summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Schaefer <joes@apache.org>2012-11-26 02:32:20 +0000
committerJoe Schaefer <joes@apache.org>2012-11-26 02:32:20 +0000
commit59ee09f905e86724a2ba5cdccab9210d16686820 (patch)
treeb31b34097ade50a060d0d427bce5f8ccd4ad6a6f
parent8f4457b94f439f3b8a4a8611f98daa411b615e9e (diff)
mv ooo to top-level
-rw-r--r--accessibility/source/extended/accessibletablistboxtable.cxx9
-rw-r--r--accessibility/source/extended/listboxaccessible.cxx12
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx10
-rw-r--r--accessibility/source/standard/accessiblemenubasecomponent.cxx10
-rw-r--r--accessibility/source/standard/vclxaccessiblemenubar.cxx13
-rw-r--r--automation/source/app/testbasi.cxx2
-rw-r--r--automation/source/app/testbasi.hxx1
-rw-r--r--automation/source/miniapp/testapp.cxx2
-rw-r--r--automation/source/server/recorder.cxx14
-rw-r--r--automation/source/testtool/cmdstrm.cxx8
-rw-r--r--automation/source/testtool/comm_bas.cxx2
-rw-r--r--automation/source/testtool/cretstrm.cxx12
-rw-r--r--automation/source/testtool/objtest.cxx10
-rw-r--r--avmedia/inc/avmedia/mediaitem.hxx6
-rw-r--r--avmedia/source/framework/mediaitem.cxx3
-rw-r--r--avmedia/source/framework/mediatoolbox.cxx2
-rw-r--r--basctl/source/accessibility/accessibledialogcontrolshape.cxx7
-rw-r--r--basctl/source/accessibility/accessibledialogwindow.cxx55
-rw-r--r--basctl/source/basicide/basdoc.cxx1
-rw-r--r--basctl/source/basicide/basdoc.hxx2
-rw-r--r--basctl/source/basicide/basicbox.cxx11
-rw-r--r--basctl/source/basicide/baside2.cxx6
-rw-r--r--basctl/source/basicide/baside2.hxx2
-rw-r--r--basctl/source/basicide/baside2b.cxx47
-rw-r--r--basctl/source/basicide/baside3.cxx35
-rw-r--r--basctl/source/basicide/basides1.cxx81
-rw-r--r--basctl/source/basicide/basides2.cxx34
-rw-r--r--basctl/source/basicide/basides3.cxx8
-rw-r--r--basctl/source/basicide/basidesh.cxx15
-rw-r--r--basctl/source/basicide/basobj3.cxx8
-rw-r--r--basctl/source/basicide/bastype3.cxx6
-rw-r--r--basctl/source/basicide/bastypes.cxx13
-rw-r--r--basctl/source/basicide/localizationmgr.cxx6
-rw-r--r--basctl/source/basicide/tbxctl.cxx2
-rw-r--r--basctl/source/dlged/dlged.cxx214
-rw-r--r--basctl/source/dlged/dlgedfac.cxx183
-rw-r--r--basctl/source/dlged/dlgedfunc.cxx287
-rw-r--r--basctl/source/dlged/dlgedmod.cxx8
-rw-r--r--basctl/source/dlged/dlgedobj.cxx246
-rw-r--r--basctl/source/dlged/dlgedpage.cxx56
-rw-r--r--basctl/source/dlged/dlgedview.cxx74
-rw-r--r--basctl/source/dlged/propbrw.cxx41
-rw-r--r--basctl/source/inc/baside3.hxx1
-rw-r--r--basctl/source/inc/basidesh.hxx3
-rw-r--r--basctl/source/inc/bastypes.hxx1
-rw-r--r--basctl/source/inc/dlged.hxx1
-rw-r--r--basctl/source/inc/dlgedfac.hxx1
-rw-r--r--basctl/source/inc/dlgedfunc.hxx4
-rw-r--r--basctl/source/inc/dlgedmod.hxx6
-rw-r--r--basctl/source/inc/dlgedobj.hxx51
-rw-r--r--basctl/source/inc/dlgedpage.hxx15
-rw-r--r--basctl/source/inc/dlgedview.hxx12
-rw-r--r--basctl/source/inc/propbrw.hxx4
-rw-r--r--basctl/source/inc/sbxitem.hxx3
-rw-r--r--basctl/util/makefile.mk1
-rw-r--r--basegfx/inc/basegfx/matrix/b2dhommatrix.hxx2
-rw-r--r--basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx203
-rw-r--r--basegfx/inc/basegfx/matrix/b3dhommatrix.hxx3
-rw-r--r--basegfx/inc/basegfx/matrix/b3dhommatrixtools.hxx49
-rw-r--r--basegfx/inc/basegfx/numeric/ftools.hxx1
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolygon.hxx13
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolygontools.hxx22
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx14
-rw-r--r--basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx18
-rw-r--r--basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx11
-rw-r--r--basegfx/inc/basegfx/range/b1drange.hxx5
-rw-r--r--basegfx/inc/basegfx/range/b1irange.hxx5
-rw-r--r--basegfx/inc/basegfx/range/b2drange.hxx27
-rw-r--r--basegfx/inc/basegfx/range/b2irange.hxx7
-rw-r--r--basegfx/inc/basegfx/range/b3drange.hxx28
-rw-r--r--basegfx/inc/basegfx/range/b3irange.hxx8
-rw-r--r--basegfx/inc/basegfx/range/basicrange.hxx22
-rw-r--r--basegfx/prj/d.lst1
-rw-r--r--basegfx/source/inc/PolygonPoint.hxx2
-rw-r--r--basegfx/source/inc/polygontemplate.hxx2
-rw-r--r--basegfx/source/matrix/b2dhommatrix.cxx21
-rw-r--r--basegfx/source/matrix/b2dhommatrixtools.cxx107
-rw-r--r--basegfx/source/matrix/b3dhommatrix.cxx15
-rw-r--r--basegfx/source/matrix/b3dhommatrixtools.cxx84
-rw-r--r--basegfx/source/matrix/makefile.mk3
-rw-r--r--basegfx/source/polygon/b2dlinegeometry.cxx2
-rw-r--r--basegfx/source/polygon/b2dpolygon.cxx14
-rw-r--r--basegfx/source/polygon/b2dpolygontools.cxx365
-rw-r--r--basegfx/source/polygon/b2dpolypolygon.cxx26
-rw-r--r--basegfx/source/polygon/b2dpolypolygoncutter.cxx4
-rw-r--r--basegfx/source/polygon/b2dpolypolygontools.cxx132
-rw-r--r--basegfx/source/polygon/b2dsvgpolypolygon.cxx3
-rw-r--r--basegfx/source/polygon/b3dpolygon.cxx4
-rw-r--r--basegfx/source/polygon/b3dpolygonclipper.cxx4
-rw-r--r--basegfx/source/polygon/b3dpolypolygontools.cxx125
-rw-r--r--basegfx/source/range/b2drange.cxx19
-rw-r--r--basegfx/source/range/b3drange.cxx18
-rw-r--r--basic/inc/basic/basmgr.hxx1
-rw-r--r--basic/inc/basic/mybasic.hxx1
-rw-r--r--basic/inc/basic/sbmeth.hxx2
-rw-r--r--basic/inc/basic/sbmod.hxx2
-rw-r--r--basic/inc/basic/sbobjmod.hxx2
-rw-r--r--basic/inc/basic/sbprop.hxx2
-rw-r--r--basic/inc/basic/sbstar.hxx1
-rw-r--r--basic/inc/basic/sbstdobj.hxx6
-rw-r--r--basic/inc/basic/sbx.hxx5
-rw-r--r--basic/inc/basic/sbxcore.hxx3
-rw-r--r--basic/inc/basic/sbxmeth.hxx1
-rw-r--r--basic/inc/basic/sbxobj.hxx1
-rw-r--r--basic/inc/basic/sbxprop.hxx1
-rw-r--r--basic/inc/basic/sbxvar.hxx2
-rw-r--r--basic/inc/basic/testtool.hxx3
-rw-r--r--basic/inc/pch/precompiled_basic.hxx1
-rw-r--r--basic/source/app/app.cxx72
-rw-r--r--basic/source/app/appbased.cxx3
-rw-r--r--basic/source/app/appbased.hxx1
-rw-r--r--basic/source/app/appedit.cxx1
-rw-r--r--basic/source/app/appedit.hxx1
-rw-r--r--basic/source/app/apperror.cxx1
-rw-r--r--basic/source/app/apperror.hxx1
-rw-r--r--basic/source/app/appwin.cxx1
-rw-r--r--basic/source/app/appwin.hxx1
-rw-r--r--basic/source/app/msgedit.cxx7
-rw-r--r--basic/source/app/mybasic.cxx2
-rw-r--r--basic/source/app/processw.cxx2
-rw-r--r--basic/source/app/textedit.cxx82
-rw-r--r--basic/source/basmgr/basmgr.cxx37
-rw-r--r--basic/source/classes/disas.cxx4
-rw-r--r--basic/source/classes/eventatt.cxx70
-rw-r--r--basic/source/classes/sb.cxx57
-rw-r--r--basic/source/classes/sbunoobj.cxx145
-rw-r--r--basic/source/classes/sbxmod.cxx102
-rw-r--r--basic/source/comp/parser.cxx2
-rw-r--r--basic/source/comp/sbcomp.cxx19
-rw-r--r--basic/source/inc/sbjsmeth.hxx1
-rw-r--r--basic/source/inc/sbjsmod.hxx1
-rw-r--r--basic/source/inc/sbunoobj.hxx13
-rw-r--r--basic/source/runtime/dllmgr.cxx12
-rw-r--r--basic/source/runtime/methods.cxx16
-rw-r--r--basic/source/runtime/methods1.cxx26
-rw-r--r--basic/source/runtime/runtime.cxx15
-rw-r--r--basic/source/runtime/stdobj.cxx2
-rw-r--r--basic/source/runtime/stdobj1.cxx14
-rw-r--r--basic/source/runtime/step0.cxx38
-rw-r--r--basic/source/runtime/step1.cxx10
-rw-r--r--basic/source/runtime/step2.cxx47
-rw-r--r--basic/source/sample/collelem.cxx2
-rw-r--r--basic/source/sample/object.cxx2
-rw-r--r--basic/source/sbx/sbxarray.cxx3
-rw-r--r--basic/source/sbx/sbxbase.cxx2
-rw-r--r--basic/source/sbx/sbxbool.cxx4
-rw-r--r--basic/source/sbx/sbxbyte.cxx4
-rw-r--r--basic/source/sbx/sbxchar.cxx4
-rw-r--r--basic/source/sbx/sbxcoll.cxx9
-rw-r--r--basic/source/sbx/sbxcurr.cxx4
-rw-r--r--basic/source/sbx/sbxdate.cxx4
-rw-r--r--basic/source/sbx/sbxdbl.cxx4
-rw-r--r--basic/source/sbx/sbxdec.cxx4
-rw-r--r--basic/source/sbx/sbxexec.cxx4
-rw-r--r--basic/source/sbx/sbxint.cxx12
-rw-r--r--basic/source/sbx/sbxlng.cxx4
-rw-r--r--basic/source/sbx/sbxobj.cxx44
-rw-r--r--basic/source/sbx/sbxscan.cxx2
-rw-r--r--basic/source/sbx/sbxsng.cxx4
-rw-r--r--basic/source/sbx/sbxstr.cxx6
-rw-r--r--basic/source/sbx/sbxuint.cxx4
-rw-r--r--basic/source/sbx/sbxulng.cxx4
-rwxr-xr-xbasic/source/sbx/sbxvalue.cxx26
-rw-r--r--basic/source/sbx/sbxvar.cxx9
-rw-r--r--canvas/source/tools/canvascustomspritehelper.cxx3
-rwxr-xr-xcanvas/source/tools/canvastools.cxx3
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx4
-rwxr-xr-xcanvas/source/vcl/spritehelper.cxx3
-rwxr-xr-xchart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx98
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.cxx7
-rw-r--r--chart2/source/controller/drawinglayer/DrawViewWrapper.cxx74
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx22
-rw-r--r--chart2/source/controller/inc/DrawViewWrapper.hxx14
-rw-r--r--chart2/source/controller/main/ChartController.cxx4
-rw-r--r--chart2/source/controller/main/ChartController.hxx4
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx13
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx11
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx76
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx8
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx4
-rw-r--r--chart2/source/controller/main/DragMethod_PieSegment.cxx20
-rw-r--r--chart2/source/controller/main/DragMethod_PieSegment.hxx4
-rw-r--r--chart2/source/controller/main/DragMethod_RotateDiagram.cxx27
-rw-r--r--chart2/source/controller/main/DragMethod_RotateDiagram.hxx6
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx125
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.hxx3
-rw-r--r--chart2/source/controller/main/SelectionHelper.cxx39
-rw-r--r--chart2/source/controller/main/SelectionHelper.hxx6
-rw-r--r--chart2/source/controller/main/ShapeController.cxx30
-rw-r--r--chart2/source/tools/BaseGFXHelper.cxx2
-rw-r--r--chart2/source/view/diagram/VDiagram.cxx4
-rw-r--r--chart2/source/view/main/ChartView.cxx17
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx19
-rw-r--r--connectivity/source/drivers/dbase/DCode.cxx1
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx3
-rw-r--r--connectivity/source/drivers/dbase/DIndexIter.cxx10
-rw-r--r--connectivity/source/drivers/dbase/dindexnode.cxx5
-rw-r--r--connectivity/source/drivers/file/FNoException.cxx2
-rw-r--r--connectivity/source/drivers/file/fanalyzer.cxx18
-rw-r--r--connectivity/source/drivers/file/fcode.cxx51
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx8
-rw-r--r--connectivity/source/inc/dbase/DCode.hxx1
-rw-r--r--connectivity/source/inc/file/fanalyzer.hxx1
-rw-r--r--connectivity/source/inc/file/fcode.hxx37
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx17
-rw-r--r--cppcanvas/source/mtfrenderer/mtftools.cxx6
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx9
-rw-r--r--cppcanvas/source/mtfrenderer/transparencygroupaction.cxx3
-rw-r--r--cui/inc/pch/precompiled_cui.hxx1
-rw-r--r--cui/source/customize/acccfg.cxx6
-rw-r--r--cui/source/dialogs/cuicharmap.cxx14
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx2
-rw-r--r--cui/source/dialogs/hldocntp.cxx2
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx4
-rw-r--r--cui/source/dialogs/iconcdlg.cxx4
-rw-r--r--cui/source/dialogs/scriptdlg.cxx4
-rw-r--r--cui/source/dialogs/srchxtra.cxx9
-rw-r--r--cui/source/dialogs/zoom.cxx10
-rw-r--r--cui/source/factory/dlgfact.cxx2
-rw-r--r--cui/source/inc/autocdlg.hxx2
-rw-r--r--cui/source/inc/grfpage.hxx2
-rw-r--r--cui/source/inc/page.hxx6
-rw-r--r--cui/source/options/cfgchart.cxx2
-rw-r--r--cui/source/options/cfgchart.hxx3
-rw-r--r--cui/source/options/connpoolsettings.cxx4
-rw-r--r--cui/source/options/connpoolsettings.hxx2
-rw-r--r--cui/source/options/dbregistersettings.cxx4
-rw-r--r--cui/source/options/dbregistersettings.hxx2
-rw-r--r--cui/source/options/fontsubs.cxx4
-rw-r--r--cui/source/options/fontsubs.hxx4
-rw-r--r--cui/source/options/optaccessibility.cxx2
-rw-r--r--cui/source/options/optdict.cxx8
-rw-r--r--cui/source/options/optfltr.cxx2
-rw-r--r--cui/source/options/optfltr.hxx2
-rw-r--r--cui/source/options/optgdlg.cxx4
-rw-r--r--cui/source/options/optinet2.cxx2
-rw-r--r--cui/source/options/optjsearch.cxx3
-rw-r--r--cui/source/options/optlingu.cxx20
-rw-r--r--cui/source/options/optpath.cxx4
-rw-r--r--cui/source/tabpages/autocdlg.cxx10
-rw-r--r--cui/source/tabpages/backgrnd.cxx10
-rw-r--r--cui/source/tabpages/border.cxx4
-rw-r--r--cui/source/tabpages/chardlg.cxx152
-rw-r--r--cui/source/tabpages/connect.cxx6
-rw-r--r--cui/source/tabpages/grfpage.cxx4
-rw-r--r--cui/source/tabpages/labdlg.cxx23
-rw-r--r--cui/source/tabpages/measure.cxx78
-rw-r--r--cui/source/tabpages/numfmt.cxx4
-rw-r--r--cui/source/tabpages/numpages.cxx20
-rw-r--r--cui/source/tabpages/page.cxx22
-rw-r--r--cui/source/tabpages/paragrph.cxx41
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx64
-rw-r--r--cui/source/tabpages/swpossizetabpage.hxx6
-rw-r--r--cui/source/tabpages/tabarea.cxx1
-rw-r--r--cui/source/tabpages/tabline.cxx34
-rw-r--r--cui/source/tabpages/tabstpge.cxx2
-rw-r--r--cui/source/tabpages/textanim.cxx12
-rw-r--r--cui/source/tabpages/textattr.cxx56
-rw-r--r--cui/source/tabpages/tparea.cxx28
-rw-r--r--cui/source/tabpages/tpline.cxx101
-rw-r--r--cui/source/tabpages/tplneend.cxx18
-rw-r--r--cui/source/tabpages/tpshadow.cxx46
-rw-r--r--cui/source/tabpages/transfrm.cxx118
-rw-r--r--dbaccess/source/filter/xml/xmlColumn.cxx14
-rw-r--r--dbaccess/source/filter/xml/xmlStyleImport.cxx10
-rw-r--r--dbaccess/source/filter/xml/xmlStyleImport.hxx6
-rw-r--r--dbaccess/source/filter/xml/xmlTable.cxx4
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx2
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx4
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx30
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx10
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx4
-rw-r--r--dbaccess/source/ui/dlg/dbwiz.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dsnItem.hxx1
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/optionalboolitem.cxx4
-rw-r--r--dbaccess/source/ui/dlg/optionalboolitem.hxx1
-rw-r--r--dbaccess/source/ui/inc/GeneralUndo.hxx1
-rw-r--r--dbaccess/source/ui/inc/JoinTableView.hxx3
-rw-r--r--dbaccess/source/ui/inc/TableConnection.hxx3
-rw-r--r--dbaccess/source/ui/inc/TableConnectionData.hxx3
-rw-r--r--dbaccess/source/ui/inc/TableWindow.hxx1
-rw-r--r--dbaccess/source/ui/inc/propertysetitem.hxx1
-rw-r--r--dbaccess/source/ui/inc/stringlistitem.hxx1
-rw-r--r--dbaccess/source/ui/misc/propertysetitem.cxx4
-rw-r--r--dbaccess/source/ui/misc/stringlistitem.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/QTableConnectionData.hxx3
-rw-r--r--dbaccess/source/ui/querydesign/QTableWindow.hxx3
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx8
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.hxx1
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.cxx10
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.hxx8
-rw-r--r--desktop/source/app/officeipcthread.cxx1
-rw-r--r--desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx6
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx6
-rw-r--r--desktop/source/migration/services/wordbookmigration.cxx1
-rw-r--r--desktop/source/splash/services_spl.cxx1
-rw-r--r--drawinglayer/Library_drawinglayer.mk3
-rw-r--r--drawinglayer/Package_inc.mk1
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx5
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx16
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx7
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/cropprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx9
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx5
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx3
-rwxr-xr-xdrawinglayer/inc/drawinglayer/primitive2d/fillgraphicprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx3
-rwxr-xr-xdrawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx5
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/patternfillprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx15
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx24
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx5
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx22
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx13
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx44
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx9
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx16
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx5
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx15
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx15
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx5
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx19
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx17
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/hairlineextractor2d.hxx67
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx22
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx6
-rwxr-xr-xdrawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx5
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/texture/texture3d.hxx2
-rw-r--r--drawinglayer/source/attribute/fillhatchattribute.cxx2
-rw-r--r--drawinglayer/source/attribute/fontattribute.cxx14
-rw-r--r--drawinglayer/source/attribute/linestartendattribute.cxx2
-rw-r--r--drawinglayer/source/attribute/sdrlightattribute3d.cxx2
-rw-r--r--drawinglayer/source/attribute/sdrobjectattribute3d.cxx10
-rw-r--r--drawinglayer/source/attribute/sdrsceneattribute3d.cxx2
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx5
-rw-r--r--drawinglayer/source/primitive2d/animatedprimitive2d.cxx17
-rw-r--r--drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/baseprimitive2d.cxx68
-rw-r--r--drawinglayer/source/primitive2d/bitmapprimitive2d.cxx17
-rw-r--r--drawinglayer/source/primitive2d/borderlineprimitive2d.cxx23
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx56
-rw-r--r--drawinglayer/source/primitive2d/cropprimitive2d.cxx16
-rw-r--r--drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx17
-rw-r--r--drawinglayer/source/primitive2d/epsprimitive2d.cxx19
-rw-r--r--drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx14
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitive2d.cxx18
-rw-r--r--drawinglayer/source/primitive2d/gridprimitive2d.cxx33
-rw-r--r--drawinglayer/source/primitive2d/groupprimitive2d.cxx16
-rw-r--r--drawinglayer/source/primitive2d/helplineprimitive2d.cxx17
-rw-r--r--drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/maskprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/mediaprimitive2d.cxx26
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx24
-rw-r--r--drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx12
-rwxr-xr-xdrawinglayer/source/primitive2d/objectinfoprimitive2d.cxx14
-rw-r--r--drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx31
-rw-r--r--drawinglayer/source/primitive2d/patternfillprimitive2d.cxx14
-rw-r--r--drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/polygonprimitive2d.cxx68
-rw-r--r--drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx105
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx20
-rw-r--r--drawinglayer/source/primitive2d/shadowprimitive2d.cxx13
-rw-r--r--drawinglayer/source/primitive2d/svggradientprimitive2d.cxx93
-rw-r--r--drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx26
-rw-r--r--drawinglayer/source/primitive2d/texteffectprimitive2d.cxx21
-rw-r--r--drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx19
-rw-r--r--drawinglayer/source/primitive2d/textlineprimitive2d.cxx29
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx49
-rw-r--r--drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx57
-rw-r--r--drawinglayer/source/primitive2d/transformprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/transparenceprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx12
-rw-r--r--drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx14
-rw-r--r--drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx18
-rw-r--r--drawinglayer/source/primitive3d/baseprimitive3d.cxx68
-rw-r--r--drawinglayer/source/primitive3d/groupprimitive3d.cxx16
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx12
-rw-r--r--drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx12
-rw-r--r--drawinglayer/source/primitive3d/polygonprimitive3d.cxx27
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx16
-rw-r--r--drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx14
-rw-r--r--drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx12
-rw-r--r--drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx2
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx21
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx23
-rw-r--r--drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx12
-rw-r--r--drawinglayer/source/primitive3d/sdrprimitive3d.cxx18
-rw-r--r--drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx22
-rw-r--r--drawinglayer/source/primitive3d/shadowprimitive3d.cxx15
-rw-r--r--drawinglayer/source/primitive3d/textureprimitive3d.cxx54
-rw-r--r--drawinglayer/source/primitive3d/transformprimitive3d.cxx12
-rw-r--r--drawinglayer/source/processor2d/baseprocessor2d.cxx8
-rw-r--r--drawinglayer/source/processor2d/contourextractor2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/hairlineextractor2d.cxx310
-rw-r--r--drawinglayer/source/processor2d/hittestprocessor2d.cxx36
-rw-r--r--drawinglayer/source/processor2d/linegeometryextractor2d.cxx4
-rwxr-xr-xdrawinglayer/source/processor2d/objectinfoextractor2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/textaspolygonextractor2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclhelperbitmaprender.cxx15
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx66
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx11
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx14
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx12
-rwxr-xr-xediteng/Library_editeng.mk4
-rw-r--r--editeng/Package_inc.mk1
-rw-r--r--editeng/inc/editeng/adjitem.hxx4
-rw-r--r--editeng/inc/editeng/akrnitem.hxx6
-rw-r--r--editeng/inc/editeng/blnkitem.hxx5
-rw-r--r--editeng/inc/editeng/bolnitem.hxx9
-rw-r--r--editeng/inc/editeng/boxitem.hxx18
-rw-r--r--editeng/inc/editeng/brkitem.hxx6
-rw-r--r--editeng/inc/editeng/brshitem.hxx5
-rw-r--r--editeng/inc/editeng/bulitem.hxx2
-rw-r--r--editeng/inc/editeng/charhiddenitem.hxx2
-rw-r--r--editeng/inc/editeng/charreliefitem.hxx6
-rw-r--r--editeng/inc/editeng/charrotateitem.hxx9
-rw-r--r--editeng/inc/editeng/charscaleitem.hxx6
-rw-r--r--editeng/inc/editeng/cmapitem.hxx7
-rw-r--r--editeng/inc/editeng/cntritem.hxx6
-rw-r--r--editeng/inc/editeng/colritem.hxx5
-rw-r--r--editeng/inc/editeng/crsditem.hxx6
-rw-r--r--editeng/inc/editeng/cscoitem.hxx2
-rw-r--r--editeng/inc/editeng/editeng.hxx6
-rw-r--r--editeng/inc/editeng/editobj.hxx3
-rw-r--r--editeng/inc/editeng/editund2.hxx1
-rw-r--r--editeng/inc/editeng/editview.hxx2
-rw-r--r--editeng/inc/editeng/emphitem.hxx6
-rw-r--r--editeng/inc/editeng/escpitem.hxx5
-rw-r--r--editeng/inc/editeng/fhgtitem.hxx12
-rw-r--r--editeng/inc/editeng/flditem.hxx2
-rw-r--r--editeng/inc/editeng/flstitem.hxx2
-rw-r--r--editeng/inc/editeng/fontitem.hxx5
-rw-r--r--editeng/inc/editeng/forbiddenruleitem.hxx2
-rw-r--r--editeng/inc/editeng/frmdiritem.hxx2
-rw-r--r--editeng/inc/editeng/fwdtitem.hxx6
-rw-r--r--editeng/inc/editeng/hngpnctitem.hxx2
-rw-r--r--editeng/inc/editeng/hyznitem.hxx7
-rw-r--r--editeng/inc/editeng/keepitem.hxx7
-rw-r--r--editeng/inc/editeng/kernitem.hxx9
-rw-r--r--editeng/inc/editeng/langitem.hxx6
-rw-r--r--editeng/inc/editeng/lcolitem.hxx3
-rw-r--r--editeng/inc/editeng/lrspitem.hxx11
-rw-r--r--editeng/inc/editeng/lspcitem.hxx4
-rw-r--r--editeng/inc/editeng/nhypitem.hxx2
-rw-r--r--editeng/inc/editeng/nlbkitem.hxx2
-rw-r--r--editeng/inc/editeng/opaqitem.hxx2
-rw-r--r--editeng/inc/editeng/optitems.hxx4
-rw-r--r--editeng/inc/editeng/orphitem.hxx5
-rw-r--r--editeng/inc/editeng/outliner.hxx42
-rw-r--r--editeng/inc/editeng/paravertalignitem.hxx7
-rw-r--r--editeng/inc/editeng/pathtextportion.hxx77
-rw-r--r--editeng/inc/editeng/pbinitem.hxx5
-rw-r--r--editeng/inc/editeng/pgrditem.hxx2
-rw-r--r--editeng/inc/editeng/pmdlitem.hxx2
-rw-r--r--editeng/inc/editeng/postitem.hxx6
-rw-r--r--editeng/inc/editeng/prntitem.hxx2
-rw-r--r--editeng/inc/editeng/protitem.hxx5
-rw-r--r--editeng/inc/editeng/prszitem.hxx2
-rw-r--r--editeng/inc/editeng/scriptspaceitem.hxx2
-rw-r--r--editeng/inc/editeng/scripttypeitem.hxx4
-rw-r--r--editeng/inc/editeng/shaditem.hxx9
-rw-r--r--editeng/inc/editeng/shdditem.hxx6
-rw-r--r--editeng/inc/editeng/sizeitem.hxx9
-rw-r--r--editeng/inc/editeng/spltitem.hxx8
-rw-r--r--editeng/inc/editeng/svxacorr.hxx3
-rw-r--r--editeng/inc/editeng/tstpitem.hxx5
-rw-r--r--editeng/inc/editeng/twolinesitem.hxx1
-rw-r--r--editeng/inc/editeng/udlnitem.hxx10
-rw-r--r--editeng/inc/editeng/ulspitem.hxx9
-rw-r--r--editeng/inc/editeng/unoedhlp.hxx1
-rw-r--r--editeng/inc/editeng/unoipset.hxx1
-rw-r--r--editeng/inc/editeng/unoviwou.hxx1
-rw-r--r--editeng/inc/editeng/wghtitem.hxx6
-rw-r--r--editeng/inc/editeng/widwitem.hxx5
-rw-r--r--editeng/inc/editeng/writingmodeitem.hxx2
-rw-r--r--editeng/inc/editeng/wrlmitem.hxx6
-rw-r--r--editeng/inc/editeng/xmlcnitm.hxx2
-rw-r--r--editeng/inc/pch/precompiled_editeng.hxx1
-rw-r--r--editeng/prj/build.lst2
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx6
-rw-r--r--editeng/source/editeng/editdoc2.cxx16
-rw-r--r--editeng/source/editeng/editeng.cxx6
-rw-r--r--editeng/source/editeng/editobj.cxx8
-rw-r--r--editeng/source/editeng/editobj2.hxx2
-rw-r--r--editeng/source/editeng/editundo.cxx16
-rw-r--r--editeng/source/editeng/editundo.hxx13
-rw-r--r--editeng/source/editeng/editview.cxx2
-rw-r--r--editeng/source/editeng/impedit.cxx3
-rw-r--r--editeng/source/editeng/impedit.hxx4
-rw-r--r--editeng/source/editeng/impedit2.cxx9
-rw-r--r--editeng/source/editeng/impedit3.cxx22
-rw-r--r--editeng/source/editeng/impedit4.cxx4
-rw-r--r--editeng/source/editeng/impedit5.cxx12
-rw-r--r--editeng/source/editeng/textconv.cxx2
-rw-r--r--editeng/source/items/bulitem.cxx6
-rw-r--r--editeng/source/items/charhiddenitem.cxx2
-rw-r--r--editeng/source/items/flditem.cxx32
-rw-r--r--editeng/source/items/frmitems.cxx110
-rw-r--r--editeng/source/items/itemtype.cxx4
-rw-r--r--editeng/source/items/optitems.cxx5
-rw-r--r--editeng/source/items/paraitem.cxx52
-rw-r--r--editeng/source/items/textitem.cxx104
-rw-r--r--editeng/source/items/writingmodeitem.cxx2
-rw-r--r--editeng/source/items/xmlcnitm.cxx5
-rw-r--r--editeng/source/misc/svxacorr.cxx1
-rw-r--r--editeng/source/misc/unolingu.cxx4
-rw-r--r--editeng/source/outliner/outlin2.cxx4
-rw-r--r--editeng/source/outliner/outlinerdecomposition.cxx604
-rw-r--r--editeng/source/outliner/outlvw.cxx2
-rw-r--r--editeng/source/outliner/pathtextportion.cxx99
-rw-r--r--editeng/source/outliner/pathtextportioncreator.cxx82
-rw-r--r--editeng/source/uno/unoedhlp.cxx2
-rw-r--r--editeng/source/uno/unofield.cxx68
-rw-r--r--extensions/source/preload/oemwiz.cxx6
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx2
-rw-r--r--extensions/source/scanner/grid.cxx3
-rw-r--r--filter/inc/filter/msfilter/dffrecordheader.hxx2
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx467
-rw-r--r--filter/inc/filter/msfilter/msdffimp.hxx79
-rw-r--r--filter/inc/filter/msfilter/svdfppt.hxx10
-rw-r--r--filter/source/filtertracer/filtertracer.cxx2
-rw-r--r--filter/source/msfilter/dffpropset.cxx1
-rw-r--r--filter/source/msfilter/escherex.cxx942
-rw-r--r--filter/source/msfilter/eschesdo.cxx809
-rw-r--r--filter/source/msfilter/eschesdo.hxx66
-rw-r--r--filter/source/msfilter/msdffimp.cxx859
-rw-r--r--filter/source/msfilter/svdfppt.cxx281
-rw-r--r--filter/source/pdf/pdfexport.cxx4
-rw-r--r--filter/source/svg/svgexport.cxx29
-rw-r--r--filter/source/xsltdialog/xmlfileview.cxx13
-rw-r--r--forms/source/richtext/richtextunowrapper.cxx3
-rw-r--r--forms/source/richtext/rtattributehandler.cxx21
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx2
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx2
-rw-r--r--framework/source/services/license.cxx6
-rw-r--r--framework/source/services/tabwindowservice.cxx7
-rw-r--r--framework/source/uielement/spinfieldtoolbarcontroller.cxx3
-rw-r--r--i18npool/source/characterclassification/cclass_unicode.cxx2
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx15
-rw-r--r--i18npool/source/textconversion/textconversion_ko.cxx9
-rw-r--r--i18npool/source/textconversion/textconversion_zh.cxx6
-rw-r--r--i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/transliteration_Ignore.cxx2
-rw-r--r--i18npool/source/transliteration/transliteration_Numeric.cxx4
-rw-r--r--i18npool/source/transliteration/transliteration_OneToOne.cxx2
-rw-r--r--i18npool/source/transliteration/transliteration_body.cxx8
-rw-r--r--i18nutil/inc/i18nutil/x_rtl_ustring.h23
-rw-r--r--i18nutil/source/utility/widthfolding.cxx8
-rw-r--r--idl/inc/basobj.hxx12
-rw-r--r--idl/source/objects/basobj.cxx3
-rw-r--r--idl/source/objects/object.cxx3
-rw-r--r--idl/source/objects/slot.cxx12
-rw-r--r--idl/source/objects/types.cxx18
-rw-r--r--idl/source/prj/svidl.cxx1
-rw-r--r--l10ntools/inc/export.hxx1
-rw-r--r--offapi/com/sun/star/drawing/EnhancedCustomShapeGeometry.idl4
-rw-r--r--offapi/com/sun/star/text/AutoTextGroup.idl35
-rw-r--r--offapi/com/sun/star/text/XAutoTextContainer.idl99
-rw-r--r--oox/inc/oox/drawingml/customshapeproperties.hxx12
-rw-r--r--oox/inc/oox/drawingml/shape.hxx8
-rw-r--r--oox/inc/oox/export/vmlexport.hxx4
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx15
-rw-r--r--oox/source/drawingml/shape.cxx34
-rw-r--r--oox/source/drawingml/transform2dcontext.cxx3
-rw-r--r--oox/source/export/shapes.cxx6
-rw-r--r--oox/source/token/properties.txt2
-rw-r--r--padmin/source/cmddlg.cxx3
-rw-r--r--reportdesign/inc/ReportDefinition.hxx7
-rw-r--r--reportdesign/inc/RptModel.hxx4
-rw-r--r--reportdesign/inc/RptObject.hxx91
-rw-r--r--reportdesign/inc/RptPage.hxx22
-rw-r--r--reportdesign/inc/UndoActions.hxx1
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx17
-rw-r--r--reportdesign/source/core/api/Section.cxx8
-rw-r--r--reportdesign/source/core/api/Shape.cxx2
-rw-r--r--reportdesign/source/core/inc/ReportUndoFactory.hxx18
-rw-r--r--reportdesign/source/core/sdr/ReportDrawPage.cxx30
-rw-r--r--reportdesign/source/core/sdr/ReportUndoFactory.cxx49
-rw-r--r--reportdesign/source/core/sdr/RptModel.cxx7
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx523
-rw-r--r--reportdesign/source/core/sdr/RptObjectListener.cxx4
-rw-r--r--reportdesign/source/core/sdr/RptPage.cxx88
-rw-r--r--reportdesign/source/core/sdr/UndoActions.cxx16
-rw-r--r--reportdesign/source/core/sdr/UndoEnv.cxx8
-rw-r--r--reportdesign/source/filter/xml/xmlCell.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlColumn.cxx4
-rw-r--r--reportdesign/source/filter/xml/xmlHelper.cxx6
-rw-r--r--reportdesign/source/filter/xml/xmlRow.cxx4
-rw-r--r--reportdesign/source/filter/xml/xmlStyleImport.cxx9
-rw-r--r--reportdesign/source/filter/xml/xmlStyleImport.hxx6
-rw-r--r--reportdesign/source/filter/xml/xmlTable.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.cxx10
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.hxx2
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx2
-rw-r--r--reportdesign/source/ui/inc/RptUndo.hxx4
-rw-r--r--reportdesign/source/ui/inc/SectionView.hxx8
-rw-r--r--reportdesign/source/ui/inc/UITools.hxx4
-rw-r--r--reportdesign/source/ui/inc/ViewsWindow.hxx17
-rw-r--r--reportdesign/source/ui/inc/dlgedfac.hxx5
-rw-r--r--reportdesign/source/ui/inc/dlgedfunc.hxx6
-rw-r--r--reportdesign/source/ui/inc/propbrw.hxx4
-rw-r--r--reportdesign/source/ui/misc/ColorListener.cxx6
-rw-r--r--reportdesign/source/ui/misc/RptUndo.cxx12
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx105
-rw-r--r--reportdesign/source/ui/report/FixedTextColor.cxx2
-rw-r--r--reportdesign/source/ui/report/FormattedFieldBeautifier.cxx3
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx61
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx179
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx151
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx6
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx538
-rw-r--r--reportdesign/source/ui/report/dlgedfac.cxx84
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx473
-rw-r--r--reportdesign/source/ui/report/propbrw.cxx26
-rw-r--r--reportdesign/util/makefile.mk2
-rw-r--r--sc/inc/arealink.hxx1
-rw-r--r--sc/inc/attrib.hxx17
-rw-r--r--sc/inc/brdcst.hxx3
-rw-r--r--sc/inc/docoptio.hxx2
-rw-r--r--sc/inc/document.hxx7
-rw-r--r--sc/inc/docuno.hxx3
-rw-r--r--sc/inc/drawpage.hxx10
-rw-r--r--sc/inc/drwlayer.hxx20
-rw-r--r--sc/inc/editsrc.hxx1
-rw-r--r--sc/inc/hints.hxx9
-rw-r--r--sc/inc/pch/precompiled_sc.hxx3
-rw-r--r--sc/inc/postit.hxx10
-rw-r--r--sc/inc/printopt.hxx1
-rw-r--r--sc/inc/stlsheet.hxx2
-rw-r--r--sc/inc/tablink.hxx1
-rw-r--r--sc/inc/unoreflist.hxx1
-rw-r--r--sc/inc/userdat.hxx6
-rw-r--r--sc/inc/viewopti.hxx1
-rw-r--r--sc/source/core/data/attarray.cxx5
-rw-r--r--sc/source/core/data/attrib.cxx22
-rw-r--r--sc/source/core/data/bcaslot.cxx3
-rw-r--r--sc/source/core/data/cell.cxx8
-rw-r--r--sc/source/core/data/column3.cxx2
-rw-r--r--sc/source/core/data/compressedarray.cxx2
-rw-r--r--sc/source/core/data/documen3.cxx9
-rw-r--r--sc/source/core/data/documen5.cxx21
-rw-r--r--sc/source/core/data/documen8.cxx80
-rw-r--r--sc/source/core/data/documen9.cxx104
-rw-r--r--sc/source/core/data/document.cxx4
-rw-r--r--sc/source/core/data/drawpage.cxx40
-rw-r--r--sc/source/core/data/drwlayer.cxx470
-rw-r--r--sc/source/core/data/markarr.cxx2
-rw-r--r--sc/source/core/data/markdata.cxx2
-rw-r--r--sc/source/core/data/postit.cxx280
-rw-r--r--sc/source/core/data/stlpool.cxx2
-rw-r--r--sc/source/core/data/stlsheet.cxx7
-rw-r--r--sc/source/core/data/table1.cxx6
-rw-r--r--sc/source/core/data/table2.cxx8
-rw-r--r--sc/source/core/data/table5.cxx2
-rw-r--r--sc/source/core/data/userdat.cxx29
-rw-r--r--sc/source/core/data/validat.cxx5
-rw-r--r--sc/source/core/inc/core_pch.hxx1
-rw-r--r--sc/source/core/inc/ddelink.hxx2
-rw-r--r--sc/source/core/tool/charthelper.cxx7
-rw-r--r--sc/source/core/tool/chgtrack.cxx1
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/ddelink.cxx2
-rw-r--r--sc/source/core/tool/detfunc.cxx151
-rw-r--r--sc/source/core/tool/docoptio.cxx2
-rw-r--r--sc/source/core/tool/editutil.cxx26
-rw-r--r--sc/source/core/tool/hints.cxx10
-rw-r--r--sc/source/core/tool/interpr2.cxx5
-rw-r--r--sc/source/core/tool/interpr4.cxx6
-rw-r--r--sc/source/core/tool/lookupcache.cxx2
-rw-r--r--sc/source/core/tool/printopt.cxx4
-rw-r--r--sc/source/core/tool/viewopti.cxx67
-rw-r--r--sc/source/filter/excel/excel.cxx6
-rw-r--r--sc/source/filter/excel/excimp8.cxx6
-rw-r--r--sc/source/filter/excel/xechart.cxx33
-rw-r--r--sc/source/filter/excel/xeescher.cxx92
-rw-r--r--sc/source/filter/excel/xehelper.cxx16
-rw-r--r--sc/source/filter/excel/xeroot.cxx4
-rw-r--r--sc/source/filter/excel/xetable.cxx2
-rw-r--r--sc/source/filter/excel/xichart.cxx47
-rw-r--r--sc/source/filter/excel/xiescher.cxx325
-rw-r--r--sc/source/filter/excel/xlchart.cxx8
-rw-r--r--sc/source/filter/excel/xlescher.cxx92
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx4
-rw-r--r--sc/source/filter/html/htmlexp.cxx5
-rw-r--r--sc/source/filter/html/htmlexp2.cxx23
-rw-r--r--sc/source/filter/inc/filt_pch.hxx1
-rw-r--r--sc/source/filter/inc/xcl97esc.hxx6
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx9
-rw-r--r--sc/source/filter/inc/xechart.hxx8
-rw-r--r--sc/source/filter/inc/xeescher.hxx37
-rw-r--r--sc/source/filter/inc/xichart.hxx12
-rw-r--r--sc/source/filter/inc/xiescher.hxx48
-rw-r--r--sc/source/filter/inc/xlchart.hxx5
-rw-r--r--sc/source/filter/inc/xlescher.hxx9
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx46
-rw-r--r--sc/source/filter/starcalc/scfobj.cxx21
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx28
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx25
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.cxx4
-rw-r--r--sc/source/filter/xml/XMLTableHeaderFooterContext.hxx4
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx18
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx2
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx5
-rw-r--r--sc/source/filter/xml/xmlstyli.hxx6
-rw-r--r--sc/source/ui/Accessibility/AccessibilityHints.cxx15
-rw-r--r--sc/source/ui/Accessibility/AccessibleContextBase.cxx8
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx65
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx37
-rw-r--r--sc/source/ui/Accessibility/AccessibleEditObject.cxx3
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeader.cxx9
-rw-r--r--sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx7
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewCell.cxx7
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx7
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx9
-rw-r--r--sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx45
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx48
-rw-r--r--sc/source/ui/Accessibility/DrawModelBroadcaster.cxx3
-rw-r--r--sc/source/ui/app/client.cxx88
-rw-r--r--sc/source/ui/app/drwtrans.cxx62
-rw-r--r--sc/source/ui/app/inputhdl.cxx12
-rw-r--r--sc/source/ui/app/inputwin.cxx35
-rw-r--r--sc/source/ui/app/scmod.cxx108
-rw-r--r--sc/source/ui/app/seltrans.cxx36
-rw-r--r--sc/source/ui/app/typemap.cxx5
-rw-r--r--sc/source/ui/app/uiitems.cxx17
-rw-r--r--sc/source/ui/cctrl/tbinsert.cxx2
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx4
-rw-r--r--sc/source/ui/dbgui/validate.cxx8
-rw-r--r--sc/source/ui/docshell/arealink.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx5
-rw-r--r--sc/source/ui/docshell/docsh.cxx55
-rw-r--r--sc/source/ui/docshell/docsh3.cxx5
-rw-r--r--sc/source/ui/docshell/docsh4.cxx35
-rw-r--r--sc/source/ui/docshell/docsh6.cxx10
-rw-r--r--sc/source/ui/docshell/impex.cxx8
-rw-r--r--sc/source/ui/docshell/servobj.cxx37
-rw-r--r--sc/source/ui/docshell/tablink.cxx7
-rw-r--r--sc/source/ui/docshell/tpstat.cxx2
-rw-r--r--sc/source/ui/drawfunc/chartsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx65
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx108
-rw-r--r--sc/source/ui/drawfunc/drawsh4.cxx13
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx67
-rw-r--r--sc/source/ui/drawfunc/drformsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx47
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx29
-rw-r--r--sc/source/ui/drawfunc/fuconarc.cxx60
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx43
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx97
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx91
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx55
-rw-r--r--sc/source/ui/drawfunc/fuconuno.cxx27
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx280
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx151
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx342
-rw-r--r--sc/source/ui/drawfunc/fumark.cxx39
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx39
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx203
-rw-r--r--sc/source/ui/drawfunc/fusel2.cxx61
-rw-r--r--sc/source/ui/drawfunc/futext.cxx306
-rw-r--r--sc/source/ui/drawfunc/futext2.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx16
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx53
-rw-r--r--sc/source/ui/drawfunc/mediash.cxx22
-rw-r--r--sc/source/ui/drawfunc/oleobjsh.cxx2
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx6
-rw-r--r--sc/source/ui/formdlg/formula.cxx13
-rw-r--r--sc/source/ui/inc/AccessibilityHints.hxx4
-rw-r--r--sc/source/ui/inc/auditsh.hxx1
-rw-r--r--sc/source/ui/inc/cellsh.hxx2
-rw-r--r--sc/source/ui/inc/chartsh.hxx2
-rw-r--r--sc/source/ui/inc/docsh.hxx2
-rw-r--r--sc/source/ui/inc/drawsh.hxx5
-rw-r--r--sc/source/ui/inc/drawview.hxx13
-rw-r--r--sc/source/ui/inc/drformsh.hxx2
-rw-r--r--sc/source/ui/inc/drtxtob.hxx1
-rw-r--r--sc/source/ui/inc/editsh.hxx1
-rw-r--r--sc/source/ui/inc/formatsh.hxx2
-rw-r--r--sc/source/ui/inc/fuconarc.hxx2
-rw-r--r--sc/source/ui/inc/fuconcustomshape.hxx2
-rw-r--r--sc/source/ui/inc/fuconpol.hxx2
-rw-r--r--sc/source/ui/inc/fuconrec.hxx2
-rw-r--r--sc/source/ui/inc/fuconuno.hxx2
-rw-r--r--sc/source/ui/inc/fudraw.hxx2
-rw-r--r--sc/source/ui/inc/fumark.hxx4
-rw-r--r--sc/source/ui/inc/fupoor.hxx12
-rw-r--r--sc/source/ui/inc/fusel.hxx4
-rw-r--r--sc/source/ui/inc/futext.hxx4
-rw-r--r--sc/source/ui/inc/graphsh.hxx2
-rw-r--r--sc/source/ui/inc/gridwin.hxx2
-rw-r--r--sc/source/ui/inc/mediash.hxx2
-rw-r--r--sc/source/ui/inc/oleobjsh.hxx2
-rw-r--r--sc/source/ui/inc/pgbrksh.hxx1
-rw-r--r--sc/source/ui/inc/pivotsh.hxx1
-rw-r--r--sc/source/ui/inc/prevwsh.hxx2
-rw-r--r--sc/source/ui/inc/tabpopsh.hxx1
-rw-r--r--sc/source/ui/inc/tabview.hxx13
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx14
-rw-r--r--sc/source/ui/inc/target.hxx2
-rw-r--r--sc/source/ui/inc/ui_pch.hxx13
-rw-r--r--sc/source/ui/inc/uiitems.hxx14
-rw-r--r--sc/source/ui/inc/undobase.hxx5
-rw-r--r--sc/source/ui/inc/undoblk.hxx32
-rw-r--r--sc/source/ui/inc/undocell.hxx12
-rw-r--r--sc/source/ui/inc/undodat.hxx17
-rw-r--r--sc/source/ui/inc/undodraw.hxx1
-rw-r--r--sc/source/ui/inc/undostyl.hxx2
-rw-r--r--sc/source/ui/inc/undotab.hxx16
-rw-r--r--sc/source/ui/inc/validate.hxx1
-rw-r--r--sc/source/ui/inc/viewfunc.hxx14
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx39
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx3
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx34
-rw-r--r--sc/source/ui/navipi/navcitem.cxx6
-rw-r--r--sc/source/ui/navipi/navipi.cxx22
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx4
-rw-r--r--sc/source/ui/optdlg/opredlin.cxx2
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx3
-rw-r--r--sc/source/ui/optdlg/tpview.cxx4
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx4
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx8
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx3
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx21
-rw-r--r--sc/source/ui/undo/areasave.cxx19
-rw-r--r--sc/source/ui/undo/target.cxx1
-rw-r--r--sc/source/ui/undo/undobase.cxx14
-rw-r--r--sc/source/ui/undo/undoblk.cxx153
-rw-r--r--sc/source/ui/undo/undoblk2.cxx14
-rw-r--r--sc/source/ui/undo/undoblk3.cxx106
-rw-r--r--sc/source/ui/undo/undocell.cxx57
-rw-r--r--sc/source/ui/undo/undodat.cxx88
-rw-r--r--sc/source/ui/undo/undodraw.cxx4
-rw-r--r--sc/source/ui/undo/undostyl.cxx5
-rw-r--r--sc/source/ui/undo/undotab.cxx84
-rw-r--r--sc/source/ui/unoobj/ChartRangeSelectionListener.cxx2
-rw-r--r--sc/source/ui/unoobj/addruno.cxx5
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx109
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx111
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx172
-rw-r--r--sc/source/ui/unoobj/confuno.cxx4
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx15
-rw-r--r--sc/source/ui/unoobj/datauno.cxx38
-rw-r--r--sc/source/ui/unoobj/defltuno.cxx5
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx10
-rw-r--r--sc/source/ui/unoobj/docuno.cxx113
-rw-r--r--sc/source/ui/unoobj/drdefuno.cxx5
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx8
-rwxr-xr-xsc/source/ui/unoobj/eventuno.cxx5
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx123
-rw-r--r--sc/source/ui/unoobj/forbiuno.cxx5
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx5
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx91
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx14
-rw-r--r--sc/source/ui/unoobj/notesuno.cxx18
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx2
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx143
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx12
-rw-r--r--sc/source/ui/unoobj/targuno.cxx8
-rw-r--r--sc/source/ui/unoobj/textuno.cxx13
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx4
-rw-r--r--sc/source/ui/unoobj/unoreflist.cxx2
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx61
-rw-r--r--sc/source/ui/view/auditsh.cxx4
-rw-r--r--sc/source/ui/view/cellsh.cxx4
-rw-r--r--sc/source/ui/view/cellsh1.cxx42
-rw-r--r--sc/source/ui/view/cellsh3.cxx2
-rw-r--r--sc/source/ui/view/dbfunc3.cxx2
-rw-r--r--sc/source/ui/view/dbfunc4.cxx4
-rw-r--r--sc/source/ui/view/drawvie2.cxx2
-rw-r--r--sc/source/ui/view/drawvie3.cxx115
-rw-r--r--sc/source/ui/view/drawvie4.cxx78
-rw-r--r--sc/source/ui/view/drawview.cxx211
-rw-r--r--sc/source/ui/view/editsh.cxx12
-rw-r--r--sc/source/ui/view/formatsh.cxx28
-rw-r--r--sc/source/ui/view/gridwin.cxx139
-rw-r--r--sc/source/ui/view/gridwin3.cxx77
-rw-r--r--sc/source/ui/view/gridwin4.cxx10
-rw-r--r--sc/source/ui/view/gridwin5.cxx37
-rw-r--r--sc/source/ui/view/hdrcont.cxx3
-rw-r--r--sc/source/ui/view/makefile.mk2
-rw-r--r--sc/source/ui/view/notemark.cxx5
-rw-r--r--sc/source/ui/view/output.cxx14
-rw-r--r--sc/source/ui/view/output2.cxx6
-rw-r--r--sc/source/ui/view/output3.cxx4
-rw-r--r--sc/source/ui/view/pgbrksh.cxx2
-rw-r--r--sc/source/ui/view/pivotsh.cxx2
-rw-r--r--sc/source/ui/view/preview.cxx17
-rw-r--r--sc/source/ui/view/prevwsh.cxx7
-rw-r--r--sc/source/ui/view/prevwsh2.cxx15
-rw-r--r--sc/source/ui/view/printfun.cxx17
-rw-r--r--sc/source/ui/view/reffact.cxx16
-rw-r--r--sc/source/ui/view/spelldialog.cxx6
-rw-r--r--sc/source/ui/view/spelleng.cxx2
-rw-r--r--sc/source/ui/view/tabcont.cxx14
-rw-r--r--sc/source/ui/view/tabpopsh.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx165
-rw-r--r--sc/source/ui/view/tabview2.cxx4
-rw-r--r--sc/source/ui/view/tabview3.cxx10
-rw-r--r--sc/source/ui/view/tabview5.cxx66
-rw-r--r--sc/source/ui/view/tabvwsh.cxx3
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx110
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx13
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx39
-rw-r--r--sc/source/ui/view/tabvwsh5.cxx20
-rw-r--r--sc/source/ui/view/tabvwsh9.cxx31
-rw-r--r--sc/source/ui/view/tabvwshb.cxx126
-rw-r--r--sc/source/ui/view/tabvwshe.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx4
-rw-r--r--sc/source/ui/view/tabvwshg.cxx36
-rw-r--r--sc/source/ui/view/tabvwshh.cxx61
-rw-r--r--sc/source/ui/view/viewdata.cxx2
-rw-r--r--sc/source/ui/view/viewfun2.cxx10
-rw-r--r--sc/source/ui/view/viewfun3.cxx22
-rw-r--r--sc/source/ui/view/viewfun4.cxx16
-rw-r--r--sc/source/ui/view/viewfun5.cxx101
-rw-r--r--sc/source/ui/view/viewfun7.cxx234
-rw-r--r--sc/source/ui/view/viewutil.cxx6
-rw-r--r--scripting/source/basprov/basscript.cxx2
-rw-r--r--sd/inc/CustomAnimationEffect.hxx7
-rw-r--r--sd/inc/Outliner.hxx20
-rw-r--r--sd/inc/OutlinerIterator.hxx8
-rw-r--r--sd/inc/anminfo.hxx16
-rw-r--r--sd/inc/drawdoc.hxx178
-rw-r--r--sd/inc/imapinfo.hxx6
-rw-r--r--sd/inc/pch/precompiled_sd.hxx11
-rw-r--r--sd/inc/pglink.hxx2
-rw-r--r--sd/inc/sdabstdlg.hxx26
-rw-r--r--sd/inc/sdattr.hxx69
-rw-r--r--sd/inc/sderror.hxx4
-rw-r--r--sd/inc/sdiocmpt.hxx2
-rw-r--r--sd/inc/sdmod.hxx9
-rw-r--r--sd/inc/sdpage.hxx121
-rw-r--r--sd/inc/sdundo.hxx1
-rw-r--r--sd/inc/shapelist.hxx21
-rw-r--r--sd/inc/stlpool.hxx6
-rw-r--r--sd/inc/stlsheet.hxx2
-rw-r--r--sd/inc/undo/undofactory.hxx6
-rw-r--r--sd/inc/undo/undoobjects.hxx19
-rw-r--r--sd/sdi/_drvwsh.sdi2
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx51
-rw-r--r--sd/source/core/EffectMigration.cxx78
-rw-r--r--sd/source/core/PageListWatcher.cxx33
-rw-r--r--sd/source/core/PageListWatcher.hxx9
-rw-r--r--sd/source/core/anminfo.cxx18
-rw-r--r--sd/source/core/annotations/Annotation.cxx4
-rw-r--r--sd/source/core/drawdoc.cxx219
-rw-r--r--sd/source/core/drawdoc2.cxx462
-rw-r--r--sd/source/core/drawdoc3.cxx518
-rw-r--r--sd/source/core/drawdoc4.cxx198
-rw-r--r--sd/source/core/pglink.cxx18
-rw-r--r--sd/source/core/sdattr.cxx7
-rw-r--r--sd/source/core/sdiocmpt.cxx6
-rw-r--r--sd/source/core/sdobjfac.cxx31
-rw-r--r--sd/source/core/sdpage.cxx1499
-rw-r--r--sd/source/core/sdpage2.cxx231
-rw-r--r--sd/source/core/shapelist.cxx34
-rw-r--r--sd/source/core/stlpool.cxx61
-rw-r--r--sd/source/core/stlsheet.cxx39
-rw-r--r--sd/source/core/text/textapi.cxx3
-rw-r--r--sd/source/core/typemap.cxx1
-rw-r--r--sd/source/core/undo/undofactory.cxx12
-rw-r--r--sd/source/core/undo/undoobjects.cxx70
-rw-r--r--sd/source/filter/cgm/sdcgmfilter.cxx2
-rw-r--r--sd/source/filter/eppt/eppt.cxx381
-rw-r--r--sd/source/filter/eppt/eppt.hxx247
-rw-r--r--sd/source/filter/eppt/epptso.cxx1163
-rw-r--r--sd/source/filter/eppt/escherex.cxx42
-rw-r--r--sd/source/filter/eppt/escherex.hxx4
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx27
-rw-r--r--sd/source/filter/html/htmlex.cxx102
-rw-r--r--sd/source/filter/html/htmlex.hxx8
-rw-r--r--sd/source/filter/html/pubdlg.cxx166
-rw-r--r--sd/source/filter/ppt/ppt97animations.cxx8
-rw-r--r--sd/source/filter/ppt/pptin.cxx235
-rw-r--r--sd/source/filter/ppt/pptin.hxx4
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx7
-rw-r--r--sd/source/filter/ppt/propread.cxx3
-rw-r--r--sd/source/filter/ppt/propread.hxx2
-rw-r--r--sd/source/filter/sdpptwrp.cxx8
-rw-r--r--sd/source/filter/xml/sdtransform.cxx2
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx10
-rw-r--r--sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx8
-rw-r--r--sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx12
-rw-r--r--sd/source/ui/accessibility/AccessibleOutlineView.cxx12
-rw-r--r--sd/source/ui/accessibility/AccessibleSlideSorterView.cxx20
-rw-r--r--sd/source/ui/animations/CustomAnimationCreateDialog.cxx8
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx39
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx11
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx48
-rw-r--r--sd/source/ui/animations/DialogListBox.cxx2
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx23
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx428
-rw-r--r--sd/source/ui/animations/motionpathtag.hxx18
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx34
-rw-r--r--sd/source/ui/annotations/annotationmanagerimpl.hxx2
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx169
-rw-r--r--sd/source/ui/annotations/annotationtag.hxx10
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx10
-rw-r--r--sd/source/ui/app/optsitem.cxx278
-rw-r--r--sd/source/ui/app/sddll.cxx6
-rw-r--r--sd/source/ui/app/sdmod.cxx20
-rw-r--r--sd/source/ui/app/sdmod1.cxx125
-rw-r--r--sd/source/ui/app/sdmod2.cxx89
-rw-r--r--sd/source/ui/app/sdpopup.cxx320
-rw-r--r--sd/source/ui/app/sdxfer.cxx245
-rw-r--r--sd/source/ui/app/tbxww.cxx26
-rw-r--r--sd/source/ui/app/tmplctrl.cxx23
-rw-r--r--sd/source/ui/controller/slidelayoutcontroller.cxx4
-rw-r--r--sd/source/ui/dlg/AnimationChildWindow.cxx2
-rw-r--r--sd/source/ui/dlg/LayerTabBar.cxx50
-rw-r--r--sd/source/ui/dlg/PaneChildWindows.cxx2
-rw-r--r--sd/source/ui/dlg/PaneShells.cxx10
-rw-r--r--sd/source/ui/dlg/SpellDialogChildWindow.cxx12
-rw-r--r--sd/source/ui/dlg/animobjs.cxx229
-rw-r--r--sd/source/ui/dlg/assclass.cxx2
-rw-r--r--sd/source/ui/dlg/brkdlg.cxx6
-rw-r--r--sd/source/ui/dlg/celltempl.cxx2
-rw-r--r--sd/source/ui/dlg/copydlg.cxx34
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx66
-rw-r--r--sd/source/ui/dlg/dlgass.cxx173
-rw-r--r--sd/source/ui/dlg/dlgassim.cxx8
-rw-r--r--sd/source/ui/dlg/dlgassim.hxx4
-rw-r--r--sd/source/ui/dlg/dlgctrls.cxx18
-rw-r--r--sd/source/ui/dlg/dlgfield.cxx307
-rw-r--r--sd/source/ui/dlg/dlgolbul.cxx55
-rw-r--r--sd/source/ui/dlg/dlgpage.cxx2
-rw-r--r--sd/source/ui/dlg/dlgsnap.cxx35
-rw-r--r--sd/source/ui/dlg/docprev.cxx36
-rw-r--r--sd/source/ui/dlg/filedlg.cxx18
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx54
-rw-r--r--sd/source/ui/dlg/ins_paste.cxx4
-rw-r--r--sd/source/ui/dlg/inspagob.cxx6
-rw-r--r--sd/source/ui/dlg/layeroptionsdlg.cxx24
-rw-r--r--sd/source/ui/dlg/masterlayoutdlg.cxx21
-rw-r--r--sd/source/ui/dlg/morphdlg.cxx21
-rw-r--r--sd/source/ui/dlg/navigatr.cxx89
-rw-r--r--sd/source/ui/dlg/paragr.cxx14
-rw-r--r--sd/source/ui/dlg/present.cxx14
-rw-r--r--sd/source/ui/dlg/prltempl.cxx8
-rw-r--r--sd/source/ui/dlg/prntopts.cxx9
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx26
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx26
-rw-r--r--sd/source/ui/dlg/sdpreslt.cxx20
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx209
-rw-r--r--sd/source/ui/dlg/tabtempl.cxx2
-rw-r--r--sd/source/ui/dlg/tpaction.cxx70
-rw-r--r--sd/source/ui/dlg/tpoption.cxx45
-rw-r--r--sd/source/ui/dlg/unchss.cxx62
-rw-r--r--sd/source/ui/dlg/vectdlg.cxx19
-rw-r--r--sd/source/ui/docshell/docshel2.cxx61
-rw-r--r--sd/source/ui/docshell/docshel3.cxx6
-rw-r--r--sd/source/ui/docshell/docshel4.cxx108
-rw-r--r--sd/source/ui/docshell/docshell.cxx31
-rw-r--r--sd/source/ui/docshell/grdocsh.cxx5
-rw-r--r--sd/source/ui/docshell/sdclient.cxx121
-rw-r--r--sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx2
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationClassifier.hxx4
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationUpdater.hxx8
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.cxx2
-rw-r--r--sd/source/ui/framework/factories/ChildWindowPane.cxx10
-rw-r--r--sd/source/ui/framework/factories/FrameWindowPane.hxx2
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.cxx4
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx2
-rw-r--r--sd/source/ui/framework/module/ReadOnlyModeObserver.hxx2
-rw-r--r--sd/source/ui/framework/module/ShellStackGuard.hxx2
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx8
-rw-r--r--sd/source/ui/func/bulmaper.cxx45
-rw-r--r--sd/source/ui/func/fuarea.cxx3
-rw-r--r--sd/source/ui/func/fubullet.cxx42
-rw-r--r--sd/source/ui/func/fuchar.cxx12
-rw-r--r--sd/source/ui/func/fucon3d.cxx159
-rw-r--r--sd/source/ui/func/fuconarc.cxx147
-rw-r--r--sd/source/ui/func/fuconbez.cxx184
-rw-r--r--sd/source/ui/func/fuconcs.cxx76
-rw-r--r--sd/source/ui/func/fuconnct.cxx4
-rw-r--r--sd/source/ui/func/fuconrec.cxx287
-rw-r--r--sd/source/ui/func/fuconstr.cxx142
-rw-r--r--sd/source/ui/func/fuconuno.cxx54
-rw-r--r--sd/source/ui/func/fucopy.cxx165
-rw-r--r--sd/source/ui/func/fucushow.cxx5
-rw-r--r--sd/source/ui/func/fudraw.cxx402
-rw-r--r--sd/source/ui/func/fudspord.cxx25
-rw-r--r--sd/source/ui/func/fuediglu.cxx115
-rw-r--r--sd/source/ui/func/fuexpand.cxx54
-rw-r--r--sd/source/ui/func/fuformatpaintbrush.cxx116
-rw-r--r--sd/source/ui/func/fuhhconv.cxx28
-rw-r--r--sd/source/ui/func/fuinsert.cxx293
-rw-r--r--sd/source/ui/func/fuinsfil.cxx114
-rw-r--r--sd/source/ui/func/fuline.cxx13
-rw-r--r--sd/source/ui/func/fulinend.cxx39
-rw-r--r--sd/source/ui/func/fulink.cxx2
-rw-r--r--sd/source/ui/func/fumeasur.cxx4
-rw-r--r--sd/source/ui/func/fumorph.cxx160
-rw-r--r--sd/source/ui/func/fuoaprms.cxx183
-rw-r--r--sd/source/ui/func/fuolbull.cxx15
-rw-r--r--sd/source/ui/func/fuoltext.cxx45
-rw-r--r--sd/source/ui/func/fuoutl.cxx8
-rw-r--r--sd/source/ui/func/fupage.cxx401
-rw-r--r--sd/source/ui/func/fuparagr.cxx4
-rw-r--r--sd/source/ui/func/fupoor.cxx622
-rw-r--r--sd/source/ui/func/fuprlout.cxx67
-rw-r--r--sd/source/ui/func/fuprobjs.cxx27
-rw-r--r--sd/source/ui/func/fuscale.cxx22
-rw-r--r--sd/source/ui/func/fusearch.cxx24
-rw-r--r--sd/source/ui/func/fusel.cxx479
-rw-r--r--sd/source/ui/func/fusldlg.cxx19
-rw-r--r--sd/source/ui/func/fusnapln.cxx132
-rw-r--r--sd/source/ui/func/fusumry.cxx52
-rw-r--r--sd/source/ui/func/futempl.cxx58
-rw-r--r--sd/source/ui/func/futext.cxx524
-rw-r--r--sd/source/ui/func/futhes.cxx25
-rw-r--r--sd/source/ui/func/futransf.cxx18
-rw-r--r--sd/source/ui/func/futxtatt.cxx4
-rw-r--r--sd/source/ui/func/fuvect.cxx33
-rw-r--r--sd/source/ui/func/fuzoom.cxx122
-rw-r--r--sd/source/ui/func/makefile.mk2
-rw-r--r--sd/source/ui/func/sdundogr.cxx11
-rw-r--r--sd/source/ui/func/smarttag.cxx84
-rw-r--r--sd/source/ui/func/undoback.cxx4
-rw-r--r--sd/source/ui/func/undoheaderfooter.cxx2
-rw-r--r--sd/source/ui/func/undolayer.cxx8
-rw-r--r--sd/source/ui/func/undopage.cxx65
-rw-r--r--sd/source/ui/func/unoaprms.cxx63
-rw-r--r--sd/source/ui/func/unprlout.cxx12
-rw-r--r--sd/source/ui/inc/AccessibleSlideView.hxx4
-rw-r--r--sd/source/ui/inc/BezierObjectBar.hxx1
-rw-r--r--sd/source/ui/inc/BreakDlg.hxx2
-rw-r--r--sd/source/ui/inc/ClientView.hxx2
-rw-r--r--sd/source/ui/inc/DrawController.hxx2
-rw-r--r--sd/source/ui/inc/DrawDocShell.hxx33
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx84
-rw-r--r--sd/source/ui/inc/FrameView.hxx67
-rw-r--r--sd/source/ui/inc/GraphicDocShell.hxx6
-rw-r--r--sd/source/ui/inc/GraphicObjectBar.hxx1
-rw-r--r--sd/source/ui/inc/GraphicViewShell.hxx2
-rw-r--r--sd/source/ui/inc/GraphicViewShellBase.hxx1
-rw-r--r--sd/source/ui/inc/ImpressViewShellBase.hxx1
-rw-r--r--sd/source/ui/inc/MediaObjectBar.hxx1
-rw-r--r--sd/source/ui/inc/OutlineBulletDlg.hxx2
-rw-r--r--sd/source/ui/inc/OutlineView.hxx21
-rw-r--r--sd/source/ui/inc/OutlineViewShell.hxx16
-rw-r--r--sd/source/ui/inc/OutlineViewShellBase.hxx1
-rw-r--r--sd/source/ui/inc/OutlinerIteratorImpl.hxx12
-rw-r--r--sd/source/ui/inc/PaneShells.hxx3
-rw-r--r--sd/source/ui/inc/PresentationViewShell.hxx6
-rw-r--r--sd/source/ui/inc/PresentationViewShellBase.hxx1
-rw-r--r--sd/source/ui/inc/PreviewRenderer.hxx10
-rw-r--r--sd/source/ui/inc/Ruler.hxx4
-rw-r--r--sd/source/ui/inc/SlideSorter.hxx4
-rw-r--r--sd/source/ui/inc/SlideSorterViewShell.hxx13
-rw-r--r--sd/source/ui/inc/SlideSorterViewShellBase.hxx1
-rw-r--r--sd/source/ui/inc/SlideView.hxx28
-rw-r--r--sd/source/ui/inc/SlideViewShell.hxx14
-rw-r--r--sd/source/ui/inc/SpellDialogChildWindow.hxx2
-rw-r--r--sd/source/ui/inc/TabControl.hxx2
-rw-r--r--sd/source/ui/inc/TemplateScanner.hxx2
-rw-r--r--sd/source/ui/inc/TextObjectBar.hxx1
-rw-r--r--sd/source/ui/inc/UpdateLockManager.hxx2
-rw-r--r--sd/source/ui/inc/View.hxx100
-rw-r--r--sd/source/ui/inc/ViewShell.hxx101
-rw-r--r--sd/source/ui/inc/ViewShellBase.hxx5
-rw-r--r--sd/source/ui/inc/ViewShellHint.hxx2
-rw-r--r--sd/source/ui/inc/ViewShellImplementation.hxx6
-rw-r--r--sd/source/ui/inc/ViewShellManager.hxx2
-rw-r--r--sd/source/ui/inc/ViewTabControl.hxx2
-rw-r--r--sd/source/ui/inc/Window.hxx60
-rw-r--r--sd/source/ui/inc/animobjs.hxx6
-rw-r--r--sd/source/ui/inc/custsdlg.hxx10
-rw-r--r--sd/source/ui/inc/dlgass.hxx8
-rw-r--r--sd/source/ui/inc/dlgpage.hxx2
-rw-r--r--sd/source/ui/inc/dlgsnap.hxx2
-rw-r--r--sd/source/ui/inc/docprev.hxx6
-rw-r--r--sd/source/ui/inc/drawview.hxx19
-rw-r--r--sd/source/ui/inc/framework/Configuration.hxx4
-rw-r--r--sd/source/ui/inc/framework/FrameworkHelper.hxx4
-rw-r--r--sd/source/ui/inc/framework/Pane.hxx2
-rw-r--r--sd/source/ui/inc/framework/ResourceId.hxx4
-rw-r--r--sd/source/ui/inc/fuarea.hxx2
-rw-r--r--sd/source/ui/inc/fubullet.hxx2
-rw-r--r--sd/source/ui/inc/fuchar.hxx2
-rw-r--r--sd/source/ui/inc/fucon3d.hxx12
-rw-r--r--sd/source/ui/inc/fuconarc.hxx12
-rw-r--r--sd/source/ui/inc/fuconbez.hxx12
-rw-r--r--sd/source/ui/inc/fuconcs.hxx12
-rw-r--r--sd/source/ui/inc/fuconnct.hxx2
-rw-r--r--sd/source/ui/inc/fuconrec.hxx12
-rw-r--r--sd/source/ui/inc/fuconstr.hxx12
-rw-r--r--sd/source/ui/inc/fuconuno.hxx12
-rw-r--r--sd/source/ui/inc/fucopy.hxx2
-rw-r--r--sd/source/ui/inc/fucushow.hxx2
-rw-r--r--sd/source/ui/inc/fudraw.hxx27
-rw-r--r--sd/source/ui/inc/fudspord.hxx8
-rw-r--r--sd/source/ui/inc/fuediglu.hxx15
-rw-r--r--sd/source/ui/inc/fuexpand.hxx2
-rw-r--r--sd/source/ui/inc/fuformatpaintbrush.hxx12
-rw-r--r--sd/source/ui/inc/fugrid.hxx2
-rw-r--r--sd/source/ui/inc/fuhhconv.hxx6
-rw-r--r--sd/source/ui/inc/fuinsert.hxx8
-rw-r--r--sd/source/ui/inc/fuinsfil.hxx6
-rw-r--r--sd/source/ui/inc/fuline.hxx2
-rw-r--r--sd/source/ui/inc/fulinend.hxx2
-rw-r--r--sd/source/ui/inc/fulink.hxx2
-rw-r--r--sd/source/ui/inc/fumeasur.hxx2
-rw-r--r--sd/source/ui/inc/fumorph.hxx4
-rw-r--r--sd/source/ui/inc/fuoaprms.hxx2
-rw-r--r--sd/source/ui/inc/fuolbull.hxx2
-rw-r--r--sd/source/ui/inc/fuoltext.hxx10
-rw-r--r--sd/source/ui/inc/fuoutl.hxx4
-rw-r--r--sd/source/ui/inc/fupage.hxx5
-rw-r--r--sd/source/ui/inc/fuparagr.hxx2
-rw-r--r--sd/source/ui/inc/fupoor.hxx41
-rw-r--r--sd/source/ui/inc/fuprlout.hxx2
-rw-r--r--sd/source/ui/inc/fuprobjs.hxx2
-rw-r--r--sd/source/ui/inc/fuscale.hxx2
-rw-r--r--sd/source/ui/inc/fusearch.hxx4
-rw-r--r--sd/source/ui/inc/fusel.hxx24
-rw-r--r--sd/source/ui/inc/fusldlg.hxx2
-rw-r--r--sd/source/ui/inc/fuslhide.hxx2
-rw-r--r--sd/source/ui/inc/fuslid.hxx8
-rw-r--r--sd/source/ui/inc/fuslsel.hxx24
-rw-r--r--sd/source/ui/inc/fusnapln.hxx2
-rw-r--r--sd/source/ui/inc/fusumry.hxx2
-rw-r--r--sd/source/ui/inc/futempl.hxx2
-rw-r--r--sd/source/ui/inc/futext.hxx23
-rw-r--r--sd/source/ui/inc/futhes.hxx2
-rw-r--r--sd/source/ui/inc/futransf.hxx2
-rw-r--r--sd/source/ui/inc/futxtatt.hxx2
-rw-r--r--sd/source/ui/inc/fuvect.hxx2
-rw-r--r--sd/source/ui/inc/fuzoom.hxx25
-rw-r--r--sd/source/ui/inc/ins_paste.hxx2
-rw-r--r--sd/source/ui/inc/inspagob.hxx4
-rw-r--r--sd/source/ui/inc/masterlayoutdlg.hxx8
-rw-r--r--sd/source/ui/inc/morphdlg.hxx4
-rw-r--r--sd/source/ui/inc/navigatr.hxx18
-rw-r--r--sd/source/ui/inc/optsitem.hxx381
-rw-r--r--sd/source/ui/inc/pubdlg.hxx10
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx27
-rw-r--r--sd/source/ui/inc/sdundogr.hxx1
-rw-r--r--sd/source/ui/inc/sdxfer.hxx32
-rw-r--r--sd/source/ui/inc/smarttag.hxx41
-rw-r--r--sd/source/ui/inc/sprite.hxx6
-rw-r--r--sd/source/ui/inc/taskpane/ControlContainer.hxx8
-rw-r--r--sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx12
-rw-r--r--sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx14
-rw-r--r--sd/source/ui/inc/taskpane/TitleBar.hxx2
-rw-r--r--sd/source/ui/inc/taskpane/TitledControl.hxx8
-rw-r--r--sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx5
-rw-r--r--sd/source/ui/inc/tbx_ww.hxx2
-rw-r--r--sd/source/ui/inc/tools/AsynchronousTask.hxx4
-rw-r--r--sd/source/ui/inc/tools/TimerBasedTaskExecution.hxx2
-rw-r--r--sd/source/ui/inc/tpaction.hxx4
-rw-r--r--sd/source/ui/inc/tpoption.hxx2
-rw-r--r--sd/source/ui/inc/unchss.hxx18
-rw-r--r--sd/source/ui/inc/undoback.hxx2
-rw-r--r--sd/source/ui/inc/undoheaderfooter.hxx1
-rw-r--r--sd/source/ui/inc/undolayer.hxx1
-rw-r--r--sd/source/ui/inc/undopage.hxx156
-rw-r--r--sd/source/ui/inc/unmodpg.hxx13
-rw-r--r--sd/source/ui/inc/unoaprms.hxx53
-rw-r--r--sd/source/ui/inc/unokywds.hxx2
-rw-r--r--sd/source/ui/inc/unomodel.hxx7
-rw-r--r--sd/source/ui/inc/unprlout.hxx5
-rw-r--r--sd/source/ui/inc/unslsel.hxx1
-rw-r--r--sd/source/ui/inc/zoomlist.hxx15
-rw-r--r--sd/source/ui/notes/EditWindow.cxx78
-rw-r--r--sd/source/ui/notes/EditWindow.hxx10
-rw-r--r--sd/source/ui/notes/NotesDockingWindow.cxx2
-rw-r--r--sd/source/ui/notes/TextLogger.cxx2
-rw-r--r--sd/source/ui/presenter/PresenterHelper.cxx6
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx8
-rw-r--r--sd/source/ui/presenter/SlideRenderer.cxx6
-rw-r--r--sd/source/ui/slideshow/showwin.cxx63
-rw-r--r--sd/source/ui/slideshow/showwindow.hxx10
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx17
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx84
-rw-r--r--sd/source/ui/slideshow/slideshowviewimpl.cxx8
-rw-r--r--sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx14
-rw-r--r--sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx2
-rw-r--r--sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx2
-rw-r--r--sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx10
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx44
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx62
-rw-r--r--sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx12
-rw-r--r--sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsFocusManager.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsHideSlideFunction.hxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsListener.cxx99
-rw-r--r--sd/source/ui/slidesorter/controller/SlsListener.hxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx14
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx42
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx12
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlideFunction.cxx16
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx53
-rw-r--r--sd/source/ui/slidesorter/controller/SlsTransferableData.cxx7
-rw-r--r--sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx2
-rw-r--r--sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx4
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx6
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx2
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx20
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx6
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx20
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx10
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx12
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsSlideFunction.hxx8
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx2
-rw-r--r--sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx10
-rw-r--r--sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx4
-rw-r--r--sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx10
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx8
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx6
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectViewContact.hxx2
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectViewObjectContact.hxx8
-rw-r--r--sd/source/ui/slidesorter/model/SlideSorterModel.cxx22
-rw-r--r--sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx4
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorter.cxx2
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterChildWindow.cxx1
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx66
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx33
-rw-r--r--sd/source/ui/slidesorter/view/SlsFontProvider.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsLayouter.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx6
-rw-r--r--sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx4
-rw-r--r--sd/source/ui/table/TableDesignPane.cxx10
-rw-r--r--sd/source/ui/table/tablefunction.cxx91
-rw-r--r--sd/source/ui/table/tableobjectbar.cxx6
-rw-r--r--sd/source/ui/table/tableobjectbar.hxx1
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.cxx36
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.hxx1
-rw-r--r--sd/source/ui/toolpanel/ScrollPanel.cxx11
-rw-r--r--sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx29
-rw-r--r--sd/source/ui/toolpanel/SubToolPanel.cxx5
-rw-r--r--sd/source/ui/toolpanel/TaskPaneFocusManager.cxx5
-rw-r--r--sd/source/ui/toolpanel/TaskPaneTreeNode.cxx2
-rw-r--r--sd/source/ui/toolpanel/TestMenu.cxx7
-rw-r--r--sd/source/ui/toolpanel/TitleBar.cxx6
-rw-r--r--sd/source/ui/toolpanel/TitledControl.cxx5
-rw-r--r--sd/source/ui/toolpanel/ToolPanel.cxx2
-rw-r--r--sd/source/ui/toolpanel/ToolPanelViewShell.cxx11
-rw-r--r--sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx2
-rw-r--r--sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx10
-rw-r--r--sd/source/ui/toolpanel/controls/DocumentHelper.cxx132
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainer.cxx6
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainerFiller.hxx4
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx11
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainerQueue.hxx4
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx10
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageObserver.cxx28
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx19
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx1
-rw-r--r--sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.hxx4
-rw-r--r--sd/source/ui/tools/EventMultiplexer.cxx27
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx67
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx61
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx70
-rw-r--r--sd/source/ui/unoidl/sddetect.cxx14
-rw-r--r--sd/source/ui/unoidl/unocpres.cxx2
-rw-r--r--sd/source/ui/unoidl/unocpres.hxx2
-rw-r--r--sd/source/ui/unoidl/unodoc.cxx4
-rw-r--r--sd/source/ui/unoidl/unolayer.cxx26
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx261
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx297
-rw-r--r--sd/source/ui/unoidl/unopage.cxx558
-rw-r--r--sd/source/ui/unoidl/unopage.hxx8
-rw-r--r--sd/source/ui/unoidl/unopback.cxx9
-rw-r--r--sd/source/ui/unoidl/unosrch.cxx3
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx168
-rw-r--r--sd/source/ui/view/GraphicObjectBar.cxx57
-rw-r--r--sd/source/ui/view/GraphicViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/ImpressViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/MediaObjectBar.cxx69
-rw-r--r--sd/source/ui/view/OutlineViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/Outliner.cxx268
-rw-r--r--sd/source/ui/view/OutlinerIterator.cxx16
-rw-r--r--sd/source/ui/view/PresentationViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/SlideSorterViewShellBase.cxx2
-rw-r--r--sd/source/ui/view/ToolBarManager.cxx2
-rw-r--r--sd/source/ui/view/ViewClipboard.cxx33
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx63
-rw-r--r--sd/source/ui/view/ViewShellHint.cxx2
-rw-r--r--sd/source/ui/view/ViewShellImplementation.cxx54
-rw-r--r--sd/source/ui/view/ViewShellManager.cxx4
-rw-r--r--sd/source/ui/view/ViewTabBar.cxx4
-rw-r--r--sd/source/ui/view/clview.cxx11
-rw-r--r--sd/source/ui/view/drawview.cxx131
-rw-r--r--sd/source/ui/view/drbezob.cxx88
-rw-r--r--sd/source/ui/view/drtxtob.cxx82
-rw-r--r--sd/source/ui/view/drtxtob1.cxx47
-rw-r--r--sd/source/ui/view/drviews1.cxx283
-rw-r--r--sd/source/ui/view/drviews2.cxx286
-rw-r--r--sd/source/ui/view/drviews3.cxx286
-rw-r--r--sd/source/ui/view/drviews4.cxx302
-rw-r--r--sd/source/ui/view/drviews5.cxx116
-rw-r--r--sd/source/ui/view/drviews6.cxx111
-rw-r--r--sd/source/ui/view/drviews7.cxx271
-rw-r--r--sd/source/ui/view/drviews8.cxx70
-rw-r--r--sd/source/ui/view/drviews9.cxx192
-rw-r--r--sd/source/ui/view/drviewsa.cxx241
-rw-r--r--sd/source/ui/view/drviewsb.cxx251
-rw-r--r--sd/source/ui/view/drviewsc.cxx73
-rw-r--r--sd/source/ui/view/drviewsd.cxx22
-rw-r--r--sd/source/ui/view/drviewse.cxx449
-rw-r--r--sd/source/ui/view/drviewsf.cxx84
-rw-r--r--sd/source/ui/view/drviewsg.cxx49
-rw-r--r--sd/source/ui/view/drviewsh.cxx150
-rw-r--r--sd/source/ui/view/drviewsi.cxx8
-rw-r--r--sd/source/ui/view/drviewsj.cxx382
-rw-r--r--sd/source/ui/view/drvwshrg.cxx5
-rw-r--r--sd/source/ui/view/frmview.cxx182
-rw-r--r--sd/source/ui/view/outlnvs2.cxx48
-rw-r--r--sd/source/ui/view/outlnvsh.cxx293
-rw-r--r--sd/source/ui/view/outlview.cxx200
-rw-r--r--sd/source/ui/view/presvish.cxx9
-rw-r--r--sd/source/ui/view/sdruler.cxx6
-rw-r--r--sd/source/ui/view/sdview.cxx476
-rw-r--r--sd/source/ui/view/sdview2.cxx378
-rw-r--r--sd/source/ui/view/sdview3.cxx533
-rw-r--r--sd/source/ui/view/sdview4.cxx205
-rw-r--r--sd/source/ui/view/sdview5.cxx31
-rw-r--r--sd/source/ui/view/sdwindow.cxx484
-rw-r--r--sd/source/ui/view/tabcontr.cxx28
-rw-r--r--sd/source/ui/view/unmodpg.cxx57
-rw-r--r--sd/source/ui/view/viewoverlaymanager.cxx152
-rw-r--r--sd/source/ui/view/viewshe2.cxx310
-rw-r--r--sd/source/ui/view/viewshe3.cxx40
-rw-r--r--sd/source/ui/view/viewshel.cxx100
-rw-r--r--sd/source/ui/view/zoomlist.cxx54
-rw-r--r--sd/util/makefile.mk1
-rw-r--r--sdext/source/pdfimport/tree/pdfiprocessor.cxx53
-rw-r--r--sfx2/inc/msgnodei.hxx6
-rw-r--r--sfx2/inc/pch/precompiled_sfx2.hxx1
-rw-r--r--sfx2/inc/sfx2/app.hxx1
-rw-r--r--sfx2/inc/sfx2/bindings.hxx2
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx1
-rw-r--r--sfx2/inc/sfx2/docfac.hxx1
-rw-r--r--sfx2/inc/sfx2/event.hxx8
-rw-r--r--sfx2/inc/sfx2/evntconf.hxx3
-rw-r--r--sfx2/inc/sfx2/frame.hxx10
-rw-r--r--sfx2/inc/sfx2/frmdescr.hxx2
-rw-r--r--sfx2/inc/sfx2/linksrc.hxx3
-rw-r--r--sfx2/inc/sfx2/lnkbase.hxx1
-rw-r--r--sfx2/inc/sfx2/minfitem.hxx4
-rw-r--r--sfx2/inc/sfx2/mnuitem.hxx9
-rw-r--r--sfx2/inc/sfx2/module.hxx1
-rw-r--r--sfx2/inc/sfx2/msg.hxx38
-rw-r--r--sfx2/inc/sfx2/msgpool.hxx3
-rw-r--r--sfx2/inc/sfx2/objitem.hxx2
-rw-r--r--sfx2/inc/sfx2/objsh.hxx20
-rw-r--r--sfx2/inc/sfx2/prnmon.hxx2
-rw-r--r--sfx2/inc/sfx2/progress.hxx2
-rw-r--r--sfx2/inc/sfx2/request.hxx19
-rw-r--r--sfx2/inc/sfx2/shell.hxx4
-rw-r--r--sfx2/inc/sfx2/stbitem.hxx11
-rw-r--r--sfx2/inc/sfx2/tabdlg.hxx1
-rw-r--r--sfx2/inc/sfx2/tbxctrl.hxx15
-rw-r--r--sfx2/inc/sfx2/tplpitem.hxx3
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx12
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx19
-rw-r--r--sfx2/inc/sorgitm.hxx1
-rw-r--r--sfx2/source/appl/app.cxx4
-rw-r--r--sfx2/source/appl/appbas.cxx10
-rw-r--r--sfx2/source/appl/appcfg.cxx74
-rw-r--r--sfx2/source/appl/appdde.cxx12
-rw-r--r--sfx2/source/appl/appmain.cxx3
-rw-r--r--sfx2/source/appl/appopen.cxx68
-rw-r--r--sfx2/source/appl/appreg.cxx6
-rw-r--r--sfx2/source/appl/appserv.cxx26
-rw-r--r--sfx2/source/appl/appuno.cxx12
-rw-r--r--sfx2/source/appl/linkmgr2.cxx10
-rw-r--r--sfx2/source/appl/linksrc.cxx2
-rw-r--r--sfx2/source/appl/lnkbase2.cxx3
-rw-r--r--sfx2/source/appl/module.cxx8
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx8
-rw-r--r--sfx2/source/appl/workwin.cxx2
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx6
-rw-r--r--sfx2/source/bastyp/progress.cxx10
-rw-r--r--sfx2/source/config/evntconf.cxx3
-rw-r--r--sfx2/source/control/bindings.cxx17
-rw-r--r--sfx2/source/control/ctrlitem.cxx2
-rw-r--r--sfx2/source/control/dispatch.cxx20
-rw-r--r--sfx2/source/control/macro.cxx25
-rw-r--r--sfx2/source/control/minfitem.cxx5
-rw-r--r--sfx2/source/control/msg.cxx2
-rw-r--r--sfx2/source/control/msgpool.cxx10
-rw-r--r--sfx2/source/control/request.cxx33
-rw-r--r--sfx2/source/control/shell.cxx15
-rw-r--r--sfx2/source/control/sorgitm.cxx10
-rw-r--r--sfx2/source/control/statcach.cxx2
-rw-r--r--sfx2/source/control/unoctitm.cxx8
-rw-r--r--sfx2/source/dialog/basedlgs.cxx12
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx59
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx6
-rw-r--r--sfx2/source/dialog/tabdlg.cxx4
-rw-r--r--sfx2/source/dialog/templdlg.cxx32
-rw-r--r--sfx2/source/dialog/tplcitem.cxx7
-rw-r--r--sfx2/source/dialog/tplpitem.cxx4
-rw-r--r--sfx2/source/dialog/versdlg.cxx4
-rw-r--r--sfx2/source/doc/docfile.cxx68
-rw-r--r--sfx2/source/doc/frmdescr.cxx2
-rw-r--r--sfx2/source/doc/guisaveas.cxx2
-rw-r--r--sfx2/source/doc/objcont.cxx2
-rw-r--r--sfx2/source/doc/objitem.cxx11
-rw-r--r--sfx2/source/doc/objmisc.cxx34
-rw-r--r--sfx2/source/doc/objserv.cxx36
-rw-r--r--sfx2/source/doc/objstor.cxx65
-rw-r--r--sfx2/source/doc/objxtor.cxx17
-rw-r--r--sfx2/source/doc/printhelper.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx44
-rw-r--r--sfx2/source/inc/templdgi.hxx7
-rw-r--r--sfx2/source/inet/inettbc.cxx4
-rw-r--r--sfx2/source/menu/mnuitem.cxx24
-rw-r--r--sfx2/source/menu/virtmenu.cxx2
-rw-r--r--sfx2/source/statbar/stbitem.cxx12
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx25
-rw-r--r--sfx2/source/view/frame.cxx20
-rw-r--r--sfx2/source/view/frmload.cxx2
-rw-r--r--sfx2/source/view/impviewframe.hxx1
-rw-r--r--sfx2/source/view/viewfrm.cxx104
-rw-r--r--sfx2/source/view/viewfrm2.cxx14
-rw-r--r--sfx2/source/view/viewprn.cxx14
-rw-r--r--sfx2/source/view/viewsh.cxx491
-rw-r--r--slideshow/source/engine/shapes/viewshape.cxx6
-rw-r--r--slideshow/source/engine/slide/userpaintoverlay.cxx62
-rw-r--r--slideshow/source/engine/tools.cxx3
-rw-r--r--slideshow/source/engine/transitions/clippingfunctor.cxx3
-rw-r--r--slideshow/source/engine/transitions/combtransition.cxx3
-rw-r--r--slideshow/source/engine/transitions/transitiontools.cxx4
-rw-r--r--soldep/source/soldep.cxx6
-rw-r--r--solenv/gbuild/AllLangResTarget.mk154
-rw-r--r--solenv/gbuild/ComponentTarget.mk18
-rw-r--r--solenv/gbuild/CppunitTest.mk54
-rw-r--r--solenv/gbuild/CustomTarget.mk30
-rw-r--r--solenv/gbuild/Deliver.mk12
-rw-r--r--solenv/gbuild/Executable.mk56
-rw-r--r--solenv/gbuild/Helper.mk8
-rw-r--r--solenv/gbuild/JavaClassSet.mk22
-rw-r--r--solenv/gbuild/JunitTest.mk14
-rw-r--r--solenv/gbuild/Library.mk62
-rw-r--r--solenv/gbuild/LinkTarget.mk106
-rw-r--r--solenv/gbuild/Module.mk66
-rw-r--r--solenv/gbuild/Output.mk4
-rw-r--r--solenv/gbuild/Package.mk14
-rw-r--r--solenv/gbuild/PrecompiledHeaders.mk40
-rw-r--r--solenv/gbuild/SdiTarget.mk38
-rw-r--r--solenv/gbuild/StaticLibrary.mk60
-rw-r--r--[-rwxr-xr-x]solenv/gbuild/TargetLocations.mk50
-rw-r--r--solenv/gbuild/WinResTarget.mk18
-rw-r--r--solenv/gbuild/extensions/post_PackModule.mk10
-rw-r--r--solenv/gbuild/extensions/post_SetupLocal.mk40
-rw-r--r--solenv/gbuild/gbuild.mk70
-rw-r--r--solenv/gbuild/platform/linux.mk266
-rw-r--r--solenv/gbuild/platform/macosx.mk314
-rw-r--r--solenv/gbuild/platform/solaris.mk262
-rw-r--r--solenv/gbuild/platform/windows.mk638
-rw-r--r--solenv/gbuild/platform/winmingw.mk562
-rw-r--r--solenv/gbuild/templates/AllLangResTarget.mk2
-rw-r--r--solenv/gbuild/templates/CppunitTest.mk2
-rw-r--r--solenv/gbuild/templates/Executable.mk4
-rw-r--r--solenv/gbuild/templates/JunitTest.mk14
-rw-r--r--solenv/gbuild/templates/Library.mk6
-rw-r--r--sot/inc/sot/factory.hxx4
-rw-r--r--sot/inc/sot/filelist.hxx1
-rw-r--r--sot/inc/sot/stg.hxx8
-rw-r--r--sot/source/base/factory.cxx2
-rw-r--r--sot/source/base/filelist.cxx3
-rw-r--r--sot/source/base/object.cxx3
-rw-r--r--sot/source/sdstor/stg.cxx14
-rw-r--r--sot/source/sdstor/storage.cxx26
-rw-r--r--sot/source/sdstor/ucbstorage.cxx16
-rw-r--r--starmath/inc/document.hxx1
-rw-r--r--starmath/inc/smmod.hxx1
-rw-r--r--starmath/inc/view.hxx2
-rw-r--r--starmath/source/document.cxx2
-rw-r--r--starmath/source/edit.cxx12
-rw-r--r--starmath/source/smdetect.cxx2
-rw-r--r--starmath/source/smmod.cxx10
-rw-r--r--starmath/source/toolbox.cxx2
-rw-r--r--starmath/source/unomodel.cxx7
-rw-r--r--starmath/source/utility.cxx2
-rw-r--r--starmath/source/view.cxx12
-rw-r--r--svl/inc/svl/aeitem.hxx2
-rw-r--r--svl/inc/svl/brdcst.hxx3
-rw-r--r--svl/inc/svl/broadcast.hxx3
-rw-r--r--svl/inc/svl/cenumitm.hxx6
-rw-r--r--svl/inc/svl/cintitem.hxx8
-rw-r--r--svl/inc/svl/cntwall.hxx3
-rw-r--r--svl/inc/svl/ctypeitm.hxx2
-rw-r--r--svl/inc/svl/custritm.hxx2
-rw-r--r--svl/inc/svl/dateitem.hxx6
-rw-r--r--svl/inc/svl/eitem.hxx5
-rw-r--r--svl/inc/svl/filerec.hxx54
-rw-r--r--svl/inc/svl/flagitem.hxx3
-rw-r--r--svl/inc/svl/globalnameitem.hxx3
-rw-r--r--svl/inc/svl/hint.hxx6
-rw-r--r--svl/inc/svl/ilstitem.hxx3
-rw-r--r--svl/inc/svl/imageitm.hxx1
-rw-r--r--svl/inc/svl/intitem.hxx15
-rw-r--r--svl/inc/svl/isethint.hxx2
-rw-r--r--svl/inc/svl/itempool.hxx30
-rw-r--r--svl/inc/svl/itemset.hxx51
-rw-r--r--svl/inc/svl/lckbitem.hxx3
-rw-r--r--svl/inc/svl/listener.hxx3
-rw-r--r--svl/inc/svl/listeneriter.hxx14
-rw-r--r--svl/inc/svl/lstner.hxx3
-rw-r--r--svl/inc/svl/macitem.hxx3
-rw-r--r--svl/inc/svl/metitem.hxx5
-rw-r--r--svl/inc/svl/poolitem.hxx30
-rw-r--r--svl/inc/svl/ptitem.hxx2
-rw-r--r--svl/inc/svl/rectitem.hxx2
-rw-r--r--svl/inc/svl/rngitem.hxx2
-rw-r--r--svl/inc/svl/sfontitm.hxx2
-rw-r--r--svl/inc/svl/slstitm.hxx4
-rw-r--r--svl/inc/svl/smplhint.hxx5
-rw-r--r--svl/inc/svl/solar.hrc2
-rw-r--r--svl/inc/svl/srchitem.hxx5
-rw-r--r--svl/inc/svl/stritem.hxx3
-rw-r--r--svl/inc/svl/strmadpt.hxx2
-rw-r--r--svl/inc/svl/style.hxx12
-rw-r--r--svl/inc/svl/szitem.hxx1
-rw-r--r--svl/inc/svl/undo.hxx6
-rw-r--r--svl/inc/svl/visitem.hxx2
-rw-r--r--svl/inc/svl/zforlist.hxx2
-rw-r--r--svl/source/filerec/filerec.cxx38
-rw-r--r--svl/source/inc/poolio.hxx4
-rw-r--r--svl/source/items/aeitem.cxx3
-rw-r--r--svl/source/items/cenumitm.cxx14
-rw-r--r--svl/source/items/cintitem.cxx34
-rw-r--r--svl/source/items/cntwall.cxx2
-rw-r--r--svl/source/items/ctypeitm.cxx2
-rw-r--r--svl/source/items/custritm.cxx12
-rw-r--r--svl/source/items/dateitem.cxx9
-rw-r--r--svl/source/items/eitem.cxx6
-rw-r--r--svl/source/items/flagitem.cxx4
-rw-r--r--svl/source/items/globalnameitem.cxx5
-rw-r--r--svl/source/items/ilstitem.cxx4
-rw-r--r--svl/source/items/imageitm.cxx2
-rw-r--r--svl/source/items/intitem.cxx26
-rw-r--r--svl/source/items/itempool.cxx55
-rw-r--r--svl/source/items/itemset.cxx119
-rw-r--r--svl/source/items/lckbitem.cxx5
-rw-r--r--svl/source/items/macitem.cxx5
-rw-r--r--svl/source/items/poolio.cxx92
-rw-r--r--svl/source/items/poolitem.cxx40
-rw-r--r--svl/source/items/ptitem.cxx5
-rw-r--r--svl/source/items/rectitem.cxx6
-rw-r--r--svl/source/items/rngitem_inc.cxx3
-rw-r--r--svl/source/items/sfontitm.cxx5
-rw-r--r--svl/source/items/slstitm.cxx4
-rw-r--r--svl/source/items/srchitem.cxx6
-rw-r--r--svl/source/items/stritem.cxx3
-rw-r--r--svl/source/items/style.cxx9
-rw-r--r--svl/source/items/szitem.cxx4
-rw-r--r--svl/source/items/visitem.cxx5
-rw-r--r--svl/source/misc/strmadpt.cxx3
-rw-r--r--svl/source/notify/brdcst.cxx3
-rw-r--r--svl/source/notify/broadcast.cxx3
-rw-r--r--svl/source/notify/hint.cxx4
-rw-r--r--svl/source/notify/isethint.cxx4
-rw-r--r--svl/source/notify/listener.cxx3
-rw-r--r--svl/source/notify/listeneriter.cxx12
-rw-r--r--svl/source/notify/lstner.cxx3
-rw-r--r--svl/source/notify/smplhint.cxx3
-rw-r--r--svl/source/undo/undo.cxx7
-rw-r--r--svtools/bmpmaker/bmp.cxx8
-rw-r--r--svtools/inc/svtools/brwbox.hxx2
-rw-r--r--svtools/inc/svtools/editbrowsebox.hxx12
-rw-r--r--svtools/inc/svtools/grfmgr.hxx2
-rw-r--r--svtools/inc/svtools/imap.hxx2
-rw-r--r--svtools/inc/svtools/parhtml.hxx2
-rw-r--r--svtools/inc/svtools/textdata.hxx1
-rw-r--r--svtools/inc/svtools/ttprops.hxx4
-rw-r--r--svtools/inc/svtools/xwindowitem.hxx1
-rw-r--r--svtools/source/brwbox/brwbox1.cxx6
-rw-r--r--svtools/source/brwbox/brwbox2.cxx20
-rw-r--r--svtools/source/brwbox/datwin.cxx50
-rw-r--r--svtools/source/brwbox/datwin.hxx34
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx9
-rw-r--r--svtools/source/config/accessibilityoptions.cxx2
-rw-r--r--svtools/source/control/toolbarmenuacc.cxx4
-rw-r--r--svtools/source/edit/svmedit.cxx15
-rw-r--r--svtools/source/edit/textdata.cxx2
-rw-r--r--svtools/source/edit/textund2.hxx6
-rw-r--r--svtools/source/edit/textundo.cxx11
-rw-r--r--svtools/source/edit/textundo.hxx1
-rw-r--r--svtools/source/graphic/grfmgr.cxx4
-rw-r--r--svtools/source/misc/ehdl.cxx7
-rw-r--r--svtools/source/misc/imap2.cxx7
-rw-r--r--svtools/source/misc/transfer.cxx4
-rw-r--r--svtools/source/misc/transfer2.cxx3
-rw-r--r--svtools/source/misc/xwindowitem.cxx3
-rw-r--r--svtools/source/plugapp/ttprops.cxx5
-rw-r--r--svtools/source/svhtml/parhtml.cxx2
-rw-r--r--svtools/source/toolpanel/drawerlayouter.cxx2
-rw-r--r--svtools/source/uno/unoevent.cxx1
-rw-r--r--svx/AllLangResTarget_svx.mk46
-rw-r--r--svx/Library_svx.mk2
-rw-r--r--svx/Library_svxcore.mk14
-rw-r--r--svx/Package_inc.mk54
-rw-r--r--svx/inc/dragmt3d.hxx29
-rw-r--r--svx/inc/pch/precompiled_svx.hxx1
-rw-r--r--svx/inc/svdibrow.hxx18
-rw-r--r--svx/inc/svx/EnhancedCustomShape2d.hxx25
-rw-r--r--svx/inc/svx/SmartTagItem.hxx4
-rw-r--r--svx/inc/svx/SvxShapeTypes.hxx2
-rw-r--r--svx/inc/svx/algitem.hxx16
-rw-r--r--svx/inc/svx/camera3d.hxx6
-rw-r--r--svx/inc/svx/charthelper.hxx12
-rw-r--r--svx/inc/svx/chrtitem.hxx11
-rw-r--r--svx/inc/svx/clipfmtitem.hxx2
-rw-r--r--svx/inc/svx/connctrl.hxx2
-rw-r--r--svx/inc/svx/contdlg.hxx1
-rw-r--r--svx/inc/svx/cube3d.hxx28
-rw-r--r--svx/inc/svx/deflt3d.hxx10
-rw-r--r--svx/inc/svx/dlgctl3d.hxx8
-rw-r--r--svx/inc/svx/drawitem.hxx12
-rw-r--r--svx/inc/svx/e3ditem.hxx1
-rw-r--r--svx/inc/svx/e3dundo.hxx3
-rw-r--r--svx/inc/svx/extrud3d.hxx26
-rw-r--r--svx/inc/svx/extrusionbar.hxx1
-rw-r--r--svx/inc/svx/float3d.hxx1
-rw-r--r--svx/inc/svx/fmglob.hxx1
-rw-r--r--svx/inc/svx/fmmodel.hxx22
-rw-r--r--svx/inc/svx/fmpage.hxx24
-rw-r--r--svx/inc/svx/fmshell.hxx5
-rw-r--r--svx/inc/svx/fmview.hxx20
-rw-r--r--svx/inc/svx/fontwork.hxx4
-rw-r--r--svx/inc/svx/fontworkbar.hxx1
-rw-r--r--svx/inc/svx/fontworkgallery.hxx15
-rw-r--r--svx/inc/svx/galmisc.hxx5
-rw-r--r--svx/inc/svx/globaldrawitempool.hxx42
-rw-r--r--svx/inc/svx/globl3d.hxx13
-rw-r--r--svx/inc/svx/gluepoint.hxx136
-rw-r--r--svx/inc/svx/grafctrl.hxx1
-rw-r--r--svx/inc/svx/graphctl.hxx48
-rw-r--r--svx/inc/svx/grfcrop.hxx1
-rw-r--r--svx/inc/svx/hdft.hxx2
-rw-r--r--svx/inc/svx/hlnkitem.hxx3
-rw-r--r--svx/inc/svx/imapdlg.hxx1
-rw-r--r--svx/inc/svx/ipolypolygoneditorcontroller.hxx15
-rw-r--r--svx/inc/svx/lathe3d.hxx32
-rw-r--r--svx/inc/svx/layctrl.hxx4
-rw-r--r--svx/inc/svx/numinf.hxx2
-rw-r--r--svx/inc/svx/obj3d.hxx174
-rw-r--r--svx/inc/svx/optgrid.hxx68
-rw-r--r--svx/inc/svx/pageitem.hxx6
-rw-r--r--svx/inc/svx/polygn3d.hxx32
-rw-r--r--svx/inc/svx/polypolygoneditor.hxx34
-rw-r--r--svx/inc/svx/postattr.hxx6
-rw-r--r--svx/inc/svx/rotmodit.hxx3
-rw-r--r--svx/inc/svx/rulritem.hxx14
-rw-r--r--svx/inc/svx/scene3d.hxx159
-rw-r--r--svx/inc/svx/sdangitm.hxx1
-rw-r--r--svx/inc/svx/sdasaitm.hxx1
-rw-r--r--svx/inc/svx/sdasitm.hxx41
-rw-r--r--svx/inc/svx/sdgcoitm.hxx6
-rw-r--r--svx/inc/svx/sdgcpitm.hxx2
-rw-r--r--svx/inc/svx/sdggaitm.hxx2
-rw-r--r--svx/inc/svx/sdginitm.hxx2
-rw-r--r--svx/inc/svx/sdgluitm.hxx4
-rw-r--r--svx/inc/svx/sdgmoitm.hxx2
-rw-r--r--svx/inc/svx/sdgtritm.hxx1
-rw-r--r--svx/inc/svx/sdmetitm.hxx5
-rw-r--r--svx/inc/svx/sdooitm.hxx2
-rw-r--r--svx/inc/svx/sdprcitm.hxx2
-rw-r--r--svx/inc/svx/sdr/contact/displayinfo.hxx8
-rw-r--r--svx/inc/svx/sdr/contact/objectcontact.hxx23
-rw-r--r--svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx6
-rw-r--r--svx/inc/svx/sdr/contact/objectcontactofpageview.hxx8
-rw-r--r--svx/inc/svx/sdr/contact/viewcontact.hxx16
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofe3d.hxx3
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx1
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx5
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx3
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx4
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontact.hxx11
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx3
-rw-r--r--svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx2
-rw-r--r--svx/inc/svx/sdr/overlay/overlayhatchrect.hxx18
-rw-r--r--svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx2
-rw-r--r--svx/inc/svx/sdr/overlay/overlayobject.hxx8
-rw-r--r--svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx4
-rw-r--r--svx/inc/svx/sdr/overlay/overlayselection.hxx2
-rw-r--r--svx/inc/svx/sdr/overlay/overlaytools.hxx34
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx11
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx10
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx9
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx5
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx33
-rw-r--r--svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/attributeproperties.hxx27
-rw-r--r--svx/inc/svx/sdr/properties/captionproperties.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/connectorproperties.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/customshapeproperties.hxx4
-rw-r--r--svx/inc/svx/sdr/properties/defaultproperties.hxx5
-rw-r--r--svx/inc/svx/sdr/properties/e3dcompoundproperties.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/e3dproperties.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/e3dsceneproperties.hxx7
-rw-r--r--svx/inc/svx/sdr/properties/emptyproperties.hxx4
-rw-r--r--svx/inc/svx/sdr/properties/graphicproperties.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/groupproperties.hxx9
-rw-r--r--svx/inc/svx/sdr/properties/itemsettools.hxx14
-rw-r--r--svx/inc/svx/sdr/properties/measureproperties.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/properties.hxx25
-rw-r--r--svx/inc/svx/sdr/properties/rectangleproperties.hxx2
-rw-r--r--svx/inc/svx/sdr/properties/textproperties.hxx2
-rw-r--r--svx/inc/svx/sdrhittesthelper.hxx26
-rw-r--r--svx/inc/svx/sdrmasterpagedescriptor.hxx23
-rwxr-xr-xsvx/inc/svx/sdrobjectfactory.hxx116
-rw-r--r--svx/inc/svx/sdrpagewindow.hxx2
-rw-r--r--svx/inc/svx/sdrpaintwindow.hxx9
-rw-r--r--svx/inc/svx/sdrselection.hxx141
-rw-r--r--svx/inc/svx/sdrtexthelpers.hxx41
-rw-r--r--svx/inc/svx/sdtaaitm.hxx5
-rw-r--r--svx/inc/svx/sdtaditm.hxx1
-rw-r--r--svx/inc/svx/sdtaitm.hxx2
-rw-r--r--svx/inc/svx/sdtakitm.hxx1
-rw-r--r--svx/inc/svx/sdtayitm.hxx1
-rw-r--r--svx/inc/svx/sdtfchim.hxx1
-rw-r--r--svx/inc/svx/sdtfsitm.hxx2
-rw-r--r--svx/inc/svx/sdynitm.hxx1
-rw-r--r--svx/inc/svx/sphere3d.hxx29
-rw-r--r--svx/inc/svx/srchdlg.hxx6
-rw-r--r--svx/inc/svx/svdattr.hxx21
-rw-r--r--svx/inc/svx/svdattrx.hxx43
-rw-r--r--svx/inc/svx/svdcrtv.hxx171
-rw-r--r--svx/inc/svx/svddef.hxx8
-rw-r--r--svx/inc/svx/svddrag.hxx260
-rw-r--r--svx/inc/svx/svddrgmt.hxx113
-rw-r--r--svx/inc/svx/svddrgv.hxx294
-rw-r--r--svx/inc/svx/svdedtv.hxx333
-rw-r--r--svx/inc/svx/svdedxv.hxx212
-rw-r--r--svx/inc/svx/svdetc.hxx14
-rw-r--r--svx/inc/svx/svdglev.hxx69
-rw-r--r--svx/inc/svx/svdglue.hxx165
-rw-r--r--svx/inc/svx/svdhdl.hxx479
-rw-r--r--svx/inc/svx/svdhlpln.hxx94
-rw-r--r--svx/inc/svx/svditer.hxx61
-rw-r--r--svx/inc/svx/svdlayer.hxx125
-rw-r--r--svx/inc/svx/svdlegacy.hxx84
-rw-r--r--svx/inc/svx/svdmodel.hxx751
-rw-r--r--svx/inc/svx/svdmrkv.hxx548
-rw-r--r--svx/inc/svx/svdoashp.hxx138
-rw-r--r--svx/inc/svx/svdoattr.hxx32
-rw-r--r--svx/inc/svx/svdobj.hxx1143
-rw-r--r--svx/inc/svx/svdocapt.hxx77
-rw-r--r--svx/inc/svx/svdocirc.hxx124
-rw-r--r--svx/inc/svx/svdoedge.hxx271
-rw-r--r--svx/inc/svx/svdograf.hxx93
-rw-r--r--svx/inc/svx/svdogrp.hxx101
-rw-r--r--svx/inc/svx/svdomeas.hxx96
-rw-r--r--svx/inc/svx/svdomedia.hxx25
-rw-r--r--svx/inc/svx/svdoole2.hxx68
-rw-r--r--svx/inc/svx/svdopage.hxx29
-rw-r--r--svx/inc/svx/svdopath.hxx176
-rw-r--r--svx/inc/svx/svdorect.hxx72
-rw-r--r--svx/inc/svx/svdotable.hxx118
-rw-r--r--svx/inc/svx/svdotext.hxx357
-rw-r--r--svx/inc/svx/svdouno.hxx37
-rw-r--r--svx/inc/svx/svdpage.hxx571
-rw-r--r--svx/inc/svx/svdpagv.hxx191
-rw-r--r--svx/inc/svx/svdpntv.hxx511
-rw-r--r--svx/inc/svx/svdpoev.hxx62
-rw-r--r--svx/inc/svx/svdsnpv.hxx253
-rw-r--r--svx/inc/svx/svdsob.hxx27
-rw-r--r--svx/inc/svx/svdstr.hrc9
-rw-r--r--svx/inc/svx/svdtext.hxx14
-rw-r--r--svx/inc/svx/svdtrans.hxx188
-rw-r--r--svx/inc/svx/svdtypes.hxx54
-rw-r--r--svx/inc/svx/svdundo.hxx574
-rw-r--r--svx/inc/svx/svdview.hxx288
-rw-r--r--svx/inc/svx/svdxcgv.hxx104
-rw-r--r--svx/inc/svx/svx3ditems.hxx224
-rw-r--r--svx/inc/svx/svxgrahicitem.hxx1
-rw-r--r--svx/inc/svx/sxcecitm.hxx38
-rw-r--r--svx/inc/svx/sxctitm.hxx1
-rw-r--r--svx/inc/svx/sxekitm.hxx1
-rw-r--r--svx/inc/svx/sxelditm.hxx9
-rw-r--r--svx/inc/svx/sxenditm.hxx16
-rw-r--r--svx/inc/svx/sxfiitm.hxx1
-rw-r--r--svx/inc/svx/sxmkitm.hxx1
-rw-r--r--svx/inc/svx/sxmtpitm.hxx2
-rw-r--r--svx/inc/svx/sxmuitm.hxx1
-rw-r--r--svx/inc/svx/sxsaitm.hxx10
-rw-r--r--svx/inc/svx/sxsiitm.hxx1
-rw-r--r--svx/inc/svx/unoapi.hxx5
-rw-r--r--svx/inc/svx/unomod.hxx12
-rw-r--r--svx/inc/svx/unomodel.hxx4
-rw-r--r--svx/inc/svx/unopage.hxx15
-rw-r--r--svx/inc/svx/unoprov.hxx56
-rw-r--r--svx/inc/svx/unoshape.hxx140
-rw-r--r--svx/inc/svx/unoshprp.hxx18
-rw-r--r--svx/inc/svx/unoshtxt.hxx2
-rw-r--r--svx/inc/svx/view3d.hxx72
-rw-r--r--svx/inc/svx/viewlayoutitem.hxx3
-rw-r--r--svx/inc/svx/xbtmpit.hxx2
-rw-r--r--svx/inc/svx/xcolit.hxx1
-rw-r--r--svx/inc/svx/xexch.hxx2
-rw-r--r--svx/inc/svx/xfillit0.hxx2
-rw-r--r--svx/inc/svx/xflasit.hxx1
-rw-r--r--svx/inc/svx/xflbckit.hxx2
-rw-r--r--svx/inc/svx/xflbmpit.hxx1
-rw-r--r--svx/inc/svx/xflbmsli.hxx1
-rw-r--r--svx/inc/svx/xflbmsxy.hxx6
-rw-r--r--svx/inc/svx/xflbmtit.hxx1
-rw-r--r--svx/inc/svx/xflboxy.hxx2
-rw-r--r--svx/inc/svx/xflbstit.hxx1
-rw-r--r--svx/inc/svx/xflbtoxy.hxx2
-rw-r--r--svx/inc/svx/xflclit.hxx2
-rw-r--r--svx/inc/svx/xflftrit.hxx2
-rw-r--r--svx/inc/svx/xflgrit.hxx2
-rw-r--r--svx/inc/svx/xflhtit.hxx10
-rw-r--r--svx/inc/svx/xfltrit.hxx1
-rw-r--r--svx/inc/svx/xftadit.hxx2
-rw-r--r--svx/inc/svx/xftdiit.hxx2
-rw-r--r--svx/inc/svx/xftmrit.hxx2
-rw-r--r--svx/inc/svx/xftouit.hxx2
-rw-r--r--svx/inc/svx/xftsfit.hxx2
-rw-r--r--svx/inc/svx/xftshcit.hxx2
-rw-r--r--svx/inc/svx/xftshit.hxx2
-rw-r--r--svx/inc/svx/xftshtit.hxx1
-rw-r--r--svx/inc/svx/xftshxy.hxx4
-rw-r--r--svx/inc/svx/xftstit.hxx2
-rw-r--r--svx/inc/svx/xgrscit.hxx1
-rw-r--r--svx/inc/svx/xit.hxx1
-rw-r--r--svx/inc/svx/xlineit0.hxx2
-rw-r--r--svx/inc/svx/xlinjoit.hxx1
-rw-r--r--svx/inc/svx/xlnasit.hxx1
-rw-r--r--svx/inc/svx/xlncapit.hxx3
-rw-r--r--svx/inc/svx/xlnclit.hxx2
-rw-r--r--svx/inc/svx/xlndsit.hxx6
-rw-r--r--svx/inc/svx/xlnedcit.hxx1
-rw-r--r--svx/inc/svx/xlnedit.hxx2
-rw-r--r--svx/inc/svx/xlnedwit.hxx1
-rw-r--r--svx/inc/svx/xlnstcit.hxx1
-rw-r--r--svx/inc/svx/xlnstit.hxx2
-rw-r--r--svx/inc/svx/xlnstwit.hxx1
-rw-r--r--svx/inc/svx/xlntrit.hxx1
-rw-r--r--svx/inc/svx/xlnwtit.hxx2
-rw-r--r--svx/inc/svx/xsflclit.hxx1
-rw-r--r--svx/inc/svx/xtextit0.hxx4
-rw-r--r--svx/inc/svx/zoomitem.hxx5
-rw-r--r--svx/inc/svx/zoomslideritem.hxx3
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/sdi/svxitems.sdi2
-rw-r--r--svx/source/accessibility/AccessibleControlShape.cxx2
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx22
-rw-r--r--svx/source/accessibility/AccessibleShape.cxx6
-rw-r--r--svx/source/accessibility/AccessibleTextEventQueue.cxx4
-rw-r--r--svx/source/accessibility/AccessibleTextEventQueue.hxx5
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx94
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx48
-rw-r--r--svx/source/accessibility/ShapeTypeHandler.cxx6
-rw-r--r--svx/source/accessibility/SvxShapeTypes.cxx8
-rw-r--r--svx/source/accessibility/svxrectctaccessiblecontext.cxx13
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx588
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx863
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.hxx54
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx272
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx40
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeHandle.cxx4
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx1
-rw-r--r--svx/source/dialog/_bmpmask.cxx3
-rw-r--r--svx/source/dialog/_contdlg.cxx29
-rw-r--r--svx/source/dialog/connctrl.cxx144
-rw-r--r--svx/source/dialog/contwnd.cxx25
-rw-r--r--svx/source/dialog/ctredlin.cxx6
-rw-r--r--svx/source/dialog/dlgctl3d.cxx164
-rw-r--r--svx/source/dialog/dlgctrl.cxx56
-rw-r--r--svx/source/dialog/fontlb.cxx8
-rw-r--r--svx/source/dialog/fontwork.cxx222
-rw-r--r--svx/source/dialog/graphctl.cxx235
-rw-r--r--svx/source/dialog/grfflt.cxx441
-rw-r--r--svx/source/dialog/hdft.cxx6
-rw-r--r--svx/source/dialog/imapdlg.cxx21
-rw-r--r--svx/source/dialog/imapwnd.cxx200
-rw-r--r--svx/source/dialog/imapwnd.hxx8
-rw-r--r--svx/source/dialog/measctrl.cxx6
-rw-r--r--svx/source/dialog/optgrid.cxx110
-rw-r--r--svx/source/dialog/pagectrl.cxx2
-rw-r--r--svx/source/dialog/rlrcitem.cxx44
-rw-r--r--svx/source/dialog/rulritem.cxx15
-rw-r--r--svx/source/dialog/srchctrl.cxx10
-rw-r--r--svx/source/dialog/svxgrahicitem.cxx5
-rw-r--r--svx/source/dialog/svxruler.cxx14
-rw-r--r--svx/source/dialog/swframeexample.cxx5
-rw-r--r--svx/source/engine3d/cube3d.cxx89
-rw-r--r--svx/source/engine3d/dragmt3d.cxx152
-rw-r--r--svx/source/engine3d/e3dsceneupdater.cxx9
-rw-r--r--svx/source/engine3d/e3dundo.cxx10
-rw-r--r--svx/source/engine3d/extrud3d.cxx79
-rw-r--r--svx/source/engine3d/float3d.cxx201
-rw-r--r--svx/source/engine3d/helperhittest3d.cxx4
-rw-r--r--svx/source/engine3d/helperminimaldepth3d.cxx2
-rw-r--r--svx/source/engine3d/lathe3d.cxx88
-rw-r--r--svx/source/engine3d/obj3d.cxx895
-rw-r--r--svx/source/engine3d/objfac3d.cxx88
-rw-r--r--svx/source/engine3d/polygn3d.cxx145
-rw-r--r--svx/source/engine3d/scene3d.cxx726
-rw-r--r--svx/source/engine3d/sphere3d.cxx90
-rw-r--r--svx/source/engine3d/svx3ditems.cxx273
-rw-r--r--svx/source/engine3d/view3d.cxx955
-rw-r--r--svx/source/engine3d/view3d1.cxx81
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx3
-rw-r--r--svx/source/fmcomp/fmgridif.cxx9
-rw-r--r--svx/source/fmcomp/gridcell.cxx90
-rw-r--r--svx/source/fmcomp/gridctrl.cxx25
-rw-r--r--svx/source/form/ParseContext.cxx3
-rw-r--r--svx/source/form/datanavi.cxx6
-rw-r--r--svx/source/form/filtnav.cxx179
-rw-r--r--svx/source/form/fmPropBrw.cxx6
-rw-r--r--svx/source/form/fmdmod.cxx4
-rw-r--r--svx/source/form/fmdpage.cxx16
-rw-r--r--svx/source/form/fmexpl.cxx58
-rw-r--r--svx/source/form/fmitems.cxx1
-rw-r--r--svx/source/form/fmmodel.cxx78
-rw-r--r--svx/source/form/fmobj.cxx421
-rw-r--r--svx/source/form/fmobjfac.cxx16
-rw-r--r--svx/source/form/fmpage.cxx140
-rw-r--r--svx/source/form/fmpgeimp.cxx33
-rw-r--r--svx/source/form/fmshell.cxx62
-rw-r--r--svx/source/form/fmshimp.cxx97
-rw-r--r--svx/source/form/fmsrcimp.cxx12
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx18
-rw-r--r--svx/source/form/fmtools.cxx3
-rw-r--r--svx/source/form/fmundo.cxx172
-rw-r--r--svx/source/form/fmview.cxx99
-rw-r--r--svx/source/form/fmvwimp.cxx297
-rw-r--r--svx/source/form/formcontrolfactory.cxx15
-rw-r--r--svx/source/form/formcontroller.cxx5
-rw-r--r--svx/source/form/formdispatchinterceptor.cxx5
-rw-r--r--svx/source/form/navigatortree.cxx318
-rw-r--r--svx/source/form/navigatortreemodel.cxx131
-rw-r--r--svx/source/form/tabwin.cxx11
-rw-r--r--svx/source/form/tbxform.cxx14
-rw-r--r--svx/source/gallery2/codec.cxx1
-rw-r--r--svx/source/gallery2/galbrws2.cxx12
-rw-r--r--svx/source/gallery2/galmisc.cxx21
-rw-r--r--svx/source/gallery2/galobj.cxx12
-rw-r--r--svx/source/gallery2/galtheme.cxx15
-rw-r--r--svx/source/inc/clonelist.hxx19
-rw-r--r--svx/source/inc/filtnav.hxx7
-rw-r--r--svx/source/inc/fmexpl.hxx18
-rw-r--r--svx/source/inc/fmitems.hxx2
-rw-r--r--svx/source/inc/fmobj.hxx34
-rw-r--r--svx/source/inc/fmshimp.hxx8
-rw-r--r--svx/source/inc/fmvwimp.hxx12
-rw-r--r--svx/source/inc/formcontrolfactory.hxx4
-rw-r--r--svx/source/inc/frmselimpl.hxx1
-rw-r--r--svx/source/inc/gridcell.hxx21
-rw-r--r--svx/source/inc/unopolyhelper.hxx10
-rw-r--r--svx/source/items/SmartTagItem.cxx20
-rw-r--r--svx/source/items/algitem.cxx12
-rw-r--r--svx/source/items/chrtitem.cxx12
-rw-r--r--svx/source/items/clipfmtitem.cxx3
-rw-r--r--svx/source/items/customshapeitem.cxx28
-rw-r--r--svx/source/items/drawitem.cxx20
-rw-r--r--svx/source/items/e3ditem.cxx19
-rw-r--r--svx/source/items/grfitem.cxx6
-rw-r--r--svx/source/items/hlnkitem.cxx6
-rw-r--r--svx/source/items/numinf.cxx4
-rw-r--r--svx/source/items/ofaitem.cxx40
-rw-r--r--svx/source/items/pageitem.cxx15
-rw-r--r--svx/source/items/postattr.cxx6
-rw-r--r--svx/source/items/rotmodit.cxx6
-rw-r--r--svx/source/items/viewlayoutitem.cxx3
-rw-r--r--svx/source/items/zoomitem.cxx4
-rw-r--r--svx/source/items/zoomslideritem.cxx4
-rw-r--r--svx/source/mnuctrls/SmartTagCtl.cxx2
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx2
-rw-r--r--svx/source/mnuctrls/fntctl.cxx7
-rw-r--r--svx/source/mnuctrls/fntszctl.cxx9
-rw-r--r--svx/source/sdr/attribute/sdrformtextattribute.cxx12
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx22
-rw-r--r--svx/source/sdr/contact/objectcontact.cxx40
-rw-r--r--svx/source/sdr/contact/objectcontactofobjlistpainter.cxx6
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx85
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx91
-rw-r--r--svx/source/sdr/contact/viewcontactofe3d.cxx26
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dcube.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dscene.cxx37
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dsphere.cxx4
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx102
-rw-r--r--svx/source/sdr/contact/viewcontactofgroup.cxx9
-rw-r--r--svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx5
-rw-r--r--svx/source/sdr/contact/viewcontactofpageobj.cxx11
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx44
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcircobj.cxx44
-rw-r--r--svx/source/sdr/contact/viewcontactofsdredgeobj.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx24
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx28
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobj.cxx42
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx105
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx26
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx20
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx32
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx44
-rw-r--r--svx/source/sdr/contact/viewcontactofunocontrol.cxx35
-rw-r--r--svx/source/sdr/contact/viewobjectcontact.cxx131
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3d.cxx23
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgraphic.cxx6
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx4
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx40
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx2
-rwxr-xr-xsvx/source/sdr/contact/viewobjectcontactofsdrobj.cxx13
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx12
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx136
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx84
-rw-r--r--svx/source/sdr/overlay/overlayhatchrect.cxx32
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx4
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx9
-rw-r--r--svx/source/sdr/overlay/overlayobjectlist.cxx3
-rw-r--r--svx/source/sdr/overlay/overlaytools.cxx127
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx93
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx18
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx13
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx17
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx28
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx36
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx21
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx26
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx26
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx39
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx14
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx18
-rw-r--r--svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx112
-rw-r--r--svx/source/sdr/primitive3d/sdrattributecreator3d.cxx14
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx582
-rw-r--r--svx/source/sdr/properties/captionproperties.cxx2
-rw-r--r--svx/source/sdr/properties/connectorproperties.cxx2
-rw-r--r--svx/source/sdr/properties/customshapeproperties.cxx31
-rw-r--r--svx/source/sdr/properties/defaultproperties.cxx26
-rw-r--r--svx/source/sdr/properties/e3dcompoundproperties.cxx2
-rw-r--r--svx/source/sdr/properties/e3dproperties.cxx14
-rw-r--r--svx/source/sdr/properties/e3dsceneproperties.cxx65
-rw-r--r--svx/source/sdr/properties/emptyproperties.cxx7
-rw-r--r--svx/source/sdr/properties/graphicproperties.cxx8
-rw-r--r--svx/source/sdr/properties/groupproperties.cxx61
-rw-r--r--svx/source/sdr/properties/itemsettools.cxx42
-rw-r--r--svx/source/sdr/properties/measureproperties.cxx5
-rw-r--r--svx/source/sdr/properties/oleproperties.cxx1
-rw-r--r--svx/source/sdr/properties/pageproperties.cxx3
-rw-r--r--svx/source/sdr/properties/properties.cxx75
-rw-r--r--svx/source/sdr/properties/rectangleproperties.cxx12
-rw-r--r--svx/source/sdr/properties/textproperties.cxx57
-rw-r--r--svx/source/stbctrls/insctrl.cxx2
-rw-r--r--svx/source/stbctrls/modctrl.cxx2
-rw-r--r--svx/source/stbctrls/pszctrl.cxx12
-rw-r--r--svx/source/stbctrls/selctrl.cxx2
-rw-r--r--svx/source/stbctrls/xmlsecctrl.cxx24
-rw-r--r--svx/source/stbctrls/zoomctrl.cxx4
-rw-r--r--svx/source/stbctrls/zoomsliderctrl.cxx4
-rw-r--r--svx/source/svdraw/charthelper.cxx42
-rw-r--r--svx/source/svdraw/clonelist.cxx78
-rw-r--r--svx/source/svdraw/globaldrawitempool.cxx62
-rw-r--r--svx/source/svdraw/gluepoint.cxx175
-rw-r--r--svx/source/svdraw/gradtrns.cxx24
-rw-r--r--svx/source/svdraw/gradtrns.hxx14
-rw-r--r--svx/source/svdraw/polypolygoneditor.cxx241
-rw-r--r--svx/source/svdraw/sdrhittesthelper.cxx54
-rw-r--r--svx/source/svdraw/sdrmasterpagedescriptor.cxx27
-rwxr-xr-xsvx/source/svdraw/sdrobjectfactory.cxx244
-rw-r--r--svx/source/svdraw/sdrpagewindow.cxx53
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx11
-rw-r--r--svx/source/svdraw/sdrselection.cxx657
-rw-r--r--svx/source/svdraw/sdrtexthelpers.cxx249
-rw-r--r--svx/source/svdraw/selectioncontroller.cxx2
-rw-r--r--svx/source/svdraw/svdattr.cxx821
-rw-r--r--svx/source/svdraw/svdcrtv.cxx712
-rw-r--r--svx/source/svdraw/svddrag.cxx324
-rw-r--r--svx/source/svdraw/svddrgm1.hxx147
-rw-r--r--svx/source/svdraw/svddrgmt.cxx2936
-rw-r--r--svx/source/svdraw/svddrgv.cxx1107
-rw-r--r--svx/source/svdraw/svdedtv.cxx1435
-rw-r--r--svx/source/svdraw/svdedtv1.cxx2796
-rw-r--r--svx/source/svdraw/svdedtv2.cxx2557
-rw-r--r--svx/source/svdraw/svdedxv.cxx2152
-rw-r--r--svx/source/svdraw/svdetc.cxx127
-rw-r--r--svx/source/svdraw/svdfmtf.cxx851
-rw-r--r--svx/source/svdraw/svdfmtf.hxx37
-rw-r--r--svx/source/svdraw/svdglev.cxx575
-rw-r--r--svx/source/svdraw/svdglue.cxx631
-rw-r--r--svx/source/svdraw/svdhdl.cxx2479
-rw-r--r--svx/source/svdraw/svdhlpln.cxx196
-rw-r--r--svx/source/svdraw/svdibrow.cxx155
-rw-r--r--svx/source/svdraw/svditer.cxx92
-rw-r--r--svx/source/svdraw/svdlayer.cxx507
-rw-r--r--svx/source/svdraw/svdlegacy.cxx469
-rw-r--r--svx/source/svdraw/svdmodel.cxx2183
-rw-r--r--svx/source/svdraw/svdmrkv.cxx2365
-rw-r--r--svx/source/svdraw/svdmrkv1.cxx819
-rw-r--r--svx/source/svdraw/svdoashp.cxx2045
-rw-r--r--svx/source/svdraw/svdoattr.cxx69
-rw-r--r--svx/source/svdraw/svdobj.cxx3253
-rw-r--r--svx/source/svdraw/svdocapt.cxx485
-rw-r--r--svx/source/svdraw/svdocirc.cxx1323
-rw-r--r--svx/source/svdraw/svdoedge.cxx2329
-rw-r--r--svx/source/svdraw/svdograf.cxx863
-rw-r--r--svx/source/svdraw/svdogrp.cxx863
-rw-r--r--svx/source/svdraw/svdomeas.cxx852
-rw-r--r--svx/source/svdraw/svdomedia.cxx166
-rw-r--r--svx/source/svdraw/svdoole2.cxx753
-rw-r--r--svx/source/svdraw/svdopage.cxx132
-rw-r--r--svx/source/svdraw/svdopath.cxx2342
-rw-r--r--svx/source/svdraw/svdorect.cxx574
-rw-r--r--svx/source/svdraw/svdotext.cxx1606
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx748
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx178
-rw-r--r--svx/source/svdraw/svdotxat.cxx535
-rw-r--r--svx/source/svdraw/svdotxdr.cxx251
-rw-r--r--svx/source/svdraw/svdotxed.cxx332
-rw-r--r--svx/source/svdraw/svdotxfl.cxx12
-rw-r--r--svx/source/svdraw/svdotxln.cxx123
-rw-r--r--svx/source/svdraw/svdotxtr.cxx397
-rw-r--r--svx/source/svdraw/svdouno.cxx322
-rw-r--r--svx/source/svdraw/svdoutl.cxx8
-rw-r--r--svx/source/svdraw/svdpage.cxx1858
-rw-r--r--svx/source/svdraw/svdpagv.cxx812
-rw-r--r--svx/source/svdraw/svdpntv.cxx966
-rw-r--r--svx/source/svdraw/svdpoev.cxx758
-rw-r--r--svx/source/svdraw/svdsnpv.cxx737
-rw-r--r--svx/source/svdraw/svdsob.cxx208
-rw-r--r--svx/source/svdraw/svdstr.src38
-rw-r--r--svx/source/svdraw/svdtext.cxx145
-rw-r--r--svx/source/svdraw/svdtrans.cxx808
-rw-r--r--svx/source/svdraw/svdundo.cxx1308
-rw-r--r--svx/source/svdraw/svdview.cxx2017
-rw-r--r--svx/source/svdraw/svdxcgv.cxx856
-rw-r--r--svx/source/table/accessiblecell.cxx4
-rw-r--r--svx/source/table/cell.cxx642
-rw-r--r--svx/source/table/cell.hxx6
-rw-r--r--svx/source/table/cellcursor.cxx22
-rw-r--r--svx/source/table/celleditsource.cxx79
-rw-r--r--svx/source/table/celleditsource.hxx2
-rw-r--r--svx/source/table/svdotable.cxx1011
-rw-r--r--svx/source/table/tablecolumn.cxx7
-rw-r--r--svx/source/table/tablecontroller.cxx74
-rw-r--r--svx/source/table/tablehandles.cxx168
-rw-r--r--svx/source/table/tablehandles.hxx24
-rw-r--r--svx/source/table/tablelayouter.cxx33
-rw-r--r--svx/source/table/tablelayouter.hxx6
-rw-r--r--svx/source/table/tablemodel.cxx151
-rw-r--r--svx/source/table/tablerow.cxx9
-rw-r--r--svx/source/table/tablertfimporter.cxx13
-rw-r--r--svx/source/table/tableundo.cxx35
-rw-r--r--svx/source/table/tableundo.hxx6
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx91
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx8
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx2
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx12
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx99
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx376
-rw-r--r--svx/source/tbxctrls/layctrl.cxx2
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx4
-rw-r--r--svx/source/tbxctrls/linectrl.cxx27
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx25
-rw-r--r--svx/source/toolbars/extrusionbar.cxx611
-rw-r--r--svx/source/toolbars/fontworkbar.cxx281
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx209
-rw-r--r--svx/source/unodraw/UnoNameItemTable.cxx4
-rw-r--r--svx/source/unodraw/XPropertyTable.cxx11
-rw-r--r--svx/source/unodraw/gluepts.cxx39
-rw-r--r--svx/source/unodraw/tableshape.cxx158
-rw-r--r--svx/source/unodraw/unomlstr.cxx2
-rw-r--r--svx/source/unodraw/unomod.cxx135
-rw-r--r--svx/source/unodraw/unomtabl.cxx4
-rw-r--r--svx/source/unodraw/unopage.cxx679
-rw-r--r--svx/source/unodraw/unoprov.cxx160
-rw-r--r--svx/source/unodraw/unoshap2.cxx1656
-rw-r--r--svx/source/unodraw/unoshap3.cxx1087
-rw-r--r--svx/source/unodraw/unoshap4.cxx607
-rw-r--r--svx/source/unodraw/unoshape.cxx2773
-rw-r--r--svx/source/unodraw/unoshtxt.cxx227
-rw-r--r--svx/source/unogallery/unogaltheme.cxx37
-rw-r--r--svx/source/xml/xmleohlp.cxx6
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx4
-rw-r--r--svx/source/xoutdev/_xpoly.cxx18
-rw-r--r--svx/source/xoutdev/xattr.cxx138
-rw-r--r--svx/source/xoutdev/xattr2.cxx42
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx6
-rw-r--r--svx/source/xoutdev/xexch.cxx3
-rw-r--r--svx/source/xoutdev/xtabdash.cxx20
-rw-r--r--svx/source/xoutdev/xtabgrdt.cxx12
-rw-r--r--svx/source/xoutdev/xtabhtch.cxx19
-rw-r--r--svx/source/xoutdev/xtablend.cxx20
-rw-r--r--svx/workben/edittest.cxx10
-rw-r--r--sw/inc/IDocumentDrawModelAccess.hxx10
-rw-r--r--sw/inc/IDocumentMarkAccess.hxx3
-rw-r--r--sw/inc/anchoreddrawobject.hxx14
-rw-r--r--sw/inc/anchoredobject.hxx3
-rw-r--r--sw/inc/calbck.hxx36
-rw-r--r--sw/inc/ccoll.hxx2
-rw-r--r--sw/inc/charfmt.hxx1
-rw-r--r--sw/inc/crsrsh.hxx5
-rw-r--r--sw/inc/dcontact.hxx235
-rw-r--r--sw/inc/doc.hxx14
-rw-r--r--sw/inc/docsh.hxx1
-rw-r--r--sw/inc/dpage.hxx19
-rw-r--r--sw/inc/drawdoc.hxx4
-rw-r--r--sw/inc/fchrfmt.hxx2
-rw-r--r--sw/inc/fesh.hxx46
-rw-r--r--sw/inc/fmtautofmt.hxx2
-rw-r--r--sw/inc/fmtcol.hxx8
-rw-r--r--sw/inc/fmtfld.hxx3
-rw-r--r--sw/inc/fmtfollowtextflow.hxx2
-rw-r--r--sw/inc/fmtftntx.hxx2
-rw-r--r--sw/inc/fmthdft.hxx4
-rw-r--r--sw/inc/fmtinfmt.hxx3
-rw-r--r--sw/inc/fmtline.hxx3
-rw-r--r--sw/inc/fmtornt.hxx2
-rw-r--r--sw/inc/fmtpdsc.hxx2
-rw-r--r--sw/inc/fmtwrapinfluenceonobjpos.hxx2
-rw-r--r--sw/inc/format.hxx2
-rw-r--r--sw/inc/frmfmt.hxx8
-rw-r--r--sw/inc/globdoc.hxx1
-rw-r--r--sw/inc/grfatr.hxx3
-rw-r--r--sw/inc/index.hxx2
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/inc/node.hxx2
-rw-r--r--sw/inc/paratr.hxx9
-rw-r--r--sw/inc/pch/precompiled_sw.hxx3
-rw-r--r--sw/inc/redline.hxx1
-rw-r--r--sw/inc/section.hxx8
-rw-r--r--sw/inc/swacorr.hxx2
-rw-r--r--sw/inc/swatrset.hxx2
-rw-r--r--sw/inc/swbaslnk.hxx2
-rw-r--r--sw/inc/swddetbl.hxx1
-rw-r--r--sw/inc/swerror.h4
-rw-r--r--sw/inc/switerator.hxx61
-rw-r--r--sw/inc/swmodule.hxx1
-rw-r--r--sw/inc/swtable.hxx15
-rw-r--r--sw/inc/swtblfmt.hxx5
-rw-r--r--sw/inc/tox.hxx2
-rw-r--r--sw/inc/txtatr.hxx1
-rw-r--r--sw/inc/txtinet.hxx1
-rw-r--r--sw/inc/unodraw.hxx16
-rw-r--r--sw/inc/unofield.hxx4
-rw-r--r--sw/inc/unoframe.hxx5
-rw-r--r--sw/inc/unoredline.hxx2
-rw-r--r--sw/inc/unostyle.hxx2
-rw-r--r--sw/inc/unotbl.hxx11
-rw-r--r--sw/inc/unotxdoc.hxx3
-rw-r--r--sw/inc/viewsh.hxx4
-rw-r--r--sw/inc/wdocsh.hxx1
-rw-r--r--sw/source/core/access/acccell.cxx7
-rw-r--r--sw/source/core/access/acccontext.cxx25
-rw-r--r--sw/source/core/access/accdoc.cxx7
-rw-r--r--sw/source/core/access/accframebase.cxx7
-rw-r--r--sw/source/core/access/accfrmobj.cxx18
-rw-r--r--sw/source/core/access/accfrmobjmap.cxx2
-rw-r--r--sw/source/core/access/accmap.cxx42
-rw-r--r--sw/source/core/access/accpara.cxx7
-rw-r--r--sw/source/core/access/accselectionhelper.cxx12
-rw-r--r--sw/source/core/attr/calbck.cxx139
-rw-r--r--sw/source/core/attr/cellatr.cxx3
-rw-r--r--sw/source/core/attr/fmtfollowtextflow.cxx2
-rw-r--r--sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx2
-rw-r--r--sw/source/core/attr/format.cxx8
-rw-r--r--sw/source/core/attr/swatrset.cxx6
-rw-r--r--sw/source/core/bastyp/index.cxx3
-rw-r--r--sw/source/core/crsr/crossrefbookmark.cxx16
-rw-r--r--sw/source/core/crsr/crsrsh.cxx21
-rw-r--r--sw/source/core/crsr/crstrvl.cxx8
-rw-r--r--sw/source/core/crsr/trvltbl.cxx6
-rw-r--r--sw/source/core/crsr/viscrs.cxx4
-rw-r--r--sw/source/core/doc/doc.cxx42
-rw-r--r--sw/source/core/doc/docbm.cxx41
-rw-r--r--sw/source/core/doc/doccorr.cxx8
-rw-r--r--sw/source/core/doc/docdesc.cxx32
-rw-r--r--sw/source/core/doc/docdraw.cxx545
-rw-r--r--sw/source/core/doc/docedt.cxx8
-rw-r--r--sw/source/core/doc/docfld.cxx6
-rw-r--r--sw/source/core/doc/docfly.cxx28
-rw-r--r--sw/source/core/doc/docfmt.cxx13
-rw-r--r--sw/source/core/doc/doclay.cxx31
-rw-r--r--sw/source/core/doc/docnum.cxx2
-rw-r--r--sw/source/core/doc/docredln.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx20
-rw-r--r--sw/source/core/doc/fmtcol.cxx5
-rw-r--r--sw/source/core/doc/notxtfrm.cxx23
-rw-r--r--sw/source/core/doc/number.cxx2
-rw-r--r--sw/source/core/doc/poolfmt.cxx2
-rw-r--r--sw/source/core/doc/swserv.cxx35
-rw-r--r--sw/source/core/doc/tblrwcl.cxx2
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/docnode/ndcopy.cxx2
-rw-r--r--sw/source/core/docnode/ndsect.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx22
-rw-r--r--sw/source/core/docnode/node.cxx6
-rw-r--r--sw/source/core/docnode/nodes.cxx2
-rw-r--r--sw/source/core/docnode/section.cxx30
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx10
-rw-r--r--sw/source/core/draw/dcontact.cxx1253
-rw-r--r--sw/source/core/draw/dflyobj.cxx649
-rw-r--r--sw/source/core/draw/dobjfac.cxx12
-rw-r--r--sw/source/core/draw/dpage.cxx74
-rw-r--r--sw/source/core/draw/drawdoc.cxx18
-rw-r--r--sw/source/core/draw/dview.cxx431
-rw-r--r--sw/source/core/edit/edfld.cxx2
-rw-r--r--sw/source/core/edit/edglbldc.cxx2
-rw-r--r--sw/source/core/edit/edtab.cxx8
-rw-r--r--sw/source/core/edit/edtox.cxx8
-rw-r--r--sw/source/core/edit/edundo.cxx30
-rw-r--r--sw/source/core/edit/edws.cxx10
-rw-r--r--sw/source/core/fields/ddefld.cxx19
-rw-r--r--sw/source/core/fields/ddetbl.cxx2
-rw-r--r--sw/source/core/fields/docufld.cxx11
-rw-r--r--sw/source/core/frmedt/fecopy.cxx230
-rw-r--r--sw/source/core/frmedt/fefly1.cxx213
-rw-r--r--sw/source/core/frmedt/feshview.cxx981
-rw-r--r--sw/source/core/frmedt/fetab.cxx44
-rw-r--r--sw/source/core/frmedt/fews.cxx55
-rw-r--r--sw/source/core/graphic/grfatr.cxx7
-rw-r--r--sw/source/core/graphic/ndgrf.cxx4
-rw-r--r--sw/source/core/inc/UndoCore.hxx21
-rw-r--r--sw/source/core/inc/UndoDraw.hxx33
-rw-r--r--sw/source/core/inc/cntfrm.hxx1
-rw-r--r--sw/source/core/inc/crossrefbookmark.hxx1
-rw-r--r--sw/source/core/inc/dflyobj.hxx108
-rw-r--r--sw/source/core/inc/doctxm.hxx1
-rw-r--r--sw/source/core/inc/dview.hxx19
-rw-r--r--sw/source/core/inc/flyfrm.hxx2
-rw-r--r--sw/source/core/inc/flyfrms.hxx8
-rw-r--r--sw/source/core/inc/frame.hxx2
-rw-r--r--sw/source/core/inc/frmtool.hxx3
-rw-r--r--sw/source/core/inc/layfrm.hxx2
-rw-r--r--sw/source/core/inc/txtfrm.hxx1
-rw-r--r--sw/source/core/inc/viewimp.hxx7
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx85
-rw-r--r--sw/source/core/layout/anchoredobject.cxx4
-rw-r--r--sw/source/core/layout/atrfrm.cxx41
-rw-r--r--sw/source/core/layout/calcmove.cxx9
-rw-r--r--sw/source/core/layout/dbg_lay.cxx2
-rw-r--r--sw/source/core/layout/flowfrm.cxx4
-rw-r--r--sw/source/core/layout/fly.cxx75
-rw-r--r--sw/source/core/layout/flycnt.cxx3
-rw-r--r--sw/source/core/layout/flyincnt.cxx3
-rw-r--r--sw/source/core/layout/flylay.cxx107
-rw-r--r--sw/source/core/layout/flypos.cxx4
-rw-r--r--sw/source/core/layout/frmtool.cxx148
-rw-r--r--sw/source/core/layout/hffrm.cxx5
-rw-r--r--sw/source/core/layout/layact.cxx48
-rw-r--r--sw/source/core/layout/laycache.cxx28
-rw-r--r--sw/source/core/layout/newfrm.cxx16
-rw-r--r--sw/source/core/layout/objectformatter.cxx35
-rw-r--r--sw/source/core/layout/pagechg.cxx70
-rw-r--r--sw/source/core/layout/paintfrm.cxx63
-rw-r--r--sw/source/core/layout/sectfrm.cxx8
-rw-r--r--sw/source/core/layout/ssfrm.cxx26
-rw-r--r--sw/source/core/layout/tabfrm.cxx36
-rw-r--r--sw/source/core/layout/trvlfrm.cxx18
-rw-r--r--sw/source/core/layout/wsfrm.cxx34
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx23
-rw-r--r--sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx23
-rw-r--r--sw/source/core/objectpositioning/environmentofanchoredobject.cxx4
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx2
-rw-r--r--sw/source/core/para/paratr.cxx9
-rw-r--r--sw/source/core/sw3io/swacorr.cxx5
-rw-r--r--sw/source/core/table/swtable.cxx11
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx8
-rw-r--r--sw/source/core/text/itratr.cxx5
-rw-r--r--sw/source/core/text/itrcrsr.cxx2
-rw-r--r--sw/source/core/text/porfly.cxx4
-rw-r--r--sw/source/core/text/txtfly.cxx58
-rw-r--r--sw/source/core/text/txtfrm.cxx12
-rw-r--r--sw/source/core/text/txtftn.cxx2
-rw-r--r--sw/source/core/text/txtio.cxx14
-rw-r--r--sw/source/core/tox/tox.cxx2
-rw-r--r--sw/source/core/txtnode/atrfld.cxx3
-rw-r--r--sw/source/core/txtnode/chrfmt.cxx6
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx4
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx6
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx4
-rw-r--r--sw/source/core/undo/SwUndoField.cxx3
-rw-r--r--sw/source/core/undo/SwUndoTOXChange.cxx5
-rw-r--r--sw/source/core/undo/docundo.cxx5
-rw-r--r--sw/source/core/undo/rolbck.cxx4
-rw-r--r--sw/source/core/undo/unattr.cxx33
-rw-r--r--sw/source/core/undo/undobj1.cxx8
-rw-r--r--sw/source/core/undo/undraw.cxx149
-rw-r--r--sw/source/core/undo/unins.cxx2
-rw-r--r--sw/source/core/undo/unsect.cxx2
-rw-r--r--sw/source/core/undo/untbl.cxx6
-rw-r--r--sw/source/core/unocore/unobkm.cxx3
-rw-r--r--sw/source/core/unocore/unodraw.cxx321
-rw-r--r--sw/source/core/unocore/unofield.cxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx23
-rw-r--r--sw/source/core/unocore/unoredline.cxx1
-rw-r--r--sw/source/core/unocore/unosect.cxx3
-rw-r--r--sw/source/core/unocore/unostyle.cxx5
-rw-r--r--sw/source/core/unocore/unotbl.cxx9
-rw-r--r--sw/source/core/view/printdata.cxx3
-rw-r--r--sw/source/core/view/vdraw.cxx140
-rw-r--r--sw/source/core/view/viewimp.cxx44
-rw-r--r--sw/source/core/view/viewsh.cxx40
-rw-r--r--sw/source/core/view/vnew.cxx4
-rw-r--r--sw/source/core/view/vprint.cxx2
-rw-r--r--sw/source/filter/html/css1atr.cxx6
-rw-r--r--sw/source/filter/html/htmlbas.cxx2
-rw-r--r--sw/source/filter/html/htmldraw.cxx69
-rw-r--r--sw/source/filter/html/htmlform.cxx4
-rw-r--r--sw/source/filter/html/htmlforw.cxx11
-rw-r--r--sw/source/filter/html/swhtml.cxx11
-rw-r--r--sw/source/filter/inc/fltshell.hxx36
-rw-r--r--sw/source/filter/rtf/rtffly.cxx13
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx53
-rw-r--r--sw/source/filter/ww1/fltshell.cxx89
-rw-r--r--sw/source/filter/ww1/w1filter.cxx2
-rw-r--r--sw/source/filter/ww8/escher.hxx6
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx31
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx2
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx3
-rw-r--r--sw/source/filter/ww8/writerhelper.hxx4
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx133
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx6
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx15
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx20
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx75
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx217
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx39
-rw-r--r--sw/source/filter/ww8/ww8par.cxx183
-rw-r--r--sw/source/filter/ww8/ww8par.hxx51
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx35
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx85
-rw-r--r--sw/source/filter/ww8/ww8struc.hxx1
-rw-r--r--sw/source/filter/xml/swxml.cxx15
-rw-r--r--sw/source/filter/xml/xmlbrsh.cxx2
-rw-r--r--sw/source/filter/xml/xmlbrshi.hxx2
-rw-r--r--sw/source/filter/xml/xmlexp.cxx11
-rw-r--r--sw/source/filter/xml/xmlexpit.cxx35
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx27
-rw-r--r--sw/source/filter/xml/xmlimp.cxx17
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx28
-rw-r--r--sw/source/filter/xml/xmltble.cxx2
-rw-r--r--sw/source/filter/xml/xmltbli.cxx6
-rw-r--r--sw/source/filter/xml/xmltbli.hxx2
-rw-r--r--sw/source/ui/app/appenv.cxx4
-rw-r--r--sw/source/ui/app/apphdl.cxx75
-rw-r--r--sw/source/ui/app/appopt.cxx10
-rw-r--r--sw/source/ui/app/docsh.cxx32
-rw-r--r--sw/source/ui/app/docsh2.cxx48
-rw-r--r--sw/source/ui/app/docshdrw.cxx1
-rw-r--r--sw/source/ui/app/docshini.cxx14
-rw-r--r--sw/source/ui/app/docst.cxx6
-rw-r--r--sw/source/ui/app/docstyle.cxx7
-rw-r--r--sw/source/ui/app/swdll.cxx16
-rw-r--r--sw/source/ui/app/swmodul1.cxx21
-rw-r--r--sw/source/ui/app/swmodule.cxx4
-rw-r--r--sw/source/ui/chrdlg/ccoll.cxx3
-rw-r--r--sw/source/ui/config/cfgitems.cxx8
-rw-r--r--sw/source/ui/config/optpage.cxx17
-rw-r--r--sw/source/ui/config/viewopt.cxx2
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx3
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx6
-rw-r--r--sw/source/ui/dbui/mmconfigitem.cxx5
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx38
-rw-r--r--sw/source/ui/dialog/docstdlg.cxx4
-rw-r--r--sw/source/ui/dialog/regionsw.cxx2
-rw-r--r--sw/source/ui/dialog/swwrtshitem.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx8
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx19
-rw-r--r--sw/source/ui/docvw/AnchorOverlayObject.cxx21
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx37
-rw-r--r--sw/source/ui/docvw/ShadowOverlayObject.cxx16
-rw-r--r--sw/source/ui/docvw/SidebarTxtControl.cxx4
-rw-r--r--sw/source/ui/docvw/edtdd.cxx20
-rw-r--r--sw/source/ui/docvw/edtwin.cxx271
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx34
-rw-r--r--sw/source/ui/docvw/edtwin3.cxx16
-rw-r--r--sw/source/ui/docvw/romenu.cxx4
-rw-r--r--sw/source/ui/docvw/srcedtw.cxx25
-rw-r--r--sw/source/ui/envelp/envimg.cxx5
-rw-r--r--sw/source/ui/fldui/flddinf.cxx2
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx5
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx4
-rw-r--r--sw/source/ui/globdoc/globdoc.cxx3
-rw-r--r--sw/source/ui/inc/annotsh.hxx1
-rw-r--r--sw/source/ui/inc/basesh.hxx1
-rw-r--r--sw/source/ui/inc/beziersh.hxx1
-rw-r--r--sw/source/ui/inc/cfgitems.hxx4
-rw-r--r--sw/source/ui/inc/drawbase.hxx4
-rw-r--r--sw/source/ui/inc/drawsh.hxx1
-rw-r--r--sw/source/ui/inc/drformsh.hxx1
-rw-r--r--sw/source/ui/inc/drwbassh.hxx1
-rw-r--r--sw/source/ui/inc/drwtxtsh.hxx1
-rw-r--r--sw/source/ui/inc/edtwin.hxx10
-rw-r--r--sw/source/ui/inc/envimg.hxx3
-rw-r--r--sw/source/ui/inc/glshell.hxx2
-rw-r--r--sw/source/ui/inc/listsh.hxx1
-rw-r--r--sw/source/ui/inc/pview.hxx1
-rw-r--r--sw/source/ui/inc/srcview.hxx2
-rw-r--r--sw/source/ui/inc/swwrtshitem.hxx1
-rw-r--r--sw/source/ui/inc/tabsh.hxx1
-rw-r--r--sw/source/ui/inc/textsh.hxx1
-rw-r--r--sw/source/ui/inc/view.hxx8
-rw-r--r--sw/source/ui/inc/wformsh.hxx1
-rw-r--r--sw/source/ui/inc/wfrmsh.hxx1
-rw-r--r--sw/source/ui/inc/wgrfsh.hxx1
-rw-r--r--sw/source/ui/inc/wlistsh.hxx1
-rw-r--r--sw/source/ui/inc/wtabsh.hxx1
-rw-r--r--sw/source/ui/inc/wtextsh.hxx1
-rw-r--r--sw/source/ui/inc/wview.hxx1
-rw-r--r--sw/source/ui/index/cnttab.cxx15
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.cxx11
-rw-r--r--sw/source/ui/misc/docfnote.cxx2
-rw-r--r--sw/source/ui/misc/glshell.cxx5
-rw-r--r--sw/source/ui/misc/insfnote.cxx4
-rw-r--r--sw/source/ui/misc/num.cxx6
-rw-r--r--sw/source/ui/misc/srtdlg.cxx2
-rw-r--r--sw/source/ui/ribbar/conarc.cxx19
-rw-r--r--sw/source/ui/ribbar/concustomshape.cxx26
-rw-r--r--sw/source/ui/ribbar/conform.cxx28
-rw-r--r--sw/source/ui/ribbar/conpoly.cxx29
-rw-r--r--sw/source/ui/ribbar/conrect.cxx60
-rw-r--r--sw/source/ui/ribbar/drawbase.cxx119
-rw-r--r--sw/source/ui/ribbar/dselect.cxx2
-rw-r--r--sw/source/ui/ribbar/tbxanchr.cxx7
-rw-r--r--sw/source/ui/ribbar/workctrl.cxx2
-rw-r--r--sw/source/ui/shells/annotsh.cxx32
-rw-r--r--sw/source/ui/shells/basesh.cxx34
-rw-r--r--sw/source/ui/shells/beziersh.cxx27
-rw-r--r--sw/source/ui/shells/drawdlg.cxx44
-rw-r--r--sw/source/ui/shells/drawsh.cxx40
-rw-r--r--sw/source/ui/shells/drformsh.cxx16
-rw-r--r--sw/source/ui/shells/drwbassh.cxx74
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx28
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx33
-rw-r--r--sw/source/ui/shells/frmsh.cxx12
-rw-r--r--sw/source/ui/shells/grfshex.cxx10
-rw-r--r--sw/source/ui/shells/langhelper.cxx2
-rw-r--r--sw/source/ui/shells/listsh.cxx2
-rw-r--r--sw/source/ui/shells/mediash.cxx28
-rw-r--r--sw/source/ui/shells/tabsh.cxx18
-rw-r--r--sw/source/ui/shells/textdrw.cxx27
-rw-r--r--sw/source/ui/shells/textfld.cxx8
-rw-r--r--sw/source/ui/shells/textsh.cxx32
-rw-r--r--sw/source/ui/shells/textsh1.cxx18
-rw-r--r--sw/source/ui/shells/txtnum.cxx6
-rw-r--r--sw/source/ui/table/colwd.cxx7
-rw-r--r--sw/source/ui/table/rowht.cxx3
-rw-r--r--sw/source/ui/table/tablemgr.cxx4
-rw-r--r--sw/source/ui/uiview/formatclipboard.cxx2
-rw-r--r--sw/source/ui/uiview/pview.cxx32
-rw-r--r--sw/source/ui/uiview/srcview.cxx23
-rw-r--r--sw/source/ui/uiview/view.cxx69
-rw-r--r--sw/source/ui/uiview/view0.cxx2
-rw-r--r--sw/source/ui/uiview/view2.cxx25
-rw-r--r--sw/source/ui/uiview/viewdlg2.cxx2
-rw-r--r--sw/source/ui/uiview/viewdraw.cxx105
-rw-r--r--sw/source/ui/uiview/viewmdi.cxx9
-rw-r--r--sw/source/ui/uiview/viewport.cxx4
-rw-r--r--sw/source/ui/uiview/viewprt.cxx10
-rw-r--r--sw/source/ui/uiview/viewstat.cxx6
-rw-r--r--sw/source/ui/uiview/viewtab.cxx2
-rw-r--r--sw/source/ui/uno/swdetect.cxx2
-rw-r--r--sw/source/ui/uno/unoatxt.cxx15
-rw-r--r--sw/source/ui/uno/unodefaults.cxx1
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx2
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx52
-rw-r--r--sw/source/ui/uno/unotxvw.cxx23
-rw-r--r--sw/source/ui/utlui/attrdesc.cxx7
-rw-r--r--sw/source/ui/utlui/bookctrl.cxx4
-rw-r--r--sw/source/ui/utlui/content.cxx19
-rw-r--r--sw/source/ui/utlui/glbltree.cxx5
-rw-r--r--sw/source/ui/utlui/navipi.cxx17
-rw-r--r--sw/source/ui/utlui/tmplctrl.cxx4
-rw-r--r--sw/source/ui/utlui/viewlayoutctrl.cxx4
-rw-r--r--sw/source/ui/utlui/zoomctrl.cxx2
-rw-r--r--sw/source/ui/web/wdocsh.cxx2
-rw-r--r--sw/source/ui/web/wformsh.cxx2
-rw-r--r--sw/source/ui/web/wfrmsh.cxx2
-rw-r--r--sw/source/ui/web/wgrfsh.cxx2
-rw-r--r--sw/source/ui/web/wlistsh.cxx2
-rw-r--r--sw/source/ui/web/wtabsh.cxx2
-rw-r--r--sw/source/ui/web/wtextsh.cxx2
-rw-r--r--sw/source/ui/web/wview.cxx9
-rw-r--r--sw/source/ui/wrtsh/move.cxx2
-rw-r--r--sw/source/ui/wrtsh/select.cxx3
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx2
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx2
-rw-r--r--sw/source/ui/wrtsh/wrtsh3.cxx7
-rw-r--r--toolkit/source/awt/vclxaccessiblecomponent.cxx8
-rw-r--r--toolkit/source/awt/vclxmenu.cxx4
-rw-r--r--toolkit/source/awt/vclxwindow.cxx4
-rw-r--r--toolkit/workben/layout/zoom.cxx10
-rw-r--r--tools/Package_inc.mk1
-rw-r--r--[-rwxr-xr-x]tools/StaticLibrary_ooopathutils.mk4
-rw-r--r--tools/bootstrp/prj.cxx1
-rw-r--r--tools/inc/tools/b3dtrans.hxx4
-rw-r--r--tools/inc/tools/errinf.hxx12
-rw-r--r--tools/inc/tools/geninfo.hxx1
-rw-r--r--tools/inc/tools/pstm.hxx7
-rw-r--r--tools/inc/tools/solar.h1
-rw-r--r--tools/inc/tools/stream.hxx8
-rw-r--r--tools/source/generic/b3dtrans.cxx12
-rw-r--r--tools/source/generic/poly2.cxx1
-rw-r--r--tools/source/inet/inetstrm.cxx8
-rw-r--r--tools/source/ref/errinf.cxx14
-rw-r--r--tools/source/ref/pstm.cxx3
-rw-r--r--tools/source/stream/stream.cxx9
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx1
-rw-r--r--[-rwxr-xr-x]vcl/StaticLibrary_vclmain.mk18
-rw-r--r--vcl/inc/vcl/apptypes.hxx4
-rw-r--r--vcl/inc/vcl/extoutdevdata.hxx3
-rw-r--r--vcl/inc/vcl/graph.hxx3
-rw-r--r--vcl/inc/vcl/outdev.hxx19
-rw-r--r--vcl/inc/vcl/pdfextoutdevdata.hxx3
-rw-r--r--vcl/inc/vcl/vclevent.hxx8
-rw-r--r--vcl/source/app/salvtables.cxx7
-rw-r--r--vcl/source/app/svapp.cxx4
-rw-r--r--vcl/source/app/vclevent.cxx8
-rw-r--r--vcl/source/control/field2.cxx8
-rw-r--r--vcl/source/control/tabctrl.cxx2
-rw-r--r--vcl/source/gdi/alpha.cxx8
-rw-r--r--vcl/source/gdi/bitmap3.cxx33
-rw-r--r--vcl/source/gdi/bitmapex.cxx8
-rw-r--r--vcl/source/gdi/bmpfast.cxx8
-rw-r--r--vcl/source/gdi/extoutdevdata.cxx2
-rw-r--r--vcl/source/gdi/gfxlink.cxx1
-rw-r--r--vcl/source/gdi/graph.cxx4
-rw-r--r--vcl/source/gdi/jobset.cxx7
-rw-r--r--vcl/source/gdi/outdev2.cxx9
-rw-r--r--vcl/source/gdi/outmap.cxx96
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx1
-rw-r--r--vcl/source/window/winproc.cxx5
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx3
-rw-r--r--xmloff/inc/EnhancedCustomShapeToken.hxx3
-rw-r--r--xmloff/inc/PageMasterImportContext.hxx2
-rw-r--r--xmloff/inc/XMLBackgroundImageContext.hxx2
-rw-r--r--xmloff/inc/XMLChartStyleContext.hxx2
-rw-r--r--xmloff/inc/XMLElementPropertyContext.hxx2
-rw-r--r--xmloff/inc/XMLEmbeddedObjectImportContext.hxx2
-rw-r--r--xmloff/inc/XMLFootnoteConfigurationImportContext.hxx2
-rw-r--r--xmloff/inc/XMLImageMapContext.hxx2
-rw-r--r--xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx2
-rw-r--r--xmloff/inc/XMLLineNumberingImportContext.hxx2
-rw-r--r--xmloff/inc/XMLNumberStylesImport.hxx2
-rw-r--r--xmloff/inc/XMLReplacementImageContext.hxx2
-rw-r--r--xmloff/inc/XMLShapePropertySetContext.hxx2
-rw-r--r--xmloff/inc/XMLStringBufferImportContext.hxx2
-rw-r--r--xmloff/inc/XMLTextColumnsContext.hxx2
-rw-r--r--xmloff/inc/XMLTextHeaderFooterContext.hxx2
-rw-r--r--xmloff/inc/animationimport.hxx2
-rw-r--r--xmloff/inc/animimp.hxx2
-rw-r--r--xmloff/inc/pch/precompiled_xmloff.hxx1
-rw-r--r--xmloff/inc/txtfldi.hxx84
-rw-r--r--xmloff/inc/txtvfldi.hxx28
-rw-r--r--xmloff/inc/xexptran.hxx6
-rw-r--r--xmloff/inc/xmloff/XMLBase64ImportContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLCharContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLEventsImportContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLFontStylesContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLShapeStyleContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLTextMasterPageContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx2
-rw-r--r--xmloff/inc/xmloff/XMLTextTableContext.hxx2
-rw-r--r--xmloff/inc/xmloff/formsimp.hxx2
-rw-r--r--xmloff/inc/xmloff/prstylei.hxx2
-rw-r--r--xmloff/inc/xmloff/shapeimport.hxx2
-rw-r--r--xmloff/inc/xmloff/txtstyli.hxx2
-rw-r--r--xmloff/inc/xmloff/xmlcnitm.hxx2
-rw-r--r--xmloff/inc/xmloff/xmlictxt.hxx3
-rw-r--r--xmloff/inc/xmloff/xmlmultiimagehelper.hxx5
-rw-r--r--xmloff/inc/xmloff/xmlnumi.hxx2
-rw-r--r--xmloff/inc/xmloff/xmlstyle.hxx5
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx5
-rw-r--r--xmloff/inc/xmltabi.hxx2
-rw-r--r--xmloff/source/chart/SchXMLAxisContext.cxx4
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx4
-rwxr-xr-xxmloff/source/chart/SchXMLLegendContext.cxx2
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx4
-rw-r--r--xmloff/source/chart/XMLChartPropertyContext.cxx2
-rw-r--r--xmloff/source/chart/XMLChartPropertyContext.hxx2
-rw-r--r--xmloff/source/chart/XMLChartStyleContext.cxx2
-rw-r--r--xmloff/source/chart/XMLLabelSeparatorContext.cxx2
-rw-r--r--xmloff/source/chart/XMLLabelSeparatorContext.hxx2
-rw-r--r--xmloff/source/chart/XMLSymbolImageContext.cxx2
-rw-r--r--xmloff/source/chart/XMLSymbolImageContext.hxx2
-rw-r--r--xmloff/source/chart/contexts.cxx2
-rw-r--r--xmloff/source/chart/contexts.hxx2
-rw-r--r--xmloff/source/core/XMLBase64ImportContext.cxx3
-rw-r--r--xmloff/source/core/XMLEmbeddedObjectImportContext.cxx6
-rw-r--r--xmloff/source/core/xmlictxt.cxx1
-rw-r--r--xmloff/source/core/xmlimp.cxx2
-rw-r--r--xmloff/source/core/xmlmultiimagehelper.cxx65
-rw-r--r--xmloff/source/core/xmltoken.cxx5
-rw-r--r--xmloff/source/draw/EnhancedCustomShapeToken.cxx5
-rw-r--r--xmloff/source/draw/XMLGraphicsDefaultStyle.cxx2
-rw-r--r--xmloff/source/draw/XMLImageMapContext.cxx21
-rw-r--r--xmloff/source/draw/XMLImageMapExport.cxx2
-rw-r--r--xmloff/source/draw/XMLNumberStyles.cxx7
-rw-r--r--xmloff/source/draw/XMLReplacementImageContext.cxx2
-rw-r--r--xmloff/source/draw/XMLShapePropertySetContext.cxx2
-rw-r--r--xmloff/source/draw/XMLShapeStyleContext.cxx2
-rw-r--r--xmloff/source/draw/animationimport.cxx2
-rw-r--r--xmloff/source/draw/animimp.cxx10
-rw-r--r--xmloff/source/draw/descriptionimp.cxx2
-rw-r--r--xmloff/source/draw/descriptionimp.hxx2
-rw-r--r--xmloff/source/draw/eventimp.cxx10
-rw-r--r--xmloff/source/draw/eventimp.hxx2
-rw-r--r--xmloff/source/draw/layerimp.cxx2
-rw-r--r--xmloff/source/draw/layerimp.hxx2
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx4
-rw-r--r--xmloff/source/draw/shapeexport2.cxx97
-rw-r--r--xmloff/source/draw/shapeexport4.cxx33
-rw-r--r--xmloff/source/draw/shapeimport.cxx2
-rw-r--r--xmloff/source/draw/xexptran.cxx66
-rw-r--r--xmloff/source/draw/ximp3dobject.cxx14
-rw-r--r--xmloff/source/draw/ximp3dobject.hxx13
-rw-r--r--xmloff/source/draw/ximp3dscene.cxx2
-rw-r--r--xmloff/source/draw/ximp3dscene.hxx3
-rw-r--r--xmloff/source/draw/ximpcustomshape.cxx76
-rw-r--r--xmloff/source/draw/ximpcustomshape.hxx6
-rw-r--r--xmloff/source/draw/ximpgrp.cxx2
-rw-r--r--xmloff/source/draw/ximpgrp.hxx3
-rw-r--r--xmloff/source/draw/ximplink.cxx2
-rw-r--r--xmloff/source/draw/ximplink.hxx3
-rw-r--r--xmloff/source/draw/ximppage.cxx95
-rw-r--r--xmloff/source/draw/ximppage.hxx5
-rw-r--r--xmloff/source/draw/ximpshap.cxx247
-rw-r--r--xmloff/source/draw/ximpshap.hxx58
-rw-r--r--xmloff/source/draw/ximpshow.cxx2
-rw-r--r--xmloff/source/draw/ximpshow.hxx2
-rw-r--r--xmloff/source/draw/ximpstyl.cxx61
-rw-r--r--xmloff/source/draw/ximpstyl.hxx12
-rw-r--r--xmloff/source/forms/elementimport.cxx2
-rw-r--r--xmloff/source/forms/formsimp.cxx2
-rw-r--r--xmloff/source/forms/officeforms.cxx2
-rw-r--r--xmloff/source/forms/officeforms.hxx2
-rw-r--r--xmloff/source/script/XMLEventsImportContext.cxx3
-rw-r--r--xmloff/source/style/FillStyleContext.cxx12
-rw-r--r--xmloff/source/style/FillStyleContext.hxx12
-rw-r--r--xmloff/source/style/PageMasterImportContext.cxx2
-rw-r--r--xmloff/source/style/XMLBackgroundImageContext.cxx2
-rw-r--r--xmloff/source/style/XMLElementPropertyContext.cxx2
-rw-r--r--xmloff/source/style/XMLFontStylesContext.cxx8
-rw-r--r--xmloff/source/style/XMLFootnoteSeparatorImport.cxx3
-rw-r--r--xmloff/source/style/XMLFootnoteSeparatorImport.hxx2
-rw-r--r--xmloff/source/style/prstylei.cxx2
-rw-r--r--xmloff/source/style/xmlnumi.cxx2
-rw-r--r--xmloff/source/style/xmlstyle.cxx4
-rw-r--r--xmloff/source/style/xmltabi.cxx6
-rw-r--r--xmloff/source/text/XMLAutoMarkFileContext.cxx2
-rw-r--r--xmloff/source/text/XMLAutoMarkFileContext.hxx2
-rw-r--r--xmloff/source/text/XMLAutoTextContainerEventImport.cxx3
-rw-r--r--xmloff/source/text/XMLAutoTextContainerEventImport.hxx2
-rw-r--r--xmloff/source/text/XMLChangeElementImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLChangeElementImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLChangeImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLChangeImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLChangeInfoContext.cxx2
-rw-r--r--xmloff/source/text/XMLChangeInfoContext.hxx2
-rw-r--r--xmloff/source/text/XMLChangedRegionImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLChangedRegionImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLFootnoteBodyImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLFootnoteBodyImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx6
-rw-r--r--xmloff/source/text/XMLFootnoteImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLFootnoteImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexBibliographyEntryContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexBibliographyEntryContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexBibliographySourceContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexBibliographySourceContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexBodyContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexBodyContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexIllustrationSourceContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexIllustrationSourceContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexObjectSourceContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexObjectSourceContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexSimpleEntryContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexSimpleEntryContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexSourceBaseContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexSourceBaseContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexSpanEntryContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexSpanEntryContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexTOCSourceContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexTOCSourceContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexTOCStylesContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexTOCStylesContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexTabStopEntryContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexTabStopEntryContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexTableSourceContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexTableSourceContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexTemplateContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexTemplateContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexTitleTemplateContext.cxx2
-rw-r--r--xmloff/source/text/XMLIndexTitleTemplateContext.hxx2
-rw-r--r--xmloff/source/text/XMLIndexUserSourceContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexUserSourceContext.hxx2
-rw-r--r--xmloff/source/text/XMLLineNumberingImportContext.cxx3
-rw-r--r--xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLSectionFootnoteConfigImport.cxx3
-rw-r--r--xmloff/source/text/XMLSectionFootnoteConfigImport.hxx2
-rw-r--r--xmloff/source/text/XMLSectionImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLSectionImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLSectionSourceDDEImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLSectionSourceDDEImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLSectionSourceImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLSectionSourceImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLStringBufferImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextColumnsContext.cxx10
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx37
-rw-r--r--xmloff/source/text/XMLTextFrameContext.hxx2
-rw-r--r--xmloff/source/text/XMLTextFrameHyperlinkContext.cxx8
-rw-r--r--xmloff/source/text/XMLTextFrameHyperlinkContext.hxx2
-rw-r--r--xmloff/source/text/XMLTextHeaderFooterContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.hxx2
-rw-r--r--xmloff/source/text/XMLTextListItemContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextListItemContext.hxx2
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.hxx2
-rw-r--r--xmloff/source/text/XMLTextMasterPageContext.cxx1
-rw-r--r--xmloff/source/text/XMLTextMasterStylesContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextShapeStyleContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextTableContext.cxx2
-rw-r--r--xmloff/source/text/XMLTrackedChangesImportContext.cxx2
-rw-r--r--xmloff/source/text/XMLTrackedChangesImportContext.hxx2
-rw-r--r--xmloff/source/text/txtdropi.cxx1
-rw-r--r--xmloff/source/text/txtdropi.hxx2
-rw-r--r--xmloff/source/text/txtfldi.cxx82
-rw-r--r--xmloff/source/text/txtimp.cxx50
-rw-r--r--xmloff/source/text/txtparae.cxx2
-rw-r--r--xmloff/source/text/txtparai.cxx64
-rw-r--r--xmloff/source/text/txtparai.hxx4
-rw-r--r--xmloff/source/text/txtparaimphint.hxx24
-rw-r--r--xmloff/source/text/txtstyli.cxx2
-rw-r--r--xmloff/source/text/txtvfldi.cxx28
-rw-r--r--xmloff/source/transform/ChartOASISTContext.cxx2
-rw-r--r--xmloff/source/transform/ChartOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/ChartOOoTContext.cxx2
-rw-r--r--xmloff/source/transform/ChartOOoTContext.hxx2
-rw-r--r--xmloff/source/transform/ChartPlotAreaOASISTContext.cxx6
-rw-r--r--xmloff/source/transform/ChartPlotAreaOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/ChartPlotAreaOOoTContext.cxx6
-rw-r--r--xmloff/source/transform/ChartPlotAreaOOoTContext.hxx2
-rw-r--r--xmloff/source/transform/ControlOASISTContext.cxx2
-rw-r--r--xmloff/source/transform/ControlOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/ControlOOoTContext.cxx2
-rw-r--r--xmloff/source/transform/ControlOOoTContext.hxx2
-rw-r--r--xmloff/source/transform/CreateElemTContext.cxx2
-rw-r--r--xmloff/source/transform/CreateElemTContext.hxx2
-rw-r--r--xmloff/source/transform/DeepTContext.cxx2
-rw-r--r--xmloff/source/transform/DeepTContext.hxx2
-rw-r--r--xmloff/source/transform/DlgOASISTContext.cxx2
-rw-r--r--xmloff/source/transform/DlgOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/DocumentTContext.cxx2
-rw-r--r--xmloff/source/transform/DocumentTContext.hxx2
-rw-r--r--xmloff/source/transform/EventOASISTContext.cxx2
-rw-r--r--xmloff/source/transform/EventOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/EventOOoTContext.cxx2
-rw-r--r--xmloff/source/transform/EventOOoTContext.hxx2
-rw-r--r--xmloff/source/transform/FlatTContext.cxx2
-rw-r--r--xmloff/source/transform/FlatTContext.hxx2
-rw-r--r--xmloff/source/transform/FormPropOASISTContext.cxx3
-rw-r--r--xmloff/source/transform/FormPropOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/FormPropOOoTContext.cxx6
-rw-r--r--xmloff/source/transform/FormPropOOoTContext.hxx2
-rw-r--r--xmloff/source/transform/FrameOASISTContext.cxx2
-rw-r--r--xmloff/source/transform/FrameOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/FrameOOoTContext.cxx2
-rw-r--r--xmloff/source/transform/FrameOOoTContext.hxx2
-rw-r--r--xmloff/source/transform/IgnoreTContext.cxx2
-rw-r--r--xmloff/source/transform/IgnoreTContext.hxx2
-rw-r--r--xmloff/source/transform/MergeElemTContext.cxx10
-rw-r--r--xmloff/source/transform/MergeElemTContext.hxx2
-rw-r--r--xmloff/source/transform/MetaTContext.cxx2
-rw-r--r--xmloff/source/transform/MetaTContext.hxx2
-rw-r--r--xmloff/source/transform/NotesTContext.cxx2
-rw-r--r--xmloff/source/transform/NotesTContext.hxx2
-rw-r--r--xmloff/source/transform/OOo2Oasis.cxx20
-rw-r--r--xmloff/source/transform/Oasis2OOo.cxx20
-rw-r--r--xmloff/source/transform/PersAttrListTContext.cxx2
-rw-r--r--xmloff/source/transform/PersAttrListTContext.hxx2
-rw-r--r--xmloff/source/transform/PersMixedContentTContext.cxx6
-rw-r--r--xmloff/source/transform/PersMixedContentTContext.hxx2
-rw-r--r--xmloff/source/transform/ProcAddAttrTContext.cxx2
-rw-r--r--xmloff/source/transform/ProcAddAttrTContext.hxx2
-rw-r--r--xmloff/source/transform/ProcAttrTContext.cxx2
-rw-r--r--xmloff/source/transform/ProcAttrTContext.hxx2
-rw-r--r--xmloff/source/transform/RenameElemTContext.cxx2
-rw-r--r--xmloff/source/transform/RenameElemTContext.hxx2
-rw-r--r--xmloff/source/transform/StyleOASISTContext.cxx6
-rw-r--r--xmloff/source/transform/StyleOASISTContext.hxx2
-rw-r--r--xmloff/source/transform/StyleOOoTContext.cxx10
-rw-r--r--xmloff/source/transform/StyleOOoTContext.hxx2
-rw-r--r--xmloff/source/transform/TransformerContext.cxx2
-rw-r--r--xmloff/source/transform/TransformerContext.hxx3
-rw-r--r--xmlsecurity/source/dialogs/stbcontrl.cxx2
3064 files changed, 84045 insertions, 89677 deletions
diff --git a/accessibility/source/extended/accessibletablistboxtable.cxx b/accessibility/source/extended/accessibletablistboxtable.cxx
index d72d239e60b2..51766741d2a2 100644
--- a/accessibility/source/extended/accessibletablistboxtable.cxx
+++ b/accessibility/source/extended/accessibletablistboxtable.cxx
@@ -219,11 +219,12 @@ namespace accessibility
// -----------------------------------------------------------------------------
IMPL_LINK( AccessibleTabListBoxTable, WindowEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ VclWindowEvent* pVclWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+ DBG_ASSERT( pVclWindowEvent, "Unknown WindowEvent!" );
+ if ( pVclWindowEvent )
{
- DBG_ASSERT( ( (VclWindowEvent*)pEvent )->GetWindow() && m_pTabListBox, "no event window" );
- ProcessWindowEvent( *(VclWindowEvent*)pEvent );
+ DBG_ASSERT( pVclWindowEvent->GetWindow() && m_pTabListBox, "no event window" );
+ ProcessWindowEvent( *pVclWindowEvent );
}
return 0;
}
diff --git a/accessibility/source/extended/listboxaccessible.cxx b/accessibility/source/extended/listboxaccessible.cxx
index e464d0e9345b..7232be595a41 100644
--- a/accessibility/source/extended/listboxaccessible.cxx
+++ b/accessibility/source/extended/listboxaccessible.cxx
@@ -56,13 +56,15 @@ namespace accessibility
//--------------------------------------------------------------------
IMPL_LINK( ListBoxAccessibleBase, WindowEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "ListBoxAccessibleBase::WindowEventListener: unexpected WindowEvent!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ VclWindowEvent* pVclWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+ DBG_ASSERT( pVclWindowEvent, "ListBoxAccessibleBase::WindowEventListener: unexpected WindowEvent!" );
+
+ if ( pVclWindowEvent )
{
- DBG_ASSERT( static_cast< VclWindowEvent* >( pEvent )->GetWindow() , "ListBoxAccessibleBase::WindowEventListener: no event window!" );
- DBG_ASSERT( static_cast< VclWindowEvent* >( pEvent )->GetWindow() == m_pWindow, "ListBoxAccessibleBase::WindowEventListener: where did this come from?" );
+ DBG_ASSERT( pVclWindowEvent->GetWindow() , "ListBoxAccessibleBase::WindowEventListener: no event window!" );
+ DBG_ASSERT( pVclWindowEvent->GetWindow() == m_pWindow, "ListBoxAccessibleBase::WindowEventListener: where did this come from?" );
- ProcessWindowEvent( *static_cast< VclWindowEvent* >( pEvent ) );
+ ProcessWindowEvent( *pVclWindowEvent );
}
return 0;
}
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index fc95d00a898d..dba8bcf555fb 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1497,11 +1497,11 @@ void SAL_CALL Document::disposing()
// virtual
void Document::Notify(::SfxBroadcaster &, ::SfxHint const & rHint)
{
- if (rHint.ISA(::TextHint))
+ const ::TextHint* pTextHint = dynamic_cast< const ::TextHint* >(&rHint);
+
+ if (pTextHint)
{
- ::TextHint const & rTextHint
- = static_cast< ::TextHint const & >(rHint);
- switch (rTextHint.GetId())
+ switch (pTextHint->GetId())
{
case TEXT_HINT_PARAINSERTED:
case TEXT_HINT_PARAREMOVED:
@@ -1525,7 +1525,7 @@ void Document::Notify(::SfxBroadcaster &, ::SfxHint const & rHint)
if (!isAlive())
break;
- m_aParagraphNotifications.push(rTextHint);
+ m_aParagraphNotifications.push(*pTextHint);
break;
}
case TEXT_HINT_TEXTFORMATTED:
diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx
index 4b08b757d716..e4e3b2f77b01 100644
--- a/accessibility/source/standard/accessiblemenubasecomponent.cxx
+++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx
@@ -572,11 +572,13 @@ sal_Bool OAccessibleMenuBaseComponent::IsPopupMenuOpen()
IMPL_LINK( OAccessibleMenuBaseComponent, MenuEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclMenuEvent ), "OAccessibleMenuBaseComponent - Unknown MenuEvent!" );
- if ( pEvent && pEvent->ISA( VclMenuEvent ) )
+ VclMenuEvent* pVclMenuEvent = dynamic_cast< VclMenuEvent* >(pEvent);
+ DBG_ASSERT( pVclMenuEvent, "OAccessibleMenuBaseComponent - Unknown MenuEvent!" );
+
+ if ( pVclMenuEvent )
{
- DBG_ASSERT( ((VclMenuEvent*)pEvent)->GetMenu(), "OAccessibleMenuBaseComponent - Menu?" );
- ProcessMenuEvent( *(VclMenuEvent*)pEvent );
+ DBG_ASSERT( pVclMenuEvent->GetMenu(), "OAccessibleMenuBaseComponent - Menu?" );
+ ProcessMenuEvent( *pVclMenuEvent );
}
return 0;
}
diff --git a/accessibility/source/standard/vclxaccessiblemenubar.cxx b/accessibility/source/standard/vclxaccessiblemenubar.cxx
index 916176b75c6a..a601b6973634 100644
--- a/accessibility/source/standard/vclxaccessiblemenubar.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenubar.cxx
@@ -77,13 +77,16 @@ sal_Bool VCLXAccessibleMenuBar::IsFocused()
IMPL_LINK( VCLXAccessibleMenuBar, WindowEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "VCLXAccessibleMenuBar::WindowEventListener: unknown window event!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ VclWindowEvent* pVclWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+ DBG_ASSERT( pVclWindowEvent , "VCLXAccessibleMenuBar::WindowEventListener: unknown window event!" );
+
+ if ( pVclWindowEvent )
{
- DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "VCLXAccessibleMenuBar::WindowEventListener: no window!" );
- if ( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
+ DBG_ASSERT( pVclWindowEvent->GetWindow(), "VCLXAccessibleMenuBar::WindowEventListener: no window!" );
+
+ if ( !pVclWindowEvent->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
{
- ProcessWindowEvent( *(VclWindowEvent*)pEvent );
+ ProcessWindowEvent( *pVclWindowEvent );
}
}
return 0;
diff --git a/automation/source/app/testbasi.cxx b/automation/source/app/testbasi.cxx
index 3d15b5b6a6c2..32298a2c836d 100644
--- a/automation/source/app/testbasi.cxx
+++ b/automation/source/app/testbasi.cxx
@@ -49,8 +49,6 @@
//#include "comm_bas.hxx"
//#include "processw.hxx"
-TYPEINIT1(TTBasic,MyBasic)
-
/*class MyFactory : public SbxFactory
{
public:
diff --git a/automation/source/app/testbasi.hxx b/automation/source/app/testbasi.hxx
index f4ef55078856..8017aa014c48 100644
--- a/automation/source/app/testbasi.hxx
+++ b/automation/source/app/testbasi.hxx
@@ -37,7 +37,6 @@ class TTBasic : public MyBasic
{
public:
SBX_DECL_PERSIST_NODATA(SBXCR_TEST2,SBXID_TTBASIC,1);
- TYPEINFO();
TTBasic();
~TTBasic();
sal_Bool Compile( SbModule* );
diff --git a/automation/source/miniapp/testapp.cxx b/automation/source/miniapp/testapp.cxx
index 37838befecc7..60bea8c5329a 100644
--- a/automation/source/miniapp/testapp.cxx
+++ b/automation/source/miniapp/testapp.cxx
@@ -180,7 +180,7 @@ MyApp::MyApp()
void MyApp::Property( ApplicationProperty& rProp )
{
- TTProperties* pTTProperties = PTR_CAST( TTProperties, &rProp );
+ TTProperties* pTTProperties = dynamic_cast< TTProperties* >( &rProp );
if ( pTTProperties )
{
pTTProperties->nPropertyVersion = TT_PROPERTIES_VERSION;
diff --git a/automation/source/server/recorder.cxx b/automation/source/server/recorder.cxx
index 228898481ef0..77dccc47af49 100644
--- a/automation/source/server/recorder.cxx
+++ b/automation/source/server/recorder.cxx
@@ -130,10 +130,10 @@ rtl::OString MacroRecorder::GetParentID( Window* pThis )
IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent )
{
sal_Bool bSendData = sal_False;
+ VclWindowEvent* pWinEvent = dynamic_cast< VclWindowEvent* >(pEvent);
- if ( pEvent->ISA( VclWindowEvent ) )
+ if ( pWinEvent )
{
- VclWindowEvent* pWinEvent = ( VclWindowEvent* ) pEvent;
Window* pWin = pWinEvent->GetWindow();
sal_uLong nEventID = pWinEvent->GetId();
#if OSL_DEBUG_LEVEL > 1
@@ -1035,12 +1035,16 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent )
pLastWin = pWin;
- } // if
- else if ( pEvent->ISA( VclMenuEvent ) )
+ }
+ else
+ {
+ VclMenuEvent* pVclMenuEvent = dynamic_cast< VclMenuEvent* >(pEvent);
+
+ if ( pVclMenuEvent )
{
// VclMenuEvent* pMenuEvent = ( VclMenuEvent* ) pEvent;
}
-
+ }
if ( bSendData )
new StatementFlow( NULL, F_EndCommandBlock ); // Kommando zum Senden erzeugen und in que eintragen
diff --git a/automation/source/testtool/cmdstrm.cxx b/automation/source/testtool/cmdstrm.cxx
index 5ffb1ccb7749..de6c40c8b6ae 100644
--- a/automation/source/testtool/cmdstrm.cxx
+++ b/automation/source/testtool/cmdstrm.cxx
@@ -216,8 +216,12 @@ void CmdStream::WriteSortedParams( SbxArray* rPar, sal_Bool IsKeyString )
case SbxOBJECT: // whenever a control is passed. TabPage, MenuBar
{
SbxProperty *pMember = NULL;
- if ( rPar->Get( i )->ISA( SbxObject ) )
- pMember = ((SbxObject*)rPar->Get( i ))->GetDfltProperty();
+ SbxObject* pSbxObject = dynamic_cast< SbxObject* >(rPar->Get( i ));
+
+ if ( pSbxObject )
+ {
+ pMember = pSbxObject->GetDfltProperty();
+ }
if ( pMember != NULL )
{
if ( pMember->GetType() == SbxSTRING )
diff --git a/automation/source/testtool/comm_bas.cxx b/automation/source/testtool/comm_bas.cxx
index 72c6a530d022..bf70f29ed03e 100644
--- a/automation/source/testtool/comm_bas.cxx
+++ b/automation/source/testtool/comm_bas.cxx
@@ -224,7 +224,7 @@ SbxVariable* CommunicationWrapper::Find( const String& rName, SbxClassType t )
void CommunicationWrapper::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT,
const SfxHint& rHint, const TypeId& rHT )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/automation/source/testtool/cretstrm.cxx b/automation/source/testtool/cretstrm.cxx
index b646b2e9c82d..b769ce722d13 100644
--- a/automation/source/testtool/cretstrm.cxx
+++ b/automation/source/testtool/cretstrm.cxx
@@ -29,6 +29,7 @@
#include <tools/debug.hxx>
#include "rcontrol.hxx"
#include "svcommstream.hxx"
+#include <typeinfo>
SV_IMPL_REF(SbxBase)
@@ -63,7 +64,14 @@ void CRetStream::Read( SbxValue &aValue )
DBG_ERROR1( "Falscher Typ im Stream: Erwartet SbxValue, gefunden :%hu", nId );
}
SbxBaseRef xBase = SbxBase::Load( *pSammel );
- if ( IS_TYPE( SbxValue, xBase ) )
- aValue = *PTR_CAST( SbxValue, &xBase );
+
+ // old RTTI did the following:
+ // if ( IS_TYPE( SbxValue, xBase ) )
+ // aValue = *dynamic_cast< SbxValue* >( &xBase );
+ SbxValue* pSbxValue = dynamic_cast< SbxValue* >(&xBase);
+ if(pSbxValue)
+ {
+ aValue = *pSbxValue;
+ }
}
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index d3fa15a659a9..8adad7846e78 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -596,7 +596,7 @@ void TestToolObj::InitTestToolObj()
// overwrite standard "wait" method, cause we can do better than that!!
// Insert Object into SbiStdObject but change listening.
SbxVariable* pRTL = pImpl->pMyBasic->Find( CUniString(RTLNAME), SbxCLASS_DONTCARE );
- SbxObject* pRTLObject = PTR_CAST( SbxObject, pRTL );
+ SbxObject* pRTLObject = dynamic_cast< SbxObject* >( pRTL );
if ( pRTLObject )
{
SbxVariableRef pWait;
@@ -1360,7 +1360,7 @@ void TestToolObj::SendViaSocket()
{
// first try to run basic sub "startTheOffice" see i86540
SbxVariable* pMeth = pImpl->pMyBasic->Find( CUniString( "startTheOffice" ), SbxCLASS_DONTCARE);
- if( !pImpl->bIsStart && pMeth && pMeth->ISA(SbxMethod) )
+ if( !pImpl->bIsStart && pMeth && dynamic_cast< SbxMethod* >(pMeth) )
{
pImpl->pMyBasic->Call( CUniString( "startTheOffice" ) );
}
@@ -1655,7 +1655,7 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
{
static CNames *pUIds = NULL; // Halten der hid.lst
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast< const SbxHint* >( &rHint);
if( p )
{
SbxVariable* pVar = p->GetVar();
@@ -2266,7 +2266,7 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
case ID_Control:
case ID_StringControl:
// if only the object is given in the script we don't have to do anything (object stands for itself)
- if ( !pVar->ISA( SbxObject ) )
+ if ( !dynamic_cast< SbxObject* >(pVar) )
{
if ( SingleCommandBlock )
BeginBlock();
@@ -4274,7 +4274,7 @@ SbTextType TestToolObj::GetSymbolType( const String &rSymbol, sal_Bool bWasContr
// Wenns sonst nix war, dann vielleicht ein Lokales Kommando
SbxVariable *pVar = SbxObject::Find( rSymbol, SbxCLASS_DONTCARE );
- if ( pVar && ( pVar->ISA(SbxMethod) || pVar->ISA(SbxProperty) ) )
+ if ( pVar && ( dynamic_cast< SbxMethod* >(pVar) || dynamic_cast< SbxProperty* >(pVar) ) )
{
return TT_LOCALCMD;
}
diff --git a/avmedia/inc/avmedia/mediaitem.hxx b/avmedia/inc/avmedia/mediaitem.hxx
index dcfabf12418a..195c4638fff7 100644
--- a/avmedia/inc/avmedia/mediaitem.hxx
+++ b/avmedia/inc/avmedia/mediaitem.hxx
@@ -24,10 +24,7 @@
#ifndef _AVMEDIA_MEDIAITEM_HXX
#define _AVMEDIA_MEDIAITEM_HXX
-#include <tools/rtti.hxx>
-#ifndef _POOLITEM_HXX
#include <svl/poolitem.hxx>
-#endif
#include <com/sun/star/media/ZoomLevel.hpp>
#define AVMEDIA_SETMASK_NONE ((sal_uInt32)(0x00000000))
@@ -65,8 +62,7 @@ enum MediaState
class MediaItem : public SfxPoolItem
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
MediaItem( sal_uInt16 nWhich = 0, sal_uInt32 nMaskSet = AVMEDIA_SETMASK_NONE );
MediaItem( const MediaItem& rMediaItem );
virtual ~MediaItem();
diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx
index 892a7234896f..8e7611085ce4 100644
--- a/avmedia/source/framework/mediaitem.cxx
+++ b/avmedia/source/framework/mediaitem.cxx
@@ -33,7 +33,6 @@ namespace avmedia
// - MediaItem -
// -------------
-TYPEINIT1_AUTOFACTORY( MediaItem, ::SfxPoolItem );
::rtl::OUString maURL;
sal_uInt32 mnMaskSet;
MediaState meState;
@@ -46,6 +45,8 @@ TYPEINIT1_AUTOFACTORY( MediaItem, ::SfxPoolItem );
// ------------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(MediaItem)
+
MediaItem::MediaItem( sal_uInt16 _nWhich, sal_uInt32 nMaskSet ) :
SfxPoolItem( _nWhich ),
mnMaskSet( nMaskSet ),
diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index 03b0abf8f5a0..9994b9b84bf7 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -124,7 +124,7 @@ void MediaToolBoxControl::StateChanged( sal_uInt16 /* nSID */, SfxItemState eSta
{
pCtrl->Enable( true, false );
- const MediaItem* pMediaItem = PTR_CAST( MediaItem, pState );
+ const MediaItem* pMediaItem = dynamic_cast< const MediaItem* >( pState );
if( pMediaItem && ( SFX_ITEM_AVAILABLE == eState ) )
pCtrl->setState( *pMediaItem );
diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
index 2d85c86ab5a6..4bbf404c7b88 100644
--- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx
+++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
@@ -38,6 +38,7 @@
#include <toolkit/helper/convert.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -88,7 +89,7 @@ sal_Bool AccessibleDialogControlShape::IsFocused()
if ( m_pDialogWindow )
{
SdrView* pSdrView = m_pDialogWindow->GetView();
- if ( pSdrView && pSdrView->IsObjMarked( m_pDlgEdObj ) && pSdrView->GetMarkedObjectList().GetMarkCount() == 1 )
+ if ( pSdrView && pSdrView->getSelectedIfSingle() == m_pDlgEdObj )
bFocused = sal_True;
}
@@ -104,7 +105,7 @@ sal_Bool AccessibleDialogControlShape::IsSelected()
{
SdrView* pSdrView = m_pDialogWindow->GetView();
if ( pSdrView )
- bSelected = pSdrView->IsObjMarked( m_pDlgEdObj );
+ bSelected = pSdrView->IsObjMarked( *m_pDlgEdObj );
}
return bSelected;
@@ -150,7 +151,7 @@ awt::Rectangle AccessibleDialogControlShape::GetBounds()
if ( m_pDlgEdObj )
{
// get the bounding box of the shape in logic units
- Rectangle aRect = m_pDlgEdObj->GetSnapRect();
+ Rectangle aRect(sdr::legacy::GetSnapRect(*m_pDlgEdObj));
if ( m_pDialogWindow )
{
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx
index 08dc8f89d325..afd3a16cf49b 100644
--- a/basctl/source/accessibility/accessibledialogwindow.cxx
+++ b/basctl/source/accessibility/accessibledialogwindow.cxx
@@ -40,6 +40,7 @@
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
#include <vector>
#include <algorithm>
@@ -104,7 +105,7 @@ bool AccessibleDialogWindow::ChildDescriptor::operator==( const ChildDescriptor&
bool AccessibleDialogWindow::ChildDescriptor::operator<( const ChildDescriptor& rDesc ) const
{
bool bRet = false;
- if ( pDlgEdObj && rDesc.pDlgEdObj && pDlgEdObj->GetOrdNum() < rDesc.pDlgEdObj->GetOrdNum() )
+ if ( pDlgEdObj && rDesc.pDlgEdObj && pDlgEdObj->GetNavigationPosition() < rDesc.pDlgEdObj->GetNavigationPosition() )
bRet = true;
return bRet;
@@ -131,7 +132,7 @@ AccessibleDialogWindow::AccessibleDialogWindow( DialogWindow* pDialogWindow )
for ( sal_uLong i = 0; i < nCount; ++i )
{
SdrObject* pObj = pSdrPage->GetObj( i );
- DlgEdObj* pDlgEdObj = PTR_CAST( DlgEdObj, pObj );
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >( pObj );
if ( pDlgEdObj )
{
ChildDescriptor aDesc( pDlgEdObj );
@@ -233,7 +234,7 @@ sal_Bool AccessibleDialogWindow::IsChildVisible( const ChildDescriptor& rDesc )
SdrModel* pSdrModel = m_pDialogWindow->GetModel();
if ( pSdrModel )
{
- SdrLayerAdmin& rLayerAdmin = pSdrModel->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = pSdrModel->GetModelLayerAdmin();
DlgEdObj* pDlgEdObj = rDesc.pDlgEdObj;
if ( pDlgEdObj )
{
@@ -246,7 +247,7 @@ sal_Bool AccessibleDialogWindow::IsChildVisible( const ChildDescriptor& rDesc )
if ( pSdrView && pSdrView->IsLayerVisible( aLayerName ) )
{
// get the bounding box of the shape in logic units
- Rectangle aRect = pDlgEdObj->GetSnapRect();
+ Rectangle aRect(sdr::legacy::GetSnapRect(*pDlgEdObj));
// transform coordinates relative to the parent
MapMode aMap = m_pDialogWindow->GetMapMode();
@@ -356,7 +357,7 @@ void AccessibleDialogWindow::UpdateChildren()
for ( sal_uLong i = 0, nCount = pSdrPage->GetObjCount(); i < nCount; ++i )
{
SdrObject* pObj = pSdrPage->GetObj( i );
- DlgEdObj* pDlgEdObj = PTR_CAST( DlgEdObj, pObj );
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >( pObj );
if ( pDlgEdObj )
UpdateChild( ChildDescriptor( pDlgEdObj ) );
}
@@ -376,15 +377,16 @@ void AccessibleDialogWindow::SortChildren()
IMPL_LINK( AccessibleDialogWindow, WindowEventListener, VclSimpleEvent*, pEvent )
{
+ VclWindowEvent* pVclWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
DBG_CHKTHIS( AccessibleDialogWindow, 0 );
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "AccessibleDialogWindow::WindowEventListener: unknown window event!" );
+ DBG_ASSERT( pVclWindowEvent, "AccessibleDialogWindow::WindowEventListener: unknown window event!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ if ( pVclWindowEvent )
{
- DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "AccessibleDialogWindow::WindowEventListener: no window!" );
- if ( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
+ DBG_ASSERT( pVclWindowEvent->GetWindow(), "AccessibleDialogWindow::WindowEventListener: no window!" );
+ if ( !pVclWindowEvent->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
{
- ProcessWindowEvent( *(VclWindowEvent*)pEvent );
+ ProcessWindowEvent( *pVclWindowEvent );
}
}
@@ -531,15 +533,16 @@ awt::Rectangle AccessibleDialogWindow::implGetBounds() throw (RuntimeException)
void AccessibleDialogWindow::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SdrHint ) )
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if ( pSdrHint )
{
- SdrHint* pSdrHint = (SdrHint*)&rHint;
- switch ( pSdrHint->GetKind() )
+ switch ( pSdrHint->GetSdrHintKind() )
{
case HINT_OBJINSERTED:
{
- SdrObject* pObj = (SdrObject*)pSdrHint->GetObject();
- DlgEdObj* pDlgEdObj = PTR_CAST( DlgEdObj, pObj );
+ SdrObject* pObj = (SdrObject*)pSdrHint->GetSdrHintObject();
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >( pObj );
if ( pDlgEdObj )
{
ChildDescriptor aDesc( pDlgEdObj );
@@ -550,8 +553,8 @@ void AccessibleDialogWindow::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
case HINT_OBJREMOVED:
{
- SdrObject* pObj = (SdrObject*)pSdrHint->GetObject();
- DlgEdObj* pDlgEdObj = PTR_CAST( DlgEdObj, pObj );
+ SdrObject* pObj = (SdrObject*)pSdrHint->GetSdrHintObject();
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >( pObj );
if ( pDlgEdObj )
RemoveChild( ChildDescriptor( pDlgEdObj ) );
}
@@ -559,9 +562,12 @@ void AccessibleDialogWindow::Notify( SfxBroadcaster&, const SfxHint& rHint )
default: ;
}
}
- else if ( rHint.ISA( DlgEdHint ) )
+ else
+ {
+ const DlgEdHint* pDlgEdHint = dynamic_cast< const DlgEdHint* >(&rHint);
+
+ if ( pDlgEdHint )
{
- DlgEdHint* pDlgEdHint = (DlgEdHint*)&rHint;
switch ( pDlgEdHint->GetKind() )
{
case DLGED_HINT_WINDOWSCROLLED:
@@ -592,6 +598,7 @@ void AccessibleDialogWindow::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
+}
// -----------------------------------------------------------------------------
// XInterface
@@ -991,9 +998,7 @@ void AccessibleDialogWindow::selectAccessibleChild( sal_Int32 nChildIndex ) thro
SdrView* pSdrView = m_pDialogWindow->GetView();
if ( pSdrView )
{
- SdrPageView* pPgView = pSdrView->GetSdrPageView();
- if ( pPgView )
- pSdrView->MarkObj( pDlgEdObj, pPgView );
+ pSdrView->MarkObj( *pDlgEdObj );
}
}
}
@@ -1016,7 +1021,7 @@ sal_Bool AccessibleDialogWindow::isAccessibleChildSelected( sal_Int32 nChildInde
{
SdrView* pSdrView = m_pDialogWindow->GetView();
if ( pSdrView )
- bSelected = pSdrView->IsObjMarked( pDlgEdObj );
+ bSelected = pSdrView->IsObjMarked( *pDlgEdObj );
}
}
@@ -1108,9 +1113,7 @@ void AccessibleDialogWindow::deselectAccessibleChild( sal_Int32 nChildIndex ) th
SdrView* pSdrView = m_pDialogWindow->GetView();
if ( pSdrView )
{
- SdrPageView* pPgView = pSdrView->GetSdrPageView();
- if ( pPgView )
- pSdrView->MarkObj( pDlgEdObj, pPgView, sal_True );
+ pSdrView->MarkObj( *pDlgEdObj, true);
}
}
}
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 8def96e6ddf7..68d9feb8aec6 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -44,7 +44,6 @@
#include "basicmod.hxx"
#include "unomodel.hxx"
-TYPEINIT1(BasicDocShell, SfxObjectShell);
DBG_NAME(BasicDocShell);
SFX_IMPL_OBJECTFACTORY( BasicDocShell, SvGlobalName(), SFXOBJECTSHELL_STD_NORMAL, "sbasic" )
diff --git a/basctl/source/basicide/basdoc.hxx b/basctl/source/basicide/basdoc.hxx
index ade830a6dd7e..926de59b949f 100644
--- a/basctl/source/basicide/basdoc.hxx
+++ b/basctl/source/basicide/basdoc.hxx
@@ -46,8 +46,6 @@ protected:
sal_Bool bTemplate = sal_False ) const;
public:
- TYPEINFO();
-
using SotObject::GetInterface;
SFX_DECL_OBJECTFACTORY();
SFX_DECL_INTERFACE( SVX_INTERFACE_BASIDE_DOCSH )
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx
index 3223d445d140..46f9ab9b3b76 100644
--- a/basctl/source/basicide/basicbox.cxx
+++ b/basctl/source/basicide/basicbox.cxx
@@ -78,11 +78,7 @@ void LibBoxControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPool
else
{
pBox->Enable();
-
- if ( pState->ISA(SfxStringItem) )
- pBox->Update( (const SfxStringItem*)pState );
- else
- pBox->Update( NULL );
+ pBox->Update( dynamic_cast< const SfxStringItem* >(pState) );
}
}
@@ -379,10 +375,7 @@ void LanguageBoxControl::StateChanged( sal_uInt16 _nID, SfxItemState _eState, co
else
{
pBox->Enable();
- if ( _pItem->ISA(SfxStringItem) )
- pBox->Update( (const SfxStringItem*)_pItem );
- else
- pBox->Update( NULL );
+ pBox->Update( dynamic_cast< const SfxStringItem* >(_pItem) );
}
}
}
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 2c6c1123d7af..b6071032ff11 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -102,8 +102,6 @@ using namespace comphelper;
DBG_NAME( ModulWindow )
-TYPEINIT1( ModulWindow , IDEBaseWindow );
-
void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, sal_uInt16 nCurPage, const String& rTitle, bool bOutput )
{
short nLeftMargin = LMARGPRN;
@@ -1718,8 +1716,10 @@ void ModulWindowLayout::ConfigurationChanged( utl::ConfigurationBroadcaster*, sa
bool bChanged = aColor != m_aSyntaxColors[TT_IDENTIFIER];
m_aSyntaxColors[TT_IDENTIFIER] = aColor;
aColor = Color(m_aColorConfig.GetColorValue(svtools::BASICNUMBER).nColor);
- if (bChanged || aColor != m_aSyntaxColors[TT_NUMBER])
+
+ if (bChanged || aColor != m_aSyntaxColors[TT_NUMBER])
bChanged = true;
+
m_aSyntaxColors[TT_NUMBER] = aColor;
aColor = Color(m_aColorConfig.GetColorValue(svtools::BASICSTRING).nColor);
if (bChanged || aColor != m_aSyntaxColors[TT_STRING])
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 9b2ab2d7f4ec..29c7b2e9f2aa 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -363,8 +363,6 @@ protected:
virtual void DoScroll( ScrollBar* pCurScrollBar );
public:
- TYPEINFO();
-
ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, String aLibName,
String aName, ::rtl::OUString& aModule );
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 0e8569c0bb67..cab8bbbb4e84 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -274,7 +274,7 @@ void __EXPORT EditorWindow::RequestHelp( const HelpEvent& rHEvt )
if ( strchr( cSuffixes, aWord.GetChar( nLastChar ) ) )
aWord.Erase( nLastChar, 1 );
SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aWord );
- if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) )
+ if ( pSBX && dynamic_cast< SbxVariable* >(pSBX) && !dynamic_cast< SbxMethod* >(pSBX) )
{
SbxVariable* pVar = (SbxVariable*)pSBX;
SbxDataType eType = pVar->GetType();
@@ -665,10 +665,11 @@ void EditorWindow::DataChanged(DataChangedEvent const & rDCEvt)
void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if ( rHint.ISA( TextHint ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
- const TextHint& rTextHint = (const TextHint&)rHint;
- if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
+ if( pTextHint->GetId() == TEXT_HINT_VIEWSCROLLED )
{
if ( pModulWindow->GetHScrollBar() )
pModulWindow->GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() );
@@ -676,7 +677,7 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
pModulWindow->GetBreakPointWindow().DoScroll
( 0, pModulWindow->GetBreakPointWindow().GetCurYOffset() - pEditView->GetStartDocPos().Y() );
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
{
if ( pEditView->GetStartDocPos().Y() )
{
@@ -688,7 +689,7 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
SetScrollBarRanges();
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTFORMATTED )
{
if ( pModulWindow->GetHScrollBar() )
{
@@ -705,18 +706,18 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
if ( nCurTextWidth != nPrevTextWidth )
SetScrollBarRanges();
}
- else if( rTextHint.GetId() == TEXT_HINT_PARAINSERTED )
+ else if( pTextHint->GetId() == TEXT_HINT_PARAINSERTED )
{
- ParagraphInsertedDeleted( rTextHint.GetValue(), sal_True );
- DoDelayedSyntaxHighlight( rTextHint.GetValue() );
+ ParagraphInsertedDeleted( pTextHint->GetValue(), sal_True );
+ DoDelayedSyntaxHighlight( pTextHint->GetValue() );
}
- else if( rTextHint.GetId() == TEXT_HINT_PARAREMOVED )
+ else if( pTextHint->GetId() == TEXT_HINT_PARAREMOVED )
{
- ParagraphInsertedDeleted( rTextHint.GetValue(), sal_False );
+ ParagraphInsertedDeleted( pTextHint->GetValue(), sal_False );
}
- else if( rTextHint.GetId() == TEXT_HINT_PARACONTENTCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_PARACONTENTCHANGED )
{
- DoDelayedSyntaxHighlight( rTextHint.GetValue() );
+ DoDelayedSyntaxHighlight( pTextHint->GetValue() );
}
}
}
@@ -1914,8 +1915,8 @@ SbxBase* WatchTreeListBox::ImplGetSBXForEntry( SvLBoxEntry* pEntry, bool& rbArra
pSBX = pObj->Find( aVName, SbxCLASS_DONTCARE );
SbxVariable* pVar;
- if ( pSBX && (pVar = PTR_CAST( SbxVariable, pSBX )) != NULL
- && !pSBX->ISA( SbxMethod ) )
+ if ( pSBX && (pVar = dynamic_cast< SbxVariable* >( pSBX )) != NULL
+ && !dynamic_cast< SbxMethod* >(pSBX) )
{
// Force getting value
SbxValues aRes;
@@ -1952,7 +1953,7 @@ sal_Bool __EXPORT WatchTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection
// No out of scope entries
bool bArrayElement;
SbxBase* pSBX = ImplGetSBXForEntry( pEntry, bArrayElement );
- if ( ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) ) || bArrayElement )
+ if ( ( pSBX && dynamic_cast< SbxVariable* >(pSBX) && !dynamic_cast< SbxMethod* >(pSBX) ) || bArrayElement )
{
// Accept no objects and only end nodes of arrays for editing
if( !pItem->mpObject && (pItem->mpArray == NULL || pItem->nDimLevel == pItem->nDimCount) )
@@ -2019,7 +2020,7 @@ sal_Bool WatchTreeListBox::ImplBasicEntryEdited( SvLBoxEntry* pEntry, const Stri
SbxBase* pSBX = ImplGetSBXForEntry( pEntry, bArrayElement );
SbxBase* pToBeChanged = NULL;
- if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) )
+ if ( pSBX && dynamic_cast< SbxVariable* >(pSBX) && !dynamic_cast< SbxMethod* >(pSBX) )
{
SbxVariable* pVar = (SbxVariable*)pSBX;
SbxDataType eType = pVar->GetType();
@@ -2033,11 +2034,13 @@ sal_Bool WatchTreeListBox::ImplBasicEntryEdited( SvLBoxEntry* pEntry, const Stri
if ( pToBeChanged )
{
- if ( pToBeChanged->ISA( SbxVariable ) )
+ SbxVariable* pSbxVariable = dynamic_cast< SbxVariable* >(pToBeChanged);
+
+ if ( pSbxVariable )
{
// Wenn der Typ variabel ist, macht die Konvertierung des SBX nichts,
// bei festem Typ wird der String konvertiert.
- ((SbxVariable*)pToBeChanged)->PutStringExt( aResult );
+ pSbxVariable->PutStringExt( aResult );
}
else
bError = sal_True;
@@ -2157,7 +2160,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
}
bool bCollapse = false;
- if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) )
+ if ( pSBX && dynamic_cast< SbxVariable* >(pSBX) && !dynamic_cast< SbxMethod* >(pSBX) )
{
SbxVariable* pVar = (SbxVariable*)pSBX;
// Sonderbehandlung fuer Arrays:
@@ -2166,7 +2169,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
{
// Mehrdimensionale Arrays beruecksichtigen!
SbxBase* pBase = pVar->GetObject();
- if ( pBase && pBase->ISA( SbxDimArray ) )
+ if ( pBase && dynamic_cast< SbxDimArray* >(pBase) )
{
SbxDimArray* pNewArray = (SbxDimArray*)pBase;
SbxDimArray* pOldArray = pItem->mpArray;
@@ -2231,7 +2234,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
{
SbxObject* pObj = NULL;
SbxBase* pBase = pVar->GetObject();
- if( pBase && pBase->ISA( SbxObject ) )
+ if( pBase && dynamic_cast< SbxObject* >(pBase) )
pObj = (SbxObject*)pBase;
if( pObj )
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 84ece1094120..5df59d2f7246 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -97,8 +97,6 @@ using namespace ::com::sun::star::ui::dialogs;
DBG_NAME( DialogWindow )
-TYPEINIT1( DialogWindow, IDEBaseWindow );
-
DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, String aLibName, String aName,
const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xDialogModel )
:IDEBaseWindow( pParent, rDocument, aLibName, aName )
@@ -252,18 +250,33 @@ void DialogWindow::Command( const CommandEvent& rCEvt )
if ( pDispatcher )
{
SdrView* pView = GetView();
- if( !rCEvt.IsMouseEvent() && pView->AreObjectsMarked() )
+ if( !rCEvt.IsMouseEvent() && pView->areSdrObjectsSelected() )
{
- Rectangle aMarkedRect( pView->GetMarkedRect() );
- Point MarkedCenter( aMarkedRect.Center() );
- Point PosPixel( LogicToPixel( MarkedCenter ) );
- pDispatcher->ExecutePopup( IDEResId(RID_POPUP_DLGED), this, &PosPixel );
+ basegfx::B2DRange aMarkedRange(pView->getMarkedObjectSnapRange());
+
+ if(pView->IsGluePointEditMode() && pView->areGluesSelected())
+ {
+ aMarkedRange = pView->getMarkedGluePointRange();
+ }
+
+ if(pView->HasMarkedPoints())
+ {
+ aMarkedRange = pView->getMarkedPointRange();
+ }
+
+ const basegfx::B2DPoint aMarkedCenter(aMarkedRange.getCenter());
+ const basegfx::B2DPoint aDiscreteMarkedCenter(GetViewTransformation() * aMarkedCenter);
+ const Point aOldPoint(basegfx::fround(aDiscreteMarkedCenter.getX()), basegfx::fround(aDiscreteMarkedCenter.getY()));
+
+ pDispatcher->ExecutePopup(
+ IDEResId(RID_POPUP_DLGED),
+ this,
+ &aOldPoint);
}
else
{
pDispatcher->ExecutePopup( IDEResId(RID_POPUP_DLGED) );
}
-
}
}
else
@@ -329,7 +342,7 @@ void __EXPORT DialogWindow::GetState( SfxItemSet& rSet )
case SID_COPY:
{
// any object selected?
- if ( !pEditor->GetView()->AreObjectsMarked() )
+ if ( !pEditor->GetView()->areSdrObjectsSelected() )
rSet.DisableItem( nWh );
}
break;
@@ -338,7 +351,7 @@ void __EXPORT DialogWindow::GetState( SfxItemSet& rSet )
case SID_BACKSPACE:
{
// any object selected?
- if ( !pEditor->GetView()->AreObjectsMarked() )
+ if ( !pEditor->GetView()->areSdrObjectsSelected() )
rSet.DisableItem( nWh );
if ( IsReadOnly() )
@@ -424,7 +437,7 @@ void __EXPORT DialogWindow::GetState( SfxItemSet& rSet )
{
BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL;
- if ( pViewFrame && !pViewFrame->HasChildWindow( SID_SHOW_PROPERTYBROWSER ) && !pEditor->GetView()->AreObjectsMarked() )
+ if ( pViewFrame && !pViewFrame->HasChildWindow( SID_SHOW_PROPERTYBROWSER ) && !pEditor->GetView()->areSdrObjectsSelected() )
rSet.DisableItem( nWh );
if ( IsReadOnly() )
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 6461643d8761..74fffc3f2c9d 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -98,7 +98,7 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
String aLibName = pCurWin->GetLibName();
String aName = pCurWin->GetName();
- if ( pCurWin->ISA( ModulWindow ) )
+ if ( dynamic_cast< ModulWindow* >(pCurWin) )
{
// module
if ( QueryDelModule( aName, pCurWin ) )
@@ -130,7 +130,7 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
break;
case FID_SEARCH_NOW:
{
- if ( pCurWin->ISA( ModulWindow ) )
+ if ( dynamic_cast< ModulWindow* >(pCurWin) )
{
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -138,8 +138,8 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
sal_uInt16 nWhich = pArgs->GetWhichByPos( 0 );
DBG_ASSERT( nWhich, "Wich fuer SearchItem ?" );
const SfxPoolItem& rItem = pArgs->Get( nWhich );
- DBG_ASSERT( rItem.ISA( SvxSearchItem ), "Kein Searchitem!" );
- if ( rItem.ISA( SvxSearchItem ) )
+ DBG_ASSERT( dynamic_cast< const SvxSearchItem* >(&rItem), "Kein Searchitem!" );
+ if ( dynamic_cast< const SvxSearchItem* >(&rItem) )
{
// Item wegen der Einstellungen merken...
IDE_DLL()->GetExtraData()->SetSearchItem( (const SvxSearchItem&)rItem );
@@ -151,7 +151,7 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
IDEBaseWindow* pWin = aIDEWindowTable.First();
while ( pWin )
{
- if ( !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) )
+ if ( !pWin->IsSuspended() && dynamic_cast< ModulWindow* >(pWin) )
nActModWindows++;
pWin = aIDEWindowTable.Next();
}
@@ -161,7 +161,7 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
pWin = aIDEWindowTable.First();
while ( pWin )
{
- if ( !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) )
+ if ( !pWin->IsSuspended() && dynamic_cast< ModulWindow* >(pWin) )
nFound = nFound + ((ModulWindow*)pWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem );
pWin = aIDEWindowTable.Next();
}
@@ -202,7 +202,7 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
bCanceled = sal_True;
}
- if ( pWin && !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) )
+ if ( pWin && !pWin->IsSuspended() && dynamic_cast< ModulWindow* >(pWin) )
{
if ( pWin != pCurWin )
{
@@ -239,7 +239,7 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
break;
case FID_SEARCH_OFF:
{
- if ( pCurWin && pCurWin->ISA( ModulWindow ) )
+ if ( pCurWin && dynamic_cast< ModulWindow* >(pCurWin) )
pCurWin->GrabFocus();
}
break;
@@ -268,7 +268,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICSTOP:
{
// Evtl. nicht einfach anhalten, falls auf Brechpunkt!
- if ( pCurWin && pCurWin->IsA( TYPE( ModulWindow ) ) )
+ if ( pCurWin && dynamic_cast< ModulWindow* >(pCurWin) )
((ModulWindow*)pCurWin)->BasicStop();
BasicIDE::StopBasic();
}
@@ -287,7 +287,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
{
uno::Reference< task::XStatusIndicator > xStatusIndicator;
- SFX_REQUEST_ARG( rReq, pStatusIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL, sal_False );
+ SFX_REQUEST_ARG( rReq, pStatusIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL );
if ( pStatusIndicatorItem )
OSL_VERIFY( pStatusIndicatorItem->GetValue() >>= xStatusIndicator );
else
@@ -428,7 +428,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
if ( aNewName != aOldName )
{
bool bRenameOk = false;
- if ( pWin->IsA( TYPE( ModulWindow ) ) )
+ if ( dynamic_cast< ModulWindow* >(pWin) )
{
ModulWindow* pModWin = (ModulWindow*)pWin;
String aLibName = ( pModWin->GetLibName() );
@@ -444,7 +444,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
}
}
- else if ( pWin->IsA( TYPE( DialogWindow ) ) )
+ else if ( dynamic_cast< DialogWindow* >(pWin) )
{
DialogWindow* pDlgWin = (DialogWindow*)pWin;
bRenameOk = pDlgWin->RenameDialog( aNewName );
@@ -492,7 +492,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
IDEBaseWindow* pWin = aIDEWindowTable.First();
while ( pWin )
{
- if ( !pWin->IsSuspended() && pWin->IsA( TYPE( ModulWindow ) ) )
+ if ( !pWin->IsSuspended() && dynamic_cast< ModulWindow* >(pWin) )
{
if ( rReq.GetSlot() == SID_BASICIDE_STOREALLMODULESOURCES )
pWin->StoreData();
@@ -648,7 +648,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
{
::std::auto_ptr< ScriptDocument > pDocument;
- SFX_REQUEST_ARG( rReq, pDocumentItem, SfxStringItem, SID_BASICIDE_ARG_DOCUMENT, sal_False );
+ SFX_REQUEST_ARG( rReq, pDocumentItem, SfxStringItem, SID_BASICIDE_ARG_DOCUMENT );
if ( pDocumentItem )
{
String sDocumentCaption = pDocumentItem->GetValue();
@@ -656,7 +656,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
pDocument.reset( new ScriptDocument( ScriptDocument::getDocumentWithURLOrCaption( sDocumentCaption ) ) );
}
- SFX_REQUEST_ARG( rReq, pDocModelItem, SfxUsrAnyItem, SID_BASICIDE_ARG_DOCUMENT_MODEL, sal_False );
+ SFX_REQUEST_ARG( rReq, pDocModelItem, SfxUsrAnyItem, SID_BASICIDE_ARG_DOCUMENT_MODEL );
if ( !pDocument.get() && pDocModelItem )
{
uno::Reference< frame::XModel > xModel( pDocModelItem->GetValue(), UNO_QUERY );
@@ -667,21 +667,21 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
if ( !pDocument.get() )
break;
- SFX_REQUEST_ARG( rReq, pLibNameItem, SfxStringItem, SID_BASICIDE_ARG_LIBNAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pLibNameItem, SfxStringItem, SID_BASICIDE_ARG_LIBNAME );
if ( !pLibNameItem )
break;
String aLibName( pLibNameItem->GetValue() );
pDocument->loadLibraryIfExists( E_SCRIPTS, aLibName );
SetCurLib( *pDocument, aLibName );
- SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_BASICIDE_ARG_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_BASICIDE_ARG_NAME );
if ( pNameItem )
{
String aName( pNameItem->GetValue() );
String aModType( String::CreateFromAscii( "Module" ) );
String aDlgType( String::CreateFromAscii( "Dialog" ) );
String aType( aModType );
- SFX_REQUEST_ARG( rReq, pTypeItem, SfxStringItem, SID_BASICIDE_ARG_TYPE, sal_False );
+ SFX_REQUEST_ARG( rReq, pTypeItem, SfxStringItem, SID_BASICIDE_ARG_TYPE );
if ( pTypeItem )
aType = pTypeItem->GetValue();
@@ -697,10 +697,11 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
if ( pTabBar )
pTabBar->MakeVisible( pTabBar->GetCurPageId() );
- if ( pWin->ISA( ModulWindow ) )
+ ModulWindow* pModWin = dynamic_cast< ModulWindow* >(pWin);
+
+ if ( pModWin )
{
- ModulWindow* pModWin = (ModulWindow*)pWin;
- SFX_REQUEST_ARG( rReq, pLineItem, SfxUInt32Item, SID_BASICIDE_ARG_LINE, sal_False );
+ SFX_REQUEST_ARG( rReq, pLineItem, SfxUInt32Item, SID_BASICIDE_ARG_LINE );
if ( pLineItem )
{
pModWin->AssertValidEditEngine();
@@ -733,7 +734,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
pModWin->GetEditVScrollBar().SetThumbPos( pTextView->GetStartDocPos().Y() );
}
sal_uInt16 nCol1 = 0, nCol2 = 0;
- SFX_REQUEST_ARG( rReq, pCol1Item, SfxUInt16Item, SID_BASICIDE_ARG_COLUMN1, sal_False );
+ SFX_REQUEST_ARG( rReq, pCol1Item, SfxUInt16Item, SID_BASICIDE_ARG_COLUMN1 );
if ( pCol1Item )
{
nCol1 = pCol1Item->GetValue();
@@ -741,7 +742,7 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
--nCol1;
nCol2 = nCol1;
}
- SFX_REQUEST_ARG( rReq, pCol2Item, SfxUInt16Item, SID_BASICIDE_ARG_COLUMN2, sal_False );
+ SFX_REQUEST_ARG( rReq, pCol2Item, SfxUInt16Item, SID_BASICIDE_ARG_COLUMN2 );
if ( pCol2Item )
{
nCol2 = pCol2Item->GetValue();
@@ -848,7 +849,7 @@ void __EXPORT BasicIDEShell::GetState(SfxItemSet &rSet)
case SID_BASICSAVEAS:
case SID_BASICIDE_MATCHGROUP:
{
- if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) )
+ if ( !pCurWin || !dynamic_cast< ModulWindow* >(pCurWin) )
rSet.DisableItem( nWh );
else if ( ( nWh == SID_BASICLOAD ) && ( StarBASIC::IsRunning() || ( pCurWin && pCurWin->IsReadOnly() ) ) )
rSet.DisableItem( nWh );
@@ -861,7 +862,7 @@ void __EXPORT BasicIDEShell::GetState(SfxItemSet &rSet)
case SID_BASICIDE_TOGGLEBRKPNT:
case SID_BASICIDE_MANAGEBRKPNTS:
{
- if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) )
+ if ( !pCurWin || !dynamic_cast< ModulWindow* >(pCurWin) )
rSet.DisableItem( nWh );
else if ( StarBASIC::IsRunning() && !((ModulWindow*)pCurWin)->GetBasicStatus().bIsInReschedule )
rSet.DisableItem( nWh );
@@ -869,7 +870,7 @@ void __EXPORT BasicIDEShell::GetState(SfxItemSet &rSet)
break;
case SID_BASICCOMPILE:
{
- if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) || StarBASIC::IsRunning() )
+ if ( !pCurWin || !dynamic_cast< ModulWindow* >(pCurWin) || StarBASIC::IsRunning() )
rSet.DisableItem( nWh );
}
break;
@@ -883,7 +884,7 @@ void __EXPORT BasicIDEShell::GetState(SfxItemSet &rSet)
case SID_CHOOSE_CONTROLS:
case SID_DIALOG_TESTMODE:
{
- if( !pCurWin || !pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if( !pCurWin || !dynamic_cast< DialogWindow* >(pCurWin) )
rSet.DisableItem( nWh );
}
break;
@@ -1036,7 +1037,7 @@ sal_Bool BasicIDEShell::HasUIFeature( sal_uInt32 nFeature )
if ( (nFeature & BASICIDE_UI_FEATURE_SHOW_BROWSER) == BASICIDE_UI_FEATURE_SHOW_BROWSER )
{
// fade out (in) property browser in module (dialog) windows
- if ( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) && !pCurWin->IsReadOnly() )
+ if ( pCurWin && dynamic_cast< DialogWindow* >(pCurWin) && !pCurWin->IsReadOnly() )
bResult = sal_True;
}
@@ -1066,7 +1067,7 @@ void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, sal_Bool bUpdateTabBar
pPrevCurWin->Hide();
pPrevCurWin->Deactivating();
// pPrevCurWin->GetLayoutWindow()->Hide();
- if( pPrevCurWin->IsA( TYPE( DialogWindow ) ) )
+ if( dynamic_cast< DialogWindow* >(pPrevCurWin) )
{
((DialogWindow*)pPrevCurWin)->DisableBrowser();
}
@@ -1078,7 +1079,7 @@ void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, sal_Bool bUpdateTabBar
if ( pCurWin )
{
AdjustPosSizePixel( Point( 0, 0 ), GetViewFrame()->GetWindow().GetOutputSizePixel() );
- if( pCurWin->IsA( TYPE( ModulWindow ) ) )
+ if( dynamic_cast< ModulWindow* >(pCurWin) )
{
GetViewFrame()->GetWindow().SetHelpId( HID_BASICIDE_MODULWINDOW );
pModulLayout->SetModulWindow( (ModulWindow*)pCurWin );
@@ -1095,7 +1096,7 @@ void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, sal_Bool bUpdateTabBar
BasicIDEData* pData = IDE_DLL()->GetExtraData();
if ( pData )
{
- sal_uInt16 nCurrentType = pCurWin->IsA( TYPE( ModulWindow ) ) ? BASICIDE_TYPE_MODULE : BASICIDE_TYPE_DIALOG;
+ sal_uInt16 nCurrentType = dynamic_cast< ModulWindow* >(pCurWin) ? BASICIDE_TYPE_MODULE : BASICIDE_TYPE_DIALOG;
LibInfoItem* pLibInfoItem = new LibInfoItem( pCurWin->GetDocument(), pCurWin->GetLibName(), pCurWin->GetName(), nCurrentType );
pData->GetLibInfos().InsertInfo( pLibInfoItem );
}
@@ -1115,7 +1116,7 @@ void BasicIDEShell::SetCurWindow( IDEBaseWindow* pNewWin, sal_Bool bUpdateTabBar
if ( pFocusWindow ) // Focus in BasicIDE
pNewWin->GrabFocus();
}
- if( pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if( dynamic_cast< DialogWindow* >(pCurWin) )
((DialogWindow*)pCurWin)->UpdateBrowser();
}
if ( bUpdateTabBar )
@@ -1177,7 +1178,7 @@ void BasicIDEShell::ManageToolbars()
if ( xLayoutManager.is() )
{
xLayoutManager->lock();
- if( pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if( dynamic_cast< DialogWindow* >(pCurWin) )
{
xLayoutManager->destroyElement( aMacroBarResName );
@@ -1214,8 +1215,8 @@ IDEBaseWindow* BasicIDEShell::FindWindow( const ScriptDocument& rDocument, const
return pWin;
}
else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rName &&
- ( ( pWin->IsA( TYPE( ModulWindow ) ) && nType == BASICIDE_TYPE_MODULE ) ||
- ( pWin->IsA( TYPE( DialogWindow ) ) && nType == BASICIDE_TYPE_DIALOG ) ) )
+ ( ( dynamic_cast< ModulWindow* >(pWin) && nType == BASICIDE_TYPE_MODULE ) ||
+ ( dynamic_cast< DialogWindow* >(pWin) && nType == BASICIDE_TYPE_DIALOG ) ) )
{
return pWin;
}
@@ -1272,7 +1273,7 @@ ModulWindow* BasicIDEShell::ShowActiveModuleWindow( StarBASIC* pBasic )
SetCurLib( ScriptDocument::getApplicationScriptDocument(), String(), false );
SbModule* pActiveModule = StarBASIC::GetActiveModule();
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
+ SbClassModuleObject* pClassModuleObject = dynamic_cast< SbClassModuleObject* >( pActiveModule);
if( pClassModuleObject != NULL )
pActiveModule = pClassModuleObject->getClassModule();
@@ -1281,7 +1282,7 @@ ModulWindow* BasicIDEShell::ShowActiveModuleWindow( StarBASIC* pBasic )
{
ModulWindow* pWin = 0;
SbxObject* pParent = pActiveModule->GetParent();
- DBG_ASSERT( pParent && pParent->ISA( StarBASIC ), "Kein BASIC!" );
+ DBG_ASSERT( pParent && dynamic_cast< StarBASIC* >(pParent), "Kein BASIC!" );
StarBASIC* pLib = static_cast< StarBASIC* >( pParent );
if ( pLib )
{
@@ -1339,7 +1340,7 @@ void __EXPORT BasicIDEShell::AdjustPosSizePixel( const Point &rPos, const Size &
Window* pEdtWin = pCurWin ? pCurWin->GetLayoutWindow() : pModulLayout;
if ( pEdtWin )
{
- if( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if( pCurWin && dynamic_cast< DialogWindow* >(pCurWin) )
pEdtWin->SetPosSizePixel( rPos, aSz ); // Ohne ScrollBar
else
pEdtWin->SetPosSizePixel( rPos, aOutSz );
@@ -1360,7 +1361,7 @@ void __EXPORT BasicIDEShell::Activate( sal_Bool bMDI )
if ( bMDI )
{
- if( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if( pCurWin && dynamic_cast< DialogWindow* >(pCurWin) )
((DialogWindow*)pCurWin)->UpdateBrowser();
ShowObjectDialog( sal_True, sal_False );
@@ -1373,7 +1374,7 @@ void __EXPORT BasicIDEShell::Deactivate( sal_Bool bMDI )
// Deactivate durch eine MessageBox ist bMDI FALSE
if ( bMDI )
{
- if( pCurWin && pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if( pCurWin && dynamic_cast< DialogWindow* >(pCurWin) )
{
DialogWindow* pXDlgWin = (DialogWindow*)pCurWin;
pXDlgWin->DisableBrowser();
diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx
index af403fe039c0..dfa01a3a3161 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -68,7 +68,7 @@ IMPL_LINK( BasicIDEShell, ObjectDialogInsertHdl, ObjectCatalog *, pObjCat )
if ( !pCurWin )
return 0;
- if ( pCurWin->IsA( TYPE( ModulWindow ) ) )
+ if ( dynamic_cast< ModulWindow* >(pCurWin) )
{
ModulWindow* pEditWin = (ModulWindow*)pCurWin;
pEditWin->InsertFromObjectCatalog( pObjCat );
@@ -104,9 +104,11 @@ sal_uInt16 __EXPORT BasicIDEShell::Print( SfxProgress &rProgress, sal_Bool bIsAP
sal_Bool BasicIDEShell::HasSelection( sal_Bool /* bText */ ) const
{
sal_Bool bSel = sal_False;
- if ( pCurWin && pCurWin->ISA( ModulWindow ) )
+ ModulWindow* pModulWindow = dynamic_cast< ModulWindow* >(pCurWin);
+
+ if ( pModulWindow )
{
- TextView* pEditView = ((ModulWindow*)pCurWin)->GetEditView();
+ TextView* pEditView = pModulWindow->GetEditView();
if ( pEditView && pEditView->HasSelection() )
bSel = sal_True;
}
@@ -116,9 +118,11 @@ sal_Bool BasicIDEShell::HasSelection( sal_Bool /* bText */ ) const
String BasicIDEShell::GetSelectionText( sal_Bool bWholeWord )
{
String aText;
- if ( pCurWin && pCurWin->ISA( ModulWindow ) )
+ ModulWindow* pModulWindow = dynamic_cast< ModulWindow* >(pCurWin);
+
+ if ( pModulWindow )
{
- TextView* pEditView = ((ModulWindow*)pCurWin)->GetEditView();
+ TextView* pEditView = pModulWindow->GetEditView();
if ( pEditView )
{
if ( bWholeWord && !pEditView->HasSelection() )
@@ -141,7 +145,7 @@ String BasicIDEShell::GetSelectionText( sal_Bool bWholeWord )
SfxPrinter* __EXPORT BasicIDEShell::GetPrinter( sal_Bool bCreate )
{
- if ( pCurWin ) // && pCurWin->ISA( ModulWindow ) )
+ if ( pCurWin ) // && dynamic_cast< ModulWindow* >(pCurWin) )
{
BasicDocShell* pDocShell = (BasicDocShell*)GetViewFrame()->GetObjectShell();
DBG_ASSERT( pDocShell, "DocShell ?!" );
@@ -303,7 +307,7 @@ ModulWindow* BasicIDEShell::FindBasWin( const ScriptDocument& rDocument, const S
IDEBaseWindow* pWin = aIDEWindowTable.First();
while ( pWin && !pModWin )
{
- if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( ModulWindow ) ) )
+ if ( ( !pWin->IsSuspended() || bFindSuspended ) && dynamic_cast< ModulWindow* >(pWin) )
{
if ( !rLibName.Len() ) // nur irgendeins finden...
pModWin = (ModulWindow*)pWin;
@@ -320,14 +324,18 @@ ModulWindow* BasicIDEShell::FindBasWin( const ScriptDocument& rDocument, const S
void __EXPORT BasicIDEShell::Move()
{
- if ( pCurWin && pCurWin->ISA( ModulWindow ) )
- ((ModulWindow*)pCurWin)->FrameWindowMoved();
+ ModulWindow* pModulWindow = dynamic_cast< ModulWindow* >(pCurWin);
+
+ if ( pModulWindow )
+ pModulWindow->FrameWindowMoved();
}
-void __EXPORT BasicIDEShell::ShowCursor( FASTBOOL bOn )
+void __EXPORT BasicIDEShell::ShowCursor( bool bOn )
{
- if ( pCurWin && pCurWin->ISA( ModulWindow ) )
- ((ModulWindow*)pCurWin)->ShowCursor( (sal_Bool)bOn );
+ ModulWindow* pModulWindow = dynamic_cast< ModulWindow* >(pCurWin);
+
+ if ( pModulWindow )
+ pModulWindow->ShowCursor( (sal_Bool)bOn );
}
// Hack for #101048
@@ -336,7 +344,7 @@ sal_Int32 getBasicIDEShellCount( void );
// Nur wenn Basicfenster oben:
void __EXPORT BasicIDEShell::ExecuteBasic( SfxRequest& rReq )
{
- if ( !pCurWin || !pCurWin->IsA( TYPE( ModulWindow ) ) )
+ if ( !pCurWin || !dynamic_cast< ModulWindow* >(pCurWin) )
return;
pCurWin->ExecuteCommand( rReq );
diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx
index ccd7b483878c..660ef2077e30 100644
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@ -137,7 +137,7 @@ DialogWindow* BasicIDEShell::FindDlgWin( const ScriptDocument& rDocument, const
IDEBaseWindow* pWin = aIDEWindowTable.First();
while ( pWin && !pDlgWin )
{
- if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( DialogWindow ) ) )
+ if ( ( !pWin->IsSuspended() || bFindSuspended ) && dynamic_cast< DialogWindow* >(pWin) )
{
if ( !rLibName.Len() ) // nur irgendeins finden...
pDlgWin = (DialogWindow*)pWin;
@@ -154,7 +154,7 @@ DialogWindow* BasicIDEShell::FindDlgWin( const ScriptDocument& rDocument, const
SdrView* BasicIDEShell::GetCurDlgView() const
{
- if ( !pCurWin || !pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if ( !pCurWin || !dynamic_cast< DialogWindow* >(pCurWin) )
return NULL;
DialogWindow* pWin = (DialogWindow*)pCurWin;
@@ -164,8 +164,8 @@ SdrView* BasicIDEShell::GetCurDlgView() const
// Nur wenn Dialogfenster oben:
void __EXPORT BasicIDEShell::ExecuteDialog( SfxRequest& rReq )
{
- if ( pCurWin && ( pCurWin->IsA( TYPE( DialogWindow) ) ||
- (rReq.GetSlot() == SID_IMPORT_DIALOG &&pCurWin->IsA( TYPE( ModulWindow) ) ) ) )
+ if ( pCurWin && ( dynamic_cast< DialogWindow* >(pCurWin) ||
+ (rReq.GetSlot() == SID_IMPORT_DIALOG && dynamic_cast< ModulWindow* >(pCurWin) ) ) )
{
pCurWin->ExecuteCommand( rReq );
}
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 9a2919138a92..9f556ab09e2b 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -149,8 +149,6 @@ public:
};
-TYPEINIT1( BasicIDEShell, SfxViewShell );
-
SFX_IMPL_NAMED_VIEWFACTORY( BasicIDEShell, "Default" )
{
SFX_VIEW_REGISTRATION( BasicDocShell );
@@ -610,9 +608,11 @@ void __EXPORT BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
{
if ( IDE_DLL()->GetShell() )
{
- if ( rHint.IsA( TYPE( SfxSimpleHint ) ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- switch ( ((SfxSimpleHint&)rHint).GetId() )
+ switch ( pSfxSimpleHint->GetId() )
{
case SFX_HINT_DYING:
{
@@ -623,10 +623,11 @@ void __EXPORT BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
break;
}
- if ( rHint.IsA( TYPE( SbxHint ) ) )
+ const SbxHint* pSbxHint = dynamic_cast< const SbxHint* >(&rHint);
+
+ if ( pSbxHint )
{
- SbxHint& rSbxHint = (SbxHint&)rHint;
- sal_uLong nHintId = rSbxHint.GetId();
+ sal_uLong nHintId = pSbxHint->GetId();
if ( ( nHintId == SBX_HINT_BASICSTART ) ||
( nHintId == SBX_HINT_BASICSTOP ) )
{
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index e33f03af0a77..34954c5ea03a 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -137,7 +137,7 @@ SbMethod* CreateMacro( SbModule* pModule, const String& rMacroName )
// update module in library
ScriptDocument aDocument( ScriptDocument::NoDocument );
SbxObject* pParent = pModule->GetParent();
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pParent);
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( pParent);
DBG_ASSERT(pBasic, "BasicIDE::CreateMacro: No Basic found!");
if ( pBasic )
{
@@ -252,10 +252,10 @@ bool RemoveDialog( const ScriptDocument& rDocument, const String& rLibName, cons
StarBASIC* FindBasic( const SbxVariable* pVar )
{
const SbxVariable* pSbx = pVar;
- while ( pSbx && !pSbx->ISA( StarBASIC ) )
+ while ( pSbx && !dynamic_cast< const StarBASIC* >(pSbx) )
pSbx = pSbx->GetParent();
- DBG_ASSERT( !pSbx || pSbx->ISA( StarBASIC ), "Find Basic: Kein Basic!" );
+ DBG_ASSERT( !pSbx || dynamic_cast< const StarBASIC* >(pSbx), "Find Basic: Kein Basic!" );
return (StarBASIC*)pSbx;
}
@@ -505,7 +505,7 @@ SfxBindings* GetBindingsPtr()
while ( pView )
{
SfxObjectShell* pObjShell = pView->GetObjectShell();
- if ( pObjShell && pObjShell->ISA( BasicDocShell ) )
+ if ( pObjShell && dynamic_cast< BasicDocShell* >(pObjShell) )
{
pFrame = pView;
break;
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index 394db46993ee..2665008df490 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -226,7 +226,7 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
break;
case OBJ_TYPE_MODULE:
{
- DBG_ASSERT( pVar && pVar->IsA( TYPE(StarBASIC) ), "FindVariable: Ungueltiges Basic" );
+ DBG_ASSERT( pVar && dynamic_cast< StarBASIC* >(pVar), "FindVariable: Ungueltiges Basic" );
// extract the module name from the string like "Sheet1 (Example1)"
if( bDocumentObjects )
{
@@ -238,7 +238,7 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry )
break;
case OBJ_TYPE_METHOD:
{
- DBG_ASSERT( pVar && ( (pVar->IsA( TYPE(SbModule) )) || (pVar->IsA( TYPE(SbxObject) )) ), "FindVariable: Ungueltiges Modul/Objekt" );
+ DBG_ASSERT( pVar && ( (dynamic_cast< SbModule* >(pVar)) || (dynamic_cast< SbxObject* >(pVar)) ), "FindVariable: Ungueltiges Modul/Objekt" );
pVar = ((SbxObject*)pVar)->GetMethods()->Find( aName, SbxCLASS_METHOD );
}
break;
@@ -470,7 +470,7 @@ bool BasicTreeListBox::IsValidEntry( SvLBoxEntry* pEntry )
SbModule* BasicTreeListBox::FindModule( SvLBoxEntry* pEntry )
{
SbxVariable* pVar = FindVariable( pEntry );
- if ( pVar && pVar->IsA( TYPE(SbModule ) ) )
+ if ( pVar && dynamic_cast< SbModule* >(pVar) )
return (SbModule*)pVar;
return 0;
}
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 762f99c6726d..f04d486ff8e7 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -63,9 +63,6 @@ DBG_NAME( IDEBaseWindow )
const char* pRegName = "BasicIDETabBar";
-TYPEINIT0( IDEBaseWindow )
-TYPEINIT1( SbxItem, SfxPoolItem );
-
IDEBaseWindow::IDEBaseWindow( Window* pParent, const ScriptDocument& rDocument, String aLibName, String aName )
:Window( pParent, WinBits( WB_3DLOOK ) )
,m_aDocument( rDocument )
@@ -592,7 +589,7 @@ void __EXPORT BasicIDETabBar::Command( const CommandEvent& rCEvt )
{
IDEWindowTable& aIDEWindowTable = pIDEShell->GetIDEWindowTable();
IDEBaseWindow* pWin = aIDEWindowTable.Get( GetCurPageId() );
- if( pWin && pWin->ISA( ModulWindow ) )
+ if( pWin && dynamic_cast< ModulWindow* >(pWin) )
{
SbModule* pActiveModule = (SbModule*)pBasic->FindModule( pWin->GetName() );
if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
@@ -663,11 +660,11 @@ void BasicIDETabBar::Sort()
aTabBarSortHelper.aPageText = GetPageText( nId );
IDEBaseWindow* pWin = aIDEWindowTable.Get( nId );
- if ( pWin->IsA( TYPE( ModulWindow ) ) )
+ if ( dynamic_cast< ModulWindow* >(pWin) )
{
aModuleList.push_back( aTabBarSortHelper );
}
- else if ( pWin->IsA( TYPE( DialogWindow ) ) )
+ else if ( dynamic_cast< DialogWindow* >(pWin) )
{
aDialogList.push_back( aTabBarSortHelper );
}
@@ -885,6 +882,8 @@ LibInfoItem* LibInfos::GetInfo( const LibInfoKey& rKey )
return pItem;
}
+IMPL_POOLITEM_FACTORY(SbxItem)
+
SbxItem::SbxItem(sal_uInt16 nWhich_, const ScriptDocument& rDocument, const String& aLibName, const String& aName, sal_uInt16 nType )
:SfxPoolItem( nWhich_ )
,m_aDocument(rDocument)
@@ -916,7 +915,7 @@ SbxItem::SbxItem(const SbxItem& rCopy)
int SbxItem::operator==( const SfxPoolItem& rCmp) const
{
- DBG_ASSERT( rCmp.ISA( SbxItem ), "==: Kein SbxItem!" );
+ DBG_ASSERT( dynamic_cast< const SbxItem* >(&rCmp), "==: Kein SbxItem!" );
return ( SfxPoolItem::operator==( rCmp ) && ( m_aDocument == ((const SbxItem&)rCmp).m_aDocument )
&& ( m_aLibName == ((const SbxItem&)rCmp).m_aLibName )
&& ( m_aName == ((const SbxItem&)rCmp).m_aName )
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index 6bb156b30541..fffa9b0dceb2 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -144,7 +144,7 @@ void LocalizationMgr::implEnableDisableResourceForAllLibraryDialogs( HandleResou
{
String aDlgName = pDlgNames[ i ];
DialogWindow* pWin = m_pIDEShell->FindDlgWin( m_aDocument, m_aLibName, aDlgName, sal_False );
- if( pWin && pWin->IsA( TYPE( DialogWindow ) ) )
+ if( pWin && dynamic_cast< DialogWindow* >(pWin) )
{
DialogWindow* pDialogWin = static_cast< DialogWindow* >( pWin );
Reference< container::XNameContainer > xDialog = pDialogWin->GetDialog();
@@ -834,7 +834,7 @@ void LocalizationMgr::handleSetCurrentLocale( ::com::sun::star::lang::Locale aLo
pBindings->Invalidate( SID_BASICIDE_CURRENT_LANG );
IDEBaseWindow* pCurWin = m_pIDEShell->GetCurWindow();
- if ( pCurWin && !pCurWin->IsSuspended() && pCurWin->IsA( TYPE( DialogWindow ) ) )
+ if ( pCurWin && !pCurWin->IsSuspended() && dynamic_cast< DialogWindow* >(pCurWin) )
{
DialogWindow* pDlgWin = (DialogWindow*)pCurWin;
DlgEditor* pWinEditor = pDlgWin->GetEditor();
@@ -871,7 +871,7 @@ DialogWindow* FindDialogWindowForEditor( DlgEditor* pEditor )
DialogWindow* pFoundDlgWin = NULL;
while( pWin )
{
- if ( !pWin->IsSuspended() && pWin->IsA( TYPE( DialogWindow ) ) )
+ if ( !pWin->IsSuspended() && dynamic_cast< DialogWindow* >(pWin) )
{
DialogWindow* pDlgWin = (DialogWindow*)pWin;
DlgEditor* pWinEditor = pDlgWin->GetEditor();
diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx
index 0109a4ffb31a..56e0cc606b67 100644
--- a/basctl/source/basicide/tbxctl.cxx
+++ b/basctl/source/basicide/tbxctl.cxx
@@ -139,7 +139,7 @@ void TbxControls::StateChanged( sal_uInt16 nSID, SfxItemState eState,
{
if( pState )
{
- SfxAllEnumItem* pItem = PTR_CAST(SfxAllEnumItem, pState);
+ const SfxAllEnumItem* pItem = dynamic_cast< const SfxAllEnumItem* >( pState);
if( pItem )
{
sal_uInt16 nLastEnum = pItem->GetValue();
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 7c47ac310fc0..deb8ec394f94 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -34,14 +34,12 @@
#include <dlgeddef.hxx>
#include "propbrw.hxx"
#include <localizationmgr.hxx>
-
#include <basidesh.hxx>
#include <iderdll.hxx>
#include <vcl/scrbar.hxx>
#include <tools/shl.hxx>
#include <svl/itempool.hxx>
#include <sfx2/viewfrm.hxx>
-
#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
#endif
@@ -58,9 +56,8 @@
#include <comphelper/types.hxx>
#include <vcl/svapp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-
-// #i74769#
#include <svx/sdrpaintwindow.hxx>
+#include <svx/svdlegacy.hxx>
using namespace comphelper;
using namespace ::com::sun::star;
@@ -81,10 +78,6 @@ static ::rtl::OUString aTitlePropName =
// DlgEdHint
//============================================================================
-TYPEINIT1( DlgEdHint, SfxHint );
-
-//----------------------------------------------------------------------------
-
DlgEdHint::DlgEdHint( DlgEdHintKind eHint )
:eHintKind( eHint )
{
@@ -173,13 +166,11 @@ void DlgEditor::ShowDialog()
sal_Bool DlgEditor::UnmarkDialog()
{
- SdrObject* pDlgObj = pDlgEdModel->GetPage(0)->GetObj(0);
- SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
-
- sal_Bool bWasMarked = pDlgEdView->IsObjMarked( pDlgObj );
+ SdrObject* pDlgObj = GetModel()->GetPage(0)->GetObj(0);
+ const bool bWasMarked(GetView()->IsObjMarked( *pDlgObj ));
if( bWasMarked )
- pDlgEdView->MarkObj( pDlgObj, pPgView, sal_True );
+ GetView()->MarkObj( *pDlgObj, true );
return bWasMarked;
}
@@ -188,13 +179,11 @@ sal_Bool DlgEditor::UnmarkDialog()
sal_Bool DlgEditor::RemarkDialog()
{
- SdrObject* pDlgObj = pDlgEdModel->GetPage(0)->GetObj(0);
- SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
-
- sal_Bool bWasMarked = pDlgEdView->IsObjMarked( pDlgObj );
+ SdrObject* pDlgObj = GetModel()->GetPage(0)->GetObj(0);
+ const bool bWasMarked(GetView()->IsObjMarked( *pDlgObj ));
if( !bWasMarked )
- pDlgEdView->MarkObj( pDlgObj, pPgView, sal_False );
+ GetView()->MarkObj( *pDlgObj, false );
return bWasMarked;
}
@@ -225,15 +214,15 @@ DlgEditor::DlgEditor()
,mnPaintGuard(0)
{
pDlgEdModel = new DlgEdModel();
- pDlgEdModel->GetItemPool().FreezeIdRanges();
- pDlgEdModel->SetScaleUnit( MAP_100TH_MM );
+ GetModel()->GetItemPool().FreezeIdRanges();
+ GetModel()->SetExchangeObjectUnit( MAP_100TH_MM );
- SdrLayerAdmin& rAdmin = pDlgEdModel->GetLayerAdmin();
+ SdrLayerAdmin& rAdmin = GetModel()->GetModelLayerAdmin();
rAdmin.NewLayer( rAdmin.GetControlLayerName() );
rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ) );
- pDlgEdPage = new DlgEdPage( *pDlgEdModel );
- pDlgEdModel->InsertPage( pDlgEdPage );
+ pDlgEdPage = new DlgEdPage( *GetModel() );
+ GetModel()->InsertPage( GetPage() );
pObjFac = new DlgEdFactory();
@@ -286,21 +275,22 @@ void DlgEditor::SetWindow( Window* pWindow_ )
{
DlgEditor::pWindow = pWindow_;
pWindow_->SetMapMode( MapMode( MAP_100TH_MM ) );
- pDlgEdPage->SetSize( pWindow_->PixelToLogic( Size( DLGED_PAGE_WIDTH_MIN, DLGED_PAGE_HEIGHT_MIN ) ) );
+ const basegfx::B2DVector aPageSize(pWindow_->GetInverseViewTransformation() * basegfx::B2DVector(DLGED_PAGE_WIDTH_MIN, DLGED_PAGE_HEIGHT_MIN));
+ GetPage()->SetPageScale(aPageSize);
- pDlgEdView = new DlgEdView( pDlgEdModel, pWindow_, this );
- pDlgEdView->ShowSdrPage(pDlgEdView->GetModel()->GetPage(0));
- pDlgEdView->SetLayerVisible( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), sal_False );
- pDlgEdView->SetMoveSnapOnlyTopLeft( sal_True );
- pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) );
+ pDlgEdView = new DlgEdView( *GetModel(), pWindow_, *this );
+ GetView()->ShowSdrPage(*GetView()->getSdrModelFromSdrView().GetPage(0));
+ GetView()->SetLayerVisible( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), sal_False );
+ GetView()->SetMoveSnapOnlyTopLeft(true);
+ GetView()->SetWorkArea( basegfx::B2DRange( basegfx::B2DPoint( 0.0, 0.0 ), GetPage()->GetPageScale() ) );
- pDlgEdView->SetGridCoarse( aGridSize );
- pDlgEdView->SetSnapGridWidth(Fraction(aGridSize.Width(), 1), Fraction(aGridSize.Height(), 1));
- pDlgEdView->SetGridSnap( bGridSnap );
- pDlgEdView->SetGridVisible( bGridVisible );
- pDlgEdView->SetDragStripes( sal_False );
+ GetView()->SetGridCoarse( aGridSize );
+ GetView()->SetSnapGridWidth(aGridSize.Width(), aGridSize.Height());
+ GetView()->SetGridSnap( bGridSnap );
+ GetView()->SetGridVisible( bGridVisible );
+ GetView()->SetDragStripes( sal_False );
- pDlgEdView->SetDesignMode( sal_True );
+ GetView()->SetDesignMode( true );
::comphelper::disposeComponent( m_xControlContainer );
}
@@ -325,10 +315,10 @@ void DlgEditor::InitScrollBars()
return;
Size aOutSize = pWindow->GetOutputSize();
- Size aPgSize = pDlgEdPage->GetSize();
+ const basegfx::B2DVector& rPgSize = GetPage()->GetPageScale();
- pHScroll->SetRange( Range( 0, aPgSize.Width() ));
- pVScroll->SetRange( Range( 0, aPgSize.Height() ));
+ pHScroll->SetRange(Range(0, basegfx::fround(rPgSize.getX())));
+ pVScroll->SetRange(Range(0, basegfx::fround(rPgSize.getY())));
pHScroll->SetVisibleSize( (sal_uLong)aOutSize.Width() );
pVScroll->SetVisibleSize( (sal_uLong)aOutSize.Height() );
@@ -404,12 +394,12 @@ void DlgEditor::SetDialog( uno::Reference< container::XNameContainer > xUnoContr
m_xUnoControlDialogModel = xUnoControlDialogModel;
// create dialog form
- pDlgEdForm = new DlgEdForm();
+ pDlgEdForm = new DlgEdForm(*GetModel());
uno::Reference< awt::XControlModel > xDlgMod( m_xUnoControlDialogModel , uno::UNO_QUERY );
pDlgEdForm->SetUnoControlModel(xDlgMod);
pDlgEdForm->SetDlgEditor( this );
- ((DlgEdPage*)pDlgEdModel->GetPage(0))->SetDlgEdForm( pDlgEdForm );
- pDlgEdModel->GetPage(0)->InsertObject( pDlgEdForm );
+ ((DlgEdPage*)GetModel()->GetPage(0))->SetDlgEdForm( pDlgEdForm );
+ GetModel()->GetPage(0)->InsertObjectToSdrObjList(*pDlgEdForm);
AdjustPageSize();
pDlgEdForm->SetRectFromProps();
pDlgEdForm->UpdateTabIndices(); // for backward compatibility
@@ -449,11 +439,11 @@ void DlgEditor::SetDialog( uno::Reference< container::XNameContainer > xUnoContr
Any aCtrl = xNameAcc->getByName( aIt->second );
Reference< ::com::sun::star::awt::XControlModel > xCtrlModel;
aCtrl >>= xCtrlModel;
- DlgEdObj* pCtrlObj = new DlgEdObj();
+ DlgEdObj* pCtrlObj = new DlgEdObj(*GetModel());
pCtrlObj->SetUnoControlModel( xCtrlModel );
pCtrlObj->SetDlgEdForm( pDlgEdForm );
pDlgEdForm->AddChild( pCtrlObj );
- pDlgEdModel->GetPage(0)->InsertObject( pCtrlObj );
+ GetModel()->GetPage(0)->InsertObjectToSdrObjList(*pCtrlObj);
pCtrlObj->SetRectFromProps();
pCtrlObj->UpdateStep();
pCtrlObj->StartListening();
@@ -462,21 +452,27 @@ void DlgEditor::SetDialog( uno::Reference< container::XNameContainer > xUnoContr
bFirstDraw = sal_True;
- pDlgEdModel->SetChanged( sal_False );
+ GetModel()->SetChanged( sal_False );
}
void DlgEditor::ResetDialog( void )
{
DlgEdForm* pOldDlgEdForm = pDlgEdForm;
- DlgEdPage* pPage = (DlgEdPage*)pDlgEdModel->GetPage(0);
- SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
- sal_Bool bWasMarked = pDlgEdView->IsObjMarked( pOldDlgEdForm );
- pDlgEdView->UnmarkAll();
- pPage->Clear();
+ DlgEdPage* pPage = (DlgEdPage*)GetModel()->GetPage(0);
+ const bool bWasMarked(GetView()->IsObjMarked( *pOldDlgEdForm ));
+ GetView()->UnmarkAll();
+
+ if(pPage->GetObjCount())
+ {
+ pPage->ClearSdrObjList();
+ pPage->getSdrModelFromSdrObjList().SetChanged();
+ }
+
pPage->SetDlgEdForm( NULL );
SetDialog( m_xUnoControlDialogModel );
+
if( bWasMarked )
- pDlgEdView->MarkObj( pDlgEdForm, pPgView, sal_False );
+ GetView()->MarkObj( *pDlgEdForm, false );
}
@@ -544,7 +540,7 @@ void DlgEditor::Paint( const Rectangle& rRect )
IMPL_LINK( DlgEditor, PaintTimeout, Timer *, EMPTYARG )
{
- if( !pDlgEdView )
+ if( !GetView() )
return 0;
mnPaintGuard++;
@@ -571,7 +567,7 @@ IMPL_LINK( DlgEditor, PaintTimeout, Timer *, EMPTYARG )
Size aSize = pWindow->PixelToLogic( Size( 400, 300 ) );
// align with grid
- Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY()));
+ Size aGridSize_(floor(GetView()->GetSnapGridWidthX()), floor(GetView()->GetSnapGridWidthY()));
aSize.Width() -= aSize.Width() % aGridSize_.Width();
aSize.Height() -= aSize.Height() % aGridSize_.Height();
@@ -594,7 +590,7 @@ IMPL_LINK( DlgEditor, PaintTimeout, Timer *, EMPTYARG )
}
// set dialog position and size
- pDlgEdForm->SetSnapRect( Rectangle( aPos, aSize ) );
+ sdr::legacy::SetSnapRect(*pDlgEdForm, Rectangle( aPos, aSize ) );
pDlgEdForm->EndListening(sal_False);
pDlgEdForm->SetPropsFromRect();
pDlgEdForm->GetDlgEditor()->SetDialogModelChanged(sal_True);
@@ -602,13 +598,13 @@ IMPL_LINK( DlgEditor, PaintTimeout, Timer *, EMPTYARG )
// set position and size of controls
sal_uLong nObjCount;
- if ( pDlgEdPage && ( ( nObjCount = pDlgEdPage->GetObjCount() ) > 0 ) )
+ if ( GetPage() && ( ( nObjCount = GetPage()->GetObjCount() ) > 0 ) )
{
for ( sal_uLong i = 0 ; i < nObjCount ; i++ )
{
- SdrObject* pObj = pDlgEdPage->GetObj(i);
- DlgEdObj* pDlgEdObj = PTR_CAST(DlgEdObj, pObj);
- if ( pDlgEdObj && !pDlgEdObj->ISA(DlgEdForm) )
+ SdrObject* pObj = GetPage()->GetObj(i);
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >(pObj);
+ if ( pDlgEdObj && !dynamic_cast< DlgEdForm* >(pDlgEdObj) )
pDlgEdObj->SetRectFromProps();
}
}
@@ -617,7 +613,7 @@ IMPL_LINK( DlgEditor, PaintTimeout, Timer *, EMPTYARG )
}
// repaint, get PageView and prepare Region
- SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
+ SdrPageView* pPgView = GetView()->GetSdrPageView();
const Region aPaintRectRegion(aPaintRect);
@@ -682,9 +678,9 @@ void DlgEditor::SetMode( DlgEdMode eNewMode )
pFunc = new DlgEdFuncSelect( this );
if ( eNewMode == DLGED_READONLY )
- pDlgEdModel->SetReadOnly( sal_True );
+ GetModel()->SetReadOnly( sal_True );
else
- pDlgEdModel->SetReadOnly( sal_False );
+ GetModel()->SetReadOnly( sal_False );
}
if ( eNewMode == DLGED_TEST )
@@ -699,8 +695,10 @@ void DlgEditor::SetInsertObj( sal_uInt16 eObj )
{
eActObj = eObj;
- if( pDlgEdView )
- pDlgEdView->SetCurrentObj( eActObj, DlgInventor );
+ if(GetView())
+ {
+ GetView()->setSdrObjectCreationInfo(SdrObjectCreationInfo(eActObj, DlgInventor));
+ }
}
//----------------------------------------------------------------------------
@@ -715,24 +713,25 @@ sal_uInt16 DlgEditor::GetInsertObj() const
void DlgEditor::CreateDefaultObject()
{
// create object by factory
- SdrObject* pObj = SdrObjFactory::MakeNewObject( pDlgEdView->GetCurrentObjInventor(), pDlgEdView->GetCurrentObjIdentifier(), pDlgEdPage );
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ GetView()->getSdrModelFromSdrView(),
+ GetView()->getSdrObjectCreationInfo());
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >( pObj );
- DlgEdObj* pDlgEdObj = PTR_CAST( DlgEdObj, pObj );
if ( pDlgEdObj )
{
// set position and size
Size aSize = pWindow->PixelToLogic( Size( 96, 24 ) );
- Point aPoint = (pDlgEdForm->GetSnapRect()).Center();
+ Point aPoint = (sdr::legacy::GetSnapRect(*pDlgEdForm)).Center();
aPoint.X() -= aSize.Width() / 2;
aPoint.Y() -= aSize.Height() / 2;
- pDlgEdObj->SetSnapRect( Rectangle( aPoint, aSize ) );
+ sdr::legacy::SetSnapRect(*pDlgEdObj, Rectangle( aPoint, aSize ) );
// set default property values
pDlgEdObj->SetDefaults();
// insert object into drawing page
- SdrPageView* pPageView = pDlgEdView->GetSdrPageView();
- pDlgEdView->InsertObjectAtView( pDlgEdObj, *pPageView);
+ GetView()->InsertObjectAtView( *pDlgEdObj );
// start listening
pDlgEdObj->StartListening();
@@ -768,11 +767,11 @@ void implCopyStreamToByteSequence( Reference< XInputStream > xStream,
void DlgEditor::Copy()
{
- if( !pDlgEdView->AreObjectsMarked() )
+ if( !GetView()->areSdrObjectsSelected() )
return;
// stop all drawing actions
- pDlgEdView->BrkAction();
+ GetView()->BrkAction();
// create an empty clipboard dialog model
Reference< util::XCloneable > xClone( m_xUnoControlDialogModel, UNO_QUERY );
@@ -793,13 +792,13 @@ void DlgEditor::Copy()
}
// insert control models of marked objects into clipboard dialog model
- sal_uLong nMark = pDlgEdView->GetMarkedObjectList().GetMarkCount();
- for( sal_uLong i = 0; i < nMark; i++ )
+ const SdrObjectVector aSelection(GetView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrObject* pObj = pDlgEdView->GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj();
- DlgEdObj* pDlgEdObj = PTR_CAST(DlgEdObj, pObj);
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >(aSelection[a]);
- if (pDlgEdObj && !pDlgEdObj->ISA(DlgEdForm) )
+ if (pDlgEdObj && !dynamic_cast< DlgEdForm* >(pDlgEdObj) )
{
::rtl::OUString aName;
Reference< beans::XPropertySet > xMarkPSet(pDlgEdObj->GetUnoControlModel(), uno::UNO_QUERY);
@@ -926,10 +925,10 @@ void DlgEditor::Copy()
void DlgEditor::Paste()
{
// stop all drawing actions
- pDlgEdView->BrkAction();
+ GetView()->BrkAction();
// unmark all objects
- pDlgEdView->UnmarkAll();
+ GetView()->UnmarkAll();
// get clipboard
Reference< datatransfer::clipboard::XClipboard > xClipboard = GetWindow()->GetClipboard();
@@ -1040,7 +1039,7 @@ void DlgEditor::Paste()
Reference< util::XCloneable > xClone( xCM, uno::UNO_QUERY );
Reference< awt::XControlModel > xCtrlModel( xClone->createClone(), uno::UNO_QUERY );
- DlgEdObj* pCtrlObj = new DlgEdObj();
+ DlgEdObj* pCtrlObj = new DlgEdObj(*GetModel());
pCtrlObj->SetDlgEdForm(pDlgEdForm); // set parent form
pDlgEdForm->AddChild(pCtrlObj); // add child to parent form
pCtrlObj->SetUnoControlModel( xCtrlModel ); // set control model
@@ -1083,24 +1082,23 @@ void DlgEditor::Paste()
m_xUnoControlDialogModel->insertByName( aOUniqueName , aCtrlModel );
// insert object into drawing page
- pDlgEdModel->GetPage(0)->InsertObject( pCtrlObj );
+ GetModel()->GetPage(0)->InsertObjectToSdrObjList(*pCtrlObj);
pCtrlObj->SetRectFromProps();
pCtrlObj->UpdateStep();
pDlgEdForm->UpdateTabOrderAndGroups(); // #110559#
pCtrlObj->StartListening(); // start listening
// mark object
- SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
- pDlgEdView->MarkObj( pCtrlObj, pPgView, sal_False, sal_True);
+ GetView()->MarkObj( *pCtrlObj, false );
}
// center marked objects in dialog editor form
- Point aMarkCenter = (pDlgEdView->GetMarkedObjRect()).Center();
- Point aFormCenter = (pDlgEdForm->GetSnapRect()).Center();
- Point aPoint = aFormCenter - aMarkCenter;
- Size aSize( aPoint.X() , aPoint.Y() );
- pDlgEdView->MoveMarkedObj( aSize ); // update of control model properties (position + size) in NbcMove
- pDlgEdView->MarkListHasChanged();
+ const basegfx::B2DPoint aMarkCenter(GetView()->getMarkedObjectSnapRange().getCenter());
+ const basegfx::B2DPoint aFormCenter(pDlgEdForm->getObjectRange(GetView()).getCenter());
+ const basegfx::B2DVector aTranslate(aFormCenter - aMarkCenter);
+
+ // update of control model properties (position + size) in NbcMove
+ GetView()->MoveMarkedObj(aTranslate);
// dialog model changed
SetDialogModelChanged(sal_True);
@@ -1114,18 +1112,19 @@ void DlgEditor::Paste()
void DlgEditor::Delete()
{
- if( !pDlgEdView->AreObjectsMarked() )
+ const SdrObjectVector aSelection(GetView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(!aSelection.size())
+ {
return;
+ }
// remove control models of marked objects from dialog model
- sal_uLong nMark = pDlgEdView->GetMarkedObjectList().GetMarkCount();
-
- for( sal_uLong i = 0; i < nMark; i++ )
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrObject* pObj = pDlgEdView->GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj();
- DlgEdObj* pDlgEdObj = PTR_CAST(DlgEdObj, pObj);
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >(aSelection[a]);
- if ( pDlgEdObj && !pDlgEdObj->ISA(DlgEdForm) )
+ if ( pDlgEdObj && !dynamic_cast< DlgEdForm* >(pDlgEdObj) )
{
// get name from property
::rtl::OUString aName;
@@ -1159,10 +1158,10 @@ void DlgEditor::Delete()
// update tab indices
pDlgEdForm->UpdateTabIndices();
- pDlgEdView->BrkAction();
+ GetView()->BrkAction();
sal_Bool bDlgMarked = UnmarkDialog();
- pDlgEdView->DeleteMarked();
+ GetView()->DeleteMarked();
if( bDlgMarked )
RemarkDialog();
}
@@ -1214,14 +1213,14 @@ void DlgEditor::UpdatePropertyBrowserDelayed()
sal_Bool DlgEditor::IsModified() const
{
- return pDlgEdModel->IsChanged() || bDialogModelChanged;
+ return GetModel()->IsChanged() || bDialogModelChanged;
}
//----------------------------------------------------------------------------
void DlgEditor::ClearModifyFlag()
{
- pDlgEdModel->SetChanged( sal_False );
+ GetModel()->SetChanged( sal_False );
bDialogModelChanged = sal_False;
}
@@ -1291,7 +1290,7 @@ void DlgEditor::printPage( sal_Int32 nPage, Printer* pPrinter, const String& rTi
void DlgEditor::Print( Printer* pPrinter, const String& rTitle ) // not working yet
{
- if( pDlgEdView )
+ if( GetView() )
{
MapMode aOldMap( pPrinter->GetMapMode());
Font aOldFont( pPrinter->GetFont() );
@@ -1397,16 +1396,17 @@ bool DlgEditor::AdjustPageSize()
if ( nNewPageHeight < nPageHeightMin )
nNewPageHeight = nPageHeightMin;
- if ( pDlgEdPage )
+ if ( GetPage() )
{
- Size aPageSize = pDlgEdPage->GetSize();
- if ( nNewPageWidth != aPageSize.Width() || nNewPageHeight != aPageSize.Height() )
+ const basegfx::B2DVector& rPageSize = GetPage()->GetPageScale();
+ const basegfx::B2DVector aNewPageSize( nNewPageWidth, nNewPageHeight );
+
+ if(!rPageSize.equal(aNewPageSize))
{
- Size aNewPageSize( nNewPageWidth, nNewPageHeight );
- pDlgEdPage->SetSize( aNewPageSize );
- DBG_ASSERT( pDlgEdView, "DlgEditor::AdjustPageSize: no view!" );
- if ( pDlgEdView )
- pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), aNewPageSize ) );
+ GetPage()->SetPageScale( aNewPageSize );
+ DBG_ASSERT( GetView(), "DlgEditor::AdjustPageSize: no view!" );
+ if ( GetView() )
+ GetView()->SetWorkArea( basegfx::B2DRange( basegfx::B2DPoint( 0.0, 0.0 ), GetPage()->GetPageScale() ) );
bAdjustedPageSize = true;
}
}
diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx
index 82721ca3365d..bfcc682293ef 100644
--- a/basctl/source/dlged/dlgedfac.cxx
+++ b/basctl/source/dlged/dlgedfac.cxx
@@ -24,7 +24,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basctl.hxx"
-
#include "dlgedfac.hxx"
#include "dlgedobj.hxx"
#include <dlgeddef.hxx>
@@ -32,6 +31,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
+#include <svx/sdrobjectfactory.hxx>
using namespace ::com::sun::star;
@@ -68,63 +68,118 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
bNeedsInit = sal_False;
}
- if( (pObjFactory->nInventor == DlgInventor) &&
- (pObjFactory->nIdentifier >= OBJ_DLG_PUSHBUTTON) &&
- (pObjFactory->nIdentifier <= OBJ_DLG_TREECONTROL) )
+ if( (DlgInventor == pObjFactory->getSdrObjectCreationInfo().getInvent()) &&
+ (pObjFactory->getSdrObjectCreationInfo().getIdent() >= OBJ_DLG_PUSHBUTTON) &&
+ (pObjFactory->getSdrObjectCreationInfo().getIdent() <= OBJ_DLG_TREECONTROL) )
{
- switch( pObjFactory->nIdentifier )
+ switch(pObjFactory->getSdrObjectCreationInfo().getIdent())
{
case OBJ_DLG_PUSHBUTTON:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlButtonModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlButtonModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_RADIOBUTTON:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlRadioButtonModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlRadioButtonModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_CHECKBOX:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlCheckBoxModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlCheckBoxModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_LISTBOX:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlListBoxModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlListBoxModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_COMBOBOX:
{
- DlgEdObj* pNew = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlComboBoxModel") , xDialogSFact );
- pObjFactory->pNewObj = pNew;
- try
- {
+ DlgEdObj* pNew = new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlComboBoxModel") , xDialogSFact );
+ pObjFactory->setNewSdrObject(pNew);
+ try
+ {
uno::Reference< beans::XPropertySet > xPSet(pNew->GetUnoControlModel(), uno::UNO_QUERY);
if (xPSet.is())
{
sal_Bool bB = sal_True;
xPSet->setPropertyValue( DLGED_PROP_DROPDOWN, uno::Any(&bB,::getBooleanCppuType()));
}
- }
- catch(...)
- {
- }
- } break;
+ }
+ catch(...)
+ {
+ }
+ break;
+ }
case OBJ_DLG_GROUPBOX:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlGroupBoxModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlGroupBoxModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_EDIT:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlEditModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlEditModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_FIXEDTEXT:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedTextModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedTextModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_IMAGECONTROL:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlImageControlModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlImageControlModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_PROGRESSBAR:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlProgressBarModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlProgressBarModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_HSCROLLBAR:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlScrollBarModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlScrollBarModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_VSCROLLBAR:
{
- DlgEdObj* pNew = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlScrollBarModel") , xDialogSFact );
- pObjFactory->pNewObj = pNew;
+ DlgEdObj* pNew = new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlScrollBarModel") , xDialogSFact );
+ pObjFactory->setNewSdrObject(pNew);
// set vertical orientation
try
{
@@ -139,14 +194,22 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
catch(...)
{
}
- } break;
+ break;
+ }
case OBJ_DLG_HFIXEDLINE:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedLineModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedLineModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_VFIXEDLINE:
{
- DlgEdObj* pNew = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedLineModel") , xDialogSFact );
- pObjFactory->pNewObj = pNew;
+ DlgEdObj* pNew = new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedLineModel") , xDialogSFact );
+ pObjFactory->setNewSdrObject(pNew);
// set vertical orientation
try
{
@@ -161,31 +224,70 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
catch(...)
{
}
- } break;
+ break;
+ }
case OBJ_DLG_DATEFIELD:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlDateFieldModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlDateFieldModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_TIMEFIELD:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlTimeFieldModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlTimeFieldModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_NUMERICFIELD:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlNumericFieldModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlNumericFieldModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_CURRENCYFIELD:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlCurrencyFieldModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlCurrencyFieldModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_FORMATTEDFIELD:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFormattedFieldModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFormattedFieldModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_PATTERNFIELD:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlPatternFieldModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlPatternFieldModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_FILECONTROL:
- pObjFactory->pNewObj = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFileControlModel") , xDialogSFact );
+ {
+ pObjFactory->setNewSdrObject(
+ new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFileControlModel") , xDialogSFact ));
break;
+ }
case OBJ_DLG_TREECONTROL:
- DlgEdObj* pNew = new DlgEdObj( ::rtl::OUString::createFromAscii("com.sun.star.awt.tree.TreeControlModel") , xDialogSFact );
- pObjFactory->pNewObj = pNew;
+ {
+ DlgEdObj* pNew = new DlgEdObj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString::createFromAscii("com.sun.star.awt.tree.TreeControlModel") , xDialogSFact );
+ pObjFactory->setNewSdrObject(pNew);
/*
try
{
@@ -256,6 +358,7 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
break;
}
}
+ }
return 0;
}
diff --git a/basctl/source/dlged/dlgedfunc.cxx b/basctl/source/dlged/dlgedfunc.cxx
index 7027ded96c2a..d308e1a39b01 100644
--- a/basctl/source/dlged/dlgedfunc.cxx
+++ b/basctl/source/dlged/dlgedfunc.cxx
@@ -37,42 +37,39 @@ IMPL_LINK_INLINE_START( DlgEdFunc, ScrollTimeout, Timer *, pTimer )
{
(void)pTimer;
Window* pWindow = pParent->GetWindow();
- Point aPos = pWindow->ScreenToOutputPixel( pWindow->GetPointerPosPixel() );
- aPos = pWindow->PixelToLogic( aPos );
- ForceScroll( aPos );
+ const basegfx::B2DPoint aPixelPos(pWindow->GetPointerPosPixel().X(), pWindow->GetPointerPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+
+ ForceScroll( aLogicPos );
+
return 0;
}
IMPL_LINK_INLINE_END( DlgEdFunc, ScrollTimeout, Timer *, pTimer )
//----------------------------------------------------------------------------
-void DlgEdFunc::ForceScroll( const Point& rPos )
+void DlgEdFunc::ForceScroll( const basegfx::B2DPoint& rPos )
{
aScrollTimer.Stop();
Window* pWindow = pParent->GetWindow();
-
- static Point aDefPoint;
- Rectangle aOutRect( aDefPoint, pWindow->GetOutputSizePixel() );
- aOutRect = pWindow->PixelToLogic( aOutRect );
-
+ const basegfx::B2DRange aOutRangeDiscrete(pWindow->GetDiscreteRange());
+ const basegfx::B2DRange aOutRangeLogic(pWindow->GetLogicRange());
ScrollBar* pHScroll = pParent->GetHScroll();
ScrollBar* pVScroll = pParent->GetVScroll();
long nDeltaX = pHScroll->GetLineSize();
long nDeltaY = pVScroll->GetLineSize();
- if( !aOutRect.IsInside( rPos ) )
+ if( !aOutRangeLogic.isInside( rPos ) )
{
- if( rPos.X() < aOutRect.Left() )
+ if( rPos.getX() < aOutRangeLogic.getMinX() )
nDeltaX = -nDeltaX;
- else
- if( rPos.X() <= aOutRect.Right() )
+ else if( rPos.getX() <= aOutRangeLogic.getMaxX() )
nDeltaX = 0;
- if( rPos.Y() < aOutRect.Top() )
+ if( rPos.getY() < aOutRangeLogic.getMinY() )
nDeltaY = -nDeltaY;
- else
- if( rPos.Y() <= aOutRect.Bottom() )
+ else if( rPos.getY() <= aOutRangeLogic.getMaxY() )
nDeltaY = 0;
if( nDeltaX )
@@ -147,7 +144,7 @@ sal_Bool DlgEdFunc::KeyInput( const KeyEvent& rKEvt )
pView->BrkAction();
bReturn = sal_True;
}
- else if ( pView->AreObjectsMarked() )
+ else if ( pView->areSdrObjectsSelected() )
{
const SdrHdlList& rHdlList = pView->GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
@@ -172,8 +169,8 @@ sal_Bool DlgEdFunc::KeyInput( const KeyEvent& rKEvt )
pView->MarkNextObj( !aCode.IsShift() );
}
- if ( pView->AreObjectsMarked() )
- pView->MakeVisible( pView->GetAllMarkedRect(), *pWindow );
+ if ( pView->areSdrObjectsSelected() )
+ pView->MakeVisibleAtView( pView->getMarkedObjectSnapRange(), *pWindow );
bReturn = sal_True;
}
@@ -187,9 +184,11 @@ sal_Bool DlgEdFunc::KeyInput( const KeyEvent& rKEvt )
SdrHdl* pHdl = rHdlList.GetFocusHdl();
if ( pHdl )
{
- Point aHdlPosition( pHdl->GetPos() );
- Rectangle aVisRect( aHdlPosition - Point( 100, 100 ), Size( 200, 200 ) );
- pView->MakeVisible( aVisRect, *pWindow );
+ const basegfx::B2DRange aRange(
+ pHdl->getPosition() - basegfx::B2DPoint(100.0, 100.0),
+ pHdl->getPosition() + basegfx::B2DPoint(100.0, 100.0));
+
+ pView->MakeVisibleAtView( aRange, *pWindow );
}
bReturn = sal_True;
@@ -201,48 +200,42 @@ sal_Bool DlgEdFunc::KeyInput( const KeyEvent& rKEvt )
case KEY_LEFT:
case KEY_RIGHT:
{
- long nX = 0;
- long nY = 0;
+ basegfx::B2DVector aMove(0.0, 0.0);
if ( nCode == KEY_UP )
{
// scroll up
- nX = 0;
- nY = -1;
+ aMove = basegfx::B2DVector(0.0, -1.0);
}
else if ( nCode == KEY_DOWN )
{
// scroll down
- nX = 0;
- nY = 1;
+ aMove = basegfx::B2DVector(0.0, 1.0);
}
else if ( nCode == KEY_LEFT )
{
// scroll left
- nX = -1;
- nY = 0;
+ aMove = basegfx::B2DVector(-1.0, 0.0);
}
else if ( nCode == KEY_RIGHT )
{
// scroll right
- nX = 1;
- nY = 0;
+ aMove = basegfx::B2DVector(1.0, 0.0);
}
- if ( pView->AreObjectsMarked() && !aCode.IsMod1() )
+ if ( pView->areSdrObjectsSelected() && !aCode.IsMod1() )
{
if ( aCode.IsMod2() )
{
// move in 1 pixel distance
- Size aPixelSize = pWindow ? pWindow->PixelToLogic( Size( 1, 1 ) ) : Size( 100, 100 );
- nX *= aPixelSize.Width();
- nY *= aPixelSize.Height();
+ aMove *= pWindow
+ ? pWindow->GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0)
+ : basegfx::B2DVector(100.0, 100.0);
}
else
{
// move in 1 mm distance
- nX *= 100;
- nY *= 100;
+ aMove *= 100.0;
}
const SdrHdlList& rHdlList = pView->GetHdlList();
@@ -254,88 +247,115 @@ sal_Bool DlgEdFunc::KeyInput( const KeyEvent& rKEvt )
if ( pView->IsMoveAllowed() )
{
// restrict movement to work area
- const Rectangle& rWorkArea = pView->GetWorkArea();
+ const basegfx::B2DRange& rWorkArea = pView->GetWorkArea();
- if ( !rWorkArea.IsEmpty() )
+ if ( !rWorkArea.isEmpty() )
{
- Rectangle aMarkRect( pView->GetMarkedObjRect() );
- aMarkRect.Move( nX, nY );
+ basegfx::B2DRange aMarkRange( pView->getMarkedObjectSnapRange() );
+ aMarkRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aMove));
- if ( !rWorkArea.IsInside( aMarkRect ) )
+ if ( !rWorkArea.isInside( aMarkRange ) )
{
- if ( aMarkRect.Left() < rWorkArea.Left() )
- nX += rWorkArea.Left() - aMarkRect.Left();
-
- if ( aMarkRect.Right() > rWorkArea.Right() )
- nX -= aMarkRect.Right() - rWorkArea.Right();
-
- if ( aMarkRect.Top() < rWorkArea.Top() )
- nY += rWorkArea.Top() - aMarkRect.Top();
-
- if ( aMarkRect.Bottom() > rWorkArea.Bottom() )
- nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
+ if ( aMarkRange.getMinX() < rWorkArea.getMinX() )
+ {
+ aMove.setX(aMove.getX() + rWorkArea.getMinX() - aMarkRange.getMinX());
+ }
+
+ if ( aMarkRange.getMaxX() > rWorkArea.getMaxX() )
+ {
+ aMove.setX(aMove.getX() - aMarkRange.getMaxX() - rWorkArea.getMaxX());
+ }
+
+ if ( aMarkRange.getMinY() < rWorkArea.getMinY() )
+ {
+ aMove.setY(aMove.getY() + rWorkArea.getMinY() - aMarkRange.getMinY());
+ }
+
+ if ( aMarkRange.getMaxY() > rWorkArea.getMaxY() )
+ {
+ aMove.setY(aMove.getY() - aMarkRange.getMaxY() - rWorkArea.getMaxY());
+ }
}
}
- if ( nX != 0 || nY != 0 )
+ if ( !aMove.equalZero() )
{
- pView->MoveAllMarked( Size( nX, nY ) );
- pView->MakeVisible( pView->GetAllMarkedRect(), *pWindow );
+ pView->MoveMarkedObj( aMove );
+ pView->MakeVisibleAtView( pView->getMarkedObjectSnapRange(), *pWindow );
}
}
}
else
{
// move the handle
- if ( pHdl && ( nX || nY ) )
+ if ( pHdl && !aMove.equalZero() )
{
- Point aStartPoint( pHdl->GetPos() );
- Point aEndPoint( pHdl->GetPos() + Point( nX, nY ) );
+ const basegfx::B2DPoint aStartPoint( pHdl->getPosition() );
+ const basegfx::B2DPoint aEndPoint( pHdl->getPosition() + aMove );
const SdrDragStat& rDragStat = pView->GetDragStat();
// start dragging
- pView->BegDragObj( aStartPoint, 0, pHdl, 0 );
+ pView->BegDragObj( aStartPoint, pHdl, 0.0 );
if ( pView->IsDragObj() )
{
- FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
- sal_Bool bWasSnapEnabled = pView->IsSnapEnabled();
+ const bool bWasNoSnap(rDragStat.IsNoSnap());
+ const bool bWasSnapEnabled(pView->IsSnapEnabled());
// switch snapping off
if ( !bWasNoSnap )
- ((SdrDragStat&)rDragStat).SetNoSnap( sal_True );
+ {
+ ((SdrDragStat&)rDragStat).SetNoSnap(true);
+ }
+
if ( bWasSnapEnabled )
- pView->SetSnapEnabled( sal_False );
+ {
+ pView->SetSnapEnabled( false );
+ }
pView->MovAction( aEndPoint );
pView->EndDragObj();
// restore snap
if ( !bWasNoSnap )
+ {
((SdrDragStat&)rDragStat).SetNoSnap( bWasNoSnap );
+ }
+
if ( bWasSnapEnabled )
+ {
pView->SetSnapEnabled( bWasSnapEnabled );
+ }
}
// make moved handle visible
- Rectangle aVisRect( aEndPoint - Point( 100, 100 ), Size( 200, 200 ) );
- pView->MakeVisible( aVisRect, *pWindow );
+ const basegfx::B2DRange aVisRange(
+ aEndPoint - basegfx::B2DPoint(100.0, 100.0),
+ aEndPoint + basegfx::B2DPoint(100.0, 100.0));
+
+ pView->MakeVisibleAtView( aVisRange, *pWindow );
}
}
}
else
{
// scroll page
- ScrollBar* pScrollBar = ( nX != 0 ) ? pParent->GetHScroll() : pParent->GetVScroll();
+ const bool bHorUsed(!basegfx::fTools::equalZero(aMove.getY()));
+ ScrollBar* pScrollBar = bHorUsed ? pParent->GetHScroll() : pParent->GetVScroll();
+
if ( pScrollBar )
{
long nRangeMin = pScrollBar->GetRangeMin();
long nRangeMax = pScrollBar->GetRangeMax();
- long nThumbPos = pScrollBar->GetThumbPos() + ( ( nX != 0 ) ? nX : nY ) * pScrollBar->GetLineSize();
+ long nThumbPos = pScrollBar->GetThumbPos() +
+ basegfx::fround( bHorUsed ? aMove.getX() : aMove.getY() ) *
+ pScrollBar->GetLineSize();
+
if ( nThumbPos < nRangeMin )
nThumbPos = nRangeMin;
if ( nThumbPos > nRangeMax )
nThumbPos = nRangeMax;
+
pScrollBar->SetThumbPos( nThumbPos );
pParent->DoScroll( pScrollBar );
}
@@ -361,14 +381,14 @@ sal_Bool DlgEdFunc::KeyInput( const KeyEvent& rKEvt )
DlgEdFuncInsert::DlgEdFuncInsert( DlgEditor* pParent_ ) :
DlgEdFunc( pParent_ )
{
- pParent_->GetView()->SetCreateMode( sal_True );
+ pParent_->GetView()->SetViewEditMode(SDREDITMODE_CREATE);
}
//----------------------------------------------------------------------------
DlgEdFuncInsert::~DlgEdFuncInsert()
{
- pParent->GetView()->SetEditMode( sal_True );
+ pParent->GetView()->SetViewEditMode(SDREDITMODE_EDIT);
}
//----------------------------------------------------------------------------
@@ -380,32 +400,33 @@ sal_Bool DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt )
SdrView* pView = pParent->GetView();
Window* pWindow= pParent->GetWindow();
- pView->SetActualWin( pWindow );
+ pView->SetActualOutDev( pWindow );
- Point aPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
- sal_uInt16 nHitLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
- sal_uInt16 nDrgLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+ const double fTolerance(basegfx::B2DVector(pWindow->GetInverseViewTransformation() *
+ basegfx::B2DVector(3.0, 0.0)).getLength());
pWindow->CaptureMouse();
if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 )
{
- SdrHdl* pHdl = pView->PickHandle(aPos);
+ SdrHdl* pHdl = pView->PickHandle(aLogicPos);
// if selected object was hit, drag object
- if ( pHdl!=NULL || pView->IsMarkedHit(aPos, nHitLog) )
- pView->BegDragObj(aPos, (OutputDevice*) NULL, pHdl, nDrgLog);
- else if ( pView->AreObjectsMarked() )
+ if ( pHdl!=NULL || pView->IsMarkedObjHit(aLogicPos, fTolerance) )
+ pView->BegDragObj(aLogicPos, pHdl, fTolerance);
+ else if ( pView->areSdrObjectsSelected() )
pView->UnmarkAll();
// if no action, create object
if ( !pView->IsAction() )
- pView->BegCreateObj(aPos);
+ pView->BegCreateObj(aLogicPos);
}
else if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 2 )
{
// if object was hit, show property browser
- if ( pView->IsMarkedHit(aPos, nHitLog) && pParent->GetMode() != DLGED_READONLY )
+ if ( pView->IsMarkedObjHit(aLogicPos, fTolerance) && pParent->GetMode() != DLGED_READONLY )
pParent->ShowProperties();
}
@@ -420,23 +441,26 @@ sal_Bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
SdrView* pView = pParent->GetView();
Window* pWindow= pParent->GetWindow();
- pView->SetActualWin( pWindow );
+ pView->SetActualOutDev( pWindow );
pWindow->ReleaseMouse();
// object creation active?
- if ( pView->IsCreateObj() )
+ if ( pView->GetCreateObj() )
{
pView->EndCreateObj(SDRCREATE_FORCEEND);
- if ( !pView->AreObjectsMarked() )
+ if ( !pView->areSdrObjectsSelected() )
{
- sal_uInt16 nHitLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
- Point aPos( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
- pView->MarkObj(aPos, nHitLog);
+ const double fTolerance(basegfx::B2DVector(pWindow->GetInverseViewTransformation() *
+ basegfx::B2DVector(3.0, 0.0)).getLength());
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+
+ pView->MarkObj(aLogicPos, fTolerance);
}
- if( pView->AreObjectsMarked() )
+ if( pView->areSdrObjectsSelected() )
return sal_True;
else
return sal_False;
@@ -455,18 +479,18 @@ sal_Bool DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt )
{
SdrView* pView = pParent->GetView();
Window* pWindow= pParent->GetWindow();
- pView->SetActualWin( pWindow );
+ pView->SetActualOutDev( pWindow );
- Point aPos( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
- sal_uInt16 nHitLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
if ( pView->IsAction() )
{
- ForceScroll(aPos);
- pView->MovAction(aPos);
+ ForceScroll(aLogicPos);
+ pView->MovAction(aLogicPos);
}
- pWindow->SetPointer( pView->GetPreferedPointer( aPos, pWindow, nHitLog ) );
+ pWindow->SetPointer(pView->GetPreferedPointer(aLogicPos, pWindow, rMEvt.GetModifier()));
return sal_True;
}
@@ -492,22 +516,22 @@ sal_Bool DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt )
// get view from parent
SdrView* pView = pParent->GetView();
Window* pWindow = pParent->GetWindow();
- pView->SetActualWin( pWindow );
+ pView->SetActualOutDev( pWindow );
- sal_uInt16 nDrgLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
- sal_uInt16 nHitLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
- Point aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+ const double fTolerance(basegfx::B2DVector(pWindow->GetInverseViewTransformation() *
+ basegfx::B2DVector(3.0, 0.0)).getLength());
if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 )
{
- SdrHdl* pHdl = pView->PickHandle(aMDPos);
+ SdrHdl* pHdl = pView->PickHandle(aLogicPos);
SdrObject* pObj;
- SdrPageView* pPV;
// hit selected object?
- if ( pHdl!=NULL || pView->IsMarkedHit(aMDPos, nHitLog) )
+ if ( pHdl!=NULL || pView->IsMarkedObjHit(aLogicPos, fTolerance) )
{
- pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+ pView->BegDragObj(aLogicPos, pHdl, fTolerance);
}
else
{
@@ -516,25 +540,25 @@ sal_Bool DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt )
pView->UnmarkAll();
else
{
- if( pView->PickObj( aMDPos, nHitLog, pObj, pPV ) )
+ if( pView->PickObj( aLogicPos, fTolerance, pObj ) )
{
- //if( pObj->ISA( DlgEdForm ) )
+ //if( dynamic_cast< DlgEdForm* >(pObj) )
// pView->UnmarkAll();
//else
// pParent->UnmarkDialog();
}
}
- if ( pView->MarkObj(aMDPos, nHitLog) )
+ if ( pView->MarkObj(aLogicPos, fTolerance) )
{
// drag object
- pHdl=pView->PickHandle(aMDPos);
- pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+ pHdl=pView->PickHandle(aLogicPos);
+ pView->BegDragObj(aLogicPos, pHdl, fTolerance);
}
else
{
// select object
- pView->BegMarkObj(aMDPos);
+ pView->BegMarkObj(aLogicPos);
bMarkAction = sal_True;
}
}
@@ -542,7 +566,7 @@ sal_Bool DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt )
else if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 2 )
{
// if object was hit, show property browser
- if ( pView->IsMarkedHit(aMDPos, nHitLog) && pParent->GetMode() != DLGED_READONLY )
+ if ( pView->IsMarkedObjHit(aLogicPos, fTolerance) && pParent->GetMode() != DLGED_READONLY )
pParent->ShowProperties();
}
@@ -558,10 +582,10 @@ sal_Bool DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt )
// get view from parent
SdrView* pView = pParent->GetView();
Window* pWindow= pParent->GetWindow();
- pView->SetActualWin( pWindow );
+ pView->SetActualOutDev( pWindow );
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
- sal_uInt16 nHitLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
if ( rMEvt.IsLeft() )
{
@@ -569,10 +593,8 @@ sal_Bool DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt )
{
// object was dragged
pView->EndDragObj( rMEvt.IsMod1() );
- pView->ForceMarkedToAnotherPage();
}
- else
- if (pView->IsAction() )
+ else if (pView->IsAction() )
{
pView->EndAction();
//if( bMarkAction )
@@ -580,26 +602,8 @@ sal_Bool DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt )
}
}
-// sal_uInt16 nClicks = rMEvt.GetClicks();
-// if (nClicks == 2)
-// {
-// if ( pView->AreObjectsMarked() )
-// {
-// const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
-//
-// if (rMarkList.GetMarkCount() == 1)
-// {
-// SdrMark* pMark = rMarkList.GetMark(0);
-// SdrObject* pObj = pMark->GetMarkedSdrObj();
-//
-// // edit objects here
-// }
-// }
-// }
-
bMarkAction = sal_False;
-
- pWindow->SetPointer( pView->GetPreferedPointer( aPnt, pWindow, nHitLog ) );
+ pWindow->SetPointer(pView->GetPreferedPointer(aLogicPos, pWindow, rMEvt.GetModifier()));
pWindow->ReleaseMouse();
return sal_True;
@@ -611,21 +615,18 @@ sal_Bool DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt )
{
SdrView* pView = pParent->GetView();
Window* pWindow= pParent->GetWindow();
- pView->SetActualWin( pWindow );
+ pView->SetActualOutDev( pWindow );
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
- sal_uInt16 nHitLog = sal_uInt16 ( pWindow->PixelToLogic(Size(3,0)).Width() );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
if ( pView->IsAction() )
{
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt_(pWindow->PixelToLogic(aPix));
-
- ForceScroll(aPnt_);
- pView->MovAction(aPnt_);
+ ForceScroll(aLogicPos);
+ pView->MovAction(aLogicPos);
}
- pWindow->SetPointer( pView->GetPreferedPointer( aPnt, pWindow, nHitLog ) );
+ pWindow->SetPointer(pView->GetPreferedPointer(aLogicPos, pWindow, rMEvt.GetModifier()));
return sal_True;
}
diff --git a/basctl/source/dlged/dlgedmod.cxx b/basctl/source/dlged/dlgedmod.cxx
index 15f3aa2ea66c..5633642b85a2 100644
--- a/basctl/source/dlged/dlgedmod.cxx
+++ b/basctl/source/dlged/dlgedmod.cxx
@@ -32,12 +32,10 @@
DBG_NAME(DlgEdModel)
-TYPEINIT1(DlgEdModel,SdrModel);
-
//----------------------------------------------------------------------------
DlgEdModel::DlgEdModel()
- :SdrModel(NULL, NULL)
+: SdrModel()
{
DBG_CTOR(DlgEdModel,0);
}
@@ -51,7 +49,7 @@ DlgEdModel::~DlgEdModel()
//----------------------------------------------------------------------------
-SdrPage* DlgEdModel::AllocPage(FASTBOOL bMasterPage)
+SdrPage* DlgEdModel::AllocPage(bool bMasterPage)
{
DBG_CHKTHIS(DlgEdModel, 0);
return new DlgEdPage(*this, bMasterPage);
@@ -59,7 +57,7 @@ SdrPage* DlgEdModel::AllocPage(FASTBOOL bMasterPage)
//----------------------------------------------------------------------------
-void DlgEdModel::DlgEdModelChanged( FASTBOOL bChanged )
+void DlgEdModel::DlgEdModelChanged( bool bChanged )
{
SetChanged( static_cast< sal_Bool > ( bChanged ) );
}
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index e5e6246691ff..c9460b8ed3cc 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -54,6 +54,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
#include <algorithm>
#include <functional>
@@ -65,14 +66,12 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::script;
using ::rtl::OUString;
-
-TYPEINIT1(DlgEdObj, SdrUnoObj);
DBG_NAME(DlgEdObj);
//----------------------------------------------------------------------------
-DlgEdObj::DlgEdObj()
- :SdrUnoObj(String(), sal_False)
+DlgEdObj::DlgEdObj(SdrModel& rSdrModel)
+: SdrUnoObj(rSdrModel, String(), sal_False)
,bIsListening(sal_False)
,pDlgEdForm( NULL )
{
@@ -81,9 +80,11 @@ DlgEdObj::DlgEdObj()
//----------------------------------------------------------------------------
-DlgEdObj::DlgEdObj(const ::rtl::OUString& rModelName,
+DlgEdObj::DlgEdObj(
+ SdrModel& rSdrModel,
+ const ::rtl::OUString& rModelName,
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac)
- :SdrUnoObj(rModelName, rxSFac, sal_False)
+: SdrUnoObj(rSdrModel, rModelName, rxSFac, sal_False)
,bIsListening(sal_False)
,pDlgEdForm( NULL )
{
@@ -100,16 +101,47 @@ DlgEdObj::~DlgEdObj()
EndListening();
}
-//----------------------------------------------------------------------------
+void DlgEdObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const DlgEdObj* pSource = dynamic_cast< const DlgEdObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrUnoObj::copyDataFromSdrObject(rSource);
-void DlgEdObj::SetPage(SdrPage* _pNewPage)
+ // no own local data to copy (? had no own operator= at least)
+ clonedFrom(pSource);
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* DlgEdObj::CloneSdrObject(SdrModel* pTargetModel) const
{
- // now set the page
- SdrUnoObj::SetPage(_pNewPage);
+ DlgEdObj* pClone = new DlgEdObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
//----------------------------------------------------------------------------
+//void DlgEdObj::SetPage(SdrPage* _pNewPage)
+//{
+// // now set the page
+// SdrUnoObj::SetPage(_pNewPage);
+//}
+
+//----------------------------------------------------------------------------
+
namespace
{
/** returns the DlgEdForm which the given DlgEdObj belongs to
@@ -159,7 +191,7 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
DlgEdForm* pForm = NULL;
if ( !lcl_getDlgEdForm( this, pForm ) )
return false;
- Rectangle aFormRect = pForm->GetSnapRect();
+ const Rectangle aFormRect(sdr::legacy::GetSnapRect(*pForm));
Size aFormPos( aFormRect.Left(), aFormRect.Top() );
// convert 100th_mm to pixel
@@ -385,7 +417,7 @@ void DlgEdObj::SetRectFromProps()
// set rectangle position and size
Point aPoint( nXOut, nYOut );
Size aSize( nWidthOut, nHeightOut );
- SetSnapRect( Rectangle( aPoint, aSize ) );
+ sdr::legacy::SetSnapRect(*this, Rectangle( aPoint, aSize ) );
}
}
}
@@ -395,7 +427,7 @@ void DlgEdObj::SetRectFromProps()
void DlgEdObj::SetPropsFromRect()
{
// get control position and size from rectangle
- Rectangle aRect_ = GetSnapRect();
+ const Rectangle aRect_(sdr::legacy::GetSnapRect(*this));
sal_Int32 nXIn = aRect_.Left();
sal_Int32 nYIn = aRect_.Top();
sal_Int32 nWidthIn = aRect_.GetWidth();
@@ -438,9 +470,8 @@ void DlgEdObj::PositionAndSizeChange( const beans::PropertyChangeEvent& evt )
{
sal_Int32 nPageXIn = 0;
sal_Int32 nPageYIn = 0;
- Size aPageSize = pPage_->GetSize();
- sal_Int32 nPageWidthIn = aPageSize.Width();
- sal_Int32 nPageHeightIn = aPageSize.Height();
+ sal_Int32 nPageWidthIn = basegfx::fround(pPage_->GetPageScale().getX());
+ sal_Int32 nPageHeightIn = basegfx::fround(pPage_->GetPageScale().getY());
sal_Int32 nPageX, nPageY, nPageWidth, nPageHeight;
if ( TransformSdrToControlCoordinates( nPageXIn, nPageYIn, nPageWidthIn, nPageHeightIn, nPageX, nPageY, nPageWidth, nPageHeight ) )
{
@@ -531,7 +562,7 @@ void SAL_CALL DlgEdObj::NameChange( const ::com::sun::star::beans::PropertyChan
xCont->insertByName( aNewName , aAny );
DlgEditor* pEditor;
- if ( ISA(DlgEdForm) )
+ if ( dynamic_cast< DlgEdForm* >(this) )
pEditor = ((DlgEdForm*)this)->GetDlgEditor();
else
pEditor = GetDlgEdForm()->GetDlgEditor();
@@ -570,10 +601,9 @@ sal_Int32 DlgEdObj::GetStep() const
void DlgEdObj::UpdateStep()
{
- sal_Int32 nCurStep = GetDlgEdForm()->GetStep();
- sal_Int32 nStep = GetStep();
-
- SdrLayerAdmin& rLayerAdmin = GetModel()->GetLayerAdmin();
+ const sal_Int32 nCurStep(GetDlgEdForm()->GetStep());
+ const sal_Int32 nStep(GetStep());
+ SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrObject().GetModelLayerAdmin();
SdrLayerID nHiddenLayerId = rLayerAdmin.GetLayerID( String( RTL_CONSTASCII_USTRINGPARAM( "HiddenLayer" ) ), sal_False );
SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), sal_False );
@@ -677,7 +707,16 @@ void DlgEdObj::TabIndexChange( const beans::PropertyChangeEvent& evt ) throw (Ru
}
// reorder objects in drawing page
- GetModel()->GetPage(0)->SetObjectOrdNum( nOldTabIndex + 1, nNewTabIndex + 1 );
+ SdrPage* pOwningPage = getSdrModelFromSdrObject().GetPage(0);
+
+ if(pOwningPage)
+ {
+ pOwningPage->SetNavigationPosition( nOldTabIndex + 1, nNewTabIndex + 1 );
+ }
+ else
+ {
+ OSL_ENSURE(pOwningPage, "DlgEdObj::TabIndexChange got no SdrPage (!)");
+ }
// #110559#
pForm->UpdateTabOrderAndGroups();
@@ -976,61 +1015,18 @@ void DlgEdObj::clonedFrom(const DlgEdObj* _pSource)
//----------------------------------------------------------------------------
-SdrObject* DlgEdObj::Clone() const
-{
- SdrObject* pReturn = SdrUnoObj::Clone();
-
- DlgEdObj* pDlgEdObj = PTR_CAST(DlgEdObj, pReturn);
- DBG_ASSERT( pDlgEdObj != NULL, "DlgEdObj::Clone: invalid clone!" );
- if ( pDlgEdObj )
- pDlgEdObj->clonedFrom( this );
-
- return pReturn;
-}
-
-//----------------------------------------------------------------------------
-
SdrObject* DlgEdObj::getFullDragClone() const
{
// no need to really add the clone for dragging, it's a temporary
- // object
- SdrObject* pObj = new SdrUnoObj(String());
- *pObj = *((const SdrUnoObj*)this);
-
- return pObj;
-}
-
-//----------------------------------------------------------------------------
-
-void DlgEdObj::operator= (const SdrObject& rObj)
-{
- SdrUnoObj::operator= (rObj);
-}
-
-//----------------------------------------------------------------------------
-
-void DlgEdObj::NbcMove( const Size& rSize )
-{
- SdrUnoObj::NbcMove( rSize );
-
- // stop listening
- EndListening(sal_False);
-
- // set geometry properties
- SetPropsFromRect();
-
- // start listening
- StartListening();
-
- // dialog model changed
- GetDlgEdForm()->GetDlgEditor()->SetDialogModelChanged(sal_True);
+ // object. Force to SdrUnoObj by using the correct method call
+ return SdrUnoObj::CloneSdrObject();
}
//----------------------------------------------------------------------------
-void DlgEdObj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+void DlgEdObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- SdrUnoObj::NbcResize( rRef, xFract, yFract );
+ SdrUnoObj::setSdrObjectTransformation(rTransformation);
// stop listening
EndListening(sal_False);
@@ -1047,9 +1043,9 @@ void DlgEdObj::NbcResize(const Point& rRef, const Fraction& xFract, const Fracti
//----------------------------------------------------------------------------
-FASTBOOL DlgEdObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool DlgEdObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- FASTBOOL bResult = SdrUnoObj::EndCreate(rStat, eCmd);
+ bool bResult(SdrUnoObj::EndCreate(rStat, eCmd));
SetDefaults();
StartListening();
@@ -1062,7 +1058,8 @@ FASTBOOL DlgEdObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
void DlgEdObj::SetDefaults()
{
// set parent form
- pDlgEdForm = ((DlgEdPage*)GetPage())->GetDlgEdForm();
+ DlgEdPage* pOwningPage = dynamic_cast< DlgEdPage* >(getSdrPageFromSdrObject());
+ pDlgEdForm = pOwningPage ? pOwningPage->GetDlgEdForm() : 0;
if ( pDlgEdForm )
{
@@ -1129,7 +1126,7 @@ void DlgEdObj::SetDefaults()
xCont->insertByName( aOUniqueName , aAny );
DlgEditor* pEditor;
- if ( ISA(DlgEdForm) )
+ if ( dynamic_cast< DlgEdForm* >(this) )
pEditor = ((DlgEdForm*)this)->GetDlgEditor();
else
pEditor = GetDlgEdForm()->GetDlgEditor();
@@ -1259,7 +1256,7 @@ void SAL_CALL DlgEdObj::_propertyChange( const ::com::sun::star::beans::Propert
if ( evt.PropertyName == DLGED_PROP_DECORATION )
{
- if ( ISA(DlgEdForm) )
+ if ( dynamic_cast< DlgEdForm* >(this) )
((DlgEdForm*)this)->GetDlgEditor()->ResetDialog();
else
GetDlgEdForm()->GetDlgEditor()->ResetDialog();
@@ -1268,7 +1265,7 @@ void SAL_CALL DlgEdObj::_propertyChange( const ::com::sun::star::beans::Propert
// change name of control in dialog model
else if ( evt.PropertyName == DLGED_PROP_NAME )
{
- if ( !ISA(DlgEdForm) )
+ if ( !dynamic_cast< DlgEdForm* >(this) )
{
NameChange(evt);
}
@@ -1281,7 +1278,7 @@ void SAL_CALL DlgEdObj::_propertyChange( const ::com::sun::star::beans::Propert
// change tabindex
else if ( evt.PropertyName == DLGED_PROP_TABINDEX )
{
- if ( !ISA(DlgEdForm) )
+ if ( !dynamic_cast< DlgEdForm* >(this) )
{
TabIndexChange(evt);
}
@@ -1296,7 +1293,7 @@ void SAL_CALL DlgEdObj::_elementInserted(const ::com::sun::star::container::Cont
if (isListening())
{
// dialog model changed
- if ( ISA(DlgEdForm) )
+ if ( dynamic_cast< DlgEdForm* >(this) )
{
((DlgEdForm*)this)->GetDlgEditor()->SetDialogModelChanged(sal_True);
}
@@ -1314,7 +1311,7 @@ void SAL_CALL DlgEdObj::_elementReplaced(const ::com::sun::star::container::Cont
if (isListening())
{
// dialog model changed
- if ( ISA(DlgEdForm) )
+ if ( dynamic_cast< DlgEdForm* >(this) )
{
((DlgEdForm*)this)->GetDlgEditor()->SetDialogModelChanged(sal_True);
}
@@ -1332,7 +1329,7 @@ void SAL_CALL DlgEdObj::_elementRemoved(const ::com::sun::star::container::Conta
if (isListening())
{
// dialog model changed
- if ( ISA(DlgEdForm) )
+ if ( dynamic_cast< DlgEdForm* >(this) )
{
((DlgEdForm*)this)->GetDlgEditor()->SetDialogModelChanged(sal_True);
}
@@ -1360,13 +1357,12 @@ void DlgEdObj::SetLayer(SdrLayerID nLayer)
//----------------------------------------------------------------------------
-TYPEINIT1(DlgEdForm, DlgEdObj);
DBG_NAME(DlgEdForm);
//----------------------------------------------------------------------------
-DlgEdForm::DlgEdForm()
- :DlgEdObj()
+DlgEdForm::DlgEdForm(SdrModel& rSdrModel)
+: DlgEdObj(rSdrModel)
{
DBG_CTOR(DlgEdForm, NULL);
}
@@ -1378,6 +1374,36 @@ DlgEdForm::~DlgEdForm()
DBG_DTOR(DlgEdForm, NULL);
}
+void DlgEdForm::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const DlgEdForm* pSource = dynamic_cast< const DlgEdForm* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ DlgEdObj::copyDataFromSdrObject(rSource);
+
+ // no own local data to copy (? had no own operator= at least)
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* DlgEdForm::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ DlgEdForm* pClone = new DlgEdForm(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
//----------------------------------------------------------------------------
void DlgEdForm::SetDlgEditor( DlgEditor* pEditor )
@@ -1414,7 +1440,7 @@ void DlgEdForm::SetRectFromProps()
// set rectangle position and size
Point aPoint( nXOut, nYOut );
Size aSize( nWidthOut, nHeightOut );
- SetSnapRect( Rectangle( aPoint, aSize ) );
+ sdr::legacy::SetSnapRect(*this, Rectangle( aPoint, aSize ) );
}
}
}
@@ -1424,7 +1450,7 @@ void DlgEdForm::SetRectFromProps()
void DlgEdForm::SetPropsFromRect()
{
// get form position and size from rectangle
- Rectangle aRect_ = GetSnapRect();
+ const Rectangle aRect_(sdr::legacy::GetSnapRect(*this));
sal_Int32 nXIn = aRect_.Left();
sal_Int32 nYIn = aRect_.Top();
sal_Int32 nWidthIn = aRect_.GetWidth();
@@ -1479,9 +1505,8 @@ void DlgEdForm::PositionAndSizeChange( const beans::PropertyChangeEvent& evt )
{
sal_Int32 nPageXIn = 0;
sal_Int32 nPageYIn = 0;
- Size aPageSize = pPage_->GetSize();
- sal_Int32 nPageWidthIn = aPageSize.Width();
- sal_Int32 nPageHeightIn = aPageSize.Height();
+ sal_Int32 nPageWidthIn = basegfx::fround(pPage_->GetPageScale().getX());
+ sal_Int32 nPageHeightIn = basegfx::fround(pPage_->GetPageScale().getY());
sal_Int32 nPageX, nPageY, nPageWidth, nPageHeight;
if ( TransformSdrToFormCoordinates( nPageXIn, nPageYIn, nPageWidthIn, nPageHeightIn, nPageX, nPageY, nPageWidth, nPageHeight ) )
{
@@ -1532,9 +1557,8 @@ void DlgEdForm::PositionAndSizeChange( const beans::PropertyChangeEvent& evt )
if ( bAdjustedPageSize )
{
pEditor->InitScrollBars();
- aPageSize = pPage_->GetSize();
- nPageWidthIn = aPageSize.Width();
- nPageHeightIn = aPageSize.Height();
+ nPageWidthIn = basegfx::fround(pPage_->GetPageScale().getX());
+ nPageHeightIn = basegfx::fround(pPage_->GetPageScale().getY());
if ( TransformSdrToControlCoordinates( nPageXIn, nPageYIn, nPageWidthIn, nPageHeightIn, nPageX, nPageY, nPageWidth, nPageHeight ) )
{
for ( aIter = aChildList.begin(); aIter != aChildList.end(); aIter++ )
@@ -1597,15 +1621,15 @@ void DlgEdForm::PositionAndSizeChange( const beans::PropertyChangeEvent& evt )
void DlgEdForm::UpdateStep()
{
sal_uLong nObjCount;
- SdrPage* pSdrPage = GetPage();
+ SdrPage* pOwningPage = getSdrPageFromSdrObject();
- if ( pSdrPage && ( ( nObjCount = pSdrPage->GetObjCount() ) > 0 ) )
+ if ( pOwningPage && ( ( nObjCount = pOwningPage->GetObjCount() ) > 0 ) )
{
for ( sal_uLong i = 0 ; i < nObjCount ; i++ )
{
- SdrObject* pObj = pSdrPage->GetObj(i);
- DlgEdObj* pDlgEdObj = PTR_CAST(DlgEdObj, pObj);
- if ( pDlgEdObj && !pDlgEdObj->ISA(DlgEdForm) )
+ SdrObject* pObj = pOwningPage->GetObj(i);
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >( pObj);
+ if ( pDlgEdObj && !dynamic_cast< DlgEdForm* >(pDlgEdObj) )
pDlgEdObj->UpdateStep();
}
}
@@ -1775,33 +1799,9 @@ void DlgEdForm::UpdateTabOrderAndGroups()
//----------------------------------------------------------------------------
-void DlgEdForm::NbcMove( const Size& rSize )
-{
- SdrUnoObj::NbcMove( rSize );
-
- // set geometry properties of form
- EndListening(sal_False);
- SetPropsFromRect();
- StartListening();
-
- // set geometry properties of all childs
- ::std::vector<DlgEdObj*>::iterator aIter;
- for ( aIter = pChilds.begin() ; aIter != pChilds.end() ; aIter++ )
- {
- (*aIter)->EndListening(sal_False);
- (*aIter)->SetPropsFromRect();
- (*aIter)->StartListening();
- }
-
- // dialog model changed
- GetDlgEditor()->SetDialogModelChanged(sal_True);
-}
-
-//----------------------------------------------------------------------------
-
-void DlgEdForm::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+void DlgEdForm::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- SdrUnoObj::NbcResize( rRef, xFract, yFract );
+ SdrUnoObj::setSdrObjectTransformation(rTransformation);
// set geometry properties of form
EndListening(sal_False);
@@ -1823,9 +1823,9 @@ void DlgEdForm::NbcResize(const Point& rRef, const Fraction& xFract, const Fract
//----------------------------------------------------------------------------
-FASTBOOL DlgEdForm::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool DlgEdForm::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- FASTBOOL bResult = SdrUnoObj::EndCreate(rStat, eCmd);
+ bool bResult(SdrUnoObj::EndCreate(rStat, eCmd));
// stop listening
EndListening(sal_False);
diff --git a/basctl/source/dlged/dlgedpage.cxx b/basctl/source/dlged/dlgedpage.cxx
index 9ea7ea360252..0bdced6fd287 100644
--- a/basctl/source/dlged/dlgedpage.cxx
+++ b/basctl/source/dlged/dlgedpage.cxx
@@ -31,42 +31,70 @@
#include "dlgedobj.hxx"
-TYPEINIT1( DlgEdPage, SdrPage );
-
//----------------------------------------------------------------------------
-DlgEdPage::DlgEdPage( DlgEdModel& rModel, FASTBOOL bMasterPage )
+DlgEdPage::DlgEdPage( DlgEdModel& rModel, bool bMasterPage )
:SdrPage( rModel, bMasterPage )
{
}
//----------------------------------------------------------------------------
-DlgEdPage::DlgEdPage( const DlgEdPage& rPage )
- :SdrPage( rPage )
-{
- pDlgEdForm = rPage.pDlgEdForm;
-}
+//DlgEdPage::DlgEdPage( const DlgEdPage& rPage )
+// :SdrPage( rPage )
+//{
+// pDlgEdForm = rPage.pDlgEdForm;
+//}
//----------------------------------------------------------------------------
DlgEdPage::~DlgEdPage()
{
- Clear();
+ if(GetObjCount())
+ {
+ getSdrModelFromSdrObjList().SetChanged();
+ }
}
-//----------------------------------------------------------------------------
+void DlgEdPage::copyDataFromSdrPage(const SdrPage& rSource)
+{
+ if(this != &rSource)
+ {
+ const DlgEdPage* pSource = dynamic_cast< const DlgEdPage* >(&rSource);
+
+ if(pSource)
+{
+ // call parent
+ SdrPage::copyDataFromSdrPage(rSource);
+
+ // copy local data
+ pDlgEdForm = pSource->pDlgEdForm;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
-SdrPage* DlgEdPage::Clone() const
+SdrPage* DlgEdPage::CloneSdrPage(SdrModel* pTargetModel) const
{
- return new DlgEdPage( *this );
+ DlgEdModel* pDlgEdModel = static_cast< DlgEdModel* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
+ OSL_ENSURE(dynamic_cast< DlgEdModel* >(pDlgEdModel), "Wrong SdrModel type in DlgEdPage cloner (!)");
+ DlgEdPage* pClone = new DlgEdPage(
+ *pDlgEdModel,
+ IsMasterPage());
+ OSL_ENSURE(pClone, "CloneSdrPage error (!)");
+ pClone->copyDataFromSdrPage(*this);
+
+ return pClone;
}
//----------------------------------------------------------------------------
-SdrObject* DlgEdPage::SetObjectOrdNum(sal_uLong nOldObjNum, sal_uLong nNewObjNum)
+SdrObject* DlgEdPage::SetNavigationPosition(sal_uInt32 nOldObjNum, sal_uInt32 nNewObjNum)
{
- SdrObject* pObj = SdrPage::SetObjectOrdNum( nOldObjNum, nNewObjNum );
+ SdrObject* pObj = SdrPage::SetNavigationPosition( nOldObjNum, nNewObjNum );
DlgEdHint aHint( DLGED_HINT_OBJORDERCHANGED );
if ( pDlgEdForm )
diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx
index 97e15a1f5191..6dc384ede8f4 100644
--- a/basctl/source/dlged/dlgedview.cxx
+++ b/basctl/source/dlged/dlgedview.cxx
@@ -37,14 +37,13 @@
#include <basidesh.hxx>
#include <iderdll.hxx>
#include "dlgedobj.hxx"
-
-TYPEINIT1( DlgEdView, SdrView );
+#include <svx/svdlegacy.hxx>
//----------------------------------------------------------------------------
-DlgEdView::DlgEdView( SdrModel* pModel, OutputDevice* pOut, DlgEditor* pEditor )
- :SdrView( pModel, pOut )
- ,pDlgEditor( pEditor )
+DlgEdView::DlgEdView( SdrModel& rModel, OutputDevice* pOut, DlgEditor& rEditor )
+: SdrView( rModel, pOut ),
+ mrDlgEditor( rEditor )
{
// #114898#
SetBufferedOutputAllowed(true);
@@ -59,21 +58,20 @@ DlgEdView::~DlgEdView()
//----------------------------------------------------------------------------
-void DlgEdView::MarkListHasChanged()
+void DlgEdView::handleSelectionChange()
{
- SdrView::MarkListHasChanged();
+ // call parent
+ SdrView::handleSelectionChange();
+ // local reactions
DlgEdHint aHint( DLGED_HINT_SELECTIONCHANGED );
- if ( pDlgEditor )
- {
- pDlgEditor->Broadcast( aHint );
- pDlgEditor->UpdatePropertyBrowserDelayed();
- }
+ mrDlgEditor.Broadcast( aHint );
+ mrDlgEditor.UpdatePropertyBrowserDelayed();
}
//----------------------------------------------------------------------------
-void DlgEdView::MakeVisible( const Rectangle& rRect, Window& rWin )
+void DlgEdView::MakeVisibleAtView( const basegfx::B2DRange& rRange, Window& rWin )
{
// visible area
MapMode aMap( rWin.GetMapMode() );
@@ -83,7 +81,8 @@ void DlgEdView::MakeVisible( const Rectangle& rRect, Window& rWin )
Rectangle aVisRect( RectTmp );
// check, if rectangle is inside visible area
- if ( !aVisRect.IsInside( rRect ) )
+ const Rectangle aOldRange(basegfx::fround(rRange.getMinX()), basegfx::fround(rRange.getMinY()), basegfx::fround(rRange.getMaxX()), basegfx::fround(rRange.getMaxY()));
+ if ( !aVisRect.IsInside( aOldRange ) )
{
// calculate scroll distance; the rectangle must be inside the visible area
sal_Int32 nScrollX = 0, nScrollY = 0;
@@ -93,25 +92,24 @@ void DlgEdView::MakeVisible( const Rectangle& rRect, Window& rWin )
sal_Int32 nVisTop = aVisRect.Top();
sal_Int32 nVisBottom = aVisRect.Bottom();
- sal_Int32 nDeltaX = pDlgEditor->GetHScroll()->GetLineSize();
- sal_Int32 nDeltaY = pDlgEditor->GetVScroll()->GetLineSize();
+ sal_Int32 nDeltaX = mrDlgEditor.GetHScroll()->GetLineSize();
+ sal_Int32 nDeltaY = mrDlgEditor.GetVScroll()->GetLineSize();
- while ( rRect.Right() > nVisRight + nScrollX )
+ while ( aOldRange.Right() > nVisRight + nScrollX )
nScrollX += nDeltaX;
- while ( rRect.Left() < nVisLeft + nScrollX )
+ while ( aOldRange.Left() < nVisLeft + nScrollX )
nScrollX -= nDeltaX;
- while ( rRect.Bottom() > nVisBottom + nScrollY )
+ while ( aOldRange.Bottom() > nVisBottom + nScrollY )
nScrollY += nDeltaY;
- while ( rRect.Top() < nVisTop + nScrollY )
+ while ( aOldRange.Top() < nVisTop + nScrollY )
nScrollY -= nDeltaY;
// don't scroll beyond the page size
- Size aPageSize = pDlgEditor->GetPage()->GetSize();
- sal_Int32 nPageWidth = aPageSize.Width();
- sal_Int32 nPageHeight = aPageSize.Height();
+ const sal_Int32 nPageWidth(basegfx::fround(mrDlgEditor.GetPage()->GetPageScale().getX()));
+ const sal_Int32 nPageHeight(basegfx::fround(mrDlgEditor.GetPage()->GetPageScale().getY()));
if ( nVisRight + nScrollX > nPageWidth )
nScrollX = nPageWidth - nVisRight;
@@ -134,18 +132,16 @@ void DlgEdView::MakeVisible( const Rectangle& rRect, Window& rWin )
rWin.Invalidate();
// update scroll bars
- if ( pDlgEditor )
- pDlgEditor->UpdateScrollBars();
+ mrDlgEditor.UpdateScrollBars();
DlgEdHint aHint( DLGED_HINT_WINDOWSCROLLED );
- if ( pDlgEditor )
- pDlgEditor->Broadcast( aHint );
+ mrDlgEditor.Broadcast( aHint );
}
}
//----------------------------------------------------------------------------
-SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol)
+SdrObject* impLocalHitCorrection(SdrObject* pRetval, const basegfx::B2DPoint& rPnt, double fTol)
{
DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >(pRetval);
@@ -168,22 +164,16 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt
{
// use direct model data; it's a DlgEdObj, so GetLastBoundRect()
// will access aOutRect directly
- const Rectangle aOuterRectangle(pDlgEdObj->GetLastBoundRect());
+ basegfx::B2DRange aOuterRange(sdr::legacy::GetSnapRange(*pDlgEdObj));
- if(!aOuterRectangle.IsEmpty()
- && RECT_EMPTY != aOuterRectangle.Right()
- && RECT_EMPTY != aOuterRectangle.Bottom())
+ if(!aOuterRange.isEmpty())
{
- basegfx::B2DRange aOuterRange(
- aOuterRectangle.Left(), aOuterRectangle.Top(),
- aOuterRectangle.Right(), aOuterRectangle.Bottom());
-
- if(nTol)
+ if(!basegfx::fTools::equalZero(fTol))
{
- aOuterRange.grow(-1.0 * nTol);
+ aOuterRange.grow(fTol);
}
- if(aOuterRange.isInside(basegfx::B2DPoint(rPnt.X(), rPnt.Y())))
+ if(aOuterRange.isInside(rPnt))
{
pRetval = 0;
}
@@ -194,15 +184,15 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt
return pRetval;
}
-SdrObject* DlgEdView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const
+SdrObject* DlgEdView::CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, sal_uInt32 nOptions, const SetOfByte* pMVisLay) const
{
// call parent
- SdrObject* pRetval = SdrView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay);
+ SdrObject* pRetval = SdrView::CheckSingleSdrObjectHit(rPnt, fTol, pObj, nOptions, pMVisLay);
if(pRetval)
{
// check hitted object locally
- pRetval = impLocalHitCorrection(pRetval, rPnt, nTol);
+ pRetval = impLocalHitCorrection(pRetval, rPnt, fTol);
}
return pRetval;
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index dee5d3219614..a7f17b4bf9e5 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -317,27 +317,25 @@ sal_Bool PropBrw::Close()
}
//----------------------------------------------------------------------------
-Sequence< Reference< XInterface > >
- PropBrw::CreateMultiSelectionSequence( const SdrMarkList& _rMarkList )
+Sequence< Reference< XInterface > > PropBrw::CreateMultiSelectionSequence(const SdrObjectVector& rSelection)
{
Sequence< Reference< XInterface > > aSeq;
InterfaceArray aInterfaces;
- sal_uInt32 nMarkCount = _rMarkList.GetMarkCount();
- for( sal_uInt32 i = 0 ; i < nMarkCount ; i++ )
+ for(sal_uInt32 a(0); a < rSelection.size(); a++)
{
- SdrObject* pCurrent = _rMarkList.GetMark(i)->GetMarkedSdrObj();
-
+ SdrObject* pCurrent = rSelection[a];
SdrObjListIter* pGroupIterator = NULL;
- if (pCurrent->IsGroupObject())
+
+ if (pCurrent->getChildrenOfSdrObject())
{
- pGroupIterator = new SdrObjListIter(*pCurrent->GetSubList());
+ pGroupIterator = new SdrObjListIter(*pCurrent->getChildrenOfSdrObject());
pCurrent = pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL;
}
while (pCurrent)
{
- DlgEdObj* pDlgEdObj = PTR_CAST(DlgEdObj, pCurrent);
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >( pCurrent);
if (pDlgEdObj)
{
Reference< XInterface > xControlInterface(pDlgEdObj->GetUnoControlModel(), UNO_QUERY);
@@ -561,7 +559,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
{
if ( pView )
{
- EndListening( *(pView->GetModel()) );
+ EndListening( pView->getSdrModelFromSdrView() );
pView = NULL;
}
@@ -578,12 +576,11 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
m_bInitialStateChange = sal_False;
}
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uInt32 nMarkCount = rMarkList.GetMarkCount();
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
- if ( nMarkCount == 0 )
+ if(!aSelection.size())
{
- EndListening( *(pView->GetModel()) );
+ EndListening( pView->getSdrModelFromSdrView() );
pView = NULL;
implSetNewObject( NULL );
return;
@@ -591,20 +588,22 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
Reference< XPropertySet > xNewObject;
Sequence< Reference< XInterface > > aNewObjects;
- if ( nMarkCount == 1 )
+
+ if(1 == aSelection.size())
{
- DlgEdObj* pDlgEdObj = PTR_CAST( DlgEdObj, rMarkList.GetMark(0)->GetMarkedSdrObj() );
+ DlgEdObj* pDlgEdObj = dynamic_cast< DlgEdObj* >(aSelection[0]);
+
if ( pDlgEdObj )
{
- if ( pDlgEdObj->IsGroupObject() ) // group object
- aNewObjects = CreateMultiSelectionSequence( rMarkList );
+ if ( pDlgEdObj->getChildrenOfSdrObject() ) // group object
+ aNewObjects = CreateMultiSelectionSequence(aSelection);
else // single selection
xNewObject = xNewObject.query( pDlgEdObj->GetUnoControlModel() );
}
}
- else if ( nMarkCount > 1 ) // multiple selection
+ else // if ( nMarkCount > 1 ) // multiple selection
{
- aNewObjects = CreateMultiSelectionSequence( rMarkList );
+ aNewObjects = CreateMultiSelectionSequence(aSelection);
}
if ( aNewObjects.getLength() )
@@ -612,7 +611,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
else
implSetNewObject( xNewObject );
- StartListening( *(pView->GetModel()) );
+ StartListening( pView->getSdrModelFromSdrView() );
}
catch ( const PropertyVetoException& ) { /* silence */ }
catch ( const Exception& )
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index 11a68f15632f..e61939e2d84a 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -74,7 +74,6 @@ protected:
void InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground);
public:
- TYPEINFO();
DialogWindow( Window* pParent, const ScriptDocument& rDocument, String aLibName, String aName,
const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xDialogModel );
DialogWindow( DialogWindow* pCurView ); // never implemented
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index cb3fd4d8ad7f..fd5a74285548 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -153,7 +153,7 @@ protected:
virtual void Deactivate(sal_Bool bMDI);
virtual void Move();
- virtual void ShowCursor( FASTBOOL bOn = sal_True );
+ virtual void ShowCursor( bool bOn = sal_True );
void CreateModulWindowLayout();
void DestroyModulWindowLayout();
@@ -171,7 +171,6 @@ protected:
virtual void onDocumentModeChanged( const ScriptDocument& _rDocument );
public:
- TYPEINFO();
SFX_DECL_INTERFACE( SVX_INTERFACE_BASIDE_VIEWSH )
SFX_DECL_VIEWFACTORY(BasicIDEShell);
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index 79784561b050..1ed986a3c883 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -184,7 +184,6 @@ protected:
virtual void DoScroll( ScrollBar* pCurScrollBar );
public:
- TYPEINFO();
IDEBaseWindow( Window* pParent, const ScriptDocument& rDocument, String aLibName, String aName );
virtual ~IDEBaseWindow();
diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx
index d5e35fa2bbf7..d4dab7261b74 100644
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@ -60,7 +60,6 @@ private:
DlgEdObj* pDlgEdObj;
public:
- TYPEINFO();
DlgEdHint( DlgEdHintKind eHint );
DlgEdHint( DlgEdHintKind eHint, DlgEdObj* pObj );
virtual ~DlgEdHint();
diff --git a/basctl/source/inc/dlgedfac.hxx b/basctl/source/inc/dlgedfac.hxx
index aea74d91477a..aa724343cb06 100644
--- a/basctl/source/inc/dlgedfac.hxx
+++ b/basctl/source/inc/dlgedfac.hxx
@@ -31,6 +31,7 @@
//============================================================================
// DlgEdFactory
//============================================================================
+class SdrObjFactory;
class DlgEdFactory
{
diff --git a/basctl/source/inc/dlgedfunc.hxx b/basctl/source/inc/dlgedfunc.hxx
index 8d1a8dbc7048..f37c9c330994 100644
--- a/basctl/source/inc/dlgedfunc.hxx
+++ b/basctl/source/inc/dlgedfunc.hxx
@@ -29,7 +29,7 @@
class DlgEditor;
class Timer;
class MouseEvent;
-class Point;
+namespace basegfx { class B2DPoint; }
//============================================================================
// DlgEdFunc
@@ -42,7 +42,7 @@ protected:
Timer aScrollTimer;
DECL_LINK( ScrollTimeout, Timer * );
- void ForceScroll( const Point& rPos );
+ void ForceScroll( const basegfx::B2DPoint& rPos );
public:
DlgEdFunc( DlgEditor* pParent );
diff --git a/basctl/source/inc/dlgedmod.hxx b/basctl/source/inc/dlgedmod.hxx
index 133c8a24e435..67af5f1e6d7b 100644
--- a/basctl/source/inc/dlgedmod.hxx
+++ b/basctl/source/inc/dlgedmod.hxx
@@ -45,14 +45,12 @@ private:
void operator=(const DlgEdModel& rSrcModel); // not implemented
public:
- TYPEINFO();
-
DlgEdModel();
virtual ~DlgEdModel();
- virtual void DlgEdModelChanged( FASTBOOL bChanged = sal_True );
+ virtual void DlgEdModelChanged( bool bChanged = sal_True );
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual SdrPage* AllocPage(bool bMasterPage);
virtual Window* GetCurDocViewWin();
};
diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx
index 3f3c82a848ff..752c8204fca1 100644
--- a/basctl/source/inc/dlgedobj.hxx
+++ b/basctl/source/inc/dlgedobj.hxx
@@ -46,25 +46,28 @@ class DlgEditor;
class DlgEdObj: public SdrUnoObj
{
+private:
friend class DlgEditor;
friend class DlgEdFactory;
friend class DlgEdPropListenerImpl;
friend class DlgEdForm;
-private:
sal_Bool bIsListening;
DlgEdForm* pDlgEdForm;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener> m_xPropertyChangeListener;
::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener> m_xContainerListener;
protected:
- DlgEdObj();
- DlgEdObj(const ::rtl::OUString& rModelName,
+ DlgEdObj(
+ SdrModel& rSdrModel);
+ DlgEdObj(
+ SdrModel& rSdrModel,
+ const ::rtl::OUString& rModelName,
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac);
+ virtual ~DlgEdObj();
- virtual void NbcMove( const Size& rSize );
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
DECL_LINK(OnCreate, void* );
@@ -87,11 +90,13 @@ protected:
sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut );
-public:
- TYPEINFO();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
- virtual ~DlgEdObj();
- virtual void SetPage(SdrPage* pNewPage);
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+ virtual void clonedFrom(const DlgEdObj* _pSource); // not working yet
virtual void SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; }
virtual DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; }
@@ -99,10 +104,6 @@ public:
virtual sal_uInt32 GetObjInventor() const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual SdrObject* Clone() const; // not working yet
- virtual void operator= (const SdrObject& rObj); // not working yet
- virtual void clonedFrom(const DlgEdObj* _pSource); // not working yet
-
// FullDrag support
virtual SdrObject* getFullDragClone() const;
@@ -141,27 +142,30 @@ public:
class DlgEdForm: public DlgEdObj
{
+private:
friend class DlgEditor;
friend class DlgEdFactory;
-private:
DlgEditor* pDlgEditor;
::std::vector<DlgEdObj*> pChilds;
mutable ::boost::optional< ::com::sun::star::awt::DeviceInfo > mpDeviceInfo;
+ void ImplInvalidateDeviceInfo();
protected:
- DlgEdForm();
+ DlgEdForm(SdrModel& rSdrModel);
+ virtual ~DlgEdForm();
- virtual void NbcMove( const Size& rSize );
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
-public:
- TYPEINFO();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
- virtual ~DlgEdForm();
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
virtual void SetDlgEditor( DlgEditor* pEditor );
virtual DlgEditor* GetDlgEditor() const { return pDlgEditor; }
@@ -183,9 +187,6 @@ public:
virtual void UpdateTabOrderAndGroups();
::com::sun::star::awt::DeviceInfo getDeviceInfo() const;
-
-private:
- void ImplInvalidateDeviceInfo();
};
#endif // _BASCTL_DLGEDOBJ_HXX
diff --git a/basctl/source/inc/dlgedpage.hxx b/basctl/source/inc/dlgedpage.hxx
index 35d934f635af..3769152a2e68 100644
--- a/basctl/source/inc/dlgedpage.hxx
+++ b/basctl/source/inc/dlgedpage.hxx
@@ -38,20 +38,21 @@ class DlgEdPage : public SdrPage
private:
DlgEdForm* pDlgEdForm;
+protected:
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrPage(const SdrPage& rSource);
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrPage* CloneSdrPage(SdrModel* pTargetModel = 0) const;
- DlgEdPage( DlgEdModel& rModel, FASTBOOL bMasterPage=sal_False );
- DlgEdPage( const DlgEdPage& );
+ DlgEdPage( DlgEdModel& rModel, bool bMasterPage = false );
virtual ~DlgEdPage();
- using SdrPage::Clone;
- virtual SdrPage* Clone() const;
-
void SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; }
DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; }
- virtual SdrObject* SetObjectOrdNum(sal_uLong nOldObjNum, sal_uLong nNewObjNum);
+ virtual SdrObject* SetNavigationPosition(sal_uInt32 nOldObjNum, sal_uInt32 nNewObjNum);
};
#endif //_BASCTL_DLGEDPAGE_HXX
diff --git a/basctl/source/inc/dlgedview.hxx b/basctl/source/inc/dlgedview.hxx
index aad297605af4..39838bfb3b2f 100644
--- a/basctl/source/inc/dlgedview.hxx
+++ b/basctl/source/inc/dlgedview.hxx
@@ -36,21 +36,19 @@ class DlgEditor;
class DlgEdView : public SdrView
{
private:
- DlgEditor* pDlgEditor;
+ DlgEditor& mrDlgEditor;
public:
- TYPEINFO();
-
- DlgEdView( SdrModel* pModel, OutputDevice* pOut, DlgEditor* pEditor );
+ DlgEdView( SdrModel& rModel, OutputDevice* pOut, DlgEditor& rEditor );
virtual ~DlgEdView();
- virtual void MarkListHasChanged();
- virtual void MakeVisible( const Rectangle& rRect, Window& rWin );
+ virtual void handleSelectionChange();
+ virtual void MakeVisibleAtView( const basegfx::B2DRange& rRange, Window& rWin );
protected:
// overloaded to handle HitTest for some objects special
using SdrView::CheckSingleSdrObjectHit;
- virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, sal_uInt32 nOptions, const SetOfByte* pMVisLay) const;
};
#endif //_BASCTL_DLGEDVIEW_HXX
diff --git a/basctl/source/inc/propbrw.hxx b/basctl/source/inc/propbrw.hxx
index 6b9795c581de..36b92c936a1a 100644
--- a/basctl/source/inc/propbrw.hxx
+++ b/basctl/source/inc/propbrw.hxx
@@ -33,7 +33,7 @@
#include <svl/brdcst.hxx>
#include <svl/lstner.hxx>
#include <sfx2/childwin.hxx>
-#include <svx/svdmark.hxx>
+#include <svx/svdobj.hxx>
//============================================================================
// PropBrwMgr
@@ -78,7 +78,7 @@ protected:
DECLARE_STL_VECTOR(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>, InterfaceArray);
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >
- CreateMultiSelectionSequence( const SdrMarkList& _rMarkList );
+ CreateMultiSelectionSequence(const SdrObjectVector& rSelection);
void implSetNewObjectSequence( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >& _rObjectSeq );
diff --git a/basctl/source/inc/sbxitem.hxx b/basctl/source/inc/sbxitem.hxx
index 47b74859ff9a..019af2d07f7a 100644
--- a/basctl/source/inc/sbxitem.hxx
+++ b/basctl/source/inc/sbxitem.hxx
@@ -43,7 +43,8 @@ class SbxItem : public SfxPoolItem
sal_uInt16 m_nType;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
+ SbxItem() : SfxPoolItem( 0 ), m_aDocument( ScriptDocument::NoDocument ), m_nType( 0 ) {}
SbxItem( sal_uInt16 nWhich, const ScriptDocument& rDocument, const String& aLibName, const String& aName, sal_uInt16 nType );
SbxItem( sal_uInt16 nWhich, const ScriptDocument& rDocument, const String& aLibName, const String& aName, const String& aMethodName, sal_uInt16 nType );
SbxItem( const SbxItem& );
diff --git a/basctl/util/makefile.mk b/basctl/util/makefile.mk
index bf7138063b0a..24312814146d 100644
--- a/basctl/util/makefile.mk
+++ b/basctl/util/makefile.mk
@@ -46,6 +46,7 @@ SHL1TARGET= basctl$(DLLPOSTFIX)
SHL1IMPLIB= basctl
SHL1BASE = 0x1d800000
SHL1STDLIBS= \
+ $(BASEGFXLIB) \
$(EDITENGLIB) \
$(SVXCORELIB) \
$(SVXLIB) \
diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx
index d02479105249..0b8c0b11aae4 100644
--- a/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx
+++ b/basegfx/inc/basegfx/matrix/b2dhommatrix.hxx
@@ -91,9 +91,11 @@ namespace basegfx
// Translation
void translate(double fX, double fY);
+ void translate(const B2DTuple& rTuple);
// Skalierung
void scale(double fX, double fY);
+ void scale(const B2DTuple& rTuple);
// Shearing-Matrices
void shearX(double fSx);
diff --git a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
index 267cf570b7ce..d66803644c90 100644
--- a/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
+++ b/basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
@@ -27,6 +27,8 @@
#include <sal/types.h>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/vector/b2dvector.hxx>
+#include <com/sun/star/drawing/HomogenMatrix3.hpp>
+#include <basegfx/point/b2dpoint.hxx>
namespace rtl { class OUString; }
@@ -91,6 +93,21 @@ namespace basegfx
rTranslate.getX(), rTranslate.getY());
}
+ B2DHomMatrix createScaleRotateTranslateB2DHomMatrix(
+ double fScaleX, double fScaleY,
+ double fRadiant,
+ double fTranslateX, double fTranslateY);
+ inline B2DHomMatrix createScaleRotateTranslateB2DHomMatrix(
+ const B2DTuple& rScale,
+ double fRadiant,
+ const B2DTuple& rTranslate)
+ {
+ return createScaleRotateTranslateB2DHomMatrix(
+ rScale.getX(), rScale.getY(),
+ fRadiant,
+ rTranslate.getX(), rTranslate.getY());
+ }
+
B2DHomMatrix createShearXRotateTranslateB2DHomMatrix(
double fShearX,
double fRadiant,
@@ -106,6 +123,18 @@ namespace basegfx
rTranslate.getX(), rTranslate.getY());
}
+ B2DHomMatrix createRotateTranslateB2DHomMatrix(
+ double fRadiant,
+ double fTranslateX, double fTranslateY);
+ inline B2DHomMatrix createRotateTranslateB2DHomMatrix(
+ double fRadiant,
+ const B2DTuple& rTranslate)
+ {
+ return createRotateTranslateB2DHomMatrix(
+ fRadiant,
+ rTranslate.getX(), rTranslate.getY());
+ }
+
B2DHomMatrix createScaleTranslateB2DHomMatrix(
double fScaleX, double fScaleY,
double fTranslateX, double fTranslateY);
@@ -131,6 +160,15 @@ namespace basegfx
fRadiant);
}
+ /* tooling methods for converting API matrices (drawing::HomogenMatrix3)
+ to B2DHomMatrix
+ */
+ B2DHomMatrix UnoHomogenMatrix3ToB2DHomMatrix(
+ const com::sun::star::drawing::HomogenMatrix3 rMatrixIn);
+ void B2DHomMatrixToUnoHomogenMatrix3(
+ const B2DHomMatrix& rMatrixIn,
+ com::sun::star::drawing::HomogenMatrix3& rMatrixOut);
+
} // end of namespace tools
} // end of namespace basegfx
@@ -144,7 +182,7 @@ namespace basegfx
{
private:
B2DVector maScale;
- B2DVector maTranslate;
+ B2DPoint maTranslate;
double mfRotate;
double mfShearX;
@@ -166,7 +204,7 @@ namespace basegfx
}
const B2DVector& getScale() const { return maScale; }
- const B2DVector& getTranslate() const { return maTranslate; }
+ const B2DPoint& getTranslate() const { return maTranslate; }
double getRotate() const { return mfRotate; }
double getShearX() const { return mfShearX; }
};
@@ -182,14 +220,15 @@ namespace basegfx
class B2DHomMatrixBufferedOnDemandDecompose
{
private:
- B2DHomMatrix maB2DHomMatrix;
- B2DVector maScale;
- B2DVector maTranslate;
- double mfRotate;
- double mfShearX;
+ B2DHomMatrix maB2DHomMatrix;
+ B2DVector maScale;
+ B2DPoint maTranslate;
+ double mfRotate;
+ double mfShearX;
// bitfield
- unsigned mbDecomposed : 1;
+ bool mbDecomposed : 1;
+ bool mbCombined : 1;
void impCheckDecompose()
{
@@ -200,23 +239,151 @@ namespace basegfx
}
}
+ void impCheckCombined()
+ {
+ if(!mbCombined)
+ {
+ maB2DHomMatrix = createScaleShearXRotateTranslateB2DHomMatrix(maScale, mfShearX, mfRotate, maTranslate);
+ mbCombined = true;
+ }
+ }
+
public:
- B2DHomMatrixBufferedOnDemandDecompose(const B2DHomMatrix& rB2DHomMatrix = B2DHomMatrix())
+ B2DHomMatrixBufferedOnDemandDecompose(const B2DHomMatrix& rB2DHomMatrix)
: maB2DHomMatrix(rB2DHomMatrix),
- maScale(),
- maTranslate(),
+ maScale(1.0, 1.0),
+ maTranslate(0.0, 0.0),
mfRotate(0.0),
mfShearX(0.0),
- mbDecomposed(false)
+ mbDecomposed(false),
+ mbCombined(true)
{
}
- // data access
- const B2DHomMatrix& getB2DHomMatrix() const { return maB2DHomMatrix; }
- const B2DVector& getScale() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maScale; }
- const B2DVector& getTranslate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maTranslate; }
- double getRotate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfRotate; }
- double getShearX() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfShearX; }
+ B2DHomMatrixBufferedOnDemandDecompose()
+ : maB2DHomMatrix(),
+ maScale(1.0, 1.0),
+ maTranslate(0.0, 0.0),
+ mfRotate(0.0),
+ mfShearX(0.0),
+ mbDecomposed(true),
+ mbCombined(true)
+ {
+ }
+
+ // data read access
+ const B2DHomMatrix& getB2DHomMatrix() const
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckCombined();
+ return maB2DHomMatrix;
+ }
+
+ const B2DVector& getScale() const
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+ return maScale;
+ }
+
+ const B2DPoint& getTranslate() const
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+ return maTranslate;
+ }
+
+ double getRotate() const
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+ return mfRotate;
+ }
+
+ double getShearX() const
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+ return mfShearX;
+ }
+
+ // data write access
+ void reset()
+ {
+ maB2DHomMatrix.identity();
+ maScale = B2DVector(1.0, 1.0);
+ maTranslate = B2DPoint(0.0, 0.0);
+ mfRotate = 0.0;
+ mfShearX = 0.0;
+ mbDecomposed = true;
+ mbCombined = true;
+ }
+
+ void setB2DHomMatrix(const B2DHomMatrix& rNew)
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckCombined();
+
+ if(rNew != maB2DHomMatrix)
+ {
+ maB2DHomMatrix = rNew;
+ mbDecomposed = false;
+ }
+ }
+
+ void setScale(const B2DVector& rNew)
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+
+ if(rNew != maScale)
+ {
+ maScale = rNew;
+ mbCombined = false;
+ }
+ }
+
+ void setTranslate(const B2DPoint& rNew)
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+
+ if(rNew != maTranslate)
+ {
+ maTranslate = rNew;
+ mbCombined = false;
+ }
+ }
+
+ void setRotate(double fNew)
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+
+ if(fNew != mfRotate)
+ {
+ mfRotate = fNew;
+ mbCombined = false;
+ }
+ }
+
+ void setShearX(double fNew)
+ {
+ const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+
+ if(fNew != mfShearX)
+ {
+ mfShearX = fNew;
+ mbCombined = false;
+ }
+ }
+
+ // convenience bool tests
+ bool isRotated() const { return !fTools::equalZero(getRotate()); }
+ bool isSheared() const { return !fTools::equalZero(getShearX()); }
+ bool isMirroredX() const { return fTools::less(getScale().getX(), 0.0); }
+ bool isMirroredY() const { return fTools::less(getScale().getY(), 0.0); }
+ bool isTranslatedX() const { return !fTools::equalZero(getTranslate().getX()); }
+ bool isTranslatedY() const { return !fTools::equalZero(getTranslate().getX()); }
+
+ // combined convenience bool tests
+ bool isRotatedOrSheared() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+ return !(fTools::equalZero(mfRotate) && fTools::equalZero(mfShearX)); }
+ bool isMirrored() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+ return (fTools::less(maScale.getX(), 0.0) || fTools::less(maScale.getY(), 0.0)); }
+ bool isTranslated() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose();
+ return !(fTools::equalZero(maTranslate.getX()) && fTools::equalZero(maTranslate.getY())); }
};
} // end of namespace tools
diff --git a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx
index 98777b9b1500..652bb2e524f6 100644
--- a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx
+++ b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx
@@ -80,12 +80,15 @@ namespace basegfx
/// Rotation
void rotate(double fAngleX,double fAngleY,double fAngleZ);
+ void rotate(const B3DTuple& rRotation);
/// Translation
void translate(double fX, double fY, double fZ);
+ void translate(const B3DTuple& rTranslation);
/// Scaling
void scale(double fX, double fY, double fZ);
+ void scale(const B3DTuple& rScale);
// Shearing-Matrices
void shearXY(double fSx, double fSy);
diff --git a/basegfx/inc/basegfx/matrix/b3dhommatrixtools.hxx b/basegfx/inc/basegfx/matrix/b3dhommatrixtools.hxx
new file mode 100644
index 000000000000..3b77ce9802d1
--- /dev/null
+++ b/basegfx/inc/basegfx/matrix/b3dhommatrixtools.hxx
@@ -0,0 +1,49 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _BGFX_MATRIX_B3DHOMMATRIXTOOLS_HXX
+#define _BGFX_MATRIX_B3DHOMMATRIXTOOLS_HXX
+
+#include <sal/types.h>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <com/sun/star/drawing/HomogenMatrix.hpp>
+
+///////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ /* tooling methods for converting API matrices (drawing::HomogenMatrix) to
+ B3DHomMatrix. drawing::HomogenMatrix4 is not used by OOo
+ */
+ B3DHomMatrix UnoHomogenMatrixToB3DHomMatrix(
+ const com::sun::star::drawing::HomogenMatrix rMatrixIn);
+ void B3DHomMatrixToUnoHomogenMatrix(
+ const B3DHomMatrix& rMatrixIn,
+ com::sun::star::drawing::HomogenMatrix& rMatrixOut);
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+///////////////////////////////////////////////////////////////////////////////
+
+#endif /* _BGFX_MATRIX_B3DHOMMATRIXTOOLS_HXX */
diff --git a/basegfx/inc/basegfx/numeric/ftools.hxx b/basegfx/inc/basegfx/numeric/ftools.hxx
index 0d77bd04be1b..f61bb58d6b4b 100644
--- a/basegfx/inc/basegfx/numeric/ftools.hxx
+++ b/basegfx/inc/basegfx/numeric/ftools.hxx
@@ -224,6 +224,7 @@ namespace basegfx
return (rfValA > rfValB || equal(rfValA, rfValB));
}
};
+
} // end of namespace basegfx
#endif /* _BGFX_NUMERIC_FTOOLS_HXX */
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
index fd988a382f86..4b91efdce444 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx
@@ -72,6 +72,9 @@ namespace basegfx
bool operator==(const B2DPolygon& rPolygon) const;
bool operator!=(const B2DPolygon& rPolygon) const;
+ /// Transform B2DPolygon by given transformation matrix.
+ B2DPolygon& operator*=(const ::basegfx::B2DHomMatrix& rMatrix);
+
/// member count
sal_uInt32 count() const;
@@ -264,9 +267,17 @@ namespace basegfx
B2DPoint* end();
};
- // typedef for a vector of B2DPolygons
+ //////////////////////////////////////////////////////////////////////////
+ /// global typedef for a vector of B2DPolygons
+
typedef ::std::vector< B2DPolygon > B2DPolygonVector;
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /// Transform B2DPolygon by given transformation matrix (see operator*=())
+ B2DPolygon operator*(const B2DHomMatrix& rMatrix, const B2DPolygon& rB2DPolygon);
+
} // end of namespace basegfx
//////////////////////////////////////////////////////////////////////////////
diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
index 592ab4b9209d..99a7423f41bc 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
@@ -29,6 +29,8 @@
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
+#include <com/sun/star/drawing/PointSequence.hpp>
+#include <com/sun/star/drawing/FlagSequence.hpp>
#include <vector>
//////////////////////////////////////////////////////////////////////////////
@@ -527,6 +529,26 @@ namespace basegfx
*/
B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate);
+ /// converters for com::sun::star::drawing::PointSequence
+ B2DPolygon UnoPointSequenceToB2DPolygon(
+ const com::sun::star::drawing::PointSequence& rPointSequenceSource,
+ bool bCheckClosed = true);
+ void B2DPolygonToUnoPointSequence(
+ const B2DPolygon& rPolygon,
+ com::sun::star::drawing::PointSequence& rPointSequenceRetval);
+
+ /* converters for com::sun::star::drawing::PointSequence and
+ com::sun::star::drawing::FlagSequence to B2DPolygon (curved polygons)
+ */
+ B2DPolygon UnoPolygonBezierCoordsToB2DPolygon(
+ const com::sun::star::drawing::PointSequence& rPointSequenceSource,
+ const com::sun::star::drawing::FlagSequence& rFlagSequenceSource,
+ bool bCheckClosed = true);
+ void B2DPolygonToUnoPolygonBezierCoords(
+ const B2DPolygon& rPolyPolygon,
+ com::sun::star::drawing::PointSequence& rPointSequenceRetval,
+ com::sun::star::drawing::FlagSequence& rFlagSequenceRetval);
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
index 68b7a5090ead..f2e1ece4d0a9 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx
@@ -65,8 +65,12 @@ namespace basegfx
bool operator==(const B2DPolyPolygon& rPolyPolygon) const;
bool operator!=(const B2DPolyPolygon& rPolyPolygon) const;
+ /// Transform B2DPolygon by given transformation matrix.
+ B2DPolyPolygon& operator*=(const ::basegfx::B2DHomMatrix& rMatrix);
+
// polygon interface
sal_uInt32 count() const;
+ sal_uInt32 allPointCount() const;
B2DPolygon getB2DPolygon(sal_uInt32 nIndex) const;
void setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon& rPolygon);
@@ -129,9 +133,17 @@ namespace basegfx
B2DPolygon* end();
};
- // typedef for a vector of B2DPolyPolygons
+ //////////////////////////////////////////////////////////////////////////
+ /// global typedef for a vector of B2DPolyPolygons
+
typedef ::std::vector< B2DPolyPolygon > B2DPolyPolygonVector;
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /// Transform B2DPolyPolygon by given transformation matrix (see operator*=())
+ B2DPolyPolygon operator*(const B2DHomMatrix& rMatrix, const B2DPolyPolygon& rB2DPolyPolygon);
+
} // end of namespace basegfx
#endif /* _BGFX_POLYGON_B2DPOLYPOLYGON_HXX */
diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
index 7a602ef36538..c9cb8b3a7d88 100644
--- a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
@@ -28,6 +28,8 @@
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b3dpolypolygon.hxx>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
#include <vector>
namespace rtl
@@ -275,6 +277,22 @@ namespace basegfx
*/
B2DPolyPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolyPolygon& rCandidate);
+ /// converters for com::sun::star::drawing::PointSequence
+ B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(
+ const com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceSource,
+ bool bCheckClosed = true);
+ void B2DPolyPolygonToUnoPointSequenceSequence(
+ const B2DPolyPolygon& rPolyPolygon,
+ com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceRetval);
+
+ /// converters for com::sun::star::drawing::PolyPolygonBezierCoords (curved polygons)
+ B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+ const com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsSource,
+ bool bCheckClosed = true);
+ void B2DPolyPolygonToUnoPolyPolygonBezierCoords(
+ const B2DPolyPolygon& rPolyPolygon,
+ com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsRetval);
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx
index 8158e37d3e98..e05525828727 100644
--- a/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx
+++ b/basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx
@@ -26,9 +26,10 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dvector.hxx>
-#include <vector>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/point/b3dpoint.hxx>
+#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
+#include <vector>
//////////////////////////////////////////////////////////////////////////////
@@ -144,6 +145,14 @@ namespace basegfx
bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& rCandidateB, const double& rfSmallValue);
bool equal(const B3DPolyPolygon& rCandidateA, const B3DPolyPolygon& rCandidateB);
+ /// converters for com::sun::star::drawing::PolyPolygonShape3D
+ B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(
+ const com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygonShape3DSource,
+ bool bCheckClosed = true);
+ void B3DPolyPolygonToUnoPolyPolygonShape3D(
+ const B3DPolyPolygon& rPolyPolygonSource,
+ com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygonShape3DRetval);
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/range/b1drange.hxx b/basegfx/inc/basegfx/range/b1drange.hxx
index 5e10ffbfb959..abfefbc814fe 100644
--- a/basegfx/inc/basegfx/range/b1drange.hxx
+++ b/basegfx/inc/basegfx/range/b1drange.hxx
@@ -148,6 +148,11 @@ namespace basegfx
{
maRange.grow(fValue);
}
+
+ double clamp(double fValue) const
+ {
+ return maRange.clamp(fValue);
+ }
};
/** Round double to nearest integer for 1D range
diff --git a/basegfx/inc/basegfx/range/b1irange.hxx b/basegfx/inc/basegfx/range/b1irange.hxx
index 99685d74c586..ac8e87c9b543 100644
--- a/basegfx/inc/basegfx/range/b1irange.hxx
+++ b/basegfx/inc/basegfx/range/b1irange.hxx
@@ -134,6 +134,11 @@ namespace basegfx
{
maRange.grow(nValue);
}
+
+ sal_Int32 clamp(sal_Int32 fValue) const
+ {
+ return maRange.clamp(fValue);
+ }
};
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/range/b2drange.hxx b/basegfx/inc/basegfx/range/b2drange.hxx
index 2362b81ab649..1e7fafc1b5d8 100644
--- a/basegfx/inc/basegfx/range/b2drange.hxx
+++ b/basegfx/inc/basegfx/range/b2drange.hxx
@@ -247,8 +247,28 @@ namespace basegfx
maRangeY.grow(fValue);
}
+ B2DTuple clamp(const B2DTuple& rTuple) const
+ {
+ return B2DTuple(
+ maRangeX.clamp(rTuple.getX()),
+ maRangeY.clamp(rTuple.getY()));
+ }
+
+ /** Transform Range by given transformation matrix. */
void transform(const B2DHomMatrix& rMatrix);
+ /** Transform Range by given transformation matrix.
+
+ This operation transforms the Range by transforming all four possible
+ extrema points (corners) of the given range and building a new one.
+ This means that the range will grow evtl. when a shear and/or rotation
+ is part of the transformation.
+ */
+ B2DRange& operator*=( const ::basegfx::B2DHomMatrix& rMat );
+
+ /** Get a range filled with (0.0, 0.0, 1.0, 1.0) */
+ static const B2DRange& getUnitB2DRange();
+
private:
typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange;
@@ -256,6 +276,13 @@ namespace basegfx
MyBasicRange maRangeY;
};
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** Transform B2DRange by given transformation matrix (see operator*=())
+ */
+ B2DRange operator*( const B2DHomMatrix& rMat, const B2DRange& rB2DRange );
+
/** Round double to nearest integer for 2D range
@return the nearest integer for this range
diff --git a/basegfx/inc/basegfx/range/b2irange.hxx b/basegfx/inc/basegfx/range/b2irange.hxx
index 6b99c06427f5..ef4094d8e384 100644
--- a/basegfx/inc/basegfx/range/b2irange.hxx
+++ b/basegfx/inc/basegfx/range/b2irange.hxx
@@ -215,6 +215,13 @@ namespace basegfx
maRangeY.grow(nValue);
}
+ B2ITuple clamp(const B2ITuple& rTuple) const
+ {
+ return B2ITuple(
+ maRangeX.clamp(rTuple.getX()),
+ maRangeY.clamp(rTuple.getY()));
+ }
+
private:
typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange;
diff --git a/basegfx/inc/basegfx/range/b3drange.hxx b/basegfx/inc/basegfx/range/b3drange.hxx
index c022a4e7e221..c64a23c61b4b 100644
--- a/basegfx/inc/basegfx/range/b3drange.hxx
+++ b/basegfx/inc/basegfx/range/b3drange.hxx
@@ -284,9 +284,37 @@ namespace basegfx
maRangeZ.grow(fValue);
}
+ B3DTuple clamp(const B3DTuple& rTuple) const
+ {
+ return B3DTuple(
+ maRangeX.clamp(rTuple.getX()),
+ maRangeY.clamp(rTuple.getY()),
+ maRangeZ.clamp(rTuple.getZ()));
+ }
+
+ /** Transform Range by given transformation matrix. */
void transform(const B3DHomMatrix& rMatrix);
+
+ /** Transform Range by given transformation matrix.
+
+ This operation transforms the Range by transforming all eight possible
+ extrema points (corners) of the given range and building a new one.
+ This means that the range will grow evtl. when a shear and/or rotation
+ is part of the transformation.
+ */
+ B3DRange& operator*=( const ::basegfx::B3DHomMatrix& rMat );
+
+ /** Get a range filled with (0.0, 0.0, 0.0, 1.0, 1.0, 1.0) */
+ static const B3DRange& getUnitB3DRange();
};
+ // external operators
+ //////////////////////////////////////////////////////////////////////////
+
+ /** Transform B3DRange by given transformation matrix (see operator*=())
+ */
+ B3DRange operator*( const B3DHomMatrix& rMat, const B3DRange& rB2DRange );
+
/** Round double to nearest integer for 3D range
@return the nearest integer for this range
diff --git a/basegfx/inc/basegfx/range/b3irange.hxx b/basegfx/inc/basegfx/range/b3irange.hxx
index e30397cc8ad2..abb06dc5d4ce 100644
--- a/basegfx/inc/basegfx/range/b3irange.hxx
+++ b/basegfx/inc/basegfx/range/b3irange.hxx
@@ -252,6 +252,14 @@ namespace basegfx
maRangeY.grow(nValue);
maRangeZ.grow(nValue);
}
+
+ B3ITuple clamp(const B3ITuple& rTuple) const
+ {
+ return B3ITuple(
+ maRangeX.clamp(rTuple.getX()),
+ maRangeY.clamp(rTuple.getY()),
+ maRangeZ.clamp(rTuple.getZ()));
+ }
};
} // end of namespace basegfx
diff --git a/basegfx/inc/basegfx/range/basicrange.hxx b/basegfx/inc/basegfx/range/basicrange.hxx
index b84d2ce97c43..3cd0ee53de59 100644
--- a/basegfx/inc/basegfx/range/basicrange.hxx
+++ b/basegfx/inc/basegfx/range/basicrange.hxx
@@ -267,6 +267,28 @@ namespace basegfx
return (mnMaximum - mnMinimum);
}
}
+
+ T clamp(T nValue) const
+ {
+ if(isEmpty())
+ {
+ return nValue;
+ }
+ else
+ {
+ if(nValue < mnMinimum)
+ {
+ return mnMinimum;
+ }
+
+ if(nValue > mnMaximum)
+ {
+ return mnMaximum;
+ }
+
+ return nValue;
+ }
+ }
};
// some pre-fabricated traits
diff --git a/basegfx/prj/d.lst b/basegfx/prj/d.lst
index e4409216db89..257dd4dc63b0 100644
--- a/basegfx/prj/d.lst
+++ b/basegfx/prj/d.lst
@@ -14,6 +14,7 @@ mkdir: %_DEST%\inc%_EXT%\basegfx\matrix
..\inc\basegfx\matrix\b2dhommatrix.hxx %_DEST%\inc%_EXT%\basegfx\matrix\b2dhommatrix.hxx
..\inc\basegfx\matrix\b2dhommatrixtools.hxx %_DEST%\inc%_EXT%\basegfx\matrix\b2dhommatrixtools.hxx
..\inc\basegfx\matrix\b3dhommatrix.hxx %_DEST%\inc%_EXT%\basegfx\matrix\b3dhommatrix.hxx
+..\inc\basegfx\matrix\b3dhommatrixtools.hxx %_DEST%\inc%_EXT%\basegfx\matrix\b3dhommatrixtools.hxx
mkdir: %_DEST%\inc%_EXT%\basegfx\point
..\inc\basegfx\point\b2dpoint.hxx %_DEST%\inc%_EXT%\basegfx\point\b2dpoint.hxx
diff --git a/basegfx/source/inc/PolygonPoint.hxx b/basegfx/source/inc/PolygonPoint.hxx
index ca959fec91a5..e251302cd8ce 100644
--- a/basegfx/source/inc/PolygonPoint.hxx
+++ b/basegfx/source/inc/PolygonPoint.hxx
@@ -131,7 +131,7 @@ template < class Point, class Vector > class PolygonPointList
SimplePointVector maPoints;
SimpleBezierVector* mpVectors;
- unsigned mbIsClosed : 1;
+ bool mbIsClosed : 1;
void implTryToReduceToPointVector()
{
diff --git a/basegfx/source/inc/polygontemplate.hxx b/basegfx/source/inc/polygontemplate.hxx
index dcb35194f328..df8678e6a21d 100644
--- a/basegfx/source/inc/polygontemplate.hxx
+++ b/basegfx/source/inc/polygontemplate.hxx
@@ -131,7 +131,7 @@ template < class Point, class Vector > class ImplPolygonTemplate
SimplePointVector maPoints;
SimpleBezierVector* mpVectors;
- unsigned mbIsClosed : 1;
+ bool mbIsClosed : 1;
void implTryToReduceToPointVector()
{
diff --git a/basegfx/source/matrix/b2dhommatrix.cxx b/basegfx/source/matrix/b2dhommatrix.cxx
index 041ce9fdec17..595e6a88b3b7 100644
--- a/basegfx/source/matrix/b2dhommatrix.cxx
+++ b/basegfx/source/matrix/b2dhommatrix.cxx
@@ -123,6 +123,12 @@ namespace basegfx
bool B2DHomMatrix::invert()
{
+ if(isIdentity())
+ {
+ return true;
+ }
+ else
+ {
Impl2DHomMatrix aWork(*mpImpl);
sal_uInt16* pIndex = new sal_uInt16[mpImpl->getEdgeLength()];
sal_Int16 nParity;
@@ -134,10 +140,13 @@ namespace basegfx
return true;
}
-
+ else
+ {
delete[] pIndex;
return false;
}
+ }
+ }
bool B2DHomMatrix::isNormalized() const
{
@@ -250,6 +259,11 @@ namespace basegfx
}
}
+ void B2DHomMatrix::translate(const B2DTuple& rTuple)
+ {
+ translate(rTuple.getX(), rTuple.getY());
+ }
+
void B2DHomMatrix::scale(double fX, double fY)
{
const double fOne(1.0);
@@ -265,6 +279,11 @@ namespace basegfx
}
}
+ void B2DHomMatrix::scale(const B2DTuple& rTuple)
+ {
+ scale(rTuple.getX(), rTuple.getY());
+ }
+
void B2DHomMatrix::shearX(double fSx)
{
// #i76239# do not test againt 1.0, but against 0.0. We are talking about a value not on the diagonal (!)
diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx
index 7ce6be51c2d4..08652adadea0 100644
--- a/basegfx/source/matrix/b2dhommatrixtools.cxx
+++ b/basegfx/source/matrix/b2dhommatrixtools.cxx
@@ -257,6 +257,47 @@ namespace basegfx
}
}
+ B2DHomMatrix createScaleRotateTranslateB2DHomMatrix(
+ double fScaleX, double fScaleY,
+ double fRadiant,
+ double fTranslateX, double fTranslateY)
+ {
+ const double fOne(1.0);
+
+ if(fTools::equal(fScaleX, fOne) && fTools::equal(fScaleY, fOne))
+ {
+ /// no scale, take shortcut
+ return createRotateTranslateB2DHomMatrix(fRadiant, fTranslateX, fTranslateY);
+ }
+ else
+ {
+ /// scale used
+ if(fTools::equalZero(fRadiant))
+ {
+ /// no rotate, take shortcut
+ return createScaleTranslateB2DHomMatrix(fScaleX, fScaleY, fTranslateX, fTranslateY);
+ }
+ else
+ {
+ /// rotate and scale used
+ double fSin(0.0);
+ double fCos(1.0);
+
+ createSinCosOrthogonal(fSin, fCos, fRadiant);
+
+ B2DHomMatrix aRetval(
+ /* Row 0, Column 0 */ fCos * fScaleX,
+ /* Row 0, Column 1 */ fScaleY * -fSin,
+ /* Row 0, Column 2 */ fTranslateX,
+ /* Row 1, Column 0 */ fSin * fScaleX,
+ /* Row 1, Column 1 */ fScaleY * fCos,
+ /* Row 1, Column 2 */ fTranslateY);
+
+ return aRetval;
+ }
+ }
+ }
+
B2DHomMatrix createShearXRotateTranslateB2DHomMatrix(
double fShearX,
double fRadiant,
@@ -326,6 +367,35 @@ namespace basegfx
}
}
+ B2DHomMatrix createRotateTranslateB2DHomMatrix(
+ double fRadiant,
+ double fTranslateX, double fTranslateY)
+ {
+ if(fTools::equalZero(fRadiant))
+ {
+ /// no shear, no rotate, take shortcut
+ return createTranslateB2DHomMatrix(fTranslateX, fTranslateY);
+ }
+ else
+ {
+ /// no shear, but rotate used
+ double fSin(0.0);
+ double fCos(1.0);
+
+ createSinCosOrthogonal(fSin, fCos, fRadiant);
+
+ B2DHomMatrix aRetval(
+ /* Row 0, Column 0 */ fCos,
+ /* Row 0, Column 1 */ -fSin,
+ /* Row 0, Column 2 */ fTranslateX,
+ /* Row 1, Column 0 */ fSin,
+ /* Row 1, Column 1 */ fCos,
+ /* Row 1, Column 2 */ fTranslateY);
+
+ return aRetval;
+ }
+ }
+
B2DHomMatrix createScaleTranslateB2DHomMatrix(
double fScaleX, double fScaleY,
double fTranslateX, double fTranslateY)
@@ -390,6 +460,43 @@ namespace basegfx
return aRetval;
}
+
+ /* tooling methods for converting API matrices (drawing::HomogenMatrix3)
+ to B2DHomMatrix
+ */
+ B2DHomMatrix UnoHomogenMatrix3ToB2DHomMatrix(
+ const com::sun::star::drawing::HomogenMatrix3 rMatrixIn)
+ {
+ B2DHomMatrix aRetval;
+
+ aRetval.set(0, 0, rMatrixIn.Line1.Column1);
+ aRetval.set(0, 1, rMatrixIn.Line1.Column2);
+ aRetval.set(0, 2, rMatrixIn.Line1.Column3);
+ aRetval.set(1, 0, rMatrixIn.Line2.Column1);
+ aRetval.set(1, 1, rMatrixIn.Line2.Column2);
+ aRetval.set(1, 2, rMatrixIn.Line2.Column3);
+ aRetval.set(2, 0, rMatrixIn.Line3.Column1);
+ aRetval.set(2, 1, rMatrixIn.Line3.Column2);
+ aRetval.set(2, 2, rMatrixIn.Line3.Column3);
+
+ return aRetval;
+ }
+
+ void B2DHomMatrixToUnoHomogenMatrix3(
+ const B2DHomMatrix& rMatrixIn,
+ com::sun::star::drawing::HomogenMatrix3& rMatrixOut)
+ {
+ rMatrixOut.Line1.Column1 = rMatrixIn.get(0, 0);
+ rMatrixOut.Line1.Column2 = rMatrixIn.get(0, 1);
+ rMatrixOut.Line1.Column3 = rMatrixIn.get(0, 2);
+ rMatrixOut.Line2.Column1 = rMatrixIn.get(1, 0);
+ rMatrixOut.Line2.Column2 = rMatrixIn.get(1, 1);
+ rMatrixOut.Line2.Column3 = rMatrixIn.get(1, 2);
+ rMatrixOut.Line3.Column1 = rMatrixIn.get(2, 0);
+ rMatrixOut.Line3.Column2 = rMatrixIn.get(2, 1);
+ rMatrixOut.Line3.Column3 = rMatrixIn.get(2, 2);
+ }
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx
index 44f62a784867..1b0c79eb6081 100644
--- a/basegfx/source/matrix/b3dhommatrix.cxx
+++ b/basegfx/source/matrix/b3dhommatrix.cxx
@@ -241,6 +241,11 @@ namespace basegfx
}
}
+ void B3DHomMatrix::rotate(const B3DTuple& rRotation)
+ {
+ rotate(rRotation.getX(), rRotation.getY(), rRotation.getZ());
+ }
+
void B3DHomMatrix::translate(double fX, double fY, double fZ)
{
if(!fTools::equalZero(fX) || !fTools::equalZero(fY) || !fTools::equalZero(fZ))
@@ -255,6 +260,11 @@ namespace basegfx
}
}
+ void B3DHomMatrix::translate(const B3DTuple& rRotation)
+ {
+ translate(rRotation.getX(), rRotation.getY(), rRotation.getZ());
+ }
+
void B3DHomMatrix::scale(double fX, double fY, double fZ)
{
const double fOne(1.0);
@@ -271,6 +281,11 @@ namespace basegfx
}
}
+ void B3DHomMatrix::scale(const B3DTuple& rRotation)
+ {
+ scale(rRotation.getX(), rRotation.getY(), rRotation.getZ());
+ }
+
void B3DHomMatrix::shearXY(double fSx, double fSy)
{
// #i76239# do not test againt 1.0, but against 0.0. We are talking about a value not on the diagonal (!)
diff --git a/basegfx/source/matrix/b3dhommatrixtools.cxx b/basegfx/source/matrix/b3dhommatrixtools.cxx
new file mode 100644
index 000000000000..d229d2daa74a
--- /dev/null
+++ b/basegfx/source/matrix/b3dhommatrixtools.cxx
@@ -0,0 +1,84 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_basegfx.hxx"
+
+#include <basegfx/matrix/b3dhommatrixtools.hxx>
+
+///////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+ namespace tools
+ {
+ B3DHomMatrix UnoHomogenMatrixToB3DHomMatrix(
+ const com::sun::star::drawing::HomogenMatrix rMatrixIn)
+ {
+ B3DHomMatrix aRetval;
+
+ aRetval.set(0, 0, rMatrixIn.Line1.Column1);
+ aRetval.set(0, 1, rMatrixIn.Line1.Column2);
+ aRetval.set(0, 2, rMatrixIn.Line1.Column3);
+ aRetval.set(0, 3, rMatrixIn.Line1.Column4);
+ aRetval.set(1, 0, rMatrixIn.Line2.Column1);
+ aRetval.set(1, 1, rMatrixIn.Line2.Column2);
+ aRetval.set(1, 2, rMatrixIn.Line2.Column3);
+ aRetval.set(1, 3, rMatrixIn.Line2.Column4);
+ aRetval.set(2, 0, rMatrixIn.Line3.Column1);
+ aRetval.set(2, 1, rMatrixIn.Line3.Column2);
+ aRetval.set(2, 2, rMatrixIn.Line3.Column3);
+ aRetval.set(2, 3, rMatrixIn.Line3.Column4);
+ aRetval.set(3, 0, rMatrixIn.Line4.Column1);
+ aRetval.set(3, 1, rMatrixIn.Line4.Column2);
+ aRetval.set(3, 2, rMatrixIn.Line4.Column3);
+ aRetval.set(3, 3, rMatrixIn.Line4.Column4);
+
+ return aRetval;
+ }
+
+ void B3DHomMatrixToUnoHomogenMatrix(
+ const B3DHomMatrix& rMatrixIn,
+ com::sun::star::drawing::HomogenMatrix& rMatrixOut)
+ {
+ rMatrixOut.Line1.Column1 = rMatrixIn.get(0, 0);
+ rMatrixOut.Line1.Column2 = rMatrixIn.get(0, 1);
+ rMatrixOut.Line1.Column3 = rMatrixIn.get(0, 2);
+ rMatrixOut.Line1.Column4 = rMatrixIn.get(0, 3);
+ rMatrixOut.Line2.Column1 = rMatrixIn.get(1, 0);
+ rMatrixOut.Line2.Column2 = rMatrixIn.get(1, 1);
+ rMatrixOut.Line2.Column3 = rMatrixIn.get(1, 2);
+ rMatrixOut.Line2.Column4 = rMatrixIn.get(1, 3);
+ rMatrixOut.Line3.Column1 = rMatrixIn.get(2, 0);
+ rMatrixOut.Line3.Column2 = rMatrixIn.get(2, 1);
+ rMatrixOut.Line3.Column3 = rMatrixIn.get(2, 2);
+ rMatrixOut.Line3.Column4 = rMatrixIn.get(2, 3);
+ rMatrixOut.Line4.Column1 = rMatrixIn.get(3, 0);
+ rMatrixOut.Line4.Column2 = rMatrixIn.get(3, 1);
+ rMatrixOut.Line4.Column3 = rMatrixIn.get(3, 2);
+ rMatrixOut.Line4.Column4 = rMatrixIn.get(3, 3);
+ }
+
+ } // end of namespace tools
+} // end of namespace basegfx
+
+///////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/basegfx/source/matrix/makefile.mk b/basegfx/source/matrix/makefile.mk
index 7290920a83df..02bfb07b2f96 100644
--- a/basegfx/source/matrix/makefile.mk
+++ b/basegfx/source/matrix/makefile.mk
@@ -38,7 +38,8 @@ TARGET=matrix
SLOFILES= \
$(SLO)$/b2dhommatrix.obj \
$(SLO)$/b2dhommatrixtools.obj \
- $(SLO)$/b3dhommatrix.obj
+ $(SLO)$/b3dhommatrix.obj \
+ $(SLO)$/b3dhommatrixtools.obj
# --- Targets ----------------------------------
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx
index 575c9ba1474d..604f6a1700d9 100644
--- a/basegfx/source/polygon/b2dlinegeometry.cxx
+++ b/basegfx/source/polygon/b2dlinegeometry.cxx
@@ -117,7 +117,7 @@ namespace basegfx
aArrowTransform.rotate(fRotation);
// move arrow docking position to polygon head
- aArrowTransform.translate(aHead.getX(), aHead.getY());
+ aArrowTransform.translate(aHead);
// transform retval and close
aRetval.transform(aArrowTransform);
diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx
index fb488345d7f5..f542072cfcc7 100644
--- a/basegfx/source/polygon/b2dpolygon.cxx
+++ b/basegfx/source/polygon/b2dpolygon.cxx
@@ -1242,6 +1242,13 @@ namespace basegfx
return !(*this == rPolygon);
}
+ B2DPolygon& B2DPolygon::operator*=(const ::basegfx::B2DHomMatrix& rMatrix)
+ {
+ transform(rMatrix);
+
+ return *this;
+ }
+
sal_uInt32 B2DPolygon::count() const
{
return mpPolygon->count();
@@ -1644,6 +1651,13 @@ namespace basegfx
{
return mpPolygon->end();
}
+
+ B2DPolygon operator*(const B2DHomMatrix& rMatrix, const B2DPolygon& rB2DPolygon)
+ {
+ B2DPolygon aRes(rB2DPolygon);
+
+ return aRes *= rMatrix;
+ }
} // end of namespace basegfx
//////////////////////////////////////////////////////////////////////////////
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index bf6ca742b7ad..afbb7e5e823c 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -38,7 +38,6 @@
#include <basegfx/curve/b2dbeziertools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <osl/mutex.hxx>
-
#include <numeric>
#include <limits>
@@ -1985,7 +1984,7 @@ namespace basegfx
// truncate fStart, fEnd to a range of [0.0 .. F_2PI[ where F_2PI
// falls back to 0.0 to ensure a unique definition
- if(fTools::less(fStart, 0.0))
+ if(fTools::lessOrEqual(fStart, 0.0))
{
fStart = 0.0;
}
@@ -1995,7 +1994,7 @@ namespace basegfx
fStart = 0.0;
}
- if(fTools::less(fEnd, 0.0))
+ if(fTools::lessOrEqual(fEnd, 0.0))
{
fEnd = 0.0;
}
@@ -2387,8 +2386,9 @@ namespace basegfx
// scan all _edges_ (which involves coming back to point 0
// for the last edge - thus the modulo operation below)
- const sal_Int32 nCount( rPoly.count() );
- for( sal_Int32 i=0; i<nCount; ++i )
+ const sal_uInt32 nCount(rPoly.count());
+
+ for(sal_uInt32 i(0); i < nCount; ++i)
{
const B2DPoint& rPoint0( rPoly.getB2DPoint(i % nCount) );
const B2DPoint& rPoint1( rPoly.getB2DPoint((i+1) % nCount) );
@@ -2716,7 +2716,7 @@ namespace basegfx
if(nPointCount)
{
- const B2DHomMatrix aMatrix(basegfx::tools::createRotateAroundPoint(rCenter, fAngle));
+ const B2DHomMatrix aMatrix(createRotateAroundPoint(rCenter, fAngle));
aRetval.transform(aMatrix);
}
@@ -3545,12 +3545,12 @@ namespace basegfx
if(bAreControlPointsUsed)
{
- const basegfx::B2DPoint aPrev(rCandidateA.getPrevControlPoint(a));
+ const B2DPoint aPrev(rCandidateA.getPrevControlPoint(a));
if(!aPrev.equal(rCandidateB.getPrevControlPoint(a), rfSmallValue))
return false;
- const basegfx::B2DPoint aNext(rCandidateA.getNextControlPoint(a));
+ const B2DPoint aNext(rCandidateA.getNextControlPoint(a));
if(!aNext.equal(rCandidateB.getNextControlPoint(a), rfSmallValue))
return false;
@@ -3579,9 +3579,9 @@ namespace basegfx
B2DPolygon aRetval(rCandidate);
// prepare geometry data. Get rounded from original
- B2ITuple aPrevTuple(basegfx::fround(rCandidate.getB2DPoint(nPointCount - 1)));
+ B2ITuple aPrevTuple(fround(rCandidate.getB2DPoint(nPointCount - 1)));
B2DPoint aCurrPoint(rCandidate.getB2DPoint(0));
- B2ITuple aCurrTuple(basegfx::fround(aCurrPoint));
+ B2ITuple aCurrTuple(fround(aCurrPoint));
// loop over all points. This will also snap the implicit closing edge
// even when not closed, but that's no problem here
@@ -3591,7 +3591,7 @@ namespace basegfx
const bool bLastRun(a + 1 == nPointCount);
const sal_uInt32 nNextIndex(bLastRun ? 0 : a + 1);
const B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex));
- const B2ITuple aNextTuple(basegfx::fround(aNextPoint));
+ const B2ITuple aNextTuple(fround(aNextPoint));
// get the states
const bool bPrevVertical(aPrevTuple.getX() == aCurrTuple.getX());
@@ -3627,6 +3627,349 @@ namespace basegfx
}
}
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PointSequence
+
+ B2DPolygon UnoPointSequenceToB2DPolygon(
+ const com::sun::star::drawing::PointSequence& rPointSequenceSource,
+ bool bCheckClosed)
+ {
+ B2DPolygon aRetval;
+ const sal_uInt32 nLength(rPointSequenceSource.getLength());
+
+ if(nLength)
+ {
+ aRetval.reserve(nLength);
+ const com::sun::star::awt::Point* pArray = rPointSequenceSource.getConstArray();
+ const com::sun::star::awt::Point* pArrayEnd = pArray + rPointSequenceSource.getLength();
+
+ for(;pArray != pArrayEnd; pArray++)
+ {
+ aRetval.append(B2DPoint(pArray->X, pArray->Y));
+ }
+
+ if(bCheckClosed)
+ {
+ // check for closed state flag
+ tools::checkClosed(aRetval);
+ }
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolygonToUnoPointSequence(
+ const B2DPolygon& rPolygon,
+ com::sun::star::drawing::PointSequence& rPointSequenceRetval)
+ {
+ B2DPolygon aPolygon(rPolygon);
+
+ if(aPolygon.areControlPointsUsed())
+ {
+ OSL_ENSURE(false, "B2DPolygonToUnoPointSequence: Source contains bezier segments, wrong UNO API data type may be used (!)");
+ aPolygon = aPolygon.getDefaultAdaptiveSubdivision();
+ }
+
+ const sal_uInt32 nPointCount(aPolygon.count());
+
+ if(nPointCount)
+ {
+ // Take closed state into account, the API polygon still uses the old closed definition
+ // with last/first point are identical (cannot hold information about open polygons with identical
+ // first and last point, though)
+ const bool bIsClosed(aPolygon.isClosed());
+
+ rPointSequenceRetval.realloc(bIsClosed ? nPointCount + 1 : nPointCount);
+ com::sun::star::awt::Point* pSequence = rPointSequenceRetval.getArray();
+
+ for(sal_uInt32 b(0); b < nPointCount; b++)
+ {
+ const B2DPoint aPoint(aPolygon.getB2DPoint(b));
+ const com::sun::star::awt::Point aAPIPoint(fround(aPoint.getX()), fround(aPoint.getY()));
+
+ *pSequence = aAPIPoint;
+ pSequence++;
+ }
+
+ // copy first point if closed
+ if(bIsClosed)
+ {
+ *pSequence = *rPointSequenceRetval.getArray();
+ }
+ }
+ else
+ {
+ rPointSequenceRetval.realloc(0);
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PointSequence and
+ // com::sun::star::drawing::FlagSequence to B2DPolygon (curved polygons)
+
+ B2DPolygon UnoPolygonBezierCoordsToB2DPolygon(
+ const com::sun::star::drawing::PointSequence& rPointSequenceSource,
+ const com::sun::star::drawing::FlagSequence& rFlagSequenceSource,
+ bool bCheckClosed)
+ {
+ const sal_uInt32 nCount((sal_uInt32)rPointSequenceSource.getLength());
+ OSL_ENSURE(nCount == (sal_uInt32)rFlagSequenceSource.getLength(),
+ "UnoPolygonBezierCoordsToB2DPolygon: Unequal count of Points and Flags (!)");
+
+ // prepare new polygon
+ B2DPolygon aRetval;
+ const com::sun::star::awt::Point* pPointSequence = rPointSequenceSource.getConstArray();
+ const com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceSource.getConstArray();
+
+ // get first point and flag
+ B2DPoint aNewCoordinatePair(pPointSequence->X, pPointSequence->Y); pPointSequence++;
+ com::sun::star::drawing::PolygonFlags ePolygonFlag(*pFlagSequence); pFlagSequence++;
+ B2DPoint aControlA;
+ B2DPoint aControlB;
+
+ // first point is not allowed to be a control point
+ OSL_ENSURE(com::sun::star::drawing::PolygonFlags_CONTROL != ePolygonFlag,
+ "UnoPolygonBezierCoordsToB2DPolygon: Start point is a control point, illegal input polygon (!)");
+
+ // add first point as start point
+ aRetval.append(aNewCoordinatePair);
+
+ for(sal_uInt32 b(1); b < nCount;)
+ {
+ // prepare loop
+ bool bControlA(false);
+ bool bControlB(false);
+
+ // get next point and flag
+ aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
+ ePolygonFlag = *pFlagSequence;
+ pPointSequence++; pFlagSequence++; b++;
+
+ if(b < nCount && com::sun::star::drawing::PolygonFlags_CONTROL == ePolygonFlag)
+ {
+ aControlA = aNewCoordinatePair;
+ bControlA = true;
+
+ // get next point and flag
+ aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
+ ePolygonFlag = *pFlagSequence;
+ pPointSequence++; pFlagSequence++; b++;
+ }
+
+ if(b < nCount && com::sun::star::drawing::PolygonFlags_CONTROL == ePolygonFlag)
+ {
+ aControlB = aNewCoordinatePair;
+ bControlB = true;
+
+ // get next point and flag
+ aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
+ ePolygonFlag = *pFlagSequence;
+ pPointSequence++; pFlagSequence++; b++;
+ }
+
+ // two or no control points are consumed, another one would be an error.
+ // It's also an error if only one control point was read
+ OSL_ENSURE(com::sun::star::drawing::PolygonFlags_CONTROL != ePolygonFlag && bControlA == bControlB,
+ "UnoPolygonBezierCoordsToB2DPolygon: Illegal source polygon (!)");
+
+ // the previous writes used the B2DPolyPoygon -> PolyPolygon converter
+ // which did not create minimal PolyPolygons, but created all control points
+ // as null vectors (identical points). Because of the former P(CA)(CB)-norm of
+ // B2DPolygon and it's unused sign of being the zero-vector and CA and CB being
+ // relative to P, an empty edge was exported as P == CA == CB. Luckily, the new
+ // export format can be read without errors by the old OOo-versions, so we need only
+ // to correct here at read and do not need to export a wrong but compatible version
+ // for the future.
+ if(bControlA
+ && aControlA.equal(aControlB)
+ && aControlA.equal(aRetval.getB2DPoint(aRetval.count() - 1)))
+ {
+ bControlA = bControlB = false;
+ }
+
+ if(bControlA)
+ {
+ // add bezier edge
+ aRetval.appendBezierSegment(aControlA, aControlB, aNewCoordinatePair);
+ }
+ else
+ {
+ // add edge
+ aRetval.append(aNewCoordinatePair);
+ }
+ }
+
+ // #i72807# API import uses old line start/end-equal definition for closed,
+ // so we need to correct this to closed state here
+ if(bCheckClosed)
+ {
+ checkClosed(aRetval);
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolygonToUnoPolygonBezierCoords(
+ const B2DPolygon& rPolygon,
+ com::sun::star::drawing::PointSequence& rPointSequenceRetval,
+ com::sun::star::drawing::FlagSequence& rFlagSequenceRetval)
+ {
+ const sal_uInt32 nPointCount(rPolygon.count());
+
+ if(nPointCount)
+ {
+ const bool bCurve(rPolygon.areControlPointsUsed());
+ const bool bClosed(rPolygon.isClosed());
+
+ if(nPointCount)
+ {
+ if(bCurve)
+ {
+ // calculate target point count
+ const sal_uInt32 nLoopCount(bClosed ? nPointCount : (nPointCount ? nPointCount - 1 : 0));
+
+ if(nLoopCount)
+ {
+ // prepare target data. The real needed number of target points (and flags)
+ // could only be calculated by using two loops, so use dynamic memory
+ std::vector< com::sun::star::awt::Point > aCollectPoints;
+ std::vector< com::sun::star::drawing::PolygonFlags > aCollectFlags;
+
+ // reserve maximum creatable points
+ const sal_uInt32 nMaxTargetCount((nLoopCount * 3) + 1);
+ aCollectPoints.reserve(nMaxTargetCount);
+ aCollectFlags.reserve(nMaxTargetCount);
+
+ // prepare current bezier segment by setting start point
+ B2DCubicBezier aBezierSegment;
+ aBezierSegment.setStartPoint(rPolygon.getB2DPoint(0));
+
+ for(sal_uInt32 a(0); a < nLoopCount; a++)
+ {
+ // add current point (always) and remember StartPointIndex for evtl. later corrections
+ const sal_uInt32 nStartPointIndex(aCollectPoints.size());
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aBezierSegment.getStartPoint().getX()),
+ fround(aBezierSegment.getStartPoint().getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
+
+ // prepare next segment
+ const sal_uInt32 nNextIndex((a + 1) % nPointCount);
+ aBezierSegment.setEndPoint(rPolygon.getB2DPoint(nNextIndex));
+ aBezierSegment.setControlPointA(rPolygon.getNextControlPoint(a));
+ aBezierSegment.setControlPointB(rPolygon.getPrevControlPoint(nNextIndex));
+
+ if(aBezierSegment.isBezier())
+ {
+ // if bezier is used, add always two control points due to the old schema
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aBezierSegment.getControlPointA().getX()),
+ fround(aBezierSegment.getControlPointA().getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_CONTROL);
+
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aBezierSegment.getControlPointB().getX()),
+ fround(aBezierSegment.getControlPointB().getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_CONTROL);
+ }
+
+ // test continuity with previous control point to set flag value
+ if(aBezierSegment.getControlPointA() != aBezierSegment.getStartPoint() && (bClosed || a))
+ {
+ const B2VectorContinuity eCont(rPolygon.getContinuityInPoint(a));
+
+ if(CONTINUITY_C1 == eCont)
+ {
+ aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SMOOTH;
+ }
+ else if(CONTINUITY_C2 == eCont)
+ {
+ aCollectFlags[nStartPointIndex] = com::sun::star::drawing::PolygonFlags_SYMMETRIC;
+ }
+ }
+
+ // prepare next loop
+ aBezierSegment.setStartPoint(aBezierSegment.getEndPoint());
+ }
+
+ if(bClosed)
+ {
+ // add first point again as closing point due to old definition
+ aCollectPoints.push_back(aCollectPoints[0]);
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
+ }
+ else
+ {
+ // add last point as closing point
+ const B2DPoint aClosingPoint(rPolygon.getB2DPoint(nPointCount - 1L));
+ aCollectPoints.push_back(
+ com::sun::star::awt::Point(
+ fround(aClosingPoint.getX()),
+ fround(aClosingPoint.getY())));
+ aCollectFlags.push_back(com::sun::star::drawing::PolygonFlags_NORMAL);
+ }
+
+ // copy collected data to target arrays
+ const sal_uInt32 nTargetCount(aCollectPoints.size());
+ OSL_ENSURE(nTargetCount == aCollectFlags.size(), "Unequal Point and Flag count (!)");
+
+ rPointSequenceRetval.realloc((sal_Int32)nTargetCount);
+ rFlagSequenceRetval.realloc((sal_Int32)nTargetCount);
+ com::sun::star::awt::Point* pPointSequence = rPointSequenceRetval.getArray();
+ com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceRetval.getArray();
+
+ for(sal_uInt32 a(0); a < nTargetCount; a++)
+ {
+ *pPointSequence = aCollectPoints[a];
+ *pFlagSequence = aCollectFlags[a];
+ pPointSequence++;
+ pFlagSequence++;
+ }
+ }
+ }
+ else
+ {
+ // straightforward point list creation
+ const sal_uInt32 nTargetCount(nPointCount + (bClosed ? 1 : 0));
+
+ rPointSequenceRetval.realloc((sal_Int32)nTargetCount);
+ rFlagSequenceRetval.realloc((sal_Int32)nTargetCount);
+
+ com::sun::star::awt::Point* pPointSequence = rPointSequenceRetval.getArray();
+ com::sun::star::drawing::PolygonFlags* pFlagSequence = rFlagSequenceRetval.getArray();
+
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ const B2DPoint aB2DPoint(rPolygon.getB2DPoint(a));
+ const com::sun::star::awt::Point aAPIPoint(
+ fround(aB2DPoint.getX()),
+ fround(aB2DPoint.getY()));
+
+ *pPointSequence = aAPIPoint;
+ *pFlagSequence = com::sun::star::drawing::PolygonFlags_NORMAL;
+ pPointSequence++;
+ pFlagSequence++;
+ }
+
+ if(bClosed)
+ {
+ // add first point as closing point
+ *pPointSequence = *rPointSequenceRetval.getConstArray();
+ *pFlagSequence = com::sun::star::drawing::PolygonFlags_NORMAL;
+ }
+ }
+ }
+ }
+ else
+ {
+ rPointSequenceRetval.realloc(0);
+ rFlagSequenceRetval.realloc(0);
+ }
+ }
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx
index 28f8270ece65..87152ccf83e8 100644
--- a/basegfx/source/polygon/b2dpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dpolypolygon.cxx
@@ -242,11 +242,30 @@ namespace basegfx
return !((*this) == rPolyPolygon);
}
+ B2DPolyPolygon& B2DPolyPolygon::operator*=(const ::basegfx::B2DHomMatrix& rMatrix)
+ {
+ transform(rMatrix);
+
+ return *this;
+ }
+
sal_uInt32 B2DPolyPolygon::count() const
{
return mpPolyPolygon->count();
}
+ sal_uInt32 B2DPolyPolygon::allPointCount() const
+ {
+ sal_uInt32 nRetval(0);
+
+ for(sal_uInt32 a(0); a < mpPolyPolygon->count(); a++)
+ {
+ nRetval += mpPolyPolygon->getB2DPolygon(a).count();
+ }
+
+ return nRetval;
+ }
+
B2DPolygon B2DPolyPolygon::getB2DPolygon(sal_uInt32 nIndex) const
{
OSL_ENSURE(nIndex < mpPolyPolygon->count(), "B2DPolyPolygon access outside range (!)");
@@ -421,6 +440,13 @@ namespace basegfx
{
return mpPolyPolygon->end();
}
+
+ B2DPolyPolygon operator*(const B2DHomMatrix& rMatrix, const B2DPolyPolygon& rB2DPolyPolygon)
+ {
+ B2DPolyPolygon aRes(rB2DPolyPolygon);
+
+ return aRes *= rMatrix;
+ }
} // end of namespace basegfx
// eof
diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
index 849fc3811f0d..1e369fa4dd77 100644
--- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx
+++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
@@ -121,8 +121,8 @@ namespace basegfx
VNV maVNV;
SNV maSNV;
- unsigned mbIsCurve : 1;
- unsigned mbChanged : 1;
+ bool mbIsCurve : 1;
+ bool mbChanged : 1;
void impAddPolygon(const sal_uInt32 aPos, const B2DPolygon& rGeometry)
{
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx
index 308bafb94d38..e05f16045341 100644
--- a/basegfx/source/polygon/b2dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolypolygontools.cxx
@@ -30,7 +30,6 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
-
#include <numeric>
//////////////////////////////////////////////////////////////////////////////
@@ -47,7 +46,7 @@ namespace basegfx
for(sal_uInt32 a(0L); a < nCount; a++)
{
const B2DPolygon aCandidate(rCandidate.getB2DPolygon(a));
- const B2VectorOrientation aOrientation(tools::getOrientation(aCandidate));
+ const B2VectorOrientation aOrientation(getOrientation(aCandidate));
sal_uInt32 nDepth(0L);
for(sal_uInt32 b(0L); b < nCount; b++)
@@ -56,7 +55,7 @@ namespace basegfx
{
const B2DPolygon aCompare(rCandidate.getB2DPolygon(b));
- if(tools::isInside(aCompare, aCandidate, true))
+ if(isInside(aCompare, aCandidate, true))
{
nDepth++;
}
@@ -94,7 +93,7 @@ namespace basegfx
{
const B2DPolygon aCompare(rCandidate.getB2DPolygon(b));
- if(tools::isInside(aCompare, aCandidate, true))
+ if(isInside(aCompare, aCandidate, true))
{
nDepth++;
}
@@ -134,7 +133,7 @@ namespace basegfx
if(aCandidate.areControlPointsUsed())
{
- aRetval.append(tools::adaptiveSubdivideByDistance(aCandidate, fDistanceBound));
+ aRetval.append(adaptiveSubdivideByDistance(aCandidate, fDistanceBound));
}
else
{
@@ -163,7 +162,7 @@ namespace basegfx
if(aCandidate.areControlPointsUsed())
{
- aRetval.append(tools::adaptiveSubdivideByAngle(aCandidate, fAngleBound));
+ aRetval.append(adaptiveSubdivideByAngle(aCandidate, fAngleBound));
}
else
{
@@ -192,7 +191,7 @@ namespace basegfx
if(aCandidate.areControlPointsUsed())
{
- aRetval.append(tools::adaptiveSubdivideByCount(aCandidate, nCount));
+ aRetval.append(adaptiveSubdivideByCount(aCandidate, nCount));
}
else
{
@@ -218,7 +217,7 @@ namespace basegfx
}
else
{
- sal_Int32 nInsideCount(0L);
+ sal_uInt32 nInsideCount(0);
for(sal_uInt32 a(0L); a < nPolygonCount; a++)
{
@@ -243,7 +242,7 @@ namespace basegfx
for(sal_uInt32 a(0L); a < nPolygonCount; a++)
{
B2DPolygon aCandidate = rCandidate.getB2DPolygon(a);
- aRetval.expand(tools::getRangeWithControlPoints(aCandidate));
+ aRetval.expand(getRangeWithControlPoints(aCandidate));
}
return aRetval;
@@ -257,7 +256,7 @@ namespace basegfx
for(sal_uInt32 a(0L); a < nPolygonCount; a++)
{
B2DPolygon aCandidate = rCandidate.getB2DPolygon(a);
- aRetval.expand(tools::getRange(aCandidate));
+ aRetval.expand(getRange(aCandidate));
}
return aRetval;
@@ -594,6 +593,119 @@ namespace basegfx
return aRetval;
}
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PointSequence
+
+ B2DPolyPolygon UnoPointSequenceSequenceToB2DPolyPolygon(
+ const com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceSource,
+ bool bCheckClosed)
+ {
+ B2DPolyPolygon aRetval;
+ const com::sun::star::drawing::PointSequence* pPointSequence = rPointSequenceSequenceSource.getConstArray();
+ const com::sun::star::drawing::PointSequence* pPointSeqEnd = pPointSequence + rPointSequenceSequenceSource.getLength();
+
+ for(;pPointSequence != pPointSeqEnd; pPointSequence++)
+ {
+ const B2DPolygon aNewPolygon = UnoPointSequenceToB2DPolygon(*pPointSequence, bCheckClosed);
+ aRetval.append(aNewPolygon);
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolyPolygonToUnoPointSequenceSequence(
+ const B2DPolyPolygon& rPolyPolygon,
+ com::sun::star::drawing::PointSequenceSequence& rPointSequenceSequenceRetval)
+ {
+ const sal_uInt32 nCount(rPolyPolygon.count());
+
+ if(nCount)
+ {
+ rPointSequenceSequenceRetval.realloc(nCount);
+ com::sun::star::drawing::PointSequence* pPointSequence = rPointSequenceSequenceRetval.getArray();
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(a));
+
+ B2DPolygonToUnoPointSequence(aPolygon, *pPointSequence);
+ pPointSequence++;
+ }
+ }
+ else
+ {
+ rPointSequenceSequenceRetval.realloc(0);
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+ // converters for com::sun::star::drawing::PolyPolygonBezierCoords (curved polygons)
+
+ B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+ const com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsSource,
+ bool bCheckClosed)
+ {
+ B2DPolyPolygon aRetval;
+ const sal_uInt32 nSequenceCount((sal_uInt32)rPolyPolygonBezierCoordsSource.Coordinates.getLength());
+
+ if(nSequenceCount)
+ {
+ OSL_ENSURE(nSequenceCount == (sal_uInt32)rPolyPolygonBezierCoordsSource.Flags.getLength(),
+ "UnoPolyPolygonBezierCoordsToB2DPolyPolygon: unequal number of Points and Flags (!)");
+ const com::sun::star::drawing::PointSequence* pPointSequence = rPolyPolygonBezierCoordsSource.Coordinates.getConstArray();
+ const com::sun::star::drawing::FlagSequence* pFlagSequence = rPolyPolygonBezierCoordsSource.Flags.getConstArray();
+
+ for(sal_uInt32 a(0); a < nSequenceCount; a++)
+ {
+ const B2DPolygon aNewPolygon(UnoPolygonBezierCoordsToB2DPolygon(
+ *pPointSequence,
+ *pFlagSequence,
+ bCheckClosed));
+
+ pPointSequence++;
+ pFlagSequence++;
+ aRetval.append(aNewPolygon);
+ }
+ }
+
+ return aRetval;
+ }
+
+ void B2DPolyPolygonToUnoPolyPolygonBezierCoords(
+ const B2DPolyPolygon& rPolyPolygon,
+ com::sun::star::drawing::PolyPolygonBezierCoords& rPolyPolygonBezierCoordsRetval)
+ {
+ const sal_uInt32 nCount(rPolyPolygon.count());
+
+ if(nCount)
+ {
+ // prepare return value memory
+ rPolyPolygonBezierCoordsRetval.Coordinates.realloc((sal_Int32)nCount);
+ rPolyPolygonBezierCoordsRetval.Flags.realloc((sal_Int32)nCount);
+
+ // get pointers to arrays
+ com::sun::star::drawing::PointSequence* pPointSequence = rPolyPolygonBezierCoordsRetval.Coordinates.getArray();
+ com::sun::star::drawing::FlagSequence* pFlagSequence = rPolyPolygonBezierCoordsRetval.Flags.getArray();
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const B2DPolygon aSource(rPolyPolygon.getB2DPolygon(a));
+
+ B2DPolygonToUnoPolygonBezierCoords(
+ aSource,
+ *pPointSequence,
+ *pFlagSequence);
+ pPointSequence++;
+ pFlagSequence++;
+ }
+ }
+ else
+ {
+ rPolyPolygonBezierCoordsRetval.Coordinates.realloc(0);
+ rPolyPolygonBezierCoordsRetval.Flags.realloc(0);
+ }
+ }
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 1ac1258d7cdd..cdd99f0a34cf 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -806,8 +806,7 @@ namespace basegfx
aCenter_prime.getY());
aTransform.rotate(fPhi*M_PI/180);
const B2DPoint aOffset((p1+p2)/2.0);
- aTransform.translate(aOffset.getX(),
- aOffset.getY());
+ aTransform.translate(aOffset);
aSegment.transform(aTransform);
// createPolygonFromEllipseSegment()
diff --git a/basegfx/source/polygon/b3dpolygon.cxx b/basegfx/source/polygon/b3dpolygon.cxx
index e76d6754afe2..92af01977232 100644
--- a/basegfx/source/polygon/b3dpolygon.cxx
+++ b/basegfx/source/polygon/b3dpolygon.cxx
@@ -794,10 +794,10 @@ class ImplB3DPolygon
// bitfield
// flag which decides if this polygon is opened or closed
- unsigned mbIsClosed : 1;
+ bool mbIsClosed : 1;
// flag which says if maPlaneNormal is up-to-date
- unsigned mbPlaneNormalValid : 1;
+ bool mbPlaneNormalValid : 1;
protected:
void invalidatePlaneNormal()
diff --git a/basegfx/source/polygon/b3dpolygonclipper.cxx b/basegfx/source/polygon/b3dpolygonclipper.cxx
index 0fddb25f9b84..229dc4a62011 100644
--- a/basegfx/source/polygon/b3dpolygonclipper.cxx
+++ b/basegfx/source/polygon/b3dpolygonclipper.cxx
@@ -497,7 +497,7 @@ namespace basegfx
{
// build transform to project planeNormal on X-Axis and pointOnPlane to null point
B3DHomMatrix aMatrixTransform;
- aMatrixTransform.translate(-rPointOnPlane.getX(), -rPointOnPlane.getY(), -rPointOnPlane.getZ());
+ aMatrixTransform.translate(-rPointOnPlane);
const double fRotInXY(atan2(rPlaneNormal.getY(), rPlaneNormal.getX()));
const double fRotInXZ(atan2(-rPlaneNormal.getZ(), rPlaneNormal.getXYLength()));
if(!fTools::equalZero(fRotInXY) || !fTools::equalZero(fRotInXZ))
@@ -536,7 +536,7 @@ namespace basegfx
{
// build transform to project planeNormal on X-Axis and pointOnPlane to null point
B3DHomMatrix aMatrixTransform;
- aMatrixTransform.translate(-rPointOnPlane.getX(), -rPointOnPlane.getY(), -rPointOnPlane.getZ());
+ aMatrixTransform.translate(-rPointOnPlane);
const double fRotInXY(atan2(rPlaneNormal.getY(), rPlaneNormal.getX()));
const double fRotInXZ(atan2(-rPlaneNormal.getZ(), rPlaneNormal.getXYLength()));
if(!fTools::equalZero(fRotInXY) || !fTools::equalZero(fRotInXZ))
diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx
index cd1a96e3d0cd..3efd70f8b68e 100644
--- a/basegfx/source/polygon/b3dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b3dpolypolygontools.cxx
@@ -32,6 +32,7 @@
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <osl/mutex.hxx>
+#include <com/sun/star/drawing/DoubleSequence.hpp>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -541,6 +542,130 @@ namespace basegfx
return equal(rCandidateA, rCandidateB, fSmallValue);
}
+ /// converters for com::sun::star::drawing::PolyPolygonShape3D
+ B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(
+ const com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygonShape3DSource,
+ bool bCheckClosed)
+ {
+ B3DPolyPolygon aRetval;
+ const sal_Int32 nOuterSequenceCount(rPolyPolygonShape3DSource.SequenceX.getLength());
+
+ if(nOuterSequenceCount)
+ {
+ OSL_ENSURE(nOuterSequenceCount == rPolyPolygonShape3DSource.SequenceY.getLength()
+ && nOuterSequenceCount == rPolyPolygonShape3DSource.SequenceZ.getLength(),
+ "UnoPolyPolygonShape3DToB3DPolygon: Not all double sequences have the same length (!)");
+
+ const com::sun::star::drawing::DoubleSequence* pInnerSequenceX = rPolyPolygonShape3DSource.SequenceX.getConstArray();
+ const com::sun::star::drawing::DoubleSequence* pInnerSequenceY = rPolyPolygonShape3DSource.SequenceY.getConstArray();
+ const com::sun::star::drawing::DoubleSequence* pInnerSequenceZ = rPolyPolygonShape3DSource.SequenceZ.getConstArray();
+
+ for(sal_Int32 a(0); a < nOuterSequenceCount; a++)
+ {
+ basegfx::B3DPolygon aNewPolygon;
+ const sal_Int32 nInnerSequenceCount(pInnerSequenceX->getLength());
+ OSL_ENSURE(nInnerSequenceCount == pInnerSequenceY->getLength()
+ && nInnerSequenceCount == pInnerSequenceZ->getLength(),
+ "UnoPolyPolygonShape3DToB3DPolygon: Not all double sequences have the same length (!)");
+
+ const double* pArrayX = pInnerSequenceX->getConstArray();
+ const double* pArrayY = pInnerSequenceY->getConstArray();
+ const double* pArrayZ = pInnerSequenceZ->getConstArray();
+
+ for(sal_Int32 b(0); b < nInnerSequenceCount; b++)
+ {
+ aNewPolygon.append(basegfx::B3DPoint(*pArrayX++,*pArrayY++,*pArrayZ++));
+ }
+
+ pInnerSequenceX++;
+ pInnerSequenceY++;
+ pInnerSequenceZ++;
+
+ // #i101520# correction is needed for imported polygons of old format,
+ // see callers
+ if(bCheckClosed)
+ {
+ basegfx::tools::checkClosed(aNewPolygon);
+ }
+
+ aRetval.append(aNewPolygon);
+ }
+ }
+
+ return aRetval;
+ }
+
+ void B3DPolyPolygonToUnoPolyPolygonShape3D(
+ const B3DPolyPolygon& rPolyPolygonSource,
+ com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygonShape3DRetval)
+ {
+ const sal_uInt32 nPolygonCount(rPolyPolygonSource.count());
+
+ if(nPolygonCount)
+ {
+ rPolyPolygonShape3DRetval.SequenceX.realloc(nPolygonCount);
+ rPolyPolygonShape3DRetval.SequenceY.realloc(nPolygonCount);
+ rPolyPolygonShape3DRetval.SequenceZ.realloc(nPolygonCount);
+
+ com::sun::star::drawing::DoubleSequence* pOuterSequenceX = rPolyPolygonShape3DRetval.SequenceX.getArray();
+ com::sun::star::drawing::DoubleSequence* pOuterSequenceY = rPolyPolygonShape3DRetval.SequenceY.getArray();
+ com::sun::star::drawing::DoubleSequence* pOuterSequenceZ = rPolyPolygonShape3DRetval.SequenceZ.getArray();
+
+ for(sal_uInt32 a(0); a < nPolygonCount; a++)
+ {
+ const basegfx::B3DPolygon aPoly(rPolyPolygonSource.getB3DPolygon(a));
+ const sal_uInt32 nPointCount(aPoly.count());
+
+ if(nPointCount)
+ {
+ const bool bIsClosed(aPoly.isClosed());
+ const sal_uInt32 nTargetCount(bIsClosed ? nPointCount + 1 : nPointCount);
+ pOuterSequenceX->realloc(nTargetCount);
+ pOuterSequenceY->realloc(nTargetCount);
+ pOuterSequenceZ->realloc(nTargetCount);
+
+ double* pInnerSequenceX = pOuterSequenceX->getArray();
+ double* pInnerSequenceY = pOuterSequenceY->getArray();
+ double* pInnerSequenceZ = pOuterSequenceZ->getArray();
+
+ for(sal_uInt32 b(0); b < nPointCount; b++)
+ {
+ const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(b));
+
+ *pInnerSequenceX++ = aPoint.getX();
+ *pInnerSequenceY++ = aPoint.getY();
+ *pInnerSequenceZ++ = aPoint.getZ();
+ }
+
+ if(bIsClosed)
+ {
+ const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(0));
+
+ *pInnerSequenceX++ = aPoint.getX();
+ *pInnerSequenceY++ = aPoint.getY();
+ *pInnerSequenceZ++ = aPoint.getZ();
+ }
+ }
+ else
+ {
+ pOuterSequenceX->realloc(0);
+ pOuterSequenceY->realloc(0);
+ pOuterSequenceZ->realloc(0);
+ }
+
+ pOuterSequenceX++;
+ pOuterSequenceY++;
+ pOuterSequenceZ++;
+ }
+ }
+ else
+ {
+ rPolyPolygonShape3DRetval.SequenceX.realloc(0);
+ rPolyPolygonShape3DRetval.SequenceY.realloc(0);
+ rPolyPolygonShape3DRetval.SequenceZ.realloc(0);
+ }
+ }
+
} // end of namespace tools
} // end of namespace basegfx
diff --git a/basegfx/source/range/b2drange.cxx b/basegfx/source/range/b2drange.cxx
index 995bb3b221e4..8e447cfa1705 100644
--- a/basegfx/source/range/b2drange.cxx
+++ b/basegfx/source/range/b2drange.cxx
@@ -58,6 +58,19 @@ namespace basegfx
}
}
+ B2DRange& B2DRange::operator*=( const ::basegfx::B2DHomMatrix& rMat )
+ {
+ transform(rMat);
+ return *this;
+ }
+
+ const B2DRange& B2DRange::getUnitB2DRange()
+ {
+ static const B2DRange aUnitB2DRange(0.0, 0.0, 1.0, 1.0);
+
+ return aUnitB2DRange;
+ }
+
B2IRange fround(const B2DRange& rRange)
{
return rRange.isEmpty() ?
@@ -65,6 +78,12 @@ namespace basegfx
B2IRange(fround(rRange.getMinimum()),
fround(rRange.getMaximum()));
}
+
+ B2DRange operator*( const ::basegfx::B2DHomMatrix& rMat, const B2DRange& rB2DRange )
+ {
+ B2DRange aRes( rB2DRange );
+ return aRes *= rMat;
+ }
} // end of namespace basegfx
// eof
diff --git a/basegfx/source/range/b3drange.cxx b/basegfx/source/range/b3drange.cxx
index bab2d3c91579..319a189c03d6 100644
--- a/basegfx/source/range/b3drange.cxx
+++ b/basegfx/source/range/b3drange.cxx
@@ -64,6 +64,19 @@ namespace basegfx
}
}
+ B3DRange& B3DRange::operator*=( const ::basegfx::B3DHomMatrix& rMat )
+ {
+ transform(rMat);
+ return *this;
+ }
+
+ const B3DRange& B3DRange::getUnitB3DRange()
+ {
+ static const B3DRange aUnitB3DRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
+
+ return aUnitB3DRange;
+ }
+
B3IRange fround(const B3DRange& rRange )
{
return rRange.isEmpty() ?
@@ -76,6 +89,11 @@ namespace basegfx
fround(rRange.getMaxZ()));
}
+ B3DRange operator*( const ::basegfx::B3DHomMatrix& rMat, const B3DRange& rB3DRange )
+ {
+ B3DRange aRes( rB3DRange );
+ return aRes *= rMat;
+ }
} // end of namespace basegfx
// eof
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx
index 64678ca8c6a6..6e0c8cc13800 100644
--- a/basic/inc/basic/basmgr.hxx
+++ b/basic/inc/basic/basmgr.hxx
@@ -166,7 +166,6 @@ protected:
~BasicManager();
public:
- TYPEINFO();
BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib = NULL, String* pLibPath = NULL, sal_Bool bDocMgr = sal_False );
BasicManager( StarBASIC* pStdLib, String* pLibPath = NULL, sal_Bool bDocMgr = sal_False );
diff --git a/basic/inc/basic/mybasic.hxx b/basic/inc/basic/mybasic.hxx
index 90467dc06198..d5aebb164e1c 100644
--- a/basic/inc/basic/mybasic.hxx
+++ b/basic/inc/basic/mybasic.hxx
@@ -62,7 +62,6 @@ protected:
public:
SBX_DECL_PERSIST_NODATA(SBXCR_TEST,SBXID_MYBASIC,1);
- TYPEINFO();
ErrorList aErrors;
MyBasic();
virtual ~MyBasic();
diff --git a/basic/inc/basic/sbmeth.hxx b/basic/inc/basic/sbmeth.hxx
index ebe1d07eaf06..4a37e3c64ca6 100644
--- a/basic/inc/basic/sbmeth.hxx
+++ b/basic/inc/basic/sbmeth.hxx
@@ -56,7 +56,6 @@ class SbMethod : public SbxMethod
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMETHOD,2);
- TYPEINFO();
virtual SbxInfo* GetInfo();
SbxArray* GetLocals();
SbxArray* GetStatics();
@@ -84,7 +83,6 @@ class SbIfaceMapperMethod : public SbMethod
SbMethodRef mxImplMeth;
public:
- TYPEINFO();
SbIfaceMapperMethod( const String& rName, SbMethod* pImplMeth )
: SbMethod( rName, pImplMeth->GetType(), NULL )
, mxImplMeth( pImplMeth )
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index 3632dc9d5d76..a6d683b0dd34 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -98,7 +98,6 @@ protected:
virtual ~SbModule();
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2);
- TYPEINFO();
SbModule( const String&, sal_Bool bCompat = sal_False );
virtual void SetParent( SbxObject* );
virtual void Clear();
@@ -164,7 +163,6 @@ class SbClassModuleObject : public SbModule
bool mbInitializeEventDone;
public:
- TYPEINFO();
SbClassModuleObject( SbModule* pClassModule );
~SbClassModuleObject();
diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx
index 1c5f2bc6a352..550e7b190e13 100644
--- a/basic/inc/basic/sbobjmod.hxx
+++ b/basic/inc/basic/sbobjmod.hxx
@@ -44,7 +44,6 @@ protected:
virtual ~SbObjModule();
public:
- TYPEINFO();
SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible );
virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
@@ -72,7 +71,6 @@ class SbUserFormModule : public SbObjModule
//protected:
virtual void InitObject();
public:
- TYPEINFO();
SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat );
virtual ~SbUserFormModule();
virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
diff --git a/basic/inc/basic/sbprop.hxx b/basic/inc/basic/sbprop.hxx
index d41013ccc750..daf81dfd55b9 100644
--- a/basic/inc/basic/sbprop.hxx
+++ b/basic/inc/basic/sbprop.hxx
@@ -40,7 +40,6 @@ class SbProperty : public SbxProperty
virtual ~SbProperty();
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICPROP,1);
- TYPEINFO();
SbModule* GetModule() { return pMod; }
};
@@ -60,7 +59,6 @@ public:
: SbxProperty( r, t ) // , pMod( p )
, mbSet( false )
{}
- TYPEINFO();
bool isSet( void )
{ return mbSet; }
diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index 0de7831d5120..768fc2b06555 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -97,7 +97,6 @@ protected:
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASIC,1);
- TYPEINFO();
StarBASIC( StarBASIC* pParent = NULL, sal_Bool bIsDocBasic = sal_False );
diff --git a/basic/inc/basic/sbstdobj.hxx b/basic/inc/basic/sbstdobj.hxx
index c04ade916a3e..e915f6153b4b 100644
--- a/basic/inc/basic/sbstdobj.hxx
+++ b/basic/inc/basic/sbstdobj.hxx
@@ -60,8 +60,6 @@ protected:
void PropHeight( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
public:
- TYPEINFO();
-
SbStdPicture();
virtual SbxVariable* Find( const String&, SbxClassType );
@@ -94,8 +92,6 @@ protected:
void PropName( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite );
public:
- TYPEINFO();
-
SbStdFont();
virtual SbxVariable* Find( const String&, SbxClassType );
@@ -132,8 +128,6 @@ protected:
void MethSetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite );
public:
- TYPEINFO();
-
SbStdClipboard();
virtual SbxVariable* Find( const String&, SbxClassType );
};
diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx
index 7f4bae5f4d36..0c05867ca55b 100644
--- a/basic/inc/basic/sbx.hxx
+++ b/basic/inc/basic/sbx.hxx
@@ -125,7 +125,6 @@ class SbxHint : public SfxSimpleHint
{
SbxVariable* pVar;
public:
- TYPEINFO();
SbxHint( sal_uIntPtr n, SbxVariable* v ) : SfxSimpleHint( n ), pVar( v ) {}
SbxVariable* GetVar() const { return pVar; }
};
@@ -182,7 +181,6 @@ protected:
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_ARRAY,1);
- TYPEINFO();
SbxArray( SbxDataType=SbxVARIANT );
SbxArray( const SbxArray& );
SbxArray& operator=( const SbxArray& );
@@ -239,7 +237,6 @@ protected:
virtual ~SbxDimArray();
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_DIMARRAY,1);
- TYPEINFO();
SbxDimArray( SbxDataType=SbxVARIANT );
SbxDimArray( const SbxDimArray& );
SbxDimArray& operator=( const SbxDimArray& );
@@ -292,7 +289,6 @@ protected:
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_COLLECTION,1);
- TYPEINFO();
SbxCollection( const String& rClassname );
SbxCollection( const SbxCollection& );
SbxCollection& operator=( const SbxCollection& );
@@ -318,7 +314,6 @@ protected:
virtual void CollRemove( SbxArray* pPar );
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_FIXCOLLECTION,1);
- TYPEINFO();
SbxStdCollection
( const String& rClassname, const String& rElemClass, sal_Bool=sal_True );
SbxStdCollection( const SbxStdCollection& );
diff --git a/basic/inc/basic/sbxcore.hxx b/basic/inc/basic/sbxcore.hxx
index 47ed192ee8d3..dc833b4274b7 100644
--- a/basic/inc/basic/sbxcore.hxx
+++ b/basic/inc/basic/sbxcore.hxx
@@ -24,10 +24,8 @@
#ifndef _SBXCORE_HXX
#define _SBXCORE_HXX
-#include <tools/rtti.hxx>
#include <tools/ref.hxx>
#include <tools/debug.hxx>
-
#include <basic/sbxdef.hxx>
class SvStream;
@@ -89,7 +87,6 @@ protected:
virtual ~SbxBase();
SBX_DECL_PERSIST(0,0,0);
public:
- TYPEINFO();
inline void SetFlags( sal_uInt16 n );
inline sal_uInt16 GetFlags() const;
inline void SetFlag( sal_uInt16 n );
diff --git a/basic/inc/basic/sbxmeth.hxx b/basic/inc/basic/sbxmeth.hxx
index dc25ee9d91a1..a5792772dc23 100644
--- a/basic/inc/basic/sbxmeth.hxx
+++ b/basic/inc/basic/sbxmeth.hxx
@@ -34,7 +34,6 @@ class SbxMethod : public SbxVariable
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_METHOD,1);
- TYPEINFO();
SbxMethod( const String& r, SbxDataType t )
: SbxVariable( t ) { SetName( r ); }
SbxMethod( const SbxMethod& r ) : SvRefBase( r ), SbxVariable( r ) {}
diff --git a/basic/inc/basic/sbxobj.hxx b/basic/inc/basic/sbxobj.hxx
index 989ea40725d3..748ec857d27f 100644
--- a/basic/inc/basic/sbxobj.hxx
+++ b/basic/inc/basic/sbxobj.hxx
@@ -55,7 +55,6 @@ protected:
const SfxHint& rHint, const TypeId& rHintType );
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_OBJECT,1);
- TYPEINFO();
SbxObject( const String& rClassname );
SbxObject( const SbxObject& );
SbxObject& operator=( const SbxObject& );
diff --git a/basic/inc/basic/sbxprop.hxx b/basic/inc/basic/sbxprop.hxx
index 660ddfca5dbd..11950fd1c18c 100644
--- a/basic/inc/basic/sbxprop.hxx
+++ b/basic/inc/basic/sbxprop.hxx
@@ -34,7 +34,6 @@ class SbxProperty : public SbxVariable
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_PROPERTY,1);
- TYPEINFO();
SbxProperty( const String& r, SbxDataType t )
: SbxVariable( t ) { SetName( r ); }
SbxProperty( const SbxProperty& r ) : SvRefBase( r ), SbxVariable( r ) {}
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx
index 4103b0ad2a4d..b38725261895 100644
--- a/basic/inc/basic/sbxvar.hxx
+++ b/basic/inc/basic/sbxvar.hxx
@@ -242,7 +242,6 @@ protected:
virtual sal_Bool StoreData( SvStream& ) const;
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VALUE,1);
- TYPEINFO();
SbxValue();
SbxValue( SbxDataType, void* = NULL );
SbxValue( const SbxValue& );
@@ -458,7 +457,6 @@ protected:
virtual sal_Bool StoreData( SvStream& ) const;
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VARIABLE,2);
- TYPEINFO();
SbxVariable();
SbxVariable( SbxDataType, void* = NULL );
SbxVariable( const SbxVariable& );
diff --git a/basic/inc/basic/testtool.hxx b/basic/inc/basic/testtool.hxx
index 0273392b8ecf..a059db9834d1 100644
--- a/basic/inc/basic/testtool.hxx
+++ b/basic/inc/basic/testtool.hxx
@@ -133,7 +133,6 @@ private:
String maAdditionalExecutionStatus;
public:
- TYPEINFO();
TTExecutionStatusHint( sal_uInt16 nType, sal_Char *pExecutionStatus, const sal_Char *pAdditionalExecutionStatus = "" )
: SfxSimpleHint(SBX_HINT_EXECUTION_STATUS_INFORMATION)
, mnType( nType )
@@ -150,7 +149,7 @@ public:
const String& GetExecutionStatus() const { return maExecutionStatus; }
const String& GetAdditionalExecutionStatus() const { return maAdditionalExecutionStatus; }
- sal_uInt16 GetType(){ return mnType; }
+ sal_uInt16 GetType() const { return mnType; }
};
#endif // _BASIC_TESTTOOL_HXX_
diff --git a/basic/inc/pch/precompiled_basic.hxx b/basic/inc/pch/precompiled_basic.hxx
index 4549056ffcf2..5349a09b4a0b 100644
--- a/basic/inc/pch/precompiled_basic.hxx
+++ b/basic/inc/pch/precompiled_basic.hxx
@@ -212,7 +212,6 @@
#include "tools/rcid.h"
#include "tools/ref.hxx"
#include "tools/resid.hxx"
-#include "tools/rtti.hxx"
#include "tools/shl.hxx"
#include "tools/solar.h"
#include "tools/stream.hxx"
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 2913ae4e2c44..5ed597033fb7 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -395,8 +395,12 @@ void BasicApp::LoadIniFile()
void BasicApp::SetFocus()
{
- if( pFrame->pWork && pFrame->pWork->ISA(AppEdit) )
- ((AppEdit*)pFrame->pWork)->pDataEdit->GrabFocus();
+ AppEdit* pAppEdit = dynamic_cast< AppEdit* >(pFrame->pWork);
+
+ if( pAppEdit )
+ {
+ pAppEdit->pDataEdit->GrabFocus();
+ }
}
IMPL_LINK( BasicApp, LateInit, void *, pDummy )
@@ -516,8 +520,6 @@ IMPL_LINK(FloatingExecutionStatus, HideNow, FloatingExecutionStatus*, pFLC )
//////////////////////////////////////////////////////////////////////////
-TYPEINIT1(TTExecutionStatusHint, SfxSimpleHint);
-
BasicFrame::BasicFrame() : WorkWindow( NULL,
WinBits( WB_APP | WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) )
, bIsAutoRun( sal_False )
@@ -785,9 +787,10 @@ void BasicFrame::SetAutoRun( sal_Bool bAuto )
void BasicFrame::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( TTExecutionStatusHint ) )
+ const TTExecutionStatusHint* pStatusHint = dynamic_cast< const TTExecutionStatusHint* >(&rHint);
+
+ if ( pStatusHint )
{
- TTExecutionStatusHint *pStatusHint = ( TTExecutionStatusHint* )&rHint;
switch ( pStatusHint->GetType() )
{
case TT_EXECUTION_ENTERWAIT:
@@ -1064,7 +1067,18 @@ sal_Bool BasicFrame::CompileAll()
{
AppWin* p;
for( p = pList->First(); p; p = pList->Next() )
- if( p->ISA(AppBasEd) && !((AppBasEd*)p)->Compile() ) return sal_False;
+ {
+ AppBasEd* pAppBasEd = dynamic_cast< AppBasEd* >(p);
+
+ if(pAppBasEd)
+ {
+ if(!pAppBasEd->Compile())
+ {
+ return sal_False;
+ }
+ }
+ }
+
return sal_True;
}
@@ -1247,7 +1261,7 @@ IMPL_LINK_INLINE_START( BasicFrame, ShowLineNr, AutoTimer *, pTimer )
{
(void) pTimer; /* avoid warning about unused parameter */
String aPos;
- if ( pWork && pWork->ISA(AppBasEd))
+ if ( pWork && dynamic_cast< AppBasEd* >(pWork))
{
aPos = String::CreateFromInt32(pWork->GetLineNr());
}
@@ -1388,9 +1402,12 @@ long BasicFrame::Command( short nID, sal_Bool bChecked )
nFlags = SbDEBUG_STEPINTO;
goto start;
case RID_RUNTOCURSOR:
- if ( pWork && pWork->ISA(AppBasEd) && ((AppBasEd*)pWork)->GetModule()->SetBP(pWork->GetLineNr()) )
{
- SbModule *pModule = ((AppBasEd*)pWork)->GetModule();
+ AppBasEd* pAppBasEd = dynamic_cast< AppBasEd* >(pWork);
+
+ if ( pAppBasEd && pAppBasEd->GetModule()->SetBP(pWork->GetLineNr()) )
+ {
+ SbModule *pModule = pAppBasEd->GetModule();
#if OSL_DEBUG_LEVEL > 1
sal_uInt16 x;
x = pWork->GetLineNr();
@@ -1409,20 +1426,21 @@ long BasicFrame::Command( short nID, sal_Bool bChecked )
}
nFlags = SbDEBUG_BREAK;
goto start;
+ }
start: {
// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN ));
if ( !Basic().IsRunning() || bInBreak )
{
- AppBasEd* p = NULL;
- if( pWork && pWork->ISA(AppBasEd) )
+ AppBasEd* p = dynamic_cast< AppBasEd* >(pWork);
+
+ if( p )
{
- p = ((AppBasEd*)pWork);
p->ToTop();
}
else
{
AppWin *w = NULL;
- for ( w = pList->Last() ; w ? !w->ISA(AppBasEd) : sal_False ; w = pList->Prev() ) ;
+ for ( w = pList->Last() ; w ? !dynamic_cast< AppBasEd* >(w) : sal_False ; w = pList->Prev() ) ;
if ( w )
{
p = ((AppBasEd*)w);
@@ -1456,13 +1474,17 @@ long BasicFrame::Command( short nID, sal_Bool bChecked )
// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); // after run
break;
case RID_RUNCOMPILE:
- if( pWork && pWork->ISA(AppBasEd) && SaveAll() )
{
- ((AppBasEd*)pWork)->Compile();
+ AppBasEd* pAppBasEd = dynamic_cast< AppBasEd* >(pWork);
+
+ if( pAppBasEd && SaveAll() )
+ {
+ pAppBasEd->Compile();
pWork->ToTop();
pWork->GrabFocus();
}
break;
+ }
case RID_RUNDISAS:
bDisas = sal_Bool( !bChecked );
break;
@@ -1664,8 +1686,12 @@ AppBasEd* BasicFrame::FindModuleWin( const String& rName )
AppWin* p;
for( p = pList->First(); p; p = pList->Next() )
{
- if( p->ISA(AppBasEd) && ((AppBasEd*)p)->GetModName() == rName )
- return ((AppBasEd*)p);
+ AppBasEd* pAppBasEd = dynamic_cast< AppBasEd* >(p);
+
+ if( pAppBasEd && pAppBasEd->GetModName() == rName )
+ {
+ return pAppBasEd;
+ }
}
return NULL;
}
@@ -1675,8 +1701,12 @@ AppError* BasicFrame::FindErrorWin( const String& rName )
AppWin* p;
for( p = pList->First(); p; p = pList->Next() )
{
- if( p->ISA(AppError) && ((AppError*)p)->GetText() == rName )
- return ((AppError*)p);
+ AppError* pAppError = dynamic_cast< AppError* >(p);
+
+ if( pAppError && pAppError->GetText() == rName )
+ {
+ return pAppError;
+ }
}
return NULL;
}
@@ -1858,7 +1888,7 @@ void BasicFrame::LoadLibrary()
CloseAll();
SvFileStream aStrm( s, STREAM_STD_READ );
MyBasic* pNew = (MyBasic*) SbxBase::Load( aStrm );
- if( pNew && pNew->ISA( MyBasic ) )
+ if( dynamic_cast< MyBasic* >(pNew) )
{
pBasic = pNew;
// Show all contents if existing
diff --git a/basic/source/app/appbased.cxx b/basic/source/app/appbased.cxx
index 0afee7ecdbd8..7353c65bb188 100644
--- a/basic/source/app/appbased.cxx
+++ b/basic/source/app/appbased.cxx
@@ -45,7 +45,6 @@
#include "basrid.hxx"
-TYPEINIT1(AppBasEd,AppEdit);
AppBasEd::AppBasEd( BasicFrame* pParent, SbModule* p )
: AppEdit( pParent )
, pBreakpoints( NULL )
@@ -103,7 +102,7 @@ AppBasEd::~AppBasEd()
void AppBasEd::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- const SfxSimpleHint* p = PTR_CAST(SfxSimpleHint,&rHint);
+ const SfxSimpleHint* p = dynamic_cast< const SfxSimpleHint* >( &rHint);
if( p )
{
sal_uIntPtr nHintId = p->GetId();
diff --git a/basic/source/app/appbased.hxx b/basic/source/app/appbased.hxx
index ebdc39296d38..854172898697 100644
--- a/basic/source/app/appbased.hxx
+++ b/basic/source/app/appbased.hxx
@@ -47,7 +47,6 @@ protected:
virtual sal_uInt16 ImplSave(); // Save file
public:
- TYPEINFO();
AppBasEd( BasicFrame*, SbModule* );
~AppBasEd();
FileType GetFileType(); // Returns Filetype
diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx
index 700027a035fd..3d42ddb0a335 100644
--- a/basic/source/app/appedit.cxx
+++ b/basic/source/app/appedit.cxx
@@ -37,7 +37,6 @@
#include "appedit.hxx"
#include "brkpnts.hxx"
-TYPEINIT1(AppEdit,AppWin);
AppEdit::AppEdit( BasicFrame* pParent )
: AppWin( pParent )
, pVScroll( NULL )
diff --git a/basic/source/app/appedit.hxx b/basic/source/app/appedit.hxx
index 11c8c6a445e2..75e9a2ec4e32 100644
--- a/basic/source/app/appedit.hxx
+++ b/basic/source/app/appedit.hxx
@@ -46,7 +46,6 @@ private:
protected:
DECL_LINK( Scroll, ScrollBar* );
public:
- TYPEINFO();
AppEdit( BasicFrame* );
~AppEdit();
sal_uInt16 GetLineNr(); // Current line number
diff --git a/basic/source/app/apperror.cxx b/basic/source/app/apperror.cxx
index bfb6bb66e163..c4f0dfde846e 100644
--- a/basic/source/app/apperror.cxx
+++ b/basic/source/app/apperror.cxx
@@ -31,7 +31,6 @@
#include "basic.hrc"
#include "apperror.hxx"
-TYPEINIT1(AppError,AppWin);
AppError::AppError( BasicFrame* pParent, String aFileName )
: AppWin( pParent )
{
diff --git a/basic/source/app/apperror.hxx b/basic/source/app/apperror.hxx
index 1f65f4fe56f4..3ca36d3a1afa 100644
--- a/basic/source/app/apperror.hxx
+++ b/basic/source/app/apperror.hxx
@@ -29,7 +29,6 @@ class AppError : public AppWin
protected:
DECL_LINK( EditChange, MsgEdit * );
public:
- TYPEINFO();
AppError( BasicFrame*, String );
~AppError();
// long Command( short nID );
diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx
index 233e5799e38a..b0ab8852ed1b 100644
--- a/basic/source/app/appwin.cxx
+++ b/basic/source/app/appwin.cxx
@@ -44,7 +44,6 @@ String *AppWin::pNoName = NULL; // contains the "Untitled"-String
short AppWin::nNumber = 0; // consecutive number
short AppWin::nCount = 0; // number of edit windows
-TYPEINIT0(AppWin);
AppWin::AppWin( BasicFrame* pParent )
: DockingWindow( pParent, WB_SIZEMOVE | WB_CLOSEABLE | WB_PINABLE )
, nSkipReload(0)
diff --git a/basic/source/app/appwin.hxx b/basic/source/app/appwin.hxx
index 4416ff46673f..e65f10e62740 100644
--- a/basic/source/app/appwin.hxx
+++ b/basic/source/app/appwin.hxx
@@ -85,7 +85,6 @@ protected:
sal_uInt16 nWinId;
public:
- TYPEINFO();
AppWin( BasicFrame* );
~AppWin();
DataEdit* pDataEdit; // Data area
diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx
index 5bb25628ed49..d3c0ace4ee2d 100644
--- a/basic/source/app/msgedit.cxx
+++ b/basic/source/app/msgedit.cxx
@@ -810,8 +810,11 @@ sal_Bool TTTreeListBox::JumpToSourcecode( SvLBoxEntry *pThisEntry )
else
pBasicFrame->LoadFile( aFilename );
- if ( pBasicFrame->pWork && pBasicFrame->pWork->ISA(AppEdit) )
- ((AppEdit*)pBasicFrame->pWork)->Highlight( aData->nLine, aData->nCol1, aData->nCol2 );
+ AppEdit* pAppEdit = dynamic_cast< AppEdit* >(pBasicFrame->pWork);
+
+ if ( pAppEdit )
+ pAppEdit->Highlight( aData->nLine, aData->nCol1, aData->nCol2 );
+
return sal_False;
}
return sal_True;
diff --git a/basic/source/app/mybasic.cxx b/basic/source/app/mybasic.cxx
index 204ad14eca72..ed564616c935 100644
--- a/basic/source/app/mybasic.cxx
+++ b/basic/source/app/mybasic.cxx
@@ -56,8 +56,6 @@
#include "processw.hxx"
#include "basrid.hxx"
-TYPEINIT1(MyBasic,StarBASIC)
-
class MyFactory : public SbxFactory
{
public:
diff --git a/basic/source/app/processw.cxx b/basic/source/app/processw.cxx
index aeb627c6d86f..42c4779e444a 100644
--- a/basic/source/app/processw.cxx
+++ b/basic/source/app/processw.cxx
@@ -159,7 +159,7 @@ SbxVariable* ProcessWrapper::Find( const String& rName, SbxClassType t )
void ProcessWrapper::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT,
const SfxHint& rHint, const TypeId& rHT )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/basic/source/app/textedit.cxx b/basic/source/app/textedit.cxx
index 6e5e057a85f0..d7c386f41569 100644
--- a/basic/source/app/textedit.cxx
+++ b/basic/source/app/textedit.cxx
@@ -86,10 +86,11 @@ sal_Bool TextEditImp::ViewMoved()
void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
(void) rBC; /* avoid warning about unused parameter */
- if ( rHint.ISA( TextHint ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
- const TextHint& rTextHint = (const TextHint&)rHint;
- if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
+ if( pTextHint->GetId() == TEXT_HINT_VIEWSCROLLED )
{
pAppEdit->pHScroll->SetThumbPos( pTextView->GetStartDocPos().X() );
pAppEdit->pVScroll->SetThumbPos( pTextView->GetStartDocPos().Y() );
@@ -97,7 +98,7 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->Scroll( 0, ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->GetCurYOffset() - pTextView->GetStartDocPos().Y() );
bViewMoved = sal_True;
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
{
if ( pTextView->GetStartDocPos().Y() )
{
@@ -109,7 +110,7 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
pAppEdit->SetScrollBarRanges();
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTFORMATTED )
{
sal_uIntPtr nWidth = pTextEngine->CalcTextWidth();
if ( (sal_uIntPtr)nWidth != pAppEdit->nCurTextWidth )
@@ -122,23 +123,23 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if( rTextHint.GetId() == TEXT_HINT_PARAINSERTED )
+ else if( pTextHint->GetId() == TEXT_HINT_PARAINSERTED )
{
if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() )
- ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, sal_True );
+ ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( pTextHint->GetValue()+1, sal_True );
}
- else if( rTextHint.GetId() == TEXT_HINT_PARAREMOVED )
+ else if( pTextHint->GetId() == TEXT_HINT_PARAREMOVED )
{
if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() )
- ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, sal_False );
+ ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( pTextHint->GetValue()+1, sal_False );
// Itchy adaption for two signs at line ends instead of one (hard coded default)
pTextEngine->SetMaxTextLen( STRING_MAXLEN - pTextEngine->GetParagraphCount() );
}
- else if( rTextHint.GetId() == TEXT_HINT_FORMATPARA )
+ else if( pTextHint->GetId() == TEXT_HINT_FORMATPARA )
{
DoDelayedSyntaxHighlight(
- sal::static_int_cast< xub_StrLen >( rTextHint.GetValue() ) );
+ sal::static_int_cast< xub_StrLen >( pTextHint->GetValue() ) );
if ( pTextView->GetTextEngine()->IsModified() )
ModifyHdl.Call( NULL );
}
@@ -243,31 +244,31 @@ void TextEditImp::ImpDoHighlight( const String& rSource, sal_uIntPtr nLineOff )
}
}
- // Es muessen nur die Blanks und Tabs mit attributiert werden.
- // If there are two equal attributes one after another,
- // they are optimized by the EditEngine.
- xub_StrLen nLastEnd = 0;
+ // Es muessen nur die Blanks und Tabs mit attributiert werden.
+ // If there are two equal attributes one after another,
+ // they are optimized by the EditEngine.
+ xub_StrLen nLastEnd = 0;
#ifdef DBG_UTIL
- xub_StrLen nLine1 = aPortionList[0].nLine;
+ xub_StrLen nLine1 = aPortionList[0].nLine;
#endif
- for ( i = 0; i < nCount; i++ )
- {
- SbTextPortion& r = aPortionList[i];
- DBG_ASSERT( r.nLine == nLine1, "doch mehrere Zeilen ?" );
- DBG_ASSERT( r.nStart <= r.nEnd, "Highlight: Start > End?" );
- if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoben
- continue;
+ for ( i = 0; i < nCount; i++ )
+ {
+ SbTextPortion& r = aPortionList[i];
+ DBG_ASSERT( r.nLine == nLine1, "doch mehrere Zeilen ?" );
+ DBG_ASSERT( r.nStart <= r.nEnd, "Highlight: Start > End?" );
+ if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoben
+ continue;
- if ( r.nStart > nLastEnd )
- {
- // Kann ich mich drauf verlassen, dass alle ausser
- // Blank und Tab gehighlightet wird ?!
- r.nStart = nLastEnd;
- }
- nLastEnd = r.nEnd+1;
- if ( ( i == (nCount-1) ) && ( r.nEnd < rSource.Len() ) )
- r.nEnd = rSource.Len()-1;
+ if ( r.nStart > nLastEnd )
+ {
+ // Kann ich mich drauf verlassen, dass alle ausser
+ // Blank und Tab gehighlightet wird ?!
+ r.nStart = nLastEnd;
}
+ nLastEnd = r.nEnd+1;
+ if ( ( i == (nCount-1) ) && ( r.nEnd < rSource.Len() ) )
+ r.nEnd = rSource.Len()-1;
+ }
sal_Bool bWasModified = pTextEngine->IsModified();
for ( i = 0; i < aPortionList.Count(); i++ )
@@ -566,21 +567,25 @@ IMPL_LINK( TextEditImp, ShowVarContents, void*, EMPTYARG )
SbxBase* pSBX = GetSbxAtMousePos( aWord );
String aHelpText;
Point aPos = GetPointerPosPixel();
+ SbxVariable* pVar = dynamic_cast< SbxVariable* >(pSBX);
- if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) )
+ if ( pVar && !dynamic_cast< SbxMethod* >(pSBX) )
{
- SbxVariable* pVar = (SbxVariable*)pSBX;
SbxDataType eType = pVar->GetType();
if ( eType == SbxOBJECT )
{
// Can cause a crash: Type == Object does not mean pVar == Object
- if ( pVar->GetObject() && pVar->GetObject()->ISA( SbxObject ) )
- aHelpText = ((SbxObject*)(pVar->GetObject()))->GetClassName();
+ SbxObject* pSbxObject = dynamic_cast< SbxObject* >(pVar->GetObject());
+
+ if ( pSbxObject )
+ aHelpText = pSbxObject->GetClassName();
else
aHelpText = CUniString("Object");
}
else if ( eType & SbxARRAY )
+ {
aHelpText = CUniString("{...}");
+ }
else if ( eType != SbxEMPTY )
{
aHelpText = pVar->GetName();
@@ -617,9 +622,10 @@ void TextEditImp::BuildKontextMenu( PopupMenu *&pMenu )
{
String aWord;
SbxBase* pSBX = GetSbxAtMousePos( aWord );
- if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) )
+ SbxVariable* pVar = dynamic_cast< SbxVariable* >(pSBX);
+
+ if ( pVar && !dynamic_cast< SbxMethod* >(pSBX) )
{
- SbxVariable* pVar = (SbxVariable*)pSBX;
SbxDataType eType = pVar->GetType();
if ( ( eType & ( SbxVECTOR | SbxARRAY | SbxBYREF )) == 0 )
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index ced77e813951..f156e99daea8 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -106,7 +106,6 @@ static const char* szImbedded = "LIBIMBEDDED";
static const char* szCryptingKey = "CryptedBasic";
static const char* szScriptLanguage = "StarBasic";
-TYPEINIT1( BasicManager, SfxBroadcaster );
DBG_NAME( BasicManager );
StreamMode eStreamReadMode = STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL;
@@ -1283,9 +1282,10 @@ sal_Bool BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic )
sal_Bool bLoaded = sal_False;
if( xNew.Is() )
{
- if( xNew->IsA( TYPE(StarBASIC) ) )
+ StarBASIC* pNew = dynamic_cast< StarBASIC* >((SbxBase*) xNew);
+
+ if( pNew )
{
- StarBASIC* pNew = (StarBASIC*)(SbxBase*) xNew;
// Use the Parent of the old BASICs
if( rOldBasic.Is() )
{
@@ -2258,8 +2258,9 @@ sal_Bool DialogContainer_Impl::hasElements()
sal_Int16 nCount = mpLib->GetObjects()->Count();
for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ )
{
- SbxVariable* pVar = mpLib->GetObjects()->Get( nObj );
- if ( pVar->ISA( SbxObject ) && ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) )
+ SbxObject* pVar = dynamic_cast< SbxObject* >(mpLib->GetObjects()->Get( nObj ));
+
+ if ( pVar && pVar->GetSbxId() == SBXID_DIALOG )
{
bRet = sal_True;
break;
@@ -2272,16 +2273,16 @@ sal_Bool DialogContainer_Impl::hasElements()
Any DialogContainer_Impl::getByName( const ::rtl::OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
- SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE );
- if( !( pVar && pVar->ISA( SbxObject ) &&
- ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) )
+ SbxObject* pVar = dynamic_cast< SbxObject* >(mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ));
+
+ if( !( pVar && pVar->GetSbxId() == SBXID_DIALOG ) )
{
throw NoSuchElementException();
}
Reference< XStarBasicDialogInfo > xDialog =
(XStarBasicDialogInfo*)new DialogInfo_Impl
- ( aName, implGetDialogData( (SbxObject*)pVar ) );
+ ( aName, implGetDialogData( pVar ) );
Any aRetAny;
aRetAny <<= xDialog;
@@ -2299,8 +2300,9 @@ Sequence< ::rtl::OUString > DialogContainer_Impl::getElementNames()
for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ )
{
- SbxVariable* pVar = mpLib->GetObjects()->Get( nObj );
- if ( pVar->ISA( SbxObject ) && ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) )
+ SbxObject* pVar = dynamic_cast< SbxObject* >(mpLib->GetObjects()->Get( nObj ));
+
+ if ( pVar && pVar->GetSbxId() == SBXID_DIALOG )
{
pRetSeq[ nDialogCounter ] = ::rtl::OUString( pVar->GetName() );
nDialogCounter++;
@@ -2314,9 +2316,9 @@ sal_Bool DialogContainer_Impl::hasByName( const ::rtl::OUString& aName )
throw(RuntimeException)
{
sal_Bool bRet = sal_False;
- SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE );
- if( pVar && pVar->ISA( SbxObject ) &&
- ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) )
+ SbxObject* pVar = dynamic_cast< SbxObject* >(mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ));
+
+ if( pVar && pVar->GetSbxId() == SBXID_DIALOG )
{
bRet = sal_True;
}
@@ -2352,12 +2354,13 @@ void DialogContainer_Impl::removeByName( const ::rtl::OUString& Name )
throw(NoSuchElementException, WrappedTargetException, RuntimeException)
{
(void)Name;
- SbxVariable* pVar = mpLib->GetObjects()->Find( Name, SbxCLASS_DONTCARE );
- if( !( pVar && pVar->ISA( SbxObject ) &&
- ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) )
+ SbxObject* pVar = dynamic_cast< SbxObject* >(mpLib->GetObjects()->Find( Name, SbxCLASS_DONTCARE ));
+
+ if( !( pVar && pVar->GetSbxId() == SBXID_DIALOG ) )
{
throw NoSuchElementException();
}
+
mpLib->Remove( pVar );
}
diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx
index 5a245361614c..89eb78761d18 100644
--- a/basic/source/classes/disas.cxx
+++ b/basic/source/classes/disas.cxx
@@ -276,7 +276,7 @@ SbiDisas::SbiDisas( SbModule* p, const SbiImage* q ) : rImg( *q ), pMod( p )
// Add the publics
for( sal_uInt16 i = 0; i < pMod->GetMethods()->Count(); i++ )
{
- SbMethod* pMeth = PTR_CAST(SbMethod,pMod->GetMethods()->Get( i ));
+ SbMethod* pMeth = dynamic_cast< SbMethod* >( pMod->GetMethods()->Get( i ));
if( pMeth )
{
sal_uInt16 nPos = (sal_uInt16) (pMeth->GetId());
@@ -410,7 +410,7 @@ sal_Bool SbiDisas::DisasLine( String& rText )
ByteString aByteMethName;
for( sal_uInt16 i = 0; i < pMod->GetMethods()->Count(); i++ )
{
- SbMethod* pMeth = PTR_CAST(SbMethod,pMod->GetMethods()->Get( i ));
+ SbMethod* pMeth = dynamic_cast< SbMethod* >( pMod->GetMethods()->Get( i ));
if( pMeth )
{
aByteMethName = ByteString( pMeth->GetName(), gsl_getSystemTextEncoding() );
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index 7110bd6de57e..9d789e170cb9 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -286,7 +286,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
else
{
SbxVariable* pVar = xLibSearchBasic->GetObjects()->Get( nObj );
- pBasic = PTR_CAST(StarBASIC,pVar);
+ pBasic = dynamic_cast< StarBASIC* >( pVar);
}
if( pBasic )
{
@@ -305,10 +305,10 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
}
// Default: Be tolerant and search everywhere
- if( (!pMethVar || !pMethVar->ISA(SbMethod)) && maBasicRef.Is() )
+ if( (!pMethVar || !dynamic_cast< SbMethod* >(pMethVar)) && maBasicRef.Is() )
pMethVar = maBasicRef->FindQualified( aMacro, SbxCLASS_DONTCARE );
- SbMethod* pMeth = PTR_CAST(SbMethod,pMethVar);
+ SbMethod* pMeth = dynamic_cast< SbMethod* >( pMethVar);
if( !pMeth )
return;
@@ -337,12 +337,11 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
*pRet = sbxToUnoValue( xValue );
pMeth->SetParameters( NULL );
}
- else // scripting framework script
- {
- //callBasic via scripting framework
- SFURL_firing_impl( aScriptEvent, pRet, m_xModel );
-
- }
+ else // scripting framework script
+ {
+ //callBasic via scripting framework
+ SFURL_firing_impl( aScriptEvent, pRet, m_xModel );
+ }
}
Any implFindDialogLibForDialog( const Any& rDlgAny, SbxObject* pBasic )
@@ -351,7 +350,7 @@ Any implFindDialogLibForDialog( const Any& rDlgAny, SbxObject* pBasic )
SbxVariable* pDlgLibContVar = pBasic->Find
( String::CreateFromAscii("DialogLibraries"), SbxCLASS_OBJECT );
- if( pDlgLibContVar && pDlgLibContVar->ISA(SbUnoObject) )
+ if( pDlgLibContVar && dynamic_cast< SbUnoObject* >(pDlgLibContVar) )
{
SbUnoObject* pDlgLibContUnoObj = (SbUnoObject*)(SbxBase*)pDlgLibContVar;
Any aDlgLibContAny = pDlgLibContUnoObj->getUnoAny();
@@ -459,7 +458,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
// Get dialog
SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject();
- if( !(pObj && pObj->ISA(SbUnoObject)) )
+ if( !(pObj && dynamic_cast< SbUnoObject* >((SbxBase*)pObj)) )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
@@ -518,43 +517,44 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
StarBASIC* pFoundBasic = NULL;
OSL_TRACE("About to try get a hold of ThisComponent");
Reference< frame::XModel > xModel = StarBASIC::GetModelFromBasic( pINST->GetBasic() ) ;
- aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pINST->GetBasic(), pFoundBasic );
- // If we found the dialog then it belongs to the Search basic
- if ( !pFoundBasic )
+ aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pINST->GetBasic(), pFoundBasic );
+ // If we found the dialog then it belongs to the Search basic
+ if ( !pFoundBasic )
{
- Reference< frame::XDesktop > xDesktop( xMSF->createInstance
- ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
+ Reference< frame::XDesktop > xDesktop( xMSF->createInstance
+ ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ),
UNO_QUERY );
Reference< container::XEnumeration > xModels;
- if ( xDesktop.is() )
- {
- Reference< container::XEnumerationAccess > xComponents( xDesktop->getComponents(), UNO_QUERY );
- if ( xComponents.is() )
- xModels.set( xComponents->createEnumeration(), UNO_QUERY );
- if ( xModels.is() )
+ if ( xDesktop.is() )
+ {
+ Reference< container::XEnumerationAccess > xComponents( xDesktop->getComponents(), UNO_QUERY );
+ if ( xComponents.is() )
+ xModels.set( xComponents->createEnumeration(), UNO_QUERY );
+ if ( xModels.is() )
+ {
+ while ( xModels->hasMoreElements() )
{
- while ( xModels->hasMoreElements() )
+ Reference< frame::XModel > xNextModel( xModels->nextElement(), UNO_QUERY );
+ if ( xNextModel.is() )
{
- Reference< frame::XModel > xNextModel( xModels->nextElement(), UNO_QUERY );
- if ( xNextModel.is() )
+ BasicManager* pMgr = basic::BasicManagerRepository::getDocumentBasicManager( xNextModel );
+ if ( pMgr )
+ aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pMgr->GetLib(0), pFoundBasic );
+ if ( aDlgLibAny.hasValue() )
{
- BasicManager* pMgr = basic::BasicManagerRepository::getDocumentBasicManager( xNextModel );
- if ( pMgr )
- aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pMgr->GetLib(0), pFoundBasic );
- if ( aDlgLibAny.hasValue() )
- {
- bDocDialog = true;
- xModel = xNextModel;
- break;
- }
+ bDocDialog = true;
+ xModel = xNextModel;
+ break;
}
}
}
}
}
+ }
+
if ( pFoundBasic )
bDocDialog = pFoundBasic->IsDocBasic();
- Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pINST->GetBasic(), xModel );
+ Reference< XScriptListener > xScriptListener = new BasicScriptListener_Impl( pINST->GetBasic(), xModel );
Sequence< Any > aArgs( 4 );
if( bDocDialog )
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index bc3c57baaecd..cb707d2dd1dd 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -68,8 +68,6 @@ using namespace ::com::sun::star::script;
SV_IMPL_VARARR(SbTextPortions,SbTextPortion)
-TYPEINIT1(StarBASIC,SbxObject)
-
#define RTLNAME "@SBRTL"
// i#i68894#
using namespace ::com::sun::star;
@@ -205,7 +203,7 @@ StarBASIC* lclGetDocBasicForModule( SbModule* pModule )
while( pCurParent->GetParent() != NULL )
{
pCurParent = pCurParent->GetParent();
- StarBASIC* pDocBasic = PTR_CAST( StarBASIC, pCurParent );
+ StarBASIC* pDocBasic = dynamic_cast< StarBASIC* >( pCurParent );
if( pDocBasic != NULL && pDocBasic->IsDocBasic() )
{
pRetBasic = pDocBasic;
@@ -497,7 +495,7 @@ SbxObject* SbFormFactory::CreateObject( const String& rClassName )
{
if( SbxVariable* pVar = pMod->Find( rClassName, SbxCLASS_OBJECT ) )
{
- if( SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pVar->GetObject() ) )
+ if( SbUserFormModule* pFormModule = dynamic_cast< SbUserFormModule* >( pVar->GetObject() ) )
{
bool bInitState = pFormModule->getInitState();
if( bInitState )
@@ -533,7 +531,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
for( sal_uInt32 i = 0 ; i < nCount ; i++ )
{
SbxVariable* pVar = pProps->Get32( i );
- SbxProperty* pProp = PTR_CAST( SbxProperty, pVar );
+ SbxProperty* pProp = dynamic_cast< SbxProperty* >( pVar );
if( pProp )
{
SbxProperty* pNewProp = new SbxProperty( *pProp );
@@ -541,7 +539,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( eVarType & SbxARRAY )
{
SbxBase* pParObj = pVar->GetObject();
- SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pSource = dynamic_cast< SbxDimArray* >( pParObj);
SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
sal_Int32 lb = 0;
sal_Int32 ub = 0;
@@ -568,7 +566,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
if( eVarType == SbxOBJECT )
{
SbxBase* pObjBase = pVar->GetObject();
- SbxObject* pSrcObj = PTR_CAST(SbxObject,pObjBase);
+ SbxObject* pSrcObj = dynamic_cast< SbxObject* >( pObjBase);
SbxObject* pDestObj = NULL;
if( pSrcObj != NULL )
pDestObj = cloneTypeObjectImpl( *pSrcObj );
@@ -613,9 +611,6 @@ SbxObject* createUserTypeImpl( const String& rClassName )
return pRetObj;
}
-
-TYPEINIT1(SbClassModuleObject,SbModule)
-
SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
: SbModule( pClassModule->GetName() )
, mpClassModule( pClassModule )
@@ -640,10 +635,10 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbxVariable* pVar = pClassMethods->Get32( i );
// Exclude SbIfaceMapperMethod to copy them in a second step
- SbIfaceMapperMethod* pIfaceMethod = PTR_CAST( SbIfaceMapperMethod, pVar );
+ SbIfaceMapperMethod* pIfaceMethod = dynamic_cast< SbIfaceMapperMethod* >( pVar );
if( !pIfaceMethod )
{
- SbMethod* pMethod = PTR_CAST(SbMethod, pVar );
+ SbMethod* pMethod = dynamic_cast< SbMethod* >( pVar );
if( pMethod )
{
sal_uInt16 nFlags_ = pMethod->GetFlags();
@@ -665,7 +660,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
{
SbxVariable* pVar = pClassMethods->Get32( i );
- SbIfaceMapperMethod* pIfaceMethod = PTR_CAST( SbIfaceMapperMethod, pVar );
+ SbIfaceMapperMethod* pIfaceMethod = dynamic_cast< SbIfaceMapperMethod* >( pVar );
if( pIfaceMethod )
{
SbMethod* pImplMethod = pIfaceMethod->getImplMethod();
@@ -678,7 +673,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
// Search for own copy of ImplMethod
String aImplMethodName = pImplMethod->GetName();
SbxVariable* p = pMethods->Find( aImplMethodName, SbxCLASS_METHOD );
- SbMethod* pImplMethodCopy = p ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pImplMethodCopy = p ? dynamic_cast< SbMethod* >( p) : NULL;
if( !pImplMethodCopy )
{
DBG_ERROR( "Found no ImplMethod copy" );
@@ -696,7 +691,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
for( i = 0 ; i < nPropertyCount ; i++ )
{
SbxVariable* pVar = pClassProps->Get32( i );
- SbProcedureProperty* pProcedureProp = PTR_CAST( SbProcedureProperty, pVar );
+ SbProcedureProperty* pProcedureProp = dynamic_cast< SbProcedureProperty* >( pVar );
if( pProcedureProp )
{
sal_uInt16 nFlags_ = pProcedureProp->GetFlags();
@@ -712,7 +707,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
}
else
{
- SbxProperty* pProp = PTR_CAST( SbxProperty, pVar );
+ SbxProperty* pProp = dynamic_cast< SbxProperty* >( pVar );
if( pProp )
{
sal_uInt16 nFlags_ = pProp->GetFlags();
@@ -725,12 +720,12 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
if( eVarType == SbxOBJECT )
{
SbxBase* pObjBase = pProp->GetObject();
- SbxObject* pObj = PTR_CAST(SbxObject,pObjBase);
+ SbxObject* pObj = dynamic_cast< SbxObject* >( pObjBase);
if( pObj != NULL )
{
String aObjClass = pObj->GetClassName();
- SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase);
+ SbClassModuleObject* pClassModuleObj = dynamic_cast< SbClassModuleObject* >( pObjBase);
if( pClassModuleObj != NULL )
{
SbModule* pLclClassModule = pClassModuleObj->getClassModule();
@@ -789,7 +784,7 @@ SbxVariable* SbClassModuleObject::Find( const XubString& rName, SbxClassType t )
{
triggerInitializeEvent();
- SbIfaceMapperMethod* pIfaceMapperMethod = PTR_CAST(SbIfaceMapperMethod,pRes);
+ SbIfaceMapperMethod* pIfaceMapperMethod = dynamic_cast< SbIfaceMapperMethod* >( pRes);
if( pIfaceMapperMethod )
{
pRes = pIfaceMapperMethod->getImplMethod();
@@ -1040,7 +1035,7 @@ void StarBASIC::implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic )
for( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar);
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >(pVar);
if( pBasic && pBasic != pDeletedBasic )
pBasic->implClearDependingVarsOnDelete( pDeletedBasic );
}
@@ -1097,7 +1092,7 @@ SbModule* StarBASIC::MakeModule32( const String& rName, const ModuleInfo& mInfo,
void StarBASIC::Insert( SbxVariable* pVar )
{
- if( pVar->IsA( TYPE(SbModule) ) )
+ if( dynamic_cast< SbModule* >(pVar) )
{
pModules->Insert( pVar, pModules->Count() );
pVar->SetParent( this );
@@ -1114,7 +1109,7 @@ void StarBASIC::Insert( SbxVariable* pVar )
void StarBASIC::Remove( SbxVariable* pVar )
{
- if( pVar->IsA( TYPE(SbModule) ) )
+ if( dynamic_cast< SbModule* >(pVar) )
{
// #87540 Can be last reference!
SbxVariableRef xVar = pVar;
@@ -1269,7 +1264,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar);
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( pVar);
if( pBasic && pBasic != pBasicNotToInit )
pBasic->InitAllModules();
}
@@ -1283,14 +1278,14 @@ void StarBASIC::DeInitAllModules( void )
for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ )
{
SbModule* pModule = (SbModule*)pModules->Get( nMod );
- if( pModule->pImage && !pModule->isProxyModule() && !pModule->ISA(SbObjModule) )
+ if( pModule->pImage && !pModule->isProxyModule() && !dynamic_cast< SbObjModule* >(pModule) )
pModule->pImage->bInit = false;
}
for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar);
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( pVar);
if( pBasic )
pBasic->DeInitAllModules();
}
@@ -1408,8 +1403,8 @@ SbxVariable* StarBASIC::FindVarInCurrentScopy
SbxBase* pSbx = FindSBXInCurrentScope( rName );
if( pSbx )
{
- if( !pSbx->ISA(SbxMethod) && !pSbx->ISA(SbxObject) )
- pVar = PTR_CAST(SbxVariable,pSbx);
+ if( !dynamic_cast< SbxMethod* >(pSbx) && !dynamic_cast< SbxObject* >(pSbx) )
+ pVar = dynamic_cast< SbxVariable* >( pSbx);
}
if( pVar )
rStatus = 0; // We found something
@@ -1913,7 +1908,7 @@ sal_Bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
for( nObj = 0 ; nObj < nObjCount ; nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST( StarBASIC, pVar );
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( pVar );
ppDeleteTab[nObj] = pBasic ? NULL : pVar;
}
for( nObj = 0 ; nObj < nObjCount ; nObj++ )
@@ -1932,7 +1927,7 @@ sal_Bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
SbModule* pMod = (SbModule*) SbxBase::Load( r );
if( !pMod )
return sal_False;
- else if( pMod->ISA(SbJScriptModule) )
+ else if( dynamic_cast< SbJScriptModule* >(pMod) )
{
// Ref zuweisen, damit pMod deleted wird
SbModuleRef xRef = pMod;
@@ -2040,8 +2035,6 @@ Reference< frame::XModel > StarBASIC::GetModelFromBasic( SbxObject* pBasic )
//========================================================================
// #118116 Implementation Collection object
-TYPEINIT1(BasicCollection,SbxObject)
-
static const char pCountStr[] = "Count";
static const char pAddStr[] = "Add";
static const char pItemStr[] = "Item";
@@ -2114,7 +2107,7 @@ SbxVariable* BasicCollection::Find( const XubString& rName, SbxClassType t )
void BasicCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1,
const SfxHint& rHint, const TypeId& rId2 )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast< const SbxHint* >( &rHint);
if( p )
{
sal_uIntPtr nId = p->GetId();
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 03cda46054e4..8a7793f81c77 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -99,14 +99,6 @@ using namespace cppu;
#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
#include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
-TYPEINIT1(SbUnoMethod,SbxMethod)
-TYPEINIT1(SbUnoProperty,SbxProperty)
-TYPEINIT1(SbUnoObject,SbxObject)
-TYPEINIT1(SbUnoClass,SbxObject)
-TYPEINIT1(SbUnoService,SbxObject)
-TYPEINIT1(SbUnoServiceCtor,SbxMethod)
-TYPEINIT1(SbUnoSingleton,SbxObject)
-
typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper;
// Flag, um immer ueber Invocation zu gehen
@@ -143,15 +135,18 @@ SbxVariable* getDefaultProp( SbxVariable* pRef )
SbxVariable* pDefaultProp = NULL;
if ( pRef->GetType() == SbxOBJECT )
{
- SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pRef);
+ SbxObject* pObj = dynamic_cast< SbxObject* >( (SbxVariable*) pRef);
+
if ( !pObj )
{
SbxBase* pObjVarObj = pRef->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast< SbxObject* >( pObjVarObj);
}
- if ( pObj && pObj->ISA(SbUnoObject) )
+
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >(pObj);
+
+ if ( pUnoObj )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)pObj);
pDefaultProp = pUnoObj->GetDfltProperty();
}
}
@@ -387,11 +382,6 @@ Any convertAny( const Any& rVal, const Type& aDestType )
return aConvertedVal;
}
-
-// #105565 Special Object to wrap a strongly typed Uno Any
-TYPEINIT1(SbUnoAnyObject,SbxObject)
-
-
// TODO: Spaeter auslagern
Reference<XIdlClass> TypeToIdlClass( const Type& rType )
{
@@ -849,7 +839,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
enum2int( nEnum, aValue );
pVar->PutLong( nEnum );
}
- break;
+ break;
case TypeClass_SEQUENCE:
{
@@ -1010,11 +1000,10 @@ Type getUnoTypeForSbxValue( SbxValue* pVal )
return aRetType;
}
- if( xObj->ISA(SbxDimArray) )
- {
- SbxBase* pObj = (SbxBase*)xObj;
- SbxDimArray* pArray = (SbxDimArray*)pObj;
+ SbxDimArray* pArray = dynamic_cast< SbxDimArray* >((SbxBase*)xObj);
+ if( pArray )
+ {
short nDims = pArray->GetDims();
Type aElementType = getUnoTypeForSbxBaseType( (SbxDataType)(pArray->GetType() & 0xfff) );
TypeClass eElementTypeClass = aElementType.getTypeClass();
@@ -1103,16 +1092,26 @@ Type getUnoTypeForSbxValue( SbxValue* pVal )
}
}
// Kein Array, sondern...
- else if( xObj->ISA(SbUnoObject) )
- {
- aRetType = ((SbUnoObject*)(SbxBase*)xObj)->getUnoAny().getValueType();
- }
- // SbUnoAnyObject?
- else if( xObj->ISA(SbUnoAnyObject) )
+ else
{
- aRetType = ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue().getValueType();
+ SbUnoObject* pSbUnoObject = dynamic_cast< SbUnoObject* >((SbxBase*)xObj);
+
+ if( pSbUnoObject )
+ {
+ aRetType = pSbUnoObject->getUnoAny().getValueType();
+ }
+ // SbUnoAnyObject?
+ else
+ {
+ SbUnoAnyObject* pSbUnoAnyObject = dynamic_cast< SbUnoAnyObject* >((SbxBase*)xObj);
+
+ if( pSbUnoAnyObject )
+ {
+ aRetType = pSbUnoAnyObject->getValue().getValueType();
+ }
+ // Sonst ist es ein Nicht-Uno-Basic-Objekt -> default==void liefern
+ }
}
- // Sonst ist es ein Nicht-Uno-Basic-Objekt -> default==void liefern
}
// Kein Objekt, Basistyp konvertieren
else
@@ -1134,20 +1133,26 @@ Any sbxToUnoValueImpl( SbxVariable* pVar, bool bBlockConversionToSmallestType =
SbxBaseRef xObj = (SbxBase*)pVar->GetObject();
if( xObj.Is() )
{
- if( xObj->ISA(SbUnoAnyObject) )
- return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue();
- if( xObj->ISA(SbClassModuleObject) )
+ SbUnoAnyObject* pSbUnoAnyObject = dynamic_cast< SbUnoAnyObject* >((SbxBase*)xObj);
+
+ if(pSbUnoAnyObject)
+ {
+ return pSbUnoAnyObject->getValue();
+ }
+
+ SbClassModuleObject* pClassModuleObj = dynamic_cast< SbClassModuleObject* >((SbxBase*)xObj);
+
+ if(pClassModuleObj)
{
Any aRetAny;
- SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)xObj;
SbModule* pClassModule = pClassModuleObj->getClassModule();
if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) )
return aRetAny;
}
- if( !xObj->ISA(SbUnoObject) )
+ if( !dynamic_cast< SbUnoObject* >( (SbxBase*)xObj ) )
{
// Create NativeObjectWrapper to identify object in case of callbacks
- SbxObject* pObj = PTR_CAST(SbxObject,pVar->GetObject());
+ SbxObject* pObj = dynamic_cast< SbxObject* >(pVar->GetObject());
if( pObj != NULL )
{
NativeObjectWrapper aNativeObjectWrapper;
@@ -1332,10 +1337,11 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
SbxDataType eBaseType = pVar->SbxValue::GetType();
if( eBaseType == SbxOBJECT )
{
- SbxBaseRef xObj = (SbxBase*)pVar->GetObject();
- if( xObj.Is() && xObj->ISA(SbUnoAnyObject) )
+ SbUnoAnyObject* pSbUnoAnyObject = dynamic_cast< SbUnoAnyObject* >((SbxBase*)pVar->GetObject());
+
+ if( pSbUnoAnyObject )
{
- return ((SbUnoAnyObject*)(SbxBase*)xObj)->getValue();
+ return pSbUnoAnyObject->getValue();
}
}
@@ -1393,9 +1399,11 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
}
SbxBaseRef pObj = (SbxBase*)pVar->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ SbUnoObject* pSbUnoObject = dynamic_cast< SbUnoObject* >((SbxBase*)pObj);
+
+ if( pSbUnoObject )
{
- aRetVal = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
+ aRetVal = pSbUnoObject->getUnoAny();
}
else
{
@@ -1415,7 +1423,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
Reference< XIdlClass > xIdlClass;
SbxBaseRef pObj = (SbxBase*)pVar->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ if( pObj && dynamic_cast< SbUnoObject* >((SbxBase*)pObj) )
{
Any aUnoAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
aUnoAny >>= xIdlClass;
@@ -1458,12 +1466,10 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
case TypeClass_SEQUENCE:
{
- SbxBaseRef xObj = (SbxBase*)pVar->GetObject();
- if( xObj && xObj->ISA(SbxDimArray) )
- {
- SbxBase* pObj = (SbxBase*)xObj;
- SbxDimArray* pArray = (SbxDimArray*)pObj;
+ SbxDimArray* pArray = dynamic_cast< SbxDimArray* >((SbxBase*)pVar->GetObject());
+ if( pArray )
+ {
short nDims = pArray->GetDims();
// Normal case: One dimensional array
@@ -1711,7 +1717,7 @@ String getBasicObjectTypeName( SbxObject* pObj )
String aName;
if( pObj )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >( pObj);
if( pUnoObj )
aName = getDbgObjectNameImpl( pUnoObj );
}
@@ -2072,8 +2078,6 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj )
return aRet;
}
-TYPEINIT1(AutomationNamedArgsSbxArray,SbxArray)
-
// Implementation SbUnoObject
void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
@@ -2081,13 +2085,13 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
if( bNeedIntrospection )
doIntrospection();
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
SbxArray* pParams = pVar->GetParameters();
- SbUnoProperty* pProp = PTR_CAST(SbUnoProperty,pVar);
- SbUnoMethod* pMeth = PTR_CAST(SbUnoMethod,pVar);
+ SbUnoProperty* pProp = dynamic_cast< SbUnoProperty* >( pVar);
+ SbUnoMethod* pMeth = dynamic_cast< SbUnoMethod* >( pVar);
if( pProp )
{
bool bInvocation = pProp->isInvocationBased();
@@ -2278,7 +2282,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
AutomationNamedArgsSbxArray* pArgNamesArray = NULL;
if( bOLEAutomation )
- pArgNamesArray = PTR_CAST(AutomationNamedArgsSbxArray,pParams);
+ pArgNamesArray = dynamic_cast< AutomationNamedArgsSbxArray* >( pParams);
args.realloc( nParamCount );
Any* pAnyArgs = args.getArray();
@@ -3044,7 +3048,7 @@ void createAllObjectProperties( SbxObject* pObj )
if( !pObj )
return;
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >( pObj);
if( pUnoObj )
pUnoObj->createAllProperties();
else
@@ -3232,7 +3236,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
// Uno-Objekt holen
SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject();
- if( !(pObj && pObj->ISA(SbUnoObject)) )
+ if( !(pObj && dynamic_cast< SbUnoObject* >((SbxBase*)pObj)) )
return;
Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
TypeClass eType = aAny.getValueType().getTypeClass();
@@ -3289,7 +3293,7 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite )
if( !xParam->IsObject() )
return;
SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject();
- if( !(pObj && pObj->ISA(SbUnoObject)) )
+ if( !(pObj && dynamic_cast< SbUnoObject* >((SbxBase*)pObj)) )
return;
Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
TypeClass eType = aAny.getValueType().getTypeClass();
@@ -3318,7 +3322,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
if( !xParam1->IsObject() )
return;
SbxBaseRef pObj1 = (SbxBase*)xParam1->GetObject();
- if( !(pObj1 && pObj1->ISA(SbUnoObject)) )
+ if( !(pObj1 && dynamic_cast< SbUnoObject* >((SbxBase*)pObj1)) )
return;
Any aAny1 = ((SbUnoObject*)(SbxBase*)pObj1)->getUnoAny();
TypeClass eType1 = aAny1.getValueType().getTypeClass();
@@ -3332,7 +3336,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
if( !xParam2->IsObject() )
return;
SbxBaseRef pObj2 = (SbxBase*)xParam2->GetObject();
- if( !(pObj2 && pObj2->ISA(SbUnoObject)) )
+ if( !(pObj2 && dynamic_cast< SbUnoObject* >((SbxBase*)pObj2)) )
return;
Any aAny2 = ((SbUnoObject*)(SbxBase*)pObj2)->getUnoAny();
TypeClass eType2 = aAny2.getValueType().getTypeClass();
@@ -3648,12 +3652,12 @@ SbxVariable* SbUnoService::Find( const String& rName, SbxClassType )
void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
SbxArray* pParams = pVar->GetParameters();
- SbUnoServiceCtor* pUnoCtor = PTR_CAST(SbUnoServiceCtor,pVar);
+ SbUnoServiceCtor* pUnoCtor = dynamic_cast< SbUnoServiceCtor* >( pVar);
if( pUnoCtor && pHint->GetId() == SBX_HINT_DATAWANTED )
{
// Parameter count -1 because of Param0 == this
@@ -3878,7 +3882,7 @@ SbUnoSingleton::SbUnoSingleton( const String& aName_,
void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
@@ -3983,7 +3987,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet
while( pP->GetParent() )
{
pP = pP->GetParent();
- StarBASIC * pLib = PTR_CAST(StarBASIC,pP);
+ StarBASIC * pLib = dynamic_cast< StarBASIC* >( pP);
if( pLib )
{
// In Basic Array anlegen
@@ -4326,7 +4330,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
Reference< XIdlClass > xIdlClass;
SbxBaseRef pObj = (SbxBase*)pVal->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ if( pObj && dynamic_cast< SbUnoObject* >((SbxBase*)pObj) )
{
Any aUnoAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny();
aUnoAny >>= xIdlClass;
@@ -4453,7 +4457,7 @@ ModuleInvocationProxy::ModuleInvocationProxy( const ::rtl::OUString& aPrefix, Sb
, m_xScopeObj( xScopeObj )
, m_aListeners( m_aMutex )
{
- m_bProxyIsClassModuleObject = xScopeObj.Is() ? xScopeObj->ISA(SbClassModuleObject) : false;
+ m_bProxyIsClassModuleObject = xScopeObj.Is() ? 0 != dynamic_cast< SbClassModuleObject* >((SbxBase*)xScopeObj) : false;
}
Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospection() throw()
@@ -4473,7 +4477,7 @@ void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty,
aPropertyFunctionName += rProperty;
SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD );
- SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = p != NULL ? dynamic_cast< SbMethod* >( p) : NULL;
if( pMeth == NULL )
{
// TODO: Check vba behavior concernig missing function
@@ -4514,7 +4518,7 @@ Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty )
aPropertyFunctionName += rProperty;
SbxVariable* p = m_xScopeObj->Find( aPropertyFunctionName, SbxCLASS_METHOD );
- SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = p != NULL ? dynamic_cast< SbMethod* >( p) : NULL;
if( pMeth == NULL )
{
// TODO: Check vba behavior concernig missing function
@@ -4569,7 +4573,8 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction,
}
SbxVariable* p = xScopeObj->Find( aFunctionName, SbxCLASS_METHOD );
- SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = dynamic_cast< SbMethod* >(p);
+
if( pMeth == NULL )
{
// TODO: Check vba behavior concernig missing function
@@ -4813,7 +4818,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
do
{
SbxObject* pObjParent = pCurObject->GetParent();
- pParentBasic = PTR_CAST( StarBASIC, pObjParent );
+ pParentBasic = dynamic_cast< StarBASIC* >( pObjParent );
pCurObject = pObjParent;
}
while( pParentBasic == NULL && pCurObject != NULL );
@@ -4840,7 +4845,7 @@ bool handleToStringForCOMObjects( SbxObject* pObj, SbxValue* pVal )
bool bSuccess = false;
SbUnoObject* pUnoObj = NULL;
- if( pObj != NULL && (pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)pObj)) != NULL )
+ if( pObj != NULL && (pUnoObj = dynamic_cast< SbUnoObject* >((SbxObject*)pObj)) != NULL )
{
// Only for native COM objects
if( pUnoObj->isNativeCOMObject() )
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index be51a7c06175..827b7ecebdb4 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -148,14 +148,14 @@ public:
DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pVar->GetName() )
{
- SbObjModule* pMod = PTR_CAST(SbObjModule,pVar);
+ SbObjModule* pMod = dynamic_cast< SbObjModule* >( pVar);
if ( pMod )
{
if ( pMod->GetModuleType() == ModuleType::DOCUMENT )
{
Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
// Use proxy factory service to create aggregatable proxy.
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pMod->GetObject() );
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >( pMod->GetObject() );
Reference< XInterface > xIf;
if ( pUnoObj )
{
@@ -436,14 +436,6 @@ SbPropertyRef DocObjectWrapper::getProperty( const rtl::OUString& aName ) throw
return pProperty;
}
-TYPEINIT1(SbModule,SbxObject)
-TYPEINIT1(SbMethod,SbxMethod)
-TYPEINIT1(SbProperty,SbxProperty)
-TYPEINIT1(SbProcedureProperty,SbxProperty)
-TYPEINIT1(SbJScriptModule,SbModule)
-TYPEINIT1(SbJScriptMethod,SbMethod)
-TYPEINIT1(SbObjModule,SbModule)
-TYPEINIT1(SbUserFormModule,SbObjModule)
typedef std::vector<HighlightPortion> HighlightPortions;
@@ -574,13 +566,13 @@ void SbModule::StartDefinitions()
sal_uInt16 i;
for( i = 0; i < pMethods->Count(); i++ )
{
- SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) );
+ SbMethod* p = dynamic_cast< SbMethod* >( pMethods->Get( i ) );
if( p )
p->bInvalid = sal_True;
}
for( i = 0; i < pProps->Count(); )
{
- SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) );
+ SbProperty* p = dynamic_cast< SbProperty* >( pProps->Get( i ) );
if( p )
pProps->Remove( i );
else
@@ -593,7 +585,7 @@ void SbModule::StartDefinitions()
SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t )
{
SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
- SbMethod* pMeth = p ? PTR_CAST(SbMethod,p) : NULL;
+ SbMethod* pMeth = p ? dynamic_cast< SbMethod* >( p) : NULL;
if( p && !pMeth )
pMethods->Remove( p );
if( !pMeth )
@@ -621,7 +613,7 @@ SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t )
SbProperty* SbModule::GetProperty( const String& rName, SbxDataType t )
{
SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
- SbProperty* pProp = p ? PTR_CAST(SbProperty,p) : NULL;
+ SbProperty* pProp = p ? dynamic_cast< SbProperty* >( p) : NULL;
if( p && !pProp )
pProps->Remove( p );
if( !pProp )
@@ -639,7 +631,7 @@ SbProcedureProperty* SbModule::GetProcedureProperty
( const String& rName, SbxDataType t )
{
SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
- SbProcedureProperty* pProp = p ? PTR_CAST(SbProcedureProperty,p) : NULL;
+ SbProcedureProperty* pProp = p ? dynamic_cast< SbProcedureProperty* >( p) : NULL;
if( p && !pProp )
pProps->Remove( p );
if( !pProp )
@@ -657,7 +649,7 @@ SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod
( const String& rName, SbMethod* pImplMeth )
{
SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
- SbIfaceMapperMethod* pMapperMethod = p ? PTR_CAST(SbIfaceMapperMethod,p) : NULL;
+ SbIfaceMapperMethod* pMapperMethod = p ? dynamic_cast< SbIfaceMapperMethod* >( p) : NULL;
if( p && !pMapperMethod )
pMethods->Remove( p );
if( !pMapperMethod )
@@ -675,16 +667,13 @@ SbIfaceMapperMethod::~SbIfaceMapperMethod()
{
}
-TYPEINIT1(SbIfaceMapperMethod,SbMethod)
-
-
// Aus dem Codegenerator: Ungueltige Eintraege entfernen
void SbModule::EndDefinitions( sal_Bool bNewState )
{
for( sal_uInt16 i = 0; i < pMethods->Count(); )
{
- SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) );
+ SbMethod* p = dynamic_cast< SbMethod* >( pMethods->Get( i ) );
if( p )
{
if( p->bInvalid )
@@ -727,7 +716,7 @@ SbxVariable* SbModule::Find( const XubString& rName, SbxClassType t )
if( xArray.Is() )
{
SbxVariable* pEnumVar = xArray->Find( rName, SbxCLASS_DONTCARE );
- SbxObject* pEnumObject = PTR_CAST( SbxObject, pEnumVar );
+ SbxObject* pEnumObject = dynamic_cast< SbxObject* >( pEnumVar );
if( pEnumObject )
{
bool bPrivate = pEnumObject->IsSet( SBX_PRIVATE );
@@ -764,19 +753,19 @@ const String& SbModule::GetSource() const
void SbModule::SetParent( SbxObject* p )
{
// #118083: Assertion is not valid any more
- // DBG_ASSERT( !p || p->IsA( TYPE(StarBASIC) ), "SbModules nur in BASIC eintragen" );
+ // DBG_ASSERT( !p || dynamic_cast< StarBASIC* >(p), "SbModules nur in BASIC eintragen" );
pParent = p;
}
void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
- SbProperty* pProp = PTR_CAST(SbProperty,pVar);
- SbMethod* pMeth = PTR_CAST(SbMethod,pVar);
+ SbProperty* pProp = dynamic_cast< SbProperty* >( pVar);
+ SbMethod* pMeth = dynamic_cast< SbMethod* >( pVar);
if( pProp )
{
if( pProp->GetModule() != this )
@@ -932,15 +921,15 @@ SbMethod* SbModule::GetFunctionForLine( sal_uInt16 nLine )
static void _SendHint( SbxObject* pObj, sal_uIntPtr nId, SbMethod* p )
{
// Selbst ein BASIC?
- if( pObj->IsA( TYPE(StarBASIC) ) && pObj->IsBroadcaster() )
+ if( dynamic_cast< StarBASIC* >(pObj) && pObj->IsBroadcaster() )
pObj->GetBroadcaster().Broadcast( SbxHint( nId, p ) );
// Dann die Unterobjekte fragen
SbxArray* pObjs = pObj->GetObjects();
for( sal_uInt16 i = 0; i < pObjs->Count(); i++ )
{
- SbxVariable* pVar = pObjs->Get( i );
- if( pVar->IsA( TYPE(SbxObject) ) )
- _SendHint( PTR_CAST(SbxObject,pVar), nId, p );
+ SbxObject* pVar = dynamic_cast< SbxObject* >(pObjs->Get( i ));
+ if( pVar )
+ _SendHint( pVar, nId, p );
}
}
@@ -985,7 +974,7 @@ void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic )
for( sal_uInt16 i = 0 ; i < nCount ; i++ )
{
SbxVariable* pObjVar = pObjs->Get( i );
- StarBASIC* pSubBasic = PTR_CAST( StarBASIC, pObjVar );
+ StarBASIC* pSubBasic = dynamic_cast< StarBASIC* >( pObjVar );
if( pSubBasic )
ClearUnoObjectsInRTL_Impl_Rek( pSubBasic );
}
@@ -1076,7 +1065,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
SbxBase::ResetError();
if( pMSOMacroRuntimeLibVar )
{
- StarBASIC* pMSOMacroRuntimeLib = PTR_CAST(StarBASIC,pMSOMacroRuntimeLibVar);
+ StarBASIC* pMSOMacroRuntimeLib = dynamic_cast< StarBASIC* >( pMSOMacroRuntimeLibVar);
if( pMSOMacroRuntimeLib )
{
sal_uInt16 nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SBX_GBLSEARCH;
@@ -1239,7 +1228,8 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
StarBASIC::FatalError( SbERR_STACK_OVERFLOW );
}
- StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >(GetParent());
+
if( bDelInst )
{
// #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden,
@@ -1335,18 +1325,18 @@ void SbModule::ClearPrivateVars()
{
for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ )
{
- SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) );
+ SbProperty* p = dynamic_cast< SbProperty* >( pProps->Get( i ) );
if( p )
{
// Arrays nicht loeschen, sondern nur deren Inhalt
if( p->GetType() & SbxARRAY )
{
- SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject());
+ SbxArray* pArray = dynamic_cast< SbxArray* >( p->GetObject());
if( pArray )
{
for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ )
{
- SbxVariable* pj = PTR_CAST(SbxVariable,pArray->Get( j ));
+ SbxVariable* pj = dynamic_cast< SbxVariable* >( pArray->Get( j ));
pj->SbxValue::Clear();
/*
sal_uInt16 nFlags = pj->GetFlags();
@@ -1373,21 +1363,21 @@ void SbModule::ClearPrivateVars()
void SbModule::implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic )
{
- if( pVar->SbxValue::GetType() != SbxOBJECT || pVar->ISA( SbProcedureProperty ) )
+ if( pVar->SbxValue::GetType() != SbxOBJECT || dynamic_cast< SbProcedureProperty* >(pVar) )
return;
- SbxObject* pObj = PTR_CAST(SbxObject,pVar->GetObject());
+ SbxObject* pObj = dynamic_cast< SbxObject* >(pVar->GetObject());
if( pObj != NULL )
{
SbxObject* p = pObj;
- SbModule* pMod = PTR_CAST( SbModule, p );
+ SbModule* pMod = dynamic_cast< SbModule* >( p );
if( pMod != NULL )
pMod->ClearVarsDependingOnDeletedBasic( pDeletedBasic );
while( (p = p->GetParent()) != NULL )
{
- StarBASIC* pBasic = PTR_CAST( StarBASIC, p );
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( p );
if( pBasic != NULL && pBasic == pDeletedBasic )
{
pVar->SbxValue::Clear();
@@ -1403,17 +1393,17 @@ void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic )
for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ )
{
- SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) );
+ SbProperty* p = dynamic_cast< SbProperty* >( pProps->Get( i ) );
if( p )
{
if( p->GetType() & SbxARRAY )
{
- SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject());
+ SbxArray* pArray = dynamic_cast< SbxArray* >(p->GetObject());
if( pArray )
{
for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ )
{
- SbxVariable* pVar = PTR_CAST(SbxVariable,pArray->Get( j ));
+ SbxVariable* pVar = dynamic_cast< SbxVariable* >(pArray->Get( j ));
implClearIfVarDependsOnDeletedBasic( pVar, pDeletedBasic );
}
}
@@ -1435,7 +1425,7 @@ void StarBASIC::ClearAllModuleVars( void )
{
SbModule* pModule = (SbModule*)pModules->Get( nMod );
// Nur initialisieren, wenn der Startcode schon ausgefuehrt wurde
- if( pModule->pImage && pModule->pImage->bInit && !pModule->isProxyModule() && !pModule->ISA(SbObjModule) )
+ if( pModule->pImage && pModule->pImage->bInit && !pModule->isProxyModule() && !dynamic_cast< SbObjModule* >( pModule ) )
pModule->ClearPrivateVars();
}
@@ -1445,7 +1435,7 @@ void StarBASIC::ClearAllModuleVars( void )
for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
- StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar);
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( pVar);
if( pBasic )
pBasic->ClearAllModuleVars();
}
@@ -1467,7 +1457,7 @@ void SbModule::GlobalRunInit( sal_Bool bBasicStart )
GetSbData()->bGlobalInitErr = sal_False;
// Parent vom Modul ist ein Basic
- StarBASIC *pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC *pBasic = dynamic_cast< StarBASIC* >( GetParent());
if( pBasic )
{
pBasic->InitAllModules();
@@ -1475,7 +1465,7 @@ void SbModule::GlobalRunInit( sal_Bool bBasicStart )
SbxObject* pParent_ = pBasic->GetParent();
if( pParent_ )
{
- StarBASIC * pParentBasic = PTR_CAST(StarBASIC,pParent_);
+ StarBASIC * pParentBasic = dynamic_cast< StarBASIC* >( pParent_);
if( pParentBasic )
{
pParentBasic->InitAllModules( pBasic );
@@ -1484,7 +1474,7 @@ void SbModule::GlobalRunInit( sal_Bool bBasicStart )
SbxObject* pParentParent = pParentBasic->GetParent();
if( pParentParent )
{
- StarBASIC * pParentParentBasic = PTR_CAST(StarBASIC,pParentParent);
+ StarBASIC * pParentParentBasic = dynamic_cast< StarBASIC* >( pParentParent);
if( pParentParentBasic )
pParentParentBasic->InitAllModules( pParentBasic );
}
@@ -1495,14 +1485,14 @@ void SbModule::GlobalRunInit( sal_Bool bBasicStart )
void SbModule::GlobalRunDeInit( void )
{
- StarBASIC *pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC *pBasic = dynamic_cast< StarBASIC* >( GetParent());
if( pBasic )
{
pBasic->DeInitAllModules();
SbxObject* pParent_ = pBasic->GetParent();
if( pParent_ )
- pBasic = PTR_CAST(StarBASIC,pParent_);
+ pBasic = dynamic_cast< StarBASIC* >( pParent_);
if( pBasic )
pBasic->DeInitAllModules();
}
@@ -1657,7 +1647,7 @@ SbModule::fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg ) const
pImg = pImage;
for( sal_uInt32 i = 0; i < pMethods->Count(); i++ )
{
- SbMethod* pMeth = PTR_CAST(SbMethod,pMethods->Get( (sal_uInt16)i ) );
+ SbMethod* pMeth = dynamic_cast< SbMethod* >( pMethods->Get( (sal_uInt16)i ) );
if( pMeth )
{
//fixup method start positions
@@ -1819,14 +1809,14 @@ sal_Bool SbModule::LoadCompleted()
sal_uInt16 i;
for( i = 0; i < p->Count(); i++ )
{
- SbMethod* q = PTR_CAST(SbMethod,p->Get( i ) );
+ SbMethod* q = dynamic_cast< SbMethod* >( p->Get( i ) );
if( q )
q->pMod = this;
}
p = GetProperties();
for( i = 0; i < p->Count(); i++ )
{
- SbProperty* q = PTR_CAST(SbProperty,p->Get( i ) );
+ SbProperty* q = dynamic_cast< SbProperty* >( p->Get( i ) );
if( q )
q->pMod = this;
}
@@ -1837,11 +1827,11 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
{
bool bDone = false;
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
- SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar );
+ SbProcedureProperty* pProcProperty = dynamic_cast< SbProcedureProperty* >( pVar );
if( pProcProperty )
{
bDone = true;
@@ -2163,7 +2153,7 @@ SbObjModule::~SbObjModule()
void
SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxVariable*)pDocObject);
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >( (SbxVariable*)pDocObject);
if ( pUnoObj && pUnoObj->getUnoAny() == aObj ) // object is equal, nothing to do
return;
pDocObject = new SbUnoObject( GetName(), uno::makeAny( aObj ) );
@@ -2653,7 +2643,7 @@ void SbUserFormModule::InitObject()
do
{
SbxObject* pObjParent = pCurObject->GetParent();
- pParentBasic = PTR_CAST( StarBASIC, pObjParent );
+ pParentBasic = dynamic_cast< StarBASIC* >( pObjParent );
pCurObject = pObjParent;
}
while( pParentBasic == NULL && pCurObject != NULL );
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index d9b851260458..9d0f8ab9d699 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -166,7 +166,7 @@ SbiSymDef* SbiParser::CheckRTLForSym( const String& rSym, SbxDataType eType )
SbiSymDef* pDef = NULL;
if( pVar )
{
- if( pVar->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast< SbxMethod* >(pVar) )
{
SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym );
pProc_->SetType( pVar->GetType() );
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index 4ff9bf595464..483fc7e2a920 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -550,9 +550,10 @@ void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl )
GnLastCallLvl = nCallLvl;
SbModule* pTraceMod = pModule;
- if( pTraceMod->ISA(SbClassModuleObject) )
+ SbClassModuleObject* pClassModuleObj = dynamic_cast< SbClassModuleObject* >((SbxBase*)pTraceMod);
+
+ if(pClassModuleObj)
{
- SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
pTraceMod = pClassModuleObj->getClassModule();
}
@@ -652,10 +653,10 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallL
GnLastCallLvl = nCallLvl;
SbModule* pTraceMod = pModule;
- SbClassModuleObject* pClassModuleObj = NULL;
- if( pTraceMod->ISA(SbClassModuleObject) )
+ SbClassModuleObject* pClassModuleObj = dynamic_cast< SbClassModuleObject* >((SbxBase*)pTraceMod);
+
+ if( pClassModuleObj )
{
- pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
pTraceMod = pClassModuleObj->getClassModule();
}
@@ -981,7 +982,7 @@ sal_Bool SbModule::Compile()
{
if( pImage )
return sal_True;
- StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent());
+ StarBASIC* pBasic = dynamic_cast< StarBASIC* >( GetParent());
if( !pBasic )
return sal_False;
SbxBase::ResetError();
@@ -1005,13 +1006,13 @@ sal_Bool SbModule::Compile()
sal_Bool bRet = IsCompiled();
if( bRet )
{
- if( !this->ISA(SbObjModule) )
+ if( !dynamic_cast< SbObjModule* >(this) )
pBasic->ClearAllModuleVars();
RemoveVars(); // remove 'this' Modules variables
// clear all method statics
for( sal_uInt16 i = 0; i < pMethods->Count(); i++ )
{
- SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) );
+ SbMethod* p = dynamic_cast< SbMethod* >( pMethods->Get( i ) );
if( p )
p->ClearStatics();
}
@@ -1021,7 +1022,7 @@ sal_Bool SbModule::Compile()
{
SbxObject* pParent_ = pBasic->GetParent();
if( pParent_ )
- pBasic = PTR_CAST(StarBASIC,pParent_);
+ pBasic = dynamic_cast< StarBASIC* >( pParent_);
if( pBasic )
pBasic->ClearAllModuleVars();
}
diff --git a/basic/source/inc/sbjsmeth.hxx b/basic/source/inc/sbjsmeth.hxx
index 6616e9d9a35d..0f866ed2adf0 100644
--- a/basic/source/inc/sbjsmeth.hxx
+++ b/basic/source/inc/sbjsmeth.hxx
@@ -38,7 +38,6 @@ public:
virtual ~SbJScriptMethod();
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMETH,2);
- TYPEINFO();
};
#ifndef __SB_SBJSCRIPTMETHODREF_HXX
diff --git a/basic/source/inc/sbjsmod.hxx b/basic/source/inc/sbjsmod.hxx
index 1c22613b5689..42052865d3ea 100644
--- a/basic/source/inc/sbjsmod.hxx
+++ b/basic/source/inc/sbjsmod.hxx
@@ -36,7 +36,6 @@ class SbJScriptModule : public SbModule
virtual sal_Bool StoreData( SvStream& ) const;
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMOD,1);
- TYPEINFO();
SbJScriptModule( const String& ); // DURCHREICHEN
};
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index f7e533a5c7e4..679ae82a6a8a 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -60,7 +60,6 @@ class SbUnoObject: public SbxObject
public:
static bool getDefaultPropName( SbUnoObject* pUnoObj, String& sDfltProp );
- TYPEINFO();
SbUnoObject( const String& aName_, const ::com::sun::star::uno::Any& aUnoObj_ );
~SbUnoObject();
@@ -108,8 +107,6 @@ class SbUnoMethod : public SbxMethod
bool mbDirectInvocation; // Method should be used with XDirectInvocation interface
public:
- TYPEINFO();
-
SbUnoMethod( const String& aName_, SbxDataType eSbxType, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlMethod > xUnoMethod_,
bool bInvocation,
bool bDirect = false );
@@ -137,7 +134,6 @@ class SbUnoProperty : public SbxProperty
virtual ~SbUnoProperty();
public:
- TYPEINFO();
SbUnoProperty( const String& aName_, SbxDataType eSbxType,
const ::com::sun::star::beans::Property& aUnoProp_, sal_Int32 nId_, bool bInvocation );
@@ -159,7 +155,6 @@ class SbUnoClass : public SbxObject
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > m_xClass;
public:
- TYPEINFO();
SbUnoClass( const String& aName_ )
: SbxObject( aName_ )
{}
@@ -192,7 +187,6 @@ class SbUnoService : public SbxObject
bool m_bNeedsInit;
public:
- TYPEINFO();
SbUnoService( const String& aName_,
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 >& xServiceTypeDesc )
: SbxObject( aName_ )
@@ -222,8 +216,6 @@ class SbUnoServiceCtor : public SbxMethod
SbUnoServiceCtor* pNext;
public:
- TYPEINFO();
-
SbUnoServiceCtor( const String& aName_, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > xServiceCtorDesc );
virtual ~SbUnoServiceCtor();
virtual SbxInfo* GetInfo();
@@ -239,7 +231,6 @@ class SbUnoSingleton : public SbxObject
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XSingletonTypeDescription > m_xSingletonTypeDesc;
public:
- TYPEINFO();
SbUnoSingleton( const String& aName_,
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XSingletonTypeDescription >& xSingletonTypeDesc );
@@ -263,8 +254,6 @@ public:
const ::com::sun::star::uno::Any& getValue( void )
{ return mVal; }
-
- TYPEINFO();
};
@@ -275,7 +264,6 @@ class AutomationNamedArgsSbxArray : public SbxArray
{
::com::sun::star::uno::Sequence< ::rtl::OUString > maNameSeq;
public:
- TYPEINFO();
AutomationNamedArgsSbxArray( sal_Int32 nSeqSize )
: maNameSeq( nSeqSize )
{}
@@ -323,7 +311,6 @@ class BasicCollection : public SbxObject
void CollRemove( SbxArray* pPar_ );
public:
- TYPEINFO();
BasicCollection( const String& rClassname );
virtual SbxVariable* Find( const String&, SbxClassType );
virtual void Clear();
diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx
index 967618b255d8..8cad71b78caf 100644
--- a/basic/source/runtime/dllmgr.cxx
+++ b/basic/source/runtime/dllmgr.cxx
@@ -163,7 +163,7 @@ std::size_t alignment(SbxVariable * variable) {
case SbxOBJECT:
{
std::size_t n = 1;
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast< SbxObject* >( variable->GetObject())->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
n = std::max(n, alignment(props->Get(i)));
@@ -178,7 +178,7 @@ std::size_t alignment(SbxVariable * variable) {
return 1;
}
} else {
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast< SbxDimArray* >( variable->GetObject());
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
for (int i = 0; i < dims; ++i) {
@@ -215,7 +215,7 @@ SbError marshalStruct(
MarshalData & data)
{
OSL_ASSERT(variable != 0);
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast< SbxObject* >( variable->GetObject())->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
SbError e = marshal(false, props->Get(i), false, blob, offset, data);
@@ -231,7 +231,7 @@ SbError marshalArray(
MarshalData & data)
{
OSL_ASSERT(variable != 0);
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast< SbxDimArray* >( variable->GetObject());
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
@@ -407,7 +407,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
align(
reinterpret_cast< sal_uIntPtr >(data),
alignment(variable)));
- SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())->
+ SbxArray * props = dynamic_cast< SbxObject* >( variable->GetObject())->
GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
data = unmarshal(props->Get(i), data);
@@ -425,7 +425,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
break;
}
} else {
- SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject());
+ SbxDimArray * arr = dynamic_cast< SbxDimArray* >( variable->GetObject());
int dims = arr->GetDims();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 3300d03a1eba..130cdeed15f6 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2377,7 +2377,7 @@ RTLFUNC(IsObject)
SbUnoClass* pUnoClass;
sal_Bool bObject;
- if( pObj && NULL != ( pUnoClass=PTR_CAST(SbUnoClass,pObj) ) )
+ if( pObj && NULL != ( pUnoClass=dynamic_cast< SbUnoClass* >( pObj) ) )
{
bObject = pUnoClass->getUnoClass().is();
}
@@ -3860,7 +3860,7 @@ RTLFUNC(LBound)
return;
}
SbxBase* pParObj = rPar.Get(1)->GetObject();
- SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pArr = dynamic_cast< SbxDimArray* >( pParObj);
if( pArr )
{
sal_Int32 nLower, nUpper;
@@ -3887,7 +3887,7 @@ RTLFUNC(UBound)
}
SbxBase* pParObj = rPar.Get(1)->GetObject();
- SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pArr = dynamic_cast< SbxDimArray* >( pParObj);
if( pArr )
{
sal_Int32 nLower, nUpper;
@@ -4128,11 +4128,11 @@ RTLFUNC(Load)
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
if ( pObj )
{
- if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ if( dynamic_cast< SbUserFormModule* >(pObj) )
{
((SbUserFormModule*)pObj)->Load();
}
- else if( pObj->IsA( TYPE( SbxObject ) ) )
+ else if( dynamic_cast< SbxObject* >(pObj) )
{
SbxVariable* pVar = ((SbxObject*)pObj)->
Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
@@ -4158,12 +4158,12 @@ RTLFUNC(Unload)
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
if ( pObj )
{
- if( pObj->IsA( TYPE( SbUserFormModule ) ) )
+ if( dynamic_cast< SbUserFormModule* >(pObj) )
{
SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
pFormModule->Unload();
}
- else if( pObj->IsA( TYPE( SbxObject ) ) )
+ else if( dynamic_cast< SbxObject* >(pObj) )
{
SbxVariable* pVar = ((SbxObject*)pObj)->
Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
@@ -4212,7 +4212,7 @@ RTLFUNC(SavePicture)
}
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
- if( pObj->IsA( TYPE( SbStdPicture ) ) )
+ if( dynamic_cast< SbStdPicture* >(pObj) )
{
SvFileStream aOStream( rPar.Get(2)->GetString(), STREAM_WRITE | STREAM_TRUNC );
Graphic aGraphic = ((SbStdPicture*)pObj)->GetGraphic();
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index b2657b350f0c..897148b91baf 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -130,11 +130,11 @@ RTLFUNC(CallByName)
SbxBase* pObjVar = (SbxObject*)rPar.Get(1)->GetObject();
SbxObject* pObj = NULL;
if( pObjVar )
- pObj = PTR_CAST(SbxObject,pObjVar);
- if( !pObj && pObjVar && pObjVar->ISA(SbxVariable) )
+ pObj = dynamic_cast< SbxObject* >(pObjVar);
+ if( !pObj && pObjVar && dynamic_cast< SbxVariable* >(pObjVar) )
{
SbxBase* pObjVarObj = ((SbxVariable*)pObjVar)->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast< SbxObject* >(pObjVarObj);
}
if( !pObj )
{
@@ -196,7 +196,7 @@ RTLFUNC(CallByName)
break;
case vbMethod:
{
- SbMethod* pMeth = PTR_CAST(SbMethod,pFindVar);
+ SbMethod* pMeth = dynamic_cast< SbMethod* >(pFindVar);
if( pMeth == NULL )
{
StarBASIC::Error( SbERR_PROC_UNDEFINED );
@@ -889,7 +889,7 @@ RTLFUNC(FindObject)
SbxBase* pFind = StarBASIC::FindSBXInCurrentScope( aNameStr );
SbxObject* pFindObj = NULL;
if( pFind )
- pFindObj = PTR_CAST(SbxObject,pFind);
+ pFindObj = dynamic_cast< SbxObject* >( pFind);
/*
if( !pFindObj )
{
@@ -922,11 +922,11 @@ RTLFUNC(FindPropertyObject)
SbxBase* pObjVar = (SbxObject*)rPar.Get(1)->GetObject();
SbxObject* pObj = NULL;
if( pObjVar )
- pObj = PTR_CAST(SbxObject,pObjVar);
- if( !pObj && pObjVar && pObjVar->ISA(SbxVariable) )
+ pObj = dynamic_cast< SbxObject* >( pObjVar);
+ if( !pObj && pObjVar && dynamic_cast< SbxVariable* >(pObjVar) )
{
SbxBase* pObjVarObj = ((SbxVariable*)pObjVar)->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast< SbxObject* >( pObjVarObj);
}
/*
if( !pObj )
@@ -945,7 +945,7 @@ RTLFUNC(FindPropertyObject)
{
// Im Objekt nach Objekt suchen
SbxVariable* pFindVar = pObj->Find( aNameStr, SbxCLASS_OBJECT );
- pFindObj = PTR_CAST(SbxObject,pFindVar);
+ pFindObj = dynamic_cast< SbxObject* >( pFindVar);
}
else
StarBASIC::Error( SbERR_BAD_PARAMETER );
@@ -1225,7 +1225,7 @@ void PutGet( SbxArray& rPar, sal_Bool bPut )
if( pVar->GetType() & SbxARRAY )
{
SbxBase* pParObj = pVar->GetObject();
- pArr = PTR_CAST(SbxDimArray,pParObj);
+ pArr = dynamic_cast< SbxDimArray* >( pParObj);
}
sal_Bool bRet;
@@ -1654,7 +1654,7 @@ RTLFUNC(Join)
return;
}
SbxBase* pParObj = rPar.Get(1)->GetObject();
- SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
+ SbxDimArray* pArr = dynamic_cast< SbxDimArray* >( pParObj);
if( pArr )
{
if( pArr->GetDims() != 1 )
@@ -2700,11 +2700,11 @@ RTLFUNC(Me)
(void)bWrite;
SbModule* pActiveModule = pINST->GetActiveModule();
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
+ SbClassModuleObject* pClassModuleObject = dynamic_cast< SbClassModuleObject* >( pActiveModule);
SbxVariableRef refVar = rPar.Get(0);
if( pClassModuleObject == NULL )
{
- SbObjModule* pMod = PTR_CAST(SbObjModule,pActiveModule);
+ SbObjModule* pMod = dynamic_cast< SbObjModule* >( pActiveModule);
if ( pMod )
refVar->PutObject( pMod );
else
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index f4ffc29d2830..d7878a28d28f 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -497,8 +497,7 @@ StarBASIC* GetCurrentBasic( StarBASIC* pRTBasic )
if( pActiveModule )
{
SbxObject* pParent = pActiveModule->GetParent();
- if( pParent && pParent->ISA(StarBASIC) )
- pCurBasic = (StarBASIC*)pParent;
+ pCurBasic = dynamic_cast< StarBASIC* >(pParent);
}
return pCurBasic;
}
@@ -642,7 +641,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
SbxVariable* v = pParams->Get( i );
// Methoden sind immer byval!
- sal_Bool bByVal = v->IsA( TYPE(SbxMethod) );
+ sal_Bool bByVal = (0 != dynamic_cast< SbxMethod* >(v));
SbxDataType t = v->GetType();
bool bTargetTypeIsArray = false;
if( p )
@@ -995,7 +994,7 @@ SbxVariableRef SbiRuntime::PopVar()
DBG_TRACE( "" );
#endif
// Methods halten im 0.Parameter sich selbst, also weghauen
- if( xVar->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast< const SbxMethod* >(&xVar) )
xVar->SetParameters(0);
return xVar;
}
@@ -1146,7 +1145,7 @@ void SbiRuntime::PushForEach()
BasicCollection* pCollection;
SbxDimArray* pArray;
SbUnoObject* pUnoObj;
- if( (pArray = PTR_CAST(SbxDimArray,pObj)) != NULL )
+ if( (pArray = dynamic_cast< SbxDimArray* >( pObj)) != NULL )
{
p->eForType = FOR_EACH_ARRAY;
p->refEnd = (SbxVariable*)pArray;
@@ -1163,13 +1162,13 @@ void SbiRuntime::PushForEach()
p->pArrayUpperBounds[i] = uBound;
}
}
- else if( (pCollection = PTR_CAST(BasicCollection,pObj)) != NULL )
+ else if( (pCollection = dynamic_cast< BasicCollection* >( pObj)) != NULL )
{
p->eForType = FOR_EACH_COLLECTION;
p->refEnd = pCollection;
p->nCurCollectionIndex = 0;
}
- else if( (pUnoObj = PTR_CAST(SbUnoObject,pObj)) != NULL )
+ else if( (pUnoObj = dynamic_cast< SbUnoObject* >( pObj)) != NULL )
{
// XEnumerationAccess?
Any aAny = pUnoObj->getUnoAny();
@@ -1247,7 +1246,7 @@ SbiForStack* SbiRuntime::FindForStackItemForCollection( class BasicCollection* p
{
SbxVariable* pVar = p->refEnd.Is() ? (SbxVariable*)p->refEnd : NULL;
if( p->eForType == FOR_EACH_COLLECTION && pVar != NULL &&
- (pCollection = PTR_CAST(BasicCollection,pVar)) == pCollection )
+ (pCollection = dynamic_cast< BasicCollection* >(pVar)) == pCollection )
{
pRet = p;
break;
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index 8e1058a5a08f..b3f333da2650 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -734,7 +734,7 @@ void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx
index 4fb73cb2fea7..eb5c616f1f0e 100644
--- a/basic/source/runtime/stdobj1.cxx
+++ b/basic/source/runtime/stdobj1.cxx
@@ -119,8 +119,6 @@ void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, sal_Bool bWrite )
}
-TYPEINIT1( SbStdPicture, SbxObject );
-
SbStdPicture::SbStdPicture() :
SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Picture") ) )
{
@@ -153,7 +151,7 @@ void SbStdPicture::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST( SbxHint, &rHint );
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint );
if( pHint )
{
@@ -231,8 +229,6 @@ void SbStdFont::PropName( SbxVariable* pVar, SbxArray*, sal_Bool bWrite )
}
-TYPEINIT1( SbStdFont, SbxObject );
-
SbStdFont::SbStdFont() :
SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Font") ) )
{
@@ -275,7 +271,7 @@ SbxVariable* SbStdFont::Find( const String& rName, SbxClassType t )
void SbStdFont::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST( SbxHint, &rHint );
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint );
if( pHint )
{
@@ -447,7 +443,7 @@ void SbStdClipboard::MethSetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool )
{
SbxObject* pObj = (SbxObject*)pPar_->Get(1)->GetObject();
- if( pObj && pObj->IsA( TYPE( SbStdPicture ) ) )
+ if( pObj && dynamic_cast< SbStdPicture* >(pObj) )
((SbStdPicture*)(SbxObject*)pObj)->GetGraphic().Copy();
}
*/
@@ -467,8 +463,6 @@ void SbStdClipboard::MethSetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool )
}
-TYPEINIT1( SbStdClipboard, SbxObject );
-
SbStdClipboard::SbStdClipboard() :
SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Clipboard") ) )
{
@@ -514,7 +508,7 @@ SbxVariable* SbStdClipboard::Find( const String& rName, SbxClassType t )
void SbStdClipboard::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST( SbxHint, &rHint );
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint );
if( pHint )
{
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index f7cb7fbe8f8b..24986d551415 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -341,18 +341,18 @@ inline void checkUnoStructCopy( SbxVariableRef& refVal, SbxVariableRef& refVar )
return;
SbxObjectRef xValObj = (SbxObject*)refVal->GetObject();
- if( !xValObj.Is() || xValObj->ISA(SbUnoAnyObject) )
+ if( !xValObj.Is() || dynamic_cast< const SbUnoAnyObject* >(&xValObj) )
return;
// #115826: Exclude ProcedureProperties to avoid call to Property Get procedure
- if( refVar->ISA(SbProcedureProperty) )
+ if( dynamic_cast< SbProcedureProperty* >(&refVar) )
return;
SbxObjectRef xVarObj = (SbxObject*)refVar->GetObject();
SbxDataType eValType = refVal->GetType();
if( eValType == SbxOBJECT && xVarObj == xValObj )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)xVarObj);
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >( (SbxObject*)xVarObj);
if( pUnoObj )
{
Any aAny = pUnoObj->getUnoAny();
@@ -491,7 +491,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
SbxBase* pObjVarObj = refVal->GetObject();
if( pObjVarObj )
{
- SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
+ SbxVariableRef refObjVal = dynamic_cast< SbxObject* >( pObjVarObj);
// #67733 Typen mit Array-Flag sind auch ok
if( refObjVal )
@@ -519,7 +519,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
n = refVar->GetFlags();
refVar->SetFlag( SBX_WRITE );
}
- SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar);
+ SbProcedureProperty* pProcProperty = dynamic_cast< SbProcedureProperty* >( (SbxVariable*)refVar);
if( pProcProperty )
pProcProperty->setSet( true );
@@ -543,17 +543,14 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
{
// check if lhs is a null object
// if it is then use the object not the default property
- SbxObject* pObj = NULL;
-
-
- pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar);
+ SbxObject* pObj = dynamic_cast< SbxObject* >((SbxVariable*)refVar);
// calling GetObject on a SbxEMPTY variable raises
// object not set errors, make sure its an Object
if ( !pObj && refVar->GetType() == SbxOBJECT )
{
SbxBase* pObjVarObj = refVar->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast< SbxObject* >( pObjVarObj);
}
SbxVariable* pDflt = NULL;
if ( pObj || bLHSHasDefaultProp )
@@ -575,9 +572,8 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
if ( bWithEvents )
{
Reference< XInterface > xComListener;
-
SbxBase* pObj = refVal->GetObject();
- SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
+ SbUnoObject* pUnoObj = (pObj) ? dynamic_cast< SbUnoObject* >(pObj) : 0;
if( pUnoObj != NULL )
{
Any aControlAny = pUnoObj->getUnoAny();
@@ -600,7 +596,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
if ( bDimAsNew )
{
- if( !refVar->ISA(SbxObject) )
+ if( !dynamic_cast< SbxObject* >(&refVar) )
{
SbxBase* pValObjBase = refVal->GetObject();
if( pValObjBase == NULL )
@@ -636,12 +632,12 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
if( bFirstInit )
{
// Store information to instantiate object later
- SbxObject* pValObj = PTR_CAST(SbxObject,pValObjBase);
+ SbxObject* pValObj = dynamic_cast< SbxObject* >(pValObjBase);
if( pValObj != NULL )
{
String aObjClass = pValObj->GetClassName();
- SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pValObjBase);
+ SbClassModuleObject* pClassModuleObj = dynamic_cast< SbClassModuleObject* >(pValObjBase);
if( pClassModuleObj != NULL )
{
SbModule* pClassModule = pClassModuleObj->getClassModule();
@@ -867,7 +863,7 @@ void SbiRuntime::StepREDIMP()
if( refRedimpArray.Is() )
{
SbxBase* pElemObj = refVar->GetObject();
- SbxDimArray* pNewArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pNewArray = dynamic_cast< SbxDimArray* >( pElemObj);
SbxDimArray* pOldArray = (SbxDimArray*)(SbxArray*)refRedimpArray;
if( pNewArray )
{
@@ -952,7 +948,7 @@ void SbiRuntime::StepREDIMP_ERASE()
if( eType & SbxARRAY )
{
SbxBase* pElemObj = refVar->GetObject();
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pDimArray = dynamic_cast< SbxDimArray* >( pElemObj);
if( pDimArray )
{
refRedimpArray = pDimArray;
@@ -989,7 +985,7 @@ void lcl_eraseImpl( SbxVariableRef& refVar, bool bVBAEnabled )
if ( bVBAEnabled )
{
SbxBase* pElemObj = refVar->GetObject();
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pDimArray = dynamic_cast< SbxDimArray* >( pElemObj);
bool bClearValues = true;
if( pDimArray )
{
@@ -1004,7 +1000,7 @@ void lcl_eraseImpl( SbxVariableRef& refVar, bool bVBAEnabled )
}
if ( bClearValues )
{
- SbxArray* pArray = PTR_CAST(SbxArray,pElemObj);
+ SbxArray* pArray = dynamic_cast< SbxArray* >( pElemObj);
if ( pArray )
pArray->Clear();
}
@@ -1085,9 +1081,7 @@ void SbiRuntime::StepARGV()
{
SbxVariableRef pVal = PopVar();
- // Before fix of #94916:
- // if( pVal->ISA(SbxMethod) || pVal->ISA(SbxProperty) )
- if( pVal->ISA(SbxMethod) || pVal->ISA(SbUnoProperty) || pVal->ISA(SbProcedureProperty) )
+ if( dynamic_cast< const SbxMethod* >(&pVal) || dynamic_cast< const SbUnoProperty* >(&pVal) || dynamic_cast< const SbProcedureProperty* >(&pVal) )
{
// Methoden und Properties evaluieren!
SbxVariable* pRes = new SbxVariable( *pVal );
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index e324414d1147..95d8d844f4ee 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -457,21 +457,21 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
{
SbxObject* pObj;
SbxVariable* pVal = (SbxVariable*)refVal;
- if( pVal->IsA( TYPE(SbxObject) ) )
+ if( dynamic_cast< SbxObject* >(pVal) )
pObj = (SbxObject*) pVal;
else
{
pObj = (SbxObject*) refVal->GetObject();
- if( pObj && !pObj->IsA( TYPE(SbxObject) ) )
+ if( pObj && !dynamic_cast< SbxObject* >(pObj) )
pObj = NULL;
}
if( pObj )
{
if( !implIsClass( pObj, aClass ) )
{
- if ( bVBAEnabled && pObj->IsA( TYPE(SbUnoObject) ) )
+ if ( bVBAEnabled && dynamic_cast< SbUnoObject* >(pObj) )
{
- SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >( pObj);
bOk = checkUnoObjectType( pUnoObj, aClass );
}
else
@@ -486,7 +486,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
{
bOk = true;
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pObj);
+ SbClassModuleObject* pClassModuleObject = dynamic_cast< SbClassModuleObject* >( pObj);
if( pClassModuleObject != NULL )
pClassModuleObject->triggerInitializeEvent();
}
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index b01dd573ecca..857a87f0f805 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -225,7 +225,7 @@ SbxVariable* SbiRuntime::FindElement
// Ein bestimmter Call-Type wurde gewuenscht, daher muessen
// wir hier den Typ setzen und das Ding anfassen, um den
// korrekten Returnwert zu erhalten!
- if( pElem->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast< SbxMethod* >(pElem) )
{
// Soll der Typ konvertiert werden?
SbxDataType t2 = pElem->GetType();
@@ -266,7 +266,7 @@ SbxVariable* SbiRuntime::FindElement
// definitely we want this for VBA where properties are often
// collections ( which need index access ), but lets only do
// this if we actually have params following
- else if( bVBAEnabled && pElem->ISA(SbUnoProperty) && pElem->GetParameters() )
+ else if( bVBAEnabled && dynamic_cast< SbUnoProperty* >(pElem) && pElem->GetParameters() )
{
// pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen
SbxVariableRef refTemp = pElem;
@@ -377,11 +377,11 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
{
bool bError_ = true;
- SbUnoMethod* pUnoMethod = PTR_CAST(SbUnoMethod,p);
- SbUnoProperty* pUnoProperty = PTR_CAST(SbUnoProperty,p);
+ SbUnoMethod* pUnoMethod = dynamic_cast< SbUnoMethod* >(p);
+ SbUnoProperty* pUnoProperty = dynamic_cast< SbUnoProperty* >(p);
if( pUnoMethod || pUnoProperty )
{
- SbUnoObject* pParentUnoObj = PTR_CAST( SbUnoObject,p->GetParent() );
+ SbUnoObject* pParentUnoObj = dynamic_cast< SbUnoObject* >( p->GetParent() );
if( pParentUnoObj )
{
Any aUnoAny = pParentUnoObj->getUnoAny();
@@ -407,11 +407,11 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
}
}
}
- else if( bVBAEnabled && p->GetType() == SbxOBJECT && (!p->ISA(SbxMethod) || !p->IsBroadcaster()) )
+ else if( bVBAEnabled && p->GetType() == SbxOBJECT && (!dynamic_cast< SbxMethod* >(p) || !p->IsBroadcaster()) )
{
// Check for default method with named parameters
SbxBaseRef pObj = (SbxBase*)p->GetObject();
- if( pObj && pObj->ISA(SbUnoObject) )
+ if( pObj && dynamic_cast< SbUnoObject* >((SbxBase*)pObj) )
{
SbUnoObject* pUnoObj = (SbUnoObject*)(SbxBase*)pObj;
Any aAny = pUnoObj->getUnoAny();
@@ -488,7 +488,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
if( pElem->GetType() & SbxARRAY )
{
SbxBase* pElemObj = pElem->GetObject();
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pDimArray = dynamic_cast< SbxDimArray* >( pElemObj);
pPar = pElem->GetParameters();
if( pDimArray )
{
@@ -499,7 +499,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
else
{
- SbxArray* pArray = PTR_CAST(SbxArray,pElemObj);
+ SbxArray* pArray = dynamic_cast< SbxArray* >( pElemObj);
if( pArray )
{
if( !pPar )
@@ -517,7 +517,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
pPar->Put( NULL, 0 );
}
// Index-Access bei UnoObjekten beruecksichtigen
- else if( pElem->GetType() == SbxOBJECT && (!pElem->ISA(SbxMethod) || (bVBAEnabled && !pElem->IsBroadcaster()) ) )
+ else if( pElem->GetType() == SbxOBJECT && (!dynamic_cast< SbxMethod* >(pElem) || (bVBAEnabled && !pElem->IsBroadcaster())))
{
pPar = pElem->GetParameters();
if ( pPar )
@@ -526,9 +526,10 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
SbxBaseRef pObj = (SbxBase*)pElem->GetObject();
if( pObj )
{
- if( pObj->ISA(SbUnoObject) )
+ SbUnoObject* pUnoObj = dynamic_cast< SbUnoObject* >((SbxBase*)pObj);
+
+ if( pUnoObj )
{
- SbUnoObject* pUnoObj = (SbUnoObject*)(SbxBase*)pObj;
Any aAny = pUnoObj->getUnoAny();
if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE )
@@ -609,14 +610,18 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
// #42940, 0.Parameter zu NULL setzen, damit sich Var nicht selbst haelt
pPar->Put( NULL, 0 );
}
- else if( pObj->ISA(BasicCollection) )
+ else
+ {
+ BasicCollection* pCol = dynamic_cast< BasicCollection* >((SbxBase*)pObj);
+
+ if( pCol )
{
- BasicCollection* pCol = (BasicCollection*)(SbxBase*)pObj;
pElem = new SbxVariable( SbxVARIANT );
pPar->Put( pElem, 0 );
pCol->CollItem( pPar );
}
}
+ }
else if( bVBAEnabled ) // !pObj
{
SbxArray* pParam = pElem->GetParameters();
@@ -654,7 +659,7 @@ void SbiRuntime::StepFIND( sal_uInt32 nOp1, sal_uInt32 nOp2 )
void SbiRuntime::StepFIND_CM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pMod);
+ SbClassModuleObject* pClassModuleObject = dynamic_cast< SbClassModuleObject* >( pMod);
if( pClassModuleObject )
pMod->SetFlag( SBX_GBLSEARCH );
@@ -677,11 +682,11 @@ void SbiRuntime::StepELEM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
// Liegt auf dem TOS ein Objekt?
SbxVariableRef pObjVar = PopVar();
- SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pObjVar);
+ SbxObject* pObj = dynamic_cast< SbxObject* >( (SbxVariable*) pObjVar);
if( !pObj )
{
SbxBase* pObjVarObj = pObjVar->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
+ pObj = dynamic_cast< SbxObject* >( pObjVarObj);
}
// #56368 Bei StepElem Referenz sichern, sonst koennen Objekte
@@ -1004,12 +1009,10 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
return;
}
- SbxDimArray* pArray = 0;
- if( xObj->ISA(SbxDimArray) )
- {
- SbxBase* pObj = (SbxBase*)xObj;
- pArray = (SbxDimArray*)pObj;
+ SbxDimArray* pArray = dynamic_cast< SbxDimArray* >((SbxBase*)xObj);
+ if( pArray )
+ {
// Dimensionen auswerten
short nDims = pArray->GetDims();
sal_Int32 nTotalSize = 0;
diff --git a/basic/source/sample/collelem.cxx b/basic/source/sample/collelem.cxx
index ebc0a190c21c..25ce71bc72e2 100644
--- a/basic/source/sample/collelem.cxx
+++ b/basic/source/sample/collelem.cxx
@@ -46,7 +46,7 @@ SampleElement::SampleElement( const String& r ) : SbxObject( r )
void SampleElement::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/basic/source/sample/object.cxx b/basic/source/sample/object.cxx
index 2688150f3a9a..86251116cba2 100644
--- a/basic/source/sample/object.cxx
+++ b/basic/source/sample/object.cxx
@@ -166,7 +166,7 @@ SbxVariable* SampleObject::Find( const String& rName, SbxClassType t )
void SampleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT,
const SfxHint& rHint, const TypeId& rHT )
{
- const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* pHint = dynamic_cast< const SbxHint* >( &rHint);
if( pHint )
{
SbxVariable* pVar = pHint->GetVar();
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index 0aedab76637b..9316abb18ed7 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -51,9 +51,6 @@ public:
};
-TYPEINIT1(SbxArray,SbxBase)
-TYPEINIT1(SbxDimArray,SbxArray)
-
//////////////////////////////////////////////////////////////////////////
//
// SbxArray
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 1ee777ef74e3..232c2f5d4bd4 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -37,8 +37,6 @@
SV_IMPL_PTRARR(SbxParams,SbxParamInfo*);
SV_IMPL_PTRARR(SbxFacs,SbxFactory*);
-TYPEINIT0(SbxBase)
-
// SBX-Daten anfordern oder ggf. anlegen
// wir legen den Bereich einfach an und verzichten auf die Freigabe!
diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx
index 516f47f966b3..2129fdb5b71b 100644
--- a/basic/source/sbx/sbxbool.cxx
+++ b/basic/source/sbx/sbxbool.cxx
@@ -110,7 +110,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetBool() ? SbxTRUE : SbxFALSE;
else
@@ -205,7 +205,7 @@ void ImpPutBool( SbxValues* p, sal_Int16 n )
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutBool( sal_Bool( n != 0 ) );
else
diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx
index 2beafbf9ffa2..a3cc1047a5db 100644
--- a/basic/source/sbx/sbxbyte.cxx
+++ b/basic/source/sbx/sbxbyte.cxx
@@ -183,7 +183,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetByte();
else
@@ -281,7 +281,7 @@ void ImpPutByte( SbxValues* p, sal_uInt8 n )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutByte( n );
else
diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx
index 72bd0f7bd895..2a875bdebc77 100644
--- a/basic/source/sbx/sbxchar.cxx
+++ b/basic/source/sbx/sbxchar.cxx
@@ -172,7 +172,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetChar();
else
@@ -275,7 +275,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutChar( n );
else
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 3a38b8b0875a..f7381502f164 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -30,9 +30,6 @@
#include <basic/sbx.hxx>
#include "sbxres.hxx"
-TYPEINIT1(SbxCollection,SbxObject)
-TYPEINIT1(SbxStdCollection,SbxCollection)
-
static const char* pCount;
static const char* pAdd;
static const char* pItem;
@@ -122,7 +119,7 @@ SbxVariable* SbxCollection::Find( const XubString& rName, SbxClassType t )
void SbxCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1,
const SfxHint& rHint, const TypeId& rId2 )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast< const SbxHint* >( &rHint);
if( p )
{
sal_uIntPtr nId = p->GetId();
@@ -164,7 +161,7 @@ void SbxCollection::CollAdd( SbxArray* pPar_ )
else
{
SbxBase* pObj = pPar_->Get( 1 )->GetObject();
- if( !pObj || !( pObj->ISA(SbxObject) ) )
+ if( !pObj || !( dynamic_cast< SbxObject* >(pObj) ) )
SetError( SbxERR_NOTIMP );
else
Insert( (SbxObject*) pObj );
@@ -250,7 +247,7 @@ SbxStdCollection::~SbxStdCollection()
void SbxStdCollection::Insert( SbxVariable* p )
{
- SbxObject* pObj = PTR_CAST(SbxObject,p);
+ SbxObject* pObj = dynamic_cast< SbxObject* >( p);
if( pObj && !pObj->IsClass( aElemClass ) )
SetError( SbxERR_BAD_ACTION );
else
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index 5c64879a4bf2..b5e5aae0fb74 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -124,7 +124,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetCurrency();
else
@@ -227,7 +227,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutCurrency( r );
else
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index e9e3bbdd47bc..9f4130b4869e 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -140,7 +140,7 @@ double ImpGetDate( const SbxValues* p )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetDate();
else
@@ -298,7 +298,7 @@ start:
}
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutDate( n );
else
diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx
index 5674dc49cb63..602531987d2e 100644
--- a/basic/source/sbx/sbxdbl.cxx
+++ b/basic/source/sbx/sbxdbl.cxx
@@ -94,7 +94,7 @@ double ImpGetDouble( const SbxValues* p )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetDouble();
else
@@ -190,7 +190,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutDouble( n );
else
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 92770f598f8d..18c02466ef14 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -527,7 +527,7 @@ start:
pnDecRes->setString( p->pOUString ); break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pnDecRes->setDecimal( pVal->GetDecimal() );
else
@@ -673,7 +673,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutDecimal( pDec );
else
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index bef0edd67392..43f9cda0e94e 100644
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -115,10 +115,10 @@ static SbxVariable* QualifiedName
{
// Es folgt noch ein Objektelement. Das aktuelle Element
// muss also ein SBX-Objekt sein oder liefern!
- pObj = PTR_CAST(SbxObject,(SbxVariable*) refVar);
+ pObj = dynamic_cast< SbxObject* >( (SbxVariable*) refVar);
if( !pObj )
// Dann muss es ein Objekt liefern
- pObj = PTR_CAST(SbxObject,refVar->GetObject());
+ pObj = dynamic_cast< SbxObject* >( refVar->GetObject());
refVar.Clear();
if( !pObj )
break;
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index 95ae7a57cd1b..eca771a89c8d 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -172,7 +172,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetInteger();
else
@@ -277,7 +277,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutInteger( n );
else
@@ -473,7 +473,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetInt64();
else
@@ -580,7 +580,7 @@ start:
}
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutInt64( n );
else
@@ -776,7 +776,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetUInt64();
else
@@ -885,7 +885,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutUInt64( n );
else
diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx
index f6c1f9dbd52c..3571fe201d7e 100644
--- a/basic/source/sbx/sbxlng.cxx
+++ b/basic/source/sbx/sbxlng.cxx
@@ -137,7 +137,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetLong();
else
@@ -242,7 +242,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutLong( n );
else
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 9934331c4a18..d6fa364c18ac 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -30,10 +30,6 @@
#include "sbxres.hxx"
#include <svl/brdcst.hxx>
-TYPEINIT1(SbxMethod,SbxVariable)
-TYPEINIT1(SbxProperty,SbxVariable)
-TYPEINIT2(SbxObject,SbxVariable,SfxListener)
-
static const char* pNameProp; // Name-Property
static const char* pParentProp; // Parent-Property
@@ -141,7 +137,7 @@ void SbxObject::Clear()
void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
const SfxHint& rHint, const TypeId& )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast< const SbxHint* >( &rHint);
if( p )
{
sal_uIntPtr nId = p->GetId();
@@ -292,7 +288,7 @@ SbxVariable* SbxObject::Find( const XubString& rName, SbxClassType t )
sal_Bool SbxObject::Call( const XubString& rName, SbxArray* pParam )
{
SbxVariable* pMeth = FindQualified( rName, SbxCLASS_DONTCARE);
- if( pMeth && pMeth->ISA(SbxMethod) )
+ if( pMeth && dynamic_cast< SbxMethod* >(pMeth) )
{
// FindQualified() koennte schon zugeschlagen haben!
if( pParam )
@@ -392,7 +388,7 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy
if( !pArray )
return NULL;
// Collections duerfen gleichnamige Objekte enthalten
- if( !( ct == SbxCLASS_OBJECT && ISA(SbxCollection) ) )
+ if( !( ct == SbxCLASS_OBJECT && dynamic_cast< SbxCollection* >(this) ) )
{
SbxVariable* pRes = pArray->Find( rName, ct );
if( pRes )
@@ -441,7 +437,7 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy
SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClass )
{
// Ist das Objekt bereits vorhanden?
- if( !ISA(SbxCollection) )
+ if( !dynamic_cast< SbxCollection* >(this) )
{
SbxVariable* pRes = pObjs->Find( rName, SbxCLASS_OBJECT );
if( pRes )
@@ -460,7 +456,7 @@ SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClas
}
#endif
*/
- return PTR_CAST(SbxObject,pRes);
+ return dynamic_cast< SbxObject* >( pRes);
}
}
SbxObject* pVar = CreateObject( rClass );
@@ -488,8 +484,10 @@ void SbxObject::Insert( SbxVariable* pVar )
{
// dann gibt es dieses Element bereits
// Bei Collections duerfen gleichnamige Objekte hinein
- if( pArray == pObjs && ISA(SbxCollection) )
+ if( pArray == pObjs && dynamic_cast< SbxCollection* >(this) )
+ {
nIdx = pArray->Count();
+ }
else
{
SbxVariable* pOld = pArray->Get( nIdx );
@@ -529,8 +527,8 @@ void SbxObject::Insert( SbxVariable* pVar )
static const char* pCls[] =
{ "DontCare","Array","Value","Variable","Method","Property","Object" };
XubString aVarName( pVar->GetName() );
- if ( !aVarName.Len() && pVar->ISA(SbxObject) )
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ if ( !aVarName.Len() && dynamic_cast< const SbxObject* >(pVar) )
+ aVarName = dynamic_cast< SbxObject* >( pVar)->GetClassName();
ByteString aNameStr1( (const UniString&)aVarName, RTL_TEXTENCODING_ASCII_US );
ByteString aNameStr2( (const UniString&)SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US );
DbgOutf( "SBX: Insert %s %s in %s",
@@ -569,8 +567,8 @@ void SbxObject::QuickInsert( SbxVariable* pVar )
static const char* pCls[] =
{ "DontCare","Array","Value","Variable","Method","Property","Object" };
XubString aVarName( pVar->GetName() );
- if ( !aVarName.Len() && pVar->ISA(SbxObject) )
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ if ( !aVarName.Len() && dynamic_cast< SbxObject* >(pVar) )
+ aVarName = dynamic_cast< SbxObject* >( pVar)->GetClassName();
ByteString aNameStr1( (const UniString&)aVarName, RTL_TEXTENCODING_ASCII_US );
ByteString aNameStr2( (const UniString&)SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US );
DbgOutf( "SBX: Insert %s %s in %s",
@@ -621,8 +619,8 @@ void SbxObject::Remove( SbxVariable* pVar )
{
#ifdef DBG_UTIL
XubString aVarName( pVar->GetName() );
- if ( !aVarName.Len() && pVar->ISA(SbxObject) )
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ if ( !aVarName.Len() && dynamic_cast< SbxObject* >(pVar) )
+ aVarName = dynamic_cast< SbxObject* >( pVar)->GetClassName();
ByteString aNameStr1( (const UniString&)aVarName, RTL_TEXTENCODING_ASCII_US );
ByteString aNameStr2( (const UniString&)SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US );
#endif
@@ -949,7 +947,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
XubString aAttrs2;
if( CollectAttrs( pVar, aAttrs2 ) )
aLine += aAttrs2;
- if( !pVar->IsA( TYPE(SbxMethod) ) )
+ if( !dynamic_cast< SbxMethod* >(pVar) )
aLine.AppendAscii( " !! Not a Method !!" );
rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
@@ -982,7 +980,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
XubString aAttrs3;
if( CollectAttrs( pVar, aAttrs3 ) )
aLine += aAttrs3;
- if( !pVar->IsA( TYPE(SbxProperty) ) )
+ if( !dynamic_cast< SbxProperty* >(pVar) )
aLine.AppendAscii( " !! Not a Property !!" );
rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
@@ -1011,9 +1009,9 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
if ( pVar )
{
rStrm << aIndentNameStr.GetBuffer() << " - Sub";
- if ( pVar->ISA(SbxObject) )
+ if ( dynamic_cast< SbxObject* >(pVar) )
((SbxObject*) pVar)->Dump( rStrm, bFill );
- else if ( pVar->ISA(SbxVariable) )
+ else if ( dynamic_cast< SbxVariable* >(pVar) )
((SbxVariable*) pVar)->Dump( rStrm, bFill );
}
}
@@ -1079,7 +1077,7 @@ void SbxObject::GarbageCollection( sal_uIntPtr nObjects )
while ( pObj && 0 != nObjects-- )
{
// hat der Parent nur noch 1 Ref-Count?
- SbxObject *pParent = PTR_CAST( SbxObject, pObj->GetParent() );
+ SbxObject *pParent = dynamic_cast< SbxObject* >( pObj->GetParent() );
if ( pParent && 1 == pParent->GetRefCount() )
{
// dann alle Properies des Objects durchsuchen
@@ -1126,12 +1124,12 @@ void SbxObject::GarbageCollection( sal_uIntPtr nObjects )
for ( sal_uIntPtr n = 0; n < rVars.Count(); ++n )
{
SbxVariable *pVar = rVars.GetObject(n);
- SbxObject *pObj = PTR_CAST(SbxObject, pVar);
+ SbxObject *pObj = dynamic_cast< SbxObject* >( pVar);
sal_uInt16 nFlags = pVar->GetFlags();
pVar->SetFlag(SBX_NO_BROADCAST);
if ( pObj )
pObj->Dump(aStream);
- else if ( !pVar->GetParent() || !pVar->GetParent()->ISA(SbxObject) )
+ else if ( !pVar->GetParent() || !dynamic_cast< SbxObject* >(pVar->GetParent()) )
pVar->Dump(aStream);
pVar->SetFlags(nFlags);
}
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 910e61a182d8..2bc9d90fcc59 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -402,7 +402,7 @@ void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, sal_Bool bCoreS
*p++ = '-';
}
double dMaxNumWithoutExp = (nPrec == 6) ? 1E6 : 1E14;
- myftoa( nNum, p, nPrec,( nNum &&( nNum < 1E-1 || nNum >= dMaxNumWithoutExp ) ) ? 4:0,
+ myftoa( nNum, p, nPrec,( nNum &&( nNum < 1E-1 || nNum > dMaxNumWithoutExp ) ) ? 4:0,
sal_False, sal_True, cDecimalSep );
// Trailing Zeroes weg:
for( p = cBuf; *p &&( *p != 'E' ); p++ ) {}
diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx
index e8e2dc80398f..9c67df1c70d1 100644
--- a/basic/source/sbx/sbxsng.cxx
+++ b/basic/source/sbx/sbxsng.cxx
@@ -132,7 +132,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetSingle();
else
@@ -240,7 +240,7 @@ start:
}
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutSingle( n );
else
diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index e4b7b612c961..3fb8665d3799 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -87,14 +87,14 @@ using namespace rtl;
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
aRes = pVal->GetString();
else if( p->pObj && p->pObj->IsFixed()
&& (p->pObj->GetType() == (SbxARRAY | SbxBYTE )) )
{
// convert byte array to string
- SbxArray* pArr = PTR_CAST(SbxArray, p->pObj);
+ SbxArray* pArr = dynamic_cast< SbxArray* >( p->pObj);
if( pArr )
aRes = ByteArrayToString( pArr );
}
@@ -216,7 +216,7 @@ void ImpPutString( SbxValues* p, const ::rtl::OUString* n )
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutString( *n );
else
diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx
index e27c87619796..61826777f0b1 100644
--- a/basic/source/sbx/sbxuint.cxx
+++ b/basic/source/sbx/sbxuint.cxx
@@ -169,7 +169,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetUShort();
else
@@ -274,7 +274,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutUShort( n );
else
diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx
index b16f56c5817b..3f3ff9ea5004 100644
--- a/basic/source/sbx/sbxulng.cxx
+++ b/basic/source/sbx/sbxulng.cxx
@@ -145,7 +145,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
nRes = pVal->GetULong();
else
@@ -248,7 +248,7 @@ start:
break;
case SbxOBJECT:
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->pObj);
if( pVal )
pVal->PutULong( n );
else
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 664842d024d2..bb0e80f77e2e 100755
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -38,8 +38,6 @@ using namespace rtl;
#endif
-TYPEINIT1(SbxValue,SbxBase)
-
/////////////////////////// SbxINT64 /////////////////////////////////////
SbxINT64 &SbxINT64::operator -= ( const SbxINT64 &r )
{
@@ -316,7 +314,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
&& (aData.eType == SbxSTRING) )
{
SbxBase* pObj = r.GetObject();
- SbxArray* pArr = PTR_CAST(SbxArray, pObj);
+ SbxArray* pArr = dynamic_cast< SbxArray* >( pObj);
if( pArr )
{
::rtl::OUString aStr = ByteArrayToString( pArr );
@@ -358,7 +356,7 @@ SbxValue::~SbxValue()
if( aData.pObj && aData.pObj != this )
{
HACK(nicht bei Parent-Prop - sonst CyclicRef)
- SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
+ SbxVariable *pThisVar = dynamic_cast< SbxVariable* >( this);
sal_Bool bParentProp = pThisVar && 5345 ==
( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) );
if ( !bParentProp )
@@ -389,7 +387,7 @@ void SbxValue::Clear()
if( aData.pObj != this )
{
HACK(nicht bei Parent-Prop - sonst CyclicRef)
- SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
+ SbxVariable *pThisVar = dynamic_cast< SbxVariable* >( this);
sal_Bool bParentProp = pThisVar && 5345 ==
( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) );
if ( !bParentProp )
@@ -443,7 +441,7 @@ SbxValue* SbxValue::TheRealValue( sal_Bool bObjInObjError ) const
if( t == SbxOBJECT )
{
// Der Block enthaelt ein Objekt oder eine Variable
- SbxObject* pObj = PTR_CAST(SbxObject,p->aData.pObj);
+ SbxObject* pObj = dynamic_cast< SbxObject* >( p->aData.pObj);
if( pObj )
{
// Hat das Objekt eine Default-Property?
@@ -475,18 +473,18 @@ SbxValue* SbxValue::TheRealValue( sal_Bool bObjInObjError ) const
break;
}
// Haben wir ein Array?
- SbxArray* pArray = PTR_CAST(SbxArray,p->aData.pObj);
+ SbxArray* pArray = dynamic_cast< SbxArray* >( p->aData.pObj);
if( pArray )
{
// Ggf. Parameter holen
SbxArray* pPar = NULL;
- SbxVariable* pVar = PTR_CAST(SbxVariable,p);
+ SbxVariable* pVar = dynamic_cast< SbxVariable* >( p);
if( pVar )
pPar = pVar->GetParameters();
if( pPar )
{
// Haben wir ein dimensioniertes Array?
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,p->aData.pObj);
+ SbxDimArray* pDimArray = dynamic_cast< SbxDimArray* >( p->aData.pObj);
if( pDimArray )
p = pDimArray->Get( pPar );
else
@@ -495,7 +493,7 @@ SbxValue* SbxValue::TheRealValue( sal_Bool bObjInObjError ) const
}
}
// Sonst einen SbxValue annehmen
- SbxValue* pVal = PTR_CAST(SbxValue,p->aData.pObj);
+ SbxValue* pVal = dynamic_cast< SbxValue* >( p->aData.pObj);
if( pVal )
p = pVal;
else
@@ -772,7 +770,7 @@ sal_Bool SbxValue::Put( const SbxValues& rVal )
DBG_ERROR( "TheRealValue" );
}
HACK(nicht bei Parent-Prop - sonst CyclicRef)
- SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
+ SbxVariable *pThisVar = dynamic_cast< SbxVariable* >( this);
sal_Bool bParentProp = pThisVar && 5345 ==
( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) );
if ( !bParentProp )
@@ -990,7 +988,7 @@ sal_Bool SbxValue::ImpIsNumeric( sal_Bool bOnlyIntntl ) const
SetError( SbxERR_PROP_WRITEONLY ); return sal_False;
}
// Downcast pruefen!!!
- if( this->ISA(SbxVariable) )
+ if( dynamic_cast< const SbxVariable* >(this) )
((SbxVariable*)this)->Broadcast( SBX_HINT_DATAWANTED );
SbxDataType t = GetType();
if( t == SbxSTRING )
@@ -1061,7 +1059,7 @@ sal_Bool SbxValue::SetType( SbxDataType t )
if( aData.pObj && aData.pObj != this )
{
HACK(nicht bei Parent-Prop - sonst CyclicRef)
- SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
+ SbxVariable *pThisVar = dynamic_cast< SbxVariable* >( this);
sal_uInt16 nSlotId = pThisVar
? ( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) )
: 0;
@@ -1807,7 +1805,7 @@ sal_Bool SbxValue::StoreData( SvStream& r ) const
// sich selbst als Objektptr speichern geht nicht!
if( aData.pObj )
{
- if( PTR_CAST(SbxValue,aData.pObj) != this )
+ if( dynamic_cast< SbxValue* >( aData.pObj) != this )
{
r << (sal_uInt8) 1;
return aData.pObj->Store( r );
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index c512d1e3def4..b6d61b65eb3a 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -40,9 +40,6 @@ using namespace com::sun::star::uno;
///////////////////////////// SbxVariable //////////////////////////////
-TYPEINIT1(SbxVariable,SbxValue)
-TYPEINIT1(SbxHint,SfxSimpleHint)
-
extern sal_uInt32 nVarCreator; // in SBXBASE.CXX, fuer LoadData()
#ifdef DBG_UTIL
static sal_uIntPtr nVar = 0;
@@ -365,7 +362,7 @@ void SbxVariable::SetParent( SbxObject* p )
{
#ifdef DBG_UTIL
// wird der Parent eines SbxObjects gesetzt?
- if ( p && ISA(SbxObject) )
+ if ( p && dynamic_cast< SbxObject* >(this) )
{
// dann mu\s dieses auch Child vom neuen Parent sein
sal_Bool bFound = sal_False;
@@ -533,7 +530,7 @@ sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const
{
rStrm << (sal_uInt8) 0xFF; // Marker
sal_Bool bValStore;
- if( this->IsA( TYPE(SbxMethod) ) )
+ if( dynamic_cast< const SbxMethod* >(this) )
{
// #50200 Verhindern, dass Objekte, die zur Laufzeit als Return-Wert
// in der Methode als Value gespeichert sind, mit gespeichert werden
@@ -629,7 +626,7 @@ void SbxAlias::Broadcast( sal_uIntPtr nHt )
void SbxAlias::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
const SfxHint& rHint, const TypeId& )
{
- const SbxHint* p = PTR_CAST(SbxHint,&rHint);
+ const SbxHint* p = dynamic_cast< const SbxHint* >( &rHint);
if( p && p->GetId() == SBX_HINT_DYING )
{
xAlias.Clear();
diff --git a/canvas/source/tools/canvascustomspritehelper.cxx b/canvas/source/tools/canvascustomspritehelper.cxx
index 2a8ed9298946..acfdfc94519e 100644
--- a/canvas/source/tools/canvascustomspritehelper.cxx
+++ b/canvas/source/tools/canvascustomspritehelper.cxx
@@ -450,8 +450,7 @@ namespace canvas
{
// Internal! Only call with locked object mutex!
::basegfx::B2DHomMatrix aTransform( maTransform );
- aTransform.translate( maPosition.getX(),
- maPosition.getY() );
+ aTransform.translate(maPosition);
// transform bounds at origin, as the sprite transformation is
// formulated that way
diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx
index 7a5b8599588e..7805efc5bc6f 100755
--- a/canvas/source/tools/canvastools.cxx
+++ b/canvas/source/tools/canvastools.cxx
@@ -750,8 +750,7 @@ namespace canvas
// TODO(E2): error handling
// translate to final position
- aCorrectedTransform.translate( destRect.getMinX(),
- destRect.getMinY() );
+ aCorrectedTransform.translate( destRect.getMinimum() );
::basegfx::B2DHomMatrix transform( transformation );
o_transform = aCorrectedTransform * transform;
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 655ee8ab13a9..bee0e6febb00 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -702,7 +702,7 @@ namespace vclcanvas
#if 0 //defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
{
- ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
+ const ::basegfx::B2DRectangle aRect(basegfx::B2DRange::getUnitB2DRange());
::basegfx::B2DRectangle aTextureDeviceRect;
::basegfx::B2DHomMatrix aTextureTransform;
::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect,
@@ -827,7 +827,7 @@ namespace vclcanvas
aTotalTransform *= aTextureTransform;
- const ::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
+ const ::basegfx::B2DRectangle aRect(basegfx::B2DRange::getUnitB2DRange());
::basegfx::B2DRectangle aTextureDeviceRect;
::canvas::tools::calcTransformedRectBounds( aTextureDeviceRect,
aRect,
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 2440ad3bfd75..17642ef3c7c8 100755
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -186,8 +186,7 @@ namespace vclcanvas
// make transformation absolute (put sprite to final
// output position). Need to happen here, as we also have
// to translate the clip polygon
- aTransform.translate( aOutPos.X(),
- aOutPos.Y() );
+ aTransform.translate( aOutPos.X(), aOutPos.Y() );
if( !bIdentityTransform )
{
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
index a40b5d4e718f..574c76b1da93 100755
--- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
@@ -75,7 +75,7 @@ void WrappedD3DTransformMatrixProperty::setPropertyValue( const Any& rOuterValue
BaseGFXHelper::HomogenMatrixToB3DHomMatrix( aHM ) ) );
::basegfx::B3DHomMatrix aMatrix;
- aMatrix.rotate( aRotation.getX(), aRotation.getY(), aRotation.getZ() );
+ aMatrix.rotate( aRotation );
::basegfx::B3DHomMatrix aObjectMatrix;
::basegfx::B3DHomMatrix aNewMatrix = aMatrix*aObjectMatrix;
@@ -102,7 +102,7 @@ Any WrappedD3DTransformMatrixProperty::getPropertyValue( const Reference< beans:
BaseGFXHelper::HomogenMatrixToB3DHomMatrix( aHM ) ) );
::basegfx::B3DHomMatrix aMatrix;
- aMatrix.rotate( aRotation.getX(), aRotation.getY(), aRotation.getZ() );
+ aMatrix.rotate( aRotation );
::basegfx::B3DHomMatrix aObjectMatrix;
::basegfx::B3DHomMatrix aNewMatrix = aMatrix*aObjectMatrix;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 74674970187f..4a458e1b1151 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -417,44 +417,44 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, PreviewChangeHdl, void*, EMPTYARG )
const SfxItemSet a3DLightAttributes(m_aCtl_Preview.GetSvx3DLightControl().Get3DAttributes());
LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor1Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff1Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection1Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue());
pInfo = &m_pLightSourceInfoList[1];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor2Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff2Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection2Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue());
pInfo = &m_pLightSourceInfoList[2];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor3Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff3Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection3Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue());
pInfo = &m_pLightSourceInfoList[3];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor4Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff4Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection4Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue());
pInfo = &m_pLightSourceInfoList[4];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor5Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff5Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection5Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue());
pInfo = &m_pLightSourceInfoList[5];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor6Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff6Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection6Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue());
pInfo = &m_pLightSourceInfoList[6];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor7Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff7Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection7Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue());
pInfo = &m_pLightSourceInfoList[7];
- pInfo->aLightSource.nDiffuseColor = ((const Svx3DLightcolor8Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue().GetColor();
- pInfo->aLightSource.bIsEnabled = ((const Svx3DLightOnOff8Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue();
- pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const Svx3DLightDirection8Item&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue());
+ pInfo->aLightSource.nDiffuseColor = ((const SvxColorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue().GetColor();
+ pInfo->aLightSource.bIsEnabled = ((const SfxBoolItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue();
+ pInfo->aLightSource.aDirection = B3DVectorToDirection3D(((const SvxB3DVectorItem&)a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue());
applyLightSourcesToModel();
@@ -594,46 +594,46 @@ void ThreeD_SceneIllumination_TabPage::updatePreview()
LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
// AmbientColor
- aItemSet.Put(Svx3DAmbientcolorItem(m_aLB_AmbientLight.GetSelectEntryColor()));
+ aItemSet.Put(SvxColorItem(m_aLB_AmbientLight.GetSelectEntryColor(), SDRATTR_3DSCENE_AMBIENTCOLOR));
- aItemSet.Put(Svx3DLightcolor1Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff1Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection1Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_1));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
pInfo = &m_pLightSourceInfoList[1];
- aItemSet.Put(Svx3DLightcolor2Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff2Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection2Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_2));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
pInfo = &m_pLightSourceInfoList[2];
- aItemSet.Put(Svx3DLightcolor3Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff3Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection3Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_3));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
pInfo = &m_pLightSourceInfoList[3];
- aItemSet.Put(Svx3DLightcolor4Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff4Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection4Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_4));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
pInfo = &m_pLightSourceInfoList[4];
- aItemSet.Put(Svx3DLightcolor5Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff5Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection5Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_5));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
pInfo = &m_pLightSourceInfoList[5];
- aItemSet.Put(Svx3DLightcolor6Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff6Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection6Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_6));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
pInfo = &m_pLightSourceInfoList[6];
- aItemSet.Put(Svx3DLightcolor7Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff7Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection7Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_7));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
pInfo = &m_pLightSourceInfoList[7];
- aItemSet.Put(Svx3DLightcolor8Item(pInfo->aLightSource.nDiffuseColor));
- aItemSet.Put(Svx3DLightOnOff8Item(pInfo->aLightSource.bIsEnabled));
- aItemSet.Put(Svx3DLightDirection8Item(Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
+ aItemSet.Put(SvxColorItem(pInfo->aLightSource.nDiffuseColor, SDRATTR_3DSCENE_LIGHTCOLOR_8));
+ aItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, pInfo->aLightSource.bIsEnabled));
+ aItemSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, Direction3DToB3DVector(pInfo->aLightSource.aDirection)));
// set lights and ambient light
m_aCtl_Preview.GetSvx3DLightControl().Set3DAttributes(aItemSet);
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
index 0c1697ad9f78..a22eece87a76 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
@@ -29,11 +29,8 @@
#include "ResId.hxx"
#include "chartview/ChartSfxItemIds.hxx"
-
-// header for SfxInt32Item
#include <svl/intitem.hxx>
-// header for class Svx3DHorizontalSegmentsItem
-#include <svx/svx3ditems.hxx>
+#include <svx/svddef.hxx>
//.............................................................................
namespace chart
@@ -75,7 +72,7 @@ sal_Bool SchLayoutTabPage::FillItemSet(SfxItemSet& rOutAttrs)
nSegs=4;
rOutAttrs.Put(SfxInt32Item(SCHATTR_STYLE_SHAPE,nShape));
- rOutAttrs.Put(Svx3DHorizontalSegmentsItem(nSegs));
+ rOutAttrs.Put(SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nSegs));
}
return sal_True;
}
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 65aac4b7c418..31187e1e76ef 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -57,6 +57,7 @@
#include <sfx2/objsh.hxx>
#include <svx/helperhittest3d.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -150,10 +151,10 @@ void lcl_initOutliner( SdrOutliner* pTargetOutliner, SdrOutliner* pSourceOutline
}
*/
-DrawViewWrapper::DrawViewWrapper( SdrModel* pSdrModel, OutputDevice* pOut, bool bPaintPageForEditMode)
- : E3dView(pSdrModel, pOut)
+DrawViewWrapper::DrawViewWrapper( SdrModel& rSdrModel, OutputDevice* pOut, bool bPaintPageForEditMode)
+ : E3dView(rSdrModel, pOut)
, m_pMarkHandleProvider(NULL)
- , m_apOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, pSdrModel ) )
+ , m_apOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, &rSdrModel ) )
, m_bRestoreMapMode( false )
{
// #114898#
@@ -190,25 +191,22 @@ void DrawViewWrapper::ReInit()
if(pOutDev)
aOutputSize = pOutDev->GetOutputSize();
- bPageVisible = false;
- bPageBorderVisible = false;
- bBordVisible = false;
- bGridVisible = false;
- bHlplVisible = false;
+ SetPageVisible(false);
+ SetPageBorderVisible(false);
+ SetBordVisible(false);
+ SetGridVisible(false);
+ SetHlplVisible(false);
this->SetNoDragXorPolys(true);//for interactive 3D resize-dragging: paint only a single rectangle (not a simulated 3D object)
//this->SetResizeAtCenter(true);//for interactive resize-dragging: keep the object center fix
//a correct work area is at least necessary for correct values in the position and size dialog
- Rectangle aRect(Point(0,0), aOutputSize);
- this->SetWorkArea(aRect);
-
- this->ShowSdrPage(this->GetModel()->GetPage(0));
+ this->SetWorkArea(basegfx::B2DRange(0.0, 0.0, aOutputSize.Width(), aOutputSize.Height()));
+ this->ShowSdrPage(*this->getSdrModelFromSdrView().GetPage(0));
}
DrawViewWrapper::~DrawViewWrapper()
{
- aComeBackTimer.Stop();//@todo this should be done in destructor of base class
UnmarkAllObj();//necessary to aavoid a paint call during the destructor hierarchy
}
@@ -221,20 +219,18 @@ SdrPageView* DrawViewWrapper::GetPageView() const
//virtual
void DrawViewWrapper::SetMarkHandles()
{
- if( m_pMarkHandleProvider && m_pMarkHandleProvider->getMarkHandles( aHdl ) )
+ if( m_pMarkHandleProvider && m_pMarkHandleProvider->getMarkHandles( maViewHandleList ) )
return;
else
SdrView::SetMarkHandles();
}
-SdrObject* DrawViewWrapper::getHitObject( const Point& rPnt ) const
+SdrObject* DrawViewWrapper::getHitObject( const basegfx::B2DPoint& rPnt ) const
{
SdrObject* pRet = NULL;
//sal_uLong nOptions =SDRSEARCH_DEEP|SDRSEARCH_PASS2BOUND|SDRSEARCH_PASS3NEAREST;
sal_uLong nOptions = SDRSEARCH_DEEP | SDRSEARCH_TESTMARKABLE;
-
- SdrPageView* pSdrPageView = this->GetPageView();
- this->SdrView::PickObj(rPnt, lcl_getHitTolerance( this->GetFirstOutputDevice() ), pRet, pSdrPageView, nOptions);
+ this->SdrView::PickObj(rPnt, lcl_getHitTolerance( this->GetFirstOutputDevice() ), pRet, nOptions);
if( pRet )
{
@@ -256,8 +252,7 @@ SdrObject* DrawViewWrapper::getHitObject( const Point& rPnt ) const
{
// prepare result vector and call helper
::std::vector< const E3dCompoundObject* > aHitList;
- const basegfx::B2DPoint aHitPoint(rPnt.X(), rPnt.Y());
- getAllHit3DObjectsSortedFrontToBack(aHitPoint, *pScene, aHitList);
+ getAllHit3DObjectsSortedFrontToBack(rPnt, *pScene, aHitList);
if(aHitList.size())
{
@@ -278,9 +273,8 @@ void DrawViewWrapper::MarkObject( SdrObject* pObj )
if( m_pMarkHandleProvider )
bFrameDragSingles = m_pMarkHandleProvider->getFrameDragSingles();
- this->SetFrameDragSingles(bFrameDragSingles);//decide wether each single object should get handles
- this->SdrView::MarkObj( pObj, this->GetPageView() );
- this->showMarkHandles();
+ this->SetFrameHandles(bFrameDragSingles);//decide wether each single object should get handles
+ this->SdrView::MarkObj( *pObj );
}
@@ -297,21 +291,9 @@ void DrawViewWrapper::CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr
this->E3dView::CompleteRedraw( pOut, rReg );
}
-SdrObject* DrawViewWrapper::getSelectedObject() const
-{
- SdrObject* pObj(NULL);
- const SdrMarkList& rMarkList = this->GetMarkedObjectList();
- if(rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- pObj = pMark->GetMarkedSdrObj();
- }
- return pObj;
-}
-
SdrObject* DrawViewWrapper::getTextEditObject() const
{
- SdrObject* pObj = this->getSelectedObject();
+ SdrObject* pObj = this->getSelectedIfSingle();
SdrObject* pTextObj = NULL;
if( pObj && pObj->HasTextEdit())
pTextObj = (SdrTextObj*)pObj;
@@ -336,7 +318,7 @@ SdrOutliner* DrawViewWrapper::getOutliner() const
SfxItemSet DrawViewWrapper::getPositionAndSizeItemSetFromMarkedObject() const
{
- SfxItemSet aFullSet( GetModel()->GetItemPool(),
+ SfxItemSet aFullSet( getSdrModelFromSdrView().GetItemPool(),
SID_ATTR_TRANSFORM_POS_X,SID_ATTR_TRANSFORM_ANGLE,
SID_ATTR_TRANSFORM_PROTECT_POS,SID_ATTR_TRANSFORM_AUTOHEIGHT,
SDRATTR_ECKENRADIUS,SDRATTR_ECKENRADIUS,
@@ -355,17 +337,16 @@ SdrObject* DrawViewWrapper::getNamedSdrObject( const rtl::OUString& rName ) cons
SdrPageView* pSdrPageView = this->GetPageView();
if( pSdrPageView )
{
- return DrawModelWrapper::getNamedSdrObject( rName, pSdrPageView->GetObjList() );
+ return DrawModelWrapper::getNamedSdrObject( rName, pSdrPageView->GetCurrentObjectList() );
}
return 0;
}
-bool DrawViewWrapper::IsObjectHit( SdrObject* pObj, const Point& rPnt ) const
+bool DrawViewWrapper::IsObjectHit( SdrObject* pObj, const basegfx::B2DPoint& rPnt ) const
{
if(pObj)
{
- Rectangle aRect(pObj->GetCurrentBoundRect());
- return aRect.IsInside(rPnt);
+ return pObj->getObjectRange(this).isInside(rPnt);
}
return false;
}
@@ -373,25 +354,24 @@ bool DrawViewWrapper::IsObjectHit( SdrObject* pObj, const Point& rPnt ) const
void DrawViewWrapper::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
//prevent wrong reselection of objects
- SdrModel* pSdrModel( this->GetModel() );
- if( pSdrModel && pSdrModel->isLocked() )
+ if( getSdrModelFromSdrView().isLocked() )
return;
- const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >( &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >( &rHint );
//#i76053# do nothing when only changes on the hidden draw page were made ( e.g. when the symbols for the dialogs are created )
SdrPageView* pSdrPageView = this->GetPageView();
if( pSdrHint && pSdrPageView )
{
- if( pSdrPageView->GetPage() != pSdrHint->GetPage() )
+ if( &pSdrPageView->getSdrPageFromSdrPageView() != pSdrHint->GetSdrHintPage() )
return;
}
E3dView::Notify(rBC, rHint);
- if( pSdrHint != 0 )
+ if( pSdrHint )
{
- SdrHintKind eKind = pSdrHint->GetKind();
+ SdrHintKind eKind = pSdrHint->GetSdrHintKind();
if( eKind == HINT_BEGEDIT )
{
// #i79965# remember map mode
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index e04b5ea7fa47..8b795c970cf8 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -32,6 +32,7 @@
#include <svx/XPropertyTable.hxx>
#include <svx/unofill.hxx>
#include <svx/unoapi.hxx>
+#include <svx/svdlegacy.hxx>
// header for class NameOrIndex
#include <svx/xit.hxx>
@@ -152,7 +153,7 @@ SdrObjList* ViewElementListProvider::GetSymbolList() const
SdrObject* pSdrObject = DrawViewWrapper::getSdrObject( uno::Reference< drawing::XShape >( m_xSymbols, uno::UNO_QUERY ) );
if(pSdrObject)
- m_pSymbolList = pSdrObject->GetSubList();
+ m_pSymbolList = pSdrObject->getChildrenOfSdrObject();
}
}
catch( uno::Exception& e )
@@ -178,28 +179,27 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
SdrPage* pPage = new SdrPage( *pModel, sal_False );
- pPage->SetSize(Size(1000,1000));
+ pPage->SetPageScale(basegfx::B2DVector(1000.0, 1000.0));
pModel->InsertPage( pPage, 0 );
- SdrView* pView = new SdrView( pModel, &aVDev );
- pView->hideMarkHandles();
- SdrPageView* pPageView = pView->ShowSdrPage(pPage);
+ SdrView* pView = new SdrView( *pModel, &aVDev );
+ pView->ShowSdrPage(*pPage);
- pObj=pObj->Clone();
- pPage->NbcInsertObject(pObj);
- pView->MarkObj(pObj,pPageView);
+ pObj = pObj->CloneSdrObject();
+ pPage->InsertObjectToSdrObjList(*pObj);
+ pView->MarkObj(*pObj);
if( pSymbolShapeProperties )
pObj->SetMergedItemSet(*pSymbolShapeProperties);
GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
Graphic aGraph(aMeta);
- Size aSize = pObj->GetSnapRect().GetSize();
+ const Size aSize(sdr::legacy::GetSnapRect(*pObj).GetSize());
aGraph.SetPrefSize(aSize);
aGraph.SetPrefMapMode(MAP_100TH_MM);
pView->UnmarkAll();
- pObj=pPage->RemoveObject(0);
- SdrObject::Free( pObj );
+ pObj=pPage->RemoveObjectFromSdrObjList(0);
+ deleteSdrObjectSafeAndClearPointer( pObj );
delete pView;
delete pModel;
diff --git a/chart2/source/controller/inc/DrawViewWrapper.hxx b/chart2/source/controller/inc/DrawViewWrapper.hxx
index f83ba09150e0..fec4891a011a 100644
--- a/chart2/source/controller/inc/DrawViewWrapper.hxx
+++ b/chart2/source/controller/inc/DrawViewWrapper.hxx
@@ -49,7 +49,7 @@ public:
class DrawViewWrapper : public E3dView
{
public:
- DrawViewWrapper(SdrModel* pModel, OutputDevice* pOut, bool bPaintPageForEditMode);
+ DrawViewWrapper(SdrModel& rModel, OutputDevice* pOut, bool bPaintPageForEditMode);
virtual ~DrawViewWrapper();
//triggers the use of an updated first page
@@ -59,17 +59,12 @@ public:
void attachParentReferenceDevice(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel );
- //fill list of selection handles 'aHdl'
+ //fill list of selection handles 'maViewHandleList'
virtual void SetMarkHandles();
SdrPageView* GetPageView() const;
- SdrObject* getHitObject( const Point& rPnt ) const;
- //sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uLong nOptions, SdrObject** ppRootObj, sal_uLong* pnMarkNum=NULL, sal_uInt16* pnPassNum=NULL) const;
- //sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uLong nOptions=0) const;
- //sal_Bool PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uLong nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
-
- //void MarkObj(SdrObject* pObj, SdrPageView* pPV, sal_Bool bUnmark=sal_False, sal_Bool bImpNoSetMarkHdl=sal_False);
+ SdrObject* getHitObject( const basegfx::B2DPoint& rPnt ) const;
void MarkObject( SdrObject* pObj );
//----------------------
@@ -77,14 +72,13 @@ public:
void setMarkHandleProvider( MarkHandleProvider* pMarkHandleProvider );
void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0);
- SdrObject* getSelectedObject() const;
SdrObject* getTextEditObject() const;
SdrOutliner* getOutliner() const;
SfxItemSet getPositionAndSizeItemSetFromMarkedObject() const;
SdrObject* getNamedSdrObject( const rtl::OUString& rName ) const;
- bool IsObjectHit( SdrObject* pObj, const Point& rPnt ) const;
+ bool IsObjectHit( SdrObject* pObj, const basegfx::B2DPoint& rPnt ) const;
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 5f65a23ad211..b4ff1595b747 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -484,8 +484,6 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
this->EndTextEdit();
if( m_pDrawViewWrapper )
{
- m_pDrawViewWrapper->UnmarkAll();
- //m_pDrawViewWrapper->hideMarkHandles(); todo??
m_pDrawViewWrapper->HideSdrPage();
}
}
@@ -737,7 +735,7 @@ void ChartController::impl_createDrawViewController()
{
if( m_pDrawModelWrapper )
{
- m_pDrawViewWrapper = new DrawViewWrapper(&m_pDrawModelWrapper->getSdrModel(),m_pChartWindow,true);
+ m_pDrawViewWrapper = new DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),m_pChartWindow,true);
m_pDrawViewWrapper->attachParentReferenceDevice( getModel() );
}
}
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index 3e5bb04bbeca..5df00a394724 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -125,7 +125,7 @@ public:
@return </sal_True>, if a quick help should be shown.
*/
virtual bool requestQuickHelp(
- ::Point aAtLogicPosition, bool bIsBalloonHelp,
+ basegfx::B2DPoint aAtLogicPosition, bool bIsBalloonHelp,
::rtl::OUString & rOutQuickHelpText, ::com::sun::star::awt::Rectangle & rOutEqualRect ) = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() = 0;
@@ -457,7 +457,7 @@ public:
virtual bool execute_KeyInput( const KeyEvent& rKEvt );
virtual bool requestQuickHelp(
- ::Point aAtLogicPosition, bool bIsBalloonHelp,
+ basegfx::B2DPoint aAtLogicPosition, bool bIsBalloonHelp,
::rtl::OUString & rOutQuickHelpText, ::com::sun::star::awt::Rectangle & rOutEqualRect );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 98746f49da47..e0a6fcb5d4e2 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -52,6 +52,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <svl/stritem.hxx>
#include <editeng/fontitem.hxx>
+#include <svx/svdlegacy.hxx>
//.............................................................................
namespace chart
@@ -95,7 +96,6 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
xChartViewProps->setPropertyValue( C2U("SdrViewIsInEditMode"), uno::makeAny(sal_True) );
sal_Bool bEdit = m_pDrawViewWrapper->SdrBeginTextEdit( pTextObj
- , m_pDrawViewWrapper->GetPageView()
, m_pChartWindow
, sal_False //bIsNewObj
, pOutliner
@@ -111,7 +111,7 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
pViewSh->GetViewFrame()->GetDispatcher()->GetShell( 0 )->
SetUndoManager(&pOutliner->GetUndoManager());
*/
- m_pDrawViewWrapper->SetEditMode();
+ m_pDrawViewWrapper->SetViewEditMode(SDREDITMODE_EDIT);
// #i12587# support for shapes in chart
if ( pMousePixel )
@@ -127,7 +127,9 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
//we invalidate the outliner region because the outliner has some
//paint problems (some characters are painted twice a little bit shifted)
- m_pChartWindow->Invalidate( m_pDrawViewWrapper->GetMarkedObjBoundRect() );
+ m_pChartWindow->Invalidate(
+ sdr::legacy::GetAllObjBoundRect(
+ m_pDrawViewWrapper->getSelectedSdrObjectVectorFromSdrMarkView()));
}
}
@@ -204,9 +206,8 @@ void SAL_CALL ChartController::executeDispatch_InsertSpecialCharacter()
const SfxItemSet* pSet = pDlg->GetOutputItemSet();
const SfxPoolItem* pItem=0;
String aString;
- if ( pSet && pSet->GetItemState( SID_CHARMAP, sal_True, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxStringItem) )
- aString = dynamic_cast<const SfxStringItem*>(pItem)->GetValue();
+ if ( pSet && pSet->GetItemState( SID_CHARMAP, sal_True, &pItem) == SFX_ITEM_SET && dynamic_cast< const SfxStringItem* >(pItem) )
+ aString = static_cast< const SfxStringItem* >(pItem)->GetValue();
OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 524c7338db6a..72333f370f65 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -440,12 +440,9 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
while ( aIter.IsMore() )
{
SdrObject* pObj = aIter.Next();
- SdrObject* pNewObj = ( pObj ? pObj->Clone() : NULL );
+ SdrObject* pNewObj = ( pObj ? pObj->CloneSdrObject() : NULL );
if ( pNewObj )
{
- pNewObj->SetModel( &pDrawModelWrapper->getSdrModel() );
- pNewObj->SetPage( pDestPage );
-
// set position
Reference< drawing::XShape > xShape( pNewObj->getUnoShape(), uno::UNO_QUERY );
if ( xShape.is() )
@@ -453,7 +450,7 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
xShape->setPosition( awt::Point( 0, 0 ) );
}
- pDestPage->InsertObject( pNewObj );
+ pDestPage->InsertObjectToSdrObjList(*pNewObj);
m_pDrawViewWrapper->AddUndo( new SdrUndoInsertObj( *pNewObj ) );
xSelShape = xShape;
}
@@ -612,8 +609,8 @@ bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
bool ChartController::isShapeContext() const
{
if ( m_aSelection.isAdditionalShapeSelected() ||
- ( m_pDrawViewWrapper && m_pDrawViewWrapper->AreObjectsMarked() &&
- ( m_pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) ) )
+ ( m_pDrawViewWrapper && m_pDrawViewWrapper->areSdrObjectsSelected() &&
+ ( m_pDrawViewWrapper->getSdrObjectCreationInfo().getIdent() == OBJ_TEXT ) ) )
{
return true;
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 3be59801731c..b59970d8680b 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -83,6 +83,7 @@
#include <rtl/math.hxx>
#include <svtools/acceleratorexecute.hxx>
+#include <svx/svdlegacy.hxx>
#define DRGPIX 2 // Drag MinMove in Pixel
@@ -281,8 +282,7 @@ const short HITPIX=2; //hit-tolerance in pixel
//a correct work area is at least necessary for correct values in the position and size dialog and for dragging area
if(m_pDrawViewWrapper)
{
- Rectangle aRect(Point(0,0), m_pChartWindow->GetOutputSize());
- m_pDrawViewWrapper->SetWorkArea( aRect );
+ m_pDrawViewWrapper->SetWorkArea(basegfx::B2DRange(0.0, 0.0, m_pChartWindow->GetOutputSize().Width(), m_pChartWindow->GetOutputSize().Height()));
}
}
else
@@ -617,7 +617,8 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
if(!m_pChartWindow || !pDrawViewWrapper )
return;
- Point aMPos = m_pChartWindow->PixelToLogic(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(m_pChartWindow->GetInverseViewTransformation() * aPixelPos);
if ( MOUSE_LEFT == rMEvt.GetButtons() )
{
@@ -628,7 +629,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
if( pDrawViewWrapper->IsTextEdit() )
{
SdrViewEvent aVEvt;
- if ( pDrawViewWrapper->IsTextEditHit( aMPos, HITPIX ) ||
+ if ( pDrawViewWrapper->IsTextEditHit( aLogicPos, HITPIX ) ||
// #i12587# support for shapes in chart
( rMEvt.IsRight() && pDrawViewWrapper->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt ) == SDRHIT_MARKEDOBJECT ) )
{
@@ -655,13 +656,13 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
SdrHdl* pHitSelectionHdl = 0;
//switch from move to resize if handle is hit on a resizeable object
if( m_aSelection.isResizeableObjectSelected() )
- pHitSelectionHdl = pDrawViewWrapper->PickHandle( aMPos );
+ pHitSelectionHdl = pDrawViewWrapper->PickHandle( aLogicPos );
//only change selection if no selection handles are hit
if( !pHitSelectionHdl )
{
// #i12587# support for shapes in chart
if ( m_eDrawMode == CHARTDRAW_INSERT &&
- ( !pDrawViewWrapper->IsMarkedHit( aMPos ) || !m_aSelection.isDragableObjectSelected() ) )
+ ( !pDrawViewWrapper->IsMarkedObjHit( aLogicPos ) || !m_aSelection.isDragableObjectSelected() ) )
{
if ( m_aSelection.hasSelection() )
{
@@ -669,14 +670,13 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
}
if ( !pDrawViewWrapper->IsAction() )
{
- if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_CAPTION )
+ if ( pDrawViewWrapper->getSdrObjectCreationInfo().getIdent() == OBJ_CAPTION )
{
- Size aCaptionSize( 2268, 1134 );
- pDrawViewWrapper->BegCreateCaptionObj( aMPos, aCaptionSize );
+ pDrawViewWrapper->BegCreateCaptionObj( aLogicPos, basegfx::B2DVector(2268.0, 1134.0) );
}
else
{
- pDrawViewWrapper->BegCreateObj( aMPos);
+ pDrawViewWrapper->BegCreateObj( aLogicPos );
}
SdrObject* pObj = pDrawViewWrapper->GetCreateObj();
DrawCommandDispatch* pDrawCommandDispatch = m_aDispatchContainer.getDrawCommandDispatch();
@@ -692,7 +692,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
return;
}
- m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper
+ m_aSelection.adaptSelectionToNewPos( aLogicPos, pDrawViewWrapper
, rMEvt.IsRight(), m_bWaitingForDoubleClick );
if( !m_aSelection.isRotateableObjectSelected( getModel() ) )
@@ -707,11 +707,12 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
&& !rMEvt.IsRight() )
{
//start drag
- sal_uInt16 nDrgLog = (sal_uInt16)m_pChartWindow->PixelToLogic(Size(DRGPIX,0)).Width();
+ const double fTolerance(basegfx::B2DVector(m_pChartWindow->GetInverseViewTransformation() *
+ basegfx::B2DVector(DRGPIX, 0.0)).getLength());
SdrDragMethod* pDragMethod = NULL;
//change selection to 3D scene if rotate mode
- SdrDragMode eDragMode = pDrawViewWrapper->GetDragMode();
+ const SdrDragMode eDragMode(pDrawViewWrapper->GetDragMode());
if( SDRDRAG_ROTATE==eDragMode )
{
E3dScene* pScene = SelectionHelper::getSceneToRotate( pDrawViewWrapper->getNamedSdrObject( m_aSelection.getSelectedCID() ) );
@@ -737,7 +738,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
if( aDragMethodServiceName.equals( ObjectIdentifier::getPieSegmentDragMethodServiceName() ) )
pDragMethod = new DragMethod_PieSegment( *pDrawViewWrapper, m_aSelection.getSelectedCID(), getModel() );
}
- pDrawViewWrapper->SdrView::BegDragObj(aMPos, NULL, pHitSelectionHdl, nDrgLog, pDragMethod);
+ pDrawViewWrapper->SdrView::BegDragObj(aLogicPos, pHitSelectionHdl, fTolerance, pDragMethod);
}
impl_SetMousePointer( rMEvt );
@@ -759,11 +760,11 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
if(pDrawViewWrapper->IsAction())
{
- pDrawViewWrapper->MovAction( m_pChartWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(m_pChartWindow->GetInverseViewTransformation() * aPixelPos);
+ pDrawViewWrapper->MovAction(aLogicPos);
}
- //?? pDrawViewWrapper->GetPageView()->DragPoly();
-
impl_SetMousePointer( rMEvt );
}
void ChartController::execute_Tracking( const TrackingEvent& /* rTEvt */ )
@@ -785,7 +786,8 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if(!m_pChartWindow || !pDrawViewWrapper)
return;
- Point aMPos = m_pChartWindow->PixelToLogic(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aMPos(m_pChartWindow->GetInverseViewTransformation() * aPixelPos);
if(pDrawViewWrapper->IsTextEdit())
{
@@ -794,7 +796,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
}
// #i12587# support for shapes in chart
- if ( m_eDrawMode == CHARTDRAW_INSERT && pDrawViewWrapper->IsCreateObj() )
+ if ( m_eDrawMode == CHARTDRAW_INSERT && pDrawViewWrapper->GetCreateObj() )
{
pDrawViewWrapper->EndCreateObj( SDRCREATE_FORCEEND );
{
@@ -802,15 +804,15 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
// don't want the positioning Undo action to appear in the UI
impl_switchDiagramPositioningToExcludingPositioning();
}
- if ( pDrawViewWrapper->AreObjectsMarked() )
+ if ( pDrawViewWrapper->areSdrObjectsSelected() )
{
- if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT )
+ if ( pDrawViewWrapper->getSdrObjectCreationInfo().getIdent() == OBJ_TEXT )
{
executeDispatch_EditText();
}
else
{
- SdrObject* pObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pObj = pDrawViewWrapper->getSelectedIfSingle();
if ( pObj )
{
uno::Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY );
@@ -852,16 +854,16 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
try
{
//end move or size
- SdrObject* pObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pObj = pDrawViewWrapper->getSelectedIfSingle();
if( pObj )
{
- Rectangle aObjectRect = pObj->GetSnapRect();
+ Rectangle aObjectRect(sdr::legacy::GetSnapRect(*pObj));
awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
const E3dObject* pE3dObject = dynamic_cast< const E3dObject*>( pObj );
if( pE3dObject )
- aObjectRect = pE3dObject->GetScene()->GetSnapRect();
+ aObjectRect = sdr::legacy::GetSnapRect(*pE3dObject->GetScene());
ActionDescriptionProvider::ActionType eActionType(ActionDescriptionProvider::MOVE);
if( !bIsMoveOnly && m_aSelection.isResizeableObjectSelected() )
@@ -955,7 +957,7 @@ void ChartController::execute_DoubleClick( const Point* pMousePixel )
{
// #i12587# support for shapes in chart
SdrObject* pObj = DrawViewWrapper::getSdrObject( m_aSelection.getSelectedAdditionalShape() );
- if ( pObj && pObj->ISA( SdrTextObj ) )
+ if ( pObj && dynamic_cast< SdrTextObj* >(pObj) )
{
bEditText = true;
}
@@ -1607,7 +1609,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
}
bool ChartController::requestQuickHelp(
- ::Point aAtLogicPosition,
+ basegfx::B2DPoint aAtLogicPosition,
bool bIsBalloonHelp,
::rtl::OUString & rOutQuickHelpText,
awt::Rectangle & rOutEqualRect )
@@ -1903,7 +1905,8 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
::vos::OGuard aGuard( Application::GetSolarMutex());
if( m_pDrawViewWrapper && m_pChartWindow )
{
- Point aMousePos( m_pChartWindow->PixelToLogic( rEvent.GetPosPixel()));
+ const basegfx::B2DPoint aPixelPos(rEvent.GetPosPixel().X(), rEvent.GetPosPixel().Y());
+ const basegfx::B2DPoint aMousePos(m_pChartWindow->GetInverseViewTransformation() * aPixelPos);
sal_uInt16 nModifier = rEvent.GetModifier();
sal_Bool bLeftDown = rEvent.IsLeft();
@@ -1970,15 +1973,19 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
// #i12587# support for shapes in chart
if ( m_eDrawMode == CHARTDRAW_INSERT &&
- ( !m_pDrawViewWrapper->IsMarkedHit( aMousePos ) || !m_aSelection.isDragableObjectSelected() ) )
+ ( !m_pDrawViewWrapper->IsMarkedObjHit( aMousePos ) || !m_aSelection.isDragableObjectSelected() ) )
{
PointerStyle ePointerStyle = POINTER_DRAW_RECT;
- SdrObjKind eKind = static_cast< SdrObjKind >( m_pDrawViewWrapper->GetCurrentObjIdentifier() );
+ SdrObjKind eKind = static_cast< SdrObjKind >( m_pDrawViewWrapper->getSdrObjectCreationInfo().getIdent() );
switch ( eKind )
{
- case OBJ_LINE:
+ case OBJ_POLY:
{
- ePointerStyle = POINTER_DRAW_LINE;
+ switch(m_pDrawViewWrapper->getSdrObjectCreationInfo().getSdrPathObjType())
+ {
+ case PathType_Line: ePointerStyle = POINTER_DRAW_LINE; break;
+ default: ePointerStyle = POINTER_DRAW_POLYGON; break;
+ }
}
break;
case OBJ_RECT:
@@ -1992,11 +1999,6 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
ePointerStyle = POINTER_DRAW_ELLIPSE;
}
break;
- case OBJ_FREELINE:
- {
- ePointerStyle = POINTER_DRAW_POLYGON;
- }
- break;
case OBJ_TEXT:
{
ePointerStyle = POINTER_DRAW_TEXT;
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index 2ed0ee04610a..5639c0d738f4 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -54,12 +54,12 @@ ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelected
:m_pMarkedObjModel( NULL )
,m_bDrawing( bDrawing )
{
- SdrExchangeView * pExchgView( new SdrView( pDrawModel ));
- SdrPageView* pPv = pExchgView->ShowSdrPage( pDrawModel->GetPage( 0 ));
+ OSL_ENSURE(pDrawModel, "ChartTransferable without SDrModel constructed (!)");
+ SdrExchangeView * pExchgView( new SdrView( *pDrawModel ));
if( pSelectedObj )
- pExchgView->MarkObj( pSelectedObj, pPv );
+ pExchgView->MarkObj( *pSelectedObj );
else
- pExchgView->MarkAllObj( pPv );
+ pExchgView->MarkAllObj();
Graphic aGraphic( pExchgView->GetMarkedObjMetaFile(true));
m_xMetaFileGraphic.set( aGraphic.GetXGraphic());
if ( m_bDrawing )
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 3cbdfdb4e210..fc338e4c12b2 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -207,8 +207,8 @@ void ChartWindow::RequestHelp( const HelpEvent& rHEvt )
if( ( rHEvt.GetMode() & HELPMODE_QUICK ) &&
m_pWindowController )
{
-// Point aLogicHitPos = PixelToLogic( rHEvt.GetMousePosPixel()); // old chart: GetPointerPosPixel()
- Point aLogicHitPos = PixelToLogic( GetPointerPosPixel());
+ const basegfx::B2DPoint aPixelPos(GetPointerPosPixel().X(), GetPointerPosPixel().Y());
+ const basegfx::B2DPoint aLogicHitPos(GetInverseViewTransformation() * aPixelPos);
::rtl::OUString aQuickHelpText;
awt::Rectangle aHelpRect;
bool bIsBalloonHelp( Help::IsBalloonHelpEnabled() );
diff --git a/chart2/source/controller/main/DragMethod_PieSegment.cxx b/chart2/source/controller/main/DragMethod_PieSegment.cxx
index 633613cd7c09..4971e77d4bc4 100644
--- a/chart2/source/controller/main/DragMethod_PieSegment.cxx
+++ b/chart2/source/controller/main/DragMethod_PieSegment.cxx
@@ -42,13 +42,12 @@ namespace chart
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
-using ::basegfx::B2DVector;
DragMethod_PieSegment::DragMethod_PieSegment( DrawViewWrapper& rDrawViewWrapper
, const rtl::OUString& rObjectCID
, const Reference< frame::XModel >& xChartModel )
: DragMethod_Base( rDrawViewWrapper, rObjectCID, xChartModel )
- , m_aStartVector(100.0,100.0)
+ , m_aStartPoint(100.0,100.0)
, m_fInitialOffset(0.0)
, m_fAdditionalOffset(0.0)
, m_aDragDirection(1000.0,1000.0)
@@ -68,8 +67,8 @@ DragMethod_PieSegment::DragMethod_PieSegment( DrawViewWrapper& rDrawViewWrapper
m_fInitialOffset = 0.0;
if( m_fInitialOffset > 1.0 )
m_fInitialOffset = 1.0;
- B2DVector aMinVector( aMinimumPosition.X, aMinimumPosition.Y );
- B2DVector aMaxVector( aMaximumPosition.X, aMaximumPosition.Y );
+ basegfx::B2DVector aMinVector( aMinimumPosition.X, aMinimumPosition.Y );
+ basegfx::B2DVector aMaxVector( aMaximumPosition.X, aMaximumPosition.Y );
m_aDragDirection = aMaxVector - aMinVector;
m_fDragRange = m_aDragDirection.scalar( m_aDragDirection );
if( ::rtl::math::approxEqual( m_fDragRange, 0.0 ) )
@@ -85,17 +84,16 @@ void DragMethod_PieSegment::TakeSdrDragComment(String& rStr) const
}
bool DragMethod_PieSegment::BeginSdrDrag()
{
- Point aStart( DragStat().GetStart() );
- m_aStartVector = B2DVector( aStart.X(), aStart.Y() );
+ m_aStartPoint = DragStat().GetStart();
Show();
return true;
}
-void DragMethod_PieSegment::MoveSdrDrag(const Point& rPnt)
+void DragMethod_PieSegment::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
if( DragStat().CheckMinMoved(rPnt) )
{
//calculate new offset
- B2DVector aShiftVector(( B2DVector( rPnt.X(), rPnt.Y() ) - m_aStartVector ));
+ const basegfx::B2DVector aShiftVector(rPnt - m_aStartPoint);
m_fAdditionalOffset = m_aDragDirection.scalar( aShiftVector )/m_fDragRange; // projection
if( m_fAdditionalOffset < -m_fInitialOffset )
@@ -103,8 +101,8 @@ void DragMethod_PieSegment::MoveSdrDrag(const Point& rPnt)
else if( m_fAdditionalOffset > (1.0-m_fInitialOffset) )
m_fAdditionalOffset = 1.0 - m_fInitialOffset;
- B2DVector aNewPosVector = m_aStartVector + (m_aDragDirection * m_fAdditionalOffset);
- Point aNewPos = Point( (long)(aNewPosVector.getX()), (long)(aNewPosVector.getY()) );
+ const basegfx::B2DPoint aNewPos(m_aStartPoint + (m_aDragDirection * m_fAdditionalOffset));
+
if( aNewPos != DragStat().GetNow() )
{
Hide();
@@ -145,7 +143,7 @@ basegfx::B2DHomMatrix DragMethod_PieSegment::getCurrentTransformation()
}
void DragMethod_PieSegment::createSdrDragEntries()
{
- SdrObject* pObj = m_rDrawViewWrapper.getSelectedObject();
+ SdrObject* pObj = m_rDrawViewWrapper.getSelectedIfSingle();
SdrPageView* pPV = m_rDrawViewWrapper.GetPageView();
if( pObj && pPV )
diff --git a/chart2/source/controller/main/DragMethod_PieSegment.hxx b/chart2/source/controller/main/DragMethod_PieSegment.hxx
index e17795e7af47..fe0f5e256c57 100644
--- a/chart2/source/controller/main/DragMethod_PieSegment.hxx
+++ b/chart2/source/controller/main/DragMethod_PieSegment.hxx
@@ -38,7 +38,7 @@ public:
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual basegfx::B2DHomMatrix getCurrentTransformation();
@@ -47,7 +47,7 @@ protected:
virtual void createSdrDragEntries();
private:
- ::basegfx::B2DVector m_aStartVector;
+ ::basegfx::B2DPoint m_aStartPoint;
double m_fInitialOffset;
double m_fAdditionalOffset;
::basegfx::B2DVector m_aDragDirection;
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
index 17aabbec91f4..85a5c73fdb04 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
@@ -42,6 +42,7 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
+#include <svx/svdlegacy.hxx>
#define FIXED_SIZE_FOR_3D_CHART_VOLUME (10000.0)
@@ -59,8 +60,8 @@ DragMethod_RotateDiagram::DragMethod_RotateDiagram( DrawViewWrapper& rDrawViewWr
, RotationDirection eRotationDirection )
: DragMethod_Base( rDrawViewWrapper, rObjectCID, xChartModel, ActionDescriptionProvider::ROTATE )
, m_pScene(0)
- , m_aReferenceRect(100,100,100,100)
- , m_aStartPos(0,0)
+ , m_aReferenceRect(100.0, 100.0, 100.0, 100.0)
+ , m_aStartPos(0.0, 0.0)
, m_aWireframePolyPolygon()
, m_fInitialXAngleRad(0.0)
, m_fInitialYAngleRad(0.0)
@@ -76,12 +77,10 @@ DragMethod_RotateDiagram::DragMethod_RotateDiagram( DrawViewWrapper& rDrawViewWr
, m_bRightAngledAxes(sal_False)
{
m_pScene = SelectionHelper::getSceneToRotate( rDrawViewWrapper.getNamedSdrObject( rObjectCID ) );
- SdrObject* pObj = rDrawViewWrapper.getSelectedObject();
+ SdrObject* pObj = rDrawViewWrapper.getSelectedIfSingle();
if(pObj && m_pScene)
{
- m_aReferenceRect = pObj->GetLogicRect();
- Rectangle aTemp = m_pScene->GetLogicRect();
-
+ m_aReferenceRect = sdr::legacy::GetLogicRange(*pObj);
m_aWireframePolyPolygon = m_pScene->CreateWireframe();
uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram(this->getChartModel()) );
@@ -118,17 +117,15 @@ bool DragMethod_RotateDiagram::BeginSdrDrag()
Show();
return true;
}
-void DragMethod_RotateDiagram::MoveSdrDrag(const Point& rPnt)
+void DragMethod_RotateDiagram::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
if( DragStat().CheckMinMoved(rPnt) )
{
Hide();
//calculate new angle
- double fX = F_PI / 2.0 * (double)(rPnt.Y() - m_aStartPos.Y())
- / (double)m_aReferenceRect.GetHeight();
- double fY = F_PI * (double)(rPnt.X() - m_aStartPos.X())
- / (double)m_aReferenceRect.GetWidth();
+ double fX = F_PI / 2.0 * (rPnt.getY() - m_aStartPos.getY()) / m_aReferenceRect.getHeight();
+ double fY = F_PI * (rPnt.getX() - m_aStartPos.getX()) / m_aReferenceRect.getWidth();
if( m_eRotationDirection != ROTATIONDIRECTION_Y )
m_fAdditionalYAngleRad = fY;
@@ -145,11 +142,11 @@ void DragMethod_RotateDiagram::MoveSdrDrag(const Point& rPnt)
m_fAdditionalXAngleRad = 0.0;
m_fAdditionalYAngleRad = 0.0;
- double fCx = m_aReferenceRect.Center().X();
- double fCy = m_aReferenceRect.Center().Y();
+ double fCx = m_aReferenceRect.getCenterX();
+ double fCy = m_aReferenceRect.getCenterY();
- m_fAdditionalZAngleRad = atan((double)(fCx - m_aStartPos.X())/(m_aStartPos.Y()-fCy))
- + atan((double)(fCx - rPnt.X())/(fCy-rPnt.Y()));
+ m_fAdditionalZAngleRad = atan((fCx - m_aStartPos.getX())/(m_aStartPos.getY() - fCy))
+ + atan((fCx - rPnt.getX())/(fCy - rPnt.getY()));
}
m_nAdditionalHorizontalAngleDegree = static_cast<sal_Int32>(m_fAdditionalXAngleRad*180.0/F_PI);
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
index 079cf22eee7a..f604afe13664 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx
@@ -52,7 +52,7 @@ public:
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual void CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlayManager);
@@ -60,8 +60,8 @@ public:
private:
E3dScene* m_pScene;
- Rectangle m_aReferenceRect;
- Point m_aStartPos;
+ basegfx::B2DRange m_aReferenceRect;
+ basegfx::B2DPoint m_aStartPos;
basegfx::B3DPolyPolygon m_aWireframePolyPolygon;
double m_fInitialXAngleRad;
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index c560c28b9ef6..0ce03caea078 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -49,6 +49,7 @@
#include <svx/xlnwtit.hxx>
#include <svx/xtable.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/svdlegacy.hxx>
#include <boost/bind.hpp>
@@ -138,7 +139,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
{
DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pDrawModelWrapper && pDrawViewWrapper && pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_CUSTOMSHAPE )
+ if ( pDrawModelWrapper && pDrawViewWrapper && pDrawViewWrapper->getSdrObjectCreationInfo().getIdent() == OBJ_CUSTOMSHAPE )
{
sal_Bool bAttributesAppliedFromGallery = sal_False;
if ( GalleryExplorer::GetSdrObjCount( GALLERY_THEME_POWERPOINT ) )
@@ -159,7 +160,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
if ( pSourceObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
- SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
+ SfxItemSet aDest( pObj->GetObjectItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
@@ -175,11 +176,11 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
0, 0);
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
- sal_Int32 nAngle = pSourceObj->GetRotateAngle();
- if ( nAngle )
+
+ const long aOldRotation(sdr::legacy::GetRotateAngle(*pSourceObj));
+ if ( aOldRotation )
{
- double a = nAngle * F_PI18000;
- pObj->NbcRotate( pObj->GetSnapRect().Center(), nAngle, sin( a ), cos( a ) );
+ sdr::legacy::RotateSdrObject(*pObj, sdr::legacy::GetSnapRect(*pObj).Center(), aOldRotation);
}
bAttributesAppliedFromGallery = sal_True;
}
@@ -194,7 +195,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER, 0 ) );
pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
- pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ pObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
( dynamic_cast< SdrObjCustomShape* >( pObj ) )->MergeDefaultAttributes( &m_aCustomShapeType );
}
}
@@ -220,7 +221,7 @@ void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
aArrow.append( aNewArrow );
}
- SfxItemSet aSet( pDrawViewWrapper->GetModel()->GetItemPool() );
+ SfxItemSet aSet( pDrawViewWrapper->getSdrModelFromSdrView().GetItemPool() );
pDrawViewWrapper->GetAttributes( aSet );
long nWidth = 300; // (1/100th mm)
@@ -299,7 +300,10 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
(void)rArgs;
ChartDrawMode eDrawMode = CHARTDRAW_SELECT;
- SdrObjKind eKind = OBJ_NONE;
+ SdrObjKind eKind(OBJ_NONE);
+ bool bFreehandMode(false);
+ SdrPathObjType aSdrPathObjType(PathType_Line);
+ SdrCircleObjType aSdrCircleObjType(CircleType_Circle);
bool bCreate = false;
sal_uInt16 nFeatureId = 0;
@@ -322,7 +326,8 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
case COMMAND_ID_LINE_ARROW_END:
{
eDrawMode = CHARTDRAW_INSERT;
- eKind = OBJ_LINE;
+ eKind = OBJ_POLY;
+ aSdrPathObjType = PathType_Line;
}
break;
case COMMAND_ID_DRAW_RECT:
@@ -335,12 +340,15 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
{
eDrawMode = CHARTDRAW_INSERT;
eKind = OBJ_CIRC;
+ aSdrCircleObjType = CircleType_Circle;
}
break;
case COMMAND_ID_DRAW_FREELINE_NOFILL:
{
eDrawMode = CHARTDRAW_INSERT;
- eKind = OBJ_FREELINE;
+ eKind = OBJ_POLY;
+ aSdrPathObjType = PathType_OpenBezier;
+ bFreehandMode = true;
}
break;
case COMMAND_ID_DRAW_TEXT:
@@ -382,10 +390,11 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
m_pChartController->setDrawMode( eDrawMode );
- setInsertObj( sal::static_int_cast< sal_uInt16 >( eKind ) );
+ setInsertObj(SdrObjectCreationInfo(static_cast< sal_uInt16 >(eKind), SdrInventor, aSdrPathObjType, aSdrCircleObjType, bFreehandMode));
+
if ( bCreate )
{
- pDrawViewWrapper->SetCreateMode();
+ pDrawViewWrapper->SetViewEditMode(SDREDITMODE_CREATE);
}
const ::rtl::OUString sKeyModifier( C2U( "KeyModifier" ) );
@@ -401,8 +410,7 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
SdrObject* pObj = createDefaultObject( nFeatureId );
if ( pObj )
{
- SdrPageView* pPageView = pDrawViewWrapper->GetSdrPageView();
- pDrawViewWrapper->InsertObjectAtView( pObj, *pPageView );
+ pDrawViewWrapper->InsertObjectAtView( *pObj );
Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY );
if ( xShape.is() )
{
@@ -439,12 +447,12 @@ void DrawCommandDispatch::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:StarShapes", COMMAND_ID_DRAWTBX_CS_STAR, CommandGroup::INSERT );
}
-void DrawCommandDispatch::setInsertObj( sal_uInt16 eObj )
+void DrawCommandDispatch::setInsertObj(const SdrObjectCreationInfo& rSdrObjectCreationInfo)
{
DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
if ( pDrawViewWrapper )
{
- pDrawViewWrapper->SetCurrentObj( eObj /*, Inventor */);
+ pDrawViewWrapper->setSdrObjectCreationInfo(rSdrObjectCreationInfo);
}
}
@@ -461,33 +469,30 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
if ( pPage )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- pObj = SdrObjFactory::MakeNewObject( pDrawViewWrapper->GetCurrentObjInventor(),
- pDrawViewWrapper->GetCurrentObjIdentifier(), pPage );
+ pObj = SdrObjFactory::MakeNewObject(
+ pDrawViewWrapper->getSdrModelFromSdrView(),
+ pDrawViewWrapper->getSdrObjectCreationInfo());
if ( pObj )
{
- long nDefaultObjectSizeWidth = 4000;
- long nDefaultObjectSizeHeight = 2500;
- Size aObjectSize( nDefaultObjectSizeWidth, nDefaultObjectSizeHeight );
- Rectangle aPageRect( Rectangle( Point( 0, 0 ), pPage->GetSize() ) );
- Point aObjectPos = aPageRect.Center();
- aObjectPos.X() -= aObjectSize.Width() / 2;
- aObjectPos.Y() -= aObjectSize.Height() / 2;
- Rectangle aRect( aObjectPos, aObjectSize );
+ const basegfx::B2DVector aObjectSize(4000.0, 2500.0);
+ const basegfx::B2DRange aPageRange(basegfx::B2DPoint(0.0, 0.0), pPage->GetPageScale());
+ const basegfx::B2DPoint aObjectPos(aPageRange.getCenter() - (aObjectSize * 0.5));
+ const basegfx::B2DRange aRange(aObjectPos, aObjectPos + aObjectSize);
switch ( nID )
{
case COMMAND_ID_DRAW_LINE:
case COMMAND_ID_LINE_ARROW_END:
{
- if ( pObj->ISA( SdrPathObj ) )
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if ( pSdrPathObj )
{
- Point aStart = aRect.TopLeft();
- Point aEnd = aRect.BottomRight();
- sal_Int32 nYMiddle( ( aRect.Top() + aRect.Bottom() ) / 2 );
+ const double nYMiddle((aRange.getMinY() + aRange.getMaxY()) * 0.5);
basegfx::B2DPolygon aPoly;
- aPoly.append( basegfx::B2DPoint( aStart.X(), nYMiddle ) );
- aPoly.append( basegfx::B2DPoint( aEnd.X(), nYMiddle ) );
- ( dynamic_cast< SdrPathObj* >( pObj ) )->SetPathPoly( basegfx::B2DPolyPolygon( aPoly ) );
+ aPoly.append(basegfx::B2DPoint(aRange.getMinX(), nYMiddle));
+ aPoly.append(basegfx::B2DPoint(aRange.getMaxX(), nYMiddle));
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aPoly));
SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
setLineEnds( aSet );
pObj->SetMergedItemSet( aSet );
@@ -496,52 +501,54 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
break;
case COMMAND_ID_DRAW_FREELINE_NOFILL:
{
- if ( pObj->ISA( SdrPathObj ) )
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if ( pSdrPathObj )
{
basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append( basegfx::B2DPoint( aRect.Left(), aRect.Bottom() ) );
+ aInnerPoly.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMaxY()));
aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint( aRect.Left(), aRect.Top() ),
- basegfx::B2DPoint( aRect.Center().X(), aRect.Top() ),
- basegfx::B2DPoint( aRect.Center().X(), aRect.Center().Y() ) );
+ aRange.getMinimum(),
+ basegfx::B2DPoint(aRange.getCenterX(), aRange.getMinY()),
+ aRange.getCenter());
aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint( aRect.Center().X(), aRect.Bottom() ),
- basegfx::B2DPoint( aRect.Right(), aRect.Bottom() ),
- basegfx::B2DPoint( aRect.Right(), aRect.Top() ) );
- basegfx::B2DPolyPolygon aPoly;
- aPoly.append( aInnerPoly );
- ( dynamic_cast< SdrPathObj* >( pObj ) )->SetPathPoly( aPoly );
+ basegfx::B2DPoint(aRange.getCenterX(), aRange.getMaxY()),
+ aRange.getMaximum(),
+ basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
+ const basegfx::B2DPolyPolygon aPoly(aInnerPoly);
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates( aPoly );
}
}
break;
case COMMAND_ID_DRAW_TEXT:
case COMMAND_ID_DRAW_TEXT_VERTICAL:
{
- if ( pObj->ISA( SdrTextObj ) )
- {
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
+
if ( pTextObj )
{
- pTextObj->SetLogicRect( aRect );
- sal_Bool bVertical = ( nID == SID_DRAW_TEXT_VERTICAL );
+ sdr::legacy::SetLogicRange(*pTextObj, aRange );
+ const sal_Bool bVertical = ( nID == SID_DRAW_TEXT_VERTICAL );
pTextObj->SetVerticalWriting( bVertical );
+
if ( bVertical )
{
SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
- aSet.Put( SdrTextAutoGrowWidthItem( sal_True ) );
- aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_True ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
aSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_TOP ) );
aSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_RIGHT ) );
pTextObj->SetMergedItemSet( aSet );
}
}
}
- }
break;
case COMMAND_ID_DRAW_CAPTION:
case COMMAND_ID_DRAW_CAPTION_VERTICAL:
{
- if ( pObj->ISA( SdrCaptionObj ) )
+ SdrCaptionObj* pSdrCaptionObj = dynamic_cast< SdrCaptionObj* >(pObj);
+
+ if ( pSdrCaptionObj )
{
sal_Bool bIsVertical( SID_DRAW_CAPTION_VERTICAL == nID );
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
@@ -556,19 +563,15 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
aSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_RIGHT ) );
pObj->SetMergedItemSet( aSet );
}
- SdrCaptionObj* pCaptionObj = dynamic_cast< SdrCaptionObj* >( pObj );
- if ( pCaptionObj )
- {
- pCaptionObj->SetLogicRect( aRect );
- pCaptionObj->SetTailPos(
- aRect.TopLeft() - Point( aRect.GetWidth() / 2, aRect.GetHeight() / 2 ) );
- }
+
+ sdr::legacy::SetLogicRange(*pSdrCaptionObj, aRange );
+ pSdrCaptionObj->SetTailPos(aRange.getMinimum() - (aRange.getRange() * 0.5));
}
}
break;
default:
{
- pObj->SetLogicRect( aRect );
+ sdr::legacy::SetLogicRange(*pObj, aRange );
SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
setAttributes( pObj );
pObj->SetMergedItemSet( aSet );
diff --git a/chart2/source/controller/main/DrawCommandDispatch.hxx b/chart2/source/controller/main/DrawCommandDispatch.hxx
index 86ba246f4896..b9268bb19263 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.hxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.hxx
@@ -29,6 +29,7 @@
class SfxItemSet;
class SdrObject;
+class SdrObjectCreationInfo;
//.............................................................................
namespace chart
@@ -72,7 +73,7 @@ protected:
virtual void describeSupportedFeatures();
private:
- void setInsertObj( sal_uInt16 eObj );
+ void setInsertObj(const SdrObjectCreationInfo& rSdrObjectCreationInfo);
SdrObject* createDefaultObject( const sal_uInt16 nID );
bool parseCommandURL( const ::rtl::OUString& rCommandURL, sal_uInt16* pnFeatureId, ::rtl::OUString* pBaseCommand, ::rtl::OUString* pCustomShapeType );
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx
index d32b12f391f5..b24902929b2e 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -40,6 +40,7 @@
#include <vos/mutex.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <svx/svdlegacy.hxx>
//.............................................................................
namespace chart
@@ -174,7 +175,7 @@ void Selection::applySelection( DrawViewWrapper* pDrawViewWrapper )
}
}
-void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper* pDrawViewWrapper
+void Selection::adaptSelectionToNewPos( const basegfx::B2DPoint& rMousePos, DrawViewWrapper* pDrawViewWrapper
, bool bIsRightMouse, bool bWaitingForDoubleClick )
{
if( pDrawViewWrapper )
@@ -360,10 +361,10 @@ bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
while( pObj && !ObjectIdentifier::isCID( aName ) )
{
- SdrObjList* pObjList = pObj->GetObjList();
+ SdrObjList* pObjList = pObj->getParentOfSdrObject();
if( !pObjList )
return false;;
- SdrObject* pOwner = pObjList->GetOwnerObj();
+ SdrObject* pOwner = pObjList->getSdrObjectFromSdrObjList();
if( !pOwner )
return false;
pObj = pOwner;
@@ -393,7 +394,7 @@ bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
return false;
}
-bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos
+bool SelectionHelper::isDragableObjectHitTwice( const basegfx::B2DPoint& rMPos
, const rtl::OUString& rNameOfSelectedObject
, const DrawViewWrapper& rDrawViewWrapper )
{
@@ -409,7 +410,7 @@ bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos
}
::rtl::OUString SelectionHelper::getHitObjectCID(
- const Point& rMPos,
+ const basegfx::B2DPoint& rMPos,
DrawViewWrapper& rDrawViewWrapper,
bool bGetDiagramInsteadOf_Wall )
{
@@ -499,7 +500,7 @@ SelectionHelper::~SelectionHelper()
bool SelectionHelper::getFrameDragSingles()
{
bool bFrameDragSingles = true;//true == green == surrounding handles
- if( m_pSelectedObj && m_pSelectedObj->ISA(E3dObject) )
+ if( m_pSelectedObj && dynamic_cast< E3dObject* >(m_pSelectedObj) )
bFrameDragSingles = false;
return bFrameDragSingles;
}
@@ -516,7 +517,7 @@ SdrObject* SelectionHelper::getMarkHandlesObject( SdrObject* pObj )
//search for a child with name "MarkHandles" or "HandlesOnly"
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- SdrObjList* pSubList = pObj->GetSubList();
+ SdrObjList* pSubList = pObj->getChildrenOfSdrObject();
if(pSubList)
{
SdrObjListIter aIterator(*pSubList, IM_FLAT);
@@ -541,7 +542,7 @@ SdrObject* SelectionHelper::getObjectToMark()
if(pObj)
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- SdrObjList* pSubList = pObj->GetSubList();
+ SdrObjList* pSubList = pObj->getChildrenOfSdrObject();
if(pSubList)
{
SdrObjListIter aIterator(*pSubList, IM_FLAT);
@@ -572,7 +573,7 @@ E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj )
if( !pRotateable )
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- SdrObjList* pSubList = pObj->GetSubList();
+ SdrObjList* pSubList = pObj->getChildrenOfSdrObject();
if(pSubList)
{
SdrObjListIter aIterator(*pSubList, IM_DEEPWITHGROUPS);
@@ -622,19 +623,20 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList )
if( m_pMarkObj && m_pMarkObj != m_pSelectedObj)
{
rHdlList.Clear();
- if( m_pMarkObj->ISA(SdrPathObj) )
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(m_pMarkObj);
+
+ if( pSdrPathObj )
{
//if th object is a polygon
//from each point a handle is generated
- const ::basegfx::B2DPolyPolygon& rPolyPolygon = ((SdrPathObj*)m_pMarkObj)->GetPathPoly();
- for( sal_uInt32 nN = 0L; nN < rPolyPolygon.count(); nN++)
+ const ::basegfx::B2DPolyPolygon aPolyPolygon = pSdrPathObj->getB2DPolyPolygonInObjectCoordinates();
+ for( sal_uInt32 nN = 0L; nN < aPolyPolygon.count(); nN++)
{
- const ::basegfx::B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(nN));
+ const ::basegfx::B2DPolygon aPolygon(aPolyPolygon.getB2DPolygon(nN));
for( sal_uInt32 nM = 0L; nM < aPolygon.count(); nM++)
{
const ::basegfx::B2DPoint aPoint(aPolygon.getB2DPoint(nM));
- SdrHdl* pHdl = new SdrHdl(Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())), HDL_POLY);
- rHdlList.AddHdl(pHdl);
+ new SdrHdl(rHdlList, pSdrPathObj, HDL_POLY, aPoint);
}
}
return true;
@@ -651,7 +653,7 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList )
SdrObject* pObj = m_pSelectedObj;
if(!pObj)
return false;
- SdrObjList* pSubList = pObj->GetSubList();
+ SdrObjList* pSubList = pObj->getChildrenOfSdrObject();
if( !pSubList )//no group object !pObj->IsGroupObject()
return false;
@@ -678,9 +680,8 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList )
return false;
}
- Point aPos = pSubObj->GetCurrentBoundRect().Center();
- SdrHdl* pHdl = new SdrHdl(aPos,HDL_POLY);
- rHdlList.AddHdl(pHdl);
+ const basegfx::B2DPoint aB2DPos(pSubObj->getObjectRange(rHdlList.GetViewFromSdrHdlList().getAsSdrView()).getCenter());
+ new SdrHdl(rHdlList, pSubObj, HDL_POLY, aB2DPos);
}
return true;
}
diff --git a/chart2/source/controller/main/SelectionHelper.hxx b/chart2/source/controller/main/SelectionHelper.hxx
index 73c1bd7e1de1..fb471c19d81f 100644
--- a/chart2/source/controller/main/SelectionHelper.hxx
+++ b/chart2/source/controller/main/SelectionHelper.hxx
@@ -72,7 +72,7 @@ public: //methods
void remindSelectionBeforeMouseDown();
bool isSelectionDifferentFromBeforeMouseDown();
- void adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper* pDrawViewWrapper
+ void adaptSelectionToNewPos( const basegfx::B2DPoint& rMousePos, DrawViewWrapper* pDrawViewWrapper
, bool bIsRightMouse, bool bWaitingForDoubleClick );
void applySelection( DrawViewWrapper* pDrawViewWrapper );
@@ -99,12 +99,12 @@ public:
, bool bGivenObjectMayBeResult );
static SdrObject* getMarkHandlesObject( SdrObject* pObj );
static E3dScene* getSceneToRotate( SdrObject* pObj );
- static bool isDragableObjectHitTwice( const Point& rMPos
+ static bool isDragableObjectHitTwice( const basegfx::B2DPoint& rMPos
, const rtl::OUString& rNameOfSelectedObject
, const DrawViewWrapper& rDrawViewWrapper );
static ::rtl::OUString getHitObjectCID(
- const Point& rMPos,
+ const basegfx::B2DPoint& rMPos,
DrawViewWrapper& rDrawViewWrapper,
bool bGetDiagramInsteadOf_Wall=false );
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 6b7b49c3d2b1..20632be1cfcb 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -266,9 +266,9 @@ void ShapeController::executeDispatch_FormatLine()
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
{
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedIfSingle();
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- sal_Bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ sal_Bool bHasMarked = pDrawViewWrapper->areSdrObjectsSelected();
if ( bHasMarked )
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, sal_False );
@@ -307,7 +307,7 @@ void ShapeController::executeDispatch_FormatArea()
if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
{
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- sal_Bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ sal_Bool bHasMarked = pDrawViewWrapper->areSdrObjectsSelected();
if ( bHasMarked )
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, sal_False );
@@ -320,7 +320,7 @@ void ShapeController::executeDispatch_FormatArea()
pDrawViewWrapper ) );
if ( pDlg.get() )
{
- SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
+ SfxItemPool& rItemPool = pDrawViewWrapper->getSdrModelFromSdrView().GetItemPool();
SfxItemSet aSet( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
const SvxColorTableItem* pColorItem = static_cast< const SvxColorTableItem* >( aSet.GetItem( SID_COLOR_TABLE ) );
if ( pColorItem && pColorItem->GetColorTable() == XColorTable::GetStdColorTable() )
@@ -355,7 +355,7 @@ void ShapeController::executeDispatch_TextAttributes()
if ( pParent && pDrawViewWrapper )
{
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- sal_Bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ sal_Bool bHasMarked = pDrawViewWrapper->areSdrObjectsSelected();
if ( bHasMarked )
{
pDrawViewWrapper->MergeAttrFromMarked( aAttr, sal_False );
@@ -391,11 +391,11 @@ void ShapeController::executeDispatch_TransformDialog()
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawViewWrapper )
{
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedIfSingle();
if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == OBJ_CAPTION )
{
// item set for caption
- SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ SfxItemSet aAttr( pDrawViewWrapper->getSdrModelFromSdrView().GetItemPool() );
pDrawViewWrapper->GetAttributes( aAttr );
// item set for position and size
SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
@@ -445,9 +445,9 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
if ( m_pChartController )
{
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
+ if ( pDrawViewWrapper )
{
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedIfSingle();
if ( pSelectedObj )
{
String aTitle( pSelectedObj->GetTitle() );
@@ -476,9 +476,9 @@ void ShapeController::executeDispatch_RenameObject()
if ( m_pChartController )
{
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
+ if ( pDrawViewWrapper )
{
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedIfSingle();
if ( pSelectedObj )
{
String aName( pSelectedObj->GetName() );
@@ -561,7 +561,7 @@ void ShapeController::executeDispatch_FontDialog()
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
{
- SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ SfxItemSet aAttr( pDrawViewWrapper->getSdrModelFromSdrView().GetItemPool() );
pDrawViewWrapper->GetAttributes( aAttr );
ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
::boost::scoped_ptr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) );
@@ -583,7 +583,7 @@ void ShapeController::executeDispatch_ParagraphDialog()
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawViewWrapper )
{
- SfxItemPool& rPool = pDrawViewWrapper->GetModel()->GetItemPool();
+ SfxItemPool& rPool = pDrawViewWrapper->getSdrModelFromSdrView().GetItemPool();
SfxItemSet aAttr( rPool );
pDrawViewWrapper->GetAttributes( aAttr );
@@ -700,7 +700,7 @@ bool ShapeController::isBackwardPossible()
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pDrawViewWrapper )
{
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedIfSingle();
SdrObject* pFirstObj = getFirstAdditionalShape();
if ( pSelectedObj && pFirstObj && pSelectedObj != pFirstObj )
{
@@ -719,7 +719,7 @@ bool ShapeController::isForwardPossible()
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pDrawViewWrapper )
{
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedIfSingle();
SdrObject* pLastObj = getLastAdditionalShape();
if ( pSelectedObj && pLastObj && pSelectedObj != pLastObj )
{
diff --git a/chart2/source/tools/BaseGFXHelper.cxx b/chart2/source/tools/BaseGFXHelper.cxx
index 63bf5fe8e9f3..2f87f378430f 100644
--- a/chart2/source/tools/BaseGFXHelper.cxx
+++ b/chart2/source/tools/BaseGFXHelper.cxx
@@ -200,7 +200,7 @@ void ReduceToRotationMatrix( ::basegfx::B3DHomMatrix & rB3DMatrix )
{
B3DTuple aR( GetRotationFromMatrix( rB3DMatrix ) );
::basegfx::B3DHomMatrix aRotationMatrix;
- aRotationMatrix.rotate(aR.getX(),aR.getY(),aR.getZ());
+ aRotationMatrix.rotate(aR);
rB3DMatrix = aRotationMatrix;
}
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index a4f080cbaf43..64281ef117d6 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -242,8 +242,8 @@ E3dScene* lcl_getE3dScene( const uno::Reference< drawing::XShape >& xShape )
if(pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
- if( pObj && pObj->ISA(E3dScene) )
- pRet = (E3dScene*)pObj;
+ if( pObj )
+ pRet = dynamic_cast< E3dScene* >(pObj);
}
}
return pRet;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 056e07c45dd5..d4a7888bf7ab 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -71,6 +71,7 @@
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <svx/unofill.hxx>
+#include <svx/svdlegacy.hxx>
#include <time.h>
@@ -1791,7 +1792,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const rtl::OUString& rObjectCID,
SdrObject* pRootSdrObject = pRoot->GetSdrObject();
if( pRootSdrObject )
{
- SdrObjList* pRootList = pRootSdrObject->GetSubList();
+ SdrObjList* pRootList = pRootSdrObject->getChildrenOfSdrObject();
if( pRootList )
{
OUString aShapeName = C2U("MarkHandles");
@@ -1817,7 +1818,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const rtl::OUString& rObjectCID,
SdrObject* pSdrObject = pShape->GetSdrObject();
if( pSdrObject )
{
- Rectangle aSnapRect( pSdrObject->GetSnapRect() );
+ const Rectangle aSnapRect( sdr::legacy::GetSnapRect(*pSdrObject) );
aRet = awt::Rectangle(aSnapRect.Left(),aSnapRect.Top(),aSnapRect.GetWidth(),aSnapRect.GetHeight());
}
}
@@ -2531,7 +2532,7 @@ void ChartView::createShapes()
SdrPage* pPage = ChartView::getSdrPage();
if(pPage) //it is neccessary to use the implementation here as the uno page does not provide a propertyset
- pPage->SetSize(Size(aPageSize.Width,aPageSize.Height));
+ pPage->SetPageScale(basegfx::B2DVector(aPageSize.Width,aPageSize.Height));
else
{
DBG_ERROR("could not set page size correctly");
@@ -2806,14 +2807,16 @@ void ChartView::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
- const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >(&rHint);
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
if( !pSdrHint )
return;
bool bShapeChanged = false;
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
- case HINT_OBJCHG:
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
+ case HINT_OBJCHG_ATTR:
bShapeChanged = true;
break;
case HINT_OBJINSERTED:
@@ -2835,7 +2838,7 @@ void ChartView::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
if(bShapeChanged)
{
//#i76053# do not send view modified notifications for changes on the hidden page which contains e.g. the symbols for the dialogs
- if( ChartView::getSdrPage() != pSdrHint->GetPage() )
+ if( ChartView::getSdrPage() != pSdrHint->GetSdrHintPage() )
bShapeChanged=false;
}
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 99b8966f87ee..7463485d7c84 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -35,8 +35,6 @@
#include <svl/eitem.hxx>
// header for define EE_PARA_HYPHENATE
#include <editeng/eeitem.hxx>
-// header for class Svx3DPercentDiagonalItem
-#include <svx/svx3ditems.hxx>
// header for class SvtPathOptions
#include <unotools/pathoptions.hxx>
// header E3dObjFactory
@@ -63,6 +61,9 @@
#include <com/sun/star/linguistic2/XHyphenator.hpp>
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
+#include <svx/svddef.hxx>
+#include <svl/intitem.hxx>
+
using namespace ::com::sun::star;
//.............................................................................
@@ -125,14 +126,14 @@ DrawModelWrapper::DrawModelWrapper(
m_xMCF = xContext->getServiceManager();
- SetScaleUnit(MAP_100TH_MM);
- SetScaleFraction(Fraction(1, 1));
+ SetExchangeObjectUnit(MAP_100TH_MM);
+ SetExchangeObjectScale(Fraction(1, 1));
SetDefaultFontHeight(423); // 12pt
SfxItemPool* pMasterPool = &GetItemPool();
pMasterPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, sal_True) );
- pMasterPool->SetPoolDefaultItem(Svx3DPercentDiagonalItem (5));
+ pMasterPool->SetPoolDefaultItem(SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, 5));
SfxItemPool* pPool = pMasterPool;
// append chart pool to end of pool chain
@@ -181,7 +182,7 @@ DrawModelWrapper::DrawModelWrapper(
MapMode aMapMode = m_apRefDevice->GetMapMode();
aMapMode.SetMapUnit(MAP_100TH_MM);
m_apRefDevice->SetMapMode(aMapMode);
- SetRefDevice(m_apRefDevice.get());
+ SetReferenceDevice(m_apRefDevice.get());
rOutliner.SetRefDevice(m_apRefDevice.get());
}
@@ -317,13 +318,13 @@ void DrawModelWrapper::attachParentReferenceDevice( const uno::Reference< frame:
OutputDevice * pParentRefDev( lcl_GetParentRefDevice( xChartModel ));
if( pParentRefDev )
{
- SetRefDevice( pParentRefDev );
+ SetReferenceDevice( pParentRefDev );
}
}
OutputDevice* DrawModelWrapper::getReferenceDevice() const
{
- return SdrModel::GetRefDevice();
+ return SdrModel::GetReferenceDevice();
}
SfxItemPool& DrawModelWrapper::GetItemPool()
@@ -378,7 +379,7 @@ SdrObject* DrawModelWrapper::getNamedSdrObject( const String& rObjectCID, SdrObj
continue;
if( ObjectIdentifier::areIdenticalObjects( rObjectCID, pObj->GetName() ) )
return pObj;
- pObj = DrawModelWrapper::getNamedSdrObject( rObjectCID, pObj->GetSubList() );
+ pObj = DrawModelWrapper::getNamedSdrObject( rObjectCID, pObj->getChildrenOfSdrObject() );
if(pObj)
return pObj;
}
diff --git a/connectivity/source/drivers/dbase/DCode.cxx b/connectivity/source/drivers/dbase/DCode.cxx
index 8296dcc8d0f2..40c89611dafc 100644
--- a/connectivity/source/drivers/dbase/DCode.cxx
+++ b/connectivity/source/drivers/dbase/DCode.cxx
@@ -37,7 +37,6 @@ using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
-TYPEINIT1(OFILEOperandAttr, OOperandAttr);
// -----------------------------------------------------------------------------
OOperandAttr* OFILEAnalyzer::createOperandAttr(sal_Int32 _nPos,
const Reference< XPropertySet>& _xCol,
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 050f0e1898dc..3ea89c4c7f01 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
#include "dbase/DIndex.hxx"
@@ -46,6 +44,7 @@
#include <comphelper/types.hxx>
#include "resource/dbase_res.hrc"
#include <unotools/sharedunocomponent.hxx>
+#include <memory.h>
using namespace ::comphelper;
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/dbase/DIndexIter.cxx b/connectivity/source/drivers/dbase/DIndexIter.cxx
index d53ed96b796e..d68ed7c6b19e 100644
--- a/connectivity/source/drivers/dbase/DIndexIter.cxx
+++ b/connectivity/source/drivers/dbase/DIndexIter.cxx
@@ -82,13 +82,13 @@ sal_uIntPtr OIndexIterator::Find(sal_Bool bFirst)
ONDXKey* pKey = GetNextKey();
nRes = pKey ? pKey->GetRecord() : STRING_NOTFOUND;
}
- else if (m_pOperator->IsA(TYPE(OOp_ISNOTNULL)))
+ else if (dynamic_cast< OOp_ISNOTNULL* >(m_pOperator))
nRes = GetNotNull(bFirst);
- else if (m_pOperator->IsA(TYPE(OOp_ISNULL)))
+ else if (dynamic_cast< OOp_ISNULL* >(m_pOperator))
nRes = GetNull(bFirst);
- else if (m_pOperator->IsA(TYPE(OOp_LIKE)))
+ else if (dynamic_cast< OOp_LIKE* >(m_pOperator))
nRes = GetLike(bFirst);
- else if (m_pOperator->IsA(TYPE(OOp_COMPARE)))
+ else if (dynamic_cast< OOp_COMPARE* >(m_pOperator))
nRes = GetCompare(bFirst);
return nRes;
@@ -146,7 +146,7 @@ sal_uIntPtr OIndexIterator::GetCompare(sal_Bool bFirst)
{
ONDXKey* pKey = NULL;
// ONDXIndex* m_pIndex = GetNDXIndex();
- sal_Int32 ePredicateType = PTR_CAST(file::OOp_COMPARE,m_pOperator)->getPredicateType();
+ sal_Int32 ePredicateType = dynamic_cast< file::OOp_COMPARE* >( m_pOperator)->getPredicateType();
if (bFirst)
{
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 6418012059d5..c51a6ae7f0f5 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
#include "dbase/dindexnode.hxx"
@@ -29,9 +27,8 @@
#include "dbase/DIndex.hxx"
#include <tools/debug.hxx>
#include "diagnose_ex.h"
-
#include <algorithm>
-
+#include <memory.h>
using namespace connectivity;
using namespace connectivity::dbase;
diff --git a/connectivity/source/drivers/file/FNoException.cxx b/connectivity/source/drivers/file/FNoException.cxx
index 592051a2ac5e..4d46c644e6d6 100644
--- a/connectivity/source/drivers/file/FNoException.cxx
+++ b/connectivity/source/drivers/file/FNoException.cxx
@@ -73,7 +73,7 @@ void OSQLAnalyzer::bindParameterRow(OValueRefRow& _pRow)
OCodeList& rCodeList = m_aCompiler->m_aCodeList;
for(OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end();++aIter)
{
- OOperandParam* pParam = PTR_CAST(OOperandParam,(*aIter));
+ OOperandParam* pParam = dynamic_cast< OOperandParam* >( (*aIter));
if ( pParam )
pParam->bindValue(_pRow);
}
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx
index e37ac74944dd..51ddc0f4cf17 100644
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ b/connectivity/source/drivers/file/fanalyzer.cxx
@@ -137,7 +137,7 @@ void OSQLAnalyzer::bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow,OEvalu
for (OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end(); ++aIter)
{
- OOperandAttr* pAttr = PTR_CAST(OOperandAttr,(*aIter));
+ OOperandAttr* pAttr = dynamic_cast< OOperandAttr* >( (*aIter));
if (pAttr)
{
if (pAttr->isIndexed() && !m_aCompiler->hasORCondition())
@@ -145,10 +145,10 @@ void OSQLAnalyzer::bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow,OEvalu
OCode* pCode1 = *(aIter + 1);
OCode* pCode2 = *(aIter + 2);
- if (PTR_CAST(OOperand,pCode1))
- pEvaluateSet = pAttr->preProcess(PTR_CAST(OBoolOperator,pCode2), PTR_CAST(OOperand,pCode1));
+ if (dynamic_cast< OOperand* >( pCode1))
+ pEvaluateSet = pAttr->preProcess(dynamic_cast< OBoolOperator* >( pCode2), dynamic_cast< OOperand* >(pCode1));
else
- pEvaluateSet = pAttr->preProcess(PTR_CAST(OBoolOperator,pCode1));
+ pEvaluateSet = pAttr->preProcess(dynamic_cast< OBoolOperator* >( pCode1));
}
if (pEvaluateSet)
@@ -234,18 +234,18 @@ void OSQLAnalyzer::describeParam(::vos::ORef<OSQLColumns> rParameterColumns)
for(OCodeList::iterator aIter = rCodeList.begin(); aIter != rCodeList.end(); ++aIter)
{
- OOperand* pOperand = PTR_CAST(OOperand,(*aIter));
- OOperator* pOperator = PTR_CAST(OOperator,(*aIter));
+ OOperand* pOperand = dynamic_cast< OOperand* >( (*aIter));
+ OOperator* pOperator = dynamic_cast< OOperator* >( (*aIter));
if (pOperand)
aCodeStack.push(pOperand);
else
{
if (pOperator->getRequestedOperands() == 2) // bei zwei Operatoren ist es moeglich
{ // einen Parameter weiter zu spezifizieren
- OOperandParam *pParam = PTR_CAST(OOperandParam,aCodeStack.top());
+ OOperandParam *pParam = dynamic_cast< OOperandParam* >( aCodeStack.top());
if (pParam) // Anpassen des ParameterTyps, wenn der linke Operand ein Attribut ist
{
- OOperandAttr *pLeft = PTR_CAST(OOperandAttr,*(rCodeList.end() - 2));
+ OOperandAttr *pLeft = dynamic_cast< OOperandAttr* >( *(rCodeList.end() - 2));
if (pLeft)
{
Reference< XPropertySet> xCol;
@@ -263,7 +263,7 @@ void OSQLAnalyzer::describeParam(::vos::ORef<OSQLColumns> rParameterColumns)
OSL_ENSURE(aCodeStack.size() == 0, "StackFehler");
OSL_ENSURE(pOperand, "StackFehler");
- if (IS_TYPE(OOperandResult,pOperand))
+ if ( typeid(OOperandResult) == typeid(*pOperand) ) // IS_TYPE(OOperandResult,pOperand))
delete pOperand;
else
OSL_ENSURE(0,"Illegal here!");
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
index e3250a64e87a..095f36a1a505 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -46,31 +46,6 @@ using namespace ::com::sun::star::sdb;
//using namespace ::com::sun::star::beans;
//using namespace ::com::sun::star::sdbcx;
-TYPEINIT0(OCode);
-TYPEINIT1(OOperand, OCode);
-TYPEINIT1(OOperandRow, OOperand);
-TYPEINIT1(OOperandAttr, OOperandRow);
-TYPEINIT1(OOperandParam, OOperandRow);
-TYPEINIT1(OOperandValue, OOperand);
-TYPEINIT1(OOperandConst, OOperandValue);
-TYPEINIT1(OOperandResult, OOperandValue);
-TYPEINIT1(OStopOperand, OOperandValue);
-
-TYPEINIT1(OOperator, OCode);
-TYPEINIT1(OBoolOperator,OOperator);
-TYPEINIT1(OOp_NOT, OBoolOperator);
-TYPEINIT1(OOp_AND, OBoolOperator);
-TYPEINIT1(OOp_OR, OBoolOperator);
-TYPEINIT1(OOp_ISNULL, OBoolOperator);
-TYPEINIT1(OOp_ISNOTNULL, OOp_ISNULL);
-TYPEINIT1(OOp_LIKE, OBoolOperator);
-TYPEINIT1(OOp_NOTLIKE, OOp_LIKE);
-TYPEINIT1(OOp_COMPARE, OBoolOperator);
-TYPEINIT1(ONumOperator, OOperator);
-TYPEINIT1(ONthOperator, OOperator);
-TYPEINIT1(OBinaryOperator, OOperator);
-TYPEINIT1(OUnaryOperator, OOperator);
-
//------------------------------------------------------------------
DBG_NAME(OCode )
OCode::OCode()
@@ -231,9 +206,9 @@ void OBoolOperator::Exec(OCodeStack& rCodeStack)
rCodeStack.pop();
rCodeStack.push(new OOperandResultBOOL(operate(pLeft, pRight)));
- if (IS_TYPE(OOperandResult,pLeft))
+ if ( typeid(OOperandResult) == typeid(*pLeft) ) // IS_TYPE(OOperandResult,pLeft))
delete pLeft;
- if (IS_TYPE(OOperandResult,pRight))
+ if ( typeid(OOperandResult) == typeid(*pRight) ) // IS_TYPE(OOperandResult,pRight))
delete pRight;
}
//------------------------------------------------------------------
@@ -250,7 +225,7 @@ void OOp_NOT::Exec(OCodeStack& rCodeStack)
rCodeStack.pop();
rCodeStack.push(new OOperandResultBOOL(operate(pOperand)));
- if (IS_TYPE(OOperandResult,pOperand))
+ if ( typeid(OOperandResult) == typeid(*pOperand) ) // IS_TYPE(OOperandResult,pOperand))
delete pOperand;
}
//------------------------------------------------------------------
@@ -289,7 +264,7 @@ void OOp_ISNULL::Exec(OCodeStack& rCodeStack)
rCodeStack.pop();
rCodeStack.push(new OOperandResultBOOL(operate(pOperand)));
- if (IS_TYPE(OOperandResult,pOperand))
+ if ( typeid(OOperandResult) == typeid(*pOperand) ) // IS_TYPE(OOperandResult,pOperand))
delete pOperand;
}
@@ -412,9 +387,9 @@ void ONumOperator::Exec(OCodeStack& rCodeStack)
rCodeStack.pop();
rCodeStack.push(new OOperandResultNUM(operate(pLeft->getValue(), pRight->getValue())));
- if (IS_TYPE(OOperandResult,pLeft))
+ if ( typeid(OOperandResult) == typeid(*pLeft) ) // IS_TYPE(OOperandResult,pLeft))
delete pLeft;
- if (IS_TYPE(OOperandResult,pRight))
+ if ( typeid(OOperandResult) == typeid(*pRight) ) // IS_TYPE(OOperandResult,pRight))
delete pRight;
}
//------------------------------------------------------------------
@@ -462,11 +437,11 @@ void ONthOperator::Exec(OCodeStack& rCodeStack)
OSL_ENSURE(!rCodeStack.empty(),"Stack must be none empty!");
pOperand = rCodeStack.top();
rCodeStack.pop();
- if ( !IS_TYPE(OStopOperand,pOperand) )
+ if ( typeid(OStopOperand) != typeid(*pOperand) ) // !IS_TYPE(OStopOperand,pOperand) )
aValues.push_back( pOperand->getValue() );
aOperands.push_back( pOperand );
}
- while ( !IS_TYPE(OStopOperand,pOperand) );
+ while ( typeid(OStopOperand) != typeid(*pOperand) ); // IS_TYPE(OStopOperand,pOperand) );
rCodeStack.push(new OOperandResult(operate(aValues)));
@@ -474,7 +449,7 @@ void ONthOperator::Exec(OCodeStack& rCodeStack)
::std::vector<OOperand*>::iterator aEnd = aOperands.end();
for (; aIter != aEnd; ++aIter)
{
- if (IS_TYPE(OOperandResult,*aIter))
+ if ( typeid(OOperandResult) == typeid(**aIter) ) // IS_TYPE(OOperandResult,*aIter))
delete *aIter;
}
}
@@ -487,13 +462,13 @@ void OBinaryOperator::Exec(OCodeStack& rCodeStack)
OOperand *pLeft = rCodeStack.top();
rCodeStack.pop();
- if ( !rCodeStack.empty() && IS_TYPE(OStopOperand,rCodeStack.top()) )
+ if ( !rCodeStack.empty() && ( typeid(OStopOperand) == typeid(*rCodeStack.top()) ) ) // IS_TYPE(OStopOperand,rCodeStack.top()) )
rCodeStack.pop();
rCodeStack.push(new OOperandResult(operate(pLeft->getValue(),pRight->getValue())));
- if (IS_TYPE(OOperandResult,pRight))
+ if ( typeid(OOperandResult) == typeid(*pRight) ) // IS_TYPE(OOperandResult,pRight))
delete pRight;
- if (IS_TYPE(OOperandResult,pLeft))
+ if ( typeid(OOperandResult) == typeid(*pLeft) ) // IS_TYPE(OOperandResult,pLeft))
delete pLeft;
}
//------------------------------------------------------------------
@@ -505,7 +480,7 @@ void OUnaryOperator::Exec(OCodeStack& rCodeStack)
rCodeStack.pop();
rCodeStack.push(new OOperandResult(operate(pOperand->getValue())));
- if (IS_TYPE(OOperandResult,pOperand))
+ if ( typeid(OOperandResult) == typeid(*pOperand) ) // IS_TYPE(OOperandResult,pOperand))
delete pOperand;
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 1513f0c5e2d2..0569e76c15a9 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -568,7 +568,7 @@ sal_Bool OPredicateInterpreter::evaluate(OCodeList& rCodeList)
for(;aIter != rCodeList.end();++aIter)
{
- OOperand* pOperand = PTR_CAST(OOperand,(*aIter));
+ OOperand* pOperand = dynamic_cast< OOperand* >( (*aIter));
if (pOperand)
m_aStack.push(pOperand);
else
@@ -582,7 +582,7 @@ sal_Bool OPredicateInterpreter::evaluate(OCodeList& rCodeList)
DBG_ASSERT(pOperand, "StackFehler");
bResult = pOperand->isValid();
- if (IS_TYPE(OOperandResult,pOperand))
+ if ( typeid(OOperandResult) == typeid(*pOperand) ) // IS_TYPE(OOperandResult,pOperand))
delete pOperand;
return bResult;
}
@@ -595,7 +595,7 @@ void OPredicateInterpreter::evaluateSelection(OCodeList& rCodeList,ORowSetValueD
for(;aIter != rCodeList.end();++aIter)
{
- OOperand* pOperand = PTR_CAST(OOperand,(*aIter));
+ OOperand* pOperand = dynamic_cast< OOperand* >( (*aIter));
if (pOperand)
m_aStack.push(pOperand);
else
@@ -609,7 +609,7 @@ void OPredicateInterpreter::evaluateSelection(OCodeList& rCodeList,ORowSetValueD
DBG_ASSERT(pOperand, "StackFehler");
(*_rVal) = pOperand->getValue();
- if (IS_TYPE(OOperandResult,pOperand))
+ if ( typeid(OOperandResult) == typeid(*pOperand) ) // IS_TYPE(OOperandResult,pOperand))
delete pOperand;
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/inc/dbase/DCode.hxx b/connectivity/source/inc/dbase/DCode.hxx
index c969476b3b2e..2225fc0f0fd6 100644
--- a/connectivity/source/inc/dbase/DCode.hxx
+++ b/connectivity/source/inc/dbase/DCode.hxx
@@ -56,7 +56,6 @@ namespace connectivity
virtual sal_Bool isIndexed() const;
virtual file::OEvaluateSet* preProcess(file::OBoolOperator* pOp, file::OOperand* pRight = 0);
- TYPEINFO();
};
}
}
diff --git a/connectivity/source/inc/file/fanalyzer.hxx b/connectivity/source/inc/file/fanalyzer.hxx
index 9a7777d5e993..98a61385e3f3 100644
--- a/connectivity/source/inc/file/fanalyzer.hxx
+++ b/connectivity/source/inc/file/fanalyzer.hxx
@@ -26,6 +26,7 @@
#include "file/fcomp.hxx"
#include "file/filedllapi.hxx"
+#include <tools/solar.h>
namespace connectivity
{
diff --git a/connectivity/source/inc/file/fcode.hxx b/connectivity/source/inc/file/fcode.hxx
index 5e338479494f..80f9848bde17 100644
--- a/connectivity/source/inc/file/fcode.hxx
+++ b/connectivity/source/inc/file/fcode.hxx
@@ -27,7 +27,6 @@
#include "connectivity/sqliterator.hxx"
#include <com/sun/star/sdbc/DataType.hpp>
#include "connectivity/CommonTools.hxx"
-#include <tools/rtti.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include "connectivity/FValue.hxx"
@@ -65,8 +64,6 @@ namespace connectivity
{ ::rtl_freeMemory( pMem ); }
inline static void SAL_CALL operator delete( void * /*pMem*/,void* /*_pHint*/ ) SAL_THROW( () )
{ }
-
- TYPEINFO();
};
@@ -86,8 +83,6 @@ namespace connectivity
virtual sal_Int32 getDBType() const {return m_eDBType;}
virtual OEvaluateSet* preProcess(OBoolOperator* pOp, OOperand* pRight = 0);
inline sal_Bool isValid() const;
-
- TYPEINFO();
};
class OOO_DLLPUBLIC_FILE OOperandRow : public OOperand
@@ -102,8 +97,6 @@ namespace connectivity
virtual const ORowSetValue& getValue() const;
virtual void setValue(const ORowSetValue& _rVal);
void bindValue(const OValueRefRow& _pRow); // Bindung an den Wert, den der Operand repraesentiert
-
- TYPEINFO();
};
// Attribute aus einer Ergebniszeile
@@ -118,7 +111,6 @@ namespace connectivity
virtual sal_Bool isIndexed() const;
virtual OEvaluateSet* preProcess(OBoolOperator* pOp, OOperand* pRight = 0);
- TYPEINFO();
};
// Parameter fuer ein Praedikat
@@ -127,8 +119,6 @@ namespace connectivity
public:
OOperandParam(connectivity::OSQLParseNode* pNode, sal_Int32 _nPos);
void describe(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn, ::vos::ORef<connectivity::OSQLColumns> _xParamColumns);
-
- TYPEINFO();
};
// WerteOperanden
@@ -148,8 +138,6 @@ namespace connectivity
public:
virtual const ORowSetValue& getValue() const;
virtual void setValue(const ORowSetValue& _rVal);
-
- TYPEINFO();
};
@@ -158,8 +146,6 @@ namespace connectivity
{
public:
OOperandConst(const connectivity::OSQLParseNode& rColumnRef, const rtl::OUString& aStrValue);
-
- TYPEINFO();
};
@@ -174,7 +160,6 @@ namespace connectivity
public:
OOperandResult(const ORowSetValue& _rVar)
:OOperandValue(_rVar, _rVar.getTypeKind()) {}
- TYPEINFO();
};
@@ -205,7 +190,6 @@ namespace connectivity
{
public:
OStopOperand(){}
- TYPEINFO();
};
// Operatoren
@@ -215,7 +199,6 @@ namespace connectivity
virtual void Exec(OCodeStack&) = 0;
virtual sal_uInt16 getRequestedOperands() const; // Anzahl benoetigter Operanden
// Standard ist 2
- TYPEINFO();
};
@@ -224,7 +207,6 @@ namespace connectivity
class OOO_DLLPUBLIC_FILE OBoolOperator : public OOperator
{
public:
- TYPEINFO();
virtual void Exec(OCodeStack&);
virtual sal_Bool operate(const OOperand*, const OOperand*) const;
};
@@ -232,8 +214,6 @@ namespace connectivity
class OOp_NOT : public OBoolOperator
{
public:
- TYPEINFO();
-
protected:
virtual void Exec(OCodeStack&);
virtual sal_Bool operate(const OOperand*, const OOperand* = NULL) const;
@@ -243,8 +223,6 @@ namespace connectivity
class OOp_AND : public OBoolOperator
{
public:
- TYPEINFO();
-
protected:
virtual sal_Bool operate(const OOperand*, const OOperand*) const;
};
@@ -252,7 +230,6 @@ namespace connectivity
class OOp_OR : public OBoolOperator
{
public:
- TYPEINFO();
protected:
virtual sal_Bool operate(const OOperand*, const OOperand*) const;
};
@@ -260,7 +237,6 @@ namespace connectivity
class OOO_DLLPUBLIC_FILE OOp_ISNULL : public OBoolOperator
{
public:
- TYPEINFO();
public:
virtual void Exec(OCodeStack&);
virtual sal_uInt16 getRequestedOperands() const;
@@ -270,14 +246,12 @@ namespace connectivity
class OOO_DLLPUBLIC_FILE OOp_ISNOTNULL : public OOp_ISNULL
{
public:
- TYPEINFO();
virtual sal_Bool operate(const OOperand*, const OOperand* = NULL) const;
};
class OOO_DLLPUBLIC_FILE OOp_LIKE : public OBoolOperator
{
public:
- TYPEINFO();
protected:
const sal_Unicode cEscape;
@@ -290,7 +264,6 @@ namespace connectivity
class OOp_NOTLIKE : public OOp_LIKE
{
public:
- TYPEINFO();
public:
OOp_NOTLIKE(const sal_Unicode cEsc = L'\0'):OOp_LIKE(cEsc){};
@@ -302,7 +275,6 @@ namespace connectivity
sal_Int32 aPredicateType;
public:
- TYPEINFO();
OOp_COMPARE(sal_Int32 aPType)
:aPredicateType(aPType) {}
@@ -317,8 +289,6 @@ namespace connectivity
public:
virtual void Exec(OCodeStack&);
- TYPEINFO();
-
protected:
virtual double operate(const double& fLeft,const double& fRight) const = 0;
};
@@ -358,8 +328,6 @@ namespace connectivity
public:
virtual void Exec(OCodeStack&);
- TYPEINFO();
-
protected:
virtual ORowSetValue operate(const ::std::vector<ORowSetValue>& lhs) const = 0;
};
@@ -369,8 +337,6 @@ namespace connectivity
public:
virtual void Exec(OCodeStack&);
- TYPEINFO();
-
protected:
virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const = 0;
};
@@ -381,9 +347,6 @@ namespace connectivity
virtual void Exec(OCodeStack&);
virtual sal_uInt16 getRequestedOperands() const;
virtual ORowSetValue operate(const ORowSetValue& lhs) const = 0;
-
- TYPEINFO();
-
};
}
}
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index a3a27174afb8..aa375ef00007 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -785,12 +785,14 @@ namespace cppcanvas
// gradient will always display at the origin, and
// not within the polygon bound (which might be
// miles away from the origin).
- aGradInfo.setTextureTransform(
- basegfx::tools::createTranslateB2DHomMatrix(
- aBounds.getMinX(),
- aBounds.getMinY()) * aGradInfo.getTextureTransform());
- ::basegfx::unotools::affineMatrixFromHomMatrix( aTexture.AffineTransform,
- aGradInfo.getTextureTransform() );
+ basegfx::B2DHomMatrix aTextureTransform(aGradInfo.getTextureTransform());
+
+ aTextureTransform.translate(aBounds.getMinimum());
+ aGradInfo.setTextureTransform(aTextureTransform);
+
+ ::basegfx::unotools::affineMatrixFromHomMatrix(
+ aTexture.AffineTransform,
+ aGradInfo.getTextureTransform());
uno::Sequence<uno::Any> args(3);
beans::PropertyValue aProp;
@@ -1678,8 +1680,7 @@ namespace cppcanvas
const ::Point& rPos( rVDev.LogicToPixel( pAct->GetPoint() ) );
const ::Size& rSize( rVDev.LogicToPixel( pAct->GetSize() ) );
- getState( rStates ).transform.translate( rPos.X(),
- rPos.Y() );
+ getState( rStates ).transform.translate( rPos.X(), rPos.Y() );
getState( rStates ).transform.scale( (double)rSize.Width() / aMtfSizePix.Width(),
(double)rSize.Height() / aMtfSizePix.Height() );
diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx
index 2e76dce13ac4..feef73a82b73 100644
--- a/cppcanvas/source/mtfrenderer/mtftools.cxx
+++ b/cppcanvas/source/mtfrenderer/mtftools.cxx
@@ -152,8 +152,7 @@ namespace cppcanvas
::basegfx::B2DHomMatrix aTransform;
if( bOffsetting )
- aTransform.translate( -rOffset.getX(),
- -rOffset.getY() );
+ aTransform.translate( -rOffset );
if( bScaling )
aTransform.scale( 1.0/pScaling->getX(), 1.0/pScaling->getY() );
@@ -188,8 +187,7 @@ namespace cppcanvas
::basegfx::B2DHomMatrix aTransform;
if( bOffsetting )
- aTransform.translate( -rOffset.getX(),
- -rOffset.getY() );
+ aTransform.translate( -rOffset );
if( bScaling )
aTransform.scale( 1.0/pScaling->getX(), 1.0/pScaling->getY() );
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index 6e9ca3486c03..499737a42604 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -88,8 +88,7 @@ namespace cppcanvas
&rState.fontRotation );
basegfx::B2DHomMatrix aLocalTransformation(basegfx::tools::createRotateB2DHomMatrix(rState.fontRotation));
- aLocalTransformation.translate( rStartPoint.getX(),
- rStartPoint.getY() );
+ aLocalTransformation.translate( rStartPoint );
::canvas::tools::appendToRenderState( o_rRenderState,
aLocalTransformation );
@@ -517,8 +516,7 @@ namespace cppcanvas
rendering::RenderState aShadowState( rRenderState );
::basegfx::B2DHomMatrix aTranslate;
- aTranslate.translate( rShadowOffset.getX(),
- rShadowOffset.getY() );
+ aTranslate.translate( rShadowOffset );
::canvas::tools::appendToRenderState(aShadowState, aTranslate);
@@ -535,8 +533,7 @@ namespace cppcanvas
rendering::RenderState aReliefState( rRenderState );
::basegfx::B2DHomMatrix aTranslate;
- aTranslate.translate( rReliefOffset.getX(),
- rReliefOffset.getY() );
+ aTranslate.translate( rReliefOffset );
::canvas::tools::appendToRenderState(aReliefState, aTranslate);
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index a3229f7e8cf9..25116cbae833 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -174,8 +174,7 @@ namespace cppcanvas
{
::basegfx::B2DHomMatrix aLocalTransformation;
- aLocalTransformation.translate( rDstPoint.getX(),
- rDstPoint.getY() );
+ aLocalTransformation.translate( rDstPoint );
::canvas::tools::appendToRenderState( rRenderState,
aLocalTransformation );
}
diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx
index 7219eba0aec2..887fac6cc736 100644
--- a/cui/inc/pch/precompiled_cui.hxx
+++ b/cui/inc/pch/precompiled_cui.hxx
@@ -867,7 +867,6 @@
#include "tools/resary.hxx"
#include "tools/resid.hxx"
#include "tools/resmgr.hxx"
-#include "tools/rtti.hxx"
#include "tools/shl.hxx"
#include "tools/solar.h"
#include "tools/stack.hxx"
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 4ee5159fac88..1b3e2e9355c2 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1426,18 +1426,18 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet )
const SfxPoolItem* pMacroItem=0;
if( SFX_ITEM_SET == rSet.GetItemState( SID_MACROINFO, sal_True, &pMacroItem ) )
{
- m_pMacroInfoItem = PTR_CAST( SfxMacroInfoItem, pMacroItem );
+ m_pMacroInfoItem = dynamic_cast< const SfxMacroInfoItem* >( pMacroItem );
pGroupLBox->SelectMacro( m_pMacroInfoItem );
}
else
{
const SfxPoolItem* pStringItem=0;
if( SFX_ITEM_SET == rSet.GetItemState( SID_CHARMAP, sal_True, &pStringItem ) )
- m_pStringItem = PTR_CAST( SfxStringItem, pStringItem );
+ m_pStringItem = dynamic_cast< const SfxStringItem* >( pStringItem );
const SfxPoolItem* pFontItem=0;
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_SPECIALCHAR, sal_True, &pFontItem ) )
- m_pFontItem = PTR_CAST( SfxStringItem, pFontItem );
+ m_pFontItem = dynamic_cast< const SfxStringItem* >( pFontItem );
}
}
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 9161c08d70e1..66fbc4d0d585 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -59,22 +59,22 @@ SvxCharacterMap::SvxCharacterMap( Window* pParent, sal_Bool bOne, const SfxItemS
SfxModalDialog( pParent, CUI_RES( RID_SVXDLG_CHARMAP ) ),
mpCharMapData( 0 )
{
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, FN_PARAM_1, sal_False );
+ SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, FN_PARAM_1 );
if ( pItem )
bOne = pItem->GetValue();
mpCharMapData = new SvxCharMapData( this, bOne, &CUI_MGR() );
- SFX_ITEMSET_ARG( pSet, pCharItem, SfxInt32Item, SID_ATTR_CHAR, sal_False );
+ SFX_ITEMSET_ARG( pSet, pCharItem, SfxInt32Item, SID_ATTR_CHAR );
if ( pCharItem )
SetChar( pCharItem->GetValue() );
- SFX_ITEMSET_ARG( pSet, pDisableItem, SfxBoolItem, FN_PARAM_2, sal_False );
+ SFX_ITEMSET_ARG( pSet, pDisableItem, SfxBoolItem, FN_PARAM_2 );
if ( pDisableItem && pDisableItem->GetValue() )
DisableFontSelection();
- SFX_ITEMSET_ARG( pSet, pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
- SFX_ITEMSET_ARG( pSet, pFontNameItem, SfxStringItem, SID_FONT_NAME, sal_False );
+ SFX_ITEMSET_ARG( pSet, pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT );
+ SFX_ITEMSET_ARG( pSet, pFontNameItem, SfxStringItem, SID_FONT_NAME );
if ( pFontItem )
{
Font aFont( pFontItem->GetFamilyName(), pFontItem->GetStyleName(), GetCharFont().GetSize() );
@@ -308,7 +308,7 @@ SvxCharMapData::SvxCharMapData( SfxModalDialog* pDialog, sal_Bool bOne_, ResMgr*
// the font may not be in the list =>
// try to find a font name token in list and select found font,
// else select topmost entry
- FASTBOOL bFound = (aFontLB.GetEntryPos( aDefStr ) == LISTBOX_ENTRY_NOTFOUND );
+ bool bFound = (aFontLB.GetEntryPos( aDefStr ) == LISTBOX_ENTRY_NOTFOUND );
if( !bFound )
{
for ( xub_StrLen i = 0; i < aDefStr.GetTokenCount(); ++i )
@@ -317,7 +317,7 @@ SvxCharMapData::SvxCharMapData( SfxModalDialog* pDialog, sal_Bool bOne_, ResMgr*
if ( aFontLB.GetEntryPos( aToken ) != LISTBOX_ENTRY_NOTFOUND )
{
aDefStr = aToken;
- bFound = sal_True;
+ bFound = true;
break;
}
}
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index dddd5d3029e2..49e648305ced 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -470,7 +470,7 @@ IMPL_LINK(FmSearchDialog, OnFieldSelected, ListBox*, pBox)
//------------------------------------------------------------------------
IMPL_LINK(FmSearchDialog, OnCheckBoxToggled, CheckBox*, pBox)
{
- sal_Bool bChecked = pBox->IsChecked();
+ bool bChecked = pBox->IsChecked();
// Formatter oder case -> an die Engine weiterreichen
if (pBox == &m_cbUseFormat)
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 7b7273041f07..95aec16429e6 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -374,7 +374,7 @@ void SvxHyperlinkNewDocTp::DoApply ()
&aFrame, &aReferer, 0L );
// save new doc
- const SfxViewFrameItem *pItem = PTR_CAST( SfxViewFrameItem, pReturn ); // SJ: pReturn is NULL if the Hyperlink
+ const SfxViewFrameItem *pItem = dynamic_cast< const SfxViewFrameItem* >( pReturn ); // SJ: pReturn is NULL if the Hyperlink
if ( pItem ) // creation is cancelled #106216#
{
pViewFrame = pItem->GetFrame();
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index 2d03e96ad1df..399591d560c3 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -471,14 +471,14 @@ void SvxHlinkDlgMarkWnd::ClearTree()
SvLBoxEntry* SvxHlinkDlgMarkWnd::FindEntry ( String aStrName )
{
- sal_Bool bFound=sal_False;
+ bool bFound=false;
SvLBoxEntry* pEntry = maLbTree.First();
while ( pEntry && !bFound )
{
TargetData* pUserData = ( TargetData * ) pEntry->GetUserData ();
if ( aStrName == String( pUserData->aUStrLinkname ) )
- bFound = sal_True;
+ bFound = true;
else
pEntry = maLbTree.Next( pEntry );
}
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index da8c9aee6587..53e071402706 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -971,7 +971,7 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool )
void IconChoiceDialog::SetInputSet( const SfxItemSet* pInSet )
{
- FASTBOOL bSet = ( pSet != NULL );
+ bool bSet = ( pSet != NULL );
pSet = pInSet;
@@ -1103,7 +1103,7 @@ const SfxItemSet* IconChoiceDialog::GetRefreshedSet()
IconChoicePageData* IconChoiceDialog::GetPageData ( sal_uInt16 nId )
{
IconChoicePageData *pRet = NULL;
- sal_Bool bFound = sal_False;
+ bool bFound = false;
for ( sal_uLong i=0; i<maPageList.Count() && !bFound; i++ )
{
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 55fd3539def5..2d3bd0597371 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -955,7 +955,7 @@ void SvxScriptOrgDialog::createEntry( SvLBoxEntry* pEntry )
{
aNewName = aNewStdName;
aNewName += String::CreateFromInt32( i );
- sal_Bool bFound = sal_False;
+ bool bFound = false;
if(childNodes.getLength() > 0 )
{
::rtl::OUString nodeName = childNodes[0]->getName();
@@ -967,7 +967,7 @@ void SvxScriptOrgDialog::createEntry( SvLBoxEntry* pEntry )
{
if ( (aNewName+extn).equals( childNodes[index]->getName() ) )
{
- bFound = sal_True;
+ bFound = true;
break;
}
}
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index 05d147d3dd02..e62f46cc303e 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -166,14 +166,15 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog( Window* pParent,
sal_uInt16 nSlot = rPool.GetSlotId( nWhich );
if ( nSlot >= SID_SVX_START )
{
- sal_Bool bChecked = sal_False, bFound = sal_False;
+ bool bChecked = false;
+ bool bFound = false;
for ( sal_uInt16 i = 0; !bFound && i < rList.Count(); ++i )
{
if ( nSlot == rList[i].nSlot )
{
- bFound = sal_True;
+ bFound = true;
if ( IsInvalidItem( rList[i].pItem ) )
- bChecked = sal_True;
+ bChecked = true;
}
}
@@ -212,7 +213,7 @@ IMPL_LINK( SvxSearchAttributeDialog, OKHdl, Button *, EMPTYARG )
for ( sal_uInt16 i = 0; i < aAttrLB.GetEntryCount(); ++i )
{
sal_uInt16 nSlot = (sal_uInt16)(sal_uLong)aAttrLB.GetEntryData(i);
- sal_Bool bChecked = aAttrLB.IsChecked(i);
+ bool bChecked = aAttrLB.IsChecked(i);
sal_uInt16 j;
for ( j = rList.Count(); j; )
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index a650cc3201ab..2bc7b80ca74e 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -235,13 +235,13 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
aBookModeChk.SetAccessibleRelationMemberOf(&aColumnsBtn);
const SfxPoolItem& rItem = rSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
+ const SvxZoomItem* pZoomItem = dynamic_cast< const SvxZoomItem* >(&rItem);
- if ( rItem.ISA(SvxZoomItem) )
+ if ( pZoomItem )
{
- const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem;
- const sal_uInt16 nZoom = rZoomItem.GetValue();
- const SvxZoomType eType = rZoomItem.GetType();
- const sal_uInt16 nValSet = rZoomItem.GetValueSet();
+ const sal_uInt16 nZoom = pZoomItem->GetValue();
+ const SvxZoomType eType = pZoomItem->GetType();
+ const sal_uInt16 nValSet = pZoomItem->GetValueSet();
sal_uInt16 nBtnId = 0;
switch ( eType )
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 030c7ce7f02e..ac9125841f2e 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1675,7 +1675,7 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent,
case RID_SVXPAGE_IMPROVEMENT :
{
String help_url;
- SFX_ITEMSET_ARG( &rAttr, pItem, SfxStringItem, SID_CURRENT_URL, sal_False );
+ SFX_ITEMSET_ARG( &rAttr, pItem, SfxStringItem, SID_CURRENT_URL );
if ( pItem )
help_url = pItem->GetValue();
pDlg = new SvxImprovementDialog( pParent, help_url);
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index ceb75fa08b6e..94767287c6e7 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -88,7 +88,7 @@ class OfaACorrCheckListBox : public SvxSimpleTable
inline sal_uLong GetSelectEntryPos() { return GetModel()->GetAbsPos(FirstSelected()); }
sal_Bool IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0);
- void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked);
+ void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked);
SvButtonState GetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol ) const;
void SetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol, SvButtonState );
};
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index 39ab2df3400a..c57e6cd8a3e4 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -120,7 +120,7 @@ class SvxGrfCropPage : public SfxTabPage
void CalcZoom();
void CalcMinMaxBorder();
- void GraphicHasChanged(sal_Bool bFound);
+ void GraphicHasChanged(bool bFound);
virtual void ActivatePage(const SfxItemSet& rSet);
Size GetGrfOrigSize( const Graphic& ) const;
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index f49e36df91b9..efc15e345169 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -161,8 +161,8 @@ class SvxPageDescPage : public SfxTabPage
long nLastBottomMargin;
Size aMaxSize;
- sal_Bool bLandscape;
- FASTBOOL bBorderModified;
+ sal_Bool bLandscape;
+ bool bBorderModified;
SvxModeType eMode;
Paper ePaperStart;
Paper ePaperEnd;
@@ -174,7 +174,7 @@ class SvxPageDescPage : public SfxTabPage
DECL_LINK( LayoutHdl_Impl, ListBox* );
DECL_LINK( PaperBinHdl_Impl, ListBox* );
DECL_LINK( SwapOrientation_Impl, RadioButton* );
- void SwapFirstValues_Impl( FASTBOOL bSet );
+ void SwapFirstValues_Impl( bool bSet );
DECL_LINK( BorderModify_Impl, MetricField* );
void InitHeadFoot_Impl( const SfxItemSet& rSet );
DECL_LINK( CenterHdl_Impl, CheckBox* );
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 54e282d37f82..8876ea550eeb 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -37,8 +37,6 @@
using namespace com::sun::star;
-TYPEINIT1( SvxChartColorTableItem, SfxPoolItem );
-
SvxChartColorTable::SvxChartColorTable()
{}
diff --git a/cui/source/options/cfgchart.hxx b/cui/source/options/cfgchart.hxx
index 12ad1d54e296..8e25d5c92804 100644
--- a/cui/source/options/cfgchart.hxx
+++ b/cui/source/options/cfgchart.hxx
@@ -24,8 +24,6 @@
#ifndef _SVX_CFGCHART_HXX
#define _SVX_CFGCHART_HXX
-// header for TYPEINFO
-#include <tools/rtti.hxx>
// header for ConfigItem
#include <unotools/configitem.hxx>
// header for SfxPoolItem
@@ -92,7 +90,6 @@ public:
class SvxChartColorTableItem : public SfxPoolItem
{
public:
- TYPEINFO();
SvxChartColorTableItem( sal_uInt16 nWhich, const SvxChartColorTable& );
SvxChartColorTableItem( const SvxChartColorTableItem& );
diff --git a/cui/source/options/connpoolsettings.cxx b/cui/source/options/connpoolsettings.cxx
index 157c8c5d524b..389135471c42 100644
--- a/cui/source/options/connpoolsettings.cxx
+++ b/cui/source/options/connpoolsettings.cxx
@@ -61,8 +61,6 @@ namespace offapp
//====================================================================
//= DriverPoolingSettingsItem
//====================================================================
- TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
- //--------------------------------------------------------------------
DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings )
:SfxPoolItem(_nId)
,m_aSettings(_rSettings)
@@ -72,7 +70,7 @@ namespace offapp
//--------------------------------------------------------------------
int DriverPoolingSettingsItem::operator==( const SfxPoolItem& _rCompare ) const
{
- const DriverPoolingSettingsItem* pItem = PTR_CAST(DriverPoolingSettingsItem, &_rCompare);
+ const DriverPoolingSettingsItem* pItem = dynamic_cast< const DriverPoolingSettingsItem* >( &_rCompare);
if (!pItem)
return sal_False;
diff --git a/cui/source/options/connpoolsettings.hxx b/cui/source/options/connpoolsettings.hxx
index a783d7a600b9..24e5a15dc57c 100644
--- a/cui/source/options/connpoolsettings.hxx
+++ b/cui/source/options/connpoolsettings.hxx
@@ -84,8 +84,6 @@ namespace offapp
DriverPoolingSettings m_aSettings;
public:
- TYPEINFO();
-
DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings );
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/cui/source/options/dbregistersettings.cxx b/cui/source/options/dbregistersettings.cxx
index 8cf63dd3c69a..54581b996edd 100644
--- a/cui/source/options/dbregistersettings.cxx
+++ b/cui/source/options/dbregistersettings.cxx
@@ -36,8 +36,6 @@ namespace svx
//====================================================================
//= DatabaseMapItem
//====================================================================
- TYPEINIT1( DatabaseMapItem, SfxPoolItem )
- //--------------------------------------------------------------------
DatabaseMapItem::DatabaseMapItem( sal_uInt16 _nId, const DatabaseRegistrations& _rRegistrations )
:SfxPoolItem( _nId )
,m_aRegistrations( _rRegistrations )
@@ -47,7 +45,7 @@ namespace svx
//--------------------------------------------------------------------
int DatabaseMapItem::operator==( const SfxPoolItem& _rCompare ) const
{
- const DatabaseMapItem* pItem = PTR_CAST(DatabaseMapItem, &_rCompare);
+ const DatabaseMapItem* pItem = dynamic_cast< const DatabaseMapItem* >( &_rCompare);
if ( !pItem )
return sal_False;
diff --git a/cui/source/options/dbregistersettings.hxx b/cui/source/options/dbregistersettings.hxx
index 9e8413d54154..f680b7d370fd 100644
--- a/cui/source/options/dbregistersettings.hxx
+++ b/cui/source/options/dbregistersettings.hxx
@@ -73,8 +73,6 @@ namespace svx
DatabaseRegistrations m_aRegistrations;
public:
- TYPEINFO();
-
DatabaseMapItem( sal_uInt16 _nId, const DatabaseRegistrations& _rRegistrations );
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index d681813dd0ef..49919f41fffe 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -514,7 +514,7 @@ void SvxFontSubstCheckListBox::KeyInput( const KeyEvent& rKEvt )
/* */
/*********************************************************************/
-void SvxFontSubstCheckListBox::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked)
+void SvxFontSubstCheckListBox::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked)
{
if ( nPos < GetEntryCount() )
SetCheckButtonState(
@@ -528,7 +528,7 @@ void SvxFontSubstCheckListBox::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sa
/* */
/*********************************************************************/
-void SvxFontSubstCheckListBox::CheckEntry(SvLBoxEntry* pEntry, sal_uInt16 nCol, sal_Bool bChecked)
+void SvxFontSubstCheckListBox::CheckEntry(SvLBoxEntry* pEntry, sal_uInt16 nCol, bool bChecked)
{
if ( pEntry )
SetCheckButtonState(
diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx
index 0649a09b12c0..73386dec4fdd 100644
--- a/cui/source/options/fontsubs.hxx
+++ b/cui/source/options/fontsubs.hxx
@@ -56,8 +56,8 @@ class SvxFontSubstCheckListBox : public SvxSimpleTable
sal_Bool IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0);
sal_Bool IsChecked(SvLBoxEntry* pEntry, sal_uInt16 nCol = 0);
- void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked);
- void CheckEntry(SvLBoxEntry* pEntry, sal_uInt16 nCol, sal_Bool bChecked);
+ void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked);
+ void CheckEntry(SvLBoxEntry* pEntry, sal_uInt16 nCol, bool bChecked);
SvButtonState GetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol ) const;
void SetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol, SvButtonState );
};
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx
index 4bb862f987ae..e7023d48599d 100644
--- a/cui/source/options/optaccessibility.cxx
+++ b/cui/source/options/optaccessibility.cxx
@@ -169,7 +169,7 @@ void SvxAccessibilityOptionsTabPage::Reset( const SfxItemSet& )
IMPL_LINK(SvxAccessibilityOptionsTabPage, TipHelpHdl, CheckBox*, pBox)
{
- sal_Bool bChecked = pBox->IsChecked();
+ bool bChecked = pBox->IsChecked();
m_aTipHelpNF.Enable(bChecked);
return 0;
}
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 46101452ccf1..40124660a419 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -142,11 +142,11 @@ IMPL_LINK( SvxNewDictionaryDialog, OKHdl_Impl, Button *, EMPTYARG )
const Reference< XDictionary > *pDic = aDics.getConstArray();
sal_Int32 nCount = (sal_uInt16) aDics.getLength();
- sal_Bool bFound = sal_False;
+ bool bFound = false;
sal_uInt16 i;
for (i = 0; !bFound && i < nCount; ++i )
if ( sDict.EqualsIgnoreCaseAscii( String(pDic[i]->getName()) ))
- bFound = sal_True;
+ bFound = true;
if ( bFound )
{
@@ -699,7 +699,7 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
{
if(nWordLen>0)
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
sal_Bool bTmpSelEntry=sal_False;
CDE_RESULT eCmpRes = CDE_DIFFERENT;
@@ -723,7 +723,7 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
aNewReplaceText = sModify;
bEnableNewReplace = sal_True;
}
- bFound= sal_True;
+ bFound = true;
break;
}
else if(getNormDicEntry_Impl(aTestStr).Search(
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 49681f9a71f4..f172ec91f74f 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -389,7 +389,7 @@ SvButtonState OfaMSFilterTabPage2::MSFltrSimpleTable::GetCheckButtonState(
/* -----------------------------2002/06/20 11:57------------------------------
---------------------------------------------------------------------------*/
-void OfaMSFilterTabPage2::MSFltrSimpleTable::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked)
+void OfaMSFilterTabPage2::MSFltrSimpleTable::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked)
{
if ( nPos < GetEntryCount() )
SetCheckButtonState(
diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx
index 3b474312851d..e5bf4150d8dd 100644
--- a/cui/source/options/optfltr.hxx
+++ b/cui/source/options/optfltr.hxx
@@ -69,7 +69,7 @@ class OfaMSFilterTabPage2 : public SfxTabPage
using SvTreeListBox::SetCheckButtonState;
using SvxSimpleTable::SetTabs;
- void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked);
+ void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked);
SvButtonState GetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol ) const;
void SetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol, SvButtonState );
protected:
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index f4742d937f7e..c15da85b0aca 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -374,7 +374,7 @@ sal_Bool OfaMiscTabPage::FillItemSet( SfxItemSet& rSet )
}
const SfxUInt16Item* pUInt16Item =
- PTR_CAST( SfxUInt16Item, GetOldItem( rSet, SID_ATTR_YEAR2000 ) );
+ dynamic_cast< const SfxUInt16Item* >( GetOldItem( rSet, SID_ATTR_YEAR2000 ) );
sal_uInt16 nNum = (sal_uInt16)aYearValueField.GetText().ToInt32();
if ( pUInt16Item && pUInt16Item->GetValue() != nNum )
{
@@ -1585,7 +1585,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
if(aAsianSupportCB.GetSavedValue() != aAsianSupportCB.IsChecked() )
{
- sal_Bool bChecked = aAsianSupportCB.IsChecked();
+ bool bChecked = aAsianSupportCB.IsChecked();
pLangConfig->aLanguageOptions.SetAll(bChecked);
//iterate over all bindings to invalidate vertical text direction
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 0ce2cc604ff7..aae0e097dac9 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -1026,7 +1026,7 @@ IMPL_LINK( SvxSearchTabPage, SearchModifyHdl_Impl, SvxNoSpaceEdit*, pEdit )
if ( pEdit == &aSearchNameED )
{
sal_Bool bTextLen = ( 0 != pEdit->GetText().Len() );
- sal_Bool bFound = sal_False;
+ bool bFound = false;
if ( bTextLen )
{
sal_uInt16 nEntryPos = aSearchLB.GetEntryPos( pEdit->GetText() );
diff --git a/cui/source/options/optjsearch.cxx b/cui/source/options/optjsearch.cxx
index eb38f625f3b0..87dd89a18253 100644
--- a/cui/source/options/optjsearch.cxx
+++ b/cui/source/options/optjsearch.cxx
@@ -234,7 +234,8 @@ sal_Bool SvxJSearchOptionsPage::FillItemSet( SfxItemSet& )
bModified = sal_False;
SvtSearchOptions aOpt;
- sal_Bool bNewVal, bChanged;
+ sal_Bool bNewVal;
+ bool bChanged;
bNewVal = aMatchCase.IsChecked(); //! treat as equal uppercase/lowercase
bChanged = bNewVal != aMatchCase.GetSavedValue();
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 6af076f238cb..963b53f5649a 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -221,7 +221,7 @@ class ModuleUserData_Impl
String sImplName;
public:
- ModuleUserData_Impl( String sImpName, sal_Bool bIsParent, sal_Bool bChecked, sal_uInt8 nSetType, sal_uInt8 nSetIndex ) :
+ ModuleUserData_Impl( String sImpName, sal_Bool bIsParent, bool bChecked, sal_uInt8 nSetType, sal_uInt8 nSetIndex ) :
bParent(bIsParent),
bIsChecked(bChecked),
nType(nSetType),
@@ -250,7 +250,7 @@ class DicUserData
public:
DicUserData( sal_uLong nUserData ) : nVal( nUserData ) {}
DicUserData( sal_uInt16 nEID,
- sal_Bool bChecked, sal_Bool bEditable, sal_Bool bDeletable );
+ bool bChecked, sal_Bool bEditable, sal_Bool bDeletable );
sal_uLong GetUserData() const { return nVal; }
sal_uInt16 GetEntryId() const { return (sal_uInt16)(nVal >> 16); }
@@ -264,7 +264,7 @@ public:
DicUserData::DicUserData(
sal_uInt16 nEID,
- sal_Bool bChecked, sal_Bool bEditable, sal_Bool bDeletable )
+ bool bChecked, sal_Bool bEditable, sal_Bool bDeletable )
{
DBG_ASSERT( nEID < 65000, "Entry Id out of range" );
nVal = ((sal_uLong)(0xFFFF & nEID) << 16) |
@@ -416,7 +416,7 @@ public:
OptionsUserData( sal_uLong nUserData ) : nVal( nUserData ) {}
OptionsUserData( sal_uInt16 nEID,
sal_Bool bHasNV, sal_uInt16 nNumVal,
- sal_Bool bCheckable, sal_Bool bChecked );
+ sal_Bool bCheckable, bool bChecked );
sal_uLong GetUserData() const { return nVal; }
sal_uInt16 GetEntryId() const { return (sal_uInt16)(nVal >> 16); }
@@ -432,7 +432,7 @@ public:
OptionsUserData::OptionsUserData( sal_uInt16 nEID,
sal_Bool bHasNV, sal_uInt16 nNumVal,
- sal_Bool bCheckable, sal_Bool bChecked )
+ sal_Bool bCheckable, bool bChecked )
{
DBG_ASSERT( nEID < 65000, "Entry Id out of range" );
DBG_ASSERT( nNumVal < 256, "value out of range" );
@@ -1365,12 +1365,12 @@ sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet )
DicUserData aData( (sal_uLong)pEntry->GetUserData() );
if (aData.GetEntryId() < nDics)
{
- sal_Bool bChecked = aLinguDicsCLB.IsChecked( (sal_uInt16) i );
+ bool bChecked = aLinguDicsCLB.IsChecked( (sal_uInt16) i );
uno::Reference< XDictionary > xDic( aDics.getConstArray()[ i ] );
if (xDic.is())
{
if (SvxGetIgnoreAllList() == xDic)
- bChecked = sal_True;
+ bChecked = true;
xDic->setActive( bChecked );
if (bChecked)
@@ -1457,7 +1457,7 @@ sal_uLong SvxLinguTabPage::GetDicUserData( const uno::Reference< XDictionary > &
uno::Reference< frame::XStorable > xStor( rxDic, UNO_QUERY );
// sal_uLong nUserData = 0;
- sal_Bool bChecked = rxDic->isActive();
+ bool bChecked = rxDic->isActive();
sal_Bool bEditable = !xStor.is() || !xStor->isReadonly();
sal_Bool bDeletable = bEditable;
// sal_Bool bNegativ = rxDic->getDictionaryType() == DictionaryType_NEGATIVE;
@@ -2244,7 +2244,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
sal_Int32 nStart = 0, nLocalIndex = 0;
Sequence< OUString > aChange;
- sal_Bool bChanged = sal_False;
+ bool bChanged = false;
for(sal_uInt16 i = 0; i < aModulesCLB.GetEntryCount(); i++)
{
SvLBoxEntry *pEntry = aModulesCLB.GetEntry(i);
@@ -2270,7 +2270,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox )
}
nLocalIndex = nStart = 0;
aChange.realloc(aModulesCLB.GetEntryCount());
- bChanged = sal_False;
+ bChanged = false;
}
else
{
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 538ddb0be933..e3a93873d83e 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -502,7 +502,7 @@ void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder )
// old path is an URL?
INetURLObject aObj( sWritable );
- FASTBOOL bURL = ( aObj.GetProtocol() != INET_PROT_NOT_VALID );
+ bool bURL = ( aObj.GetProtocol() != INET_PROT_NOT_VALID );
rtl::OUString aPathStr( _rFolder );
INetURLObject aNewObj( aPathStr );
aNewObj.removeFinalSlash();
@@ -510,7 +510,7 @@ void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder )
// then the new path also an URL else system path
String sNewPathStr = bURL ? aPathStr : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT );
- FASTBOOL bChanged =
+ bool bChanged =
#ifdef UNX
// Unix is case sensitive
( sNewPathStr != sWritable );
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 32354058fcda..3e81fe13e260 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -90,11 +90,11 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) :
if ( _pSet )
{
- SFX_ITEMSET_ARG( _pSet, pItem, SfxBoolItem, SID_AUTO_CORRECT_DLG, sal_False );
+ SFX_ITEMSET_ARG( _pSet, pItem, SfxBoolItem, SID_AUTO_CORRECT_DLG );
if ( pItem && pItem->GetValue() )
bShowSWOptions = sal_True;
- SFX_ITEMSET_ARG( _pSet, pItem2, SfxBoolItem, SID_OPEN_SMARTTAGOPTIONS, sal_False );
+ SFX_ITEMSET_ARG( _pSet, pItem2, SfxBoolItem, SID_OPEN_SMARTTAGOPTIONS );
if ( pItem2 && pItem2->GetValue() )
bOpenSmartTagOptions = sal_True;
}
@@ -851,7 +851,7 @@ void OfaACorrCheckListBox::SetTabs()
/* */
/*********************************************************************/
-void OfaACorrCheckListBox::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked)
+void OfaACorrCheckListBox::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked)
{
if ( nPos < GetEntryCount() )
SetCheckButtonState(
@@ -2066,7 +2066,7 @@ OfaQuoteTabPage::OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet ) :
aCheckLB.SetHelpId( HID_OFAPAGE_QUOTE_CLB );
aSwCheckLB.SetHelpId( HID_OFAPAGE_QUOTE_SW_CLB );
- SFX_ITEMSET_ARG( &rSet, pItem, SfxBoolItem, SID_AUTO_CORRECT_DLG, sal_False );
+ SFX_ITEMSET_ARG( &rSet, pItem, SfxBoolItem, SID_AUTO_CORRECT_DLG );
if ( pItem && pItem->GetValue() )
bShowSWOptions = sal_True;
@@ -2832,7 +2832,7 @@ sal_Bool OfaSmartTagOptionsTabPage::FillItemSet( SfxItemSet& )
{
const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(i);
const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData());
- const sal_Bool bChecked = m_aSmartTagTypesLB.IsChecked(i);
+ const bool bChecked = m_aSmartTagTypesLB.IsChecked(i);
const sal_Bool bIsCurrentlyEnabled = pSmartTagMgr->IsSmartTagTypeEnabled( pUserData->maSmartTagType );
bModifiedSmartTagTypes = bModifiedSmartTagTypes || ( !bChecked != !bIsCurrentlyEnabled );
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 938ae0868580..110f09d059b0 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -479,7 +479,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet& rSet )
// os: So ein Unsinn! Irgendwo laesst sich so ein Item immer finden,
// es muss aber im rSet vorhanden sein!
// const SfxPoolItem* pX = GetOldItem( rSet, SID_VIEW_FLD_PIC );
-// if( pX && pX->ISA(SfxWallpaperItem))
+// if( pX && dynamic_cast< SfxWallpaperItem* >(pX))
if(SFX_ITEM_AVAILABLE <= rSet.GetItemState(GetWhich(SID_VIEW_FLD_PIC), sal_False))
{
ResetFromWallpaperItem( rSet );
@@ -759,7 +759,7 @@ sal_Bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
// es muss aber im rSet vorhanden sein!
// const SfxPoolItem* pX = GetOldItem( rCoreSet, SID_VIEW_FLD_PIC );
-// if( pX && pX->ISA(SfxWallpaperItem))
+// if( pX && dynamic_cast< SfxWallpaperItem* >(pX))
if(SFX_ITEM_AVAILABLE <= rCoreSet.GetItemState(GetWhich(SID_VIEW_FLD_PIC), sal_False))
return FillItemSetWithWallpaperItem( rCoreSet, SID_VIEW_FLD_PIC );
@@ -1196,14 +1196,14 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl()
const SfxPoolItem* pItem = NULL;
XColorTable* pColorTable = NULL;
const Size aSize15x15 = Size( 15, 15 );
- FASTBOOL bOwn = sal_False;
+ bool bOwn = false;
if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
if ( !pColorTable )
{
- bOwn = sal_True;
+ bOwn = true;
pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
}
@@ -1968,7 +1968,7 @@ void SvxBackgroundTabPage::EnableTransparency(sal_Bool bColor, sal_Bool bGraphic
void SvxBackgroundTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE );
if (pFlagItem)
{
sal_uInt32 nFlags=pFlagItem->GetValue();
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 578f29deac8f..6175daf2a0ab 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -1223,8 +1223,8 @@ void SvxBorderTabPage::DataChanged( const DataChangedEvent& rDCEvt )
void SvxBorderTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pSWModeItem,SfxUInt16Item,SID_SWMODE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pSWModeItem,SfxUInt16Item,SID_SWMODE_TYPE );
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE );
if (pSWModeItem)
{
nSWMode = pSWModeItem->GetValue();
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 50ce94bd633d..ce3a46604335 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -716,7 +716,7 @@ void SvxCharNamePage::Initialize()
SfxObjectShell* pDocSh = SfxObjectShell::Current();
//DBG_ASSERT( pDocSh, "DocShell not found!" );
XColorTable* pColorTable = NULL;
- FASTBOOL bKillTable = sal_False;
+ bool bKillTable = false;
const SfxPoolItem* pItem = NULL;
if ( pDocSh )
@@ -729,7 +729,7 @@ void SvxCharNamePage::Initialize()
if ( !pColorTable )
{
pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = sal_True;
+ bKillTable = true;
}
m_pColorLB->SetUpdateMode( sal_False );
@@ -1043,8 +1043,8 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
FillStyleBox_Impl( pNameBox );
- FASTBOOL bStyle = sal_False;
- FASTBOOL bStyleAvailable = sal_True;
+ bool bStyle = false;
+ bool bStyleAvailable = true;
FontItalic eItalic = ITALIC_NONE;
FontWeight eWeight = WEIGHT_NORMAL;
switch ( eLangGrp )
@@ -1059,7 +1059,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
{
const SvxPostureItem& rItem = (SvxPostureItem&)rSet.Get( nWhich );
eItalic = (FontItalic)rItem.GetValue();
- bStyle = sal_True;
+ bStyle = true;
}
bStyleAvailable = bStyleAvailable && (eState >= SFX_ITEM_DONTCARE);
@@ -1077,7 +1077,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
eWeight = (FontWeight)rItem.GetValue();
}
else
- bStyle = sal_False;
+ bStyle = false;
bStyleAvailable = bStyleAvailable && (eState >= SFX_ITEM_DONTCARE);
// Aktuell eingestellter Font
@@ -1236,7 +1236,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
- FASTBOOL bChanged = sal_True;
+ bool bChanged = true;
const String& rFontName = pNameBox->GetText();
const FontList* pFontList = GetFontList();
String aStyleBoxText =pStyleBox->GetText();
@@ -1253,7 +1253,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
const SvxFontItem& rItem = *( (const SvxFontItem*)pOld );
if ( rItem.GetFamilyName() == aFontItem.GetFamilyName() )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged )
@@ -1262,7 +1262,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
( (SvxFontItem*)pItem )->GetFamilyName() != aFontItem.GetFamilyName() )
- bChanged = sal_True;
+ bChanged = true;
if ( bChanged && rFontName.Len() )
{
@@ -1273,7 +1273,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
rSet.ClearItem( nWhich );
- bChanged = sal_True;
+ bChanged = true;
switch ( eLangGrp )
{
case Western : nSlot = SID_ATTR_CHAR_WEIGHT; break;
@@ -1292,7 +1292,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
const SvxWeightItem& rItem = *( (const SvxWeightItem*)pOld );
if ( rItem.GetValue() == aWeightItem.GetValue() )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged )
@@ -1301,13 +1301,13 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
if ( m_pImpl->m_bInSearchMode && bChanged &&
aInfo.GetWeight() == WEIGHT_NORMAL && aInfo.GetItalic() != ITALIC_NONE )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
( (SvxWeightItem*)pItem )->GetValue() != aWeightItem.GetValue() )
- bChanged = sal_True;
+ bChanged = true;
if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
bChanged = ( nEntryPos == m_pImpl->m_nExtraEntryPos );
@@ -1322,7 +1322,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
switch ( eLangGrp )
{
case Western : nSlot = SID_ATTR_CHAR_POSTURE; break;
@@ -1341,7 +1341,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
const SvxPostureItem& rItem = *( (const SvxPostureItem*)pOld );
if ( rItem.GetValue() == aPostureItem.GetValue() )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged )
@@ -1350,13 +1350,13 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
if ( m_pImpl->m_bInSearchMode && bChanged &&
aInfo.GetItalic() == ITALIC_NONE && aInfo.GetWeight() != WEIGHT_NORMAL )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
( (SvxPostureItem*)pItem )->GetValue() != aPostureItem.GetValue() )
- bChanged = sal_True;
+ bChanged = true;
if ( nEntryPos >= m_pImpl->m_nExtraEntryPos )
bChanged = ( nEntryPos == ( m_pImpl->m_nExtraEntryPos + 1 ) );
@@ -1375,12 +1375,12 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
if ( !pSizeBox->GetText().Len() ) // GetValue() gibt dann Min-Wert zurueck
nSize = 0;
long nSavedSize = pSizeBox->GetSavedValue().ToInt32();
- FASTBOOL bRel = sal_True;
+ bool bRel = true;
if ( !pSizeBox->IsRelative() )
{
nSavedSize *= 10;
- bRel = sal_False;
+ bRel = false;
}
switch ( eLangGrp )
@@ -1399,7 +1399,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
float fSize = (float)nSize / 10;
long nVal = CalcToUnit( fSize, rSet.GetPool()->GetMetric( nWhich ) );
if ( ( (SvxFontHeightItem*)pItem )->GetHeight() != (sal_uInt32)nVal )
- bChanged = sal_True;
+ bChanged = true;
}
if ( bChanged || !pOldHeight ||
@@ -1429,7 +1429,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
switch ( eLangGrp )
{
case Western : nSlot = SID_ATTR_CHAR_LANGUAGE; break;
@@ -1446,7 +1446,7 @@ sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLan
const SvxLanguageItem& rItem = *( (const SvxLanguageItem*)pOld );
if ( nLangPos == LISTBOX_ENTRY_NOTFOUND || eLangType == (LanguageType)rItem.GetValue() )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged )
@@ -1694,9 +1694,9 @@ void SvxCharNamePage::SetPreviewBackgroundToCharacter()
// -----------------------------------------------------------------------
void SvxCharNamePage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pFontListItem,SvxFontListItem,SID_ATTR_CHAR_FONTLIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDisalbeItem,SfxUInt16Item,SID_DISABLE_CTL,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pFontListItem,SvxFontListItem,SID_ATTR_CHAR_FONTLIST );
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE );
+ SFX_ITEMSET_ARG (&aSet,pDisalbeItem,SfxUInt16Item,SID_DISABLE_CTL );
if (pFontListItem)
SetFontList(*pFontListItem);
//CHINA001 SetFontList(pFontListItem->GetFontList());
@@ -1788,7 +1788,7 @@ void SvxCharEffectsPage::Initialize()
SfxObjectShell* pDocSh = SfxObjectShell::Current();
DBG_ASSERT( pDocSh, "DocShell not found!" );
XColorTable* pColorTable = NULL;
- FASTBOOL bKillTable = sal_False;
+ bool bKillTable = false;
if ( pDocSh )
{
@@ -1800,7 +1800,7 @@ void SvxCharEffectsPage::Initialize()
if ( !pColorTable )
{
pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = sal_True;
+ bKillTable = true;
}
m_aUnderlineColorLB.SetUpdateMode( sal_False );
@@ -2020,7 +2020,7 @@ sal_Bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet )
sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
const SvxColorItem* pOld = (const SvxColorItem*)GetOldItem( rSet, SID_ATTR_CHAR_COLOR );
const SvxColorItem* pItem = NULL;
- sal_Bool bChanged = sal_True;
+ bool bChanged = true;
const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL;
const SfxItemSet& rOldSet = GetItemSet();
@@ -2031,7 +2031,7 @@ sal_Bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet )
aSelectedColor = m_aFontColorLB.GetSelectEntryColor();
if ( pOld && pOld->GetValue() == aSelectedColor )
- bChanged = sal_False;
+ bChanged = false;
if ( !bChanged )
bChanged = ( m_aFontColorLB.GetSavedValue() == LISTBOX_ENTRY_NOTFOUND );
@@ -2039,7 +2039,7 @@ sal_Bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet )
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, sal_False, (const SfxPoolItem**)&pItem ) == SFX_ITEM_SET &&
( (SvxColorItem*)pItem )->GetValue() != aSelectedColor )
- bChanged = sal_True;
+ bChanged = true;
sal_Bool bModified = sal_False;
@@ -2615,7 +2615,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
const SfxPoolItem* pOld = 0;
const SfxItemSet& rOldSet = GetItemSet();
sal_Bool bModified = sal_False;
- FASTBOOL bChanged = sal_True;
+ bool bChanged = true;
// Underline
sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_UNDERLINE );
@@ -2636,7 +2636,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
if ( (FontUnderline)rItem.GetValue() == eUnder &&
( UNDERLINE_NONE == eUnder || rItem.GetColor() == m_aUnderlineColorLB.GetSelectEntryColor() ) &&
! bAllowChg )
- bChanged = sal_False;
+ bChanged = false;
}
if ( bChanged )
@@ -2649,7 +2649,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Overline
nWhich = GetWhich( SID_ATTR_CHAR_OVERLINE );
@@ -2670,7 +2670,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
if ( (FontUnderline)rItem.GetValue() == eOver &&
( UNDERLINE_NONE == eOver || rItem.GetColor() == m_aOverlineColorLB.GetSelectEntryColor() ) &&
! bAllowChg )
- bChanged = sal_False;
+ bChanged = false;
}
if ( bChanged )
@@ -2683,7 +2683,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Strikeout
nWhich = GetWhich( SID_ATTR_CHAR_STRIKEOUT );
@@ -2703,7 +2703,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
const SvxCrossedOutItem& rItem = *( (const SvxCrossedOutItem*)pOld );
if ( !m_aStrikeoutLB.IsEnabled()
|| ((FontStrikeout)rItem.GetValue() == eStrike && !bAllowChg) )
- bChanged = sal_False;
+ bChanged = false;
}
if ( bChanged )
@@ -2714,7 +2714,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Individual words
nWhich = GetWhich( SID_ATTR_CHAR_WORDLINEMODE );
@@ -2724,12 +2724,12 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
{
const SvxWordLineModeItem& rItem = *( (const SvxWordLineModeItem*)pOld );
if ( rItem.GetValue() == m_aIndividualWordsBtn.IsChecked() )
- bChanged = sal_False;
+ bChanged = false;
}
if ( rOldSet.GetItemState( nWhich ) == SFX_ITEM_DONTCARE &&
m_aIndividualWordsBtn.IsChecked() == m_aIndividualWordsBtn.GetSavedValue() )
- bChanged = sal_False;
+ bChanged = false;
if ( bChanged )
{
@@ -2739,7 +2739,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Emphasis
nWhich = GetWhich( SID_ATTR_CHAR_EMPHASISMARK );
@@ -2759,13 +2759,13 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
{
const SvxEmphasisMarkItem& rItem = *( (const SvxEmphasisMarkItem*)pOld );
if ( rItem.GetEmphasisMark() == eMark )
- bChanged = sal_False;
+ bChanged = false;
}
}
if ( rOldSet.GetItemState( nWhich ) == SFX_ITEM_DONTCARE &&
m_aEmphasisLB.GetSavedValue() == nMarkPos && m_aPositionLB.GetSavedValue() == nPosPos )
- bChanged = sal_False;
+ bChanged = false;
if ( bChanged )
{
@@ -2775,18 +2775,18 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Effects
nWhich = GetWhich( SID_ATTR_CHAR_CASEMAP );
pOld = GetOldItem( rSet, SID_ATTR_CHAR_CASEMAP );
SvxCaseMap eCaseMap = SVX_CASEMAP_NOT_MAPPED;
- FASTBOOL bChecked = sal_False;
+ bool bChecked = false;
sal_uInt16 nCapsPos = m_aEffects2LB.GetSelectEntryPos();
if ( nCapsPos != LISTBOX_ENTRY_NOTFOUND )
{
eCaseMap = (SvxCaseMap)nCapsPos;
- bChecked = sal_True;
+ bChecked = true;
}
if ( pOld )
@@ -2800,7 +2800,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
const SvxCaseMapItem& rItem = *( (const SvxCaseMapItem*)pOld );
if ( (SvxCaseMap)rItem.GetValue() == eCaseMap && !bAllowChg )
- bChanged = sal_False;
+ bChanged = false;
}
if ( bChanged && bChecked )
@@ -2811,7 +2811,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
//Relief
nWhich = GetWhich(SID_ATTR_CHAR_RELIEF);
@@ -2833,12 +2833,12 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
{
const SvxContourItem& rItem = *( (const SvxContourItem*)pOld );
if ( rItem.GetValue() == StateToAttr( eState ) && m_aOutlineBtn.GetSavedValue() == eState )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
!StateToAttr( eState ) && ( (SvxContourItem*)pItem )->GetValue() )
- bChanged = sal_True;
+ bChanged = true;
if ( bChanged && eState != STATE_DONTKNOW )
{
@@ -2848,7 +2848,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Shadow
nWhich = GetWhich( SID_ATTR_CHAR_SHADOWED );
@@ -2859,12 +2859,12 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
{
const SvxShadowedItem& rItem = *( (const SvxShadowedItem*)pOld );
if ( rItem.GetValue() == StateToAttr( eState ) && m_aShadowBtn.GetSavedValue() == eState )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
!StateToAttr( eState ) && ( (SvxShadowedItem*)pItem )->GetValue() )
- bChanged = sal_True;
+ bChanged = true;
if ( bChanged && eState != STATE_DONTKNOW )
{
@@ -2874,7 +2874,7 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Blinking
nWhich = GetWhich( SID_ATTR_FLASH );
@@ -2885,12 +2885,12 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
{
const SvxBlinkItem& rItem = *( (const SvxBlinkItem*)pOld );
if ( rItem.GetValue() == StateToAttr( eState ) && m_aBlinkingBtn.GetSavedValue() == eState )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
!StateToAttr( eState ) && ( (SvxBlinkItem*)pItem )->GetValue() )
- bChanged = sal_True;
+ bChanged = true;
if ( bChanged && eState != STATE_DONTKNOW )
{
@@ -2904,18 +2904,18 @@ sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet )
nWhich = GetWhich( SID_ATTR_CHAR_HIDDEN );
pOld = GetOldItem( rSet, SID_ATTR_CHAR_HIDDEN );
eState = m_aHiddenBtn.GetState();
- bChanged = sal_True;
+ bChanged = true;
if ( pOld )
{
const SvxCharHiddenItem& rItem = *( (const SvxCharHiddenItem*)pOld );
if ( rItem.GetValue() == StateToAttr( eState ) && m_aHiddenBtn.GetSavedValue() == eState )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET &&
!StateToAttr( eState ) && ( (SvxCharHiddenItem*)pItem )->GetValue() )
- bChanged = sal_True;
+ bChanged = true;
if ( bChanged && eState != STATE_DONTKNOW )
{
@@ -2970,8 +2970,8 @@ void SvxCharEffectsPage::SetPreviewBackgroundToCharacter()
// -----------------------------------------------------------------------
void SvxCharEffectsPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pDisableCtlItem,SfxUInt16Item,SID_DISABLE_CTL,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pDisableCtlItem,SfxUInt16Item,SID_DISABLE_CTL );
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE );
if (pDisableCtlItem)
DisableControls(pDisableCtlItem->GetValue());
@@ -3264,7 +3264,7 @@ IMPL_LINK( SvxCharPositionPage, PairKerningHdl_Impl, CheckBox*, EMPTYARG )
IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, MetricField*, pField )
{
#ifdef DBG_UTIL
- sal_Bool bHigh = m_aHighPosBtn.IsChecked();
+ bool bHigh = m_aHighPosBtn.IsChecked();
#endif
sal_Bool bLow = m_aLowPosBtn.IsChecked();
DBG_ASSERT( bHigh || bLow, "normal position is not valid" );
@@ -3595,10 +3595,11 @@ sal_Bool SvxCharPositionPage::FillItemSet( SfxItemSet& rSet )
{
// Position (hoch, normal oder tief)
const SfxItemSet& rOldSet = GetItemSet();
- sal_Bool bModified = sal_False, bChanged = sal_True;
+ sal_Bool bModified = sal_False;
+ bool bChanged = true;
sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_ESCAPEMENT );
const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_CHAR_ESCAPEMENT );
- const FASTBOOL bHigh = m_aHighPosBtn.IsChecked();
+ const bool bHigh = m_aHighPosBtn.IsChecked();
short nEsc;
sal_uInt8 nEscProp;
@@ -3623,12 +3624,12 @@ sal_Bool SvxCharPositionPage::FillItemSet( SfxItemSet& rSet )
{
const SvxEscapementItem& rItem = *( (const SvxEscapementItem*)pOld );
if ( rItem.GetEsc() == nEsc && rItem.GetProp() == nEscProp )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged && !m_aHighPosBtn.GetSavedValue() &&
!m_aNormalPosBtn.GetSavedValue() && !m_aLowPosBtn.GetSavedValue() )
- bChanged = sal_True;
+ bChanged = true;
if ( bChanged &&
( m_aHighPosBtn.IsChecked() || m_aNormalPosBtn.IsChecked() || m_aLowPosBtn.IsChecked() ) )
@@ -3639,7 +3640,7 @@ sal_Bool SvxCharPositionPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Kerning
nWhich = GetWhich( SID_ATTR_CHAR_KERNING );
@@ -3662,13 +3663,13 @@ sal_Bool SvxCharPositionPage::FillItemSet( SfxItemSet& rSet )
{
const SvxKerningItem& rItem = *( (const SvxKerningItem*)pOld );
if ( rItem.GetValue() == nKerning )
- bChanged = sal_False;
+ bChanged = false;
}
if ( !bChanged &&
( m_aKerningLB.GetSavedValue() == LISTBOX_ENTRY_NOTFOUND ||
( !m_aKerningEdit.GetSavedValue().Len() && m_aKerningEdit.IsEnabled() ) ) )
- bChanged = sal_True;
+ bChanged = true;
if ( bChanged && nPos != LISTBOX_ENTRY_NOTFOUND )
{
@@ -3678,7 +3679,7 @@ sal_Bool SvxCharPositionPage::FillItemSet( SfxItemSet& rSet )
else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) )
CLEARTITEM;
- bChanged = sal_True;
+ bChanged = true;
// Pair-Kerning
nWhich = GetWhich( SID_ATTR_CHAR_AUTOKERN );
@@ -3746,7 +3747,7 @@ void SvxCharPositionPage::SetPreviewBackgroundToCharacter()
// -----------------------------------------------------------------------
void SvxCharPositionPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE );
if (pFlagItem)
{
sal_uInt32 nFlags=pFlagItem->GetValue();
@@ -3839,7 +3840,7 @@ void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, sal_Bool bStart )
pBox->SelectEntryPos(0);
else
{
- FASTBOOL bFound = sal_False;
+ bool bFound = sal_False;
for ( sal_uInt16 i = 1; i < pBox->GetEntryCount(); ++i )
{
if ( (sal_uLong)pBox->GetEntryData(i) != CHRDLG_ENCLOSE_SPECIAL_CHAR )
@@ -3871,7 +3872,7 @@ void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, sal_Bool bStart )
IMPL_LINK( SvxCharTwoLinesPage, TwoLinesHdl_Impl, CheckBox*, EMPTYARG )
{
- sal_Bool bChecked = m_aTwoLinesBtn.IsChecked();
+ bool bChecked = m_aTwoLinesBtn.IsChecked();
m_aStartBracketFT.Enable( bChecked );
m_aStartBracketLB.Enable( bChecked );
m_aEndBracketFT.Enable( bChecked );
@@ -3959,7 +3960,8 @@ void SvxCharTwoLinesPage::Reset( const SfxItemSet& rSet )
sal_Bool SvxCharTwoLinesPage::FillItemSet( SfxItemSet& rSet )
{
const SfxItemSet& rOldSet = GetItemSet();
- sal_Bool bModified = sal_False, bChanged = sal_True;
+ sal_Bool bModified = sal_False;
+ bool bChanged = true;
sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_TWO_LINES );
const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_CHAR_TWO_LINES );
sal_Bool bOn = m_aTwoLinesBtn.IsChecked();
@@ -3973,7 +3975,7 @@ sal_Bool SvxCharTwoLinesPage::FillItemSet( SfxItemSet& rSet )
const SvxTwoLinesItem& rItem = *( (const SvxTwoLinesItem*)pOld );
if ( rItem.GetValue() == bOn &&
( !bOn || ( rItem.GetStartBracket() == cStart && rItem.GetEndBracket() == cEnd ) ) )
- bChanged = sal_False;
+ bChanged = false;
}
if ( bChanged )
@@ -4008,7 +4010,7 @@ void SvxCharTwoLinesPage::SetPreviewBackgroundToCharacter()
// -----------------------------------------------------------------------
void SvxCharTwoLinesPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE );
if (pFlagItem)
{
sal_uInt32 nFlags=pFlagItem->GetValue();
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index cfbf335af732..0967912a8146 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -280,13 +280,13 @@ void __EXPORT SvxConnectionPage::Reset( const SfxItemSet& rAttrs )
aMtrFldLine3.SaveValue();
- // SdrEdgeLineDeltaAnzItem
+ // EdgeLineDeltaAnz
pItem = GetItem( rAttrs, SDRATTR_EDGELINEDELTAANZ );
if( !pItem )
pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINEDELTAANZ );
if( pItem )
{
- sal_uInt16 nValue = ( ( const SdrEdgeLineDeltaAnzItem* )pItem )->GetValue();
+ sal_uInt16 nValue = ( ( const SfxUInt16Item* )pItem )->GetValue();
if( nValue <= 2 )
{
aFtLine3.Enable( sal_False );
@@ -554,7 +554,7 @@ void SvxConnectionPage::FillTypeLB()
}
void SvxConnectionPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG(&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST,sal_False);
+ SFX_ITEMSET_ARG(&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST );
if (pOfaPtrItem)
SetView( static_cast<SdrView *>(pOfaPtrItem->GetValue()) );
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 0733f98a2ae8..ce68d2104249 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -382,7 +382,7 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
CalcMinMaxBorder();
}
else
- GraphicHasChanged( sal_False );
+ GraphicHasChanged( false );
}
CalcZoom();
@@ -649,7 +649,7 @@ void SvxGrfCropPage::CalcMinMaxBorder()
FixedText mit der Originalgroesse fuellen
--------------------------------------------------------------------*/
-void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound )
+void SvxGrfCropPage::GraphicHasChanged( bool bFound )
{
if( bFound )
{
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 1ef00b3c6db1..66cf11300299 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -40,6 +40,7 @@
#include "labdlg.hrc"
#include "labdlg.hxx"
+#include <svx/sdangitm.hxx>
// define ----------------------------------------------------------------
@@ -182,7 +183,7 @@ sal_Bool SvxCaptionTabPage::FillItemSet( SfxItemSet& _rOutAttrs)
if( aMF_ABSTAND.IsValueModified() )
{
eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONGAP ) );
- _rOutAttrs.Put( SdrCaptionGapItem( GetCoreValue(aMF_ABSTAND, eUnit ) ) );
+ _rOutAttrs.Put( SdrMetricItem(SDRATTR_CAPTIONGAP, GetCoreValue(aMF_ABSTAND, eUnit ) ) );
}
// Sonderbehandlung!!! XXX
@@ -198,7 +199,7 @@ sal_Bool SvxCaptionTabPage::FillItemSet( SfxItemSet& _rOutAttrs)
_rOutAttrs.Put( SdrCaptionEscDirItem( (SdrCaptionEscDir)nEscDir ) );
bEscRel = aLB_ANSATZ_REL.IsVisible();
- _rOutAttrs.Put( SdrCaptionEscIsRelItem( bEscRel ) );
+ _rOutAttrs.Put( SdrYesNoItem(SDRATTR_CAPTIONESCISREL, bEscRel ) );
if( bEscRel )
{
@@ -210,26 +211,26 @@ sal_Bool SvxCaptionTabPage::FillItemSet( SfxItemSet& _rOutAttrs)
case AT_MITTE: nVal=5000;break;
case AT_UNTEN: nVal=10000;break;
}
- _rOutAttrs.Put( SdrCaptionEscRelItem( nVal ) );
+ _rOutAttrs.Put( SfxInt32Item(SDRATTR_CAPTIONESCREL, nVal ) );
}
else
{
if( aMF_ANSATZ.IsValueModified() )
{
eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONESCABS ) );
- _rOutAttrs.Put( SdrCaptionEscAbsItem( GetCoreValue(aMF_ANSATZ, eUnit ) ) );
+ _rOutAttrs.Put( SdrMetricItem(SDRATTR_CAPTIONESCABS, GetCoreValue(aMF_ANSATZ, eUnit ) ) );
}
}
bFitLineLen = aCB_LAENGE.IsChecked();
- _rOutAttrs.Put( SdrCaptionFitLineLenItem( bFitLineLen ) );
+ _rOutAttrs.Put( SdrYesNoItem( bFitLineLen ) );
if( ! bFitLineLen )
{
if( aMF_LAENGE.IsValueModified() )
{
eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONLINELEN ) );
- _rOutAttrs.Put( SdrCaptionLineLenItem( GetCoreValue(aMF_LAENGE, eUnit ) ) );
+ _rOutAttrs.Put( SdrMetricItem(SDRATTR_CAPTIONLINELEN, GetCoreValue(aMF_LAENGE, eUnit ) ) );
}
}
@@ -268,30 +269,30 @@ void SvxCaptionTabPage::Reset( const SfxItemSet& )
//------- Winkel ----------
nWhich = GetWhich( SDRATTR_CAPTIONANGLE );
- nFixedAngle = ( ( const SdrCaptionAngleItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nFixedAngle = ( ( const SdrAngleItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
//------- absolute Ansatzentfernung ----------
nWhich = GetWhich( SDRATTR_CAPTIONESCABS );
eUnit = pPool->GetMetric( nWhich );
- nEscAbs = ( ( const SdrCaptionEscAbsItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nEscAbs = ( ( const SdrMetricItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( aMF_ANSATZ, nEscAbs, eUnit );
nEscAbs = static_cast<long>(aMF_ANSATZ.GetValue());
//------- relative Ansatzentfernung ----------
nWhich = GetWhich( SDRATTR_CAPTIONESCREL );
- nEscRel = (long)( ( const SdrCaptionEscRelItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nEscRel = (long)( ( const SfxInt32Item& ) rOutAttrs.Get( nWhich ) ).GetValue();
//------- Linienlaenge ----------
nWhich = GetWhich( SDRATTR_CAPTIONLINELEN );
eUnit = pPool->GetMetric( nWhich );
- nLineLen = ( ( const SdrCaptionLineLenItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nLineLen = ( ( const SdrMetricItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( aMF_LAENGE, nLineLen, eUnit );
nLineLen = static_cast<long>(aMF_LAENGE.GetValue());
//------- Abstand zur Box ----------
nWhich = GetWhich( SDRATTR_CAPTIONGAP );
eUnit = pPool->GetMetric( nWhich );
- nGap = ( ( const SdrCaptionGapItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
+ nGap = ( ( const SdrMetricItem& ) rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( aMF_ABSTAND, nGap, eUnit );
nGap = static_cast<long>(aMF_ABSTAND.GetValue());
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 541269aebe3a..f81f0b214808 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -194,12 +194,12 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_MEASURELINEDIST );
- // SdrMeasureLineDistItem
+ // MeasureLineDist
if( pItem == NULL )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASURELINEDIST );
if( pItem )
{
- long nValue = ( ( const SdrMeasureLineDistItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldLineDist, nValue, eUnit );
}
else
@@ -208,13 +208,13 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aMtrFldLineDist.SaveValue();
- // SdrMeasureHelplineOverhangItem
+ // MeasureHelplineOverhang
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEOVERHANG );
if( pItem == NULL )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEOVERHANG );
if( pItem )
{
- long nValue = ( ( const SdrMeasureHelplineOverhangItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelplineOverhang, nValue, eUnit );
}
else
@@ -223,13 +223,13 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aMtrFldHelplineOverhang.SaveValue();
- // SdrMeasureHelplineDistItem
+ // MeasureHelplineDist
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEDIST );
if( pItem == NULL )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEDIST );
if( pItem )
{
- long nValue = ( ( const SdrMeasureHelplineDistItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelplineDist, nValue, eUnit );
}
else
@@ -238,13 +238,13 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aMtrFldHelplineDist.SaveValue();
- // SdrMeasureHelpline1LenItem
+ // MeasureHelpline1Len
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE1LEN );
if( pItem == NULL )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE1LEN );
if( pItem )
{
- long nValue = ( ( const SdrMeasureHelpline1LenItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelpline1Len, nValue, eUnit );
}
else
@@ -253,13 +253,13 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aMtrFldHelpline1Len.SaveValue();
- // SdrMeasureHelpline2LenItem
+ // MeasureHelpline2Len
pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE2LEN );
if( pItem == NULL )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE2LEN );
if( pItem )
{
- long nValue = ( ( const SdrMeasureHelpline2LenItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldHelpline2Len, nValue, eUnit );
}
else
@@ -268,10 +268,10 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aMtrFldHelpline2Len.SaveValue();
- // SdrMeasureBelowRefEdgeItem
+ // MeasureBelowRefEdge
if( rAttrs.GetItemState( SDRATTR_MEASUREBELOWREFEDGE ) != SFX_ITEM_DONTCARE )
{
- aTsbBelowRefEdge.SetState( ( ( const SdrMeasureBelowRefEdgeItem& )rAttrs.Get( SDRATTR_MEASUREBELOWREFEDGE ) ).
+ aTsbBelowRefEdge.SetState( ( ( const SdrYesNoItem& )rAttrs.Get( SDRATTR_MEASUREBELOWREFEDGE ) ).
GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbBelowRefEdge.EnableTriState( sal_False );
}
@@ -281,13 +281,13 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aTsbBelowRefEdge.SaveValue();
- // SdrMeasureDecimalPlacesItem
+ // MeasureDecimalPlaces
pItem = GetItem( rAttrs, SDRATTR_MEASUREDECIMALPLACES );
if( pItem == NULL )
pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREDECIMALPLACES );
if( pItem )
{
- sal_Int16 nValue = ( ( const SdrMeasureDecimalPlacesItem* )pItem )->GetValue();
+ sal_Int16 nValue = ( ( const SfxInt16Item* )pItem )->GetValue();
aMtrFldDecimalPlaces.SetValue( nValue );
}
else
@@ -296,11 +296,11 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aMtrFldDecimalPlaces.SaveValue();
- // SdrMeasureTextRota90Item
+ // MeasureTextRota90
// Attention: negate !
if( rAttrs.GetItemState( SDRATTR_MEASURETEXTROTA90 ) != SFX_ITEM_DONTCARE )
{
- aTsbParallel.SetState( ( ( const SdrMeasureTextRota90Item& )rAttrs.Get( SDRATTR_MEASURETEXTROTA90 ) ).
+ aTsbParallel.SetState( ( ( const SdrYesNoItem& )rAttrs.Get( SDRATTR_MEASURETEXTROTA90 ) ).
GetValue() ? STATE_NOCHECK : STATE_CHECK );
aTsbParallel.EnableTriState( sal_False );
}
@@ -310,10 +310,10 @@ void __EXPORT SvxMeasurePage::Reset( const SfxItemSet& rAttrs )
}
aTsbParallel.SaveValue();
- // SdrMeasureShowUnitItem
+ // MeasureShowUnit
if( rAttrs.GetItemState( SDRATTR_MEASURESHOWUNIT ) != SFX_ITEM_DONTCARE )
{
- aTsbShowUnit.SetState( ( ( const SdrMeasureShowUnitItem& )rAttrs.Get( SDRATTR_MEASURESHOWUNIT ) ).
+ aTsbShowUnit.SetState( ( ( const SdrYesNoItem& )rAttrs.Get( SDRATTR_MEASURESHOWUNIT ) ).
GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbShowUnit.EnableTriState( sal_False );
}
@@ -449,65 +449,63 @@ sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs)
if( aMtrFldLineDist.GetText() != aMtrFldLineDist.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldLineDist, eUnit );
- rAttrs.Put( SdrMeasureLineDistItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_MEASURELINEDIST, nValue ) );
bModified = sal_True;
}
if( aMtrFldHelplineOverhang.GetText() != aMtrFldHelplineOverhang.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit );
- rAttrs.Put( SdrMeasureHelplineOverhangItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG, nValue ) );
bModified = sal_True;
}
if( aMtrFldHelplineDist.GetText() != aMtrFldHelplineDist.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldHelplineDist, eUnit );
- rAttrs.Put( SdrMeasureHelplineDistItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST, nValue ) );
bModified = sal_True;
}
if( aMtrFldHelpline1Len.GetText() != aMtrFldHelpline1Len.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit );
- rAttrs.Put( SdrMeasureHelpline1LenItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN, nValue ) );
bModified = sal_True;
}
if( aMtrFldHelpline2Len.GetText() != aMtrFldHelpline2Len.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit );
- rAttrs.Put( SdrMeasureHelpline2LenItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN, nValue ) );
bModified = sal_True;
}
eState = aTsbBelowRefEdge.GetState();
if( eState != aTsbBelowRefEdge.GetSavedValue() )
{
- rAttrs.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE, (sal_Bool) STATE_CHECK == eState ) );
bModified = sal_True;
}
if( aMtrFldDecimalPlaces.GetText() != aMtrFldDecimalPlaces.GetSavedValue() )
{
nValue = static_cast<sal_Int32>(aMtrFldDecimalPlaces.GetValue());
- rAttrs.Put(
- SdrMeasureDecimalPlacesItem(
- sal::static_int_cast< sal_Int16 >( nValue ) ) );
+ rAttrs.Put( SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES, sal::static_int_cast< sal_Int16 >( nValue ) ) );
bModified = sal_True;
}
eState = aTsbParallel.GetState();
if( eState != aTsbParallel.GetSavedValue() )
{
- rAttrs.Put( SdrMeasureTextRota90Item( (sal_Bool) STATE_NOCHECK == eState ) );
+ rAttrs.Put( SdrYesNoItem(SDRATTR_MEASURETEXTROTA90, (sal_Bool) STATE_NOCHECK == eState ) );
bModified = sal_True;
}
eState = aTsbShowUnit.GetState();
if( eState != aTsbShowUnit.GetSavedValue() )
{
- rAttrs.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, (sal_Bool) STATE_CHECK == eState ) );
bModified = sal_True;
}
@@ -608,7 +606,7 @@ void SvxMeasurePage::Construct()
{
DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
- aCtlPreview.pMeasureObj->SetModel( pView->GetModel() );
+ // aCtlPreview.pMeasureObj->SetModel( pView->GetModel() );
aCtlPreview.Invalidate();
}
@@ -713,59 +711,59 @@ IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p )
if( p == &aMtrFldLineDist )
{
sal_Int32 nValue = GetCoreValue( aMtrFldLineDist, eUnit );
- aAttrSet.Put( SdrMeasureLineDistItem( nValue ) );
+ aAttrSet.Put( SdrMetricItem(SDRATTR_MEASURELINEDIST, nValue ) );
}
if( p == &aMtrFldHelplineOverhang )
{
sal_Int32 nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit );
- aAttrSet.Put( SdrMeasureHelplineOverhangItem( nValue) );
+ aAttrSet.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG, nValue) );
}
if( p == &aMtrFldHelplineDist )
{
sal_Int32 nValue = GetCoreValue( aMtrFldHelplineDist, eUnit );
- aAttrSet.Put( SdrMeasureHelplineDistItem( nValue) );
+ aAttrSet.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST, nValue) );
}
if( p == &aMtrFldHelpline1Len )
{
sal_Int32 nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit );
- aAttrSet.Put( SdrMeasureHelpline1LenItem( nValue ) );
+ aAttrSet.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN, nValue ) );
}
if( p == &aMtrFldHelpline2Len )
{
sal_Int32 nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit );
- aAttrSet.Put( SdrMeasureHelpline2LenItem( nValue ) );
+ aAttrSet.Put( SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN, nValue ) );
}
if( p == &aTsbBelowRefEdge )
{
TriState eState = aTsbBelowRefEdge.GetState();
if( eState != STATE_DONTKNOW )
- aAttrSet.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) );
+ aAttrSet.Put( SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE, (sal_Bool) STATE_CHECK == eState ) );
}
if( p == &aMtrFldDecimalPlaces )
{
sal_Int16 nValue = sal::static_int_cast< sal_Int16 >(
aMtrFldDecimalPlaces.GetValue() );
- aAttrSet.Put( SdrMeasureDecimalPlacesItem( nValue ) );
+ aAttrSet.Put( SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES, nValue ) );
}
if( p == &aTsbParallel )
{
TriState eState = aTsbParallel.GetState();
if( eState != STATE_DONTKNOW )
- aAttrSet.Put( SdrMeasureTextRota90Item( (sal_Bool) !STATE_CHECK == eState ) );
+ aAttrSet.Put( SdrYesNoItem(SDRATTR_MEASURETEXTROTA90, (sal_Bool) !STATE_CHECK == eState ) );
}
if( p == &aTsbShowUnit )
{
TriState eState = aTsbShowUnit.GetState();
if( eState != STATE_DONTKNOW )
- aAttrSet.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) );
+ aAttrSet.Put( SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, (sal_Bool) STATE_CHECK == eState ) );
}
if( p == &aLbUnit )
@@ -864,7 +862,7 @@ void SvxMeasurePage::FillUnitLB()
}
void SvxMeasurePage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST );
if (pOfaPtrItem)
SetView( static_cast<SdrView *>(pOfaPtrItem->GetValue()));
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 5489fcaa75c7..ef105f289912 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -1944,8 +1944,8 @@ void SvxNumberFormatTabPage::AddAutomaticLanguage_Impl(LanguageType eAutoLang, s
void SvxNumberFormatTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pNumberInfoItem,SvxNumberInfoItem,SID_ATTR_NUMBERFORMAT_INFO,sal_False);
- SFX_ITEMSET_ARG (&aSet,pLinkItem,SfxLinkItem,SID_LINK_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pNumberInfoItem,SvxNumberInfoItem,SID_ATTR_NUMBERFORMAT_INFO );
+ SFX_ITEMSET_ARG (&aSet,pLinkItem,SfxLinkItem,SID_LINK_TYPE );
if (pNumberInfoItem)
SetNumberFormatList(*pNumberInfoItem);
if (pLinkItem)
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 9e9219c24acd..ba81428b19b4 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -641,7 +641,7 @@ IMPL_LINK(SvxBulletPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG)
void SvxBulletPickTabPage::PageCreated(SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT );
if (pBulletCharFmt)
SetCharFmtName( pBulletCharFmt->GetValue());
@@ -934,8 +934,8 @@ IMPL_LINK(SvxNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG)
//add CHINA001 begin
void SvxNumPickTabPage::PageCreated(SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT,sal_False);
- SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT );
+ SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT );
if (pNumCharFmt &&pBulletCharFmt)
@@ -1610,7 +1610,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
SfxObjectShell* pDocSh = SfxObjectShell::Current();
DBG_ASSERT( pDocSh, "DocShell not found!" );
XColorTable* pColorTable = NULL;
- FASTBOOL bKillTable = sal_False;
+ bool bKillTable = false;
if ( pDocSh )
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
@@ -1621,7 +1621,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
if ( !pColorTable )
{
pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = sal_True;
+ bKillTable = true;
}
aBulColLB.InsertEntry( Color( COL_AUTO ), SVX_RESSTR( RID_SVXSTR_AUTOMATIC ));
@@ -4037,10 +4037,10 @@ void SvxNumOptionsTabPage::SetModified(sal_Bool bRepaint)
//Add CHINA001
void SvxNumOptionsTabPage::PageCreated(SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_CHAR_FMT_LIST_BOX,sal_False);
- SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT,sal_False);
- SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
- SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_CHAR_FMT_LIST_BOX );
+ SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT );
+ SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT );
+ SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM );
if (pNumCharFmt &&pBulletCharFmt)
SetCharFmts( pNumCharFmt->GetValue(),pBulletCharFmt->GetValue());
@@ -4066,7 +4066,7 @@ void SvxNumOptionsTabPage::PageCreated(SfxAllItemSet aSet)
void SvxNumPositionTabPage::PageCreated(SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM );
if (pMetricItem)
SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue()));
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index c5c349505e81..8e46557a89e9 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -293,7 +293,7 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
pImpl ( new SvxPage_Impl )
{
- bBorderModified = sal_False;
+ bBorderModified = false;
FreeResource();
aBspWin.EnableRTL( sal_False );
@@ -560,12 +560,12 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet )
if ( pItem )
aPaperSize = ( (const SvxSizeItem*)pItem )->GetSize();
- FASTBOOL bOrientationSupport =
+ bool bOrientationSupport =
pImpl->mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION );
#ifdef OS2
// unter OS/2 wird bei HasSupport() immer sal_True returned
// aber nur als Dummy, deshalb FALSE
- bOrientationSupport = sal_False;
+ bOrientationSupport = false;
#endif
if ( !bOrientationSupport &&
@@ -676,8 +676,8 @@ void SvxPageDescPage::Reset( const SfxItemSet& rSet )
InitHeadFoot_Impl( rSet );
// R"ander auf Hoch/Quer updaten, dann Beispiel updaten
- bBorderModified = sal_False;
- SwapFirstValues_Impl( sal_False );
+ bBorderModified = false;
+ SwapFirstValues_Impl( false );
UpdateExample_Impl();
// Alte Werte sichern
@@ -1156,7 +1156,7 @@ IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, RadioButton *, pBtn )
// -----------------------------------------------------------------------
-void SvxPageDescPage::SwapFirstValues_Impl( FASTBOOL bSet )
+void SvxPageDescPage::SwapFirstValues_Impl( bool bSet )
{
MapMode aOldMode = pImpl->mpDefPrinter->GetMapMode();
Orientation eOri = ORIENTATION_PORTRAIT;
@@ -1229,7 +1229,7 @@ void SvxPageDescPage::SwapFirstValues_Impl( FASTBOOL bSet )
IMPL_LINK_INLINE_START( SvxPageDescPage, BorderModify_Impl, MetricField *, EMPTYARG )
{
if ( !bBorderModified )
- bBorderModified = sal_True;
+ bBorderModified = true;
UpdateExample_Impl();
return 0;
}
@@ -1760,10 +1760,10 @@ bool SvxPageDescPage::IsMarginOutOfRange()
void SvxPageDescPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pModeItem,SfxAllEnumItem,SID_ENUM_PAGE_MODE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPaperStartItem,SfxAllEnumItem,SID_PAPER_START,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPaperEndItem,SfxAllEnumItem,SID_PAPER_END,sal_False);
- SFX_ITEMSET_ARG (&aSet,pCollectListItem,SfxStringListItem,SID_COLLECT_LIST,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pModeItem,SfxAllEnumItem,SID_ENUM_PAGE_MODE );
+ SFX_ITEMSET_ARG (&aSet,pPaperStartItem,SfxAllEnumItem,SID_PAPER_START );
+ SFX_ITEMSET_ARG (&aSet,pPaperEndItem,SfxAllEnumItem,SID_PAPER_END );
+ SFX_ITEMSET_ARG (&aSet,pCollectListItem,SfxStringListItem,SID_COLLECT_LIST );
if (pModeItem)
SetMode((SvxModeType)pModeItem->GetEnumValue());
if (pPaperStartItem && pPaperEndItem)
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 127760c3243f..91611705e47c 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -323,7 +323,7 @@ sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
bModified |= sal_True;
}
}
- FASTBOOL bNullTab = sal_False;
+ bool bNullTab = false;
if ( aLeftIndent.IsValueModified() ||
aFLineIndent.IsValueModified() ||
@@ -370,7 +370,7 @@ sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
}
aMargin.SetAutoFirst(aAutoCB.IsChecked());
if ( aMargin.GetTxtFirstLineOfst() < 0 )
- bNullTab = sal_True;
+ bNullTab = true;
eState = GetItemSet().GetItemState( nWhich );
if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) ||
@@ -987,9 +987,9 @@ void SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet)
*/
- SFX_ITEMSET_ARG (&aSet,pPageWidthItem,SfxUInt16Item,SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,sal_False);
- SFX_ITEMSET_ARG (&aSet,pFlagSetItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,sal_False);
- SFX_ITEMSET_ARG (&aSet,pLineDistItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pPageWidthItem,SfxUInt16Item,SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH );
+ SFX_ITEMSET_ARG (&aSet,pFlagSetItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET );
+ SFX_ITEMSET_ARG (&aSet,pLineDistItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST );
if (pPageWidthItem)
SetPageWidth(pPageWidthItem->GetValue());
@@ -1139,26 +1139,27 @@ sal_Bool SvxParaAlignTabPage::FillItemSet( SfxItemSet& rOutSet )
{
sal_Bool bModified = sal_False;
- FASTBOOL bAdj = sal_False, bChecked = sal_False;
+ bool bAdj = false;
+ bool bChecked = false;
SvxAdjust eAdjust = SVX_ADJUST_LEFT;
if ( aLeft.IsChecked() )
{
eAdjust = SVX_ADJUST_LEFT;
bAdj = !aLeft.GetSavedValue();
- bChecked = sal_True;
+ bChecked = true;
}
else if ( aRight.IsChecked() )
{
eAdjust = SVX_ADJUST_RIGHT;
bAdj = !aRight.GetSavedValue();
- bChecked = sal_True;
+ bChecked = true;
}
else if ( aCenter.IsChecked() )
{
eAdjust = SVX_ADJUST_CENTER;
bAdj = !aCenter.GetSavedValue();
- bChecked = sal_True;
+ bChecked = true;
}
else if ( aJustify.IsChecked() )
{
@@ -1166,7 +1167,7 @@ sal_Bool SvxParaAlignTabPage::FillItemSet( SfxItemSet& rOutSet )
bAdj = !aJustify.GetSavedValue() ||
aExpandCB.IsChecked() != aExpandCB.GetSavedValue() ||
aLastLineLB.GetSelectEntryPos() != aLastLineLB.GetSavedValue();
- bChecked = sal_True;
+ bChecked = true;
}
sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
@@ -1184,7 +1185,7 @@ sal_Bool SvxParaAlignTabPage::FillItemSet( SfxItemSet& rOutSet )
else if ( 2 == nLBPos )
eLastBlock = SVX_ADJUST_BLOCK;
- FASTBOOL bNothingWasChecked =
+ bool bNothingWasChecked =
!aLeft.GetSavedValue() && !aRight.GetSavedValue() &&
!aCenter.GetSavedValue() && !aJustify.GetSavedValue();
@@ -1405,7 +1406,7 @@ void SvxParaAlignTabPage::EnableJustifyExt()
//add CHINA001 begin
void SvxParaAlignTabPage::PageCreated (SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pBoolItem,SfxBoolItem,SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pBoolItem,SfxBoolItem,SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT );
if (pBoolItem)
if(pBoolItem->GetValue())
EnableJustifyExt();
@@ -1470,7 +1471,7 @@ sal_Bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
// Seitenumbruch
TriState eState = aApplyCollBtn.GetState();
- FASTBOOL bIsPageModel = sal_False;
+ bool bIsPageModel = false;
_nWhich = GetWhich( SID_ATTR_PARA_MODEL );
String sPage;
@@ -1491,10 +1492,10 @@ sal_Bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
bModified |= sal_True;
}
else
- bIsPageModel = sal_False;
+ bIsPageModel = false;
}
else if(STATE_CHECK == eState && aApplyCollBtn.IsEnabled())
- bIsPageModel = sal_True;
+ bIsPageModel = true;
else
rOutSet.Put( SvxPageModelItem( sPage, sal_False, _nWhich ) );
@@ -1673,7 +1674,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet )
{
// zuerst PageModel behandeln
_nWhich = GetWhich( SID_ATTR_PARA_MODEL );
- sal_Bool bIsPageModel = sal_False;
+ bool bIsPageModel = false;
eItemState = rSet.GetItemState( _nWhich );
if ( eItemState >= SFX_ITEM_SET )
@@ -1689,7 +1690,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet )
{
aApplyCollBox.SelectEntry( aStr );
aApplyCollBtn.SetState( STATE_CHECK );
- bIsPageModel = sal_True;
+ bIsPageModel = true;
aPageBreakBox.Enable();
aPageBreakBox.EnableTriState( sal_False );
@@ -2237,15 +2238,11 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox )
//Add CHINA001 begin
void SvxExtParagraphTabPage::PageCreated(SfxAllItemSet aSet)
{
-
-
- SFX_ITEMSET_ARG (&aSet,pDisablePageBreakItem,SfxBoolItem,SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pDisablePageBreakItem,SfxBoolItem,SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK );
if (pDisablePageBreakItem)
if ( pDisablePageBreakItem->GetValue())
DisablePageBreak();
-
-
}
//end of Add CHINA001
/*-- 29.11.00 11:36:24---------------------------------------------------
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 328f88c6b25f..709cc67acce1 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <svx/dialogs.hrc>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star::text;
#define SwFPos SvxSwFramePosString
@@ -713,11 +714,15 @@ sal_Bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet& rSet)
static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP)));
// Altes Rechteck mit CoreUnit
- m_aRect = m_pSdrView->GetAllMarkedRect();
- m_pSdrView->GetSdrPageView()->LogicToPagePos( m_aRect );
+ m_aRange = m_pSdrView->getMarkedObjectSnapRange();
- nHoriByPos += m_aAnchorPos.X();
- nVertByPos += m_aAnchorPos.Y();
+ if(m_pSdrView->GetSdrPageView())
+ {
+ m_aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-m_pSdrView->GetSdrPageView()->GetPageOrigin()));
+ }
+
+ nHoriByPos += m_aAnchorPos.getX();
+ nVertByPos += m_aAnchorPos.getY();
rSet.Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_X ), nHoriByPos ) );
rSet.Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_Y ), nVertByPos ) );
@@ -1583,7 +1588,7 @@ void SvxSwPosSizeTabPage::InitPos(short nAnchor,
}
else if(m_bIsMultiSelection)
{
- m_aHoriByMF.SetValue( m_aHoriByMF.Normalize(m_aRect.Left()), FUNIT_TWIP );
+ m_aHoriByMF.SetValue( m_aHoriByMF.Normalize(basegfx::fround(m_aRange.getMinX())), FUNIT_TWIP );
}
else
{
@@ -1602,7 +1607,7 @@ void SvxSwPosSizeTabPage::InitPos(short nAnchor,
}
else if(m_bIsMultiSelection)
{
- m_aVertByMF.SetValue( m_aVertByMF.Normalize(m_aRect.Top()), FUNIT_TWIP );
+ m_aVertByMF.SetValue( m_aVertByMF.Normalize(basegfx::fround(m_aRange.getMinY())), FUNIT_TWIP );
}
else
{
@@ -1871,25 +1876,32 @@ void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView )
}
// Setzen des Rechtecks und der Workingarea
- m_aRect = m_pSdrView->GetAllMarkedRect();
- m_pSdrView->GetSdrPageView()->LogicToPagePos( m_aRect );
+ m_aRange = m_pSdrView->getMarkedObjectSnapRange();
+
+ if(m_pSdrView->GetSdrPageView())
+ {
+ m_aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-m_pSdrView->GetSdrPageView()->GetPageOrigin()));
+ }
// get WorkArea
m_aWorkArea = m_pSdrView->GetWorkArea();
// Beruecksichtigung Ankerposition (bei Writer)
- const SdrMarkList& rMarkList = m_pSdrView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() >= 1 )
+ const SdrObjectVector aSelection(m_pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSelection.size())
{
- const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ const SdrObject* pObj = aSelection[0];
m_aAnchorPos = pObj->GetAnchorPos();
- if( m_aAnchorPos != Point(0,0) ) // -> Writer
+ if( !m_aAnchorPos.equalZero() ) // -> Writer
{
- for( sal_uInt16 i = 1; i < rMarkList.GetMarkCount(); i++ )
+ for(sal_uInt32 i(1); i < aSelection.size(); i++ )
{
- pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- if( m_aAnchorPos != pObj->GetAnchorPos() )
+ const SdrObject* pCandidate = aSelection[i];
+ const basegfx::B2DPoint aObjectAnchor(pCandidate->GetAnchorPos());
+
+ if( !m_aAnchorPos.equal(aObjectAnchor) )
{
// different anchor positions -> disable positioning
m_aPositionFL.Enable(sal_False);
@@ -1915,21 +1927,19 @@ void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView )
}
}
}
- Point aPt = m_aAnchorPos * -1;
- Point aPt2 = aPt;
- aPt += m_aWorkArea.TopLeft();
- m_aWorkArea.SetPos( aPt );
+ const basegfx::B2DHomMatrix aTranslate(basegfx::tools::createTranslateB2DHomMatrix(-m_aAnchorPos));
- aPt2 += m_aRect.TopLeft();
- m_aRect.SetPos( aPt2 );
+ m_aWorkArea.transform(aTranslate);
+ m_aRange.transform(aTranslate);
}
// this should happen via SID_ATTR_TRANSFORM_AUTOSIZE
- if( rMarkList.GetMarkCount() == 1 )
+ if(1 == aSelection.size())
{
- const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
+ const SdrObject* pObj = aSelection[0];
+ const SdrObjKind eKind = (SdrObjKind)pObj->GetObjIdentifier();
+
if( ( pObj->GetObjInventor() == SdrInventor ) &&
( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) &&
( (SdrTextObj*) pObj )->HasText() )
@@ -1938,13 +1948,15 @@ void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView )
}
}
else
+ {
m_bIsMultiSelection = true;
+ }
// use page offset and recalculate
- Point aPt( m_pSdrView->GetSdrPageView()->GetPageOrigin() );
+// Point aPt( m_pSdrView->GetSdrPageView()->GetPageOrigin() );
// Massstab
- Fraction aUIScale = m_pSdrView->GetModel()->GetUIScale();
+// Fraction aUIScale = m_pSdrView->GetModel()->GetUIScale();
// lcl_ScaleRect( m_aWorkArea, aUIScale );
// lcl_ScaleRect( m_aRect, aUIScale );
diff --git a/cui/source/tabpages/swpossizetabpage.hxx b/cui/source/tabpages/swpossizetabpage.hxx
index bd4f40786895..bed5a0b2d3b9 100644
--- a/cui/source/tabpages/swpossizetabpage.hxx
+++ b/cui/source/tabpages/swpossizetabpage.hxx
@@ -85,9 +85,9 @@ class SvxSwPosSizeTabPage : public SfxTabPage
//'string provider'
SvxSwFramePosString m_aFramePosString;
- Rectangle m_aRect; //size of all selected objects
- Rectangle m_aWorkArea;
- Point m_aAnchorPos;
+ basegfx::B2DRange m_aRange; //size of all selected objects
+ basegfx::B2DRange m_aWorkArea;
+ basegfx::B2DPoint m_aAnchorPos;
FrmMap* m_pVMap;
FrmMap* m_pHMap;
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index a7cea69736f7..47675f4465b1 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -31,7 +31,6 @@
#include <sfx2/objsh.hxx>
#include <vcl/msgbox.hxx>
#include <unotools/pathoptions.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdview.hxx>
#include <svx/dialogs.hrc>
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index 0224fd401f0a..e971075b7044 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -31,19 +31,17 @@
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <svx/dialogs.hrc>
-
#define _SVX_TABLINE_CXX
#include <cuires.hrc>
#include "tabline.hrc"
-//#include "dlgname.hrc"
-
-#include "cuitabarea.hxx"
-#include "cuitabline.hxx"
-#include "dlgname.hxx"
+#include <cuitabarea.hxx>
+#include <cuitabline.hxx>
+#include <dlgname.hxx>
#include <dialmgr.hxx>
#include <svx/svdmodel.hxx>
#include <svx/xtable.hxx>
-#include "svx/drawitem.hxx"
+#include <svx/drawitem.hxx>
+#include <svx/svdopath.hxx>
#define DLGWIN this->GetParent()->GetParent()
@@ -96,13 +94,27 @@ SvxLineTabDialog::SvxLineTabDialog
{
switch( pObj->GetObjIdentifier() )
{
- case OBJ_LINE:
- case OBJ_PLIN:
- case OBJ_PATHLINE:
- case OBJ_FREELINE:
case OBJ_MEASURE:
case OBJ_EDGE:
bLineOnly = true;
+ break;
+
+ case OBJ_POLY:
+ {
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pObj);
+ if(pSdrPathObj)
+ {
+ switch(pSdrPathObj->getSdrPathObjType())
+ {
+ case PathType_Line:
+ case PathType_OpenPolygon:
+ case PathType_OpenBezier:
+ bLineOnly = true;
+ break;
+ }
+ }
+ break;
+ }
default:
break;
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index a1ad6a70fc59..98e4695ff195 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -750,7 +750,7 @@ IMPL_LINK( SvxTabulatorTabPage, ModifyHdl_Impl, MetricBox *, EMPTYARG )
//add CHINA001 Begin
void SvxTabulatorTabPage::PageCreated(SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pControlItem,SfxUInt16Item,SID_SVXTABULATORTABPAGE_CONTROLFLAGS,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pControlItem,SfxUInt16Item,SID_SVXTABULATORTABPAGE_CONTROLFLAGS);
if (pControlItem)
DisableControls(pControlItem->GetValue());
}
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 80ecb5c16586..626da2e4035f 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -236,7 +236,7 @@ void __EXPORT SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs )
if( pItem )
{
aTsbStartInside.EnableTriState( sal_False );
- sal_Bool bValue = ( ( const SdrTextAniStartInsideItem* )pItem )->GetValue();
+ sal_Bool bValue = ( ( const SdrYesNoItem* )pItem )->GetValue();
if( bValue )
aTsbStartInside.SetState( STATE_CHECK );
else
@@ -253,7 +253,7 @@ void __EXPORT SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs )
if( pItem )
{
aTsbStopInside.EnableTriState( sal_False );
- sal_Bool bValue = ( ( const SdrTextAniStopInsideItem* )pItem )->GetValue();
+ sal_Bool bValue = ( ( const SdrYesNoItem* )pItem )->GetValue();
if( bValue )
aTsbStopInside.SetState( STATE_CHECK );
else
@@ -270,7 +270,7 @@ void __EXPORT SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs )
if( pItem )
{
aTsbEndless.EnableTriState( sal_False );
- long nValue = (long) ( ( const SdrTextAniCountItem* )pItem )->GetValue();
+ long nValue = (long) ( ( const SfxUInt16Item* )pItem )->GetValue();
aNumFldCount.SetValue( nValue );
if( nValue == 0 )
{
@@ -413,7 +413,7 @@ sal_Bool SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs)
eState = aTsbStartInside.GetState();
if( eState != aTsbStartInside.GetSavedValue() )
{
- rAttrs.Put( SdrTextAniStartInsideItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE, (sal_Bool) STATE_CHECK == eState ) );
bModified = sal_True;
}
@@ -421,7 +421,7 @@ sal_Bool SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs)
eState = aTsbStopInside.GetState();
if( eState != aTsbStopInside.GetSavedValue() )
{
- rAttrs.Put( SdrTextAniStopInsideItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE, (sal_Bool) STATE_CHECK == eState ) );
bModified = sal_True;
}
@@ -443,7 +443,7 @@ sal_Bool SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs)
}
}
if( bModified )
- rAttrs.Put( SdrTextAniCountItem( (sal_uInt16) nValue ) );
+ rAttrs.Put( SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, (sal_uInt16) nValue ) );
}
// Verzoegerung
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 606585d96f75..221c4b292536 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -30,13 +30,9 @@
#include <tools/shl.hxx>
#include <cuires.hrc>
#include <svx/svddef.hxx>
-#include <svx/sdtditm.hxx>
-#include <svx/sdtagitm.hxx>
#include <svx/sdtaitm.hxx>
#include <svx/sdtfsitm.hxx>
-#include <svx/sdtcfitm.hxx>
#include <svx/svdobj.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdview.hxx>
#include <svx/svdotext.hxx>
#include <svx/dialogs.hrc>
@@ -173,7 +169,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LEFTDIST );
if( pItem )
{
- long nValue = ( ( const SdrTextLeftDistItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldLeft, nValue, eUnit );
}
else
@@ -186,7 +182,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_RIGHTDIST );
if( pItem )
{
- long nValue = ( ( const SdrTextRightDistItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldRight, nValue, eUnit );
}
else
@@ -199,7 +195,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_UPPERDIST );
if( pItem )
{
- long nValue = ( ( const SdrTextUpperDistItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldTop, nValue, eUnit );
}
else
@@ -212,7 +208,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LOWERDIST );
if( pItem )
{
- long nValue = ( ( const SdrTextLowerDistItem* )pItem )->GetValue();
+ long nValue = ( ( const SdrMetricItem* )pItem )->GetValue();
SetMetricValue( aMtrFldBottom, nValue, eUnit );
}
else
@@ -222,7 +218,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
// An Hoehe anpassen
if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) != SFX_ITEM_DONTCARE )
{
- aTsbAutoGrowHeight.SetState( ( ( const SdrTextAutoGrowHeightItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
+ aTsbAutoGrowHeight.SetState( ( ( const SdrOnOffItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbAutoGrowHeight.EnableTriState( sal_False );
}
@@ -233,7 +229,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
// An Breite anpassen
if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWWIDTH ) != SFX_ITEM_DONTCARE )
{
- aTsbAutoGrowWidth.SetState( ( ( const SdrTextAutoGrowWidthItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWWIDTH ) ).
+ aTsbAutoGrowWidth.SetState( ( ( const SdrOnOffItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWWIDTH ) ).
GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbAutoGrowWidth.EnableTriState( sal_False );
}
@@ -244,7 +240,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
// autogrowsize
if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWSIZE ) != SFX_ITEM_DONTCARE )
{
- aTsbAutoGrowSize.SetState( ( ( const SdrTextAutoGrowHeightItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
+ aTsbAutoGrowSize.SetState( ( ( const SdrOnOffItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ).
GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbAutoGrowSize.EnableTriState( sal_False );
}
@@ -255,7 +251,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
// wordwrap text
if ( rAttrs.GetItemState( SDRATTR_TEXT_WORDWRAP ) != SFX_ITEM_DONTCARE )
{
- aTsbWordWrapText.SetState( ( ( const SdrTextWordWrapItem& )rAttrs.Get( SDRATTR_TEXT_WORDWRAP ) ).
+ aTsbWordWrapText.SetState( ( ( const SdrOnOffItem& )rAttrs.Get( SDRATTR_TEXT_WORDWRAP ) ).
GetValue() ? STATE_CHECK : STATE_NOCHECK );
aTsbWordWrapText.EnableTriState( sal_False );
}
@@ -359,7 +355,7 @@ void __EXPORT SvxTextAttrPage::Reset( const SfxItemSet& rAttrs )
// Konturfluss
if( rAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME ) != SFX_ITEM_DONTCARE )
{
- sal_Bool bContour = ( ( const SdrTextContourFrameItem& )rAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
+ sal_Bool bContour = ( ( const SdrOnOffItem& )rAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
aTsbContour.SetState( bContour ? STATE_CHECK : STATE_NOCHECK );
aTsbContour.EnableTriState( sal_False );
}
@@ -388,56 +384,56 @@ sal_Bool SvxTextAttrPage::FillItemSet( SfxItemSet& rAttrs)
if( aMtrFldLeft.GetText() != aMtrFldLeft.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldLeft, eUnit );
- rAttrs.Put( SdrTextLeftDistItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, nValue ) );
}
if( aMtrFldRight.GetText() != aMtrFldRight.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldRight, eUnit );
- rAttrs.Put( SdrTextRightDistItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, nValue ) );
}
if( aMtrFldTop.GetText() != aMtrFldTop.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldTop, eUnit );
- rAttrs.Put( SdrTextUpperDistItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, nValue ) );
}
if( aMtrFldBottom.GetText() != aMtrFldBottom.GetSavedValue() )
{
nValue = GetCoreValue( aMtrFldBottom, eUnit );
- rAttrs.Put( SdrTextLowerDistItem( nValue ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, nValue ) );
}
eState = aTsbAutoGrowHeight.GetState();
if( eState != aTsbAutoGrowHeight.GetSavedValue() )
{
- rAttrs.Put( SdrTextAutoGrowHeightItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, (sal_Bool) STATE_CHECK == eState ) );
}
eState = aTsbAutoGrowWidth.GetState();
if( eState != aTsbAutoGrowWidth.GetSavedValue() )
{
- rAttrs.Put( SdrTextAutoGrowWidthItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, (sal_Bool) STATE_CHECK == eState ) );
}
eState = aTsbAutoGrowSize.GetState();
if( eState != aTsbAutoGrowSize.GetSavedValue() )
{
- rAttrs.Put( SdrTextAutoGrowHeightItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, (sal_Bool) STATE_CHECK == eState ) );
}
eState = aTsbWordWrapText.GetState();
if( eState != aTsbWordWrapText.GetSavedValue() )
{
- rAttrs.Put( SdrTextWordWrapItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, (sal_Bool) STATE_CHECK == eState ) );
}
// Konturfluss
eState = aTsbContour.GetState();
if( eState != aTsbContour.GetSavedValue() )
{
- rAttrs.Put( SdrTextContourFrameItem( (sal_Bool) STATE_CHECK == eState ) );
+ rAttrs.Put( SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, (sal_Bool) STATE_CHECK == eState ) );
}
eState = aTsbFitToSize.GetState();
@@ -529,16 +525,15 @@ sal_Bool SvxTextAttrPage::FillItemSet( SfxItemSet& rAttrs)
void SvxTextAttrPage::Construct()
{
DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
-
bFitToSizeEnabled = bContourEnabled = sal_True;
bWordWrapTextEnabled = bAutoGrowSizeEnabled = bAutoGrowWidthEnabled = bAutoGrowHeightEnabled = sal_False;
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ if(pSelected)
{
- const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier();
- if( pObj->GetObjInventor() == SdrInventor )
+ const SdrObjKind eKind = (SdrObjKind) pSelected->GetObjIdentifier();
+
+ if( pSelected->GetObjInventor() == SdrInventor )
{
switch( eKind )
{
@@ -547,7 +542,7 @@ void SvxTextAttrPage::Construct()
case OBJ_OUTLINETEXT :
case OBJ_CAPTION :
{
- if ( ((SdrTextObj*)pObj)->HasText() )
+ if ( ((SdrTextObj*)pSelected)->HasText() )
{
// Konturfluss ist NICHT bei reinen Textobjekten m�glich
bContourEnabled = sal_False;
@@ -568,6 +563,7 @@ void SvxTextAttrPage::Construct()
}
}
}
+
aTsbAutoGrowHeight.Enable( bAutoGrowHeightEnabled );
aTsbAutoGrowWidth.Enable( bAutoGrowWidthEnabled );
aTsbFitToSize.Enable( bFitToSizeEnabled );
@@ -785,7 +781,7 @@ bool SvxTextAttrPage::IsTextDirectionLeftToRight (void) const
//add CHINA001 begin
void SvxTextAttrPage::PageCreated(SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pViewItem,OfaPtrItem,SID_SVXTEXTATTRPAGE_VIEW,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pViewItem,OfaPtrItem,SID_SVXTEXTATTRPAGE_VIEW );
if (pViewItem)
SetView( static_cast<SdrView *>(pViewItem->GetValue()));
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 47044c13e9b3..859b930c8e56 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -353,7 +353,7 @@ sal_Bool SvxTransparenceTabPage::FillItemSet(SfxItemSet& rAttrs)
if(nPos != (sal_uInt16)aMtrTransparent.GetSavedValue().ToInt32() || !bLinearActive)
{
XFillTransparenceItem aItem(nPos);
- SdrShadowTransparenceItem aShadowItem(nPos);
+ SdrPercentItem aShadowItem(SDRATTR_SHADOWTRANSPARENCE, nPos);
const SfxPoolItem* pOld = GetOldItem(rAttrs, XATTR_FILLTRANSPARENCE);
if(!pOld || !(*(const XFillTransparenceItem*)pOld == aItem) || !bLinearActive)
{
@@ -425,7 +425,7 @@ sal_Bool SvxTransparenceTabPage::FillItemSet(SfxItemSet& rAttrs)
if(bSwitchOffLinear && (bLinearActive || bLinearUsed))
{
XFillTransparenceItem aItem(0);
- SdrShadowTransparenceItem aShadowItem(0);
+ SdrPercentItem aShadowItem(SDRATTR_SHADOWTRANSPARENCE, 0);
rAttrs.Put(aItem);
rAttrs.Put(aShadowItem);
bModified = sal_True;
@@ -504,7 +504,7 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet& rAttrs)
void SvxTransparenceTabPage::ActivatePage(const SfxItemSet& rSet)
{
//add CHINA001 Begin
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE );
if (pPageTypeItem)
SetPageType(pPageTypeItem->GetValue());
//add CHINA001 end
@@ -601,8 +601,8 @@ void SvxTransparenceTabPage::InvalidatePreview (sal_Bool bEnable)
void SvxTransparenceTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE );
+ SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE );
if (pPageTypeItem)
SetPageType(pPageTypeItem->GetValue());
@@ -802,8 +802,8 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
sal_uInt16 _nPos = 0;
sal_uInt16 nCount;
//add CHINA001 Begin
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&rSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False);
+ SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE );
+ SFX_ITEMSET_ARG (&rSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS );
if (pPageTypeItem)
SetPageType(pPageTypeItem->GetValue());
if (pPosItem)
@@ -2567,13 +2567,13 @@ void SvxAreaTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pGradientListItem,SvxGradientListItem,SID_GRADIENT_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pHatchingListItem,SvxHatchListItem,SID_HATCH_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pBitmapListItem,SvxBitmapListItem,SID_BITMAP_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE );
+ SFX_ITEMSET_ARG (&aSet,pGradientListItem,SvxGradientListItem,SID_GRADIENT_LIST );
+ SFX_ITEMSET_ARG (&aSet,pHatchingListItem,SvxHatchListItem,SID_HATCH_LIST );
+ SFX_ITEMSET_ARG (&aSet,pBitmapListItem,SvxBitmapListItem,SID_BITMAP_LIST );
+ SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE );
+ SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE );
+ SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS );
if (pColorTabItem)
SetColorTable(pColorTabItem->GetColorTable());
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index a78837113a1d..a4ffb442c2f7 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -26,17 +26,12 @@
// include ---------------------------------------------------------------
-#ifndef _SVX_SIZEITEM_HXX //autogen
-
#include <editeng/sizeitem.hxx>
-#endif
#include <tools/shl.hxx>
#include <tools/urlobj.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
-
#define _SVX_TPLINE_CXX
-
#include <cuires.hrc>
#include "tabline.hrc"
#include "svx/xattr.hxx"
@@ -49,7 +44,6 @@
#include "svx/dlgutil.hxx"
#include <svx/svdmodel.hxx>
#include "svx/svxgrahicitem.hxx"
-//#include "linectrl.hrc"
#include <sfx2/request.hxx>
#include "svx/ofaitem.hxx"
#include <svx/svdobj.hxx>
@@ -67,6 +61,7 @@
#include "sfx2/opengrf.hxx"
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
+#include <svx/svdlegacy.hxx>
#define MAX_BMP_WIDTH 16
#define MAX_BMP_HEIGHT 16
@@ -323,7 +318,7 @@ void SvxLineTabPage::FillListboxes()
void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
{
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False); //add CHINA001 begin
+ SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE); //add CHINA001 begin
if (pPageTypeItem)
SetPageType(pPageTypeItem->GetValue()); //add CHINA001 end
if( nDlgType == 0 && pDashList ) //CHINA001 if( *pDlgType == 0 && pDashList ) // Linien-Dialog
@@ -1011,14 +1006,13 @@ void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
VirtualDevice aVDev;
aVDev.SetMapMode(MapMode(MAP_100TH_MM));
- SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS);
+ SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
SdrPage* pPage = new SdrPage( *pModel, sal_False );
- pPage->SetSize(Size(1000,1000));
+ pPage->SetPageScale(basegfx::B2DVector(1000.0, 1000.0));
pModel->InsertPage( pPage, 0 );
- SdrView* pView = new SdrView( pModel, &aVDev );
- pView->hideMarkHandles();
- /*SdrPageView* pPageView = */pView->ShowSdrPage(pPage);
+ SdrView* pView = new SdrView( *pModel, &aVDev );
+ pView->ShowSdrPage(*pPage);
SdrObject *pObj=NULL;
long nSymTmp=nSymType;
if(pSymbolList)
@@ -1029,7 +1023,8 @@ void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
pObj=pSymbolList->GetObj(nSymTmp);
if(pObj)
{
- pObj=pObj->Clone();
+ pObj = pObj->CloneSdrObject();
+
if(pSymbolAttr)
{
pObj->SetMergedItemSet(*pSymbolAttr);
@@ -1039,13 +1034,13 @@ void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
pObj->SetMergedItemSet(rOutAttrs);
}
- pPage->NbcInsertObject(pObj);
+ pPage->InsertObjectToSdrObjList(*pObj);
// Generate invisible square to give all symbol types a
// bitmap size, which is indepedent from specific glyph
- SdrObject *pInvisibleSquare=pSymbolList->GetObj(0);
- pInvisibleSquare=pInvisibleSquare->Clone();
- pPage->NbcInsertObject(pInvisibleSquare);
+ SdrObject *pInvisibleSquare = pSymbolList->GetObj(0);
+ pInvisibleSquare = pInvisibleSquare->CloneSdrObject();
+ pPage->InsertObjectToSdrObjList(*pInvisibleSquare);
pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
@@ -1053,18 +1048,20 @@ void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
aSymbolGraphic=Graphic(aMeta);
- aSymbolSize=pObj->GetSnapRect().GetSize();
- aSymbolGraphic.SetPrefSize(pInvisibleSquare->GetSnapRect().GetSize());
+ aSymbolSize=sdr::legacy::GetSnapRect(*pObj).GetSize();
+ aSymbolGraphic.SetPrefSize(sdr::legacy::GetSnapRect(*pInvisibleSquare).GetSize());
aSymbolGraphic.SetPrefMapMode(MAP_100TH_MM);
bPrevSym=sal_True;
bEnable=sal_True;
bIgnoreGraphic=sal_True;
pView->UnmarkAll();
- pInvisibleSquare=pPage->RemoveObject(1);
- SdrObject::Free( pInvisibleSquare);
- pObj=pPage->RemoveObject(0);
- SdrObject::Free( pObj );
+
+ pInvisibleSquare = pPage->RemoveObjectFromSdrObjList(pInvisibleSquare->GetNavigationPosition());
+ deleteSdrObjectSafeAndClearPointer(pInvisibleSquare);
+
+ pObj = pPage->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+ deleteSdrObjectSafeAndClearPointer(pObj);
}
}
}
@@ -1739,39 +1736,42 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
{
VirtualDevice aVDev;
aVDev.SetMapMode(MapMode(MAP_100TH_MM));
- SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS);
+ SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
// Page
SdrPage* pPage = new SdrPage( *pModel, sal_False );
- pPage->SetSize(Size(1000,1000));
+ pPage->SetPageScale(basegfx::B2DVector(1000.0, 1000.0));
pModel->InsertPage( pPage, 0 );
+
// 3D View
- SdrView* pView = new SdrView( pModel, &aVDev );
- pView->hideMarkHandles();
- /*SdrPageView* pPageView = */pView->ShowSdrPage(pPage);
+ SdrView* pView = new SdrView( *pModel, &aVDev );
+ pView->ShowSdrPage(*pPage);
PopupMenu* pPopup = new PopupMenu;
String aEmptyStr;
// Generate invisible square to give all symbols a
// bitmap size, which is indepedent from specific glyph
- SdrObject *pInvisibleSquare=pSymbolList->GetObj(0);
- pInvisibleSquare=pInvisibleSquare->Clone();
- pPage->NbcInsertObject(pInvisibleSquare);
+ SdrObject *pInvisibleSquare = pSymbolList->GetObj(0);
+ pInvisibleSquare=pInvisibleSquare->CloneSdrObject();
+ pPage->InsertObjectToSdrObjList(*pInvisibleSquare);
pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
for(long i=0;; ++i)
{
SdrObject *pObj=pSymbolList->GetObj(i);
- if(pObj==NULL)
+
+ if(!pObj)
+ {
break;
- pObj=pObj->Clone();
- //const String* pGrfName = (const String*)aGrfNames.GetObject(i);
- String *pStr=new String();//String(i));
+ }
+
+ pObj = pObj->CloneSdrObject();
+ String *pStr = new String();
aGrfNames.Insert(pStr,LIST_APPEND);
- //Rectangle aRect(pObj->GetLogicRect());
- pPage->NbcInsertObject(pObj);
+ pPage->InsertObjectToSdrObjList(*pObj);
+
if(pSymbolAttr)
{
pObj->SetMergedItemSet(*pSymbolAttr);
@@ -1780,12 +1780,14 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
{
pObj->SetMergedItemSet(rOutAttrs);
}
+
pView->MarkAll();
BitmapEx aBitmapEx(pView->GetMarkedObjBitmapEx());
GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
pView->UnmarkAll();
- pObj=pPage->RemoveObject(1);
- SdrObject::Free(pObj);
+
+ pObj = pPage->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+ deleteSdrObjectSafeAndClearPointer(pObj);
SvxBrushItem* pBrushItem = new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH);
pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl));
@@ -1807,8 +1809,9 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
Image aImage(aBitmapEx);
pPopup->InsertItem(pInfo->nItemId,*pStr,aImage);
}
- pInvisibleSquare=pPage->RemoveObject(0);
- SdrObject::Free(pInvisibleSquare);
+
+ pInvisibleSquare = pPage->RemoveObjectFromSdrObjList(pInvisibleSquare->GetNavigationPosition());
+ deleteSdrObjectSafeAndClearPointer(pInvisibleSquare);
aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_SYMBOLS, pPopup );
if(!aGrfNames.Count())
@@ -2034,14 +2037,14 @@ void SvxLineTabPage::DataChanged( const DataChangedEvent& rDCEvt )
void SvxLineTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDashListItem,SvxDashListItem,SID_DASH_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pLineEndListItem,SvxLineEndListItem,SID_LINEEND_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pSdrObjListItem,OfaPtrItem,SID_OBJECT_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pSymbolAttrItem,SfxTabDialogItem,SID_ATTR_SET,sal_False);
- SFX_ITEMSET_ARG (&aSet,pGraphicItem,SvxGraphicItem,SID_GRAPHIC,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE);
+ SFX_ITEMSET_ARG (&aSet,pDashListItem,SvxDashListItem,SID_DASH_LIST);
+ SFX_ITEMSET_ARG (&aSet,pLineEndListItem,SvxLineEndListItem,SID_LINEEND_LIST);
+ SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE);
+ SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE);
+ SFX_ITEMSET_ARG (&aSet,pSdrObjListItem,OfaPtrItem,SID_OBJECT_LIST);
+ SFX_ITEMSET_ARG (&aSet,pSymbolAttrItem,SfxTabDialogItem,SID_ATTR_SET);
+ SFX_ITEMSET_ARG (&aSet,pGraphicItem,SvxGraphicItem,SID_GRAPHIC);
if (pColorTabItem)
SetColorTable(pColorTabItem->GetColorTable());
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 942e3f93f6e1..90068e94ad0d 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -154,16 +154,16 @@ void SvxLineEndDefTabPage::Construct()
{
bCreateArrowPossible = false;
}
- else if( !pPolyObj->ISA( SdrPathObj ) )
+ else if( !dynamic_cast< const SdrPathObj* >(pPolyObj) )
{
SdrObjTransformInfoRec aInfoRec;
pPolyObj->TakeObjInfo( aInfoRec );
SdrObject* pNewObj = 0;
- if( aInfoRec.bCanConvToPath )
+ if( aInfoRec.mbCanConvToPath )
pNewObj = pPolyObj->ConvertToPolyObj( sal_True, sal_False );
- bCreateArrowPossible = pNewObj && pNewObj->ISA( SdrPathObj );
- SdrObject::Free( pNewObj );
+ bCreateArrowPossible = pNewObj && dynamic_cast< SdrPathObj* >(pNewObj);
+ deleteSdrObjectSafeAndClearPointer( pNewObj );
}
if( !bCreateArrowPossible )
@@ -428,7 +428,7 @@ IMPL_LINK( SvxLineEndDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
const SdrObject* pNewObj;
SdrObject* pConvPolyObj = NULL;
- if( pPolyObj->ISA( SdrPathObj ) )
+ if( dynamic_cast< const SdrPathObj* >(pPolyObj) )
{
pNewObj = pPolyObj;
}
@@ -437,18 +437,18 @@ IMPL_LINK( SvxLineEndDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
SdrObjTransformInfoRec aInfoRec;
pPolyObj->TakeObjInfo( aInfoRec );
- if( aInfoRec.bCanConvToPath )
+ if( aInfoRec.mbCanConvToPath )
{
pNewObj = pConvPolyObj = pPolyObj->ConvertToPolyObj( sal_True, sal_False );
- if( !pNewObj || !pNewObj->ISA( SdrPathObj ) )
+ if( !pNewObj || !dynamic_cast< const SdrPathObj* >(pNewObj) )
return( 0L ); // Abbruch, zusaetzliche Sicherheit, die bei
// Gruppenobjekten aber nichts bringt.
}
else return( 0L ); // Abbruch
}
- basegfx::B2DPolyPolygon aNewPolyPolygon(((SdrPathObj*)pNewObj)->GetPathPoly());
+ basegfx::B2DPolyPolygon aNewPolyPolygon(((SdrPathObj*)pNewObj)->getB2DPolyPolygonInObjectCoordinates());
basegfx::B2DRange aNewRange(basegfx::tools::getRange(aNewPolyPolygon));
// Normalisieren
@@ -456,7 +456,7 @@ IMPL_LINK( SvxLineEndDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
-aNewRange.getMinX(), -aNewRange.getMinY()));
// Loeschen des angelegten PolyObjektes
- SdrObject::Free( pConvPolyObj );
+ deleteSdrObjectSafeAndClearPointer( pConvPolyObj );
XLineEndEntry* pEntry;
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 6be463a01fde..b4ee07263377 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -216,7 +216,7 @@ void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet )
sal_uInt16 nPos;
sal_uInt16 nCount;
//add CHINA001 Begin
- SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE);
if (pPageTypeItem)
SetPageType(pPageTypeItem->GetValue());
//add CHINA001 end
@@ -285,9 +285,9 @@ sal_Bool SvxShadowTabPage::FillItemSet( SfxItemSet& rAttrs )
TriState eState = aTsbShowShadow.GetState();
if( eState != aTsbShowShadow.GetSavedValue() )
{
- SdrShadowItem aItem( sal::static_int_cast< sal_Bool >( eState ) );
+ SdrOnOffItem aItem( sal::static_int_cast< sal_Bool >( eState ) );
pOld = GetOldItem( rAttrs, SDRATTR_SHADOW );
- if ( !pOld || !( *(const SdrShadowItem*)pOld == aItem ) )
+ if ( !pOld || !( *(const SdrOnOffItem*)pOld == aItem ) )
{
rAttrs.Put( aItem );
bModified = sal_True;
@@ -326,23 +326,23 @@ sal_Bool SvxShadowTabPage::FillItemSet( SfxItemSet& rAttrs )
if( rOutAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE &&
rOutAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE )
{
- nOldX = ( ( const SdrShadowXDistItem& ) rOutAttrs.
+ nOldX = ( ( const SdrMetricItem& ) rOutAttrs.
Get( SDRATTR_SHADOWXDIST ) ).GetValue();
- nOldY = ( ( const SdrShadowYDistItem& ) rOutAttrs.
+ nOldY = ( ( const SdrMetricItem& ) rOutAttrs.
Get( SDRATTR_SHADOWYDIST ) ).GetValue();
}
- SdrShadowXDistItem aXItem( nX );
+ SdrMetricItem aXItem(SDRATTR_SHADOWXDIST, nX );
pOld = GetOldItem( rAttrs, SDRATTR_SHADOWXDIST );
if ( nX != nOldX &&
- ( !pOld || !( *(const SdrShadowXDistItem*)pOld == aXItem ) ) )
+ ( !pOld || !( *(const SdrMetricItem*)pOld == aXItem ) ) )
{
rAttrs.Put( aXItem );
bModified = sal_True;
}
- SdrShadowYDistItem aYItem( nY );
+ SdrMetricItem aYItem( SDRATTR_SHADOWYDIST, nY );
pOld = GetOldItem( rAttrs, SDRATTR_SHADOWYDIST );
if ( nY != nOldY &&
- ( !pOld || !( *(const SdrShadowYDistItem*)pOld == aYItem ) ) )
+ ( !pOld || !( *(const SdrMetricItem*)pOld == aYItem ) ) )
{
rAttrs.Put( aYItem );
bModified = sal_True;
@@ -354,10 +354,10 @@ sal_Bool SvxShadowTabPage::FillItemSet( SfxItemSet& rAttrs )
if( nPos != LISTBOX_ENTRY_NOTFOUND &&
nPos != aLbShadowColor.GetSavedValue() )
{
- SdrShadowColorItem aItem( aLbShadowColor.GetSelectEntry(),
+ XColorItem aItem(SDRATTR_SHADOWCOLOR, aLbShadowColor.GetSelectEntry(),
aLbShadowColor.GetSelectEntryColor() );
pOld = GetOldItem( rAttrs, SDRATTR_SHADOWCOLOR );
- if ( !pOld || !( *(const SdrShadowColorItem*)pOld == aItem ) )
+ if ( !pOld || !( *(const XColorItem*)pOld == aItem ) )
{
rAttrs.Put( aItem );
bModified = sal_True;
@@ -368,9 +368,9 @@ sal_Bool SvxShadowTabPage::FillItemSet( SfxItemSet& rAttrs )
sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue();
if( nVal != (sal_uInt16)aMtrTransparent.GetSavedValue().ToInt32() )
{
- SdrShadowTransparenceItem aItem( nVal );
+ SdrPercentItem aItem(SDRATTR_SHADOWTRANSPARENCE, nVal );
pOld = GetOldItem( rAttrs, SDRATTR_SHADOWTRANSPARENCE );
- if ( !pOld || !( *(const SdrShadowTransparenceItem*)pOld == aItem ) )
+ if ( !pOld || !( *(const SdrPercentItem*)pOld == aItem ) )
{
rAttrs.Put( aItem );
bModified = sal_True;
@@ -397,7 +397,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet& rAttrs )
{
aTsbShowShadow.EnableTriState( sal_False );
- if( ( ( const SdrShadowItem& ) rAttrs.Get( SDRATTR_SHADOW ) ).GetValue() )
+ if( ( ( const SdrOnOffItem& ) rAttrs.Get( SDRATTR_SHADOW ) ).GetValue() )
aTsbShowShadow.SetState( STATE_CHECK );
else
{
@@ -413,8 +413,8 @@ void SvxShadowTabPage::Reset( const SfxItemSet& rAttrs )
if( rAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE &&
rAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE )
{
- sal_Int32 nX = ( ( const SdrShadowXDistItem& ) rAttrs.Get( SDRATTR_SHADOWXDIST ) ).GetValue();
- sal_Int32 nY = ( ( const SdrShadowYDistItem& ) rAttrs.Get( SDRATTR_SHADOWYDIST ) ).GetValue();
+ sal_Int32 nX = ( ( const SdrMetricItem& ) rAttrs.Get( SDRATTR_SHADOWXDIST ) ).GetValue();
+ sal_Int32 nY = ( ( const SdrMetricItem& ) rAttrs.Get( SDRATTR_SHADOWYDIST ) ).GetValue();
if( nX != 0 )
SetMetricValue( aMtrDistance, nX < 0L ? -nX : nX, ePoolUnit );
@@ -437,8 +437,8 @@ void SvxShadowTabPage::Reset( const SfxItemSet& rAttrs )
{
// determine default-distance
SfxItemPool* pPool = rOutAttrs.GetPool();
- SdrShadowXDistItem* pXDistItem = (SdrShadowXDistItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWXDIST);
- SdrShadowYDistItem* pYDistItem = (SdrShadowYDistItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWYDIST);
+ SdrMetricItem* pXDistItem = (SdrMetricItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWXDIST);
+ SdrMetricItem* pYDistItem = (SdrMetricItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWYDIST);
if (pXDistItem && pYDistItem)
{
sal_Int32 nX = pXDistItem->GetValue();
@@ -459,7 +459,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet& rAttrs )
// SchattenFarbe:
if( rAttrs.GetItemState( SDRATTR_SHADOWCOLOR ) != SFX_ITEM_DONTCARE )
{
- aLbShadowColor.SelectEntry( ( ( const SdrShadowColorItem& ) rAttrs.Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() );
+ aLbShadowColor.SelectEntry( ( ( const XColorItem& ) rAttrs.Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() );
}
else
aLbShadowColor.SetNoSelection();
@@ -467,7 +467,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet& rAttrs )
// Transparenz
if( rAttrs.GetItemState( SDRATTR_SHADOWTRANSPARENCE ) != SFX_ITEM_DONTCARE )
{
- sal_uInt16 nTransp = ( ( const SdrShadowTransparenceItem& ) rAttrs.Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue();
+ sal_uInt16 nTransp = ( ( const SdrPercentItem& ) rAttrs.Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue();
aMtrTransparent.SetValue( nTransp );
}
else
@@ -593,9 +593,9 @@ void SvxShadowTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
void SvxShadowTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
- SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE);
+ SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE);
+ SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE);
if (pColorTabItem)
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 3639ecdd96ef..05455c1b772a 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -32,7 +32,6 @@
#include <svx/svdobj.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdotext.hxx>
-#include <svx/sderitm.hxx>
#include <svx/dialogs.hrc>
#include <cuires.hrc>
#include "transfrm.hrc"
@@ -267,19 +266,21 @@ void SvxAngleTabPage::Construct()
aMtrPosY.SetDecimalDigits( 3 );
}
- { // #i75273#
- Rectangle aTempRect(pView->GetAllMarkedRect());
- pView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ {
+ maRange = pView->getMarkedObjectSnapRange();
+
+ if(pView->GetSdrPageView())
+ {
+ maRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-pView->GetSdrPageView()->GetPageOrigin()));
+ }
}
// Take anchor into account (Writer)
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
- if(rMarkList.GetMarkCount())
+ if(pSelected)
{
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y());
+ maAnchor = pSelected->GetAnchorPos();
if(!maAnchor.equalZero()) // -> Writer
{
@@ -288,7 +289,7 @@ void SvxAngleTabPage::Construct()
}
// take scale into account
- const Fraction aUIScale(pView->GetModel()->GetUIScale());
+ const Fraction aUIScale(pView->getSdrModelFromSdrView().GetUIScale());
lcl_ScaleRect(maRange, aUIScale);
// take UI units into account
@@ -320,7 +321,7 @@ sal_Bool SvxAngleTabPage::FillItemSet(SfxItemSet& rSet)
if(aMtrAngle.IsValueModified() || aMtrPosX.IsValueModified() || aMtrPosY.IsValueModified())
{
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
+ const double fUIScale(double(pView->getSdrModelFromSdrView().GetUIScale()));
const double fTmpX((GetCoreValue(aMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
const double fTmpY((GetCoreValue(aMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);
@@ -338,7 +339,7 @@ sal_Bool SvxAngleTabPage::FillItemSet(SfxItemSet& rSet)
void SvxAngleTabPage::Reset(const SfxItemSet& rAttrs)
{
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
+ const double fUIScale(double(pView->getSdrModelFromSdrView().GetUIScale()));
const SfxPoolItem* pItem = GetItem( rAttrs, SID_ATTR_TRANSFORM_ROT_X );
if(pItem)
@@ -546,10 +547,13 @@ void SvxSlantTabPage::Construct()
eDlgUnit = GetModuleFieldUnit(GetItemSet());
SetFieldUnit(aMtrRadius, eDlgUnit, sal_True);
- { // #i75273#
- Rectangle aTempRect(pView->GetAllMarkedRect());
- pView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ {
+ maRange = pView->getMarkedObjectSnapRange();
+
+ if(pView->GetSdrPageView())
+ {
+ maRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-pView->GetSdrPageView()->GetPageOrigin()));
+ }
}
}
@@ -563,11 +567,11 @@ sal_Bool SvxSlantTabPage::FillItemSet(SfxItemSet& rAttrs)
if( aStr != aMtrRadius.GetSavedValue() )
{
- Fraction aUIScale = pView->GetModel()->GetUIScale();
+ Fraction aUIScale = pView->getSdrModelFromSdrView().GetUIScale();
long nTmp = GetCoreValue( aMtrRadius, ePoolUnit );
nTmp = Fraction( nTmp ) * aUIScale;
- rAttrs.Put( SdrEckenradiusItem( nTmp ) );
+ rAttrs.Put( SdrMetricItem(SDRATTR_ECKENRADIUS, nTmp ) );
bModified = sal_True;
}
@@ -584,12 +588,17 @@ sal_Bool SvxSlantTabPage::FillItemSet(SfxItemSet& rAttrs)
{
// Referenzpunkt setzen
// #75897#
- Rectangle aObjectRect(pView->GetAllMarkedRect());
- pView->GetSdrPageView()->LogicToPagePos(aObjectRect);
- Point aPt = aObjectRect.Center();
+ basegfx::B2DRange aObjectRange(pView->getMarkedObjectSnapRange());
- rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X, aPt.X()));
- rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y, aPt.Y()));
+ if(pView->GetSdrPageView())
+ {
+ aObjectRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-pView->GetSdrPageView()->GetPageOrigin()));
+ }
+
+ const basegfx::B2DPoint aCenter(aObjectRange.getCenter());
+
+ rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X, basegfx::fround(aCenter.getX())));
+ rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y, basegfx::fround(aCenter.getY())));
rAttrs.Put( SfxBoolItem( SID_ATTR_TRANSFORM_SHEAR_VERTICAL, sal_False ) );
}
@@ -617,8 +626,8 @@ void SvxSlantTabPage::Reset(const SfxItemSet& rAttrs)
if( pItem )
{
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
- const double fTmp((double)((const SdrEckenradiusItem*)pItem)->GetValue() / fUIScale);
+ const double fUIScale(double(pView->getSdrModelFromSdrView().GetUIScale()));
+ const double fTmp((double)((const SdrMetricItem*)pItem)->GetValue() / fUIScale);
SetMetricValue(aMtrRadius, basegfx::fround(fTmp), ePoolUnit);
}
else
@@ -793,32 +802,38 @@ void SvxPositionSizeTabPage::Construct()
}
{ // #i75273#
- Rectangle aTempRect(mpView->GetAllMarkedRect());
- mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ maRange = mpView->getMarkedObjectSnapRange();
+
+ if(mpView->GetSdrPageView())
+ {
+ maRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpView->GetSdrPageView()->GetPageOrigin()));
+ }
}
{ // #i75273#
- Rectangle aTempRect(mpView->GetWorkArea());
- mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maWorkRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ maWorkRange = mpView->GetWorkArea();
+
+ if(mpView->GetSdrPageView())
+ {
+ maWorkRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpView->GetSdrPageView()->GetPageOrigin()));
+ }
}
// take anchor into account (Writer)
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ const SdrObjectVector aSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
- if(rMarkList.GetMarkCount())
+ if(aSelection.size())
{
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y());
+ const SdrObject* pObj = aSelection[0];
+ maAnchor = pObj->GetAnchorPos();
if(!maAnchor.equalZero()) // -> Writer
{
- for(sal_uInt16 i(1); i < rMarkList.GetMarkCount(); i++)
+ for(sal_uInt32 i(1); i < aSelection.size(); i++)
{
- pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ const SdrObject* pCandidate = aSelection[i];
- if(maAnchor != basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y()))
+ if(!maAnchor.equal(pCandidate->GetAnchorPos()))
{
// diferent anchor positions
maMtrPosX.SetText( String() );
@@ -835,12 +850,14 @@ void SvxPositionSizeTabPage::Construct()
}
// this should happen via SID_ATTR_TRANSFORM_AUTOSIZE
- if(1 == rMarkList.GetMarkCount())
+ if(1 == aSelection.size())
{
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ const SdrObject* pObj = aSelection[0];
const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier());
- if((pObj->GetObjInventor() == SdrInventor) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && ((SdrTextObj*)pObj)->HasText())
+ if((pObj->GetObjInventor() == SdrInventor)
+ && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind)
+ && ((SdrTextObj*)pObj)->HasText())
{
mbAdjustDisabled = false;
maFlAdjust.Enable();
@@ -856,7 +873,7 @@ void SvxPositionSizeTabPage::Construct()
}
// take scale into account
- const Fraction aUIScale(mpView->GetModel()->GetUIScale());
+ const Fraction aUIScale(mpView->getSdrModelFromSdrView().GetUIScale());
lcl_ScaleRect( maWorkRange, aUIScale );
lcl_ScaleRect( maRange, aUIScale );
@@ -888,14 +905,17 @@ sal_Bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet& rOutAttrs )
{
if ( maMtrPosX.IsValueModified() || maMtrPosY.IsValueModified() )
{
- const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+ const double fUIScale(double(mpView->getSdrModelFromSdrView().GetUIScale()));
double fX((GetCoreValue( maMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale);
double fY((GetCoreValue( maMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale);
- { // #i75273#
- Rectangle aTempRect(mpView->GetAllMarkedRect());
- mpView->GetSdrPageView()->LogicToPagePos(aTempRect);
- maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom());
+ {
+ maRange = mpView->getMarkedObjectSnapRange();
+
+ if(mpView->GetSdrPageView())
+ {
+ maRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpView->GetSdrPageView()->GetPageOrigin()));
+ }
}
// #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions
@@ -926,7 +946,7 @@ sal_Bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet& rOutAttrs )
if ( maMtrWidth.IsValueModified() || maMtrHeight.IsValueModified() )
{
- Fraction aUIScale = mpView->GetModel()->GetUIScale();
+ Fraction aUIScale = mpView->getSdrModelFromSdrView().GetUIScale();
// get Width
double nWidth = static_cast<double>(maMtrWidth.GetValue( meDlgUnit ));
@@ -999,7 +1019,7 @@ sal_Bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet& rOutAttrs )
void SvxPositionSizeTabPage::Reset( const SfxItemSet& )
{
const SfxPoolItem* pItem;
- const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+ const double fUIScale(double(mpView->getSdrModelFromSdrView().GetUIScale()));
if ( !mbPageDisabled )
{
diff --git a/dbaccess/source/filter/xml/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx
index 2fbb171fa70c..4edaceb57ca0 100644
--- a/dbaccess/source/filter/xml/xmlColumn.cxx
+++ b/dbaccess/source/filter/xml/xmlColumn.cxx
@@ -169,10 +169,10 @@ void OXMLColumn::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName));
+ const OTableStyleContext* pAutoStyle = dynamic_cast< const OTableStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName));
if ( pAutoStyle )
{
- pAutoStyle->FillPropertySet(xProp);
+ const_cast< OTableStyleContext* >(pAutoStyle)->FillPropertySet(xProp);
}
}
} // if ( m_sStyleName.getLength() )
@@ -181,12 +181,12 @@ void OXMLColumn::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName));
+ const OTableStyleContext* pAutoStyle = dynamic_cast< const OTableStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName));
if ( pAutoStyle )
{
- pAutoStyle->FillPropertySet(xProp);
+ const_cast< OTableStyleContext* >(pAutoStyle)->FillPropertySet(xProp);
// we also have to do this on the table to import text-properties
- pAutoStyle->FillPropertySet(m_xTable);
+ const_cast< OTableStyleContext* >(pAutoStyle)->FillPropertySet(m_xTable);
}
}
}
@@ -198,11 +198,11 @@ void OXMLColumn::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName));
+ const OTableStyleContext* pAutoStyle = dynamic_cast< const OTableStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sCellStyleName));
if ( pAutoStyle )
{
// we also have to do this on the table to import text-properties
- pAutoStyle->FillPropertySet(m_xTable);
+ const_cast< OTableStyleContext* >(pAutoStyle)->FillPropertySet(m_xTable);
}
}
}
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx b/dbaccess/source/filter/xml/xmlStyleImport.cxx
index eb9c6577d9c6..e6e95969b686 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.cxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx
@@ -96,8 +96,6 @@ using namespace ::com::sun::star::container;
using namespace xmloff::token;
// -----------------------------------------------------------------------------
-TYPEINIT1( OTableStyleContext, XMLPropStyleContext );
-TYPEINIT1( OTableStylesContext, SvXMLStylesContext );
DBG_NAME(OTableStyleContext)
OTableStyleContext::OTableStyleContext( ODBFilter& rImport,
@@ -141,13 +139,13 @@ void OTableStyleContext::FillPropertySet(
{
if ((m_nNumberFormat == -1) && m_sDataStyleName.getLength())
{
- SvXMLNumFormatContext* pStyle = PTR_CAST(SvXMLNumFormatContext,pStyles->FindStyleChildContext(
+ const SvXMLNumFormatContext* pStyle = dynamic_cast< const SvXMLNumFormatContext* >( pStyles->FindStyleChildContext(
XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True));
if ( !pStyle )
{
- OTableStylesContext* pMyStyles = PTR_CAST(OTableStylesContext,GetOwnImport().GetAutoStyles());
+ OTableStylesContext* pMyStyles = dynamic_cast< OTableStylesContext* >( GetOwnImport().GetAutoStyles());
if ( pMyStyles )
- pStyle = PTR_CAST(SvXMLNumFormatContext,pMyStyles->
+ pStyle = dynamic_cast< const SvXMLNumFormatContext* >( pMyStyles->
FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True));
else {
DBG_ERROR("not possible to get style");
@@ -156,7 +154,7 @@ void OTableStyleContext::FillPropertySet(
if ( pStyle )
{
uno::Any aNumberFormat;
- m_nNumberFormat = pStyle->GetKey();
+ m_nNumberFormat = const_cast< SvXMLNumFormatContext* >(pStyle)->GetKey();
aNumberFormat <<= m_nNumberFormat;
//rPropSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_NUMBERFORMAT)), aNumberFormat);
AddProperty(CTF_DB_NUMBERFORMAT, aNumberFormat);
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.hxx b/dbaccess/source/filter/xml/xmlStyleImport.hxx
index d6e8cdb43c85..ad12afb983b3 100644
--- a/dbaccess/source/filter/xml/xmlStyleImport.hxx
+++ b/dbaccess/source/filter/xml/xmlStyleImport.hxx
@@ -81,9 +81,6 @@ namespace dbaxml
const ::rtl::OUString& rValue );
public:
-
- TYPEINFO();
-
OTableStyleContext( ODBFilter& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
@@ -127,9 +124,6 @@ namespace dbaxml
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
public:
-
- TYPEINFO();
-
OTableStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx ,
const ::rtl::OUString& rLName ,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx
index 9cf54e7a4c19..359f843f0258 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -229,10 +229,10 @@ void OXMLTable::EndElement()
const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
if ( pAutoStyles )
{
- OTableStyleContext* pAutoStyle = PTR_CAST(OTableStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName));
+ const OTableStyleContext* pAutoStyle = dynamic_cast< const OTableStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName));
if ( pAutoStyle )
{
- pAutoStyle->FillPropertySet(m_xTable);
+ const_cast< OTableStyleContext* >(pAutoStyle)->FillPropertySet(m_xTable);
}
}
}
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 523e349e490c..0328a955a3e1 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1648,7 +1648,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const
case ID_BROWSER_CUT:
{
CellControllerRef xCurrentController = getBrowserView()->getVclControl()->Controller();
- if (xCurrentController.Is() && xCurrentController->ISA(EditCellController))
+ if (xCurrentController.Is() && dynamic_cast< EditCellController* >(&xCurrentController))
{
Edit& rEdit = (Edit&)xCurrentController->GetWindow();
sal_Bool bHasLen = (rEdit.GetSelection().Len() != 0);
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 7d3b7a07f912..d432db22a454 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -1665,7 +1665,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt )
ActivateCell();
CellControllerRef xCurrentController = Controller();
- if (!xCurrentController.Is() || !xCurrentController->ISA(EditCellController))
+ if (!xCurrentController.Is() || !dynamic_cast< EditCellController* >(&xCurrentController))
return DND_ACTION_NONE;
Edit& rEdit = (Edit&)xCurrentController->GetWindow();
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index b45415ffe4d7..5ec8ec311566 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -195,7 +195,7 @@ DBG_NAME(OConnectionHelper)
DBG_CTOR(OConnectionHelper,NULL);
// extract the datasource type collection from the item set
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rCoreAttrs.GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( _rCoreAttrs.GetItem(DSID_TYPECOLLECTION));
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
m_aPB_Connection.SetClickHdl(LINK(this, OConnectionHelper, OnBrowseConnections));
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 5b04ca2878d1..96be047c373c 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -245,7 +245,7 @@ DBG_NAME(OTextConnectionPageSetup)
if ( m_aETHostServer.GetText() != m_aETHostServer.GetSavedValue() )
{
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( _rSet.GetItem(DSID_TYPECOLLECTION));
::dbaccess::ODsnTypeCollection* pCollection = NULL;
if (pCollectionItem)
pCollection = pCollectionItem->getCollection();
@@ -352,7 +352,7 @@ DBG_NAME(OMySQLIntroPageSetup)
void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bSaveValue*/)
{
// show the "Connect directly" option only if the driver is installed
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( _rSet.GetItem(DSID_TYPECOLLECTION));
bool bHasMySQLNative = ( pCollectionItem != NULL ) && pCollectionItem->getCollection()->hasDriver( "sdbc:mysqlc:" );
if ( bHasMySQLNative )
m_aRB_NATIVEDatabase.Show();
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 5d8fe8ba07dc..0d4b3bf8baa1 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -80,6 +80,8 @@
#include <algorithm>
#include <functional>
+#include <typeinfo>
+
//.........................................................................
namespace dbaui
{
@@ -100,7 +102,7 @@ using namespace com::sun::star::frame;
//-------------------------------------------------------------------------
namespace
{
- sal_Bool implCheckItemType( SfxItemSet& _rSet, const sal_uInt16 _nId, const TypeId _nExpectedItemType )
+ sal_Bool implCheckItemType( SfxItemSet& _rSet, const sal_uInt16 _nId, const std::type_info& _nExpectedItemType )
{
sal_Bool bCorrectType = sal_False;
@@ -109,7 +111,7 @@ namespace
if ( pPool )
{
const SfxPoolItem& rDefItem = pPool->GetDefaultItem( _nId );
- bCorrectType = rDefItem.IsA( _nExpectedItemType );
+ bCorrectType = typeid(rDefItem) == _nExpectedItemType;
}
return bCorrectType;
}
@@ -914,11 +916,11 @@ Any ODbDataSourceAdministrationHelper::implTranslateProperty(const SfxPoolItem*
// translate the SfxPoolItem
Any aValue;
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, _pItem );
- const SfxBoolItem* pBoolItem = PTR_CAST( SfxBoolItem, _pItem );
- const OptionalBoolItem* pOptBoolItem = PTR_CAST( OptionalBoolItem, _pItem );
- const SfxInt32Item* pInt32Item = PTR_CAST( SfxInt32Item, _pItem );
- const OStringListItem* pStringListItem = PTR_CAST( OStringListItem, _pItem );
+ const SfxStringItem* pStringItem = dynamic_cast< const SfxStringItem* >( _pItem );
+ const SfxBoolItem* pBoolItem = dynamic_cast< const SfxBoolItem* >( _pItem );
+ const OptionalBoolItem* pOptBoolItem = dynamic_cast< const OptionalBoolItem* >( _pItem );
+ const SfxInt32Item* pInt32Item = dynamic_cast< const SfxInt32Item* >( _pItem );
+ const OStringListItem* pStringListItem = dynamic_cast< const OStringListItem* >( _pItem );
if ( pStringItem )
{
@@ -986,7 +988,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
switch ( _rValue.getValueType().getTypeClass() )
{
case TypeClass_STRING:
- if ( implCheckItemType( _rSet, _nId, SfxStringItem::StaticType() ) )
+ if ( implCheckItemType( _rSet, _nId, typeid(SfxStringItem) ) )
{
::rtl::OUString sValue;
_rValue >>= sValue;
@@ -1003,13 +1005,13 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
break;
case TypeClass_BOOLEAN:
- if ( implCheckItemType( _rSet, _nId, SfxBoolItem::StaticType() ) )
+ if ( implCheckItemType( _rSet, _nId, typeid(SfxBoolItem) ) )
{
sal_Bool bVal = sal_False;
_rValue >>= bVal;
_rSet.Put(SfxBoolItem(_nId, bVal));
}
- else if ( implCheckItemType( _rSet, _nId, OptionalBoolItem::StaticType() ) )
+ else if ( implCheckItemType( _rSet, _nId, typeid(OptionalBoolItem) ) )
{
OptionalBoolItem aItem( _nId );
if ( _rValue.hasValue() )
@@ -1033,7 +1035,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
break;
case TypeClass_LONG:
- if ( implCheckItemType( _rSet, _nId, SfxInt32Item::StaticType() ) )
+ if ( implCheckItemType( _rSet, _nId, typeid(SfxInt32Item) ) )
{
sal_Int32 nValue = 0;
_rValue >>= nValue;
@@ -1050,7 +1052,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
break;
case TypeClass_SEQUENCE:
- if ( implCheckItemType( _rSet, _nId, OStringListItem::StaticType() ) )
+ if ( implCheckItemType( _rSet, _nId, typeid(OStringListItem) ) )
{
// determine the element type
TypeDescription aTD(_rValue.getValueType());
@@ -1181,8 +1183,6 @@ void ODbDataSourceAdministrationHelper::setDataSourceOrName( const Any& _rDataSo
//=========================================================================
//= DbuTypeCollectionItem
//=========================================================================
-TYPEINIT1(DbuTypeCollectionItem, SfxPoolItem);
-//-------------------------------------------------------------------------
DbuTypeCollectionItem::DbuTypeCollectionItem(sal_Int16 _nWhich, ::dbaccess::ODsnTypeCollection* _pCollection)
:SfxPoolItem(_nWhich)
,m_pCollection(_pCollection)
@@ -1199,7 +1199,7 @@ DbuTypeCollectionItem::DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSour
//-------------------------------------------------------------------------
int DbuTypeCollectionItem::operator==(const SfxPoolItem& _rItem) const
{
- DbuTypeCollectionItem* pCompare = PTR_CAST(DbuTypeCollectionItem, &_rItem);
+ const DbuTypeCollectionItem* pCompare = dynamic_cast< const DbuTypeCollectionItem* >( &_rItem);
return pCompare && (pCompare->getCollection() == getCollection());
}
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 8903df59006e..b63fd5ef1898 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -119,7 +119,7 @@ namespace dbaui
// check whether this must be a tristate check box
const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId );
- if ( rItem.ISA( OptionalBoolItem ) )
+ if ( dynamic_cast< const OptionalBoolItem* >(&rItem) )
(*setting->ppControl)->EnableTriState( sal_True );
}
}
@@ -300,13 +300,13 @@ namespace dbaui
::boost::optional< bool > aValue;
SFX_ITEMSET_GET( _rSet, pItem, SfxPoolItem, setting->nItemId, sal_True );
- if ( pItem->ISA( SfxBoolItem ) )
+ if ( dynamic_cast< const SfxBoolItem* >(pItem) )
{
- aValue.reset( PTR_CAST( SfxBoolItem, pItem )->GetValue() );
+ aValue.reset( dynamic_cast< const SfxBoolItem* >( pItem )->GetValue() );
}
- else if ( pItem->ISA( OptionalBoolItem ) )
+ else if ( dynamic_cast< const OptionalBoolItem* >(pItem) )
{
- aValue = PTR_CAST( OptionalBoolItem, pItem )->GetFullValue();
+ aValue = dynamic_cast< const OptionalBoolItem* >( pItem )->GetFullValue();
}
else
DBG_ERROR( "SpecialSettingsPage::implInitControls: unknown boolean item type!" );
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 33409ed6fd19..45c44d6539d2 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -135,7 +135,7 @@ void ODbAdminDialog::impl_selectDataSource(const ::com::sun::star::uno::Any& _aD
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
impl_resetPages( xDatasource );
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( getOutputSet()->GetItem(DSID_TYPECOLLECTION));
::dbaccess::ODsnTypeCollection* pCollection = pCollectionItem->getCollection();
::dbaccess::DATASOURCE_TYPE eType = pCollection->determineType(getDatasourceType(*getOutputSet()));
@@ -239,7 +239,7 @@ void ODbAdminDialog::impl_resetPages(const Reference< XPropertySet >& _rxDatasou
// special case: MySQL Native does not have the generic PAGE_CONNECTION page
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, getOutputSet()->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( getOutputSet()->GetItem(DSID_TYPECOLLECTION));
::dbaccess::ODsnTypeCollection* pCollection = pCollectionItem->getCollection();
if ( pCollection->determineType(getDatasourceType( *pExampleSet )) == ::dbaccess::DST_MYSQL_NATIVE )
{
diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index 859b57dc2bca..fd1be12a2ec4 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -148,7 +148,7 @@ ODbTypeWizDialog::ODbTypeWizDialog(Window* _pParent
m_pHelp->SetUniqueId(UID_DBWIZ_HELP);
// no local resources needed anymore
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _pItems->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( _pItems->GetItem(DSID_TYPECOLLECTION));
m_pCollection = pCollectionItem->getCollection();
FreeResource();
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 3ebb4d2c6d5d..6d232be8c4b3 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -274,7 +274,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent
m_sWorkPath = SvtPathOptions().GetWorkPath();
pFinalPage = NULL;
// extract the datasource type collection from the item set
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _pItems->GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( _pItems->GetItem(DSID_TYPECOLLECTION));
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
diff --git a/dbaccess/source/ui/dlg/dsnItem.hxx b/dbaccess/source/ui/dlg/dsnItem.hxx
index 6879a221b59b..df5b5e7c97fa 100644
--- a/dbaccess/source/ui/dlg/dsnItem.hxx
+++ b/dbaccess/source/ui/dlg/dsnItem.hxx
@@ -48,7 +48,6 @@ namespace dbaui
::dbaccess::ODsnTypeCollection* m_pCollection;
public:
- TYPEINFO();
DbuTypeCollectionItem(sal_Int16 nWhich = 0, ::dbaccess::ODsnTypeCollection* _pCollection = NULL);
DbuTypeCollectionItem(const DbuTypeCollectionItem& _rSource);
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 4855457cfe97..333fc98a844e 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -92,7 +92,7 @@ namespace dbaui
// and remember the respective DSN prefixes
FreeResource();
// extract the datasource type collection from the item set
- DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rItems.GetItem(DSID_TYPECOLLECTION));
+ const DbuTypeCollectionItem* pCollectionItem = dynamic_cast< const DbuTypeCollectionItem* >( _rItems.GetItem(DSID_TYPECOLLECTION));
if (pCollectionItem)
m_pCollection = pCollectionItem->getCollection();
DBG_ASSERT(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !");
diff --git a/dbaccess/source/ui/dlg/optionalboolitem.cxx b/dbaccess/source/ui/dlg/optionalboolitem.cxx
index 6f34f58c5820..741fef01b61d 100644
--- a/dbaccess/source/ui/dlg/optionalboolitem.cxx
+++ b/dbaccess/source/ui/dlg/optionalboolitem.cxx
@@ -34,8 +34,6 @@ namespace dbaui
//====================================================================
//= OptionalBoolItem
//====================================================================
- TYPEINIT1( OptionalBoolItem, SfxPoolItem );
- //--------------------------------------------------------------------
OptionalBoolItem::OptionalBoolItem( sal_Int16 _nWhich )
:SfxPoolItem( _nWhich )
,m_aValue()
@@ -52,7 +50,7 @@ namespace dbaui
//--------------------------------------------------------------------
int OptionalBoolItem::operator==( const SfxPoolItem& _rItem ) const
{
- const OptionalBoolItem* pCompare = PTR_CAST( OptionalBoolItem, &_rItem );
+ const OptionalBoolItem* pCompare = dynamic_cast< const OptionalBoolItem* >( &_rItem );
if ( !pCompare )
return 0;
diff --git a/dbaccess/source/ui/dlg/optionalboolitem.hxx b/dbaccess/source/ui/dlg/optionalboolitem.hxx
index c578b1d71db5..85b0de756850 100644
--- a/dbaccess/source/ui/dlg/optionalboolitem.hxx
+++ b/dbaccess/source/ui/dlg/optionalboolitem.hxx
@@ -41,7 +41,6 @@ namespace dbaui
::boost::optional< bool > m_aValue;
public:
- TYPEINFO();
OptionalBoolItem( sal_Int16 nWhich );
OptionalBoolItem( const OptionalBoolItem& _rSource );
diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx
index 6c817e6f8bac..3cc2c961e65d 100644
--- a/dbaccess/source/ui/inc/GeneralUndo.hxx
+++ b/dbaccess/source/ui/inc/GeneralUndo.hxx
@@ -44,7 +44,6 @@ namespace dbaui
String m_strComment; // undo, redo comment
public:
- TYPEINFO();
OCommentUndoAction(sal_uInt16 nCommentID) { m_strComment = String(ModuleRes(nCommentID)); }
virtual UniString GetComment() const { return m_strComment; }
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index 05dc0fe1ff39..629a2ef0ff67 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -32,9 +32,6 @@
#ifndef _SV_SCRBAR_HXX
#include <vcl/scrbar.hxx>
#endif
-#ifndef _RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
#ifndef _TRANSFER_HXX
#include <svtools/transfer.hxx>
#endif
diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx
index a1bb90e54ddf..97ec56bbdbec 100644
--- a/dbaccess/source/ui/inc/TableConnection.hxx
+++ b/dbaccess/source/ui/inc/TableConnection.hxx
@@ -36,9 +36,6 @@
#ifndef _SV_WINDOW_HXX
#include <vcl/window.hxx>
#endif
-#ifndef _RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
#include <com/sun/star/uno/Reference.h>
#endif
diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx
index 1e04b040381d..fa04fe270906 100644
--- a/dbaccess/source/ui/inc/TableConnectionData.hxx
+++ b/dbaccess/source/ui/inc/TableConnectionData.hxx
@@ -28,9 +28,6 @@
#endif
#include "TableWindowData.hxx"
#include <vector>
-#ifndef _RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
#ifndef _STRING_HXX
#include <tools/string.hxx>
#endif
diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx
index 1a9033a5559a..aa37941f2012 100644
--- a/dbaccess/source/ui/inc/TableWindow.hxx
+++ b/dbaccess/source/ui/inc/TableWindow.hxx
@@ -26,7 +26,6 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include "TableWindowTitle.hxx"
-#include <tools/rtti.hxx>
#include <rtl/ref.hxx>
#include "TableWindowData.hxx"
#include <vector>
diff --git a/dbaccess/source/ui/inc/propertysetitem.hxx b/dbaccess/source/ui/inc/propertysetitem.hxx
index d8422be60250..b0d17a74fb28 100644
--- a/dbaccess/source/ui/inc/propertysetitem.hxx
+++ b/dbaccess/source/ui/inc/propertysetitem.hxx
@@ -46,7 +46,6 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xSet;
public:
- TYPEINFO();
OPropertySetItem(sal_Int16 nWhich);
OPropertySetItem(sal_Int16 nWhich,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxSet);
diff --git a/dbaccess/source/ui/inc/stringlistitem.hxx b/dbaccess/source/ui/inc/stringlistitem.hxx
index f4b03e0fe21c..7fb664b7d2fb 100644
--- a/dbaccess/source/ui/inc/stringlistitem.hxx
+++ b/dbaccess/source/ui/inc/stringlistitem.hxx
@@ -50,7 +50,6 @@ class OStringListItem : public SfxPoolItem
::com::sun::star::uno::Sequence< ::rtl::OUString > m_aList;
public:
- TYPEINFO();
OStringListItem(sal_Int16 nWhich, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rList);
OStringListItem(const OStringListItem& _rSource);
diff --git a/dbaccess/source/ui/misc/propertysetitem.cxx b/dbaccess/source/ui/misc/propertysetitem.cxx
index 4d02f747c7d4..f4b72f08a900 100644
--- a/dbaccess/source/ui/misc/propertysetitem.cxx
+++ b/dbaccess/source/ui/misc/propertysetitem.cxx
@@ -39,8 +39,6 @@ namespace dbaui
//=========================================================================
//= OPropertySetItem
//=========================================================================
- TYPEINIT1(OPropertySetItem, SfxPoolItem);
- //-------------------------------------------------------------------------
OPropertySetItem::OPropertySetItem(sal_Int16 _nWhich)
:SfxPoolItem(_nWhich)
{
@@ -63,7 +61,7 @@ namespace dbaui
//-------------------------------------------------------------------------
int OPropertySetItem::operator==(const SfxPoolItem& _rItem) const
{
- const OPropertySetItem* pCompare = PTR_CAST(OPropertySetItem, &_rItem);
+ const OPropertySetItem* pCompare = dynamic_cast< const OPropertySetItem* >( &_rItem);
if ((!pCompare) || (pCompare->m_xSet.get() != m_xSet.get()))
return 0;
diff --git a/dbaccess/source/ui/misc/stringlistitem.cxx b/dbaccess/source/ui/misc/stringlistitem.cxx
index 0a3c38b471bb..fc7b97d704a5 100644
--- a/dbaccess/source/ui/misc/stringlistitem.cxx
+++ b/dbaccess/source/ui/misc/stringlistitem.cxx
@@ -38,8 +38,6 @@ using namespace ::com::sun::star::uno;
//=========================================================================
//= OStringListItem
//=========================================================================
-TYPEINIT1(OStringListItem, SfxPoolItem);
-//-------------------------------------------------------------------------
OStringListItem::OStringListItem(sal_Int16 _nWhich, const Sequence< ::rtl::OUString >& _rList)
:SfxPoolItem(_nWhich)
,m_aList(_rList)
@@ -56,7 +54,7 @@ OStringListItem::OStringListItem(const OStringListItem& _rSource)
//-------------------------------------------------------------------------
int OStringListItem::operator==(const SfxPoolItem& _rItem) const
{
- const OStringListItem* pCompare = PTR_CAST(OStringListItem, &_rItem);
+ const OStringListItem* pCompare = dynamic_cast< const OStringListItem* >( &_rItem);
if ((!pCompare) || (pCompare->m_aList.getLength() != m_aList.getLength()))
return 0;
diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.hxx b/dbaccess/source/ui/querydesign/QTableConnectionData.hxx
index 617587b2ee4f..5c207a2edf24 100644
--- a/dbaccess/source/ui/querydesign/QTableConnectionData.hxx
+++ b/dbaccess/source/ui/querydesign/QTableConnectionData.hxx
@@ -32,9 +32,6 @@
#ifndef DBAUI_ENUMTYPES_HXX
#include "QEnumTypes.hxx"
#endif
-#ifndef _RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
//#ifndef DBAUI_QUERYCONTROLLER_HXX
//#include "querycontroller.hxx"
//#endif
diff --git a/dbaccess/source/ui/querydesign/QTableWindow.hxx b/dbaccess/source/ui/querydesign/QTableWindow.hxx
index e0dbb3b64e7e..edbb8ed23801 100644
--- a/dbaccess/source/ui/querydesign/QTableWindow.hxx
+++ b/dbaccess/source/ui/querydesign/QTableWindow.hxx
@@ -32,9 +32,6 @@
#ifndef DBAUI_TABLEFIELDDESC_HXX
#include "TableFieldDescription.hxx"
#endif
-#ifndef _RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
namespace dbaui
{
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index b3a0da896cb8..d72a1c002ca3 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -125,11 +125,6 @@ namespace dbaui
}
//==============================================================================
-// TYPEINIT1(OTableEditorCtrl, DBView);
-DBG_NAME(OTableEditorCtrl)
-
-//==============================================================================
-
#define HANDLE_ID 0
// default Spaltenbreiten
@@ -151,7 +146,10 @@ DBG_NAME(OTableEditorCtrl)
//==================================================================
+
DBG_NAME(ClipboardInvalidator)
+DBG_NAME(OTableEditorCtrl)
+
//------------------------------------------------------------------
OTableEditorCtrl::ClipboardInvalidator::ClipboardInvalidator(sal_uLong nTimeout,OTableEditorCtrl* _pOwner)
: m_pOwner(_pOwner)
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx
index b4f14b684c34..6bc6fa6c8b7d 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx
@@ -139,7 +139,6 @@ namespace dbaui
DECL_LINK(ControlPreNotifyHdl, NotifyEvent*);
public:
- // TYPEINFO();
OTableEditorCtrl(Window* pParentWin);
virtual ~OTableEditorCtrl();
virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol);
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx
index 4189638cc04d..a1dc0f32202e 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.cxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx
@@ -54,16 +54,6 @@
using namespace dbaui;
using namespace ::svt;
-TYPEINIT1( OCommentUndoAction, SfxUndoAction );
-TYPEINIT1( OTableDesignUndoAct, OCommentUndoAction );
-TYPEINIT1( OTableEditorUndoAct, OTableDesignUndoAct );
-TYPEINIT1( OTableDesignCellUndoAct, OTableDesignUndoAct );
-TYPEINIT1( OTableEditorTypeSelUndoAct, OTableEditorUndoAct );
-TYPEINIT1( OTableEditorDelUndoAct, OTableEditorUndoAct );
-TYPEINIT1( OTableEditorInsUndoAct, OTableEditorUndoAct );
-TYPEINIT1( OTableEditorInsNewUndoAct, OTableEditorUndoAct );
-TYPEINIT1( OPrimKeyUndoAct, OTableEditorUndoAct );
-
//==============================================================================
// class OTableDesignUndoAct
//==============================================================================
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx
index 8bf2be50891c..d945454435a8 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.hxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx
@@ -52,7 +52,6 @@ namespace dbaui
virtual void Undo();
virtual void Redo();
public:
- TYPEINFO();
OTableDesignUndoAct( OTableRowView* pOwner ,sal_uInt16 nCommentID);
virtual ~OTableDesignUndoAct();
};
@@ -65,7 +64,6 @@ namespace dbaui
OTableEditorCtrl* pTabEdCtrl;
public:
- TYPEINFO();
OTableEditorUndoAct( OTableEditorCtrl* pOwner,sal_uInt16 nCommentID );
virtual ~OTableEditorUndoAct();
};
@@ -83,7 +81,6 @@ namespace dbaui
virtual void Undo();
virtual void Redo();
public:
- TYPEINFO();
OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, sal_uInt16 nColumn );
virtual ~OTableDesignCellUndoAct();
};
@@ -101,7 +98,6 @@ namespace dbaui
virtual void Undo();
virtual void Redo();
public:
- TYPEINFO();
OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType );
virtual ~OTableEditorTypeSelUndoAct();
};
@@ -115,7 +111,6 @@ namespace dbaui
virtual void Undo();
virtual void Redo();
public:
- TYPEINFO();
OTableEditorDelUndoAct( OTableEditorCtrl* pOwner );
virtual ~OTableEditorDelUndoAct();
};
@@ -130,7 +125,6 @@ namespace dbaui
virtual void Undo();
virtual void Redo();
public:
- TYPEINFO();
OTableEditorInsUndoAct( OTableEditorCtrl* pOwner,
long nInsertPosition,
const ::std::vector< ::boost::shared_ptr<OTableRow> >& _vInsertedRows);
@@ -147,7 +141,6 @@ namespace dbaui
virtual void Undo();
virtual void Redo();
public:
- TYPEINFO();
OTableEditorInsNewUndoAct( OTableEditorCtrl* pOwner, long nInsertPosition, long nInsertedRows );
virtual ~OTableEditorInsNewUndoAct();
};
@@ -164,7 +157,6 @@ namespace dbaui
virtual void Undo();
virtual void Redo();
public:
- TYPEINFO();
OPrimKeyUndoAct( OTableEditorCtrl* pOwner, MultiSelection aDeletedKeys, MultiSelection aInsertedKeys );
virtual ~OPrimKeyUndoAct();
};
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 485fd7bce602..6791ebebff07 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -47,6 +47,7 @@
#include "osl/file.hxx"
#include "rtl/process.h"
#include "tools/getprocessworkingdir.hxx"
+#include <string.h>
using namespace vos;
using namespace rtl;
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
index b3d5cb2d952e..1ca3616621a1 100644
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
+++ b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
@@ -53,9 +53,11 @@ AutoScrollEdit::~AutoScrollEdit()
void AutoScrollEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA( TYPE(TextHint) ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
- sal_uLong nId = ((const TextHint&)rHint).GetId();
+ sal_uLong nId = pTextHint->GetId();
if ( nId == TEXT_HINT_VIEWSCROLLED )
{
ScrollBar* pScroll = GetVScrollBar();
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index 1848b639f9ac..676fa5049f75 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -161,10 +161,12 @@ sal_Bool LicenseView::IsEndReached() const
void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA( TYPE(TextHint) ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
sal_Bool bLastVal = EndReached();
- sal_uLong nId = ((const TextHint&)rHint).GetId();
+ sal_uLong nId = pTextHint->GetId();
if ( nId == TEXT_HINT_PARAINSERTED )
{
diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx
index 02781c514a70..de0a57722b45 100644
--- a/desktop/source/migration/services/wordbookmigration.cxx
+++ b/desktop/source/migration/services/wordbookmigration.cxx
@@ -27,6 +27,7 @@
#include <tools/urlobj.hxx>
#include <unotools/bootstrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <string.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/desktop/source/splash/services_spl.cxx b/desktop/source/splash/services_spl.cxx
index 817d7d159d02..32a30fb94a4f 100644
--- a/desktop/source/splash/services_spl.cxx
+++ b/desktop/source/splash/services_spl.cxx
@@ -29,6 +29,7 @@
#include <uno/environment.h>
#include <cppuhelper/factory.hxx>
#include <unotools/configmgr.hxx>
+#include <string.h>
#include "splash.hxx"
#include "firststart.hxx"
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 7279af460e8c..00b1b6eb5f6f 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -168,7 +168,8 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/processor2d/linegeometryextractor2d \
drawinglayer/source/processor2d/hittestprocessor2d \
drawinglayer/source/processor2d/textaspolygonextractor2d \
- drawinglayer/source/processor2d/objectinfoextractor2d \
+ drawinglayer/source/processor2d/hairlineextractor2d \
+ drawinglayer/source/processor2d/objectinfoextractor2d \
drawinglayer/source/processor3d/baseprocessor3d \
drawinglayer/source/processor3d/cutfindprocessor3d \
drawinglayer/source/processor3d/defaultprocessor3d \
diff --git a/drawinglayer/Package_inc.mk b/drawinglayer/Package_inc.mk
index e27a64f3d0fb..a6993c625269 100644
--- a/drawinglayer/Package_inc.mk
+++ b/drawinglayer/Package_inc.mk
@@ -109,6 +109,7 @@ $(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/linegeometryextractor2d.hxx,drawinglayer/processor2d/linegeometryextractor2d.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/hittestprocessor2d.hxx,drawinglayer/processor2d/hittestprocessor2d.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx,drawinglayer/processor2d/textaspolygonextractor2d.hxx))
+$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/hairlineextractor2d.hxx,drawinglayer/processor2d/hairlineextractor2d.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor2d/objectinfoextractor2d.hxx,drawinglayer/processor2d/objectinfoextractor2d.hxx))
$(eval $(call gb_Package_add_file,drawinglayer_inc,inc/drawinglayer/processor3d/baseprocessor3d.hxx,drawinglayer/processor3d/baseprocessor3d.hxx))
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
index f672a707aae8..ddf80c5daa9f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/animatedprimitive2d.hxx
@@ -68,7 +68,7 @@ namespace drawinglayer
/** flag if this is a text or graphic animation. Necessary since SdrViews need to differentiate
between both types if they are on/off
*/
- unsigned mbIsTextAnimation : 1;
+ bool mbIsTextAnimation : 1;
public:
/// constructor
@@ -85,9 +85,6 @@ namespace drawinglayer
bool isTextAnimation() const { return mbIsTextAnimation; }
bool isGraphicAnimation() const { return !isTextAnimation(); }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
index ebae011a309c..bd974f2853c7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
@@ -67,9 +67,6 @@ namespace drawinglayer
/// data read access
const basegfx::BColor& getBColor() const { return maBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get B2Drange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
index b907d7536012..bd3b7575b38d 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -150,14 +150,6 @@ namespace drawinglayer
BasePrimitive2D();
virtual ~BasePrimitive2D();
- /** the ==operator is mainly needed to allow testing newly-created primitives against their last
- incarnation which buffers/holds the made decompositions. The default implementation
- uses getPrimitive2DID()-calls to test if it's the same ID at last. Overloaded implementation are then
- based on this implementation
- */
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
- bool operator!=( const BasePrimitive2D& rPrimitive ) const { return !operator==(rPrimitive); }
-
/// The default implementation will use getDecomposition results to create the range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -275,14 +267,6 @@ namespace drawinglayer
/// get B2DRange from a given Primitive2DSequence
basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DSequence(const Primitive2DSequence& rCandidate, const geometry::ViewInformation2D& aViewInformation);
- /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
- and using compare operator
- */
- bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA, const Primitive2DReference& rB);
-
- /// compare two Primitive2DReferences for equality, uses arePrimitive2DReferencesEqual internally
- bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB);
-
/// concatenate sequence
void DRAWINGLAYER_DLLPUBLIC appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource);
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
index ef7d3dadbd19..69672b1beaff 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/bitmapprimitive2d.hxx
@@ -64,9 +64,6 @@ namespace drawinglayer
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
index 7127f99375f2..71cbd3154267 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
@@ -66,8 +66,8 @@ namespace drawinglayer
/// bitfield
/// flags to influence inside/outside creation
- unsigned mbCreateInside : 1;
- unsigned mbCreateOutside : 1;
+ bool mbCreateInside : 1;
+ bool mbCreateOutside : 1;
/// local helpers
double getCorrectedLeftWidth() const
@@ -144,9 +144,6 @@ namespace drawinglayer
bool getCreateOutside() const { return mbCreateOutside; }
const basegfx::BColor& getRGBColor() const { return maRGBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
index 6c2c9ab4dc0b..45b2caae7bb0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/controlprimitive2d.hxx
@@ -94,9 +94,6 @@ namespace drawinglayer
*/
const com::sun::star::uno::Reference< com::sun::star::awt::XControl >& getXControl() const;
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/cropprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/cropprimitive2d.hxx
index 86b218d2665a..1c5aed21b2a7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/cropprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/cropprimitive2d.hxx
@@ -85,9 +85,6 @@ namespace drawinglayer
double getCropRight() const { return mfCropRight; }
double getCropBottom() const { return mfCropBottom; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// local decomposition
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
index c9dd568f21f2..3a4c37faed82 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
@@ -65,9 +65,6 @@ namespace drawinglayer
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
index f5e663d038a4..c4562c6c268a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
@@ -62,12 +62,6 @@ namespace drawinglayer
/// data read access
const BitmapEx& getBitmapEx() const { return maBitmapEx; }
- /// compare operator
- bool operator==(const DiscreteShadow& rCompare) const
- {
- return getBitmapEx() == rCompare.getBitmapEx();
- }
-
/// helper accesses which create on-demand needed segments
const BitmapEx& getTopLeft() const;
const BitmapEx& getTop() const;
@@ -105,9 +99,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const DiscreteShadow& getDiscreteShadow() const { return maDiscreteShadow; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
index e39561e5a3c2..fe7d2c00cff7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx
@@ -79,7 +79,7 @@ namespace drawinglayer
/** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
are created in maShadowPrimitives
*/
- unsigned mbShadow3DChecked : 1;
+ bool mbShadow3DChecked : 1;
/// private helpers
bool impGetShadow3D(const geometry::ViewInformation2D& rViewInformation) const;
@@ -106,9 +106,6 @@ namespace drawinglayer
double getShadowSlant() const { return mfShadowSlant; }
const basegfx::B3DRange& getScene3DRange() const { return maScene3DRange; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx
index 9ad08e1ba2e4..95a8433cc4a1 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/epsprimitive2d.hxx
@@ -65,9 +65,6 @@ namespace drawinglayer
const GfxLink& getGfxLink() const { return maGfxLink; }
const GDIMetaFile& getMetaFile() const { return maMetaFile; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get B2Drange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
index b937dee8b701..9bd066e56e7f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
@@ -94,9 +94,6 @@ namespace drawinglayer
const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgraphicprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgraphicprimitive2d.hxx
index 6658e6d01b43..aad001ff31f5 100755
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillgraphicprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgraphicprimitive2d.hxx
@@ -72,9 +72,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
const attribute::FillGraphicAttribute& getFillGraphic() const { return maFillGraphic; }
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 9fbc68b0a54e..70e5d707691d 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -78,9 +78,6 @@ namespace drawinglayer
const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
const basegfx::BColor& getBColor() const { return maBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
index 6ce406cca571..04f1f88f3548 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/graphicprimitive2d.hxx
@@ -82,9 +82,6 @@ namespace drawinglayer
const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
bool isTransparent() const;
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
index 0bbaecd19f55..e7f9655aa97e 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
@@ -100,9 +100,6 @@ namespace drawinglayer
const basegfx::BColor& getBColor() const { return maBColor; }
const BitmapEx& getCrossMarker() const { return maCrossMarker; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get 2d range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
index 6082c66f011c..947d9b050c43 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
@@ -79,9 +79,6 @@ namespace drawinglayer
/// data read access
const Primitive2DSequence& getChildren() const { return maChildren; }
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
/// local decomposition. Implementation will just return children
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
index e9cd13481226..d3d751c6d7a1 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx
@@ -98,9 +98,6 @@ namespace drawinglayer
const basegfx::BColor& getRGBColB() const { return maRGBColB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
index 16f06bfaece6..a93d48f0eb64 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
@@ -72,9 +72,6 @@ namespace drawinglayer
const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
const BitmapEx& getMarker() const { return maMarker; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
index 0bcf13739c46..689038525e4d 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx
@@ -63,9 +63,6 @@ namespace drawinglayer
/// data read access
const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
index 207772f7b7cc..9b03deb032da 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/mediaprimitive2d.hxx
@@ -77,9 +77,6 @@ namespace drawinglayer
const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
sal_uInt32 getDiscreteBorder() const { return mnDiscreteBorder; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
index 2354171c5ff3..e18bc9062c70 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
@@ -78,9 +78,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getTransform() const { return maMetaFileTransform; }
const GDIMetaFile& getMetaFile() const { return maMetaFile; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
index 98d1295fa1ac..1b011d5b5f25 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
@@ -66,9 +66,6 @@ namespace drawinglayer
/// data read access
const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx
index 2b7ab931fbc9..ec587d9d96a3 100755
--- a/drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx
@@ -62,9 +62,6 @@ namespace drawinglayer
const rtl::OUString& getTitle() const { return maTitle; }
const rtl::OUString& getDesc() const { return maDesc; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
index 5cd58c8b0bbd..dc67e683398d 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/pagepreviewprimitive2d.hxx
@@ -64,7 +64,7 @@ namespace drawinglayer
/// bitfield
/// flag to allow keeping the aspect ratio
- unsigned mbKeepAspectRatio : 1;
+ bool mbKeepAspectRatio : 1;
protected:
/// local decomposition. Implementation will just return children
@@ -88,9 +88,6 @@ namespace drawinglayer
double getContentHeight() const { return mfContentHeight; }
bool getKeepAspectRatio() const { return mbKeepAspectRatio; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// own getB2DRange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/patternfillprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/patternfillprimitive2d.hxx
index 5d760e2e0d1d..79417b0ae90e 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/patternfillprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/patternfillprimitive2d.hxx
@@ -64,9 +64,6 @@ namespace drawinglayer
const Primitive2DSequence& getChildren() const { return maChildren; }
const basegfx::B2DRange& getReferenceRange() const { return maReferenceRange; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
index 705802c09a7a..c3b20eb9cf52 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
@@ -67,9 +67,6 @@ namespace drawinglayer
const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; }
const basegfx::BColor& getRGBColor() const { return maRGBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
index 239a3b150e29..629fc721826b 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -67,9 +67,6 @@ namespace drawinglayer
const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -129,9 +126,6 @@ namespace drawinglayer
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -190,9 +184,6 @@ namespace drawinglayer
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -245,9 +236,6 @@ namespace drawinglayer
double getWaveWidth() const { return mfWaveWidth; }
double getWaveHeight() const { return mfWaveHeight; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -301,9 +289,6 @@ namespace drawinglayer
const attribute::LineStartEndAttribute& getStart() const { return maStart; }
const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index 1fd133d3f629..e84084b061a0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -69,9 +69,6 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -125,9 +122,6 @@ namespace drawinglayer
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -183,9 +177,6 @@ namespace drawinglayer
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -239,9 +230,6 @@ namespace drawinglayer
const attribute::LineStartEndAttribute& getStart() const { return maStart; }
const attribute::LineStartEndAttribute& getEnd() const { return maEnd; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -283,9 +271,6 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -331,9 +316,6 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
@@ -381,9 +363,6 @@ namespace drawinglayer
const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
@@ -426,9 +405,6 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
const attribute::FillGraphicAttribute& getFillGraphic() const { return maFillGraphic; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
index 1c1ed29ac9e8..ebd7a0e1b68e 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
@@ -81,7 +81,7 @@ namespace drawinglayer
/** flag if given 3D geometry is already cheched for shadow definitions and 2d shadows
are created in maShadowPrimitives
*/
- unsigned mbShadow3DChecked : 1;
+ bool mbShadow3DChecked : 1;
/// the last used NewDiscreteSize and NewUnitVisiblePart definitions for decomposition
double mfOldDiscreteSizeX;
@@ -140,9 +140,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
index 69f35673bc82..fd17d5a10e45 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/shadowprimitive2d.hxx
@@ -69,9 +69,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getShadowTransform() const { return maShadowTransform; }
const basegfx::BColor& getShadowColor() const { return maShadowColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
index dd0eff514172..28bde8ebdd95 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
@@ -57,13 +57,6 @@ namespace drawinglayer
const basegfx::BColor& getColor() const { return maColor; }
double getOpacity() const { return mfOpacity; }
- bool operator==(const SvgGradientEntry& rCompare) const
- {
- return (getOffset() == rCompare.getOffset()
- && getColor() == getColor()
- && getOpacity() == getOpacity());
- }
-
bool operator<(const SvgGradientEntry& rCompare) const
{
return getOffset() < rCompare.getOffset();
@@ -161,9 +154,6 @@ namespace drawinglayer
const basegfx::B2DPoint& getStart() const { return maStart; }
bool getUseUnitCoordinates() const { return mbUseUnitCoordinates; }
SpreadMethod getSpreadMethod() const { return maSpreadMethod; }
-
- /// compare operator
- virtual bool operator==(const SvgGradientHelper& rSvgGradientHelper) const;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -209,9 +199,6 @@ namespace drawinglayer
/// data read access
const basegfx::B2DPoint& getEnd() const { return maEnd; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -280,9 +267,6 @@ namespace drawinglayer
const basegfx::B2DPoint& getFocal() const { return maFocal; }
bool isFocalSet() const { return mbFocalSet; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -329,9 +313,6 @@ namespace drawinglayer
double getOffsetA() const { return mfOffsetA; }
double getOffsetB() const { return mfOffsetB; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
@@ -398,9 +379,6 @@ namespace drawinglayer
basegfx::B2DVector getTranslateA() const { if(mpTranslate) return mpTranslate->maTranslateA; return basegfx::B2DVector(); }
basegfx::B2DVector getTranslateB() const { if(mpTranslate) return mpTranslate->maTranslateB; return basegfx::B2DVector(); }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
index b0b08928d9e4..d98646638e1f 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx
@@ -65,11 +65,11 @@ namespace drawinglayer
TextRelief meTextRelief;
/// bitfield
- unsigned mbUnderlineAbove : 1;
- unsigned mbWordLineMode : 1;
- unsigned mbEmphasisMarkAbove : 1;
- unsigned mbEmphasisMarkBelow : 1;
- unsigned mbShadow : 1;
+ bool mbUnderlineAbove : 1;
+ bool mbWordLineMode : 1;
+ bool mbEmphasisMarkAbove : 1;
+ bool mbEmphasisMarkBelow : 1;
+ bool mbShadow : 1;
/// helper methods
void impCreateGeometryContent(
@@ -131,9 +131,6 @@ namespace drawinglayer
/// if a TextSimplePortionPrimitive2D would be suficcient
bool decoratedIsNeeded() const;
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
index 5c5d796360c1..740872924aa2 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/texteffectprimitive2d.hxx
@@ -84,9 +84,6 @@ namespace drawinglayer
double getDirection() const { return mfDirection; }
TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/** own get range implementation to solve more effective. Content is by definition displaced
by a fixed discrete unit, thus the contained geometry needs only once be asked for it's
own basegfx::B2DRange
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
index 22071729914d..6d6416be23dc 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
@@ -131,47 +131,57 @@ namespace drawinglayer
{
namespace primitive2d
{
+ /** TextHierarchyFieldPrimitive2D class
+
+ This primitive encapsulates text fields.
+ Also: This type uses a type enum to transport the encapsulated field
+ type. Also added is a String which is type-dependent. E.g. for URL
+ fields, it contains the URL.
+ */
+ class DRAWINGLAYER_DLLPUBLIC TextHierarchyFieldPrimitive2D : public GroupPrimitive2D
+ {
+ public:
/** FieldType definition */
enum FieldType
{
/** unspecified. If more info is needed for a FieldType,
create a new type and it's handling
+
+ maStringA and maStringB unused
*/
FIELD_TYPE_COMMON,
- /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling */
+ /** uses "FIELD_SEQ_BEGIN;PageField" -> special handling
+
+ maStringA and maStringB unused
+ */
FIELD_TYPE_PAGE,
- /** uses URL as string -> special handling */
+ /** uses URL as string -> special handling
+
+ In maStringA: URL
+ In maStringB: TargetFrame
+ */
FIELD_TYPE_URL
};
- /** TextHierarchyFieldPrimitive2D class
-
- This primitive encapsulates text fields.
- Also: This type uses a type enum to transport the encapsulated field
- type. Also added is a String which is type-dependent. E.g. for URL
- fields, it contains the URL.
- */
- class DRAWINGLAYER_DLLPUBLIC TextHierarchyFieldPrimitive2D : public GroupPrimitive2D
- {
private:
FieldType meType;
- rtl::OUString maString;
+ rtl::OUString maStringA;
+ rtl::OUString maStringB;
public:
/// constructor
TextHierarchyFieldPrimitive2D(
const Primitive2DSequence& rChildren,
const FieldType& rFieldType,
- const rtl::OUString& rString);
+ const rtl::OUString& rStringA = rtl::OUString(),
+ const rtl::OUString& rStringB = rtl::OUString());
/// data read access
FieldType getType() const { return meType; }
- const rtl::OUString& getString() const { return maString; }
-
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+ const rtl::OUString& getStringA() const { return maStringA; }
+ const rtl::OUString& getStringB() const { return maStringB; }
/// provide unique ID
DeclPrimitrive2DIDBlock()
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx
index c8982b3af19a..90095efbd906 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlineprimitive2d.hxx
@@ -71,9 +71,6 @@ namespace drawinglayer
TextLine getTextLine() const { return meTextLine; }
const basegfx::BColor& getLineColor() const { return maLineColor; }
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
index a9bbea65f16d..3a8e5d644812 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
@@ -155,9 +155,6 @@ namespace drawinglayer
const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
const basegfx::BColor& getFontColor() const { return maFontColor; }
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
index 62e00fd8ced3..33ddc22d29ec 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx
@@ -59,9 +59,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
double getWidth() const { return mfWidth; }
const basegfx::BColor& getFontColor() const { return maFontColor; }
-
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -98,9 +95,6 @@ namespace drawinglayer
const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; }
const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
@@ -139,9 +133,6 @@ namespace drawinglayer
double getOffset() const { return mfOffset; }
TextStrikeout getTextStrikeout() const { return meTextStrikeout; }
- /// compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
index 5a20b3ccc1d0..3e5843a52203 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/transformprimitive2d.hxx
@@ -68,9 +68,6 @@ namespace drawinglayer
/// data read access
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx
index cd05eeebc6de..9704b374cdf0 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx
@@ -73,9 +73,6 @@ namespace drawinglayer
/// data read access
const Primitive2DSequence& getTransparence() const { return maTransparence; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
index 9984f9e59b79..4e965800dfe2 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
@@ -55,9 +55,6 @@ namespace drawinglayer
/// data read access
double getTransparence() const { return mfTransparence; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// own getB2DRange implementation to include transparent geometries to BoundRect calculations
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
index c4431634d3a0..94218d2477df 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/wallpaperprimitive2d.hxx
@@ -71,9 +71,6 @@ namespace drawinglayer
const BitmapEx& getBitmapEx() const { return maBitmapEx ; }
WallpaperStyle getWallpaperStyle() const { return meWallpaperStyle; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// get B2Drange
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
index 80fbd578e775..d88b873a6bf8 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/wrongspellprimitive2d.hxx
@@ -79,9 +79,6 @@ namespace drawinglayer
double getStop() const { return mfStop; }
const basegfx::BColor& getColor() const { return maColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
index 4d10db16bada..85d9018ad2eb 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/baseprimitive3d.hxx
@@ -91,14 +91,6 @@ namespace drawinglayer
BasePrimitive3D();
virtual ~BasePrimitive3D();
- /** the ==operator is mainly needed to allow testing newly-created high level primitives against their last
- incarnation which buffers/holds the decompositionsThe default implementation
- uses getPrimitive3DID()-calls to test if it's the same ID at last. Overloaded implementation are then
- based on this implementation.
- */
- virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
- bool operator!=( const BasePrimitive3D& rPrimitive ) const { return !operator==(rPrimitive); }
-
/** This method is for places where using the C++ implementation directly is possible. The subprocessing
and range merging is more efficient when working directly on basegfx::B3DRange. The default implementation
will use getDecomposition results to create the range
@@ -192,14 +184,6 @@ namespace drawinglayer
/// get range3D from a given Primitive3DSequence
basegfx::B3DRange DRAWINGLAYER_DLLPUBLIC getB3DRangeFromPrimitive3DSequence(const Primitive3DSequence& rCandidate, const geometry::ViewInformation3D& aViewInformation);
- /** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
- and using compare operator
- */
- bool DRAWINGLAYER_DLLPUBLIC arePrimitive3DReferencesEqual(const Primitive3DReference& rA, const Primitive3DReference& rB);
-
- /// compare two Primitive3DReferences for equality, uses arePrimitive3DReferencesEqual internally
- bool DRAWINGLAYER_DLLPUBLIC arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB);
-
/// concatenate sequence
void DRAWINGLAYER_DLLPUBLIC appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource);
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
index 33cfbf1fdc18..3293dba21f09 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
@@ -65,9 +65,6 @@ namespace drawinglayer
/// data read access
Primitive3DSequence getChildren() const { return maChildren; }
- /// compare operator
- virtual bool operator==( const BasePrimitive3D& rPrimitive ) const;
-
/// local decomposition. Implementation will just return children
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
index e41213ee09a0..f80f5849ad4a 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
@@ -70,9 +70,6 @@ namespace drawinglayer
/// data read access
const attribute::FillHatchAttribute& getHatch() const { return maHatch; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// local decomposition.
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
index f26a7307a401..3a40734ffb09 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
@@ -56,9 +56,6 @@ namespace drawinglayer
/// data read access
const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive3DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
index 77ba6ca730b5..233085a0e02b 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polygonprimitive3d.hxx
@@ -64,9 +64,6 @@ namespace drawinglayer
const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; }
const basegfx::BColor& getBColor() const { return maBColor; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
@@ -121,9 +118,6 @@ namespace drawinglayer
const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive3DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
index b00b3b369722..70febb9aa72a 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polygontubeprimitive3d.hxx
@@ -90,9 +90,6 @@ namespace drawinglayer
basegfx::B2DLineJoin getLineJoin() const { return maLineJoin; }
com::sun::star::drawing::LineCap getLineCap() const { return maLineCap; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/** local decomposition. Use own buffering since we are not derived from
BufferedDecompositionPrimitive3D
*/
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
index d767989a913c..3f6518cb0bf6 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/polypolygonprimitive3d.hxx
@@ -53,7 +53,7 @@ namespace drawinglayer
attribute::MaterialAttribute3D maMaterial;
/// bitfield
- unsigned mbDoubleSided : 1;
+ bool mbDoubleSided : 1;
public:
/// constructor
@@ -67,9 +67,6 @@ namespace drawinglayer
const attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; }
bool getDoubleSided() const { return mbDoubleSided; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
index ed34d2d5d674..61a3906f71b5 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
@@ -53,9 +53,6 @@ namespace drawinglayer
const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
index 3cbf4f17343c..d4421a4bbccd 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
@@ -62,12 +62,12 @@ namespace drawinglayer
geometry::ViewInformation3D* mpLastRLGViewInformation;
/// bitfield
- unsigned mbSmoothNormals : 1; // Plane self
- unsigned mbSmoothHorizontalNormals : 1; // always
- unsigned mbSmoothLids : 1; // Front/back
- unsigned mbCharacterMode : 1;
- unsigned mbCloseFront : 1;
- unsigned mbCloseBack : 1;
+ bool mbSmoothNormals : 1; // Plane self
+ bool mbSmoothHorizontalNormals : 1; // always
+ bool mbSmoothLids : 1; // Front/back
+ bool mbCharacterMode : 1;
+ bool mbCloseFront : 1;
+ bool mbCloseBack : 1;
/// create slices
void impCreateSlices();
@@ -110,9 +110,6 @@ namespace drawinglayer
bool getCloseFront() const { return mbCloseFront; }
bool getCloseBack() const { return mbCloseBack; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
index 12f684cbb4d0..ac7f66a579e7 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
@@ -64,12 +64,12 @@ namespace drawinglayer
geometry::ViewInformation3D* mpLastRLGViewInformation;
/// bitfield
- unsigned mbSmoothNormals : 1; // Plane self
- unsigned mbSmoothHorizontalNormals : 1; // always
- unsigned mbSmoothLids : 1; // Front/back
- unsigned mbCharacterMode : 1;
- unsigned mbCloseFront : 1;
- unsigned mbCloseBack : 1;
+ bool mbSmoothNormals : 1; // Plane self
+ bool mbSmoothHorizontalNormals : 1; // always
+ bool mbSmoothLids : 1; // Front/back
+ bool mbCharacterMode : 1;
+ bool mbCloseFront : 1;
+ bool mbCloseBack : 1;
/// create slices
void impCreateSlices();
@@ -128,9 +128,6 @@ namespace drawinglayer
bool getCloseFront() const { return mbCloseFront; }
bool getCloseBack() const { return mbCloseBack; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
index 7b347c290707..6f16eb23d457 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
@@ -65,9 +65,6 @@ namespace drawinglayer
/// data access
const basegfx::B3DPolyPolygon& getPolyPolygon3D() const { return maPolyPolygon3D; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
index 3c105cffd692..c851b8069166 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
@@ -77,9 +77,6 @@ namespace drawinglayer
const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
const attribute::SdrLineFillShadowAttribute3D& getSdrLFSAttribute() const { return maSdrLFSAttribute; }
const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; }
-
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
};
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
index be325a64eea8..b51929fd1403 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
@@ -64,9 +64,6 @@ namespace drawinglayer
sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
index 77abf0603af4..775dab5a4bf0 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/shadowprimitive3d.hxx
@@ -54,7 +54,7 @@ namespace drawinglayer
double mfShadowTransparence;
/// bitfield
- unsigned mbShadow3D : 1;
+ bool mbShadow3D : 1;
public:
/// constructor
@@ -71,9 +71,6 @@ namespace drawinglayer
double getShadowTransparence() const { return mfShadowTransparence; }
bool getShadow3D() const { return mbShadow3D; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive3DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
index 0422251837ca..9fdbe71e51d9 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
@@ -51,10 +51,10 @@ namespace drawinglayer
/// bitfield
/// flag if texture shall be modulated with white interpolated color
- unsigned mbModulate : 1;
+ bool mbModulate : 1;
/// flag if texture shall be filtered
- unsigned mbFilter : 1;
+ bool mbFilter : 1;
public:
/// constructor
@@ -68,9 +68,6 @@ namespace drawinglayer
const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
bool getModulate() const { return mbModulate; }
bool getFilter() const { return mbFilter; }
-
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
};
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -102,9 +99,6 @@ namespace drawinglayer
/// data read access
double getTransparence() const { return mfTransparence; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// own getB3DRange implementation to include transparent geometries to BoundRect calculations
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
@@ -147,9 +141,6 @@ namespace drawinglayer
/// data read access
const attribute::FillGradientAttribute& getGradient() const { return maGradient; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive3DIDBlock()
};
@@ -186,9 +177,6 @@ namespace drawinglayer
/// data read access
const attribute::FillGraphicAttribute& getFillGraphicAttribute() const { return maFillGraphicAttribute; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive3DIDBlock()
};
@@ -217,9 +205,6 @@ namespace drawinglayer
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize);
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// provide unique ID
DeclPrimitrive3DIDBlock()
};
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
index abb3c5a12403..e2854e08ddc1 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/transformprimitive3d.hxx
@@ -58,9 +58,6 @@ namespace drawinglayer
/// data read access
const basegfx::B3DHomMatrix& getTransformation() const { return maTransformation; }
- /// compare operator
- virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
-
/// get range
virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
diff --git a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
index a9b4285a36f9..6fea644ea762 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
@@ -27,6 +27,7 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <boost/utility.hpp>
//////////////////////////////////////////////////////////////////////////////
@@ -37,7 +38,8 @@ namespace drawinglayer
/** BaseProcessor2D class
Baseclass for all C++ implementations of instances which process
- primitives.
+ primitives. Is is derived from boost::noncopyable to not copy it by
+ accident.
Instances which process primitives can be renderers, but also stuff
for HitTests, BoundRect calculations and/or animation processing. The
@@ -92,7 +94,9 @@ namespace drawinglayer
The main part of a processBasePrimitive2D implementation is a switch..case
construct, looking like the following:
- void foo::processBasePrimitive2D(const BasePrimitive2D& rCandidate)
+ void foo::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate)
{
switch(rCandidate.getPrimitive2DID())
{
@@ -157,6 +161,7 @@ namespace drawinglayer
to not force their decomposition to be created and/or parsed.
*/
class DRAWINGLAYER_DLLPUBLIC BaseProcessor2D
+ : private boost::noncopyable
{
private:
/// The ViewInformation2D itself. It's private to isolate accesses to it
@@ -175,8 +180,14 @@ namespace drawinglayer
/* as tooling, the process() implementation takes over API handling and calls this
virtual render method when the primitive implementation is BasePrimitive2D-based.
Default implementation does nothing
+
+ For convenience (sometimes the uno reference object is needed) not only the casted
+ implementation is handed over (rCandidate), but also the Uno Reference to it
+ (rUnoCandidate).
*/
- virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ virtual void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
public:
/// constructor/destructor
diff --git a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
index c8070830b3b9..597a5e8e8017 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
@@ -50,7 +50,9 @@ namespace drawinglayer
bool mbExtractFillOnly : 1;
/// tooling methods
- void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
public:
ContourExtractor2D(
diff --git a/drawinglayer/inc/drawinglayer/processor2d/hairlineextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hairlineextractor2d.hxx
new file mode 100644
index 000000000000..606757b5a423
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/processor2d/hairlineextractor2d.hxx
@@ -0,0 +1,67 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_HAIRLINEEXTRACTOR2D_HXX
+#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_HAIRLINEEXTRACTOR2D_HXX
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** HairlineGeometryExtractor2D class
+
+ A processor who extracts the hairlines, even of invisible
+ geometries. Text is ignored. This is used for calculating the
+ former SnapRect of a SdrObject from it's primitive representation
+ */
+ class DRAWINGLAYER_DLLPUBLIC HairlineGeometryExtractor2D : public BaseProcessor2D
+ {
+ private:
+ std::vector< basegfx::B2DPolyPolygon > maExtractedHairlines;
+
+ /// tooling methods
+ void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
+ void addB2DPolygon(const basegfx::B2DPolygon& rPolygon);
+ void addB2DPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon);
+ void addB2DTransform(const basegfx::B2DHomMatrix& rTransform);
+
+ public:
+ HairlineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~HairlineGeometryExtractor2D();
+
+ const std::vector< basegfx::B2DPolyPolygon >& getExtractedHairlines() const { return maExtractedHairlines; }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // INCLUDED_DRAWINGLAYER_PROCESSOR2D_HAIRLINEEXTRACTOR2D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
index 64f7eccaa4cc..4c7d2fe8227b 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -54,9 +54,12 @@ namespace drawinglayer
/// discrete HitTolerance
double mfDiscreteHitTolerance;
+ /// space to keep hit TextHierarchyFieldPrimitive2Ds
+ primitive2d::Primitive2DSequence* mpRecordFields;
+
/// bitfield
- unsigned mbHit : 1;
- unsigned mbHitToleranceUsed : 1;
+ bool mbHit : 1;
+ bool mbHitToleranceUsed : 1;
/* this flag decides if primitives which are embedded to an
UnifiedTransparencePrimitive2D and are invisible will be taken into account for
@@ -64,13 +67,15 @@ namespace drawinglayer
completely invisible and normally their content exists of hairline
primitives describing the object's contour
*/
- unsigned mbUseInvisiblePrimitiveContent : 1;
+ bool mbUseInvisiblePrimitiveContent : 1;
- /// flag to concentraze on text hits only
- unsigned mbHitTextOnly : 1;
+ /// flag to concentrate on text hits only
+ bool mbHitTextOnly : 1;
/// tooling methods
- void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
bool checkHairlineHitWithTolerance(
const basegfx::B2DPolygon& rPolygon,
double fDiscreteHitTolerance);
@@ -84,13 +89,14 @@ namespace drawinglayer
const geometry::ViewInformation2D& rViewInformation,
const basegfx::B2DPoint& rLogicHitPosition,
double fLogicHitTolerance,
- bool bHitTextOnly);
+ bool bHitTextOnly,
+ primitive2d::Primitive2DSequence* pRecordFields);
virtual ~HitTestProcessor2D();
/// data write access
void setUseInvisiblePrimitiveContent(bool bNew)
{
- if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
+ if(mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
}
/// data read access
diff --git a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
index 408614c26fe5..8b339cdd1c25 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
@@ -47,10 +47,12 @@ namespace drawinglayer
basegfx::B2DPolyPolygonVector maExtractedLineFills;
/// bitfield
- unsigned mbInLineGeometry : 1;
+ bool mbInLineGeometry : 1;
/// tooling methods
- void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
public:
LineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
index f39a9c0fa910..5cf8eb948e62 100755
--- a/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/objectinfoextractor2d.hxx
@@ -47,7 +47,9 @@ namespace drawinglayer
const primitive2d::ObjectInfoPrimitive2D* mpFound;
/// tooling methods
- void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ virtual void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
public:
ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D& rViewInformation);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
index c62ccc50113b..1dbc33505a44 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
@@ -82,7 +82,9 @@ namespace drawinglayer
sal_uInt32 mnInText;
// tooling methods
- void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
public:
TextAsPolygonExtractor2D(const geometry::ViewInformation2D& rViewInformation);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
index 59d95b2f81a2..8c38ed40ccb6 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
@@ -132,7 +132,9 @@ namespace drawinglayer
/* the local processor for BasePrinitive2D-Implementation based primitives,
called from the common process()-implementation
*/
- virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ virtual void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
public:
/// constructor/destructor
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
index d3b5f033f1de..ea5c044dde44 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
@@ -47,7 +47,9 @@ namespace drawinglayer
/* the local processor for BasePrinitive2D-Implementation based primitives,
called from the common process()-implementation
*/
- virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
+ virtual void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
public:
/// constructor/destructor
diff --git a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
index 68e24df6c02a..9476cefbcb7a 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
@@ -27,6 +27,7 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
+#include <boost/utility.hpp>
//////////////////////////////////////////////////////////////////////////////
@@ -37,11 +38,13 @@ namespace drawinglayer
/** BaseProcessor3D class
Baseclass for all C++ implementations of instances which process
- primitives.
+ primitives. Is is derived from boost::noncopyable to not copy it by
+ accident.
Please have a look at baseprocessor2d.hxx for more comments.
*/
class DRAWINGLAYER_DLLPUBLIC BaseProcessor3D
+ : private boost::noncopyable
{
private:
geometry::ViewInformation3D maViewInformation3D;
diff --git a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
index 9f90529435ef..6df5abaa12e0 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
@@ -103,9 +103,9 @@ namespace drawinglayer
sal_uInt32 mnTransparenceCounter;
/// bitfield
- unsigned mbModulate : 1;
- unsigned mbFilter : 1;
- unsigned mbSimpleTextureActive : 1;
+ bool mbModulate : 1;
+ bool mbFilter : 1;
+ bool mbSimpleTextureActive : 1;
//////////////////////////////////////////////////////////////////////////////
// rendering support
diff --git a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
index d33c89ef0c76..be2630ca93f1 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
@@ -73,13 +73,13 @@ namespace drawinglayer
/// bitfield
/// flag if shadow plane projection preparation leaded to valid results
- unsigned mbShadowProjectionIsValid : 1;
+ bool mbShadowProjectionIsValid : 1;
/// flag if conversion is switched on
- unsigned mbConvert : 1;
+ bool mbConvert : 1;
/// flag if conversion shall use projection
- unsigned mbUseProjection : 1;
+ bool mbUseProjection : 1;
/// local helpers
basegfx::B2DPolygon impDoShadowProjection(const basegfx::B3DPolygon& rSource);
diff --git a/drawinglayer/inc/drawinglayer/texture/texture3d.hxx b/drawinglayer/inc/drawinglayer/texture/texture3d.hxx
index 33173fc2cf43..6dbd625427bf 100644
--- a/drawinglayer/inc/drawinglayer/texture/texture3d.hxx
+++ b/drawinglayer/inc/drawinglayer/texture/texture3d.hxx
@@ -146,7 +146,7 @@ namespace drawinglayer
GeoTexSvxHatch* mp2;
// bitfield
- unsigned mbFillBackground : 1;
+ bool mbFillBackground : 1;
// helpers
bool impIsOnHatch(const basegfx::B2DPoint& rUV) const;
diff --git a/drawinglayer/source/attribute/fillhatchattribute.cxx b/drawinglayer/source/attribute/fillhatchattribute.cxx
index cddbcb5e61ed..0d3816f9ce75 100644
--- a/drawinglayer/source/attribute/fillhatchattribute.cxx
+++ b/drawinglayer/source/attribute/fillhatchattribute.cxx
@@ -45,7 +45,7 @@ namespace drawinglayer
sal_uInt32 mnMinimalDiscreteDistance;
// bitfield
- unsigned mbFillBackground : 1;
+ bool mbFillBackground : 1;
ImpFillHatchAttribute(
HatchStyle eStyle,
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 55b46b50ca18..8732d002ace9 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -45,13 +45,13 @@ namespace drawinglayer
sal_uInt16 mnWeight; // Font weight
/// bitfield
- unsigned mbSymbol : 1; // Symbol Font Flag
- unsigned mbVertical : 1; // Vertical Text Flag
- unsigned mbItalic : 1; // Italic Flag
- unsigned mbOutline : 1; // Outline Flag
- unsigned mbRTL : 1; // RTL Flag
- unsigned mbBiDiStrong : 1; // BiDi Flag
- unsigned mbMonospaced : 1;
+ bool mbSymbol : 1; // Symbol Font Flag
+ bool mbVertical : 1; // Vertical Text Flag
+ bool mbItalic : 1; // Italic Flag
+ bool mbOutline : 1; // Outline Flag
+ bool mbRTL : 1; // RTL Flag
+ bool mbBiDiStrong : 1; // BiDi Flag
+ bool mbMonospaced : 1;
ImpFontAttribute(
const String& rFamilyName,
diff --git a/drawinglayer/source/attribute/linestartendattribute.cxx b/drawinglayer/source/attribute/linestartendattribute.cxx
index 80e500449b92..5bc6c3a4bd45 100644
--- a/drawinglayer/source/attribute/linestartendattribute.cxx
+++ b/drawinglayer/source/attribute/linestartendattribute.cxx
@@ -45,7 +45,7 @@ namespace drawinglayer
basegfx::B2DPolyPolygon maPolyPolygon; // the StartEndGeometry PolyPolygon
// bitfield
- unsigned mbCentered : 1; // use centered to ineStart/End point?
+ bool mbCentered : 1; // use centered to ineStart/End point?
ImpLineStartEndAttribute(
double fWidth,
diff --git a/drawinglayer/source/attribute/sdrlightattribute3d.cxx b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
index c33e1faf6a26..5c168f918940 100644
--- a/drawinglayer/source/attribute/sdrlightattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
@@ -43,7 +43,7 @@ namespace drawinglayer
basegfx::B3DVector maDirection;
// bitfield
- unsigned mbSpecular : 1;
+ bool mbSpecular : 1;
ImpSdr3DLightAttribute(
const basegfx::BColor& rColor,
diff --git a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
index 35165aa726f8..278d64b5190e 100644
--- a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
@@ -46,11 +46,11 @@ namespace drawinglayer
MaterialAttribute3D maMaterial; // object, specular and emissive colors, SpecularIntensity
// bitfield
- unsigned mbNormalsInvert : 1; // invert normals
- unsigned mbDoubleSided : 1; // surfaces are double sided
- unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene
- unsigned mbTextureFilter : 1; // filter texture to make more smooth
- unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific)
+ bool mbNormalsInvert : 1; // invert normals
+ bool mbDoubleSided : 1; // surfaces are double sided
+ bool mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene
+ bool mbTextureFilter : 1; // filter texture to make more smooth
+ bool mbReducedLineGeometry : 1; // use reduced line geometry (object specific)
ImpSdr3DObjectAttribute(
::com::sun::star::drawing::NormalsKind aNormalsKind,
diff --git a/drawinglayer/source/attribute/sdrsceneattribute3d.cxx b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx
index 65cdcc56dd33..9ae2d874a0e4 100644
--- a/drawinglayer/source/attribute/sdrsceneattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx
@@ -43,7 +43,7 @@ namespace drawinglayer
::com::sun::star::drawing::ShadeMode maShadeMode;
// bitfield
- unsigned mbTwoSidedLighting : 1;
+ bool mbTwoSidedLighting : 1;
public:
ImpSdrSceneAttribute(
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 3d78eca56d2d..119e4f97204d 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -338,8 +338,7 @@ namespace drawinglayer
if(maDiscreteViewport.isEmpty() && !maViewport.isEmpty())
{
- basegfx::B2DRange aDiscreteViewport(maViewport);
- aDiscreteViewport.transform(getViewTransformation());
+ const basegfx::B2DRange aDiscreteViewport(getViewTransformation() * maViewport);
const_cast< ImpViewInformation2D* >(this)->maDiscreteViewport = aDiscreteViewport;
}
@@ -353,7 +352,7 @@ namespace drawinglayer
if(maObjectToViewTransformation.isIdentity() &&
(!maObjectTransformation.isIdentity() || !maViewTransformation.isIdentity()))
{
- basegfx::B2DHomMatrix aObjectToView(maViewTransformation * maObjectTransformation);
+ const basegfx::B2DHomMatrix aObjectToView(maViewTransformation * maObjectTransformation);
const_cast< ImpViewInformation2D* >(this)->maObjectToViewTransformation = aObjectToView;
}
diff --git a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
index 4af1819726dc..c8e2b089eb92 100644
--- a/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/animatedprimitive2d.cxx
@@ -58,18 +58,6 @@ namespace drawinglayer
delete mpAnimationEntry;
}
- bool AnimatedSwitchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const AnimatedSwitchPrimitive2D& rCompare = static_cast< const AnimatedSwitchPrimitive2D& >(rPrimitive);
-
- return (getAnimationEntry() == rCompare.getAnimationEntry());
- }
-
- return false;
- }
-
Primitive2DSequence AnimatedSwitchPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
if(getChildren().hasElements())
@@ -197,7 +185,10 @@ namespace drawinglayer
// build matrix for state
aTargetTransform = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aScale, fShearX, fRotate, aTranslate);
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate);
}
// create new transform primitive reference, return new sequence
diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
index 382b7a6f1b17..78f0c39ea15c 100644
--- a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
@@ -64,18 +64,6 @@ namespace drawinglayer
{
}
- bool BackgroundColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const BackgroundColorPrimitive2D& rCompare = (BackgroundColorPrimitive2D&)rPrimitive;
-
- return (getBColor() == rCompare.getBColor());
- }
-
- return false;
- }
-
basegfx::B2DRange BackgroundColorPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// always as big as the view
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index 868305b45208..9c62b5827935 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -47,11 +47,6 @@ namespace drawinglayer
{
}
- bool BasePrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- return (getPrimitive2DID() == rPrimitive.getPrimitive2DID());
- }
-
basegfx::B2DRange BasePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
return getB2DRangeFromPrimitive2DSequence(get2DDecomposition(rViewInformation), rViewInformation);
@@ -180,69 +175,6 @@ namespace drawinglayer
return aRetval;
}
- bool arePrimitive2DReferencesEqual(const Primitive2DReference& rxA, const Primitive2DReference& rxB)
- {
- const sal_Bool bAIs(rxA.is());
-
- if(bAIs != rxB.is())
- {
- return false;
- }
-
- if(!bAIs)
- {
- return true;
- }
-
- const BasePrimitive2D* pA(dynamic_cast< const BasePrimitive2D* >(rxA.get()));
- const BasePrimitive2D* pB(dynamic_cast< const BasePrimitive2D* >(rxB.get()));
- const bool bAEqualZero(pA == 0L);
-
- if(bAEqualZero != (pB == 0L))
- {
- return false;
- }
-
- if(bAEqualZero)
- {
- return false;
- }
-
- return (pA->operator==(*pB));
- }
-
- bool arePrimitive2DSequencesEqual(const Primitive2DSequence& rA, const Primitive2DSequence& rB)
- {
- const sal_Bool bAHasElements(rA.hasElements());
-
- if(bAHasElements != rB.hasElements())
- {
- return false;
- }
-
- if(!bAHasElements)
- {
- return true;
- }
-
- const sal_Int32 nCount(rA.getLength());
-
- if(nCount != rB.getLength())
- {
- return false;
- }
-
- for(sal_Int32 a(0L); a < nCount; a++)
- {
- if(!arePrimitive2DReferencesEqual(rA[a], rB[a]))
- {
- return false;
- }
- }
-
- return true;
- }
-
// concatenate sequence
void appendPrimitive2DSequenceToPrimitive2DSequence(Primitive2DSequence& rDest, const Primitive2DSequence& rSource)
{
diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
index 7cd0f7b6a8cc..1f356595af3c 100644
--- a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
@@ -47,24 +47,9 @@ namespace drawinglayer
{
}
- bool BitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const BitmapPrimitive2D& rCompare = (BitmapPrimitive2D&)rPrimitive;
-
- return (getBitmapEx() == rCompare.getBitmapEx()
- && getTransform() == rCompare.getTransform());
- }
-
- return false;
- }
-
basegfx::B2DRange BitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(maTransform);
- return aRetval;
+ return getTransform() * basegfx::B2DRange::getUnitB2DRange();
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index ef481f3fbdf2..2bfa4a79e314 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -198,29 +198,6 @@ namespace drawinglayer
{
}
- bool BorderLinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const BorderLinePrimitive2D& rCompare = (BorderLinePrimitive2D&)rPrimitive;
-
- return (getStart() == rCompare.getStart()
- && getEnd() == rCompare.getEnd()
- && getLeftWidth() == rCompare.getLeftWidth()
- && getDistance() == rCompare.getDistance()
- && getRightWidth() == rCompare.getRightWidth()
- && getExtendInnerStart() == rCompare.getExtendInnerStart()
- && getExtendInnerEnd() == rCompare.getExtendInnerEnd()
- && getExtendOuterStart() == rCompare.getExtendOuterStart()
- && getExtendOuterEnd() == rCompare.getExtendOuterEnd()
- && getCreateInside() == rCompare.getCreateInside()
- && getCreateOutside() == rCompare.getCreateOutside()
- && getRGBColor() == rCompare.getRGBColor());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(BorderLinePrimitive2D, PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index e0c5daf49f98..be7c16d14b7d 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -101,7 +101,8 @@ namespace drawinglayer
if(xControlWindow.is())
{
// get decomposition to get size
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -219,8 +220,12 @@ namespace drawinglayer
}
// short form for scale and translate transformation
- const basegfx::B2DHomMatrix aBitmapTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(
- aBitmapSizeLogic.getX(), aBitmapSizeLogic.getY(), aTranslate.getX(), aTranslate.getY()));
+ const basegfx::B2DHomMatrix aBitmapTransform(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aBitmapSizeLogic,
+ fShearX,
+ fRotate,
+ aTranslate));
// create primitive
xRetval = new BitmapPrimitive2D(BitmapEx(aContent), aBitmapTransform);
@@ -240,9 +245,7 @@ namespace drawinglayer
Primitive2DReference ControlPrimitive2D::createPlaceholderDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// create a gray placeholder hairline polygon in object size
- basegfx::B2DRange aObjectRange(0.0, 0.0, 1.0, 1.0);
- aObjectRange.transform(getTransform());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aObjectRange));
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(getTransform() * basegfx::B2DRange::getUnitB2DRange()));
const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0);
// The replacement object may also get a text like 'empty group' here later
@@ -298,49 +301,10 @@ namespace drawinglayer
return mxXControl;
}
- bool ControlPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- // use base class compare operator
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const ControlPrimitive2D& rCompare = (ControlPrimitive2D&)rPrimitive;
-
- if(getTransform() == rCompare.getTransform())
- {
- // check if ControlModel references both are/are not
- bool bRetval(getControlModel().is() == rCompare.getControlModel().is());
-
- if(bRetval && getControlModel().is())
- {
- // both exist, check for equality
- bRetval = (getControlModel() == rCompare.getControlModel());
- }
-
- if(bRetval)
- {
- // check if XControl references both are/are not
- bRetval = (getXControl().is() == rCompare.getXControl().is());
- }
-
- if(bRetval && getXControl().is())
- {
- // both exist, check for equality
- bRetval = (getXControl() == rCompare.getXControl());
- }
-
- return bRetval;
- }
- }
-
- return false;
- }
-
basegfx::B2DRange ControlPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// simply derivate from unit range
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(getTransform());
- return aRetval;
+ return getTransform() * basegfx::B2DRange::getUnitB2DRange();
}
Primitive2DSequence ControlPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
diff --git a/drawinglayer/source/primitive2d/cropprimitive2d.cxx b/drawinglayer/source/primitive2d/cropprimitive2d.cxx
index f4b6e82b9df0..20ecdf5ff087 100644
--- a/drawinglayer/source/primitive2d/cropprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/cropprimitive2d.cxx
@@ -57,22 +57,6 @@ namespace drawinglayer
{
}
- bool CropPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const CropPrimitive2D& rCompare = static_cast< const CropPrimitive2D& >(rPrimitive);
-
- return (getTransformation() == rCompare.getTransformation()
- && getCropLeft() == rCompare.getCropLeft()
- && getCropTop() == rCompare.getCropTop()
- && getCropRight() == rCompare.getCropRight()
- && getCropBottom() == rCompare.getCropBottom());
- }
-
- return false;
- }
-
Primitive2DSequence CropPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
Primitive2DSequence xRetval;
diff --git a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
index c5a1ed96ea39..bd297a65237f 100644
--- a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
@@ -89,19 +89,6 @@ namespace drawinglayer
{
}
- bool DiscreteBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(ObjectAndViewTransformationDependentPrimitive2D::operator==(rPrimitive))
- {
- const DiscreteBitmapPrimitive2D& rCompare = (DiscreteBitmapPrimitive2D&)rPrimitive;
-
- return (getBitmapEx() == rCompare.getBitmapEx()
- && getTopLeft() == rCompare.getTopLeft());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(DiscreteBitmapPrimitive2D, PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
index c96fb99eba3d..0e166b0b1c93 100644
--- a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
@@ -288,19 +288,6 @@ namespace drawinglayer
{
}
- bool DiscreteShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const DiscreteShadowPrimitive2D& rCompare = (DiscreteShadowPrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getDiscreteShadow() == rCompare.getDiscreteShadow());
- }
-
- return false;
- }
-
basegfx::B2DRange DiscreteShadowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
if(getDiscreteShadow().getBitmapEx().IsEmpty())
diff --git a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
index 69c2ffc6214f..908bb7f5f8fa 100644
--- a/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx
@@ -104,23 +104,6 @@ namespace drawinglayer
maLightNormal.normalize();
}
- bool Embedded3DPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const Embedded3DPrimitive2D& rCompare = static_cast< const Embedded3DPrimitive2D& >(rPrimitive);
-
- return (primitive3d::arePrimitive3DSequencesEqual(getChildren3D(), rCompare.getChildren3D())
- && getObjectTransformation() == rCompare.getObjectTransformation()
- && getViewInformation3D() == rCompare.getViewInformation3D()
- && getLightNormal() == rCompare.getLightNormal()
- && getShadowSlant() == rCompare.getShadowSlant()
- && getScene3DRange() == rCompare.getScene3DRange());
- }
-
- return false;
- }
-
basegfx::B2DRange Embedded3DPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
if(maB2DRange.isEmpty())
diff --git a/drawinglayer/source/primitive2d/epsprimitive2d.cxx b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
index ce897af4ccb0..aac7b3cee280 100644
--- a/drawinglayer/source/primitive2d/epsprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/epsprimitive2d.cxx
@@ -66,27 +66,10 @@ namespace drawinglayer
{
}
- bool EpsPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const EpsPrimitive2D& rCompare = (EpsPrimitive2D&)rPrimitive;
-
- return (getEpsTransform() == rCompare.getEpsTransform()
- && getGfxLink().IsEqual(rCompare.getGfxLink())
- && getMetaFile() == rCompare.getMetaFile());
- }
-
- return false;
- }
-
basegfx::B2DRange EpsPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// use own implementation to quickly answer the getB2DRange question.
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(getEpsTransform());
-
- return aRetval;
+ return getEpsTransform() * basegfx::B2DRange::getUnitB2DRange();
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index d5132de7e633..018fcd962bc3 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -271,19 +271,6 @@ namespace drawinglayer
{
}
- bool FillGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive;
-
- return (getObjectRange() == rCompare.getObjectRange()
- && getFillGradient() == rCompare.getFillGradient());
- }
-
- return false;
- }
-
basegfx::B2DRange FillGradientPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return ObjectRange
diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
index 5da9d85dc4a1..d379860c4ee0 100644
--- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
@@ -115,19 +115,6 @@ namespace drawinglayer
{
}
- bool FillGraphicPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const FillGraphicPrimitive2D& rCompare = static_cast< const FillGraphicPrimitive2D& >(rPrimitive);
-
- return (getTransformation() == rCompare.getTransformation()
- && getFillGraphic() == rCompare.getFillGraphic());
- }
-
- return false;
- }
-
basegfx::B2DRange FillGraphicPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return range of it
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index beb57072b7dc..5491bfe2107f 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -142,20 +142,6 @@ namespace drawinglayer
{
}
- bool FillHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive;
-
- return (getObjectRange() == rCompare.getObjectRange()
- && getFillHatch() == rCompare.getFillHatch()
- && getBColor() == rCompare.getBColor());
- }
-
- return false;
- }
-
basegfx::B2DRange FillHatchPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return ObjectRange
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 088a31581459..e6e4572ce6ba 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -168,25 +168,9 @@ namespace drawinglayer
{
}
- bool GraphicPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const GraphicPrimitive2D& rCompare = (GraphicPrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getGraphicObject() == rCompare.getGraphicObject()
- && getGraphicAttr() == rCompare.getGraphicAttr());
- }
-
- return false;
- }
-
basegfx::B2DRange GraphicPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(getTransform());
- return aRetval;
+ return getTransform() * basegfx::B2DRange::getUnitB2DRange();
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/gridprimitive2d.cxx b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
index 56d613f45965..23789e7c1f04 100644
--- a/drawinglayer/source/primitive2d/gridprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/gridprimitive2d.cxx
@@ -49,13 +49,17 @@ namespace drawinglayer
if(!rViewInformation.getViewport().isEmpty() && getWidth() > 0.0 && getHeight() > 0.0)
{
// decompose grid matrix to get logic size
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create grid matrix which transforms from scaled logic to view
- basegfx::B2DHomMatrix aRST(basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
- fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ basegfx::B2DHomMatrix aRST(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX,
+ fRotate,
+ aTranslate.getX(), aTranslate.getY()));
aRST *= rViewInformation.getObjectToViewTransformation();
// get step widths
@@ -294,31 +298,10 @@ namespace drawinglayer
{
}
- bool GridPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const GridPrimitive2D& rCompare = (GridPrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getWidth() == rCompare.getWidth()
- && getHeight() == rCompare.getHeight()
- && getSmallestViewDistance() == rCompare.getSmallestViewDistance()
- && getSmallestSubdivisionViewDistance() == rCompare.getSmallestSubdivisionViewDistance()
- && getSubdivisionsX() == rCompare.getSubdivisionsX()
- && getSubdivisionsY() == rCompare.getSubdivisionsY()
- && getBColor() == rCompare.getBColor()
- && getCrossMarker() == rCompare.getCrossMarker());
- }
-
- return false;
- }
-
basegfx::B2DRange GridPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// get object's range
- basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- aUnitRange.transform(getTransform());
+ basegfx::B2DRange aUnitRange(getTransform() * basegfx::B2DRange::getUnitB2DRange());
// intersect with visible part
aUnitRange.intersect(rViewInformation.getViewport());
diff --git a/drawinglayer/source/primitive2d/groupprimitive2d.cxx b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
index 23948caefd0a..85ea3085693d 100644
--- a/drawinglayer/source/primitive2d/groupprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
@@ -43,22 +43,6 @@ namespace drawinglayer
{
}
- /** The compare opertator uses the Sequence::==operator, so only checking if
- the rererences are equal. All non-equal references are interpreted as
- non-equal.
- */
- bool GroupPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const GroupPrimitive2D& rCompare = static_cast< const GroupPrimitive2D& >(rPrimitive);
-
- return (arePrimitive2DSequencesEqual(getChildren(), rCompare.getChildren()));
- }
-
- return false;
- }
-
/// default: just return children, so all renderers not supporting group will use it's content
Primitive2DSequence GroupPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
index 18cf762ca0e6..d71cb5b9bae5 100644
--- a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx
@@ -167,23 +167,6 @@ namespace drawinglayer
{
}
- bool HelplinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const HelplinePrimitive2D& rCompare = (HelplinePrimitive2D&)rPrimitive;
-
- return (getPosition() == rCompare.getPosition()
- && getDirection() == rCompare.getDirection()
- && getStyle() == rCompare.getStyle()
- && getRGBColA() == rCompare.getRGBColA()
- && getRGBColB() == rCompare.getRGBColB()
- && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
- }
-
- return false;
- }
-
Primitive2DSequence HelplinePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
{
::osl::MutexGuard aGuard( m_aMutex );
diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
index d5435a640255..da7bde8c942b 100644
--- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
@@ -94,19 +94,6 @@ namespace drawinglayer
{
}
- bool MarkerArrayPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const MarkerArrayPrimitive2D& rCompare = (MarkerArrayPrimitive2D&)rPrimitive;
-
- return (getPositions() == rCompare.getPositions()
- && getMarker() == rCompare.getMarker());
- }
-
- return false;
- }
-
basegfx::B2DRange MarkerArrayPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
basegfx::B2DRange aRetval;
diff --git a/drawinglayer/source/primitive2d/maskprimitive2d.cxx b/drawinglayer/source/primitive2d/maskprimitive2d.cxx
index 03e91d9561cd..0937e03eae21 100644
--- a/drawinglayer/source/primitive2d/maskprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/maskprimitive2d.cxx
@@ -45,18 +45,6 @@ namespace drawinglayer
{
}
- bool MaskPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const MaskPrimitive2D& rCompare = static_cast< const MaskPrimitive2D& >(rPrimitive);
-
- return (getMask() == rCompare.getMask());
- }
-
- return false;
- }
-
basegfx::B2DRange MaskPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
return getMask().getB2DRange();
diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
index 34112d479eca..00925c08a62d 100644
--- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
@@ -72,9 +72,7 @@ namespace drawinglayer
const basegfx::B2DVector aDiscreteInLogic(rViewInformation.getInverseObjectToViewTransformation() *
basegfx::B2DVector((double)getDiscreteBorder(), (double)getDiscreteBorder()));
const double fDiscreteSize(aDiscreteInLogic.getX() + aDiscreteInLogic.getY());
-
- basegfx::B2DRange aSourceRange(0.0, 0.0, 1.0, 1.0);
- aSourceRange.transform(getTransform());
+ const basegfx::B2DRange aSourceRange(getTransform() * basegfx::B2DRange::getUnitB2DRange());
basegfx::B2DRange aDestRange(aSourceRange);
aDestRange.grow(-0.5 * fDiscreteSize);
@@ -91,9 +89,9 @@ namespace drawinglayer
{
// create transformation matrix from original range to shrunk range
basegfx::B2DHomMatrix aTransform;
- aTransform.translate(-aSourceRange.getMinX(), -aSourceRange.getMinY());
+ aTransform.translate(-aSourceRange.getMinimum());
aTransform.scale(aDestRange.getWidth() / aSourceRange.getWidth(), aDestRange.getHeight() / aSourceRange.getHeight());
- aTransform.translate(aDestRange.getMinX(), aDestRange.getMinY());
+ aTransform.translate(aDestRange.getMinimum());
// add transform primitive
const Primitive2DReference aScaled(new TransformPrimitive2D(aTransform, xRetval));
@@ -117,25 +115,9 @@ namespace drawinglayer
{
}
- bool MediaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const MediaPrimitive2D& rCompare = (MediaPrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getURL() == rCompare.getURL()
- && getBackgroundColor() == rCompare.getBackgroundColor()
- && getDiscreteBorder() == rCompare.getDiscreteBorder());
- }
-
- return false;
- }
-
basegfx::B2DRange MediaPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(getTransform());
+ basegfx::B2DRange aRetval(getTransform() * basegfx::B2DRange::getUnitB2DRange());
if(getDiscreteBorder())
{
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 25f4867a3b2d..386bcc61100b 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -1242,7 +1242,7 @@ namespace
0 != (rProperty.getLayoutMode() & TEXT_LAYOUT_BIDI_STRONG)));
// add FontScaling
- rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY());
+ rTextTransform.scale(aFontScaling);
// take text align into account
if(ALIGN_BASELINE != rFont.GetAlign())
@@ -1259,7 +1259,7 @@ namespace
rAlignmentOffset.setY(-aTextLayouterDevice.getFontDescent());
}
- rTextTransform.translate(rAlignmentOffset.getX(), rAlignmentOffset.getY());
+ rTextTransform.translate(rAlignmentOffset);
}
// add FontRotation (if used)
@@ -1421,7 +1421,7 @@ namespace
// create Transform
basegfx::B2DHomMatrix aTextTransform;
- aTextTransform.translate(aAlignmentOffset.getX(), aAlignmentOffset.getY());
+ aTextTransform.translate(aAlignmentOffset);
if(rFont.GetOrientation())
{
@@ -3229,29 +3229,13 @@ namespace drawinglayer
{
}
- bool MetafilePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const MetafilePrimitive2D& rCompare = (MetafilePrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getMetaFile() == rCompare.getMetaFile());
- }
-
- return false;
- }
-
basegfx::B2DRange MetafilePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// use own implementation to quickly answer the getB2DRange question. The
// MetafilePrimitive2D assumes that all geometry is inside of the shape. If
// this is not the case (i have already seen some wrong Metafiles) it should
// be embedded to a MaskPrimitive2D
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(getTransform());
-
- return aRetval;
+ return getTransform() * basegfx::B2DRange::getUnitB2DRange();
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
index 87058e2dd308..0eef666e2aad 100644
--- a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
@@ -45,18 +45,6 @@ namespace drawinglayer
{
}
- bool ModifiedColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const ModifiedColorPrimitive2D& rCompare = (ModifiedColorPrimitive2D&)rPrimitive;
-
- return (getColorModifier() == rCompare.getColorModifier());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(ModifiedColorPrimitive2D, PRIMITIVE2D_ID_MODIFIEDCOLORPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/objectinfoprimitive2d.cxx b/drawinglayer/source/primitive2d/objectinfoprimitive2d.cxx
index e8a4d327fc28..9f39f164ac30 100755
--- a/drawinglayer/source/primitive2d/objectinfoprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/objectinfoprimitive2d.cxx
@@ -49,20 +49,6 @@ namespace drawinglayer
{
}
- bool ObjectInfoPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const ObjectInfoPrimitive2D& rCompare = (ObjectInfoPrimitive2D&)rPrimitive;
-
- return (getName() == rCompare.getName()
- && getTitle() == rCompare.getTitle()
- && getDesc() == rCompare.getDesc());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(ObjectInfoPrimitive2D, PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
index 376251aaab47..9e4c1a67e8e6 100644
--- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
@@ -52,7 +52,8 @@ namespace drawinglayer
&& basegfx::fTools::more(getContentHeight(), 0.0))
{
// the decomposed matrix will be needed
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -104,8 +105,11 @@ namespace drawinglayer
}
// add the missing object transformation aspects
- const basegfx::B2DHomMatrix aCombined(basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
- fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ const basegfx::B2DHomMatrix aCombined(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX,
+ fRotate,
+ aTranslate.getX(), aTranslate.getY()));
aPageTrans = aCombined * aPageTrans;
}
else
@@ -143,30 +147,11 @@ namespace drawinglayer
{
}
- bool PagePreviewPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const PagePreviewPrimitive2D& rCompare = static_cast< const PagePreviewPrimitive2D& >(rPrimitive);
-
- return (getXDrawPage() == rCompare.getXDrawPage()
- && getPageContent() == rCompare.getPageContent()
- && getTransform() == rCompare.getTransform()
- && getContentWidth() == rCompare.getContentWidth()
- && getContentHeight() == rCompare.getContentHeight()
- && getKeepAspectRatio() == rCompare.getKeepAspectRatio());
- }
-
- return false;
- }
-
basegfx::B2DRange PagePreviewPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation`*/) const
{
// nothing is allowed to stick out of a PagePreviewPrimitive, thus we
// can quickly deliver our range here
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
- aRetval.transform(getTransform());
- return aRetval;
+ return getTransform() * basegfx::B2DRange::getUnitB2DRange();
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 8c0893ff3d11..7ebd2f5ac1d2 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -130,20 +130,6 @@ namespace drawinglayer
{
}
- bool PatternFillPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PatternFillPrimitive2D& rCompare = static_cast< const PatternFillPrimitive2D& >(rPrimitive);
-
- return (getMask() == rCompare.getMask()
- && getChildren() == rCompare.getChildren()
- && getReferenceRange() == rCompare.getReferenceRange());
- }
-
- return false;
- }
-
basegfx::B2DRange PatternFillPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
return getMask().getB2DRange();
diff --git a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
index d0fe0b776044..056a7e120e73 100644
--- a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx
@@ -47,19 +47,6 @@ namespace drawinglayer
{
}
- bool PointArrayPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const PointArrayPrimitive2D& rCompare = (PointArrayPrimitive2D&)rPrimitive;
-
- return (getPositions() == rCompare.getPositions()
- && getRGBColor() == rCompare.getRGBColor());
- }
-
- return false;
- }
-
basegfx::B2DRange PointArrayPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
if(maB2DRange.isEmpty())
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index 1c8e150c6642..e5a7ca0fa9a5 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -53,19 +53,6 @@ namespace drawinglayer
{
}
- bool PolygonHairlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const PolygonHairlinePrimitive2D& rCompare = (PolygonHairlinePrimitive2D&)rPrimitive;
-
- return (getB2DPolygon() == rCompare.getB2DPolygon()
- && getBColor() == rCompare.getBColor());
- }
-
- return false;
- }
-
basegfx::B2DRange PolygonHairlinePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// this is a hairline, thus the line width is view-dependent. Get range of polygon
@@ -146,21 +133,6 @@ namespace drawinglayer
{
}
- bool PolygonMarkerPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolygonMarkerPrimitive2D& rCompare = (PolygonMarkerPrimitive2D&)rPrimitive;
-
- return (getB2DPolygon() == rCompare.getB2DPolygon()
- && getRGBColorA() == rCompare.getRGBColorA()
- && getRGBColorB() == rCompare.getRGBColorB()
- && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
- }
-
- return false;
- }
-
basegfx::B2DRange PolygonMarkerPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// this is a hairline, thus the line width is view-dependent. Get range of polygon
@@ -324,20 +296,6 @@ namespace drawinglayer
{
}
- bool PolygonStrokePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolygonStrokePrimitive2D& rCompare = (PolygonStrokePrimitive2D&)rPrimitive;
-
- return (getB2DPolygon() == rCompare.getB2DPolygon()
- && getLineAttribute() == rCompare.getLineAttribute()
- && getStrokeAttribute() == rCompare.getStrokeAttribute());
- }
-
- return false;
- }
-
basegfx::B2DRange PolygonStrokePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
basegfx::B2DRange aRetval;
@@ -478,19 +436,6 @@ namespace drawinglayer
}
}
- bool PolygonWavePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(PolygonStrokePrimitive2D::operator==(rPrimitive))
- {
- const PolygonWavePrimitive2D& rCompare = (PolygonWavePrimitive2D&)rPrimitive;
-
- return (getWaveWidth() == rCompare.getWaveWidth()
- && getWaveHeight() == rCompare.getWaveHeight());
- }
-
- return false;
- }
-
basegfx::B2DRange PolygonWavePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// get range of parent
@@ -618,19 +563,6 @@ namespace drawinglayer
{
}
- bool PolygonStrokeArrowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(PolygonStrokePrimitive2D::operator==(rPrimitive))
- {
- const PolygonStrokeArrowPrimitive2D& rCompare = (PolygonStrokeArrowPrimitive2D&)rPrimitive;
-
- return (getStart() == rCompare.getStart()
- && getEnd() == rCompare.getEnd());
- }
-
- return false;
- }
-
basegfx::B2DRange PolygonStrokeArrowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
basegfx::B2DRange aRetval;
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
index be8300fdba69..a5e006c88599 100644
--- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
@@ -76,19 +76,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonHairlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonHairlinePrimitive2D& rCompare = (PolyPolygonHairlinePrimitive2D&)rPrimitive;
-
- return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
- && getBColor() == rCompare.getBColor());
- }
-
- return false;
- }
-
basegfx::B2DRange PolyPolygonHairlinePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return range
@@ -142,21 +129,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonMarkerPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonMarkerPrimitive2D& rCompare = (PolyPolygonMarkerPrimitive2D&)rPrimitive;
-
- return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
- && getRGBColorA() == rCompare.getRGBColorA()
- && getRGBColorB() == rCompare.getRGBColorB()
- && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
- }
-
- return false;
- }
-
basegfx::B2DRange PolyPolygonMarkerPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return range
@@ -220,20 +192,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonStrokePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonStrokePrimitive2D& rCompare = (PolyPolygonStrokePrimitive2D&)rPrimitive;
-
- return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
- && getLineAttribute() == rCompare.getLineAttribute()
- && getStrokeAttribute() == rCompare.getStrokeAttribute());
- }
-
- return false;
- }
-
basegfx::B2DRange PolyPolygonStrokePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// get range of it (subdivided)
@@ -318,19 +276,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonStrokeArrowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(PolyPolygonStrokePrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonStrokeArrowPrimitive2D& rCompare = (PolyPolygonStrokeArrowPrimitive2D&)rPrimitive;
-
- return (getStart() == rCompare.getStart()
- && getEnd() == rCompare.getEnd());
- }
-
- return false;
- }
-
basegfx::B2DRange PolyPolygonStrokeArrowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
basegfx::B2DRange aRetval;
@@ -368,19 +313,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonColorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonColorPrimitive2D& rCompare = (PolyPolygonColorPrimitive2D&)rPrimitive;
-
- return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
- && getBColor() == rCompare.getBColor());
- }
-
- return false;
- }
-
basegfx::B2DRange PolyPolygonColorPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return range
@@ -430,18 +362,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonGradientPrimitive2D& rCompare = (PolyPolygonGradientPrimitive2D&)rPrimitive;
-
- return (getFillGradient() == rCompare.getFillGradient());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(PolyPolygonGradientPrimitive2D, PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D)
@@ -487,19 +407,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonHatchPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonHatchPrimitive2D& rCompare = (PolyPolygonHatchPrimitive2D&)rPrimitive;
-
- return (getBackgroundColor() == rCompare.getBackgroundColor()
- && getFillHatch() == rCompare.getFillHatch());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(PolyPolygonHatchPrimitive2D, PRIMITIVE2D_ID_POLYPOLYGONHATCHPRIMITIVE2D)
@@ -561,18 +468,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonGraphicPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const PolyPolygonGraphicPrimitive2D& rCompare = (PolyPolygonGraphicPrimitive2D&)rPrimitive;
-
- return (getFillGraphic() == rCompare.getFillGraphic());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(PolyPolygonGraphicPrimitive2D, PRIMITIVE2D_ID_POLYPOLYGONGRAPHICPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 60b0a9c2fc40..d9daf1b0a0ac 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -95,7 +95,7 @@ namespace drawinglayer
basegfx::B2DRange& rUnitVisibleRange) const
{
// use unit range and transform to discrete coordinates
- rDiscreteRange = basegfx::B2DRange(0.0, 0.0, 1.0, 1.0);
+ rDiscreteRange = basegfx::B2DRange::getUnitB2DRange();
rDiscreteRange.transform(rViewInformation.getObjectToViewTransformation() * getObjectTransformation());
// clip it against discrete Viewport (if set)
@@ -423,26 +423,10 @@ namespace drawinglayer
{
}
- bool ScenePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const ScenePrimitive2D& rCompare = (ScenePrimitive2D&)rPrimitive;
-
- return (primitive3d::arePrimitive3DSequencesEqual(getChildren3D(), rCompare.getChildren3D())
- && getSdrSceneAttribute() == rCompare.getSdrSceneAttribute()
- && getSdrLightingAttribute() == rCompare.getSdrLightingAttribute()
- && getObjectTransformation() == rCompare.getObjectTransformation()
- && getViewInformation3D() == rCompare.getViewInformation3D());
- }
-
- return false;
- }
-
basegfx::B2DRange ScenePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// transform unit range to discrete coordinate range
- basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0);
+ basegfx::B2DRange aRetval(basegfx::B2DRange::getUnitB2DRange());
aRetval.transform(rViewInformation.getObjectToViewTransformation() * getObjectTransformation());
// force to discrete expanded bounds (it grows, so expanding works perfectly well)
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index ef94387f8897..e2c9cf4ad499 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -53,19 +53,6 @@ namespace drawinglayer
{
}
- bool ShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const ShadowPrimitive2D& rCompare = static_cast< const ShadowPrimitive2D& >(rPrimitive);
-
- return (getShadowTransform() == rCompare.getShadowTransform()
- && getShadowColor() == rCompare.getShadowColor());
- }
-
- return false;
- }
-
basegfx::B2DRange ShadowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index db8a9d1be894..4ca50ff758bd 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -302,17 +302,6 @@ namespace drawinglayer
{
}
- bool SvgGradientHelper::operator==(const SvgGradientHelper& rSvgGradientHelper) const
- {
- const SvgGradientHelper& rCompare = static_cast< const SvgGradientHelper& >(rSvgGradientHelper);
-
- return (getPolyPolygon() == rCompare.getPolyPolygon()
- && getGradientEntries() == rCompare.getGradientEntries()
- && getStart() == rCompare.getStart()
- && getUseUnitCoordinates() == rCompare.getUseUnitCoordinates()
- && getSpreadMethod() == rCompare.getSpreadMethod());
- }
-
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -566,20 +555,6 @@ namespace drawinglayer
{
}
- bool SvgLinearGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive);
-
- if(pSvgGradientHelper && SvgGradientHelper::operator==(*pSvgGradientHelper))
- {
- const SvgLinearGradientPrimitive2D& rCompare = static_cast< const SvgLinearGradientPrimitive2D& >(rPrimitive);
-
- return (getEnd() == rCompare.getEnd());
- }
-
- return false;
- }
-
basegfx::B2DRange SvgLinearGradientPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return ObjectRange
@@ -855,33 +830,6 @@ namespace drawinglayer
{
}
- bool SvgRadialGradientPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive);
-
- if(pSvgGradientHelper && SvgGradientHelper::operator==(*pSvgGradientHelper))
- {
- const SvgRadialGradientPrimitive2D& rCompare = static_cast< const SvgRadialGradientPrimitive2D& >(rPrimitive);
-
- if(getRadius() == rCompare.getRadius())
- {
- if(isFocalSet() == rCompare.isFocalSet())
- {
- if(isFocalSet())
- {
- return getFocal() == rCompare.getFocal();
- }
- else
- {
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
basegfx::B2DRange SvgRadialGradientPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return ObjectRange
@@ -960,21 +908,6 @@ namespace drawinglayer
}
}
- bool SvgLinearAtomPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const SvgLinearAtomPrimitive2D& rCompare = static_cast< const SvgLinearAtomPrimitive2D& >(rPrimitive);
-
- return (getColorA() == rCompare.getColorA()
- && getColorB() == rCompare.getColorB()
- && getOffsetA() == rCompare.getOffsetA()
- && getOffsetB() == rCompare.getOffsetB());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SvgLinearAtomPrimitive2D, PRIMITIVE2D_ID_SVGLINEARATOMPRIMITIVE2D)
@@ -1110,32 +1043,6 @@ namespace drawinglayer
}
}
- bool SvgRadialAtomPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const SvgRadialAtomPrimitive2D& rCompare = static_cast< const SvgRadialAtomPrimitive2D& >(rPrimitive);
-
- if(getColorA() == rCompare.getColorA()
- && getColorB() == rCompare.getColorB()
- && getScaleA() == rCompare.getScaleA()
- && getScaleB() == rCompare.getScaleB())
- {
- if(isTranslateSet() && rCompare.isTranslateSet())
- {
- return (getTranslateA() == rCompare.getTranslateA()
- && getTranslateB() == rCompare.getTranslateB());
- }
- else if(!isTranslateSet() && !rCompare.isTranslateSet())
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SvgRadialAtomPrimitive2D, PRIMITIVE2D_ID_SVGRADIALATOMPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index 4f41eac25c0e..f3e6439c27f0 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -364,31 +364,7 @@ namespace drawinglayer
|| getShadow());
}
- bool TextDecoratedPortionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(TextSimplePortionPrimitive2D::operator==(rPrimitive))
- {
- const TextDecoratedPortionPrimitive2D& rCompare = (TextDecoratedPortionPrimitive2D&)rPrimitive;
-
- return (getOverlineColor() == rCompare.getOverlineColor()
- && getTextlineColor() == rCompare.getTextlineColor()
- && getFontOverline() == rCompare.getFontOverline()
- && getFontUnderline() == rCompare.getFontUnderline()
- && getTextStrikeout() == rCompare.getTextStrikeout()
- && getTextEmphasisMark() == rCompare.getTextEmphasisMark()
- && getTextRelief() == rCompare.getTextRelief()
- && getUnderlineAbove() == rCompare.getUnderlineAbove()
- && getWordLineMode() == rCompare.getWordLineMode()
- && getEmphasisMarkAbove() == rCompare.getEmphasisMarkAbove()
- && getEmphasisMarkBelow() == rCompare.getEmphasisMarkBelow()
- && getShadow() == rCompare.getShadow());
- }
-
- return false;
- }
-
- // #i96475#
- // Added missing implementation. Decorations may (will) stick out of the text's
+ // #i96475# Added missing implementation. Decorations may (will) stick out of the text's
// inking area, so add them if needed
basegfx::B2DRange TextDecoratedPortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
index ef9fbf67e4a7..43f89c666438 100644
--- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
@@ -63,7 +63,7 @@ namespace drawinglayer
// prepare transform of sub-group back to it's position and rotation
basegfx::B2DHomMatrix aForwardTransform(basegfx::tools::createRotateB2DHomMatrix(getDirection()));
- aForwardTransform.translate(getRotationCenter().getX(), getRotationCenter().getY());
+ aForwardTransform.translate(getRotationCenter());
// create transformation for one discrete unit
const bool bEmbossed(
@@ -78,12 +78,12 @@ namespace drawinglayer
if(bEmbossed)
{
// to bottom-right
- aTransform.translate(aDiagonalDistance.getX(), aDiagonalDistance.getY());
+ aTransform.translate(aDiagonalDistance);
}
else
{
// to top-left
- aTransform.translate(-aDiagonalDistance.getX(), -aDiagonalDistance.getY());
+ aTransform.translate(-aDiagonalDistance);
}
aTransform *= aForwardTransform;
@@ -174,21 +174,6 @@ namespace drawinglayer
{
}
- bool TextEffectPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const TextEffectPrimitive2D& rCompare = (TextEffectPrimitive2D&)rPrimitive;
-
- return (getTextContent() == rCompare.getTextContent()
- && getRotationCenter() == rCompare.getRotationCenter()
- && getDirection() == rCompare.getDirection()
- && getTextEffectStyle2D() == rCompare.getTextEffectStyle2D());
- }
-
- return false;
- }
-
basegfx::B2DRange TextEffectPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// get range of content and grow by used fDiscreteSize. That way it is not necessary to ask
diff --git a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
index 6e12871249c7..2d834725d94c 100644
--- a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
@@ -108,26 +108,15 @@ namespace drawinglayer
TextHierarchyFieldPrimitive2D::TextHierarchyFieldPrimitive2D(
const Primitive2DSequence& rChildren,
const FieldType& rFieldType,
- const rtl::OUString& rString)
+ const rtl::OUString& rStringA,
+ const rtl::OUString& rStringB)
: GroupPrimitive2D(rChildren),
meType(rFieldType),
- maString(rString)
+ maStringA(rStringA),
+ maStringB(rStringB)
{
}
- bool TextHierarchyFieldPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const TextHierarchyFieldPrimitive2D& rCompare = (TextHierarchyFieldPrimitive2D&)rPrimitive;
-
- return (getType() == rCompare.getType()
- && getString() == rCompare.getString());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(TextHierarchyFieldPrimitive2D, PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D)
} // end of namespace primitive2d
diff --git a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
index 14fd4cfec13a..630ea505642d 100644
--- a/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textlineprimitive2d.cxx
@@ -59,7 +59,8 @@ namespace drawinglayer
static const int aLongDashArray[] = { 7, 2, 0}; // LONGDASH
// get decomposition
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -200,7 +201,9 @@ namespace drawinglayer
const basegfx::B2DHomMatrix aUnscaledTransform(
basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
- fShearX, fRotate, aTranslate));
+ fShearX,
+ fRotate,
+ aTranslate));
aLine.transform(aUnscaledTransform);
@@ -240,8 +243,7 @@ namespace drawinglayer
}
// move base point of text to 0.0 and de-rotate
- basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(
- -aTranslate.getX(), -aTranslate.getY()));
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-aTranslate));
aTransform.rotate(-fRotate);
// translate in Y by offset
@@ -249,7 +251,7 @@ namespace drawinglayer
// move back and rotate
aTransform.rotate(fRotate);
- aTransform.translate(aTranslate.getX(), aTranslate.getY());
+ aTransform.translate(aTranslate);
// add transform primitive
const Primitive2DSequence aContent(&aNewPrimitive, 1);
@@ -278,23 +280,6 @@ namespace drawinglayer
{
}
- bool TextLinePrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const TextLinePrimitive2D& rCompare = (TextLinePrimitive2D&)rPrimitive;
-
- return (getObjectTransformation() == rCompare.getObjectTransformation()
- && getWidth() == rCompare.getWidth()
- && getOffset() == rCompare.getOffset()
- && getHeight() == rCompare.getHeight()
- && getTextLine() == rCompare.getTextLine()
- && getLineColor() == rCompare.getLineColor());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(TextLinePrimitive2D, PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index 9eedb4c83edd..29a8627d08c5 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -100,7 +100,8 @@ namespace drawinglayer
if(getTextLength())
{
// decompose object transformation to single values
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
// if decomposition returns false, create no geometry since e.g. scaling may
@@ -129,13 +130,15 @@ namespace drawinglayer
aFontScale.getY(),
getLocale());
- // When getting outlines from stretched text (aScale.getX() != 1.0) it
+ // When getting outlines from stretched text (fabs(aScale.getX()) != 1.0) it
// is necessary to inverse-scale the DXArray (if used) to not get the
// outlines already aligned to given, but wrong DXArray
- if(getDXArray().size() && !basegfx::fTools::equal(aScale.getX(), 1.0))
+ const double fAbsScaleX(fabs(aScale.getX()));
+
+ if(getDXArray().size() && !basegfx::fTools::equal(fAbsScaleX, 1.0))
{
::std::vector< double > aScaledDXArray = getDXArray();
- const double fDXArrayScale(1.0 / aScale.getX());
+ const double fDXArrayScale(1.0 / fAbsScaleX);
for(sal_uInt32 a(0); a < aScaledDXArray.size(); a++)
{
@@ -168,7 +171,10 @@ namespace drawinglayer
{
// prepare object transformation for polygons
rTransformation = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aScale, fShearX, fRotate, aTranslate);
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate);
}
}
}
@@ -206,7 +212,8 @@ namespace drawinglayer
if(getFontAttribute().getOutline())
{
// decompose polygon transformation to single values
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
aPolygonTransform.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -259,32 +266,14 @@ namespace drawinglayer
&& rA.Variant == rB.Variant);
}
- bool TextSimplePortionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const TextSimplePortionPrimitive2D& rCompare = (TextSimplePortionPrimitive2D&)rPrimitive;
-
- return (getTextTransform() == rCompare.getTextTransform()
- && getText() == rCompare.getText()
- && getTextPosition() == rCompare.getTextPosition()
- && getTextLength() == rCompare.getTextLength()
- && getDXArray() == rCompare.getDXArray()
- && getFontAttribute() == rCompare.getFontAttribute()
- && LocalesAreEqual(getLocale(), rCompare.getLocale())
- && getFontColor() == rCompare.getFontColor());
- }
-
- return false;
- }
-
basegfx::B2DRange TextSimplePortionPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
if(maB2DRange.isEmpty() && getTextLength())
{
// get TextBoundRect as base size
// decompose object transformation to single values
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
if(getTextTransform().decompose(aScale, aTranslate, fRotate, fShearX))
@@ -310,8 +299,12 @@ namespace drawinglayer
if(!aNewRange.isEmpty())
{
// prepare object transformation for range
- const basegfx::B2DHomMatrix aRangeTransformation(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aScale, fShearX, fRotate, aTranslate));
+ const basegfx::B2DHomMatrix aRangeTransformation(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate));
// apply range transformation to it
aNewRange.transform(aRangeTransformation);
diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
index e2d835d366e9..5e429090abdc 100644
--- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
@@ -50,20 +50,6 @@ namespace drawinglayer
maFontColor(rFontColor)
{
}
-
- bool BaseTextStrikeoutPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const BaseTextStrikeoutPrimitive2D& rCompare = (BaseTextStrikeoutPrimitive2D&)rPrimitive;
-
- return (getObjectTransformation() == rCompare.getObjectTransformation()
- && getWidth() == rCompare.getWidth()
- && getFontColor() == rCompare.getFontColor());
- }
-
- return false;
- }
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -77,7 +63,8 @@ namespace drawinglayer
{
// strikeout with character
const String aSingleCharString(getStrikeoutChar());
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
// get decomposition
@@ -132,20 +119,6 @@ namespace drawinglayer
{
}
- bool TextCharacterStrikeoutPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(BaseTextStrikeoutPrimitive2D::operator==(rPrimitive))
- {
- const TextCharacterStrikeoutPrimitive2D& rCompare = (TextCharacterStrikeoutPrimitive2D&)rPrimitive;
-
- return (getStrikeoutChar() == rCompare.getStrikeoutChar()
- && getFontAttribute() == rCompare.getFontAttribute()
- && LocalesAreEqual(getLocale(), rCompare.getLocale()));
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(TextCharacterStrikeoutPrimitive2D, PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D)
@@ -169,7 +142,8 @@ namespace drawinglayer
bool bDoubleLine(false);
// get decomposition
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -206,7 +180,9 @@ namespace drawinglayer
const basegfx::B2DHomMatrix aUnscaledTransform(
basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
- fShearX, fRotate, aTranslate));
+ fShearX,
+ fRotate,
+ aTranslate));
aStrikeoutLine.transform(aUnscaledTransform);
@@ -222,8 +198,7 @@ namespace drawinglayer
const double fLineDist(2.0 * fStrikeoutHeight);
// move base point of text to 0.0 and de-rotate
- basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(
- -aTranslate.getX(), -aTranslate.getY()));
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-aTranslate));
aTransform.rotate(-fRotate);
// translate in Y by offset
@@ -231,7 +206,7 @@ namespace drawinglayer
// move back and rotate
aTransform.rotate(fRotate);
- aTransform.translate(aTranslate.getX(), aTranslate.getY());
+ aTransform.translate(aTranslate);
// add transform primitive
appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
@@ -258,20 +233,6 @@ namespace drawinglayer
{
}
- bool TextGeometryStrikeoutPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(BaseTextStrikeoutPrimitive2D::operator==(rPrimitive))
- {
- const TextGeometryStrikeoutPrimitive2D& rCompare = (TextGeometryStrikeoutPrimitive2D&)rPrimitive;
-
- return (getHeight() == rCompare.getHeight()
- && getOffset() == rCompare.getOffset()
- && getTextStrikeout() == rCompare.getTextStrikeout());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(TextGeometryStrikeoutPrimitive2D, PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/transformprimitive2d.cxx b/drawinglayer/source/primitive2d/transformprimitive2d.cxx
index 2a5a2b72a1d5..3f1d3036a644 100644
--- a/drawinglayer/source/primitive2d/transformprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/transformprimitive2d.cxx
@@ -46,18 +46,6 @@ namespace drawinglayer
{
}
- bool TransformPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const TransformPrimitive2D& rCompare = static_cast< const TransformPrimitive2D& >(rPrimitive);
-
- return (getTransformation() == rCompare.getTransformation());
- }
-
- return false;
- }
-
basegfx::B2DRange TransformPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
basegfx::B2DRange aRetval(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
diff --git a/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx
index 78eb0b459d76..26a6fe0622bd 100644
--- a/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx
@@ -43,18 +43,6 @@ namespace drawinglayer
{
}
- bool TransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const TransparencePrimitive2D& rCompare = (TransparencePrimitive2D&)rPrimitive;
-
- return (getTransparence() == rCompare.getTransparence());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(TransparencePrimitive2D, PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D)
} // end of namespace primitive2d
diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
index 4c0402eaaed0..7c241f557766 100644
--- a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
@@ -49,18 +49,6 @@ namespace drawinglayer
{
}
- bool UnifiedTransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const UnifiedTransparencePrimitive2D& rCompare = (UnifiedTransparencePrimitive2D&)rPrimitive;
-
- return (getTransparence() == rCompare.getTransparence());
- }
-
- return false;
- }
-
basegfx::B2DRange UnifiedTransparencePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
{
// do not use the fallback to decomposition here since for a correct BoundRect we also
diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
index ffb341c4fe64..08b1764af40d 100644
--- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
@@ -236,20 +236,6 @@ namespace drawinglayer
{
}
- bool WallpaperBitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(ViewTransformationDependentPrimitive2D::operator==(rPrimitive))
- {
- const WallpaperBitmapPrimitive2D& rCompare = (WallpaperBitmapPrimitive2D&)rPrimitive;
-
- return (getLocalObjectRange() == rCompare.getLocalObjectRange()
- && getBitmapEx() == rCompare.getBitmapEx()
- && getWallpaperStyle() == rCompare.getWallpaperStyle());
- }
-
- return false;
- }
-
basegfx::B2DRange WallpaperBitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
return getLocalObjectRange();
diff --git a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
index 309bca4ad16a..9ccdb512ff13 100644
--- a/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wrongspellprimitive2d.cxx
@@ -50,7 +50,8 @@ namespace drawinglayer
// direct WrongSpellPrimitive2D support, You may want to do the described change here.
// get the font height (part of scale), so decompose the matrix
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -93,21 +94,6 @@ namespace drawinglayer
{
}
- bool WrongSpellPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const WrongSpellPrimitive2D& rCompare = (WrongSpellPrimitive2D&)rPrimitive;
-
- return (getTransformation() == rCompare.getTransformation()
- && getStart() == rCompare.getStart()
- && getStop() == rCompare.getStop()
- && getColor() == rCompare.getColor());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(WrongSpellPrimitive2D, PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive3d/baseprimitive3d.cxx b/drawinglayer/source/primitive3d/baseprimitive3d.cxx
index 96142a5b1367..b3fe132fe548 100644
--- a/drawinglayer/source/primitive3d/baseprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/baseprimitive3d.cxx
@@ -47,11 +47,6 @@ namespace drawinglayer
{
}
- bool BasePrimitive3D::operator==( const BasePrimitive3D& rPrimitive ) const
- {
- return (getPrimitive3DID() == rPrimitive.getPrimitive3DID());
- }
-
basegfx::B3DRange BasePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
{
return getB3DRangeFromPrimitive3DSequence(get3DDecomposition(rViewInformation), rViewInformation);
@@ -159,69 +154,6 @@ namespace drawinglayer
return aRetval;
}
- bool arePrimitive3DReferencesEqual(const Primitive3DReference& rxA, const Primitive3DReference& rxB)
- {
- const sal_Bool bAIs(rxA.is());
-
- if(bAIs != rxB.is())
- {
- return false;
- }
-
- if(!bAIs)
- {
- return true;
- }
-
- const BasePrimitive3D* pA(dynamic_cast< const BasePrimitive3D* >(rxA.get()));
- const BasePrimitive3D* pB(dynamic_cast< const BasePrimitive3D* >(rxB.get()));
- const bool bAEqualZero(pA == 0L);
-
- if(bAEqualZero != (pB == 0L))
- {
- return false;
- }
-
- if(bAEqualZero)
- {
- return false;
- }
-
- return (pA->operator==(*pB));
- }
-
- bool arePrimitive3DSequencesEqual(const Primitive3DSequence& rA, const Primitive3DSequence& rB)
- {
- const sal_Bool bAHasElements(rA.hasElements());
-
- if(bAHasElements != rB.hasElements())
- {
- return false;
- }
-
- if(!bAHasElements)
- {
- return true;
- }
-
- const sal_Int32 nCount(rA.getLength());
-
- if(nCount != rB.getLength())
- {
- return false;
- }
-
- for(sal_Int32 a(0L); a < nCount; a++)
- {
- if(!arePrimitive3DReferencesEqual(rA[a], rB[a]))
- {
- return false;
- }
- }
-
- return true;
- }
-
// concatenate sequence
void appendPrimitive3DSequenceToPrimitive3DSequence(Primitive3DSequence& rDest, const Primitive3DSequence& rSource)
{
diff --git a/drawinglayer/source/primitive3d/groupprimitive3d.cxx b/drawinglayer/source/primitive3d/groupprimitive3d.cxx
index 7a9cfbbe7a5b..74e65e74ad91 100644
--- a/drawinglayer/source/primitive3d/groupprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/groupprimitive3d.cxx
@@ -43,22 +43,6 @@ namespace drawinglayer
{
}
- /** The compare opertator uses the Sequence::==operator, so only checking if
- the rererences are equal. All non-equal references are interpreted as
- non-equal.
- */
- bool GroupPrimitive3D::operator==( const BasePrimitive3D& rPrimitive ) const
- {
- if(BasePrimitive3D::operator==(rPrimitive))
- {
- const GroupPrimitive3D& rCompare = static_cast< const GroupPrimitive3D& >(rPrimitive);
-
- return (arePrimitive3DSequencesEqual(getChildren(), rCompare.getChildren()));
- }
-
- return false;
- }
-
/// default: just return children, so all renderers not supporting group will use it's content
Primitive3DSequence GroupPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index 7b13bfed0cce..099067a3f5f7 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -280,18 +280,6 @@ namespace drawinglayer
{
}
- bool HatchTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(TexturePrimitive3D::operator==(rPrimitive))
- {
- const HatchTexturePrimitive3D& rCompare = (HatchTexturePrimitive3D&)rPrimitive;
-
- return (getHatch() == rCompare.getHatch());
- }
-
- return false;
- }
-
Primitive3DSequence HatchTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
::osl::MutexGuard aGuard( m_aMutex );
diff --git a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
index 6d59f2e1f172..78253848dd3d 100644
--- a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
@@ -45,18 +45,6 @@ namespace drawinglayer
{
}
- bool ModifiedColorPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(GroupPrimitive3D::operator==(rPrimitive))
- {
- const ModifiedColorPrimitive3D& rCompare = (ModifiedColorPrimitive3D&)rPrimitive;
-
- return (maColorModifier == rCompare.maColorModifier);
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive3DIDBlock(ModifiedColorPrimitive3D, PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D)
diff --git a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
index 669dc5ee171e..b587fc3dc66d 100644
--- a/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygonprimitive3d.cxx
@@ -50,19 +50,6 @@ namespace drawinglayer
{
}
- bool PolygonHairlinePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(BasePrimitive3D::operator==(rPrimitive))
- {
- const PolygonHairlinePrimitive3D& rCompare = (PolygonHairlinePrimitive3D&)rPrimitive;
-
- return (getB3DPolygon() == rCompare.getB3DPolygon()
- && getBColor() == rCompare.getBColor());
- }
-
- return false;
- }
-
basegfx::B3DRange PolygonHairlinePrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
return basegfx::tools::getRange(getB3DPolygon());
@@ -157,20 +144,6 @@ namespace drawinglayer
{
}
- bool PolygonStrokePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive3D::operator==(rPrimitive))
- {
- const PolygonStrokePrimitive3D& rCompare = (PolygonStrokePrimitive3D&)rPrimitive;
-
- return (getB3DPolygon() == rCompare.getB3DPolygon()
- && getLineAttribute() == rCompare.getLineAttribute()
- && getStrokeAttribute() == rCompare.getStrokeAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive3DIDBlock(PolygonStrokePrimitive3D, PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D)
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 39c8952980bd..00ee9dce73ef 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -697,22 +697,6 @@ namespace drawinglayer
{
}
- bool PolygonTubePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(PolygonHairlinePrimitive3D::operator==(rPrimitive))
- {
- const PolygonTubePrimitive3D& rCompare = (PolygonTubePrimitive3D&)rPrimitive;
-
- return (getRadius() == rCompare.getRadius()
- && getDegreeStepWidth() == rCompare.getDegreeStepWidth()
- && getMiterMinimumAngle() == rCompare.getMiterMinimumAngle()
- && getLineJoin() == rCompare.getLineJoin()
- && getLineCap() == rCompare.getLineCap());
- }
-
- return false;
- }
-
Primitive3DSequence PolygonTubePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const
{
::osl::MutexGuard aGuard( m_aMutex );
diff --git a/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx
index 23deb42eed66..0d884bbd4be2 100644
--- a/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polypolygonprimitive3d.cxx
@@ -50,20 +50,6 @@ namespace drawinglayer
{
}
- bool PolyPolygonMaterialPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(BasePrimitive3D::operator==(rPrimitive))
- {
- const PolyPolygonMaterialPrimitive3D& rCompare = (PolyPolygonMaterialPrimitive3D&)rPrimitive;
-
- return (getB3DPolyPolygon() == rCompare.getB3DPolyPolygon()
- && getMaterial() == rCompare.getMaterial()
- && getDoubleSided() == rCompare.getDoubleSided());
- }
-
- return false;
- }
-
basegfx::B3DRange PolyPolygonMaterialPrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
return basegfx::tools::getRange(getB3DPolyPolygon());
diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
index cc784ea118e4..437722b59bc0 100644
--- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
@@ -47,9 +47,8 @@ namespace drawinglayer
{
Primitive3DSequence SdrCubePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
- const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
Primitive3DSequence aRetval;
- basegfx::B3DPolyPolygon aFill(basegfx::tools::createCubeFillPolyPolygonFromB3DRange(aUnitRange));
+ basegfx::B3DPolyPolygon aFill(basegfx::tools::createCubeFillPolyPolygonFromB3DRange(basegfx::B3DRange::getUnitB3DRange()));
// normal creation
if(!getSdrLFSAttribute().getFill().isDefault())
@@ -130,7 +129,7 @@ namespace drawinglayer
// transform texture coordinates to texture size
basegfx::B2DHomMatrix aTexMatrix;
- aTexMatrix.scale(getTextureSize().getX(), getTextureSize().getY());
+ aTexMatrix.scale(getTextureSize());
aFill.transformTextureCoordiantes(aTexMatrix);
}
@@ -166,7 +165,7 @@ namespace drawinglayer
// add line
if(!getSdrLFSAttribute().getLine().isDefault())
{
- basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(aUnitRange));
+ basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(basegfx::B3DRange::getUnitB3DRange()));
const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
aLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
@@ -192,11 +191,6 @@ namespace drawinglayer
{
}
- bool SdrCubePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- return SdrPrimitive3D::operator==(rPrimitive);
- }
-
basegfx::B3DRange SdrCubePrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2.
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index 3152efad65f8..77afaf8a60f5 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -132,7 +132,7 @@ namespace drawinglayer
// transform texture coordinates to texture size
basegfx::B2DHomMatrix aTexMatrix;
- aTexMatrix.scale(rTextureSize.getX(), rTextureSize.getY());
+ aTexMatrix.scale(rTextureSize);
for(a = 0; a < rFill.size(); a++)
{
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index 7dcaa1a04538..00d7b1f405b4 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -459,27 +459,6 @@ namespace drawinglayer
}
}
- bool SdrExtrudePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(SdrPrimitive3D::operator==(rPrimitive))
- {
- const SdrExtrudePrimitive3D& rCompare = static_cast< const SdrExtrudePrimitive3D& >(rPrimitive);
-
- return (getPolyPolygon() == rCompare.getPolyPolygon()
- && getDepth() == rCompare.getDepth()
- && getDiagonal() == rCompare.getDiagonal()
- && getBackScale() == rCompare.getBackScale()
- && getSmoothNormals() == rCompare.getSmoothNormals()
- && getSmoothHorizontalNormals() == rCompare.getSmoothHorizontalNormals()
- && getSmoothLids() == rCompare.getSmoothLids()
- && getCharacterMode() == rCompare.getCharacterMode()
- && getCloseFront() == rCompare.getCloseFront()
- && getCloseBack() == rCompare.getCloseBack());
- }
-
- return false;
- }
-
basegfx::B3DRange SdrExtrudePrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index 5742720674fa..d4a7d66111c8 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -318,29 +318,6 @@ namespace drawinglayer
}
}
- bool SdrLathePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(SdrPrimitive3D::operator==(rPrimitive))
- {
- const SdrLathePrimitive3D& rCompare = static_cast< const SdrLathePrimitive3D& >(rPrimitive);
-
- return (getPolyPolygon() == rCompare.getPolyPolygon()
- && getHorizontalSegments() == rCompare.getHorizontalSegments()
- && getVerticalSegments() == rCompare.getVerticalSegments()
- && getDiagonal() == rCompare.getDiagonal()
- && getBackScale() == rCompare.getBackScale()
- && getRotation() == rCompare.getRotation()
- && getSmoothNormals() == rCompare.getSmoothNormals()
- && getSmoothHorizontalNormals() == rCompare.getSmoothHorizontalNormals()
- && getSmoothLids() == rCompare.getSmoothLids()
- && getCharacterMode() == rCompare.getCharacterMode()
- && getCloseFront() == rCompare.getCloseFront()
- && getCloseBack() == rCompare.getCloseBack());
- }
-
- return false;
- }
-
basegfx::B3DRange SdrLathePrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2
diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
index b407f98c3588..5aa717c84b6e 100644
--- a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
@@ -139,18 +139,6 @@ namespace drawinglayer
{
}
- bool SdrPolyPolygonPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(SdrPrimitive3D::operator==(rPrimitive))
- {
- const SdrPolyPolygonPrimitive3D& rCompare = static_cast< const SdrPolyPolygonPrimitive3D& >(rPrimitive);
-
- return (getPolyPolygon3D() == rCompare.getPolyPolygon3D());
- }
-
- return false;
- }
-
basegfx::B3DRange SdrPolyPolygonPrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
// added this implementation to make sure that non-visible objects of this
diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
index e54125e2c637..0e9452b4cd64 100644
--- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
@@ -41,7 +41,7 @@ namespace drawinglayer
{
basegfx::B3DRange SdrPrimitive3D::getStandard3DRange() const
{
- basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
+ basegfx::B3DRange aUnitRange(basegfx::B3DRange::getUnitB3DRange());
aUnitRange.transform(getTransform());
if(!getSdrLFSAttribute().getLine().isDefault())
@@ -98,22 +98,6 @@ namespace drawinglayer
maSdr3DObjectAttribute(rSdr3DObjectAttribute)
{
}
-
- bool SdrPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive3D::operator==(rPrimitive))
- {
- const SdrPrimitive3D& rCompare = static_cast< const SdrPrimitive3D& >(rPrimitive);
-
- return (getTransform() == rCompare.getTransform()
- && getTextureSize() == rCompare.getTextureSize()
- && getSdrLFSAttribute() == rCompare.getSdrLFSAttribute()
- && getSdr3DObjectAttribute() == rCompare.getSdr3DObjectAttribute());
- }
-
- return false;
- }
-
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
index 4e430caed653..ac451005fa3d 100644
--- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
@@ -48,12 +48,12 @@ namespace drawinglayer
Primitive3DSequence SdrSpherePrimitive3D::create3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
Primitive3DSequence aRetval;
- const basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
const bool bCreateNormals(::com::sun::star::drawing::NormalsKind_SPECIFIC == getSdr3DObjectAttribute().getNormalsKind()
|| ::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind());
// create unit geometry
- basegfx::B3DPolyPolygon aFill(basegfx::tools::createSphereFillPolyPolygonFromB3DRange(aUnitRange,
+ basegfx::B3DPolyPolygon aFill(basegfx::tools::createSphereFillPolyPolygonFromB3DRange(
+ basegfx::B3DRange::getUnitB3DRange(),
getHorizontalSegments(), getVerticalSegments(), bCreateNormals));
// normal inversion
@@ -119,7 +119,7 @@ namespace drawinglayer
// transform texture coordinates to texture size
basegfx::B2DHomMatrix aTexMatrix;
- aTexMatrix.scale(getTextureSize().getX(), getTextureSize().getY());
+ aTexMatrix.scale(getTextureSize());
aFill.transformTextureCoordiantes(aTexMatrix);
}
@@ -155,7 +155,8 @@ namespace drawinglayer
// add line
if(!getSdrLFSAttribute().getLine().isDefault())
{
- basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(aUnitRange, getHorizontalSegments(), getVerticalSegments()));
+ basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(
+ basegfx::B3DRange::getUnitB3DRange(), getHorizontalSegments(), getVerticalSegments()));
const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
aSphere, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
@@ -186,19 +187,6 @@ namespace drawinglayer
{
}
- bool SdrSpherePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(SdrPrimitive3D::operator==(rPrimitive))
- {
- const SdrSpherePrimitive3D& rCompare = static_cast< const SdrSpherePrimitive3D& >(rPrimitive);
-
- return (getHorizontalSegments() == rCompare.getHorizontalSegments()
- && getVerticalSegments() == rCompare.getVerticalSegments());
- }
-
- return false;
- }
-
basegfx::B3DRange SdrSpherePrimitive3D::getB3DRange(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
// use defaut from sdrPrimitive3D which uses transformation expanded by line width/2
diff --git a/drawinglayer/source/primitive3d/shadowprimitive3d.cxx b/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
index 16ed05f83aa0..f1268daf37aa 100644
--- a/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/shadowprimitive3d.cxx
@@ -51,21 +51,6 @@ namespace drawinglayer
{
}
- bool ShadowPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(GroupPrimitive3D::operator==(rPrimitive))
- {
- const ShadowPrimitive3D& rCompare = (ShadowPrimitive3D&)rPrimitive;
-
- return (getShadowTransform() == rCompare.getShadowTransform()
- && getShadowColor() == rCompare.getShadowColor()
- && getShadowTransparence() == rCompare.getShadowTransparence()
- && getShadow3D() == rCompare.getShadow3D());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive3DIDBlock(ShadowPrimitive3D, PRIMITIVE3D_ID_SHADOWPRIMITIVE3D)
diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
index 77ffb85991b2..8d02c0ec74db 100644
--- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
@@ -48,19 +48,6 @@ namespace drawinglayer
mbFilter(bFilter)
{
}
-
- bool TexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(GroupPrimitive3D::operator==(rPrimitive))
- {
- const TexturePrimitive3D& rCompare = (TexturePrimitive3D&)rPrimitive;
-
- return (getModulate() == rCompare.getModulate()
- && getFilter() == rCompare.getFilter());
- }
-
- return false;
- }
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -78,18 +65,6 @@ namespace drawinglayer
{
}
- bool UnifiedTransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(TexturePrimitive3D::operator==(rPrimitive))
- {
- const UnifiedTransparenceTexturePrimitive3D& rCompare = (UnifiedTransparenceTexturePrimitive3D&)rPrimitive;
-
- return (getTransparence() == rCompare.getTransparence());
- }
-
- return false;
- }
-
basegfx::B3DRange UnifiedTransparenceTexturePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
{
// do not use the fallback to decomposition here since for a correct BoundRect we also
@@ -142,18 +117,6 @@ namespace drawinglayer
{
}
- bool GradientTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(TexturePrimitive3D::operator==(rPrimitive))
- {
- const GradientTexturePrimitive3D& rCompare = (GradientTexturePrimitive3D&)rPrimitive;
-
- return (getGradient() == rCompare.getGradient());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive3DIDBlock(GradientTexturePrimitive3D, PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D)
@@ -176,18 +139,6 @@ namespace drawinglayer
{
}
- bool BitmapTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(TexturePrimitive3D::operator==(rPrimitive))
- {
- const BitmapTexturePrimitive3D& rCompare = (BitmapTexturePrimitive3D&)rPrimitive;
-
- return (getFillGraphicAttribute() == rCompare.getFillGraphicAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive3DIDBlock(BitmapTexturePrimitive3D, PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D)
@@ -208,11 +159,6 @@ namespace drawinglayer
{
}
- bool TransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- return (GradientTexturePrimitive3D::operator==(rPrimitive));
- }
-
// provide unique ID
ImplPrimitrive3DIDBlock(TransparenceTexturePrimitive3D, PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D)
diff --git a/drawinglayer/source/primitive3d/transformprimitive3d.cxx b/drawinglayer/source/primitive3d/transformprimitive3d.cxx
index 68cbf92697fe..c798845073c0 100644
--- a/drawinglayer/source/primitive3d/transformprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/transformprimitive3d.cxx
@@ -46,18 +46,6 @@ namespace drawinglayer
{
}
- bool TransformPrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
- {
- if(GroupPrimitive3D::operator==(rPrimitive))
- {
- const TransformPrimitive3D& rCompare = static_cast< const TransformPrimitive3D& >(rPrimitive);
-
- return (getTransformation() == rCompare.getTransformation());
- }
-
- return false;
- }
-
basegfx::B3DRange TransformPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
{
basegfx::B3DRange aRetval(getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation));
diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx
index 336f10b5fc93..87fee9e2d164 100644
--- a/drawinglayer/source/processor2d/baseprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx
@@ -36,7 +36,9 @@ namespace drawinglayer
{
namespace processor2d
{
- void BaseProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& /*rCandidate*/)
+ void BaseProcessor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& /*rCandidate*/,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
}
@@ -58,7 +60,7 @@ namespace drawinglayer
for(sal_Int32 a(0L); a < nCount; a++)
{
// get reference
- const primitive2d::Primitive2DReference xReference(rSource[a]);
+ const primitive2d::Primitive2DReference& xReference(rSource[a]);
if(xReference.is())
{
@@ -68,7 +70,7 @@ namespace drawinglayer
if(pBasePrimitive)
{
// it is a BasePrimitive2D implementation, use local processor
- processBasePrimitive2D(*pBasePrimitive);
+ processBasePrimitive2D(*pBasePrimitive, xReference);
}
else
{
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index b7b754671301..575198eb99c1 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -59,7 +59,9 @@ namespace drawinglayer
{
}
- void ContourExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ void ContourExtractor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
switch(rCandidate.getPrimitive2DID())
{
diff --git a/drawinglayer/source/processor2d/hairlineextractor2d.cxx b/drawinglayer/source/processor2d/hairlineextractor2d.cxx
new file mode 100644
index 000000000000..34551a7f48f2
--- /dev/null
+++ b/drawinglayer/source/processor2d/hairlineextractor2d.cxx
@@ -0,0 +1,310 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/processor2d/hairlineextractor2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
+#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
+#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
+#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
+#include <drawinglayer/primitive2d/mediaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ HairlineGeometryExtractor2D::HairlineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation)
+ : BaseProcessor2D(rViewInformation),
+ maExtractedHairlines()
+ {
+ }
+
+ HairlineGeometryExtractor2D::~HairlineGeometryExtractor2D()
+ {
+ }
+
+ void HairlineGeometryExtractor2D::addB2DPolygon(const basegfx::B2DPolygon& rPolygon)
+ {
+ maExtractedHairlines.push_back(basegfx::B2DPolyPolygon(getViewInformation2D().getObjectTransformation() * rPolygon));
+ }
+
+ void HairlineGeometryExtractor2D::addB2DPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon)
+ {
+ maExtractedHairlines.push_back(getViewInformation2D().getObjectTransformation() * rPolyPolygon);
+ }
+
+ void HairlineGeometryExtractor2D::addB2DTransform(const basegfx::B2DHomMatrix& rTransform)
+ {
+ addB2DPolygon(rTransform * basegfx::tools::createUnitPolygon());
+ }
+
+ void HairlineGeometryExtractor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
+ {
+ switch(rCandidate.getPrimitive2DID())
+ {
+ // basic primitives:
+ //
+ // - BitmapPrimitive2D (bitmap data, evtl. with transparence)
+ // - PointArrayPrimitive2D (single points)
+ // - PolygonHairlinePrimitive2D (hairline curves/polygons)
+ // - PolyPolygonColorPrimitive2D (colored polygons)
+
+ case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::BitmapPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getTransform());
+ break;
+ }
+ case PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D :
+ {
+ // can be ignored
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D :
+ {
+ // extract hairline
+ const primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate));
+ addB2DPolygon(rPolygonCandidate.getB2DPolygon());
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
+ {
+ // extract outline
+ const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate));
+ addB2DPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
+ break;
+ }
+
+ // state primitives:
+ //
+ // - TransparencePrimitive2D (objects with freely defined transparence)
+ // - InvertPrimitive2D (for XOR)
+ // - MaskPrimitive2D (for masking)
+ // - ModifiedColorPrimitive2D (for a stack of color modifications)
+ // - TransformPrimitive2D (for a transformation stack)
+
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_INVERTPRIMITIVE2D :
+ case PRIMITIVE2D_ID_MODIFIEDCOLORPRIMITIVE2D :
+ {
+ // use children (without transparence, invert or colorchange)
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
+ {
+ // extract mask outline
+ const primitive2d::MaskPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::MaskPrimitive2D& >(rCandidate));
+ addB2DPolyPolygon(rPolygonCandidate.getMask());
+ break;
+ }
+ case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D :
+ {
+ // remember current transformation and ViewInformation
+ const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
+ const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+
+ // create new transformations for CurrentTransformation and for local ViewInformation2D
+ const geometry::ViewInformation2D aViewInformation2D(
+ getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(),
+ getViewInformation2D().getViewTransformation(),
+ getViewInformation2D().getViewport(),
+ getViewInformation2D().getVisualizedPage(),
+ getViewInformation2D().getViewTime(),
+ getViewInformation2D().getExtendedInformationSequence());
+ updateViewInformation(aViewInformation2D);
+
+ // proccess content
+ process(rTransformCandidate.getChildren());
+
+ // restore transformations
+ updateViewInformation(aLastViewInformation2D);
+
+ break;
+ }
+
+ // everything with fat lines and/or arrows needs to be taken directly,
+ // the decomposition would create the fat line/arrow geometries which
+ // we do not want here
+
+ case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYGONSTROKEARROWPRIMITIVE2D :
+ {
+ // ignore stroke and arrow, extract as hairline
+ const primitive2d::PolygonStrokePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonStrokePrimitive2D& >(rCandidate));
+ addB2DPolygon(rPolygonCandidate.getB2DPolygon());
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYPOLYGONSTROKEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONSTROKEARROWPRIMITIVE2D :
+ {
+ // ignore stroke and arrow, extract as hairline
+ const primitive2d::PolyPolygonStrokePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonStrokePrimitive2D& >(rCandidate));
+ addB2DPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
+ break;
+ }
+
+ // take hidden geometry into account. If the object is invisible,
+ // this contains minimal graphical descriptions. We need to take
+ // this for hairline geometry extraction
+ case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D :
+ {
+ // use children directly since default decomposition is empty (since
+ // invisible)
+ const primitive2d::HiddenGeometryPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::HiddenGeometryPrimitive2D& >(rCandidate));
+ process(rPolygonCandidate.getChildren());
+ break;
+ }
+
+ // optimizations:
+ // everything here is a shortcut to avoid unnecessary decompositions
+
+ case PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D :
+ {
+ // extract as hairline
+ const primitive2d::PolyPolygonHairlinePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonHairlinePrimitive2D& >(rCandidate));
+ addB2DPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYGONMARKERPRIMITIVE2D :
+ {
+ // extract hairline
+ const primitive2d::PolygonMarkerPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolygonMarkerPrimitive2D& >(rCandidate));
+ addB2DPolygon(rPolygonCandidate.getB2DPolygon());
+ break;
+ }
+ case PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D :
+ {
+ // extract hairline
+ const primitive2d::PolyPolygonMarkerPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonMarkerPrimitive2D& >(rCandidate));
+ addB2DPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
+ break;
+ }
+ case PRIMITIVE2D_ID_CONTROLPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::ControlPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::ControlPrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getTransform());
+ break;
+ }
+ case PRIMITIVE2D_ID_EPSPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::EpsPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::EpsPrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getEpsTransform());
+ break;
+ }
+ case PRIMITIVE2D_ID_GRAPHICPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::GraphicPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::GraphicPrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getTransform());
+ break;
+ }
+ case PRIMITIVE2D_ID_MEDIAPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::MediaPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::MediaPrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getTransform());
+ break;
+ }
+ case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::MetafilePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getTransform());
+ break;
+ }
+ case PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::PagePreviewPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PagePreviewPrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getTransform());
+ break;
+ }
+ case PRIMITIVE2D_ID_SCENEPRIMITIVE2D :
+ {
+ // extract bound rectangle
+ const primitive2d::ScenePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::ScenePrimitive2D& >(rCandidate));
+ addB2DTransform(rPolygonCandidate.getObjectTransformation());
+ break;
+ }
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
+ {
+ // use children directly, avoid decomposition
+ const primitive2d::UnifiedTransparencePrimitive2D& rPolygonCandidate(static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate));
+ process(rPolygonCandidate.getChildren());
+ break;
+ }
+
+ // text is not taken into account
+ case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D:
+ case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TEXTEFFECTPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
+ {
+ break;
+ }
+
+ // ignorable primitives
+ case PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_GRIDPRIMITIVE2D :
+ case PRIMITIVE2D_ID_BACKGROUNDCOLORPRIMITIVE2D :
+ case PRIMITIVE2D_ID_HELPLINEPRIMITIVE2D :
+ {
+ break;
+ }
+
+ // use decomposition, process recursively
+ default :
+ {
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ }
+ }
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 3b5e266f3bfd..a7e7382c1ac5 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -39,6 +39,7 @@
#include <drawinglayer/processor3d/cutfindprocessor3d.hxx>
#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,10 +50,12 @@ namespace drawinglayer
HitTestProcessor2D::HitTestProcessor2D(const geometry::ViewInformation2D& rViewInformation,
const basegfx::B2DPoint& rLogicHitPosition,
double fLogicHitTolerance,
- bool bHitTextOnly)
+ bool bHitTextOnly,
+ primitive2d::Primitive2DSequence* pRecordFields)
: BaseProcessor2D(rViewInformation),
maDiscreteHitPosition(),
mfDiscreteHitTolerance(0.0),
+ mpRecordFields(pRecordFields),
mbHit(false),
mbHitToleranceUsed(false),
mbUseInvisiblePrimitiveContent(true),
@@ -270,7 +273,9 @@ namespace drawinglayer
}
}
- void HitTestProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ void HitTestProcessor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate)
{
if(getHit())
{
@@ -498,9 +503,8 @@ namespace drawinglayer
aBackTransform.invert();
const basegfx::B2DPoint aRelativePoint(aBackTransform * getDiscreteHitPosition());
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- if(aUnitRange.isInside(aRelativePoint))
+ if(basegfx::B2DRange::getUnitB2DRange().isInside(aRelativePoint))
{
const sal_Int32 nX(basegfx::fround(aRelativePoint.getX() * rSizePixel.Width()));
const sal_Int32 nY(basegfx::fround(aRelativePoint.getY() * rSizePixel.Height()));
@@ -585,6 +589,30 @@ namespace drawinglayer
break;
}
+ case PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D :
+ {
+ const primitive2d::TextHierarchyFieldPrimitive2D& rFieldPrimitive(static_cast< const primitive2d::TextHierarchyFieldPrimitive2D& >(rCandidate));
+ const primitive2d::Primitive2DSequence& rChildren = rFieldPrimitive.getChildren();
+
+ // hit only possible with child content
+ if(rChildren.hasElements())
+ {
+ // remember old HitState
+ const bool bOldHit(getHit());
+
+ // process sub-content, the FieldContent itself
+ process(rChildren);
+
+ // if HitState changed, the FieldContent was the reason
+ if(mpRecordFields && bOldHit != getHit())
+ {
+ // record the TextHierarchyFieldPrimitive2D hit
+ primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpRecordFields, rUnoCandidate);
+ }
+ }
+
+ break;
+ }
default :
{
// process recursively
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index 97ecf9da6952..9d81e0989a33 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -52,7 +52,9 @@ namespace drawinglayer
{
}
- void LineGeometryExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ void LineGeometryExtractor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
switch(rCandidate.getPrimitive2DID())
{
diff --git a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
index 11f929f61125..1e0dd2d140ba 100755
--- a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
+++ b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
@@ -38,7 +38,9 @@ namespace drawinglayer
{
namespace processor2d
{
- void ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ void ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
if(!mpFound)
{
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
index 59a47fc790a6..d20f658af81a 100644
--- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -37,7 +37,9 @@ namespace drawinglayer
{
namespace processor2d
{
- void TextAsPolygonExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ void TextAsPolygonExtractor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
switch(rCandidate.getPrimitive2DID())
{
diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
index a0b3af099533..6053c483bb76 100644
--- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
@@ -47,7 +47,8 @@ namespace drawinglayer
GraphicAttr aAttributes;
// decompose matrix to check for shear, rotate and mirroring
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -64,7 +65,7 @@ namespace drawinglayer
}
// prepare Bitmap
- basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
+ basegfx::B2DRange aOutlineRange(basegfx::B2DRange::getUnitB2DRange());
if(basegfx::fTools::equalZero(fRotate))
{
@@ -107,8 +108,8 @@ namespace drawinglayer
BitmapEx aContent(rBitmapEx);
// prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less
- basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
- aOutlineRange.transform(rTransform);
+ const basegfx::B2DRange aOutlineRange(rTransform * basegfx::B2DRange::getUnitB2DRange());
+
// prepare dest coordinates
const Point aPoint(
basegfx::fround(aOutlineRange.getMinX()),
@@ -118,7 +119,8 @@ namespace drawinglayer
basegfx::fround(aOutlineRange.getHeight()));
// decompose matrix to check for shear, rotate and mirroring
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -150,8 +152,7 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& rTransform)
{
// process self with free transformation (containing shear and rotate). Get dest rect in pixels.
- basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
- aOutlineRange.transform(rTransform);
+ const basegfx::B2DRange aOutlineRange(rTransform * basegfx::B2DRange::getUnitB2DRange());
const Rectangle aDestRectLogic(
basegfx::fround(aOutlineRange.getMinX()),
basegfx::fround(aOutlineRange.getMinY()),
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 61207ecb5c1d..0adbae0821c3 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -667,7 +667,7 @@ namespace drawinglayer
XTEXT_SCROLLRECT, XTEXT_PAINTRECT
Currently used to get extra MetaFile infos using GraphicExporter which again uses
- SdrTextObj::GetTextScrollMetaFileAndRectangle(). ATM works with primitives since
+ SdrTextObj::GetTextScrollMetaFileAndRange(). ATM works with primitives since
the rectangle data is added directly by the GraphicsExporter as comment. Does not need
to be adapted at once.
When adapting later, the only user - the diashow - should directly use the provided
@@ -735,7 +735,9 @@ namespace drawinglayer
****************************************************************************************************/
- void VclMetafileProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ void VclMetafileProcessor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
switch(rCandidate.getPrimitive2DID())
{
@@ -749,7 +751,8 @@ namespace drawinglayer
{
const primitive2d::GraphicPrimitive2D& rGraphicPrimitive = static_cast< const primitive2d::GraphicPrimitive2D& >(rCandidate);
bool bUsingPDFExtOutDevData(false);
- basegfx::B2DVector aTranslate, aScale;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
static bool bSuppressPDFExtOutDevDataSupport(false);
if(mpPDFExtOutDevData && !bSuppressPDFExtOutDevDataSupport)
@@ -962,19 +965,19 @@ namespace drawinglayer
switch(rFieldPrimitive.getType())
{
- default : // case drawinglayer::primitive2d::FIELD_TYPE_COMMON :
+ default : // case drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_COMMON :
{
mpMetaFile->AddAction(new MetaCommentAction(aCommentStringCommon));
break;
}
- case drawinglayer::primitive2d::FIELD_TYPE_PAGE :
+ case drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_PAGE :
{
mpMetaFile->AddAction(new MetaCommentAction(aCommentStringPage));
break;
}
- case drawinglayer::primitive2d::FIELD_TYPE_URL :
+ case drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_URL :
{
- const rtl::OUString& rURL = rFieldPrimitive.getString();
+ const rtl::OUString& rURL = rFieldPrimitive.getStringA();
const String aOldString(rURL);
mpMetaFile->AddAction(new MetaCommentAction(aCommentStringCommon, 0, reinterpret_cast< const sal_uInt8* >(aOldString.GetBuffer()), 2 * aOldString.Len()));
break;
@@ -988,7 +991,8 @@ namespace drawinglayer
// for the end comment the type is not relevant yet, they are all the same. Just add.
mpMetaFile->AddAction(new MetaCommentAction(aCommentStringEnd));
- if(mpPDFExtOutDevData && drawinglayer::primitive2d::FIELD_TYPE_URL == rFieldPrimitive.getType())
+ if(mpPDFExtOutDevData
+ && drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_URL == rFieldPrimitive.getType())
{
// emulate data handling from ImpEditEngine::Paint
const basegfx::B2DRange aViewRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D()));
@@ -997,7 +1001,7 @@ namespace drawinglayer
(sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY()));
vcl::PDFExtOutDevBookmarkEntry aBookmark;
aBookmark.nLinkId = mpPDFExtOutDevData->CreateLink(aRectLogic);
- aBookmark.aBookmark = rFieldPrimitive.getString();
+ aBookmark.aBookmark = rFieldPrimitive.getStringA();
std::vector< vcl::PDFExtOutDevBookmarkEntry >& rBookmarks = mpPDFExtOutDevData->GetBookmarks();
rBookmarks.push_back( aBookmark );
}
@@ -1143,12 +1147,16 @@ namespace drawinglayer
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
// per polygon. If there are more, split the polygon in half and call recursively
basegfx::B2DPolygon aLeft, aRight;
+
splitLinePolygon(rBasePolygon, aLeft, aRight);
- const primitive2d::PolygonHairlinePrimitive2D aPLeft(aLeft, rHairlinePrimitive.getBColor());
- const primitive2d::PolygonHairlinePrimitive2D aPRight(aRight, rHairlinePrimitive.getBColor());
- processBasePrimitive2D(aPLeft);
- processBasePrimitive2D(aPRight);
+ primitive2d::PolygonHairlinePrimitive2D* pPLeft = new primitive2d::PolygonHairlinePrimitive2D(aLeft, rHairlinePrimitive.getBColor());
+ primitive2d::PolygonHairlinePrimitive2D* pPRight = new primitive2d::PolygonHairlinePrimitive2D(aRight, rHairlinePrimitive.getBColor());
+ const primitive2d::Primitive2DReference aRefLeft(pPLeft);
+ const primitive2d::Primitive2DReference aRefRight(pPRight);
+
+ processBasePrimitive2D(*pPLeft, aRefLeft);
+ processBasePrimitive2D(*pPRight, aRefRight);
}
else
{
@@ -1191,14 +1199,18 @@ namespace drawinglayer
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
// per polygon. If there are more, split the polygon in half and call recursively
basegfx::B2DPolygon aLeft, aRight;
+
splitLinePolygon(rBasePolygon, aLeft, aRight);
- const primitive2d::PolygonStrokePrimitive2D aPLeft(
+
+ primitive2d::PolygonStrokePrimitive2D* pPLeft = new primitive2d::PolygonStrokePrimitive2D(
aLeft, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute());
- const primitive2d::PolygonStrokePrimitive2D aPRight(
+ primitive2d::PolygonStrokePrimitive2D* pPRight = new primitive2d::PolygonStrokePrimitive2D(
aRight, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute());
+ const primitive2d::Primitive2DReference aRefLeft(pPLeft);
+ const primitive2d::Primitive2DReference aRefRight(pPRight);
- processBasePrimitive2D(aPLeft);
- processBasePrimitive2D(aPRight);
+ processBasePrimitive2D(*pPLeft, aRefLeft);
+ processBasePrimitive2D(*pPRight, aRefRight);
}
else
{
@@ -1274,23 +1286,29 @@ namespace drawinglayer
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
// per polygon. If there are more, split the polygon in half and call recursively
basegfx::B2DPolygon aLeft, aRight;
+
splitLinePolygon(rBasePolygon, aLeft, aRight);
+
const attribute::LineStartEndAttribute aEmpty;
- const primitive2d::PolygonStrokeArrowPrimitive2D aPLeft(
+ primitive2d::PolygonStrokeArrowPrimitive2D* pPLeft =
+ new primitive2d::PolygonStrokeArrowPrimitive2D(
aLeft,
rStrokeArrowPrimitive.getLineAttribute(),
rStrokeArrowPrimitive.getStrokeAttribute(),
rStrokeArrowPrimitive.getStart(),
aEmpty);
- const primitive2d::PolygonStrokeArrowPrimitive2D aPRight(
+ primitive2d::PolygonStrokeArrowPrimitive2D* pPRight =
+ new primitive2d::PolygonStrokeArrowPrimitive2D(
aRight,
rStrokeArrowPrimitive.getLineAttribute(),
rStrokeArrowPrimitive.getStrokeAttribute(),
aEmpty,
rStrokeArrowPrimitive.getEnd());
+ const primitive2d::Primitive2DReference aRefLeft(pPLeft);
+ const primitive2d::Primitive2DReference aRefRight(pPRight);
- processBasePrimitive2D(aPLeft);
- processBasePrimitive2D(aPRight);
+ processBasePrimitive2D(*pPLeft, aRefLeft);
+ processBasePrimitive2D(*pPRight, aRefRight);
}
else
{
@@ -1351,11 +1369,13 @@ namespace drawinglayer
{
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
// per polygon. If there are more use the splitted polygon and call recursively
- const primitive2d::PolyPolygonGraphicPrimitive2D aSplitted(
+ primitive2d::PolyPolygonGraphicPrimitive2D* pSplitted =
+ new primitive2d::PolyPolygonGraphicPrimitive2D(
aLocalPolyPolygon,
rBitmapCandidate.getFillGraphic());
+ const primitive2d::Primitive2DReference aRefSplitted(pSplitted);
- processBasePrimitive2D(aSplitted);
+ processBasePrimitive2D(*pSplitted, aRefSplitted);
}
else
{
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 1c88543168fb..2eaadf654f13 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -99,7 +99,9 @@ namespace drawinglayer
mpOutputDevice->SetAntialiasing(mpOutputDevice->GetAntialiasing() & ~ANTIALIASING_ENABLE_B2DDRAW);
}
- void VclPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
+ void VclPixelProcessor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
switch(rCandidate.getPrimitive2DID())
{
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 22ded6afedd9..0b23b720ee96 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -136,7 +136,8 @@ namespace drawinglayer
{
// decompose matrix to have position and size of text
basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rTextCandidate.getTextTransform());
- basegfx::B2DVector aFontScaling, aTranslate;
+ basegfx::B2DVector aFontScaling;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
aLocalTransform.decompose(aFontScaling, aTranslate, fRotate, fShearX);
bool bPrimitiveAccepted(false);
@@ -420,7 +421,8 @@ namespace drawinglayer
static bool bUseGraphicManager(true);
// decompose matrix to check for shear, rotate and mirroring
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -894,7 +896,8 @@ namespace drawinglayer
{
// decompose matrix to check for shear, rotate and mirroring
basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rMetaCandidate.getTransform());
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -1467,7 +1470,7 @@ namespace drawinglayer
// since DrawEPS will not be able e.g. to rotate the replacement. To be able
// to do that, i added a boolean return to OutputDevice::DrawEPS(..)
// to know when EPS was handled directly already.
- basegfx::B2DRange aRange(0.0, 0.0, 1.0, 1.0);
+ basegfx::B2DRange aRange(basegfx::B2DRange::getUnitB2DRange());
aRange.transform(maCurrentTransformation * rEpsPrimitive2D.getEpsTransform());
if(!aRange.isEmpty())
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 0745920b516f..22e41ba707a3 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -385,15 +385,16 @@ namespace drawinglayer
const sal_uInt16 nSpecularIntensity(rPrimitive.getMaterial().getSpecularIntensity());
// solve color model for each normal vector, set colors at points. Clear normals.
- for(sal_uInt32 a(0L); a < aFill.count(); a++)
+ for(sal_uInt32 a(0); a < aFill.count(); a++)
{
basegfx::B3DPolygon aPartFill(aFill.getB3DPolygon(a));
- for(sal_uInt32 b(0L); b < aPartFill.count(); b++)
+ for(sal_uInt32 b(0); b < aPartFill.count(); b++)
{
// solve color model. Transform normal to eye coor
const basegfx::B3DVector aNormal(aPartFill.getNormal(b));
const basegfx::BColor aSolvedColor(getSdrLightingAttribute().solveColorModel(aNormal, aColor, rSpecular, rEmission, nSpecularIntensity));
+
aPartFill.setBColor(b, aSolvedColor);
}
@@ -401,6 +402,15 @@ namespace drawinglayer
aPartFill.clearNormals();
aFill.setB3DPolygon(a, aPartFill);
}
+
+ // if no colors are used after solving the color model for
+ // all normals, all calculated colors were black (0.0, 0.0, 0.0).
+ // To represent this 'unused' state, set object color to black
+ // which will be used in this case
+ if(!aFill.areBColorsUsed())
+ {
+ aObjectColor = ::basegfx::BColor::getEmptyBColor();
+ }
break;
}
case ::com::sun::star::drawing::ShadeMode_FLAT:
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 92b0f3148a37..581f9c360a82 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -160,12 +160,12 @@ private:
// bitfield
// some boolean flags for line span interpolator usages
- unsigned mbModifyColor : 1;
- unsigned mbUseTex : 1;
- unsigned mbHasTexCoor : 1;
- unsigned mbHasInvTexCoor : 1;
- unsigned mbUseNrm : 1;
- unsigned mbUseCol : 1;
+ bool mbModifyColor : 1;
+ bool mbUseTex : 1;
+ bool mbHasTexCoor : 1;
+ bool mbHasInvTexCoor : 1;
+ bool mbUseNrm : 1;
+ bool mbUseCol : 1;
void getTextureCoor(basegfx::B2DPoint& rTarget) const
{
diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk
index 3e6f098b097c..56d34c5ba945 100755
--- a/editeng/Library_editeng.mk
+++ b/editeng/Library_editeng.mk
@@ -111,6 +111,9 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\
editeng/source/outliner/outlvw \
editeng/source/outliner/outl_pch \
editeng/source/outliner/paralist \
+ editeng/source/outliner/outlinerdecomposition \
+ editeng/source/outliner/pathtextportion \
+ editeng/source/outliner/pathtextportioncreator \
editeng/source/rtf/rtfgrf \
editeng/source/rtf/rtfitem \
editeng/source/rtf/svxrtf \
@@ -138,6 +141,7 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\
$(eval $(call gb_Library_add_linked_libs,editeng,\
xo \
basegfx \
+ drawinglayer \
lng \
svt \
tk \
diff --git a/editeng/Package_inc.mk b/editeng/Package_inc.mk
index c7e409089b40..894c2f9f066c 100644
--- a/editeng/Package_inc.mk
+++ b/editeng/Package_inc.mk
@@ -146,5 +146,6 @@ $(eval $(call gb_Package_add_file,editeng_inc,inc/editeng/widwitem.hxx,editeng/w
$(eval $(call gb_Package_add_file,editeng_inc,inc/editeng/writingmodeitem.hxx,editeng/writingmodeitem.hxx))
$(eval $(call gb_Package_add_file,editeng_inc,inc/editeng/wrlmitem.hxx,editeng/wrlmitem.hxx))
$(eval $(call gb_Package_add_file,editeng_inc,inc/editeng/xmlcnitm.hxx,editeng/xmlcnitm.hxx))
+$(eval $(call gb_Package_add_file,editeng_inc,inc/editeng/pathtextportion.hxx,editeng/pathtextportion.hxx))
# vim: set noet sw=4 ts=4:
diff --git a/editeng/inc/editeng/adjitem.hxx b/editeng/inc/editeng/adjitem.hxx
index 7a10536ba53d..5da098a29a7d 100644
--- a/editeng/inc/editeng/adjitem.hxx
+++ b/editeng/inc/editeng/adjitem.hxx
@@ -58,8 +58,8 @@ class EDITENG_DLLPUBLIC SvxAdjustItem : public SfxEnumItemInterface
friend SvStream& operator<<( SvStream&, SvxAdjustItem& ); //$ ostream
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
+ SvxAdjustItem( );
SvxAdjustItem( const SvxAdjust eAdjst /*= SVX_ADJUST_LEFT*/,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/akrnitem.hxx b/editeng/inc/editeng/akrnitem.hxx
index 0debc486e7f6..6b3db722b3fc 100644
--- a/editeng/inc/editeng/akrnitem.hxx
+++ b/editeng/inc/editeng/akrnitem.hxx
@@ -44,10 +44,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxAutoKernItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
- SvxAutoKernItem( const sal_Bool bAutoKern /*= sal_False*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxAutoKernItem( const sal_Bool bAutoKern = sal_False, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/blnkitem.hxx b/editeng/inc/editeng/blnkitem.hxx
index 95cf8b75db65..c63df194c66d 100644
--- a/editeng/inc/editeng/blnkitem.hxx
+++ b/editeng/inc/editeng/blnkitem.hxx
@@ -45,9 +45,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxBlinkItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
- SvxBlinkItem( const sal_Bool bBlink /*= sal_False*/, const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxBlinkItem( const sal_Bool bBlink = sal_False, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/bolnitem.hxx b/editeng/inc/editeng/bolnitem.hxx
index c9a62960af99..7a88809872dd 100644
--- a/editeng/inc/editeng/bolnitem.hxx
+++ b/editeng/inc/editeng/bolnitem.hxx
@@ -45,9 +45,8 @@ class SvxBorderLine;
class EDITENG_DLLPUBLIC SvxLineItem : public SfxPoolItem
{
public:
- TYPEINFO();
-
- SvxLineItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxLineItem( const sal_uInt16 nId = 0 );
SvxLineItem( const SvxLineItem& rCpy );
~SvxLineItem();
SvxLineItem &operator=( const SvxLineItem& rLine );
@@ -63,8 +62,8 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
const SvxBorderLine* GetLine () const { return pLine; }
void SetLine ( const SvxBorderLine *pNew );
diff --git a/editeng/inc/editeng/boxitem.hxx b/editeng/inc/editeng/boxitem.hxx
index 0b9e1a3f25a9..160d7e333dd7 100644
--- a/editeng/inc/editeng/boxitem.hxx
+++ b/editeng/inc/editeng/boxitem.hxx
@@ -57,9 +57,8 @@ class EDITENG_DLLPUBLIC SvxBoxItem : public SfxPoolItem
nRightDist;
public:
- TYPEINFO();
-
- SvxBoxItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxBoxItem( const sal_uInt16 nId = 0 );
SvxBoxItem( const SvxBoxItem &rCpy );
~SvxBoxItem();
SvxBoxItem &operator=( const SvxBoxItem& rBox );
@@ -79,8 +78,8 @@ public:
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
const SvxBorderLine* GetTop() const { return pTop; }
const SvxBorderLine* GetBottom() const { return pBottom; }
@@ -168,9 +167,8 @@ class EDITENG_DLLPUBLIC SvxBoxInfoItem : public SfxPoolItem
sal_uInt16 nDefDist; // Der Default- bzw. Minimalabstand.
public:
- TYPEINFO();
-
- SvxBoxInfoItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxBoxInfoItem( const sal_uInt16 nId = 0 );
SvxBoxInfoItem( const SvxBoxInfoItem &rCpy );
~SvxBoxInfoItem();
SvxBoxInfoItem &operator=( const SvxBoxInfoItem &rCpy );
@@ -187,8 +185,8 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
const SvxBorderLine* GetHori() const { return pHori; }
const SvxBorderLine* GetVert() const { return pVert; }
diff --git a/editeng/inc/editeng/brkitem.hxx b/editeng/inc/editeng/brkitem.hxx
index 4c0c76f44bfd..015cd53eed5f 100644
--- a/editeng/inc/editeng/brkitem.hxx
+++ b/editeng/inc/editeng/brkitem.hxx
@@ -46,10 +46,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxFmtBreakItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
- inline SvxFmtBreakItem( const SvxBreak eBrk /*= SVX_BREAK_NONE*/,
- const sal_uInt16 nWhich );
+ POOLITEM_FACTORY()
+ inline SvxFmtBreakItem( const SvxBreak eBrk = SVX_BREAK_NONE, const sal_uInt16 nWhich = 0);
inline SvxFmtBreakItem( const SvxFmtBreakItem& rBreak );
inline SvxFmtBreakItem& operator=( const SvxFmtBreakItem& rCpy );
diff --git a/editeng/inc/editeng/brshitem.hxx b/editeng/inc/editeng/brshitem.hxx
index f5225fbe5ce3..ca39b54d6726 100644
--- a/editeng/inc/editeng/brshitem.hxx
+++ b/editeng/inc/editeng/brshitem.hxx
@@ -71,9 +71,8 @@ class EDITENG_DLLPUBLIC SvxBrushItem : public SfxPoolItem
sal_uInt16 nVersion, sal_uInt16 nWhich );
public:
- TYPEINFO();
-
- SvxBrushItem( sal_uInt16 nWhich );
+ POOLITEM_FACTORY()
+ SvxBrushItem( sal_uInt16 nWhich = 0);
SvxBrushItem( const Color& rColor, sal_uInt16 nWhich );
SvxBrushItem( const Graphic& rGraphic,
diff --git a/editeng/inc/editeng/bulitem.hxx b/editeng/inc/editeng/bulitem.hxx
index 84a927b81463..6e89938cb5ca 100644
--- a/editeng/inc/editeng/bulitem.hxx
+++ b/editeng/inc/editeng/bulitem.hxx
@@ -85,8 +85,6 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
#endif
public:
- TYPEINFO();
-
SvxBulletItem( sal_uInt16 nWhich = 0 );
SvxBulletItem( sal_uInt8 nStyle, const Font& rFont, sal_uInt16 nStart = 0, sal_uInt16 nWhich = 0 );
SvxBulletItem( const Font& rFont, sal_Unicode cSymbol, sal_uInt16 nWhich=0 );
diff --git a/editeng/inc/editeng/charhiddenitem.hxx b/editeng/inc/editeng/charhiddenitem.hxx
index f6786cf26e93..3aca1183f18b 100644
--- a/editeng/inc/editeng/charhiddenitem.hxx
+++ b/editeng/inc/editeng/charhiddenitem.hxx
@@ -38,8 +38,6 @@
class EDITENG_DLLPUBLIC SvxCharHiddenItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxCharHiddenItem( const sal_Bool bHidden /*= sal_False*/, const sal_uInt16 nId );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/charreliefitem.hxx b/editeng/inc/editeng/charreliefitem.hxx
index 1989dfb1943d..7cb9eb5615cb 100644
--- a/editeng/inc/editeng/charreliefitem.hxx
+++ b/editeng/inc/editeng/charreliefitem.hxx
@@ -41,10 +41,8 @@
class EDITENG_DLLPUBLIC SvxCharReliefItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxCharReliefItem( FontRelief eValue /*= RELIEF_NONE*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxCharReliefItem( FontRelief eValue = RELIEF_NONE, const sal_uInt16 nId = 0 );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
diff --git a/editeng/inc/editeng/charrotateitem.hxx b/editeng/inc/editeng/charrotateitem.hxx
index 9bb26fcfa360..12ea6e8c7c6b 100644
--- a/editeng/inc/editeng/charrotateitem.hxx
+++ b/editeng/inc/editeng/charrotateitem.hxx
@@ -43,11 +43,10 @@ class EDITENG_DLLPUBLIC SvxCharRotateItem : public SfxUInt16Item
{
sal_Bool bFitToLine;
public:
- TYPEINFO();
-
- SvxCharRotateItem( sal_uInt16 nValue /*= 0*/,
- sal_Bool bFitIntoLine /*= sal_False*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxCharRotateItem( sal_uInt16 nValue = 0,
+ sal_Bool bFitIntoLine = sal_False,
+ const sal_uInt16 nId = 0);
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
diff --git a/editeng/inc/editeng/charscaleitem.hxx b/editeng/inc/editeng/charscaleitem.hxx
index 87f2c95be8ba..6c901d5d45d7 100644
--- a/editeng/inc/editeng/charscaleitem.hxx
+++ b/editeng/inc/editeng/charscaleitem.hxx
@@ -41,10 +41,8 @@
class EDITENG_DLLPUBLIC SvxCharScaleWidthItem : public SfxUInt16Item
{
public:
- TYPEINFO();
-
- SvxCharScaleWidthItem( sal_uInt16 nValue /*= 100*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxCharScaleWidthItem( sal_uInt16 nValue = 100, const sal_uInt16 nId = 0 );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
diff --git a/editeng/inc/editeng/cmapitem.hxx b/editeng/inc/editeng/cmapitem.hxx
index 8e1fe6832f97..7200bde2e318 100644
--- a/editeng/inc/editeng/cmapitem.hxx
+++ b/editeng/inc/editeng/cmapitem.hxx
@@ -45,10 +45,9 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxCaseMapItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxCaseMapItem( const SvxCaseMap eMap /*= SVX_CASEMAP_NOT_MAPPED*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxCaseMapItem( const SvxCaseMap eMap = SVX_CASEMAP_NOT_MAPPED,
+ const sal_uInt16 nId = 0);
// "pure virtual Methoden" vom SfxPoolItem + SfxEnumItem
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/editeng/inc/editeng/cntritem.hxx b/editeng/inc/editeng/cntritem.hxx
index f508ce26bbda..cd73f5d8614a 100644
--- a/editeng/inc/editeng/cntritem.hxx
+++ b/editeng/inc/editeng/cntritem.hxx
@@ -38,10 +38,8 @@
class EDITENG_DLLPUBLIC SvxContourItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
- SvxContourItem( const sal_Bool bContoured /*= sal_False*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxContourItem( const sal_Bool bContoured = sal_False, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/colritem.hxx b/editeng/inc/editeng/colritem.hxx
index 6aba71edca06..1ca1f144365e 100644
--- a/editeng/inc/editeng/colritem.hxx
+++ b/editeng/inc/editeng/colritem.hxx
@@ -50,9 +50,8 @@ private:
Color mColor;
public:
- TYPEINFO();
-
- SvxColorItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxColorItem( const sal_uInt16 nId = 0 );
SvxColorItem( const Color& aColor, const sal_uInt16 nId );
SvxColorItem( SvStream& rStrm, const sal_uInt16 nId );
SvxColorItem( const SvxColorItem& rCopy );
diff --git a/editeng/inc/editeng/crsditem.hxx b/editeng/inc/editeng/crsditem.hxx
index 6e2d4907473e..cdb6e64068c5 100644
--- a/editeng/inc/editeng/crsditem.hxx
+++ b/editeng/inc/editeng/crsditem.hxx
@@ -45,10 +45,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxCrossedOutItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxCrossedOutItem( const FontStrikeout eSt /*= STRIKEOUT_NONE*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxCrossedOutItem( const FontStrikeout eSt = STRIKEOUT_NONE, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/editeng/inc/editeng/cscoitem.hxx b/editeng/inc/editeng/cscoitem.hxx
index 69c5f64e36f2..4d95fec17770 100644
--- a/editeng/inc/editeng/cscoitem.hxx
+++ b/editeng/inc/editeng/cscoitem.hxx
@@ -40,8 +40,6 @@ class EDITENG_DLLPUBLIC SvxCharSetColorItem : public SvxColorItem
{
rtl_TextEncoding eFrom;
public:
- TYPEINFO();
-
SvxCharSetColorItem( const sal_uInt16 nId );
SvxCharSetColorItem( const Color& aColor, const rtl_TextEncoding eFrom,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 8947d5f5d765..42ede62bbd8a 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -61,6 +61,7 @@ class FontList;
#include <vos/ref.hxx>
#include <vector>
#include <com/sun/star/uno/Reference.h>
+#include <typeinfo>
namespace com { namespace sun { namespace star {
namespace linguistic2 {
@@ -89,9 +90,6 @@ namespace basegfx { class B2DPolyPolygon; }
#endif
#include <i18npool/lang.h>
#include "editeng/editengdllapi.h"
-
-#include <tools/rtti.hxx> // wegen typedef TypeId
-
#include <editeng/eedata.hxx>
class SvxFieldData;
@@ -405,7 +403,7 @@ public:
virtual sal_Bool ConvertNextDocument();
sal_Bool UpdateFields();
- void RemoveFields( sal_Bool bKeepFieldText, TypeId aType = NULL );
+ void RemoveFields( sal_Bool bKeepFieldText, const std::type_info* pTypeInfo = 0 );
sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
diff --git a/editeng/inc/editeng/editobj.hxx b/editeng/inc/editeng/editobj.hxx
index 01806842076a..5c823aab770f 100644
--- a/editeng/inc/editeng/editobj.hxx
+++ b/editeng/inc/editeng/editobj.hxx
@@ -30,6 +30,7 @@
#include <svl/itemset.hxx>
#include <editeng/eeitem.hxx>
#include "editeng/editengdllapi.h"
+#include <typeinfo>
DBG_NAMEEX( EE_EditTextObject )
@@ -101,7 +102,7 @@ public:
virtual sal_Bool IsFieldObject() const;
virtual const SvxFieldItem* GetField() const;
- virtual sal_Bool HasField( TypeId aType = NULL ) const;
+ virtual sal_Bool HasField( const std::type_info* pTypeInfo = 0 ) const;
virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rAttribs );
diff --git a/editeng/inc/editeng/editund2.hxx b/editeng/inc/editeng/editund2.hxx
index cea9150febb2..8c5d13729901 100644
--- a/editeng/inc/editeng/editund2.hxx
+++ b/editeng/inc/editeng/editund2.hxx
@@ -56,7 +56,6 @@ private:
ImpEditEngine* pImpEE;
public:
- TYPEINFO();
EditUndo( sal_uInt16 nI, ImpEditEngine* pImpEE );
virtual ~EditUndo();
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index eef2aa3c0306..1b03942f0494 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -94,7 +94,7 @@ public:
void SetWindow( Window* pWin );
Window* GetWindow() const;
- void Paint( const Rectangle& rRect, OutputDevice* pTargetDevice = 0 );
+ void Paint( const Rectangle& rRect, OutputDevice* pTargetDevice = 0);
void Invalidate();
Pair Scroll( long nHorzScroll, long nVertScroll, sal_uInt8 nRangeCheck = RGCHK_NEG );
diff --git a/editeng/inc/editeng/emphitem.hxx b/editeng/inc/editeng/emphitem.hxx
index d5d24a3889eb..88be65f01f7e 100644
--- a/editeng/inc/editeng/emphitem.hxx
+++ b/editeng/inc/editeng/emphitem.hxx
@@ -45,10 +45,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxEmphasisMarkItem : public SfxUInt16Item
{
public:
- TYPEINFO();
-
- SvxEmphasisMarkItem( const FontEmphasisMark eVal /*= EMPHASISMARK_NONE*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxEmphasisMarkItem( const FontEmphasisMark eVal = EMPHASISMARK_NONE, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem + SfxEnumItem
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/editeng/inc/editeng/escpitem.hxx b/editeng/inc/editeng/escpitem.hxx
index aff61f497d11..9db8c1090ca3 100644
--- a/editeng/inc/editeng/escpitem.hxx
+++ b/editeng/inc/editeng/escpitem.hxx
@@ -53,9 +53,8 @@ class EDITENG_DLLPUBLIC SvxEscapementItem : public SfxEnumItemInterface
short nEsc;
sal_uInt8 nProp;
public:
- TYPEINFO();
-
- SvxEscapementItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxEscapementItem( const sal_uInt16 nId = 0 );
SvxEscapementItem( const SvxEscapement eEscape,
const sal_uInt16 nId );
SvxEscapementItem( const short nEsc, const sal_uInt8 nProp,
diff --git a/editeng/inc/editeng/fhgtitem.hxx b/editeng/inc/editeng/fhgtitem.hxx
index 5a163ddeaf70..11e134abb6f9 100644
--- a/editeng/inc/editeng/fhgtitem.hxx
+++ b/editeng/inc/editeng/fhgtitem.hxx
@@ -52,10 +52,8 @@ class EDITENG_DLLPUBLIC SvxFontHeightItem : public SfxPoolItem
sal_uInt16 nProp; // default 100%
SfxMapUnit ePropUnit; // Percent, Twip, ...
public:
- TYPEINFO();
-
- SvxFontHeightItem( const sal_uLong nSz /*= 240*/, const sal_uInt16 nPropHeight /*= 100*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxFontHeightItem( const sal_uLong nSz = 240, const sal_uInt16 nPropHeight = 100, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
@@ -70,9 +68,9 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
- virtual sal_uInt16 GetVersion( sal_uInt16 nItemVersion) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nItemVersion) const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
inline SvxFontHeightItem& operator=(const SvxFontHeightItem& rSize)
{
diff --git a/editeng/inc/editeng/flditem.hxx b/editeng/inc/editeng/flditem.hxx
index 9fd0ae6b331f..b5d4392cd2c5 100644
--- a/editeng/inc/editeng/flditem.hxx
+++ b/editeng/inc/editeng/flditem.hxx
@@ -67,8 +67,6 @@ private:
EDITENG_DLLPRIVATE SvxFieldItem( SvxFieldData* pField, const sal_uInt16 nId );
public:
- TYPEINFO();
-
SvxFieldItem( const SvxFieldData& rField, const sal_uInt16 nId );
SvxFieldItem( const SvxFieldItem& rItem );
~SvxFieldItem();
diff --git a/editeng/inc/editeng/flstitem.hxx b/editeng/inc/editeng/flstitem.hxx
index 7d67c1a0e39c..92c479472ceb 100644
--- a/editeng/inc/editeng/flstitem.hxx
+++ b/editeng/inc/editeng/flstitem.hxx
@@ -48,8 +48,6 @@ private:
com::sun::star::uno::Sequence< rtl::OUString > aFontNameSeq;
public:
- TYPEINFO();
-
SvxFontListItem( const FontList* pFontLst,
const sal_uInt16 nId );
SvxFontListItem( const SvxFontListItem& rItem );
diff --git a/editeng/inc/editeng/fontitem.hxx b/editeng/inc/editeng/fontitem.hxx
index 8354aaa28c8d..df5179e09a34 100644
--- a/editeng/inc/editeng/fontitem.hxx
+++ b/editeng/inc/editeng/fontitem.hxx
@@ -54,9 +54,8 @@ class EDITENG_DLLPUBLIC SvxFontItem : public SfxPoolItem
static sal_Bool bEnableStoreUnicodeNames;
public:
- TYPEINFO();
-
- SvxFontItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxFontItem( const sal_uInt16 nId = 0 );
SvxFontItem( const FontFamily eFam, const String& rFamilyName,
const String& rStyleName,
const FontPitch eFontPitch /*= PITCH_DONTKNOW*/,
diff --git a/editeng/inc/editeng/forbiddenruleitem.hxx b/editeng/inc/editeng/forbiddenruleitem.hxx
index 9d6fa1f1e0fc..3c444a524cb7 100644
--- a/editeng/inc/editeng/forbiddenruleitem.hxx
+++ b/editeng/inc/editeng/forbiddenruleitem.hxx
@@ -38,8 +38,6 @@
class EDITENG_DLLPUBLIC SvxForbiddenRuleItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxForbiddenRuleItem( sal_Bool bOn /*= sal_False*/,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/frmdiritem.hxx b/editeng/inc/editeng/frmdiritem.hxx
index 50a3c7bb9f7e..bc47d0aa96ea 100644
--- a/editeng/inc/editeng/frmdiritem.hxx
+++ b/editeng/inc/editeng/frmdiritem.hxx
@@ -41,8 +41,6 @@
class EDITENG_DLLPUBLIC SvxFrameDirectionItem : public SfxUInt16Item
{
public:
- TYPEINFO();
-
SvxFrameDirectionItem( sal_uInt16 nWhich );
SvxFrameDirectionItem( SvxFrameDirection nValue /*= FRMDIR_HORI_LEFT_TOP*/,
sal_uInt16 nWhich );
diff --git a/editeng/inc/editeng/fwdtitem.hxx b/editeng/inc/editeng/fwdtitem.hxx
index 72569ba342ff..be7ba5e16686 100644
--- a/editeng/inc/editeng/fwdtitem.hxx
+++ b/editeng/inc/editeng/fwdtitem.hxx
@@ -42,8 +42,6 @@ class SvxFontWidthItem : public SfxPoolItem
sal_uInt16 nWidth; // 0 = default
sal_uInt16 nProp; // default 100%
public:
- TYPEINFO();
-
SvxFontWidthItem( const sal_uInt16 nSz /*= 0*/,
const sal_uInt16 nPropWidth /*= 100*/,
const sal_uInt16 nId );
@@ -61,8 +59,8 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
inline SvxFontWidthItem& operator=(const SvxFontWidthItem& rItem )
{
diff --git a/editeng/inc/editeng/hngpnctitem.hxx b/editeng/inc/editeng/hngpnctitem.hxx
index 3b9e8487b491..792eadf59e61 100644
--- a/editeng/inc/editeng/hngpnctitem.hxx
+++ b/editeng/inc/editeng/hngpnctitem.hxx
@@ -38,8 +38,6 @@
class EDITENG_DLLPUBLIC SvxHangingPunctuationItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxHangingPunctuationItem( sal_Bool bOn /*= sal_False*/,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/hyznitem.hxx b/editeng/inc/editeng/hyznitem.hxx
index f08d75ba0843..d5ddce1ea9d8 100644
--- a/editeng/inc/editeng/hyznitem.hxx
+++ b/editeng/inc/editeng/hyznitem.hxx
@@ -53,10 +53,9 @@ class EDITENG_DLLPUBLIC SvxHyphenZoneItem : public SfxPoolItem
friend SvStream & operator<<( SvStream & aS, SvxHyphenZoneItem & );
public:
- TYPEINFO();
-
- SvxHyphenZoneItem( const sal_Bool bHyph /*= sal_False*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxHyphenZoneItem( const sal_Bool bHyph = sal_False,
+ const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/editeng/inc/editeng/keepitem.hxx b/editeng/inc/editeng/keepitem.hxx
index 78d6de0f28a2..68adebcec510 100644
--- a/editeng/inc/editeng/keepitem.hxx
+++ b/editeng/inc/editeng/keepitem.hxx
@@ -43,10 +43,9 @@ Dieses Item beschreibt eine logische Variable "Absaetze zusammenhalten?".
class EDITENG_DLLPUBLIC SvxFmtKeepItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
- inline SvxFmtKeepItem( const sal_Bool bKeep /*= sal_False*/,
- const sal_uInt16 _nWhich );
+ POOLITEM_FACTORY()
+ inline SvxFmtKeepItem( const sal_Bool bKeep = sal_False,
+ const sal_uInt16 _nWhich = 0 );
inline SvxFmtKeepItem& operator=( const SvxFmtKeepItem& rSplit );
// "pure virtual Methoden" vom SfxPoolItem
diff --git a/editeng/inc/editeng/kernitem.hxx b/editeng/inc/editeng/kernitem.hxx
index 4bfbfd67d6ae..13bd8aaa4b10 100644
--- a/editeng/inc/editeng/kernitem.hxx
+++ b/editeng/inc/editeng/kernitem.hxx
@@ -47,16 +47,15 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxKerningItem : public SfxInt16Item
{
public:
- TYPEINFO();
-
- SvxKerningItem( const short nKern /*= 0*/, const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxKerningItem( const short nKern = 0, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
diff --git a/editeng/inc/editeng/langitem.hxx b/editeng/inc/editeng/langitem.hxx
index 0e904da88953..ca488aefe908 100644
--- a/editeng/inc/editeng/langitem.hxx
+++ b/editeng/inc/editeng/langitem.hxx
@@ -45,10 +45,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxLanguageItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxLanguageItem( const LanguageType eLang /*= LANGUAGE_GERMAN*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxLanguageItem( const LanguageType eLang = LANGUAGE_GERMAN, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/editeng/inc/editeng/lcolitem.hxx b/editeng/inc/editeng/lcolitem.hxx
index 77e1d9b420d2..56f0b3fb15bd 100644
--- a/editeng/inc/editeng/lcolitem.hxx
+++ b/editeng/inc/editeng/lcolitem.hxx
@@ -36,14 +36,13 @@
class EDITENG_DLLPUBLIC SvxLineColorItem : public SvxColorItem
{
public:
- TYPEINFO();
-
SvxLineColorItem( const sal_uInt16 nId );
SvxLineColorItem( const Color& aColor, const sal_uInt16 nId );
SvxLineColorItem( SvStream& rStrm, const sal_uInt16 nId );
SvxLineColorItem( const SvxLineColorItem& rCopy );
~SvxLineColorItem();
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
diff --git a/editeng/inc/editeng/lrspitem.hxx b/editeng/inc/editeng/lrspitem.hxx
index 525c6c717f9f..4b36f4720767 100644
--- a/editeng/inc/editeng/lrspitem.hxx
+++ b/editeng/inc/editeng/lrspitem.hxx
@@ -72,9 +72,8 @@ class EDITENG_DLLPUBLIC SvxLRSpaceItem : public SfxPoolItem
void AdjustLeft(); // nLeftMargin und nTxtLeft werden angepasst.
public:
- TYPEINFO();
-
- SvxLRSpaceItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxLRSpaceItem( const sal_uInt16 nId = 0 );
SvxLRSpaceItem( const long nLeft, const long nRight,
const long nTLeft /*= 0*/, const short nOfset /*= 0*/,
const sal_uInt16 nId );
@@ -94,9 +93,9 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
- virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
// Die "Layout-Schnittstelle":
inline void SetLeft ( const long nL, const sal_uInt16 nProp = 100 );
diff --git a/editeng/inc/editeng/lspcitem.hxx b/editeng/inc/editeng/lspcitem.hxx
index f645eb18d8aa..687a87916a7c 100644
--- a/editeng/inc/editeng/lspcitem.hxx
+++ b/editeng/inc/editeng/lspcitem.hxx
@@ -54,14 +54,14 @@ class EDITENG_DLLPUBLIC SvxLineSpacingItem : public SfxEnumItemInterface
SvxInterLineSpace eInterLineSpace;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
// Der Writer verlaesst sich auf eine Default-Hoehe von 200!
// Eigentlich wuerde ich alle Werte mit 0 initialisieren, aber wer kann
// die Folgen beim Writer absehen ?
// => lieber einen krummen Wert als Default, aber der Programmierer
// sieht, dass dort etwas besonderes passiert.
+ SvxLineSpacingItem( );
SvxLineSpacingItem( sal_uInt16 nHeight /*= LINE_SPACE_DEFAULT_HEIGHT*/, const sal_uInt16 nId );
// "pure virtual Methoden" vom SfxPoolItem
diff --git a/editeng/inc/editeng/nhypitem.hxx b/editeng/inc/editeng/nhypitem.hxx
index fa0bab6e6b19..219d366a5d61 100644
--- a/editeng/inc/editeng/nhypitem.hxx
+++ b/editeng/inc/editeng/nhypitem.hxx
@@ -38,8 +38,6 @@
class EDITENG_DLLPUBLIC SvxNoHyphenItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxNoHyphenItem( const sal_Bool bHyphen /*= sal_True*/,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/nlbkitem.hxx b/editeng/inc/editeng/nlbkitem.hxx
index b4301d3a0c86..c3cad37b14ce 100644
--- a/editeng/inc/editeng/nlbkitem.hxx
+++ b/editeng/inc/editeng/nlbkitem.hxx
@@ -40,8 +40,6 @@
class EDITENG_DLLPUBLIC SvxNoLinebreakItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxNoLinebreakItem( const sal_Bool bBreak /*= sal_True*/,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/opaqitem.hxx b/editeng/inc/editeng/opaqitem.hxx
index bcfbd9b28d77..533e47dd7dda 100644
--- a/editeng/inc/editeng/opaqitem.hxx
+++ b/editeng/inc/editeng/opaqitem.hxx
@@ -45,8 +45,6 @@ Dieses Item beschreibt eine logische Variable "Undurchsichtig ja oder nein".
class EDITENG_DLLPUBLIC SvxOpaqueItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxOpaqueItem( const sal_uInt16 nId , const sal_Bool bOpa = sal_True );
inline SvxOpaqueItem &operator=( const SvxOpaqueItem &rCpy );
diff --git a/editeng/inc/editeng/optitems.hxx b/editeng/inc/editeng/optitems.hxx
index 59ac82633cb0..f1c6be66f893 100644
--- a/editeng/inc/editeng/optitems.hxx
+++ b/editeng/inc/editeng/optitems.hxx
@@ -41,8 +41,6 @@ namespace linguistic2{
class EDITENG_DLLPUBLIC SfxSpellCheckItem: public SfxPoolItem
{
public:
- TYPEINFO();
-
SfxSpellCheckItem( ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > &xChecker,
sal_uInt16 nWhich );
@@ -74,8 +72,6 @@ class EDITENG_DLLPUBLIC SfxHyphenRegionItem: public SfxPoolItem
sal_uInt8 nMinTrail;
public:
- TYPEINFO();
-
SfxHyphenRegionItem( const sal_uInt16 nId );
SfxHyphenRegionItem( const SfxHyphenRegionItem& rItem );
diff --git a/editeng/inc/editeng/orphitem.hxx b/editeng/inc/editeng/orphitem.hxx
index 8c63da5367b0..f45238c5d145 100644
--- a/editeng/inc/editeng/orphitem.hxx
+++ b/editeng/inc/editeng/orphitem.hxx
@@ -45,9 +45,8 @@ class EDITENG_DLLPUBLIC SvxOrphansItem: public SfxByteItem
{
friend SvStream & operator<<( SvStream & aS, SvxOrphansItem & );
public:
- TYPEINFO();
-
- SvxOrphansItem( const sal_uInt8 nL /*= 0*/, const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxOrphansItem( const sal_uInt8 nL = 0, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index 74034df0c89a..8bec4d427e2d 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -26,9 +26,7 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
#include <tools/debug.hxx>
-
#include <svl/brdcst.hxx>
-
#include <editeng/editdata.hxx>
#include <i18npool/lang.h>
#include <tools/color.hxx>
@@ -37,11 +35,10 @@
#include <tools/link.hxx>
#include <rsc/rscsfx.hxx>
#include "editeng/editengdllapi.h"
-
#include <svtools/grfmgr.hxx>
-
-#include <tools/rtti.hxx> // wegen typedef TypeId
+#include <editeng/pathtextportion.hxx>
#include <vector>
+#include <typeinfo>
class OutlinerEditEng;
class Outliner;
@@ -80,11 +77,11 @@ namespace svl
}
#include <com/sun/star/uno/Reference.h>
-
#include <vos/ref.hxx>
#include <editeng/svxfont.hxx>
#include <editeng/eedata.hxx>
#include <editeng/paragraphdata.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
class SvxFieldData;
//////////////////////////////////////////////////////////////////////////////
@@ -259,7 +256,15 @@ public:
void Scroll( long nHorzScroll, long nVertScroll );
- void Paint( const Rectangle& rRect, OutputDevice* pTargetDevice = 0 );
+ void Paint(const Rectangle& rRect, OutputDevice* pTargetDevice = 0);
+ void Paint(const basegfx::B2DRange& rRange, OutputDevice* pTargetDevice = 0)
+ {
+ Paint(
+ Rectangle(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY())),
+ pTargetDevice);
+ }
sal_Bool PostKeyEvent( const KeyEvent& rKEvt );
sal_Bool MouseButtonDown( const MouseEvent& );
sal_Bool MouseButtonUp( const MouseEvent& );
@@ -278,7 +283,19 @@ public:
sal_Bool IsReadOnly() const;
void SetOutputArea( const Rectangle& rRect );
+ void SetOutputArea(const basegfx::B2DRange& rRange)
+ {
+ SetOutputArea(
+ Rectangle(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY())));
+ }
Rectangle GetOutputArea() const;
+ basegfx::B2DRange GetOutputAreaRange() const
+ {
+ const Rectangle aTemp(GetOutputArea());
+ return basegfx::B2DRange(aTemp.Left(), aTemp.Top(), aTemp.Right(), aTemp.Bottom());
+ }
Rectangle GetVisArea() const;
@@ -953,7 +970,7 @@ public:
void QuickFormatDoc( sal_Bool bFull = sal_False );
sal_Bool UpdateFields();
- void RemoveFields( sal_Bool bKeepFieldText, TypeId aType = NULL );
+ void RemoveFields( sal_Bool bKeepFieldText, const std::type_info* pTypeInfo = 0);
virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
virtual void FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
@@ -1049,6 +1066,15 @@ public:
virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara );
virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart );
+
+ /// get primitive version of layouted text
+ void getPrimitive2DSequence(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const basegfx::B2DVector* pContourScale = 0,
+ const basegfx::B2DRange* pClipRange = 0);
+
+ /// get path thext portions of text for text on curve functionality
+ void getPathTextPortions(::std::vector< PathTextPortion >& rTarget);
};
#endif
diff --git a/editeng/inc/editeng/paravertalignitem.hxx b/editeng/inc/editeng/paravertalignitem.hxx
index 4d69b86a3bd8..b1011eb45999 100644
--- a/editeng/inc/editeng/paravertalignitem.hxx
+++ b/editeng/inc/editeng/paravertalignitem.hxx
@@ -41,10 +41,9 @@ class EDITENG_DLLPUBLIC SvxParaVertAlignItem : public SfxUInt16Item
{
public:
enum { AUTOMATIC, BASELINE, TOP, CENTER, BOTTOM };
- TYPEINFO();
-
- SvxParaVertAlignItem( sal_uInt16 nValue /*= 0*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxParaVertAlignItem( sal_uInt16 nValue = 0,
+ const sal_uInt16 nId = 0 );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
diff --git a/editeng/inc/editeng/pathtextportion.hxx b/editeng/inc/editeng/pathtextportion.hxx
new file mode 100644
index 000000000000..de688c16bd40
--- /dev/null
+++ b/editeng/inc/editeng/pathtextportion.hxx
@@ -0,0 +1,77 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _PATHTEXTPORTION_HXX
+#define _PATHTEXTPORTION_HXX
+
+#include <editeng/svxfont.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <com/sun/star/lang/Locale.hpp>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predeclarations
+
+class DrawPortionInfo;
+
+//////////////////////////////////////////////////////////////////////////////
+
+class EDITENG_DLLPUBLIC PathTextPortion
+{
+ basegfx::B2DVector maOffset;
+ String maText;
+ xub_StrLen mnTextStart;
+ xub_StrLen mnTextLength;
+ sal_uInt16 mnParagraph;
+ xub_StrLen mnIndex;
+ SvxFont maFont;
+ ::std::vector< double > maDblDXArray; // double DXArray, font size independent -> unit coordinate system
+ ::com::sun::star::lang::Locale maLocale;
+
+ // bitfield
+ bool mbRTL : 1;
+
+public:
+ PathTextPortion(DrawPortionInfo& rInfo);
+
+ // for ::std::sort
+ bool operator<(const PathTextPortion& rComp) const;
+
+ const basegfx::B2DVector& getOffset() const { return maOffset; }
+ const String& getText() const { return maText; }
+ xub_StrLen getTextStart() const { return mnTextStart; }
+ xub_StrLen getTextLength() const { return mnTextLength; }
+ sal_uInt16 getParagraph() const { return mnParagraph; }
+ xub_StrLen getIndex() const { return mnIndex; }
+ const SvxFont& getFont() const { return maFont; }
+ bool isRTL() const { return mbRTL; }
+ const ::std::vector< double >& getDoubleDXArray() const { return maDblDXArray; }
+ const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
+ xub_StrLen getPortionIndex(xub_StrLen nIndex, xub_StrLen nLength) const;
+ double getDisplayLength(xub_StrLen nIndex, xub_StrLen nLength) const;
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _PATHTEXTPORTION_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/editeng/inc/editeng/pbinitem.hxx b/editeng/inc/editeng/pbinitem.hxx
index b394a8b874ed..788663c44f15 100644
--- a/editeng/inc/editeng/pbinitem.hxx
+++ b/editeng/inc/editeng/pbinitem.hxx
@@ -42,9 +42,8 @@
class EDITENG_DLLPUBLIC SvxPaperBinItem : public SfxByteItem
{
public:
- TYPEINFO();
-
- inline SvxPaperBinItem( const sal_uInt16 nId ,
+ POOLITEM_FACTORY()
+ inline SvxPaperBinItem( const sal_uInt16 nId = 0,
const sal_uInt8 nTray = PAPERBIN_PRINTER_SETTINGS );
inline SvxPaperBinItem &operator=( const SvxPaperBinItem &rCpy );
diff --git a/editeng/inc/editeng/pgrditem.hxx b/editeng/inc/editeng/pgrditem.hxx
index 5c5a578ad13c..6d4d5361a951 100644
--- a/editeng/inc/editeng/pgrditem.hxx
+++ b/editeng/inc/editeng/pgrditem.hxx
@@ -39,8 +39,6 @@
class EDITENG_DLLPUBLIC SvxParaGridItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxParaGridItem( const sal_Bool bSnapToGrid /*= sal_True*/,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/pmdlitem.hxx b/editeng/inc/editeng/pmdlitem.hxx
index 2f564af4f8d7..0400bcaba1a2 100644
--- a/editeng/inc/editeng/pmdlitem.hxx
+++ b/editeng/inc/editeng/pmdlitem.hxx
@@ -41,8 +41,6 @@ private:
sal_Bool bAuto;
public:
- TYPEINFO();
-
inline SvxPageModelItem( sal_uInt16 nWh );
inline SvxPageModelItem( const String& rModel, sal_Bool bA /*= sal_False*/,
sal_uInt16 nWh );
diff --git a/editeng/inc/editeng/postitem.hxx b/editeng/inc/editeng/postitem.hxx
index 5ffc87b3de51..8b172a8b680c 100644
--- a/editeng/inc/editeng/postitem.hxx
+++ b/editeng/inc/editeng/postitem.hxx
@@ -45,10 +45,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxPostureItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxPostureItem( const FontItalic ePost /*= ITALIC_NONE*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxPostureItem( const FontItalic ePost = ITALIC_NONE, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem + SwEnumItem
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/editeng/inc/editeng/prntitem.hxx b/editeng/inc/editeng/prntitem.hxx
index 7a1d5635691c..c69c1fa605b0 100644
--- a/editeng/inc/editeng/prntitem.hxx
+++ b/editeng/inc/editeng/prntitem.hxx
@@ -42,8 +42,6 @@ Dieses Item beschreibt eine logische Variable "Drucken ja oder nein".
class EDITENG_DLLPUBLIC SvxPrintItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxPrintItem( const sal_uInt16 nId , const sal_Bool bPrt = sal_True );
inline SvxPrintItem &operator=( const SvxPrintItem &rCpy );
diff --git a/editeng/inc/editeng/protitem.hxx b/editeng/inc/editeng/protitem.hxx
index c223ead7220b..15903e2d0fc0 100644
--- a/editeng/inc/editeng/protitem.hxx
+++ b/editeng/inc/editeng/protitem.hxx
@@ -51,9 +51,8 @@ class EDITENG_DLLPUBLIC SvxProtectItem : public SfxPoolItem
sal_Bool bPos :1; //Position geschuetzt
public:
- TYPEINFO();
-
- inline SvxProtectItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ inline SvxProtectItem( const sal_uInt16 nId = 0 );
inline SvxProtectItem &operator=( const SvxProtectItem &rCpy );
// "pure virtual Methoden" vom SfxPoolItem
diff --git a/editeng/inc/editeng/prszitem.hxx b/editeng/inc/editeng/prszitem.hxx
index 23a32e4048d4..a5bc81f07277 100644
--- a/editeng/inc/editeng/prszitem.hxx
+++ b/editeng/inc/editeng/prszitem.hxx
@@ -38,8 +38,6 @@
class EDITENG_DLLPUBLIC SvxPropSizeItem : public SfxUInt16Item
{
public:
- TYPEINFO();
-
SvxPropSizeItem( const sal_uInt16 nPercent /*= 100*/,
const sal_uInt16 nID );
diff --git a/editeng/inc/editeng/scriptspaceitem.hxx b/editeng/inc/editeng/scriptspaceitem.hxx
index 80fc2a505386..33436f9e3330 100644
--- a/editeng/inc/editeng/scriptspaceitem.hxx
+++ b/editeng/inc/editeng/scriptspaceitem.hxx
@@ -39,8 +39,6 @@
class EDITENG_DLLPUBLIC SvxScriptSpaceItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
SvxScriptSpaceItem( sal_Bool bOn /*= sal_False*/,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/scripttypeitem.hxx b/editeng/inc/editeng/scripttypeitem.hxx
index 53db1be9f0db..b5c71c643bc5 100644
--- a/editeng/inc/editeng/scripttypeitem.hxx
+++ b/editeng/inc/editeng/scripttypeitem.hxx
@@ -44,8 +44,6 @@ short GetI18NScriptType( sal_uInt16 nItemType );
class EDITENG_DLLPUBLIC SvxScriptTypeItem : public SfxUInt16Item
{
public:
- TYPEINFO();
-
SvxScriptTypeItem( sal_uInt16 nType = SCRIPTTYPE_LATIN );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
@@ -54,8 +52,6 @@ public:
class EDITENG_DLLPUBLIC SvxScriptSetItem : public SfxSetItem
{
public:
- TYPEINFO();
-
SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/shaditem.hxx b/editeng/inc/editeng/shaditem.hxx
index 0f4969afea44..cb557b72b57d 100644
--- a/editeng/inc/editeng/shaditem.hxx
+++ b/editeng/inc/editeng/shaditem.hxx
@@ -53,9 +53,8 @@ class EDITENG_DLLPUBLIC SvxShadowItem : public SfxEnumItemInterface
sal_uInt16 nWidth;
SvxShadowLocation eLocation;
public:
- TYPEINFO();
-
- SvxShadowItem( const sal_uInt16 nId ,
+ POOLITEM_FACTORY()
+ SvxShadowItem( const sal_uInt16 nId = 0,
const Color *pColor = 0, const sal_uInt16 nWidth = 100 /*5pt*/,
const SvxShadowLocation eLoc = SVX_SHADOW_NONE );
@@ -74,8 +73,8 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
const Color& GetColor() const { return aShadowColor;}
void SetColor( const Color &rNew ) { aShadowColor = rNew; }
diff --git a/editeng/inc/editeng/shdditem.hxx b/editeng/inc/editeng/shdditem.hxx
index f4ec441517b4..c83599abcce5 100644
--- a/editeng/inc/editeng/shdditem.hxx
+++ b/editeng/inc/editeng/shdditem.hxx
@@ -44,10 +44,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxShadowedItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
- SvxShadowedItem( const sal_Bool bShadowed /*= sal_False*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxShadowedItem( const sal_Bool bShadowed = sal_False, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/sizeitem.hxx b/editeng/inc/editeng/sizeitem.hxx
index 46175db81dfe..305726060fc0 100644
--- a/editeng/inc/editeng/sizeitem.hxx
+++ b/editeng/inc/editeng/sizeitem.hxx
@@ -42,9 +42,8 @@ class EDITENG_DLLPUBLIC SvxSizeItem : public SfxPoolItem
Size aSize;
public:
- TYPEINFO();
-
- SvxSizeItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxSizeItem( const sal_uInt16 nId = 0);
SvxSizeItem( const sal_uInt16 nId, const Size& rSize);
inline SvxSizeItem& operator=( const SvxSizeItem &rCpy );
@@ -62,8 +61,8 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
const Size& GetSize() const { return aSize; }
void SetSize(const Size& rSize) { aSize = rSize; }
diff --git a/editeng/inc/editeng/spltitem.hxx b/editeng/inc/editeng/spltitem.hxx
index 4de850b8d90b..e4f0bd8c31cd 100644
--- a/editeng/inc/editeng/spltitem.hxx
+++ b/editeng/inc/editeng/spltitem.hxx
@@ -44,12 +44,10 @@ Dieses Item beschreibt eine logische Variable "Absatz trennen ja oder nein".
class EDITENG_DLLPUBLIC SvxFmtSplitItem : public SfxBoolItem
{
public:
- TYPEINFO();
- ~SvxFmtSplitItem();
-
- inline SvxFmtSplitItem( const sal_Bool bSplit /*= sal_True*/,
- const sal_uInt16 nWh );
+ POOLITEM_FACTORY()
+ inline SvxFmtSplitItem( const sal_Bool bSplit = sal_True, const sal_uInt16 nWh = 0 );
inline SvxFmtSplitItem& operator=( const SvxFmtSplitItem& rSplit );
+ ~SvxFmtSplitItem();
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/svxacorr.hxx b/editeng/inc/editeng/svxacorr.hxx
index 04f55e085409..ff16c49b1a8c 100644
--- a/editeng/inc/editeng/svxacorr.hxx
+++ b/editeng/inc/editeng/svxacorr.hxx
@@ -25,7 +25,6 @@
#define _MySVXACORR_HXX
#include <com/sun/star/embed/XStorage.hpp>
-#include <tools/rtti.hxx>
#include <svl/svarray.hxx>
#include <i18npool/lang.h>
#include <tools/time.hxx>
@@ -237,8 +236,6 @@ public:
LanguageType eLang ) const;
virtual sal_Bool GetLongText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const String& rFileName, const String& rShort, String& rLong );
- TYPEINFO();
-
SvxAutoCorrect( const String& rShareAutocorrFile,
const String& rUserAutocorrFile );
SvxAutoCorrect( const SvxAutoCorrect& );
diff --git a/editeng/inc/editeng/tstpitem.hxx b/editeng/inc/editeng/tstpitem.hxx
index 4174905fe477..d9af4abeb077 100644
--- a/editeng/inc/editeng/tstpitem.hxx
+++ b/editeng/inc/editeng/tstpitem.hxx
@@ -117,9 +117,8 @@ class EDITENG_DLLPUBLIC SvxTabStopItem : public SfxPoolItem, private SvxTabStopA
//friend class SvxTabStopObject_Impl;
public:
- TYPEINFO();
-
- SvxTabStopItem( sal_uInt16 nWhich );
+ POOLITEM_FACTORY()
+ SvxTabStopItem( sal_uInt16 nWhich = 0 );
SvxTabStopItem( const sal_uInt16 nTabs,
const sal_uInt16 nDist,
const SvxTabAdjust eAdjst /*= SVX_TAB_ADJUST_DEFAULT*/,
diff --git a/editeng/inc/editeng/twolinesitem.hxx b/editeng/inc/editeng/twolinesitem.hxx
index 9076acea17b1..1191dc869a86 100644
--- a/editeng/inc/editeng/twolinesitem.hxx
+++ b/editeng/inc/editeng/twolinesitem.hxx
@@ -38,7 +38,6 @@ class EDITENG_DLLPUBLIC SvxTwoLinesItem : public SfxPoolItem
sal_Unicode cStartBracket, cEndBracket;
sal_Bool bOn;
public:
- TYPEINFO();
SvxTwoLinesItem( sal_Bool bOn /*= sal_True*/,
sal_Unicode nStartBracket /*= 0*/,
sal_Unicode nEndBracket /*= 0*/,
diff --git a/editeng/inc/editeng/udlnitem.hxx b/editeng/inc/editeng/udlnitem.hxx
index 5f637b09b94f..33efe9a2c0d4 100644
--- a/editeng/inc/editeng/udlnitem.hxx
+++ b/editeng/inc/editeng/udlnitem.hxx
@@ -44,10 +44,8 @@ class EDITENG_DLLPUBLIC SvxTextLineItem : public SfxEnumItem
{
Color mColor;
public:
- TYPEINFO();
-
- SvxTextLineItem( const FontUnderline eSt,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxTextLineItem( const FontUnderline eSt = UNDERLINE_NONE, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
@@ -99,8 +97,6 @@ public:
class EDITENG_DLLPUBLIC SvxUnderlineItem : public SvxTextLineItem
{
public:
- TYPEINFO();
-
SvxUnderlineItem( const FontUnderline eSt,
const sal_uInt16 nId );
@@ -116,8 +112,6 @@ public:
class EDITENG_DLLPUBLIC SvxOverlineItem : public SvxTextLineItem
{
public:
- TYPEINFO();
-
SvxOverlineItem( const FontUnderline eSt,
const sal_uInt16 nId );
diff --git a/editeng/inc/editeng/ulspitem.hxx b/editeng/inc/editeng/ulspitem.hxx
index da732f3fc2cb..b80043dab8e3 100644
--- a/editeng/inc/editeng/ulspitem.hxx
+++ b/editeng/inc/editeng/ulspitem.hxx
@@ -48,9 +48,8 @@ class EDITENG_DLLPUBLIC SvxULSpaceItem : public SfxPoolItem
sal_uInt16 nLower; //Unterer Rand
sal_uInt16 nPropUpper, nPropLower; // relativ oder absolut (=100%)
public:
- TYPEINFO();
-
- SvxULSpaceItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxULSpaceItem( const sal_uInt16 nId = 0 );
SvxULSpaceItem( const sal_uInt16 nUp, const sal_uInt16 nLow,
const sal_uInt16 nId );
inline SvxULSpaceItem& operator=( const SvxULSpaceItem &rCpy );
@@ -70,8 +69,8 @@ public:
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
- virtual int ScaleMetrics( long nMult, long nDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long nMult, long nDiv );
+ virtual bool HasMetrics() const;
inline void SetUpper( const sal_uInt16 nU, const sal_uInt16 nProp = 100 );
inline void SetLower( const sal_uInt16 nL, const sal_uInt16 nProp = 100 );
diff --git a/editeng/inc/editeng/unoedhlp.hxx b/editeng/inc/editeng/unoedhlp.hxx
index 6cf977384c7d..6ab481bb0049 100644
--- a/editeng/inc/editeng/unoedhlp.hxx
+++ b/editeng/inc/editeng/unoedhlp.hxx
@@ -49,7 +49,6 @@ private:
sal_uLong mnEnd;
public:
- TYPEINFO();
SvxEditSourceHint( sal_uLong nId );
SvxEditSourceHint( sal_uLong nId, sal_uLong nValue, sal_uLong nStart=0, sal_uLong nEnd=0 );
diff --git a/editeng/inc/editeng/unoipset.hxx b/editeng/inc/editeng/unoipset.hxx
index f9d44795eb32..145de3351e1e 100644
--- a/editeng/inc/editeng/unoipset.hxx
+++ b/editeng/inc/editeng/unoipset.hxx
@@ -30,7 +30,6 @@
#include <svl/itemprop.hxx>
class SvxIDPropertyCombineList;
-class SdrItemPool;
class SfxItemSet;
class SvxShape;
diff --git a/editeng/inc/editeng/unoviwou.hxx b/editeng/inc/editeng/unoviwou.hxx
index b070c2a965e8..3db9d7d70eac 100644
--- a/editeng/inc/editeng/unoviwou.hxx
+++ b/editeng/inc/editeng/unoviwou.hxx
@@ -49,6 +49,7 @@ public:
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+ // pure virtual methods from SvxEditViewForwarder
virtual sal_Bool GetSelection( ESelection& rSelection ) const;
virtual sal_Bool SetSelection( const ESelection& rSelection );
virtual sal_Bool Copy();
diff --git a/editeng/inc/editeng/wghtitem.hxx b/editeng/inc/editeng/wghtitem.hxx
index 244edce20b3c..ba08179f38a7 100644
--- a/editeng/inc/editeng/wghtitem.hxx
+++ b/editeng/inc/editeng/wghtitem.hxx
@@ -45,10 +45,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxWeightItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxWeightItem( const FontWeight eWght /*= WEIGHT_NORMAL*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxWeightItem( const FontWeight eWght = WEIGHT_NORMAL, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem + SfxEnumItem
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/editeng/inc/editeng/widwitem.hxx b/editeng/inc/editeng/widwitem.hxx
index c144d380a400..b7f267a7d9bf 100644
--- a/editeng/inc/editeng/widwitem.hxx
+++ b/editeng/inc/editeng/widwitem.hxx
@@ -45,9 +45,8 @@ class EDITENG_DLLPUBLIC SvxWidowsItem: public SfxByteItem
{
friend SvStream & operator<<( SvStream & aS, SvxWidowsItem & );
public:
- TYPEINFO();
-
- SvxWidowsItem( const sal_uInt8 nL /*= 0*/, const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxWidowsItem( const sal_uInt8 nL = 0, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/writingmodeitem.hxx b/editeng/inc/editeng/writingmodeitem.hxx
index 27b3704979af..48ecd8366b04 100644
--- a/editeng/inc/editeng/writingmodeitem.hxx
+++ b/editeng/inc/editeng/writingmodeitem.hxx
@@ -34,8 +34,6 @@
class EDITENG_DLLPUBLIC SvxWritingModeItem : public SfxUInt16Item
{
public:
- TYPEINFO();
-
SvxWritingModeItem( ::com::sun::star::text::WritingMode eValue /*= com::sun::star::text::WritingMode_LR_TB*/,
sal_uInt16 nWhich /*= SDRATTR_TEXTDIRECTION*/ );
virtual ~SvxWritingModeItem();
diff --git a/editeng/inc/editeng/wrlmitem.hxx b/editeng/inc/editeng/wrlmitem.hxx
index 153c0c5d47df..6fbd46695f1e 100644
--- a/editeng/inc/editeng/wrlmitem.hxx
+++ b/editeng/inc/editeng/wrlmitem.hxx
@@ -45,10 +45,8 @@ namespace rtl
class EDITENG_DLLPUBLIC SvxWordLineModeItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
- SvxWordLineModeItem( const sal_Bool bWordLineMode /*= sal_False*/,
- const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxWordLineModeItem( const sal_Bool bWordLineMode = sal_False, const sal_uInt16 nId = 0 );
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/editeng/inc/editeng/xmlcnitm.hxx b/editeng/inc/editeng/xmlcnitm.hxx
index 220ed11022be..07000704f0ce 100644
--- a/editeng/inc/editeng/xmlcnitm.hxx
+++ b/editeng/inc/editeng/xmlcnitm.hxx
@@ -39,8 +39,6 @@ class EDITENG_DLLPUBLIC SvXMLAttrContainerItem: public SfxPoolItem
SvXMLAttrContainerData *pImpl;
public:
- TYPEINFO();
-
SvXMLAttrContainerItem( sal_uInt16 nWhich = 0 );
SvXMLAttrContainerItem( const SvXMLAttrContainerItem& );
virtual ~SvXMLAttrContainerItem();
diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx
index 6bb1fc10eb21..e673408f7875 100644
--- a/editeng/inc/pch/precompiled_editeng.hxx
+++ b/editeng/inc/pch/precompiled_editeng.hxx
@@ -798,7 +798,6 @@
#include "tools/resary.hxx"
#include "tools/resid.hxx"
#include "tools/resmgr.hxx"
-#include "tools/rtti.hxx"
#include "tools/shl.hxx"
#include "tools/solar.h"
#include "tools/stack.hxx"
diff --git a/editeng/prj/build.lst b/editeng/prj/build.lst
index bba7f2666744..5e5ad16cc22c 100644
--- a/editeng/prj/build.lst
+++ b/editeng/prj/build.lst
@@ -1,3 +1,3 @@
-ed editeng : L10N:l10n svtools xmloff linguistic NULL
+ed editeng : L10N:l10n svtools xmloff linguistic drawinglayer NULL
ed editeng\prj nmake - all ed_prj NULL
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 33fea5b4b930..49da2a2e4861 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -2102,7 +2102,7 @@ namespace accessibility
for ( sal_uInt16 n = 0; n < nFields; n++ )
{
EFieldInfo aField = rT.GetFieldInfo( nPara, n );
- if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ if ( dynamic_cast< const SvxURLField* >(aField.pFieldItem->GetField()) )
nHyperLinks++;
}
return nHyperLinks;
@@ -2120,7 +2120,7 @@ namespace accessibility
for ( sal_uInt16 n = 0; n < nFields; n++ )
{
EFieldInfo aField = rT.GetFieldInfo( nPara, n );
- if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ if ( dynamic_cast< const SvxURLField* >(aField.pFieldItem->GetField()) )
{
if ( nHyperLink == nLinkIndex )
{
@@ -2155,7 +2155,7 @@ namespace accessibility
for ( sal_uInt16 n = 0; n < nFields; n++ )
{
EFieldInfo aField = rT.GetFieldInfo( nPara, n );
- if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ if ( dynamic_cast< const SvxURLField* >(aField.pFieldItem->GetField()) )
{
if ( aField.aPosition.nIndex == nEEIndex )
{
diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx
index 6f4bfc2ed729..0e9001548e88 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -29,18 +29,13 @@
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <svl/smplhint.hxx>
-
-#include <tools/rtti.hxx>
#include <editeng/lspcitem.hxx>
#include <editeng/adjitem.hxx>
#include <editeng/tstpitem.hxx>
-
#include <editdoc.hxx>
#include <impedit.hxx>
#include <editdbg.hxx>
-
#include <editeng/numitem.hxx>
-
#include <editeng/akrnitem.hxx>
#include <editeng/cntritem.hxx>
#include <editeng/colritem.hxx>
@@ -57,7 +52,6 @@
#include <editeng/wghtitem.hxx>
#include <editeng/wrlmitem.hxx>
#include <editeng/charscaleitem.hxx>
-
#include <vcl/svapp.hxx> // Fuer AppWindow...
DBG_NAME( EE_ParaPortion )
@@ -442,7 +436,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit
{
case EE_PARA_LRSPACE:
{
- DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLRSpaceItem ) ), "ConvertItem: Ungueltiges Item!" );
+ DBG_ASSERT( dynamic_cast< const SvxLRSpaceItem* >(&rPoolItem), "ConvertItem: Ungueltiges Item!" );
SvxLRSpaceItem& rItem = (SvxLRSpaceItem&)rPoolItem;
rItem.SetTxtFirstLineOfst( sal::static_int_cast< short >( OutputDevice::LogicToLogic( rItem.GetTxtFirstLineOfst(), eSourceUnit, eDestUnit ) ) );
rItem.SetTxtLeft( OutputDevice::LogicToLogic( rItem.GetTxtLeft(), eSourceUnit, eDestUnit ) );
@@ -452,7 +446,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit
break;
case EE_PARA_ULSPACE:
{
- DBG_ASSERT( rPoolItem.IsA( TYPE( SvxULSpaceItem ) ), "ConvertItem: Ungueltiges Item!" );
+ DBG_ASSERT( dynamic_cast< const SvxULSpaceItem* >(&rPoolItem), "ConvertItem: Ungueltiges Item!" );
SvxULSpaceItem& rItem = (SvxULSpaceItem&)rPoolItem;
rItem.SetUpper( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) );
rItem.SetLower( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) );
@@ -460,7 +454,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit
break;
case EE_PARA_SBL:
{
- DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLineSpacingItem ) ), "ConvertItem: Ungueltiges Item!" );
+ DBG_ASSERT( dynamic_cast< const SvxLineSpacingItem* >(&rPoolItem), "ConvertItem: Ungueltiges Item!" );
SvxLineSpacingItem& rItem = (SvxLineSpacingItem&)rPoolItem;
// #96298# SetLineHeight changes also eLineSpace!
if ( rItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN )
@@ -469,7 +463,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit
break;
case EE_PARA_TABS:
{
- DBG_ASSERT( rPoolItem.IsA( TYPE( SvxTabStopItem ) ), "ConvertItem: Ungueltiges Item!" );
+ DBG_ASSERT( dynamic_cast< const SvxTabStopItem* >(&rPoolItem), "ConvertItem: Ungueltiges Item!" );
SvxTabStopItem& rItem = (SvxTabStopItem&)rPoolItem;
SvxTabStopItem aNewItem( EE_PARA_TABS );
for ( sal_uInt16 i = 0; i < rItem.Count(); i++ )
@@ -485,7 +479,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit
case EE_CHAR_FONTHEIGHT_CJK:
case EE_CHAR_FONTHEIGHT_CTL:
{
- DBG_ASSERT( rPoolItem.IsA( TYPE( SvxFontHeightItem ) ), "ConvertItem: Ungueltiges Item!" );
+ DBG_ASSERT( dynamic_cast< const SvxFontHeightItem* >(&rPoolItem), "ConvertItem: Ungueltiges Item!" );
SvxFontHeightItem& rItem = (SvxFontHeightItem&)rPoolItem;
rItem.SetHeight( OutputDevice::LogicToLogic( rItem.GetHeight(), eSourceUnit, eDestUnit ) );
}
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index b15da58cdc74..f8af8401fa1a 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2342,7 +2342,7 @@ sal_Bool EditEngine::UpdateFields()
return bChanges;
}
-void EditEngine::RemoveFields( sal_Bool bKeepFieldText, TypeId aType )
+void EditEngine::RemoveFields( sal_Bool bKeepFieldText, const std::type_info* pTypeInfo )
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -2360,9 +2360,9 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, TypeId aType )
if ( pAttr->Which() == EE_FEATURE_FIELD )
{
const SvxFieldData* pFldData = ((const SvxFieldItem*)pAttr->GetItem())->GetField();
- if ( pFldData && ( !aType || ( pFldData->IsA( aType ) ) ) )
+ if ( pFldData && ( !pTypeInfo || ( *pTypeInfo == typeid(*pFldData) ) ) )
{
- DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "Kein FeldItem..." );
+ DBG_ASSERT( dynamic_cast< const SvxFieldItem* >(pAttr->GetItem()), "Kein FeldItem..." );
EditSelection aSel( EditPaM( pNode, pAttr->GetStart() ), EditPaM( pNode, pAttr->GetEnd() ) );
String aFieldText = ((EditCharAttribField*)pAttr)->GetFieldValue();
pImpEditEngine->ImpInsertText( aSel, aFieldText );
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index add3689a6524..3a2a23735e6f 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -379,7 +379,7 @@ const SvxFieldItem* EditTextObject::GetField() const
return 0;
}
-sal_Bool EditTextObject::HasField( TypeId /*aType*/ ) const
+sal_Bool EditTextObject::HasField( const std::type_info* /*pTypeInfo*/ ) const
{
DBG_ERROR( "V-Methode direkt vom EditTextObject!" );
return sal_False;
@@ -1002,7 +1002,7 @@ const SvxFieldItem* BinTextObject::GetField() const
return 0;
}
-sal_Bool BinTextObject::HasField( TypeId aType ) const
+sal_Bool BinTextObject::HasField( const std::type_info* pTypeInfo ) const
{
sal_uInt16 nParagraphs = GetContents().Count();
for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ )
@@ -1014,11 +1014,11 @@ sal_Bool BinTextObject::HasField( TypeId aType ) const
XEditAttribute* pAttr = pC->GetAttribs()[nAttr];
if ( pAttr->GetItem()->Which() == EE_FEATURE_FIELD )
{
- if ( !aType )
+ if ( !pTypeInfo )
return sal_True;
const SvxFieldData* pFldData = ((const SvxFieldItem*)pAttr->GetItem())->GetField();
- if ( pFldData && pFldData->IsA( aType ) )
+ if ( pFldData && ( *pTypeInfo == typeid(*pFldData) ) )
return sal_True;
}
}
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index 2d1f6de362e2..a88904b72a6e 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -265,7 +265,7 @@ public:
virtual sal_Bool IsFieldObject() const;
virtual const SvxFieldItem* GetField() const;
- virtual sal_Bool HasField( TypeId Type = NULL ) const;
+ virtual sal_Bool HasField( const std::type_info* pTypeInfo = 0 ) const;
SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rAttribs );
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index 51fa7198f585..066e8a7d2d37 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -39,20 +39,6 @@ DBG_NAME( EditUndo )
#define NO_UNDO 0xFFFF
#define GROUP_NOTFOUND 0xFFFF
-TYPEINIT1( EditUndo, SfxUndoAction );
-TYPEINIT1( EditUndoDelContent, EditUndo );
-TYPEINIT1( EditUndoConnectParas, EditUndo );
-TYPEINIT1( EditUndoSplitPara, EditUndo );
-TYPEINIT1( EditUndoInsertChars, EditUndo );
-TYPEINIT1( EditUndoRemoveChars, EditUndo );
-TYPEINIT1( EditUndoInsertFeature, EditUndo );
-TYPEINIT1( EditUndoMoveParagraphs, EditUndo );
-TYPEINIT1( EditUndoSetStyleSheet, EditUndo );
-TYPEINIT1( EditUndoSetParaAttribs, EditUndo );
-TYPEINIT1( EditUndoSetAttribs, EditUndo );
-TYPEINIT1( EditUndoTransliteration, EditUndo );
-TYPEINIT1( EditUndoMarkSelection, EditUndo );
-
void lcl_DoSetSelection( EditView* pView, sal_uInt16 nPara )
{
EPaM aEPaM( nPara, 0 );
@@ -371,7 +357,7 @@ void __EXPORT EditUndoInsertChars::Redo()
sal_Bool __EXPORT EditUndoInsertChars::Merge( SfxUndoAction* pNextAction )
{
- if ( !pNextAction->ISA( EditUndoInsertChars ) )
+ if ( !dynamic_cast< EditUndoInsertChars* >(pNextAction) )
return sal_False;
EditUndoInsertChars* pNext = (EditUndoInsertChars*)pNextAction;
diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx
index 1264579d65ba..2c2f54e22720 100644
--- a/editeng/source/editeng/editundo.hxx
+++ b/editeng/source/editeng/editundo.hxx
@@ -49,7 +49,6 @@ private:
// nicht zerstoerte Objekt!
public:
- TYPEINFO();
EditUndoDelContent( ImpEditEngine* pImpEE, ContentNode* pNode, sal_uInt16 nPortio );
~EditUndoDelContent();
@@ -77,7 +76,6 @@ private:
sal_Bool bBackward;
public:
- TYPEINFO();
EditUndoConnectParas( ImpEditEngine* pImpEE, sal_uInt16 nNode, sal_uInt16 nSepPos,
const SfxItemSet& rLeftParaAttribs, const SfxItemSet& rRightParaAttribs,
const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, sal_Bool bBackward );
@@ -97,7 +95,6 @@ private:
sal_uInt16 nSepPos;
public:
- TYPEINFO();
EditUndoSplitPara( ImpEditEngine* pImpEE, sal_uInt16 nNode, sal_uInt16 nSepPos );
~EditUndoSplitPara();
@@ -115,7 +112,6 @@ private:
String aText;
public:
- TYPEINFO();
EditUndoInsertChars( ImpEditEngine* pImpEE, const EPaM& rEPaM, const String& rStr );
const EPaM& GetEPaM() { return aEPaM; }
@@ -137,7 +133,6 @@ private:
String aText;
public:
- TYPEINFO();
EditUndoRemoveChars( ImpEditEngine* pImpEE, const EPaM& rEPaM, const String& rStr );
const EPaM& GetEPaM() { return aEPaM; }
@@ -157,7 +152,6 @@ private:
SfxPoolItem* pFeature;
public:
- TYPEINFO();
EditUndoInsertFeature( ImpEditEngine* pImpEE, const EPaM& rEPaM,
const SfxPoolItem& rFeature);
~EditUndoInsertFeature();
@@ -176,7 +170,6 @@ private:
sal_uInt16 nDest;
public:
- TYPEINFO();
EditUndoMoveParagraphs( ImpEditEngine* pImpEE, const Range& rParas, sal_uInt16 nDest );
~EditUndoMoveParagraphs();
@@ -198,8 +191,6 @@ private:
SfxItemSet aPrevParaAttribs;
public:
- TYPEINFO();
-
EditUndoSetStyleSheet( ImpEditEngine* pImpEE, sal_uInt16 nPara,
const XubString& rPrevName, SfxStyleFamily ePrevFamily,
const XubString& rNewName, SfxStyleFamily eNewFamily,
@@ -221,7 +212,6 @@ private:
SfxItemSet aNewItems;
public:
- TYPEINFO();
EditUndoSetParaAttribs( ImpEditEngine* pImpEE, sal_uInt16 nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems );
~EditUndoSetParaAttribs();
@@ -248,7 +238,6 @@ private:
public:
- TYPEINFO();
EditUndoSetAttribs( ImpEditEngine* pImpEE, const ESelection& rESel, const SfxItemSet& rNewItems );
~EditUndoSetAttribs();
@@ -278,7 +267,6 @@ private:
String aText;
public:
- TYPEINFO();
EditUndoTransliteration( ImpEditEngine* pImpEE, const ESelection& rESel, sal_Int32 nMode );
~EditUndoTransliteration();
@@ -299,7 +287,6 @@ private:
ESelection aSelection;
public:
- TYPEINFO();
EditUndoMarkSelection( ImpEditEngine* pImpEE, const ESelection& rSel );
~EditUndoMarkSelection();
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 14d073c1ad24..d144ec342a42 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1381,7 +1381,7 @@ const SvxFieldItem* EditView::GetFieldAtSelection() const
if ( pAttr->GetStart() == nXPos )
if ( pAttr->Which() == EE_FEATURE_FIELD )
{
- DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "Kein FeldItem..." );
+ DBG_ASSERT( dynamic_cast< const SvxFieldItem* >(pAttr->GetItem()), "Kein FeldItem..." );
return (const SvxFieldItem*)pAttr->GetItem();
}
}
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 7c44611c9264..b50e93348351 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -141,7 +141,6 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion, OutputD
// zwei Paint-Events!
// 19.10: Muss sogar vor Abfrage von bUpdate, falls nach Invalidate
// noch Paints in der Queue, aber jemand schaltet den UpdateMode um!
-
// pRegion: Wenn nicht NULL, dann nur Region berechnen.
PolyPolygon* pPolyPoly = NULL;
if ( pRegion )
@@ -1206,7 +1205,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara,
if ( pAttr->GetStart() == nXPos )
if ( pAttr->Which() == EE_FEATURE_FIELD )
{
- DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "Kein FeldItem..." );
+ DBG_ASSERT( dynamic_cast< const SvxFieldItem* >(pAttr->GetItem()), "Kein FeldItem..." );
if ( pPara )
*pPara = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
if ( pPos )
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 39807d9f61a3..8a789e0917fa 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -261,7 +261,7 @@ protected:
void ShowDDCursor( const Rectangle& rRect );
void HideDDCursor();
- void ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rDocPosTopLeft, const Point& rDocPosBottomRight, PolyPolygon* pPolyPoly );
+ void ImplDrawHighlightRect( OutputDevice* pOutWin, const Point& rDocPosTopLeft, const Point& rDocPosBottomRight, PolyPolygon* pPolyPoly );
public:
ImpEditView( EditView* pView, EditEngine* pEng, Window* pWindow );
@@ -748,7 +748,7 @@ public:
void FormatDoc();
void FormatFullDoc();
void UpdateViews( EditView* pCurView = 0 );
- void Paint( ImpEditView* pView, const Rectangle& rRect, OutputDevice* pTargetDevice = 0, sal_Bool bUseVirtDev = sal_False );
+ void Paint( ImpEditView* pView, const Rectangle& rRect, OutputDevice* pTargetDevice = 0, bool bUseVirtDev = false );
void Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aStartPos, sal_Bool bStripOnly = sal_False, short nOrientation = 0 );
sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent, EditView* pView );
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index a4204d360093..e818108a8c91 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3683,12 +3683,13 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable(
( pAttr->Which() == EE_FEATURE_FIELD ) )
{
const SvxFieldItem* pField = (const SvxFieldItem*)pAttr->GetItem();
- const SvxFieldData* pFld = pField->GetField();
- if ( pFld && pFld->ISA( SvxURLField ) )
+ const SvxURLField* pSvxURLField = dynamic_cast< const SvxURLField* >(pField->GetField());
+
+ if ( pSvxURLField )
{
// Office-Bookmark
- String aURL( ((const SvxURLField*)pFld)->GetURL() );
- String aTxt( ((const SvxURLField*)pFld)->GetRepresentation() );
+ String aURL( pSvxURLField->GetURL() );
+ String aTxt( pSvxURLField->GetRepresentation() );
pDataObj->GetURL() = aURL;
}
}
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 9809295cc2f6..4a54edb3f782 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -305,7 +305,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView )
aClipRec = pView->pImpEditView->GetWindowPos( aClipRec );
if ( ( pView == pCurView ) )
- Paint( pView->pImpEditView, aClipRec, 0, sal_True );
+ Paint( pView->pImpEditView, aClipRec, 0, true );
else
pView->GetWindow()->Invalidate( aClipRec );
}
@@ -2375,7 +2375,7 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& r
sal_uInt16 nInvPos;
#ifdef DBG_UTIL
- sal_Bool bFound =
+ bool bFound =
#endif
aPositions.Seek_Entry( nPortionStart, &nInvPos );
@@ -2872,7 +2872,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
DBG_ASSERT( GetParaPortions().Count(), "Keine ParaPortion?!" );
SvxFont aTmpFont( GetParaPortions()[0]->GetNode()->GetCharAttribs().GetDefFont() );
Font aOldFont( pOutDev->GetFont() );
- vcl::PDFExtOutDevData* pPDFExtOutDevData = PTR_CAST( vcl::PDFExtOutDevData, pOutDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >( pOutDev->GetExtOutDevData() );
// Bei gedrehtem Text wird aStartPos als TopLeft angesehen, da andere
// Informationen fehlen, und sowieso das ganze Object ungescrollt
@@ -3167,7 +3167,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
{
EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature( nIndex );
DBG_ASSERT( pAttr, "Feld nicht gefunden" );
- DBG_ASSERT( pAttr && pAttr->GetItem()->ISA( SvxFieldItem ), "Feld vom falschen Typ!" );
+ DBG_ASSERT( pAttr && dynamic_cast< const SvxFieldItem* >(pAttr->GetItem()), "Feld vom falschen Typ!" );
aText = ((EditCharAttribField*)pAttr)->GetFieldValue();
nTextStart = 0;
nTextLen = aText.Len();
@@ -3183,7 +3183,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
// add a meta file comment if we record to a metafile
if( bMetafileValid )
{
- SvxFieldItem* pFieldItem = PTR_CAST( SvxFieldItem, pAttr->GetItem() );
+ const SvxFieldItem* pFieldItem = dynamic_cast< const SvxFieldItem* >( pAttr->GetItem() );
if( pFieldItem )
{
const SvxFieldData* pFieldData = pFieldItem->GetField();
@@ -3293,7 +3293,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
if(PORTIONKIND_FIELD == pTextPortion->GetKind())
{
EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature(nIndex);
- SvxFieldItem* pFieldItem = PTR_CAST(SvxFieldItem, pAttr->GetItem());
+ const SvxFieldItem* pFieldItem = dynamic_cast< const SvxFieldItem* >( pAttr->GetItem());
if(pFieldItem)
{
@@ -3447,11 +3447,11 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
if ( pTextPortion->GetKind() == PORTIONKIND_FIELD )
{
EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature( nIndex );
- SvxFieldItem* pFieldItem = PTR_CAST( SvxFieldItem, pAttr->GetItem() );
+ const SvxFieldItem* pFieldItem = dynamic_cast< const SvxFieldItem* >( pAttr->GetItem() );
if( pFieldItem )
{
const SvxFieldData* pFieldData = pFieldItem->GetField();
- if ( pFieldData->ISA( SvxURLField ) )
+ if ( dynamic_cast< const SvxURLField* >(pFieldData) )
{
Point aTopLeft( aTmpPos );
aTopLeft.Y() -= pLine->GetMaxAscent();
@@ -3519,12 +3519,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
{
EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature( nIndex );
DBG_ASSERT( pAttr, "Feld nicht gefunden" );
- DBG_ASSERT( pAttr && pAttr->GetItem()->ISA( SvxFieldItem ), "Feld vom falschen Typ!" );
+ DBG_ASSERT( pAttr && dynamic_cast< const SvxFieldItem* >(pAttr->GetItem()), "Feld vom falschen Typ!" );
// add a meta file comment if we record to a metafile
if( bMetafileValid )
{
- SvxFieldItem* pFieldItem = PTR_CAST( SvxFieldItem, pAttr->GetItem() );
+ const SvxFieldItem* pFieldItem = dynamic_cast< const SvxFieldItem* >( pAttr->GetItem() );
if( pFieldItem )
{
@@ -3634,7 +3634,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
pOutDev->SetFont( aOldFont );
}
-void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, OutputDevice* pTargetDevice, sal_Bool bUseVirtDev )
+void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, OutputDevice* pTargetDevice, bool bUseVirtDev )
{
DBG_ASSERT( pView, "Keine View - Kein Paint!" );
DBG_CHKOBJ( GetEditEnginePtr(), EditEngine, 0 );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 9cab2925ecd3..16772dd9a6e4 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2653,7 +2653,7 @@ sal_uInt16 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxS
aCurSel.Adjust( aEditDoc );
EditPaM aStartPaM = aTmpItem.GetSelection() ? aCurSel.Min() : aEditDoc.GetStartPaM();
EditSelection aFoundSel( aCurSel.Max() );
- sal_Bool bFound = ImpSearch( aTmpItem, aCurSel, aStartPaM, aFoundSel );
+ bool bFound = ImpSearch( aTmpItem, aCurSel, aStartPaM, aFoundSel );
if ( bFound )
UndoActionStart( EDITUNDO_REPLACEALL );
while ( bFound )
@@ -2690,7 +2690,7 @@ sal_Bool ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEdi
aStartPaM = aSel.Min();
EditSelection aFoundSel;
- sal_Bool bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel );
+ bool bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel );
if ( bFound && ( aFoundSel == aSel ) ) // Bei Rueckwaetssuche
{
aStartPaM = aSel.Min();
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index be74f6eee185..d3dea084d934 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -154,15 +154,15 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
SfxStyleSheet* pStyle = NULL;
sal_uLong nId = 0;
+ const SfxStyleSheetHint* pSfxStyleSheetHint = dynamic_cast< const SfxStyleSheetHint* >(&rHint);
- if ( rHint.ISA( SfxStyleSheetHint ) )
+ if ( pSfxStyleSheetHint )
{
- const SfxStyleSheetHint& rH = (const SfxStyleSheetHint&) rHint;
- DBG_ASSERT( rH.GetStyleSheet()->ISA( SfxStyleSheet ), "Kein SfxStyleSheet!" );
- pStyle = (SfxStyleSheet*) rH.GetStyleSheet();
- nId = rH.GetHint();
+ DBG_ASSERT( dynamic_cast< SfxStyleSheet* >(pSfxStyleSheetHint->GetStyleSheet()), "Kein SfxStyleSheet!" );
+ pStyle = (SfxStyleSheet*) pSfxStyleSheetHint->GetStyleSheet();
+ nId = pSfxStyleSheetHint->GetHint();
}
- else if ( ( rHint.Type() == TYPE(SfxSimpleHint ) ) && ( rBC.ISA( SfxStyleSheet ) ) )
+ else if ( dynamic_cast< const SfxSimpleHint* >(&rHint) && dynamic_cast< SfxStyleSheet* >(&rBC) )
{
pStyle = (SfxStyleSheet*)&rBC;
nId = ((SfxSimpleHint&)rHint).GetId();
diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx
index d560c69b676f..c11df46e44fa 100644
--- a/editeng/source/editeng/textconv.cxx
+++ b/editeng/source/editeng/textconv.cxx
@@ -159,7 +159,7 @@ sal_Bool TextConvWrapper::FindConvText_impl()
//ShowLanguageErrors();
- sal_Bool bFound = sal_False;
+ bool bFound = false;
pWin->EnterWait();
sal_Bool bConvert = sal_True;
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index e98514aa72a5..e7aa8c8e18a5 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -40,10 +40,6 @@
// -----------------------------------------------------------------------
-TYPEINIT1(SvxBulletItem,SfxPoolItem);
-
-// -----------------------------------------------------------------------
-
void SvxBulletItem::StoreFont( SvStream& rStream, const Font& rFont )
{
sal_uInt16 nTemp;
@@ -331,7 +327,7 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom )
int SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
{
- DBG_ASSERT(rItem.ISA(SvxBulletItem),"operator==Types not matching");
+ DBG_ASSERT(dynamic_cast< const SvxBulletItem* >(&rItem),"operator==Types not matching");
const SvxBulletItem& rBullet = (const SvxBulletItem&)rItem;
// ValidMask mitvergleichen, da sonst kein Putten in ein AttrSet moeglich,
// wenn sich das Item nur in der ValidMask von einem existierenden unterscheidet.
diff --git a/editeng/source/items/charhiddenitem.cxx b/editeng/source/items/charhiddenitem.cxx
index d960277f8716..397b0f7eaff2 100644
--- a/editeng/source/items/charhiddenitem.cxx
+++ b/editeng/source/items/charhiddenitem.cxx
@@ -29,8 +29,6 @@
#include <editeng/editrids.hrc>
#include <editeng/eerdll.hxx>
-TYPEINIT1_FACTORY(SvxCharHiddenItem, SfxBoolItem, new SvxCharHiddenItem(sal_False, 0));
-
/*-- 16.12.2003 15:24:25---------------------------------------------------
-----------------------------------------------------------------------*/
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index ffebc074c693..17b37133226b 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -42,8 +42,6 @@
// -----------------------------------------------------------------------
-TYPEINIT1( SvxFieldItem, SfxPoolItem );
-
SV_IMPL_PERSIST1( SvxFieldData, SvPersistBase );
// -----------------------------------------------------------------------
@@ -69,7 +67,7 @@ SvxFieldData* SvxFieldData::Clone() const
int SvxFieldData::operator==( const SvxFieldData& rFld ) const
{
- DBG_ASSERT( Type() == rFld.Type(), "==: Verschiedene Typen" );
+ DBG_ASSERT( typeid(*this) == typeid(rFld), "==: Verschiedene Typen" );
(void)rFld;
return sal_True; // Basicklasse immer gleich.
}
@@ -186,7 +184,7 @@ int SvxFieldItem::operator==( const SfxPoolItem& rItem ) const
if ( ( !pField && pOtherFld ) || ( pField && !pOtherFld ) )
return sal_False;
- return ( ( pField->Type() == pOtherFld->Type() )
+ return ( ( typeid(*pField) == typeid(*pOtherFld) )
&& ( *pField == *pOtherFld ) );
}
@@ -225,7 +223,7 @@ SvxFieldData* SvxDateField::Clone() const
int SvxDateField::operator==( const SvxFieldData& rOther ) const
{
- if ( rOther.Type() != Type() )
+ if ( typeid(rOther) != typeid(*this) )
return sal_False;
const SvxDateField& rOtherFld = (const SvxDateField&) rOther;
@@ -361,7 +359,7 @@ SvxFieldData* SvxURLField::Clone() const
int SvxURLField::operator==( const SvxFieldData& rOther ) const
{
- if ( rOther.Type() != Type() )
+ if ( typeid(rOther) != typeid(*this) )
return sal_False;
const SvxURLField& rOtherFld = (const SvxURLField&) rOther;
@@ -437,7 +435,7 @@ SvxFieldData* __EXPORT SvxPageField::Clone() const
int __EXPORT SvxPageField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxPageField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxPageField::Load( SvPersistStream & /*rStm*/ )
@@ -463,7 +461,7 @@ SvxFieldData* __EXPORT SvxPagesField::Clone() const
int __EXPORT SvxPagesField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxPagesField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxPagesField::Load( SvPersistStream & /*rStm*/ )
@@ -483,7 +481,7 @@ SvxFieldData* __EXPORT SvxTimeField::Clone() const
int __EXPORT SvxTimeField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxTimeField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxTimeField::Load( SvPersistStream & /*rStm*/ )
@@ -508,7 +506,7 @@ SvxFieldData* __EXPORT SvxFileField::Clone() const
int __EXPORT SvxFileField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxFileField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxFileField::Load( SvPersistStream & /*rStm*/ )
@@ -528,7 +526,7 @@ SvxFieldData* __EXPORT SvxTableField::Clone() const
int __EXPORT SvxTableField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxTableField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxTableField::Load( SvPersistStream & /*rStm*/ )
@@ -574,7 +572,7 @@ SvxFieldData* SvxExtTimeField::Clone() const
int SvxExtTimeField::operator==( const SvxFieldData& rOther ) const
{
- if ( rOther.Type() != Type() )
+ if ( typeid(rOther) != typeid(*this) )
return sal_False;
const SvxExtTimeField& rOtherFld = (const SvxExtTimeField&) rOther;
@@ -713,7 +711,7 @@ SvxFieldData* SvxExtFileField::Clone() const
int SvxExtFileField::operator==( const SvxFieldData& rOther ) const
{
- if ( rOther.Type() != Type() )
+ if ( typeid(rOther) != typeid(*this) )
return sal_False;
const SvxExtFileField& rOtherFld = (const SvxExtFileField&) rOther;
@@ -865,7 +863,7 @@ SvxFieldData* SvxAuthorField::Clone() const
int SvxAuthorField::operator==( const SvxFieldData& rOther ) const
{
- if ( rOther.Type() != Type() )
+ if ( typeid(rOther) != typeid(*this) )
return sal_False;
const SvxAuthorField& rOtherFld = (const SvxAuthorField&) rOther;
@@ -966,7 +964,7 @@ SvxFieldData* __EXPORT SvxHeaderField::Clone() const
int __EXPORT SvxHeaderField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxHeaderField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxHeaderField::Load( SvPersistStream & /*rStm*/ )
@@ -988,7 +986,7 @@ SvxFieldData* __EXPORT SvxFooterField::Clone() const
int __EXPORT SvxFooterField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxFooterField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxFooterField::Load( SvPersistStream & /*rStm*/ )
@@ -1010,7 +1008,7 @@ SvxFieldData* __EXPORT SvxDateTimeField::Clone() const
int __EXPORT SvxDateTimeField::operator==( const SvxFieldData& rCmp ) const
{
- return ( rCmp.Type() == TYPE(SvxDateTimeField) );
+ return ( typeid(rCmp) == typeid(*this) );
}
void __EXPORT SvxDateTimeField::Load( SvPersistStream & /*rStm*/ )
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 540a987e58af..0354a647bff9 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -119,26 +119,8 @@ inline void SetValueProp( XubString& rStr, const short nValue,
( rStr += String::CreateFromInt32( nProp )) += sal_Unicode('%');
}
-// -----------------------------------------------------------------------
-
-TYPEINIT1_FACTORY(SvxPaperBinItem, SfxByteItem, new SvxPaperBinItem(0));
-TYPEINIT1_FACTORY(SvxSizeItem, SfxPoolItem, new SvxSizeItem(0));
-TYPEINIT1_FACTORY(SvxLRSpaceItem, SfxPoolItem, new SvxLRSpaceItem(0));
-TYPEINIT1_FACTORY(SvxULSpaceItem, SfxPoolItem, new SvxULSpaceItem(0));
-TYPEINIT1_FACTORY(SvxPrintItem, SfxBoolItem, new SvxPrintItem(0));
-TYPEINIT1_FACTORY(SvxOpaqueItem, SfxBoolItem, new SvxOpaqueItem(0));
-TYPEINIT1_FACTORY(SvxProtectItem, SfxPoolItem, new SvxProtectItem(0));
-TYPEINIT1_FACTORY(SvxBrushItem, SfxPoolItem, new SvxBrushItem(0));
-TYPEINIT1_FACTORY(SvxShadowItem, SfxPoolItem, new SvxShadowItem(0));
-TYPEINIT1_FACTORY(SvxBoxItem, SfxPoolItem, new SvxBoxItem(0));
-TYPEINIT1_FACTORY(SvxBoxInfoItem, SfxPoolItem, new SvxBoxInfoItem(0));
-TYPEINIT1_FACTORY(SvxFmtBreakItem, SfxEnumItem, new SvxFmtBreakItem(SVX_BREAK_NONE, 0));
-TYPEINIT1_FACTORY(SvxFmtKeepItem, SfxBoolItem, new SvxFmtKeepItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxLineItem, SfxPoolItem, new SvxLineItem(0));
-TYPEINIT1_FACTORY(SvxFrameDirectionItem, SfxUInt16Item, new SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, 0));
-
-
// class SvxPaperBinItem ------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxPaperBinItem)
SfxPoolItem* SvxPaperBinItem::Clone( SfxItemPool* ) const
{
@@ -205,6 +187,8 @@ SfxItemPresentation SvxPaperBinItem::GetPresentation
// class SvxSizeItem -----------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxSizeItem)
+
SvxSizeItem::SvxSizeItem( const sal_uInt16 nId, const Size& rSize ) :
SfxPoolItem( nId ),
@@ -361,18 +345,17 @@ SvStream& SvxSizeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
// -----------------------------------------------------------------------
-int SvxSizeItem::ScaleMetrics( long nMult, long nDiv )
+void SvxSizeItem::ScaleMetrics( long nMult, long nDiv )
{
aSize.Width() = Scale( aSize.Width(), nMult, nDiv );
aSize.Height() = Scale( aSize.Height(), nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxSizeItem::HasMetrics() const
+bool SvxSizeItem::HasMetrics() const
{
- return 1;
+ return true;
}
// -----------------------------------------------------------------------
@@ -391,6 +374,8 @@ SfxPoolItem* SvxSizeItem::Create( SvStream& rStrm, sal_uInt16 ) const
// class SvxLRSpaceItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxLRSpaceItem)
+
SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) :
SfxPoolItem( nId ),
@@ -776,24 +761,25 @@ sal_uInt16 SvxLRSpaceItem::GetVersion( sal_uInt16 nFileVersion ) const
// -----------------------------------------------------------------------
-int SvxLRSpaceItem::ScaleMetrics( long nMult, long nDiv )
+void SvxLRSpaceItem::ScaleMetrics( long nMult, long nDiv )
{
nFirstLineOfst = (short)Scale( nFirstLineOfst, nMult, nDiv );
nTxtLeft = Scale( nTxtLeft, nMult, nDiv );
nLeftMargin = Scale( nLeftMargin, nMult, nDiv );
nRightMargin = Scale( nRightMargin, nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxLRSpaceItem::HasMetrics() const
+bool SvxLRSpaceItem::HasMetrics() const
{
- return 1;
+ return true;
}
// class SvxULSpaceItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxULSpaceItem)
+
SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nId ) :
SfxPoolItem( nId ),
@@ -1021,18 +1007,17 @@ sal_uInt16 SvxULSpaceItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
// -----------------------------------------------------------------------
-int SvxULSpaceItem::ScaleMetrics( long nMult, long nDiv )
+void SvxULSpaceItem::ScaleMetrics( long nMult, long nDiv )
{
nUpper = (sal_uInt16)Scale( nUpper, nMult, nDiv );
nLower = (sal_uInt16)Scale( nLower, nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxULSpaceItem::HasMetrics() const
+bool SvxULSpaceItem::HasMetrics() const
{
- return 1;
+ return true;
}
@@ -1151,6 +1136,7 @@ SfxItemPresentation SvxOpaqueItem::GetPresentation
}
// class SvxProtectItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxProtectItem)
int SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const
{
@@ -1280,10 +1266,10 @@ SfxPoolItem* SvxProtectItem::Create( SvStream& rStrm, sal_uInt16 ) const
// class SvxShadowItem ---------------------------------------------------
-SvxShadowItem::SvxShadowItem( const sal_uInt16 nId,
- const Color *pColor, const sal_uInt16 nW,
- const SvxShadowLocation eLoc ) :
- SfxEnumItemInterface( nId ),
+IMPL_POOLITEM_FACTORY(SvxShadowItem)
+
+SvxShadowItem::SvxShadowItem( const sal_uInt16 nId, const Color *pColor, const sal_uInt16 nW, const SvxShadowLocation eLoc )
+: SfxEnumItemInterface( nId ),
aShadowColor(COL_GRAY),
nWidth ( nW ),
eLocation ( eLoc )
@@ -1503,17 +1489,16 @@ SvStream& SvxShadowItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ )
// -----------------------------------------------------------------------
-int SvxShadowItem::ScaleMetrics( long nMult, long nDiv )
+void SvxShadowItem::ScaleMetrics( long nMult, long nDiv )
{
nWidth = (sal_uInt16)Scale( nWidth, nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxShadowItem::HasMetrics() const
+bool SvxShadowItem::HasMetrics() const
{
- return 1;
+ return true;
}
// -----------------------------------------------------------------------
@@ -1733,6 +1718,8 @@ bool SvxBorderLine::HasPriority( const SvxBorderLine& rOtherLine ) const
// class SvxBoxItem ------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxBoxItem)
+
SvxBoxItem::SvxBoxItem( const SvxBoxItem& rCpy ) :
SfxPoolItem ( rCpy ),
@@ -1960,7 +1947,7 @@ sal_Bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
table::BorderLine aBorderLine;
if ( aSeq[0] >>= aBorderLine )
{
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
SetLine(bSet ? &aLine : 0, BOX_LINE_LEFT );
}
else
@@ -1968,7 +1955,7 @@ sal_Bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if ( aSeq[1] >>= aBorderLine )
{
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
SetLine(bSet ? &aLine : 0, BOX_LINE_RIGHT );
}
else
@@ -1976,7 +1963,7 @@ sal_Bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if ( aSeq[2] >>= aBorderLine )
{
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
SetLine(bSet ? &aLine : 0, BOX_LINE_BOTTOM );
}
else
@@ -1984,7 +1971,7 @@ sal_Bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if ( aSeq[3] >>= aBorderLine )
{
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
SetLine(bSet ? &aLine : 0, BOX_LINE_TOP );
}
else
@@ -2094,7 +2081,7 @@ sal_Bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
else
return sal_False;
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
SetLine(bSet ? &aLine : 0, nLine);
}
@@ -2310,7 +2297,7 @@ sal_uInt16 SvxBoxItem::GetVersion( sal_uInt16 nFFVer ) const
// -----------------------------------------------------------------------
-int SvxBoxItem::ScaleMetrics( long nMult, long nDiv )
+void SvxBoxItem::ScaleMetrics( long nMult, long nDiv )
{
if ( pTop ) pTop->ScaleMetrics( nMult, nDiv );
if ( pBottom ) pBottom->ScaleMetrics( nMult, nDiv );
@@ -2320,14 +2307,13 @@ int SvxBoxItem::ScaleMetrics( long nMult, long nDiv )
nBottomDist = (sal_uInt16)Scale( nBottomDist, nMult, nDiv );
nLeftDist = (sal_uInt16)Scale( nLeftDist, nMult, nDiv );
nRightDist = (sal_uInt16)Scale( nRightDist, nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxBoxItem::HasMetrics() const
+bool SvxBoxItem::HasMetrics() const
{
- return 1;
+ return true;
}
// -----------------------------------------------------------------------
@@ -2534,6 +2520,8 @@ sal_uInt16 SvxBoxItem::CalcLineSpace( sal_uInt16 nLine, sal_Bool bIgnoreLine ) c
// class SvxBoxInfoItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxBoxInfoItem)
+
SvxBoxInfoItem::SvxBoxInfoItem( const sal_uInt16 nId ) :
SfxPoolItem( nId ),
pHori ( 0 ),
@@ -2717,19 +2705,18 @@ SvStream& SvxBoxInfoItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ )
// -----------------------------------------------------------------------
-int SvxBoxInfoItem::ScaleMetrics( long nMult, long nDiv )
+void SvxBoxInfoItem::ScaleMetrics( long nMult, long nDiv )
{
if ( pHori ) pHori->ScaleMetrics( nMult, nDiv );
if ( pVert ) pVert->ScaleMetrics( nMult, nDiv );
nDefDist = (sal_uInt16)Scale( nDefDist, nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxBoxInfoItem::HasMetrics() const
+bool SvxBoxInfoItem::HasMetrics() const
{
- return 1;
+ return true;
}
// -----------------------------------------------------------------------
@@ -2878,7 +2865,7 @@ sal_Bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
sal_Int32 nVal( 0 );
if ( aSeq[0] >>= aBorderLine )
{
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
if ( bSet )
SetLine( &aLine, BOXINFO_LINE_HORI );
}
@@ -2886,7 +2873,7 @@ sal_Bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return sal_False;
if ( aSeq[1] >>= aBorderLine )
{
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
if ( bSet )
SetLine( &aLine, BOXINFO_LINE_VERT );
}
@@ -2970,7 +2957,7 @@ sal_Bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return sal_False;
SvxBorderLine aLine;
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
+ bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
if ( bSet )
SetLine( &aLine, nMemberId == MID_HORIZONTAL ? BOXINFO_LINE_HORI : BOXINFO_LINE_VERT );
break;
@@ -3015,6 +3002,7 @@ sal_Bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
// class SvxFmtBreakItem -------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxFmtBreakItem)
int SvxFmtBreakItem::operator==( const SfxPoolItem& rAttr ) const
{
@@ -3154,6 +3142,7 @@ sal_uInt16 SvxFmtBreakItem::GetValueCount() const
}
// class SvxFmtKeepItem -------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxFmtKeepItem)
SfxPoolItem* SvxFmtKeepItem::Clone( SfxItemPool* ) const
{
@@ -3212,6 +3201,8 @@ SfxItemPresentation SvxFmtKeepItem::GetPresentation
// class SvxLineItem ------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxLineItem)
+
SvxLineItem::SvxLineItem( const sal_uInt16 nId ) :
SfxPoolItem ( nId ),
@@ -3379,17 +3370,16 @@ SvStream& SvxLineItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
// -----------------------------------------------------------------------
-int SvxLineItem::ScaleMetrics( long nMult, long nDiv )
+void SvxLineItem::ScaleMetrics( long nMult, long nDiv )
{
if ( pLine ) pLine->ScaleMetrics( nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxLineItem::HasMetrics() const
+bool SvxLineItem::HasMetrics() const
{
- return 1;
+ return true;
}
// -----------------------------------------------------------------------
@@ -3443,6 +3433,8 @@ public:
// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxBrushItem)
+
void SvxBrushItem::SetDoneLink( const Link& rLink )
{
pImpl->aDoneLink = rLink;
diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx
index 3ba4671653b3..9df2bb1c7d37 100644
--- a/editeng/source/items/itemtype.cxx
+++ b/editeng/source/items/itemtype.cxx
@@ -151,7 +151,7 @@ XubString GetColorString( const Color& rCol )
{
XubString sStr;
- FASTBOOL bFound = sal_False;
+ bool bFound = false;
ColorData nColData =
RGB_COLORDATA( rCol.GetRed(), rCol.GetGreen(), rCol.GetBlue() );
sal_uInt16 nColor = 0, nColCount = 16;
@@ -165,7 +165,7 @@ XubString GetColorString( const Color& rCol )
while ( !bFound && nColor < nColCount )
{
if ( aColAry[nColor] == nColData )
- bFound = sal_True;
+ bFound = true;
else
nColor++;
}
diff --git a/editeng/source/items/optitems.cxx b/editeng/source/items/optitems.cxx
index 70ee959f5f06..e096f9a3a5b8 100644
--- a/editeng/source/items/optitems.cxx
+++ b/editeng/source/items/optitems.cxx
@@ -37,11 +37,6 @@
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::linguistic2;
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(SfxSpellCheckItem, SfxPoolItem);
-TYPEINIT1(SfxHyphenRegionItem, SfxPoolItem);
-
// class SfxSpellCheckItem -----------------------------------------------
SfxSpellCheckItem::SfxSpellCheckItem
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 41e961ac0133..3f13c232b84a 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -36,7 +36,6 @@
using namespace ::rtl;
using namespace ::com::sun::star;
-#include <tools/rtti.hxx>
#define GLOBALOVERFLOW3
#define _SVX_PARAITEM_CXX
@@ -76,30 +75,22 @@ using namespace ::com::sun::star;
#define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
#define MM100_TO_TWIP_UNSIGNED(MM100) ((((MM100)*72L+63L)/127L))
-
-// STATIC DATA -----------------------------------------------------------
-
-
// -----------------------------------------------------------------------
-
-TYPEINIT1_FACTORY(SvxLineSpacingItem, SfxPoolItem , new SvxLineSpacingItem(LINE_SPACE_DEFAULT_HEIGHT, 0));
-TYPEINIT1_FACTORY(SvxAdjustItem, SfxPoolItem, new SvxAdjustItem(SVX_ADJUST_LEFT, 0));
-TYPEINIT1_FACTORY(SvxWidowsItem, SfxByteItem, new SvxWidowsItem(0, 0));
-TYPEINIT1_FACTORY(SvxOrphansItem, SfxByteItem, new SvxOrphansItem(0, 0));
-TYPEINIT1_FACTORY(SvxHyphenZoneItem, SfxPoolItem, new SvxHyphenZoneItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxTabStopItem, SfxPoolItem, new SvxTabStopItem(0));
-TYPEINIT1_FACTORY(SvxFmtSplitItem, SfxBoolItem, new SvxFmtSplitItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxPageModelItem, SfxStringItem, new SvxPageModelItem(0));
-TYPEINIT1_FACTORY(SvxScriptSpaceItem, SfxBoolItem, new SvxScriptSpaceItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxHangingPunctuationItem, SfxBoolItem, new SvxHangingPunctuationItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxForbiddenRuleItem, SfxBoolItem, new SvxForbiddenRuleItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxParaVertAlignItem, SfxUInt16Item, new SvxParaVertAlignItem(0, 0));
-TYPEINIT1_FACTORY(SvxParaGridItem, SfxBoolItem, new SvxParaGridItem(sal_True, 0));
-
SV_IMPL_VARARR_SORT( SvxTabStopArr, SvxTabStop )
// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxLineSpacingItem)
+
+SvxLineSpacingItem::SvxLineSpacingItem( )
+ : SfxEnumItemInterface( 0 )
+{
+ nPropLineSpace = 100;
+ nInterLineSpace = 0;
+ nLineHeight = 0;
+ eLineSpace = SVX_LINE_SPACE_AUTO;
+ eInterLineSpace = SVX_INTER_LINE_SPACE_OFF;
+}
SvxLineSpacingItem::SvxLineSpacingItem( sal_uInt16 nHeight, const sal_uInt16 nId )
: SfxEnumItemInterface( nId )
@@ -363,6 +354,15 @@ void SvxLineSpacingItem::SetEnumValue( sal_uInt16 nVal )
// class SvxAdjustItem ---------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxAdjustItem)
+
+SvxAdjustItem::SvxAdjustItem( )
+ : SfxEnumItemInterface( 0 ),
+ bOneBlock( sal_False ), bLastCenter( sal_False ), bLastBlock( sal_False )
+{
+ SetAdjust( SVX_ADJUST_LEFT );
+}
+
SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId )
: SfxEnumItemInterface( nId ),
bOneBlock( sal_False ), bLastCenter( sal_False ), bLastBlock( sal_False )
@@ -550,6 +550,7 @@ SvStream& SvxAdjustItem::Store( SvStream& rStrm, sal_uInt16 nItemVersion ) const
}
// class SvxWidowsItem ---------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxWidowsItem)
SvxWidowsItem::SvxWidowsItem(const sal_uInt8 nL, const sal_uInt16 nId ) :
SfxByteItem( nId, nL )
@@ -622,6 +623,7 @@ SfxItemPresentation SvxWidowsItem::GetPresentation
}
// class SvxOrphansItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxOrphansItem)
SvxOrphansItem::SvxOrphansItem(const sal_uInt8 nL, const sal_uInt16 nId ) :
SfxByteItem( nId, nL )
@@ -694,6 +696,7 @@ SfxItemPresentation SvxOrphansItem::GetPresentation
}
// class SvxHyphenZoneItem -----------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxHyphenZoneItem)
SvxHyphenZoneItem::SvxHyphenZoneItem( const sal_Bool bHyph, const sal_uInt16 nId ) :
SfxPoolItem( nId )
@@ -923,6 +926,8 @@ XubString SvxTabStop::GetValueString() const
// class SvxTabStopItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxTabStopItem)
+
SvxTabStopItem::SvxTabStopItem( sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich ),
SvxTabStopArr( sal_Int8(SVX_TAB_DEFCOUNT) )
@@ -1238,7 +1243,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ )
//Alles nur SWG!
const SfxItemPool *pPool = SfxItemPool::GetStoringPool();
- const FASTBOOL bStoreDefTabs = pPool
+ const bool bStoreDefTabs = pPool
&& pPool->GetName().EqualsAscii("SWG")
&& ::IsDefaultItem( this );
@@ -1311,6 +1316,8 @@ void SvxTabStopItem::Insert( const SvxTabStopItem* pTabs, sal_uInt16 nStart,
// class SvxFmtSplitItem -------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxFmtSplitItem)
+
SvxFmtSplitItem::~SvxFmtSplitItem()
{
}
@@ -1416,7 +1423,7 @@ SfxItemPresentation SvxPageModelItem::GetPresentation
) const
{
rText.Erase();
- FASTBOOL bSet = ( GetValue().Len() > 0 );
+ bool bSet = ( GetValue().Len() > 0 );
switch ( ePres )
{
@@ -1610,6 +1617,7 @@ SfxItemPresentation SvxForbiddenRuleItem::GetPresentation(
/*************************************************************************
|* class SvxParaVertAlignItem
*************************************************************************/
+IMPL_POOLITEM_FACTORY(SvxParaVertAlignItem)
SvxParaVertAlignItem::SvxParaVertAlignItem( sal_uInt16 nValue,
const sal_uInt16 nW )
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index dd454a1700b8..a80bce4ff562 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -122,46 +122,6 @@ using namespace ::com::sun::star::text;
sal_Bool SvxFontItem::bEnableStoreUnicodeNames = sal_False;
-// STATIC DATA -----------------------------------------------------------
-
-// -----------------------------------------------------------------------
-
-TYPEINIT1(SvxFontListItem, SfxPoolItem);
-TYPEINIT1_FACTORY(SvxFontItem, SfxPoolItem, new SvxFontItem(0));
-TYPEINIT1_FACTORY(SvxPostureItem, SfxEnumItem, new SvxPostureItem(ITALIC_NONE, 0));
-TYPEINIT1_FACTORY(SvxWeightItem, SfxEnumItem, new SvxWeightItem(WEIGHT_NORMAL, 0));
-TYPEINIT1_FACTORY(SvxFontHeightItem, SfxPoolItem, new SvxFontHeightItem(240, 100, 0));
-TYPEINIT1_FACTORY(SvxFontWidthItem, SfxPoolItem, new SvxFontWidthItem(0, 100, 0));
-TYPEINIT1_FACTORY(SvxTextLineItem, SfxEnumItem, new SvxTextLineItem(UNDERLINE_NONE, 0));
-TYPEINIT1_FACTORY(SvxUnderlineItem, SfxEnumItem, new SvxUnderlineItem(UNDERLINE_NONE, 0));
-TYPEINIT1_FACTORY(SvxOverlineItem, SfxEnumItem, new SvxOverlineItem(UNDERLINE_NONE, 0));
-TYPEINIT1_FACTORY(SvxCrossedOutItem, SfxEnumItem, new SvxCrossedOutItem(STRIKEOUT_NONE, 0));
-TYPEINIT1_FACTORY(SvxShadowedItem, SfxBoolItem, new SvxShadowedItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxAutoKernItem, SfxBoolItem, new SvxAutoKernItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxWordLineModeItem, SfxBoolItem, new SvxWordLineModeItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxContourItem, SfxBoolItem, new SvxContourItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxPropSizeItem, SfxUInt16Item, new SvxPropSizeItem(100, 0));
-TYPEINIT1_FACTORY(SvxColorItem, SfxPoolItem, new SvxColorItem(0));
-TYPEINIT1_FACTORY(SvxCharSetColorItem, SvxColorItem, new SvxCharSetColorItem(0));
-TYPEINIT1_FACTORY(SvxKerningItem, SfxInt16Item, new SvxKerningItem(0, 0));
-TYPEINIT1_FACTORY(SvxCaseMapItem, SfxEnumItem, new SvxCaseMapItem(SVX_CASEMAP_NOT_MAPPED, 0));
-TYPEINIT1_FACTORY(SvxEscapementItem, SfxPoolItem, new SvxEscapementItem(0));
-TYPEINIT1_FACTORY(SvxLanguageItem, SfxEnumItem, new SvxLanguageItem(LANGUAGE_GERMAN, 0));
-TYPEINIT1_FACTORY(SvxNoLinebreakItem, SfxBoolItem, new SvxNoLinebreakItem(sal_True, 0));
-TYPEINIT1_FACTORY(SvxNoHyphenItem, SfxBoolItem, new SvxNoHyphenItem(sal_True, 0));
-TYPEINIT1_FACTORY(SvxLineColorItem, SvxColorItem, new SvxLineColorItem(0));
-TYPEINIT1_FACTORY(SvxBlinkItem, SfxBoolItem, new SvxBlinkItem(sal_False, 0));
-TYPEINIT1_FACTORY(SvxEmphasisMarkItem, SfxUInt16Item, new SvxEmphasisMarkItem(EMPHASISMARK_NONE, 0));
-TYPEINIT1_FACTORY(SvxTwoLinesItem, SfxPoolItem, new SvxTwoLinesItem(sal_True, 0, 0, 0));
-TYPEINIT1_FACTORY(SvxScriptTypeItem, SfxUInt16Item, new SvxScriptTypeItem);
-TYPEINIT1_FACTORY(SvxCharRotateItem, SfxUInt16Item, new SvxCharRotateItem(0, sal_False, 0));
-TYPEINIT1_FACTORY(SvxCharScaleWidthItem, SfxUInt16Item, new SvxCharScaleWidthItem(100, 0));
-TYPEINIT1_FACTORY(SvxCharReliefItem, SfxEnumItem, new SvxCharReliefItem(RELIEF_NONE, 0));
-
-
-TYPEINIT1(SvxScriptSetItem, SfxSetItem );
-
-
// class SvxFontListItem -------------------------------------------------
SvxFontListItem::SvxFontListItem( const FontList* pFontLst,
@@ -227,6 +187,8 @@ SfxItemPresentation SvxFontListItem::GetPresentation
// class SvxFontItem -----------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxFontItem)
+
SvxFontItem::SvxFontItem( const sal_uInt16 nId ) :
SfxPoolItem( nId )
{
@@ -494,6 +456,8 @@ void SvxFontItem::EnableStoreUnicodeNames( sal_Bool bEnable )
// class SvxPostureItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxPostureItem)
+
SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const sal_uInt16 nId ) :
SfxEnumItem( nId, (sal_uInt16)ePosture )
{
@@ -647,6 +611,8 @@ void SvxPostureItem::SetBoolValue( sal_Bool bVal )
// class SvxWeightItem ---------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxWeightItem)
+
SvxWeightItem::SvxWeightItem( const FontWeight eWght, const sal_uInt16 nId ) :
SfxEnumItem( nId, (sal_uInt16)eWght )
{
@@ -789,6 +755,8 @@ sal_Bool SvxWeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
// class SvxFontHeightItem -----------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxFontHeightItem)
+
SvxFontHeightItem::SvxFontHeightItem( const sal_uLong nSz,
const sal_uInt16 nPrp,
const sal_uInt16 nId ) :
@@ -1137,17 +1105,16 @@ sal_uInt16 SvxFontHeightItem::GetVersion(sal_uInt16 nFileVersion) const
// -----------------------------------------------------------------------
-int SvxFontHeightItem::ScaleMetrics( long nMult, long nDiv )
+void SvxFontHeightItem::ScaleMetrics( long nMult, long nDiv )
{
nHeight = (sal_uInt32)Scale( nHeight, nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxFontHeightItem::HasMetrics() const
+bool SvxFontHeightItem::HasMetrics() const
{
- return 1;
+ return true;
}
void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewProp,
@@ -1218,17 +1185,16 @@ SvStream& SvxFontWidthItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/
// -----------------------------------------------------------------------
-int SvxFontWidthItem::ScaleMetrics( long nMult, long nDiv )
+void SvxFontWidthItem::ScaleMetrics( long nMult, long nDiv )
{
nWidth = (sal_uInt16)Scale( nWidth, nMult, nDiv );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxFontWidthItem::HasMetrics() const
+bool SvxFontWidthItem::HasMetrics() const
{
- return 1;
+ return true;
}
// -----------------------------------------------------------------------
@@ -1333,6 +1299,8 @@ SfxItemPresentation SvxFontWidthItem::GetPresentation
// class SvxTextLineItem ------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxTextLineItem)
+
SvxTextLineItem::SvxTextLineItem( const FontUnderline eSt, const sal_uInt16 nId )
: SfxEnumItem( nId, (sal_uInt16)eSt ), mColor( COL_TRANSPARENT )
{
@@ -1572,6 +1540,8 @@ XubString SvxOverlineItem::GetValueTextByPos( sal_uInt16 nPos ) const
// class SvxCrossedOutItem -----------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxCrossedOutItem)
+
SvxCrossedOutItem::SvxCrossedOutItem( const FontStrikeout eSt, const sal_uInt16 nId )
: SfxEnumItem( nId, (sal_uInt16)eSt )
{
@@ -1704,6 +1674,8 @@ sal_Bool SvxCrossedOutItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId
}
// class SvxShadowedItem -------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxShadowedItem)
+
SvxShadowedItem::SvxShadowedItem( const sal_Bool bShadowed, const sal_uInt16 nId ) :
SfxBoolItem( nId, bShadowed )
{
@@ -1765,6 +1737,8 @@ SfxItemPresentation SvxShadowedItem::GetPresentation
// class SvxAutoKernItem -------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxAutoKernItem)
+
SvxAutoKernItem::SvxAutoKernItem( const sal_Bool bAutoKern, const sal_uInt16 nId ) :
SfxBoolItem( nId, bAutoKern )
{
@@ -1826,6 +1800,8 @@ SfxItemPresentation SvxAutoKernItem::GetPresentation
// class SvxWordLineModeItem ---------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxWordLineModeItem)
+
SvxWordLineModeItem::SvxWordLineModeItem( const sal_Bool bWordLineMode,
const sal_uInt16 nId ) :
SfxBoolItem( nId, bWordLineMode )
@@ -1888,6 +1864,8 @@ SfxItemPresentation SvxWordLineModeItem::GetPresentation
// class SvxContourItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxContourItem)
+
SvxContourItem::SvxContourItem( const sal_Bool bContoured, const sal_uInt16 nId ) :
SfxBoolItem( nId, bContoured )
{
@@ -1994,6 +1972,8 @@ SfxItemPresentation SvxPropSizeItem::GetPresentation
// class SvxColorItem ----------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxColorItem)
+
SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
SfxPoolItem( nId ),
mColor( COL_BLACK )
@@ -2195,6 +2175,8 @@ SfxItemPresentation SvxCharSetColorItem::GetPresentation
// class SvxKerningItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxKerningItem)
+
SvxKerningItem::SvxKerningItem( const short nKern, const sal_uInt16 nId ) :
SfxInt16Item( nId, nKern )
{
@@ -2217,17 +2199,16 @@ SvStream& SvxKerningItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ )
// -----------------------------------------------------------------------
-int SvxKerningItem::ScaleMetrics( long nMult, long nDiv )
+void SvxKerningItem::ScaleMetrics( long nMult, long nDiv )
{
SetValue( (sal_Int16)Scale( GetValue(), nMult, nDiv ) );
- return 1;
}
// -----------------------------------------------------------------------
-int SvxKerningItem::HasMetrics() const
+bool SvxKerningItem::HasMetrics() const
{
- return 1;
+ return true;
}
// -----------------------------------------------------------------------
@@ -2304,6 +2285,7 @@ sal_Bool SvxKerningItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId)
}
// class SvxCaseMapItem --------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxCaseMapItem)
SvxCaseMapItem::SvxCaseMapItem( const SvxCaseMap eMap, const sal_uInt16 nId ) :
SfxEnumItem( nId, (sal_uInt16)eMap )
@@ -2413,6 +2395,8 @@ sal_Bool SvxCaseMapItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/
// class SvxEscapementItem -----------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxEscapementItem)
+
SvxEscapementItem::SvxEscapementItem( const sal_uInt16 nId ) :
SfxEnumItemInterface( nId ),
@@ -2626,6 +2610,8 @@ sal_Bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId
// class SvxLanguageItem -------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxLanguageItem)
+
SvxLanguageItem::SvxLanguageItem( const LanguageType eLang, const sal_uInt16 nId )
: SfxEnumItem( nId , eLang )
{
@@ -2881,6 +2867,11 @@ SvxLineColorItem::~SvxLineColorItem()
//------------------------------------------------------------------------
+SfxPoolItem* SvxLineColorItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SvxLineColorItem(GetValue(), Which());
+}
+
SfxItemPresentation SvxLineColorItem::GetPresentation
(
SfxItemPresentation ePres,
@@ -2895,7 +2886,7 @@ SfxItemPresentation SvxLineColorItem::GetPresentation
}
// class SvxBlinkItem -------------------------------------------------
-
+IMPL_POOLITEM_FACTORY(SvxBlinkItem)
SvxBlinkItem::SvxBlinkItem( const sal_Bool bBlink, const sal_uInt16 nId ) :
SfxBoolItem( nId, bBlink )
@@ -2958,6 +2949,8 @@ SfxItemPresentation SvxBlinkItem::GetPresentation
// class SvxEmphaisMarkItem ---------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxEmphasisMarkItem)
+
SvxEmphasisMarkItem::SvxEmphasisMarkItem( const FontEmphasisMark nValue,
const sal_uInt16 nId )
: SfxUInt16Item( nId, nValue )
@@ -3255,6 +3248,7 @@ sal_uInt16 SvxTwoLinesItem::GetVersion( sal_uInt16 nFFVer ) const
/*************************************************************************
|* class SvxCharRotateItem
*************************************************************************/
+IMPL_POOLITEM_FACTORY(SvxCharRotateItem)
SvxCharRotateItem::SvxCharRotateItem( sal_uInt16 nValue,
sal_Bool bFitIntoLine,
@@ -3378,6 +3372,8 @@ int SvxCharRotateItem::operator==( const SfxPoolItem& rItem ) const
|* class SvxCharScaleItem
*************************************************************************/
+IMPL_POOLITEM_FACTORY(SvxCharScaleWidthItem)
+
SvxCharScaleWidthItem::SvxCharScaleWidthItem( sal_uInt16 nValue,
const sal_uInt16 nW )
: SfxUInt16Item( nW, nValue )
@@ -3488,6 +3484,8 @@ sal_Bool SvxCharScaleWidthItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberI
|* class SvxCharReliefItem
*************************************************************************/
+IMPL_POOLITEM_FACTORY(SvxCharReliefItem)
+
SvxCharReliefItem::SvxCharReliefItem( FontRelief eValue,
const sal_uInt16 nId )
: SfxEnumItem( nId, (sal_uInt16)eValue )
diff --git a/editeng/source/items/writingmodeitem.cxx b/editeng/source/items/writingmodeitem.cxx
index 8bbd73deebe9..d356db8dd866 100644
--- a/editeng/source/items/writingmodeitem.cxx
+++ b/editeng/source/items/writingmodeitem.cxx
@@ -36,8 +36,6 @@ using namespace ::com::sun::star::text;
// class SvxWritingModeItem -------------------------------------------------
-TYPEINIT1_FACTORY(SvxWritingModeItem, SfxUInt16Item, new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB, 0));
-
SvxWritingModeItem::SvxWritingModeItem( WritingMode eValue, sal_uInt16 _nWhich )
: SfxUInt16Item( _nWhich, (sal_uInt16)eValue )
{
diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx
index 28182dc2b840..0bf1c1a93971 100644
--- a/editeng/source/items/xmlcnitm.cxx
+++ b/editeng/source/items/xmlcnitm.cxx
@@ -39,8 +39,6 @@ using namespace ::com::sun::star::xml;
// ------------------------------------------------------------------------
-TYPEINIT1(SvXMLAttrContainerItem, SfxPoolItem);
-
SvXMLAttrContainerItem::SvXMLAttrContainerItem( sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich )
{
@@ -61,8 +59,7 @@ SvXMLAttrContainerItem::~SvXMLAttrContainerItem()
int SvXMLAttrContainerItem::operator==( const SfxPoolItem& rItem ) const
{
- DBG_ASSERT( rItem.ISA(SvXMLAttrContainerItem),
- "SvXMLAttrContainerItem::operator ==(): Bad type");
+ DBG_ASSERT( dynamic_cast< const SvXMLAttrContainerItem* >(&rItem), "SvXMLAttrContainerItem::operator ==(): Bad type");
return *pImpl == *((const SvXMLAttrContainerItem&)rItem).pImpl;
}
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index f8f83c7b8319..409309db745a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -111,7 +111,6 @@ void DecryptBlockName_Imp( String& rName );
_SV_IMPL_SORTAR_ALG( SvxAutocorrWordList, SvxAutocorrWordPtr )
-TYPEINIT0(SvxAutoCorrect)
typedef SvxAutoCorrectLanguageLists* SvxAutoCorrectLanguageListsPtr;
DECLARE_TABLE( SvxAutoCorrLanguageTable_Impl, SvxAutoCorrectLanguageListsPtr)
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 533b186dcf6f..dfe396e5cafd 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -139,7 +139,7 @@ Sequence< OUString > lcl_GetLastFoundSvcs(
SvxLocaleToLanguage( rAvailLocale ) ) );
Sequence< OUString > aNodeNames( rCfg.GetNodeNames(rLastFoundList) );
- sal_Bool bFound = lcl_FindEntry( aCfgLocaleStr, aNodeNames);
+ bool bFound = lcl_FindEntry( aCfgLocaleStr, aNodeNames);
if (bFound)
{
@@ -576,7 +576,7 @@ sal_Bool SAL_CALL
else if (!pLocaleSeq) // if not already loaded save startup time by avoiding loading them now
GetCfgLocales();
GetCfgLocales();
- sal_Bool bFound = sal_False;
+ bool bFound = false;
sal_Int32 nLen = pLocaleSeq->getLength();
const Locale *pLocale = pLocaleSeq->getConstArray();
const Locale *pEnd = pLocale + nLen;
diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx
index 9566a2ff128b..14991c474a4e 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -196,10 +196,10 @@ sal_Bool Outliner::UpdateFields()
return pEditEngine->UpdateFields();
}
-void Outliner::RemoveFields( sal_Bool bKeepFieldText, TypeId aType )
+void Outliner::RemoveFields( sal_Bool bKeepFieldText, const std::type_info* pTypeInfo )
{
DBG_CHKTHIS(Outliner,0);
- pEditEngine->RemoveFields( bKeepFieldText, aType );
+ pEditEngine->RemoveFields( bKeepFieldText, pTypeInfo );
}
void Outliner::SetWordDelimiters( const String& rDelimiters )
diff --git a/editeng/source/outliner/outlinerdecomposition.cxx b/editeng/source/outliner/outlinerdecomposition.cxx
new file mode 100644
index 000000000000..944e34e189b0
--- /dev/null
+++ b/editeng/source/outliner/outlinerdecomposition.cxx
@@ -0,0 +1,604 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_editeng.hxx"
+
+#include <editeng/outliner.hxx>
+#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <editeng/escpitem.hxx>
+#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
+#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
+#include <editeng/flditem.hxx>
+#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// helpers
+
+namespace
+{
+ drawinglayer::primitive2d::Primitive2DSequence impConvertVectorToPrimitive2DSequence(
+ const std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rPrimitiveVector)
+ {
+ const sal_Int32 nCount(rPrimitiveVector.size());
+ drawinglayer::primitive2d::Primitive2DSequence aRetval(nCount);
+
+ for(sal_Int32 a(0); a < nCount; a++)
+ {
+ aRetval[a] = drawinglayer::primitive2d::Primitive2DReference(rPrimitiveVector[a]);
+ }
+
+ return aRetval;
+ }
+
+ class impTextBreakupHandler
+ {
+ private:
+ std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maTextPortionPrimitives;
+ std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maLinePrimitives;
+ std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maParagraphPrimitives;
+
+ Outliner& mrOutliner;
+
+ // the visible area for contour text decomposition
+ const basegfx::B2DVector* mpContourScale;
+
+ // #SJ# ClipRange for BlockText decomposition; only text portions completely
+ // inside are to be accepted, so this is different from geometric clipping
+ // (which would allow e.g. upper parts of portions to remain). Only used for
+ // BlockText (see there)
+ const basegfx::B2DRange* mpClipRange;
+
+ DECL_LINK(decomposeTextPrimitive, DrawPortionInfo* );
+ DECL_LINK(decomposeBulletPrimitive, DrawBulletInfo* );
+
+ bool impIsUnderlineAbove(const Font& rFont) const;
+ void impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo);
+ drawinglayer::primitive2d::BasePrimitive2D* impCheckFieldPrimitive(drawinglayer::primitive2d::BasePrimitive2D* pPrimitive, const DrawPortionInfo& rInfo) const;
+ void impFlushTextPortionPrimitivesToLinePrimitives();
+ void impFlushLinePrimitivesToParagraphPrimitives();
+ void impHandleDrawPortionInfo(const DrawPortionInfo& rInfo);
+ void impHandleDrawBulletInfo(const DrawBulletInfo& rInfo);
+
+ public:
+ impTextBreakupHandler(Outliner& rOutliner)
+ : maTextPortionPrimitives(),
+ maLinePrimitives(),
+ maParagraphPrimitives(),
+ mrOutliner(rOutliner),
+ mpContourScale(0),
+ mpClipRange(0)
+ {
+ }
+
+ void decompose(const basegfx::B2DVector* pContourScale, const basegfx::B2DRange* pClipRange)
+ {
+ mpContourScale = pContourScale;
+ mpClipRange = pClipRange;
+
+ const Link aOldDrawPortionHdl(mrOutliner.GetDrawPortionHdl());
+ const Link aOldDrawBulletHdl(mrOutliner.GetDrawBulletHdl());
+
+ mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeTextPrimitive));
+ mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeBulletPrimitive));
+
+ mrOutliner.StripPortions();
+
+ mrOutliner.SetDrawPortionHdl(aOldDrawPortionHdl);
+ mrOutliner.SetDrawBulletHdl(aOldDrawBulletHdl);
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence();
+ };
+
+ bool impTextBreakupHandler::impIsUnderlineAbove(const Font& rFont) const
+ {
+ if(!rFont.IsVertical())
+ {
+ return false;
+ }
+
+ if((LANGUAGE_JAPANESE == rFont.GetLanguage()) || (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()))
+ {
+ // the underline is right for Japanese only
+ return true;
+ }
+
+ return false;
+ }
+
+ void impTextBreakupHandler::impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo)
+ {
+ if(rInfo.mrText.Len() && rInfo.mnTextLen)
+ {
+ basegfx::B2DVector aFontScaling;
+ basegfx::B2DHomMatrix aNewTransform;
+ drawinglayer::attribute::FontAttribute aFontAttribute(
+ drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ aFontScaling,
+ rInfo.mrFont,
+ rInfo.IsRTL(),
+ false));
+
+ // add font scale to new transform
+ aNewTransform.scale(aFontScaling);
+
+ // look for proportional font scaling, evtl scale accordingly
+ if(100 != rInfo.mrFont.GetPropr())
+ {
+ const double fFactor(rInfo.mrFont.GetPropr() / 100.0);
+ aNewTransform.scale(fFactor, fFactor);
+ }
+
+ // apply font rotate
+ if(rInfo.mrFont.GetOrientation())
+ {
+ aNewTransform.rotate(-rInfo.mrFont.GetOrientation() * F_PI1800);
+ }
+
+ // look for escapement, evtl translate accordingly
+ if(rInfo.mrFont.GetEscapement())
+ {
+ sal_Int16 nEsc(rInfo.mrFont.GetEscapement());
+
+ if(DFLT_ESC_AUTO_SUPER == nEsc)
+ {
+ nEsc = 33;
+ }
+ else if(DFLT_ESC_AUTO_SUB == nEsc)
+ {
+ nEsc = -20;
+ }
+
+ if(nEsc > 100)
+ {
+ nEsc = 100;
+ }
+ else if(nEsc < -100)
+ {
+ nEsc = -100;
+ }
+
+ const double fEscapement(nEsc / -100.0);
+ aNewTransform.translate(0.0, fEscapement * aFontScaling.getY());
+ }
+
+ // apply local offset
+ aNewTransform.translate(rInfo.mrStartPos.X(), rInfo.mrStartPos.Y());
+
+ // prepare DXArray content. To make it independent from font size (and such from
+ // the text transformation), scale it to unit coordinates
+ ::std::vector< double > aDXArray;
+ static bool bDisableTextArray(false);
+
+ if(!bDisableTextArray && rInfo.mpDXArray && rInfo.mnTextLen)
+ {
+ aDXArray.reserve(rInfo.mnTextLen);
+
+ for(xub_StrLen a(0); a < rInfo.mnTextLen; a++)
+ {
+ aDXArray.push_back((double)rInfo.mpDXArray[a]);
+ }
+ }
+
+ // create complex text primitive and append
+ const Color aFontColor(rInfo.mrFont.GetColor());
+ const basegfx::BColor aBFontColor(aFontColor.getBColor());
+
+ // prepare wordLineMode (for underline and strikeout)
+ // NOT for bullet texts. It is set (this may be an error by itself), but needs to be suppressed to hinder e.g. '1)'
+ // to be splitted which would not look like the original
+ const bool bWordLineMode(rInfo.mrFont.IsWordLineMode() && !rInfo.mbEndOfBullet);
+
+ // prepare new primitive
+ drawinglayer::primitive2d::BasePrimitive2D* pNewPrimitive = 0;
+ const bool bDecoratedIsNeeded(
+ UNDERLINE_NONE != rInfo.mrFont.GetOverline()
+ || UNDERLINE_NONE != rInfo.mrFont.GetUnderline()
+ || STRIKEOUT_NONE != rInfo.mrFont.GetStrikeout()
+ || EMPHASISMARK_NONE != (rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_STYLE)
+ || RELIEF_NONE != rInfo.mrFont.GetRelief()
+ || rInfo.mrFont.IsShadow()
+ || bWordLineMode);
+
+ if(bDecoratedIsNeeded)
+ {
+ // TextDecoratedPortionPrimitive2D needed, prepare some more data
+ // get overline and underline color. If it's on automatic (0xffffffff) use FontColor instead
+ const Color aUnderlineColor(rInfo.maTextLineColor);
+ const basegfx::BColor aBUnderlineColor((0xffffffff == aUnderlineColor.GetColor()) ? aBFontColor : aUnderlineColor.getBColor());
+ const Color aOverlineColor(rInfo.maOverlineColor);
+ const basegfx::BColor aBOverlineColor((0xffffffff == aOverlineColor.GetColor()) ? aBFontColor : aOverlineColor.getBColor());
+
+ // prepare overline and underline data
+ const drawinglayer::primitive2d::TextLine eFontOverline(
+ drawinglayer::primitive2d::mapFontUnderlineToTextLine(rInfo.mrFont.GetOverline()));
+ const drawinglayer::primitive2d::TextLine eFontUnderline(
+ drawinglayer::primitive2d::mapFontUnderlineToTextLine(rInfo.mrFont.GetUnderline()));
+
+ // check UndelineAbove
+ const bool bUnderlineAbove(
+ drawinglayer::primitive2d::TEXT_LINE_NONE != eFontUnderline && impIsUnderlineAbove(rInfo.mrFont));
+
+ // prepare strikeout data
+ const drawinglayer::primitive2d::TextStrikeout eTextStrikeout(
+ drawinglayer::primitive2d::mapFontStrikeoutToTextStrikeout(rInfo.mrFont.GetStrikeout()));
+
+ // prepare emphasis mark data
+ drawinglayer::primitive2d::TextEmphasisMark eTextEmphasisMark(drawinglayer::primitive2d::TEXT_EMPHASISMARK_NONE);
+
+ switch(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_STYLE)
+ {
+ case EMPHASISMARK_DOT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DOT; break;
+ case EMPHASISMARK_CIRCLE : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_CIRCLE; break;
+ case EMPHASISMARK_DISC : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DISC; break;
+ case EMPHASISMARK_ACCENT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_ACCENT; break;
+ }
+
+ const bool bEmphasisMarkAbove(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_POS_ABOVE);
+ const bool bEmphasisMarkBelow(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_POS_BELOW);
+
+ // prepare font relief data
+ drawinglayer::primitive2d::TextRelief eTextRelief(drawinglayer::primitive2d::TEXT_RELIEF_NONE);
+
+ switch(rInfo.mrFont.GetRelief())
+ {
+ case RELIEF_EMBOSSED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_EMBOSSED; break;
+ case RELIEF_ENGRAVED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_ENGRAVED; break;
+ default : break; // RELIEF_NONE, FontRelief_FORCE_EQUAL_SIZE
+ }
+
+ // prepare shadow/outline data
+ const bool bShadow(rInfo.mrFont.IsShadow());
+
+ // TextDecoratedPortionPrimitive2D is needed, create one
+ pNewPrimitive = new drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D(
+
+ // attributes for TextSimplePortionPrimitive2D
+ aNewTransform,
+ rInfo.mrText,
+ rInfo.mnTextStart,
+ rInfo.mnTextLen,
+ aDXArray,
+ aFontAttribute,
+ rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(),
+ aBFontColor,
+
+ // attributes for TextDecoratedPortionPrimitive2D
+ aBOverlineColor,
+ aBUnderlineColor,
+ eFontOverline,
+ eFontUnderline,
+ bUnderlineAbove,
+ eTextStrikeout,
+ bWordLineMode,
+ eTextEmphasisMark,
+ bEmphasisMarkAbove,
+ bEmphasisMarkBelow,
+ eTextRelief,
+ bShadow);
+ }
+ else
+ {
+ // TextSimplePortionPrimitive2D is enough
+ pNewPrimitive = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aNewTransform,
+ rInfo.mrText,
+ rInfo.mnTextStart,
+ rInfo.mnTextLen,
+ aDXArray,
+ aFontAttribute,
+ rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(),
+ aBFontColor);
+ }
+
+ if(rInfo.mbEndOfBullet)
+ {
+ // embed in TextHierarchyBulletPrimitive2D
+ const drawinglayer::primitive2d::Primitive2DReference aNewReference(pNewPrimitive);
+ const drawinglayer::primitive2d::Primitive2DSequence aNewSequence(&aNewReference, 1);
+ pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(aNewSequence);
+ }
+
+ if(rInfo.mpFieldData)
+ {
+ pNewPrimitive = impCheckFieldPrimitive(pNewPrimitive, rInfo);
+ }
+
+ maTextPortionPrimitives.push_back(pNewPrimitive);
+
+ // support for WrongSpellVector. Create WrongSpellPrimitives as needed
+ if(rInfo.mpWrongSpellVector && !aDXArray.empty())
+ {
+ const sal_uInt32 nSize(rInfo.mpWrongSpellVector->size());
+ const sal_uInt32 nDXCount(aDXArray.size());
+ const basegfx::BColor aSpellColor(1.0, 0.0, 0.0); // red, hard coded
+
+ for(sal_uInt32 a(0); a < nSize; a++)
+ {
+ const EEngineData::WrongSpellClass& rCandidate = (*rInfo.mpWrongSpellVector)[a];
+
+ if(rCandidate.nStart >= rInfo.mnTextStart && rCandidate.nEnd >= rInfo.mnTextStart && rCandidate.nEnd > rCandidate.nStart)
+ {
+ const sal_uInt32 nStart(rCandidate.nStart - rInfo.mnTextStart);
+ const sal_uInt32 nEnd(rCandidate.nEnd - rInfo.mnTextStart);
+ double fStart(0.0);
+ double fEnd(0.0);
+
+ if(nStart > 0 && nStart - 1 < nDXCount)
+ {
+ fStart = aDXArray[nStart - 1];
+ }
+
+ if(nEnd > 0 && nEnd - 1 < nDXCount)
+ {
+ fEnd = aDXArray[nEnd - 1];
+ }
+
+ if(!basegfx::fTools::equal(fStart, fEnd))
+ {
+ if(rInfo.IsRTL())
+ {
+ // #i98523#
+ // When the portion is RTL, mirror the redlining using the
+ // full portion width
+ const double fTextWidth(aDXArray[aDXArray.size() - 1]);
+
+ fStart = fTextWidth - fStart;
+ fEnd = fTextWidth - fEnd;
+ }
+
+ // need to take FontScaling out of values; it's already part of
+ // aNewTransform and would be double applied
+ const double fFontScaleX(aFontScaling.getX());
+
+ if(!basegfx::fTools::equal(fFontScaleX, 1.0)
+ && !basegfx::fTools::equalZero(fFontScaleX))
+ {
+ fStart /= fFontScaleX;
+ fEnd /= fFontScaleX;
+ }
+
+ maTextPortionPrimitives.push_back(new drawinglayer::primitive2d::WrongSpellPrimitive2D(
+ aNewTransform,
+ fStart,
+ fEnd,
+ aSpellColor));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ drawinglayer::primitive2d::BasePrimitive2D* impTextBreakupHandler::impCheckFieldPrimitive(drawinglayer::primitive2d::BasePrimitive2D* pPrimitive, const DrawPortionInfo& rInfo) const
+ {
+ if(rInfo.mpFieldData)
+ {
+ // Support for FIELD_SEQ_BEGIN, FIELD_SEQ_END. If used, create a TextHierarchyFieldPrimitive2D
+ // which holds the field type and evtl. the URL
+ const SvxURLField* pURLField = dynamic_cast< const SvxURLField* >(rInfo.mpFieldData);
+ const SvxPageField* pPageField = dynamic_cast< const SvxPageField* >(rInfo.mpFieldData);
+
+ // embed current primitive to a sequence
+ drawinglayer::primitive2d::Primitive2DSequence aSequence;
+
+ if(pPrimitive)
+ {
+ aSequence.realloc(1);
+ aSequence[0] = drawinglayer::primitive2d::Primitive2DReference(pPrimitive);
+ }
+
+ if(pURLField)
+ {
+ pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(
+ aSequence,
+ drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_URL,
+ pURLField->GetURL(),
+ pURLField->GetTargetFrame());
+ }
+ else if(pPageField)
+ {
+ pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(
+ aSequence,
+ drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_PAGE);
+ }
+ else
+ {
+ pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(
+ aSequence,
+ drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_COMMON);
+ }
+ }
+
+ return pPrimitive;
+ }
+
+ void impTextBreakupHandler::impFlushTextPortionPrimitivesToLinePrimitives()
+ {
+ // only create a line primitive when we had content; there is no need for
+ // empty line primitives (contrary to paragraphs, see below).
+ if(maTextPortionPrimitives.size())
+ {
+ drawinglayer::primitive2d::Primitive2DSequence aLineSequence(impConvertVectorToPrimitive2DSequence(maTextPortionPrimitives));
+ maTextPortionPrimitives.clear();
+ maLinePrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyLinePrimitive2D(aLineSequence));
+ }
+ }
+
+ void impTextBreakupHandler::impFlushLinePrimitivesToParagraphPrimitives()
+ {
+ // ALWAYS create a paragraph primitive, even when no content was added. This is done to
+ // have the correct paragraph count even with empty paragraphs. Those paragraphs will
+ // have an empty sub-PrimitiveSequence.
+ drawinglayer::primitive2d::Primitive2DSequence aParagraphSequence(impConvertVectorToPrimitive2DSequence(maLinePrimitives));
+ maLinePrimitives.clear();
+ maParagraphPrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D(aParagraphSequence));
+ }
+
+ void impTextBreakupHandler::impHandleDrawPortionInfo(const DrawPortionInfo& rInfo)
+ {
+ impCreateTextPortionPrimitive(rInfo);
+
+ if(rInfo.mbEndOfLine || rInfo.mbEndOfParagraph)
+ {
+ impFlushTextPortionPrimitivesToLinePrimitives();
+ }
+
+ if(rInfo.mbEndOfParagraph)
+ {
+ impFlushLinePrimitivesToParagraphPrimitives();
+ }
+ }
+
+ void impTextBreakupHandler::impHandleDrawBulletInfo(const DrawBulletInfo& rInfo)
+ {
+ basegfx::B2DHomMatrix aNewTransform;
+
+ // add size to new transform
+ aNewTransform.scale(rInfo.maBulletSize.getWidth(), rInfo.maBulletSize.getHeight());
+
+ // apply local offset
+ aNewTransform.translate(rInfo.maBulletPosition.X(), rInfo.maBulletPosition.Y());
+
+ // prepare empty GraphicAttr
+ const GraphicAttr aGraphicAttr;
+
+ // create GraphicPrimitive2D
+ const drawinglayer::primitive2d::Primitive2DReference aNewReference(new drawinglayer::primitive2d::GraphicPrimitive2D(
+ aNewTransform,
+ rInfo.maBulletGraphicObject,
+ aGraphicAttr));
+
+ // embed in TextHierarchyBulletPrimitive2D
+ const drawinglayer::primitive2d::Primitive2DSequence aNewSequence(&aNewReference, 1);
+ drawinglayer::primitive2d::BasePrimitive2D* pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(aNewSequence);
+
+ // add to output
+ maTextPortionPrimitives.push_back(pNewPrimitive);
+ }
+
+ IMPL_LINK(impTextBreakupHandler, decomposeTextPrimitive, DrawPortionInfo*, pInfo)
+ {
+ if(pInfo)
+ {
+ // for contour text, ignore (clip away) all portions which are below
+ // the visible area given by mpContourScale
+ if(mpContourScale)
+ {
+ if((double)pInfo->mrStartPos.Y() >= mpContourScale->getY())
+ {
+ return 0;
+ }
+ }
+ // #SJ# Is clipping wanted? This is text clipping; only accept a portion
+ // if it's completely in the range
+ if(mpClipRange && !mpClipRange->isEmpty())
+ {
+ // Test start position first; this allows to not get the text range at
+ // all if text is far outside
+ const basegfx::B2DPoint aStartPosition(pInfo->mrStartPos.X(), pInfo->mrStartPos.Y());
+
+ if(!mpClipRange->isInside(aStartPosition))
+ {
+ return 0;
+ }
+
+ // Start position is inside. Get TextBoundRect and TopLeft next
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ aTextLayouterDevice.setFont(pInfo->mrFont);
+
+ const basegfx::B2DRange aTextBoundRect(
+ aTextLayouterDevice.getTextBoundRect(
+ pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextLen));
+ const basegfx::B2DPoint aTopLeft(aTextBoundRect.getMinimum() + aStartPosition);
+
+ if(!mpClipRange->isInside(aTopLeft))
+ {
+ return 0;
+ }
+
+ // TopLeft is inside. Get BottomRight and check
+ const basegfx::B2DPoint aBottomRight(aTextBoundRect.getMaximum() + aStartPosition);
+
+ if(!mpClipRange->isInside(aBottomRight))
+ {
+ return 0;
+ }
+
+ // all inside, clip was successful
+ }
+
+ // action
+ impHandleDrawPortionInfo(*pInfo);
+ }
+
+ return 0;
+ }
+
+ IMPL_LINK(impTextBreakupHandler, decomposeBulletPrimitive, DrawBulletInfo*, pInfo)
+ {
+ if(pInfo)
+ {
+ impHandleDrawBulletInfo(*pInfo);
+ }
+
+ return 0;
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence impTextBreakupHandler::getPrimitive2DSequence()
+ {
+ if(maTextPortionPrimitives.size())
+ {
+ // collect non-closed lines
+ impFlushTextPortionPrimitivesToLinePrimitives();
+ }
+
+ if(maLinePrimitives.size())
+ {
+ // collect non-closed paragraphs
+ impFlushLinePrimitivesToParagraphPrimitives();
+ }
+
+ return impConvertVectorToPrimitive2DSequence(maParagraphPrimitives);
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+void Outliner::getPrimitive2DSequence(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const basegfx::B2DVector* pContourScale,
+ const basegfx::B2DRange* pClipRange)
+{
+ // incarnate helper
+ impTextBreakupHandler aConverter(*this);
+
+ // use it
+ aConverter.decompose(pContourScale, pClipRange);
+
+ // append results
+ rTarget = aConverter.getPrimitive2DSequence();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 3eec145746d5..044294867d1b 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -304,7 +304,7 @@ sal_uLong OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTa
{
// Check for hyperlink
const SvxFieldItem* pFieldItem = pEditView->GetField( aMousePosWin );
- if ( pFieldItem && pFieldItem->GetField() && pFieldItem->GetField()->ISA( SvxURLField ) )
+ if ( pFieldItem && pFieldItem->GetField() && dynamic_cast< const SvxURLField* >(pFieldItem->GetField()) )
reTarget = MouseHypertext;
}
}
diff --git a/editeng/source/outliner/pathtextportion.cxx b/editeng/source/outliner/pathtextportion.cxx
new file mode 100644
index 000000000000..25bdf5950301
--- /dev/null
+++ b/editeng/source/outliner/pathtextportion.cxx
@@ -0,0 +1,99 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_editeng.hxx"
+
+#include <editeng/pathtextportion.hxx>
+#include <editeng/outliner.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+PathTextPortion::PathTextPortion(DrawPortionInfo& rInfo)
+: maOffset(rInfo.mrStartPos.X(), rInfo.mrStartPos.Y()),
+ maText(rInfo.mrText),
+ mnTextStart(rInfo.mnTextStart),
+ mnTextLength(rInfo.mnTextLen),
+ mnParagraph(rInfo.mnPara),
+ mnIndex(rInfo.mnIndex),
+ maFont(rInfo.mrFont),
+ maDblDXArray(),
+ maLocale(rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale()),
+ mbRTL(rInfo.mrFont.IsVertical() ? false : rInfo.IsRTL())
+{
+ if(mnTextLength && rInfo.mpDXArray)
+ {
+ maDblDXArray.reserve(mnTextLength);
+
+ for(xub_StrLen a(0); a < mnTextLength; a++)
+ {
+ maDblDXArray.push_back((double)rInfo.mpDXArray[a]);
+ }
+ }
+}
+
+bool PathTextPortion::operator<(const PathTextPortion& rComp) const
+{
+ if(mnParagraph < rComp.mnParagraph)
+ {
+ return true;
+ }
+
+ if(maOffset.getX() < rComp.maOffset.getX())
+ {
+ return true;
+ }
+
+ return (maOffset.getY() < rComp.maOffset.getY());
+}
+
+xub_StrLen PathTextPortion::getPortionIndex(xub_StrLen nIndex, xub_StrLen nLength) const
+{
+ if(mbRTL)
+ {
+ return (mnTextStart + (mnTextLength - (nIndex + nLength)));
+ }
+ else
+ {
+ return (mnTextStart + nIndex);
+ }
+}
+
+double PathTextPortion::getDisplayLength(xub_StrLen nIndex, xub_StrLen nLength) const
+{
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ double fRetval(0.0);
+
+ if(maFont.IsVertical())
+ {
+ fRetval = aTextLayouter.getTextHeight() * (double)nLength;
+ }
+ else
+ {
+ fRetval = aTextLayouter.getTextWidth(maText, getPortionIndex(nIndex, nLength), nLength);
+ }
+
+ return fRetval;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/editeng/source/outliner/pathtextportioncreator.cxx b/editeng/source/outliner/pathtextportioncreator.cxx
new file mode 100644
index 000000000000..d7c8ce747eff
--- /dev/null
+++ b/editeng/source/outliner/pathtextportioncreator.cxx
@@ -0,0 +1,82 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_editeng.hxx"
+
+#include <editeng/outliner.hxx>
+#include <editeng/pathtextportion.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// TextBreakup helper
+
+namespace
+{
+ class impTextBreakupHandler
+ {
+ Outliner& mrOutliner;
+ ::std::vector< PathTextPortion > maPathTextPortions;
+
+ DECL_LINK(decompositionPathTextPrimitive, DrawPortionInfo* );
+
+ public:
+ impTextBreakupHandler(Outliner& rOutliner)
+ : mrOutliner(rOutliner)
+ {
+ }
+
+ const ::std::vector< PathTextPortion >& decompositionPathTextPrimitive()
+ {
+ // strip portions to maPathTextPortions
+ mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decompositionPathTextPrimitive));
+ mrOutliner.StripPortions();
+
+ if(maPathTextPortions.size())
+ {
+ // sort portions by paragraph, x and y
+ ::std::sort(maPathTextPortions.begin(), maPathTextPortions.end());
+ }
+
+ return maPathTextPortions;
+ }
+ };
+
+ IMPL_LINK(impTextBreakupHandler, decompositionPathTextPrimitive, DrawPortionInfo*, pInfo)
+ {
+ maPathTextPortions.push_back(PathTextPortion(*pInfo));
+ return 0;
+ }
+} // end of anonymous namespace
+
+//////////////////////////////////////////////////////////////////////////////
+
+void Outliner::getPathTextPortions(::std::vector< PathTextPortion >& rTarget)
+{
+ // break up to text portions
+ impTextBreakupHandler aConverter(*this);
+
+ rTarget = aConverter.decompositionPathTextPrimitive();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx
index 82b2969a2c7d..d1e47eec0999 100644
--- a/editeng/source/uno/unoedhlp.cxx
+++ b/editeng/source/uno/unoedhlp.cxx
@@ -31,8 +31,6 @@
//------------------------------------------------------------------------
-TYPEINIT1( SvxEditSourceHint, TextHint );
-
SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId ) :
TextHint( _nId ),
mnStart( 0 ),
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 1016dcfa22f3..fedc10b142ba 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -721,35 +721,35 @@ void SAL_CALL SvxUnoTextField::setPropertyValue( const OUString& aPropertyName,
{
case ID_DATEFIELD:
{
- SvxDateField* pDate = PTR_CAST( SvxDateField, aFieldItem.GetField() );
+ SvxDateField* pDate = dynamic_cast< SvxDateField* >( aFieldItem.GetField() );
if(pDate)
pDate->SetFormat( (SvxDateFormat)nFormat );
break;
}
case ID_URLFIELD:
{
- SvxURLField* pURL = PTR_CAST( SvxURLField, aFieldItem.GetField() );
+ SvxURLField* pURL = dynamic_cast< SvxURLField* >( aFieldItem.GetField() );
if(pURL)
pURL->SetFormat( (SvxURLFormat)nFormat );
break;
}
case ID_EXT_TIMEFIELD:
{
- SvxExtTimeField* pTime = PTR_CAST( SvxExtTimeField, aFieldItem.GetField() );
+ SvxExtTimeField* pTime = dynamic_cast< SvxExtTimeField* >( aFieldItem.GetField() );
if(pTime)
pTime->SetFormat( (SvxTimeFormat)nFormat );
break;
}
case ID_EXT_FILEFIELD:
{
- SvxExtFileField* pFile = PTR_CAST( SvxExtFileField, aFieldItem.GetField() );
+ SvxExtFileField* pFile = dynamic_cast< SvxExtFileField* >( aFieldItem.GetField() );
if(pFile)
pFile->SetFormat( (SvxFileFormat)nFormat );
break;
}
case ID_AUTHORFIELD:
{
- SvxAuthorField* pAuthor = PTR_CAST( SvxAuthorField, aFieldItem.GetField() );
+ SvxAuthorField* pAuthor = dynamic_cast< SvxAuthorField* >( aFieldItem.GetField() );
if(pAuthor)
pAuthor->SetFormat( (SvxAuthorFormat)nFormat );
break;
@@ -768,28 +768,28 @@ void SAL_CALL SvxUnoTextField::setPropertyValue( const OUString& aPropertyName,
{
case ID_EXT_TIMEFIELD:
{
- SvxExtTimeField* pTime = PTR_CAST( SvxExtTimeField, aFieldItem.GetField() );
+ SvxExtTimeField* pTime = dynamic_cast< SvxExtTimeField* >( aFieldItem.GetField() );
if(pTime)
pTime->SetType( (SvxTimeType)bFix?SVXTIMETYPE_FIX:SVXTIMETYPE_VAR );
break;
}
case ID_DATEFIELD:
{
- SvxDateField* pDate = PTR_CAST( SvxDateField, aFieldItem.GetField() );
+ SvxDateField* pDate = dynamic_cast< SvxDateField* >( aFieldItem.GetField() );
if(pDate)
pDate->SetType( (SvxDateType)bFix?SVXDATETYPE_FIX:SVXDATETYPE_VAR );
break;
}
case ID_EXT_FILEFIELD:
{
- SvxExtFileField* pFile = PTR_CAST( SvxExtFileField, aFieldItem.GetField() );
+ SvxExtFileField* pFile = dynamic_cast< SvxExtFileField* >( aFieldItem.GetField() );
if(pFile)
pFile->SetType( (SvxFileType)bFix?SVXFILETYPE_FIX:SVXFILETYPE_VAR );
break;
}
case ID_AUTHORFIELD:
{
- SvxAuthorField* pAuthor = PTR_CAST( SvxAuthorField, aFieldItem.GetField() );
+ SvxAuthorField* pAuthor = dynamic_cast< SvxAuthorField* >( aFieldItem.GetField() );
if(pAuthor)
pAuthor->SetType( (SvxAuthorType)bFix?SVXAUTHORTYPE_FIX:SVXAUTHORTYPE_VAR );
break;
@@ -803,7 +803,7 @@ void SAL_CALL SvxUnoTextField::setPropertyValue( const OUString& aPropertyName,
case WID_URL:
case WID_TARGET:
{
- SvxURLField* pURL = PTR_CAST( SvxURLField, aFieldItem.GetField() );
+ SvxURLField* pURL = dynamic_cast< SvxURLField* >( aFieldItem.GetField() );
if(pURL)
{
OUString aUnoStr;
@@ -881,35 +881,35 @@ uno::Any SAL_CALL SvxUnoTextField::getPropertyValue( const OUString& PropertyNam
{
case ID_DATEFIELD:
{
- SvxDateField* pDate = PTR_CAST( SvxDateField, pFieldItem->GetField() );
+ SvxDateField* pDate = dynamic_cast< SvxDateField* >( pFieldItem->GetField() );
if(pDate)
aValue <<= (sal_Int32)pDate->GetFormat();
break;
}
case ID_URLFIELD:
{
- SvxURLField* pURL = PTR_CAST( SvxURLField, pFieldItem->GetField() );
+ SvxURLField* pURL = dynamic_cast< SvxURLField* >( pFieldItem->GetField() );
if(pURL)
aValue <<= (sal_Int32)pURL->GetFormat();
break;
}
case ID_EXT_TIMEFIELD:
{
- SvxExtTimeField* pTime = PTR_CAST( SvxExtTimeField, pFieldItem->GetField() );
+ SvxExtTimeField* pTime = dynamic_cast< SvxExtTimeField* >( pFieldItem->GetField() );
if(pTime)
aValue <<= (sal_Int32)pTime->GetFormat();
break;
}
case ID_EXT_FILEFIELD:
{
- SvxExtFileField* pFile = PTR_CAST( SvxExtFileField, pFieldItem->GetField() );
+ SvxExtFileField* pFile = dynamic_cast< SvxExtFileField* >( pFieldItem->GetField() );
if(pFile)
aValue <<= (sal_Int32)pFile->GetFormat();
break;
}
case ID_AUTHORFIELD:
{
- SvxAuthorField* pAuthor = PTR_CAST( SvxAuthorField, pFieldItem->GetField() );
+ SvxAuthorField* pAuthor = dynamic_cast< SvxAuthorField* >( pFieldItem->GetField() );
if(pAuthor)
aValue <<= (sal_Int32)pAuthor->GetFormat();
break;
@@ -925,28 +925,28 @@ uno::Any SAL_CALL SvxUnoTextField::getPropertyValue( const OUString& PropertyNam
{
case ID_EXT_TIMEFIELD:
{
- SvxExtTimeField* pTime = PTR_CAST( SvxExtTimeField, pFieldItem->GetField() );
+ SvxExtTimeField* pTime = dynamic_cast< SvxExtTimeField* >( pFieldItem->GetField() );
if(pTime)
bFix = pTime->GetType() == SVXTIMETYPE_FIX;
break;
}
case ID_DATEFIELD:
{
- SvxDateField* pDate = PTR_CAST( SvxDateField, pFieldItem->GetField() );
+ SvxDateField* pDate = dynamic_cast< SvxDateField* >( pFieldItem->GetField() );
if(pDate)
bFix = pDate->GetType() == SVXDATETYPE_FIX;
break;
}
case ID_EXT_FILEFIELD:
{
- SvxExtFileField* pFile = PTR_CAST( SvxExtFileField, pFieldItem->GetField() );
+ SvxExtFileField* pFile = dynamic_cast< SvxExtFileField* >( pFieldItem->GetField() );
if(pFile)
bFix = pFile->GetType() == SVXFILETYPE_FIX;
break;
}
case ID_AUTHORFIELD:
{
- SvxAuthorField* pAuthor = PTR_CAST( SvxAuthorField, pFieldItem->GetField() );
+ SvxAuthorField* pAuthor = dynamic_cast< SvxAuthorField* >( pFieldItem->GetField() );
if(pAuthor)
bFix = pAuthor->GetType() == SVXAUTHORTYPE_FIX;
break;
@@ -961,7 +961,7 @@ uno::Any SAL_CALL SvxUnoTextField::getPropertyValue( const OUString& PropertyNam
case WID_URL:
case WID_TARGET:
{
- SvxURLField* pURL = PTR_CAST( SvxURLField, pFieldItem->GetField() );
+ SvxURLField* pURL = dynamic_cast< SvxURLField* >( pFieldItem->GetField() );
if(pURL)
{
OUString aStr;
@@ -1017,33 +1017,33 @@ void SvxUnoTextField::disposing()
sal_Int32 SvxUnoTextField::GetFieldId( const SvxFieldData* pFieldData ) const throw()
{
- if( pFieldData->ISA( SvxURLField ) )
+ if( dynamic_cast< const SvxURLField* >(pFieldData))
return ID_URLFIELD;
- else if( pFieldData->ISA( SvxPageField ) )
+ else if( dynamic_cast< const SvxPageField* >( pFieldData ) )
return ID_PAGEFIELD;
- else if( pFieldData->ISA( SvxPagesField ) )
+ else if( dynamic_cast< const SvxPagesField* >( pFieldData ) )
return ID_PAGESFIELD;
- else if( pFieldData->ISA( SvxTimeField ) )
+ else if( dynamic_cast< const SvxTimeField* >( pFieldData ) )
return ID_TIMEFIELD;
- else if( pFieldData->ISA( SvxFileField ) )
+ else if( dynamic_cast< const SvxFileField* >( pFieldData ) )
return ID_FILEFIELD;
- else if( pFieldData->ISA( SvxTableField ) )
+ else if( dynamic_cast< const SvxTableField* >( pFieldData ) )
return ID_TABLEFIELD;
- else if( pFieldData->ISA( SvxExtTimeField ) )
+ else if( dynamic_cast< const SvxExtTimeField* >( pFieldData ) )
return ID_EXT_TIMEFIELD;
- else if( pFieldData->ISA( SvxExtFileField ) )
+ else if( dynamic_cast< const SvxExtFileField* >( pFieldData ) )
return ID_EXT_FILEFIELD;
- else if( pFieldData->ISA( SvxAuthorField ) )
+ else if( dynamic_cast< const SvxAuthorField* >( pFieldData ) )
return ID_AUTHORFIELD;
- else if( pFieldData->ISA( SvxDateField ) )
+ else if( dynamic_cast< const SvxDateField* >( pFieldData ) )
return ID_EXT_DATEFIELD;
- else if( pFieldData->ISA( SdrMeasureField ) )
+ else if( dynamic_cast< const SdrMeasureField* >( pFieldData ) )
return ID_MEASUREFIELD;
- else if( pFieldData->ISA( SvxHeaderField ) )
+ else if( dynamic_cast< const SvxHeaderField* >( pFieldData ) )
return ID_HEADERFIELD;
- else if( pFieldData->ISA( SvxFooterField ) )
+ else if( dynamic_cast< const SvxFooterField* >( pFieldData ) )
return ID_FOOTERFIELD;
- else if( pFieldData->ISA( SvxDateTimeField ) )
+ else if( dynamic_cast< const SvxDateTimeField* >( pFieldData ) )
return ID_DATETIMEFIELD;
return ID_UNKNOWN;
diff --git a/extensions/source/preload/oemwiz.cxx b/extensions/source/preload/oemwiz.cxx
index 9124c83cc93c..55dd5b0b1fdd 100644
--- a/extensions/source/preload/oemwiz.cxx
+++ b/extensions/source/preload/oemwiz.cxx
@@ -434,10 +434,12 @@ namespace preload
//------------------------------------------------------------------------
void LicenceView::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if ( rHint.IsA( TYPE(TextHint) ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
sal_Bool bLastVal = EndReached();
- sal_uLong nId = ((const TextHint&)rHint).GetId();
+ sal_uLong nId = pTextHint->GetId();
if ( nId == TEXT_HINT_PARAINSERTED )
{
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 186ade97aebe..da945ecc77d1 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -687,7 +687,7 @@ namespace pcr
const SfxPoolItem* pItem = pDocSh ? pDocSh->GetItem( SID_COLOR_TABLE ) : NULL;
if ( pItem )
{
- DBG_ASSERT(pItem->ISA(SvxColorTableItem), "OColorControl::OColorControl: invalid color item!");
+ DBG_ASSERT(dynamic_cast< const SvxColorTableItem* >(pItem), "OColorControl::OColorControl: invalid color item!");
pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
}
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx
index 89f2f9c360ec..000e85bc62d5 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -31,9 +31,8 @@
#include <cmath>
#undef _USE_MATH_DEFINES
+#include <memory.h>
#include <grid.hxx>
-
-// for ::std::sort
#include <algorithm>
ResId SaneResId( sal_uInt32 );
diff --git a/filter/inc/filter/msfilter/dffrecordheader.hxx b/filter/inc/filter/msfilter/dffrecordheader.hxx
index 7d099efe34ee..23c4e9688e74 100644
--- a/filter/inc/filter/msfilter/dffrecordheader.hxx
+++ b/filter/inc/filter/msfilter/dffrecordheader.hxx
@@ -41,7 +41,7 @@ public:
sal_uLong nFilePos;
public:
DffRecordHeader() : nRecVer(0), nRecInstance(0), nImpVerInst(0), nRecType(0), nRecLen(0), nFilePos(0) {}
- FASTBOOL IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
+ bool IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
sal_uLong GetRecBegFilePos() const { return nFilePos; }
sal_uLong GetRecEndFilePos() const { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
void SeekToEndOfRecord(SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen ); }
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index 04aa974befb7..61778e35514c 100644
--- a/filter/inc/filter/msfilter/escherex.hxx
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -652,15 +652,15 @@ enum ESCHER_LineCap
// Transform
#define ESCHER_Prop_Rotation 4 /* Fixed Point 16.16 degrees */
// Protection
-#define ESCHER_Prop_LockRotation 119 /* sal_Bool No rotation */
-#define ESCHER_Prop_LockAspectRatio 120 /* sal_Bool Don't allow changes in aspect ratio */
-#define ESCHER_Prop_LockPosition 121 /* sal_Bool Don't allow the shape to be moved */
-#define ESCHER_Prop_LockAgainstSelect 122 /* sal_Bool Shape may not be selected */
-#define ESCHER_Prop_LockCropping 123 /* sal_Bool No cropping this shape */
-#define ESCHER_Prop_LockVertices 124 /* sal_Bool Edit Points not allowed */
-#define ESCHER_Prop_LockText 125 /* sal_Bool Do not edit text */
-#define ESCHER_Prop_LockAdjustHandles 126 /* sal_Bool Do not adjust */
-#define ESCHER_Prop_LockAgainstGrouping 127 /* sal_Bool Do not group this shape */
+#define ESCHER_Prop_LockRotation 119 /* bool No rotation */
+#define ESCHER_Prop_LockAspectRatio 120 /* bool Don't allow changes in aspect ratio */
+#define ESCHER_Prop_LockPosition 121 /* bool Don't allow the shape to be moved */
+#define ESCHER_Prop_LockAgainstSelect 122 /* bool Shape may not be selected */
+#define ESCHER_Prop_LockCropping 123 /* bool No cropping this shape */
+#define ESCHER_Prop_LockVertices 124 /* bool Edit Points not allowed */
+#define ESCHER_Prop_LockText 125 /* bool Do not edit text */
+#define ESCHER_Prop_LockAdjustHandles 126 /* bool Do not adjust */
+#define ESCHER_Prop_LockAgainstGrouping 127 /* bool Do not group this shape */
// Text
#define ESCHER_Prop_lTxid 128 /* LONG id for the text, value determined by the host */
#define ESCHER_Prop_dxTextLeft 129 /* LONG margins relative to shape's inscribed */
@@ -674,11 +674,11 @@ enum ESCHER_LineCap
#define ESCHER_Prop_cdirFont 137 /* MSOCDIR Font rotation */
#define ESCHER_Prop_hspNext 138 /* MSOHSP ID of the next shape (used by Word for linked textboxes) */
#define ESCHER_Prop_txdir 139 /* MSOTXDIR Bi-Di Text direction */
-#define ESCHER_Prop_SelectText 187 /* sal_Bool sal_True if single click selects text, sal_False if two clicks */
-#define ESCHER_Prop_AutoTextMargin 188 /* sal_Bool use host's margin calculations */
-#define ESCHER_Prop_RotateText 189 /* sal_Bool Rotate text with shape */
-#define ESCHER_Prop_FitShapeToText 190 /* sal_Bool Size shape to fit text size */
-#define ESCHER_Prop_FitTextToShape 191 /* sal_Bool Size text to fit shape size */
+#define ESCHER_Prop_SelectText 187 /* bool true if single click selects text, false if two clicks */
+#define ESCHER_Prop_AutoTextMargin 188 /* bool use host's margin calculations */
+#define ESCHER_Prop_RotateText 189 /* bool Rotate text with shape */
+#define ESCHER_Prop_FitShapeToText 190 /* bool Size shape to fit text size */
+#define ESCHER_Prop_FitTextToShape 191 /* bool Size text to fit shape size */
// GeoText
#define ESCHER_Prop_gtextUNICODE 192 /* WCHAR* UNICODE text string */
#define ESCHER_Prop_gtextRTF 193 /* char* RTF text string */
@@ -686,22 +686,22 @@ enum ESCHER_LineCap
#define ESCHER_Prop_gtextSize 195 /* LONG default point size */
#define ESCHER_Prop_gtextSpacing 196 /* LONG fixed point 16.16 */
#define ESCHER_Prop_gtextFont 197 /* WCHAR* font family name */
-#define ESCHER_Prop_gtextFReverseRows 240 /* sal_Bool Reverse row order */
-#define ESCHER_Prop_fGtext 241 /* sal_Bool Has text effect */
-#define ESCHER_Prop_gtextFVertical 242 /* sal_Bool Rotate characters */
-#define ESCHER_Prop_gtextFKern 243 /* sal_Bool Kern characters */
-#define ESCHER_Prop_gtextFTight 244 /* sal_Bool Tightening or tracking */
-#define ESCHER_Prop_gtextFStretch 245 /* sal_Bool Stretch to fit shape */
-#define ESCHER_Prop_gtextFShrinkFit 246 /* sal_Bool Char bounding box */
-#define ESCHER_Prop_gtextFBestFit 247 /* sal_Bool Scale text-on-path */
-#define ESCHER_Prop_gtextFNormalize 248 /* sal_Bool Stretch char height */
-#define ESCHER_Prop_gtextFDxMeasure 249 /* sal_Bool Do not measure along path */
-#define ESCHER_Prop_gtextFBold 250 /* sal_Bool Bold font */
-#define ESCHER_Prop_gtextFItalic 251 /* sal_Bool Italic font */
-#define ESCHER_Prop_gtextFUnderline 252 /* sal_Bool Underline font */
-#define ESCHER_Prop_gtextFShadow 253 /* sal_Bool Shadow font */
-#define ESCHER_Prop_gtextFSmallcaps 254 /* sal_Bool Small caps font */
-#define ESCHER_Prop_gtextFStrikethrough 255 /* sal_Bool Strike through font */
+#define ESCHER_Prop_gtextFReverseRows 240 /* bool Reverse row order */
+#define ESCHER_Prop_fGtext 241 /* bool Has text effect */
+#define ESCHER_Prop_gtextFVertical 242 /* bool Rotate characters */
+#define ESCHER_Prop_gtextFKern 243 /* bool Kern characters */
+#define ESCHER_Prop_gtextFTight 244 /* bool Tightening or tracking */
+#define ESCHER_Prop_gtextFStretch 245 /* bool Stretch to fit shape */
+#define ESCHER_Prop_gtextFShrinkFit 246 /* bool Char bounding box */
+#define ESCHER_Prop_gtextFBestFit 247 /* bool Scale text-on-path */
+#define ESCHER_Prop_gtextFNormalize 248 /* bool Stretch char height */
+#define ESCHER_Prop_gtextFDxMeasure 249 /* bool Do not measure along path */
+#define ESCHER_Prop_gtextFBold 250 /* bool Bold font */
+#define ESCHER_Prop_gtextFItalic 251 /* bool Italic font */
+#define ESCHER_Prop_gtextFUnderline 252 /* bool Underline font */
+#define ESCHER_Prop_gtextFShadow 253 /* bool Shadow font */
+#define ESCHER_Prop_gtextFSmallcaps 254 /* bool Small caps font */
+#define ESCHER_Prop_gtextFStrikethrough 255 /* bool Strike through font */
// Blip
#define ESCHER_Prop_cropFromTop 256 /* LONG 16.16 fraction times total */
#define ESCHER_Prop_cropFromBottom 257 /* LONG image width or height, */
@@ -721,10 +721,10 @@ enum ESCHER_LineCap
#define ESCHER_Prop_pibPrint 271 /* IMsoBlip* Blip to display when printing */
#define ESCHER_Prop_pibPrintName 272 /* WCHAR* Blip file name */
#define ESCHER_Prop_pibPrintFlags 273 /* MSOBLIPFLAGS Blip flags */
-#define ESCHER_Prop_fNoHitTestPicture 316 /* sal_Bool Do not hit test the picture */
-#define ESCHER_Prop_pictureGray 317 /* sal_Bool grayscale display */
-#define ESCHER_Prop_pictureBiLevel 318 /* sal_Bool bi-level display */
-#define ESCHER_Prop_pictureActive 319 /* sal_Bool Server is active (OLE objects only) */
+#define ESCHER_Prop_fNoHitTestPicture 316 /* bool Do not hit test the picture */
+#define ESCHER_Prop_pictureGray 317 /* bool grayscale display */
+#define ESCHER_Prop_pictureBiLevel 318 /* bool bi-level display */
+#define ESCHER_Prop_pictureActive 319 /* bool Server is active (OLE objects only) */
// Geometry
#define ESCHER_Prop_geoLeft 320 /* LONG Defines the G (geometry) coordinate space. */
#define ESCHER_Prop_geoTop 321 /* LONG */
@@ -743,12 +743,12 @@ enum ESCHER_LineCap
#define ESCHER_Prop_adjust8Value 334 /* LONG */
#define ESCHER_Prop_adjust9Value 335 /* LONG */
#define ESCHER_Prop_adjust10Value 336 /* LONG */
-#define ESCHER_Prop_fShadowOK 378 /* sal_Bool Shadow may be set */
-#define ESCHER_Prop_f3DOK 379 /* sal_Bool 3D may be set */
-#define ESCHER_Prop_fLineOK 380 /* sal_Bool Line style may be set */
-#define ESCHER_Prop_fGtextOK 381 /* sal_Bool Text effect (FontWork) supported */
-#define ESCHER_Prop_fFillShadeShapeOK 382 /* sal_Bool */
-#define ESCHER_Prop_fFillOK 383 /* sal_Bool OK to fill the shape through the UI or VBA? */
+#define ESCHER_Prop_fShadowOK 378 /* bool Shadow may be set */
+#define ESCHER_Prop_f3DOK 379 /* bool 3D may be set */
+#define ESCHER_Prop_fLineOK 380 /* bool Line style may be set */
+#define ESCHER_Prop_fGtextOK 381 /* bool Text effect (FontWork) supported */
+#define ESCHER_Prop_fFillShadeShapeOK 382 /* bool */
+#define ESCHER_Prop_fFillOK 383 /* bool OK to fill the shape through the UI or VBA? */
// FillStyle
#define ESCHER_Prop_fillType 384 /* ESCHER_FillStyle Type of fill */
#define ESCHER_Prop_fillColor 385 /* MSOCLR Foreground color */
@@ -779,11 +779,11 @@ enum ESCHER_LineCap
#define ESCHER_Prop_fillShapeOriginX 410 /* LONG */
#define ESCHER_Prop_fillShapeOriginY 411 /* LONG */
#define ESCHER_Prop_fillShadeType 412 /* MSOSHADETYPE Type of shading, if a shaded (gradient) fill. */
-#define ESCHER_Prop_fFilled 443 /* sal_Bool Is shape filled? */
-#define ESCHER_Prop_fHitTestFill 444 /* sal_Bool Should we hit test fill? */
-#define ESCHER_Prop_fillShape 445 /* sal_Bool Register pattern on shape */
-#define ESCHER_Prop_fillUseRect 446 /* sal_Bool Use the large rect? */
-#define ESCHER_Prop_fNoFillHitTest 447 /* sal_Bool Hit test a shape as though filled */
+#define ESCHER_Prop_fFilled 443 /* bool Is shape filled? */
+#define ESCHER_Prop_fHitTestFill 444 /* bool Should we hit test fill? */
+#define ESCHER_Prop_fillShape 445 /* bool Register pattern on shape */
+#define ESCHER_Prop_fillUseRect 446 /* bool Use the large rect? */
+#define ESCHER_Prop_fNoFillHitTest 447 /* bool Hit test a shape as though filled */
// LineStyle
#define ESCHER_Prop_lineColor 448 /* MSOCLR Color of line */
#define ESCHER_Prop_lineOpacity 449 /* LONG Not implemented */
@@ -809,11 +809,11 @@ enum ESCHER_LineCap
#define ESCHER_Prop_lineEndArrowLength 469 /* MSOLINEENDLENGTH Arrow at end */
#define ESCHER_Prop_lineJoinStyle 470 /* MSOLINEJOIN How to join lines */
#define ESCHER_Prop_lineEndCapStyle 471 /* MSOLINECAP How to end lines */
-#define ESCHER_Prop_fArrowheadsOK 507 /* sal_Bool Allow arrowheads if prop. is set */
-#define ESCHER_Prop_fLine 508 /* sal_Bool Any line? */
-#define ESCHER_Prop_fHitTestLine 509 /* sal_Bool Should we hit test lines? */
-#define ESCHER_Prop_lineFillShape 510 /* sal_Bool Register pattern on shape */
-#define ESCHER_Prop_fNoLineDrawDash 511 /* sal_Bool Draw a dashed line if no line */
+#define ESCHER_Prop_fArrowheadsOK 507 /* bool Allow arrowheads if prop. is set */
+#define ESCHER_Prop_fLine 508 /* bool Any line? */
+#define ESCHER_Prop_fHitTestLine 509 /* bool Should we hit test lines? */
+#define ESCHER_Prop_lineFillShape 510 /* bool Register pattern on shape */
+#define ESCHER_Prop_fNoLineDrawDash 511 /* bool Draw a dashed line if no line */
// ShadowStyle
#define ESCHER_Prop_shadowType 512 /* MSOSHADOWTYPE Type of effect */
#define ESCHER_Prop_shadowColor 513 /* MSOCLR Foreground color */
@@ -833,8 +833,8 @@ enum ESCHER_LineCap
#define ESCHER_Prop_shadowWeight 527 /* LONG scaling factor */
#define ESCHER_Prop_shadowOriginX 528 /* LONG */
#define ESCHER_Prop_shadowOriginY 529 /* LONG */
-#define ESCHER_Prop_fShadow 574 /* sal_Bool Any shadow? */
-#define ESCHER_Prop_fshadowObscured 575 /* sal_Bool Excel5-style shadow */
+#define ESCHER_Prop_fShadow 574 /* bool Any shadow? */
+#define ESCHER_Prop_fshadowObscured 575 /* bool Excel5-style shadow */
// PerspectiveStyle
#define ESCHER_Prop_perspectiveType 576 /* MSOXFORMTYPE Where transform applies */
#define ESCHER_Prop_perspectiveOffsetX 577 /* LONG The LONG values define a */
@@ -848,7 +848,7 @@ enum ESCHER_LineCap
#define ESCHER_Prop_perspectiveWeight 585 /* LONG Scaling factor */
#define ESCHER_Prop_perspectiveOriginX 586 /* LONG */
#define ESCHER_Prop_perspectiveOriginY 587 /* LONG */
-#define ESCHER_Prop_fPerspective 639 /* sal_Bool On/off */
+#define ESCHER_Prop_fPerspective 639 /* bool On/off */
// 3D Object
#define ESCHER_Prop_c3DSpecularAmt 640 /* LONG Fixed-point 16.16 */
#define ESCHER_Prop_c3DDiffuseAmt 641 /* LONG Fixed-point 16.16 */
@@ -859,10 +859,10 @@ enum ESCHER_LineCap
#define ESCHER_Prop_c3DExtrudePlane 646 /* LONG Extrusion direction */
#define ESCHER_Prop_c3DExtrusionColor 647 /* MSOCLR Basic color of extruded part of shape; the lighting model used will determine the exact shades used when rendering. */
#define ESCHER_Prop_c3DCrMod 648 /* MSOCLR Modification for BW views */
-#define ESCHER_Prop_f3D 700 /* sal_Bool Does this shape have a 3D effect? */
-#define ESCHER_Prop_fc3DMetallic 701 /* sal_Bool Use metallic specularity? */
-#define ESCHER_Prop_fc3DUseExtrusionColor 702 /* sal_Bool */
-#define ESCHER_Prop_fc3DLightFace 703 /* sal_Bool */
+#define ESCHER_Prop_f3D 700 /* bool Does this shape have a 3D effect? */
+#define ESCHER_Prop_fc3DMetallic 701 /* bool Use metallic specularity? */
+#define ESCHER_Prop_fc3DUseExtrusionColor 702 /* bool */
+#define ESCHER_Prop_fc3DLightFace 703 /* bool */
// 3D Style
#define ESCHER_Prop_c3DYRotationAngle 704 /* LONG degrees (16.16) about y axis */
#define ESCHER_Prop_c3DXRotationAngle 705 /* LONG degrees (16.16) about x axis */
@@ -891,22 +891,22 @@ enum ESCHER_LineCap
#define ESCHER_Prop_c3DFillY 728 /* LONG tion; only their relative */
#define ESCHER_Prop_c3DFillZ 729 /* LONG magnitudes matter */
#define ESCHER_Prop_c3DFillIntensity 730 /* LONG Fixed point intensity */
-#define ESCHER_Prop_fc3DConstrainRotation 763 /* sal_Bool */
-#define ESCHER_Prop_fc3DRotationCenterAuto 764 /* sal_Bool */
-#define ESCHER_Prop_fc3DParallel 765 /* sal_Bool Parallel projection? */
-#define ESCHER_Prop_fc3DKeyHarsh 766 /* sal_Bool Is key lighting harsh? */
-#define ESCHER_Prop_fc3DFillHarsh 767 /* sal_Bool Is fill lighting harsh? */
+#define ESCHER_Prop_fc3DConstrainRotation 763 /* bool */
+#define ESCHER_Prop_fc3DRotationCenterAuto 764 /* bool */
+#define ESCHER_Prop_fc3DParallel 765 /* bool Parallel projection? */
+#define ESCHER_Prop_fc3DKeyHarsh 766 /* bool Is key lighting harsh? */
+#define ESCHER_Prop_fc3DFillHarsh 767 /* bool Is fill lighting harsh? */
// Shape
#define ESCHER_Prop_hspMaster 769 /* MSOHSP master shape */
#define ESCHER_Prop_cxstyle 771 /* MSOCXSTYLE Type of connector */
#define ESCHER_Prop_bWMode 772 /* ESCHERwMode Settings for modifications to */
#define ESCHER_Prop_bWModePureBW 773 /* ESCHERwMode be made when in different */
#define ESCHER_Prop_bWModeBW 774 /* ESCHERwMode forms of black-and-white mode. */
-#define ESCHER_Prop_fOleIcon 826 /* sal_Bool For OLE objects, whether the object is in icon form */
-#define ESCHER_Prop_fPreferRelativeResize 827 /* sal_Bool For UI only. Prefer relative resizing. */
-#define ESCHER_Prop_fLockShapeType 828 /* sal_Bool Lock the shape type (don't allow Change Shape) */
-#define ESCHER_Prop_fDeleteAttachedObject 830 /* sal_Bool */
-#define ESCHER_Prop_fBackground 831 /* sal_Bool If sal_True, this is the background shape. */
+#define ESCHER_Prop_fOleIcon 826 /* bool For OLE objects, whether the object is in icon form */
+#define ESCHER_Prop_fPreferRelativeResize 827 /* bool For UI only. Prefer relative resizing. */
+#define ESCHER_Prop_fLockShapeType 828 /* bool Lock the shape type (don't allow Change Shape) */
+#define ESCHER_Prop_fDeleteAttachedObject 830 /* bool */
+#define ESCHER_Prop_fBackground 831 /* bool If true, this is the background shape. */
// Callout
#define ESCHER_Prop_spcot 832 /* MSOSPCOT Callout type */
#define ESCHER_Prop_dxyCalloutGap 833 /* LONG Distance from box to first point.(EMUs) */
@@ -914,13 +914,13 @@ enum ESCHER_LineCap
#define ESCHER_Prop_spcod 835 /* MSOSPCOD Callout drop type */
#define ESCHER_Prop_dxyCalloutDropSpecified 836 /* LONG if msospcodSpecified, the actual drop distance */
#define ESCHER_Prop_dxyCalloutLengthSpecified 837 /* LONG if fCalloutLengthSpecified, the actual distance */
-#define ESCHER_Prop_fCallout 889 /* sal_Bool Is the shape a callout? */
-#define ESCHER_Prop_fCalloutAccentBar 890 /* sal_Bool does callout have accent bar */
-#define ESCHER_Prop_fCalloutTextBorder 891 /* sal_Bool does callout have a text border */
-#define ESCHER_Prop_fCalloutMinusX 892 /* sal_Bool */
-#define ESCHER_Prop_fCalloutMinusY 893 /* sal_Bool */
-#define ESCHER_Prop_fCalloutDropAuto 894 /* sal_Bool If true, then we occasionally invert the drop distance */
-#define ESCHER_Prop_fCalloutLengthSpecified 895 /* sal_Bool if true, we look at dxyCalloutLengthSpecified */
+#define ESCHER_Prop_fCallout 889 /* bool Is the shape a callout? */
+#define ESCHER_Prop_fCalloutAccentBar 890 /* bool does callout have accent bar */
+#define ESCHER_Prop_fCalloutTextBorder 891 /* bool does callout have a text border */
+#define ESCHER_Prop_fCalloutMinusX 892 /* bool */
+#define ESCHER_Prop_fCalloutMinusY 893 /* bool */
+#define ESCHER_Prop_fCalloutDropAuto 894 /* bool If true, then we occasionally invert the drop distance */
+#define ESCHER_Prop_fCalloutLengthSpecified 895 /* bool if true, we look at dxyCalloutLengthSpecified */
// GroupShape
#define ESCHER_Prop_wzName 896 /* WCHAR* Shape Name (present only if explicitly set) */
#define ESCHER_Prop_wzDescription 897 /* WCHAR* alternate text */
@@ -933,13 +933,13 @@ enum ESCHER_LineCap
#define ESCHER_Prop_lidRegroup 904 /* LONG Regroup ID */
#define ESCHER_Prop_tableProperties 927
#define ESCHER_Prop_tableRowProperties 928
-#define ESCHER_Prop_fEditedWrap 953 /* sal_Bool Has the wrap polygon been edited? */
-#define ESCHER_Prop_fBehindDocument 954 /* sal_Bool Word-only (shape is behind text) */
-#define ESCHER_Prop_fOnDblClickNotify 955 /* sal_Bool Notify client on a double click */
-#define ESCHER_Prop_fIsButton 956 /* sal_Bool A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros. */
-#define ESCHER_Prop_fOneD 957 /* sal_Bool 1D adjustment */
-#define ESCHER_Prop_fHidden 958 /* sal_Bool Do not display */
-#define ESCHER_Prop_fPrint 959 /* sal_Bool Print this shape */
+#define ESCHER_Prop_fEditedWrap 953 /* bool Has the wrap polygon been edited? */
+#define ESCHER_Prop_fBehindDocument 954 /* bool Word-only (shape is behind text) */
+#define ESCHER_Prop_fOnDblClickNotify 955 /* bool Notify client on a double click */
+#define ESCHER_Prop_fIsButton 956 /* bool A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros. */
+#define ESCHER_Prop_fOneD 957 /* bool 1D adjustment */
+#define ESCHER_Prop_fHidden 958 /* bool Do not display */
+#define ESCHER_Prop_fPrint 959 /* bool Print this shape */
#define ESCHER_PERSISTENTRY_PREALLOCATE 64
@@ -973,7 +973,7 @@ struct MSFILTER_DLLPUBLIC EscherConnectorListEntry
::com::sun::star::awt::Point maPointB;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXConnectToB;
- sal_uInt32 GetConnectorRule( sal_Bool bFirst );
+ sal_uInt32 GetConnectorRule( bool bFirst );
EscherConnectorListEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rC,
const ::com::sun::star::awt::Point& rPA,
@@ -1008,11 +1008,11 @@ struct MSFILTER_DLLPUBLIC EscherExAtom
struct EscherPropertyValueHelper
{
- static sal_Bool GetPropertyValue(
+ static bool GetPropertyValue(
::com::sun::star::uno::Any& rAny,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
const String& rPropertyName,
- sal_Bool bTestPropertyAvailability = sal_False );
+ bool bTestPropertyAvailability = false );
static ::com::sun::star::beans::PropertyState GetPropertyState(
const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
@@ -1051,8 +1051,9 @@ class EscherBlibEntry
Size maPrefSize;
MapMode maPrefMapMode;
- sal_Bool mbIsEmpty;
- sal_Bool mbIsNativeGraphicPossible;
+ /// bitfield
+ bool mbIsEmpty : 1;
+ bool mbIsNativeGraphicPossible : 1;
public:
@@ -1061,10 +1062,10 @@ class EscherBlibEntry
~EscherBlibEntry();
- void WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0 );
- sal_Bool IsEmpty() const { return mbIsEmpty; };
+ void WriteBlibEntry( SvStream& rSt, bool bWritePictureOffset, sal_uInt32 nResize = 0 );
+ bool IsEmpty() const { return mbIsEmpty; };
- sal_Bool operator==( const EscherBlibEntry& ) const;
+ bool operator==( const EscherBlibEntry& ) const;
};
// ---------------------------------------------------------------------------------------------
@@ -1090,15 +1091,19 @@ class MSFILTER_DLLPUBLIC EscherGraphicProvider
sal_uInt32 GetBlibStoreContainerSize( SvStream* pMergePicStreamBSE = NULL ) const;
void WriteBlibStoreContainer( SvStream& rStrm, SvStream* pMergePicStreamBSE = NULL );
- sal_Bool WriteBlibStoreEntry(SvStream& rStrm, sal_uInt32 nBlipId,
- sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0);
- sal_uInt32 GetBlibID( SvStream& rPicOutStream, const ByteString& rGraphicId, const Rectangle& rBoundRect,
- const com::sun::star::awt::Rectangle* pVisArea = NULL, const GraphicAttr* pGrafikAttr = NULL );
- sal_Bool HasGraphics() const { return mnBlibEntrys != 0; };
+ bool WriteBlibStoreEntry(SvStream& rStrm, sal_uInt32 nBlipId,
+ bool bWritePictureOffset, sal_uInt32 nResize = 0);
+ sal_uInt32 GetBlibID(
+ SvStream& rPicOutStream,
+ const ByteString& rGraphicId,
+ const basegfx::B2DRange& rObjectRange,
+ const com::sun::star::awt::Rectangle* pVisArea = NULL,
+ const GraphicAttr* pGrafikAttr = NULL );
+ bool HasGraphics() const { return mnBlibEntrys != 0; };
void SetNewBlipStreamOffset( sal_Int32 nOffset );
- sal_Bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode );
+ bool GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode );
void SetBaseURI( const rtl::OUString& rBaseURI ) { maBaseURI = rBaseURI; };
const rtl::OUString& GetBaseURI(){ return maBaseURI; };
@@ -1151,113 +1156,112 @@ typedef std::vector< EscherPropSortStruct > EscherProperties;
class MSFILTER_DLLPUBLIC EscherPropertyContainer
{
- EscherGraphicProvider* pGraphicProvider;
- SvStream* pPicOutStrm;
- Rectangle* pShapeBoundRect;
-
- EscherPropSortStruct* pSortStruct;
-
- sal_uInt32 nSortCount;
- sal_uInt32 nSortBufSize;
- sal_uInt32 nCountCount;
- sal_uInt32 nCountSize;
-
- sal_Bool bHasComplexData;
-
- sal_uInt32 ImplGetColor( const sal_uInt32 rColor, sal_Bool bSwap = sal_True );
- void ImplCreateGraphicAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_uInt32 nBlibId, sal_Bool bCreateCroppingAttributes );
- sal_Bool ImplCreateEmbeddedBmp( const ByteString& rUniqueId );
- void ImplInit();
-
- public :
-
- EscherPropertyContainer();
- EscherPropertyContainer(
- EscherGraphicProvider& rGraphicProvider, // the PropertyContainer needs to know
- SvStream* pPicOutStrm, // the GraphicProvider to be able to write
- Rectangle& rShapeBoundRect ); // FillBitmaps or GraphicObjects.
- // under some cirumstances the ShapeBoundRect is adjusted
- // this will happen when rotated GraphicObjects
- // are saved to PowerPoint
- ~EscherPropertyContainer();
-
- void AddOpt( sal_uInt16 nPropertyID, const rtl::OUString& rString );
-
- void AddOpt( sal_uInt16 nPropertyID, sal_uInt32 nPropValue,
- sal_Bool bBlib = sal_False );
-
- void AddOpt( sal_uInt16 nPropertyID, sal_Bool bBlib, sal_uInt32 nPropValue,
- sal_uInt8* pProp, sal_uInt32 nPropSize );
-
- sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
-
- sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
-
- EscherProperties GetOpts() const;
-
- void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
-
- sal_Bool CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
- sal_Bool CreateOLEGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject );
-
- sal_Bool CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
- const GraphicObject& rGraphicObj );
- sal_Bool CreateMediaGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXMediaObject );
- /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel charts). */
- sal_Bool CreateEmbeddedBitmapProperties( const ::rtl::OUString& rBitmapUrl,
- ::com::sun::star::drawing::BitmapMode eBitmapMode );
- /** Creates a complex ESCHER_Prop_fillBlip containing a hatch style (for Excel charts). */
- sal_Bool CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch,
- const Color& rBackColor, bool bFillBackground );
-
- // the GraphicProperties will only be created if a GraphicProvider and PicOutStrm is known
- // DR: #99897# if no GraphicProvider is present, a complex ESCHER_Prop_fillBlip
- // will be created, containing the BLIP directly (e.g. for Excel charts).
- sal_Bool CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes = sal_False,
- const sal_Bool bFillBitmapModeAllowed = sal_True );
- sal_Bool CreateBlipPropertiesforOLEControl( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape);
- sal_Bool CreatePolygonProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_uInt32 nFlags, sal_Bool bBezier, ::com::sun::star::awt::Rectangle& rGeoRect, Polygon* pPolygon = NULL );
-
- static sal_uInt32 GetGradientColor( const ::com::sun::star::awt::Gradient* pGradient, sal_uInt32 nStartColor );
-
- void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient );
- void CreateGradientProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & , sal_Bool bTransparentGradient = sal_False );
- void CreateLineProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge );
- void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge , sal_Bool bTransparentGradient = sal_False );
- void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_Bool bEdge , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
- void CreateTextProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_uInt32 nText,
- const sal_Bool bIsCustomShape = sal_False, const sal_Bool bIsTextFrame = sal_True );
-
- sal_Bool CreateConnectorProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
- EscherSolverContainer& rSolver, ::com::sun::star::awt::Rectangle& rGeoRect,
- sal_uInt16& rShapeType, sal_uInt16& rShapeFlags );
-
- // Because shadow properties depends to the line and fillstyle, the CreateShadowProperties method should be called at last.
- // It activ only when at least a FillStyle or LineStyle is set.
- sal_Bool CreateShadowProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & );
-
- sal_Int32 GetValueForEnhancedCustomShapeParameter( const ::com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter,
- const std::vector< sal_Int32 >& rEquationOrder, sal_Bool bAdjustTrans = sal_False );
- // creates all necessary CustomShape properties, this includes also Text-, Shadow-, Fill-, and LineProperties
- void CreateCustomShapeProperties( const MSO_SPT eShapeType, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & );
- sal_Bool IsFontWork() const;
-
- // helper functions which are also used by the escher import
- static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
- static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
- static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags );
- static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType );
+private:
+ EscherGraphicProvider* mpGraphicProvider;
+ SvStream* mpPicOutStrm;
+ basegfx::B2DRange* mpObjectRange; // TTTT: think about making this a member to be able to hand over a const&
+ EscherPropSortStruct* mpSortStruct;
+
+ sal_uInt32 mnSortCount;
+ sal_uInt32 mnSortBufSize;
+ sal_uInt32 mnCountCount;
+ sal_uInt32 mnCountSize;
+
+ /// bitfield
+ bool mbHasComplexData : 1;
+
+ sal_uInt32 ImplGetColor( const sal_uInt32 rColor, bool bSwap = true );
+ void ImplCreateGraphicAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nBlibId, bool bCreateCroppingAttributes );
+ bool ImplCreateEmbeddedBmp( const ByteString& rUniqueId );
+
+public :
+
+ EscherPropertyContainer();
+ EscherPropertyContainer(
+ EscherGraphicProvider& rGraphicProvider, // the PropertyContainer needs to know
+ SvStream* pPicOutStrm, // the GraphicProvider to be able to write
+ basegfx::B2DRange& rObjectRange); // FillBitmaps or GraphicObjects.
+ // under some cirumstances the ShapeBoundRect is adjusted
+ // this will happen when rotated GraphicObjects
+ // are saved to PowerPoint
+ ~EscherPropertyContainer();
+
+ void AddOpt( sal_uInt16 nPropertyID, const rtl::OUString& rString );
+
+ void AddOpt( sal_uInt16 nPropertyID, sal_uInt32 nPropValue,
+ bool bBlib = false );
+
+ void AddOpt( sal_uInt16 nPropertyID, bool bBlib, sal_uInt32 nPropValue,
+ sal_uInt8* pProp, sal_uInt32 nPropSize );
+
+ bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
+
+ bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
+
+ EscherProperties GetOpts() const;
+
+ void Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
+
+ bool CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
+ bool CreateOLEGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject );
+
+ bool CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ const GraphicObject& rGraphicObj );
+ bool CreateMediaGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXMediaObject );
+ /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel charts). */
+ bool CreateEmbeddedBitmapProperties( const ::rtl::OUString& rBitmapUrl,
+ ::com::sun::star::drawing::BitmapMode eBitmapMode );
+ /** Creates a complex ESCHER_Prop_fillBlip containing a hatch style (for Excel charts). */
+ bool CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch,
+ const Color& rBackColor, bool bFillBackground );
+
+ // the GraphicProperties will only be created if a GraphicProvider and PicOutStrm is known
+ // DR: #99897# if no GraphicProvider is present, a complex ESCHER_Prop_fillBlip
+ // will be created, containing the BLIP directly (e.g. for Excel charts).
+ bool CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ const String& rSource, const bool bCreateFillBitmap, const bool bCreateCroppingAttributes = false,
+ const bool bFillBitmapModeAllowed = true );
+ bool CreateBlipPropertiesforOLEControl( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape);
+ bool CreatePolygonProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
+ sal_uInt32 nFlags, bool bBezier, ::com::sun::star::awt::Rectangle& rGeoRect, Polygon* pPolygon = NULL );
+
+ static sal_uInt32 GetGradientColor( const ::com::sun::star::awt::Gradient* pGradient, sal_uInt32 nStartColor );
+
+ void CreateGradientProperties( const ::com::sun::star::awt::Gradient & rGradient );
+ void CreateGradientProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & , bool bTransparentGradient = false );
+ void CreateLineProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, bool bEdge );
+ void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, bool bEdge , bool bTransparentGradient = false );
+ void CreateFillProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, bool bEdge , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
+ void CreateTextProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &, sal_uInt32 nText,
+ const bool bIsCustomShape = false, const bool bIsTextFrame = true );
+
+ bool CreateConnectorProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
+ EscherSolverContainer& rSolver, ::com::sun::star::awt::Rectangle& rGeoRect,
+ sal_uInt16& rShapeType, sal_uInt16& rShapeFlags );
+
+ // Because shadow properties depends to the line and fillstyle, the CreateShadowProperties method should be called at last.
+ // It activ only when at least a FillStyle or LineStyle is set.
+ bool CreateShadowProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & );
+
+ sal_Int32 GetValueForEnhancedCustomShapeParameter( const ::com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter,
+ const std::vector< sal_Int32 >& rEquationOrder, bool bAdjustTrans = false );
+ // creates all necessary CustomShape properties, this includes also Text-, Shadow-, Fill-, and LineProperties
+ void CreateCustomShapeProperties( const MSO_SPT eShapeType, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & );
+ bool IsFontWork() const;
+
+ // helper functions which are also used by the escher import
+ static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
+ static PolyPolygon GetPolyPolygon( const ::com::sun::star::uno::Any& rSource );
+ static MSO_SPT GetCustomShapeType( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, rtl::OUString& rShapeType );
// helper functions which are also used in ooxml export
- static sal_Bool GetLineArrow( const sal_Bool bLineStart,
+ static bool GetLineArrow( const bool bLineStart,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth );
- static sal_Bool IsDefaultObject( SdrObjCustomShape* pCustoShape, const MSO_SPT eShapeType );
+ static bool IsDefaultObject( SdrObjCustomShape* pCustoShape, const MSO_SPT eShapeType );
static void LookForPolarHandles( const MSO_SPT eShapeType, sal_Int32& nAdjustmentsWhichNeedsToBeConverted );
- static sal_Bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
+ static bool GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue );
};
// ---------------------------------------------------------------------------------------------
@@ -1268,7 +1272,7 @@ class MSFILTER_DLLPUBLIC EscherPersistTable
public:
List maPersistTable;
- sal_Bool PtIsID( sal_uInt32 nID );
+ bool PtIsID( sal_uInt32 nID );
void PtInsert( sal_uInt32 nID, sal_uInt32 nOfs );
sal_uInt32 PtDelete( sal_uInt32 nID );
sal_uInt32 PtGetOffsetByID( sal_uInt32 nID );
@@ -1308,8 +1312,9 @@ public:
/// Application writes the record header
/// using rEx.AddAtom(...) followed by
/// record data written to rEx.GetStream()
- virtual void WriteData( EscherEx& rEx,
- const Rectangle& rRect ) = 0;
+ virtual void WriteData(
+ EscherEx& rEx,
+ const basegfx::B2DRange& rObjectRange) = 0;
};
@@ -1319,12 +1324,14 @@ private:
EscherExClientAnchor_Base* pClientAnchor;
EscherExClientRecord_Base* pClientData;
EscherExClientRecord_Base* pClientTextbox;
+
+ /// bitfield
// ignore single shape if entire pages are written
- sal_Bool bDontWriteShape;
+ bool bDontWriteShape : 1;
public:
EscherExHostAppData() : pClientAnchor(0), pClientData(0),
- pClientTextbox(0), bDontWriteShape(sal_False)
+ pClientTextbox(0), bDontWriteShape(false)
{}
void SetClientAnchor( EscherExClientAnchor_Base* p )
@@ -1333,7 +1340,7 @@ public:
{ pClientData = p; }
void SetClientTextbox( EscherExClientRecord_Base* p )
{ pClientTextbox = p; }
- void SetDontWriteShape( sal_Bool b )
+ void SetDontWriteShape( bool b )
{ bDontWriteShape = b; }
EscherExClientAnchor_Base* GetClientAnchor() const
{ return pClientAnchor; }
@@ -1342,14 +1349,14 @@ public:
EscherExClientRecord_Base* GetClientTextbox() const
{ return pClientTextbox; }
- void WriteClientAnchor( EscherEx& rEx, const Rectangle& rRect )
- { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rRect ); }
+ void WriteClientAnchor( EscherEx& rEx, const basegfx::B2DRange& rObjectRange )
+ { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rObjectRange ); }
void WriteClientData( EscherEx& rEx )
{ if( pClientData ) pClientData->WriteData( rEx ); }
void WriteClientTextbox( EscherEx& rEx )
{ if( pClientTextbox ) pClientTextbox->WriteData( rEx ); }
- sal_Bool DontWriteShape() const { return bDontWriteShape; }
+ bool DontWriteShape() const { return bDontWriteShape; }
};
@@ -1459,12 +1466,13 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
sal_uInt32 mnGroupLevel;
sal_uInt16 mnHellLayerId;
- sal_Bool mbEscherSpgr;
- sal_Bool mbEscherDg;
- sal_Bool mbOleEmf; // OLE is EMF instead of WMF
+ /// bitfield
+ bool mbEscherSpgr : 1;
+ bool mbEscherDg : 1;
+ bool mbOleEmf : 1; // OLE is EMF instead of WMF
- virtual sal_Bool DoSeek( sal_uInt32 nKey );
+ virtual bool DoSeek( sal_uInt32 nKey );
public:
explicit EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm );
@@ -1515,14 +1523,14 @@ public:
void InsertPersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
void ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset );
sal_uInt32 GetPersistOffset( sal_uInt32 nKey );
- sal_Bool SeekToPersistOffset( sal_uInt32 nKey );
- virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
+ bool SeekToPersistOffset( sal_uInt32 nKey );
+ virtual bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
// aktuelle StreamPosition aendert
SvStream& GetStream() const { return *mpOutStrm; }
sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); }
- virtual sal_Bool SeekBehindRecHeader( sal_uInt16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
+ virtual bool SeekBehindRecHeader( sal_uInt16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
// features beim erzeugen folgender Container:
//
@@ -1537,23 +1545,34 @@ public:
virtual void BeginAtom();
virtual void EndAtom( sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
virtual void AddAtom( sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- virtual void AddChildAnchor( const Rectangle& rRectangle );
- virtual void AddClientAnchor( const Rectangle& rRectangle );
-
- virtual sal_uInt32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
- sal_uInt32 EnterGroup( const Rectangle* pBoundRect = NULL );
+ virtual void AddChildAnchor(
+ const basegfx::B2DRange& rObjectRange);
+ virtual void AddClientAnchor(
+ const basegfx::B2DRange& rObjectRange);
+
+ virtual sal_uInt32 EnterGroup(
+ const String& rShapeName,
+ const basegfx::B2DRange* pObjectRange = 0);
+ sal_uInt32 EnterGroup(
+ const basegfx::B2DRange* pObjectRange = 0);
sal_uInt32 GetGroupLevel() const { return mnGroupLevel; };
- virtual sal_Bool SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
- virtual sal_Bool SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual bool SetGroupSnapPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DRange& rObjectRange);
+ virtual bool SetGroupLogicPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DRange& rObjectRange);
virtual void LeaveGroup();
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 );
- virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+ virtual void Commit(
+ EscherPropertyContainer& rProps,
+ const basegfx::B2DRange& rObjectRange);
- sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True );
- sal_uInt32 GetColor( const Color& rColor, sal_Bool bSwap = sal_True );
+ sal_uInt32 GetColor( const sal_uInt32 nColor, bool bSwap = true );
+ sal_uInt32 GetColor( const Color& rColor, bool bSwap = true );
// ...Sdr... implemented in eschesdo.cxx
@@ -1573,7 +1592,7 @@ public:
/// shape is ignored.
virtual EscherExHostAppData* StartShape(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
- const Rectangle* pChildAnchor );
+ const basegfx::B2DRange* pObjectRange);
/// Called after a shape is written to inform the application
/// of the resulted shape type and ID.
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx
index 02b58f0fdbf5..0a0952f63c5d 100644
--- a/filter/inc/filter/msfilter/msdffimp.hxx
+++ b/filter/inc/filter/msfilter/msdffimp.hxx
@@ -52,15 +52,11 @@ class PolyPolygon;
class FmFormModel;
class SdrModel;
class DffRecordHeader;
-
class SwFlyFrmFmt;
-
struct SvxMSDffBLIPInfo;
struct SvxMSDffShapeInfo;
struct SvxMSDffShapeOrder;
-
class SvxMSDffManager;
-
class SfxItemSet;
class SdrObject;
struct DffObjData;
@@ -259,31 +255,30 @@ SV_DECL_PTRARR_SORT_DEL_VISIBILITY(MSDffImportRecords, MSDffImportRec_Ptr, 16,16
struct SvxMSDffImportData
{
MSDffImportRecords aRecords; // Shape-Pointer, -Ids und private Daten
- Rectangle aParentRect;// Rectangle der umgebenden Gruppe
+ basegfx::B2DRange aParentRect;// Rectangle der umgebenden Gruppe
// bzw. von aussen reingegebenes Rect
- Rectangle aNewRect; // mit diesem Shape definiertes Rectangle
+ basegfx::B2DRange aNewRect; // mit diesem Shape definiertes Rectangle
SvxMSDffImportData()
{}
- SvxMSDffImportData(const Rectangle& rParentRect)
+ SvxMSDffImportData(const basegfx::B2DRange& rParentRect)
:aParentRect( rParentRect )
{}
void SetNewRect(sal_Int32 l, sal_Int32 o,
- sal_Int32 r, sal_Int32 u ){ aNewRect = Rectangle(l,o, r,u); }
- sal_Bool HasParRect() const { return aParentRect.IsEmpty(); }
- sal_Bool HasNewRect() const { return aNewRect.IsEmpty() ; }
+ sal_Int32 r, sal_Int32 u ){ aNewRect = basegfx::B2DRange(l,o,r,u); }
+ sal_Bool HasParRect() const { return aParentRect.isEmpty(); }
+ sal_Bool HasNewRect() const { return aNewRect.isEmpty() ; }
sal_Bool HasRecords() const { return 0 != aRecords.Count(); }
sal_uInt16 GetRecCount() const { return aRecords.Count(); }
- SvxMSDffImportRec* GetRecord(sal_uInt16 iRecord) const
- { return aRecords.GetObject( iRecord ); }
+ SvxMSDffImportRec* GetRecord(sal_uInt16 iRecord) const { return aRecords.GetObject( iRecord ); }
};
struct DffObjData
{
const DffRecordHeader& rSpHd;
- Rectangle aBoundRect;
- Rectangle aChildAnchor;
+ basegfx::B2DRange aBoundRect;
+ basegfx::B2DRange aChildAnchor;
sal_uInt32 nShapeId;
sal_uInt32 nSpFlags;
@@ -301,7 +296,7 @@ struct DffObjData
int nCalledByGroup;
DffObjData( const DffRecordHeader& rObjHd,
- const Rectangle& rBoundRect,
+ const basegfx::B2DRange& rBoundRect,
int nClByGroup ) :
rSpHd( rObjHd ),
aBoundRect( rBoundRect ),
@@ -414,7 +409,7 @@ protected :
long nEmuDiv;
long nPntMul;
long nPntDiv;
- FASTBOOL bNeedMap;
+ bool bNeedMap;
sal_uInt32 nSvxMSDffSettings;
sal_uInt32 nSvxMSDffOLEConvFlags;
@@ -444,16 +439,16 @@ protected :
const unsigned long nDrawingContainerId );
// <--
- FASTBOOL ReadGraphic( SvStream& rSt, sal_uLong nIndex, Graphic& rGraphic ) const;
- SdrObject* ImportFontWork( SvStream&, SfxItemSet&, Rectangle& rBoundRect ) const;
+ bool ReadGraphic( SvStream& rSt, sal_uLong nIndex, Graphic& rGraphic ) const;
+ SdrObject* ImportFontWork( SvStream&, SfxItemSet&, basegfx::B2DRange& rBoundRect ) const;
SdrObject* ImportGraphic( SvStream&, SfxItemSet&, const DffObjData& ) const;
// --> OD 2004-12-14 #i32596# - pass <nCalledByGroup> to method
// Needed in the Writer Microsoft Word import to avoid import of OLE objects
// inside groups. Instead a graphic object is created.
virtual SdrObject* ImportOLE( long nOLEId,
const Graphic& rGraf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
const int _nCalledByGroup,
sal_Int64 nAspect ) const;
// <--
@@ -463,7 +458,7 @@ protected :
sal_uInt32 nConvertFlags, SotStorage& rSrcStg,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg,
const Graphic& rGrf,
- const Rectangle& rVisArea );
+ const basegfx::B2DRange& rVisArea );
#endif
/*
@@ -472,9 +467,9 @@ protected :
virtual sal_Bool ProcessClientAnchor(SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
virtual void ProcessClientAnchor2( SvStream& rStData, DffRecordHeader& rHd, void* pData, DffObjData& );
virtual sal_Bool ProcessClientData( SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
- virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj = NULL);
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, basegfx::B2DRange& rTextRect, SdrObject* pObj = NULL);
virtual sal_uLong Calc_nBLIPPos( sal_uLong nOrgVal, sal_uLong nStreamPos ) const;
- virtual FASTBOOL GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
// SJ: New implementation of ReadObjText is used by Fontwork objects, because
// the old one does not properly import multiple paragraphs
@@ -498,6 +493,14 @@ protected :
*/
virtual sal_Bool ShapeHasText(sal_uLong nShapeId, sal_uLong nFilePos) const;
+ // helper to apply rotation and mirroring to SdrObject
+ void ApplyRotationAndMirror(
+ SdrObject& rTarget,
+ const basegfx::B2DPoint& rCenter,
+ sal_Int32 nAngle, // in old DrawingLayer notation
+ bool bFlipHorizontal,
+ bool bFlipVertical);
+
public:
void* pSvxMSDffDummy1;
@@ -514,11 +517,11 @@ public:
Color MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const;
Color MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContextProperty = DFF_Prop_lineColor ) const;
virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
- FASTBOOL SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
- FASTBOOL SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
+ bool SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
+ bool SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
// -----------------------------------------------------------------------
- static void MSDFFReadZString( SvStream& rIn, String& rStr, sal_uLong nMaxLen, FASTBOOL bUniCode = sal_False );
+ static void MSDFFReadZString( SvStream& rIn, String& rStr, sal_uLong nMaxLen, bool bUniCode = sal_False );
static sal_Bool ReadCommonRecordHeader( DffRecordHeader& rRec, SvStream& rIn );
static sal_Bool ReadCommonRecordHeader( SvStream& rSt,
@@ -594,7 +597,7 @@ public:
Rueckgabewert: sal_True, im Erfolgsfalls, sal_False bei Fehler
*/
- sal_Bool GetBLIP( sal_uLong nIdx, Graphic& rData, Rectangle* pVisArea = NULL ) const;
+ sal_Bool GetBLIP( sal_uLong nIdx, Graphic& rData, basegfx::B2DRange* pVisArea = NULL ) const;
/*
GetBLIPDirect() -Einlesen eines BLIP aus schon positioniertem Stream
@@ -607,7 +610,7 @@ public:
Rueckgabewert: sal_True, im Erfolgsfalls, sal_False bei Fehler
*/
- sal_Bool GetBLIPDirect(SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea = NULL ) const;
+ sal_Bool GetBLIPDirect(SvStream& rBLIPStream, Graphic& rData, basegfx::B2DRange* pVisArea = NULL ) const;
sal_Bool GetShape(sal_uLong nId,
SdrObject*& rpData, SvxMSDffImportData& rData);
@@ -652,18 +655,18 @@ public:
// sal_Bool bLookForEnd );
//
SdrObject* ImportObj(SvStream& rSt, void* pData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL);
+ basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL);
SdrObject* ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, void* pData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL );
+ basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL );
SdrObject* ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL);
+ basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL);
- Rectangle GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle& aClientRect );
+ basegfx::B2DRange GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, basegfx::B2DRange& aClientRange );
void GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt,
- Rectangle& rGroupClientAnchor, Rectangle& rGroupChildAnchor,
- const Rectangle& rClientRect, const Rectangle& rGlobalChildRect );
+ basegfx::B2DRange& rGroupClientAnchor, basegfx::B2DRange& rGroupChildAnchor,
+ const basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange );
inline const SvxMSDffShapeInfos* GetShapeInfos( void ) const
{
@@ -690,12 +693,14 @@ public:
sal_uInt32 GetConvertFlags() const { return nSvxMSDffOLEConvFlags; }
- static SdrOle2Obj* CreateSdrOLEFromStorage( const String& rStorageName,
+ static SdrOle2Obj* CreateSdrOLEFromStorage(
+ SdrModel& rTargetModel,
+ const String& rStorageName,
SotStorageRef& rSrcStorage,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg,
const Graphic& rGraf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
SvStream* pDataStrrm,
ErrCode& rError,
sal_uInt32 nConvertFlags,
diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index af90008115a6..8f51981bbb85 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -450,7 +450,7 @@ public:
SdrEscherImport( PowerPointImportParam&, const String& rBaseURL );
virtual ~SdrEscherImport();
- virtual FASTBOOL GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const;
+ virtual bool GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const;
virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
PptFontEntityAtom* GetFontEnityAtom( sal_uInt32 nNum ) const;
CharSet GetCharSet( sal_uInt32 nNum ) const;
@@ -458,7 +458,7 @@ public:
void RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraph );
using SvxMSDffManager::ReadObjText;
virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
- virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj );
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, basegfx::B2DRange& rTextRect, SdrObject* pObj );
virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* pData, DffObjData& rObj );
void ImportHeaderFooterContainer( DffRecordHeader& rHeader, HeaderFooterEntry& rEntry );
};
@@ -565,8 +565,8 @@ protected:
// indicates, if the OLE object is imported inside a group object.
virtual SdrObject* ImportOLE( long nOLEId,
const Graphic& rGraf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
const int _nCalledByGroup,
sal_Int64 nAspect ) const;
// <--
@@ -596,7 +596,7 @@ public:
sal_uInt16 GetMasterPageIndex( sal_uInt16 nPageNum, PptPageKind ePageKind = PPT_SLIDEPAGE ) const;
void ImportPage( SdrPage* pPage, const PptSlidePersistEntry* pMasterPersist = NULL );
- virtual FASTBOOL GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
sal_Unicode PPTSubstitute( sal_uInt16 nFont, sal_Unicode nChar,
sal_uInt32& nMappedFontId, Font& rFont, char nDefault ) const;
diff --git a/filter/source/filtertracer/filtertracer.cxx b/filter/source/filtertracer/filtertracer.cxx
index fcac713b9a36..06141e961e0b 100644
--- a/filter/source/filtertracer/filtertracer.cxx
+++ b/filter/source/filtertracer/filtertracer.cxx
@@ -27,6 +27,8 @@
#include <uno/mapping.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include "memory.h"
+
// ----------------
// - FILTERTRACER -
// ----------------
diff --git a/filter/source/msfilter/dffpropset.cxx b/filter/source/msfilter/dffpropset.cxx
index 7f0326a135e1..e96283ec98d0 100644
--- a/filter/source/msfilter/dffpropset.cxx
+++ b/filter/source/msfilter/dffpropset.cxx
@@ -25,6 +25,7 @@
#include <filter/msfilter/dffpropset.hxx>
#include <rtl/ustrbuf.hxx>
+#include <memory.h>
static const DffPropSetEntry mso_PropSetDefaults[] = {
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index d126053c2fd6..0108f107593a 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -95,6 +95,7 @@
#include <vcl/virdev.hxx>
#include <rtl/crc.h>
#include <vos/xception.hxx>
+#include <svx/svdlegacy.hxx>
using namespace vos;
using namespace ::rtl;
@@ -151,46 +152,48 @@ EscherExClientAnchor_Base::~EscherExClientAnchor_Base()
// ---------------------------------------------------------------------------------------------
-void EscherPropertyContainer::ImplInit()
-{
- nSortCount = 0;
- nCountCount = 0;
- nCountSize = 0;
- nSortBufSize = 64;
- bHasComplexData = sal_False;
- pSortStruct = new EscherPropSortStruct[ nSortBufSize ];
-}
-
-EscherPropertyContainer::EscherPropertyContainer() :
- pGraphicProvider ( NULL ),
- pPicOutStrm ( NULL )
-{
- ImplInit();
+EscherPropertyContainer::EscherPropertyContainer()
+: mpGraphicProvider(0),
+ mpPicOutStrm(0),
+ mpObjectRange(),
+ mpSortStruct(0),
+ mnSortCount(0),
+ mnSortBufSize(64),
+ mnCountCount(0),
+ mnCountSize(0),
+ mbHasComplexData(false)
+{
+ mpSortStruct = new EscherPropSortStruct[mnSortBufSize];
};
EscherPropertyContainer::EscherPropertyContainer(
EscherGraphicProvider& rGraphProv,
- SvStream* pPiOutStrm,
- Rectangle& rBoundRect ) :
-
- pGraphicProvider ( &rGraphProv ),
- pPicOutStrm ( pPiOutStrm ),
- pShapeBoundRect ( &rBoundRect )
-{
- ImplInit();
+ SvStream* pPiOutStrm,
+ basegfx::B2DRange& rObjectRange) // FillBitmaps or GraphicObjects.
+: mpGraphicProvider(&rGraphProv),
+ mpPicOutStrm(pPiOutStrm),
+ mpObjectRange(&rObjectRange),
+ mpSortStruct(0),
+ mnSortCount(0),
+ mnSortBufSize(64),
+ mnCountCount(0),
+ mnCountSize(0),
+ mbHasComplexData(false)
+{
+ mpSortStruct = new EscherPropSortStruct[mnSortBufSize];
}
EscherPropertyContainer::~EscherPropertyContainer()
{
- if ( bHasComplexData )
+ if ( mbHasComplexData )
{
- while ( nSortCount-- )
- delete[] pSortStruct[ nSortCount ].pBuf;
+ while ( mnSortCount-- )
+ delete[] mpSortStruct[ mnSortCount ].pBuf;
}
- delete[] pSortStruct;
+ delete[] mpSortStruct;
};
-void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_uInt32 nPropValue, sal_Bool bBlib )
+void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_uInt32 nPropValue, bool bBlib )
{
AddOpt( nPropID, bBlib, nPropValue, NULL, 0 );
}
@@ -207,91 +210,91 @@ void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, const rtl::OUString& r
}
pBuf[ j++ ] = 0;
pBuf[ j++ ] = 0;
- AddOpt( nPropID, sal_True, nLen, pBuf, nLen );
+ AddOpt( nPropID, true, nLen, pBuf, nLen );
}
-void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_Bool bBlib, sal_uInt32 nPropValue, sal_uInt8* pProp, sal_uInt32 nPropSize )
+void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, bool bBlib, sal_uInt32 nPropValue, sal_uInt8* pProp, sal_uInt32 nPropSize )
{
if ( bBlib ) // bBlib is only valid when fComplex = 0
nPropID |= 0x4000;
if ( pProp )
- nPropID |= 0x8000; // fComplex = sal_True;
+ nPropID |= 0x8000; // fComplex = true;
sal_uInt32 i;
- for( i = 0; i < nSortCount; i++ )
+ for( i = 0; i < mnSortCount; i++ )
{
- if ( ( pSortStruct[ i ].nPropId &~0xc000 ) == ( nPropID &~0xc000 ) ) // pruefen, ob Property nur ersetzt wird
+ if ( ( mpSortStruct[ i ].nPropId &~0xc000 ) == ( nPropID &~0xc000 ) ) // pruefen, ob Property nur ersetzt wird
{
- pSortStruct[ i ].nPropId = nPropID;
- if ( pSortStruct[ i ].pBuf )
+ mpSortStruct[ i ].nPropId = nPropID;
+ if ( mpSortStruct[ i ].pBuf )
{
- nCountSize -= pSortStruct[ i ].nPropSize;
- delete[] pSortStruct[ i ].pBuf;
+ mnCountSize -= mpSortStruct[ i ].nPropSize;
+ delete[] mpSortStruct[ i ].pBuf;
}
- pSortStruct[ i ].pBuf = pProp;
- pSortStruct[ i ].nPropSize = nPropSize;
- pSortStruct[ i ].nPropValue = nPropValue;
+ mpSortStruct[ i ].pBuf = pProp;
+ mpSortStruct[ i ].nPropSize = nPropSize;
+ mpSortStruct[ i ].nPropValue = nPropValue;
if ( pProp )
- nCountSize += nPropSize;
+ mnCountSize += nPropSize;
return;
}
}
- nCountCount++;
- nCountSize += 6;
- if ( nSortCount == nSortBufSize ) // buffer vergroessern
+ mnCountCount++;
+ mnCountSize += 6;
+ if ( mnSortCount == mnSortBufSize ) // buffer vergroessern
{
- nSortBufSize <<= 1;
- EscherPropSortStruct* pTemp = new EscherPropSortStruct[ nSortBufSize ];
- for( i = 0; i < nSortCount; i++ )
+ mnSortBufSize <<= 1;
+ EscherPropSortStruct* pTemp = new EscherPropSortStruct[ mnSortBufSize ];
+ for( i = 0; i < mnSortCount; i++ )
{
- pTemp[ i ] = pSortStruct[ i ];
+ pTemp[ i ] = mpSortStruct[ i ];
}
- delete pSortStruct;
- pSortStruct = pTemp;
+ delete mpSortStruct;
+ mpSortStruct = pTemp;
}
- pSortStruct[ nSortCount ].nPropId = nPropID; // property einfuegen
- pSortStruct[ nSortCount ].pBuf = pProp;
- pSortStruct[ nSortCount ].nPropSize = nPropSize;
- pSortStruct[ nSortCount++ ].nPropValue = nPropValue;
+ mpSortStruct[ mnSortCount ].nPropId = nPropID; // property einfuegen
+ mpSortStruct[ mnSortCount ].pBuf = pProp;
+ mpSortStruct[ mnSortCount ].nPropSize = nPropSize;
+ mpSortStruct[ mnSortCount++ ].nPropValue = nPropValue;
if ( pProp )
{
- nCountSize += nPropSize;
- bHasComplexData = sal_True;
+ mnCountSize += nPropSize;
+ mbHasComplexData = true;
}
}
-sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& rPropValue ) const
+bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& rPropValue ) const
{
EscherPropSortStruct aPropStruct;
if ( GetOpt( nPropId, aPropStruct ) )
{
rPropValue = aPropStruct.nPropValue;
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
-sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, EscherPropSortStruct& rPropValue ) const
+bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, EscherPropSortStruct& rPropValue ) const
{
- for( sal_uInt32 i = 0; i < nSortCount; i++ )
+ for( sal_uInt32 i = 0; i < mnSortCount; i++ )
{
- if ( ( pSortStruct[ i ].nPropId &~0xc000 ) == ( nPropId &~0xc000 ) )
+ if ( ( mpSortStruct[ i ].nPropId &~0xc000 ) == ( nPropId &~0xc000 ) )
{
- rPropValue = pSortStruct[ i ];
- return sal_True;
+ rPropValue = mpSortStruct[ i ];
+ return true;
}
}
- return sal_False;
+ return false;
}
EscherProperties EscherPropertyContainer::GetOpts() const
{
EscherProperties aVector;
- for ( sal_uInt32 i = 0; i < nSortCount; ++i )
- aVector.push_back( pSortStruct[ i ] );
+ for ( sal_uInt32 i = 0; i < mnSortCount; ++i )
+ aVector.push_back( mpSortStruct[ i ] );
return aVector;
}
@@ -311,39 +314,39 @@ extern "C" int __LOADONCALLAPI EscherPropSortFunc( const void* p1, const void* p
void EscherPropertyContainer::Commit( SvStream& rSt, sal_uInt16 nVersion, sal_uInt16 nRecType )
{
- rSt << (sal_uInt16)( ( nCountCount << 4 ) | ( nVersion & 0xf ) ) << nRecType << nCountSize;
- if ( nSortCount )
+ rSt << (sal_uInt16)( ( mnCountCount << 4 ) | ( nVersion & 0xf ) ) << nRecType << mnCountSize;
+ if ( mnSortCount )
{
- qsort( pSortStruct, nSortCount, sizeof( EscherPropSortStruct ), EscherPropSortFunc );
+ qsort( mpSortStruct, mnSortCount, sizeof( EscherPropSortStruct ), EscherPropSortFunc );
sal_uInt32 i;
- for ( i = 0; i < nSortCount; i++ )
+ for ( i = 0; i < mnSortCount; i++ )
{
- sal_uInt32 nPropValue = pSortStruct[ i ].nPropValue;
- sal_uInt16 nPropId = pSortStruct[ i ].nPropId;
+ sal_uInt32 nPropValue = mpSortStruct[ i ].nPropValue;
+ sal_uInt16 nPropId = mpSortStruct[ i ].nPropId;
rSt << nPropId
<< nPropValue;
}
- if ( bHasComplexData )
+ if ( mbHasComplexData )
{
- for ( i = 0; i < nSortCount; i++ )
+ for ( i = 0; i < mnSortCount; i++ )
{
- if ( pSortStruct[ i ].pBuf )
- rSt.Write( pSortStruct[ i ].pBuf, pSortStruct[ i ].nPropSize );
+ if ( mpSortStruct[ i ].pBuf )
+ rSt.Write( mpSortStruct[ i ].pBuf, mpSortStruct[ i ].nPropSize );
}
}
}
}
-sal_Bool EscherPropertyContainer::IsFontWork() const
+bool EscherPropertyContainer::IsFontWork() const
{
sal_uInt32 nTextPathFlags = 0;
GetOpt( DFF_Prop_gtextFStrikethrough, nTextPathFlags );
return ( nTextPathFlags & 0x4000 ) != 0;
}
-sal_uInt32 EscherPropertyContainer::ImplGetColor( const sal_uInt32 nSOColor, sal_Bool bSwap )
+sal_uInt32 EscherPropertyContainer::ImplGetColor( const sal_uInt32 nSOColor, bool bSwap )
{
if ( bSwap )
{
@@ -436,7 +439,7 @@ void EscherPropertyContainer::CreateGradientProperties(
}
void EscherPropertyContainer::CreateGradientProperties(
- const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet , sal_Bool bTransparentGradient)
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet , bool bTransparentGradient)
{
::com::sun::star::uno::Any aAny;
::com::sun::star::awt::Gradient* pGradient = NULL;
@@ -451,14 +454,14 @@ void EscherPropertyContainer::CreateGradientProperties(
//Transparency gradient: Means the third setting in transparency page is set
if (bTransparentGradient && EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparenceGradient" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparenceGradient" ) ), false ) )
{
pGradient = (::com::sun::star::awt::Gradient*)aAny.getValue();
::com::sun::star::uno::Any aAnyTemp;
const rtl::OUString aPropName( String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) );
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAnyTemp, rXPropSet, aPropName, sal_False ) )
+ aAnyTemp, rXPropSet, aPropName, false ) )
{
::com::sun::star::drawing::FillStyle eFS;
if ( ! ( aAnyTemp >>= eFS ) )
@@ -467,17 +470,17 @@ void EscherPropertyContainer::CreateGradientProperties(
if ( eFS == ::com::sun::star::drawing::FillStyle_SOLID)
{
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAnyTemp, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), sal_False ) )
+ aAnyTemp, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), false ) )
{
- pGradient->StartColor = ImplGetColor( *((sal_uInt32*)aAnyTemp.getValue()), sal_False );
- pGradient->EndColor = ImplGetColor( *((sal_uInt32*)aAnyTemp.getValue()), sal_False );
+ pGradient->StartColor = ImplGetColor( *((sal_uInt32*)aAnyTemp.getValue()), false );
+ pGradient->EndColor = ImplGetColor( *((sal_uInt32*)aAnyTemp.getValue()), false );
}
}
//gradient and transparency.
else if( eFS == ::com::sun::star::drawing::FillStyle_GRADIENT )
{
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ), false ) )
pGradient = (::com::sun::star::awt::Gradient*)aAny.getValue();
}
}
@@ -485,7 +488,7 @@ void EscherPropertyContainer::CreateGradientProperties(
}
//Not transparency gradient
else if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ), false ) )
{
pGradient = (::com::sun::star::awt::Gradient*)aAny.getValue();
}
@@ -554,7 +557,7 @@ void EscherPropertyContainer::CreateGradientProperties(
//Transparency gradient
if (bTransparentGradient && EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparenceGradient" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparenceGradient" ) ), false ) )
{
pGradient = (::com::sun::star::awt::Gradient*)aAny.getValue();
if ( pGradient )
@@ -569,7 +572,7 @@ void EscherPropertyContainer::CreateGradientProperties(
void EscherPropertyContainer::CreateFillProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_Bool bEdge , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
+ bool bEdge , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
{
if ( rXShape.is() )
{
@@ -578,7 +581,7 @@ void EscherPropertyContainer::CreateFillProperties(
{
SfxItemSet aAttr( pObj->GetMergedItemSet() );
//tranparency with gradient. Means the third setting in transparency page is set
- sal_Bool bTransparentGradient = ( aAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SFX_ITEM_SET ) &&
+ bool bTransparentGradient = ( aAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SFX_ITEM_SET ) &&
( (const XFillFloatTransparenceItem&) aAttr.Get( XATTR_FILLFLOATTRANSPARENCE ) ).IsEnabled();
CreateFillProperties( rXPropSet, bEdge, bTransparentGradient );
}
@@ -587,7 +590,7 @@ void EscherPropertyContainer::CreateFillProperties(
void EscherPropertyContainer::CreateFillProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_Bool bEdge , sal_Bool bTransparentGradient)
+ bool bEdge , bool bTransparentGradient)
{
::com::sun::star::uno::Any aAny;
@@ -598,7 +601,7 @@ void EscherPropertyContainer::CreateFillProperties(
const rtl::OUString aPropName( String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) );
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, aPropName, sal_False ) )
+ aAny, rXPropSet, aPropName, false ) )
{
::com::sun::star::drawing::FillStyle eFS;
if ( ! ( aAny >>= eFS ) )
@@ -614,14 +617,14 @@ void EscherPropertyContainer::CreateFillProperties(
case ::com::sun::star::drawing::FillStyle_BITMAP :
{
- CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ), sal_True );
+ CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ), true );
AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
AddOpt( ESCHER_Prop_fillBackColor, nFillBackColor );
}
break;
case ::com::sun::star::drawing::FillStyle_HATCH :
{
- CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ), sal_True );
+ CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ), true );
}
break;
case ::com::sun::star::drawing::FillStyle_SOLID :
@@ -637,7 +640,7 @@ void EscherPropertyContainer::CreateFillProperties(
AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), false ) )
{
sal_uInt32 nFillColor = ImplGetColor( *((sal_uInt32*)aAny.getValue()) );
nFillBackColor = nFillColor ^ 0xffffff;
@@ -655,7 +658,7 @@ void EscherPropertyContainer::CreateFillProperties(
if ( eFS != ::com::sun::star::drawing::FillStyle_NONE )
{
sal_uInt16 nTransparency = ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparence" ) ), sal_True ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillTransparence" ) ), true ) )
? *((sal_Int16*)aAny.getValue() )
: 0;
if ( nTransparency )
@@ -667,7 +670,7 @@ void EscherPropertyContainer::CreateFillProperties(
void EscherPropertyContainer::CreateTextProperties(
const uno::Reference< beans::XPropertySet > & rXPropSet, sal_uInt32 nTextId,
- const sal_Bool bIsCustomShape, const sal_Bool bIsTextFrame )
+ const bool bIsCustomShape, const bool bIsTextFrame )
{
uno::Any aAny;
text::WritingMode eWM( text::WritingMode_LR_TB );
@@ -680,34 +683,34 @@ void EscherPropertyContainer::CreateTextProperties(
sal_Int32 nBottom ( 0 );
// used with normal shapes:
- sal_Bool bAutoGrowWidth ( sal_False );
- sal_Bool bAutoGrowHeight ( sal_False );
+ bool bAutoGrowWidth(false);
+ bool bAutoGrowHeight(false);
// used with ashapes:
- sal_Bool bWordWrap ( sal_False );
- sal_Bool bAutoGrowSize ( sal_False );
+ bool bWordWrap(false);
+ bool bAutoGrowSize(false);
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextWritingMode" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextWritingMode" ) ), true ) )
aAny >>= eWM;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) ), true ) )
aAny >>= eVA;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextHorizontalAdjust" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextHorizontalAdjust" ) ), true ) )
aAny >>= eHA;
if ( bIsCustomShape )
{
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextWordWrap" ) ), sal_False ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextWordWrap" ) ), false ) )
aAny >>= bWordWrap;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowHeight" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowHeight" ) ), true ) )
aAny >>= bAutoGrowSize;
}
else if ( bIsTextFrame )
{
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowWidth" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowWidth" ) ), true ) )
aAny >>= bAutoGrowWidth;
// i63936 not setting autogrowheight, because otherwise
// the minframeheight of the text will be ignored
//
-// if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowHeight" ) ), sal_True ) )
+// if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextAutoGrowHeight" ) ), true ) )
// aAny >>= bAutoGrowHeight;
}
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextLeftDistance" ) ) ) )
@@ -860,7 +863,7 @@ void EscherPropertyContainer::CreateTextProperties(
AddOpt( ESCHER_Prop_lTxid, nTextId );
}
-sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
+bool EscherPropertyContainer::GetLineArrow( const bool bLineStart,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
ESCHER_LineEnd& reLineEnd, sal_Int32& rnArrowLength, sal_Int32& rnArrowWidth )
{
@@ -872,30 +875,30 @@ sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
const String sLine ( bLineStart ? sLineStart : sLineEnd );
const String sLineName ( bLineStart ? sLineStartName : sLineEndName );
- sal_Bool bIsArrow = sal_False;
+ bool bIsArrow(false);
::com::sun::star::uno::Any aAny;
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, sLine, sal_False ) )
+ aAny, rXPropSet, sLine, false ) )
{
PolyPolygon aPolyPoly( EscherPropertyContainer::GetPolyPolygon( aAny ) );
if ( aPolyPoly.Count() && aPolyPoly[ 0 ].GetSize() )
{
- bIsArrow = sal_True;
+ bIsArrow = true;
reLineEnd = ESCHER_LineArrowEnd;
rnArrowLength = 1;
rnArrowWidth = 1;
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, sLineName, sal_False ) )
+ aAny, rXPropSet, sLineName, false ) )
{
String aArrowStartName = *(::rtl::OUString*)aAny.getValue();
rtl::OUString aApiName;
sal_Int16 nWhich = bLineStart ? XATTR_LINESTART : XATTR_LINEEND;
SvxUnogetApiNameForItem( nWhich, aArrowStartName, aApiName );
- sal_Bool bIsMapped = sal_True;
+ bool bIsMapped(true);
if ( aApiName.getLength() )
{
@@ -931,12 +934,12 @@ sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
else if ( aApiName.equalsAscii( "Arrow" ) )
reLineEnd = ESCHER_LineArrowEnd;
else
- bIsMapped = sal_False;
+ bIsMapped = false;
}
if ( !bIsMapped && aArrowStartName.GetTokenCount( ' ' ) == 2 )
{
- sal_Bool b = sal_True;
+ bool b(true);
String aArrowName( aArrowStartName.GetToken( 0, ' ' ) );
if ( aArrowName.EqualsAscii( "msArrowEnd" ) )
reLineEnd = ESCHER_LineArrowEnd;
@@ -949,7 +952,7 @@ sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
else if ( aArrowName.EqualsAscii( "msArrowOvalEnd" ) )
reLineEnd = ESCHER_LineArrowOvalEnd;
else
- b = sal_False;
+ b = false;
// now we have the arrow, and try to determine the arrow size;
if ( b )
@@ -968,7 +971,7 @@ sal_Bool EscherPropertyContainer::GetLineArrow( const sal_Bool bLineStart,
void EscherPropertyContainer::CreateLineProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_Bool bEdge )
+ bool bEdge )
{
::com::sun::star::uno::Any aAny;
sal_uInt32 nLineFlags = 0x80008;
@@ -977,24 +980,24 @@ void EscherPropertyContainer::CreateLineProperties(
sal_Int32 nArrowLength;
sal_Int32 nArrowWidth;
- sal_Bool bSwapLineEnds = sal_False;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CircleKind" ) ), sal_True ) )
+ bool bSwapLineEnds(false);
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CircleKind" ) ), true ) )
{
::com::sun::star::drawing::CircleKind eCircleKind;
if ( aAny >>= eCircleKind )
{
if ( eCircleKind == ::com::sun::star::drawing::CircleKind_ARC )
- bSwapLineEnds = sal_True;
+ bSwapLineEnds = true;
}
}
- if ( GetLineArrow( bSwapLineEnds ? sal_False : sal_True, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
+ if ( GetLineArrow( bSwapLineEnds ? false : true, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
{
AddOpt( ESCHER_Prop_lineStartArrowLength, nArrowLength );
AddOpt( ESCHER_Prop_lineStartArrowWidth, nArrowWidth );
AddOpt( ESCHER_Prop_lineStartArrowhead, eLineEnd );
nLineFlags |= 0x100010;
}
- if ( GetLineArrow( bSwapLineEnds ? sal_True : sal_False, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
+ if ( GetLineArrow( bSwapLineEnds ? true : false, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
{
AddOpt( ESCHER_Prop_lineEndArrowLength, nArrowLength );
AddOpt( ESCHER_Prop_lineEndArrowWidth, nArrowWidth );
@@ -1003,7 +1006,7 @@ void EscherPropertyContainer::CreateLineProperties(
}
// support LineCaps
- if(EscherPropertyValueHelper::GetPropertyValue(aAny, rXPropSet, String(RTL_CONSTASCII_USTRINGPARAM("LineCap")), sal_False))
+ if(EscherPropertyValueHelper::GetPropertyValue(aAny, rXPropSet, String(RTL_CONSTASCII_USTRINGPARAM("LineCap")), false))
{
::com::sun::star::drawing::LineCap aLineCap(com::sun::star::drawing::LineCap_BUTT);
@@ -1031,7 +1034,7 @@ void EscherPropertyContainer::CreateLineProperties(
}
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineStyle" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineStyle" ) ), false ) )
{
::com::sun::star::drawing::LineStyle eLS;
if ( aAny >>= eLS )
@@ -1045,7 +1048,7 @@ void EscherPropertyContainer::CreateLineProperties(
case ::com::sun::star::drawing::LineStyle_DASH :
{
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineDash" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineDash" ) ), false ) )
{
ESCHER_LineDashing eDash = ESCHER_LineSolid;
::com::sun::star::drawing::LineDash* pLineDash = (::com::sun::star::drawing::LineDash*)aAny.getValue();
@@ -1101,7 +1104,7 @@ void EscherPropertyContainer::CreateLineProperties(
}
}
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineColor" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineColor" ) ), false ) )
{
sal_uInt32 nLineColor = ImplGetColor( *((sal_uInt32*)aAny.getValue()) );
AddOpt( ESCHER_Prop_lineColor, nLineColor );
@@ -1110,7 +1113,7 @@ void EscherPropertyContainer::CreateLineProperties(
}
sal_uInt32 nLineSize = ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineWidth" ) ), sal_False ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineWidth" ) ), false ) )
? *((sal_uInt32*)aAny.getValue())
: 0;
if ( nLineSize > 1 )
@@ -1118,7 +1121,7 @@ void EscherPropertyContainer::CreateLineProperties(
ESCHER_LineJoin eLineJoin = ESCHER_LineJoinMiter;
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineJoint" ) ), sal_True ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineJoint" ) ), true ) )
{
::com::sun::star::drawing::LineJoint eLJ;
if ( aAny >>= eLJ )
@@ -1143,7 +1146,7 @@ void EscherPropertyContainer::CreateLineProperties(
AddOpt( ESCHER_Prop_lineJoinStyle, eLineJoin );
if ( EscherPropertyValueHelper::GetPropertyValue(
- aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineTransparence" ) ), sal_True ) )
+ aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LineTransparence" ) ), true ) )
{
sal_Int16 nTransparency = 0;
if ( aAny >>= nTransparency )
@@ -1151,7 +1154,7 @@ void EscherPropertyContainer::CreateLineProperties(
}
- if ( bEdge == sal_False )
+ if ( bEdge == false )
{
AddOpt( ESCHER_Prop_fFillOK, 0x1001 );
AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
@@ -1169,7 +1172,7 @@ static Size lcl_SizeToEmu(Size aPrefSize, MapMode aPrefMapMode)
}
void EscherPropertyContainer::ImplCreateGraphicAttributes( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- sal_uInt32 nBlibId, sal_Bool bCreateCroppingAttributes )
+ sal_uInt32 nBlibId, bool bCreateCroppingAttributes )
{
::com::sun::star::uno::Any aAny;
@@ -1225,11 +1228,11 @@ void EscherPropertyContainer::ImplCreateGraphicAttributes( const ::com::sun::sta
if ( nPicFlags )
AddOpt( ESCHER_Prop_pictureActive, nPicFlags );
- if ( bCreateCroppingAttributes && pGraphicProvider )
+ if ( bCreateCroppingAttributes && mpGraphicProvider )
{
Size aPrefSize;
MapMode aPrefMapMode;
- if ( pGraphicProvider->GetPrefSize( nBlibId, aPrefSize, aPrefMapMode ) )
+ if ( mpGraphicProvider->GetPrefSize( nBlibId, aPrefSize, aPrefMapMode ) )
{
Size aCropSize(lcl_SizeToEmu(aPrefSize, aPrefMapMode));
if ( aCropSize.Width() && aCropSize.Height() )
@@ -1266,21 +1269,21 @@ void EscherPropertyContainer::ImplCreateGraphicAttributes( const ::com::sun::sta
}
}
-sal_Bool EscherPropertyContainer::CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
+bool EscherPropertyContainer::CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
{
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
if ( aXPropSet.is() )
{
- sal_Bool bVal = false;
+ bool bVal(false);
::com::sun::star::uno::Any aAny;
sal_uInt32 nShapeAttr = 0;
- EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), sal_True );
+ EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), true );
if ( aAny >>= bVal )
{
if ( !bVal )
nShapeAttr |= 0x20002; // set fHidden = true
}
- EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ), sal_True );
+ EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ), true );
if ( aAny >>= bVal )
{
if ( !bVal )
@@ -1289,20 +1292,23 @@ sal_Bool EscherPropertyContainer::CreateShapeProperties( const ::com::sun::star:
if ( nShapeAttr )
AddOpt( ESCHER_Prop_fPrint, nShapeAttr );
}
- return sal_True;
+ return true;
}
-sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties(
+bool EscherPropertyContainer::CreateOLEGraphicProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
if ( rXShape.is() )
{
- SdrObject* pSdrOLE2( GetSdrObjectFromXShape( rXShape ) ); // SJ: leaving unoapi, because currently there is
- if ( pSdrOLE2 && pSdrOLE2->ISA( SdrOle2Obj ) ) // no access to the native graphic object
+ // SJ: leaving unoapi, because currently there is
+ SdrOle2Obj* pSdrOLE2(dynamic_cast< SdrOle2Obj* >(GetSdrObjectFromXShape(rXShape)));
+
+ if(pSdrOLE2) // no access to the native graphic object
{
- Graphic* pGraphic = ((SdrOle2Obj*)pSdrOLE2)->GetGraphic();
+ Graphic* pGraphic = pSdrOLE2->GetGraphic();
+
if ( pGraphic )
{
GraphicObject aGraphicObject( *pGraphic );
@@ -1314,16 +1320,16 @@ sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties(
return bRetValue;
}
-sal_Bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape ,const GraphicObject& rGraphicObj )
+bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape ,const GraphicObject& rGraphicObj )
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
ByteString aUniqueId( rGraphicObj.GetUniqueID() );
if ( aUniqueId.Len() )
{
AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect && aXPropSet.is() )
+ if ( mpGraphicProvider && mpPicOutStrm && mpObjectRange && aXPropSet.is() )
{
::com::sun::star::uno::Any aAny;
::com::sun::star::awt::Rectangle* pVisArea = NULL;
@@ -1332,61 +1338,89 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::sta
pVisArea = new ::com::sun::star::awt::Rectangle;
aAny >>= (*pVisArea);
}
- Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
- sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, pVisArea, NULL );
+
+ const basegfx::B2DRange aRange(0.0, 0.0, mpObjectRange->getWidth(), mpObjectRange->getHeight());
+ const sal_uInt32 nBlibId(mpGraphicProvider->GetBlibID(*mpPicOutStrm, aUniqueId, aRange, pVisArea, NULL));
+
if ( nBlibId )
{
- AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
- ImplCreateGraphicAttributes( aXPropSet, nBlibId, sal_False );
- bRetValue = sal_True;
+ AddOpt( ESCHER_Prop_pib, nBlibId, true );
+ ImplCreateGraphicAttributes( aXPropSet, nBlibId, false );
+ bRetValue = true;
}
delete pVisArea;
}
+
+ // TTTT: Check if this works; not sure if this is correct and on the correct place
+ // pShapeBoundRect -> mpObjectRange
+ //
+ //if ( mpGraphicProvider && mpPicOutStrm && pShapeBoundRect && aXPropSet.is() )
+ //{
+ // ::com::sun::star::uno::Any aAny;
+ // ::com::sun::star::awt::Rectangle* pVisArea = NULL;
+ // if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) )
+ // {
+ // pVisArea = new ::com::sun::star::awt::Rectangle;
+ // aAny >>= (*pVisArea);
+ // }
+ // Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
+ // sal_uInt32 nBlibId = mpGraphicProvider->GetBlibID( *mpPicOutStrm, aUniqueId, aRect, pVisArea, NULL );
+ // if ( nBlibId )
+ // {
+ // AddOpt( ESCHER_Prop_pib, nBlibId, true );
+ // ImplCreateGraphicAttributes( aXPropSet, nBlibId, false );
+ // bRetValue = true;
+ // }
+ // delete pVisArea;
+ //}
}
return bRetValue;
}
-sal_Bool EscherPropertyContainer::CreateMediaGraphicProperties(
+bool EscherPropertyContainer::CreateMediaGraphicProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
if ( rXShape.is() )
{
- SdrObject* pSdrMedia( GetSdrObjectFromXShape( rXShape ) ); // SJ: leaving unoapi, because currently there is
- if ( pSdrMedia && pSdrMedia->ISA( SdrMediaObj ) ) // no access to the native graphic object
+ // SJ: leaving unoapi, because currently there is no access to the native graphic object
+ SdrMediaObj* pSdrMediaObj = dynamic_cast< SdrMediaObj* >(GetSdrObjectFromXShape(rXShape));
+
+ if(pSdrMediaObj)
{
- GraphicObject aGraphicObject( ((SdrMediaObj*)pSdrMedia)->getGraphic() );
- bRetValue = CreateGraphicProperties( rXShape, aGraphicObject );
+ GraphicObject aGraphicObject(pSdrMediaObj->getGraphic());
+ bRetValue = CreateGraphicProperties(rXShape, aGraphicObject);
}
}
return bRetValue;
}
-sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const ByteString& rUniqueId )
+bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const ByteString& rUniqueId )
{
if( rUniqueId.Len() > 0 )
{
EscherGraphicProvider aProvider;
SvMemoryStream aMemStrm;
- Rectangle aRect;
- if ( aProvider.GetBlibID( aMemStrm, rUniqueId, aRect ) )
+ const basegfx::B2DRange aRange(0.0, 0.0, 1.0, 1.0);
+
+ if(aProvider.GetBlibID(aMemStrm, rUniqueId, aRange))
{
// grab BLIP from stream and insert directly as complex property
// ownership of stream memory goes to complex property
- aMemStrm.ObjectOwnsMemory( sal_False );
+ aMemStrm.ObjectOwnsMemory( false );
sal_uInt8* pBuf = (sal_uInt8*) aMemStrm.GetData();
sal_uInt32 nSize = aMemStrm.Seek( STREAM_SEEK_TO_END );
- AddOpt( ESCHER_Prop_fillBlip, sal_True, nSize, pBuf, nSize );
- return sal_True;
+ AddOpt( ESCHER_Prop_fillBlip, true, nSize, pBuf, nSize );
+ return true;
}
}
- return sal_False;
+ return false;
}
-sal_Bool EscherPropertyContainer::CreateEmbeddedBitmapProperties(
+bool EscherPropertyContainer::CreateEmbeddedBitmapProperties(
const ::rtl::OUString& rBitmapUrl, ::com::sun::star::drawing::BitmapMode eBitmapMode )
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
String aVndUrl( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) );
String aBmpUrl( rBitmapUrl );
xub_StrLen nIndex = aBmpUrl.Search( aVndUrl, 0 );
@@ -1412,57 +1446,82 @@ sal_Bool EscherPropertyContainer::CreateEmbeddedBitmapProperties(
namespace {
-GraphicObject lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground, const Rectangle& rRect )
+GraphicObject lclDrawHatch(
+ const ::com::sun::star::drawing::Hatch& rHatch,
+ const Color& rBackColor,
+ bool bFillBackground,
+ const basegfx::B2DRange& rRange)
{
- // #121183# For hatch, do no longer create a bitmap with the fixed size of 28x28 pixels. Also
- // do not create a bitmap in page size, that would explode file sizes (and have no good quality).
- // Better use a MetaFile graphic in page size; thus we have good quality due to vector format and
- // no bit file sizes.
- VirtualDevice aOut;
- GDIMetaFile aMtf;
-
- aOut.SetOutputSizePixel(Size(2, 2));
- aOut.EnableOutput(false);
- aOut.SetMapMode(MapMode(MAP_100TH_MM));
- aMtf.Clear();
- aMtf.Record(&aOut);
- aOut.SetLineColor();
- aOut.SetFillColor(bFillBackground ? rBackColor : Color(COL_TRANSPARENT));
- aOut.DrawRect(rRect);
- aOut.DrawHatch(PolyPolygon(rRect), Hatch((HatchStyle)rHatch.Style, Color(rHatch.Color), rHatch.Distance, (sal_uInt16)rHatch.Angle));
- aMtf.Stop();
- aMtf.WindStart();
- aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM));
- aMtf.SetPrefSize(rRect.GetSize());
-
- return GraphicObject(Graphic(aMtf));
+ if(!rRange.isEmpty())
+ {
+ // #121183# For hatch, do no longer create a bitmap with the fixed size of 28x28 pixels. Also
+ // do not create a bitmap in page size, that would explode file sizes (and have no good quality).
+ // Better use a MetaFile graphic in page size; thus we have good quality due to vector format and
+ // no bit file sizes.
+ VirtualDevice aOut;
+ GDIMetaFile aMtf;
+ const Rectangle aRect(
+ basegfx::fround(rRange.getMinX()), basegfx::fround(rRange.getMinY()),
+ basegfx::fround(rRange.getMaxX()), basegfx::fround(rRange.getMaxY()));
+
+ aOut.SetOutputSizePixel(Size(2, 2));
+ aOut.EnableOutput(false);
+ aOut.SetMapMode(MapMode(MAP_100TH_MM));
+ aMtf.Clear();
+ aMtf.Record(&aOut);
+ aOut.SetLineColor();
+
+ if(bFillBackground)
+ {
+ aOut.SetFillColor(rBackColor);
+ aOut.DrawRect(aRect);
+ }
+ else
+ {
+ aOut.SetFillColor();
+ }
+
+ aOut.DrawHatch(
+ PolyPolygon(aRect),
+ Hatch((HatchStyle)rHatch.Style,
+ Color(rHatch.Color),
+ rHatch.Distance,
+ (sal_uInt16)rHatch.Angle));
+ aMtf.Stop();
+ aMtf.WindStart();
+ aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM));
+ aMtf.SetPrefSize(aRect.GetSize());
+
+ return GraphicObject(Graphic(aMtf));
+ }
+
+ return GraphicObject();
}
} // namespace
-sal_Bool EscherPropertyContainer::CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground )
+bool EscherPropertyContainer::CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground )
{
- const Rectangle aRect(pShapeBoundRect ? *pShapeBoundRect : Rectangle(Point(0,0), Size(28000, 21000)));
- GraphicObject aGraphicObject = lclDrawHatch( rHatch, rBackColor, bFillBackground, aRect );
+ const basegfx::B2DRange aRange(mpObjectRange ? *mpObjectRange : basegfx::B2DRange(0.0, 0.0, 28000.0, 21000.0));
+ GraphicObject aGraphicObject = lclDrawHatch(rHatch, rBackColor, bFillBackground, aRange);
ByteString aUniqueId = aGraphicObject.GetUniqueID();
- sal_Bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
+ bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
if ( bRetValue )
AddOpt( ESCHER_Prop_fillType, ESCHER_FillTexture );
return bRetValue;
}
-sal_Bool EscherPropertyContainer::CreateGraphicProperties(
+bool EscherPropertyContainer::CreateGraphicProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- const String& rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes,
- const sal_Bool bFillBitmapModeAllowed )
+ const String& rSource, const bool bCreateFillBitmap, const bool bCreateCroppingAttributes,
+ const bool bFillBitmapModeAllowed )
{
- sal_Bool bRetValue = sal_False;
- sal_Bool bCreateFillStyles = sal_False;
-
- sal_Bool bMirrored = sal_False;
- sal_Bool bRotate = sal_True;
+ bool bRetValue(false);
+ bool bCreateFillStyles(false);
+ bool bMirrored(false);
+ bool bRotate(true);
sal_uInt16 nAngle = 0;
GraphicAttr* pGraphicAttr = NULL;
GraphicObject aGraphicObject;
@@ -1488,7 +1547,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
sal_uInt32 nAryLen = aSeq.getLength();
// the metafile is already rotated
- bRotate = sal_False;
+ bRotate = false;
if ( pAry && nAryLen )
{
@@ -1526,7 +1585,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
else if ( rSource == String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ) )
{
aGraphicUrl = *(::rtl::OUString*)aAny.getValue();
- bCreateFillStyles = sal_True;
+ bCreateFillStyles = true;
}
else if ( rSource == String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ) )
{
@@ -1535,26 +1594,28 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
{
Color aBackColor;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), sal_False ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), false ) )
{
- aBackColor = ImplGetColor( *((sal_uInt32*)aAny.getValue()), sal_False );
+ aBackColor = ImplGetColor( *((sal_uInt32*)aAny.getValue()), false );
}
bool bFillBackground = false;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBackground" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillBackground" ) ), true ) )
{
aAny >>= bFillBackground;
}
- const Rectangle aRect(Point(0, 0), pShapeBoundRect ? pShapeBoundRect->GetSize() : Size(28000, 21000));
- aGraphicObject = lclDrawHatch( aHatch, aBackColor, bFillBackground, aRect );
+ const basegfx::B2DRange aRange(
+ basegfx::B2DTuple(0.0, 0.0),
+ mpObjectRange ? mpObjectRange->getRange() : basegfx::B2DTuple(28000.0, 21000.0));
+ aGraphicObject = lclDrawHatch(aHatch, aBackColor, bFillBackground, aRange);
aUniqueId = aGraphicObject.GetUniqueID();
eBitmapMode = ::com::sun::star::drawing::BitmapMode_REPEAT;
bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE;
}
}
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsMirrored" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsMirrored" ) ), true ) )
aAny >>= bMirrored;
// #121074# transparency of graphic is not supported in MS formats, get and apply it
@@ -1586,13 +1647,13 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
if ( bCreateFillBitmap && bFillBitmapModeAllowed )
{
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapMode" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapMode" ) ), true ) )
aAny >>= eBitmapMode;
}
else
{
nAngle = bRotate && EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True )
+ String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), true )
? (sal_uInt16)( ( *((sal_Int32*)aAny.getValue() ) ) + 5 ) / 10
: 0;
}
@@ -1650,9 +1711,9 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
}
if ( !aUniqueId.Len() )
{
- if ( pGraphicProvider )
+ if ( mpGraphicProvider )
{
- const rtl::OUString& rBaseURI( pGraphicProvider->GetBaseURI() );
+ const rtl::OUString& rBaseURI( mpGraphicProvider->GetBaseURI() );
INetURLObject aBaseURI( rBaseURI );
if( aBaseURI.GetProtocol() == aTmp.GetProtocol() )
{
@@ -1713,32 +1774,32 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
{
sal_Int32 nSizeX = 0,nSizeY = 0,nOffsetX = 0,nOffsetY = 0,nPosOffsetX = 0,nPosOffsetY = 0;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapSizeX" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapSizeX" ) ), true ) )
{
aAny >>= nSizeX;
}
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapSizeY" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapSizeY" ) ), true ) )
{
aAny >>= nSizeY;
}
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapOffsetX" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapOffsetX" ) ), true ) )
{
aAny >>= nOffsetX;
}
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapOffsetY" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapOffsetY" ) ), true ) )
{
aAny >>= nOffsetY;
}
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapPositionOffsetX" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapPositionOffsetX" ) ), true ) )
{
aAny >>= nPosOffsetX;
}
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapPositionOffsetY" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapPositionOffsetY" ) ), true ) )
{
aAny >>= nPosOffsetY;
}
@@ -1750,44 +1811,44 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
else
AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
- if ( aUniqueId.Len() )
+ if(aUniqueId.Len() && mpObjectRange)
{
// write out embedded graphic
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect )
+ if(mpGraphicProvider && mpPicOutStrm)
{
- Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
- const sal_uInt32 nBlibId(pGraphicProvider->GetBlibID(*pPicOutStrm, aUniqueId, aRect, NULL, pGraphicAttr));
+ const basegfx::B2DRange aRange(0.0, 0.0, mpObjectRange->getWidth(), mpObjectRange->getHeight());
+ const sal_uInt32 nBlibId(mpGraphicProvider->GetBlibID(*mpPicOutStrm, aUniqueId, aRange, NULL, pGraphicAttr));
- if(nBlibId)
+ if ( nBlibId )
{
if(bCreateFillBitmap)
{
- AddOpt(ESCHER_Prop_fillBlip, nBlibId, sal_True);
+ AddOpt(ESCHER_Prop_fillBlip, nBlibId, true);
}
else
{
- AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
+ AddOpt( ESCHER_Prop_pib, nBlibId, true );
ImplCreateGraphicAttributes( rXPropSet, nBlibId, bCreateCroppingAttributes );
}
- bRetValue = sal_True;
+ bRetValue = true;
}
}
else
{
EscherGraphicProvider aProvider;
SvMemoryStream aMemStrm;
- Rectangle aRect;
+ const basegfx::B2DRange aRange(0.0, 0.0, mpObjectRange->getWidth(), mpObjectRange->getHeight());
- if ( aProvider.GetBlibID( aMemStrm, aUniqueId, aRect, NULL, pGraphicAttr ) )
+ if(aProvider.GetBlibID(aMemStrm, aUniqueId, aRange, NULL, pGraphicAttr))
{
// grab BLIP from stream and insert directly as complex property
// ownership of stream memory goes to complex property
- aMemStrm.ObjectOwnsMemory( sal_False );
+ aMemStrm.ObjectOwnsMemory( false );
sal_uInt8* pBuf = (sal_uInt8*) aMemStrm.GetData();
sal_uInt32 nSize = aMemStrm.Seek( STREAM_SEEK_TO_END );
- AddOpt( ESCHER_Prop_fillBlip, sal_True, nSize, pBuf, nSize );
- bRetValue = sal_True;
+ AddOpt( ESCHER_Prop_fillBlip, true, nSize, pBuf, nSize );
+ bRetValue = true;
}
}
}
@@ -1806,7 +1867,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
}
delete pGraphicAttr;
if ( bCreateFillStyles )
- CreateFillProperties( rXPropSet, sal_True );
+ CreateFillProperties( rXPropSet, true );
return bRetValue;
}
@@ -1824,11 +1885,11 @@ PolyPolygon EscherPropertyContainer::GetPolyPolygon( const ::com::sun::star::uno
if ( aAny >>= aXPropSet )
{
- sal_Bool bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygonBezier, sal_True );
+ bool bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygonBezier, true );
if ( !bHasProperty )
- bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygon, sal_True );
+ bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolyPolygon, true );
if ( !bHasProperty )
- bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolygon, sal_True );
+ bHasProperty = EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sPolygon, true );
if ( bHasProperty )
aRetPolyPoly = GetPolyPolygon( aAny );
}
@@ -1837,7 +1898,7 @@ PolyPolygon EscherPropertyContainer::GetPolyPolygon( const ::com::sun::star::uno
PolyPolygon EscherPropertyContainer::GetPolyPolygon( const ::com::sun::star::uno::Any& rAny )
{
- sal_Bool bNoError = sal_True;
+ bool bNoError(true);
Polygon aPolygon;
PolyPolygon aPolyPolygon;
@@ -1957,18 +2018,18 @@ PolyPolygon EscherPropertyContainer::GetPolyPolygon( const ::com::sun::star::uno
return aPolyPolygon;
}
-sal_Bool EscherPropertyContainer::CreatePolygonProperties(
+bool EscherPropertyContainer::CreatePolygonProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
sal_uInt32 nFlags,
- sal_Bool bBezier,
+ bool bBezier,
::com::sun::star::awt::Rectangle& rGeoRect,
Polygon* pPolygon )
{
static String sPolyPolygonBezier( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygonBezier" ) );
static String sPolyPolygon ( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygon" ) );
- sal_Bool bRetValue = sal_True;
- sal_Bool bLine = ( nFlags & ESCHER_CREATEPOLYGON_LINE ) != 0;
+ bool bRetValue(true);
+ bool bLine(nFlags & ESCHER_CREATEPOLYGON_LINE);
PolyPolygon aPolyPolygon;
@@ -1978,7 +2039,7 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
{
::com::sun::star::uno::Any aAny;
bRetValue = EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- ( bBezier ) ? sPolyPolygonBezier : sPolyPolygon, sal_True );
+ ( bBezier ) ? sPolyPolygonBezier : sPolyPolygon, true );
if ( bRetValue )
{
aPolyPolygon = GetPolyPolygon( aAny );
@@ -1999,14 +2060,14 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
rPoly[ 1 ].Y() - rPoly[ 0 ].Y() );
}
else
- bRetValue = sal_False;
+ bRetValue = false;
}
else
{
Polygon aPolygon;
sal_uInt16 i, j, k, nPoints, nBezPoints, nPolyCount = aPolyPolygon.Count();
- Rectangle aRect( aPolyPolygon.GetBoundRect() );
+ const Rectangle aRect( aPolyPolygon.GetBoundRect() );
rGeoRect = ::com::sun::star::awt::Rectangle( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight() );
for ( nBezPoints = nPoints = i = 0; i < nPolyCount; i++ )
@@ -2099,8 +2160,8 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
AddOpt( ESCHER_Prop_geoBottom, rGeoRect.Height );
AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- AddOpt( ESCHER_Prop_pVertices, sal_True, nVerticesBufSize - 6, (sal_uInt8*)pVerticesBuf, nVerticesBufSize );
- AddOpt( ESCHER_Prop_pSegmentInfo, sal_True, nSegmentBufSize, (sal_uInt8*)pSegmentBuf, nSegmentBufSize );
+ AddOpt( ESCHER_Prop_pVertices, true, nVerticesBufSize - 6, (sal_uInt8*)pVerticesBuf, nVerticesBufSize );
+ AddOpt( ESCHER_Prop_pSegmentInfo, true, nSegmentBufSize, (sal_uInt8*)pSegmentBuf, nSegmentBufSize );
}
}
return bRetValue;
@@ -2156,7 +2217,7 @@ sal_Int32 lcl_GetConnectorAdjustValue ( const XPolygon& rPoly, sal_uInt16 nIndex
if ( aEnd.X() == aStart.X() )
aEnd.X() = aStart.X() +4;
- sal_Bool bVertical = ( rPoly[1].X()-aStart.X() ) == 0 ;
+ bool bVertical((0 == rPoly[1].X() - aStart.X()));
//vertical and horizon alternate
if ( nIndex%2 == 1 ) bVertical = !bVertical;
aPt = rPoly[ nIndex + 1];
@@ -2211,7 +2272,7 @@ void lcl_Rotate(sal_Int32 nAngle, Point center, Point& pt)
Generally, draw the connector from top to bottom, from left to right when meet the adjust value,
but when (X1>X2 or Y1>Y2),the draw director must be reverse, FlipV or FlipH should be set to true.
*/
-sal_Bool lcl_GetAngle(Polygon &rPoly,sal_uInt16& rShapeFlags,sal_Int32& nAngle )
+bool lcl_GetAngle(Polygon &rPoly,sal_uInt16& rShapeFlags,sal_Int32& nAngle )
{
Point aStart = rPoly[0];
Point aEnd = rPoly[rPoly.GetSize()-1];
@@ -2252,11 +2313,11 @@ sal_Bool lcl_GetAngle(Polygon &rPoly,sal_uInt16& rShapeFlags,sal_Int32& nAngle )
nAngle *= 655;
nAngle += 0x8000;
nAngle &=~0xffff; // nAngle auf volle Gradzahl runden
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
-sal_Bool EscherPropertyContainer::CreateConnectorProperties(
+bool EscherPropertyContainer::CreateConnectorProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape,
EscherSolverContainer& rSolverContainer, ::com::sun::star::awt::Rectangle& rGeoRect,
sal_uInt16& rShapeType, sal_uInt16& rShapeFlags )
@@ -2267,7 +2328,7 @@ sal_Bool EscherPropertyContainer::CreateConnectorProperties(
static String sEdgeStartConnection ( RTL_CONSTASCII_USTRINGPARAM( "EdgeStartConnection" ) );
static String sEdgeEndConnection ( RTL_CONSTASCII_USTRINGPARAM( "EdgeEndConnection" ) );
static String sEdgePath ( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygonBezier") );
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
rShapeType = rShapeFlags = 0;
if ( rXShape.is() )
@@ -2278,7 +2339,7 @@ sal_Bool EscherPropertyContainer::CreateConnectorProperties(
::com::sun::star::uno::Any aAny( rXShape->queryInterface( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >*) 0 ) ));
if ( aAny >>= aXPropSet )
{
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeKind, sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, sEdgeKind, true ) )
{
::com::sun::star::drawing::ConnectorType eCt;
aAny >>= eCt;
@@ -2364,7 +2425,7 @@ sal_Bool EscherPropertyContainer::CreateConnectorProperties(
rShapeType = ( sal_uInt16 )( ESCHER_ShpInst_BentConnector2 + nAdjCount);
for ( sal_Int32 i = 0 ; i < nAdjCount; ++ i)
AddOpt( (sal_uInt16) ( ESCHER_Prop_adjustValue+i) , lcl_GetConnectorAdjustValue( aPoly, i ) );
- bRetValue = sal_True;
+ bRetValue = true;
}
sal_Int32 nAngle=0;
if (lcl_GetAngle(aPoly,rShapeFlags,nAngle ))
@@ -2388,8 +2449,8 @@ sal_Bool EscherPropertyContainer::CreateConnectorProperties(
}
break;
}
- CreateLineProperties( aXPropSet, sal_False );
- bRetValue = sal_True;
+ CreateLineProperties( aXPropSet, false );
+ bRetValue = true;
}
}
}
@@ -2398,12 +2459,12 @@ sal_Bool EscherPropertyContainer::CreateConnectorProperties(
return bRetValue;
}
-sal_Bool EscherPropertyContainer::CreateShadowProperties(
+bool EscherPropertyContainer::CreateShadowProperties(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet )
{
::com::sun::star::uno::Any aAny;
- sal_Bool bHasShadow = sal_False; // shadow is possible only if at least a fillcolor, linecolor or graphic is set
+ bool bHasShadow(false); // shadow is possible only if at least a fillcolor, linecolor or graphic is set
sal_uInt32 nLineFlags = 0; // default : shape has no line
sal_uInt32 nFillFlags = 0x10; // shape is filled
@@ -2411,13 +2472,13 @@ sal_Bool EscherPropertyContainer::CreateShadowProperties(
GetOpt( ESCHER_Prop_fNoFillHitTest, nFillFlags );
sal_uInt32 nDummy;
- sal_Bool bGraphic = GetOpt( DFF_Prop_pib, nDummy ) || GetOpt( DFF_Prop_pibName, nDummy ) || GetOpt( DFF_Prop_pibFlags, nDummy );
+ bool bGraphic = GetOpt( DFF_Prop_pib, nDummy ) || GetOpt( DFF_Prop_pibName, nDummy ) || GetOpt( DFF_Prop_pibFlags, nDummy );
sal_uInt32 nShadowFlags = 0x20000;
if ( ( nLineFlags & 8 ) || ( nFillFlags & 0x10 ) || bGraphic )
{
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "Shadow" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "Shadow" ) ), true ) )
{
if ( aAny >>= bHasShadow )
{
@@ -2425,16 +2486,16 @@ sal_Bool EscherPropertyContainer::CreateShadowProperties(
{
nShadowFlags |= 2;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowColor" ) ), sal_False ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "ShadowColor" ) ), false ) )
AddOpt( ESCHER_Prop_shadowColor, ImplGetColor( *((sal_uInt32*)aAny.getValue()) ) );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowXDistance" ) ), sal_False ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "ShadowXDistance" ) ), false ) )
AddOpt( ESCHER_Prop_shadowOffsetX, *((sal_Int32*)aAny.getValue()) * 360 );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowYDistance" ) ), sal_False ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "ShadowYDistance" ) ), false ) )
AddOpt( ESCHER_Prop_shadowOffsetY, *((sal_Int32*)aAny.getValue()) * 360 );
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "ShadowTransparence" ) ), sal_False ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "ShadowTransparence" ) ), false ) )
AddOpt( ESCHER_Prop_shadowOpacity, 0x10000 - (((sal_uInt32)*((sal_uInt16*)aAny.getValue())) * 655 ) );
}
}
@@ -2447,7 +2508,7 @@ sal_Bool EscherPropertyContainer::CreateShadowProperties(
// ---------------------------------------------------------------------------------------------
sal_Int32 EscherPropertyContainer::GetValueForEnhancedCustomShapeParameter( const ::com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter,
- const std::vector< sal_Int32 >& rEquationOrder, sal_Bool bAdjustTrans )
+ const std::vector< sal_Int32 >& rEquationOrder, bool bAdjustTrans )
{
sal_Int32 nValue = 0;
if ( rParameter.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
@@ -2476,7 +2537,7 @@ sal_Int32 EscherPropertyContainer::GetValueForEnhancedCustomShapeParameter( cons
if(bAdjustTrans)
{
sal_uInt32 nAdjustValue = 0;
- sal_Bool bGot = GetOpt((sal_uInt16)( DFF_Prop_adjustValue + nValue ), nAdjustValue);
+ bool bGot = GetOpt((sal_uInt16)( DFF_Prop_adjustValue + nValue ), nAdjustValue);
if(bGot) nValue = (sal_Int32)nAdjustValue;
}
}
@@ -2495,9 +2556,9 @@ sal_Int32 EscherPropertyContainer::GetValueForEnhancedCustomShapeParameter( cons
return nValue;
}
-sal_Bool GetValueForEnhancedCustomShapeHandleParameter( sal_Int32& nRetValue, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter )
+bool GetValueForEnhancedCustomShapeHandleParameter( sal_Int32& nRetValue, const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter )
{
- sal_Bool bSpecial = sal_False;
+ bool bSpecial(false);
nRetValue = 0;
if ( rParameter.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
{
@@ -2513,27 +2574,27 @@ sal_Bool GetValueForEnhancedCustomShapeHandleParameter( sal_Int32& nRetValue, co
case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION :
{
nRetValue += 3;
- bSpecial = sal_True;
+ bSpecial = true;
}
break;
case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT :
{
nRetValue += 0x100;
- bSpecial = sal_True;
+ bSpecial = true;
}
break;
case com::sun::star::drawing::EnhancedCustomShapeParameterType::TOP :
case com::sun::star::drawing::EnhancedCustomShapeParameterType::LEFT :
{
nRetValue = 0;
- bSpecial = sal_True;
+ bSpecial = true;
}
break;
case com::sun::star::drawing::EnhancedCustomShapeParameterType::RIGHT :
case com::sun::star::drawing::EnhancedCustomShapeParameterType::BOTTOM :
{
nRetValue = 1;
- bSpecial = sal_True;
+ bSpecial = true;
}
break;
case com::sun::star::drawing::EnhancedCustomShapeParameterType::NORMAL :
@@ -2614,9 +2675,9 @@ void ConvertEnhancedCustomShapeEquation( SdrObjCustomShape* pCustoShape,
}
}
-sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape , const MSO_SPT eShapeType )
+bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShape , const MSO_SPT eShapeType )
{
- sal_Bool bIsDefaultObject = sal_False;
+ bool bIsDefaultObject(false);
switch(eShapeType)
{
//if the custom shape is not default shape of ppt, return sal_Fasle;
@@ -2638,7 +2699,7 @@ sal_Bool EscherPropertyContainer::IsDefaultObject( SdrObjCustomShape* pCustoShap
&& pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_STRETCHY )
// && pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_HANDLES )
&& pCustoShape->IsDefaultGeometry( SdrObjCustomShape::DEFAULT_TEXTFRAMES ) )
- bIsDefaultObject = sal_True;
+ bIsDefaultObject = true;
}
return bIsDefaultObject;
@@ -2662,12 +2723,12 @@ void EscherPropertyContainer::LookForPolarHandles( const MSO_SPT eShapeType, sal
}
}
-sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue )
+bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue )
{
if ( rkProp.State != beans::PropertyState_DIRECT_VALUE )
- return sal_False;
+ return false;
- sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << nIndex ) ) != 0;
+ bool bUseFixedFloat(nAdjustmentsWhichNeedsToBeConverted & (1 << nIndex));
if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
{
double fValue(0.0);
@@ -2683,7 +2744,7 @@ sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::draw
nValue <<= 16;
}
- return sal_True;
+ return true;
}
void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeType, const uno::Reference< drawing::XShape > & rXShape )
@@ -2711,8 +2772,8 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
const beans::PropertyValue* pPathCoordinatesProp = NULL;
sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
uno::Sequence< beans::PropertyValues > aHandlesPropSeq;
- sal_Bool bPredefinedHandlesUsed = sal_True;
- sal_Bool bIsDefaultObject = IsDefaultObject( pCustoShape , eShapeType);
+ bool bPredefinedHandlesUsed(true);
+ bool bIsDefaultObject(IsDefaultObject(pCustoShape, eShapeType));
// convert property "Equations" into std::vector< EnhancedCustomShapeEquationEquation >
std::vector< EnhancedCustomShapeEquation > aEquations;
@@ -3041,7 +3102,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
nLightFaceFlags |= 2;
uno::Any aFillColor2;
if ( EscherPropertyValueHelper::GetPropertyValue( aFillColor2, aXPropSet,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillColor2" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillColor2" ) ), true ) )
{
sal_uInt32 nFillColor = ImplGetColor( *((sal_uInt32*)aFillColor2.getValue()) );
AddOpt( DFF_Prop_c3DExtrusionColor, nFillColor );
@@ -3084,12 +3145,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
}
sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_pFormulas, sal_True, nStreamSize - 6, pBuf, nStreamSize );
+ AddOpt( DFF_Prop_pFormulas, true, nStreamSize - 6, pBuf, nStreamSize );
}
else
{
sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_pFormulas, sal_True, 0, pBuf, 0 );
+ AddOpt( DFF_Prop_pFormulas, true, 0, pBuf, 0 );
}
}
}
@@ -3185,12 +3246,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
}
sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_connectorPoints, sal_True, nStreamSize - 6, pBuf, nStreamSize ); // -6
+ AddOpt( DFF_Prop_connectorPoints, true, nStreamSize - 6, pBuf, nStreamSize ); // -6
}
else
{
sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_connectorPoints, sal_True, 0, pBuf, 0 );
+ AddOpt( DFF_Prop_connectorPoints, true, 0, pBuf, 0 );
}
}
}
@@ -3306,12 +3367,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
}
sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_pSegmentInfo, sal_False, nStreamSize - 6, pBuf, nStreamSize );
+ AddOpt( DFF_Prop_pSegmentInfo, false, nStreamSize - 6, pBuf, nStreamSize );
}
else
{
sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_pSegmentInfo, sal_True, 0, pBuf, 0 );
+ AddOpt( DFF_Prop_pSegmentInfo, true, 0, pBuf, 0 );
}
}
}
@@ -3364,12 +3425,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
}
sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_textRectangles, sal_True, nStreamSize - 6, pBuf, nStreamSize );
+ AddOpt( DFF_Prop_textRectangles, true, nStreamSize - 6, pBuf, nStreamSize );
}
else
{
sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_textRectangles, sal_True, 0, pBuf, 0 );
+ AddOpt( DFF_Prop_textRectangles, true, 0, pBuf, 0 );
}
}
}
@@ -3475,7 +3536,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
AddOpt( DFF_Prop_gtextFont, aFontName );
sal_Int16 nCharScaleWidth = 100;
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharScaleWidth" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharScaleWidth" ) ), true ) )
{
if ( aAny >>= nCharScaleWidth )
{
@@ -3486,7 +3547,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
}
}
}
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), true ) )
{
float fCharHeight = 0.0;
if ( aAny >>= fCharHeight )
@@ -3495,7 +3556,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
AddOpt(ESCHER_Prop_gtextSize, nTextSize);
}
}
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharKerning" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharKerning" ) ), true ) )
{
sal_Int16 nCharKerning = sal_Int16();
if ( aAny >>= nCharKerning )
@@ -3507,7 +3568,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
nTextPathFlags &=~0x1000;
}
}
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), true ) )
{
awt::FontSlant eFontSlant;
if ( aAny >>= eFontSlant )
@@ -3519,7 +3580,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
nTextPathFlags &=~0x10;
}
}
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), true ) )
{
float fFontWidth = 0;
if ( aAny >>= fFontWidth )
@@ -3532,7 +3593,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
}
}
//export gTextAlign attr
- if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextHorizontalAdjust" ) ), sal_True ) )
+ if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextHorizontalAdjust" ) ), true ) )
{
MSO_GeoTextAlign gTextAlign = mso_alignTextCenter;
// SdrFitToSizeType eFTS( ((SdrTextFitToSizeTypeItem&)pCustoShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() );
@@ -3582,7 +3643,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
{
if ( !bIsDefaultObject )
{
- bPredefinedHandlesUsed = sal_False;
+ bPredefinedHandlesUsed = false;
if ( rProp.Value >>= aHandlesPropSeq )
{
sal_uInt16 nElements = (sal_uInt16)aHandlesPropSeq.getLength();
@@ -3619,7 +3680,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
const rtl::OUString sMirroredY ( RTL_CONSTASCII_USTRINGPARAM( "MirroredY" ) );
const rtl::OUString sSwitched ( RTL_CONSTASCII_USTRINGPARAM( "Switched" ) );
const rtl::OUString sPolar ( RTL_CONSTASCII_USTRINGPARAM( "Polar" ) );
- // const rtl::OUString sMap ( RTL_CONSTASCII_USTRINGPARAM( "Map" ) );
+// const rtl::OUString sMap ( RTL_CONSTASCII_USTRINGPARAM( "Map" ) );
const rtl::OUString sRadiusRangeMinimum ( RTL_CONSTASCII_USTRINGPARAM( "RadiusRangeMinimum" ) );
const rtl::OUString sRadiusRangeMaximum ( RTL_CONSTASCII_USTRINGPARAM( "RadiusRangeMaximum" ) );
const rtl::OUString sRangeXMinimum ( RTL_CONSTASCII_USTRINGPARAM( "RangeXMinimum" ) );
@@ -3771,12 +3832,12 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
}
sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_Handles, sal_True, nStreamSize - 6, pBuf, nStreamSize );
+ AddOpt( DFF_Prop_Handles, true, nStreamSize - 6, pBuf, nStreamSize );
}
else
{
sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_Handles, sal_True, 0, pBuf, 0 );
+ AddOpt( DFF_Prop_Handles, true, 0, pBuf, 0 );
}
}
}
@@ -3819,19 +3880,19 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
<< nElementSize;
for( j = 0; j < nElements; j++ )
{
- sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].First, aEquationOrder, sal_True );
- sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].Second, aEquationOrder, sal_True );
+ sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].First, aEquationOrder, true );
+ sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].Second, aEquationOrder, true );
aOut << X
<< Y;
}
sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ];
memcpy( pBuf, aOut.GetData(), nStreamSize );
- AddOpt( DFF_Prop_pVertices, sal_True, nStreamSize - 6, pBuf, nStreamSize ); // -6
+ AddOpt( DFF_Prop_pVertices, true, nStreamSize - 6, pBuf, nStreamSize ); // -6
}
else
{
sal_uInt8* pBuf = new sal_uInt8[ 1 ];
- AddOpt( DFF_Prop_pVertices, sal_True, 0, pBuf, 0 );
+ AddOpt( DFF_Prop_pVertices, true, 0, pBuf, 0 );
}
}
}
@@ -3841,10 +3902,9 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
// ---------------------------------------------------------------------------------------------
-MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags, rtl::OUString& rShapeType )
+MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawing::XShape > & rXShape, rtl::OUString& rShapeType )
{
MSO_SPT eShapeType = mso_sptNil;
- nMirrorFlags = 0;
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
if ( aXPropSet.is() )
{
@@ -3864,18 +3924,21 @@ MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawi
if ( rProp.Value >>= rShapeType )
eShapeType = EnhancedCustomShapeTypeNames::Get( rShapeType );
}
- else if ( rProp.Name.equalsAscii( "MirroredX" ) )
- {
- sal_Bool bMirroredX = sal_Bool();
- if ( ( rProp.Value >>= bMirroredX ) && bMirroredX )
- nMirrorFlags |= SHAPEFLAG_FLIPH;
- }
- else if ( rProp.Name.equalsAscii( "MirroredY" ) )
- {
- sal_Bool bMirroredY = sal_Bool();
- if ( ( rProp.Value >>= bMirroredY ) && bMirroredY )
- nMirrorFlags |= SHAPEFLAG_FLIPV;
- }
+ // TTTT: Need to remove "MirroredX" and "MirroredY" attributes
+ // for CustomShapeGeometry completely
+ //
+ //else if ( rProp.Name.equalsAscii( "MirroredX" ) )
+ //{
+ // sal_Bool bMirroredX = sal_Bool();
+ // if ( ( rProp.Value >>= bMirroredX ) && bMirroredX )
+ // nMirrorFlags |= SHAPEFLAG_FLIPH;
+ //}
+ //else if ( rProp.Name.equalsAscii( "MirroredY" ) )
+ //{
+ // sal_Bool bMirroredY = sal_Bool();
+ // if ( ( rProp.Value >>= bMirroredY ) && bMirroredY )
+ // nMirrorFlags |= SHAPEFLAG_FLIPV;
+ //}
}
}
}
@@ -3886,42 +3949,34 @@ MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawi
return eShapeType;
}
-MSO_SPT EscherPropertyContainer::GetCustomShapeType( const uno::Reference< drawing::XShape > & rXShape, sal_uInt32& nMirrorFlags )
-{
- rtl::OUString aShapeType;
- return GetCustomShapeType( rXShape, nMirrorFlags, aShapeType );
-}
-
// ---------------------------------------------------------------------------------------------
//Implement for form control export
-sal_Bool EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape)
+bool EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape)
{
SdrObject* pShape = GetSdrObjectFromXShape( rXShape );
if ( pShape )
{
- SdrModel* pMod = pShape->GetModel();
- Graphic aGraphic(SdrExchangeView::GetObjGraphic( pMod, pShape));
-
- GraphicObject aGraphicObject = aGraphic;
+ Graphic aGraphic(GetObjGraphic(*pShape));
+ GraphicObject aGraphicObject = aGraphic;
ByteString aUniqueId = aGraphicObject.GetUniqueID();
if ( aUniqueId.Len() )
{
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect )
+ if(mpGraphicProvider && mpPicOutStrm && mpObjectRange)
{
- Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
+ const basegfx::B2DRange aRange(0.0, 0.0, mpObjectRange->getWidth(), mpObjectRange->getHeight());
+ const sal_uInt32 nBlibId(mpGraphicProvider->GetBlibID(*mpPicOutStrm, aUniqueId, aRange, NULL));
- sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, NULL );
if ( nBlibId )
{
- AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
- ImplCreateGraphicAttributes( rXPropSet, nBlibId, sal_False );
- return sal_True;
+ AddOpt( ESCHER_Prop_pib, nBlibId, true );
+ ImplCreateGraphicAttributes( rXPropSet, nBlibId, false );
+ return true;
}
}
}
}
- return sal_False;
+ return false;
}
@@ -3939,14 +3994,14 @@ EscherPersistTable::~EscherPersistTable()
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherPersistTable::PtIsID( sal_uInt32 nID )
+bool EscherPersistTable::PtIsID( sal_uInt32 nID )
{
for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
{
if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
// ---------------------------------------------------------------------------------------------
@@ -4016,16 +4071,16 @@ sal_uInt32 EscherPersistTable::PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOf
return 0;
}
-sal_Bool EscherPropertyValueHelper::GetPropertyValue(
+bool EscherPropertyValueHelper::GetPropertyValue(
::com::sun::star::uno::Any& rAny,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
const String& rString,
- sal_Bool bTestPropertyAvailability )
+ bool bTestPropertyAvailability )
{
- sal_Bool bRetValue = sal_True;
+ bool bRetValue(true);
if ( bTestPropertyAvailability )
{
- bRetValue = sal_False;
+ bRetValue = false;
try
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
@@ -4035,7 +4090,7 @@ sal_Bool EscherPropertyValueHelper::GetPropertyValue(
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = sal_False;
+ bRetValue = false;
}
}
if ( bRetValue )
@@ -4044,11 +4099,11 @@ sal_Bool EscherPropertyValueHelper::GetPropertyValue(
{
rAny = rXPropSet->getPropertyValue( rString );
if ( !rAny.hasValue() )
- bRetValue = sal_False;
+ bRetValue = false;
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = sal_False;
+ bRetValue = false;
}
}
return bRetValue;
@@ -4086,7 +4141,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
mnSizeExtra ( 0 ),
maPrefSize ( rObject.GetPrefSize() ),
maPrefMapMode ( rObject.GetPrefMapMode() ),
- mbIsEmpty ( sal_True )
+ mbIsEmpty ( true )
{
mbIsNativeGraphicPossible = ( pGraphicAttr == NULL );
meBlibType = UNKNOWN;
@@ -4123,12 +4178,12 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
<< pGraphicAttr->GetChannelG()
<< pGraphicAttr->GetChannelB()
<< pGraphicAttr->GetGamma()
- << (sal_Bool)( pGraphicAttr->IsInvert() == sal_True )
+ << static_cast< sal_Bool >(pGraphicAttr->IsInvert())
<< pGraphicAttr->GetTransparency();
mnIdentifier[ 1 ] = rtl_crc32( 0, aSt.GetData(), aSt.Tell() );
}
else
- mbIsNativeGraphicPossible = sal_True;
+ mbIsNativeGraphicPossible = true;
}
sal_uInt32 i, nTmp, n1, n2;
n1 = n2 = 0;
@@ -4143,13 +4198,13 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
}
mnIdentifier[ 2 ] = n1;
mnIdentifier[ 3 ] = n2;
- mbIsEmpty = sal_False;
+ mbIsEmpty = false;
}
};
// ---------------------------------------------------------------------------------------------
-void EscherBlibEntry::WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize )
+void EscherBlibEntry::WriteBlibEntry( SvStream& rSt, bool bWritePictureOffset, sal_uInt32 nResize )
{
sal_uInt32 nPictureOffset = ( bWritePictureOffset ) ? mnPictureOffset : 0;
@@ -4183,14 +4238,14 @@ EscherBlibEntry::~EscherBlibEntry()
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherBlibEntry::operator==( const EscherBlibEntry& rEscherBlibEntry ) const
+bool EscherBlibEntry::operator==( const EscherBlibEntry& rEscherBlibEntry ) const
{
for ( int i = 0; i < 3; i++ )
{
if ( mnIdentifier[ i ] != rEscherBlibEntry.mnIdentifier[ i ] )
- return sal_False;
+ return false;
}
- return sal_True;
+ return true;
}
// ---------------------------------------------------------------------------------------------
@@ -4248,13 +4303,13 @@ sal_uInt32 EscherGraphicProvider::GetBlibStoreContainerSize( SvStream* pMergePic
return nSize;
}
-sal_Bool EscherGraphicProvider::WriteBlibStoreEntry(SvStream& rSt,
- sal_uInt32 nBlipId, sal_Bool bWritePictureOffSet, sal_uInt32 nResize)
+bool EscherGraphicProvider::WriteBlibStoreEntry(SvStream& rSt,
+ sal_uInt32 nBlipId, bool bWritePictureOffSet, sal_uInt32 nResize)
{
if (nBlipId > mnBlibEntrys || nBlipId == 0)
- return sal_False;
+ return false;
mpBlibEntrys[nBlipId-1]->WriteBlibEntry(rSt, bWritePictureOffSet, nResize);
- return sal_True;
+ return true;
}
void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pMergePicStreamBSE )
@@ -4277,7 +4332,7 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
ESCHER_BlibType nBlibType = pBlibEntry->meBlibType;
nBlipSize = pBlibEntry->mnSize + pBlibEntry->mnSizeExtra;
- pBlibEntry->WriteBlibEntry( rSt, sal_False, nBlipSize );
+ pBlibEntry->WriteBlibEntry( rSt, false, nBlipSize );
// BLIP
pMergePicStreamBSE->Seek( pBlibEntry->mnPictureOffset );
@@ -4310,14 +4365,14 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
else
{
for ( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
- mpBlibEntrys[ i ]->WriteBlibEntry( rSt, sal_True );
+ mpBlibEntrys[ i ]->WriteBlibEntry( rSt, true );
}
}
}
-sal_Bool EscherGraphicProvider::GetPrefSize( const sal_uInt32 nBlibId, Size& rPrefSize, MapMode& rPrefMapMode )
+bool EscherGraphicProvider::GetPrefSize( const sal_uInt32 nBlibId, Size& rPrefSize, MapMode& rPrefMapMode )
{
- sal_Bool bInRange = nBlibId && ( ( nBlibId - 1 ) < mnBlibEntrys );
+ bool bInRange = nBlibId && ( ( nBlibId - 1 ) < mnBlibEntrys );
if ( bInRange )
{
EscherBlibEntry* pEntry = mpBlibEntrys[ nBlibId - 1 ];
@@ -4327,8 +4382,12 @@ sal_Bool EscherGraphicProvider::GetPrefSize( const sal_uInt32 nBlibId, Size& rPr
return bInRange;
}
-sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteString& rId,
- const Rectangle& /* rBoundRect */, const com::sun::star::awt::Rectangle* pVisArea, const GraphicAttr* pGraphicAttr )
+sal_uInt32 EscherGraphicProvider::GetBlibID(
+ SvStream& rPicOutStrm,
+ const ByteString& rId,
+ const basegfx::B2DRange& /*rObjectRange*/,
+ const com::sun::star::awt::Rectangle* pVisArea,
+ const GraphicAttr* pGraphicAttr )
{
sal_uInt32 nBlibId = 0;
GraphicObject aGraphicObject( rId );
@@ -4346,7 +4405,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
}
}
- sal_Bool bUseNativeGraphic( sal_False );
+ bool bUseNativeGraphic( false );
Graphic aGraphic( aGraphicObject.GetTransformedGraphic( pGraphicAttr ) );
GfxLink aGraphicLink;
@@ -4392,7 +4451,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
default: break;
}
if ( p_EscherBlibEntry->meBlibType != UNKNOWN )
- bUseNativeGraphic = sal_True;
+ bUseNativeGraphic = true;
}
}
if ( !bUseNativeGraphic )
@@ -4598,7 +4657,7 @@ sal_uInt32 EscherConnectorListEntry::GetClosestPoint( const Polygon& rPoly, cons
// 2 ->Bottom 4 ->Bottom
// 3 ->Right 6 ->Right
-sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
+sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst )
{
sal_uInt32 nRule = 0;
@@ -4717,12 +4776,11 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
if ( aType == "drawing.Custom" )
{
- SdrObject* pCustoShape( GetSdrObjectFromXShape( aXShape ) );
- if ( pCustoShape && pCustoShape->ISA( SdrObjCustomShape ) )
- {
- SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)
- pCustoShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
+ SdrObjCustomShape* pCustoShape( dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape( aXShape ) ) );
+ if ( pCustoShape )
+ {
+ SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustoShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
const rtl::OUString sPath( RTL_CONSTASCII_USTRINGPARAM( "Path" ) );
const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
const rtl::OUString sGluePointType( RTL_CONSTASCII_USTRINGPARAM( "GluePointType" ) );
@@ -4752,8 +4810,8 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
for ( nNum = 0; nNum < nAnz; nNum++ )
{
const SdrGluePoint& rGP = (*pList)[ nNum ];
- Point aPt( rGP.GetAbsolutePos( *pCustoShape ) );
- aPoly.Insert( POLY_APPEND, aPt );
+ const basegfx::B2DPoint aPt( rGP.GetAbsolutePos( sdr::legacy::GetSnapRange(*pCustoShape) ) );
+ aPoly.Insert( POLY_APPEND, Point(basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY())) );
}
nRule = GetClosestPoint( aPoly, aRefPoint );
bRectangularConnection = false;
@@ -4762,15 +4820,16 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
}
else if ( nGluePointType == com::sun::star::drawing::EnhancedCustomShapeGluePointType::SEGMENTS )
{
- SdrObject* pPoly = pCustoShape->DoConvertToPolyObj( sal_True, true );
- if ( pPoly && pPoly->ISA( SdrPathObj ) )
+ SdrPathObj* pPoly = dynamic_cast< SdrPathObj* >(pCustoShape->DoConvertToPolygonObject(true, true));
+
+ if ( pPoly )
{
sal_Int16 a, b, nIndex = 0;
sal_uInt32 nDistance = 0xffffffff;
// #i74631# use explicit constructor here. Also XPolyPolygon is not necessary,
// reducing to PolyPolygon
- const PolyPolygon aPolyPoly(((SdrPathObj*)pPoly)->GetPathPoly());
+ const PolyPolygon aPolyPoly(pPoly->getB2DPolyPolygonInObjectCoordinates());
for ( a = 0; a < aPolyPoly.Count(); a++ )
{
@@ -4810,7 +4869,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
aPoly[ 3 ] = Point( aRect.Right(), aCenter.Y() );
sal_Int32 nAngle = ( EscherPropertyValueHelper::GetPropertyValue( aAny,
- aPropertySet, String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True ) )
+ aPropertySet, String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), true ) )
? *((sal_Int32*)aAny.getValue() )
: 0;
if ( nAngle )
@@ -4884,9 +4943,9 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm )
if ( aConnectorRule.nShapeC )
{
if ( aConnectorRule.nShapeA )
- aConnectorRule.ncptiA = pPtr->GetConnectorRule( sal_True );
+ aConnectorRule.ncptiA = pPtr->GetConnectorRule( true );
if ( aConnectorRule.nShapeB )
- aConnectorRule.ncptiB = pPtr->GetConnectorRule( sal_False );
+ aConnectorRule.ncptiB = pPtr->GetConnectorRule( false );
}
rStrm << (sal_uInt32)( ( ESCHER_ConnectorRule << 16 ) | 1 ) // atom hd
<< (sal_uInt32)24 //
@@ -5041,8 +5100,8 @@ EscherEx::EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm ) :
mnGroupLevel ( 0 ),
mnHellLayerId ( USHRT_MAX ),
- mbEscherSpgr ( sal_False ),
- mbEscherDg ( sal_False )
+ mbEscherSpgr ( false ),
+ mbEscherDg ( false )
{
mnStrmStartOfs = mpOutStrm->Tell();
mpImplEscherExSdr.reset( new ImplEscherExSdr( *this ) );
@@ -5152,7 +5211,7 @@ void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom )
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::SeekBehindRecHeader( sal_uInt16 nRecType )
+bool EscherEx::SeekBehindRecHeader( sal_uInt16 nRecType )
{
sal_uInt32 nOldPos, nStreamEnd, nType, nSize;
@@ -5163,12 +5222,12 @@ sal_Bool EscherEx::SeekBehindRecHeader( sal_uInt16 nRecType )
{
*mpOutStrm >> nType >> nSize;
if ( ( nType >> 16 ) == nRecType )
- return sal_True;
+ return true;
if ( ( nType & 0xf ) != 0xf )
mpOutStrm->SeekRel( nSize );
}
mpOutStrm->Seek( nOldPos );
- return sal_False;
+ return false;
}
// ---------------------------------------------------------------------------------------------
@@ -5190,7 +5249,7 @@ sal_uInt32 EscherEx::GetPersistOffset( sal_uInt32 nKey )
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::DoSeek( sal_uInt32 nKey )
+bool EscherEx::DoSeek( sal_uInt32 nKey )
{
sal_uInt32 nPos = PtGetOffsetByID( nKey );
if ( nPos )
@@ -5198,25 +5257,25 @@ sal_Bool EscherEx::DoSeek( sal_uInt32 nKey )
else
{
if (! PtIsID( nKey ) )
- return sal_False;
+ return false;
mpOutStrm->Seek( 0 );
}
- return sal_True;
+ return true;
}
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::SeekToPersistOffset( sal_uInt32 nKey )
+bool EscherEx::SeekToPersistOffset( sal_uInt32 nKey )
{
return DoSeek( ESCHER_Persist_PrivateEntry | nKey );
}
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue )
+bool EscherEx::InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue )
{
sal_uInt32 nOldPos = mpOutStrm->Tell();
- sal_Bool bRetValue = SeekToPersistOffset( nKey );
+ bool bRetValue(SeekToPersistOffset(nKey));
if ( bRetValue )
{
*mpOutStrm << nValue;
@@ -5253,7 +5312,7 @@ void EscherEx::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance )
{
if ( !mbEscherDg )
{
- mbEscherDg = sal_True;
+ mbEscherDg = true;
mnCurrentDg = mxGlobal->GenerateDrawingId();
AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
@@ -5268,7 +5327,7 @@ void EscherEx::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance )
{
if ( mbEscherDg )
{
- mbEscherSpgr = sal_True;
+ mbEscherSpgr = true;
}
}
break;
@@ -5298,7 +5357,7 @@ void EscherEx::CloseContainer()
{
if ( mbEscherDg )
{
- mbEscherDg = sal_False;
+ mbEscherDg = false;
if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
*mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
}
@@ -5309,7 +5368,7 @@ void EscherEx::CloseContainer()
{
if ( mbEscherSpgr )
{
- mbEscherSpgr = sal_False;
+ mbEscherSpgr = false;
}
}
@@ -5351,24 +5410,28 @@ void EscherEx::AddAtom( sal_uInt32 nAtomSize, sal_uInt16 nRecType, int nRecVersi
// ---------------------------------------------------------------------------------------------
-void EscherEx::AddChildAnchor( const Rectangle& rRect )
+void EscherEx::AddChildAnchor(
+ const basegfx::B2DRange& rObjectRange)
{
AddAtom( 16, ESCHER_ChildAnchor );
- *mpOutStrm << (sal_Int32)rRect.Left()
- << (sal_Int32)rRect.Top()
- << (sal_Int32)rRect.Right()
- << (sal_Int32)rRect.Bottom();
+ *mpOutStrm << (sal_Int32)basegfx::fround(rObjectRange.getMinX())
+ << (sal_Int32)basegfx::fround(rObjectRange.getMinY())
+ << (sal_Int32)basegfx::fround(rObjectRange.getMaxX())
+ << (sal_Int32)basegfx::fround(rObjectRange.getMaxY());
}
// ---------------------------------------------------------------------------------------------
-void EscherEx::AddClientAnchor( const Rectangle& rRect )
+void EscherEx::AddClientAnchor(
+ const basegfx::B2DRange& rObjectRange)
{
AddAtom( 8, ESCHER_ClientAnchor );
- *mpOutStrm << (sal_Int16)rRect.Top()
- << (sal_Int16)rRect.Left()
- << (sal_Int16)( rRect.GetWidth() + rRect.Left() )
- << (sal_Int16)( rRect.GetHeight() + rRect.Top() );
+ // Askes SJ, here it is CORRECT to first write Y, then X (!)
+ // Do NOT change this, it's NOT a typo (!)
+ *mpOutStrm << (sal_Int16)basegfx::fround(rObjectRange.getMinY())
+ << (sal_Int16)basegfx::fround(rObjectRange.getMinX())
+ << (sal_Int16)basegfx::fround(rObjectRange.getMaxX())
+ << (sal_Int16)basegfx::fround(rObjectRange.getMaxY());
}
// ---------------------------------------------------------------------------------------------
@@ -5380,21 +5443,26 @@ EscherExHostAppData* EscherEx::EnterAdditionalTextGroup()
// ---------------------------------------------------------------------------------------------
-sal_uInt32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRect )
+sal_uInt32 EscherEx::EnterGroup(
+ const String& rShapeName,
+ const basegfx::B2DRange* pObjectRange)
{
- Rectangle aRect;
- if( pBoundRect )
- aRect = *pBoundRect;
+ basegfx::B2DRange aObjectRange(0.0, 0.0, 1.0, 1.0);
+
+ if(pObjectRange)
+ {
+ aObjectRange = *pObjectRange;
+ }
OpenContainer( ESCHER_SpgrContainer );
OpenContainer( ESCHER_SpContainer );
AddAtom( 16, ESCHER_Spgr, 1 );
PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel,
mpOutStrm->Tell() );
- *mpOutStrm << (sal_Int32)aRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (sal_Int32)aRect.Top()
- << (sal_Int32)aRect.Right()
- << (sal_Int32)aRect.Bottom();
+ *mpOutStrm << (sal_Int32)basegfx::fround(aObjectRange.getMinX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)basegfx::fround(aObjectRange.getMinY())
+ << (sal_Int32)basegfx::fround(aObjectRange.getMaxX())
+ << (sal_Int32)basegfx::fround(aObjectRange.getMaxY());
sal_uInt32 nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
@@ -5411,15 +5479,15 @@ sal_uInt32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBou
if( rShapeName.Len() > 0 )
aPropOpt.AddOpt( ESCHER_Prop_wzName, rShapeName );
- Commit( aPropOpt, aRect );
+ Commit( aPropOpt, aObjectRange );
if ( mnGroupLevel > 1 )
- AddChildAnchor( aRect );
+ AddChildAnchor( aObjectRange );
EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData();
if( pAppData )
{
if ( mnGroupLevel <= 1 )
- pAppData->WriteClientAnchor( *this, aRect );
+ pAppData->WriteClientAnchor( *this, aObjectRange );
pAppData->WriteClientData( *this );
}
}
@@ -5428,25 +5496,28 @@ sal_uInt32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBou
return nShapeId;
}
-sal_uInt32 EscherEx::EnterGroup( const Rectangle* pBoundRect )
+sal_uInt32 EscherEx::EnterGroup(
+ const basegfx::B2DRange* pObjectRange)
{
- return EnterGroup( String::EmptyString(), pBoundRect );
+ return EnterGroup( String::EmptyString(), pObjectRange );
}
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect )
+bool EscherEx::SetGroupSnapPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DRange& rObjectRange)
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
if ( nGroupLevel )
{
sal_uInt32 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Snap | ( nGroupLevel - 1 ) ) )
{
- *mpOutStrm << (sal_Int32)rRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (sal_Int32)rRect.Top()
- << (sal_Int32)rRect.Right()
- << (sal_Int32)rRect.Bottom();
+ *mpOutStrm << (sal_Int32)basegfx::fround(rObjectRange.getMinX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)basegfx::fround(rObjectRange.getMinY())
+ << (sal_Int32)basegfx::fround(rObjectRange.getMaxX())
+ << (sal_Int32)basegfx::fround(rObjectRange.getMaxY());
mpOutStrm->Seek( nCurrentPos );
}
}
@@ -5455,15 +5526,20 @@ sal_Bool EscherEx::SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rR
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect )
+bool EscherEx::SetGroupLogicPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DRange& rObjectRange)
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
if ( nGroupLevel )
{
sal_uInt32 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Logic | ( nGroupLevel - 1 ) ) )
{
- *mpOutStrm << (sal_Int16)rRect.Top() << (sal_Int16)rRect.Left() << (sal_Int16)rRect.Right() << (sal_Int16)rRect.Bottom();
+ *mpOutStrm << (sal_Int16)basegfx::fround(rObjectRange.getMinX())
+ << (sal_Int16)basegfx::fround(rObjectRange.getMinY())
+ << (sal_Int16)basegfx::fround(rObjectRange.getMaxX())
+ << (sal_Int16)basegfx::fround(rObjectRange.getMaxY());
mpOutStrm->Seek( nCurrentPos );
}
}
@@ -5499,14 +5575,16 @@ void EscherEx::AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlags, sal_uInt32
// ---------------------------------------------------------------------------------------------
-void EscherEx::Commit( EscherPropertyContainer& rProps, const Rectangle& )
+void EscherEx::Commit(
+ EscherPropertyContainer& rProps,
+ const basegfx::B2DRange& /*rObjectRange*/)
{
rProps.Commit( GetStream() );
}
// ---------------------------------------------------------------------------------------------
-sal_uInt32 EscherEx::GetColor( const sal_uInt32 nSOColor, sal_Bool bSwap )
+sal_uInt32 EscherEx::GetColor( const sal_uInt32 nSOColor, bool bSwap )
{
if ( bSwap )
{
@@ -5521,14 +5599,14 @@ sal_uInt32 EscherEx::GetColor( const sal_uInt32 nSOColor, sal_Bool bSwap )
// ---------------------------------------------------------------------------------------------
-sal_uInt32 EscherEx::GetColor( const Color& rSOColor, sal_Bool bSwap )
+sal_uInt32 EscherEx::GetColor( const Color& rSOColor, bool bSwap )
{
sal_uInt32 nColor = ( rSOColor.GetRed() << 16 );
nColor |= ( rSOColor.GetGreen() << 8 );
nColor |= rSOColor.GetBlue();
if ( !bSwap )
- nColor = GetColor( nColor, sal_True );
+ nColor = GetColor( nColor, true );
return nColor;
}
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 38a53070220c..07cc76bd603c 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -50,10 +50,13 @@
#include <comphelper/extract.hxx>
#include <svtools/fltcall.hxx>
#include <vcl/cvtgrf.hxx>
+#include <svx/svdlegacy.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/svdocirc.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -76,69 +79,131 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
// PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi
maMapModeDest( MAP_INCH, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) ),
// mXStatusIndicator ( rXStatInd ),
+ maLogicToLogic ( ),
mpPicStrm ( NULL ),
mpHostAppData ( NULL ),
mnPagesWritten ( 0 ),
mnShapeMasterTitle ( 0 ),
mnShapeMasterBody ( 0 ),
- mbStatusIndicator ( sal_False ),
- mbStatus ( sal_False )
+ mbStatusIndicator ( false ),
+ mbStatus ( false )
{
}
// -------------------------------------------------------------------
-Point ImplEESdrWriter::ImplMapPoint( const Point& rPoint )
+void ImplEESdrWriter::implPrepareLogicToLogic()
{
- return OutputDevice::LogicToLogic( rPoint, maMapModeSrc, maMapModeDest );
+ if(maLogicToLogic.isIdentity())
+ {
+ maLogicToLogic = Application::GetDefaultDevice()->GetTransformLogicToLogic(maMapModeSrc, maMapModeDest);
+ }
}
-
// -------------------------------------------------------------------
-Size ImplEESdrWriter::ImplMapSize( const Size& rSize )
+basegfx::B2DPoint ImplEESdrWriter::ImplMapB2DPoint( const basegfx::B2DPoint& rB2DPoint )
{
- Size aRetSize( OutputDevice::LogicToLogic( rSize, maMapModeSrc, maMapModeDest ) );
+ if(maMapModeSrc == maMapModeDest)
+ {
+ return rB2DPoint;
+ }
+ else
+ {
+ implPrepareLogicToLogic();
- if ( !aRetSize.Width() )
- aRetSize.Width()++;
- if ( !aRetSize.Height() )
- aRetSize.Height()++;
- return aRetSize;
+ return maLogicToLogic * rB2DPoint;
+ }
}
// -------------------------------------------------------------------
-void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt )
+basegfx::B2DVector ImplEESdrWriter::ImplMapB2DVector( const basegfx::B2DVector& rB2DVector )
{
- sal_Int32 nAngle = rObj.GetAngle();
- Rectangle aRect( rObj.GetRect() );
+ if(maMapModeSrc == maMapModeDest)
+ {
+ return rB2DVector;
+ }
+ else
+{
+ implPrepareLogicToLogic();
+
+ return maLogicToLogic * rB2DVector;
+ }
+}
- if ( nAngle < 0 )
- nAngle = ( 36000 + nAngle ) % 36000;
+// -------------------------------------------------------------------
+
+basegfx::B2DRange ImplEESdrWriter::ImplMapB2DRange(const basegfx::B2DRange& rRange)
+{
+ if(maMapModeSrc == maMapModeDest)
+ {
+ return rRange;
+ }
else
- nAngle = ( 36000 - ( nAngle % 36000 ) );
+ {
+ implPrepareLogicToLogic();
+
+ basegfx::B2DRange aRetval(rRange);
+
+ aRetval.transform(maLogicToLogic);
+ return aRetval;
+ }
+}
+
+// -------------------------------------------------------------------
+
+void ImplEESdrWriter::ImplHandleRotation( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt )
+{
+ if(rObj.GetAngle())
+ {
+ const basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rMat(rObj.getTransform());
- double fVal = (double)nAngle * F_PI18000;
- double fCos = cos( fVal );
- double fSin = sin( fVal );
+ // rObj.getObjectRange() is already mapped, while rMat is not. Thus, adapt aCurrentCenter, too.
+ // MS shape format rotates around the object center, so adapt adapt ObjectRange
+ // to be centered at the center of the original shape to do this
+ const basegfx::B2DPoint aCurrentCenter(ImplMapB2DPoint(rMat.getB2DHomMatrix() * basegfx::B2DPoint(0.5, 0.5)));
+ const basegfx::B2DPoint aObjectRangeCenter(rObj.getObjectRange().getCenter());
+ basegfx::B2DRange aObjectRange(rObj.getObjectRange());
+ bool bChanged(false);
- double nWidthHalf = (double) aRect.GetWidth() / 2;
- double nHeightHalf = (double) aRect.GetHeight() / 2;
+ if(!aCurrentCenter.equal(aObjectRangeCenter))
+ {
+ const basegfx::B2DHomMatrix aAdaptToCenterRotation(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ aCurrentCenter - aObjectRangeCenter));
+
+ aObjectRange.transform(aAdaptToCenterRotation);
+ bChanged = true;
+ }
- double nXDiff = fCos * nWidthHalf + fSin * (-nHeightHalf);
- double nYDiff = - ( fSin * nWidthHalf - fCos * ( -nHeightHalf ) );
+ // do use inverted rotation here: The old model format (in which the value is here)
+ // was wrongly oriented. PPT uses the correct mathematical orientation, so invert
+ sal_Int32 nAngle(36000 - rObj.GetAngle());
- aRect.Move( (sal_Int32)( -( nWidthHalf - nXDiff ) ), (sal_Int32)( - ( nHeightHalf + nYDiff ) ) );
+ // adapt angle to MS format
+ nAngle *= 655;
+ nAngle += 0x8000;
+ nAngle &=~0xffff; // round to full degrees
+ rPropOpt.AddOpt(ESCHER_Prop_Rotation, nAngle);
+ rObj.SetAngle( nAngle );
- nAngle *= 655;
- nAngle += 0x8000;
- nAngle &=~0xffff; // nAngle auf volle Gradzahl runden
- rPropOpt.AddOpt( ESCHER_Prop_Rotation, nAngle );
+ if((nAngle >= (45 << 16) && nAngle < (135 << 16)) || (nAngle >= (225 << 16) && nAngle < (315 << 16)))
+ {
+ // in this region of rotation the ObjectRange is already rotated,
+ // so do this here, too
+ const basegfx::B2DHomMatrix aMirrorDiagonal(
+ basegfx::tools::createRotateAroundPoint(
+ aObjectRange.getCenter(),
+ F_PI2));
+
+ aObjectRange.transform(aMirrorDiagonal);
+ bChanged = true;
+ }
- rObj.SetAngle( nAngle );
- rObj.SetRect( aRect );
+ rObj.setObjectRange(aObjectRange);
+ }
}
// -----------------------------------------------------------------------
@@ -157,7 +222,7 @@ void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherProperty
mpEscherEx->OpenContainer( ESCHER_SpContainer ); \
ADD_SHAPE( ESCHER_ShpInst_TextBox, 0xa00 ); \
if ( bFill ) \
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True ); \
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, true ); \
if( rObj.ImplGetText() ) \
aPropOpt.CreateTextProperties( rObj.mXPropSet, \
mpEscherEx->QueryTextID( rObj.GetShapeRef(), \
@@ -177,12 +242,13 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
{
sal_uInt32 nShapeID = 0;
sal_uInt16 nShapeType = 0;
- sal_Bool bDontWriteText = sal_False; // if a metafile is written as shape replacement, then the text is already part of the metafile
- sal_Bool bAdditionalText = sal_False;
+ bool bDontWriteText(false); // if a metafile is written as shape replacement, then the text is already part of the metafile
+ bool bAdditionalText(false);
sal_uInt32 nGrpShapeID = 0;
do {
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
+ const bool bHandOverPosAndSize(mpEscherEx->GetGroupLevel() > 1);
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), bHandOverPosAndSize ? &rObj.getObjectRange() : 0);
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
@@ -200,7 +266,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( xXIndexAccess.is() && 0 != xXIndexAccess->getCount() )
{
- nShapeID = mpEscherEx->EnterGroup( aShapeName, &rObj.GetRect() );
+ nShapeID = mpEscherEx->EnterGroup( aShapeName, &rObj.getObjectRange() );
nShapeType = ESCHER_ShpInst_Min;
for( sal_uInt32 n = 0, nCnt = xXIndexAccess->getCount();
@@ -215,7 +281,9 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
}
break;
}
- rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle") ));
+
+ // TTTT: Moved to below (at transformation)
+ // rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle") ));
if( ( rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("IsFontwork") ) &&
::cppu::any2bool( rObj.GetUsrAny() ) ) ||
@@ -225,8 +293,8 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("BoundRect") ) )
{
::com::sun::star::awt::Rectangle aRect( *(::com::sun::star::awt::Rectangle*)rObj.GetUsrAny().getValue() );
- rObj.SetRect( ImplMapPoint( Point( aRect.X, aRect.Y ) ),
- ImplMapSize( Size( aRect.Width, aRect.Height ) ) );
+ rObj.SetRange( ImplMapB2DPoint( Point( aRect.X, aRect.Y ) ),
+ ImplMapB2DVector( Size( aRect.Width, aRect.Height ) ) );
}
*/
rObj.SetType( String( RTL_CONSTASCII_STRINGPARAM(
@@ -234,12 +302,57 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
RTL_TEXTENCODING_MS_1252 ));
}
- const ::com::sun::star::awt::Size aSize100thmm( rObj.GetShapeRef()->getSize() );
- const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
- Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
+ // TTTT: adapted to transformation
+ // TTTT: Check mirroring exports for ALL shape types
+ basegfx::B2DRange aObjectRange(0.0, 0.0, 1.0, 1.0);
+ sal_uInt32 nMirrorFlags(0);
+
+ {
+ const basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rMat(rObj.getTransform());
+
+ // Use translation and scale to create range. Use signed scale
+ // to get the unrotated SnapRect
+ aObjectRange = basegfx::B2DRange(
+ rMat.getTranslate(),
+ rMat.getTranslate() + rMat.getScale());
+
+ double fObjectRotation(rMat.getRotate());
+ bool bMirroredX(rMat.getScale().getX() < 0.0);
+ bool bMirroredY(rMat.getScale().getY() < 0.0);
+
+ // if mirror is X and Y, replace with 180 degree rotation. Prefer
+ // rotation export over mirror export.
+ if(bMirroredX && bMirroredY)
+ {
+ bMirroredX = bMirroredY = false;
+ fObjectRotation += F_PI;
+ }
+
+ if(bMirroredX)
+ {
+ nMirrorFlags |= SHAPEFLAG_FLIPH;
+ }
+
+ if(bMirroredY)
+ {
+ nMirrorFlags |= SHAPEFLAG_FLIPV;
+ }
+
+ if(bMirroredX != bMirroredY)
+ {
+ // if one axis is mirrored, invert the rotation
+ fObjectRotation = -fObjectRotation;
+ }
+
+ // convert rotation to old coordinate system and set
+ const double fSnappedRotation(basegfx::snapToZeroRange(-fObjectRotation / F_PI18000, 36000.0));
+ rObj.SetAngle(basegfx::fround(fSnappedRotation));
+ }
+
if ( !mpPicStrm )
mpPicStrm = mpEscherEx->QueryPictureStream();
- EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
+
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aObjectRange );
// #i51348# shape name
if( aShapeName.Len() > 0 )
@@ -248,14 +361,16 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if ( rObj.GetType().EqualsAscii( "drawing.Custom" ) )
{
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- sal_uInt32 nMirrorFlags;
+ // TTTT: remove when checked sal_uInt32 nMirrorFlags;
rtl::OUString sCustomShapeType;
- MSO_SPT eShapeType = aPropOpt.GetCustomShapeType( rObj.GetShapeRef(), nMirrorFlags, sCustomShapeType );
+ MSO_SPT eShapeType = aPropOpt.GetCustomShapeType( rObj.GetShapeRef(), /*nMirrorFlags, */sCustomShapeType );
if ( sCustomShapeType.equalsAscii( "col-502ad400" ) || sCustomShapeType.equalsAscii( "col-60da8460" ) )
{
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
+ ADD_SHAPE(
+ ESCHER_ShpInst_PictureFrame,
+ 0xa00 ); // TTTT: no mirroring, metafile export version
+ if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), false ) )
{
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 ); // no fill
@@ -263,12 +378,11 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
SdrObject* pObj = GetSdrObjectFromXShape( rObj.GetShapeRef() );
if ( pObj )
{
- Rectangle aBound = pObj->GetCurrentBoundRect();
- Point aPosition( ImplMapPoint( aBound.TopLeft() ) );
- Size aSize( ImplMapSize( aBound.GetSize() ) );
- rObj.SetRect( Rectangle( aPosition, aSize ) );
+ const basegfx::B2DRange aRange(ImplMapB2DRange(pObj->getObjectRange(0)));
+
+ rObj.setObjectRange(aRange);
rObj.SetAngle( 0 );
- bDontWriteText = sal_True;
+ bDontWriteText = true;
}
}
}
@@ -276,14 +390,14 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
{
ADD_SHAPE(
sal::static_int_cast< sal_uInt16 >(eShapeType),
- nMirrorFlags | 0xa00 );
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
aPropOpt.CreateCustomShapeProperties( eShapeType, rObj.GetShapeRef() );
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
if ( rObj.ImplGetText() )
{
if ( !aPropOpt.IsFontWork() )
aPropOpt.CreateTextProperties( rObj.mXPropSet, mpEscherEx->QueryTextID(
- rObj.GetShapeRef(), rObj.GetShapeId() ), sal_True, sal_False );
+ rObj.GetShapeRef(), rObj.GetShapeId() ), true, false );
}
}
}
@@ -294,12 +408,11 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
::rtl::OUString::createFromAscii("CornerRadius"));
if( nRadius )
{
- nRadius = ImplMapSize( Size( nRadius, 0 )).Width();
- ADD_SHAPE( ESCHER_ShpInst_RoundRectangle, 0xa00 ); // Flags: Connector | HasSpt
- sal_Int32 nLenght = rObj.GetRect().GetWidth();
- if ( nLenght > rObj.GetRect().GetHeight() )
- nLenght = rObj.GetRect().GetHeight();
- nLenght >>= 1;
+ nRadius = ImplMapB2DVector(basegfx::B2DVector(nRadius, 0.0)).getLength();
+ ADD_SHAPE(
+ ESCHER_ShpInst_RoundRectangle,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
+ const sal_Int32 nLenght(basegfx::fround((std::min(rObj.getObjectRange().getWidth(), rObj.getObjectRange().getHeight())) * 0.5));
if ( nRadius >= nLenght )
nRadius = 0x2a30; // 0x2a30 ist PPTs maximum radius
else
@@ -308,109 +421,75 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
}
else
{
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0xa00 ); // Flags: Connector | HasSpt
+ ADD_SHAPE(
+ ESCHER_ShpInst_Rectangle,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
}
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
if( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ), sal_False, sal_False );
+ rObj.GetShapeId() ), false, false );
}
else if ( rObj.GetType().EqualsAscii( "drawing.Ellipse" ))
{
- CircleKind eCircleKind = CircleKind_FULL;
- PolyStyle ePolyKind = PolyStyle();
- if ( rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleKind") ) )
- {
- eCircleKind = *( (CircleKind*)rObj.GetUsrAny().getValue() );
- switch ( eCircleKind )
- {
- case CircleKind_SECTION :
- {
- ePolyKind = POLY_PIE;
- }
- break;
- case CircleKind_ARC :
- {
- ePolyKind = POLY_ARC;
- }
- break;
+ // changed to directly use the SdrObject, using the handmade creatin of the polygon data
+ // seemed too dangerous for the moment. Can be changed back to own geometry creation, of
+ // course (e.g. by getting primitives using UNO API and filtering for hairlines)
+ SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(GetSdrObjectFromXShape(rObj.GetShapeRef()));
- case CircleKind_CUT :
- {
- ePolyKind = POLY_CHORD;
- }
- break;
+ if(!pCircObj)
+ break;
- default:
- eCircleKind = CircleKind_FULL;
- }
- }
- if ( eCircleKind == CircleKind_FULL )
+ if(CircleType_Circle == pCircObj->GetSdrCircleObjType())
{
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_Ellipse, 0xa00 ); // Flags: Connector | HasSpt
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );;
+ ADD_SHAPE(
+ ESCHER_ShpInst_Ellipse,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, true );;
}
else
{
- sal_Int32 nStartAngle, nEndAngle;
- if ( !rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleStartAngle") ) )
- break;
- nStartAngle = *( (sal_Int32*)rObj.GetUsrAny().getValue() );
- if( !rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleEndAngle") ) )
+ const basegfx::B2DPolyPolygon aOutline(pCircObj->TakeXorPoly());
+
+ if(!aOutline.count())
break;
- nEndAngle = *( (sal_Int32*)rObj.GetUsrAny().getValue() );
-
- Point aStart, aEnd, aCenter;
- aStart.X() = (sal_Int32)( ( cos( (double)( nStartAngle *
- F_PI18000 ) ) * 100.0 ) );
- aStart.Y() = - (sal_Int32)( ( sin( (double)( nStartAngle *
- F_PI18000 ) ) * 100.0 ) );
- aEnd.X() = (sal_Int32)( ( cos( (double)( nEndAngle *
- F_PI18000 ) ) * 100.0 ) );
- aEnd.Y() = - (sal_Int32)( ( sin( (double)( nEndAngle *
- F_PI18000 ) ) * 100.0 ) );
- const Rectangle& rRect = aRect100thmm;
- aCenter.X() = rRect.Left() + ( rRect.GetWidth() / 2 );
- aCenter.Y() = rRect.Top() + ( rRect.GetHeight() / 2 );
- aStart.X() += aCenter.X();
- aStart.Y() += aCenter.Y();
- aEnd.X() += aCenter.X();
- aEnd.Y() += aCenter.Y();
- Polygon aPolygon( rRect, aStart, aEnd, ePolyKind );
- if( rObj.GetAngle() )
+
+ Polygon aPolygon(aOutline.getB2DPolygon(0));
+
+ if( rObj.GetAngle() || nMirrorFlags)
{
- aPolygon.Rotate( rRect.TopLeft(), (sal_uInt16)( rObj.GetAngle() / 10 ) );
+ // already applied to the polygon, nothing to do there
rObj.SetAngle( 0 );
+ nMirrorFlags = 0;
}
+
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
+ ADD_SHAPE(
+ ESCHER_ShpInst_NotPrimitive,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- switch ( ePolyKind )
- {
- case POLY_PIE :
- case POLY_CHORD :
- {
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon );
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
- }
- break;
- case POLY_ARC :
- {
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, &aPolygon );
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
- }
- break;
+ if(aOutline.isClosed())
+ {
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, false, aNewRect, &aPolygon );
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
+ }
+ else
+ {
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, false, aNewRect, &aPolygon );
+ aPropOpt.CreateLineProperties( rObj.mXPropSet, false );
}
- rObj.SetRect( Rectangle( ImplMapPoint( Point( aNewRect.X, aNewRect.Y ) ),
- ImplMapSize( Size( aNewRect.Width, aNewRect.Height ) ) ) );
+
+ const basegfx::B2DRange aRange(ImplMapB2DRange(basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height)));
+
+ rObj.setObjectRange(aRange);
}
if ( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ), sal_False, sal_False );
+ rObj.GetShapeId() ), false, false );
}
else if ( rObj.GetType().EqualsAscii( "drawing.Control" ))
@@ -422,13 +501,16 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
sal_uInt16 nSpType, nSpFlags;
::com::sun::star::awt::Rectangle aNewRect;
if ( aPropOpt.CreateConnectorProperties( rObj.GetShapeRef(),
- rSolverContainer, aNewRect, nSpType, nSpFlags ) == sal_False )
+ rSolverContainer, aNewRect, nSpType, nSpFlags ) == false )
break;
- rObj.SetRect( Rectangle( ImplMapPoint( Point( aNewRect.X, aNewRect.Y ) ),
- ImplMapSize( Size( aNewRect.Width, aNewRect.Height ) ) ) );
+ const basegfx::B2DRange aRange(ImplMapB2DRange(basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height)));
+
+ rObj.setObjectRange(aRange);
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( nSpType, nSpFlags );
+ ADD_SHAPE(
+ nSpType,
+ nMirrorFlags | nSpFlags ); // Flags: mirror | Connector | HasSpt
}
else if ( rObj.GetType().EqualsAscii( "drawing.Measure" ))
{
@@ -437,16 +519,18 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
{
mpEscherEx->EnterGroup( &maRect );
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ImplWriteAny( ANY_FLAGS_LINE, sal_False );
+ ImplWriteAny( ANY_FLAGS_LINE, false );
sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
if ( maRect.Top() > maRect.Bottom() )
nFlags |= 0x80; // Flags: VertMirror
if ( maRect.Left() > maRect.Right() )
nFlags |= 0x40; // Flags: HorzMirror
- ADD_SHAPE( ESCHER_ShpInst_Line, nFlags );
+ ADD_SHAPE(
+ ESCHER_ShpInst_Line,
+ nMirrorFlags | nFlags ); // Flags: mirror | nFlags
aPropOpt.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
+ aPropOpt.CreateLineProperties( rObj.mXPropSet, false );
mpEscherEx->EndCount( ESCHER_OPT, 3 );
maRect.Justify();
mpEscherEx->AddClientAnchor( maRect );
@@ -517,35 +601,41 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
else if ( rObj.GetType().EqualsAscii( "drawing.Line" ))
{
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_LINE, sal_False, aNewRect, NULL );
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_LINE, false, aNewRect, NULL );
MapRect(rObj);
//i27942: Poly/Lines/Bezier do not support text.
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
- if( aNewRect.Height < 0 )
- nFlags |= 0x80; // Flags: VertMirror
- if( aNewRect.Width < 0 )
- nFlags |= 0x40; // Flags: HorzMirror
- ADD_SHAPE( ESCHER_ShpInst_Line, nFlags );
+ // TTTT: Mirroring alraedy done above
+ //sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
+ //if( aNewRect.Height < 0 )
+ // nFlags |= 0x80; // Flags: VertMirror
+ //if( aNewRect.Width < 0 )
+ // nFlags |= 0x40; // Flags: HorzMirror
+
+ ADD_SHAPE(
+ ESCHER_ShpInst_Line,
+ nMirrorFlags ); // Flags: mirror
aPropOpt.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
+ aPropOpt.CreateLineProperties( rObj.mXPropSet, false );
rObj.SetAngle( 0 );
}
else if ( rObj.GetType().EqualsAscii( "drawing.PolyPolygon" ))
{
if( rObj.ImplHasText() )
{
- nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRect() );
- bAdditionalText = sal_True;
+ nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.getObjectRange() );
+ bAdditionalText = true;
}
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
+ ADD_SHAPE(
+ ESCHER_ShpInst_NotPrimitive,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, NULL );
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, false, aNewRect, NULL );
MapRect(rObj);
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
rObj.SetAngle( 0 );
}
else if ( rObj.GetType().EqualsAscii( "drawing.PolyLine" ))
@@ -553,11 +643,13 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
//i27942: Poly/Lines/Bezier do not support text.
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
+ ADD_SHAPE(
+ ESCHER_ShpInst_NotPrimitive,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, NULL );
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, false, aNewRect, NULL );
MapRect(rObj);
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
+ aPropOpt.CreateLineProperties( rObj.mXPropSet, false );
rObj.SetAngle( 0 );
}
else if ( rObj.GetType().EqualsAscii( "drawing.OpenBezier" ) )
@@ -565,26 +657,30 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
//i27942: Poly/Lines/Bezier do not support text.
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
+ ADD_SHAPE(
+ ESCHER_ShpInst_NotPrimitive,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_True, aNewRect, NULL );
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, true, aNewRect, NULL );
MapRect(rObj);
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
+ aPropOpt.CreateLineProperties( rObj.mXPropSet, false );
rObj.SetAngle( 0 );
}
else if ( rObj.GetType().EqualsAscii( "drawing.ClosedBezier" ) )
{
if ( rObj.ImplHasText() )
{
- nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRect() );
- bAdditionalText = sal_True;
+ nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.getObjectRange() );
+ bAdditionalText = true;
}
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
+ ADD_SHAPE(
+ ESCHER_ShpInst_NotPrimitive,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_True, aNewRect, NULL );
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, true, aNewRect, NULL );
MapRect(rObj);
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, true );
rObj.SetAngle( 0 );
}
else if ( rObj.GetType().EqualsAscii( "drawing.GraphicObject" ))
@@ -594,7 +690,9 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
// ein GraphicObject kann auch ein ClickMe Element sein
if( rObj.IsEmptyPresObj() && ( ePageType == NORMAL ) )
{
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0x220 ); // Flags: HaveAnchor | HaveMaster
+ ADD_SHAPE(
+ ESCHER_ShpInst_Rectangle,
+ nMirrorFlags | 0x220 ); // Flags: mirror | HaveAnchor | HaveMaster
sal_uInt32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
rObj.GetShapeId() );
aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
@@ -609,8 +707,10 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
/* SJ #i34951#: because M. documents are not allowing GraphicObjects containing text, we
have to create a simpe Rectangle with fill bitmap instead (while not allowing BitmapMode_Repeat).
*/
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0xa00 ); // Flags: Connector | HasSpt
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), sal_True, sal_True, sal_False ) )
+ ADD_SHAPE(
+ ESCHER_ShpInst_Rectangle,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
+ if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), true, true, false ) )
{
aPropOpt.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapNone );
aPropOpt.AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
@@ -620,25 +720,29 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if ( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
mpEscherEx->QueryTextID( rObj.GetShapeRef(),
- rObj.GetShapeId() ), sal_False, sal_False );
+ rObj.GetShapeId() ), false, false );
}
}
else
{
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), sal_False, sal_True ) )
+ ADD_SHAPE(
+ ESCHER_ShpInst_PictureFrame,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
+ if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), false, true ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}
}
}
else if ( rObj.GetType().EqualsAscii( "drawing.Text" ))
{
- SHAPE_TEXT( sal_True );
+ SHAPE_TEXT( true );
}
else if ( rObj.GetType().EqualsAscii( "drawing.Page" ))
{
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0xa00 );
+ ADD_SHAPE(
+ ESCHER_ShpInst_Rectangle,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt // pages should never be mirrored, but who knows...
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x40004 );
aPropOpt.AddOpt( ESCHER_Prop_fFillOK, 0x100001 );
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110011 );
@@ -654,7 +758,9 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
mpEscherEx->OpenContainer( ESCHER_SpContainer );
if( rObj.IsEmptyPresObj() && ( ePageType == NORMAL ) )
{
- ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0x220 ); // Flags: HaveAnchor | HaveMaster
+ ADD_SHAPE(
+ ESCHER_ShpInst_Rectangle,
+ nMirrorFlags | 0x220 ); // Flags: mirror | HaveAnchor | HaveMaster
sal_uInt32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
rObj.GetShapeId() );
aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
@@ -665,9 +771,10 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
else
{
//2do: could be made an option in HostAppData whether OLE object should be written or not
- sal_Bool bAppOLE = sal_True;
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame,
- 0xa00 | (bAppOLE ? SHAPEFLAG_OLESHAPE : 0) );
+ bool bAppOLE(true);
+ ADD_SHAPE(
+ ESCHER_ShpInst_PictureFrame,
+ nMirrorFlags | 0xa00 | (bAppOLE ? SHAPEFLAG_OLESHAPE : 0) ); // Flags: mirror | Connector | HasSpt | OLE
if ( aPropOpt.CreateOLEGraphicProperties( rObj.GetShapeRef() ) )
{
if ( bAppOLE )
@@ -694,17 +801,21 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
break;
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
+ ADD_SHAPE(
+ nMirrorFlags | ESCHER_ShpInst_PictureFrame, // TTTT: Probably nor mirror needed, check
+ 0xa00 ); // Flags: Connector | HasSpt
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ), sal_False ) )
+ if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ), false ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}
else if ( rObj.GetType().EqualsAscii( "drawing.dontknow" ))
{
rObj.SetAngle( 0 );
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 );
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
+ ADD_SHAPE(
+ ESCHER_ShpInst_PictureFrame,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
+ if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), false ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}
else
@@ -720,23 +831,19 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x200020 );
}
+ if( rObj.GetAngle() )
{
- Rectangle aRect( rObj.GetRect() );
- aRect.Justify();
- rObj.SetRect( aRect );
+ ImplHandleRotation( rObj, aPropOpt );
}
- if( rObj.GetAngle() )
- ImplFlipBoundingBox( rObj, aPropOpt );
-
aPropOpt.CreateShapeProperties( rObj.GetShapeRef() );
- mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
+ mpEscherEx->Commit( aPropOpt, rObj.getObjectRange() );
if( mpEscherEx->GetGroupLevel() > 1 )
- mpEscherEx->AddChildAnchor( rObj.GetRect() );
+ mpEscherEx->AddChildAnchor( rObj.getObjectRange() );
if ( mpHostAppData )
{ //! with AdditionalText the App has to control whether these are written or not
- mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRect() );
+ mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.getObjectRange() );
mpHostAppData->WriteClientData( *mpEscherEx );
if ( !bDontWriteText )
mpHostAppData->WriteClientTextbox( *mpEscherEx );
@@ -765,28 +872,72 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
sal_uInt16 nShapeType = 0;
do
{
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
+ const bool bHandOver(mpEscherEx->GetGroupLevel() > 1);
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), bHandOver ? &rObj.getObjectRange() : 0 );
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
- const ::com::sun::star::awt::Size aSize100thmm( rObj.GetShapeRef()->getSize() );
- const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
- Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
+ // TTTT: adapted to transformation
+ basegfx::B2DRange aObjectRange(0.0, 0.0, 1.0, 1.0);
+ sal_uInt32 nMirrorFlags(0);
+
+ {
+ const basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& rMat(rObj.getTransform());
+
+ // Use translation and scale to create range. Use signed scale
+ // to get the unrotated SnapRect
+ aObjectRange = basegfx::B2DRange(
+ rMat.getTranslate(),
+ rMat.getTranslate() + rMat.getScale());
+
+ double fObjectRotation(rMat.getRotate());
+ bool bMirroredX(rMat.getScale().getX() < 0.0);
+ bool bMirroredY(rMat.getScale().getY() < 0.0);
+
+ // if mirror is X and Y, replace with 180 degree rotation. Prefer
+ // rotation export over mirror export.
+ if(bMirroredX && bMirroredY)
+ {
+ bMirroredX = bMirroredY = false;
+ fObjectRotation += F_PI;
+ }
+
+ if(bMirroredX)
+ {
+ nMirrorFlags |= SHAPEFLAG_FLIPH;
+ }
+
+ if(bMirroredY)
+ {
+ nMirrorFlags |= SHAPEFLAG_FLIPV;
+ }
+
+ // convert rotation to old coordinate system and set
+ const double fSnappedRotation(basegfx::snapToZeroRange(-fObjectRotation / F_PI18000, 36000.0));
+ rObj.SetAngle(basegfx::fround(fSnappedRotation));
+ }
+
if ( !mpPicStrm )
mpPicStrm = mpEscherEx->QueryPictureStream();
- EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
- rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle")));
+
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aObjectRange );
+
+ // TTTT: Done above, see transformation
+ // rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle")));
+
sal_Int32 nAngle = rObj.GetAngle();
if( rObj.GetType().EqualsAscii( "drawing.Line" ))
{
//2do: this does not work right
- double fDist = hypot( rObj.GetRect().GetWidth(),
- rObj.GetRect().GetHeight() );
- rObj.SetRect( Rectangle( rTextRefPoint,
- Point( (sal_Int32)( rTextRefPoint.X() + fDist ), rTextRefPoint.Y() - 1 ) ) );
+ const double fDist(hypot(rObj.getObjectRange().getWidth(), rObj.getObjectRange().getHeight()));
+ const basegfx::B2DRange aRange(rTextRefPoint.X(), rTextRefPoint.Y(), rTextRefPoint.X() + fDist, rTextRefPoint.Y());
+ rObj.setObjectRange(aRange);
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- mpEscherEx->AddShape( ESCHER_ShpInst_TextBox, 0xa00 );
+ mpEscherEx->AddShape(
+ ESCHER_ShpInst_TextBox,
+ nMirrorFlags | 0xa00 ); // Flags: mirror | Connector | HasSpt
+
if ( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
mpEscherEx->QueryTextID( rObj.GetShapeRef(),
@@ -795,16 +946,25 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x60006 ); // Size Shape To Fit Text
+
if ( nAngle < 0 )
+ {
nAngle = ( 36000 + nAngle ) % 36000;
+ }
+
if ( nAngle )
- ImplFlipBoundingBox( rObj, aPropOpt );
+ {
+ ImplHandleRotation( rObj, aPropOpt );
+ }
}
else
{
mpEscherEx->OpenContainer( ESCHER_SpContainer );
nShapeID = mpEscherEx->GenerateShapeId();
- mpEscherEx->AddShape( nShapeType = ESCHER_ShpInst_TextBox, 0xa00, nShapeID );
+ mpEscherEx->AddShape(
+ nShapeType = ESCHER_ShpInst_TextBox,
+ nMirrorFlags | 0xa00, // Flags: mirror | Connector | HasSpt
+ nShapeID );
if ( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
mpEscherEx->QueryTextID( rObj.GetShapeRef(),
@@ -821,21 +981,20 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
nAngle += 0x8000;
nAngle &=~0xffff; // nAngle auf volle Gradzahl runden
aPropOpt.AddOpt( ESCHER_Prop_Rotation, nAngle );
- mpEscherEx->SetGroupSnapRect( mpEscherEx->GetGroupLevel(),
- rObj.GetRect() );
- mpEscherEx->SetGroupLogicRect( mpEscherEx->GetGroupLevel(),
- rObj.GetRect() );
+ mpEscherEx->SetGroupSnapPositionAndScale( mpEscherEx->GetGroupLevel(), rObj.getObjectRange() );
+ mpEscherEx->SetGroupLogicPositionAndScale( mpEscherEx->GetGroupLevel(), rObj.getObjectRange() );
}
+
rObj.SetAngle( nAngle );
aPropOpt.CreateShapeProperties( rObj.GetShapeRef() );
- mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
+ mpEscherEx->Commit( aPropOpt, rObj.getObjectRange() );
// write the childanchor
- mpEscherEx->AddChildAnchor( rObj.GetRect() );
+ mpEscherEx->AddChildAnchor( rObj.getObjectRange() );
#if defined EES_WRITE_EPP
// ClientAnchor
- mpEscherEx->AddClientAnchor( maRect );
+ mpEscherEx->AddClientAnchor( rObj.getObjectRange() );
// ClientTextbox
mpEscherEx->OpenContainer( ESCHER_ClientTextbox );
mpEscherEx->AddAtom( 4, EPP_TextHeaderAtom );
@@ -845,7 +1004,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
#else // !EES_WRITE_EPP
if ( mpHostAppData )
{ //! the App has to control whether these are written or not
- mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRect() );
+ mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.getObjectRange() );
mpHostAppData->WriteClientData( *mpEscherEx );
mpHostAppData->WriteClientTextbox( *mpEscherEx );
}
@@ -859,26 +1018,27 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
// -------------------------------------------------------------------
-sal_uInt32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShape >& rShape,
- const Rectangle* pBoundRect )
+sal_uInt32 ImplEESdrWriter::ImplEnterAdditionalTextGroup(
+ const Reference< XShape >& rShape,
+ const basegfx::B2DRange* pObjectRange)
{
mpHostAppData = mpEscherEx->EnterAdditionalTextGroup();
- sal_uInt32 nGrpId = mpEscherEx->EnterGroup( pBoundRect );
- mpHostAppData = mpEscherEx->StartShape( rShape, pBoundRect );
+ sal_uInt32 nGrpId = mpEscherEx->EnterGroup( pObjectRange );
+ mpHostAppData = mpEscherEx->StartShape( rShape, pObjectRange );
return nGrpId;
}
// -------------------------------------------------------------------
-sal_Bool ImplEESdrWriter::ImplInitPageValues()
+bool ImplEESdrWriter::ImplInitPageValues()
{
mnIndices = 0;
mnOutlinerCount = 0; // die gliederungsobjekte muessen dem layout entsprechen,
mnEffectCount = 0;
- mbIsTitlePossible = sal_True; // bei mehr als einem title geht powerpoint in die knie
+ mbIsTitlePossible = true; // bei mehr als einem title geht powerpoint in die knie
- return sal_True;
+ return true;
}
@@ -886,7 +1046,7 @@ sal_Bool ImplEESdrWriter::ImplInitPageValues()
void ImplEESdrWriter::ImplWritePage(
EscherSolverContainer& rSolverContainer,
- ImplEESdrPageType ePageType, sal_Bool /* bBackGround */ )
+ ImplEESdrPageType ePageType, bool /* bBackGround */ )
{
ImplInitPageValues();
@@ -1070,7 +1230,9 @@ void EscherEx::EndSdrObjectPage()
// -------------------------------------------------------------------
-EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */, const Rectangle* /*pChildAnchor*/ )
+EscherExHostAppData* EscherEx::StartShape(
+ const Reference< XShape >& /* rShape */,
+ const basegfx::B2DRange* /*pObjectRange*/ )
{
return NULL;
}
@@ -1120,35 +1282,42 @@ const SdrObject* EscherEx::GetSdrObject( const Reference< XShape >& rShape )
// -------------------------------------------------------------------
-ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
- const SdrObject& rObj ) :
- mnShapeId( 0 ),
- mnTextSize( 0 ),
- mnAngle( 0 ),
- mbValid( sal_False ),
- mbPresObj( sal_False ),
- mbEmptyPresObj( sal_False )
+ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx, const SdrObject& rObj )
+: mXShape(),
+ mAny(),
+ maObjectRange(),
+ maObjTrans(),
+ mType(),
+ mnShapeId(0),
+ mnTextSize(0),
+ mnAngle(0),
+ mbValid(false),
+ mbPresObj(false),
+ mbEmptyPresObj( false)
{
- SdrPage* pPage = rObj.GetPage();
+ SdrPage* pPage = rObj.getSdrPageFromSdrObject();
DBG_ASSERT( pPage, "ImplEESdrObject::ImplEESdrObject: no SdrPage" );
if( pPage && rEx.ImplInitPage( *pPage ) )
{
// why not declare a const parameter if the object will
// not be modified?
- mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );;
+ mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );
Init( rEx );
}
}
-ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx,
- const Reference< XShape >& rShape ) :
- mXShape( rShape ),
- mnShapeId( 0 ),
- mnTextSize( 0 ),
- mnAngle( 0 ),
- mbValid( sal_False ),
- mbPresObj( sal_False ),
- mbEmptyPresObj( sal_False )
+ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx, const Reference< XShape >& rShape )
+: mXShape(rShape),
+ mAny(),
+ maObjectRange(),
+ maObjTrans(),
+ mType(),
+ mnShapeId(0),
+ mnTextSize(0),
+ mnAngle(0),
+ mbValid(false),
+ mbPresObj(false),
+ mbEmptyPresObj(false)
{
Init( rEx );
}
@@ -1196,59 +1365,44 @@ basegfx::B2DRange getUnrotatedGroupBoundRange(const Reference< XShape >& rxShape
if(mXPropSet.is())
{
const Any aAny = mXPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")));
+ HomogenMatrix3 aMatrix;
- if(aAny.hasValue())
+ if(aAny.hasValue() && (aAny >>= aMatrix))
{
- HomogenMatrix3 aMatrix;
+ basegfx::B2DHomMatrix aHomogenMatrix(
+ basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix));
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+
+ // decopose transformation
+ aHomogenMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
- if(aAny >>= aMatrix)
+ // check if rotation needs to be corrected
+ if(!basegfx::fTools::equalZero(fRotate))
{
- basegfx::B2DHomMatrix aHomogenMatrix;
-
- aHomogenMatrix.set(0, 0, aMatrix.Line1.Column1);
- aHomogenMatrix.set(0, 1, aMatrix.Line1.Column2);
- aHomogenMatrix.set(0, 2, aMatrix.Line1.Column3);
- aHomogenMatrix.set(1, 0, aMatrix.Line2.Column1);
- aHomogenMatrix.set(1, 1, aMatrix.Line2.Column2);
- aHomogenMatrix.set(1, 2, aMatrix.Line2.Column3);
- aHomogenMatrix.set(2, 0, aMatrix.Line3.Column1);
- aHomogenMatrix.set(2, 1, aMatrix.Line3.Column2);
- aHomogenMatrix.set(2, 2, aMatrix.Line3.Column3);
-
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
-
- // decopose transformation
- aHomogenMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // check if rotation needs to be corrected
- if(!basegfx::fTools::equalZero(fRotate))
- {
- // to correct, keep in mind that ppt graphics are rotated around their center
- const basegfx::B2DPoint aCenter(aHomogenMatrix * basegfx::B2DPoint(0.5, 0.5));
-
- aHomogenMatrix.translate(-aCenter.getX(), -aCenter.getY());
- aHomogenMatrix.rotate(-fRotate);
- aHomogenMatrix.translate(aCenter.getX(), aCenter.getY());
- }
-
-
- // check if shear needs to be corrected (always correct shear,
- // ppt does not know about it)
- if(!basegfx::fTools::equalZero(fShearX))
- {
- const basegfx::B2DPoint aMinimum(aHomogenMatrix * basegfx::B2DPoint(0.0, 0.0));
-
- aHomogenMatrix.translate(-aMinimum.getX(), -aMinimum.getY());
- aHomogenMatrix.shearX(-fShearX);
- aHomogenMatrix.translate(aMinimum.getX(), aMinimum.getY());
- }
-
- // create range. It's no longer rotated (or sheared), so use
- // minimum and maximum values
- aRetval.expand(aHomogenMatrix * basegfx::B2DPoint(0.0, 0.0));
- aRetval.expand(aHomogenMatrix * basegfx::B2DPoint(1.0, 1.0));
+ // to correct, keep in mind that ppt graphics are rotated around their center
+ const basegfx::B2DPoint aCenter(aHomogenMatrix * basegfx::B2DPoint(0.5, 0.5));
+
+ aHomogenMatrix.translate(-aCenter.getX(), -aCenter.getY());
+ aHomogenMatrix.rotate(-fRotate);
+ aHomogenMatrix.translate(aCenter.getX(), aCenter.getY());
}
+
+ // check if shear needs to be corrected (always correct shear,
+ // ppt does not know about it)
+ if(!basegfx::fTools::equalZero(fShearX))
+ {
+ const basegfx::B2DPoint aMinimum(aHomogenMatrix * basegfx::B2DPoint(0.0, 0.0));
+
+ aHomogenMatrix.translate(-aMinimum.getX(), -aMinimum.getY());
+ aHomogenMatrix.shearX(-fShearX);
+ aHomogenMatrix.translate(aMinimum.getX(), aMinimum.getY());
+ }
+
+ // create range. It's no longer rotated (or sheared), so use
+ // minimum and maximum values
+ aRetval.expand(aHomogenMatrix * basegfx::B2DPoint(0.0, 0.0));
+ aRetval.expand(aHomogenMatrix * basegfx::B2DPoint(1.0, 1.0));
}
}
}
@@ -1279,81 +1433,103 @@ void ImplEESdrObject::Init( ImplEESdrWriter& rEx )
{
// if it's a group, the unrotated range is needed for that group
const basegfx::B2DRange aUnroatedRange(getUnrotatedGroupBoundRange(mXShape));
- const Point aNewP(basegfx::fround(aUnroatedRange.getMinX()), basegfx::fround(aUnroatedRange.getMinY()));
- const Size aNewS(basegfx::fround(aUnroatedRange.getWidth()), basegfx::fround(aUnroatedRange.getHeight()));
- SetRect(rEx.ImplMapPoint(aNewP), rEx.ImplMapSize(aNewS));
+ setObjectRange(rEx.ImplMapB2DRange(aUnroatedRange));
}
else
{
// if it's no group, use position and size directly, roated/sheared or not
- const Point aOldP(mXShape->getPosition().X, mXShape->getPosition().Y);
- const Size aOldS(mXShape->getSize().Width, mXShape->getSize().Height);
+ const Any aAny = mXPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")));
+ drawing::HomogenMatrix3 aMatrix;
+ basegfx::B2DRange aRange;
- SetRect(rEx.ImplMapPoint(aOldP), rEx.ImplMapSize(aOldS));
- }
+ if(aAny.hasValue() && (aAny >>= aMatrix))
+ {
+ maObjTrans = basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix);
+ // Use translation and scale to create range. Use signed scale
+ // to get the unrotated SnapRect
+ aRange = basegfx::B2DRange(
+ maObjTrans.getTranslate(),
+ maObjTrans.getTranslate() + maObjTrans.getScale());
+ }
+ else
+ {
+ // fallback to getPosition/getSize(), but will miss mirrorings
+ // and should not be necessary
+ const ::com::sun::star::awt::Point aPoint(mXShape->getPosition());
+ const ::com::sun::star::awt::Size aSize(mXShape->getSize());
+
+ maObjTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize.Width, aSize.Height,
+ aPoint.X, aPoint.Y);
+ aRange = basegfx::B2DRange(
+ aPoint.X, aPoint.Y,
+ aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
+ }
+
+ setObjectRange(rEx.ImplMapB2DRange(aRange));
+ }
static const OUString sPresStr(rtl::OUString::createFromAscii("IsPresentationObject"));
static const OUString sEmptyPresStr(rtl::OUString::createFromAscii("IsEmptyPresentationObject"));
if( ImplGetPropertyValue( sPresStr ) )
+ {
mbPresObj = ::cppu::any2bool( mAny );
+ }
if( mbPresObj && ImplGetPropertyValue( sEmptyPresStr ) )
+ {
mbEmptyPresObj = ::cppu::any2bool( mAny );
+ }
- mbValid = sal_True;
+ mbValid = true;
}
}
-//sal_Bool ImplEESdrObject::ImplGetPropertyValue( const OUString& rString )
-sal_Bool ImplEESdrObject::ImplGetPropertyValue( const sal_Unicode* rString )
+//bool ImplEESdrObject::ImplGetPropertyValue( const OUString& rString )
+bool ImplEESdrObject::ImplGetPropertyValue( const sal_Unicode* rString )
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
if( mbValid )
{
try
{
mAny = mXPropSet->getPropertyValue( rString );
if( mAny.hasValue() )
- bRetValue = sal_True;
+ bRetValue = true;
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = sal_False;
+ bRetValue = false;
}
}
return bRetValue;
}
#ifdef USED
-sal_Bool ImplEESdrObject::ImplGetPropertyValue( const Reference< XPropertySet >& rXPropSet,
+bool ImplEESdrObject::ImplGetPropertyValue( const Reference< XPropertySet >& rXPropSet,
const OUString& rString )
{
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
if( mbValid )
{
try
{
mAny = rXPropSet->getPropertyValue( rString );
if( 0 != mAny.get() )
- bRetValue = sal_True;
+ bRetValue = true;
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = sal_False;
+ bRetValue = false;
}
}
return bRetValue;
}
#endif
-void ImplEESdrObject::SetRect( const Point& rPos, const Size& rSz )
-{
- maRect = Rectangle( rPos, rSz );
-}
-
const SdrObject* ImplEESdrObject::GetSdrObject() const
{
return EscherEx::GetSdrObject( mXShape );
@@ -1369,9 +1545,10 @@ sal_uInt32 ImplEESdrObject::ImplGetText()
return mnTextSize;
}
-sal_Bool ImplEESdrObject::ImplHasText() const
+bool ImplEESdrObject::ImplHasText() const
{
Reference< XText > xXText( mXShape, UNO_QUERY );
return xXText.is() && xXText->getString().getLength();
}
+// eof
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index f286cce152c3..5ddc2e567f8f 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -25,6 +25,7 @@
#include <filter/msfilter/escherex.hxx>
#include <svx/unopage.hxx>
#include <vcl/mapmod.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
// ===================================================================
// fractions of Draw PPTWriter etc.
@@ -36,17 +37,24 @@ class ImplEscherExSdr;
class ImplEESdrObject
{
+private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXShape;
// XTextRef mXText; // TextRef des globalen Text
::com::sun::star::uno::Any mAny;
- Rectangle maRect;
+
+ // the object range, split in pos and scale to keep the evtl. negative size (mirroring)
+ basegfx::B2DRange maObjectRange;
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose maObjTrans;
+
String mType;
- sal_uInt32 mnShapeId;
- sal_uInt32 mnTextSize;
- sal_Int32 mnAngle;
- sal_Bool mbValid : 1;
- sal_Bool mbPresObj : 1;
- sal_Bool mbEmptyPresObj : 1;
+ sal_uInt32 mnShapeId;
+ sal_uInt32 mnTextSize;
+ sal_Int32 mnAngle;
+
+ /// bitfield
+ bool mbValid : 1;
+ bool mbPresObj : 1;
+ bool mbEmptyPresObj : 1;
void Init( ImplEESdrWriter& rEx );
public:
@@ -56,7 +64,7 @@ public:
ImplEESdrObject( ImplEESdrWriter& rEx, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape );
~ImplEESdrObject();
- sal_Bool ImplGetPropertyValue( const sal_Unicode* pString );
+ bool ImplGetPropertyValue( const sal_Unicode* pString );
sal_Int32 ImplGetInt32PropertyValue( const sal_Unicode* pStr, sal_uInt32 nDef = 0 )
{ return ImplGetPropertyValue( pStr ) ? *(sal_Int32*)mAny.getValue() : nDef; }
@@ -66,26 +74,26 @@ public:
const String& GetType() const { return mType; }
void SetType( const String& rS ) { mType = rS; }
- const Rectangle& GetRect() const { return maRect; }
- void SetRect( const Point& rPos, const Size& rSz );
- void SetRect( const Rectangle& rRect )
- { maRect = rRect; }
+ void setObjectRange(const basegfx::B2DRange& rObjectRange) { maObjectRange = rObjectRange; }
+ const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
sal_Int32 GetAngle() const { return mnAngle; }
void SetAngle( sal_Int32 nVal ) { mnAngle = nVal; }
sal_uInt32 GetTextSize() const { return mnTextSize; }
- sal_Bool IsValid() const { return mbValid; }
- sal_Bool IsPresObj() const { return mbPresObj; }
- sal_Bool IsEmptyPresObj() const { return mbEmptyPresObj; }
+ bool IsValid() const { return mbValid; }
+ bool IsPresObj() const { return mbPresObj; }
+ bool IsEmptyPresObj() const { return mbEmptyPresObj; }
sal_uInt32 GetShapeId() const { return mnShapeId; }
void SetShapeId( sal_uInt32 nVal ) { mnShapeId = nVal; }
const SdrObject* GetSdrObject() const;
sal_uInt32 ImplGetText();
- sal_Bool ImplHasText() const;
+ bool ImplHasText() const;
+
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose& getTransform() { return maObjTrans; }
};
@@ -112,6 +120,9 @@ protected:
EscherEx* mpEscherEx;
MapMode maMapModeSrc;
MapMode maMapModeDest;
+ basegfx::B2DHomMatrix maLogicToLogic;
+
+ void implPrepareLogicToLogic();
::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mXStatusIndicator;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mXDrawPage;
@@ -136,37 +147,40 @@ protected:
sal_uInt16 mnEffectCount;
- sal_Bool mbIsTitlePossible;
- sal_Bool mbStatusIndicator;
- sal_Bool mbStatus;
+ /// bitfield
+ bool mbIsTitlePossible : 1;
+ bool mbStatusIndicator : 1;
+ bool mbStatus : 1;
ImplEESdrWriter( EscherEx& rEx );
- sal_Bool ImplInitPageValues();
+ bool ImplInitPageValues();
void ImplWritePage(
EscherSolverContainer& rSolver,
ImplEESdrPageType ePageType,
- sal_Bool bBackGround = sal_False );
+ bool bBackGround = false );
sal_uInt32 ImplWriteShape( ImplEESdrObject& rObj,
EscherSolverContainer& rSolver,
ImplEESdrPageType ePageType ); // returns ShapeID
- void ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
- sal_Bool ImplGetText( ImplEESdrObject& rObj );
+ void ImplHandleRotation( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
+ bool ImplGetText( ImplEESdrObject& rObj );
void ImplWriteAdditionalText(
ImplEESdrObject& rObj,
const Point& rTextRefPoint );
sal_uInt32 ImplEnterAdditionalTextGroup(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
- const Rectangle* pBoundRect = NULL );
+ const basegfx::B2DRange* pObjectRange = 0);
public:
- Point ImplMapPoint( const Point& rPoint );
- Size ImplMapSize( const Size& rSize );
+ basegfx::B2DPoint ImplMapB2DPoint( const basegfx::B2DPoint& rPoint );
+ basegfx::B2DVector ImplMapB2DVector( const basegfx::B2DVector& rScale );
+ basegfx::B2DRange ImplMapB2DRange(const basegfx::B2DRange& rRange);
+
EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
void MapRect(ImplEESdrObject& rObj);
};
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index a8306bad5d4f..21bda9cf8192 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -106,7 +106,6 @@
#include <editeng/colritem.hxx>
#include <svx/sxekitm.hxx>
#include <editeng/bulitem.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/extrud3d.hxx>
#include "svx/svditer.hxx"
#include <svx/xpoly.hxx>
@@ -140,6 +139,8 @@ using namespace vos;
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include "svx/EnhancedCustomShape2d.hxx"
+#include <svx/svdlegacy.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
using namespace ::com::sun::star ;
using namespace ::com::sun::star::drawing;
@@ -488,9 +489,6 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
case OBJ_RECT :
case OBJ_TEXT :
case OBJ_PAGE :
- case OBJ_TEXTEXT :
- case OBJ_wegFITTEXT :
- case OBJ_wegFITALLTEXT :
case OBJ_TITLETEXT :
case OBJ_OUTLINETEXT :
{
@@ -524,16 +522,6 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
}
break;
case OBJ_POLY :
- case OBJ_PLIN :
- case OBJ_LINE :
- case OBJ_PATHLINE :
- case OBJ_PATHFILL :
- case OBJ_FREELINE :
- case OBJ_FREEFILL :
- case OBJ_SPLNLINE :
- case OBJ_SPLNFILL :
- case OBJ_PATHPOLY :
- case OBJ_PATHPLIN :
{
if ( pList && ( pList->GetCount() > nC ) )
{
@@ -575,8 +563,8 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
fXRel *= 10000;
fYRel /= (double)nHeight;
fYRel *= 10000;
- aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
- aGluePoint.SetPercent( sal_True );
+ aGluePoint.SetPos( basegfx::B2DPoint( fXRel, fYRel ) );
+ aGluePoint.SetPercent( true );
aGluePoint.SetAlign( SDRVERTALIGN_TOP | SDRHORZALIGN_LEFT );
aGluePoint.SetEscDir( SDRESC_SMART );
nId = (sal_Int32)((*pList)[ pList->Insert( aGluePoint ) ].GetId() + 3 );
@@ -744,7 +732,7 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
bValidGluePoint = sal_True;
((SdrObjCustomShape*)pO)->SetMergedItem( aGeometryItem );
SdrGluePointList* pLst = pO->ForceGluePointList();
- if ( pLst->GetCount() > nGluePoints )
+ if ( (sal_Int32)pLst->GetCount() > nGluePoints )
nId = (sal_Int32)((*pLst)[ (sal_uInt16)nGluePoints ].GetId() + 3 );
}
}
@@ -758,6 +746,8 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
Reference< XPropertySet > xPropSet( aXConnector, UNO_QUERY );
if ( xPropSet.is() )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pO);
+
if ( nN )
{
String aPropName( RTL_CONSTASCII_USTRINGPARAM( "EndShape" ) );
@@ -779,8 +769,10 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
// Not sure what this is good for, repaint or broadcast of object change.
//( Thus i am adding repaint here
+ // AW: Should not be needed at all; SetPropValue should trigger all needed actions
+ // when called and do the needed broadcasts for changes at the model (SdrObject).
+ // Still keeping this to not change behaviour
pO->SetChanged();
- pO->BroadcastObjectChange();
}
}
}
@@ -889,9 +881,11 @@ static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_L
break;
case mso_lineArrowOvalEnd :
{
- aRetval = XPolygon( Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 ),
- (sal_Int32)( fWidthMul * fLineWidth * 0.50 ),
- (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ), 0, 3600 ).getB2DPolygon();
+ const double fRadX(fWidthMul * fLineWidth * 0.5);
+ const double fRadY(fLenghtMul * fLineWidth * 0.5);
+ const basegfx::B2DPoint aCenter(fRadX, 0.0);
+
+ aRetval = basegfx::tools::createPolygonFromEllipse(aCenter, fRadX, fRadY);
rbArrowCenter = sal_True;
rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOvalEnd " ), RTL_TEXTENCODING_UTF8 );
}
@@ -1032,7 +1026,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
if ( nLineFlags & 0x10 )
{
- sal_Bool bScaleArrows = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP;
+ sal_Bool bScaleArrows = rManager.pSdrModel->GetExchangeObjectUnit() == MAP_TWIP;
///////////////
// LineStart //
///////////////
@@ -1142,8 +1136,8 @@ struct QuantErr
void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream& rIn, SfxItemSet& rSet, const std::vector< ShadeColor >& rShadeColors, const DffObjData& rObjData, sal_Int32 nFix16Angle )
{
- Size aBitmapSizePixel( static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetWidth() / 2540.0 ) * 90.0 ), // we will create a bitmap with 90 dpi
- static_cast< sal_Int32 >( ( rObjData.aBoundRect.GetHeight() / 2540.0 ) * 90.0 ) );
+ Size aBitmapSizePixel( static_cast< sal_Int32 >( ( rObjData.aBoundRect.getWidth() / 2540.0 ) * 90.0 ), // we will create a bitmap with 90 dpi
+ static_cast< sal_Int32 >( ( rObjData.aBoundRect.getHeight() / 2540.0 ) * 90.0 ) );
if ( aBitmapSizePixel.Width() && aBitmapSizePixel.Height() && ( aBitmapSizePixel.Width() <= 1024 ) && ( aBitmapSizePixel.Height() <= 1024 ) )
{
// std::vector< QuantErr > aQuantErrCurrScan( aBitmapSizePixel.Width() + 1 );
@@ -1351,7 +1345,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
//If it is imported as a bitmap, it will not work well with transparecy especially 100
//But the gradient look well comparing with imported as gradient. And rotate with shape
//also works better. So here just keep it.
- if ( rObjData.aBoundRect.IsEmpty() )// size of object needed to be able
+ if ( rObjData.aBoundRect.isEmpty() )// size of object needed to be able
eXFill = XFILL_GRADIENT; // to create a bitmap substitution
else
eXFill = XFILL_BITMAP;
@@ -1561,16 +1555,16 @@ void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
rSet.Put( SdrTextVertAdjustItem( eTVA ) );
rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
- rSet.Put( SdrTextLeftDistItem( nTextLeft ) );
- rSet.Put( SdrTextRightDistItem( nTextRight ) );
- rSet.Put( SdrTextUpperDistItem( nTextTop ) );
- rSet.Put( SdrTextLowerDistItem( nTextBottom ) );
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, nTextLeft ) );
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, nTextRight ) );
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, nTextTop ) );
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, nTextBottom ) );
- rSet.Put( SdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_True : sal_False ) );
- rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
+ rSet.Put( SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_True : sal_False ) );
+ rSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
-// rSet.Put( SdrTextAutoGrowWidthItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_False : sal_True ) );
-// rSet.Put( SdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
+// rSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_False : sal_True ) );
+// rSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
}
void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
@@ -2634,7 +2628,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const
{
- Rectangle aEmptyRect;
+ basegfx::B2DRange aEmptyRect;
DffRecordHeader aHdTemp;
DffObjData aDffObjTemp( aHdTemp, aEmptyRect, 0 );
ApplyAttributes( rIn, rSet, aDffObjTemp );
@@ -2661,25 +2655,35 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
if ( IsProperty( DFF_Prop_fillColor ) )
rSet.Put( XFillColorItem( String(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor ) ) );
if ( IsProperty( DFF_Prop_shadowColor ) )
- rSet.Put( SdrShadowColorItem( String(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_shadowColor ), DFF_Prop_shadowColor ) ) );
+ rSet.Put( XColorItem( SDRATTR_SHADOWCOLOR, String(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_shadowColor ), DFF_Prop_shadowColor ) ) );
else
{
//The default value for this property is 0x00808080
- rSet.Put( SdrShadowColorItem( String(), rManager.MSO_CLR_ToColor( 0x00808080, DFF_Prop_shadowColor ) ) );
+ rSet.Put( XColorItem( SDRATTR_SHADOWCOLOR, String(), rManager.MSO_CLR_ToColor( 0x00808080, DFF_Prop_shadowColor ) ) );
}
if ( IsProperty( DFF_Prop_shadowOpacity ) )
- rSet.Put( SdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - GetPropertyValue( DFF_Prop_shadowOpacity ) ) / 655 ) ) );
+ {
+ rSet.Put( SdrPercentItem( SDRATTR_SHADOWTRANSPARENCE, (sal_uInt16)( ( 0x10000 - GetPropertyValue( DFF_Prop_shadowOpacity ) ) / 655 ) ) );
+ }
if ( IsProperty( DFF_Prop_shadowOffsetX ) )
{
sal_Int32 nVal = static_cast< sal_Int32 >( GetPropertyValue( DFF_Prop_shadowOffsetX ) );
rManager.ScaleEmu( nVal );
- rSet.Put( SdrShadowXDistItem( nVal ) );
+
+ if(nVal)
+ {
+ rSet.Put( SdrMetricItem( SDRATTR_SHADOWXDIST, nVal ) );
+ }
}
if ( IsProperty( DFF_Prop_shadowOffsetY ) )
{
sal_Int32 nVal = static_cast< sal_Int32 >( GetPropertyValue( DFF_Prop_shadowOffsetY ) );
rManager.ScaleEmu( nVal );
- rSet.Put( SdrShadowYDistItem( nVal ) );
+
+ if(nVal)
+ {
+ rSet.Put( SdrMetricItem( SDRATTR_SHADOWYDIST, nVal ) );
+ }
}
if ( IsProperty( DFF_Prop_fshadowObscured ) )
{
@@ -2687,9 +2691,9 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
if ( bHasShadow )
{
if ( !IsProperty( DFF_Prop_shadowOffsetX ) )
- rSet.Put( SdrShadowXDistItem( 35 ) );
+ rSet.Put( SdrMetricItem( SDRATTR_SHADOWXDIST, 35 ) );
if ( !IsProperty( DFF_Prop_shadowOffsetY ) )
- rSet.Put( SdrShadowYDistItem( 35 ) );
+ rSet.Put( SdrMetricItem( SDRATTR_SHADOWYDIST, 35 ) );
}
}
if ( IsProperty( DFF_Prop_shadowType ) )
@@ -2698,9 +2702,9 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
if( eShadowType != mso_shadowOffset )
{
//0.12'' == 173 twip == 302 100mm
- sal_uInt32 nDist = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP ? 173: 302;
- rSet.Put( SdrShadowXDistItem( nDist ) );
- rSet.Put( SdrShadowYDistItem( nDist ) );
+ const sal_uInt32 nDist(MAP_TWIP == rManager.pSdrModel->GetExchangeObjectUnit() ? 173: 302);
+ rSet.Put( SdrMetricItem( SDRATTR_SHADOWXDIST, nDist ) );
+ rSet.Put( SdrMetricItem( SDRATTR_SHADOWYDIST, nDist ) );
}
}
if ( bHasShadow )
@@ -2739,7 +2743,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
bHasShadow = sal_False; // we are turning shadow off.
if ( bHasShadow )
- rSet.Put( SdrShadowItem( bHasShadow ) );
+ rSet.Put( SdrOnOffItem(SDRATTR_SHADOW, bHasShadow ) );
}
ApplyLineAttributes( rSet, rObjData.eShapeType ); // #i28269#
ApplyFillAttributes( rIn, rSet, rObjData );
@@ -3229,7 +3233,7 @@ void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const
{
- MapUnit eMap = pSdrModel->GetScaleUnit();
+ MapUnit eMap = pSdrModel->GetExchangeObjectUnit();
Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
long aMul = aFact.GetNumerator();
long aDiv = aFact.GetDenominator() * 65536;
@@ -3249,7 +3253,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
{
// PPT arbeitet nur mit Einheiten zu 576DPI
// WW hingegen verwendet twips, dh. 1440DPI.
- MapUnit eMap = pSdrModel->GetScaleUnit();
+ MapUnit eMap = pSdrModel->GetExchangeObjectUnit();
Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
long nMul=aFact.GetNumerator();
long nDiv=aFact.GetDenominator()*nApplicationScale;
@@ -3280,7 +3284,7 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
{
pModel = 0;
nMapMul = nMapDiv = nMapXOfs = nMapYOfs = nEmuMul = nEmuDiv = nPntMul = nPntDiv = 0;
- bNeedMap = sal_False;
+ bNeedMap = false;
}
}
@@ -3330,9 +3334,9 @@ sal_Bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, s
return bRet;
}
-FASTBOOL SvxMSDffManager::SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd, sal_uLong nSkipCount ) const
+bool SvxMSDffManager::SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd, sal_uLong nSkipCount ) const
{
- FASTBOOL bRet = sal_False;
+ bool bRet = false;
sal_uLong nFPosMerk = rSt.Tell(); // store FilePos to restore it later if necessary
DffRecordHeader aHd;
do
@@ -3353,7 +3357,7 @@ FASTBOOL SvxMSDffManager::SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong
nSkipCount--;
else
{
- bRet = sal_True;
+ bRet = true;
if ( pRecHd != NULL )
*pRecHd = aHd;
else
@@ -3369,9 +3373,9 @@ FASTBOOL SvxMSDffManager::SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong
return bRet;
}
-FASTBOOL SvxMSDffManager::SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd, sal_uLong nSkipCount ) const
+bool SvxMSDffManager::SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd, sal_uLong nSkipCount ) const
{
- FASTBOOL bRet = sal_False;
+ bool bRet = false;
sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
DffRecordHeader aHd;
do
@@ -3383,7 +3387,7 @@ FASTBOOL SvxMSDffManager::SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sa
nSkipCount--;
else
{
- bRet = sal_True;
+ bRet = true;
if ( pRecHd )
*pRecHd = aHd;
else
@@ -3400,7 +3404,7 @@ FASTBOOL SvxMSDffManager::SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sa
}
-FASTBOOL SvxMSDffManager::GetColorFromPalette( sal_uInt16 /* nNum */, Color& rColor ) const
+bool SvxMSDffManager::GetColorFromPalette( sal_uInt16 /* nNum */, Color& rColor ) const
{
// diese Methode ist in der zum Excel-Import
// abgeleiteten Klasse zu ueberschreiben...
@@ -3663,7 +3667,7 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte
// our outliner is too complicate to be used properly,
void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
{
- SdrTextObj* pText = PTR_CAST( SdrTextObj, pObj );
+ SdrTextObj* pText = dynamic_cast< SdrTextObj* >( pObj );
if ( pText )
{
SdrOutliner& rOutliner = pText->ImpGetDrawOutliner();
@@ -3723,7 +3727,7 @@ void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
//static
void SvxMSDffManager::MSDFFReadZString( SvStream& rIn, String& rStr,
- sal_uLong nRecLen, FASTBOOL bUniCode )
+ sal_uLong nRecLen, bool bUniCode )
{
sal_uInt16 nLen = (sal_uInt16)nRecLen;
if( nLen )
@@ -3759,7 +3763,7 @@ void SvxMSDffManager::MSDFFReadZString( SvStream& rIn, String& rStr,
rStr.Erase();
}
-SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, Rectangle& rBoundRect ) const
+SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, basegfx::B2DRange& rBoundRect ) const
{
SdrObject* pRet = NULL;
String aObjectText;
@@ -3774,13 +3778,13 @@ SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, R
if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 )
{
// Text ist senkrecht formatiert, Box Kippen
- sal_Int32 nHalfWidth = ( rBoundRect.GetWidth() + 1) >> 1;
- sal_Int32 nHalfHeight = ( rBoundRect.GetHeight() + 1) >> 1;
- Point aTopLeft( rBoundRect.Left() + nHalfWidth - nHalfHeight,
- rBoundRect.Top() + nHalfHeight - nHalfWidth);
- Size aNewSize( rBoundRect.GetHeight(), rBoundRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- rBoundRect = aNewRect;
+ const basegfx::B2DVector aHalfSize(rBoundRect.getRange() * 0.5);
+ const basegfx::B2DPoint aTopLeft(
+ rBoundRect.getMinX() + aHalfSize.getX() - aHalfSize.getY(),
+ rBoundRect.getMinY() + aHalfSize.getY() - aHalfSize.getX());
+ const basegfx::B2DVector aNewSize(rBoundRect.getHeight(), rBoundRect.getWidth());
+
+ rBoundRect = basegfx::B2DRange(aTopLeft, aTopLeft + aNewSize);
String aSrcText( aObjectText );
aObjectText.Erase();
@@ -3794,15 +3798,22 @@ SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, R
}
if ( aObjectText.Len() )
{ // FontWork-Objekt Mit dem Text in aObjectText erzeugen
- SdrObject* pNewObj = new SdrRectObj( OBJ_TEXT, rBoundRect );
+ SdrObject* pNewObj = new SdrRectObj(
+ *GetModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rBoundRect.getRange(),
+ rBoundRect.getMinimum()),
+ OBJ_TEXT,
+ true);
+
if( pNewObj )
{
- pNewObj->SetModel( pSdrModel );
+ //pNewObj->SetModel( pSdrModel );
((SdrRectObj*)pNewObj)->SetText( aObjectText );
SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
rSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
- rSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
- rSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
+ rSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
+ rSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
rSet.Put( SvxFontItem( FAMILY_DONTKNOW, aFontName, String(),
PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
@@ -3813,13 +3824,18 @@ SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, R
pRet = pNewObj;
else
{
- pRet->NbcSetSnapRect( rBoundRect );
- SdrObject::Free( pNewObj );
+ sdr::legacy::SetSnapRange(*pRet, rBoundRect );
+ deleteSdrObjectSafeAndClearPointer( pNewObj );
}
if( bTextRotate )
{
- double a = 9000 * nPi180;
- pRet->NbcRotate( rBoundRect.Center(), 9000, sin( a ), cos( a ) );
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-rBoundRect.getCenter());
+ aTransform.rotate(-F_PI2);
+ aTransform.translate(rBoundRect.getCenter());
+
+ sdr::legacy::transformSdrObject(*pRet, aTransform);
}
}
}
@@ -3904,7 +3920,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
SdrObject* pRet = NULL;
String aFileName;
String aLinkFileName, aLinkFilterName;
- Rectangle aVisArea;
+ basegfx::B2DRange aVisArea;
MSO_BlipFlags eFlags = (MSO_BlipFlags)GetPropertyValue( DFF_Prop_pibFlags, mso_blipflagDefault );
sal_uInt32 nBlipId = GetPropertyValue( DFF_Prop_pib, 0 );
@@ -4085,7 +4101,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
}
if( !pRet )
{
- pRet = new SdrGrafObj;
+ pRet = new SdrGrafObj(*GetModel(), Graphic());
if( bGrfRead )
((SdrGrafObj*)pRet)->SetGraphic( aGraf );
@@ -4111,8 +4127,8 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
}
// set the size from BLIP if there is one
- if ( pRet && bGrfRead && !aVisArea.IsEmpty() )
- pRet->SetBLIPSizeRectangle( aVisArea );
+ if ( pRet && bGrfRead && !aVisArea.isEmpty() )
+ pRet->SetBLIPSizeRange( aVisArea );
if ( !pRet->GetName().Len() ) // SJ 22.02.00 : PPT OLE IMPORT:
{ // name is already set in ImportOLE !!
@@ -4127,21 +4143,22 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
pRet->SetName( aFileName );
}
}
- pRet->SetModel( pSdrModel ); // fuer GraphicLink erforderlich
- pRet->SetLogicRect( rObjData.aBoundRect );
+ //pRet->SetModel( pSdrModel ); // fuer GraphicLink erforderlich
+ sdr::legacy::SetLogicRange(*pRet, rObjData.aBoundRect );
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pRet);
- if ( pRet->ISA( SdrGrafObj ) )
+ if ( pSdrGrafObj )
{
if( aLinkFileName.Len() )
- ((SdrGrafObj*)pRet)->SetGraphicLink( aLinkFileName, aLinkFilterName );
+ pSdrGrafObj->SetGraphicLink( aLinkFileName, aLinkFilterName );
if ( bLinkGrf && !bGrfRead )
{
- ((SdrGrafObj*)pRet)->ForceSwapIn();
- Graphic aGraf(((SdrGrafObj*)pRet)->GetGraphic());
+ pSdrGrafObj->ForceSwapIn();
+ Graphic aGraf(pSdrGrafObj->GetGraphic());
lcl_ApplyCropping( *this, &rSet, aGraf );
}
- ((SdrGrafObj*)pRet)->ForceSwapOut();
+ pSdrGrafObj->ForceSwapOut();
}
return pRet;
@@ -4149,25 +4166,57 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
// PptSlidePersistEntry& rPersistEntry, SdPage* pPage
SdrObject* SvxMSDffManager::ImportObj( SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup, sal_Int32* pShapeId )
+ basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange, int nCalledByGroup, sal_Int32* pShapeId )
{
SdrObject* pRet = NULL;
DffRecordHeader aObjHd;
rSt >> aObjHd;
if ( aObjHd.nRecType == DFF_msofbtSpgrContainer )
{
- pRet = ImportGroup( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
+ pRet = ImportGroup( aObjHd, rSt, pClientData, rClientRange, rGlobalChildRange, nCalledByGroup, pShapeId );
}
else if ( aObjHd.nRecType == DFF_msofbtSpContainer )
{
- pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup, pShapeId );
+ pRet = ImportShape( aObjHd, rSt, pClientData, rClientRange, rGlobalChildRange, nCalledByGroup, pShapeId );
}
aObjHd.SeekToBegOfRecord( rSt ); // FilePos restaurieren
return pRet;
}
+void SvxMSDffManager::ApplyRotationAndMirror(
+ SdrObject& rTarget,
+ const basegfx::B2DPoint& rCenter,
+ sal_Int32 nAngle, // in old DrawingLayer notation
+ bool bFlipHorizontal,
+ bool bFlipVertical)
+{
+ if(nAngle || bFlipHorizontal || bFlipVertical)
+ {
+ basegfx::B2DHomMatrix aTransform;
+ aTransform.translate(-rCenter);
+
+ if(nAngle)
+ {
+ aTransform.rotate((-nAngle * F_PI) / 18000.0);
+ }
+
+ if(bFlipHorizontal)
+ {
+ aTransform.scale(-1.0, 1.0);
+ }
+
+ if(bFlipVertical)
+ {
+ aTransform.scale(1.0, -1.0);
+ }
+
+ aTransform.translate(rCenter);
+ sdr::legacy::transformSdrObject(rTarget, aTransform);
+ }
+}
+
SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
+ basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange,
int nCalledByGroup, sal_Int32* pShapeId )
{
SdrObject* pRet = NULL;
@@ -4184,30 +4233,30 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
sal_Int32 nSpFlags = 0;
mnFix16Angle = 0;
aRecHd.SeekToBegOfRecord( rSt );
- pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
+ pRet = ImportObj( rSt, pClientData, rClientRange, rGlobalChildRange, nCalledByGroup + 1, pShapeId );
if ( pRet )
{
nSpFlags = nGroupShapeFlags;
nGroupRotateAngle = mnFix16Angle;
- Rectangle aClientRect( rClientRect );
+ basegfx::B2DRange aClientRange( rClientRange );
+ basegfx::B2DRange aGlobalChildRect;
- Rectangle aGlobalChildRect;
- if ( !nCalledByGroup || rGlobalChildRect.IsEmpty() )
- aGlobalChildRect = GetGlobalChildAnchor( rHd, rSt, aClientRect );
+ if ( !nCalledByGroup || rGlobalChildRange.isEmpty() )
+ aGlobalChildRect = GetGlobalChildAnchor( rHd, rSt, aClientRange );
else
- aGlobalChildRect = rGlobalChildRect;
+ aGlobalChildRect = rGlobalChildRange;
if ( ( nGroupRotateAngle > 4500 && nGroupRotateAngle <= 13500 )
|| ( nGroupRotateAngle > 22500 && nGroupRotateAngle <= 31500 ) )
{
- sal_Int32 nHalfWidth = ( aClientRect.GetWidth() + 1 ) >> 1;
- sal_Int32 nHalfHeight = ( aClientRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aClientRect.Left() + nHalfWidth - nHalfHeight,
- aClientRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aClientRect.GetHeight(), aClientRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- aClientRect = aNewRect;
+ const basegfx::B2DVector aHalfSize(aClientRange.getRange() * 0.5);
+ const basegfx::B2DPoint aTopLeft(
+ aClientRange.getMinX() + aHalfSize.getX() - aHalfSize.getY(),
+ aClientRange.getMinY() + aHalfSize.getY() - aHalfSize.getX());
+ const basegfx::B2DVector aNewSize(aClientRange.getHeight(), aClientRange.getWidth());
+
+ aClientRange = basegfx::B2DRange(aTopLeft, aTopLeft + aNewSize);
}
// now importing the inner objects of the group
@@ -4218,14 +4267,14 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
rSt >> aRecHd2;
if ( aRecHd2.nRecType == DFF_msofbtSpgrContainer )
{
- Rectangle aGroupClientAnchor, aGroupChildAnchor;
- GetGroupAnchors( aRecHd2, rSt, aGroupClientAnchor, aGroupChildAnchor, aClientRect, aGlobalChildRect );
+ basegfx::B2DRange aGroupClientAnchor, aGroupChildAnchor;
+ GetGroupAnchors( aRecHd2, rSt, aGroupClientAnchor, aGroupChildAnchor, aClientRange, aGlobalChildRect );
aRecHd2.SeekToBegOfRecord( rSt );
sal_Int32 nShapeId;
SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
+ if ( pTmp && pRet->getChildrenOfSdrObject() )
{
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
+ pRet->getChildrenOfSdrObject()->InsertObjectToSdrObjList(*pTmp);
if( nShapeId )
insertShapeId( nShapeId, pTmp );
}
@@ -4234,10 +4283,10 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
{
aRecHd2.SeekToBegOfRecord( rSt );
sal_Int32 nShapeId;
- SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
- if ( pTmp )
+ SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRange, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
+ if ( pTmp && pRet->getChildrenOfSdrObject() )
{
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
+ pRet->getChildrenOfSdrObject()->InsertObjectToSdrObjList(*pTmp);
if( nShapeId )
insertShapeId( nShapeId, pTmp );
}
@@ -4245,31 +4294,21 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
aRecHd2.SeekToEndOfRecord( rSt );
}
- // pRet->NbcSetSnapRect( aGroupBound );
- if ( nGroupRotateAngle )
- {
- double a = nGroupRotateAngle * nPi180;
- pRet->NbcRotate( aClientRect.Center(), nGroupRotateAngle, sin( a ), cos( a ) );
- }
- if ( nSpFlags & SP_FFLIPV ) // Vertikal gespiegelt?
- { // BoundRect in aBoundRect
- Point aLeft( aClientRect.Left(), ( aClientRect.Top() + aClientRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- if ( nSpFlags & SP_FFLIPH ) // Horizontal gespiegelt?
- { // BoundRect in aBoundRect
- Point aTop( ( aClientRect.Left() + aClientRect.Right() ) >> 1, aClientRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
+ const basegfx::B2DPoint aCenter(aClientRange.getCenter());
+
+ ApplyRotationAndMirror(
+ *pRet,
+ aCenter,
+ nGroupRotateAngle,
+ nSpFlags & SP_FFLIPH,
+ nSpFlags & SP_FFLIPV);
}
}
return pRet;
}
SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pClientData,
- Rectangle& rClientRect, const Rectangle& rGlobalChildRect,
+ basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange,
int nCalledByGroup, sal_Int32* pShapeId )
{
SdrObject* pRet = NULL;
@@ -4278,7 +4317,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
*pShapeId = 0;
rHd.SeekToBegOfRecord( rSt );
- DffObjData aObjData( rHd, rClientRect, nCalledByGroup );
+ DffObjData aObjData( rHd, rClientRange, nCalledByGroup );
aObjData.bRotateTextWithShape = ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_EXCEL ) == 0;
maShapeRecords.Consume( rSt, sal_False );
if( maShapeRecords.SeekToContent( rSt,
@@ -4358,20 +4397,22 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
Scale( o );
Scale( r );
Scale( u );
- aObjData.aChildAnchor = Rectangle( l, o, r, u );
- if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
+ aObjData.aChildAnchor = basegfx::B2DRange( l, o, r, u );
+
+ if ( !rGlobalChildRange.isEmpty() && !rClientRange.isEmpty() && !rGlobalChildRange.getRange().equalZero() )
{
double fl = l;
double fo = o;
double fWidth = r - l;
double fHeight= u - o;
- double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
- double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
- fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
- fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
+ double fXScale = rClientRange.getWidth() / rGlobalChildRange.getWidth();
+ double fYScale = rClientRange.getHeight() / rGlobalChildRange.getHeight();
+ fl = ( ( l - rGlobalChildRange.getMinX() ) * fXScale ) + rClientRange.getMinX();
+ fo = ( ( o - rGlobalChildRange.getMinY() ) * fYScale ) + rClientRange.getMinY();
fWidth *= fXScale;
fHeight *= fYScale;
- aObjData.aChildAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
+
+ aObjData.aChildAnchor = basegfx::B2DRange(fl, fo, fl + fWidth, fo + fHeight);
}
}
@@ -4383,39 +4424,39 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
aObjData.aBoundRect = aObjData.aChildAnchor;
if ( aObjData.nSpFlags & SP_FBACKGROUND )
- aObjData.aBoundRect = Rectangle( Point(), Size( 1, 1 ) );
+ aObjData.aBoundRect = basegfx::B2DRange::getUnitB2DRange();
- Rectangle aTextRect;
- if ( !aObjData.aBoundRect.IsEmpty() )
+ basegfx::B2DRange aTextRect;
+ if ( !aObjData.aBoundRect.isEmpty() )
{ // Rotation auf BoundingBox anwenden, BEVOR ien Objekt generiert wurde
if( mnFix16Angle )
{
long nAngle = mnFix16Angle;
if ( ( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 ) )
{
- sal_Int32 nHalfWidth = ( aObjData.aBoundRect.GetWidth() + 1 ) >> 1;
- sal_Int32 nHalfHeight = ( aObjData.aBoundRect.GetHeight() + 1 ) >> 1;
- Point aTopLeft( aObjData.aBoundRect.Left() + nHalfWidth - nHalfHeight,
- aObjData.aBoundRect.Top() + nHalfHeight - nHalfWidth );
- Size aNewSize( aObjData.aBoundRect.GetHeight(), aObjData.aBoundRect.GetWidth() );
- Rectangle aNewRect( aTopLeft, aNewSize );
- aObjData.aBoundRect = aNewRect;
+ const basegfx::B2DVector aHalfSize(aObjData.aBoundRect.getRange() * 0.5);
+ const basegfx::B2DPoint aTopLeft(
+ aObjData.aBoundRect.getMinX() + aHalfSize.getX() - aHalfSize.getY(),
+ aObjData.aBoundRect.getMinY() + aHalfSize.getY() - aHalfSize.getX());
+ const basegfx::B2DVector aNewSize(aObjData.aBoundRect.getHeight(), aObjData.aBoundRect.getWidth());
+
+ aObjData.aBoundRect = basegfx::B2DRange(aTopLeft, aTopLeft + aNewSize);
}
}
aTextRect = aObjData.aBoundRect;
- FASTBOOL bGraphic = IsProperty( DFF_Prop_pib ) ||
+ bool bGraphic = IsProperty( DFF_Prop_pib ) ||
IsProperty( DFF_Prop_pibName ) ||
IsProperty( DFF_Prop_pibFlags );
if ( aObjData.nSpFlags & SP_FGROUP )
{
- pRet = new SdrObjGroup;
+ pRet = new SdrObjGroup(*GetModel());
/* After CWS aw033 has been integrated, an empty group object
cannot store its resulting bounding rectangle anymore. We have
- to return this rectangle via rClientRect now, but only, if
+ to return this rectangle via rClientRange now, but only, if
caller has not passed an own bounding ractangle. */
- if ( rClientRect.IsEmpty() )
- rClientRect = aObjData.aBoundRect;
+ if ( rClientRange.isEmpty() )
+ rClientRange = aObjData.aBoundRect;
nGroupShapeFlags = aObjData.nSpFlags; // #73013#
}
else if ( ( aObjData.eShapeType != mso_sptNil ) || IsProperty( DFF_Prop_pVertices ) || bGraphic )
@@ -4436,10 +4477,12 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
else if ( aObjData.eShapeType == mso_sptLine && !( GetPropertyValue( DFF_Prop_fc3DLightFace ) & 8 ) )
{
basegfx::B2DPolygon aPoly;
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
- aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
- pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
- pRet->SetModel( pSdrModel );
+ aPoly.append(aObjData.aBoundRect.getMinimum());
+ aPoly.append(aObjData.aBoundRect.getMaximum());
+ pRet = new SdrPathObj(
+ *GetModel(),
+ basegfx::B2DPolyPolygon(aPoly));
+ //pRet->SetModel( pSdrModel );
ApplyAttributes( rSt, aSet, aObjData );
pRet->SetMergedItemSet(aSet);
}
@@ -4451,9 +4494,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
ApplyAttributes( rSt, aSet, aObjData );
// the com.sun.star.drawing.EnhancedCustomShapeEngine is default, so we do not need to set a hard attribute
-// aSet.Put( SdrCustomShapeEngineItem( String::CreateFromAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ) );
- pRet = new SdrObjCustomShape();
- pRet->SetModel( pSdrModel );
+// aSet.Put( SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, String::CreateFromAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ) );
+ pRet = new SdrObjCustomShape(*GetModel());
+ //pRet->SetModel( pSdrModel );
sal_Bool bIsFontwork = ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x4000 ) != 0;
@@ -4527,8 +4570,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
aSet.Put( SvxKerningItem( 1, EE_CHAR_KERNING ) );
// #119496# the resize autoshape to fit text attr of word art in MS PPT is always false
- aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
- aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
}
pRet->SetMergedItemSet( aSet );
@@ -4541,10 +4584,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
if ( pParaObj )
{
SdrOutliner& rOutliner = ((SdrObjCustomShape*)pRet)->ImpGetDrawOutliner();
- sal_Bool bOldUpdateMode = rOutliner.GetUpdateMode();
- SdrModel* pModel = pRet->GetModel();
- if ( pModel )
- rOutliner.SetStyleSheetPool( (SfxStyleSheetPool*)pModel->GetStyleSheetPool() );
+ const sal_Bool bOldUpdateMode = rOutliner.GetUpdateMode();
+ rOutliner.SetStyleSheetPool( (SfxStyleSheetPool*)pRet->getSdrModelFromSdrObject().GetStyleSheetPool() );
rOutliner.SetUpdateMode( sal_False );
rOutliner.SetText( *pParaObj );
VirtualDevice aVirDev( 1 );
@@ -4568,7 +4609,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
{
OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
- ((SdrObjCustomShape*)pRet)->NbcSetOutlinerParaObject( pNewText );
+ ((SdrObjCustomShape*)pRet)->SetOutlinerParaObject( pNewText );
}
}
rOutliner.Clear();
@@ -4595,32 +4636,53 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
// before clearing the GeometryItem we have to store the current Coordinates
const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates );
- Rectangle aPolyBoundRect;
- Point aStartPt( 0,0 );
+ basegfx::B2DRange aPolyBoundRect;
+
+ basegfx::B2DPoint aStartPt(0.0, 0.0);
if ( pAny && ( *pAny >>= seqCoordinates ) && ( seqCoordinates.getLength() >= 4 ) )
{
sal_Int32 nPtNum, nNumElemVert = seqCoordinates.getLength();
- XPolygon aXP( (sal_uInt16)nNumElemVert );
-// const EnhancedCustomShapeParameterPair* pTmp = seqCoordinates.getArray();
+
for ( nPtNum = 0; nPtNum < nNumElemVert; nPtNum++ )
{
- Point aP;
sal_Int32 nX = 0, nY = 0;
seqCoordinates[ nPtNum ].First.Value >>= nX;
seqCoordinates[ nPtNum ].Second.Value >>= nY;
- aP.X() = nX;
- aP.Y() = nY;
- aXP[ (sal_uInt16)nPtNum ] = aP;
- }
- aPolyBoundRect = Rectangle( aXP.GetBoundRect() );
- if ( nNumElemVert >= 3 )
- { // arc first command is always wr -- clockwise arc
- // the parameters are : (left,top),(right,bottom),start(x,y),end(x,y)
- aStartPt = aXP[2];
+
+ aPolyBoundRect.expand(basegfx::B2DPoint(nX, nY));
+
+ if(nNumElemVert >= 3 && nPtNum == 2)
+ {
+ aStartPt.setX(nX);
+ aStartPt.setY(nY);
+ }
}
+
+// TTTT check before removal
+// XPolygon aXP( (sal_uInt16)nNumElemVert );
+// const EnhancedCustomShapeParameterPair* pTmp = seqCoordinates.getArray();
+// for ( nPtNum = 0; nPtNum < nNumElemVert; nPtNum++ )
+// {
+// Point aP;
+// sal_Int32 nX = 0, nY = 0;
+// seqCoordinates[ nPtNum ].First.Value >>= nX;
+// seqCoordinates[ nPtNum ].Second.Value >>= nY;
+// aP.X() = nX;
+// aP.Y() = nY;
+// aXP[ (sal_uInt16)nPtNum ] = aP;
+// }
+// const Rectangle aOldBound(aXP.GetBoundRect());
+// aPolyBoundRect = basegfx::B2DRange(aOldBound.Left(), aOldBound.Top(), aOldBound.Right(), aOldBound.Bottom());
+// if ( nNumElemVert >= 3 )
+// { // arc first command is always wr -- clockwise arc
+// // the parameters are : (left,top),(right,bottom),start(x,y),end(x,y)
+// aStartPt = aXP[2];
+// }
}
else
- aPolyBoundRect = Rectangle( -21600, 0, 21600, 43200 ); // defaulting
+ {
+ aPolyBoundRect = basegfx::B2DRange(-21600.0, 0.0, 21600.0, 43200.0); // defaulting
+ }
// clearing items, so MergeDefaultAttributes will set the corresponding defaults from EnhancedCustomShapeGeometry
aGeometryItem.ClearPropertyValue( sHandles );
@@ -4642,18 +4704,25 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
else
{
fNumber = 270.0;
+ // TTTT: Another angle to check...
//normal situation:if endAngle != 90,there will be a direct_value,but for damaged curve,the endAngle need to recalculate.
- Point cent = aPolyBoundRect.Center();
- if ( aStartPt.Y() == cent.Y() )
- fNumber = ( aStartPt.X() >= cent.X() ) ? 0:180.0;
- else if ( aStartPt.X() == cent.X() )
- fNumber = ( aStartPt.Y() >= cent.Y() ) ? 90.0: 270.0;
+ const basegfx::B2DPoint cent(aPolyBoundRect.getCenter());
+
+ if(basegfx::fTools::equal(aStartPt.getY(), cent.getY()))
+ {
+ fNumber = basegfx::fTools::moreOrEqual(aStartPt.getX(), cent.getX()) ? 0:180.0;
+ }
+ else if(basegfx::fTools::equal(aStartPt.getX(), cent.getX()))
+ {
+ fNumber = basegfx::fTools::moreOrEqual(aStartPt.getY(), cent.getY()) ? 90.0: 270.0;
+ }
else
{
- fNumber = atan2( double( aStartPt.X() - cent.X() ),double( aStartPt.Y() - cent.Y() ) )+ F_PI; // 0..2PI
+ fNumber = atan2(double(aStartPt.getX() - cent.getX()), double(aStartPt.getY() - cent.getY())) + F_PI; // 0..2PI
fNumber /= F_PI180; // 0..360.0
}
- nEndAngle = NormAngle360( - (sal_Int32)fNumber * 100 );
+
+ nEndAngle = NormAngle360((sal_Int32)-fNumber * 100);
seqAdjustmentValues[ 0 ].Value <<= fNumber;
seqAdjustmentValues[ 0 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; // so this value will properly be stored
}
@@ -4677,52 +4746,76 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
}
if ( nStartAngle != nEndAngle )
{
- XPolygon aXPoly( aPolyBoundRect.Center(), aPolyBoundRect.GetWidth() / 2, aPolyBoundRect.GetHeight() / 2,
- (sal_uInt16)nStartAngle / 10, (sal_uInt16)nEndAngle / 10, sal_True );
- Rectangle aPolyPieRect( aXPoly.GetBoundRect() );
+ basegfx::B2DRange aPolyPieRect;
- double fYScale, fXScale;
- double fYOfs, fXOfs;
+ {
+ // create the pie segment temporary for BoundRange calculation
+ double fStart((-nStartAngle * F_PI) / 18000.0);
+ double fEnd((-nEndAngle * F_PI) / 18000.0);
+
+ fStart = basegfx::snapToZeroRange(fStart, F_2PI);
+ fEnd = basegfx::snapToZeroRange(fEnd, F_2PI);
+
+ const basegfx::B2DPolygon aTempPie(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ aPolyBoundRect.getCenter(),
+ aPolyBoundRect.getWidth() * 0.5,
+ aPolyBoundRect.getHeight() * 0.5,
+ fEnd,
+ fStart));
+
+ aPolyPieRect = aTempPie.getB2DRange();
+ }
- Point aP( aObjData.aBoundRect.Center() );
- Size aS( aObjData.aBoundRect.GetSize() );
- aP.X() -= aS.Width() / 2;
- aP.Y() -= aS.Height() / 2;
- Rectangle aLogicRect( aP, aS );
+// TTTT check before removal
+// { // use old XPoly consructor for BoundRange calculation; needs to be removed once
+// const Point aCenter(basegfx::fround(aPolyBoundRect.getCenterX()), basegfx::fround(aPolyBoundRect.getCenterY()));
+// const long nWidth(basegfx::fround(aPolyBoundRect.getWidth() * 0.5));
+// const long nHeight(basegfx::fround(aPolyBoundRect.getHeight() * 0.5));
+//
+//
+// const XPolygon aXPoly(aCenter, nWidth, nHeight, (USHORT)nStartAngle / 10, (USHORT)nEndAngle / 10, TRUE);
+// const Rectangle aXPolyRect(aXPoly.GetBoundRect());
+//
+// aPolyPieRect = basegfx::B2DRange(aXPolyRect.Left(), aXPolyRect.Top(), aXPolyRect.Right(), aXPolyRect.Bottom());
+// }
- fYOfs = fXOfs = 0.0;
+ double fYScale, fXScale;
+ double fYOfs(0.0), fXOfs(0.0);
- if ( aPolyBoundRect.GetWidth() && aPolyPieRect.GetWidth() )
+ if ( aPolyBoundRect.getWidth() && aPolyPieRect.getWidth() )
{
- fXScale = (double)aLogicRect.GetWidth() / (double)aPolyPieRect.GetWidth();
+ fXScale = aObjData.aBoundRect.getWidth() / aPolyPieRect.getWidth();
if ( nSpFlags & SP_FFLIPH )
- fXOfs = ( (double)aPolyPieRect.Right() - (double)aPolyBoundRect.Right() ) * fXScale;
+ fXOfs = ( aPolyPieRect.getMaxX() - aPolyBoundRect.getMaxX() ) * fXScale;
else
- fXOfs = ( (double)aPolyBoundRect.Left() - (double)aPolyPieRect.Left() ) * fXScale;
+ fXOfs = ( aPolyBoundRect.getMinX() - aPolyPieRect.getMinX() ) * fXScale;
}
- if ( aPolyBoundRect.GetHeight() && aPolyPieRect.GetHeight() )
+
+ if ( aPolyBoundRect.getHeight() && aPolyPieRect.getHeight() )
{
- fYScale = (double)aLogicRect.GetHeight() / (double)aPolyPieRect.GetHeight();
+ fYScale = aObjData.aBoundRect.getHeight() / aPolyPieRect.getHeight();
if ( nSpFlags & SP_FFLIPV )
- fYOfs = ( (double)aPolyPieRect.Bottom() - (double)aPolyBoundRect.Bottom() ) * fYScale;
+ fYOfs = ( aPolyPieRect.getMaxY() - aPolyBoundRect.getMaxY() ) * fYScale;
else
- fYOfs = ((double)aPolyBoundRect.Top() - (double)aPolyPieRect.Top() ) * fYScale;
+ fYOfs = (aPolyBoundRect.getMinY() - aPolyPieRect.getMinY() ) * fYScale;
}
- fXScale = (double)aPolyBoundRect.GetWidth() / (double)aPolyPieRect.GetWidth();
- fYScale = (double)aPolyBoundRect.GetHeight() / (double)aPolyPieRect.GetHeight();
+ fXScale = aPolyBoundRect.getWidth() / aPolyPieRect.getWidth();
+ fYScale = aPolyBoundRect.getHeight() / aPolyPieRect.getHeight();
- Rectangle aOldBoundRect( aObjData.aBoundRect );
- aObjData.aBoundRect = Rectangle( Point( aLogicRect.Left() + (sal_Int32)fXOfs, aLogicRect.Top() + (sal_Int32)fYOfs ),
- Size( (sal_Int32)( aLogicRect.GetWidth() * fXScale ), (sal_Int32)( aLogicRect.GetHeight() * fYScale ) ) );
+ const basegfx::B2DRange aOldBoundRect( aObjData.aBoundRect );
+ const basegfx::B2DPoint aNewTopLeft(aObjData.aBoundRect.getMinX() + fXOfs, aObjData.aBoundRect.getMinY() + fYOfs);
+ const basegfx::B2DVector aNewScale(aObjData.aBoundRect.getWidth() * fXScale, aObjData.aBoundRect.getHeight() * fYScale);
+ aObjData.aBoundRect = basegfx::B2DRange(aNewTopLeft, aNewTopLeft + aNewScale);
// creating the text frame -> scaling into (0,0),(21600,21600) destination coordinate system
- double fTextFrameScaleX = (double)21600 / (double)aPolyBoundRect.GetWidth();
- double fTextFrameScaleY = (double)21600 / (double)aPolyBoundRect.GetHeight();
- sal_Int32 nLeft = (sal_Int32)(( aPolyPieRect.Left() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
- sal_Int32 nTop = (sal_Int32)(( aPolyPieRect.Top() - aPolyBoundRect.Top() ) * fTextFrameScaleY );
- sal_Int32 nRight = (sal_Int32)(( aPolyPieRect.Right() - aPolyBoundRect.Left() ) * fTextFrameScaleX );
- sal_Int32 nBottom= (sal_Int32)(( aPolyPieRect.Bottom()- aPolyBoundRect.Top() ) * fTextFrameScaleY );
+ double fTextFrameScaleX = 21600.0 / aPolyBoundRect.getWidth();
+ double fTextFrameScaleY = 21600.0 / aPolyBoundRect.getHeight();
+ sal_Int32 nLeft = (sal_Int32)(( aPolyPieRect.getMinX() - aPolyBoundRect.getMinX() ) * fTextFrameScaleX );
+ sal_Int32 nTop = (sal_Int32)(( aPolyPieRect.getMinY() - aPolyBoundRect.getMinY() ) * fTextFrameScaleY );
+ sal_Int32 nRight = (sal_Int32)(( aPolyPieRect.getMaxX() - aPolyBoundRect.getMinX() ) * fTextFrameScaleX );
+ sal_Int32 nBottom= (sal_Int32)(( aPolyPieRect.getMaxY() - aPolyBoundRect.getMinY() ) * fTextFrameScaleY );
com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrame( 1 );
EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.First, nLeft );
EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrame[ 0 ].TopLeft.Second, nTop );
@@ -4744,13 +4837,14 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
double a = nAngle * F_PI18000;
double ss = sin( a );
double cc = cos( a );
- Point aP1( aOldBoundRect.TopLeft() );
- Point aC1( aObjData.aBoundRect.Center() );
- Point aP2( aOldBoundRect.TopLeft() );
- Point aC2( aOldBoundRect.Center() );
+ Point aP1( basegfx::fround(aOldBoundRect.getMinX()), basegfx::fround(aOldBoundRect.getMinY()) );
+ const Point aC1( basegfx::fround(aObjData.aBoundRect.getCenterX()), basegfx::fround(aObjData.aBoundRect.getCenterY()) );
+ Point aP2( basegfx::fround(aOldBoundRect.getMinX()), basegfx::fround(aOldBoundRect.getMinY()) );
+ const Point aC2( basegfx::fround(aOldBoundRect.getCenterX()), basegfx::fround(aOldBoundRect.getCenterY()) );
RotatePoint( aP1, aC1, ss, cc );
RotatePoint( aP2, aC2, ss, cc );
- aObjData.aBoundRect.Move( aP2.X() - aP1.X(), aP2.Y() - aP1.Y() );
+
+ aObjData.aBoundRect.transform(basegfx::tools::createTranslateB2DHomMatrix(aP2.X() - aP1.X(), aP2.Y() - aP1.Y()));
}
}
((SdrObjCustomShape*)pRet)->SetMergedItem( aGeometryItem );
@@ -4769,57 +4863,54 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
else
((SdrObjCustomShape*)pRet)->MergeDefaultAttributes();
- pRet->SetSnapRect( aObjData.aBoundRect );
+ sdr::legacy::SetSnapRange(*pRet, aObjData.aBoundRect );
EnhancedCustomShape2d aCustomShape2d( pRet );
- aTextRect = aCustomShape2d.GetTextRect();
+ aTextRect = aCustomShape2d.GetTextRange();
bIsCustomShape = sal_True;
if( bIsConnector )
{
- if( nObjectRotation )
- {
- double a = nObjectRotation * nPi180;
- pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
- }
- // Horizontal gespiegelt?
- if ( nSpFlags & SP_FFLIPH )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- // Vertikal gespiegelt?
- if ( nSpFlags & SP_FFLIPV )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
- basegfx::B2DPolyPolygon aPoly( SdrObjCustomShape::GetLineGeometry( (SdrObjCustomShape*)pRet, sal_True ) );
- SdrObject::Free( pRet );
+ const basegfx::B2DPoint aCenter(aObjData.aBoundRect.getCenter());
+
+ ApplyRotationAndMirror(
+ *pRet,
+ aCenter,
+ nObjectRotation,
+ nSpFlags & SP_FFLIPH,
+ nSpFlags & SP_FFLIPV);
+ // #120437# reset rotation, it is part of the path and shall not be applied again
+ nObjectRotation = 0;
+
+ // #120437# reset hor filp
+ nSpFlags &= ~SP_FFLIPH;
+
+ // #120437# reset ver filp
+ nSpFlags &= ~SP_FFLIPV;
+
+ const basegfx::B2DPolyPolygon aPoly( SdrObjCustomShape::GetLineGeometry( (SdrObjCustomShape*)pRet, sal_True ) );
+ deleteSdrObjectSafeAndClearPointer( pRet );
- pRet = new SdrEdgeObj();
+ SdrEdgeObj* pSdrEdgeObj = new SdrEdgeObj(*GetModel());
+ pRet = pSdrEdgeObj;
ApplyAttributes( rSt, aSet, aObjData );
- pRet->SetLogicRect( aObjData.aBoundRect );
- pRet->SetMergedItemSet(aSet);
+ sdr::legacy::SetLogicRange(*pSdrEdgeObj, aObjData.aBoundRect );
+ pSdrEdgeObj->SetMergedItemSet(aSet);
// Konnektoren
MSO_ConnectorStyle eConnectorStyle = (MSO_ConnectorStyle)GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight );
- ((SdrEdgeObj*)pRet)->ConnectToNode(sal_True, NULL);
- ((SdrEdgeObj*)pRet)->ConnectToNode(sal_False, NULL);
+ pSdrEdgeObj->ConnectToNode(sal_True, NULL);
+ pSdrEdgeObj->ConnectToNode(sal_False, NULL);
- Point aPoint1( aObjData.aBoundRect.TopLeft() );
- Point aPoint2( aObjData.aBoundRect.BottomRight() );
+ Point aPoint1( basegfx::fround(aObjData.aBoundRect.getMinX()), basegfx::fround(aObjData.aBoundRect.getMinY()) );
+ Point aPoint2( basegfx::fround(aObjData.aBoundRect.getMaxX()), basegfx::fround(aObjData.aBoundRect.getMaxY()) );
// Rotationen beachten
if ( nObjectRotation )
{
double a = nObjectRotation * nPi180;
- Point aCenter( aObjData.aBoundRect.Center() );
+ Point aCenter( basegfx::fround(aObjData.aBoundRect.getCenterX()), basegfx::fround(aObjData.aBoundRect.getCenterY()) );
double ss = sin(a);
double cc = cos(a);
@@ -4850,8 +4941,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
nSpFlags &= ~SP_FFLIPV;
}
- pRet->NbcSetPoint(aPoint1, 0L); // Startpunkt
- pRet->NbcSetPoint(aPoint2, 1L); // Endpunkt
+ pSdrEdgeObj->SetObjectPoint(basegfx::B2DPoint(aPoint1.X(), aPoint1.Y()), 0L); // Startpunkt
+ pSdrEdgeObj->SetObjectPoint(basegfx::B2DPoint(aPoint2.X(), aPoint2.Y()), 1L); // Endpunkt
sal_Int32 n1HorzDist, n1VertDist, n2HorzDist, n2VertDist;
n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 0;
@@ -4875,8 +4966,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
aSet.Put( SdrEdgeNode2HorzDistItem( n2HorzDist ) );
aSet.Put( SdrEdgeNode2VertDistItem( n2VertDist ) );
- ((SdrEdgeObj*)pRet)->SetEdgeTrackPath( aPoly );
- pRet->SetMergedItemSet( aSet );
+ if(aPoly.count())
+ {
+ OSL_ENSURE(1 == aPoly.count(), "Connectors support only single polygon, taking first one (!)");
+ pSdrEdgeObj->SetEdgeTrackPath( aPoly.getB2DPolygon(0) );
+ }
+
+ pSdrEdgeObj->SetMergedItemSet( aSet );
}
if ( aObjData.eShapeType == mso_sptLine )
{
@@ -4886,29 +4982,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
}
}
- if ( pRet )
+ if(pRet && (nObjectRotation || nSpFlags & (SP_FFLIPH|SP_FFLIPV)))
{
- if( nObjectRotation )
- {
- double a = nObjectRotation * nPi180;
- pRet->NbcRotate( aObjData.aBoundRect.Center(), nObjectRotation, sin( a ), cos( a ) );
- }
- // Horizontal gespiegelt?
- if ( nSpFlags & SP_FFLIPH )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aTop( ( aBndRect.Left() + aBndRect.Right() ) >> 1, aBndRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRet->NbcMirror( aTop, aBottom );
- }
- // Vertikal gespiegelt?
- if ( nSpFlags & SP_FFLIPV )
- {
- Rectangle aBndRect( pRet->GetSnapRect() );
- Point aLeft( aBndRect.Left(), ( aBndRect.Top() + aBndRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRet->NbcMirror( aLeft, aRight );
- }
+ const basegfx::B2DPoint aCenter(aObjData.aBoundRect.getCenter());
+
+ ApplyRotationAndMirror(
+ *pRet,
+ aCenter,
+ nObjectRotation,
+ nSpFlags & SP_FFLIPH,
+ nSpFlags & SP_FFLIPV);
}
}
}
@@ -4921,8 +5004,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
pRet->SetName( aObjName );
}
- pRet =
- ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
+ pRet = ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
if ( pRet )
{
@@ -4946,9 +5028,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
return pRet;
}
-Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle& aClientRect )
+basegfx::B2DRange SvxMSDffManager::GetGlobalChildAnchor(const DffRecordHeader& rHd, SvStream& rSt, basegfx::B2DRange& aClientRange)
{
- Rectangle aChildAnchor;
+ basegfx::B2DRange aChildAnchor;
rHd.SeekToContent( rSt );
sal_Bool bIsClientRectRead = sal_False;
while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
@@ -4987,12 +5069,12 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
Scale( b );
if ( bIsClientRectRead )
{
- Rectangle aChild( l, t, r, b );
- aChildAnchor.Union( aChild );
+ basegfx::B2DRange aChild( l, t, r, b );
+ aChildAnchor.expand( aChild );
}
else
{
- aClientRect = Rectangle( l, t, r, b );
+ aClientRange = basegfx::B2DRange( l, t, r, b );
bIsClientRectRead = sal_True;
}
}
@@ -5006,8 +5088,7 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
Scale( o );
Scale( r );
Scale( u );
- Rectangle aChild( l, o, r, u );
- aChildAnchor.Union( aChild );
+ aChildAnchor.expand(basegfx::B2DRange(l, o, r, u));
break;
}
aShapeAtom.SeekToEndOfRecord( rSt );
@@ -5019,8 +5100,8 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
}
void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt,
- Rectangle& rGroupClientAnchor, Rectangle& rGroupChildAnchor,
- const Rectangle& rClientRect, const Rectangle& rGlobalChildRect )
+ basegfx::B2DRange& rGroupClientAnchor, basegfx::B2DRange& rGroupChildAnchor,
+ const basegfx::B2DRange& rClientRange, const basegfx::B2DRange& rGlobalChildRange )
{
sal_Bool bFirst = sal_True;
rHd.SeekToContent( rSt );
@@ -5046,28 +5127,30 @@ void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt
Scale( o );
Scale( r );
Scale( u );
- Rectangle aChild( l, o, r, u );
+ basegfx::B2DRange aChild( l, o, r, u );
if ( bFirst )
{
- if ( !rGlobalChildRect.IsEmpty() && !rClientRect.IsEmpty() && rGlobalChildRect.GetWidth() && rGlobalChildRect.GetHeight() )
+ if ( !rGlobalChildRange.isEmpty() && !rClientRange.isEmpty() && !rGlobalChildRange.getRange().equalZero() )
{
double fl = l;
double fo = o;
double fWidth = r - l;
double fHeight= u - o;
- double fXScale = (double)rClientRect.GetWidth() / (double)rGlobalChildRect.GetWidth();
- double fYScale = (double)rClientRect.GetHeight() / (double)rGlobalChildRect.GetHeight();
- fl = ( ( l - rGlobalChildRect.Left() ) * fXScale ) + rClientRect.Left();
- fo = ( ( o - rGlobalChildRect.Top() ) * fYScale ) + rClientRect.Top();
+ double fXScale = rClientRange.getWidth() / rGlobalChildRange.getWidth();
+ double fYScale = rClientRange.getHeight() / rGlobalChildRange.getHeight();
+ fl = ( ( l - rGlobalChildRange.getMinX() ) * fXScale ) + rClientRange.getMinX();
+ fo = ( ( o - rGlobalChildRange.getMinY() ) * fYScale ) + rClientRange.getMinY();
fWidth *= fXScale;
fHeight *= fYScale;
- rGroupClientAnchor = Rectangle( Point( (sal_Int32)fl, (sal_Int32)fo ), Size( (sal_Int32)( fWidth + 1 ), (sal_Int32)( fHeight + 1 ) ) );
+ rGroupClientAnchor = basegfx::B2DRange(fl, fo, fl + fWidth, fo + fHeight);
}
bFirst = sal_False;
}
else
- rGroupChildAnchor.Union( aChild );
+ {
+ rGroupChildAnchor.expand( aChild );
+ }
break;
}
aShapeAtom.SeekToEndOfRecord( rSt );
@@ -5077,14 +5160,14 @@ void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt
}
}
-SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
+SdrObject* SvxMSDffManager::ProcessObj(
+ SvStream& rSt,
DffObjData& rObjData,
void* pData,
- Rectangle& rTextRect,
- SdrObject* pObj
- )
+ basegfx::B2DRange& rTextRect,
+ SdrObject* pObj)
{
- if( !rTextRect.IsEmpty() )
+ if( !rTextRect.isEmpty() )
{
SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
@@ -5156,7 +5239,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
//textbox, this was changed for #88277# to be created as a simple
//rect to keep impress happy. For the rest of us we'd like to turn
//it back into a textbox again.
- FASTBOOL bTextFrame = (pImpRec->eShapeType == mso_sptTextBox);
+ bool bTextFrame = (pImpRec->eShapeType == mso_sptTextBox);
if (!bTextFrame)
{
//Either
@@ -5175,8 +5258,8 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
if (bTextFrame)
{
- SdrObject::Free( pObj );
- pObj = pOrgObj = 0;
+ deleteSdrObjectSafeAndClearPointer( pObj );
+ pOrgObj = 0;
}
// Distance of Textbox to it's surrounding Customshape
@@ -5225,9 +5308,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
{
case 9000:
{
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
+ rTextRect = basegfx::B2DRange(
+ rTextRect.getMinX(), rTextRect.getMinY(),
+ rTextRect.getMinX() + rTextRect.getHeight(), rTextRect.getMinY() + rTextRect.getWidth());
sal_Int32 nOldTextLeft = nTextLeft;
sal_Int32 nOldTextRight = nTextRight;
@@ -5242,9 +5325,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
break;
case 27000:
{
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
+ rTextRect = basegfx::B2DRange(
+ rTextRect.getMinX(), rTextRect.getMinY(),
+ rTextRect.getMinX() + rTextRect.getHeight(), rTextRect.getMinY() + rTextRect. getWidth());
sal_Int32 nOldTextLeft = nTextLeft;
sal_Int32 nOldTextRight = nTextRight;
@@ -5262,15 +5345,15 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
}
}
- pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect);
+ pTextObj = new SdrRectObj(
+ *GetModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rTextRect.getRange(),
+ rTextRect.getMinimum()),
+ OBJ_TEXT,
+ true);
pTextImpRec = new SvxMSDffImportRec(*pImpRec);
- // Die vertikalen Absatzeinrueckungen sind im BoundRect mit drin,
- // hier rausrechnen
- Rectangle aNewRect(rTextRect);
- aNewRect.Bottom() -= nTextTop + nTextBottom;
- aNewRect.Right() -= nTextLeft + nTextRight;
-
// Nur falls es eine einfache Textbox ist, darf der Writer
// das Objekt durch einen Rahmen ersetzen, ansonsten
if( bTextFrame )
@@ -5293,24 +5376,28 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
bool bFitText = false;
if (GetPropertyValue(DFF_Prop_FitTextToShape) & 2)
{
- aSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
- aSet.Put( SdrTextMinFrameHeightItem(
- aNewRect.Bottom() - aNewRect.Top() ) );
- aSet.Put( SdrTextMinFrameWidthItem(
- aNewRect.Right() - aNewRect.Left() ) );
+ // Die vertikalen Absatzeinrueckungen sind im BoundRect mit drin,
+ // hier rausrechnen
+ const basegfx::B2DRange aNewRect(
+ rTextRect.getMinX(), rTextRect.getMinY(),
+ rTextRect.getMaxX() - (nTextLeft + nTextRight), rTextRect.getMaxY() - (nTextTop + nTextBottom));
+
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_True ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, basegfx::fround( aNewRect.getHeight() ) ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, basegfx::fround( aNewRect.getWidth() ) ) );
bFitText = true;
}
else
{
- aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
- aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
}
switch ( (MSO_WrapMode)
GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) )
{
case mso_wrapNone :
- aSet.Put( SdrTextAutoGrowWidthItem( sal_True ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_True ) );
if (bFitText)
{
//can't do autowidth in flys #i107184#
@@ -5318,16 +5405,16 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
}
break;
case mso_wrapByPoints :
- aSet.Put( SdrTextContourFrameItem( sal_True ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, sal_True ) );
break;
default: break;
}
// Abstaende an den Raendern der Textbox setzen
- aSet.Put( SdrTextLeftDistItem( nTextLeft ) );
- aSet.Put( SdrTextRightDistItem( nTextRight ) );
- aSet.Put( SdrTextUpperDistItem( nTextTop ) );
- aSet.Put( SdrTextLowerDistItem( nTextBottom ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, nTextLeft ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, nTextRight ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, nTextTop ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, nTextBottom ) );
pTextImpRec->nDxTextLeft = nTextLeft;
pTextImpRec->nDyTextTop = nTextTop;
pTextImpRec->nDxTextRight = nTextRight;
@@ -5399,29 +5486,34 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
}
pTextObj->SetMergedItemSet(aSet);
- pTextObj->SetModel(pSdrModel);
+ // pTextObj->SetModel(pSdrModel);
if (bVerticalText)
pTextObj->SetVerticalWriting(sal_True);
if (nTextRotationAngle)
{
- long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
- rTextRect.GetWidth() : rTextRect.GetHeight();
- nMinWH /= 2;
- Point aPivot(rTextRect.TopLeft());
- aPivot.X() += nMinWH;
- aPivot.Y() += nMinWH;
- double a = nTextRotationAngle * nPi180;
- pTextObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
+ const double fMinWH(std::min(rTextRect.getWidth(), rTextRect.getHeight()) * 0.5);
+ const basegfx::B2DPoint aPivot(rTextRect.getMinimum() + basegfx::B2DPoint(fMinWH, fMinWH));
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aPivot);
+ aTransform.rotate((-nTextRotationAngle * F_PI) / 18000.0);
+ aTransform.translate(aPivot);
+
+ sdr::legacy::transformSdrObject(*pTextObj, aTransform);
}
// rotate text with shape ?
if ( mnFix16Angle )
{
- double a = mnFix16Angle * nPi180;
- pTextObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
- sin( a ), cos( a ) );
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-rObjData.aBoundRect.getCenter());
+ aTransform.rotate((-mnFix16Angle * F_PI) / 18000.0);
+ aTransform.translate(rObjData.aBoundRect.getCenter());
+
+ sdr::legacy::transformSdrObject(*pTextObj, aTransform);
}
if( !pObj )
@@ -5432,9 +5524,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
{
if( pTextObj != pObj )
{
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->GetSubList()->NbcInsertObject( pObj );
- pGroup->GetSubList()->NbcInsertObject( pTextObj );
+ SdrObjGroup* pGroup = new SdrObjGroup(*GetModel());
+ pGroup->InsertObjectToSdrObjList(*pObj);
+ pGroup->InsertObjectToSdrObjList(*pTextObj);
if (pOrgObj == pObj)
pOrgObj = pGroup;
else
@@ -5448,9 +5540,14 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
// simple rectangular objects are ignored by ImportObj() :-(
// this is OK for Draw but not for Calc and Writer
// cause here these objects have a default border
- pObj = new SdrRectObj(rTextRect);
+ pObj = new SdrRectObj(
+ *GetModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rTextRect.getRange(),
+ rTextRect.getMinimum()));
+
pOrgObj = pObj;
- pObj->SetModel( pSdrModel );
+ // pObj->SetModel( pSdrModel );
SfxItemSet aSet( pSdrModel->GetItemPool() );
ApplyAttributes( rSt, aSet, rObjData );
@@ -6437,7 +6534,7 @@ sal_Bool SvxMSDffManager::GetShape(sal_uLong nId, SdrObject*& rpShape,
/* Zugriff auf ein BLIP zur Laufzeit (bei bereits bekannter Blip-Nr)
---------------------------------
******************************************************************************/
-sal_Bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* pVisArea ) const
+sal_Bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, basegfx::B2DRange* pVisArea ) const
{
sal_Bool bOk = sal_False; // Ergebnisvariable initialisieren
if ( pStData )
@@ -6527,7 +6624,7 @@ sal_Bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* p
/* Zugriff auf ein BLIP zur Laufzeit (mit korrekt positioniertem Stream)
---------------------------------
******************************************************************************/
-sal_Bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea ) const
+sal_Bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, basegfx::B2DRange* pVisArea ) const
{
sal_uLong nOldPos = rBLIPStream.Tell();
@@ -6560,7 +6657,7 @@ sal_Bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData,
aMtfSize100.Width() /= 360, aMtfSize100.Height() /= 360;
if ( pVisArea ) // seem that we currently are skipping the visarea position
- *pVisArea = Rectangle( Point(), aMtfSize100 );
+ *pVisArea = basegfx::B2DRange( 0.0, 0.0, aMtfSize100.Width(), aMtfSize100.Height() );
// skip rest of header
nSkip = 6;
@@ -6778,8 +6875,8 @@ sal_Bool SvxMSDffManager::ShapeHasText( sal_uLong /* nShapeId */, sal_uLong /* n
// --> OD 2004-12-14 #i32596# - add new parameter <_nCalledByGroup>
SdrObject* SvxMSDffManager::ImportOLE( long nOLEId,
const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
const int /* _nCalledByGroup */,
sal_Int64 nAspect ) const
// <--
@@ -6790,9 +6887,18 @@ SdrObject* SvxMSDffManager::ImportOLE( long nOLEId,
ErrCode nError = ERRCODE_NONE;
uno::Reference < embed::XStorage > xDstStg;
if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg ))
- pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg,
- rGrf, rBoundRect, rVisArea, pStData, nError,
- nSvxMSDffOLEConvFlags, nAspect );
+ pRet = CreateSdrOLEFromStorage(
+ *GetModel(),
+ sStorageName,
+ xSrcStg,
+ xDstStg,
+ rGrf,
+ rBoundRect,
+ rVisArea,
+ pStData,
+ nError,
+ nSvxMSDffOLEConvFlags,
+ nAspect );
return pRet;
}
@@ -7115,7 +7221,7 @@ const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName )
com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( sal_uInt32 nConvertFlags,
SotStorage& rSrcStg, const uno::Reference < embed::XStorage >& rDestStorage,
const Graphic& rGrf,
- const Rectangle& rVisArea )
+ const basegfx::B2DRange& rVisArea )
{
uno::Reference < embed::XEmbeddedObject > xObj;
SvGlobalName aStgNm = rSrcStg.GetClassName();
@@ -7262,11 +7368,11 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS
{
MapMode aMapMode( VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nViewAspect ) ) );
Size aSz;
- if ( rVisArea.IsEmpty() )
+ if ( rVisArea.isEmpty() )
aSz = lcl_GetPrefSize(rGrf, aMapMode );
else
{
- aSz = rVisArea.GetSize();
+ aSz = Size(basegfx::fround(rVisArea.getWidth()), basegfx::fround(rVisArea.getHeight()));
aSz = OutputDevice::LogicToLogic( aSz, MapMode( MAP_100TH_MM ), aMapMode );
}
@@ -7292,12 +7398,13 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS
// TODO/MBA: code review and testing!
SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
+ SdrModel& rTargetModel,
const String& rStorageName,
SotStorageRef& rSrcStorage,
const uno::Reference < embed::XStorage >& xDestStorage,
const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
SvStream* pDataStrm,
ErrCode& rError,
sal_uInt32 nConvertFlags,
@@ -7371,7 +7478,14 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
aObj.SetGraphic( rGrf, ::rtl::OUString() );
// TODO/MBA: check setting of PersistName
- pRet = new SdrOle2Obj( aObj, String(), rBoundRect, false);
+ pRet = new SdrOle2Obj(
+ rTargetModel,
+ aObj,
+ String(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rBoundRect.getRange(),
+ rBoundRect.getMinimum()),
+ false);
// we have the Object, don't create another
bValidStorage = false;
}
@@ -7436,7 +7550,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
try
{
// the provided visual area should be used, if there is any
- if ( rVisArea.IsEmpty() )
+ if ( rVisArea.isEmpty() )
{
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
Size aSz(lcl_GetPrefSize(rGrf, MapMode(aMapUnit)));
@@ -7445,8 +7559,8 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
}
else
{
- aAwtSz.Width = rVisArea.GetWidth();
- aAwtSz.Height = rVisArea.GetHeight();
+ aAwtSz.Width = basegfx::fround(rVisArea.getWidth());
+ aAwtSz.Height = basegfx::fround(rVisArea.getHeight());
}
//xInplaceObj->EnableSetModified( sal_False );
xObj->setVisualAreaSize( nAspect, aAwtSz );
@@ -7463,7 +7577,14 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
// TODO/LATER: need MediaType
aObj.SetGraphic( rGrf, ::rtl::OUString() );
- pRet = new SdrOle2Obj( aObj, aDstStgName, rBoundRect, false);
+ pRet = new SdrOle2Obj(
+ rTargetModel,
+ aObj,
+ aDstStgName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rBoundRect.getRange(),
+ rBoundRect.getMinimum()),
+ false);
}
}
}
@@ -7477,7 +7598,7 @@ SdrObject* SvxMSDffManager::GetAutoForm( MSO_SPT eTyp ) const
if(120 >= sal_uInt16(eTyp))
{
- pRet = new SdrRectObj();
+ pRet = new SdrRectObj(*GetModel());
}
DBG_ASSERT(pRet, "SvxMSDffManager::GetAutoForm -> UNKNOWN AUTOFORM");
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 51af756dc9d4..5c2f2c62e970 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -56,10 +56,9 @@
#include <editeng/outlobj.hxx>
#include <svx/svdattr.hxx>
#include "svx/xattr.hxx"
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
#include <svx/svdetc.hxx>
#include <editeng/bulitem.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/extrud3d.hxx>
#include <svx/svdoashp.hxx>
#include <editeng/tstpitem.hxx>
@@ -130,6 +129,7 @@
#include <com/sun/star/table/XMergeableCellRange.hpp>
#include <com/sun/star/table/BorderLine.hpp>
#include <vcl/virdev.hxx>
+#include <svx/svdlegacy.hxx>
#include <algorithm>
#include <set>
@@ -636,7 +636,7 @@ sal_Bool SdrEscherImport::ReadString( String& rStr ) const
|| aStrHd.nRecType == PPT_PST_TextCharsAtom
|| aStrHd.nRecType == PPT_PST_CString)
{
- sal_Bool bUniCode =
+ bool bUniCode =
(aStrHd.nRecType == PPT_PST_TextCharsAtom
|| aStrHd.nRecType == PPT_PST_CString);
bRet=sal_True;
@@ -649,7 +649,7 @@ sal_Bool SdrEscherImport::ReadString( String& rStr ) const
return bRet;
}
-FASTBOOL SdrEscherImport::GetColorFromPalette(sal_uInt16 /*nNum*/, Color& /*rColor*/) const
+bool SdrEscherImport::GetColorFromPalette(sal_uInt16 /*nNum*/, Color& /*rColor*/) const
{
return sal_False;
}
@@ -705,7 +705,7 @@ void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd,
Scale( t );
Scale( r );
Scale( b );
- rObj.aChildAnchor = Rectangle( l, t, r, b );
+ rObj.aChildAnchor = basegfx::B2DRange( l, t, r, b );
rObj.bChildAnchor = sal_True;
return;
};
@@ -822,9 +822,9 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic
The parameter pOriginalObj is the object as it was imported by our general escher import, it must either
be deleted or it can be returned to be inserted into the sdr page.
*/
-SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, Rectangle& rTextRect, SdrObject* pOriginalObj )
+SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, basegfx::B2DRange& rTextRect, SdrObject* pOriginalObj )
{
- if ( pOriginalObj && pOriginalObj->ISA( SdrObjCustomShape ) )
+ if ( pOriginalObj && dynamic_cast< SdrObjCustomShape* >(pOriginalObj) )
pOriginalObj->SetMergedItem( SdrTextFixedCellHeightItem( sal_True ) );
// we are initializing our return value with the object that was imported by our escher import
@@ -867,11 +867,13 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
case PPT_PST_RecolorInfoAtom :
{
- if ( pRet && ( pRet->ISA( SdrGrafObj ) && ((SdrGrafObj*)pRet)->HasGDIMetaFile() ) )
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pRet);
+
+ if ( pSdrGrafObj && pSdrGrafObj->HasGDIMetaFile() )
{
- Graphic aGraphic( ((SdrGrafObj*)pRet)->GetGraphic() );
+ Graphic aGraphic( pSdrGrafObj->GetGraphic() );
RecolorGraphic( rSt, aClientDataHd.nRecLen, aGraphic );
- ((SdrGrafObj*)pRet)->SetGraphic( aGraphic );
+ pSdrGrafObj->SetGraphic( aGraphic );
}
}
break;
@@ -886,8 +888,13 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
nPageNum--;
// replacing the object which we will return with a SdrPageObj
- SdrObject::Free( pRet );
- pRet = new SdrPageObj( rObjData.aBoundRect, pSdrModel->GetPage( nPageNum - 1 ) );
+ deleteSdrObjectSafeAndClearPointer( pRet );
+ pRet = new SdrPageObj(
+ *pSdrModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rObjData.aBoundRect.getRange(),
+ rObjData.aBoundRect.getMinimum()),
+ pSdrModel->GetPage( nPageNum - 1 ) );
}
else
{
@@ -936,10 +943,13 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( pRet )
{
sal_Bool bDeleteSource = aTextObj.GetOEPlaceHolderAtom() != 0;
- if ( bDeleteSource && ( pRet->ISA( SdrGrafObj ) == sal_False ) // we are not allowed to get
- && ( pRet->ISA( SdrObjGroup ) == sal_False ) // grouped placeholder objects
- && ( pRet->ISA( SdrOle2Obj ) == sal_False ) )
- SdrObject::Free( pRet );
+ if ( bDeleteSource
+ && ( !dynamic_cast< SdrGrafObj* >(pRet) ) // we are not allowed to get
+ && ( !dynamic_cast< SdrObjGroup* >(pRet) ) // grouped placeholder objects
+ && ( !dynamic_cast< SdrOle2Obj* >(pRet) ) )
+ {
+ deleteSdrObjectSafeAndClearPointer( pRet );
+ }
}
sal_uInt32 nTextFlags = aTextObj.GetTextFlags();
sal_Int32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 25 * 3600 ); // 0.25 cm (emu)
@@ -1015,7 +1025,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
break;
}
- nMinFrameWidth = rTextRect.GetWidth() - ( nTextLeft + nTextRight );
+ nMinFrameWidth = basegfx::fround(rTextRect.getWidth()) - ( nTextLeft + nTextRight );
}
else
{
@@ -1071,7 +1081,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
break;
}
- nMinFrameHeight = rTextRect.GetHeight() - ( nTextTop + nTextBottom );
+ nMinFrameHeight = basegfx::fround(rTextRect.getHeight()) - ( nTextTop + nTextBottom );
}
SdrObjKind eTextKind = OBJ_RECT;
@@ -1140,7 +1150,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
sal_Bool bWordWrap = (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone;
sal_Bool bFitShapeToText = ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0;
- if ( pRet && pRet->ISA( SdrObjCustomShape ) && ( eTextKind == OBJ_RECT ) )
+ if ( pRet && dynamic_cast< SdrObjCustomShape* >(pRet) && ( eTextKind == OBJ_RECT ) )
{
bAutoGrowHeight = bFitShapeToText;
if ( bWordWrap )
@@ -1152,13 +1162,17 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
else
{
- if ( pRet && pRet->ISA( SdrObjCustomShape ) )
+ if ( pRet && dynamic_cast< SdrObjCustomShape* >(pRet) )
{
- SdrObject::Free( pRet );
- pRet = NULL;
+ deleteSdrObjectSafeAndClearPointer( pRet );
}
- pTObj = new SdrRectObj( eTextKind != OBJ_RECT ? eTextKind : OBJ_TEXT );
- pTObj->SetModel( pSdrModel );
+ pTObj = new SdrRectObj(
+ *pSdrModel,
+ basegfx::B2DHomMatrix(),
+ eTextKind != OBJ_RECT ? eTextKind : OBJ_TEXT,
+ true);
+
+ // pTObj->SetModel( pSdrModel );
SfxItemSet aSet( pSdrModel->GetItemPool() );
if ( !pRet )
((SdrEscherImport*)this)->ApplyAttributes( rSt, aSet, rObjData );
@@ -1185,15 +1199,15 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
- if ( !pTObj->ISA( SdrObjCustomShape ) )
+ if ( !dynamic_cast< SdrObjCustomShape* >(pTObj) )
{
- pTObj->SetMergedItem( SdrTextAutoGrowWidthItem( bAutoGrowWidth ) );
- pTObj->SetMergedItem( SdrTextAutoGrowHeightItem( bAutoGrowHeight ) );
+ pTObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, bAutoGrowWidth ) );
+ pTObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, bAutoGrowHeight ) );
}
else
{
- pTObj->SetMergedItem( SdrTextWordWrapItem( bWordWrap ) );
- pTObj->SetMergedItem( SdrTextAutoGrowHeightItem( bFitShapeToText ) );
+ pTObj->SetMergedItem( SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, bWordWrap ) );
+ pTObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, bFitShapeToText ) );
}
pTObj->SetMergedItem( SdrTextVertAdjustItem( eTVA ) );
@@ -1201,23 +1215,26 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( nMinFrameHeight < 0 )
nMinFrameHeight = 0;
- if ( !pTObj->ISA( SdrObjCustomShape ) )
- pTObj->SetMergedItem( SdrTextMinFrameHeightItem( nMinFrameHeight ) );
+ if ( !dynamic_cast< SdrObjCustomShape* >(pTObj) )
+ pTObj->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, nMinFrameHeight ) );
if ( nMinFrameWidth < 0 )
nMinFrameWidth = 0;
- if ( !pTObj->ISA( SdrObjCustomShape ) )
- pTObj->SetMergedItem( SdrTextMinFrameWidthItem( nMinFrameWidth ) );
+ if ( !dynamic_cast< SdrObjCustomShape* >(pTObj) )
+ pTObj->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, nMinFrameWidth ) );
// Abstaende an den Raendern der Textbox setzen
- pTObj->SetMergedItem( SdrTextLeftDistItem( nTextLeft ) );
- pTObj->SetMergedItem( SdrTextRightDistItem( nTextRight ) );
- pTObj->SetMergedItem( SdrTextUpperDistItem( nTextTop ) );
- pTObj->SetMergedItem( SdrTextLowerDistItem( nTextBottom ) );
+ pTObj->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, nTextLeft ) );
+ pTObj->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, nTextRight ) );
+ pTObj->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, nTextTop ) );
+ pTObj->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, nTextBottom ) );
pTObj->SetMergedItem( SdrTextFixedCellHeightItem( sal_True ) );
- if ( !pTObj->ISA( SdrObjCustomShape ) )
- pTObj->SetSnapRect( rTextRect );
+ if ( !dynamic_cast< SdrObjCustomShape* >(pTObj) )
+ {
+ sdr::legacy::SetSnapRange(*pTObj, rTextRect );
+ }
+
pTObj = ReadObjText( &aTextObj, pTObj, rData.pPage );
if ( pTObj )
{
@@ -1227,9 +1244,9 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
snaprect of the object. Then we will use
ADJUST_CENTER instead of ADJUST_BLOCK.
*/
- if ( !pTObj->ISA( SdrObjCustomShape ) && !bFitShapeToText && !bWordWrap )
+ if ( !dynamic_cast< SdrObjCustomShape* >(pTObj) && !bFitShapeToText && !bWordWrap )
{
- SdrTextObj* pText = PTR_CAST( SdrTextObj, pTObj );
+ SdrTextObj* pText = dynamic_cast< SdrTextObj* >( pTObj );
if ( pText )
{
if ( bVerticalText )
@@ -1239,7 +1256,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
Size aTextSize( pText->GetTextSize() );
aTextSize.Width() += nTextLeft + nTextRight;
aTextSize.Height() += nTextTop + nTextBottom;
- if ( rTextRect.GetHeight() < aTextSize.Height() )
+ if ( rTextRect.getHeight() < aTextSize.Height() )
pTObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
}
}
@@ -1250,7 +1267,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
Size aTextSize( pText->GetTextSize() );
aTextSize.Width() += nTextLeft + nTextRight;
aTextSize.Height() += nTextTop + nTextBottom;
- if ( rTextRect.GetWidth() < aTextSize.Width() )
+ if ( rTextRect.getWidth() < aTextSize.Width() )
pTObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
}
}
@@ -1260,7 +1277,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
sal_Int32 nAngle = ( rObjData.nSpFlags & SP_FFLIPV ) ? -mnFix16Angle : mnFix16Angle; // #72116# vertical flip -> rotate by using the other way
nAngle += nTextRotationAngle;
- if ( pTObj->ISA( SdrObjCustomShape ) )
+ if ( dynamic_cast< SdrObjCustomShape* >(pTObj) )
{
/*
if ( nTextRotationAngle )
@@ -1280,22 +1297,36 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
if ( rObjData.nSpFlags & SP_FFLIPV )
{
- double a = 18000 * nPi180;
- pTObj->Rotate( rTextRect.Center(), 18000, sin( a ), cos( a ) );
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-rTextRect.getCenter());
+ aTransform.rotate(-F_PI);
+ aTransform.translate(rTextRect.getCenter());
+
+ sdr::legacy::transformSdrObject(*pTObj, aTransform);
}
+
if ( rObjData.nSpFlags & SP_FFLIPH )
+ {
nAngle = 36000 - nAngle;
+ }
+
if ( nAngle )
{
- double a = nAngle * nPi180;
- pTObj->NbcRotate( rObjData.aBoundRect.Center(), nAngle, sin( a ), cos( a ) );
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-rObjData.aBoundRect.getCenter());
+ aTransform.rotate((-nAngle * F_PI) / 18000.0);
+ aTransform.translate(rObjData.aBoundRect.getCenter());
+
+ sdr::legacy::transformSdrObject(*pTObj, aTransform);
}
}
if ( pRet )
{
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->GetSubList()->NbcInsertObject( pRet );
- pGroup->GetSubList()->NbcInsertObject( pTObj );
+ SdrObjGroup* pGroup = new SdrObjGroup(*pSdrModel);
+ pGroup->InsertObjectToSdrObjList(*pRet);
+ pGroup->InsertObjectToSdrObjList(*pTObj);
pRet = pGroup;
}
else
@@ -1335,7 +1366,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
if ( rObjData.nSpFlags & SP_FBACKGROUND )
{
- pRet->NbcSetSnapRect( Rectangle( Point(), ((SdrPage*)rData.pPage)->GetSize() ) ); // Groesse setzen
+ sdr::legacy::SetSnapRange(*pRet, basegfx::B2DRange( basegfx::B2DPoint(0.0, 0.0), ((SdrPage*)rData.pPage)->GetPageScale() ) ); // Groesse setzen
}
if ( rPersistEntry.pSolverContainer )
{
@@ -1347,7 +1378,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
else
{
SdrObject* pConnectObj = pRet;
- if ( pOriginalObj && pRet->ISA( SdrObjGroup ) )
+
+ if ( pOriginalObj && dynamic_cast< SdrObjGroup* >(pRet) )
{ /* check if the original object from the escherimport is part of the group object,
if this is the case, we will use the original object to connect to */
SdrObjListIter aIter( *pRet, IM_DEEPWITHGROUPS );
@@ -1898,8 +1930,8 @@ sal_Bool SdrPowerPointOLEDecompress( SvStream& rOutput, SvStream& rInput, sal_uI
// --> OD 2004-12-14 #i32596# - add new parameter <_nCalledByGroup>
SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
const Graphic& rGraf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
const int /*_nCalledByGroup*/,
sal_Int64 /*nAspect*/ ) const
// <--
@@ -1997,7 +2029,14 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
// TODO/LATER: need MediaType for Graphic
aObj.SetGraphic( rGraf, ::rtl::OUString() );
- pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, sal_False );
+ pRet = new SdrOle2Obj(
+ *pSdrModel,
+ aObj,
+ aNm,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rBoundRect.getRange(),
+ rBoundRect.getMinimum()),
+ false);
}
}
if ( !pRet && ( pOe->nType == PPT_PST_ExControl ) )
@@ -2032,8 +2071,8 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
{
//TODO/LATER: keep on hacking?!
// modifiziert wollen wir nicht werden
- //xInplaceObj->EnableSetModified( sal_False );
- if ( rVisArea.IsEmpty() )
+ //xInplaceObj->EnableSetModified( FALSE );
+ if ( rVisArea.isEmpty() )
{
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( pOe->nAspect ) );
Size aSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(),
@@ -2046,7 +2085,9 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
}
else
{
- awt::Size aSize( rVisArea.GetSize().Width(), rVisArea.GetSize().Height() );
+ awt::Size aSize(
+ basegfx::fround(rVisArea.getWidth()),
+ basegfx::fround(rVisArea.getHeight()));
xObj->setVisualAreaSize( pOe->nAspect, aSize );
}
//xInplaceObj->EnableSetModified( sal_True );
@@ -2057,7 +2098,14 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
// TODO/LATER: need MediaType for Graphic
aObj.SetGraphic( aGraphic, ::rtl::OUString() );
- pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, sal_False );
+ pRet = new SdrOle2Obj(
+ *pSdrModel,
+ aObj,
+ aNm,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rBoundRect.getRange(),
+ rBoundRect.getMinimum()),
+ false);
}
}
}
@@ -2310,8 +2358,8 @@ sal_Bool SdrPowerPointImport::ReadFontCollection()
pDbgOut->Seek( STREAM_SEEK_TO_END );
Printer* pPrinter = NULL;
- if ( pSdrModel->GetRefDevice() && pSdrModel->GetRefDevice()->GetOutDevType() == OUTDEV_PRINTER )
- pPrinter = (Printer*)pSdrModel->GetRefDevice();
+ if ( pSdrModel->GetReferenceDevice() && pSdrModel->GetReferenceDevice()->GetOutDevType() == OUTDEV_PRINTER )
+ pPrinter = (Printer*)pSdrModel->GetReferenceDevice();
if ( pPrinter )
{
Font aOldFont( pPrinter->GetFont() );
@@ -2390,7 +2438,7 @@ SdrOutliner* SdrPowerPointImport::GetDrawOutliner( SdrTextObj* pSdrText ) const
SdrObject* SdrPowerPointImport::ReadObjText( PPTTextObj* pTextObj, SdrObject* pSdrObj, SdPage* pPage ) const
{
- SdrTextObj* pText = PTR_CAST( SdrTextObj, pSdrObj );
+ SdrTextObj* pText = dynamic_cast< SdrTextObj* >( pSdrObj );
if ( pText )
{
if ( !ApplyTextObj( pTextObj, pText, pPage, NULL, NULL ) )
@@ -2691,7 +2739,7 @@ Size SdrPowerPointImport::GetPageSize() const
// vermeiden runde ich die letzte Nachkommastelle metrisch weg.
if ( nMapMul > 2 * nMapDiv )
{
- MapUnit eMap = pSdrModel->GetScaleUnit();
+ MapUnit eMap = pSdrModel->GetExchangeObjectUnit();
bool bInch = IsInch( eMap );
long nInchMul = 1, nInchDiv = 1;
if ( bInch )
@@ -2713,7 +2761,7 @@ Size SdrPowerPointImport::GetPageSize() const
return aRet;
}
-FASTBOOL SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const
+bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const
{
if ( nPageColorsNum != nAktPageNum || ePageColorsKind != eAktPageKind )
{
@@ -2837,7 +2885,8 @@ sal_Bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal
SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const
{
SdrPage* pRet = pSdrModel->AllocPage( bMaster );
- pRet->SetSize( GetPageSize() );
+ const Size aPageSize(GetPageSize());
+ pRet->SetPageScale( basegfx::B2DVector( aPageSize.Width(), aPageSize.Height() ) );
/*
SJ (21.08.00) : since bug #77576# i decided not to set a border size.
@@ -2848,14 +2897,14 @@ SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const
if ( nHMarg > 0 )
{
Scale( nHMarg );
- pRet->SetLftBorder( nHMarg / 2 );
- pRet->SetRgtBorder( nHMarg - nHMarg / 2 );
+ pRet->SetLeftPageBorder( nHMarg / 2 );
+ pRet->SetRightPageBorder( nHMarg - nHMarg / 2 );
}
if ( nVMarg > 0 )
{
Scale( nVMarg );
- pRet->SetUppBorder( nVMarg / 2 );
- pRet->SetLwrBorder( nVMarg - nVMarg / 2 );
+ pRet->SetTopPageBorder( nVMarg / 2 );
+ pRet->SetBottomPageBorder( nVMarg - nVMarg / 2 );
}
*/
return pRet;
@@ -2997,7 +3046,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
{
case DFF_msofbtSpContainer :
{
- Rectangle aPageSize( Point(), pRet->GetSize() );
+ basegfx::B2DRange aPageSize( basegfx::B2DPoint(0.0, 0.0), pRet->GetPageScale() );
if ( rSlidePersist.aSlideAtom.nFlags & 4 ) // follow master background ?
{
if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
@@ -3068,7 +3117,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
rStCtrl >> aShapeHd;
if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) || ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
{
- Rectangle aEmpty;
+ basegfx::B2DRange aEmpty;
aShapeHd.SeekToBegOfRecord( rStCtrl );
sal_Int32 nShapeId;
aProcessData.pTableRowProperties = NULL;
@@ -3078,7 +3127,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
if ( aProcessData.pTableRowProperties )
pObj = CreateTable( pObj, aProcessData.pTableRowProperties, aProcessData.rPersistEntry.pSolverContainer );
- pRet->NbcInsertObject( pObj );
+ pRet->InsertObjectToSdrObjList(*pObj);
if( nShapeId )
insertShapeId( nShapeId, pObj );
@@ -3130,7 +3179,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
// obsolete here, too.
pRet->getSdrPageProperties().ClearItem();
pRet->getSdrPageProperties().PutItemSet(rSlidePersist.pBObj->GetMergedItemSet());
- SdrObject::Free( rSlidePersist.pBObj );
+ deleteSdrObjectSafeAndClearPointer( rSlidePersist.pBObj );
}
}
}
@@ -3238,7 +3287,7 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage
mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
sal_uInt32 nColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
pSet = new SfxItemSet( pSdrModel->GetItemPool() );
- DffObjData aObjData( aEscherObjectHd, Rectangle( 0, 0, 28000, 21000 ), 0 );
+ DffObjData aObjData( aEscherObjectHd, basegfx::B2DRange( 0.0, 0.0, 28000.0, 21000.0 ), 0 );
ApplyAttributes( rStCtrl, *pSet, aObjData );
Color aColor( MSO_CLR_ToColor( nColor ) );
pSet->Put( XFillColorItem( String(), aColor ) );
@@ -3256,12 +3305,17 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage
pSet->Put( XFillStyleItem( XFILL_NONE ) );
}
pSet->Put( XLineStyleItem( XLINE_NONE ) );
- Rectangle aRect( rPage.GetLftBorder(), rPage.GetUppBorder(), rPage.GetWdt()-rPage.GetRgtBorder(), rPage.GetHgt()-rPage.GetLwrBorder() );
- pRet = new SdrRectObj( aRect );
- pRet->SetModel( pSdrModel );
- pRet->SetMergedItemSet(*pSet);
+ const basegfx::B2DRange aRect( rPage.GetInnerPageRange() );
+
+ pRet = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getRange(),
+ aRect.getMinimum()));
+ // pRet->SetModel( pSdrModel );
+ pRet->SetMergedItemSet(*pSet);
pRet->SetMarkProtect( sal_True );
pRet->SetMoveProtect( sal_True );
pRet->SetResizeProtect( sal_True );
@@ -7254,7 +7308,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( pCurrent->mpFieldItem )
{
pCurrent->SetColor( PPT_COLSCHEME_A_UND_HYPERLINK );
- if ( pCurrent->mpFieldItem->GetField()->ISA( SvxURLField ) )
+ if ( dynamic_cast< const SvxURLField* >(pCurrent->mpFieldItem->GetField()) )
break;
nHyperLenLeft--;
}
@@ -7400,15 +7454,22 @@ PPTTextObj& PPTTextObj::operator=( PPTTextObj& rTextObj )
return *this;
}
-sal_Bool IsLine( const SdrObject* pObj )
+bool IsLine( const SdrObject* pObj )
{
- return pObj->ISA( SdrPathObj ) && ((SdrPathObj*)pObj)->IsLine() && (((SdrPathObj*)pObj)->GetPointCount() == 2 );
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
+ {
+ return pSdrPathObj->isLine();
+ }
+
+ return false;
}
sal_Bool GetCellPosition( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns,
sal_Int32& nTableIndex, sal_Int32& nRow, sal_Int32& nRowCount, sal_Int32& nColumn, sal_Int32& nColumnCount )
{
- Rectangle aSnapRect( pObj->GetSnapRect() );
+ const Rectangle aSnapRect( sdr::legacy::GetSnapRect(*pObj) );
sal_Bool bCellObject = ( aSnapRect.GetWidth() > 1 ) && ( aSnapRect.GetHeight() > 1 );
if ( bCellObject )
{
@@ -7492,7 +7553,7 @@ void GetColumnPositions( const Rectangle& rSnapRect, const std::set< sal_Int32 >
void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows, const std::set< sal_Int32 >& rColumns,
std::vector< sal_Int32 >& rPositions, const Rectangle& rGroupSnap )
{
- Rectangle aSnapRect( pObj->GetSnapRect() );
+ const Rectangle aSnapRect( sdr::legacy::GetSnapRect(*pObj) );
if ( aSnapRect.Left() == aSnapRect.Right() )
{
std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( aSnapRect.Left() ) );
@@ -7537,16 +7598,20 @@ void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows
}
else
{
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
+ {
sal_uInt32 nPosition = 0;
- Point aPt1( ((SdrPathObj*)pObj)->GetPoint( 0 ) );
- Point aPt2( ((SdrPathObj*)pObj)->GetPoint( 1 ) );
- if ( aPt1.X() < aPt2.X() )
- nPosition |= aPt1.Y() < aPt2.Y() ? LinePositionTLBR : LinePositionBLTR;
+ const basegfx::B2DPoint aPt1( pSdrPathObj->GetObjectPoint( 0 ) );
+ const basegfx::B2DPoint aPt2( pSdrPathObj->GetObjectPoint( 1 ) );
+ if ( aPt1.getX() < aPt2.getX() )
+ nPosition |= aPt1.getY() < aPt2.getY() ? LinePositionTLBR : LinePositionBLTR;
else
- nPosition |= aPt1.Y() < aPt2.Y() ? LinePositionBLTR : LinePositionTLBR;
+ nPosition |= aPt1.getY() < aPt2.getY() ? LinePositionBLTR : LinePositionTLBR;
- std::set< sal_Int32 >::const_iterator aRow( rRows.find( aPt1.Y() < aPt2.Y() ? aPt1.Y() : aPt2.Y() ) );
- std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( aPt1.X() < aPt2.X() ? aPt1.X() : aPt2.X() ) );
+ std::set< sal_Int32 >::const_iterator aRow( rRows.find( aPt1.getY() < aPt2.getY() ? basegfx::fround(aPt1.getY()) : basegfx::fround(aPt2.getY()) ) );
+ std::set< sal_Int32 >::const_iterator aColumn( rColumns.find( aPt1.getX() < aPt2.getX() ? basegfx::fround(aPt1.getX()) : basegfx::fround(aPt2.getX()) ) );
if ( ( aRow != rRows.end() ) && ( aColumn != rColumns.end() ) )
{
nPosition |= ( std::distance( rRows.begin(), aRow ) * rColumns.size() ) + std::distance( rColumns.begin(), aColumn );
@@ -7554,6 +7619,7 @@ void GetLinePositions( const SdrObject* pObj, const std::set< sal_Int32 >& rRows
}
}
}
+}
void CreateTableRows( Reference< XTableRows > xTableRows, const std::set< sal_Int32 >& rRows, sal_Int32 nTableBottom )
{
@@ -7630,10 +7696,10 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
{
Reference< XPropertySet > xPropSet( xCell, UNO_QUERY_THROW );
- const sal_Int32 nLeftDist(((const SdrTextLeftDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST)).GetValue());
- const sal_Int32 nRightDist(((const SdrTextRightDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST)).GetValue());
- const sal_Int32 nUpperDist(((const SdrTextUpperDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST)).GetValue());
- const sal_Int32 nLowerDist(((const SdrTextLowerDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST)).GetValue());
+ const sal_Int32 nLeftDist(((const SdrMetricItem&)pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST)).GetValue());
+ const sal_Int32 nRightDist(((const SdrMetricItem&)pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST)).GetValue());
+ const sal_Int32 nUpperDist(((const SdrMetricItem&)pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST)).GetValue());
+ const sal_Int32 nLowerDist(((const SdrMetricItem&)pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST)).GetValue());
static const rtl::OUString sTopBorder( RTL_CONSTASCII_USTRINGPARAM( "TextUpperDistance" ) );
static const rtl::OUString sBottomBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLowerDistance" ) );
static const rtl::OUString sLeftBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLeftDistance" ) );
@@ -7653,7 +7719,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
xPropSet->setPropertyValue( sTextVerticalAdjust, Any( eVA ) );
//set textHorizontalAdjust and TextWritingMode attr
- const sal_Int32 eHA(((const SdrTextLeftDistItem&)pObj->GetMergedItem(SDRATTR_TEXT_HORZADJUST)).GetValue());
+ const sal_Int32 eHA(((const SdrMetricItem&)pObj->GetMergedItem(SDRATTR_TEXT_HORZADJUST)).GetValue());
const SvxFrameDirection eDirection = (const SvxFrameDirection)((( const SvxFrameDirectionItem&)pObj->GetMergedItem(EE_PARA_WRITINGDIR)).GetValue());
static const rtl::OUString sHorizontalAdjust( RTL_CONSTASCII_USTRINGPARAM( "TextHorizontalAdjust" ) );
static const rtl::OUString sWritingMode( RTL_CONSTASCII_USTRINGPARAM("TextWritingMode") );
@@ -7811,9 +7877,9 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
{
SdrObject* pRet = pGroup;
sal_uInt32 nRows = pTableArry[ 1 ];
- if ( nRows && pGroup->ISA( SdrObjGroup ) )
+ if ( nRows && dynamic_cast< SdrObjGroup* >(pGroup) )
{
- SdrObjList* pSubList(((SdrObjGroup*)pGroup)->GetSubList());
+ SdrObjList* pSubList(pGroup->getChildrenOfSdrObject());
if ( pSubList )
{
std::set< sal_Int32 > aRows;
@@ -7825,20 +7891,20 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
const SdrObject* pObj( aGroupIter.Next() );
if ( !IsLine( pObj ) )
{
- Rectangle aSnapRect( pObj->GetSnapRect() );
+ const Rectangle aSnapRect( sdr::legacy::GetSnapRect(*pObj) );
aRows.insert( aSnapRect.Top() );
aColumns.insert( aSnapRect.Left() );
}
}
- ::sdr::table::SdrTableObj* pTable = new ::sdr::table::SdrTableObj( pSdrModel );
+ ::sdr::table::SdrTableObj* pTable = new ::sdr::table::SdrTableObj(*pSdrModel);
pTable->uno_lock();
Reference< XTable > xTable( pTable->getTable() );
try
{
Reference< XColumnRowRange > xColumnRowRange( xTable, UNO_QUERY_THROW );
-
- CreateTableRows( xColumnRowRange->getRows(), aRows, pGroup->GetSnapRect().Bottom() );
- CreateTableColumns( xColumnRowRange->getColumns(), aColumns, pGroup->GetSnapRect().Right() );
+ const Rectangle aGroupRectangle(sdr::legacy::GetSnapRect(*pGroup));
+ CreateTableRows( xColumnRowRange->getRows(), aRows, aGroupRectangle.Bottom() );
+ CreateTableColumns( xColumnRowRange->getColumns(), aColumns, aGroupRectangle.Right() );
sal_Int32 nCellCount = aRows.size() * aColumns.size();
sal_Int32 *pMergedCellIndexTable = new sal_Int32[ nCellCount ];
@@ -7851,7 +7917,6 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
SdrObject* pObj( aGroupIter.Next() );
if ( !IsLine( pObj ) )
{
- Rectangle aSnapRect( pObj->GetSnapRect() );
sal_Int32 nTableIndex = 0;
sal_Int32 nRow = 0;
sal_Int32 nRowCount = 0;
@@ -7894,7 +7959,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
if ( IsLine( pObj ) )
{
std::vector< sal_Int32 > vPositions; // containing cell indexes + cell position
- GetLinePositions( pObj, aRows, aColumns, vPositions, pGroup->GetSnapRect() );
+ GetLinePositions( pObj, aRows, aColumns, vPositions, aGroupRectangle );
// correcting merged cell position
std::vector< sal_Int32 >::iterator aIter( vPositions.begin() );
@@ -7936,7 +8001,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
}
}
pTable->uno_unlock();
- pTable->SetSnapRect( pGroup->GetSnapRect() );
+ sdr::legacy::SetSnapRect(*pTable, aGroupRectangle );
pRet = pTable;
//Remove Objects from shape map
@@ -7947,13 +8012,13 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
removeShapeId( pPartObj );
}
- SdrObject::Free( pGroup );
+ deleteSdrObjectSafeAndClearPointer( pGroup );
}
catch( Exception& )
{
pTable->uno_unlock();
SdrObject* pObj = pTable;
- SdrObject::Free( pObj );
+ deleteSdrObjectSafeAndClearPointer( pObj );
}
}
}
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 59644118ce01..408552908709 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -189,7 +189,7 @@ sal_Bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter, Reference< com:
if( pOut )
{
- vcl::PDFExtOutDevData* pPDFExtOutDevData = PTR_CAST( vcl::PDFExtOutDevData, pOut->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >( pOut->GetExtOutDevData() );
if ( nPageCount )
{
pPDFExtOutDevData->SetIsExportNotesPages( bExportNotesPages );
@@ -1039,7 +1039,7 @@ sal_Bool PDFExport::ImplExportPage( PDFWriter& rWriter, PDFExtOutDevData& rPDFEx
aCtx.m_nJPEGQuality = mnQuality;
- basegfx::B2DRectangle aB2DRect( aPageRect.Left(), aPageRect.Top(), aPageRect.Right(), aPageRect.Bottom() );
+ const basegfx::B2DRectangle aB2DRect( aPageRect.Left(), aPageRect.Top(), aPageRect.Right(), aPageRect.Bottom() );
rWriter.SetClipRegion( basegfx::B2DPolyPolygon( basegfx::tools::createPolygonFromRect( aB2DRect ) ) );
rWriter.PlayMetafile( aMtf, aCtx, &rPDFExtOutDevData );
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index fe8ff0857c84..1938ee451db2 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -38,6 +38,8 @@
#include <editeng/outliner.hxx>
#include <editeng/flditem.hxx>
#include <editeng/numitem.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdetc.hxx>
using ::rtl::OUString;
@@ -304,7 +306,7 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
if( pSvxDrawPage )
{
mpDefaultSdrPage = pSvxDrawPage->GetSdrPage();
- mpSdrModel = mpDefaultSdrPage->GetModel();
+ mpSdrModel = &mpDefaultSdrPage->getSdrModelFromSdrPage();
if( mpSdrModel )
{
@@ -969,24 +971,27 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XShape >& rxSha
if( pObj )
{
- Graphic aGraphic( SdrExchangeView::GetObjGraphic( pObj->GetModel(), pObj ) );
+ const Graphic aGraphic(GetObjGraphic(*pObj));
- if( aGraphic.GetType() != GRAPHIC_NONE )
+ if(GRAPHIC_NONE != aGraphic.GetType())
{
- if( aGraphic.GetType() == GRAPHIC_BITMAP )
+ if(GRAPHIC_BITMAP == aGraphic.GetType())
{
GDIMetaFile aMtf;
- const Point aNullPt;
- const Size aSize( pObj->GetCurrentBoundRect().GetSize() );
+ const basegfx::B2DRange& rRange = pObj->getObjectRange(0);
+ const basegfx::B2DVector aSize(rRange.getRange());
+ const Size aOldSize(basegfx::fround(aSize.getX()), basegfx::fround(aSize.getY()));
- aMtf.AddAction( new MetaBmpExScaleAction( aNullPt, aSize, aGraphic.GetBitmapEx() ) );
- aMtf.SetPrefSize( aSize );
+ aMtf.AddAction(new MetaBmpExScaleAction(Point(), aOldSize, aGraphic.GetBitmapEx()));
+ aMtf.SetPrefSize(aOldSize);
aMtf.SetPrefMapMode( MAP_100TH_MM );
(*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aMtf );
}
else
+ {
(*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aGraphic.GetGDIMetaFile() );
+ }
bRet = sal_True;
}
@@ -1138,25 +1143,25 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
const SvxFieldData* pField = pInfo->GetField().GetField();
Any aProperty;
- if( pField->ISA( SvxHeaderField ) &&
+ if( dynamic_cast< const SvxHeaderField* >(pField) &&
xDefaultPagePropSetInfo->hasPropertyByName( aHeaderText ) )
{
xDefaultPagePropertySet->getPropertyValue( aHeaderText ) >>= aRepresentation;
bFieldProcessed = sal_True;
}
- else if( pField->ISA( SvxFooterField ) &&
+ else if( dynamic_cast< const SvxFooterField* >(pField) &&
xDefaultPagePropSetInfo->hasPropertyByName( aFooterText ) )
{
xDefaultPagePropertySet->getPropertyValue( aFooterText ) >>= aRepresentation;
bFieldProcessed = sal_True;
}
- else if( pField->ISA( SvxDateTimeField ) &&
+ else if( dynamic_cast< const SvxDateTimeField* >(pField) &&
xDefaultPagePropSetInfo->hasPropertyByName( aDateTimeText ) )
{
xDefaultPagePropertySet->getPropertyValue( aDateTimeText ) >>= aRepresentation;
bFieldProcessed = sal_True;
}
- else if( pField->ISA( SvxPageField ) &&
+ else if( dynamic_cast< const SvxPageField* >(pField) &&
xDefaultPagePropSetInfo->hasPropertyByName( aPageNumberText ) )
{
String aPageNumValue;
diff --git a/filter/source/xsltdialog/xmlfileview.cxx b/filter/source/xsltdialog/xmlfileview.cxx
index 10684ad01e9b..3eba335801fe 100644
--- a/filter/source/xsltdialog/xmlfileview.cxx
+++ b/filter/source/xsltdialog/xmlfileview.cxx
@@ -411,24 +411,25 @@ IMPL_LINK(XMLFileWindow, ScrollHdl, ScrollBar*, pScroll)
void XMLFileWindow::Notify( SfxBroadcaster& /* rBC */, const SfxHint& rHint )
{
- if ( rHint.ISA( TextHint ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
- const TextHint& rTextHint = (const TextHint&)rHint;
- if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
+ if( pTextHint->GetId() == TEXT_HINT_VIEWSCROLLED )
{
pHScrollbar->SetThumbPos( pTextView->GetStartDocPos().X() );
pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() );
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
{
if ( (long)pTextEngine->GetTextHeight() < pOutWin->GetOutputSizePixel().Height() )
pTextView->Scroll( 0, pTextView->GetStartDocPos().Y() );
pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() );
SetScrollBarRanges();
}
- else if( rTextHint.GetId() == TEXT_HINT_FORMATPARA )
+ else if( pTextHint->GetId() == TEXT_HINT_FORMATPARA )
{
- DoDelayedSyntaxHighlight( (sal_uInt16)rTextHint.GetValue() );
+ DoDelayedSyntaxHighlight( (sal_uInt16)pTextHint->GetValue() );
}
}
}
diff --git a/forms/source/richtext/richtextunowrapper.cxx b/forms/source/richtext/richtextunowrapper.cxx
index ffb14340d90f..649447692814 100644
--- a/forms/source/richtext/richtextunowrapper.cxx
+++ b/forms/source/richtext/richtextunowrapper.cxx
@@ -34,6 +34,7 @@
#include <svx/svdpool.hxx>
#include <svx/svdobj.hxx>
#include <editeng/unoprnms.hxx>
+#include <svx/globaldrawitempool.hxx>
//........................................................................
namespace frm
@@ -60,7 +61,7 @@ namespace frm
{ MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType( static_cast< const Reference< XNameContainer >* >( NULL ) ), 0, 0 },
{ NULL, 0, 0, NULL, 0, 0 }
};
- static SvxItemPropertySet aTextEnginePropertySet( aTextEnginePropertyMap, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aTextEnginePropertySet( aTextEnginePropertyMap, GetGlobalDrawObjectItemPool() );
return &aTextEnginePropertySet;
}
}
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx
index 39b79c5ac5cf..3d14f529be4f 100644
--- a/forms/source/richtext/rtattributehandler.cxx
+++ b/forms/source/richtext/rtattributehandler.cxx
@@ -236,7 +236,7 @@ namespace frm
//--------------------------------------------------------------------
AttributeCheckState ParaAlignmentHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
{
- OSL_ENSURE( _rItem.ISA( SvxAdjustItem ), "ParaAlignmentHandler::implGetCheckState: invalid pool item!" );
+ OSL_ENSURE( dynamic_cast< const SvxAdjustItem* >(&_rItem), "ParaAlignmentHandler::implGetCheckState: invalid pool item!" );
SvxAdjust eAdjust = static_cast< const SvxAdjustItem& >( _rItem ).GetAdjust();
return ( eAdjust == m_eAdjust ) ? eChecked : eUnchecked;
}
@@ -271,7 +271,7 @@ namespace frm
//--------------------------------------------------------------------
AttributeCheckState LineSpacingHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
{
- OSL_ENSURE( _rItem.ISA( SvxLineSpacingItem ), "LineSpacingHandler::implGetCheckState: invalid pool item!" );
+ OSL_ENSURE( dynamic_cast< const SvxLineSpacingItem* >(&_rItem), "LineSpacingHandler::implGetCheckState: invalid pool item!" );
sal_uInt16 nLineSpace = static_cast< const SvxLineSpacingItem& >( _rItem ).GetPropLineSpace();
return ( nLineSpace == m_nLineSpace ) ? eChecked : eUnchecked;
}
@@ -313,7 +313,7 @@ namespace frm
//--------------------------------------------------------------------
AttributeCheckState EscapementHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
{
- OSL_ENSURE( _rItem.ISA( SvxEscapementItem ), "EscapementHandler::getState: invalid pool item!" );
+ OSL_ENSURE( dynamic_cast< const SvxEscapementItem* >(&_rItem), "EscapementHandler::getState: invalid pool item!" );
SvxEscapement eEscapement = static_cast< const SvxEscapementItem& >( _rItem ).GetEscapement();
return ( eEscapement == m_eEscapement ) ? eChecked : eUnchecked;
}
@@ -390,7 +390,7 @@ namespace frm
AttributeState aState( eIndetermined );
const SfxPoolItem* pItem = _rAttribs.GetItem( getWhich() );
- const SvxFontHeightItem* pFontHeightItem = PTR_CAST( SvxFontHeightItem, pItem );
+ const SvxFontHeightItem* pFontHeightItem = dynamic_cast< const SvxFontHeightItem* >( pItem );
OSL_ENSURE( pFontHeightItem || !pItem, "FontSizeHandler::getState: invalid item!" );
if ( pFontHeightItem )
{
@@ -416,7 +416,7 @@ namespace frm
//--------------------------------------------------------------------
void FontSizeHandler::executeAttribute( const SfxItemSet& /*_rCurrentAttribs*/, SfxItemSet& _rNewAttribs, const SfxPoolItem* _pAdditionalArg, ScriptType _nForScriptType ) const
{
- const SvxFontHeightItem* pFontHeightItem = PTR_CAST( SvxFontHeightItem, _pAdditionalArg );
+ const SvxFontHeightItem* pFontHeightItem = dynamic_cast< const SvxFontHeightItem* >( _pAdditionalArg );
OSL_ENSURE( pFontHeightItem, "FontSizeHandler::executeAttribute: need a FontHeightItem!" );
if ( pFontHeightItem )
@@ -470,7 +470,7 @@ namespace frm
//--------------------------------------------------------------------
AttributeCheckState ParagraphDirectionHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
{
- OSL_ENSURE( _rItem.ISA( SvxFrameDirectionItem ), "ParagraphDirectionHandler::implGetCheckState: invalid pool item!" );
+ OSL_ENSURE( dynamic_cast< const SvxFrameDirectionItem* >(&_rItem), "ParagraphDirectionHandler::implGetCheckState: invalid pool item!" );
SvxFrameDirection eDirection = static_cast< SvxFrameDirection >( static_cast< const SvxFrameDirectionItem& >( _rItem ).GetValue() );
return ( eDirection == m_eParagraphDirection ) ? eChecked : eUnchecked;
}
@@ -503,9 +503,10 @@ namespace frm
//--------------------------------------------------------------------
AttributeCheckState BooleanHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
{
- OSL_ENSURE( _rItem.ISA( SfxBoolItem ), "BooleanHandler::implGetCheckState: invalid item!" );
- if ( _rItem.ISA( SfxBoolItem ) )
- return static_cast< const SfxBoolItem& >( _rItem ).GetValue() ? eChecked : eUnchecked;
+ const SfxBoolItem* pSfxBoolItem = dynamic_cast< const SfxBoolItem* >(&_rItem);
+ OSL_ENSURE( pSfxBoolItem, "BooleanHandler::implGetCheckState: invalid item!" );
+ if ( pSfxBoolItem )
+ return pSfxBoolItem->GetValue() ? eChecked : eUnchecked;
return eIndetermined;
}
@@ -513,7 +514,7 @@ namespace frm
//--------------------------------------------------------------------
void BooleanHandler::executeAttribute( const SfxItemSet& /*_rCurrentAttribs*/, SfxItemSet& _rNewAttribs, const SfxPoolItem* _pAdditionalArg, ScriptType /*_nForScriptType*/ ) const
{
- OSL_ENSURE( _pAdditionalArg && _pAdditionalArg->ISA( SfxBoolItem ), "BooleanHandler::executeAttribute: invalid argument!" );
+ OSL_ENSURE( _pAdditionalArg && dynamic_cast< const SfxBoolItem* >(_pAdditionalArg), "BooleanHandler::executeAttribute: invalid argument!" );
if ( _pAdditionalArg )
{
SfxPoolItem* pCorrectWich = _pAdditionalArg->Clone();
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 03a8fdb8436d..9e843b3cc3c5 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -1442,7 +1442,7 @@ IMPL_LINK( LayoutManager, WindowEventListener, VclSimpleEvent*, pEvent )
{
long nResult( 1 );
- if ( pEvent && pEvent->ISA( VclWindowEvent ))
+ if ( pEvent && dynamic_cast< VclWindowEvent* >( pEvent))
{
Window* pWindow = static_cast< VclWindowEvent* >(pEvent)->GetWindow();
if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX )
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index acc842d2b987..1842d6f81822 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -797,7 +797,7 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent )
// To enable toolbar controllers to change their image when a sub-toolbar function
// is activated, we need this mechanism. We have NO connection between these toolbars
// anymore!
- if ( pEvent && pEvent->ISA( VclWindowEvent ))
+ if ( pEvent && dynamic_cast< VclWindowEvent* >( pEvent))
{
if ( pEvent->GetId() == VCLEVENT_TOOLBOX_SELECT )
{
diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx
index 5916f2fd1cc7..02477d86d98a 100644
--- a/framework/source/services/license.cxx
+++ b/framework/source/services/license.cxx
@@ -599,10 +599,12 @@ sal_Bool LicenseView::IsEndReached() const
void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA( TYPE(TextHint) ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
sal_Bool bLastVal = EndReached();
- sal_uLong nId = ((const TextHint&)rHint).GetId();
+ sal_uLong nId = pTextHint->GetId();
if ( nId == TEXT_HINT_PARAINSERTED )
{
diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx
index 16461d56014c..5ba4f85080cd 100644
--- a/framework/source/services/tabwindowservice.cxx
+++ b/framework/source/services/tabwindowservice.cxx
@@ -360,13 +360,12 @@ css::uno::Any SAL_CALL TabWindowService::impl_getPropertyValue(const ::rtl::OUSt
//*****************************************************************************************************************
IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent )
{
+ VclWindowEvent* pWinEvt = dynamic_cast< VclWindowEvent* >(pEvent);
- if ( !pEvent && !pEvent->ISA(VclWindowEvent))
+ if ( !pEvent )
return 0;
- sal_uLong nEventId = pEvent->GetId();
- VclWindowEvent* pWinEvt = static_cast< VclWindowEvent* >(pEvent);
-
+ sal_uLong nEventId = pWinEvt->GetId();
css::uno::Reference< css::uno::XInterface > xThis ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY );
css::lang::EventObject aEvent( xThis );
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index 3c4092fe3e28..5b5286599358 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -19,13 +19,12 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <stdio.h>
#include <wchar.h>
+#include <string.h>
#ifndef __FRAMEWORK_UIELEMENT_SPINFIELDTOOLBARCONTROLLER_HXX
#include "uielement/spinfieldtoolbarcontroller.hxx"
diff --git a/i18npool/source/characterclassification/cclass_unicode.cxx b/i18npool/source/characterclassification/cclass_unicode.cxx
index a2128a2e361c..b46a54960d4b 100644
--- a/i18npool/source/characterclassification/cclass_unicode.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode.cxx
@@ -94,7 +94,7 @@ cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount,
nCount = len - nPos;
trans->setMappingType(MappingTypeToTitle, rLocale);
- rtl_uString* pStr = x_rtl_uString_new_WithLength( nCount ); // defined in x_rtl_ustring.h
+ rtl_uString* pStr = x_rtl_uString_new_WithLength( nCount, 1 );
sal_Unicode* out = pStr->buffer;
BreakIteratorImpl brk(xMSF);
Boundary bdy = brk.getWordBoundary(Text, nPos, rLocale,
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 7eda6d220bb1..d3e484cc691c 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -73,7 +73,7 @@ OUString SAL_CALL AsciiToNativeChar( const OUString& inStr, sal_Int32 startPos,
Sequence< sal_Int32 >& offset, sal_Bool useOffset, sal_Int16 number ) throw(RuntimeException)
{
const sal_Unicode *src = inStr.getStr() + startPos;
- rtl_uString *newStr = x_rtl_uString_new_WithLength( nCount ); // defined in x_rtl_ustring.h
+ rtl_uString *newStr = x_rtl_uString_new_WithLength(nCount);
if (useOffset)
offset.realloc(nCount);
@@ -93,7 +93,7 @@ OUString SAL_CALL AsciiToNativeChar( const OUString& inStr, sal_Int32 startPos,
if (useOffset)
offset[i] = startPos + i;
}
- return OUString( newStr, SAL_NO_ACQUIRE); // take over ownership of <newStr>
+ return OUString( newStr, SAL_NO_ACQUIRE);
}
sal_Bool SAL_CALL AsciiToNative_numberMaker(const sal_Unicode *str, sal_Int32 begin, sal_Int32 len,
@@ -246,10 +246,7 @@ OUString SAL_CALL AsciiToNative( const OUString& inStr, sal_Int32 startPos, sal_
if (useOffset)
offset.realloc(count);
- OUString resultStr( newStr->buffer, count );
- x_rtl_uString_release( newStr );
- x_rtl_uString_release( srcStr );
- return resultStr;
+ return OUString(newStr->buffer, count);
}
return OUString();
}
@@ -312,7 +309,7 @@ static OUString SAL_CALL NativeToAscii(const OUString& inStr,
if (nCount > 0) {
const sal_Unicode *str = inStr.getStr() + startPos;
- rtl_uString *newStr = x_rtl_uString_new_WithLength( nCount * MultiplierExponent_7_CJK[0] + 1 );
+ rtl_uString *newStr = x_rtl_uString_new_WithLength(nCount * MultiplierExponent_7_CJK[0] + 1);
if (useOffset)
offset.realloc( nCount * MultiplierExponent_7_CJK[0] + 1 );
sal_Int32 count = 0, index;
@@ -370,9 +367,7 @@ static OUString SAL_CALL NativeToAscii(const OUString& inStr,
for (i = 0; i < count; i++)
offset[i] += startPos;
}
- OUString resultStr( newStr->buffer, count );
- x_rtl_uString_release( newStr );
- return resultStr;
+ return OUString(newStr->buffer, count);
}
return OUString();
}
diff --git a/i18npool/source/textconversion/textconversion_ko.cxx b/i18npool/source/textconversion/textconversion_ko.cxx
index 7ce4adbfa702..e17b7ea1ba8f 100644
--- a/i18npool/source/textconversion/textconversion_ko.cxx
+++ b/i18npool/source/textconversion/textconversion_ko.cxx
@@ -155,8 +155,7 @@ TextConversion_ko::getCharConversions(const OUString& aText, sal_Int32 nStartPos
} else if (! toHanja && getHanja2HangulIndex && getHanja2HangulData) {
rtl_uString * newStr = x_rtl_uString_new_WithLength( nLength ); // defined in x_rtl_ustring.h
sal_Int32 count = 0;
- while (count < nLength)
- {
+ while (count < nLength) {
ch = aText[nStartPos + count];
sal_Unicode address = getHanja2HangulIndex()[ch>>8];
if (address != 0xFFFF)
@@ -167,12 +166,10 @@ TextConversion_ko::getCharConversions(const OUString& aText, sal_Int32 nStartPos
else
break;
}
- if (count > 0)
- {
+ if (count > 0) {
output.realloc(1);
- output[0] = OUString( newStr->buffer, count );
+ output[0] = OUString( newStr->buffer, count);
}
- x_rtl_uString_release( newStr );
}
return output;
}
diff --git a/i18npool/source/textconversion/textconversion_zh.cxx b/i18npool/source/textconversion/textconversion_zh.cxx
index 012dfc77456e..b88929886411 100644
--- a/i18npool/source/textconversion/textconversion_zh.cxx
+++ b/i18npool/source/textconversion/textconversion_zh.cxx
@@ -84,7 +84,7 @@ TextConversion_zh::getCharConversion(const OUString& aText, sal_Int32 nStartPos,
for (sal_Int32 i = 0; i < nLength; i++)
newStr->buffer[i] =
getOneCharConversion(aText[nStartPos+i], Data, Index);
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr, SAL_NO_ACQUIRE);
}
OUString SAL_CALL
@@ -214,9 +214,7 @@ TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos,
}
if (offset.getLength() > 0)
offset.realloc(one2one ? 0 : count);
- OUString resultStr( newStr->buffer, count );
- x_rtl_uString_release( newStr );
- return resultStr;
+ return OUString( newStr->buffer, count);
}
TextConversionResult SAL_CALL
diff --git a/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx b/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx
index b997498ab8e2..5cbd3883398d 100644
--- a/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx
@@ -139,7 +139,7 @@ ignoreIandEfollowedByYa_ja_JP::folding( const OUString& inStr, sal_Int32 startPo
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
offset.realloc(newStr->length);
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
} } } }
diff --git a/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx b/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx
index 462d0d178fa5..478bd0b0628f 100644
--- a/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx
@@ -146,7 +146,7 @@ ignoreIterationMark_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, s
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
offset.realloc(newStr->length);
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
diff --git a/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx b/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx
index 701c7f354731..30963c2b7ade 100644
--- a/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx
@@ -96,7 +96,7 @@ ignoreKiKuFollowedBySa_ja_JP::folding( const OUString& inStr, sal_Int32 startPos
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
offset.realloc(newStr->length);
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
} } } }
diff --git a/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx b/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx
index 53d9a9a4545e..e3efe058d4f4 100644
--- a/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx
@@ -354,7 +354,7 @@ ignoreProlongedSoundMark_ja_JP::folding( const OUString& inStr, sal_Int32 startP
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
offset.realloc(newStr->length);
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
diff --git a/i18npool/source/transliteration/transliteration_Ignore.cxx b/i18npool/source/transliteration/transliteration_Ignore.cxx
index 5c3b41a23c39..e613be133d7b 100644
--- a/i18npool/source/transliteration/transliteration_Ignore.cxx
+++ b/i18npool/source/transliteration/transliteration_Ignore.cxx
@@ -204,7 +204,7 @@ transliteration_Ignore::folding( const OUString& inStr, sal_Int32 startPos,
offset.realloc(newStr->length);
*dst = (sal_Unicode) 0;
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
sal_Unicode SAL_CALL
diff --git a/i18npool/source/transliteration/transliteration_Numeric.cxx b/i18npool/source/transliteration/transliteration_Numeric.cxx
index 341606d51eb3..639adef0e89d 100644
--- a/i18npool/source/transliteration/transliteration_Numeric.cxx
+++ b/i18npool/source/transliteration/transliteration_Numeric.cxx
@@ -72,7 +72,7 @@ transliteration_Numeric::transliterateBullet( const OUString& inStr, sal_Int32 s
if (endPos > inStr.getLength())
endPos = inStr.getLength();
- rtl_uString* pStr = x_rtl_uString_new_WithLength( nCount ); // our x_rtl_ustring.h
+ rtl_uString* pStr = x_rtl_uString_new_WithLength( nCount, 1 ); // our x_rtl_ustring.h
sal_Unicode* out = pStr->buffer;
if (useOffset)
@@ -114,7 +114,7 @@ transliteration_Numeric::transliterateBullet( const OUString& inStr, sal_Int32 s
if (useOffset)
offset.realloc(j);
- return OUString( pStr, SAL_NO_ACQUIRE ); // take over ownership of <pStr>
+ return OUString( pStr, SAL_NO_ACQUIRE );
}
OUString SAL_CALL
diff --git a/i18npool/source/transliteration/transliteration_OneToOne.cxx b/i18npool/source/transliteration/transliteration_OneToOne.cxx
index 4be6efc05784..f05314995355 100644
--- a/i18npool/source/transliteration/transliteration_OneToOne.cxx
+++ b/i18npool/source/transliteration/transliteration_OneToOne.cxx
@@ -91,7 +91,7 @@ transliteration_OneToOne::transliterate( const OUString& inStr, sal_Int32 startP
}
*dst = (sal_Unicode) 0;
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
sal_Unicode SAL_CALL
diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx
index 15902486ba36..48358f7b0593 100644
--- a/i18npool/source/transliteration/transliteration_body.cxx
+++ b/i18npool/source/transliteration/transliteration_body.cxx
@@ -183,7 +183,7 @@ Transliteration_body::transliterate(
const Mapping &map = casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType );
nOffCount += map.nmap;
}
- rtl_uString* pStr = x_rtl_uString_new_WithLength( nOffCount ); // our x_rtl_ustring.h
+ rtl_uString* pStr = x_rtl_uString_new_WithLength( nOffCount, 1 ); // our x_rtl_ustring.h
sal_Unicode* out = pStr->buffer;
if ( nOffCount != offset.getLength() )
@@ -207,7 +207,7 @@ Transliteration_body::transliterate(
}
out[j] = 0;
- return OUString( pStr, SAL_NO_ACQUIRE ); // take over ownership of <pStr>
+ return OUString( pStr, SAL_NO_ACQUIRE );
}
else
{
@@ -254,7 +254,7 @@ OUString SAL_CALL
Transliteration_body::transliterateChar2String( sal_Unicode inChar ) throw(RuntimeException)
{
const Mapping &map = casefolding::getValue(&inChar, 0, 1, aLocale, nMappingType);
- rtl_uString* pStr = x_rtl_uString_new_WithLength( map.nmap ); // our x_rtl_ustring.h
+ rtl_uString* pStr = x_rtl_uString_new_WithLength( map.nmap, 1 ); // our x_rtl_ustring.h
sal_Unicode* out = pStr->buffer;
sal_Int32 i;
@@ -262,7 +262,7 @@ Transliteration_body::transliterateChar2String( sal_Unicode inChar ) throw(Runti
out[i] = map.map[i];
out[i] = 0;
- return OUString( pStr, SAL_NO_ACQUIRE ); // take over ownership of <pStr>
+ return OUString( pStr, SAL_NO_ACQUIRE );
}
sal_Unicode SAL_CALL
diff --git a/i18nutil/inc/i18nutil/x_rtl_ustring.h b/i18nutil/inc/i18nutil/x_rtl_ustring.h
index 89942eb3f9f9..bdc24f4dc749 100644
--- a/i18nutil/inc/i18nutil/x_rtl_ustring.h
+++ b/i18nutil/inc/i18nutil/x_rtl_ustring.h
@@ -32,15 +32,18 @@
/**
* Allocates a new <code>rtl_uString</code> which can hold nLen + 1 characters.
- * The reference count is 1. The memory allocated for the characters is not initialized.
+ * The reference count is 0. The characters of room is not cleared.
+ * This method is similar to rtl_uString_new_WithLength in rtl/ustring.h, but
+ * can allocate a new string more efficiently. You need to "acquire" by such as
+ * OUString( rtl_uString * value ) if you intend to use it for a while.
+ * @param [output] newStr
* @param [input] nLen
*/
-inline rtl_uString * SAL_CALL x_rtl_uString_new_WithLength( sal_Int32 nLen )
+inline void SAL_CALL x_rtl_uString_new_WithLength( rtl_uString ** newStr, sal_Int32 nLen, sal_Int32 _refCount = 0 )
{
- rtl_uString *newStr = (rtl_uString*) rtl_allocateMemory ( sizeof(rtl_uString) + sizeof(sal_Unicode) * nLen);
- newStr->refCount = 1;
- newStr->length = nLen;
- return newStr;
+ *newStr = (rtl_uString*) rtl_allocateMemory ( sizeof(rtl_uString) + sizeof(sal_Unicode) * nLen);
+ (*newStr)->refCount = _refCount;
+ (*newStr)->length = nLen;
// rtl_uString is defined in rtl/ustring.h as below:
//typedef struct _rtl_uString
@@ -51,6 +54,14 @@ inline rtl_uString * SAL_CALL x_rtl_uString_new_WithLength( sal_Int32 nLen )
//} rtl_uString;
}
+inline rtl_uString * SAL_CALL x_rtl_uString_new_WithLength( sal_Int32 nLen, sal_Int32 _refCount = 0 )
+{
+ rtl_uString *newStr = (rtl_uString*) rtl_allocateMemory ( sizeof(rtl_uString) + sizeof(sal_Unicode) * nLen);
+ newStr->refCount = _refCount;
+ newStr->length = nLen;
+ return newStr;
+}
+
/**
* Release <code>rtl_uString</code> regardless its reference count.
*/
diff --git a/i18nutil/source/utility/widthfolding.cxx b/i18nutil/source/utility/widthfolding.cxx
index ee1554d9972e..2b6d365f3937 100644
--- a/i18nutil/source/utility/widthfolding.cxx
+++ b/i18nutil/source/utility/widthfolding.cxx
@@ -49,7 +49,8 @@ OUString widthfolding::decompose_ja_voiced_sound_marks (const OUString& inStr, s
{
// Create a string buffer which can hold nCount * 2 + 1 characters.
// Its size may become double of nCount.
- rtl_uString * newStr = x_rtl_uString_new_WithLength( nCount * 2 ); // defined in x_rtl_ustring.h
+ rtl_uString * newStr;
+ x_rtl_uString_new_WithLength( &newStr, nCount * 2 ); // defined in x_rtl_ustring.h The reference count is 0 now.
sal_Int32 *p = NULL;
sal_Int32 position = 0;
@@ -93,7 +94,7 @@ OUString widthfolding::decompose_ja_voiced_sound_marks (const OUString& inStr, s
newStr->length = sal_Int32(dst - newStr->buffer);
if (useOffset)
offset.realloc(newStr->length);
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
oneToOneMapping& widthfolding::getfull2halfTable(void)
@@ -110,6 +111,7 @@ OUString widthfolding::compose_ja_voiced_sound_marks (const OUString& inStr, sal
{
// Create a string buffer which can hold nCount + 1 characters.
// Its size may become equal to nCount or smaller.
+ // The reference count is 0 now.
rtl_uString * newStr = x_rtl_uString_new_WithLength( nCount ); // defined in x_rtl_ustring.h
// Prepare pointers of unicode character arrays.
@@ -197,7 +199,7 @@ OUString widthfolding::compose_ja_voiced_sound_marks (const OUString& inStr, sal
}
if (useOffset)
offset.realloc(newStr->length);
- return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
+ return OUString( newStr ); // defined in rtl/usrting. The reference count is increased from 0 to 1.
}
oneToOneMapping& widthfolding::gethalf2fullTable(void)
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx
index f27fc4ca7da0..af7862d903f3 100644
--- a/idl/inc/basobj.hxx
+++ b/idl/inc/basobj.hxx
@@ -27,6 +27,7 @@
#include <tools/ref.hxx>
#include <bastype.hxx>
#include <tools/pstm.hxx>
+#include <typeinfo>
class SvTokenStream;
class SvMetaObject;
@@ -120,6 +121,11 @@ SV_DECL_IMPL_REF(SvMetaObject)
SV_DECL_PERSIST_LIST(SvMetaObject,SvMetaObject *)
SV_IMPL_PERSIST_LIST(SvMetaObject,SvMetaObject *)
+typedef bool (*ConvertToSvMetaObject)( const SvMetaObject* );
+template<class T> bool _IsSvMetaObject(const SvMetaObject* pObj)
+{
+ return 0 != dynamic_cast<const T*>(pObj);
+}
class SvMetaObjectMemberStack
{
@@ -134,12 +140,14 @@ public:
void Clear() { aList.Clear(); }
sal_uLong Count() const { return aList.Count(); }
- SvMetaObject * Get( TypeId nType )
+ SvMetaObject * Get( ConvertToSvMetaObject rConvert )
+// SvMetaObject * Get( TypeId nType )
{
SvMetaObject * pObj = aList.Last();
while( pObj )
{
- if( pObj->IsA( nType ) )
+ if( rConvert(pObj) )
+// if( pObj->IsA( nType ) )
return pObj;
pObj = aList.Prev();
}
diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index d77e70c3b074..64b813fa6ee2 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -675,7 +675,8 @@ const SvGlobalName & SvMetaExtern::GetUUId() const
*************************************************************************/
void SvMetaExtern::SetModule( SvIdlDataBase & rBase )
{
- pModule = (SvMetaModule *)rBase.GetStack().Get( TYPE( SvMetaModule ) );
+ pModule = (SvMetaModule *)rBase.GetStack().Get( _IsSvMetaObject< SvMetaModule > );
+// pModule = (SvMetaModule *)rBase.GetStack().Get( TYPE( SvMetaModule ) );
}
/*************************************************************************
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 5793387a5b83..ebb3f9e834bc 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -448,7 +448,8 @@ sal_Bool SvMetaClass::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm,
SvMetaAttribute & rAttr ) const
{
- if ( !rAttr.GetRef() && rAttr.IsA( TYPE( SvMetaSlot ) ) )
+ if ( !rAttr.GetRef() && dynamic_cast< const SvMetaSlot* >(&rAttr))
+// if ( !rAttr.GetRef() && rAttr.IsA( TYPE( SvMetaSlot ) ) )
{
DBG_ERROR( "Neuer Slot : " );
DBG_ERROR( rAttr.GetSlotId().GetBuffer() );
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 180ee0682b0f..fe8c0ac30655 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -932,7 +932,7 @@ sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
if( pAttr )
{
// F"ur Testzwecke: Referenz bei Kurz-Syntax
- SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr );
+ SvMetaSlot * pKnownSlot = dynamic_cast< SvMetaSlot* >( pAttr );
if( pKnownSlot )
{
SetRef( pKnownSlot );
@@ -957,7 +957,7 @@ sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
if( pAttr2 )
{
// F"ur Testzwecke: Referenz bei kompletter Definition
- SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr2 );
+ SvMetaSlot * pKnownSlot = dynamic_cast< SvMetaSlot* >( pAttr2 );
if( pKnownSlot )
{
SetRef( pKnownSlot );
@@ -1098,7 +1098,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
// EnumSlots plattklopfen
SvMetaTypeEnum * pEnum = NULL;
SvMetaType * pBType = GetType()->GetBaseType();
- pEnum = PTR_CAST( SvMetaTypeEnum, pBType );
+ pEnum = dynamic_cast< SvMetaTypeEnum* >( pBType );
if( GetPseudoSlots() && pEnum && pEnum->Count() )
{
// Den MasterSlot clonen
@@ -1121,7 +1121,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
SvMetaAttribute * pAttr = rBase.GetAttrList().GetObject( m );
if( pAttr->GetSlotId() == aSId )
{
- SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr );
+ SvMetaSlot* pSlot = dynamic_cast< SvMetaSlot*>( pAttr );
xEnumSlot = pSlot->Clone();
break;
}
@@ -1623,7 +1623,7 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
rOutStm << "};" << endl;
}
- SvMetaTypeEnum * pEnum = PTR_CAST( SvMetaTypeEnum, GetType() );
+ SvMetaTypeEnum* pEnum = dynamic_cast< SvMetaTypeEnum* >( GetType() );
if( GetPseudoSlots() && pEnum )
{
for( sal_uLong n = 0; n < pEnum->Count(); n++ )
@@ -1675,7 +1675,7 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
rOutStm << "#define " << GetSlotId().GetBuffer() << '\t' << ByteString::CreateFromInt32( nSId ).GetBuffer() << endl;
}
- SvMetaTypeEnum * pEnum = PTR_CAST( SvMetaTypeEnum, GetType() );
+ SvMetaTypeEnum* pEnum = dynamic_cast< SvMetaTypeEnum* >( GetType() );
if( GetPseudoSlots() && pEnum )
{
for( sal_uLong n = 0; n < pEnum->Count(); n++ )
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 826b1bfb9a6b..feb0aa1c56ad 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -589,7 +589,7 @@ sal_uLong SvMetaAttribute::MakeSlotValue( SvIdlDataBase & rBase, sal_Bool bVar )
n = n << 20;
n += rBase.aStructSlotId.GetValue();
}
- if( PTR_CAST( SvMetaSlot, this ) )
+ if( dynamic_cast< const SvMetaSlot* >( this ) )
n |= 0x20000;
if( !bVar )
n += 0x10000;
@@ -1405,7 +1405,7 @@ sal_Bool SvMetaType::SetName( const ByteString & rName, SvIdlDataBase * pBase )
/*
void SvMetaType::FillSbxObject( SbxVariable * pObj, sal_Bool bVariable )
{
- if( PTR_CAST( SbxMethod, pObj ) )
+ if( dynamic_cast< SbxMethod* >( pObj ) )
{
if( GetType() == TYPE_METHOD )
{
@@ -1923,11 +1923,19 @@ void SvMetaType::WriteSfxItem(
<< aVarName.GetBuffer() << ';' << endl;
// Den Implementationsteil schreiben
- rOutStm << "#ifdef SFX_TYPEMAP" << endl
- << aTypeName.GetBuffer() << aVarName.GetBuffer()
+// rOutStm << "#ifdef SFX_TYPEMAP" << endl
+// << aTypeName.GetBuffer() << aVarName.GetBuffer()
+ rOutStm << "#ifdef SFX_TYPEMAP" << endl;
+ rOutStm << "bool To" << rItemName.GetBuffer()
+ << "_Impl( const SfxPoolItem* pItem ) { return 0 != dynamic_cast< const " << rItemName.GetBuffer() << "* >(pItem); }"
+ << endl;
+ rOutStm << aTypeName.GetBuffer() << aVarName.GetBuffer()
<< " = " << endl;
+// rOutStm << '{' << endl
+// << "\tTYPE(" << rItemName.GetBuffer() << "), "
rOutStm << '{' << endl
- << "\tTYPE(" << rItemName.GetBuffer() << "), "
+ << "\t" << rItemName.GetBuffer() << "::Create, To" << rItemName.GetBuffer() << "_Impl ,"
+ << " &typeid(" << rItemName.GetBuffer() << "), "
<< aAttrCount.GetBuffer();
if( nAttrCount )
{
diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx
index 6a3f260ab65c..dd98d7f96bff 100644
--- a/idl/source/prj/svidl.cxx
+++ b/idl/source/prj/svidl.cxx
@@ -31,6 +31,7 @@
#include <command.hxx>
#include <tools/fsys.hxx>
#include <tools/string.hxx>
+#include <memory.h>
#define BR 0x8000
sal_Bool FileMove_Impl( const String & rFile1, const String & rFile2, sal_Bool bImmerVerschieben )
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 67c6655f0b5e..354e7b90f868 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -38,6 +38,7 @@
#include <tools/fsys.hxx>
#include <osl/file.hxx>
#include <osl/file.h>
+#include <string.h>
#include <hash_map> /* std::hashmap*/
#include <iterator> /* std::iterator*/
diff --git a/offapi/com/sun/star/drawing/EnhancedCustomShapeGeometry.idl b/offapi/com/sun/star/drawing/EnhancedCustomShapeGeometry.idl
index cb0c0284340a..c40b15f76497 100644
--- a/offapi/com/sun/star/drawing/EnhancedCustomShapeGeometry.idl
+++ b/offapi/com/sun/star/drawing/EnhancedCustomShapeGeometry.idl
@@ -64,10 +64,14 @@ service EnhancedCustomShapeGeometry
[optional, property] ::com::sun::star::awt::Rectangle ViewBox;
/** This property specifies if the orientation of the shape is horizontal mirrored.
+ @deprecated : This property is now part of the shape geometry (negative scale in X)
+ It will always return sal_False now.
*/
[optional, property] boolean MirroredX;
/** This property specifies if the orientation of the shape is vertical mirrored.
+ @deprecated : This property is now part of the shape geometry (negative scale in Y)
+ It will always return sal_False now.
*/
[optional, property] boolean MirroredY;
diff --git a/offapi/com/sun/star/text/AutoTextGroup.idl b/offapi/com/sun/star/text/AutoTextGroup.idl
index dcb16709b8ed..0c5fee5b164c 100644
--- a/offapi/com/sun/star/text/AutoTextGroup.idl
+++ b/offapi/com/sun/star/text/AutoTextGroup.idl
@@ -23,35 +23,46 @@
#ifndef __com_sun_star_text_AutoTextGroup_idl__
#define __com_sun_star_text_AutoTextGroup_idl__
+#ifndef __com_sun_star_text_XAutoTextGroup_idl__
#include <com/sun/star/text/XAutoTextGroup.idl>
+#endif
+
+#ifndef __com_sun_star_container_XIndexAccess_idl__
#include <com/sun/star/container/XIndexAccess.idl>
+#endif
+
+#ifndef __com_sun_star_container_XNamed_idl__
#include <com/sun/star/container/XNamed.idl>
+#endif
+
+
+//=============================================================================
+
+ module com { module sun { module star { module text {
-module com { module sun { module star { module text {
+//=============================================================================
-/** provides access to text blocks in a group.
- @see com::sun::star::text::AutoTextContainer
+// DocMerge from xml: service com::sun::star::text::AutoTextGroup
+/** provides access to text blocks in a group.@see com::sun::star::text::AutoTextContainer
*/
published service AutoTextGroup
{
+ // DocMerge: empty anyway
interface com::sun::star::text::XAutoTextGroup;
+ // DocMerge: empty anyway
interface com::sun::star::container::XIndexAccess;
- /** provides access to the name of the group.
- */
- interface com::sun::star::container::XNamed;
-
- /** The path to the file containing the <type>AutoTextEntry</type>&apos;s in this group
- */
- [property, readonly] string FilePath;
- /** The title of this <type>AutoTextGroup</type>
+ // DocMerge from xml: service com::sun::star::text::AutoTextGroup: interface com::sun::star::container::XNamed
+ /** provides access to the name of the group.
*/
- [property] string Title;
+ interface com::sun::star::container::XNamed;
};
+//=============================================================================
+
}; }; }; };
#endif
diff --git a/offapi/com/sun/star/text/XAutoTextContainer.idl b/offapi/com/sun/star/text/XAutoTextContainer.idl
index 6ff07740991a..da34ee4e2bde 100644
--- a/offapi/com/sun/star/text/XAutoTextContainer.idl
+++ b/offapi/com/sun/star/text/XAutoTextContainer.idl
@@ -19,68 +19,85 @@
*
*************************************************************/
+
#ifndef __com_sun_star_text_XAutoTextContainer_idl__
#define __com_sun_star_text_XAutoTextContainer_idl__
-#include <com/sun/star/container/ElementExistException.idl>
-#include <com/sun/star/container/NoSuchElementException.idl>
+#ifndef __com_sun_star_container_XNameAccess_idl__
#include <com/sun/star/container/XNameAccess.idl>
-#include <com/sun/star/lang/IllegalArgumentException.idl>
+#endif
+
+#ifndef __com_sun_star_text_XAutoTextGroup_idl__
#include <com/sun/star/text/XAutoTextGroup.idl>
+#endif
+
+#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+#endif
+
+#ifndef __com_sun_star_container_ElementExistException_idl__
+#include <com/sun/star/container/ElementExistException.idl>
+#endif
+
+#ifndef __com_sun_star_container_NoSuchElementException_idl__
+#include <com/sun/star/container/NoSuchElementException.idl>
+#endif
+
-module com { module sun { module star { module text {
+//=============================================================================
+ module com { module sun { module star { module text {
+
+//=============================================================================
+
+// DocMerge from xml: interface com::sun::star::text::XAutoTextContainer
/** handles blocks of <type>AutoTextEntry</type>.
- @see AutoTextContainer
-*/
+
+
+
+
+
+
+
+ @example <pre>
+ AutoTextPath=d:\office\autotext;f:\user\autotext
+
+ groupname: "standard*0"
+ -&amp;amp;gt; the group file is located n the path d:\office\autotext
+ groupname: "all*1"
+ -&amp;amp;gt; the group file is located in the path f:\user\autotext\
+ </pre>
+
+ <p>If the path extension is not specified, then the first directory
+ is used. For automatic text expansion, the name of an actual group is
+ set to search first in this group.
+
+ </p>@see AutoTextContainer
+ */
published interface XAutoTextContainer: com::sun::star::container::XNameAccess
{
- /** creates a new AutoText group.
+ //-------------------------------------------------------------------------
- @param aGroupName the name of the <type>AutoTextContainer</type>
-
- <p>The name must follow the pattern <code>groupname*pathid</code>, where:</p>
-
- <ul>
- <li><code>groupname</code> should contain only alphanumeric characters
- (A-Za-z0-9), underscore (_) or space (0x20)</li>
- <li>an asterisk (*) delimiter separates the group name from the path
- identifier</li>
- <li><code>pathid</code> is a number (0 or 1) identifying the directory
- where the AutoText file is stored. Paths are stored in the Office
- configuration and accessed through
- <member scope="com::sun::star::util">PathSettings::AutoText</member>.
- <ul>
- <li>0 indicates the path of the <b>Office Basis</b> layer</li>
- <li>1 indicates the path of the <b>user</b> directory</li>
- </ul>
- </li>
- </ul>
- If only <code>groupname</code> is specified, the path defaults to 0, the
- <b>Office Basis</b> layer.</br>Note that in some systems the user may lack of
- write access to the Office Basis directory.
-
- @example
-
- <ul>
- <li><code>standard*0</code></br>the "standard" AutoTextGroup in the Office Basis layer</li>
- <li><code>template</code></br>the "template" AutoTextGroup in the Office Basis layer</li>
- <li><code>mytexts*1</code></br>the "mytexts" AutoTextGroup in the user directory</li>
- </ul>
-
- */
+ // DocMerge from xml: method com::sun::star::text::XAutoTextContainer::insertNewByName
+ /** creates a new AutoText group.
+ */
com::sun::star::text::XAutoTextGroup insertNewByName( [in] string aGroupName )
raises( com::sun::star::lang::IllegalArgumentException,
com::sun::star::container::ElementExistException );
+ //-------------------------------------------------------------------------
+
+ // DocMerge from xml: method com::sun::star::text::XAutoTextContainer::removeByName
/** deletes the specified AutoText group.
- @param aGroupName see the documentation for <member>XAutoTextContainer::insertNewByName()</member>
- */
+ */
void removeByName( [in] string aGroupName )
raises( com::sun::star::container::NoSuchElementException );
};
+//=============================================================================
+
}; }; }; };
+
#endif
diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx
index a08ce8feb9d5..7a2be8bf09f4 100644
--- a/oox/inc/oox/drawingml/customshapeproperties.hxx
+++ b/oox/inc/oox/drawingml/customshapeproperties.hxx
@@ -127,8 +127,10 @@ public:
OptValue< GeomRect >& getTextRect(){ return maTextRect; };
std::vector< Path2D >& getPath2DList(){ return maPath2DList; };
std::vector< com::sun::star::drawing::EnhancedCustomShapeSegment >& getSegments(){ return maSegments; };
- void setMirroredX( sal_Bool bMirroredX ) { mbMirroredX = bMirroredX; };
- void setMirroredY( sal_Bool bMirroredY ) { mbMirroredY = bMirroredY; };
+
+ // TTTT: MirrorX/Y removed
+ //void setMirroredX( sal_Bool bMirroredX ) { mbMirroredX = bMirroredX; };
+ //void setMirroredY( sal_Bool bMirroredY ) { mbMirroredY = bMirroredY; };
// #119920# Add missing extra text rotation
void setTextRotation(sal_Int32 nTextRotation) { mnTextRotation = nTextRotation; }
@@ -149,8 +151,10 @@ private:
std::vector< com::sun::star::drawing::EnhancedCustomShapeSegment >
maSegments;
- sal_Bool mbMirroredX;
- sal_Bool mbMirroredY;
+
+ // TTTT: MirrorX/Y removed
+ //sal_Bool mbMirroredX;
+ //sal_Bool mbMirroredY;
// #119920# Add missing extra text rotation
sal_Int32 mnTextRotation;
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 3cbaf4e89df1..cdbd1bb9e1f5 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -97,7 +97,8 @@ public:
void setPosition( com::sun::star::awt::Point nPosition ){ maPosition = nPosition; }
void setSize( com::sun::star::awt::Size aSize ){ maSize = aSize; }
void setRotation( sal_Int32 nRotation ) { mnRotation = nRotation; }
- void setFlip( sal_Bool bFlipH, sal_Bool bFlipV ) { mbFlipH = bFlipH; mbFlipV = bFlipV; }
+ // TTTT: MirrorX/Y removed
+ //void setFlip( sal_Bool bFlipH, sal_Bool bFlipV ) { mbFlipH = bFlipH; mbFlipV = bFlipV; }
void addChild( const ShapePtr pChildPtr ) { maChildren.push_back( pChildPtr ); }
std::vector< ShapePtr >& getChildren() { return maChildren; }
@@ -211,8 +212,9 @@ private:
ChartShapeInfoRef mxChartShapeInfo; /// Additional data for chart shapes.
sal_Int32 mnRotation;
- sal_Bool mbFlipH;
- sal_Bool mbFlipV;
+ // TTTT: MirrorX/Y removed
+ //sal_Bool mbFlipH;
+ //sal_Bool mbFlipV;
sal_Bool mbHidden;
};
diff --git a/oox/inc/oox/export/vmlexport.hxx b/oox/inc/oox/export/vmlexport.hxx
index 211cdbf609fe..581f883a0654 100644
--- a/oox/inc/oox/export/vmlexport.hxx
+++ b/oox/inc/oox/export/vmlexport.hxx
@@ -83,7 +83,9 @@ protected:
/// The parameter is just what we got from StartShape().
virtual void EndShape( sal_Int32 nShapeElement );
- virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+ virtual void Commit(
+ EscherPropertyContainer& rProps,
+ const basegfx::B2DRange& rObjectRange);
private:
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index f930b25cb7bf..abe6b6327798 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -43,9 +43,9 @@ using namespace ::com::sun::star::drawing;
namespace oox { namespace drawingml {
CustomShapeProperties::CustomShapeProperties()
-: mbMirroredX ( sal_False )
+: /*mbMirroredX ( sal_False ) // TTTT: MirrorX/Y removed
, mbMirroredY ( sal_False )
-, mnTextRotation(0) // #119920# Add missing extra text rotation
+, */mnTextRotation(0) // #119920# Add missing extra text rotation
{
}
CustomShapeProperties::~CustomShapeProperties()
@@ -97,8 +97,9 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
PropertyMap aPropertyMap;
- aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
- aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
+ // TTTT: MirrorX/Y removed
+ //aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
+ //aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
if(mnTextRotation)
{
@@ -161,8 +162,10 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
sal_uInt32 i;
PropertyMap aPropertyMap;
aPropertyMap[ PROP_Type ] <<= CREATE_OUSTRING( "non-primitive" );
- aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
- aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
+
+ // TTTT: MirrorX/Y removed
+ //aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
+ //aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
if(mnTextRotation)
{
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 204782c0de14..0543425c3155 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -76,8 +76,8 @@ Shape::Shape( const sal_Char* pServiceName )
, mnSubTypeIndex( -1 )
, meFrameType( FRAMETYPE_GENERIC )
, mnRotation( 0 )
-, mbFlipH( false )
-, mbFlipV( false )
+//, mbFlipH( false ) // TTTT: MirrorX/Y removed
+//, mbFlipV( false )
, mbHidden( false )
{
if ( pServiceName )
@@ -196,8 +196,8 @@ void Shape::applyShapeReference( const Shape& rReferencedShape )
maSize = rReferencedShape.maSize;
maPosition = rReferencedShape.maPosition;
mnRotation = rReferencedShape.mnRotation;
- mbFlipH = rReferencedShape.mbFlipH;
- mbFlipV = rReferencedShape.mbFlipV;
+ //mbFlipH = rReferencedShape.mbFlipH; // TTTT: MirrorX/Y removed
+ //mbFlipV = rReferencedShape.mbFlipV;
mbHidden = rReferencedShape.mbHidden;
}
@@ -284,20 +284,21 @@ Reference< XShape > Shape::createAndInsert(
aSize.Height ? aSize.Height / 360.0 : 1.0 );
}
- if( mbFlipH || mbFlipV || mnRotation != 0)
+ if( /*mbFlipH || mbFlipV || // TTTT: MirrorX/Y removed*/ mnRotation != 0)
{
// calculate object's center
basegfx::B2DPoint aCenter(0.5, 0.5);
aCenter *= aTransformation;
// center object at origin
- aTransformation.translate( -aCenter.getX(), -aCenter.getY() );
+ aTransformation.translate( -aCenter );
- if( !bIsCustomShape && ( mbFlipH || mbFlipV ) )
- {
- // mirror around object's center
- aTransformation.scale( mbFlipH ? -1.0 : 1.0, mbFlipV ? -1.0 : 1.0 );
- }
+ // TTTT: MirrorX/Y removed
+ //if( !bIsCustomShape && ( mbFlipH || mbFlipV ) )
+ //{
+ // // mirror around object's center
+ // aTransformation.scale( mbFlipH ? -1.0 : 1.0, mbFlipV ? -1.0 : 1.0 );
+ //}
if( mnRotation != 0 )
{
@@ -306,7 +307,7 @@ Reference< XShape > Shape::createAndInsert(
}
// move object back from center
- aTransformation.translate( aCenter.getX(), aCenter.getY() );
+ aTransformation.translate( aCenter );
}
if( aPosition.X != 0 || aPosition.Y != 0)
@@ -471,10 +472,11 @@ Reference< XShape > Shape::createAndInsert(
if( bIsCustomShape )
{
- if ( mbFlipH )
- mpCustomShapePropertiesPtr->setMirroredX( sal_True );
- if ( mbFlipV )
- mpCustomShapePropertiesPtr->setMirroredY( sal_True );
+ // TTTT: MirrorX/Y removed
+ //if ( mbFlipH )
+ // mpCustomShapePropertiesPtr->setMirroredX( sal_True );
+ //if ( mbFlipV )
+ // mpCustomShapePropertiesPtr->setMirroredY( sal_True );
// #119920# Handle missing text rotation
if(getTextBody())
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index 0e6cf4de50b3..eae68ed2031b 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -46,7 +46,8 @@ Transform2DContext::Transform2DContext( ContextHandler& rParent, const Reference
{
AttributeList aAttributeList( xAttribs );
mrShape.setRotation( aAttributeList.getInteger( XML_rot, 0 ) ); // 60000ths of a degree Positive angles are clockwise; negative angles are counter-clockwise
- mrShape.setFlip( aAttributeList.getBool( XML_flipH, sal_False ), aAttributeList.getBool( XML_flipV, sal_False ) );
+ // TTTT: MirrorX/Y removed
+ //mrShape.setFlip( aAttributeList.getBool( XML_flipH, sal_False ), aAttributeList.getBool( XML_flipV, sal_False ) );
}
Reference< XFastContextHandler > Transform2DContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 49ae8d984134..a77a6b8fd2f8 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -455,8 +455,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
sal_Bool bIsDefaultObject = EscherPropertyContainer::IsDefaultObject( pShape );
sal_Bool bPredefinedHandlesUsed = TRUE;
OUString sShapeType;
- sal_uInt32 nMirrorFlags = 0;
- MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType );
+ MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, sShapeType );
const char* sPresetShape = lcl_GetPresetGeometry( USS( sShapeType ) );
DBG(printf("custom shape type: %s ==> %s\n", USS( sShapeType ), sPresetShape));
Sequence< PropertyValue > aGeometrySeq;
@@ -498,7 +497,10 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
// visual shape properties
pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
+
+ // TTTT: Will this take mirrorings into account...?
WriteShapeTransformation( xShape );
+
if( nAdjustmentValuesIndex != -1 )
WritePresetShape( sPresetShape, eShapeType, bPredefinedHandlesUsed, nAdjustmentsWhichNeedsToBeConverted, aGeometrySeq[ nAdjustmentValuesIndex ] );
else
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 348fe315f0fa..3844a1b387a8 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -274,8 +274,6 @@ MaxFieldCount
MaxTextLen
MediaType
MinorTickmarks
-MirroredX
-MirroredY
MissingValueTreatment
Model
ModifyPasswordHash
diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx
index b76f9dcad18a..91c2bd2b989b 100644
--- a/padmin/source/cmddlg.cxx
+++ b/padmin/source/cmddlg.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#include <stdio.h>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
@@ -31,6 +29,7 @@
#include <padialog.hxx>
#include <helper.hxx>
#include <prtsetup.hxx>
+#include <string.h>
using namespace psp;
using namespace rtl;
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index 5a6215d6f96a..d322e1c6b030 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -191,9 +191,12 @@ namespace reportdesign
*
* \return
*/
- ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const;
+ ::boost::shared_ptr<rptui::OReportModel> getSharedSdrModel() const;
- static ::boost::shared_ptr<rptui::OReportModel> getSdrModel(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModel() const;
+
+ static ::boost::shared_ptr<rptui::OReportModel> getSharedSdrModel(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
private:
DECLARE_XINTERFACE( )
DECLARE_XTYPEPROVIDER( )
diff --git a/reportdesign/inc/RptModel.hxx b/reportdesign/inc/RptModel.hxx
index ff6cd539fd34..72764cb4b2ea 100644
--- a/reportdesign/inc/RptModel.hxx
+++ b/reportdesign/inc/RptModel.hxx
@@ -60,13 +60,11 @@ private:
OReportModel( const OReportModel& );
void operator=(const OReportModel& rSrcModel);
public:
- TYPEINFO();
-
OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
virtual ~OReportModel();
virtual void SetChanged(sal_Bool bFlg = sal_True);
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual SdrPage* AllocPage(bool bMasterPage);
virtual Window* GetCurDocViewWin();
virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
/** returns the numbering type that is used to format page fields in drawing shapes */
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index c0d7785351f6..e31033015c7e 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -62,7 +62,6 @@ typedef ::std::multimap< sal_Int16, ::rtl::OUString, ::std::less< sal_Int16 > >
DlgEdHint(DlgEdHint&);
void operator =(DlgEdHint&);
public:
- TYPEINFO();
DlgEdHint( DlgEdHintKind eHint );
virtual ~DlgEdHint();
@@ -132,7 +131,9 @@ public:
*/
void releaseUnoShape() { m_xKeepShapeAlive.clear(); }
- static SdrObject* createObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+ static SdrObject* createObject(
+ SdrModel* pTargetModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
static sal_uInt16 getObjectType(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
};
//============================================================================
@@ -144,27 +145,26 @@ class REPORTDESIGN_DLLPUBLIC OCustomShape: public SdrObjCustomShape , public OOb
friend class DlgEdFactory;
public:
- static OCustomShape* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent )
- {
- return new OCustomShape( _xComponent );
- }
+ static OCustomShape* Create(SdrModel& rSdrModel, const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
protected:
- OCustomShape(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
- OCustomShape(const ::rtl::OUString& _sComponentName);
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+ OCustomShape(SdrModel& rSdrModel, const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+ OCustomShape(SdrModel& rSdrModel, const ::rtl::OUString& _sComponentName);
- virtual void NbcMove( const Size& rSize );
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
virtual void SetSnapRectImpl(const Rectangle& _rRect);
virtual SdrPage* GetImplPage() const;
void SetObjectItemHelper(const SfxPoolItem& rItem);
public:
- TYPEINFO();
-
virtual ~OCustomShape();
virtual sal_Int32 GetStep() const;
@@ -180,34 +180,39 @@ public:
//============================================================================
class REPORTDESIGN_DLLPUBLIC OOle2Obj: public SdrOle2Obj , public OObjectBase
{
+private:
friend class OReportPage;
friend class DlgEdFactory;
sal_uInt16 m_nType;
bool m_bOnlyOnce;
void impl_createDataProvider_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel);
-public:
- static OOle2Obj* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,sal_uInt16 _nType )
- {
- return new OOle2Obj( _xComponent,_nType );
- }
+
protected:
- OOle2Obj(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,sal_uInt16 _nType);
- OOle2Obj(const ::rtl::OUString& _sComponentName,sal_uInt16 _nType);
+ OOle2Obj(
+ SdrModel& rSdrModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent,
+ sal_uInt16 _nType);
+ OOle2Obj(
+ SdrModel& rSdrModel,
+ ::rtl::OUString _sComponentName,
+ sal_uInt16 _nType);
+ virtual ~OOle2Obj();
- virtual void NbcMove( const Size& rSize );
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
virtual void SetSnapRectImpl(const Rectangle& _rRect);
virtual SdrPage* GetImplPage() const;
-public:
- TYPEINFO();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
- virtual ~OOle2Obj();
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+ static OOle2Obj* Create(SdrModel& rSdrModel, const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent, sal_uInt16 _nType);
virtual sal_Int32 GetStep() const;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
@@ -215,8 +220,6 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
virtual sal_uInt16 GetObjIdentifier() const;
virtual sal_uInt32 GetObjInventor() const;
- // Clone() soll eine komplette Kopie des Objektes erzeugen.
- virtual SdrObject* Clone() const;
virtual void initializeOle();
void initializeChart( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel);
@@ -227,31 +230,40 @@ public:
//============================================================================
class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase
{
+private:
friend class OReportPage;
friend class OObjectBase;
friend class DlgEdFactory;
sal_uInt16 m_nObjectType;
+
+ void impl_setReportComponent_nothrow();
+ void impl_initializeModel_nothrow();
+
protected:
- OUnoObject(const ::rtl::OUString& _sComponentName
+ OUnoObject(SdrModel& rSdrModel
+ ,const ::rtl::OUString& _sComponentName
,const ::rtl::OUString& rModelName
,sal_uInt16 _nObjectType);
- OUnoObject( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent
+ OUnoObject( SdrModel& rSdrModel
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent
,const ::rtl::OUString& rModelName
,sal_uInt16 _nObjectType);
virtual ~OUnoObject();
- virtual void NbcMove( const Size& rSize );
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
virtual void SetSnapRectImpl(const Rectangle& _rRect);
virtual SdrPage* GetImplPage() const;
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
virtual sal_Int32 GetStep() const;
virtual void _propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
@@ -268,11 +280,6 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
virtual sal_uInt16 GetObjIdentifier() const;
virtual sal_uInt32 GetObjInventor() const;
- virtual SdrObject* Clone() const;
-
-private:
- void impl_setReportComponent_nothrow();
- void impl_initializeModel_nothrow();
};
//============================================================================
diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx
index 7050778e27c9..265292af2862 100644
--- a/reportdesign/inc/RptPage.hxx
+++ b/reportdesign/inc/RptPage.hxx
@@ -39,12 +39,13 @@ class OReportModel;
class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage
{
+private:
OReportModel& rModel;
::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection;
bool m_bSpecialInsertMode;
- std::vector<SdrObject*> m_aTemporaryObjectList;
+ SdrObjectVector m_aTemporaryObjectList;
- OReportPage(const OReportPage&);
+// OReportPage(const OReportPage&);
// methode to remove temporary objects, created by 'special mode'
// (BegDragObj)
@@ -54,19 +55,20 @@ class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrPage(const SdrPage& rSource);
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrPage* CloneSdrPage(SdrModel* pTargetModel = 0) const;
OReportPage( OReportModel& rModel
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
- ,FASTBOOL bMasterPage=sal_False );
-
-
- virtual SdrPage* Clone() const;
- using SdrPage::Clone;
+ ,bool bMasterPage = false );
- virtual void NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInsertReason* pReason);
- virtual SdrObject* RemoveObject(sal_uLong nObjNum);
+ virtual void InsertObjectToSdrObjList(SdrObject& rObj, sal_uInt32 nPos = CONTAINER_APPEND);
+ virtual SdrObject* RemoveObjectFromSdrObjList(sal_uInt32 nObjNum);
/** returns the index inside the object list which belongs to the report component.
@param _xObject the report component
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
index 775786be17b1..fec8ce6e28f4 100644
--- a/reportdesign/inc/UndoActions.hxx
+++ b/reportdesign/inc/UndoActions.hxx
@@ -171,7 +171,6 @@ namespace rptui
::dbaui::IController* m_pController;
public:
- TYPEINFO();
OCommentUndoAction( SdrModel& rMod
,sal_uInt16 nCommentID);
virtual ~OCommentUndoAction();
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 6b0f648b6563..27fc41cf5dd1 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -772,8 +772,8 @@ void OReportDefinition::init()
m_pImpl->m_pReportModel.reset(new OReportModel(this));
m_pImpl->m_pReportModel->GetItemPool().FreezeIdRanges();
- m_pImpl->m_pReportModel->SetScaleUnit( MAP_100TH_MM );
- SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin();
+ m_pImpl->m_pReportModel->SetExchangeObjectUnit( MAP_100TH_MM );
+ SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetModelLayerAdmin();
rAdmin.NewStandardLayer(RPT_LAYER_FRONT);
rAdmin.NewLayer(UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "back" ) ), RPT_LAYER_BACK );
rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), RPT_LAYER_HIDDEN );
@@ -2022,7 +2022,7 @@ void SAL_CALL OReportDefinition::setModified( ::sal_Bool _bModified ) throw (bea
if ( m_pImpl->m_bModified != _bModified )
{
m_pImpl->m_bModified = _bModified;
- if ( m_pImpl->m_pReportModel->IsChanged() != _bModified )
+ if ( m_pImpl->m_pReportModel->IsChanged() != (bool)_bModified )
m_pImpl->m_pReportModel->SetChanged(_bModified);
lang::EventObject aEvent(*this);
@@ -2254,17 +2254,22 @@ uno::Reference< uno::XComponentContext > OReportDefinition::getContext()
return m_aProps->m_xContext;
}
// -----------------------------------------------------------------------------
-::boost::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel() const
+::boost::shared_ptr<rptui::OReportModel> OReportDefinition::getSharedSdrModel() const
{
return m_pImpl->m_pReportModel;
}
// -----------------------------------------------------------------------------
-::boost::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel(const uno::Reference< report::XReportDefinition >& _xReportDefinition)
+SdrModel* OReportDefinition::getSdrModel() const
+{
+ return m_pImpl->m_pReportModel.get();
+}
+// -----------------------------------------------------------------------------
+::boost::shared_ptr<rptui::OReportModel> OReportDefinition::getSharedSdrModel(const uno::Reference< report::XReportDefinition >& _xReportDefinition)
{
::boost::shared_ptr<rptui::OReportModel> pReportModel;
uno::Reference< lang::XUnoTunnel > xUT( _xReportDefinition, uno::UNO_QUERY );
if( xUT.is() )
- pReportModel = reinterpret_cast<OReportDefinition*>(sal::static_int_cast<sal_uIntPtr>(xUT->getSomething( OReportDefinition::getUnoTunnelImplementationId())))->getSdrModel();
+ pReportModel = reinterpret_cast<OReportDefinition*>(sal::static_int_cast<sal_uIntPtr>(xUT->getSomething( OReportDefinition::getUnoTunnelImplementationId())))->getSharedSdrModel();
return pReportModel;
}
// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx
index d855f0cc0ffe..0abcb407aed8 100644
--- a/reportdesign/source/core/api/Section.cxx
+++ b/reportdesign/source/core/api/Section.cxx
@@ -135,7 +135,7 @@ OSection::OSection(const uno::Reference< report::XReportDefinition >& _xParent
{
DBG_CTOR( rpt_OSection,NULL);
init();
- //.getSdrModel()->createNewPage(m_xSection);
+ //.getSharedSdrModel()->createNewPage(m_xSection);
}
//--------------------------------------------------------------------------
// TODO: VirtualFunctionFinder: This is virtual function!
@@ -181,7 +181,7 @@ void SAL_CALL OSection::disposing()
//m_xDrawPage.clear();
/*uno::Reference< report::XReportDefinition> xReport = getReportDefinition();
- ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSdrModel(xReport);
+ ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSharedSdrModel(xReport);
osl_incrementInterlockedCount( &m_refCount );
while( m_xDrawPage.is() && m_xDrawPage->hasElements() )
{
@@ -197,7 +197,7 @@ void SAL_CALL OSection::disposing()
if ( pModel )
{
uno::Reference< report::XSection> xSection = this;
- pModel->DeletePage(pModel->getPage(xSection)->GetPageNum());
+ pModel->DeletePage(pModel->getPage(xSection)->GetPageNumber());
}
osl_decrementInterlockedCount( &m_refCount );*/
}
@@ -227,7 +227,7 @@ sal_Bool SAL_CALL OSection::supportsService( const ::rtl::OUString& _rServiceNam
void OSection::init()
{
uno::Reference< report::XReportDefinition> xReport = getReportDefinition();
- ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSdrModel(xReport);
+ ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSharedSdrModel(xReport);
OSL_ENSURE(pModel,"No odel set at the report definition!");
if ( pModel )
{
diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx
index b7cb1d11d0c4..a6b3f0526163 100644
--- a/reportdesign/source/core/api/Shape.cxx
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -313,7 +313,7 @@ uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( ) throw (uno::
SdrObject* pObject = pShape->GetSdrObject();
if ( pObject )
{
- SdrObject* pClone = pObject->Clone();
+ SdrObject* pClone = pObject->CloneSdrObject();
if ( pClone )
{
xSet.set(pClone->getUnoShape(),uno::UNO_QUERY_THROW );
diff --git a/reportdesign/source/core/inc/ReportUndoFactory.hxx b/reportdesign/source/core/inc/ReportUndoFactory.hxx
index 161eaeb388ad..b31336b19cf8 100644
--- a/reportdesign/source/core/inc/ReportUndoFactory.hxx
+++ b/reportdesign/source/core/inc/ReportUndoFactory.hxx
@@ -41,26 +41,26 @@ namespace rptui
virtual ~OReportUndoFactory();
// shapes
- virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject );
- virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject, const Size& rDist );
+// virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject );
+// virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject, const basegfx::B2DPoint& rOffset );
virtual SdrUndoAction* CreateUndoGeoObject( SdrObject& rObject );
virtual SdrUndoAction* CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false );
- virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoInsertObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoNewObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoCopyObject( SdrObject& rObject );
virtual SdrUndoAction* CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1);
- virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect = false );
+ virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject );
virtual SdrUndoAction* CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer );
virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
// layer
virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
- virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1);
+// virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1);
// page
virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage);
diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx
index 7cdaf30eec59..36993909beb4 100644
--- a/reportdesign/source/core/sdr/ReportDrawPage.cxx
+++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx
@@ -37,6 +37,7 @@
#include <tools/diagnose_ex.h>
#include <svx/unoshape.hxx>
+#include <svx/svdlegacy.hxx>
namespace reportdesign
{
@@ -54,7 +55,7 @@ SdrObject* OReportDrawPage::_CreateSdrObject( const uno::Reference< drawing::XSh
{
uno::Reference< report::XReportComponent> xReportComponent(xDescr,uno::UNO_QUERY);
if ( xReportComponent.is() )
- return OObjectBase::createObject(xReportComponent);
+ return OObjectBase::createObject(&GetSdrPage()->getSdrModelFromSdrPage(), xReportComponent);
return SvxDrawPage::_CreateSdrObject( xDescr );
}
@@ -75,10 +76,10 @@ uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pOb
bool bChangeOrientation = false;
::rtl::OUString sServiceName = pBaseObj->getServiceName();
OSL_ENSURE(sServiceName.getLength(),"No Service Name given!");
+ OUnoObject* pUnoObj = dynamic_cast< OUnoObject* >(pObj);
- if ( pObj->ISA(OUnoObject) )
+ if ( pUnoObj )
{
- OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObj);
if ( pUnoObj->GetObjIdentifier() == OBJ_DLG_FIXEDTEXT )
{
uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
@@ -87,26 +88,30 @@ uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pOb
}
else
bChangeOrientation = pUnoObj->GetObjIdentifier() == OBJ_DLG_HFIXEDLINE;
+
SvxShapeControl* pShape = new SvxShapeControl( pObj );
xShape.set(*pShape,uno::UNO_QUERY);
- pShape->setShapeKind(pObj->GetObjIdentifier());
+ pShape->setSvxShapeKind(SdrObjectCreatorInventorToSvxShapeKind(pObj->GetObjIdentifier(), pObj->GetObjInventor()));
}
- else if ( pObj->ISA(OCustomShape) )
+ else if ( dynamic_cast< OCustomShape* >(pObj) )
{
SvxCustomShape* pShape = new SvxCustomShape( pObj );
uno::Reference < drawing::XEnhancedCustomShapeDefaulter > xShape2 = pShape;
xShape.set(xShape2,uno::UNO_QUERY);
- pShape->setShapeKind(pObj->GetObjIdentifier());
+ pShape->setSvxShapeKind(SdrObjectCreatorInventorToSvxShapeKind(pObj->GetObjIdentifier(), pObj->GetObjInventor()));
}
- else if ( pObj->ISA(SdrOle2Obj) )
+ else
{
SdrOle2Obj* pOle2Obj = dynamic_cast<SdrOle2Obj*>(pObj);
+
+ if ( pOle2Obj )
+ {
if ( !pOle2Obj->GetObjRef().is() )
{
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
uno::Reference < embed::XEmbeddedObject > xObj;
::rtl::OUString sName;
- xObj = pObj->GetModel()->GetPersist()->getEmbeddedObjectContainer().CreateEmbeddedObject(
+ xObj = pObj->getSdrModelFromSdrObject().GetPersist()->getEmbeddedObjectContainer().CreateEmbeddedObject(
::comphelper::MimeConfigurationHelper::GetSequenceClassIDRepresentation(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("80243D39-6741-46C5-926E-069164FF87BB"))), sName );
OSL_ENSURE(xObj.is(),"Embedded Object could not be created!");
@@ -120,7 +125,7 @@ uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pOb
pOle2Obj->SetPersistName(sName);
pOle2Obj->SetName(sName);
pOle2Obj->SetAspect(nAspect);
- Rectangle aRect = pOle2Obj->GetLogicRect();
+ const Rectangle aRect(sdr::legacy::GetLogicRect(*pOle2Obj));
Size aTmp = aRect.GetSize();
awt::Size aSz( aTmp.Width(), aTmp.Height() );
@@ -128,17 +133,18 @@ uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pOb
}
SvxOle2Shape* pShape = new SvxOle2Shape( pObj );
xShape.set(*pShape,uno::UNO_QUERY);
- pShape->setShapeKind(pObj->GetObjIdentifier());
+ pShape->setSvxShapeKind(SdrObjectCreatorInventorToSvxShapeKind(pObj->GetObjIdentifier(), pObj->GetObjInventor()));
//xShape = new SvxOle2Shape( pOle2Obj );
}
+ }
if ( !xShape.is() )
xShape.set( SvxDrawPage::_CreateShape( pObj ) );
try
{
- OReportModel* pRptModel = static_cast<OReportModel*>(pObj->GetModel());
- xRet.set( pRptModel->createShape(sServiceName,xShape,bChangeOrientation ? 0 : 1), uno::UNO_QUERY_THROW );
+ OReportModel& rRptModel = static_cast< OReportModel& >(pObj->getSdrModelFromSdrObject());
+ xRet.set( rRptModel.createShape(sServiceName,xShape,bChangeOrientation ? 0 : 1), uno::UNO_QUERY_THROW );
}
catch( const uno::Exception& )
{
diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
index 7f17c660519c..24682bdd99de 100644
--- a/reportdesign/source/core/sdr/ReportUndoFactory.cxx
+++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
@@ -39,9 +39,9 @@ SdrUndoAction* lcl_createUndo(SdrObject& rObject,Action _eAction,sal_uInt16 _nCo
uno::Reference< report::XGroup> xGroup = xSection->getGroup();
SdrUndoAction* pUndo = NULL;
if ( xGroup.is() )
- pUndo = new OUndoGroupSectionAction(*rObject.GetModel(),_eAction,OGroupHelper::getMemberFunction(xSection),xGroup,xReportComponent,_nCommentId);
+ pUndo = new OUndoGroupSectionAction(rObject.getSdrModelFromSdrObject(),_eAction,OGroupHelper::getMemberFunction(xSection),xGroup,xReportComponent,_nCommentId);
else
- pUndo = new OUndoReportSectionAction(*rObject.GetModel(),_eAction,OReportHelper::getMemberFunction(xSection),xSection->getReportDefinition(),xReportComponent,_nCommentId);
+ pUndo = new OUndoReportSectionAction(rObject.getSdrModelFromSdrObject(),_eAction,OReportHelper::getMemberFunction(xSection),xSection->getReportDefinition(),xReportComponent,_nCommentId);
return pUndo;
}
// -----------------------------------------------------------------------------
@@ -58,15 +58,15 @@ OReportUndoFactory::~OReportUndoFactory()
}
///////////////////////////////////////////////////////////////////////
// shapes
-SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject )
-{
- return m_pUndoFactory->CreateUndoMoveObject( rObject );
-}
-
-SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
-{
- return m_pUndoFactory->CreateUndoMoveObject( rObject, rDist );
-}
+//SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject )
+//{
+// return m_pUndoFactory->CreateUndoMoveObject( rObject );
+//}
+//
+//SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const basegfx::B2DPoint& rOffset )
+//{
+// return m_pUndoFactory->CreateUndoMoveObject( rObject, rOffset );
+//}
SdrUndoAction* OReportUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
{
@@ -78,30 +78,29 @@ SdrUndoAction* OReportUndoFactory::CreateUndoAttrObject( SdrObject& rObject, boo
return m_pUndoFactory->CreateUndoAttrObject( rObject, bStyleSheet1 ? sal_True : sal_False, bSaveText ? sal_True : sal_False );
}
-SdrUndoAction* OReportUndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* OReportUndoFactory::CreateUndoRemoveObject( SdrObject& rObject )
{
- return m_pUndoFactory->CreateUndoRemoveObject( rObject, bOrdNumDirect ? sal_True : sal_False );
+ return m_pUndoFactory->CreateUndoRemoveObject( rObject );
}
-SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
+SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject )
{
return lcl_createUndo(rObject,rptui::Inserted,RID_STR_UNDO_INSERT_CONTROL);
}
-SdrUndoAction* OReportUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
+SdrUndoAction* OReportUndoFactory::CreateUndoDeleteObject( SdrObject& rObject )
{
return lcl_createUndo(rObject,rptui::Removed,RID_STR_UNDO_DELETE_CONTROL);
- //return m_pUndoFactory->CreateUndoDeleteObject( rObject, bOrdNumDirect ? sal_True : sal_False );
}
-SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
+SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject )
{
return lcl_createUndo(rObject,rptui::Inserted,RID_STR_UNDO_INSERT_CONTROL);
}
-SdrUndoAction* OReportUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* OReportUndoFactory::CreateUndoCopyObject( SdrObject& rObject )
{
- return m_pUndoFactory->CreateUndoCopyObject( rObject, bOrdNumDirect ? sal_True : sal_False );
+ return m_pUndoFactory->CreateUndoCopyObject( rObject );
}
SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
@@ -109,9 +108,9 @@ SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, s
return m_pUndoFactory->CreateUndoObjectOrdNum( rObject, nOldOrdNum1, nNewOrdNum1 );
}
-SdrUndoAction* OReportUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect )
+SdrUndoAction* OReportUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject )
{
- return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect ? sal_True : sal_False );
+ return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject );
}
SdrUndoAction* OReportUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer )
@@ -135,10 +134,10 @@ SdrUndoAction* OReportUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, S
return m_pUndoFactory->CreateUndoDeleteLayer( nLayerNum, rNewLayerAdmin, rNewModel );
}
-SdrUndoAction* OReportUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
-{
- return m_pUndoFactory->CreateUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNeuPos1 );
-}
+//SdrUndoAction* OReportUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
+//{
+// return m_pUndoFactory->CreateUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNeuPos1 );
+//}
// page
SdrUndoAction* OReportUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx
index 3dc4dac988bc..4996c1b7d450 100644
--- a/reportdesign/source/core/sdr/RptModel.cxx
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -52,7 +52,6 @@ namespace rptui
using namespace reportdesign;
using namespace com::sun::star;
DBG_NAME( rpt_OReportModel )
-TYPEINIT1(OReportModel,SdrModel);
//----------------------------------------------------------------------------
@@ -62,7 +61,7 @@ OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition
,m_pReportDefinition(_pReportDefinition)
{
DBG_CTOR( rpt_OReportModel,0);
- SetAllowShapePropertyChangeListener(true);
+// SetAllowShapePropertyChangeListener(true);
m_pUndoEnv = new OXUndoEnvironment(*this);
m_pUndoEnv->acquire();
SetSdrUndoFactory(new OReportUndoFactory);
@@ -92,7 +91,7 @@ void OReportModel::detachController()
m_pUndoEnv->Clear(OXUndoEnvironment::Accessor());
}
//----------------------------------------------------------------------------
-SdrPage* OReportModel::AllocPage(FASTBOOL /*bMasterPage*/)
+SdrPage* OReportModel::AllocPage(bool /*bMasterPage*/)
{
DBG_CHKTHIS( rpt_OReportModel, 0);
OSL_ENSURE(0,"Who called me!");
@@ -150,7 +149,7 @@ OReportPage* OReportModel::getPage(const uno::Reference< report::XSection >& _xS
sal_uInt16 nCount = GetPageCount();
for (sal_uInt16 i = 0; i < nCount && !pPage ; ++i)
{
- OReportPage* pRptPage = PTR_CAST( OReportPage, GetPage(i) );
+ OReportPage* pRptPage = dynamic_cast< OReportPage* >( GetPage(i) );
if ( pRptPage && pRptPage->getSection() == _xSection )
pPage = pRptPage;
}
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index ab43faf7d11b..4cacefd894ce 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -41,9 +41,10 @@
#include <svx/xlnclit.hxx>
#include <svx/xlndsit.hxx>
#include <svx/xlineit0.hxx>
-#include <svx/sderitm.hxx>
#include <svx/xlnwtit.hxx>
#include <svx/xlntrit.hxx>
+#include <svx/svdlegacy.hxx>
+
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/awt/XTabControllerModel.hpp>
#include <com/sun/star/awt/XUnoControlContainer.hpp>
@@ -115,7 +116,7 @@ sal_uInt16 OObjectBase::getObjectType(const uno::Reference< report::XReportCompo
return 0;
}
// -----------------------------------------------------------------------------
-SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportComponent>& _xComponent)
+SdrObject* OObjectBase::createObject(SdrModel* pTargetModel, const uno::Reference< report::XReportComponent>& _xComponent)
{
SdrObject* pNewObj = NULL;
sal_uInt16 nType = OObjectBase::getObjectType(_xComponent);
@@ -123,9 +124,12 @@ SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportCompon
{
case OBJ_DLG_FIXEDTEXT:
{
- OUnoObject* pUnoObj = new OUnoObject( _xComponent
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))
- ,OBJ_DLG_FIXEDTEXT);
+ OUnoObject* pUnoObj = new OUnoObject(
+ *pTargetModel,
+ _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))
+ ,OBJ_DLG_FIXEDTEXT);
+ SetUnoShapeAtSdrObjectFromSvxShape(*pUnoObj, _xComponent);
pNewObj = pUnoObj;
uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
@@ -134,23 +138,34 @@ SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportCompon
}
break;
case OBJ_DLG_IMAGECONTROL:
- pNewObj = new OUnoObject(_xComponent
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"))
- ,OBJ_DLG_IMAGECONTROL);
+ pNewObj = new OUnoObject(
+ *pTargetModel,
+ _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"))
+ ,OBJ_DLG_IMAGECONTROL);
+ SetUnoShapeAtSdrObjectFromSvxShape(*pNewObj, _xComponent);
break;
case OBJ_DLG_FORMATTEDFIELD:
- pNewObj = new OUnoObject( _xComponent
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"))
- ,OBJ_DLG_FORMATTEDFIELD);
+ pNewObj = new OUnoObject(
+ *pTargetModel,
+ _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"))
+ ,OBJ_DLG_FORMATTEDFIELD);
+ SetUnoShapeAtSdrObjectFromSvxShape(*pNewObj, _xComponent);
break;
case OBJ_DLG_HFIXEDLINE:
case OBJ_DLG_VFIXEDLINE:
- pNewObj = new OUnoObject( _xComponent
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel"))
- ,nType);
+ pNewObj = new OUnoObject(
+ *pTargetModel,
+ _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel"))
+ ,nType);
+ SetUnoShapeAtSdrObjectFromSvxShape(*pNewObj, _xComponent);
break;
case OBJ_CUSTOMSHAPE:
- pNewObj = OCustomShape::Create( _xComponent );
+ pNewObj = OCustomShape::Create(
+ *pTargetModel,
+ _xComponent );
try
{
sal_Bool bOpaque = sal_False;
@@ -164,7 +179,10 @@ SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportCompon
break;
case OBJ_DLG_SUBREPORT:
case OBJ_OLE2:
- pNewObj = OOle2Obj::Create( _xComponent,nType );
+ pNewObj = OOle2Obj::Create(
+ *pTargetModel,
+ _xComponent,
+ nType );
break;
default:
OSL_ENSURE(0,"Unknown object id");
@@ -412,7 +430,7 @@ void OObjectBase::SetPropsFromRect(const Rectangle& _rRect)
xSection->setHeight(_rRect.getHeight() + _rRect.Top());
// TODO
- //pModel->GetRefDevice()->Invalidate(INVALIDATE_CHILDREN);
+ //pModel->GetReferenceDevice()->Invalidate(INVALIDATE_CHILDREN);
}
}
//----------------------------------------------------------------------------
@@ -479,21 +497,18 @@ uno::Reference< uno::XInterface > OObjectBase::getUnoShapeOf( SdrObject& _rSdrOb
}
//----------------------------------------------------------------------------
-TYPEINIT1(OCustomShape, SdrObjCustomShape);
DBG_NAME( rpt_OCustomShape );
-OCustomShape::OCustomShape(const uno::Reference< report::XReportComponent>& _xComponent
- )
- :SdrObjCustomShape()
- ,OObjectBase(_xComponent)
+OCustomShape::OCustomShape(SdrModel& rSdrModel, const uno::Reference< report::XReportComponent>& _xComponent)
+ :SdrObjCustomShape(rSdrModel)
+ ,OObjectBase(_xComponent)
{
DBG_CTOR( rpt_OCustomShape, NULL);
- impl_setUnoShape( uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY) );
m_bIsListening = sal_True;
}
//----------------------------------------------------------------------------
-OCustomShape::OCustomShape(const ::rtl::OUString& _sComponentName)
- :SdrObjCustomShape()
- ,OObjectBase(_sComponentName)
+OCustomShape::OCustomShape(SdrModel& rSdrModel, const ::rtl::OUString& _sComponentName)
+ :SdrObjCustomShape(rSdrModel)
+ ,OObjectBase(_sComponentName)
{
DBG_CTOR( rpt_OCustomShape, NULL);
m_bIsListening = sal_True;
@@ -504,6 +519,47 @@ OCustomShape::~OCustomShape()
{
DBG_DTOR( rpt_OCustomShape, NULL);
}
+
+void OCustomShape::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const OCustomShape* pSource = dynamic_cast< const OCustomShape* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrObjCustomShape::copyDataFromSdrObject(rSource);
+
+ // no local data to copy
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* OCustomShape::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ OCustomShape* pClone = new OCustomShape(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ getReportComponent());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+OCustomShape* OCustomShape::Create(SdrModel& rSdrModel, const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent)
+{
+ OCustomShape* pNew = new OCustomShape( rSdrModel, _xComponent );
+ OSL_ENSURE(pNew, "Create error (!)");
+ SetUnoShapeAtSdrObjectFromSvxShape(*pNew, _xComponent);
+
+ return pNew;
+}
+
// -----------------------------------------------------------------------------
sal_uInt16 OCustomShape::GetObjIdentifier() const
{
@@ -517,12 +573,12 @@ sal_uInt32 OCustomShape::GetObjInventor() const
//----------------------------------------------------------------------------
SdrPage* OCustomShape::GetImplPage() const
{
- return GetPage();
+ return getSdrPageFromSdrObject();
}
//----------------------------------------------------------------------------
void OCustomShape::SetSnapRectImpl(const Rectangle& _rRect)
{
- SetSnapRect( _rRect );
+ sdr::legacy::SetSnapRect(*this, _rRect );
}
//----------------------------------------------------------------------------
sal_Int32 OCustomShape::GetStep() const
@@ -532,56 +588,44 @@ sal_Int32 OCustomShape::GetStep() const
OSL_ENSURE(0,"Who called me!");
return nStep;
}
+
//----------------------------------------------------------------------------
-void OCustomShape::NbcMove( const Size& rSize )
+void OCustomShape::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
+ // call parent
+ SdrObjCustomShape::setSdrObjectTransformation(rTransformation);
+
if ( m_bIsListening )
{
m_bIsListening = sal_False;
if ( m_xReportComponent.is() )
{
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
- m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.A());
- m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.B());
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
+ const basegfx::B2DPoint& rTopLeft = getSdrObjectTranslate();
+ m_xReportComponent->setPositionX(int(rTopLeft.getX()));
+ m_xReportComponent->setPositionY(int(rTopLeft.getY()));
}
// set geometry properties
- SetPropsFromRect(GetSnapRect());
+ SetPropsFromRect(sdr::legacy::GetSnapRect(*this));
m_bIsListening = sal_True;
}
- else
- SdrObjCustomShape::NbcMove( rSize );
}
-//----------------------------------------------------------------------------
-void OCustomShape::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
-{
- SdrObjCustomShape::NbcResize( rRef, xFract, yFract );
- SetPropsFromRect(GetSnapRect());
-}
-//----------------------------------------------------------------------------
-void OCustomShape::NbcSetLogicRect(const Rectangle& rRect)
-{
- SdrObjCustomShape::NbcSetLogicRect(rRect);
- SetPropsFromRect(rRect);
-}
//----------------------------------------------------------------------------
-FASTBOOL OCustomShape::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool OCustomShape::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- FASTBOOL bResult = SdrObjCustomShape::EndCreate(rStat, eCmd);
+ bool bResult(SdrObjCustomShape::EndCreate(rStat, eCmd));
if ( bResult )
{
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- if ( pRptModel )
- {
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
if ( !m_xReportComponent.is() )
m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
- }
- SetPropsFromRect(GetSnapRect());
+ SetPropsFromRect(sdr::legacy::GetSnapRect(*this));
}
return bResult;
@@ -591,8 +635,6 @@ FASTBOOL OCustomShape::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
void OCustomShape::SetObjectItemHelper(const SfxPoolItem& rItem)
{
SetObjectItem(rItem);
- // TODO
- //getSectionWindow()->getView()->AdjustMarkHdl();
}
// -----------------------------------------------------------------------------
@@ -607,8 +649,8 @@ uno::Reference< uno::XInterface > OCustomShape::getUnoShape()
uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this );
if ( !m_xReportComponent.is() )
{
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
m_xReportComponent.set(xShape,uno::UNO_QUERY);
}
return xShape;
@@ -616,13 +658,12 @@ uno::Reference< uno::XInterface > OCustomShape::getUnoShape()
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
-TYPEINIT1(OUnoObject, SdrUnoObj);
DBG_NAME( rpt_OUnoObject );
-//----------------------------------------------------------------------------
-OUnoObject::OUnoObject(const ::rtl::OUString& _sComponentName
+OUnoObject::OUnoObject(SdrModel& rSdrModel
+ ,const ::rtl::OUString& _sComponentName
,const ::rtl::OUString& rModelName
,sal_uInt16 _nObjectType)
- :SdrUnoObj(rModelName, sal_True)
+: SdrUnoObj(rSdrModel, rModelName, sal_True)
,OObjectBase(_sComponentName)
,m_nObjectType(_nObjectType)
{
@@ -631,15 +672,15 @@ OUnoObject::OUnoObject(const ::rtl::OUString& _sComponentName
impl_initializeModel_nothrow();
}
//----------------------------------------------------------------------------
-OUnoObject::OUnoObject(const uno::Reference< report::XReportComponent>& _xComponent
+OUnoObject::OUnoObject(SdrModel& rSdrModel
+ ,const uno::Reference< report::XReportComponent>& _xComponent
,const ::rtl::OUString& rModelName
,sal_uInt16 _nObjectType)
- :SdrUnoObj(rModelName, sal_True)
+: SdrUnoObj(rSdrModel, rModelName, sal_True)
,OObjectBase(_xComponent)
,m_nObjectType(_nObjectType)
{
DBG_CTOR( rpt_OUnoObject, NULL);
- impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) );
if ( rModelName.getLength() )
impl_initializeModel_nothrow();
@@ -652,6 +693,48 @@ OUnoObject::~OUnoObject()
{
DBG_DTOR( rpt_OUnoObject, NULL);
}
+
+void OUnoObject::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const OUnoObject* pSource = dynamic_cast< const OUnoObject* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrUnoObj::copyDataFromSdrObject(rSource);
+
+ // no own local data to copy (? had no own operator= at least)
+ Reference<XPropertySet> xSource(const_cast< OUnoObject* >(pSource)->getUnoShape(),uno::UNO_QUERY);
+ Reference<XPropertySet> xDest(getUnoShape(),uno::UNO_QUERY);
+
+ if ( xSource.is() && xDest.is() )
+ {
+ comphelper::copyProperties(xSource.get(),xDest.get());
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* OUnoObject::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ OUnoObject* pClone = new OUnoObject(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ getReportComponent(),
+ String(),
+ GetObjIdentifier());
+ SetUnoShapeAtSdrObjectFromSvxShape(*pClone, getReportComponent());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
// -----------------------------------------------------------------------------
void OUnoObject::impl_initializeModel_nothrow()
{
@@ -677,12 +760,8 @@ void OUnoObject::impl_setReportComponent_nothrow()
if ( m_xReportComponent.is() )
return;
- OReportModel* pReportModel = static_cast<OReportModel*>(GetModel());
- OSL_ENSURE( pReportModel, "OUnoObject::impl_setReportComponent_nothrow: no report model!" );
- if ( !pReportModel )
- return;
-
- OXUndoEnvironment::OUndoEnvLock aLock( pReportModel->GetUndoEnv() );
+ OReportModel& rReportModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock( rReportModel.GetUndoEnv() );
m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
impl_initializeModel_nothrow();
@@ -701,13 +780,13 @@ sal_uInt32 OUnoObject::GetObjInventor() const
SdrPage* OUnoObject::GetImplPage() const
{
DBG_CHKTHIS( rpt_OUnoObject,NULL);
- return GetPage();
+ return getSdrPageFromSdrObject();
}
//----------------------------------------------------------------------------
void OUnoObject::SetSnapRectImpl(const Rectangle& _rRect)
{
DBG_CHKTHIS( rpt_OUnoObject,NULL);
- SetSnapRect( _rRect );
+ sdr::legacy::SetSnapRect(*this, _rRect );
}
//----------------------------------------------------------------------------
sal_Int32 OUnoObject::GetStep() const
@@ -720,94 +799,58 @@ sal_Int32 OUnoObject::GetStep() const
}
//----------------------------------------------------------------------------
-void OUnoObject::NbcMove( const Size& rSize )
+void OUnoObject::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ // call parent
+ SdrUnoObj::setSdrObjectTransformation(rTransformation);
+
if ( m_bIsListening )
{
// stop listening
OObjectBase::EndListening(sal_False);
- bool bPositionFixed = false;
- Size aUndoSize(0,0);
- bool bUndoMode = false;
if ( m_xReportComponent.is() )
{
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- if (pRptModel->GetUndoEnv().IsUndoMode())
- {
- // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode
- bUndoMode = true;
- }
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
-
- // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point?
- int nNewX = m_xReportComponent->getPositionX() + rSize.A();
- // can this hinder us to set components outside the area?
- // if (nNewX < 0)
- // {
- // nNewX = 0;
- // }
- m_xReportComponent->setPositionX(nNewX);
- int nNewY = m_xReportComponent->getPositionY() + rSize.B();
- if (nNewY < 0 && !bUndoMode)
- {
- aUndoSize.B() = abs(nNewY);
- bPositionFixed = true;
- nNewY = 0;
- }
- m_xReportComponent->setPositionY(nNewY);
- }
- if (bPositionFixed)
- {
- GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
- }
- // set geometry properties
- SetPropsFromRect(GetLogicRect());
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ const bool bUndoMode(rRptModel.GetUndoEnv().IsUndoMode());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
+ const basegfx::B2DPoint& rNewTopLeft(getSdrObjectTranslate());
+ basegfx::B2DPoint aCorrectedTopLeft(rNewTopLeft);
- // start listening
- OObjectBase::StartListening();
- }
- else
- SdrUnoObj::NbcMove( rSize );
+ if(rNewTopLeft.getY() < 0.0 && !bUndoMode)
+ {
+ aCorrectedTopLeft.setY(0.0);
}
-//----------------------------------------------------------------------------
-
-void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+ if(aCorrectedTopLeft != rNewTopLeft)
{
- DBG_CHKTHIS( rpt_OUnoObject,NULL);
- SdrUnoObj::NbcResize( rRef, xFract, yFract );
+ basegfx::B2DHomMatrix aCorrected(rTransformation);
- // stop listening
- OObjectBase::EndListening(sal_False);
-
- // set geometry properties
- SetPropsFromRect(GetLogicRect());
+ aCorrected.translate(aCorrectedTopLeft - rNewTopLeft);
+ rRptModel.AddUndo(rRptModel.GetSdrUndoFactory().CreateUndoGeoObject(*this));
+ SdrUnoObj::setSdrObjectTransformation(aCorrected);
+ }
- // start listening
- OObjectBase::StartListening();
+ m_xReportComponent->setPositionX(int(aCorrectedTopLeft.getX()));
+ m_xReportComponent->setPositionY(int(aCorrectedTopLeft.getY()));
}
-//----------------------------------------------------------------------------
-void OUnoObject::NbcSetLogicRect(const Rectangle& rRect)
-{
- SdrUnoObj::NbcSetLogicRect(rRect);
- // stop listening
- OObjectBase::EndListening(sal_False);
// set geometry properties
- SetPropsFromRect(rRect);
+ SetPropsFromRect(sdr::legacy::GetLogicRect(*this));
// start listening
OObjectBase::StartListening();
}
+}
+
//----------------------------------------------------------------------------
-FASTBOOL OUnoObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool OUnoObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
DBG_CHKTHIS( rpt_OUnoObject,NULL);
- FASTBOOL bResult = SdrUnoObj::EndCreate(rStat, eCmd);
+ bool bResult(SdrUnoObj::EndCreate(rStat, eCmd));
if ( bResult )
{
impl_setReportComponent_nothrow();
@@ -829,7 +872,7 @@ FASTBOOL OUnoObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
impl_initializeModel_nothrow();
}
// set geometry properties
- SetPropsFromRect(GetLogicRect());
+ SetPropsFromRect(sdr::legacy::GetLogicRect(*this));
}
return bResult;
@@ -943,38 +986,28 @@ uno::Reference< uno::XInterface > OUnoObject::getUnoShape()
{
return OObjectBase::getUnoShapeOf( *this );
}
-// -----------------------------------------------------------------------------
-SdrObject* OUnoObject::Clone() const
-{
- SdrObject* pClone = SdrUnoObj::Clone();
- if ( pClone )
- {
- Reference<XPropertySet> xSource(const_cast<OUnoObject*>(this)->getUnoShape(),uno::UNO_QUERY);
- Reference<XPropertySet> xDest(pClone->getUnoShape(),uno::UNO_QUERY);
- if ( xSource.is() && xDest.is() )
- comphelper::copyProperties(xSource.get(),xDest.get());
- } // if ( pClone )
- return pClone;
-}
//----------------------------------------------------------------------------
// OOle2Obj
//----------------------------------------------------------------------------
-TYPEINIT1(OOle2Obj, SdrOle2Obj);
DBG_NAME( rpt_OOle2Obj );
-OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,sal_uInt16 _nType)
- :SdrOle2Obj()
+OOle2Obj::OOle2Obj(
+ SdrModel& rSdrModel,
+ const uno::Reference< report::XReportComponent>& _xComponent,
+ sal_uInt16 _nType)
+: SdrOle2Obj(rSdrModel)
,OObjectBase(_xComponent)
,m_nType(_nType)
,m_bOnlyOnce(true)
{
DBG_CTOR( rpt_OOle2Obj, NULL);
-
- impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) );
m_bIsListening = sal_True;
}
//----------------------------------------------------------------------------
-OOle2Obj::OOle2Obj(const ::rtl::OUString& _sComponentName,sal_uInt16 _nType)
- :SdrOle2Obj()
+OOle2Obj::OOle2Obj(
+ SdrModel& rSdrModel,
+ ::rtl::OUString _sComponentName,
+ sal_uInt16 _nType)
+: SdrOle2Obj(rSdrModel)
,OObjectBase(_sComponentName)
,m_nType(_nType)
,m_bOnlyOnce(true)
@@ -1001,13 +1034,13 @@ sal_uInt32 OOle2Obj::GetObjInventor() const
SdrPage* OOle2Obj::GetImplPage() const
{
DBG_CHKTHIS( rpt_OOle2Obj,NULL);
- return GetPage();
+ return getSdrPageFromSdrObject();
}
//----------------------------------------------------------------------------
void OOle2Obj::SetSnapRectImpl(const Rectangle& _rRect)
{
DBG_CHKTHIS( rpt_OOle2Obj,NULL);
- SetSnapRect( _rRect );
+ sdr::legacy::SetSnapRect(*this, _rRect );
}
//----------------------------------------------------------------------------
sal_Int32 OOle2Obj::GetStep() const
@@ -1020,105 +1053,66 @@ sal_Int32 OOle2Obj::GetStep() const
}
//----------------------------------------------------------------------------
-void OOle2Obj::NbcMove( const Size& rSize )
+void OOle2Obj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
DBG_CHKTHIS( rpt_OOle2Obj,NULL);
+ // call parent
+ SdrOle2Obj::setSdrObjectTransformation(rTransformation);
+
if ( m_bIsListening )
{
// stop listening
OObjectBase::EndListening(sal_False);
- bool bPositionFixed = false;
- Size aUndoSize(0,0);
- bool bUndoMode = false;
if ( m_xReportComponent.is() )
{
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- if (pRptModel->GetUndoEnv().IsUndoMode())
- {
- // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode
- bUndoMode = true;
- }
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
-
- // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point?
- int nNewX = m_xReportComponent->getPositionX() + rSize.A();
- // can this hinder us to set components outside the area?
- // if (nNewX < 0)
- // {
- // nNewX = 0;
- // }
- m_xReportComponent->setPositionX(nNewX);
- int nNewY = m_xReportComponent->getPositionY() + rSize.B();
- if (nNewY < 0 && !bUndoMode)
- {
- aUndoSize.B() = abs(nNewY);
- bPositionFixed = true;
- nNewY = 0;
- }
- m_xReportComponent->setPositionY(nNewY);
- }
- if (bPositionFixed)
- {
- GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
- }
- // set geometry properties
- SetPropsFromRect(GetLogicRect());
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ const bool bUndoMode(rRptModel.GetUndoEnv().IsUndoMode());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
+ const basegfx::B2DPoint& rNewTopLeft(getSdrObjectTranslate());
+ basegfx::B2DPoint aCorrectedTopLeft(rNewTopLeft);
- // start listening
- OObjectBase::StartListening();
- }
- else
- SdrOle2Obj::NbcMove( rSize );
+ if(rNewTopLeft.getY() < 0.0 && !bUndoMode)
+ {
+ aCorrectedTopLeft.setY(0.0);
}
-//----------------------------------------------------------------------------
-
-void OOle2Obj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+ if(aCorrectedTopLeft != rNewTopLeft)
{
- DBG_CHKTHIS( rpt_OOle2Obj,NULL);
- SdrOle2Obj::NbcResize( rRef, xFract, yFract );
-
- // stop listening
- OObjectBase::EndListening(sal_False);
+ basegfx::B2DHomMatrix aCorrected(rTransformation);
- // set geometry properties
- SetPropsFromRect(GetLogicRect());
+ aCorrected.translate(aCorrectedTopLeft - rNewTopLeft);
+ rRptModel.AddUndo(rRptModel.GetSdrUndoFactory().CreateUndoGeoObject(*this));
+ SdrOle2Obj::setSdrObjectTransformation(aCorrected);
+ }
- // start listening
- OObjectBase::StartListening();
+ m_xReportComponent->setPositionX(int(aCorrectedTopLeft.getX()));
+ m_xReportComponent->setPositionY(int(aCorrectedTopLeft.getY()));
}
-//----------------------------------------------------------------------------
-void OOle2Obj::NbcSetLogicRect(const Rectangle& rRect)
-{
- SdrOle2Obj::NbcSetLogicRect(rRect);
- // stop listening
- OObjectBase::EndListening(sal_False);
// set geometry properties
- SetPropsFromRect(rRect);
+ SetPropsFromRect(sdr::legacy::GetLogicRect(*this));
// start listening
OObjectBase::StartListening();
}
+}
+
//----------------------------------------------------------------------------
-FASTBOOL OOle2Obj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool OOle2Obj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
DBG_CHKTHIS( rpt_OOle2Obj,NULL);
- FASTBOOL bResult = SdrOle2Obj::EndCreate(rStat, eCmd);
+ bool bResult(SdrOle2Obj::EndCreate(rStat, eCmd));
if ( bResult )
{
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- if ( pRptModel )
- {
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
if ( !m_xReportComponent.is() )
m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
- }
// set geometry properties
- SetPropsFromRect(GetLogicRect());
+ SetPropsFromRect(sdr::legacy::GetLogicRect(*this));
}
return bResult;
@@ -1135,8 +1129,8 @@ uno::Reference< uno::XInterface > OOle2Obj::getUnoShape()
uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this );
if ( !m_xReportComponent.is() )
{
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
m_xReportComponent.set(xShape,uno::UNO_QUERY);
}
return xShape;
@@ -1157,21 +1151,62 @@ uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const
return xSource;
}
// -----------------------------------------------------------------------------
-// Clone() soll eine komplette Kopie des Objektes erzeugen.
-SdrObject* OOle2Obj::Clone() const
+void OOle2Obj::copyDataFromSdrObject(const SdrObject& rSource)
{
- OOle2Obj* pObj = static_cast<OOle2Obj*>(SdrOle2Obj::Clone());
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- svt::EmbeddedObjectRef::TryRunningState( pObj->GetObjRef() );
- pObj->impl_createDataProvider_nothrow(pRptModel->getReportDefinition().get());
+ if(this != &rSource)
+ {
+ const OOle2Obj* pSource = dynamic_cast< const OOle2Obj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrOle2Obj::copyDataFromSdrObject(rSource);
+
+ // no own local data to copy (? had no own operator= at least)
+ OReportModel& rRptModel = static_cast< OReportModel& >(pSource->getSdrModelFromSdrObject());
+ svt::EmbeddedObjectRef::TryRunningState( GetObjRef() );
+ impl_createDataProvider_nothrow(rRptModel.getReportDefinition().get());
- uno::Reference< chart2::data::XDatabaseDataProvider > xSource( lcl_getDataProvider(GetObjRef()) );
- uno::Reference< chart2::data::XDatabaseDataProvider > xDest( lcl_getDataProvider(pObj->GetObjRef()) );
- if ( xSource.is() && xDest.is() )
- comphelper::copyProperties(xSource.get(),xDest.get());
+ uno::Reference< chart2::data::XDatabaseDataProvider > xSource( lcl_getDataProvider(pSource->GetObjRef()) );
+ uno::Reference< chart2::data::XDatabaseDataProvider > xDest( lcl_getDataProvider(GetObjRef()) );
+
+ if ( xSource.is() && xDest.is() )
+ {
+ comphelper::copyProperties(xSource.get(),xDest.get());
+ }
+
+ initializeChart(rRptModel.getReportDefinition().get());
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+SdrObject* OOle2Obj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ OOle2Obj* pClone = new OOle2Obj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ getReportComponent(),
+ GetObjIdentifier());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ SetUnoShapeAtSdrObjectFromSvxShape(*pClone, getReportComponent());
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+// -----------------------------------------------------------------------------
+OOle2Obj* OOle2Obj::Create(
+ SdrModel& rSdrModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent,
+ sal_uInt16 _nType)
+{
+ OOle2Obj* pNew = new OOle2Obj( rSdrModel, _xComponent, _nType );
+ OSL_ENSURE(pNew, "Create error (!)");
+ SetUnoShapeAtSdrObjectFromSvxShape(*pNew, _xComponent);
- pObj->initializeChart(pRptModel->getReportDefinition().get());
- return pObj;
+ return pNew;
}
// -----------------------------------------------------------------------------
void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XModel>& _xModel)
@@ -1202,8 +1237,8 @@ void OOle2Obj::initializeOle()
{
m_bOnlyOnce = false;
uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef();
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- pRptModel->GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ rRptModel.GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
if( xCompSupp.is() )
@@ -1233,8 +1268,8 @@ void OOle2Obj::initializeChart( const uno::Reference< frame::XModel>& _xModel)
if ( !lcl_getDataProvider(xObj).is() )
impl_createDataProvider_nothrow(_xModel);
- OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
- pRptModel->GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
+ OReportModel& rRptModel = static_cast< OReportModel& >(getSdrModelFromSdrObject());
+ rRptModel.GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
::comphelper::NamedValueCollection aArgs;
aArgs.put( "CellRangeRepresentation", uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "all" ) ) ) );
diff --git a/reportdesign/source/core/sdr/RptObjectListener.cxx b/reportdesign/source/core/sdr/RptObjectListener.cxx
index 7d805637dda9..1229f7a0736c 100644
--- a/reportdesign/source/core/sdr/RptObjectListener.cxx
+++ b/reportdesign/source/core/sdr/RptObjectListener.cxx
@@ -74,10 +74,6 @@ void SAL_CALL OObjectListener::propertyChange( const ::com::sun::star::beans::P
// DlgEdHint
//============================================================================
-TYPEINIT1( DlgEdHint, SfxHint );
-
-//----------------------------------------------------------------------------
-
DlgEdHint::DlgEdHint( DlgEdHintKind eHint )
:eHintKind( eHint )
{
diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx
index a73c7ad17d46..af564656460a 100644
--- a/reportdesign/source/core/sdr/RptPage.cxx
+++ b/reportdesign/source/core/sdr/RptPage.cxx
@@ -31,13 +31,11 @@
namespace rptui
{
using namespace ::com::sun::star;
-TYPEINIT1( OReportPage, SdrPage );
-
//----------------------------------------------------------------------------
DBG_NAME( rpt_OReportPage )
OReportPage::OReportPage( OReportModel& _rModel
,const uno::Reference< report::XSection >& _xSection
- ,FASTBOOL bMasterPage )
+ ,bool bMasterPage )
:SdrPage( _rModel, bMasterPage )
,rModel(_rModel)
,m_xSection(_xSection)
@@ -48,15 +46,15 @@ OReportPage::OReportPage( OReportModel& _rModel
//----------------------------------------------------------------------------
-OReportPage::OReportPage( const OReportPage& rPage )
- :SdrPage( rPage )
- ,rModel(rPage.rModel)
- ,m_xSection(rPage.m_xSection)
- ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode)
- ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList)
-{
- DBG_CTOR( rpt_OReportPage,NULL);
-}
+//OReportPage::OReportPage( const OReportPage& rPage )
+// :SdrPage( rPage )
+// ,rModel(rPage.rModel)
+// ,m_xSection(rPage.m_xSection)
+// ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode)
+// ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList)
+//{
+// DBG_CTOR( rpt_OReportPage,NULL);
+//}
//----------------------------------------------------------------------------
@@ -65,12 +63,38 @@ OReportPage::~OReportPage()
DBG_DTOR( rpt_OReportPage,NULL);
}
-//----------------------------------------------------------------------------
+void OReportPage::copyDataFromSdrPage(const SdrPage& rSource)
+{
+ if(this != &rSource)
+ {
+ const OReportPage* pSource = dynamic_cast< const OReportPage* >(&rSource);
-SdrPage* OReportPage::Clone() const
+ if(pSource)
{
- DBG_CHKTHIS( rpt_OReportPage,NULL);
- return new OReportPage( *this );
+ // call parent
+ SdrPage::copyDataFromSdrPage(rSource);
+
+ // no local data to copy
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrPage* OReportPage::CloneSdrPage(SdrModel* pTargetModel) const
+{
+ OReportModel* pOReportModel = static_cast< OReportModel* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
+ OSL_ENSURE(dynamic_cast< OReportModel* >(pOReportModel), "Wrong SdrModel type in OReportPage cloner (!)");
+ OReportPage* pClone = new OReportPage(
+ *pOReportModel,
+ getSection(),
+ IsMasterPage());
+ OSL_ENSURE(pClone, "CloneSdrPage error (!)");
+ pClone->copyDataFromSdrPage(*this);
+
+ return pClone;
}
//----------------------------------------------------------------------------
@@ -101,13 +125,13 @@ void OReportPage::removeSdrObject(const uno::Reference< report::XReportComponent
OSL_ENSURE(pBase,"Why is this not a OObjectBase?");
if ( pBase )
pBase->EndListening();
- /*delete */RemoveObject(nPos);
+ /*delete */RemoveObjectFromSdrObjList(nPos);
}
}
// -----------------------------------------------------------------------------
-SdrObject* OReportPage::RemoveObject(sal_uLong nObjNum)
+SdrObject* OReportPage::RemoveObjectFromSdrObjList(sal_uInt32 nObjNum)
{
- SdrObject* pObj = SdrPage::RemoveObject(nObjNum);
+ SdrObject* pObj = SdrPage::RemoveObjectFromSdrObjList(nObjNum);
if (getSpecialMode())
{
return pObj;
@@ -117,13 +141,15 @@ SdrObject* OReportPage::RemoveObject(sal_uLong nObjNum)
reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection);
uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY);
pSection->notifyElementRemoved(xShape);
- if (pObj->ISA(OUnoObject))
- {
OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObj);
+
+ if (pUnoObj)
+ {
uno::Reference< container::XChild> xChild(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
if ( xChild.is() )
xChild->setParent(NULL);
}
+
return pObj;
}
//----------------------------------------------------------------------------
@@ -178,7 +204,7 @@ void OReportPage::removeTempObject(SdrObject *_pToRemoveObj)
SdrObject *aObj = GetObj(i);
if (aObj && aObj == _pToRemoveObj)
{
- SdrObject* pObject = RemoveObject(i);
+ SdrObject* pObject = RemoveObjectFromSdrObjList(i);
(void)pObject;
break;
// delete pObject;
@@ -190,8 +216,8 @@ void OReportPage::removeTempObject(SdrObject *_pToRemoveObj)
void OReportPage::resetSpecialMode()
{
const sal_Bool bChanged = rModel.IsChanged();
- ::std::vector<SdrObject*>::iterator aIter = m_aTemporaryObjectList.begin();
- ::std::vector<SdrObject*>::iterator aEnd = m_aTemporaryObjectList.end();
+ SdrObjectVector::iterator aIter = m_aTemporaryObjectList.begin();
+ SdrObjectVector::iterator aEnd = m_aTemporaryObjectList.end();
for (; aIter != aEnd; ++aIter)
{
@@ -203,14 +229,14 @@ void OReportPage::resetSpecialMode()
m_bSpecialInsertMode = false;
}
// -----------------------------------------------------------------------------
-void OReportPage::NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInsertReason* pReason)
+void OReportPage::InsertObjectToSdrObjList(SdrObject& rObj, sal_uInt32 nPos)
{
- SdrPage::NbcInsertObject(pObj, nPos, pReason);
+ SdrPage::InsertObjectToSdrObjList(rObj, nPos);
- OUnoObject* pUnoObj = dynamic_cast< OUnoObject* >( pObj );
+ OUnoObject* pUnoObj = dynamic_cast< OUnoObject* >( &rObj );
if (getSpecialMode())
{
- m_aTemporaryObjectList.push_back(pObj);
+ m_aTemporaryObjectList.push_back(&rObj);
return;
}
@@ -224,7 +250,7 @@ void OReportPage::NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInse
// this code is evil, but what else shall I do
reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection);
- uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY);
+ uno::Reference< drawing::XShape> xShape(rObj.getUnoShape(),uno::UNO_QUERY);
pSection->notifyElementAdded(xShape);
//// check if we are a shape
@@ -237,8 +263,8 @@ void OReportPage::NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInse
// now that the shape is inserted into its structures, we can allow the OObjectBase
// to release the reference to it
- OObjectBase* pObjectBase = dynamic_cast< OObjectBase* >( pObj );
- OSL_ENSURE( pObjectBase, "OReportPage::NbcInsertObject: what is being inserted here?" );
+ OObjectBase* pObjectBase = dynamic_cast< OObjectBase* >( &rObj );
+ OSL_ENSURE( pObjectBase, "OReportPage::InsertObjectToSdrObjList: what is being inserted here?" );
if ( pObjectBase )
pObjectBase->releaseUnoShape();
}
diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx
index f2805dbe2a27..d2e94a8cb5d6 100644
--- a/reportdesign/source/core/sdr/UndoActions.cxx
+++ b/reportdesign/source/core/sdr/UndoActions.cxx
@@ -89,9 +89,7 @@ namespace rptui
}
//------------------------------------------------------------------------------
-TYPEINIT1( OCommentUndoAction, SdrUndoAction );
DBG_NAME(rpt_OCommentUndoAction)
-//----------------------------------------------------------------------------
OCommentUndoAction::OCommentUndoAction(SdrModel& _rMod,sal_uInt16 nCommentID)
:SdrUndoAction(_rMod)
{
@@ -141,13 +139,13 @@ OUndoContainerAction::~OUndoContainerAction()
Reference< XChild > xChild( m_xOwnElement, UNO_QUERY );
if ( xChild.is() && !xChild->getParent().is() )
{
- OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( mrModel ).GetUndoEnv();
rEnv.RemoveElement( m_xOwnElement );
#if OSL_DEBUG_LEVEL > 0
SvxShape* pShape = SvxShape::getImplementation( xChild );
SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
- OSL_ENSURE( pObject ? pShape->HasSdrObjectOwnership() && !pObject->IsInserted() : true ,
+ OSL_ENSURE( pObject ? pShape->HasSdrObjectOwnership() && !pObject->IsObjectInserted() : true ,
"OUndoContainerAction::~OUndoContainerAction: inconsistency in the shape/object ownership!" );
#endif
// -> dispose it
@@ -178,7 +176,7 @@ void OUndoContainerAction::implReInsert( ) SAL_THROW( ( Exception ) )
//------------------------------------------------------------------------------
void OUndoContainerAction::implReRemove( ) SAL_THROW( ( Exception ) )
{
- OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( mrModel ).GetUndoEnv();
try
{
OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -273,7 +271,7 @@ OUndoGroupSectionAction::OUndoGroupSectionAction(SdrModel& _rMod
//------------------------------------------------------------------------------
void OUndoGroupSectionAction::implReInsert( ) SAL_THROW( ( Exception ) )
{
- OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( mrModel ).GetUndoEnv();
try
{
OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -290,7 +288,7 @@ void OUndoGroupSectionAction::implReInsert( ) SAL_THROW( ( Exception ) )
//------------------------------------------------------------------------------
void OUndoGroupSectionAction::implReRemove( ) SAL_THROW( ( Exception ) )
{
- OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( mrModel ).GetUndoEnv();
try
{
OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -319,7 +317,7 @@ OUndoReportSectionAction::OUndoReportSectionAction(SdrModel& _rMod
//------------------------------------------------------------------------------
void OUndoReportSectionAction::implReInsert( ) SAL_THROW( ( Exception ) )
{
- OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( mrModel ).GetUndoEnv();
try
{
OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -342,7 +340,7 @@ void OUndoReportSectionAction::implReInsert( ) SAL_THROW( ( Exception ) )
//------------------------------------------------------------------------------
void OUndoReportSectionAction::implReRemove( ) SAL_THROW( ( Exception ) )
{
- OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( mrModel ).GetUndoEnv();
try
{
OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index 1b72640a6863..b1e9823d2193 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -192,14 +192,14 @@ void OXUndoEnvironment::Clear(const Accessor& /*_r*/)
sal_uInt16 i;
for (i = 0; i < nCount; i++)
{
- OReportPage* pPage = PTR_CAST( OReportPage, m_pImpl->m_rModel.GetPage(i) );
+ OReportPage* pPage = dynamic_cast< OReportPage* >( m_pImpl->m_rModel.GetPage(i) );
RemoveSection(pPage);
}
nCount = m_pImpl->m_rModel.GetMasterPageCount();
for (i = 0; i < nCount; i++)
{
- OReportPage* pPage = PTR_CAST( OReportPage, m_pImpl->m_rModel.GetMasterPage(i) );
+ OReportPage* pPage = dynamic_cast< OReportPage* >( m_pImpl->m_rModel.GetMasterPage(i) );
RemoveSection(pPage);
}
@@ -223,7 +223,9 @@ void OXUndoEnvironment::ModeChanged()
//------------------------------------------------------------------------------
void OXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if (rHint.ISA(SfxSimpleHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_MODECHANGED )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_MODECHANGED == pSfxSimpleHint->GetId())
ModeChanged();
}
// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx
index 9c1647a1a849..658c60a329c5 100644
--- a/reportdesign/source/filter/xml/xmlCell.cxx
+++ b/reportdesign/source/filter/xml/xmlCell.cxx
@@ -230,7 +230,7 @@ void OXMLCell::EndElement()
m_xComponent = xFixedLine.get();
m_pContainer->getSection()->add(m_xComponent.get());
m_pContainer->addCell(m_xComponent);
- XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,GetImport().GetAutoStyles()->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sStyleName));
+ XMLPropStyleContext* pAutoStyle = const_cast< XMLPropStyleContext* >(dynamic_cast< const XMLPropStyleContext* >( GetImport().GetAutoStyles()->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sStyleName)));
if ( pAutoStyle )
{
uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet();
diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx
index a911027c9df7..a71a246cd0fd 100644
--- a/reportdesign/source/filter/xml/xmlColumn.cxx
+++ b/reportdesign/source/filter/xml/xmlColumn.cxx
@@ -150,7 +150,7 @@ void OXMLRowColumn::fillStyle(const ::rtl::OUString& _sStyleName)
};
pInfo->add(pMap);
Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo);
- XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,_sStyleName));
+ XMLPropStyleContext* pAutoStyle = const_cast< XMLPropStyleContext* >(dynamic_cast< const XMLPropStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,_sStyleName)));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(xProp);
@@ -160,7 +160,7 @@ void OXMLRowColumn::fillStyle(const ::rtl::OUString& _sStyleName)
}
else
{
- pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,_sStyleName));
+ pAutoStyle = const_cast< XMLPropStyleContext* >(dynamic_cast< const XMLPropStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,_sStyleName)));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(xProp);
diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx
index 28d04155b1be..384ed33d4eef 100644
--- a/reportdesign/source/filter/xml/xmlHelper.cxx
+++ b/reportdesign/source/filter/xml/xmlHelper.cxx
@@ -273,7 +273,7 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const ::rtl::OUString& _sSty
{
if ( !_xProp.is() || !_sStyleName.getLength() || !_pAutoStyles )
return;
- XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName));
+ const XMLPropStyleContext* pAutoStyle = dynamic_cast< const XMLPropStyleContext* >( _pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName));
if ( pAutoStyle )
{
::com::sun::star::awt::FontDescriptor aFont;
@@ -306,12 +306,12 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const ::rtl::OUString& _sSty
};
try
{
- pAutoStyle->FillPropertySet(_xProp);
+ const_cast< XMLPropStyleContext* >(pAutoStyle)->FillPropertySet(_xProp);
if ( _bOld && _xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_CHARHIDDEN) )
_xProp->setPropertyValue(PROPERTY_CHARHIDDEN,uno::makeAny(sal_False));
uno::Reference<beans::XPropertySet> xProp = comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap));
- pAutoStyle->FillPropertySet(xProp);
+ const_cast< XMLPropStyleContext* >(pAutoStyle)->FillPropertySet(xProp);
xProp->getPropertyValue(PROPERTY_FONTNAME) >>= aFont.Name;
xProp->getPropertyValue(PROPERTY_CHARFONTHEIGHT) >>= aFont.Height;
xProp->getPropertyValue(PROPERTY_FONTWIDTH) >>= aFont.Width;
diff --git a/reportdesign/source/filter/xml/xmlRow.cxx b/reportdesign/source/filter/xml/xmlRow.cxx
index 243c07ec9375..4e111b823106 100644
--- a/reportdesign/source/filter/xml/xmlRow.cxx
+++ b/reportdesign/source/filter/xml/xmlRow.cxx
@@ -148,7 +148,7 @@ void OXMLRow::EndElement()
};
pInfo->add(pMap);
Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo);
- XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName));
+ XMLPropStyleContext* pAutoStyle = dynamic_cast< XMLPropStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(xProp);
@@ -158,7 +158,7 @@ void OXMLRow::EndElement()
}
else
{
- pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,m_sStyleName));
+ pAutoStyle = dynamic_cast< XMLPropStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,m_sStyleName));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(xProp);
diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx
index 4875af1ff6d4..1245ada84317 100644
--- a/reportdesign/source/filter/xml/xmlStyleImport.cxx
+++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx
@@ -79,10 +79,7 @@ public:
}
};
-TYPEINIT1( OControlStyleContext, XMLPropStyleContext );
-TYPEINIT1( OReportStylesContext, SvXMLStylesContext );
DBG_NAME( rpt_OControlStyleContext )
-
OControlStyleContext::OControlStyleContext( ORptFilter& rImport,
sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
const Reference< XAttributeList > & xAttrList,
@@ -119,10 +116,10 @@ void OControlStyleContext::FillPropertySet(const Reference< XPropertySet > & rPr
XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_False)));
if ( !pStyle )
{
- OReportStylesContext* pMyStyles = PTR_CAST(OReportStylesContext,GetOwnImport().GetAutoStyles());
+ OReportStylesContext* pMyStyles = dynamic_cast< OReportStylesContext* >( GetOwnImport().GetAutoStyles());
if ( pMyStyles )
- pStyle = PTR_CAST(SvXMLNumFormatContext,pMyStyles->
- FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True));
+ pStyle = const_cast< SvXMLNumFormatContext*>(dynamic_cast< const SvXMLNumFormatContext* >( pMyStyles->
+ FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True)));
else {
DBG_ERROR("not possible to get style");
}
diff --git a/reportdesign/source/filter/xml/xmlStyleImport.hxx b/reportdesign/source/filter/xml/xmlStyleImport.hxx
index 53278de70883..bce5a2584b53 100644
--- a/reportdesign/source/filter/xml/xmlStyleImport.hxx
+++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx
@@ -68,9 +68,6 @@ namespace rptxml
const ::rtl::OUString& rValue );
public:
-
- TYPEINFO();
-
OControlStyleContext( ORptFilter& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
@@ -135,9 +132,6 @@ namespace rptxml
::com::sun::star::xml::sax::XAttributeList > & xAttrList );
public:
-
- TYPEINFO();
-
OReportStylesContext( ORptFilter& rImport, sal_uInt16 nPrfx ,
const ::rtl::OUString& rLName ,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
index 03328462dbfd..a420419cf3f2 100644
--- a/reportdesign/source/filter/xml/xmlTable.cxx
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -185,7 +185,7 @@ void OXMLTable::EndElement()
const SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles();
if ( pAutoStyles )
{
- XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName));
+ XMLPropStyleContext* pAutoStyle = const_cast< XMLPropStyleContext* >(dynamic_cast< const XMLPropStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName)));
if ( pAutoStyle )
{
pAutoStyle->FillPropertySet(m_xSection.get());
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 7ecb8f2bf49d..3ed2a108542b 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -91,9 +91,6 @@ class RptMLMasterStylesContext_Impl : public XMLTextMasterStylesContext
RptMLMasterStylesContext_Impl(const RptMLMasterStylesContext_Impl&);
void operator =(const RptMLMasterStylesContext_Impl&);
public:
-
- TYPEINFO();
-
RptMLMasterStylesContext_Impl(
ORptFilter& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName ,
@@ -102,7 +99,6 @@ public:
virtual void EndElement();
};
-TYPEINIT1( RptMLMasterStylesContext_Impl, XMLTextMasterStylesContext );
DBG_NAME(rpt_RptMLMasterStylesContext_Impl)
RptMLMasterStylesContext_Impl::RptMLMasterStylesContext_Impl(
ORptFilter& rImport, sal_uInt16 nPrfx,
@@ -689,10 +685,10 @@ SvXMLImportContext* ORptFilter::CreateContext( sal_uInt16 nPrefix,
const SvXMLStylesContext* pAutoStyles = GetAutoStyles();
if ( pAutoStyles )
{
- XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_PAGE_MASTER,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pm1"))));
+ const XMLPropStyleContext* pAutoStyle = dynamic_cast< const XMLPropStyleContext* >( pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_PAGE_MASTER,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pm1"))));
if ( pAutoStyle )
{
- pAutoStyle->FillPropertySet(getReportDefinition().get());
+ const_cast< XMLPropStyleContext* >(pAutoStyle)->FillPropertySet(getReportDefinition().get());
}
}
pContext = new OXMLReport( *this, nPrefix, rLocalName,xAttrList,getReportDefinition(),NULL );
@@ -1061,7 +1057,7 @@ void SAL_CALL ORptFilter::startDocument( void )
OSL_ENSURE(m_xReportDefinition.is(),"ReportDefinition is NULL!");
if ( m_xReportDefinition.is() )
{
- m_pReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition);
+ m_pReportModel = reportdesign::OReportDefinition::getSharedSdrModel(m_xReportDefinition);
OSL_ENSURE(m_pReportModel,"Report model is NULL!");
SvXMLImport::startDocument();
diff --git a/reportdesign/source/filter/xml/xmlfilter.hxx b/reportdesign/source/filter/xml/xmlfilter.hxx
index 1cdf0e911215..64a60431b602 100644
--- a/reportdesign/source/filter/xml/xmlfilter.hxx
+++ b/reportdesign/source/filter/xml/xmlfilter.hxx
@@ -142,7 +142,7 @@ public:
*
* \return
*/
- ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const { return m_pReportModel; }
+ ::boost::shared_ptr<rptui::OReportModel> getSharedSdrModel() const { return m_pReportModel; }
void FinishStyles();
virtual void SAL_CALL startDocument(void)
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index 5d20dff52aa7..e7005807f93b 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -451,7 +451,7 @@ namespace rptui
*
* \return
*/
- ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const;
+ ::boost::shared_ptr<rptui::OReportModel> getSharedSdrModel() const;
inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; }
inline sal_Int16 getZoomValue() const { return m_nZoomValue; }
diff --git a/reportdesign/source/ui/inc/RptUndo.hxx b/reportdesign/source/ui/inc/RptUndo.hxx
index 9a248d3ecea4..a0ab12b9282e 100644
--- a/reportdesign/source/ui/inc/RptUndo.hxx
+++ b/reportdesign/source/ui/inc/RptUndo.hxx
@@ -59,7 +59,6 @@ namespace rptui
void collectControls(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
public:
- TYPEINFO();
OSectionUndo( OReportModel& rMod
,sal_uInt16 _nSlot
,Action _eAction
@@ -83,7 +82,6 @@ namespace rptui
OReportSectionUndo(const OReportSectionUndo&);
void operator =(const OReportSectionUndo&);
public:
- TYPEINFO();
//OReportSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
OReportSectionUndo( OReportModel& rMod
,sal_uInt16 _nSlot
@@ -110,7 +108,6 @@ namespace rptui
OGroupSectionUndo(const OGroupSectionUndo&);
void operator =(const OGroupSectionUndo&);
public:
- TYPEINFO();
//OGroupSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
OGroupSectionUndo( OReportModel& rMod
,sal_uInt16 _nSlot
@@ -136,7 +133,6 @@ namespace rptui
void implReInsert( );
void implReRemove( );
public:
- TYPEINFO();
OGroupUndo(OReportModel& rMod
,sal_uInt16 nCommentID
,Action _eAction
diff --git a/reportdesign/source/ui/inc/SectionView.hxx b/reportdesign/source/ui/inc/SectionView.hxx
index 15c03bfca5b6..c3dcb5dd69b1 100644
--- a/reportdesign/source/ui/inc/SectionView.hxx
+++ b/reportdesign/source/ui/inc/SectionView.hxx
@@ -45,14 +45,12 @@ private:
OSectionView(const OSectionView&);
void operator =(const OSectionView&);
public:
- TYPEINFO();
-
- OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor );
+ OSectionView( SdrModel& rModel, OReportSection* _pSectionWindow, OReportWindow* pEditor );
virtual ~OSectionView();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- virtual void MarkListHasChanged();
- virtual void MakeVisible( const Rectangle& rRect, Window& rWin );
+ virtual void handleSelectionChange();
+ virtual void MakeVisibleAtView( const basegfx::B2DRange& rRange, Window& rWin );
inline OReportSection* getReportSection() const { return m_pSectionWindow; }
diff --git a/reportdesign/source/ui/inc/UITools.hxx b/reportdesign/source/ui/inc/UITools.hxx
index e31f80a0a7ac..1609733e740d 100644
--- a/reportdesign/source/ui/inc/UITools.hxx
+++ b/reportdesign/source/ui/inc/UITools.hxx
@@ -141,9 +141,9 @@ namespace rptui
* \param _bAllObjects if <TRUE/> all objects are taken into account, otherwise only not marked ones
* \return the object which is overlapped, otherwise <NULL/>
*/
- SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects = false,SdrObject* _pIgnore = NULL, sal_Int16 _nIgnoreType=0);
+ SdrObject* isOver(const basegfx::B2DRange& _rRange,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects = false,SdrObject* _pIgnore = NULL, sal_Int16 _nIgnoreType=0);
- SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects, SdrUnoObj* _pIgnoreList[], int _nIgnoreListLength);
+ SdrObject* isOver(const basegfx::B2DRange& _rRange,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects, SdrUnoObj* _pIgnoreList[], int _nIgnoreListLength);
/** checks whether the given OUnoObject object rectangle overlapps another object in that view.
*
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
index 50e0c0aad729..003558414108 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -295,20 +295,19 @@ namespace rptui
*
*/
void BrkAction();
- void BegMarkObj(const Point& _aPnt,const OSectionView* _pSection);
+ void BegMarkObj(const basegfx::B2DPoint& _aPnt,const OSectionView* _pSection);
private:
- void BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _aRect, const OSectionView& _rSection);
+ void BegDragObj_createInvisibleObjectAtPosition(const basegfx::B2DRange& _aRange, const OSectionView& _rSection);
void EndDragObj_removeInvisibleObjects();
- Point m_aDragDelta;
- ::std::vector<SdrObject*> m_aBegDragTempList;
+ basegfx::B2DPoint m_aDragDelta;
+ SdrObjectVector m_aBegDragTempList;
bool isObjectInMyTempList(SdrObject *);
public:
- void BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection);
- void EndDragObj(sal_Bool _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt);
+ void BegDragObj(const basegfx::B2DPoint& _aPnt, const SdrHdl* _pHdl,const OSectionView* _pSection);
+ void EndDragObj(sal_Bool _bDragIntoNewSection,const OSectionView* _pSection,const basegfx::B2DPoint& _aPnt);
void EndAction();
- void ForceMarkedToAnotherPage();
sal_Bool IsAction() const;
sal_Bool IsDragObj() const;
void handleKey(const KeyCode& _rCode);
@@ -320,9 +319,9 @@ namespace rptui
* \param _rPnt the point, it will be changed that it is inside the section which will be returned
* \return the section
*/
- OSectionView* getSectionRelativeToPosition(const OSectionView* _pSection,Point& _rPnt);
+ OSectionView* getSectionRelativeToPosition(const OSectionView* _pSection,basegfx::B2DPoint& _rPnt);
- void MovAction(const Point& rPnt,const OSectionView* _pSection,bool _bMove /*= true */, bool _bControlKeySet);
+ void MovAction(const basegfx::B2DPoint& rPnt,const OSectionView* _pSection,bool _bMove /*= true */, bool _bControlKeySet);
// void MovAction2(const Point& rPnt,const OSectionView* _pSection);
sal_uInt32 getMarkedObjectCount() const;
diff --git a/reportdesign/source/ui/inc/dlgedfac.hxx b/reportdesign/source/ui/inc/dlgedfac.hxx
index 5a7b181e0504..5a89eda653b1 100644
--- a/reportdesign/source/ui/inc/dlgedfac.hxx
+++ b/reportdesign/source/ui/inc/dlgedfac.hxx
@@ -19,14 +19,13 @@
*
*************************************************************/
-
-
#ifndef _REPORT_RPTUIFAC_HXX
#define _REPORT_RPTUIFAC_HXX
-
#include <svx/svdobj.hxx>
+class SdrObjFactory;
+
namespace rptui
{
class OReportSection;
diff --git a/reportdesign/source/ui/inc/dlgedfunc.hxx b/reportdesign/source/ui/inc/dlgedfunc.hxx
index 28a931011e6e..14fc49c4e84b 100644
--- a/reportdesign/source/ui/inc/dlgedfunc.hxx
+++ b/reportdesign/source/ui/inc/dlgedfunc.hxx
@@ -48,7 +48,7 @@ protected:
OReportSection* m_pParent;
OSectionView& m_rView;
Timer aScrollTimer;
- Point m_aMDPos;
+ basegfx::B2DPoint m_aMDPos;
com::sun::star::uno::Reference<com::sun::star::uno::XInterface> m_xOverlappingObj;
SdrObject * m_pOverlappingObj;
sal_Int32 m_nOverlappedControlColor;
@@ -58,7 +58,7 @@ protected:
bool m_bShowPropertyBrowser;
DECL_LINK( ScrollTimeout, Timer * );
- void ForceScroll( const Point& rPos );
+ void ForceScroll( const basegfx::B2DPoint& rPos );
/** checks that no other object is overlapped.
*
* \param rMEvt
@@ -81,7 +81,7 @@ protected:
/** activate object if it is of type OBJ_OLE2
*/
- void activateOle(SdrObject* _pObj);
+ void activateOle(SdrObject& _rObj);
void checkTwoCklicks(const MouseEvent& rMEvt);
diff --git a/reportdesign/source/ui/inc/propbrw.hxx b/reportdesign/source/ui/inc/propbrw.hxx
index f6783b96079b..7de458f91f14 100644
--- a/reportdesign/source/ui/inc/propbrw.hxx
+++ b/reportdesign/source/ui/inc/propbrw.hxx
@@ -33,7 +33,7 @@
#include <svl/brdcst.hxx>
#include <svl/lstner.hxx>
#include <vcl/dockwin.hxx>
-#include <svx/svdmark.hxx>
+#include <svx/svdobj.hxx>
#include "ModuleHelper.hxx"
namespace rptui
@@ -75,7 +75,7 @@ protected:
virtual sal_Bool Close();
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >
- CreateCompPropSet(const SdrMarkList& rMarkList);
+ CreateCompPropSet(const SdrObjectVector& rSelection);
void implSetNewObject(
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >& _aObjects = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >());
diff --git a/reportdesign/source/ui/misc/ColorListener.cxx b/reportdesign/source/ui/misc/ColorListener.cxx
index a1c432c729e2..39237f9b4fd9 100644
--- a/reportdesign/source/ui/misc/ColorListener.cxx
+++ b/reportdesign/source/ui/misc/ColorListener.cxx
@@ -54,9 +54,9 @@ OColorListener::~OColorListener()
// -----------------------------------------------------------------------
void OColorListener::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint)
{
- if (rHint.ISA(SfxSimpleHint)
- && (static_cast< SfxSimpleHint const & >(rHint).GetId()
- == SFX_HINT_COLORS_CHANGED))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint && SFX_HINT_COLORS_CHANGED == pSfxSimpleHint->GetId() )
{
m_nColor = m_aExtendedColorConfig.GetColorValue(CFG_REPORTDESIGNER,m_sColorEntry).getColor();
m_nTextBoundaries = m_aColorConfig.GetColorValue(::svtools::DOCBOUNDARIES).nColor;
diff --git a/reportdesign/source/ui/misc/RptUndo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx
index 04b7eb5bf26e..5b9e9dff3c0b 100644
--- a/reportdesign/source/ui/misc/RptUndo.cxx
+++ b/reportdesign/source/ui/misc/RptUndo.cxx
@@ -114,9 +114,7 @@ namespace
}
}
//----------------------------------------------------------------------------
-TYPEINIT1( OSectionUndo, OCommentUndoAction );
DBG_NAME(rpt_OSectionUndo)
-//----------------------------------------------------------------------------
OSectionUndo::OSectionUndo(OReportModel& _rMod
,sal_uInt16 _nSlot
,Action _eAction
@@ -133,7 +131,7 @@ OSectionUndo::~OSectionUndo()
{
if ( !m_bInserted )
{
- OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( mrModel ).GetUndoEnv();
::std::vector< uno::Reference< drawing::XShape> >::iterator aEnd = m_aControls.end();
for (::std::vector< uno::Reference< drawing::XShape> >::iterator aIter = m_aControls.begin(); aIter != aEnd; ++aIter)
{
@@ -143,7 +141,7 @@ OSectionUndo::~OSectionUndo()
#if OSL_DEBUG_LEVEL > 0
SvxShape* pShape = SvxShape::getImplementation( xShape );
SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
- OSL_ENSURE( pShape && pShape->HasSdrObjectOwnership() && pObject && !pObject->IsInserted(),
+ OSL_ENSURE( pShape && pShape->HasSdrObjectOwnership() && pObject && !pObject->IsObjectInserted(),
"OSectionUndo::~OSectionUndo: inconsistency in the shape/object ownership!" );
#endif
try
@@ -223,8 +221,6 @@ void OSectionUndo::Redo()
}
}
//----------------------------------------------------------------------------
-TYPEINIT1( OReportSectionUndo, OSectionUndo );
-//----------------------------------------------------------------------------
OReportSectionUndo::OReportSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot
,::std::mem_fun_t< uno::Reference< report::XSection >
,OReportHelper> _pMemberFunction
@@ -262,8 +258,6 @@ void OReportSectionUndo::implReRemove( )
m_bInserted = false;
}
//----------------------------------------------------------------------------
-TYPEINIT1( OGroupSectionUndo, OSectionUndo );
-//----------------------------------------------------------------------------
OGroupSectionUndo::OGroupSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot
,::std::mem_fun_t< uno::Reference< report::XSection >
,OGroupHelper> _pMemberFunction
@@ -332,8 +326,6 @@ void OGroupSectionUndo::implReRemove( )
m_bInserted = false;
}
//----------------------------------------------------------------------------
-TYPEINIT1( OGroupUndo, OCommentUndoAction );
-//----------------------------------------------------------------------------
OGroupUndo::OGroupUndo(OReportModel& _rMod
,sal_uInt16 nCommentID
,Action _eAction
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 13006a87dd39..32161ebd8c19 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -78,6 +78,8 @@
#include <svx/svdpage.hxx>
#include <svx/svxdlg.hxx>
#include <svx/unoprov.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/globaldrawitempool.hxx>
#include <unotools/pathoptions.hxx>
#include <svtools/ctrltool.hxx>
@@ -267,7 +269,7 @@ namespace
{
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
- const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
+ const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, GetGlobalDrawObjectItemPool())->getPropertyMap();
PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
while( aIt != aPropVector.end() )
@@ -290,7 +292,7 @@ namespace
{
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
- const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
+ const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, GetGlobalDrawObjectItemPool())->getPropertyMap();
PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
while( aIt != aPropVector.end() )
@@ -383,7 +385,7 @@ namespace
{
Font aNewFont( _rOriginalFont );
const SfxPoolItem* pItem( NULL );
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nFont,sal_True,&pItem) && pItem->ISA(SvxFontItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nFont,sal_True,&pItem) && dynamic_cast< const SvxFontItem* >(pItem))
{
const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(pItem);
aNewFont.SetName( pFontItem->GetFamilyName());
@@ -391,49 +393,49 @@ namespace
aNewFont.SetFamily(pFontItem->GetFamily());
aNewFont.SetPitch(pFontItem->GetPitch());
aNewFont.SetCharSet(pFontItem->GetCharSet());
- } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_FONT,sal_True,&pItem) && pItem->ISA(SvxFontItem))
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nFontHeight,sal_True,&pItem) && pItem->ISA(SvxFontHeightItem))
+ } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_FONT,sal_True,&pItem) && dynamic_cast< const SvxFontItem* >(pItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nFontHeight,sal_True,&pItem) && dynamic_cast< const SvxFontHeightItem* >(pItem))
{
const SvxFontHeightItem* pFontItem = static_cast<const SvxFontHeightItem*>(pItem);
aNewFont.SetHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MAP_TWIP, MAP_POINT).Height());
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nPosture,sal_True,&pItem) && pItem->ISA(SvxPostureItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nPosture,sal_True,&pItem) && dynamic_cast< const SvxPostureItem* >(pItem))
{
const SvxPostureItem* pFontItem = static_cast<const SvxPostureItem*>(pItem);
aNewFont.SetItalic(pFontItem->GetPosture());
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nWeight,sal_True,&pItem) && pItem->ISA(SvxWeightItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nWeight,sal_True,&pItem) && dynamic_cast< const SvxWeightItem* >(pItem))
{
const SvxWeightItem* pFontItem = static_cast<const SvxWeightItem*>(pItem);
aNewFont.SetWeight(pFontItem->GetWeight());
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_WORDLINEMODE,sal_True,&pItem) && pItem->ISA(SvxWordLineModeItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_WORDLINEMODE,sal_True,&pItem) && dynamic_cast< const SvxWordLineModeItem* >(pItem))
{
const SvxWordLineModeItem* pFontItem = static_cast<const SvxWordLineModeItem*>(pItem);
aNewFont.SetWordLineMode(pFontItem->GetValue());
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CROSSEDOUT,sal_True,&pItem) && pItem->ISA(SvxCrossedOutItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CROSSEDOUT,sal_True,&pItem) && dynamic_cast< const SvxCrossedOutItem* >(pItem))
{
const SvxCrossedOutItem* pFontItem = static_cast<const SvxCrossedOutItem*>(pItem);
aNewFont.SetStrikeout(pFontItem->GetStrikeout());
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARROTATE,sal_True,&pItem) && pItem->ISA(SvxCharRotateItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARROTATE,sal_True,&pItem) && dynamic_cast< const SvxCharRotateItem* >(pItem))
{
const SvxCharRotateItem* pRotateItem = static_cast<const SvxCharRotateItem*>(pItem);
aNewFont.SetOrientation(pRotateItem->GetValue());
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARSCALE_W,sal_True,&pItem) && pItem->ISA(SvxCharScaleWidthItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARSCALE_W,sal_True,&pItem) && dynamic_cast< const SvxCharScaleWidthItem* >(pItem))
{
const SvxCharScaleWidthItem* pCharItem = static_cast<const SvxCharScaleWidthItem*>(pItem);
aNewFont.SetWidthType(VCLUnoHelper::ConvertFontWidth(pCharItem->GetValue()));
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_UNDERLINE,sal_True,&pItem) && pItem->ISA(SvxUnderlineItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_UNDERLINE,sal_True,&pItem) && dynamic_cast< const SvxUnderlineItem* >(pItem))
{
const SvxUnderlineItem* pFontItem = static_cast<const SvxUnderlineItem*>(pItem);
aNewFont.SetUnderline(pFontItem->GetLineStyle());
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_COLOR,sal_True,&pItem) && pItem->ISA(SvxColorItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_COLOR,sal_True,&pItem) && dynamic_cast< const SvxColorItem* >(pItem))
{
const SvxColorItem* pFontItem = static_cast<const SvxColorItem*>(pItem);
aNewFont.SetColor(pFontItem->GetValue().GetColor());
@@ -457,87 +459,87 @@ namespace
lcl_pushBack( _out_rProperties, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FontComplex")), uno::makeAny( aAwtFont ) );
// properties which cannot be represented in an AWT font need to be preserved directly
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_SHADOWED,sal_True,&pItem) && pItem->ISA(SvxShadowedItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_SHADOWED,sal_True,&pItem) && dynamic_cast< const SvxShadowedItem* >(pItem))
{
const SvxShadowedItem* pFontItem = static_cast<const SvxShadowedItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARSHADOWED, uno::makeAny( pFontItem->GetValue() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CONTOUR,sal_True,&pItem) && pItem->ISA(SvxContourItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CONTOUR,sal_True,&pItem) && dynamic_cast< const SvxContourItem* >(pItem))
{
const SvxContourItem* pFontItem = static_cast<const SvxContourItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARCONTOURED, uno::makeAny( pFontItem->GetValue() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_UNDERLINE,sal_True,&pItem) && pItem->ISA(SvxUnderlineItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_UNDERLINE,sal_True,&pItem) && dynamic_cast< const SvxUnderlineItem* >(pItem))
{
const SvxUnderlineItem* pFontItem = static_cast<const SvxUnderlineItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARUNDERLINECOLOR, uno::makeAny( pFontItem->GetColor().GetColor() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_HORJUSTIFY,sal_True,&pItem) && pItem->ISA(SvxHorJustifyItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_HORJUSTIFY,sal_True,&pItem) && dynamic_cast< const SvxHorJustifyItem* >(pItem))
{
const SvxHorJustifyItem* pJustifyItem = static_cast<const SvxHorJustifyItem*>(pItem);
uno::Any aValue;
pJustifyItem->QueryValue(aValue,MID_HORJUST_ADJUST);
lcl_pushBack( _out_rProperties, PROPERTY_PARAADJUST, aValue );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_VERJUSTIFY,sal_True,&pItem) && pItem->ISA(SvxVerJustifyItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_VERJUSTIFY,sal_True,&pItem) && dynamic_cast< const SvxVerJustifyItem* >(pItem))
{
const SvxVerJustifyItem* pJustifyItem = static_cast<const SvxVerJustifyItem*>(pItem);
uno::Any aValue;
pJustifyItem->QueryValue(aValue,MID_HORJUST_ADJUST);
lcl_pushBack( _out_rProperties, PROPERTY_VERTICALALIGN, aValue );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARRELIEF,sal_True,&pItem) && pItem->ISA(SvxCharReliefItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARRELIEF,sal_True,&pItem) && dynamic_cast< const SvxCharReliefItem* >(pItem))
{
const SvxCharReliefItem* pFontItem = static_cast<const SvxCharReliefItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARRELIEF, uno::makeAny( static_cast< sal_Int16 >( pFontItem->GetEnumValue() ) ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARHIDDEN,sal_True,&pItem) && pItem->ISA(SvxCharHiddenItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARHIDDEN,sal_True,&pItem) && dynamic_cast< const SvxCharHiddenItem* >(pItem))
{
const SvxCharHiddenItem* pFontItem = static_cast<const SvxCharHiddenItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARHIDDEN, uno::makeAny( pFontItem->GetValue() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_AUTOKERN,sal_True,&pItem) && pItem->ISA(SvxAutoKernItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_AUTOKERN,sal_True,&pItem) && dynamic_cast< const SvxAutoKernItem* >(pItem))
{
const SvxAutoKernItem* pFontItem = static_cast<const SvxAutoKernItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARAUTOKERNING, uno::makeAny( pFontItem->GetValue() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_BRUSH,sal_True,&pItem) && pItem->ISA(SvxBrushItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_BRUSH,sal_True,&pItem) && dynamic_cast< const SvxBrushItem* >(pItem))
{
const SvxBrushItem* pFontItem = static_cast<const SvxBrushItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CONTROLBACKGROUND, uno::makeAny( pFontItem->GetColor().GetColor() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_BLINK,sal_True,&pItem) && pItem->ISA(SvxBlinkItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_BLINK,sal_True,&pItem) && dynamic_cast< const SvxBlinkItem* >(pItem))
{
const SvxBlinkItem* pFontItem = static_cast<const SvxBlinkItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARFLASH, uno::makeAny( pFontItem->GetValue() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_EMPHASISMARK,sal_True,&pItem) && pItem->ISA(SvxEmphasisMarkItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_EMPHASISMARK,sal_True,&pItem) && dynamic_cast< const SvxEmphasisMarkItem* >(pItem))
{
const SvxEmphasisMarkItem* pFontItem = static_cast<const SvxEmphasisMarkItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHAREMPHASIS, uno::makeAny( static_cast< sal_Int16 >( pFontItem->GetEmphasisMark() ) ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_TWOLINES,sal_True,&pItem) && pItem->ISA(SvxTwoLinesItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_TWOLINES,sal_True,&pItem) && dynamic_cast< const SvxTwoLinesItem* >(pItem))
{
const SvxTwoLinesItem* pFontItem = static_cast<const SvxTwoLinesItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARCOMBINEISON, uno::makeAny( pFontItem->GetValue() ) );
lcl_pushBack( _out_rProperties, PROPERTY_CHARCOMBINEPREFIX, uno::makeAny( ::rtl::OUString( pFontItem->GetStartBracket() ) ) );
lcl_pushBack( _out_rProperties, PROPERTY_CHARCOMBINESUFFIX, uno::makeAny( ::rtl::OUString( pFontItem->GetEndBracket() ) ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_COLOR,sal_True,&pItem) && pItem->ISA(SvxColorItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_COLOR,sal_True,&pItem) && dynamic_cast< const SvxColorItem*>(pItem))
{
const SvxColorItem* pFontItem = static_cast<const SvxColorItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARCOLOR, uno::makeAny( pFontItem->GetValue().GetColor() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_KERNING,sal_True,&pItem) && pItem->ISA(SvxKerningItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_KERNING,sal_True,&pItem) && dynamic_cast< const SvxKerningItem* >(pItem))
{
const SvxKerningItem* pFontItem = static_cast<const SvxKerningItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARKERNING, uno::makeAny( pFontItem->GetValue() ) );
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && pItem->ISA(SvxCaseMapItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && dynamic_cast< const SvxCaseMapItem* >(pItem))
{
const SvxCaseMapItem* pFontItem = static_cast<const SvxCaseMapItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARCASEMAP, uno::makeAny( pFontItem->GetValue() ) );
- } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && pItem->ISA(SvxCaseMapItem))
+ } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && dynamic_cast< SvxCaseMapItem* >(pItem))
struct Items {
sal_uInt16 nWhich;
::rtl::OUString sPropertyName;
@@ -548,15 +550,15 @@ namespace
};
for(size_t k = 0; k < sizeof(pItems)/sizeof(pItems[0]);++k)
{
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( pItems[k].nWhich,sal_True,&pItem) && pItem->ISA(SvxLanguageItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( pItems[k].nWhich,sal_True,&pItem) && dynamic_cast< const SvxLanguageItem* >(pItem))
{
const SvxLanguageItem* pFontItem = static_cast<const SvxLanguageItem*>(pItem);
lang::Locale aCharLocale;
MsLangId::convertLanguageToLocale( pFontItem->GetLanguage(), aCharLocale );
lcl_pushBack( _out_rProperties, pItems[k].sPropertyName, uno::makeAny( aCharLocale ) );
- } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_LANGUAGE,sal_True,&pItem) && pItem->ISA(SvxLanguageItem))
+ } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_LANGUAGE,sal_True,&pItem) && dynamic_cast< SvxLanguageItem* >(pItem))
}
- if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_ESCAPEMENT,sal_True,&pItem) && pItem->ISA(SvxEscapementItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_ESCAPEMENT,sal_True,&pItem) && dynamic_cast< const SvxEscapementItem* >(pItem))
{
const SvxEscapementItem* pFontItem = static_cast<const SvxEscapementItem*>(pItem);
lcl_pushBack( _out_rProperties, PROPERTY_CHARESCAPEMENT, uno::makeAny( pFontItem->GetEsc() ) );
@@ -750,7 +752,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R
if ( !_xShape.is() || !_rxParentWindow.is() )
return false;
- ::boost::shared_ptr<rptui::OReportModel> pModel = ::reportdesign::OReportDefinition::getSdrModel(_xShape->getSection()->getReportDefinition());
+ ::boost::shared_ptr<rptui::OReportModel> pModel = ::reportdesign::OReportDefinition::getSharedSdrModel(_xShape->getSection()->getReportDefinition());
Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow );
@@ -862,7 +864,7 @@ void notifySystemWindow(Window* _pWindow,Window* _pToRegister, ::comphelper::mem
}
}
// -----------------------------------------------------------------------------
-SdrObject* isOver(const Rectangle& _rRect, SdrPage& _rPage, SdrView& _rView, bool _bAllObjects, SdrObject* _pIgnore, sal_Int16 _nIgnoreType)
+SdrObject* isOver(const basegfx::B2DRange& _rRange, SdrPage& _rPage, SdrView& _rView, bool _bAllObjects, SdrObject* _pIgnore, sal_Int16 _nIgnoreType)
{
SdrObject* pOverlappedObj = NULL;
SdrObjListIter aIter(_rPage,IM_DEEPNOGROUPS);
@@ -871,7 +873,6 @@ SdrObject* isOver(const Rectangle& _rRect, SdrPage& _rPage, SdrView& _rView, boo
while( !pOverlappedObj && (pObjIter = aIter.Next()) != NULL )
{
if ( _pIgnore != pObjIter
- && (_bAllObjects || !_rView.IsObjMarked(pObjIter))
&& (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL))
{
if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == OBJ_CUSTOMSHAPE)
@@ -881,12 +882,18 @@ SdrObject* isOver(const Rectangle& _rRect, SdrPage& _rPage, SdrView& _rView, boo
if (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL)
{
- Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect());
- if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
+ basegfx::B2DRange aRange(_rRange);
+ aRange.intersect(pObjIter->getObjectRange(&_rView));
+
+ if(!aRange.isEmpty()
+ && !basegfx::fTools::equalZero(aRange.getWidth())
+ && !basegfx::fTools::equalZero(aRange.getHeight()))
+ {
pOverlappedObj = pObjIter;
}
}
}
+ }
return pOverlappedObj;
}
// -----------------------------------------------------------------------------
@@ -903,7 +910,7 @@ bool checkArrayForOccurance(SdrObject* _pObjToCheck, SdrUnoObj* _pIgnore[], int
return false;
}
-SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects, SdrUnoObj * _pIgnoreList[], int _nIgnoreListLength)
+SdrObject* isOver(const basegfx::B2DRange& _rRange,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects, SdrUnoObj * _pIgnoreList[], int _nIgnoreListLength)
{
SdrObject* pOverlappedObj = NULL;
SdrObjListIter aIter(_rPage,IM_DEEPNOGROUPS);
@@ -916,11 +923,10 @@ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _
continue;
}
- if ( (_bAllObjects || !_rView.IsObjMarked(pObjIter))
+ if ( (_bAllObjects || !_rView.IsObjMarked(*pObjIter))
&& (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL) )
{
- Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect());
- if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
+ if(pObjIter->getObjectRange(&_rView).overlaps(_rRange))
pOverlappedObj = pObjIter;
}
}
@@ -933,8 +939,7 @@ SdrObject* isOver(SdrObject* _pObj,SdrPage& _rPage,SdrView& _rView,bool _bUnMark
SdrObject* pOverlappedObj = NULL;
if (dynamic_cast<OUnoObject*>(_pObj) != NULL || dynamic_cast<OOle2Obj*>(_pObj) != NULL) // this doesn't need to be done for shapes
{
- Rectangle aRect = _pObj->GetCurrentBoundRect();
- pOverlappedObj = isOver(aRect,_rPage,_rView,_bUnMarkedObjects,_pObj);
+ pOverlappedObj = isOver(_pObj->getObjectRange(&_rView),_rPage,_rView,_bUnMarkedObjects,_pObj);
}
return pOverlappedObj;
}
@@ -995,22 +1000,24 @@ void correctOverlapping(SdrObject* _pControl,OReportSection& _aReportSection,boo
// Rectangle aRet(VCLPoint(xComponent->getPosition()),VCLSize(xComponent->getSize()));
// aRet.setHeight(aRet.getHeight() + 1);
// aRet.setWidth(aRet.getWidth() + 1);
- Rectangle aRect = getRectangleFromControl(_pControl);
+ const Rectangle aRect(getRectangleFromControl(_pControl));
+ const basegfx::B2DRange aControlRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
bool bOverlapping = true;
while ( bOverlapping )
{
- SdrObject* pOverlappedObj = isOver(aRect,*_aReportSection.getPage(),rSectionView,true, _pControl);
+ SdrObject* pOverlappedObj = isOver(aControlRange,*_aReportSection.getPage(),rSectionView,true, _pControl);
bOverlapping = pOverlappedObj != NULL;
if ( bOverlapping )
{
- const Rectangle& aLogicRect = pOverlappedObj->GetLogicRect();
- aRect.Move(0,aLogicRect.Top() + aLogicRect.getHeight() - aRect.Top());
- xComponent->setPositionY(aRect.Top());
+ const basegfx::B2DRange& rOverlapRange(pOverlappedObj->getObjectRange(&rSectionView));
+ const double fNewY(rOverlapRange.getMaxY() - aControlRange.getMinY());
+
+ xComponent->setPositionY(basegfx::fround(fNewY));
}
}
if ( !bOverlapping && _bInsert ) // now insert objects
- rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(),SDRINSERT_ADDMARK);
+ rSectionView.InsertObjectAtView(*_pControl,SDRINSERT_ADDMARK);
}
// -----------------------------------------------------------------------------
void setZoomFactor(const Fraction& _aZoom,Window& _rWindow)
diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx
index b8fc4b80d7bb..1b169c8690c0 100644
--- a/reportdesign/source/ui/report/FixedTextColor.cxx
+++ b/reportdesign/source/ui/report/FixedTextColor.cxx
@@ -236,7 +236,7 @@ namespace rptui
uno::Reference<awt::XControl> xControl;
OReportController *pController = (OReportController *)&m_rReportController;
- ::boost::shared_ptr<OReportModel> pModel = pController->getSdrModel();
+ ::boost::shared_ptr<OReportModel> pModel = pController->getSharedSdrModel();
uno::Reference<report::XSection> xSection(_xFixedText->getSection());
if ( xSection.is() )
diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
index 2f84f84c9890..a3a04bb6b469 100644
--- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
+++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
@@ -169,7 +169,7 @@ namespace rptui
{
uno::Reference<awt::XVclWindowPeer> xVclWindowPeer;
- ::boost::shared_ptr<OReportModel> pModel = const_cast< OReportController& >( m_rReportController ).getSdrModel();
+ ::boost::shared_ptr<OReportModel> pModel = const_cast< OReportController& >( m_rReportController ).getSharedSdrModel();
uno::Reference<report::XSection> xSection(_xComponent->getSection());
if ( xSection.is() )
@@ -182,7 +182,6 @@ namespace rptui
OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObject);
if ( pUnoObj ) // this doesn't need to be done for shapes
{
- // Rectangle aRect = pUnoObj->GetCurrentBoundRect();
::boost::shared_ptr<OSectionWindow> pSectionWindow = m_rReportController.getSectionWindow(xSection);
if (pSectionWindow != NULL)
{
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index da09142f341a..059659716bc1 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -120,6 +120,7 @@
#include <svx/svxdlg.hxx>
#include <svx/zoom_def.hxx>
#include <svx/dialogs.hrc>
+#include <svx/svdlegacy.hxx>
#include "DesignView.hxx"
#include "ModuleHelper.hxx"
@@ -489,7 +490,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
if ( aReturn.bEnabled )
{
OSectionView* pSectionView = getCurrentSectionView();
- aReturn.bEnabled = pSectionView && pSectionView->GetMarkedObjectCount() > 2;
+ aReturn.bEnabled = pSectionView && pSectionView->getSelectedSdrObjectCount() > 2;
}
break;
case SID_ARRANGEMENU:
@@ -1685,7 +1686,8 @@ void OReportController::impl_initialize( )
//m_sName = m_xReportDefinition->getName();
getView()->initialize(); // show the windows and fill with our informations
- m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition);
+ m_aReportModel = reportdesign::OReportDefinition::getSharedSdrModel(m_xReportDefinition);
+
if ( !m_aReportModel )
throw RuntimeException();
m_aReportModel->attachController( *this );
@@ -1733,7 +1735,7 @@ void OReportController::impl_initialize( )
if ( m_nPageNum != -1 )
{
- if ( m_nPageNum < m_aReportModel->GetPageCount() )
+ if ( m_nPageNum < (sal_Int32)m_aReportModel->GetPageCount() )
{
const OReportPage* pPage = dynamic_cast<OReportPage*>(m_aReportModel->GetPage(static_cast<sal_uInt16>(m_nPageNum)));
if ( pPage )
@@ -2586,9 +2588,9 @@ IMPL_LINK( OReportController, EventLstHdl, VclWindowEvent*, _pEvent )
// -----------------------------------------------------------------------------
void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHint)
{
- if (_rHint.ISA(DlgEdHint)
- && (static_cast< DlgEdHint const & >(_rHint).GetKind()
- == RPTUI_HINT_SELECTIONCHANGED))
+ const DlgEdHint* pDlgEdHint = dynamic_cast< const DlgEdHint* >(&_rHint);
+
+ if(pDlgEdHint && RPTUI_HINT_SELECTIONCHANGED == pDlgEdHint->GetKind())
{
const sal_Int32 nSelectionCount = getDesignView()->getMarkedObjectCount();
if ( m_nSelectionCount != nSelectionCount )
@@ -2780,7 +2782,7 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept
::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow.get() )
{
- aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum() );
+ aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNumber() );
} // if ( pSectionWindow.get() )
} // if ( getDesignView() )
@@ -3060,7 +3062,7 @@ void OReportController::insertGraphic()
}
}
// -----------------------------------------------------------------------------
-::boost::shared_ptr<rptui::OReportModel> OReportController::getSdrModel() const
+::boost::shared_ptr<rptui::OReportModel> OReportController::getSharedSdrModel() const
{
return m_aReportModel;
}
@@ -3166,19 +3168,19 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
uno::Reference< report::XReportComponent> xShapeProp;
if ( _nObjectId == OBJ_CUSTOMSHAPE )
{
- pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
+ pNewControl = SdrObjFactory::MakeNewObject( *m_aReportModel.get(), SdrObjectCreationInfo(_nObjectId, ReportInventor) );
xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
::rtl::OUString sCustomShapeType = getDesignView()->GetInsertObjString();
if ( !sCustomShapeType.getLength() )
sCustomShapeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond"));
pSectionWindow->getReportSection().createDefault(sCustomShapeType,pNewControl);
- pNewControl->SetLogicRect(Rectangle(3000,500,6000,3500)); // switch height and width
+ sdr::legacy::SetLogicRect(*pNewControl, Rectangle(3000,500,6000,3500)); // switch height and width
} // if ( _nObjectId == OBJ_CUSTOMSHAPE )
else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT == _nObjectId )
{
- pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
+ pNewControl = SdrObjFactory::MakeNewObject( *m_aReportModel.get(), SdrObjectCreationInfo(_nObjectId, ReportInventor) );
- pNewControl->SetLogicRect(Rectangle(3000,500,8000,5500)); // switch height and width
+ sdr::legacy::SetLogicRect(*pNewControl, Rectangle(3000,500,8000,5500)); // switch height and width
xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW);
OOle2Obj* pObj = dynamic_cast<OOle2Obj*>(pNewControl);
if ( pObj && !pObj->IsEmpty() )
@@ -3195,7 +3197,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
,NULL,NULL,_nObjectId,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT,
NULL,pSectionWindow->getReportSection().getPage(),m_aReportModel.get(),
pLabel,pControl);
- delete pLabel;
+ deleteSdrObjectSafeAndClearPointer(pLabel);
pNewControl = pControl;
OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl);
@@ -3592,12 +3594,12 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
{
if ( pSectionViews[0] == pSectionViews[1] )
{
- Rectangle aLabel = getRectangleFromControl(pControl[0]);
- Rectangle aTextfield = getRectangleFromControl(pControl[1]);
+ const Rectangle aLabel(getRectangleFromControl(pControl[0]));
+ const Rectangle aTextfield(getRectangleFromControl(pControl[1]));
// create a Union of the given Label and Textfield
- Rectangle aLabelAndTextfield( aLabel );
- aLabelAndTextfield.Union(aTextfield);
+ basegfx::B2DRange aLabelAndTextfield(aLabel.Left(), aLabel.Top(), aLabel.Right(), aLabel.Bottom());
+ aLabelAndTextfield.expand(basegfx::B2DRange(aTextfield.Left(), aTextfield.Top(), aTextfield.Right(), aTextfield.Bottom()));
// check if there exists other fields and if yes, move down
bool bOverlapping = true;
@@ -3608,8 +3610,10 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
bOverlapping = pOverlappedObj != NULL;
if ( bOverlapping )
{
- const Rectangle& aLogicRect = pOverlappedObj->GetLogicRect();
- aLabelAndTextfield.Move(0,aLogicRect.Top() + aLogicRect.getHeight() - aLabelAndTextfield.Top());
+ const basegfx::B2DRange aLogicRange(sdr::legacy::GetLogicRange(*pOverlappedObj));
+
+ aLabelAndTextfield.transform(basegfx::tools::createTranslateB2DHomMatrix(
+ 0.0, aLogicRange.getMaxY() - aLabelAndTextfield.getMinY()));
bHasToMove = true;
}
}
@@ -3617,14 +3621,19 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
if (bHasToMove)
{
// There was a move down, we need to move the Label and the Textfield down
- aLabel.Move(0, aLabelAndTextfield.Top() - aLabel.Top());
- aTextfield.Move(0, aLabelAndTextfield.Top() - aTextfield.Top());
+
+ // aLabel.Move below moves Y relative to aLabel.Top(), thus we get
+ // aLabel.Top() + aLabelAndTextfield.Top() - aLabel.Top(), which is
+ // aLabelAndTextfield.Top() as new top position. Same for aTextfield.Top()
+ //aLabel.Move(0, aLabelAndTextfield.Top() - aLabel.Top());
+ //aTextfield.Move(0, aLabelAndTextfield.Top() - aTextfield.Top());
+ const sal_Int32 nNewY(basegfx::fround(aLabelAndTextfield.getMinY()));
uno::Reference< report::XReportComponent> xLabel(pControl[0]->getUnoShape(),uno::UNO_QUERY_THROW);
- xLabel->setPositionY(aLabel.Top());
+ xLabel->setPositionY(nNewY); // aLabel.Top());
uno::Reference< report::XReportComponent> xTextfield(pControl[1]->getUnoShape(),uno::UNO_QUERY_THROW);
- xTextfield->setPositionY(aTextfield.Top());
+ xTextfield->setPositionY(nNewY); // aTextfield.Top());
}
}
// this should never happen.
@@ -3638,7 +3647,9 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
else
{
for(size_t i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
- delete pControl[i];
+ {
+ deleteSdrObjectSafeAndClearPointer(pControl[i]);
+ }
}
}
}
@@ -4396,7 +4407,7 @@ SfxUndoManager& OReportController::getUndoManager() const
DBG_TESTSOLARMUTEX();
// this is expected to be called during UI actions, so the SM is assumed to be locked
- ::boost::shared_ptr< OReportModel > pReportModel( getSdrModel() );
+ ::boost::shared_ptr< OReportModel > pReportModel( m_aReportModel );
ENSURE_OR_THROW( !!pReportModel, "no access to our model" );
SfxUndoManager* pUndoManager( pReportModel->GetSdrUndoManager() );
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 40e8900b297b..219f3cfe3928 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -42,6 +42,7 @@
#include <svx/svxids.hrc>
#include <svx/svditer.hxx>
#include <svx/dbaexchange.hxx>
+#include <svx/svdlegacy.hxx>
#include <vcl/svapp.hxx>
@@ -135,7 +136,7 @@ OReportSection::~OReportSection()
m_pView->EndListening( *m_pModel );
m_pView = NULL;
}
- /*m_pModel->DeletePage(m_pPage->GetPageNum());*/
+ /*m_pModel->DeletePage(m_pPage->GetPageNumber());*/
}
//------------------------------------------------------------------------------
void OReportSection::Paint( const Rectangle& rRect )
@@ -189,19 +190,19 @@ void OReportSection::fill()
m_pReportListener = addStyleListener(m_xSection->getReportDefinition(),this);
- m_pModel = m_pParent->getViewsWindow()->getView()->getReportView()->getController().getSdrModel();
+ m_pModel = m_pParent->getViewsWindow()->getView()->getReportView()->getController().getSharedSdrModel();
m_pPage = m_pModel->getPage(m_xSection);
- m_pView = new OSectionView( m_pModel.get(), this, m_pParent->getViewsWindow()->getView() );
+ m_pView = new OSectionView( *m_pModel.get(), this, m_pParent->getViewsWindow()->getView() );
// #i93597# tell SdrPage that only left and right page border is defined
// instead of the full rectangle definition
m_pPage->setPageBorderOnlyLeftRight(true);
// without the following call, no grid is painted
- m_pView->ShowSdrPage( m_pPage );
+ m_pView->ShowSdrPage( *m_pPage );
- m_pView->SetMoveSnapOnlyTopLeft( sal_True );
+ m_pView->SetMoveSnapOnlyTopLeft(true);
ODesignView* pDesignView = m_pParent->getViewsWindow()->getView()->getReportView();
// #i93595# Adapted grid to a more coarse grid and subdivisions for better visualisation. This
@@ -212,9 +213,7 @@ void OReportSection::fill()
m_pView->SetGridFine(aGridSizeFine);
// #i93595# set snap grid width to snap to all existing subdivisions
- const Fraction aX(aGridSizeFine.A());
- const Fraction aY(aGridSizeFine.B());
- m_pView->SetSnapGridWidth(aX, aY);
+ m_pView->SetSnapGridWidth(aGridSizeFine.A(), aGridSizeFine.B());
m_pView->SetGridSnap( pDesignView->isGridSnap() );
m_pView->SetGridFront( sal_False );
@@ -228,19 +227,27 @@ void OReportSection::fill()
uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition();
const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
- m_pPage->SetLftBorder(nLeftMargin);
- m_pPage->SetRgtBorder(nRightMargin);
+ m_pPage->SetLeftPageBorder(nLeftMargin);
+ m_pPage->SetRightPageBorder(nRightMargin);
// LLA: TODO
-// m_pPage->SetUppBorder(-10000);
+// m_pPage->SetTopPageBorder(-10000);
- m_pView->SetDesignMode( sal_True );
+ m_pView->SetDesignMode( true );
m_pView->StartListening( *m_pModel );
/*Resize();*/
- m_pPage->SetSize( Size( getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight()) );
- const Size aPageSize = m_pPage->GetSize();
- m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) );
+ m_pPage->SetPageScale(
+ basegfx::B2DVector(
+ getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,
+ 5*m_xSection->getHeight()));
+ const basegfx::B2DVector& rPageScale = m_pPage->GetPageScale();
+ m_pView->SetWorkArea(
+ basegfx::B2DRange(
+ nLeftMargin,
+ 0.0,
+ rPageScale.getX() - nLeftMargin - nRightMargin,
+ rPageScale.getY()));
//SetBackground( Wallpaper( COL_BLUE ));
}
@@ -275,31 +282,42 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC
SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
if ( pObject )
{
- SdrObject* pNeuObj = pObject->Clone();
+ SdrObject* pNeuObj = pObject->CloneSdrObject();
+ m_pPage->InsertObjectToSdrObjList(*pNeuObj);
- pNeuObj->SetPage( m_pPage );
- pNeuObj->SetModel( m_pModel.get() );
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- m_pPage->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason);
-
- Rectangle aRet(VCLPoint((*pCopiesIter)->getPosition()),VCLSize((*pCopiesIter)->getSize()));
- aRet.setHeight(aRet.getHeight() + 1);
- aRet.setWidth(aRet.getWidth() + 1);
+ const awt::Point aWorkPos((*pCopiesIter)->getPosition());
+ const awt::Size aWorkSize((*pCopiesIter)->getSize());
+ basegfx::B2DRange aWorkRange(aWorkPos.X, aWorkPos.Y, aWorkPos.X + aWorkSize.Width, aWorkPos.Y + aWorkSize.Height);
bool bOverlapping = true;
+
while ( bOverlapping )
{
- bOverlapping = isOver(aRet,*m_pPage,*m_pView,true,pNeuObj) != NULL;
+ bOverlapping = isOver(aWorkRange,*m_pPage,*m_pView,true,pNeuObj) != NULL;
if ( bOverlapping )
{
- aRet.Move(0,aRet.getHeight()+1);
- pNeuObj->SetLogicRect(aRet);
+ aWorkRange.transform(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ 0.0,
+ aWorkRange.getHeight()));
+ pNeuObj->setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aWorkRange.getRange(),
+ aWorkRange.getMinimum()));
//(*pCopiesIter)->setPositionY(aRet.Top());
}
}
- m_pView->AddUndo( m_pView->GetModel()->GetSdrUndoFactory().CreateUndoNewObject( *pNeuObj ) );
- m_pView->MarkObj( pNeuObj, m_pView->GetSdrPageView() );
- if ( m_xSection.is() && (static_cast<sal_uInt32>(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) )
- m_xSection->setHeight(aRet.getHeight() + aRet.Top());
+ m_pView->AddUndo( m_pView->getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject( *pNeuObj ) );
+ m_pView->MarkObj( *pNeuObj );
+
+ if(m_xSection.is())
+ {
+ const sal_Int32 nBottom(basegfx::fround(aWorkRange.getMaxY()));
+
+ if(static_cast<sal_uInt32>(nBottom) > m_xSection->getHeight())
+ {
+ m_xSection->setHeight(nBottom);
+ }
+ }
}
}
}
@@ -316,7 +334,7 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC
//----------------------------------------------------------------------------
void OReportSection::Delete()
{
- if( !m_pView->AreObjectsMarked() )
+ if( !m_pView->areSdrObjectsSelected() )
return;
m_pView->BrkAction();
@@ -349,36 +367,35 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedOb
void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedObjects,bool _bEraseAnddNoClone)
{
OSL_ENSURE(m_xSection.is(),"Why is the section here NULL!");
- if( !m_pView->AreObjectsMarked() || !m_xSection.is() )
+ if( !m_pView->areSdrObjectsSelected() || !m_xSection.is() )
return;
// stop all drawing actions
//m_pView->BrkAction();
// insert control models of marked objects into clipboard dialog model
- const SdrMarkList& rMarkedList = m_pView->GetMarkedObjectList();
- const sal_uLong nMark = rMarkedList.GetMarkCount();
-
+ const SdrObjectVector aSelection(m_pView->getSelectedSdrObjectVectorFromSdrMarkView());
::std::vector< uno::Reference<report::XReportComponent> > aCopies;
- aCopies.reserve(nMark);
+ aCopies.reserve(aSelection.size());
+ SdrUndoFactory& rUndo = m_pView->getSdrModelFromSdrView().GetSdrUndoFactory();
- SdrUndoFactory& rUndo = m_pView->GetModel()->GetSdrUndoFactory();
-
- for( sal_uLong i = nMark; i > 0; )
+ for( sal_uInt32 i = aSelection.size(); i > 0; )
{
--i;
- SdrObject* pSdrObject = rMarkedList.GetMark(i)->GetMarkedSdrObj();
+ SdrObject* pSdrObject = aSelection[i];
OObjectBase* pObj = dynamic_cast<OObjectBase*>(pSdrObject);
+
if ( pObj )
{
try
{
- SdrObject* pNeuObj = pSdrObject->Clone();
+ SdrObject* pNeuObj = pSdrObject->CloneSdrObject();
aCopies.push_back(uno::Reference<report::XReportComponent>(pNeuObj->getUnoShape(),uno::UNO_QUERY));
+
if ( _bEraseAnddNoClone )
{
m_pView->AddUndo( rUndo.CreateUndoDeleteObject( *pSdrObject ) );
- m_pPage->RemoveObject(pSdrObject->GetOrdNum());
+ m_pPage->RemoveObjectFromSdrObjList(pSdrObject->GetNavigationPosition());
}
}
@@ -440,7 +457,7 @@ void OReportSection::SelectAll(const sal_uInt16 _nObjectType)
while( (pObjIter = aIter.Next()) != NULL )
{
if ( pObjIter->GetObjIdentifier() == _nObjectType )
- m_pView->MarkObj( pObjIter, m_pView->GetSdrPageView() );
+ m_pView->MarkObj( *pObjIter );
}
}
}
@@ -535,20 +552,28 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
if ( _rEvent.PropertyName == PROPERTY_LEFTMARGIN )
{
- m_pPage->SetLftBorder(nLeftMargin);
+ m_pPage->SetLeftPageBorder(nLeftMargin);
}
else if ( _rEvent.PropertyName == PROPERTY_RIGHTMARGIN )
{
- m_pPage->SetRgtBorder(nRightMargin);
+ m_pPage->SetRightPageBorder(nRightMargin);
}
- const Size aOldPageSize = m_pPage->GetSize();
- sal_Int32 nNewHeight = 5*m_xSection->getHeight();
- if ( aOldPageSize.Height() != nNewHeight || nPaperWidth != aOldPageSize.Width() )
+
+ const basegfx::B2DVector& rCurrentPageSize = m_pPage->GetPageScale();
+ const sal_uInt32 nNewHeight(m_xSection->getHeight() >= 0.0 ? 5 * m_xSection->getHeight() : 0);
+
+ if(basegfx::fround(rCurrentPageSize.getY()) != nNewHeight || nPaperWidth != basegfx::fround(rCurrentPageSize.getX()))
{
- m_pPage->SetSize( Size( nPaperWidth,nNewHeight) );
- const Size aPageSize = m_pPage->GetSize();
- m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) );
+ m_pPage->SetPageScale(basegfx::B2DVector(nPaperWidth, nNewHeight));
+ const basegfx::B2DVector& rNewPageSize = m_pPage->GetPageScale();
+ m_pView->SetWorkArea(
+ basegfx::B2DRange(
+ nLeftMargin,
+ 0.0,
+ rNewPageSize.getX() - nLeftMargin - nRightMargin,
+ rNewPageSize.getY()));
}
+
impl_adjustObjectSizePosition(nPaperWidth,nLeftMargin,nRightMargin);
m_pParent->Invalidate(INVALIDATE_UPDATE | INVALIDATE_TRANSPARENT);
}
@@ -603,7 +628,7 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
if ( m_xSection.is() && (static_cast<sal_uInt32>(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) )
m_xSection->setHeight(aRet.getHeight() + aRet.Top());
- pObject->RecalcBoundRect();
+ pObject->ActionChanged();
}
pBase->StartListening();
}
@@ -628,7 +653,7 @@ void OReportSection::deactivateOle()
// -----------------------------------------------------------------------------
void OReportSection::createDefault(const ::rtl::OUString& _sType)
{
- SdrObject* pObj = m_pView->GetCreateObj();//rMarkList.GetMark(0)->GetObj();
+ SdrObject* pObj = m_pView->GetCreateObj();//rMarkList.GetMark(0).GetObj();
if ( !pObj )
return;
createDefault(_sType,pObj);
@@ -658,7 +683,7 @@ void OReportSection::createDefault(const ::rtl::OUString& _sType,SdrObject* _pOb
if( pSourceObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
- SfxItemSet aDest( _pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
+ SfxItemSet aDest( _pObj->GetObjectItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
@@ -674,11 +699,11 @@ void OReportSection::createDefault(const ::rtl::OUString& _sType,SdrObject* _pOb
0, 0);
aDest.Set( rSource );
_pObj->SetMergedItemSet( aDest );
- sal_Int32 nAngle = pSourceObj->GetRotateAngle();
- if ( nAngle )
+
+ const long aOldRotation(sdr::legacy::GetRotateAngle(*pSourceObj));
+ if ( aOldRotation )
{
- double a = nAngle * F_PI18000;
- _pObj->NbcRotate( _pObj->GetSnapRect().Center(), nAngle, sin( a ), cos( a ) );
+ sdr::legacy::RotateSdrObject(*_pObj, sdr::legacy::GetSnapRect(*_pObj).Center(), aOldRotation);
}
bAttributesAppliedFromGallery = sal_True;
}
@@ -693,7 +718,7 @@ void OReportSection::createDefault(const ::rtl::OUString& _sType,SdrObject* _pOb
_pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER ,ITEMID_ADJUST) );
_pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
_pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
- _pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ _pObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
((SdrObjCustomShape*)_pObj)->MergeDefaultAttributes( &_sType );
}
}
@@ -703,17 +728,14 @@ uno::Reference< report::XReportComponent > OReportSection::getCurrentControlMode
uno::Reference< report::XReportComponent > xModel;
if ( m_pView )
{
- const SdrMarkList& rMarkList = m_pView->GetMarkedObjectList();
- sal_uInt32 nMarkCount = rMarkList.GetMarkCount();
+ OObjectBase* pSelected = dynamic_cast< OObjectBase* >(m_pView->getSelectedIfSingle());
- if ( nMarkCount == 1 )
+ if ( pSelected )
{
- SdrObject* pDlgEdObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- OObjectBase* pObj = dynamic_cast<OObjectBase*>(pDlgEdObj);
- if ( pObj )
- xModel = pObj->getReportComponent().get();
+ xModel = pSelected->getReportComponent().get();
}
}
+
return xModel;
}
// -----------------------------------------------------------------------------
@@ -721,18 +743,19 @@ void OReportSection::fillControlModelSelection(::std::vector< uno::Reference< un
{
if ( m_pView )
{
- const SdrMarkList& rMarkList = m_pView->GetMarkedObjectList();
- const sal_uInt32 nMarkCount = rMarkList.GetMarkCount();
+ const SdrObjectVector aSelection(m_pView->getSelectedSdrObjectVectorFromSdrMarkView());
- for (sal_uInt32 i=0; i < nMarkCount; ++i)
+ for(sal_uInt32 i(0); i < aSelection.size(); ++i)
{
- const SdrObject* pDlgEdObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- const OObjectBase* pObj = dynamic_cast<const OObjectBase*>(pDlgEdObj);
+ const OObjectBase* pObj = dynamic_cast< const OObjectBase* >(aSelection[i]);
+
if ( pObj )
+ {
_rSelection.push_back(pObj->getReportComponent());
}
}
}
+}
// -----------------------------------------------------------------------------
sal_Int8 OReportSection::AcceptDrop( const AcceptDropEvent& _rEvt )
{
@@ -810,14 +833,10 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt )
{
m_pParent->getViewsWindow()->getView()->setMarked(m_pView,sal_True);
m_pView->UnmarkAll();
- const Rectangle& rRect = m_pView->GetWorkArea();
- if ( aDropPos.X() < rRect.Left() )
- aDropPos.X() = rRect.Left();
- else if ( aDropPos.X() > rRect.Right() )
- aDropPos.X() = rRect.Right();
-
- if ( aDropPos.Y() > rRect.Bottom() )
- aDropPos.Y() = rRect.Bottom();
+
+ const basegfx::B2DRange aWorkArea(m_pView->GetWorkArea());
+ const basegfx::B2DPoint aClampedDropPos(aWorkArea.clamp(basegfx::B2DPoint(aDropPos.X(), aDropPos.Y())));
+ aDropPos = Point(basegfx::fround(aClampedDropPos.getX()), basegfx::fround(aClampedDropPos.getY()));
uno::Sequence<beans::PropertyValue> aValues;
if ( !bMultipleFormat )
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
index 486c7ea47e46..b61b7fe67432 100644
--- a/reportdesign/source/ui/report/SectionView.cxx
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -38,12 +38,11 @@
namespace rptui
{
using namespace ::com::sun::star;
-TYPEINIT1( OSectionView, SdrView );
//----------------------------------------------------------------------------
DBG_NAME( rpt_OSectionView )
-OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor )
- :SdrView( pModel, _pSectionWindow )
+OSectionView::OSectionView( SdrModel& rModel, OReportSection* _pSectionWindow, OReportWindow* pEditor )
+ :SdrView( rModel, _pSectionWindow )
,m_pReportWindow( pEditor )
,m_pSectionWindow(_pSectionWindow)
{
@@ -65,11 +64,12 @@ OSectionView::~OSectionView()
//----------------------------------------------------------------------------
-void OSectionView::MarkListHasChanged()
+void OSectionView::handleSelectionChange()
{
- DBG_CHKTHIS( rpt_OSectionView,NULL);
- SdrView::MarkListHasChanged();
+ // call parent
+ SdrView::handleSelectionChange();
+ // local reactions
if ( m_pReportWindow && m_pSectionWindow && !m_pSectionWindow->getPage()->getSpecialMode() )
{
//m_pReportWindow->unmarkAllObjects(this); // WHY
@@ -81,47 +81,56 @@ void OSectionView::MarkListHasChanged()
//----------------------------------------------------------------------------
-void OSectionView::MakeVisible( const Rectangle& rRect, Window& rWin )
+void OSectionView::MakeVisibleAtView( const basegfx::B2DRange& rRange, Window& rWin )
{
DBG_CHKTHIS( rpt_OSectionView,NULL);
// visible area
- MapMode aMap( rWin.GetMapMode() );
- const Point aOrg( aMap.GetOrigin() );
- const Size aVisSize( rWin.GetOutputSize() );
- const Rectangle aVisRect( Point(-aOrg.X(),-aOrg.Y()), aVisSize );
+ const basegfx::B2DRange aVisRange(rWin.GetLogicRange());
// check, if rectangle is inside visible area
- if ( !aVisRect.IsInside( rRect ) )
+ if ( !aVisRange.isInside( rRange ) )
{
// calculate scroll distance; the rectangle must be inside the visible area
- sal_Int32 nScrollX = 0, nScrollY = 0;
+ double fScrollX(0.0);
+ double fScrollY(0.0);
- const sal_Int32 nVisLeft = aVisRect.Left();
- const sal_Int32 nVisRight = aVisRect.Right();
- const sal_Int32 nVisTop = aVisRect.Top();
- const sal_Int32 nVisBottom = aVisRect.Bottom();
+ const double fVisLeft(aVisRange.getMinX());
+ const double fVisRight(aVisRange.getMaxX());
+ const double fVisTop(aVisRange.getMinY());
+ const double fVisBottom(aVisRange.getMaxY());
// don't scroll beyond the page size
- Size aPageSize = m_pSectionWindow->getPage()->GetSize();
- const sal_Int32 nPageWidth = aPageSize.Width();
- const sal_Int32 nPageHeight = aPageSize.Height();
+ const double fPageWidth(m_pSectionWindow->getPage()->GetPageScale().getX());
+ const double fPageHeight(m_pSectionWindow->getPage()->GetPageScale().getY());
- if ( nVisRight + nScrollX > nPageWidth )
- nScrollX = nPageWidth - nVisRight;
+ if ( fVisRight + fScrollX > fPageWidth )
+ {
+ fScrollX = fPageWidth - fVisRight;
+ }
- if ( nVisLeft + nScrollX < 0 )
- nScrollX = -nVisLeft;
+ if ( fVisLeft + fScrollX < 0 )
+ {
+ fScrollX = -fVisLeft;
+ }
- if ( nVisBottom + nScrollY > nPageHeight )
- nScrollY = nPageHeight - nVisBottom;
+ if ( fVisBottom + fScrollY > fPageHeight )
+ {
+ fScrollY = fPageHeight - fVisBottom;
+ }
- if ( nVisTop + nScrollY < 0 )
- nScrollY = -nVisTop;
+ if ( fVisTop + fScrollY < 0 )
+ {
+ fScrollY = -fVisTop;
+ }
// scroll window
+ const sal_uInt32 nScrollX(basegfx::fround(fScrollX));
+ const sal_uInt32 nScrollY(basegfx::fround(fScrollY));
+ MapMode aMap( rWin.GetMapMode() );
+
rWin.Update();
rWin.Scroll( -nScrollX, -nScrollY );
- aMap.SetOrigin( Point( aOrg.X() - nScrollX, aOrg.Y() - nScrollY ) );
+ aMap.SetOrigin( Point( aMap.GetOrigin().X() - nScrollX, aMap.GetOrigin().Y() - nScrollY ) );
rWin.SetMapMode( aMap );
rWin.Update();
rWin.Invalidate();
@@ -142,57 +151,67 @@ void OSectionView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
DBG_CHKTHIS( rpt_OSectionView,NULL);
SdrView::Notify(rBC,rHint);
- if ( rHint.ISA(SdrHint) )
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if ( pSdrHint )
{
- const SdrObject* pObj = ((SdrHint&)rHint).GetObject();
- const SdrHintKind eKind = ((SdrHint&)rHint).GetKind();
+ const SdrObject* pObj = pSdrHint->GetSdrHintObject();
+ const SdrHintKind eKind = pSdrHint->GetSdrHintKind();
// check for change of selected object
- if(HINT_OBJCHG == eKind && pObj && IsObjMarked(const_cast<SdrObject*>(pObj)))
- AdjustMarkHdl();
+ if((HINT_OBJCHG_MOVE == eKind || HINT_OBJCHG_RESIZE == eKind || HINT_OBJCHG_ATTR == eKind)
+ && pObj && IsObjMarked(*pObj))
+ {
+ SetMarkHandles();
+ }
else if ( eKind == HINT_OBJREMOVED )
+ {
ObjectRemovedInAliveMode(pObj);
}
}
+}
//------------------------------------------------------------------------------
void OSectionView::ObjectRemovedInAliveMode( const SdrObject* _pObject )
{
+ if(_pObject)
+ {
DBG_CHKTHIS( rpt_OSectionView,NULL);
- const SdrMarkList& rMarkedList = GetMarkedObjectList();
- const sal_uLong nMark = rMarkedList.GetMarkCount();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for( sal_uLong i = 0; i < nMark; i++ )
+ for( sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- SdrObject* pSdrObj = rMarkedList.GetMark(i)->GetMarkedSdrObj();
+ SdrObject* pSdrObj = aSelection[i];
+
if (_pObject == pSdrObj)
{
- SdrPageView* pPgView = GetSdrPageView();
BrkAction();
- MarkObj( pSdrObj, pPgView, sal_True );
+ MarkObj( *pSdrObj, true );
break;
}
}
}
+}
// -----------------------------------------------------------------------------
void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo )
{
- if (AreObjectsMarked())
+ if (areSdrObjectsSelected())
{
// #i11702# use SdrUndoObjectLayerChange for undo
// STR_UNDO_SELATTR is "Attributes" - should use a different text later
BegUndo( );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- const SdrMarkList& rMark = GetMarkedObjectList();
- sal_uLong nCount = rMark.GetMarkCount();
- for (sal_uLong i=0; i<nCount; i++)
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
- if ( pObj->ISA(OCustomShape) )
+ OCustomShape* pObj = dynamic_cast< OCustomShape* >(aSelection[i]);
+
+ if ( pObj )
{
AddUndo( new SdrUndoObjectLayerChange( *pObj, pObj->GetLayer(), _nLayerNo) );
pObj->SetLayer( _nLayerNo );
OObjectBase* pBaseObj = dynamic_cast<OObjectBase*>(pObj);
+
try
{
pBaseObj->getReportComponent()->setPropertyValue(PROPERTY_OPAQUE,uno::makeAny(_nLayerNo == RPT_LAYER_FRONT));
@@ -205,29 +224,29 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo )
}
EndUndo();
-
- // #84073# check mark list now instead of later in a timer
- CheckMarked();
- MarkListHasChanged();
}
}
// -----------------------------------------------------------------------------
bool OSectionView::OnlyShapesMarked() const
{
- const SdrMarkList& rMark = GetMarkedObjectList();
- const sal_uLong nCount = rMark.GetMarkCount();
- if ( !nCount )
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(!aSelection.size())
+ {
return false;
- sal_uLong i=0;
- for (; i<nCount; i++)
+ }
+
+ sal_uInt32 a(0);
+
+ for(; a < aSelection.size(); a++)
{
- SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
- if ( !pObj->ISA(OCustomShape) )
+ if(!dynamic_cast< OCustomShape* >(aSelection[a]))
{
break;
}
- } // for (sal_uLong i=0; i<nCount; i++)
- return i == nCount;
+ }
+
+ return a == aSelection.size();
}
bool OSectionView::IsDragResize() const
@@ -249,20 +268,28 @@ bool OSectionView::IsDragResize() const
short OSectionView::GetLayerIdOfMarkedObjects() const
{
short nRet = SHRT_MAX;
- const SdrMarkList &rMrkList = GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ const SdrObject* pObj = aSelection[i];
+
if ( nRet == SHRT_MAX )
+ {
nRet = pObj->GetLayer();
+ }
else if ( nRet != pObj->GetLayer() )
{
nRet = -1;
break;
}
}
+
if ( nRet == SHRT_MAX )
+ {
nRet = -1;
+ }
+
return nRet;
}
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index 75535098497f..759c737087fe 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -268,9 +268,9 @@ void OStartMarker::setTitle(const String& _sTitle)
void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
{
OColorListener::Notify(rBc, rHint);
- if (rHint.ISA(SfxSimpleHint)
- && (static_cast< SfxSimpleHint const & >(rHint).GetId()
- == SFX_HINT_COLORS_CHANGED))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_COLORS_CHANGED == pSfxSimpleHint->GetId())
{
setColor();
Invalidate(INVALIDATE_CHILDREN);
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 51aaff40f244..f5c767827cf8 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -46,6 +46,7 @@
#include <svx/unoshape.hxx>
#include <vcl/svapp.hxx>
#include <boost/bind.hpp>
+#include <svx/svdlegacy.hxx>
#include "helpids.hrc"
#include <svx/svdundo.hxx>
@@ -83,10 +84,18 @@ bool lcl_getNewRectSize(const Rectangle& _aObjRect,long& _nXMov, long& _nYMov,Sd
}
if (dynamic_cast<OUnoObject*>(_pObj) != NULL || dynamic_cast<OOle2Obj*>(_pObj) != NULL)
{
- pOverlappedObj = isOver(aNewRect,*_pObj->GetPage(),*_pView,true,_pObj);
+ pOverlappedObj = isOver(
+ basegfx::B2DRange(aNewRect.Left(), aNewRect.Top(), aNewRect.Right(), aNewRect.Bottom()),
+ *_pObj->getSdrPageFromSdrObject(),
+ *_pView,
+ true,
+ _pObj);
+
if ( pOverlappedObj && _pObj != pOverlappedObj )
{
- Rectangle aOverlappingRect = (_bBoundRects ? pOverlappedObj->GetCurrentBoundRect() : pOverlappedObj->GetSnapRect());
+ const Rectangle aOverlappingRect(_bBoundRects
+ ? sdr::legacy::GetBoundRect(*pOverlappedObj)
+ : sdr::legacy::GetSnapRect(*pOverlappedObj));
sal_Int32 nXTemp = _nXMov;
sal_Int32 nYTemp = _nYMov;
switch(_nControlModification)
@@ -360,7 +369,7 @@ void OViewsWindow::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeT
TSectionsMap::iterator aIter = m_aSections.begin();
TSectionsMap::iterator aEnd = m_aSections.end();
for (;aIter != aEnd ; ++aIter)
- (*aIter)->getReportSection().getSectionView().SetCurrentObj( eObj, ReportInventor );
+ (*aIter)->getReportSection().getSectionView().setSdrObjectCreationInfo(SdrObjectCreationInfo(eObj, ReportInventor));
m_sShapeType = _sShapeType;
}
@@ -381,7 +390,7 @@ sal_Bool OViewsWindow::HasSelection() const
{
TSectionsMap::const_iterator aIter = m_aSections.begin();
TSectionsMap::const_iterator aEnd = m_aSections.end();
- for (;aIter != aEnd && !(*aIter)->getReportSection().getSectionView().AreObjectsMarked(); ++aIter)
+ for (;aIter != aEnd && !(*aIter)->getReportSection().getSectionView().areSdrObjectsSelected(); ++aIter)
;
return aIter != aEnd;
}
@@ -592,7 +601,7 @@ void OViewsWindow::MouseButtonUp( const MouseEvent& rMEvt )
TSectionsMap::iterator aEnd = m_aSections.end();
for (;aIter != aEnd ; ++aIter)
{
- if ( (*aIter)->getReportSection().getSectionView().AreObjectsMarked() )
+ if ( (*aIter)->getReportSection().getSectionView().areSdrObjectsSelected() )
{
(*aIter)->getReportSection().MouseButtonUp(rMEvt);
break;
@@ -614,7 +623,7 @@ sal_Bool OViewsWindow::handleKeyEvent(const KeyEvent& _rEvent)
TSectionsMap::iterator aEnd = m_aSections.end();
for (;aIter != aEnd ; ++aIter)
{
- //if ( (*aIter).getReportSection().getSectionView().->AreObjectsMarked() )
+ //if ( (*aIter).getReportSection().getSectionView().->areSdrObjectsSelected() )
if ( (*aIter)->getStartMarker().isMarked() )
{
bRet = (*aIter)->getReportSection().handleKeyEvent(_rEvent);
@@ -677,7 +686,7 @@ void OViewsWindow::setMarked(const uno::Sequence< uno::Reference< report::XRepor
SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
OSL_ENSURE( pObject, "OViewsWindow::setMarked: no SdrObject for the shape!" );
if ( pObject )
- pSectionWindow->getReportSection().getSectionView().MarkObj( pObject, pSectionWindow->getReportSection().getSectionView().GetSdrPageView(), !_bMark );
+ pSectionWindow->getReportSection().getSectionView().MarkObj( *pObject, !_bMark );
}
}
}
@@ -687,18 +696,22 @@ void OViewsWindow::collectRectangles(TRectangleMap& _rSortRectangles, bool _bBo
{
TSectionsMap::iterator aIter = m_aSections.begin();
TSectionsMap::iterator aEnd = m_aSections.end();
+
for (aIter = m_aSections.begin();aIter != aEnd ; ++aIter)
{
OSectionView& rView = (*aIter)->getReportSection().getSectionView();
- if ( rView.AreObjectsMarked() )
+
+ if(rView.areSdrObjectsSelected())
{
- rView.SortMarkedObjects();
- const sal_uInt32 nCount = rView.GetMarkedObjectCount();
- for (sal_uInt32 i=0; i < nCount; ++i)
- {
- const SdrMark* pM = rView.GetSdrMarkByIndex(i);
- SdrObject* pObj = pM->GetMarkedSdrObj();
- Rectangle aObjRect(_bBoundRects ? pObj->GetCurrentBoundRect() : pObj->GetSnapRect());
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 i(0); i < aSelection.size(); ++i)
+ {
+ SdrObject* pObj = aSelection[i];
+ Rectangle aObjRect(_bBoundRects
+ ? sdr::legacy::GetBoundRect(*pObj)
+ : sdr::legacy::GetSnapRect(*pObj));
+
_rSortRectangles.insert(TRectangleMap::value_type(aObjRect,TRectangleMap::mapped_type(pObj,&rView)));
}
}
@@ -738,7 +751,7 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,
SdrObjTransformInfoRec aInfo;
const SdrObject* pObj = aRectIter->second.first;
pObj->TakeObjInfo(aInfo);
- sal_Bool bHasFixed = !aInfo.bMoveAllowed || pObj->IsMoveProtect();
+ sal_Bool bHasFixed = !aInfo.mbMoveAllowed || pObj->IsMoveProtect();
if ( bHasFixed )
_rBound.Union(aObjRect);
else
@@ -763,9 +776,22 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,
else
{
if (_bBoundRects)
- _rBound.Union(aRectIter->second.second->GetMarkedObjBoundRect());
+ {
+ _rBound.Union(sdr::legacy::GetAllObjBoundRect(
+ aRectIter->second.second->getSelectedSdrObjectVectorFromSdrMarkView()));
+ }
else
- _rBound.Union(aRectIter->second.second->GetMarkedObjRect());
+ {
+ const basegfx::B2DRange aSnapRange(aRectIter->second.second->getMarkedObjectSnapRange());
+
+ if(!aSnapRange.isEmpty())
+ {
+ _rBound.Union(
+ Rectangle(
+ (sal_Int32)floor(aSnapRange.getMinX()), (sal_Int32)floor(aSnapRange.getMinY()),
+ (sal_Int32)ceil(aSnapRange.getMaxX()), (sal_Int32)ceil(aSnapRange.getMaxY())));
+ }
+ }
}
}
}
@@ -819,7 +845,7 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli
Point aCenter(aBound.Center());
SdrObjTransformInfoRec aInfo;
pObj->TakeObjInfo(aInfo);
- if (aInfo.bMoveAllowed && !pObj->IsMoveProtect())
+ if (aInfo.mbMoveAllowed && !pObj->IsMoveProtect())
{
long nXMov = 0;
long nYMov = 0;
@@ -866,7 +892,9 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli
if ( pView == aInterSectRectIter->second.second && (dynamic_cast<OUnoObject*>(aInterSectRectIter->second.first) || dynamic_cast<OOle2Obj*>(aInterSectRectIter->second.first)))
{
SdrObject* pPreviousObj = aInterSectRectIter->second.first;
- Rectangle aIntersectRect = aTest.GetIntersection(_bBoundRects ? pPreviousObj->GetCurrentBoundRect() : pPreviousObj->GetSnapRect());
+ Rectangle aIntersectRect(aTest.GetIntersection(_bBoundRects
+ ? sdr::legacy::GetBoundRect(*pPreviousObj)
+ : sdr::legacy::GetSnapRect(*pPreviousObj)));
if ( !aIntersectRect.IsEmpty() && (aIntersectRect.Left() != aIntersectRect.Right() && aIntersectRect.Top() != aIntersectRect.Bottom() ) )
{
*pValue = aRefFun(&aIntersectRect) - aGetFun(&aObjRect);
@@ -880,10 +908,11 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli
if ( lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification,_bBoundRects) )
{
- const Size aSize(nXMov,nYMov);
- pView->AddUndo(pView->GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj,aSize));
- pObj->Move(aSize);
- aObjRect = (_bBoundRects ? pObj->GetCurrentBoundRect() : pObj->GetSnapRect());
+ pView->AddUndo(pView->getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(nXMov, nYMov));
+ aObjRect = (_bBoundRects
+ ? sdr::legacy::GetBoundRect(*pObj)
+ : sdr::legacy::GetSnapRect(*pObj));
}
// resizing control
@@ -903,7 +932,7 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli
// run through
case ControlModification::WIDTH_SMALLEST:
case ControlModification::HEIGHT_SMALLEST:
- pView->AddUndo( pView->GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ pView->AddUndo( pView->getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
{
OObjectBase* pObjBase = dynamic_cast<OObjectBase*>(pObj);
OSL_ENSURE(pObjBase,"Where comes this object from?");
@@ -923,7 +952,8 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli
}
}
}
- pView->AdjustMarkHdl();
+
+ pView->SetMarkHandles();
}
}
// -----------------------------------------------------------------------------
@@ -988,7 +1018,6 @@ namespace
eEndAction,
eMoveAction,
eMarkAction,
- eForceToAnotherPage,
eBreakAction
};
class ApplySectionViewAction : public ::std::unary_function< OViewsWindow::TSectionsMap::value_type, void >
@@ -996,12 +1025,12 @@ namespace
private:
SectionViewAction m_eAction;
sal_Bool m_bCopy;
- Point m_aPoint;
+ basegfx::B2DPoint m_aPoint;
public:
ApplySectionViewAction( sal_Bool _bCopy ) : m_eAction( eEndDragObj ), m_bCopy( _bCopy ) { }
ApplySectionViewAction(SectionViewAction _eAction = eEndAction ) : m_eAction( _eAction ) { }
- ApplySectionViewAction( const Point& _rPoint, SectionViewAction _eAction = eMoveAction ) : m_eAction( _eAction ), m_bCopy( sal_False ), m_aPoint( _rPoint ) { }
+ ApplySectionViewAction(const basegfx::B2DPoint& _rPoint, SectionViewAction _eAction = eMoveAction ) : m_eAction( _eAction ), m_bCopy( sal_False ), m_aPoint( _rPoint ) { }
void operator() ( const OViewsWindow::TSectionsMap::value_type& _rhs )
{
@@ -1021,9 +1050,6 @@ namespace
case eMarkAction:
rView.BegMarkObj ( m_aPoint );
break;
- case eForceToAnotherPage:
- rView.ForceMarkedToAnotherPage();
- break;
case eBreakAction:
if ( rView.IsAction() )
rView.BrkAction ( );
@@ -1041,7 +1067,7 @@ void OViewsWindow::BrkAction()
::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction(eBreakAction) );
}
// -----------------------------------------------------------------------------
-void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _aRect, const OSectionView& _rSection)
+void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const basegfx::B2DRange& _aRange, const OSectionView& _rSection)
{
TSectionsMap::iterator aIter = m_aSections.begin();
TSectionsMap::iterator aEnd = m_aSections.end();
@@ -1055,24 +1081,22 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _
if ( &rView != &_rSection )
{
-// SdrRectObj *pNewObj = new SdrRectObj(OBJ_RECT, _aRect);
-// SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Temp Label")));
- SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText")));
+ SdrObject *pNewObj = new SdrUnoObj(
+ rView.getSdrModelFromSdrView(),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText")));
+
if (pNewObj)
{
- pNewObj->SetLogicRect(_aRect);
- // pNewObj->SetSize(_aRect.GetSize());
- // pNewObj->Move(Size(_aRect.Left(), _aRect.Top()));
-
- pNewObj->Move(Size(0, aNewPos.Y()));
- sal_Bool bChanged = rView.GetModel()->IsChanged();
- rReportSection.getPage()->InsertObject(pNewObj);
- rView.GetModel()->SetChanged(bChanged);
+ sdr::legacy::SetLogicRange(*pNewObj, _aRange);
+ sdr::legacy::MoveSdrObject(*pNewObj, Size(0, aNewPos.Y()));
+ sal_Bool bChanged = rView.getSdrModelFromSdrView().IsChanged();
+ rReportSection.getPage()->InsertObjectToSdrObjList(*pNewObj);
+ rView.getSdrModelFromSdrView().SetChanged(bChanged);
m_aBegDragTempList.push_back(pNewObj);
- Rectangle aRect = pNewObj->GetLogicRect();
+ const Rectangle aRect(sdr::legacy::GetLogicRect(*pNewObj));
// pNewObj->SetText(String::CreateFromAscii("Drag helper"));
- rView.MarkObj( pNewObj, rView.GetSdrPageView() );
+ rView.MarkObj( *pNewObj );
}
}
const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
@@ -1087,14 +1111,14 @@ bool OViewsWindow::isObjectInMyTempList(SdrObject *_pObj)
}
// -----------------------------------------------------------------------------
-void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection)
+void OViewsWindow::BegDragObj(const basegfx::B2DPoint& _aPnt, const SdrHdl* _pHdl, const OSectionView* _pSection)
{
- OSL_TRACE("BegDragObj Clickpoint X:%d Y:%d\n", _aPnt.X(), _aPnt.Y() );
+ OSL_TRACE("BegDragObj Clickpoint X:%f Y:%f\n", _aPnt.getX(), _aPnt.getY() );
m_aBegDragTempList.clear();
// Calculate the absolute clickpoint in the views
- Point aAbsolutePnt = _aPnt;
+ basegfx::B2DPoint aAbsolutePnt(_aPnt);
TSectionsMap::iterator aIter = m_aSections.begin();
TSectionsMap::iterator aEnd = m_aSections.end();
for (; aIter != aEnd; ++aIter)
@@ -1104,10 +1128,10 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
if (pView == _pSection)
break;
const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
- aAbsolutePnt.Y() += nSectionHeight;
+ aAbsolutePnt.setY(aAbsolutePnt.getY() + nSectionHeight);
}
- m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32);
- OSL_TRACE("BegDragObj Absolute X:%d Y:%d\n", aAbsolutePnt.X(), aAbsolutePnt.Y() );
+ m_aDragDelta = basegfx::B2DPoint(SAL_MAX_INT32, SAL_MAX_INT32);
+ OSL_TRACE("BegDragObj Absolute X:%f Y:%f\n", aAbsolutePnt.getX(), aAbsolutePnt.getY() );
// Create drag lines over all viewable Views
// Therefore we need to identify the marked objects
@@ -1116,32 +1140,28 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
OSL_TRACE("BegDragObj createInvisible Objects\n" );
int nViewCount = 0;
- Point aNewObjPos(0,0);
- Point aLeftTop = Point(SAL_MAX_INT32, SAL_MAX_INT32);
+ basegfx::B2DPoint aNewObjPos(0.0, 0.0);
+ basegfx::B2DPoint aLeftTop(SAL_MAX_INT32, SAL_MAX_INT32);
for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
{
OReportSection& rReportSection = (*aIter)->getReportSection();
-
OSectionView& rView = rReportSection.getSectionView();
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
- if ( rView.AreObjectsMarked() )
- {
- const sal_uInt32 nCount = rView.GetMarkedObjectCount();
- for (sal_uInt32 i=0; i < nCount; ++i)
+ for(sal_uInt32 i(0); i < aSelection.size(); ++i)
{
- const SdrMark* pM = rView.GetSdrMarkByIndex(i);
- SdrObject* pObj = pM->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[i];
+
if (!isObjectInMyTempList(pObj))
{
- Rectangle aRect( pObj->GetCurrentBoundRect() );
- aRect.Move(0, aNewObjPos.Y());
-
- aLeftTop.X() = ::std::min( aRect.Left(), aLeftTop.X() );
- aLeftTop.Y() = ::std::min( aRect.Top(), aLeftTop.Y() );
+ basegfx::B2DRange aRange(pObj->getObjectRange(&rView));
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(0.0, aNewObjPos.getY()));
+ aLeftTop.setX(::std::min( aRange.getMinX(), aLeftTop.getX() ));
+ aLeftTop.setY(::std::min( aRange.getMinY(), aLeftTop.getY() ));
- OSL_TRACE("BegDragObj createInvisible X:%d Y:%d on View #%d\n", aRect.Left(), aRect.Top(), nViewCount );
+ OSL_TRACE("BegDragObj createInvisible X:%g Y:%g on View #%d\n", aRange.getMinX(), aRange.getMinY(), nViewCount );
- BegDragObj_createInvisibleObjectAtPosition(aRect, rView);
+ BegDragObj_createInvisibleObjectAtPosition(aRange, rView);
// calculate the clickpoint
// const sal_Int32 nDeltaX = abs(aRect.Left() - aAbsolutePnt.X());
@@ -1152,25 +1172,22 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
// m_aDragDelta.Y() = nDeltaY;
}
}
- }
++nViewCount;
- Rectangle aClipRect = rView.GetWorkArea();
- aClipRect.Top() = -aNewObjPos.Y();
- rView.SetWorkArea( aClipRect );
+
+ basegfx::B2DRange aWorkArea(rView.GetWorkArea());
+ aWorkArea = basegfx::B2DRange(aWorkArea.getMinX(), -aNewObjPos.getY(), aWorkArea.getMaxX(), aWorkArea.getMaxY());
+ rView.SetWorkArea(aWorkArea);
const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
- aNewObjPos.Y() += nSectionHeight;
+ aNewObjPos.setY(aNewObjPos.getY() + nSectionHeight);
// don't subtract the height of the lines between the views
// aNewObjPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height();
}
- const sal_Int32 nDeltaX = abs(aLeftTop.X() - aAbsolutePnt.X());
- const sal_Int32 nDeltaY = abs(aLeftTop.Y() - aAbsolutePnt.Y());
- m_aDragDelta.X() = nDeltaX;
- m_aDragDelta.Y() = nDeltaY;
+ m_aDragDelta = absolute(aLeftTop - aAbsolutePnt);
- Point aNewPos = aAbsolutePnt;
+ basegfx::B2DPoint aNewPos(aAbsolutePnt);
// for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
// {
// OReportSection& rReportSection = (*aIter)->getReportSection();
@@ -1179,7 +1196,6 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
// aNewPos.Y() += rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
// }
- const short nDrgLog = static_cast<short>(PixelToLogic(Size(3,0)).Width());
// long nLastSectionHeight = 0;
// bool bAdd = true;
nViewCount = 0;
@@ -1203,39 +1219,36 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
// }
//?
- SdrHdl* pHdl = _pHdl;
+ const SdrHdl* pHdl = _pHdl;
if ( pHdl )
{
if ( &rReportSection.getSectionView() != _pSection )
{
const SdrHdlList& rHdlList = rReportSection.getSectionView().GetHdlList();
- pHdl = rHdlList.GetHdl(_pHdl->GetKind());
+ pHdl = rHdlList.GetHdlByKind(_pHdl->GetKind());
}
}
- OSL_TRACE("BegDragObj X:%d Y:%d on View#%d\n", aNewPos.X(), aNewPos.Y(), nViewCount++ );
- rReportSection.getSectionView().BegDragObj(aNewPos, (OutputDevice*)NULL, pHdl, nDrgLog, NULL);
+ OSL_TRACE("BegDragObj X:%f Y:%f on View#%d\n", aNewPos.getX(), aNewPos.getY(), nViewCount++ );
+ const double fTolerance(basegfx::B2DVector(GetInverseViewTransformation() * basegfx::B2DVector(3.0, 0.0)).getLength());
+ rReportSection.getSectionView().BegDragObj(aNewPos, pHdl, fTolerance, NULL);
const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
- aNewPos.Y() -= nSectionHeight;
+ aNewPos.setY(aNewPos.getY() - nSectionHeight);
// subtract the height between the views, because they are visible but not from interest here.
// aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height();
}
}
// -----------------------------------------------------------------------------
-void OViewsWindow::ForceMarkedToAnotherPage()
-{
- ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction(eForceToAnotherPage ) );
-}
-// -----------------------------------------------------------------------------
-void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection)
+void OViewsWindow::BegMarkObj(const basegfx::B2DPoint& _aPnt,const OSectionView* _pSection)
{
bool bAdd = true;
- Point aNewPos = _aPnt;
+ basegfx::B2DPoint aNewPos(_aPnt);
TSectionsMap::iterator aIter = m_aSections.begin();
TSectionsMap::iterator aEnd = m_aSections.end();
- long nLastSectionHeight = 0;
+ double fLastSectionHeight(0.0);
+
for (; aIter != aEnd; ++aIter)
{
OReportSection& rReportSection = (*aIter)->getReportSection();
@@ -1246,22 +1259,25 @@ void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection)
}
else if ( bAdd )
{
- const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
- aNewPos.Y() += nSectionHeight;
+ const double fSectionHeight(basegfx::B2DVector(rReportSection.GetInverseViewTransformation() *
+ basegfx::B2DVector(rReportSection.GetOutputSizePixel().getWidth(), 0.0)).getLength());
+ aNewPos.setY(aNewPos.getY() + fSectionHeight);
}
else
{
- aNewPos.Y() -= nLastSectionHeight;
+ aNewPos.setY(aNewPos.getY() - fLastSectionHeight);
}
+
rReportSection.getSectionView().BegMarkObj ( aNewPos );
- nLastSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ fLastSectionHeight = basegfx::B2DVector(rReportSection.GetInverseViewTransformation() *
+ basegfx::B2DVector(rReportSection.GetOutputSizePixel().getWidth(), 0.0)).getLength();
// aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height();
}
//::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( _aPnt , eMarkAction) );
}
// -----------------------------------------------------------------------------
-OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pSection,Point& _rPnt)
+OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pSection,basegfx::B2DPoint& _rPnt)
{
OSectionView* pSection = NULL;
sal_Int32 nCount = 0;
@@ -1274,16 +1290,16 @@ OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pS
break;
}
OSL_ENSURE(aIter != aEnd,"This can never happen!");
- if ( _rPnt.Y() < 0 )
+ if ( _rPnt.getY() < 0.0 )
{
if ( nCount )
--aIter;
- for (; nCount && (_rPnt.Y() < 0); --nCount)
+ for (; nCount && (_rPnt.getY() < 0.0); --nCount)
{
OReportSection& rReportSection = (*aIter)->getReportSection();
const sal_Int32 nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
- _rPnt.Y() += nHeight;
- if ( (nCount -1) > 0 && (_rPnt.Y() < 0) )
+ _rPnt.setY(_rPnt.getY() + nHeight);
+ if ( (nCount -1) > 0 && (_rPnt.getY() < 0.0) )
--aIter;
}
if ( nCount == 0 )
@@ -1297,9 +1313,9 @@ OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pS
{
OReportSection& rReportSection = (*aIter)->getReportSection();
const long nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
- if ( (_rPnt.Y() - nHeight) < 0 )
+ if ( (_rPnt.getY() - nHeight) < 0.0 )
break;
- _rPnt.Y() -= nHeight;
+ _rPnt.setY(_rPnt.getY() - nHeight);
}
if ( aIter != aEnd )
pSection = &(*aIter)->getReportSection().getSectionView();
@@ -1322,12 +1338,12 @@ void OViewsWindow::EndDragObj_removeInvisibleObjects()
}
}
// -----------------------------------------------------------------------------
-void OViewsWindow::EndDragObj(sal_Bool _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt)
+void OViewsWindow::EndDragObj(sal_Bool _bControlKeyPressed, const OSectionView* _pSection,const basegfx::B2DPoint& _aPnt)
{
const String sUndoAction = String((ModuleRes(RID_STR_UNDO_CHANGEPOSITION)));
const UndoContext aUndoContext( getView()->getReportView()->getController().getUndoManager(), sUndoAction );
- Point aNewPos = _aPnt;
+ basegfx::B2DPoint aNewPos(_aPnt);
OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aNewPos);
if (!_bControlKeyPressed &&
(_pSection && ( _pSection->IsDragResize() == false ) ) && /* Not in resize mode */
@@ -1367,12 +1383,12 @@ void OViewsWindow::EndDragObj(sal_Bool _bControlKeyPressed, const OSectionView*
const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
- if ( aNewPos.X() < nLeftMargin )
- aNewPos.X() = nLeftMargin;
- if ( aNewPos.Y() < 0 )
- aNewPos.Y() = 0;
+ if ( aNewPos.getX() < nLeftMargin )
+ aNewPos.setX(nLeftMargin);
+ if ( aNewPos.getY() < 0.0 )
+ aNewPos.setY(0.0);
- Point aPrevious;
+ basegfx::B2DPoint aPrevious;
for (; pIter != pEnd; ++pIter)
{
uno::Sequence< uno::Reference<report::XReportComponent> > aClones;
@@ -1384,34 +1400,34 @@ void OViewsWindow::EndDragObj(sal_Bool _bControlKeyPressed, const OSectionView*
for (; pColIter != pColEnd; ++pColIter)
{
uno::Reference< report::XReportComponent> xRC(*pColIter);
- aPrevious = VCLPoint(xRC->getPosition());
+ aPrevious = basegfx::B2DPoint(xRC->getPosition().X, xRC->getPosition().Y);
awt::Size aSize = xRC->getSize();
- if ( aNewPos.X() < nLeftMargin )
+ if ( aNewPos.getX() < nLeftMargin )
{
- aNewPos.X() = nLeftMargin;
+ aNewPos.setX(nLeftMargin);
}
- else if ( (aNewPos.X() + aSize.Width) > (nPaperWidth - nRightMargin) )
+ else if ( (aNewPos.getX() + aSize.Width) > (nPaperWidth - nRightMargin) )
{
- aNewPos.X() = nPaperWidth - nRightMargin - aSize.Width;
+ aNewPos.setX(nPaperWidth - nRightMargin - aSize.Width);
}
- if ( aNewPos.Y() < 0 )
+ if ( aNewPos.getY() < 0.0 )
{
- aNewPos.Y() = 0;
+ aNewPos.setY(0.0);
}
- if ( aNewPos.X() < 0 )
+ if ( aNewPos.getX() < 0.0 )
{
- aSize.Width += aNewPos.X();
- aNewPos.X()= 0;
+ aSize.Width += basegfx::fround(aNewPos.getX());
+ aNewPos.setX(0.0);
xRC->setSize(aSize);
}
- xRC->setPosition(AWTPoint(aNewPos));
+ xRC->setPosition(::com::sun::star::awt::Point(basegfx::fround(aNewPos.getX()), basegfx::fround(aNewPos.getY())));
if ( (pColIter+1) != pColEnd )
{
// bring aNewPos to the position of the next object
uno::Reference< report::XReportComponent> xRCNext(*(pColIter + 1),uno::UNO_QUERY);
- Point aNextPosition = VCLPoint(xRCNext->getPosition());
- aNewPos += (aNextPosition - aPrevious);
+ const basegfx::B2DPoint aNextPosition(xRCNext->getPosition().X, xRCNext->getPosition().Y);
+ aNewPos += aNextPosition - aPrevious;
}
}
}
@@ -1427,7 +1443,7 @@ void OViewsWindow::EndDragObj(sal_Bool _bControlKeyPressed, const OSectionView*
::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( sal_False ) );
EndDragObj_removeInvisibleObjects();
}
- m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32);
+ m_aDragDelta = basegfx::B2DPoint(SAL_MAX_INT32, SAL_MAX_INT32);
}
// -----------------------------------------------------------------------------
void OViewsWindow::EndAction()
@@ -1435,19 +1451,19 @@ void OViewsWindow::EndAction()
::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction() );
}
// -----------------------------------------------------------------------------
-void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bool _bMove, bool _bControlKeySet)
+void OViewsWindow::MovAction(const basegfx::B2DPoint& _aPnt,const OSectionView* _pSection,bool _bMove, bool _bControlKeySet)
{
(void)_bMove;
- Point aRealMousePos = _aPnt;
- Point aCurrentSectionPos;
- OSL_TRACE("MovAction X:%d Y:%d\n", aRealMousePos.X(), aRealMousePos.Y() );
+ basegfx::B2DPoint aRealMousePos(_aPnt);
+ basegfx::B2DPoint aCurrentSectionPos(0.0, 0.0);
+ OSL_TRACE("MovAction X:%g Y:%g\n", aRealMousePos.getX(), aRealMousePos.getY() );
- Point aHdlPos;
+ basegfx::B2DPoint aHdlPos;
SdrHdl* pHdl = _pSection->GetDragHdl();
if ( pHdl )
{
- aHdlPos = pHdl->GetPos();
+ aHdlPos = pHdl->getPosition();
}
TSectionsMap::iterator aIter/* = m_aSections.begin() */;
@@ -1461,37 +1477,34 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo
if ( &rReportSection.getSectionView() == _pSection )
break;
const long nSectionHeight = (*aIter)->PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
- aCurrentSectionPos.Y() += nSectionHeight;
+ aCurrentSectionPos.setY(aCurrentSectionPos.getY() + nSectionHeight);
} // for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
//}
aRealMousePos += aCurrentSectionPos;
// If control key is pressed the work area is limited to the section with the current selection.
- Point aPosForWorkArea(0,0);
+ basegfx::B2DPoint aPosForWorkArea(0.0, 0.0);
for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
{
OReportSection& rReportSection = (*aIter)->getReportSection();
OSectionView& rView = rReportSection.getSectionView();
const long nSectionHeight = (*aIter)->PixelToLogic((*aIter)->GetOutputSizePixel()).Height();
+ basegfx::B2DPoint aClipTopLeft(rView.GetWorkArea().getMinimum());
+ basegfx::B2DPoint aClipBottomRight(rView.GetWorkArea().getMaximum());
if (_bControlKeySet)
{
- Rectangle aClipRect = rView.GetWorkArea();
- aClipRect.Top() = aCurrentSectionPos.Y() - aPosForWorkArea.Y();
- // if (aClipRect.Top() < 0) aClipRect.Top() = 0;
- aClipRect.Bottom() = aClipRect.Top() + nSectionHeight;
- rView.SetWorkArea( aClipRect );
+ aClipTopLeft.setY(aCurrentSectionPos.getY() - aPosForWorkArea.getY());
+ aClipBottomRight.setY(aClipTopLeft.getY() + nSectionHeight);
}
else
{
- Rectangle aClipRect = rView.GetWorkArea();
- aClipRect.Top() = -aPosForWorkArea.Y();
- rView.SetWorkArea( aClipRect );
- }
- aPosForWorkArea.Y() += nSectionHeight;
- // aNewPos.Y() += PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+ aClipTopLeft.setY(aClipTopLeft.getY() - aPosForWorkArea.getY());
}
+ rView.SetWorkArea(basegfx::B2DRange(aClipTopLeft, aClipBottomRight));
+ aPosForWorkArea.setY(aPosForWorkArea.getY() + nSectionHeight);
+ }
for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
{
@@ -1499,69 +1512,13 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo
SdrHdl* pCurrentHdl = rReportSection.getSectionView().GetDragHdl();
if ( pCurrentHdl )
{
- if ( aRealMousePos.Y() > 0 )
- aRealMousePos = _aPnt + pCurrentHdl->GetPos() - aHdlPos;
+ if ( aRealMousePos.getY() > 0.0 )
+ aRealMousePos = _aPnt + pCurrentHdl->getPosition() - aHdlPos;
}
rReportSection.getSectionView().MovAction ( aRealMousePos );
const long nSectionHeight = (*aIter)->PixelToLogic((*aIter)->GetOutputSizePixel()).Height();
- aRealMousePos.Y() -= nSectionHeight;
- }
-#if 0
-#if OSL_DEBUG_LEVEL > 0
- // TEST TEST TEST TEST
- // Ich versuche gerade rauszubekommen, ob ich ein Object bewege oder nur resize.
- // TEST TEST TEST TEST
-
- for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
- {
- OReportSection& rReportSection = (*aIter)->getReportSection();
- OSectionView& rView = rReportSection.getSectionView();
- if ( rView.AreObjectsMarked() )
- {
- rView.SortMarkedObjects();
- const sal_uInt32 nCount = rView.GetMarkedObjectCount();
- for (sal_uInt32 i=0; i < nCount; ++i)
- {
- const SdrMark* pM = rView.GetSdrMarkByIndex(i);
- SdrObject* pObj = pM->GetMarkedSdrObj();
- (void)pObj;
-
- int dummy = 0;
- (void)dummy;
- }
- }
-
- /*
- OReportSection& rReportSection = (*aIter)->getReportSection();
- OSectionView& rView = rReportSection.getSectionView();
- const SdrHdlList& rHdlList = rView.GetHdlList();
- SdrHdl* pHdl2 = rHdlList.GetFocusHdl();
-
- if ( pHdl2 != 0 )
- {
- SdrHdlKind eKind = pHdl->GetKind();
- int dummy = 0;
- switch(eKind)
- {
- case HDL_UPLFT: // Oben links
- case HDL_UPPER: // Oben
- case HDL_UPRGT: // Oben rechts
- case HDL_LEFT: // Links
- case HDL_RIGHT: // Rechts
- case HDL_LWLFT: // Unten links
- case HDL_LOWER: // Unten
- case HDL_LWRGT: // Unten rechts
- dummy = 1;
- break;
- default:
- dummy = 0;
- }
- }
- */
+ aRealMousePos.setY(aRealMousePos.getY() - nSectionHeight);
}
- // TEST TEST TEST TEST
-#endif
-#endif
}
// -----------------------------------------------------------------------------
sal_Bool OViewsWindow::IsAction() const
@@ -1590,7 +1547,7 @@ sal_uInt32 OViewsWindow::getMarkedObjectCount() const
TSectionsMap::const_iterator aIter = m_aSections.begin();
TSectionsMap::const_iterator aEnd = m_aSections.end();
for (; aIter != aEnd; ++aIter)
- nCount += (*aIter)->getReportSection().getSectionView().GetMarkedObjectCount();
+ nCount += (*aIter)->getReportSection().getSectionView().getSelectedSdrObjectCount();
return nCount;
}
// -----------------------------------------------------------------------------
@@ -1611,32 +1568,29 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
for (; aIter != aEnd; ++aIter)
{
OReportSection& rReportSection = (*aIter)->getReportSection();
- long nX = 0;
- long nY = 0;
+ basegfx::B2DVector aMove(0.0, 0.0);
if ( nCode == KEY_UP )
- nY = -1;
+ aMove.setY(-1.0);
else if ( nCode == KEY_DOWN )
- nY = 1;
+ aMove.setY(1.0);
else if ( nCode == KEY_LEFT )
- nX = -1;
+ aMove.setX(-1.0);
else if ( nCode == KEY_RIGHT )
- nX = 1;
+ aMove.setX(1.0);
- if ( rReportSection.getSectionView().AreObjectsMarked() )
+ if ( rReportSection.getSectionView().areSdrObjectsSelected() )
{
if ( _rCode.IsMod2() )
{
// move in 1 pixel distance
const Size aPixelSize = rReportSection.PixelToLogic( Size( 1, 1 ) );
- nX *= aPixelSize.Width();
- nY *= aPixelSize.Height();
+ aMove *= basegfx::B2DVector(aPixelSize.getWidth(), aPixelSize.getHeight());
}
else
{
// move in 1 mm distance
- nX *= DEFAUL_MOVE_SIZE;
- nY *= DEFAUL_MOVE_SIZE;
+ aMove *= DEFAUL_MOVE_SIZE;
}
OSectionView& rView = rReportSection.getSectionView();
@@ -1649,79 +1603,96 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
if ( rView.IsMoveAllowed() )
{
// restrict movement to work area
- Rectangle rWorkArea = rView.GetWorkArea();
- rWorkArea.Right()++;
+ basegfx::B2DRange aWorkArea(rView.GetWorkArea());
- if ( !rWorkArea.IsEmpty() )
+ if ( !aWorkArea.isEmpty() )
+ {
+ if ( aWorkArea.getMinY() < 0.0 )
{
- if ( rWorkArea.Top() < 0 )
- rWorkArea.Top() = 0;
- Rectangle aMarkRect( rView.GetMarkedObjRect() );
- aMarkRect.Move( nX, nY );
+ aWorkArea = basegfx::B2DRange(aWorkArea.getMinX(), 0.0, aWorkArea.getMaxX(), aWorkArea.getMaxY());
+ }
+
+ basegfx::B2DRange aMarkRange( rView.getMarkedObjectSnapRange() );
+ aMarkRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aMove));
- if ( !rWorkArea.IsInside( aMarkRect ) )
+ if ( !aWorkArea.isInside( aMarkRange ) )
{
- if ( aMarkRect.Left() < rWorkArea.Left() )
- nX += rWorkArea.Left() - aMarkRect.Left();
+ if ( aMarkRange.getMinX() < aWorkArea.getMinX() )
+ {
+ aMove.setX(aMove.getX() + aWorkArea.getMinX() - aMarkRange.getMinX());
+ }
- if ( aMarkRect.Right() > rWorkArea.Right() )
- nX -= aMarkRect.Right() - rWorkArea.Right();
+ if ( aMarkRange.getMaxX() > aWorkArea.getMaxX() )
+ {
+ aMove.setX(aMove.getX() - aMarkRange.getMaxX() - aWorkArea.getMaxX());
+ }
- if ( aMarkRect.Top() < rWorkArea.Top() )
- nY += rWorkArea.Top() - aMarkRect.Top();
+ if ( aMarkRange.getMinY() < aWorkArea.getMinY() )
+ {
+ aMove.setY(aMove.getY() + aWorkArea.getMinY() - aMarkRange.getMinY());
+ }
- if ( aMarkRect.Bottom() > rWorkArea.Bottom() )
- nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
+ if ( aMarkRange.getMaxY() > aWorkArea.getMaxY() )
+ {
+ aMove.setY(aMove.getY() - aMarkRange.getMaxY() - aWorkArea.getMaxY());
}
+ }
+
bool bCheck = false;
- const SdrMarkList& rMarkList = rView.GetMarkedObjectList();
- for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i )
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 i(0); !bCheck && i < aSelection.size(); ++i )
{
- SdrMark* pMark = rMarkList.GetMark(i);
- bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL|| dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj());
+ bCheck = dynamic_cast< OUnoObject* >(aSelection[i]) != NULL
+ || dynamic_cast< OOle2Obj* >(aSelection[i]) != NULL;
}
-
if ( bCheck )
{
- SdrObject* pOverlapped = isOver(aMarkRect,*rReportSection.getPage(),rView);
+ SdrObject* pOverlapped = isOver(aMarkRange,*rReportSection.getPage(),rView);
if ( pOverlapped )
{
do
{
- Rectangle aOver = pOverlapped->GetLastBoundRect();
- Point aPos;
+ const basegfx::B2DRange& rOver = pOverlapped->getObjectRange(&rView);
+ basegfx::B2DPoint aPos(0.0, 0.0);
if ( nCode == KEY_UP )
{
- aPos.X() = aMarkRect.Left();
- aPos.Y() = aOver.Top() - aMarkRect.getHeight();
- nY += (aPos.Y() - aMarkRect.Top());
+ aPos.setX(aMarkRange.getMinX());
+ aPos.setY(rOver.getMinY() - aMarkRange.getHeight());
+ aMove.setY(aMove.getY() + (aPos.getY() - aMarkRange.getMinY()));
}
else if ( nCode == KEY_DOWN )
{
- aPos.X() = aMarkRect.Left();
- aPos.Y() = aOver.Bottom();
- nY += (aPos.Y() - aMarkRect.Top());
+ aPos.setX(aMarkRange.getMinX());
+ aPos.setY(rOver.getMaxY());
+ aMove.setY(aMove.getY() + (aPos.getY() - aMarkRange.getMinY()));
}
else if ( nCode == KEY_LEFT )
{
- aPos.X() = aOver.Left() - aMarkRect.getWidth();
- aPos.Y() = aMarkRect.Top();
- nX += (aPos.X() - aMarkRect.Left());
+ aPos.setX(rOver.getMinX() - aMarkRange.getWidth());
+ aPos.setY(aMarkRange.getMinY());
+ aMove.setX(aMove.getX() + (aPos.getX() - aMarkRange.getMinX()));
}
else if ( nCode == KEY_RIGHT )
{
- aPos.X() = aOver.Right();
- aPos.Y() = aMarkRect.Top();
- nX += (aPos.X() - aMarkRect.Left());
+ aPos.setX(rOver.getMaxX());
+ aPos.setY(aMarkRange.getMinY());
+ aMove.setX(aMove.getX() + (aPos.getX() - aMarkRange.getMinX()));
}
- aMarkRect.SetPos(aPos);
- if ( !rWorkArea.IsInside( aMarkRect ) )
+ aMarkRange = basegfx::B2DRange(
+ aPos.getX(),
+ aPos.getY(),
+ aPos.getX() + aMarkRange.getWidth(),
+ aPos.getY() + aMarkRange.getHeight());
+
+ if ( !aWorkArea.isInside( aMarkRange ) )
{
break;
}
- pOverlapped = isOver(aMarkRect,*rReportSection.getPage(),rView);
+
+ pOverlapped = isOver(aMarkRange,*rReportSection.getPage(),rView);
}
while(pOverlapped != NULL);
if (pOverlapped != NULL)
@@ -1730,45 +1701,46 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
}
}
- if ( nX != 0 || nY != 0 )
+ if ( !aMove.equalZero() )
{
- rView.MoveAllMarked( Size( nX, nY ) );
- rView.MakeVisible( rView.GetAllMarkedRect(), rReportSection);
+ rView.MoveMarkedObj(aMove);
+ rView.MakeVisibleAtView( rView.getMarkedObjectSnapRange(), rReportSection);
}
}
}
else
{
// move the handle
- if ( pHdl && ( nX || nY ) )
+ if ( pHdl && !aMove.equalZero() )
{
- const Point aStartPoint( pHdl->GetPos() );
- const Point aEndPoint( pHdl->GetPos() + Point( nX, nY ) );
+ const basegfx::B2DPoint aStartPoint( pHdl->getPosition() );
+ const basegfx::B2DPoint aEndPoint( pHdl->getPosition() + aMove );
const SdrDragStat& rDragStat = rView.GetDragStat();
// start dragging
- rView.BegDragObj( aStartPoint, 0, pHdl, 0 );
+ rView.BegDragObj( aStartPoint, pHdl, 0.0 );
if ( rView.IsDragObj() )
{
- const FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
- const sal_Bool bWasSnapEnabled = rView.IsSnapEnabled();
+ const bool bWasNoSnap = rDragStat.IsNoSnap();
+ const bool bWasSnapEnabled = rView.IsSnapEnabled();
// switch snapping off
if ( !bWasNoSnap )
- ((SdrDragStat&)rDragStat).SetNoSnap( sal_True );
+ ((SdrDragStat&)rDragStat).SetNoSnap( true );
if ( bWasSnapEnabled )
- rView.SetSnapEnabled( sal_False );
+ rView.SetSnapEnabled( false );
- Rectangle aNewRect;
+ basegfx::B2DRange aNewRange;
bool bCheck = false;
- const SdrMarkList& rMarkList = rView.GetMarkedObjectList();
- for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i )
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 i(0); !bCheck && i < aSelection.size(); ++i )
{
- SdrMark* pMark = rMarkList.GetMark(i);
- bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL || dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj()) != NULL;
+ bCheck = dynamic_cast< OUnoObject* >(aSelection[i]) != NULL
+ || dynamic_cast< OOle2Obj* >(aSelection[i]) != NULL;
if ( bCheck )
- aNewRect.Union(pMark->GetMarkedSdrObj()->GetLastBoundRect());
+ aNewRange.expand(aSelection[i]->getObjectRange(&rView));
}
switch(pHdl->GetKind())
@@ -1777,21 +1749,27 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
case HDL_UPLFT:
case HDL_LWLFT:
case HDL_UPPER:
- aNewRect.Left() += nX;
- aNewRect.Top() += nY;
+ aNewRange = basegfx::B2DRange(
+ aNewRange.getMinimum() + aMove,
+ aNewRange.getMaximum());
break;
case HDL_UPRGT:
case HDL_RIGHT:
case HDL_LWRGT:
case HDL_LOWER:
- aNewRect.setWidth(aNewRect.getWidth() + nX);
- aNewRect.setHeight(aNewRect.getHeight() + nY);
+ aNewRange = basegfx::B2DRange(
+ aNewRange.getMinimum(),
+ aNewRange.getMinimum() + aMove);
break;
default:
break;
}
- if ( !(bCheck && isOver(aNewRect,*rReportSection.getPage(),rView)) )
+
+ if ( !(bCheck && isOver(aNewRange,*rReportSection.getPage(),rView)) )
+ {
rView.MovAction(aEndPoint);
+ }
+
rView.EndDragObj();
// restore snap
@@ -1802,11 +1780,15 @@ void OViewsWindow::handleKey(const KeyCode& _rCode)
}
// make moved handle visible
- const Rectangle aVisRect( aEndPoint - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) );
- rView.MakeVisible( aVisRect, rReportSection);
+ const basegfx::B2DRange aRange(
+ aEndPoint - basegfx::B2DPoint(DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE),
+ aEndPoint + basegfx::B2DPoint(DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE));
+
+ rView.MakeVisibleAtView( aRange, rReportSection);
}
}
- rView.AdjustMarkHdl();
+
+ rView.SetMarkHandles();
}
}
}
diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx
index 1585dee4da70..7e4fddb769a0 100644
--- a/reportdesign/source/ui/report/dlgedfac.cxx
+++ b/reportdesign/source/ui/report/dlgedfac.cxx
@@ -33,6 +33,8 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
#include <svx/svdoole2.hxx>
+#include <svx/sdrobjectfactory.hxx>
+
namespace rptui
{
using namespace ::com::sun::star;
@@ -55,51 +57,87 @@ DlgEdFactory::~DlgEdFactory()
IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
{
- if ( pObjFactory->nInventor == ReportInventor )
+ if ( pObjFactory->getSdrObjectCreationInfo().getInvent() == ReportInventor )
{
- switch( pObjFactory->nIdentifier )
+ switch( pObjFactory->getSdrObjectCreationInfo().getIdent() )
{
case OBJ_DLG_FIXEDTEXT:
- pObjFactory->pNewObj = new OUnoObject( SERVICE_FIXEDTEXT
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))
- ,OBJ_DLG_FIXEDTEXT);
+ {
+ pObjFactory->setNewSdrObject(
+ new OUnoObject(
+ pObjFactory->getTargetModel(),
+ SERVICE_FIXEDTEXT
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))
+ ,OBJ_DLG_FIXEDTEXT));
break;
+ }
case OBJ_DLG_IMAGECONTROL:
- pObjFactory->pNewObj = new OUnoObject( SERVICE_IMAGECONTROL
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"))
- ,OBJ_DLG_IMAGECONTROL);
+ {
+ pObjFactory->setNewSdrObject(
+ new OUnoObject(
+ pObjFactory->getTargetModel(),
+ SERVICE_IMAGECONTROL
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"))
+ ,OBJ_DLG_IMAGECONTROL));
break;
+ }
case OBJ_DLG_FORMATTEDFIELD:
- pObjFactory->pNewObj = new OUnoObject( SERVICE_FORMATTEDFIELD
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"))
- ,OBJ_DLG_FORMATTEDFIELD);
+ {
+ pObjFactory->setNewSdrObject(
+ new OUnoObject(
+ pObjFactory->getTargetModel(),
+ SERVICE_FORMATTEDFIELD
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"))
+ ,OBJ_DLG_FORMATTEDFIELD));
break;
+ }
case OBJ_DLG_VFIXEDLINE:
case OBJ_DLG_HFIXEDLINE:
+ {
+ OUnoObject* pObj = new OUnoObject(
+ pObjFactory->getTargetModel(),
+ SERVICE_FIXEDLINE
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel"))
+ ,pObjFactory->getSdrObjectCreationInfo().getIdent());
+ pObjFactory->setNewSdrObject(pObj);
+ if ( pObjFactory->getSdrObjectCreationInfo().getIdent() == OBJ_DLG_HFIXEDLINE )
{
- OUnoObject* pObj = new OUnoObject( SERVICE_FIXEDLINE
- ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel"))
- ,pObjFactory->nIdentifier);
- pObjFactory->pNewObj = pObj;
- if ( pObjFactory->nIdentifier == OBJ_DLG_HFIXEDLINE )
- {
- uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent();
- xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) );
- }
+ uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent();
+ xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) );
}
break;
+ }
case OBJ_CUSTOMSHAPE:
- pObjFactory->pNewObj = new OCustomShape(SERVICE_SHAPE);
+ {
+ pObjFactory->setNewSdrObject(
+ new OCustomShape(
+ pObjFactory->getTargetModel(),
+ SERVICE_SHAPE));
break;
+ }
case OBJ_DLG_SUBREPORT:
- pObjFactory->pNewObj = new OOle2Obj(SERVICE_REPORTDEFINITION,OBJ_DLG_SUBREPORT);
+ {
+ pObjFactory->setNewSdrObject(
+ new OOle2Obj(
+ pObjFactory->getTargetModel(),
+ SERVICE_REPORTDEFINITION,
+ OBJ_DLG_SUBREPORT));
break;
+ }
case OBJ_OLE2:
- pObjFactory->pNewObj = new OOle2Obj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.ChartDocument")),OBJ_OLE2);
+ {
+ pObjFactory->setNewSdrObject(
+ new OOle2Obj(
+ pObjFactory->getTargetModel(),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.ChartDocument")),
+ OBJ_OLE2));
break;
+ }
default:
+ {
OSL_ENSURE(0,"Unknown object id");
break;
+ }
}
}
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index f12e1a992901..e72f39845b3e 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -39,6 +39,8 @@
#include <svx/svdoashp.hxx>
#include <svx/svxids.hrc>
#include <svx/svditer.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -70,49 +72,47 @@ using namespace ::com::sun::star;
IMPL_LINK( DlgEdFunc, ScrollTimeout, Timer *, )
{
- ForceScroll( m_pParent->PixelToLogic( m_pParent->GetPointerPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(m_pParent->GetPointerPosPixel().X(), m_pParent->GetPointerPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(m_pParent->GetInverseViewTransformation() * aPixelPos);
+ ForceScroll( aLogicPos );
return 0;
}
//----------------------------------------------------------------------------
-void DlgEdFunc::ForceScroll( const Point& rPos )
+void DlgEdFunc::ForceScroll( const basegfx::B2DPoint& rPos )
{
aScrollTimer.Stop();
OReportWindow* pReportWindow = m_pParent->getSectionWindow()->getViewsWindow()->getView();
OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow();
+ const double fStartWidth(REPORT_STARTMARKER_WIDTH * double(m_pParent->GetMapMode().GetScaleX()));
+ basegfx::B2DRange aOutRange(basegfx::B2DTuple(pScrollWindow->getThumbPos().X(), pScrollWindow->getThumbPos().Y()));
+ basegfx::B2DRange aWorkArea(0.0, 0.0,
+ pScrollWindow->getTotalSize().Width() - fStartWidth,
+ pScrollWindow->getTotalSize().Height());
- Size aOut = pReportWindow->GetOutputSizePixel();
- Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
- aStartWidth *= m_pParent->GetMapMode().GetScaleX();
-
- aOut.Width() -= (long)aStartWidth;
- aOut.Height() = m_pParent->GetOutputSizePixel().Height();
-
- Point aPos = pScrollWindow->getThumbPos();
- aPos.X() *= 0.5;
- aPos.Y() *= 0.5;
- Rectangle aOutRect( aPos, aOut );
- aOutRect = m_pParent->PixelToLogic( aOutRect );
- //Rectangle aWorkArea = m_pParent->getView()->GetWorkArea();
- Point aGcc3WorkaroundTemporary;
- Rectangle aWorkArea(aGcc3WorkaroundTemporary,pScrollWindow->getTotalSize());
- aWorkArea.Right() -= (long)aStartWidth;
- aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
- if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
+ aOutRange.expand(aOutRange.getMinimum() + basegfx::B2DVector(
+ pReportWindow->GetOutputSizePixel().Width() - fStartWidth,
+ pReportWindow->GetOutputSizePixel().Height()));
+
+ aOutRange.transform(m_pParent->GetInverseViewTransformation());
+ aWorkArea.transform(pScrollWindow->GetInverseViewTransformation());
+
+ if( !aOutRange.isInside( rPos ) && aWorkArea.isInside( rPos ) )
{
ScrollBar* pHScroll = pScrollWindow->GetHScroll();
ScrollBar* pVScroll = pScrollWindow->GetVScroll();
ScrollType eH = SCROLL_LINEDOWN,eV = SCROLL_LINEDOWN;
- if( rPos.X() < aOutRect.Left() )
+
+ if( rPos.getX() < aOutRange.getMinX() )
eH = SCROLL_LINEUP;
- else if( rPos.X() <= aOutRect.Right() )
+ else if( rPos.getX() <= aOutRange.getMaxX() )
eH = SCROLL_DONTKNOW;
- if( rPos.Y() < aOutRect.Top() )
+ if( rPos.getY() < aOutRange.getMinY() )
eV = SCROLL_LINEUP;
- else if( rPos.Y() <= aOutRect.Bottom() )
+ else if( rPos.getY() <= aOutRange.getMaxY() )
eV = SCROLL_DONTKNOW;
pHScroll->DoScrollAction(eH);
@@ -135,7 +135,7 @@ DlgEdFunc::DlgEdFunc( OReportSection* _pParent )
{
// m_pParent = _pParent;
aScrollTimer.SetTimeoutHdl( LINK( this, DlgEdFunc, ScrollTimeout ) );
- m_rView.SetActualWin( m_pParent);
+ m_rView.SetActualOutDev( m_pParent);
aScrollTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
}
@@ -187,7 +187,7 @@ DlgEdFunc::~DlgEdFunc()
sal_Bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
{
- m_aMDPos = m_pParent->PixelToLogic( rMEvt.GetPosPixel() );
+ m_aMDPos = m_pParent->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
m_pParent->GrabFocus();
sal_Bool bHandled = sal_False;
if ( rMEvt.IsLeft() )
@@ -216,7 +216,7 @@ sal_Bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
//m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(m_pView);
// if selected object was hit, drag object
- if ( pHdl!=NULL || m_rView.IsMarkedHit(m_aMDPos) )
+ if ( pHdl!=NULL || m_rView.IsMarkedObjHit(m_aMDPos) )
{
bHandled = sal_True;
m_pParent->CaptureMouse();
@@ -226,12 +226,11 @@ sal_Bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
}
else if ( rMEvt.IsRight() && !rMEvt.IsLeft() && rMEvt.GetClicks() == 1 ) // mark object when context menu was selected
{
- SdrPageView* pPV = m_rView.GetSdrPageView();
SdrViewEvent aVEvt;
if ( m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt) != SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() )
m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
- if ( aVEvt.pRootObj )
- m_rView.MarkObj(aVEvt.pRootObj, pPV);
+ if ( aVEvt.mpRootObj )
+ m_rView.MarkObj(*aVEvt.mpRootObj);
else
m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
@@ -260,16 +259,12 @@ void DlgEdFunc::checkTwoCklicks(const MouseEvent& rMEvt)
const sal_uInt16 nClicks = rMEvt.GetClicks();
if ( nClicks == 2 && rMEvt.IsLeft() )
{
- if ( m_rView.AreObjectsMarked() )
- {
- const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ SdrObject* pSelected = m_rView.getSelectedIfSingle();
+
+ if(pSelected)
{
- const SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- activateOle(pObj);
- } // if (rMarkList.GetMarkCount() == 1)
- } // if ( pView->AreObjectsMarked() )
+ activateOle(*pSelected);
+ }
}
}
// -----------------------------------------------------------------------------
@@ -310,7 +305,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent)
m_rView.SdrEndTextEdit();
bReturn = sal_True;
}
- else if ( m_rView.AreObjectsMarked() )
+ else if ( m_rView.areSdrObjectsSelected() )
{
const SdrHdlList& rHdlList = m_rView.GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
@@ -341,8 +336,10 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent)
m_rView.MarkNextObj( !rCode.IsShift() );
}
- if ( m_rView.AreObjectsMarked() )
- m_rView.MakeVisible( m_rView.GetAllMarkedRect(), *m_pParent);
+ if ( m_rView.areSdrObjectsSelected() )
+ {
+ m_rView.MakeVisibleAtView( m_rView.getMarkedObjectSnapRange(), *m_pParent);
+ }
bReturn = sal_True;
}
@@ -356,9 +353,11 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent)
SdrHdl* pHdl = rHdlList.GetFocusHdl();
if ( pHdl )
{
- Point aHdlPosition( pHdl->GetPos() );
- Rectangle aVisRect( aHdlPosition - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) );
- m_rView.MakeVisible( aVisRect, *m_pParent);
+ const basegfx::B2DRange aRange(
+ pHdl->getPosition() - basegfx::B2DPoint(DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE),
+ pHdl->getPosition() + basegfx::B2DPoint(DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE));
+
+ m_rView.MakeVisibleAtView( aRange, *m_pParent);
}
bReturn = sal_True;
@@ -377,11 +376,11 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent)
case KEY_RETURN:
if ( !rCode.IsMod1() )
{
- const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
- if ( rMarkList.GetMarkCount() == 1 )
+ SdrObject* pSelected = m_rView.getSelectedIfSingle();
+
+ if ( pSelected )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- activateOle(pObj);
+ activateOle(*pSelected);
}
}
break;
@@ -406,46 +405,36 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent)
return bReturn;
}
// -----------------------------------------------------------------------------
-void DlgEdFunc::activateOle(SdrObject* _pObj)
+void DlgEdFunc::activateOle(SdrObject& _rObj)
{
- if ( _pObj )
+ //
+ // OLE: activate
+ //
+ SdrOle2Obj* pOleObj = dynamic_cast< SdrOle2Obj* >(&_rObj);
+
+ if (pOleObj && pOleObj->GetObjRef().is() )
{
- const sal_uInt16 nSdrObjKind = _pObj->GetObjIdentifier();
- //
- // OLE: activate
- //
- if (nSdrObjKind == OBJ_OLE2)
+ if (m_rView.IsTextEdit())
{
- bool bIsInplaceOle = false;
- if (!bIsInplaceOle)
- {
- SdrOle2Obj* pOleObj = dynamic_cast<SdrOle2Obj*>(_pObj);
- if ( pOleObj->GetObjRef().is() )
- {
- if (m_rView.IsTextEdit())
- {
- m_rView.SdrEndTextEdit();
- }
+ m_rView.SdrEndTextEdit();
+ }
- pOleObj->AddOwnLightClient();
- pOleObj->SetWindow(VCLUnoHelper::GetInterface(m_pParent));
- try
- {
- pOleObj->GetObjRef()->changeState( embed::EmbedStates::UI_ACTIVE );
- m_bUiActive = true;
- OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
- m_bShowPropertyBrowser = rController.isCommandChecked(SID_SHOW_PROPERTYBROWSER);
- if ( m_bShowPropertyBrowser )
- rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
- }
- catch( uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- }
- } // if (nSdrObjKind == OBJ_OLE2)
- } // if ( _pObj )
+ pOleObj->AddOwnLightClient();
+ pOleObj->SetWindow(VCLUnoHelper::GetInterface(m_pParent));
+ try
+ {
+ pOleObj->GetObjRef()->changeState( embed::EmbedStates::UI_ACTIVE );
+ m_bUiActive = true;
+ OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
+ m_bShowPropertyBrowser = rController.isCommandChecked(SID_SHOW_PROPERTYBROWSER);
+ if ( m_bShowPropertyBrowser )
+ rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
+ }
+ catch( uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
}
// -----------------------------------------------------------------------------
void DlgEdFunc::deactivateOle(bool _bSelect)
@@ -456,7 +445,7 @@ void DlgEdFunc::deactivateOle(bool _bSelect)
for(sal_uLong i = 0 ; i< nCount;++i)
{
SdrOle2Obj* pObj = reinterpret_cast<SdrOle2Obj*>(rObjCache.GetObject(i));
- if ( m_pParent->getPage() == pObj->GetPage() )
+ if ( m_pParent->getPage() == pObj->getSdrPageFromSdrObject() )
{
uno::Reference< embed::XEmbeddedObject > xObj = pObj->GetObjRef();
if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE )
@@ -470,8 +459,7 @@ void DlgEdFunc::deactivateOle(bool _bSelect)
if ( _bSelect )
{
- SdrPageView* pPV = m_rView.GetSdrPageView();
- m_rView.MarkObj(pObj, pPV);
+ m_rView.MarkObj(*pObj);
}
} // if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE )
}
@@ -486,10 +474,8 @@ void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj)
uno::Reference<report::XReportComponent> xComponent = pObj->getReportComponent();
if (xComponent.is() && xComponent != m_xOverlappingObj)
{
- OReportModel* pRptModel = static_cast<OReportModel*>(_pOverlappedObj->GetModel());
- if ( pRptModel )
- {
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ OReportModel& rRptModel = static_cast< OReportModel& >(_pOverlappedObj->getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
// uncolorize an old object, if there is one
unColorizeOverlappedObj();
@@ -500,33 +486,29 @@ void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj)
}
}
}
-}
// -----------------------------------------------------------------------------
void DlgEdFunc::unColorizeOverlappedObj()
{
// uncolorize an old object, if there is one
if (m_xOverlappingObj.is())
{
- OReportModel* pRptModel = static_cast<OReportModel*>(m_pOverlappingObj->GetModel());
- if ( pRptModel )
- {
- OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ OReportModel& rRptModel = static_cast< OReportModel& >(m_pOverlappingObj->getSdrModelFromSdrObject());
+ OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
lcl_setColorOfObject(m_xOverlappingObj, m_nOldColor);
m_xOverlappingObj = NULL;
m_pOverlappingObj = NULL;
}
}
-}
// -----------------------------------------------------------------------------
bool DlgEdFunc::isOverlapping(const MouseEvent& rMEvt)
{
bool bOverlapping = false;
SdrViewEvent aVEvt;
bOverlapping = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt) != SDRHIT_NONE;
- if (bOverlapping && aVEvt.pObj)
+ if (bOverlapping && aVEvt.mpObj)
{
- colorizeOverlappedObject(aVEvt.pObj);
+ colorizeOverlappedObject(aVEvt.mpObj);
}
else
{
@@ -546,7 +528,8 @@ void DlgEdFunc::checkMovementAllowed(const MouseEvent& rMEvt)
m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
}
// object was dragged
- Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ basegfx::B2DPoint aPnt(m_pParent->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+
if (m_bSelectionMode)
{
m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
@@ -555,21 +538,20 @@ void DlgEdFunc::checkMovementAllowed(const MouseEvent& rMEvt)
{
bool bControlKeyPressed = rMEvt.IsMod1();
// Don't allow points smaller 0
- if (bControlKeyPressed && (aPnt.Y() < 0))
+ if (bControlKeyPressed && (aPnt.getY() < 0.0))
{
- aPnt.Y() = 0;
+ aPnt.setY(0.0);
}
if (m_rView.IsDragResize())
{
// we resize the object don't resize to above sections
- if ( aPnt.Y() < 0 )
+ if ( aPnt.getY() < 0.0 )
{
- aPnt.Y() = 0;
+ aPnt.setY(0.0);
}
}
m_pParent->getSectionWindow()->getViewsWindow()->EndDragObj( bControlKeyPressed, &m_rView, aPnt );
}
- m_pParent->getSectionWindow()->getViewsWindow()->ForceMarkedToAnotherPage();
m_pParent->Invalidate(INVALIDATE_CHILDREN);
}
else
@@ -579,13 +561,11 @@ void DlgEdFunc::checkMovementAllowed(const MouseEvent& rMEvt)
bool DlgEdFunc::isOnlyCustomShapeMarked()
{
bool bReturn = true;
- const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
- for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i )
+ const SdrObjectVector aSelection(m_rView.getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 i = 0; i < aSelection.size(); ++i )
{
- SdrMark* pMark = rMarkList.GetMark(i);
- // bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- if (pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE)
+ if (aSelection[i]->GetObjIdentifier() != OBJ_CUSTOMSHAPE)
{
// we found an object in the marked objects, which is not a custom shape.
bReturn = false;
@@ -608,7 +588,6 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
if ( !bIsSetPoint )
{
// no drag rect, we have to check every single select rect
- //const Rectangle& rRect = m_rView.GetDragStat().GetActionRect();
const SdrDragStat& rDragStat = m_rView.GetDragStat();
if (rDragStat.GetDragMethod() != NULL)
{
@@ -617,24 +596,39 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
// loop through all marked objects and check if there new rect overlapps an old one.
while( (pObjIter = aIter.Next()) != NULL && !bIsSetPoint)
{
- if ( m_rView.IsObjMarked(pObjIter)
+ if ( m_rView.IsObjMarked(*pObjIter)
&& (dynamic_cast<OUnoObject*>(pObjIter) != NULL || dynamic_cast<OOle2Obj*>(pObjIter) != NULL) )
{
- Rectangle aNewRect = pObjIter->GetLastBoundRect();
- long nDx = rDragStat.IsHorFixed() ? 0 : rDragStat.GetDX();
- long nDy = rDragStat.IsVerFixed() ? 0 : rDragStat.GetDY();
- if ( (nDx + aNewRect.Left()) < 0 )
- nDx = -aNewRect.Left();
- if ( (nDy + aNewRect.Top()) < 0 )
- nDy = -aNewRect.Top();
+ basegfx::B2DRange aNewRange(pObjIter->getObjectRange(&m_rView));
+ double fDx(rDragStat.IsHorFixed() ? 0.0 : rDragStat.GetDX());
+ double fDy(rDragStat.IsVerFixed() ? 0.0 : rDragStat.GetDY());
+
+ if(fDx + aNewRange.getMinX() < 0.0)
+ {
+ fDx -= aNewRange.getMinX();
+ }
+
+ if(fDy + aNewRange.getMinY() < 0.0)
+ {
+ fDy -= aNewRange.getMinY();
+ }
if ( rDragStat.GetDragMethod()->getMoveOnly() )
- aNewRect.Move(nDx,nDy);
+ {
+ aNewRange.transform(
+ basegfx::tools::createTranslateB2DHomMatrix(fDx, fDy));
+ }
else
- ::ResizeRect(aNewRect,rDragStat.GetRef1(),rDragStat.GetXFact(),rDragStat.GetYFact());
+ {
+ basegfx::B2DHomMatrix aTransform;
+ aTransform.translate(-rDragStat.GetRef1());
+ aTransform.scale(rDragStat.GetXFact(), rDragStat.GetYFact());
+ aTransform.translate(rDragStat.GetRef1());
+ aNewRange.transform(aTransform);
+ }
- SdrObject* pObjOverlapped = isOver(aNewRect,*m_pParent->getPage(),m_rView,false,pObjIter, ISOVER_IGNORE_CUSTOMSHAPES);
+ SdrObject* pObjOverlapped = isOver(aNewRange,*m_pParent->getPage(),m_rView,false,pObjIter, ISOVER_IGNORE_CUSTOMSHAPES);
bIsSetPoint = pObjOverlapped ? true : false;
if (pObjOverlapped && !m_bSelectionMode)
{
@@ -644,9 +638,9 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
}
}
}
- else if ( aVEvt.pObj && (aVEvt.pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) && !m_bSelectionMode)
+ else if ( aVEvt.mpObj && (aVEvt.mpObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) && !m_bSelectionMode)
{
- colorizeOverlappedObject(aVEvt.pObj);
+ colorizeOverlappedObject(aVEvt.mpObj);
}
else
bIsSetPoint = false;
@@ -675,14 +669,14 @@ bool DlgEdFunc::setMovementPointer(const MouseEvent& rMEvt)
DlgEdFuncInsert::DlgEdFuncInsert( OReportSection* _pParent ) :
DlgEdFunc( _pParent )
{
- m_rView.SetCreateMode( sal_True );
+ m_rView.SetViewEditMode(SDREDITMODE_CREATE);
}
//----------------------------------------------------------------------------
DlgEdFuncInsert::~DlgEdFuncInsert()
{
- m_rView.SetEditMode( sal_True );
+ m_rView.SetViewEditMode(SDREDITMODE_EDIT);
}
//----------------------------------------------------------------------------
@@ -693,7 +687,7 @@ sal_Bool DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt )
return sal_True;
SdrViewEvent aVEvt;
- sal_Int16 nId = m_rView.GetCurrentObjIdentifier();
+ sal_Int16 nId = m_rView.getSdrObjectCreationInfo().getIdent();
const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
@@ -741,38 +735,38 @@ sal_Bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
if ( DlgEdFunc::MouseButtonUp( rMEvt ) )
return sal_True;
- const Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
- const sal_uInt16 nHitLog = sal_uInt16 ( m_pParent->PixelToLogic(Size(3,0)).Width() );
+ const basegfx::B2DPoint aPos(m_pParent->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+ const double fHitLog(basegfx::B2DVector(m_pParent->GetInverseViewTransformation() * basegfx::B2DVector(3.0, 0.0)).getLength());
sal_Bool bReturn = sal_True;
// object creation active?
- if ( m_rView.IsCreateObj() )
+ if ( m_rView.GetCreateObj() )
{
if ( isOver(m_rView.GetCreateObj(),*m_pParent->getPage(),m_rView) )
{
m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
// BrkAction disables the create mode
- m_rView.SetCreateMode( sal_True );
+ m_rView.SetViewEditMode(SDREDITMODE_CREATE);
return sal_True;
}
m_rView.EndCreateObj(SDRCREATE_FORCEEND);
- if ( !m_rView.AreObjectsMarked() )
+ if ( !m_rView.areSdrObjectsSelected() )
{
- m_rView.MarkObj(aPos, nHitLog);
+ m_rView.MarkObj(aPos, fHitLog);
}
- bReturn = m_rView.AreObjectsMarked();
+ bReturn = m_rView.areSdrObjectsSelected();
if ( bReturn )
{
OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
- const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
- for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i )
+ const SdrObjectVector aSelection(m_rView.getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 i = 0; i < aSelection.size();++i )
{
- SdrMark* pMark = rMarkList.GetMark(i);
- // bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
- OOle2Obj* pObj = dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj());
+ OOle2Obj* pObj = dynamic_cast< OOle2Obj* >(aSelection[i]);
+
if ( pObj && !pObj->IsEmpty() )
{
pObj->initializeChart(rController.getModel());
@@ -783,15 +777,14 @@ sal_Bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
else
checkMovementAllowed(rMEvt);
- if ( !m_rView.AreObjectsMarked() &&
- Abs(m_aMDPos.X() - aPos.X()) < nHitLog &&
- Abs(m_aMDPos.Y() - aPos.Y()) < nHitLog &&
+ if ( !m_rView.areSdrObjectsSelected() &&
+ fabs(m_aMDPos.getX() - aPos.getX()) < fHitLog &&
+ fabs(m_aMDPos.getY() - aPos.getY()) < fHitLog &&
!rMEvt.IsShift() && !rMEvt.IsMod2() )
{
- SdrPageView* pPV = m_rView.GetSdrPageView();
SdrViewEvent aVEvt;
m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- m_rView.MarkObj(aVEvt.pRootObj, pPV);
+ m_rView.MarkObj(*aVEvt.mpRootObj);
} // ift() && !rMEvt.IsMod2() )
checkTwoCklicks(rMEvt);
m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView);
@@ -804,11 +797,13 @@ sal_Bool DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt )
{
if ( DlgEdFunc::MouseMove(rMEvt ) )
return sal_True;
- Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
- if ( m_rView.IsCreateObj() )
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ basegfx::B2DPoint aLogicPos(m_pParent->GetInverseViewTransformation() * aPixelPos);
+
+ if ( m_rView.GetCreateObj() )
{
- m_rView.SetOrtho(SdrObjCustomShape::doConstructOrthogonal(m_rView.getReportSection()->getSectionWindow()->getViewsWindow()->getShapeType()) ? !rMEvt.IsShift() : rMEvt.IsShift());
+ m_rView.SetOrthogonal(SdrObjCustomShape::doConstructOrthogonal(m_rView.getReportSection()->getSectionWindow()->getViewsWindow()->getShapeType()) ? !rMEvt.IsShift() : rMEvt.IsShift());
m_rView.SetAngleSnapEnabled(rMEvt.IsShift());
}
@@ -818,21 +813,21 @@ sal_Bool DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt )
if ( m_rView.IsDragResize() )
{
// we resize the object don't resize to above sections
- if ( aPos.Y() < 0 )
+ if ( aLogicPos.getY() < 0.0 )
{
- aPos.Y() = 0;
+ aLogicPos.setY(0.0);
}
}
bIsSetPoint = setMovementPointer(rMEvt);
- ForceScroll(aPos);
- m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPos,&m_rView, m_rView.GetDragMethod() == NULL, false);
+ ForceScroll(aLogicPos);
+ m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aLogicPos,&m_rView, m_rView.GetDragMethod() == NULL, false);
}
//if ( isOver(m_rView.GetCreateObj(),*m_pParent->getPage(),*m_pView) )
// m_pParent->SetPointer( Pointer(POINTER_NOTALLOWED));
//else
if ( !bIsSetPoint )
- m_pParent->SetPointer( m_rView.GetPreferedPointer( aPos, m_pParent) );
+ m_pParent->SetPointer( m_rView.GetPreferedPointer( aLogicPos, m_pParent) );
return sal_True;
}
@@ -890,7 +885,7 @@ sal_Bool DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt )
}
else
{
- m_rView.SdrBeginTextEdit( aVEvt.pRootObj,m_rView.GetSdrPageView(),m_pParent,sal_False );
+ m_rView.SdrBeginTextEdit( aVEvt.mpRootObj,m_pParent,sal_False );
}
}
@@ -905,7 +900,8 @@ sal_Bool DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt )
return sal_True;
// get view from parent
- const Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aPnt(m_pParent->GetInverseViewTransformation() * aPixelPos);
if ( rMEvt.IsLeft() ) // left mousebutton pressed
checkMovementAllowed(rMEvt);
@@ -928,46 +924,38 @@ sal_Bool DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt )
if ( DlgEdFunc::MouseMove(rMEvt ) )
return sal_True;
- Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ basegfx::B2DPoint aLogicPos(m_pParent->GetInverseViewTransformation() * aPixelPos);
bool bIsSetPoint = false;
if ( m_rView.IsAction() ) // Drag Mode
{
bIsSetPoint = setMovementPointer(rMEvt);
- ForceScroll(aPnt);
+ ForceScroll(aLogicPos);
if (m_rView.GetDragMethod()==NULL)
{
// create a selection
- m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &m_rView, true, false);
+ m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aLogicPos, &m_rView, true, false);
}
else
{
if ( m_rView.IsDragResize() )
{
// we resize the object don't resize to above sections
- if ( aPnt.Y() < 0 )
+ if ( aLogicPos.getY() < 0.0 )
{
- aPnt.Y() = 0;
+ aLogicPos.setY(0.0);
}
- // grow section if it is under the current section
-// else
-// {
-// const Size& aSectionSize = m_rView->GetSizePixel();
-// if ( aPnt.Y() > aSectionSize.Height() )
-// {
-// aPnt.Y() = aSectionSize.Height();
-// }
-// }
}
// drag or resize an object
bool bControlKey = rMEvt.IsMod1();
- m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &m_rView, false, bControlKey);
+ m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aLogicPos, &m_rView, false, bControlKey);
}
}
if ( !bIsSetPoint )
{
- m_pParent->SetPointer( m_rView.GetPreferedPointer( aPnt, m_pParent) );
+ m_pParent->SetPointer( m_rView.GetPreferedPointer( aLogicPos, m_pParent) );
// restore color
unColorizeOverlappedObj();
@@ -975,147 +963,6 @@ sal_Bool DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt )
return sal_True;
}
-// -----------------------------------------------------------------------------
-//void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, sal_Bool bQuickDrag)
-//{
-//
-// SdrPageView* pPV = m_rView.GetSdrPageView();
-// if( _pTextObj && _pTextObj->GetPage() == pPV->GetPage() )
-// {
-// m_rView.SetCurrentObj(OBJ_TEXT);
-// m_rView.SetEditMode(SDREDITMODE_EDIT);
-//
-// sal_Bool bEmptyOutliner = sal_False;
-//
-// if (!_pTextObj->GetOutlinerParaObject() && m_rView.GetTextEditOutliner())
-// {
-// ::SdrOutliner* pOutl = m_rView.GetTextEditOutliner();
-// sal_uLong nParaAnz = pOutl->GetParagraphCount();
-// Paragraph* p1stPara = pOutl->GetParagraph( 0 );
-//
-// if (nParaAnz==1 && p1stPara)
-// {
-// // Bei nur einem Pararaph
-// if (pOutl->GetText(p1stPara).Len() == 0)
-// {
-// bEmptyOutliner = sal_True;
-// }
-// }
-// }
-//
-// if (_pTextObj != m_rView.GetTextEditObject() || bEmptyOutliner)
-// {
-// sal_uInt32 nInv = _pTextObj->GetObjInventor();
-// sal_uInt16 nSdrObjKind = _pTextObj->GetObjIdentifier();
-//
-// if (nInv == SdrInventor && _pTextObj->HasTextEdit() &&
-// (nSdrObjKind == OBJ_TEXT ||
-// nSdrObjKind == OBJ_TITLETEXT ||
-// nSdrObjKind == OBJ_OUTLINETEXT ||
-// (_pTextObj->ISA(SdrTextObj) && !_pTextObj->IsEmptyPresObj())))
-// {
-// // Neuen Outliner machen (gehoert der SdrObjEditView)
-// SdrModel* pModel = _pTextObj->GetModel();
-// SdrOutliner* pOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, pModel );
-// pOutl->SetMinDepth(0);
-// pOutl->SetStyleSheetPool((SfxStyleSheetPool*) pModel->GetStyleSheetPool());
-// //pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
-// sal_uLong nCntrl = pOutl->GetControlWord();
-// nCntrl |= EE_CNTRL_ALLOWBIGOBJS;
-// nCntrl |= EE_CNTRL_URLSFXEXECUTE;
-// nCntrl |= EE_CNTRL_MARKFIELDS;
-// nCntrl |= EE_CNTRL_AUTOCORRECT;
-//
-// nCntrl &= ~EE_CNTRL_ULSPACESUMMATION;
-// //if ( pModel->IsSummationOfParagraphs() )
-// // nCntrl |= EE_CNTRL_ULSPACESUMMATION;
-//
-// //SetSpellOptions( nCntrl );
-//
-// pOutl->SetControlWord(nCntrl);
-//
-// uno::Reference< linguistic2::XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
-// if ( xSpellChecker.is() )
-// pOutl->SetSpeller( xSpellChecker );
-//
-// uno::Reference< linguistic2::XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
-// if( xHyphenator.is() )
-// pOutl->SetHyphenator( xHyphenator );
-//
-// pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguage() );
-//
-// // in einem Gliederungstext darf nicht auf die 0-te
-// // Ebene ausgerueckt werden
-// if (_pTextObj->GetObjInventor() == SdrInventor &&
-// _pTextObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
-// {
-// pOutl->SetMinDepth(1);
-// }
-//
-// if (bEmptyOutliner)
-// {
-// m_rView.SdrEndTextEdit(sal_True);
-// }
-//
-// if( _pTextObj )
-// {
-// OutlinerParaObject* pOPO = _pTextObj->GetOutlinerParaObject();
-// if( ( pOPO && pOPO->IsVertical() ) /*||
-// nSlotId == SID_ATTR_CHAR_VERTICAL ||
-// nSlotId == SID_TEXT_FITTOSIZE_VERTICAL */)
-// pOutl->SetVertical( sal_True );
-//
-//
-// if (m_rView.SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor)
-// {
-// //bFirstObjCreated = sal_True;
-// //DeleteDefaultText();
-//
-// OutlinerView* pOLV = m_rView.GetTextEditOutlinerView();
-//
-// nSdrObjKind = _pTextObj->GetObjIdentifier();
-//
-// SdrViewEvent aVEvt;
-// SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
-//
-// if (eHit == SDRHIT_TEXTEDIT)
-// {
-// // Text getroffen
-// if (nSdrObjKind == OBJ_TEXT ||
-// nSdrObjKind == OBJ_TITLETEXT ||
-// nSdrObjKind == OBJ_OUTLINETEXT ||
-// //nSlotId == SID_TEXTEDIT ||
-// !bQuickDrag)
-// {
-// pOLV->MouseButtonDown(rMEvt);
-// pOLV->MouseMove(rMEvt);
-// pOLV->MouseButtonUp(rMEvt);
-// }
-//
-// if ( bQuickDrag && _pTextObj->GetOutlinerParaObject())
-// {
-// pOLV->MouseButtonDown(rMEvt);
-// }
-// }
-// else
-// {
-// // #98198# Move cursor to end of text
-// ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
-// pOLV->SetSelection(aNewSelection);
-// }
-// }
-// else
-// {
-// //RestoreDefaultText();
-// }
-// }
-// }
-// }
-// }
-// else
-// _pTextObj = NULL;
-//}
-
//----------------------------------------------------------------------------
}
diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx
index 181fc41515fe..f000c0a4687b 100644
--- a/reportdesign/source/ui/report/propbrw.cxx
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -312,20 +312,20 @@ sal_Bool PropBrw::Close()
//----------------------------------------------------------------------------
-uno::Sequence< Reference<uno::XInterface> > PropBrw::CreateCompPropSet(const SdrMarkList& _rMarkList)
+uno::Sequence< Reference<uno::XInterface> > PropBrw::CreateCompPropSet(const SdrObjectVector& rSelection)
{
- sal_uInt32 nMarkCount = _rMarkList.GetMarkCount();
+ const sal_uInt32 nMarkCount(rSelection.size());
::std::vector< uno::Reference< uno::XInterface> > aSets;
aSets.reserve(nMarkCount);
- for(sal_uInt32 i=0;i<nMarkCount;++i)
+ for(sal_uInt32 i(0); i < nMarkCount; ++i)
{
- SdrObject* pCurrent = _rMarkList.GetMark(i)->GetMarkedSdrObj();
-
+ SdrObject* pCurrent = rSelection[i];
::std::auto_ptr<SdrObjListIter> pGroupIterator;
- if (pCurrent->IsGroupObject())
+
+ if (pCurrent->getChildrenOfSdrObject())
{
- pGroupIterator.reset(new SdrObjListIter(*pCurrent->GetSubList()));
+ pGroupIterator.reset(new SdrObjListIter(*pCurrent->getChildrenOfSdrObject()));
pCurrent = pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL;
}
@@ -509,7 +509,7 @@ void PropBrw::Update( OSectionView* pNewView )
{
if ( m_pView )
{
- EndListening( *(m_pView->GetModel()) );
+ EndListening( m_pView->getSdrModelFromSdrView() );
m_pView = NULL;
}
@@ -547,8 +547,10 @@ void PropBrw::Update( OSectionView* pNewView )
::boost::shared_ptr<OSectionWindow> pSectionWindow = pViews->getSectionWindow(i);
if ( pSectionWindow )
{
- const SdrMarkList& rMarkList = pSectionWindow->getReportSection().getSectionView().GetMarkedObjectList();
- aMarkedObjects = ::comphelper::concatSequences(aMarkedObjects,CreateCompPropSet( rMarkList ));
+ const SdrObjectVector aSelection(
+ pSectionWindow->getReportSection().getSectionView().getSelectedSdrObjectVectorFromSdrMarkView());
+
+ aMarkedObjects = ::comphelper::concatSequences(aMarkedObjects,CreateCompPropSet( aSelection ));
}
}
@@ -568,7 +570,7 @@ void PropBrw::Update( OSectionView* pNewView )
implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> >(&xTemp,1) );
}
- StartListening( *(m_pView->GetModel()) );
+ StartListening( m_pView->getSdrModelFromSdrView() );
}
catch ( Exception& )
{
@@ -585,7 +587,7 @@ void PropBrw::Update( const uno::Reference< uno::XInterface>& _xReportComponent)
{
if ( m_pView )
{
- EndListening( *(m_pView->GetModel()) );
+ EndListening( m_pView->getSdrModelFromSdrView() );
m_pView = NULL;
} // if ( m_pView )
diff --git a/reportdesign/util/makefile.mk b/reportdesign/util/makefile.mk
index 6c1025478a55..fcf03c180814 100644
--- a/reportdesign/util/makefile.mk
+++ b/reportdesign/util/makefile.mk
@@ -50,6 +50,7 @@ SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
SHL1STDLIBS= \
$(EDITENGLIB) \
$(SVXCORELIB) \
+ $(BASEGFXLIB) \
$(SVXLIB) \
$(FWELIB) \
$(SFXLIB) \
@@ -106,6 +107,7 @@ SHL2TARGET=$(TARGET2)$(DLLPOSTFIX)
SHL2STDLIBS= \
$(EDITENGLIB) \
+ $(BASEGFXLIB) \
$(SVXCORELIB) \
$(SVXLIB) \
$(SFXLIB) \
diff --git a/sc/inc/arealink.hxx b/sc/inc/arealink.hxx
index 5bab40a3a469..0e40864d3f8e 100644
--- a/sc/inc/arealink.hxx
+++ b/sc/inc/arealink.hxx
@@ -51,7 +51,6 @@ private:
sal_Bool FindExtRange( ScRange& rRange, ScDocument* pSrcDoc, const String& rAreaName );
public:
- TYPEINFO();
ScAreaLink( SfxObjectShell* pShell, const String& rFile,
const String& rFilter, const String& rOpt,
const String& rArea, const ScRange& rDest, sal_uLong nRefresh );
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx
index 087db816d7f6..552ed3920071 100644
--- a/sc/inc/attrib.hxx
+++ b/sc/inc/attrib.hxx
@@ -59,7 +59,6 @@ class SC_DLLPUBLIC ScMergeAttr: public SfxPoolItem
SCsCOL nColMerge;
SCsROW nRowMerge;
public:
- TYPEINFO();
ScMergeAttr();
ScMergeAttr( SCsCOL nCol, SCsROW nRow = 0);
ScMergeAttr( const ScMergeAttr& );
@@ -93,6 +92,7 @@ public:
ScMergeFlagAttr(sal_Int16 nFlags);
~ScMergeFlagAttr();
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
sal_Bool IsHorOverlapped() const { return ( GetValue() & SC_MF_HOR ) != 0; }
sal_Bool IsVerOverlapped() const { return ( GetValue() & SC_MF_VER ) != 0; }
sal_Bool IsOverlapped() const { return ( GetValue() & ( SC_MF_HOR | SC_MF_VER ) ) != 0; }
@@ -112,7 +112,7 @@ class SC_DLLPUBLIC ScProtectionAttr: public SfxPoolItem
sal_Bool bHideCell; // Zelle nicht Anzeigen
sal_Bool bHidePrint; // Zelle nicht Ausdrucken
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
ScProtectionAttr();
ScProtectionAttr( sal_Bool bProtect,
sal_Bool bHFormula = sal_False,
@@ -165,8 +165,6 @@ public:
class ScRangeItem : public SfxPoolItem
{
public:
- TYPEINFO();
-
inline ScRangeItem( const sal_uInt16 nWhich );
inline ScRangeItem( const sal_uInt16 nWhich,
const ScRange& rRange,
@@ -223,8 +221,6 @@ inline ScRangeItem& ScRangeItem::operator=( const ScRangeItem &rCpy )
class ScTableListItem : public SfxPoolItem
{
public:
- TYPEINFO();
-
inline ScTableListItem( const sal_uInt16 nWhich );
ScTableListItem( const ScTableListItem& rCpy );
//UNUSED2008-05 ScTableListItem( const sal_uInt16 nWhich, const List& rList );
@@ -267,7 +263,6 @@ class SC_DLLPUBLIC ScPageHFItem : public SfxPoolItem
EditTextObject* pRightArea;
public:
- TYPEINFO();
ScPageHFItem( sal_uInt16 nWhich );
ScPageHFItem( const ScPageHFItem& rItem );
~ScPageHFItem();
@@ -300,8 +295,6 @@ public:
class SC_DLLPUBLIC ScViewObjectModeItem: public SfxEnumItem
{
public:
- TYPEINFO();
-
ScViewObjectModeItem( sal_uInt16 nWhich );
ScViewObjectModeItem( sal_uInt16 nWhich, ScVObjMode eMode );
~ScViewObjectModeItem();
@@ -324,8 +317,8 @@ public:
class ScDoubleItem : public SfxPoolItem
{
public:
- TYPEINFO();
- ScDoubleItem( sal_uInt16 nWhich, double nVal=0 );
+ POOLITEM_FACTORY()
+ ScDoubleItem( sal_uInt16 nWhich = 0, double nVal=0 );
ScDoubleItem( const ScDoubleItem& rItem );
~ScDoubleItem();
@@ -356,8 +349,6 @@ const sal_uInt8 SC_MID_PAGE_SCALETO_HEIGHT = 2;
class SC_DLLPUBLIC ScPageScaleToItem : public SfxPoolItem
{
public:
- TYPEINFO();
-
/** Default c'tor sets the width and height to 0. */
explicit ScPageScaleToItem();
explicit ScPageScaleToItem( sal_uInt16 nWidth, sal_uInt16 nHeight );
diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx
index 8df2f94eead2..577ac7f6e8d2 100644
--- a/sc/inc/brdcst.hxx
+++ b/sc/inc/brdcst.hxx
@@ -25,7 +25,6 @@
#include "global.hxx"
#include "address.hxx"
-#include <tools/rtti.hxx>
#include <svl/hint.hxx>
#include <svl/smplhint.hxx>
class ScBaseCell;
@@ -42,7 +41,6 @@ private:
ScBaseCell* pCell;
public:
- TYPEINFO();
ScHint( sal_uLong n, const ScAddress& a, ScBaseCell* p )
: SfxSimpleHint( n ), aAddress( a ), pCell( p ) {}
ScBaseCell* GetCell() const { return pCell; }
@@ -57,7 +55,6 @@ class ScAreaChangedHint : public SfxHint
private:
ScRange aNewRange;
public:
- TYPEINFO();
ScAreaChangedHint(const ScRange& rRange) : aNewRange(rRange) {}
const ScRange& GetRange() const { return aNewRange; }
};
diff --git a/sc/inc/docoptio.hxx b/sc/inc/docoptio.hxx
index 4e466a35aa67..5f234b8cb7bc 100644
--- a/sc/inc/docoptio.hxx
+++ b/sc/inc/docoptio.hxx
@@ -169,8 +169,6 @@ inline int ScDocOptions::operator!=( const ScDocOptions& rOpt ) const
class SC_DLLPUBLIC ScTpCalcItem : public SfxPoolItem
{
public:
- TYPEINFO();
-//UNUSED2008-05 ScTpCalcItem( sal_uInt16 nWhich );
ScTpCalcItem( sal_uInt16 nWhich,
const ScDocOptions& rOpt );
ScTpCalcItem( const ScTpCalcItem& rItem );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 8e45677be682..f97d76807d93 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -142,6 +142,7 @@ class ScFormulaParserPool;
struct ScClipParam;
struct ScClipRangeNameData;
class ScRowBreakIterator;
+class SdrView;
namespace com { namespace sun { namespace star {
namespace lang {
@@ -165,6 +166,8 @@ namespace com { namespace sun { namespace star {
}
} } }
+namespace basegfx { class B2DPoint; }
+
#include <svl/zforlist.hxx>
/*
#ifdef _ZFORLIST_DECLARE_TABLE
@@ -529,8 +532,8 @@ public:
void EnsureGraphicNames();
- SdrObject* GetObjectAtPoint( SCTAB nTab, const Point& rPos );
- sal_Bool HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName = NULL );
+ SdrObject* GetObjectAtPoint( SCTAB nTab, const basegfx::B2DPoint& rPos, const SdrView* pSdrView = 0 );
+ sal_Bool HasChartAtPoint( SCTAB nTab, const basegfx::B2DPoint& rPos, String* pName = NULL, const SdrView* pSdrView = 0 );
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartByName( const String& rChartName );
SC_DLLPUBLIC void GetChartRanges( const String& rChartName, ::std::vector< ScRangeList >& rRanges, ScDocument* pSheetNameDoc );
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 006b24534124..9324771ec71e 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -115,6 +115,9 @@ private:
protected:
const SfxItemPropertySet& GetPropertySet() const { return aPropSet; }
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModel() const;
+
public:
ScModelObj(ScDocShell* pDocSh);
virtual ~ScModelObj();
diff --git a/sc/inc/drawpage.hxx b/sc/inc/drawpage.hxx
index 1209922bc7e2..f31835a2dd9d 100644
--- a/sc/inc/drawpage.hxx
+++ b/sc/inc/drawpage.hxx
@@ -35,8 +35,16 @@ class ScDrawLayer;
class ScDrawPage: public FmFormPage
{
+private:
+protected:
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrPage(const SdrPage& rSource);
+
public:
- ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, sal_Bool bMasterPage=sal_False);
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrPage* CloneSdrPage(SdrModel* pTargetModel = 0) const;
+
+ ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, bool bMasterPage = false);
~ScDrawPage();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx
index 86d0cc2e0e74..f7551d6d3570 100644
--- a/sc/inc/drwlayer.hxx
+++ b/sc/inc/drwlayer.hxx
@@ -48,7 +48,6 @@ class ScTabDeletedHint : public SfxHint
private:
SCTAB nTab;
public:
- TYPEINFO();
ScTabDeletedHint( SCTAB nTabNo = SCTAB_MAX );
virtual ~ScTabDeletedHint();
@@ -60,7 +59,6 @@ class ScTabSizeChangedHint : public SfxHint
private:
SCTAB nTab;
public:
- TYPEINFO();
ScTabSizeChangedHint( SCTAB nTabNo = SCTAB_MAX );
virtual ~ScTabSizeChangedHint();
@@ -115,9 +113,9 @@ public:
ScDrawLayer( ScDocument* pDocument, const String& rName );
virtual ~ScDrawLayer();
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual SdrPage* AllocPage(bool bMasterPage);
virtual SdrModel* AllocModel() const;
- virtual void SetChanged( sal_Bool bFlg = sal_True );
+ virtual void SetChanged( bool bFlg = true );
virtual Window* GetCurDocViewWin();
virtual SvStream* GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const;
@@ -185,7 +183,7 @@ public:
SCTAB nSourceTab, const Rectangle& rSourceRange,
const ScAddress& rDestPos, const Rectangle& rDestRange );
- void SetPageSize( sal_uInt16 nPageNo, const Size& rSize, bool bUpdateNoteCaptionPos = true );
+ void SetPageSize( sal_uInt32 nPageNo, const basegfx::B2DVector& rSize, bool bUpdateNoteCaptionPos = true );
// mirror or move between positive and negative positions for RTL
void MirrorRTL( SdrObject* pObj );
@@ -194,6 +192,7 @@ public:
/** Returns the rectangle for the passed cell address in 1/100 mm.
@param bMergedCell True = regards merged cells. False = use single column/row size. */
static Rectangle GetCellRect( ScDocument& rDoc, const ScAddress& rPos, bool bMergedCell );
+ static basegfx::B2DRange GetCellRange(ScDocument& rDoc, const ScAddress& rPos, bool bMergedCell);
// GetVisibleName: name for navigator etc: GetPersistName or GetName
// (ChartListenerCollection etc. must use GetPersistName directly)
@@ -210,24 +209,23 @@ public:
static ScAnchorType GetAnchor( const SdrObject* );
// Positionen fuer Detektivlinien
- static ScDrawObjData* GetObjData( SdrObject* pObj, sal_Bool bCreate=sal_False );
+ static ScDrawObjData* GetObjData( const SdrObject& rObj, sal_Bool bCreate=sal_False );
// The sheet information in ScDrawObjData isn't updated when sheets are inserted/deleted.
// Use this method to get an object with positions on the specified sheet (should be the
// sheet on which the object is inserted).
- static ScDrawObjData* GetObjDataTab( SdrObject* pObj, SCTAB nTab );
+ static ScDrawObjData* GetObjDataTab( const SdrObject& rObj, SCTAB nTab );
/** Returns true, if the passed object is the caption of a cell note. */
- static bool IsNoteCaption( SdrObject* pObj );
+ static bool IsNoteCaption( const SdrObject& rObj );
/** Returns the object data, if the passed object is a cell note caption. */
- static ScDrawObjData* GetNoteCaptionData( SdrObject* pObj, SCTAB nTab );
+ static ScDrawObjData* GetNoteCaptionData( const SdrObject& rObj, SCTAB nTab );
// Image-Map
static ScIMapInfo* GetIMapInfo( SdrObject* pObj );
- static IMapObject* GetHitIMapObject( SdrObject* pObject,
- const Point& rWinPoint, const Window& rCmpWnd );
+ static IMapObject* GetHitIMapObject(SdrObject& rObject, const basegfx::B2DPoint& rWinPoint, const Window& rCmpWnd);
static ScMacroInfo* GetMacroInfo( SdrObject* pObj, sal_Bool bCreate = sal_False );
diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx
index 7270278ac4a8..1e40759a4f82 100644
--- a/sc/inc/editsrc.hxx
+++ b/sc/inc/editsrc.hxx
@@ -46,7 +46,6 @@ class ScHeaderFooterChangedHint : public SfxHint
sal_uInt16 nPart;
public:
- TYPEINFO();
ScHeaderFooterChangedHint(sal_uInt16 nP);
~ScHeaderFooterChangedHint();
diff --git a/sc/inc/hints.hxx b/sc/inc/hints.hxx
index 2a1584f96a88..88dc244bd419 100644
--- a/sc/inc/hints.hxx
+++ b/sc/inc/hints.hxx
@@ -39,7 +39,6 @@ class ScPaintHint : public SfxHint
ScPaintHint(); // disabled
public:
- TYPEINFO();
ScPaintHint( const ScRange& rRng, sal_uInt16 nPaint = PAINT_ALL );
~ScPaintHint();
@@ -66,8 +65,6 @@ class ScUpdateRefHint : public SfxHint
SCsTAB nDz;
public:
- TYPEINFO();
-
ScUpdateRefHint( UpdateRefMode eMode, const ScRange& rR,
SCsCOL nX, SCsROW nY, SCsTAB nZ );
~ScUpdateRefHint();
@@ -87,8 +84,6 @@ class ScPointerChangedHint : public SfxHint
sal_uInt16 nFlags;
public:
- TYPEINFO();
-
//UNUSED2008-05 ScPointerChangedHint( sal_uInt16 nF );
~ScPointerChangedHint();
@@ -115,7 +110,6 @@ class ScLinkRefreshedHint : public SfxHint
//! also use source data for area links?
public:
- TYPEINFO();
ScLinkRefreshedHint();
~ScLinkRefreshedHint();
@@ -143,7 +137,6 @@ class ScAutoStyleHint : public SfxHint
sal_uLong nTimeout;
public:
- TYPEINFO();
ScAutoStyleHint( const ScRange& rR, const String& rSt1,
sal_uLong nT, const String& rSt2 );
~ScAutoStyleHint();
@@ -159,7 +152,6 @@ class ScDBRangeRefreshedHint : public SfxHint
ScImportParam aParam;
public:
- TYPEINFO();
ScDBRangeRefreshedHint( const ScImportParam& rP );
~ScDBRangeRefreshedHint();
@@ -171,7 +163,6 @@ class ScDataPilotModifiedHint : public SfxHint
String maName;
public:
- TYPEINFO();
ScDataPilotModifiedHint( const String& rName );
~ScDataPilotModifiedHint();
diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx
index db9c58b8be0e..f14f543c520e 100644
--- a/sc/inc/pch/precompiled_sc.hxx
+++ b/sc/inc/pch/precompiled_sc.hxx
@@ -160,12 +160,10 @@
#include <svx/fmglob.hxx>
#include <editeng/outlobj.hxx>
#include <svx/sdangitm.hxx>
-#include <svx/sderitm.hxx>
#include <svx/sdmetitm.hxx>
#include <svx/sdooitm.hxx>
#include <svx/sdprcitm.hxx>
#include <svx/sdrmasterpagedescriptor.hxx>
-#include <svx/sdrpageuser.hxx>
#include <svx/sdtaitm.hxx>
#include <svx/svdglue.hxx>
#include <svx/svdlayer.hxx>
@@ -192,7 +190,6 @@
#include <tools/globname.hxx>
#include <tools/list.hxx>
#include <tools/rc.hxx>
-#include <tools/rtti.hxx>
#include <tools/solar.h>
#include <tools/string.hxx>
#include <tools/toolsdllapi.h>
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 305c69df5453..d6343c2a3695 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -37,6 +37,7 @@ class SdrPage;
class SfxItemSet;
class ScDocument;
struct ScCaptionInitData;
+namespace basegfx { class B2DRange; }
// ============================================================================
@@ -227,9 +228,12 @@ public:
otherwise. The Calc document is the owner of the note object.
*/
static ScPostIt* CreateNoteFromObjectData(
- ScDocument& rDoc, const ScAddress& rPos,
- SfxItemSet* pItemSet, OutlinerParaObject* pOutlinerObj,
- const Rectangle& rCaptionRect, bool bShown,
+ ScDocument& rDoc,
+ const ScAddress& rPos,
+ SfxItemSet* pItemSet,
+ OutlinerParaObject* pOutlinerObj,
+ const basegfx::B2DRange& rCaptionRange,
+ bool bShown,
bool bAlwaysCreateCaption );
/** Creates a cell note based on the passed string and inserts it into the
diff --git a/sc/inc/printopt.hxx b/sc/inc/printopt.hxx
index 6f48c455da97..4729ebf3db5d 100644
--- a/sc/inc/printopt.hxx
+++ b/sc/inc/printopt.hxx
@@ -58,7 +58,6 @@ public:
class SC_DLLPUBLIC ScTpPrintItem : public SfxPoolItem
{
public:
- TYPEINFO();
//UNUSED2008-05 ScTpPrintItem( sal_uInt16 nWhich );
ScTpPrintItem( sal_uInt16 nWhich,
const ScPrintOptions& rOpt );
diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx
index 4cf83c1bfcf9..54b3892e7c76 100644
--- a/sc/inc/stlsheet.hxx
+++ b/sc/inc/stlsheet.hxx
@@ -51,8 +51,6 @@ private:
mutable ScStyleSheet::Usage eUsage;
public:
- TYPEINFO();
-
ScStyleSheet( const ScStyleSheet& rStyle );
virtual sal_Bool SetParent ( const String& rParentName );
diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx
index 7a35b2ac6eee..08a9da4d0446 100644
--- a/sc/inc/tablink.hxx
+++ b/sc/inc/tablink.hxx
@@ -50,7 +50,6 @@ private:
sal_Bool bDoPaint;
public:
- TYPEINFO();
ScTableLink( ScDocShell* pDocSh, const String& rFile,
const String& rFilter, const String& rOpt, sal_uLong nRefresh );
ScTableLink( SfxObjectShell* pShell, const String& rFile,
diff --git a/sc/inc/unoreflist.hxx b/sc/inc/unoreflist.hxx
index 4decc527a21b..1041185208b6 100644
--- a/sc/inc/unoreflist.hxx
+++ b/sc/inc/unoreflist.hxx
@@ -67,7 +67,6 @@ class ScUnoRefUndoHint : public SfxHint
ScUnoRefEntry aEntry;
public:
- TYPEINFO();
ScUnoRefUndoHint( const ScUnoRefEntry& rRefEntry );
~ScUnoRefUndoHint();
diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx
index 9d968ff6b648..01f019dbb4fd 100644
--- a/sc/inc/userdat.hxx
+++ b/sc/inc/userdat.hxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef SC_USERDAT_HXX
#define SC_USERDAT_HXX
@@ -29,6 +27,8 @@
#include "global.hxx"
#include "address.hxx"
+//-------------------------------------------------------------------------
+class SdrObjFactory;
//-------------------------------------------------------------------------
@@ -43,7 +43,9 @@
class ScDrawObjFactory
{
+private:
DECL_LINK( MakeUserData, SdrObjFactory * );
+
public:
ScDrawObjFactory();
~ScDrawObjFactory();
diff --git a/sc/inc/viewopti.hxx b/sc/inc/viewopti.hxx
index 19af35fd8549..10a90b8df93d 100644
--- a/sc/inc/viewopti.hxx
+++ b/sc/inc/viewopti.hxx
@@ -130,7 +130,6 @@ private:
class SC_DLLPUBLIC ScTpViewItem : public SfxPoolItem
{
public:
- TYPEINFO();
//UNUSED2008-05 ScTpViewItem( sal_uInt16 nWhich );
ScTpViewItem( sal_uInt16 nWhich, const ScViewOptions& rOpt );
ScTpViewItem( const ScTpViewItem& rItem );
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 72fc50662ee9..6c267fb60f44 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1933,9 +1933,8 @@ sal_Bool ScAttrArray::GetLastAttr( SCROW& rLastRow, SCROW nLastData ) const
while ( nStartPos > 0 && pData[nStartPos-1].nRow > nLastData &&
!pData[nStartPos].pPattern->IsVisible() )
--nStartPos;
- if(nStartPos == 0 && !pData[nStartPos].pPattern->IsVisible()) // add this condition for handle only default pattern in one colume
- rLastRow = nLastData;
- else if(nStartPos >= 0 && pData[nStartPos].nRow > nLastData)
+
+ if(nStartPos >= 0 && pData[nStartPos].nRow > nLastData)
{
bFound = sal_True;
rLastRow = pData[nStartPos].nRow;
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index cb499cec4cd5..d2cde61658a8 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -55,17 +55,6 @@ using namespace com::sun::star;
//------------------------------------------------------------------------
-TYPEINIT1(ScMergeAttr, SfxPoolItem);
-TYPEINIT1_AUTOFACTORY(ScProtectionAttr, SfxPoolItem);
-TYPEINIT1(ScRangeItem, SfxPoolItem);
-TYPEINIT1(ScTableListItem, SfxPoolItem);
-TYPEINIT1(ScPageHFItem, SfxPoolItem);
-TYPEINIT1(ScViewObjectModeItem, SfxEnumItem);
-TYPEINIT1(ScDoubleItem, SfxPoolItem);
-TYPEINIT1(ScPageScaleToItem, SfxPoolItem);
-
-//------------------------------------------------------------------------
-
//
// allgemeine Hilfsfunktionen
//
@@ -151,7 +140,7 @@ String ScMergeAttr::GetValueText() const
int ScMergeAttr::operator==( const SfxPoolItem& rItem ) const
{
- DBG_ASSERT( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" );
+ DBG_ASSERT( Which() != rItem.Which() || typeid(*this) == typeid(rItem), "which ==, type !=" );
return (Which() == rItem.Which())
&& (nColMerge == ((ScMergeAttr&)rItem).nColMerge)
&& (nRowMerge == ((ScMergeAttr&)rItem).nRowMerge);
@@ -195,9 +184,15 @@ ScMergeFlagAttr::~ScMergeFlagAttr()
{
}
+SfxPoolItem* ScMergeFlagAttr::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new ScMergeFlagAttr(*this);
+}
+
//------------------------------------------------------------------------
// Protection
//------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(ScProtectionAttr)
ScProtectionAttr::ScProtectionAttr():
SfxPoolItem(ATTR_PROTECTION),
@@ -374,7 +369,7 @@ SfxItemPresentation ScProtectionAttr::GetPresentation
int ScProtectionAttr::operator==( const SfxPoolItem& rItem ) const
{
- DBG_ASSERT( Which() != rItem.Which() || Type() == rItem.Type(), "which ==, type !=" );
+ DBG_ASSERT( Which() != rItem.Which() || typeid(*this) == typeid(rItem), "which ==, type !=" );
return (Which() == rItem.Which())
&& (bProtection == ((ScProtectionAttr&)rItem).bProtection)
&& (bHideFormula == ((ScProtectionAttr&)rItem).bHideFormula)
@@ -1150,6 +1145,7 @@ SfxPoolItem* ScViewObjectModeItem::Create(
// -----------------------------------------------------------------------
// double
// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(ScDoubleItem)
ScDoubleItem::ScDoubleItem( sal_uInt16 nWhichP, double nVal )
: SfxPoolItem ( nWhichP ),
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 967eea26de49..66f9e2daca10 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -68,9 +68,6 @@
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1( ScHint, SfxSimpleHint );
-TYPEINIT1( ScAreaChangedHint, SfxHint );
-
struct ScSlotData
{
SCROW nStartRow; // first row of this segment
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 215253e81c34..404864d66225 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -746,13 +746,9 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
bInChangeTrack( sal_False ),
bTableOpDirty( sal_False ),
bNeedListening( sal_False ),
+ pValidRefToken( rCell.pValidRefToken ),
aPos( rPos )
{
- if ( rCell.pValidRefToken )
- pValidRefToken = static_cast<ScToken*>(rCell.pValidRefToken->Clone());
- else
- pValidRefToken = NULL;
-
pCode = (rCell.pCode) ? rCell.pCode->Clone() : NULL;
if ( nCloneFlags & SC_CLONECELL_ADJUST3DREL )
@@ -1802,7 +1798,7 @@ void __EXPORT ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint)
{
if ( !pDocument->IsInDtorClear() && !pDocument->GetHardRecalcState() )
{
- const ScHint* p = PTR_CAST( ScHint, &rHint );
+ const ScHint* p = dynamic_cast< const ScHint* >( &rHint );
sal_uLong nHint = (p ? p->GetId() : 0);
if (nHint & (SC_HINT_DATACHANGED | SC_HINT_DYING | SC_HINT_TABLEOPDIRTY))
{
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index e716ca353b05..d7b49d27ca5f 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -56,6 +56,8 @@
#include "dpglobal.hxx"
#include <dptablecache.hxx>
#include <com/sun/star/i18n/LocaleDataItem.hpp>
+#include <memory.h>
+
using ::com::sun::star::i18n::LocaleDataItem;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx
index 1f217d5975d2..c8d862bba766 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -26,8 +26,8 @@
#include "compressedarray.hxx"
#include "address.hxx"
-
#include <algorithm>
+#include <memory.h>
template< typename A, typename D >
ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D& rValue,
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 7e19b6734e2c..e97998eeb5b2 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -831,9 +831,11 @@ void ScDocument::BroadcastUno( const SfxHint &rHint )
// The listener calls must be processed after completing the broadcast,
// because they can add or remove objects from pUnoBroadcaster.
- if ( pUnoListenerCalls && rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DATACHANGED &&
- !bInUnoListenerCall )
+ if ( pUnoListenerCalls )
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DATACHANGED == pSfxSimpleHint->GetId() && !bInUnoListenerCall )
{
// Listener calls may lead to BroadcastUno calls again. The listener calls
// are not nested, instead the calls are collected in the list, and the
@@ -846,6 +848,7 @@ void ScDocument::BroadcastUno( const SfxHint &rHint )
}
}
}
+}
void ScDocument::AddUnoListenerCall( const uno::Reference<util::XModifyListener>& rListener,
const lang::EventObject& rEvent )
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 4f1209dadf16..4053cddd7322 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -61,6 +61,7 @@
#include "miscuno.hxx"
#include "chart2uno.hxx"
#include "charthelper.hxx"
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -204,7 +205,7 @@ void ScDocument::UpdateAllCharts()
pChartCollection->FreeAll();
}
-sal_Bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName )
+sal_Bool ScDocument::HasChartAtPoint( SCTAB nTab, const basegfx::B2DPoint& rPos, String* pName, const SdrView* pSdrView )
{
if (pDrawLayer && pTab[nTab])
{
@@ -215,11 +216,9 @@ sal_Bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pNa
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetObjIdentifier() == OBJ_OLE2 &&
- pObject->GetCurrentBoundRect().IsInside(rPos) )
+ if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pObject->getObjectRange(pSdrView).isInside(rPos) )
{
- // auch Chart-Objekte die nicht in der Collection sind
-
+ // auch Chart-Objekte die nicht in der Collection sind
if (IsChart(pObject))
{
if (pName)
@@ -251,8 +250,8 @@ uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( const Strin
if (pDrawLayer)
{
- sal_uInt16 nCount = pDrawLayer->GetPageCount();
- for (sal_uInt16 nTab=0; nTab<nCount; nTab++)
+ const sal_uInt32 nCount(pDrawLayer->GetPageCount());
+ for (sal_uInt32 nTab=0; nTab<nCount; nTab++)
{
SdrPage* pPage = pDrawLayer->GetPage(nTab);
DBG_ASSERT(pPage,"Page ?");
@@ -316,8 +315,8 @@ void ScDocument::GetOldChartParameters( const String& rName,
if (!pDrawLayer)
return;
- sal_uInt16 nCount = pDrawLayer->GetPageCount();
- for (sal_uInt16 nTab=0; nTab<nCount; nTab++)
+ const sal_uInt32 nCount(pDrawLayer->GetPageCount());
+ for (sal_uInt32 nTab=0; nTab<nCount; nTab++)
{
SdrPage* pPage = pDrawLayer->GetPage(nTab);
DBG_ASSERT(pPage,"Page ?");
@@ -670,8 +669,8 @@ uno::Reference< embed::XEmbeddedObject >
// weil sie evtl. nicht mit den Tabellen uebereinstimmen
// (z.B. Redo von Tabelle loeschen, Draw-Redo passiert vor DeleteTab).
- sal_uInt16 nCount = pDrawLayer->GetPageCount();
- for (sal_uInt16 nTab=0; nTab<nCount; nTab++)
+ const sal_uInt32 nCount(pDrawLayer->GetPageCount());
+ for (sal_uInt32 nTab=0; nTab<nCount; nTab++)
{
SdrPage* pPage = pDrawLayer->GetPage(nTab);
DBG_ASSERT(pPage,"Page ?");
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 617008114717..1e4a7aafef2e 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -924,9 +924,10 @@ sal_Bool ScDocument::IdleCheckLinks() // sal_True = demnaechst wieder
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
{
- ScDdeLink* pDdeLink = (ScDdeLink*)pBase;
if (pDdeLink->NeedsUpdate())
{
pDdeLink->TryUpdate();
@@ -955,8 +956,10 @@ void ScDocument::SaveDdeLinks(SvStream& rStream) const
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
- if ( !bExport40 || ((ScDdeLink*)pBase)->GetMode() == SC_DDE_DEFAULT )
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
+ if ( !bExport40 || pDdeLink->GetMode() == SC_DDE_DEFAULT )
++nDdeCount;
}
@@ -970,11 +973,12 @@ void ScDocument::SaveDdeLinks(SvStream& rStream) const
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
{
- ScDdeLink* pLink = (ScDdeLink*)pBase;
- if ( !bExport40 || pLink->GetMode() == SC_DDE_DEFAULT )
- pLink->Store( rStream, aHdr );
+ if ( !bExport40 || pDdeLink->GetMode() == SC_DDE_DEFAULT )
+ pDdeLink->Store( rStream, aHdr );
}
}
}
@@ -1001,7 +1005,7 @@ sal_Bool ScDocument::HasDdeLinks() const
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.Count();
for (sal_uInt16 i=0; i<nCount; i++)
- if ((*rLinks[i])->ISA(ScDdeLink))
+ if (dynamic_cast< ScDdeLink* >(&(*(rLinks[i]))))
return sal_True;
}
@@ -1074,9 +1078,11 @@ void ScDocument::UpdateDdeLinks()
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
{
- ((ScDdeLink*)pBase)->ResetValue();
+ pDdeLink->ResetValue();
bAny = sal_True;
}
}
@@ -1095,8 +1101,10 @@ void ScDocument::UpdateDdeLinks()
for (i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
- ((ScDdeLink*)pBase)->TryUpdate(); // bei DDE-Links TryUpdate statt Update
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
+ pDdeLink->TryUpdate(); // bei DDE-Links TryUpdate statt Update
}
}
}
@@ -1115,9 +1123,10 @@ sal_Bool ScDocument::UpdateDdeLink( const String& rAppl, const String& rTopic, c
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
{
- ScDdeLink* pDdeLink = (ScDdeLink*)pBase;
if ( pDdeLink->GetAppl() == rAppl &&
pDdeLink->GetTopic() == rTopic &&
pDdeLink->GetItem() == rItem )
@@ -1140,7 +1149,9 @@ void ScDocument::DisconnectDdeLinks()
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
pBase->Disconnect(); // bleibt im LinkManager eingetragen
}
}
@@ -1163,9 +1174,11 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScDdeLink))
+ ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pDdeLink)
{
- ScDdeLink* pNew = new ScDdeLink( pDestDoc, *(ScDdeLink*)pBase );
+ ScDdeLink* pNew = new ScDdeLink( pDestDoc, *pDdeLink );
pDestDoc->pLinkManager->InsertDDELink( pNew,
pNew->GetAppl(), pNew->GetTopic(), pNew->GetItem() );
@@ -1182,7 +1195,7 @@ sal_uInt16 ScDocument::GetDdeLinkCount() const
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.Count();
for (sal_uInt16 i=0; i<nCount; i++)
- if ((*rLinks[i])->ISA(ScDdeLink))
+ if (dynamic_cast< ScDdeLink* >(&(*(rLinks[i]))))
++nDdeCount;
}
return nDdeCount;
@@ -1209,7 +1222,7 @@ ScDdeLink* lclGetDdeLink(
for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
- if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
+ if( ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >( pLink ) )
{
if( (pDdeLink->GetAppl() == rAppl) &&
(pDdeLink->GetTopic() == rTopic) &&
@@ -1236,7 +1249,7 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDde
for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
- if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
+ if( ScDdeLink* pDdeLink = dynamic_cast< ScDdeLink* >( pLink ) )
{
if( nDdeIndex == nDdePos )
return pDdeLink;
@@ -1329,7 +1342,7 @@ sal_Bool ScDocument::HasAreaLinks() const
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
sal_uInt16 nCount = rLinks.Count();
for (sal_uInt16 i=0; i<nCount; i++)
- if ((*rLinks[i])->ISA(ScAreaLink))
+ if (dynamic_cast< ScAreaLink* >(&(*(rLinks[i]))))
return sal_True;
}
@@ -1345,7 +1358,7 @@ void ScDocument::UpdateAreaLinks()
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast< ScAreaLink* >(pBase))
pBase->Update();
}
}
@@ -1360,8 +1373,9 @@ void ScDocument::DeleteAreaLinksOnTab( SCTAB nTab )
while ( nPos < rLinks.Count() )
{
const ::sfx2::SvBaseLink* pBase = *rLinks[nPos];
- if ( pBase->ISA(ScAreaLink) &&
- static_cast<const ScAreaLink*>(pBase)->GetDestArea().aStart.Tab() == nTab )
+ const ScAreaLink* pScAreaLink = dynamic_cast< const ScAreaLink* >(pBase);
+
+ if ( pScAreaLink && pScAreaLink->GetDestArea().aStart.Tab() == nTab )
pLinkManager->Remove( nPos );
else
++nPos;
@@ -1381,9 +1395,10 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ ScAreaLink* pLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if (pLink)
{
- ScAreaLink* pLink = (ScAreaLink*) pBase;
ScRange aOutRange = pLink->GetDestArea();
SCCOL nCol1 = aOutRange.aStart.Col();
@@ -1417,14 +1432,17 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
{
bool bFound = false;
::sfx2::SvBaseLink* pFirst = *rLinks[nFirstIndex];
- if ( pFirst->ISA(ScAreaLink) )
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pFirst);
+
+ if ( pScAreaLink )
{
- ScAddress aFirstPos = static_cast<ScAreaLink*>(pFirst)->GetDestArea().aStart;
+ ScAddress aFirstPos = pScAreaLink->GetDestArea().aStart;
for ( sal_uInt16 nSecondIndex = nFirstIndex + 1; nSecondIndex < nCount && !bFound; ++nSecondIndex )
{
::sfx2::SvBaseLink* pSecond = *rLinks[nSecondIndex];
- if ( pSecond->ISA(ScAreaLink) &&
- static_cast<ScAreaLink*>(pSecond)->GetDestArea().aStart == aFirstPos )
+ ScAreaLink* pScAreaLink2 = dynamic_cast< ScAreaLink* >(pSecond);
+
+ if ( pScAreaLink2 && pScAreaLink2->GetDestArea().aStart == aFirstPos )
{
// remove the first link, exit the inner loop, don't increment nFirstIndex
pLinkManager->Remove( pFirst );
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 7bfc6e3a349f..4fcfad743d91 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -47,6 +47,7 @@
#include <sfx2/printer.hxx>
#include <unotools/saveopt.hxx>
#include <unotools/pathoptions.hxx>
+#include <svx/svdlegacy.hxx>
#include "document.hxx"
#include "docoptio.hxx"
@@ -119,17 +120,12 @@ void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDes
while (pOldObject)
{
// #i112034# do not copy internal objects (detective) and note captions
- if ( pOldObject->GetLayer() != SC_LAYER_INTERN && !ScDrawLayer::IsNoteCaption( pOldObject ) )
+ if ( pOldObject->GetLayer() != SC_LAYER_INTERN && !ScDrawLayer::IsNoteCaption( *pOldObject ) )
{
// #116235#
- SdrObject* pNewObject = pOldObject->Clone();
- // SdrObject* pNewObject = pOldObject->Clone( pNewPage, pDrawLayer );
- pNewObject->SetModel(pDrawLayer);
- pNewObject->SetPage(pNewPage);
-
- pNewObject->NbcMove(Size(0,0));
- pNewPage->InsertObject( pNewObject );
+ SdrObject* pNewObject = pOldObject->CloneSdrObject();
+ pNewPage->InsertObjectToSdrObjList(*pNewObject);
if (pDrawLayer->IsRecording())
pDrawLayer->AddCalcUndo< SdrUndoInsertObj >( *pNewObject );
}
@@ -140,7 +136,7 @@ void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDes
}
// #71726# make sure the data references of charts are adapted
- // (this must be after InsertObject!)
+ // (this must be after InsertObjectToSdrObjList!)
ScChartHelper::AdjustRangesOfChartsOnDestinationPage( pSrcDoc, this, nSrcPos, nDestPos );
ScChartHelper::UpdateChartsOnDestinationPage(this, nDestPos);
}
@@ -211,6 +207,7 @@ void ScDocument::UpdateDrawLanguages()
if (pDrawLayer)
{
SfxItemPool& rDrawPool = pDrawLayer->GetItemPool();
+
rDrawPool.SetPoolDefaultItem( SvxLanguageItem( eLanguage, EE_CHAR_LANGUAGE ) );
rDrawPool.SetPoolDefaultItem( SvxLanguageItem( eCjkLanguage, EE_CHAR_LANGUAGE_CJK ) );
rDrawPool.SetPoolDefaultItem( SvxLanguageItem( eCtlLanguage, EE_CHAR_LANGUAGE_CTL ) );
@@ -238,7 +235,7 @@ void ScDocument::UpdateDrawPrinter()
// OutputDevice* pRefDev = GetPrinter();
// pRefDev->SetMapMode( MAP_100TH_MM );
- pDrawLayer->SetRefDevice(GetRefDevice());
+ pDrawLayer->SetReferenceDevice(GetRefDevice());
}
}
@@ -337,7 +334,7 @@ sal_Bool ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkDat
while (pObject)
{
if ( pObject->GetObjIdentifier() == OBJ_OLE2 &&
- aMMRect.IsInside( pObject->GetCurrentBoundRect() ) )
+ aMMRect.IsInside( sdr::legacy::GetBoundRect(*pObject) ) )
return sal_True;
pObject = aIter.Next();
@@ -354,80 +351,29 @@ void ScDocument::StartAnimations( SCTAB nTab, Window* pWin )
{
if (!pDrawLayer)
return;
+
SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
+
if (!pPage)
return;
SdrObjListIter aIter( *pPage, IM_FLAT );
SdrObject* pObject = aIter.Next();
+
while (pObject)
{
- if (pObject->ISA(SdrGrafObj))
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObject);
+
+ if(pGrafObj && pGrafObj->IsAnimated() )
{
- SdrGrafObj* pGrafObj = (SdrGrafObj*)pObject;
- if ( pGrafObj->IsAnimated() )
- {
- const Rectangle& rRect = pGrafObj->GetCurrentBoundRect();
- pGrafObj->StartAnimation( pWin, rRect.TopLeft(), rRect.GetSize() );
- }
+ pGrafObj->SetGrafAnimationAllowed(true);
}
+
pObject = aIter.Next();
}
}
-//UNUSED2008-05 void ScDocument::RefreshNoteFlags()
-//UNUSED2008-05 {
-//UNUSED2008-05 if (!pDrawLayer)
-//UNUSED2008-05 return;
-//UNUSED2008-05
-//UNUSED2008-05 sal_Bool bAnyIntObj = sal_False;
-//UNUSED2008-05 SCTAB nTab;
-//UNUSED2008-05 ScPostIt aNote(this);
-//UNUSED2008-05 for (nTab=0; nTab<=MAXTAB && pTab[nTab]; nTab++)
-//UNUSED2008-05 {
-//UNUSED2008-05 SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
-//UNUSED2008-05 DBG_ASSERT(pPage,"Page ?");
-//UNUSED2008-05 if (pPage)
-//UNUSED2008-05 {
-//UNUSED2008-05 SdrObjListIter aIter( *pPage, IM_FLAT );
-//UNUSED2008-05 SdrObject* pObject = aIter.Next();
-//UNUSED2008-05 while (pObject)
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( pObject->GetLayer() == SC_LAYER_INTERN )
-//UNUSED2008-05 {
-//UNUSED2008-05 bAnyIntObj = sal_True; // for all internal objects, including detective
-//UNUSED2008-05
-//UNUSED2008-05 if ( pObject->ISA( SdrCaptionObj ) )
-//UNUSED2008-05 {
-//UNUSED2008-05 ScDrawObjData* pData = ScDrawLayer::GetObjData( pObject );
-//UNUSED2008-05 if ( pData )
-//UNUSED2008-05 {
-//UNUSED2008-05 if ( GetNote( pData->aStt.Col(), pData->aStt.Row(), nTab, aNote))
-//UNUSED2008-05 if ( !aNote.IsShown() )
-//UNUSED2008-05 {
-//UNUSED2008-05 aNote.SetShown(sal_True);
-//UNUSED2008-05 SetNote( pData->aStt.Col(), pData->aStt.Row(), nTab, aNote);
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 pObject = aIter.Next();
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 if (bAnyIntObj)
-//UNUSED2008-05 {
-//UNUSED2008-05 // update attributes for all note objects and the colors of detective objects
-//UNUSED2008-05 // (we don't know with which settings the file was created)
-//UNUSED2008-05
-//UNUSED2008-05 ScDetectiveFunc aFunc( this, 0 );
-//UNUSED2008-05 aFunc.UpdateAllComments();
-//UNUSED2008-05 aFunc.UpdateAllArrowColors();
-//UNUSED2008-05 }
-//UNUSED2008-05 }
-
sal_Bool ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect )
{
// Gibt es Objekte auf dem Hintergrund-Layer, die (teilweise) von rMMRect
@@ -448,7 +394,7 @@ sal_Bool ScDocument::HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect )
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
{
- if ( pObject->GetLayer() == SC_LAYER_BACK && pObject->GetCurrentBoundRect().IsOver( rMMRect ) )
+ if ( pObject->GetLayer() == SC_LAYER_BACK && sdr::legacy::GetBoundRect(*pObject).IsOver( rMMRect ) )
bFound = sal_True;
pObject = aIter.Next();
}
@@ -475,7 +421,7 @@ sal_Bool ScDocument::HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect )
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
{
- if ( pObject->GetCurrentBoundRect().IsOver( rMMRect ) )
+ if ( sdr::legacy::GetBoundRect(*pObject).IsOver( rMMRect ) )
bFound = sal_True;
pObject = aIter.Next();
}
@@ -489,7 +435,7 @@ void ScDocument::EnsureGraphicNames()
pDrawLayer->EnsureGraphicNames();
}
-SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos )
+SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const basegfx::B2DPoint& rPos, const SdrView* pSdrView )
{
// fuer Drag&Drop auf Zeichenobjekt
@@ -504,7 +450,7 @@ SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos )
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetCurrentBoundRect().IsInside(rPos) )
+ if ( pObject->getObjectRange(pSdrView).isInside(rPos) )
{
// Intern interessiert gar nicht
// Objekt vom Back-Layer nur, wenn kein Objekt von anderem Layer getroffen
@@ -621,9 +567,9 @@ sal_Bool ScDocument::HasControl( SCTAB nTab, const Rectangle& rMMRect )
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
{
- if (pObject->ISA(SdrUnoObj))
+ if (dynamic_cast< SdrUnoObj* >(pObject))
{
- Rectangle aObjRect = pObject->GetLogicRect();
+ const Rectangle aObjRect(sdr::legacy::GetLogicRect(*pObject));
if ( aObjRect.IsOver( rMMRect ) )
bFound = sal_True;
}
@@ -648,9 +594,9 @@ void ScDocument::InvalidateControls( Window* pWin, SCTAB nTab, const Rectangle&
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if (pObject->ISA(SdrUnoObj))
+ if (dynamic_cast< SdrUnoObj* >(pObject))
{
- Rectangle aObjRect = pObject->GetLogicRect();
+ const Rectangle aObjRect(sdr::legacy::GetLogicRect(*pObject));
if ( aObjRect.IsOver( rMMRect ) )
{
// Uno-Controls zeichnen sich immer komplett, ohne Ruecksicht
@@ -686,7 +632,7 @@ sal_Bool ScDocument::HasDetectiveObjects(SCTAB nTab) const
while (pObject && !bFound)
{
// anything on the internal layer except captions (annotations)
- if ( (pObject->GetLayer() == SC_LAYER_INTERN) && !ScDrawLayer::IsNoteCaption( pObject ) )
+ if ( (pObject->GetLayer() == SC_LAYER_INTERN) && !ScDrawLayer::IsNoteCaption( *pObject ) )
bFound = sal_True;
pObject = aIter.Next();
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 915dbf8620d6..644521eb8054 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -600,7 +600,7 @@ void ScDocument::SetLayoutRTL( SCTAB nTab, sal_Bool bRTL )
{
// objects with ScDrawObjData are re-positioned in SetPageSize,
// don't mirror again
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pObject );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( *pObject );
if ( !pData )
pDrawLayer->MirrorRTL( pObject );
@@ -4106,7 +4106,7 @@ sal_Bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGat
for ( const SfxStyleSheetBase* pStyle = aIter.First(); pStyle;
pStyle = aIter.Next() )
{
- const ScStyleSheet* pScStyle = PTR_CAST( ScStyleSheet, pStyle );
+ const ScStyleSheet* pScStyle = dynamic_cast< const ScStyleSheet* >( pStyle );
if ( pScStyle )
pScStyle->SetUsage( ScStyleSheet::NOTUSED );
}
diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx
index 5c2de7fe7e7a..9d1f7dc12d10 100644
--- a/sc/source/core/data/drawpage.cxx
+++ b/sc/source/core/data/drawpage.cxx
@@ -39,10 +39,10 @@
// -----------------------------------------------------------------------
-ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, sal_Bool bMasterPage) :
- FmFormPage(rNewModel, pBasic, bMasterPage)
+ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, StarBASIC* pBasic, bool bMasterPage)
+: FmFormPage(rNewModel, pBasic, bMasterPage)
{
- SetSize( Size( LONG_MAX, LONG_MAX ) );
+ SetPageScale( basegfx::B2DVector( LONG_MAX, LONG_MAX ) );
}
// -----------------------------------------------------------------------
@@ -51,6 +51,40 @@ __EXPORT ScDrawPage::~ScDrawPage()
{
}
+void ScDrawPage::copyDataFromSdrPage(const SdrPage& rSource)
+{
+ if(this != &rSource)
+ {
+ const ScDrawPage* pSource = dynamic_cast< const ScDrawPage* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ FmFormPage::copyDataFromSdrPage(rSource);
+
+ // no local data to copy
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrPage* ScDrawPage::CloneSdrPage(SdrModel* pTargetModel) const
+{
+ ScDrawLayer* pScDrawLayer = static_cast< ScDrawLayer* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
+ OSL_ENSURE(dynamic_cast< ScDrawLayer* >(pScDrawLayer), "Wrong SdrModel type in ScDrawPage clone (!)");
+ ScDrawPage* pClone = new ScDrawPage(
+ *pScDrawLayer,
+ GetBasic(),
+ IsMasterPage());
+ OSL_ENSURE(pClone, "CloneSdrPage error (!)");
+ pClone->copyDataFromSdrPage(*this);
+
+ return pClone;
+}
+
// -----------------------------------------------------------------------
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ScDrawPage::createUnoPage()
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 391e0cc08961..e71a921273cf 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -63,6 +63,7 @@
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <svx/svdlegacy.hxx>
#include "drwlayer.hxx"
#include "drawpage.hxx"
@@ -92,9 +93,6 @@ using namespace ::com::sun::star;
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1(ScTabDeletedHint, SfxHint);
-TYPEINIT1(ScTabSizeChangedHint, SfxHint);
-
static ScDrawObjFactory* pFac = NULL;
static E3dObjFactory* pF3d = NULL;
static sal_uInt16 nInst = 0;
@@ -122,7 +120,7 @@ __EXPORT ScUndoObjData::~ScUndoObjData()
void ScUndoObjData::Undo()
{
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( mrSdrObject );
DBG_ASSERT(pData,"ScUndoObjData: Daten nicht da");
if (pData)
{
@@ -133,7 +131,7 @@ void ScUndoObjData::Undo()
void __EXPORT ScUndoObjData::Redo()
{
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( mrSdrObject );
DBG_ASSERT(pData,"ScUndoObjData: Daten nicht da");
if (pData)
{
@@ -234,7 +232,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
SetSwapGraphics(sal_True);
// SetSwapAsynchron(sal_True); // an der View
- SetScaleUnit(MAP_100TH_MM);
+ SetExchangeObjectUnit(MAP_100TH_MM);
SfxItemPool& rPool = GetItemPool();
rPool.SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
SvxFrameDirectionItem aModeItem( FRMDIR_ENVIRONMENT, EE_PARA_WRITINGDIR );
@@ -242,8 +240,8 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
// #i33700#
// Set shadow distance defaults as PoolDefaultItems. Details see bug.
- rPool.SetPoolDefaultItem(SdrShadowXDistItem(300));
- rPool.SetPoolDefaultItem(SdrShadowYDistItem(300));
+ rPool.SetPoolDefaultItem(SdrMetricItem(SDRATTR_SHADOWXDIST, 300));
+ rPool.SetPoolDefaultItem(SdrMetricItem(SDRATTR_SHADOWYDIST, 300));
// #111216# default for script spacing depends on locale, see SdDrawDocument ctor in sd
LanguageType eOfficeLanguage = Application::GetSettings().GetLanguage();
@@ -256,7 +254,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
rPool.FreezeIdRanges(); // the pool is also used directly
- SdrLayerAdmin& rAdmin = GetLayerAdmin();
+ SdrLayerAdmin& rAdmin = GetModelLayerAdmin();
rAdmin.NewLayer(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("vorne")), SC_LAYER_FRONT);
rAdmin.NewLayer(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("hinten")), SC_LAYER_BACK);
rAdmin.NewLayer(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("intern")), SC_LAYER_INTERN);
@@ -269,16 +267,10 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
Outliner& rOutliner = GetDrawOutliner();
rOutliner.SetCalcFieldValueHdl( LINK( pScMod, ScModule, CalcFieldValueHdl ) );
- Outliner& rHitOutliner = GetHitTestOutliner();
- rHitOutliner.SetCalcFieldValueHdl( LINK( pScMod, ScModule, CalcFieldValueHdl ) );
-
// #95129# SJ: set FontHeight pool defaults without changing static SdrEngineDefaults
SfxItemPool* pOutlinerPool = rOutliner.GetEditTextObjectPool();
if ( pOutlinerPool )
- pItemPool->SetPoolDefaultItem(SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT )); // 12Pt
- SfxItemPool* pHitOutlinerPool = rHitOutliner.GetEditTextObjectPool();
- if ( pHitOutlinerPool )
- pHitOutlinerPool->SetPoolDefaultItem(SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT )); // 12Pt
+ mpItemPool->SetPoolDefaultItem(SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT )); // 12Pt
// initial undo mode as in Calc document
if( pDoc )
@@ -295,11 +287,11 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
__EXPORT ScDrawLayer::~ScDrawLayer()
{
- Broadcast(SdrHint(HINT_MODELCLEARED));
+ Broadcast(SdrBaseHint(HINT_MODELCLEARED));
// #116168#
//Clear();
- ClearModel(sal_True);
+ ClearModel(true);
delete pUndoGroup;
if( !--nInst )
@@ -317,13 +309,11 @@ void ScDrawLayer::UseHyphenator()
xHyphenator = LinguMgr::GetHyphenator();
GetDrawOutliner().SetHyphenator( xHyphenator );
- GetHitTestOutliner().SetHyphenator( xHyphenator );
-
bHyphenatorSet = sal_True;
}
}
-SdrPage* __EXPORT ScDrawLayer::AllocPage(FASTBOOL bMasterPage)
+SdrPage* __EXPORT ScDrawLayer::AllocPage(bool bMasterPage)
{
// don't create basic until it is needed
StarBASIC* pBasic = NULL;
@@ -335,8 +325,8 @@ sal_Bool ScDrawLayer::HasObjects() const
{
sal_Bool bFound = sal_False;
- sal_uInt16 nCount = GetPageCount();
- for (sal_uInt16 i=0; i<nCount && !bFound; i++)
+ const sal_uInt32 nCount(GetPageCount());
+ for (sal_uInt32 i=0; i<nCount && !bFound; i++)
if (GetPage(i)->GetObjCount())
bFound = sal_True;
@@ -432,16 +422,12 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool b
while (pOldObject)
{
// #i112034# do not copy internal objects (detective) and note captions
- if ( pOldObject->GetLayer() != SC_LAYER_INTERN && !IsNoteCaption( pOldObject ) )
+ if ( pOldObject->GetLayer() != SC_LAYER_INTERN && !IsNoteCaption( *pOldObject ) )
{
// #116235#
- SdrObject* pNewObject = pOldObject->Clone();
- //SdrObject* pNewObject = pOldObject->Clone( pNewPage, this );
- pNewObject->SetModel(this);
- pNewObject->SetPage(pNewPage);
+ SdrObject* pNewObject = pOldObject->CloneSdrObject();
- pNewObject->NbcMove(Size(0,0));
- pNewPage->InsertObject( pNewObject );
+ pNewPage->InsertObjectToSdrObjList(*pNewObject);
if (bRecording)
AddCalcUndo< SdrUndoInsertObj >( *pNewObject );
}
@@ -470,11 +456,11 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC
sal_Bool bNegativePage = pDoc && pDoc->IsNegativePage( nTab );
- sal_uLong nCount = pPage->GetObjCount();
- for ( sal_uLong i = 0; i < nCount; i++ )
+ sal_uInt32 nCount = pPage->GetObjCount();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
SdrObject* pObj = pPage->GetObj( i );
- ScDrawObjData* pData = GetObjDataTab( pObj, nTab );
+ ScDrawObjData* pData = pObj ? GetObjDataTab( *pObj, nTab ) : 0;
if( pData )
{
const ScAddress aOldStt = pData->maStart;
@@ -494,7 +480,7 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC
}
if (bChange)
{
- if ( pObj->ISA( SdrRectObj ) && pData->maStart.IsValid() && pData->maEnd.IsValid() )
+ if ( dynamic_cast< SdrRectObj* >(pObj) && pData->maStart.IsValid() && pData->maEnd.IsValid() )
pData->maStart.PutInOrder( pData->maEnd );
AddCalcUndo< ScUndoObjData >( pObj, aOldStt, aOldEnd, pData->maStart, pData->maEnd );
RecalcPos( pObj, *pData, bNegativePage, bUpdateNoteCaptionPos );
@@ -503,14 +489,14 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC
}
}
-void ScDrawLayer::SetPageSize( sal_uInt16 nPageNo, const Size& rSize, bool bUpdateNoteCaptionPos )
+void ScDrawLayer::SetPageSize( sal_uInt32 nPageNo, const basegfx::B2DVector& rSize, bool bUpdateNoteCaptionPos )
{
SdrPage* pPage = GetPage(nPageNo);
if (pPage)
{
- if ( rSize != pPage->GetSize() )
+ if(!rSize.equal(pPage->GetPageScale()))
{
- pPage->SetSize( rSize );
+ pPage->SetPageScale( rSize );
Broadcast( ScTabSizeChangedHint( static_cast<SCTAB>(nPageNo) ) ); // SetWorkArea() an den Views
}
@@ -520,11 +506,11 @@ void ScDrawLayer::SetPageSize( sal_uInt16 nPageNo, const Size& rSize, bool bUpda
sal_Bool bNegativePage = pDoc && pDoc->IsNegativePage( static_cast<SCTAB>(nPageNo) );
- sal_uLong nCount = pPage->GetObjCount();
- for ( sal_uLong i = 0; i < nCount; i++ )
+ sal_uInt32 nCount = pPage->GetObjCount();
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
SdrObject* pObj = pPage->GetObj( i );
- ScDrawObjData* pData = GetObjDataTab( pObj, static_cast<SCTAB>(nPageNo) );
+ ScDrawObjData* pData = pObj ? GetObjDataTab( *pObj, static_cast<SCTAB>(nPageNo) ) : 0;
if( pData )
RecalcPos( pObj, *pData, bNegativePage, bUpdateNoteCaptionPos );
}
@@ -564,33 +550,27 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
SCTAB nTab2 = rData.maEnd.Tab();
// validation circle
- bool bCircle = pObj->ISA( SdrCircObj );
+ bool bCircle = dynamic_cast< SdrCircObj* >(pObj);
// detective arrow
- bool bArrow = pObj->IsPolyObj() && (pObj->GetPointCount() == 2);
+ bool bArrow = pObj->IsPolygonObject() && (2 == pObj->GetObjectPointCount());
if( bCircle )
{
- Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
- TwipsToMM( aPos.X() );
- TwipsToMM( aPos.Y() );
-
// Berechnung und Werte wie in detfunc.cxx
+ const basegfx::B2DPoint aPos(pDoc->GetColOffset(nCol1, nTab1) * HMM_PER_TWIPS, pDoc->GetRowOffset(nRow1, nTab1) * HMM_PER_TWIPS);
+ const basegfx::B2DVector aSize(pDoc->GetColWidth(nCol1, nTab1) * HMM_PER_TWIPS, pDoc->GetRowHeight(nRow1, nTab1) * HMM_PER_TWIPS);
+ basegfx::B2DRange aRange(aPos.getX() - 250.0, aPos.getY() - 70.0, aPos.getX() + aSize.getX() + 250.0, aPos.getY() + aSize.getY() + 70.0);
- Size aSize( (long)(pDoc->GetColWidth( nCol1, nTab1 ) * HMM_PER_TWIPS),
- (long)(pDoc->GetRowHeight( nRow1, nTab1 ) * HMM_PER_TWIPS) );
- Rectangle aRect( aPos, aSize );
- aRect.Left() -= 250;
- aRect.Right() += 250;
- aRect.Top() -= 70;
- aRect.Bottom() += 70;
if ( bNegativePage )
- MirrorRectRTL( aRect );
+ {
+ aRange = basegfx::B2DRange(-aRange.getMaxX(), aRange.getMinY(), -aRange.getMinX(), aRange.getMaxY());
+ }
- if ( pObj->GetLogicRect() != aRect )
+ if(!sdr::legacy::GetLogicRange(*pObj).equal(aRange))
{
if (bRecording)
AddCalcUndo<SdrUndoGeoObj>( *pObj );
- pObj->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pObj, aRange);
}
}
else if( bArrow )
@@ -601,71 +581,114 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
SCROW nLastRow;
if( bValid1 )
{
- Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
+ basegfx::B2DPoint aPos(pDoc->GetColOffset(nCol1, nTab1), pDoc->GetRowOffset(nRow1, nTab1));
+
if (!pDoc->ColHidden(nCol1, nTab1, nLastCol))
- aPos.X() += pDoc->GetColWidth( nCol1, nTab1 ) / 4;
+ {
+ aPos.setX(aPos.getX() + pDoc->GetColWidth(nCol1, nTab1) / 4.0);
+ }
+
if (!pDoc->RowHidden(nRow1, nTab1, nLastRow))
- aPos.Y() += pDoc->GetRowHeight( nRow1, nTab1 ) / 2;
- TwipsToMM( aPos.X() );
- TwipsToMM( aPos.Y() );
- Point aStartPos = aPos;
+ {
+ aPos.setY(aPos.getY() + pDoc->GetRowHeight(nRow1, nTab1) / 2.0);
+ }
+
+ aPos *= HMM_PER_TWIPS;
+
+ basegfx::B2DPoint aStartPos(aPos);
+
if ( bNegativePage )
- aStartPos.X() = -aStartPos.X(); // don't modify aPos - used below
- if ( pObj->GetPoint( 0 ) != aStartPos )
+ {
+ aStartPos.setX(-aStartPos.getX()); // don't modify aPos - used below
+ }
+
+ if(!pObj->GetObjectPoint(0).equal(aStartPos))
{
if (bRecording)
AddCalcUndo< SdrUndoGeoObj> ( *pObj );
- pObj->SetPoint( aStartPos, 0 );
+
+ pObj->SetObjectPoint( aStartPos, 0 );
}
if( !bValid2 )
{
- Point aEndPos( aPos.X() + DET_ARROW_OFFSET, aPos.Y() - DET_ARROW_OFFSET );
- if (aEndPos.Y() < 0)
- aEndPos.Y() += (2 * DET_ARROW_OFFSET);
+ basegfx::B2DPoint aEndPos(aPos.getX() + DET_ARROW_OFFSET, aPos.getY() - DET_ARROW_OFFSET);
+
+ if(aEndPos.getY() < 0.0)
+ {
+ aEndPos.setY(aEndPos.getY() + (2 * DET_ARROW_OFFSET));
+ }
+
if ( bNegativePage )
- aEndPos.X() = -aEndPos.X();
- if ( pObj->GetPoint( 1 ) != aEndPos )
+ {
+ aEndPos.setX(-aEndPos.getX());
+ }
+
+ if(!pObj->GetObjectPoint(1).equal(aEndPos))
{
if (bRecording)
AddCalcUndo< SdrUndoGeoObj >( *pObj );
- pObj->SetPoint( aEndPos, 1 );
+
+ pObj->SetObjectPoint( aEndPos, 1 );
}
}
}
if( bValid2 )
{
- Point aPos( pDoc->GetColOffset( nCol2, nTab2 ), pDoc->GetRowOffset( nRow2, nTab2 ) );
+ basegfx::B2DPoint aPos(pDoc->GetColOffset(nCol2, nTab2), pDoc->GetRowOffset(nRow2, nTab2));
+
if (!pDoc->ColHidden(nCol2, nTab2, nLastCol))
- aPos.X() += pDoc->GetColWidth( nCol2, nTab2 ) / 4;
+ {
+ aPos.setX(aPos.getX() + pDoc->GetColWidth(nCol2, nTab2) / 4.0);
+ }
+
if (!pDoc->RowHidden(nRow2, nTab2, nLastRow))
- aPos.Y() += pDoc->GetRowHeight( nRow2, nTab2 ) / 2;
- TwipsToMM( aPos.X() );
- TwipsToMM( aPos.Y() );
- Point aEndPos = aPos;
+ {
+ aPos.setY(aPos.getY() + pDoc->GetRowHeight(nRow2, nTab2) / 2);
+ }
+
+ aPos *= HMM_PER_TWIPS;
+
+ basegfx::B2DPoint aEndPos(aPos);
+
if ( bNegativePage )
- aEndPos.X() = -aEndPos.X(); // don't modify aPos - used below
- if ( pObj->GetPoint( 1 ) != aEndPos )
+ {
+ aEndPos.setX(-aEndPos.getX()); // don't modify aPos - used below
+ }
+
+ if(!pObj->GetObjectPoint(1).equal(aEndPos))
{
if (bRecording)
AddCalcUndo< SdrUndoGeoObj> ( *pObj );
- pObj->SetPoint( aEndPos, 1 );
+
+ pObj->SetObjectPoint( aEndPos, 1 );
}
if( !bValid1 )
{
- Point aStartPos( aPos.X() - DET_ARROW_OFFSET, aPos.Y() - DET_ARROW_OFFSET );
- if (aStartPos.X() < 0)
- aStartPos.X() += (2 * DET_ARROW_OFFSET);
- if (aStartPos.Y() < 0)
- aStartPos.Y() += (2 * DET_ARROW_OFFSET);
+ basegfx::B2DPoint aStartPos(aPos.getX() - DET_ARROW_OFFSET, aPos.getY() - DET_ARROW_OFFSET);
+
+ if(aStartPos.getX() < 0.0)
+ {
+ aStartPos.setX(aStartPos.getX() + (2 * DET_ARROW_OFFSET));
+ }
+
+ if(aStartPos.getY() < 0.0)
+ {
+ aStartPos.setY(aStartPos.getY() + (2 * DET_ARROW_OFFSET));
+ }
+
if ( bNegativePage )
- aStartPos.X() = -aStartPos.X();
- if ( pObj->GetPoint( 0 ) != aStartPos )
+ {
+ aStartPos.setX(-aStartPos.getX());
+ }
+
+ if(!pObj->GetObjectPoint(0).equal(aStartPos))
{
if (bRecording)
AddCalcUndo< SdrUndoGeoObj >( *pObj );
- pObj->SetPoint( aStartPos, 0 );
+
+ pObj->SetObjectPoint( aStartPos, 0 );
}
}
}
@@ -673,35 +696,42 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool b
else // Referenz-Rahmen
{
DBG_ASSERT( bValid1, "ScDrawLayer::RecalcPos - invalid start position" );
- Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
- TwipsToMM( aPos.X() );
- TwipsToMM( aPos.Y() );
+ basegfx::B2DPoint aPos(pDoc->GetColOffset(nCol1, nTab1) * HMM_PER_TWIPS, pDoc->GetRowOffset(nRow1, nTab1) * HMM_PER_TWIPS);
if( bValid2 )
{
- Point aEnd( pDoc->GetColOffset( nCol2 + 1, nTab2 ), pDoc->GetRowOffset( nRow2 + 1, nTab2 ) );
- TwipsToMM( aEnd.X() );
- TwipsToMM( aEnd.Y() );
+ const basegfx::B2DPoint aEnd(pDoc->GetColOffset(nCol2 + 1, nTab2) + HMM_PER_TWIPS, pDoc->GetRowOffset(nRow2 + 1, nTab2) * HMM_PER_TWIPS);
+ basegfx::B2DRange aNew(aPos, aPos + aEnd);
- Rectangle aNew( aPos, aEnd );
if ( bNegativePage )
- MirrorRectRTL( aNew );
- if ( pObj->GetLogicRect() != aNew )
+ {
+ aNew = basegfx::B2DRange(-aNew.getMaxX(), aNew.getMinY(), -aNew.getMinX(), aNew.getMaxY());
+ }
+
+ if(!sdr::legacy::GetLogicRange(*pObj).equal(aNew))
{
if (bRecording)
AddCalcUndo< SdrUndoGeoObj >( *pObj );
- pObj->SetLogicRect(aNew);
+
+ sdr::legacy::SetLogicRange(*pObj, aNew);
}
}
else
{
if ( bNegativePage )
- aPos.X() = -aPos.X();
- if ( pObj->GetRelativePos() != aPos )
+ {
+ aPos.setX(-aPos.getX());
+ }
+
+ // #i108739# SC never used anchor, thus i simplified this to just TopLeft
+ const basegfx::B2DPoint aRelativePos(pObj->getSdrObjectTranslate());
+
+ if(!aRelativePos.equal(aPos))
{
if (bRecording)
AddCalcUndo< SdrUndoGeoObj >( *pObj );
- pObj->SetRelativePos( aPos );
+
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(aPos - aRelativePos));
}
}
}
@@ -766,7 +796,7 @@ sal_Bool ScDrawLayer::GetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool
{
//! Flags (ausgeblendet?) testen
- Rectangle aObjRect = pObject->GetCurrentBoundRect();
+ Rectangle aObjRect = sdr::legacy::GetBoundRect(*pObject);
sal_Bool bFit = sal_True;
if ( !bSetHor && ( aObjRect.Right() < nStartX || aObjRect.Left() > nEndX ) )
bFit = sal_False;
@@ -911,21 +941,22 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea,
{
if( GetAnchor( pObject ) == SCA_CELL )
{
- if ( GetObjData( pObject ) ) // Detektiv-Pfeil ?
+ if ( GetObjData( *pObject ) ) // Detektiv-Pfeil ?
{
// hier nichts
}
- else if ( pObject->ISA( SdrEdgeObj ) ) // Verbinder?
+ else if (pObject->IsSdrEdgeObj()) // Verbinder?
{
// hier auch nichts
//! nicht verbundene Enden wie bei Linien (s.u.) behandeln?
}
- else if ( pObject->IsPolyObj() && pObject->GetPointCount()==2 )
+ else if ( pObject->IsPolygonObject() && 2 == pObject->GetObjectPointCount() )
{
for (sal_uInt16 i=0; i<2; i++)
{
sal_Bool bMoved = sal_False;
- Point aPoint = pObject->GetPoint(i);
+ const basegfx::B2DPoint aB2DPoint(pObject->GetObjectPoint(i));
+ Point aPoint(basegfx::fround(aB2DPoint.getX()), basegfx::fround(aB2DPoint.getY()));
lcl_ReverseTwipsToMM( aPoint );
if (rArea.IsInside(aPoint))
{
@@ -951,13 +982,13 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea,
{
AddCalcUndo< SdrUndoGeoObj >( *pObject );
lcl_TwipsToMM( aPoint );
- pObject->SetPoint( aPoint, i );
+ pObject->SetObjectPoint( basegfx::B2DPoint(aPoint.X(), aPoint.Y()), i );
}
}
}
else
{
- Rectangle aObjRect = pObject->GetLogicRect();
+ Rectangle aObjRect(sdr::legacy::GetLogicRect(*pObject));
// aOldMMPos: not converted, millimeters
Point aOldMMPos = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft();
lcl_ReverseTwipsToMM( aObjRect );
@@ -1003,8 +1034,8 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea,
lcl_TwipsToMM( aNewPos );
aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() ); // millimeters
- AddCalcUndo< SdrUndoMoveObj >( *pObject, aMoveSize );
- pObject->Move( aMoveSize );
+ AddCalcUndo(new SdrUndoGeoObj(*pObject));
+ sdr::legacy::transformSdrObject(*pObject, basegfx::tools::createTranslateB2DHomMatrix(aMoveSize.Width(), aMoveSize.Height()));
}
else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) &&
!pObject->IsResizeProtect() )
@@ -1015,7 +1046,8 @@ void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea,
long nOldSizeX = aObjRect.Right() - aObjRect.Left() + 1;
long nOldSizeY = aObjRect.Bottom() - aObjRect.Top() + 1;
long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 ); // logical direction
- pObject->Resize( aOldMMPos, Fraction( nOldSizeX+nLogMoveX, nOldSizeX ),
+
+ sdr::legacy::ResizeSdrObject(*pObject, aOldMMPos, Fraction( nOldSizeX+nLogMoveX, nOldSizeX ),
Fraction( nOldSizeY+rMove.Y(), nOldSizeY ) );
}
}
@@ -1196,11 +1228,13 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR
SdrObject* pObject = aIter.Next();
while ( pObject && !bFound )
{
- aObjRect = pObject->GetSnapRect(); //! GetLogicRect ?
+ aObjRect = sdr::legacy::GetSnapRect(*pObject); //! GetLogicRect ?
// #i116164# note captions are handled separately, don't have to be included for each single row height change
if ( (aTestRect.IsInside(aObjRect.TopLeft()) || aTestRect.IsInside(aObjRect.BottomLeft())) &&
- (bIncludeNotes || !IsNoteCaption(pObject)) )
+ (bIncludeNotes || !IsNoteCaption(*pObject)) )
+ {
bFound = sal_True;
+ }
pObject = aIter.Next();
}
@@ -1216,10 +1250,8 @@ void ScDrawLayer::DeleteObjects( SCTAB nTab )
if (!pPage)
return;
- pPage->RecalcObjOrdNums();
-
long nDelCount = 0;
- sal_uLong nObjCount = pPage->GetObjCount();
+ sal_uInt32 nObjCount = pPage->GetObjCount();
if (nObjCount)
{
SdrObject** ppObj = new SdrObject*[nObjCount];
@@ -1239,7 +1271,7 @@ void ScDrawLayer::DeleteObjects( SCTAB nTab )
AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
for (i=1; i<=nDelCount; i++)
- pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
+ pPage->RemoveObjectFromSdrObjList( ppObj[nDelCount-i]->GetNavigationPosition() );
delete[] ppObj;
}
@@ -1258,10 +1290,8 @@ void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
if (!pPage)
return;
- pPage->RecalcObjOrdNums();
-
long nDelCount = 0;
- sal_uLong nObjCount = pPage->GetObjCount();
+ sal_uInt32 nObjCount = pPage->GetObjCount();
if (nObjCount)
{
Rectangle aDelRect = pDoc->GetMMRect( nCol1, nRow1, nCol2, nRow2, nTab );
@@ -1274,9 +1304,9 @@ void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
{
// do not delete note caption, they are always handled by the cell note
// TODO: detective objects are still deleted, is this desired?
- if (!IsNoteCaption( pObject ))
+ if (!IsNoteCaption( *pObject ))
{
- Rectangle aObjRect = pObject->GetCurrentBoundRect();
+ Rectangle aObjRect = sdr::legacy::GetBoundRect(*pObject);
if ( aDelRect.IsInside( aObjRect ) )
ppObj[nDelCount++] = pObject;
}
@@ -1290,7 +1320,7 @@ void ScDrawLayer::DeleteObjectsInArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1,
AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
for (i=1; i<=nDelCount; i++)
- pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
+ pPage->RemoveObjectFromSdrObjList( ppObj[nDelCount-i]->GetNavigationPosition() );
delete[] ppObj;
}
@@ -1315,9 +1345,8 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark )
SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
if (pPage)
{
- pPage->RecalcObjOrdNums();
long nDelCount = 0;
- sal_uLong nObjCount = pPage->GetObjCount();
+ sal_uInt32 nObjCount = pPage->GetObjCount();
if (nObjCount)
{
// Rechteck um die ganze Selektion
@@ -1333,9 +1362,9 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark )
{
// do not delete note caption, they are always handled by the cell note
// TODO: detective objects are still deleted, is this desired?
- if (!IsNoteCaption( pObject ))
+ if (!IsNoteCaption( *pObject ))
{
- Rectangle aObjRect = pObject->GetCurrentBoundRect();
+ Rectangle aObjRect = sdr::legacy::GetBoundRect(*pObject);
if ( aMarkBound.IsInside( aObjRect ) )
{
ScRange aRange = pDoc->GetRange( nTab, aObjRect );
@@ -1355,7 +1384,7 @@ void ScDrawLayer::DeleteObjectsInSelection( const ScMarkData& rMark )
AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
for (i=1; i<=nDelCount; i++)
- pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
+ pPage->RemoveObjectFromSdrObjList( ppObj[nDelCount-i]->GetNavigationPosition() );
delete[] ppObj;
}
@@ -1381,9 +1410,9 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle&
SdrObject* pOldObject = aIter.Next();
while (pOldObject)
{
- Rectangle aObjRect = pOldObject->GetCurrentBoundRect();
+ Rectangle aObjRect = sdr::legacy::GetBoundRect(*pOldObject);
// do not copy internal objects (detective) and note captions
- if ( rRange.IsInside( aObjRect ) && (pOldObject->GetLayer() != SC_LAYER_INTERN) && !IsNoteCaption( pOldObject ) )
+ if ( rRange.IsInside( aObjRect ) && (pOldObject->GetLayer() != SC_LAYER_INTERN) && !IsNoteCaption( *pOldObject ) )
{
if ( !pDestModel )
{
@@ -1402,17 +1431,9 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle&
DBG_ASSERT( pDestPage, "no page" );
if (pDestPage)
{
- // #116235#
- SdrObject* pNewObject = pOldObject->Clone();
- //SdrObject* pNewObject = pOldObject->Clone( pDestPage, pDestModel );
- pNewObject->SetModel(pDestModel);
- pNewObject->SetPage(pDestPage);
-
+ SdrObject* pNewObject = pOldObject->CloneSdrObject();
uno::Reference< chart2::XChartDocument > xOldChart( ScChartHelper::GetChartFromSdrObject( pOldObject ) );
- if(!xOldChart.is())//#i110034# do not move charts as they loose all their data references otherwise
- pNewObject->NbcMove(Size(0,0));
- pDestPage->InsertObject( pNewObject );
-
+ pDestPage->InsertObjectToSdrObjList(*pNewObject);
// no undo needed in clipboard document
// charts are not updated
}
@@ -1564,29 +1585,22 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
while (pOldObject)
{
- Rectangle aObjRect = pOldObject->GetCurrentBoundRect();
+ Rectangle aObjRect = sdr::legacy::GetBoundRect(*pOldObject);
// do not copy internal objects (detective) and note captions
- if ( rSourceRange.IsInside( aObjRect ) && (pOldObject->GetLayer() != SC_LAYER_INTERN) && !IsNoteCaption( pOldObject ) )
+ if ( rSourceRange.IsInside( aObjRect ) && (pOldObject->GetLayer() != SC_LAYER_INTERN) && !IsNoteCaption( *pOldObject ) )
{
- // #116235#
- SdrObject* pNewObject = pOldObject->Clone();
- //SdrObject* pNewObject = pOldObject->Clone( pDestPage, this );
- pNewObject->SetModel(this);
- pNewObject->SetPage(pDestPage);
-
+ SdrObject* pNewObject = pOldObject->CloneSdrObject();
if ( bMirrorObj )
MirrorRTL( pNewObject ); // first mirror, then move
- pNewObject->NbcMove( aMove );
+ sdr::legacy::MoveSdrObject(*pNewObject, aMove );
if ( bResize )
- pNewObject->NbcResize( aRefPos, aHorFract, aVerFract );
+ sdr::legacy::ResizeSdrObject(*pNewObject, aRefPos, aHorFract, aVerFract );
- pDestPage->InsertObject( pNewObject );
+ pDestPage->InsertObjectToSdrObjList(*pNewObject);
if (bRecording)
AddCalcUndo< SdrUndoInsertObj >( *pNewObject );
- //#i110034# handle chart data references (after InsertObject)
-
if ( pNewObject->GetObjIdentifier() == OBJ_OLE2 )
{
uno::Reference< embed::XEmbeddedObject > xIPObj = ((SdrOle2Obj*)pNewObject)->GetObjRef();
@@ -1685,7 +1699,7 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj )
{
SdrObjTransformInfoRec aInfo;
pObj->TakeObjInfo( aInfo );
- bCanMirror = aInfo.bMirror90Allowed;
+ bCanMirror = aInfo.mbMirror90Allowed;
}
if (bCanMirror)
@@ -1694,18 +1708,22 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj )
Point aRef2( 0, 1 );
if (bRecording)
AddCalcUndo< SdrUndoGeoObj >( *pObj );
- pObj->Mirror( aRef1, aRef2 );
+ sdr::legacy::MirrorSdrObject(*pObj, aRef1, aRef2 );
}
else
{
// Move instead of mirroring:
// New start position is negative of old end position
// -> move by sum of start and end position
- Rectangle aObjRect = pObj->GetLogicRect();
- Size aMoveSize( -(aObjRect.Left() + aObjRect.Right()), 0 );
+ const basegfx::B2DRange aObjRange(sdr::legacy::GetLogicRange(*pObj));
+ const double aDeltaX(-aObjRange.getMinX() - aObjRange.getMaxX());
+
if (bRecording)
- AddCalcUndo< SdrUndoMoveObj >( *pObj, aMoveSize );
- pObj->Move( aMoveSize );
+ {
+ AddCalcUndo(new SdrUndoGeoObj(*pObj));
+ }
+
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(aDeltaX, 0.0));
}
}
@@ -1718,6 +1736,12 @@ void ScDrawLayer::MirrorRectRTL( Rectangle& rRect )
rRect.Right() = -nTemp;
}
+basegfx::B2DRange ScDrawLayer::GetCellRange(ScDocument& rDoc, const ScAddress& rPos, bool bMergedCell)
+{
+ const Rectangle aCellRect(GetCellRect(rDoc, rPos, bMergedCell));
+ return basegfx::B2DRange(aCellRect.Left(), aCellRect.Top(), aCellRect.Right(), aCellRect.Bottom());
+}
+
Rectangle ScDrawLayer::GetCellRect( ScDocument& rDoc, const ScAddress& rPos, bool bMergedCell )
{
Rectangle aCellRect;
@@ -1788,8 +1812,8 @@ inline sal_Bool IsNamedObject( SdrObject* pObj, const String& rName )
SdrObject* ScDrawLayer::GetNamedObject( const String& rName, sal_uInt16 nId, SCTAB& rFoundTab ) const
{
- sal_uInt16 nTabCount = GetPageCount();
- for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++)
+ const sal_uInt32 nTabCount(GetPageCount());
+ for (sal_uInt32 nTab=0; nTab<nTabCount; nTab++)
{
const SdrPage* pPage = GetPage(nTab);
DBG_ASSERT(pPage,"Page ?");
@@ -1841,8 +1865,8 @@ void ScDrawLayer::EnsureGraphicNames()
{
// make sure all graphic objects have names (after Excel import etc.)
- sal_uInt16 nTabCount = GetPageCount();
- for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++)
+ const sal_uInt32 nTabCount(GetPageCount());
+ for (sal_uInt32 nTab=0; nTab<nTabCount; nTab++)
{
SdrPage* pPage = GetPage(nTab);
DBG_ASSERT(pPage,"Page ?");
@@ -1873,8 +1897,9 @@ void ScDrawLayer::SetAnchor( SdrObject* pObj, ScAnchorType eType )
// Ein an der Seite verankertes Objekt zeichnet sich durch eine Anker-Pos
// von (0,1) aus. Das ist ein shabby Trick, der aber funktioniert!
- Point aAnchor( 0, eType == SCA_PAGE ? 1 : 0 );
- pObj->SetAnchorPos( aAnchor );
+
+ // #i108739# get rid of that SC anchor hack, replace with bool flag
+ pObj->setUniversalApplicationFlag01(SCA_PAGE == eType);
if ( eOldAnchorType != eType )
pObj->notifyShapePropertyChange( ::svx::eSpreadsheetAnchor );
@@ -1882,32 +1907,33 @@ void ScDrawLayer::SetAnchor( SdrObject* pObj, ScAnchorType eType )
ScAnchorType ScDrawLayer::GetAnchor( const SdrObject* pObj )
{
- Point aAnchor( pObj->GetAnchorPos() );
- return ( aAnchor.Y() != 0 ) ? SCA_PAGE : SCA_CELL;
+ // #i108739# get rid of that SC anchor hack, replace with bool flag
+ return pObj->getUniversalApplicationFlag01() ? SCA_PAGE : SCA_CELL;
}
-ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate ) // static
+ScDrawObjData* ScDrawLayer::GetObjData( const SdrObject& rObj, sal_Bool bCreate ) // static
{
- sal_uInt16 nCount = pObj ? pObj->GetUserDataCount() : 0;
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ const sal_uInt32 nCount(rObj.GetUserDataCount());
+
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
- SdrObjUserData* pData = pObj->GetUserData( i );
+ SdrObjUserData* pData = rObj.GetUserData( i );
if( pData && pData->GetInventor() == SC_DRAWLAYER
&& pData->GetId() == SC_UD_OBJDATA )
return (ScDrawObjData*) pData;
}
- if( pObj && bCreate )
+ if( bCreate )
{
ScDrawObjData* pData = new ScDrawObjData;
- pObj->InsertUserData( pData, 0 );
+ const_cast< SdrObject& >(rObj).InsertUserData( pData, 0 );
return pData;
}
return 0;
}
-ScDrawObjData* ScDrawLayer::GetObjDataTab( SdrObject* pObj, SCTAB nTab ) // static
+ScDrawObjData* ScDrawLayer::GetObjDataTab( const SdrObject& rObj, SCTAB nTab ) // static
{
- ScDrawObjData* pData = GetObjData( pObj );
+ ScDrawObjData* pData = GetObjData( rObj );
if ( pData )
{
if ( pData->maStart.IsValid() )
@@ -1918,22 +1944,25 @@ ScDrawObjData* ScDrawLayer::GetObjDataTab( SdrObject* pObj, SCTAB nTab ) // s
return pData;
}
-bool ScDrawLayer::IsNoteCaption( SdrObject* pObj )
+bool ScDrawLayer::IsNoteCaption( const SdrObject& rObj )
{
- ScDrawObjData* pData = pObj ? GetObjData( pObj ) : 0;
+ ScDrawObjData* pData = GetObjData( rObj );
+
return pData && pData->mbNote;
}
-ScDrawObjData* ScDrawLayer::GetNoteCaptionData( SdrObject* pObj, SCTAB nTab )
+ScDrawObjData* ScDrawLayer::GetNoteCaptionData( const SdrObject& rObj, SCTAB nTab )
{
- ScDrawObjData* pData = pObj ? GetObjDataTab( pObj, nTab ) : 0;
+ ScDrawObjData* pData = GetObjDataTab( rObj, nTab );
+
return (pData && pData->mbNote) ? pData : 0;
}
ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj ) // static
{
- sal_uInt16 nCount = pObj->GetUserDataCount();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ const sal_uInt32 nCount(pObj->GetUserDataCount());
+
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
SdrObjUserData* pData = pObj->GetUserData( i );
if( pData && pData->GetInventor() == SC_DRAWLAYER
@@ -1944,65 +1973,67 @@ ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj ) // static
}
// static:
-IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
- const Point& rWinPoint, const Window& rCmpWnd )
-{
- const MapMode aMap100( MAP_100TH_MM );
- MapMode aWndMode = rCmpWnd.GetMapMode();
- Point aRelPoint( rCmpWnd.LogicToLogic( rWinPoint, &aWndMode, &aMap100 ) );
- Rectangle aLogRect = rCmpWnd.LogicToLogic( pObj->GetLogicRect(), &aWndMode, &aMap100 );
- ScIMapInfo* pIMapInfo = GetIMapInfo( pObj );
+IMapObject* ScDrawLayer::GetHitIMapObject(SdrObject& rObj, const basegfx::B2DPoint& rWinPoint, const Window& rCmpWnd)
+{
+ const basegfx::B2DHomMatrix aTransWinTo100thmm(rCmpWnd.GetTransformLogicToLogic(rCmpWnd.GetMapMode(), MapMode(MAP_100TH_MM)));
+ basegfx::B2DPoint aRelPoint(aTransWinTo100thmm * rWinPoint);
+ basegfx::B2DRange aLogRange(sdr::legacy::GetLogicRange(rObj));
+ aLogRange.transform(aTransWinTo100thmm);
+ ScIMapInfo* pIMapInfo = GetIMapInfo(&rObj);
IMapObject* pIMapObj = NULL;
if ( pIMapInfo )
{
Size aGraphSize;
ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap();
- Graphic aGraphic;
- sal_Bool bObjSupported = sal_False;
+ bool bObjSupported(false);
+ const SdrGrafObj* pGrafObj = dynamic_cast< const SdrGrafObj* >(&rObj);
- if ( pObj->ISA( SdrGrafObj ) ) // einfaches Grafik-Objekt
+ if ( pGrafObj ) // einfaches Grafik-Objekt
{
- const SdrGrafObj* pGrafObj = (const SdrGrafObj*) pObj;
- const GeoStat& rGeo = pGrafObj->GetGeoStat();
- const Graphic& rGraphic = pGrafObj->GetGraphic();
+ // remove shear, mirror and rotation; so just absolute scale and translation get applied
+ basegfx::B2DHomMatrix aJustAbsScaleTranslate(pGrafObj->getSdrObjectTransformation());
- // Drehung rueckgaengig
- if ( rGeo.nDrehWink )
- RotatePoint( aRelPoint, aLogRect.TopLeft(), -rGeo.nSin, rGeo.nCos );
-
- // Spiegelung rueckgaengig
- if ( ( (const SdrGrafObjGeoData*) pGrafObj->GetGeoData() )->bMirrored )
- aRelPoint.X() = aLogRect.Right() + aLogRect.Left() - aRelPoint.X();
-
- // ggf. Unshear:
- if ( rGeo.nShearWink )
- ShearPoint( aRelPoint, aLogRect.TopLeft(), -rGeo.nTan );
+ aJustAbsScaleTranslate.invert();
+ aJustAbsScaleTranslate.scale(basegfx::absolute(pGrafObj->getSdrObjectScale()));
+ aJustAbsScaleTranslate.translate(pGrafObj->getSdrObjectTranslate());
+ aRelPoint = aJustAbsScaleTranslate * aRelPoint;
+ const Graphic& rGraphic = pGrafObj->GetGraphic();
if ( rGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
- aGraphSize = rCmpWnd.PixelToLogic( rGraphic.GetPrefSize(),
- aMap100 );
+ {
+ aGraphSize = rCmpWnd.PixelToLogic( rGraphic.GetPrefSize(), MapMode( MAP_100TH_MM ) );
+ }
else
+ {
+ const MapMode aMap100( MAP_100TH_MM );
aGraphSize = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(),
- rGraphic.GetPrefMapMode(),
- aMap100 );
+ rGraphic.GetPrefMapMode(), MapMode( MAP_100TH_MM ) );
+ }
- bObjSupported = sal_True;
+ bObjSupported = true;
}
- else if ( pObj->ISA( SdrOle2Obj ) ) // OLE-Objekt
+ else
+ {
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&rObj);
+
+ if ( pSdrOle2Obj ) // OLE-Objekt
{
// TODO/LEAN: working with visual area needs running state
- aGraphSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize();
- bObjSupported = sal_True;
+ aGraphSize = pSdrOle2Obj->GetOrigObjSize();
+ bObjSupported = true;
+ }
}
// hat alles geklappt, dann HitTest ausfuehren
if ( bObjSupported )
{
// relativen Mauspunkt berechnen
- aRelPoint -= aLogRect.TopLeft();
- pIMapObj = rImageMap.GetHitIMapObject( aGraphSize, aLogRect.GetSize(), aRelPoint );
+ aRelPoint -= aLogRange.getMinimum();
+ const Size aDisplaySize(basegfx::fround(aLogRange.getWidth()), basegfx::fround(aLogRange.getHeight()));
+ const Point aRelHitPoint(basegfx::fround(aRelPoint.getX()), basegfx::fround(aRelPoint.getY()));
+ pIMapObj = rImageMap.GetHitIMapObject(aGraphSize, aDisplaySize, aRelHitPoint);
}
}
@@ -2011,8 +2042,9 @@ IMapObject* ScDrawLayer::GetHitIMapObject( SdrObject* pObj,
ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, sal_Bool bCreate ) // static
{
- sal_uInt16 nCount = pObj->GetUserDataCount();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ const sal_uInt32 nCount(pObj->GetUserDataCount());
+
+ for( sal_uInt32 i = 0; i < nCount; i++ )
{
SdrObjUserData* pData = pObj->GetUserData( i );
if( pData && pData->GetInventor() == SC_DRAWLAYER
@@ -2034,7 +2066,7 @@ void ScDrawLayer::SetGlobalDrawPersist(SfxObjectShell* pPersist) // s
pGlobalDrawPersist = pPersist;
}
-void __EXPORT ScDrawLayer::SetChanged( sal_Bool bFlg /* = sal_True */ )
+void __EXPORT ScDrawLayer::SetChanged( bool bFlg /* = true */ )
{
if ( bFlg && pDoc )
pDoc->SetChartListenerCollectionNeedsUpdate( sal_True );
diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx
index ed4aeac83bad..8783cf640dc1 100644
--- a/sc/source/core/data/markarr.cxx
+++ b/sc/source/core/data/markarr.cxx
@@ -29,10 +29,10 @@
// INCLUDE ---------------------------------------------------------------
#include <tools/debug.hxx>
-
#include "markarr.hxx"
#include "global.hxx"
#include "address.hxx"
+#include <memory.h>
// STATIC DATA -----------------------------------------------------------
diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx
index 47df2071ebea..44a38c4070d6 100644
--- a/sc/source/core/data/markdata.cxx
+++ b/sc/source/core/data/markdata.cxx
@@ -29,10 +29,10 @@
// INCLUDE ---------------------------------------------------------------
#include <tools/debug.hxx>
-
#include "markdata.hxx"
#include "markarr.hxx"
#include "rangelst.hxx"
+#include <memory.h>
// STATIC DATA -----------------------------------------------------------
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 8bf7ef2d4b8d..444871d94dca 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -40,8 +40,7 @@
#include <svx/xlnstcit.hxx>
#include <svx/sxcecitm.hxx>
#include <svx/xflclit.hxx>
-#include <svx/sdshitm.hxx>
-#include <svx/sdsxyitm.hxx>
+#include <svx/svdlegacy.hxx>
#include "document.hxx"
#include "docpool.hxx"
@@ -104,7 +103,7 @@ void ScCaptionUtil::SetBasicCaptionSettings( SdrCaptionObj& rCaption, bool bShow
void ScCaptionUtil::SetCaptionUserData( SdrCaptionObj& rCaption, const ScAddress& rPos )
{
// pass true to ScDrawLayer::GetObjData() to create the object data entry
- ScDrawObjData* pObjData = ScDrawLayer::GetObjData( &rCaption, true );
+ ScDrawObjData* pObjData = ScDrawLayer::GetObjData( rCaption, true );
OSL_ENSURE( pObjData, "ScCaptionUtil::SetCaptionUserData - missing drawing object user data" );
pObjData->maStart = rPos;
pObjData->mbNote = true;
@@ -134,17 +133,17 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc )
/* SdrShadowItem has sal_False, instead the shadow is set for the
rectangle only with SetSpecialTextBoxShadow() when the object is
created (item must be set to adjust objects from older files). */
- aItemSet.Put( SdrShadowItem( sal_False ) );
- aItemSet.Put( SdrShadowXDistItem( 100 ) );
- aItemSet.Put( SdrShadowYDistItem( 100 ) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_SHADOW, sal_False ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_SHADOWXDIST, 100 ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_SHADOWYDIST, 100 ) );
// text attributes
- aItemSet.Put( SdrTextLeftDistItem( 100 ) );
- aItemSet.Put( SdrTextRightDistItem( 100 ) );
- aItemSet.Put( SdrTextUpperDistItem( 100 ) );
- aItemSet.Put( SdrTextLowerDistItem( 100 ) );
- aItemSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aItemSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 100 ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 100 ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 100 ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 100 ) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_True ) );
// #78943# use the default cell style to be able to modify the caption font
const ScPatternAttr& rDefPattern = static_cast< const ScPatternAttr& >( rDoc.GetPool()->GetDefaultItem( ATTR_PATTERN ) );
rDefPattern.FillEditItemSet( &aItemSet );
@@ -157,9 +156,9 @@ void ScCaptionUtil::SetCaptionItems( SdrCaptionObj& rCaption, const SfxItemSet&
// copy all items
rCaption.SetMergedItemSet( rItemSet );
// reset shadow items
- rCaption.SetMergedItem( SdrShadowItem( sal_False ) );
- rCaption.SetMergedItem( SdrShadowXDistItem( 100 ) );
- rCaption.SetMergedItem( SdrShadowYDistItem( 100 ) );
+ rCaption.SetMergedItem( SdrOnOffItem(SDRATTR_SHADOW, sal_False ) );
+ rCaption.SetMergedItem( SdrMetricItem(SDRATTR_SHADOWXDIST, 100 ) );
+ rCaption.SetMergedItem( SdrMetricItem(SDRATTR_SHADOWYDIST, 100 ) );
rCaption.SetSpecialTextBoxShadow();
}
@@ -181,18 +180,18 @@ public:
inline SdrCaptionObj* GetCaption() { return mpCaption; }
/** Moves the caption inside the passed rectangle. Uses page area if 0 is passed. */
- void FitCaptionToRect( const Rectangle* pVisRect = 0 );
+ void FitCaptionToRect( const basegfx::B2DRange* pVisRange = 0 );
/** Places the caption inside the passed rectangle, tries to keep the cell rectangle uncovered. Uses page area if 0 is passed. */
- void AutoPlaceCaption( const Rectangle* pVisRect = 0 );
+ void AutoPlaceCaption( const basegfx::B2DRange* pVisRange = 0 );
/** Updates caption tail and textbox according to current cell position. Uses page area if 0 is passed. */
- void UpdateCaptionPos( const Rectangle* pVisRect = 0 );
+ void UpdateCaptionPos( const basegfx::B2DRange* pVisRange = 0 );
protected:
/** Helper constructor for derived classes. */
explicit ScCaptionCreator( ScDocument& rDoc, const ScAddress& rPos );
/** Calculates the caption tail position according to current cell position. */
- Point CalcTailPos( bool bTailFront );
+ basegfx::B2DPoint CalcTailPos( bool bTailFront );
/** Implements creation of the caption object. The caption will not be inserted into the document. */
void CreateCaption( bool bShown, bool bTailFront );
@@ -200,14 +199,14 @@ private:
/** Initializes all members. */
void Initialize();
/** Returns the passed rectangle if existing, page rectangle otherwise. */
- inline const Rectangle& GetVisRect( const Rectangle* pVisRect ) const { return pVisRect ? *pVisRect : maPageRect; }
+ inline const basegfx::B2DRange& GetVisRange(const basegfx::B2DRange* pVisRange) const { return pVisRange ? *pVisRange : maPageRange; }
private:
ScDocument& mrDoc;
ScAddress maPos;
SdrCaptionObj* mpCaption;
- Rectangle maPageRect;
- Rectangle maCellRect;
+ basegfx::B2DRange maPageRange;
+ basegfx::B2DRange maCellRange;
bool mbNegPage;
};
@@ -244,107 +243,105 @@ SdrPage* ScCaptionCreator::GetDrawPage()
return pDrawLayer ? pDrawLayer->GetPage( static_cast< sal_uInt16 >( maPos.Tab() ) ) : 0;
}
-void ScCaptionCreator::FitCaptionToRect( const Rectangle* pVisRect )
+void ScCaptionCreator::FitCaptionToRect( const basegfx::B2DRange* pVisRange )
{
- const Rectangle& rVisRect = GetVisRect( pVisRect );
+ const basegfx::B2DRange& rVisRange = GetVisRange( pVisRange );
// tail position
- Point aTailPos = mpCaption->GetTailPos();
- aTailPos.X() = ::std::max( ::std::min( aTailPos.X(), rVisRect.Right() ), rVisRect.Left() );
- aTailPos.Y() = ::std::max( ::std::min( aTailPos.Y(), rVisRect.Bottom() ), rVisRect.Top() );
- mpCaption->SetTailPos( aTailPos );
+ mpCaption->SetTailPos(rVisRange.clamp(mpCaption->GetTailPos()));
// caption rectangle
- Rectangle aCaptRect = mpCaption->GetLogicRect();
- Point aCaptPos = aCaptRect.TopLeft();
+ basegfx::B2DRange aCaptRange(sdr::legacy::GetLogicRange(*mpCaption));
+ basegfx::B2DPoint aCaptPos(aCaptRange.getMinimum());
// move textbox inside right border of visible area
- aCaptPos.X() = ::std::min< long >( aCaptPos.X(), rVisRect.Right() - aCaptRect.GetWidth() );
+ aCaptPos.setX(::std::min(aCaptPos.getX(), rVisRange.getMaxX() - aCaptRange.getWidth()));
// move textbox inside left border of visible area (this may move it outside on right side again)
- aCaptPos.X() = ::std::max< long >( aCaptPos.X(), rVisRect.Left() );
+ aCaptPos.setX(::std::max(aCaptPos.getX(), rVisRange.getMinX()));
// move textbox inside bottom border of visible area
- aCaptPos.Y() = ::std::min< long >( aCaptPos.Y(), rVisRect.Bottom() - aCaptRect.GetHeight() );
+ aCaptPos.setY(::std::min(aCaptPos.getY(), rVisRange.getMaxY() - aCaptRange.getHeight()));
// move textbox inside top border of visible area (this may move it outside on bottom side again)
- aCaptPos.Y() = ::std::max< long >( aCaptPos.Y(), rVisRect.Top() );
+ aCaptPos.setY(::std::max(aCaptPos.getY(), rVisRange.getMinY()));
// update caption
- aCaptRect.SetPos( aCaptPos );
- mpCaption->SetLogicRect( aCaptRect );
+ aCaptRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aCaptPos - aCaptRange.getMinimum()));
+ sdr::legacy::SetLogicRange(*mpCaption, aCaptRange);
}
-void ScCaptionCreator::AutoPlaceCaption( const Rectangle* pVisRect )
+void ScCaptionCreator::AutoPlaceCaption( const basegfx::B2DRange* pVisRange )
{
- const Rectangle& rVisRect = GetVisRect( pVisRect );
+ const basegfx::B2DRange& rVisRange = GetVisRange( pVisRange );
// caption rectangle
- Rectangle aCaptRect = mpCaption->GetLogicRect();
- long nWidth = aCaptRect.GetWidth();
- long nHeight = aCaptRect.GetHeight();
+ basegfx::B2DRange aCaptRange(sdr::legacy::GetLogicRange(*mpCaption));
// n***Space contains available space between border of visible area and cell
- long nLeftSpace = maCellRect.Left() - rVisRect.Left() + 1;
- long nRightSpace = rVisRect.Right() - maCellRect.Right() + 1;
- long nTopSpace = maCellRect.Top() - rVisRect.Top() + 1;
- long nBottomSpace = rVisRect.Bottom() - maCellRect.Bottom() + 1;
+ const double fLeftSpace(maCellRange.getMinX() - rVisRange.getMinX());
+ const double fRightSpace(rVisRange.getMaxX() - maCellRange.getMaxX());
+ const double fTopSpace(maCellRange.getMinY() - rVisRange.getMinY());
+ const double fBottomSpace(rVisRange.getMaxY() - maCellRange.getMaxY());
// nNeeded*** contains textbox dimensions plus needed distances to cell or border of visible area
- long nNeededSpaceX = nWidth + SC_NOTECAPTION_CELLDIST;
- long nNeededSpaceY = nHeight + SC_NOTECAPTION_CELLDIST;
+ const double fNeededSpaceX(aCaptRange.getWidth() + SC_NOTECAPTION_CELLDIST);
+ const double fNeededSpaceY(aCaptRange.getHeight() + SC_NOTECAPTION_CELLDIST);
// bFitsWidth*** == true means width of textbox fits into horizontal free space of visible area
- bool bFitsWidthLeft = nNeededSpaceX <= nLeftSpace; // text box width fits into the width left of cell
- bool bFitsWidthRight = nNeededSpaceX <= nRightSpace; // text box width fits into the width right of cell
- bool bFitsWidth = nWidth <= rVisRect.GetWidth(); // text box width fits into width of visible area
+ const bool bFitsWidthLeft(fNeededSpaceX <= fLeftSpace); // text box width fits into the width left of cell
+ const bool bFitsWidthRight(fNeededSpaceX <= fRightSpace); // text box width fits into the width right of cell
+ const bool bFitsWidth(aCaptRange.getWidth() <= rVisRange.getWidth()); // text box width fits into width of visible area
// bFitsHeight*** == true means height of textbox fits into vertical free space of visible area
- bool bFitsHeightTop = nNeededSpaceY <= nTopSpace; // text box height fits into the height above cell
- bool bFitsHeightBottom = nNeededSpaceY <= nBottomSpace; // text box height fits into the height below cell
- bool bFitsHeight = nHeight <= rVisRect.GetHeight(); // text box height fits into height of visible area
+ const bool bFitsHeightTop(fNeededSpaceY <= fTopSpace); // text box height fits into the height above cell
+ const bool bFitsHeightBottom(fNeededSpaceY <= fBottomSpace); // text box height fits into the height below cell
+ const bool bFitsHeight(aCaptRange.getHeight() <= rVisRange.getHeight()); // text box height fits into height of visible area
// bFits*** == true means the textbox fits completely into free space of visible area
- bool bFitsLeft = bFitsWidthLeft && bFitsHeight;
- bool bFitsRight = bFitsWidthRight && bFitsHeight;
- bool bFitsTop = bFitsWidth && bFitsHeightTop;
- bool bFitsBottom = bFitsWidth && bFitsHeightBottom;
+ const bool bFitsLeft(bFitsWidthLeft && bFitsHeight);
+ const bool bFitsRight(bFitsWidthRight && bFitsHeight);
+ const bool bFitsTop(bFitsWidth && bFitsHeightTop);
+ const bool bFitsBottom(bFitsWidth && bFitsHeightBottom);
+
+ basegfx::B2DPoint aCaptPos(0.0, 0.0);
- Point aCaptPos;
// use left/right placement if possible, or if top/bottom placement not possible
if( bFitsLeft || bFitsRight || (!bFitsTop && !bFitsBottom) )
{
// prefer left in RTL sheet and right in LTR sheets
- bool bPreferLeft = bFitsLeft && (mbNegPage || !bFitsRight);
- bool bPreferRight = bFitsRight && (!mbNegPage || !bFitsLeft);
+ const bool bPreferLeft(bFitsLeft && (mbNegPage || !bFitsRight));
+ const bool bPreferRight(bFitsRight && (!mbNegPage || !bFitsLeft));
+
// move to left, if left is preferred, or if neither left nor right fit and there is more space to the left
- if( bPreferLeft || (!bPreferRight && (nLeftSpace > nRightSpace)) )
- aCaptPos.X() = maCellRect.Left() - SC_NOTECAPTION_CELLDIST - nWidth;
+ if( bPreferLeft || (!bPreferRight && (fLeftSpace > fRightSpace)) )
+ aCaptPos.setX(maCellRange.getMinX() - SC_NOTECAPTION_CELLDIST - aCaptRange.getWidth());
else // to right
- aCaptPos.X() = maCellRect.Right() + SC_NOTECAPTION_CELLDIST;
+ aCaptPos.setX(maCellRange.getMaxX() + SC_NOTECAPTION_CELLDIST);
// Y position according to top cell border
- aCaptPos.Y() = maCellRect.Top() + SC_NOTECAPTION_OFFSET_Y;
+ aCaptPos.setY(maCellRange.getMinY() + SC_NOTECAPTION_OFFSET_Y);
}
else // top or bottom placement
{
// X position
- aCaptPos.X() = maCellRect.Left() + SC_NOTECAPTION_OFFSET_X;
+ aCaptPos.setX(maCellRange.getMinX() + SC_NOTECAPTION_OFFSET_X);
// top placement, if possible
if( bFitsTop )
- aCaptPos.Y() = maCellRect.Top() - SC_NOTECAPTION_CELLDIST - nHeight;
+ aCaptPos.setY(maCellRange.getMinY() - SC_NOTECAPTION_CELLDIST - aCaptRange.getHeight());
else // bottom placement
- aCaptPos.Y() = maCellRect.Bottom() + SC_NOTECAPTION_CELLDIST;
+ aCaptPos.setY(maCellRange.getMaxY() + SC_NOTECAPTION_CELLDIST);
}
// update textbox position in note caption object
- aCaptRect.SetPos( aCaptPos );
- mpCaption->SetLogicRect( aCaptRect );
- FitCaptionToRect( pVisRect );
+ aCaptRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aCaptPos - aCaptRange.getMinimum()));
+ sdr::legacy::SetLogicRange(*mpCaption, aCaptRange);
+ FitCaptionToRect(pVisRange);
}
-void ScCaptionCreator::UpdateCaptionPos( const Rectangle* pVisRect )
+void ScCaptionCreator::UpdateCaptionPos( const basegfx::B2DRange* pVisRange )
{
ScDrawLayer* pDrawLayer = mrDoc.GetDrawLayer();
// update caption position
- const Point& rOldTailPos = mpCaption->GetTailPos();
- Point aTailPos = CalcTailPos( false );
- if( rOldTailPos != aTailPos )
+ const basegfx::B2DPoint& rOldTailPos = mpCaption->GetTailPos();
+ const basegfx::B2DPoint aTailPos(CalcTailPos(false));
+
+ if(!rOldTailPos.equal(aTailPos))
{
// create drawing undo action
if( pDrawLayer )
@@ -353,20 +350,20 @@ void ScCaptionCreator::UpdateCaptionPos( const Rectangle* pVisRect )
pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoGeoObject( *mpCaption ) );
// calculate new caption rectangle (#i98141# handle LTR<->RTL switch correctly)
- Rectangle aCaptRect = mpCaption->GetLogicRect();
- long nDiffX = (rOldTailPos.X() >= 0) ? (aCaptRect.Left() - rOldTailPos.X()) : (rOldTailPos.X() - aCaptRect.Right());
- if( mbNegPage ) nDiffX = -nDiffX - aCaptRect.GetWidth();
- long nDiffY = aCaptRect.Top() - rOldTailPos.Y();
- aCaptRect.SetPos( aTailPos + Point( nDiffX, nDiffY ) );
+ basegfx::B2DRange aCaptRange(sdr::legacy::GetLogicRange(*mpCaption));
+ double fDiffX((rOldTailPos.getX() >= 0.0) ? (aCaptRange.getMinX() - rOldTailPos.getX()) : (rOldTailPos.getX() - aCaptRange.getMaxX()));
+ if( mbNegPage ) fDiffX = -fDiffX - aCaptRange.getWidth();
+ const double fDiffY(aCaptRange.getMinY() - rOldTailPos.getY());
+ aCaptRange.transform(basegfx::tools::createTranslateB2DHomMatrix(fDiffX, fDiffY));
// set new tail position and caption rectangle
mpCaption->SetTailPos( aTailPos );
- mpCaption->SetLogicRect( aCaptRect );
+ sdr::legacy::SetLogicRange(*mpCaption, aCaptRange);
// fit caption into draw page
- FitCaptionToRect( pVisRect );
+ FitCaptionToRect(pVisRange);
}
// update cell position in caption user data
- ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( mpCaption, maPos.Tab() );
+ ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( *mpCaption, maPos.Tab() );
if( pCaptData && (maPos != pCaptData->maStart) )
{
// create drawing undo action
@@ -377,38 +374,44 @@ void ScCaptionCreator::UpdateCaptionPos( const Rectangle* pVisRect )
}
}
-Point ScCaptionCreator::CalcTailPos( bool bTailFront )
+basegfx::B2DPoint ScCaptionCreator::CalcTailPos( bool bTailFront )
{
// tail position
- bool bTailLeft = bTailFront != mbNegPage;
- Point aTailPos = bTailLeft ? maCellRect.TopLeft() : maCellRect.TopRight();
+ const bool bTailLeft(bTailFront != mbNegPage);
+ basegfx::B2DPoint aTailPos(bTailLeft ? maCellRange.getMinX() : maCellRange.getMaxX(), maCellRange.getMinY());
// move caption point 1/10 mm inside cell
- if( bTailLeft ) aTailPos.X() += 10; else aTailPos.X() -= 10;
- aTailPos.Y() += 10;
+ if( bTailLeft ) aTailPos.setX(aTailPos.getX() + 10.0); else aTailPos.setX(aTailPos.getX() - 10.0);
+ aTailPos.setY(aTailPos.getY() + 10.0);
return aTailPos;
}
void ScCaptionCreator::CreateCaption( bool bShown, bool bTailFront )
{
// create the caption drawing object
- Rectangle aTextRect( Point( 0 , 0 ), Size( SC_NOTECAPTION_WIDTH, SC_NOTECAPTION_HEIGHT ) );
- Point aTailPos = CalcTailPos( bTailFront );
- mpCaption = new SdrCaptionObj( aTextRect, aTailPos );
+ const basegfx::B2DPoint aTailPos(CalcTailPos(bTailFront));
+
+ if(!mrDoc.GetDrawLayer())
+ {
+ mrDoc.InitDrawLayer();
+ }
+
+ mpCaption = new SdrCaptionObj(
+ *mrDoc.GetDrawLayer(),
+ basegfx::tools::createScaleB2DHomMatrix(
+ SC_NOTECAPTION_WIDTH, SC_NOTECAPTION_HEIGHT),
+ &aTailPos);
+
// basic caption settings
ScCaptionUtil::SetBasicCaptionSettings( *mpCaption, bShown );
}
void ScCaptionCreator::Initialize()
{
- maCellRect = ScDrawLayer::GetCellRect( mrDoc, maPos, true );
+ maCellRange = ScDrawLayer::GetCellRange( mrDoc, maPos, true );
mbNegPage = mrDoc.IsNegativePage( maPos.Tab() );
if( SdrPage* pDrawPage = GetDrawPage() )
{
- maPageRect = Rectangle( Point( 0, 0 ), pDrawPage->GetSize() );
- /* #i98141# SdrPage::GetSize() returns negative width in RTL mode.
- The call to Rectangle::Adjust() orders left/right coordinate
- accordingly. */
- maPageRect.Justify();
+ maPageRange = basegfx::B2DRange(0.0, 0.0, pDrawPage->GetPageScale().getX(), pDrawPage->GetPageScale().getY());
}
}
@@ -442,7 +445,7 @@ ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& r
// store note position in user data of caption object
ScCaptionUtil::SetCaptionUserData( *rNoteData.mpCaption, rPos );
// insert object into draw page
- pDrawPage->InsertObject( rNoteData.mpCaption );
+ pDrawPage->InsertObjectToSdrObjList(*rNoteData.mpCaption);
}
}
}
@@ -452,8 +455,8 @@ ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& r
{
SdrPage* pDrawPage = GetDrawPage();
OSL_ENSURE( pDrawPage, "ScNoteCaptionCreator::ScNoteCaptionCreator - no drawing page" );
- OSL_ENSURE( rCaption.GetPage() == pDrawPage, "ScNoteCaptionCreator::ScNoteCaptionCreator - wrong drawing page in caption" );
- if( pDrawPage && (rCaption.GetPage() == pDrawPage) )
+ OSL_ENSURE( rCaption.getSdrPageFromSdrObject() == pDrawPage, "ScNoteCaptionCreator::ScNoteCaptionCreator - wrong drawing page in caption" );
+ if( pDrawPage && (rCaption.getSdrPageFromSdrObject() == pDrawPage) )
{
// store note position in user data of caption object
ScCaptionUtil::SetCaptionUserData( rCaption, rPos );
@@ -476,8 +479,8 @@ struct ScCaptionInitData
SfxItemSetPtr mxItemSet; /// Caption object formatting.
OutlinerParaObjPtr mxOutlinerObj; /// Text object with all text portion formatting.
::rtl::OUString maSimpleText; /// Simple text without formatting.
- Point maCaptionOffset; /// Caption position relative to cell corner.
- Size maCaptionSize; /// Size of the caption object.
+ basegfx::B2DPoint maCaptionOffset; /// Caption position relative to cell corner.
+ basegfx::B2DVector maCaptionScale; /// Size of the caption object.
bool mbDefaultPosSize; /// True = use default position and size for caption.
explicit ScCaptionInitData();
@@ -675,19 +678,20 @@ void ScPostIt::CreateCaptionFromInitData( const ScAddress& rPos ) const
if( rInitData.mbDefaultPosSize )
{
// set other items and fit caption size to text
- maNoteData.mpCaption->SetMergedItem( SdrTextMinFrameWidthItem( SC_NOTECAPTION_WIDTH ) );
- maNoteData.mpCaption->SetMergedItem( SdrTextMaxFrameWidthItem( SC_NOTECAPTION_MAXWIDTH_TEMP ) );
+ maNoteData.mpCaption->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, SC_NOTECAPTION_WIDTH ) );
+ maNoteData.mpCaption->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH, SC_NOTECAPTION_MAXWIDTH_TEMP ) );
maNoteData.mpCaption->AdjustTextFrameWidthAndHeight();
aCreator.AutoPlaceCaption();
}
else
{
- Rectangle aCellRect = ScDrawLayer::GetCellRect( mrDoc, rPos, true );
- bool bNegPage = mrDoc.IsNegativePage( rPos.Tab() );
- long nPosX = bNegPage ? (aCellRect.Left() - rInitData.maCaptionOffset.X()) : (aCellRect.Right() + rInitData.maCaptionOffset.X());
- long nPosY = aCellRect.Top() + rInitData.maCaptionOffset.Y();
- Rectangle aCaptRect( Point( nPosX, nPosY ), rInitData.maCaptionSize );
- maNoteData.mpCaption->SetLogicRect( aCaptRect );
+ const basegfx::B2DRange aCellRange(ScDrawLayer::GetCellRange(mrDoc, rPos, true));
+ const bool bNegPage(mrDoc.IsNegativePage(rPos.Tab()));
+ const basegfx::B2DPoint aTopLeft(
+ bNegPage ? (aCellRange.getMinX() - rInitData.maCaptionOffset.getX()) : (aCellRange.getMaxX() + rInitData.maCaptionOffset.getX()),
+ aCellRange.getMinY() + rInitData.maCaptionOffset.getY());
+ const basegfx::B2DRange aCaptRange(aTopLeft, aTopLeft + rInitData.maCaptionScale);
+ sdr::legacy::SetLogicRange(*maNoteData.mpCaption, aCaptRange);
aCreator.FitCaptionToRect();
}
}
@@ -725,10 +729,9 @@ void ScPostIt::CreateCaption( const ScAddress& rPos, const SdrCaptionObj* pCapti
// copy formatting items (after text has been copied to apply font formatting)
maNoteData.mpCaption->SetMergedItemSetAndBroadcast( pCaption->GetMergedItemSet() );
// move textbox position relative to new cell, copy textbox size
- Rectangle aCaptRect = pCaption->GetLogicRect();
- Point aDist = maNoteData.mpCaption->GetTailPos() - pCaption->GetTailPos();
- aCaptRect.Move( aDist.X(), aDist.Y() );
- maNoteData.mpCaption->SetLogicRect( aCaptRect );
+ basegfx::B2DRange aCaptRange(sdr::legacy::GetLogicRange(*pCaption));
+ aCaptRange.transform(basegfx::tools::createTranslateB2DHomMatrix(maNoteData.mpCaption->GetTailPos() - pCaption->GetTailPos()));
+ sdr::legacy::SetLogicRange(*maNoteData.mpCaption, aCaptRange);
aCreator.FitCaptionToRect();
}
else
@@ -753,22 +756,22 @@ void ScPostIt::RemoveCaption()
undo documents refer to captions in original document, do not remove
them from drawing layer here). */
ScDrawLayer* pDrawLayer = mrDoc.GetDrawLayer();
- if( maNoteData.mpCaption && (pDrawLayer == maNoteData.mpCaption->GetModel()) )
+
+ if( maNoteData.mpCaption && (pDrawLayer == &maNoteData.mpCaption->getSdrModelFromSdrObject()) )
{
OSL_ENSURE( pDrawLayer, "ScPostIt::RemoveCaption - object without drawing layer" );
- SdrPage* pDrawPage = maNoteData.mpCaption->GetPage();
+ SdrPage* pDrawPage = maNoteData.mpCaption->getSdrPageFromSdrObject();
OSL_ENSURE( pDrawPage, "ScPostIt::RemoveCaption - object without drawing page" );
if( pDrawPage )
{
- pDrawPage->RecalcObjOrdNums();
// create drawing undo action (before removing the object to have valid draw page in undo action)
bool bRecording = ( pDrawLayer && pDrawLayer->IsUndoAllowed() && pDrawLayer->IsRecording() );
if( bRecording )
pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoDeleteObject( *maNoteData.mpCaption ) );
// remove the object from the drawing page, delete if undo is disabled
- SdrObject* pObj = pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() );
+ SdrObject* pObj = pDrawPage->RemoveObjectFromSdrObjList( maNoteData.mpCaption->GetNavigationPosition() );
if( !bRecording )
- SdrObject::Free( pObj );
+ deleteSdrObjectSafeAndClearPointer( pObj );
}
}
maNoteData.mpCaption = 0;
@@ -817,7 +820,7 @@ SdrCaptionObj* ScNoteUtil::CreateTempCaption(
SdrCaptionObj* pCaption = aCreator.GetCaption();
// insert caption into page (needed to set caption text)
- rDrawPage.InsertObject( pCaption );
+ rDrawPage.InsertObjectToSdrObjList(*pCaption);
// clone the edit text object, unless user text is present, then set this text
if( pNoteCaption && (rUserText.getLength() == 0) )
@@ -826,8 +829,8 @@ SdrCaptionObj* ScNoteUtil::CreateTempCaption(
pCaption->SetOutlinerParaObject( new OutlinerParaObject( *pOPO ) );
// set formatting (must be done after setting text) and resize the box to fit the text
pCaption->SetMergedItemSetAndBroadcast( pNoteCaption->GetMergedItemSet() );
- Rectangle aCaptRect( pCaption->GetLogicRect().TopLeft(), pNoteCaption->GetLogicRect().GetSize() );
- pCaption->SetLogicRect( aCaptRect );
+ const Rectangle aCaptRect(sdr::legacy::GetLogicRect(*pCaption).TopLeft(), sdr::legacy::GetLogicRect(*pNoteCaption).GetSize() );
+ sdr::legacy::SetLogicRect(*pCaption, aCaptRect );
}
else
{
@@ -836,15 +839,16 @@ SdrCaptionObj* ScNoteUtil::CreateTempCaption(
ScCaptionUtil::SetDefaultItems( *pCaption, rDoc );
// adjust caption size to text size
long nMaxWidth = ::std::min< long >( aVisRect.GetWidth() * 2 / 3, SC_NOTECAPTION_MAXWIDTH_TEMP );
- pCaption->SetMergedItem( SdrTextAutoGrowWidthItem( sal_True ) );
- pCaption->SetMergedItem( SdrTextMinFrameWidthItem( SC_NOTECAPTION_WIDTH ) );
- pCaption->SetMergedItem( SdrTextMaxFrameWidthItem( nMaxWidth ) );
- pCaption->SetMergedItem( SdrTextAutoGrowHeightItem( sal_True ) );
+ pCaption->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_True ) );
+ pCaption->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, SC_NOTECAPTION_WIDTH ) );
+ pCaption->SetMergedItem( SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH, nMaxWidth ) );
+ pCaption->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_True ) );
pCaption->AdjustTextFrameWidthAndHeight();
}
// move caption into visible area
- aCreator.AutoPlaceCaption( &aVisRect );
+ const basegfx::B2DRange aVisRange(aVisRect.Left(), aVisRect.Top(), aVisRect.Right(), aVisRect.Bottom());
+ aCreator.AutoPlaceCaption( &aVisRange );
return pCaption;
}
@@ -866,9 +870,13 @@ ScPostIt* ScNoteUtil::CreateNoteFromCaption(
}
ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
- ScDocument& rDoc, const ScAddress& rPos, SfxItemSet* pItemSet,
- OutlinerParaObject* pOutlinerObj, const Rectangle& rCaptionRect,
- bool bShown, bool bAlwaysCreateCaption )
+ ScDocument& rDoc,
+ const ScAddress& rPos,
+ SfxItemSet* pItemSet,
+ OutlinerParaObject* pOutlinerObj,
+ const basegfx::B2DRange& rCaptionRange,
+ bool bShown,
+ bool bAlwaysCreateCaption )
{
OSL_ENSURE( pItemSet && pOutlinerObj, "ScNoteUtil::CreateNoteFromObjectData - item set and outliner object expected" );
ScNoteData aNoteData( bShown );
@@ -878,14 +886,16 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
rInitData.mxOutlinerObj.reset( pOutlinerObj );
// convert absolute caption position to relative position
- rInitData.mbDefaultPosSize = rCaptionRect.IsEmpty();
+ rInitData.mbDefaultPosSize = rCaptionRange.isEmpty();
if( !rInitData.mbDefaultPosSize )
{
- Rectangle aCellRect = ScDrawLayer::GetCellRect( rDoc, rPos, true );
- bool bNegPage = rDoc.IsNegativePage( rPos.Tab() );
- rInitData.maCaptionOffset.X() = bNegPage ? (aCellRect.Left() - rCaptionRect.Right()) : (rCaptionRect.Left() - aCellRect.Right());
- rInitData.maCaptionOffset.Y() = rCaptionRect.Top() - aCellRect.Top();
- rInitData.maCaptionSize = rCaptionRect.GetSize();
+ const basegfx::B2DRange aCellRange(ScDrawLayer::GetCellRange(rDoc, rPos, true));
+ const bool bNegPage(rDoc.IsNegativePage(rPos.Tab()));
+
+ rInitData.maCaptionOffset = basegfx::B2DPoint(
+ bNegPage ? (aCellRange.getMinX() - rCaptionRange.getMaxX()) : (rCaptionRange.getMinX() - aCellRange.getMaxX()),
+ rCaptionRange.getMinY() - aCellRange.getMinY());
+ rInitData.maCaptionScale = rCaptionRange.getRange();
}
/* Create the note and insert it into the document. If the note is
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 0d1e13184e75..86684740d0f2 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -138,7 +138,7 @@ SfxStyleSheetBase* __EXPORT ScStyleSheetPool::Create(
SfxStyleSheetBase* __EXPORT ScStyleSheetPool::Create( const SfxStyleSheetBase& rStyle )
{
- DBG_ASSERT( rStyle.ISA(ScStyleSheet), "Invalid StyleSheet-class! :-/" );
+ DBG_ASSERT( dynamic_cast< const ScStyleSheet* >(&rStyle), "Invalid StyleSheet-class! :-/" );
return new ScStyleSheet( (const ScStyleSheet&) rStyle );
}
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 47375e5a6b6a..3c335271e872 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -53,8 +53,6 @@
#include "sc.hrc"
//------------------------------------------------------------------------
-TYPEINIT1(ScStyleSheet, SfxStyleSheet);
-
#define TWO_CM 1134
#define HFDIST_CM 142
@@ -288,8 +286,9 @@ sal_Bool __EXPORT ScStyleSheet::IsUsed() const
void __EXPORT ScStyleSheet::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) )
- if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId())
GetItemSet().SetParent( NULL );
}
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index fd4b31e7b990..7d7fefa80c5e 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -129,9 +129,9 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName,
if ( pDrawLayer->ScAddPage( nTab ) ) // sal_False (not inserted) during Undo
{
pDrawLayer->ScRenamePage( nTab, aName );
- sal_uLong nx = (sal_uLong) ((double) (MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS );
- sal_uLong ny = (sal_uLong) ((double) (MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS );
- pDrawLayer->SetPageSize( static_cast<sal_uInt16>(nTab), Size( nx, ny ), false );
+ const double fx((double)(MAXCOL+1) * STD_COL_WIDTH * HMM_PER_TWIPS );
+ const double fy((double)(MAXROW+1) * ScGlobal::nStdRowHeight * HMM_PER_TWIPS );
+ pDrawLayer->SetPageSize( static_cast< sal_uInt32 >(nTab), basegfx::B2DVector( fx, fy ), false );
}
}
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 5ed85d319396..509e51b401c7 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -507,9 +507,9 @@ void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
}
}
- //
- // Zellschutz auf geschuetzter Tabelle nicht setzen
- //
+ //
+ // Zellschutz auf geschuetzter Tabelle nicht setzen
+ //
if ( IsProtected() && (nInsFlag & IDF_ATTRIB) )
{
@@ -3231,7 +3231,7 @@ void ScTable::SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos
if ( IsLayoutRTL() ) // IsNegativePage
x = -x;
- pDrawLayer->SetPageSize( static_cast<sal_uInt16>(nTab), Size( x, y ), bUpdateNoteCaptionPos );
+ pDrawLayer->SetPageSize( static_cast< sal_uInt32 >(nTab), basegfx::B2DVector( x, y ), bUpdateNoteCaptionPos );
}
// #i102616# actions that modify the draw page size count as sheet modification
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 43445b695685..f5859f501931 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -134,7 +134,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea )
if ( pStyleSet->GetItemState( ATTR_PAGE_SCALETOPAGES, sal_False, &pItem ) == SFX_ITEM_SET )
{
- DBG_ASSERT( pItem->ISA(SfxUInt16Item), "falsches Item" );
+ DBG_ASSERT( dynamic_cast< const SfxUInt16Item* >(pItem), "falsches Item" );
bSkipColBreaks = bSkipRowBreaks = ( ((const SfxUInt16Item*)pItem)->GetValue() > 0 );
}
diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx
index 3a7081d1641b..cf6af92e5938 100644
--- a/sc/source/core/data/userdat.cxx
+++ b/sc/source/core/data/userdat.cxx
@@ -30,6 +30,7 @@
#include <tools/debug.hxx>
#include "drwlayer.hxx"
#include "rechead.hxx"
+#include <svx/sdrobjectfactory.hxx>
// -----------------------------------------------------------------------
@@ -45,14 +46,20 @@ ScDrawObjFactory::~ScDrawObjFactory()
IMPL_LINK_INLINE_START( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFactory )
{
- if ( pObjFactory->nInventor == SC_DRAWLAYER )
+ if ( SC_DRAWLAYER == pObjFactory->getSdrObjectCreationInfo().getInvent() )
{
- if ( pObjFactory->nIdentifier == SC_UD_OBJDATA )
- pObjFactory->pNewData = new ScDrawObjData;
- else if ( pObjFactory->nIdentifier == SC_UD_IMAPDATA )
- pObjFactory->pNewData = new ScIMapInfo;
- else if ( pObjFactory->nIdentifier == SC_UD_MACRODATA )
- pObjFactory->pNewData = new ScMacroInfo;
+ if ( pObjFactory->getSdrObjectCreationInfo().getIdent() == SC_UD_OBJDATA )
+ {
+ pObjFactory->setNewSdrObjUserData(new ScDrawObjData);
+ }
+ else if ( pObjFactory->getSdrObjectCreationInfo().getIdent() == SC_UD_IMAPDATA )
+ {
+ pObjFactory->setNewSdrObjUserData(new ScIMapInfo);
+ }
+ else if ( pObjFactory->getSdrObjectCreationInfo().getIdent() == SC_UD_MACRODATA )
+ {
+ pObjFactory->setNewSdrObjUserData(new ScMacroInfo);
+ }
else
{
DBG_ERROR("MakeUserData: falsche ID");
@@ -65,7 +72,7 @@ IMPL_LINK_INLINE_END( ScDrawObjFactory, MakeUserData, SdrObjFactory *, pObjFacto
//------------------------------------------------------------------------
ScDrawObjData::ScDrawObjData() :
- SdrObjUserData( SC_DRAWLAYER, SC_UD_OBJDATA, 0 ),
+ SdrObjUserData( SC_DRAWLAYER, SC_UD_OBJDATA ),
maStart( ScAddress::INITIALIZE_INVALID ),
maEnd( ScAddress::INITIALIZE_INVALID ),
mbNote( false )
@@ -80,12 +87,12 @@ ScDrawObjData* ScDrawObjData::Clone( SdrObject* ) const
//------------------------------------------------------------------------
ScIMapInfo::ScIMapInfo() :
- SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 )
+ SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA )
{
}
ScIMapInfo::ScIMapInfo( const ImageMap& rImageMap ) :
- SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA, 0 ),
+ SdrObjUserData( SC_DRAWLAYER, SC_UD_IMAPDATA ),
aImageMap( rImageMap )
{
}
@@ -108,7 +115,7 @@ SdrObjUserData* ScIMapInfo::Clone( SdrObject* ) const
//------------------------------------------------------------------------
ScMacroInfo::ScMacroInfo() :
- SdrObjUserData( SC_DRAWLAYER, SC_UD_MACRODATA, 0 )
+ SdrObjUserData( SC_DRAWLAYER, SC_UD_MACRODATA )
{
}
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 10127d44ea4d..555766c2d094 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -306,9 +306,10 @@ sal_Bool ScValidationData::DoMacro( const ScAddress& rPos, const String& rInput,
StarBASIC* pRoot = pDocSh->GetBasic();
SbxVariable* pVar = pRoot->Find( aErrorTitle, SbxCLASS_METHOD );
- if ( pVar && pVar->ISA(SbMethod) )
+ SbMethod* pMethod = dynamic_cast< SbMethod* >(pVar);
+
+ if ( pMethod )
{
- SbMethod* pMethod = (SbMethod*)pVar;
SbModule* pModule = pMethod->GetModule();
SbxObject* pObject = pModule->GetParent();
String aMacroStr = pObject->GetName();
diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx
index cfa4ce1a41e8..f6cd08e11682 100644
--- a/sc/source/core/inc/core_pch.hxx
+++ b/sc/source/core/inc/core_pch.hxx
@@ -37,7 +37,6 @@
#include <tools/solar.h>
#include <string.h>
#include <tools/string.hxx>
-#include <tools/rtti.hxx>
#include <limits.h>
#include <tools/ref.hxx>
#include <tools/list.hxx>
diff --git a/sc/source/core/inc/ddelink.hxx b/sc/source/core/inc/ddelink.hxx
index a93f4f568d48..46c9e81207b1 100644
--- a/sc/source/core/inc/ddelink.hxx
+++ b/sc/source/core/inc/ddelink.hxx
@@ -51,8 +51,6 @@ static sal_Bool bIsInUpdate;
ScMatrixRef pResult; // Ergebnis
public:
- TYPEINFO();
-
ScDdeLink( ScDocument* pD,
const String& rA, const String& rT, const String& rI,
sal_uInt8 nM );
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index fbae501396e9..fc659bb7cf0c 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -35,6 +35,7 @@
#include <svx/svditer.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdpage.hxx>
+#include <svx/svdlegacy.hxx>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/util/XModifiable.hpp>
@@ -57,8 +58,8 @@ sal_uInt16 lcl_DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool
sal_uInt16 nFound = 0;
- sal_uInt16 nPageCount = pModel->GetPageCount();
- for (sal_uInt16 nPageNo=0; nPageNo<nPageCount; nPageNo++)
+ const sal_uInt32 nPageCount(pModel->GetPageCount());
+ for (sal_uInt32 nPageNo=0; nPageNo<nPageCount; nPageNo++)
{
SdrPage* pPage = pModel->GetPage(nPageNo);
DBG_ASSERT(pPage,"Page ?");
@@ -461,7 +462,7 @@ void ScChartHelper::CreateProtectedChartListenersAndNotify( ScDocument* pDoc, Sd
if ( pModelObj && pModelObj->HasChangesListeners() )
{
- Rectangle aRectangle = pSdrOle2Obj->GetSnapRect();
+ Rectangle aRectangle = sdr::legacy::GetSnapRect(*pSdrOle2Obj);
ScRange aRange( pDoc->GetRange( nTab, aRectangle ) );
ScRangeList aChangeRanges;
aChangeRanges.Append( aRange );
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 2d8c692cea54..142c93ce12d7 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -28,7 +28,6 @@
#include <tools/debug.hxx>
#include <tools/shl.hxx> // SHL_CALC
#include <tools/stack.hxx>
-#include <tools/rtti.hxx>
#include <svl/zforlist.hxx>
#include <svl/itemset.hxx>
#include <svl/isethint.hxx>
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index a7fdd2e8bb62..82c5d75de671 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2947,7 +2947,7 @@ sal_Bool ScCompiler::IsMacro( const String& rName )
// It really should be a BASIC function!
if( pMeth->GetType() == SbxVOID
|| ( pMeth->IsFixed() && pMeth->GetType() == SbxEMPTY )
- || !pMeth->ISA(SbMethod) )
+ || !dynamic_cast< SbMethod* >(pMeth) )
{
return sal_False;
}
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index e078151f1976..8e6dc81a7039 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -42,8 +42,6 @@
#include "sc.hrc"
#include "hints.hxx"
-TYPEINIT2(ScDdeLink,::sfx2::SvBaseLink,SfxBroadcaster);
-
#define DDE_TXT_ENCODING gsl_getSystemTextEncoding()
sal_Bool ScDdeLink::bIsInUpdate = sal_False;
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index d62612e2bf01..a138b1bb0c20 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -30,9 +30,6 @@
#include <svtools/colorcfg.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/outlobj.hxx>
-#include <svx/sdshitm.hxx>
-#include <svx/sdsxyitm.hxx>
-#include <svx/sdtditm.hxx>
#include <svx/svditer.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svdocirc.hxx>
@@ -56,10 +53,10 @@
#include <svx/sxcecitm.hxx>
#include <svl/whiter.hxx>
#include <editeng/writingmodeitem.hxx>
-
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/svdlegacy.hxx>
#include "detfunc.hxx"
#include "document.hxx"
@@ -226,18 +223,18 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
// SdrShadowItem has sal_False, instead the shadow is set for the rectangle
// only with SetSpecialTextBoxShadow when the object is created
// (item must be set to adjust objects from older files)
- aCaptionSet.Put( SdrShadowItem( sal_False ) );
- aCaptionSet.Put( SdrShadowXDistItem( 100 ) );
- aCaptionSet.Put( SdrShadowYDistItem( 100 ) );
+ aCaptionSet.Put( SdrOnOffItem(SDRATTR_SHADOW, sal_False ) );
+ aCaptionSet.Put( SdrMetricItem(SDRATTR_SHADOWXDIST, 100 ) );
+ aCaptionSet.Put( SdrMetricItem(SDRATTR_SHADOWYDIST, 100 ) );
// text attributes
- aCaptionSet.Put( SdrTextLeftDistItem( 100 ) );
- aCaptionSet.Put( SdrTextRightDistItem( 100 ) );
- aCaptionSet.Put( SdrTextUpperDistItem( 100 ) );
- aCaptionSet.Put( SdrTextLowerDistItem( 100 ) );
+ aCaptionSet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 100 ) );
+ aCaptionSet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 100 ) );
+ aCaptionSet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 100 ) );
+ aCaptionSet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 100 ) );
- aCaptionSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aCaptionSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
+ aCaptionSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
+ aCaptionSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_True ) );
// #78943# do use the default cell style, so the user has a chance to
// modify the font for the annotations
@@ -426,8 +423,7 @@ sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart,
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
{
- if ( pObject->GetLayer()==SC_LAYER_INTERN &&
- pObject->IsPolyObj() && pObject->GetPointCount()==2 )
+ if ( pObject->GetLayer()==SC_LAYER_INTERN && pObject->IsPolygonObject() && 2 == pObject->GetObjectPointCount())
{
const SfxItemSet& rSet = pObject->GetMergedItemSet();
@@ -436,10 +432,21 @@ sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart,
sal_Bool bObjEndAlien =
lcl_IsOtherTab( ((const XLineEndItem&)rSet.Get(XATTR_LINEEND)).GetLineEndValue() );
- sal_Bool bStartHit = bStartAlien ? bObjStartAlien :
- ( !bObjStartAlien && aStartRect.IsInside(pObject->GetPoint(0)) );
- sal_Bool bEndHit = bEndAlien ? bObjEndAlien :
- ( !bObjEndAlien && aEndRect.IsInside(pObject->GetPoint(1)) );
+ sal_Bool bStartHit(bObjStartAlien);
+
+ if(!bObjStartAlien)
+ {
+ bStartHit = aStartRect.IsInside(
+ Point(basegfx::fround(pObject->GetObjectPoint(0).getX()), basegfx::fround(pObject->GetObjectPoint(0).getY())));
+ }
+
+ sal_Bool bEndHit(bObjEndAlien);
+
+ if(!bObjEndAlien)
+ {
+ bEndHit = aEndRect.IsInside(
+ Point(basegfx::fround(pObject->GetObjectPoint(1).getX()), basegfx::fround(pObject->GetObjectPoint(1).getY())));
+ }
if ( bStartHit && bEndHit )
bFound = sal_True;
@@ -452,8 +459,7 @@ sal_Bool ScDetectiveFunc::HasArrow( const ScAddress& rStart,
sal_Bool ScDetectiveFunc::IsNonAlienArrow( SdrObject* pObject ) // static
{
- if ( pObject->GetLayer()==SC_LAYER_INTERN &&
- pObject->IsPolyObj() && pObject->GetPointCount()==2 )
+ if ( pObject->GetLayer()==SC_LAYER_INTERN && pObject->IsPolygonObject() && 2 == pObject->GetObjectPointCount())
{
const SfxItemSet& rSet = pObject->GetMergedItemSet();
@@ -487,16 +493,20 @@ sal_Bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
// insert the rectangle before the arrow - this is relied on in FindFrameForObject
Rectangle aRect = GetDrawRect( nRefStartCol, nRefStartRow, nRefEndCol, nRefEndRow );
- SdrRectObj* pBox = new SdrRectObj( aRect );
+ SdrRectObj* pBox = new SdrRectObj(
+ *pModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth(), aRect.getHeight(),
+ aRect.Left(), aRect.Top()));
pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
ScDrawLayer::SetAnchor( pBox, SCA_CELL );
pBox->SetLayer( SC_LAYER_INTERN );
- pPage->InsertObject( pBox );
+ pPage->InsertObjectToSdrObjList(*pBox);
pModel->AddCalcUndo< SdrUndoInsertObj >( *pBox );
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, sal_True );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( *pBox, sal_True );
pData->maStart.Set( nRefStartCol, nRefStartRow, nTab);
pData->maEnd.Set( nRefEndCol, nRefEndRow, nTab);
}
@@ -529,16 +539,17 @@ sal_Bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
basegfx::B2DPolygon aTempPoly;
aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y()));
aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y()));
- SdrPathObj* pArrow = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aTempPoly));
- pArrow->NbcSetLogicRect(Rectangle(aStartPos,aEndPos)); //! noetig ???
+ SdrPathObj* pArrow = new SdrPathObj(
+ *pModel,
+ basegfx::B2DPolyPolygon(aTempPoly));
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
pArrow->SetLayer( SC_LAYER_INTERN );
- pPage->InsertObject( pArrow );
+ pPage->InsertObjectToSdrObjList(*pArrow);
pModel->AddCalcUndo< SdrUndoInsertObj >( *pArrow );
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, sal_True );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( *pArrow, sal_True );
if (bFromOtherTab)
pData->maStart.SetInvalid();
else
@@ -561,16 +572,20 @@ sal_Bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
if (bArea)
{
Rectangle aRect = GetDrawRect( nStartCol, nStartRow, nEndCol, nEndRow );
- SdrRectObj* pBox = new SdrRectObj( aRect );
+ SdrRectObj* pBox = new SdrRectObj(
+ *pModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth(), aRect.getHeight(),
+ aRect.Left(), aRect.Top()));
pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
ScDrawLayer::SetAnchor( pBox, SCA_CELL );
pBox->SetLayer( SC_LAYER_INTERN );
- pPage->InsertObject( pBox );
+ pPage->InsertObjectToSdrObjList(*pBox);
pModel->AddCalcUndo< SdrUndoInsertObj >( *pBox );
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pBox, sal_True );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( *pBox, sal_True );
pData->maStart.Set( nStartCol, nStartRow, nTab);
pData->maEnd.Set( nEndCol, nEndRow, nTab);
}
@@ -595,17 +610,17 @@ sal_Bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
basegfx::B2DPolygon aTempPoly;
aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y()));
aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y()));
- SdrPathObj* pArrow = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aTempPoly));
- pArrow->NbcSetLogicRect(Rectangle(aStartPos,aEndPos)); //! noetig ???
+ SdrPathObj* pArrow = new SdrPathObj(
+ *pModel,
+ basegfx::B2DPolyPolygon(aTempPoly));
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
-
ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
pArrow->SetLayer( SC_LAYER_INTERN );
- pPage->InsertObject( pArrow );
+ pPage->InsertObjectToSdrObjList(*pArrow);
pModel->AddCalcUndo< SdrUndoInsertObj >( *pArrow );
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pArrow, sal_True );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( *pArrow, sal_True );
pData->maStart.Set( nStartCol, nStartRow, nTab);
pData->maEnd.SetInvalid();
@@ -664,17 +679,21 @@ void ScDetectiveFunc::DrawCircle( SCCOL nCol, SCROW nRow, ScDetectiveData& rData
aRect.Top() -= 70;
aRect.Bottom() += 70;
- SdrCircObj* pCircle = new SdrCircObj( OBJ_CIRC, aRect );
+ SdrCircObj* pCircle = new SdrCircObj(
+ *pModel,
+ CircleType_Circle,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth(), aRect.getHeight(),
+ aRect.Left(), aRect.Top()));
SfxItemSet& rAttrSet = rData.GetCircleSet();
pCircle->SetMergedItemSetAndBroadcast(rAttrSet);
-
ScDrawLayer::SetAnchor( pCircle, SCA_CELL );
pCircle->SetLayer( SC_LAYER_INTERN );
- pPage->InsertObject( pCircle );
+ pPage->InsertObjectToSdrObjList(*pCircle);
pModel->AddCalcUndo< SdrUndoInsertObj >( *pCircle );
- ScDrawObjData* pData = ScDrawLayer::GetObjData( pCircle, sal_True );
+ ScDrawObjData* pData = ScDrawLayer::GetObjData( *pCircle, sal_True );
pData->maStart.Set( nCol, nRow, nTab);
pData->maEnd.SetInvalid();
@@ -689,8 +708,6 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, sal_Bool bDestPnt
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
- pPage->RecalcObjOrdNums();
-
long nDelCount = 0;
sal_uLong nObjCount = pPage->GetObjCount();
if (nObjCount)
@@ -701,10 +718,12 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, sal_Bool bDestPnt
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetLayer()==SC_LAYER_INTERN &&
- pObject->IsPolyObj() && pObject->GetPointCount()==2 )
+ if ( pObject->GetLayer()==SC_LAYER_INTERN && pObject->IsPolygonObject() && 2 == pObject->GetObjectPointCount())
{
- if (aRect.IsInside(pObject->GetPoint(bDestPnt))) // Start/Zielpunkt
+ const basegfx::B2DPoint aB2DTestPoint(pObject->GetObjectPoint(bDestPnt ? 1 : 0));
+ const Point aTestPoint(basegfx::fround(aB2DTestPoint.getX()), basegfx::fround(aB2DTestPoint.getY()));
+
+ if (aRect.IsInside(aTestPoint)) // Start/Zielpunkt
ppObj[nDelCount++] = pObject;
}
@@ -716,7 +735,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, sal_Bool bDestPnt
pModel->AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
for (i=1; i<=nDelCount; i++)
- pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
+ pPage->RemoveObjectFromSdrObjList( ppObj[nDelCount-i]->GetNavigationPosition() );
delete[] ppObj;
@@ -764,8 +783,6 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
- pPage->RecalcObjOrdNums();
-
long nDelCount = 0;
sal_uLong nObjCount = pPage->GetObjCount();
if (nObjCount)
@@ -776,11 +793,10 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->GetLayer() == SC_LAYER_INTERN &&
- pObject->Type() == TYPE(SdrRectObj) )
+ if ( pObject->GetLayer() == SC_LAYER_INTERN && dynamic_cast< SdrRectObj* >(pObject) )
{
- aObjRect = ((SdrRectObj*)pObject)->GetLogicRect();
- aObjRect.Justify();
+ aObjRect = sdr::legacy::GetLogicRect(*pObject);
+
if ( RectIsPoints( aObjRect, aStartCorner, aEndCorner ) )
ppObj[nDelCount++] = pObject;
}
@@ -793,7 +809,7 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR
pModel->AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
for (i=1; i<=nDelCount; i++)
- pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
+ pPage->RemoveObjectFromSdrObjList( ppObj[nDelCount-i]->GetNavigationPosition() );
delete[] ppObj;
@@ -1295,8 +1311,6 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat )
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT(pPage,"Page ?");
- pPage->RecalcObjOrdNums();
-
long nDelCount = 0;
sal_uLong nObjCount = pPage->GetObjCount();
if (nObjCount)
@@ -1312,8 +1326,8 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat )
sal_Bool bDoThis = sal_True;
if ( eWhat != SC_DET_ALL )
{
- sal_Bool bCircle = ( pObject->ISA(SdrCircObj) );
- sal_Bool bCaption = ScDrawLayer::IsNoteCaption( pObject );
+ const bool bCircle(dynamic_cast< SdrCircObj* >(pObject));
+ const bool bCaption(ScDrawLayer::IsNoteCaption(*pObject));
if ( eWhat == SC_DET_DETECTIVE ) // Detektiv, aus Menue
bDoThis = !bCaption; // auch Kreise
else if ( eWhat == SC_DET_CIRCLES ) // Kreise, wenn neue erzeugt werden
@@ -1337,7 +1351,7 @@ sal_Bool ScDetectiveFunc::DeleteAll( ScDetectiveDelete eWhat )
pModel->AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] );
for (i=1; i<=nDelCount; i++)
- pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );
+ pPage->RemoveObjectFromSdrObjList( ppObj[nDelCount-i]->GetNavigationPosition() );
delete[] ppObj;
@@ -1437,7 +1451,9 @@ void ScDetectiveFunc::UpdateAllComments( ScDocument& rDoc )
SdrObjListIter aIter( *pPage, IM_FLAT );
for( SdrObject* pObject = aIter.Next(); pObject; pObject = aIter.Next() )
{
- if ( ScDrawObjData* pData = ScDrawLayer::GetNoteCaptionData( pObject, nObjTab ) )
+ if(pObject)
+ {
+ if ( ScDrawObjData* pData = ScDrawLayer::GetNoteCaptionData( *pObject, nObjTab ) )
{
ScPostIt* pNote = rDoc.GetNote( pData->maStart );
// caption should exist, we iterate over drawing objects...
@@ -1460,6 +1476,7 @@ void ScDetectiveFunc::UpdateAllComments( ScDocument& rDoc )
}
}
}
+}
void ScDetectiveFunc::UpdateAllArrowColors()
{
@@ -1519,7 +1536,7 @@ void ScDetectiveFunc::UpdateAllArrowColors()
{
// frame for area reference has no ObjType, always gets arrow color
- if ( pObject->ISA( SdrRectObj ) && !pObject->ISA( SdrCaptionObj ) )
+ if ( dynamic_cast< SdrRectObj* >(pObject) && !dynamic_cast< SdrCaptionObj* >(pObject) )
{
bArrow = sal_True;
}
@@ -1554,18 +1571,18 @@ sal_Bool ScDetectiveFunc::FindFrameForObject( SdrObject* pObject, ScRange& rRang
if (!pPage) return sal_False;
// test if the object is a direct page member
- if( pObject && pObject->GetPage() && (pObject->GetPage() == pObject->GetObjList()) )
+ if( pObject && pObject->getSdrPageFromSdrObject() && (pObject->getSdrPageFromSdrObject() == pObject->getParentOfSdrObject()) )
{
// Is there a previous object?
- const sal_uInt32 nOrdNum(pObject->GetOrdNum());
+ const sal_uInt32 nOrdNum(pObject->GetNavigationPosition());
if(nOrdNum > 0)
{
SdrObject* pPrevObj = pPage->GetObj(nOrdNum - 1);
- if ( pPrevObj && pPrevObj->GetLayer() == SC_LAYER_INTERN && pPrevObj->ISA(SdrRectObj) )
+ if ( pPrevObj && pPrevObj->GetLayer() == SC_LAYER_INTERN && dynamic_cast< SdrRectObj* >(pPrevObj) )
{
- ScDrawObjData* pPrevData = ScDrawLayer::GetObjDataTab( pPrevObj, rRange.aStart.Tab() );
+ ScDrawObjData* pPrevData = ScDrawLayer::GetObjDataTab( *pPrevObj, rRange.aStart.Tab() );
if ( pPrevData && pPrevData->maStart.IsValid() && pPrevData->maEnd.IsValid() && (pPrevData->maStart == rRange.aStart) )
{
rRange.aEnd = pPrevData->maEnd;
@@ -1585,12 +1602,12 @@ ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject,
if ( pObject && pObject->GetLayer() == SC_LAYER_INTERN )
{
- if ( ScDrawObjData* pData = ScDrawLayer::GetObjDataTab( pObject, nObjTab ) )
+ if ( ScDrawObjData* pData = ScDrawLayer::GetObjDataTab( *pObject, nObjTab ) )
{
bool bValidStart = pData->maStart.IsValid();
bool bValidEnd = pData->maEnd.IsValid();
- if ( pObject->IsPolyObj() && pObject->GetPointCount() == 2 )
+ if ( pObject->IsPolygonObject() && 2 == pObject->GetObjectPointCount())
{
// line object -> arrow
@@ -1615,7 +1632,7 @@ ScDetectiveObjType ScDetectiveFunc::GetDetectiveObjectType( SdrObject* pObject,
if ( nObjColor == GetErrorColor() && nObjColor != GetArrowColor() )
rRedLine = sal_True;
}
- else if ( pObject->ISA(SdrCircObj) )
+ else if ( dynamic_cast< SdrCircObj* >(pObject) )
{
if ( bValidStart )
{
diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx
index 800bebdc3f16..f1affba2c59d 100644
--- a/sc/source/core/tool/docoptio.cxx
+++ b/sc/source/core/tool/docoptio.cxx
@@ -47,8 +47,6 @@ using namespace com::sun::star::uno;
#define SC_VERSION ((sal_uInt16)251)
-TYPEINIT1(ScTpCalcItem, SfxPoolItem);
-
//------------------------------------------------------------------------
//! these functions should be moved to some header file
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 9b091875a3df..87c1c6a4d974 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -649,16 +649,15 @@ String __EXPORT ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
const SvxFieldData* pFieldData = rField.GetField();
if ( pFieldData )
{
- TypeId aType = pFieldData->Type();
- if (aType == TYPE(SvxPageField))
+ if (dynamic_cast< const SvxPageField* >(pFieldData))
aRet = lcl_GetNumStr( aData.nPageNo,aData.eNumType );
- else if (aType == TYPE(SvxPagesField))
+ else if (dynamic_cast< const SvxPagesField* >(pFieldData))
aRet = lcl_GetNumStr( aData.nTotalPages,aData.eNumType );
- else if (aType == TYPE(SvxTimeField))
+ else if (dynamic_cast< const SvxTimeField* >(pFieldData))
aRet = ScGlobal::pLocaleData->getTime(aData.aTime);
- else if (aType == TYPE(SvxFileField))
+ else if (dynamic_cast< const SvxFileField* >(pFieldData))
aRet = aData.aTitle;
- else if (aType == TYPE(SvxExtFileField))
+ else if (dynamic_cast< const SvxExtFileField* >(pFieldData))
{
switch ( ((const SvxExtFileField*)pFieldData)->GetFormat() )
{
@@ -669,9 +668,9 @@ String __EXPORT ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
aRet = aData.aShortDocName;
}
}
- else if (aType == TYPE(SvxTableField))
+ else if (dynamic_cast< const SvxTableField* >(pFieldData))
aRet = aData.aTabName;
- else if (aType == TYPE(SvxDateField))
+ else if (dynamic_cast< const SvxDateField* >(pFieldData))
aRet = ScGlobal::pLocaleData->getDate(aData.aDate);
else
{
@@ -716,9 +715,7 @@ String __EXPORT ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
if ( pFieldData )
{
- TypeId aType = pFieldData->Type();
-
- if (aType == TYPE(SvxURLField))
+ if (dynamic_cast< const SvxURLField* >(pFieldData))
{
String aURL = ((const SvxURLField*)pFieldData)->GetURL();
@@ -753,14 +750,17 @@ String __EXPORT ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
void __EXPORT ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_uInt16, sal_uInt16 )
{
+ if(bExecuteURL)
+ {
const SvxFieldData* pFld = rField.GetField();
+ const SvxURLField* pURLField = dynamic_cast< const SvxURLField* >(pFld);
- if ( pFld && pFld->ISA( SvxURLField ) && bExecuteURL )
+ if(pURLField)
{
- const SvxURLField* pURLField = (const SvxURLField*) pFld;
ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame() );
}
}
+}
//------------------------------------------------------------------------
diff --git a/sc/source/core/tool/hints.cxx b/sc/source/core/tool/hints.cxx
index 9a122e0b893b..31aa04949a09 100644
--- a/sc/source/core/tool/hints.cxx
+++ b/sc/source/core/tool/hints.cxx
@@ -29,16 +29,6 @@
#include "hints.hxx"
// -----------------------------------------------------------------------
-
-TYPEINIT1(ScPaintHint, SfxHint);
-TYPEINIT1(ScUpdateRefHint, SfxHint);
-TYPEINIT1(ScPointerChangedHint, SfxHint);
-TYPEINIT1(ScLinkRefreshedHint, SfxHint);
-TYPEINIT1(ScAutoStyleHint, SfxHint);
-TYPEINIT1(ScDBRangeRefreshedHint, SfxHint);
-TYPEINIT1(ScDataPilotModifiedHint, SfxHint);
-
-// -----------------------------------------------------------------------
// ScPaintHint - Angabe, was neu gezeichnet werden muss
// -----------------------------------------------------------------------
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index ec6dda11b0df..bc590c028963 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2100,9 +2100,10 @@ ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr,
for (sal_uInt16 i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkMgr->GetLinks()[i];
- if (pBase->ISA(ScDdeLink))
+ ScDdeLink* pLink = dynamic_cast< ScDdeLink* >(pBase);
+
+ if (pLink)
{
- ScDdeLink* pLink = (ScDdeLink*)pBase;
if ( pLink->GetAppl() == rA &&
pLink->GetTopic() == rT &&
pLink->GetItem() == rI &&
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 77018c24ab70..e4e0fbc441d8 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2726,7 +2726,7 @@ void ScInterpreter::ScMacro()
StarBASIC* pRoot = pDocSh->GetBasic();
SbxVariable* pVar = pRoot->Find( aMacro, SbxCLASS_METHOD );
- if( !pVar || pVar->GetType() == SbxVOID || !pVar->ISA(SbMethod) )
+ if( !pVar || pVar->GetType() == SbxVOID || !dynamic_cast< SbMethod* >(pVar) )
{
PushError( errNoMacro );
return;
@@ -2735,7 +2735,7 @@ void ScInterpreter::ScMacro()
SbMethod* pMethod = (SbMethod*)pVar;
SbModule* pModule = pMethod->GetModule();
SbxObject* pObject = pModule->GetParent();
- DBG_ASSERT(pObject->IsA(TYPE(StarBASIC)), "Kein Basic gefunden!");
+ DBG_ASSERT(dynamic_cast< StarBASIC* >(pObject), "Kein Basic gefunden!");
String aMacroStr = pObject->GetName();
aMacroStr += '.';
aMacroStr += pModule->GetName();
@@ -2861,7 +2861,7 @@ void ScInterpreter::ScMacro()
else if ( eResType & SbxARRAY )
{
SbxBase* pElemObj = refRes->GetObject();
- SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj);
+ SbxDimArray* pDimArray = dynamic_cast< SbxDimArray* >( pElemObj);
short nDim = pDimArray->GetDims();
if ( 1 <= nDim && nDim <= 2 )
{
diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx
index 1c15bec3e8eb..5cd757b79a49 100644
--- a/sc/source/core/tool/lookupcache.cxx
+++ b/sc/source/core/tool/lookupcache.cxx
@@ -112,7 +112,7 @@ void ScLookupCache::Notify( SvtBroadcaster & /* rBC */ , const SfxHint & rHint
{
if (!mpDoc->IsInDtorClear())
{
- const ScHint* p = PTR_CAST( ScHint, &rHint );
+ const ScHint* p = dynamic_cast< const ScHint* >( &rHint );
if (p && (p->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)))
{
mpDoc->RemoveLookupCache( *this);
diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx
index 2866bb5e76f0..5ba3cc923450 100644
--- a/sc/source/core/tool/printopt.cxx
+++ b/sc/source/core/tool/printopt.cxx
@@ -38,10 +38,6 @@ using namespace com::sun::star::uno;
// -----------------------------------------------------------------------
-TYPEINIT1(ScTpPrintItem, SfxPoolItem);
-
-// -----------------------------------------------------------------------
-
ScPrintOptions::ScPrintOptions()
{
SetDefaults();
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 7d1458aa4bf6..505e89ee3c5b 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -46,8 +46,6 @@ using namespace com::sun::star::uno;
//------------------------------------------------------------------
-TYPEINIT1(ScTpViewItem, SfxPoolItem);
-
#define SC_VERSION ((sal_uInt16)302)
@@ -65,37 +63,38 @@ void ScGridOptions::SetDefaults()
if ( ScOptionsUtil::IsMetricSystem() )
{
- nFldDrawX = 1000; // 1cm
- nFldDrawY = 1000;
- nFldSnapX = 1000;
- nFldSnapY = 1000;
+ mnFldDrawX = 1000; // 1cm
+ mnFldDrawY = 1000;
+ mnFldSnapX = 1000;
+ mnFldSnapY = 1000;
}
else
{
- nFldDrawX = 1270; // 0,5"
- nFldDrawY = 1270;
- nFldSnapX = 1270;
- nFldSnapY = 1270;
+ mnFldDrawX = 1270; // 0,5"
+ mnFldDrawY = 1270;
+ mnFldSnapX = 1270;
+ mnFldSnapY = 1270;
}
- nFldDivisionX = 1;
- nFldDivisionY = 1;
+
+ mnFldDivisionX = 1;
+ mnFldDivisionY = 1;
}
//------------------------------------------------------------------------
const ScGridOptions& ScGridOptions::operator=( const ScGridOptions& rCpy )
{
- nFldDrawX = rCpy.nFldDrawX; // UINT32
- nFldDrawX = rCpy.nFldDrawX;
- nFldDivisionX = rCpy.nFldDivisionX;
- nFldDrawY = rCpy.nFldDrawY;
- nFldDivisionY = rCpy.nFldDivisionY;
- nFldSnapX = rCpy.nFldSnapX;
- nFldSnapY = rCpy.nFldSnapY;
- bUseGridsnap = rCpy.bUseGridsnap; // BitBool
- bSynchronize = rCpy.bSynchronize;
- bGridVisible = rCpy.bGridVisible;
- bEqualGrid = rCpy.bEqualGrid;
+ mnFldDrawX = rCpy.mnFldDrawX; // UINT32
+ mnFldDrawX = rCpy.mnFldDrawX;
+ mnFldDivisionX = rCpy.mnFldDivisionX;
+ mnFldDrawY = rCpy.mnFldDrawY;
+ mnFldDivisionY = rCpy.mnFldDivisionY;
+ mnFldSnapX = rCpy.mnFldSnapX;
+ mnFldSnapY = rCpy.mnFldSnapY;
+ mbUseGridsnap = rCpy.mbUseGridsnap; // BitBool
+ mbSynchronize = rCpy.mbSynchronize;
+ mbGridVisible = rCpy.mbGridVisible;
+ mbEqualGrid = rCpy.mbEqualGrid;
return *this;
}
@@ -104,17 +103,17 @@ const ScGridOptions& ScGridOptions::operator=( const ScGridOptions& rCpy )
int ScGridOptions::operator==( const ScGridOptions& rCpy ) const
{
- return ( nFldDrawX == rCpy.nFldDrawX
- && nFldDrawX == rCpy.nFldDrawX
- && nFldDivisionX == rCpy.nFldDivisionX
- && nFldDrawY == rCpy.nFldDrawY
- && nFldDivisionY == rCpy.nFldDivisionY
- && nFldSnapX == rCpy.nFldSnapX
- && nFldSnapY == rCpy.nFldSnapY
- && bUseGridsnap == rCpy.bUseGridsnap
- && bSynchronize == rCpy.bSynchronize
- && bGridVisible == rCpy.bGridVisible
- && bEqualGrid == rCpy.bEqualGrid );
+ return ( mnFldDrawX == rCpy.mnFldDrawX
+ && mnFldDrawX == rCpy.mnFldDrawX
+ && mnFldDivisionX == rCpy.mnFldDivisionX
+ && mnFldDrawY == rCpy.mnFldDrawY
+ && mnFldDivisionY == rCpy.mnFldDivisionY
+ && mnFldSnapX == rCpy.mnFldSnapX
+ && mnFldSnapY == rCpy.mnFldSnapY
+ && mbUseGridsnap == rCpy.mbUseGridsnap
+ && mbSynchronize == rCpy.mbSynchronize
+ && mbGridVisible == rCpy.mbGridVisible
+ && mbEqualGrid == rCpy.mbEqualGrid );
}
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 66b825ee7ce0..05d71b5c5221 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -97,15 +97,15 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
SfxItemSet* pItemSet = rMedium.GetItemSet();
if( pItemSet )
{
- SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
+ SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME );
if( pFileNameItem )
aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pFileNameItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD );
if( pPasswordItem )
aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pPasswordItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if( pEncryptionDataItem )
aMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] = pEncryptionDataItem->GetValue();
}
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 7bee437daac3..9ca24c0d01da 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -258,13 +258,13 @@ void ImportExcel8::ReadBasic( void )
SfxItemSet* pItemSet = rMedium.GetItemSet();
if( pItemSet )
{
- SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_ITEMSET_ARG( pItemSet, pFileNameItem, SfxStringItem, SID_FILE_NAME );
if( pFileNameItem )
aMediaDesc[ MediaDescriptor::PROP_URL() ] <<= ::rtl::OUString( pFileNameItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( pItemSet, pPasswordItem, SfxStringItem, SID_PASSWORD );
if( pPasswordItem )
aMediaDesc[ MediaDescriptor::PROP_PASSWORD() ] <<= ::rtl::OUString( pPasswordItem->GetValue() );
- SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ SFX_ITEMSET_ARG( pItemSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if( pEncryptionDataItem )
aMediaDesc[ MediaDescriptor::PROP_ENCRYPTIONDATA() ] = pEncryptionDataItem->GetValue();
}
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 9bf2a148ca2f..aa3397832ca0 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -328,9 +328,9 @@ const XclChFormatInfo& XclExpChRoot::GetFormatInfo( XclChObjectType eObjType ) c
return mxChData->mxFmtInfoProv->GetFormatInfo( eObjType );
}
-void XclExpChRoot::InitConversion( XChartDocRef xChartDoc, const Rectangle& rChartRect ) const
+void XclExpChRoot::InitConversion( XChartDocRef xChartDoc, const basegfx::B2DRange& rChartRange ) const
{
- mxChData->InitConversion( GetRoot(), xChartDoc, rChartRect );
+ mxChData->InitConversion( GetRoot(), xChartDoc, rChartRange );
}
void XclExpChRoot::FinishConversion() const
@@ -373,12 +373,12 @@ XclChRectangle XclExpChRoot::CalcChartRectFromHmm( const ::com::sun::star::awt::
sal_Int32 XclExpChRoot::CalcChartXFromRelative( double fPosX ) const
{
- return CalcChartXFromHmm( static_cast< sal_Int32 >( fPosX * mxChData->maChartRect.GetWidth() + 0.5 ) );
+ return CalcChartXFromHmm( static_cast< sal_Int32 >( fPosX * mxChData->maChartRange.getWidth() + 0.5 ) );
}
sal_Int32 XclExpChRoot::CalcChartYFromRelative( double fPosY ) const
{
- return CalcChartYFromHmm( static_cast< sal_Int32 >( fPosY * mxChData->maChartRect.GetHeight() + 0.5 ) );
+ return CalcChartYFromHmm( static_cast< sal_Int32 >( fPosY * mxChData->maChartRange.getHeight() + 0.5 ) );
}
void XclExpChRoot::ConvertLineFormat( XclChLineFormat& rLineFmt,
@@ -3300,14 +3300,15 @@ void XclExpChAxesSet::WriteBody( XclExpStream& rStrm )
// The chart object ===========================================================
XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
- Reference< XChartDocument > xChartDoc, const Rectangle& rChartRect ) :
+ Reference< XChartDocument > xChartDoc, const basegfx::B2DRange& rChartRange ) :
XclExpChGroupBase( XclExpChRoot( rRoot, *this ), EXC_CHFRBLOCK_TYPE_CHART, EXC_ID_CHCHART, 16 )
{
- Size aPtSize = OutputDevice::LogicToLogic( rChartRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( MAP_POINT ) );
+ const double fMapFactor(OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, MAP_POINT));
+ const basegfx::B2DVector aPtSize(rChartRange.getRange() * fMapFactor);
// rectangle is stored in 16.16 fixed-point format
maRect.mnX = maRect.mnY = 0;
- maRect.mnWidth = static_cast< sal_Int32 >( aPtSize.Width() << 16 );
- maRect.mnHeight = static_cast< sal_Int32 >( aPtSize.Height() << 16 );
+ maRect.mnWidth = static_cast< sal_Int32 >( basegfx::fround(aPtSize.getX()) << 16 );
+ maRect.mnHeight = static_cast< sal_Int32 >( basegfx::fround(aPtSize.getY()) << 16 );
// global chart properties (default values)
::set_flag( maProps.mnFlags, EXC_CHPROPS_SHOWVISIBLEONLY, false );
@@ -3327,8 +3328,8 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
bool bIncludeHidden = aDiagramProp.GetBoolProperty( EXC_CHPROP_INCLUDEHIDDENCELLS );
::set_flag( maProps.mnFlags, EXC_CHPROPS_SHOWVISIBLEONLY, !bIncludeHidden );
- // initialize API conversion (remembers xChartDoc and rChartRect internally)
- InitConversion( xChartDoc, rChartRect );
+ // initialize API conversion (remembers xChartDoc and rChartRange internally)
+ InitConversion( xChartDoc, rChartRange );
// chart frame
ScfPropertySet aFrameProp( xChartDoc->getPageBackground() );
@@ -3426,10 +3427,10 @@ void XclExpChChart::WriteBody( XclExpStream& rStrm )
// ----------------------------------------------------------------------------
XclExpChartDrawing::XclExpChartDrawing( const XclExpRoot& rRoot,
- const Reference< XModel >& rxModel, const Size& rChartSize ) :
+ const Reference< XModel >& rxModel, const basegfx::B2DVector& rChartScale ) :
XclExpRoot( rRoot )
{
- if( (rChartSize.Width() > 0) && (rChartSize.Height() > 0) )
+ if( (rChartScale.getX() > 0.0) && (rChartScale.getY() > 0.0) )
{
ScfPropertySet aPropSet( rxModel );
Reference< XShapes > xShapes;
@@ -3438,7 +3439,7 @@ XclExpChartDrawing::XclExpChartDrawing( const XclExpRoot& rRoot,
/* Create a new independent object manager with own DFF stream for the
DGCONTAINER, pass global manager as parent for shared usage of
global DFF data (picture container etc.). */
- mxObjMgr.reset( new XclExpEmbeddedObjectManager( GetObjectManager(), rChartSize, EXC_CHART_TOTALUNITS, EXC_CHART_TOTALUNITS ) );
+ mxObjMgr.reset( new XclExpEmbeddedObjectManager( GetObjectManager(), rChartScale, EXC_CHART_TOTALUNITS, EXC_CHART_TOTALUNITS ) );
// initialize the drawing object list
mxObjMgr->StartSheet();
// process the draw page (convert all shapes)
@@ -3461,17 +3462,17 @@ void XclExpChartDrawing::Save( XclExpStream& rStrm )
// ----------------------------------------------------------------------------
-XclExpChart::XclExpChart( const XclExpRoot& rRoot, Reference< XModel > xModel, const Rectangle& rChartRect ) :
+XclExpChart::XclExpChart( const XclExpRoot& rRoot, Reference< XModel > xModel, const basegfx::B2DRange& rChartRange ) :
XclExpSubStream( EXC_BOF_CHART ),
XclExpRoot( rRoot )
{
AppendNewRecord( new XclExpChartPageSettings( rRoot ) );
AppendNewRecord( new XclExpBoolRecord( EXC_ID_PROTECT, false ) );
- AppendNewRecord( new XclExpChartDrawing( rRoot, xModel, rChartRect.GetSize() ) );
+ AppendNewRecord( new XclExpChartDrawing( rRoot, xModel, rChartRange.getRange() ) );
AppendNewRecord( new XclExpUInt16Record( EXC_ID_CHUNITS, EXC_CHUNITS_TWIPS ) );
Reference< XChartDocument > xChartDoc( xModel, UNO_QUERY );
- AppendNewRecord( new XclExpChChart( rRoot, xChartDoc, rChartRect ) );
+ AppendNewRecord( new XclExpChChart( rRoot, xChartDoc, rChartRange ) );
}
// ============================================================================
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index ca403e70bcc3..b1b1bc07ed26 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -47,6 +47,7 @@
#include <editeng/editobj.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <svx/svdlegacy.hxx>
#include "editutil.hxx"
#include "unonames.hxx"
@@ -98,8 +99,9 @@ void XclExpDffAnchorBase::SetFlags( const SdrObject& rSdrObj )
void XclExpDffAnchorBase::SetSdrObject( const SdrObject& rSdrObj )
{
+ const basegfx::B2DRange aRange(rSdrObj.getObjectRange(0));
ImplSetFlags( rSdrObj );
- ImplCalcAnchorRect( rSdrObj.GetCurrentBoundRect(), MAP_100TH_MM );
+ ImplCalcAnchorRange( aRange, MAP_100TH_MM );
}
void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const
@@ -108,10 +110,11 @@ void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const
rEscherEx.GetStream() << mnFlags << maAnchor;
}
-void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const Rectangle& rRect )
+void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx,
+ const basegfx::B2DRange& rObjectRange)
{
// the passed rectangle is in twips
- ImplCalcAnchorRect( rRect, MAP_TWIP );
+ ImplCalcAnchorRange( rObjectRange, MAP_TWIP );
WriteDffData( rEscherEx );
}
@@ -120,7 +123,7 @@ void XclExpDffAnchorBase::ImplSetFlags( const SdrObject& )
OSL_ENSURE( false, "XclExpDffAnchorBase::ImplSetFlags - not implemented" );
}
-void XclExpDffAnchorBase::ImplCalcAnchorRect( const Rectangle&, MapUnit )
+void XclExpDffAnchorBase::ImplCalcAnchorRange( const basegfx::B2DRange& /*rObjectRange*/, MapUnit )
{
OSL_ENSURE( false, "XclExpDffAnchorBase::ImplCalcAnchorRect - not implemented" );
}
@@ -135,24 +138,23 @@ XclExpDffSheetAnchor::XclExpDffSheetAnchor( const XclExpRoot& rRoot ) :
void XclExpDffSheetAnchor::ImplSetFlags( const SdrObject& rSdrObj )
{
- // Special case "page anchor" (X==0,Y==1) -> lock pos and size.
- const Point& rPos = rSdrObj.GetAnchorPos();
- mnFlags = ((rPos.X() == 0) && (rPos.Y() == 1)) ? EXC_ESC_ANCHOR_LOCKED : 0;
+ // #i108739# use extra bool flag to get rid of the old Anchor-Hack
+ mnFlags = rSdrObj.getUniversalApplicationFlag01() ? EXC_ESC_ANCHOR_LOCKED : 0;
}
-void XclExpDffSheetAnchor::ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit )
+void XclExpDffSheetAnchor::ImplCalcAnchorRange( const basegfx::B2DRange& rObjectRange, MapUnit eMapUnit )
{
- maAnchor.SetRect( GetRoot(), mnScTab, rRect, eMapUnit );
+ maAnchor.SetRangeAtAnchor( GetRoot(), mnScTab, rObjectRange, eMapUnit );
}
// ----------------------------------------------------------------------------
XclExpDffEmbeddedAnchor::XclExpDffEmbeddedAnchor( const XclExpRoot& rRoot,
- const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY ) :
+ const basegfx::B2DVector& rPageScale, double fScaleX, double fScaleY ) :
XclExpDffAnchorBase( rRoot ),
- maPageSize( rPageSize ),
- mnScaleX( nScaleX ),
- mnScaleY( nScaleY )
+ maPageScale( rPageScale ),
+ mfScaleX( fScaleX ),
+ mfScaleY( fScaleY )
{
}
@@ -161,17 +163,17 @@ void XclExpDffEmbeddedAnchor::ImplSetFlags( const SdrObject& /*rSdrObj*/ )
// TODO (unsupported feature): fixed size
}
-void XclExpDffEmbeddedAnchor::ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit )
+void XclExpDffEmbeddedAnchor::ImplCalcAnchorRange( const basegfx::B2DRange& rObjectRange, MapUnit eMapUnit )
{
- maAnchor.SetRect( maPageSize, mnScaleX, mnScaleY, rRect, eMapUnit, true );
+ maAnchor.SetRangeAtAnchor( maPageScale, mfScaleX, mfScaleY, rObjectRange, eMapUnit, true );
}
// ----------------------------------------------------------------------------
-XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect ) :
+XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const basegfx::B2DRange& rObjectRange ) :
XclExpDffAnchorBase( rRoot, EXC_ESC_ANCHOR_SIZELOCKED )
{
- maAnchor.SetRect( rRoot, rRoot.GetCurrScTab(), rRect, MAP_100TH_MM );
+ maAnchor.SetRangeAtAnchor( rRoot, rRoot.GetCurrScTab(), rObjectRange, MAP_100TH_MM );
}
// ----------------------------------------------------------------------------
@@ -376,9 +378,14 @@ void XclExpControlHelper::WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16 nS
//delete for exporting OCX
//#if EXC_EXP_OCX_CTRL
-XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape,
- const Rectangle* pChildAnchor, const String& rClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
- XclObj( rObjMgr, EXC_OBJTYPE_PICTURE, true ),
+XclExpOcxControlObj::XclExpOcxControlObj(
+ XclExpObjectManager& rObjMgr,
+ Reference< XShape > xShape,
+ const basegfx::B2DRange* pObjectRange,
+ const String& rClassName,
+ sal_uInt32 nStrmStart,
+ sal_uInt32 nStrmSize )
+: XclObj( rObjMgr, EXC_OBJTYPE_PICTURE, true ),
XclExpControlHelper( rObjMgr.GetRoot() ),
maClassName( rClassName ),
mnStrmStart( nStrmStart ),
@@ -395,8 +402,8 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc
// fill DFF property set
mrEscherEx.OpenContainer( ESCHER_SpContainer );
mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE );
- Rectangle aDummyRect;
- EscherPropertyContainer aPropOpt( mrEscherEx.GetGraphicProvider(), mrEscherEx.QueryPictureStream(), aDummyRect );
+ basegfx::B2DRange aEmptyRange;
+ EscherPropertyContainer aPropOpt( mrEscherEx.GetGraphicProvider(), mrEscherEx.QueryPictureStream(), aEmptyRange);
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x08000040 );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
@@ -420,7 +427,7 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc
aPropOpt.Commit( mrEscherEx.GetStream() );
// anchor
- ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
+ ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pObjectRange );
mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
mrEscherEx.CloseContainer(); // ESCHER_SpContainer
@@ -481,8 +488,11 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
//#else
-XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) :
- XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN, true ),
+XclExpTbxControlObj::XclExpTbxControlObj(
+ XclExpObjectManager& rObjMgr,
+ Reference< XShape > xShape,
+ const basegfx::B2DRange* pObjectRange)
+: XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN, true ),
XclExpControlHelper( rObjMgr.GetRoot() ),
mnHeight( 0 ),
mnState( 0 ),
@@ -566,7 +576,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Referenc
aPropOpt.Commit( mrEscherEx.GetStream() );
// anchor
- ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
+ ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pObjectRange );
mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
mrEscherEx.UpdateDffFragmentEnd();
@@ -922,8 +932,11 @@ void XclExpTbxControlObj::WriteSbs( XclExpStream& rStrm )
// ----------------------------------------------------------------------------
-XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) :
- XclObj( rObjMgr, EXC_OBJTYPE_CHART ),
+XclExpChartObj::XclExpChartObj(
+ XclExpObjectManager& rObjMgr,
+ Reference< XShape > xShape,
+ const basegfx::B2DRange* pObjectRange)
+: XclObj( rObjMgr, EXC_OBJTYPE_CHART ),
XclExpRoot( rObjMgr.GetRoot() )
{
// create the MSODRAWING record contents for the chart object
@@ -943,7 +956,7 @@ XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape
// anchor
SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape );
- ImplWriteAnchor( GetRoot(), pSdrObj, pChildAnchor );
+ ImplWriteAnchor( GetRoot(), pSdrObj, pObjectRange );
// client data (the following OBJ record)
mrEscherEx.AddAtom( 0, ESCHER_ClientData );
@@ -960,8 +973,8 @@ XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape
aShapeProp.GetProperty( xModel, CREATE_OUSTRING( "Model" ) );
::com::sun::star::awt::Rectangle aBoundRect;
aShapeProp.GetProperty( aBoundRect, CREATE_OUSTRING( "BoundRect" ) );
- Rectangle aChartRect( Point( aBoundRect.X, aBoundRect.Y ), Size( aBoundRect.Width, aBoundRect.Height ) );
- mxChart.reset( new XclExpChart( GetRoot(), xModel, aChartRect ) );
+ const basegfx::B2DRange aChartRange(aBoundRect.X, aBoundRect.Y, aBoundRect.X + aBoundRect.Width, aBoundRect.Y + aBoundRect.Height);
+ mxChart.reset( new XclExpChart( GetRoot(), xModel, aChartRange ) );
}
XclExpChartObj::~XclExpChartObj()
@@ -1006,7 +1019,12 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
if( pScNote )
if( SdrCaptionObj* pCaption = pScNote->GetOrCreateCaption( maScPos ) )
if( const OutlinerParaObject* pOPO = pCaption->GetOutlinerParaObject() )
- mnObjId = rRoot.GetObjectManager().AddObj( new XclObjComment( rRoot.GetObjectManager(), pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible ) );
+ {
+ const basegfx::B2DRange aRange(pCaption->getSdrObjectTranslate(), pCaption->getSdrObjectScale());
+ mnObjId = rRoot.GetObjectManager().AddObj(
+ new XclObjComment(
+ rRoot.GetObjectManager(), aRange, pOPO->GetTextObject(), pCaption, mbVisible ) );
+ }
SetRecSize( 9 + maAuthor.GetSize() );
}
@@ -1271,17 +1289,17 @@ void XclExpObjectManager::InitStream( bool bTempFile )
// ----------------------------------------------------------------------------
XclExpEmbeddedObjectManager::XclExpEmbeddedObjectManager(
- const XclExpObjectManager& rParent, const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY ) :
+ const XclExpObjectManager& rParent, const basegfx::B2DVector& rPageScale, double fScaleX, double fScaleY ) :
XclExpObjectManager( rParent ),
- maPageSize( rPageSize ),
- mnScaleX( nScaleX ),
- mnScaleY( nScaleY )
+ maPageScale( rPageScale ),
+ mfScaleX( fScaleX ),
+ mfScaleY( fScaleY )
{
}
XclExpDffAnchorBase* XclExpEmbeddedObjectManager::CreateDffAnchor() const
{
- return new XclExpDffEmbeddedAnchor( GetRoot(), maPageSize, mnScaleX, mnScaleY );
+ return new XclExpDffEmbeddedAnchor( GetRoot(), maPageScale, mfScaleX, mfScaleY );
}
// ============================================================================
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index 072d73493961..50183a338ded 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -495,7 +495,7 @@ XclExpStringRef lclCreateFormattedString(
if( aEditSet.GetItemState( EE_FEATURE_FIELD, sal_False, &pItem ) == SFX_ITEM_SET )
{
const SvxFieldData* pField = static_cast< const SvxFieldItem* >( pItem )->GetField();
- if( const SvxURLField* pUrlField = PTR_CAST( SvxURLField, pField ) )
+ if( const SvxURLField* pUrlField = dynamic_cast< const SvxURLField* >( pField ) )
{
// convert URL field to string representation
aXclPortionText = pLinkHelper ?
@@ -849,19 +849,19 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico
{
if( const SvxFieldData* pFieldData = static_cast< const SvxFieldItem* >( pItem )->GetField() )
{
- if( pFieldData->ISA( SvxPageField ) )
+ if( dynamic_cast< const SvxPageField* >(pFieldData) )
aParaText.AppendAscii( "&P" );
- else if( pFieldData->ISA( SvxPagesField ) )
+ else if( dynamic_cast< const SvxPagesField* >(pFieldData) )
aParaText.AppendAscii( "&N" );
- else if( pFieldData->ISA( SvxDateField ) )
+ else if( dynamic_cast< const SvxDateField* >(pFieldData) )
aParaText.AppendAscii( "&D" );
- else if( pFieldData->ISA( SvxTimeField ) || pFieldData->ISA( SvxExtTimeField ) )
+ else if( dynamic_cast< const SvxTimeField* >(pFieldData) || dynamic_cast< const SvxExtTimeField* >(pFieldData) )
aParaText.AppendAscii( "&T" );
- else if( pFieldData->ISA( SvxTableField ) )
+ else if( dynamic_cast< const SvxTableField* >(pFieldData) )
aParaText.AppendAscii( "&A" );
- else if( pFieldData->ISA( SvxFileField ) ) // title -> file name
+ else if( dynamic_cast< const SvxFileField* >(pFieldData) ) // title -> file name
aParaText.AppendAscii( "&F" );
- else if( const SvxExtFileField* pFileField = PTR_CAST( SvxExtFileField, pFieldData ) )
+ else if( const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >( pFieldData ) )
{
switch( pFileField->GetFormat() )
{
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index 30c288fda835..479cba955e00 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -281,13 +281,13 @@ uno::Sequence< beans::NamedValue > XclExpRoot::GenerateEncryptionData( const ::r
uno::Sequence< beans::NamedValue > XclExpRoot::GetEncryptionData() const
{
uno::Sequence< beans::NamedValue > aEncryptionData;
- SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if ( pEncryptionDataItem )
pEncryptionDataItem->GetValue() >>= aEncryptionData;
else
{
// try to get the encryption data from the password
- SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( GetMedium().GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD );
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
aEncryptionData = GenerateEncryptionData( pPasswordItem->GetValue() );
}
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 4cd1cdccb7ce..da8b0079a623 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -2359,7 +2359,6 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
SCCOL nLastIterScCol = nMaxScCol;
SCROW nLastIterScRow = ulimit_cast< SCROW >( nLastUsedScRow + 128, nMaxScRow );
// modified for 119707 by zhanglu
-
SCCOL rEndColAtt = 0;
SCROW rEndRowAtt = 0;
rDoc.GetLastAttrCell( nScTab, rEndColAtt,rEndRowAtt ); // To get the real last cell's row number, which has visual data or attribute.
@@ -2368,7 +2367,6 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
if (nLastIterScRow > nMaxScRow)
nLastIterScRow = nMaxScRow;
-
// modified for 119707 end
ScUsedAreaIterator aIt( &rDoc, nScTab, 0, 0, nLastIterScCol, nLastIterScRow );
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 70a9f94360ab..28e53d09ccf8 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -268,10 +268,10 @@ Color XclImpChRoot::GetSeriesFillAutoColor( sal_uInt16 nFormatIdx ) const
return ScfTools::GetMixedColor( aColor, rPal.GetColor( EXC_COLOR_CHWINDOWBACK ), nTrans );
}
-void XclImpChRoot::InitConversion( Reference< XChartDocument > xChartDoc, const Rectangle& rChartRect ) const
+void XclImpChRoot::InitConversion( Reference< XChartDocument > xChartDoc, const basegfx::B2DRange& rChartRange ) const
{
// create formatting object tables
- mxChData->InitConversion( GetRoot(), xChartDoc, rChartRect );
+ mxChData->InitConversion( GetRoot(), xChartDoc, rChartRange );
// lock the model to suppress any internal updates
Reference< XModel > xModel( xChartDoc, UNO_QUERY );
@@ -337,12 +337,12 @@ sal_Int32 XclImpChRoot::CalcHmmFromChartY( sal_Int32 nPosY ) const
double XclImpChRoot::CalcRelativeFromHmmX( sal_Int32 nPosX ) const
{
- return static_cast< double >( nPosX ) / mxChData->maChartRect.GetWidth();
+ return static_cast< double >( nPosX ) / mxChData->maChartRange.getWidth();
}
double XclImpChRoot::CalcRelativeFromHmmY( sal_Int32 nPosY ) const
{
- return static_cast< double >( nPosY ) / mxChData->maChartRect.GetHeight();
+ return static_cast< double >( nPosY ) / mxChData->maChartRange.getHeight();
}
double XclImpChRoot::CalcRelativeFromChartX( sal_Int32 nPosX ) const
@@ -352,7 +352,7 @@ double XclImpChRoot::CalcRelativeFromChartX( sal_Int32 nPosX ) const
double XclImpChRoot::CalcRelativeFromChartY( sal_Int32 nPosY ) const
{
- return CalcRelativeFromHmmY( CalcHmmFromChartY( nPosY ) );
+ return static_cast< double >( CalcHmmFromChartY( nPosY ) ) / mxChData->maChartRange.getHeight();
}
void XclImpChRoot::ConvertLineFormat( ScfPropertySet& rPropSet,
@@ -3829,10 +3829,10 @@ bool XclImpChChart::IsManualPlotArea() const
}
void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc,
- XclImpDffConverter& rDffConv, const OUString& rObjName, const Rectangle& rChartRect ) const
+ XclImpDffConverter& rDffConv, const OUString& rObjName, const basegfx::B2DRange& rChartRange ) const
{
// initialize conversion (locks the model to suppress any internal updates)
- InitConversion( xChartDoc, rChartRect );
+ InitConversion( xChartDoc, rChartRange );
// chart frame formatting
if( mxFrame.is() )
@@ -4093,9 +4093,9 @@ XclImpChartDrawing::XclImpChartDrawing( const XclImpRoot& rRoot, bool bOwnTab )
}
void XclImpChartDrawing::ConvertObjects( XclImpDffConverter& rDffConv,
- const Reference< XModel >& rxModel, const Rectangle& rChartRect )
+ const Reference< XModel >& rxModel, const basegfx::B2DRange& rChartRange )
{
- maChartRect = rChartRect; // needed in CalcAnchorRect() callback
+ maChartRange = rChartRange; // needed in CalcAnchorRect() callback
SdrModel* pSdrModel = 0;
SdrPage* pSdrPage = 0;
@@ -4113,7 +4113,7 @@ void XclImpChartDrawing::ConvertObjects( XclImpDffConverter& rDffConv,
Reference< XDrawPageSupplier > xDrawPageSupp( rxModel, UNO_QUERY_THROW );
Reference< XDrawPage > xDrawPage( xDrawPageSupp->getDrawPage(), UNO_SET_THROW );
pSdrPage = ::GetSdrPageFromXDrawPage( xDrawPage );
- pSdrModel = pSdrPage ? pSdrPage->GetModel() : 0;
+ pSdrModel = pSdrPage ? &pSdrPage->getSdrModelFromSdrPage() : 0;
}
catch( Exception& )
{
@@ -4124,21 +4124,24 @@ void XclImpChartDrawing::ConvertObjects( XclImpDffConverter& rDffConv,
ImplConvertObjects( rDffConv, *pSdrModel, *pSdrPage );
}
-Rectangle XclImpChartDrawing::CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const
+basegfx::B2DRange XclImpChartDrawing::CalcAnchorRange( const XclObjAnchor& rAnchor, bool bDffAnchor ) const
{
/* In objects with DFF client anchor, the position of the shape is stored
in the cell address components of the client anchor. In old BIFF3-BIFF5
objects, the position is stored in the offset components of the anchor. */
- Rectangle aRect(
- static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maFirst.mnCol : rAnchor.mnLX ) / EXC_CHART_TOTALUNITS * maChartRect.GetWidth() + 0.5 ),
- static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maFirst.mnRow : rAnchor.mnTY ) / EXC_CHART_TOTALUNITS * maChartRect.GetHeight() + 0.5 ),
- static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maLast.mnCol : rAnchor.mnRX ) / EXC_CHART_TOTALUNITS * maChartRect.GetWidth() + 0.5 ),
- static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maLast.mnRow : rAnchor.mnBY ) / EXC_CHART_TOTALUNITS * maChartRect.GetHeight() + 0.5 ) );
- aRect.Justify();
+ basegfx::B2DRange aRange(
+ static_cast< double >( bDffAnchor ? rAnchor.maFirst.mnCol : rAnchor.mnLX ) / EXC_CHART_TOTALUNITS * maChartRange.getWidth() + 0.5,
+ static_cast< double >( bDffAnchor ? rAnchor.maFirst.mnRow : rAnchor.mnTY ) / EXC_CHART_TOTALUNITS * maChartRange.getHeight() + 0.5,
+ static_cast< double >( bDffAnchor ? rAnchor.maLast.mnCol : rAnchor.mnRX ) / EXC_CHART_TOTALUNITS * maChartRange.getWidth() + 0.5,
+ static_cast< double >( bDffAnchor ? rAnchor.maLast.mnRow : rAnchor.mnBY ) / EXC_CHART_TOTALUNITS * maChartRange.getHeight() + 0.5 );
+
// move shapes into chart area for sheet charts
if( mbOwnTab )
- aRect.Move( maChartRect.Left(), maChartRect.Top() );
- return aRect;
+ {
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(maChartRange.getMinimum()));
+ }
+
+ return aRange;
}
void XclImpChartDrawing::OnObjectInserted( const XclImpDrawObjBase& )
@@ -4251,15 +4254,15 @@ sal_Size XclImpChart::GetProgressSize() const
(mxChartDrawing.is() ? mxChartDrawing->GetProgressSize() : 0);
}
-void XclImpChart::Convert( Reference< XModel > xModel, XclImpDffConverter& rDffConv, const OUString& rObjName, const Rectangle& rChartRect ) const
+void XclImpChart::Convert( Reference< XModel > xModel, XclImpDffConverter& rDffConv, const OUString& rObjName, const basegfx::B2DRange& rChartRange ) const
{
Reference< XChartDocument > xChartDoc( xModel, UNO_QUERY );
if( xChartDoc.is() )
{
if( mxChartData.is() )
- mxChartData->Convert( xChartDoc, rDffConv, rObjName, rChartRect );
+ mxChartData->Convert( xChartDoc, rDffConv, rObjName, rChartRange );
if( mxChartDrawing.is() )
- mxChartDrawing->ConvertObjects( rDffConv, xModel, rChartRect );
+ mxChartDrawing->ConvertObjects( rDffConv, xModel, rChartRange );
}
}
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 617b1a2c0fed..1370fd6d0db5 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -75,7 +75,6 @@
#include <svx/unoapi.hxx>
#include <svx/svditer.hxx>
#include <editeng/writingmodeitem.hxx>
-#include <svx/charthelper.hxx>
#include "scitems.hxx"
#include <editeng/eeitem.hxx>
@@ -86,6 +85,7 @@
#include <svx/xlinjoit.hxx>
#include <svx/xlntrit.hxx>
#include <svx/xbtmpit.hxx>
+#include <svx/svdlegacy.hxx>
#include "document.hxx"
#include "drwlayer.hxx"
@@ -148,7 +148,7 @@ using ::com::sun::star::table::CellRangeAddress;
namespace {
/** Helper class which mimics the auto_ptr< SdrObject > semantics, but calls
- SdrObject::Free instead of deleting the SdrObject directly. */
+ deleteSdrObjectSafeAndClearPointer instead of deleting the SdrObject directly. */
template< typename SdrObjType >
class TSdrObjectPtr
{
@@ -175,7 +175,7 @@ private:
TSdrObjectPtr( const TSdrObjectPtr& ); // not implemented
TSdrObjectPtr& operator=( TSdrObjectPtr& rxObj ); // not implemented
- inline void free() { SdrObject* pObj = mpObj; mpObj = 0; SdrObject::Free( pObj ); }
+ inline void free() { SdrObject* pObj = mpObj; mpObj = 0; deleteSdrObjectSafeAndClearPointer( pObj ); }
private:
SdrObjType* mpObj;
@@ -414,12 +414,12 @@ const XclObjAnchor* XclImpDrawObjBase::GetAnchor() const
return mbHasAnchor ? &maAnchor : 0;
}
-bool XclImpDrawObjBase::IsValidSize( const Rectangle& rAnchorRect ) const
+bool XclImpDrawObjBase::IsValidSize( const basegfx::B2DRange& rAnchorRange ) const
{
// XclObjAnchor rounds up the width, width of 3 is the result of an Excel width of 0
return mbAreaObj ?
- ((rAnchorRect.GetWidth() > 3) && (rAnchorRect.GetHeight() > 1)) :
- ((rAnchorRect.GetWidth() > 3) || (rAnchorRect.GetHeight() > 1));
+ ((rAnchorRange.getWidth() > 3.0) && (rAnchorRange.getHeight() > 1.0)) :
+ ((rAnchorRange.getWidth() > 3.0) || (rAnchorRange.getHeight() > 1.0));
}
ScRange XclImpDrawObjBase::GetUsedArea( SCTAB nScTab ) const
@@ -442,7 +442,7 @@ sal_Size XclImpDrawObjBase::GetProgressSize() const
return DoGetProgressSize();
}
-SdrObject* XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect, bool bIsDff ) const
+SdrObject* XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange, bool bIsDff ) const
{
SdrObjectPtr xSdrObj;
if( bIsDff && !mbCustomDff )
@@ -451,9 +451,9 @@ SdrObject* XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, con
}
else
{
- xSdrObj.reset( DoCreateSdrObj( rDffConv, rAnchorRect ) );
- if( xSdrObj.is() )
- xSdrObj->SetModel( rDffConv.GetModel() );
+ xSdrObj.reset( DoCreateSdrObj( rDffConv, rAnchorRange ) );
+ //if( xSdrObj.is() )
+ // xSdrObj->SetModel( rDffConv.GetModel() );
//added for exporting OCX control
/* mnObjType value set should be as below table:
0x0000 Group 0x0001 Line
@@ -472,11 +472,11 @@ SdrObject* XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, con
+-----------------------------------------------------+
0x0019 Note 0x001E OfficeArt object
*/
- if( xSdrObj.is() && xSdrObj->IsUnoObj() &&
- ( (mnObjType < 25 && mnObjType > 10) || mnObjType == 7 || mnObjType == 8 ) )
+ if(xSdrObj.is())
{
- SdrUnoObj* pSdrUnoObj = dynamic_cast< SdrUnoObj* >( xSdrObj.get() );
- if( pSdrUnoObj != NULL )
+ SdrUnoObj* pSdrUnoObj = dynamic_cast< SdrUnoObj* >(xSdrObj.get());
+
+ if(pSdrUnoObj && ((mnObjType < 25 && mnObjType > 10) || mnObjType == 7 || mnObjType == 8 ))
{
Reference< XControlModel > xCtrlModel = pSdrUnoObj->GetUnoControlModel();
Reference< XPropertySet > xPropSet(xCtrlModel,UNO_QUERY);
@@ -528,16 +528,13 @@ SdrObject* XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, con
void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
// default: front layer, derived classes may have to set other layer in DoPreProcessSdrObj()
- rSdrObj.NbcSetLayer( SC_LAYER_FRONT );
- SdrModel * pModel = rSdrObj.GetModel();
- if ( pModel ) {
- const bool bEnableUndo = pModel->IsUndoEnabled();
- pModel->EnableUndo(false);
- // set object name (GetObjName() will always return a non-empty name)
- rSdrObj.SetName( GetObjName() );
- pModel->EnableUndo(bEnableUndo);
- } else
- rSdrObj.SetName( GetObjName() );
+ rSdrObj.SetLayer( SC_LAYER_FRONT );
+ const bool bEnableUndo(rSdrObj.getSdrModelFromSdrObject().IsUndoEnabled());
+ rSdrObj.getSdrModelFromSdrObject().EnableUndo(false);
+ // set object name (GetObjName() will always return a non-empty name)
+ rSdrObj.SetName( GetObjName() );
+ rSdrObj.getSdrModelFromSdrObject().EnableUndo(bEnableUndo);
+
// #i39167# full width for all objects regardless of horizontal alignment
rSdrObj.SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
@@ -545,10 +542,10 @@ void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrOb
if( mbAutoMargin )
{
sal_Int32 nMargin = rDffConv.GetDefaultTextMargin();
- rSdrObj.SetMergedItem( SdrTextLeftDistItem( nMargin ) );
- rSdrObj.SetMergedItem( SdrTextRightDistItem( nMargin ) );
- rSdrObj.SetMergedItem( SdrTextUpperDistItem( nMargin ) );
- rSdrObj.SetMergedItem( SdrTextLowerDistItem( nMargin ) );
+ rSdrObj.SetMergedItem( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, nMargin ) );
+ rSdrObj.SetMergedItem( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, nMargin ) );
+ rSdrObj.SetMergedItem( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, nMargin ) );
+ rSdrObj.SetMergedItem( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, nMargin ) );
}
// macro and hyperlink
@@ -758,10 +755,10 @@ void XclImpDrawObjBase::ConvertFrameStyle( SdrObject& rSdrObj, sal_uInt16 nFrame
{
if( ::get_flag( nFrameFlags, EXC_OBJ_FRAME_SHADOW ) )
{
- rSdrObj.SetMergedItem( SdrShadowItem( sal_True ) );
- rSdrObj.SetMergedItem( SdrShadowXDistItem( 35 ) );
- rSdrObj.SetMergedItem( SdrShadowYDistItem( 35 ) );
- rSdrObj.SetMergedItem( SdrShadowColorItem( EMPTY_STRING, GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
+ rSdrObj.SetMergedItem( SdrOnOffItem(SDRATTR_SHADOW, sal_True ) );
+ rSdrObj.SetMergedItem( SdrMetricItem(SDRATTR_SHADOWXDIST, 35 ) );
+ rSdrObj.SetMergedItem( SdrMetricItem(SDRATTR_SHADOWYDIST, 35 ) );
+ rSdrObj.SetMergedItem( XColorItem(SDRATTR_SHADOWCOLOR, EMPTY_STRING, GetPalette().GetColor( EXC_COLOR_WINDOWTEXT ) ) );
}
}
@@ -820,7 +817,7 @@ sal_Size XclImpDrawObjBase::DoGetProgressSize() const
return 1;
}
-SdrObject* XclImpDrawObjBase::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& ) const
+SdrObject* XclImpDrawObjBase::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& ) const
{
rDffConv.Progress( GetProgressSize() );
return 0;
@@ -1027,11 +1024,11 @@ sal_Size XclImpGroupObj::DoGetProgressSize() const
return XclImpDrawObjBase::DoGetProgressSize() + maChildren.GetProgressSize();
}
-SdrObject* XclImpGroupObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& /*rAnchorRect*/ ) const
+SdrObject* XclImpGroupObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& /* rAnchorRange */ ) const
{
- TSdrObjectPtr< SdrObjGroup > xSdrObj( new SdrObjGroup );
+ TSdrObjectPtr< SdrObjGroup > xSdrObj( new SdrObjGroup(rDffConv.GetTargetSdrModel()) );
// child objects in BIFF2-BIFF5 have absolute size, not needed to pass own anchor rectangle
- SdrObjList& rObjList = *xSdrObj->GetSubList(); // SdrObjGroup always returns existing sublist
+ SdrObjList& rObjList = *xSdrObj->getChildrenOfSdrObject(); // SdrObjGroup always returns existing sublist
for( XclImpDrawObjVector::const_iterator aIt = maChildren.begin(), aEnd = maChildren.end(); aIt != aEnd; ++aIt )
rDffConv.ProcessObject( rObjList, **aIt );
rDffConv.Progress();
@@ -1070,30 +1067,32 @@ void XclImpLineObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
ReadMacro5( rStrm, nMacroSize );
}
-SdrObject* XclImpLineObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpLineObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
::basegfx::B2DPolygon aB2DPolygon;
switch( mnStartPoint )
{
default:
case EXC_OBJ_LINE_TL:
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Top() ) );
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Bottom() ) );
+ aB2DPolygon.append( rAnchorRange.getMinimum() );
+ aB2DPolygon.append( rAnchorRange.getMaximum() );
break;
case EXC_OBJ_LINE_TR:
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Top() ) );
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Bottom() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRange.getMaxX(), rAnchorRange.getMinY() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRange.getMinX(), rAnchorRange.getMaxY() ) );
break;
case EXC_OBJ_LINE_BR:
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Bottom() ) );
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Top() ) );
+ aB2DPolygon.append( rAnchorRange.getMaximum() );
+ aB2DPolygon.append( rAnchorRange.getMinimum() );
break;
case EXC_OBJ_LINE_BL:
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Left(), rAnchorRect.Bottom() ) );
- aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Top() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRange.getMinX(), rAnchorRange.getMaxY() ) );
+ aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRange.getMaxX(), rAnchorRange.getMinY() ) );
break;
}
- SdrObjectPtr xSdrObj( new SdrPathObj( OBJ_LINE, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
+ SdrObjectPtr xSdrObj( new SdrPathObj(
+ rDffConv.GetTargetSdrModel(),
+ ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
ConvertLineStyle( *xSdrObj, maLineData );
// line ends
@@ -1207,9 +1206,13 @@ void XclImpRectObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
ReadMacro5( rStrm, nMacroSize );
}
-SdrObject* XclImpRectObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpRectObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
- SdrObjectPtr xSdrObj( new SdrRectObj( rAnchorRect ) );
+ SdrObjectPtr xSdrObj(
+ new SdrRectObj(
+ rDffConv.GetTargetSdrModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rAnchorRange.getRange(), rAnchorRange.getMinimum())));
ConvertRectStyle( *xSdrObj );
rDffConv.Progress();
return xSdrObj.release();
@@ -1222,9 +1225,14 @@ XclImpOvalObj::XclImpOvalObj( const XclImpRoot& rRoot ) :
{
}
-SdrObject* XclImpOvalObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpOvalObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
- SdrObjectPtr xSdrObj( new SdrCircObj( OBJ_CIRC, rAnchorRect ) );
+ SdrObjectPtr xSdrObj(
+ new SdrCircObj(
+ rDffConv.GetTargetSdrModel(),
+ CircleType_Circle,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rAnchorRange.getRange(), rAnchorRange.getMinimum())));
ConvertRectStyle( *xSdrObj );
rDffConv.Progress();
return xSdrObj.release();
@@ -1261,41 +1269,54 @@ void XclImpArcObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uIn
ReadMacro5( rStrm, nMacroSize );
}
-SdrObject* XclImpArcObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpArcObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
- Rectangle aNewRect = rAnchorRect;
- long nStartAngle = 0;
- long nEndAngle = 0;
+ basegfx::B2DRange aNewRange(rAnchorRange);
+ double fStartAngle(0.0);
+ double fEndAngle(0.0);
+
switch( mnQuadrant )
{
default:
case EXC_OBJ_ARC_TR:
- nStartAngle = 0;
- nEndAngle = 9000;
- aNewRect.Left() -= rAnchorRect.GetWidth();
- aNewRect.Bottom() += rAnchorRect.GetHeight();
+ fStartAngle = 0.0; // 0; TTTT angle conversion needs check
+ fEndAngle = 3.0 * F_PI; // 9000;
+ aNewRange = basegfx::B2DRange(
+ aNewRange.getMinX() - rAnchorRange.getWidth(), aNewRange.getMinY(),
+ aNewRange.getMaxX(), aNewRange.getMaxY() + rAnchorRange.getHeight());
break;
case EXC_OBJ_ARC_TL:
- nStartAngle = 9000;
- nEndAngle = 18000;
- aNewRect.Right() += rAnchorRect.GetWidth();
- aNewRect.Bottom() += rAnchorRect.GetHeight();
+ fStartAngle = 3.0 * F_PI; // 9000;
+ fEndAngle = F_PI; // 18000;
+ aNewRange = basegfx::B2DRange(
+ aNewRange.getMinX(), aNewRange.getMinY(),
+ aNewRange.getMaxX() + rAnchorRange.getWidth(), aNewRange.getMaxY() + rAnchorRange.getHeight());
break;
case EXC_OBJ_ARC_BL:
- nStartAngle = 18000;
- nEndAngle = 27000;
- aNewRect.Right() += rAnchorRect.GetWidth();
- aNewRect.Top() -= rAnchorRect.GetHeight();
+ fStartAngle = F_PI; // 18000;
+ fEndAngle = F_PI2; // 27000;
+ aNewRange = basegfx::B2DRange(
+ aNewRange.getMinX(), aNewRange.getMinY() - rAnchorRange.getHeight(),
+ aNewRange.getMaxX() + rAnchorRange.getWidth(), aNewRange.getMaxY());
break;
case EXC_OBJ_ARC_BR:
- nStartAngle = 27000;
- nEndAngle = 0;
- aNewRect.Left() -= rAnchorRect.GetWidth();
- aNewRect.Top() -= rAnchorRect.GetHeight();
+ fStartAngle = F_PI2; // 27000;
+ fEndAngle = 0.0; // 0;
+ aNewRange = basegfx::B2DRange(
+ aNewRange.getMinX() - rAnchorRange.getWidth(), aNewRange.getMinY() - rAnchorRange.getHeight(),
+ aNewRange.getMaxX(), aNewRange.getMaxY());
break;
}
- SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_SECT : OBJ_CARC;
- SdrObjectPtr xSdrObj( new SdrCircObj( eObjKind, aNewRect, nStartAngle, nEndAngle ) );
+
+ SdrObjectPtr xSdrObj(
+ new SdrCircObj(
+ rDffConv.GetTargetSdrModel(),
+ maFillData.IsFilled() ? CircleType_Sector : CircleType_Arc,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aNewRange.getRange(), aNewRange.getMinimum()),
+ fStartAngle,
+ fEndAngle));
+
ConvertFillStyle( *xSdrObj, maFillData );
ConvertLineStyle( *xSdrObj, maLineData );
rDffConv.Progress();
@@ -1321,7 +1342,7 @@ void XclImpPolygonObj::ReadCoordList( XclImpStream& rStrm )
{
sal_uInt16 nX, nY;
rStrm >> nX >> nY;
- maCoords.push_back( Point( nX, nY ) );
+ maCoords.push_back( basegfx::B2DPoint( nX, nY ) );
}
}
}
@@ -1351,16 +1372,16 @@ void XclImpPolygonObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal
namespace {
-::basegfx::B2DPoint lclGetPolyPoint( const Rectangle& rAnchorRect, const Point& rPoint )
+::basegfx::B2DPoint lclGetPolyPoint( const basegfx::B2DRange& rAnchorRect, const basegfx::B2DPoint& rPoint )
{
return ::basegfx::B2DPoint(
- rAnchorRect.Left() + static_cast< sal_Int32 >( ::std::min< double >( rPoint.X(), 16384.0 ) / 16384.0 * rAnchorRect.GetWidth() + 0.5 ),
- rAnchorRect.Top() + static_cast< sal_Int32 >( ::std::min< double >( rPoint.Y(), 16384.0 ) / 16384.0 * rAnchorRect.GetHeight() + 0.5 ) );
+ rAnchorRect.getMinX() + ::std::min< double >( rPoint.getX(), 16384.0 ) / 16384.0 * rAnchorRect.getWidth(),
+ rAnchorRect.getMinY() + ::std::min< double >( rPoint.getY(), 16384.0 ) / 16384.0 * rAnchorRect.getHeight());
}
} // namespace
-SdrObject* XclImpPolygonObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpPolygonObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
SdrObjectPtr xSdrObj;
if( maCoords.size() >= 2 )
@@ -1368,13 +1389,14 @@ SdrObject* XclImpPolygonObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const
// create the polygon
::basegfx::B2DPolygon aB2DPolygon;
for( PointVector::const_iterator aIt = maCoords.begin(), aEnd = maCoords.end(); aIt != aEnd; ++aIt )
- aB2DPolygon.append( lclGetPolyPoint( rAnchorRect, *aIt ) );
+ aB2DPolygon.append( lclGetPolyPoint( rAnchorRange, *aIt ) );
// close polygon if specified
if( ::get_flag( mnPolyFlags, EXC_OBJ_POLY_CLOSED ) && (maCoords.front() != maCoords.back()) )
- aB2DPolygon.append( lclGetPolyPoint( rAnchorRect, maCoords.front() ) );
+ aB2DPolygon.append( lclGetPolyPoint( rAnchorRange, maCoords.front() ) );
// create the SdrObject
- SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_PATHPOLY : OBJ_PATHPLIN;
- xSdrObj.reset( new SdrPathObj( eObjKind, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
+ xSdrObj.reset( new SdrPathObj(
+ rDffConv.GetTargetSdrModel(),
+ ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
ConvertRectStyle( *xSdrObj );
}
rDffConv.Progress();
@@ -1438,17 +1460,17 @@ void XclImpTextObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
maTextData.ReadFormats( rStrm );
}
-SdrObject* XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
- TSdrObjectPtr< SdrObjCustomShape > xSdrObj( new SdrObjCustomShape );
- xSdrObj->NbcSetSnapRect( rAnchorRect );
+ TSdrObjectPtr< SdrObjCustomShape > xSdrObj( new SdrObjCustomShape(rDffConv.GetTargetSdrModel()) );
+ sdr::legacy::SetSnapRange(*xSdrObj.get(), rAnchorRange );
OUString aRectType = CREATE_OUSTRING( "rectangle" );
xSdrObj->MergeDefaultAttributes( &aRectType );
ConvertRectStyle( *xSdrObj );
sal_Bool bAutoSize = ::get_flag( maTextData.maData.mnFlags, EXC_OBJ_TEXT_AUTOSIZE );
- xSdrObj->SetMergedItem( SdrTextAutoGrowWidthItem( bAutoSize ) );
- xSdrObj->SetMergedItem( SdrTextAutoGrowHeightItem( bAutoSize ) );
- xSdrObj->SetMergedItem( SdrTextWordWrapItem( sal_True ) );
+ xSdrObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, bAutoSize ) );
+ xSdrObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, bAutoSize ) );
+ xSdrObj->SetMergedItem( SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, sal_True ) );
rDffConv.Progress();
return xSdrObj.release();
}
@@ -1468,12 +1490,12 @@ void XclImpTextObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject&
OutlinerParaObject* pOutlineObj = new OutlinerParaObject( *xEditObj );
pOutlineObj->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT );
// text object takes ownership of the outliner object
- pTextObj->NbcSetOutlinerParaObject( pOutlineObj );
+ pTextObj->SetOutlinerParaObject( pOutlineObj );
}
else
{
// plain text
- pTextObj->NbcSetText( maTextData.mxString->GetText() );
+ pTextObj->SetText( maTextData.mxString->GetText() );
}
/* #i96858# Do not apply any formatting if there is no text.
@@ -1712,7 +1734,7 @@ sal_Size XclImpChartObj::DoGetProgressSize() const
return mxChart.is() ? mxChart->GetProgressSize() : 1;
}
-SdrObject* XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
SdrObjectPtr xSdrObj;
SfxObjectShell* pDocShell = GetDocShell();
@@ -1726,18 +1748,23 @@ SdrObject* XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const R
/* Set the size to the embedded object, this prevents that font sizes
of text objects are changed in the chart when the object is
inserted into the draw page. */
- sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT;
- MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xEmbObj->getMapUnit( nAspect ) );
- Size aSize( Window::LogicToLogic( rAnchorRect.GetSize(), MapMode( MAP_100TH_MM ), MapMode( aUnit ) ) );
- ::com::sun::star::awt::Size aAwtSize( aSize.Width(), aSize.Height() );
- xEmbObj->setVisualAreaSize( nAspect, aAwtSize );
+ const sal_Int64 nAspect(::com::sun::star::embed::Aspects::MSOLE_CONTENT);
+ const MapUnit aUnit(VCLUnoHelper::UnoEmbed2VCLMapUnit(xEmbObj->getMapUnit(nAspect)));
+ const double fMapModScale(Window::GetFactorLogicToLogic(MAP_100TH_MM, aUnit));
+ const basegfx::B2DVector aNewSize(rAnchorRange.getRange() * fMapModScale);
+ const ::com::sun::star::awt::Size aAwtSize(basegfx::fround(aNewSize.getX()), basegfx::fround(aNewSize.getY()));
- // #121334# This call will change the chart's default background fill from white to transparent.
- // Add here again if this is wanted (see task description for details)
- // ChartHelper::AdaptDefaultsForChart( xEmbObj );
+ xEmbObj->setVisualAreaSize( nAspect, aAwtSize );
// create the container OLE object
- xSdrObj.reset( new SdrOle2Obj( svt::EmbeddedObjectRef( xEmbObj, nAspect ), aEmbObjName, rAnchorRect ) );
+ xSdrObj.reset(
+ new SdrOle2Obj(
+ rDffConv.GetTargetSdrModel(),
+ svt::EmbeddedObjectRef( xEmbObj, nAspect ),
+ aEmbObjName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rAnchorRange.getRange(),
+ rAnchorRange.getMinimum())));
}
return xSdrObj.release();
@@ -1753,7 +1780,7 @@ void XclImpChartObj::DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObjec
{
Reference< XEmbedPersist > xPersist( xEmbObj, UNO_QUERY_THROW );
Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY_THROW );
- mxChart->Convert( xModel, rDffConv, xPersist->getEntryName(), rSdrObj.GetLogicRect() );
+ mxChart->Convert( xModel, rDffConv, xPersist->getEntryName(), sdr::legacy::GetLogicRange(rSdrObj) );
xPersist->storeOwn();
}
catch( Exception& )
@@ -1776,23 +1803,23 @@ void XclImpChartObj::FinalizeTabChart()
const XclPageData& rPageData = GetPageSettings().GetPageData();
Size aPaperSize = rPageData.GetScPaperSize();
- long nWidth = XclTools::GetHmmFromTwips( aPaperSize.Width() );
- long nHeight = XclTools::GetHmmFromTwips( aPaperSize.Height() );
+ double fWidth(XclTools::GetHmmFromTwips( aPaperSize.Width() ));
+ double fHeight(XclTools::GetHmmFromTwips( aPaperSize.Height() ));
// subtract page margins, give some more extra space
- nWidth -= (XclTools::GetHmmFromInch( rPageData.mfLeftMargin + rPageData.mfRightMargin ) + 2000);
- nHeight -= (XclTools::GetHmmFromInch( rPageData.mfTopMargin + rPageData.mfBottomMargin ) + 1000);
+ fWidth -= (XclTools::GetHmmFromInch( rPageData.mfLeftMargin + rPageData.mfRightMargin ) + 2000.0);
+ fHeight -= (XclTools::GetHmmFromInch( rPageData.mfTopMargin + rPageData.mfBottomMargin ) + 1000.0);
// print column/row headers?
if( rPageData.mbPrintHeadings )
{
- nWidth -= 2000;
- nHeight -= 1000;
+ fWidth -= 2000.0;
+ fHeight -= 1000.0;
}
// create the object anchor
XclObjAnchor aAnchor;
- aAnchor.SetRect( GetRoot(), GetCurrScTab(), Rectangle( 1000, 500, nWidth, nHeight ), MAP_100TH_MM );
+ aAnchor.SetRangeAtAnchor( GetRoot(), GetCurrScTab(), basegfx::B2DRange(1000.0, 500.0, 1000.0 + fWidth, 500.0 + fHeight), MAP_100TH_MM );
SetAnchor( aAnchor );
}
@@ -1823,10 +1850,11 @@ void XclImpNoteObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject&
{
// create cell note with all data from drawing object
ScNoteUtil::CreateNoteFromObjectData(
- GetDoc(), maScPos,
+ GetDoc(),
+ maScPos,
rSdrObj.GetMergedItemSet().Clone(), // new object on heap expected
new OutlinerParaObject( *pOutlinerObj ), // new object on heap expected
- rSdrObj.GetLogicRect(),
+ sdr::legacy::GetLogicRange(rSdrObj),
::get_flag( mnNoteFlags, EXC_NOTE_VISIBLE ),
false );
}
@@ -1844,16 +1872,15 @@ XclImpControlHelper::~XclImpControlHelper()
{
}
-SdrObject* XclImpControlHelper::CreateSdrObjectFromShape(
- const Reference< XShape >& rxShape, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpControlHelper::CreateSdrObjectFromShape(const Reference< XShape >& rxShape, const basegfx::B2DRange& rAnchorRange ) const
{
mxShape = rxShape;
SdrObjectPtr xSdrObj( SdrObject::getSdrObjectFromXShape( rxShape ) );
if( xSdrObj.is() )
{
- xSdrObj->NbcSetSnapRect( rAnchorRect );
+ sdr::legacy::SetSnapRange(*xSdrObj.get(), rAnchorRange);
// #i30543# insert into control layer
- xSdrObj->NbcSetLayer( SC_LAYER_CONTROLS );
+ xSdrObj->SetLayer( SC_LAYER_CONTROLS );
}
return xSdrObj.release();
}
@@ -2075,9 +2102,9 @@ void XclImpTbxObjBase::ConvertLabel( ScfPropertySet& rPropSet ) const
ConvertFont( rPropSet );
}
-SdrObject* XclImpTbxObjBase::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpTbxObjBase::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
- SdrObjectPtr xSdrObj( rDffConv.CreateSdrObject( *this, rAnchorRect ) );
+ SdrObjectPtr xSdrObj( rDffConv.CreateSdrObject( *this, rAnchorRange ) );
rDffConv.Progress();
return xSdrObj.release();
}
@@ -2901,15 +2928,21 @@ void XclImpPictureObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRec
}
}
-SdrObject* XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
+SdrObject* XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const
{
// try to create an OLE object or form control
- SdrObjectPtr xSdrObj( rDffConv.CreateSdrObject( *this, rAnchorRect ) );
+ SdrObjectPtr xSdrObj( rDffConv.CreateSdrObject( *this, rAnchorRange ) );
// no OLE - create a plain picture from IMGDATA record data
if( !xSdrObj && (maGraphic.GetType() != GRAPHIC_NONE) )
{
- xSdrObj.reset( new SdrGrafObj( maGraphic, rAnchorRect ) );
+ xSdrObj.reset(
+ new SdrGrafObj(
+ rDffConv.GetTargetSdrModel(),
+ maGraphic,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rAnchorRange.getRange(), rAnchorRange.getMinimum())));
+
ConvertRectStyle( *xSdrObj );
}
@@ -3113,7 +3146,7 @@ void XclImpSolverContainer::RemoveSdrObjectInfo( SdrObject& rSdrObj )
// remove info of all child objects of a group object
if( SdrObjGroup* pGroupObj = dynamic_cast< SdrObjGroup* >( &rSdrObj ) )
{
- if( SdrObjList* pSubList = pGroupObj->GetSubList() )
+ if( SdrObjList* pSubList = pGroupObj->getChildrenOfSdrObject() )
{
// iterate flat over the list because this function already works recursively
SdrObjListIter aObjIt( *pSubList, IM_FLAT );
@@ -3178,7 +3211,7 @@ XclImpSimpleDffConverter::~XclImpSimpleDffConverter()
{
}
-FASTBOOL XclImpSimpleDffConverter::GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const
+bool XclImpSimpleDffConverter::GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const
{
ColorData nColor = GetPalette().GetColorData( static_cast< sal_uInt16 >( nIndex ) );
@@ -3257,11 +3290,12 @@ void XclImpDffConverter::ProcessObject( SdrObjList& rObjList, const XclImpDrawOb
{
if( const XclObjAnchor* pAnchor = rDrawObj.GetAnchor() )
{
- Rectangle aAnchorRect = GetConvData().mrDrawing.CalcAnchorRect( *pAnchor, false );
- if( rDrawObj.IsValidSize( aAnchorRect ) )
+ const basegfx::B2DRange aAnchorRange(GetConvData().mrDrawing.CalcAnchorRange( *pAnchor, false ));
+
+ if( rDrawObj.IsValidSize( aAnchorRange ) )
{
// CreateSdrObject() recursively creates embedded child objects
- SdrObjectPtr xSdrObj( rDrawObj.CreateSdrObject( *this, aAnchorRect, false ) );
+ SdrObjectPtr xSdrObj( rDrawObj.CreateSdrObject( *this, aAnchorRange, false ) );
if( xSdrObj.is() )
rDrawObj.PreProcessSdrObject( *this, *xSdrObj );
// call InsertSdrObject() also, if SdrObject is missing
@@ -3301,7 +3335,7 @@ void XclImpDffConverter::FinalizeDrawing()
SetModel( &maDataStack.back()->mrSdrModel, 1440 );
}
-SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const Rectangle& rAnchorRect )
+SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const basegfx::B2DRange& rAnchorRange )
{
SdrObjectPtr xSdrObj;
@@ -3318,7 +3352,7 @@ SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpTbxObjBase& rTbxObj,
XclImpDffConvData& rConvData = GetConvData();
if( rConvData.mxCtrlForm.is() && InsertControl( xFormComp, aDummySize, &xShape, sal_True ) )
{
- xSdrObj.reset( rTbxObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) );
+ xSdrObj.reset( rTbxObj.CreateSdrObjectFromShape( xShape, rAnchorRange ) );
// try to attach a macro to the control
ScriptEventDescriptor aDescriptor;
if( (rConvData.mnLastCtrlIndex >= 0) && rTbxObj.FillMacroDescriptor( aDescriptor ) )
@@ -3335,7 +3369,7 @@ SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpTbxObjBase& rTbxObj,
return xSdrObj.release();
}
-SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicObj, const Rectangle& rAnchorRect )
+SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicObj, const basegfx::B2DRange& rAnchorRange )
{
SdrObjectPtr xSdrObj;
@@ -3353,7 +3387,7 @@ SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicObj,
// read from mxCtlsStrm into xShape, insert the control model into the form
Reference< XShape > xShape;
if( GetConvData().mxCtrlForm.is() && ReadOCXExcelKludgeStream( mxCtlsStrm, &xShape, sal_True ) )
- xSdrObj.reset( rPicObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) );
+ xSdrObj.reset( rPicObj.CreateSdrObjectFromShape( xShape, rAnchorRange ) );
}
catch( Exception& )
{
@@ -3368,21 +3402,32 @@ SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicObj,
{
// first try to resolve graphic from DFF storage
Graphic aGraphic;
- Rectangle aVisArea;
+ basegfx::B2DRange aVisArea;
+
if( !GetBLIP( GetPropertyValue( DFF_Prop_pib ), aGraphic, &aVisArea ) )
{
// if not found, use graphic from object (imported from IMGDATA record)
aGraphic = rPicObj.GetGraphic();
aVisArea = rPicObj.GetVisArea();
}
+
if( aGraphic.GetType() != GRAPHIC_NONE )
{
ErrCode nError = ERRCODE_NONE;
namespace cssea = ::com::sun::star::embed::Aspects;
sal_Int64 nAspects = rPicObj.IsSymbol() ? cssea::MSOLE_ICON : cssea::MSOLE_CONTENT;
xSdrObj.reset( CreateSdrOLEFromStorage(
- aStrgName, xSrcStrg, pDocShell->GetStorage(), aGraphic,
- rAnchorRect, aVisArea, 0, nError, mnOleImpFlags, nAspects ) );
+ GetTargetSdrModel(),
+ aStrgName,
+ xSrcStrg,
+ pDocShell->GetStorage(),
+ aGraphic,
+ rAnchorRange,
+ aVisArea,
+ 0,
+ nError,
+ mnOleImpFlags,
+ nAspects ) );
}
}
}
@@ -3411,13 +3456,13 @@ void XclImpDffConverter::ProcessClientAnchor2( SvStream& rDffStrm,
rDffStrm.SeekRel( 2 ); // flags
rDffStrm >> aAnchor; // anchor format equal to BIFF5 OBJ records
pDrawObj->SetAnchor( aAnchor );
- rObjData.aChildAnchor = rConvData.mrDrawing.CalcAnchorRect( aAnchor, true );
+ rObjData.aChildAnchor = rConvData.mrDrawing.CalcAnchorRange( aAnchor, true );
rObjData.bChildAnchor = sal_True;
}
}
SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffObjData,
- void* pClientData, Rectangle& /*rTextRect*/, SdrObject* pOldSdrObj )
+ void* pClientData, basegfx::B2DRange& /*rTextRange*/, SdrObject* pOldSdrObj )
{
XclImpDffConvData& rConvData = GetConvData();
@@ -3428,7 +3473,7 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
// find the OBJ record data related to the processed shape
XclImpDrawObjRef xDrawObj = rConvData.mrDrawing.FindDrawObj( rDffObjData.rSpHd );
- const Rectangle& rAnchorRect = rDffObjData.aChildAnchor;
+ const basegfx::B2DRange& rAnchorRange = rDffObjData.aChildAnchor;
// #102378# Do not process the global page group shape (flag SP_FPATRIARCH)
bool bGlobalPageGroup = ::get_flag< sal_uInt32 >( rDffObjData.nSpFlags, SP_FPATRIARCH );
@@ -3444,7 +3489,7 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
*ppTopLevelObj = xDrawObj.get();
// #119010# connectors don't have to be area objects
- if( dynamic_cast< SdrEdgeObj* >( xSdrObj.get() ) )
+ if(xSdrObj->IsSdrEdgeObj())
xDrawObj->SetAreaObj( false );
/* Check for valid size for all objects. Needed to ignore lots of invisible
@@ -3452,7 +3497,7 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
#i30816# Include objects embedded in groups.
#i58780# Ignore group shapes, size is not initialized. */
bool bEmbeddedGroup = !bIsTopLevel && dynamic_cast< SdrObjGroup* >( xSdrObj.get() );
- if( !bEmbeddedGroup && !xDrawObj->IsValidSize( rAnchorRect ) )
+ if( !bEmbeddedGroup && !xDrawObj->IsValidSize( rAnchorRange ) )
return 0; // simply return, xSdrObj will be destroyed
// set shape information from DFF stream
@@ -3473,7 +3518,7 @@ SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffO
pTbxObj->SetDffProperties( *this );
// try to create a custom SdrObject that overwrites the passed object
- SdrObjectPtr xNewSdrObj( xDrawObj->CreateSdrObject( *this, rAnchorRect, true ) );
+ SdrObjectPtr xNewSdrObj( xDrawObj->CreateSdrObject( *this, rAnchorRange, true ) );
if( xNewSdrObj.is() )
xSdrObj.reset( xNewSdrObj.release() );
@@ -3662,7 +3707,7 @@ void XclImpDffConverter::ProcessSolverContainer( SvStream& rDffStrm, const DffRe
void XclImpDffConverter::ProcessShContainer( SvStream& rDffStrm, const DffRecordHeader& rShHeader )
{
rShHeader.SeekToBegOfRecord( rDffStrm );
- Rectangle aDummy;
+ basegfx::B2DRange aDummy;
const XclImpDrawObjBase* pDrawObj = 0;
/* The call to ImportObj() creates and returns a new SdrObject for the
processed shape. We take ownership of the returned object here. If the
@@ -3684,7 +3729,7 @@ void XclImpDffConverter::InsertSdrObject( SdrObjList& rObjList, const XclImpDraw
SdrObjectPtr xSdrObj( pSdrObj );
if( xSdrObj.is() && rDrawObj.IsInsertSdrObj() )
{
- rObjList.NbcInsertObject( xSdrObj.release() );
+ rObjList.InsertObjectToSdrObjList(*xSdrObj.release());
// callback to drawing manager for e.g. tracking of used sheet area
rConvData.mrDrawing.OnObjectInserted( rDrawObj );
// callback to drawing object for post processing (use pSdrObj, xSdrObj already released)
@@ -4042,9 +4087,9 @@ void XclImpSheetDrawing::ConvertObjects( XclImpDffConverter& rDffConv )
ImplConvertObjects( rDffConv, *pSdrModel, *pSdrPage );
}
-Rectangle XclImpSheetDrawing::CalcAnchorRect( const XclObjAnchor& rAnchor, bool /*bDffAnchor*/ ) const
+basegfx::B2DRange XclImpSheetDrawing::CalcAnchorRange( const XclObjAnchor& rAnchor, bool /*bDffAnchor*/ ) const
{
- return rAnchor.GetRect( GetRoot(), maScUsedArea.aStart.Tab(), MAP_100TH_MM );
+ return rAnchor.GetRangeFromAnchor( GetRoot(), maScUsedArea.aStart.Tab(), MAP_100TH_MM );
}
void XclImpSheetDrawing::OnObjectInserted( const XclImpDrawObjBase& rDrawObj )
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index d2689ddc3011..10ad0ef3bcd2 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -1300,20 +1300,20 @@ XclChRootData::~XclChRootData()
{
}
-void XclChRootData::InitConversion( const XclRoot& rRoot, const Reference< XChartDocument >& rxChartDoc, const Rectangle& rChartRect )
+void XclChRootData::InitConversion( const XclRoot& rRoot, const Reference< XChartDocument >& rxChartDoc, const basegfx::B2DRange& rChartRange )
{
// remember chart document reference and chart shape position/size
DBG_ASSERT( rxChartDoc.is(), "XclChRootData::InitConversion - missing chart document" );
mxChartDoc = rxChartDoc;
- maChartRect = rChartRect;
+ maChartRange = rChartRange;
// Excel excludes a border of 5 pixels in each direction from chart area
mnBorderGapX = rRoot.GetHmmFromPixelX( 5.0 );
mnBorderGapY = rRoot.GetHmmFromPixelY( 5.0 );
// size of a chart unit in 1/100 mm
- mfUnitSizeX = ::std::max< double >( maChartRect.GetWidth() - 2 * mnBorderGapX, mnBorderGapX ) / EXC_CHART_TOTALUNITS;
- mfUnitSizeY = ::std::max< double >( maChartRect.GetHeight() - 2 * mnBorderGapY, mnBorderGapY ) / EXC_CHART_TOTALUNITS;
+ mfUnitSizeX = ::std::max< double >( maChartRange.getWidth() - 2 * mnBorderGapX, mnBorderGapX ) / EXC_CHART_TOTALUNITS;
+ mfUnitSizeY = ::std::max< double >( maChartRange.getHeight() - 2 * mnBorderGapY, mnBorderGapY ) / EXC_CHART_TOTALUNITS;
// create object tables
Reference< XMultiServiceFactory > xFactory( mxChartDoc, UNO_QUERY );
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx
index e9ee6e778c72..2e148145e7d3 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -107,11 +107,15 @@ long lclGetYFromRow( ScDocument& rDoc, SCTAB nScTab, sal_uInt16 nXclRow, sal_uIn
/** Calculates an object column position from a drawing layer X position (in twips). */
void lclGetColFromX(
ScDocument& rDoc, SCTAB nScTab, sal_uInt16& rnXclCol,
- sal_uInt16& rnOffset, sal_uInt16 nXclStartCol, sal_uInt16 nXclMaxCol,
- long& rnStartW, long nX, double fScale )
+ sal_uInt16& rnOffset,
+ sal_uInt16 nXclStartCol,
+ sal_uInt16 nXclMaxCol,
+ long& rnStartW,
+ double fX,
+ double fScale )
{
// rnStartW in conjunction with nXclStartCol is used as buffer for previously calculated width
- long nTwipsX = static_cast< long >( nX / fScale + 0.5 );
+ long nTwipsX = static_cast< long >( fX / fScale + 0.5 );
long nColW = 0;
for( rnXclCol = nXclStartCol; rnXclCol <= nXclMaxCol; ++rnXclCol )
{
@@ -125,12 +129,18 @@ void lclGetColFromX(
/** Calculates an object row position from a drawing layer Y position (in twips). */
void lclGetRowFromY(
- ScDocument& rDoc, SCTAB nScTab, sal_uInt16& rnXclRow,
- sal_uInt16& rnOffset, sal_uInt16 nXclStartRow, sal_uInt16 nXclMaxRow,
- long& rnStartH, long nY, double fScale )
+ ScDocument& rDoc,
+ SCTAB nScTab,
+ sal_uInt16& rnXclRow,
+ sal_uInt16& rnOffset,
+ sal_uInt16 nXclStartRow,
+ sal_uInt16 nXclMaxRow,
+ long& rnStartH,
+ double fY,
+ double fScale )
{
// rnStartH in conjunction with nXclStartRow is used as buffer for previously calculated height
- long nTwipsY = static_cast< long >( nY / fScale + 0.5 );
+ long nTwipsY = static_cast< long >( fY / fScale + 0.5 );
long nRowH = 0;
bool bFound = false;
for( SCROW nRow = static_cast< SCROW >( nXclStartRow ); nRow <= nXclMaxRow; ++nRow )
@@ -150,16 +160,16 @@ void lclGetRowFromY(
}
/** Mirrors a rectangle (from LTR to RTL layout or vice versa). */
-void lclMirrorRectangle( Rectangle& rRect )
+void lclMirrorRange( basegfx::B2DRange& rRange )
{
- long nLeft = rRect.Left();
- rRect.Left() = -rRect.Right();
- rRect.Right() = -nLeft;
+ rRange = basegfx::B2DRange(
+ -rRange.getMaxX(), rRange.getMinY(),
+ -rRange.getMinX(), rRange.getMaxY());
}
-sal_uInt16 lclGetEmbeddedScale( long nPageSize, sal_Int32 nPageScale, long nPos, double fPosScale )
+sal_uInt16 lclGetEmbeddedScale( double fPageSize, double fPageScale, double fPos, double fPosScale )
{
- return static_cast< sal_uInt16 >( nPos * fPosScale / nPageSize * nPageScale + 0.5 );
+ return static_cast< sal_uInt16 >( fPos * fPosScale / fPageSize * fPageScale + 0.5 );
}
} // namespace
@@ -174,11 +184,11 @@ XclObjAnchor::XclObjAnchor() :
{
}
-Rectangle XclObjAnchor::GetRect( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMapUnit ) const
+basegfx::B2DRange XclObjAnchor::GetRangeFromAnchor( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMapUnit ) const
{
ScDocument& rDoc = rRoot.GetDoc();
- double fScale = lclGetTwipsScale( eMapUnit );
- Rectangle aRect(
+ const double fScale(lclGetTwipsScale(eMapUnit));
+ basegfx::B2DRange aRange(
lclGetXFromCol( rDoc, nScTab, maFirst.mnCol, mnLX, fScale ),
lclGetYFromRow( rDoc, nScTab, maFirst.mnRow, mnTY, fScale ),
lclGetXFromCol( rDoc, nScTab, maLast.mnCol, mnRX + 1, fScale ),
@@ -186,48 +196,64 @@ Rectangle XclObjAnchor::GetRect( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMa
// #106948# adjust coordinates in mirrored sheets
if( rDoc.IsLayoutRTL( nScTab ) )
- lclMirrorRectangle( aRect );
- return aRect;
+ {
+ lclMirrorRange( aRange );
+ }
+
+ return aRange;
}
-void XclObjAnchor::SetRect( const XclRoot& rRoot, SCTAB nScTab, const Rectangle& rRect, MapUnit eMapUnit )
+void XclObjAnchor::SetRangeAtAnchor(
+ const XclRoot& rRoot,
+ SCTAB nScTab,
+ const basegfx::B2DRange& rObjectRange,
+ MapUnit eMapUnit )
{
+ basegfx::B2DRange aObjectRange(rObjectRange);
ScDocument& rDoc = rRoot.GetDoc();
sal_uInt16 nXclMaxCol = rRoot.GetXclMaxPos().Col();
sal_uInt16 nXclMaxRow = static_cast<sal_uInt16>( rRoot.GetXclMaxPos().Row());
// #106948# adjust coordinates in mirrored sheets
- Rectangle aRect( rRect );
if( rDoc.IsLayoutRTL( nScTab ) )
- lclMirrorRectangle( aRect );
+ {
+ aObjectRange = basegfx::B2DRange(
+ -aObjectRange.getMinX(), aObjectRange.getMinY(),
+ -aObjectRange.getMaxX(), aObjectRange.getMaxY());
+ }
- double fScale = lclGetTwipsScale( eMapUnit );
+ const double fScale(lclGetTwipsScale( eMapUnit ));
long nDummy = 0;
- lclGetColFromX( rDoc, nScTab, maFirst.mnCol, mnLX, 0, nXclMaxCol, nDummy, aRect.Left(), fScale );
- lclGetColFromX( rDoc, nScTab, maLast.mnCol, mnRX, maFirst.mnCol, nXclMaxCol, nDummy, aRect.Right(), fScale );
+ lclGetColFromX( rDoc, nScTab, maFirst.mnCol, mnLX, 0, nXclMaxCol, nDummy, aObjectRange.getMinX(), fScale );
+ lclGetColFromX( rDoc, nScTab, maLast.mnCol, mnRX, maFirst.mnCol, nXclMaxCol, nDummy, aObjectRange.getMaxX(), fScale );
nDummy = 0;
- lclGetRowFromY( rDoc, nScTab, maFirst.mnRow, mnTY, 0, nXclMaxRow, nDummy, aRect.Top(), fScale );
- lclGetRowFromY( rDoc, nScTab, maLast.mnRow, mnBY, maFirst.mnRow, nXclMaxRow, nDummy, aRect.Bottom(), fScale );
+ lclGetRowFromY( rDoc, nScTab, maFirst.mnRow, mnTY, 0, nXclMaxRow, nDummy, aObjectRange.getMinY(), fScale );
+ lclGetRowFromY( rDoc, nScTab, maLast.mnRow, mnBY, maFirst.mnRow, nXclMaxRow, nDummy, aObjectRange.getMaxY(), fScale );
}
-void XclObjAnchor::SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY,
- const Rectangle& rRect, MapUnit eMapUnit, bool bDffAnchor )
+void XclObjAnchor::SetRangeAtAnchor(
+ const basegfx::B2DVector& rPageScale,
+ double fScaleX,
+ double fScaleY,
+ const basegfx::B2DRange& rObjectRange,
+ MapUnit eMapUnit,
+ bool bDffAnchor )
{
double fScale = 1.0;
switch( eMapUnit )
{
case MAP_TWIP: fScale = HMM_PER_TWIPS; break; // Calc twips -> 1/100mm
case MAP_100TH_MM: fScale = 1.0; break; // Calc 1/100mm -> 1/100mm
- default: DBG_ERRORFILE( "XclObjAnchor::SetRect - map unit not implemented" );
+ default: DBG_ERRORFILE( "XclObjAnchor::SetRangeAtAnchor - map unit not implemented" );
}
/* In objects with DFF client anchor, the position of the shape is stored
in the cell address components of the client anchor. In old BIFF3-BIFF5
objects, the position is stored in the offset components of the anchor. */
- (bDffAnchor ? maFirst.mnCol : mnLX) = lclGetEmbeddedScale( rPageSize.Width(), nScaleX, rRect.Left(), fScale );
- (bDffAnchor ? maFirst.mnRow : mnTY) = lclGetEmbeddedScale( rPageSize.Height(), nScaleY, rRect.Top(), fScale );
- (bDffAnchor ? maLast.mnCol : mnRX) = lclGetEmbeddedScale( rPageSize.Width(), nScaleX, rRect.Right(), fScale );
- (bDffAnchor ? maLast.mnRow : mnBY) = lclGetEmbeddedScale( rPageSize.Height(), nScaleY, rRect.Bottom(), fScale );
+ (bDffAnchor ? maFirst.mnCol : mnLX) = lclGetEmbeddedScale( rPageScale.getX(), fScaleX, rObjectRange.getMinX(), fScale );
+ (bDffAnchor ? maFirst.mnRow : mnTY) = lclGetEmbeddedScale( rPageScale.getY(), fScaleY, rObjectRange.getMinY(), fScale );
+ (bDffAnchor ? maLast.mnCol : mnRX) = lclGetEmbeddedScale( rPageScale.getX(), fScaleX, rObjectRange.getMaxX(), fScale );
+ (bDffAnchor ? maLast.mnRow : mnBY) = lclGetEmbeddedScale( rPageScale.getY(), fScaleY, rObjectRange.getMaxY(), fScale );
// for safety, clear the other members
if( bDffAnchor )
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 0e7d1f0e66e3..f60b365f556e 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -140,12 +140,12 @@ uno::Sequence< beans::NamedValue > ScfApiHelper::QueryEncryptionDataForMedium( S
::comphelper::IDocPasswordVerifier& rVerifier, const ::std::vector< OUString >* pDefaultPasswords )
{
uno::Sequence< beans::NamedValue > aEncryptionData;
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if ( pEncryptionDataItem )
pEncryptionDataItem->GetValue() >>= aEncryptionData;
::rtl::OUString aPassword;
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD );
if ( pPasswordItem )
aPassword = pPasswordItem->GetValue();
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index bcd2f96abb4d..8a57ef4bb04d 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1197,10 +1197,11 @@ sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
if ( aSet.GetItemState( EE_FEATURE_FIELD, sal_False, &pItem ) == SFX_ITEM_ON )
{
const SvxFieldData* pField = ((const SvxFieldItem*)pItem)->GetField();
- if ( pField && pField->ISA(SvxURLField) )
+ const SvxURLField* pURLField = dynamic_cast< const SvxURLField* >(pField);
+
+ if ( pURLField )
{
bUrl = sal_True;
- const SvxURLField* pURLField = (const SvxURLField*)pField;
// String aFieldText = rEngine.GetText( aSel );
rStrm << '<' << OOO_STRING_SVTOOLS_HTML_anchor << ' ' << OOO_STRING_SVTOOLS_HTML_O_href << "=\"";
OUT_STR( pURLField->GetURL() );
diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx
index efff492e3176..28281c3b4765 100644
--- a/sc/source/filter/html/htmlexp2.cxx
+++ b/sc/source/filter/html/htmlexp2.cxx
@@ -41,6 +41,7 @@
#include <svtools/embedtransfer.hxx>
#include <svl/urihelper.hxx>
#include <tools/urlobj.hxx>
+#include <svx/svdlegacy.hxx>
#include "htmlexp.hxx"
#include "global.hxx"
@@ -90,7 +91,7 @@ void ScHTMLExport::FillGraphList( const SdrPage* pPage, SCTAB nTab,
SdrObject* pObject = aIter.Next();
while ( pObject )
{
- Rectangle aObjRect = pObject->GetCurrentBoundRect();
+ Rectangle aObjRect = sdr::legacy::GetBoundRect(*pObject);
if ( bAll || aRect.IsInside( aObjRect ) )
{
Size aSpace;
@@ -150,16 +151,19 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
case OBJ_GRAF:
{
const SdrGrafObj* pSGO = (SdrGrafObj*)pObject;
- const SdrGrafObjGeoData* pGeo = (SdrGrafObjGeoData*)pSGO->GetGeoData();
- sal_uInt16 nMirrorCase = (pGeo->aGeo.nDrehWink == 18000 ?
- ( pGeo->bMirrored ? 3 : 4 ) : ( pGeo->bMirrored ? 2 : 1 ));
- sal_Bool bHMirr = ( ( nMirrorCase == 2 ) || ( nMirrorCase == 4 ) );
- sal_Bool bVMirr = ( ( nMirrorCase == 3 ) || ( nMirrorCase == 4 ) );
+ const basegfx::B2DVector& rScale = pSGO->getSdrObjectScale();
sal_uLong nXOutFlags = 0;
- if ( bHMirr )
+
+ if(basegfx::fTools::less(rScale.getX(), 0.0))
+ {
nXOutFlags |= XOUTBMP_MIRROR_HORZ;
- if ( bVMirr )
+ }
+
+ if(basegfx::fTools::less(rScale.getY(), 0.0))
+ {
nXOutFlags |= XOUTBMP_MIRROR_VERT;
+ }
+
String aLinkName;
if ( pSGO->IsLinkedGraphic() )
aLinkName = pSGO->GetFileName();
@@ -180,8 +184,7 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
break;
default:
{
- Graphic aGraph( SdrExchangeView::GetObjGraphic(
- pDoc->GetDrawLayer(), pObject ) );
+ const Graphic aGraph(GetObjGraphic(*pObject));
String aLinkName;
WriteImage( aLinkName, aGraph, aOpt );
pE->bWritten = sal_True;
diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx
index e48cda6e807a..5b342e45e36b 100644
--- a/sc/source/filter/inc/filt_pch.hxx
+++ b/sc/source/filter/inc/filt_pch.hxx
@@ -53,7 +53,6 @@
#include <global.hxx>
#include <tools/stream.hxx>
#include <tools/errinf.hxx>
-#include <tools/rtti.hxx>
#include <tools/errcode.hxx>
#include <tools/ref.hxx>
#include <tools/link.hxx>
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index eb22d4d2405c..5c0d655338be 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -99,7 +99,7 @@ public:
virtual EscherExHostAppData* StartShape(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& rxShape,
- const Rectangle* pChildAnchor );
+ const basegfx::B2DRange* pObjectRange);
virtual void EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID );
virtual EscherExHostAppData* EnterAdditionalTextGroup();
@@ -111,11 +111,11 @@ public:
@descr Writes the form control data to the 'Ctls' stream. */
XclExpOcxControlObj* CreateOCXCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const Rectangle* pChildAnchor );
+ const basegfx::B2DRange* pObjectRange);
/** Creates a TBX form control OBJ record from the passed form control. */
XclExpTbxControlObj* CreateTBXCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const Rectangle* pChildAnchor );
+ const basegfx::B2DRange* pObjectRange);
private:
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 67edce4f9e42..720ea40fd4f8 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -83,7 +83,10 @@ protected:
See SetOwnEscher() for details. */
explicit XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher = false );
- void ImplWriteAnchor( const XclExpRoot& rRoot, const SdrObject* pSdrObj, const Rectangle* pChildAnchor );
+ void ImplWriteAnchor(
+ const XclExpRoot& rRoot,
+ const SdrObject* pSdrObj,
+ const basegfx::B2DRange* pObjectRange);
// overwritten for writing MSODRAWING record
virtual void WriteBody( XclExpStream& rStrm );
@@ -134,13 +137,13 @@ class XclObjComment : public XclObj
{
public:
XclObjComment( XclExpObjectManager& rObjMgr,
- const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible );
+ const basegfx::B2DRange& rObjectRange, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible );
virtual ~XclObjComment();
/** c'tor process for formatted text objects above .
@descr used to construct the MSODRAWING Escher object properties. */
void ProcessEscherObj( const XclExpRoot& rRoot,
- const Rectangle& rRect, SdrObject* pCaption, bool bVisible );
+ const basegfx::B2DRange& rObjectRange, SdrObject* pCaption, bool bVisible );
virtual void Save( XclExpStream& rStrm );
diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx
index a0893dc488ec..b8e8645def7f 100644
--- a/sc/source/filter/inc/xechart.hxx
+++ b/sc/source/filter/inc/xechart.hxx
@@ -102,7 +102,7 @@ public:
const XclChFormatInfo& GetFormatInfo( XclChObjectType eObjType ) const;
/** Starts the API chart document conversion. Must be called once before all API conversion. */
- void InitConversion( XChartDocRef xChartDoc, const Rectangle& rChartRect ) const;
+ void InitConversion( XChartDocRef xChartDoc, const basegfx::B2DRange& rChartRange ) const;
/** Finishes the API chart document conversion. Must be called once after all API conversion. */
void FinishConversion() const;
@@ -1211,7 +1211,7 @@ public:
public:
explicit XclExpChChart( const XclExpRoot& rRoot,
- XChartDocRef xChartDoc, const Rectangle& rChartRect );
+ XChartDocRef xChartDoc, const basegfx::B2DRange& rChartRange );
/** Creates, registers and returns a new data series object. */
XclExpChSeriesRef CreateSeries();
@@ -1253,7 +1253,7 @@ public:
explicit XclExpChartDrawing(
const XclExpRoot& rRoot,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
- const Size& rChartSize );
+ const basegfx::B2DVector& rChartScale );
virtual ~XclExpChartDrawing();
virtual void Save( XclExpStream& rStrm );
@@ -1273,7 +1273,7 @@ public:
public:
explicit XclExpChart( const XclExpRoot& rRoot,
- XModelRef xModel, const Rectangle& rChartRect );
+ XModelRef xModel, const basegfx::B2DRange& rChartRange );
};
// ============================================================================
diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx
index 20e01fdc36c3..1ebfcf72064b 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -52,11 +52,13 @@ public:
/** Called from SVX DFF converter.
@param rRect The object anchor rectangle to be exported (in twips). */
- virtual void WriteData( EscherEx& rEscherEx, const Rectangle& rRect );
+ virtual void WriteData(
+ EscherEx& rEscherEx,
+ const basegfx::B2DRange& rObjectRange);
private:
virtual void ImplSetFlags( const SdrObject& rSdrObj );
- virtual void ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
+ virtual void ImplCalcAnchorRange( const basegfx::B2DRange& rObjectRange, MapUnit eMapUnit );
protected: // for access in derived classes
XclObjAnchor maAnchor; /// The client anchor data.
@@ -73,7 +75,7 @@ public:
private:
virtual void ImplSetFlags( const SdrObject& rSdrObj );
- virtual void ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
+ virtual void ImplCalcAnchorRange( const basegfx::B2DRange& rObjectRange, MapUnit eMapUnit );
private:
SCTAB mnScTab; /// Calc sheet index.
@@ -86,16 +88,16 @@ class XclExpDffEmbeddedAnchor : public XclExpDffAnchorBase
{
public:
explicit XclExpDffEmbeddedAnchor( const XclExpRoot& rRoot,
- const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY );
+ const basegfx::B2DVector& rPageScale, double fScaleX, double fScaleY );
private:
virtual void ImplSetFlags( const SdrObject& rSdrObj );
- virtual void ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
+ virtual void ImplCalcAnchorRange( const basegfx::B2DRange& rObjectRange, MapUnit eMapUnit );
private:
- Size maPageSize;
- sal_Int32 mnScaleX;
- sal_Int32 mnScaleY;
+ basegfx::B2DVector maPageScale;
+ double mfScaleX;
+ double mfScaleY;
};
// ----------------------------------------------------------------------------
@@ -104,7 +106,7 @@ private:
class XclExpDffNoteAnchor : public XclExpDffAnchorBase
{
public:
- explicit XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect );
+ explicit XclExpDffNoteAnchor( const XclExpRoot& rRoot, const basegfx::B2DRange& rObjectRange );
};
// ----------------------------------------------------------------------------
@@ -215,7 +217,7 @@ public:
explicit XclExpOcxControlObj(
XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const Rectangle* pChildAnchor,
+ const basegfx::B2DRange* pObjectRange,
const String& rClassName,
sal_uInt32 nStrmStart, sal_uInt32 nStrmSize );
@@ -237,7 +239,7 @@ public:
explicit XclExpTbxControlObj(
XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const Rectangle* pChildAnchor );
+ const basegfx::B2DRange* pObjectRange);
/** Sets the name of a macro attached to this control.
@return true = The passed event descriptor was valid, macro name has been found. */
@@ -285,7 +287,7 @@ public:
explicit XclExpChartObj(
XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const Rectangle* pChildAnchor );
+ const basegfx::B2DRange* pObjectRange);
virtual ~XclExpChartObj();
/** Writes the OBJ record and the entire chart substream. */
@@ -413,17 +415,18 @@ class XclExpEmbeddedObjectManager : public XclExpObjectManager
public:
explicit XclExpEmbeddedObjectManager(
const XclExpObjectManager& rParent,
- const Size& rPageSize,
- sal_Int32 nScaleX, sal_Int32 nScaleY );
+ const basegfx::B2DVector& rPageScale,
+ double fScaleX,
+ double fScaleY );
/** Creates a new DFF client anchor object for embedded objects according
to the scaling data passed to the constructor. Caller takes ownership! */
virtual XclExpDffAnchorBase* CreateDffAnchor() const;
private:
- Size maPageSize;
- sal_Int32 mnScaleX;
- sal_Int32 mnScaleY;
+ basegfx::B2DVector maPageScale;
+ double mfScaleX;
+ double mfScaleY;
};
// ============================================================================
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 522dec93b7b2..76db9c3051a5 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -112,7 +112,7 @@ public:
Color GetSeriesFillAutoColor( sal_uInt16 nFormatIdx ) const;
/** Starts the API chart document conversion. Must be called once before all API conversion. */
- void InitConversion( XChartDocRef xChartDoc, const Rectangle& rChartRect ) const;
+ void InitConversion( XChartDocRef xChartDoc, const basegfx::B2DRange& rChartRange ) const;
/** Finishes the API chart document conversion. Must be called once after all API conversion. */
void FinishConversion( XclImpDffConverter& rDffConv ) const;
@@ -1400,7 +1400,7 @@ public:
void Convert( XChartDocRef xChartDoc,
XclImpDffConverter& rDffConv,
const ::rtl::OUString& rObjName,
- const Rectangle& rChartRect ) const;
+ const basegfx::B2DRange& rChartRange ) const;
private:
/** Reads a CHSERIES group (data series source and formatting). */
@@ -1455,15 +1455,15 @@ public:
void ConvertObjects(
XclImpDffConverter& rDffConv,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
- const Rectangle& rChartRect );
+ const basegfx::B2DRange& rChartRange );
/** Calculate the resulting rectangle of the passed anchor. */
- virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const;
+ virtual basegfx::B2DRange CalcAnchorRange( const XclObjAnchor& rAnchor, bool bDffAnchor ) const;
/** Called whenever an object has been inserted into the draw page. */
virtual void OnObjectInserted( const XclImpDrawObjBase& rDrawObj );
private:
- Rectangle maChartRect; /// Position and size of the chart shape in 1/100 mm.
+ basegfx::B2DRange maChartRange; /// Position and size of the chart shape in 1/100 mm.
SCTAB mnScTab; /// Index of the sheet that contains the chart.
bool mbOwnTab; /// True = own sheet, false = embedded object.
};
@@ -1497,7 +1497,7 @@ public:
void Convert( XModelRef xModel,
XclImpDffConverter& rDffConv,
const ::rtl::OUString& rObjName,
- const Rectangle& rChartRect ) const;
+ const basegfx::B2DRange& rChartRange ) const;
private:
/** Returns (initially creates) the drawing container for embedded shapes. **/
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 291174737ffd..ef29b3ad1d92 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -107,7 +107,7 @@ public:
/** Returns the object anchor if existing, null otherwise. */
const XclObjAnchor* GetAnchor() const;
/** Returns true, if the passed size is valid for this object. */
- bool IsValidSize( const Rectangle& rAnchorRect ) const;
+ bool IsValidSize( const basegfx::B2DRange& rAnchorRange ) const;
/** Returns the range in the sheet covered by this object. */
ScRange GetUsedArea( SCTAB nScTab ) const;
@@ -119,7 +119,7 @@ public:
/** Returns the needed size on the progress bar (calls virtual DoGetProgressSize() function). */
sal_Size GetProgressSize() const;
/** Creates and returns an SdrObject from the contained data. Caller takes ownership! */
- SdrObject* CreateSdrObject( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect, bool bIsDff ) const;
+ SdrObject* CreateSdrObject( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange, bool bIsDff ) const;
/** Additional processing for the passed SdrObject before insertion into
the drawing page (calls virtual DoPreProcessSdrObj() function). */
void PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
@@ -163,7 +163,7 @@ protected:
/** Derived classes may return a progress bar size different from 1. */
virtual sal_Size DoGetProgressSize() const;
/** Derived classes create and return a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
/** Derived classes may perform additional processing for the passed SdrObject before insertion. */
virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
/** Derived classes may perform additional processing for the passed SdrObject after insertion. */
@@ -244,7 +244,7 @@ protected:
/** Returns a progress bar size that takes all group children into account. */
virtual sal_Size DoGetProgressSize() const;
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
protected:
XclImpDrawObjVector maChildren; /// Grouped objects.
@@ -267,7 +267,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
protected:
XclObjLineData maLineData; /// BIFF5 line formatting.
@@ -297,7 +297,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
protected:
XclObjFillData maFillData; /// BIFF5 fill formatting.
@@ -315,7 +315,7 @@ public:
protected:
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
};
// ----------------------------------------------------------------------------
@@ -334,7 +334,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
protected:
XclObjFillData maFillData; /// BIFF5 fill formatting.
@@ -359,10 +359,10 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
protected:
- typedef ::std::vector< Point > PointVector;
+ typedef ::std::vector< basegfx::B2DPoint > PointVector;
PointVector maCoords; /// Coordinates relative to bounding rectangle.
sal_uInt16 mnPolyFlags; /// Additional flags.
sal_uInt16 mnPointCount; /// Polygon point count.
@@ -400,7 +400,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
/** Inserts the contained text data at the passed object. */
virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
@@ -432,7 +432,7 @@ protected:
/** Returns the needed size on the progress bar. */
virtual sal_Size DoGetProgressSize() const;
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
/** Converts the chart document. */
virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
@@ -484,7 +484,7 @@ public:
/** Returns the SdrObject from the passed control shape and sets the bounding rectangle. */
SdrObject* CreateSdrObjectFromShape(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
- const Rectangle& rAnchorRect ) const;
+ const basegfx::B2DRange& rAnchorRange ) const;
/** Sets additional properties to the form control model, calls virtual DoProcessControl(). */
void ProcessControl( const XclImpDrawObjBase& rDrawObj ) const;
@@ -537,7 +537,7 @@ protected:
void ConvertLabel( ScfPropertySet& rPropSet ) const;
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
/** Additional processing on the SdrObject, calls new virtual function DoProcessControl(). */
virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
@@ -862,7 +862,7 @@ public:
/** Returns the graphic imported from the IMGDATA record. */
inline const Graphic& GetGraphic() const { return maGraphic; }
/** Returns the visible area of the imported graphic. */
- inline const Rectangle& GetVisArea() const { return maVisArea; }
+ inline const basegfx::B2DRange& GetVisArea() const { return maVisArea; }
/** Returns true, if the OLE object will be shown as symbol. */
inline bool IsSymbol() const { return mbSymbol; }
@@ -886,7 +886,7 @@ protected:
/** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const basegfx::B2DRange& rAnchorRange ) const;
/** Overloaded to do additional processing on the SdrObject. */
virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
@@ -900,7 +900,7 @@ private:
private:
Graphic maGraphic; /// Picture or OLE placeholder graphic.
- Rectangle maVisArea; /// Size of graphic.
+ basegfx::B2DRange maVisArea; /// Size of graphic.
String maClassName; /// Class name of embedded OLE object.
sal_uInt32 mnStorageId; /// Identifier of the storage for this object.
sal_Size mnCtlsStrmPos; /// Position in 'Ctls' stream for this control.
@@ -969,7 +969,7 @@ public:
protected:
/** Returns a color from the Excel color palette. */
- virtual FASTBOOL GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const;
+ virtual bool GetColorFromPalette( sal_uInt16 nIndex, Color& rColor ) const;
};
// ----------------------------------------------------------------------------
@@ -1004,14 +1004,16 @@ public:
void FinalizeDrawing();
/** Creates the SdrObject for the passed Excel TBX form control object. */
- SdrObject* CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const Rectangle& rAnchorRect );
+ SdrObject* CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const basegfx::B2DRange& rAnchorRange );
/** Creates the SdrObject for the passed Excel OLE object or OCX form control object. */
- SdrObject* CreateSdrObject( const XclImpPictureObj& rPicObj, const Rectangle& rAnchorRect );
+ SdrObject* CreateSdrObject( const XclImpPictureObj& rPicObj, const basegfx::B2DRange& rAnchorRange );
/** Returns true, if the conversion of OLE objects is supported. */
bool SupportsOleObjects() const;
/** Returns the default text margin in drawing layer units. */
inline sal_Int32 GetDefaultTextMargin() const { return mnDefTextMargin; }
+ /** Access to DrawingLayer target model */
+ SdrModel& GetTargetSdrModel() const { return GetConvData().mrSdrModel; }
private:
// virtual functions of SvxMSDffManager
@@ -1027,7 +1029,7 @@ private:
SvStream& rDffStrm,
DffObjData& rDffObjData,
void* pClientData,
- Rectangle& rTextRect,
+ basegfx::B2DRange& rTextRect,
SdrObject* pOldSdrObj = 0 );
/** Returns the BLIP stream position, based on the passed DFF stream position. */
virtual sal_uLong Calc_nBLIPPos( sal_uLong nOrgVal, sal_uLong nStreamPos ) const;
@@ -1128,7 +1130,7 @@ public:
sal_Size GetProgressSize() const;
/** Derived classes calculate the resulting rectangle of the passed anchor. */
- virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const = 0;
+ virtual basegfx::B2DRange CalcAnchorRange( const XclObjAnchor& rAnchor, bool bDffAnchor ) const = 0;
/** Called whenever an object has been inserted into the draw page. */
virtual void OnObjectInserted( const XclImpDrawObjBase& rDrawObj ) = 0;
@@ -1186,7 +1188,7 @@ public:
void ConvertObjects( XclImpDffConverter& rDffConv );
/** Calculate the resulting rectangle of the passed anchor. */
- virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const;
+ virtual basegfx::B2DRange CalcAnchorRange( const XclObjAnchor& rAnchor, bool bDffAnchor ) const;
/** On call, updates the used area of the sheet. */
virtual void OnObjectInserted( const XclImpDrawObjBase& rDrawObj );
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index c0f272aca9b9..306826d9e374 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -32,6 +32,7 @@
#include <map>
#include <tools/gen.hxx>
#include "fapihelper.hxx"
+#include <basegfx/range/b2drange.hxx>
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
@@ -1479,7 +1480,7 @@ struct XclChRootData
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
mxChartDoc; /// The chart document.
- Rectangle maChartRect; /// Position and size of the chart shape.
+ basegfx::B2DRange maChartRange; /// Position and size of the chart shape.
XclChTypeProvRef mxTypeInfoProv; /// Provides info about chart types.
XclChFmtInfoProvRef mxFmtInfoProv; /// Provides info about auto formatting.
XclChObjectTableRef mxLineDashTable; /// Container for line dash styles.
@@ -1499,7 +1500,7 @@ struct XclChRootData
void InitConversion(
const XclRoot& rRoot,
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
- const Rectangle& rChartRect );
+ const basegfx::B2DRange& rChartRange );
/** Finishes the API chart document conversion. Must be called once before any API access. */
void FinishConversion();
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index 973c2b7be992..224cbbeb14e4 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -29,6 +29,7 @@
#include "fapihelper.hxx"
#include "xladdress.hxx"
#include "xlstyle.hxx"
+#include <basegfx/range/b2drange.hxx>
namespace com { namespace sun { namespace star {
namespace drawing { class XShape; }
@@ -317,13 +318,13 @@ struct XclObjAnchor : public XclRange
explicit XclObjAnchor();
/** Calculates a rectangle from the contained coordinates. */
- Rectangle GetRect( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMapUnit ) const;
+ basegfx::B2DRange GetRangeFromAnchor( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMapUnit ) const;
/** Initializes the anchor coordinates for a sheet. */
- void SetRect( const XclRoot& rRoot, SCTAB nScTab, const Rectangle& rRect, MapUnit eMapUnit );
+ void SetRangeAtAnchor( const XclRoot& rRoot, SCTAB nScTab, const basegfx::B2DRange& rObjectRange, MapUnit eMapUnit );
/** Initializes the anchor coordinates for an embedded draw page. */
- void SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY,
- const Rectangle& rRect, MapUnit eMapUnit, bool bDffAnchor );
+ void SetRangeAtAnchor( const basegfx::B2DVector& rPageScale, double fScaleX, double fScaleY,
+ const basegfx::B2DRange& rObjectRange, MapUnit eMapUnit, bool bDffAnchor );
};
template< typename StreamType >
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index b60e7715ebf5..270c77e9adff 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -48,6 +48,7 @@
#include <vcl/svapp.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/charclass.hxx>
+#include <svx/svdlegacy.hxx>
#include "eeimport.hxx"
#include "global.hxx"
@@ -66,7 +67,7 @@
#include "globstr.hrc"
// in fuins1.cxx
-extern void ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage );
+extern void ScLimitSizeOnDrawPage(basegfx::B2DVector& rSize, basegfx::B2DPoint& rPos, const basegfx::B2DVector& rPageScale);
//------------------------------------------------------------------------
@@ -534,52 +535,49 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
SdrPage* pPage = pModel->GetPage( static_cast<sal_uInt16>(nTab) );
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
- Point aCellInsertPos(
- (long)((double) mpDoc->GetColOffset( nCol, nTab ) * HMM_PER_TWIPS),
- (long)((double) mpDoc->GetRowOffset( nRow, nTab ) * HMM_PER_TWIPS) );
+ const basegfx::B2DPoint aCellInsertPos(
+ (double)mpDoc->GetColOffset( nCol, nTab ) * HMM_PER_TWIPS,
+ (double)mpDoc->GetRowOffset( nRow, nTab ) * HMM_PER_TWIPS);
- Point aInsertPos( aCellInsertPos );
- Point aSpace;
- Size aLogicSize;
+ basegfx::B2DPoint aInsertPos(aCellInsertPos);
sal_Char nDir = nHorizontal;
+
for ( ScHTMLImage* pI = pIL->First(); pI; pI = pIL->Next() )
{
if ( nDir & nHorizontal )
{ // horizontal
- aInsertPos.X() += aLogicSize.Width();
- aInsertPos.X() += aSpace.X();
- aInsertPos.Y() = aCellInsertPos.Y();
+ aInsertPos.setX(aInsertPos.getX());
+ aInsertPos.setY(aCellInsertPos.getY());
}
else
{ // vertikal
- aInsertPos.X() = aCellInsertPos.X();
- aInsertPos.Y() += aLogicSize.Height();
- aInsertPos.Y() += aSpace.Y();
+ aInsertPos.setX(aCellInsertPos.getX());
+ aInsertPos.setY(aInsertPos.getY());
}
+
// Offset des Spacings drauf
- aSpace = pDefaultDev->PixelToLogic( pI->aSpace, MapMode( MAP_100TH_MM ) );
- aInsertPos += aSpace;
+ const basegfx::B2DHomMatrix aDiscreteToLogic100thmm(pDefaultDev->GetInverseViewTransformation(MapMode(MAP_100TH_MM)));
+ aInsertPos += aDiscreteToLogic100thmm * basegfx::B2DPoint(pI->aSpace.X(), pI->aSpace.Y());
+ basegfx::B2DVector aLogicSize(aDiscreteToLogic100thmm * basegfx::B2DVector(pI->aSize.Width(), pI->aSize.Height()));
- Size aSizePix = pI->aSize;
- aLogicSize = pDefaultDev->PixelToLogic( aSizePix, MapMode( MAP_100TH_MM ) );
// Groesse begrenzen
- ::ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, pPage->GetSize() );
+ ::ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, pPage->GetPageScale() );
if ( pI->pGraphic )
{
- Rectangle aRect ( aInsertPos, aLogicSize );
- SdrGrafObj* pObj = new SdrGrafObj( *pI->pGraphic, aRect );
+ SdrGrafObj* pObj = new SdrGrafObj(
+ *pModel,
+ *pI->pGraphic,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aLogicSize, aInsertPos));
+
// #118522# calling SetGraphicLink here doesn't work
pObj->SetName( pI->aURL );
-
- pPage->InsertObject( pObj );
+ pPage->InsertObjectToSdrObjList(*pObj);
// #118522# SetGraphicLink has to be used after inserting the object,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
// See #i37444#.
pObj->SetGraphicLink( pI->aURL, pI->aFilterName );
-
- pObj->SetLogicRect( aRect ); // erst nach InsertObject !!!
}
nDir = pI->nDir;
}
diff --git a/sc/source/filter/starcalc/scfobj.cxx b/sc/source/filter/starcalc/scfobj.cxx
index c9797060daa3..0319b6d43774 100644
--- a/sc/source/filter/starcalc/scfobj.cxx
+++ b/sc/source/filter/starcalc/scfobj.cxx
@@ -41,9 +41,9 @@ using namespace com::sun::star;
#include <sot/storage.hxx>
#include <sfx2/app.hxx>
#include <sot/clsids.hxx>
-#include <svx/charthelper.hxx>
-#include "address.hxx"
+#include <svx/svdlegacy.hxx>
+#include "address.hxx"
#include "scfobj.hxx"
#include "document.hxx"
#include "drwlayer.hxx"
@@ -67,8 +67,6 @@ void Sc10InsertObject::InsertChart( ScDocument* pDoc, SCTAB nDestTab, const Rect
GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID ).GetByteSequence(), aName );
if ( xObj.is() )
{
- SdrOle2Obj* pSdrOle2Obj = new SdrOle2Obj( ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), aName, rRect );
-
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (!pModel)
{
@@ -77,20 +75,23 @@ void Sc10InsertObject::InsertChart( ScDocument* pDoc, SCTAB nDestTab, const Rect
DBG_ASSERT(pModel,"Draw Layer ?");
}
+ SdrOle2Obj* pSdrOle2Obj = new SdrOle2Obj(
+ *pModel,
+ ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ),
+ aName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRect.getWidth(), rRect.getHeight(),
+ rRect.Left(), rRect.Top()));
+
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nDestTab));
DBG_ASSERT(pPage,"Page ?");
- pPage->InsertObject(pSdrOle2Obj);
+ pPage->InsertObjectToSdrObjList(*pSdrOle2Obj);
- pSdrOle2Obj->SetLogicRect(rRect); // erst nach InsertObject !!!
awt::Size aSz;
aSz.Width = rRect.GetSize().Width();
aSz.Height = rRect.GetSize().Height();
xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, aSz );
- // #121334# This call will change the chart's default background fill from white to transparent.
- // Add here again if this is wanted (see task description for details)
- // ChartHelper::AdaptDefaultsForChart( xObj );
-
// hier kann das Chart noch nicht mit Daten gefuettert werden,
// weil die Formeln noch nicht berechnet sind.
// Deshalb in die ChartCollection, die Daten werden dann im
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index e35f369f23f0..e645221c39f1 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -196,7 +196,9 @@ bool lcl_IsFontwork( const SdrObject* pObj )
} // namespace
-EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape, const Rectangle* pChildAnchor )
+EscherExHostAppData* XclEscherEx::StartShape(
+ const Reference< XShape >& rxShape,
+ const basegfx::B2DRange* pObjectRange)
{
if ( nAdditionalText )
nAdditionalText++;
@@ -234,7 +236,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
SvGlobalName aObjClsId( xObj->getClassID() );
if ( SotExchange::IsChart( aObjClsId ) )
{ // yes, it's a chart diagram
- mrObjMgr.AddObj( new XclExpChartObj( mrObjMgr, rxShape, pChildAnchor ) );
+ mrObjMgr.AddObj( new XclExpChartObj( mrObjMgr, rxShape, pObjectRange) );
pCurrXclObj = NULL; // no metafile or whatsoever
}
else // metafile and OLE object
@@ -260,13 +262,13 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
aAny >>= nMsCtlType;
if( nMsCtlType == 2 ) //OCX Form Control
- pCurrXclObj = CreateOCXCtrlObj( rxShape, pChildAnchor );
+ pCurrXclObj = CreateOCXCtrlObj( rxShape, pObjectRange );
else //TBX Form Control
- pCurrXclObj = CreateTBXCtrlObj( rxShape, pChildAnchor );
+ pCurrXclObj = CreateTBXCtrlObj( rxShape, pObjectRange );
if( !pCurrXclObj )
pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile
}
- else if( !ScDrawLayer::IsNoteCaption( pObj ) )
+ else if( !ScDrawLayer::IsNoteCaption( *pObj ) )
{
// #107540# ignore permanent note shapes
// #i12190# do not ignore callouts (do not filter by object type ID)
@@ -290,12 +292,12 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape
{
/* Create a dummy anchor carrying the flags. Real
coordinates are calculated later in virtual call of
- WriteData(EscherEx&,const Rectangle&). */
+ WriteData(EscherEx&,const basegfx::B2DPoint&,const basegfx::B2DVector&). */
XclExpDffAnchorBase* pAnchor = mrObjMgr.CreateDffAnchor();
pAnchor->SetFlags( *pObj );
pCurrAppData->SetClientAnchor( pAnchor );
}
- const SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, pObj );
+ const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >( pObj );
if( pTextObj && !lcl_IsFontwork( pTextObj ) && (pObj->GetObjIdentifier() != OBJ_CAPTION) )
{
const OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
@@ -408,7 +410,9 @@ void XclEscherEx::EndDocument()
//delete for exporting OCX
//#if EXC_EXP_OCX_CTRL
-XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
+XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj(
+ Reference< XShape > xShape,
+ const basegfx::B2DRange* pObjectRange)
{
::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl;
@@ -429,7 +433,7 @@ XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape,
sal_uInt32 nStrmSize = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() - nStrmStart );
// adjust the class name to "Forms.***.1"
aClassName.InsertAscii( "Forms.", 0 ).AppendAscii( ".1" );
- xOcxCtrl.reset( new XclExpOcxControlObj( mrObjMgr, xShape, pChildAnchor, aClassName, nStrmStart, nStrmSize ) );
+ xOcxCtrl.reset( new XclExpOcxControlObj( mrObjMgr, xShape, pObjectRange, aClassName, nStrmStart, nStrmSize ) );
}
}
}
@@ -438,9 +442,11 @@ XclExpOcxControlObj* XclEscherEx::CreateOCXCtrlObj( Reference< XShape > xShape,
//#else
-XclExpTbxControlObj* XclEscherEx::CreateTBXCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
+XclExpTbxControlObj* XclEscherEx::CreateTBXCtrlObj(
+ Reference< XShape > xShape,
+ const basegfx::B2DRange* pObjectRange)
{
- ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) );
+ ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pObjectRange) );
if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN )
xTbxCtrl.reset();
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 10273eec8a86..27fcc2e4df36 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -40,6 +40,7 @@
#include <svl/zformat.hxx>
#include "cell.hxx"
#include "drwlayer.hxx"
+#include <svx/svdlegacy.hxx>
#include "xcl97rec.hxx"
#include "xcl97esc.hxx"
@@ -93,8 +94,7 @@ XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx )
pMsodrawingPerSheet = new XclExpMsoDrawing( rEscherEx );
// open the DGCONTAINER and the patriarch group shape
mrEscherEx.OpenContainer( ESCHER_DgContainer );
- Rectangle aRect( 0, 0, 0, 0 );
- mrEscherEx.EnterGroup( &aRect );
+ mrEscherEx.EnterGroup();
mrEscherEx.UpdateDffFragmentEnd();
}
@@ -173,11 +173,14 @@ XclObj::~XclObj()
delete pTxo;
}
-void XclObj::ImplWriteAnchor( const XclExpRoot& /*rRoot*/, const SdrObject* pSdrObj, const Rectangle* pChildAnchor )
+void XclObj::ImplWriteAnchor(
+ const XclExpRoot& /*rRoot*/,
+ const SdrObject* pSdrObj,
+ const basegfx::B2DRange* pObjectRange)
{
- if( pChildAnchor )
+ if( pObjectRange )
{
- mrEscherEx.AddChildAnchor( *pChildAnchor );
+ mrEscherEx.AddChildAnchor( *pObjectRange );
}
else if( pSdrObj )
{
@@ -284,15 +287,15 @@ void XclObj::SaveTextRecs( XclExpStream& rStrm )
// --- class XclObjComment -------------------------------------------
-XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ) :
+XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const basegfx::B2DRange& rObjectRange, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ) :
XclObj( rObjMgr, EXC_OBJTYPE_NOTE, true )
{
- ProcessEscherObj( rObjMgr.GetRoot(), rRect, pCaption, bVisible);
+ ProcessEscherObj( rObjMgr.GetRoot(), rObjectRange, pCaption, bVisible);
// TXO
pTxo = new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption );
}
-void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle& rRect, SdrObject* pCaption, const bool bVisible )
+void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const basegfx::B2DRange& rObjectRange, SdrObject* pCaption, const bool bVisible )
{
Reference<XShape> aXShape;
EscherPropertyContainer aPropOpt;
@@ -306,7 +309,7 @@ void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle&
aPropOpt.CreateFillProperties( aXPropSet, sal_True);
aPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // undocumented
- aPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented
+ aPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented
sal_uInt32 nValue = 0;
if(!aPropOpt.GetOpt( ESCHER_Prop_FitTextToShape, nValue ))
@@ -347,7 +350,7 @@ void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle&
aPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
aPropOpt.Commit( mrEscherEx.GetStream() );
- XclExpDffNoteAnchor( rRoot, rRect ).WriteDffData( mrEscherEx );
+ XclExpDffNoteAnchor( rRoot, rObjectRange ).WriteDffData( mrEscherEx );
mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
mrEscherEx.UpdateDffFragmentEnd();
@@ -483,7 +486,7 @@ XclTxo::XclTxo( const XclExpRoot& rRoot, const SdrTextObj& rTextObj ) :
SetVerAlign( lcl_GetVerAlignFromItemSet( rItemSet ) );
// rotation
- long nAngle = rTextObj.GetRotateAngle();
+ const long nAngle(sdr::legacy::GetRotateAngle(rTextObj));
if( (4500 < nAngle) && (nAngle < 13500) )
mnRotation = EXC_OBJ_ORIENT_90CCW;
else if( (22500 < nAngle) && (nAngle < 31500) )
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index 74d309de2fa2..3dac18c83665 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -41,8 +41,6 @@ using namespace ::com::sun::star::beans;
using namespace xmloff::token;
-TYPEINIT1( XMLTableHeaderFooterContext, SvXMLImportContext );
-
XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference<
@@ -205,8 +203,6 @@ void XMLTableHeaderFooterContext::EndElement()
}
}
-TYPEINIT1( XMLHeaderFooterRegionContext, SvXMLImportContext );
-
XMLHeaderFooterRegionContext::XMLHeaderFooterRegionContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference<
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
index 8fe7f3592c06..632fc2ead97b 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx
@@ -59,8 +59,6 @@ class XMLTableHeaderFooterContext: public SvXMLImportContext
sal_Bool bContainsCenter;
public:
- TYPEINFO();
-
XMLTableHeaderFooterContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -88,8 +86,6 @@ private:
::com::sun::star::text::XTextCursor > xOldTextCursor;
public:
- TYPEINFO();
-
XMLHeaderFooterRegionContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 010b5e1f5e22..f726db4ef475 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -64,6 +64,7 @@
#include <editeng/editobj.hxx>
#include <svx/unoapi.hxx>
#include <svl/languageoptions.hxx>
+#include <svx/svdlegacy.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/text/XText.hpp>
@@ -621,7 +622,7 @@ void ScXMLTableRowCellContext::SetAnnotation(const table::CellAddress& aCellAddr
{
if( SdrCaptionObj* pCaption = dynamic_cast< SdrCaptionObj* >( pObject ) )
{
- OSL_ENSURE( !pCaption->GetLogicRect().IsEmpty(), "ScXMLTableRowCellContext::SetAnnotation - invalid caption rectangle" );
+ OSL_ENSURE( !sdr::legacy::GetLogicRect(*pCaption).IsEmpty(), "ScXMLTableRowCellContext::SetAnnotation - invalid caption rectangle" );
// create the cell note with the caption object
pNote = ScNoteUtil::CreateNoteFromCaption( *pDoc, aPos, *pCaption, true );
// forget pointer to object (do not create note again below)
@@ -637,9 +638,9 @@ void ScXMLTableRowCellContext::SetAnnotation(const table::CellAddress& aCellAddr
::std::auto_ptr< OutlinerParaObject > xOutlinerObj;
if( OutlinerParaObject* pOutlinerObj = pObject->GetOutlinerParaObject() )
xOutlinerObj.reset( new OutlinerParaObject( *pOutlinerObj ) );
- Rectangle aCaptionRect;
+ basegfx::B2DRange aCaptionRange;
if( mxAnnotationData->mbUseShapePos )
- aCaptionRect = pObject->GetLogicRect();
+ aCaptionRange = sdr::legacy::GetLogicRange(*pObject);
// remove the shape from the drawing page, this invalidates pObject
mxAnnotationData->mxShapes->remove( mxAnnotationData->mxShape );
pObject = 0;
@@ -651,9 +652,14 @@ void ScXMLTableRowCellContext::SetAnnotation(const table::CellAddress& aCellAddr
if( xOutlinerObj.get() )
{
// create cell note with all data from drawing object
- pNote = ScNoteUtil::CreateNoteFromObjectData( *pDoc, aPos,
- xItemSet.release(), xOutlinerObj.release(),
- aCaptionRect, mxAnnotationData->mbShown, false );
+ pNote = ScNoteUtil::CreateNoteFromObjectData(
+ *pDoc,
+ aPos,
+ xItemSet.release(),
+ xOutlinerObj.release(),
+ aCaptionRange,
+ mxAnnotationData->mbShown,
+ false );
}
}
}
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 26d1c3fb0b5b..16a48fddc632 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2673,7 +2673,7 @@ void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > xShape
if( SdrObject* pObject = pShapeImp->GetSdrObject() )
{
// collect note caption objects from all layers (internal or hidden)
- if( ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObject, static_cast< SCTAB >( nCurrentTable ) ) )
+ if( ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( *pObject, static_cast< SCTAB >( nCurrentTable ) ) )
{
pSharedData->AddNoteObj( xShape, pCaptData->maStart );
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index b6a86ff9e44e..609ecc5aa849 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -457,8 +457,6 @@ struct ScXMLMapContent
rtl::OUString sBaseCell;
};
-TYPEINIT1( XMLTableStyleContext, XMLPropStyleContext );
-
XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const uno::Reference< XAttributeList > & xAttrList,
@@ -902,7 +900,6 @@ sal_Int32 XMLTableStylesContext::GetIndex(const sal_Int16 nContextID)
}
// ---------------------------------------------------------------------------
-TYPEINIT1( ScXMLMasterStylesContext, SvXMLStylesContext );
sal_Bool ScXMLMasterStylesContext::InsertStyleFamily( sal_uInt16 ) const
{
@@ -954,8 +951,6 @@ void ScXMLMasterStylesContext::EndElement()
FinishStyles(sal_True);
}
-TYPEINIT1( ScMasterPageContext, XMLTextMasterPageContext );
-
ScMasterPageContext::ScMasterPageContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const uno::Reference< XAttributeList > & xAttrList,
diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx
index dd6a670f3eea..aa8e16fa7ae9 100644
--- a/sc/source/filter/xml/xmlstyli.hxx
+++ b/sc/source/filter/xml/xmlstyli.hxx
@@ -132,8 +132,6 @@ protected:
public:
- TYPEINFO();
-
XMLTableStyleContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
@@ -249,8 +247,6 @@ protected:
virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const;
public:
- TYPEINFO();
-
ScXMLMasterStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -274,8 +270,6 @@ class ScMasterPageContext : public XMLTextMasterPageContext
void ClearContent(const rtl::OUString& rContent);
public:
- TYPEINFO();
-
ScMasterPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/sc/source/ui/Accessibility/AccessibilityHints.cxx b/sc/source/ui/Accessibility/AccessibilityHints.cxx
index 530aecdd4d14..2ef9b50ceb8b 100644
--- a/sc/source/ui/Accessibility/AccessibilityHints.cxx
+++ b/sc/source/ui/Accessibility/AccessibilityHints.cxx
@@ -31,10 +31,6 @@
using namespace ::com::sun::star;
// -----------------------------------------------------------------------
-
-TYPEINIT1(ScAccWinFocusLostHint, SfxHint);
-
-// -----------------------------------------------------------------------
// ScAccWinFocusLostHint - the current window lost its focus (to another application, view or document)
// -----------------------------------------------------------------------
@@ -50,10 +46,6 @@ ScAccWinFocusLostHint::~ScAccWinFocusLostHint()
}
// -----------------------------------------------------------------------
-
-TYPEINIT1(ScAccWinFocusGotHint, SfxHint);
-
-// -----------------------------------------------------------------------
// ScAccWinFocusGotHint - the window got the focus (from another application, view or document)
// -----------------------------------------------------------------------
@@ -67,9 +59,6 @@ ScAccWinFocusGotHint::ScAccWinFocusGotHint(
ScAccWinFocusGotHint::~ScAccWinFocusGotHint()
{
}
-// -----------------------------------------------------------------------
-
-TYPEINIT1(ScAccGridWinFocusLostHint, SfxHint);
// -----------------------------------------------------------------------
// ScAccGridWinFocusLostHint - the current grid window lost its focus (to another application, view or document)
@@ -88,10 +77,6 @@ ScAccGridWinFocusLostHint::~ScAccGridWinFocusLostHint()
}
// -----------------------------------------------------------------------
-
-TYPEINIT1(ScAccGridWinFocusGotHint, SfxHint);
-
-// -----------------------------------------------------------------------
// ScAccGridWinFocusGotHint - the grid window got the focus (from another application, view or document)
// -----------------------------------------------------------------------
diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index f8e9b14b6f75..433248f7814a 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -147,16 +147,14 @@ void SAL_CALL ScAccessibleContextBase::release()
void ScAccessibleContextBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
- {
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- if (rRef.GetId() == SFX_HINT_DYING)
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId())
{
// it seems the Broadcaster is dying, since the view is dying
dispose();
}
}
-}
//===== XAccessible =========================================================
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 23b2238bd05d..a25e29feb3b5 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -371,19 +371,21 @@ void ScChildrenShapes::SetDrawBroadcaster()
void ScChildrenShapes::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- if ( rHint.ISA( SdrHint ) )
- {
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
if (pSdrHint)
{
- SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject());
- if (pObj && /*(pObj->GetLayer() != SC_LAYER_INTERN) && */(pObj->GetPage() == GetDrawPage()) &&
- (pObj->GetPage() == pObj->GetObjList()) ) //#108480# only do something if the object lies direct on the page
+ SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetSdrHintObject());
+ if (pObj && /*(pObj->GetLayer() != SC_LAYER_INTERN) && */(pObj->getSdrPageFromSdrObject() == GetDrawPage()) &&
+ (pObj->getSdrPageFromSdrObject() == pObj->getParentOfSdrObject()) ) //#108480# only do something if the object lies direct on the page
{
- switch (pSdrHint->GetKind())
+ switch (pSdrHint->GetSdrHintKind())
{
- case HINT_OBJCHG : // Objekt geaendert
+ case HINT_OBJCHG_MOVE :
+ case HINT_OBJCHG_RESIZE :
+ case HINT_OBJCHG_ATTR :
{
+ // Objekt geaendert
uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
if (xShape.is())
{
@@ -416,7 +418,6 @@ void ScChildrenShapes::Notify(SfxBroadcaster&, const SfxHint& rHint)
}
}
}
-}
sal_Bool ScChildrenShapes::ReplaceChild (::accessibility::AccessibleShape* pCurrentChild,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _rxShape,
@@ -820,8 +821,8 @@ SdrPage* ScChildrenShapes::GetDrawPage() const
if (pDoc && pDoc->GetDrawLayer())
{
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
- if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab))
- pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab)));
+ if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > static_cast< sal_uInt32 >(nTab)))
+ pDrawPage = pDrawLayer->GetPage(static_cast< sal_uInt32 >(nTab));
}
}
return pDrawPage;
@@ -1307,10 +1308,11 @@ void SAL_CALL ScAccessibleDocument::disposing( const lang::EventObject& /* Sourc
IMPL_LINK( ScAccessibleDocument, WindowChildEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ VclWindowEvent *pVclEvent = dynamic_cast< VclWindowEvent * >( pEvent );
+ DBG_ASSERT( pVclEvent, "Unknown WindowEvent!" );
+
+ if ( pVclEvent )
{
- VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent );
DBG_ASSERT( pVclEvent->GetWindow(), "Window???" );
switch ( pVclEvent->GetId() )
{
@@ -1339,10 +1341,11 @@ IMPL_LINK( ScAccessibleDocument, WindowChildEventListener, VclSimpleEvent*, pEve
void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( ScAccGridWinFocusLostHint ) )
+ const ScAccGridWinFocusLostHint* pScAccGridWinFocusLostHint = dynamic_cast< const ScAccGridWinFocusLostHint* >(&rHint);
+
+ if(pScAccGridWinFocusLostHint)
{
- const ScAccGridWinFocusLostHint& rRef = (const ScAccGridWinFocusLostHint&)rHint;
- if (rRef.GetOldGridWin() == meSplitPos)
+ if (pScAccGridWinFocusLostHint->GetOldGridWin() == meSplitPos)
{
if (mxTempAcc.is() && mpTempAccEdit)
mpTempAccEdit->LostFocus();
@@ -1352,10 +1355,13 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
CommitFocusLost();
}
}
- else if (rHint.ISA( ScAccGridWinFocusGotHint ) )
+ else
{
- const ScAccGridWinFocusGotHint& rRef = (const ScAccGridWinFocusGotHint&)rHint;
- if (rRef.GetNewGridWin() == meSplitPos)
+ const ScAccGridWinFocusGotHint* rScAccGridWinFocusGotHint = dynamic_cast< const ScAccGridWinFocusGotHint* >(&rHint);
+
+ if (rScAccGridWinFocusGotHint )
+ {
+ if (rScAccGridWinFocusGotHint->GetNewGridWin() == meSplitPos)
{
if (mxTempAcc.is() && mpTempAccEdit)
mpTempAccEdit->GotFocus();
@@ -1365,11 +1371,14 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
CommitFocusGained();
}
}
- else if (rHint.ISA( SfxSimpleHint ))
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if ((rRef.GetId() == SC_HINT_ACC_TABLECHANGED) &&
+ if ((pSfxSimpleHint->GetId() == SC_HINT_ACC_TABLECHANGED) &&
mpAccessibleSpreadsheet)
{
FreeAccessibleSpreadsheet();
@@ -1387,12 +1396,12 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
aEvent.Source = uno::Reference< XAccessibleContext >(this);
CommitChange(aEvent); // all childs changed
}
- else if (rRef.GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
+ else if (pSfxSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
{
if (mpChildrenShapes)
mpChildrenShapes->SetDrawBroadcaster();
}
- else if ((rRef.GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell
+ else if ((pSfxSimpleHint->GetId() == SC_HINT_ACC_ENTEREDITMODE)) // this event comes only on creating edit field of a cell
{
if (mpViewShell && mpViewShell->GetViewData()->HasEditView(meSplitPos))
{
@@ -1411,7 +1420,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
mpTempAccEdit->GotFocus();
}
}
- else if (rRef.GetId() == SC_HINT_ACC_LEAVEEDITMODE)
+ else if (pSfxSimpleHint->GetId() == SC_HINT_ACC_LEAVEEDITMODE)
{
if (mxTempAcc.is())
{
@@ -1427,7 +1436,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
CommitFocusGained();
}
}
- else if ((rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) || (rRef.GetId() == SC_HINT_ACC_WINDOWRESIZED))
+ else if ((pSfxSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED) || (pSfxSimpleHint->GetId() == SC_HINT_ACC_WINDOWRESIZED))
{
Rectangle aOldVisArea(maVisArea);
maVisArea = GetVisibleArea_Impl();
@@ -1454,6 +1463,8 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
+ }
+ }
ScAccessibleDocumentBase::Notify(rBC, rHint);
}
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index a96376e59cb5..8fb01e9ea61b 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -774,18 +774,21 @@ void ScShapeChilds::SetDrawBroadcaster()
void ScShapeChilds::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- if ( rHint.ISA( SdrHint ) )
- {
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
if (pSdrHint)
{
- SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject());
- if (pObj && (pObj->GetPage() == GetDrawPage()))
+ const SdrObject* pObj = pSdrHint->GetSdrHintObject();
+
+ if (pObj && (pObj->getSdrPageFromSdrObject() == GetDrawPage()))
{
- switch (pSdrHint->GetKind())
+ switch (pSdrHint->GetSdrHintKind())
{
- case HINT_OBJCHG : // Objekt geaendert
+ case HINT_OBJCHG_MOVE :
+ case HINT_OBJCHG_RESIZE :
+ case HINT_OBJCHG_ATTR :
{
+ // Objekt geaendert
}
break;
// no longer necessary
@@ -812,7 +815,6 @@ void ScShapeChilds::Notify(SfxBroadcaster&, const SfxHint& rHint)
}
}
}
-}
void ScShapeChilds::FindChanged(ScShapeChildVec& rOld, ScShapeChildVec& rNew) const
{
@@ -1360,8 +1362,8 @@ SdrPage* ScShapeChilds::GetDrawPage() const
if (pDoc && pDoc->GetDrawLayer())
{
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
- if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab))
- pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab)));
+ if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > static_cast< sal_uInt32 >(nTab)))
+ pDrawPage = pDrawLayer->GetPage(static_cast< sal_uInt32 >(nTab));
}
}
return pDrawPage;
@@ -1497,11 +1499,12 @@ void SAL_CALL ScAccessibleDocumentPagePreview::disposing()
void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint )
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if ((rRef.GetId() == SC_HINT_DATACHANGED))
+ if ((pSfxSimpleHint->GetId() == SC_HINT_DATACHANGED))
{
if (mpTable) // if there is no table there is nothing to notify, because no one recongnizes the change
{
@@ -1551,11 +1554,11 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
}
}
}
- else if (rRef.GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
+ else if (pSfxSimpleHint->GetId() == SC_HINT_ACC_MAKEDRAWLAYER)
{
GetShapeChilds()->SetDrawBroadcaster();
}
- else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ else if (pSfxSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
Size aOutputSize;
Window* pSizeWindow = mpViewShell->GetWindow();
@@ -1573,11 +1576,11 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint
CommitChange(aEvent);
}
}
- else if ( rHint.ISA(ScAccWinFocusLostHint) )
+ else if ( dynamic_cast< const ScAccWinFocusLostHint* >(&rHint) )
{
CommitFocusLost();
}
- else if ( rHint.ISA(ScAccWinFocusGotHint) )
+ else if ( dynamic_cast< const ScAccWinFocusGotHint* >(&rHint) )
{
CommitFocusGained();
}
diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
index 8324f41f0adc..a8d9007e3393 100644
--- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx
+++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
@@ -345,8 +345,7 @@ void ScAccessibleEditObject::CreateTextHelper()
const ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
if( pInputHdl && !pInputHdl->IsTopMode() )
{
- SdrHint aHint( HINT_BEGEDIT );
- mpTextHelper->GetEditSource().GetBroadcaster().Broadcast( aHint );
+ mpTextHelper->GetEditSource().GetBroadcaster().Broadcast(SdrBaseHint(HINT_BEGEDIT));
}
}
}
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index 7138e902a913..a4c69bca86d4 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -132,11 +132,12 @@ void SAL_CALL ScAccessiblePageHeader::disposing()
void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if ((rRef.GetId() == SC_HINT_DATACHANGED))
+ if ((pSfxSimpleHint->GetId() == SC_HINT_DATACHANGED))
{
ScHFAreas aOldAreas(maAreas);
std::for_each(aOldAreas.begin(), aOldAreas.end(), Acquire());
@@ -170,7 +171,7 @@ void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
std::for_each(aOldAreas.begin(), aOldAreas.end(), Release());
}
- else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ else if (pSfxSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index 0fd253be892b..23c85c9c8e85 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -102,11 +102,12 @@ void SAL_CALL ScAccessiblePageHeaderArea::disposing()
void ScAccessiblePageHeaderArea::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ if (pSfxSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
if (mpTextHelper)
mpTextHelper->UpdateChildren();
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index 3afda4f9f2c7..b2583c2328a3 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -87,10 +87,11 @@ void SAL_CALL ScAccessiblePreviewCell::disposing()
void ScAccessiblePreviewCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ if (pSfxSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
if (mpTextHelper)
mpTextHelper->UpdateChildren();
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index d3cfb742828c..bd85560bb316 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -97,10 +97,11 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::disposing()
void ScAccessiblePreviewHeaderCell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- sal_uLong nId = rRef.GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if (nId == SC_HINT_ACC_VISAREACHANGED)
{
if (mpTextHelper)
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 7c2319d9e8ce..4564668722df 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -95,17 +95,18 @@ void SAL_CALL ScAccessiblePreviewTable::disposing()
void ScAccessiblePreviewTable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
- sal_uLong nId = rRef.GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DATACHANGED )
{
// column / row layout may change with any document change,
// so it must be invalidated
DELETEZ( mpTableInfo );
}
- else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+ else if (nId == SC_HINT_ACC_VISAREACHANGED)
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 5cbf6bf3c32f..1bfb282a380c 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -206,11 +206,12 @@ void ScAccessibleSpreadsheet::VisAreaChanged()
void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint;
// only notify if child exist, otherwise it is not necessary
- if ((rRef.GetId() == SC_HINT_ACC_CURSORCHANGED))
+ if ((pSfxSimpleHint->GetId() == SC_HINT_ACC_CURSORCHANGED))
{
if (mpViewShell)
{
@@ -264,7 +265,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
}
}
- else if ((rRef.GetId() == SC_HINT_DATACHANGED))
+ else if ((pSfxSimpleHint->GetId() == SC_HINT_DATACHANGED))
{
if (!mbDelIns)
CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
@@ -272,7 +273,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
mbDelIns = sal_False;
}
// no longer needed, because the document calls the VisAreaChanged method
-/* else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED)
+/* else if (pSfxSimpleHint->GetId() == SC_HINT_ACC_VISAREACHANGED)
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
@@ -298,7 +299,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
}*/
// no longer needed, because the document calls the BoundingBoxChanged method
-/* else if (rRef.GetId() == SC_HINT_ACC_WINDOWRESIZED)
+/* else if (pSfxSimpleHint->GetId() == SC_HINT_ACC_WINDOWRESIZED)
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::BOUNDRECT_CHANGED;
@@ -307,23 +308,26 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
CommitChange(aEvent);
}*/
}
- else if (rHint.ISA( ScUpdateRefHint ))
+ else
{
- const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- if (rRef.GetMode() == URM_INSDEL && rRef.GetDz() == 0) //#107250# test whether table is inserted or deleted
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if (pScUpdateRefHint)
{
- if (((rRef.GetRange().aStart.Col() == maRange.aStart.Col()) &&
- (rRef.GetRange().aEnd.Col() == maRange.aEnd.Col())) ||
- ((rRef.GetRange().aStart.Row() == maRange.aStart.Row()) &&
- (rRef.GetRange().aEnd.Row() == maRange.aEnd.Row())))
+ if (pScUpdateRefHint->GetMode() == URM_INSDEL && pScUpdateRefHint->GetDz() == 0) //#107250# test whether table is inserted or deleted
+ {
+ if (((pScUpdateRefHint->GetRange().aStart.Col() == maRange.aStart.Col()) &&
+ (pScUpdateRefHint->GetRange().aEnd.Col() == maRange.aEnd.Col())) ||
+ ((pScUpdateRefHint->GetRange().aStart.Row() == maRange.aStart.Row()) &&
+ (pScUpdateRefHint->GetRange().aEnd.Row() == maRange.aEnd.Row())))
{
// ignore next SC_HINT_DATACHANGED notification
mbDelIns = sal_True;
sal_Int16 nId(0);
- SCsCOL nX(rRef.GetDx());
- SCsROW nY(rRef.GetDy());
- ScRange aRange(rRef.GetRange());
+ SCsCOL nX(pScUpdateRefHint->GetDx());
+ SCsROW nY(pScUpdateRefHint->GetDy());
+ ScRange aRange(pScUpdateRefHint->GetRange());
if ((nX < 0) || (nY < 0))
{
DBG_ASSERT(!((nX < 0) && (nY < 0)), "should not be possible to remove row and column at the same time");
@@ -353,10 +357,10 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
DBG_ERROR("is it a deletion or a insertion?");
}
- CommitTableModelChange(rRef.GetRange().aStart.Row(),
- rRef.GetRange().aStart.Col(),
- rRef.GetRange().aStart.Row() + nY,
- rRef.GetRange().aStart.Col() + nX, nId);
+ CommitTableModelChange(pScUpdateRefHint->GetRange().aStart.Row(),
+ pScUpdateRefHint->GetRange().aStart.Col(),
+ pScUpdateRefHint->GetRange().aStart.Row() + nY,
+ pScUpdateRefHint->GetRange().aStart.Col() + nX, nId);
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
@@ -368,6 +372,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
}
}
+ }
ScAccessibleTableBase::Notify(rBC, rHint);
}
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 577217d8f6b9..a3d3f6f0aa5d 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -771,9 +771,11 @@ ScAccessibleCellTextData::~ScAccessibleCellTextData()
void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
@@ -1086,9 +1088,11 @@ ScAccessibleEditObjectTextData::~ScAccessibleEditObjectTextData()
void ScAccessibleEditObjectTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpWindow = NULL;
@@ -1320,15 +1324,13 @@ void ScAccessibleEditLineTextData::StartEdit()
mpEditView = NULL;
// send HINT_BEGEDIT
- SdrHint aHint(HINT_BEGEDIT);
- GetBroadcaster().Broadcast( aHint );
+ GetBroadcaster().Broadcast(SdrBaseHint(HINT_BEGEDIT));
}
void ScAccessibleEditLineTextData::EndEdit()
{
// send HINT_ENDEDIT
- SdrHint aHint(HINT_ENDEDIT);
- GetBroadcaster().Broadcast( aHint );
+ GetBroadcaster().Broadcast(SdrBaseHint(HINT_ENDEDIT));
ResetEditMode();
mpEditView = NULL;
@@ -1357,9 +1359,11 @@ ScAccessiblePreviewCellTextData::~ScAccessiblePreviewCellTextData()
void ScAccessiblePreviewCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
@@ -1450,9 +1454,11 @@ ScAccessiblePreviewHeaderCellTextData::~ScAccessiblePreviewHeaderCellTextData()
void ScAccessiblePreviewHeaderCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL; // invalid now
@@ -1593,9 +1599,11 @@ ScAccessibleTextData* ScAccessibleHeaderTextData::Clone() const
void ScAccessibleHeaderTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL;// invalid now
@@ -1710,9 +1718,11 @@ ScAccessibleTextData* ScAccessibleNoteTextData::Clone() const
void ScAccessibleNoteTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
mpViewShell = NULL;// invalid now
@@ -1857,9 +1867,11 @@ ScAccessibleCsvTextData::~ScAccessibleCsvTextData()
void ScAccessibleCsvTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if( nId == SFX_HINT_DYING )
{
mpWindow = NULL;
diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
index 7ceb037c1cfc..5794e5766089 100644
--- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
+++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx
@@ -59,7 +59,8 @@ void SAL_CALL ScDrawModelBroadcaster::removeEventListener( const uno::Reference<
void ScDrawModelBroadcaster::Notify( SfxBroadcaster&,
const SfxHint& rHint )
{
- const SdrHint *pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
if( !pSdrHint )
return;
diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 6ea211e0274a..e5275f63fe22 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -42,6 +42,7 @@
#include <svx/svdview.hxx>
#include <svx/svdograf.hxx>
#include <svtools/embedhlp.hxx>
+#include <svx/svdlegacy.hxx>
#include "client.hxx"
#include "tabvwsh.hxx"
@@ -69,8 +70,8 @@ SdrOle2Obj* ScClient::GetDrawObj()
SdrOle2Obj* pOle2Obj = NULL;
String aName = GetViewShell()->GetObjectShell()->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj );
- sal_uInt16 nPages = pModel->GetPageCount();
- for (sal_uInt16 nPNr=0; nPNr<nPages && !pOle2Obj; nPNr++)
+ const sal_uInt32 nPages(pModel->GetPageCount());
+ for (sal_uInt32 nPNr=0; nPNr<nPages && !pOle2Obj; nPNr++)
{
SdrPage* pPage = pModel->GetPage(nPNr);
SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
@@ -92,7 +93,7 @@ SdrOle2Obj* ScClient::GetDrawObj()
void __EXPORT ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
{
SfxViewShell* pSfxViewSh = GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( pSfxViewSh );
if (!pViewSh)
{
DBG_ERROR("Wrong ViewShell");
@@ -114,39 +115,45 @@ void __EXPORT ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(static_cast<sal_Int16>(nTab)));
if ( pPage && aLogicRect != aOldRect )
{
- Point aPos;
- Size aSize = pPage->GetSize();
- if ( aSize.Width() < 0 )
+ basegfx::B2DPoint aPos(0.0, 0.0);
+ basegfx::B2DVector aSize(pPage->GetPageScale());
+
+ if ( aSize.getX() < 0.0 )
{
- aPos.X() = aSize.Width() + 1; // negative
- aSize.Width() = -aSize.Width(); // positive
+ aPos.setX( aSize.getX() + 1.0); // negative
+ aSize.setX(-aSize.getX()); // positive
}
- Rectangle aPageRect( aPos, aSize );
- if (aLogicRect.Right() > aPageRect.Right())
+ basegfx::B2DRange aPageRange( aPos, aPos + aSize );
+ basegfx::B2DPoint aTranslate(0.0, 0.0);
+ basegfx::B2DRange aLogicRange(aLogicRect.Left(), aLogicRect.Top(), aLogicRect.Right(), aLogicRect.Bottom());
+
+ if(aPageRange.getMaxX() < aLogicRange.getMaxX())
{
- long nDiff = aLogicRect.Right() - aPageRect.Right();
- aLogicRect.Left() -= nDiff;
- aLogicRect.Right() -= nDiff;
+ aTranslate.setX(aPageRange.getMaxX() - aLogicRange.getMaxX());
}
- if (aLogicRect.Bottom() > aPageRect.Bottom())
+
+ if(aPageRange.getMinX() > aLogicRange.getMinX())
{
- long nDiff = aLogicRect.Bottom() - aPageRect.Bottom();
- aLogicRect.Top() -= nDiff;
- aLogicRect.Bottom() -= nDiff;
+ aTranslate.setX(aPageRange.getMinX() - aLogicRange.getMinX());
}
- if (aLogicRect.Left() < aPageRect.Left())
+ if(aPageRange.getMaxY() < aLogicRange.getMaxY())
{
- long nDiff = aLogicRect.Left() - aPageRect.Left();
- aLogicRect.Right() -= nDiff;
- aLogicRect.Left() -= nDiff;
+ aTranslate.setY(aPageRange.getMaxY() - aLogicRange.getMaxY());
}
- if (aLogicRect.Top() < aPageRect.Top())
+
+ if(aPageRange.getMinY() > aLogicRange.getMinY())
+ {
+ aTranslate.setY(aPageRange.getMinY() - aLogicRange.getMinY());
+ }
+
+ if(!aTranslate.equalZero())
{
- long nDiff = aLogicRect.Top() - aPageRect.Top();
- aLogicRect.Bottom() -= nDiff;
- aLogicRect.Top() -= nDiff;
+ aLogicRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aTranslate));
+ aLogicRect = Rectangle(
+ basegfx::fround(aLogicRange.getMinX()), basegfx::fround(aLogicRange.getMinY()),
+ basegfx::fround(aLogicRange.getMaxX()), basegfx::fround(aLogicRange.getMaxY()));
}
}
}
@@ -154,7 +161,7 @@ void __EXPORT ScClient::RequestNewObjectArea( Rectangle& aLogicRect )
void __EXPORT ScClient::ObjectAreaChanged()
{
SfxViewShell* pSfxViewSh = GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( pSfxViewSh );
if (!pViewSh)
{
DBG_ERROR("Wrong ViewShell");
@@ -165,28 +172,33 @@ void __EXPORT ScClient::ObjectAreaChanged()
SdrOle2Obj* pDrawObj = GetDrawObj();
if (pDrawObj)
{
- Rectangle aNewRectangle(GetScaledObjArea());
+ const Rectangle aScaledObjArea(GetScaledObjArea());
+ basegfx::B2DRange aNewRange(aScaledObjArea.Left(), aScaledObjArea.Top(), aScaledObjArea.Right(), aScaledObjArea.Bottom());
// #i118524# if sheared/rotated, center to non-rotated LogicRect
pDrawObj->setSuppressSetVisAreaSize(true);
- if(pDrawObj->GetGeoStat().nDrehWink || pDrawObj->GetGeoStat().nShearWink)
+ if(pDrawObj->isRotatedOrSheared())
{
- pDrawObj->SetLogicRect( aNewRectangle );
+ sdr::legacy::SetLogicRange(*pDrawObj, aNewRange);
- const Rectangle& rBoundRect = pDrawObj->GetCurrentBoundRect();
- const Point aDelta(aNewRectangle.Center() - rBoundRect.Center());
+ const SdrView* pView(pViewSh ? pViewSh->GetSdrView() : 0);
+ const basegfx::B2DRange& rBoundRange(pDrawObj->getObjectRange(pView));
+ const basegfx::B2DPoint aDelta(aNewRange.getCenter() - rBoundRange.getCenter());
- aNewRectangle.Move(aDelta.X(), aDelta.Y());
+ aNewRange.transform(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ aDelta.getX(),
+ aDelta.getY()));
}
- pDrawObj->SetLogicRect( aNewRectangle );
+ sdr::legacy::SetLogicRange(*pDrawObj, aNewRange);
pDrawObj->setSuppressSetVisAreaSize(false);
// set document modified (SdrModel::SetChanged is not used)
// TODO/LATER: is there a reason that this code is not executed in Draw?
// SfxViewShell* pSfxViewSh = GetViewShell();
-// ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+// ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( pSfxViewSh );
if (pViewSh)
pViewSh->GetViewData()->GetDocShell()->SetDrawModified();
}
@@ -224,7 +236,7 @@ void __EXPORT ScClient::ViewChanged()
SdrOle2Obj* pDrawObj = GetDrawObj();
if (pDrawObj)
{
- Rectangle aLogicRect = pDrawObj->GetLogicRect();
+ Rectangle aLogicRect(sdr::legacy::GetLogicRect(*pDrawObj));
Fraction aFractX = GetScaleWidth();
Fraction aFractY = GetScaleHeight();
aFractX *= aVisSize.Width();
@@ -238,14 +250,14 @@ void __EXPORT ScClient::ViewChanged()
//SetObjArea( aObjArea );
SfxViewShell* pSfxViewSh = GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( pSfxViewSh );
if ( pViewSh )
{
Window* pWin = pViewSh->GetActiveWin();
if ( pWin->LogicToPixel( aVisSize ) != pWin->LogicToPixel( aLogicRect.GetSize() ) )
{
aLogicRect.SetSize( aVisSize );
- pDrawObj->SetLogicRect( aLogicRect );
+ sdr::legacy::SetLogicRect(*pDrawObj, aLogicRect );
// set document modified (SdrModel::SetChanged is not used)
pViewSh->GetViewData()->GetDocShell()->SetDrawModified();
@@ -260,7 +272,7 @@ void __EXPORT ScClient::MakeVisible()
if (pDrawObj)
{
SfxViewShell* pSfxViewSh = GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pSfxViewSh );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( pSfxViewSh );
if (pViewSh)
pViewSh->ScrollToObject( pDrawObj );
}
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index c47b7b90a898..2da03f40887b 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -149,7 +149,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
// URL button
//
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObject);
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pObject);
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
@@ -214,11 +214,12 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
//
// #i71538# use complete SdrViews
- // SdrExchangeView aView(pModel);
- SdrView aView(pModel);
- SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
- aView.MarkAllObj(pPv);
- aSrcSize = aView.GetAllMarkedRect().GetSize();
+ OSL_ENSURE(pModel, "ScDrawTransferObj without SdrModel (!)");
+ SdrView aView(*pModel);
+ aView.ShowSdrPage(*aView.getSdrModelFromSdrView().GetPage(0));
+ aView.MarkAllObj();
+ const basegfx::B2DRange aAllRange(aView.getMarkedObjectSnapRange());
+ aSrcSize = Size(basegfx::fround(aAllRange.getWidth()), basegfx::fround(aAllRange.getHeight()));
if ( bOleObj ) // single OLE object
{
@@ -298,7 +299,7 @@ sal_Bool lcl_HasOnlyControls( SdrModel* pModel )
bOnlyControls = sal_True; // only set if there are any objects at all
while ( pObj )
{
- if (!pObj->ISA(SdrUnoObj))
+ if (!dynamic_cast< SdrUnoObj* >(pObj))
{
bOnlyControls = sal_False;
break;
@@ -430,10 +431,10 @@ sal_Bool ScDrawTransferObj::GetData( const ::com::sun::star::datatransfer::DataF
{
// #i71538# use complete SdrViews
// SdrExchangeView aView( pModel );
- SdrView aView( pModel );
- SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
- DBG_ASSERT( pPv, "pPv not there..." );
- aView.MarkAllObj( pPv );
+ OSL_ENSURE(pModel, "ScDrawTransferObj without SdrModel (!)");
+ SdrView aView( *pModel );
+ aView.ShowSdrPage(*aView.getSdrModelFromSdrView().GetPage(0));
+ aView.MarkAllObj();
if ( nFormat == SOT_FORMAT_GDIMETAFILE )
bOK = SetGDIMetaFile( aView.GetMarkedObjMetaFile(true), rFlavor );
else
@@ -504,7 +505,7 @@ sal_Bool ScDrawTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUse
// SW should have no MasterPages
DBG_ASSERT(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
- for(sal_uInt16 a(0); a < pModel->GetPageCount(); a++)
+ for(sal_uInt32 a(0); a < pModel->GetPageCount(); a++)
{
const SdrPage* pPage = pModel->GetPage(a);
SdrObjListIter aIter(*pPage, IM_DEEPNOGROUPS);
@@ -661,25 +662,19 @@ void ScDrawTransferObj::SetDrawPersist( const SfxObjectShellRef& rRef )
void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, SCTAB nTab )
{
- rDest.ShowSdrPage(rDest.GetModel()->GetPage(nTab));
- SdrPageView* pDestPV = rDest.GetSdrPageView();
- DBG_ASSERT(pDestPV,"PageView ?");
+ rDest.ShowSdrPage(*rDest.getSdrModelFromSdrView().GetPage(nTab));
+ const SdrObjectVector aSelection(rSource.getSelectedSdrObjectVectorFromSdrMarkView());
- const SdrMarkList& rMarkList = rSource.GetMarkedObjectList();
- sal_uLong nCount = rMarkList.GetMarkCount();
- for (sal_uLong i=0; i<nCount; i++)
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrMark* pMark = rMarkList.GetMark(i);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- rDest.MarkObj(pObj, pDestPV);
+ rDest.MarkObj(*aSelection[i]);
}
}
void ScDrawTransferObj::SetDragSource( ScDrawView* pView )
{
DELETEZ( pDragSourceView );
- pDragSourceView = new SdrView( pView->GetModel() );
+ pDragSourceView = new SdrView( pView->getSdrModelFromSdrView() );
lcl_InitMarks( *pDragSourceView, *pView, pView->GetTab() );
//! add as listener with document, delete pDragSourceView if document gone
@@ -688,10 +683,10 @@ void ScDrawTransferObj::SetDragSource( ScDrawView* pView )
void ScDrawTransferObj::SetDragSourceObj( SdrObject* pObj, SCTAB nTab )
{
DELETEZ( pDragSourceView );
- pDragSourceView = new SdrView( pObj->GetModel() );
- pDragSourceView->ShowSdrPage(pDragSourceView->GetModel()->GetPage(nTab));
- SdrPageView* pPV = pDragSourceView->GetSdrPageView();
- pDragSourceView->MarkObj(pObj, pPV);
+ OSL_ENSURE(pObj, "ScDrawTransferObj without SdrObject/SdrModel (!)");
+ pDragSourceView = new SdrView(pObj->getSdrModelFromSdrObject());
+ pDragSourceView->ShowSdrPage(*pDragSourceView->getSdrModelFromSdrView().GetPage(nTab));
+ pDragSourceView->MarkObj(*pObj);
//! add as listener with document, delete pDragSourceView if document gone
}
@@ -743,9 +738,10 @@ void ScDrawTransferObj::InitDocShell()
SdrModel* pDestModel = pDestDoc->GetDrawLayer();
// #i71538# use complete SdrViews
// SdrExchangeView aDestView( pDestModel );
- SdrView aDestView( pDestModel );
- aDestView.ShowSdrPage(aDestView.GetModel()->GetPage(0));
- aDestView.Paste( *pModel, Point( aSrcSize.Width()/2, aSrcSize.Height()/2 ) );
+ OSL_ENSURE(pDestModel, "ScDrawTransferObj without SdrModel (!)");
+ SdrView aDestView( *pDestModel );
+ aDestView.ShowSdrPage(*aDestView.getSdrModelFromSdrView().GetPage(0));
+ aDestView.Paste( *pModel, basegfx::B2DPoint( aSrcSize.Width()/2, aSrcSize.Height()/2 ) );
// put objects to right layer (see ScViewFunc::PasteDataFormat for SOT_FORMATSTR_ID_DRAWING)
@@ -756,10 +752,10 @@ void ScDrawTransferObj::InitDocShell()
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->ISA(SdrUnoObj) )
- pObject->NbcSetLayer(SC_LAYER_CONTROLS);
+ if ( dynamic_cast< SdrUnoObj* >(pObject) )
+ pObject->SetLayer(SC_LAYER_CONTROLS);
else
- pObject->NbcSetLayer(SC_LAYER_FRONT);
+ pObject->SetLayer(SC_LAYER_FRONT);
pObject = aIter.Next();
}
}
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index d8d6f8fb8d2f..8bcbb82483d5 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1679,7 +1679,7 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // wird synchron
UpdateAutoCorrFlag();
}
- pActiveViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ pActiveViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
if ( pActiveViewSh && pActiveViewSh == pViewSh )
{
@@ -1834,7 +1834,7 @@ void ScInputHandler::RemoveAdjust()
if (bChange)
{
EditView* pActiveView = pTopView ? pTopView : pTableView;
- pActiveView->ShowCursor( sal_False, sal_True );
+ pActiveView->ShowCursor( false, true );
}
#endif
}
@@ -1850,7 +1850,7 @@ void ScInputHandler::RemoveRangeFinder()
pEngine->SetUpdateMode(sal_True);
EditView* pActiveView = pTopView ? pTopView : pTableView;
- pActiveView->ShowCursor( sal_False, sal_True );
+ pActiveView->ShowCursor( false, true );
DeleteRangeFinder(); // loescht die Liste und die Markierungen auf der Tabelle
}
@@ -2218,7 +2218,7 @@ void ScInputHandler::ShowRefFrame()
// #123169# Modifying pActiveViewSh here would interfere with the bInEnterHandler / bRepeat
// checks in NotifyChange, and lead to keeping the wrong value in pActiveViewSh.
// A local variable is used instead.
- ScTabViewShell* pVisibleSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pVisibleSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
if ( pRefViewSh && pRefViewSh != pVisibleSh )
{
sal_Bool bFound = sal_False;
@@ -2339,7 +2339,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode )
pEngine->GetView(i)->
SetSelection( ESelection( nPara, nLen, nPara, nLen ) );
}
- pEngine->GetView(i)->ShowCursor(sal_False);
+ pEngine->GetView(i)->ShowCursor(false);
}
}
@@ -3346,7 +3346,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
if ( pSourceSh )
pActiveViewSh = pSourceSh;
else
- pActiveViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ pActiveViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
ImplCreateEditEngine();
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index cbc7d439979c..b0ccb08c7dd9 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -157,7 +157,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
{
SfxViewFrame* pViewFrm = pDisp->GetFrame();
if ( pViewFrm )
- pViewSh = PTR_CAST( ScTabViewShell, pViewFrm->GetViewShell() );
+ pViewSh = dynamic_cast< ScTabViewShell* >( pViewFrm->GetViewShell() );
}
DBG_ASSERT( pViewSh, "no view shell for input window" );
@@ -232,8 +232,7 @@ __EXPORT ScInputWindow::~ScInputWindow()
if ( !bDown )
{
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( _IsSfxViewShell< ScTabViewShell > );
while ( pSh )
{
ScInputHandler* pHdl = ((ScTabViewShell*)pSh)->GetInputHandler();
@@ -242,7 +241,7 @@ __EXPORT ScInputWindow::~ScInputWindow()
pHdl->SetInputWindow( NULL );
pHdl->StopInputWinEngine( sal_False ); // #125841# reset pTopView pointer
}
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, _IsSfxViewShell< ScTabViewShell > );
}
}
@@ -267,7 +266,7 @@ void ScInputWindow::SetInputHandler( ScInputHandler* pNew )
sal_Bool ScInputWindow::UseSubTotal(ScRangeList* pRangeList) const
{
sal_Bool bSubTotal(sal_False);
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
if ( pViewSh )
{
ScDocument* pDoc = pViewSh->GetViewData()->GetDocument();
@@ -361,7 +360,7 @@ void __EXPORT ScInputWindow::Select()
case SID_INPUT_SUM:
{
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
if ( pViewSh )
{
const ScMarkData& rMark = pViewSh->GetViewData()->GetMarkData();
@@ -1114,7 +1113,7 @@ void ScTextWnd::StartEditEngine()
// as long as EditEngine and DrawText sometimes differ for CTL text,
// repaint now to have the EditEngine's version visible
// SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast< ScDocShell* >(pObjSh) )
{
ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument(); // any document
sal_uInt8 nScript = pDoc->GetStringScriptType( aString );
@@ -1199,7 +1198,7 @@ void ScTextWnd::SetTextString( const String& rNewString )
sal_uInt8 nOldScript = 0;
sal_uInt8 nNewScript = 0;
SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast< ScDocShell* >(pObjSh) )
{
// any document can be used (used only for its break iterator)
ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument();
@@ -1429,7 +1428,7 @@ void ScPosWnd::FillRangeNames()
Clear();
SfxObjectShell* pObjSh = SfxObjectShell::Current();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ if ( pObjSh && dynamic_cast< ScDocShell* >(pObjSh) )
{
ScDocument* pDoc = ((ScDocShell*)pObjSh)->GetDocument();
@@ -1516,21 +1515,27 @@ void __EXPORT ScPosWnd::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( !bFormulaMode )
{
// muss die Liste der Bereichsnamen updgedated werden?
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA(SfxSimpleHint) )
+ if ( pSfxSimpleHint )
{
- sal_uLong nHintId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uLong nHintId = pSfxSimpleHint->GetId();
if ( nHintId == SC_HINT_AREAS_CHANGED || nHintId == SC_HINT_NAVIGATOR_UPDATEALL)
FillRangeNames();
}
- else if ( rHint.ISA(SfxEventHint) )
+ else
+ {
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if ( pSfxEventHint )
{
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = pSfxEventHint->GetEventId();
if ( nEventId == SFX_EVENT_ACTIVATEDOC )
FillRangeNames();
}
}
}
+}
void ScPosWnd::HideTip()
{
@@ -1678,7 +1683,7 @@ void ScPosWnd::DoEnter()
}
else
{
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
ScInputHandler* pHdl = pScMod->GetInputHdl( pViewSh );
if (pHdl)
pHdl->InsertFunction( aText );
@@ -1789,7 +1794,7 @@ void ScPosWnd::ReleaseFocus_Impl()
HideTip();
SfxViewShell* pCurSh = SfxViewShell::Current();
- ScInputHandler* pHdl = SC_MOD()->GetInputHdl( PTR_CAST( ScTabViewShell, pCurSh ) );
+ ScInputHandler* pHdl = SC_MOD()->GetInputHdl( dynamic_cast< ScTabViewShell* >( pCurSh ) );
if ( pHdl && pHdl->IsTopMode() )
{
// Focus wieder in die Eingabezeile?
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 746de4d80838..3b50146ad666 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -229,9 +229,10 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
while ( pObjSh )
{
- if ( pObjSh->Type() == TYPE(ScDocShell) )
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pDocSh )
{
- ScDocShell* pDocSh = ((ScDocShell*)pObjSh);
if ( bArrows )
ScDetectiveFunc( pDocSh->GetDocument(), 0 ).UpdateAllArrowColors();
if ( bComments )
@@ -247,9 +248,10 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while(pViewShell)
{
- if ( pViewShell->ISA(ScTabViewShell) )
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >(pViewShell);
+
+ if ( pViewSh )
{
- ScTabViewShell* pViewSh = (ScTabViewShell*)pViewShell;
pViewSh->PaintGrid();
pViewSh->PaintTop();
pViewSh->PaintLeft();
@@ -259,12 +261,13 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
if ( pHdl )
pHdl->ForgetLastPattern(); // EditEngine BackgroundColor may change
}
- else if ( pViewShell->ISA(ScPreviewShell) )
+ else if ( dynamic_cast< ScPreviewShell* >(pViewShell) )
{
Window* pWin = pViewShell->GetWindow();
if (pWin)
pWin->Invalidate();
}
+
pViewShell = SfxViewShell::GetNext( *pViewShell );
}
}
@@ -274,9 +277,10 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
while ( pObjSh )
{
- if ( pObjSh->Type() == TYPE(ScDocShell) )
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pDocSh )
{
- ScDocShell* pDocSh = ((ScDocShell*)pObjSh);
OutputDevice* pPrinter = pDocSh->GetPrinter();
if ( pPrinter )
pPrinter->SetDigitLanguage( GetOptDigitLanguage() );
@@ -294,10 +298,10 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
SfxViewShell* pSh = SfxViewShell::GetFirst();
while ( pSh )
{
- if ( pSh->ISA( ScTabViewShell ) )
- {
- ScTabViewShell* pViewSh = (ScTabViewShell*)pSh;
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >(pSh);
+ if ( pViewSh )
+ {
// set ref-device for EditEngine (re-evaluates digit settings)
ScInputHandler* pHdl = GetInputHdl(pViewSh);
if (pHdl)
@@ -306,14 +310,17 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
pViewSh->DigitLanguageChanged();
pViewSh->PaintGrid();
}
- else if ( pSh->ISA( ScPreviewShell ) )
+ else
{
- ScPreviewShell* pPreviewSh = (ScPreviewShell*)pSh;
- ScPreview* pPreview = pPreviewSh->GetPreview();
+ ScPreviewShell* pPreviewSh = dynamic_cast< ScPreviewShell* >(pSh);
+ if ( pPreviewSh )
+ {
+ ScPreview* pPreview = pPreviewSh->GetPreview();
pPreview->SetDigitLanguage( GetOptDigitLanguage() );
pPreview->Invalidate();
}
+ }
pSh = SfxViewShell::GetNext( *pSh );
}
@@ -322,9 +329,12 @@ void ScModule::ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt3
void ScModule::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nHintId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uLong nHintId = pSfxSimpleHint->GetId();
+
if ( nHintId == SFX_HINT_DEINITIALIZING )
{
// ConfigItems must be removed before ConfigManager
@@ -404,7 +414,7 @@ void ScModule::Execute( SfxRequest& rReq )
bSet = ((const SfxBoolItem*)pItem)->GetValue();
else
{ // Toggle
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
if ( pDocSh )
bSet = !pDocSh->GetDocument()->GetDocOptions().IsAutoSpell();
else
@@ -465,7 +475,7 @@ void ScModule::Execute( SfxRequest& rReq )
{
ScAppOptions aNewOpts( GetAppOptions() );
sal_Bool bNew = !aNewOpts.GetDetectiveAuto();
- SFX_REQUEST_ARG( rReq, pAuto, SfxBoolItem, SID_DETECTIVE_AUTO, sal_False );
+ SFX_REQUEST_ARG( rReq, pAuto, SfxBoolItem, SID_DETECTIVE_AUTO );
if ( pAuto )
bNew = pAuto->GetValue();
@@ -482,7 +492,7 @@ void ScModule::Execute( SfxRequest& rReq )
if (pReqArgs)
{
const SfxUInt16Item& rItem = (const SfxUInt16Item&)pReqArgs->Get(SID_PSZ_FUNCTION);
- DBG_ASSERT(rItem.ISA(SfxUInt16Item),"falscher Parameter");
+ DBG_ASSERT(dynamic_cast< const SfxUInt16Item* >(&rItem),"falscher Parameter");
ScAppOptions aNewOpts( GetAppOptions() );
aNewOpts.SetStatusFunc( rItem.GetValue() );
@@ -507,7 +517,7 @@ void ScModule::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs && SFX_ITEM_SET == pReqArgs->GetItemState( GetPool().GetWhich(nSlot), sal_True, &pItem ) )
{
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : NULL;
if ( pDoc )
{
@@ -530,7 +540,7 @@ void ScModule::Execute( SfxRequest& rReq )
ScInputHandler* pInputHandler = GetInputHdl();
if ( pInputHandler )
pInputHandler->UpdateSpellSettings(); // EditEngine-Flags
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
if ( pViewSh )
pViewSh->UpdateDrawTextOutliner(); // EditEngine-Flags
@@ -599,7 +609,7 @@ void ScModule::GetState( SfxItemSet& rSet )
case SID_AUTOSPELL_CHECK:
{
sal_Bool bAuto;
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
if ( pDocSh )
bAuto = pDocSh->GetDocument()->GetDocOptions().IsAutoSpell();
else
@@ -614,7 +624,7 @@ void ScModule::GetState( SfxItemSet& rSet )
case ATTR_CJK_FONT_LANGUAGE: // WID for SID_ATTR_CHAR_CJK_LANGUAGE
case ATTR_CTL_FONT_LANGUAGE: // WID for SID_ATTR_CHAR_CTL_LANGUAGE
{
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : NULL;
if ( pDoc )
{
@@ -969,8 +979,8 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
SfxBindings* pBindings = pViewFrm ? &pViewFrm->GetBindings() : NULL;
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : NULL;
const SfxPoolItem* pItem = NULL;
sal_Bool bRepaint = sal_False;
@@ -1294,20 +1304,20 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
while ( pObjSh )
{
- if ( pObjSh->Type() == TYPE(ScDocShell) )
+ ScDocShell* pDocSh1 = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pDocSh1 )
{
- ScDocShell* pOneDocSh = ((ScDocShell*)pObjSh);
- pOneDocSh->CalcOutputFactor();
- SCTAB nTabCount = pOneDocSh->GetDocument()->GetTableCount();
+ pDocSh1->CalcOutputFactor();
+ SCTAB nTabCount = pDocSh1->GetDocument()->GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
- pOneDocSh->AdjustRowHeight( 0, MAXROW, nTab );
+ pDocSh1->AdjustRowHeight( 0, MAXROW, nTab );
}
pObjSh = SfxObjectShell::GetNext( *pObjSh );
}
// for all (tab-) views:
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( _IsSfxViewShell< ScTabViewShell > );
while ( pSh )
{
ScTabViewShell* pOneViewSh = (ScTabViewShell*)pSh;
@@ -1326,7 +1336,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
pOneViewSh->PaintTop();
pOneViewSh->PaintLeft();
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, _IsSfxViewShell< ScTabViewShell > );
}
}
}
@@ -1350,7 +1360,7 @@ ScInputHandler* ScModule::GetInputHdl( ScTabViewShell* pViewSh, sal_Bool bUseRef
// in case a UIActive embedded object has no ViewShell ( UNO component )
// the own calc view shell will be set as current, but no handling should happen
- ScTabViewShell* pCurViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pCurViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
if ( pCurViewSh && !pCurViewSh->GetUIActiveClient() )
pViewSh = pCurViewSh;
}
@@ -1538,8 +1548,10 @@ void ScModule::SetRefDialog( sal_uInt16 nId, sal_Bool bVis, SfxViewFrame* pViewF
{
// store the dialog id also in the view shell
SfxViewShell* pViewSh = pViewFrm->GetViewShell();
- if ( pViewSh && pViewSh->ISA( ScTabViewShell ) )
+ if ( pViewSh && dynamic_cast< ScTabViewShell* >(pViewSh) )
+ {
((ScTabViewShell*)pViewSh)->SetCurRefDlgId( nCurRefDlgId );
+ }
else
{
// no ScTabViewShell - possible for example from a Basic macro
@@ -1815,7 +1827,7 @@ void lcl_CheckNeedsRepaint( ScDocShell* pDocShell )
while ( pFrame )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( p);
if ( pViewSh )
pViewSh->CheckNeedsRepaint();
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
@@ -1831,7 +1843,7 @@ IMPL_LINK( ScModule, IdleHandler, Timer*, EMPTYARG )
}
sal_Bool bMore = sal_False;
- ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current() );
if ( pDocSh )
{
ScDocument* pDoc = pDocSh->GetDocument();
@@ -1885,7 +1897,7 @@ IMPL_LINK( ScModule, SpellTimerHdl, Timer*, EMPTYARG )
return 0; // dann spaeter wieder...
}
- ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current() );
if ( pDocSh )
{
ScDocument* pDoc = pDocSh->GetDocument();
@@ -1922,14 +1934,12 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId )
SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
0 );
- ScDocShell* pDocSh = PTR_CAST(ScDocShell,
- SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
ScDocOptions aCalcOpt = pDocSh
? pDocSh->GetDocument()->GetDocOptions()
: GetDocOptions();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,
- SfxViewShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
ScViewOptions aViewOpt = pViewSh
? pViewSh->GetViewData()->GetOptions()
: GetViewOptions();
@@ -2031,16 +2041,16 @@ SfxTabPage* ScModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const Sfx
break;
case SID_SC_TP_CALC:
{ //CHINA001 pRet = ScTpCalcOptions::Create(pParent, rSet);
- ::CreateTabPage ScTpCalcOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_CALC );
- if ( ScTpCalcOptionsCreate )
- pRet = (*ScTpCalcOptionsCreate)(pParent, rSet);
+ ::CreateTabPage ScTpCalcOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_CALC );
+ if ( ScTpCalcOptionsCreate )
+ pRet = (*ScTpCalcOptionsCreate)(pParent, rSet);
}
break;
case SID_SC_TP_CHANGES:
{ //CHINA001 pRet = ScRedlineOptionsTabPage::Create(pParent, rSet);
- ::CreateTabPage ScRedlineOptionsTabPageCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_OPREDLINE );
- if ( ScRedlineOptionsTabPageCreate )
- pRet =(*ScRedlineOptionsTabPageCreate)(pParent, rSet);
+ ::CreateTabPage ScRedlineOptionsTabPageCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_OPREDLINE );
+ if ( ScRedlineOptionsTabPageCreate )
+ pRet =(*ScRedlineOptionsTabPageCreate)(pParent, rSet);
}
break;
case RID_SC_TP_PRINT:
@@ -2077,14 +2087,14 @@ IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo )
{
const SvxFieldItem& rField = pInfo->GetField();
const SvxFieldData* pField = rField.GetField();
+ const SvxURLField* pURLField = dynamic_cast< const SvxURLField* >(pField);
- if (pField && pField->ISA(SvxURLField))
+ if (pURLField)
{
/******************************************************************
* URL-Field
******************************************************************/
- const SvxURLField* pURLField = (const SvxURLField*) pField;
String aURL = pURLField->GetURL();
switch ( pURLField->GetFormat() )
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 96d740d6666c..59a4bc3f7e76 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -37,6 +37,7 @@
#include <svx/fmglob.hxx>
#include <svx/svdograf.hxx>
#include <svx/svdouno.hxx>
+#include <svx/svdoole2.hxx>
#include "seltrans.hxx"
#include "transobj.hxx"
@@ -55,7 +56,7 @@ sal_Bool lcl_IsURLButton( SdrObject* pObject )
{
sal_Bool bRet = sal_False;
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObject);
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pObject);
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
@@ -93,27 +94,34 @@ ScSelectionTransferObj* ScSelectionTransferObj::CreateFromView( ScTabView* pView
if ( pSdrView )
{
// handle selection on drawing layer
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
- if ( nMarkCount )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSelection.size())
{
- if ( nMarkCount == 1 )
+ if(1 == aSelection.size())
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(aSelection[0]);
- if ( nSdrObjKind == OBJ_GRAF )
+ if ( pSdrGrafObj )
+ {
+ if ( GRAPHIC_BITMAP == pSdrGrafObj->GetGraphic().GetType() )
{
- if ( ((SdrGrafObj*)pObj)->GetGraphic().GetType() == GRAPHIC_BITMAP )
eMode = SC_SELTRANS_DRAW_BITMAP;
+ }
else
+ {
eMode = SC_SELTRANS_DRAW_GRAPHIC;
}
- else if ( nSdrObjKind == OBJ_OLE2 )
+ }
+ else if ( dynamic_cast< SdrOle2Obj* >(aSelection[0]) )
+ {
eMode = SC_SELTRANS_DRAW_OLE;
- else if ( lcl_IsURLButton( pObj ) )
+ }
+ else if ( lcl_IsURLButton( aSelection[0] ) )
+ {
eMode = SC_SELTRANS_DRAW_BOOKMARK;
}
+ }
if ( eMode == SC_SELTRANS_INVALID )
eMode = SC_SELTRANS_DRAW_OTHER; // something selected but no special selection
@@ -328,7 +336,7 @@ void ScSelectionTransferObj::CreateCellData()
}
//! make static member of ScDrawView
-extern void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle );
+extern void lcl_CheckOle( const SdrObjectVector& rSelection, sal_Bool& rAnyOle, sal_Bool& rOneOle );
void ScSelectionTransferObj::CreateDrawData()
{
@@ -341,8 +349,8 @@ void ScSelectionTransferObj::CreateDrawData()
if ( pDrawView )
{
sal_Bool bAnyOle, bOneOle;
- const SdrMarkList& rMarkList = pDrawView->GetMarkedObjectList();
- lcl_CheckOle( rMarkList, bAnyOle, bOneOle );
+ const SdrObjectVector aSelection(pDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+ lcl_CheckOle( aSelection, bAnyOle, bOneOle );
//---------------------------------------------------------
ScDocShellRef aDragShellRef;
diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx
index 50d87e085c40..194d1eb693b2 100644
--- a/sc/source/ui/app/typemap.cxx
+++ b/sc/source/ui/app/typemap.cxx
@@ -114,14 +114,11 @@
#include <svl/globalnameitem.hxx>
#include <svx/chrtitem.hxx>
#include <svx/zoomslideritem.hxx>
-
-// #i25616#
-#include <svx/sdshitm.hxx>
-
#include <svl/aeitem.hxx>
#include <avmedia/mediaitem.hxx>
#include <sfx2/frame.hxx>
#include "attrib.hxx"
+#include <svx/sdooitm.hxx>
#define SvxDrawToolItem SfxAllEnumItem
#define SvxDrawAlignItem SfxAllEnumItem
diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx
index dfc6f497be39..15c4783da5dc 100644
--- a/sc/source/ui/app/uiitems.cxx
+++ b/sc/source/ui/app/uiitems.cxx
@@ -32,23 +32,6 @@
#include "uiitems.hxx"
#include "dpsave.hxx"
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(ScInputStatusItem, SfxPoolItem);
-TYPEINIT1(ScSortItem, SfxPoolItem);
-TYPEINIT1(ScQueryItem, SfxPoolItem);
-TYPEINIT1(ScSubTotalItem, SfxPoolItem);
-TYPEINIT1(ScUserListItem, SfxPoolItem);
-TYPEINIT1(ScConsolidateItem, SfxPoolItem);
-TYPEINIT1(ScPivotItem, SfxPoolItem);
-TYPEINIT1(ScSolveItem, SfxPoolItem);
-TYPEINIT1(ScTabOpItem, SfxPoolItem);
-TYPEINIT1(ScCondFrmtItem, SfxPoolItem);
-
-TYPEINIT1(ScTablesHint, SfxHint);
-TYPEINIT1(ScEditViewHint, SfxHint);
-TYPEINIT1(ScIndexHint, SfxHint);
-
// -----------------------------------------------------------------------
// ScInputStatusItem - Status-Update fuer Eingabezeile
// -----------------------------------------------------------------------
diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx
index ab588d5c8e1c..225cac3f0296 100644
--- a/sc/source/ui/cctrl/tbinsert.cxx
+++ b/sc/source/ui/cctrl/tbinsert.cxx
@@ -77,7 +77,7 @@ void __EXPORT ScTbxInsertCtrl::StateChanged( sal_uInt16 /* nSID */, SfxItemState
if( eState == SFX_ITEM_AVAILABLE )
{
- const SfxUInt16Item* pItem = PTR_CAST( SfxUInt16Item, pState );
+ const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >( pState );
if(pItem)
{
nLastSlotId = pItem->GetValue();
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 5394d327d362..bff326ff2f02 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -84,7 +84,7 @@ void ScZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState
ScZoomSliderWnd* pBox = (ScZoomSliderWnd*)(rTbx.GetItemWindow( nId ));
DBG_ASSERT( pBox ,"Control not found!" );
- if ( SFX_ITEM_AVAILABLE != eState || pState->ISA( SfxVoidItem ) )
+ if ( SFX_ITEM_AVAILABLE != eState || dynamic_cast< const SfxVoidItem* >(pState) )
{
SvxZoomSliderItem aZoomSliderItem( 100 );
pBox->Disable();
@@ -93,7 +93,7 @@ void ScZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState
else
{
pBox->Enable();
- DBG_ASSERT( pState->ISA( SvxZoomSliderItem ), "invalid item type" );
+ DBG_ASSERT( dynamic_cast< const SvxZoomSliderItem* >(pState), "invalid item type" );
const SvxZoomSliderItem* pZoomSliderItem = dynamic_cast< const SvxZoomSliderItem* >( pState );
DBG_ASSERT( pZoomSliderItem, "Sc::ScZoomSliderControl::StateChanged(), wrong item type!" );
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 9aa87da891d2..77416d773100 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -113,7 +113,7 @@ void ScTPValidationValue:: SetActiveHdl()
}
}
-void ScTPValidationValue::RefInputStartPreHdl( ScRefEdit* pEdit, ScRefButton* pButton )
+void ScTPValidationValue::RefInputStartPreHdl( ScRefEdit* pEdit, ScRefButton* pButton )
{
if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
{
@@ -132,7 +132,7 @@ void ScTPValidationValue::RefInputStartPreHdl( ScRefEdit* pEdit, ScRe
}
}
-void ScTPValidationValue::RefInputDonePreHdl()
+void ScTPValidationValue::RefInputDonePreHdl()
{
if( m_pRefEdit && m_pRefEdit->GetParent()!= this )
@@ -153,7 +153,7 @@ void ScTPValidationValue::RefInputDonePreHdl()
// if( aExample1.GetParent()!=this ) aExample1.SetParent( this );
}
-void ScTPValidationValue::RefInputDonePostHdl()
+void ScTPValidationValue::RefInputDonePostHdl()
{
@@ -983,8 +983,6 @@ bool ScValidationDlg::RemoveRefDlg( sal_Bool bRestoreModal /* = sal_True */ )
return true;
}
-//TYPEINIT1( ScTPValidationValue, SfxTabPage )
-
void ScTPValidationValue::ScRefButtonEx::Click()
{
if( ScTPValidationValue *pParent = dynamic_cast< ScTPValidationValue*>( GetParent() ) )
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 1e9509d81e31..9b0872dbf12d 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -66,8 +66,6 @@ struct AreaLink_Impl
AreaLink_Impl() : m_pDocSh( NULL ), m_pDialog( NULL ) {}
};
-TYPEINIT1(ScAreaLink,::sfx2::SvBaseLink);
-
//------------------------------------------------------------------------
ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const String& rFile,
@@ -86,7 +84,7 @@ ScAreaLink::ScAreaLink( SfxObjectShell* pShell, const String& rFile,
bInCreate (sal_False),
bDoInsert (sal_True)
{
- DBG_ASSERT(pShell->ISA(ScDocShell), "ScAreaLink mit falscher ObjectShell");
+ DBG_ASSERT(dynamic_cast< ScDocShell* >(pShell), "ScAreaLink mit falscher ObjectShell");
pImpl->m_pDocSh = static_cast< ScDocShell* >( pShell );
SetRefreshHandler( LINK( this, ScAreaLink, RefreshHdl ) );
SetRefreshControl( pImpl->m_pDocSh->GetDocument()->GetRefreshTimerControlAddress() );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 1303c26f71c4..91a947aa1415 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4813,8 +4813,9 @@ sal_Bool ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter,
while (nLinkPos<nLinkCount)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[nLinkPos];
- if ( pBase->ISA(ScAreaLink) &&
- static_cast<ScAreaLink*>(pBase)->GetDestArea().aStart == rDestRange.aStart )
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if( pScAreaLink && pScAreaLink->GetDestArea().aStart == rDestRange.aStart )
{
if ( bUndo )
{
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index cbe6b21602be..c2460832677e 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -272,8 +272,6 @@ SFX_IMPL_INTERFACE(ScDocShell,SfxObjectShell, ScResId(SCSTR_DOCSHELL))
// GlobalName der aktuellen Version:
SFX_IMPL_OBJECTFACTORY( ScDocShell, SvGlobalName(SO3_SC_CLASSID), SFXOBJECTSHELL_STD_NORMAL, "scalc" )
-TYPEINIT1( ScDocShell, SfxObjectShell ); // SfxInPlaceObject: kein Type-Info ?
-
//------------------------------------------------------------------
void __EXPORT ScDocShell::FillClass( SvGlobalName* pClassName,
@@ -552,7 +550,7 @@ sal_Bool __EXPORT ScDocShell::Load( SfxMedium& rMedium )
{
if (GetMedium())
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
}
@@ -587,16 +585,17 @@ sal_Bool __EXPORT ScDocShell::Load( SfxMedium& rMedium )
void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if (rHint.ISA(ScTablesHint) )
+ const ScTablesHint* pScHint = dynamic_cast< const ScTablesHint* >( &rHint );
+
+ if (pScHint )
{
- const ScTablesHint& rScHint = static_cast< const ScTablesHint& >( rHint );
- if (rScHint.GetId() == SC_TAB_INSERTED)
+ if (pScHint->GetId() == SC_TAB_INSERTED)
{
uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = aDocument.GetVbaEventProcessor();
if ( xVbaEvents.is() ) try
{
uno::Sequence< uno::Any > aArgs( 1 );
- aArgs[0] <<= rScHint.GetTab1();
+ aArgs[0] <<= pScHint->GetTab1();
xVbaEvents->processVbaEvent( script::vba::VBAEventId::WORKBOOK_NEWSHEET, aArgs );
}
catch( uno::Exception& )
@@ -605,9 +604,14 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
- if (rHint.ISA(SfxSimpleHint)) // ohne Parameter
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
+ const SfxStyleSheetHint* pSfxStyleSheetHint = dynamic_cast< const SfxStyleSheetHint* >( &rHint );
+ const ScAutoStyleHint* pScAutoStyleHint = dynamic_cast< const ScAutoStyleHint* >( &rHint );
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >( &rHint );
+
+ if ( pSfxSimpleHint ) // ohne Parameter
{
- sal_uLong nSlot = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nSlot = pSfxSimpleHint->GetId();
switch ( nSlot )
{
case SFX_HINT_TITLECHANGED:
@@ -617,9 +621,11 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(SfxStyleSheetHint)) // Vorlagen geaendert
- NotifyStyle((const SfxStyleSheetHint&) rHint);
- else if (rHint.ISA(ScAutoStyleHint))
+ else if ( pSfxStyleSheetHint ) // Vorlagen geaendert
+ {
+ NotifyStyle(*pSfxStyleSheetHint);
+ }
+ else if ( pScAutoStyleHint )
{
//! direct call for AutoStyles
@@ -627,19 +633,18 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// modifying the document must be asynchronous
// (handled by AddInitial)
- ScAutoStyleHint& rStlHint = (ScAutoStyleHint&)rHint;
- ScRange aRange = rStlHint.GetRange();
- String aName1 = rStlHint.GetStyle1();
- String aName2 = rStlHint.GetStyle2();
- sal_uInt32 nTimeout = rStlHint.GetTimeout();
+ ScRange aRange = pScAutoStyleHint->GetRange();
+ String aName1 = pScAutoStyleHint->GetStyle1();
+ String aName2 = pScAutoStyleHint->GetStyle2();
+ sal_uInt32 nTimeout = pScAutoStyleHint->GetTimeout();
if (!pAutoStyleList)
pAutoStyleList = new ScAutoStyleList(this);
pAutoStyleList->AddInitial( aRange, aName1, nTimeout, aName2 );
}
- else if ( rHint.ISA( SfxEventHint ) )
+ else if ( pSfxEventHint )
{
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = pSfxEventHint->GetEventId();
switch ( nEventId )
{
case SFX_EVENT_LOADFINISHED:
@@ -845,7 +850,7 @@ void __EXPORT ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
aValues[0].Name = ::rtl::OUString::createFromAscii( "FilterName" );
aValues[0].Value <<= ::rtl::OUString( GetMedium()->GetFilter()->GetFilterName() );
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD);
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
{
aValues.realloc( 2 );
@@ -967,7 +972,7 @@ sal_Bool __EXPORT ScDocShell::LoadFrom( SfxMedium& rMedium )
if (GetMedium())
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
}
@@ -1060,7 +1065,7 @@ sal_Bool __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
// Datei uebertragen wird.
rMedium.GetPhysicalName(); //! CreateFileStream direkt rufen, wenn verfuegbar
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE);
nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : com::sun::star::document::UpdateDocMode::NO_UPDATE;
const SfxFilter* pFilter = rMedium.GetFilter();
@@ -1729,7 +1734,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
String aString;
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
const ScViewOptions& rOpt = (pViewSh)
? pViewSh->GetViewData()->GetOptions()
: aDocument.GetViewOptions();
@@ -2410,7 +2415,7 @@ sal_uInt16 __EXPORT ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsin
if( pFrame )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( p);
if(pViewSh!=NULL)
{
Window *pWin=pViewSh->GetWindow();
@@ -2779,7 +2784,7 @@ SfxDocumentInfoDialog* __EXPORT ScDocShell::CreateDocumentInfoDialog(
Window *pParent, const SfxItemSet &rSet )
{
SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog( pParent, rSet );
- ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
//nur mit Statistik, wenn dieses Doc auch angezeigt wird, nicht
//aus dem Doc-Manager
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 60241737e8a4..f2948206c1c5 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -510,9 +510,10 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
while (pFrame)
{
SfxViewShell* pSh = pFrame->GetViewShell();
- if (pSh && pSh->ISA(ScTabViewShell))
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >(pSh);
+
+ if (pViewSh)
{
- ScTabViewShell* pViewSh = (ScTabViewShell*)pSh;
ScInputHandler* pInputHdl = pScMod->GetInputHdl(pViewSh);
if (pInputHdl)
pInputHdl->UpdateRefDevice();
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index e6def167913b..2f48c6550f97 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -69,6 +69,7 @@ using namespace ::com::sun::star;
#include <svl/PasswordHelper.hxx>
#include <svl/documentlockfile.hxx>
#include <svl/sharecontrolfile.hxx>
+#include <svx/svdlegacy.hxx>
#include <comphelper/processfactory.hxx>
#include "docuno.hxx"
@@ -579,7 +580,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
if(pDoc!=NULL)
{
// get argument (recorded macro)
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FID_CHG_RECORD );
sal_Bool bDo = sal_True;
// xmlsec05/06:
@@ -688,25 +689,25 @@ void ScDocShell::Execute( SfxRequest& rReq )
SfxMedium* pMed = NULL;
if ( pReqArgs &&
pReqArgs->GetItemState( SID_FILE_NAME, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA(SfxStringItem) )
+ dynamic_cast< const SfxStringItem* >(pItem) )
{
String aFileName = ((const SfxStringItem*)pItem)->GetValue();
String aFilterName;
if ( pReqArgs->GetItemState( SID_FILTER_NAME, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA(SfxStringItem) )
+ dynamic_cast< const SfxStringItem* >(pItem) )
{
aFilterName = ((const SfxStringItem*)pItem)->GetValue();
}
String aOptions;
if ( pReqArgs->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA(SfxStringItem) )
+ dynamic_cast< const SfxStringItem* >(pItem) )
{
aOptions = ((const SfxStringItem*)pItem)->GetValue();
}
short nVersion = 0;
if ( pReqArgs->GetItemState( SID_VERSION, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA(SfxInt16Item) )
+ dynamic_cast< const SfxInt16Item* >(pItem) )
{
nVersion = ((const SfxInt16Item*)pItem)->GetValue();
}
@@ -824,7 +825,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
{
- if ( pItem->ISA(SfxStringItem) )
+ if ( dynamic_cast< const SfxStringItem* >(pItem) )
{
String aName = ((const SfxStringItem*)pItem)->GetValue();
SCTAB nTab;
@@ -852,7 +853,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
{
- if ( pItem->ISA(SfxStringItem) )
+ if ( dynamic_cast< const SfxStringItem* >(pItem) )
{
String aName = ((const SfxStringItem*)pItem)->GetValue();
SCTAB nTab;
@@ -904,7 +905,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
{
- if ( pItem->ISA(SfxUInt16Item) )
+ if ( dynamic_cast< const SfxUInt16Item* >(pItem) )
{
sal_uInt16 nY2k = ((SfxUInt16Item*)pItem)->GetValue();
// immer an den DocOptions setzen, damit das auch fuer SO50
@@ -1316,9 +1317,9 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
String aNewName = pStyle->GetName();
String aOldName = aNewName;
- sal_Bool bExtended = rHint.ISA(SfxStyleSheetHintExtended); // Name geaendert?
+ const bool bExtended = dynamic_cast< const SfxStyleSheetHintExtended* >(&rHint); // Name geaendert?
if (bExtended)
- aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
+ aOldName = ((const SfxStyleSheetHintExtended&)rHint).GetOldName();
if ( aNewName != aOldName )
aDocument.RenamePageStyleInUse( aOldName, aNewName );
@@ -1354,9 +1355,9 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
{
String aNewName = pStyle->GetName();
String aOldName = aNewName;
- sal_Bool bExtended = rHint.ISA(SfxStyleSheetHintExtended);
+ const bool bExtended = dynamic_cast< const SfxStyleSheetHintExtended* >(&rHint);
if (bExtended)
- aOldName = ((SfxStyleSheetHintExtended&)rHint).GetOldName();
+ aOldName = ((const SfxStyleSheetHintExtended&)rHint).GetOldName();
if ( aNewName != aOldName )
{
ScConditionalFormatList* pList = aDocument.GetCondFormList();
@@ -2137,7 +2138,7 @@ long __EXPORT ScDocShell::DdeSetData( const String& rItem,
ScViewData* ScDocShell::GetViewData()
{
SfxViewShell* pCur = SfxViewShell::Current();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,pCur);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( pCur);
return pViewSh ? pViewSh->GetViewData() : NULL;
}
@@ -2165,7 +2166,7 @@ ScTabViewShell* ScDocShell::GetBestViewShell( sal_Bool bOnlyVisible )
if( pFrame )
{
SfxViewShell* p = pFrame->GetViewShell();
- pViewSh = PTR_CAST(ScTabViewShell,p);
+ pViewSh = dynamic_cast< ScTabViewShell* >( p);
}
}
return pViewSh;
@@ -2192,7 +2193,7 @@ ScDocShell* ScDocShell::GetShellByNum( sal_uInt16 nDocNo ) // static
while ( pShell && !pFound )
{
- if ( pShell->Type() == TYPE(ScDocShell) )
+ if ( typeid(*pShell) == typeid(ScDocShell) )
{
if ( nShellCnt == nDocNo )
pFound = (ScDocShell*) pShell;
@@ -2233,7 +2234,7 @@ IMPL_LINK( ScDocShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
SfxItemSet* pSet = pMed->GetItemSet();
if ( pSet &&
pSet->GetItemState( SID_VERSION, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA( SfxInt16Item ) )
+ dynamic_cast< const SfxInt16Item* >(pItem) )
{
pImpl->pRequest->AppendItem( *pItem );
}
@@ -2297,7 +2298,7 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument()
if ( GetMedium() )
{
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD);
if ( pPasswordItem && pPasswordItem->GetValue().Len() )
{
aArgs.realloc( 2 );
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index aac6ac05a01a..5590cb5d2cef 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -370,9 +370,10 @@ void ScDocShell::UpdateLinks()
{
--k;
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[k];
- if (pBase->ISA(ScTableLink))
+ ScTableLink* pTabLink = dynamic_cast< ScTableLink* >(pBase);
+
+ if (pTabLink)
{
- ScTableLink* pTabLink = (ScTableLink*)pBase;
if (pTabLink->IsUsed())
{
StrData* pData = new StrData(pTabLink->GetFileName());
@@ -438,9 +439,10 @@ sal_Bool ScDocShell::ReloadTabLinks()
for (sal_uInt16 i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScTableLink))
+ ScTableLink* pTabLink = dynamic_cast< ScTableLink* >(pBase);
+
+ if (pTabLink)
{
- ScTableLink* pTabLink = (ScTableLink*)pBase;
// pTabLink->SetAddUndo(sal_False); //! Undo's zusammenfassen
// Painting only after Update() makes no sense:
// ScTableLink::Refresh() will post a Paint only is bDoPaint is true
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index a4392b24a8f6..096e959eba45 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -106,7 +106,7 @@ enum SylkVersion
ScImportExport::ScImportExport( ScDocument* p )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast< ScDocShell* >( p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( sal_False ), bIncludeFiltered( sal_True ),
bAll( sal_True ), bSingle( sal_True ), bUndo( sal_False ),
@@ -120,7 +120,7 @@ ScImportExport::ScImportExport( ScDocument* p )
ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast< ScDocShell* >( p->GetDocumentShell()) ), pDoc( p ),
aRange( rPt ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( sal_False ), bIncludeFiltered( sal_True ),
@@ -136,7 +136,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
//! ctor with a string (and bSingle=sal_True) is also used for DdeSetData
ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast< ScDocShell* >( p->GetDocumentShell()) ), pDoc( p ),
aRange( r ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( sal_False ), bIncludeFiltered( sal_True ),
@@ -154,7 +154,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
- : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
+ : pDocSh( dynamic_cast< ScDocShell* >( p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
bFormulas( sal_False ), bIncludeFiltered( sal_True ),
bAll( sal_False ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index a30c18e2ff23..7c632cd94d70 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -212,17 +212,22 @@ void __EXPORT ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
if ( &rBC == pDocSh )
{
// from DocShell, only SFX_HINT_DYING is interesting
- if ( rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocSh = NULL;
EndListening(*SFX_APP());
// don't access DocShell anymore for EndListening etc.
}
}
- else if (rBC.ISA(SfxApplication))
+ else if (dynamic_cast< SfxApplication* >(&rBC))
+ {
+ if ( aItemStr.Len() )
{
- if ( aItemStr.Len() && rHint.ISA(SfxSimpleHint) &&
- ((const SfxSimpleHint&)rHint).GetId() == SC_HINT_AREAS_CHANGED )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SC_HINT_AREAS_CHANGED == pSfxSimpleHint->GetId() )
{
// check if named range was modified
ScRange aNew;
@@ -230,25 +235,37 @@ void __EXPORT ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
bDataChanged = sal_True;
}
}
+ }
else
{
// must be from Area broadcasters
+ const ScHint* pScHint = dynamic_cast< const ScHint* >( &rHint );
- const ScHint* pScHint = PTR_CAST( ScHint, &rHint );
if( pScHint && (pScHint->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)) )
+ {
bDataChanged = sal_True;
- else if (rHint.ISA(ScAreaChangedHint)) // position of broadcaster changed
+ }
+ else
{
- ScRange aNewRange = ((const ScAreaChangedHint&)rHint).GetRange();
+ const ScAreaChangedHint* pScAreaChangedHint = dynamic_cast< const ScAreaChangedHint* >( &rHint );
+
+ if (pScAreaChangedHint) // position of broadcaster changed
+ {
+ ScRange aNewRange = pScAreaChangedHint->GetRange();
if ( aRange != aNewRange )
{
bRefreshListener = sal_True;
bDataChanged = sal_True;
}
}
- else if (rHint.ISA(SfxSimpleHint))
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
+
if (nId == SFX_HINT_DYING)
{
// If the range is being deleted, listening must be restarted
@@ -258,6 +275,8 @@ void __EXPORT ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
}
}
+ }
+ }
if ( bDataChanged && HasDataLinks() )
SvLinkSource::NotifyDataChanged();
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 1c0361153db8..388cf6cb6dcb 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -68,8 +68,6 @@ struct TableLink_Impl
TableLink_Impl() : m_pDocSh( NULL ), m_pOldParent( NULL ) {}
};
-TYPEINIT1(ScTableLink, ::sfx2::SvBaseLink);
-
//------------------------------------------------------------------------
ScTableLink::ScTableLink(ScDocShell* pDocSh, const String& rFile,
@@ -466,8 +464,7 @@ sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
String& rFilter, String& rOptions,
sal_Bool bWithContent, sal_Bool bWithInteraction ) // static
{
- TypeId aScType = TYPE(ScDocShell);
- SfxObjectShell* pDocSh = SfxObjectShell::GetFirst( &aScType );
+ SfxObjectShell* pDocSh = SfxObjectShell::GetFirst(_IsObjectShell< ScDocShell >);
while ( pDocSh )
{
if ( pDocSh->HasName() )
@@ -480,7 +477,7 @@ sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
return sal_True;
}
}
- pDocSh = SfxObjectShell::GetNext( *pDocSh, &aScType );
+ pDocSh = SfxObjectShell::GetNext( *pDocSh, _IsObjectShell< ScDocShell > );
}
INetURLObject aUrl( rFileName );
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 7f3df8a037e2..ce6b0f59c333 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -57,7 +57,7 @@ ScDocStatPage::ScDocStatPage( Window *pParent, const SfxItemSet& rSet )
aFtPagesLbl ( this, ScResId( FT_PAGES_LBL ) ),
aFtPages ( this, ScResId( FT_PAGES ) )
{
- ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current() );
ScDocStat aDocStat;
if ( pDocSh )
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index e445499604ac..e8367edfb2c8 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -62,8 +62,6 @@ SFX_IMPL_INTERFACE(ScChartShell, ScDrawShell, ScResId(SCSTR_CHARTSHELL) )
//SFX_OBJECTMENU_REGISTRATION( SID_OBJECTMENU0, ScResId(RID_OBJECTMENU_DRAW) );
}
-TYPEINIT1( ScChartShell, ScDrawShell );
-
ScChartShell::ScChartShell(ScViewData* pData) :
ScDrawShell(pData)
{
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 1142dc4194bf..170c3061dc75 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -72,8 +72,6 @@
//------------------------------------------------------------------
-TYPEINIT1( ScDrawShell, SfxShell );
-
SFX_IMPL_INTERFACE(ScDrawShell, SfxShell, ScResId(SCSTR_DRAWSHELL) )
{
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
@@ -114,12 +112,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
// SfxViewFrame* pViewFrame = SfxViewShell::Current()->GetViewFrame(); //!!! koennte knallen
ScDrawView* pView = pViewData->GetScDrawView();
SdrModel* pDoc = pViewData->GetDocument()->GetDrawLayer();
-
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
- SdrObject* pSingleSelectedObj = NULL;
- if ( nMarkCount > 0 )
- pSingleSelectedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ SdrObject* pSingleSelectedObj = pView->getSelectedIfSingle();
switch ( nSlot )
{
@@ -184,7 +177,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
//=====
}
- if( pView->AreObjectsMarked() )
+ if( pView->areSdrObjectsSelected() )
pView->SetAttrToMarked( *rReq.GetArgs(), sal_False );
else
pView->SetDefaultAttr( *rReq.GetArgs(), sal_False);
@@ -216,18 +209,22 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
break;
case SID_OPEN_HYPERLINK:
- if ( nMarkCount == 1 )
+ if ( pSingleSelectedObj )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if ( pObj->IsGroupObject() )
+ if ( pSingleSelectedObj->GetSubList() )
{
- SdrPageView* pPV = 0;
SdrObject* pHit = 0;
- if ( pView->PickObj( pWin->PixelToLogic( pViewData->GetMousePosPixel() ), pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
- pObj = pHit;
+ const basegfx::B2DPoint aPixelPos(pViewData->GetMousePosPixel().X(), pViewData->GetMousePosPixel().Y())
+ const basegfx::B2DPoint aLogicHitPos(pWin->GetInverseViewTransformation() * aPixelPos);
+
+ if ( pView->PickObj( aLogicHitPos, pView->getHitTolLog(), pHit, SDRSEARCH_DEEP ) )
+ {
+ pSingleSelectedObj = pHit;
+ }
}
- ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
+ ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pSingleSelectedObj );
+
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() );
}
@@ -236,16 +233,17 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
case SID_ATTR_TRANSFORM:
{
- if ( pView->AreObjectsMarked() )
+ if ( pView->areSdrObjectsSelected() )
{
const SfxItemSet* pArgs = rReq.GetArgs();
if( !pArgs )
{
- // const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( rMarkList.GetMark(0) != 0 )
+ const SdrObject* pObj = pView->getSelectedIfSingle();
+
+ if( pObj )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+
if( pObj->GetObjIdentifier() == OBJ_CAPTION )
{
// --------- Itemset fuer Caption --------
@@ -295,11 +293,11 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
}
}
}
-
-
}
else
+ {
pView->SetGeoAttrToMarked( *pArgs );
+ }
}
}
break;
@@ -346,11 +344,11 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
if ( pMacro )
sMacro = pMacro->GetMacName();
- if ( pObj->IsGroupObject() )
+ if ( pObj->getChildrenOfSdrObject() )
{
- SdrObjList* pOL = pObj->GetSubList();
- sal_uLong nObj = pOL->GetObjCount();
- for ( sal_uLong index=0; index<nObj; ++index )
+ SdrObjList* pOL = pObj->getChildrenOfSdrObject();
+ const sal_uInt32 nObj = pOL->GetObjCount();
+ for ( sal_uInt32 index=0; index<nObj; ++index )
{
pInfo = ScDrawLayer::GetMacroInfo( pOL->GetObj(index), sal_True );
pInfo->SetMacro( sMacro );
@@ -369,15 +367,11 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
{
ScDrawView* pView = pViewData->GetScDrawView();
- sal_Bool bHasMarked = pView->AreObjectsMarked();
- const SdrObject* pObj = NULL;
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
-
- if( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ const SdrObject* pObj = pView->getSelectedIfSingle();
+ sal_Bool bHasMarked = pView->areSdrObjectsSelected();
SfxItemSet aNewAttr( pView->GetDefaultAttr() );
- if( bHasMarked )
+ if( pObj )
pView->MergeAttrFromMarked( aNewAttr, sal_False );
//CHINA001 SvxLineTabDialog* pDlg
@@ -394,6 +388,7 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
pObj,
bHasMarked);
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+
if ( nTabPage != 0xffff )
pDlg->SetCurPageId( nTabPage );
@@ -414,7 +409,7 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
{
ScDrawView* pView = pViewData->GetScDrawView();
- sal_Bool bHasMarked = pView->AreObjectsMarked();
+ sal_Bool bHasMarked = pView->areSdrObjectsSelected();
SfxItemSet aNewAttr( pView->GetDefaultAttr() );
if( bHasMarked )
@@ -461,7 +456,7 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, sal_uInt16 /* nTabPage */ )
{
ScDrawView* pView = pViewData->GetScDrawView();
- sal_Bool bHasMarked = pView->AreObjectsMarked();
+ sal_Bool bHasMarked = pView->areSdrObjectsSelected();
SfxItemSet aNewAttr ( pView->GetDefaultAttr() );
if( bHasMarked )
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 6c33e2109f61..062023ef7f67 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -63,7 +63,7 @@ ScDrawShell::ScDrawShell( ScViewData* pData ) :
SfxShell(pData->GetViewShell()),
pViewData( pData )
{
- SetPool( &pViewData->GetScDrawView()->GetModel()->GetItemPool() );
+ SetPool( &pViewData->GetScDrawView()->getSdrModelFromSdrView().GetItemPool() );
::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
@@ -85,7 +85,7 @@ void ScDrawShell::GetState( SfxItemSet& rSet ) // Zustaende / Toggles
rSet.Put( SfxBoolItem( SID_OBJECT_ROTATE, eMode == SDRDRAG_ROTATE ) );
rSet.Put( SfxBoolItem( SID_OBJECT_MIRROR, eMode == SDRDRAG_MIRROR ) );
- rSet.Put( SfxBoolItem( SID_BEZIER_EDIT, !pView->IsFrameDragSingles() ) );
+ rSet.Put( SfxBoolItem( SID_BEZIER_EDIT, !pView->IsFrameHandles() ) );
sal_uInt16 nFWId = ScGetFontWorkId();
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
@@ -93,12 +93,11 @@ void ScDrawShell::GetState( SfxItemSet& rSet ) // Zustaende / Toggles
// Notes always default to Page anchor.
bool bDisableAnchor = false;
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
- if ( nMarkCount == 1 )
+ SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if ( pSelected )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( ScDrawLayer::IsNoteCaption( pObj ) )
+ if( ScDrawLayer::IsNoteCaption( *pSelected ) )
{
bDisableAnchor = true;
rSet.DisableItem( SID_ANCHOR_PAGE );
@@ -132,7 +131,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
{
ScDrawView* pView = pViewData->GetScDrawView();
- // #111711# call IsMirrorAllowed first to make sure ForcePossibilities (and thus CheckMarked)
+ // #111711# call IsMirrorAllowed first to make sure ForcePossibilities
// is called before GetMarkCount, so the nMarkCount value is valid for the rest of this method.
if (!pView->IsMirrorAllowed(sal_True,sal_True))
{
@@ -140,19 +139,18 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
rSet.DisableItem( SID_MIRROR_VERTICAL );
}
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
- if ( nMarkCount <= 1 || !pView->IsGroupPossible() )
+ if ( aSelection.size() <= 1 || !pView->IsGroupPossible() )
rSet.DisableItem( SID_GROUP );
- if ( nMarkCount == 0 || !pView->IsUnGroupPossible() )
+ if ( !aSelection.size() || !pView->IsUnGroupPossible() )
rSet.DisableItem( SID_UNGROUP );
- if ( nMarkCount != 1 || !pView->IsGroupEnterPossible() )
+ if ( aSelection.size() != 1 || !pView->IsGroupEnterPossible() )
rSet.DisableItem( SID_ENTER_GROUP );
if ( !pView->IsGroupEntered() )
rSet.DisableItem( SID_LEAVE_GROUP );
- if ( nMarkCount <= 1 ) // nichts oder nur ein Objekt selektiert
+ if ( aSelection.size() <= 1 ) // nichts oder nur ein Objekt selektiert
{
// Ausrichtung
rSet.DisableItem( SID_OBJECT_ALIGN_LEFT ); // keine Ausrichtung an der Seite
@@ -173,25 +171,25 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
// do not change layer of form controls
// #158385# #i83729# do not change layer of cell notes (on internal layer)
- if ( !nMarkCount || pView->HasMarkedControl() || pView->HasMarkedInternal() )
+ if ( !aSelection.size() || pView->HasMarkedControl() || pView->HasMarkedInternal() )
{
rSet.DisableItem( SID_OBJECT_HEAVEN );
rSet.DisableItem( SID_OBJECT_HELL );
}
else
{
- if(AreAllObjectsOnLayer(SC_LAYER_FRONT,rMarkList))
+ if(AreAllObjectsOnLayer(SC_LAYER_FRONT, aSelection))
{
rSet.DisableItem( SID_OBJECT_HEAVEN );
}
- else if(AreAllObjectsOnLayer(SC_LAYER_BACK,rMarkList))
+ else if(AreAllObjectsOnLayer(SC_LAYER_BACK, aSelection))
{
rSet.DisableItem( SID_OBJECT_HELL );
}
}
sal_Bool bCanRename = sal_False;
- if ( nMarkCount > 1 )
+ if ( aSelection.size() > 1 )
{
#ifdef ISSUE66550_HLINK_FOR_SHAPES
// no hypelink options for a selected group
@@ -200,9 +198,9 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
rSet.DisableItem( SID_OPEN_HYPERLINK );
#endif
}
- else if ( nMarkCount == 1 )
+ else if ( aSelection.size() == 1 )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[0];
#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( !pInfo || (pInfo->GetHlink().getLength() == 0) )
@@ -211,21 +209,22 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
rSet.DisableItem( SID_OPEN_HYPERLINK );
}
#endif
- SdrLayerID nLayerID = pObj->GetLayer();
+ const SdrLayerID nLayerID = pObj->GetLayer();
if ( nLayerID != SC_LAYER_INTERN )
bCanRename = sal_True; // #i51351# anything except internal objects can be renamed
// #91929#; don't show original size entry if not possible
- sal_uInt16 nObjType = pObj->GetObjIdentifier();
- if ( nObjType == OBJ_OLE2 )
+ SdrOle2Obj* pOleObj = dynamic_cast< SdrOle2Obj* >(pObj);
+ SdrCaptionObj* pSdrCaptionObj = dynamic_cast< SdrCaptionObj* >(pObj);
+
+ if(pOleObj)
{
- SdrOle2Obj* pOleObj = static_cast<SdrOle2Obj*>(rMarkList.GetMark( 0 )->GetMarkedSdrObj());
if (pOleObj->GetObjRef().is() &&
((pOleObj->GetObjRef()->getStatus( pOleObj->GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) ) )
//TODO/LATER: why different slots in Draw and Calc?
rSet.DisableItem(SID_ORIGINALSIZE);
}
- else if ( nObjType == OBJ_CAPTION )
+ else if(pSdrCaptionObj)
{
if ( nLayerID == SC_LAYER_INTERN )
{
@@ -245,7 +244,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
rSet.DisableItem( SID_TITLE_DESCRIPTION_OBJECT );
}
- if ( !nMarkCount ) // nichts selektiert
+ if ( !aSelection.size() ) // nichts selektiert
{
// Anordnung
rSet.DisableItem( SID_FRAME_UP );
@@ -265,7 +264,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
if ( rSet.GetItemState( SID_ENABLE_HYPHENATION ) != SFX_ITEM_UNKNOWN )
{
- SfxItemSet aAttrs( pView->GetModel()->GetItemPool() );
+ SfxItemSet aAttrs( pView->getSdrModelFromSdrView().GetItemPool() );
pView->GetAttributes( aAttrs );
if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SFX_ITEM_AVAILABLE )
{
@@ -284,11 +283,9 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
{
- Point aMousePos = pViewData->GetMousePosPixel();
Window* pWindow = pViewData->GetActiveWin();
ScDrawView* pDrView = pViewData->GetScDrawView();
- Point aPos = pWindow->PixelToLogic(aMousePos);
- sal_Bool bHasMarked = pDrView->AreObjectsMarked();
+ sal_Bool bHasMarked = pDrView->areSdrObjectsSelected();
if( bHasMarked )
{
@@ -324,32 +321,36 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
sal_Bool bActionItem = sal_False;
if ( pDrView->IsAction() ) // action rectangle
{
- Rectangle aRect;
- pDrView->TakeActionRect( aRect );
- if ( !aRect.IsEmpty() )
+ basegfx::B2DRange aRange(pDrView->TakeActionRange());
+
+ if(!aRange.isEmpty())
{
- pPV->LogicToPagePos(aRect);
- rSet.Put( SfxPointItem( SID_ATTR_POSITION, aRect.TopLeft() ) );
- Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
- rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize ) );
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-pPV->GetPageOrigin()));
+ const Point aOldTopLeft(basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()));
+ const Size aOldSize(basegfx::fround(aRange.getWidth()), basegfx::fround(aRange.getHeight()));
+
+ rSet.Put( SfxPointItem( SID_ATTR_POSITION, aOldTopLeft ) );
+ rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aOldSize ) );
+
bActionItem = sal_True;
}
}
if ( !bActionItem )
{
- if ( pDrView->AreObjectsMarked() ) // selected objects
+ if ( pDrView->areSdrObjectsSelected() ) // selected objects
{
- Rectangle aRect = pDrView->GetAllMarkedRect();
- pPV->LogicToPagePos(aRect);
- rSet.Put( SfxPointItem( SID_ATTR_POSITION, aRect.TopLeft() ) );
- Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
- rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize ) );
+ const basegfx::B2DRange aRange(basegfx::tools::createTranslateB2DHomMatrix(-pPV->GetPageOrigin()) * pDrView->getMarkedObjectSnapRange());
+
+ rSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()))));
+ rSet.Put(SvxSizeItem(SID_ATTR_SIZE, Size(basegfx::fround(aRange.getWidth()), basegfx::fround(aRange.getHeight()))));
}
else // mouse position
{
// aPos is initialized above
- pPV->LogicToPagePos(aPos);
- rSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos ) );
+ const basegfx::B2DPoint aPos((pWindow->GetInverseViewTransformation() *
+ basegfx::B2DPoint(pViewData->GetMousePosPixel().X(), pViewData->GetMousePosPixel().Y())) - pPV->GetPageOrigin());
+
+ rSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY()))));
rSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
}
}
@@ -373,23 +374,20 @@ void ScDrawShell::GetAttrFuncState(SfxItemSet &rSet)
rSet.DisableItem( SID_ATTRIBUTES_AREA );
}
-sal_Bool ScDrawShell::AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList& rMark)
+bool ScDrawShell::AreAllObjectsOnLayer(sal_uInt16 nLayerNo, const SdrObjectVector& rSelection)
{
- sal_Bool bResult=sal_True;
- sal_uLong nCount = rMark.GetMarkCount();
- for (sal_uLong i=0; i<nCount; i++)
+ for (sal_uInt32 i(0); i < rSelection.size(); i++)
{
- SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
- if ( !pObj->ISA(SdrUnoObj) )
+ if ( !dynamic_cast< SdrUnoObj* >(rSelection[i]) )
{
- if(nLayerNo!=pObj->GetLayer())
+ if(nLayerNo != rSelection[i]->GetLayer())
{
- bResult=sal_False;
- break;
+ return false;
}
}
}
- return bResult;
+
+ return true;
}
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index 2a5fb843436e..cf4690466554 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -47,21 +47,16 @@
void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
{
- const SdrObject* pObj = NULL;
SvxFontWorkDialog* pDlg = NULL;
ScDrawView* pDrView = pViewData->GetScDrawView();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
+ const SdrObject* pObj = pDrView->getSelectedIfSingle();
sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
-
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
+
if ( pViewFrm->HasChildWindow(nId) )
pDlg = (SvxFontWorkDialog*)(pViewFrm->GetChildWindow(nId)->GetWindow());
- if ( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ if ( !pObj || !dynamic_cast< const SdrTextObj* >(pObj) || !static_cast< const SdrTextObj* >(pObj)->HasText() )
{
if ( pDlg )
pDlg->SetActive(sal_False);
@@ -101,7 +96,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
{ DBG_ERROR( "ColorList not found :-/" ); }
}
}
- SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
+ SfxItemSet aViewAttr(pDrView->getSdrModelFromSdrView().GetItemPool());
pDrView->GetAttributes(aViewAttr);
rSet.Set(aViewAttr);
}
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index bab82d87c1d1..fbefdd1e71d9 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -78,25 +78,22 @@ using namespace com::sun::star;
void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
{
ScDrawView* pView = pViewData->GetScDrawView();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ SdrObject* pSelected = pView->getSelectedIfSingle();
// Hyperlink
-
SvxHyperlinkItem aHLinkItem;
- if ( nMarkCount == 1 ) // URL-Button markiert ?
+ if ( pSelected ) // URL-Button markiert ?
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
#ifdef ISSUE66550_HLINK_FOR_SHAPES
- ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
+ ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pSelected );
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
{
aHLinkItem.SetURL( pInfo->GetHlink() );
aHLinkItem.SetInsertMode(HLINK_FIELD);
}
#endif
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pSelected);
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
@@ -178,11 +175,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
if ( eMode == HLINK_FIELD || eMode == HLINK_BUTTON )
{
ScDrawView* pView = pViewData->GetScDrawView();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if ( rMarkList.GetMarkCount() == 1 )
+ SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if ( pSelected )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj );
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pSelected );
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference<awt::XControlModel> xControlModel =
@@ -241,7 +238,7 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
#ifdef ISSUE66550_HLINK_FOR_SHAPES
else
{
- SetHlinkForObject( pObj, rURL );
+ SetHlinkForObject( pSelected, rURL );
bDone = sal_True;
}
#endif
@@ -325,10 +322,10 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
break;
case SID_MIRROR_HORIZONTAL:
- pView->MirrorAllMarkedHorizontal();
+ pView->MirrorMarkedObjHorizontal();
break;
case SID_MIRROR_VERTICAL:
- pView->MirrorAllMarkedVertical();
+ pView->MirrorMarkedObjVertical();
break;
case SID_OBJECT_ALIGN_LEFT:
@@ -424,9 +421,9 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
pView->SetDragMode( eMode );
rBindings.Invalidate( SID_OBJECT_ROTATE );
rBindings.Invalidate( SID_OBJECT_MIRROR );
- if (eMode == SDRDRAG_ROTATE && !pView->IsFrameDragSingles())
+ if (eMode == SDRDRAG_ROTATE && !pView->IsFrameHandles())
{
- pView->SetFrameDragSingles( sal_True );
+ pView->SetFrameHandles(true);
rBindings.Invalidate( SID_BEZIER_EDIT );
}
}
@@ -441,17 +438,17 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
pView->SetDragMode( eMode );
rBindings.Invalidate( SID_OBJECT_ROTATE );
rBindings.Invalidate( SID_OBJECT_MIRROR );
- if (eMode == SDRDRAG_MIRROR && !pView->IsFrameDragSingles())
+ if (eMode == SDRDRAG_MIRROR && !pView->IsFrameHandles())
{
- pView->SetFrameDragSingles( sal_True );
+ pView->SetFrameHandles(true);
rBindings.Invalidate( SID_BEZIER_EDIT );
}
}
break;
case SID_BEZIER_EDIT:
{
- sal_Bool bOld = pView->IsFrameDragSingles();
- pView->SetFrameDragSingles( !bOld );
+ bool bOld(pView->IsFrameHandles());
+ pView->SetFrameHandles( !bOld );
rBindings.Invalidate( SID_BEZIER_EDIT );
if (bOld && pView->GetDragMode() != SDRDRAG_MOVE)
{
@@ -486,7 +483,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
case SID_ENABLE_HYPHENATION:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION );
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
@@ -500,13 +497,10 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
case SID_RENAME_OBJECT:
{
- if(1L == pView->GetMarkedObjectCount())
- {
// #i68101#
- SdrObject* pSelected = pView->GetMarkedObjectByIndex(0L);
- OSL_ENSURE(pSelected, "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
+ SdrObject* pSelected = pView->getSelectedIfSingle();
- if(SC_LAYER_INTERN != pSelected->GetLayer())
+ if(pSelected && SC_LAYER_INTERN != pSelected->GetLayer())
{
String aName(pSelected->GetName());
@@ -564,19 +558,15 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
delete pDlg;
}
- }
break;
}
// #i68101#
case SID_TITLE_DESCRIPTION_OBJECT:
{
- if(1L == pView->GetMarkedObjectCount())
- {
- SdrObject* pSelected = pView->GetMarkedObjectByIndex(0L);
- OSL_ENSURE(pSelected, "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
+ SdrObject* pSelected = pView->getSelectedIfSingle();
- if(SC_LAYER_INTERN != pSelected->GetLayer())
+ if(pSelected && SC_LAYER_INTERN != pSelected->GetLayer())
{
String aTitle(pSelected->GetTitle());
String aDescription(pSelected->GetDescription());
@@ -603,7 +593,6 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
delete pDlg;
}
- }
break;
}
@@ -672,9 +661,9 @@ IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog )
void ScDrawShell::ExecFormText(SfxRequest& rReq)
{
ScDrawView* pDrView = pViewData->GetScDrawView();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
+ SdrObject* pSelected = pDrView->getSelectedIfSingle();
- if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() )
+ if ( pSelected && rReq.GetArgs() )
{
const SfxItemSet& rSet = *rReq.GetArgs();
const SfxPoolItem* pItem;
@@ -694,8 +683,8 @@ void ScDrawShell::ExecFormText(SfxRequest& rReq)
(pViewFrm->
GetChildWindow(nId)->GetWindow());
- pDlg->CreateStdFormObj(*pDrView, *pDrView->GetSdrPageView(),
- rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
+ pDlg->CreateStdFormObj(*pDrView,
+ rSet, *pSelected,
((const XFormTextStdFormItem*) pItem)->
GetValue());
}
@@ -722,7 +711,7 @@ void ScDrawShell::ExecFormatPaintbrush( SfxRequest& rReq )
bLock = static_cast<const SfxBoolItem&>(pArgs->Get(SID_FORMATPAINTBRUSH)).GetValue();
ScDrawView* pDrawView = pViewData->GetScDrawView();
- if ( pDrawView && pDrawView->AreObjectsMarked() )
+ if ( pDrawView && pDrawView->areSdrObjectsSelected() )
{
sal_Bool bOnlyHardAttr = sal_True;
SfxItemSet* pItemSet = new SfxItemSet( pDrawView->GetAttrFromMarked(bOnlyHardAttr) );
@@ -734,7 +723,7 @@ void ScDrawShell::ExecFormatPaintbrush( SfxRequest& rReq )
void ScDrawShell::StateFormatPaintbrush( SfxItemSet& rSet )
{
ScDrawView* pDrawView = pViewData->GetScDrawView();
- sal_Bool bSelection = pDrawView && pDrawView->AreObjectsMarked();
+ sal_Bool bSelection = pDrawView && pDrawView->areSdrObjectsSelected();
sal_Bool bHasPaintBrush = pViewData->GetView()->HasPaintBrush();
if ( !bHasPaintBrush && !bSelection )
diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx
index c4ab05526dc8..9ed40076fff1 100644
--- a/sc/source/ui/drawfunc/drformsh.cxx
+++ b/sc/source/ui/drawfunc/drformsh.cxx
@@ -62,8 +62,6 @@ SFX_IMPL_INTERFACE(ScDrawFormShell, ScDrawShell, ScResId(SCSTR_DRAWFORMSHELL) )
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_DRAWFORM) );
}
-TYPEINIT1( ScDrawFormShell, ScDrawShell );
-
ScDrawFormShell::ScDrawFormShell(ScViewData* pData) :
ScDrawShell(pData)
{
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index fa22a356a711..d8fb3502d887 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -96,10 +96,6 @@ SFX_IMPL_INTERFACE( ScDrawTextObjectBar, SfxShell, ScResId(SCSTR_DRAWTEXTSHELL)
SFX_CHILDWINDOW_REGISTRATION( ScGetFontWorkId() );
}
-TYPEINIT1( ScDrawTextObjectBar, SfxShell );
-
-
-
// abschalten der nicht erwuenschten Acceleratoren:
void ScDrawTextObjectBar::StateDisableItems( SfxItemSet &rSet )
@@ -188,7 +184,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SfxPoolItem* pItem;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, sal_True, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast< const SfxUInt32Item* >(pItem) )
{
nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
}
@@ -233,7 +229,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
aString = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast< const SfxStringItem* >( pFtItem );
if ( pFontItem )
{
String aFontName(pFontItem->GetValue());
@@ -279,8 +275,9 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
if (pFieldItem)
{
- const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField && pField->ISA(SvxURLField) )
+ const SvxURLField* pField = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
+
+ if ( pField )
{
// altes Feld selektieren
@@ -328,11 +325,11 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
if ( pFieldItem )
{
- const SvxFieldData* pField = pFieldItem->GetField();
- if( pField && pField->ISA( SvxURLField ) )
+ const SvxURLField* pField = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
+
+ if( pField )
{
- const SvxURLField* pURLField = static_cast< const SvxURLField* >( pField );
- ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame() );
+ ScGlobal::OpenURL( pField->GetURL(), pField->GetTargetFrame() );
}
}
}
@@ -363,7 +360,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
// Hyphenation is handled above - text edit is ended
case SID_ENABLE_HYPHENATION:
// force loading of hyphenator (object is skipped in repaint)
- ((ScDrawLayer*)pView->GetModel())->UseHyphenator();
+ dynamic_cast< ScDrawLayer& >(pView->getSdrModelFromSdrView()).UseHyphenator();
pOutliner->SetHyphenator( LinguMgr::GetHyphenator() );
ExecuteGlobal( rReq );
break;
@@ -372,7 +369,7 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_THES:
{
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -417,13 +414,13 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
if (pFieldItem)
{
- const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField && pField->ISA(SvxURLField) )
+ const SvxURLField* pField = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
+
+ if ( pField )
{
- const SvxURLField* pURLField = (const SvxURLField*) pField;
- aHLinkItem.SetName( pURLField->GetRepresentation() );
- aHLinkItem.SetURL( pURLField->GetURL() );
- aHLinkItem.SetTargetFrame( pURLField->GetTargetFrame() );
+ aHLinkItem.SetName( pField->GetRepresentation() );
+ aHLinkItem.SetURL( pField->GetURL() );
+ aHLinkItem.SetTargetFrame( pField->GetTargetFrame() );
bField = sal_True;
}
}
@@ -450,7 +447,7 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if ( pFieldItem )
{
const SvxFieldData* pField = pFieldItem->GetField();
- bEnable = pField && pField->ISA( SvxURLField );
+ bEnable = pField && dynamic_cast< const SvxURLField* >(pField);
}
}
if( !bEnable )
@@ -469,7 +466,7 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
if ( rSet.GetItemState( SID_ENABLE_HYPHENATION ) != SFX_ITEM_UNKNOWN )
{
SdrView* pView = pViewData->GetScDrawView();
- SfxItemSet aAttrs( pView->GetModel()->GetItemPool() );
+ SfxItemSet aAttrs( pView->getSdrModelFromSdrView().GetItemPool() );
pView->GetAttributes( aAttrs );
if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SFX_ITEM_AVAILABLE )
{
@@ -588,7 +585,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq )
SfxItemSet aSet( pView->GetDefaultAttr() );
- SfxItemSet aViewAttr(pView->GetModel()->GetItemPool());
+ SfxItemSet aViewAttr(pView->getSdrModelFromSdrView().GetItemPool());
pView->GetAttributes(aViewAttr);
// Unterstreichung
@@ -702,7 +699,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
sal_Bool bArgsInReq = ( pArgs != NULL );
if ( !bArgsInReq )
{
- SfxItemSet aEditAttr(pView->GetModel()->GetItemPool());
+ SfxItemSet aEditAttr(pView->getSdrModelFromSdrView().GetItemPool());
pView->GetAttributes(aEditAttr);
SfxItemSet aNewAttr( *aEditAttr.GetPool(), aEditAttr.GetRanges() );
sal_Bool bDone = sal_True;
@@ -904,7 +901,7 @@ void __EXPORT ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
sal_Bool bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled();
SdrView* pView = pViewData->GetScDrawView();
- SfxItemSet aAttrSet(pView->GetModel()->GetItemPool());
+ SfxItemSet aAttrSet(pView->getSdrModelFromSdrView().GetItemPool());
pView->GetAttributes(aAttrSet);
// direkte Attribute
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index d20b8795f621..fcfe81d08c26 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -60,7 +60,7 @@ sal_uInt16 ScGetFontWorkId()
sal_Bool ScDrawTextObjectBar::IsNoteEdit()
{
- return ScDrawLayer::IsNoteCaption( pViewData->GetView()->GetSdrView()->GetTextEditObject() );
+ return ScDrawLayer::IsNoteCaption( *pViewData->GetView()->GetSdrView()->GetTextEditObject() );
}
// wenn kein Text editiert wird, Funktionen wie in drawsh
@@ -100,7 +100,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
{
- SfxItemSet aAttr( pView->GetModel()->GetItemPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
+ SfxItemSet aAttr( pView->getSdrModelFromSdrView().GetItemPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
aAttr.Put( SvxWritingModeItem(
nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
@@ -113,7 +113,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_ENABLE_HYPHENATION:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_ENABLE_HYPHENATION );
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
@@ -171,7 +171,7 @@ void __EXPORT ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
case SID_ATTR_PARA_LEFT_TO_RIGHT:
case SID_ATTR_PARA_RIGHT_TO_LEFT:
{
- SfxItemSet aAttr( pView->GetModel()->GetItemPool(),
+ SfxItemSet aAttr( pView->getSdrModelFromSdrView().GetItemPool(),
EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
EE_PARA_JUST, EE_PARA_JUST,
0 );
@@ -195,9 +195,9 @@ void ScDrawTextObjectBar::ExecFormText(SfxRequest& rReq)
{
ScTabView* pTabView = pViewData->GetView();
ScDrawView* pDrView = pTabView->GetScDrawView();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
+ SdrObject* pSelected = pDrView->getSelectedIfSingle();
- if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() )
+ if ( pSelected && rReq.GetArgs() )
{
const SfxItemSet& rSet = *rReq.GetArgs();
const SfxPoolItem* pItem;
@@ -217,8 +217,8 @@ void ScDrawTextObjectBar::ExecFormText(SfxRequest& rReq)
(pViewFrm->
GetChildWindow(nId)->GetWindow());
- pDlg->CreateStdFormObj(*pDrView, *pDrView->GetSdrPageView(),
- rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
+ pDlg->CreateStdFormObj(*pDrView,
+ rSet, *pSelected,
((const XFormTextStdFormItem*) pItem)->
GetValue());
}
@@ -229,21 +229,16 @@ void ScDrawTextObjectBar::ExecFormText(SfxRequest& rReq)
void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
{
- const SdrObject* pObj = NULL;
SvxFontWorkDialog* pDlg = NULL;
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
+ const SdrObject* pSelected = pDrView->getSelectedIfSingle();
sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
-
SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
+
if ( pViewFrm->HasChildWindow(nId) )
pDlg = (SvxFontWorkDialog*)(pViewFrm->GetChildWindow(nId)->GetWindow());
- if ( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ if ( !pSelected || !dynamic_cast< const SdrTextObj* >(pSelected) || !static_cast< const SdrTextObj* >(pSelected)->HasText() )
{
if ( pDlg )
pDlg->SetActive(sal_False);
@@ -283,7 +278,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
{ DBG_ERROR( "ColorList not found :-/" ); }
}
}
- SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
+ SfxItemSet aViewAttr(pDrView->getSdrModelFromSdrView().GetItemPool());
pDrView->GetAttributes(aViewAttr);
rSet.Set(aViewAttr);
}
diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx
index 3efee5b7df9c..723243813597 100644
--- a/sc/source/ui/drawfunc/fuconarc.cxx
+++ b/sc/source/ui/drawfunc/fuconarc.cxx
@@ -28,10 +28,8 @@
#include "sc.hrc"
#include "tabvwsh.hxx"
#include "drawview.hxx"
-
-// #98185# Create default drawing objects via keyboard
#include <svx/svdocirc.hxx>
-#include <svx/sxciaitm.hxx>
+#include <svx/svdlegacy.hxx>
/*************************************************************************
|*
@@ -70,9 +68,11 @@ sal_Bool __EXPORT FuConstArc::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.IsLeft() && !pView->IsAction() )
{
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+
pWindow->CaptureMouse();
- pView->BegCreateObj( aPnt );
+ pView->BegCreateObj( aLogicPos );
bReturn = sal_True;
}
return bReturn;
@@ -102,20 +102,13 @@ sal_Bool __EXPORT FuConstArc::MouseButtonUp( const MouseEvent& rMEvt )
sal_Bool bReturn = sal_False;
- if ( pView->IsCreateObj() && rMEvt.IsLeft() )
+ if ( pView->GetCreateObj() && rMEvt.IsLeft() )
{
// Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
pView->EndCreateObj( SDRCREATE_NEXTPOINT );
bReturn = sal_True;
}
-/*
- else if ( pView->IsCreateObj() && rMEvt.IsRight() )
- {
- // Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
- pView->EndCreateObj( SDRCREATE_FORCEEND );
- bReturn = sal_True;
- }
-*/
+
return (FuConstruct::MouseButtonUp(rMEvt) || bReturn);
}
@@ -142,32 +135,35 @@ sal_Bool __EXPORT FuConstArc::KeyInput(const KeyEvent& rKEvt)
void FuConstArc::Activate()
{
- SdrObjKind aObjKind;
+ SdrCircleObjType aSdrCircleObjType(CircleType_Circle);
switch (aSfxRequest.GetSlot() )
{
case SID_DRAW_ARC:
aNewPointer = Pointer( POINTER_DRAW_ARC );
- aObjKind = OBJ_CARC;
+ aSdrCircleObjType = CircleType_Arc;
break;
case SID_DRAW_PIE:
aNewPointer = Pointer( POINTER_DRAW_PIE );
- aObjKind = OBJ_SECT;
+ aSdrCircleObjType = CircleType_Sector;
break;
case SID_DRAW_CIRCLECUT:
aNewPointer = Pointer( POINTER_DRAW_CIRCLECUT );
- aObjKind = OBJ_CCUT;
+ aSdrCircleObjType = CircleType_Segment;
break;
default:
aNewPointer = Pointer( POINTER_CROSS );
- aObjKind = OBJ_CARC;
+ aSdrCircleObjType = CircleType_Arc;
break;
}
- pView->SetCurrentObj( sal::static_int_cast<sal_uInt16>( aObjKind ) );
+ SdrObjectCreationInfo aSdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_CIRC));
+
+ aSdrObjectCreationInfo.setSdrCircleObjType(aSdrCircleObjType);
+ pView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer );
@@ -188,35 +184,33 @@ void FuConstArc::Deactivate()
}
// #98185# Create default drawing objects via keyboard
-SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_DRAW_ARC:
// case SID_DRAW_PIE:
// case SID_DRAW_CIRCLECUT:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- 0L, pDrDoc);
+ pView->getSdrModelFromSdrView(),
+ pView->getSdrObjectCreationInfo());
if(pObj)
{
- if(pObj->ISA(SdrCircObj))
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(pObj);
+
+ if(pSdrCircObj)
{
- Rectangle aRect(rRectangle);
+ basegfx::B2DRange aRange(rRange);
if(SID_DRAW_ARC == nID || SID_DRAW_CIRCLECUT == nID)
{
// force quadratic
- ImpForceQuadratic(aRect);
+ ImpForceQuadratic(aRange);
}
- pObj->SetLogicRect(aRect);
-
- SfxItemSet aAttr(pDrDoc->GetItemPool());
- aAttr.Put(SdrCircStartAngleItem(9000));
- aAttr.Put(SdrCircEndAngleItem(0));
-
- pObj->SetMergedItemSet(aAttr);
+ sdr::legacy::SetLogicRange(*pSdrCircObj, aRange);
+ pSdrCircObj->SetStartAngle(F_PI2 * 3.0); // TTTT formally 9000, needs check (mirroring?)
+ pSdrCircObj->SetEndAngle(0.0);
}
else
{
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index f5fdc8cdf1f6..33707b83737e 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -33,12 +33,12 @@
#include <svx/svdpage.hxx>
#include <svx/svdoashp.hxx>
#include <editeng/eeitem.hxx>
-#include <svx/sdtagitm.hxx>
#include "fuconuno.hxx"
#include "tabvwsh.hxx"
#include "sc.hrc"
#include "drawview.hxx"
#include <editeng/adjitem.hxx>
+#include <svx/svdlegacy.hxx>
#include <math.h>
@@ -79,9 +79,11 @@ sal_Bool __EXPORT FuConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
if ( rMEvt.IsLeft() && !pView->IsAction() )
{
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+
pWindow->CaptureMouse();
- pView->BegCreateObj(aPnt);
+ pView->BegCreateObj(aLogicPos);
SdrObject* pObj = pView->GetCreateObj();
if ( pObj )
@@ -127,7 +129,7 @@ sal_Bool __EXPORT FuConstCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool bReturn = sal_False;
- if ( pView->IsCreateObj() && rMEvt.IsLeft() )
+ if ( pView->GetCreateObj() && rMEvt.IsLeft() )
{
Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
pView->EndCreateObj(SDRCREATE_FORCEEND);
@@ -159,13 +161,13 @@ sal_Bool __EXPORT FuConstCustomShape::KeyInput(const KeyEvent& rKEvt)
void FuConstCustomShape::Activate()
{
- pView->SetCurrentObj( OBJ_CUSTOMSHAPE, SdrInventor );
+ pView->setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_CUSTOMSHAPE, SdrInventor));
aNewPointer = Pointer( POINTER_DRAW_RECT );
aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer );
- SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
+ SdrLayer* pLayer = pView->getSdrModelFromSdrView().GetModelLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
if (pLayer)
pView->SetActiveLayer( pLayer->GetName() );
@@ -182,7 +184,7 @@ void FuConstCustomShape::Deactivate()
{
FuConstruct::Deactivate();
- SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_FRONT);
+ SdrLayer* pLayer = pView->getSdrModelFromSdrView().GetModelLayerAdmin().GetLayerPerID(SC_LAYER_FRONT);
if (pLayer)
pView->SetActiveLayer( pLayer->GetName() );
@@ -190,18 +192,23 @@ void FuConstCustomShape::Deactivate()
}
// #98185# Create default drawing objects via keyboard
-SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, const Rectangle& rRectangle)
+SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, const basegfx::B2DRange& rRange)
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- 0L, pDrDoc);
+ pView->getSdrModelFromSdrView(),
+ pView->getSdrObjectCreationInfo());
+
if( pObj )
{
- Rectangle aRectangle( rRectangle );
+ basegfx::B2DRange aRange( rRange );
SetAttributes( pObj );
+
if ( SdrObjCustomShape::doConstructOrthogonal( aCustomShape ) )
- ImpForceQuadratic( aRectangle );
- pObj->SetLogicRect( aRectangle );
+ {
+ ImpForceQuadratic( aRange );
+ }
+
+ sdr::legacy::SetLogicRange(*pObj, aRange );
}
return pObj;
}
@@ -235,7 +242,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
if( pSourceObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
- SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
+ SfxItemSet aDest( pObj->GetObjectItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
@@ -251,11 +258,11 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
0, 0);
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
- sal_Int32 nAngle = pSourceObj->GetRotateAngle();
+
+ const sal_Int32 nAngle(sdr::legacy::GetRotateAngle(*pSourceObj));
if ( nAngle )
{
- double a = nAngle * F_PI18000;
- pObj->NbcRotate( pObj->GetSnapRect().Center(), nAngle, sin( a ), cos( a ) );
+ sdr::legacy::RotateSdrObject(*pObj, sdr::legacy::GetSnapRect(*pObj).Center(), nAngle);
}
bAttributesAppliedFromGallery = sal_True;
}
@@ -270,7 +277,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER, 0 ) );
pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
- pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ pObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
((SdrObjCustomShape*)pObj)->MergeDefaultAttributes( &aCustomShape );
}
}
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index c67b932ed674..829d0be06240 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -33,6 +33,7 @@
#include <svx/svdopath.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/point/b2dpoint.hxx>
+#include <svx/svdlegacy.hxx>
// Pixelabstand zum Schliessen von Freihand-Zeichnungen
#ifndef CLOSE_PIXDIST
@@ -78,10 +79,10 @@ sal_Bool __EXPORT FuConstPolygon::MouseButtonDown(const MouseEvent& rMEvt)
SdrViewEvent aVEvt;
(void)pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- if (aVEvt.eEvent == SDREVENT_BEGTEXTEDIT)
+ if (aVEvt.meEvent == SDREVENT_BEGTEXTEDIT)
{
// Texteingabe hier nicht zulassen
- aVEvt.eEvent = SDREVENT_BEGDRAGOBJ;
+ aVEvt.meEvent = SDREVENT_BEGDRAGOBJ;
pView->EnableExtendedMouseEventDispatcher(sal_False);
}
else
@@ -127,7 +128,7 @@ sal_Bool __EXPORT FuConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
pView->MouseButtonUp(rMEvt, pWindow);
- if (aVEvt.eEvent == SDREVENT_ENDCREATE)
+ if (aVEvt.meEvent == SDREVENT_ENDCREATE)
{
bReturn = sal_True;
bSimple = sal_True; // Doppelklick nicht weiterreichen
@@ -167,62 +168,60 @@ sal_Bool __EXPORT FuConstPolygon::KeyInput(const KeyEvent& rKEvt)
void FuConstPolygon::Activate()
{
pView->EnableExtendedMouseEventDispatcher(sal_True);
-
- SdrObjKind eKind;
+ SdrObjectCreationInfo aSdrObjectCreationInfo;
switch (GetSlotID())
{
case SID_DRAW_POLYGON_NOFILL:
case SID_DRAW_XPOLYGON_NOFILL:
{
- eKind = OBJ_PLIN;
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenPolygon);
}
break;
case SID_DRAW_POLYGON:
case SID_DRAW_XPOLYGON:
{
- eKind = OBJ_POLY;
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_ClosedPolygon);
}
break;
case SID_DRAW_BEZIER_NOFILL:
{
- eKind = OBJ_PATHLINE;
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenBezier);
}
break;
case SID_DRAW_BEZIER_FILL:
{
- eKind = OBJ_PATHFILL;
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_ClosedBezier);
}
break;
case SID_DRAW_FREELINE_NOFILL:
{
- eKind = OBJ_FREELINE;
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenBezier);
+ aSdrObjectCreationInfo.setFreehandMode(true);
}
break;
case SID_DRAW_FREELINE:
{
- eKind = OBJ_FREEFILL;
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_ClosedBezier);
+ aSdrObjectCreationInfo.setFreehandMode(true);
}
break;
default:
{
- eKind = OBJ_PATHLINE;
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenBezier);
}
break;
}
- pView->SetCurrentObj(sal::static_int_cast<sal_uInt16>(eKind));
-
- pView->SetEditMode(SDREDITMODE_CREATE);
-
+ pView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
+ pView->SetViewEditMode(SDREDITMODE_CREATE);
FuConstruct::Activate();
-
aNewPointer = Pointer( POINTER_DRAW_POLYGON );
aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer );
@@ -236,7 +235,7 @@ void FuConstPolygon::Activate()
void FuConstPolygon::Deactivate()
{
- pView->SetEditMode(SDREDITMODE_EDIT);
+ pView->SetViewEditMode(SDREDITMODE_EDIT);
pView->EnableExtendedMouseEventDispatcher(sal_False);
@@ -246,7 +245,7 @@ void FuConstPolygon::Deactivate()
}
// #98185# Create default drawing objects via keyboard
-SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_DRAW_POLYGON:
// case SID_DRAW_POLYGON_NOFILL:
@@ -254,12 +253,14 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
// case SID_DRAW_FREELINE_NOFILL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- 0L, pDrDoc);
+ pView->getSdrModelFromSdrView(),
+ pView->getSdrObjectCreationInfo());
if(pObj)
{
- if(pObj->ISA(SdrPathObj))
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
{
basegfx::B2DPolyPolygon aPoly;
@@ -269,19 +270,19 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
{
basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
- const basegfx::B2DPoint aCenterBottom(rRectangle.Center().X(), rRectangle.Bottom());
+ const basegfx::B2DPoint aCenterBottom(rRange.getCenterX(), rRange.getMaxY());
aInnerPoly.appendBezierSegment(
aCenterBottom,
aCenterBottom,
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
+ rRange.getCenter());
- const basegfx::B2DPoint aCenterTop(rRectangle.Center().X(), rRectangle.Top());
+ const basegfx::B2DPoint aCenterTop(rRange.getCenterX(), rRange.getMinY());
aInnerPoly.appendBezierSegment(
aCenterTop,
aCenterTop,
- basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
+ basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY()));
aPoly.append(aInnerPoly);
break;
@@ -290,17 +291,17 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
{
basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()),
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()),
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
+ rRange.getMinimum(),
+ basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()),
+ rRange.getCenter());
aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()),
- basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()),
- basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
+ basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()),
+ basegfx::B2DPoint(rRange.getMaxX(), rRange.getMaxY()),
+ basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY()));
aPoly.append(aInnerPoly);
break;
@@ -309,21 +310,21 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
case SID_DRAW_POLYGON_NOFILL:
{
basegfx::B2DPolygon aInnerPoly;
- const sal_Int32 nWdt(rRectangle.GetWidth());
- const sal_Int32 nHgt(rRectangle.GetHeight());
-
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 30) / 100, rRectangle.Top() + (nHgt * 70) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top() + (nHgt * 15) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 65) / 100, rRectangle.Top()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + nWdt, rRectangle.Top() + (nHgt * 30) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 50) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 75) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Bottom(), rRectangle.Right()));
+ const double fWdt(rRange.getWidth());
+ const double fHgt(rRange.getHeight());
+
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.3, rRange.getMinY() + fHgt * 0.7));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + fHgt * 0.15));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.65, rRange.getMinY()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt, rRange.getMinY() + fHgt * 0.3));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.5));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.75));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxY(), rRange.getMaxX()));
if(SID_DRAW_POLYGON_NOFILL == nID)
{
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()));
}
else
{
@@ -335,14 +336,14 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
}
}
- ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly);
}
else
{
DBG_ERROR("Object is NO path object");
}
- pObj->SetLogicRect(rRectangle);
+ sdr::legacy::SetLogicRange(*pObj, rRange);
}
return pObj;
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 6330c5991bc4..06a2533bdc13 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -28,13 +28,13 @@
#include "tabvwsh.hxx"
#include "sc.hrc"
#include "drawview.hxx"
-
#include <editeng/outlobj.hxx>
-// #98185# Create default drawing objects via keyboard
#include <svx/svdopath.hxx>
#include <svx/svdocapt.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/point/b2dpoint.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/sdrobjectfactory.hxx>
#include "scresid.hxx"
@@ -78,20 +78,21 @@ sal_Bool __EXPORT FuConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
if ( rMEvt.IsLeft() && !pView->IsAction() )
{
- Point aPos( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
pWindow->CaptureMouse();
- if ( pView->GetCurrentObjIdentifier() == OBJ_CAPTION )
+ if ( OBJ_CAPTION == pView->getSdrObjectCreationInfo().getIdent() )
{
- Size aCaptionSize ( 2268, 1134 ); // 4x2cm
-
- bReturn = pView->BegCreateCaptionObj( aPos, aCaptionSize );
+ bReturn = pView->BegCreateCaptionObj( aLogicPos, basegfx::B2DVector(2268.0, 1134.0)); // 4x2cm
// wie stellt man den Font ein, mit dem geschrieben wird
}
else
- bReturn = pView->BegCreateObj(aPos);
+ {
+ bReturn = pView->BegCreateObj(aLogicPos);
+ }
}
return bReturn;
}
@@ -120,7 +121,7 @@ sal_Bool __EXPORT FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool bReturn = sal_False;
- if ( pView->IsCreateObj() && rMEvt.IsLeft() )
+ if ( pView->GetCreateObj() && rMEvt.IsLeft() )
{
Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
pView->EndCreateObj(SDRCREATE_FORCEEND);
@@ -128,15 +129,18 @@ sal_Bool __EXPORT FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
if (aSfxRequest.GetSlot() == SID_DRAW_CAPTION_VERTICAL)
{
// set vertical flag for caption object
+ SdrObject* pSelected = pView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMark(0))
+ if (pSelected)
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
// create OutlinerParaObject now so it can be set to vertical
- if ( pObj->ISA(SdrTextObj) )
- ((SdrTextObj*)pObj)->ForceOutlinerParaObject();
- OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pSelected);
+
+ if ( pSdrTextObj )
+ pSdrTextObj->ForceOutlinerParaObject();
+
+ OutlinerParaObject* pOPO = pSelected->GetOutlinerParaObject();
+
if( pOPO && !pOPO->IsVertical() )
pOPO->SetVertical( sal_True );
}
@@ -170,41 +174,39 @@ sal_Bool __EXPORT FuConstRectangle::KeyInput(const KeyEvent& rKEvt)
void FuConstRectangle::Activate()
{
- SdrObjKind aObjKind;
+ SdrObjectCreationInfo aSdrObjectCreationInfo(OBJ_RECT);
switch (aSfxRequest.GetSlot() )
{
case SID_DRAW_LINE:
aNewPointer = Pointer( POINTER_DRAW_LINE );
- aObjKind = OBJ_LINE;
+ aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_Line);
break;
case SID_DRAW_RECT:
aNewPointer = Pointer( POINTER_DRAW_RECT );
- aObjKind = OBJ_RECT;
break;
case SID_DRAW_ELLIPSE:
+ aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
aNewPointer = Pointer( POINTER_DRAW_ELLIPSE );
- aObjKind = OBJ_CIRC;
break;
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
+ aSdrObjectCreationInfo.setIdent(OBJ_CAPTION);
aNewPointer = Pointer( POINTER_DRAW_CAPTION );
- aObjKind = OBJ_CAPTION;
break;
default:
aNewPointer = Pointer( POINTER_CROSS );
- aObjKind = OBJ_RECT;
break;
}
- pView->SetCurrentObj(sal::static_int_cast<sal_uInt16>(aObjKind));
-
+ pView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
aOldPointer = pWindow->GetPointer();
- pViewShell->SetActivePointer( aNewPointer );
+ pViewShell->SetActivePointer(aNewPointer);
FuConstruct::Activate();
}
@@ -222,7 +224,7 @@ void FuConstRectangle::Deactivate()
}
// #98185# Create default drawing objects via keyboard
-SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_DRAW_LINE:
// case SID_DRAW_RECT:
@@ -231,26 +233,24 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
// case SID_DRAW_CAPTION_VERTICAL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- 0L, pDrDoc);
+ pView->getSdrModelFromSdrView(),
+ pView->getSdrObjectCreationInfo());
if(pObj)
{
- Rectangle aRect(rRectangle);
- Point aStart = aRect.TopLeft();
- Point aEnd = aRect.BottomRight();
-
switch(nID)
{
case SID_DRAW_LINE:
{
- if(pObj->ISA(SdrPathObj))
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
{
- sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
+ const double fYMiddle((rRange.getMinY() + rRange.getMaxY()) * 0.5);
basegfx::B2DPolygon aPoly;
- aPoly.append(basegfx::B2DPoint(aStart.X(), nYMiddle));
- aPoly.append(basegfx::B2DPoint(aEnd.X(), nYMiddle));
- ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aPoly));
+ aPoly.append(basegfx::B2DPoint(rRange.getMinX(), fYMiddle));
+ aPoly.append(basegfx::B2DPoint(rRange.getMaxX(), fYMiddle));
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aPoly));
}
else
{
@@ -262,29 +262,30 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
{
- if(pObj->ISA(SdrCaptionObj))
+ SdrCaptionObj* pSdrCaptionObj = dynamic_cast< SdrCaptionObj* >(pObj);
+
+ if(pSdrCaptionObj)
{
sal_Bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID);
- ((SdrTextObj*)pObj)->SetVerticalWriting(bIsVertical);
+ pSdrCaptionObj->SetVerticalWriting(bIsVertical);
if(bIsVertical)
{
- SfxItemSet aSet(pObj->GetMergedItemSet());
+ SfxItemSet aSet(pSdrCaptionObj->GetMergedItemSet());
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
- pObj->SetMergedItemSet(aSet);
+ pSdrCaptionObj->SetMergedItemSet(aSet);
}
// #105815# don't set default text, start edit mode instead
// (Edit mode is started in ScTabViewShell::ExecDraw, because
// it must be handled by FuText)
// String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
- // ((SdrCaptionObj*)pObj)->SetText(aText);
+ // pSdrCaptionObj->SetText(aText);
- ((SdrCaptionObj*)pObj)->SetLogicRect(aRect);
- ((SdrCaptionObj*)pObj)->SetTailPos(
- aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
+ sdr::legacy::SetLogicRange(*pSdrCaptionObj, rRange);
+ pSdrCaptionObj->SetTailPos(rRange.getMinimum() - (rRange.getRange() * 0.5));
}
else
{
@@ -296,7 +297,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec
default:
{
- pObj->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pObj, rRange);
break;
}
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 48c968083d34..dd2aa792be91 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -94,7 +94,7 @@ sal_Bool __EXPORT FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
aDragTimer.Start();
- aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
+ aMDPos = pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
if ( rMEvt.IsLeft() )
{
@@ -102,12 +102,13 @@ sal_Bool __EXPORT FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
SdrHdl* pHdl = pView->PickHandle(aMDPos);
- if ( pHdl != NULL || pView->IsMarkedHit(aMDPos) )
+ if ( pHdl != NULL || pView->IsMarkedObjHit(aMDPos) )
{
- pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, 1);
+ const double fTolerance(basegfx::B2DVector(pWindow->GetInverseViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength());
+ pView->BegDragObj(aMDPos, pHdl, fTolerance);
bReturn = sal_True;
}
- else if ( pView->AreObjectsMarked() )
+ else if ( pView->areSdrObjectsSelected() )
{
pView->UnmarkAll();
bReturn = sal_True;
@@ -131,30 +132,31 @@ sal_Bool __EXPORT FuConstruct::MouseMove(const MouseEvent& rMEvt)
if (aDragTimer.IsActive() )
{
- Point aOldPixel = pWindow->LogicToPixel( aMDPos );
- Point aNewPixel = rMEvt.GetPosPixel();
- if ( Abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE ||
- Abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE )
+ const basegfx::B2DPoint aOldPixel(pWindow->GetViewTransformation() * aMDPos);
+ const basegfx::B2DPoint aNewPixel(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+
+ if ( fabs( aOldPixel.getX() - aNewPixel.getX() ) > SC_MAXDRAGMOVE ||
+ fabs( aOldPixel.getY() - aNewPixel.getY() ) > SC_MAXDRAGMOVE )
aDragTimer.Stop();
}
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt( pWindow->PixelToLogic(aPix) );
+ const Point aPix(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(aPix.X(), aPix.Y()));
if ( pView->IsAction() )
{
ForceScroll(aPix);
- pView->MovAction(aPnt);
+ pView->MovAction(aLogicPos);
}
else
{
- SdrHdl* pHdl=pView->PickHandle(aPnt);
+ SdrHdl* pHdl = pView->PickHandle(aLogicPos);
- if ( pHdl != NULL )
+ if ( pHdl )
{
pViewShell->SetActivePointer(pHdl->GetPointer());
}
- else if ( pView->IsMarkedHit(aPnt) )
+ else if ( pView->IsMarkedObjHit(aLogicPos) )
{
pViewShell->SetActivePointer(Pointer(POINTER_MOVE));
}
@@ -184,18 +186,16 @@ sal_Bool __EXPORT FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
sal_uInt16 nClicks = rMEvt.GetClicks();
if ( nClicks == 2 && rMEvt.IsLeft() )
{
- if ( pView->AreObjectsMarked() )
- {
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ if ( pView->areSdrObjectsSelected() )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
+ SdrObject* pSelected = pView->getSelectedIfSingle();
+ if (pSelected)
+ {
// #49458# bei Uno-Controls nicht in Textmodus
- if ( pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) )
+ if ( dynamic_cast< SdrTextObj* >(pSelected) && !dynamic_cast< SdrUnoObj* >(pSelected) )
{
- OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
+ OutlinerParaObject* pOPO = pSelected->GetOutlinerParaObject();
sal_Bool bVertical = ( pOPO && pOPO->IsVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
@@ -208,7 +208,7 @@ sal_Bool __EXPORT FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
{
FuText* pText = (FuText*)pPoor;
Point aMousePixel = rMEvt.GetPosPixel();
- pText->SetInEditMode( pObj, &aMousePixel );
+ pText->SetInEditMode( pSelected, &aMousePixel );
}
bReturn = sal_True;
}
@@ -232,7 +232,8 @@ sal_Bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt)
aDragTimer.Stop();
}
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aPnt(pWindow->GetInverseViewTransformation() * aPixelPos);
if ( pView->IsDragObj() )
pView->EndDragObj( rMEvt.IsMod1() );
@@ -246,12 +247,12 @@ sal_Bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt)
{
pWindow->ReleaseMouse();
- if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 )
+ if ( !pView->areSdrObjectsSelected() && rMEvt.GetClicks() < 2 )
{
- pView->MarkObj(aPnt, -2, sal_False, rMEvt.IsMod1());
+ pView->MarkObj(aPnt, 2.0, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
- if ( pView->AreObjectsMarked() )
+ if ( pView->areSdrObjectsSelected() )
rDisp.Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
else
rDisp.Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx
index 5f900a1b553c..a20f5dbf71c1 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -28,6 +28,7 @@
#include "tabvwsh.hxx"
#include "sc.hrc"
#include "drawview.hxx"
+#include <svx/svdlegacy.hxx>
/*************************************************************************
|*
@@ -39,8 +40,8 @@ FuConstUnoControl::FuConstUnoControl(ScTabViewShell* pViewSh, Window* pWin, ScDr
SdrModel* pDoc, SfxRequest& rReq)
: FuConstruct(pViewSh, pWin, pViewP, pDoc, rReq)
{
- SFX_REQUEST_ARG( rReq, pInventorItem, SfxUInt32Item, SID_FM_CONTROL_INVENTOR, sal_False );
- SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER, sal_False );
+ SFX_REQUEST_ARG( rReq, pInventorItem, SfxUInt32Item, SID_FM_CONTROL_INVENTOR );
+ SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER );
if( pInventorItem )
nInventor = pInventorItem->GetValue();
if( pIdentifierItem )
@@ -72,9 +73,11 @@ sal_Bool __EXPORT FuConstUnoControl::MouseButtonDown(const MouseEvent& rMEvt)
if ( rMEvt.IsLeft() && !pView->IsAction() )
{
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+
pWindow->CaptureMouse();
- pView->BegCreateObj(aPnt);
+ pView->BegCreateObj(aLogicPos);
bReturn = sal_True;
}
return bReturn;
@@ -104,7 +107,7 @@ sal_Bool __EXPORT FuConstUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool bReturn = sal_False;
- if ( pView->IsCreateObj() && rMEvt.IsLeft() )
+ if ( pView->GetCreateObj() && rMEvt.IsLeft() )
{
Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
pView->EndCreateObj(SDRCREATE_FORCEEND);
@@ -136,13 +139,13 @@ sal_Bool __EXPORT FuConstUnoControl::KeyInput(const KeyEvent& rKEvt)
void FuConstUnoControl::Activate()
{
- pView->SetCurrentObj( nIdentifier, nInventor );
+ pView->setSdrObjectCreationInfo(SdrObjectCreationInfo(nIdentifier, nInventor));
aNewPointer = Pointer( POINTER_DRAW_RECT );
aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer );
- SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
+ SdrLayer* pLayer = pView->getSdrModelFromSdrView().GetModelLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
if (pLayer)
pView->SetActiveLayer( pLayer->GetName() );
@@ -159,7 +162,7 @@ void FuConstUnoControl::Deactivate()
{
FuConstruct::Deactivate();
- SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_FRONT);
+ SdrLayer* pLayer = pView->getSdrModelFromSdrView().GetModelLayerAdmin().GetLayerPerID(SC_LAYER_FRONT);
if (pLayer)
pView->SetActiveLayer( pLayer->GetName() );
@@ -167,17 +170,17 @@ void FuConstUnoControl::Deactivate()
}
// #98185# Create default drawing objects via keyboard
-SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, const Rectangle& rRectangle)
+SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, const basegfx::B2DRange& rRange)
{
// case SID_FM_CREATE_CONTROL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- 0L, pDrDoc);
+ pView->getSdrModelFromSdrView(),
+ pView->getSdrObjectCreationInfo());
if(pObj)
{
- pObj->SetLogicRect(rRectangle);
+ sdr::legacy::SetLogicRange(*pObj, rRange);
}
return pObj;
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index cf91e1908a89..bda53f4d48ef 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -86,19 +86,19 @@ void FuDraw::DoModifiers(const MouseEvent& rMEvt)
// Control = Snap (Toggle)
// Alt = zentrisch
- sal_Bool bShift = rMEvt.IsShift();
-// sal_Bool bCtrl = rMEvt.IsMod1();
- sal_Bool bAlt = rMEvt.IsMod2();
+ bool bShift = rMEvt.IsShift();
+// bool bCtrl = rMEvt.IsMod1();
+ bool bAlt = rMEvt.IsMod2();
// ScViewData* pViewData = pViewShell->GetViewData();
// const ScViewOptions& rOpt = pViewData->GetOptions();
// const ScGridOptions& rGrid = rOpt.GetGridOptions();
-// sal_Bool bGridOpt = rGrid.GetUseGridSnap();
+// bool bGridOpt = rGrid.GetUseGridSnap();
- sal_Bool bOrtho = bShift;
- sal_Bool bAngleSnap = bShift;
-// sal_Bool bGridSnap = ( bGridOpt != bCtrl ); // andere Snap's nicht unterstuetzt
- sal_Bool bCenter = bAlt;
+ bool bOrtho = bShift;
+ bool bAngleSnap = bShift;
+// bool bGridSnap = ( bGridOpt != bCtrl ); // andere Snap's nicht unterstuetzt
+ bool bCenter = bAlt;
// #i33136#
if(doConstructOrthogonal())
@@ -106,23 +106,37 @@ void FuDraw::DoModifiers(const MouseEvent& rMEvt)
bOrtho = !bShift;
}
- if (pView->IsOrtho() != bOrtho)
- pView->SetOrtho(bOrtho);
+ if (pView->IsOrthogonal() != bOrtho)
+ {
+ pView->SetOrthogonal(bOrtho);
+ }
+
if (pView->IsAngleSnapEnabled() != bAngleSnap)
+ {
pView->SetAngleSnapEnabled(bAngleSnap);
+ }
/* Control fuer Snap beisst sich beim Verschieben mit "kopieren" !!!
if (pView->IsGridSnap() != bGridSnap)
+ {
pView->SetGridSnap(bGridSnap);
+ }
+
if (pView->IsSnapEnabled() != bGridSnap)
+ {
pView->SetSnapEnabled(bGridSnap);
+ }
*/
if (pView->IsCreate1stPointAsCenter() != bCenter)
+ {
pView->SetCreate1stPointAsCenter(bCenter);
+ }
+
if (pView->IsResizeAtCenter() != bCenter)
+ {
pView->SetResizeAtCenter(bCenter);
-
+ }
}
void FuDraw::ResetModifiers()
@@ -130,22 +144,34 @@ void FuDraw::ResetModifiers()
ScViewData* pViewData = pViewShell->GetViewData();
const ScViewOptions& rOpt = pViewData->GetOptions();
const ScGridOptions& rGrid = rOpt.GetGridOptions();
- sal_Bool bGridOpt = rGrid.GetUseGridSnap();
+ bool bGridOpt = rGrid.GetUseGridSnap();
- if (pView->IsOrtho())
- pView->SetOrtho(sal_False);
+ if (pView->IsOrthogonal())
+ {
+ pView->SetOrthogonal(false);
+ }
if (pView->IsAngleSnapEnabled())
- pView->SetAngleSnapEnabled(sal_False);
+ {
+ pView->SetAngleSnapEnabled(false);
+ }
if (pView->IsGridSnap() != bGridOpt)
+ {
pView->SetGridSnap(bGridOpt);
+ }
if (pView->IsSnapEnabled() != bGridOpt)
+ {
pView->SetSnapEnabled(bGridOpt);
+ }
if (pView->IsCreate1stPointAsCenter())
- pView->SetCreate1stPointAsCenter(sal_False);
+ {
+ pView->SetCreate1stPointAsCenter(false);
+ }
if (pView->IsResizeAtCenter())
- pView->SetResizeAtCenter(sal_False);
+ {
+ pView->SetResizeAtCenter(false);
+ }
}
/*************************************************************************
@@ -206,7 +232,7 @@ sal_Bool __EXPORT FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const KeyEvent* pInitialKey )
{
sal_Bool bReturn = sal_False;
- if ( pObj && pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) )
+ if ( pObj && dynamic_cast< SdrTextObj* >(pObj) && !dynamic_cast< SdrUnoObj* >(pObj) )
{
// start text edit - like FuSelection::MouseButtonUp,
// but with bCursorToEnd instead of mouse position
@@ -256,7 +282,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
* else if ( pView->IsTextEdit() )
* {
* pView->EndTextEdit();
- * pView->SetCreateMode();
+ * pView->SetViewEditMode(SDREDITMODE_CREATE);
* pViewShell->GetScDrawView()->InvalidateDrawTextAttrs();
* bReturn = sal_True;
* }
@@ -275,7 +301,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
rViewData.GetDispatcher().Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
bReturn = sal_True;
}
- else if ( pView->AreObjectsMarked() )
+ else if ( pView->areSdrObjectsSelected() )
{
// #97016# III
SdrHdlList& rHdlList = const_cast< SdrHdlList& >( pView->GetHdlList() );
@@ -285,7 +311,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
pView->UnmarkAll();
// Beim Bezier-Editieren ist jetzt wieder das Objekt selektiert
- if (!pView->AreObjectsMarked())
+ if (!pView->areSdrObjectsSelected())
pViewShell->SetDrawShell( sal_False );
bReturn = sal_True;
@@ -303,20 +329,21 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// #98256# activate OLE object on RETURN for selected object
// #98198# put selected text object in edit mode
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
+ SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if( !pView->IsTextEdit() && pSelected )
{
sal_Bool bOle = pViewShell->GetViewFrame()->GetFrame().IsInPlace();
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && pObj->ISA( SdrOle2Obj ) && !bOle )
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pSelected);
+
+ if( pSdrOle2Obj && !bOle )
{
- //HMHpView->HideMarkHdl();
- pViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
+ pViewShell->ActivateObject( pSdrOle2Obj, 0 );
// consumed
bReturn = sal_True;
}
- else if ( lcl_KeyEditMode( pObj, pViewShell, NULL ) ) // start text edit for suitable object
+ else if ( lcl_KeyEditMode( pSelected, pViewShell, NULL ) ) // start text edit for suitable object
bReturn = sal_True;
}
}
@@ -329,11 +356,11 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// #98198# put selected text object in edit mode
// (this is not SID_SETINPUTMODE, but F2 hardcoded, like in Writer)
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
+ SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if( !pView->IsTextEdit() && pSelected )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if ( lcl_KeyEditMode( pObj, pViewShell, NULL ) ) // start text edit for suitable object
+ if ( lcl_KeyEditMode( pSelected, pViewShell, NULL ) ) // start text edit for suitable object
bReturn = sal_True;
}
}
@@ -345,7 +372,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// in calc do NOT start draw object selection using TAB/SHIFT-TAB when
// there is not yet a object selected
- if(pView->AreObjectsMarked())
+ if(pView->areSdrObjectsSelected())
{
KeyCode aCode = rKEvt.GetKeyCode();
@@ -361,8 +388,10 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
}
// #97016# II
- if(pView->AreObjectsMarked())
- pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
+ if(pView->areSdrObjectsSelected())
+ {
+ pView->MakeVisibleAtView(pView->getMarkedObjectSnapRange(), *pWindow);
+ }
bReturn = sal_True;
}
@@ -381,9 +410,11 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
if(pHdl)
{
- Point aHdlPosition(pHdl->GetPos());
- Rectangle aVisRect(aHdlPosition - Point(100, 100), Size(200, 200));
- pView->MakeVisible(aVisRect, *pWindow);
+ const basegfx::B2DRange aRange(
+ pHdl->getPosition() - basegfx::B2DPoint(100.0, 100.0),
+ pHdl->getPosition() + basegfx::B2DPoint(100.0, 100.0));
+
+ pView->MakeVisibleAtView(aRange, *pWindow);
}
// consumed
@@ -398,7 +429,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// in calc do NOT select the last draw object when
// there is not yet a object selected
- if(pView->AreObjectsMarked())
+ if(pView->areSdrObjectsSelected())
{
KeyCode aCode = rKEvt.GetKeyCode();
@@ -406,11 +437,13 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// #97016# mark last object
pView->UnmarkAllObj();
- pView->MarkNextObj(sal_False);
+ pView->MarkNextObj(false);
// #97016# II
- if(pView->AreObjectsMarked())
- pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
+ if(pView->areSdrObjectsSelected())
+ {
+ pView->MakeVisibleAtView(pView->getMarkedObjectSnapRange(), *pWindow);
+ }
bReturn = sal_True;
}
@@ -423,7 +456,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// in calc do NOT select the first draw object when
// there is not yet a object selected
- if(pView->AreObjectsMarked())
+ if(pView->areSdrObjectsSelected())
{
KeyCode aCode = rKEvt.GetKeyCode();
@@ -431,11 +464,13 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// #97016# mark first object
pView->UnmarkAllObj();
- pView->MarkNextObj(sal_True);
+ pView->MarkNextObj(true);
// #97016# II
- if(pView->AreObjectsMarked())
- pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
+ if(pView->areSdrObjectsSelected())
+ {
+ pView->MakeVisibleAtView(pView->getMarkedObjectSnapRange(), *pWindow);
+ }
bReturn = sal_True;
}
@@ -451,73 +486,67 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// in calc do cursor travelling of draw objects only when
// there is a object selected yet
- if(pView->AreObjectsMarked())
+ if(pView->areSdrObjectsSelected())
{
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if(rMarkList.GetMarkCount() == 1)
+ if(pSelected)
{
// disable cursor travelling on note objects as the tail connector position
// must not move.
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( ScDrawLayer::IsNoteCaption( pObj ) )
+ if( ScDrawLayer::IsNoteCaption( *pSelected ) )
break;
}
- long nX = 0;
- long nY = 0;
+ basegfx::B2DVector aMove(0.0, 0.0);
sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
if (nCode == KEY_UP)
{
// Scroll nach oben
- nX = 0;
- nY =-1;
+ aMove = basegfx::B2DPoint(0.0, -1.0);
}
else if (nCode == KEY_DOWN)
{
// Scroll nach unten
- nX = 0;
- nY = 1;
+ aMove = basegfx::B2DPoint(0.0, 1.0);
}
else if (nCode == KEY_LEFT)
{
// Scroll nach links
- nX =-1;
- nY = 0;
+ aMove = basegfx::B2DPoint(-1.0, 0.0);
}
else if (nCode == KEY_RIGHT)
{
// Scroll nach rechts
- nX = 1;
- nY = 0;
+ aMove = basegfx::B2DPoint(1.0, 0.0);
}
- sal_Bool bReadOnly = rViewData.GetDocShell()->IsReadOnly();
+ const bool bReadOnly(rViewData.GetDocShell()->IsReadOnly());
if(!rKEvt.GetKeyCode().IsMod1() && !bReadOnly)
{
if(rKEvt.GetKeyCode().IsMod2())
{
// #97016# move in 1 pixel distance
- Size aLogicSizeOnePixel = (pWindow) ? pWindow->PixelToLogic(Size(1,1)) : Size(100, 100);
- nX *= aLogicSizeOnePixel.Width();
- nY *= aLogicSizeOnePixel.Height();
+ const basegfx::B2DVector aLogicOnePix(
+ pWindow->GetInverseViewTransformation() *
+ basegfx::B2DVector(100.0, 100.0));
+
+ aMove *= aLogicOnePix;
}
else if(rKEvt.GetKeyCode().IsShift()) // #121236# Support for shift key in calc
{
- nX *= 1000;
- nY *= 1000;
+ aMove *= 1000.0;
}
else
{
// old, fixed move distance
- nX *= 100;
- nY *= 100;
+ aMove *= 100.0;
}
// is there a movement to do?
- if(0 != nX || 0 != nY)
+ if(!aMove.equalZero())
{
// #97016# II
const SdrHdlList& rHdlList = pView->GetHdlList();
@@ -529,42 +558,42 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
if(pView->IsMoveAllowed())
{
// #90129# restrict movement to WorkArea
- const Rectangle& rWorkArea = pView->GetWorkArea();
+ const basegfx::B2DRange& rWorkRange = pView->GetWorkArea();
- if(!rWorkArea.IsEmpty())
+ if(!rWorkRange.isEmpty())
{
- Rectangle aMarkRect(pView->GetMarkedObjRect());
- aMarkRect.Move(nX, nY);
+ basegfx::B2DRange aMarkRange(pView->getMarkedObjectSnapRange());
+ aMarkRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aMove));
- if(!aMarkRect.IsInside(rWorkArea))
+ if(!aMarkRange.isInside(rWorkRange))
{
- if(aMarkRect.Left() < rWorkArea.Left())
+ if(aMarkRange.getMinX() < rWorkRange.getMinX())
{
- nX += rWorkArea.Left() - aMarkRect.Left();
+ aMove.setX(aMove.getX() + rWorkRange.getMinX() - aMarkRange.getMinX());
}
- if(aMarkRect.Right() > rWorkArea.Right())
+ if(aMarkRange.getMaxX() > rWorkRange.getMaxX())
{
- nX -= aMarkRect.Right() - rWorkArea.Right();
+ aMove.setX(aMove.getX() - aMarkRange.getMaxX() - rWorkRange.getMaxX());
}
- if(aMarkRect.Top() < rWorkArea.Top())
+ if(aMarkRange.getMinY() < rWorkRange.getMinY())
{
- nY += rWorkArea.Top() - aMarkRect.Top();
+ aMove.setY(aMove.getY() + rWorkRange.getMinY() - aMarkRange.getMinY());
}
- if(aMarkRect.Bottom() > rWorkArea.Bottom())
+ if(aMarkRange.getMaxY() > rWorkRange.getMaxY())
{
- nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
+ aMove.setY(aMove.getY() - aMarkRange.getMaxY() - rWorkRange.getMaxY());
}
}
}
// now move the selected draw objects
- pView->MoveAllMarked(Size(nX, nY));
+ pView->MoveMarkedObj(aMove);
// #97016# II
- pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow);
+ pView->MakeVisibleAtView(pView->getMarkedObjectSnapRange(), *pWindow);
bReturn = sal_True;
}
@@ -572,26 +601,26 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
else
{
// move handle with index nHandleIndex
- if(pHdl && (nX || nY))
+ if(pHdl && !aMove.equalZero())
{
- // now move the Handle (nX, nY)
- Point aStartPoint(pHdl->GetPos());
- Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
+ // now move the Handle
+ const basegfx::B2DPoint aStartPoint(pHdl->getPosition());
+ const basegfx::B2DPoint aEndPoint(aStartPoint + aMove);
const SdrDragStat& rDragStat = pView->GetDragStat();
// start dragging
- pView->BegDragObj(aStartPoint, 0, pHdl, 0);
+ pView->BegDragObj(aStartPoint, pHdl, 0.0);
if(pView->IsDragObj())
{
- FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
- sal_Bool bWasSnapEnabled = pView->IsSnapEnabled();
+ const bool bWasNoSnap(rDragStat.IsNoSnap());
+ const bool bWasSnapEnabled(pView->IsSnapEnabled());
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap(sal_True);
+ ((SdrDragStat&)rDragStat).SetNoSnap(true);
if(bWasSnapEnabled)
- pView->SetSnapEnabled(sal_False);
+ pView->SetSnapEnabled(false);
pView->MovAction(aEndPoint);
pView->EndDragObj();
@@ -604,8 +633,10 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
}
// make moved handle visible
- Rectangle aVisRect(aEndPoint - Point(100, 100), Size(200, 200));
- pView->MakeVisible(aVisRect, *pWindow);
+ const basegfx::B2DRange aVisRange(
+ aEndPoint - basegfx::B2DPoint(100.0, 100.0),
+ aEndPoint + basegfx::B2DPoint(100.0, 100.0));
+ pView->MakeVisibleAtView(aVisRange, *pWindow);
bReturn = sal_True;
}
@@ -620,7 +651,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
case KEY_SPACE:
{
// in calc do only something when draw objects are selected
- if(pView->AreObjectsMarked())
+ if(pView->areSdrObjectsSelected())
{
const SdrHdlList& rHdlList = pView->GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
@@ -637,14 +668,14 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
{
if(rKEvt.GetKeyCode().IsShift())
{
- pView->UnmarkPoint(*pHdl);
+ pView->MarkPoint(*pHdl, true); // unmark
}
}
else
{
if(!rKEvt.GetKeyCode().IsShift())
{
- pView->UnmarkAllPoints();
+ pView->MarkPoints(0, true); // unmarkall
}
pView->MarkPoint(*pHdl);
@@ -657,7 +688,7 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++)
{
- SdrHdl* pAct = rHdlList.GetHdl(a);
+ SdrHdl* pAct = rHdlList.GetHdlByIndex(a);
if(pAct
&& pAct->GetKind() == HDL_POLY
@@ -690,14 +721,12 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
if (!bReturn)
{
// #98198# allow direct typing into a selected text object
+ SdrObject* pSelected = pView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() && EditEngine::IsSimpleCharInput(rKEvt) )
+ if( !pView->IsTextEdit() && pSelected && EditEngine::IsSimpleCharInput(rKEvt) )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-
// start text edit for suitable object, pass key event to OutlinerView
- if ( lcl_KeyEditMode( pObj, pViewShell, &rKEvt ) )
+ if ( lcl_KeyEditMode( pSelected, pViewShell, &rKEvt ) )
bReturn = sal_True;
}
}
@@ -705,11 +734,11 @@ sal_Bool __EXPORT FuDraw::KeyInput(const KeyEvent& rKEvt)
return (bReturn);
}
-// #97016# II
void FuDraw::SelectionHasChanged()
{
- const SdrHdlList& rHdlList = pView->GetHdlList();
- ((SdrHdlList&)rHdlList).ResetFocusHdl();
+ // Not needed TTTT
+ //const SdrHdlList& rHdlList = pView->GetHdlList();
+ //((SdrHdlList&)rHdlList).ResetFocusHdl();
}
/*************************************************************************
@@ -768,13 +797,15 @@ sal_Bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, Window* pWindow )
MouseEvent aMEvt( rPosPixel, 1, 0, MOUSE_LEFT );
SdrHitKind eHit = pView->PickAnything( aMEvt, SDRMOUSEBUTTONDOWN, aVEvt );
- if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL )
+ if ( eHit != SDRHIT_NONE && aVEvt.mpObj != NULL )
{
- if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) && ScDrawLayer::GetHitIMapObject(
- aVEvt.pObj, pWindow->PixelToLogic(rPosPixel), *pWindow ) )
+ const basegfx::B2DPoint aPixelPos(rPosPixel.X(), rPosPixel.Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
+
+ if ( ScDrawLayer::GetIMapInfo( aVEvt.mpObj ) && ScDrawLayer::GetHitIMapObject( *aVEvt.mpObj, aLogicPos, *pWindow ) )
return sal_True;
- if ( aVEvt.eEvent == SDREVENT_EXECUTEURL )
+ if ( aVEvt.meEvent == SDREVENT_EXECUTEURL )
return sal_True;
}
@@ -787,18 +818,17 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
{
Point aPosPixel = pWindow->GetPointerPosPixel();
sal_Bool bAlt = pMEvt && pMEvt->IsMod2();
- Point aPnt = pWindow->PixelToLogic( aPosPixel );
+ const basegfx::B2DPoint aPnt(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(aPosPixel.X(), aPosPixel.Y()));
SdrHdl* pHdl = pView->PickHandle(aPnt);
SdrObject* pObj;
- SdrPageView* pPV;
ScMacroInfo* pInfo = 0;
- if ( pView->PickObj(aPnt, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER) )
+ if ( pView->PickObj(aPnt, pView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER) )
{
- if ( pObj->IsGroupObject() )
+ if ( pObj->getChildrenOfSdrObject() )
{
SdrObject* pHit = 0;
- if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
+ if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, SDRSEARCH_DEEP ) )
pObj = pHit;
}
pInfo = ScDrawLayer::GetMacroInfo( pObj );
@@ -813,7 +843,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
pViewShell->SetActivePointer(
pView->GetPreferedPointer( aPnt, pWindow ) );
}
- else if ( pView->IsMarkedHit(aPnt) )
+ else if ( pView->IsMarkedObjHit(aPnt) )
{
pViewShell->SetActivePointer( Pointer(POINTER_MOVE) );
}
@@ -823,7 +853,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
// kann mit ALT unterdrueckt werden
pWindow->SetPointer( Pointer( POINTER_REFHAND ) ); // Text-URL / ImageMap
}
- else if ( !bAlt && pView->PickObj(aPnt, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
+ else if ( !bAlt && pView->PickObj(aPnt, pView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO) )
{
// kann mit ALT unterdrueckt werden
SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ????
@@ -847,13 +877,15 @@ sal_Bool FuDraw::IsSizingOrMovingNote( const MouseEvent& rMEvt ) const
sal_Bool bIsSizingOrMoving = sal_False;
if ( rMEvt.IsLeft() )
{
- const SdrMarkList& rNoteMarkList = pView->GetMarkedObjectList();
- if(rNoteMarkList.GetMarkCount() == 1)
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if(pSelected)
{
- SdrObject* pObj = rNoteMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if ( ScDrawLayer::IsNoteCaption( pObj ) )
+ if ( ScDrawLayer::IsNoteCaption( *pSelected ) )
{
- Point aMPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
+ const basegfx::B2DPoint aMPos(
+ pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+
bIsSizingOrMoving =
pView->PickHandle( aMPos ) || // handles to resize the note
pView->IsTextEditFrameHit( aMPos ); // frame for moving the note
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 274f1004ab0e..8555bfcb365e 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -96,49 +96,52 @@
//------------------------------------------------------------------------
-void SC_DLLPUBLIC ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage )
+void SC_DLLPUBLIC ScLimitSizeOnDrawPage(basegfx::B2DVector& rSize, basegfx::B2DPoint& rPos, const basegfx::B2DVector& rPageSize)
{
- if ( !rPage.Width() || !rPage.Height() )
+ if(rPageSize.equalZero())
return;
- Size aPageSize = rPage;
- sal_Bool bNegative = aPageSize.Width() < 0;
+ basegfx::B2DVector aPageSize(rPageSize);
+ const bool bNegative(aPageSize.getX() < 0.0);
+
if ( bNegative )
{
// make everything positive temporarily
- aPageSize.Width() = -aPageSize.Width();
- rPos.X() = -rPos.X() - rSize.Width();
+ aPageSize.setX(-aPageSize.getX());
+ rPos.setX(-rPos.getX() - rSize.getX());
}
- if ( rSize.Width() > aPageSize.Width() || rSize.Height() > aPageSize.Height() )
+ if ( rSize.getX() > aPageSize.getX() || rSize.getY() > aPageSize.getY() )
{
- double fX = aPageSize.Width() / (double) rSize.Width();
- double fY = aPageSize.Height() / (double) rSize.Height();
+ const double fX(aPageSize.getX() / rSize.getX());
+ const double fY(aPageSize.getY() / rSize.getY());
if ( fX < fY )
{
- rSize.Width() = aPageSize.Width();
- rSize.Height() = (long) ( rSize.Height() * fX );
+ rSize.setX(aPageSize.getX());
+ rSize.setY(rSize.getY() * fX);
}
else
{
- rSize.Height() = aPageSize.Height();
- rSize.Width() = (long) ( rSize.Width() * fY );
+ rSize.setY(aPageSize.getY());
+ rSize.setX(rSize.getX() * fY);
}
- if (!rSize.Width())
- rSize.Width() = 1;
- if (!rSize.Height())
- rSize.Height() = 1;
+ if(basegfx::fTools::equalZero(rSize.getX()))
+ rSize.setX(1.0);
+
+ if(basegfx::fTools::equalZero(rSize.getY()))
+ rSize.setY(1.0);
}
- if ( rPos.X() + rSize.Width() > aPageSize.Width() )
- rPos.X() = aPageSize.Width() - rSize.Width();
- if ( rPos.Y() + rSize.Height() > aPageSize.Height() )
- rPos.Y() = aPageSize.Height() - rSize.Height();
+ if ( rPos.getX() + rSize.getX() > aPageSize.getX() )
+ rPos.setX(aPageSize.getX() - rSize.getX());
+
+ if ( rPos.getY() + rSize.getY() > aPageSize.getY() )
+ rPos.setY(aPageSize.getY() - rSize.getY());
if ( bNegative )
- rPos.X() = -rPos.X() - rSize.Width(); // back to real position
+ rPos.setX(-rPos.getX() - rSize.getX()); // back to real position
}
//------------------------------------------------------------------------
@@ -161,42 +164,46 @@ void lcl_InsertGraphic( const Graphic& rGraphic,
aDestMap.SetScaleX(aScaleX);
aDestMap.SetScaleY(aScaleY);
}
- Size aLogicSize = pWindow->LogicToLogic(
- rGraphic.GetPrefSize(), &aSourceMap, &aDestMap );
- // Limit size
+ const Size aOldLogicSize(pWindow->LogicToLogic(rGraphic.GetPrefSize(), &aSourceMap, &aDestMap));
+ basegfx::B2DVector aLogicSize(aOldLogicSize.Width(), aOldLogicSize.Height());
+ // Limit size
SdrPageView* pPV = pView->GetSdrPageView();
- SdrPage* pPage = pPV->GetPage();
- Point aInsertPos = pViewSh->GetInsertPos();
-
- ScViewData* pData = pViewSh->GetViewData();
- if ( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
- aInsertPos.X() -= aLogicSize.Width(); // move position to left edge
- ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, pPage->GetSize() );
+ if(pPV)
+ {
+ SdrPage& rPage = pPV->getSdrPageFromSdrPageView();
+ basegfx::B2DPoint aInsertPos(pViewSh->GetInsertPos());
+ ScViewData* pData = pViewSh->GetViewData();
- Rectangle aRect ( aInsertPos, aLogicSize );
+ if ( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
+ aInsertPos.setX(aInsertPos.getX() - aLogicSize.getX()); // move position to left edge
- SdrGrafObj* pObj = new SdrGrafObj( rGraphic, aRect );
+ ScLimitSizeOnDrawPage( aLogicSize, aInsertPos, rPage.GetPageScale() );
- // #118522# calling SetGraphicLink here doesn't work
+ SdrGrafObj* pObj = new SdrGrafObj(
+ pView->getSdrModelFromSdrView(),
+ rGraphic,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aLogicSize, aInsertPos));
- // #49961# Path is no longer used as name for the graphics object
+ // #118522# calling SetGraphicLink here doesn't work
+ // #49961# Path is no longer used as name for the graphics object
- ScDrawLayer* pLayer = (ScDrawLayer*) pView->GetModel();
- String aName = pLayer->GetNewGraphicName(); // "Grafik x"
- pObj->SetName(aName);
+ ScDrawLayer& rLayer = dynamic_cast< ScDrawLayer& >(pView->getSdrModelFromSdrView());
+ String aName = rLayer.GetNewGraphicName(); // "Grafik x"
+ pObj->SetName(aName);
- // don't select if from (dispatch) API, to allow subsequent cell operations
- sal_uLong nInsOptions = bApi ? SDRINSERT_DONTMARK : 0;
- pView->InsertObjectAtView( pObj, *pPV, nInsOptions );
+ // don't select if from (dispatch) API, to allow subsequent cell operations
+ sal_uLong nInsOptions = bApi ? SDRINSERT_DONTMARK : 0;
+ pView->InsertObjectAtView( *pObj, nInsOptions );
- // #118522# SetGraphicLink has to be used after inserting the object,
- // otherwise an empty graphic is swapped in and the contact stuff crashes.
- // See #i37444#.
- if ( bAsLink )
- pObj->SetGraphicLink( rFileName, rFilterName );
+ // #118522# SetGraphicLink has to be used after inserting the object,
+ // otherwise an empty graphic is swapped in and the contact stuff crashes.
+ // See #i37444#.
+ if ( bAsLink )
+ pObj->SetGraphicLink( rFileName, rFilterName );
+ }
}
//------------------------------------------------------------------------
@@ -206,30 +213,44 @@ void lcl_InsertMedia( const ::rtl::OUString& rMediaURL, bool bApi,
const Size& rPrefSize )
{
SdrPageView* pPV = pView->GetSdrPageView();
- SdrPage* pPage = pPV->GetPage();
- ScViewData* pData = pViewSh->GetViewData();
- Point aInsertPos( pViewSh->GetInsertPos() );
- Size aSize;
- if( rPrefSize.Width() && rPrefSize.Height() )
+ if(pPV)
{
- if( pWindow )
- aSize = pWindow->PixelToLogic( rPrefSize, MAP_100TH_MM );
+ SdrPage& rPage = pPV->getSdrPageFromSdrPageView();
+ ScViewData* pData = pViewSh->GetViewData();
+ basegfx::B2DPoint aInsertPos(pViewSh->GetInsertPos());
+ basegfx::B2DVector aScale(0.0, 0.0);
+
+ if( rPrefSize.Width() && rPrefSize.Height() )
+ {
+ const basegfx::B2DVector aPrefScale(rPrefSize.Width(), rPrefSize.Height());
+
+ if( pWindow )
+ {
+ aScale = pWindow->GetInverseViewTransformation(MapMode(MAP_100TH_MM)) * aPrefScale;
+ }
+ else
+ {
+ aScale = Application::GetDefaultDevice()->GetInverseViewTransformation(MapMode(MAP_100TH_MM)) * aPrefScale;
+ }
+ }
else
- aSize = Application::GetDefaultDevice()->PixelToLogic( rPrefSize, MAP_100TH_MM );
- }
- else
- aSize = Size( 5000, 5000 );
+ {
+ aScale = basegfx::B2DVector( 5000.0, 5000.0 );
+ }
- ScLimitSizeOnDrawPage( aSize, aInsertPos, pPage->GetSize() );
+ ScLimitSizeOnDrawPage( aScale, aInsertPos, rPage.GetPageScale() );
- if( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
- aInsertPos.X() -= aSize.Width();
+ if( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
+ aInsertPos.setX(aInsertPos.getX() - aScale.getX());
- SdrMediaObj* pObj = new SdrMediaObj( Rectangle( aInsertPos, aSize ) );
+ SdrMediaObj* pObj = new SdrMediaObj(
+ pView->getSdrModelFromSdrView(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aScale, aInsertPos));
- pObj->setURL( rMediaURL );
- pView->InsertObjectAtView( pObj, *pPV, bApi ? SDRINSERT_DONTMARK : 0 );
+ pObj->setURL( rMediaURL );
+ pView->InsertObjectAtView( *pObj, bApi ? SDRINSERT_DONTMARK : 0 );
+ }
}
/*************************************************************************
@@ -376,7 +397,7 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh,
if( pReqArgs )
{
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, &pReqArgs->Get( rReq.GetSlot() ) );
+ const SfxStringItem* pStringItem = dynamic_cast< const SfxStringItem* >( &pReqArgs->Get( rReq.GetSlot() ) );
if( pStringItem )
{
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 5ebd98e35fc0..9271080956c3 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -50,8 +50,8 @@
#include <svx/svdpagv.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdundo.hxx>
+#include <svx/svdlegacy.hxx>
#include <sfx2/msgpool.hxx>
-#include <svx/charthelper.hxx>
#include <scmod.hxx>
// BM/IHA --
@@ -90,6 +90,8 @@ using namespace ::com::sun::star;
#include "globstr.hrc"
#include "drawview.hxx"
+extern SdrObject* pSkipPaintObj; // output.cxx - dieses Objekt nicht zeichnen
+
//------------------------------------------------------------------------
#define IS_AVAILABLE(WhichId,ppItem) \
@@ -232,7 +234,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
sal_uInt16 nSlot = rReq.GetSlot();
- SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT );
if ( nSlot == SID_INSERT_OBJECT && pNameItem )
{
SvGlobalName aClassName = pNameItem->GetValue();
@@ -330,14 +332,15 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
try
{
::svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
- Size aSize;
- MapMode aMap100( MAP_100TH_MM );
- MapUnit aMapUnit = MAP_100TH_MM;
+ basegfx::B2DVector aScale;
+ MapUnit aMapUnit(MAP_100TH_MM);
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
aObjRef.SetGraphicStream( xIconMetaFile, aIconMediaType );
- aSize = aObjRef.GetSize( &aMap100 );
+ MapMode aMap100( MAP_100TH_MM );
+ const Size aSize(aObjRef.GetSize( &aMap100 ));
+ aScale = basegfx::B2DVector(aSize.Width(), aSize.Height());
}
else
{
@@ -351,26 +354,22 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
// the default size will be set later
}
- aSize = Size( aSz.Width, aSz.Height );
-
+ aScale = basegfx::B2DVector( aSz.Width, aSz.Height );
aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- if (aSize.Height() == 0 || aSize.Width() == 0)
+
+ if(basegfx::fTools::equalZero(aScale.getY()) || basegfx::fTools::equalZero(aScale.getX()))
{
// Rechteck mit ausgewogenem Kantenverhaeltnis
- aSize.Width() = 5000;
- aSize.Height() = 5000;
- Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aMapUnit );
- aSz.Width = aTmp.Width();
- aSz.Height = aTmp.Height();
+ aScale = basegfx::B2DVector(5000.0, 5000.0);
+
+ basegfx::B2DVector aTmp(aScale * OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, aMapUnit));
+ aSz.Width = basegfx::fround(aTmp.getX());
+ aSz.Height = basegfx::fround(aTmp.getY());
xObj->setVisualAreaSize( nAspect, aSz );
+ }
// re-convert aSize to 1/100th mm to avoid rounding errors in comparison below
- aSize = Window::LogicToLogic( aTmp,
- MapMode( aMapUnit ), aMap100 );
- }
- else
- aSize = Window::LogicToLogic( aSize,
- MapMode( aMapUnit ), aMap100 );
+ aScale *= Window::GetFactorLogicToLogic(aMapUnit, MAP_100TH_MM);
}
// Chart initialisieren ?
@@ -379,31 +378,42 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
ScViewData* pData = pViewSh->GetViewData();
- Point aPnt = pViewSh->GetInsertPos();
+ basegfx::B2DPoint aPnt(pViewSh->GetInsertPos());
if ( pData->GetDocument()->IsNegativePage( pData->GetTabNo() ) )
- aPnt.X() -= aSize.Width(); // move position to left edge
- Rectangle aRect (aPnt, aSize);
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect);
- SdrPageView* pPV = pView->GetSdrPageView();
- pView->InsertObjectAtView(pObj, *pPV);
+ aPnt.setX(aPnt.getX() - aScale.getX()); // move position to left edge
+
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ pView->getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aPnt));
+
+ // Dieses Objekt nicht vor dem Aktivieren zeichnen
+ // (in MarkListHasChanged kommt ein Update)
+ if (!bIsFromFile)
+ pSkipPaintObj = pObj;
+
+ pView->InsertObjectAtView(*pObj);
if ( nAspect != embed::Aspects::MSOLE_ICON )
{
- // #73279# Math objects change their object size during InsertObject.
+ // #73279# Math objects change their object size during InsertObjectToSdrObjList.
// New size must be set in SdrObject, or a wrong scale will be set at
// ActivateObject.
try
{
- awt::Size aSz = xObj->getVisualAreaSize( nAspect );
-
- Size aNewSize( aSz.Width, aSz.Height );
- aNewSize = OutputDevice::LogicToLogic( aNewSize, aMapUnit, MAP_100TH_MM );
+ const awt::Size aSz(xObj->getVisualAreaSize( nAspect ));
+ const basegfx::B2DVector aNewSize(basegfx::B2DVector(aSz.Width, aSz.Height) * OutputDevice::GetFactorLogicToLogic(aMapUnit, MAP_100TH_MM));
- if ( aNewSize != aSize )
+ if ( !aNewSize.equal(aScale) )
{
- aRect.SetSize( aNewSize );
- pObj->SetLogicRect( aRect );
+ pObj->setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aNewSize,
+ aPnt));
}
}
catch( embed::NoVisualAreaSizeException& )
@@ -421,6 +431,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
else
{
pViewShell->ActivateObject( (SdrOle2Obj*) pObj, SVVERB_SHOW );
+ pSkipPaintObj = NULL;
}
}
@@ -552,33 +563,32 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
xChartModel->lockControllers();
ScRangeListRef aDummy;
- Rectangle aMarkDest;
+ basegfx::B2DRange aMarkDest;
SCTAB nMarkTab;
sal_Bool bDrawRect = pViewShell->GetChartArea( aDummy, aMarkDest, nMarkTab );
// Objekt-Groesse
awt::Size aSz = xObj->getVisualAreaSize( nAspect );
- Size aSize( aSz.Width, aSz.Height );
+ basegfx::B2DVector aScale( aSz.Width, aSz.Height );
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
sal_Bool bSizeCh = sal_False;
- if (bDrawRect && !aMarkDest.IsEmpty())
+ if (bDrawRect && !aMarkDest.isEmpty())
{
- aSize = aMarkDest.GetSize();
+ aScale = aMarkDest.getRange();
bSizeCh = sal_True;
}
- if (aSize.Height() <= 0 || aSize.Width() <= 0)
+ if (aScale.getY() <= 0.0 || aScale.getX() <= 0.0)
{
- aSize.Width() = 5000;
- aSize.Height() = 5000;
+ aScale = basegfx::B2DVector(5000.0, 5000.0);
bSizeCh = sal_True;
}
if (bSizeCh)
{
- aSize = Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) );
- aSz.Width = aSize.Width();
- aSz.Height = aSize.Height();
+ aScale = Window::GetFactorLogicToLogic(MAP_100TH_MM, aMapUnit) * aScale;
+ aSz.Width = basegfx::fround(aScale.getX());
+ aSz.Height = basegfx::fround(aScale.getY());
xObj->setVisualAreaSize( nAspect, aSz );
}
@@ -594,9 +604,11 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
if( IS_AVAILABLE( FN_PARAM_4, &pItem ) )
{
- if ( pItem->ISA( SfxUInt16Item ) )
+ if ( dynamic_cast< const SfxUInt16Item* >(pItem) )
+ {
nToTable = ((const SfxUInt16Item*)pItem)->GetValue();
- else if ( pItem->ISA( SfxBoolItem ) )
+ }
+ else if ( dynamic_cast< const SfxBoolItem* >(pItem) )
{
// #46033# in der idl fuer Basic steht FN_PARAM_4 als SfxBoolItem
// -> wenn gesetzt, neue Tabelle, sonst aktuelle Tabelle
@@ -653,148 +665,160 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
// Objekt-Position
- Point aStart;
+ basegfx::B2DPoint aStart(0.0, 0.0);
if ( bDrawRect )
- aStart = aMarkDest.TopLeft(); // marked by hand
+ {
+ aStart = aMarkDest.getMinimum(); // marked by hand
+ }
else
{
// get chart position (from window size and data range)
- aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange );
+ aStart = pViewSh->GetChartInsertPos( aScale, aPositionRange );
}
- Rectangle aRect (aStart, aSize);
- SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
- SdrPageView* pPV = pView->GetSdrPageView();
-
- // #121334# This call will change the chart's default background fill from white to transparent.
- // Add here again if this is wanted (see task description for details)
- // ChartHelper::AdaptDefaultsForChart( xObj );
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ pView->getSdrModelFromSdrView(),
+ svt::EmbeddedObjectRef( xObj, nAspect ),
+ aName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aStart));
-// pView->InsertObjectAtView(pObj, *pPV);//this call leads to an immidiate redraw and asks the chart for a visual representation
+ // Dieses Objekt nicht vor dem Aktivieren zeichnen
+ pSkipPaintObj = pObj;
- // use the page instead of the view to insert, so no undo action is created yet
- SdrPage* pInsPage = pPV->GetPage();
- pInsPage->InsertObject( pObj );
- pView->UnmarkAllObj();
- pView->MarkObj( pObj, pPV );
- bool bAddUndo = true; // add undo action later, unless the dialog is canceled
+ SdrPageView* pPV = pView->GetSdrPageView();
- if (rReq.IsAPI())
+ if(pPV)
{
- if( xChartModel.is() )
- xChartModel->unlockControllers();
- }
- else
- {
- //the controller will be unlocked by the dialog when the dialog is told to do so
+ // use the page instead of the view to insert, so no undo action is created yet
+ SdrPage& rInsPage = pPV->getSdrPageFromSdrPageView();
+ rInsPage.InsertObjectToSdrObjList(*pObj);
+ pView->UnmarkAllObj();
+ pView->MarkObj( *pObj );
+ bool bAddUndo = true; // add undo action later, unless the dialog is canceled
+
+ if (rReq.IsAPI())
+ {
+ if( xChartModel.is() )
+ xChartModel->unlockControllers();
+ }
+ else
+ {
+ //the controller will be unlocked by the dialog when the dialog is told to do so
- // only activate object if not called via API (e.g. macro)
- pViewShell->ActivateObject( (SdrOle2Obj*) pObj, SVVERB_SHOW );
+ // only activate object if not called via API (e.g. macro)
+ pViewShell->ActivateObject( (SdrOle2Obj*) pObj, SVVERB_SHOW );
- //open wizard
- //@todo get context from calc if that has one
- uno::Reference< uno::XComponentContext > xContext(
- ::cppu::defaultBootstrap_InitialComponentContext() );
- if(xContext.is())
- {
- uno::Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
- if(xMCF.is())
+ //open wizard
+ //@todo get context from calc if that has one
+ uno::Reference< uno::XComponentContext > xContext(
+ ::cppu::defaultBootstrap_InitialComponentContext() );
+ if(xContext.is())
{
- uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
- xMCF->createInstanceWithContext(
- rtl::OUString::createFromAscii("com.sun.star.comp.chart2.WizardDialog")
- , xContext), uno::UNO_QUERY);
- uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY );
- if( xChartModel.is() && xInit.is() )
+ uno::Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
+ if(xMCF.is())
{
- uno::Reference< awt::XWindow > xDialogParentWindow(0);
- // initialize dialog
- uno::Sequence<uno::Any> aSeq(2);
- uno::Any* pArray = aSeq.getArray();
- beans::PropertyValue aParam1;
- aParam1.Name = rtl::OUString::createFromAscii("ParentWindow");
- aParam1.Value <<= uno::makeAny(xDialogParentWindow);
- beans::PropertyValue aParam2;
- aParam2.Name = rtl::OUString::createFromAscii("ChartModel");
- aParam2.Value <<= uno::makeAny(xChartModel);
- pArray[0] <<= uno::makeAny(aParam1);
- pArray[1] <<= uno::makeAny(aParam2);
- xInit->initialize( aSeq );
-
- // try to set the dialog's position so it doesn't hide the chart
- uno::Reference < beans::XPropertySet > xDialogProps( xDialog, uno::UNO_QUERY );
- if ( xDialogProps.is() )
+ uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
+ xMCF->createInstanceWithContext(
+ rtl::OUString::createFromAscii("com.sun.star.comp.chart2.WizardDialog")
+ , xContext), uno::UNO_QUERY);
+ uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY );
+ if( xChartModel.is() && xInit.is() )
{
- try
+ uno::Reference< awt::XWindow > xDialogParentWindow(0);
+ // initialize dialog
+ uno::Sequence<uno::Any> aSeq(2);
+ uno::Any* pArray = aSeq.getArray();
+ beans::PropertyValue aParam1;
+ aParam1.Name = rtl::OUString::createFromAscii("ParentWindow");
+ aParam1.Value <<= uno::makeAny(xDialogParentWindow);
+ beans::PropertyValue aParam2;
+ aParam2.Name = rtl::OUString::createFromAscii("ChartModel");
+ aParam2.Value <<= uno::makeAny(xChartModel);
+ pArray[0] <<= uno::makeAny(aParam1);
+ pArray[1] <<= uno::makeAny(aParam2);
+ xInit->initialize( aSeq );
+
+ // try to set the dialog's position so it doesn't hide the chart
+ uno::Reference < beans::XPropertySet > xDialogProps( xDialog, uno::UNO_QUERY );
+ if ( xDialogProps.is() )
{
- //get dialog size:
- awt::Size aDialogAWTSize;
- if( xDialogProps->getPropertyValue( ::rtl::OUString::createFromAscii("Size") )
- >>= aDialogAWTSize )
+ try
{
- Size aDialogSize( aDialogAWTSize.Width, aDialogAWTSize.Height );
- if ( aDialogSize.Width() > 0 && aDialogSize.Height() > 0 )
+ //get dialog size:
+ awt::Size aDialogAWTSize;
+ if( xDialogProps->getPropertyValue( ::rtl::OUString::createFromAscii("Size") )
+ >>= aDialogAWTSize )
{
- //calculate and set new position
- Point aDialogPos = pViewShell->GetChartDialogPos( aDialogSize, aRect );
- xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("Position"),
- uno::makeAny( awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) );
+ const basegfx::B2DVector aDialogScale(aDialogAWTSize.Width, aDialogAWTSize.Height);
+
+ if( aDialogScale.getX() > 0 && aDialogScale.getY() > 0 )
+ {
+ //calculate and set new position
+ const basegfx::B2DRange aOldObjRange(sdr::legacy::GetLogicRange(*pObj));
+ const basegfx::B2DPoint aDialogPos(pViewShell->GetChartDialogPos(aDialogScale, aOldObjRange));
+
+ xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("Position"),
+ uno::makeAny(
+ awt::Point(
+ basegfx::fround(aDialogPos.getX()),
+ basegfx::fround(aDialogPos.getY())) ) );
+ }
}
+ //tell the dialog to unlock controller
+ xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("UnlockControllersOnExecute"),
+ uno::makeAny( sal_True ) );
+
}
- //tell the dialog to unlock controller
- xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("UnlockControllersOnExecute"),
- uno::makeAny( sal_True ) );
+ catch( uno::Exception& )
+ {
+ OSL_ASSERT( "Chart wizard couldn't be positioned automatically\n" );
+ }
+ }
+
+ sal_Int16 nDialogRet = xDialog->execute();
+ if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
+ {
+ // leave OLE inplace mode and unmark
+ OSL_ASSERT( pViewShell );
+ OSL_ASSERT( pView );
+ pViewShell->DeactivateOle();
+ pView->UnmarkAll();
+
+ // old page view pointer is invalid after switching sheets
+ pPV = pView->GetSdrPageView();
+ // remove the chart
+ OSL_ASSERT( pPV );
+ SdrPage& rPage = pPV->getSdrPageFromSdrPageView();
+ OSL_ASSERT( pObj );
+ rPage.RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+
+ bAddUndo = false; // don't create the undo action for inserting
+
+ // leave the draw shell
+ pViewShell->SetDrawShell( sal_False );
}
- catch( uno::Exception& )
+ else
{
- OSL_ASSERT( "Chart wizard couldn't be positioned automatically\n" );
+ OSL_ASSERT( nDialogRet == ui::dialogs::ExecutableDialogResults::OK );
+ //@todo maybe move chart to different table
}
}
-
- sal_Int16 nDialogRet = xDialog->execute();
- if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
- {
- // leave OLE inplace mode and unmark
- OSL_ASSERT( pViewShell );
- OSL_ASSERT( pView );
- pViewShell->DeactivateOle();
- pView->UnmarkAll();
-
- // old page view pointer is invalid after switching sheets
- pPV = pView->GetSdrPageView();
-
- // remove the chart
- OSL_ASSERT( pPV );
- SdrPage * pPage( pPV->GetPage());
- OSL_ASSERT( pPage );
- OSL_ASSERT( pObj );
- if( pPage )
- pPage->RemoveObject( pObj->GetOrdNum());
-
- bAddUndo = false; // don't create the undo action for inserting
-
- // leave the draw shell
- pViewShell->SetDrawShell( sal_False );
- }
- else
- {
- OSL_ASSERT( nDialogRet == ui::dialogs::ExecutableDialogResults::OK );
- //@todo maybe move chart to different table
- }
+ uno::Reference< lang::XComponent > xComponent( xDialog, uno::UNO_QUERY );
+ if( xComponent.is())
+ xComponent->dispose();
}
- uno::Reference< lang::XComponent > xComponent( xDialog, uno::UNO_QUERY );
- if( xComponent.is())
- xComponent->dispose();
}
}
- }
- if ( bAddUndo )
- {
- // add undo action the same way as in SdrEditView::InsertObjectAtView
- // (using UndoActionHdl etc.)
- pView->AddUndo(pDoc->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
+ if ( bAddUndo )
+ {
+ // add undo action the same way as in SdrEditView::InsertObjectAtView
+ // (using UndoActionHdl etc.)
+ pView->AddUndo(pDoc->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
+ }
}
// BM/IHA --
diff --git a/sc/source/ui/drawfunc/fumark.cxx b/sc/source/ui/drawfunc/fumark.cxx
index 526597c88391..95a821d160df 100644
--- a/sc/source/ui/drawfunc/fumark.cxx
+++ b/sc/source/ui/drawfunc/fumark.cxx
@@ -26,6 +26,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
+#include <basegfx/range/b2drange.hxx>
#include "fumark.hxx"
#include "sc.hrc"
@@ -77,8 +78,8 @@ sal_Bool FuMarkRect::MouseButtonDown(const MouseEvent& rMEvt)
pView->UnmarkAll(); // der Einheitlichkeit halber und wegen #50558#
bStartDrag = sal_True;
- aBeginPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
- aZoomRect = Rectangle( aBeginPos, Size() );
+ aBeginPos = pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ aZoomRange = basegfx::B2DRange(aBeginPos);
return sal_True;
}
@@ -93,15 +94,16 @@ sal_Bool FuMarkRect::MouseMove(const MouseEvent& rMEvt)
if ( bStartDrag )
{
if ( bVisible )
- pViewShell->DrawMarkRect(aZoomRect);
- Point aPixPos= rMEvt.GetPosPixel();
- ForceScroll(aPixPos);
-
- Point aEndPos = pWindow->PixelToLogic(aPixPos);
- Rectangle aRect(aBeginPos, aEndPos);
- aZoomRect = aRect;
- aZoomRect.Justify();
- pViewShell->DrawMarkRect(aZoomRect);
+ {
+ pViewShell->DrawMarkRange(aZoomRange);
+ }
+
+ const basegfx::B2DPoint aPixPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ ForceScroll(rMEvt.GetPosPixel());
+
+ const basegfx::B2DPoint aEndPos(pWindow->GetInverseViewTransformation() * aPixPos);
+ aZoomRange = basegfx::B2DRange(aBeginPos, aEndPos);
+ pViewShell->DrawMarkRange(aZoomRange);
bVisible = sal_True;
}
@@ -124,18 +126,17 @@ sal_Bool FuMarkRect::MouseButtonUp(const MouseEvent& rMEvt)
if ( bVisible )
{
// Hide ZoomRect
- pViewShell->DrawMarkRect(aZoomRect);
+ pViewShell->DrawMarkRange(aZoomRange);
bVisible = sal_False;
}
- Size aZoomSizePixel = pWindow->LogicToPixel(aZoomRect).GetSize();
+ const basegfx::B2DVector aZoomSizePixel(pWindow->GetViewTransformation() * aZoomRange.getRange());
+ const double fMinMove(pView->GetMinMoveDistancePixel());
- sal_uInt16 nMinMove = pView->GetMinMoveDistancePixel();
- if ( aZoomSizePixel.Width() < nMinMove || aZoomSizePixel.Height() < nMinMove )
+ if ( aZoomSizePixel.getX() < fMinMove || aZoomSizePixel.getY() < fMinMove )
{
// Klick auf der Stelle
-
- aZoomRect.SetSize(Size()); // dann ganz leer
+ aZoomRange = basegfx::B2DRange(aZoomRange.getMinimum());
}
bStartDrag = sal_False;
@@ -146,7 +147,7 @@ sal_Bool FuMarkRect::MouseButtonUp(const MouseEvent& rMEvt)
// Daten an der View merken
- pViewShell->SetChartArea( aSourceRange, aZoomRect );
+ pViewShell->SetChartArea(aSourceRange, aZoomRange);
// Chart-Dialog starten:
@@ -264,7 +265,7 @@ void FuMarkRect::Deactivate()
if (bVisible)
{
// Hide ZoomRect
- pViewShell->DrawMarkRect(aZoomRect);
+ pViewShell->DrawMarkRange(aZoomRange);
bVisible = sal_False;
bStartDrag = sal_False;
}
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 6ff13e599831..3c956df541a5 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -299,7 +299,7 @@ IMPL_LINK( FuPoor, DragHdl, void *, EMPTYARG )
{
SdrHdl* pHdl = pView->PickHandle(aMDPos);
- if ( pHdl==NULL && pView->IsMarkedHit(aMDPos) )
+ if ( pHdl==NULL && pView->IsMarkedObjHit(aMDPos) )
{
pWindow->ReleaseMouse();
bIsInDragMode = sal_True;
@@ -312,22 +312,21 @@ IMPL_LINK( FuPoor, DragHdl, void *, EMPTYARG )
// Detektiv-Linie
-sal_Bool FuPoor::IsDetectiveHit( const Point& rLogicPos )
+bool FuPoor::IsDetectiveHit( const basegfx::B2DPoint& rLogicPos )
{
- SdrPageView* pPV = pView->GetSdrPageView();
- if (!pPV)
- return sal_False;
-
sal_Bool bFound = sal_False;
- SdrObjListIter aIter( *pPV->GetObjList(), IM_FLAT );
+
+ if(pView->GetSdrPageView())
+ {
+ SdrObjListIter aIter( *pView->GetSdrPageView()->GetCurrentObjectList(), IM_FLAT );
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
{
if (ScDetectiveFunc::IsNonAlienArrow( pObject ))
{
- sal_uInt16 nHitLog = (sal_uInt16) pWindow->PixelToLogic(
- Size(pView->GetHitTolerancePixel(),0)).Width();
- if(SdrObjectPrimitiveHit(*pObject, rLogicPos, nHitLog, *pPV, 0, false))
+ const double fHitLog(basegfx::B2DVector(pWindow->GetInverseViewTransformation() * basegfx::B2DVector(pView->GetHitTolerancePixel(), 0.0)).getLength());
+
+ if(SdrObjectPrimitiveHit(*pObject, rLogicPos, fHitLog, *pView, false, 0))
{
bFound = sal_True;
}
@@ -335,6 +334,8 @@ sal_Bool FuPoor::IsDetectiveHit( const Point& rLogicPos )
pObject = aIter.Next();
}
+ }
+
return bFound;
}
@@ -350,26 +351,26 @@ void FuPoor::StopDragTimer()
|*
\************************************************************************/
-SdrObject* FuPoor::CreateDefaultObject(const sal_uInt16 /* nID */, const Rectangle& /* rRectangle */)
+SdrObject* FuPoor::CreateDefaultObject(const sal_uInt16 /* nID */, const basegfx::B2DRange& /* rRange */)
{
// empty base implementation
return 0L;
}
-void FuPoor::ImpForceQuadratic(Rectangle& rRect)
+void FuPoor::ImpForceQuadratic(basegfx::B2DRange& rRange)
{
- if(rRect.GetWidth() > rRect.GetHeight())
+ basegfx::B2DPoint aNewTopLeft(0.0, 0.0);
+
+ if(rRange.getWidth() > rRange.getHeight())
{
- rRect = Rectangle(
- Point(rRect.Left() + ((rRect.GetWidth() - rRect.GetHeight()) / 2), rRect.Top()),
- Size(rRect.GetHeight(), rRect.GetHeight()));
+ aNewTopLeft = basegfx::B2DPoint(rRange.getMinX() + ((rRange.getWidth() - rRange.getHeight()) * 0.5), rRange.getMinY());
}
else
{
- rRect = Rectangle(
- Point(rRect.Left(), rRect.Top() + ((rRect.GetHeight() - rRect.GetWidth()) / 2)),
- Size(rRect.GetWidth(), rRect.GetWidth()));
+ aNewTopLeft = basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + ((rRange.getHeight() - rRange.getWidth()) * 0.5));
}
+
+ rRange = basegfx::B2DRange(aNewTopLeft, aNewTopLeft + rRange.getRange());
}
// #i33136#
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index f0b7e3916766..5383e594476a 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -124,30 +124,30 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
- aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
+ aMDPos = pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
if ( rMEvt.IsLeft() )
{
SdrHdl* pHdl = pView->PickHandle(aMDPos);
SdrObject* pObj;
- SdrPageView* pPV;
- if ( pHdl!=NULL || pView->IsMarkedHit(aMDPos) )
+ if ( pHdl!=NULL || pView->IsMarkedObjHit(aMDPos) )
{
// Determine if this is the tail of a SdrCaptionObj i.e.
// we need to disable the drag option on the tail of a note
// object. Also, disable the ability to use the circular
// drag of a note object.
bool bDrag = false;
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if( pSelected )
{
- SdrObject* pMarkedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
+ if( ScDrawLayer::IsNoteCaption( *pSelected ) )
{
// move using the valid caption handles for note text box.
if(pHdl && (pHdl->GetKind() != HDL_POLY && pHdl->GetKind() != HDL_CIRC))
bDrag = true;
+
// move the complete note box.
else if(!pHdl)
bDrag = true;
@@ -161,22 +161,22 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
if ( bDrag )
{
aDragTimer.Start();
- pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl);
+ pView->BegDragObj(aMDPos, pHdl);
bReturn = sal_True;
}
}
else
{
sal_Bool bAlt = rMEvt.IsMod2();
- if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
+ if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO) )
{
- pView->BegMacroObj(aMDPos, pObj, pPV, pWindow);
+ pView->BegMacroObj(aMDPos, 2.0, pObj, pWindow);
bReturn = sal_True;
}
else
{
String sURL, sTarget;
- if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER))
+ if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER))
{
// Support for imported Excel docs
// Excel is of course not consistent and allows
@@ -194,10 +194,10 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
// If a group object has no hyperlink use the hyperlink of the
// object clicked
- if ( pObj->IsGroupObject() )
+ if ( pObj->getChildrenOfSdrObject() )
{
SdrObject* pHit = NULL;
- if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
+ if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, SDRSEARCH_DEEP ) )
pObj = pHit;
}
@@ -235,22 +235,21 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
SdrViewEvent aVEvt;
if ( !bAlt &&
pView->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt ) != SDRHIT_NONE &&
- aVEvt.pObj != NULL )
+ aVEvt.mpObj != NULL )
{
- if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) ) // ImageMap
+ if ( ScDrawLayer::GetIMapInfo( aVEvt.mpObj ) ) // ImageMap
{
- const IMapObject* pIMapObj =
- ScDrawLayer::GetHitIMapObject( aVEvt.pObj, aMDPos, *pWindow );
+ const IMapObject* pIMapObj = ScDrawLayer::GetHitIMapObject( *aVEvt.mpObj, aMDPos, *pWindow );
if ( pIMapObj && pIMapObj->GetURL().Len() )
{
sURL = pIMapObj->GetURL();
sTarget = pIMapObj->GetTarget();
}
}
- if ( aVEvt.eEvent == SDREVENT_EXECUTEURL && aVEvt.pURLField ) // URL
+ if ( aVEvt.meEvent == SDREVENT_EXECUTEURL && aVEvt.maURLField.Len() ) // URL
{
- sURL = aVEvt.pURLField->GetURL();
- sTarget = aVEvt.pURLField->GetTargetFrame();
+ sURL = aVEvt.maURLField;
+ sTarget = aVEvt.maTargetFrame;
}
}
@@ -263,7 +262,6 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
// Is another object being edited in this view?
- // (Editing is ended in MarkListHasChanged - test before UnmarkAll)
SfxInPlaceClient* pClient = pViewShell->GetIPClient();
sal_Bool bWasOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
@@ -274,18 +272,17 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
if ( !rMEvt.IsShift() || bCaptionClicked || IsNoteCaptionMarked() )
pView->UnmarkAll();
- /* Unlock internal layer, if a note caption is clicked. The
- layer will be relocked in ScDrawView::MarkListHasChanged(). */
+ /* Unlock internal layer, if a note caption is clicked */
if( bCaptionClicked )
pView->UnlockInternalLayer();
// try to select the clicked object
- if ( pView->MarkObj( aMDPos, -2, sal_False, rMEvt.IsMod1() ) )
+ if ( pView->MarkObj( aMDPos, 2.0, false, rMEvt.IsMod1() ) )
{
//*********************************************************
//Objekt verschieben
//********************************************************
- if (pView->IsMarkedHit(aMDPos))
+ if (pView->IsMarkedObjHit(aMDPos))
{
// #95834# Don't start drag timer if inplace editing of an OLE object
// was just ended with this mouse click - the view will be moved
@@ -295,7 +292,7 @@ sal_Bool __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
aDragTimer.Start();
pHdl=pView->PickHandle(aMDPos);
- pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl);
+ pView->BegDragObj(aMDPos, pHdl);
bReturn = sal_True;
}
else // Objekt am Rand getroffen
@@ -342,20 +339,21 @@ sal_Bool __EXPORT FuSelection::MouseMove(const MouseEvent& rMEvt)
if (aDragTimer.IsActive() )
{
- Point aOldPixel = pWindow->LogicToPixel( aMDPos );
- Point aNewPixel = rMEvt.GetPosPixel();
- if ( Abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE ||
- Abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE )
+ const basegfx::B2DPoint aOldPixel(pWindow->GetViewTransformation() * aMDPos);
+ const basegfx::B2DPoint aNewPixel(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+
+ if ( fabs( aOldPixel.getX() - aNewPixel.getX() ) > SC_MAXDRAGMOVE ||
+ fabs( aOldPixel.getY() - aNewPixel.getY() ) > SC_MAXDRAGMOVE )
aDragTimer.Stop();
}
if ( pView->IsAction() )
{
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt(pWindow->PixelToLogic(aPix));
+ const Point aPix(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(aPix.X(), aPix.Y()));
ForceScroll(aPix);
- pView->MovAction(aPnt);
+ pView->MovAction(aLogicPos);
bReturn = sal_True;
}
@@ -397,13 +395,13 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
aDragTimer.Stop();
}
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPnt(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
bool bCopy = false;
ScViewData* pViewData = ( pViewShell ? pViewShell->GetViewData() : NULL );
ScDocument* pDocument = ( pViewData ? pViewData->GetDocument() : NULL );
SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : NULL );
- SdrPage* pPage = ( pPageView ? pPageView->GetPage() : NULL );
+ SdrPage* pPage = ( pPageView ? &pPageView->getSdrPageFromSdrPageView() : NULL );
::std::vector< ::rtl::OUString > aExcludedChartNames;
ScRangeListVector aProtectedChartRangesVector;
@@ -422,32 +420,24 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
}
if ( pView && pDocument )
{
- const SdrMarkList& rSdrMarkList = pView->GetMarkedObjectList();
- sal_uLong nMarkCount = rSdrMarkList.GetMarkCount();
- for ( sal_uLong i = 0; i < nMarkCount; ++i )
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrMark* pMark = rSdrMarkList.GetMark( i );
- SdrObject* pObj = ( pMark ? pMark->GetMarkedSdrObj() : NULL );
- if ( pObj )
- {
- ScChartHelper::AddRangesIfProtectedChart( aProtectedChartRangesVector, pDocument, pObj );
- }
+ ScChartHelper::AddRangesIfProtectedChart( aProtectedChartRangesVector, pDocument, aSelection[i] );
}
}
bCopy = true;
}
pView->EndDragObj( rMEvt.IsMod1() );
- pView->ForceMarkedToAnotherPage();
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ if (pSelected)
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
FuText* pText = static_cast<FuText*>(pPoor);
- pText->StopDragMode(pObj );
+ pText->StopDragMode(*pSelected);
}
bReturn = sal_True;
}
@@ -456,25 +446,27 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
// unlock internal layer to include note captions
pView->UnlockInternalLayer();
pView->EndAction();
- if ( pView->AreObjectsMarked() )
+
+ if(pView->areSdrObjectsSelected())
{
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
bReturn = sal_True;
/* if multi-selection contains a note caption object, remove
all other objects from selection. */
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uLong nCount = rMarkList.GetMarkCount();
- if( nCount > 1 )
+ if( aSelection.size() > 1 )
{
bool bFound = false;
- for( sal_uLong nIdx = 0; !bFound && (nIdx < nCount); ++nIdx )
+
+ for( sal_uInt32 nIdx = 0; !bFound && (nIdx < aSelection.size()); ++nIdx )
{
- SdrObject* pObj = rMarkList.GetMark( nIdx )->GetMarkedSdrObj();
- bFound = ScDrawLayer::IsNoteCaption( pObj );
+ SdrObject* pObj = aSelection[nIdx];
+ bFound = ScDrawLayer::IsNoteCaption( *pObj );
+
if( bFound )
{
- pView->UnMarkAll();
- pView->MarkObj( pObj, pView->GetSdrPageView() );
+ pView->UnmarkAllObj();
+ pView->MarkObj( *pObj );
}
}
}
@@ -507,81 +499,66 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
sal_uInt16 nClicks = rMEvt.GetClicks();
if ( nClicks == 2 && rMEvt.IsLeft() )
{
- if ( pView->AreObjectsMarked() )
+ SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if ( pSelected )
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ // #43984# aktivieren nur, wenn die Maus auch (noch) ueber dem
+ // selektierten Objekt steht
+ SdrViewEvent aVEvt;
+ SdrHitKind eHit = pView->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt );
+
+ if ( eHit != SDRHIT_NONE && aVEvt.mpObj == pSelected )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
+ //
+ // OLE: aktivieren
+ //
- // #43984# aktivieren nur, wenn die Maus auch (noch) ueber dem
- // selektierten Objekt steht
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pSelected) ;
- SdrViewEvent aVEvt;
- SdrHitKind eHit = pView->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt );
- if ( eHit != SDRHIT_NONE && aVEvt.pObj == pObj )
+ if (pSdrOle2Obj && !bOle && pSdrOle2Obj->GetObjRef().is())
{
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
+ pViewShell->ActivateObject( pSdrOle2Obj, 0 );
+ }
- //
- // OLE: aktivieren
- //
+ //
+ // Edit text
+ // #49458# not in UNO controls
+ // #i32352# not in media objects
+ //
+ else if ( dynamic_cast< SdrTextObj* >(pSelected)
+ && !dynamic_cast< SdrUnoObj* >(pSelected)
+ && !dynamic_cast< SdrMediaObj* >(pSelected) )
+ {
+ OutlinerParaObject* pOPO = pSelected->GetOutlinerParaObject();
+ sal_Bool bVertical = ( pOPO && pOPO->IsVertical() );
+ sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
- if (nSdrObjKind == OBJ_OLE2)
- {
- if (!bOle)
- {
- if (((SdrOle2Obj*) pObj)->GetObjRef().is())
- {
- //HMHpView->HideMarkHdl();
- pViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0 );
- }
- }
- }
+ pViewShell->GetViewData()->GetDispatcher().
+ Execute(nTextSlotId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD);
- //
- // Edit text
- // #49458# not in UNO controls
- // #i32352# not in media objects
- //
- else if ( pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) && !pObj->ISA(SdrMediaObj) )
+ // jetzt den erzeugten FuText holen und in den EditModus setzen
+ FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
+ if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // hat keine RTTI
{
- OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
- sal_Bool bVertical = ( pOPO && pOPO->IsVertical() );
- sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
-
- pViewShell->GetViewData()->GetDispatcher().
- Execute(nTextSlotId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD);
-
- // jetzt den erzeugten FuText holen und in den EditModus setzen
- FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
- if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // hat keine RTTI
- {
- FuText* pText = (FuText*)pPoor;
- Point aMousePixel = rMEvt.GetPosPixel();
- pText->SetInEditMode( pObj, &aMousePixel );
- }
- bReturn = sal_True;
+ FuText* pText = (FuText*)pPoor;
+ Point aMousePixel = rMEvt.GetPosPixel();
+ pText->SetInEditMode( pSelected, &aMousePixel );
}
+ bReturn = sal_True;
}
}
}
else if ( TestDetective( pView->GetSdrPageView(), aPnt ) )
+ {
bReturn = sal_True;
+ }
}
// Ein VCControl ist aktiv
// Event an den Manager weiterleiten
if( bVCAction )
{
- // GetSbxForm gibts nicht mehr - Basic-Controls sind tot
- //SdrPageView* pPgView = pView->GetPageViewByIndex(0);
- //ScDrawPage* pPage = (ScDrawPage*)pPgView->GetPage();
- //VCSbxForm* pForm = (VCSbxForm*)(SbxObject*)(pPage->GetSbxForm());
- //((VCManager*)(pForm->GetVCContainer()))->
- // MouseButtonUp( pWindow, rMEvt );
- //HMHpView->ShowMarkHdl();
bVCAction = sal_False;
bReturn = sal_True;
}
diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx
index c4ffc2eff010..7a6014031fb3 100644
--- a/sc/source/ui/drawfunc/fusel2.cxx
+++ b/sc/source/ui/drawfunc/fusel2.cxx
@@ -33,6 +33,7 @@
#include <svx/svdpagv.hxx>
#include <sfx2/dispatch.hxx>
#include <editeng/outliner.hxx>
+#include <svx/svdlegacy.hxx>
#include "fusel.hxx"
#include "tabvwsh.hxx"
@@ -50,43 +51,41 @@
// -----------------------------------------------------------------------
-inline long Diff( const Point& rP1, const Point& rP2 )
+inline double Diff( const basegfx::B2DPoint& rP1, const basegfx::B2DPoint& rP2 )
{
- long nX = rP1.X() - rP2.X();
- if (nX<0) nX = -nX;
- long nY = rP1.Y() - rP2.Y();
- if (nY<0) nY = -nY;
- return nX+nY;
+ const basegfx::B2DVector aDiff(absolute(rP1 - rP2));
+
+ return aDiff.getX() + aDiff.getY();
}
-sal_Bool FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos )
+bool FuSelection::TestDetective( SdrPageView* pPV, const basegfx::B2DPoint& rPos )
{
if (!pPV)
- return sal_False;
+ return false;
- sal_Bool bFound = sal_False;
- SdrObjListIter aIter( *pPV->GetObjList(), IM_FLAT );
+ bool bFound(false);
+ SdrObjListIter aIter( *pPV->GetCurrentObjectList(), IM_FLAT );
SdrObject* pObject = aIter.Next();
while (pObject && !bFound)
{
if (ScDetectiveFunc::IsNonAlienArrow( pObject ))
{
- sal_uInt16 nHitLog = (sal_uInt16) pWindow->PixelToLogic(
- Size(pView->GetHitTolerancePixel(),0)).Width();
- if (SdrObjectPrimitiveHit(*pObject, rPos, nHitLog, *pPV, 0, false))
+ const double fHitLog(basegfx::B2DVector(pWindow->GetInverseViewTransformation() * basegfx::B2DVector(pView->GetHitTolerancePixel(), 0.0)).getLength());
+
+ if (SdrObjectPrimitiveHit(*pObject, rPos, fHitLog, pPV->GetView(), false, 0))
{
ScViewData* pViewData = pViewShell->GetViewData();
ScSplitPos ePos = pViewShell->FindWindow( pWindow );
- Point aLineStart = pObject->GetPoint(0);
- Point aLineEnd = pObject->GetPoint(1);
- Point aPixel = pWindow->LogicToPixel( aLineStart );
+ const basegfx::B2DPoint aLineStart(pObject->GetObjectPoint(0));
+ const basegfx::B2DPoint aLineEnd(pObject->GetObjectPoint(1));
+ basegfx::B2DPoint aPixel = pWindow->GetViewTransformation() * aLineStart;
SCsCOL nStartCol;
SCsROW nStartRow;
- pViewData->GetPosFromPixel( aPixel.X(), aPixel.Y(), ePos, nStartCol, nStartRow );
- aPixel = pWindow->LogicToPixel( aLineEnd );
+ pViewData->GetPosFromPixel(basegfx::fround(aPixel.getX()), basegfx::fround(aPixel.getY()), ePos, nStartCol, nStartRow);
+ aPixel = pWindow->GetViewTransformation() * aLineEnd;
SCsCOL nEndCol;
SCsROW nEndRow;
- pViewData->GetPosFromPixel( aPixel.X(), aPixel.Y(), ePos, nEndCol, nEndRow );
+ pViewData->GetPosFromPixel(basegfx::fround(aPixel.getX()), basegfx::fround(aPixel.getY()), ePos, nEndCol, nEndRow);
SCsCOL nCurX = (SCsCOL) pViewData->GetCurX();
SCsROW nCurY = (SCsROW) pViewData->GetCurY();
sal_Bool bStart = ( Diff( rPos,aLineStart ) > Diff( rPos,aLineEnd ) );
@@ -109,7 +108,7 @@ sal_Bool FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos )
}
pViewShell->MoveCursorRel( nDifX, nDifY, SC_FOLLOW_JUMP, sal_False );
- bFound = sal_True;
+ bFound = true;
}
}
@@ -122,17 +121,17 @@ bool FuSelection::IsNoteCaptionMarked() const
{
if( pView )
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if( pSelected )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- return ScDrawLayer::IsNoteCaption( pObj );
+ return ScDrawLayer::IsNoteCaption( *pSelected );
}
}
return false;
}
-bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const
+bool FuSelection::IsNoteCaptionClicked( const basegfx::B2DPoint& rPos ) const
{
SdrPageView* pPageView = pView ? pView->GetSdrPageView() : 0;
if( pPageView )
@@ -144,12 +143,12 @@ bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const
bool bProtectDoc = rDoc.IsTabProtected( nTab ) || (pDocSh && pDocSh->IsReadOnly());
// search the last object (on top) in the object list
- SdrObjListIter aIter( *pPageView->GetObjList(), IM_DEEPNOGROUPS, sal_True );
+ SdrObjListIter aIter( *pPageView->GetCurrentObjectList(), IM_DEEPNOGROUPS, sal_True );
for( SdrObject* pObj = aIter.Next(); pObj; pObj = aIter.Next() )
{
- if( pObj->GetLogicRect().IsInside( rPos ) )
+ if( sdr::legacy::GetLogicRange(*pObj).isInside( rPos ) )
{
- if( const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObj, nTab ) )
+ if( const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( *pObj, nTab ) )
{
const ScAddress& rNotePos = pCaptData->maStart;
// skip caption objects of notes in protected cells
@@ -166,11 +165,11 @@ bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const
void FuSelection::ActivateNoteHandles(SdrObject* pObject)
{
- if( pView && ScDrawLayer::IsNoteCaption( pObject ) )
+ if( pView && pObject && ScDrawLayer::IsNoteCaption( *pObject ) )
{
- // Leave the internal layer unlocked - relock in ScDrawView::MarkListHasChanged()
+ // Leave the internal layer unlocked
pView->UnlockInternalLayer();
- pView->MarkObj( pObject, pView->GetSdrPageView() );
+ pView->MarkObj( *pObject );
}
}
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 61e2ebedec26..4293e286ee3a 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -28,7 +28,6 @@
#include <svx/svdoutl.hxx>
#include <editeng/outlobj.hxx>
#include <svx/sdtaaitm.hxx>
-#include <svx/sdtacitm.hxx>
#include <svx/svdotext.hxx>
#include <editeng/unolingu.hxx>
#include <svx/svdocapt.hxx>
@@ -38,6 +37,7 @@
#include <svx/svxids.hrc>
#include <editeng/eeitem.hxx>
#include <svl/itemset.hxx>
+#include <svx/svdlegacy.hxx>
#include "futext.hxx"
#include "drwlayer.hxx"
@@ -139,14 +139,15 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
{
if( !IsSizingOrMovingNote(rMEvt) )
StopEditMode(); // Danebengeklickt, Ende mit Edit
- pView->SetCreateMode();
+ pView->SetViewEditMode(SDREDITMODE_CREATE);
}
- aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * aPixelPos);
if ( rMEvt.IsLeft() )
{
- SdrHdl* pHdl = pView->PickHandle(aMDPos);
+ SdrHdl* pHdl = pView->PickHandle(aLogicPos);
sal_uLong nHdlNum = pView->GetHdlNum(pHdl);
@@ -164,29 +165,28 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
}
else
{
- pView->UnmarkPoint(*pHdl);
+ pView->MarkPoint(*pHdl, true); // unmark
}
}
else
{
if (!bPointMarked)
{
- pView->UnmarkAllPoints();
+ pView->MarkPoints(0, true); // unmarkall
pView->MarkPoint(*pHdl);
}
}
- pHdl=pView->GetHdl(nHdlNum);
+ pHdl=pView->GetHdlByIndex(nHdlNum);
}
}
SdrObject* pObj;
- SdrPageView* pPV;
- if ( pHdl != NULL || pView->IsMarkedHit(aMDPos) )
+ if ( pHdl != NULL || pView->IsMarkedObjHit(aLogicPos) )
{
if (pHdl == NULL &&
-// pView->TakeTextEditObject(aMDPos, pObj, pPV) )
- pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKTEXTEDIT) )
+// pView->TakeTextEditObject(aLogicPos, pObj, pPV) )
+ pView->PickObj(aLogicPos, pView->getHitTolLog(), pObj, SDRSEARCH_PICKTEXTEDIT) )
{
SdrOutliner* pO = MakeOutliner();
lcl_UpdateHyphenator( *pO, pObj );
@@ -202,7 +202,7 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
pO->SetVertical( bVertical );
//!?? ohne uebergebenen Outliner stimmen die Defaults nicht ???!?
- if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, sal_True, pO) )
+ if ( pView->SdrBeginTextEdit(pObj, pWindow, sal_True, pO) )
{
// EditEngine-UndoManager anmelden
pViewShell->SetDrawTextUndo( &pO->GetUndoManager() );
@@ -216,11 +216,11 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
{
// disable tail & circular move for caption objects.
bool bDrag = false;
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if( pSelected )
{
- SdrObject* pMarkedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
+ if( ScDrawLayer::IsNoteCaption( *pSelected ) )
{
if(pHdl->GetKind() != HDL_POLY && pHdl->GetKind() != HDL_CIRC)
bDrag = true;
@@ -234,7 +234,7 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
if ( bDrag )
{
aDragTimer.Start();
- pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl);
+ pView->BegDragObj(aLogicPos, pHdl);
}
}
}
@@ -242,23 +242,23 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
{
sal_Bool bMacro = sal_False;
-// if (bMacro && pView->TakeMacroObject(aMDPos,pObj,pPV))
- if (bMacro && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
+// if (bMacro && pView->TakeMacroObject(aLogicPos,pObj,pPV))
+ if (bMacro && pView->PickObj(aLogicPos, pView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO) )
{
- pView->BegMacroObj(aMDPos,pObj,pPV,pWindow);
+ pView->BegMacroObj(aLogicPos, 2.0, pObj, pWindow);
}
else
{
if (pView->IsEditMode())
{
- sal_Bool bPointMode=pView->HasMarkablePoints();
+ const bool bPointMode(pView->HasMarkablePoints());
if (!rMEvt.IsShift())
{
if (bPointMode)
{
- pView->UnmarkAllPoints();
+ pView->MarkPoints(0, true); // unmarkall
}
else
{
@@ -269,32 +269,32 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_OBJECT_ROTATE );
rBindings.Invalidate( SID_OBJECT_MIRROR );
- pHdl=pView->GetHdl(nHdlNum);
+ pHdl=pView->GetHdlByIndex(nHdlNum);
}
- if ( pView->MarkObj(aMDPos, -2, sal_False, rMEvt.IsMod1()) )
+ if ( pView->MarkObj(aLogicPos, 2.0, false, rMEvt.IsMod1()) )
{
aDragTimer.Start();
- pHdl=pView->PickHandle(aMDPos);
+ pHdl=pView->PickHandle(aLogicPos);
if (pHdl!=NULL)
{
pView->MarkPoint(*pHdl);
- pHdl=pView->GetHdl(nHdlNum);
+ pHdl=pView->GetHdlByIndex(nHdlNum);
}
- pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl);
+ pView->BegDragObj(aLogicPos, pHdl);
}
else
{
if (bPointMode)
{
- pView->BegMarkPoints(aMDPos);
+ pView->BegMarkPoints(aLogicPos);
}
else
{
- pView->BegMarkObj(aMDPos);
+ pView->BegMarkObj(aLogicPos);
}
}
}
@@ -311,7 +311,7 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
/**********************************************************
* Objekt erzeugen
**********************************************************/
- pView->BegCreateObj(aMDPos, (OutputDevice*) NULL);
+ pView->BegCreateObj(aLogicPos);
}
}
}
@@ -325,8 +325,7 @@ sal_Bool __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
lcl_InvalidateAttribs( pViewShell->GetViewFrame()->GetBindings() );
}
- pViewShell->SetActivePointer(pView->GetPreferedPointer(
- pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
+ pViewShell->SetActivePointer(pView->GetPreferedPointer(aLogicPos, pWindow ));
// return (bReturn);
return sal_True;
@@ -344,15 +343,16 @@ sal_Bool __EXPORT FuText::MouseMove(const MouseEvent& rMEvt)
// pViewShell->SetActivePointer(aNewPointer);
- pViewShell->SetActivePointer(pView->GetPreferedPointer(
- pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aMousePos(pWindow->GetInverseViewTransformation() * aPixelPos);
+ pViewShell->SetActivePointer(pView->GetPreferedPointer(aMousePos, pWindow ));
if (aDragTimer.IsActive() )
{
- Point aOldPixel = pWindow->LogicToPixel( aMDPos );
- Point aNewPixel = rMEvt.GetPosPixel();
- if ( Abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE ||
- Abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE )
+ const basegfx::B2DPoint aOldPixel(pWindow->GetViewTransformation() * aMDPos);
+
+ if ( fabs( aOldPixel.getX() - aPixelPos.getX() ) > SC_MAXDRAGMOVE ||
+ fabs( aOldPixel.getY() - aPixelPos.getY() ) > SC_MAXDRAGMOVE )
aDragTimer.Stop();
}
@@ -364,11 +364,11 @@ sal_Bool __EXPORT FuText::MouseMove(const MouseEvent& rMEvt)
/* aNewPointer = Pointer(POINTER_TEXT);
pViewShell->SetActivePointer(aNewPointer);
*/
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt(pWindow->PixelToLogic(aPix));
+ const Point aPix(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(aPix.X(), aPix.Y()));
ForceScroll(aPix);
- pView->MovAction(aPnt);
+ pView->MovAction(aLogicPos);
}
// ForcePointer(&rMEvt);
@@ -396,7 +396,8 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
lcl_InvalidateAttribs( pViewShell->GetViewFrame()->GetBindings() );
- Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aPnt(pWindow->GetInverseViewTransformation() * aPixelPos);
if ( pView->MouseButtonUp(rMEvt, pWindow) )
return (sal_True); // Event von der SdrView ausgewertet
@@ -404,18 +405,16 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
if ( pView->IsDragObj() )
{
pView->EndDragObj( rMEvt.IsShift() );
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
+
+ if (pSelected)
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
FuPoor* pPoor = pViewShell->GetViewData()->GetView()->GetDrawFuncPtr();
FuText* pText = static_cast<FuText*>(pPoor);
- pText->StopDragMode(pObj );
+ pText->StopDragMode(*pSelected);
}
- pView->ForceMarkedToAnotherPage();
}
- else if ( pView->IsCreateObj() )
+ else if ( pView->GetCreateObj() )
{
if (rMEvt.IsLeft())
{
@@ -423,24 +422,23 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
if (aSfxRequest.GetSlot() == SID_DRAW_TEXT_MARQUEE)
{
// Lauftext-Objekt erzeugen?
+ SdrObject* pSelected = pView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMark(0))
+ if (pSelected)
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
// die fuer das Scrollen benoetigten Attribute setzen
SfxItemSet aItemSet( pDrDoc->GetItemPool(),
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
- aItemSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aItemSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
aItemSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
aItemSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
- aItemSet.Put( SdrTextAniCountItem( 1 ) );
+ aItemSet.Put( SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, 1 ) );
aItemSet.Put( SdrTextAniAmountItem(
(sal_Int16)pWindow->PixelToLogic(Size(2,1)).Width()) );
- pObj->SetMergedItemSetAndBroadcast(aItemSet);
+
+ pSelected->SetMergedItemSetAndBroadcast(aItemSet);
}
}
@@ -449,24 +447,18 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotID);
if(bVertical)
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if(rMarkList.GetMark(0))
- {
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if(pObj && pObj->ISA(SdrTextObj))
- {
- SdrTextObj* pText = (SdrTextObj*)pObj;
- SfxItemSet aSet(pDrDoc->GetItemPool());
+ SdrTextObj* pSelected = dynamic_cast< SdrTextObj* >(pView->getSelectedIfSingle());
- pText->SetVerticalWriting(sal_True);
+ if(pSelected)
+ {
+ SfxItemSet aSet(pDrDoc->GetItemPool());
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ pSelected->SetVerticalWriting(sal_True);
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_True));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False));
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
-
- pText->SetMergedItemSet(aSet);
- }
+ pSelected->SetMergedItemSet(aSet);
}
}
@@ -475,12 +467,12 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
// Modus verlassen bei einzelnem Klick
// (-> fuconstr)
- if ( !pView->AreObjectsMarked() )
+ if ( !pView->areSdrObjectsSelected() )
{
- pView->MarkObj(aPnt, -2, sal_False, rMEvt.IsMod1());
+ pView->MarkObj(aPnt, 2.0, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
- if ( pView->AreObjectsMarked() )
+ if ( pView->areSdrObjectsSelected() )
rDisp.Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
else
rDisp.Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
@@ -495,12 +487,12 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
{
pWindow->ReleaseMouse();
- if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 )
+ if ( !pView->areSdrObjectsSelected() && rMEvt.GetClicks() < 2 )
{
- pView->MarkObj(aPnt, -2, sal_False, rMEvt.IsMod1());
+ pView->MarkObj(aPnt, 2.0, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData()->GetDispatcher();
- if ( pView->AreObjectsMarked() )
+ if ( pView->areSdrObjectsSelected() )
rDisp.Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
else
rDisp.Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
@@ -519,49 +511,6 @@ sal_Bool __EXPORT FuText::MouseButtonUp(const MouseEvent& rMEvt)
void FuText::ForcePointer(const MouseEvent* /* pMEvt */)
{
pViewShell->SetActivePointer( aNewPointer );
-
-/*
- if ( !pView->IsAction() )
- {
- Point aPnt(pWindow->PixelToLogic( pWindow->ScreenToOutputPixel(
- Pointer::GetPosPixel() ) ) );
- SdrHdl* pHdl=pView->HitHandle(aPnt, *pWindow);
-
- if (pHdl!=NULL)
- {
- pViewShell->SetActivePointer(pHdl->GetPointer() );
- }
- else
- {
- SdrObject* pObj;
- SdrPageView* pPV;
-
- if ( pView->IsMarkedHit(aPnt) )
- {
- if ( pView->TakeTextEditObject(aPnt, pObj, pPV) )
- {
- pViewShell->SetActivePointer(Pointer(POINTER_TEXT));
- }
- else
- {
- pViewShell->SetActivePointer(Pointer(POINTER_MOVE));
- }
- }
- else
- {
-// if ( pView->TakeMacroObject(aPnt, pObj, pPV) )
- if ( pView->PickObj(aPnt, pObj, pPV, SDRSEARCH_PICKMACRO) )
- {
- pViewShell->SetActivePointer( pObj->GetMacroPointer() );
- }
- else
- {
- pViewShell->SetActivePointer( aNewPointer );
- }
- }
- }
- }
-*/
}
@@ -607,28 +556,12 @@ void FuText::Activate()
rBindings.Invalidate( SID_OBJECT_ROTATE );
rBindings.Invalidate( SID_OBJECT_MIRROR );
-// Sofort in den Edit Mode setzen
-// SetInEditMode();
+ sal_uInt16 nObj = OBJ_TEXT;
-// if (!pTextObj)
- {
- /**********************************************************************
- * Kein Textobjekt im EditMode, daher CreateMode setzen
- **********************************************************************/
- sal_uInt16 nObj = OBJ_TEXT;
-
-/* sal_uInt16 nIdent;
- sal_uInt32 nInvent;
- pView->TakeCurrentObj(nIdent, nInvent);
-*/
- pView->SetCurrentObj(nObj);
-
- pView->SetCreateMode();
- }
+ pView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+ pView->SetViewEditMode(SDREDITMODE_CREATE);
aNewPointer = Pointer(POINTER_TEXT);
-// aNewPointer = Pointer(POINTER_CROSS); //! ???
-
aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer );
@@ -662,59 +595,25 @@ void FuText::SelectionHasChanged()
SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_OBJECT_ROTATE );
rBindings.Invalidate( SID_OBJECT_MIRROR );
+ pTextObj = dynamic_cast< SdrTextObj* >(pView->getSelectedIfSingle());
- pTextObj = NULL;
-
- if ( pView->AreObjectsMarked() )
+ if(pTextObj)
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
+ const sal_uInt16 nSdrObjKind = pTextObj->GetObjIdentifier();
- if (rMarkList.GetMarkCount() == 1)
+ if (nSdrObjKind != OBJ_TEXT ||
+ nSdrObjKind != OBJ_TITLETEXT ||
+ nSdrObjKind != OBJ_OUTLINETEXT)
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
-
- if (nSdrObjKind == OBJ_TEXT ||
- nSdrObjKind == OBJ_TITLETEXT ||
- nSdrObjKind == OBJ_OUTLINETEXT /* ||
- pObj->ISA(SdrTextObj) */ )
- {
- pTextObj = (SdrTextObj*) pObj;
- }
+ pTextObj = 0;
}
}
if (!pTextObj)
{
- /**********************************************************************
- * Kein Textobjekt im EditMode, daher CreateMode setzen
- **********************************************************************/
- sal_uInt16 nObj = OBJ_TEXT;
- sal_uInt16 nIdent;
- sal_uInt32 nInvent;
- pView->TakeCurrentObj(nIdent, nInvent);
-
-// if (! pView->IsEditMode() )
-// {
-// if (nIdent == OBJ_TEXT)
-// {
-// nObj = OBJ_TEXT;
-// }
-// else if (nIdent == OBJ_OUTLINETEXT)
-// {
-// nObj = OBJ_OUTLINETEXT;
-// }
-// else if (nIdent == OBJ_TITLETEXT)
-// {
-// nObj = OBJ_TITLETEXT;
-// }
-// }
-
- pView->SetCurrentObj(nObj);
-
- pView->SetCreateMode();
+ pView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+
+ pView->SetViewEditMode(SDREDITMODE_CREATE);
}
}
@@ -733,14 +632,9 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
if ( pObj && (pObj->GetLayer() == SC_LAYER_INTERN) )
pView->UnlockInternalLayer();
- if ( !pObj && pView->AreObjectsMarked() )
+ if ( !pObj && pView->areSdrObjectsSelected() )
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- pObj = pMark->GetMarkedSdrObj();
- }
+ pObj = pView->getSelectedIfSingle();
}
pTextObj = NULL;
@@ -752,10 +646,9 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
if (nSdrObjKind == OBJ_TEXT ||
nSdrObjKind == OBJ_TITLETEXT ||
nSdrObjKind == OBJ_OUTLINETEXT ||
- pObj->ISA(SdrTextObj))
+ dynamic_cast< SdrTextObj* >(pObj))
{
- SdrPageView* pPV = pView->GetSdrPageView();
- Rectangle aRect = pObj->GetLogicRect();
+ const Rectangle aRect(sdr::legacy::GetLogicRect(*pObj));
Point aPnt = aRect.Center();
if ( pObj->HasTextEdit() )
@@ -774,13 +667,13 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
pO->SetVertical( bVertical );
//!?? ohne uebergebenen Outliner stimmen die Defaults nicht ???!?
- if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, sal_True, pO) )
+ if ( pView->SdrBeginTextEdit(pObj, pWindow, sal_True, pO) )
{
// EditEngine-UndoManager anmelden
pViewShell->SetDrawTextUndo( &pO->GetUndoManager() );
pTextObj = (SdrTextObj*) pObj;
- pView->SetEditMode();
+ pView->SetViewEditMode(SDREDITMODE_EDIT);
// set text cursor to click position or to end,
// pass initial key event to outliner view
@@ -812,7 +705,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
}
// #98185# Create default drawing objects via keyboard
-SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_DRAW_TEXT:
// case SID_DRAW_TEXT_VERTICAL:
@@ -820,15 +713,16 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
// case SID_DRAW_NOTEEDIT:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- 0L, pDrDoc);
+ pView->getSdrModelFromSdrView(),
+ pView->getSdrObjectCreationInfo());
if(pObj)
{
- if(pObj->ISA(SdrTextObj))
+ SdrTextObj* pText = dynamic_cast< SdrTextObj* >(pObj);
+
+ if(pText)
{
- SdrTextObj* pText = (SdrTextObj*)pObj;
- pText->SetLogicRect(rRectangle);
+ sdr::legacy::SetLogicRange(*pText, rRange);
// #105815# don't set default text, start edit mode instead
// String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
@@ -843,8 +737,8 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
{
SfxItemSet aSet(pDrDoc->GetItemPool());
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_True));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False));
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
@@ -855,11 +749,11 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
{
SfxItemSet aSet(pDrDoc->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
- aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
aSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
aSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
- aSet.Put( SdrTextAniCountItem( 1 ) );
+ aSet.Put( SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, 1 ) );
aSet.Put( SdrTextAniAmountItem( (sal_Int16)pWindow->PixelToLogic(Size(2,1)).Width()) );
pObj->SetMergedItemSetAndBroadcast(aSet);
diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx
index dd3f5aced5b2..0439bed558a6 100644
--- a/sc/source/ui/drawfunc/futext2.cxx
+++ b/sc/source/ui/drawfunc/futext2.cxx
@@ -288,7 +288,7 @@ SdrOutliner* FuText::MakeOutliner()
// #i10426# The ref device isn't set to the EditEngine before SdrBeginTextEdit now,
// so the device must be taken from the model here.
- OutputDevice* pRef = pDrDoc->GetRefDevice();
+ OutputDevice* pRef = pDrDoc->GetReferenceDevice();
if (pRef && pRef != pWindow)
pRef->SetMapMode( MapMode(MAP_100TH_MM) );
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 2fdfffeab3ab..7789903890d2 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -73,7 +73,7 @@ void FuText::StopEditMode(sal_Bool /*bTextDirection*/)
ScAddress aNotePos;
ScPostIt* pNote = 0;
- if( const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObject, rViewData.GetTabNo() ) )
+ if( const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( *pObject, rViewData.GetTabNo() ) )
{
aNotePos = pCaptData->maStart;
pNote = rDoc.GetNote( aNotePos );
@@ -94,7 +94,7 @@ void FuText::StopEditMode(sal_Bool /*bTextDirection*/)
/* Note has been created before editing, if first undo action is
an insert action. Needed below to decide whether to drop the
undo if editing a new note has been cancelled. */
- bNewNote = (pCalcUndo->GetActionCount() > 0) && pCalcUndo->GetAction( 0 )->ISA( SdrUndoNewObj );
+ bNewNote = (pCalcUndo->GetActionCount() > 0) && dynamic_cast< SdrUndoNewObj* >(pCalcUndo->GetAction( 0 ));
// create a "insert note" undo action if needed
if( bNewNote )
pUndoMgr->AddUndoAction( new ScUndoReplaceNote( *pDocShell, aNotePos, pNote->GetNoteData(), true, pCalcUndo ) );
@@ -188,20 +188,20 @@ void FuText::StopEditMode(sal_Bool /*bTextDirection*/)
}
// Called following an EndDragObj() to update the new note rectangle position
-void FuText::StopDragMode(SdrObject* /*pObject*/)
+void FuText::StopDragMode(const SdrObject& /*rObject*/)
{
#if 0 // DR
ScViewData& rViewData = *pViewShell->GetViewData();
- if( ScDrawObjData* pData = ScDrawLayer::GetNoteCaptionData( pObject, rViewData.GetTabNo() ) )
+ if( ScDrawObjData* pData = ScDrawLayer::GetNoteCaptionData( rObject, rViewData.GetTabNo() ) )
{
ScDocument& rDoc = *rViewData.GetDocument();
const ScAddress& rPos = pData->maStart;
ScPostIt* pNote = rDoc.GetNote( rPos );
- DBG_ASSERT( pNote && (pNote->GetCaption() == pObject), "FuText::StopDragMode - missing or invalid cell note" );
+ DBG_ASSERT( pNote && (pNote->GetCaption() == &rObject), "FuText::StopDragMode - missing or invalid cell note" );
if( pNote )
{
Rectangle aOldRect = pNote->CalcRectangle( rDoc, rPos );
- Rectangle aNewRect = pObject->GetLogicRect();
+ Rectangle aNewRect = rObject.GetLogicRect();
if( aOldRect != aNewRect )
{
pNote->UpdateFromRectangle( rDoc, rPos, aNewRect );
@@ -212,7 +212,7 @@ void FuText::StopDragMode(SdrObject* /*pObject*/)
{
if(pCaption->IsAutoGrowHeight() && !bVertical)
{
- pCaption->SetMergedItem( SdrTextAutoGrowHeightItem( false ) );
+ pCaption->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false ) );
aNote.SetItemSet( *pDoc, pCaption->GetMergedItemSet() );
}
}
@@ -220,7 +220,7 @@ void FuText::StopDragMode(SdrObject* /*pObject*/)
{
if(pCaption->IsAutoGrowWidth() && bVertical)
{
- pCaption->SetMergedItem( SdrTextAutoGrowWidthItem( false ) );
+ pCaption->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false ) );
aNote.SetItemSet( *pDoc, pCaption->GetMergedItemSet() );
}
}
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 0be5cc1bb904..2ff09e347890 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -55,8 +55,6 @@ SFX_IMPL_INTERFACE(ScGraphicShell, ScDrawShell, ScResId(SCSTR_GRAPHICSHELL) )
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_GRAPHIC) );
}
-TYPEINIT1( ScGraphicShell, ScDrawShell );
-
ScGraphicShell::ScGraphicShell(ScViewData* pData) :
ScDrawShell(pData)
{
@@ -90,16 +88,8 @@ void ScGraphicShell::Execute( SfxRequest& rReq )
void ScGraphicShell::GetFilterState( SfxItemSet& rSet )
{
ScDrawView* pView = GetViewData()->GetScDrawView();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_Bool bEnable = sal_False;
-
- if( rMarkList.GetMarkCount() == 1 )
- {
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-
- if( pObj && pObj->ISA( SdrGrafObj ) && ( ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) )
- bEnable = sal_True;
- }
+ const SdrGrafObj* pSelected = dynamic_cast< SdrGrafObj* >(pView->getSelectedIfSingle());
+ const sal_Bool bEnable( pSelected && GRAPHIC_BITMAP == pSelected->GetGraphicType() );
if( !bEnable )
SvxGraphicFilter::DisableGraphicFilterSlots( rSet );
@@ -108,34 +98,25 @@ void ScGraphicShell::GetFilterState( SfxItemSet& rSet )
void ScGraphicShell::ExecuteFilter( SfxRequest& rReq )
{
ScDrawView* pView = GetViewData()->GetScDrawView();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
+ SdrGrafObj* pSelected = dynamic_cast< SdrGrafObj* >(pView->getSelectedIfSingle());
- if( rMarkList.GetMarkCount() == 1 )
+ if( pSelected && GRAPHIC_BITMAP == pSelected->GetGraphicType() )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ GraphicObject aFilterObj( pSelected->GetGraphicObject() );
- if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
+ if( SVX_GRAPHICFILTER_ERRCODE_NONE ==
+ SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) )
{
- GraphicObject aFilterObj( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
-
- if( SVX_GRAPHICFILTER_ERRCODE_NONE ==
- SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) )
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if( pPageView )
- {
- SdrGrafObj* pFilteredObj = (SdrGrafObj*) pObj->Clone();
- String aStr( pView->GetDescriptionOfMarkedObjects() );
-
- aStr.Append( sal_Unicode(' ') );
- aStr.Append( String( ScResId( SCSTR_UNDO_GRAFFILTER ) ) );
- pView->BegUndo( aStr );
- pFilteredObj->SetGraphicObject( aFilterObj );
- pView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
- pView->EndUndo();
- }
- }
+ SdrGrafObj* pFilteredObj = static_cast< SdrGrafObj* >(pSelected->CloneSdrObject());
+ String aStr;
+
+ pSelected->TakeObjNameSingul(aStr);
+ aStr.Append( sal_Unicode(' ') );
+ aStr.Append( String( ScResId( SCSTR_UNDO_GRAFFILTER ) ) );
+ pView->BegUndo( aStr );
+ pFilteredObj->SetGraphicObject( aFilterObj );
+ pView->ReplaceObjectAtView( *pSelected, *pFilteredObj );
+ pView->EndUndo();
}
}
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 05af38da9ed6..63bcf15d17ea 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -50,8 +50,6 @@ SFX_IMPL_INTERFACE(ScMediaShell, ScDrawShell, ScResId(SCSTR_GRAPHICSHELL) )
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_MEDIA) );
}
-TYPEINIT1( ScMediaShell, ScDrawShell );
-
ScMediaShell::ScMediaShell(ScViewData* pData) :
ScDrawShell(pData)
{
@@ -76,14 +74,14 @@ void ScMediaShell::GetMediaState( SfxItemSet& rSet )
{
if( SID_AVMEDIA_TOOLBOX == nWhich )
{
- SdrMarkList* pMarkList = new SdrMarkList( pView->GetMarkedObjectList() );
+ const SdrObjectVector aSdrObjectVector(pView->getSelectedSdrObjectVectorFromSdrMarkView());
bool bDisable = true;
- if( 1 == pMarkList->GetMarkCount() )
+ if( 1 == aSdrObjectVector.size() )
{
- SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
+ const SdrMediaObj* pObj = dynamic_cast< const SdrMediaObj* >(aSdrObjectVector[0]);
- if( pObj && pObj->ISA( SdrMediaObj ) )
+ if( pObj )
{
::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX );
@@ -95,8 +93,6 @@ void ScMediaShell::GetMediaState( SfxItemSet& rSet )
if( bDisable )
rSet.DisableItem( SID_AVMEDIA_TOOLBOX );
-
- delete pMarkList;
}
nWhich = aIter.NextWhich();
@@ -118,19 +114,17 @@ void ScMediaShell::ExecuteMedia( SfxRequest& rReq )
if( pItem )
{
- SdrMarkList* pMarkList = new SdrMarkList( pView->GetMarkedObjectList() );
+ const SdrObjectVector aSdrObjectVector(pView->getSelectedSdrObjectVectorFromSdrMarkView());
- if( 1 == pMarkList->GetMarkCount() )
+ if( 1 == aSdrObjectVector.size() )
{
- SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
+ const SdrMediaObj* pObj = dynamic_cast< const SdrMediaObj* >(aSdrObjectVector[0]);
- if( pObj && pObj->ISA( SdrMediaObj ) )
+ if( pObj )
{
static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem(
static_cast< const ::avmedia::MediaItem& >( *pItem ) );
}
-
- delete pMarkList;
}
}
}
diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx
index d98a919a78fc..d1e190969206 100644
--- a/sc/source/ui/drawfunc/oleobjsh.cxx
+++ b/sc/source/ui/drawfunc/oleobjsh.cxx
@@ -62,8 +62,6 @@ SFX_IMPL_INTERFACE(ScOleObjectShell, ScDrawShell, ScResId(SCSTR_OLEOBJECTSHELL)
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_OLE) );
}
-TYPEINIT1( ScOleObjectShell, ScDrawShell );
-
ScOleObjectShell::ScOleObjectShell(ScViewData* pData) :
ScDrawShell(pData)
{
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 11611faabb1d..cb2e17de4351 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -754,10 +754,10 @@ SfxChildAlignment __EXPORT ScFunctionDockWin::CheckAlignment(SfxChildAlignment /
#************************************************************************/
void ScFunctionDockWin::Notify( SfxBroadcaster&, const SfxHint& /* rHint */ )
{
-// const SfxPoolItemHint *pPoolItemHint = PTR_CAST(SfxPoolItemHint, &rHint);
+// const SfxPoolItemHint *pPoolItemHint = dynamic_cast< const SfxPoolItemHint* >( &rHint);
/*
if ( pPoolItemHint
- && ( pPoolItemHint->GetObject()->ISA( SvxColorTableItem ) ) )
+ && ( dynamic_cast< SvxColorTableItem* >(pPoolItemHint->GetObject()) ) )
{
// Die Liste der Farben hat sich geaendert
pColorTable = ( (SvxColorTableItem*) pPoolItemHint->GetObject() )->GetColorTable();
@@ -886,7 +886,7 @@ void ScFunctionDockWin::DoEnter(sal_Bool /* bOk */) //@@ ???
{
ScModule* pScMod = SC_MOD();
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, pCurSh);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( pCurSh);
ScInputHandler* pHdl = pScMod->GetInputHdl( pViewSh );
if(!pScMod->IsEditMode())
{
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 1e01d6676169..c38b5abb809f 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -101,7 +101,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
SfxViewFrame* pMyViewFrm = pMyDisp->GetFrame();
if (pMyViewFrm)
{
- pScViewShell = PTR_CAST( ScTabViewShell, pMyViewFrm->GetViewShell() );
+ pScViewShell = dynamic_cast< ScTabViewShell* >( pMyViewFrm->GetViewShell() );
if( pScViewShell )
pScViewShell->UpdateInputHandler(sal_True);
pParentDoc = pMyViewFrm->GetObjectShell();
@@ -286,13 +286,12 @@ sal_Bool ScFormulaDlg::IsInputHdl(ScInputHandler* pHdl)
// gehoert der InputHandler zu irgendeiner ViewShell ?
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( _IsSfxViewShell< ScTabViewShell > );
while ( pSh && !bAlive )
{
if (((ScTabViewShell*)pSh)->GetInputHandler() == pHdl)
bAlive = sal_True;
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, _IsSfxViewShell< ScTabViewShell > );
}
return bAlive;
@@ -307,7 +306,7 @@ ScInputHandler* ScFormulaDlg::GetNextInputHandler(ScDocShell* pDocShell,PtrTabVi
while( pFrame && pHdl==NULL)
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( p);
if(pViewSh!=NULL)
{
pHdl=pViewSh->GetInputHandler();
@@ -579,7 +578,7 @@ void ScFormulaDlg::clear()
pScMod->SetRefInputHdl(NULL);
// Enable() der Eingabezeile erzwingen:
- ScTabViewShell* pScViewShell = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pScViewShell = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
if ( pScViewShell )
pScViewShell->UpdateInputHandler();
}
@@ -596,7 +595,7 @@ void ScFormulaDlg::switchBack()
}
// aktuelle Tabelle ggF. restaurieren (wg. Maus-RefInput)
- ScTabViewShell* pScViewShell = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pScViewShell = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
if ( pScViewShell )
{
ScViewData* pVD=pScViewShell->GetViewData();
diff --git a/sc/source/ui/inc/AccessibilityHints.hxx b/sc/source/ui/inc/AccessibilityHints.hxx
index b883ed3aac15..65e742177365 100644
--- a/sc/source/ui/inc/AccessibilityHints.hxx
+++ b/sc/source/ui/inc/AccessibilityHints.hxx
@@ -43,7 +43,6 @@ class ScAccWinFocusLostHint : public SfxHint
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
xOldAccessible;
public:
- TYPEINFO();
ScAccWinFocusLostHint(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xOld );
~ScAccWinFocusLostHint();
@@ -57,7 +56,6 @@ class ScAccWinFocusGotHint : public SfxHint
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
xNewAccessible;
public:
- TYPEINFO();
ScAccWinFocusGotHint(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xNew );
~ScAccWinFocusGotHint();
@@ -70,7 +68,6 @@ class ScAccGridWinFocusLostHint : public ScAccWinFocusLostHint
{
ScSplitPos eOldGridWin;
public:
- TYPEINFO();
ScAccGridWinFocusLostHint( ScSplitPos eOldGridWin,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xOld );
~ScAccGridWinFocusLostHint();
@@ -82,7 +79,6 @@ class ScAccGridWinFocusGotHint : public ScAccWinFocusGotHint
{
ScSplitPos eNewGridWin;
public:
- TYPEINFO();
ScAccGridWinFocusGotHint( ScSplitPos eNewGridWin,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xNew );
~ScAccGridWinFocusGotHint();
diff --git a/sc/source/ui/inc/auditsh.hxx b/sc/source/ui/inc/auditsh.hxx
index f8185a247101..459115347ca4 100644
--- a/sc/source/ui/inc/auditsh.hxx
+++ b/sc/source/ui/inc/auditsh.hxx
@@ -38,7 +38,6 @@ private:
sal_uInt16 nFunction;
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_AUDITING_SHELL)
ScAuditingShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index fd1f3c6e9739..bb459bba5b3c 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -27,7 +27,6 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
#include <tools/link.hxx>
#include "formatsh.hxx"
@@ -65,7 +64,6 @@ private:
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_CELL_SHELL)
ScCellShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/chartsh.hxx b/sc/source/ui/inc/chartsh.hxx
index 2091e0092b91..e24a29169ffa 100644
--- a/sc/source/ui/inc/chartsh.hxx
+++ b/sc/source/ui/inc/chartsh.hxx
@@ -27,7 +27,6 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
class ScViewData;
@@ -37,7 +36,6 @@ class ScChartShell: public ScDrawShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_CHART_SHELL)
ScChartShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index c22747f484a7..905f81c72820 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -167,8 +167,6 @@ protected:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
public:
- TYPEINFO();
-
SFX_DECL_INTERFACE(SCID_DOC_SHELL)
SFX_DECL_OBJECTFACTORY();
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index bae217487f1b..c1c01e5f323f 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -27,7 +27,7 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
+#include <svx/svdobj.hxx>
#include <tools/link.hxx>
class AbstractSvxNameDialog; //CHINA001 class SvxNameDialog;
@@ -48,7 +48,6 @@ protected:
ScViewData* GetViewData() { return pViewData; }
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_DRAW_SHELL)
ScDrawShell(ScViewData* pData);
@@ -80,7 +79,7 @@ public:
ScDrawView* GetDrawView();
- sal_Bool AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList& rMark);
+ bool AreAllObjectsOnLayer(sal_uInt16 nLayerNo, const SdrObjectVector& rSelection);
};
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index efdda272b34a..16f1e2c0b82e 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -46,13 +46,12 @@ class ScDrawView: public FmFormView
SdrDropMarkerOverlay* pDropMarker;
SdrObject* pDropMarkObj;
sal_Bool bInConstruct;
- //HMHBOOL bDisableHdl;
void Construct();
void UpdateBrowser();
protected:
- virtual void ModelHasChanged();
+ virtual void LazyReactOnObjectChanges();
// add custom handles (used by other apps, e.g. AnchorPos)
virtual void AddCustomHdl();
@@ -66,12 +65,12 @@ public:
ScDrawView( OutputDevice* pOut, ScViewData* pData );
virtual ~ScDrawView();
- virtual void MarkListHasChanged();
+ virtual void handleSelectionChange();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
virtual void DoConnect(SdrOle2Obj* pOleObj);
- virtual void MakeVisible( const Rectangle& rRect, Window& rWin );
+ virtual void MakeVisibleAtView( const basegfx::B2DRange& rRange, Window& rWin );
virtual void DeleteMarked();
@@ -79,14 +78,12 @@ public:
void MarkDropObj( SdrObject* pObj );
- //HMHBOOL IsDisableHdl() const { return bDisableHdl; }
-
void SetMarkedToLayer( sal_uInt8 nLayerNo );
void InvalidateAttribs();
void InvalidateDrawTextAttrs();
- sal_Bool BeginDrag( Window* pWindow, const Point& rStartPos );
+ sal_Bool BeginDrag( Window* pWindow, const basegfx::B2DPoint& rStartPos );
void DoCut();
void DoCopy();
@@ -115,7 +112,7 @@ public:
bool HasMarkedControl() const;
bool HasMarkedInternal() const;
- FASTBOOL InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
+ bool InsertObjectSafe(SdrObject& rObj, sal_uLong nOptions=0);
/** Returns the selected object, if it is the caption object of a cell note.
@param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */
diff --git a/sc/source/ui/inc/drformsh.hxx b/sc/source/ui/inc/drformsh.hxx
index 5bcfac330bd5..9ebe30955404 100644
--- a/sc/source/ui/inc/drformsh.hxx
+++ b/sc/source/ui/inc/drformsh.hxx
@@ -27,7 +27,6 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
class ScViewData;
@@ -38,7 +37,6 @@ class ScDrawFormShell: public ScDrawShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_FORM_SHELL)
ScDrawFormShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/drtxtob.hxx b/sc/source/ui/inc/drtxtob.hxx
index acd63a0cbedb..f0becbcbea97 100644
--- a/sc/source/ui/inc/drtxtob.hxx
+++ b/sc/source/ui/inc/drtxtob.hxx
@@ -48,7 +48,6 @@ class ScDrawTextObjectBar : public SfxShell
DECL_LINK( ClipboardChanged, TransferableDataHelper* );
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_DRAW_TEXT_SHELL)
ScDrawTextObjectBar(ScViewData* pData);
diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx
index 32a52926e174..e9e41a9a37a1 100644
--- a/sc/source/ui/inc/editsh.hxx
+++ b/sc/source/ui/inc/editsh.hxx
@@ -53,7 +53,6 @@ private:
DECL_LINK( ClipboardChanged, TransferableDataHelper* );
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_EDIT_SHELL)
ScEditShell(EditView* pView, ScViewData* pData);
diff --git a/sc/source/ui/inc/formatsh.hxx b/sc/source/ui/inc/formatsh.hxx
index 06501dfabc3b..235877a28367 100644
--- a/sc/source/ui/inc/formatsh.hxx
+++ b/sc/source/ui/inc/formatsh.hxx
@@ -27,7 +27,6 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
class ScViewData;
@@ -42,7 +41,6 @@ protected:
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_FORMAT_SHELL)
ScFormatShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/fuconarc.hxx b/sc/source/ui/inc/fuconarc.hxx
index 550da4953c93..b70a3f5e9f7b 100644
--- a/sc/source/ui/inc/fuconarc.hxx
+++ b/sc/source/ui/inc/fuconarc.hxx
@@ -49,7 +49,7 @@ class FuConstArc : public FuConstruct
virtual void Deactivate(); // Function deaktivieren
// #98185# Create default drawing objects via keyboard
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
};
diff --git a/sc/source/ui/inc/fuconcustomshape.hxx b/sc/source/ui/inc/fuconcustomshape.hxx
index f8724bcbded1..d048bf13607f 100644
--- a/sc/source/ui/inc/fuconcustomshape.hxx
+++ b/sc/source/ui/inc/fuconcustomshape.hxx
@@ -47,7 +47,7 @@ public:
virtual void Deactivate(); // Function deaktivieren
// #98185# Create default drawing objects via keyboard
- virtual SdrObject* CreateDefaultObject( const sal_uInt16 nID, const Rectangle& rRectangle );
+ virtual SdrObject* CreateDefaultObject( const sal_uInt16 nID, const basegfx::B2DRange& rRange );
// #i33136#
virtual bool doConstructOrthogonal() const;
diff --git a/sc/source/ui/inc/fuconpol.hxx b/sc/source/ui/inc/fuconpol.hxx
index 0b009ae7b32d..7192ab4836e7 100644
--- a/sc/source/ui/inc/fuconpol.hxx
+++ b/sc/source/ui/inc/fuconpol.hxx
@@ -51,7 +51,7 @@ class FuConstPolygon : public FuConstruct
virtual void Deactivate(); // Function deaktivieren
// #98185# Create default drawing objects via keyboard
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
};
diff --git a/sc/source/ui/inc/fuconrec.hxx b/sc/source/ui/inc/fuconrec.hxx
index 3bbd5617a1df..3fe71d3661ea 100644
--- a/sc/source/ui/inc/fuconrec.hxx
+++ b/sc/source/ui/inc/fuconrec.hxx
@@ -49,7 +49,7 @@ class FuConstRectangle : public FuConstruct
virtual void Deactivate(); // Function deaktivieren
// #98185# Create default drawing objects via keyboard
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
};
diff --git a/sc/source/ui/inc/fuconuno.hxx b/sc/source/ui/inc/fuconuno.hxx
index 6fc01a0bff4f..b87f604e8e44 100644
--- a/sc/source/ui/inc/fuconuno.hxx
+++ b/sc/source/ui/inc/fuconuno.hxx
@@ -54,7 +54,7 @@ public:
virtual void Deactivate(); // Function deaktivieren
// #98185# Create default drawing objects via keyboard
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
};
diff --git a/sc/source/ui/inc/fudraw.hxx b/sc/source/ui/inc/fudraw.hxx
index 78b2795ba2c3..5675d581d2cc 100644
--- a/sc/source/ui/inc/fudraw.hxx
+++ b/sc/source/ui/inc/fudraw.hxx
@@ -57,8 +57,6 @@ class FuDraw : public FuPoor
virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
-
- // #97016# II
virtual void SelectionHasChanged();
sal_Bool IsSizingOrMovingNote( const MouseEvent& rMEvt ) const;
diff --git a/sc/source/ui/inc/fumark.hxx b/sc/source/ui/inc/fumark.hxx
index 5edd52d270b9..7db680814f24 100644
--- a/sc/source/ui/inc/fumark.hxx
+++ b/sc/source/ui/inc/fumark.hxx
@@ -37,8 +37,8 @@
class FuMarkRect : public FuPoor
{
protected:
- Point aBeginPos;
- Rectangle aZoomRect;
+ basegfx::B2DPoint aBeginPos;
+ basegfx::B2DRange aZoomRange;
sal_Bool bVisible;
sal_Bool bStartDrag;
ScRangeListRef aSourceRange;
diff --git a/sc/source/ui/inc/fupoor.hxx b/sc/source/ui/inc/fupoor.hxx
index 6de65ed871a2..64574d4325e7 100644
--- a/sc/source/ui/inc/fupoor.hxx
+++ b/sc/source/ui/inc/fupoor.hxx
@@ -27,15 +27,15 @@
#include <vcl/event.hxx>
#include <vcl/timer.hxx>
#include <sfx2/request.hxx>
+#include <basegfx/point/b2dpoint.hxx>
class ScDrawView;
class ScTabViewShell;
class Window;
class SdrModel;
class Dialog;
-
-// #98185# Create default drawing objects via keyboard
class SdrObject;
+namespace basegfx { class B2DRange; }
// Return-Werte fuer Command
#define SC_CMD_NONE 0
@@ -67,7 +67,7 @@ protected:
DECL_LINK( DragTimerHdl, Timer * );
DECL_LINK( DragHdl, void * );
sal_Bool bIsInDragMode;
- Point aMDPos; // Position von MouseButtonDown
+ basegfx::B2DPoint aMDPos; // Position von MouseButtonDown
// #95491# member to hold state of the mouse buttons for creation
// of own MouseEvents (like in ScrollHdl)
@@ -111,15 +111,15 @@ public:
sal_uInt16 GetSlotID() const { return( aSfxRequest.GetSlot() ); }
- sal_Bool IsDetectiveHit( const Point& rLogicPos );
+ bool IsDetectiveHit( const basegfx::B2DPoint& rLogicPos );
void StopDragTimer();
// #98185# Create default drawing objects via keyboard
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
protected:
- void ImpForceQuadratic(Rectangle& rRect);
+ void ImpForceQuadratic(basegfx::B2DRange& rRange);
public:
// #i33136#
diff --git a/sc/source/ui/inc/fusel.hxx b/sc/source/ui/inc/fusel.hxx
index a2567f1654df..c068ad57b250 100644
--- a/sc/source/ui/inc/fusel.hxx
+++ b/sc/source/ui/inc/fusel.hxx
@@ -65,10 +65,10 @@ protected:
sal_Bool bVCAction;
private:
- sal_Bool TestDetective( SdrPageView* pPV, const Point& rPos ); // -> fusel2
+ bool TestDetective( SdrPageView* pPV, const basegfx::B2DPoint& rPos ); // -> fusel2
bool IsNoteCaptionMarked() const;
- bool IsNoteCaptionClicked( const Point& rPos ) const;
+ bool IsNoteCaptionClicked( const basegfx::B2DPoint& rPos ) const;
};
diff --git a/sc/source/ui/inc/futext.hxx b/sc/source/ui/inc/futext.hxx
index ec6055584b6f..8285783e2038 100644
--- a/sc/source/ui/inc/futext.hxx
+++ b/sc/source/ui/inc/futext.hxx
@@ -62,10 +62,10 @@ public:
void SetInEditMode( SdrObject* pObj = NULL, const Point* pMousePixel = NULL,
sal_Bool bCursorToEnd = sal_False, const KeyEvent* pInitialKey = NULL );
void StopEditMode(sal_Bool bTextDirection = sal_False);
- void StopDragMode(SdrObject* pObject);
+ void StopDragMode(const SdrObject& rObject);
// #98185# Create default drawing objects via keyboard
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
private:
SdrOutliner* MakeOutliner();
diff --git a/sc/source/ui/inc/graphsh.hxx b/sc/source/ui/inc/graphsh.hxx
index 335fa60902cf..ddb8ea85c99e 100644
--- a/sc/source/ui/inc/graphsh.hxx
+++ b/sc/source/ui/inc/graphsh.hxx
@@ -27,7 +27,6 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
class ScViewData;
@@ -37,7 +36,6 @@ class ScGraphicShell: public ScDrawShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_GRAPHIC_SHELL)
ScGraphicShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index a3d4c051af20..127f72b73e26 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -245,7 +245,7 @@ private:
sal_Int8 AcceptPrivateDrop( const AcceptDropEvent& rEvt );
sal_Int8 ExecutePrivateDrop( const ExecuteDropEvent& rEvt );
sal_Int8 DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPosX, SCROW nDestPosY,
- const Point& rLogicPos, sal_Int8 nDndAction );
+ const basegfx::B2DPoint& rLogicPos, sal_Int8 nDndAction );
void HandleMouseButtonDown( const MouseEvent& rMEvt );
diff --git a/sc/source/ui/inc/mediash.hxx b/sc/source/ui/inc/mediash.hxx
index 07af10547ccf..7c4830d7ca67 100644
--- a/sc/source/ui/inc/mediash.hxx
+++ b/sc/source/ui/inc/mediash.hxx
@@ -27,7 +27,6 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
class ScViewData;
@@ -37,7 +36,6 @@ class ScMediaShell: public ScDrawShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_MEDIA_SHELL)
ScMediaShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/oleobjsh.hxx b/sc/source/ui/inc/oleobjsh.hxx
index fa03eac9e8b3..da4451b1f3e3 100644
--- a/sc/source/ui/inc/oleobjsh.hxx
+++ b/sc/source/ui/inc/oleobjsh.hxx
@@ -27,7 +27,6 @@
#include <sfx2/shell.hxx>
#include "shellids.hxx"
#include <sfx2/module.hxx>
-#include <svx/svdmark.hxx>
class ScViewData;
@@ -37,7 +36,6 @@ class ScOleObjectShell: public ScDrawShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_OLEOBJECT_SHELL)
ScOleObjectShell(ScViewData* pData);
diff --git a/sc/source/ui/inc/pgbrksh.hxx b/sc/source/ui/inc/pgbrksh.hxx
index 563307c4373a..1a6e0a14993c 100644
--- a/sc/source/ui/inc/pgbrksh.hxx
+++ b/sc/source/ui/inc/pgbrksh.hxx
@@ -34,7 +34,6 @@ class ScTabViewShell;
class ScPageBreakShell : public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_PAGEBREAK_SHELL)
ScPageBreakShell( ScTabViewShell* pView );
diff --git a/sc/source/ui/inc/pivotsh.hxx b/sc/source/ui/inc/pivotsh.hxx
index 9bf4c82dd921..3ec0e1e09d5a 100644
--- a/sc/source/ui/inc/pivotsh.hxx
+++ b/sc/source/ui/inc/pivotsh.hxx
@@ -35,7 +35,6 @@ class ScDPObject;
class ScPivotShell : public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_PIVOT_SHELL)
ScPivotShell( ScTabViewShell* pView );
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index d8782262c8c0..2982fa85920b 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -84,8 +84,6 @@ protected:
virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
public:
- TYPEINFO();
-
SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
SFX_DECL_VIEWFACTORY(ScPreviewShell);
diff --git a/sc/source/ui/inc/tabpopsh.hxx b/sc/source/ui/inc/tabpopsh.hxx
index 46ee3ee6a5eb..2d486c4048cd 100644
--- a/sc/source/ui/inc/tabpopsh.hxx
+++ b/sc/source/ui/inc/tabpopsh.hxx
@@ -32,7 +32,6 @@
class ScTabPopShell : public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SCID_TABPOP_SHELL);
ScTabPopShell(SfxItemPool& rItemPool);
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 8c2985c0922d..d1b6c3017fbe 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -209,7 +209,6 @@ protected:
void ResetDrawDragMode();
sal_Bool IsDrawTextEdit() const;
void DrawEnableAnim(sal_Bool bSet);
- //HMHvoid DrawShowMarkHdl(sal_Bool bShow);
void MakeDrawView( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
@@ -261,7 +260,7 @@ public:
FuPoor* GetDrawFuncOldPtr() { return pDrawOld; }
void DrawDeselectAll();
- void DrawMarkListHasChanged();
+// void DrawMarkListHasChanged();
void UpdateAnchorHandles();
//UNUSED2008-05 String GetSelectedChartName() const;
@@ -270,7 +269,7 @@ public:
void UpdatePageBreakData( sal_Bool bForcePaint = sal_False );
- void DrawMarkRect( const Rectangle& rRect );
+ void DrawMarkRange( const basegfx::B2DRange& rRange );
ScViewData* GetViewData() { return &aViewData; }
const ScViewData* GetViewData() const { return &aViewData; }
@@ -335,10 +334,10 @@ public:
void InvertHorizontal( ScVSplitPos eWhich, long nDragPos );
void InvertVertical( ScHSplitPos eWhich, long nDragPos );
- Point GetInsertPos();
+ basegfx::B2DPoint GetInsertPos();
- Point GetChartInsertPos( const Size& rSize, const ScRange& rCellRange );
- Point GetChartDialogPos( const Size& rDialogSize, const Rectangle& rLogicChart );
+ basegfx::B2DPoint GetChartInsertPos( const basegfx::B2DVector& rScale, const ScRange& rCellRange );
+ basegfx::B2DPoint GetChartDialogPos( const basegfx::B2DVector& rScale, const basegfx::B2DRange& rLogicChart );
void UpdateAutoFillMark();
@@ -404,7 +403,7 @@ public:
sal_Bool ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos );
void ScrollToObject( SdrObject* pDrawObj );
- void MakeVisible( const Rectangle& rHMMRect );
+ void MakeVisibleAtView( const basegfx::B2DRange& rRange );
// Zeichnen
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 283ce5f0c05f..4fc864018956 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -168,7 +168,7 @@ private:
sal_Bool bChartAreaValid; // wenn Chart aufgezogen wird
String aEditChartName;
ScRangeListRef aChartSource;
- Rectangle aChartPos;
+ basegfx::B2DRange aChartPos;
SCTAB nChartDestTab;
sal_uInt16 nCurRefDlgId;
@@ -199,7 +199,7 @@ protected:
virtual void Deactivate(sal_Bool bMDI);
virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
- virtual void ShowCursor(FASTBOOL bOn);
+ virtual void ShowCursor(bool bOn);
virtual void Move(); // Benachrichtigung
@@ -224,12 +224,10 @@ protected:
virtual void UIDeactivated( SfxInPlaceClient* pClient );
- virtual FASTBOOL KeyInput( const KeyEvent &rKeyEvent );
+ virtual bool KeyInput( const KeyEvent &rKeyEvent );
virtual SdrView* GetDrawView() const;
public:
- TYPEINFO_VISIBILITY(SC_DLLPUBLIC);
-
SFX_DECL_INTERFACE(SCID_TABVIEW_SHELL)
SFX_DECL_VIEWFACTORY(ScTabViewShell);
@@ -347,8 +345,8 @@ public:
void FillFieldData( ScHeaderFieldData& rData );
//UNUSED2008-05 void ResetChartArea();
- void SetChartArea( const ScRangeListRef& rSource, const Rectangle& rDest );
- sal_Bool GetChartArea( ScRangeListRef& rSource, Rectangle& rDest, SCTAB& rTab ) const;
+ void SetChartArea( const ScRangeListRef& rSource, const basegfx::B2DRange& rDest );
+ sal_Bool GetChartArea( ScRangeListRef& rSource, basegfx::B2DRange& rDest, SCTAB& rTab ) const;
//UNUSED2008-05 sal_Bool IsChartDlgEdit() const;
//UNUSED2008-05 void SetChartDlgEdit(sal_Bool bFlag){bChartDlgIsEdit=bFlag;}
@@ -388,7 +386,7 @@ public:
void InsertURL( const String& rName, const String& rURL, const String& rTarget,
sal_uInt16 nMode );
void InsertURLButton( const String& rName, const String& rURL, const String& rTarget,
- const Point* pInsPos = NULL );
+ const basegfx::B2DPoint* pInsPos = NULL );
void InsertURLField( const String& rName, const String& rURL, const String& rTarget );
sal_Bool SelectObject( const String& rName );
diff --git a/sc/source/ui/inc/target.hxx b/sc/source/ui/inc/target.hxx
index 943841722f60..3c735b6618ba 100644
--- a/sc/source/ui/inc/target.hxx
+++ b/sc/source/ui/inc/target.hxx
@@ -34,8 +34,6 @@ private:
ScTabViewShell* pViewShell;
public:
- TYPEINFO();
-
ScTabViewTarget( ScTabViewShell* pShell ) : pViewShell( pShell ) {}
virtual ~ScTabViewTarget();
diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx
index 4243632b7738..c9f092803af6 100644
--- a/sc/source/ui/inc/ui_pch.hxx
+++ b/sc/source/ui/inc/ui_pch.hxx
@@ -37,7 +37,6 @@
#include <tools/solar.h>
#include <tools/string.hxx>
#include <svl/solar.hrc>
-#include <tools/rtti.hxx>
#include <string.h>
#include <tools/contnr.hxx>
#include <vcl/sv.h>
@@ -209,7 +208,6 @@
#include <svx/svdlayer.hxx>
#include <vcl/msgbox.hxx>
#include <svx/svdmrkv.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdhdl.hxx>
#include <svx/svdsnpv.hxx>
#include <svx/svdpntv.hxx>
@@ -264,28 +262,17 @@
#include <svx/xlnasit.hxx>
#include <svx/svdattr.hxx>
#include <svx/sdangitm.hxx>
-#include <svx/sderitm.hxx>
#include <svx/sdmetitm.hxx>
#include <svx/svddef.hxx>
#include <svx/sdooitm.hxx>
#include <svx/sdprcitm.hxx>
-#include <svx/sdshcitm.hxx>
-#include <svx/sdshitm.hxx>
-#include <svx/sdshtitm.hxx>
-#include <svx/sdsxyitm.hxx>
#include <svx/sdtaaitm.hxx>
-#include <svx/sdtacitm.hxx>
#include <svx/sdtaditm.hxx>
-#include <svx/sdtagitm.hxx>
-#include <svx/sdtaiitm.hxx>
#include <svx/sdynitm.hxx>
#include <svx/sdtaitm.hxx>
#include <svx/sdtakitm.hxx>
#include <svx/sdtayitm.hxx>
-#include <svx/sdtcfitm.hxx>
-#include <svx/sdtditm.hxx>
#include <svx/sdtfsitm.hxx>
-#include <svx/sdtmfitm.hxx>
#include <tools/poly.hxx>
#include <vcl/gdimtf.hxx>
#include <cell.hxx>
diff --git a/sc/source/ui/inc/uiitems.hxx b/sc/source/ui/inc/uiitems.hxx
index 1449691996e4..70b9391d0a0d 100644
--- a/sc/source/ui/inc/uiitems.hxx
+++ b/sc/source/ui/inc/uiitems.hxx
@@ -49,8 +49,6 @@ class ScInputStatusItem : public SfxPoolItem
EditTextObject* pEditData;
public:
- TYPEINFO();
-//UNUSED2008-05 ScInputStatusItem( sal_uInt16 nWhich,
//UNUSED2008-05 SCTAB nTab,
//UNUSED2008-05 SCCOL nCol, SCROW nRow,
//UNUSED2008-05 SCCOL nStartCol, SCROW nStartRow,
@@ -101,7 +99,6 @@ class ScTablesHint : public SfxHint
SCTAB nTab2;
public:
- TYPEINFO();
ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0);
~ScTablesHint();
@@ -116,7 +113,6 @@ class ScEditViewHint : public SfxHint
ScAddress aCursorPos;
public:
- TYPEINFO();
ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos );
~ScEditViewHint();
@@ -135,7 +131,6 @@ class ScIndexHint : public SfxHint
sal_uInt16 nIndex;
public:
- TYPEINFO();
ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx);
~ScIndexHint();
@@ -149,7 +144,6 @@ public:
class SC_DLLPUBLIC ScSortItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScSortItem( sal_uInt16 nWhich,
ScViewData* ptrViewData,
const ScSortParam* pSortData );
@@ -177,7 +171,6 @@ private:
class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScQueryItem( sal_uInt16 nWhich,
ScViewData* ptrViewData,
const ScQueryParam* pQueryData );
@@ -209,7 +202,6 @@ private:
class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScSubTotalItem( sal_uInt16 nWhich,
ScViewData* ptrViewData,
const ScSubTotalParam* pSubTotalData );
@@ -237,7 +229,6 @@ private:
class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScUserListItem( sal_uInt16 nWhich );
ScUserListItem( const ScUserListItem& rItem );
~ScUserListItem();
@@ -259,7 +250,6 @@ private:
class ScConsolidateItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScConsolidateItem( sal_uInt16 nWhich,
const ScConsolidateParam* pParam );
ScConsolidateItem( const ScConsolidateItem& rItem );
@@ -281,7 +271,6 @@ private:
class ScPivotItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScPivotItem( sal_uInt16 nWhich, const ScDPSaveData* pData,
const ScRange* pRange, sal_Bool bNew );
ScPivotItem( const ScPivotItem& rItem );
@@ -307,7 +296,6 @@ private:
class ScSolveItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScSolveItem( sal_uInt16 nWhich,
const ScSolveParam* pParam );
ScSolveItem( const ScSolveItem& rItem );
@@ -329,7 +317,6 @@ private:
class ScTabOpItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScTabOpItem( sal_uInt16 nWhich,
const ScTabOpParam* pParam );
ScTabOpItem( const ScTabOpItem& rItem );
@@ -351,7 +338,6 @@ private:
class ScCondFrmtItem : public SfxPoolItem
{
public:
- TYPEINFO();
ScCondFrmtItem( sal_uInt16 nWhich,
//! const ScConditionalFormat* pCondFrmt );
const ScConditionalFormat& rCondFrmt );
diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx
index a9238cf0b74e..2ec8a3c6ef6d 100644
--- a/sc/source/ui/inc/undobase.hxx
+++ b/sc/source/ui/inc/undobase.hxx
@@ -40,7 +40,6 @@ class ScDBData;
class ScSimpleUndo: public SfxUndoAction
{
public:
- TYPEINFO();
ScSimpleUndo( ScDocShell* pDocSh );
virtual ~ScSimpleUndo();
@@ -70,7 +69,6 @@ enum ScBlockUndoMode { SC_UNDO_SIMPLE, SC_UNDO_MANUALHEIGHT, SC_UNDO_AUTOHEIGHT
class ScBlockUndo: public ScSimpleUndo
{
public:
- TYPEINFO();
ScBlockUndo( ScDocShell* pDocSh, const ScRange& rRange,
ScBlockUndoMode eBlockMode );
virtual ~ScBlockUndo();
@@ -101,7 +99,6 @@ class ScDBFuncUndo: public ScSimpleUndo
SdrUndoAction* mpDrawUndo;
public:
- TYPEINFO();
ScDBFuncUndo( ScDocShell* pDocSh, const ScRange& rOriginal, SdrUndoAction* pDrawUndo = 0 );
virtual ~ScDBFuncUndo();
@@ -120,7 +117,6 @@ enum ScMoveUndoMode { SC_UNDO_REFFIRST, SC_UNDO_REFLAST };
class ScMoveUndo: public ScSimpleUndo // mit Referenzen
{
public:
- TYPEINFO();
ScMoveUndo( ScDocShell* pDocSh,
ScDocument* pRefDoc, ScRefUndoData* pRefData,
ScMoveUndoMode eRefMode );
@@ -148,7 +144,6 @@ class ScUndoWrapper: public SfxUndoAction // for manual merging of act
SfxUndoAction* pWrappedUndo;
public:
- TYPEINFO();
ScUndoWrapper( SfxUndoAction* pUndo );
virtual ~ScUndoWrapper();
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index 2a14adc4f29c..45d8c1832822 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -46,7 +46,6 @@ class SdrUndoAction;
class ScUndoInsertCells: public ScMoveUndo
{
public:
- TYPEINFO();
ScUndoInsertCells( ScDocShell* pNewDocShell,
const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
InsCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData,
@@ -80,7 +79,6 @@ private:
class ScUndoDeleteCells: public ScMoveUndo
{
public:
- TYPEINFO();
ScUndoDeleteCells( ScDocShell* pNewDocShell,
const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
DelCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData );
@@ -110,7 +108,6 @@ private:
class ScUndoDeleteMulti: public ScMoveUndo
{
public:
- TYPEINFO();
ScUndoDeleteMulti( ScDocShell* pNewDocShell,
sal_Bool bNewRows, sal_Bool bNeedsRefresh, SCTAB nNewTab,
const SCCOLROW* pRng, SCCOLROW nRngCnt,
@@ -141,7 +138,6 @@ private:
class ScUndoCut: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoCut( ScDocShell* pNewDocShell,
ScRange aRange, // adjusted for merged cells
ScAddress aOldEnd, // end position without adjustment
@@ -188,7 +184,6 @@ struct ScUndoPasteOptions
class ScUndoPaste: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoPaste( ScDocShell* pNewDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
@@ -227,7 +222,6 @@ private:
class ScUndoDragDrop: public ScMoveUndo
{
public:
- TYPEINFO();
ScUndoDragDrop( ScDocShell* pNewDocShell,
const ScRange& rRange, ScAddress aNewDestPos, sal_Bool bNewCut,
ScDocument* pUndoDocument, ScRefUndoData* pRefData,
@@ -259,7 +253,6 @@ private:
class ScUndoDeleteContents: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoDeleteContents( ScDocShell* pNewDocShell,
const ScMarkData& rMark,
const ScRange& rRange,
@@ -292,7 +285,6 @@ private:
class ScUndoFillTable: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoFillTable( ScDocShell* pNewDocShell,
const ScMarkData& rMark,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
@@ -329,7 +321,6 @@ private:
class ScUndoSelectionAttr: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoSelectionAttr( ScDocShell* pNewDocShell,
const ScMarkData& rMark,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
@@ -363,7 +354,6 @@ private:
class ScUndoWidthOrHeight: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
const ScMarkData& rMark,
SCCOLROW nNewStart, SCTAB nNewStartTab,
@@ -402,7 +392,6 @@ private:
class ScUndoAutoFill: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoAutoFill( ScDocShell* pNewDocShell,
const ScRange& rRange, const ScRange& rSourceArea,
ScDocument* pNewUndoDoc, const ScMarkData& rMark,
@@ -440,7 +429,6 @@ private:
class ScUndoMerge: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoMerge( ScDocShell* pNewDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
@@ -467,7 +455,6 @@ private:
class ScUndoAutoFormat: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoAutoFormat( ScDocShell* pNewDocShell,
const ScRange& rRange, ScDocument* pNewUndoDoc,
const ScMarkData& rMark,
@@ -492,7 +479,6 @@ private:
class ScUndoReplace: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoReplace( ScDocShell* pNewDocShell,
const ScMarkData& rMark,
SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
@@ -523,7 +509,6 @@ private:
class ScUndoTabOp: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoTabOp( ScDocShell* pNewDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
@@ -556,8 +541,6 @@ private:
class ScUndoConversion : public ScSimpleUndo
{
public:
- TYPEINFO();
-
ScUndoConversion(
ScDocShell* pNewDocShell, const ScMarkData& rMark,
SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc,
@@ -589,7 +572,6 @@ private:
class ScUndoRefConversion: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRefConversion( ScDocShell* pNewDocShell,
const ScRange& aMarkRange, const ScMarkData& rMark,
ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, sal_Bool bNewMulti, sal_uInt16 nNewFlag);
@@ -619,7 +601,6 @@ private:
class ScUndoListNames: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoListNames( ScDocShell* pNewDocShell,
const ScRange& rRange,
ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc );
@@ -643,7 +624,6 @@ private:
class ScUndoUseScenario: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoUseScenario( ScDocShell* pNewDocShell,
const ScMarkData& rMark,
const ScArea& rDestArea, ScDocument* pNewUndoDoc,
@@ -668,7 +648,6 @@ private:
class ScUndoSelectionStyle: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoSelectionStyle( ScDocShell* pNewDocShell,
const ScMarkData& rMark,
const ScRange& rRange,
@@ -697,7 +676,6 @@ private:
class ScUndoRefreshLink: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRefreshLink( ScDocShell* pNewDocShell,
ScDocument* pNewUndoDoc );
virtual ~ScUndoRefreshLink();
@@ -718,7 +696,6 @@ private:
class ScUndoEnterMatrix: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoEnterMatrix( ScDocShell* pNewDocShell,
const ScRange& rArea,
ScDocument* pNewUndoDoc,
@@ -746,7 +723,6 @@ private:
class ScUndoInsertAreaLink : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoInsertAreaLink( ScDocShell* pShell,
const String& rDoc,
const String& rFlt, const String& rOpt,
@@ -774,7 +750,6 @@ private:
class ScUndoRemoveAreaLink : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRemoveAreaLink( ScDocShell* pShell,
const String& rDoc,
const String& rFlt, const String& rOpt,
@@ -802,7 +777,6 @@ private:
class ScUndoUpdateAreaLink : public ScSimpleUndo //! auch BlockUndo umstellen?
{
public:
- TYPEINFO();
ScUndoUpdateAreaLink( ScDocShell* pShell,
const String& rOldD,
const String& rOldF, const String& rOldO,
@@ -847,7 +821,6 @@ private:
class ScUndoIndent: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark,
ScDocument* pNewUndoDoc, sal_Bool bIncrement );
virtual ~ScUndoIndent();
@@ -869,7 +842,6 @@ private:
class ScUndoTransliterate: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
ScDocument* pNewUndoDoc, sal_Int32 nType );
virtual ~ScUndoTransliterate();
@@ -891,7 +863,6 @@ private:
class ScUndoClearItems: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark,
ScDocument* pNewUndoDoc, const sal_uInt16* pW );
virtual ~ScUndoClearItems();
@@ -913,7 +884,6 @@ private:
class ScUndoRemoveBreaks: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRemoveBreaks( ScDocShell* pNewDocShell,
SCTAB nNewTab, ScDocument* pNewUndoDoc );
virtual ~ScUndoRemoveBreaks();
@@ -934,7 +904,6 @@ private:
class ScUndoRemoveMerge: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoRemoveMerge( ScDocShell* pNewDocShell,
const ScRange& rArea,
ScDocument* pNewUndoDoc );
@@ -955,7 +924,6 @@ private:
class ScUndoBorder: public ScBlockUndo
{
public:
- TYPEINFO();
ScUndoBorder( ScDocShell* pNewDocShell,
const ScRangeList& rRangeList,
ScDocument* pNewUndoDoc,
diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx
index 5387a8119e67..d3270b02164c 100644
--- a/sc/source/ui/inc/undocell.hxx
+++ b/sc/source/ui/inc/undocell.hxx
@@ -41,7 +41,6 @@ class ScRangeName;
class ScUndoCursorAttr: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoCursorAttr( ScDocShell* pNewDocShell,
SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
const ScPatternAttr* pOldPat, const ScPatternAttr* pNewPat,
@@ -71,7 +70,6 @@ private:
class ScUndoEnterData: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoEnterData( ScDocShell* pNewDocShell,
SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
SCTAB nNewCount, SCTAB* pNewTabs,
@@ -107,7 +105,6 @@ private:
class ScUndoEnterValue: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoEnterValue( ScDocShell* pNewDocShell,
const ScAddress& rNewPos,
ScBaseCell* pUndoCell, double nVal, sal_Bool bHeight );
@@ -134,7 +131,6 @@ private:
class ScUndoPutCell: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoPutCell( ScDocShell* pNewDocShell,
const ScAddress& rNewPos,
ScBaseCell* pUndoCell, ScBaseCell* pRedoCell, sal_Bool bHeight );
@@ -161,7 +157,6 @@ private:
class ScUndoPageBreak: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoPageBreak( ScDocShell* pNewDocShell,
SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
sal_Bool bNewColumn, sal_Bool bNewInsert );
@@ -187,7 +182,6 @@ private:
class ScUndoPrintZoom: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoPrintZoom( ScDocShell* pNewDocShell, SCTAB nT,
sal_uInt16 nOS, sal_uInt16 nOP, sal_uInt16 nNS, sal_uInt16 nNP );
virtual ~ScUndoPrintZoom();
@@ -212,7 +206,6 @@ private:
class ScUndoThesaurus: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoThesaurus( ScDocShell* pNewDocShell,
SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
const String& rNewUndoStr, const EditTextObject* pUndoTObj,
@@ -247,8 +240,6 @@ private:
class ScUndoReplaceNote : public ScSimpleUndo
{
public:
- TYPEINFO();
-
/** Constructs an undo action for inserting or removing a cell note. */
ScUndoReplaceNote(
ScDocShell& rDocShell,
@@ -291,7 +282,6 @@ private:
class ScUndoShowHideNote : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoShowHideNote( ScDocShell& rDocShell, const ScAddress& rPos, bool bShow );
virtual ~ScUndoShowHideNote();
@@ -312,7 +302,6 @@ private:
class ScUndoDetective: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoDetective( ScDocShell* pNewDocShell,
SdrUndoAction* pDraw, const ScDetOpData* pOperation,
ScDetOpList* pUndoList = NULL );
@@ -337,7 +326,6 @@ private:
class ScUndoRangeNames: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRangeNames( ScDocShell* pNewDocShell,
ScRangeName* pOld, ScRangeName* pNew );
virtual ~ScUndoRangeNames();
diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx
index dcd182451b54..370efdf8f68e 100644
--- a/sc/source/ui/inc/undodat.hxx
+++ b/sc/source/ui/inc/undodat.hxx
@@ -46,7 +46,6 @@ class SdrUndoAction;
class ScUndoDoOutline: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoDoOutline( ScDocShell* pNewDocShell,
SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab,
ScDocument* pNewUndoDoc, sal_Bool bNewColumns,
@@ -75,7 +74,6 @@ private:
class ScUndoMakeOutline: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoMakeOutline( ScDocShell* pNewDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
@@ -102,7 +100,6 @@ private:
class ScUndoOutlineLevel: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoOutlineLevel( ScDocShell* pNewDocShell,
SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab,
ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab,
@@ -130,7 +127,6 @@ private:
class ScUndoOutlineBlock: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoOutlineBlock( ScDocShell* pNewDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
@@ -157,7 +153,6 @@ private:
class ScUndoRemoveAllOutlines: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRemoveAllOutlines( ScDocShell* pNewDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
@@ -182,7 +177,6 @@ private:
class ScUndoAutoOutline: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoAutoOutline( ScDocShell* pNewDocShell,
SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
@@ -207,7 +201,6 @@ private:
class ScUndoSubTotals: public ScDBFuncUndo
{
public:
- TYPEINFO();
ScUndoSubTotals( ScDocShell* pNewDocShell, SCTAB nNewTab,
const ScSubTotalParam& rNewParam, SCROW nNewEndY,
ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab,
@@ -237,7 +230,6 @@ private:
class ScUndoSort: public ScDBFuncUndo
{
public:
- TYPEINFO();
ScUndoSort( ScDocShell* pNewDocShell, SCTAB nNewTab,
const ScSortParam& rParam,
sal_Bool bQuery, ScDocument* pNewUndoDoc,
@@ -265,7 +257,6 @@ private:
class ScUndoQuery: public ScDBFuncUndo
{
public:
- TYPEINFO();
ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab,
const ScQueryParam& rParam, ScDocument* pNewUndoDoc,
ScDBCollection* pNewUndoDB, const ScRange* pOld,
@@ -302,7 +293,6 @@ private:
void DoChange( sal_Bool bUndo );
public:
- TYPEINFO();
ScUndoAutoFilter( ScDocShell* pNewDocShell, const ScRange& rRange,
const String& rName, sal_Bool bSet );
virtual ~ScUndoAutoFilter();
@@ -319,7 +309,6 @@ public:
class ScUndoDBData: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoDBData( ScDocShell* pNewDocShell,
ScDBCollection* pNewUndoColl, ScDBCollection* pNewRedoColl );
virtual ~ScUndoDBData();
@@ -340,7 +329,6 @@ private:
class ScUndoImportData: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoImportData( ScDocShell* pNewDocShell, SCTAB nNewTab,
const ScImportParam& rParam, SCCOL nNewEndX, SCROW nNewEndY,
SCCOL nNewFormula,
@@ -372,7 +360,6 @@ private:
class ScUndoRepeatDB: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRepeatDB( ScDocShell* pNewDocShell, SCTAB nNewTab,
SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY,
SCROW nResultEndRow, SCCOL nCurX, SCROW nCurY,
@@ -405,7 +392,6 @@ private:
//UNUSED2008-05 class ScUndoPivot: public ScSimpleUndo
//UNUSED2008-05 {
//UNUSED2008-05 public:
-//UNUSED2008-05 TYPEINFO();
//UNUSED2008-05 ScUndoPivot( ScDocShell* pNewDocShell,
//UNUSED2008-05 const ScArea& rOld, const ScArea& rNew,
//UNUSED2008-05 ScDocument* pOldDoc, ScDocument* pNewDoc,
@@ -439,7 +425,6 @@ private:
class ScUndoDataPilot: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoDataPilot( ScDocShell* pNewDocShell,
ScDocument* pOldDoc, ScDocument* pNewDoc,
const ScDPObject* pOldObj, const ScDPObject* pNewObj,
@@ -465,7 +450,6 @@ private:
class ScUndoConsolidate: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoConsolidate( ScDocShell* pNewDocShell,
const ScArea& rArea, const ScConsolidateParam& rPar,
ScDocument* pNewUndoDoc, sal_Bool bReference,
@@ -494,7 +478,6 @@ private:
class ScUndoChartData: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoChartData( ScDocShell* pNewDocShell,
const String& rName, const ScRange& rNew,
sal_Bool bColHdr, sal_Bool bRowHdr, sal_Bool bAdd );
diff --git a/sc/source/ui/inc/undodraw.hxx b/sc/source/ui/inc/undodraw.hxx
index d84b6f1c7054..7ac97acad684 100644
--- a/sc/source/ui/inc/undodraw.hxx
+++ b/sc/source/ui/inc/undodraw.hxx
@@ -36,7 +36,6 @@ class ScUndoDraw: public SfxUndoAction
void UpdateSubShell();
public:
- TYPEINFO();
ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh );
virtual ~ScUndoDraw();
diff --git a/sc/source/ui/inc/undostyl.hxx b/sc/source/ui/inc/undostyl.hxx
index a872185e0c54..368bf550f4b9 100644
--- a/sc/source/ui/inc/undostyl.hxx
+++ b/sc/source/ui/inc/undostyl.hxx
@@ -64,7 +64,6 @@ private:
const ScStyleSaveData& rData );
public:
- TYPEINFO();
ScUndoModifyStyle( ScDocShell* pDocSh,
SfxStyleFamily eFam,
const ScStyleSaveData& rOld,
@@ -82,7 +81,6 @@ public:
class ScUndoApplyPageStyle: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoApplyPageStyle( ScDocShell* pDocSh, const String& rNewStyle );
virtual ~ScUndoApplyPageStyle();
diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx
index 95cab89c2473..991442655e8e 100644
--- a/sc/source/ui/inc/undotab.hxx
+++ b/sc/source/ui/inc/undotab.hxx
@@ -61,7 +61,6 @@ class ScTableProtection;
class ScUndoInsertTab : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoInsertTab(
ScDocShell* pNewDocShell,
SCTAB nTabNum,
@@ -89,7 +88,6 @@ private:
class ScUndoInsertTables : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoInsertTables(
ScDocShell* pNewDocShell,
SCTAB nTabNum,
@@ -120,7 +118,6 @@ private:
class ScUndoDeleteTab: public ScMoveUndo // Draw vom Move fuer geloeschte Tabelle
{
public:
- TYPEINFO();
ScUndoDeleteTab(
ScDocShell* pNewDocShell,
const SvShorts &theTabs, //SCTAB nNewTab,
@@ -147,7 +144,6 @@ private:
class ScUndoRenameTab: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRenameTab(
ScDocShell* pNewDocShell,
SCTAB nT,
@@ -174,7 +170,6 @@ private:
class ScUndoMoveTab: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoMoveTab( ScDocShell* pNewDocShell,
const SvShorts &aOldTab,
const SvShorts &aNewTab);
@@ -198,7 +193,6 @@ private:
class ScUndoCopyTab: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoCopyTab(ScDocShell* pNewDocShell,
const SvShorts &aOldTab,
const SvShorts &aNewTab);
@@ -223,7 +217,6 @@ private:
class ScUndoTabColor: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoTabColor(
ScDocShell* pNewDocShell,
SCTAB nT,
@@ -251,7 +244,6 @@ private:
class ScUndoMakeScenario: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoMakeScenario(
ScDocShell* pNewDocShell,
SCTAB nSrc, SCTAB nDest,
@@ -282,7 +274,6 @@ private:
class ScUndoImportTab : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoImportTab(
ScDocShell* pShell,
SCTAB nNewTab, SCTAB nNewCount,
@@ -310,7 +301,6 @@ private:
class ScUndoRemoveLink : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRemoveLink( // vor dem Loeschen aufrufen!
ScDocShell* pShell,
const String& rDoc );
@@ -340,7 +330,6 @@ private:
class ScUndoShowHideTab : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoShowHideTab(
ScDocShell* pShell,
SCTAB nNewTab, sal_Bool bNewShow );
@@ -412,7 +401,6 @@ private:
class ScUndoPrintRange : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoPrintRange( ScDocShell* pShell, SCTAB nNewTab,
ScPrintRangeSaver* pOld, ScPrintRangeSaver* pNew );
virtual ~ScUndoPrintRange();
@@ -436,7 +424,6 @@ private:
class ScUndoScenarioFlags: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoScenarioFlags(
ScDocShell* pNewDocShell, SCTAB nT,
const String& rON, const String& rNN,
@@ -469,7 +456,6 @@ private:
class ScUndoRenameObject: public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoRenameObject(
ScDocShell* pNewDocShell, const String& rPN,
const String& rON, const String& rNN );
@@ -495,7 +481,6 @@ private:
class ScUndoLayoutRTL : public ScSimpleUndo
{
public:
- TYPEINFO();
ScUndoLayoutRTL( ScDocShell* pShell, SCTAB nNewTab, sal_Bool bNewRTL );
virtual ~ScUndoLayoutRTL();
@@ -517,7 +502,6 @@ private:
//UNUSED2009-05 class ScUndoSetGrammar : public ScSimpleUndo
//UNUSED2009-05 {
//UNUSED2009-05 public:
-//UNUSED2009-05 TYPEINFO();
//UNUSED2009-05 ScUndoSetGrammar( ScDocShell* pShell,
//UNUSED2009-05 formula::FormulaGrammar::Grammar eGrammar );
//UNUSED2009-05 virtual ~ScUndoSetGrammar();
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 9b87cbf2aab9..21f4652fdda5 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -255,7 +255,6 @@ private:
void RefInputDonePostHdl();
ScValidationDlg * GetValidationDlg();
- //TYPEINFO();
void TidyListBoxes();
public:
sal_uInt16 GetAllowEntryPos();
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 3ca3b634e916..eccfb5ff3574 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -124,7 +124,7 @@ public:
::com::sun::star::datatransfer::XTransferable >& rxTransferable );
void PasteDraw();
- void PasteDraw( const Point& rLogicPos, SdrModel* pModel,
+ void PasteDraw( const basegfx::B2DPoint& rLogicPos, SdrModel* pModel,
sal_Bool bGroup = sal_False, sal_Bool bSameDocClipboard = sal_False );
sal_Bool PasteOnDrawObject( const ::com::sun::star::uno::Reference<
@@ -134,14 +134,14 @@ public:
sal_Bool PasteDataFormat( sal_uLong nFormatId,
const ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable >& rxTransferable,
- SCCOL nPosX, SCROW nPosY, Point* pLogicPos = NULL,
+ SCCOL nPosX, SCROW nPosY, basegfx::B2DPoint* pLogicPos = NULL,
sal_Bool bLink = sal_False, sal_Bool bAllowDialogs = sal_False );
- sal_Bool PasteFile( const Point&, const String&, sal_Bool bLink=sal_False );
- sal_Bool PasteObject( const Point&, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >&, const Size* = NULL, const Graphic* = NULL, const ::rtl::OUString& = ::rtl::OUString(), sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT );
- sal_Bool PasteBitmap( const Point&, const Bitmap& );
- sal_Bool PasteMetaFile( const Point&, const GDIMetaFile& );
- sal_Bool PasteGraphic( const Point& rPos, const Graphic& rGraphic,
+ sal_Bool PasteFile( const basegfx::B2DPoint&, const String&, sal_Bool bLink=sal_False );
+ sal_Bool PasteObject( const basegfx::B2DPoint&, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >&, const basegfx::B2DVector* = NULL, const Graphic* = NULL, const ::rtl::OUString& = ::rtl::OUString(), sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT );
+ sal_Bool PasteBitmap( const basegfx::B2DPoint&, const Bitmap& );
+ sal_Bool PasteMetaFile( const basegfx::B2DPoint&, const GDIMetaFile& );
+ sal_Bool PasteGraphic( const basegfx::B2DPoint& rPos, const Graphic& rGraphic,
const String& rFile, const String& rFilter );
sal_Bool PasteBookmark( sal_uLong nFormatId,
const ::com::sun::star::uno::Reference<
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 7b69185373c5..30fce055f88f 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -90,8 +90,7 @@ ScFormulaReferenceHelper::~ScFormulaReferenceHelper()
// -----------------------------------------------------------------------------
void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable )
{
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(_IsObjectShell< ScDocShell >);
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -101,7 +100,7 @@ void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable )
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( p);
if(pViewSh!=NULL)
{
Window *pWin=pViewSh->GetWindow();
@@ -120,7 +119,7 @@ void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable )
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, _IsObjectShell< ScDocShell >);
}
}
// -----------------------------------------------------------------------------
@@ -559,9 +558,7 @@ sal_Bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
void ScFormulaReferenceHelper::SetDispatcherLock( sal_Bool bLock )
{
// lock / unlock only the dispatchers of Calc documents
-
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(_IsObjectShell< ScDocShell >);
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -573,7 +570,7 @@ void ScFormulaReferenceHelper::SetDispatcherLock( sal_Bool bLock )
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, _IsObjectShell< ScDocShell >);
}
// if a new view is created while the dialog is open,
@@ -589,8 +586,7 @@ void ScFormulaReferenceHelper::ViewShellChanged(ScTabViewShell* /* pScViewShell
}
void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChilds)
{
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(_IsObjectShell< ScDocShell >);
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -600,7 +596,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChil
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( p);
if(pViewSh!=NULL)
{
Window *pWin=pViewSh->GetWindow();
@@ -619,7 +615,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChil
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, _IsObjectShell< ScDocShell >);
}
}
@@ -629,8 +625,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChil
void lcl_InvalidateWindows()
{
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(_IsObjectShell< ScDocShell >);
while( pDocShell )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
@@ -640,7 +635,7 @@ void lcl_InvalidateWindows()
if ( !pFrame->GetFrame().IsInPlace() )
{
SfxViewShell* p = pFrame->GetViewShell();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,p);
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( p);
if(pViewSh!=NULL)
{
Window *pWin=pViewSh->GetWindow();
@@ -655,19 +650,18 @@ void lcl_InvalidateWindows()
pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
}
- pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = (ScDocShell*)SfxObjectShell::GetNext(*pDocShell, _IsObjectShell< ScDocShell >);
}
}
//----------------------------------------------------------------------------
void lcl_HideAllReferences()
{
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( _IsSfxViewShell< ScTabViewShell > );
while ( pSh )
{
((ScTabViewShell*)pSh)->ClearHighlightRanges();
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, _IsSfxViewShell< ScTabViewShell > );
}
}
@@ -717,7 +711,7 @@ bool ScRefHandler::EnterRefMode()
SfxViewFrame* pMyViewFrm = pMyDisp->GetFrame();
if (pMyViewFrm)
{
- pScViewShell = PTR_CAST( ScTabViewShell, pMyViewFrm->GetViewShell() );
+ pScViewShell = dynamic_cast< ScTabViewShell* >( pMyViewFrm->GetViewShell() );
if( pScViewShell )
pScViewShell->UpdateInputHandler(sal_True);
pParentDoc = pMyViewFrm->GetObjectShell();
@@ -801,8 +795,7 @@ void ScRefHandler::SwitchToDocument()
}
}
- TypeId aScType = TYPE(ScTabViewShell);
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( _IsSfxViewShell< ScTabViewShell > );
while ( pSh )
{
SfxObjectShell* pObjSh = pSh->GetObjectShell();
@@ -812,7 +805,7 @@ void ScRefHandler::SwitchToDocument()
((ScTabViewShell*)pSh)->SetActive();
return;
}
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, _IsSfxViewShell< ScTabViewShell > );
}
}
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index c01faca2992d..e3e6a4aa6634 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -848,8 +848,7 @@ void ScAutoFmtPreview::Init()
CalcCellArray( sal_False );
CalcLineMap();
- TypeId aType(TYPE(ScDocShell));
- ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
+ ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(_IsObjectShell< ScDocShell >);
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
SfxViewShell* p = pFrame->GetViewShell();
ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( p );
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 850a93e22484..cde4596552ee 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -128,7 +128,7 @@ void ScMoveTableDlg::InitDocListBox()
while ( pSh )
{
- pScSh = PTR_CAST( ScDocShell, pSh );
+ pScSh = dynamic_cast< ScDocShell* >( pSh );
if ( pScSh )
{
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 1a5bb02d293a..ee5059f14afb 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -91,13 +91,12 @@ ScDocShell* ScContentTree::GetManualOrCurrent()
ScDocShell* pSh = NULL;
if ( aManualDoc.Len() )
{
- TypeId aScType = TYPE(ScDocShell);
- SfxObjectShell* pObjSh = SfxObjectShell::GetFirst( &aScType );
+ SfxObjectShell* pObjSh = SfxObjectShell::GetFirst(_IsObjectShell< ScDocShell >);
while ( pObjSh && !pSh )
{
if ( pObjSh->GetTitle() == aManualDoc )
- pSh = PTR_CAST( ScDocShell, pObjSh );
- pObjSh = SfxObjectShell::GetNext( *pObjSh, &aScType );
+ pSh = dynamic_cast< ScDocShell* >( pObjSh );
+ pObjSh = SfxObjectShell::GetNext( *pObjSh, _IsObjectShell< ScDocShell > );
}
}
else
@@ -109,7 +108,7 @@ ScDocShell* ScContentTree::GetManualOrCurrent()
if ( pViewSh )
{
SfxObjectShell* pObjSh = pViewSh->GetViewFrame()->GetObjectShell();
- pSh = PTR_CAST( ScDocShell, pObjSh );
+ pSh = dynamic_cast< ScDocShell* >( pObjSh );
}
}
@@ -474,11 +473,11 @@ void __EXPORT ScContentTree::Command( const CommandEvent& rCEvt )
sal_uInt16 i=0;
sal_uInt16 nPos=0;
// geladene Dokumente
- ScDocShell* pCurrentSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pCurrentSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current() );
SfxObjectShell* pSh = SfxObjectShell::GetFirst();
while ( pSh )
{
- if ( pSh->ISA(ScDocShell) )
+ if ( dynamic_cast< ScDocShell* >(pSh) )
{
String aName = pSh->GetTitle();
String aEntry = aName;
@@ -833,8 +832,10 @@ void ScContentTree::GetLinkNames()
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
- InsertContent( SC_CONTENT_AREALINK, ((ScAreaLink*)pBase)->GetSource() );
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if (pScAreaLink)
+ InsertContent( SC_CONTENT_AREALINK, pScAreaLink->GetSource() );
// in der Liste die Namen der Quellbereiche
}
@@ -854,10 +855,12 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex )
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if (pScAreaLink)
{
if (nFound == nIndex)
- return (const ScAreaLink*) pBase;
+ return pScAreaLink;
++nFound;
}
}
@@ -1063,10 +1066,9 @@ void lcl_DoDragObject( ScDocShell* pSrcShell, const String& rName, sal_uInt16 nT
SdrObject* pObject = pModel->GetNamedObject( rName, nDrawId, nTab );
if (pObject)
{
- SdrView aEditView( pModel );
- aEditView.ShowSdrPage(aEditView.GetModel()->GetPage(nTab));
- SdrPageView* pPV = aEditView.GetSdrPageView();
- aEditView.MarkObj(pObject, pPV);
+ SdrView aEditView( *pModel );
+ aEditView.ShowSdrPage(*aEditView.getSdrModelFromSdrView().GetPage(nTab));
+ aEditView.MarkObj(*pObject);
SdrModel* pDragModel = aEditView.GetAllMarkedModel();
@@ -1439,7 +1441,7 @@ void ScContentTree::SelectDoc(const String& rName) // rName wie im Menue/Li
SfxObjectShell* pSh = SfxObjectShell::GetFirst();
while ( pSh && !bLoaded )
{
- if ( pSh->ISA(ScDocShell) )
+ if ( dynamic_cast< ScDocShell* >(pSh) )
if ( pSh->GetTitle() == aRealName )
bLoaded = sal_True;
pSh = SfxObjectShell::GetNext( *pSh );
diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx
index 0571030bc693..b5f023400dc2 100644
--- a/sc/source/ui/navipi/navcitem.cxx
+++ b/sc/source/ui/navipi/navcitem.cxx
@@ -59,8 +59,8 @@ void __EXPORT ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, Sf
case SID_CURRENTCELL:
if ( pItem )
{
-// const SfxPointItem* pCellPosItem = PTR_CAST(SfxPointItem, pItem);
- const SfxStringItem* pCellPosItem = PTR_CAST(SfxStringItem, pItem);
+// const SfxPointItem* pCellPosItem = dynamic_cast< const SfxPointItem* >( pItem);
+ const SfxStringItem* pCellPosItem = dynamic_cast< const SfxStringItem* >( pItem);
DBG_ASSERT( pCellPosItem, "SfxStringItem expected!" );
@@ -86,7 +86,7 @@ void __EXPORT ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, Sf
case SID_CURRENTTAB:
if ( pItem )
{
- const SfxUInt16Item* pTabItem = PTR_CAST(SfxUInt16Item, pItem);
+ const SfxUInt16Item* pTabItem = dynamic_cast< const SfxUInt16Item* >( pItem);
DBG_ASSERT( pTabItem, "SfxUInt16Item expected!" );
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 772be87c3b9b..ba10811988a9 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -906,9 +906,11 @@ void ScNavigatorDlg::DoResize()
void __EXPORT ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nHintId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uLong nHintId = pSfxSimpleHint->GetId();
if ( nHintId == SC_HINT_DOCNAME_CHANGED )
{
@@ -960,9 +962,14 @@ void __EXPORT ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
- else if ( rHint.ISA(SfxEventHint) )
+ else
+ {
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if ( pSfxEventHint )
{
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = pSfxEventHint->GetEventId();
+
if ( nEventId == SFX_EVENT_ACTIVATEDOC )
{
aLbEntries.ActiveDocChanged();
@@ -970,6 +977,7 @@ void __EXPORT ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
+}
//------------------------------------------------------------------------
@@ -1099,7 +1107,7 @@ void ScNavigatorDlg::SetCurrentDoc( const String& rDocName ) // aktiviere
ScTabViewShell* ScNavigatorDlg::GetTabViewShell() const
{
- return PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ return dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
}
//------------------------------------------------------------------------
@@ -1334,13 +1342,13 @@ void ScNavigatorDlg::GetDocNames( const String* pManualSel )
aLbDocuments.Clear();
aLbDocuments.SetUpdateMode( sal_False );
- ScDocShell* pCurrentSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScDocShell* pCurrentSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current() );
String aSelEntry;
SfxObjectShell* pSh = SfxObjectShell::GetFirst();
while ( pSh )
{
- if ( pSh->ISA(ScDocShell) )
+ if ( dynamic_cast< ScDocShell* >(pSh) )
{
String aName = pSh->GetTitle();
String aEntry = aName;
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index a2ff5ffd9c38..ea3547b88cb7 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -263,7 +263,7 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState )
{
aLbScenario.Enable();
- if ( pState->ISA(SfxStringItem) )
+ if ( dynamic_cast< const SfxStringItem* >(pState) )
{
String aNewEntry( ((const SfxStringItem*)pState)->GetValue() );
@@ -272,7 +272,7 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState )
else
aLbScenario.SetNoSelection();
}
- else if ( pState->ISA(SfxStringListItem) )
+ else if ( dynamic_cast< const SfxStringListItem* >(pState) )
{
aLbScenario.UpdateEntries( ((SfxStringListItem*)pState)->GetList() );
}
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index a55ec9e02589..12c3c675bf61 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -157,7 +157,7 @@ sal_Bool __EXPORT ScRedlineOptionsTabPage::FillItemSet( SfxItemSet& /* rSet */ )
// Repaint (wenn alles ueber Items laufen wuerde, wie es sich gehoert,
// waere das nicht noetig...)
- ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
if (pDocSh)
pDocSh->PostPaintGridAll();
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 5697ddbe8c71..7d5981031ea3 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -125,8 +125,7 @@ __EXPORT ScTpUserLists::~ScTpUserLists()
void ScTpUserLists::Init()
{
- SfxViewShell* pSh = SfxViewShell::Current();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell, pSh);
+ ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
aLbLists.SetSelectHdl ( LINK( this, ScTpUserLists, LbSelectHdl ) );
aBtnNew.SetClickHdl ( LINK( this, ScTpUserLists, BtnClickHdl ) );
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 31e8d61cc27d..827a41733c9b 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -349,7 +349,7 @@ void ScTpContentOptions::InitGridOpt()
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
// hier koennte auch eine andere DocShell kommen!
- pDocSh = PTR_CAST(ScDocShell, pDocSh);
+ pDocSh = dynamic_cast< ScDocShell* >( pDocSh);
XColorTable* pColorTable = NULL;
@@ -495,7 +495,7 @@ SfxTabPage* ScTpLayoutOptions::Create( Window* pParent,
const SfxItemSet& rCoreSet )
{
ScTpLayoutOptions* pNew = new ScTpLayoutOptions(pParent, rCoreSet);
- ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current());
if(pDocSh!=NULL)
pNew->SetDocument(pDocSh->GetDocument());
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index cb7445347853..57f3c41b77da 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -133,8 +133,8 @@ ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, Window*
pViewData ( NULL ),
nCurTab ( 0 )
{
- ScTabViewShell* pScViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
- ScDocShell* pScDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ ScTabViewShell* pScViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
+ ScDocShell* pScDocSh = dynamic_cast< ScDocShell* >( SfxObjectShell::Current() );
DBG_ASSERT( pScDocSh, "Current DocumentShell not found :-(" );
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 7e6f831f3fc4..8b828bff93df 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -433,7 +433,7 @@ void ScHFEditPage::SetSelectDefinedList()
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxTableField))
+ if(pField && dynamic_cast< const SvxTableField* >(pField))
{
eSelectEntry = eSheetEntry;
bFound = true;
@@ -579,7 +579,7 @@ bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj)
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxPageField))
+ if(pField && dynamic_cast< const SvxPageField* >(pField))
bReturn = true;
}
}
@@ -601,7 +601,7 @@ bool ScHFEditPage::IsDateEntry(EditTextObject* pTextObj)
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxDateField))
+ if(pField && dynamic_cast< const SvxDateField* >(pField))
bReturn = true;
}
}
@@ -619,7 +619,7 @@ bool ScHFEditPage::IsExtFileNameEntry(EditTextObject* pTextObj)
if(pFieldItem)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxExtFileField))
+ if(pField && dynamic_cast< const SvxExtFileField* >(pField))
bReturn = true;
}
}
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index 69e1f7b58022..e92b827557ce 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -69,8 +69,7 @@ ScHFPage::ScHFPage( Window* pParent, sal_uInt16 nResId,
{
SetExchangeSupport();
- SfxViewShell* pSh = SfxViewShell::Current();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,pSh);
+ ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
Point aPos( aBackgroundBtn.GetPosPixel() );
// aBackgroundBtn position not changed anymore
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 5005ce6597c7..dd389f8e9563 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -382,10 +382,21 @@ void lcl_GetFieldData( ScHeaderFieldData& rData )
SfxViewShell* pShell = SfxViewShell::Current();
if (pShell)
{
- if (pShell->ISA(ScTabViewShell))
- ((ScTabViewShell*)pShell)->FillFieldData(rData);
- else if (pShell->ISA(ScPreviewShell))
- ((ScPreviewShell*)pShell)->FillFieldData(rData);
+ ScTabViewShell* pScTabViewShell = dynamic_cast< ScTabViewShell* >(pShell);
+
+ if (pScTabViewShell)
+ {
+ pScTabViewShell->FillFieldData(rData);
+ }
+ else
+ {
+ ScPreviewShell* pScPreviewShell = dynamic_cast< ScPreviewShell* >(pShell);
+
+ if (pScPreviewShell)
+ {
+ pScPreviewShell->FillFieldData(rData);
+ }
+ }
}
}
@@ -507,7 +518,7 @@ void ScEditWindow::SetCharAttriutes()
SfxViewShell* pViewSh = SfxViewShell::Current();
- ScTabViewShell* pTabViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
+ ScTabViewShell* pTabViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current());
DBG_ASSERT( pDocSh, "Current DocShell not found" );
diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx
index 73aa9c512129..1c9a35bdf044 100644
--- a/sc/source/ui/undo/areasave.cxx
+++ b/sc/source/ui/undo/areasave.cxx
@@ -142,9 +142,11 @@ sal_Bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
for (sal_uInt16 i=0; i<nLinkCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if (pScAreaLink)
{
- if ( nPos >= GetCount() || !(*this)[nPos]->IsEqual( *(ScAreaLink*)pBase ) )
+ if ( nPos >= GetCount() || !(*this)[nPos]->IsEqual( *pScAreaLink ) )
return sal_False;
++nPos;
@@ -163,10 +165,11 @@ ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScAreaLinkSav
for (sal_uInt16 i=0; i<nLinkCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if ( pBase->ISA(ScAreaLink) &&
- rSaver.IsEqualSource( *static_cast<ScAreaLink*>(pBase) ) )
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if ( pScAreaLink && rSaver.IsEqualSource( *pScAreaLink ) )
{
- return static_cast<ScAreaLink*>(pBase); // found
+ return pScAreaLink; // found
}
}
return NULL; // not found
@@ -209,12 +212,14 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum
for (sal_uInt16 i=0; i<nLinkCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if (pScAreaLink)
{
if (!pColl)
pColl = new ScAreaLinkSaveCollection;
- ScAreaLinkSaver* pSaver = new ScAreaLinkSaver( *(ScAreaLink*)pBase );
+ ScAreaLinkSaver* pSaver = new ScAreaLinkSaver( *pScAreaLink );
if (!pColl->Insert(pSaver))
delete pSaver;
}
diff --git a/sc/source/ui/undo/target.cxx b/sc/source/ui/undo/target.cxx
index 8205b0661ad8..459a841e69a6 100644
--- a/sc/source/ui/undo/target.cxx
+++ b/sc/source/ui/undo/target.cxx
@@ -34,7 +34,6 @@
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1(ScTabViewTarget, SfxRepeatTarget);
__EXPORT ScTabViewTarget::~ScTabViewTarget()
{
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 74838288d28a..cbca070913da 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -42,14 +42,6 @@
#include "queryparam.hxx"
#include "globstr.hrc"
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(ScSimpleUndo, SfxUndoAction);
-TYPEINIT1(ScBlockUndo, ScSimpleUndo);
-TYPEINIT1(ScMoveUndo, ScSimpleUndo);
-TYPEINIT1(ScDBFuncUndo, ScSimpleUndo);
-TYPEINIT1(ScUndoWrapper, SfxUndoAction);
-
// -----------------------------------------------------------------------
ScSimpleUndo::ScSimpleUndo( ScDocShell* pDocSh ) :
@@ -83,14 +75,14 @@ sal_Bool __EXPORT ScSimpleUndo::Merge( SfxUndoAction *pNextAction )
// DetectiveRefresh kommt immer hinterher, die SdrUndoGroup ist in
// eine ScUndoDraw Action verpackt.
// Nur beim automatischen Aktualisieren wird AddUndoAction mit
- // bTryMerg=sal_True gerufen.
+ // bTryMerg=TRUE gerufen.
+ ScUndoDraw* pCalcUndo = dynamic_cast< ScUndoDraw* >(pNextAction);
- if ( !pDetectiveUndo && pNextAction->ISA(ScUndoDraw) )
+ if ( !pDetectiveUndo && pCalcUndo )
{
// SdrUndoAction aus der ScUndoDraw Action uebernehmen,
// ScUndoDraw wird dann vom UndoManager geloescht
- ScUndoDraw* pCalcUndo = (ScUndoDraw*)pNextAction;
pDetectiveUndo = pCalcUndo->GetDrawUndo();
pCalcUndo->ForgetDrawUndo();
return sal_True;
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index ca1c04f03437..9078cf9f7c2b 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -61,27 +61,6 @@
#include "sc.hrc"
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(ScUndoInsertCells, SfxUndoAction);
-TYPEINIT1(ScUndoDeleteCells, SfxUndoAction);
-TYPEINIT1(ScUndoDeleteMulti, SfxUndoAction);
-TYPEINIT1(ScUndoCut, ScBlockUndo);
-TYPEINIT1(ScUndoPaste, SfxUndoAction);
-TYPEINIT1(ScUndoDragDrop, SfxUndoAction);
-TYPEINIT1(ScUndoListNames, SfxUndoAction);
-TYPEINIT1(ScUndoUseScenario, SfxUndoAction);
-TYPEINIT1(ScUndoSelectionStyle, SfxUndoAction);
-TYPEINIT1(ScUndoEnterMatrix, ScBlockUndo);
-TYPEINIT1(ScUndoIndent, ScBlockUndo);
-TYPEINIT1(ScUndoTransliterate, ScBlockUndo);
-TYPEINIT1(ScUndoClearItems, ScBlockUndo);
-TYPEINIT1(ScUndoRemoveBreaks, SfxUndoAction);
-TYPEINIT1(ScUndoRemoveMerge, ScBlockUndo);
-TYPEINIT1(ScUndoBorder, ScBlockUndo);
-
-
-
// To Do:
/*A*/ // SetOptimalHeight auf Dokument, wenn keine View
/*B*/ // gelinkte Tabellen
@@ -142,11 +121,13 @@ sal_Bool ScUndoInsertCells::Merge( SfxUndoAction* pNextAction )
if ( pPasteUndo )
return pPasteUndo->Merge( pNextAction );
- if ( bPartOfPaste && pNextAction->ISA( ScUndoWrapper ) )
+ ScUndoWrapper* pWrapper = dynamic_cast< ScUndoWrapper* >(pNextAction);
+
+ if ( bPartOfPaste && pWrapper )
{
- ScUndoWrapper* pWrapper = (ScUndoWrapper*)pNextAction;
SfxUndoAction* pWrappedAction = pWrapper->GetWrappedUndo();
- if ( pWrappedAction && pWrappedAction->ISA( ScUndoPaste ) )
+
+ if ( pWrappedAction && dynamic_cast< ScUndoPaste* >(pWrappedAction) )
{
// Store paste action if this is part of paste with inserting cells.
// A list action isn't used because Repeat wouldn't work (insert wrong cells).
@@ -311,7 +292,9 @@ void __EXPORT ScUndoInsertCells::Redo()
void __EXPORT ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
if ( pPasteUndo )
{
@@ -321,13 +304,15 @@ void __EXPORT ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
pPasteUndo->Repeat( rTarget );
}
else
- ((ScTabViewTarget&)rTarget).GetViewShell()->InsertCells( eCmd, sal_True );
+ {
+ pScTabViewTarget->GetViewShell()->InsertCells( eCmd, sal_True );
+ }
}
}
sal_Bool __EXPORT ScUndoInsertCells::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -556,13 +541,17 @@ void __EXPORT ScUndoDeleteCells::Redo()
void __EXPORT ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( eCmd, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->DeleteCells( eCmd, sal_True );
+ }
}
sal_Bool __EXPORT ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -749,13 +738,17 @@ void __EXPORT ScUndoDeleteMulti::Redo()
void __EXPORT ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
{
// DeleteCells, falls einfache Selektion
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteCells( DEL_DELROWS, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->DeleteCells( DEL_DELROWS, sal_True );
+ }
}
sal_Bool __EXPORT ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -854,13 +847,17 @@ void __EXPORT ScUndoCut::Redo()
void __EXPORT ScUndoCut::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->CutToClip( NULL, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->CutToClip( NULL, sal_True );
+ }
}
sal_Bool __EXPORT ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1101,9 +1098,11 @@ void __EXPORT ScUndoPaste::Redo()
void __EXPORT ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell* pViewSh = ((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell* pViewSh = pScTabViewTarget->GetViewShell();
ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pViewSh->GetActiveWin() );
if (pOwnClip)
{
@@ -1119,7 +1118,7 @@ void __EXPORT ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoPaste::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1426,13 +1425,15 @@ void __EXPORT ScUndoListNames::Redo()
void __EXPORT ScUndoListNames::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->InsertNameList();
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->InsertNameList();
}
sal_Bool __EXPORT ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1545,18 +1546,22 @@ void __EXPORT ScUndoUseScenario::Redo()
void __EXPORT ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
String aTemp = aName;
- ((ScTabViewTarget&)rTarget).GetViewShell()->UseScenario(aTemp);
+ pScTabViewTarget->GetViewShell()->UseScenario(aTemp);
}
}
sal_Bool __EXPORT ScUndoUseScenario::CanRepeat(SfxRepeatTarget& rTarget) const
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScViewData* pViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
+ ScViewData* pViewData = pScTabViewTarget->GetViewShell()->GetViewData();
return !pViewData->GetDocument()->IsScenario( pViewData->GetTabNo() );
}
return sal_False;
@@ -1652,7 +1657,9 @@ void __EXPORT ScUndoSelectionStyle::Redo()
void __EXPORT ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
ScDocument* pDoc = pDocShell->GetDocument();
ScStyleSheetPool* pStlPool = pDoc->GetStyleSheetPool();
@@ -1664,14 +1671,14 @@ void __EXPORT ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget)
return;
}
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
rViewShell.SetStyleSheetToMarked( pStyleSheet, sal_True );
}
}
sal_Bool __EXPORT ScUndoSelectionStyle::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
sal_uInt16 __EXPORT ScUndoSelectionStyle::GetId() const
@@ -1758,16 +1765,18 @@ void __EXPORT ScUndoEnterMatrix::Redo()
void __EXPORT ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
String aTemp = aFormula;
- ((ScTabViewTarget&)rTarget).GetViewShell()->EnterMatrix(aTemp);
+ pScTabViewTarget->GetViewShell()->EnterMatrix(aTemp);
}
}
sal_Bool __EXPORT ScUndoEnterMatrix::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
@@ -1832,13 +1841,15 @@ void __EXPORT ScUndoIndent::Redo()
void __EXPORT ScUndoIndent::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->ChangeIndent( bIsIncrement );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->ChangeIndent( bIsIncrement );
}
sal_Bool __EXPORT ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
@@ -1893,13 +1904,15 @@ void __EXPORT ScUndoTransliterate::Redo()
void __EXPORT ScUndoTransliterate::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->TransliterateText( nTransliterationType );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->TransliterateText( nTransliterationType );
}
sal_Bool __EXPORT ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
@@ -1959,9 +1972,11 @@ void __EXPORT ScUndoClearItems::Redo()
void __EXPORT ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScViewData* pViewData = ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData();
+ ScViewData* pViewData = pScTabViewTarget->GetViewShell()->GetViewData();
ScDocFunc aFunc(*pViewData->GetDocShell());
aFunc.ClearItems( pViewData->GetMarkData(), pWhich, sal_False );
}
@@ -1969,7 +1984,7 @@ void __EXPORT ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoClearItems::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
@@ -2028,16 +2043,18 @@ void __EXPORT ScUndoRemoveBreaks::Redo()
void __EXPORT ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
rViewShell.RemoveManualBreaks();
}
}
sal_Bool __EXPORT ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
@@ -2130,13 +2147,15 @@ void __EXPORT ScUndoRemoveMerge::Redo()
void __EXPORT ScUndoRemoveMerge::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->RemoveMerge();
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->RemoveMerge();
}
sal_Bool __EXPORT ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 001ba2146da9..9a990cf3d45f 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -46,10 +46,6 @@
#include "undoolk.hxx" //! GetUndo ins Document verschieben!
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(ScUndoWidthOrHeight, SfxUndoAction);
-
// -----------------------------------------------------------------------
@@ -191,13 +187,17 @@ void __EXPORT ScUndoWidthOrHeight::Redo()
void __EXPORT ScUndoWidthOrHeight::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, nNewSize, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, nNewSize, sal_True );
+ }
}
sal_Bool __EXPORT ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index e555a0c86da7..1d8a9b6a0abf 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -56,24 +56,6 @@
#include "postit.hxx"
#include "docuno.hxx"
-// STATIC DATA ---------------------------------------------------------------
-
-TYPEINIT1(ScUndoDeleteContents, SfxUndoAction);
-TYPEINIT1(ScUndoFillTable, SfxUndoAction);
-TYPEINIT1(ScUndoSelectionAttr, SfxUndoAction);
-TYPEINIT1(ScUndoAutoFill, SfxUndoAction);
-TYPEINIT1(ScUndoMerge, SfxUndoAction);
-TYPEINIT1(ScUndoAutoFormat, SfxUndoAction);
-TYPEINIT1(ScUndoReplace, SfxUndoAction);
-TYPEINIT1(ScUndoTabOp, SfxUndoAction);
-TYPEINIT1(ScUndoConversion, SfxUndoAction);
-TYPEINIT1(ScUndoRefConversion, SfxUndoAction);
-TYPEINIT1(ScUndoRefreshLink, SfxUndoAction);
-TYPEINIT1(ScUndoInsertAreaLink, SfxUndoAction);
-TYPEINIT1(ScUndoRemoveAreaLink, SfxUndoAction);
-TYPEINIT1(ScUndoUpdateAreaLink, SfxUndoAction);
-
-
// To Do:
/*A*/ // SetOptimalHeight auf Dokument, wenn keine View
@@ -244,8 +226,12 @@ void __EXPORT ScUndoDeleteContents::Redo()
void __EXPORT ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->DeleteContents( nFlags, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->DeleteContents( nFlags, sal_True );
+ }
}
@@ -253,7 +239,7 @@ void __EXPORT ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -408,8 +394,10 @@ void __EXPORT ScUndoFillTable::Redo()
void __EXPORT ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, bAsLink );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, bAsLink );
}
@@ -417,7 +405,7 @@ void __EXPORT ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -539,9 +527,11 @@ void __EXPORT ScUndoSelectionAttr::Redo()
void __EXPORT ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
if (pLineOuter)
rViewShell.ApplyPatternLines( *pApplyPattern, pLineOuter, pLineInner, sal_True );
else
@@ -554,7 +544,7 @@ void __EXPORT ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoSelectionAttr::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -738,9 +728,11 @@ void __EXPORT ScUndoAutoFill::Redo()
void __EXPORT ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
if (eFillCmd==FILL_SIMPLE)
rViewShell.FillSimple( eFillDir, sal_True );
else
@@ -754,7 +746,7 @@ void __EXPORT ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -873,9 +865,11 @@ void ScUndoMerge::Redo()
void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
sal_Bool bCont = sal_False;
rViewShell.MergeCells( sal_False, bCont, sal_True );
}
@@ -886,7 +880,7 @@ void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget)
sal_Bool ScUndoMerge::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1059,8 +1053,12 @@ void __EXPORT ScUndoAutoFormat::Redo()
void __EXPORT ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->AutoFormat( nFormatNo, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->AutoFormat( nFormatNo, sal_True );
+ }
}
@@ -1068,7 +1066,7 @@ void __EXPORT ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1262,8 +1260,12 @@ void __EXPORT ScUndoReplace::Redo()
void __EXPORT ScUndoReplace::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->SearchAndReplace( pSearchItem, sal_True, sal_False );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->SearchAndReplace( pSearchItem, sal_True, sal_False );
+ }
}
@@ -1271,7 +1273,7 @@ void __EXPORT ScUndoReplace::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1504,8 +1506,12 @@ void ScUndoConversion::Redo()
void ScUndoConversion::Repeat( SfxRepeatTarget& rTarget )
{
- if( rTarget.ISA( ScTabViewTarget ) )
- ((ScTabViewTarget&)rTarget).GetViewShell()->DoSheetConversion( maConvParam, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if( pScTabViewTarget )
+ {
+ pScTabViewTarget->GetViewShell()->DoSheetConversion( maConvParam, sal_True );
+ }
}
@@ -1513,7 +1519,7 @@ void ScUndoConversion::Repeat( SfxRepeatTarget& rTarget )
sal_Bool ScUndoConversion::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return rTarget.ISA( ScTabViewTarget );
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1600,13 +1606,15 @@ void __EXPORT ScUndoRefConversion::Redo()
void __EXPORT ScUndoRefConversion::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->DoRefConversion();
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->DoRefConversion();
}
sal_Bool __EXPORT ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
//============================================================================
// class ScUndoRefreshLink
@@ -1758,9 +1766,11 @@ ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const String& rDo
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
- if (pBase->ISA(ScAreaLink))
- if ( ((ScAreaLink*)pBase)->IsEqual( rDoc, rFlt, rOpt, rSrc, rDest ) )
- return (ScAreaLink*)pBase;
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if (pScAreaLink)
+ if ( pScAreaLink->IsEqual( rDoc, rFlt, rOpt, rSrc, rDest ) )
+ return pScAreaLink;
}
DBG_ERROR("ScAreaLink nicht gefunden");
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index e044a18236c0..b6fde50f8aac 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -50,21 +50,6 @@
#include "sc.hrc"
#include "docuno.hxx"
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(ScUndoCursorAttr, ScSimpleUndo);
-TYPEINIT1(ScUndoEnterData, ScSimpleUndo);
-TYPEINIT1(ScUndoEnterValue, ScSimpleUndo);
-TYPEINIT1(ScUndoPutCell, ScSimpleUndo);
-TYPEINIT1(ScUndoPageBreak, ScSimpleUndo);
-TYPEINIT1(ScUndoPrintZoom, ScSimpleUndo);
-TYPEINIT1(ScUndoThesaurus, ScSimpleUndo);
-TYPEINIT1(ScUndoReplaceNote, ScSimpleUndo);
-TYPEINIT1(ScUndoShowHideNote, ScSimpleUndo);
-TYPEINIT1(ScUndoDetective, ScSimpleUndo);
-TYPEINIT1(ScUndoRangeNames, ScSimpleUndo);
-
-
// -----------------------------------------------------------------------
//
// Attribute auf Cursor anwenden
@@ -154,13 +139,15 @@ void __EXPORT ScUndoCursorAttr::Redo()
void __EXPORT ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->ApplySelectionPattern( *pApplyPattern );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->ApplySelectionPattern( *pApplyPattern );
}
sal_Bool __EXPORT ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -330,16 +317,18 @@ void __EXPORT ScUndoEnterData::Redo()
void __EXPORT ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
String aTemp = aNewString;
- ((ScTabViewTarget&)rTarget).GetViewShell()->EnterDataAtCursor( aTemp );
+ pScTabViewTarget->GetViewShell()->EnterDataAtCursor( aTemp );
}
}
sal_Bool __EXPORT ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -585,9 +574,11 @@ void __EXPORT ScUndoPageBreak::Redo()
void __EXPORT ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
if (bInsert)
rViewShell.InsertPageBreak(bColumn, sal_True);
@@ -598,7 +589,7 @@ void __EXPORT ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
@@ -663,9 +654,11 @@ void __EXPORT ScUndoPrintZoom::Redo()
void __EXPORT ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
ScViewData* pViewData = rViewShell.GetViewData();
pViewData->GetDocShell()->SetPrintZoom( pViewData->GetTabNo(), nNewScale, nNewPages );
}
@@ -673,7 +666,7 @@ void __EXPORT ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -793,13 +786,17 @@ void __EXPORT ScUndoThesaurus::Redo()
void __EXPORT ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->DoThesaurus( sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->DoThesaurus( sal_True );
+ }
}
sal_Bool __EXPORT ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 23a6beab1d18..8082d4368e13 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -51,26 +51,6 @@
// -----------------------------------------------------------------------
-TYPEINIT1(ScUndoDoOutline, ScSimpleUndo);
-TYPEINIT1(ScUndoMakeOutline, ScSimpleUndo);
-TYPEINIT1(ScUndoOutlineLevel, ScSimpleUndo);
-TYPEINIT1(ScUndoOutlineBlock, ScSimpleUndo);
-TYPEINIT1(ScUndoRemoveAllOutlines, ScSimpleUndo);
-TYPEINIT1(ScUndoAutoOutline, ScSimpleUndo);
-TYPEINIT1(ScUndoSubTotals, ScDBFuncUndo);
-TYPEINIT1(ScUndoSort, ScDBFuncUndo);
-TYPEINIT1(ScUndoQuery, ScDBFuncUndo);
-TYPEINIT1(ScUndoAutoFilter, ScDBFuncUndo);
-TYPEINIT1(ScUndoDBData, ScSimpleUndo);
-TYPEINIT1(ScUndoImportData, ScSimpleUndo);
-TYPEINIT1(ScUndoRepeatDB, ScSimpleUndo);
-//UNUSED2008-05 TYPEINIT1(ScUndoPivot, ScSimpleUndo);
-TYPEINIT1(ScUndoDataPilot, ScSimpleUndo);
-TYPEINIT1(ScUndoConsolidate, ScSimpleUndo);
-TYPEINIT1(ScUndoChartData, ScSimpleUndo);
-
-// -----------------------------------------------------------------------
-
//
// Outline-Gruppen ein- oder ausblenden
@@ -238,9 +218,11 @@ void __EXPORT ScUndoMakeOutline::Redo()
void __EXPORT ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
if (bMake)
rViewShell.MakeOutline( bColumns, sal_True );
@@ -251,7 +233,7 @@ void __EXPORT ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoMakeOutline::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
//
@@ -335,13 +317,17 @@ void __EXPORT ScUndoOutlineLevel::Redo()
void __EXPORT ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->SelectLevel( bColumns, nLevel, sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->SelectLevel( bColumns, nLevel, sal_True );
+ }
}
sal_Bool __EXPORT ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
//
@@ -436,9 +422,11 @@ void __EXPORT ScUndoOutlineBlock::Redo()
void __EXPORT ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
if (bShow)
rViewShell.ShowMarkedOutlines( sal_True );
@@ -449,7 +437,7 @@ void __EXPORT ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
sal_Bool __EXPORT ScUndoOutlineBlock::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
//
@@ -534,13 +522,17 @@ void __EXPORT ScUndoRemoveAllOutlines::Redo()
void __EXPORT ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->RemoveAllOutlines( sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->RemoveAllOutlines( sal_True );
+ }
}
sal_Bool __EXPORT ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
//
@@ -643,13 +635,17 @@ void __EXPORT ScUndoAutoOutline::Redo()
void __EXPORT ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->AutoOutline( sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->AutoOutline( sal_True );
+ }
}
sal_Bool __EXPORT ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
//
@@ -1431,9 +1427,11 @@ void __EXPORT ScUndoImportData::Redo()
void __EXPORT ScUndoImportData::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell& rViewShell = *((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell& rViewShell = *pScTabViewTarget->GetViewShell();
SCTAB nDummy;
ScImportParam aNewParam(aImportParam);
@@ -1449,7 +1447,7 @@ sal_Bool __EXPORT ScUndoImportData::CanRepeat(SfxRepeatTarget& rTarget) const
// Repeat nur fuer Import per DB-Bereich, dann ist pUndoDBData gesetzt
if (pUndoDBData)
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
else
return sal_False; // Adressbuch
}
@@ -1618,13 +1616,17 @@ void __EXPORT ScUndoRepeatDB::Redo()
void __EXPORT ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->RepeatDB( sal_True );
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ {
+ pScTabViewTarget->GetViewShell()->RepeatDB( sal_True );
+ }
}
sal_Bool __EXPORT ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
//UNUSED2008-05 //
@@ -1774,7 +1776,7 @@ sal_Bool __EXPORT ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
//UNUSED2008-05 {
//UNUSED2008-05 // Wiederholen: nur loeschen
//UNUSED2008-05
-//UNUSED2008-05 if ( pOldUndoDoc && !pNewUndoDoc && rTarget.ISA(ScTabViewTarget) )
+//UNUSED2008-05 if ( pOldUndoDoc && !pNewUndoDoc && dynamic_cast< ScTabViewTarget* >(&rTarget) )
//UNUSED2008-05 ((ScTabViewTarget&)rTarget).GetViewShell()->DeletePivotTable();
//UNUSED2008-05 }
//UNUSED2008-05
@@ -1782,7 +1784,7 @@ sal_Bool __EXPORT ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
//UNUSED2008-05 {
//UNUSED2008-05 // Wiederholen: nur loeschen
//UNUSED2008-05
-//UNUSED2008-05 return ( pOldUndoDoc && !pNewUndoDoc && rTarget.ISA(ScTabViewTarget) );
+//UNUSED2008-05 return ( pOldUndoDoc && !pNewUndoDoc && dynamic_cast< ScTabViewTarget* >(&rTarget) );
//UNUSED2008-05 }
//
diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx
index db02d588eda3..0fd8bcb09ad1 100644
--- a/sc/source/ui/undo/undodraw.cxx
+++ b/sc/source/ui/undo/undodraw.cxx
@@ -35,10 +35,6 @@
// -----------------------------------------------------------------------
-TYPEINIT1(ScUndoDraw, SfxUndoAction);
-
-// -----------------------------------------------------------------------
-
ScUndoDraw::ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh ) :
pDrawUndo( pUndo ),
pDocShell( pDocSh )
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index eec30663b6b1..67268493e661 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -41,11 +41,6 @@
#include "globstr.hrc"
// -----------------------------------------------------------------------
-
-TYPEINIT1(ScUndoModifyStyle, ScSimpleUndo);
-TYPEINIT1(ScUndoApplyPageStyle, ScSimpleUndo);
-
-// -----------------------------------------------------------------------
//
// modify style (cell or page style)
//
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index d8df6e2ec4c5..873e37ea9e74 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -58,26 +58,6 @@ using namespace com::sun::star;
using ::com::sun::star::uno::Sequence;
using ::std::auto_ptr;
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(ScUndoInsertTab, SfxUndoAction);
-TYPEINIT1(ScUndoInsertTables, SfxUndoAction);
-TYPEINIT1(ScUndoDeleteTab, SfxUndoAction);
-TYPEINIT1(ScUndoRenameTab, SfxUndoAction);
-TYPEINIT1(ScUndoMoveTab, SfxUndoAction);
-TYPEINIT1(ScUndoCopyTab, SfxUndoAction);
-TYPEINIT1(ScUndoMakeScenario, SfxUndoAction);
-TYPEINIT1(ScUndoImportTab, SfxUndoAction);
-TYPEINIT1(ScUndoRemoveLink, SfxUndoAction);
-TYPEINIT1(ScUndoShowHideTab, SfxUndoAction);
-TYPEINIT1(ScUndoPrintRange, SfxUndoAction);
-TYPEINIT1(ScUndoScenarioFlags, SfxUndoAction);
-TYPEINIT1(ScUndoRenameObject, SfxUndoAction);
-TYPEINIT1(ScUndoLayoutRTL, SfxUndoAction);
-//UNUSED2009-05 TYPEINIT1(ScUndoSetGrammar, SfxUndoAction);
-TYPEINIT1(ScUndoTabColor, SfxUndoAction);
-
-
// -----------------------------------------------------------------------
//
// Tabelle einfuegen
@@ -167,14 +147,16 @@ void ScUndoInsertTab::Redo()
void ScUndoInsertTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->GetViewData()->GetDispatcher().
Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
sal_Bool ScUndoInsertTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
// -----------------------------------------------------------------------
@@ -286,14 +268,16 @@ void ScUndoInsertTables::Redo()
void ScUndoInsertTables::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->GetViewData()->GetDispatcher().
Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
sal_Bool ScUndoInsertTables::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -457,16 +441,18 @@ void ScUndoDeleteTab::Redo()
void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ScTabViewShell* pViewShell = ((ScTabViewTarget&)rTarget).GetViewShell();
+ ScTabViewShell* pViewShell = pScTabViewTarget->GetViewShell();
pViewShell->DeleteTable( pViewShell->GetViewData()->GetTabNo(), sal_True );
}
}
sal_Bool ScUndoDeleteTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -908,15 +894,17 @@ void ScUndoMakeScenario::Redo()
void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
{
- ((ScTabViewTarget&)rTarget).GetViewShell()->MakeScenario( aName, aComment, aColor, nFlags );
+ pScTabViewTarget->GetViewShell()->MakeScenario( aName, aComment, aColor, nFlags );
}
}
sal_Bool ScUndoMakeScenario::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1072,14 +1060,16 @@ void ScUndoImportTab::Redo()
void ScUndoImportTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->GetViewData()->GetDispatcher().
Execute(FID_INS_TABLE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
sal_Bool ScUndoImportTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
@@ -1211,15 +1201,17 @@ void ScUndoShowHideTab::Redo()
void ScUndoShowHideTab::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->GetViewData()->GetDispatcher().
Execute( bShow ? FID_TABLE_SHOW : FID_TABLE_HIDE,
SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
sal_Bool ScUndoShowHideTab::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
String ScUndoShowHideTab::GetComment() const
@@ -1542,8 +1534,8 @@ SdrObject* ScUndoRenameObject::GetObject()
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
if ( pDrawLayer )
{
- sal_uInt16 nCount = pDrawLayer->GetPageCount();
- for (sal_uInt16 nTab=0; nTab<nCount; nTab++)
+ const sal_uInt32 nCount(pDrawLayer->GetPageCount());
+ for (sal_uInt32 nTab=0; nTab<nCount; nTab++)
{
SdrPage* pPage = pDrawLayer->GetPage(nTab);
DBG_ASSERT(pPage,"Page ?");
@@ -1637,14 +1629,16 @@ void ScUndoLayoutRTL::Redo()
void ScUndoLayoutRTL::Repeat(SfxRepeatTarget& rTarget)
{
- if (rTarget.ISA(ScTabViewTarget))
- ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
+ ScTabViewTarget* pScTabViewTarget = dynamic_cast< ScTabViewTarget* >(&rTarget);
+
+ if (pScTabViewTarget)
+ pScTabViewTarget->GetViewShell()->GetViewData()->GetDispatcher().
Execute( FID_TAB_RTL, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
sal_Bool ScUndoLayoutRTL::CanRepeat(SfxRepeatTarget& rTarget) const
{
- return (rTarget.ISA(ScTabViewTarget));
+ return 0 != dynamic_cast< ScTabViewTarget* >(&rTarget);
}
String ScUndoLayoutRTL::GetComment() const
@@ -1694,7 +1688,7 @@ String ScUndoLayoutRTL::GetComment() const
//UNUSED2009-05 {
//UNUSED2009-05 #if 0
//UNUSED2009-05 // erAck: 2006-09-07T23:00+0200 commented out in CWS scr1c1
-//UNUSED2009-05 if (rTarget.ISA(ScTabViewTarget))
+//UNUSED2009-05 if (dynamic_cast< ScTabViewTarget* >(&rTarget))
//UNUSED2009-05 ((ScTabViewTarget&)rTarget).GetViewShell()->GetViewData()->GetDispatcher().
//UNUSED2009-05 Execute( FID_TAB_USE_R1C1, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
//UNUSED2009-05 #endif
@@ -1702,7 +1696,7 @@ String ScUndoLayoutRTL::GetComment() const
//UNUSED2009-05
//UNUSED2009-05 sal_Bool __EXPORT ScUndoSetGrammar::CanRepeat(SfxRepeatTarget& rTarget) const
//UNUSED2009-05 {
-//UNUSED2009-05 return (rTarget.ISA(ScTabViewTarget));
+//UNUSED2009-05 return dynamic_cast< ScTabViewTarget* >(&rTarget);
//UNUSED2009-05 }
//UNUSED2009-05
//UNUSED2009-05 String __EXPORT ScUndoSetGrammar::GetComment() const
diff --git a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
index 80557a200403..2cb49582cad0 100644
--- a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
+++ b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx
@@ -69,7 +69,7 @@ void SAL_CALL ScChartRangeSelectionListener::selectionChanged( const lang::Event
// while (pFrame)
// {
// SfxViewShell* pSh = pFrame->GetViewShell();
-// if (pSh && pSh->ISA(ScTabViewShell))
+// if (pSh && dynamic_cast< ScTabViewShell* >(pSh))
// {
// ScTabViewShell* pViewSh = (ScTabViewShell*)pSh;
// }
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index 9663fc17d895..877ffaf74408 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -58,8 +58,9 @@ ScAddressConversionObj::~ScAddressConversionObj()
void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId())
{
pDocShell = NULL; // invalid
}
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 71819db52724..d91f50a56b3c 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -47,6 +47,7 @@
#include <svl/zformat.hxx>
#include <rtl/uuid.h>
#include <float.h> // DBL_MIN
+#include <svx/globaldrawitempool.hxx>
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/util/CellProtection.hpp>
@@ -790,7 +791,7 @@ const SfxItemPropertyMapEntry* lcl_GetEditPropertyMap()
}
const SvxItemPropertySet* lcl_GetEditPropertySet()
{
- static SvxItemPropertySet aEditPropertySet( lcl_GetEditPropertyMap(), SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aEditPropertySet( lcl_GetEditPropertyMap(), GetGlobalDrawObjectItemPool() );
return &aEditPropertySet;
}
@@ -1511,9 +1512,9 @@ const ScMarkData* ScCellRangesBase::GetMarkData()
void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast< const ScUpdateRefHint* >(&rHint) )
{
- const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
+ const ScUpdateRefHint& rRef = static_cast< const ScUpdateRefHint& >(rHint);
ScDocument* pDoc = pDocShell->GetDocument();
ScRangeList* pUndoRanges = NULL;
@@ -1549,9 +1550,9 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
delete pUndoRanges;
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast< const SfxSimpleHint* >(&rHint) )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = static_cast< const SfxSimpleHint& >(rHint).GetId();
if ( nId == SFX_HINT_DYING )
{
ForgetCurrentAttrs();
@@ -1608,9 +1609,10 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
bGotDataChangedHint = sal_True;
}
}
- else if ( rHint.ISA( ScUnoRefUndoHint ) )
+ else if ( dynamic_cast< const ScUnoRefUndoHint* >(&rHint) )
{
const ScUnoRefUndoHint& rUndoHint = static_cast<const ScUnoRefUndoHint&>(rHint);
+
if ( rUndoHint.GetObjectId() == nObjectId )
{
// restore ranges from hint
@@ -2702,8 +2704,9 @@ void SAL_CALL ScCellRangesBase::firePropertiesChangeEvent( const uno::Sequence<
IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint )
{
- if ( pDocShell && pHint && pHint->ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint*)pHint)->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(pHint);
+
+ if(pDocShell && pHint && pSfxSimpleHint && (pSfxSimpleHint->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)))
{
// This may be called several times for a single change, if several formulas
// in the range are notified. So only a flag is set that is checked when
@@ -4758,8 +4761,11 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellRangesObj::getSupportedServiceNames(
uno::Reference<table::XCellRange> ScCellRangeObj::CreateRangeFromDoc( ScDocument* pDoc, const ScRange& rR )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
- return new ScCellRangeObj( (ScDocShell*) pObjSh, rR );
+ ScDocShell* pScDocShell = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pObjSh && pScDocShell )
+ return new ScCellRangeObj( pScDocShell, rR );
+
return NULL;
}
@@ -7756,9 +7762,10 @@ void SAL_CALL ScTableSheetObj::link( const rtl::OUString& aUrl, const rtl::OUStr
for ( sal_uInt16 i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScTableLink))
+ ScTableLink* pTabLink = dynamic_cast< ScTableLink* >(pBase);
+
+ if (pTabLink)
{
- ScTableLink* pTabLink = (ScTableLink*)pBase;
if ( pTabLink->GetFileName() == aFileString )
pTabLink->Update(); // inkl. Paint&Undo
@@ -9195,18 +9202,28 @@ ScCellsObj::~ScCellsObj()
void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
- const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- aRanges.UpdateReference( rRef.GetMode(), pDocShell->GetDocument(), rRef.GetRange(),
- rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
+ aRanges.UpdateReference(
+ pScUpdateRefHint->GetMode(),
+ pDocShell->GetDocument(),
+ pScUpdateRefHint->GetRange(),
+ pScUpdateRefHint->GetDx(),
+ pScUpdateRefHint->GetDy(),
+ pScUpdateRefHint->GetDz() );
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
}
+}
// XEnumerationAccess
@@ -9314,13 +9331,19 @@ void ScCellsEnumeration::Advance_Impl()
void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
if (pDocShell)
{
- const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
- aRanges.UpdateReference( rRef.GetMode(), pDocShell->GetDocument(), rRef.GetRange(),
- rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
+ aRanges.UpdateReference(
+ pScUpdateRefHint->GetMode(),
+ pDocShell->GetDocument(),
+ pScUpdateRefHint->GetRange(),
+ pScUpdateRefHint->GetDx(),
+ pScUpdateRefHint->GetDy(),
+ pScUpdateRefHint->GetDz() );
delete pMark; // aus verschobenen Bereichen neu erzeugen
pMark = NULL;
@@ -9329,8 +9352,14 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
ScRangeList aNew;
aNew.Append(ScRange(aPos));
- aNew.UpdateReference( rRef.GetMode(), pDocShell->GetDocument(), rRef.GetRange(),
- rRef.GetDx(), rRef.GetDy(), rRef.GetDz() );
+ aNew.UpdateReference(
+ pScUpdateRefHint->GetMode(),
+ pDocShell->GetDocument(),
+ pScUpdateRefHint->GetRange(),
+ pScUpdateRefHint->GetDx(),
+ pScUpdateRefHint->GetDy(),
+ pScUpdateRefHint->GetDz() );
+
if (aNew.Count()==1)
{
aPos = aNew.GetObject(0)->aStart;
@@ -9339,12 +9368,16 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
}
+}
// XEnumeration
@@ -9391,16 +9424,22 @@ ScCellFormatsObj::~ScCellFormatsObj()
void ScCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
//! aTotalRange...
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
}
+}
ScCellRangeObj* ScCellFormatsObj::GetObjectByIndex_Impl(long nIndex) const
{
@@ -9561,11 +9600,11 @@ ScCellRangeObj* ScCellFormatsEnumeration::NextObject_Impl()
void ScCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast< const ScUpdateRefHint* >(&rHint) )
{
//! und nun ???
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast< const SfxSimpleHint* >(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
@@ -9624,11 +9663,11 @@ ScUniqueCellFormatsObj::~ScUniqueCellFormatsObj()
void ScUniqueCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast< const ScUpdateRefHint* >(&rHint) )
{
//! aTotalRange...
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast< const SfxSimpleHint* >(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
@@ -9891,11 +9930,11 @@ ScUniqueCellFormatsEnumeration::~ScUniqueCellFormatsEnumeration()
void ScUniqueCellFormatsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast< const ScUpdateRefHint* >(&rHint) )
{
//! und nun ???
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast< const SfxSimpleHint* >(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index a4d923bba8a2..924da284b03c 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1013,8 +1013,9 @@ ScChart2DataProvider::~ScChart2DataProvider()
void ScChart2DataProvider::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
m_pDocument = NULL;
}
@@ -2281,8 +2282,9 @@ ScChart2DataSource::~ScChart2DataSource()
void ScChart2DataSource::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
m_pDocument = NULL;
}
@@ -2383,7 +2385,6 @@ void ScChart2DataSource::AddLabeledSequence(const uno::Reference < chart2::data:
m_aLabeledSequences.push_back(xNew);
}
-
// DataSequence ==============================================================
ScChart2DataSequence::Item::Item() :
@@ -2786,9 +2787,11 @@ void ScChart2DataSequence::CopyData(const ScChart2DataSequence& r)
void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = static_cast<const SfxSimpleHint&>(rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId ==SFX_HINT_DYING )
{
m_pDocument = NULL;
@@ -2821,7 +2824,11 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
m_bGotDataChangedHint = true;
}
}
- else if ( rHint.ISA( ScUpdateRefHint ) )
+ else
+ {
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
// Create a range list from the token list, have the range list
// updated, and bring the change back to the token list.
@@ -2848,60 +2855,69 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
if ( m_pDocument->HasUnoRefUndo() )
pUndoRanges.reset(new ScRangeList(aRanges));
- const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
bool bChanged = aRanges.UpdateReference(
- rRef.GetMode(), m_pDocument, rRef.GetRange(), rRef.GetDx(), rRef.GetDy(), rRef.GetDz());
-
- if (bChanged)
- {
- DBG_ASSERT(m_pRangeIndices->size() == static_cast<size_t>(aRanges.Count()),
- "range list and range index list have different sizes after the reference update.");
+ pScUpdateRefHint->GetMode(),
+ m_pDocument,
+ pScUpdateRefHint->GetRange(),
+ pScUpdateRefHint->GetDx(),
+ pScUpdateRefHint->GetDy(),
+ pScUpdateRefHint->GetDz());
+
+ if (bChanged)
+ {
+ DBG_ASSERT(m_pRangeIndices->size() == static_cast<size_t>(aRanges.Count()),
+ "range list and range index list have different sizes after the reference update.");
- // Bring the change back from the range list to the token list.
- UpdateTokensFromRanges(aRanges);
+ // Bring the change back from the range list to the token list.
+ UpdateTokensFromRanges(aRanges);
- if (pUndoRanges.get())
- m_pDocument->AddUnoRefChange(m_nObjectId, *pUndoRanges);
+ if (pUndoRanges.get())
+ m_pDocument->AddUnoRefChange(m_nObjectId, *pUndoRanges);
+ }
}
- }
- else if ( rHint.ISA( ScUnoRefUndoHint ) )
- {
- const ScUnoRefUndoHint& rUndoHint = static_cast<const ScUnoRefUndoHint&>(rHint);
-
- do
+ else
{
- if (rUndoHint.GetObjectId() != m_nObjectId)
- break;
+ const ScUnoRefUndoHint* pScUnoRefUndoHint = dynamic_cast< const ScUnoRefUndoHint* >(&rHint);
- // The hint object provides the old ranges. Restore the old state
- // from these ranges.
-
- if (!m_pRangeIndices.get() || m_pRangeIndices->empty())
+ if ( pScUnoRefUndoHint )
{
- DBG_ERROR(" faulty range indices");
- break;
- }
+ do
+ {
+ if (pScUnoRefUndoHint->GetObjectId() != m_nObjectId)
+ break;
- const ScRangeList& rRanges = rUndoHint.GetRanges();
+ // The hint object provides the old ranges. Restore the old state
+ // from these ranges.
- sal_uInt32 nCount = rRanges.Count();
- if (nCount != m_pRangeIndices->size())
- {
- DBG_ERROR("range count and range index count differ.");
- break;
- }
+ if (!m_pRangeIndices.get() || m_pRangeIndices->empty())
+ {
+ DBG_ERROR(" faulty range indices");
+ break;
+ }
+
+ const ScRangeList& rRanges = pScUnoRefUndoHint->GetRanges();
- UpdateTokensFromRanges(rRanges);
+ sal_uInt32 nCount = rRanges.Count();
+ if (nCount != m_pRangeIndices->size())
+ {
+ DBG_ERROR("range count and range index count differ.");
+ break;
+ }
+
+ UpdateTokensFromRanges(rRanges);
+ }
+ while (false);
+ }
}
- while (false);
}
}
IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
{
- if ( m_pDocument && pHint && pHint->ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint*)pHint)->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(pHint);
+
+ if ( m_pDocument && pSfxSimpleHint && (pSfxSimpleHint->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)))
{
// This may be called several times for a single change, if several formulas
// in the range are notified. So only a flag is set that is checked when
@@ -3626,8 +3642,9 @@ ScChart2EmptyDataSequence::~ScChart2EmptyDataSequence()
void ScChart2EmptyDataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
m_pDocument = NULL;
}
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index a8d9bb952888..2318808cd3f8 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -39,7 +39,6 @@
#include <unotools/moduleoptions.hxx>
#include <sot/clsids.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <svx/charthelper.hxx>
#include "chartuno.hxx"
#include "miscuno.hxx"
@@ -115,9 +114,9 @@ ScChartsObj::~ScChartsObj()
void ScChartsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -221,87 +220,88 @@ void SAL_CALL ScChartsObj::addNewByName( const rtl::OUString& aName,
xObj = pDocShell->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID ).GetByteSequence(), aTmp );
if ( xObj.is() )
{
- String aObjName = aTmp; // wirklich eingefuegter Name...
-
- // Rechteck anpassen
- //! Fehler/Exception, wenn leer/ungueltig ???
- Point aRectPos( aRect.X, aRect.Y );
- bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
- if ( ( aRectPos.X() < 0 && !bLayoutRTL ) || ( aRectPos.X() > 0 && bLayoutRTL ) ) aRectPos.X() = 0;
- if (aRectPos.Y() < 0) aRectPos.Y() = 0;
- Size aRectSize( aRect.Width, aRect.Height );
- if (aRectSize.Width() <= 0) aRectSize.Width() = 5000; // Default-Groesse
- if (aRectSize.Height() <= 0) aRectSize.Height() = 5000;
- Rectangle aInsRect( aRectPos, aRectSize );
-
- sal_Int64 nAspect(embed::Aspects::MSOLE_CONTENT);
- MapUnit aMapUnit(VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ));
- Size aSize(aInsRect.GetSize());
- aSize = Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) );
- awt::Size aSz;
- aSz.Width = aSize.Width();
- aSz.Height = aSize.Height();
-
- // Calc -> DataProvider
- uno::Reference< chart2::data::XDataProvider > xDataProvider = new
- ScChart2DataProvider( pDoc );
- // Chart -> DataReceiver
- uno::Reference< chart2::data::XDataReceiver > xReceiver;
- uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
- if( xCompSupp.is())
- xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
- if( xReceiver.is())
- {
- String sRangeStr;
- xNewRanges->Format(sRangeStr, SCR_ABS_3D, pDoc);
-
- // connect
- if( sRangeStr.Len() )
- xReceiver->attachDataProvider( xDataProvider );
- else
- sRangeStr = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "all" ) );
-
- uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( pDocShell->GetModel(), uno::UNO_QUERY );
- xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
-
- // set arguments
- uno::Sequence< beans::PropertyValue > aArgs( 4 );
- aArgs[0] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
- uno::makeAny( ::rtl::OUString( sRangeStr )), beans::PropertyState_DIRECT_VALUE );
- aArgs[1] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("HasCategories"), -1,
- uno::makeAny( bRowHeaders ), beans::PropertyState_DIRECT_VALUE );
- aArgs[2] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
- uno::makeAny( bColumnHeaders ), beans::PropertyState_DIRECT_VALUE );
- aArgs[3] = beans::PropertyValue(
- ::rtl::OUString::createFromAscii("DataRowSource"), -1,
- uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
- xReceiver->setArguments( aArgs );
- }
-
- ScChartListener* pChartListener =
- new ScChartListener( aObjName, pDoc, xNewRanges );
- pDoc->GetChartListenerCollection()->Insert( pChartListener );
- pChartListener->StartListeningTo();
-
- SdrOle2Obj* pObj = new SdrOle2Obj( ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), aObjName, aInsRect );
-
- // set VisArea
- if( xObj.is())
- xObj->setVisualAreaSize( nAspect, aSz );
-
- // #121334# This call will change the chart's default background fill from white to transparent.
- // Add here again if this is wanted (see task description for details)
- // ChartHelper::AdaptDefaultsForChart( xObj );
-
- pPage->InsertObject( pObj );
- pModel->AddUndo( new SdrUndoNewObj( *pObj ) );
+ String aObjName = aTmp; // wirklich eingefuegter Name...
+
+ // Rechteck anpassen
+ //! Fehler/Exception, wenn leer/ungueltig ???
+ Point aRectPos( aRect.X, aRect.Y );
+ bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
+ if ( ( aRectPos.X() < 0 && !bLayoutRTL ) || ( aRectPos.X() > 0 && bLayoutRTL ) ) aRectPos.X() = 0;
+ if (aRectPos.Y() < 0) aRectPos.Y() = 0;
+ Size aRectSize( aRect.Width, aRect.Height );
+ if (aRectSize.Width() <= 0) aRectSize.Width() = 5000; // Default-Groesse
+ if (aRectSize.Height() <= 0) aRectSize.Height() = 5000;
+
+ sal_Int64 nAspect(embed::Aspects::MSOLE_CONTENT);
+ MapUnit aMapUnit(VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ));
+ Size aSize(aRectSize);
+ aSize = Window::LogicToLogic( aSize, MapMode( MAP_100TH_MM ), MapMode( aMapUnit ) );
+ awt::Size aSz;
+ aSz.Width = aSize.Width();
+ aSz.Height = aSize.Height();
+
+ // Calc -> DataProvider
+ uno::Reference< chart2::data::XDataProvider > xDataProvider = new
+ ScChart2DataProvider( pDoc );
+ // Chart -> DataReceiver
+ uno::Reference< chart2::data::XDataReceiver > xReceiver;
+ uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
+ if( xCompSupp.is())
+ xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
+ if( xReceiver.is())
+ {
+ String sRangeStr;
+ xNewRanges->Format(sRangeStr, SCR_ABS_3D, pDoc);
+
+ // connect
+ if( sRangeStr.Len() )
+ xReceiver->attachDataProvider( xDataProvider );
+ else
+ sRangeStr = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "all" ) );
+
+ uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( pDocShell->GetModel(), uno::UNO_QUERY );
+ xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
+
+ // set arguments
+ uno::Sequence< beans::PropertyValue > aArgs( 4 );
+ aArgs[0] = beans::PropertyValue(
+ ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
+ uno::makeAny( ::rtl::OUString( sRangeStr )), beans::PropertyState_DIRECT_VALUE );
+ aArgs[1] = beans::PropertyValue(
+ ::rtl::OUString::createFromAscii("HasCategories"), -1,
+ uno::makeAny( bRowHeaders ), beans::PropertyState_DIRECT_VALUE );
+ aArgs[2] = beans::PropertyValue(
+ ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
+ uno::makeAny( bColumnHeaders ), beans::PropertyState_DIRECT_VALUE );
+ aArgs[3] = beans::PropertyValue(
+ ::rtl::OUString::createFromAscii("DataRowSource"), -1,
+ uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE );
+ xReceiver->setArguments( aArgs );
+ }
- // Dies veranlaesst Chart zum sofortigen Update
- //SvData aEmpty;
- //aIPObj->SendDataChanged( aEmpty );
+ ScChartListener* pChartListener =
+ new ScChartListener( aObjName, pDoc, xNewRanges );
+ pDoc->GetChartListenerCollection()->Insert( pChartListener );
+ pChartListener->StartListeningTo();
+
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ *pModel,
+ ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ),
+ aObjName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRectSize.getWidth(), aRectSize.getHeight(),
+ aRectPos.X(), aRectPos.Y()));
+
+ // set VisArea
+ if( xObj.is())
+ xObj->setVisualAreaSize( nAspect, aSz );
+
+ pPage->InsertObjectToSdrObjList(*pObj);
+ pModel->AddUndo( new SdrUndoNewObj( *pObj ) );
+
+ // Dies veranlaesst Chart zum sofortigen Update
+ //SvData aEmpty;
+ //aIPObj->SendDataChanged( aEmpty );
}
}
@@ -318,7 +318,7 @@ void SAL_CALL ScChartsObj::removeByName( const rtl::OUString& aName )
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); // ist nicht 0
pModel->AddUndo( new SdrUndoDelObj( *pObj ) );
- pPage->RemoveObject( pObj->GetOrdNum() );
+ pPage->RemoveObjectFromSdrObjList( pObj->GetNavigationPosition() );
//! Notify etc.???
}
@@ -481,9 +481,9 @@ ScChartObj::~ScChartObj()
void ScChartObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 93a614ad17e5..f82bc29cca67 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -108,9 +108,9 @@ ScDocumentConfiguration::~ScDocumentConfiguration()
void ScDocumentConfiguration::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 2febbb7b4532..a06b1e43f42d 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -321,9 +321,9 @@ ScDataPilotTablesObj::~ScDataPilotTablesObj()
void ScDataPilotTablesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -673,9 +673,9 @@ Sequence<sal_Int8> SAL_CALL ScDataPilotDescriptorBase::getImplementationId()
void ScDataPilotDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Referenz-Update?
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -1389,12 +1389,13 @@ void SAL_CALL ScDataPilotTableObj::removeModifyListener( const uno::Reference<ut
void ScDataPilotTableObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA(ScDataPilotModifiedHint) &&
- static_cast<const ScDataPilotModifiedHint&>(rHint).GetName() == aName )
+ const ScDataPilotModifiedHint* pScDataPilotModifiedHint = dynamic_cast< const ScDataPilotModifiedHint* >(&rHint);
+
+ if ( pScDataPilotModifiedHint && pScDataPilotModifiedHint->GetName() == aName )
{
Refreshed_Impl();
}
- else if ( rHint.ISA( ScUpdateRefHint ) )
+ else if ( dynamic_cast< const ScUpdateRefHint* >(&rHint) )
{
ScRange aRange( 0, 0, nTab );
ScRangeList aRanges;
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 324bb8c2dea4..ce38f956c998 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1091,9 +1091,11 @@ ScFilterDescriptorBase::~ScFilterDescriptorBase()
void ScFilterDescriptorBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
pDocSh = NULL; // invalid
@@ -1626,17 +1628,27 @@ ScDatabaseRangeObj::~ScDatabaseRangeObj()
void ScDatabaseRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
- pDocShell = NULL; // ungueltig geworden
- else if ( rHint.ISA (ScDBRangeRefreshedHint) )
+ if ( pSfxSimpleHint )
+ {
+ if(SFX_HINT_DYING == pSfxSimpleHint->GetId())
+ {
+ pDocShell = NULL; // ungueltig geworden
+ }
+ }
+ else
{
- ScDBData* pDBData = GetDBData_Impl();
- const ScDBRangeRefreshedHint& rRef = (const ScDBRangeRefreshedHint&)rHint;
- ScImportParam aParam;
- pDBData->GetImportParam(aParam);
- if (aParam == rRef.GetImportParam())
- Refreshed_Impl();
+ const ScDBRangeRefreshedHint* pScDBRangeRefreshedHint = dynamic_cast< const ScDBRangeRefreshedHint* >(&rHint);
+
+ if ( pScDBRangeRefreshedHint )
+ {
+ ScDBData* pDBData = GetDBData_Impl();
+ ScImportParam aParam;
+ pDBData->GetImportParam(aParam);
+ if (aParam == pScDBRangeRefreshedHint->GetImportParam())
+ Refreshed_Impl();
+ }
}
}
@@ -2180,9 +2192,9 @@ ScDatabaseRangesObj::~ScDatabaseRangesObj()
void ScDatabaseRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx
index 2585174516e3..f274f8a53ef8 100644
--- a/sc/source/ui/unoobj/defltuno.cxx
+++ b/sc/source/ui/unoobj/defltuno.cxx
@@ -102,8 +102,9 @@ ScDocDefaultsObj::~ScDocDefaultsObj()
void ScDocDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index 1c30bdd2ef9c..792a7191cb26 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -103,8 +103,9 @@ ScDispatchProviderInterceptor::~ScDispatchProviderInterceptor()
void ScDispatchProviderInterceptor::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pViewShell = NULL;
}
@@ -232,8 +233,9 @@ ScDispatch::~ScDispatch()
void ScDispatch::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pViewShell = NULL;
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 28e3dec5d5d6..1f2901a8379f 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -30,6 +30,7 @@
#include <svx/svditer.hxx>
#include <svx/svdpage.hxx>
#include <svx/svxids.hrc>
+#include <svx/svdlegacy.hxx>
#include <svx/unoshape.hxx>
#include <svl/numuno.hxx>
@@ -349,6 +350,18 @@ void ScModelObj::CreateAndSet(ScDocShell* pDocSh)
pDocSh->SetBaseModel( new ScModelObj(pDocSh) );
}
+SdrModel* ScModelObj::getSdrModel() const
+{
+ ScDocument* pDoc = pDocShell->GetDocument();
+
+ if(!pDoc->GetDrawLayer())
+ {
+ pDoc->InitDrawLayer();
+ }
+
+ return pDoc->GetDrawLayer();
+}
+
ScModelObj::ScModelObj( ScDocShell* pDocSh ) :
SfxBaseModel( pDocSh ),
aPropSet( lcl_GetDocOptPropertyMap() ),
@@ -564,10 +577,11 @@ uno::Sequence<sal_Int8> SAL_CALL ScModelObj::getImplementationId()
void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
// Not interested in reference update hints here
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) )
+ if ( pSfxSimpleHint )
{
- sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
+ sal_uLong nId = pSfxSimpleHint->GetId();
if ( nId == SFX_HINT_DYING )
{
pDocShell = NULL; // has become invalid
@@ -607,20 +621,26 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if ( rHint.ISA( ScPointerChangedHint ) )
+ else
{
- sal_uInt16 nFlags = ((const ScPointerChangedHint&)rHint).GetFlags();
- if (nFlags & SC_POINTERCHANGED_NUMFMT)
+ const ScPointerChangedHint* pScPointerChangedHint = dynamic_cast< const ScPointerChangedHint* >(&rHint);
+
+ if ( pScPointerChangedHint )
{
- // NumberFormatter-Pointer am Uno-Objekt neu setzen
+ sal_uInt16 nFlags = pScPointerChangedHint->GetFlags();
- if (GetFormatter().is())
+ if (nFlags & SC_POINTERCHANGED_NUMFMT)
{
- SvNumberFormatsSupplierObj* pNumFmt =
- SvNumberFormatsSupplierObj::getImplementation(
- uno::Reference<util::XNumberFormatsSupplier>(xNumberAgg, uno::UNO_QUERY) );
- if ( pNumFmt && pDocShell )
- pNumFmt->SetNumberFormatter( pDocShell->GetDocument()->GetFormatTable() );
+ // NumberFormatter-Pointer am Uno-Objekt neu setzen
+
+ if (GetFormatter().is())
+ {
+ SvNumberFormatsSupplierObj* pNumFmt =
+ SvNumberFormatsSupplierObj::getImplementation(
+ uno::Reference<util::XNumberFormatsSupplier>(xNumberAgg, uno::UNO_QUERY) );
+ if ( pNumFmt && pDocShell )
+ pNumFmt->SetNumberFormatter( pDocShell->GetDocument()->GetFormatTable() );
+ }
}
}
}
@@ -739,7 +759,7 @@ bool lcl_ParseTarget( const String& rTarget, ScRange& rTargetRange, Rectangle& r
{
if ( ScDrawLayer::GetVisibleName( pObject ) == rTarget )
{
- rTargetRect = pObject->GetLogicRect(); // 1/100th mm
+ rTargetRect = sdr::legacy::GetLogicRect(*pObject); // 1/100th mm
rTargetRange = pDoc->GetRange( i, rTargetRect ); // underlying cells
bRangeValid = bRectValid = true; // rectangle is valid
}
@@ -872,7 +892,7 @@ sal_Bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
ScDocument* pDoc = pDocShell->GetDocument();
if( pDoc && pSdrObj )
{
- Rectangle aObjRect = pSdrObj->GetCurrentBoundRect();
+ Rectangle aObjRect = sdr::legacy::GetBoundRect(*pSdrObj);
SCTAB nCurrentTab = ScDocShell::GetCurTab();
ScRange aRange = pDoc->GetRange( nCurrentTab, aObjRect );
rMark.SetMarkArea( aRange );
@@ -1140,8 +1160,9 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
if( pModel )
{
- pDrawView = new FmFormView( pModel, pDev );
- pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
+ pDrawView = new FmFormView( *pModel, pDev );
+ pDrawView->ShowSdrPage(*pDrawView->getSdrModelFromSdrView().GetPage(nTab));
+ pDrawView->SetPrintPreview(true);
pDrawView->SetPrintPreview( sal_True );
}
@@ -1170,7 +1191,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
long nTabStart = pPrintFuncCache->GetTabStart( nTab );
- vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFData = dynamic_cast< vcl::PDFExtOutDevData* >( pDev->GetExtOutDevData() );
if ( nRenderer == nTabStart )
{
// first page of a sheet: add outline item for the sheet name
@@ -1298,8 +1319,6 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
rBookmarks.clear();
}
- if ( pDrawView )
- pDrawView->HideSdrPage();
delete pDrawView;
}
@@ -2368,9 +2387,9 @@ ScDrawPagesObj::~ScDrawPagesObj()
void ScDrawPagesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -2423,7 +2442,7 @@ void SAL_CALL ScDrawPagesObj::remove( const uno::Reference<drawing::XDrawPage>&
SdrPage* pPage = pImp->GetSdrPage();
if (pPage)
{
- SCTAB nPageNum = static_cast<SCTAB>(pPage->GetPageNum());
+ SCTAB nPageNum = static_cast<SCTAB>(pPage->GetPageNumber());
ScDocFunc aFunc(*pDocShell);
aFunc.DeleteTable( nPageNum, sal_True, sal_True );
}
@@ -2482,9 +2501,9 @@ ScTableSheetsObj::~ScTableSheetsObj()
void ScTableSheetsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -2870,18 +2889,24 @@ ScTableColumnsObj::~ScTableColumnsObj()
void ScTableColumnsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Referenz-Update fuer Tab und Start/Ende
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
}
+}
// XTableColumns
@@ -3147,18 +3172,24 @@ ScTableRowsObj::~ScTableRowsObj()
void ScTableRowsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Referenz-Update fuer Tab und Start/Ende
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
}
+}
// XTableRows
@@ -3427,9 +3458,9 @@ ScSpreadsheetSettingsObj::~ScSpreadsheetSettingsObj()
void ScSpreadsheetSettingsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -3481,9 +3512,9 @@ ScAnnotationsObj::~ScAnnotationsObj()
void ScAnnotationsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! nTab bei Referenz-Update anpassen!!!
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -3627,16 +3658,22 @@ ScScenariosObj::~ScScenariosObj()
void ScScenariosObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Referenz-Update fuer Tab und Start/Ende
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
{
- pDocShell = NULL; // ungueltig geworden
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
+ {
+ pDocShell = NULL; // ungueltig geworden
+ }
}
}
diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx
index 3f227040ae0d..d7c02e1adc66 100644
--- a/sc/source/ui/unoobj/drdefuno.cxx
+++ b/sc/source/ui/unoobj/drdefuno.cxx
@@ -52,8 +52,9 @@ ScDrawDefaultsObj::~ScDrawDefaultsObj() throw ()
void ScDrawDefaultsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx
index bfae1332e8cb..f50003440db8 100644
--- a/sc/source/ui/unoobj/editsrc.cxx
+++ b/sc/source/ui/unoobj/editsrc.cxx
@@ -49,8 +49,6 @@
//------------------------------------------------------------------------
-TYPEINIT1( ScHeaderFooterChangedHint, SfxHint );
-
ScHeaderFooterChangedHint::ScHeaderFooterChangedHint(sal_uInt16 nP) :
nPart( nP )
{
@@ -262,7 +260,7 @@ void ScAnnotationEditSource::UpdateData()
OutlinerParaObject* pOPO = new OutlinerParaObject( *pEditObj );
delete pEditObj;
pOPO->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT );
- pObj->NbcSetOutlinerParaObject( pOPO );
+ pObj->SetOutlinerParaObject( pOPO );
pObj->ActionChanged();
}
@@ -276,13 +274,13 @@ void ScAnnotationEditSource::UpdateData()
void ScAnnotationEditSource::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast< const ScUpdateRefHint* >(&rHint) )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast< const SfxSimpleHint* >(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index 513347ee058f..4c5c94c07783 100755
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -55,8 +55,9 @@ ScSheetEventsObj::~ScSheetEventsObj()
void ScSheetEventsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! reference update
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId())
{
mpDocShell = NULL;
}
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 56872dca4df1..7d50b43adf7c 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -123,7 +123,7 @@ class ScUnoEditEngine : public ScEditEngineDefaulter
{
ScUnoCollectMode eMode;
sal_uInt16 nFieldCount;
- TypeId aFieldType;
+ const std::type_info* pFieldType;
SvxFieldData* pFound; // lokale Kopie
sal_uInt16 nFieldPar;
xub_StrLen nFieldPos;
@@ -137,9 +137,9 @@ public:
virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
Color*& rTxtColor, Color*& rFldColor );
- sal_uInt16 CountFields(TypeId aType);
- SvxFieldData* FindByIndex(sal_uInt16 nIndex, TypeId aType);
- SvxFieldData* FindByPos(sal_uInt16 nPar, xub_StrLen nPos, TypeId aType);
+ sal_uInt16 CountFields(const std::type_info* pType);
+ SvxFieldData* FindByIndex(sal_uInt16 nIndex, const std::type_info* pType);
+ SvxFieldData* FindByPos(sal_uInt16 nPar, xub_StrLen nPos, const std::type_info* pType);
sal_uInt16 GetFieldPar() const { return nFieldPar; }
xub_StrLen GetFieldPos() const { return nFieldPos; }
@@ -149,7 +149,7 @@ ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource) :
ScEditEngineDefaulter( *pSource ),
eMode( SC_UNO_COLLECT_NONE ),
nFieldCount( 0 ),
- aFieldType( NULL ),
+ pFieldType( 0 ),
pFound( NULL )
{
if (pSource)
@@ -174,7 +174,7 @@ String ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
const SvxFieldData* pFieldData = rField.GetField();
if ( pFieldData )
{
- if ( !aFieldType || pFieldData->Type() == aFieldType )
+ if ( !pFieldType || typeid(*pFieldData) == *pFieldType )
{
if ( eMode == SC_UNO_COLLECT_FINDINDEX && !pFound && nFieldCount == nFieldIndex )
{
@@ -195,40 +195,40 @@ String ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
return aRet;
}
-sal_uInt16 ScUnoEditEngine::CountFields(TypeId aType)
+sal_uInt16 ScUnoEditEngine::CountFields(const std::type_info* pType)
{
eMode = SC_UNO_COLLECT_COUNT;
- aFieldType = aType;
+ pFieldType = pType;
nFieldCount = 0;
UpdateFields();
- aFieldType = NULL;
+ pFieldType = 0;
eMode = SC_UNO_COLLECT_NONE;
return nFieldCount;
}
-SvxFieldData* ScUnoEditEngine::FindByIndex(sal_uInt16 nIndex, TypeId aType)
+SvxFieldData* ScUnoEditEngine::FindByIndex(sal_uInt16 nIndex, const std::type_info* pType)
{
eMode = SC_UNO_COLLECT_FINDINDEX;
nFieldIndex = nIndex;
- aFieldType = aType;
+ pFieldType = pType;
nFieldCount = 0;
UpdateFields();
- aFieldType = NULL;
+ pFieldType = 0;
eMode = SC_UNO_COLLECT_NONE;
return pFound;
}
-SvxFieldData* ScUnoEditEngine::FindByPos(sal_uInt16 nPar, xub_StrLen nPos, TypeId aType)
+SvxFieldData* ScUnoEditEngine::FindByPos(sal_uInt16 nPar, xub_StrLen nPos, const std::type_info* pType)
{
eMode = SC_UNO_COLLECT_FINDPOS;
nFieldPar = nPar;
nFieldPos = nPos;
- aFieldType = aType;
+ pFieldType = pType;
nFieldCount = 0;
UpdateFields();
- aFieldType = NULL;
+ pFieldType = 0;
eMode = SC_UNO_COLLECT_NONE;
return pFound;
@@ -270,16 +270,22 @@ ScCellFieldsObj::~ScCellFieldsObj()
void ScCellFieldsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
{
- pDocShell = NULL; // ungueltig geworden
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
+ {
+ pDocShell = NULL; // ungueltig geworden
+ }
}
// EditSource hat sich selber als Listener angemeldet
@@ -542,17 +548,22 @@ ScCellFieldObj::~ScCellFieldObj()
void ScCellFieldObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Updates fuer aSelection (muessen erst noch erzeugt werden) !!!!!!
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( pScUpdateRefHint )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
{
- pDocShell = NULL; // ungueltig geworden
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
+ {
+ pDocShell = NULL; // ungueltig geworden
+ }
}
// EditSource hat sich selber als Listener angemeldet
@@ -912,20 +923,20 @@ ScHeaderFieldObj* ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) cons
//! Feld-Funktionen muessen an den Forwarder !!!
ScEditEngineDefaulter* pEditEngine = ((ScHeaderFooterEditSource*)pEditSource)->GetEditEngine();
ScUnoEditEngine aTempEngine(pEditEngine);
+ const std::type_info* pTypeId = 0;
- TypeId aTypeId = NULL;
switch (nType)
{
- case SC_SERVICE_PAGEFIELD: aTypeId = TYPE(SvxPageField); break;
- case SC_SERVICE_PAGESFIELD: aTypeId = TYPE(SvxPagesField); break;
- case SC_SERVICE_DATEFIELD: aTypeId = TYPE(SvxDateField); break;
- case SC_SERVICE_TIMEFIELD: aTypeId = TYPE(SvxTimeField); break;
- case SC_SERVICE_TITLEFIELD: aTypeId = TYPE(SvxFileField); break;
- case SC_SERVICE_FILEFIELD: aTypeId = TYPE(SvxExtFileField); break;
- case SC_SERVICE_SHEETFIELD: aTypeId = TYPE(SvxTableField); break;
- // bei SC_SERVICE_INVALID bleibt TypeId Null
+ case SC_SERVICE_PAGEFIELD: pTypeId = &typeid(SvxPageField); break;
+ case SC_SERVICE_PAGESFIELD: pTypeId = &typeid(SvxPagesField); break;
+ case SC_SERVICE_DATEFIELD: pTypeId = &typeid(SvxDateField); break;
+ case SC_SERVICE_TIMEFIELD: pTypeId = &typeid(SvxTimeField); break;
+ case SC_SERVICE_TITLEFIELD: pTypeId = &typeid(SvxFileField); break;
+ case SC_SERVICE_FILEFIELD: pTypeId = &typeid(SvxExtFileField); break;
+ case SC_SERVICE_SHEETFIELD: pTypeId = &typeid(SvxTableField); break;
+ // bei SC_SERVICE_INVALID bleibt pTypeId Null
}
- SvxFieldData* pData = aTempEngine.FindByIndex( (sal_uInt16)Index, aTypeId );
+ SvxFieldData* pData = aTempEngine.FindByIndex( (sal_uInt16)Index, pTypeId );
if ( pData )
{
sal_uInt16 nPar = aTempEngine.GetFieldPar();
@@ -934,13 +945,20 @@ ScHeaderFieldObj* ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_Int32 Index) cons
sal_uInt16 nFieldType = nType;
if ( nFieldType == SC_SERVICE_INVALID )
{
- if ( pData->ISA( SvxPageField ) ) nFieldType = SC_SERVICE_PAGEFIELD;
- else if ( pData->ISA( SvxPagesField ) ) nFieldType = SC_SERVICE_PAGESFIELD;
- else if ( pData->ISA( SvxDateField ) ) nFieldType = SC_SERVICE_DATEFIELD;
- else if ( pData->ISA( SvxTimeField ) ) nFieldType = SC_SERVICE_TIMEFIELD;
- else if ( pData->ISA( SvxFileField ) ) nFieldType = SC_SERVICE_TITLEFIELD;
- else if ( pData->ISA( SvxExtFileField ) ) nFieldType = SC_SERVICE_FILEFIELD;
- else if ( pData->ISA( SvxTableField ) ) nFieldType = SC_SERVICE_SHEETFIELD;
+ if ( dynamic_cast< SvxPageField* >(pData) )
+ nFieldType = SC_SERVICE_PAGEFIELD;
+ else if ( dynamic_cast< SvxPagesField* >(pData) )
+ nFieldType = SC_SERVICE_PAGESFIELD;
+ else if ( dynamic_cast< SvxDateField* >(pData) )
+ nFieldType = SC_SERVICE_DATEFIELD;
+ else if ( dynamic_cast< SvxTimeField* >(pData) )
+ nFieldType = SC_SERVICE_TIMEFIELD;
+ else if ( dynamic_cast< SvxFileField* >(pData) )
+ nFieldType = SC_SERVICE_TITLEFIELD;
+ else if ( dynamic_cast< SvxExtFileField* >(pData) )
+ nFieldType = SC_SERVICE_FILEFIELD;
+ else if ( dynamic_cast< SvxTableField* >(pData) )
+ nFieldType = SC_SERVICE_SHEETFIELD;
}
ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Field is 1 character
@@ -956,19 +974,20 @@ sal_Int32 SAL_CALL ScHeaderFieldsObj::getCount() throw(uno::RuntimeException)
//! Feld-Funktionen muessen an den Forwarder !!!
ScEditEngineDefaulter* pEditEngine = ((ScHeaderFooterEditSource*)pEditSource)->GetEditEngine();
ScUnoEditEngine aTempEngine(pEditEngine);
+ const std::type_info* pTypeId = 0;
- TypeId aTypeId = NULL;
switch (nType)
{
- case SC_SERVICE_PAGEFIELD: aTypeId = TYPE(SvxPageField); break;
- case SC_SERVICE_PAGESFIELD: aTypeId = TYPE(SvxPagesField); break;
- case SC_SERVICE_DATEFIELD: aTypeId = TYPE(SvxDateField); break;
- case SC_SERVICE_TIMEFIELD: aTypeId = TYPE(SvxTimeField); break;
- case SC_SERVICE_TITLEFIELD: aTypeId = TYPE(SvxFileField); break;
- case SC_SERVICE_FILEFIELD: aTypeId = TYPE(SvxExtFileField); break;
- case SC_SERVICE_SHEETFIELD: aTypeId = TYPE(SvxTableField); break;
+ case SC_SERVICE_PAGEFIELD: pTypeId = &typeid(SvxPageField); break;
+ case SC_SERVICE_PAGESFIELD: pTypeId = &typeid(SvxPagesField); break;
+ case SC_SERVICE_DATEFIELD: pTypeId = &typeid(SvxDateField); break;
+ case SC_SERVICE_TIMEFIELD: pTypeId = &typeid(SvxTimeField); break;
+ case SC_SERVICE_TITLEFIELD: pTypeId = &typeid(SvxFileField); break;
+ case SC_SERVICE_FILEFIELD: pTypeId = &typeid(SvxExtFileField); break;
+ case SC_SERVICE_SHEETFIELD: pTypeId = &typeid(SvxTableField); break;
}
- return aTempEngine.CountFields(aTypeId); // Felder zaehlen
+
+ return aTempEngine.CountFields(pTypeId); // Felder zaehlen
}
uno::Any SAL_CALL ScHeaderFieldsObj::getByIndex( sal_Int32 nIndex )
@@ -1404,8 +1423,7 @@ void SAL_CALL ScHeaderFieldObj::setPropertyValue(
{
ScEditEngineDefaulter* pEditEngine = ((ScHeaderFooterEditSource*)pEditSource)->GetEditEngine();
ScUnoEditEngine aTempEngine(pEditEngine);
- SvxFieldData* pField = aTempEngine.FindByPos(
- aSelection.nStartPara, aSelection.nStartPos, TYPE(SvxExtFileField) );
+ SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, &typeid(SvxExtFileField));
DBG_ASSERT(pField,"setPropertyValue: Field not found");
if (pField)
{
@@ -1450,8 +1468,7 @@ uno::Any SAL_CALL ScHeaderFieldObj::getPropertyValue( const rtl::OUString& aProp
{
ScEditEngineDefaulter* pEditEngine = ((ScHeaderFooterEditSource*)pEditSource)->GetEditEngine();
ScUnoEditEngine aTempEngine(pEditEngine);
- SvxFieldData* pField = aTempEngine.FindByPos(
- aSelection.nStartPara, aSelection.nStartPos, TYPE(SvxExtFileField) );
+ SvxFieldData* pField = aTempEngine.FindByPos(aSelection.nStartPara, aSelection.nStartPos, &typeid(SvxExtFileField));
DBG_ASSERT(pField,"setPropertyValue: Field not found");
if (pField)
{
diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx
index fa36fdd9a5ff..1eecde1ee091 100644
--- a/sc/source/ui/unoobj/forbiuno.cxx
+++ b/sc/source/ui/unoobj/forbiuno.cxx
@@ -70,8 +70,9 @@ ScForbiddenCharsObj::~ScForbiddenCharsObj()
void ScForbiddenCharsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 3d1afc35f677..6b3f16aa9a40 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -236,8 +236,9 @@ ScFunctionAccess::~ScFunctionAccess()
void ScFunctionAccess::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) &&
- ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DEINITIALIZING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DEINITIALIZING == pSfxSimpleHint->GetId() )
{
// document must not be used anymore
aDocCache.Clear();
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index f3db10b7d95b..6e0eca41c0b1 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -106,17 +106,25 @@ void ScSheetLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! notify if links in document are changed
// UpdateRef is not needed here
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) )
+ if ( pSfxSimpleHint )
{
- if ( ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pDocShell = NULL; // pointer is invalid
}
- else if ( rHint.ISA( ScLinkRefreshedHint ) )
+ else
{
- const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint;
- if ( rLH.GetLinkType() == SC_LINKREFTYPE_SHEET && rLH.GetUrl() == aFileName )
- Refreshed_Impl();
+ const ScLinkRefreshedHint* pScLinkRefreshedHint = dynamic_cast< const ScLinkRefreshedHint* >(&rHint);
+
+ if ( pScLinkRefreshedHint )
+ {
+ if ( pScLinkRefreshedHint->GetLinkType() == SC_LINKREFTYPE_SHEET
+ && pScLinkRefreshedHint->GetUrl() == aFileName )
+ {
+ Refreshed_Impl();
+ }
+ }
}
}
@@ -129,9 +137,10 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const
for (sal_uInt16 i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScTableLink))
+ ScTableLink* pTabLink = dynamic_cast< ScTableLink* >(pBase);
+
+ if (pTabLink)
{
- ScTableLink* pTabLink = (ScTableLink*)pBase;
if ( pTabLink->GetFileName() == aFileName )
return pTabLink;
}
@@ -403,9 +412,9 @@ ScSheetLinksObj::~ScSheetLinksObj()
void ScSheetLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -604,10 +613,12 @@ ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos )
for (sal_uInt16 i=0; i<nTotalCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScAreaLink))
+ ScAreaLink* pScAreaLink = dynamic_cast< ScAreaLink* >(pBase);
+
+ if (pScAreaLink)
{
if ( nAreaCount == nPos )
- return (ScAreaLink*)pBase;
+ return pScAreaLink;
++nAreaCount;
}
}
@@ -633,21 +644,26 @@ void ScAreaLinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! notify if links in document are changed
// UpdateRef is not needed here
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) )
+ if ( pSfxSimpleHint )
{
- if ( ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pDocShell = NULL; // pointer is invalid
}
- else if ( rHint.ISA( ScLinkRefreshedHint ) )
+ else
{
- const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint;
- if ( rLH.GetLinkType() == SC_LINKREFTYPE_AREA )
+ const ScLinkRefreshedHint* pScLinkRefreshedHint = dynamic_cast< const ScLinkRefreshedHint* >(&rHint);
+
+ if ( pScLinkRefreshedHint )
{
- // get this link to compare dest position
- ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
- if ( pLink && pLink->GetDestArea().aStart == rLH.GetDestPos() )
- Refreshed_Impl();
+ if ( pScLinkRefreshedHint->GetLinkType() == SC_LINKREFTYPE_AREA )
+ {
+ // get this link to compare dest position
+ ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, nPos);
+ if ( pLink && pLink->GetDestArea().aStart == pScLinkRefreshedHint->GetDestPos() )
+ Refreshed_Impl();
+ }
}
}
}
@@ -946,9 +962,9 @@ ScAreaLinksObj::~ScAreaLinksObj()
void ScAreaLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -1024,7 +1040,7 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException)
for (sal_uInt16 i=0; i<nTotalCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
- if (pBase->ISA(ScAreaLink))
+ if (dynamic_cast< ScAreaLink* >(pBase))
++nAreaCount;
}
}
@@ -1078,20 +1094,25 @@ void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! notify if links in document are changed
// UpdateRef is not needed here
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) )
+ if ( pSfxSimpleHint )
{
- if ( ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pDocShell = NULL; // pointer is invalid
}
- else if ( rHint.ISA( ScLinkRefreshedHint ) )
+ else
{
- const ScLinkRefreshedHint& rLH = (const ScLinkRefreshedHint&) rHint;
- if ( rLH.GetLinkType() == SC_LINKREFTYPE_DDE &&
- rLH.GetDdeAppl() == aAppl &&
- rLH.GetDdeTopic() == aTopic &&
- rLH.GetDdeItem() == aItem ) //! mode is ignored
- Refreshed_Impl();
+ const ScLinkRefreshedHint* pScLinkRefreshedHint = dynamic_cast< const ScLinkRefreshedHint* >(&rHint);
+
+ if ( pScLinkRefreshedHint )
+ {
+ if ( pScLinkRefreshedHint->GetLinkType() == SC_LINKREFTYPE_DDE &&
+ pScLinkRefreshedHint->GetDdeAppl() == aAppl &&
+ pScLinkRefreshedHint->GetDdeTopic() == aTopic &&
+ pScLinkRefreshedHint->GetDdeItem() == aItem ) //! mode is ignored
+ Refreshed_Impl();
+ }
}
}
@@ -1288,9 +1309,9 @@ ScDDELinksObj::~ScDDELinksObj()
void ScDDELinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index d4fc7ca23d7b..3928af050ed0 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -102,8 +102,9 @@ ScNamedRangeObj::~ScNamedRangeObj()
void ScNamedRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Ref-Update interessiert nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pDocShell = NULL; // ungueltig geworden
}
@@ -528,9 +529,9 @@ ScNamedRangesObj::~ScNamedRangesObj()
void ScNamedRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -1005,8 +1006,9 @@ ScLabelRangeObj::~ScLabelRangeObj()
void ScLabelRangeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
//! Ref-Update !!!
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pDocShell = NULL; // ungueltig geworden
}
@@ -1125,9 +1127,9 @@ ScLabelRangesObj::~ScLabelRangesObj()
void ScLabelRangesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx
index b626df738230..e0109d0a837f 100644
--- a/sc/source/ui/unoobj/notesuno.cxx
+++ b/sc/source/ui/unoobj/notesuno.cxx
@@ -28,7 +28,7 @@
#include <svl/smplhint.hxx>
#include <editeng/unotext.hxx>
-#include <svx/svdpool.hxx>
+#include <svx/globaldrawitempool.hxx>
#include <svx/svdobj.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdocapt.hxx>
@@ -53,7 +53,7 @@ const SvxItemPropertySet* lcl_GetAnnotationPropertySet()
{
{0,0,0,0,0,0}
};
- static SvxItemPropertySet aAnnotationPropertySet_Impl( aAnnotationPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aAnnotationPropertySet_Impl( aAnnotationPropertyMap_Impl, GetGlobalDrawObjectItemPool() );
return &aAnnotationPropertySet_Impl;
}
@@ -86,16 +86,22 @@ ScAnnotationObj::~ScAnnotationObj()
void ScAnnotationObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ const ScUpdateRefHint* pScUpdateRefHint = dynamic_cast< const ScUpdateRefHint* >(&rHint);
+
+ if ( pScUpdateRefHint )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ else
{
- pDocShell = NULL; // ungueltig geworden
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
+ {
+ pDocShell = NULL; // ungueltig geworden
+ }
}
}
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 658a906c40f1..c1138122b471 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -336,7 +336,7 @@ static sal_Bool lcl_IsAnyXMLFilter( const SfxFilter* pFilter )
SfxAllItemSet *pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
TransformParameters( SID_OPENDOC, lDescriptor, *pSet );
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY);
bWasReadOnly = pItem && pItem->GetValue();
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 6a44a40e5710..06d8995be360 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -35,6 +35,7 @@
#include <svx/shapepropertynotifier.hxx>
#include <toolkit/helper/convert.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <svx/svdlegacy.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -124,7 +125,7 @@ ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& xShape ) :
SdrObject* pObj = GetSdrObject();
if ( pObj )
{
- bIsNoteCaption = ScDrawLayer::IsNoteCaption( pObj );
+ bIsNoteCaption = ScDrawLayer::IsNoteCaption( *pObj );
lcl_initializeNotifier( *pObj, *this );
bInitializedNotifier = true;
}
@@ -252,8 +253,8 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScShapeObj::getPropertySetInfo(
sal_Bool lcl_GetPageNum( SdrPage* pPage, SdrModel& rModel, SCTAB& rNum )
{
- sal_uInt16 nCount = rModel.GetPageCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ const sal_uInt32 nCount(rModel.GetPageCount());
+ for (sal_uInt32 i=0; i<nCount; i++)
if ( rModel.GetPage(i) == pPage )
{
rNum = static_cast<SCTAB>(i);
@@ -356,20 +357,20 @@ void SAL_CALL ScShapeObj::setPropertyValue(
SdrObject *pObj = GetSdrObject();
if (pObj)
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel && pPage )
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ if ( pPage )
{
- ScDocument* pDoc = pModel->GetDocument();
+ ScDocument* pDoc = rModel.GetDocument();
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
- {
- ScDocShell* pDocSh = (ScDocShell*)pObjSh;
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
+ if ( pDocSh )
+ {
SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
table::CellRangeAddress aAddress = xRangeAdd->getRangeAddress();
if (nTab == aAddress.Sheet)
@@ -477,20 +478,21 @@ void SAL_CALL ScShapeObj::setPropertyValue(
SdrObject *pObj = GetSdrObject();
if (pObj)
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel && pPage )
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ if ( pPage )
{
SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
- ScDocument* pDoc = pModel->GetDocument();
+ ScDocument* pDoc = rModel.GetDocument();
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pDocSh )
{
- ScDocShell* pDocSh = (ScDocShell*)pObjSh;
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
{
@@ -575,20 +577,21 @@ void SAL_CALL ScShapeObj::setPropertyValue(
SdrObject *pObj = GetSdrObject();
if (pObj)
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel && pPage )
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ if ( pPage )
{
SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
- ScDocument* pDoc = pModel->GetDocument();
+ ScDocument* pDoc = rModel.GetDocument();
if ( pDoc )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pDocSh )
{
- ScDocShell* pDocSh = (ScDocShell*)pObjSh;
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
{
@@ -657,20 +660,21 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
SdrObject *pObj = GetSdrObject();
if (pObj)
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel && pPage )
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ if ( pPage )
{
- ScDocument* pDoc = pModel->GetDocument();
+ ScDocument* pDoc = rModel.GetDocument();
if ( pDoc )
{
SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pDocSh )
{
- ScDocShell* pDocSh = (ScDocShell*)pObjSh;
uno::Reference< uno::XInterface > xAnchor;
if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
{
@@ -718,15 +722,15 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
SdrObject *pObj = GetSdrObject();
if (pObj)
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel && pPage )
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ if ( pPage )
{
- ScDocument* pDoc = pModel->GetDocument();
+ ScDocument* pDoc = rModel.GetDocument();
if ( pDoc )
{
SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
@@ -777,15 +781,15 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
SdrObject *pObj = GetSdrObject();
if (pObj)
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel && pPage )
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ if ( pPage )
{
- ScDocument* pDoc = pModel->GetDocument();
+ ScDocument* pDoc = rModel.GetDocument();
if ( pDoc )
{
SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
if (xShape.is())
@@ -1012,28 +1016,25 @@ uno::Reference<text::XTextRange> SAL_CALL ScShapeObj::getAnchor() throw(uno::Run
SdrObject* pObj = GetSdrObject();
if( pObj )
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel )
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ ScDocument* pDoc = rModel.GetDocument();
+
+ if ( pDoc )
{
- ScDocument* pDoc = pModel->GetDocument();
- if ( pDoc )
+ SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
+
+ if ( pDocSh )
{
- SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
+ SCTAB nTab = 0;
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
- ScDocShell* pDocSh = (ScDocShell*)pObjSh;
+ Point aPos(sdr::legacy::GetBoundRect(*pObj).TopLeft());
+ ScRange aRange(pDoc->GetRange( nTab, Rectangle( aPos, aPos ) ));
- SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
- {
- Point aPos(pObj->GetCurrentBoundRect().TopLeft());
- ScRange aRange(pDoc->GetRange( nTab, Rectangle( aPos, aPos ) ));
-
- // anchor is always the cell
-
- xRet.set(new ScCellObj( pDocSh, aRange.aStart ));
- }
+ // anchor is always the cell
+ xRet.set(new ScCellObj( pDocSh, aRange.aStart ));
}
}
}
@@ -1272,28 +1273,26 @@ uno::Reference< uno::XInterface > SAL_CALL ScShapeObj::getParent() throw (uno::R
SdrObject* pObj = GetSdrObject();
if( pObj )
{
- ScDrawLayer* pModel = (ScDrawLayer*)pObj->GetModel();
- SdrPage* pPage = pObj->GetPage();
- if ( pModel )
- {
- ScDocument* pDoc = pModel->GetDocument();
+ ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
+ ScDocument* pDoc = rModel.GetDocument();
+
if ( pDoc )
{
- SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
- if ( pObjSh && pObjSh->ISA(ScDocShell) )
- {
- ScDocShell* pDocSh = (ScDocShell*)pObjSh;
+ ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pDoc->GetDocumentShell());
+ if ( pDocSh )
+ {
SCTAB nTab = 0;
- if ( lcl_GetPageNum( pPage, *pModel, nTab ) )
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+
+ if ( lcl_GetPageNum( pPage, rModel, nTab ) )
{
- const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObj, nTab );
+ const ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( *pObj, nTab );
if( pCaptData )
return static_cast< ::cppu::OWeakObject* >( new ScCellObj( pDocSh, pCaptData->maStart ) );
}
}
}
- }
}
return 0;
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index e2cd3bce31f6..cd9a110358a6 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -566,9 +566,9 @@ ScStyleFamiliesObj::~ScStyleFamiliesObj()
void ScStyleFamiliesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -757,9 +757,9 @@ ScStyleFamilyObj::~ScStyleFamilyObj()
void ScStyleFamilyObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
@@ -1163,9 +1163,9 @@ ScStyleObj* ScStyleObj::getImplementation(
void ScStyleObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// Referenz-Update interessiert hier nicht
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pDocShell = NULL; // ungueltig geworden
}
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index 4ac6599d9381..5937ffa482ad 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -98,7 +98,9 @@ ScLinkTargetTypesObj::~ScLinkTargetTypesObj()
void ScLinkTargetTypesObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pDocShell = NULL; // document gone
}
@@ -167,7 +169,9 @@ ScLinkTargetTypeObj::~ScLinkTargetTypeObj()
void ScLinkTargetTypeObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pDocShell = NULL; // document gone
}
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 9611b3a211c3..a17622c74d13 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -39,6 +39,7 @@
#include <rtl/uuid.h>
#include <vcl/virdev.hxx>
#include <com/sun/star/awt/FontSlant.hpp>
+#include <svx/globaldrawitempool.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <editeng/unoipset.hxx>
@@ -93,7 +94,7 @@ const SvxItemPropertySet * lcl_GetHdFtPropertySet()
}
bTwipsSet = sal_True;
}
- static SvxItemPropertySet aHdFtPropertySet_Impl( aHdFtPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aHdFtPropertySet_Impl( aHdFtPropertyMap_Impl, GetGlobalDrawObjectItemPool() );
return &aHdFtPropertySet_Impl;
}
@@ -253,9 +254,11 @@ ScHeaderFooterTextData::~ScHeaderFooterTextData()
void ScHeaderFooterTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScHeaderFooterChangedHint ) )
+ const ScHeaderFooterChangedHint* pScHeaderFooterChangedHint = dynamic_cast< const ScHeaderFooterChangedHint* >(&rHint);
+
+ if ( pScHeaderFooterChangedHint )
{
- if ( ((const ScHeaderFooterChangedHint&)rHint).GetPart() == nPart )
+ if ( pScHeaderFooterChangedHint->GetPart() == nPart )
{
if (!bInUpdate) // not for own updates
bDataValid = sal_False; // text has to be fetched again
@@ -1112,13 +1115,13 @@ void ScCellTextData::UpdateData()
void ScCellTextData::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( ScUpdateRefHint ) )
+ if ( dynamic_cast< const ScUpdateRefHint* >(&rHint) )
{
// const ScUpdateRefHint& rRef = (const ScUpdateRefHint&)rHint;
//! Ref-Update
}
- else if ( rHint.ISA( SfxSimpleHint ) )
+ else if ( dynamic_cast< const SfxSimpleHint* >(&rHint) )
{
sal_uLong nId = ((const SfxSimpleHint&)rHint).GetId();
if ( nId == SFX_HINT_DYING )
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index e1727b57e022..56950a9333e0 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -86,7 +86,9 @@ ScFormulaParserObj::~ScFormulaParserObj()
void ScFormulaParserObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
mpDocShell = NULL;
}
diff --git a/sc/source/ui/unoobj/unoreflist.cxx b/sc/source/ui/unoobj/unoreflist.cxx
index 073a0f27328e..304cc07df971 100644
--- a/sc/source/ui/unoobj/unoreflist.cxx
+++ b/sc/source/ui/unoobj/unoreflist.cxx
@@ -56,8 +56,6 @@ void ScUnoRefList::Undo( ScDocument* pDoc )
//------------------------------------------------------------------------
-TYPEINIT1(ScUnoRefUndoHint, SfxHint);
-
ScUnoRefUndoHint::ScUnoRefUndoHint( const ScUnoRefEntry& rRefEntry ) :
aEntry( rRefEntry )
{
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index d3f1a7be5b42..b33e9b113c87 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -32,7 +32,6 @@
#include <editeng/outliner.hxx>
#include <svx/fmdpage.hxx>
#include <svx/svditer.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdouno.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
@@ -149,8 +148,9 @@ ScViewPaneBase::~ScViewPaneBase()
void ScViewPaneBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
pViewShell = NULL;
}
@@ -684,11 +684,10 @@ void lcl_ShowObject( ScTabViewShell& rViewSh, ScDrawView& rDrawView, SdrObject*
sal_Bool bFound = sal_False;
SCTAB nObjectTab = 0;
- SdrModel* pModel = rDrawView.GetModel();
- sal_uInt16 nPageCount = pModel->GetPageCount();
- for (sal_uInt16 i=0; i<nPageCount && !bFound; i++)
+ const sal_uInt32 nPageCount(rDrawView.getSdrModelFromSdrView().GetPageCount());
+ for (sal_uInt32 i=0; i<nPageCount && !bFound; i++)
{
- SdrPage* pPage = pModel->GetPage(i);
+ SdrPage* pPage = rDrawView.getSdrModelFromSdrView().GetPage(i);
if (pPage)
{
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
@@ -760,7 +759,6 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
if ( pViewData->GetDocShell() == pRangesImp->GetDocShell() )
{
// Zuerst evtl. Drawing-Selektion aufheben
- // (MarkListHasChanged hebt Tabellen-Selektion auf)
ScDrawView* pDrawView = pViewSh->GetScDrawView();
if (pDrawView)
@@ -827,9 +825,9 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
{
lcl_ShowObject( *pViewSh, *pDrawView, pObj );
SdrPageView* pPV = pDrawView->GetSdrPageView();
- if ( pPV && pObj->GetPage() == pPV->GetPage() )
+ if ( pPV && pObj->getSdrPageFromSdrObject() == &pPV->getSdrPageFromSdrPageView() )
{
- pDrawView->MarkObj( pObj, pPV );
+ pDrawView->MarkObj( *pObj );
bRet = sal_True;
}
}
@@ -867,10 +865,10 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& aSelection )
lcl_ShowObject( *pViewSh, *pDrawView, pObj );
pPV = pDrawView->GetSdrPageView();
}
- if ( pPV && pObj->GetPage() == pPV->GetPage() )
+ if ( pPV && pObj->getSdrPageFromSdrObject() == &pPV->getSdrPageFromSdrPageView() )
{
- if (pDrawView->IsObjMarkable( pObj, pPV ))
- pDrawView->MarkObj( pObj, pPV );
+ if (pDrawView->IsObjMarkable( *pObj ))
+ pDrawView->MarkObj( *pObj );
else
bAllMarked = sal_False;
}
@@ -908,26 +906,22 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException)
SdrView* pDrawView = pViewSh->GetSdrView();
if (pDrawView)
{
- const SdrMarkList& rMarkList = pDrawView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
- if (nMarkCount)
+ const SdrObjectVector aSelection(pDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if (aSelection.size())
{
// ShapeCollection erzeugen (wie in SdXImpressView::getSelection im Draw)
// Zurueckgegeben wird XInterfaceRef, das muss das UsrObject-XInterface sein
-
SvxShapeCollection* pShapes = new SvxShapeCollection();
uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pShapes));
- for (sal_uLong i=0; i<nMarkCount; i++)
- {
- SdrObject* pDrawObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if (pDrawObj)
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
+ SdrObject* pDrawObj = aSelection[i];
uno::Reference<drawing::XShape> xShape( pDrawObj->getUnoShape(), uno::UNO_QUERY );
if (xShape.is())
pShapes->add(xShape);
}
- }
return uno::makeAny(xRet);
}
}
@@ -1223,26 +1217,23 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP
{
SdrPage* pDrawPage = NULL;
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
- if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > nTab))
- pDrawPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
+ if (pDrawLayer->HasObjects() && (pDrawLayer->GetPageCount() > static_cast< sal_uInt32 >(nTab)))
+ pDrawPage = pDrawLayer->GetPage(static_cast< sal_uInt32 >(nTab));
SdrView* pDrawView = GetViewShell()->GetSdrView();
if (pDrawPage && pDrawView && pDrawView->GetSdrPageView())
{
Window* pActiveWin = pData->GetActiveWin();
- Point aPos = pActiveWin->PixelToLogic(rPoint);
-
- sal_uInt16 nHitLog = (sal_uInt16) pActiveWin->PixelToLogic(
- Size(pDrawView->GetHitTolerancePixel(),0)).Width();
-
+ const basegfx::B2DPoint aPos(pActiveWin->GetInverseViewTransformation() * basegfx::B2DPoint(rPoint.X(), rPoint.Y()));
+ const double fHitLog(basegfx::B2DVector(pActiveWin->GetInverseViewTransformation() * basegfx::B2DVector(pDrawView->GetHitTolerancePixel(), 0.0)).getLength());
sal_uInt32 nCount(pDrawPage->GetObjCount());
sal_Bool bFound(sal_False);
sal_uInt32 i(0);
while (i < nCount && !bFound)
{
SdrObject* pObj = pDrawPage->GetObj(i);
- if (pObj && SdrObjectPrimitiveHit(*pObj, aPos, nHitLog, *pDrawView->GetSdrPageView(), 0, false))
+ if (pObj && SdrObjectPrimitiveHit(*pObj, aPos, fHitLog, *pDrawView, false, 0))
{
xTarget.set(pObj->getUnoShape(), uno::UNO_QUERY);
bFound = sal_True;
@@ -2317,11 +2308,11 @@ ScTabViewObj* ScTabViewObj::getImplementation( const uno::Reference<uno::XInterf
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL ScTabViewObj::getTransferable( ) throw (::com::sun::star::uno::RuntimeException)
{
ScUnoGuard aGuard;
- ScEditShell* pShell = PTR_CAST( ScEditShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScEditShell* pShell = dynamic_cast< ScEditShell* >( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pShell)
return pShell->GetEditView()->GetTransferable();
- ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScDrawTextObjectBar* pTextShell = dynamic_cast< ScDrawTextObjectBar* >( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pTextShell)
{
ScViewData* pViewData = GetViewShell()->GetViewData();
@@ -2331,7 +2322,7 @@ ScTabViewObj* ScTabViewObj::getImplementation( const uno::Reference<uno::XInterf
return pOutView->GetEditView().GetTransferable();
}
- ScDrawShell* pDrawShell = PTR_CAST( ScDrawShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScDrawShell* pDrawShell = dynamic_cast< ScDrawShell* >( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pDrawShell)
return pDrawShell->GetDrawView()->CopyToTransferable();
@@ -2343,12 +2334,12 @@ ScTabViewObj* ScTabViewObj::getImplementation( const uno::Reference<uno::XInterf
void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans ) throw (::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::uno::RuntimeException)
{
ScUnoGuard aGuard;
- ScEditShell* pShell = PTR_CAST( ScEditShell, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScEditShell* pShell = dynamic_cast< ScEditShell* >( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pShell)
pShell->GetEditView()->InsertText( xTrans, ::rtl::OUString(), sal_False );
else
{
- ScDrawTextObjectBar* pTextShell = PTR_CAST( ScDrawTextObjectBar, GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
+ ScDrawTextObjectBar* pTextShell = dynamic_cast< ScDrawTextObjectBar* >( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) );
if (pTextShell)
{
ScViewData* pViewData = GetViewShell()->GetViewData();
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 2fb72ac8a3cf..7b2d9d11a8d7 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -48,8 +48,6 @@
//------------------------------------------------------------------------
-TYPEINIT1( ScAuditingShell, SfxShell );
-
SFX_IMPL_INTERFACE(ScAuditingShell, SfxShell, ScResId(SCSTR_AUDITSHELL))
{
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_AUDIT) );
@@ -113,7 +111,7 @@ void ScAuditingShell::Execute( SfxRequest& rReq )
if ( pReqArgs->GetItemState( SID_RANGE_COL, sal_True, &pXItem ) == SFX_ITEM_SET
&& pReqArgs->GetItemState( SID_RANGE_ROW, sal_True, &pYItem ) == SFX_ITEM_SET )
{
- DBG_ASSERT( pXItem->ISA(SfxInt16Item) && pYItem->ISA(SfxInt32Item),
+ DBG_ASSERT( dynamic_cast< const SfxInt16Item* >(pXItem) && dynamic_cast< const SfxInt32Item* >(pYItem),
"falsche Items" );
SCsCOL nCol = static_cast<SCsCOL>(((const SfxInt16Item*) pXItem)->GetValue());
SCsROW nRow = static_cast<SCsROW>(((const SfxInt32Item*) pYItem)->GetValue());
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index f8c544bc2003..b6af7052f34e 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -67,7 +67,7 @@
#define CellMovement
#include "scslots.hxx"
-TYPEINIT1( ScCellShell, ScFormatShell );
+#define SearchSettings
SFX_IMPL_INTERFACE(ScCellShell, ScFormatShell , ScResId(SCSTR_CELLSHELL) )
{
@@ -367,7 +367,7 @@ sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDataHe
void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats )
{
Window* pWin = GetViewData()->GetActiveWin();
- sal_Bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
+ bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pWin ) );
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 6cda112e1a3e..1e9e22b05f5b 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1189,7 +1189,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, sal_True, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast< const SfxUInt32Item* >(pItem) )
{
nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
}
@@ -1197,9 +1197,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( nFormat )
{
Window* pWin = GetViewData()->GetActiveWin();
- sal_Bool bCells = ( ScTransferObj::GetOwnClipboard( pWin ) != NULL );
- sal_Bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
- sal_Bool bOle = ( nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE );
+ bool bCells = ( ScTransferObj::GetOwnClipboard( pWin ) != NULL );
+ bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
+ bool bOle = ( nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE );
if ( bCells && bOle )
pTabViewShell->PasteFromSystem();
@@ -1261,11 +1261,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
}
- SFX_REQUEST_ARG( rReq, pFuncItem, SfxUInt16Item, FN_PARAM_1, sal_False );
- SFX_REQUEST_ARG( rReq, pSkipItem, SfxBoolItem, FN_PARAM_2, sal_False );
- SFX_REQUEST_ARG( rReq, pTransposeItem, SfxBoolItem, FN_PARAM_3, sal_False );
- SFX_REQUEST_ARG( rReq, pLinkItem, SfxBoolItem, FN_PARAM_4, sal_False );
- SFX_REQUEST_ARG( rReq, pMoveItem, SfxInt16Item, FN_PARAM_5, sal_False );
+ SFX_REQUEST_ARG( rReq, pFuncItem, SfxUInt16Item, FN_PARAM_1 );
+ SFX_REQUEST_ARG( rReq, pSkipItem, SfxBoolItem, FN_PARAM_2 );
+ SFX_REQUEST_ARG( rReq, pTransposeItem, SfxBoolItem, FN_PARAM_3 );
+ SFX_REQUEST_ARG( rReq, pLinkItem, SfxBoolItem, FN_PARAM_4 );
+ SFX_REQUEST_ARG( rReq, pMoveItem, SfxInt16Item, FN_PARAM_5 );
if ( pFuncItem )
nFunction = pFuncItem->GetValue();
if ( pSkipItem )
@@ -1390,13 +1390,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SfxPoolItem* pItem=NULL;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, sal_True, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast< const SfxUInt32Item* >(pItem) )
{
sal_uLong nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
sal_Bool bRet=sal_True;
{
WaitObject aWait( GetViewData()->GetDialogParent() );
- sal_Bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
+ bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
if ( bDraw && nFormat == SOT_FORMATSTR_ID_EMBED_SOURCE )
pTabViewShell->PasteDraw();
else
@@ -1423,7 +1423,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
else // Zeichenobjekte oder fremde Daten
{
- sal_Bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
+ bool bDraw = ( ScDrawTransferObj::GetOwnClipboard( pWin ) != NULL );
SvxClipboardFmtItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
GetPossibleClipboardFormats( aFormats );
@@ -1903,12 +1903,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), sal_False, &pItem);
if ( pItem )
{
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, pItem );
+ const SfxStringItem* pStringItem = dynamic_cast< const SfxStringItem* >( pItem );
if ( pStringItem )
aChars = pStringItem->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast< const SfxStringItem* >( pFtItem );
if ( pFontItem )
aFontName = pFontItem->GetValue();
}
@@ -1944,8 +1944,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( pDlg->Execute() == RET_OK )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT );
if ( pItem && pFontItem )
{
@@ -2035,19 +2035,19 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
String aSource;
sal_uLong nRefresh=0;
- SFX_REQUEST_ARG( rReq, pFile, SfxStringItem, SID_FILE_NAME, sal_False );
- SFX_REQUEST_ARG( rReq, pSource, SfxStringItem, FN_PARAM_1, sal_False );
+ SFX_REQUEST_ARG( rReq, pFile, SfxStringItem, SID_FILE_NAME );
+ SFX_REQUEST_ARG( rReq, pSource, SfxStringItem, FN_PARAM_1 );
if ( pFile && pSource )
{
aFile = pFile->GetValue();
aSource = pSource->GetValue();
- SFX_REQUEST_ARG( rReq, pFilter, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pFilter, SfxStringItem, SID_FILTER_NAME );
if ( pFilter )
aFilter = pFilter->GetValue();
- SFX_REQUEST_ARG( rReq, pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
+ SFX_REQUEST_ARG( rReq, pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS );
if ( pOptions )
aOptions = pOptions->GetValue();
- SFX_REQUEST_ARG( rReq, pRefresh, SfxUInt32Item, FN_PARAM_2, sal_False );
+ SFX_REQUEST_ARG( rReq, pRefresh, SfxUInt32Item, FN_PARAM_2 );
if ( pRefresh )
nRefresh = pRefresh->GetValue();
}
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 56f52d2bbdd1..888d91c9d654 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -791,7 +791,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, sal_True, &pItem) == SFX_ITEM_SET )
{
- DBG_ASSERT(pItem && pItem->ISA(SfxBoolItem), "falsches Item");
+ DBG_ASSERT(pItem && dynamic_cast< const SfxBoolItem* >(pItem), "falsches Item");
bMoveContents = ((const SfxBoolItem*)pItem)->GetValue();
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index d185268b5e57..0449cef48025 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -704,7 +704,7 @@ sal_uLong RefreshDPObject( ScDPObject *pDPObj, ScDocument *pDoc, ScDocShell *pDo
if( !pDoc )
return static_cast<sal_uLong>(-1);
- if( !pDocSh && ( pDocSh = PTR_CAST( ScDocShell, pDoc->GetDocumentShell() ) ) == NULL )
+ if( !pDocSh && ( pDocSh = dynamic_cast< ScDocShell* >( pDoc->GetDocumentShell() ) ) == NULL )
return static_cast<sal_uLong>(-1);
if( sal_uLong nErrId = pDPObj->RefreshCache() )
diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx
index b418b31d0dca..98afac80840a 100644
--- a/sc/source/ui/view/dbfunc4.cxx
+++ b/sc/source/ui/view/dbfunc4.cxx
@@ -57,8 +57,8 @@ sal_uInt16 ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sa
sal_uInt16 nFound = 0;
- sal_uInt16 nPageCount = pModel->GetPageCount();
- for (sal_uInt16 nPageNo=0; nPageNo<nPageCount; nPageNo++)
+ const sal_uInt32 nPageCount(pModel->GetPageCount());
+ for (sal_uInt32 nPageNo=0; nPageNo<nPageCount; nPageNo++)
{
SdrPage* pPage = pModel->GetPage(nPageNo);
DBG_ASSERT(pPage,"Page ?");
diff --git a/sc/source/ui/view/drawvie2.cxx b/sc/source/ui/view/drawvie2.cxx
index 417dec3939d0..aa348810ae32 100644
--- a/sc/source/ui/view/drawvie2.cxx
+++ b/sc/source/ui/view/drawvie2.cxx
@@ -35,7 +35,7 @@
// -----------------------------------------------------------------------
-// UpdateBrowser in MarkListHasChanged gerufen
+// UpdateBrowser
void ScDrawView::UpdateBrowser()
{
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index 896cf403b633..e1b07b8c398e 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -48,8 +48,8 @@ sal_uInt16 ScIMapChildWindowId();
// STATIC DATA -----------------------------------------------------------
-ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData ) :
- FmFormView( pData->GetDocument()->GetDrawLayer(), pOut ),
+ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData )
+: FmFormView( *pData->GetDocument()->GetDrawLayer(), pOut ),
pViewData( pData ),
pDev( pOut ),
pDoc( pData->GetDocument() ),
@@ -57,7 +57,6 @@ ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData ) :
pDropMarker( NULL ),
pDropMarkObj( NULL ),
bInConstruct( sal_True )
- //HMHbDisableHdl( sal_False )
{
// #i73602# Use default from the configuration
SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_Calc());
@@ -72,15 +71,13 @@ ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData ) :
void ScDrawView::SetAnchor( ScAnchorType eType )
{
- SdrObject* pObj = NULL;
- if( AreObjectsMarked() )
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if( aSelection.size() )
{
- const SdrMarkList* pMark = &GetMarkedObjectList();
- sal_uLong nCount = pMark->GetMarkCount();
- for( sal_uLong i=0; i<nCount; i++ )
+ for( sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- pObj = pMark->GetMark(i)->GetMarkedSdrObj();
- ScDrawLayer::SetAnchor( pObj, eType );
+ ScDrawLayer::SetAnchor( aSelection[i], eType );
}
if ( pViewData )
@@ -92,21 +89,20 @@ ScAnchorType ScDrawView::GetAnchor() const
{
sal_Bool bPage = sal_False;
sal_Bool bCell = sal_False;
- const SdrObject* pObj = NULL;
- if( AreObjectsMarked() )
+
+ if( areSdrObjectsSelected() )
{
- const SdrMarkList* pMark = &GetMarkedObjectList();
- sal_uLong nCount = pMark->GetMarkCount();
- Point p0;
- for( sal_uLong i=0; i<nCount; i++ )
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for( sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- pObj = pMark->GetMark(i)->GetMarkedSdrObj();
- if( ScDrawLayer::GetAnchor( pObj ) == SCA_CELL )
+ if( ScDrawLayer::GetAnchor( aSelection[i] ) == SCA_CELL )
bCell =sal_True;
else
bPage = sal_True;
}
}
+
if( bPage && !bCell )
return SCA_PAGE;
if( !bPage && bCell )
@@ -116,9 +112,11 @@ ScAnchorType ScDrawView::GetAnchor() const
void __EXPORT ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA(ScTabDeletedHint)) // Tabelle geloescht
+ const ScTabDeletedHint* pScTabDeletedHint = dynamic_cast< const ScTabDeletedHint* >(&rHint);
+
+ if (pScTabDeletedHint) // Tabelle geloescht
{
- SCTAB nDelTab = ((ScTabDeletedHint&)rHint).GetTab();
+ SCTAB nDelTab = const_cast< ScTabDeletedHint* >(pScTabDeletedHint)->GetTab();
if (ValidTab(nDelTab))
{
// used to be: HidePagePgNum(nDelTab) - hide only if the deleted sheet is shown here
@@ -126,49 +124,64 @@ void __EXPORT ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
HideSdrPage();
}
}
- else if (rHint.ISA(ScTabSizeChangedHint)) // Groesse geaendert
+ else
{
- if ( nTab == ((ScTabSizeChangedHint&)rHint).GetTab() )
+ const ScTabSizeChangedHint* pScTabSizeChangedHint = dynamic_cast< const ScTabSizeChangedHint* >(&rHint);
+
+ if (pScTabSizeChangedHint) // Groesse geaendert
+ {
+ if ( nTab == const_cast< ScTabSizeChangedHint* >(pScTabSizeChangedHint)->GetTab() )
UpdateWorkArea();
+ }
+ else
+ {
+ FmFormView::Notify( rBC,rHint );
+ }
}
- else
- FmFormView::Notify( rBC,rHint );
}
void ScDrawView::UpdateIMap( SdrObject* pObj )
{
if ( pViewData &&
pViewData->GetViewShell()->GetViewFrame()->HasChildWindow( ScIMapChildWindowId() ) &&
- pObj && ( pObj->ISA(SdrGrafObj) || pObj->ISA(SdrOle2Obj) ) )
+ pObj )
{
- Graphic aGraphic;
- TargetList aTargetList;
- ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo( pObj );
- const ImageMap* pImageMap = NULL;
- if ( pIMapInfo )
- pImageMap = &pIMapInfo->GetImageMap();
-
- // Target-Liste besorgen
- pViewData->GetViewShell()->GetViewFrame()->GetTargetList( aTargetList );
-
- // Grafik vom Objekt besorgen
- if ( pObj->ISA( SdrGrafObj ) )
- aGraphic = ( (SdrGrafObj*) pObj )->GetGraphic();
- else
- {
- Graphic* pGraphic = ((const SdrOle2Obj*) pObj )->GetGraphic();
- if ( pGraphic )
- aGraphic = *pGraphic;
- }
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pObj);
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj);
- ScIMapDlgSet( aGraphic, pImageMap, &aTargetList, pObj ); // aus imapwrap
-
- // TargetListe kann von uns wieder geloescht werden
- String* pEntry = aTargetList.First();
- while( pEntry )
+ if( pSdrGrafObj || pSdrOle2Obj )
{
- delete pEntry;
- pEntry = aTargetList.Next();
+ Graphic aGraphic;
+ TargetList aTargetList;
+ ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo( pObj );
+ const ImageMap* pImageMap = NULL;
+ if ( pIMapInfo )
+ pImageMap = &pIMapInfo->GetImageMap();
+
+ // Target-Liste besorgen
+ pViewData->GetViewShell()->GetViewFrame()->GetTargetList( aTargetList );
+
+ // Grafik vom Objekt besorgen
+ if ( pSdrGrafObj )
+ {
+ aGraphic = pSdrGrafObj->GetGraphic();
+ }
+ else
+ {
+ Graphic* pGraphic = pSdrOle2Obj->GetGraphic();
+ if ( pGraphic )
+ aGraphic = *pGraphic;
+ }
+
+ ScIMapDlgSet( aGraphic, pImageMap, &aTargetList, pObj ); // aus imapwrap
+
+ // TargetListe kann von uns wieder geloescht werden
+ String* pEntry = aTargetList.First();
+ while( pEntry )
+ {
+ delete pEntry;
+ pEntry = aTargetList.Next();
+ }
}
}
}
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 9fc221c8e2b2..94c460895fb7 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -37,6 +37,7 @@
#include <sfx2/docfile.hxx>
#include <tools/urlobj.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <svx/svdlegacy.hxx>
#include "drawview.hxx"
#include "global.hxx"
@@ -55,7 +56,7 @@ using namespace com::sun::star;
// STATIC DATA -----------------------------------------------------------
-Point aDragStartDiff;
+basegfx::B2DPoint aDragStartDiff;
// -----------------------------------------------------------------------
@@ -67,25 +68,26 @@ Point aDragStartDiff;
// -----------------------------------------------------------------------
-void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle )
+void lcl_CheckOle( const SdrObjectVector& rSelection, sal_Bool& rAnyOle, sal_Bool& rOneOle )
{
rAnyOle = rOneOle = sal_False;
- sal_uLong nCount = rMarkList.GetMarkCount();
- for (sal_uLong i=0; i<nCount; i++)
+
+ for (sal_uInt32 i(0); i < rSelection.size(); i++)
{
- SdrMark* pMark = rMarkList.GetMark(i);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
+ const SdrObject* pObj = rSelection[i];
+ const sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
+
if (nSdrObjKind == OBJ_OLE2)
{
rAnyOle = sal_True;
- rOneOle = (nCount == 1);
+ rOneOle = (1 == rSelection.size());
break;
}
- else if ( pObj->ISA(SdrObjGroup) )
+ else if ( dynamic_cast< const SdrObjGroup* >(pObj) )
{
SdrObjListIter aIter( *pObj, IM_DEEPNOGROUPS );
SdrObject* pSubObj = aIter.Next();
+
while (pSubObj)
{
if ( pSubObj->GetObjIdentifier() == OBJ_OLE2 )
@@ -94,6 +96,7 @@ void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rO
// rOneOle remains sal_False - a group isn't treated like a single OLE object
return;
}
+
pSubObj = aIter.Next();
}
}
@@ -103,7 +106,7 @@ void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rO
#if 0
void lcl_RefreshChartData( SdrModel* pModel, ScDocument* pSourceDoc )
{
- sal_uInt16 nPages = pModel->GetPageCount();
+ const sal_uInt32 nPages(pModel->GetPageCount());
for (SCTAB nTab=0; nTab<nPages; nTab++)
{
SdrPage* pPage = pModel->GetPage(nTab);
@@ -138,22 +141,21 @@ void lcl_RefreshChartData( SdrModel* pModel, ScDocument* pSourceDoc )
#endif
-sal_Bool ScDrawView::BeginDrag( Window* pWindow, const Point& rStartPos )
+sal_Bool ScDrawView::BeginDrag( Window* pWindow, const basegfx::B2DPoint& rStartPos )
{
sal_Bool bReturn = sal_False;
- if ( AreObjectsMarked() )
+ if ( areSdrObjectsSelected() )
{
BrkAction();
- Rectangle aMarkedRect = GetAllMarkedRect();
- Region aRegion( aMarkedRect );
+ const basegfx::B2DRange aMarkedRange(getMarkedObjectSnapRange());
- aDragStartDiff = rStartPos - aMarkedRect.TopLeft();
+ aDragStartDiff = rStartPos - aMarkedRange.getMinimum();
sal_Bool bAnyOle, bOneOle;
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- lcl_CheckOle( rMarkList, bAnyOle, bOneOle );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ lcl_CheckOle( aSelection, bAnyOle, bOneOle );
ScDocShellRef aDragShellRef;
if (bAnyOle)
@@ -194,8 +196,8 @@ sal_Bool ScDrawView::BeginDrag( Window* pWindow, const Point& rStartPos )
void ScDrawView::DoCopy()
{
sal_Bool bAnyOle, bOneOle;
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- lcl_CheckOle( rMarkList, bAnyOle, bOneOle );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ lcl_CheckOle( aSelection, bAnyOle, bOneOle );
// update ScGlobal::pDrawClipDocShellRef
ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) );
@@ -230,8 +232,8 @@ void ScDrawView::DoCopy()
uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable()
{
sal_Bool bAnyOle, bOneOle;
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- lcl_CheckOle( rMarkList, bAnyOle, bOneOle );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ lcl_CheckOle( aSelection, bAnyOle, bOneOle );
// update ScGlobal::pDrawClipDocShellRef
ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) );
@@ -288,38 +290,37 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const
void ScDrawView::SetMarkedOriginalSize()
{
- SdrUndoGroup* pUndoGroup = new SdrUndoGroup(*GetModel());
-
- const SdrMarkList& rMarkList = GetMarkedObjectList();
+ SdrUndoGroup* pUndoGroup = new SdrUndoGroup(getSdrModelFromSdrView());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
long nDone = 0;
- sal_uLong nCount = rMarkList.GetMarkCount();
- for (sal_uLong i=0; i<nCount; i++)
+
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- sal_uInt16 nIdent = pObj->GetObjIdentifier();
+ SdrObject* pObj = aSelection[i];
sal_Bool bDo = sal_False;
Size aOriginalSize;
- if (nIdent == OBJ_OLE2)
+
+ if(SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj))
{
// TODO/LEAN: working with visual area can switch object to running state
- uno::Reference < embed::XEmbeddedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObject > xObj( pSdrOle2Obj->GetObjRef(), uno::UNO_QUERY );
if ( xObj.is() ) // #121612# NULL for an invalid object that couldn't be loaded
{
- sal_Int64 nAspect = ((SdrOle2Obj*)pObj)->GetAspect();
+ sal_Int64 nAspect = pSdrOle2Obj->GetAspect();
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
MapMode aMapMode( MAP_100TH_MM );
- aOriginalSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize( &aMapMode );
+ aOriginalSize = pSdrOle2Obj->GetOrigObjSize( &aMapMode );
bDo = sal_True;
}
else
{
- MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( ((SdrOle2Obj*)pObj)->GetAspect() ) );
+ MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( pSdrOle2Obj->GetAspect() ) );
awt::Size aSz;
try
{
- aSz = xObj->getVisualAreaSize( ((SdrOle2Obj*)pObj)->GetAspect() );
+ aSz = xObj->getVisualAreaSize( pSdrOle2Obj->GetAspect() );
aOriginalSize = OutputDevice::LogicToLogic(
Size( aSz.Width, aSz.Height ),
aUnit, MAP_100TH_MM );
@@ -331,9 +332,9 @@ void ScDrawView::SetMarkedOriginalSize()
}
}
}
- else if (nIdent == OBJ_GRAF)
+ else if (SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pObj))
{
- const Graphic& rGraphic = ((SdrGrafObj*)pObj)->GetGraphic();
+ const Graphic& rGraphic = pSdrGrafObj->GetGraphic();
MapMode aSourceMap = rGraphic.GetPrefMapMode();
MapMode aDestMap( MAP_100TH_MM );
@@ -360,10 +361,11 @@ void ScDrawView::SetMarkedOriginalSize()
if ( bDo )
{
- Rectangle aDrawRect = pObj->GetLogicRect();
+ const Rectangle aDrawRect(sdr::legacy::GetLogicRect(*pObj));
pUndoGroup->AddAction( new SdrUndoGeoObj( *pObj ) );
- pObj->Resize( aDrawRect.TopLeft(), Fraction( aOriginalSize.Width(), aDrawRect.GetWidth() ),
+ sdr::legacy::ResizeSdrObject(*pObj, aDrawRect.TopLeft(),
+ Fraction( aOriginalSize.Width(), aDrawRect.GetWidth() ),
Fraction( aOriginalSize.Height(), aDrawRect.GetHeight() ) );
++nDone;
}
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 851447e946d3..93a360a93750 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -42,6 +42,7 @@
#include <svx/sdrpaintwindow.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx>
+#include <svx/svdlegacy.hxx>
#include <svx/sdrundomanager.hxx>
#include "drawview.hxx"
@@ -84,8 +85,8 @@ void ScDrawView::Construct()
EnableExtendedMouseEventDispatcher(sal_False);
EnableExtendedCommandEventDispatcher(sal_False);
- SetFrameDragSingles(sal_True);
-// SetSolidMarkHdl(sal_True); // einstellbar -> UpdateUserViewOptions
+ SetFrameHandles(true);
+// SetSolidMarkHdl(true); // einstellbar -> UpdateUserViewOptions
SetMinMoveDistancePixel( 2 );
SetHitTolerancePixel( 2 );
@@ -93,14 +94,14 @@ void ScDrawView::Construct()
if (pViewData)
{
SCTAB nViewTab = pViewData->GetTabNo();
- ShowSdrPage(GetModel()->GetPage(nViewTab));
+ ShowSdrPage(*getSdrModelFromSdrView().GetPage(nViewTab));
sal_Bool bEx = pViewData->GetViewShell()->IsDrawSelMode();
sal_Bool bProt = pDoc->IsTabProtected( nViewTab ) ||
pViewData->GetSfxDocShell()->IsReadOnly();
SdrLayer* pLayer;
- SdrLayerAdmin& rAdmin = GetModel()->GetLayerAdmin();
+ SdrLayerAdmin& rAdmin = getSdrModelFromSdrView().GetModelLayerAdmin();
pLayer = rAdmin.GetLayerPerID(SC_LAYER_BACK);
if (pLayer)
SetLayerLocked( pLayer->GetName(), bProt || !bEx );
@@ -123,11 +124,11 @@ void ScDrawView::Construct()
SetLayerVisible( pLayer->GetName(), sal_False);
}
- SetSwapAsynchron(sal_True);
+ SetSwapAsynchron(true);
}
else
{
- ShowSdrPage(GetModel()->GetPage(nTab));
+ ShowSdrPage(*getSdrModelFromSdrView().GetPage(nTab));
}
UpdateUserViewOptions();
@@ -154,17 +155,17 @@ __EXPORT ScDrawView::~ScDrawView()
void ScDrawView::AddCustomHdl()
{
sal_Bool bNegativePage = pDoc->IsNegativePage( nTab );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- const SdrMarkList &rMrkList = GetMarkedObjectList();
- sal_uInt32 nCount = rMrkList.GetMarkCount();
- for(sal_uInt32 nPos=0; nPos<nCount; nPos++ )
+ for(sal_uInt32 nPos(0); nPos < aSelection.size(); nPos++ )
{
- const SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj();
+ const SdrObject* pObj = aSelection[nPos];
+
if(ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
{
const sal_Int32 nDelta = 1;
- Rectangle aBoundRect = pObj->GetCurrentBoundRect();
+ Rectangle aBoundRect = sdr::legacy::GetBoundRect(*pObj);
Point aPos;
if (bNegativePage)
{
@@ -192,7 +193,7 @@ void ScDrawView::AddCustomHdl()
ScTabView* pView = pViewData->GetView();
ScAddress aScAddress(nCol, nRow, nTab);
- pView->CreateAnchorHandles(aHdl, aScAddress);
+ pView->CreateAnchorHandles(maViewHandleList, aScAddress);
}
}
}
@@ -261,18 +262,19 @@ void ScDrawView::InvalidateDrawTextAttrs()
void ScDrawView::SetMarkedToLayer( sal_uInt8 nLayerNo )
{
- if (AreObjectsMarked())
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if (aSelection.size())
{
// #i11702# use SdrUndoObjectLayerChange for undo
// STR_UNDO_SELATTR is "Attributes" - should use a different text later
BegUndo( ScGlobal::GetRscString( STR_UNDO_SELATTR ) );
- const SdrMarkList& rMark = GetMarkedObjectList();
- sal_uLong nCount = rMark.GetMarkCount();
- for (sal_uLong i=0; i<nCount; i++)
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
- if ( !pObj->ISA(SdrUnoObj) && (pObj->GetLayer() != SC_LAYER_INTERN) )
+ SdrObject* pObj = aSelection[i];
+
+ if ( !dynamic_cast< SdrUnoObj* >(pObj) && (pObj->GetLayer() != SC_LAYER_INTERN) )
{
AddUndo( new SdrUndoObjectLayerChange( *pObj, pObj->GetLayer(), (SdrLayerID)nLayerNo) );
pObj->SetLayer( nLayerNo );
@@ -284,46 +286,63 @@ void ScDrawView::SetMarkedToLayer( sal_uInt8 nLayerNo )
// repaint is done in SetLayer
pViewData->GetDocShell()->SetDrawModified();
-
- // #84073# check mark list now instead of later in a timer
- CheckMarked();
- MarkListHasChanged();
}
}
bool ScDrawView::HasMarkedControl() const
{
- SdrObjListIter aIter( GetMarkedObjectList() );
- for( SdrObject* pObj = aIter.Next(); pObj; pObj = aIter.Next() )
- if( pObj->ISA( SdrUnoObj ) )
- return true;
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
+ {
+ SdrObjListIter aIter( *aSelection[a] );
+
+ for( SdrObject* pObj = aIter.Next(); pObj; pObj = aIter.Next() )
+ {
+ if( dynamic_cast< SdrUnoObj* >(pObj) )
+ {
+ return true;
+ }
+ }
+ }
+ }
+
return false;
}
bool ScDrawView::HasMarkedInternal() const
{
// internal objects should not be inside a group, but who knows...
- SdrObjListIter aIter( GetMarkedObjectList() );
- for( SdrObject* pObj = aIter.Next(); pObj; pObj = aIter.Next() )
- if( pObj->GetLayer() == SC_LAYER_INTERN )
- return true;
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
+ {
+ SdrObjListIter aIter( *aSelection[a] );
+
+ for( SdrObject* pObj = aIter.Next(); pObj; pObj = aIter.Next() )
+ {
+ if( pObj->GetLayer() == SC_LAYER_INTERN )
+ {
+ return true;
+ }
+ }
+ }
+ }
+
return false;
}
void ScDrawView::UpdateWorkArea()
{
- SdrPage* pPage = GetModel()->GetPage(static_cast<sal_uInt16>(nTab));
+ SdrPage* pPage = getSdrModelFromSdrView().GetPage(static_cast< sal_uInt32 >(nTab));
if (pPage)
{
- Point aPos;
- Size aPageSize( pPage->GetSize() );
- Rectangle aNewArea( aPos, aPageSize );
- if ( aPageSize.Width() < 0 )
- {
- // RTL: from max.negative (left) to zero (right)
- aNewArea.Right() = 0;
- aNewArea.Left() = aPageSize.Width() + 1;
- }
+ const basegfx::B2DRange aNewArea(basegfx::B2DPoint(0.0, 0.0), pPage->GetPageScale());
+
SetWorkArea( aNewArea );
}
else
@@ -387,16 +406,18 @@ void ScDrawView::DoConnect(SdrOle2Obj* pOleObj)
pViewData->GetViewShell()->ConnectObject( pOleObj );
}
-void ScDrawView::MarkListHasChanged()
+void ScDrawView::handleSelectionChange()
{
- FmFormView::MarkListHasChanged();
+ // call parent
+ FmFormView::handleSelectionChange();
+ // local reactions
UpdateBrowser();
ScTabViewShell* pViewSh = pViewData->GetViewShell();
// #i110829# remove the cell selection only if drawing objects are selected
- if ( !bInConstruct && GetMarkedObjectList().GetMarkCount() )
+ if ( !bInConstruct && areSdrObjectsSelected() )
{
pViewSh->Unmark(); // remove cell selection
@@ -413,10 +434,7 @@ void ScDrawView::MarkListHasChanged()
if ( pClient && pClient->IsObjectInPlaceActive() && !bUnoRefDialog )
{
// #41730# beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen
- //HMHbDisableHdl = sal_True;
pClient->DeactivateObject();
- //HMHbDisableHdl = sal_False;
- // Image-Ole wieder durch Grafik ersetzen passiert jetzt in ScClient::UIActivate
}
// Ole-Objekt selektiert?
@@ -425,10 +443,9 @@ void ScDrawView::MarkListHasChanged()
SdrGrafObj* pGrafObj = NULL;
SdrMediaObj* pMediaObj = NULL;
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- if ( nMarkCount == 0 && !pViewData->GetViewShell()->IsDrawSelMode() && !bInConstruct )
+ if ( !aSelection.size() == 0 && !pViewData->GetViewShell()->IsDrawSelMode() && !bInConstruct )
{
// relock layers that may have been unlocked before
LockBackgroundLayer();
@@ -436,9 +453,10 @@ void ScDrawView::MarkListHasChanged()
}
sal_Bool bSubShellSet = sal_False;
- if (nMarkCount == 1)
+ if (1 == aSelection.size())
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[0];
+
if (pObj->GetObjIdentifier() == OBJ_OLE2)
{
pOle2Obj = (SdrOle2Obj*) pObj;
@@ -467,29 +485,33 @@ void ScDrawView::MarkListHasChanged()
}
}
- if ( nMarkCount && !bSubShellSet )
+ if ( aSelection.size() && !bSubShellSet )
{
sal_Bool bOnlyControls = sal_True;
sal_Bool bOnlyGraf = sal_True;
- for (sal_uLong i=0; i<nMarkCount; i++)
+
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if ( pObj->ISA( SdrObjGroup ) )
+ SdrObject* pObj = aSelection[i];
+
+ if ( dynamic_cast< SdrObjGroup* >(pObj) )
{
- const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
- sal_uLong nListCount = pLst->GetObjCount();
- if ( nListCount == 0 )
+ const SdrObjList* pLst = pObj->getChildrenOfSdrObject();
+ sal_uInt32 nListCount(pLst ? pLst->GetObjCount() : 0);
+
+ if ( !nListCount )
{
// #104156# An empty group (may occur during Undo) is no control or graphics object.
// Creating the form shell during undo would lead to problems with the undo manager.
bOnlyControls = sal_False;
bOnlyGraf = sal_False;
}
- for ( sal_uInt16 j = 0; j < nListCount; ++j )
+
+ for ( sal_uInt32 j(0); j < nListCount; ++j )
{
SdrObject *pSubObj = pLst->GetObj( j );
- if (!pSubObj->ISA(SdrUnoObj))
+ if (!dynamic_cast< SdrUnoObj* >(pSubObj))
bOnlyControls = sal_False;
if (pSubObj->GetObjIdentifier() != OBJ_GRAF)
bOnlyGraf = sal_False;
@@ -499,7 +521,7 @@ void ScDrawView::MarkListHasChanged()
}
else
{
- if (!pObj->ISA(SdrUnoObj))
+ if (!dynamic_cast< SdrUnoObj* >(pObj))
bOnlyControls = sal_False;
if (pObj->GetObjIdentifier() != OBJ_GRAF)
bOnlyGraf = sal_False;
@@ -516,7 +538,7 @@ void ScDrawView::MarkListHasChanged()
{
pViewSh->SetGraphicShell(sal_True);
}
- else if(nMarkCount>1)
+ else if(aSelection.size() > 1)
{
pViewSh->SetDrawShell(sal_True);
}
@@ -580,18 +602,18 @@ void ScDrawView::MarkListHasChanged()
}
-void __EXPORT ScDrawView::ModelHasChanged()
+void __EXPORT ScDrawView::LazyReactOnObjectChanges()
{
SdrObject* pEditObj = GetTextEditObject();
- if ( pEditObj && !pEditObj->IsInserted() && pViewData )
+ if ( pEditObj && !pEditObj->IsObjectInserted() && pViewData )
{
- // #111700# SdrObjEditView::ModelHasChanged will end text edit in this case,
+ // #111700# SdrObjEditView::LazyReactOnObjectChanges will end text edit in this case,
// so make sure the EditEngine's undo manager is no longer used.
pViewData->GetViewShell()->SetDrawTextUndo(NULL);
- SetCreateMode(); // don't leave FuText in a funny state
+ SetViewEditMode(SDREDITMODE_CREATE); // don't leave FuText in a funny state
}
- FmFormView::ModelHasChanged();
+ FmFormView::LazyReactOnObjectChanges();
}
void __EXPORT ScDrawView::UpdateUserViewOptions()
@@ -614,9 +636,9 @@ void __EXPORT ScDrawView::UpdateUserViewOptions()
// Snap from grid options is no longer used
// SetSnapGrid( Size( rGrid.GetFldSnapX(), rGrid.GetFldSnapY() ) );
- Fraction aFractX( rGrid.GetFldDrawX(), rGrid.GetFldDivisionX() + 1 );
- Fraction aFractY( rGrid.GetFldDrawY(), rGrid.GetFldDivisionY() + 1 );
- SetSnapGridWidth( aFractX, aFractY );
+ SetSnapGridWidth(
+ (double)rGrid.GetFldDrawX() / (rGrid.GetFldDivisionX() + 1.0),
+ (double)rGrid.GetFldDrawY() / (rGrid.GetFldDivisionY() + 1.0));
SetGridCoarse( Size( rGrid.GetFldDrawX(), rGrid.GetFldDrawY() ) );
SetGridFine( Size( rGrid.GetFldDrawX() / (rGrid.GetFldDivisionX() + 1),
@@ -638,11 +660,10 @@ sal_Bool ScDrawView::SelectObject( const String& rName )
SfxObjectShell* pShell = pDoc->GetDocumentShell();
if (pShell)
{
- SdrModel* pDrawLayer = GetModel();
SCTAB nTabCount = pDoc->GetTableCount();
for (SCTAB i=0; i<nTabCount && !pFound; i++)
{
- SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(i));
+ SdrPage* pPage = getSdrModelFromSdrView().GetPage(static_cast<sal_uInt16>(i));
DBG_ASSERT(pPage,"Page ?");
if (pPage)
{
@@ -672,8 +693,7 @@ sal_Bool ScDrawView::SelectObject( const String& rName )
pView->ScrollToObject( pFound );
/* #61585# To select an object on the background layer, the layer has to
- be unlocked even if exclusive drawing selection mode is not active
- (this is reversed in MarkListHasChanged when nothing is selected) */
+ be unlocked even if exclusive drawing selection mode is not active */
if ( pFound->GetLayer() == SC_LAYER_BACK &&
!pViewData->GetViewShell()->IsDrawSelMode() &&
!pDoc->IsTabProtected( nTab ) &&
@@ -682,31 +702,13 @@ sal_Bool ScDrawView::SelectObject( const String& rName )
UnlockBackgroundLayer();
}
- SdrPageView* pPV = GetSdrPageView();
- MarkObj( pFound, pPV );
+ MarkObj( *pFound );
}
return ( pFound != NULL );
}
-//UNUSED2008-05 String ScDrawView::GetSelectedChartName() const
-//UNUSED2008-05 {
-//UNUSED2008-05 // used for modifying a chart's data area - PersistName must always be used
-//UNUSED2008-05 // (as in ScDocument::FindChartData and UpdateChartArea)
-//UNUSED2008-05
-//UNUSED2008-05 const SdrMarkList& rMarkList = GetMarkedObjectList();
-//UNUSED2008-05 if (rMarkList.GetMarkCount() == 1)
-//UNUSED2008-05 {
-//UNUSED2008-05 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-//UNUSED2008-05 if (pObj->GetObjIdentifier() == OBJ_OLE2)
-//UNUSED2008-05 if ( pDoc->IsChart(pObj) )
-//UNUSED2008-05 return static_cast<SdrOle2Obj*>(pObj)->GetPersistName();
-//UNUSED2008-05 }
-//UNUSED2008-05
-//UNUSED2008-05 return EMPTY_STRING; // nichts gefunden
-//UNUSED2008-05 }
-
-FASTBOOL ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions)
+bool ScDrawView::InsertObjectSafe(SdrObject& rObj, sal_uLong nOptions)
{
// Markierung nicht aendern, wenn Ole-Objekt aktiv
// (bei Drop aus Ole-Objekt wuerde sonst mitten im ExecuteDrag deaktiviert!)
@@ -718,38 +720,41 @@ FASTBOOL ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLo
nOptions |= SDRINSERT_DONTMARK;
}
- return InsertObjectAtView( pObj, rPV, nOptions );
+ return InsertObjectAtView( rObj, nOptions );
}
SdrObject* ScDrawView::GetMarkedNoteCaption( ScDrawObjData** ppCaptData )
{
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- if( pViewData && (rMarkList.GetMarkCount() == 1) )
+ SdrObject* pSelected = getSelectedIfSingle();
+
+ if( pViewData && pSelected )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( pObj, pViewData->GetTabNo() ) )
+ if( ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( *pSelected, pViewData->GetTabNo() ) )
{
if( ppCaptData ) *ppCaptData = pCaptData;
- return pObj;
+ return pSelected;
}
}
+
return 0;
}
void ScDrawView::LockCalcLayer( SdrLayerID nLayer, bool bLock )
{
- SdrLayer* pLockLayer = GetModel()->GetLayerAdmin().GetLayerPerID( nLayer );
+ SdrLayer* pLockLayer = getSdrModelFromSdrView().GetModelLayerAdmin().GetLayerPerID( nLayer );
if( pLockLayer && (IsLayerLocked( pLockLayer->GetName() ) != bLock) )
SetLayerLocked( pLockLayer->GetName(), bLock );
}
-void __EXPORT ScDrawView::MakeVisible( const Rectangle& rRect, Window& rWin )
+void __EXPORT ScDrawView::MakeVisibleAtView( const basegfx::B2DRange& rRange, Window& rWin )
{
//! rWin richtig auswerten
//! ggf Zoom aendern
if ( pViewData && pViewData->GetActiveWin() == &rWin )
- pViewData->GetView()->MakeVisible( rRect );
+ {
+ pViewData->GetView()->MakeVisibleAtView( rRange );
+ }
}
void ScDrawView::DeleteMarked()
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 65e973aecc5e..2881434d415d 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -95,8 +95,6 @@
using namespace ::com::sun::star;
-TYPEINIT1( ScEditShell, SfxShell );
-
SFX_IMPL_INTERFACE(ScEditShell, SfxShell, ScResId(SCSTR_EDITSHELL))
{
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_EDIT) );
@@ -221,7 +219,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_THES:
{
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES , sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -264,7 +262,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, sal_True, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast< const SfxUInt32Item* >(pItem) )
{
nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
}
@@ -358,7 +356,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
aString = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast< const SfxStringItem* >( pFtItem );
if ( pFontItem )
{
String aFontName(pFontItem->GetValue());
@@ -728,9 +726,7 @@ const SvxURLField* ScEditShell::GetURLField()
const SvxFieldItem* pFieldItem = pActiveView->GetFieldAtSelection();
if (pFieldItem)
{
- const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField && pField->ISA(SvxURLField) )
- return (const SvxURLField*)pField;
+ return dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
}
}
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 2c68c31d9c4f..32bdbae48c32 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -136,8 +136,6 @@ SvxCellVerJustify lclConvertSlotToVAlign( sal_uInt16 nSlot )
} // namespace
-TYPEINIT1( ScFormatShell, SfxShell );
-
SFX_IMPL_INTERFACE(ScFormatShell, SfxShell, ScResId(SCSTR_FORMATSHELL) )
{
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD |
@@ -351,8 +349,8 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
case SID_STYLE_APPLY:
{
- SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE, sal_False );
- SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE );
+ SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME );
if ( pFamilyItem && pNameItem )
{
com::sun::star::uno::Reference< com::sun::star::style::XStyleFamiliesSupplier > xModel(pDocSh->GetModel(), com::sun::star::uno::UNO_QUERY);
@@ -397,7 +395,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( SFX_ITEM_SET ==
pArgs->GetItemState( nSlotId, sal_True, &pItem ) )
{
- const SfxStringItem* pStrItem = PTR_CAST(SfxStringItem,pItem);
+ const SfxStringItem* pStrItem = dynamic_cast< const SfxStringItem* >( pItem);
if ( pStrItem )
{
aStyleName = pStrItem->GetValue();
@@ -1220,19 +1218,23 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
{
const SfxPoolItem& rUnderline = pSet->Get( ATTR_FONT_UNDERLINE );
- if( rUnderline.ISA(SvxUnderlineItem) )
+ if( dynamic_cast< const SvxUnderlineItem* >(&rUnderline) )
{
pTabViewShell->ApplyAttr( rUnderline );
pNewSet->Put( rUnderline,rUnderline.Which() );
}
- else if ( rUnderline.ISA(SvxTextLineItem) )
+ else
{
- // #i106580# also allow SvxTextLineItem (base class of SvxUnderlineItem)
- const SvxTextLineItem& rTextLineItem = static_cast<const SvxTextLineItem&>(rUnderline);
- SvxUnderlineItem aNewItem( rTextLineItem.GetLineStyle(), rTextLineItem.Which() );
- aNewItem.SetColor( rTextLineItem.GetColor() );
- pTabViewShell->ApplyAttr( aNewItem );
- pNewSet->Put( aNewItem, aNewItem.Which() );
+ const SvxTextLineItem* pSvxTextLineItem = dynamic_cast< const SvxTextLineItem* >(&rUnderline);
+
+ if ( pSvxTextLineItem )
+ {
+ // #i106580# also allow SvxTextLineItem (base class of SvxUnderlineItem)
+ SvxUnderlineItem aNewItem( pSvxTextLineItem->GetLineStyle(), pSvxTextLineItem->Which() );
+ aNewItem.SetColor( pSvxTextLineItem->GetColor() );
+ pTabViewShell->ApplyAttr( aNewItem );
+ pNewSet->Put( aNewItem, aNewItem.Which() );
+ }
}
}
else
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index aa795c8e40db..d084a19a2207 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -55,6 +55,7 @@
#include <svx/svditer.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svdpagv.hxx>
+#include <svx/svdlegacy.hxx>
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
@@ -346,7 +347,7 @@ sal_Bool lcl_IsEditableMatrix( ScDocument* pDoc, const ScRange& rRange )
}
-void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, const Point& rPos, ScViewData* pViewData )
+void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, const basegfx::B2DPoint& rPos, ScViewData* pViewData )
{
if (!pView && !pPV && !pDrDoc && !pViewData)
return;
@@ -355,12 +356,13 @@ void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, c
ScAddress aCellPos( pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() );
ScPostIt* pNote = rDoc.GetNote( aCellPos );
SdrObject* pObj = pNote ? pNote->GetCaption() : 0;
- if( pObj && pObj->GetLogicRect().IsInside( rPos ) && ScDrawLayer::IsNoteCaption( pObj ) )
+ if( pObj && sdr::legacy::GetLogicRange(*pObj).isInside( rPos ) && ScDrawLayer::IsNoteCaption( *pObj ) )
{
const ScProtectionAttr* pProtAttr = static_cast< const ScProtectionAttr* > (rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_PROTECTION ) );
bool bProtectAttr = pProtAttr->GetProtection() || pProtAttr->GetHideCell() ;
bool bProtectDoc = rDoc.IsTabProtected( aCellPos.Tab() ) || pViewData->GetSfxDocShell()->IsReadOnly() ;
- // unlock internal layer (if not protected), will be relocked in ScDrawView::MarkListHasChanged()
+
+ // unlock internal layer (if not protected)
pView->LockInternalLayer( bProtectDoc && bProtectAttr );
}
}
@@ -378,11 +380,10 @@ sal_Bool lcl_GetHyperlinkCell(ScDocument* pDoc, SCCOL& rPosX, SCROW& rPosY, SCTA
else
--rPosX; // weitersuchen
}
- else if ( rpCell->GetCellType() == CELLTYPE_EDIT)
- bFound = sal_True;
- else if (rpCell->GetCellType() == CELLTYPE_FORMULA &&
- static_cast<ScFormulaCell*>(rpCell)->IsHyperLinkCell())
- bFound = sal_True;
+ else if ( rpCell->GetCellType() == CELLTYPE_EDIT)
+ bFound = sal_True;
+ else if (rpCell->GetCellType() == CELLTYPE_FORMULA && static_cast<ScFormulaCell*>(rpCell)->IsHyperLinkCell())
+ bFound = sal_True;
else
return sal_False; // andere Zelle
}
@@ -1515,8 +1516,6 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt )
sal_Bool bEditMode = pViewData->HasEditView(eWhich); // auch bei Mode==SC_INPUT_TYPE
sal_Bool bDouble = (rMEvt.GetClicks() == 2);
- // DeactivateIP passiert nur noch bei MarkListHasChanged
-
// im GrabFocus Aufruf kann eine Fehlermeldung hochkommen
// (z.B. beim Umbenennen von Tabellen per Tab-Reiter)
@@ -2876,10 +2875,13 @@ void __EXPORT ScGridWindow::Command( const CommandEvent& rCEvt )
// Is a draw object selected?
SdrView* pDrawView = pViewSh->GetSdrView();
- if (pDrawView && pDrawView->AreObjectsMarked())
+ if (pDrawView && pDrawView->areSdrObjectsSelected())
{
// #100442#; the conext menu should open in the middle of the selected objects
- Rectangle aSelectRect(LogicToPixel(pDrawView->GetAllMarkedBoundRect()));
+ const Rectangle aSelectRect(
+ LogicToPixel(
+ sdr::legacy::GetAllObjBoundRect(
+ pDrawView->getSelectedSdrObjectVectorFromSdrMarkView())));
aMenuPos = aSelectRect.Center();
}
}
@@ -2957,33 +2959,38 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX,
}
// check draw text edit mode
+ const basegfx::B2DPoint aPixelPos(rPosPixel.X(), rPosPixel.Y());
+ const basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos); // after cell edit mode is ended
- Point aLogicPos = PixelToLogic( rPosPixel ); // after cell edit mode is ended
if ( pDrawView && pDrawView->GetTextEditObject() && pDrawView->GetTextEditOutlinerView() )
{
OutlinerView* pOlView = pDrawView->GetTextEditOutlinerView();
- Rectangle aOutputArea = pOlView->GetOutputArea();
- if ( aOutputArea.IsInside( aLogicPos ) )
+ Rectangle aOldArea(pOlView->GetOutputArea());
+ const basegfx::B2DRange aOutputArea(aOldArea.Left(), aOldArea.Top(), aOldArea.Right(), aOldArea.Bottom());
+
+ if ( aOutputArea.isInside( aLogicPos ) )
{
// handle selection within the OutlinerView
Outliner* pOutliner = pOlView->GetOutliner();
- const EditEngine& rEditEngine = pOutliner->GetEditEngine();
- Rectangle aVisArea = pOlView->GetVisArea();
+ aOldArea = pOlView->GetVisArea();
+ const basegfx::B2DRange aVisArea(aOldArea.Left(), aOldArea.Top(), aOldArea.Right(), aOldArea.Bottom());
+ basegfx::B2DPoint aTextPos(aLogicPos);
- Point aTextPos = aLogicPos;
if ( pOutliner->IsVertical() ) // have to manually transform position
{
- aTextPos -= aOutputArea.TopRight();
- long nTemp = -aTextPos.X();
- aTextPos.X() = aTextPos.Y();
- aTextPos.Y() = nTemp;
+ aTextPos -= basegfx::B2DPoint(aOutputArea.getMaxX(), aOutputArea.getMinY());
+ aTextPos = basegfx::B2DPoint(aTextPos.getX(), -aTextPos.getX());
}
else
- aTextPos -= aOutputArea.TopLeft();
- aTextPos += aVisArea.TopLeft(); // position in the edit document
+ {
+ aTextPos -= aOutputArea.getMinimum();
+ }
- EPosition aDocPosition = rEditEngine.FindDocPosition(aTextPos);
+ aTextPos += aVisArea.getMinimum(); // position in the edit document
+
+ const EditEngine& rEditEngine = pOutliner->GetEditEngine();
+ EPosition aDocPosition = rEditEngine.FindDocPosition(Point(basegfx::fround(aTextPos.getX()), basegfx::fround(aTextPos.getY())));
ESelection aCompare(aDocPosition.nPara, aDocPosition.nIndex);
ESelection aSelection = pOlView->GetSelection();
aSelection.Adjust(); // needed for IsLess/IsGreater
@@ -3025,16 +3032,14 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX,
if ( !bHitSelected )
{
- sal_Bool bWasDraw = ( pDrawView && pDrawView->AreObjectsMarked() );
+ sal_Bool bWasDraw = ( pDrawView && pDrawView->areSdrObjectsSelected() );
sal_Bool bHitDraw = sal_False;
if ( pDrawView )
{
pDrawView->UnmarkAllObj();
// Unlock the Internal Layer in order to activate the context menu.
- // re-lock in ScDrawView::MarkListHasChanged()
- lcl_UnLockComment( pDrawView, pDrawView->GetSdrPageView(), pDrawView->GetModel(), aLogicPos ,pViewData);
+ lcl_UnLockComment( pDrawView, pDrawView->GetSdrPageView(), &pDrawView->getSdrModelFromSdrView(), aLogicPos ,pViewData);
bHitDraw = pDrawView->MarkObj( aLogicPos );
- // draw shell is activated in MarkListHasChanged
}
if ( !bHitDraw )
{
@@ -3275,7 +3280,11 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt )
ScDocument* pThisDoc = pViewData->GetDocument();
if (pSourceDoc == pThisDoc)
{
- if ( pThisDoc->HasChartAtPoint(pViewData->GetTabNo(), PixelToLogic(aPos)) )
+ const basegfx::B2DPoint aPixelPos(aPos.X(), aPos.Y());
+ const basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos); // after cell edit mode is ended
+ const SdrView* pSdrView = pViewData->GetView()->GetScDrawView();
+
+ if(pThisDoc->HasChartAtPoint(pViewData->GetTabNo(), aLogicPos, 0, pSdrView))
{
if (bDragRect) // Rechteck loeschen
{
@@ -3545,8 +3554,11 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt )
nMyAction = DND_ACTION_COPY;
ScDocument* pThisDoc = pViewData->GetDocument();
- SdrObject* pHitObj = pThisDoc->GetObjectAtPoint(
- pViewData->GetTabNo(), PixelToLogic(rEvt.maPosPixel) );
+ const basegfx::B2DPoint aPixelPos(rEvt.maPosPixel.X(), rEvt.maPosPixel.Y());
+ const basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos); // after cell edit mode is ended
+ const SdrView* pSdrView = pViewData->GetView()->GetScDrawView();
+ SdrObject* pHitObj = pThisDoc->GetObjectAtPoint(pViewData->GetTabNo(), aLogicPos, pSdrView);
+
if ( pHitObj && nMyAction == DND_ACTION_LINK && !rData.pDrawTransfer )
{
if ( IsDropFormatSupported(SOT_FORMATSTR_ID_SVXB)
@@ -3769,13 +3781,15 @@ sal_Int8 ScGridWindow::ExecutePrivateDrop( const ExecuteDropEvent& rEvt )
ScModule* pScMod = SC_MOD();
const ScDragData& rData = pScMod->GetDragData();
+ const basegfx::B2DPoint aPixelPos(rEvt.maPosPixel.X(), rEvt.maPosPixel.Y());
+ const basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos); // after cell edit mode is ended
return DropTransferObj( rData.pCellTransfer, nDragStartX, nDragStartY,
- PixelToLogic(rEvt.maPosPixel), rEvt.mnAction );
+ aLogicPos, rEvt.mnAction );
}
sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPosX, SCROW nDestPosY,
- const Point& rLogicPos, sal_Int8 nDndAction )
+ const basegfx::B2DPoint& rLogicPos, sal_Int8 nDndAction )
{
if ( !pTransObj )
return 0;
@@ -3856,7 +3870,9 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
else // move/copy block
{
String aChartName;
- if (pThisDoc->HasChartAtPoint( nThisTab, rLogicPos, &aChartName ))
+ const SdrView* pSdrView = pViewData->GetView()->GetScDrawView();
+
+ if (pThisDoc->HasChartAtPoint( nThisTab, rLogicPos, &aChartName, pSdrView ))
{
String aRangeName;
aSource.Format( aRangeName, SCR_ABS_3D, pThisDoc );
@@ -4164,7 +4180,8 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
return bOk ? rEvt.mnAction : DND_ACTION_NONE; // don't try anything else
}
- Point aLogicPos = PixelToLogic(aPos);
+ const basegfx::B2DPoint aPixelPos(aPos.X(), aPos.Y());
+ basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos); // after cell edit mode is ended
if (rData.pDrawTransfer)
{
@@ -4205,7 +4222,8 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
sal_Bool bIsLink = ( rEvt.mnAction == DND_ACTION_LINK );
ScDocument* pThisDoc = pViewData->GetDocument();
- SdrObject* pHitObj = pThisDoc->GetObjectAtPoint( pViewData->GetTabNo(), PixelToLogic(aPos) );
+ const SdrView* pSdrView = pViewData->GetView()->GetScDrawView();
+ SdrObject* pHitObj = pThisDoc->GetObjectAtPoint(pViewData->GetTabNo(), aLogicPos, pSdrView);
if ( pHitObj && bIsLink )
{
// dropped on drawing object
@@ -4237,7 +4255,8 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
void ScGridWindow::PasteSelection( const Point& rPosPixel )
{
- Point aLogicPos = PixelToLogic( rPosPixel );
+ const basegfx::B2DPoint aPixelPos(rPosPixel.X(), rPosPixel.Y());
+ basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos); // after cell edit mode is ended
SCsCOL nPosX;
SCsROW nPosY;
@@ -5019,18 +5038,18 @@ sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos,
if (pFieldItem)
{
- const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField && pField->ISA(SvxURLField) )
+ const SvxURLField* pField = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
+
+ if ( pField )
{
if ( pName || pUrl || pTarget )
{
- const SvxURLField* pURLField = (const SvxURLField*)pField;
if (pName)
- *pName = pURLField->GetRepresentation();
+ *pName = pField->GetRepresentation();
if (pUrl)
- *pUrl = pURLField->GetURL();
+ *pUrl = pField->GetURL();
if (pTarget)
- *pTarget = pURLField->GetTargetFrame();
+ *pTarget = pField->GetTargetFrame();
}
bRet = sal_True;
}
@@ -5289,9 +5308,8 @@ void ScGridWindow::UpdateCursorOverlay()
for(sal_uInt32 a(0); a < aPixelRects.size(); a++)
{
const Rectangle aRA(aPixelRects[a]);
- basegfx::B2DRange aRB(aRA.Left(), aRA.Top(), aRA.Right() + 1, aRA.Bottom() + 1);
- aRB.transform(aTransform);
- aRanges.push_back(aRB);
+ const basegfx::B2DRange aRB(aRA.Left(), aRA.Top(), aRA.Right() + 1, aRA.Bottom() + 1);
+ aRanges.push_back(aTransform * aRB);
}
sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
@@ -5339,9 +5357,9 @@ void ScGridWindow::UpdateSelectionOverlay()
for(sal_uInt32 a(0); a < aPixelRects.size(); a++)
{
const Rectangle aRA(aPixelRects[a]);
- basegfx::B2DRange aRB(aRA.Left() - 1, aRA.Top() - 1, aRA.Right(), aRA.Bottom());
- aRB.transform(aTransform);
- aRanges.push_back(aRB);
+ const basegfx::B2DRange aRB(aRA.Left() - 1, aRA.Top() - 1, aRA.Right(), aRA.Bottom());
+
+ aRanges.push_back(aTransform * aRB);
}
// #i97672# get the system's hilight color and limit it to the maximum
@@ -5434,10 +5452,9 @@ void ScGridWindow::UpdateAutoFillOverlay()
const Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
- basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1);
+ const basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1);
- aRB.transform(aTransform);
- aRanges.push_back(aRB);
+ aRanges.push_back(aTransform * aRB);
sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
sdr::overlay::OVERLAY_SOLID,
@@ -5566,9 +5583,9 @@ void ScGridWindow::UpdateDragRectOverlay()
for(sal_uInt32 a(0); a < aPixelRects.size(); a++)
{
const Rectangle aRA(aPixelRects[a]);
- basegfx::B2DRange aRB(aRA.Left(), aRA.Top(), aRA.Right() + 1, aRA.Bottom() + 1);
- aRB.transform(aTransform);
- aRanges.push_back(aRB);
+ const basegfx::B2DRange aRB(aRA.Left(), aRA.Top(), aRA.Right() + 1, aRA.Bottom() + 1);
+
+ aRanges.push_back(aTransform * aRB);
}
sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
@@ -5612,10 +5629,9 @@ void ScGridWindow::UpdateHeaderOverlay()
// Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
- basegfx::B2DRange aRB(aInvertRect.Left(), aInvertRect.Top(), aInvertRect.Right() + 1, aInvertRect.Bottom() + 1);
+ const basegfx::B2DRange aRB(aInvertRect.Left(), aInvertRect.Top(), aInvertRect.Right() + 1, aInvertRect.Bottom() + 1);
- aRB.transform(aTransform);
- aRanges.push_back(aRB);
+ aRanges.push_back(aTransform * aRB);
sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
sdr::overlay::OVERLAY_INVERT,
@@ -5682,10 +5698,9 @@ void ScGridWindow::UpdateShrinkOverlay()
// Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor();
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
- basegfx::B2DRange aRB(aPixRect.Left(), aPixRect.Top(), aPixRect.Right() + 1, aPixRect.Bottom() + 1);
+ const basegfx::B2DRange aRB(aPixRect.Left(), aPixRect.Top(), aPixRect.Right() + 1, aPixRect.Bottom() + 1);
- aRB.transform(aTransform);
- aRanges.push_back(aRB);
+ aRanges.push_back(aTransform * aRB);
sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
sdr::overlay::OVERLAY_INVERT,
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index fce5ba1a3f61..73dc2554b2b6 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -56,7 +56,8 @@ sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt)
if (pDraw && !pViewData->IsRefMode())
{
pDraw->SetWindow( this );
- Point aLogicPos = PixelToLogic(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+
if ( pDraw->IsDetectiveHit( aLogicPos ) )
{
// auf Detektiv-Pfeilen gar nichts (Doppelklick wird bei ButtonUp ausgewertet)
@@ -165,12 +166,12 @@ sal_Bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt)
if (pDrView && pDraw && !pViewData->IsRefMode())
{
pDraw->SetWindow( this );
- sal_Bool bOldMarked = pDrView->AreObjectsMarked();
+ sal_Bool bOldMarked = pDrView->areSdrObjectsSelected();
if (pDraw->KeyInput( rKEvt ))
{
sal_Bool bLeaveDraw = sal_False;
sal_Bool bUsed = sal_True;
- sal_Bool bNewMarked = pDrView->AreObjectsMarked();
+ sal_Bool bNewMarked = pDrView->areSdrObjectsSelected();
if ( !pViewData->GetView()->IsDrawSelMode() )
if ( !bNewMarked )
{
@@ -225,17 +226,18 @@ void ScGridWindow::DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sa
void ScGridWindow::DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pContentDev )
{
// Draw-Gitterlinien
-
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
+
if ( pDrView && pDrView->IsGridVisible() )
{
SdrPageView* pPV = pDrView->GetSdrPageView();
DBG_ASSERT(pPV, "keine PageView");
+
if (pPV)
{
pContentDev->SetLineColor(COL_GRAY);
- pPV->DrawPageViewGrid( *pContentDev, rDrawingRect );
+ pPV->DrawPageViewGrid(*pContentDev, basegfx::B2DRange(rDrawingRect.Left(), rDrawingRect.Top(), rDrawingRect.Right(), rDrawingRect.Bottom()));
}
}
}
@@ -307,7 +309,7 @@ void ScGridWindow::DrawAfterScroll(/*sal_Bool bVal*/)
OutlinerView* pOlView = pDrView->GetTextEditOutlinerView();
if (pOlView && pOlView->GetWindow() == this)
- pOlView->ShowCursor(sal_False); // ist beim Scrollen weggekommen
+ pOlView->ShowCursor(false); // ist beim Scrollen weggekommen
}
}
@@ -321,7 +323,7 @@ void ScGridWindow::DrawAfterScroll(/*sal_Bool bVal*/)
//sal_Bool ScGridWindow::NeedDrawMarks()
//{
// ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
-// return pDrView && pDrView->IsMarkHdlShown() && pDrView->AreObjectsMarked();
+// return pDrView && pDrView->IsMarkHdlShown() && pDrView->areSdrObjectsSelected();
//}
void ScGridWindow::CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress)
@@ -333,9 +335,11 @@ void ScGridWindow::CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddres
if(rOpts.GetOption( VOPT_ANCHOR ))
{
sal_Bool bNegativePage = pViewData->GetDocument()->IsNegativePage( pViewData->GetTabNo() );
- Point aPos = pViewData->GetScrPos( rAddress.Col(), rAddress.Row(), eWhich, sal_True );
- aPos = PixelToLogic(aPos);
- rHdl.AddHdl(new SdrHdl(aPos, bNegativePage ? HDL_ANCHOR_TR : HDL_ANCHOR));
+ const Point aPos(pViewData->GetScrPos(rAddress.Col(), rAddress.Row(), eWhich, true));
+ const basegfx::B2DPoint aPixelPos(aPos.X(), aPos.Y());
+ const basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos); // after cell edit mode is ended
+
+ new SdrHdl(rHdl, 0, bNegativePage ? HDL_ANCHOR_TR : HDL_ANCHOR, aLogicPos);
}
}
}
@@ -373,32 +377,35 @@ void ScGridWindow::UpdateStatusPosSize()
sal_Bool bActionItem = sal_False;
if ( pDrView->IsAction() ) // action rectangle
{
- Rectangle aRect;
- pDrView->TakeActionRect( aRect );
- if ( !aRect.IsEmpty() )
+ basegfx::B2DRange aRange(pDrView->TakeActionRange());
+
+ if(!aRange.isEmpty())
{
- pPV->LogicToPagePos(aRect);
- aSet.Put( SfxPointItem( SID_ATTR_POSITION, aRect.TopLeft() ) );
- aSet.Put( SvxSizeItem( SID_ATTR_SIZE,
- Size( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() ) ) );
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-pPV->GetPageOrigin()));
+ const Point aOldTopLeft(basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()));
+ const Size aOldSize(basegfx::fround(aRange.getWidth()), basegfx::fround(aRange.getHeight()));
+
+ aSet.Put( SfxPointItem( SID_ATTR_POSITION, aOldTopLeft ) );
+ aSet.Put( SvxSizeItem( SID_ATTR_SIZE, aOldSize ) );
+
bActionItem = sal_True;
}
}
if ( !bActionItem )
{
- if ( pDrView->AreObjectsMarked() ) // selected objects
+ if ( pDrView->areSdrObjectsSelected() ) // selected objects
{
- Rectangle aRect = pDrView->GetAllMarkedRect();
- pPV->LogicToPagePos(aRect);
- aSet.Put( SfxPointItem( SID_ATTR_POSITION, aRect.TopLeft() ) );
- aSet.Put( SvxSizeItem( SID_ATTR_SIZE,
- Size( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() ) ) );
+ basegfx::B2DRange aRange(pDrView->getMarkedObjectSnapRange());
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-pPV->GetPageOrigin()));
+
+ aSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()))));
+ aSet.Put(SvxSizeItem(SID_ATTR_SIZE, Size(basegfx::fround(aRange.getWidth()), basegfx::fround(aRange.getHeight()))));
}
else // mouse position
{
- Point aPos = PixelToLogic(aCurMousePos);
- pPV->LogicToPagePos(aPos);
- aSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos ) );
+ const basegfx::B2DPoint aPos((GetInverseViewTransformation() * basegfx::B2DPoint(aCurMousePos.X(), aCurMousePos.Y())) - pPV->GetPageOrigin());
+
+ aSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY()))));
aSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
}
}
@@ -409,25 +416,9 @@ void ScGridWindow::UpdateStatusPosSize()
sal_Bool ScGridWindow::DrawHasMarkedObj()
{
ScDrawView* p = pViewData->GetScDrawView();
- return p ? p->AreObjectsMarked() : sal_False;
+ return p ? p->areSdrObjectsSelected() : sal_False;
}
-//void ScGridWindow::DrawStartTimer()
-//{
- //ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
- //if (pDrView)
- //{
- /* jetzt in DrawMarks
- sal_uInt16 nWinNum = pDrView->FindWin(this);
- if (nWinNum!=SDRVIEWWIN_NOTFOUND)
- pDrView->AfterInitRedraw(nWinNum);
- */
-
- // pDrView->PostPaint();
- // pDrView->RestartAfterPaintTimer();
- //}
-//}
-
void ScGridWindow::DrawMarkDropObj( SdrObject* pObj )
{
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 0ad8c55b5511..6e4df8dc0e25 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -818,16 +818,6 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
{
pContentDev->SetClipRegion();
}
-
- //sal_Bool bDraw = sal_True;
- //if (eMode == SC_UPDATE_CHANGED)
- // bDraw = NeedDrawMarks() && aOutputData.SetChangedClip();
- //if (bDraw)
- //{
- // DrawMarks();
- // if (eMode == SC_UPDATE_CHANGED)
- // pContentDev->SetClipRegion();
- //}
}
pContentDev->SetMapMode(MAP_PIXEL);
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index e45ad78d0559..ec3ddc0aae09 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -38,6 +38,7 @@
#include <vcl/help.hxx>
#include <tools/urlobj.hxx>
#include <sfx2/viewfrm.hxx>
+#include <svx/svdlegacy.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -81,7 +82,7 @@ ScHideTextCursor::~ScHideTextCursor()
{
// restore text cursor
if ( pViewData->HasEditView(eWhich) && pWin->HasFocus() )
- pViewData->GetEditView(eWhich)->ShowCursor( sal_False, sal_True );
+ pViewData->GetEditView(eWhich)->ShowCursor( false, true );
}
}
@@ -300,14 +301,14 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
MouseEvent aMEvt( aPosPixel, 1, 0, MOUSE_LEFT );
SdrHitKind eHit = pDrView->PickAnything( aMEvt, SDRMOUSEBUTTONDOWN, aVEvt );
- if ( eHit != SDRHIT_NONE && aVEvt.pObj != NULL )
+ if ( eHit != SDRHIT_NONE && aVEvt.mpObj != NULL )
{
// URL fuer IMapObject unter Pointer ist Hilfetext
- if ( ScDrawLayer::GetIMapInfo( aVEvt.pObj ) )
+ if ( ScDrawLayer::GetIMapInfo( aVEvt.mpObj ) )
{
- Point aLogicPos = PixelToLogic( aPosPixel );
- IMapObject* pIMapObj = ScDrawLayer::GetHitIMapObject(
- aVEvt.pObj, aLogicPos, *this );
+ const basegfx::B2DPoint aPixelPos(aPosPixel.X(), aPosPixel.Y());
+ const basegfx::B2DPoint aLogicPos(GetInverseViewTransformation() * aPixelPos);
+ IMapObject* pIMapObj = ScDrawLayer::GetHitIMapObject( *aVEvt.mpObj, aLogicPos, *this );
if ( pIMapObj )
{
@@ -315,35 +316,34 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
aHelpText = pIMapObj->GetAltText();
if (!aHelpText.Len())
aHelpText = pIMapObj->GetURL();
- aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
+ aPixRect = LogicToPixel(sdr::legacy::GetLogicRect(*aVEvt.mpObj));
}
}
// URL in shape text or at shape itself (URL in text overrides object URL)
if ( aHelpText.Len() == 0 )
{
- if( aVEvt.eEvent == SDREVENT_EXECUTEURL )
+ if( aVEvt.meEvent == SDREVENT_EXECUTEURL )
{
- aHelpText = aVEvt.pURLField->GetURL();
- aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
+ aHelpText = aVEvt.maURLField;
+ aPixRect = LogicToPixel(sdr::legacy::GetLogicRect(*aVEvt.mpObj));
}
else
{
SdrObject* pObj = 0;
- SdrPageView* pPV = 0;
- Point aMDPos = PixelToLogic( aPosPixel );
- if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER) )
+ const basegfx::B2DPoint aMDPos(GetInverseViewTransformation() * basegfx::B2DPoint(aPosPixel.X(), aPosPixel.Y()));
+ if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER) )
{
- if ( pObj->IsGroupObject() )
+ if ( pObj->getChildrenOfSdrObject() )
{
SdrObject* pHit = 0;
- if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
+ if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, SDRSEARCH_DEEP ) )
pObj = pHit;
}
#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
{
- aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
+ aPixRect = LogicToPixel(aVEvt.mpObj->GetLogicRect());
aHelpText = pInfo->GetHlink();
}
#endif
@@ -396,7 +396,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
SdrPageView* pPV = pDrView->GetSdrPageView();
DBG_ASSERT( pPV, "SdrPageView* ist NULL" );
if (pPV)
- bDone = ((ScDrawPage*)pPV->GetPage())->RequestHelp( this, pDrView, rHEvt );
+ bDone = ((ScDrawPage&)pPV->getSdrPageFromSdrPageView()).RequestHelp( this, pDrView, rHEvt );
}
// Wenn QuickHelp fuer AutoFill angezeigt wird, nicht wieder wegnehmen lassen
@@ -411,8 +411,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
sal_Bool ScGridWindow::IsMyModel(SdrEditView* pSdrView)
{
- return pSdrView &&
- pSdrView->GetModel() == pViewData->GetDocument()->GetDrawLayer();
+ return pSdrView && &pSdrView->getSdrModelFromSdrView() == pViewData->GetDocument()->GetDrawLayer();
}
void ScGridWindow::HideNoteMarker()
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 7d175799a80f..0d479c0430a1 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -867,8 +867,7 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
// Popup ausfuehren
- ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell,
- SfxViewShell::Current() );
+ ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
if ( pViewSh )
{
if ( rCEvt.IsMouseEvent() )
diff --git a/sc/source/ui/view/makefile.mk b/sc/source/ui/view/makefile.mk
index 5ed5ec4d112d..b09061a03272 100644
--- a/sc/source/ui/view/makefile.mk
+++ b/sc/source/ui/view/makefile.mk
@@ -33,8 +33,6 @@ TARGET=view
.INCLUDE : $(PRJ)$/util$/makefile.pmk
# --- Files --------------------------------------------------------
-# drawattr.cxx fuer IDL (enums), sollte in den Svx gehen??
-
SLOFILES = \
$(SLO)$/tabview.obj \
diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index ddffcb628b7b..15be546aad55 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -32,6 +32,7 @@
#include <unotools/pathoptions.hxx>
#include <svl/itempool.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
#include "notemark.hxx"
#include "document.hxx"
@@ -86,7 +87,7 @@ IMPL_LINK( ScNoteMarker, TimeHdl, Timer*, EMPTYARG )
SvtPathOptions aPathOpt;
String aPath = aPathOpt.GetPalettePath();
pModel = new SdrModel(aPath);
- pModel->SetScaleUnit(MAP_100TH_MM);
+ pModel->SetExchangeObjectUnit(MAP_100TH_MM);
SfxItemPool& rPool = pModel->GetItemPool();
rPool.SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
rPool.FreezeIdRanges();
@@ -104,7 +105,7 @@ IMPL_LINK( ScNoteMarker, TimeHdl, Timer*, EMPTYARG )
{
pObject = ScNoteUtil::CreateTempCaption( *pDoc, aDocPos, *pPage, aUserText, aVisRect, bLeft );
if( pObject )
- aRect = pObject->GetCurrentBoundRect();
+ aRect = sdr::legacy::GetBoundRect(*pObject);
// #39351# Page einfuegen damit das Model sie kennt und auch deleted
pModel->InsertPage( pPage );
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 3cc4797aa375..8b9e7d72fb3d 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -395,7 +395,7 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
}
}
- sal_Bool bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt
+ bool bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt
//! Mit dieser Abfrage wird zuviel weggelassen, wenn ein automatischer
//! Umbruch mitten in den Wiederholungsspalten liegt.
@@ -405,9 +405,9 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
if ( eType == OUTTYPE_PRINTER && !bMetaFile )
{
if ( nX == MAXCOL )
- bDraw = sal_False;
+ bDraw = false;
else if (pDoc->HasColBreak(nXplus1, nTab))
- bDraw = sal_False;
+ bDraw = false;
}
#endif
@@ -524,7 +524,7 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
}
}
- sal_Bool bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt
+ bool bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt
//! Mit dieser Abfrage wird zuviel weggelassen, wenn ein automatischer
//! Umbruch mitten in den Wiederholungszeilen liegt.
@@ -534,9 +534,9 @@ void ScOutputData::DrawGrid( sal_Bool bGrid, sal_Bool bPage )
if ( eType == OUTTYPE_PRINTER && !bMetaFile )
{
if ( nY == MAXROW )
- bDraw = sal_False;
+ bDraw = false;
else if (pDoc->HasRowBreak(nYplus1, nTab))
- bDraw = sal_False;
+ bDraw = false;
}
#endif
@@ -2238,7 +2238,7 @@ void ScOutputData::DrawNoteMarks()
void ScOutputData::AddPDFNotes()
{
- vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFData = dynamic_cast< vcl::PDFExtOutDevData* >( pDev->GetExtOutDevData() );
if ( !pPDFData || !pPDFData->GetIsExportNotes() )
return;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 13c8d1852f0b..8f5b4aafa1bc 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -762,7 +762,7 @@ double ScOutputData::GetStretch()
void lcl_DoHyperlinkResult( OutputDevice* pDev, const Rectangle& rRect, ScBaseCell* pCell )
{
- vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFData = dynamic_cast< vcl::PDFExtOutDevData* >( pDev->GetExtOutDevData() );
String aCellText;
String aURL;
@@ -1333,7 +1333,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
pDev->GetMapMode().GetMapUnit() == pRefDevice->GetMapMode().GetMapUnit(),
"DrawStrings: unterschiedliche MapUnits ?!?!" );
- vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFData = dynamic_cast< vcl::PDFExtOutDevData* >( pDev->GetExtOutDevData() );
sal_Bool bWasIdleDisabled = pDoc->IsIdleDisabled();
pDoc->DisableIdle( sal_True );
@@ -2109,7 +2109,7 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlig
void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
{
- vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFData = dynamic_cast< vcl::PDFExtOutDevData* >( pDev->GetExtOutDevData() );
Size aMinSize = pRefDevice->PixelToLogic(Size(0,100)); // erst darueber wird ausgegeben
// sal_uInt32 nMinHeight = aMinSize.Height() / 200; // 1/2 Pixel
diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx
index a0c3300d04d5..f8c51e3363bf 100644
--- a/sc/source/ui/view/output3.cxx
+++ b/sc/source/ui/view/output3.cxx
@@ -45,6 +45,10 @@
#include <svx/fmview.hxx>
+// STATIC DATA -----------------------------------------------------------
+
+SdrObject* pSkipPaintObj = NULL;
+
//==================================================================
// #i72502#
diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx
index 0a307b84bbb7..792fba7e3345 100644
--- a/sc/source/ui/view/pgbrksh.cxx
+++ b/sc/source/ui/view/pgbrksh.cxx
@@ -49,8 +49,6 @@
//------------------------------------------------------------------------
-TYPEINIT1( ScPageBreakShell, SfxShell );
-
SFX_IMPL_INTERFACE(ScPageBreakShell, SfxShell, ScResId(SCSTR_PAGEBREAKSHELL))
{
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_PAGEBREAK) );
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index c156557a4f92..cac3dc5e85e6 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -56,8 +56,6 @@
//------------------------------------------------------------------------
-TYPEINIT1( ScPivotShell, SfxShell );
-
SFX_IMPL_INTERFACE(ScPivotShell, SfxShell, ScResId(SCSTR_PIVOTSHELL))
{
SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_PIVOT) );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 143ff3f2d0ff..ab10d9c6dc1d 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -157,7 +157,7 @@ void ScPreview::UpdateDrawView() // nTab muss richtig sein
if ( pModel )
{
SdrPage* pPage = pModel->GetPage(nTab);
- if ( pDrawView && ( !pDrawView->GetSdrPageView() || pDrawView->GetSdrPageView()->GetPage() != pPage ) )
+ if ( pDrawView && ( !pDrawView->GetSdrPageView() || &pDrawView->GetSdrPageView()->getSdrPageFromSdrPageView() != pPage ) )
{
// die angezeigte Page der DrawView umzustellen (s.u.) funktioniert nicht ?!?
delete pDrawView;
@@ -166,20 +166,13 @@ void ScPreview::UpdateDrawView() // nTab muss richtig sein
if ( !pDrawView ) // neu anlegen?
{
- pDrawView = new FmFormView( pModel, this );
+ pDrawView = new FmFormView( *pModel, this );
// #55259# die DrawView uebernimmt den Design-Modus vom Model
// (Einstellung "Im Entwurfsmodus oeffnen"), darum hier zuruecksetzen
- pDrawView->SetDesignMode( sal_True );
- pDrawView->SetPrintPreview( sal_True );
- pDrawView->ShowSdrPage(pPage);
+ pDrawView->SetDesignMode( true );
+ pDrawView->SetPrintPreview(true);
+ pDrawView->ShowSdrPage(*pPage);
}
-#if 0
- else if ( !pDrawView->GetSdrPageView()) // angezeigte Page umstellen
- {
- pDrawView->HideSdrPage();
- pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
- }
-#endif
}
else if ( pDrawView )
{
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index b51772bc2d08..91edc697cddc 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -93,8 +93,6 @@ using namespace com::sun::star;
#define ScPreviewShell
#include "scslots.hxx"
-TYPEINIT1( ScPreviewShell, SfxViewShell );
-
SFX_IMPL_INTERFACE( ScPreviewShell, SfxViewShell, ScResId(SCSTR_PREVIEWSHELL) )
{
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|
@@ -151,13 +149,14 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
{
Construct( &pViewFrame->GetWindow() );
- if ( pOldSh && pOldSh->ISA( ScTabViewShell ) )
+ ScTabViewShell* pTabViewShell = dynamic_cast< ScTabViewShell* >(pOldSh);
+
+ if ( pTabViewShell )
{
// store view settings, show table from TabView
//! store live ScViewData instead, and update on ScTablesHint?
//! or completely forget aSourceData on ScTablesHint?
- ScTabViewShell* pTabViewShell = ((ScTabViewShell*)pOldSh);
ScViewData* pData = pTabViewShell->GetViewData();
pData->WriteUserDataSequence( aSourceData );
InitStartTable( pData->GetTabNo() );
diff --git a/sc/source/ui/view/prevwsh2.cxx b/sc/source/ui/view/prevwsh2.cxx
index 203d415f7564..c4313d1350f2 100644
--- a/sc/source/ui/view/prevwsh2.cxx
+++ b/sc/source/ui/view/prevwsh2.cxx
@@ -305,7 +305,7 @@ void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
sal_Bool bDataChanged = sal_False;
- if (rHint.ISA(SfxSimpleHint))
+ if ( dynamic_cast< const SfxSimpleHint* >(&rHint))
{
sal_uLong nSlot = ((const SfxSimpleHint&)rHint).GetId();
switch ( nSlot )
@@ -323,7 +323,7 @@ void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(ScPaintHint))
+ else if ( dynamic_cast< const ScPaintHint* >(&rHint))
{
if ( ((const ScPaintHint&)rHint).GetPrintFlag() )
{
@@ -332,18 +332,15 @@ void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
bDataChanged = sal_True;
}
}
- else if (rHint.ISA(SdrHint))
+ else if ( dynamic_cast< const SdrBaseHint* >(&rHint))
{
// SdrHints are no longer used for invalidating, thus react on objectchange instead
- if(HINT_OBJCHG == ((const SdrHint&)rHint).GetKind())
+ const SdrHintKind eKind(((const SdrBaseHint&)rHint).GetSdrHintKind());
+
+ if(HINT_OBJCHG_MOVE == eKind || HINT_OBJCHG_RESIZE == eKind || HINT_OBJCHG_ATTR == eKind)
bDataChanged = sal_True;
}
if (bDataChanged)
pPreview->DataChanged(sal_True);
}
-
-
-
-
-
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index b6e94ea5fdd8..c9e44a73e458 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -524,9 +524,9 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
if( pModel )
{
- pDrawView = new FmFormView( pModel, pDev );
- pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
- pDrawView->SetPrintPreview( sal_True );
+ pDrawView = new FmFormView( *pModel, pDev );
+ pDrawView->ShowSdrPage(*pDrawView->getSdrModelFromSdrView().GetPage(nTab));
+ pDrawView->SetPrintPreview(true);
aOutputData.SetDrawView( pDrawView );
}
@@ -1093,7 +1093,7 @@ void ScPrintFunc::SetDateTime( const Date& rDate, const Time& rTime )
void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut,
const Rectangle &rGrf, const Rectangle &rOut )
{
- const FASTBOOL bNotInside = !rOut.IsInside( rGrf );
+ const bool bNotInside = !rOut.IsInside( rGrf );
if ( bNotInside )
{
pOut->Push();
@@ -1128,8 +1128,7 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
Point aPos;
Size aDrawSize = aGrfSize;
- FASTBOOL bDraw = sal_True;
-// FASTBOOL bRetouche = sal_True;
+ bool bDraw = true;
switch ( ePos )
{
case GPOS_LT: aPos = rOrg.TopLeft();
@@ -1164,7 +1163,6 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
case GPOS_AREA:
aPos = rOrg.TopLeft();
aDrawSize = rOrg.GetSize();
-// bRetouche = sal_False;
break;
case GPOS_TILED:
{
@@ -1213,13 +1211,12 @@ void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevi
aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0) );
}
- bDraw = sal_False;
-// bRetouche = sal_False;
+ bDraw = false;
}
break;
case GPOS_NONE:
- bDraw = sal_False;
+ bDraw = false;
break;
default: DBG_ASSERT( !pOut, "new Graphic position?" );
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 796ab2a02d5c..14c9c8d1b337 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -106,7 +106,7 @@ namespace { ScTabViewShell * lcl_GetTabViewShell( SfxBindings *pBindings ); }
ScTabViewShell* pViewShell = lcl_GetTabViewShell( p ); \
/*//-->Added by PengYunQuan for Validity Cell Range Picker*/\
if (!pViewShell) \
- pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() ); \
+ pViewShell = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() ); \
DBG_ASSERT( pViewShell, "missing view shell :-(" ); \
pWindow = pViewShell ? \
pViewShell->CreateRefDialog( p, this, pInfo, pParentP, sid ) : NULL; \
@@ -214,7 +214,7 @@ ScSimpleRefDlgWrapper::ScSimpleRefDlgWrapper( Window* pParentP,
: SfxChildWindow(pParentP, nId)
{
// ScTabViewShell* pViewShell =
-// PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+// dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
ScTabViewShell* pViewShell = NULL;
SfxDispatcher* pDisp = p->GetDispatcher();
@@ -222,7 +222,7 @@ ScSimpleRefDlgWrapper::ScSimpleRefDlgWrapper( Window* pParentP,
{
SfxViewFrame* pViewFrm = pDisp->GetFrame();
if ( pViewFrm )
- pViewShell = PTR_CAST( ScTabViewShell, pViewFrm->GetViewShell() );
+ pViewShell = dynamic_cast< ScTabViewShell* >( pViewFrm->GetViewShell() );
}
DBG_ASSERT( pViewShell, "missing view shell :-(" );
@@ -326,8 +326,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( Window* pParentP,
SfxChildWinInfo* pInfo ) :
SfxChildWindow( pParentP, nId )
{
- ScTabViewShell* pViewShell =
- PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewShell = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
DBG_ASSERT( pViewShell, "missing view shell :-(" );
pWindow = pViewShell ?
new ScAcceptChgDlg( pBindings, this, pParentP, pViewShell->GetViewData() ) :
@@ -342,8 +341,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( Window* pParentP,
void ScAcceptChgDlgWrapper::ReInitDlg()
{
- ScTabViewShell* pViewShell =
- PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ ScTabViewShell* pViewShell = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
DBG_ASSERT( pViewShell, "missing view shell :-(" );
if(pWindow!=NULL && pViewShell)
@@ -410,11 +408,11 @@ ScValidityRefChildWin::ScValidityRefChildWin( Window* pParentP,
NULL != ( pWindow = ScValidationDlg::Find1AliveObject( pParentP ) ) ? static_cast<ScValidationDlg*>(pWindow)->GetTabViewShell() :
lcl_GetTabViewShell( p );
if (!pViewShell)
- pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
+ pViewShell = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() );
DBG_ASSERT( pViewShell, "missing view shell :-(" ); \
if (pViewShell && !pWindow) \
pViewShell->GetViewFrame()->SetChildWindow( nId, sal_False ); \
- else if( pWindow /*&& pWindow->ISA(ScValidationDlg)*/ )
+ else if( pWindow /*&& dynamic_cast< ScValidationDlg* >(pWindow)*/ )
{}//pWindow = new Window( pParentP, WB_HIDE );
if( pWindow ) m_pSavedWndParent = pWindow->GetParent();
diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx
index 0790707ef104..b7a748797b25 100644
--- a/sc/source/ui/view/spelldialog.cxx
+++ b/sc/source/ui/view/spelldialog.cxx
@@ -124,7 +124,7 @@ void ScSpellDialogChildWindow::LoseFocus()
void ScSpellDialogChildWindow::Reset()
{
- if( mpViewShell && (mpViewShell == PTR_CAST( ScTabViewShell, SfxViewShell::Current() )) )
+ if( mpViewShell && (mpViewShell == dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() )) )
{
if( mxEngine.get() && mxEngine->IsAnyModified() )
{
@@ -165,7 +165,7 @@ void ScSpellDialogChildWindow::Init()
{
if( mpViewShell )
return;
- if( (mpViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() )) == 0 )
+ if( (mpViewShell = dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() )) == 0 )
return;
mpViewData = mpViewShell->GetViewData();
@@ -260,7 +260,7 @@ void ScSpellDialogChildWindow::Init()
bool ScSpellDialogChildWindow::IsSelectionChanged()
{
- if( !mxOldSel.get() || !mpViewShell || (mpViewShell != PTR_CAST( ScTabViewShell, SfxViewShell::Current() )) )
+ if( !mxOldSel.get() || !mpViewShell || (mpViewShell != dynamic_cast< ScTabViewShell* >( SfxViewShell::Current() )) )
return true;
if( EditView* pEditView = mpViewData->GetSpellingView() )
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index 3444f3c02bcb..a05a737887f7 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -223,7 +223,7 @@ bool ScConversionEngineBase::FindNextConversionCell()
// language changed?
const SfxPoolItem* pItem = mrDoc.GetAttr( nNewCol, nNewRow, mnStartTab, ATTR_FONT_LANGUAGE );
- if( const SvxLanguageItem* pLangItem = PTR_CAST( SvxLanguageItem, pItem ) )
+ if( const SvxLanguageItem* pLangItem = dynamic_cast< const SvxLanguageItem* >( pItem ) )
{
LanguageType eLang = static_cast< LanguageType >( pLangItem->GetValue() );
if( eLang == LANGUAGE_SYSTEM )
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 34fba796422e..2b2f47d9cbf7 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -98,7 +98,7 @@ ScTabControl::~ScTabControl()
sal_uInt16 ScTabControl::GetMaxId() const
{
- sal_uInt16 nVisCnt = GetPageCount();
+ const sal_uInt16 nVisCnt(static_cast<sal_uInt16>(GetPageCount()));
if (nVisCnt)
return GetPageId(nVisCnt-1);
@@ -224,8 +224,10 @@ void ScTabControl::Select()
sal_uInt16 nPage = nCurId - 1;
// OLE-inplace deaktivieren
- if ( nPage != static_cast<sal_uInt16>(pViewData->GetTabNo()) )
- pViewData->GetView()->DrawMarkListHasChanged();
+ // TTTT: this was in no case a inplace activate; maybe a rebuild of selection visualisation
+ // (now handleSelectionChange())
+// if ( nPage != static_cast<sal_uInt16>(pViewData->GetTabNo()) )
+// pViewData->GetView()->DrawMarkListHasChanged();
// InputEnterHandler nur wenn nicht Referenzeingabe
@@ -486,9 +488,11 @@ sal_uInt16 lcl_DocShellNr( ScDocument* pDoc )
SfxObjectShell* pShell = SfxObjectShell::GetFirst();
while ( pShell )
{
- if ( pShell->Type() == TYPE(ScDocShell) )
+ ScDocShell* pScDocShell = dynamic_cast< ScDocShell* >(pShell);
+
+ if ( pScDocShell )
{
- if ( ((ScDocShell*)pShell)->GetDocument() == pDoc )
+ if ( pScDocShell->GetDocument() == pDoc )
return nShellCnt;
++nShellCnt;
diff --git a/sc/source/ui/view/tabpopsh.cxx b/sc/source/ui/view/tabpopsh.cxx
index 6e7094dca8fc..792edc9f80b3 100644
--- a/sc/source/ui/view/tabpopsh.cxx
+++ b/sc/source/ui/view/tabpopsh.cxx
@@ -36,8 +36,6 @@ SFX_SLOTMAP(ScTabPopShell)
};
-TYPEINIT1(ScTabPopShell,SfxShell);
-
//SFX_IMPL_IDL_INTERFACE(ScTabPopShell, SfxShell, 0)
SFX_IMPL_INTERFACE(ScTabPopShell, SfxShell, ResId( 0, NULL))
{
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index ab41a38cda52..56453439f966 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -70,7 +70,6 @@
#define _SDR_NOUNDO // Undo-Objekte
#define _SDR_NOPAGEOBJ // SdrPageObj
-#define _SDR_NOVIRTOBJ // SdrVirtObj
#define _SDR_NOGROUPOBJ // SdrGroupObj
#define _SDR_NOTEXTOBJ // SdrTextObj
#define _SDR_NOPATHOBJ // SdrPathObj
@@ -101,11 +100,6 @@
#define _SVDOPAGE_HXX
#endif
-#ifdef _SDR_NOVIRTOBJ
- #undef _SDR_NOVIRTOBJ
- #define _SVDOVIRT_HXX
-#endif
-
#ifdef _SDR_NOGROUPOBJ
#undef _SDR_NOGROUPOBJ
#define _SVDOGRP_HXX
@@ -1938,7 +1932,7 @@ void ScTabView::DoVSplit(long nSplitPos)
}
}
-Point ScTabView::GetInsertPos()
+basegfx::B2DPoint ScTabView::GetInsertPos()
{
ScDocument* pDoc = aViewData.GetDocument();
SCCOL nCol = aViewData.GetCurX();
@@ -1952,15 +1946,15 @@ Point ScTabView::GetInsertPos()
nPosX = -nPosX;
long nPosY = (long) pDoc->GetRowHeight( 0, nRow-1, nTab);
nPosY = (long)(nPosY * HMM_PER_TWIPS);
- return Point(nPosX,nPosY);
+
+ return basegfx::B2DPoint(nPosX, nPosY);
}
-Point ScTabView::GetChartInsertPos( const Size& rSize, const ScRange& rCellRange )
+basegfx::B2DPoint ScTabView::GetChartInsertPos( const basegfx::B2DVector& rScale, const ScRange& rCellRange )
{
- Point aInsertPos;
- const long nBorder = 100; // leave 1mm for border
- long nNeededWidth = rSize.Width() + 2 * nBorder;
- long nNeededHeight = rSize.Height() + 2 * nBorder;
+ basegfx::B2DPoint aInsertPos(0.0, 0.0);
+ const double fBorder(100.0); // leave 1mm for border
+ const basegfx::B2DVector aNeededScale(rScale.getX() + (2.0 * fBorder), rScale.getY() + (2.0 * fBorder));
// use the active window, or lower/right if frozen (as in CalcZoom)
ScSplitPos eUsedPart = aViewData.GetActivePart();
@@ -1976,107 +1970,118 @@ Point ScTabView::GetChartInsertPos( const Size& rSize, const ScRange& rCellRange
ActivatePart( eUsedPart );
// get the visible rectangle in logic units
-
- MapMode aDrawMode = pWin->GetDrawMapMode();
- Rectangle aVisible( pWin->PixelToLogic( Rectangle( Point(0,0), pWin->GetOutputSizePixel() ), aDrawMode ) );
+ const MapMode aDrawMode(pWin->GetDrawMapMode());
+ basegfx::B2DRange aVisible(pWin->GetViewTransformation(aDrawMode) * pWin->GetDiscreteRange());
ScDocument* pDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
- sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
- long nLayoutSign = bLayoutRTL ? -1 : 1;
+ const bool bLayoutRTL(pDoc->IsLayoutRTL( nTab ));
+ const double fLayoutSign(bLayoutRTL ? -1.0 : 1.0);
+ const double fDocX(pDoc->GetColOffset( MAXCOL + 1, nTab ) * HMM_PER_TWIPS * fLayoutSign);
+ const double fDocY(pDoc->GetRowOffset( MAXROW + 1, nTab ) * HMM_PER_TWIPS);
- long nDocX = (long)( (double) pDoc->GetColOffset( MAXCOL + 1, nTab ) * HMM_PER_TWIPS ) * nLayoutSign;
- long nDocY = (long)( (double) pDoc->GetRowOffset( MAXROW + 1, nTab ) * HMM_PER_TWIPS );
+ if ( aVisible.getMinX() * fLayoutSign > fDocX * fLayoutSign )
+ {
+ aVisible = basegfx::B2DRange(fDocX, aVisible.getMinY(), aVisible.getMaxX(), aVisible.getMaxY());
+ }
- if ( aVisible.Left() * nLayoutSign > nDocX * nLayoutSign )
- aVisible.Left() = nDocX;
- if ( aVisible.Right() * nLayoutSign > nDocX * nLayoutSign )
- aVisible.Right() = nDocX;
- if ( aVisible.Top() > nDocY )
- aVisible.Top() = nDocY;
- if ( aVisible.Bottom() > nDocY )
- aVisible.Bottom() = nDocY;
+ if ( aVisible.getMaxX() * fLayoutSign > fDocX * fLayoutSign )
+ {
+ aVisible = basegfx::B2DRange(aVisible.getMinX(), aVisible.getMinY(), fDocX, aVisible.getMaxY());
+ }
- // get the logic position of the selection
+ if ( aVisible.getMinY() > fDocY )
+ {
+ aVisible = basegfx::B2DRange(aVisible.getMinX(), fDocY, aVisible.getMaxX(), aVisible.getMaxY());
+ }
- Rectangle aSelection = pDoc->GetMMRect( rCellRange.aStart.Col(), rCellRange.aStart.Row(),
- rCellRange.aEnd.Col(), rCellRange.aEnd.Row(), nTab );
+ if ( aVisible.getMaxY() > fDocY )
+ {
+ aVisible = basegfx::B2DRange(aVisible.getMinX(), aVisible.getMinY(), aVisible.getMaxX(), fDocY);
+ }
- long nLeftSpace = aSelection.Left() - aVisible.Left();
- long nRightSpace = aVisible.Right() - aSelection.Right();
- long nTopSpace = aSelection.Top() - aVisible.Top();
- long nBottomSpace = aVisible.Bottom() - aSelection.Bottom();
+ // get the logic position of the selection
- bool bFitLeft = ( nLeftSpace >= nNeededWidth );
- bool bFitRight = ( nRightSpace >= nNeededWidth );
+ const Rectangle aMMRectangle(pDoc->GetMMRect(rCellRange.aStart.Col(), rCellRange.aStart.Row(), rCellRange.aEnd.Col(), rCellRange.aEnd.Row(), nTab));
+ const basegfx::B2DRange aSelection(aMMRectangle.Left(), aMMRectangle.Top(), aMMRectangle.Right(), aMMRectangle.Bottom());
+ const double fLeftSpace(aSelection.getMinX() - aVisible.getMinX());
+ const double fRightSpace(aVisible.getMaxX() - aSelection.getMaxX());
+ const double fTopSpace(aSelection.getMinY() - aVisible.getMinY());
+ const double fBottomSpace(aVisible.getMaxY() - aSelection.getMaxY());
+ const bool bFitLeft(fLeftSpace >= aNeededScale.getX());
+ const bool bFitRight(fRightSpace >= aNeededScale.getX());
if ( bFitLeft || bFitRight )
{
// first preference: completely left or right of the selection
// if both fit, prefer left in RTL mode, right otherwise
- bool bPutLeft = bFitLeft && ( bLayoutRTL || !bFitRight );
+ const bool bPutLeft(bFitLeft && ( bLayoutRTL || !bFitRight ));
if ( bPutLeft )
- aInsertPos.X() = aSelection.Left() - nNeededWidth;
+ aInsertPos.setX(aSelection.getMinX() - aNeededScale.getX());
else
- aInsertPos.X() = aSelection.Right() + 1;
+ aInsertPos.setX(aSelection.getMaxX());
// align with top of selection (is moved again if it doesn't fit)
- aInsertPos.Y() = std::max( aSelection.Top(), aVisible.Top() );
+ aInsertPos.setY(std::max( aSelection.getMinY(), aVisible.getMinY() ));
}
- else if ( nTopSpace >= nNeededHeight || nBottomSpace >= nNeededHeight )
+ else if ( fTopSpace >= aNeededScale.getY() || fBottomSpace >= aNeededScale.getY() )
{
// second preference: completely above or below the selection
- if ( nBottomSpace > nNeededHeight ) // bottom is preferred
- aInsertPos.Y() = aSelection.Bottom() + 1;
+ if ( fBottomSpace > aNeededScale.getY() ) // bottom is preferred
+ aInsertPos.setY(aSelection.getMaxY());
else
- aInsertPos.Y() = aSelection.Top() - nNeededHeight;
+ aInsertPos.setY(aSelection.getMinY() - aNeededScale.getY());
// align with (logic) left edge of selection (moved again if it doesn't fit)
if ( bLayoutRTL )
- aInsertPos.X() = std::min( aSelection.Right(), aVisible.Right() ) - nNeededWidth + 1;
+ aInsertPos.setX(std::min( aSelection.getMaxX(), aVisible.getMaxX() ) - aNeededScale.getX());
else
- aInsertPos.X() = std::max( aSelection.Left(), aVisible.Left() );
+ aInsertPos.setX(std::max( aSelection.getMinX(), aVisible.getMinX() ));
}
else
{
// place to the (logic) right of the selection and move so it fits
if ( bLayoutRTL )
- aInsertPos.X() = aSelection.Left() - nNeededWidth;
+ aInsertPos.setX(aSelection.getMinX() - aNeededScale.getX());
else
- aInsertPos.X() = aSelection.Right() + 1;
- aInsertPos.Y() = std::max( aSelection.Top(), aVisible.Top() );
+ aInsertPos.setX(aSelection.getMaxX());
+
+ aInsertPos.setY(std::max( aSelection.getMinY(), aVisible.getMinY() ));
}
// move the position if the object doesn't fit in the screen
+ const basegfx::B2DRange aCompareRange(aInsertPos, aInsertPos + aNeededScale);
- Rectangle aCompareRect( aInsertPos, Size( nNeededWidth, nNeededHeight ) );
- if ( aCompareRect.Right() > aVisible.Right() )
- aInsertPos.X() -= aCompareRect.Right() - aVisible.Right();
- if ( aCompareRect.Bottom() > aVisible.Bottom() )
- aInsertPos.Y() -= aCompareRect.Bottom() - aVisible.Bottom();
+ if ( aCompareRange.getMaxX() > aVisible.getMaxX() )
+ aInsertPos.setX(aInsertPos.getX() - (aCompareRange.getMaxX() - aVisible.getMaxX()));
+ if ( aCompareRange.getMaxY() > aVisible.getMaxY() )
+ aInsertPos.setY(aInsertPos.getY() - (aCompareRange.getMaxY() - aVisible.getMaxY()));
- if ( aInsertPos.X() < aVisible.Left() )
- aInsertPos.X() = aVisible.Left();
- if ( aInsertPos.Y() < aVisible.Top() )
- aInsertPos.Y() = aVisible.Top();
+ if ( aInsertPos.getX() < aVisible.getMinX() )
+ aInsertPos.setX(aVisible.getMinX());
+ if ( aInsertPos.getY() < aVisible.getMinY() )
+ aInsertPos.setY(aVisible.getMinY());
- // nNeededWidth / nNeededHeight includes all borders - move aInsertPos to the
+ // aNeededScale.getX() / aNeededScale.getY() includes all borders - move aInsertPos to the
// object position, inside the border
-
- aInsertPos.X() += nBorder;
- aInsertPos.Y() += nBorder;
+ aInsertPos += basegfx::B2DPoint(fBorder, fBorder);
}
+
return aInsertPos;
}
-Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const Rectangle& rLogicChart )
+basegfx::B2DPoint ScTabView::GetChartDialogPos( const basegfx::B2DVector& rDialogSize, const basegfx::B2DRange& rLogicChart )
{
- // rDialogSize must be in pixels, rLogicChart in 1/100 mm. Return value is in pixels.
+ const Size aDialogSize(basegfx::fround(rDialogSize.getX()), basegfx::fround(rDialogSize.getY()));
+ const Rectangle aLogicChart(
+ basegfx::fround(rLogicChart.getMinX()), basegfx::fround(rLogicChart.getMinY()),
+ basegfx::fround(rLogicChart.getMaxX()), basegfx::fround(rLogicChart.getMaxY()));
+ // aDialogSize must be in pixels, aLogicChart in 1/100 mm. Return value is in pixels.
Point aRet;
// use the active window, or lower/right if frozen (as in CalcZoom)
@@ -2091,7 +2096,7 @@ Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const Rectangle& rL
if (pWin)
{
MapMode aDrawMode = pWin->GetDrawMapMode();
- Rectangle aObjPixel = pWin->LogicToPixel( rLogicChart, aDrawMode );
+ Rectangle aObjPixel = pWin->LogicToPixel( aLogicChart, aDrawMode );
Rectangle aObjAbs( pWin->OutputToAbsoluteScreenPixel( aObjPixel.TopLeft() ),
pWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) );
@@ -2104,24 +2109,24 @@ Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const Rectangle& rL
bool bCenterHor = false;
- if ( aDesktop.Bottom() - aObjAbs.Bottom() >= rDialogSize.Height() + aSpace.Height() )
+ if ( aDesktop.Bottom() - aObjAbs.Bottom() >= aDialogSize.Height() + aSpace.Height() )
{
// first preference: below the chart
aRet.Y() = aObjAbs.Bottom() + aSpace.Height();
bCenterHor = true;
}
- else if ( aObjAbs.Top() - aDesktop.Top() >= rDialogSize.Height() + aSpace.Height() )
+ else if ( aObjAbs.Top() - aDesktop.Top() >= aDialogSize.Height() + aSpace.Height() )
{
// second preference: above the chart
- aRet.Y() = aObjAbs.Top() - rDialogSize.Height() - aSpace.Height();
+ aRet.Y() = aObjAbs.Top() - aDialogSize.Height() - aSpace.Height();
bCenterHor = true;
}
else
{
- bool bFitLeft = ( aObjAbs.Left() - aDesktop.Left() >= rDialogSize.Width() + aSpace.Width() );
- bool bFitRight = ( aDesktop.Right() - aObjAbs.Right() >= rDialogSize.Width() + aSpace.Width() );
+ bool bFitLeft = ( aObjAbs.Left() - aDesktop.Left() >= aDialogSize.Width() + aSpace.Width() );
+ bool bFitRight = ( aDesktop.Right() - aObjAbs.Right() >= aDialogSize.Width() + aSpace.Width() );
if ( bFitLeft || bFitRight )
{
@@ -2130,33 +2135,33 @@ Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const Rectangle& rL
if ( bPutRight )
aRet.X() = aObjAbs.Right() + aSpace.Width();
else
- aRet.X() = aObjAbs.Left() - rDialogSize.Width() - aSpace.Width();
+ aRet.X() = aObjAbs.Left() - aDialogSize.Width() - aSpace.Width();
// center vertically
- aRet.Y() = aObjAbs.Top() + ( aObjAbs.GetHeight() - rDialogSize.Height() ) / 2;
+ aRet.Y() = aObjAbs.Top() + ( aObjAbs.GetHeight() - aDialogSize.Height() ) / 2;
}
else
{
// doesn't fit on any edge - put at the bottom of the screen
- aRet.Y() = aDesktop.Bottom() - rDialogSize.Height();
+ aRet.Y() = aDesktop.Bottom() - aDialogSize.Height();
bCenterHor = true;
}
}
if ( bCenterHor )
- aRet.X() = aObjAbs.Left() + ( aObjAbs.GetWidth() - rDialogSize.Width() ) / 2;
+ aRet.X() = aObjAbs.Left() + ( aObjAbs.GetWidth() - aDialogSize.Width() ) / 2;
// limit to screen (centering might lead to invalid positions)
- if ( aRet.X() + rDialogSize.Width() - 1 > aDesktop.Right() )
- aRet.X() = aDesktop.Right() - rDialogSize.Width() + 1;
+ if ( aRet.X() + aDialogSize.Width() - 1 > aDesktop.Right() )
+ aRet.X() = aDesktop.Right() - aDialogSize.Width() + 1;
if ( aRet.X() < aDesktop.Left() )
aRet.X() = aDesktop.Left();
- if ( aRet.Y() + rDialogSize.Height() - 1 > aDesktop.Bottom() )
- aRet.Y() = aDesktop.Bottom() - rDialogSize.Height() + 1;
+ if ( aRet.Y() + aDialogSize.Height() - 1 > aDesktop.Bottom() )
+ aRet.Y() = aDesktop.Bottom() - aDialogSize.Height() + 1;
if ( aRet.Y() < aDesktop.Top() )
aRet.Y() = aDesktop.Top();
}
- return aRet;
+ return basegfx::B2DPoint(aRet.X(), aRet.Y());
}
void ScTabView::LockModifiers( sal_uInt16 nModifiers )
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 184540c6f253..73ae6658e6db 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -376,8 +376,8 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
rMark.SetMarkArea( ScRange( nBlockStartX, nBlockStartY, nTab, nBlockEndX, nBlockEndY, nTab ) );
#ifdef OLD_SELECTION_PAINT
- sal_Bool bCont;
- sal_Bool bDraw = aRect.GetXorDiff( nDrawStartCol, nDrawStartRow,
+ bool bCont;
+ bool bDraw = aRect.GetXorDiff( nDrawStartCol, nDrawStartRow,
nDrawEndCol, nDrawEndRow, bCont );
if ( bDraw )
{
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index bf1782bdc465..cc9a63f83b2a 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -41,6 +41,7 @@
#include <sfx2/bindings.hxx>
#include <sfx2/viewfrm.hxx>
#include <vcl/cursor.hxx>
+#include <svx/svdlegacy.hxx>
#include "tabview.hxx"
#include "tabvwsh.hxx"
@@ -277,8 +278,6 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bNew )
SCCOL nOldX = aViewData.GetCurX();
SCROW nOldY = aViewData.GetCurY();
- // DeactivateIP nur noch bei MarkListHasChanged
-
if ( nPosX != nOldX || nPosY != nOldY || bNew )
{
ScTabViewShell* pViewShell = aViewData.GetViewShell();
@@ -1705,7 +1704,7 @@ void ScTabView::SetTabNo( SCTAB nTab, sal_Bool bNew, sal_Bool bExtendSelection,
SdrOle2Obj* pDrawObj = pClient->GetDrawObj();
if ( pDrawObj )
{
- Rectangle aRect = pDrawObj->GetLogicRect();
+ Rectangle aRect(sdr::legacy::GetLogicRect(*pDrawObj));
MapMode aMapMode( MAP_100TH_MM );
Size aOleSize = pDrawObj->GetOrigObjSize( &aMapMode );
aRect.SetSize( aOleSize );
@@ -1851,7 +1850,7 @@ void ScTabView::UpdateEditView()
static_cast<ScEditEngineDefaulter*>(pEditView->GetEditEngine()),
pGridWin[i], GetViewData()->GetCurX(), GetViewData()->GetCurY() );
if ( (ScSplitPos)i == eActive )
- pEditView->ShowCursor( sal_False );
+ pEditView->ShowCursor( false );
}
}
@@ -2556,9 +2555,6 @@ void ScTabView::ActivateView( sal_Bool bActivate, sal_Bool bFirst )
else if (!bFirst)
ShowAllCursors();
- //HMHif (pDrawView)
- //HMH DrawShowMarkHdl(bActivate); // Drawing-Markierung
-
if (bActivate)
{
if ( bFirst )
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 2477b411d427..f1944167367f 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -39,6 +39,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
#include <tools/ref.hxx>
+#include <svx/svdlegacy.hxx>
#include "tabview.hxx"
#include "tabvwsh.hxx"
@@ -178,9 +179,6 @@ __EXPORT ScTabView::~ScTabView()
pDrawView->VCRemoveWin(pGridWin[i]);
pDrawView->DeleteWindowFromPaintView(pGridWin[i]);
}
-
- pDrawView->HideSdrPage();
- delete pDrawView;
}
delete pSelEngine;
@@ -236,7 +234,7 @@ void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode )
// #106334# used when switching back from page preview: restore saved design mode state
// (otherwise, keep the default from the draw view ctor)
if ( nForceDesignMode != SC_FORCEMODE_NONE )
- pDrawView->SetDesignMode( (sal_Bool)nForceDesignMode );
+ pDrawView->SetDesignMode( (bool)nForceDesignMode );
// an der FormShell anmelden
FmFormShell* pFormSh = aViewData.GetViewShell()->GetFormShell();
@@ -275,8 +273,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
pDrawView->VCRemoveWin(pGridWin[i]); // fuer alte Page
SCTAB nTab = aViewData.GetTabNo();
- pDrawView->HideSdrPage();
- pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
+ pDrawView->ShowSdrPage(*pDrawView->getSdrModelFromSdrView().GetPage(nTab));
UpdateLayerLocks();
@@ -351,7 +348,7 @@ void ScTabView::UpdateLayerLocks()
sal_Bool bShared = aViewData.GetDocShell()->IsDocShared();
SdrLayer* pLayer;
- SdrLayerAdmin& rAdmin = pDrawView->GetModel()->GetLayerAdmin();
+ SdrLayerAdmin& rAdmin = pDrawView->getSdrModelFromSdrView().GetModelLayerAdmin();
pLayer = rAdmin.GetLayerPerID(SC_LAYER_BACK);
if (pLayer)
pDrawView->SetLayerLocked( pLayer->GetName(), bProt || !bEx || bShared );
@@ -484,16 +481,12 @@ SdrView* ScTabView::GetSdrView()
return pDrawView;
}
-void ScTabView::DrawMarkListHasChanged()
-{
- if ( pDrawView )
- pDrawView->MarkListHasChanged();
-}
-
void ScTabView::UpdateAnchorHandles()
{
if ( pDrawView )
- pDrawView->AdjustMarkHdl();
+ {
+ pDrawView->SetMarkHandles();
+ }
}
void ScTabView::UpdateIMap( SdrObject* pObj )
@@ -502,7 +495,7 @@ void ScTabView::UpdateIMap( SdrObject* pObj )
pDrawView->UpdateIMap( pObj );
}
-void ScTabView::DrawMarkRect( const Rectangle& rRect )
+void ScTabView::DrawMarkRange( const basegfx::B2DRange& rRange )
{
//! store rectangle for repaint during drag
@@ -520,7 +513,10 @@ void ScTabView::DrawMarkRect( const Rectangle& rRect )
pGridWin[i]->SetLineColor( COL_BLACK );
pGridWin[i]->SetFillColor();
- pGridWin[i]->DrawRect(rRect);
+ const Rectangle aOldRectangle(
+ basegfx::fround(rRange.getMinX()), basegfx::fround(rRange.getMinY()),
+ basegfx::fround(rRange.getMaxX()), basegfx::fround(rRange.getMaxY()));
+ pGridWin[i]->DrawRect(aOldRectangle);
pGridWin[i]->SetRasterOp(aROp);
if (bHasLine)
@@ -537,7 +533,6 @@ void ScTabView::DrawMarkRect( const Rectangle& rRect )
void ScTabView::DrawEnableAnim(sal_Bool bSet)
{
- sal_uInt16 i;
if ( pDrawView )
{
// #71040# dont start animations if display of graphics is disabled
@@ -546,13 +541,18 @@ void ScTabView::DrawEnableAnim(sal_Bool bSet)
{
if ( !pDrawView->IsAnimationEnabled() )
{
- pDrawView->SetAnimationEnabled(sal_True);
+ pDrawView->SetAnimationEnabled(true);
// Animierte GIFs muessen wieder gestartet werden:
ScDocument* pDoc = aViewData.GetDocument();
- for (i=0; i<4; i++)
- if ( pGridWin[i] && pGridWin[i]->IsVisible() )
- pDoc->StartAnimations( aViewData.GetTabNo(), pGridWin[i] );
+
+ for(sal_uInt16 i(0); i < 4; i++)
+ {
+ if(pGridWin[i] && pGridWin[i]->IsVisible())
+ {
+ pDoc->StartAnimations(aViewData.GetTabNo(), pGridWin[i]);
+ }
+ }
}
}
else
@@ -562,20 +562,6 @@ void ScTabView::DrawEnableAnim(sal_Bool bSet)
}
}
-//HMHvoid ScTabView::DrawShowMarkHdl(sal_Bool bShow)
-//HMH{
- //HMHif (!pDrawView)
- //HMH return;
-
- //HMHif (bShow)
- //HMH{
- //HMH if (!pDrawView->IsDisableHdl())
- //HMH pDrawView->ShowMarkHdl();
- //HMH}
- //HMHelse
- //HMH pDrawView->HideMarkHdl();
-//HMH}
-
void ScTabView::UpdateDrawTextOutliner()
{
if ( pDrawView )
@@ -598,20 +584,22 @@ void ScTabView::DigitLanguageChanged()
void ScTabView::ScrollToObject( SdrObject* pDrawObj )
{
- if ( pDrawObj )
+ if(pDrawObj && pDrawView)
{
// #i118524# use the BoundRect, this defines the visible area
- MakeVisible(pDrawObj->GetCurrentBoundRect());
+ MakeVisibleAtView(pDrawObj->getObjectRange(pDrawView));
}
}
-void ScTabView::MakeVisible( const Rectangle& rHMMRect )
+void ScTabView::MakeVisibleAtView( const basegfx::B2DRange& rRange )
{
Window* pWin = GetActiveWin();
Size aWinSize = pWin->GetOutputSizePixel();
SCTAB nTab = aViewData.GetTabNo();
- Rectangle aRect = pWin->LogicToPixel( rHMMRect );
+ const Rectangle aRect(pWin->LogicToPixel(Rectangle(
+ basegfx::fround(rRange.getMinX()), basegfx::fround(rRange.getMinY()),
+ basegfx::fround(rRange.getMaxX()), basegfx::fround(rRange.getMaxY()))));
long nScrollX=0, nScrollY=0; // Pixel
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index e31f2cc0748a..7c888327fff2 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -46,14 +46,13 @@
#include "scresid.hxx"
#include "dwfunctr.hxx"
#include "sc.hrc" // -> SID_TOOL_xxx
-#include "drawattr.hxx" // -> SvxDrawToolItem
#include "spelldialog.hxx"
#define ScTabViewShell
#include "scslots.hxx"
-TYPEINIT2(ScTabViewShell,SfxViewShell,SfxListener);
+#define SearchSettings
SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL))
{
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index 001bce858595..3d5774829c41 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -41,7 +41,6 @@
#include <sfx2/dispatch.hxx>
#include "tabvwsh.hxx"
-#include "drawattr.hxx"
#include "drawsh.hxx"
#include "drawview.hxx"
#include "fupoor.hxx"
@@ -64,6 +63,8 @@
#include <svx/svdpage.hxx>
#include <fuconcustomshape.hxx>
+#define SvxDrawToolItem SfxAllEnumItem
+
// -----------------------------------------------------------------------
SdrView* __EXPORT ScTabViewShell::GetDrawView() const
@@ -77,7 +78,7 @@ void ScTabViewShell::WindowChanged()
ScDrawView* pDrView = GetScDrawView();
if (pDrView)
- pDrView->SetActualWin(pWin);
+ pDrView->SetActualOutDev(pWin);
FuPoor* pFunc = GetDrawFuncPtr();
if (pFunc)
@@ -97,18 +98,15 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
ScTabView* pTabView = GetViewData()->GetView();
SfxBindings& rBindings = GetViewFrame()->GetBindings();
-
Window* pWin = pTabView->GetActiveWin();
ScDrawView* pView = pTabView->GetScDrawView();
- SdrModel* pDoc = pView->GetModel();
-
const SfxItemSet *pArgs = rReq.GetArgs();
sal_uInt16 nNewId = rReq.GetSlot();
if ( nNewId == SID_DRAW_CHART )
{
// #i71254# directly insert a chart instead of drawing its output rectangle
- FuInsertChart(this, pWin, pView, pDoc, rReq);
+ FuInsertChart(this, pWin, pView, &pView->getSdrModelFromSdrView(), rReq);
return;
}
@@ -121,9 +119,9 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
{
const SfxPoolItem* pItem;
if ( pArgs->GetItemState( SID_INSERT_DRAW, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA( SvxDrawToolItem ) )
+ dynamic_cast< const SvxDrawToolItem* >(pItem) )
{
- SvxDrawToolEnum eSel = (SvxDrawToolEnum)((const SvxDrawToolItem*)pItem)->GetValue();
+ SvxDrawToolEnum eSel = (SvxDrawToolEnum)(static_cast< const SvxDrawToolItem* >(pItem))->GetValue();
switch (eSel)
{
case SVX_SNAP_DRAW_SELECT: nNewId = SID_OBJECT_SELECT; break;
@@ -158,16 +156,20 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
{
const SfxPoolItem* pItem;
if ( pArgs->GetItemState( SID_FM_CONTROL_IDENTIFIER, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA( SfxUInt16Item ) )
+ dynamic_cast< const SfxUInt16Item* >(pItem) )
+ {
nNewFormId = ((const SfxUInt16Item*)pItem)->GetValue();
+ }
}
String sStringItemValue;
if ( pArgs )
{
const SfxPoolItem* pItem;
- if ( pArgs->GetItemState( nNewId, sal_True, &pItem ) == SFX_ITEM_SET && pItem->ISA( SfxStringItem ) )
+ if ( pArgs->GetItemState( nNewId, sal_True, &pItem ) == SFX_ITEM_SET && dynamic_cast< const SfxStringItem* >(pItem) )
+ {
sStringItemValue = static_cast<const SfxStringItem*>(pItem)->GetValue();
+ }
}
bool bSwitchCustom = ( sStringItemValue.Len() && sDrawCustom.Len() && sStringItemValue != sDrawCustom );
@@ -224,15 +226,17 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if ( bSelectFirst )
{
// #97016# select first draw object if none is selected yet
- if(!pView->AreObjectsMarked())
+ if(!pView->areSdrObjectsSelected())
{
// select first object
pView->UnmarkAllObj();
- pView->MarkNextObj(sal_True);
+ pView->MarkNextObj(true);
// ...and make it visible
- if(pView->AreObjectsMarked())
- pView->MakeVisible(pView->GetAllMarkedRect(), *pWin);
+ if(pView->areSdrObjectsSelected())
+ {
+ pView->MakeVisibleAtView(pView->getMarkedObjectSnapRange(), *pWin);
+ }
}
}
@@ -246,7 +250,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
SetDrawTextShell( sal_True );
else
{
- if ( bEx || pView->GetMarkedObjectList().GetMarkCount() != 0 )
+ if ( bEx || pView->areSdrObjectsSelected() )
SetDrawShellOrSub();
else
SetDrawShell( sal_False );
@@ -270,20 +274,21 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
{
case SID_OBJECT_SELECT:
//@#70206# Nicht immer zurueckschalten
- if(pView->GetMarkedObjectList().GetMarkCount() == 0) SetDrawShell(bEx);
- pTabView->SetDrawFuncPtr(new FuSelection(this, pWin, pView, pDoc, aNewReq));
+ if(!pView->areSdrObjectsSelected())
+ SetDrawShell(bEx);
+ pTabView->SetDrawFuncPtr(new FuSelection(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
break;
case SID_DRAW_LINE:
case SID_DRAW_RECT:
case SID_DRAW_ELLIPSE:
- pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, aNewReq));
+ pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
break;
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
- pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, aNewReq));
- pView->SetFrameDragSingles( sal_False );
+ pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
+ pView->SetFrameHandles(false);
rBindings.Invalidate( SID_BEZIER_EDIT );
break;
@@ -291,31 +296,31 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
case SID_DRAW_POLYGON_NOFILL:
case SID_DRAW_BEZIER_NOFILL:
case SID_DRAW_FREELINE_NOFILL:
- pTabView->SetDrawFuncPtr(new FuConstPolygon(this, pWin, pView, pDoc, aNewReq));
+ pTabView->SetDrawFuncPtr(new FuConstPolygon(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
break;
case SID_DRAW_ARC:
case SID_DRAW_PIE:
case SID_DRAW_CIRCLECUT:
- pTabView->SetDrawFuncPtr(new FuConstArc(this, pWin, pView, pDoc, aNewReq));
+ pTabView->SetDrawFuncPtr(new FuConstArc(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
break;
case SID_DRAW_TEXT:
case SID_DRAW_TEXT_VERTICAL:
case SID_DRAW_TEXT_MARQUEE:
case SID_DRAW_NOTEEDIT:
- pTabView->SetDrawFuncPtr(new FuText(this, pWin, pView, pDoc, aNewReq));
+ pTabView->SetDrawFuncPtr(new FuText(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
break;
case SID_FM_CREATE_CONTROL:
SetDrawFormShell(sal_True);
- pTabView->SetDrawFuncPtr(new FuConstUnoControl(this, pWin, pView, pDoc, aNewReq));
+ pTabView->SetDrawFuncPtr(new FuConstUnoControl(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
nFormSfxId = nNewFormId;
break;
case SID_DRAW_CHART:
-//UNUSED2008-05 bChartDlgIsEdit = sal_False;
- pTabView->SetDrawFuncPtr(new FuMarkRect(this, pWin, pView, pDoc, aNewReq));
+//UNUSED2008-05 bChartDlgIsEdit = FALSE;
+ pTabView->SetDrawFuncPtr(new FuMarkRect(this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq));
break;
case SID_DRAWTBX_CS_BASIC :
@@ -326,10 +331,10 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
case SID_DRAWTBX_CS_STAR :
case SID_DRAW_CS_ID :
{
- pTabView->SetDrawFuncPtr( new FuConstCustomShape( this, pWin, pView, pDoc, aNewReq ));
+ pTabView->SetDrawFuncPtr( new FuConstCustomShape( this, pWin, pView, &pView->getSdrModelFromSdrView(), aNewReq ));
if ( nNewId != SID_DRAW_CS_ID )
{
- SFX_REQUEST_ARG( rReq, pEnumCommand, SfxStringItem, nNewId, sal_False );
+ SFX_REQUEST_ARG( rReq, pEnumCommand, SfxStringItem, nNewId );
if ( pEnumCommand )
{
aCurrShapeEnumCommand[ nNewId - SID_DRAWTBX_CS_BASIC ] = pEnumCommand->GetValue();
@@ -361,42 +366,36 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
if(pFuActual && (rReq.GetModifier() & KEY_MOD1))
{
- // #98185# Create default drawing objects via keyboard
- const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
- sal_uInt32 nDefaultObjectSizeWidth = rAppOpt.GetDefaultObjectSizeWidth();
- sal_uInt32 nDefaultObjectSizeHeight = rAppOpt.GetDefaultObjectSizeHeight();
-
- // calc position and size
- Rectangle aVisArea = pWin->PixelToLogic(Rectangle(Point(0,0), pWin->GetOutputSizePixel()));
- Point aPagePos = aVisArea.Center();
- aPagePos.X() -= nDefaultObjectSizeWidth / 2;
- aPagePos.Y() -= nDefaultObjectSizeHeight / 2;
- Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
-
ScDrawView* pDrView = GetScDrawView();
if(pDrView)
{
- SdrPageView* pPageView = pDrView->GetSdrPageView();
+ // #98185# Create default drawing objects via keyboard
+ const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
+ const sal_uInt32 nDefaultObjectSizeWidth(rAppOpt.GetDefaultObjectSizeWidth());
+ const sal_uInt32 nDefaultObjectSizeHeight(rAppOpt.GetDefaultObjectSizeHeight());
+
+ // calc position and size
+ const basegfx::B2DRange aVisArea(pWin->GetLogicRange());
+ const basegfx::B2DVector aObjectSize(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight);
+ const basegfx::B2DPoint aObjectPos(aVisArea.getCenter() - (aObjectSize * 0.5));
+ const basegfx::B2DRange aNewObjectRange(aObjectPos, aObjectPos + aObjectSize);
- if(pPageView)
- {
// create the default object
- SdrObject* pObj = pFuActual->CreateDefaultObject(nNewId, aNewObjectRectangle);
+ SdrObject* pObj = pFuActual->CreateDefaultObject(nNewId, aNewObjectRange);
- if(pObj)
- {
- // insert into page
- pView->InsertObjectAtView(pObj, *pPageView);
+ if(pObj)
+ {
+ // insert into page
+ pView->InsertObjectAtView(*pObj);
- if ( nNewId == SID_DRAW_CAPTION || nNewId == SID_DRAW_CAPTION_VERTICAL )
- {
- // #105815# use KeyInput to start edit mode (FuText is created).
- // For FuText objects, edit mode is handled within CreateDefaultObject.
- // KEY_F2 is handled in FuDraw::KeyInput.
+ if ( nNewId == SID_DRAW_CAPTION || nNewId == SID_DRAW_CAPTION_VERTICAL )
+ {
+ // #105815# use KeyInput to start edit mode (FuText is created).
+ // For FuText objects, edit mode is handled within CreateDefaultObject.
+ // KEY_F2 is handled in FuDraw::KeyInput.
- pFuActual->KeyInput( KeyEvent( 0, KeyCode( KEY_F2 ) ) );
- }
+ pFuActual->KeyInput( KeyEvent( 0, KeyCode( KEY_F2 ) ) );
}
}
}
@@ -468,7 +467,6 @@ sal_Bool ScTabViewShell::SelectObject( const String& rName )
return sal_False;
sal_Bool bFound = pView->SelectObject( rName );
- // DrawShell etc. is handled in MarkListHasChanged
return bFound;
}
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index d6ceac8920ac..2f30d5f37073 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -138,11 +138,16 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
// Einfuege-Position
- Point aInsertPos;
+ basegfx::B2DPoint aInsertPos(0.0, 0.0);
if ( pReqArgs->GetItemState(FN_PARAM_1,sal_True,&pItem) == SFX_ITEM_SET )
- aInsertPos = ((const SfxPointItem*)pItem)->GetValue();
+ {
+ const Point aPoint(((const SfxPointItem*)pItem)->GetValue());
+ aInsertPos = basegfx::B2DPoint(aPoint.X(), aPoint.Y());
+ }
else
+ {
aInsertPos = GetInsertPos();
+ }
// als Link?
@@ -800,7 +805,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SCTAB nTab;
SvULongs aIndexList( 4, 4 );
- SFX_REQUEST_ARG( rReq, pItem, SfxIntegerListItem, SID_SELECT_TABLES, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxIntegerListItem, SID_SELECT_TABLES );
if ( pItem )
pItem->GetList( aIndexList );
else
@@ -957,7 +962,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs &&
pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET &&
- pItem->ISA( SfxStringItem ) )
+ dynamic_cast< const SfxStringItem* >(pItem) )
{
String aComment = ((const SfxStringItem*)pItem)->GetValue();
pDocSh->SetChangeComment( pAction, aComment );
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 92a05c51ed87..af2ebfa6c49d 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -143,9 +143,7 @@ void __EXPORT ScTabViewShell::Activate(sal_Bool bMDI)
ScInputHandler* pOldHdl=pWin->GetInputHandler();
- TypeId aScType = TYPE(ScTabViewShell);
-
- SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType );
+ SfxViewShell* pSh = SfxViewShell::GetFirst( _IsSfxViewShell< ScTabViewShell > );
while ( pSh!=NULL && pOldHdl!=NULL)
{
if (((ScTabViewShell*)pSh)->GetInputHandler() == pOldHdl)
@@ -153,7 +151,7 @@ void __EXPORT ScTabViewShell::Activate(sal_Bool bMDI)
pOldHdl->ResetDelayTimer();
break;
}
- pSh = SfxViewShell::GetNext( *pSh, &aScType );
+ pSh = SfxViewShell::GetNext( *pSh, _IsSfxViewShell< ScTabViewShell > );
}
pWin->SetInputHandler( pInputHandler );
@@ -528,7 +526,7 @@ void __EXPORT ScTabViewShell::Move()
//------------------------------------------------------------------
-void __EXPORT ScTabViewShell::ShowCursor(FASTBOOL /* bOn */)
+void __EXPORT ScTabViewShell::ShowCursor(bool /* bOn */)
{
/*!!! ShowCursor wird nicht paarweise wie im gridwin gerufen.
Der CursorLockCount am Gridwin muss hier direkt auf 0 gesetzt werden
@@ -640,7 +638,7 @@ void ScTabViewShell::UpdateDrawShell()
// Remove DrawShell if nothing is selected.
SdrView* pDrView = GetSdrView();
- if ( pDrView && !pDrView->AreObjectsMarked() && !IsDrawSelMode() )
+ if ( pDrView && !pDrView->areSdrObjectsSelected() && !IsDrawSelMode() )
SetDrawShell( sal_False );
}
@@ -1129,7 +1127,7 @@ void ScTabViewShell::SetDrawTextUndo( ::svl::IUndoManager* pNewUndoMgr )
ScTabViewShell* ScTabViewShell::GetActiveViewShell()
{
- return PTR_CAST(ScTabViewShell,Current());
+ return dynamic_cast< ScTabViewShell* >( Current());
}
//------------------------------------------------------------------
@@ -1281,14 +1279,14 @@ sal_Bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
return sal_False;
KeyCode aCode = rKEvt.GetKeyCode();
- sal_Bool bShift = aCode.IsShift();
- sal_Bool bControl = aCode.IsMod1();
- sal_Bool bAlt = aCode.IsMod2();
sal_uInt16 nCode = aCode.GetCode();
- sal_Bool bUsed = sal_False;
- sal_Bool bInPlace = pScMod->IsEditMode(); // Editengine bekommt alles
- sal_Bool bAnyEdit = pScMod->IsInputMode(); // nur Zeichen & Backspace
- sal_Bool bDraw = IsDrawTextEdit();
+ bool bShift = aCode.IsShift();
+ bool bControl = aCode.IsMod1();
+ bool bAlt = aCode.IsMod2();
+ bool bUsed = sal_False;
+ bool bInPlace = pScMod->IsEditMode(); // Editengine bekommt alles
+ bool bAnyEdit = pScMod->IsInputMode(); // nur Zeichen & Backspace
+ bool bDraw = IsDrawTextEdit();
HideNoteMarker(); // Notiz-Anzeige
@@ -1487,7 +1485,7 @@ sal_Bool ScTabViewShell::SfxKeyInput(const KeyEvent& rKeyEvent)
return sal::static_int_cast<sal_Bool>(SfxViewShell::KeyInput( rKeyEvent ));
}
-FASTBOOL __EXPORT ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
+bool __EXPORT ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
{
// return SfxViewShell::KeyInput( rKeyEvent );
return TabKeyInput( rKeyEvent );
@@ -1612,7 +1610,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
pInputHandler = new ScInputHandler;
// Alte Version:
- // if ( !GetViewFrame()->ISA(SfxTopViewFrame) ) // OLE oder Plug-In
+ // if ( !dynamic_cast< SfxTopViewFrame* >(GetViewFrame()) ) // OLE oder Plug-In
// pInputHandler = new ScInputHandler;
// FormShell vor MakeDrawView anlegen, damit die DrawView auf jeden Fall
@@ -1777,9 +1775,10 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
// #106334# old DesignMode state from form layer must be restored, too
sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE;
- if ( pOldSh && pOldSh->ISA( ScPreviewShell ) )
+ ScPreviewShell* pPreviewShell = dynamic_cast< ScPreviewShell* >(pOldSh);
+
+ if ( pPreviewShell )
{
- ScPreviewShell* pPreviewShell = ((ScPreviewShell*)pOldSh);
nForceDesignMode = pPreviewShell->GetSourceDesignMode();
}
@@ -1890,7 +1889,7 @@ void ScTabViewShell::FillFieldData( ScHeaderFieldData& rData )
//------------------------------------------------------------------
-void ScTabViewShell::SetChartArea( const ScRangeListRef& rSource, const Rectangle& rDest )
+void ScTabViewShell::SetChartArea( const ScRangeListRef& rSource, const basegfx::B2DRange& rDest )
{
bChartAreaValid = sal_True;
aChartSource = rSource;
@@ -1903,7 +1902,7 @@ void ScTabViewShell::SetChartArea( const ScRangeListRef& rSource, const Rectangl
//UNUSED2008-05 bChartAreaValid = sal_False;
//UNUSED2008-05 }
-sal_Bool ScTabViewShell::GetChartArea( ScRangeListRef& rSource, Rectangle& rDest, SCTAB& rTab ) const
+sal_Bool ScTabViewShell::GetChartArea( ScRangeListRef& rSource, basegfx::B2DRange& rDest, SCTAB& rTab ) const
{
rSource = aChartSource;
rDest = aChartPos;
diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx
index 7dbb5046ee70..7e6d6ce1829b 100644
--- a/sc/source/ui/view/tabvwsh5.cxx
+++ b/sc/source/ui/view/tabvwsh5.cxx
@@ -54,9 +54,9 @@
void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if (rHint.ISA(SfxSimpleHint)) // ohne Parameter
+ if (dynamic_cast< const SfxSimpleHint* >(&rHint)) // ohne Parameter
{
- sal_uLong nSlot = ((SfxSimpleHint&)rHint).GetId();
+ sal_uLong nSlot = static_cast< const SfxSimpleHint& >(rHint).GetId();
switch ( nSlot )
{
case FID_DATACHANGED:
@@ -143,9 +143,9 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
break;
}
}
- else if (rHint.ISA(ScPaintHint)) // neu zeichnen
+ else if (dynamic_cast< const ScPaintHint* >(&rHint)) // neu zeichnen
{
- ScPaintHint* pHint = (ScPaintHint*) &rHint;
+ const ScPaintHint* pHint = static_cast< const ScPaintHint* >(&rHint);
sal_uInt16 nParts = pHint->GetParts();
SCTAB nTab = GetViewData()->GetTabNo();
if (pHint->GetStartTab() <= nTab && pHint->GetEndTab() >= nTab)
@@ -181,11 +181,11 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
HideNoteMarker();
}
}
- else if (rHint.ISA(ScEditViewHint)) // Edit-View anlegen
+ else if (dynamic_cast< const ScEditViewHint* >(&rHint)) // Edit-View anlegen
{
// ScEditViewHint kommt nur an aktiver View an
- ScEditViewHint* pHint = (ScEditViewHint*) &rHint;
+ const ScEditViewHint* pHint = static_cast< const ScEditViewHint* >(&rHint);
SCTAB nTab = GetViewData()->GetTabNo();
if ( pHint->GetTab() == nTab )
{
@@ -212,12 +212,12 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
}
}
}
- else if (rHint.ISA(ScTablesHint)) // Tabelle eingefuegt / geloescht
+ else if (dynamic_cast< const ScTablesHint* >(&rHint)) // Tabelle eingefuegt / geloescht
{
// aktuelle Tabelle zuerst holen (kann bei DeleteTab an ViewData geaendert werden)
SCTAB nActiveTab = GetViewData()->GetTabNo();
- const ScTablesHint& rTabHint = (const ScTablesHint&)rHint;
+ const ScTablesHint& rTabHint = static_cast< const ScTablesHint& >(rHint);
SCTAB nTab1 = rTabHint.GetTab1();
SCTAB nTab2 = rTabHint.GetTab2();
sal_uInt16 nId = rTabHint.GetId();
@@ -289,9 +289,9 @@ void __EXPORT ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
sal_Bool bForce = !bStayOnActiveTab;
SetTabNo( nNewTab, bForce, sal_False, bStayOnActiveTab );
}
- else if (rHint.ISA(ScIndexHint))
+ else if (dynamic_cast< const ScIndexHint* >(&rHint))
{
- const ScIndexHint& rIndexHint = (const ScIndexHint&)rHint;
+ const ScIndexHint& rIndexHint = static_cast< const ScIndexHint& >(rHint);
sal_uInt16 nId = rIndexHint.GetId();
sal_uInt16 nIndex = rIndexHint.GetIndex();
switch (nId)
diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx
index 658db8d0ae7f..957285111100 100644
--- a/sc/source/ui/view/tabvwsh9.cxx
+++ b/sc/source/ui/view/tabvwsh9.cxx
@@ -28,7 +28,6 @@
// INCLUDE ---------------------------------------------------------------
-#include <svx/svdmark.hxx>
#include <svx/svdview.hxx>
#include <svx/galbrws.hxx>
#include <svx/gallery.hxx>
@@ -127,7 +126,7 @@ void ScTabViewShell::ExecGallery( SfxRequest& rReq )
MakeDrawLayer();
Graphic aGraphic = GalleryGetGraphic();
- Point aPos = GetInsertPos();
+ const basegfx::B2DPoint aPos(GetInsertPos());
String aPath, aFilter;
if ( GalleryIsLinkage() ) // als Link einfuegen?
@@ -192,9 +191,10 @@ void ScTabViewShell::ExecImageMap( SfxRequest& rReq )
SdrView* pDrView = GetSdrView();
if ( pDrView )
{
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- if ( rMarkList.GetMarkCount() == 1 )
- UpdateIMap( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
+ SdrObject* pSelected = pDrView->getSelectedIfSingle();
+
+ if ( pSelected )
+ UpdateIMap( pSelected );
}
}
}
@@ -206,20 +206,19 @@ void ScTabViewShell::ExecImageMap( SfxRequest& rReq )
case SID_IMAP_EXEC:
{
SdrView* pDrView = GetSdrView();
- SdrMark* pMark = pDrView ? pDrView->GetMarkedObjectList().GetMark(0) : 0;
+ SdrObject* pSelected = pDrView ? pDrView->getSelectedIfSingle() : 0;
- if ( pMark )
+ if ( pSelected )
{
- SdrObject* pSdrObj = pMark->GetMarkedSdrObj();
SvxIMapDlg* pDlg = ScGetIMapDlg();
- if ( ScIMapDlgGetObj(pDlg) == (void*) pSdrObj )
+ if ( ScIMapDlgGetObj(pDlg) == (void*) pSelected )
{
const ImageMap& rImageMap = ScIMapDlgGetMap(pDlg);
- ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo( pSdrObj );
+ ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo( pSelected );
if ( !pIMapInfo )
- pSdrObj->InsertUserData( new ScIMapInfo( rImageMap ) );
+ pSelected->InsertUserData( new ScIMapInfo( rImageMap ) );
else
pIMapInfo->SetImageMap( rImageMap );
@@ -266,14 +265,12 @@ void ScTabViewShell::GetImageMapState( SfxItemSet& rSet )
case SID_IMAP_EXEC:
{
sal_Bool bDisable = sal_True;
-
SdrView* pDrView = GetSdrView();
- if ( pDrView )
+ SdrObject* pSelected = pDrView ? pDrView->getSelectedIfSingle() : 0;
+
+ if ( pSelected )
{
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- if ( rMarkList.GetMarkCount() == 1 )
- if ( ScIMapDlgGetObj(ScGetIMapDlg()) ==
- (void*) rMarkList.GetMark(0)->GetMarkedSdrObj() )
+ if ( ScIMapDlgGetObj(ScGetIMapDlg()) == (void*) pSelected )
bDisable = sal_False;
}
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 46b8f9c51bbc..f0830dc0cc82 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -44,7 +44,6 @@
#include <svx/dataaccessdescriptor.hxx>
#include <svx/pfiledlg.hxx>
#include <svx/svditer.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdograf.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdoole2.hxx>
@@ -61,6 +60,7 @@
#include <svl/whiter.hxx>
#include <unotools/moduleoptions.hxx>
#include <sot/exchange.hxx>
+#include <svx/svdlegacy.hxx>
#include <tools/diagnose_ex.h>
#include "tabvwsh.hxx"
@@ -91,8 +91,8 @@ void ScTabViewShell::ConnectObject( SdrOle2Obj* pObj )
SfxInPlaceClient* pClient = FindIPClient( xObj, pWin );
if ( !pClient )
{
- pClient = new ScClient( this, pWin, GetSdrView()->GetModel(), pObj );
- Rectangle aRect = pObj->GetLogicRect();
+ pClient = new ScClient( this, pWin, &GetSdrView()->getSdrModelFromSdrView(), pObj );
+ Rectangle aRect(sdr::legacy::GetLogicRect(*pObj));
Size aDrawSize = aRect.GetSize();
Size aOleSize = pObj->GetOrigObjSize();
@@ -129,21 +129,22 @@ sal_Bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
{
SfxInPlaceClient* pClient = FindIPClient( xObj, pWin );
if ( !pClient )
- pClient = new ScClient( this, pWin, GetSdrView()->GetModel(), pObj );
+ pClient = new ScClient( this, pWin, &GetSdrView()->getSdrModelFromSdrView(), pObj );
if ( !(nErr & ERRCODE_ERROR_MASK) && xObj.is() )
{
- Rectangle aRect = pObj->GetLogicRect();
+ Rectangle aRect(sdr::legacy::GetLogicRect(*pObj));
+ Size aDrawSize = aRect.GetSize();
{
// #i118485# center on BoundRect for activation,
// OLE may be sheared/rotated now
- const Rectangle& rBoundRect = pObj->GetCurrentBoundRect();
- const Point aDelta(rBoundRect.Center() - aRect.Center());
- aRect.Move(aDelta.X(), aDelta.Y());
- }
+ const basegfx::B2DRange& rObjectRange = pObj->getObjectRange(GetSdrView());
- Size aDrawSize = aRect.GetSize();
+ aRect.Move(
+ basegfx::fround(rObjectRange.getCenterX()) - aRect.Center().X(),
+ basegfx::fround(rObjectRange.getCenterY()) - aRect.Center().Y());
+ }
MapMode aMapMode( MAP_100TH_MM );
Size aOleSize = pObj->GetOrigObjSize( &aMapMode );
@@ -224,7 +225,7 @@ sal_Bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb )
// #i118524# refresh handles to suppress for activated OLE
if(GetSdrView())
{
- GetSdrView()->AdjustMarkHdl();
+ GetSdrView()->forceSelectionChange();
}
//! SetDocumentName sollte schon im Sfx passieren ???
//TODO/LATER: how "SetDocumentName"?
@@ -240,20 +241,12 @@ ErrCode __EXPORT ScTabViewShell::DoVerb(long nVerb)
return ERRCODE_SO_NOTIMPL; // soll nicht sein
SdrOle2Obj* pOle2Obj = NULL;
- SdrGrafObj* pGrafObj = NULL;
- SdrObject* pObj = NULL;
- ErrCode nErr = ERRCODE_NONE;
+ SdrObject* pSelected = pView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ if (pSelected)
{
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if (pObj->GetObjIdentifier() == OBJ_OLE2)
- pOle2Obj = (SdrOle2Obj*) pObj;
- else if (pObj->GetObjIdentifier() == OBJ_GRAF)
- {
- pGrafObj = (SdrGrafObj*) pObj;
- }
+ if (pSelected->GetObjIdentifier() == OBJ_OLE2)
+ pOle2Obj = (SdrOle2Obj*) pSelected;
}
if (pOle2Obj)
@@ -265,7 +258,7 @@ ErrCode __EXPORT ScTabViewShell::DoVerb(long nVerb)
DBG_ERROR("kein Objekt fuer Verb gefunden");
}
- return nErr;
+ return ERRCODE_NONE;
}
void ScTabViewShell::DeactivateOle()
@@ -302,23 +295,19 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
ScDrawView* pView = pTabView->GetScDrawView();
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScDocument* pDoc = pDocSh->GetDocument();
-// SdrModel* pDrModel = pDocSh->MakeDrawLayer();
- SdrModel* pDrModel = pView->GetModel();
switch ( nSlot )
{
case SID_INSERT_GRAPHIC:
- FuInsertGraphic(this, pWin, pView, pDrModel, rReq);
- // shell is set in MarkListHasChanged
+ FuInsertGraphic(this, pWin, pView, &pView->getSdrModelFromSdrView(), rReq);
break;
case SID_INSERT_AVMEDIA:
- FuInsertMedia(this, pWin, pView, pDrModel, rReq);
- // shell is set in MarkListHasChanged
+ FuInsertMedia(this, pWin, pView, &pView->getSdrModelFromSdrView(), rReq);
break;
case SID_INSERT_DIAGRAM:
- FuInsertChart(this, pWin, pView, pDrModel, rReq);
+ FuInsertChart(this, pWin, pView, &pView->getSdrModelFromSdrView(), rReq);
//? SC_MOD()->SetFunctionDlg( NULL );//XXX
break;
@@ -328,7 +317,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
case SID_INSERT_VIDEO:
case SID_INSERT_SMATH:
case SID_INSERT_FLOATINGFRAME:
- FuInsertOLE(this, pWin, pView, pDrModel, rReq);
+ FuInsertOLE(this, pWin, pView, &pView->getSdrModelFromSdrView(), rReq);
break;
case SID_OBJECTRESIZE:
@@ -339,28 +328,15 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
if ( pClient && pClient->IsObjectInPlaceActive() )
{
- const SfxRectangleItem& rRect =
- (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE);
+ const SfxRectangleItem& rRect = (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE);
Rectangle aRect( pWin->PixelToLogic( rRect.GetValue() ) );
+ SdrOle2Obj* pSelected = dynamic_cast< SdrOle2Obj* >(pView->getSelectedIfSingle());
- if ( pView->AreObjectsMarked() )
+ if ( pSelected )
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
+ if ( pSelected->GetObjRef().is() )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
-
- if (nSdrObjKind == OBJ_OLE2)
- {
- if ( ( (SdrOle2Obj*) pObj)->GetObjRef().is() )
- {
- pObj->SetLogicRect(aRect);
- }
- }
+ sdr::legacy::SetLogicRect(*pSelected, aRect);
}
}
}
@@ -384,7 +360,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
// #98721#
case SID_FM_CREATE_FIELDCONTROL:
{
- SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
+ SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR );
DBG_ASSERT( pDescriptorItem, "SID_FM_CREATE_FIELDCONTROL: invalid request args!" );
if(pDescriptorItem)
@@ -392,44 +368,52 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
//! merge with ScViewFunc::PasteDataFormat (SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE)?
ScDrawView* pDrView = GetScDrawView();
- SdrPageView* pPageView = pDrView ? pDrView->GetSdrPageView() : NULL;
- if(pPageView)
- {
::svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue());
SdrObject* pNewDBField = pDrView->CreateFieldControl(aDescriptor);
if(pNewDBField)
{
- Rectangle aVisArea = pWin->PixelToLogic(Rectangle(Point(0,0), pWin->GetOutputSizePixel()));
- Point aObjPos(aVisArea.Center());
- Size aObjSize(pNewDBField->GetLogicRect().GetSize());
- aObjPos.X() -= aObjSize.Width() / 2;
- aObjPos.Y() -= aObjSize.Height() / 2;
- Rectangle aNewObjectRectangle(aObjPos, aObjSize);
+ const basegfx::B2DPoint aOldCenter(pNewDBField->getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5));
+ const basegfx::B2DPoint aNewCenter(pWin->GetLogicRange().getCenter());
- pNewDBField->SetLogicRect(aNewObjectRectangle);
+ if(!aOldCenter.equal(aNewCenter))
+ {
+ sdr::legacy::transformSdrObject(
+ *pNewDBField,
+ basegfx::tools::createTranslateB2DHomMatrix(aNewCenter - aOldCenter));
+ }
// controls must be on control layer, groups on front layer
- if ( pNewDBField->ISA(SdrUnoObj) )
- pNewDBField->NbcSetLayer(SC_LAYER_CONTROLS);
- else
- pNewDBField->NbcSetLayer(SC_LAYER_FRONT);
- if (pNewDBField->ISA(SdrObjGroup))
+ if ( dynamic_cast< SdrUnoObj* >(pNewDBField) )
+ {
+ pNewDBField->SetLayer(SC_LAYER_CONTROLS);
+ }
+ else
+ {
+ pNewDBField->SetLayer(SC_LAYER_FRONT);
+ }
+
+ if (dynamic_cast< SdrObjGroup* >(pNewDBField))
{
SdrObjListIter aIter( *pNewDBField, IM_DEEPWITHGROUPS );
SdrObject* pSubObj = aIter.Next();
+
while (pSubObj)
{
- if ( pSubObj->ISA(SdrUnoObj) )
- pSubObj->NbcSetLayer(SC_LAYER_CONTROLS);
+ if ( dynamic_cast< SdrUnoObj* >(pSubObj) )
+ {
+ pSubObj->SetLayer(SC_LAYER_CONTROLS);
+ }
else
- pSubObj->NbcSetLayer(SC_LAYER_FRONT);
+ {
+ pSubObj->SetLayer(SC_LAYER_FRONT);
+ }
+
pSubObj = aIter.Next();
}
}
- pView->InsertObjectAtView(pNewDBField, *pPageView);
- }
+ pView->InsertObjectAtView(*pNewDBField);
}
}
rReq.Done();
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index a7451681312c..a5df77919b01 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -250,7 +250,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
if ( pReqArgs &&
SFX_ITEM_SET == pReqArgs->GetItemState(SID_SEARCH_ITEM, sal_False, &pItem) )
{
- DBG_ASSERT( pItem->ISA(SvxSearchItem), "falsches Item" );
+ DBG_ASSERT( dynamic_cast< const SvxSearchItem* >(pItem), "falsches Item" );
const SvxSearchItem* pSearchItem = (const SvxSearchItem*) pItem;
ScGlobal::SetSearchItem( *pSearchItem );
@@ -265,7 +265,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq )
pReqArgs->GetItemState(SID_SEARCH_ITEM, sal_False, &pItem))
{
// Search-Item merken
- DBG_ASSERT( pItem->ISA(SvxSearchItem), "falsches Item" );
+ DBG_ASSERT( dynamic_cast< const SvxSearchItem* >(pItem), "falsches Item" );
ScGlobal::SetSearchItem( *(const SvxSearchItem*) pItem );
}
else
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index e40d9b6a16b8..a81317f9cdf2 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -375,7 +375,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
if( rReq.IsAPI() )
{
SbxObject* pObj = GetScSbxObject();
- ScSbxTable* pSbxTab = PTR_CAST( ScSbxTable, pObj );
+ ScSbxTable* pSbxTab = dynamic_cast< ScSbxTable* >( pObj );
DBG_ASSERT( pSbxTab, "pSbxTab???" );
if( pSbxTab )
@@ -525,7 +525,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
while ( pSh )
{
- pScSh = PTR_CAST( ScDocShell, pSh );
+ pScSh = dynamic_cast< ScDocShell* >( pSh );
if( pScSh )
{
diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx
index cd45667d2e16..5c5aba78c566 100644
--- a/sc/source/ui/view/tabvwshg.cxx
+++ b/sc/source/ui/view/tabvwshg.cxx
@@ -36,6 +36,7 @@
#include <svx/svdpagv.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
+#include <svx/svdlegacy.hxx>
#include <com/sun/star/form/FormButtonType.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -53,7 +54,7 @@ using namespace com::sun::star;
void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
const String& rTarget,
- const Point* pInsPos )
+ const basegfx::B2DPoint* pInsPos )
{
// Tabelle geschuetzt ?
@@ -68,14 +69,15 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
MakeDrawLayer();
- ScTabView* pView = pViewData->GetView();
+// ScTabView* pView = pViewData->GetView();
// SdrView* pDrView = pView->GetSdrView();
- ScDrawView* pDrView = pView->GetScDrawView();
- SdrModel* pModel = pDrView->GetModel();
+// ScDrawView* pDrView = pView->GetScDrawView();
+// SdrModel* pModel = pDrView->getSdrModelFromSdrView();
- SdrObject* pObj = SdrObjFactory::MakeNewObject(FmFormInventor, OBJ_FM_BUTTON,
- pDrView->GetSdrPageView()->GetPage(), pModel);
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pViewData->GetView()->GetSdrView()->getSdrModelFromSdrView(),
+ SdrObjectCreationInfo(OBJ_FM_BUTTON, FmFormInventor));
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pObj);
uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
DBG_ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
@@ -109,26 +111,24 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL,
xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), aAny );
}
- Point aPos;
+ basegfx::B2DPoint aPos;
+
if (pInsPos)
aPos = *pInsPos;
else
aPos = GetInsertPos();
// Groesse wie in 3.1:
- Size aSize = GetActiveWin()->PixelToLogic(Size(140, 20));
+ const basegfx::B2DVector aScale(GetActiveWin()->GetInverseViewTransformation() * basegfx::B2DVector(140.0, 20.0));
if ( pDoc->IsNegativePage(nTab) )
- aPos.X() -= aSize.Width();
-
- pObj->SetLogicRect(Rectangle(aPos, aSize));
-// pObj->Resize(Point(), Fraction(1, 1), Fraction(1, 1));
-
- // am alten VC-Button musste die Position/Groesse nochmal explizit
- // gesetzt werden - das scheint mit UnoControls nicht noetig zu sein
+ {
+ aPos.setX(aPos.getX() - aScale.getX());
+ }
- // nicht markieren wenn Ole
- pDrView->InsertObjectSafe( pObj, *pDrView->GetSdrPageView() );
+ sdr::legacy::SetLogicRange(*pObj, basegfx::B2DRange(aPos, aPos + aScale));
+ ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
+ pDrView->InsertObjectSafe( *pObj );
}
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index e0ce88cdade6..f305bfc59adf 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -28,7 +28,6 @@
// INCLUDE ---------------------------------------------------------------
-#include <svx/svdmark.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdview.hxx>
#include <sfx2/app.hxx>
@@ -37,6 +36,7 @@
#include <basic/sbxcore.hxx>
#include <svl/whiter.hxx>
#include <vcl/msgbox.hxx>
+#include <svx/svdlegacy.hxx>
#include "tabvwsh.hxx"
#include "client.hxx"
@@ -90,9 +90,10 @@ void ScTabViewShell::ExecuteObject( SfxRequest& rReq )
SdrView* pDrView = GetSdrView();
if (pDrView)
{
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
- aName = ScDrawLayer::GetVisibleName( rMarkList.GetMark(0)->GetMarkedSdrObj() );
+ SdrObject* pSelected = pDrView->getSelectedIfSingle();
+
+ if (pSelected)
+ aName = ScDrawLayer::GetVisibleName( pSelected );
}
pVisibleSh->SelectObject( aName );
@@ -124,24 +125,20 @@ void ScTabViewShell::ExecuteObject( SfxRequest& rReq )
SdrView* pDrView = GetSdrView();
if ( pDrView )
{
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ SdrObject* pSelected = pDrView->getSelectedIfSingle();
+
+ if (pSelected)
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- Rectangle aRect = pObj->GetLogicRect();
+ const basegfx::B2DRange aRange(sdr::legacy::GetLogicRange(*pSelected));
if ( nSlotId == SID_OBJECT_LEFT )
- pDrView->MoveMarkedObj( Size( nNewVal - aRect.Left(), 0 ) );
+ pDrView->MoveMarkedObj( basegfx::B2DVector( nNewVal - aRange.getMinX(), 0 ) );
else if ( nSlotId == SID_OBJECT_TOP )
- pDrView->MoveMarkedObj( Size( 0, nNewVal - aRect.Top() ) );
+ pDrView->MoveMarkedObj( basegfx::B2DVector( 0, nNewVal - aRange.getMinY() ) );
else if ( nSlotId == SID_OBJECT_WIDTH )
- pDrView->ResizeMarkedObj( aRect.TopLeft(),
- Fraction( nNewVal, aRect.GetWidth() ),
- Fraction( 1, 1 ) );
+ pDrView->ResizeMarkedObj( aRange.getMinimum(), basegfx::B2DVector(nNewVal /aRange.getWidth(), 1.0));
else // if ( nSlotId == SID_OBJECT_HEIGHT )
- pDrView->ResizeMarkedObj( aRect.TopLeft(),
- Fraction( 1, 1 ),
- Fraction( nNewVal, aRect.GetHeight() ) );
+ pDrView->ResizeMarkedObj( aRange.getMinimum(), basegfx::B2DVector(1.0, nNewVal / aRange.getHeight()));
bDone = sal_True;
}
}
@@ -159,15 +156,11 @@ uno::Reference < embed::XEmbeddedObject > lcl_GetSelectedObj( SdrView* pDrView )
uno::Reference < embed::XEmbeddedObject > xRet;
if (pDrView)
{
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ SdrOle2Obj* pSelected = dynamic_cast< SdrOle2Obj* >(pDrView->getSelectedIfSingle());
+
+ if (pSelected)
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if (pObj->GetObjIdentifier() == OBJ_OLE2)
- {
- SdrOle2Obj* pOle2Obj = (SdrOle2Obj*) pObj;
- xRet = pOle2Obj->GetObjRef();
- }
+ xRet = pSelected->GetObjRef();
}
}
@@ -203,25 +196,25 @@ void ScTabViewShell::GetObjectState( SfxItemSet& rSet )
SdrView* pDrView = GetSdrView();
if ( pDrView )
{
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ SdrObject* pSelected = pDrView->getSelectedIfSingle();
+
+ if (pSelected)
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- Rectangle aRect = pObj->GetLogicRect();
+ const basegfx::B2DRange aRange(sdr::legacy::GetLogicRange(*pSelected));
- long nVal;
+ double fVal(0.0);
if ( nWhich == SID_OBJECT_LEFT )
- nVal = aRect.Left();
+ fVal = aRange.getMinX();
else if ( nWhich == SID_OBJECT_TOP )
- nVal = aRect.Top();
+ fVal = aRange.getMinY();
else if ( nWhich == SID_OBJECT_WIDTH )
- nVal = aRect.GetWidth();
+ fVal = aRange.getWidth();
else // if ( nWhich == SID_OBJECT_HEIGHT )
- nVal = aRect.GetHeight();
+ fVal = aRange.getHeight();
//! von 1/100mm in irgendwas umrechnen ??????
- rSet.Put( SfxInt32Item( nWhich, nVal ) );
+ rSet.Put( SfxInt32Item( nWhich, basegfx::fround(fVal) ) );
}
}
}
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 8c09eee9cc1a..82a50b14c091 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1161,7 +1161,7 @@ IMPL_LINK( ScViewData, EditEngineHdl, EditStatus *, pStatus )
{
ScSplitPos eWhich = GetActivePart();
if (pEditView[eWhich])
- pEditView[eWhich]->ShowCursor(sal_False);
+ pEditView[eWhich]->ShowCursor(false);
}
}
return 0;
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 9b9f360eb6c1..0b39383b84b4 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2530,13 +2530,15 @@ void ScViewFunc::MoveTable( sal_uInt16 nDestDocNo, SCTAB nDestTab, sal_Bool bCop
SID_OPENDOC, SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON, &aItem, &aTarget, 0L );
if ( pRetItem )
{
- if ( pRetItem->ISA( SfxObjectItem ) )
- pDestShell = PTR_CAST( ScDocShell, ((const SfxObjectItem*)pRetItem)->GetShell() );
- else if ( pRetItem->ISA( SfxViewFrameItem ) )
+ if ( dynamic_cast< const SfxObjectItem* >(pRetItem) )
+ {
+ pDestShell = dynamic_cast< ScDocShell* >( ((const SfxObjectItem*)pRetItem)->GetShell() );
+ }
+ else if ( dynamic_cast< const SfxViewFrameItem* >(pRetItem) )
{
SfxViewFrame* pFrm = ((const SfxViewFrameItem*)pRetItem)->GetFrame();
if (pFrm)
- pDestShell = PTR_CAST( ScDocShell, pFrm->GetObjectShell() );
+ pDestShell = dynamic_cast< ScDocShell* >( pFrm->GetObjectShell() );
}
if (pDestShell)
pDestViewSh = pDestShell->GetBestViewShell();
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 549fa1ac0fb3..f7444ba97b0f 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -176,6 +176,7 @@
#include <tools/urlobj.hxx>
#include <sot/exchange.hxx>
#include <memory>
+#include <basegfx/matrix/b2dhommatrix.hxx>
#include "attrib.hxx"
#include "patattr.hxx"
@@ -570,12 +571,15 @@ void ScViewFunc::PasteDraw()
SCCOL nPosX = pViewData->GetCurX();
SCROW nPosY = pViewData->GetCurY();
Window* pWin = GetActiveWin();
- Point aPos = pWin->PixelToLogic( pViewData->GetScrPos( nPosX, nPosY,
- pViewData->GetActivePart() ) );
ScDrawTransferObj* pDrawClip = ScDrawTransferObj::GetOwnClipboard( pWin );
+
if (pDrawClip)
- PasteDraw( aPos, pDrawClip->GetModel(), sal_False,
- pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+ {
+ const Point aOldPoint(pViewData->GetScrPos(nPosX, nPosY, pViewData->GetActivePart()));
+ const basegfx::B2DPoint aLogicPos(pWin->GetInverseViewTransformation() * basegfx::B2DPoint(aOldPoint.X(), aOldPoint.Y()));
+
+ PasteDraw(aLogicPos, pDrawClip->GetModel(), sal_False, pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID());
+ }
}
void ScViewFunc::PasteFromSystem()
@@ -711,8 +715,10 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
SCCOL nPosX = pViewData->GetCurX();
SCROW nPosY = pViewData->GetCurY();
Window* pWin = GetActiveWin();
- Point aPos = pWin->PixelToLogic( pViewData->GetScrPos( nPosX, nPosY, pViewData->GetActivePart() ) );
- PasteDraw( aPos, pDrawClip->GetModel(), sal_False, pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+ const Point aOldPoint(pViewData->GetScrPos(nPosX, nPosY, pViewData->GetActivePart()));
+ const basegfx::B2DPoint aLogicPos(pWin->GetInverseViewTransformation() * basegfx::B2DPoint(aOldPoint.X(), aOldPoint.Y()));
+
+ PasteDraw(aLogicPos, pDrawClip->GetModel(), sal_False, pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID());
}
else
{
@@ -1393,8 +1399,8 @@ sal_Bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
if ( nFlags & IDF_OBJECTS )
{
ScDrawView* pScDrawView = GetScDrawView();
- SdrModel* pModel = ( pScDrawView ? pScDrawView->GetModel() : NULL );
- pPage = ( pModel ? pModel->GetPage( static_cast< sal_uInt16 >( nStartTab ) ) : NULL );
+ SdrModel* pModel = ( pScDrawView ? &pScDrawView->getSdrModelFromSdrView() : NULL );
+ pPage = ( pModel ? pModel->GetPage( static_cast< sal_uInt32 >( nStartTab ) ) : NULL );
if ( pPage )
{
ScChartHelper::GetChartNames( aExcludedChartNames, pPage );
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index e44aa7d8566b..fefb149ec217 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -621,7 +621,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, sal_Boo
// Pasten von FORMAT_FILE-Items
// wird nicht direkt aus Drop aufgerufen, sondern asynchron -> Dialoge sind erlaubt
-sal_Bool ScViewFunc::PasteFile( const Point& rPos, const String& rFile, sal_Bool bLink )
+sal_Bool ScViewFunc::PasteFile( const basegfx::B2DPoint& rPos, const String& rFile, sal_Bool bLink )
{
INetURLObject aURL;
aURL.SetSmartURL( rFile );
@@ -691,7 +691,7 @@ sal_Bool ScViewFunc::PasteFile( const Point& rPos, const String& rFile, sal_Bool
if (bLink) // bei bLink alles, was nicht Grafik ist, als URL
{
- Rectangle aRect( rPos, Size(0,0) );
+ const Rectangle aRect(Point(basegfx::fround(rPos.getX()), basegfx::fround(rPos.getY())), Size(0,0));
ScRange aRange = GetViewData()->GetDocument()->
GetRange( GetViewData()->GetTabNo(), aRect );
SCCOL nPosX = aRange.aStart.Col();
@@ -719,7 +719,6 @@ sal_Bool ScViewFunc::PasteFile( const Point& rPos, const String& rFile, sal_Bool
return PasteObject( rPos, xObj );
// #105851# If an OLE object can't be created, insert a URL button
-
GetViewData()->GetViewShell()->InsertURLButton( aStrURL, aStrURL, EMPTY_STRING, &rPos );
return sal_True;
}
@@ -822,15 +821,14 @@ sal_Bool ScViewFunc::HasBookmarkAtCursor( SvxHyperlinkItem* pContent )
const SvxFieldItem* pFieldItem = pData->GetField();
if (pFieldItem)
{
- const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField && pField->ISA(SvxURLField) )
+ const SvxURLField* pField = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
+ if ( pField )
{
if (pContent)
{
- const SvxURLField* pURLField = (const SvxURLField*)pField;
- pContent->SetName( pURLField->GetRepresentation() );
- pContent->SetURL( pURLField->GetURL() );
- pContent->SetTargetFrame( pURLField->GetTargetFrame() );
+ pContent->SetName( pField->GetRepresentation() );
+ pContent->SetURL( pField->GetURL() );
+ pContent->SetTargetFrame( pField->GetTargetFrame() );
}
return sal_True;
}
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 91a11910bb41..32f5625b3947 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -51,6 +51,7 @@
#include <svl/stritem.hxx>
#include <svtools/transfer.hxx>
#include <vcl/graph.hxx>
+#include <svx/svdlegacy.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/processfactory.hxx>
@@ -83,14 +84,17 @@ using namespace com::sun::star;
sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
const uno::Reference<datatransfer::XTransferable>& rxTransferable,
- SCCOL nPosX, SCROW nPosY, Point* pLogicPos, sal_Bool bLink, sal_Bool bAllowDialogs )
+ SCCOL nPosX, SCROW nPosY, basegfx::B2DPoint* pLogicPos, sal_Bool bLink, sal_Bool bAllowDialogs )
{
ScDocument* pDoc = GetViewData()->GetDocument();
pDoc->SetPastingDrawFromOtherDoc( sal_True );
- Point aPos; // inserting position (1/100 mm)
+ basegfx::B2DPoint aPos(0.0, 0.0); // inserting position (1/100 mm)
+
if (pLogicPos)
+ {
aPos = *pLogicPos;
+ }
else
{
// inserting position isn't needed for text formats
@@ -107,7 +111,7 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
if (pDoc->IsNegativePage(nTab))
nXT = -nXT;
sal_uLong nYT = pDoc->GetRowHeight( 0, nPosY-1, nTab);
- aPos = Point( (long)(nXT * HMM_PER_TWIPS), (long)(nYT * HMM_PER_TWIPS) );
+ aPos = basegfx::B2DPoint( nXT * HMM_PER_TWIPS, nYT * HMM_PER_TWIPS );
}
}
@@ -200,14 +204,18 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
#endif
// insert replacement image ( if there is one ) into the object helper
+ const basegfx::B2DVector aScale(aObjDesc.maSize.Width(), aObjDesc.maSize.Height());
+
if ( nGrFormat )
{
datatransfer::DataFlavor aDataFlavor;
SotExchange::GetFormatDataFlavor( nGrFormat, aDataFlavor );
- PasteObject( aPos, xObj, &aObjDesc.maSize, &aGraphic, aDataFlavor.MimeType, aObjDesc.mnViewAspect );
+ PasteObject( aPos, xObj, &aScale, &aGraphic, aDataFlavor.MimeType, aObjDesc.mnViewAspect );
}
else
- PasteObject( aPos, xObj, &aObjDesc.maSize );
+ {
+ PasteObject( aPos, xObj, &aScale );
+ }
bRet = sal_True;
}
@@ -274,14 +282,18 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
#endif
// insert replacement image ( if there is one ) into the object helper
+ const basegfx::B2DVector aScale(aObjDesc.maSize.Width(), aObjDesc.maSize.Height());
+
if ( nGrFormat )
{
datatransfer::DataFlavor aDataFlavor;
SotExchange::GetFormatDataFlavor( nGrFormat, aDataFlavor );
- PasteObject( aPos, xObj, &aObjDesc.maSize, &aGraphic, aDataFlavor.MimeType, aObjDesc.mnViewAspect );
+ PasteObject( aPos, xObj, &aScale, &aGraphic, aDataFlavor.MimeType, aObjDesc.mnViewAspect );
}
else
- PasteObject( aPos, xObj, &aObjDesc.maSize );
+ {
+ PasteObject( aPos, xObj, &aScale );
+ }
// let object stay in loaded state after insertion
SdrOle2Obj::Unload( xObj, embed::Aspects::MSOLE_CONTENT );
@@ -421,35 +433,52 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
SdrObject* pObj = pScDrawView->CreateFieldControl( ::svx::OColumnTransferable::extractColumnDescriptor( aDataHelper ) );
if (pObj)
{
- Point aInsPos = aPos;
- Rectangle aRect(pObj->GetLogicRect());
- aInsPos.X() -= aRect.GetSize().Width() / 2;
- aInsPos.Y() -= aRect.GetSize().Height() / 2;
- if ( aInsPos.X() < 0 ) aInsPos.X() = 0;
- if ( aInsPos.Y() < 0 ) aInsPos.Y() = 0;
- aRect.SetPos(aInsPos);
- pObj->SetLogicRect(aRect);
-
- if ( pObj->ISA(SdrUnoObj) )
- pObj->NbcSetLayer(SC_LAYER_CONTROLS);
+ basegfx::B2DRange aRange(sdr::legacy::GetLogicRange(*pObj));
+ basegfx::B2DPoint aInsPos(aPos - (aRange.getRange() * 0.5));
+
+ if(aInsPos.getX() < 0.0)
+ {
+ aInsPos.setX(0.0);
+ }
+
+ if(aInsPos.getY() < 0.0)
+ {
+ aInsPos.setY(0.0);
+ }
+
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aInsPos - aRange.getMinimum()));
+ sdr::legacy::SetLogicRange(*pObj, aRange);
+
+ if ( dynamic_cast< SdrUnoObj* >(pObj) )
+ {
+ pObj->SetLayer(SC_LAYER_CONTROLS);
+ }
else
- pObj->NbcSetLayer(SC_LAYER_FRONT);
- if (pObj->ISA(SdrObjGroup))
+ {
+ pObj->SetLayer(SC_LAYER_FRONT);
+ }
+
+ if (dynamic_cast< SdrObjGroup* >(pObj))
{
SdrObjListIter aIter( *pObj, IM_DEEPWITHGROUPS );
SdrObject* pSubObj = aIter.Next();
+
while (pSubObj)
{
- if ( pSubObj->ISA(SdrUnoObj) )
- pSubObj->NbcSetLayer(SC_LAYER_CONTROLS);
+ if ( dynamic_cast< SdrUnoObj* >(pSubObj) )
+ {
+ pSubObj->SetLayer(SC_LAYER_CONTROLS);
+ }
else
- pSubObj->NbcSetLayer(SC_LAYER_FRONT);
+ {
+ pSubObj->SetLayer(SC_LAYER_FRONT);
+ }
+
pSubObj = aIter.Next();
}
}
- pScDrawView->InsertObjectSafe(pObj, *pScDrawView->GetSdrPageView());
-
+ pScDrawView->InsertObjectSafe(*pObj);
GetViewData()->GetViewShell()->SetDrawShell( sal_True );
bRet = sal_True;
}
@@ -498,19 +527,24 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
SvxDrawingLayerImport( pModel, xInputStream );
// set everything to right layer:
- sal_uLong nObjCount = 0;
- sal_uInt16 nPages = pModel->GetPageCount();
- for (sal_uInt16 i=0; i<nPages; i++)
+ sal_uInt32 nObjCount = 0;
+ const sal_uInt32 nPages(pModel->GetPageCount());
+ for (sal_uInt32 i=0; i<nPages; i++)
{
SdrPage* pPage = pModel->GetPage(i);
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->ISA(SdrUnoObj) )
- pObject->NbcSetLayer(SC_LAYER_CONTROLS);
+ if ( dynamic_cast< SdrUnoObj* >(pObject) )
+ {
+ pObject->SetLayer(SC_LAYER_CONTROLS);
+ }
else
- pObject->NbcSetLayer(SC_LAYER_FRONT);
+ {
+ pObject->SetLayer(SC_LAYER_FRONT);
+ }
+
pObject = aIter.Next();
}
@@ -607,16 +641,13 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
PasteFile( aPos, aFile, bLink );
#if 0
SfxStringItem aNameItem( FID_INSERT_FILE, aFile );
- SfxPointItem aPosItem( FN_PARAM_1, aPos );
+ SfxPointItem aPosItem(FN_PARAM_1, Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())));
SfxDispatcher* pDisp =
GetViewData()->GetViewShell()->GetViewFrame()->GetDispatcher();
if (pDisp)
pDisp->Execute( FID_INSERT_FILE, SFX_CALLMODE_ASYNCHRON,
&aNameItem, &aPosItem, (void*)0 );
#endif
-
- aPos.X() += 400;
- aPos.Y() += 400;
}
bRet = sal_True;
}
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index e6dd158f6435..a73b0318bfa5 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -42,6 +42,7 @@
#include <sfx2/viewfrm.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/embed/Aspects.hpp>
+#include <svx/svdlegacy.hxx>
#include "document.hxx" // fuer MapMode Initialisierung in PasteDraw
#include "viewfunc.hxx"
@@ -56,7 +57,7 @@
#include "docsh.hxx"
#include "convuno.hxx"
-extern Point aDragStartDiff;
+extern basegfx::B2DPoint aDragStartDiff;
// STATIC DATA -----------------------------------------------------------
@@ -66,35 +67,37 @@ using namespace com::sun::star;
//==================================================================
-void lcl_AdjustInsertPos( ScViewData* pData, Point& rPos, Size& rSize )
+void lcl_AdjustInsertPos( ScViewData* pData, basegfx::B2DPoint& rPos, basegfx::B2DVector& rSize )
{
// SdrPage* pPage = pData->GetDocument()->GetDrawLayer()->GetPage( pData->GetTabNo() );
- SdrPage* pPage = pData->GetScDrawView()->GetModel()->GetPage( static_cast<sal_uInt16>(pData->GetTabNo()) );
+ SdrPage* pPage = pData->GetScDrawView()->getSdrModelFromSdrView().GetPage( static_cast< sal_uInt32 >(pData->GetTabNo()) );
DBG_ASSERT(pPage,"pPage ???");
- Size aPgSize( pPage->GetSize() );
- if (aPgSize.Width() < 0)
- aPgSize.Width() = -aPgSize.Width();
- long x = aPgSize.Width() - rPos.X() - rSize.Width();
- long y = aPgSize.Height() - rPos.Y() - rSize.Height();
- // ggf. Ajustments (80/200) fuer Pixel-Rundungsfehler
- if( x < 0 )
- rPos.X() += x + 80;
- if( y < 0 )
- rPos.Y() += y + 200;
- rPos.X() += rSize.Width() / 2; // Position bei Paste gibt Mittelpunkt an
- rPos.Y() += rSize.Height() / 2;
+ const basegfx::B2DVector aPgScale(absolute(pPage->GetPageScale()));
+ basegfx::B2DVector aDelta(aPgScale - rPos - rSize);
+
+ if(aDelta.getX() < 0.0)
+ {
+ rPos.setX(rPos.getX() + aDelta.getX() + 80.0);
+ }
+
+ if(aDelta.getY() < 0.0)
+ {
+ rPos.setY(rPos.getY() + aDelta.getY() + 200.0);
+ }
+
+ rPos += rSize * 0.5;
}
-void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
+void ScViewFunc::PasteDraw( const basegfx::B2DPoint& rLogicPos, SdrModel* pModel,
sal_Bool bGroup, sal_Bool bSameDocClipboard )
{
MakeDrawLayer();
- Point aPos( rLogicPos );
+ basegfx::B2DPoint aPos( rLogicPos );
// #64184# MapMode am Outliner-RefDevice muss stimmen (wie in FuText::MakeOutliner)
//! mit FuText::MakeOutliner zusammenfassen?
MapMode aOldMapMode;
- OutputDevice* pRef = GetViewData()->GetDocument()->GetDrawLayer()->GetRefDevice();
+ OutputDevice* pRef = GetViewData()->GetDocument()->GetDrawLayer()->GetReferenceDevice();
if (pRef)
{
aOldMapMode = pRef->GetMapMode();
@@ -112,44 +115,45 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
pDragEditView = pDrawTrans->GetDragSourceView();
aPos -= aDragStartDiff;
+
if ( bNegativePage )
{
- if (aPos.X() > 0) aPos.X() = 0;
+ if (aPos.getX() > 0.0) aPos.setX(0.0);
}
else
{
- if (aPos.X() < 0) aPos.X() = 0;
+ if (aPos.getX() < 0.0) aPos.setX(0.0);
}
- if (aPos.Y() < 0) aPos.Y() = 0;
+
+ if (aPos.getY() < 0.0) aPos.setY(0.0);
}
ScDrawView* pScDrawView = GetScDrawView();
if (bGroup)
pScDrawView->BegUndo( ScGlobal::GetRscString( STR_UNDO_PASTE ) );
- sal_Bool bSameDoc = ( pDragEditView && pDragEditView->GetModel() == pScDrawView->GetModel() );
+ sal_Bool bSameDoc = ( pDragEditView && &pDragEditView->getSdrModelFromSdrView() == &pScDrawView->getSdrModelFromSdrView() );
if (bSameDoc)
{
// lokal kopieren - incl. Charts
- Point aSourceStart = pDragEditView->GetAllMarkedRect().TopLeft();
- long nDiffX = aPos.X() - aSourceStart.X();
- long nDiffY = aPos.Y() - aSourceStart.Y();
+ const basegfx::B2DPoint aSourceStart(pDragEditView->getMarkedObjectSnapRange().getMinimum());
+ const basegfx::B2DVector aDiff(aPos - aSourceStart);
// innerhalb einer Page verschieben?
- if ( bPasteIsMove &&
- pScDrawView->GetSdrPageView()->GetPage() ==
- pDragEditView->GetSdrPageView()->GetPage() )
+ if ( bPasteIsMove
+ && pScDrawView->GetSdrPageView()
+ && pDragEditView->GetSdrPageView()
+ && &pScDrawView->GetSdrPageView()->getSdrPageFromSdrPageView() == &pDragEditView->GetSdrPageView()->getSdrPageFromSdrPageView() )
{
- if ( nDiffX != 0 || nDiffY != 0 )
- pDragEditView->MoveAllMarked(Size(nDiffX,nDiffY), sal_False);
+ if ( !aDiff.equalZero() )
+ pDragEditView->MoveMarkedObj(aDiff, false);
}
else
{
- SdrModel* pDrawModel = pDragEditView->GetModel();
- SCTAB nTab = GetViewData()->GetTabNo();
- SdrPage* pDestPage = pDrawModel->GetPage( static_cast< sal_uInt16 >( nTab ) );
+ const SCTAB nTab = GetViewData()->GetTabNo();
+ SdrPage* pDestPage = pDragEditView->getSdrModelFromSdrView().GetPage( static_cast<sal_uInt16>(nTab) );
DBG_ASSERT(pDestPage,"nanu, Page?");
::std::vector< ::rtl::OUString > aExcludedChartNames;
@@ -158,29 +162,24 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
ScChartHelper::GetChartNames( aExcludedChartNames, pDestPage );
}
- SdrMarkList aMark = pDragEditView->GetMarkedObjectList();
- aMark.ForceSort();
- sal_uLong nMarkAnz=aMark.GetMarkCount();
- for (sal_uLong nm=0; nm<nMarkAnz; nm++) {
- const SdrMark* pM=aMark.GetMark(nm);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
+ const SdrObjectVector aSelection(pDragEditView->getSelectedSdrObjectVectorFromSdrMarkView());
- // #116235#
- SdrObject* pNeuObj=pObj->Clone();
- //SdrObject* pNeuObj=pObj->Clone(pDestPage,pDrawModel);
+ for (sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pNeuObj = aSelection[nm]->CloneSdrObject(&pDestPage->getSdrModelFromSdrPage());
- if (pNeuObj!=NULL)
+ if (pNeuObj)
{
- pNeuObj->SetModel(pDrawModel);
- pNeuObj->SetPage(pDestPage);
-
// #68787# copy graphics within the same model - always needs new name
- if ( pNeuObj->ISA(SdrGrafObj) && !bPasteIsMove )
- pNeuObj->SetName(((ScDrawLayer*)pDrawModel)->GetNewGraphicName());
-
- if (nDiffX!=0 || nDiffY!=0)
- pNeuObj->NbcMove(Size(nDiffX,nDiffY));
- pDestPage->InsertObject( pNeuObj );
+ if ( dynamic_cast< SdrGrafObj* >(pNeuObj) && !bPasteIsMove )
+ {
+ ScDrawLayer& rScDrawLayer = dynamic_cast< ScDrawLayer& >(pDragEditView->getSdrModelFromSdrView());
+ pNeuObj->SetName(rScDrawLayer.GetNewGraphicName());
+ }
+
+ if ( !aDiff.equalZero())
+ sdr::legacy::transformSdrObject(*pNeuObj, basegfx::tools::createTranslateB2DHomMatrix(aDiff));
+ pDestPage->InsertObjectToSdrObjList(*pNeuObj);
pScDrawView->AddUndo(new SdrUndoInsertObj( *pNeuObj ));
// Chart braucht nicht mehr getrennt behandelt zu werden,
@@ -206,11 +205,12 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
{
bPasteIsMove = sal_False; // kein internes Verschieben passiert
- SdrView aView(pModel); // #i71529# never create a base class of SdrView directly!
- SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
- aView.MarkAllObj(pPv);
- Size aSize = aView.GetAllMarkedRect().GetSize();
- lcl_AdjustInsertPos( GetViewData(), aPos, aSize );
+ OSL_ENSURE(pModel, "ScViewFunc::PasteDraw without SdrModel (!)");
+ SdrView aView(*pModel); // #i71529# never create a base class of SdrView directly!
+ aView.ShowSdrPage(*aView.getSdrModelFromSdrView().GetPage(0));
+ aView.MarkAllObj();
+ basegfx::B2DVector aScale(aView.getMarkedObjectSnapRange().getRange());
+ lcl_AdjustInsertPos( GetViewData(), aPos, aScale );
// #41333# Markierung nicht aendern, wenn Ole-Objekt aktiv
// (bei Drop aus Ole-Objekt wuerde sonst mitten im ExecuteDrag deaktiviert!)
@@ -221,8 +221,8 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
nOptions |= SDRINSERT_DONTMARK;
::std::vector< ::rtl::OUString > aExcludedChartNames;
- SCTAB nTab = GetViewData()->GetTabNo();
- SdrPage* pPage = pScDrawView->GetModel()->GetPage( static_cast< sal_uInt16 >( nTab ) );
+ const SCTAB nTab = GetViewData()->GetTabNo();
+ SdrPage* pPage = pScDrawView->getSdrModelFromSdrView().GetPage(static_cast<sal_uInt16>(nTab));
DBG_ASSERT( pPage, "Page?" );
if ( pPage )
{
@@ -247,8 +247,11 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
SdrObject* pObject = aIter.Next();
while (pObject)
{
- if ( pObject->ISA(SdrUnoObj) && pObject->GetLayer() != SC_LAYER_CONTROLS )
- pObject->NbcSetLayer(SC_LAYER_CONTROLS);
+ if ( dynamic_cast< SdrUnoObj* >(pObject) && pObject->GetLayer() != SC_LAYER_CONTROLS )
+ {
+ pObject->SetLayer(SC_LAYER_CONTROLS);
+ }
+
pObject = aIter.Next();
}
}
@@ -277,18 +280,10 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
if (pRef)
pRef->SetMapMode( aOldMapMode );
-
- // GetViewData()->GetViewShell()->SetDrawShell( sal_True );
- // #99759# It is not sufficient to just set the DrawShell if we pasted, for
- // example, a chart. SetDrawShellOrSub() would only work for D&D in the
- // same document but not if inserting from the clipboard, therefore
- // MarkListHasChanged() is what we need.
- pScDrawView->MarkListHasChanged();
-
}
-sal_Bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::XEmbeddedObject >& xObj,
- const Size* pDescSize, const Graphic* pReplGraph, const ::rtl::OUString& aMediaType, sal_Int64 nAspect )
+sal_Bool ScViewFunc::PasteObject( const basegfx::B2DPoint& rPos, const uno::Reference < embed::XEmbeddedObject >& xObj,
+ const basegfx::B2DVector* pDescSize, const Graphic* pReplGraph, const ::rtl::OUString& aMediaType, sal_Int64 nAspect )
{
MakeDrawLayer();
if ( xObj.is() )
@@ -305,11 +300,14 @@ sal_Bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embe
if ( pReplGraph )
aObjRef.SetGraphic( *pReplGraph, aMediaType );
- Size aSize;
+ basegfx::B2DVector aScale(1.0, 1.0);
+
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
MapMode aMapMode( MAP_100TH_MM );
- aSize = aObjRef.GetSize( &aMapMode );
+ const Size aOldSize(aObjRef.GetSize(&aMapMode));
+
+ aScale = basegfx::B2DVector(aOldSize.Width(), aOldSize.Height());
}
else
{
@@ -317,17 +315,21 @@ sal_Bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embe
MapUnit aMapObj = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
MapUnit aMap100 = MAP_100TH_MM;
- if ( pDescSize && pDescSize->Width() && pDescSize->Height() )
+ if(pDescSize && !pDescSize->equalZero())
{
// use size from object descriptor if given
- aSize = OutputDevice::LogicToLogic( *pDescSize, aMap100, aMapObj );
+ aScale = *pDescSize * OutputDevice::GetFactorLogicToLogic(aMap100, aMapObj);
+
awt::Size aSz;
- aSz.Width = aSize.Width();
- aSz.Height = aSize.Height();
+
+ aSz.Width = basegfx::fround(aScale.getX());
+ aSz.Height = basegfx::fround(aScale.getY());
+
xObj->setVisualAreaSize( nAspect, aSz );
}
awt::Size aSz;
+
try
{
aSz = xObj->getVisualAreaSize( nAspect );
@@ -337,32 +339,39 @@ sal_Bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embe
// the default size will be set later
}
- aSize = Size( aSz.Width, aSz.Height );
- aSize = OutputDevice::LogicToLogic( aSize, aMapObj, aMap100 ); // fuer SdrOle2Obj
+ aScale = basegfx::B2DVector( aSz.Width, aSz.Height );
+ aScale *= OutputDevice::GetFactorLogicToLogic(aMapObj, aMap100); // fuer SdrOle2Obj
- if( aSize.Height() == 0 || aSize.Width() == 0 )
+ if(basegfx::fTools::equalZero(aScale.getY()) || basegfx::fTools::equalZero(aScale.getX()))
{
DBG_ERROR("SvObjectDescriptor::GetSize == 0");
- aSize.Width() = 5000;
- aSize.Height() = 5000;
- aSize = OutputDevice::LogicToLogic( aSize, aMap100, aMapObj );
- aSz.Width = aSize.Width();
- aSz.Height = aSize.Height();
+ aScale.setX(5000.0);
+ aScale.setY(5000.0);
+ aScale *= OutputDevice::GetFactorLogicToLogic(aMap100, aMapObj);
+ aSz.Width = basegfx::fround(aScale.getX());
+ aSz.Height = basegfx::fround(aScale.getY());
xObj->setVisualAreaSize( nAspect, aSz );
}
}
// don't call AdjustInsertPos
- Point aInsPos = rPos;
+ basegfx::B2DPoint aInsPos(rPos);
+
if ( GetViewData()->GetDocument()->IsNegativePage( GetViewData()->GetTabNo() ) )
- aInsPos.X() -= aSize.Width();
- Rectangle aRect( aInsPos, aSize );
+ {
+ aInsPos.setX(aInsPos.getX() - aScale.getX());
+ }
ScDrawView* pDrView = GetScDrawView();
- SdrOle2Obj* pSdrObj = new SdrOle2Obj( aObjRef, aName, aRect );
-
- SdrPageView* pPV = pDrView->GetSdrPageView();
- pDrView->InsertObjectSafe( pSdrObj, *pPV ); // nicht markieren wenn Ole
+ SdrOle2Obj* pSdrObj = new SdrOle2Obj(
+ pDrView->getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aInsPos));
+
+ pDrView->InsertObjectSafe( *pSdrObj );
GetViewData()->GetViewShell()->SetDrawShell( sal_True );
return sal_True;
}
@@ -370,27 +379,27 @@ sal_Bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embe
return sal_False;
}
-sal_Bool ScViewFunc::PasteBitmap( const Point& rPos, const Bitmap& rBmp )
+sal_Bool ScViewFunc::PasteBitmap( const basegfx::B2DPoint& rPos, const Bitmap& rBmp )
{
String aEmpty;
Graphic aGraphic(rBmp);
return PasteGraphic( rPos, aGraphic, aEmpty, aEmpty );
}
-sal_Bool ScViewFunc::PasteMetaFile( const Point& rPos, const GDIMetaFile& rMtf )
+sal_Bool ScViewFunc::PasteMetaFile( const basegfx::B2DPoint& rPos, const GDIMetaFile& rMtf )
{
String aEmpty;
Graphic aGraphic(rMtf);
return PasteGraphic( rPos, aGraphic, aEmpty, aEmpty );
}
-sal_Bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
+sal_Bool ScViewFunc::PasteGraphic( const basegfx::B2DPoint& rPos, const Graphic& rGraphic,
const String& rFile, const String& rFilter )
{
MakeDrawLayer();
ScDrawView* pScDrawView = GetScDrawView();
- Point aPos( rPos );
+ basegfx::B2DPoint aPos( rPos );
Window* pWin = GetActiveWin();
MapMode aSourceMap = rGraphic.GetPrefMapMode();
MapMode aDestMap( MAP_100TH_MM );
@@ -405,26 +414,34 @@ sal_Bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
aDestMap.SetScaleY(aScaleY);
}
- Size aSize = pWin->LogicToLogic( rGraphic.GetPrefSize(), &aSourceMap, &aDestMap );
+ const basegfx::B2DHomMatrix aTransSourceMap2DestMap(pWin->GetTransformLogicToLogic(aSourceMap, aDestMap));
+ const basegfx::B2DVector aScale(aTransSourceMap2DestMap * basegfx::B2DVector(rGraphic.GetPrefSize().Width(), rGraphic.GetPrefSize().Height()));
+
// lcl_AdjustInsertPos( GetViewData(), aPos, aSize );
if ( GetViewData()->GetDocument()->IsNegativePage( GetViewData()->GetTabNo() ) )
- aPos.X() -= aSize.Width();
+ {
+ aPos.setX(aPos.getX() - aScale.getX());
+ }
GetViewData()->GetViewShell()->SetDrawShell( sal_True );
- Rectangle aRect(aPos, aSize);
- SdrGrafObj* pGrafObj = new SdrGrafObj(rGraphic, aRect);
+ SdrGrafObj* pGrafObj = new SdrGrafObj(
+ pScDrawView->getSdrModelFromSdrView(),
+ rGraphic,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aPos));
// #118522# calling SetGraphicLink here doesn't work
// #49961# Pfad wird nicht mehr als Name der Grafik gesetzt
- ScDrawLayer* pLayer = (ScDrawLayer*) pScDrawView->GetModel();
- String aName = pLayer->GetNewGraphicName(); // "Grafik x"
+ ScDrawLayer& rLayer = dynamic_cast< ScDrawLayer& >(pScDrawView->getSdrModelFromSdrView());
+ String aName = rLayer.GetNewGraphicName(); // "Grafik x"
pGrafObj->SetName(aName);
// nicht markieren wenn Ole
- pScDrawView->InsertObjectSafe(pGrafObj, *pScDrawView->GetSdrPageView());
+ pScDrawView->InsertObjectSafe(*pGrafObj);
// #118522# SetGraphicLink has to be used after inserting the object,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
@@ -446,29 +463,28 @@ sal_Bool ScViewFunc::ApplyGraphicToObject( SdrObject* pPickObj, const Graphic& r
/**********************************************************************
* Objekt neu attributieren
**********************************************************************/
- SdrPageView* pPV = pScDrawView->GetSdrPageView();
- if (pPickObj->ISA(SdrGrafObj))
+ if (dynamic_cast< SdrGrafObj* >(pPickObj))
{
/******************************************************************
* Das Graphik-Objekt bekommt eine neue Graphik
******************************************************************/
- pNewGrafObj = (SdrGrafObj*) pPickObj->Clone();
+ pNewGrafObj = static_cast< SdrGrafObj* >(pPickObj->CloneSdrObject());
pNewGrafObj->SetGraphic(rGraphic);
pScDrawView->BegUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP));
- pScDrawView->ReplaceObjectAtView(pPickObj, *pPV, pNewGrafObj);
+ pScDrawView->ReplaceObjectAtView(*pPickObj, *pNewGrafObj);
pScDrawView->EndUndo();
bRet = sal_True;
}
- else if (pPickObj->IsClosedObj() && !pPickObj->ISA(SdrOle2Obj))
+ else if (pPickObj->IsClosedObj() && !dynamic_cast< SdrOle2Obj* >(pPickObj))
{
/******************************************************************
* Das Objekt wird mit der Graphik gefuellt
******************************************************************/
pScDrawView->AddUndo(new SdrUndoAttrObj(*pPickObj));
- SfxItemSet aSet( pScDrawView->GetModel()->GetItemPool(),
+ SfxItemSet aSet( pScDrawView->getSdrModelFromSdrView().GetItemPool(),
XATTR_FILLSTYLE, XATTR_FILLBITMAP );
aSet.Put(XFillStyleItem(XFILL_BITMAP));
aSet.Put(XFillBitmapItem(String(), rGraphic));
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 540cfc9b15f5..6115c73baf8c 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -91,7 +91,7 @@ sal_uInt16 ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos )
sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE :
( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : ATTR_FONT_LANGUAGE );
const SfxPoolItem* pItem = pDoc->GetAttr( rPos.Col(), rPos.Row(), rPos.Tab(), nWhich);
- SvxLanguageItem* pLangIt = PTR_CAST( SvxLanguageItem, pItem );
+ const SvxLanguageItem* pLangIt = dynamic_cast< const SvxLanguageItem* >( pItem );
LanguageType eLnge;
if (pLangIt)
{
@@ -374,8 +374,8 @@ sal_Bool ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont,
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( &rFrame.GetWindow(), aSet, rFrame.GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
if ( pDlg->Execute() == RET_OK )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT );
if ( pItem )
rString = pItem->GetValue();
if ( pFontItem )
diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx
index 15d68ca2974d..4b3a90dbbf0b 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -97,7 +97,7 @@ namespace basprov
// not interested in
return;
}
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
if ( pSimpleHint && ( pSimpleHint->GetId() == SFX_HINT_DYING ) )
{
m_documentBasicManager = NULL;
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index cfb9d3a1ca2b..d825bd8bc9c4 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -30,14 +30,11 @@
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/util/XChangesListener.hpp>
#include <tools/string.hxx>
-
#include <boost/shared_ptr.hpp>
-
#include <comphelper/stl_types.hxx>
#include <vcl/timer.hxx>
-
+#include <svx/svdmodel.hxx>
#include <sddllapi.h>
-
#include <list>
#include <map>
@@ -181,7 +178,7 @@ public:
static sal_Int32 get_node_type( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
static sal_Int32 getNumberOfSubitems( const ::com::sun::star::uno::Any& aTarget, sal_Int16 nIterateType );
- SdrPathObj* createSdrPathObjFromPath();
+ SdrPathObj* createSdrPathObjFromPath(SdrModel& rTargetModel);
void updateSdrPathObjFromPath( SdrPathObj& rPathObj );
void updatePathFromSdrPathObj( const SdrPathObj& rPathObj );
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index fb5c939e8fdc..967371b895cb 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -163,7 +163,7 @@ public:
/** Starts the text conversion (hangul/hanja or Chinese simplified/traditional)
for the current viewshell */
void StartConversion( sal_Int16 nSourceLanguage, sal_Int16 nTargetLanguage,
- const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive );
+ const Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
/** This is called internaly when text conversion is started.
The position of current view mode/page/object/caret position
@@ -229,18 +229,18 @@ private:
/// Number of objects on the current page / in the current selection.
sal_Int32 mnObjectCount;
- /** A <TRUE/> value indicates that the end of the find&replace or spell
+ /** A <true/> value indicates that the end of the find&replace or spell
check has been reached.
*/
bool mbEndOfSearch;
- /** Set to <TRUE/> when an object has been prepared successfully for
+ /** Set to <true/> when an object has been prepared successfully for
searching/spell checking. This flag directs the internal iteration
which stops when set to </sal_True>.
*/
bool mbFoundObject;
- /** When set to <TRUE/> this flag indicates that an error has occured
+ /** When set to <true/> this flag indicates that an error has occured
that should terminate the iteration over the objects to search/spell
check.
*/
@@ -260,7 +260,7 @@ private:
selection. This copy is necessary because during the search
process the mark list is modified.
*/
- ::std::vector<SdrObjectWeakRef> maMarkListCopy;
+ SdrObjectVector maMarkListCopy;
/** This flag inidcates that only the current view is to be used for
searching and spelling. Automatically switching to other view does
@@ -382,7 +382,7 @@ private:
/** Detect whether the selection has changed.
@return
- Return <TRUE/> when the selection has been changed since the
+ Return <true/> when the selection has been changed since the
last call to this method.
*/
bool DetectSelectionChange (void);
@@ -437,7 +437,7 @@ private:
/** Prepare to do spell checking on the current text object. This
includes putting it into edit mode. Under certain conditions this
- method sets <member>mbEndOfSearch</member> to <TRUE/>.
+ method sets <member>mbEndOfSearch</member> to <true/>.
*/
void PrepareSpellCheck (void);
@@ -470,7 +470,7 @@ private:
/** Switch on edit mode for the currently selected text object.
*/
- void EnterEditMode (sal_Bool bGrabFocus=sal_True);
+ void EnterEditMode (bool bGrabFocus=true);
/** Return the position at which a new search is started with respect to
the search direction as specified by the argument.
@@ -530,9 +530,9 @@ private:
When the outline view is active then this method is called
after a wrap arround to continue at the beginning of the document.
@return
- Returns <TRUE/> to indicate that another call to this method is
+ Returns <true/> to indicate that another call to this method is
required. When all text objects have been processed then
- <FALSE/> is returned.
+ <false/> is returned.
*/
virtual sal_Bool SpellNextDocument (void);
diff --git a/sd/inc/OutlinerIterator.hxx b/sd/inc/OutlinerIterator.hxx
index d503f586c655..a2c2f20b1a63 100644
--- a/sd/inc/OutlinerIterator.hxx
+++ b/sd/inc/OutlinerIterator.hxx
@@ -144,7 +144,7 @@ public:
@param rIterator
The iterator to test equality with.
@return
- Returns <TRUE/> when both iterators point to the same object.
+ Returns <true/> when both iterators point to the same object.
*/
bool operator== (const Iterator& rIterator);
/** Test whether two iterators point to different objects. This is just
@@ -152,7 +152,7 @@ public:
@param rIterator
The iterator to test inequality with.
@return
- Returns <TRUE/> when both iterators point to the different objects.
+ Returns <true/> when both iterators point to the different objects.
*/
bool operator!= (const Iterator& rIterator);
/** Reverse the direction of iteration. The position of the iterator is
@@ -251,7 +251,7 @@ private:
This specifies at which object the iterator points initially.
*/
Iterator CreateSelectionIterator (
- const ::std::vector<SdrObjectWeakRef>& rObjectList,
+ const SdrObjectVector& rObjectList,
SdDrawDocument* pDocument,
const ::boost::shared_ptr<ViewShell>& rpViewShell,
bool bDirectionIsForward=true,
@@ -339,7 +339,7 @@ public:
IteratorPosition& operator= (const IteratorPosition& aPosition);
/** Compare two positions for equality.
@return
- <TRUE/> is returned only when all data members have the same
+ <true/> is returned only when all data members have the same
values in both position objects.
*/
bool operator== (const IteratorPosition& aPosition) const;
diff --git a/sd/inc/anminfo.hxx b/sd/inc/anminfo.hxx
index 6a8ca54d231d..a1249f84091e 100644
--- a/sd/inc/anminfo.hxx
+++ b/sd/inc/anminfo.hxx
@@ -50,22 +50,22 @@ public:
::com::sun::star::presentation::AnimationEffect meEffect; // Animationseffekt
::com::sun::star::presentation::AnimationEffect meTextEffect; // Animationseffekt fuer Textinhalt
::com::sun::star::presentation::AnimationSpeed meSpeed; // Geschwindigkeit der Animation
- sal_Bool mbActive; // eingeschaltet ?
- sal_Bool mbDimPrevious; // Objekt abblenden
- sal_Bool mbIsMovie; // wenn Gruppenobjekt, dann Sequenz aus den
- sal_Bool mbDimHide; // verstecken statt abblenden
+ bool mbActive; // eingeschaltet ?
+ bool mbDimPrevious; // Objekt abblenden
+ bool mbIsMovie; // wenn Gruppenobjekt, dann Sequenz aus den
+ bool mbDimHide; // verstecken statt abblenden
Color maBlueScreen; // identifiziert "Hintergrundpixel"
Color maDimColor; // zum Abblenden des Objekts
String maSoundFile; // Pfad zum Soundfile in MSDOS-Notation
- sal_Bool mbSoundOn; // Sound ein/aus
- sal_Bool mbPlayFull; // Sound ganz abspielen
+ bool mbSoundOn; // Sound ein/aus
+ bool mbPlayFull; // Sound ganz abspielen
SdrPathObj* mpPathObj; // das Pfadobjekt
::com::sun::star::presentation::ClickAction meClickAction; // Aktion bei Mausklick
::com::sun::star::presentation::AnimationEffect meSecondEffect; // fuer Objekt ausblenden
::com::sun::star::presentation::AnimationSpeed meSecondSpeed; // fuer Objekt ausblenden
String maSecondSoundFile; // fuer Objekt ausblenden
- sal_Bool mbSecondSoundOn; // fuer Objekt ausblenden
- sal_Bool mbSecondPlayFull;// fuer Objekt ausblenden
+ bool mbSecondSoundOn; // fuer Objekt ausblenden
+ bool mbSecondPlayFull;// fuer Objekt ausblenden
// String maBookmark; // Sprung zu Objekt/Seite
sal_uInt16 mnVerb; // fuer OLE-Objekt
sal_uLong mnPresOrder;
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index d56ae23cc107..6e5857d05383 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -167,8 +167,8 @@ private:
List* mpCustomShowList;
::sd::DrawDocShell* mpDocSh;
SdTransferable * mpCreatingTransferable;
- sal_Bool mbHasOnlineSpellErrors;
- sal_Bool mbInitialOnlineSpellingEnabled;
+ bool mbHasOnlineSpellErrors;
+ bool mbInitialOnlineSpellingEnabled;
String maBookmarkFile;
::sd::DrawDocShellRef mxBookmarkDocShRef;
@@ -176,17 +176,17 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 > mxPresentation;
- sal_Bool mbNewOrLoadCompleted;
+ bool mbNewOrLoadCompleted;
- sal_Bool mbOnlineSpell;
- sal_Bool mbSummationOfParagraphs;
+ bool mbOnlineSpell;
+ bool mbSummationOfParagraphs;
bool mbStartWithPresentation; // is set to true when starting with command line parameter -start
LanguageType meLanguage;
LanguageType meLanguageCJK;
LanguageType meLanguageCTL;
SvxNumType mePageNumType;
::sd::DrawDocShellRef mxAllocedDocShRef; // => AllocModel()
- sal_Bool mbAllocDocSh; // => AllocModel()
+ bool mbAllocDocSh; // => AllocModel()
DocumentType meDocType;
CharClass* mpCharClass;
::com::sun::star::lang::Locale* mpLocale;
@@ -195,10 +195,10 @@ private:
::std::auto_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher;
::std::auto_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher;
- void UpdatePageObjectsInNotes(sal_uInt16 nStartPos);
- void UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement);
+ void UpdatePageObjectsInNotes(sal_uInt32 nStartPos);
+ void UpdatePageRelativeURLs(SdPage* pPage, sal_uInt32 nPos, sal_Int32 nIncrement);
void FillOnlineSpellingList(SdPage* pPage);
- void SpellObject(SdrTextObj* pObj);
+ void SpellObject(const SdrTextObj* pObj);
DECL_LINK(WorkStartupHdl, Timer*);
DECL_LINK(OnlineSpellingHdl, Timer*);
@@ -214,23 +214,21 @@ public:
class InsertBookmarkAsPage_PageFunctorBase;
- TYPEINFO();
-
SdDrawDocument(DocumentType eType, SfxObjectShell* pDocSh);
~SdDrawDocument();
virtual SdrModel* AllocModel() const;
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual SdrPage* AllocPage(bool bMasterPage);
virtual const SdrModel* LoadModel(const String& rFileName);
virtual void DisposeLoadedModels();
- virtual FASTBOOL IsReadOnly() const;
- virtual void SetChanged(sal_Bool bFlag = sal_True);
+ virtual bool IsReadOnly() const;
+ virtual void SetChanged(bool bFlag = true);
virtual SvStream* GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const;
- SfxItemPool& GetPool() { return( *pItemPool ); }
+// SfxItemPool& GetPool() { return( *pItemPool ); }
- ::sd::Outliner* GetOutliner(sal_Bool bCreateOutliner=sal_True);
- SD_DLLPUBLIC ::sd::Outliner* GetInternalOutliner(sal_Bool bCreateOutliner=sal_True);
+ ::sd::Outliner* GetOutliner(bool bCreateOutliner = true);
+ SD_DLLPUBLIC ::sd::Outliner* GetInternalOutliner(bool bCreateOutliner = true);
::sd::DrawDocShell* GetDocSh() const { return mpDocSh; }
@@ -239,11 +237,11 @@ public:
SvxNumType GetPageNumType() const;
void SetPageNumType(SvxNumType eType) { mePageNumType = eType; }
- SD_DLLPUBLIC String CreatePageNumValue(sal_uInt16 nNum) const;
+ SD_DLLPUBLIC String CreatePageNumValue(sal_uInt32 nNum) const;
DocumentType GetDocumentType() const { return meDocType; }
- void SetAllocDocSh(sal_Bool bAlloc);
+ void SetAllocDocSh(bool bAlloc);
void CreatingDataObj( SdTransferable* pTransferable ) { mpCreatingTransferable = pTransferable; }
@@ -253,26 +251,23 @@ public:
for newly created slides.
*/
SD_DLLPUBLIC void CreateFirstPages( SdDrawDocument* pRefDocument = 0 );
- SD_DLLPUBLIC sal_Bool CreateMissingNotesAndHandoutPages();
+ SD_DLLPUBLIC bool CreateMissingNotesAndHandoutPages();
- void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
- void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
- void DeletePage(sal_uInt16 nPgNum);
- SdrPage* RemovePage(sal_uInt16 nPgNum);
+ void MovePage(sal_uInt32 nPgNum, sal_uInt32 nNewPos);
+ void InsertPage(SdrPage* pPage, sal_uInt32 nPos = SDRPAGE_NOTFOUND);
+ void DeletePage(sal_uInt32 nPgNum);
+ SdrPage* RemovePage(sal_uInt32 nPgNum);
- virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
- virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
+ virtual void InsertMasterPage(SdrPage* pPage, sal_uInt32 nPos = SDRPAGE_NOTFOUND);
+ virtual SdrPage* RemoveMasterPage(sal_uInt32 nPgNum);
- void RemoveUnnecessaryMasterPages( SdPage* pMaster=NULL, sal_Bool bOnlyDuplicatePages=sal_False, sal_Bool bUndo=sal_True );
- SD_DLLPUBLIC void SetMasterPage(sal_uInt16 nSdPageNum, const String& rLayoutName,
- SdDrawDocument* pSourceDoc, sal_Bool bMaster, sal_Bool bCheckMasters);
+ void RemoveUnnecessaryMasterPages( SdPage* pMaster=NULL, bool bOnlyDuplicatePages = false, bool bUndo = true);
+ SD_DLLPUBLIC void SetMasterPage(sal_uInt32 nSdPageNum, const String& rLayoutName, SdDrawDocument* pSourceDoc, bool bMaster, bool bCheckMasters);
SD_DLLPUBLIC SdDrawDocument* OpenBookmarkDoc(const String& rBookmarkFile);
SdDrawDocument* OpenBookmarkDoc(SfxMedium& rMedium);
- sal_Bool InsertBookmark(List* pBookmarkList, List* pExchangeList, sal_Bool bLink,
- sal_Bool bReplace, sal_uInt16 nPgPos, sal_Bool bNoDialogs,
- ::sd::DrawDocShell* pBookmarkDocSh, sal_Bool bCopy,
- Point* pObjPos);
+ bool InsertBookmark(List* pBookmarkList, List* pExchangeList, bool bLink, bool bReplace, sal_uInt32 nPgPos,
+ bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh, bool bCopy, basegfx::B2DPoint* pObjPos);
bool IsStartWithPresentation() const;
void SetStartWithPresentation( bool bStartWithPresentation );
@@ -322,16 +317,13 @@ public:
Whether the replace operation should take the name from the new
page, or preserve the old name
*/
- sal_Bool InsertBookmarkAsPage(List* pBookmarkList, List* pExchangeList,
- sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos,
- sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
- sal_Bool bCopy, sal_Bool bMergeMasterPages,
- sal_Bool bPreservePageNames);
- sal_Bool InsertBookmarkAsObject(List* pBookmarkList, List* pExchangeListL,
- sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
- Point* pObjPos);
+ bool InsertBookmarkAsPage(List* pBookmarkList, List* pExchangeList, bool bLink, bool bReplace, sal_uInt32 nPgPos,
+ bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh, bool bCopy, bool bMergeMasterPages, bool bPreservePageNames);
+
+ bool InsertBookmarkAsObject(List* pBookmarkList, List* pExchangeListL, bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
+ basegfx::B2DPoint* pObjPos);
void IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList,
- sal_uInt16 nBMSdPageCount,
+ sal_uInt32 nBMSdPageCount,
InsertBookmarkAsPage_PageFunctorBase& rPageIterator );
SD_DLLPUBLIC void CloseBookmarkDoc();
@@ -344,31 +336,31 @@ public:
Name of the page to return.
@param rbIsMasterPage
Is set by the method to indicate whether the returned index
- belongs to a master page (<TRUE/>) or a regular or notes page
- (<FALSE/>). The given value is ignored.
+ belongs to a master page (<true/>) or a regular or notes page
+ (<false/>). The given value is ignored.
@return
Returns the index of the page with the given name or
- SDRPAGE_NOTFOUND (=0xffff) when such a page does not exist.
+ SDRPAGE_NOTFOUND (=0xffffffff) when such a page does not exist.
*/
- sal_uInt16 GetPageByName(const String& rPgName, sal_Bool& rbIsMasterPage ) const;
- SD_DLLPUBLIC SdPage*GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const;
- SD_DLLPUBLIC sal_uInt16 GetSdPageCount(PageKind ePgKind) const;
+ sal_uInt32 GetPageByName(const String& rPgName, bool& rbIsMasterPage ) const;
+ SD_DLLPUBLIC SdPage*GetSdPage(sal_uInt32 nPgNum, PageKind ePgKind) const;
+ SD_DLLPUBLIC sal_uInt32 GetSdPageCount(PageKind ePgKind) const;
- void SetSelected(SdPage* pPage, sal_Bool bSelect);
- sal_Bool MovePages(sal_uInt16 nTargetPage);
+ void SetSelected(SdPage* pPage, bool bSelect);
+ bool MovePages(sal_uInt32 nTargetPage);
- SD_DLLPUBLIC SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
- SD_DLLPUBLIC sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const;
+ SD_DLLPUBLIC SdPage*GetMasterSdPage(sal_uInt32 nPgNum, PageKind ePgKind);
+ SD_DLLPUBLIC sal_uInt32 GetMasterSdPageCount(PageKind ePgKind) const;
- sal_uInt16 GetMasterPageUserCount(SdrPage* pMaster) const;
+ sal_uInt32 GetMasterPageUserCount(SdrPage* pMaster) const;
const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; }
sd::PresentationSettings& getPresentationSettings() { return maPresentationSettings; }
const ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentation2 >& getPresentation() const;
- void SetSummationOfParagraphs( sal_Bool bOn = sal_True ) { mbSummationOfParagraphs = bOn; }
- sal_Bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs; }
+ void SetSummationOfParagraphs( bool bOn = true ) { mbSummationOfParagraphs = bOn; }
+ bool IsSummationOfParagraphs() const { return mbSummationOfParagraphs; }
/** Set the mode that controls whether (and later how) the formatting of the document
depends on the current printer metrics.
@@ -392,24 +384,24 @@ public:
*/
sal_Int32 GetPrinterIndependentLayout (void);
- void SetOnlineSpell( sal_Bool bIn );
- sal_Bool GetOnlineSpell() const { return mbOnlineSpell; }
+ void SetOnlineSpell( bool bIn );
+ bool GetOnlineSpell() const { return mbOnlineSpell; }
void StopOnlineSpelling();
- void StartOnlineSpelling(sal_Bool bForceSpelling=sal_True);
+ void StartOnlineSpelling(bool bForceSpelling = true);
void ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl);
- void InsertObject(SdrObject* pObj, SdPage* pPage);
- void RemoveObject(SdrObject* pObj, SdPage* pPage);
+ void InsertObject(const SdrObject* pObj);
+ void RemoveObject(const SdrObject* pObj);
- sal_uLong GetLinkCount();
+ sal_uInt32 GetLinkCount();
List* GetFrameViewList() const { return mpFrameViewList; }
- SD_DLLPUBLIC List* GetCustomShowList(sal_Bool bCreate = sal_False);
+ SD_DLLPUBLIC List* GetCustomShowList(bool bCreate = false);
- void NbcSetChanged(sal_Bool bFlag = sal_True);
+ void NbcSetChanged(bool bFlag = true);
- void SetTextDefaults() const;
+ void SetSDTextDefaults();
void CreateLayoutTemplates();
void RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName);
@@ -420,19 +412,19 @@ public:
void NewOrLoadCompleted(DocCreationMode eMode);
void NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool );
- sal_Bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; }
+ bool IsNewOrLoadCompleted() const {return mbNewOrLoadCompleted; }
- ::sd::FrameView* GetFrameView(sal_uLong nPos) {
+ ::sd::FrameView* GetFrameView(sal_uInt32 nPos) {
return static_cast< ::sd::FrameView*>(
mpFrameViewList->GetObject(nPos));}
/** deprecated*/
SdAnimationInfo* GetAnimationInfo(SdrObject* pObject) const;
- SD_DLLPUBLIC static SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
+ SD_DLLPUBLIC static SdAnimationInfo* GetShapeUserData(const SdrObject& rObject, bool bCreate = false );
SdIMapInfo* GetIMapInfo( SdrObject* pObject ) const;
- IMapObject* GetHitIMapObject( SdrObject* pObject, const Point& rWinPoint, const ::Window& rCmpWnd );
+ IMapObject* GetHitIMapObject( SdrObject* pObject, const basegfx::B2DPoint& rWinPoint, const ::Window& rCmpWnd );
CharClass* GetCharClass() const { return mpCharClass; }
@@ -443,10 +435,10 @@ public:
void CheckMasterPages();
void Merge(SdrModel& rSourceModel,
- sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF,
- sal_uInt16 nDestPos=0xFFFF,
- FASTBOOL bMergeMasterPages=sal_False, FASTBOOL bAllMasterPages=sal_False,
- FASTBOOL bUndo=sal_True, FASTBOOL bTreadSourceAsConst=sal_False);
+ sal_uInt32 nFirstPageNum=0, sal_uInt32 nLastPageNum = SDRPAGE_NOTFOUND,
+ sal_uInt32 nDestPos = SDRPAGE_NOTFOUND,
+ bool bMergeMasterPages = false, bool bAllMasterPages = false,
+ bool bUndo = true, bool bTreadSourceAsConst = false);
SD_DLLPUBLIC ::com::sun::star::text::WritingMode GetDefaultWritingMode() const;
void SetDefaultWritingMode( ::com::sun::star::text::WritingMode eMode );
@@ -497,15 +489,15 @@ public:
Returns an index of the inserted pages that can be used with the
<member>GetSdPage()</member> method.
*/
- sal_uInt16 CreatePage (
+ sal_uInt32 CreatePage (
SdPage* pCurrentPage,
PageKind ePageKind,
const String& sStandardPageName,
const String& sNotesPageName,
AutoLayout eStandardLayout,
AutoLayout eNotesLayout,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj,
+ bool bIsPageBack,
+ bool bIsPageObj,
const sal_Int32 nInsertPosition = -1);
/** This method acts as a simplified front end for the more complex
@@ -518,7 +510,7 @@ public:
Returns an index of the inserted pages that can be used with the
<member>GetSdPage()</member> method.
*/
- sal_uInt16 DuplicatePage (sal_uInt16 nPageNum);
+ sal_uInt32 DuplicatePage (sal_uInt32 nPageNum);
/** Create and insert a set of two new pages that are copies of the
given <argument>pCurrentPage</argument> and its associated notes
@@ -557,15 +549,15 @@ public:
Returns an index of the inserted pages that can be used with the
<member>GetSdPage()</member> method.
*/
- sal_uInt16 DuplicatePage (
+ sal_uInt32 DuplicatePage (
SdPage* pCurrentPage,
PageKind ePageKind,
const String& sStandardPageName,
const String& sNotesPageName,
AutoLayout eStandardLayout,
AutoLayout eNotesLayout,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj,
+ bool bIsPageBack,
+ bool bIsPageObj,
const sal_Int32 nInsertPosition = -1);
/** return the document fonts for latin, cjk and ctl according to the current
@@ -577,16 +569,16 @@ public:
/* converts the given western font height to a corresponding ctl font height, deppending on the system language */
static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
- /** Get the style sheet pool if it was a SdStyleSheetPool.
- */
- SD_DLLPUBLIC SdStyleSheetPool* GetSdStyleSheetPool() const;
-
void UpdatePageRelativeURLs(const String& rOldName, const String& rNewName);
void SetCalcFieldValueHdl( ::Outliner* pOutliner);
sal_uInt16 GetAnnotationAuthorIndex( const rtl::OUString& rAuthor );
+ /** Get the style sheet pool if it was a SdStyleSheetPool.
+ */
+ SD_DLLPUBLIC SdStyleSheetPool* GetSdStyleSheetPool() const;
+
private:
/** This member stores the printer independent layout mode. Please
refer to <member>SetPrinterIndependentLayout()</member> for its
@@ -632,15 +624,15 @@ private:
Returns an index of the inserted pages that can be used with the
<member>GetSdPage()</member> method.
*/
- sal_uInt16 InsertPageSet (
+ sal_uInt32 InsertPageSet (
SdPage* pCurrentPage,
PageKind ePageKind,
const String& sStandardPageName,
const String& sNotesPageName,
AutoLayout eStandardLayout,
AutoLayout eNotesLayout,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj,
+ bool bIsPageBack,
+ bool bIsPageObj,
SdPage* pStandardPage,
SdPage* pNotesPage,
sal_Int32 nInsertPosition = -1);
@@ -664,13 +656,13 @@ private:
SdPage* pPreviousPage,
SdPage* pPage,
const String& sPageName,
- sal_uInt16 nInsertionPoint,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj);
+ sal_uInt32 nInsertionPoint,
+ bool bIsPageBack,
+ bool bIsPageObj);
// #109538#
- virtual void PageListChanged();
- virtual void MasterPageListChanged();
+// virtual void PageListChanged();
+// virtual void MasterPageListChanged();
};
namespace sd
@@ -689,8 +681,8 @@ private:
DrawDocShell* mpDocShell;
SdDrawDocument* mpDoc;
- sal_Bool mbIsEnableSetModified;
- sal_Bool mbIsDocumentChanged;
+ bool mbIsEnableSetModified;
+ bool mbIsDocumentChanged;
};
}
diff --git a/sd/inc/imapinfo.hxx b/sd/inc/imapinfo.hxx
index 3dc5b63922d9..262cff06b29d 100644
--- a/sd/inc/imapinfo.hxx
+++ b/sd/inc/imapinfo.hxx
@@ -43,14 +43,14 @@ class SdIMapInfo : public SdrObjUserData, public SfxListener
public:
SdIMapInfo() :
- SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID, 0 ) {};
+ SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID ) {};
SdIMapInfo( const ImageMap& rImageMap ) :
- SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID, 0 ),
+ SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID ),
aImageMap( rImageMap ) {};
SdIMapInfo( const SdIMapInfo& rIMapInfo ) :
- SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID, 0 ),
+ SdrObjUserData( SdUDInventor, SD_IMAPINFO_ID ),
SfxListener(),
aImageMap( rIMapInfo.aImageMap ) {};
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index 55e1ab36a3f5..696724c952c4 100644
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -642,7 +642,6 @@
#include "editeng/paperinf.hxx"
#include "editeng/pbinitem.hxx"
#include "svx/pfiledlg.hxx"
-#include "svx/polysc3d.hxx"
#include "svx/postattr.hxx"
#include "editeng/postitem.hxx"
#include "editeng/protitem.hxx"
@@ -655,7 +654,6 @@
#include "editeng/scriptspaceitem.hxx"
#include "editeng/scripttypeitem.hxx"
#include "svx/sdasitm.hxx"
-#include "svx/sderitm.hxx"
#include "svx/sdr/contact/displayinfo.hxx"
#include "svx/sdr/contact/objectcontact.hxx"
#include "svx/sdr/contact/objectcontactofobjlistpainter.hxx"
@@ -664,12 +662,7 @@
#include "svx/sdr/contact/viewcontactofpageobj.hxx"
#include "svx/sdr/contact/viewcontactofsdrmediaobj.hxx"
#include "svx/sdr/contact/viewobjectcontact.hxx"
-#include "svx/sdrobjectuser.hxx"
-#include "svx/sdshcitm.hxx"
-#include "svx/sdshitm.hxx"
-#include "svx/sdtagitm.hxx"
#include "svx/sdtakitm.hxx"
-#include "svx/sdtmfitm.hxx"
#include "editeng/shaditem.hxx"
#include "editeng/shdditem.hxx"
#include "svx/sphere3d.hxx"
@@ -682,7 +675,6 @@
#include "svx/svdglue.hxx"
#include "svx/svditer.hxx"
#include "svx/svdlayer.hxx"
-#include "svx/svdmark.hxx"
#include "svx/svdoashp.hxx"
#include "svx/svdoattr.hxx"
#include "svx/svdobj.hxx"
@@ -705,7 +697,6 @@
#include "svx/svdsob.hxx"
#include "svx/svdtypes.hxx"
#include "svx/svdundo.hxx"
-#include "svx/svdviter.hxx"
#include "svx/svx3ditems.hxx"
#include "svx/svxdlg.hxx"
#include "editeng/svxenum.hxx"
@@ -714,7 +705,6 @@
#include "svx/svxgrahicitem.hxx"
#include "svx/svxids.hrc"
#include "filter/msfilter/svxmsbas.hxx"
-#include "svx/sxciaitm.hxx"
#include "svx/sxekitm.hxx"
#include "svx/sxelditm.hxx"
#include "svx/tabarea.hxx"
@@ -809,7 +799,6 @@
#include "tools/ref.hxx"
#include "tools/resid.hxx"
#include "tools/resmgr.hxx"
-#include "tools/rtti.hxx"
#include "tools/shl.hxx"
#include "tools/solar.h"
#include "tools/stream.hxx"
diff --git a/sd/inc/pglink.hxx b/sd/inc/pglink.hxx
index 7ca4f7e9b971..d73d1be73189 100644
--- a/sd/inc/pglink.hxx
+++ b/sd/inc/pglink.hxx
@@ -43,7 +43,7 @@ public:
virtual void Closed();
virtual void DataChanged( const String& ,
const ::com::sun::star::uno::Any & );
- FASTBOOL Connect() { return 0 != SvBaseLink::GetRealObject(); }
+ bool Connect() { return 0 != SvBaseLink::GetRealObject(); }
};
#else
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 932cf0c39826..c7542240c382 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -76,8 +76,8 @@ public:
class AbstractSdCustomShowDlg : public VclAbstractDialog //add for SdCustomShowDlg
{
public:
- virtual sal_Bool IsModified() const = 0;
- virtual sal_Bool IsCustomShow() const = 0;
+ virtual bool IsModified() const = 0;
+ virtual bool IsCustomShow() const = 0;
};
class AbstractAssistentDlg : public VclAbstractDialog //add for AssistentDlg
@@ -85,11 +85,11 @@ class AbstractAssistentDlg : public VclAbstractDialog //add for AssistentDlg
public:
virtual SfxObjectShellLock GetDocument() = 0;
virtual OutputType GetOutputMedium() const = 0;
- virtual sal_Bool IsSummary() const = 0;
+ virtual bool IsSummary() const = 0;
virtual StartType GetStartType() const = 0;
virtual String GetDocPath() const = 0;
- virtual sal_Bool GetStartWithFlag() const = 0;
- virtual sal_Bool IsDocEmpty() const = 0;
+ virtual bool GetStartWithFlag() const = 0;
+ virtual bool IsDocEmpty() const = 0;
virtual String GetPassword() = 0;
};
@@ -106,7 +106,7 @@ public:
virtual void GetAttr(SfxItemSet& rOutAttrs) = 0;
virtual void HideRadioGroup() = 0;
virtual void HideDeleteBtn() = 0;
- virtual void SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY) = 0;
+ virtual void SetInputFields(bool bEnableX, bool bEnableY) = 0;
//from class ::Window
virtual void SetText( const XubString& rStr ) = 0;
};
@@ -122,7 +122,7 @@ public:
class AbstractSdInsertPasteDlg : public VclAbstractDialog //add for SdInsertPasteDlg
{
public:
- virtual sal_Bool IsInsertBefore() const = 0;
+ virtual bool IsInsertBefore() const = 0;
};
class AbstractSdInsertPagesObjsDlg : public VclAbstractDialog //add for SdInsertPagesObjsDlg
@@ -130,8 +130,8 @@ class AbstractSdInsertPagesObjsDlg : public VclAbstractDialog //add for SdInser
public:
virtual ::Window* GetWindow() = 0; //this method is added for return a ::Window type pointer
virtual List* GetList( sal_uInt16 nType ) = 0;
- virtual sal_Bool IsLink() = 0;
- virtual sal_Bool IsRemoveUnnessesaryMasterPages() const = 0;
+ virtual bool IsLink() = 0;
+ virtual bool IsRemoveUnnessesaryMasterPages() const = 0;
};
class AbstractMorphDlg : public VclAbstractDialog //add for MorphDlg
@@ -139,8 +139,8 @@ class AbstractMorphDlg : public VclAbstractDialog //add for MorphDlg
public:
virtual void SaveSettings() const = 0;
virtual sal_uInt16 GetFadeSteps() const = 0;
- virtual sal_Bool IsAttributeFade() const = 0;
- virtual sal_Bool IsOrientationFade() const = 0;
+ virtual bool IsAttributeFade() const = 0;
+ virtual bool IsOrientationFade() const = 0;
};
class AbstractSdStartPresDlg : public VclAbstractDialog //add for SdStartPresentationDlg
@@ -185,8 +185,8 @@ public:
virtual AbstractCopyDlg* CreateCopyDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, XColorTable* pColTab, ::sd::View* pView ) = 0;
virtual AbstractSdCustomShowDlg* CreateSdCustomShowDlg( ::Window* pWindow, SdDrawDocument& rDrawDoc ) = 0;
virtual SfxAbstractTabDialog* CreateSdTabCharDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell ) = 0;
- virtual SfxAbstractTabDialog* CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, sal_Bool bAreaPage = sal_True ) = 0;
- virtual AbstractAssistentDlg* CreateAssistentDlg( ::Window* pParent, sal_Bool bAutoPilot) = 0;
+ virtual SfxAbstractTabDialog* CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage = true ) = 0;
+ virtual AbstractAssistentDlg* CreateAssistentDlg( ::Window* pParent, bool bAutoPilot) = 0;
virtual AbstractSdModifyFieldDlg* CreateSdModifyFieldDlg( ::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet ) = 0;
virtual AbstractSdSnapLineDlg* CreateSdSnapLineDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView) = 0;
virtual AbstractSdInsertLayerDlg* CreateSdInsertLayerDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, String aStr ) = 0;
diff --git a/sd/inc/sdattr.hxx b/sd/inc/sdattr.hxx
index 20d3bfbb61d0..bce195a5480c 100644
--- a/sd/inc/sdattr.hxx
+++ b/sd/inc/sdattr.hxx
@@ -44,75 +44,9 @@
// Layer-Attribute
//==================================================================
-class SdAttrLayerName : public SfxStringItem
-{
-public:
- SdAttrLayerName() :
- SfxStringItem( ATTR_LAYER_NAME, String( RTL_CONSTASCII_USTRINGPARAM( "neue Ebene" ))) {}
- SdAttrLayerName( const String& aStr ) :
- SfxStringItem( ATTR_LAYER_NAME, aStr ) {}
-};
-
-//------------------------------------------------------------------
-
-class SdAttrLayerTitle : public SfxStringItem
-{
-public:
- SdAttrLayerTitle() : SfxStringItem( ATTR_LAYER_TITLE, XubString()) {}
- SdAttrLayerTitle( const String& aStr ) : SfxStringItem( ATTR_LAYER_TITLE, aStr ) {}
-};
-
-//------------------------------------------------------------------
-
-class SdAttrLayerDesc : public SfxStringItem
-{
-public:
- SdAttrLayerDesc() : SfxStringItem( ATTR_LAYER_DESC, XubString()) {}
- SdAttrLayerDesc( const String& aStr ) : SfxStringItem( ATTR_LAYER_DESC, aStr ) {}
-};
-
-//------------------------------------------------------------------
-
-class SdAttrLayerVisible : public SfxBoolItem
-{
-public:
- SdAttrLayerVisible( sal_Bool bValue = sal_True ) :
- SfxBoolItem( ATTR_LAYER_VISIBLE, bValue ) {}
-};
-
-//------------------------------------------------------------------
-
-class SdAttrLayerPrintable : public SfxBoolItem
-{
-public:
- SdAttrLayerPrintable( sal_Bool bValue = sal_True ) :
- SfxBoolItem( ATTR_LAYER_PRINTABLE, bValue ) {}
-};
-
-//------------------------------------------------------------------
-
-class SdAttrLayerLocked : public SfxBoolItem
-{
-public:
- SdAttrLayerLocked( sal_Bool bValue = sal_False ) :
- SfxBoolItem( ATTR_LAYER_LOCKED, bValue ) {}
-};
-
-//------------------------------------------------------------------
-
-class SdAttrLayerThisPage : public SfxBoolItem
-{
-public:
- SdAttrLayerThisPage( sal_Bool bValue = sal_False ) :
- SfxBoolItem( ATTR_LAYER_THISPAGE, bValue ) {}
-};
-
-//------------------------------------------------------------------
-
class DiaEffectItem : public SfxEnumItem
{
public:
- TYPEINFO();
DiaEffectItem( ::com::sun::star::presentation::FadeEffect eFade = com::sun::star::presentation::FadeEffect_NONE );
DiaEffectItem( SvStream& rIn );
@@ -128,7 +62,6 @@ public:
class DiaSpeedItem : public SfxEnumItem
{
public:
- TYPEINFO();
DiaSpeedItem( FadeSpeed = FADE_SPEED_MEDIUM );
DiaSpeedItem( SvStream& rIn );
@@ -144,7 +77,6 @@ public:
class DiaAutoItem : public SfxEnumItem
{
public:
- TYPEINFO();
DiaAutoItem( PresChange = PRESCHANGE_MANUAL );
DiaAutoItem( SvStream& rIn );
@@ -159,7 +91,6 @@ public:
class DiaTimeItem : public SfxUInt32Item
{
public:
- TYPEINFO();
DiaTimeItem( sal_uInt32 nValue = 0L );
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/sd/inc/sderror.hxx b/sd/inc/sderror.hxx
index 1a958a237f24..5d33aeb24520 100644
--- a/sd/inc/sderror.hxx
+++ b/sd/inc/sderror.hxx
@@ -45,12 +45,12 @@
#ifndef __RSC
-inline FASTBOOL IsWarning( sal_uLong nErr )
+inline bool IsWarning( sal_uLong nErr )
{
return 0 != ( nErr & ERRCODE_WARNING_MASK & nErr );
}
-inline FASTBOOL IsError( sal_uLong nErr )
+inline bool IsError( sal_uLong nErr )
{
return nErr && 0 == ( ERRCODE_WARNING_MASK & nErr );
}
diff --git a/sd/inc/sdiocmpt.hxx b/sd/inc/sdiocmpt.hxx
index 411f6618aef5..d1972963f59c 100644
--- a/sd/inc/sdiocmpt.hxx
+++ b/sd/inc/sdiocmpt.hxx
@@ -36,7 +36,7 @@ protected:
sal_uInt32 nSubRecSiz;
sal_uInt32 nSubRecPos;
sal_uInt16 nMode;
- sal_Bool bOpen;
+ bool bOpen;
protected:
void Read();
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index 12415cc568af..67c6ad9f894c 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -96,7 +96,6 @@ class SdModule : public SfxModule, public SfxListener
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDAPP)
DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
@@ -113,8 +112,8 @@ public:
SdOptions* GetSdOptions(DocumentType eDocType);
SD_DLLPUBLIC SvStorageStreamRef GetOptionStream( const String& rOptionName, SdOptionStreamMode eMode );
- sal_Bool GetWaterCan() const { return bWaterCan; }
- void SetWaterCan( sal_Bool bWC ) { bWaterCan = bWC; }
+ bool GetWaterCan() const { return bWaterCan; }
+ void SetWaterCan( bool bWC ) { bWaterCan = bWC; }
SvxSearchItem* GetSearchItem() { return (pSearchItem); }
void SetSearchItem(SvxSearchItem* pItem) { pSearchItem = pItem; }
@@ -147,8 +146,8 @@ protected:
SvxSearchItem* pSearchItem;
SvNumberFormatter* pNumberFormatter;
SvStorageRef xOptionStorage;
- sal_Bool bAutoSave;
- sal_Bool bWaterCan;
+ bool bAutoSave;
+ bool bWaterCan;
SfxErrorHandler* mpErrorHdl;
/** This device is used for printer independent layout. It is virtual
in the sense that it does not represent a printer. The pointer may
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index e1be84e9fb14..89a80b3505de 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -110,8 +110,20 @@ namespace sd {
class UndoAttrObject;
}
-class SD_DLLPUBLIC SdPage : public FmFormPage, public SdrObjUserCall
+//////////////////////////////////////////////////////////////////////////////
+
+// try to find the SdPage connected to the SdrObject
+SdPage* findConnectionToSdrObject(const SdrObject* pSdrObject);
+
+// set/reset connection between SdrObject and SdPage
+SD_DLLPUBLIC void establishConnectionToSdrObject(SdrObject* pSdrObject, SdPage* pSdPage);
+SD_DLLPUBLIC void resetConnectionToSdrObject(SdrObject* pSdrObject);
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SD_DLLPUBLIC SdPage : public FmFormPage, public SfxListener
{
+private:
friend class SdGenericDrawPage;
friend class SdDrawPage;
friend class sd::UndoAnimation;
@@ -125,12 +137,12 @@ protected:
AutoLayout meAutoLayout; // AutoLayout
sd::ShapeList maPresentationShapeList; // Praesentationsobjekte
sd::ScopeLock maLockAutoLayoutArrangement;
- sal_Bool mbSelected; // Selektionskennung
+ bool mbSelected; // Selektionskennung
PresChange mePresChange; // manuell/automatisch/halbautomatisch
sal_uInt32 mnTime; // Anzeigedauer in Sekunden
- sal_Bool mbSoundOn; // mit/ohne Sound (sal_True/sal_False)
- sal_Bool mbExcluded; // wird in der Show nicht/doch
- // angezeigt (sal_True/sal_False)
+ bool mbSoundOn; // mit/ohne Sound (true/false)
+ bool mbExcluded; // wird in der Show nicht/doch
+ // angezeigt (true/false)
String maLayoutName; // Name des Layouts
String maSoundFile; // Pfad zum Soundfile (MSDOS-Notation)
bool mbLoopSound;
@@ -138,8 +150,8 @@ protected:
String maCreatedPageName; // von GetPageName erzeugter Seitenname
String maFileName; // Filename
String maBookmarkName; // Bookmarkname
- sal_Bool mbScaleObjects; // Objekte sollen skaliert werden
- sal_Bool mbBackgroundFullSize; // Hintergrundobjekt auf ganze Seite darstellen
+ bool mbScaleObjects; // Objekte sollen skaliert werden
+ bool mbBackgroundFullSize; // Hintergrundobjekt auf ganze Seite darstellen
rtl_TextEncoding meCharSet; // Text-Encoding
sal_uInt16 mnPaperBin; // PaperBin
Orientation meOrientation; // Print-Orientation
@@ -168,31 +180,25 @@ protected:
sal_Int32 mnTransitionFadeColor;
double mfTransitionDuration;
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrPage(const SdrPage& rSource);
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrPage* CloneSdrPage(SdrModel* pTargetModel = 0) const;
- SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, sal_Bool bMasterPage=sal_False);
- SdPage(const SdPage& rSrcPage);
+ SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, bool bMasterPage = false);
~SdPage();
- virtual SdrPage* Clone() const;
- virtual SdrPage* Clone(SdrModel* pNewModel) const;
-
- virtual void SetSize(const Size& aSize);
- virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr);
- virtual void SetLftBorder(sal_Int32 nBorder);
- virtual void SetRgtBorder(sal_Int32 nBorder);
- virtual void SetUppBorder(sal_Int32 nBorder);
- virtual void SetLwrBorder(sal_Int32 nBorder);
- virtual void SetModel(SdrModel* pNewModel);
- virtual FASTBOOL IsReadOnly() const;
+
+ virtual void SetPageScale(const basegfx::B2DVector& aNewScale);
sd::ShapeList& GetPresentationShapeList() { return maPresentationShapeList; }
void EnsureMasterPageDefaultBackground();
- SdrObject* CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const Rectangle& rRect, sal_Bool bInsert=sal_False);
+ SdrObject* CreatePresObj(PresObjKind eObjKind, bool bVertical, const basegfx::B2DRange& rRange, bool bInsert=false);
SdrObject* CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert);
SdrObject* GetPresObj(PresObjKind eObjKind, int nIndex = 1, bool bFuzzySearch = false );
- PresObjKind GetPresObjKind(SdrObject* pObj) const;
+ PresObjKind GetPresObjKind(const SdrObject* pObj) const;
String GetPresObjText(PresObjKind eObjKind) const;
SfxStyleSheet* GetStyleSheetForMasterPageBackground() const;
SfxStyleSheet* GetStyleSheetForPresObj(PresObjKind eObjKind) const;
@@ -207,20 +213,13 @@ public:
/** inserts the given SdrObject into the presentation object list */
void InsertPresObj(SdrObject* pObj, PresObjKind eKind );
- void SetAutoLayout(AutoLayout eLayout, sal_Bool bInit=sal_False, sal_Bool bCreate=sal_False);
+ void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false);
AutoLayout GetAutoLayout() const { return meAutoLayout; }
- void CreateTitleAndLayout(sal_Bool bInit=sal_False, sal_Bool bCreate=sal_False);
- SdrObject* InsertAutoLayoutShape(SdrObject* pObj, PresObjKind eObjKind, bool bVertical, Rectangle aRect, bool bInit );
-
- virtual void NbcInsertObject(SdrObject* pObj, sal_uLong nPos=CONTAINER_APPEND,
- const SdrInsertReason* pReason=NULL);
- virtual SdrObject* NbcRemoveObject(sal_uLong nObjNum);
- virtual SdrObject* RemoveObject(sal_uLong nObjNum);
+ void CreateTitleAndLayout(bool bInit=false, bool bCreate=false);
+ SdrObject* InsertAutoLayoutShape(SdrObject* pObj, PresObjKind eObjKind, bool bVertical, const basegfx::B2DRange& rRange, bool bInit );
- // #95876# Also overload ReplaceObject methods to realize when
- // objects are removed with this mechanism instead of RemoveObject
- virtual SdrObject* NbcReplaceObject(SdrObject* pNewObj, sal_uLong nObjNum);
- virtual SdrObject* ReplaceObject(SdrObject* pNewObj, sal_uLong nObjNum);
+ // react on content change
+ virtual void handleContentChange(const SfxHint& rHint);
virtual void SetLinkData(const String& rLinkName, const String& rLinkData);
@@ -229,8 +228,8 @@ public:
void SetPageKind(PageKind ePgType) { mePageKind = ePgType; }
PageKind GetPageKind() const { return mePageKind; }
- void SetSelected(sal_Bool bSel) { mbSelected = bSel; }
- sal_Bool IsSelected() const { return mbSelected; }
+ void SetSelected(bool bSel) { mbSelected = bSel; }
+ bool IsSelected() const { return mbSelected; }
void SetFadeEffect(::com::sun::star::presentation::FadeEffect eNewEffect);
::com::sun::star::presentation::FadeEffect GetFadeEffect() const;
@@ -241,14 +240,14 @@ public:
void SetTime(sal_uInt32 nNewTime) { mnTime = nNewTime; }
sal_uInt32 GetTime() const { return mnTime; }
- void SetSound(sal_Bool bNewSoundOn) { mbSoundOn = bNewSoundOn; }
- sal_Bool IsSoundOn() const { return mbSoundOn; }
+ void SetSound(bool bNewSoundOn) { mbSoundOn = bNewSoundOn; }
+ bool IsSoundOn() const { return mbSoundOn; }
- void SetExcluded(sal_Bool bNewExcluded) { mbExcluded = bNewExcluded; }
- sal_Bool IsExcluded() const { return mbExcluded; }
+ void SetExcluded(bool bNewExcluded) { mbExcluded = bNewExcluded; }
+ bool IsExcluded() const { return mbExcluded; }
- void SetScaleObjects(sal_Bool bScale) { mbScaleObjects = bScale; }
- sal_Bool IsScaleObjects() const { return mbScaleObjects; }
+ void SetScaleObjects(bool bScale) { mbScaleObjects = bScale; }
+ bool IsScaleObjects() const { return mbScaleObjects; }
void SetSoundFile(const String& rStr) { maSoundFile = rStr; }
String GetSoundFile() const { return maSoundFile; }
@@ -274,9 +273,11 @@ public:
double getTransitionDuration() const;
void setTransitionDuration( double fTranstionDuration );
- // Virtuelle Methoden von SdrObjUserCall
- virtual void Changed(const SdrObject& rObj, SdrUserCallType eType,
- const Rectangle& rOldBoundRect);
+ // virtual notifyer from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ // new central SdrObject change handler, called from Notify
+ void HandleChanged(const SdrObject& rObj, SdrHintKind eHint);
void SetLayoutName(String aName);
virtual String GetLayoutName() const { return maLayoutName; }
@@ -290,20 +291,19 @@ public:
void ConnectLink();
void DisconnectLink();
- void ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderRect,
- sal_Bool bScaleAllObj);
+ void ScaleObjects(const basegfx::B2DVector& rNewPageSize, double fLeft, double fTop, double fRight, double fBottom, bool bScaleAllObj);
const String& GetName() const;
String GetRealName() const { return FmFormPage::GetName(); };
void SetPresentationLayout(const String& rLayoutName,
- sal_Bool bReplaceStyleSheets = sal_True,
- sal_Bool bSetMasterPage = sal_True,
- sal_Bool bReverseOrder = sal_False);
+ bool bReplaceStyleSheets = true,
+ bool bSetMasterPage = true,
+ bool bReverseOrder = false);
void EndListenOutlineText();
- void SetBackgroundFullSize( sal_Bool bIn );
- sal_Bool IsBackgroundFullSize() const { return mbBackgroundFullSize; }
+ void SetBackgroundFullSize( bool bIn );
+ bool IsBackgroundFullSize() const { return mbBackgroundFullSize; }
rtl_TextEncoding GetCharSet() { return(meCharSet); }
@@ -371,10 +371,10 @@ public:
/** removes all empty presentation objects from this slide */
void RemoveEmptyPresentationObjects();
- Rectangle GetTitleRect() const;
- Rectangle GetLayoutRect() const;
+ basegfx::B2DRange GetTitleRange() const;
+ basegfx::B2DRange GetLayoutRange() const;
- static void CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< Rectangle >& rAreas );
+ static void CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< basegfx::B2DRange >& rAreas );
/** Set the "precious" flag to the given value.
*/
@@ -384,7 +384,7 @@ public:
master pages from being deleted automatically. For pages
other than master pages this flag can be ignored.
@return
- When this method returns <TRUE/> for a master page then this
+ When this method returns <true/> for a master page then this
master page should not be deleted automatically.
*/
bool IsPrecious (void) const;
@@ -402,8 +402,11 @@ private:
*/
void cloneAnimations( SdPage& rTargetPage ) const;
- /** called before a shape is removed or replaced from this slide */
- void onRemoveObject( SdrObject* pObject );
+ /** called before a shape is removed from this slide */
+ void onRemoveObject( const SdrObject* pObject );
+
+ /** called after a shape is inserted to this slide */
+ void onInsertObject( const SdrObject* pObject );
};
#endif // _SDPAGE_HXX
diff --git a/sd/inc/sdundo.hxx b/sd/inc/sdundo.hxx
index a81b64b67cb5..df2666a19fdc 100644
--- a/sd/inc/sdundo.hxx
+++ b/sd/inc/sdundo.hxx
@@ -32,7 +32,6 @@ class SdDrawDocument;
class SD_DLLPUBLIC SdUndoAction : public SfxUndoAction
{
public:
- TYPEINFO();
SdUndoAction(SdDrawDocument* pSdDrawDocument)
: mpDoc(pSdDrawDocument) {}
virtual ~SdUndoAction() {}
diff --git a/sd/inc/shapelist.hxx b/sd/inc/shapelist.hxx
index 08b62b8d4898..81e399b64841 100644
--- a/sd/inc/shapelist.hxx
+++ b/sd/inc/shapelist.hxx
@@ -24,24 +24,22 @@
#ifndef _SHAPELIST_HXX
#define _SHAPELIST_HXX
-#include <svx/sdrobjectuser.hxx>
-
#include <list>
namespace sd
{
- class ShapeList : public sdr::ObjectUser
+ class ShapeList : public SfxListener
{
public:
ShapeList();
virtual ~ShapeList();
/** adds the given shape to this list */
- void addShape( SdrObject& rObject );
+ void addShape( const SdrObject& rObject );
/** removes the shape from this list and returns
a pointer to the next shape in list or 0*/
- SdrObject* removeShape( SdrObject& rObject );
+ const SdrObject* removeShape( const SdrObject& rObject );
/** removes all shapes from this list */
void clear();
@@ -50,15 +48,15 @@ namespace sd
bool isEmpty() const;
/** returns true if given shape is part of this list */
- bool hasShape( SdrObject& rObject ) const;
+ bool hasShape( const SdrObject& rObject ) const;
/** returns the shape following the given shape in the list or 0
returns the first shape if pObj is 0 */
- SdrObject* getNextShape(SdrObject* pObj) const;
+ const SdrObject* getNextShape(const SdrObject* pObj) const;
/**
*/
- SdrObject* getNextShape();
+ const SdrObject* getNextShape();
/**
*/
@@ -68,12 +66,13 @@ namespace sd
*/
bool hasMore() const;
- const std::list< SdrObject* >& getList() const { return maShapeList; }
+ const std::list< const SdrObject* >& getList() const { return maShapeList; }
private:
- virtual void ObjectInDestruction(const SdrObject& rObject);
+ // derived from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- typedef std::list< SdrObject* > ListImpl;
+ typedef std::list< const SdrObject* > ListImpl;
ListImpl maShapeList;
ListImpl::iterator maIter;
};
diff --git a/sd/inc/stlpool.hxx b/sd/inc/stlpool.hxx
index 7a73630fab9d..97af55b8c77d 100644
--- a/sd/inc/stlpool.hxx
+++ b/sd/inc/stlpool.hxx
@@ -60,8 +60,8 @@ class SdStyleSheetPool : public SdStyleSheetPoolBase, public SfxListener
public:
SdStyleSheetPool(SfxItemPool const& rPool, SdDrawDocument* pDocument);
- void SetActualStyleSheet(SfxStyleSheetBase* pActStyleSheet) { mpActualStyleSheet = pActStyleSheet; }
- SfxStyleSheetBase* GetActualStyleSheet() { return mpActualStyleSheet; }
+ void SetActualStyleSheet(SfxStyleSheetBase* pActStyleSheet) { mxActualStyleSheet = pActStyleSheet; }
+ SfxStyleSheetBase* GetActualStyleSheet() { return mxActualStyleSheet.get(); }
SfxStyleSheetBase* GetTitleSheet(const String& rLayoutName);
@@ -135,7 +135,7 @@ protected:
void RemoveStyleFamily( const SdPage* pPage );
private:
- SfxStyleSheetBase* mpActualStyleSheet;
+ rtl::Reference< SfxStyleSheetBase > mxActualStyleSheet;
SdDrawDocument* mpDoc;
SdStyleFamilyRef mxGraphicFamily;
SdStyleFamilyRef mxCellFamily;
diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx
index 7fa61107c442..3c47274212b5 100644
--- a/sd/inc/stlsheet.hxx
+++ b/sd/inc/stlsheet.hxx
@@ -67,7 +67,7 @@ public:
virtual sal_Bool SetName( const UniString& );
virtual void SetHelpId( const String& r, sal_uLong nId );
- void AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingItems = sal_True);
+ void AdjustToFontHeight(SfxItemSet& rSet, bool bOnlyMissingItems = true);
SdStyleSheet* GetRealStyleSheet() const;
SdStyleSheet* GetPseudoStyleSheet() const;
diff --git a/sd/inc/undo/undofactory.hxx b/sd/inc/undo/undofactory.hxx
index dd82a946d74f..b4153e7c7db8 100644
--- a/sd/inc/undo/undofactory.hxx
+++ b/sd/inc/undo/undofactory.hxx
@@ -32,10 +32,10 @@ namespace sd
class UndoFactory : public SdrUndoFactory
{
public:
- virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject );
virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
- virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect = false );
+ virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject );
virtual SdrUndoAction* CreateUndoGeoObject( SdrObject& rObject );
virtual SdrUndoAction* CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false );
};
diff --git a/sd/inc/undo/undoobjects.hxx b/sd/inc/undo/undoobjects.hxx
index c407471348cd..5250d445f0f4 100644
--- a/sd/inc/undo/undoobjects.hxx
+++ b/sd/inc/undo/undoobjects.hxx
@@ -29,7 +29,6 @@
#include <svx/svdobj.hxx>
#include "pres.hxx"
-class SdrObjUserCall;
class SdPage;
namespace sd
@@ -48,7 +47,7 @@ protected:
virtual void Redo();
private:
- SfxUndoAction* mpUndoUsercall;
+ SfxUndoAction* mpUndoSdPage;
SfxUndoAction* mpUndoAnimation;
SfxUndoAction* mpUndoPresObj;
};
@@ -58,7 +57,7 @@ private:
class UndoRemoveObject : public SdrUndoRemoveObj, public UndoRemovePresObjectImpl
{
public:
- UndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect );
+ UndoRemoveObject( SdrObject& rObject );
virtual void Undo();
virtual void Redo();
@@ -72,7 +71,7 @@ private:
class UndoDeleteObject : public SdrUndoDelObj, public UndoRemovePresObjectImpl
{
public:
- UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect );
+ UndoDeleteObject( SdrObject& rObject );
virtual void Undo();
virtual void Redo();
@@ -86,7 +85,7 @@ private:
class UndoReplaceObject : public SdrUndoReplaceObj, public UndoRemovePresObjectImpl
{
public:
- UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect );
+ UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject );
virtual void Undo();
virtual void Redo();
@@ -113,19 +112,19 @@ private:
};
//////////////////////////////////////////////////////////////////////////////
-// Undo for SdrObject::SetUserCall()
+// Undo for connecting SdrObject to SdPage
-class UndoObjectUserCall : public SdrUndoObj
+class UndoConnectionToSdrObject : public SdrUndoObj
{
public:
- UndoObjectUserCall(SdrObject& rNewObj);
+ UndoConnectionToSdrObject(SdrObject& rNewObj);
virtual void Undo();
virtual void Redo();
protected:
- SdrObjUserCall* mpOldUserCall;
- SdrObjUserCall* mpNewUserCall;
+ SdPage* mpOldSdPage;
+ SdPage* mpNewSdPage;
SdrObjectWeakRef mxSdrObject;
};
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index e44f6b260a24..1d6b4d09e831 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -29,7 +29,7 @@ enum SdrFitToSizeType
SDRTEXTFIT_RESIZEATTR
}
item UINT32 SvxObjectItem ;
-item BOOL SdrShadowItem ;
+item BOOL SdrOnOffItem ;
item SdrFitToSizeType SdrTextFitToSizeTypeItem ;
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 64a61f265720..0761dea2c60f 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -65,17 +65,14 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <algorithm>
-
#include <cppuhelper/implbase1.hxx>
-
-#include <drawinglayer/geometry/viewinformation2d.hxx>
-#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdpage.hxx>
#include <svx/unoapi.hxx>
#include "CustomAnimationEffect.hxx"
#include <CustomAnimationPreset.hxx>
#include "animations.hxx"
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::presentation;
@@ -1694,9 +1691,10 @@ bool CustomAnimationEffect::getStopAudio() const
// --------------------------------------------------------------------
-SdrPathObj* CustomAnimationEffect::createSdrPathObjFromPath()
+SdrPathObj* CustomAnimationEffect::createSdrPathObjFromPath(SdrModel& rTargetModel)
{
- SdrPathObj * pPathObj = new SdrPathObj( OBJ_PATHLINE );
+ SdrPathObj * pPathObj = new SdrPathObj(
+ rTargetModel );
updateSdrPathObjFromPath( *pPathObj );
return pPathObj;
}
@@ -1711,58 +1709,41 @@ void CustomAnimationEffect::updateSdrPathObjFromPath( SdrPathObj& rPathObj )
SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() );
if( pObj )
{
- SdrPage* pPage = pObj->GetPage();
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
if( pPage )
{
- const Size aPageSize( pPage->GetSize() );
- xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix((double)aPageSize.Width(), (double)aPageSize.Height()));
+ xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(pPage->GetPageScale()));
}
- const Rectangle aBoundRect( pObj->GetCurrentBoundRect() );
- const Point aCenter( aBoundRect.Center() );
- xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(aCenter.X(), aCenter.Y()));
+ xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(pObj->getObjectRange(0).getCenter()));
}
}
- rPathObj.SetPathPoly( xPolyPoly );
+ rPathObj.setB2DPolyPolygonInObjectCoordinates( xPolyPoly );
}
// --------------------------------------------------------------------
void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj )
{
- ::basegfx::B2DPolyPolygon xPolyPoly( rPathObj.GetPathPoly() );
+ basegfx::B2DPolyPolygon aPolyPolygon(rPathObj.getB2DPolyPolygonInObjectCoordinates());
+ SdrObject* pObj = GetSdrObjectFromXShape(getTargetShape());
- SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() );
- if( pObj )
+ if(pObj)
{
- Rectangle aBoundRect(0,0,0,0);
-
- const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(pObj->GetViewContact().getViewIndependentPrimitive2DSequence());
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
- const basegfx::B2DRange aRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D));
-
- if(!aRange.isEmpty())
- {
- aBoundRect = Rectangle(
- (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()),
- (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY()));
- }
+ const basegfx::B2DPoint aCenter(pObj->getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5));
- const Point aCenter( aBoundRect.Center() );
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.getX(), -aCenter.getY()));
- xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
- SdrPage* pPage = pObj->GetPage();
if( pPage )
{
- const Size aPageSize( pPage->GetSize() );
- xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(
- 1.0 / (double)aPageSize.Width(), 1.0 / (double)aPageSize.Height()));
+ aPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(1.0 / pPage->GetPageScale()));
}
}
- setPath( ::basegfx::tools::exportToSvgD( xPolyPoly ) );
+ setPath(::basegfx::tools::exportToSvgD(aPolyPolygon));
}
// ====================================================================
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index 796cc1986468..0b9be90f4bb0 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -425,14 +425,14 @@ EffectSequence::iterator ImplFindEffect( MainSequencePtr& pMainSequence, const R
static bool implIsInsideGroup( SdrObject* pObj )
{
- return pObj && pObj->GetObjList() && pObj->GetObjList()->GetUpList();
+ return pObj && pObj->getParentOfSdrObject() && pObj->getParentOfSdrObject()->getSdrObjectFromSdrObjList();
}
void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEffect )
{
- DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->GetPage(),
+ DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->getSdrPageFromSdrObject(),
"sd::EffectMigration::SetAnimationEffect(), invalid argument!" );
- if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->GetPage() )
+ if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->getSdrPageFromSdrObject() )
return;
SdrObject* pObj = pShape->GetSdrObject();
@@ -451,7 +451,7 @@ void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEff
const CustomAnimationPresets& rPresets = CustomAnimationPresets::getCustomAnimationPresets();
CustomAnimationPresetPtr pPreset( rPresets.getEffectDescriptor( aPresetId ) );
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
if( pPreset.get() && pMainSequence.get() )
{
@@ -506,7 +506,7 @@ void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEff
{
CustomAnimationEffectPtr pEffect( new CustomAnimationEffect( xNode ) );
pEffect->setTarget( makeAny( xShape ) );
- SdPage* pPage = dynamic_cast< SdPage* >( pObj->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
const bool bManual = (pPage == 0) || (pPage->GetPresChange() == PRESCHANGE_MANUAL);
if( !bManual )
pEffect->setNodeType( EffectNodeType::AFTER_PREVIOUS );
@@ -556,7 +556,7 @@ AnimationEffect EffectMigration::GetAnimationEffect( SvxShape* pShape )
OUString aPresetSubType;
SdrObject* pObj = pShape->GetSdrObject();
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
if( pMainSequence.get() )
{
@@ -597,9 +597,9 @@ AnimationEffect EffectMigration::GetAnimationEffect( SvxShape* pShape )
void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect eEffect )
{
- DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->GetPage(),
+ DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->getSdrPageFromSdrObject(),
"sd::EffectMigration::SetAnimationEffect(), invalid argument!" );
- if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->GetPage() )
+ if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->getSdrPageFromSdrObject() )
return;
SdrObject* pObj = pShape->GetSdrObject();
@@ -627,7 +627,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect
// create an effect from this preset
CustomAnimationPresetPtr pPreset( rPresets.getEffectDescriptor( aPresetId ) );
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
if( pPreset.get() && pMainSequence.get() )
{
@@ -677,7 +677,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect
pShapeEffect->setDuration( 0.1 );
pMainSequence->append( pShapeEffect );
- SdPage* pPage = dynamic_cast< SdPage* >( pObj->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
if( pPage && pPage->GetPresChange() != PRESCHANGE_MANUAL )
pShapeEffect->setNodeType( EffectNodeType::AFTER_PREVIOUS );
}
@@ -686,7 +686,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect
if( pShapeEffect.get() )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pObj->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
const bool bManual = (pPage == 0) || (pPage->GetPresChange() == PRESCHANGE_MANUAL);
// now create effects for each paragraph
@@ -744,7 +744,7 @@ AnimationEffect EffectMigration::GetTextAnimationEffect( SvxShape* pShape )
SdrObject* pObj = pShape->GetSdrObject();
if( pObj )
{
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
if( pMainSequence.get() )
{
@@ -835,9 +835,9 @@ double EffectMigration::ConvertAnimationSpeed( AnimationSpeed eSpeed )
void EffectMigration::SetAnimationSpeed( SvxShape* pShape, AnimationSpeed eSpeed )
{
- DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->GetPage(),
+ DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->getSdrPageFromSdrObject(),
"sd::EffectMigration::SetAnimationEffect(), invalid argument!" );
- if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->GetPage() )
+ if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->getSdrPageFromSdrObject() )
return;
SdrObject* pObj = pShape->GetSdrObject();
@@ -846,7 +846,7 @@ void EffectMigration::SetAnimationSpeed( SvxShape* pShape, AnimationSpeed eSpeed
double fDuration = ConvertAnimationSpeed( eSpeed );
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -873,7 +873,7 @@ void EffectMigration::SetAnimationSpeed( SvxShape* pShape, AnimationSpeed eSpeed
AnimationSpeed EffectMigration::GetAnimationSpeed( SvxShape* pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -917,16 +917,16 @@ AnimationSpeed EffectMigration::ConvertDuration( double fDuration )
void EffectMigration::SetDimColor( SvxShape* pShape, sal_Int32 nColor )
{
- DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->GetPage(),
+ DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->getSdrPageFromSdrObject(),
"sd::EffectMigration::SetAnimationEffect(), invalid argument!" );
- if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->GetPage() )
+ if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->getSdrPageFromSdrObject() )
return;
SdrObject* pObj = pShape->GetSdrObject();
if( implIsInsideGroup( pObj ) )
return;
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -957,9 +957,9 @@ sal_Int32 EffectMigration::GetDimColor( SvxShape* pShape )
if( pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
- if( pObj && pObj->GetPage() )
+ if( pObj && pObj->getSdrPageFromSdrObject() )
{
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
EffectSequence::iterator aIter;
@@ -986,9 +986,9 @@ sal_Int32 EffectMigration::GetDimColor( SvxShape* pShape )
void EffectMigration::SetDimHide( SvxShape* pShape, sal_Bool bDimHide )
{
- DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->GetPage(),
+ DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->getSdrPageFromSdrObject(),
"sd::EffectMigration::SetAnimationEffect(), invalid argument!" );
- if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->GetPage() )
+ if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->getSdrPageFromSdrObject() )
return;
SdrObject* pObj = pShape->GetSdrObject();
@@ -997,7 +997,7 @@ void EffectMigration::SetDimHide( SvxShape* pShape, sal_Bool bDimHide )
Any aEmpty;
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -1029,9 +1029,9 @@ sal_Bool EffectMigration::GetDimHide( SvxShape* pShape )
if( pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
- if( pObj && pObj->GetPage() )
+ if( pObj && pObj->getSdrPageFromSdrObject() )
{
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -1057,9 +1057,9 @@ sal_Bool EffectMigration::GetDimHide( SvxShape* pShape )
void EffectMigration::SetDimPrevious( SvxShape* pShape, sal_Bool bDimPrevious )
{
- DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->GetPage(),
+ DBG_ASSERT( pShape && pShape->GetSdrObject() && pShape->GetSdrObject()->getSdrPageFromSdrObject(),
"sd::EffectMigration::SetAnimationEffect(), invalid argument!" );
- if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->GetPage() )
+ if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->getSdrPageFromSdrObject() )
return;
SdrObject* pObj = pShape->GetSdrObject();
@@ -1071,7 +1071,7 @@ void EffectMigration::SetDimPrevious( SvxShape* pShape, sal_Bool bDimPrevious )
if( bDimPrevious )
aColor <<= (sal_Int32)COL_LIGHTGRAY;
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -1103,9 +1103,9 @@ sal_Bool EffectMigration::GetDimPrevious( SvxShape* pShape )
if( pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
- if( pObj && pObj->GetPage() )
+ if( pObj && pObj->getSdrPageFromSdrObject() )
{
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -1131,11 +1131,11 @@ sal_Bool EffectMigration::GetDimPrevious( SvxShape* pShape )
void EffectMigration::SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos )
{
- if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->GetPage() )
+ if( !pShape || !pShape->GetSdrObject() || !pShape->GetSdrObject()->getSdrPageFromSdrObject() )
return;
SdrObject* pObj = pShape->GetSdrObject();
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
EffectSequence& rSequence = pMainSequence->getSequence();
sal_Int32 nPos;
@@ -1229,7 +1229,7 @@ sal_Int32 EffectMigration::GetPresentationOrder( SvxShape* pShape )
sal_Int32 nPos = -1, nFound = -1;
SdrObject* pObj = pShape->GetSdrObject();
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
EffectSequence& rSequence = pMainSequence->getSequence();
@@ -1266,7 +1266,7 @@ void EffectMigration::UpdateSoundEffect( SvxShape* pShape, SdAnimationInfo* pInf
if( pInfo )
{
SdrObject* pObj = pShape->GetSdrObject();
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -1308,9 +1308,9 @@ OUString EffectMigration::GetSoundFile( SvxShape* pShape )
if( pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
- if( pObj && pObj->GetPage() )
+ if( pObj && pObj->getSdrPageFromSdrObject() )
{
- sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->getSdrPageFromSdrObject())->getMainSequence();
const Reference< XShape > xShape( pShape );
@@ -1349,10 +1349,8 @@ void EffectMigration::SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj )
if( pObj )
{
- //sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
-
const Reference< XShape > xShape( pShape );
- SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->GetPage() : 0 );
+ SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->getSdrPageFromSdrObject() : 0 );
if( pPage )
{
boost::shared_ptr< sd::MainSequence > pMainSequence( pPage->getMainSequence() );
diff --git a/sd/source/core/PageListWatcher.cxx b/sd/source/core/PageListWatcher.cxx
index 607741d2477a..1a94b1d22953 100644
--- a/sd/source/core/PageListWatcher.cxx
+++ b/sd/source/core/PageListWatcher.cxx
@@ -78,10 +78,14 @@ ImpPageListWatcher::ImpPageListWatcher(const SdrModel& rModel)
mpHandoutPage(0L),
mbPageListValid(sal_False)
{
+ // register as listener at SdrModel
+ StartListening(const_cast< SdrModel& >(rModel));
}
ImpPageListWatcher::~ImpPageListWatcher()
{
+ // unregister as listener at SdrModel
+ EndListening(const_cast< SdrModel& >(mrModel));
}
SdPage* ImpPageListWatcher::GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum)
@@ -197,6 +201,19 @@ ImpDrawPageListWatcher::~ImpDrawPageListWatcher()
{
}
+void ImpDrawPageListWatcher::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
+{
+ const SdrBaseHint* pSdrBaseHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrBaseHint
+ && HINT_PAGEORDERCHG == pSdrBaseHint->GetSdrHintKind()
+ && pSdrBaseHint->GetSdrHintPage()
+ && !pSdrBaseHint->GetSdrHintPage()->IsMasterPage())
+ {
+ Invalidate();
+ }
+}
+
//////////////////////////////////////////////////////////////////////////////
sal_uInt32 ImpMasterPageListWatcher::ImpGetPageCount() const
@@ -217,3 +234,19 @@ ImpMasterPageListWatcher::ImpMasterPageListWatcher(const SdrModel& rModel)
ImpMasterPageListWatcher::~ImpMasterPageListWatcher()
{
}
+
+void ImpMasterPageListWatcher::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
+{
+ const SdrBaseHint* pSdrBaseHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrBaseHint
+ && HINT_PAGEORDERCHG == pSdrBaseHint->GetSdrHintKind()
+ && pSdrBaseHint->GetSdrHintPage()
+ && pSdrBaseHint->GetSdrHintPage()->IsMasterPage())
+ {
+ Invalidate();
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/sd/source/core/PageListWatcher.hxx b/sd/source/core/PageListWatcher.hxx
index b2ceeae3723a..519f8cb24cf8 100644
--- a/sd/source/core/PageListWatcher.hxx
+++ b/sd/source/core/PageListWatcher.hxx
@@ -27,6 +27,7 @@
#include "pres.hxx"
#include <sal/types.h>
#include <vector>
+#include <svl/lstner.hxx>
class SdPage;
class SdrModel;
@@ -34,7 +35,7 @@ class SdrModel;
/** Maintain a map of page indices to page objects for faster access that
remains valid during deletions and insertions of pages (#109538#).
*/
-class ImpPageListWatcher
+class ImpPageListWatcher : public SfxListener
{
protected:
// typedefs for a vector of SdPages
@@ -77,6 +78,9 @@ protected:
public:
ImpDrawPageListWatcher(const SdrModel& rModel);
virtual ~ImpDrawPageListWatcher();
+
+ // derived from SfxListener
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
};
//////////////////////////////////////////////////////////////////////////////
@@ -90,6 +94,9 @@ protected:
public:
ImpMasterPageListWatcher(const SdrModel& rModel);
virtual ~ImpMasterPageListWatcher();
+
+ // derived from SfxListener
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
};
#endif
diff --git a/sd/source/core/anminfo.cxx b/sd/source/core/anminfo.cxx
index 0aed532a0b6c..f005b8c01932 100644
--- a/sd/source/core/anminfo.cxx
+++ b/sd/source/core/anminfo.cxx
@@ -42,23 +42,23 @@
using namespace ::com::sun::star;
SdAnimationInfo::SdAnimationInfo(SdrObject& rObject)
- : SdrObjUserData(SdUDInventor, SD_ANIMATIONINFO_ID, 0),
+ : SdrObjUserData(SdUDInventor, SD_ANIMATIONINFO_ID ),
mePresObjKind (PRESOBJ_NONE),
meEffect (presentation::AnimationEffect_NONE),
meTextEffect (presentation::AnimationEffect_NONE),
meSpeed (presentation::AnimationSpeed_SLOW),
- mbActive (sal_True),
- mbDimPrevious (sal_False),
- mbIsMovie (sal_False),
- mbDimHide (sal_False),
- mbSoundOn (sal_False),
- mbPlayFull (sal_False),
+ mbActive (true),
+ mbDimPrevious (false),
+ mbIsMovie (false),
+ mbDimHide (false),
+ mbSoundOn (false),
+ mbPlayFull (false),
mpPathObj (NULL),
meClickAction (presentation::ClickAction_NONE),
meSecondEffect (presentation::AnimationEffect_NONE),
meSecondSpeed (presentation::AnimationSpeed_SLOW),
- mbSecondSoundOn (sal_False),
- mbSecondPlayFull (sal_False),
+ mbSecondSoundOn (false),
+ mbSecondPlayFull (false),
mnVerb (0),
mnPresOrder (LIST_APPEND),
mrObject (rObject)
diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx
index f84df44eafeb..f6017558f2e3 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -63,7 +63,7 @@ public:
explicit Annotation( const Reference< XComponentContext >& context, SdPage* pPage );
SdPage* GetPage() const { return mpPage; }
- SdrModel* GetModel() { return (mpPage != 0) ? mpPage->GetModel() : 0; }
+ SdrModel* GetModel() { return mpPage ? &mpPage->getSdrModelFromSdrPage() : 0; }
// XInterface:
virtual Any SAL_CALL queryInterface(Type const & type) throw (RuntimeException);
@@ -341,7 +341,7 @@ Reference< XText > SAL_CALL Annotation::getTextRange() throw (RuntimeException)
osl::MutexGuard g(m_aMutex);
if( !m_TextRange.is() && (mpPage != 0) )
{
- m_TextRange = TextApiObject::create( static_cast< SdDrawDocument* >( mpPage->GetModel() ) );
+ m_TextRange = TextApiObject::create( static_cast< SdDrawDocument* >( &mpPage->getSdrModelFromSdrPage() ) );
}
return Reference< XText >( m_TextRange.get() );
}
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index cce06aba7acf..f12d71aebeb8 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -101,8 +101,6 @@ using namespace ::com::sun::star::linguistic2;
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdDrawDocument, FmFormModel );
-
SdDrawDocument* SdDrawDocument::pDocLockedInsertingLinks = NULL;
//////////////////////////////////////////////////////////////////////////////
@@ -158,15 +156,15 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
, mpCustomShowList(NULL)
, mpDocSh(static_cast< ::sd::DrawDocShell*>(pDrDocSh))
, mpCreatingTransferable( NULL )
-, mbHasOnlineSpellErrors(sal_False)
-, mbInitialOnlineSpellingEnabled(sal_True)
-, mbNewOrLoadCompleted(sal_False)
+, mbHasOnlineSpellErrors(false)
+, mbInitialOnlineSpellingEnabled(true)
+, mbNewOrLoadCompleted(false)
, mbStartWithPresentation( false )
, meLanguage( LANGUAGE_SYSTEM )
, meLanguageCJK( LANGUAGE_SYSTEM )
, meLanguageCTL( LANGUAGE_SYSTEM )
, mePageNumType(SVX_ARABIC)
-, mbAllocDocSh(sal_False)
+, mbAllocDocSh(false)
, meDocType(eType)
, mpCharClass(NULL)
, mpLocale(NULL)
@@ -183,7 +181,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
if (mpDocSh)
{
- SetSwapGraphics(sal_True);
+ SetSwapGraphics(true);
}
// Masseinheit (von App) und Massstab (von SdMod) setzen
@@ -193,20 +191,26 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
// #92067# Allow UI scale only for draw documents.
if( eType == DOCUMENT_TYPE_DRAW )
- SetUIUnit( (FieldUnit)pOptions->GetMetric(), Fraction( nX, nY ) ); // user-defined
+ {
+ SetUIUnit((FieldUnit)pOptions->GetMetric()); // user-defined
+ SetUIScale(Fraction(nX, nY)); // user-defined
+ }
else
- SetUIUnit( (FieldUnit)pOptions->GetMetric(), Fraction( 1, 1 ) ); // default
+ {
+ SetUIUnit((FieldUnit)pOptions->GetMetric()); // default
+ SetUIScale(Fraction(1, 1)); // default
+ }
- SetScaleUnit(MAP_100TH_MM);
- SetScaleFraction(Fraction(1, 1));
+ SetExchangeObjectUnit(MAP_100TH_MM);
+ SetExchangeObjectScale(Fraction(1, 1));
SetDefaultFontHeight(847); // 24p
- pItemPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
- pItemPool->FreezeIdRanges();
- SetTextDefaults();
+ GetItemPool().SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
+ GetItemPool().FreezeIdRanges();
+ SetSDTextDefaults();
// die DrawingEngine muss auch wissen, wo er ist
- FmFormModel::SetStyleSheetPool( new SdStyleSheetPool( GetPool(), this ) );
+ FmFormModel::SetStyleSheetPool( new SdStyleSheetPool( GetItemPool(), this ) );
// Dem DrawOutliner den StyleSheetPool setzen, damit Textobjekte richtig
// eingelesen werden koennen. Der Link zum StyleRequest-Handler des
@@ -247,7 +251,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
// for korean and japanese languages we have a different default for apply spacing between asian, latin and ctl text
if( ( LANGUAGE_KOREAN == eRealCTLLanguage ) || ( LANGUAGE_KOREAN_JOHAB == eRealCTLLanguage ) || ( LANGUAGE_JAPANESE == eRealCTLLanguage ) )
{
- GetPool().GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( sal_False, EE_PARA_ASIANCJKSPACING ) );
+ GetItemPool().GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
}
// DefTab und SpellOptions setzen
@@ -279,7 +283,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
SetLinkManager( new sfx2::LinkManager(mpDocSh) );
}
- sal_uLong nCntrl = rOutliner.GetControlWord();
+ sal_uInt32 nCntrl = rOutliner.GetControlWord();
nCntrl |= EE_CNTRL_ALLOWBIGOBJS;
nCntrl |= EE_CNTRL_URLSFXEXECUTE;
@@ -302,43 +306,6 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
// Initialize the printer independent layout mode.
SetPrinterIndependentLayout (pOptions->GetPrinterIndependentLayout());
- // Dem HitTestOutliner den StyleSheetPool setzen.
- // Der Link zum StyleRequest-Handler des
- // Dokuments wird erst in NewOrLoadCompleted gesetzt, da erst dann alle
- // Vorlagen existieren.
- SfxItemSet aSet2( pHitTestOutliner->GetEmptyItemSet() );
- pHitTestOutliner->SetStyleSheetPool( (SfxStyleSheetPool*)GetStyleSheetPool() );
-
- SetCalcFieldValueHdl( pHitTestOutliner );
-
- try
- {
- Reference< XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
- if ( xSpellChecker.is() )
- pHitTestOutliner->SetSpeller( xSpellChecker );
-
- Reference< XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
- if( xHyphenator.is() )
- pHitTestOutliner->SetHyphenator( xHyphenator );
- }
- catch(...)
- {
- DBG_ERROR("Can't get SpellChecker");
- }
-
- pHitTestOutliner->SetDefaultLanguage( Application::GetSettings().GetLanguage() );
-
- sal_uLong nCntrl2 = pHitTestOutliner->GetControlWord();
- nCntrl2 |= EE_CNTRL_ALLOWBIGOBJS;
- nCntrl2 |= EE_CNTRL_URLSFXEXECUTE;
- nCntrl2 &= ~EE_CNTRL_ONLINESPELLING;
-
- nCntrl2 &= ~ EE_CNTRL_ULSPACESUMMATION;
- if ( pOptions->IsSummationOfParagraphs() )
- nCntrl2 |= EE_CNTRL_ULSPACESUMMATION;
-
- pHitTestOutliner->SetControlWord( nCntrl2 );
-
/**************************************************************************
* Layer anlegen
*
@@ -357,8 +324,8 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
**************************************************************************/
{
String aControlLayerName( SdResId(STR_LAYER_CONTROLS) );
+ SdrLayerAdmin& rLayerAdmin = GetModelLayerAdmin();
- SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
rLayerAdmin.NewLayer( String(SdResId(STR_LAYER_LAYOUT)) );
rLayerAdmin.NewLayer( String(SdResId(STR_LAYER_BCKGRND)) );
rLayerAdmin.NewLayer( String(SdResId(STR_LAYER_BCKGRNDOBJ)) );
@@ -379,7 +346,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
SdDrawDocument::~SdDrawDocument()
{
- Broadcast(SdrHint(HINT_MODELCLEARED));
+ Broadcast(SdrBaseHint(HINT_MODELCLEARED));
if (mpWorkStartupTimer)
{
@@ -395,26 +362,26 @@ SdDrawDocument::~SdDrawDocument()
mpOnlineSearchItem = NULL;
CloseBookmarkDoc();
- SetAllocDocSh(sal_False);
+ SetAllocDocSh(false);
// #116168#
- ClearModel(sal_True);
+ ClearModel(true);
- if (pLinkManager)
+ if (GetLinkManager())
{
// BaseLinks freigeben
- if ( pLinkManager->GetLinks().Count() )
+ if ( GetLinkManager()->GetLinks().Count() )
{
- pLinkManager->Remove( 0, pLinkManager->GetLinks().Count() );
+ GetLinkManager()->Remove( 0, GetLinkManager()->GetLinks().Count() );
}
- delete pLinkManager;
- pLinkManager = NULL;
+ delete GetLinkManager();
+ SetLinkManager(0);
}
::sd::FrameView* pFrameView = NULL;
- for (sal_uLong i = 0; i < mpFrameViewList->Count(); i++)
+ for (sal_uInt32 i = 0; i < mpFrameViewList->Count(); i++)
{
// Ggf. FrameViews loeschen
pFrameView =
@@ -429,7 +396,7 @@ SdDrawDocument::~SdDrawDocument()
if (mpCustomShowList)
{
- for (sal_uLong j = 0; j < mpCustomShowList->Count(); j++)
+ for (sal_uInt32 j = 0; j < mpCustomShowList->Count(); j++)
{
// Ggf. CustomShows loeschen
SdCustomShow* pCustomShow = (SdCustomShow*) mpCustomShowList->GetObject(j);
@@ -473,10 +440,10 @@ SdrModel* SdDrawDocument::AllocModel() const
if( meDocType == DOCUMENT_TYPE_IMPRESS )
mpCreatingTransferable->SetDocShell( new ::sd::DrawDocShell(
- SFX_CREATE_MODE_EMBEDDED, sal_True, meDocType ) );
+ SFX_CREATE_MODE_EMBEDDED, true, meDocType ) );
else
mpCreatingTransferable->SetDocShell( new ::sd::GraphicDocShell(
- SFX_CREATE_MODE_EMBEDDED, sal_True, meDocType ) );
+ SFX_CREATE_MODE_EMBEDDED, true, meDocType ) );
pNewDocSh = static_cast< ::sd::DrawDocShell*>( pObj = mpCreatingTransferable->GetDocShell() );
pNewDocSh->DoInitNew( NULL );
@@ -492,7 +459,7 @@ SdrModel* SdDrawDocument::AllocModel() const
pNewStylePool->CopyTableStyles(*pOldStylePool);
- for (sal_uInt16 i = 0; i < GetMasterSdPageCount(PK_STANDARD); i++)
+ for (sal_uInt32 i = 0; i < GetMasterSdPageCount(PK_STANDARD); i++)
{
// Alle Layouts der MasterPage mitnehmen
String aOldLayoutName(((SdDrawDocument*) this)->GetMasterSdPage(i, PK_STANDARD)->GetLayoutName());
@@ -507,9 +474,9 @@ SdrModel* SdDrawDocument::AllocModel() const
{
// Es wird eine DocShell erzeugt, welche mit GetAllocedDocSh() zurueckgegeben wird
SdDrawDocument* pDoc = (SdDrawDocument*) this;
- pDoc->SetAllocDocSh(sal_False);
+ pDoc->SetAllocDocSh(false);
pDoc->mxAllocedDocShRef = new ::sd::DrawDocShell(
- SFX_CREATE_MODE_EMBEDDED, sal_True, meDocType);
+ SFX_CREATE_MODE_EMBEDDED, true, meDocType);
pDoc->mxAllocedDocShRef->DoInitNew(NULL);
pNewModel = pDoc->mxAllocedDocShRef->GetDoc();
}
@@ -530,9 +497,9 @@ SdrModel* SdDrawDocument::AllocModel() const
|*
\************************************************************************/
-SdrPage* SdDrawDocument::AllocPage(FASTBOOL bMasterPage)
+SdrPage* SdDrawDocument::AllocPage(bool bMasterPage)
{
- return new SdPage(*this, NULL, (sal_Bool)bMasterPage);
+ return new SdPage(*this, NULL, bMasterPage);
}
/*************************************************************************
@@ -541,7 +508,7 @@ SdrPage* SdDrawDocument::AllocPage(FASTBOOL bMasterPage)
|*
\************************************************************************/
-void SdDrawDocument::SetChanged(sal_Bool bFlag)
+void SdDrawDocument::SetChanged(bool bFlag)
{
if (mpDocSh)
{
@@ -567,7 +534,7 @@ void SdDrawDocument::SetChanged(sal_Bool bFlag)
|*
\************************************************************************/
-void SdDrawDocument::NbcSetChanged(sal_Bool bFlag)
+void SdDrawDocument::NbcSetChanged(bool bFlag)
{
// #100237# forward to baseclass
FmFormModel::SetChanged(bFlag);
@@ -592,7 +559,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
CreateLayoutTemplates();
CreateDefaultCellStyles();
- static_cast< SdStyleSheetPool* >( mxStyleSheetPool.get() )->CreatePseudosIfNecessary();
+ GetSdStyleSheetPool()->CreatePseudosIfNecessary();
}
else if (eMode == DOC_LOADED)
{
@@ -601,9 +568,9 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
CheckMasterPages();
if ( GetMasterSdPageCount(PK_STANDARD) > 1 )
- RemoveUnnecessaryMasterPages( NULL, sal_True, sal_False );
+ RemoveUnnecessaryMasterPages( NULL, true, false );
- for ( sal_uInt16 i = 0; i < GetPageCount(); i++ )
+ for ( sal_uInt32 i = 0; i < GetPageCount(); i++ )
{
// Check for correct layout names
SdPage* pPage = (SdPage*) GetPage( i );
@@ -619,7 +586,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
}
}
- for ( sal_uInt16 nPage = 0; nPage < GetMasterPageCount(); nPage++)
+ for ( sal_uInt32 nPage = 0; nPage < GetMasterPageCount(); nPage++)
{
// LayoutName and PageName must be the same
SdPage* pPage = (SdPage*) GetMasterPage( nPage );
@@ -635,15 +602,15 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
RestoreLayerNames();
// Sprachabhaengige Namen der Vorlagen setzen
- static_cast<SdStyleSheetPool*>(mxStyleSheetPool.get())->UpdateStdNames();
+ GetSdStyleSheetPool()->UpdateStdNames();
// Ggf. fehlende Vorlagen erzeugen (es gab z.B. frueher keinen Subtitle)
- static_cast<SdStyleSheetPool*>(mxStyleSheetPool.get())->CreatePseudosIfNecessary();
+ GetSdStyleSheetPool()->CreatePseudosIfNecessary();
}
// Standardvorlage an der Drawing Engine setzen
String aName( SdResId(STR_STANDARD_STYLESHEET_NAME));
- SetDefaultStyleSheet(static_cast<SfxStyleSheet*>(mxStyleSheetPool->Find(aName, SD_STYLE_FAMILY_GRAPHICS)));
+ SetDefaultStyleSheet(static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_GRAPHICS)));
// #119287# Set default StyleSheet for SdrGrafObj and SdrOle2Obj
SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(static_cast<SfxStyleSheet*>(mxStyleSheetPool->Find(String( SdResId(STR_POOLSHEET_OBJNOLINENOFILL)), SD_STYLE_FAMILY_GRAPHICS)));
@@ -653,18 +620,13 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
// dokumentspezifisch wie StyleSheetPool und StyleRequestHandler
::Outliner& rDrawOutliner = GetDrawOutliner();
rDrawOutliner.SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
- sal_uLong nCntrl = rDrawOutliner.GetControlWord();
+ sal_uInt32 nCntrl = rDrawOutliner.GetControlWord();
if (mbOnlineSpell)
nCntrl |= EE_CNTRL_ONLINESPELLING;
else
nCntrl &= ~EE_CNTRL_ONLINESPELLING;
rDrawOutliner.SetControlWord(nCntrl);
- // HitTest-Outliner und Dokument Outliner initialisieren,
- // aber nicht den globalen Outliner, den der ist ja nicht
- // dokumentspezifisch wie StyleSheetPool und StyleRequestHandler
- pHitTestOutliner->SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
-
if(mpOutliner)
{
mpOutliner->SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
@@ -679,7 +641,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
// Praesentationsobjekte muessen wieder Listener der entsprechenden
// Vorlagen werden
SdStyleSheetPool* pSPool = (SdStyleSheetPool*) GetStyleSheetPool();
- sal_uInt16 nPage, nPageCount;
+ sal_uInt32 nPage, nPageCount;
// #96323# create missing layout style sheets for broken documents
// that where created with the 5.2
@@ -706,37 +668,24 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
}
}
- mbNewOrLoadCompleted = sal_True;
+ mbNewOrLoadCompleted = true;
/**************************************************************************
* Alle gelinkten Pages aktualisieren
**************************************************************************/
- SdPage* pPage = NULL;
- sal_uInt16 nMaxSdPages = GetSdPageCount(PK_STANDARD);
-
- for (sal_uInt16 nSdPage=0; nSdPage < nMaxSdPages; nSdPage++)
- {
- pPage = (SdPage*) GetSdPage(nSdPage, PK_STANDARD);
-
- if (pPage && pPage->GetFileName().Len() && pPage->GetBookmarkName().Len())
- {
- pPage->SetModel(this);
- }
- }
-
UpdateAllLinks();
- SetChanged( sal_False );
+ SetChanged( false );
}
/** updates all links, only links in this document should by resolved */
void SdDrawDocument::UpdateAllLinks()
{
- if ( !pDocLockedInsertingLinks && pLinkManager && pLinkManager->GetLinks().Count() )
+ if ( !pDocLockedInsertingLinks && GetLinkManager() && GetLinkManager()->GetLinks().Count() )
{
pDocLockedInsertingLinks = this; // lock inserting links. only links in this document should by resolved
- pLinkManager->UpdateAllLinks(); // query box: update all links?
+ GetLinkManager()->UpdateAllLinks(); // query box: update all links?
if( pDocLockedInsertingLinks == this )
pDocLockedInsertingLinks = NULL; // unlock inserting links
@@ -774,7 +723,7 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
SfxStyleSheet* pTitleSheet = (SfxStyleSheet*)
pSPool->GetTitleSheet(aName);
- SdrObject* pObj = rPresentationShapes.getNextShape(0);
+ const SdrObject* pObj = rPresentationShapes.getNextShape(0);
// jetzt nach Titel- und Gliederungstextobjekten suchen und
// Objekte zu Listenern machen
@@ -790,39 +739,39 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
if( pOPO && pOPO->GetOutlinerMode() == OUTLINERMODE_DONTKNOW )
pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT );
- // sal_True: harte Attribute dabei nicht loeschen
+ // true: harte Attribute dabei nicht loeschen
if (pTitleSheet)
- pObj->SetStyleSheet(pTitleSheet, sal_True);
+ const_cast< SdrObject* >(pObj)->SetStyleSheet(pTitleSheet, true);
}
else if (nId == OBJ_OUTLINETEXT)
{
if( pOPO && pOPO->GetOutlinerMode() == OUTLINERMODE_DONTKNOW )
pOPO->SetOutlinerMode( OUTLINERMODE_OUTLINEOBJECT );
- for (sal_uInt16 nSheet = 0; nSheet < 10; nSheet++)
+ for (sal_uInt32 nSheet = 0; nSheet < 10; nSheet++)
{
SfxStyleSheet* pSheet = (SfxStyleSheet*)pOutlineList->GetObject(nSheet);
if (pSheet)
{
- pObj->StartListening(*pSheet);
+ const_cast< SdrObject* >(pObj)->StartListening(*pSheet);
if( nSheet == 0)
// Textrahmen hoert auf StyleSheet der Ebene1
- pObj->NbcSetStyleSheet(pSheet, sal_True);
+ const_cast< SdrObject* >(pObj)->SetStyleSheet(pSheet, true);
}
}
}
- if (pObj->ISA(SdrTextObj) && pObj->IsEmptyPresObj() && pPage)
+ if (dynamic_cast< const SdrTextObj* >(pObj) && pObj->IsEmptyPresObj() && pPage)
{
- PresObjKind ePresObjKind = pPage->GetPresObjKind(pObj);
- String aString( pPage->GetPresObjText(ePresObjKind) );
+ const PresObjKind ePresObjKind(pPage->GetPresObjKind(pObj));
+ const String aString( pPage->GetPresObjText(ePresObjKind) );
if (aString.Len())
{
- sd::Outliner* pInternalOutl = GetInternalOutliner(sal_True);
+ sd::Outliner* pInternalOutl = GetInternalOutliner(true);
pPage->SetObjText( (SdrTextObj*) pObj, pInternalOutl, ePresObjKind, aString );
- pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( ePresObjKind ), sal_True );
+ const_cast< SdrObject* >(pObj)->SetStyleSheet( pPage->GetStyleSheetForPresObj( ePresObjKind ), true );
pInternalOutl->Clear();
}
}
@@ -842,7 +791,7 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
|*
\************************************************************************/
-::sd::Outliner* SdDrawDocument::GetOutliner(sal_Bool bCreateOutliner)
+::sd::Outliner* SdDrawDocument::GetOutliner(bool bCreateOutliner)
{
if (!mpOutliner && bCreateOutliner)
{
@@ -851,7 +800,7 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
if (mpDocSh)
mpOutliner->SetRefDevice( SD_MOD()->GetRefDevice( *mpDocSh ) );
- mpOutliner->SetDefTab( nDefaultTabulator );
+ mpOutliner->SetDefTab(GetDefaultTabulator());
mpOutliner->SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
}
@@ -867,7 +816,7 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
|*
\************************************************************************/
-::sd::Outliner* SdDrawDocument::GetInternalOutliner(sal_Bool bCreateOutliner)
+::sd::Outliner* SdDrawDocument::GetInternalOutliner(bool bCreateOutliner)
{
if ( !mpInternalOutliner && bCreateOutliner )
{
@@ -875,19 +824,19 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
// MT:
// Dieser Outliner wird nur fuer das Erzeugen spezieller Textobjekte
// verwendet. Da in diesen Textobjekten keine Portion-Informationen
- // gespeichert werden muessen, kann/soll der Update-Mode immer sal_False bleiben.
- mpInternalOutliner->SetUpdateMode( sal_False );
- mpInternalOutliner->EnableUndo( sal_False );
+ // gespeichert werden muessen, kann/soll der Update-Mode immer false bleiben.
+ mpInternalOutliner->SetUpdateMode( false );
+ mpInternalOutliner->EnableUndo( false );
if (mpDocSh)
mpInternalOutliner->SetRefDevice( SD_MOD()->GetRefDevice( *mpDocSh ) );
- mpInternalOutliner->SetDefTab( nDefaultTabulator );
+ mpInternalOutliner->SetDefTab(GetDefaultTabulator());
mpInternalOutliner->SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
}
- DBG_ASSERT( !mpInternalOutliner || ( mpInternalOutliner->GetUpdateMode() == sal_False ) , "InternalOutliner: UpdateMode = sal_True !" );
- DBG_ASSERT( !mpInternalOutliner || ( mpInternalOutliner->IsUndoEnabled() == sal_False ), "InternalOutliner: Undo = sal_True !" );
+ DBG_ASSERT( !mpInternalOutliner || ( mpInternalOutliner->GetUpdateMode() == false ) , "InternalOutliner: UpdateMode = true !" );
+ DBG_ASSERT( !mpInternalOutliner || ( mpInternalOutliner->IsUndoEnabled() == false ), "InternalOutliner: Undo = true !" );
// MT: Wer ihn vollmuellt, macht ihn auch gleich wieder leer:
// Vorteile:
@@ -904,10 +853,10 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
|*
\************************************************************************/
-void SdDrawDocument::SetOnlineSpell(sal_Bool bIn)
+void SdDrawDocument::SetOnlineSpell(bool bIn)
{
mbOnlineSpell = bIn;
- sal_uLong nCntrl = 0;
+ sal_uInt32 nCntrl = 0;
if(mpOutliner)
{
@@ -1030,16 +979,16 @@ void SdDrawDocument::SetStartWithPresentation( bool bStartWithPresentation )
}
// #109538#
-void SdDrawDocument::PageListChanged()
-{
- mpDrawPageListWatcher->Invalidate();
-}
+//void SdDrawDocument::PageListChanged()
+//{
+// mpDrawPageListWatcher->Invalidate();
+//}
// #109538#
-void SdDrawDocument::MasterPageListChanged()
-{
- mpMasterPageListWatcher->Invalidate();
-}
+//void SdDrawDocument::MasterPageListChanged()
+//{
+// mpMasterPageListWatcher->Invalidate();
+//}
void SdDrawDocument::SetCalcFieldValueHdl(::Outliner* pOutliner)
{
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index a13303c500cc..cb781e1cb1e8 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -76,6 +76,7 @@
#include "PageListWatcher.hxx"
#include <vcl/virdev.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::sd;
@@ -98,8 +99,8 @@ SdrObject* SdDrawDocument::GetObj(const String& rObjName) const
/**************************************************************************
* Zuerst alle Pages durchsuchen
**************************************************************************/
- sal_uInt16 nPage = 0;
- const sal_uInt16 nMaxPages = GetPageCount();
+ sal_uInt32 nPage = 0;
+ const sal_uInt32 nMaxPages = GetPageCount();
while (nPage < nMaxPages && !pObjFound)
{
@@ -126,7 +127,7 @@ SdrObject* SdDrawDocument::GetObj(const String& rObjName) const
* Wenn nicht gefunden, dann alle MasterPages durchsuchen
**************************************************************************/
nPage = 0;
- const sal_uInt16 nMaxMasterPages = GetMasterPageCount();
+ const sal_uInt32 nMaxMasterPages = GetMasterPageCount();
while (nPage < nMaxMasterPages && !pObjFound)
{
@@ -159,14 +160,14 @@ SdrObject* SdDrawDocument::GetObj(const String& rObjName) const
|*
\************************************************************************/
-sal_uInt16 SdDrawDocument::GetPageByName(const String& rPgName, sal_Bool& rbIsMasterPage) const
+sal_uInt32 SdDrawDocument::GetPageByName(const String& rPgName, bool& rbIsMasterPage) const
{
SdPage* pPage = NULL;
- sal_uInt16 nPage = 0;
- const sal_uInt16 nMaxPages = GetPageCount();
- sal_uInt16 nPageNum = SDRPAGE_NOTFOUND;
+ sal_uInt32 nPage = 0;
+ const sal_uInt32 nMaxPages = GetPageCount();
+ sal_uInt32 nPageNum = SDRPAGE_NOTFOUND;
- rbIsMasterPage = sal_False;
+ rbIsMasterPage = false;
// Search all regular pages and all notes pages (handout pages are
// ignored.)
@@ -186,7 +187,7 @@ sal_uInt16 SdDrawDocument::GetPageByName(const String& rPgName, sal_Bool& rbIsMa
}
// Search all master pages when not found among non-master pages.
- const sal_uInt16 nMaxMasterPages = GetMasterPageCount();
+ const sal_uInt32 nMaxMasterPages = GetMasterPageCount();
nPage = 0;
while (nPage < nMaxMasterPages && nPageNum == SDRPAGE_NOTFOUND)
@@ -197,7 +198,7 @@ sal_uInt16 SdDrawDocument::GetPageByName(const String& rPgName, sal_Bool& rbIsMa
if (pPage && pPage->GetName() == rPgName)
{
nPageNum = nPage;
- rbIsMasterPage = sal_True;
+ rbIsMasterPage = true;
}
nPage++;
@@ -213,10 +214,10 @@ sal_uInt16 SdDrawDocument::GetPageByName(const String& rPgName, sal_Bool& rbIsMa
|*
\************************************************************************/
-SdPage* SdDrawDocument::GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
+SdPage* SdDrawDocument::GetSdPage(sal_uInt32 nPgNum, PageKind ePgKind) const
{
// #109538#
- return mpDrawPageListWatcher->GetSdPage(ePgKind, sal_uInt32(nPgNum));
+ return mpDrawPageListWatcher->GetSdPage(ePgKind, nPgNum);
}
/*************************************************************************
@@ -225,7 +226,7 @@ SdPage* SdDrawDocument::GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
|*
\************************************************************************/
-sal_uInt16 SdDrawDocument::GetSdPageCount(PageKind ePgKind) const
+sal_uInt32 SdDrawDocument::GetSdPageCount(PageKind ePgKind) const
{
// #109538#
return (sal_uInt16)mpDrawPageListWatcher->GetSdPageCount(ePgKind);
@@ -237,10 +238,10 @@ sal_uInt16 SdDrawDocument::GetSdPageCount(PageKind ePgKind) const
|*
\************************************************************************/
-SdPage* SdDrawDocument::GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
+SdPage* SdDrawDocument::GetMasterSdPage(sal_uInt32 nPgNum, PageKind ePgKind)
{
// #109538#
- return mpMasterPageListWatcher->GetSdPage(ePgKind, sal_uInt32(nPgNum));
+ return mpMasterPageListWatcher->GetSdPage(ePgKind, nPgNum);
}
/*************************************************************************
@@ -249,7 +250,7 @@ SdPage* SdDrawDocument::GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
|*
\************************************************************************/
-sal_uInt16 SdDrawDocument::GetMasterSdPageCount(PageKind ePgKind) const
+sal_uInt32 SdDrawDocument::GetMasterSdPageCount(PageKind ePgKind) const
{
// #109538#
return (sal_uInt16)mpMasterPageListWatcher->GetSdPageCount(ePgKind);
@@ -262,12 +263,12 @@ sal_uInt16 SdDrawDocument::GetMasterSdPageCount(PageKind ePgKind) const
|*
\************************************************************************/
-void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 nStartPos)
+void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt32 nStartPos)
{
- sal_uInt16 nPageCount = GetPageCount();
+ sal_uInt32 nPageCount = GetPageCount();
SdPage* pPage = NULL;
- for (sal_uInt16 nPage = nStartPos; nPage < nPageCount; nPage++)
+ for (sal_uInt32 nPage = nStartPos; nPage < nPageCount; nPage++)
{
pPage = (SdPage*)GetPage(nPage);
@@ -275,9 +276,9 @@ void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 nStartPos)
// und Nummer korrigieren
if (pPage && pPage->GetPageKind() == PK_NOTES)
{
- sal_uLong nObjCount = pPage->GetObjCount();
- SdrObject* pObj = NULL;
- for (sal_uLong nObj = 0; nObj < nObjCount; nObj++)
+ sal_uInt32 nObjCount = pPage->GetObjCount();
+ SdrObject* pObj = 0;
+ for (sal_uInt32 nObj = 0; nObj < nObjCount; nObj++)
{
pObj = pPage->GetObj(nObj);
if (pObj->GetObjIdentifier() == OBJ_PAGE &&
@@ -302,11 +303,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(const String& rOldName, const String
if (rNewName.Len() == 0)
return;
- SfxItemPool& pPool(GetPool());
- sal_uInt32 nCount = pPool.GetItemCount2(EE_FEATURE_FIELD);
+ const sal_uInt32 nCount(GetItemPool().GetItemCount2(EE_FEATURE_FIELD));
+
for (sal_uInt32 nOff = 0; nOff < nCount; nOff++)
{
- const SfxPoolItem *pItem = pPool.GetItem2(EE_FEATURE_FIELD, nOff);
+ const SfxPoolItem *pItem = GetItemPool().GetItem2(EE_FEATURE_FIELD, nOff);
const SvxFieldItem* pFldItem = dynamic_cast< const SvxFieldItem * > (pItem);
if(pFldItem)
@@ -343,15 +344,14 @@ void SdDrawDocument::UpdatePageRelativeURLs(const String& rOldName, const String
}
}
-void SdDrawDocument::UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement)
+void SdDrawDocument::UpdatePageRelativeURLs(SdPage* pPage, sal_uInt32 nPos, sal_Int32 nIncrement)
{
bool bNotes = (pPage->GetPageKind() == PK_NOTES);
+ const sal_uInt32 nCount(GetItemPool().GetItemCount2(EE_FEATURE_FIELD));
- SfxItemPool& pPool(GetPool());
- sal_uInt32 nCount = pPool.GetItemCount2(EE_FEATURE_FIELD);
for (sal_uInt32 nOff = 0; nOff < nCount; nOff++)
{
- const SfxPoolItem *pItem = pPool.GetItem2(EE_FEATURE_FIELD, nOff);
+ const SfxPoolItem *pItem = GetItemPool().GetItem2(EE_FEATURE_FIELD, nOff);
const SvxFieldItem* pFldItem;
if ((pFldItem = dynamic_cast< const SvxFieldItem * > (pItem)) != 0)
@@ -383,9 +383,9 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_
aURLCopy.Erase(aURLCopy.Len() - sNotes.Len(), sNotes.Len());
sal_Int32 number = aURLCopy.ToInt32();
- sal_uInt16 realPageNumber = (nPos + 1)/ 2;
+ sal_uInt32 realPageNumber = (nPos + 1)/ 2;
- if ( number >= realPageNumber )
+ if ( number >= (sal_Int32)realPageNumber )
{
// update link page number
number += nIncrement;
@@ -411,12 +411,12 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_
|*
\************************************************************************/
-void SdDrawDocument::MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
+void SdDrawDocument::MovePage(sal_uInt32 nPgNum, sal_uInt32 nNewPos)
{
// Seite verschieben
FmFormModel::MovePage(nPgNum, nNewPos);
- sal_uInt16 nMin = Min(nPgNum, nNewPos);
+ sal_uInt32 nMin = Min(nPgNum, nNewPos);
UpdatePageObjectsInNotes(nMin);
}
@@ -427,7 +427,7 @@ void SdDrawDocument::MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
|*
\************************************************************************/
-void SdDrawDocument::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
+void SdDrawDocument::InsertPage(SdrPage* pPage, sal_uInt32 nPos)
{
bool bLast = (nPos == GetPageCount());
@@ -448,7 +448,7 @@ void SdDrawDocument::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
|*
\************************************************************************/
-void SdDrawDocument::DeletePage(sal_uInt16 nPgNum)
+void SdDrawDocument::DeletePage(sal_uInt32 nPgNum)
{
FmFormModel::DeletePage(nPgNum);
@@ -461,7 +461,7 @@ void SdDrawDocument::DeletePage(sal_uInt16 nPgNum)
|*
\************************************************************************/
-SdrPage* SdDrawDocument::RemovePage(sal_uInt16 nPgNum)
+SdrPage* SdDrawDocument::RemovePage(sal_uInt32 nPgNum)
{
SdrPage* pPage = FmFormModel::RemovePage(nPgNum);
@@ -479,7 +479,7 @@ SdrPage* SdDrawDocument::RemovePage(sal_uInt16 nPgNum)
// Warning: This is not called for new master pages created from SdrModel::Merge,
// you also have to modify code in SdDrawDocument::Merge!
-void SdDrawDocument::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos )
+void SdDrawDocument::InsertMasterPage(SdrPage* pPage, sal_uInt32 nPos )
{
FmFormModel::InsertMasterPage( pPage, nPos );
if( pPage && pPage->IsMasterPage() && (static_cast<SdPage*>(pPage)->GetPageKind() == PK_STANDARD) )
@@ -491,7 +491,7 @@ void SdDrawDocument::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos )
}
}
-SdrPage* SdDrawDocument::RemoveMasterPage(sal_uInt16 nPgNum)
+SdrPage* SdDrawDocument::RemoveMasterPage(sal_uInt32 nPgNum)
{
SdPage* pPage = static_cast<SdPage*>(GetMasterPage(nPgNum ));
if( pPage && pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) )
@@ -511,7 +511,7 @@ SdrPage* SdDrawDocument::RemoveMasterPage(sal_uInt16 nPgNum)
|*
\************************************************************************/
-void SdDrawDocument::SetSelected(SdPage* pPage, sal_Bool bSelect)
+void SdDrawDocument::SetSelected(SdPage* pPage, bool bSelect)
{
PageKind ePageKind = pPage->GetPageKind();
@@ -519,7 +519,7 @@ void SdDrawDocument::SetSelected(SdPage* pPage, sal_Bool bSelect)
{
pPage->SetSelected(bSelect);
- const sal_uInt16 nDestPageNum(pPage->GetPageNum() + 1);
+ const sal_uInt32 nDestPageNum(pPage->GetPageNumber() + 1);
SdPage* pNotesPage = 0L;
if(nDestPageNum < GetPageCount())
@@ -535,7 +535,7 @@ void SdDrawDocument::SetSelected(SdPage* pPage, sal_Bool bSelect)
else if (ePageKind == PK_NOTES)
{
pPage->SetSelected(bSelect);
- SdPage* pStandardPage = (SdPage*) GetPage( pPage->GetPageNum() - 1 );
+ SdPage* pStandardPage = (SdPage*) GetPage( pPage->GetPageNumber() - 1 );
if (pStandardPage && pStandardPage->GetPageKind() == PK_STANDARD)
pStandardPage->SetSelected(bSelect);
@@ -554,7 +554,7 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
* Wenn noch keine Seite im Model vorhanden ist (Datei-Neu), wird
* eine neue Seite eingefuegt
**************************************************************************/
- sal_uInt16 nPageCount = GetPageCount();
+ sal_uInt32 nPageCount = GetPageCount();
if (nPageCount <= 1)
{
@@ -564,8 +564,8 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
/**********************************************************************
* Handzettel-Seite einfuegen
**********************************************************************/
- sal_Bool bMasterPage;
- SdPage* pHandoutPage = dynamic_cast< SdPage* >( AllocPage(bMasterPage=sal_False) );
+ bool bMasterPage;
+ SdPage* pHandoutPage = dynamic_cast< SdPage* >( AllocPage(bMasterPage=false) );
SdPage* pRefPage = NULL;
@@ -574,13 +574,17 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
if( pRefPage )
{
- pHandoutPage->SetSize(pRefPage->GetSize());
- pHandoutPage->SetBorder( pRefPage->GetLftBorder(), pRefPage->GetUppBorder(), pRefPage->GetRgtBorder(), pRefPage->GetLwrBorder() );
+ pHandoutPage->SetPageScale(pRefPage->GetPageScale());
+ pHandoutPage->SetPageBorder(
+ pRefPage->GetLeftPageBorder(),
+ pRefPage->GetTopPageBorder(),
+ pRefPage->GetRightPageBorder(),
+ pRefPage->GetBottomPageBorder() );
}
else
{
- pHandoutPage->SetSize(aDefSize);
- pHandoutPage->SetBorder(0, 0, 0, 0);
+ pHandoutPage->SetPageScale(basegfx::B2DVector(aDefSize.Width(), aDefSize.Height()));
+ pHandoutPage->SetPageBorder(0, 0, 0, 0);
}
pHandoutPage->SetPageKind(PK_HANDOUT);
@@ -590,13 +594,13 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
/**********************************************************************
* MasterPage einfuegen und an der Handzettel-Seite vermerken
**********************************************************************/
- SdPage* pHandoutMPage = (SdPage*) AllocPage(bMasterPage=sal_True);
- pHandoutMPage->SetSize( pHandoutPage->GetSize() );
+ SdPage* pHandoutMPage = (SdPage*) AllocPage(bMasterPage=true);
+ pHandoutMPage->SetPageScale( pHandoutPage->GetPageScale() );
pHandoutMPage->SetPageKind(PK_HANDOUT);
- pHandoutMPage->SetBorder( pHandoutPage->GetLftBorder(),
- pHandoutPage->GetUppBorder(),
- pHandoutPage->GetRgtBorder(),
- pHandoutPage->GetLwrBorder() );
+ pHandoutMPage->SetPageBorder( pHandoutPage->GetLeftPageBorder(),
+ pHandoutPage->GetTopPageBorder(),
+ pHandoutPage->GetRightPageBorder(),
+ pHandoutPage->GetBottomPageBorder() );
InsertMasterPage(pHandoutMPage, 0);
pHandoutPage->TRG_SetMasterPage( *pHandoutMPage );
@@ -606,26 +610,30 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
* Eine Standard-Seite ist daher schon vorhanden.
**********************************************************************/
SdPage* pPage;
- sal_Bool bClipboard = sal_False;
+ bool bClipboard = false;
if( pRefDocument )
pRefPage = pRefDocument->GetSdPage( 0, PK_STANDARD );
if (nPageCount == 0)
{
- pPage = dynamic_cast< SdPage* >( AllocPage(bMasterPage=sal_False) );
+ pPage = dynamic_cast< SdPage* >( AllocPage(bMasterPage=false) );
if( pRefPage )
{
- pPage->SetSize( pRefPage->GetSize() );
- pPage->SetBorder( pRefPage->GetLftBorder(), pRefPage->GetUppBorder(), pRefPage->GetRgtBorder(), pRefPage->GetLwrBorder() );
+ pPage->SetPageScale( pRefPage->GetPageScale() );
+ pPage->SetPageBorder(
+ pRefPage->GetLeftPageBorder(),
+ pRefPage->GetTopPageBorder(),
+ pRefPage->GetRightPageBorder(),
+ pRefPage->GetBottomPageBorder() );
}
else if (meDocType == DOCUMENT_TYPE_DRAW)
{
// Draw: stets Default-Groesse mit Raendern
- pPage->SetSize(aDefSize);
+ pPage->SetPageScale(basegfx::B2DVector(aDefSize.Width(), aDefSize.Height()));
- SfxPrinter* pPrinter = mpDocSh->GetPrinter(sal_False);
+ SfxPrinter* pPrinter = mpDocSh->GetPrinter(false);
if (pPrinter && pPrinter->IsValid())
{
Size aOutSize(pPrinter->GetOutputSize());
@@ -633,12 +641,12 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
aPageOffset -= pPrinter->PixelToLogic( Point() );
long nOffset = !aPageOffset.X() && !aPageOffset.X() ? 0 : PRINT_OFFSET;
- sal_uLong nTop = aPageOffset.Y();
- sal_uLong nLeft = aPageOffset.X();
- sal_uLong nBottom = Max((long)(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L);
- sal_uLong nRight = Max((long)(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L);
+ sal_uInt32 nTop = aPageOffset.Y();
+ sal_uInt32 nLeft = aPageOffset.X();
+ sal_uInt32 nBottom = Max((long)(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L);
+ sal_uInt32 nRight = Max((long)(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L);
- pPage->SetBorder(nLeft, nTop, nRight, nBottom);
+ pPage->SetPageBorder(nLeft, nTop, nRight, nBottom);
}
else
{
@@ -647,34 +655,34 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
// This has to be kept synchronized with the border
// width set in the
// SvxPageDescPage::PaperSizeSelect_Impl callback.
- pPage->SetBorder(1000, 1000, 1000, 1000);
+ pPage->SetPageBorder(1000, 1000, 1000, 1000);
}
}
else
{
// Impress: stets Bildschirmformat, quer
Size aSz( SvxPaperInfo::GetPaperSize(PAPER_SCREEN, MAP_100TH_MM) );
- pPage->SetSize( Size( aSz.Height(), aSz.Width() ) );
- pPage->SetBorder(0, 0, 0, 0);
+ pPage->SetPageScale( basegfx::B2DVector( aSz.Height(), aSz.Width() ) );
+ pPage->SetPageBorder(0, 0, 0, 0);
}
InsertPage(pPage, 1);
}
else
{
- bClipboard = sal_True;
+ bClipboard = true;
pPage = (SdPage*) GetPage(1);
}
/**********************************************************************
* MasterPage einfuegen und an der Seite vermerken
**********************************************************************/
- SdPage* pMPage = (SdPage*) AllocPage(bMasterPage=sal_True);
- pMPage->SetSize( pPage->GetSize() );
- pMPage->SetBorder( pPage->GetLftBorder(),
- pPage->GetUppBorder(),
- pPage->GetRgtBorder(),
- pPage->GetLwrBorder() );
+ SdPage* pMPage = (SdPage*) AllocPage(bMasterPage=true);
+ pMPage->SetPageScale( pPage->GetPageScale() );
+ pMPage->SetPageBorder( pPage->GetLeftPageBorder(),
+ pPage->GetTopPageBorder(),
+ pPage->GetRightPageBorder(),
+ pPage->GetBottomPageBorder() );
InsertMasterPage(pMPage, 1);
pPage->TRG_SetMasterPage( *pMPage );
if( bClipboard )
@@ -683,29 +691,33 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
/**********************************************************************
* Notizen-Seite einfuegen
**********************************************************************/
- SdPage* pNotesPage = (SdPage*) AllocPage(bMasterPage=sal_False);
+ SdPage* pNotesPage = (SdPage*) AllocPage(bMasterPage=false);
if( pRefDocument )
pRefPage = pRefDocument->GetSdPage( 0, PK_NOTES );
if( pRefPage )
{
- pNotesPage->SetSize( pRefPage->GetSize() );
- pNotesPage->SetBorder( pRefPage->GetLftBorder(), pRefPage->GetUppBorder(), pRefPage->GetRgtBorder(), pRefPage->GetLwrBorder() );
+ pNotesPage->SetPageScale( pRefPage->GetPageScale() );
+ pNotesPage->SetPageBorder(
+ pRefPage->GetLeftPageBorder(),
+ pRefPage->GetTopPageBorder(),
+ pRefPage->GetRightPageBorder(),
+ pRefPage->GetBottomPageBorder() );
}
else
{
// Stets Hochformat
if (aDefSize.Height() >= aDefSize.Width())
{
- pNotesPage->SetSize(aDefSize);
+ pNotesPage->SetPageScale(basegfx::B2DVector(aDefSize.Width(), aDefSize.Height()));
}
else
{
- pNotesPage->SetSize( Size(aDefSize.Height(), aDefSize.Width()) );
+ pNotesPage->SetPageScale( basegfx::B2DVector(aDefSize.Height(), aDefSize.Width()) );
}
- pNotesPage->SetBorder(0, 0, 0, 0);
+ pNotesPage->SetPageBorder(0, 0, 0, 0);
}
pNotesPage->SetPageKind(PK_NOTES);
InsertPage(pNotesPage, 2);
@@ -715,13 +727,13 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
/**********************************************************************
* MasterPage einfuegen und an der Notizen-Seite vermerken
**********************************************************************/
- SdPage* pNotesMPage = (SdPage*) AllocPage(bMasterPage=sal_True);
- pNotesMPage->SetSize( pNotesPage->GetSize() );
+ SdPage* pNotesMPage = (SdPage*) AllocPage(bMasterPage=true);
+ pNotesMPage->SetPageScale( pNotesPage->GetPageScale() );
pNotesMPage->SetPageKind(PK_NOTES);
- pNotesMPage->SetBorder( pNotesPage->GetLftBorder(),
- pNotesPage->GetUppBorder(),
- pNotesPage->GetRgtBorder(),
- pNotesPage->GetLwrBorder() );
+ pNotesMPage->SetPageBorder( pNotesPage->GetLeftPageBorder(),
+ pNotesPage->GetTopPageBorder(),
+ pNotesPage->GetRightPageBorder(),
+ pNotesPage->GetBottomPageBorder() );
InsertMasterPage(pNotesMPage, 2);
pNotesPage->TRG_SetMasterPage( *pNotesMPage );
if( bClipboard )
@@ -729,14 +741,14 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
if( !pRefPage && (meDocType != DOCUMENT_TYPE_DRAW) )
- pPage->SetAutoLayout( AUTOLAYOUT_TITLE, sal_True, sal_True );
+ pPage->SetAutoLayout( AUTOLAYOUT_TITLE, true, true );
mpWorkStartupTimer = new Timer();
mpWorkStartupTimer->SetTimeoutHdl( LINK(this, SdDrawDocument, WorkStartupHdl) );
mpWorkStartupTimer->SetTimeout(2000);
mpWorkStartupTimer->Start();
- SetChanged(sal_False);
+ SetChanged(false);
}
}
@@ -748,10 +760,10 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
|*
\************************************************************************/
-sal_Bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
+bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
{
- sal_Bool bOK = sal_False;
- sal_uInt16 nPageCount = GetPageCount();
+ bool bOK = false;
+ sal_uInt32 nPageCount = GetPageCount();
if (nPageCount != 0)
{
@@ -765,7 +777,7 @@ sal_Bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
pHandoutPage->SetPageKind(PK_HANDOUT);
pHandoutPage->TRG_SetMasterPage( *pHandoutMPage );
- for (sal_uInt16 i = 1; i < nPageCount; i = i + 2)
+ for (sal_uInt32 i = 1; i < nPageCount; i = i + 2)
{
SdPage* pPage = (SdPage*) GetPage(i);
@@ -780,13 +792,13 @@ sal_Bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
pNotesPage->SetPageKind(PK_NOTES);
// Notiz-MasterPages setzen
- sal_uInt16 nMasterPageAfterPagesMasterPage = (pPage->TRG_GetMasterPage()).GetPageNum() + 1;
+ const sal_uInt32 nMasterPageAfterPagesMasterPage = (pPage->TRG_GetMasterPage()).GetPageNumber() + 1;
pNotesPage->TRG_SetMasterPage(*GetMasterPage(nMasterPageAfterPagesMasterPage));
}
- bOK = sal_True;
+ bOK = true;
StopWorkStartupDelay();
- SetChanged(sal_False);
+ SetChanged(false);
}
return(bOK);
@@ -795,18 +807,18 @@ sal_Bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
/*************************************************************************
|*
|* - selektierte Seiten hinter genannte Seite schieben
-|* (nTargetPage = (sal_uInt16)-1 --> vor erste Seite schieben)
-|* - ergibt sal_True, wenn Seiten verschoben wurden
+|* (nTargetPage = (sal_uInt32)-1 --> vor erste Seite schieben)
+|* - ergibt true, wenn Seiten verschoben wurden
|*
\************************************************************************/
-sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
+bool SdDrawDocument::MovePages(sal_uInt32 nTargetPage)
{
SdPage* pTargetPage = NULL;
SdPage* pPage = NULL;
- sal_uInt16 nPage;
- sal_uInt16 nNoOfPages = GetSdPageCount(PK_STANDARD);
- sal_Bool bSomethingHappened = sal_False;
+ sal_uInt32 nPage;
+ const sal_uInt32 nNoOfPages(GetSdPageCount(PK_STANDARD));
+ bool bSomethingHappened = false;
const bool bUndo = IsUndoEnabled();
@@ -826,7 +838,7 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
// falls noetig, nach vorne hangeln, bis nicht selektierte Seite gefunden
nPage = nTargetPage;
- if (nPage != (sal_uInt16)-1)
+ if (nPage != (sal_uInt32)-1)
{
pPage = GetSdPage(nPage, PK_STANDARD);
while (nPage > 0 && pPage->IsSelected())
@@ -837,18 +849,18 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
if (pPage->IsSelected())
{
- nPage = (sal_uInt16)-1;
+ nPage = (sal_uInt32)-1;
}
}
// vor der ersten Seite einfuegen
- if (nPage == (sal_uInt16)-1)
+ if (nPage == (sal_uInt32)-1)
{
while (aPageList.Count() > 0)
{
aPageList.Last();
- nPage = ( (SdPage*) aPageList.GetCurObject() )->GetPageNum();
+ nPage = ( (SdPage*) aPageList.GetCurObject() )->GetPageNumber();
if (nPage != 0)
{
SdrPage* pPg = GetPage(nPage);
@@ -859,7 +871,7 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
if( bUndo )
AddUndo(GetSdrUndoFactory().CreateUndoSetPageNum(*pPg, nPage+1, 2));
MovePage(nPage+1, 2);
- bSomethingHappened = sal_True;
+ bSomethingHappened = true;
}
aPageList.Remove();
}
@@ -873,7 +885,7 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
while (aPageList.Count() > 0)
{
pPage = (SdPage*)aPageList.GetObject(0);
- nPage = pPage->GetPageNum();
+ nPage = pPage->GetPageNumber();
if (nPage > nTargetPage)
{
nTargetPage += 2; // hinter (!) der Seite einfuegen
@@ -888,7 +900,7 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
if( bUndo )
AddUndo(GetSdrUndoFactory().CreateUndoSetPageNum(*pPg, nPage+1, nTargetPage+1));
MovePage(nPage+1, nTargetPage+1);
- bSomethingHappened = sal_True;
+ bSomethingHappened = true;
}
}
else
@@ -906,8 +918,8 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
bSomethingHappened = sal_True;
}
}
- aPageList.Remove((sal_uLong)0);
- nTargetPage = pPage->GetPageNum();
+ aPageList.Remove((sal_uIntPtr)0);
+ nTargetPage = pPage->GetPageNumber();
}
}
@@ -924,9 +936,9 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
|*
\************************************************************************/
-sal_uLong SdDrawDocument::GetLinkCount()
+sal_uInt32 SdDrawDocument::GetLinkCount()
{
- return ( pLinkManager->GetLinks().Count() );
+ return ( GetLinkManager()->GetLinks().Count() );
}
/*************************************************************************
@@ -937,29 +949,28 @@ sal_uLong SdDrawDocument::GetLinkCount()
void SdDrawDocument::SetLanguage( const LanguageType eLang, const sal_uInt16 nId )
{
- sal_Bool bChanged = sal_False;
+ bool bChanged = false;
if( nId == EE_CHAR_LANGUAGE && meLanguage != eLang )
{
meLanguage = eLang;
- bChanged = sal_True;
+ bChanged = true;
}
else if( nId == EE_CHAR_LANGUAGE_CJK && meLanguageCJK != eLang )
{
meLanguageCJK = eLang;
- bChanged = sal_True;
+ bChanged = true;
}
else if( nId == EE_CHAR_LANGUAGE_CTL && meLanguageCTL != eLang )
{
meLanguageCTL = eLang;
- bChanged = sal_True;
+ bChanged = true;
}
if( bChanged )
{
GetDrawOutliner().SetDefaultLanguage( Application::GetSettings().GetLanguage() );
- pHitTestOutliner->SetDefaultLanguage( Application::GetSettings().GetLanguage() );
- pItemPool->SetPoolDefaultItem( SvxLanguageItem( eLang, nId ) );
+ GetItemPool().SetPoolDefaultItem( SvxLanguageItem( eLang, nId ) );
SetChanged( bChanged );
}
}
@@ -993,9 +1004,9 @@ LanguageType SdDrawDocument::GetLanguage( const sal_uInt16 nId ) const
IMPL_LINK( SdDrawDocument, WorkStartupHdl, Timer *, EMPTYARG )
{
if( mpDocSh )
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
- sal_Bool bChanged = IsChanged(); // merken
+ bool bChanged = IsChanged(); // merken
// Autolayouts initialisieren
SdPage* pHandoutMPage = GetMasterSdPage(0, PK_HANDOUT);
@@ -1003,7 +1014,7 @@ IMPL_LINK( SdDrawDocument, WorkStartupHdl, Timer *, EMPTYARG )
if (pHandoutMPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
// AutoLayout wurde noch nicht umgesetzt -> Initialisieren
- pHandoutMPage->SetAutoLayout(AUTOLAYOUT_HANDOUT6, sal_True, sal_True);
+ pHandoutMPage->SetAutoLayout(AUTOLAYOUT_HANDOUT6, true, true);
}
SdPage* pPage = GetSdPage(0, PK_STANDARD);
@@ -1011,7 +1022,7 @@ IMPL_LINK( SdDrawDocument, WorkStartupHdl, Timer *, EMPTYARG )
if (pPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
// AutoLayout wurde noch nicht umgesetzt -> Initialisieren
- pPage->SetAutoLayout(AUTOLAYOUT_NONE, sal_True, sal_True);
+ pPage->SetAutoLayout(AUTOLAYOUT_NONE, true, true);
}
SdPage* pNotesPage = GetSdPage(0, PK_NOTES);
@@ -1019,13 +1030,13 @@ IMPL_LINK( SdDrawDocument, WorkStartupHdl, Timer *, EMPTYARG )
if (pNotesPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
// AutoLayout wurde noch nicht umgesetzt -> Initialisieren
- pNotesPage->SetAutoLayout(AUTOLAYOUT_NOTES, sal_True, sal_True);
+ pNotesPage->SetAutoLayout(AUTOLAYOUT_NOTES, true, true);
}
- SetChanged(bChanged || sal_False);
+ SetChanged(bChanged || false);
if( mpDocSh )
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
return 0;
}
@@ -1071,10 +1082,10 @@ SdAnimationInfo* SdDrawDocument::GetAnimationInfo(SdrObject* pObject) const
return 0;
}
-SdAnimationInfo* SdDrawDocument::GetShapeUserData(SdrObject& rObject, bool bCreate /* = false */ )
+SdAnimationInfo* SdDrawDocument::GetShapeUserData(const SdrObject& rObject, bool bCreate /* = false */ )
{
- sal_uInt16 nUD = 0;
- sal_uInt16 nUDCount = rObject.GetUserDataCount();
+ sal_uInt32 nUD(0);
+ const sal_uInt32 nUDCount(rObject.GetUserDataCount());
SdrObjUserData* pUD = 0;
SdAnimationInfo* pRet = 0;
@@ -1091,8 +1102,8 @@ SdAnimationInfo* SdDrawDocument::GetShapeUserData(SdrObject& rObject, bool bCrea
if( (pRet == 0) && bCreate )
{
- pRet = new SdAnimationInfo( rObject );
- rObject.InsertUserData( pRet);
+ pRet = new SdAnimationInfo( const_cast< SdrObject& >(rObject) );
+ const_cast< SdrObject& >(rObject).InsertUserData( pRet);
}
return pRet;
@@ -1111,10 +1122,10 @@ SdIMapInfo* SdDrawDocument::GetIMapInfo( SdrObject* pObject ) const
SdrObjUserData* pUserData = NULL;
SdIMapInfo* pIMapInfo = NULL;
- sal_uInt16 nCount = pObject->GetUserDataCount();
+ const sal_uInt32 nCount(pObject->GetUserDataCount());
// gibt es in den User-Daten eine IMap-Information?
- for ( sal_uInt16 i = 0; i < nCount; i++ )
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
pUserData = pObject->GetUserData( i );
@@ -1133,8 +1144,7 @@ SdIMapInfo* SdDrawDocument::GetIMapInfo( SdrObject* pObject ) const
\************************************************************************/
IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj,
- const Point& rWinPoint,
- const ::Window& /* rCmpWnd */ )
+ const basegfx::B2DPoint& rWinPoint, const ::Window& /* rCmpWnd */ )
{
SdIMapInfo* pIMapInfo = GetIMapInfo( pObj );
IMapObject* pIMapObj = NULL;
@@ -1143,29 +1153,23 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj,
{
const MapMode aMap100( MAP_100TH_MM );
Size aGraphSize;
- Point aRelPoint( rWinPoint );
+ basegfx::B2DPoint aRelPoint( rWinPoint );
ImageMap& rImageMap = (ImageMap&) pIMapInfo->GetImageMap();
- const Rectangle& rRect = pObj->GetLogicRect();
- sal_Bool bObjSupported = sal_False;
+ const basegfx::B2DRange aLogicRange(sdr::legacy::GetLogicRange(*pObj));
+ bool bObjSupported = false;
// HitTest ausfuehren
- if ( pObj->ISA( SdrGrafObj ) ) // einfaches Grafik-Objekt
- {
- const SdrGrafObj* pGrafObj = (const SdrGrafObj*) pObj;
- const GeoStat& rGeo = pGrafObj->GetGeoStat();
- SdrGrafObjGeoData* pGeoData = (SdrGrafObjGeoData*) pGrafObj->GetGeoData();
+ const SdrGrafObj* pGrafObj = dynamic_cast< const SdrGrafObj* >(pObj);
- // Drehung rueckgaengig
- if ( rGeo.nDrehWink )
- RotatePoint( aRelPoint, rRect.TopLeft(), -rGeo.nSin, rGeo.nCos );
-
- // Spiegelung rueckgaengig
- if ( pGeoData->bMirrored )
- aRelPoint.X() = rRect.Right() + rRect.Left() - aRelPoint.X();
+ if ( pGrafObj ) // einfaches Grafik-Objekt
+ {
+ // remove shear, mirror and rotation; so just absolute scale and translation get applied
+ basegfx::B2DHomMatrix aJustAbsScaleTranslate(pGrafObj->getSdrObjectTransformation());
- // ggf. Unshear:
- if ( rGeo.nShearWink )
- ShearPoint( aRelPoint, rRect.TopLeft(), -rGeo.nTan );
+ aJustAbsScaleTranslate.invert();
+ aJustAbsScaleTranslate.scale(basegfx::absolute(pGrafObj->getSdrObjectScale()));
+ aJustAbsScaleTranslate.translate(pGrafObj->getSdrObjectTranslate());
+ aRelPoint = aJustAbsScaleTranslate * aRelPoint;
if ( pGrafObj->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL )
aGraphSize = Application::GetDefaultDevice()->PixelToLogic( pGrafObj->GetGrafPrefSize(), aMap100 );
@@ -1173,21 +1177,29 @@ IMapObject* SdDrawDocument::GetHitIMapObject( SdrObject* pObj,
aGraphSize = OutputDevice::LogicToLogic( pGrafObj->GetGrafPrefSize(),
pGrafObj->GetGrafPrefMapMode(), aMap100 );
- delete pGeoData;
- bObjSupported = sal_True;
+ bObjSupported = true;
}
- else if ( pObj->ISA( SdrOle2Obj ) ) // OLE-Objekt
+ else
+ {
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObj);
+
+ if ( pSdrOle2Obj ) // OLE-Objekt
{
- aGraphSize = ( (SdrOle2Obj*) pObj )->GetOrigObjSize();
- bObjSupported = sal_True;
+ aGraphSize = pSdrOle2Obj->GetOrigObjSize();
+ bObjSupported = true;
+ }
}
// hat alles geklappt, dann HitTest ausfuehren
if ( bObjSupported )
{
// relativen Mauspunkt berechnen
- aRelPoint -= rRect.TopLeft();
- pIMapObj = rImageMap.GetHitIMapObject( aGraphSize, rRect.GetSize(), aRelPoint );
+ aRelPoint -= aLogicRange.getMinimum();
+
+ const Size aLogicRangeSize(basegfx::fround(aLogicRange.getWidth()), basegfx::fround(aLogicRange.getHeight()));
+ const Point aOldRelPoint(basegfx::fround(aRelPoint.getX()), basegfx::fround(aRelPoint.getY()));
+
+ pIMapObj = rImageMap.GetHitIMapObject( aGraphSize, aLogicRangeSize, aOldRelPoint );
// Deaktivierte Objekte wollen wir nicht
if ( pIMapObj && !pIMapObj->IsActive() )
@@ -1206,7 +1218,7 @@ void SdDrawDocument::CheckMasterPages()
{
// RemoveMasterPage(2); // code to test the creation of notes pages
- sal_uInt16 nMaxPages = GetMasterPageCount();
+ sal_uInt32 nMaxPages(GetMasterPageCount());
// we need at least a handout master and one master page
if( nMaxPages < 2 )
@@ -1214,10 +1226,9 @@ void SdDrawDocument::CheckMasterPages()
return;
}
- SdPage* pPage = NULL;
- SdPage* pNotesPage = NULL;
-
- sal_uInt16 nPage;
+ SdPage* pPage = 0;
+ SdPage* pNotesPage = 0;
+ sal_uInt32 nPage;
// first see if the page order is correct
for( nPage = 1; nPage < nMaxPages; nPage++ )
@@ -1231,25 +1242,20 @@ void SdDrawDocument::CheckMasterPages()
if( nPage < nMaxPages )
{
- // there is a fatal error in the master page order,
- // we need to repair the document
- sal_Bool bChanged = sal_False;
-
nPage = 1;
while( nPage < nMaxPages )
{
pPage = static_cast<SdPage*> (GetMasterPage( nPage ));
if( pPage->GetPageKind() != PK_STANDARD )
{
- bChanged = sal_True;
- sal_uInt16 nFound = nPage + 1;
+ sal_uInt32 nFound = nPage + 1;
while( nFound < nMaxPages )
{
pPage = static_cast<SdPage*>(GetMasterPage( nFound ));
if( PK_STANDARD == pPage->GetPageKind() )
{
MoveMasterPage( nFound, nPage );
- pPage->SetInserted(sal_True);
+ // pPage->SetInserted(sal_True);
break;
}
@@ -1271,16 +1277,14 @@ void SdDrawDocument::CheckMasterPages()
if( (NULL == pNotesPage) || (pNotesPage->GetPageKind() != PK_NOTES) || ( pPage->GetLayoutName() != pNotesPage->GetLayoutName() ) )
{
- bChanged = sal_True;
-
- sal_uInt16 nFound = nPage + 1;
+ sal_uInt32 nFound = nPage + 1;
while( nFound < nMaxPages )
{
pNotesPage = static_cast<SdPage*>(GetMasterPage( nFound ));
if( (PK_NOTES == pNotesPage->GetPageKind()) && ( pPage->GetLayoutName() == pNotesPage->GetLayoutName() ) )
{
MoveMasterPage( nFound, nPage );
- pNotesPage->SetInserted(sal_True);
+ // pNotesPage->SetInserted(sal_True);
break;
}
@@ -1309,11 +1313,11 @@ void SdDrawDocument::CheckMasterPages()
pNewNotesPage->SetPageKind(PK_NOTES);
if( pRefNotesPage )
{
- pNewNotesPage->SetSize( pRefNotesPage->GetSize() );
- pNewNotesPage->SetBorder( pRefNotesPage->GetLftBorder(),
- pRefNotesPage->GetUppBorder(),
- pRefNotesPage->GetRgtBorder(),
- pRefNotesPage->GetLwrBorder() );
+ pNewNotesPage->SetPageScale( pRefNotesPage->GetPageScale() );
+ pNewNotesPage->SetPageBorder( pRefNotesPage->GetLeftPageBorder(),
+ pRefNotesPage->GetTopPageBorder(),
+ pRefNotesPage->GetRightPageBorder(),
+ pRefNotesPage->GetBottomPageBorder() );
}
InsertMasterPage(pNewNotesPage, nPage );
pNewNotesPage->SetLayoutName( pPage->GetLayoutName() );
@@ -1328,29 +1332,21 @@ void SdDrawDocument::CheckMasterPages()
// now remove all remaining and unused non PK_STANDARD slides
while( nPage < nMaxPages )
{
- bChanged = sal_True;
-
RemoveMasterPage( nPage );
nMaxPages--;
}
-
- if( bChanged )
- {
- DBG_ERROR( "master pages where in a wrong order" );
- RecalcPageNums( sal_True);
- }
}
}
-sal_uInt16 SdDrawDocument::CreatePage (
+sal_uInt32 SdDrawDocument::CreatePage (
SdPage* pActualPage,
PageKind ePageKind,
const String& sStandardPageName,
const String& sNotesPageName,
AutoLayout eStandardLayout,
AutoLayout eNotesLayout,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj,
+ bool bIsPageBack,
+ bool bIsPageObj,
const sal_Int32 nInsertPosition)
{
SdPage* pPreviousStandardPage;
@@ -1363,36 +1359,36 @@ sal_uInt16 SdDrawDocument::CreatePage (
if (ePageKind == PK_NOTES)
{
pPreviousNotesPage = pActualPage;
- sal_uInt16 nNotesPageNum = pPreviousNotesPage->GetPageNum() + 2;
+ sal_uInt32 nNotesPageNum = pPreviousNotesPage->GetPageNumber() + 2;
pPreviousStandardPage = (SdPage*) GetPage(nNotesPageNum - 3);
eStandardLayout = pPreviousStandardPage->GetAutoLayout();
}
else
{
pPreviousStandardPage = pActualPage;
- sal_uInt16 nStandardPageNum = pPreviousStandardPage->GetPageNum() + 2;
+ sal_uInt32 nStandardPageNum = pPreviousStandardPage->GetPageNumber() + 2;
pPreviousNotesPage = (SdPage*) GetPage(nStandardPageNum - 1);
eNotesLayout = pPreviousNotesPage->GetAutoLayout();
}
// Create new standard page and set it up.
- pStandardPage = (SdPage*) AllocPage(sal_False);
+ pStandardPage = (SdPage*) AllocPage(false);
// #108658#
// Set the size here since else the presobj autolayout
// will be wrong.
- pStandardPage->SetSize( pPreviousStandardPage->GetSize() );
- pStandardPage->SetBorder( pPreviousStandardPage->GetLftBorder(),
- pPreviousStandardPage->GetUppBorder(),
- pPreviousStandardPage->GetRgtBorder(),
- pPreviousStandardPage->GetLwrBorder() );
+ pStandardPage->SetPageScale( pPreviousStandardPage->GetPageScale() );
+ pStandardPage->SetPageBorder( pPreviousStandardPage->GetLeftPageBorder(),
+ pPreviousStandardPage->GetTopPageBorder(),
+ pPreviousStandardPage->GetRightPageBorder(),
+ pPreviousStandardPage->GetBottomPageBorder() );
// Use master page of current page.
pStandardPage->TRG_SetMasterPage(pPreviousStandardPage->TRG_GetMasterPage());
// User layout of current standard page.
pStandardPage->SetLayoutName( pPreviousStandardPage->GetLayoutName() );
- pStandardPage->SetAutoLayout(eStandardLayout, sal_True);
+ pStandardPage->SetAutoLayout(eStandardLayout, true);
pStandardPage->setHeaderFooterSettings( pPreviousStandardPage->getHeaderFooterSettings() );
// transition settings of current page
@@ -1407,7 +1403,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
pStandardPage->SetTime( pPreviousStandardPage->GetTime() );
// Create new notes page and set it up.
- pNotesPage = (SdPage*) AllocPage(sal_False);
+ pNotesPage = (SdPage*) AllocPage(false);
pNotesPage->SetPageKind(PK_NOTES);
// Use master page of current page.
@@ -1415,7 +1411,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
// Use layout of current notes page.
pNotesPage->SetLayoutName( pPreviousNotesPage->GetLayoutName() );
- pNotesPage->SetAutoLayout(eNotesLayout, sal_True);
+ pNotesPage->SetAutoLayout(eNotesLayout, true);
pNotesPage->setHeaderFooterSettings( pPreviousNotesPage->getHeaderFooterSettings() );
return InsertPageSet (
@@ -1435,7 +1431,7 @@ sal_uInt16 SdDrawDocument::CreatePage (
-sal_uInt16 SdDrawDocument::DuplicatePage (sal_uInt16 nPageNum)
+sal_uInt32 SdDrawDocument::DuplicatePage (sal_uInt32 nPageNum)
{
PageKind ePageKind = PK_STANDARD;
@@ -1443,9 +1439,9 @@ sal_uInt16 SdDrawDocument::DuplicatePage (sal_uInt16 nPageNum)
SdPage* pActualPage = GetSdPage(nPageNum, ePageKind);
// Get background flags.
- SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers();
// Get layout from current page.
@@ -1463,15 +1459,15 @@ sal_uInt16 SdDrawDocument::DuplicatePage (sal_uInt16 nPageNum)
-sal_uInt16 SdDrawDocument::DuplicatePage (
+sal_uInt32 SdDrawDocument::DuplicatePage (
SdPage* pActualPage,
PageKind ePageKind,
const String& sStandardPageName,
const String& sNotesPageName,
AutoLayout eStandardLayout,
AutoLayout eNotesLayout,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj,
+ bool bIsPageBack,
+ bool bIsPageObj,
const sal_Int32 nInsertPosition)
{
SdPage* pPreviousStandardPage;
@@ -1484,19 +1480,19 @@ sal_uInt16 SdDrawDocument::DuplicatePage (
if (ePageKind == PK_NOTES)
{
pPreviousNotesPage = pActualPage;
- sal_uInt16 nNotesPageNum = pPreviousNotesPage->GetPageNum() + 2;
+ sal_uInt32 nNotesPageNum = pPreviousNotesPage->GetPageNumber() + 2;
pPreviousStandardPage = (SdPage*) GetPage(nNotesPageNum - 3);
}
else
{
pPreviousStandardPage = pActualPage;
- sal_uInt16 nStandardPageNum = pPreviousStandardPage->GetPageNum() + 2;
+ sal_uInt32 nStandardPageNum = pPreviousStandardPage->GetPageNumber() + 2;
pPreviousNotesPage = (SdPage*) GetPage(nStandardPageNum - 1);
}
// Create duplicates of a standard page and the associated notes page.
- pStandardPage = (SdPage*) pPreviousStandardPage->Clone();
- pNotesPage = (SdPage*) pPreviousNotesPage->Clone();
+ pStandardPage = (SdPage*) pPreviousStandardPage->CloneSdrPage();
+ pNotesPage = (SdPage*) pPreviousNotesPage->CloneSdrPage();
return InsertPageSet (
pActualPage,
@@ -1515,23 +1511,23 @@ sal_uInt16 SdDrawDocument::DuplicatePage (
-sal_uInt16 SdDrawDocument::InsertPageSet (
+sal_uInt32 SdDrawDocument::InsertPageSet (
SdPage* pActualPage,
PageKind ePageKind,
const String& sStandardPageName,
const String& sNotesPageName,
AutoLayout eStandardLayout,
AutoLayout eNotesLayout,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj,
+ bool bIsPageBack,
+ bool bIsPageObj,
SdPage* pStandardPage,
SdPage* pNotesPage,
sal_Int32 nInsertPosition)
{
SdPage* pPreviousStandardPage;
SdPage* pPreviousNotesPage;
- sal_uInt16 nStandardPageNum;
- sal_uInt16 nNotesPageNum;
+ sal_uInt32 nStandardPageNum;
+ sal_uInt32 nNotesPageNum;
String aStandardPageName = sStandardPageName;
String aNotesPageName = sNotesPageName;
@@ -1541,7 +1537,7 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
if (ePageKind == PK_NOTES)
{
pPreviousNotesPage = pActualPage;
- nNotesPageNum = pPreviousNotesPage->GetPageNum() + 2;
+ nNotesPageNum = pPreviousNotesPage->GetPageNumber() + 2;
pPreviousStandardPage = (SdPage*) GetPage(nNotesPageNum - 3);
nStandardPageNum = nNotesPageNum - 1;
eStandardLayout = pPreviousStandardPage->GetAutoLayout();
@@ -1549,7 +1545,7 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
else
{
pPreviousStandardPage = pActualPage;
- nStandardPageNum = pPreviousStandardPage->GetPageNum() + 2;
+ nStandardPageNum = pPreviousStandardPage->GetPageNumber() + 2;
pPreviousNotesPage = (SdPage*) GetPage(nStandardPageNum - 1);
nNotesPageNum = nStandardPageNum + 1;
aNotesPageName = aStandardPageName;
@@ -1581,7 +1577,7 @@ sal_uInt16 SdDrawDocument::InsertPageSet (
// Return an index that allows the caller to access the newly inserted
// pages by using GetSdPage().
- return pStandardPage->GetPageNum() / 2;
+ return pStandardPage->GetPageNumber() / 2;
}
@@ -1591,17 +1587,17 @@ void SdDrawDocument::SetupNewPage (
SdPage* pPreviousPage,
SdPage* pPage,
const String& sPageName,
- sal_uInt16 nInsertionPoint,
- sal_Bool bIsPageBack,
- sal_Bool bIsPageObj)
+ sal_uInt32 nInsertionPoint,
+ bool bIsPageBack,
+ bool bIsPageObj)
{
if (pPreviousPage != NULL)
{
- pPage->SetSize( pPreviousPage->GetSize() );
- pPage->SetBorder( pPreviousPage->GetLftBorder(),
- pPreviousPage->GetUppBorder(),
- pPreviousPage->GetRgtBorder(),
- pPreviousPage->GetLwrBorder() );
+ pPage->SetPageScale( pPreviousPage->GetPageScale() );
+ pPage->SetPageBorder( pPreviousPage->GetLeftPageBorder(),
+ pPreviousPage->GetTopPageBorder(),
+ pPreviousPage->GetRightPageBorder(),
+ pPreviousPage->GetBottomPageBorder() );
}
pPage->SetName(sPageName);
@@ -1609,9 +1605,9 @@ void SdDrawDocument::SetupNewPage (
if (pPreviousPage != NULL)
{
- SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SetOfByte aVisibleLayers = pPreviousPage->TRG_GetMasterPageVisibleLayers();
aVisibleLayers.Set(aBckgrnd, bIsPageBack);
aVisibleLayers.Set(aBckgrndObj, bIsPageObj);
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index d30abdd4718b..80861faa47a4 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -104,24 +104,24 @@ void SdStorageListener::disposing( const lang::EventObject& aEvent ) throw ( uno
SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
{
- sal_Bool bOK = sal_True;
+ bool bOK = true;
SdDrawDocument* pBookmarkDoc = NULL;
String aBookmarkName = rMedium.GetName();
const SfxFilter* pFilter = rMedium.GetFilter();
if ( !pFilter )
{
- rMedium.UseInteractionHandler( sal_True );
+ rMedium.UseInteractionHandler( true );
SFX_APP()->GetFilterMatcher().GuessFilter( rMedium, &pFilter );
}
if ( !pFilter )
{
- bOK = sal_False;
+ bOK = false;
}
else if ( maBookmarkFile != aBookmarkName && aBookmarkName.Len() )
{
- sal_Bool bCreateGraphicShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.drawing.DrawingDocument" );
- sal_Bool bCreateImpressShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.presentation.PresentationDocument" );
+ bool bCreateGraphicShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.drawing.DrawingDocument" );
+ bool bCreateImpressShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.presentation.PresentationDocument" );
if ( bCreateGraphicShell || bCreateImpressShell )
{
CloseBookmarkDoc();
@@ -132,10 +132,10 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
// direkt laden
if ( bCreateGraphicShell )
// Draw
- mxBookmarkDocShRef = new ::sd::GraphicDocShell(SFX_CREATE_MODE_STANDARD, sal_True);
+ mxBookmarkDocShRef = new ::sd::GraphicDocShell(SFX_CREATE_MODE_STANDARD, true);
else
// Impress
- mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_True);
+ mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, true);
bOK = mxBookmarkDocShRef->DoLoad(&rMedium);
if( bOK )
@@ -176,7 +176,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const String& rBookmarkFile)
if (maBookmarkFile != rBookmarkFile && rBookmarkFile.Len())
{
- SfxMedium* pMedium = new SfxMedium( rBookmarkFile, STREAM_READ, sal_False );
+ SfxMedium* pMedium = new SfxMedium( rBookmarkFile, STREAM_READ, false );
pBookmarkDoc = OpenBookmarkDoc(*pMedium);
}
else if (mxBookmarkDocShRef.Is())
@@ -193,26 +193,26 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const String& rBookmarkFile)
|*
\************************************************************************/
-sal_Bool SdDrawDocument::InsertBookmark(
+bool SdDrawDocument::InsertBookmark(
List* pBookmarkList, // Liste der Namen der einzufuegenden Bookmarks
List* pExchangeList, // Liste der zu verwendenen Namen
- sal_Bool bLink, // Bookmarks sollen als Verknuepfung eingefuegt werden
- sal_Bool bReplace, // Aktuellen Seiten (Standard&Notiz) werden ersetzt
- sal_uInt16 nInsertPos, // Einfuegeposition fuer Seiten
- sal_Bool bNoDialogs, // Keine Dialoge anzeigen
+ bool bLink, // Bookmarks sollen als Verknuepfung eingefuegt werden
+ bool bReplace, // Aktuellen Seiten (Standard&Notiz) werden ersetzt
+ sal_uInt32 nInsertPos, // Einfuegeposition fuer Seiten
+ bool bNoDialogs, // Keine Dialoge anzeigen
::sd::DrawDocShell* pBookmarkDocSh, // Wenn gesetzt, so ist dieses das Source-Dokument
- sal_Bool bCopy, // Seiten werden kopiert
- Point* pObjPos) // Einfuegeposition fuer Objekte
+ bool bCopy, // Seiten werden kopiert
+ basegfx::B2DPoint* pObjPos) // Einfuegeposition fuer Objekte
{
- sal_Bool bOK = sal_True;
- sal_Bool bInsertPages = sal_False;
+ bool bOK = true;
+ bool bInsertPages = false;
if (!pBookmarkList)
{
/**********************************************************************
* Alle Seiten werden eingefuegt
**********************************************************************/
- bInsertPages = sal_True;
+ bInsertPages = true;
}
else
{
@@ -230,7 +230,7 @@ sal_Bool SdDrawDocument::InsertBookmark(
aBookmarkName = maBookmarkFile;
}
else
- bOK = sal_False;
+ bOK = false;
for (sal_uInt16 nPos = 0; bOK && ( nPos < pBookmarkList->Count() ) && !bInsertPages; nPos++)
{
@@ -238,12 +238,12 @@ sal_Bool SdDrawDocument::InsertBookmark(
* Gibt es in der Bookmark-Liste einen Seitennamen?
******************************************************************/
String aBMPgName (*(String*) pBookmarkList->GetObject(nPos));
- sal_Bool bIsMasterPage;
+ bool bIsMasterPage;
if( pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
{
// Seite gefunden
- bInsertPages = sal_True;
+ bInsertPages = true;
}
}
}
@@ -251,8 +251,7 @@ sal_Bool SdDrawDocument::InsertBookmark(
if ( bOK && bInsertPages )
{
// Zuerst werden alle Seiten-Bookmarks eingefuegt
- bOK = InsertBookmarkAsPage(pBookmarkList, pExchangeList, bLink, bReplace,
- nInsertPos, bNoDialogs, pBookmarkDocSh, bCopy, sal_True, sal_False);
+ bOK = InsertBookmarkAsPage(pBookmarkList, pExchangeList, bLink, bReplace, nInsertPos, bNoDialogs, pBookmarkDocSh, bCopy, true, false);
}
if ( bOK && pBookmarkList )
@@ -285,13 +284,13 @@ SdDrawDocument::InsertBookmarkAsPage_PageFunctorBase::~InsertBookmarkAsPage_Page
{
}
-void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList, sal_uInt16 nBMSdPageCount,
+void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList, sal_uInt32 nBMSdPageCount,
SdDrawDocument::InsertBookmarkAsPage_PageFunctorBase& rPageIterator )
{
//
// #96029# Refactored copy'n'pasted layout name collection from InsertBookmarkAsPage
//
- int nPos, nEndPos;
+ sal_uInt32 nPos, nEndPos;
if( !pBookmarkList )
{
@@ -315,15 +314,14 @@ void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* p
if( !pBookmarkList )
{
// simply take master page of nPos'th page in source document
- pBMMPage = (SdPage*)(&(pBookmarkDoc->GetSdPage((sal_uInt16)nPos, PK_STANDARD)->TRG_GetMasterPage()));
+ pBMMPage = (SdPage*)(&(pBookmarkDoc->GetSdPage(nPos, PK_STANDARD)->TRG_GetMasterPage()));
}
else
{
// fetch nPos'th entry from bookmark list, and determine master page
String aBMPgName (*(String*) pBookmarkList->GetObject(nPos));
- sal_Bool bIsMasterPage;
-
- sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage );
+ bool bIsMasterPage;
+ const sal_uInt32 nBMPage(pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ));
if (nBMPage != SDRPAGE_NOTFOUND)
{
@@ -337,7 +335,7 @@ void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* p
// enforce that bookmarked page is a standard page and not already a master page
if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
{
- const sal_uInt16 nBMSdPage = (nBMPage - 1) / 2;
+ const sal_uInt32 nBMSdPage = (nBMPage - 1) / 2;
pBMMPage = (SdPage*) (&(pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD)->TRG_GetMasterPage()));
}
}
@@ -355,7 +353,7 @@ class InsertBookmarkAsPage_FindDuplicateLayouts : public SdDrawDocument::InsertB
{
public:
InsertBookmarkAsPage_FindDuplicateLayouts( List* pLayoutsToTransfer, SdDrawDocument* pBookmarkDoc,
- List* pBookmarkList, sal_uInt16 nBMSdPageCount ) :
+ List* pBookmarkList, sal_uInt32 nBMSdPageCount ) :
mpLayoutsToTransfer(pLayoutsToTransfer), mpBookmarkDoc(pBookmarkDoc),
mpBookmarkList(pBookmarkList), mnBMSdPageCount(nBMSdPageCount) {}
virtual ~InsertBookmarkAsPage_FindDuplicateLayouts() {};
@@ -364,7 +362,7 @@ private:
List* mpLayoutsToTransfer;
SdDrawDocument* mpBookmarkDoc;
List* mpBookmarkList;
- sal_uInt16 mnBMSdPageCount;
+ sal_uInt32 mnBMSdPageCount;
};
void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc, SdPage* pBMMPage )
@@ -377,18 +375,18 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
pLayout->Erase( pLayout->SearchAscii( SD_LT_SEPARATOR ));
String* pTest = (String*) mpLayoutsToTransfer->First();
- sal_Bool bFound = sal_False;
+ bool bFound = false;
while (pTest && !bFound) // found yet?
{
if (*pLayout == *pTest)
- bFound = sal_True;
+ bFound = true;
else
pTest = (String*)mpLayoutsToTransfer->Next();
}
- const sal_uInt16 nMPageCount = rDoc.GetMasterPageCount();
- for (sal_uInt16 nMPage = 0; nMPage < nMPageCount && !bFound; nMPage++)
+ const sal_uInt32 nMPageCount = rDoc.GetMasterPageCount();
+ for (sal_uInt32 nMPage = 0; nMPage < nMPageCount && !bFound; nMPage++)
{
/**************************************************************
* Gibt es die Layouts schon im Dokument?
@@ -398,7 +396,7 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
aTest.Erase( aTest.SearchAscii( SD_LT_SEPARATOR ));
if (aTest == *pLayout)
- bFound = sal_True;
+ bFound = true;
}
if (!bFound)
@@ -422,22 +420,22 @@ private:
};
-sal_Bool SdDrawDocument::InsertBookmarkAsPage(
+bool SdDrawDocument::InsertBookmarkAsPage(
List* pBookmarkList,
List* pExchangeList, // Liste der zu verwendenen Namen
- sal_Bool bLink,
- sal_Bool bReplace,
- sal_uInt16 nInsertPos,
- sal_Bool bNoDialogs,
+ bool bLink,
+ bool bReplace,
+ sal_uInt32 nInsertPos,
+ bool bNoDialogs,
::sd::DrawDocShell* pBookmarkDocSh,
- sal_Bool bCopy,
- sal_Bool bMergeMasterPages,
- sal_Bool bPreservePageNames)
+ bool bCopy,
+ bool bMergeMasterPages,
+ bool bPreservePageNames)
{
- sal_Bool bOK = sal_True;
- sal_Bool bContinue = sal_True;
- sal_Bool bScaleObjects = sal_False;
- sal_uInt16 nReplacedStandardPages = 0;
+ bool bOK = true;
+ bool bContinue = true;
+ bool bScaleObjects = false;
+ sal_uInt32 nReplacedStandardPages = 0;
SdDrawDocument* pBookmarkDoc = NULL;
String aBookmarkName;
@@ -458,16 +456,16 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
}
else
{
- return sal_False;
+ return false;
}
- const sal_uInt16 nSdPageCount = GetSdPageCount(PK_STANDARD);
- const sal_uInt16 nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PK_STANDARD);
- const sal_uInt16 nMPageCount = GetMasterPageCount();
+ const sal_uInt32 nSdPageCount = GetSdPageCount(PK_STANDARD);
+ const sal_uInt32 nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PK_STANDARD);
+ const sal_uInt32 nMPageCount = GetMasterPageCount();
if (nSdPageCount==0 || nBMSdPageCount==0 || nMPageCount==0)
{
- bContinue = bOK = sal_False;
+ bContinue = bOK = false;
return(bContinue);
}
@@ -476,20 +474,20 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
// before the first page.
// Note that the pointers are used later on as general page pointers.
SdPage* pRefPage = GetSdPage(0, PK_STANDARD);
- Size aSize(pRefPage->GetSize());
- sal_Int32 nLeft = pRefPage->GetLftBorder();
- sal_Int32 nRight = pRefPage->GetRgtBorder();
- sal_Int32 nUpper = pRefPage->GetUppBorder();
- sal_Int32 nLower = pRefPage->GetLwrBorder();
- Orientation eOrient = pRefPage->GetOrientation();
-
- SdPage* pNPage = GetSdPage(0, PK_NOTES);
- Size aNSize(GetSdPage(0, PK_NOTES)->GetSize());
- sal_Int32 nNLeft = pNPage->GetLftBorder();
- sal_Int32 nNRight = pNPage->GetRgtBorder();
- sal_Int32 nNUpper = pNPage->GetUppBorder();
- sal_Int32 nNLower = pNPage->GetLwrBorder();
- Orientation eNOrient = pRefPage->GetOrientation();
+ const basegfx::B2DVector& rSize(pRefPage->GetPageScale());
+ const double fLeft(pRefPage->GetLeftPageBorder());
+ const double fRight(pRefPage->GetRightPageBorder());
+ const double fUpper(pRefPage->GetTopPageBorder());
+ const double fLower(pRefPage->GetBottomPageBorder());
+ const Orientation eOrient(pRefPage->GetOrientation());
+
+ const SdPage* pNPage = GetSdPage(0, PK_NOTES);
+ const basegfx::B2DVector aNSize(GetSdPage(0, PK_NOTES)->GetPageScale());
+ const double fNLeft(pNPage->GetLeftPageBorder());
+ const double fNRight(pNPage->GetRightPageBorder());
+ const double fNUpper(pNPage->GetTopPageBorder());
+ const double fNLower(pNPage->GetBottomPageBorder());
+ const Orientation eNOrient(pRefPage->GetOrientation());
// Seitengroesse und -raender an die Werte der letzten
// Seiten anpassen?
@@ -500,17 +498,17 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
if( !pBookmarkList )
bScaleObjects = pRefPage->IsScaleObjects();
else
- bScaleObjects = sal_True;
+ bScaleObjects = true;
}
else
{
SdPage* pBMPage = pBookmarkDoc->GetSdPage(0,PK_STANDARD);
- if (pBMPage->GetSize() != pRefPage->GetSize() ||
- pBMPage->GetLftBorder() != pRefPage->GetLftBorder() ||
- pBMPage->GetRgtBorder() != pRefPage->GetRgtBorder() ||
- pBMPage->GetUppBorder() != pRefPage->GetUppBorder() ||
- pBMPage->GetLwrBorder() != pRefPage->GetLwrBorder())
+ if (!pBMPage->GetPageScale().equal(pRefPage->GetPageScale()) ||
+ pBMPage->GetLeftPageBorder() != pRefPage->GetLeftPageBorder() ||
+ pBMPage->GetRightPageBorder() != pRefPage->GetRightPageBorder() ||
+ pBMPage->GetTopPageBorder() != pRefPage->GetTopPageBorder() ||
+ pBMPage->GetBottomPageBorder() != pRefPage->GetBottomPageBorder())
{
String aStr(SdResId(STR_SCALE_OBJECTS));
sal_uInt16 nBut = QueryBox( NULL, WB_YES_NO_CANCEL, aStr).Execute();
@@ -558,7 +556,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
// Wenn Vorlagen kopiert werden muessen, dann muessen auch die
// MasterPages kopiert werden!
if( pLayout )
- bMergeMasterPages = sal_True;
+ bMergeMasterPages = true;
while (pLayout)
{
@@ -570,7 +568,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
{
if( pUndoMgr )
{
- SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, sal_True);
+ SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, true);
pUndoMgr->AddUndoAction(pMovStyles);
}
}
@@ -599,17 +597,17 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
nInsertPos = GetPageCount();
}
- sal_uInt16 nActualInsertPos = nInsertPos;
+ sal_uInt32 nActualInsertPos = nInsertPos;
List aNameList;
- std::set<sal_uInt16> aRenameSet;
- sal_uInt16 nBMSdPage;
+ std::set< sal_uInt32 > aRenameSet;
+ sal_uInt32 nBMSdPage;
for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
{
SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD);
String pName( pBMPage->GetName() );
- sal_Bool bIsMasterPage;
+ bool bIsMasterPage;
if (bLink)
{
@@ -629,11 +627,11 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
Merge(*pBookmarkDoc,
1, // Nicht die Handzettelseite
- 0xFFFF, // Aber alle anderen
+ SDRPAGE_NOTFOUND, // Aber alle anderen
nActualInsertPos, // An Position einfuegen
bMergeMasterPages, // MasterPages mitnehmen
- sal_False, // Aber nur die benoetigten MasterPages
- sal_True, // Undo-Aktion erzeugen
+ false, // Aber nur die benoetigten MasterPages
+ true, // Undo-Aktion erzeugen
bCopy); // Seiten kopieren (oder mergen)
for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
@@ -657,7 +655,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
pPage->SetFileName(aBookmarkName);
pPage->SetBookmarkName(*(pName));
delete pName;
- pPage->SetModel(this);
+ // pPage->SetModel(this);
}
nActualInsertPos += 2;
@@ -673,19 +671,19 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
if (nInsertPos >= GetPageCount())
{
// Seiten werden hinten angefuegt
- bReplace = sal_False;
+ bReplace = false;
nInsertPos = GetPageCount();
}
- sal_uInt16 nActualInsertPos = nInsertPos;
+ sal_uInt32 nActualInsertPos = nInsertPos;
// Collect the bookmarked pages.
::std::vector<SdPage*> aBookmarkedPages (pBookmarkList->Count(), NULL);
- for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++)
+ for (sal_uInt32 nPos(0); nPos < pBookmarkList->Count(); nPos++)
{
String aPgName(*(String*) pBookmarkList->GetObject(nPos));
- sal_Bool bIsMasterPage;
- sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage );
+ bool bIsMasterPage;
+ const sal_uInt32 nBMPage(pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage ));
if (nBMPage != SDRPAGE_NOTFOUND)
{
@@ -693,10 +691,10 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
}
}
- for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++)
+ for (sal_uInt32 nPos(0); nPos < pBookmarkList->Count(); nPos++)
{
pBMPage = aBookmarkedPages[nPos];
- sal_uInt16 nBMPage = pBMPage!=NULL ? pBMPage->GetPageNum() : SDRPAGE_NOTFOUND;
+ const sal_uInt32 nBMPage(pBMPage ? pBMPage->GetPageNumber() : SDRPAGE_NOTFOUND);
if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
{
@@ -709,8 +707,9 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
// #67905# don't change name if source and dest model are the same!
// #96029# avoid renaming if replacing the same page
String aPgName(*(String*) pBookmarkList->GetObject(nPos));
- sal_Bool bIsMasterPage;
- sal_uInt16 nPageSameName = GetPageByName(aPgName, bIsMasterPage);
+ bool bIsMasterPage(false);
+ const sal_uInt32 nPageSameName(GetPageByName(aPgName, bIsMasterPage));
+
if( pBookmarkDoc != this &&
nPageSameName != SDRPAGE_NOTFOUND &&
( !bReplace ||
@@ -730,8 +729,8 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
nBMPage+1, // Bis Seite (Notizen)
nActualInsertPos, // An Position einfuegen
bMergeMasterPages, // MasterPages mitnehmen
- sal_False, // Aber nur die benoetigten MasterPages
- sal_True, // Undo-Aktion erzeugen
+ false, // Aber nur die benoetigten MasterPages
+ true, // Undo-Aktion erzeugen
bCopy); // Seiten kopieren (oder mergen)
if( bReplace )
@@ -758,13 +757,13 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
SdPage* pPage = (SdPage*) GetPage(nActualInsertPos);
pPage->SetFileName(aBookmarkName);
pPage->SetBookmarkName(aPgName);
- pPage->SetModel(this);
+ // pPage->SetModel(this);
}
if (bReplace)
{
// Seite & Notizseite ausfuegen
- const sal_uInt16 nDestPageNum(nActualInsertPos + 2);
+ const sal_uInt32 nDestPageNum(nActualInsertPos + 2);
SdPage* pStandardPage = 0L;
if(nDestPageNum < GetPageCount())
@@ -830,17 +829,17 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
|* DrawingEngine gleiche Praesentationslayouts nicht erkennen kann.
|* Ueberzaehlige MasterPages entfernen.
\*************************************************************************/
- sal_uInt16 nNewMPageCount = GetMasterPageCount();
+ sal_uInt32 nNewMPageCount = GetMasterPageCount();
// rueckwaerts, damit Nummern nicht durcheinander geraten
- for (sal_uInt16 nPage = nNewMPageCount - 1; nPage >= nMPageCount; nPage--)
+ for (sal_uInt32 nPage = nNewMPageCount - 1; nPage >= nMPageCount; nPage--)
{
pRefPage = (SdPage*) GetMasterPage(nPage);
String aMPLayout(pRefPage->GetLayoutName());
PageKind eKind = pRefPage->GetPageKind();
// gibt's den schon?
- for (sal_uInt16 nTest = 0; nTest < nMPageCount; nTest++)
+ for (sal_uInt32 nTest = 0; nTest < nMPageCount; nTest++)
{
SdPage* pTest = (SdPage*) GetMasterPage(nTest);
String aTest(pTest->GetLayoutName());
@@ -866,9 +865,8 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
// #96029# nInsertPos > 2 is always true when inserting into non-empty models
if (nInsertPos > 0)
{
- sal_uInt16 nSdPageStart = (nInsertPos - 1) / 2;
- sal_uInt16 nSdPageEnd = GetSdPageCount(PK_STANDARD) - nSdPageCount +
- nSdPageStart - 1;
+ sal_uInt32 nSdPageStart = (nInsertPos - 1) / 2;
+ sal_uInt32 nSdPageEnd = GetSdPageCount(PK_STANDARD) - nSdPageCount + nSdPageStart - 1;
const bool bRemoveEmptyPresObj = pBookmarkDoc &&
(pBookmarkDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) &&
(GetDocumentType() == DOCUMENT_TYPE_DRAW);
@@ -878,7 +876,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
nSdPageEnd = nSdPageStart + nReplacedStandardPages - 1;
}
- for (sal_uInt16 nSdPage = nSdPageStart; nSdPage <= nSdPageEnd; nSdPage++)
+ for (sal_uInt32 nSdPage = nSdPageStart; nSdPage <= nSdPageEnd; nSdPage++)
{
pRefPage = GetSdPage(nSdPage, PK_STANDARD);
@@ -889,13 +887,10 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
{
String aExchangeName (*(String*) pExchangeList->GetCurObject());
pRefPage->SetName(aExchangeName);
- SdrHint aHint(HINT_PAGEORDERCHG);
- aHint.SetPage(pRefPage);
- Broadcast(aHint);
+ Broadcast(SdrBaseHint(*pRefPage, HINT_PAGEORDERCHG));
SdPage* pNewNotesPage = GetSdPage(nSdPage, PK_NOTES);
pNewNotesPage->SetName(aExchangeName);
- aHint.SetPage(pNewNotesPage);
- Broadcast(aHint);
+ Broadcast(SdrBaseHint(*pNewNotesPage, HINT_PAGEORDERCHG));
}
pExchangeList->Next();
@@ -911,11 +906,10 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
if (bScaleObjects)
{
- Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
- pRefPage->ScaleObjects(aSize, aBorderRect, sal_True);
+ pRefPage->ScaleObjects(rSize, fLeft, fUpper, fRight, fLower, true);
}
- pRefPage->SetSize(aSize);
- pRefPage->SetBorder(nLeft, nUpper, nRight, nLower);
+ pRefPage->SetPageScale(rSize);
+ pRefPage->SetPageBorder(fLeft, fUpper, fRight, fLower);
pRefPage->SetOrientation( eOrient );
if( bRemoveEmptyPresObj )
@@ -930,41 +924,38 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
if (bScaleObjects)
{
- Rectangle aBorderRect(nNLeft, nNUpper, nNRight, nNLower);
- pRefPage->ScaleObjects(aNSize, aBorderRect, sal_True);
+ pRefPage->ScaleObjects(aNSize, fNLeft, fNUpper, fNRight, fNLower, true);
}
- pRefPage->SetSize(aNSize);
- pRefPage->SetBorder(nNLeft, nNUpper, nNRight, nNLower);
+ pRefPage->SetPageScale(aNSize);
+ pRefPage->SetPageBorder(fNLeft, fNUpper, fNRight, fNLower);
pRefPage->SetOrientation( eNOrient );
if( bRemoveEmptyPresObj )
pRefPage->RemoveEmptyPresentationObjects();
}
- for (sal_uInt16 nPage = nMPageCount; nPage < nNewMPageCount; nPage++)
+ for (sal_uInt32 nPage = nMPageCount; nPage < nNewMPageCount; nPage++)
{
pRefPage = (SdPage*) GetMasterPage(nPage);
if (pRefPage->GetPageKind() == PK_STANDARD)
{
if (bScaleObjects)
{
- Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
- pRefPage->ScaleObjects(aSize, aBorderRect, sal_True);
+ pRefPage->ScaleObjects(rSize, fLeft, fUpper, fRight, fLower, true);
}
- pRefPage->SetSize(aSize);
- pRefPage->SetBorder(nLeft, nUpper, nRight, nLower);
+ pRefPage->SetPageScale(rSize);
+ pRefPage->SetPageBorder(fLeft, fUpper, fRight, fLower);
pRefPage->SetOrientation( eOrient );
}
else // kann nur noch NOTES sein
{
if (bScaleObjects)
{
- Rectangle aBorderRect(nNLeft, nNUpper, nNRight, nNLower);
- pRefPage->ScaleObjects(aNSize, aBorderRect, sal_True);
+ pRefPage->ScaleObjects(aNSize, fNLeft, fNUpper, fNRight, fNLower, true);
}
- pRefPage->SetSize(aNSize);
- pRefPage->SetBorder(nNLeft, nNUpper, nNRight, nNLower);
+ pRefPage->SetPageScale(aNSize);
+ pRefPage->SetPageBorder(fNLeft, fNUpper, fNRight, fNLower);
pRefPage->SetOrientation( eNOrient );
}
@@ -974,7 +965,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
}
// #91146# Make absolutely sure no double masterpages are there
- RemoveUnnecessaryMasterPages(NULL, sal_True, sal_True);
+ RemoveUnnecessaryMasterPages(NULL, true, true);
if( bUndo )
EndUndo();
@@ -989,15 +980,15 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
|*
\************************************************************************/
-sal_Bool SdDrawDocument::InsertBookmarkAsObject(
+bool SdDrawDocument::InsertBookmarkAsObject(
List* pBookmarkList,
List* pExchangeList, // Liste der zu verwendenen Namen
- sal_Bool /* bLink */,
+ bool /* bLink */,
::sd::DrawDocShell* pBookmarkDocSh,
- Point* pObjPos)
+ basegfx::B2DPoint* pObjPos)
{
- sal_Bool bOK = sal_True;
- sal_Bool bOLEObjFound = sal_False;
+ bool bOK = true;
+ bool bOLEObjFound = false;
::sd::View* pBMView = NULL;
SdDrawDocument* pBookmarkDoc = NULL;
@@ -1019,19 +1010,18 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
}
else
{
- return sal_False;
+ return false;
}
if (!pBookmarkList)
{
- pBMView = new ::sd::View(pBookmarkDoc, (OutputDevice*) NULL);
+ pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
pBMView->EndListening(*pBookmarkDoc);
pBMView->MarkAll();
}
else
{
- SdrPage* pPage;
- SdrPageView* pPV;
+ SdrPage* pPage = 0;
for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++)
{
@@ -1049,30 +1039,36 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
if (pObj->GetObjInventor() == SdrInventor &&
pObj->GetObjIdentifier() == OBJ_OLE2)
{
- bOLEObjFound = sal_True;
+ bOLEObjFound = true;
}
if (!pBMView)
{
// View erstmalig erzeugen
- pBMView = new ::sd::View(pBookmarkDoc, (OutputDevice*) NULL);
+ pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
pBMView->EndListening(*pBookmarkDoc);
}
- pPage = pObj->GetPage();
+ pPage = pObj->getSdrPageFromSdrObject();
- if (pPage->IsMasterPage())
+ if(pPage)
{
- pPV = pBMView->ShowSdrPage(pBMView->GetModel()->GetMasterPage(pPage->GetPageNum()));
- }
- else
- {
- pPV = pBMView->GetSdrPageView();
- if( !pPV || (pPV->GetPage() != pPage))
- pPV = pBMView->ShowSdrPage(pPage);
+ if (pPage->IsMasterPage())
+ {
+ pBMView->ShowSdrPage(*pBMView->getSdrModelFromSdrView().GetMasterPage(pPage->GetPageNumber()));
+ }
+ else
+ {
+ SdrPageView* pPV = pBMView->GetSdrPageView();
+
+ if( !pPV || (&pPV->getSdrPageFromSdrPageView() != pPage))
+ {
+ pBMView->ShowSdrPage(*pPage);
+ }
+ }
}
- pBMView->MarkObj(pObj, pPV, sal_False);
+ pBMView->MarkObj(*pObj, false);
}
}
}
@@ -1082,7 +1078,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
/**********************************************************************
* Selektierte Objekte einfuegen
**********************************************************************/
- ::sd::View* pView = new ::sd::View(this, (OutputDevice*) NULL);
+ ::sd::View* pView = new ::sd::View(*this, (OutputDevice*) NULL);
pView->EndListening(*this);
// Seite bestimmen, auf der die Objekte eingefuegt werden sollen
@@ -1099,7 +1095,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
if (pPV)
{
- pPage = pPV->GetPage();
+ pPage = &pPV->getSdrPageFromSdrPageView();
}
else if (pViewSh->GetActualPage())
{
@@ -1108,7 +1104,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
}
}
- Point aObjPos;
+ basegfx::B2DPoint aObjPos;
if (pObjPos)
{
@@ -1116,26 +1112,25 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
}
else
{
- aObjPos = Rectangle(Point(), pPage->GetSize()).Center();
+ aObjPos = pPage->GetPageScale() * 0.5;
}
- sal_uLong nCountBefore = 0;
+ sal_uInt32 nCountBefore = 0;
if (pExchangeList)
{
// OrdNums sortieren und Anzahl Objekte vor dem Einfuegen bestimmen
- pPage->RecalcObjOrdNums();
nCountBefore = pPage->GetObjCount();
}
if (bOLEObjFound)
- pBMView->GetDoc()->SetAllocDocSh(sal_True);
+ pBMView->GetDoc()->SetAllocDocSh(true);
SdDrawDocument* pTmpDoc = (SdDrawDocument*) pBMView->GetAllMarkedModel();
bOK = pView->Paste(*pTmpDoc, aObjPos, pPage);
if (bOLEObjFound)
- pBMView->GetDoc()->SetAllocDocSh(sal_False);
+ pBMView->GetDoc()->SetAllocDocSh(false);
if (!bOLEObjFound)
delete pTmpDoc; // Wird ansonsten von der DocShell zerstoert
@@ -1147,9 +1142,9 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
if (pExchangeList)
{
// Anzahl Objekte nach dem Einfuegen bestimmen
- sal_uLong nCount = pPage->GetObjCount();
+ sal_uInt32 nCount = pPage->GetObjCount();
- for (sal_uLong nObj = nCountBefore; nObj < nCount; nObj++)
+ for (sal_uInt32 nObj = nCountBefore; nObj < nCount; nObj++)
{
// Zuverwendener Name aus Exchange-Liste holen
if (pExchangeList->GetCurObject())
@@ -1219,9 +1214,9 @@ void SdDrawDocument::DisposeLoadedModels()
|*
\************************************************************************/
-FASTBOOL SdDrawDocument::IsReadOnly() const
+bool SdDrawDocument::IsReadOnly() const
{
- return sal_False;
+ return false;
}
@@ -1232,7 +1227,7 @@ FASTBOOL SdDrawDocument::IsReadOnly() const
|*
\************************************************************************/
-void SdDrawDocument::SetAllocDocSh(sal_Bool bAlloc)
+void SdDrawDocument::SetAllocDocSh(bool bAlloc)
{
mbAllocDocSh = bAlloc;
@@ -1250,7 +1245,7 @@ void SdDrawDocument::SetAllocDocSh(sal_Bool bAlloc)
|*
\************************************************************************/
-List* SdDrawDocument::GetCustomShowList(sal_Bool bCreate)
+List* SdDrawDocument::GetCustomShowList(bool bCreate)
{
if (!mpCustomShowList && bCreate)
{
@@ -1326,9 +1321,9 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo)
if( pRet )
{
// try to get some information from stream
- const sal_uLong nStartPos = pRet->Tell();
- const sal_uLong nEndPos = pRet->Seek( STREAM_SEEK_TO_END );
- const sal_uLong nStmLen = nEndPos - nStartPos;
+ const sal_uInt32 nStartPos = pRet->Tell();
+ const sal_uInt32 nEndPos = pRet->Seek( STREAM_SEEK_TO_END );
+ const sal_uInt32 nStmLen = nEndPos - nStartPos;
sal_uChar aTestByte;
// try to read one byte
@@ -1349,13 +1344,13 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo)
|*
\************************************************************************/
-void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool bOnlyDuplicatePages, sal_Bool bUndo)
+void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnlyDuplicatePages, bool bUndo)
{
::sd::View* pView = NULL;
::svl::IUndoManager* pUndoMgr = NULL;
if( bUndo && !IsUndoEnabled() )
- bUndo = sal_False;
+ bUndo = false;
if (mpDocSh)
{
@@ -1368,7 +1363,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
/***********************************************************
* Alle MasterPages pruefen
***********************************************************/
- sal_uInt16 nSdMasterPageCount = GetMasterSdPageCount( PK_STANDARD );
+ sal_uInt32 nSdMasterPageCount = GetMasterSdPageCount( PK_STANDARD );
for (sal_Int32 nMPage = nSdMasterPageCount - 1; nMPage >= 0; nMPage--)
{
SdPage* pMaster = pMasterPage;
@@ -1376,12 +1371,12 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
if (!pMaster)
{
- pMaster = (SdPage*) GetMasterSdPage( (sal_uInt16) nMPage, PK_STANDARD );
- pNotesMaster = (SdPage*) GetMasterSdPage( (sal_uInt16) nMPage, PK_NOTES );
+ pMaster = (SdPage*) GetMasterSdPage( nMPage, PK_STANDARD );
+ pNotesMaster = (SdPage*) GetMasterSdPage( nMPage, PK_NOTES );
}
else
{
- for ( sal_uInt16 nMPg = 0; nMPg < GetMasterPageCount(); nMPg++ )
+ for ( sal_uInt32 nMPg = 0; nMPg < GetMasterPageCount(); nMPg++ )
{
if ( pMaster == GetMasterPage( nMPg ) )
{
@@ -1398,21 +1393,21 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
pNotesMaster )
{
// Do not delete master pages that have their precious flag set.
- sal_Bool bDeleteMaster = !pMaster->IsPrecious();
+ bool bDeleteMaster = !pMaster->IsPrecious();
String aLayoutName = pMaster->GetLayoutName();
if(bOnlyDuplicatePages )
{
// remove only duplicate pages
- bDeleteMaster = sal_False;
- for (sal_uInt16 i = 0; i < GetMasterSdPageCount( PK_STANDARD ); i++)
+ bDeleteMaster = false;
+ for (sal_uInt32 i = 0; i < GetMasterSdPageCount( PK_STANDARD ); i++)
{
SdPage* pMPg = (SdPage*) GetMasterSdPage( i, PK_STANDARD );
if( pMPg != pMaster &&
pMPg->GetLayoutName() == aLayoutName )
{
// duplicate page found -> remove it
- bDeleteMaster = sal_True;
+ bDeleteMaster = true;
}
}
}
@@ -1425,11 +1420,11 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
SdrPageView* pPgView = pView->GetSdrPageView();
if (pPgView)
{
- SdrPage* pShownPage = pPgView->GetPage();
- if( (pShownPage == pMaster) || (pShownPage == pNotesMaster) )
+ SdrPage& rShownPage = pPgView->getSdrPageFromSdrPageView();
+
+ if( (&rShownPage == pMaster) || (&rShownPage == pNotesMaster) )
{
- pView->HideSdrPage();
- pView->ShowSdrPage( GetSdPage( 0, PK_STANDARD ) );
+ pView->ShowSdrPage( *GetSdPage( 0, PK_STANDARD ) );
}
}
}
@@ -1440,7 +1435,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
AddUndo( GetSdrUndoFactory().CreateUndoDeletePage( *pNotesMaster ) );
}
- RemoveMasterPage( pNotesMaster->GetPageNum() );
+ RemoveMasterPage( pNotesMaster->GetPageNumber() );
if( !bUndo )
delete pNotesMaster;
@@ -1448,7 +1443,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
if( bUndo )
AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pMaster));
- RemoveMasterPage( pMaster->GetPageNum() );
+ RemoveMasterPage( pMaster->GetPageNumber() );
if( !bUndo )
delete pMaster;
@@ -1457,22 +1452,22 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
EndUndo(); // schon hier, damit sich Joes Actions ZWISCHEN unsere eigenen schieben
// alte Layoutvorlagen loeschen, wenn sie nicht mehr benoetigt werden
- sal_Bool bDeleteOldStyleSheets = sal_True;
- for ( sal_uInt16 nMPg = 0;
+ bool bDeleteOldStyleSheets = true;
+ for ( sal_uInt32 nMPg = 0;
nMPg < GetMasterPageCount() && bDeleteOldStyleSheets;
nMPg++ )
{
SdPage* pMPg = (SdPage*) GetMasterPage(nMPg);
if (pMPg->GetLayoutName() == aLayoutName)
{
- bDeleteOldStyleSheets = sal_False;
+ bDeleteOldStyleSheets = false;
}
}
if (bDeleteOldStyleSheets)
{
SdStyleSheetVector aRemove;
- static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->CreateLayoutSheetList( aLayoutName, aRemove );
+ GetSdStyleSheetPool()->CreateLayoutSheetList( aLayoutName, aRemove );
if( bUndo )
{
@@ -1484,7 +1479,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
}
for( SdStyleSheetVector::iterator iter = aRemove.begin(); iter != aRemove.end(); iter++ )
- static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->Remove((*iter).get());
+ GetSdStyleSheetPool()->Remove((*iter).get());
}
}
}
@@ -1512,14 +1507,14 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
|* Ist rLayoutName leer, so wird die erste MasterPage genommen
\************************************************************************/
-void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
+void SdDrawDocument::SetMasterPage(sal_uInt32 nSdPageNum,
const String& rLayoutName,
SdDrawDocument* pSourceDoc,
- sal_Bool bMaster,
- sal_Bool bCheckMasters)
+ bool bMaster,
+ bool bCheckMasters)
{
if( mpDocSh )
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
@@ -1531,7 +1526,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
}
SdPage* pSelectedPage = GetSdPage(nSdPageNum, PK_STANDARD);
- SdPage* pNotes = (SdPage*) GetPage(pSelectedPage->GetPageNum()+1);
+ SdPage* pNotes = (SdPage*) GetPage(pSelectedPage->GetPageNumber()+1);
SdPage& rOldMaster = (SdPage&)pSelectedPage->TRG_GetMasterPage();
SdPage& rOldNotesMaster = (SdPage&)pNotes->TRG_GetMasterPage();
SdPage* pMaster = NULL;
@@ -1546,7 +1541,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (pSourceDoc)
{
List* pReplList = NULL;
- sal_Bool bLayoutReloaded = sal_False; // Wurde ex. Layout wieder geladen?
+ bool bLayoutReloaded = false; // Wurde ex. Layout wieder geladen?
/*********************************************************************
|* LayoutName, Page and Notespage
@@ -1564,7 +1559,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
aSearchFor.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
aSearchFor.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ;
- for (sal_uInt16 nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); nMP++)
+ for (sal_uInt32 nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); nMP++)
{
SdPage* pMP = (SdPage*) pSourceDoc->GetMasterPage(nMP);
@@ -1597,7 +1592,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
pUndoMgr->LeaveListAction();
if( mpDocSh )
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
DBG_ERROR( "SdDrawDocument::SetMasterPage() failed!" );
@@ -1606,13 +1601,13 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (pSourceDoc != this)
{
- const sal_uInt16 nMasterPageCount = GetMasterPageCount();
- for ( sal_uInt16 nMPage = 0; nMPage < nMasterPageCount; nMPage++ )
+ const sal_uInt32 nMasterPageCount = GetMasterPageCount();
+ for ( sal_uInt32 nMPage = 0; nMPage < nMasterPageCount; nMPage++ )
{
SdPage* pCheckMaster = (SdPage*)GetMasterPage(nMPage);
if( pCheckMaster->GetName() == aNewLayoutName )
{
- bLayoutReloaded = sal_True;
+ bLayoutReloaded = true;
break;
}
}
@@ -1624,7 +1619,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
String aName;
SdStyleSheetPool* pSourceStyleSheetPool = (SdStyleSheetPool*) pSourceDoc->GetStyleSheetPool();
pSourceStyleSheetPool->SetSearchMask(SD_STYLE_FAMILY_MASTERPAGE);
- static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->SetSearchMask(SD_STYLE_FAMILY_MASTERPAGE);
+ GetSdStyleSheetPool()->SetSearchMask(SD_STYLE_FAMILY_MASTERPAGE);
pReplList = new List; // Liste fuer ersetzte StyleSheets
SdStyleSheetVector aCreatedStyles; // Liste fuer erzeugte StyleSheets
@@ -1637,20 +1632,19 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if( aName.Search( aNewLayoutName ) == 0 )
{
- SfxStyleSheet* pMySheet = static_cast<SfxStyleSheet*>( mxStyleSheetPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE) );
+ SfxStyleSheet* pMySheet = static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_MASTERPAGE) );
if (pMySheet)
{
// Es ist eine gleichnamige Vorlage vorhanden ist: Inhalte ersetzen
#ifdef DBG_UTIL
- sal_Bool bTest =
+ bool bTest =
#endif
pMySheet->SetName(pHisSheet->GetName());
DBG_ASSERT(bTest, "StyleSheet-Umbenennung fehlgeschlagen");
pMySheet->GetItemSet().ClearItem(0); // alle loeschen
- StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this,
- pMySheet, &pHisSheet->GetItemSet());
+ StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(*this, *pMySheet, pHisSheet->GetItemSet());
pUndoMgr->AddUndoAction(pUndoChStyle);
pMySheet->GetItemSet().Put(pHisSheet->GetItemSet());
pMySheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
@@ -1659,7 +1653,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
// create new style
String aHelpFile;
- pMySheet = static_cast<SfxStyleSheet*>( &mxStyleSheetPool->Make(aName, SD_STYLE_FAMILY_MASTERPAGE, pHisSheet->GetMask()) );
+ pMySheet = static_cast<SfxStyleSheet*>( &GetStyleSheetPool()->Make(aName, SD_STYLE_FAMILY_MASTERPAGE, pHisSheet->GetMask()) );
pMySheet->SetHelpId( aHelpFile, pHisSheet->GetHelpId(aHelpFile) );
pMySheet->GetItemSet().ClearItem(0); // alle loeschen
pMySheet->GetItemSet().Put(pHisSheet->GetItemSet());
@@ -1692,8 +1686,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
while (pRData)
{
- SfxStyleSheetBase* pSOld = mxStyleSheetPool->Find(pRData->aName);
- SfxStyleSheetBase* pSNew = mxStyleSheetPool->Find(pRData->aNewName);
+ SfxStyleSheetBase* pSOld = GetStyleSheetPool()->Find(pRData->aName);
+ SfxStyleSheetBase* pSNew = GetStyleSheetPool()->Find(pRData->aNewName);
if (pSOld && pSNew)
{
@@ -1703,7 +1697,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (rParentOfOld.Len() > 0 && rParentOfNew.Len() == 0)
{
- for (sal_uLong i = 0; i < pReplList->Count(); i++)
+ for (sal_uInt32 i = 0; i < pReplList->Count(); i++)
{
StyleReplaceData* pRD = (StyleReplaceData*)pReplList->
GetObject(i);
@@ -1721,14 +1715,14 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// ab jetzt beim Suchen alle beachten
pSourceStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_ALL);
- mxStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_ALL);
+ GetStyleSheetPool()->SetSearchMask(SFX_STYLE_FAMILY_ALL);
}
if( !aCreatedStyles.empty() )
{
// UndoAction fuer das Erzeugen und Einfuegen vorn StyleSheets
// auf den UndoManager legen
- SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction( this, aCreatedStyles, sal_True);
+ SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction( this, aCreatedStyles, true);
pUndoMgr->AddUndoAction(pMovStyles);
}
}
@@ -1742,8 +1736,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
// Aus dem Source-Dokument austragen
SdrPage* pTest = NULL;
- pTest = pSourceDoc->RemoveMasterPage(pNotesMaster->GetPageNum());
- pTest = pSourceDoc->RemoveMasterPage(pMaster->GetPageNum());
+ pTest = pSourceDoc->RemoveMasterPage(pNotesMaster->GetPageNumber());
+ pTest = pSourceDoc->RemoveMasterPage(pMaster->GetPageNumber());
}
/*********************************************************************
@@ -1757,18 +1751,18 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// dagegen ersetzt, so muss vor der Position der alten Masterpage
// eingefuegt werden, damit ab jetzt beim Suchen (z. B. SdPage::
// SetPresentationLayout) die neue Masterpage zuerst gefunden wird
- sal_uInt16 nInsertPos = rOldMaster.GetPageNum();
+ sal_uInt32 nInsertPos = rOldMaster.GetPageNumber();
BegUndo();
if (!bLayoutReloaded)
- nInsertPos = 0xFFFF;
+ nInsertPos = 0xffffffff;
InsertMasterPage(pMaster, nInsertPos);
if( bUndo )
AddUndo(GetSdrUndoFactory().CreateUndoNewPage(*pMaster));
nInsertPos++;
if (!bLayoutReloaded)
- nInsertPos = 0xFFFF;
+ nInsertPos = 0xffffffff;
InsertMasterPage(pNotesMaster, nInsertPos);
if( bUndo )
{
@@ -1788,7 +1782,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (bMaster || bLayoutReloaded)
{
- for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
+ for (sal_uInt32 nPage = 1; nPage < GetPageCount(); nPage++)
{
pPage = (SdPage*) GetPage(nPage);
String aTest = pPage->GetLayoutName();
@@ -1817,7 +1811,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
(this,
pPage->IsMasterPage() ? aLayoutName : aOldLayoutName,
aLayoutName,
- eAutoLayout, eAutoLayout, sal_False, pPage);
+ eAutoLayout, eAutoLayout, false, pPage);
pUndoMgr->AddUndoAction(pPLUndoAction);
}
pPage->SetPresentationLayout(aLayoutName);
@@ -1833,31 +1827,25 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (pSourceDoc != this)
{
// die Masterpages angleichen
- Size aSize(rOldMaster.GetSize());
- Rectangle aBorderRect(rOldMaster.GetLftBorder(),
- rOldMaster.GetUppBorder(),
- rOldMaster.GetRgtBorder(),
- rOldMaster.GetLwrBorder());
- pMaster->ScaleObjects(aSize, aBorderRect, sal_True);
- pMaster->SetSize(aSize);
- pMaster->SetBorder(rOldMaster.GetLftBorder(),
- rOldMaster.GetUppBorder(),
- rOldMaster.GetRgtBorder(),
- rOldMaster.GetLwrBorder());
+ basegfx::B2DVector aPageScale(rOldMaster.GetPageScale());
+ pMaster->ScaleObjects(aPageScale, rOldMaster.GetLeftPageBorder(), rOldMaster.GetTopPageBorder(),
+ rOldMaster.GetRightPageBorder(), rOldMaster.GetBottomPageBorder(), true);
+ pMaster->SetPageScale(aPageScale);
+ pMaster->SetPageBorder(rOldMaster.GetLeftPageBorder(),
+ rOldMaster.GetTopPageBorder(),
+ rOldMaster.GetRightPageBorder(),
+ rOldMaster.GetBottomPageBorder());
pMaster->SetOrientation( rOldMaster.GetOrientation() );
pMaster->SetAutoLayout(pMaster->GetAutoLayout());
- aSize = rOldNotesMaster.GetSize();
- Rectangle aNotesBorderRect(rOldNotesMaster.GetLftBorder(),
- rOldNotesMaster.GetUppBorder(),
- rOldNotesMaster.GetRgtBorder(),
- rOldNotesMaster.GetLwrBorder());
- pNotesMaster->ScaleObjects(aSize, aNotesBorderRect, sal_True);
- pNotesMaster->SetSize(aSize);
- pNotesMaster->SetBorder(rOldNotesMaster.GetLftBorder(),
- rOldNotesMaster.GetUppBorder(),
- rOldNotesMaster.GetRgtBorder(),
- rOldNotesMaster.GetLwrBorder());
+ aPageScale = rOldNotesMaster.GetPageScale();
+ pNotesMaster->ScaleObjects(aPageScale, rOldNotesMaster.GetLeftPageBorder(), rOldNotesMaster.GetTopPageBorder(),
+ rOldNotesMaster.GetRightPageBorder(), rOldNotesMaster.GetBottomPageBorder(), true);
+ pNotesMaster->SetPageScale(aPageScale);
+ pNotesMaster->SetPageBorder(rOldNotesMaster.GetLeftPageBorder(),
+ rOldNotesMaster.GetTopPageBorder(),
+ rOldNotesMaster.GetRightPageBorder(),
+ rOldNotesMaster.GetBottomPageBorder());
pNotesMaster->SetOrientation( rOldNotesMaster.GetOrientation() );
pNotesMaster->SetAutoLayout(pNotesMaster->GetAutoLayout());
@@ -1886,9 +1874,9 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
\********************************************************************/
String aName = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
String aTest;
- sal_Bool bNotANewName = sal_True;
- sal_uInt16 nCount = 0;
- sal_uInt16 nMPgCount = GetMasterPageCount();
+ bool bNotANewName = true;
+ sal_uInt32 nCount = 0;
+ sal_uInt32 nMPgCount = GetMasterPageCount();
for (nCount = 0; bNotANewName; nCount++)
{
@@ -1898,15 +1886,15 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
aTest += String::CreateFromInt32( nCount );
// gibt's schon eine, die so heisst?
- bNotANewName = sal_False;
- for (sal_uInt16 nMPg = 1; nMPg < nMPgCount; nMPg++)
+ bNotANewName = false;
+ for (sal_uInt32 nMPg = 1; nMPg < nMPgCount; nMPg++)
{
const SdrPage* pTest = GetMasterPage(nMPg);
String aPageLayoutName(pTest->GetLayoutName());
aPageLayoutName.Erase( aPageLayoutName.SearchAscii( SD_LT_SEPARATOR ));
if (aPageLayoutName == aTest)
- bNotANewName = sal_True;
+ bNotANewName = true;
}
}
aName = aTest;
@@ -1917,13 +1905,13 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
/*********************************************************************
|* Neue StyleSheets erzeugen
\********************************************************************/
- static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->CreateLayoutStyleSheets(aName);
+ GetSdStyleSheetPool()->CreateLayoutStyleSheets(aName);
SdStyleSheetVector aCreatedStyles;
- static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->CreateLayoutSheetList(aName, aCreatedStyles);
+ GetSdStyleSheetPool()->CreateLayoutSheetList(aName, aCreatedStyles);
if( bUndo )
{
- SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, sal_True);
+ SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, true);
pUndoMgr->AddUndoAction(pMovStyles);
}
@@ -1934,12 +1922,12 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if( bUndo )
BegUndo();
- pMaster = (SdPage*) AllocPage(sal_True);
- pMaster->SetSize(pSelectedPage->GetSize());
- pMaster->SetBorder(pSelectedPage->GetLftBorder(),
- pSelectedPage->GetUppBorder(),
- pSelectedPage->GetRgtBorder(),
- pSelectedPage->GetLwrBorder() );
+ pMaster = (SdPage*) AllocPage(true);
+ pMaster->SetPageScale(pSelectedPage->GetPageScale());
+ pMaster->SetPageBorder(pSelectedPage->GetLeftPageBorder(),
+ pSelectedPage->GetTopPageBorder(),
+ pSelectedPage->GetRightPageBorder(),
+ pSelectedPage->GetBottomPageBorder() );
pMaster->SetName(aName);
pMaster->SetLayoutName(aPageLayoutName);
InsertMasterPage(pMaster);
@@ -1949,13 +1937,13 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
pMaster->SetAutoLayout(AUTOLAYOUT_NONE, true, true);
- pNotesMaster = (SdPage*) AllocPage(sal_True);
+ pNotesMaster = (SdPage*) AllocPage(true);
pNotesMaster->SetPageKind(PK_NOTES);
- pNotesMaster->SetSize(pNotes->GetSize());
- pNotesMaster->SetBorder(pNotes->GetLftBorder(),
- pNotes->GetUppBorder(),
- pNotes->GetRgtBorder(),
- pNotes->GetLwrBorder() );
+ pNotesMaster->SetPageScale(pNotes->GetPageScale());
+ pNotesMaster->SetPageBorder(pNotes->GetLeftPageBorder(),
+ pNotes->GetTopPageBorder(),
+ pNotes->GetRightPageBorder(),
+ pNotes->GetBottomPageBorder() );
pNotesMaster->SetName(aName);
pNotesMaster->SetLayoutName(aPageLayoutName);
InsertMasterPage(pNotesMaster);
@@ -1974,7 +1962,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
List* pPageList = new List;
if (bMaster)
{
- for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
+ for (sal_uInt32 nPage = 1; nPage < GetPageCount(); nPage++)
{
pPage = (SdPage*) GetPage(nPage);
const String s(pPage->GetLayoutName());
@@ -2005,7 +1993,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
SdPresentationLayoutUndoAction * pPLUndoAction =
new SdPresentationLayoutUndoAction
(this, aOldLayoutName, aName,
- eOldAutoLayout, eNewAutoLayout, sal_True,
+ eOldAutoLayout, eNewAutoLayout, true,
pPage);
pUndoMgr->AddUndoAction(pPLUndoAction);
}
@@ -2040,16 +2028,16 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
pUndoMgr->LeaveListAction();
if( mpDocSh )
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
}
void SdDrawDocument::Merge(SdrModel& rSourceModel,
- sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
- sal_uInt16 nDestPos,
- FASTBOOL bMergeMasterPages, FASTBOOL bAllMasterPages,
- FASTBOOL bUndo, FASTBOOL bTreadSourceAsConst)
+ sal_uInt32 nFirstPageNum, sal_uInt32 nLastPageNum,
+ sal_uInt32 nDestPos,
+ bool bMergeMasterPages, bool bAllMasterPages,
+ bool bUndo, bool bTreadSourceAsConst)
{
sal_uInt16 nMasterPageCount = GetMasterPageCount();
SdrModel::Merge( rSourceModel, nFirstPageNum, nLastPageNum, nDestPos, bMergeMasterPages, bAllMasterPages, bUndo, bTreadSourceAsConst );
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 7fa94b40d142..e7871f023ea0 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -51,15 +51,12 @@
#include <svx/dialmgr.hxx> // SVX_RESSTR
#include <editeng/bulitem.hxx>
#include <svx/xtable.hxx>
-#include <svx/sxmsuitm.hxx>
#include <editeng/borderline.hxx>
#include <editeng/boxitem.hxx>
#include <svx/xit.hxx>
#include <svx/xlineit0.hxx>
-#include <svx/sdshitm.hxx>
#include <svx/svdotext.hxx>
#include <svx/xfillit0.hxx>
-#include <svx/sdshcitm.hxx>
#include <editeng/editstat.hxx>
#include <editeng/colritem.hxx>
#include <editeng/fhgtitem.hxx>
@@ -193,10 +190,10 @@ void SdDrawDocument::CreateLayoutTemplates()
rISet.Put(XFillBitmapItem(pPool, Graphic(aNullBmp)));
// Schattenattribute (Drawing Engine)
- rISet.Put(SdrShadowItem(sal_False));
- rISet.Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
- rISet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
- rISet.Put(SdrShadowYDistItem(200));
+ rISet.Put(SdrOnOffItem(SDRATTR_SHADOW, sal_False));
+ rISet.Put(XColorItem(SDRATTR_SHADOWCOLOR, aNullStr, RGB_Color(COL_GRAY)));
+ rISet.Put(SdrMetricItem(SDRATTR_SHADOWXDIST, 200)); // 3 mm Schattendistanz
+ rISet.Put(SdrMetricItem(SDRATTR_SHADOWYDIST, 200));
Font aLatinFont, aCJKFont, aCTLFont;
@@ -240,10 +237,10 @@ void SdDrawDocument::CreateLayoutTemplates()
rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE));
rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE));
- rISet.Put( SdrTextLeftDistItem( 250 ) ); // sj: (i33745) using text frame distances seems to be a better default
- rISet.Put( SdrTextRightDistItem( 250 ) );
- rISet.Put( SdrTextUpperDistItem( 125 ) );
- rISet.Put( SdrTextLowerDistItem( 125 ) );
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 250 ) ); // sj: (i33745) using text frame distances seems to be a better default
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 250 ) );
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 125 ) );
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 125 ) );
rISet.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ) );
@@ -305,10 +302,10 @@ void SdDrawDocument::CreateLayoutTemplates()
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHSHADOW );
pISet = &pSheet->GetItemSet();
- pISet->Put(SdrShadowItem(sal_True));
- pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
- pISet->Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
- pISet->Put(SdrShadowYDistItem(200));
+ pISet->Put(SdrOnOffItem(SDRATTR_SHADOW, true));
+ pISet->Put(XColorItem(SDRATTR_SHADOWCOLOR, aNullStr, RGB_Color(COL_GRAY)));
+ pISet->Put(SdrMetricItem(SDRATTR_SHADOWXDIST, 200)); // 3 mm Schattendistanz
+ pISet->Put(SdrMetricItem(SDRATTR_SHADOWYDIST, 200));
// ---- Objekt ohne Fllung -------------------------------------------
@@ -415,10 +412,10 @@ void SdDrawDocument::CreateLayoutTemplates()
pISet->Put(XFillStyleItem(XFILL_SOLID));
pISet->Put(XFillColorItem(String(), RGB_Color(COL_CYAN)));
- pISet->Put(SdrShadowItem(sal_True));
- pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
- pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
- pISet->Put(SdrShadowYDistItem(200));
+ pISet->Put(SdrOnOffItem(SDRATTR_SHADOW, true));
+ pISet->Put(XColorItem(SDRATTR_SHADOWCOLOR, aNullStr, RGB_Color(COL_GRAY)));
+ pISet->Put(SdrMetricItem(SDRATTR_SHADOWXDIST, 200)); // 2 mm Schattendistanz
+ pISet->Put(SdrMetricItem(SDRATTR_SHADOWYDIST, 200));
pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT )); // 24 pt
@@ -439,10 +436,10 @@ void SdDrawDocument::CreateLayoutTemplates()
Color aOrange4(255, 204, 153);
pISet->Put(XFillColorItem(String(), aOrange4));
- pISet->Put(SdrShadowItem(sal_True));
- pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
- pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
- pISet->Put(SdrShadowYDistItem(200));
+ pISet->Put(SdrOnOffItem(SDRATTR_SHADOW, true));
+ pISet->Put(XColorItem(SDRATTR_SHADOWCOLOR, aNullStr, RGB_Color(COL_GRAY)));
+ pISet->Put(SdrMetricItem(SDRATTR_SHADOWXDIST, 200)); // 2 mm Schattendistanz
+ pISet->Put(SdrMetricItem(SDRATTR_SHADOWYDIST, 200));
pISet->Put(SvxFontHeightItem(1270, 100, EE_CHAR_FONTHEIGHT )); // 36 pt
@@ -531,7 +528,7 @@ void SdDrawDocument::CreateLayoutTemplates()
pISet->Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
pISet->Put(XLineEndWidthItem(200));
pISet->Put(XLineStyleItem(XLINE_SOLID));
- pISet->Put(SdrMeasureShowUnitItem(true));
+ pISet->Put(SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, true));
// Praesentationsvorlagen fuer das Standardlayout erzeugen
String aPrefix = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
@@ -636,8 +633,8 @@ void SdDrawDocument::CreateDefaultCellStyles()
// rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
// rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
-// rISet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE ));
-// rISet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW ));
+// rISet.Put(SvxContourItem(false, EE_CHAR_OUTLINE ));
+// rISet.Put(SvxShadowedItem(false, EE_CHAR_SHADOW ));
// rISet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE));
// rISet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE));
// rISet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
@@ -649,13 +646,13 @@ void SdDrawDocument::CreateDefaultCellStyles()
rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE));
rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE));
- rISet.Put( SdrTextLeftDistItem( 250 ) );
- rISet.Put( SdrTextRightDistItem( 250 ) );
- rISet.Put( SdrTextUpperDistItem( 130 ) );
- rISet.Put( SdrTextLowerDistItem( 130 ) );
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 250 ) );
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 250 ) );
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 130 ) );
+ rISet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 130 ) );
rISet.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ) );
- rISet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
+ rISet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
rISet.Put( SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP) );
rISet.Put( SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_LEFT) );
@@ -767,11 +764,11 @@ void SdDrawDocument::CreateDefaultCellStyles()
|*
\************************************************************************/
-sal_uInt16 SdDrawDocument::GetMasterPageUserCount(SdrPage* pMaster) const
+sal_uInt32 SdDrawDocument::GetMasterPageUserCount(SdrPage* pMaster) const
{
- sal_uInt16 nResult = 0;
- sal_uInt16 nPage;
- sal_uInt16 nPageCount = GetPageCount();
+ sal_uInt32 nResult = 0;
+ sal_uInt32 nPage;
+ sal_uInt32 nPageCount = GetPageCount();
for (nPage = 0; nPage < nPageCount; nPage++)
{
@@ -815,14 +812,14 @@ void SdDrawDocument::StopOnlineSpelling()
|*
\************************************************************************/
-void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling)
+void SdDrawDocument::StartOnlineSpelling(bool bForceSpelling)
{
if (mbOnlineSpell && (bForceSpelling || mbInitialOnlineSpellingEnabled) &&
mpDocSh && !mpDocSh->IsReadOnly() )
{
StopOnlineSpelling();
- ::sd::Outliner* pOutl = GetInternalOutliner(sal_True);
+ ::sd::Outliner* pOutl = GetInternalOutliner(true);
Reference< XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
if ( xSpellChecker.is() )
@@ -835,7 +832,7 @@ void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling)
pOutl->SetDefaultLanguage( meLanguage );
mpOnlineSpellingList = new ShapeList;
- sal_uInt16 nPage;
+ sal_uInt32 nPage;
for ( nPage = 0; nPage < GetPageCount(); nPage++ )
{
@@ -880,20 +877,18 @@ void SdDrawDocument::FillOnlineSpellingList(SdPage* pPage)
// Textobjekt gefunden
mpOnlineSpellingList->addShape(*pObj);
}
- else if (pObj->GetObjIdentifier() == OBJ_GRUP)
+ else if (OBJ_GRUP == pObj->GetObjIdentifier() && pObj->getChildrenOfSdrObject() )
{
// Gruppenobjekt gefunden
- SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
- IM_DEEPNOGROUPS);
-
- sal_Bool bSubTextObjFound = sal_False;
+ SdrObjListIter aGroupIter(*pObj->getChildrenOfSdrObject(), IM_DEEPNOGROUPS);
+ bool bSubTextObjFound = false;
while (aGroupIter.IsMore() && !bSubTextObjFound)
{
if (aGroupIter.Next()->GetOutlinerParaObject())
{
// Textobjekt im Gruppenobjekt gefunden
- bSubTextObjFound = sal_True;
+ bSubTextObjFound = true;
}
}
@@ -919,31 +914,30 @@ IMPL_LINK(SdDrawDocument, OnlineSpellingHdl, Timer*, EMPTYARG )
/**********************************************************************
* Naechstes Objekt spellen
**********************************************************************/
- SdrObject* pObj = mpOnlineSpellingList->getNextShape();
+ const SdrObject* pObj = mpOnlineSpellingList->getNextShape();
if (pObj)
{
- if (pObj->GetOutlinerParaObject() && pObj->ISA(SdrTextObj))
+ const SdrTextObj* pSdrTextObj = dynamic_cast< const SdrTextObj* >(pObj);
+
+ if (pSdrTextObj && pSdrTextObj->GetOutlinerParaObject())
{
// Textobjekt spellen
- SpellObject((SdrTextObj*) pObj);
+ SpellObject(pSdrTextObj);
}
- else if (pObj->GetObjIdentifier() == OBJ_GRUP)
+ else if (OBJ_GRUP == pObj->GetObjIdentifier() && pObj->getChildrenOfSdrObject())
{
// Gruppenobjekt gefunden
- SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
- IM_DEEPNOGROUPS);
-
- SdrObject* pSubObj = NULL;
+ SdrObjListIter aGroupIter(*pObj->getChildrenOfSdrObject(), IM_DEEPNOGROUPS);
while (aGroupIter.IsMore())
{
- pSubObj = aGroupIter.Next();
+ pSdrTextObj = dynamic_cast< SdrTextObj* >(aGroupIter.Next());
- if (pSubObj->GetOutlinerParaObject() && pSubObj->ISA(SdrTextObj))
+ if (pSdrTextObj && pSdrTextObj->GetOutlinerParaObject())
{
// Textobjekt im Gruppenobjekt gefunden
- SpellObject((SdrTextObj*) pSubObj);
+ SpellObject(pSdrTextObj);
}
}
}
@@ -955,7 +949,7 @@ IMPL_LINK(SdDrawDocument, OnlineSpellingHdl, Timer*, EMPTYARG )
else
{
// Spelling wurde initial durchgefuehrt
- mbInitialOnlineSpellingEnabled = sal_False;
+ mbInitialOnlineSpellingEnabled = false;
// Suche beenden
StopOnlineSpelling();
@@ -973,13 +967,13 @@ IMPL_LINK(SdDrawDocument, OnlineSpellingHdl, Timer*, EMPTYARG )
|*
\************************************************************************/
-void SdDrawDocument::SpellObject(SdrTextObj* pObj)
+void SdDrawDocument::SpellObject(const SdrTextObj* pObj)
{
if (pObj && pObj->GetOutlinerParaObject() /* && pObj != pView->GetTextEditObject() */)
{
- mbHasOnlineSpellErrors = sal_False;
- ::sd::Outliner* pOutl = GetInternalOutliner(sal_True);
- pOutl->SetUpdateMode(sal_True);
+ mbHasOnlineSpellErrors = false;
+ ::sd::Outliner* pOutl = GetInternalOutliner(true);
+ pOutl->SetUpdateMode(true);
Link aEvtHdl = pOutl->GetStatusEventHdl();
pOutl->SetStatusEventHdl(LINK(this, SdDrawDocument, OnlineSpellEventHdl));
@@ -1003,26 +997,23 @@ void SdDrawDocument::SpellObject(SdrTextObj* pObj)
if (mbHasOnlineSpellErrors)
{
sd::ModifyGuard aGuard( this );
- SdrModel* pModel = pObj->GetModel();
sal_Bool bLock = sal_False;
- if ( pModel )
- {
- bLock = pModel->isLocked();
- pModel->setLock( sal_True );
- }
+
+ // inside a locked model nothing should be broadcasted, so this should
+ // be not needed at all; keeping to not change anything
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
+ bLock = pObj->getSdrModelFromSdrObject().isLocked();
+ pObj->getSdrModelFromSdrObject().setLock( sal_True );
// taking text from the outliner
((SdrTextObj*) pObj)->SetOutlinerParaObject( pOutl->CreateParaObject() );
-
- pObj->BroadcastObjectChange();
- if ( pModel )
- pModel->setLock( bLock );
+ pObj->getSdrModelFromSdrObject().setLock( bLock );
}
}
pOutl->SetStatusEventHdl(aEvtHdl);
- pOutl->SetUpdateMode(sal_False);
+ pOutl->SetUpdateMode(false);
pOutl->Init( nOldOutlMode );
- mbHasOnlineSpellErrors = sal_False;
+ mbHasOnlineSpellErrors = false;
}
}
@@ -1031,7 +1022,7 @@ void SdDrawDocument::SpellObject(SdrTextObj* pObj)
|* Objekt wurde ins Model eingefuegt
|*
\************************************************************************/
-void SdDrawDocument::InsertObject(SdrObject* pObj, SdPage* /*pPage*/)
+void SdDrawDocument::InsertObject(const SdrObject* pObj)
{
if(mpOnlineSpellingList && pObj)
{
@@ -1048,7 +1039,7 @@ void SdDrawDocument::InsertObject(SdrObject* pObj, SdPage* /*pPage*/)
|* Objekt wurde aus dem Model entfernt
|*
\************************************************************************/
-void SdDrawDocument::RemoveObject(SdrObject* pObj, SdPage* /*pPage*/)
+void SdDrawDocument::RemoveObject(const SdrObject* pObj)
{
if(mpOnlineSpellingList && pObj)
{
@@ -1067,7 +1058,7 @@ void SdDrawDocument::RemoveObject(SdrObject* pObj, SdPage* /*pPage*/)
\************************************************************************/
IMPL_LINK(SdDrawDocument, OnlineSpellEventHdl, EditStatus*, pEditStat)
{
- sal_uLong nStat = pEditStat->GetStatusWord();
+ sal_uInt32 nStat = pEditStat->GetStatusWord();
mbHasOnlineSpellErrors = (nStat & EE_STAT_WRONGWORDCHANGED) != 0;
return(0);
@@ -1091,12 +1082,14 @@ void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject*
// #91457# restart when add to dictionary takes place, too.
|| nCommand == SPELLCMD_ADDTODICTIONARY)
{
- if(pObj && pOutl && pObj->ISA(SdrTextObj))
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pObj);
+
+ if(pSdrTextObj && pOutl)
{
- sal_Bool bModified(IsChanged());
- ((SdrTextObj*)pObj)->SetOutlinerParaObject(pOutl->CreateParaObject());
+ bool bModified(IsChanged());
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pSdrTextObj);
+ pSdrTextObj->SetOutlinerParaObject(pOutl->CreateParaObject());
SetChanged(bModified);
- pObj->BroadcastObjectChange();
}
mpOnlineSearchItem = new SvxSearchItem( SID_SEARCH_ITEM );
@@ -1117,7 +1110,7 @@ void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject*
\************************************************************************/
void SdDrawDocument::RestoreLayerNames()
{
- SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = GetModelLayerAdmin();
sal_uInt16 nLayerCount = rLayerAdmin.GetLayerCount();
for (sal_uInt16 nLayer = 0; nLayer < nLayerCount; nLayer++)
@@ -1158,10 +1151,10 @@ void SdDrawDocument::RestoreLayerNames()
|*
\************************************************************************/
-String SdDrawDocument::CreatePageNumValue(sal_uInt16 nNum) const
+String SdDrawDocument::CreatePageNumValue(sal_uInt32 nNum) const
{
String aPageNumValue;
- sal_Bool bUpper = sal_False;
+ bool bUpper = false;
switch (mePageNumType)
{
@@ -1172,7 +1165,7 @@ String SdDrawDocument::CreatePageNumValue(sal_uInt16 nNum) const
aPageNumValue += (sal_Unicode)(char)((nNum - 1) % 26 + 'a');
break;
case SVX_ROMAN_UPPER:
- bUpper = sal_True;
+ bUpper = true;
case SVX_ROMAN_LOWER:
aPageNumValue += SvxNumberFormat::CreateRomanString(nNum, bUpper);
break;
@@ -1206,7 +1199,7 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
aOldName.Erase(nPos + sizeof(SD_LT_SEPARATOR) - 1 );
sal_uInt16 nLen = aOldName.Len();
std::vector< StyleReplaceData* > aRememberedStyleReplaceData; // #120074#
- SfxStyleSheetIterator aIter(mxStyleSheetPool.get(), SD_STYLE_FAMILY_MASTERPAGE);
+ SfxStyleSheetIterator aIter(GetStyleSheetPool(), SD_STYLE_FAMILY_MASTERPAGE);
SfxStyleSheetBase* pSheet = aIter.First();
while (pSheet)
@@ -1240,7 +1233,7 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
// an allen Seiten, die das jetzt umbeannte Layout benutzen, die
// Textobjekte von der Aenderung unterrichten und Layoutnamen setzen
- sal_uInt16 nPage;
+ sal_uInt32 nPage;
for (nPage = 0; nPage < GetPageCount(); nPage++)
{
SdPage* pPage = (SdPage*) GetPage(nPage);
@@ -1250,7 +1243,7 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
{
pPage->SetLayoutName(aPageLayoutName);
- for (sal_uLong nObj = 0; nObj < pPage->GetObjCount(); nObj++)
+ for (sal_uInt32 nObj = 0; nObj < pPage->GetObjCount(); nObj++)
{
SdrObject* pObj = pPage->GetObj(nObj);
@@ -1296,7 +1289,7 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
pPage->SetLayoutName(aPageLayoutName);
pPage->SetName(rNewName);
- for (sal_uLong nObj = 0; nObj < pPage->GetObjCount(); nObj++)
+ for (sal_uInt32 nObj = 0; nObj < pPage->GetObjCount(); nObj++)
{
SdrObject* pObj = pPage->GetObj(nObj);
@@ -1342,22 +1335,22 @@ void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const St
|* Outliner-Defaults setzen (Pool-Defaults)
|*
\************************************************************************/
-void SdDrawDocument::SetTextDefaults() const
+void SdDrawDocument::SetSDTextDefaults()
{
// BulletItem und BulletFont fuer Titel und Gliederung
SvxBulletItem aBulletItem(EE_PARA_BULLET);
- Font aBulletFont( static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->GetBulletFont() );
+ Font aBulletFont( GetSdStyleSheetPool()->GetBulletFont() );
aBulletFont.SetSize(Size(0,846)); // 24 pt
aBulletItem.SetFont(aBulletFont);
aBulletItem.SetStyle(BS_BULLET);
aBulletItem.SetStart(1);
aBulletItem.SetScale(45); // in Prozent
aBulletItem.SetSymbol( 0x25CF ); // Punkt
- pItemPool->SetPoolDefaultItem( aBulletItem );
+ GetItemPool().SetPoolDefaultItem( aBulletItem );
// Bullets nicht sichtbar
// SfxUInt16Item aBulletStateItem(EE_PARA_BULLETSTATE, 0);
-// pItemPool->SetPoolDefaultItem( aBulletStateItem );
+// GetItemPool().SetPoolDefaultItem( aBulletStateItem );
// Neues BulletItem
SvxNumberFormat aNumberFormat(SVX_NUM_CHAR_SPECIAL);
@@ -1368,7 +1361,7 @@ void SdDrawDocument::SetTextDefaults() const
aNumberFormat.SetStart(1);
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10, sal_False);
+ SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10, false);
aNumberFormat.SetLSpace( 0 );
aNumberFormat.SetAbsLSpace( 0 );
@@ -1385,7 +1378,7 @@ void SdDrawDocument::SetTextDefaults() const
}
SvxNumBulletItem aNumBulletItem( aNumRule, EE_PARA_NUMBULLET );
- pItemPool->SetPoolDefaultItem( aNumBulletItem );
+ GetItemPool().SetPoolDefaultItem( aNumBulletItem );
}
/*************************************************************************
@@ -1396,7 +1389,7 @@ void SdDrawDocument::SetTextDefaults() const
::com::sun::star::text::WritingMode SdDrawDocument::GetDefaultWritingMode() const
{
- const SfxPoolItem* pItem = ( pItemPool ? pItemPool->GetPoolDefaultItem( EE_PARA_WRITINGDIR ) : NULL );
+ const SfxPoolItem* pItem = GetItemPool().GetPoolDefaultItem( EE_PARA_WRITINGDIR );
::com::sun::star::text::WritingMode eRet = ::com::sun::star::text::WritingMode_LR_TB;
if( pItem )
@@ -1418,8 +1411,6 @@ void SdDrawDocument::SetTextDefaults() const
void SdDrawDocument::SetDefaultWritingMode(::com::sun::star::text::WritingMode eMode )
{
- if( pItemPool )
- {
SvxFrameDirection nVal;
switch( eMode )
{
@@ -1432,17 +1423,14 @@ void SdDrawDocument::SetDefaultWritingMode(::com::sun::star::text::WritingMode e
}
SvxFrameDirectionItem aModeItem( nVal, EE_PARA_WRITINGDIR );
- pItemPool->SetPoolDefaultItem( aModeItem );
+ GetItemPool().SetPoolDefaultItem( aModeItem );
SvxAdjustItem aAdjust( SVX_ADJUST_LEFT, EE_PARA_JUST );
if( eMode == ::com::sun::star::text::WritingMode_RL_TB )
aAdjust.SetEnumValue( SVX_ADJUST_RIGHT );
- pItemPool->SetPoolDefaultItem( aAdjust );
-
-
- }
+ GetItemPool().SetPoolDefaultItem( aAdjust );
}
void SdDrawDocument::getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont )
@@ -1504,17 +1492,17 @@ void ModifyGuard::init()
mpDocShell = mpDoc->GetDocSh();
}
- mbIsEnableSetModified = mpDocShell ? mpDocShell->IsEnableSetModified() : sal_False;
- mbIsDocumentChanged = mpDoc ? mpDoc->IsChanged() : sal_False;
+ mbIsEnableSetModified = mpDocShell ? mpDocShell->IsEnableSetModified() : false;
+ mbIsDocumentChanged = mpDoc ? mpDoc->IsChanged() : false;
if( mbIsEnableSetModified )
- mpDocShell->EnableSetModified( sal_False );
+ mpDocShell->EnableSetModified( false );
}
ModifyGuard::~ModifyGuard()
{
if( mbIsEnableSetModified )
- mpDocShell->EnableSetModified( sal_True );
+ mpDocShell->EnableSetModified( true );
if( mpDoc && (mpDoc->IsChanged() != mbIsDocumentChanged) )
mpDoc->SetChanged(mbIsDocumentChanged);
diff --git a/sd/source/core/pglink.cxx b/sd/source/core/pglink.cxx
index 4819f7164aa7..3ae07d4988a6 100644
--- a/sd/source/core/pglink.cxx
+++ b/sd/source/core/pglink.cxx
@@ -69,7 +69,7 @@ SdPageLink::~SdPageLink()
void SdPageLink::DataChanged( const String& ,
const ::com::sun::star::uno::Any& )
{
- SdDrawDocument* pDoc = (SdDrawDocument*) pPage->GetModel();
+ SdDrawDocument* pDoc = static_cast< SdDrawDocument* >(&pPage->getSdrModelFromSdrPage());
sfx2::LinkManager* pLinkManager = pDoc!=NULL ? pDoc->GetLinkManager() : NULL;
if (pLinkManager)
@@ -102,21 +102,21 @@ void SdPageLink::DataChanged( const String& ,
List aBookmarkList;
aBookmarkList.Insert(&aBookmarkName);
- sal_uInt16 nInsertPos = pPage->GetPageNum();
- sal_Bool bLink = sal_True;
- sal_Bool bReplace = sal_True;
- sal_Bool bNoDialogs = sal_False;
- sal_Bool bCopy = sal_False;
+ sal_uInt32 nInsertPos = pPage->GetPageNumber();
+ bool bLink = true;
+ bool bReplace = true;
+ bool bNoDialogs = false;
+ bool bCopy = false;
if( pDoc->pDocLockedInsertingLinks )
{
// resolving links while loading pDoc
- bNoDialogs = sal_True;
- bCopy = sal_True;
+ bNoDialogs = true;
+ bCopy = true;
}
pDoc->InsertBookmarkAsPage(&aBookmarkList, NULL, bLink, bReplace,
- nInsertPos, bNoDialogs, NULL, bCopy, sal_True, sal_True);
+ nInsertPos, bNoDialogs, NULL, bCopy, true, true);
if( !pDoc->pDocLockedInsertingLinks )
pDoc->CloseBookmarkDoc();
diff --git a/sd/source/core/sdattr.cxx b/sd/source/core/sdattr.cxx
index 5abd1ce1aa01..cf383cde93be 100644
--- a/sd/source/core/sdattr.cxx
+++ b/sd/source/core/sdattr.cxx
@@ -34,8 +34,6 @@ using namespace ::com::sun::star;
|* DiaEffectItem
|*
*************************************************************************/
-TYPEINIT1_AUTOFACTORY( DiaEffectItem, SfxEnumItem );
-
DiaEffectItem::DiaEffectItem( presentation::FadeEffect eFE ) :
SfxEnumItem( ATTR_DIA_EFFECT, (sal_uInt16)eFE )
@@ -65,8 +63,6 @@ SfxPoolItem* DiaEffectItem::Create( SvStream& rIn, sal_uInt16 ) const
|* DiaSpeedItem
|*
*************************************************************************/
-TYPEINIT1_AUTOFACTORY( DiaSpeedItem, SfxEnumItem );
-
DiaSpeedItem::DiaSpeedItem( FadeSpeed eFS ) :
SfxEnumItem( ATTR_DIA_SPEED, (sal_uInt16)eFS )
@@ -96,7 +92,6 @@ SfxPoolItem* DiaSpeedItem::Create( SvStream& rIn, sal_uInt16 ) const
|* DiaAutoItem
|*
*************************************************************************/
-TYPEINIT1_AUTOFACTORY( DiaAutoItem, SfxEnumItem );
DiaAutoItem::DiaAutoItem( PresChange eChange ) :
SfxEnumItem( ATTR_DIA_AUTO, (sal_uInt16)eChange )
@@ -126,8 +121,6 @@ SfxPoolItem* DiaAutoItem::Create( SvStream& rIn, sal_uInt16 ) const
|* DiaTimeItem
|*
*************************************************************************/
-TYPEINIT1_AUTOFACTORY( DiaTimeItem, SfxUInt32Item );
-
DiaTimeItem::DiaTimeItem( sal_uInt32 nValue ) :
SfxUInt32Item( ATTR_DIA_TIME, nValue )
diff --git a/sd/source/core/sdiocmpt.cxx b/sd/source/core/sdiocmpt.cxx
index f8fabd785dfc..b5e03880fdea 100644
--- a/sd/source/core/sdiocmpt.cxx
+++ b/sd/source/core/sdiocmpt.cxx
@@ -36,7 +36,7 @@ old_SdrDownCompat::old_SdrDownCompat(SvStream& rNewStream, sal_uInt16 nNewMode)
nSubRecSiz(0),
nSubRecPos(0),
nMode(nNewMode),
- bOpen(sal_False)
+ bOpen(false)
{
OpenSubRecord();
}
@@ -73,7 +73,7 @@ void old_SdrDownCompat::OpenSubRecord()
Write();
}
- bOpen = sal_True;
+ bOpen = true;
}
void old_SdrDownCompat::CloseSubRecord()
@@ -99,7 +99,7 @@ void old_SdrDownCompat::CloseSubRecord()
rStream.Seek(nAktPos);
}
- bOpen = sal_False;
+ bOpen = false;
}
/*************************************************************************
diff --git a/sd/source/core/sdobjfac.cxx b/sd/source/core/sdobjfac.cxx
index 49ef943b1f3e..93745b7143e5 100644
--- a/sd/source/core/sdobjfac.cxx
+++ b/sd/source/core/sdobjfac.cxx
@@ -19,14 +19,10 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
-
#include <basic/sbx.hxx>
-
#include <app.hxx>
#include "sdpage.hxx"
#include "sdobjfac.hxx"
@@ -34,7 +30,7 @@
#include "anminfo.hxx"
#include "imapinfo.hxx"
#include "drawdoc.hxx"
-
+#include <svx/sdrobjectfactory.hxx>
SdObjectFactory aSdObjectFactory;
@@ -46,16 +42,27 @@ SdObjectFactory aSdObjectFactory;
IMPL_LINK( SdObjectFactory, MakeUserData, SdrObjFactory *, pObjFactory )
{
- if ( pObjFactory->nInventor == SdUDInventor )
+ if ( SdUDInventor == pObjFactory->getSdrObjectCreationInfo().getInvent() )
{
- switch( pObjFactory->nIdentifier )
+ switch( pObjFactory->getSdrObjectCreationInfo().getIdent() )
{
case( SD_ANIMATIONINFO_ID ):
- pObjFactory->pNewData = new SdAnimationInfo( *pObjFactory->pObj );
+ {
+ if(pObjFactory->getSdrObjUserDataTargetSdrObject())
+ {
+ pObjFactory->setNewSdrObjUserData(new SdAnimationInfo(*pObjFactory->getSdrObjUserDataTargetSdrObject()));
+ }
+ else
+ {
+ OSL_ENSURE(false, "Got no target SdrObject in SdrObjUserData Factory (!)");
+ }
+ }
break;
case( SD_IMAPINFO_ID ):
- pObjFactory->pNewData = new SdIMapInfo;
+ {
+ pObjFactory->setNewSdrObjUserData(new SdIMapInfo);
+ }
break;
default:
@@ -63,11 +70,15 @@ IMPL_LINK( SdObjectFactory, MakeUserData, SdrObjFactory *, pObjFactory )
}
}
- if ( pObjFactory->pNewData )
+ if ( pObjFactory->getNewSdrObjUserData() )
+ {
return 0;
+ }
if( aOldMakeUserDataLink.IsSet() )
+ {
aOldMakeUserDataLink.Call( this );
+ }
return 0;
}
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 48cddd1709eb..1024c1a763c2 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -57,9 +57,7 @@
#include <editeng/flditem.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/svditer.hxx>
-
#include <editeng/adjitem.hxx>
-
#include "../ui/inc/DrawDocShell.hxx"
#include "Outliner.hxx"
#include "app.hrc"
@@ -81,34 +79,95 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/unoapi.hxx>
-
#include <set>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdview.hxx>
using namespace ::sd;
using namespace ::com::sun::star;
-TYPEINIT2( SdPage, FmFormPage, SdrObjUserCall );
+//////////////////////////////////////////////////////////////////////////////
+// detect and hand back the connected SdPage for a SdrObject
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
+SdPage* findConnectionToSdrObject(const SdrObject* pSdrObject)
+{
+ if(pSdrObject)
+ {
+ if(pSdrObject->HasListeners())
+ {
+ const sal_uInt16 nListenerCount(pSdrObject->GetListenerCount());
+
+ for(sal_uInt16 a(0); a < nListenerCount; a++)
+ {
+ SfxListener* pCandidate = pSdrObject->GetListener(a);
+
+ if(pCandidate) // not all slots in a broadcaster have to be used
+ {
+ SdPage* pRetval = dynamic_cast< SdPage* >(pCandidate);
+
+ if(pRetval)
+ {
+ return pRetval;
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// connect to given SdrObject. All existing connections are deleted, a single
+// new one gets established
+
+void establishConnectionToSdrObject(SdrObject* pSdrObject, SdPage* pSdPage)
+{
+ if(pSdrObject)
+ {
+ // remove all SdPages
+ resetConnectionToSdrObject(pSdrObject);
+
+ if(pSdPage)
+ {
+ pSdPage->StartListening(*pSdrObject);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// all connections (should be a single one) to the SdrObject are removed
+
+void resetConnectionToSdrObject(SdrObject* pSdrObject)
+{
+ if(pSdrObject)
+ {
+ SdPage* pFound = findConnectionToSdrObject(pSdrObject);
-SdPage::SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, sal_Bool bMasterPage)
+ while(pFound)
+ {
+ pFound->EndListening(*pSdrObject);
+ pFound = findConnectionToSdrObject(pSdrObject);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+SdPage::SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, bool bMasterPage)
: FmFormPage(rNewDoc, pBasic, bMasterPage)
-, SdrObjUserCall()
+, SfxListener()
, mePageKind(PK_STANDARD)
, meAutoLayout(AUTOLAYOUT_NONE)
-, mbSelected(sal_False)
+, mbSelected(false)
, mePresChange(PRESCHANGE_MANUAL)
, mnTime(1)
-, mbSoundOn(sal_False)
-, mbExcluded(sal_False)
-, mbLoopSound(sal_False)
-, mbStopSound(sal_False)
-, mbScaleObjects(sal_True)
-, mbBackgroundFullSize( sal_False )
+, mbSoundOn(false)
+, mbExcluded(false)
+, mbLoopSound(false)
+, mbStopSound(false)
+, mbScaleObjects(true)
+, mbBackgroundFullSize( false )
, meCharSet(gsl_getSystemTextEncoding())
, mnPaperBin(PAPERBIN_PRINTER_SETTINGS)
, mpPageLink(NULL)
@@ -127,9 +186,9 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, StarBASIC* pBasic, sal_Bool bMasterPage)
maLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
maLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
- Size aPageSize(GetSize());
+ const basegfx::B2DVector& rPageScale = GetPageScale();
- if (aPageSize.Width() > aPageSize.Height())
+ if (rPageScale.getX() > rPageScale.getY())
{
meOrientation = ORIENTATION_LANDSCAPE;
}
@@ -155,11 +214,45 @@ SdPage::~SdPage()
delete mpItems;
}
+void SdPage::copyDataFromSdrPage(const SdrPage& rSource)
+{
+ if(this != &rSource)
+ {
+ const SdPage* pSource = dynamic_cast< const SdPage* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ FmFormPage::copyDataFromSdrPage(rSource);
+
+ // no local data to copy
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrPage* SdPage::CloneSdrPage(SdrModel* pTargetModel) const
+{
+ SdDrawDocument* pSdDrawDocument = static_cast< SdDrawDocument* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
+ OSL_ENSURE(dynamic_cast< SdDrawDocument* >(pSdDrawDocument), "Wrong SdrModel type in SdPage clone (!)");
+ SdPage* pClone = new SdPage(
+ *pSdDrawDocument,
+ GetBasic(),
+ IsMasterPage());
+ OSL_ENSURE(pClone, "CloneSdrPage error (!)");
+ pClone->copyDataFromSdrPage(*this);
+
+ return pClone;
+}
+
struct OrdNumSorter
{
bool operator()( SdrObject* p1, SdrObject* p2 )
{
- return p1->GetOrdNum() < p2->GetOrdNum();
+ return p1->GetNavigationPosition() < p2->GetNavigationPosition();
}
};
@@ -167,9 +260,9 @@ struct OrdNumSorter
SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearch /* = false */ )
{
// first sort all matching shapes with z-order
- std::vector< SdrObject* > aMatches;
+ SdrObjectVector aMatches;
- SdrObject* pObj = 0;
+ const SdrObject* pObj = 0;
while( (pObj = maPresentationShapeList.getNextShape(pObj)) != 0 )
{
SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj);
@@ -192,7 +285,7 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
case PRESOBJ_CALC:
case PRESOBJ_IMAGE:
case PRESOBJ_MEDIA:
- bFound = sal_True;
+ bFound = true;
break;
default:
break;
@@ -200,7 +293,7 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
}
if( bFound )
{
- aMatches.push_back( pObj );
+ aMatches.push_back( const_cast< SdrObject* >(pObj) );
}
}
}
@@ -245,13 +338,12 @@ void SdPage::EnsureMasterPageDefaultBackground()
/** creates a presentation object with the given PresObjKind on this page. A user call will be set
*/
-SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const Rectangle& rRect, sal_Bool /* bInsert */ )
+SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const basegfx::B2DRange& rRange, bool /* bInsert */ )
{
- ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoManager = static_cast< SdDrawDocument* >(&getSdrModelFromSdrPage())->GetUndoManager();
const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
SdrObject* pSdrObj = NULL;
-
bool bForceText = false; // forces the shape text to be set even if its empty
bool bEmptyPresObj = true;
@@ -259,40 +351,56 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
{
case PRESOBJ_TITLE:
{
- pSdrObj = new SdrRectObj(OBJ_TITLETEXT);
+ pSdrObj = new SdrRectObj(
+ getSdrModelFromSdrPage(),
+ basegfx::B2DHomMatrix(),
+ OBJ_TITLETEXT,
+ true);
if (mbMaster)
{
- pSdrObj->SetNotVisibleAsMaster(sal_True);
+ pSdrObj->SetNotVisibleAsMaster(true);
}
}
break;
case PRESOBJ_OUTLINE:
{
- pSdrObj = new SdrRectObj(OBJ_OUTLINETEXT);
+ pSdrObj = new SdrRectObj(
+ getSdrModelFromSdrPage(),
+ basegfx::B2DHomMatrix(),
+ OBJ_OUTLINETEXT,
+ true);
if (mbMaster)
{
- pSdrObj->SetNotVisibleAsMaster(sal_True);
+ pSdrObj->SetNotVisibleAsMaster(true);
}
}
break;
case PRESOBJ_NOTES:
{
- pSdrObj = new SdrRectObj(OBJ_TEXT);
+ pSdrObj = new SdrRectObj(
+ getSdrModelFromSdrPage(),
+ basegfx::B2DHomMatrix(),
+ OBJ_TEXT,
+ true);
if (mbMaster)
{
- pSdrObj->SetNotVisibleAsMaster(sal_True);
+ pSdrObj->SetNotVisibleAsMaster(true);
}
}
break;
case PRESOBJ_TEXT:
{
- pSdrObj = new SdrRectObj(OBJ_TEXT);
+ pSdrObj = new SdrRectObj(
+ getSdrModelFromSdrPage(),
+ basegfx::B2DHomMatrix(),
+ OBJ_TEXT,
+ true);
}
break;
@@ -308,9 +416,10 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
aOutDev.SetMapMode(MAP_100TH_MM);
Size aSize = aOutDev.PixelToLogic(aSizePix);
- Point aPnt (0, 0);
- Rectangle aRect (aPnt, aSize);
- pSdrObj = new SdrGrafObj(aGraphic, aRect);
+ pSdrObj = new SdrGrafObj(
+ getSdrModelFromSdrPage(),
+ aGraphic,
+ basegfx::tools::createScaleB2DHomMatrix(aSize.getWidth(), aSize.getHeight()));
aOutDev.Pop();
}
break;
@@ -318,40 +427,44 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
case PRESOBJ_MEDIA:
case PRESOBJ_OBJECT:
{
- pSdrObj = new SdrOle2Obj();
+ SdrOle2Obj* pNewSdrOle2Obj = new SdrOle2Obj(getSdrModelFromSdrPage());
+ pSdrObj = pNewSdrOle2Obj;
BitmapEx aBmpEx( SdResId( BMP_PRESOBJ_OBJECT ) );
Graphic aGraphic( aBmpEx );
- ( (SdrOle2Obj*) pSdrObj)->SetGraphic(&aGraphic);
+ pNewSdrOle2Obj->SetGraphic(&aGraphic);
}
break;
case PRESOBJ_CHART:
{
- pSdrObj = new SdrOle2Obj();
- ( (SdrOle2Obj*) pSdrObj)->SetProgName( String( RTL_CONSTASCII_USTRINGPARAM( "StarChart" )));
+ SdrOle2Obj* pNewSdrOle2Obj = new SdrOle2Obj(getSdrModelFromSdrPage());
+ pSdrObj = pNewSdrOle2Obj;
+ pNewSdrOle2Obj->SetProgName( String( RTL_CONSTASCII_USTRINGPARAM( "StarChart" )));
BitmapEx aBmpEx( SdResId( BMP_PRESOBJ_CHART ) );
Graphic aGraphic( aBmpEx );
- ( (SdrOle2Obj*) pSdrObj)->SetGraphic(&aGraphic);
+ pNewSdrOle2Obj->SetGraphic(&aGraphic);
}
break;
case PRESOBJ_ORGCHART:
{
- pSdrObj = new SdrOle2Obj();
- ( (SdrOle2Obj*) pSdrObj)->SetProgName( String( RTL_CONSTASCII_USTRINGPARAM( "StarOrg" )));
+ SdrOle2Obj* pNewSdrOle2Obj = new SdrOle2Obj(getSdrModelFromSdrPage());
+ pSdrObj = pNewSdrOle2Obj;
+ pNewSdrOle2Obj->SetProgName( String( RTL_CONSTASCII_USTRINGPARAM( "StarOrg" )));
BitmapEx aBmpEx( SdResId( BMP_PRESOBJ_ORGCHART ) );
Graphic aGraphic( aBmpEx );
- ( (SdrOle2Obj*) pSdrObj)->SetGraphic(&aGraphic);
+ pNewSdrOle2Obj->SetGraphic(&aGraphic);
}
case PRESOBJ_TABLE:
case PRESOBJ_CALC:
{
- pSdrObj = new SdrOle2Obj();
- ( (SdrOle2Obj*) pSdrObj)->SetProgName( String( RTL_CONSTASCII_USTRINGPARAM( "StarCalc" )));
+ SdrOle2Obj* pNewSdrOle2Obj = new SdrOle2Obj(getSdrModelFromSdrPage());
+ pSdrObj = pNewSdrOle2Obj;
+ pNewSdrOle2Obj->SetProgName( String( RTL_CONSTASCII_USTRINGPARAM( "StarCalc" )));
BitmapEx aBmpEx( SdResId( BMP_PRESOBJ_TABLE ) );
Graphic aGraphic( aBmpEx );
- ( (SdrOle2Obj*) pSdrObj)->SetGraphic(&aGraphic);
+ pNewSdrOle2Obj->SetGraphic(&aGraphic);
}
break;
@@ -360,32 +473,35 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
//Erste Standardseite am SdrPageObj vermerken
// #i105146# We want no content to be displayed for PK_HANDOUT,
// so just never set a page as content
- pSdrObj = new SdrPageObj(0);
-// pSdrObj->SetResizeProtect(sal_True);
+ pSdrObj = new SdrPageObj(getSdrModelFromSdrPage());
+// pSdrObj->SetResizeProtect(true);
}
break;
case PRESOBJ_PAGE:
{
//Notizseite am SdrPageObj vermerken
- sal_uInt16 nDestPageNum(GetPageNum());
+ sal_uInt32 nDestPageNum(GetPageNumber());
if(nDestPageNum)
{
- // decrement only when != 0, else we get a 0xffff
+ // decrement only when != 0, else we get a SDRPAGE_NOTFOUND
nDestPageNum -= 1;
}
- if(nDestPageNum < pModel->GetPageCount())
+ if(nDestPageNum < getSdrModelFromSdrPage().GetPageCount())
{
- pSdrObj = new SdrPageObj(pModel->GetPage(nDestPageNum));
+ pSdrObj = new SdrPageObj(
+ getSdrModelFromSdrPage(),
+ basegfx::B2DHomMatrix(),
+ getSdrModelFromSdrPage().GetPage(nDestPageNum));
}
else
{
- pSdrObj = new SdrPageObj();
+ pSdrObj = new SdrPageObj(getSdrModelFromSdrPage());
}
- pSdrObj->SetResizeProtect(sal_True);
+ pSdrObj->SetResizeProtect(true);
}
break;
@@ -394,7 +510,11 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
case PRESOBJ_DATETIME:
case PRESOBJ_SLIDENUMBER:
{
- pSdrObj = new SdrRectObj(OBJ_TEXT);
+ pSdrObj = new SdrRectObj(
+ getSdrModelFromSdrPage(),
+ basegfx::B2DHomMatrix(),
+ OBJ_TEXT,
+ true);
bEmptyPresObj = false;
bForceText = true;
}
@@ -406,22 +526,22 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
if (pSdrObj)
{
pSdrObj->SetEmptyPresObj(bEmptyPresObj);
- pSdrObj->SetLogicRect(rRect);
+ sdr::legacy::SetLogicRange(*pSdrObj, rRange);
+ InsertObjectToSdrObjList(*pSdrObj);
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pSdrObj);
- InsertObject(pSdrObj);
-
- if ( pSdrObj->ISA(SdrTextObj) )
+ if ( pSdrTextObj )
{
// #96243# Tell the object EARLY that it is vertical to have the
// defaults for AutoGrowWidth/Height reversed
if(bVertical)
- ((SdrTextObj*)pSdrObj)->SetVerticalWriting(sal_True);
+ pSdrTextObj->SetVerticalWriting(true);
- SfxItemSet aTempAttr( ((SdDrawDocument*) pModel)->GetPool() );
+ SfxItemSet aTempAttr(pSdrTextObj->GetObjectItemPool());
if( bVertical )
- aTempAttr.Put( SdrTextMinFrameWidthItem( rRect.GetSize().Width() ) );
+ aTempAttr.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, basegfx::fround(rRange.getWidth()) ) );
else
- aTempAttr.Put( SdrTextMinFrameHeightItem( rRect.GetSize().Height() ) );
+ aTempAttr.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, basegfx::fround(rRange.getHeight()) ) );
if (mbMaster)
{
@@ -431,9 +551,9 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
// #96243# potential problem: This action was still NOT
// adapted for vertical text. This sure needs to be done.
if(bVertical)
- aTempAttr.Put(SdrTextAutoGrowWidthItem(sal_False));
+ aTempAttr.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
else
- aTempAttr.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aTempAttr.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
}
// check if we need another vertical adjustement than the default
@@ -451,15 +571,16 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
if( eV != SDRTEXTVERTADJUST_TOP )
aTempAttr.Put(SdrTextVertAdjustItem(eV));
- pSdrObj->SetMergedItemSet(aTempAttr);
+ pSdrTextObj->SetMergedItemSet(aTempAttr);
- pSdrObj->SetLogicRect(rRect);
+ sdr::legacy::SetLogicRange(*pSdrTextObj, rRange);
}
String aString = GetPresObjText(eObjKind);
- if( (aString.Len() || bForceText) && pSdrObj->ISA(SdrTextObj) )
+
+ if( pSdrTextObj && (aString.Len() || bForceText) )
{
- SdrOutliner* pOutliner = ( (SdDrawDocument*) GetModel() )->GetInternalOutliner();
+ SdrOutliner* pOutliner = (static_cast< SdDrawDocument& >(getSdrModelFromSdrPage())).GetInternalOutliner();
sal_uInt16 nOutlMode = pOutliner->GetMode();
pOutliner->Init( OUTLINERMODE_TEXTOBJECT );
@@ -467,7 +588,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
pOutliner->SetVertical( bVertical );
String aEmptyStr;
- SetObjText( (SdrTextObj*) pSdrObj, (SdrOutliner*)pOutliner, eObjKind, aString );
+ SetObjText( pSdrTextObj, (SdrOutliner*)pOutliner, eObjKind, aString );
pOutliner->Init( nOutlMode );
pOutliner->SetStyleSheet( 0, NULL );
@@ -475,7 +596,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
if( (eObjKind == PRESOBJ_HEADER) || (eObjKind == PRESOBJ_FOOTER) || (eObjKind == PRESOBJ_SLIDENUMBER) || (eObjKind == PRESOBJ_DATETIME) )
{
- SfxItemSet aTempAttr( ((SdDrawDocument*) pModel)->GetPool() );
+ SfxItemSet aTempAttr(pSdrObj->GetObjectItemPool());
aTempAttr.Put( SvxFontHeightItem( 493, 100, EE_CHAR_FONTHEIGHT ) );
aTempAttr.Put( SvxFontHeightItem( 493, 100, EE_CHAR_FONTHEIGHT_CTL ) );
aTempAttr.Put( SvxFontHeightItem( 493, 100, EE_CHAR_FONTHEIGHT_CJK ) );
@@ -503,21 +624,21 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
if (mbMaster)
{
- SdrLayerAdmin& rLayerAdmin = pModel->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrPage().GetModelLayerAdmin();
// Hintergrundobjekte der MasterPage
pSdrObj->SetLayer( rLayerAdmin.
- GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False) );
+ GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false) );
}
// Objekt am StyleSheet anmelden
// #95114# Set style only when one was found (as in 5.2)
- // pSdrObj->NbcSetStyleSheet( GetStyleSheetForPresObj(eObjKind), sal_False );
+ // pSdrObj->SetStyleSheet( GetStyleSheetForPresObj(eObjKind), false );
if( mePageKind != PK_HANDOUT )
{
SfxStyleSheet* pSheetForPresObj = GetStyleSheetForPresObj(eObjKind);
if(pSheetForPresObj)
- pSdrObj->SetStyleSheet(pSheetForPresObj, sal_False);
+ pSdrObj->SetStyleSheet(pSheetForPresObj, false);
}
if (eObjKind == PRESOBJ_OUTLINE)
@@ -527,7 +648,8 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
String aName(maLayoutName);
aName += sal_Unicode( ' ' );
aName += String::CreateFromInt32( nLevel );
- SfxStyleSheet* pSheet = (SfxStyleSheet*)pModel->GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
+ SfxStyleSheet* pSheet = dynamic_cast< SfxStyleSheet* >(
+ getSdrModelFromSdrPage().GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_MASTERPAGE));
DBG_ASSERT(pSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden");
if (pSheet)
pSdrObj->StartListening(*pSheet);
@@ -540,8 +662,8 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
eObjKind == PRESOBJ_CALC ||
eObjKind == PRESOBJ_GRAPHIC )
{
- SfxItemSet aSet( ((SdDrawDocument*) pModel)->GetPool() );
- aSet.Put( SdrTextContourFrameItem( sal_True ) );
+ SfxItemSet aSet(pSdrObj->GetObjectItemPool());
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, true ) );
aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
pSdrObj->SetMergedItemSet(aSet);
@@ -549,19 +671,17 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
if( bUndo )
{
- pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoNewObject(*pSdrObj));
+ pUndoManager->AddUndoAction(getSdrModelFromSdrPage().GetSdrUndoFactory().CreateUndoNewObject(*pSdrObj));
}
if( bUndo )
{
pUndoManager->AddUndoAction( new UndoObjectPresentationKind( *pSdrObj ) );
- pUndoManager->AddUndoAction( new UndoObjectUserCall(*pSdrObj) );
+ pUndoManager->AddUndoAction( new UndoConnectionToSdrObject(*pSdrObj) );
}
InsertPresObj(pSdrObj, eObjKind);
- pSdrObj->SetUserCall(this);
-
- pSdrObj->RecalcBoundRect();
+ establishConnectionToSdrObject(pSdrObj, this);
}
return(pSdrObj);
@@ -588,7 +708,7 @@ SfxStyleSheet* SdPage::GetStyleSheetForMasterPageBackground() const
aName += String(SdResId(STR_LAYOUT_BACKGROUND));
- SfxStyleSheetBasePool* pStShPool = pModel->GetStyleSheetPool();
+ SfxStyleSheetBasePool* pStShPool = getSdrModelFromSdrPage().GetStyleSheetPool();
SfxStyleSheetBase* pResult = pStShPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
return (SfxStyleSheet*)pResult;
}
@@ -637,7 +757,7 @@ SfxStyleSheet* SdPage::GetStyleSheetForPresObj(PresObjKind eObjKind) const
break;
}
- SfxStyleSheetBasePool* pStShPool = pModel->GetStyleSheetPool();
+ SfxStyleSheetBasePool* pStShPool = getSdrModelFromSdrPage().GetStyleSheetPool();
SfxStyleSheetBase* pResult = pStShPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
return (SfxStyleSheet*)pResult;
}
@@ -646,7 +766,7 @@ SfxStyleSheet* SdPage::GetStyleSheetForPresObj(PresObjKind eObjKind) const
slides masterpage */
SdStyleSheet* SdPage::getPresentationStyle( sal_uInt32 nHelpId ) const
{
- String aStyleName( pPage->GetLayoutName() );
+ String aStyleName( /*GetPage()->*/GetLayoutName() );
const String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ));
aStyleName.Erase(aStyleName.Search(aSep) + aSep.Len());
@@ -679,7 +799,7 @@ SdStyleSheet* SdPage::getPresentationStyle( sal_uInt32 nHelpId ) const
aStyleName.Append( String::CreateFromInt32( sal_Int32( nHelpId - HID_PSEUDOSHEET_OUTLINE )));
}
- SfxStyleSheetBasePool* pStShPool = pModel->GetStyleSheetPool();
+ SfxStyleSheetBasePool* pStShPool = getSdrModelFromSdrPage().GetStyleSheetPool();
SfxStyleSheetBase* pResult = pStShPool->Find(aStyleName, SD_STYLE_FAMILY_MASTERPAGE);
return dynamic_cast<SdStyleSheet*>(pResult);
}
@@ -692,16 +812,33 @@ SdStyleSheet* SdPage::getPresentationStyle( sal_uInt32 nHelpId ) const
|*
\************************************************************************/
-void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& )
+void SdPage::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+ const SdrBaseHint* pSdrBaseHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrBaseHint)
+ {
+ const SdrObject* pObj = pSdrBaseHint->GetSdrHintObject();
+
+ if(pObj)
+ {
+ HandleChanged(*pObj, pSdrBaseHint->GetSdrHintKind());
+ }
+ }
+}
+
+void SdPage::HandleChanged(
+ const SdrObject& rObj,
+ SdrHintKind eHint)
{
if (!maLockAutoLayoutArrangement.isLocked())
{
- switch (eType)
+ switch (eHint)
{
- case SDRUSERCALL_MOVEONLY:
- case SDRUSERCALL_RESIZE:
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
{
- if( pModel->isLocked() )
+ if( getSdrModelFromSdrPage().isLocked() )
break;
SdrObject* pObj = (SdrObject*) &rObj;
@@ -710,30 +847,28 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang
{
if (!mbMaster)
{
- if( pObj->GetUserCall() )
+ if( findConnectionToSdrObject(pObj) )
{
- ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoManager = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetUndoManager();
const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
-/*
- DBG_ASSERT( bUndo || (pUndoManager && pUndoManager->IsDoing()),
- "SdPage::Changed(), model change without undo!?" );
-*/
+
if( bUndo )
- pUndoManager->AddUndoAction( new UndoObjectUserCall(*pObj) );
+ pUndoManager->AddUndoAction( new UndoConnectionToSdrObject(*pObj) );
// Objekt was resized by user and does not listen to its slide anymore
- pObj->SetUserCall(0);
+ resetConnectionToSdrObject(pObj);
}
}
- else if (pModel)
+ else
{
// MasterPage-Objekt wurde veraendert, daher
// Objekte auf allen Seiten anpassen
- sal_uInt16 nPageCount = ((SdDrawDocument*) pModel)->GetSdPageCount(mePageKind);
+ SdDrawDocument& rDrawDocument = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage());
+ sal_uInt32 nPageCount = rDrawDocument.GetSdPageCount(mePageKind);
- for (sal_uInt16 i = 0; i < nPageCount; i++)
+ for (sal_uInt32 i = 0; i < nPageCount; i++)
{
- SdPage* pLoopPage = ((SdDrawDocument*) pModel)->GetSdPage(i, mePageKind);
+ SdPage* pLoopPage = rDrawDocument.GetSdPage(i, mePageKind);
if (pLoopPage && this == &(pLoopPage->TRG_GetMasterPage()))
{
@@ -747,8 +882,6 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang
}
break;
- case SDRUSERCALL_DELETE:
- case SDRUSERCALL_REMOVED:
default:
break;
}
@@ -761,9 +894,10 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang
|*
\************************************************************************/
-void SdPage::CreateTitleAndLayout(sal_Bool bInit, sal_Bool bCreate )
+void SdPage::CreateTitleAndLayout(bool bInit, bool bCreate )
{
- ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ SdDrawDocument& rDrawDocument = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage());
+ ::svl::IUndoManager* pUndoManager = rDrawDocument.GetUndoManager();
const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
SdPage* pMasterPage = this;
@@ -786,7 +920,7 @@ void SdPage::CreateTitleAndLayout(sal_Bool bInit, sal_Bool bCreate )
pMasterPage->EnsureMasterPageDefaultBackground();
}
- if( ( (SdDrawDocument*) GetModel() )->GetDocumentType() == DOCUMENT_TYPE_IMPRESS )
+ if( DOCUMENT_TYPE_IMPRESS == rDrawDocument.GetDocumentType() )
{
if( mePageKind == PK_HANDOUT && bInit )
{
@@ -796,27 +930,34 @@ void SdPage::CreateTitleAndLayout(sal_Bool bInit, sal_Bool bCreate )
SdrObject *pObj=NULL;
while( (pObj = pMasterPage->GetPresObj(PRESOBJ_HANDOUT)) != 0 )
{
- pMasterPage->RemoveObject(pObj->GetOrdNum());
+ pMasterPage->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+
+ if(getSdrModelFromSdrPage().isLocked())
+ {
+ // remove self when model is locked (during load), else the
+ // broadcast of object removal will do that
+ pMasterPage->RemovePresObj(pObj);
+ }
if( bUndo )
{
- pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
+ pUndoManager->AddUndoAction(rDrawDocument.GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
}
else
{
- SdrObject::Free( pObj ); // memory leak i120050
+ deleteSdrObjectSafeAndClearPointer(pObj); // memory leak i120050
}
}
- std::vector< Rectangle > aAreas;
- CalculateHandoutAreas( *static_cast< SdDrawDocument* >(GetModel() ), pMasterPage->GetAutoLayout(), false, aAreas );
+ std::vector< basegfx::B2DRange > aAreas;
+ CalculateHandoutAreas( rDrawDocument, pMasterPage->GetAutoLayout(), false, aAreas );
const bool bSkip = pMasterPage->GetAutoLayout() == AUTOLAYOUT_HANDOUT3;
- std::vector< Rectangle >::iterator iter( aAreas.begin() );
+ std::vector< basegfx::B2DRange >::iterator iter( aAreas.begin() );
while( iter != aAreas.end() )
{
- SdrPageObj* pPageObj = static_cast<SdrPageObj*>(pMasterPage->CreatePresObj(PRESOBJ_HANDOUT, sal_False, (*iter++), sal_True) );
+ SdrPageObj* pPageObj = static_cast<SdrPageObj*>(pMasterPage->CreatePresObj(PRESOBJ_HANDOUT, false, (*iter++), true) );
// #i105146# We want no content to be displayed for PK_HANDOUT,
// so just never set a page as content
pPageObj->SetReferencedPage(0L);
@@ -867,106 +1008,100 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert)
{
if( eObjKind == PRESOBJ_TITLE )
{
- Rectangle aTitleRect( GetTitleRect() );
- return CreatePresObj(PRESOBJ_TITLE, sal_False, aTitleRect, bInsert);
+ const basegfx::B2DRange aTitleRange( GetTitleRange() );
+ return CreatePresObj(PRESOBJ_TITLE, false, aTitleRange, bInsert);
}
else if( eObjKind == PRESOBJ_OUTLINE )
{
- Rectangle aLayoutRect( GetLayoutRect() );
- return CreatePresObj( PRESOBJ_OUTLINE, sal_False, aLayoutRect, bInsert);
+ const basegfx::B2DRange aLayoutRange( GetLayoutRange() );
+ return CreatePresObj( PRESOBJ_OUTLINE, false, aLayoutRange, bInsert);
}
else if( eObjKind == PRESOBJ_NOTES )
{
- Rectangle aLayoutRect( GetLayoutRect() );
- return CreatePresObj( PRESOBJ_NOTES, sal_False, aLayoutRect, bInsert);
+ const basegfx::B2DRange aLayoutRange( GetLayoutRange() );
+ return CreatePresObj( PRESOBJ_NOTES, false, aLayoutRange, bInsert);
}
else if( (eObjKind == PRESOBJ_FOOTER) || (eObjKind == PRESOBJ_DATETIME) || (eObjKind == PRESOBJ_SLIDENUMBER) || (eObjKind == PRESOBJ_HEADER ) )
{
// create footer objects for standard master page
if( mePageKind == PK_STANDARD )
{
- const long nLftBorder = GetLftBorder();
- const long nUppBorder = GetUppBorder();
+ const double fLeftBorder(GetLeftPageBorder());
+ const double fTopBorder(GetTopPageBorder());
+ const basegfx::B2DPoint aTitlePos(fLeftBorder, fTopBorder);
+ const basegfx::B2DVector aPageSize(GetInnerPageScale());
+ const double Y(fTopBorder + aPageSize.getY() * 0.911);
+ const double W1(aPageSize.getX() * 0.233);
+ const double W2(aPageSize.getX() * 0.317);
+ const double H(aPageSize.getY() * 0.069);
- Point aTitlePos ( nLftBorder, nUppBorder );
- Size aPageSize ( GetSize() );
- aPageSize.Width() -= nLftBorder + GetRgtBorder();
- aPageSize.Height() -= nUppBorder + GetLwrBorder();
-
- const int Y = long(nUppBorder + aPageSize.Height() * 0.911);
- const int W1 = long(aPageSize.Width() * 0.233);
- const int W2 = long(aPageSize.Width() * 0.317);
- const int H = long(aPageSize.Height() * 0.069);
-
- if( eObjKind == PRESOBJ_DATETIME )
+ if(PRESOBJ_DATETIME == eObjKind)
{
- Point aPos( long(nLftBorder+(aPageSize.Width()*0.05)), Y );
- Size aSize( W1, H );
- Rectangle aRect( aPos, aSize );
- return CreatePresObj( PRESOBJ_DATETIME, sal_False, aRect, bInsert );
+ const basegfx::B2DPoint aPos(fLeftBorder + (aPageSize.getX() * 0.05), Y);
+ const basegfx::B2DRange aRange(aPos, aPos + basegfx::B2DTuple(W1, H));
+
+ return CreatePresObj(PRESOBJ_DATETIME, false, aRange, bInsert);
}
- else if( eObjKind == PRESOBJ_FOOTER )
+ else if(PRESOBJ_FOOTER == eObjKind)
{
- Point aPos( long(nLftBorder+ aPageSize.Width() * 0.342), Y );
- Size aSize( W2, H );
- Rectangle aRect( aPos, aSize );
- return CreatePresObj( PRESOBJ_FOOTER, sal_False, aRect, bInsert );
+ const basegfx::B2DPoint aPos(fLeftBorder + (aPageSize.getX() * 0.342), Y);
+ const basegfx::B2DRange aRange(aPos, aPos + basegfx::B2DTuple(W2, H));
+
+ return CreatePresObj(PRESOBJ_FOOTER, false, aRange, bInsert);
}
else if( eObjKind == PRESOBJ_SLIDENUMBER )
{
- Point aPos( long(nLftBorder+(aPageSize.Width()*0.717)), Y );
- Size aSize( W1, H );
- Rectangle aRect( aPos, aSize );
- return CreatePresObj( PRESOBJ_SLIDENUMBER, sal_False, aRect, bInsert );
+ const basegfx::B2DPoint aPos(fLeftBorder + (aPageSize.getX() * 0.717), Y);
+ const basegfx::B2DRange aRange(aPos, aPos + basegfx::B2DTuple(W1, H));
+
+ return CreatePresObj(PRESOBJ_SLIDENUMBER, false, aRange, bInsert);
}
else
{
DBG_ERROR( "SdPage::CreateDefaultPresObj() - can't create a header placeholder for a slide master" );
- return NULL;
+ return 0;
}
}
else
{
// create header&footer objects for handout and notes master
- Point aTitlePos ( GetLftBorder(), GetUppBorder() );
- Size aPageSize ( GetSize() );
- aPageSize.Width() -= GetLftBorder() + GetRgtBorder();
- aPageSize.Height() -= GetUppBorder() + GetLwrBorder();
-
-
- const int NOTES_HEADER_FOOTER_WIDTH = long(aPageSize.Width() * 0.434);
- const int NOTES_HEADER_FOOTER_HEIGHT = long(aPageSize.Height() * 0.05);
-
- Size aSize( NOTES_HEADER_FOOTER_WIDTH, NOTES_HEADER_FOOTER_HEIGHT );
-
- const int X1 = GetLftBorder();
- const int X2 = GetLftBorder() + long(aPageSize.Width() - NOTES_HEADER_FOOTER_WIDTH);
- const int Y1 = GetUppBorder();
- const int Y2 = GetUppBorder() + long(aPageSize.Height() - NOTES_HEADER_FOOTER_HEIGHT );
-
- if( eObjKind == PRESOBJ_HEADER )
+ const basegfx::B2DPoint aTitlePos(GetLeftPageBorder(), GetTopPageBorder());
+ const basegfx::B2DVector aPageSize(GetInnerPageScale());
+ const double NOTES_HEADER_FOOTER_WIDTH(aPageSize.getX() * 0.434);
+ const double NOTES_HEADER_FOOTER_HEIGHT(aPageSize.getY() * 0.05);
+ const basegfx::B2DVector aSize(NOTES_HEADER_FOOTER_WIDTH, NOTES_HEADER_FOOTER_HEIGHT);
+ const double X1(GetLeftPageBorder());
+ const double X2(GetLeftPageBorder() + (aPageSize.getX() - NOTES_HEADER_FOOTER_WIDTH));
+ const double Y1(GetTopPageBorder());
+ const double Y2(GetTopPageBorder() + (aPageSize.getY() - NOTES_HEADER_FOOTER_HEIGHT));
+
+ if(PRESOBJ_HEADER == eObjKind)
{
- Point aPos( X1, Y1 );
- Rectangle aRect( aPos, aSize );
- return CreatePresObj( PRESOBJ_HEADER, sal_False, aRect, bInsert );
+ const basegfx::B2DPoint aPos(X1, Y1);
+ const basegfx::B2DRange aRange(aPos, aPos + aSize);
+
+ return CreatePresObj(PRESOBJ_HEADER, false, aRange, bInsert);
}
- else if( eObjKind == PRESOBJ_DATETIME )
+ else if(PRESOBJ_DATETIME == eObjKind)
{
- Point aPos( X2, Y1 );
- Rectangle aRect( aPos, aSize );
- return CreatePresObj( PRESOBJ_DATETIME, sal_False, aRect, bInsert );
+ const basegfx::B2DPoint aPos(X2, Y1);
+ const basegfx::B2DRange aRange(aPos, aPos + aSize);
+
+ return CreatePresObj(PRESOBJ_DATETIME, false, aRange, bInsert);
}
- else if( eObjKind == PRESOBJ_FOOTER )
+ else if(PRESOBJ_FOOTER == eObjKind)
{
- Point aPos( X1, Y2 );
- Rectangle aRect( aPos, aSize );
- return CreatePresObj( PRESOBJ_FOOTER, sal_False, aRect, bInsert );
+ const basegfx::B2DPoint aPos(X1, Y2);
+ const basegfx::B2DRange aRange(aPos, aPos + aSize);
+
+ return CreatePresObj(PRESOBJ_FOOTER, false, aRange, bInsert);
}
- else if( eObjKind == PRESOBJ_SLIDENUMBER )
+ else if(PRESOBJ_SLIDENUMBER == eObjKind)
{
- Point aPos( X2, Y2 );
- Rectangle aRect( aPos, aSize );
- return CreatePresObj( PRESOBJ_SLIDENUMBER, sal_False, aRect, bInsert );
+ const basegfx::B2DPoint aPos(X2, Y2);
+ const basegfx::B2DRange aRange(aPos, aPos + aSize);
+
+ return CreatePresObj(PRESOBJ_SLIDENUMBER, false, aRange, bInsert);
}
DBG_ERROR("SdPage::CreateDefaultPresObj() - this should not happen!");
@@ -986,75 +1121,65 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert)
|*
\************************************************************************/
-Rectangle SdPage::GetTitleRect() const
+basegfx::B2DRange SdPage::GetTitleRange() const
{
- Rectangle aTitleRect;
+ basegfx::B2DRange aTitleRange;
if (mePageKind != PK_HANDOUT)
{
/******************************************************************
* Standard- oder Notiz-Seite: Titelbereich
******************************************************************/
- Point aTitlePos ( GetLftBorder(), GetUppBorder() );
- Size aTitleSize ( GetSize() );
- aTitleSize.Width() -= GetLftBorder() + GetRgtBorder();
- aTitleSize.Height() -= GetUppBorder() + GetLwrBorder();
+ basegfx::B2DPoint aTitlePos(GetLeftPageBorder(), GetTopPageBorder());
+ basegfx::B2DVector aTitleSize(GetInnerPageScale());
if (mePageKind == PK_STANDARD)
{
- aTitlePos.X() += long( aTitleSize.Width() * 0.05 );
- aTitlePos.Y() += long( aTitleSize.Height() * 0.0399 );
- aTitleSize.Width() = long( aTitleSize.Width() * 0.9 );
- aTitleSize.Height() = long( aTitleSize.Height() * 0.167 );
+ aTitlePos += aTitleSize * basegfx::B2DTuple(0.05, 0.0399);
+ aTitleSize *= basegfx::B2DTuple(0.9, 0.167);
}
else if (mePageKind == PK_NOTES)
{
- Point aPos = aTitlePos;
- aPos.Y() += long( aTitleSize.Height() * 0.076 );
+ basegfx::B2DPoint aPos(aTitlePos.getX(), aTitlePos.getY() + (aTitleSize.getY() * 0.076));
// Hoehe beschraenken
- aTitleSize.Height() = (long) (aTitleSize.Height() * 0.375);
+ aTitleSize.setY(aTitleSize.getY() * 0.375);
+
+ basegfx::B2DVector aPartArea(aTitleSize);
+ basegfx::B2DVector aSize;
- Size aPartArea = aTitleSize;
- Size aSize;
- sal_uInt16 nDestPageNum(GetPageNum());
+ sal_uInt32 nDestPageNum(GetPageNumber());
SdrPage* pRefPage = 0L;
if(nDestPageNum)
{
- // only decrement if != 0, else we get 0xffff
+ // only decrement if != 0, else we get SDRPAGE_NOTFOUND
nDestPageNum -= 1;
}
- if(nDestPageNum < pModel->GetPageCount())
+ if(nDestPageNum < getSdrModelFromSdrPage().GetPageCount())
{
- pRefPage = pModel->GetPage(nDestPageNum);
+ pRefPage = getSdrModelFromSdrPage().GetPage(nDestPageNum);
}
if ( pRefPage )
{
// tatsaechliche Seitengroesse in das Handout-Rechteck skalieren
- double fH = (double) aPartArea.Width() / pRefPage->GetWdt();
- double fV = (double) aPartArea.Height() / pRefPage->GetHgt();
+ const basegfx::B2DVector aRefPageSize(pRefPage->GetPageScale());
+ const basegfx::B2DVector aFactor(aPartArea / aRefPageSize);
- if ( fH > fV )
- fH = fV;
- aSize.Width() = (long) (fH * pRefPage->GetWdt());
- aSize.Height() = (long) (fH * pRefPage->GetHgt());
-
- aPos.X() += (aPartArea.Width() - aSize.Width()) / 2;
- aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2;
+ aSize = aRefPageSize * std::max(aFactor.getX(), aFactor.getY());
+ aPos += (aPartArea - aSize) * 0.5;
}
aTitlePos = aPos;
aTitleSize = aSize;
}
- aTitleRect.SetPos(aTitlePos);
- aTitleRect.SetSize(aTitleSize);
+ aTitleRange = basegfx::B2DRange(aTitlePos, aTitlePos + aTitleSize);
}
- return aTitleRect;
+ return aTitleRange;
}
@@ -1064,38 +1189,32 @@ Rectangle SdPage::GetTitleRect() const
|*
\************************************************************************/
-Rectangle SdPage::GetLayoutRect() const
+basegfx::B2DRange SdPage::GetLayoutRange() const
{
- Rectangle aLayoutRect;
+ basegfx::B2DRange aLayoutRange;
if (mePageKind != PK_HANDOUT)
{
- Point aLayoutPos ( GetLftBorder(), GetUppBorder() );
- Size aLayoutSize ( GetSize() );
- aLayoutSize.Width() -= GetLftBorder() + GetRgtBorder();
- aLayoutSize.Height() -= GetUppBorder() + GetLwrBorder();
+ basegfx::B2DPoint aLayoutPos(GetLeftPageBorder(), GetTopPageBorder());
+ basegfx::B2DVector aLayoutSize(GetInnerPageScale());
if (mePageKind == PK_STANDARD)
{
- aLayoutPos.X() += long( aLayoutSize.Width() * 0.05 );
- aLayoutPos.Y() += long( aLayoutSize.Height() * 0.234 );
- aLayoutSize.Width() = long( aLayoutSize.Width() * 0.9 );
- aLayoutSize.Height() = long( aLayoutSize.Height() * 0.66 );
- aLayoutRect.SetPos(aLayoutPos);
- aLayoutRect.SetSize(aLayoutSize);
+ aLayoutPos += aLayoutSize * basegfx::B2DTuple(0.05, 0.234);
+ aLayoutSize *= basegfx::B2DTuple(0.9, 0.66);
+
+ aLayoutRange = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
}
else if (mePageKind == PK_NOTES)
{
- aLayoutPos.X() += long( aLayoutSize.Width() * 0.1 );
- aLayoutPos.Y() += long( aLayoutSize.Height() * 0.475 );
- aLayoutSize.Width() = long( aLayoutSize.Width() * 0.8 );
- aLayoutSize.Height() = long( aLayoutSize.Height() * 0.45 );
- aLayoutRect.SetPos(aLayoutPos);
- aLayoutRect.SetSize(aLayoutSize);
+ aLayoutPos += aLayoutSize * basegfx::B2DTuple(0.1, 0.475);
+ aLayoutSize *= basegfx::B2DTuple(0.8, 0.45);
+
+ aLayoutRange = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
}
}
- return aLayoutRect;
+ return aLayoutRange;
}
@@ -1179,10 +1298,10 @@ static const LayoutDescriptor& GetLayoutDescriptor( AutoLayout eLayout )
return aLayouts[ eLayout - AUTOLAYOUT__START ];
}
-static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* rRectangle )
+static void CalcAutoLayoutRanges( SdPage& rPage, int nLayout, basegfx::B2DRange* rRanges )
{
- Rectangle aTitleRect;
- Rectangle aLayoutRect;
+ basegfx::B2DRange aTitleRange;
+ basegfx::B2DRange aLayoutRange;
if( rPage.GetPageKind() != PK_HANDOUT )
{
@@ -1192,33 +1311,34 @@ static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* rRe
SdrObject* pMasterOutline = rMasterPage.GetPresObj( rPage.GetPageKind()==PK_NOTES ? PRESOBJ_NOTES : PRESOBJ_OUTLINE );
if( pMasterTitle )
- aTitleRect = pMasterTitle->GetLogicRect();
+ aTitleRange = sdr::legacy::GetLogicRange(*pMasterTitle);
- if (aTitleRect.IsEmpty() )
- aTitleRect = rPage.GetTitleRect();
+ if (aTitleRange.isEmpty() )
+ aTitleRange = rPage.GetTitleRange();
if( pMasterSubTitle )
- aLayoutRect = pMasterSubTitle->GetLogicRect();
+ aLayoutRange = sdr::legacy::GetLogicRange(*pMasterSubTitle);
else if( pMasterOutline )
- aLayoutRect = pMasterOutline->GetLogicRect();
+ aLayoutRange = sdr::legacy::GetLogicRange(*pMasterOutline);
- if (aLayoutRect.IsEmpty() )
- aLayoutRect = rPage.GetLayoutRect();
+ if (aLayoutRange.isEmpty() )
+ aLayoutRange = rPage.GetLayoutRange();
}
- rRectangle[0] = aTitleRect;
+ rRanges[0] = aTitleRange;
int i;
for( i = 1; i < MAX_PRESOBJS; i++ )
- rRectangle[i] = aLayoutRect;
+ rRanges[i] = aLayoutRange;
- Size aTitleSize( aTitleRect.GetSize() );
- Point aTitlePos( aTitleRect.TopLeft() );
- Size aLayoutSize( aLayoutRect.GetSize() );
- Point aLayoutPos( aLayoutRect.TopLeft() );
- Size aTempSize;
- Point aTempPnt;
+ basegfx::B2DVector aTitleSize(aTitleRange.getRange());
+ basegfx::B2DPoint aTitlePos(aTitleRange.getMinimum());
+ basegfx::B2DVector aLayoutSize(aLayoutRange.getRange());
+ basegfx::B2DPoint aLayoutPos(aLayoutRange.getMinimum());
+ basegfx::B2DVector aTempSize;
+ basegfx::B2DPoint aTempPos;
- sal_Bool bRightToLeft = ( rPage.GetModel() && static_cast< SdDrawDocument* >( rPage.GetModel() )->GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB );
+ SdDrawDocument& rDrawDocument = static_cast< SdDrawDocument& >(rPage.getSdrModelFromSdrPage());
+ const bool bRightToLeft(::com::sun::star::text::WritingMode_RL_TB == rDrawDocument.GetDefaultWritingMode());
switch( nLayout )
{
@@ -1226,163 +1346,178 @@ static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* rRe
break; // do nothing
case 1: // title, 2 shapes
case 9: // title, 2 vertical shapes
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
- rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutSize.setX(aLayoutSize.getX() * 0.488);
+ rRanges[1] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.X() = long (aLayoutPos.X() + aLayoutSize.Width() * 1.05);
- rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setX(aLayoutPos.getX() + (aLayoutSize.getX() * 1.05));
+ rRanges[2] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
if( bRightToLeft && (nLayout != 9) )
- ::std::swap< Rectangle >( rRectangle[1], rRectangle[2] );
+ {
+ ::std::swap< basegfx::B2DRange >( rRanges[1], rRanges[2] );
+ }
break;
case 2: // title, shape, 2 shapes
- aTempPnt = aLayoutPos;
+ aTempPos = aLayoutPos;
aTempSize = aLayoutSize;
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
- aLayoutPos.X() = long (aLayoutPos.X() + aLayoutSize.Width() * 1.05);
- rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
- rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutSize *= basegfx::B2DTuple(0.488, 0.477);
+ aLayoutPos.setX(aLayoutPos.getX() + (aLayoutSize.getX() * 1.05));
+ rRanges[2] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
+
+ aLayoutPos.setY(aLayoutPos.getY() + (aLayoutSize.getY() * 1.095));
+ rRanges[3] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos = aTempPnt;
+ aLayoutPos = aTempPos;
aLayoutSize = aTempSize;
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
- rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
+
+ aLayoutSize.setX(aLayoutSize.getX() * 0.488);
+ rRanges[1] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
if( bRightToLeft )
{
- ::std::swap< long >( rRectangle[1].Left(), rRectangle[2].Left() );
- rRectangle[3].Left() = rRectangle[2].Left();
+ // [2] nad [3] are on the right side, [1] is on the left.
+ const double fDeltaX(rRanges[1].getMinX() - rRanges[2].getMinX());
+ const basegfx::B2DHomMatrix aTransToLeft(basegfx::tools::createTranslateB2DHomMatrix(fDeltaX, 0.0));
+ const basegfx::B2DHomMatrix aTransToRight(basegfx::tools::createTranslateB2DHomMatrix(-fDeltaX, 0.0));
+
+ rRanges[1].transform(aTransToRight);
+ rRanges[2].transform(aTransToLeft);
+ rRanges[3].transform(aTransToLeft);
}
break;
case 3: // title, 2 shapes, shape
- aTempPnt = aLayoutPos;
+ aTempPos = aLayoutPos;
aTempSize = aLayoutSize;
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
- rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
- rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutSize *= basegfx::B2DTuple(0.488, 0.477);
+ rRanges[1] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
+
+ aLayoutPos.setY(aLayoutPos.getY() + (aLayoutSize.getY() * 1.095));
+ rRanges[2] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos = aTempPnt;
+ aLayoutPos = aTempPos;
aLayoutSize = aTempSize;
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
- aLayoutPos.X() = long (aLayoutPos.X() + aLayoutSize.Width() * 1.05);
- rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
+
+ aLayoutSize.setX(aLayoutSize.getX() * 0.488);
+ aLayoutPos.setX(aLayoutPos.getX() + (aLayoutSize.getX() * 1.05));
+ rRanges[3] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
if( bRightToLeft )
{
- ::std::swap< long >( rRectangle[1].Left(), rRectangle[2].Left() );
- rRectangle[3].Left() = rRectangle[2].Left();
+ // [1] and [2] are left, [3] is right
+ const double fDeltaX(rRanges[3].getMinX() - rRanges[1].getMinX());
+ const basegfx::B2DHomMatrix aTransToRight(basegfx::tools::createTranslateB2DHomMatrix(fDeltaX, 0.0));
+ const basegfx::B2DHomMatrix aTransToLeft(basegfx::tools::createTranslateB2DHomMatrix(-fDeltaX, 0.0));
+
+ rRanges[1].transform(aTransToRight);
+ rRanges[2].transform(aTransToRight);
+ rRanges[3].transform(aTransToLeft);
}
break;
case 4: // title, shape above shape
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutSize.setY(aLayoutSize.getY() * 0.477);
+ rRanges[1] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
- rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setY(aLayoutPos.getY() + (aLayoutSize.getY() * 1.095));
+ rRanges[2] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
break;
case 5: // title, 2 shapes above shape
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
- rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
-
- aTempPnt = aLayoutPos;
- aLayoutPos.X() = long (aLayoutPos.X() + aLayoutSize.Width() * 1.05);
- rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
-
- aLayoutPos.X() = aTempPnt.X();
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
- aLayoutSize.Width() = long (aLayoutSize.Width() / 0.488);
- rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutSize *= basegfx::B2DTuple(0.488, 0.477);
+ rRanges[1] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
+
+ aTempPos = aLayoutPos;
+ aLayoutPos.setX(aLayoutPos.getX() + (aLayoutSize.getX() * 1.05));
+ rRanges[2] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
+
+ aLayoutPos.setX(aTempPos.getX());
+ aLayoutPos.setY(aLayoutPos.getY() + (aLayoutSize.getY() * 1.095));
+ aLayoutSize.setX(aLayoutSize.getX() / 0.488);
+ rRanges[3] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
break;
case 6: // title, 4 shapes
{
- sal_uLong nX = long (aLayoutPos.X());
+ const double fX(aLayoutPos.getX());
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
- rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutSize *= basegfx::B2DTuple(0.488, 0.477);
+ rRanges[1] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.X() = long (nX + aLayoutSize.Width() * 1.05);
- rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setX(fX + (aLayoutSize.getX() * 1.05));
+ rRanges[2] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
- rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setY(aLayoutPos.getY() + (aLayoutSize.getY() * 1.095));
+ rRanges[3] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.X() = nX;
- rRectangle[4] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setX(fX);
+ rRanges[4] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
break;
}
case 7: // vertical title, shape above shape
{
- Size aSize( rRectangle[0].GetSize().Height(), rRectangle[1].BottomLeft().Y() - rRectangle[0].TopLeft().Y() );
- rRectangle[0].SetSize( aSize );
- rRectangle[0].SetPos( aTitleRect.TopRight() - Point( aSize.Width(), 0 ) );
-
- Size aPageSize ( rPage.GetSize() );
- aPageSize.Height() -= rPage.GetUppBorder() + rPage.GetLwrBorder();
- aSize.Height() = long ( rRectangle[0].GetSize().Height() * 0.47 );
- aSize.Width() = long( aPageSize.Width() * 0.7 );
- rRectangle[1].SetPos( aTitleRect.TopLeft() );
- rRectangle[1].SetSize( aSize );
-
- aSize.Height() = rRectangle[0].GetSize().Height();
- Point aPos( aTitleRect.TopLeft() );
- aPos.Y() += long ( aSize.Height() * 0.53 );
- rRectangle[2].SetPos( aPos );
- aSize.Height() = long ( rRectangle[0].GetSize().Height() * 0.47 );
- rRectangle[2].SetSize( aSize );
+ basegfx::B2DVector aSize(rRanges[0].getHeight(), rRanges[1].getMaxY() - rRanges[0].getMinY());
+ basegfx::B2DPoint aPos(aTitleRange.getMaxX() - aSize.getX(), aTitleRange.getMinY());
+
+ rRanges[0] = basegfx::B2DRange(aPos, aPos + aSize);
+
+ const basegfx::B2DVector aPageSize(rPage.GetPageScale().getX(), rPage.GetPageScale().getY() - (rPage.GetTopPageBorder() + rPage.GetBottomPageBorder()));
+
+ aSize.setX(aPageSize.getX() * 0.7);
+ aSize.setY(rRanges[0].getHeight() * 0.47);
+
+ rRanges[1] = basegfx::B2DRange(aTitleRange.getMinimum(), aTitleRange.getMinimum() + aSize);
+
+ aSize.setY(rRanges[0].getHeight());
+ aPos = aTitleRange.getMinimum();
+ aPos.setY(aPos.getY() + (aSize.getY() * 0.53));
+ aSize.setY(rRanges[0].getHeight() * 0.47);
+
+ rRanges[2] = basegfx::B2DRange(aPos, aPos + aSize);
break;
}
case 8: // vertical title, shape
{
- Size aSize( rRectangle[0].GetSize().Height(), rRectangle[1].BottomLeft().Y() - rRectangle[0].TopLeft().Y() );
- rRectangle[0].SetSize( aSize );
- rRectangle[0].SetPos( aTitleRect.TopRight() - Point( aSize.Width(), 0 ) );
+ basegfx::B2DVector aSize(rRanges[0].getHeight(), rRanges[1].getMaxY() - rRanges[0].getMinY());
+ const basegfx::B2DPoint aPos(aTitleRange.getMaxX() - aSize.getX(), aTitleRange.getMinY());
+
+ rRanges[0] = basegfx::B2DRange(aPos, aPos + aSize);
- Size aPageSize ( rPage.GetSize() );
- aPageSize.Height() -= rPage.GetUppBorder() + rPage.GetLwrBorder();
- aSize.Height() = rRectangle[0].GetSize().Height();
- aSize.Width() = long( aPageSize.Width() * 0.7 );
- rRectangle[1].SetPos( aTitleRect.TopLeft() );
- rRectangle[1].SetSize( aSize );
+ const basegfx::B2DVector aPageSize(rPage.GetPageScale().getX(), rPage.GetPageScale().getY() - (rPage.GetTopPageBorder() + rPage.GetBottomPageBorder()));
+
+ aSize.setX(aPageSize.getX() * 0.7);
+ aSize.setY(rRanges[0].getHeight());
+
+ rRanges[1] = basegfx::B2DRange(aTitleRange.getMinimum(), aTitleRange.getMinimum() + aSize);
break;
}
case 10: // onlytext
{
- Size aSize( rRectangle[0].GetSize().Width(), rRectangle[1].BottomLeft().Y() - rRectangle[0].TopLeft().Y() );
- rRectangle[0].SetSize( aSize );
- rRectangle[0].SetPos( aTitlePos);
+ const basegfx::B2DVector aSize(rRanges[0].getWidth(), rRanges[1].getMaxY() - rRanges[0].getMinY());
+
+ rRanges[0] = basegfx::B2DRange(aTitlePos, aTitlePos + aSize);
break;
}
case 11: // title, 6 shapes
{
- sal_uLong nX = long (aLayoutPos.X());
+ const double fX(aLayoutPos.getX());
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.322);
- rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutSize *= basegfx::B2DTuple(0.322, 0.477);
+ rRanges[1] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.X() = long (nX + aLayoutSize.Width() * 1.05);
- rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setX(fX + (aLayoutSize.getX() * 1.05));
+ rRanges[2] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.X() = long (nX + aLayoutSize.Width() * 2 * 1.05);
- rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setX(fX + (aLayoutSize.getX() * (2.0 * 1.05)));
+ rRanges[3] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
- rRectangle[4] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setY(aLayoutPos.getY() + (aLayoutSize.getY() * 1.095));
+ rRanges[4] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.X() = long (nX + aLayoutSize.Width() * 1.05);
- rRectangle[5] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setX(fX + (aLayoutSize.getX() * 1.05));
+ rRanges[5] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
- aLayoutPos.X() = nX;
- rRectangle[6] = Rectangle (aLayoutPos, aLayoutSize);
+ aLayoutPos.setX(fX);
+ rRanges[6] = basegfx::B2DRange(aLayoutPos, aLayoutPos + aLayoutSize);
break;
}
@@ -1391,7 +1526,7 @@ static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* rRe
}
-void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescriptor, std::vector< SdrObject* >& rShapes, bool bInit, bool bSwitchLayout )
+void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescriptor, SdrObjectVector& rShapes, bool bInit, bool bSwitchLayout )
{
int i;
@@ -1480,11 +1615,13 @@ void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescripto
if( pOle2 )
{
if( pOle2->IsEmpty() )
+ {
bFound = true;
- else if( rPage.GetModel() )
+ }
+ else
{
- SdrModel* pSdrModel = rPage.GetModel();
- ::comphelper::IEmbeddedHelper *pPersist = pSdrModel->GetPersist();
+ SdDrawDocument& rDrawDocument = static_cast< SdDrawDocument& >(rPage.getSdrModelFromSdrPage());
+ ::comphelper::IEmbeddedHelper *pPersist = rDrawDocument.GetPersist();
if( pPersist )
{
uno::Reference < embed::XEmbeddedObject > xObject = pPersist->getEmbeddedObjectContainer().
@@ -1552,13 +1689,12 @@ void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescripto
}
}
-void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate )
+void SdPage::SetAutoLayout(AutoLayout eLayout, bool bInit, bool bCreate )
{
sd::ScopeLockGuard aGuard( maLockAutoLayoutArrangement );
const bool bSwitchLayout = eLayout != GetAutoLayout();
-
- ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoManager = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetUndoManager();
const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
meAutoLayout = eLayout;
@@ -1572,14 +1708,14 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate
return;
}
- Rectangle aRectangle[MAX_PRESOBJS];
+ basegfx::B2DRange aRanges[MAX_PRESOBJS];
const LayoutDescriptor& aDescriptor = GetLayoutDescriptor( meAutoLayout );
- CalcAutoLayoutRectangles( *this, aDescriptor.mnLayout, aRectangle );
+ CalcAutoLayoutRanges( *this, aDescriptor.mnLayout, aRanges );
std::set< SdrObject* > aUsedPresentationObjects;
- std::vector< SdrObject* > aLayoutShapes(PRESOBJ_MAX, 0);
+ SdrObjectVector aLayoutShapes(PRESOBJ_MAX, 0);
findAutoLayoutShapesImpl( *this, aDescriptor, aLayoutShapes, bInit, bSwitchLayout );
int i;
@@ -1588,7 +1724,7 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate
for (i = 0; (i < MAX_PRESOBJS) && (aDescriptor.meKind[i] != PRESOBJ_NONE); i++)
{
PresObjKind eKind = aDescriptor.meKind[i];
- SdrObject* pObj = InsertAutoLayoutShape( aLayoutShapes[i], eKind, aDescriptor.mbVertical[i], aRectangle[i], bInit );
+ SdrObject* pObj = InsertAutoLayoutShape( aLayoutShapes[i], eKind, aDescriptor.mbVertical[i], aRanges[i], bInit );
if( pObj )
aUsedPresentationObjects.insert(pObj); // remember that we used this empty shape
}
@@ -1596,23 +1732,26 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate
// now delete all empty presentation objects that are no longer used by the new layout
if( bInit )
{
- SdrObject* pObj = maPresentationShapeList.getNextShape(0);
+ SdrObject* pObj = const_cast< SdrObject* >(maPresentationShapeList.getNextShape(0));
while( pObj )
{
- SdrObject* pNext = maPresentationShapeList.getNextShape(pObj);
+ SdrObject* pNext = const_cast< SdrObject* >(maPresentationShapeList.getNextShape(pObj));
+
if( aUsedPresentationObjects.count(pObj) == 0 )
{
if( pObj->IsEmptyPresObj() )
{
if( bUndo )
- pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
+ pUndoManager->AddUndoAction(getSdrModelFromSdrPage().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
- RemoveObject( pObj->GetOrdNum() );
+ RemoveObjectFromSdrObjList( pObj->GetNavigationPosition() );
if( !bUndo )
- SdrObject::Free( pObj );
+ {
+ deleteSdrObjectSafeAndClearPointer( pObj );
+ }
}
/* #i108541# keep non empty pres obj as pres obj even if they are not part of the current layout
else
@@ -1620,11 +1759,11 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate
if( bUndo )
{
pUndoManager->AddUndoAction( new UndoObjectPresentationKind( *pObj ) );
- if( pObj->GetUserCall() )
- pUndoManager->AddUndoAction( new UndoObjectUserCall( *pObj ) );
+ if( findConnectionToSdrObject(pObj) )
+ pUndoManager->AddUndoAction( new UndoConnectionToSdrObject( *pObj ) );
}
maPresentationShapeList.removeShape( *pObj );
- pObj->SetUserCall(0);
+ resetConnectionToSdrObject(pObj);
}
*/
}
@@ -1633,84 +1772,69 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate
}
}
-/*************************************************************************
-|*
-|* Objekt einfuegen
-|*
-\************************************************************************/
+// #95876# Also overload ReplaceObject methods to realize when
+// objects are removed with this mechanism instead of RemoveObject
+// -------------------------------------------------------------------------
+// called after a shape is removed/replaced inserted from this slide
-void SdPage::NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInsertReason* pReason)
+void SdPage::handleContentChange(const SfxHint& rHint)
{
- FmFormPage::NbcInsertObject(pObj, nPos, pReason);
+ const SdrBaseHint* pSdrBaseHint = dynamic_cast< const SdrBaseHint* >(&rHint);
- ((SdDrawDocument*) pModel)->InsertObject(pObj, this);
-
- SdrLayerID nId = pObj->GetLayer();
- if( mbMaster )
+ if(pSdrBaseHint)
{
- if( nId == 0 )
- pObj->NbcSetLayer( 2 ); // wrong layer. corrected to BackgroundObj layer
- }
- else
- {
- if( nId == 2 )
- pObj->NbcSetLayer( 0 ); // wrong layer. corrected to layout layer
+ switch(pSdrBaseHint->GetSdrHintKind())
+ {
+ case HINT_OBJINSERTED:
+ {
+ onInsertObject(pSdrBaseHint->GetSdrHintObject());
+ break;
+ }
+ case HINT_OBJREMOVED:
+ {
+ onRemoveObject(pSdrBaseHint->GetSdrHintObject());
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
}
}
-/*************************************************************************
-|*
-|* Objekt loeschen
-|*
-\************************************************************************/
-
-SdrObject* SdPage::RemoveObject(sal_uLong nObjNum)
-{
- onRemoveObject(GetObj( nObjNum ));
- return FmFormPage::RemoveObject(nObjNum);
-}
-
-/*************************************************************************
-|*
-|* Objekt loeschen, ohne Broadcast
-|*
-\************************************************************************/
-
-SdrObject* SdPage::NbcRemoveObject(sal_uLong nObjNum)
-{
- onRemoveObject(GetObj( nObjNum ));
- return FmFormPage::NbcRemoveObject(nObjNum);
-}
-
-// #95876# Also overload ReplaceObject methods to realize when
-// objects are removed with this mechanism instead of RemoveObject
-SdrObject* SdPage::NbcReplaceObject(SdrObject* pNewObj, sal_uLong nObjNum)
+void SdPage::onInsertObject(const SdrObject* pObject)
{
- onRemoveObject(GetObj( nObjNum ));
- return FmFormPage::NbcReplaceObject(pNewObj, nObjNum);
-}
+ if(pObject)
+ {
+ static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).InsertObject(pObject);
+ SdrLayerID nId = pObject->GetLayer();
-// #95876# Also overload ReplaceObject methods to realize when
-// objects are removed with this mechanism instead of RemoveObject
-SdrObject* SdPage::ReplaceObject(SdrObject* pNewObj, sal_uLong nObjNum)
-{
- onRemoveObject(GetObj( nObjNum ));
- return FmFormPage::ReplaceObject(pNewObj, nObjNum);
+ if( mbMaster )
+ {
+ if( nId == 0 )
+ {
+ // wrong layer. corrected to BackgroundObj layer
+ const_cast< SdrObject* >(pObject)->SetLayer( 2 );
+ }
+ }
+ else
+ {
+ if( nId == 2 )
+ {
+ // wrong layer. corrected to layout layer
+ const_cast< SdrObject* >(pObject)->SetLayer( 0 );
+ }
+ }
+ }
}
-// -------------------------------------------------------------------------
-
-// called after a shape is removed or replaced from this slide
-
-void SdPage::onRemoveObject( SdrObject* pObject )
+void SdPage::onRemoveObject(const SdrObject* pObject)
{
- if( pObject )
+ if(pObject)
{
RemovePresObj(pObject);
-
- if( pModel )
- static_cast<SdDrawDocument*>(pModel)->RemoveObject(pObject, this);
-
+ static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).RemoveObject(pObject);
removeAnimations( pObject );
}
}
@@ -1721,19 +1845,19 @@ void SdPage::onRemoveObject( SdrObject* pObject )
|*
\************************************************************************/
-void SdPage::SetSize(const Size& aSize)
+void SdPage::SetPageScale(const basegfx::B2DVector& aNewScale)
{
- Size aOldSize = GetSize();
+ const basegfx::B2DVector aOldScale(GetPageScale());
- if (aSize != aOldSize)
+ if(!aNewScale.equal(aOldScale))
{
- FmFormPage::SetSize(aSize);
+ FmFormPage::SetPageScale(aNewScale);
- if (aOldSize.Height() == 10 && aOldSize.Width() == 10)
+ if(aOldScale.getX() == 10.0 && aOldScale.getY() == 10.0)
{
// Die Seite bekommt erstmalig eine gueltige Groesse gesetzt,
// daher wird nun die Orientation initialisiert
- if (aSize.Width() > aSize.Height())
+ if (aNewScale.getX() > aNewScale.getY())
{
meOrientation = ORIENTATION_LANDSCAPE;
}
@@ -1748,86 +1872,11 @@ void SdPage::SetSize(const Size& aSize)
/*************************************************************************
|*
-|*
-|*
-\************************************************************************/
-
-void SdPage::SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 nLwr)
-{
- if (nLft != GetLftBorder() || nUpp != GetUppBorder() ||
- nRgt != GetRgtBorder() || nLwr != GetLwrBorder() )
- {
- FmFormPage::SetBorder(nLft, nUpp, nRgt, nLwr);
- }
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SdPage::SetLftBorder(sal_Int32 nBorder)
-{
- if (nBorder != GetLftBorder() )
- {
- FmFormPage::SetLftBorder(nBorder);
- }
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SdPage::SetRgtBorder(sal_Int32 nBorder)
-{
- if (nBorder != GetRgtBorder() )
- {
- FmFormPage::SetRgtBorder(nBorder);
- }
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SdPage::SetUppBorder(sal_Int32 nBorder)
-{
- if (nBorder != GetUppBorder() )
- {
- FmFormPage::SetUppBorder(nBorder);
- }
-}
-
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
-void SdPage::SetLwrBorder(sal_Int32 nBorder)
-{
- if (nBorder != GetLwrBorder() )
- {
- FmFormPage::SetLwrBorder(nBorder);
- }
-}
-
-/*************************************************************************
-|*
|* Setzt BackgroundFullSize und ruft dann AdjustBackground auf
|*
\************************************************************************/
-void SdPage::SetBackgroundFullSize( sal_Bool bIn )
+void SdPage::SetBackgroundFullSize( bool bIn )
{
if( bIn != mbBackgroundFullSize )
{
@@ -1846,69 +1895,56 @@ void SdPage::SetBackgroundFullSize( sal_Bool bIn )
|*
\************************************************************************/
-void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderRect, sal_Bool bScaleAllObj)
+void SdPage::ScaleObjects(const basegfx::B2DVector& rNewPageSize, double fLeft, double fTop, double fRight, double fBottom, bool bScaleAllObj)
{
sd::ScopeLockGuard aGuard( maLockAutoLayoutArrangement );
mbScaleObjects = bScaleAllObj;
SdrObject* pObj = NULL;
- Point aRefPnt(0, 0);
- Size aNewPageSize(rNewPageSize);
- sal_Int32 nLeft = rNewBorderRect.Left();
- sal_Int32 nRight = rNewBorderRect.Right();
- sal_Int32 nUpper = rNewBorderRect.Top();
- sal_Int32 nLower = rNewBorderRect.Bottom();
+ basegfx::B2DPoint aRefPoint(0.0, 0.0);
+ basegfx::B2DVector aNewPageSize(rNewPageSize);
// Negative Werte stehen fuer nicht zu aendernde Werte
// -> aktuelle Werte verwenden
- if (aNewPageSize.Width() < 0)
+ if (aNewPageSize.getX() < 0.0)
{
- aNewPageSize.Width() = GetWdt();
+ aNewPageSize.setX(GetPageScale().getX());
}
- if (aNewPageSize.Height() < 0)
+ if (aNewPageSize.getY() < 0.0)
{
- aNewPageSize.Height() = GetHgt();
+ aNewPageSize.setY(GetPageScale().getY());
}
- if (nLeft < 0)
+ if (fLeft < 0)
{
- nLeft = GetLftBorder();
+ fLeft = GetLeftPageBorder();
}
- if (nRight < 0)
+ if (fRight < 0)
{
- nRight = GetRgtBorder();
+ fRight = GetRightPageBorder();
}
- if (nUpper < 0)
+ if (fTop < 0)
{
- nUpper = GetUppBorder();
+ fTop = GetTopPageBorder();
}
- if (nLower < 0)
+ if (fBottom < 0)
{
- nLower = GetLwrBorder();
+ fBottom = GetBottomPageBorder();
}
- Point aBackgroundPos(nLeft, nUpper);
- Size aBackgroundSize(aNewPageSize);
- Rectangle aBorderRect (aBackgroundPos, aBackgroundSize);
-
if (mbScaleObjects)
{
- aBackgroundSize.Width() -= nLeft + nRight;
- aBackgroundSize.Height() -= nUpper + nLower;
- aBorderRect.SetSize(aBackgroundSize);
- aNewPageSize = aBackgroundSize;
+ aNewPageSize.setX(aNewPageSize.getX() - (fLeft + fRight));
+ aNewPageSize.setY(aNewPageSize.getY() - (fTop + fBottom));
}
- long nOldWidth = GetWdt() - GetLftBorder() - GetRgtBorder();
- long nOldHeight = GetHgt() - GetUppBorder() - GetLwrBorder();
-
- Fraction aFractX = Fraction(aNewPageSize.Width(), nOldWidth);
- Fraction aFractY = Fraction(aNewPageSize.Height(), nOldHeight);
+ const basegfx::B2DVector aFactor(
+ aNewPageSize.getX() / (basegfx::fTools::equalZero(GetInnerPageScale().getX()) ? 1.0 : GetInnerPageScale().getX()),
+ aNewPageSize.getY() / (basegfx::fTools::equalZero(GetInnerPageScale().getY()) ? 1.0 : GetInnerPageScale().getY()));
+ const sal_uInt32 nObjCnt(mbScaleObjects ? GetObjCount() : 0);
- sal_uLong nObjCnt = (mbScaleObjects ? GetObjCount() : 0);
-
- for (sal_uLong nObj = 0; nObj < nObjCnt; nObj++)
+ for (sal_uInt32 nObj = 0; nObj < nObjCnt; nObj++)
{
- sal_Bool bIsPresObjOnMaster = sal_False;
+ bool bIsPresObjOnMaster = false;
// Alle Objekte
pObj = GetObj(nObj);
@@ -1916,15 +1952,15 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
if (mbMaster && IsPresObj(pObj))
{
// Es ist ein Praesentationsobjekt auf der MasterPage
- bIsPresObjOnMaster = sal_True;
+ bIsPresObjOnMaster = true;
}
if (pObj)
{
// #88084# remember aTopLeft as original TopLeft
- Point aTopLeft(pObj->GetCurrentBoundRect().TopLeft());
+ const basegfx::B2DPoint aTopLeft(pObj->getObjectRange(0).getMinimum());
- if (!pObj->IsEdgeObj())
+ if (!pObj->IsSdrEdgeObj())
{
/**************************************************************
* Objekt skalieren
@@ -1932,10 +1968,18 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
if (mbScaleObjects)
{
// #88084# use aTopLeft as original TopLeft
- aRefPnt = aTopLeft;
+ aRefPoint = aTopLeft;
}
- pObj->Resize(aRefPnt, aFractX, aFractY);
+ {
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aRefPoint);
+ aTransform.scale(aFactor);
+ aTransform.translate(aRefPoint);
+
+ sdr::legacy::transformSdrObject(*pObj, aTransform);
+ }
if (mbScaleObjects)
{
@@ -1946,9 +1990,9 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
/**********************************************************
* Praesentationsvorlage: Texthoehe anpassen
**********************************************************/
- sal_uInt16 nIndexTitle = 0;
- sal_uInt16 nIndexOutline = 0;
- sal_uInt16 nIndexNotes = 0;
+ sal_uInt32 nIndexTitle = 0;
+ sal_uInt32 nIndexOutline = 0;
+ sal_uInt32 nIndexNotes = 0;
if (pObj == GetPresObj(PRESOBJ_TITLE, nIndexTitle))
{
@@ -1959,15 +2003,15 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
SfxItemSet& rSet = pTitleSheet->GetItemSet();
SvxFontHeightItem& rOldHgt = (SvxFontHeightItem&) rSet.Get(EE_CHAR_FONTHEIGHT);
- sal_uLong nFontHeight = rOldHgt.GetHeight();
- nFontHeight = long(nFontHeight * (double) aFractY);
+ sal_uInt32 nFontHeight = rOldHgt.GetHeight();
+ nFontHeight = long(nFontHeight * aFactor.getY());
rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT));
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( EE_CHAR_FONTHEIGHT_CJK ) )
{
rOldHgt = (SvxFontHeightItem&) rSet.Get(EE_CHAR_FONTHEIGHT_CJK);
nFontHeight = rOldHgt.GetHeight();
- nFontHeight = long(nFontHeight * (double) aFractY);
+ nFontHeight = long(nFontHeight * aFactor.getY());
rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK));
}
@@ -1975,7 +2019,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
{
rOldHgt = (SvxFontHeightItem&) rSet.Get(EE_CHAR_FONTHEIGHT_CTL);
nFontHeight = rOldHgt.GetHeight();
- nFontHeight = long(nFontHeight * (double) aFractY);
+ nFontHeight = long(nFontHeight * aFactor.getY());
rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL));
}
@@ -1987,11 +2031,12 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
String aName(GetLayoutName());
aName += sal_Unicode( ' ' );
- for (sal_uInt16 i=1; i<=9; i++)
+ for (sal_uInt32 i=1; i<=9; i++)
{
String sLayoutName(aName);
- sLayoutName += String::CreateFromInt32( (sal_Int32)i );
- SfxStyleSheet* pOutlineSheet = (SfxStyleSheet*)((SdDrawDocument*) pModel)->GetStyleSheetPool()->Find(sLayoutName, SD_STYLE_FAMILY_MASTERPAGE);
+ sLayoutName += String::CreateFromInt32( i );
+ SfxStyleSheet* pOutlineSheet = dynamic_cast< SfxStyleSheet* >(
+ static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetStyleSheetPool()->Find(sLayoutName, SD_STYLE_FAMILY_MASTERPAGE));
if (pOutlineSheet)
{
@@ -1999,15 +2044,15 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
SfxItemSet aTempSet(pOutlineSheet->GetItemSet());
SvxFontHeightItem& rOldHgt = (SvxFontHeightItem&) aTempSet.Get(EE_CHAR_FONTHEIGHT);
- sal_uLong nFontHeight = rOldHgt.GetHeight();
- nFontHeight = long(nFontHeight * (double) aFractY);
+ sal_uInt32 nFontHeight = rOldHgt.GetHeight();
+ nFontHeight = long(nFontHeight * aFactor.getY());
aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT));
if( SFX_ITEM_AVAILABLE == aTempSet.GetItemState( EE_CHAR_FONTHEIGHT_CJK ) )
{
rOldHgt = (SvxFontHeightItem&) aTempSet.Get(EE_CHAR_FONTHEIGHT_CJK);
nFontHeight = rOldHgt.GetHeight();
- nFontHeight = long(nFontHeight * (double) aFractY);
+ nFontHeight = long(nFontHeight * aFactor.getY());
aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK));
}
@@ -2015,12 +2060,12 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
{
rOldHgt = (SvxFontHeightItem&) aTempSet.Get(EE_CHAR_FONTHEIGHT_CTL);
nFontHeight = rOldHgt.GetHeight();
- nFontHeight = long(nFontHeight * (double) aFractY);
+ nFontHeight = long(nFontHeight * aFactor.getY());
aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL));
}
// Bullet anpassen
- ((SdStyleSheet*) pOutlineSheet)->AdjustToFontHeight(aTempSet, sal_False);
+ ((SdStyleSheet*) pOutlineSheet)->AdjustToFontHeight(aTempSet, false);
// Sonderbehandlung: die INVALIDS auf NULL-Pointer
// zurueckgesetzen (sonst landen INVALIDs oder
@@ -2049,8 +2094,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
if (pNotesSheet)
{
- sal_uLong nHeight = pObj->GetLogicRect().GetSize().Height();
- sal_uLong nFontHeight = (sal_uLong) (nHeight * 0.0741);
+ sal_uInt32 nHeight = sdr::legacy::GetLogicRect(*pObj).GetSize().Height();
+ sal_uInt32 nFontHeight = (sal_uInt32) (nHeight * 0.0741);
SfxItemSet& rSet = pNotesSheet->GetItemSet();
rSet.Put( SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT ));
rSet.Put( SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK ));
@@ -2061,13 +2106,13 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
}
else if ( eObjKind != OBJ_TITLETEXT &&
eObjKind != OBJ_OUTLINETEXT &&
- pObj->ISA(SdrTextObj) &&
+ dynamic_cast< SdrTextObj* >(pObj) &&
pObj->GetOutlinerParaObject() )
{
/******************************************************
* Normales Textobjekt: Texthoehe anpassen
******************************************************/
- sal_uLong nScriptType = pObj->GetOutlinerParaObject()->GetTextObject().GetScriptType();
+ sal_uInt32 nScriptType = pObj->GetOutlinerParaObject()->GetTextObject().GetScriptType();
sal_uInt16 nWhich = EE_CHAR_FONTHEIGHT;
if ( nScriptType == SCRIPTTYPE_ASIAN )
nWhich = EE_CHAR_FONTHEIGHT_CJK;
@@ -2076,53 +2121,39 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
// #88084# use more modern method to scale the text height
sal_uInt32 nFontHeight = ((SvxFontHeightItem&)pObj->GetMergedItem(nWhich)).GetHeight();
- sal_uInt32 nNewFontHeight = sal_uInt32((double)nFontHeight * (double)aFractY);
+ sal_uInt32 nNewFontHeight = sal_uInt32((double)nFontHeight * aFactor.getY());
pObj->SetMergedItem(SvxFontHeightItem(nNewFontHeight, 100, nWhich));
}
}
}
- if (mbScaleObjects && !pObj->IsEdgeObj())
+ if (mbScaleObjects && !pObj->IsSdrEdgeObj())
{
- /**************************************************************
- * Objektposition skalieren
- **************************************************************/
- Point aNewPos;
-
- // #76447# corrected scaling; only distances may be scaled
- // #88084# use aTopLeft as original TopLeft
- aNewPos.X() = long((aTopLeft.X() - GetLftBorder()) * (double)aFractX) + nLeft;
- aNewPos.Y() = long((aTopLeft.Y() - GetUppBorder()) * (double)aFractY) + nUpper;
-
- Size aVec(aNewPos.X() - aTopLeft.X(), aNewPos.Y() - aTopLeft.Y());
+ // scale object position
+ const basegfx::B2DPoint aNewPos(
+ ((aTopLeft.getX() - GetLeftPageBorder()) * aFactor.getX()) + fLeft,
+ ((aTopLeft.getY() - GetTopPageBorder()) * aFactor.getY()) + fTop);
- if (aVec.Height() != 0 || aVec.Width() != 0)
- {
- pObj->NbcMove(aVec);
- }
-
- pObj->SetChanged();
- pObj->BroadcastObjectChange();
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(aNewPos - aTopLeft));
}
}
}
}
-SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, PresObjKind& eObjKind, bool bVertical, Rectangle aRect )
+SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, PresObjKind& o_eObjKind, bool bVertical, const basegfx::B2DRange& rRange)
{
- SdDrawDocument* pModel = static_cast< SdDrawDocument* >( rPage.GetModel() );
- DBG_ASSERT( pModel, "sd::convertPresentationObjectImpl(), no model on page!" );
- if( !pModel || !pSourceObj )
+ SdDrawDocument& rLocalDrawModel = static_cast< SdDrawDocument& >(rPage.getSdrModelFromSdrPage());
+ if( !pSourceObj )
return pSourceObj;
- ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoManager = rLocalDrawModel.GetUndoManager();
const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && rPage.IsInserted();
SdrObject* pNewObj = pSourceObj;
- if((eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() == OBJ_TEXT) )
+ if((o_eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() == OBJ_TEXT) )
{
- pNewObj = rPage.CreatePresObj(PRESOBJ_OUTLINE, bVertical, aRect);
+ pNewObj = rPage.CreatePresObj(PRESOBJ_OUTLINE, bVertical, rRange);
// Text des Untertitels in das PRESOBJ_OUTLINE setzen
OutlinerParaObject* pOutlParaObj = pSourceObj->GetOutlinerParaObject();
@@ -2130,13 +2161,13 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
if(pOutlParaObj)
{
// Text umsetzen
- ::sd::Outliner* pOutl = pModel->GetInternalOutliner( sal_True );
+ ::sd::Outliner* pOutl = rLocalDrawModel.GetInternalOutliner( true );
pOutl->Clear();
pOutl->SetText( *pOutlParaObj );
pOutlParaObj = pOutl->CreateParaObject();
pNewObj->SetOutlinerParaObject( pOutlParaObj );
pOutl->Clear();
- pNewObj->SetEmptyPresObj(sal_False);
+ pNewObj->SetEmptyPresObj(false);
for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
{
@@ -2144,7 +2175,8 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
String aName(rPage.GetLayoutName());
aName += sal_Unicode( ' ' );
aName += String::CreateFromInt32( nLevel );
- SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>( pModel->GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_MASTERPAGE) );
+ SfxStyleSheet* pSheet = static_cast< SfxStyleSheet* >(
+ rLocalDrawModel.GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_MASTERPAGE));
if (pSheet)
{
@@ -2161,28 +2193,29 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
}
// LRSpace-Item loeschen
- SfxItemSet aSet(pModel->GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+ SfxItemSet aSet(pNewObj->GetObjectItemPool());
aSet.Put(pNewObj->GetMergedItemSet());
-
aSet.ClearItem(EE_PARA_LRSPACE);
pNewObj->SetMergedItemSet(aSet);
if( bUndo )
- pUndoManager->AddUndoAction( pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pSourceObj) );
+ pUndoManager->AddUndoAction(rLocalDrawModel.GetSdrUndoFactory().CreateUndoDeleteObject(*pSourceObj) );
// Remove outline shape from page
- rPage.RemoveObject( pSourceObj->GetOrdNum() );
+ rPage.RemoveObjectFromSdrObjList( pSourceObj->GetNavigationPosition() );
if( !bUndo )
- SdrObject::Free( pSourceObj );
+ {
+ deleteSdrObjectSafeAndClearPointer( pSourceObj );
}
}
- else if((eObjKind == PRESOBJ_TEXT) && (pSourceObj->GetObjIdentifier() == OBJ_OUTLINETEXT) )
+ }
+ else if((o_eObjKind == PRESOBJ_TEXT) && (pSourceObj->GetObjIdentifier() == OBJ_OUTLINETEXT) )
{
// is there an outline shape we can use to replace empty subtitle shape?
- pNewObj = rPage.CreatePresObj(PRESOBJ_TEXT, bVertical, aRect);
+ pNewObj = rPage.CreatePresObj(PRESOBJ_TEXT, bVertical, rRange);
// Text des Gliederungsobjekts in das PRESOBJ_TITLE setzen
OutlinerParaObject* pOutlParaObj = pSourceObj->GetOutlinerParaObject();
@@ -2190,16 +2223,16 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
if(pOutlParaObj)
{
// Text umsetzen
- ::sd::Outliner* pOutl = pModel->GetInternalOutliner();
+ ::sd::Outliner* pOutl = rLocalDrawModel.GetInternalOutliner();
pOutl->Clear();
pOutl->SetText( *pOutlParaObj );
pOutlParaObj = pOutl->CreateParaObject();
pNewObj->SetOutlinerParaObject( pOutlParaObj );
pOutl->Clear();
- pNewObj->SetEmptyPresObj(sal_False);
+ pNewObj->SetEmptyPresObj(false);
// Linken Einzug zuruecksetzen
- SfxItemSet aSet(pModel->GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+ SfxItemSet aSet(pNewObj->GetObjectItemPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
aSet.Put(pNewObj->GetMergedItemSet());
@@ -2212,26 +2245,28 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
SfxStyleSheet* pSheet = rPage.GetStyleSheetForPresObj(PRESOBJ_TEXT);
if (pSheet)
- pNewObj->SetStyleSheet(pSheet, sal_True);
+ pNewObj->SetStyleSheet(pSheet, true);
// Remove subtitle shape from page
if( bUndo )
- pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pSourceObj));
+ pUndoManager->AddUndoAction(rLocalDrawModel.GetSdrUndoFactory().CreateUndoDeleteObject(*pSourceObj));
- rPage.RemoveObject( pSourceObj->GetOrdNum() );
+ rPage.RemoveObjectFromSdrObjList( pSourceObj->GetNavigationPosition() );
if( !bUndo )
- SdrObject::Free( pSourceObj );
+ {
+ deleteSdrObjectSafeAndClearPointer( pSourceObj );
+ }
}
}
- else if((eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() != OBJ_OUTLINETEXT) )
+ else if((o_eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() != OBJ_OUTLINETEXT) )
{
switch( pSourceObj->GetObjIdentifier() )
{
- case OBJ_TABLE: eObjKind = PRESOBJ_TABLE; break;
- case OBJ_MEDIA: eObjKind = PRESOBJ_MEDIA; break;
- case OBJ_GRAF: eObjKind = PRESOBJ_GRAPHIC; break;
- case OBJ_OLE2: eObjKind = PRESOBJ_OBJECT; break;
+ case OBJ_TABLE: o_eObjKind = PRESOBJ_TABLE; break;
+ case OBJ_MEDIA: o_eObjKind = PRESOBJ_MEDIA; break;
+ case OBJ_GRAF: o_eObjKind = PRESOBJ_GRAPHIC; break;
+ case OBJ_OLE2: o_eObjKind = PRESOBJ_OBJECT; break;
}
}
@@ -2247,41 +2282,41 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
looking for an existing presentation shape
@param bVertical
If true, the shape is created vertical if bInit is true
- @param aRect
+ @param rRange
The rectangle that should be used to transform the shape
@param bInit
If true the shape is created if not found
@returns
A presentation shape that was either found or created with the given parameters
*/
-SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind, bool bVertical, Rectangle aRect, bool bInit )
+SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind, bool bVertical, const basegfx::B2DRange& rRange, bool bInit )
{
- ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoManager = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetUndoManager();
const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted();
if (!pObj && bInit)
{
- pObj = CreatePresObj(eObjKind, bVertical, aRect);
+ pObj = CreatePresObj(eObjKind, bVertical, rRange);
}
- else if ( pObj && (pObj->GetUserCall() || bInit) )
+ else if ( pObj && (findConnectionToSdrObject(pObj) || bInit) )
{
// convert object if shape type does not match kind (f.e. converting outline text to subtitle text)
if( bInit )
- pObj = convertPresentationObjectImpl( *this, pObj, eObjKind, bVertical, aRect );
+ {
+ // CAUTION! This call may change eObjKind which is given by reference
+ pObj = convertPresentationObjectImpl( *this, pObj, eObjKind, bVertical, rRange );
+ }
if( bUndo )
{
- pUndoManager->AddUndoAction( pModel->GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
- pUndoManager->AddUndoAction( pModel->GetSdrUndoFactory().CreateUndoAttrObject( *pObj, sal_True, sal_True ) );
- pUndoManager->AddUndoAction( new UndoObjectUserCall( *pObj ) );
+ pUndoManager->AddUndoAction( getSdrModelFromSdrPage().GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
+ pUndoManager->AddUndoAction( getSdrModelFromSdrPage().GetSdrUndoFactory().CreateUndoAttrObject( *pObj, true, true ) );
+ pUndoManager->AddUndoAction( new UndoConnectionToSdrObject( *pObj ) );
}
-// if ( pObj->ISA(SdrGrafObj) && !pObj->IsEmptyPresObj() )
- ( /*(SdrGrafObj*)*/ pObj)->AdjustToMaxRect( aRect );
-// else
-// SetLogicRect( pObj, aRect );
+ pObj->AdjustToMaxRange( rRange );
- pObj->SetUserCall(this);
+ establishConnectionToSdrObject(pObj, this);
SdrTextObj* pTextObject = dynamic_cast< SdrTextObj* >(pObj);
if( pTextObject )
@@ -2301,16 +2336,16 @@ SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind,
if ( pTextObject->IsAutoGrowHeight() )
{
// switch off AutoGrowHeight, set new MinHeight
- SfxItemSet aTempAttr( ((SdDrawDocument*) pModel)->GetPool() );
- SdrTextMinFrameHeightItem aMinHeight( aRect.GetSize().Height() );
+ SfxItemSet aTempAttr(pTextObject->GetObjectItemPool());
+ SdrMetricItem aMinHeight(SDRATTR_TEXT_MINFRAMEHEIGHT, basegfx::fround(rRange.getHeight()) );
aTempAttr.Put( aMinHeight );
- aTempAttr.Put( SdrTextAutoGrowHeightItem(sal_False) );
+ aTempAttr.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false) );
pTextObject->SetMergedItemSet(aTempAttr);
- pTextObject->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pTextObject, rRange);
// switch on AutoGrowHeight
- SfxItemSet aAttr( ((SdDrawDocument*) pModel)->GetPool() );
- aAttr.Put( SdrTextAutoGrowHeightItem(sal_True) );
+ SfxItemSet aAttr(pTextObject->GetObjectItemPool());
+ aAttr.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true) );
pTextObject->SetMergedItemSet(aAttr);
}
@@ -2318,16 +2353,16 @@ SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind,
if ( pTextObject->IsAutoGrowWidth() )
{
// switch off AutoGrowWidth , set new MinWidth
- SfxItemSet aTempAttr( ((SdDrawDocument*) pModel)->GetPool() );
- SdrTextMinFrameWidthItem aMinWidth( aRect.GetSize().Width() );
+ SfxItemSet aTempAttr(pTextObject->GetObjectItemPool());
+ SdrMetricItem aMinWidth(SDRATTR_TEXT_MINFRAMEWIDTH, basegfx::fround(rRange.getWidth()));
aTempAttr.Put( aMinWidth );
- aTempAttr.Put( SdrTextAutoGrowWidthItem(sal_False) );
+ aTempAttr.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false) );
pTextObject->SetMergedItemSet(aTempAttr);
- pTextObject->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pTextObject, rRange);
// switch on AutoGrowWidth
- SfxItemSet aAttr( ((SdDrawDocument*) pModel)->GetPool() );
- aAttr.Put( SdrTextAutoGrowWidthItem(sal_True) );
+ SfxItemSet aAttr(pTextObject->GetObjectItemPool());
+ aAttr.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true) );
pTextObject->SetMergedItemSet(aAttr);
}
}
@@ -2348,8 +2383,8 @@ SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind,
if( bVertical && (( eObjKind == PRESOBJ_TITLE) || (eObjKind == PRESOBJ_OUTLINE)))
{
SfxItemSet aNewSet(pObj->GetMergedItemSet());
- aNewSet.Put( SdrTextAutoGrowWidthItem(sal_True) );
- aNewSet.Put( SdrTextAutoGrowHeightItem(sal_False) );
+ aNewSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true) );
+ aNewSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false) );
if( eObjKind == PRESOBJ_OUTLINE )
{
aNewSet.Put( SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP) );
@@ -2359,8 +2394,13 @@ SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind,
}
}
- if ( pObj && (pObj->GetUserCall() || bInit) && ( pObj->IsEmptyPresObj() || !pObj->ISA(SdrGrafObj) ) )
- pObj->AdjustToMaxRect( aRect );
+ if(pObj && (pObj->IsEmptyPresObj() || !dynamic_cast< SdrGrafObj* >(pObj)))
+ {
+ if(bInit || findConnectionToSdrObject(pObj))
+ {
+ pObj->AdjustToMaxRange( rRange );
+ }
+ }
return pObj;
}
@@ -2372,10 +2412,11 @@ SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind,
|*
\************************************************************************/
-PresObjKind SdPage::GetPresObjKind(SdrObject* pObj) const
+PresObjKind SdPage::GetPresObjKind(const SdrObject* pObj) const
{
PresObjKind eKind = PRESOBJ_NONE;
- if( (pObj != 0) && (maPresentationShapeList.hasShape(*pObj)) )
+
+ if( pObj && maPresentationShapeList.hasShape(*pObj) )
{
SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj);
if( pInfo )
@@ -2424,24 +2465,25 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO
{
if ( pObj )
{
- DBG_ASSERT( pObj->ISA(SdrTextObj), "SetObjText: Kein SdrTextObj!" );
+ DBG_ASSERT( dynamic_cast< SdrTextObj* >(pObj), "SetObjText: Kein SdrTextObj!" );
::Outliner* pOutl = pOutliner;
if (!pOutliner)
{
- SfxItemPool* pPool = ((SdDrawDocument*) GetModel())->GetDrawOutliner().GetEmptyItemSet().GetPool();
+ SdDrawDocument& rSdDrawDocument = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage());
+ SfxItemPool* pPool = rSdDrawDocument.GetDrawOutliner().GetEmptyItemSet().GetPool();
pOutl = new ::Outliner( pPool, OUTLINERMODE_OUTLINEOBJECT );
- pOutl->SetRefDevice( SD_MOD()->GetRefDevice( *( (SdDrawDocument*) GetModel() )->GetDocSh() ) );
+ pOutl->SetRefDevice( SD_MOD()->GetRefDevice( *rSdDrawDocument.GetDocSh() ) );
pOutl->SetEditTextObjectPool(pPool);
- pOutl->SetStyleSheetPool((SfxStyleSheetPool*)GetModel()->GetStyleSheetPool());
- pOutl->EnableUndo(sal_False);
- pOutl->SetUpdateMode( sal_False );
+ pOutl->SetStyleSheetPool(dynamic_cast< SfxStyleSheetPool* >(rSdDrawDocument.GetStyleSheetPool()));
+ pOutl->EnableUndo(false);
+ pOutl->SetUpdateMode( false );
}
sal_uInt16 nOutlMode = pOutl->GetMode();
Size aPaperSize = pOutl->GetPaperSize();
- sal_Bool bUpdateMode = pOutl->GetUpdateMode();
- pOutl->SetUpdateMode(sal_False);
+ bool bUpdateMode = pOutl->GetUpdateMode();
+ pOutl->SetUpdateMode(false);
pOutl->SetParaAttribs( 0, pOutl->GetEmptyItemSet() );
// #95114# Always set the object's StyleSheet at the Outliner to
@@ -2536,7 +2578,7 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO
break;
}
- pOutl->SetPaperSize( pObj->GetLogicRect().GetSize() );
+ pOutl->SetPaperSize( sdr::legacy::GetLogicRect(*pObj).GetSize() );
if( aString.Len() )
pOutl->SetText( aString, pOutl->GetParagraph( 0 ) );
@@ -2604,11 +2646,12 @@ const String& SdPage::GetName() const
if ((mePageKind == PK_STANDARD || mePageKind == PK_NOTES) && !mbMaster)
{
// default name for handout pages
- sal_uInt16 nNum = (GetPageNum() + 1) / 2;
+ sal_uInt32 nNum = (GetPageNumber() + 1) / 2;
aCreatedPageName = String(SdResId(STR_PAGE));
aCreatedPageName += sal_Unicode( ' ' );
- if( GetModel()->GetPageNumType() == SVX_NUMBER_NONE )
+
+ if( SVX_NUMBER_NONE == getSdrModelFromSdrPage().GetPageNumType() )
{
// if the document has number none as a formating
// for page numbers we still default to arabic numbering
@@ -2617,7 +2660,7 @@ const String& SdPage::GetName() const
}
else
{
- aCreatedPageName += ((SdDrawDocument*) GetModel())->CreatePageNumValue(nNum);
+ aCreatedPageName += static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).CreatePageNumValue(nNum);
}
}
else
@@ -2782,7 +2825,7 @@ void SdPage::SetName (const String& rName)
{
String aOldName = GetName();
FmFormPage::SetName (rName);
- static_cast<SdDrawDocument*>(pModel)->UpdatePageRelativeURLs(aOldName, rName);
+ static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).UpdatePageRelativeURLs(aOldName, rName);
ActionChanged();
}
@@ -2830,8 +2873,8 @@ bool SdPage::checkVisibility(
const SdrPage* pVisualizedPage = GetSdrPageFromXDrawPage(rOriginal.GetObjectContact().getViewInformation2D().getVisualizedPage());
const bool bIsPrinting(rOriginal.GetObjectContact().isOutputToPrinter() || rOriginal.GetObjectContact().isOutputToPDFFile());
- const SdrPageView* pPageView = rOriginal.GetObjectContact().TryToGetSdrPageView();
- const bool bIsInsidePageObj(pPageView && pPageView->GetPage() != pVisualizedPage);
+ const SdrView* pSdrView = rOriginal.GetObjectContact().TryToGetSdrView();
+ const bool bIsInsidePageObj(pSdrView && pSdrView->GetSdrPageView() && &pSdrView->GetSdrPageView()->getSdrPageFromSdrPageView() != pVisualizedPage);
// empty presentation objects only visible during edit mode
if( (bIsPrinting || !bEdit || bIsInsidePageObj ) && pObj->IsEmptyPresObj() )
@@ -2842,7 +2885,7 @@ bool SdPage::checkVisibility(
if( ( pObj->GetObjInventor() == SdrInventor ) && ( pObj->GetObjIdentifier() == OBJ_TEXT ) )
{
- const SdPage* pCheckPage = dynamic_cast< const SdPage* >(pObj->GetPage());
+ const SdPage* pCheckPage = dynamic_cast< const SdPage* >(pObj->getSdrPageFromSdrObject());
if( pCheckPage )
{
@@ -2889,7 +2932,7 @@ bool SdPage::checkVisibility(
// i63977, do not print SdrpageObjs from master pages
if( ( pObj->GetObjInventor() == SdrInventor ) && ( pObj->GetObjIdentifier() == OBJ_PAGE ) )
{
- if( pObj->GetPage() && pObj->GetPage()->IsMasterPage() )
+ if( pObj->getSdrPageFromSdrObject() && pObj->getSdrPageFromSdrObject()->IsMasterPage() )
return false;
}
@@ -2915,7 +2958,7 @@ bool SdPage::RestoreDefaultText( SdrObject* pObj )
if (aString.Len())
{
- sal_Bool bVertical = sal_False;
+ bool bVertical = false;
OutlinerParaObject* pOldPara = pTextObj->GetOutlinerParaObject();
if( pOldPara )
bVertical = pOldPara->IsVertical(); // is old para object vertical?
@@ -2934,15 +2977,15 @@ bool SdPage::RestoreDefaultText( SdrObject* pObj )
&& pTextObj->GetOutlinerParaObject()
&& pTextObj->GetOutlinerParaObject()->IsVertical() != (bool)bVertical)
{
- Rectangle aObjectRect = pTextObj->GetSnapRect();
+ const Rectangle aObjectRect(sdr::legacy::GetSnapRect(*pTextObj));
pTextObj->GetOutlinerParaObject()->SetVertical(bVertical);
- pTextObj->SetSnapRect(aObjectRect);
+ sdr::legacy::SetSnapRect(*pTextObj, aObjectRect);
}
}
pTextObj->SetTextEditOutliner( NULL ); // to make stylesheet settings work
- pTextObj->NbcSetStyleSheet( GetStyleSheetForPresObj(ePresObjKind), sal_True );
- pTextObj->SetEmptyPresObj(sal_True);
+ pTextObj->SetStyleSheet( GetStyleSheetForPresObj(ePresObjKind), true );
+ pTextObj->SetEmptyPresObj(true);
bRet = true;
}
}
@@ -2950,45 +2993,46 @@ bool SdPage::RestoreDefaultText( SdrObject* pObj )
return bRet;
}
-void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< Rectangle >& rAreas )
+void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, bool bHorizontal, std::vector< basegfx::B2DRange >& rAreas )
{
SdPage& rHandoutMaster = *rModel.GetMasterSdPage( 0, PK_HANDOUT );
- if( eLayout == AUTOLAYOUT_NONE )
+ if(AUTOLAYOUT_NONE == eLayout)
{
// use layout from handout master
SdrObjListIter aShapeIter (rHandoutMaster);
+
while (aShapeIter.IsMore())
{
SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>(aShapeIter.Next());
+
if (pPageObj)
- rAreas.push_back( pPageObj->GetCurrentBoundRect() );
+ {
+ rAreas.push_back(pPageObj->getObjectRange(0));
+ }
}
}
else
{
- Size aArea = rHandoutMaster.GetSize();
+ const double fGapW(1000.0); // gap is 1cm
+ const double fGapH(1000.0);
+ const double fLeftBorder(rHandoutMaster.GetLeftPageBorder());
+ const double fRightBorder(rHandoutMaster.GetRightPageBorder());
+ double fTopBorder(rHandoutMaster.GetTopPageBorder());
+ double fBottomBorder(rHandoutMaster.GetBottomPageBorder());
+ basegfx::B2DVector aArea(rHandoutMaster.GetPageScale());
+ const double fHeaderFooterHeight((aArea.getY() - fTopBorder - fLeftBorder) * 0.05);
- const long nGapW = 1000; // gap is 1cm
- const long nGapH = 1000;
+ fTopBorder += fHeaderFooterHeight;
+ fBottomBorder += fHeaderFooterHeight;
- long nLeftBorder = rHandoutMaster.GetLftBorder();
- long nRightBorder = rHandoutMaster.GetRgtBorder();
- long nTopBorder = rHandoutMaster.GetUppBorder();
- long nBottomBorder = rHandoutMaster.GetLwrBorder();
+ double fX(fGapW + fLeftBorder);
+ double fY(fGapH + fTopBorder);
- const long nHeaderFooterHeight = static_cast< long >( (aArea.Height() - nTopBorder - nLeftBorder) * 0.05 );
+ aArea.setX(aArea.getX() - (fGapW * 2.0 + fLeftBorder + fRightBorder));
+ aArea.setY(aArea.getY() - (fGapH * 2.0 + fTopBorder + fBottomBorder));
- nTopBorder += nHeaderFooterHeight;
- nBottomBorder += nHeaderFooterHeight;
-
- long nX = nGapW + nLeftBorder;
- long nY = nGapH + nTopBorder;
-
- aArea.Width() -= nGapW * 2 + nLeftBorder + nRightBorder;
- aArea.Height() -= nGapH * 2 + nTopBorder + nBottomBorder;
-
- const bool bLandscape = aArea.Width() > aArea.Height();
+ const bool bLandscape(aArea.getX() > aArea.getY());
static sal_uInt16 aOffsets[5][9] =
{
@@ -3000,7 +3044,9 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout,
};
sal_uInt16* pOffsets = aOffsets[0];
- sal_uInt16 nColCnt = 0, nRowCnt = 0;
+ sal_uInt16 nColCnt(0);
+ sal_uInt16 nRowCnt(0);
+
switch ( eLayout )
{
case AUTOLAYOUT_HANDOUT1:
@@ -3057,56 +3103,57 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout,
break;
}
- rAreas.resize( nColCnt * nRowCnt );
-
- Size aPartArea, aSize;
- aPartArea.Width() = ((aArea.Width() - ((nColCnt-1) * nGapW) ) / nColCnt);
- aPartArea.Height() = ((aArea.Height() - ((nRowCnt-1) * nGapH) ) / nRowCnt);
-
+ const basegfx::B2DVector aPartArea(
+ (aArea.getX() - ((nColCnt - 1) * fGapW) ) / nColCnt,
+ (aArea.getY() - ((nRowCnt - 1) * fGapH) ) / nRowCnt);
+ basegfx::B2DVector aSize(0.0, 0.0);
SdrPage* pFirstPage = rModel.GetMasterSdPage(0, PK_STANDARD);
+
if ( pFirstPage )
{
// scale actual size into handout rect
- double fScale = (double)aPartArea.Width() / (double)pFirstPage->GetWdt();
+ double fScale = aPartArea.getX() / pFirstPage->GetPageScale().getX();
- aSize.Height() = (long)(fScale * pFirstPage->GetHgt() );
- if( aSize.Height() > aPartArea.Height() )
+ aSize.setY(fScale * pFirstPage->GetPageScale().getY());
+
+ if( aSize.getY() > aPartArea.getY() )
{
- fScale = (double)aPartArea.Height() / (double)pFirstPage->GetHgt();
- aSize.Height() = aPartArea.Height();
- aSize.Width() = (long)(fScale * pFirstPage->GetWdt());
+ fScale = aPartArea.getY() / pFirstPage->GetPageScale().getY();
+ aSize.setY(aPartArea.getY());
+ aSize.setX(fScale * pFirstPage->GetPageScale().getX());
}
else
{
- aSize.Width() = aPartArea.Width();
+ aSize.setX(aPartArea.getX());
}
- nX += (aPartArea.Width() - aSize.Width()) / 2;
- nY += (aPartArea.Height()- aSize.Height())/ 2;
+ fX += (aPartArea.getX() - aSize.getX()) * 0.5;
+ fY += (aPartArea.getY()- aSize.getY()) * 0.5;
}
else
{
aSize = aPartArea;
}
- Point aPos( nX, nY );
-
- const bool bRTL = rModel.GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB;
+ basegfx::B2DPoint aPos( fX, fY );
+ const bool bRTL(rModel.GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB);
+ const double fOffsetX((aPartArea.getX() + fGapW) * (bRTL ? -1.0 : 1.0));
+ const double fOffsetY(aPartArea.getY() + fGapH);
+ const double fStartX(bRTL ? fOffsetX * (1.0 - nColCnt) - fX : fX);
- const long nOffsetX = (aPartArea.Width() + nGapW) * (bRTL ? -1 : 1);
- const long nOffsetY = aPartArea.Height() + nGapH;
- const long nStartX = bRTL ? nOffsetX*(1 - nColCnt) - nX : nX;
+ rAreas.resize( nColCnt * nRowCnt );
for(sal_uInt16 nRow = 0; nRow < nRowCnt; nRow++)
{
- aPos.X() = nStartX;
+ aPos.setX(fStartX);
+
for(sal_uInt16 nCol = 0; nCol < nColCnt; nCol++)
{
- rAreas[*pOffsets++] = Rectangle(aPos, aSize);
- aPos.X() += nOffsetX;
+ rAreas[*pOffsets++] = basegfx::B2DRange(aPos, aPos + aSize);
+ aPos.setX(aPos.getX() + fOffsetX);
}
- aPos.Y() += nOffsetY;
+ aPos.setY(aPos.getY() + fOffsetY);
}
}
}
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 99f87c1433e3..2f747469e9ec 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -72,20 +72,20 @@ extern void NotifyDocumentEvent( SdDrawDocument* pDocument, const rtl::OUString&
|* - Die entsprechenden StyleSheets muessen bereits im
|* im StyleSheetPool sein.
|*
-|* bReplaceStyleSheets = sal_True : Benannte StyleSheets werden ausgetauscht
-|* sal_False: Alle StyleSheets werden neu zugewiesen
+|* bReplaceStyleSheets = true : Benannte StyleSheets werden ausgetauscht
+|* false: Alle StyleSheets werden neu zugewiesen
|*
-|* bSetMasterPage = sal_True : MasterPage suchen und zuweisen
+|* bSetMasterPage = true : MasterPage suchen und zuweisen
|*
-|* bReverseOrder = sal_False: MasterPages von vorn nach hinten suchen
-|* sal_True : MasterPages von hinten nach vorn suchen (fuer Undo-Action)
+|* bReverseOrder = false: MasterPages von vorn nach hinten suchen
+|* true : MasterPages von hinten nach vorn suchen (fuer Undo-Action)
|*
\************************************************************************/
void SdPage::SetPresentationLayout(const String& rLayoutName,
- sal_Bool bReplaceStyleSheets,
- sal_Bool bSetMasterPage,
- sal_Bool bReverseOrder)
+ bool bReplaceStyleSheets,
+ bool bSetMasterPage,
+ bool bReverseOrder)
{
/*********************************************************************
|* Layoutname der Seite
@@ -102,14 +102,14 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
{
SdPage* pMaster;
SdPage* pFoundMaster = 0;
- sal_uInt16 nMaster = 0;
- sal_uInt16 nMasterCount = pModel->GetMasterPageCount();
+ sal_uInt32 nMaster = 0;
+ sal_uInt32 nMasterCount = getSdrModelFromSdrPage().GetMasterPageCount();
if( !bReverseOrder )
{
for ( nMaster = 0; nMaster < nMasterCount; nMaster++ )
{
- pMaster = static_cast<SdPage*>(pModel->GetMasterPage(nMaster));
+ pMaster = static_cast< SdPage* >(getSdrModelFromSdrPage().GetMasterPage(nMaster));
if (pMaster->GetPageKind() == mePageKind && pMaster->GetLayoutName() == maLayoutName)
{
pFoundMaster = pMaster;
@@ -121,7 +121,7 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
{
for ( nMaster = nMasterCount; nMaster > 0; nMaster-- )
{
- pMaster = static_cast<SdPage*>(pModel->GetMasterPage(nMaster - 1));
+ pMaster = static_cast< SdPage* >(getSdrModelFromSdrPage().GetMasterPage(nMaster - 1));
if (pMaster->GetPageKind() == mePageKind && pMaster->GetLayoutName() == maLayoutName)
{
pFoundMaster = pMaster;
@@ -134,7 +134,7 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
// this should never happen, but we play failsafe here
if( pFoundMaster == 0 )
- pFoundMaster = static_cast< SdDrawDocument *>(pModel)->GetSdPage( 0, mePageKind );
+ pFoundMaster = static_cast< SdDrawDocument &>(getSdrModelFromSdrPage()).GetSdPage( 0, mePageKind );
if( pFoundMaster )
TRG_SetMasterPage(*pFoundMaster);
@@ -149,11 +149,11 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
List aOutlineStyles;
List aOldOutlineStyles;
List aReplList;
- sal_Bool bListsFilled = sal_False;
+ bool bListsFilled = false;
- sal_uLong nObjCount = GetObjCount();
+ sal_uInt32 nObjCount = GetObjCount();
- for (sal_uLong nObj = 0; nObj < nObjCount; nObj++)
+ for (sal_uInt32 nObj = 0; nObj < nObjCount; nObj++)
{
SdrTextObj* pObj = (SdrTextObj*) GetObj(nObj);
@@ -165,7 +165,7 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
String aFullName;
String aOldFullName;
SfxStyleSheetBase* pSheet = NULL;
- SfxStyleSheetBasePool* pStShPool = pModel->GetStyleSheetPool();
+ SfxStyleSheetBasePool* pStShPool = getSdrModelFromSdrPage().GetStyleSheetPool();
for (sal_Int16 i = -1; i < 9; i++)
{
@@ -203,7 +203,7 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
}
}
- bListsFilled = sal_True;
+ bListsFilled = true;
}
SfxStyleSheet* pSheet = (SfxStyleSheet*)aOutlineStyles.First();
@@ -243,18 +243,18 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
SfxStyleSheet* pSheet = GetStyleSheetForPresObj(PRESOBJ_TITLE);
if (pSheet)
- pObj->SetStyleSheet(pSheet, sal_True);
+ pObj->SetStyleSheet(pSheet, true);
}
else
{
SfxStyleSheet* pSheet = GetStyleSheetForPresObj(GetPresObjKind(pObj));
if (pSheet)
- pObj->SetStyleSheet(pSheet, sal_True);
+ pObj->SetStyleSheet(pSheet, true);
}
}
- for (sal_uLong i = 0; i < aReplList.Count(); i++)
+ for (sal_uInt32 i = 0; i < aReplList.Count(); i++)
{
delete (StyleReplaceData*) aReplList.GetObject(i);
}
@@ -274,7 +274,7 @@ void SdPage::EndListenOutlineText()
if (pOutlineTextObj)
{
- SdStyleSheetPool* pSPool = (SdStyleSheetPool*)pModel->GetStyleSheetPool();
+ SdStyleSheetPool* pSPool = dynamic_cast< SdStyleSheetPool* >(getSdrModelFromSdrPage().GetStyleSheetPool());
DBG_ASSERT(pSPool, "StyleSheetPool nicht gefunden");
String aTrueLayoutName(maLayoutName);
aTrueLayoutName.Erase( aTrueLayoutName.SearchAscii( SD_LT_SEPARATOR ));
@@ -292,50 +292,24 @@ void SdPage::EndListenOutlineText()
/*************************************************************************
|*
-|* Neues Model setzen
-|*
-\************************************************************************/
-
-void SdPage::SetModel(SdrModel* pNewModel)
-{
- DisconnectLink();
-
- // Model umsetzen
- FmFormPage::SetModel(pNewModel);
-
- ConnectLink();
-}
-
-/*************************************************************************
-|*
-|* Ist die Seite read-only?
-|*
-\************************************************************************/
-
-FASTBOOL SdPage::IsReadOnly() const
-{
- return sal_False;
-}
-
-/*************************************************************************
-|*
|* Beim sfx2::LinkManager anmelden
|*
\************************************************************************/
void SdPage::ConnectLink()
{
- sfx2::LinkManager* pLinkManager = pModel!=NULL ? pModel->GetLinkManager() : NULL;
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrPage().GetLinkManager();
+ SdDrawDocument& rSdDrawDocument = static_cast< SdDrawDocument& >(getSdrModelFromSdrPage());
if (pLinkManager && !mpPageLink && maFileName.Len() && maBookmarkName.Len() &&
mePageKind==PK_STANDARD && !IsMasterPage() &&
- ( (SdDrawDocument*) pModel)->IsNewOrLoadCompleted())
+ rSdDrawDocument.IsNewOrLoadCompleted())
{
/**********************************************************************
* Anmelden
* Nur Standardseiten duerfen gelinkt sein
**********************************************************************/
- ::sd::DrawDocShell* pDocSh = ((SdDrawDocument*) pModel)->GetDocSh();
+ ::sd::DrawDocShell* pDocSh = rSdDrawDocument.GetDocSh();
if (!pDocSh || pDocSh->GetMedium()->GetOrigURL() != maFileName)
{
@@ -358,7 +332,7 @@ void SdPage::ConnectLink()
void SdPage::DisconnectLink()
{
- sfx2::LinkManager* pLinkManager = pModel!=NULL ? pModel->GetLinkManager() : NULL;
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrPage().GetLinkManager();
if (pLinkManager && mpPageLink)
{
@@ -377,85 +351,47 @@ void SdPage::DisconnectLink()
|*
\************************************************************************/
-SdPage::SdPage(const SdPage& rSrcPage)
-: FmFormPage(rSrcPage)
-, SdrObjUserCall()
-, mpItems(NULL)
-{
- mePageKind = rSrcPage.mePageKind;
- meAutoLayout = rSrcPage.meAutoLayout;
-
- SdrObject* pObj = 0;
- while((pObj = rSrcPage.maPresentationShapeList.getNextShape(pObj)) != 0)
- InsertPresObj(GetObj(pObj->GetOrdNum()), rSrcPage.GetPresObjKind(pObj));
-
- mbSelected = sal_False;
- mnTransitionType = rSrcPage.mnTransitionType;
- mnTransitionSubtype = rSrcPage.mnTransitionSubtype;
- mbTransitionDirection = rSrcPage.mbTransitionDirection;
- mnTransitionFadeColor = rSrcPage.mnTransitionFadeColor;
- mfTransitionDuration = rSrcPage.mfTransitionDuration;
- mePresChange = rSrcPage.mePresChange;
- mnTime = rSrcPage.mnTime;
- mbSoundOn = rSrcPage.mbSoundOn;
- mbExcluded = rSrcPage.mbExcluded;
-
- maLayoutName = rSrcPage.maLayoutName;
- maSoundFile = rSrcPage.maSoundFile;
- mbLoopSound = rSrcPage.mbLoopSound;
- mbStopSound = rSrcPage.mbStopSound;
- maCreatedPageName = String();
- maFileName = rSrcPage.maFileName;
- maBookmarkName = rSrcPage.maBookmarkName;
- mbScaleObjects = rSrcPage.mbScaleObjects;
- mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize;
- meCharSet = rSrcPage.meCharSet;
- mnPaperBin = rSrcPage.mnPaperBin;
- meOrientation = rSrcPage.meOrientation;
-
- // header footer
- setHeaderFooterSettings( rSrcPage.getHeaderFooterSettings() );
-
- mpPageLink = NULL; // Wird beim Einfuegen ueber ConnectLink() gesetzt
-}
-
-
-
-/*************************************************************************
-|*
-|* Clone
-|*
-\************************************************************************/
-
-SdrPage* SdPage::Clone() const
-{
- return Clone(NULL);
-}
-
-SdrPage* SdPage::Clone(SdrModel* pNewModel) const
-{
- DBG_ASSERT( pNewModel == 0, "sd::SdPage::Clone(), new page ignored, please check code! CL" );
- (void)pNewModel;
-
- SdPage* pNewPage = new SdPage(*this);
-
- cloneAnimations( *pNewPage );
-
- // fix user calls for duplicated slide
- SdrObjListIter aSourceIter( *this, IM_DEEPWITHGROUPS );
- SdrObjListIter aTargetIter( *pNewPage, IM_DEEPWITHGROUPS );
-
- while( aSourceIter.IsMore() && aTargetIter.IsMore() )
- {
- SdrObject* pSource = aSourceIter.Next();
- SdrObject* pTarget = aTargetIter.Next();
-
- if( pSource->GetUserCall() )
- pTarget->SetUserCall( pNewPage );
- }
-
- return pNewPage;
-}
+//SdPage::SdPage(const SdPage& rSrcPage)
+//: FmFormPage(rSrcPage)
+//, SfxListener()
+//, mpItems(NULL)
+//{
+// mePageKind = rSrcPage.mePageKind;
+// meAutoLayout = rSrcPage.meAutoLayout;
+//
+// const SdrObject* pObj = 0;
+// while((pObj = rSrcPage.maPresentationShapeList.getNextShape(pObj)) != 0)
+// InsertPresObj(GetObj(pObj->GetNavigationPosition()), rSrcPage.GetPresObjKind(pObj));
+//
+// mbSelected = false;
+// mnTransitionType = rSrcPage.mnTransitionType;
+// mnTransitionSubtype = rSrcPage.mnTransitionSubtype;
+// mbTransitionDirection = rSrcPage.mbTransitionDirection;
+// mnTransitionFadeColor = rSrcPage.mnTransitionFadeColor;
+// mfTransitionDuration = rSrcPage.mfTransitionDuration;
+// mePresChange = rSrcPage.mePresChange;
+// mnTime = rSrcPage.mnTime;
+// mbSoundOn = rSrcPage.mbSoundOn;
+// mbExcluded = rSrcPage.mbExcluded;
+//
+// maLayoutName = rSrcPage.maLayoutName;
+// maSoundFile = rSrcPage.maSoundFile;
+// mbLoopSound = rSrcPage.mbLoopSound;
+// mbStopSound = rSrcPage.mbStopSound;
+// maCreatedPageName = String();
+// maFileName = rSrcPage.maFileName;
+// maBookmarkName = rSrcPage.maBookmarkName;
+// mbScaleObjects = rSrcPage.mbScaleObjects;
+// mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize;
+// meCharSet = rSrcPage.meCharSet;
+// mnPaperBin = rSrcPage.mnPaperBin;
+// meOrientation = rSrcPage.meOrientation;
+//
+// // header footer
+// setHeaderFooterSettings( rSrcPage.getHeaderFooterSettings() );
+//
+// mpPageLink = NULL; // Wird beim Einfuegen ueber ConnectLink() gesetzt
+//}
/*************************************************************************
|*
@@ -477,8 +413,8 @@ SfxStyleSheet* SdPage::GetTextStyleSheetForObject( SdrObject* pObj ) const
SfxItemSet* SdPage::getOrCreateItems()
{
- if( mpItems == NULL )
- mpItems = new SfxItemSet( pModel->GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
+ if( !mpItems )
+ mpItems = new SfxItemSet( getSdrModelFromSdrPage().GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
return mpItems;
}
@@ -522,8 +458,8 @@ void SdPage::RemoveEmptyPresentationObjects()
{
if( pShape && pShape->IsEmptyPresObj() )
{
- RemoveObject( pShape->GetOrdNum() );
- SdrObject::Free( pShape );
+ RemoveObjectFromSdrObjList( pShape->GetNavigationPosition() );
+ deleteSdrObjectSafeAndClearPointer( pShape );
}
}
@@ -605,40 +541,33 @@ void SdPage::addAnnotation( const Reference< XAnnotation >& xAnnotation, int nIn
maAnnotations.insert( maAnnotations.begin() + nIndex, xAnnotation );
}
- if( pModel && pModel->IsUndoEnabled() )
+ if( getSdrModelFromSdrPage().IsUndoEnabled() )
{
SdrUndoAction* pAction = CreateUndoInsertOrRemoveAnnotation( xAnnotation, true );
if( pAction )
- pModel->AddUndo( pAction );
+ getSdrModelFromSdrPage().AddUndo( pAction );
}
SetChanged();
-
- if( pModel )
- {
- pModel->SetChanged();
+ getSdrModelFromSdrPage().SetChanged();
Reference< XInterface > xSource( xAnnotation, UNO_QUERY );
- NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAnnotationInserted" ) ), xSource );
- }
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( &getSdrModelFromSdrPage() ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAnnotationInserted" ) ), xSource );
}
void SdPage::removeAnnotation( const Reference< XAnnotation >& xAnnotation )
{
- if( pModel && pModel->IsUndoEnabled() )
+ if( getSdrModelFromSdrPage().IsUndoEnabled() )
{
SdrUndoAction* pAction = CreateUndoInsertOrRemoveAnnotation( xAnnotation, false );
if( pAction )
- pModel->AddUndo( pAction );
+ getSdrModelFromSdrPage().AddUndo( pAction );
}
AnnotationVector::iterator iter = std::find( maAnnotations.begin(), maAnnotations.end(), xAnnotation );
if( iter != maAnnotations.end() )
maAnnotations.erase( iter );
- if( pModel )
- {
- pModel->SetChanged();
+ getSdrModelFromSdrPage().SetChanged();
Reference< XInterface > xSource( xAnnotation, UNO_QUERY );
- NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAnnotationRemoved" ) ), xSource );
- }
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( &getSdrModelFromSdrPage() ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAnnotationRemoved" ) ), xSource );
}
diff --git a/sd/source/core/shapelist.cxx b/sd/source/core/shapelist.cxx
index 7f9b130bbf76..638633da6ec9 100644
--- a/sd/source/core/shapelist.cxx
+++ b/sd/source/core/shapelist.cxx
@@ -26,12 +26,13 @@
#include <tools/debug.hxx>
#include <svx/svdobj.hxx>
#include "shapelist.hxx"
-
#include <algorithm>
+#include <svx/svdmodel.hxx>
using namespace sd;
ShapeList::ShapeList()
+: SfxListener()
{
maIter = maShapeList.end();
}
@@ -42,13 +43,13 @@ ShapeList::~ShapeList()
}
/** adds the given shape to this list */
-void ShapeList::addShape( SdrObject& rObject )
+void ShapeList::addShape( const SdrObject& rObject )
{
ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rObject ) );
if( aIter == maShapeList.end() )
{
maShapeList.push_back(&rObject);
- rObject.AddObjectUser( *this );
+ StartListening(const_cast< SdrObject& >(rObject));
}
else
{
@@ -57,14 +58,14 @@ void ShapeList::addShape( SdrObject& rObject )
}
/** removes the given shape from this list */
-SdrObject* ShapeList::removeShape( SdrObject& rObject )
+const SdrObject* ShapeList::removeShape( const SdrObject& rObject )
{
ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rObject ) );
if( aIter != maShapeList.end() )
{
bool bIterErased = aIter == maIter;
- (*aIter)->RemoveObjectUser(*this);
+ EndListening(const_cast< SdrObject& >(rObject));
aIter = maShapeList.erase( aIter );
if( bIterErased )
@@ -85,11 +86,15 @@ SdrObject* ShapeList::removeShape( SdrObject& rObject )
void ShapeList::clear()
{
ListImpl aShapeList;
+
aShapeList.swap( maShapeList );
ListImpl::iterator aIter( aShapeList.begin() );
+
while( aIter != aShapeList.end() )
- (*aIter++)->RemoveObjectUser(*this);
+ {
+ EndListening(const_cast< SdrObject& >(**aIter++));
+ }
maIter = aShapeList.end();
}
@@ -101,12 +106,12 @@ bool ShapeList::isEmpty() const
}
/** returns true if given shape is part of this list */
-bool ShapeList::hasShape( SdrObject& rObject ) const
+bool ShapeList::hasShape( const SdrObject& rObject ) const
{
return std::find( maShapeList.begin(), maShapeList.end(), &rObject ) != maShapeList.end();
}
-SdrObject* ShapeList::getNextShape(SdrObject* pObj) const
+const SdrObject* ShapeList::getNextShape(const SdrObject* pObj) const
{
if( pObj )
{
@@ -128,9 +133,15 @@ SdrObject* ShapeList::getNextShape(SdrObject* pObj) const
return 0;
}
-void ShapeList::ObjectInDestruction(const SdrObject& rObject)
+// derived from SfxListener
+void ShapeList::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rObject ) );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrHint && HINT_SDROBJECTDYING == pSdrHint->GetSdrHintKind() && pSdrHint->GetSdrHintObject())
+ {
+ ListImpl::iterator aIter(std::find(maShapeList.begin(), maShapeList.end(), pSdrHint->GetSdrHintObject()));
+
if( aIter != maShapeList.end() )
{
bool bIterErased = aIter == maIter;
@@ -145,8 +156,9 @@ void ShapeList::ObjectInDestruction(const SdrObject& rObject)
DBG_ERROR("sd::ShapeList::ObjectInDestruction(), got a call from an unknown friend!");
}
}
+}
-SdrObject* ShapeList::getNextShape()
+const SdrObject* ShapeList::getNextShape()
{
if( maIter != maShapeList.end() )
{
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 1e3a1e5b937c..c70bcecca107 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -58,6 +58,7 @@
#include <editeng/lrspitem.hxx>
#include <editeng/adjitem.hxx>
#include <svl/itempool.hxx>
+#include <svx/xcolit.hxx>
#define _SDR_POSITIVE
#define _SDR_ITEMS
@@ -84,7 +85,7 @@ using namespace ::com::sun::star::container;
SdStyleSheetPool::SdStyleSheetPool(SfxItemPool const& _rPool, SdDrawDocument* pDocument)
: SdStyleSheetPoolBase( _rPool )
-, mpActualStyleSheet(NULL)
+, mxActualStyleSheet()
, mpDoc(pDocument)
{
if( mpDoc )
@@ -101,8 +102,8 @@ SdStyleSheetPool::SdStyleSheetPool(SfxItemPool const& _rPool, SdDrawDocument* pD
msTableFamilyName = xNamed->getName();
// create presentation families, one for each master page
- const sal_uInt16 nCount = mpDoc->GetMasterSdPageCount(PK_STANDARD);
- for( sal_uInt16 nPage = 0; nPage < nCount; ++nPage )
+ const sal_uInt32 nCount = mpDoc->GetMasterSdPageCount(PK_STANDARD);
+ for( sal_uInt32 nPage = 0; nPage < nCount; ++nPage )
AddStyleFamily( mpDoc->GetMasterSdPage(nPage,PK_STANDARD) );
// StartListening( *mpDoc );
@@ -244,15 +245,15 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rSet.Put( SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
rSet.Put( SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ) );
rSet.Put( SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
- rSet.Put( SvxShadowedItem(sal_False, EE_CHAR_SHADOW ) );
- rSet.Put( SvxContourItem(sal_False, EE_CHAR_OUTLINE ) );
+ rSet.Put( SvxShadowedItem(false, EE_CHAR_SHADOW ) );
+ rSet.Put( SvxContourItem(false, EE_CHAR_OUTLINE ) );
rSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
rSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF) );
rSet.Put( SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR) );
rSet.Put( XLineStyleItem(XLINE_NONE) );
rSet.Put( XFillStyleItem(XFILL_NONE) );
// #i16874# enable kerning by default but only for new documents
- rSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
+ rSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
if( nLevel == 1 )
{
@@ -310,7 +311,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
aSvxLRSpaceItem.SetTxtFirstLineOfst(nFirstIndent);
aSvxLRSpaceItem.SetTxtLeft(nIndent);
aSvxLRSpaceItem.SetRight(0);
- aSvxLRSpaceItem.SetBulletFI(sal_True);
+ aSvxLRSpaceItem.SetBulletFI(true);
pSheet->GetItemSet().Put(aSvxLRSpaceItem);
*/
// Zeilendurchschuss (Abstand nach unten)
@@ -383,8 +384,8 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rTitleSet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ));
rTitleSet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ));
rTitleSet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
- rTitleSet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW ));
- rTitleSet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE ));
+ rTitleSet.Put(SvxShadowedItem(false, EE_CHAR_SHADOW ));
+ rTitleSet.Put(SvxContourItem(false, EE_CHAR_OUTLINE ));
rTitleSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
rTitleSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF ) );
rTitleSet.Put(SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR ));
@@ -392,7 +393,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rTitleSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
// rTitleSet.Put( SfxUInt16Item(EE_PARA_BULLETSTATE, 0) );
// #i16874# enable kerning by default but only for new documents
- rTitleSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
+ rTitleSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
aBulletFont.SetSize(Size(0,1552)); // 44 pt
PutNumBulletItem( pSheet, aBulletFont );
@@ -429,8 +430,8 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rSubtitleSet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ));
rSubtitleSet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ));
rSubtitleSet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
- rSubtitleSet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW ));
- rSubtitleSet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE ));
+ rSubtitleSet.Put(SvxShadowedItem(false, EE_CHAR_SHADOW ));
+ rSubtitleSet.Put(SvxContourItem(false, EE_CHAR_OUTLINE ));
rSubtitleSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
rSubtitleSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF ) );
rSubtitleSet.Put(SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR ));
@@ -438,7 +439,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rSubtitleSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
// rSubtitleSet.Put( SfxUInt16Item(EE_PARA_BULLETSTATE, 0) );
// #i16874# enable kerning by default but only for new documents
- rSubtitleSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
+ rSubtitleSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
aSvxLRSpaceItem.SetTxtLeft(0);
rSubtitleSet.Put(aSvxLRSpaceItem);
@@ -478,15 +479,15 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rNotesSet.Put( SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
rNotesSet.Put( SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ) );
rNotesSet.Put( SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
- rNotesSet.Put( SvxShadowedItem(sal_False, EE_CHAR_SHADOW ) );
- rNotesSet.Put( SvxContourItem(sal_False, EE_CHAR_OUTLINE ) );
+ rNotesSet.Put( SvxShadowedItem(false, EE_CHAR_SHADOW ) );
+ rNotesSet.Put( SvxContourItem(false, EE_CHAR_OUTLINE ) );
rNotesSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
rNotesSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF) );
rNotesSet.Put( SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR ) );
// rNotesSet.Put( SfxUInt16Item(EE_PARA_BULLETSTATE, 0) );
rNotesSet.Put( SvxLRSpaceItem( 0, 0, 600, -600, EE_PARA_LRSPACE ) );
// #i16874# enable kerning by default but only for new documents
- rNotesSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
+ rNotesSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
/* #i35937#
SvxNumBulletItem aNumBullet( (const SvxNumBulletItem&) rNotesSet.Get(EE_PARA_NUMBULLET) );
@@ -513,12 +514,12 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_BACKGROUNDOBJECTS );
pSheet->SetParent(String());
SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet();
- rBackgroundObjectsSet.Put(SdrShadowItem(sal_False));
- rBackgroundObjectsSet.Put(SdrShadowColorItem(String(), Color(COL_GRAY)));
- rBackgroundObjectsSet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
- rBackgroundObjectsSet.Put(SdrShadowYDistItem(200));
+ rBackgroundObjectsSet.Put(SdrOnOffItem(SDRATTR_SHADOW, false));
+ rBackgroundObjectsSet.Put(XColorItem(SDRATTR_SHADOWCOLOR, String(), Color(COL_GRAY)));
+ rBackgroundObjectsSet.Put(SdrMetricItem(SDRATTR_SHADOWXDIST, 200)); // 3 mm Schattendistanz
+ rBackgroundObjectsSet.Put(SdrMetricItem(SDRATTR_SHADOWYDIST, 200));
// #i16874# enable kerning by default but only for new documents
- rBackgroundObjectsSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
+ rBackgroundObjectsSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
rBackgroundObjectsSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK));
}
@@ -539,7 +540,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bo
rBackgroundSet.Put(XLineStyleItem(XLINE_NONE));
rBackgroundSet.Put(XFillStyleItem(XFILL_NONE));
// #i16874# enable kerning by default but only for new documents
- rBackgroundSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
+ rBackgroundSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
}
DBG_ASSERT( !bCheck || !bCreated, "missing layout style sheets detected!" );
@@ -905,7 +906,7 @@ void SdStyleSheetPool::UpdateStdNames()
sal_uLong nHelpId = pStyle->GetHelpId( aHelpFile );
SfxStyleFamily eFam = pStyle->GetFamily();
- sal_Bool bHelpKnown = sal_True;
+ bool bHelpKnown = true;
String aNewName;
sal_uInt16 nNameId = 0;
switch( nHelpId )
@@ -951,7 +952,7 @@ void SdStyleSheetPool::UpdateStdNames()
default:
// 0 oder falsche (alte) HelpId
- bHelpKnown = sal_False;
+ bHelpKnown = false;
}
if( bHelpKnown )
{
@@ -1026,7 +1027,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
aNumberFormat.SetStart(1);
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , sal_False);
+ SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , false);
for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
{
@@ -1052,7 +1053,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
if(pDefaultRule)
{
- SvxNumRule aNumRule(pDefaultRule->GetFeatureFlags(), 10, sal_False);
+ SvxNumRule aNumRule(pDefaultRule->GetFeatureFlags(), 10, false);
for(sal_uInt16 i=0; i < aNumRule.GetLevelCount(); i++)
{
SvxNumberFormat aFrmt( pDefaultRule->GetLevel(i) );
@@ -1082,7 +1083,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,
- 10, sal_False );
+ 10, false );
for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
{
aNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34
@@ -1156,10 +1157,10 @@ Font SdStyleSheetPool::GetBulletFont() const
aBulletFont.SetOverline(UNDERLINE_NONE);
aBulletFont.SetStrikeout(STRIKEOUT_NONE);
aBulletFont.SetItalic(ITALIC_NONE);
- aBulletFont.SetOutline(sal_False);
- aBulletFont.SetShadow(sal_False);
+ aBulletFont.SetOutline(false);
+ aBulletFont.SetShadow(false);
aBulletFont.SetColor(Color(COL_AUTO));
- aBulletFont.SetTransparent(sal_True);
+ aBulletFont.SetTransparent(true);
return aBulletFont;
}
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index da6972abd9a6..16f01855740f 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -33,7 +33,6 @@
#include <vcl/svapp.hxx>
#include <comphelper/serviceinfohelper.hxx>
#include <boost/bind.hpp>
-
#include "eetext.hxx"
#include <editeng/eeitem.hxx>
#include <editeng/fhgtitem.hxx>
@@ -41,7 +40,6 @@
#include <editeng/ulspitem.hxx>
#include <svl/smplhint.hxx>
#include <svl/itemset.hxx>
-
#include <svx/xflbmtit.hxx>
#include <svx/xflbstit.hxx>
#include <editeng/bulitem.hxx>
@@ -49,6 +47,8 @@
#include <svx/unoshprp.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdpool.hxx>
+#include <svx/xit.hxx>
+
#include "stlsheet.hxx"
#include "sdresid.hxx"
#include "sdpage.hxx"
@@ -60,6 +60,7 @@
#include "helpids.h"
#include "../ui/inc/DrawViewShell.hxx"
#include "../ui/inc/ViewShellBase.hxx"
+#include <svx/globaldrawitempool.hxx>
#include <editeng/boxitem.hxx>
using ::rtl::OUString;
@@ -103,7 +104,7 @@ static SvxItemPropertySet& GetStylePropertySet()
{0,0,0,0,0,0}
};
- static SvxItemPropertySet aPropSet( aFullPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aPropSet( aFullPropertyMap_Impl, GetGlobalDrawObjectItemPool() );
return aPropSet;
}
@@ -204,7 +205,7 @@ void SdStyleSheet::Store(SvStream& rOut)
sal_Bool SdStyleSheet::SetParent(const String& rParentName)
{
- sal_Bool bResult = sal_False;
+ bool bResult = false;
if (SfxStyleSheet::SetParent(rParentName))
{
@@ -216,7 +217,7 @@ sal_Bool SdStyleSheet::SetParent(const String& rParentName)
SfxStyleSheetBase* pStyle = rPool.Find(rParentName, nFamily);
if (pStyle)
{
- bResult = sal_True;
+ bResult = true;
SfxItemSet& rParentSet = pStyle->GetItemSet();
GetItemSet().SetParent(&rParentSet);
Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
@@ -224,14 +225,14 @@ sal_Bool SdStyleSheet::SetParent(const String& rParentName)
}
else
{
- bResult = sal_True;
+ bResult = true;
GetItemSet().SetParent(NULL);
Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
}
}
else
{
- bResult = sal_True;
+ bResult = true;
}
}
return bResult;
@@ -350,7 +351,7 @@ SfxItemSet& SdStyleSheet::GetItemSet()
sal_Bool SdStyleSheet::IsUsed() const
{
- sal_Bool bResult = sal_False;
+ bool bResult = false;
sal_uInt16 nListenerCount = GetListenerCount();
if (nListenerCount > 0)
@@ -362,14 +363,22 @@ sal_Bool SdStyleSheet::IsUsed() const
continue;
// NULL-Pointer ist im Listener-Array erlaubt
- if (pListener && pListener->ISA(SdrAttrObj))
+ SdrAttrObj* pSdrAttrObj = dynamic_cast< SdrAttrObj* >(pListener);
+
+ if (pSdrAttrObj)
{
- bResult = ((SdrAttrObj*)pListener)->IsInserted();
+ bResult = pSdrAttrObj->IsObjectInserted();
}
- else if (pListener && pListener->ISA(SfxStyleSheet))
+ else
{
- bResult = ((SfxStyleSheet*)pListener)->IsUsed();
+ SfxStyleSheet* pSfxStyleSheet = dynamic_cast< SfxStyleSheet* >(pListener);
+
+ if (pSfxStyleSheet)
+ {
+ bResult = pSfxStyleSheet->IsUsed();
+ }
}
+
if (bResult)
break;
}
@@ -566,7 +575,7 @@ void SdStyleSheet::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
// wenn der Stellvertreter ein Notify bezueglich geaenderter Attribute
// bekommt, sorgt er dafuer, dass das eigentlich gemeinte StyleSheet
// broadcastet
- SfxSimpleHint* pSimple = PTR_CAST(SfxSimpleHint, &rHint);
+ const SfxSimpleHint* pSimple = dynamic_cast< const SfxSimpleHint* >(&rHint);
sal_uLong nId = pSimple == NULL ? 0 : pSimple->GetId();
if (nId == SFX_HINT_DATACHANGED && nFamily == SD_STYLE_FAMILY_PSEUDO)
{
@@ -582,11 +591,11 @@ void SdStyleSheet::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
|* berechnet, dass das Verhaeltnis zur Fonthoehe so ist wie im StyleSheet.
|*
|* bOnlyMissingItems legt fest, ob lediglich nicht gesetzte Items ergaenzt
-|* (sal_True) oder explizit gesetzte Items ueberschreiben werden sollen (sal_False)
+|* (true) oder explizit gesetzte Items ueberschreiben werden sollen (false)
|*
\************************************************************************/
-void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingItems)
+void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, bool bOnlyMissingItems)
{
// Bulletbreite und Texteinzug an neue Fonthoehe
// anpassen, wenn sie nicht explizit gesetzt wurden
diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx
index 3744b97f36a1..b6511d0094bc 100644
--- a/sd/source/core/text/textapi.cxx
+++ b/sd/source/core/text/textapi.cxx
@@ -35,6 +35,7 @@
#include <editeng/outlobj.hxx>
#include "Outliner.hxx"
#include <svx/svdpool.hxx>
+#include <svx/globaldrawitempool.hxx>
using ::rtl::OUString;
@@ -133,7 +134,7 @@ const SvxItemPropertySet* ImplGetSdTextPortionPropertyMap()
{MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType((const Reference< XNameContainer >*)0) , 0, 0},
{0,0,0,0,0,0}
};
- static SvxItemPropertySet aSdTextPortionPropertyMap( aSdTextPortionPropertyEntries, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aSdTextPortionPropertyMap( aSdTextPortionPropertyEntries, GetGlobalDrawObjectItemPool() );
return &aSdTextPortionPropertyMap;
}
diff --git a/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx
index bc9719c8f819..987b89d531ac 100644
--- a/sd/source/core/typemap.cxx
+++ b/sd/source/core/typemap.cxx
@@ -87,6 +87,7 @@
#include <svx/xtextit0.hxx>
#include <avmedia/mediaitem.hxx>
#include <svx/drawitem.hxx>
+#include <svx/sdooitm.hxx>
// #UndoRedo#
#include <svl/slstitm.hxx>
diff --git a/sd/source/core/undo/undofactory.cxx b/sd/source/core/undo/undofactory.cxx
index f0dd21df9f2e..5075f14f73a0 100644
--- a/sd/source/core/undo/undofactory.cxx
+++ b/sd/source/core/undo/undofactory.cxx
@@ -30,14 +30,14 @@
using namespace sd;
-SdrUndoAction* UndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* UndoFactory::CreateUndoRemoveObject( SdrObject& rObject )
{
- return new UndoRemoveObject( rObject, bOrdNumDirect );
+ return new UndoRemoveObject( rObject );
}
-SdrUndoAction* UndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* UndoFactory::CreateUndoDeleteObject( SdrObject& rObject )
{
- return new UndoDeleteObject( rObject, bOrdNumDirect );
+ return new UndoDeleteObject( rObject );
}
SdrUndoAction* UndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText )
@@ -45,9 +45,9 @@ SdrUndoAction* UndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int
return new UndoObjectSetText( rNewObj, nText );
}
-SdrUndoAction* UndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect )
+SdrUndoAction* UndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject )
{
- return new UndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect );
+ return new UndoReplaceObject( rOldObject, rNewObject );
}
SdrUndoAction* UndoFactory::CreateUndoGeoObject( SdrObject& rObject )
diff --git a/sd/source/core/undo/undoobjects.cxx b/sd/source/core/undo/undoobjects.cxx
index 1a34b9f56e4c..27db40c3bef5 100644
--- a/sd/source/core/undo/undoobjects.cxx
+++ b/sd/source/core/undo/undoobjects.cxx
@@ -35,24 +35,24 @@ using namespace sd;
///////////////////////////////////////////////////////////////////////
UndoRemovePresObjectImpl::UndoRemovePresObjectImpl( SdrObject& rObject )
-: mpUndoUsercall(0)
+: mpUndoSdPage(0)
, mpUndoAnimation(0)
, mpUndoPresObj(0)
{
- SdPage* pPage = dynamic_cast< SdPage* >( rObject.GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( rObject.getSdrPageFromSdrObject() );
if( pPage )
{
if( pPage->IsPresObj(&rObject) )
mpUndoPresObj = new UndoObjectPresentationKind( rObject );
- if( rObject.GetUserCall() )
- mpUndoUsercall = new UndoObjectUserCall(rObject);
+ if( findConnectionToSdrObject(&rObject) )
+ mpUndoSdPage = new UndoConnectionToSdrObject(rObject);
if( pPage->hasAnimationNode() )
{
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape( rObject.getUnoShape(), com::sun::star::uno::UNO_QUERY );
if( pPage->getMainSequence()->hasEffect( xShape ) )
{
- mpUndoAnimation = new UndoAnimation( static_cast< SdDrawDocument* >( pPage->GetModel() ), pPage );
+ mpUndoAnimation = new UndoAnimation( static_cast< SdDrawDocument* >( &pPage->getSdrModelFromSdrPage() ), pPage );
}
}
}
@@ -64,15 +64,15 @@ UndoRemovePresObjectImpl::~UndoRemovePresObjectImpl()
{
delete mpUndoAnimation;
delete mpUndoPresObj;
- delete mpUndoUsercall;
+ delete mpUndoSdPage;
}
//---------------------------------------------------------------------
void UndoRemovePresObjectImpl::Undo()
{
- if( mpUndoUsercall )
- mpUndoUsercall->Undo();
+ if( mpUndoSdPage )
+ mpUndoSdPage->Undo();
if( mpUndoPresObj )
mpUndoPresObj->Undo();
if( mpUndoAnimation )
@@ -87,15 +87,15 @@ void UndoRemovePresObjectImpl::Redo()
mpUndoAnimation->Redo();
if( mpUndoPresObj )
mpUndoPresObj->Redo();
- if( mpUndoUsercall )
- mpUndoUsercall->Redo();
+ if( mpUndoSdPage )
+ mpUndoSdPage->Redo();
}
///////////////////////////////////////////////////////////////////////
-UndoRemoveObject::UndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect )
-: SdrUndoRemoveObj( rObject, bOrdNumDirect ), UndoRemovePresObjectImpl( rObject )
+UndoRemoveObject::UndoRemoveObject( SdrObject& rObject )
+: SdrUndoRemoveObj( rObject ), UndoRemovePresObjectImpl( rObject )
, mxSdrObject(&rObject)
{
}
@@ -126,8 +126,8 @@ void UndoRemoveObject::Redo()
///////////////////////////////////////////////////////////////////////
-UndoDeleteObject::UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect )
-: SdrUndoDelObj( rObject, bOrdNumDirect )
+UndoDeleteObject::UndoDeleteObject( SdrObject& rObject )
+: SdrUndoDelObj( rObject )
, UndoRemovePresObjectImpl( rObject )
, mxSdrObject(&rObject)
{
@@ -159,8 +159,8 @@ void UndoDeleteObject::Redo()
///////////////////////////////////////////////////////////////////////
-UndoReplaceObject::UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect )
-: SdrUndoReplaceObj( rOldObject, rNewObject, bOrdNumDirect )
+UndoReplaceObject::UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject )
+: SdrUndoReplaceObj( rOldObject, rNewObject )
, UndoRemovePresObjectImpl( rOldObject )
, mxSdrObject( &rOldObject )
{
@@ -198,13 +198,13 @@ UndoObjectSetText::UndoObjectSetText( SdrObject& rObject, sal_Int32 nText )
, mbNewEmptyPresObj(false)
, mxSdrObject( &rObject )
{
- SdPage* pPage = dynamic_cast< SdPage* >( rObject.GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( rObject.getSdrPageFromSdrObject() );
if( pPage && pPage->hasAnimationNode() )
{
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape( rObject.getUnoShape(), com::sun::star::uno::UNO_QUERY );
if( pPage->getMainSequence()->hasEffect( xShape ) )
{
- mpUndoAnimation = new UndoAnimation( static_cast< SdDrawDocument* >( pPage->GetModel() ), pPage );
+ mpUndoAnimation = new UndoAnimation( static_cast< SdDrawDocument* >( &pPage->getSdrModelFromSdrPage() ), pPage );
}
}
}
@@ -240,41 +240,41 @@ void UndoObjectSetText::Redo()
if( mpUndoAnimation )
mpUndoAnimation->Redo();
SdrUndoObjSetText::Redo();
- mxSdrObject->SetEmptyPresObj(mbNewEmptyPresObj ? sal_True : sal_False );
+ mxSdrObject->SetEmptyPresObj(mbNewEmptyPresObj ? true : false );
}
}
//////////////////////////////////////////////////////////////////////////////
-// Undo for SdrObject::SetUserCall()
+// Undo for connecting SdrObject to SdPage
-UndoObjectUserCall::UndoObjectUserCall(SdrObject& rObject)
+UndoConnectionToSdrObject::UndoConnectionToSdrObject(SdrObject& rObject)
: SdrUndoObj(rObject)
-, mpOldUserCall((SdPage*)rObject.GetUserCall())
-, mpNewUserCall(0)
+, mpOldSdPage(findConnectionToSdrObject(&rObject))
+, mpNewSdPage(0)
, mxSdrObject( &rObject )
{
}
//---------------------------------------------------------------------
-void UndoObjectUserCall::Undo()
+void UndoConnectionToSdrObject::Undo()
{
- DBG_ASSERT( mxSdrObject.is(), "sd::UndoObjectUserCall::Undo(), object already dead!" );
+ DBG_ASSERT( mxSdrObject.is(), "sd::UndoConnectionToSdrObject::Undo(), object already dead!" );
if( mxSdrObject.is() )
{
- mpNewUserCall = mxSdrObject->GetUserCall();
- mxSdrObject->SetUserCall(mpOldUserCall);
+ mpNewSdPage = findConnectionToSdrObject(mxSdrObject.get());
+ establishConnectionToSdrObject(mxSdrObject.get(), mpOldSdPage);
}
}
//---------------------------------------------------------------------
-void UndoObjectUserCall::Redo()
+void UndoConnectionToSdrObject::Redo()
{
- DBG_ASSERT( mxSdrObject.is(), "sd::UndoObjectUserCall::Redo(), object already dead!" );
+ DBG_ASSERT( mxSdrObject.is(), "sd::UndoConnectionToSdrObject::Redo(), object already dead!" );
if( mxSdrObject.is() )
{
- mxSdrObject->SetUserCall(mpNewUserCall);
+ establishConnectionToSdrObject(mxSdrObject.get(), mpNewSdPage);
}
}
@@ -285,7 +285,7 @@ UndoObjectPresentationKind::UndoObjectPresentationKind(SdrObject& rObject)
: SdrUndoObj(rObject)
, meOldKind(PRESOBJ_NONE)
, meNewKind(PRESOBJ_NONE)
-, mxPage( rObject.GetPage() )
+, mxPage( rObject.getSdrPageFromSdrObject() )
, mxSdrObject( &rObject )
{
DBG_ASSERT( mxPage.is(), "sd::UndoObjectPresentationKind::UndoObjectPresentationKind(), does not work for shapes without a slide!" );
@@ -343,14 +343,14 @@ void UndoAutoLayoutPosAndSize::Redo()
{
SdPage* pPage = static_cast< SdPage* >( mxPage.get() );
if( pPage )
- pPage->SetAutoLayout( pPage->GetAutoLayout(), sal_False, sal_False );
+ pPage->SetAutoLayout( pPage->GetAutoLayout(), false, false );
}
//////////////////////////////////////////////////////////////////////////////
UndoGeoObject::UndoGeoObject( SdrObject& rNewObj )
: SdrUndoGeoObj( rNewObj )
-, mxPage( rNewObj.GetPage() )
+, mxPage( rNewObj.getSdrPageFromSdrObject() )
, mxSdrObject( &rNewObj )
{
}
@@ -398,8 +398,8 @@ void UndoGeoObject::Redo()
//////////////////////////////////////////////////////////////////////////////
UndoAttrObject::UndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText )
-: SdrUndoAttrObj( rObject, bStyleSheet1 ? sal_True : sal_False, bSaveText ? sal_True : sal_False )
-, mxPage( rObject.GetPage() )
+: SdrUndoAttrObj( rObject, bStyleSheet1 ? true : false, bSaveText ? true : false )
+, mxPage( rObject.getSdrPageFromSdrObject() )
, mxSdrObject( &rObject )
{
}
diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx b/sd/source/filter/cgm/sdcgmfilter.cxx
index d4558034bc61..c44aa0c546ca 100644
--- a/sd/source/filter/cgm/sdcgmfilter.cxx
+++ b/sd/source/filter/cgm/sdcgmfilter.cxx
@@ -102,7 +102,7 @@ sal_Bool SdCGMFilter::Import()
if( nRetValue )
{
- bRet = sal_True;
+ bRet = true;
if( ( nRetValue &~0xff000000 ) != 0xffffff ) // maybe the backgroundcolor is already white
{ // so we must not set a master page
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 9f28d1480c28..960ba82d8ba2 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -88,31 +88,31 @@ using namespace com::sun::star;
static PHLayout pPHLayout[] =
{
- { EPP_LAYOUT_TITLESLIDE, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_True, sal_True },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_False, sal_False, sal_False },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, sal_True, sal_False, sal_False },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_False, sal_False },
- { EPP_LAYOUT_RIGHTCOLUMN2ROWS, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_LEFTCOLUMN2ROWS, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_TOPROW2COLUMN, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_4OBJECTS, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_False, sal_False },
- { EPP_LAYOUT_ONLYTITLE, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_False, sal_False },
- { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_False, sal_False, sal_False },
- { EPP_LAYOUT_TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_TITLERIGHTBODYLEFT, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, sal_True, sal_True, sal_False },
- { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, sal_True, sal_True, sal_False }
+ { EPP_LAYOUT_TITLESLIDE, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, true, true, false },
+ { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, true, true },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, false, false, false },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, true, false, false },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, false, false },
+ { EPP_LAYOUT_RIGHTCOLUMN2ROWS, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_LEFTCOLUMN2ROWS, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_TOPROW2COLUMN, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, true, false },
+ { EPP_LAYOUT_4OBJECTS, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, true, false, false },
+ { EPP_LAYOUT_ONLYTITLE, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, true, false, false },
+ { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, false, false, false },
+ { EPP_LAYOUT_TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, true, true, false },
+ { EPP_LAYOUT_TITLERIGHTBODYLEFT, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, true, true, false },
+ { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, true, true, false },
+ { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, true, true, false }
};
//============================ PPTWriter ==================================
@@ -121,27 +121,74 @@ PPTWriter::PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rXModel,
::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rXStatInd,
SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags ) :
- mbStatus ( sal_False ),
- mbUseNewAnimations ( sal_True ),
- mnLatestStatValue ( 0 ),
- maFraction ( 1, 576 ),
- maMapModeSrc ( MAP_100TH_MM ),
- maMapModeDest ( MAP_INCH, Point(), maFraction, maFraction ),
- meLatestPageType ( NORMAL ),
- mXModel ( rXModel ),
- mXStatusIndicator ( rXStatInd ),
- mbStatusIndicator ( sal_False ),
- mpCurUserStrm ( NULL ),
- mpStrm ( NULL ),
- mpPicStrm ( NULL ),
- mpPptEscherEx ( NULL ),
- mnVBAOleOfs ( 0 ),
- mpVBA ( pVBA ),
- mnExEmbed ( 0 ),
- mpExEmbed ( new SvMemoryStream ),
- mnPagesWritten ( 0 ),
- mnTxId ( 0x7a2f64 )
+ mnStatMaxValue(0),
+ mnLatestStatValue(0),
+ maStyleSheetList(),
+ mpStyleSheet(0),
+ mfMap100thMmToMs(1.0),
+ maMap100thMmToMs(),
+ maInvMap100thMmToMs(),
+ maDestPageSize(),
+ maPageSize(),
+ maNotesPageSize(),
+ meLatestPageType(NORMAL),
+ maSlideNameList(),
+ maBaseURI(),
+ mXModel(rXModel),
+ mXStatusIndicator(rXStatInd),
+ mXDrawPagesSupplier(),
+ mXMasterPagesSupplier(),
+ mXDrawPages(),
+ mXDrawPage(),
+ mXPagePropSet(),
+ mXBackgroundPropSet(),
+ mXShapes(),
+ mXShape(),
+ mXText(),
+ mXCursor(),
+ mXCursorText(),
+ mXCursorPropSet(),
+ mXTextField(),
+ maObjectRange(),
+ maObjTrans(),
+ mnMirrorFlags(0),
+ mfObjectRotation(0.0),
+ mType(),
+ mnTextStyle(0),
+ mnTextSize(0),
+ mrStg(),
+ mpCurUserStrm(0),
+ mpStrm(0),
+ mpPicStrm(0),
+ mpPptEscherEx(0),
+ maExOleObj(),
+ mnVBAOleOfs(0),
+ mpVBA(pVBA),
+ mnExEmbed(0),
+ mpExEmbed(new SvMemoryStream),
+ mnPages(0),
+ mnMasterPages(0),
+ mnDrawings(0),
+ mnPagesWritten(0),
+ mnUniqueSlideIdentifier(0),
+ mnTxId(0x7a2f64),
+ mnDiaMode(0),
+ mnShapeMasterTitle(0),
+ mnShapeMasterBody(0),
+ maHyperlink(),
+ maFontCollection(),
+ maSoundCollection(),
+ mbStatus(false),
+ mbUseNewAnimations(true),
+ mbPresObj(false),
+ mbEmptyPresObj(false),
+ mbStatusIndicator(false),
+ mbFontIndependentLineSpacing(false)
{
+ mfMap100thMmToMs = OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, MAP_INCH) * 576.0;
+ maMap100thMmToMs = basegfx::tools::createScaleB2DHomMatrix(mfMap100thMmToMs, mfMap100thMmToMs);
+ maInvMap100thMmToMs = basegfx::tools::createScaleB2DHomMatrix(1.0 / mfMap100thMmToMs, 1.0 / mfMap100thMmToMs);
+
sal_uInt32 i;
if ( !ImplInitSOIface() )
return;
@@ -161,7 +208,7 @@ PPTWriter::PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&
if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
mAny >>= nHeight;
- maNotesPageSize = ImplMapSize( ::com::sun::star::awt::Size( nWidth, nHeight ) );
+ maNotesPageSize = maMap100thMmToMs * basegfx::B2DVector(nWidth, nHeight);
if ( !ImplGetPageByIndex( 0, MASTER ) )
return;
@@ -171,7 +218,7 @@ PPTWriter::PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&
nHeight = 21000;
if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
mAny >>= nHeight;
- maDestPageSize = ImplMapSize( ::com::sun::star::awt::Size( nWidth, nHeight ) );
+ maDestPageSize = maMap100thMmToMs * basegfx::B2DVector(nWidth, nHeight);
maPageSize = Size(nWidth, nHeight);
mrStg = rSvStorage;
@@ -183,7 +230,7 @@ PPTWriter::PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&
if ( mXStatusIndicator.is() )
{
- mbStatusIndicator = sal_True;
+ mbStatusIndicator = true;
mnStatMaxValue = ( mnPages + mnMasterPages ) * 5;
mXStatusIndicator->start( String( RTL_CONSTASCII_USTRINGPARAM( "PowerPoint Export" ) ),
mnStatMaxValue + ( mnStatMaxValue >> 3 ) );
@@ -262,7 +309,7 @@ PPTWriter::PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&
if ( !ImplCreateDocumentSummaryInformation( nCnvrtFlags ) )
return;
- mbStatus = sal_True;
+ mbStatus = true;
};
@@ -303,11 +350,11 @@ static inline sal_uInt32 PPTtoEMU( sal_Int32 nPPT )
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateCurrentUserStream()
+bool PPTWriter::ImplCreateCurrentUserStream()
{
mpCurUserStrm = mrStg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Current User" ) ) );
if ( !mpCurUserStrm )
- return sal_False;
+ return false;
char pUserName[] = "Current User";
sal_uInt32 nLenOfUserName = strlen( pUserName );
sal_uInt32 nSizeOfRecord = 0x14 + ( ( nLenOfUserName + 4 ) & ~ 3 );
@@ -330,12 +377,12 @@ sal_Bool PPTWriter::ImplCreateCurrentUserStream()
*mpCurUserStrm << (sal_uInt8)0; // pad bytes
};
mpCurUserStrm->Seek( nEditPos );
- return sal_True;
+ return true;
};
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags )
+bool PPTWriter::ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags )
{
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
mXModel, uno::UNO_QUERY_THROW);
@@ -385,7 +432,7 @@ sal_Bool PPTWriter::ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags
}
}
- return sal_True;
+ return true;
}
// ---------------------------------------------------------------------------------------------
@@ -411,17 +458,17 @@ void PPTWriter::ImplCreateHeaderFooterStrings( SvStream& rStrm, ::com::sun::star
{
rtl::OUString aString;
::com::sun::star::uno::Any aAny;
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) ), true ) )
{
if ( aAny >>= aString )
PPTWriter::WriteCString( rStrm, aString, 1 );
}
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) ), true ) )
{
if ( aAny >>= aString )
PPTWriter::WriteCString( rStrm, aString, 2 );
}
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) ), true ) )
{
if ( aAny >>= aString )
PPTWriter::WriteCString( rStrm, aString, 0 );
@@ -435,37 +482,37 @@ void PPTWriter::ImplCreateHeaderFooters( ::com::sun::star::uno::Reference< ::com
{
if ( rXPagePropSet.is() )
{
- sal_Bool bVal = sal_False;
+ bool bVal = false;
sal_uInt32 nVal = 0;
::com::sun::star::uno::Any aAny;
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsHeaderVisible" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsHeaderVisible" ) ), true ) )
{
if ( ( aAny >>= bVal ) && bVal )
nVal |= 0x100000;
}
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFooterVisible" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFooterVisible" ) ), true ) )
{
if ( ( aAny >>= bVal ) && bVal )
nVal |= 0x200000;
}
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeVisible" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeVisible" ) ), true ) )
{
if ( ( aAny >>= bVal ) && bVal )
nVal |= 0x010000;
}
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsPageNumberVisible" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsPageNumberVisible" ) ), true ) )
{
if ( ( aAny >>= bVal ) && bVal )
nVal |= 0x080000;
}
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ), true ) )
{
if ( ( aAny >>= bVal ) && !bVal )
nVal |= 0x20000;
else
nVal |= 0x40000;
}
- if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ), true ) )
{
sal_Int32 nFormat = *(sal_Int32*)aAny.getValue();
SvxDateFormat eDateFormat = (SvxDateFormat)( nFormat & 0xf );
@@ -515,13 +562,12 @@ void PPTWriter::ImplCreateHeaderFooters( ::com::sun::star::uno::Reference< ::com
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateDocument()
+bool PPTWriter::ImplCreateDocument()
{
sal_uInt32 i;
sal_uInt16 nSlideType = EPP_SLIDESIZE_TYPECUSTOM;
-
- sal_uInt32 nWidth = maDestPageSize.Width;
- sal_uInt32 nHeight = maDestPageSize.Height;
+ const sal_uInt32 nWidth(basegfx::fround(maDestPageSize.getX()));
+ const sal_uInt32 nHeight(basegfx::fround(maDestPageSize.getY()));
if ( ( nWidth == 0x1680 ) && ( nHeight == 0x10e0 ) )
nSlideType = EPP_SLIDESIZE_TYPEONSCREEN;
@@ -537,8 +583,8 @@ sal_Bool PPTWriter::ImplCreateDocument()
mpPptEscherEx->AddAtom( 40, EPP_DocumentAtom, 1 );
*mpStrm << nWidth // Slide Size in Master coordinates X
<< nHeight // " " " " " Y
- << (sal_Int32)maNotesPageSize.Width // Notes Page Size X
- << (sal_Int32)maNotesPageSize.Height // " " " Y
+ << (sal_Int32)basegfx::fround(maNotesPageSize.getX()) // Notes Page Size X
+ << (sal_Int32)basegfx::fround(maNotesPageSize.getY()) // " " " Y
<< (sal_Int32)1 << (sal_Int32)2; // the scale used when the Powerpoint document is embedded. the default is 1:2
mpPptEscherEx->InsertPersistOffset( EPP_MAINNOTESMASTER_PERSIST_KEY, mpStrm->Tell() );
*mpStrm << (sal_uInt32)0 // Reference to NotesMaster ( 0 if none );
@@ -578,7 +624,7 @@ sal_Bool PPTWriter::ImplCreateDocument()
<< (sal_uInt32)0; // reserved, usualy 0
if ( !ImplGetPageByIndex( i, NORMAL ) ) // sehr aufregend: noch einmal ueber alle seiten
- return sal_False;
+ return false;
ImplSetCurrentStyleSheet( ImplGetMasterIndex( NORMAL ) );
::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed >
@@ -673,22 +719,22 @@ sal_Bool PPTWriter::ImplCreateDocument()
// }
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) )
{
- sal_Bool bBool = sal_False;
+ bool bBool = false;
mAny >>= bBool;
if ( !bBool )
nFlags |= 1;
}
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) ) // muesste eigendlich heissen IsNotEndless !=)"§()&
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) ) // muesste eigendlich heissen IsNotEndless !=)"�()&
{
- sal_Bool bBool = sal_False;
+ bool bBool = false;
mAny >>= bBool;
if ( bBool )
nFlags |= 0x80;
}
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) )
{
- sal_Bool bBool = sal_False;
+ bool bBool = false;
mAny >>= bBool;
if ( !bBool )
nFlags |= 0x11;
@@ -804,12 +850,12 @@ sal_Bool PPTWriter::ImplCreateDocument()
}
mpPptEscherEx->AddAtom( 0, EPP_EndDocument );
mpPptEscherEx->CloseContainer(); // EPP_Document
- return sal_True;
+ return true;
};
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateHyperBlob( SvMemoryStream& rStrm )
+bool PPTWriter::ImplCreateHyperBlob( SvMemoryStream& rStrm )
{
sal_uInt32 nCurrentOfs, nParaOfs, nParaCount = 0;
// SfxOlePropertySection does this...
@@ -888,14 +934,14 @@ sal_Bool PPTWriter::ImplCreateHyperBlob( SvMemoryStream& rStrm )
rStrm << (sal_uInt32)( nCurrentOfs - ( nParaOfs + 4 ) );
rStrm << nParaCount;
rStrm.Seek( nCurrentOfs );
- return sal_True;
+ return true;
}
PHLayout& PPTWriter::ImplGetLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
{
::com::sun::star::uno::Any aAny;
sal_Int16 nLayout = 20;
- if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Layout" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Layout" ) ) ), true )
aAny >>= nLayout;
if ( ( nLayout >= 21 ) && ( nLayout <= 26 ) ) // NOTES _> HANDOUT6
@@ -910,17 +956,17 @@ PHLayout& PPTWriter::ImplGetLayout( const ::com::sun::star::uno::Reference< ::c
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum )
+bool PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum )
{
if ( !ImplGetPageByIndex( nPageNum, MASTER ) )
- return sal_False;
+ return false;
ImplSetCurrentStyleSheet( nPageNum );
if ( !ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) ) ) // Backgroundshape laden
- return sal_False;
+ return false;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet;
if ( !( mAny >>= aXBackgroundPropSet ) )
- return sal_False;
+ return false;
sal_uInt32 nFillColor = 0xffffff;
sal_uInt32 nFillBackColor = 0x000000;
@@ -992,8 +1038,8 @@ sal_Bool PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum )
mpPptEscherEx->BeginAtom();
- sal_Bool bFirst = sal_True;
- sal_Bool bSimpleText = sal_False;
+ bool bFirst = true;
+ bool bSimpleText = false;
*mpStrm << (sal_uInt16)5; // paragraph count
@@ -1001,13 +1047,13 @@ sal_Bool PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum )
{
if ( nInstance >= EPP_TEXTTYPE_CenterBody )
{
- bFirst = sal_False;
- bSimpleText = sal_True;
+ bFirst = false;
+ bSimpleText = true;
*mpStrm << nLev;
}
mpStyleSheet->mpParaSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
mpStyleSheet->mpCharSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
- bFirst = sal_False;
+ bFirst = false;
}
mpPptEscherEx->EndAtom( EPP_TxMasterStyleAtom, 0, nInstance );
}
@@ -1018,8 +1064,8 @@ sal_Bool PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum )
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
- ImplWritePage( pPHLayout[ 0 ], aSolverContainer, MASTER, sal_True ); // Die Shapes der Seite werden im PPT Dok. erzeugt
+ mpPptEscherEx->EnterGroup();
+ ImplWritePage( pPHLayout[ 0 ], aSolverContainer, MASTER, true ); // Die Shapes der Seite werden im PPT Dok. erzeugt
mpPptEscherEx->LeaveGroup();
ImplWriteBackground( aXBackgroundPropSet );
@@ -1036,38 +1082,38 @@ sal_Bool PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum )
ImplProgTagContainer( mpStrm, &aBuExMasterStream );
}
mpPptEscherEx->CloseContainer(); // EPP_MainMaster
- return sal_True;
+ return true;
};
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateMainNotes()
+bool PPTWriter::ImplCreateMainNotes()
{
if ( !ImplGetPageByIndex( 0, NOTICE ) )
- return sal_False;
+ return false;
ImplSetCurrentStyleSheet( 0 );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
if ( !aXMasterPageTarget.is() )
- return sal_False;
+ return false;
mXDrawPage = aXMasterPageTarget->getMasterPage();
if ( !mXDrawPage.is() )
- return sal_False;
+ return false;
mXPropSet = ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >
( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
if ( !mXPropSet.is() )
- return sal_False;
+ return false;
mXShapes = ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >
( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
if ( !mXShapes.is() )
- return sal_False;
+ return false;
EscherSolverContainer aSolverContainer;
@@ -1078,9 +1124,9 @@ sal_Bool PPTWriter::ImplCreateMainNotes()
<< (sal_uInt32)0; // follow nothing
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
+ mpPptEscherEx->EnterGroup();
- ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, sal_True );
+ ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, true );
mpPptEscherEx->LeaveGroup();
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
@@ -1104,7 +1150,7 @@ sal_Bool PPTWriter::ImplCreateMainNotes()
mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
*mpStrm << (sal_uInt32)0xffffff << (sal_uInt32)0x000000 << (sal_uInt32)0x808080 << (sal_uInt32)0x000000 << (sal_uInt32)0x99cc00 << (sal_uInt32)0xcc3333 << (sal_uInt32)0xffcccc << (sal_uInt32)0xb2b2b2;
mpPptEscherEx->CloseContainer(); // EPP_Notes
- return sal_True;
+ return true;
}
// ---------------------------------------------------------------------------------------------
@@ -1196,18 +1242,18 @@ void ImplExportComments( uno::Reference< drawing::XDrawPage > xPage, SvMemoryStr
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
+bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
{
::com::sun::star::uno::Any aAny;
if ( !ImplGetPageByIndex( nPageNum, NORMAL ) )
- return sal_False;
+ return false;
sal_uInt32 nMasterID = ImplGetMasterIndex( NORMAL );
ImplSetCurrentStyleSheet( nMasterID );
nMasterID |= 0x80000000;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet;
- sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
+ bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
if ( bHasBackground )
bHasBackground = ( aAny >>= aXBackgroundPropSet );
@@ -1218,7 +1264,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
/* sj: Don't know what's IsBackgroundVisible for, have to ask cl
if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundVisible" ) ) ) )
{
- sal_Bool bBackgroundVisible;
+ bool bBackgroundVisible;
if ( aAny >>= bBackgroundVisible )
{
if ( bBackgroundVisible )
@@ -1228,7 +1274,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
*/
if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundObjectsVisible" ) ) ) )
{
- sal_Bool bBackgroundObjectsVisible = sal_False;
+ bool bBackgroundObjectsVisible = false;
if ( aAny >>= bBackgroundObjectsVisible )
{
if ( !bBackgroundObjectsVisible )
@@ -1248,7 +1294,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
<< (sal_uInt16)0; // padword
mnDiaMode = 0;
- sal_Bool bVisible = sal_True;
+ bool bVisible = true;
::com::sun::star::presentation::FadeEffect eFe = ::com::sun::star::presentation::FadeEffect_NONE;
if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ) ) )
@@ -1270,9 +1316,9 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
aAny >>= eFe;
sal_uInt32 nSoundRef = 0;
- sal_Bool bIsSound = sal_False;
- sal_Bool bStopSound = sal_False;
- sal_Bool bLoopSound = sal_False;
+ bool bIsSound = false;
+ bool bStopSound = false;
+ bool bLoopSound = false;
if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ) ) )
{
@@ -1280,7 +1326,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
if ( aAny >>= aSoundURL )
{
nSoundRef = maSoundCollection.GetId( aSoundURL );
- bIsSound = sal_True;
+ bIsSound = true;
}
else
aAny >>= bStopSound;
@@ -1289,7 +1335,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
aAny >>= bLoopSound;
- sal_Bool bNeedsSSSlideInfoAtom = ( bVisible == sal_False )
+ bool bNeedsSSSlideInfoAtom = ( bVisible == false )
|| ( mnDiaMode == 2 )
|| ( bIsSound )
|| ( bStopSound )
@@ -1501,7 +1547,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
}
if ( mnDiaMode == 2 ) // automatic ?
nBuildFlags |= 0x400;
- if ( bVisible == sal_False )
+ if ( bVisible == false )
nBuildFlags |= 4;
if ( bIsSound )
nBuildFlags |= 16;
@@ -1529,8 +1575,8 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
EscherSolverContainer aSolverContainer;
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
- ImplWritePage( rLayout, aSolverContainer, NORMAL, sal_False, nPageNum ); // Die Shapes der Seite werden im PPT Dok. erzeugt
+ mpPptEscherEx->EnterGroup();
+ ImplWritePage( rLayout, aSolverContainer, NORMAL, false, nPageNum ); // Die Shapes der Seite werden im PPT Dok. erzeugt
mpPptEscherEx->LeaveGroup();
if ( bHasBackground )
@@ -1540,8 +1586,8 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
EscherPropertyContainer aPropOpt;
- aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( maDestPageSize.Width ) );
- aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( maDestPageSize.Width ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( basegfx::fround(maDestPageSize.getX()) ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( basegfx::fround(maDestPageSize.getY()) ) ); // here Height() was used in the original version, probably an error
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x120012 );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
aPropOpt.AddOpt( ESCHER_Prop_bWMode, ESCHER_wDontShow );
@@ -1640,15 +1686,15 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
}
*/
mpPptEscherEx->CloseContainer(); // EPP_Slide
- return sal_True;
+ return true;
};
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum )
+bool PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum )
{
if ( !ImplGetPageByIndex( nPageNum, NOTICE ) )
- return sal_False;
+ return false;
ImplSetCurrentStyleSheet( ImplGetMasterIndex( NORMAL ) );
@@ -1665,9 +1711,9 @@ sal_Bool PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum )
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
+ mpPptEscherEx->EnterGroup();
- ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, sal_False ); // Die Shapes der Seite werden im PPT Dok. erzeugt
+ ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, false ); // Die Shapes der Seite werden im PPT Dok. erzeugt
mpPptEscherEx->LeaveGroup();
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
@@ -1691,7 +1737,7 @@ sal_Bool PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum )
mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
*mpStrm << (sal_uInt32)0xffffff << (sal_uInt32)0x000000 << (sal_uInt32)0x808080 << (sal_uInt32)0x000000 << (sal_uInt32)0x99cc00 << (sal_uInt32)0xcc3333 << (sal_uInt32)0xffcccc << (sal_uInt32)0xb2b2b2;
mpPptEscherEx->CloseContainer(); // EPP_Notes
- return sal_True;
+ return true;
};
void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet )
@@ -1707,9 +1753,12 @@ void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::su
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
// #121183# Use real PageSize in 100th mm
- Rectangle aRect(Point(0, 0), maPageSize);
+ basegfx::B2DRange aPageRange(0.0, 0.0, maPageSize.Width(), maPageSize.Height());
+ EscherPropertyContainer aPropOpt(
+ mpPptEscherEx->GetGraphicProvider(),
+ mpPicStrm,
+ aPageRange);
- EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
::com::sun::star::drawing::FillStyle aFS( ::com::sun::star::drawing::FillStyle_NONE );
if ( ImplGetPropertyValue( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )
@@ -1727,11 +1776,11 @@ void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::su
break;
case ::com::sun::star::drawing::FillStyle_BITMAP :
- aPropOpt.CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ), sal_True );
+ aPropOpt.CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ), true );
break;
case ::com::sun::star::drawing::FillStyle_HATCH :
- aPropOpt.CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ), sal_True );
+ aPropOpt.CreateGraphicProperties( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ), true );
break;
case ::com::sun::star::drawing::FillStyle_SOLID :
@@ -1749,8 +1798,8 @@ void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::su
}
aPropOpt.AddOpt( ESCHER_Prop_fillColor, nFillColor );
aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, nFillBackColor );
- aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( maDestPageSize.Width ) );
- aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( maDestPageSize.Height ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( basegfx::fround(maDestPageSize.getX()) ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( basegfx::fround(maDestPageSize.getY()) ) );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
aPropOpt.AddOpt( ESCHER_Prop_bWMode, ESCHER_bwWhite );
aPropOpt.AddOpt( ESCHER_Prop_fBackground, 0x10001 );
@@ -1792,19 +1841,20 @@ void PPTWriter::ImplWriteOLE( sal_uInt32 nCnvrtFlags )
{
case NORMAL_OLE_OBJECT :
{
- SdrObject* pSdrObj = GetSdrObjectFromXShape( pPtr->xShape );
- if ( pSdrObj && pSdrObj->ISA( SdrOle2Obj ) )
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(GetSdrObjectFromXShape( pPtr->xShape ));
+
+ if ( pSdrOle2Obj )
{
- ::uno::Reference < embed::XEmbeddedObject > xObj( ( (SdrOle2Obj*) pSdrObj )->GetObjRef() );
+ ::uno::Reference < embed::XEmbeddedObject > xObj( pSdrOle2Obj->GetObjRef() );
if( xObj.is() )
{
- SvStorageRef xTempStorage( new SvStorage( new SvMemoryStream(), sal_True ) );
+ SvStorageRef xTempStorage( new SvStorage( new SvMemoryStream(), true ) );
aOleExport.ExportOLEObject( xObj, *xTempStorage );
//TODO/MBA: testing
String aPersistStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( SVEXT_PERSIST_STREAM ) ) );
SvMemoryStream aStream;
- SvStorageRef xCleanStorage( new SvStorage( sal_False, aStream ) );
+ SvStorageRef xCleanStorage( new SvStorage( false, aStream ) );
xTempStorage->CopyTo( xCleanStorage );
// SJ: #99809# create a dummy content stream, the dummy content is necessary for ppt, but not for
// doc files, so we can't share code.
@@ -1831,8 +1881,8 @@ void PPTWriter::ImplWriteOLE( sal_uInt32 nCnvrtFlags )
String aName;
//Initialize the graphic size which will be used on export
::com::sun::star::awt::Size aSize( pPtr->xShape->getSize() );
- SvStorageRef xDest( new SvStorage( new SvMemoryStream(), sal_True ) );
- sal_Bool bOk = SvxMSConvertOCXControls::WriteOCXStream( xDest, pPtr->xControlModel, aSize, aName );
+ SvStorageRef xDest( new SvStorage( new SvMemoryStream(), true ) );
+ bool bOk = SvxMSConvertOCXControls::WriteOCXStream( xDest, pPtr->xControlModel, aSize, aName );
if ( bOk )
pStrm = xDest->CreateMemoryStream();
}
@@ -1865,7 +1915,7 @@ void PPTWriter::ImplWriteOLE( sal_uInt32 nCnvrtFlags )
// ---------------------------------------------------------------------------------------------
// PersistantTable und UserEditAtom schreiben
-sal_Bool PPTWriter::ImplWriteAtomEnding()
+bool PPTWriter::ImplWriteAtomEnding()
{
#define EPP_LastViewTypeNone 0
@@ -1974,7 +2024,7 @@ sal_Bool PPTWriter::ImplWriteAtomEnding()
<< (sal_Int16)EPP_LastViewTypeSlideView // last view type
<< (sal_Int16)0x12; // padword
- return sal_True;
+ return true;
}
// ---------------------------------------------------------------------------------------------
@@ -2044,7 +2094,7 @@ void PPTExCharSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::co
rLev.mnFlags = aPortionObj.mnCharAttr;
}
-void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bool, sal_Bool bSimpleText,
+void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, bool, bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
{
const PPTExCharLevel& rLev = maCharLevel[ nLev ];
@@ -2060,9 +2110,9 @@ void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bo
sal_uInt32 nFontColor = rLev.mnFontColor;
if ( nFontColor == COL_AUTO )
{
- sal_Bool bIsDark = sal_False;
+ bool bIsDark = false;
::com::sun::star::uno::Any aAny;
- if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), true ) )
aAny >>= bIsDark;
nFontColor = bIsDark ? 0xffffff : 0x000000;
}
@@ -2088,7 +2138,7 @@ PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBull
rBuProv ( rProv ),
mnInstance ( nInstance )
{
- sal_Bool bHasBullet = sal_False;
+ bool bHasBullet = false;
sal_uInt16 nUpperDist = 0;
sal_uInt16 nBulletChar = 0x2022;
@@ -2108,7 +2158,7 @@ PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBull
case EPP_TEXTTYPE_HalfBody :
case EPP_TEXTTYPE_QuarterBody :
{
- bHasBullet = sal_True;
+ bHasBullet = true;
nUpperDist = 0x14;
}
break;
@@ -2174,7 +2224,7 @@ PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBull
rLev.mnAsianSettings = 2;
rLev.mnBiDi = 0;
- rLev.mbExtendedBulletsUsed = sal_False;
+ rLev.mbExtendedBulletsUsed = false;
rLev.mnBulletId = 0xffff;
rLev.mnBulletStart = 0;
rLev.mnMappedNumType = 0;
@@ -2196,7 +2246,7 @@ void PPTExParaSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::co
sal_Int16 nLineSpacing = aParagraphObj.mnLineSpacing;
if ( nLineSpacing > 0 ) // if nLinespacing is < 0 the linespacing is an absolute spacing
{
- sal_Bool bFixedLineSpacing = sal_False;
+ bool bFixedLineSpacing = false;
uno::Any aAny = rXPropSet->getPropertyValue( ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"FontIndependentLineSpacing" ) ) );
@@ -2253,7 +2303,7 @@ void PPTExParaSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::co
{
PPTExParaLevel& rLevel = maParaLevel[ i ];
if ( i )
- aParagraphObj.ImplGetNumberingLevel( rBuProv, i, sal_False );
+ aParagraphObj.ImplGetNumberingLevel( rBuProv, i, false );
// rLevel.mbIsBullet = ( ( aParagraphObj.nBulletFlags & 1 ) != 0 );
rLevel.mnTextOfs = aParagraphObj.nTextOfs;
rLevel.mnBulletOfs = (sal_uInt16)aParagraphObj.nBulletOfs;
@@ -2274,7 +2324,7 @@ void PPTExParaSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::co
}
}
-void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bool, sal_Bool bSimpleText,
+void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, bool, bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
{
const PPTExParaLevel& rLev = maParaLevel[ nLev ];
@@ -2310,9 +2360,9 @@ void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bo
sal_uInt32 nBulletColor = rLev.mnBulletColor;
if ( nBulletColor == COL_AUTO )
{
- sal_Bool bIsDark = sal_False;
+ bool bIsDark = false;
::com::sun::star::uno::Any aAny;
- if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), true ) )
aAny >>= bIsDark;
nBulletColor = bIsDark ? 0xffffff : 0x000000;
}
@@ -2377,7 +2427,7 @@ void PPTExStyleSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::c
mpParaSheet[ nInstance ]->SetStyleSheet( rXPropSet, rFontCollection, nLevel, mpCharSheet[ nInstance ]->maCharLevel[ nLevel ] );
}
-sal_Bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue )
+bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue )
{
const PPTExParaLevel& rPara = mpParaSheet[ nInstance ]->maParaLevel[ nLevel ];
const PPTExCharLevel& rChar = mpCharSheet[ nInstance ]->maCharLevel[ nLevel ];
@@ -2386,7 +2436,7 @@ sal_Bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLev
switch ( eAttr )
{
- case ParaAttr_BulletOn : return ( rPara.mbIsBullet ) ? ( nValue ) ? sal_False : sal_True : ( nValue ) ? sal_True : sal_False;
+ case ParaAttr_BulletOn : return ( rPara.mbIsBullet ) ? ( nValue ) ? false : true : ( nValue ) ? true : false;
case ParaAttr_BuHardFont :
case ParaAttr_BulletFont : return ( rPara.mnBulletFont != nValue );
case ParaAttr_BuHardColor :
@@ -2410,7 +2460,7 @@ sal_Bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLev
case CharAttr_Embossed : nFlag = 512; break;
case CharAttr_Font : return ( rChar.mnFont != nValue );
case CharAttr_AsianOrComplexFont : return ( rChar.mnAsianOrComplexFont != nValue );
- case CharAttr_Symbol : return sal_True;
+ case CharAttr_Symbol : return true;
case CharAttr_FontHeight : return ( rChar.mnFontHeight != nValue );
case CharAttr_FontColor : return ( rChar.mnFontColor != nValue );
case CharAttr_Escapement : return ( rChar.mnEscapement != nValue );
@@ -2424,7 +2474,7 @@ sal_Bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLev
else
return ( ( nValue & nFlag ) != 0 );
}
- return sal_True;
+ return true;
}
sal_uInt32 PPTExStyleSheet::SizeOfTxCFStyleAtom() const
@@ -2463,29 +2513,30 @@ void PPTExStyleSheet::WriteTxCFStyleAtom( SvStream& rSt )
// - exported function -
// ---------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI ExportPPT( const std::vector< com::sun::star::beans::PropertyValue >& rMediaData, SvStorageRef& rSvStorage,
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rXModel,
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rXStatInd,
- SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags )
+extern "C" SAL_DLLPUBLIC_EXPORT bool __LOADONCALLAPI ExportPPT(
+ const std::vector< com::sun::star::beans::PropertyValue >& rMediaData, SvStorageRef& rSvStorage,
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rXModel,
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rXStatInd,
+ SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags )
{
PPTWriter* pPPTWriter;
- sal_Bool bStatus = sal_False;
+ bool bStatus = false;
pPPTWriter = new PPTWriter( rMediaData, rSvStorage, rXModel, rXStatInd, pVBA, nCnvrtFlags );
if ( pPPTWriter )
{
- bStatus = ( pPPTWriter->IsValid() == sal_True );
+ bStatus = pPPTWriter->IsValid();
delete pPPTWriter;
}
return bStatus;
}
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI SaveVBA( SfxObjectShell& rDocShell, SvMemoryStream*& pBas )
+extern "C" SAL_DLLPUBLIC_EXPORT bool __LOADONCALLAPI SaveVBA( SfxObjectShell& rDocShell, SvMemoryStream*& pBas )
{
- SvStorageRef xDest( new SvStorage( new SvMemoryStream(), sal_True ) );
- SvxImportMSVBasic aMSVBas( rDocShell, *xDest, sal_False, sal_False );
- aMSVBas.SaveOrDelMSVBAStorage( sal_True, String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) );
+ SvStorageRef xDest( new SvStorage( new SvMemoryStream(), true ) );
+ SvxImportMSVBasic aMSVBas( rDocShell, *xDest, false, false );
+ aMSVBas.SaveOrDelMSVBAStorage( true, String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) );
SvStorageRef xOverhead = xDest->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) );
if ( xOverhead.Is() && ( xOverhead->GetError() == SVSTREAM_OK ) )
@@ -2505,14 +2556,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI SaveVBA( SfxObjectShell
xTemp->Seek( STREAM_SEEK_TO_BEGIN );
xTemp->Read( pTemp, nLen );
pBas = new SvMemoryStream( pTemp, nLen, STREAM_READ );
- pBas->ObjectOwnsMemory( sal_True );
- return sal_True;
+ pBas->ObjectOwnsMemory( true );
+ return true;
}
}
}
}
}
- return sal_False;
+ return false;
}
diff --git a/sd/source/filter/eppt/eppt.hxx b/sd/source/filter/eppt/eppt.hxx
index a44dbccf28d9..2c25e6be5180 100644
--- a/sd/source/filter/eppt/eppt.hxx
+++ b/sd/source/filter/eppt/eppt.hxx
@@ -87,6 +87,8 @@
#include <com/sun/star/awt/CharSet.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/lang/Locale.hpp>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
enum PageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
@@ -143,14 +145,14 @@ struct PHLayout
sal_uInt8 nTypeOfTitle;
sal_uInt8 nTypeOfOutliner;
- sal_Bool bTitlePossible;
- sal_Bool bOutlinerPossible;
- sal_Bool bSecOutlinerPossible;
+ bool bTitlePossible;
+ bool bOutlinerPossible;
+ bool bSecOutlinerPossible;
};
struct SOParagraph
{
- sal_Bool bExtendedParameters;
+ bool bExtendedParameters;
sal_uInt32 nParaFlags;
sal_Int16 nBulletFlags;
String sPrefix;
@@ -168,22 +170,22 @@ struct SOParagraph
sal_Unicode cBulletId; // wenn Numbering Type == CharSpecial
::com::sun::star::awt::FontDescriptor aFontDesc;
- sal_Bool bExtendedBulletsUsed;
+ bool bExtendedBulletsUsed;
sal_uInt16 nBulletId;
sal_uInt32 nMappedNumType;
- sal_Bool bNumberingIsNumber;
+ bool bNumberingIsNumber;
SOParagraph()
{
nDepth = 0;
- bExtendedParameters = sal_False;
+ bExtendedParameters = false;
nParaFlags = 0;
nBulletFlags = 0;
nBulletOfs = 0;
nTextOfs = 0;
- bExtendedBulletsUsed = sal_False;
+ bExtendedBulletsUsed = false;
nBulletId = 0xffff;
- bNumberingIsNumber = sal_True;
+ bNumberingIsNumber = true;
};
};
@@ -219,7 +221,7 @@ struct FontCollectionEntry
sal_Int16 CharSet;
String Original;
- sal_Bool bIsConverted;
+ bool bIsConverted;
FontCollectionEntry( const String& rName, sal_Int16 nFamily, sal_Int16 nPitch, sal_Int16 nCharSet ) :
Scaling ( 1.0 ),
@@ -318,14 +320,14 @@ struct PPTExCharSheet
void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
FontCollection& rFontCollection, int nLevel );
- void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
+ void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, bool bFirst, bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
};
struct PPTExParaLevel
{
- sal_Bool mbIsBullet;
+ bool mbIsBullet;
sal_uInt16 mnBulletChar;
sal_uInt16 mnBulletFont;
sal_uInt16 mnBulletHeight;
@@ -339,7 +341,7 @@ struct PPTExParaLevel
sal_uInt16 mnBulletOfs;
sal_uInt16 mnDefaultTab;
- sal_Bool mbExtendedBulletsUsed;
+ bool mbExtendedBulletsUsed;
sal_uInt16 mnBulletId;
sal_uInt16 mnBulletStart;
sal_uInt32 mnMappedNumType;
@@ -359,7 +361,7 @@ struct PPTExParaSheet
void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
FontCollection& rFontCollection, int nLevel, const PPTExCharLevel& rCharLevel );
- void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
+ void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, bool bFirst, bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
};
@@ -379,7 +381,7 @@ class PPTExStyleSheet
void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
FontCollection& rFontCollection, int nInstance, int nLevel );
- sal_Bool IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue );
+ bool IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue );
sal_uInt32 SizeOfTxCFStyleAtom() const;
void WriteTxCFStyleAtom( SvStream& rSt );
@@ -474,8 +476,8 @@ class GroupTable
sal_uInt32 GetGroupsClosed();
void ResetGroupTable( sal_uInt32 nCount );
void ClearGroupTable();
- sal_Bool EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex );
- sal_Bool GetNextGroupEntry();
+ bool EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex );
+ bool GetNextGroupEntry();
GroupTable();
~GroupTable();
};
@@ -489,17 +491,18 @@ class PropValue
::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet > mXPropSet;
- sal_Bool ImplGetPropertyValue( const String& rString );
- sal_Bool ImplGetPropertyValue( const ::com::sun::star::uno::Reference
+ basegfx::B2DHomMatrix ImplGetObjectTransformation();
+ bool ImplGetPropertyValue( const String& rString );
+ bool ImplGetPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet > &, const String& );
public :
- static sal_Bool GetPropertyValue(
+ static bool GetPropertyValue(
::com::sun::star::uno::Any& rAny,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
const String& rPropertyName,
- sal_Bool bTestPropertyAvailability = sal_False );
+ bool bTestPropertyAvailability = false );
static ::com::sun::star::beans::PropertyState GetPropertyState(
const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
@@ -514,7 +517,7 @@ class PropStateValue : public PropValue
::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState > mXPropState;
- sal_Bool ImplGetPropertyValue( const String& rString, sal_Bool bGetPropertyState = sal_True );
+ bool ImplGetPropertyValue( const String& rString, bool bGetPropertyState = true );
};
@@ -533,7 +536,7 @@ class PortionObj : public PropStateValue
sal_uInt32 ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef, String& rURL );
sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
- void ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue = sal_False );
+ void ImplGetPortionValues( FontCollection& rFontCollection, bool bGetPropStateValue = false );
public :
@@ -553,19 +556,19 @@ class PortionObj : public PropStateValue
sal_Int16 mnCharEscapement;
sal_uInt32 mnTextSize;
- sal_Bool mbLastPortion;
+ bool mbLastPortion;
sal_uInt16* mpText;
FieldEntry* mpFieldEntry;
PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
- sal_Bool bLast, FontCollection& rFontCollection );
+ bool bLast, FontCollection& rFontCollection );
PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
FontCollection& rFontCollection );
PortionObj( const PortionObj& rPortionObj );
~PortionObj();
- void Write( SvStream* pStrm, sal_Bool bLast );
+ void Write( SvStream* pStrm, bool bLast );
sal_uInt32 Count() const { return mnTextSize; };
PortionObj& operator=( const PortionObj& rPortionObj );
@@ -573,10 +576,10 @@ class PortionObj : public PropStateValue
struct ParaFlags
{
- sal_Bool bFirstParagraph : 1;
- sal_Bool bLastParagraph : 1;
+ bool bFirstParagraph : 1;
+ bool bLastParagraph : 1;
- ParaFlags() { bFirstParagraph = sal_True; bLastParagraph = sal_False; };
+ ParaFlags() { bFirstParagraph = true; bLastParagraph = false; };
};
class ParagraphObj : public List, public PropStateValue, public SOParagraph
@@ -584,16 +587,13 @@ class ParagraphObj : public List, public PropStateValue, public SOParagraph
friend class TextObj;
friend struct PPTExParaSheet;
- MapMode maMapModeSrc;
- MapMode maMapModeDest;
-
protected :
void ImplConstruct( const ParagraphObj& rParagraphObj );
void ImplClear();
sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
- void ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue = sal_False );
- void ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue = sal_False );
+ void ImplGetParagraphValues( PPTExBulletProvider& rBuProv, bool bGetPropStateValue = false );
+ void ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nDepth, bool bIsBullet, bool bGetPropStateValue = false );
public :
@@ -601,9 +601,9 @@ class ParagraphObj : public List, public PropStateValue, public SOParagraph
sal_uInt32 mnTextSize;
- sal_Bool mbIsBullet;
- sal_Bool mbFirstParagraph;
- sal_Bool mbLastParagraph;
+ bool mbIsBullet;
+ bool mbFirstParagraph;
+ bool mbLastParagraph;
::com::sun::star::beans::PropertyState meBullet;
::com::sun::star::beans::PropertyState meTextAdjust;
@@ -618,8 +618,8 @@ class ParagraphObj : public List, public PropStateValue, public SOParagraph
sal_Int16 mnLineSpacing;
sal_Int16 mnLineSpacingTop;
sal_Int16 mnLineSpacingBottom;
- sal_Bool mbForbiddenRules;
- sal_Bool mbParagraphPunctation;
+ bool mbForbiddenRules;
+ bool mbParagraphPunctation;
sal_uInt16 mnBiDi;
ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContentRef,
@@ -644,8 +644,8 @@ struct ImplTextObj
sal_uInt32 mnTextSize;
int mnInstance;
List* mpList;
- sal_Bool mbHasExtendedBullets;
- sal_Bool mbFixedCellHeightUsed;
+ bool mbHasExtendedBullets;
+ bool mbFixedCellHeightUsed;
ImplTextObj( int nInstance );
~ImplTextObj();
@@ -668,7 +668,7 @@ class TextObj
ParagraphObj* Next(){ return(ParagraphObj*)mpImplTextObj->mpList->Next(); };
sal_uInt32 Count() const { return mpImplTextObj->mnTextSize; };
int GetInstance() const { return mpImplTextObj->mnInstance; };
- sal_Bool HasExtendedBullets(){ return mpImplTextObj->mbHasExtendedBullets; };
+ bool HasExtendedBullets(){ return mpImplTextObj->mbHasExtendedBullets; };
void WriteTextSpecInfo( SvStream* pStrm );
TextObj& operator=( TextObj& rTextObj );
@@ -678,23 +678,19 @@ class TextObj
struct CellBorder;
class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvider
{
- sal_Bool mbStatus;
- sal_Bool mbUseNewAnimations;
sal_uInt32 mnStatMaxValue;
sal_uInt32 mnLatestStatValue;
std::vector< PPTExStyleSheet* > maStyleSheetList;
PPTExStyleSheet* mpStyleSheet;
-
- Fraction maFraction;
- MapMode maMapModeSrc;
- MapMode maMapModeDest;
- ::com::sun::star::awt::Size maDestPageSize;
+ double mfMap100thMmToMs;
+ basegfx::B2DHomMatrix maMap100thMmToMs;
+ basegfx::B2DHomMatrix maInvMap100thMmToMs;
+ basegfx::B2DVector maDestPageSize;
Size maPageSize; // #121183# Keep size in logic coordinates (100th mm)
- ::com::sun::star::awt::Size maNotesPageSize;
+ basegfx::B2DVector maNotesPageSize;
PageType meLatestPageType;
List maSlideNameList;
rtl::OUString maBaseURI;
-
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mXModel;
::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mXStatusIndicator;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPagesSupplier > mXDrawPagesSupplier;
@@ -710,53 +706,55 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > mXCursorText; // TextRef des Teilstuecks des Cursors
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXCursorPropSet; // die Properties des Teilstueckes
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > mXTextField;
- ::com::sun::star::awt::Size maSize;
- ::com::sun::star::awt::Point maPosition;
- Rectangle maRect;
- ByteString mType;
- sal_Bool mbPresObj;
- sal_Bool mbEmptyPresObj;
- sal_Bool mbStatusIndicator;
- sal_Int32 mnAngle;
- sal_uInt32 mnTextStyle;
-
- sal_Bool mbFontIndependentLineSpacing;
- sal_uInt32 mnTextSize;
-
- SvStorageRef mrStg;
- SvStream* mpCurUserStrm;
- SvStream* mpStrm;
- SvStream* mpPicStrm;
- PptEscherEx* mpPptEscherEx;
- List maExOleObj;
- sal_uInt32 mnVBAOleOfs;
- SvMemoryStream* mpVBA;
- sal_uInt32 mnExEmbed;
- SvMemoryStream* mpExEmbed;
-
- sal_uInt32 mnPages; // anzahl einzelner Slides ( ohne masterpages & notes & handout )
- sal_uInt32 mnMasterPages; //
- sal_uInt32 mnDrawings; // anzahl Slides + masterpages + notes + handout
- sal_uInt32 mnPagesWritten;
- sal_uInt32 mnUniqueSlideIdentifier;
- sal_uInt32 mnTxId; // Identifier determined by the HOST (PP) ????
- sal_uInt32 mnDiaMode; // 0 -> manuell
- // 1 -> halbautomatisch
- // 2 -> automatisch
-
- sal_uInt32 mnShapeMasterTitle;
- sal_uInt32 mnShapeMasterBody;
-
- List maHyperlink;
-
- FontCollection maFontCollection;
- ppt::ExSoundCollection maSoundCollection;
+ // the object range, split in pos and scale to keep the evtl. negative size (mirroring)
+ basegfx::B2DRange maObjectRange;
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose maObjTrans;
+// basegfx::B2DRange maObjectRange; // TTTT mirrored needed here ?!?
+ sal_uInt32 mnMirrorFlags;
+// bool mbMirroredX;
+// bool mbMirroredY;
+ double mfObjectRotation;
+
+ ByteString mType;
+ sal_uInt32 mnTextStyle;
+ sal_uInt32 mnTextSize;
+ SvStorageRef mrStg;
+ SvStream* mpCurUserStrm;
+ SvStream* mpStrm;
+ SvStream* mpPicStrm;
+ PptEscherEx* mpPptEscherEx;
+ List maExOleObj;
+ sal_uInt32 mnVBAOleOfs;
+ SvMemoryStream* mpVBA;
+ sal_uInt32 mnExEmbed;
+ SvMemoryStream* mpExEmbed;
+ sal_uInt32 mnPages; // anzahl einzelner Slides ( ohne masterpages & notes & handout )
+ sal_uInt32 mnMasterPages; //
+ sal_uInt32 mnDrawings; // anzahl Slides + masterpages + notes + handout
+ sal_uInt32 mnPagesWritten;
+ sal_uInt32 mnUniqueSlideIdentifier;
+ sal_uInt32 mnTxId; // Identifier determined by the HOST (PP) ????
+ sal_uInt32 mnDiaMode; // 0 -> manuell
+ // 1 -> halbautomatisch
+ // 2 -> automatisch
+ sal_uInt32 mnShapeMasterTitle;
+ sal_uInt32 mnShapeMasterBody;
+ List maHyperlink;
+ FontCollection maFontCollection;
+ ppt::ExSoundCollection maSoundCollection;
+
+ /// bitfield
+ bool mbStatus : 1;
+ bool mbUseNewAnimations : 1;
+ bool mbPresObj : 1;
+ bool mbEmptyPresObj : 1;
+ bool mbStatusIndicator : 1;
+ bool mbFontIndependentLineSpacing : 1;
PHLayout& ImplGetLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const;
void ImplWriteExtParaHeader( SvMemoryStream& rSt, sal_uInt32 nRef, sal_uInt32 nInstance, sal_uInt32 nSlideId );
-
sal_uInt32 ImplProgBinaryTag( SvStream* pOutStrm = NULL );
sal_uInt32 ImplProgBinaryTagContainer( SvStream* pOutStrm = NULL, SvMemoryStream* pBinTag = NULL );
sal_uInt32 ImplProgTagContainer( SvStream* pOutStrm = NULL, SvMemoryStream* pBinTag = NULL );
@@ -771,74 +769,71 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
protected:
- sal_Bool ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags );
- sal_Bool ImplCreateCurrentUserStream();
+ bool ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags );
+ bool ImplCreateCurrentUserStream();
void ImplCreateHeaderFooterStrings( SvStream& rOut,
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPagePropSet );
void ImplCreateHeaderFooters( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPagePropSet );
- sal_Bool ImplCreateDocument();
- sal_Bool ImplCreateHyperBlob( SvMemoryStream& rStream );
+ bool ImplCreateDocument();
+ bool ImplCreateHyperBlob( SvMemoryStream& rStream );
sal_uInt32 ImplInsertBookmarkURL( const String& rBookmark, const sal_uInt32 nType,
const String& rStringVer0, const String& rStringVer1, const String& rStringVer2, const String& rStringVer3 );
- sal_Bool ImplCreateMaster( sal_uInt32 nPageNum );
- sal_Bool ImplCreateMainNotes();
- sal_Bool ImplCreateSlide( sal_uInt32 nPageNum );
- sal_Bool ImplCreateNotes( sal_uInt32 nPageNum );
+ bool ImplCreateMaster( sal_uInt32 nPageNum );
+ bool ImplCreateMainNotes();
+ bool ImplCreateSlide( sal_uInt32 nPageNum );
+ bool ImplCreateNotes( sal_uInt32 nPageNum );
void ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXBackgroundPropSet );
void ImplWriteVBA( SvMemoryStream* pVBA );
void ImplWriteOLE( sal_uInt32 nCnvrtFlags );
- sal_Bool ImplWriteAtomEnding();
+ bool ImplWriteAtomEnding();
- sal_Bool ImplInitSOIface();
- sal_Bool ImplSetCurrentStyleSheet( sal_uInt32 nPageNum );
- sal_Bool ImplGetPageByIndex( sal_uInt32 nIndex, PageType );
- sal_Bool ImplGetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup = sal_False );
+ bool ImplInitSOIface();
+ bool ImplSetCurrentStyleSheet( sal_uInt32 nPageNum );
+ bool ImplGetPageByIndex( sal_uInt32 nIndex, PageType );
+ bool ImplGetShapeByIndex( sal_uInt32 nIndex, bool bGroup = false );
sal_uInt32 ImplGetMasterIndex( PageType ePageType );
- void ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt );
- sal_Bool ImplGetText();
- sal_Bool ImplCreatePresentationPlaceholder( const sal_Bool bMaster, const PageType PageType,
+ void ImplHandleRotation( EscherPropertyContainer& rPropOpt );
+ bool ImplGetText();
+ bool ImplCreatePresentationPlaceholder( const bool bMaster, const PageType PageType,
const sal_uInt32 StyleInstance, const sal_uInt8 PlaceHolderId );
- sal_Bool ImplGetEffect( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
+ bool ImplGetEffect( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
::com::sun::star::presentation::AnimationEffect& eEffect,
::com::sun::star::presentation::AnimationEffect& eTextEffect,
- sal_Bool& bHasSound );
+ bool& bHasSound );
void ImplWriteObjectEffect( SvStream& rSt,
::com::sun::star::presentation::AnimationEffect eEffect,
::com::sun::star::presentation::AnimationEffect eTextEffect,
sal_uInt16 nOrder );
- void ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentation::ClickAction eAction, sal_Bool bMediaClickAction );
- sal_Bool ImplGetStyleSheets();
+ void ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentation::ClickAction eAction, bool bMediaClickAction );
+ bool ImplGetStyleSheets();
void ImplWriteParagraphs( SvStream& rOutStrm, TextObj& rTextObj );
void ImplWritePortions( SvStream& rOutStrm, TextObj& rTextObj );
void ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_uInt32 nAtomInstance,
TextRuleEntry* pTextRule, SvStream& rExtBu, EscherPropertyContainer* );
void ImplAdjustFirstLineLineSpacing( TextObj& rTextObj, EscherPropertyContainer& rPropOpt );
void ImplCreateShape( sal_uInt32 nType, sal_uInt32 nFlags, EscherSolverContainer& );
- void ImplCreateTextShape( EscherPropertyContainer&, EscherSolverContainer&, sal_Bool bFill );
+ void ImplCreateTextShape( EscherPropertyContainer&, EscherSolverContainer&, bool bFill );
void ImplWritePage( const PHLayout& rLayout,
EscherSolverContainer& rSolver,
PageType ePageType,
- sal_Bool bMaster,
+ bool bMaster,
int nPageNumber = 0 );
- sal_Bool ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 );
+ bool ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 );
void ImplCreateTable( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rXShape, EscherSolverContainer& aSolverContainer,
EscherPropertyContainer& aPropOpt );
- ::com::sun::star::awt::Point ImplMapPoint( const ::com::sun::star::awt::Point& );
- ::com::sun::star::awt::Size ImplMapSize( const ::com::sun::star::awt::Size& );
- Rectangle ImplMapRectangle( const ::com::sun::star::awt::Rectangle& );
- sal_Bool ImplCloseDocument(); // die font-, hyper-, Soundliste wird geschrieben ..
+ bool ImplCloseDocument(); // die font-, hyper-, Soundliste wird geschrieben ..
public:
- PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef& rSvStorage,
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel,
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rStatInd,
- SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags );
+ PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef& rSvStorage,
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel,
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rStatInd,
+ SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags );
- ~PPTWriter();
+ ~PPTWriter();
- sal_Bool IsValid() const { return mbStatus; };
+ bool IsValid() const { return mbStatus; };
};
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 6e9e9d0267a3..3fd48f75c960 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -40,9 +40,6 @@
#include <vcl/gradient.hxx>
#include <sfx2/app.hxx>
#include <svl/languageoptions.hxx>
-//#ifndef _SVX_XIT_HXX
-//#include <svx/xit.hxx>
-//#endif
#include <editeng/svxenum.hxx>
#include <svx/unoapi.hxx>
#include <svx/svdoashp.hxx>
@@ -97,24 +94,18 @@
#include <unotools/ucbstreamhelper.hxx>
#include <com/sun/star/text/FontRelief.hpp>
#include <editeng/frmdiritem.hxx>
-/*
-#include <editeng/outliner.hxx>
-#include <editeng/outlobj.hxx>
-#include <svx/svdmodel.hxx>
-*/
#include <svtools/fltcall.hxx>
#include <com/sun/star/table/XTable.hpp>
#include <com/sun/star/table/XMergeableCell.hpp>
#include <com/sun/star/table/BorderLine.hpp>
#include <set>
-
-//#include <svx/xbtmpit.hxx>
-
#include "i18npool/mslangid.hxx"
-
#include <vos/xception.hxx>
-using namespace vos;
+#include <svx/svdlegacy.hxx>
+#include <svx/svdocirc.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+using namespace vos;
using namespace ::com::sun::star;
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -165,7 +156,6 @@ sal_uInt16 PPTExBulletProvider::GetId( const ByteString& rUniqueId, Size& rGraph
if ( rUniqueId.Len() )
{
- Rectangle aRect;
GraphicObject aGraphicObject( rUniqueId );
Graphic aMappedGraphic, aGraphic( aGraphicObject.GetGraphic() );
Size aPrefSize( aGraphic.GetPrefSize() );
@@ -196,7 +186,7 @@ sal_uInt16 PPTExBulletProvider::GetId( const ByteString& rUniqueId, Size& rGraph
}
}
- nId = pGraphicProv->GetBlibID( aBuExPictureStream, aGraphicObject.GetUniqueID(), aRect, NULL, NULL );
+ nId = pGraphicProv->GetBlibID( aBuExPictureStream, aGraphicObject.GetUniqueID(), basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), NULL, NULL );
if ( nId && ( nId < 0x10000 ) )
nRetValue = (sal_uInt16)nId - 1;
@@ -241,9 +231,9 @@ void GroupTable::ImplResizeGroupTable( sal_uInt32 nEntrys )
// ---------------------------------------------------------------------------------------------
-sal_Bool GroupTable::EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rXIndexAccessRef )
+bool GroupTable::EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rXIndexAccessRef )
{
- sal_Bool bRet = sal_False;
+ bool bRet(false);
if ( rXIndexAccessRef.is() )
{
GroupEntry* pNewGroup = new GroupEntry( rXIndexAccessRef );
@@ -252,7 +242,7 @@ sal_Bool GroupTable::EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::s
if ( mnMaxGroupEntry == mnCurrentGroupEntry )
ImplResizeGroupTable( mnMaxGroupEntry + 8 );
mpGroupEntry[ mnCurrentGroupEntry++ ] = pNewGroup;
- bRet = sal_True;
+ bRet = true;
}
else
delete pNewGroup;
@@ -287,21 +277,21 @@ void GroupTable::ResetGroupTable( sal_uInt32 nCount )
// ---------------------------------------------------------------------------------------------
-sal_Bool GroupTable::GetNextGroupEntry()
+bool GroupTable::GetNextGroupEntry()
{
while ( mnCurrentGroupEntry )
{
mnIndex = mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mnCurrentPos++;
if ( mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mnCount > mnIndex )
- return sal_True;
+ return true;
delete ( mpGroupEntry[ --mnCurrentGroupEntry ] );
if ( mnCurrentGroupEntry )
mnGroupsClosed++;
}
- return sal_False;
+ return false;
}
// ---------------------------------------------------------------------------------------------
@@ -318,12 +308,12 @@ void FontCollectionEntry::ImplInit( const String& rName )
if ( aSubstName.Len() )
{
Name = aSubstName;
- bIsConverted = sal_True;
+ bIsConverted = true;
}
else
{
Name = rName;
- bIsConverted = sal_False;
+ bIsConverted = false;
}
}
@@ -706,7 +696,7 @@ sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const String& rBookmarkURL, const s
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCloseDocument()
+bool PPTWriter::ImplCloseDocument()
{
sal_uInt32 nOfs = mpPptEscherEx->PtGetOffsetByID( EPP_Persist_Document );
if ( nOfs )
@@ -720,12 +710,12 @@ sal_Bool PPTWriter::ImplCloseDocument()
EscherExAtom aTxMasterStyleAtom( aTxMasterStyleAtomStrm, EPP_TxMasterStyleAtom, EPP_TEXTTYPE_Other );
aTxMasterStyleAtomStrm << (sal_uInt16)5; // paragraph count
sal_uInt16 nLev;
- sal_Bool bFirst = sal_True;
+ bool bFirst(true);
for ( nLev = 0; nLev < 5; nLev++ )
{
- mpStyleSheet->mpParaSheet[ EPP_TEXTTYPE_Other ]->Write( aTxMasterStyleAtomStrm, mpPptEscherEx, nLev, bFirst, sal_False, mXPagePropSet );
- mpStyleSheet->mpCharSheet[ EPP_TEXTTYPE_Other ]->Write( aTxMasterStyleAtomStrm, mpPptEscherEx, nLev, bFirst, sal_False, mXPagePropSet );
- bFirst = sal_False;
+ mpStyleSheet->mpParaSheet[ EPP_TEXTTYPE_Other ]->Write( aTxMasterStyleAtomStrm, mpPptEscherEx, nLev, bFirst, false, mXPagePropSet );
+ mpStyleSheet->mpCharSheet[ EPP_TEXTTYPE_Other ]->Write( aTxMasterStyleAtomStrm, mpPptEscherEx, nLev, bFirst, false, mXPagePropSet );
+ bFirst = false;
}
}
@@ -859,24 +849,24 @@ sal_Bool PPTWriter::ImplCloseDocument()
if ( nOldPos )
{
mpStrm->Seek( nOldPos );
- return sal_True;
+ return true;
}
}
- return sal_False;
+ return false;
}
// ---------------------------------------------------------------------------------------------
-sal_Bool PropValue::GetPropertyValue(
+bool PropValue::GetPropertyValue(
::com::sun::star::uno::Any& rAny,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
const String& rString,
- sal_Bool bTestPropertyAvailability )
+ bool bTestPropertyAvailability )
{
- sal_Bool bRetValue = sal_True;
+ bool bRetValue(true);
if ( bTestPropertyAvailability )
{
- bRetValue = sal_False;
+ bRetValue = false;
try
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
@@ -886,7 +876,7 @@ sal_Bool PropValue::GetPropertyValue(
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = sal_False;
+ bRetValue = false;
}
}
if ( bRetValue )
@@ -895,11 +885,11 @@ sal_Bool PropValue::GetPropertyValue(
{
rAny = rXPropSet->getPropertyValue( rString );
if ( !rAny.hasValue() )
- bRetValue = sal_False;
+ bRetValue = false;
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = sal_False;
+ bRetValue = false;
}
}
return bRetValue;
@@ -928,35 +918,51 @@ sal_Bool PropValue::GetPropertyValue(
// ---------------------------------------------------------------------------------------------
-sal_Bool PropValue::ImplGetPropertyValue( const String& rString )
+bool PropValue::ImplGetPropertyValue( const String& rString )
{
return GetPropertyValue( mAny, mXPropSet, rString );
}
// ---------------------------------------------------------------------------------------------
-sal_Bool PropValue::ImplGetPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & aXPropSet, const String& rString )
+basegfx::B2DHomMatrix PropValue::ImplGetObjectTransformation()
+{
+ basegfx::B2DHomMatrix aRetval;
+
+ if(GetPropertyValue(mAny, mXPropSet, String(RTL_CONSTASCII_USTRINGPARAM("Transformation"))))
+ {
+ drawing::HomogenMatrix3 aMatrix;
+ mAny >>= aMatrix;
+ aRetval = basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix);
+ }
+
+ return aRetval;
+}
+
+// ---------------------------------------------------------------------------------------------
+
+bool PropValue::ImplGetPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & aXPropSet, const String& rString )
{
return GetPropertyValue( mAny, aXPropSet, rString );
}
// ---------------------------------------------------------------------------------------------
-sal_Bool PropStateValue::ImplGetPropertyValue( const String& rString, sal_Bool bGetPropertyState )
+bool PropStateValue::ImplGetPropertyValue( const String& rString, bool bGetPropertyState )
{
ePropState = ::com::sun::star::beans::PropertyState_AMBIGUOUS_VALUE;
- sal_Bool bRetValue = sal_True;
+ bool bRetValue(true);
#ifdef UNX
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
aXPropSetInfo( mXPropSet->getPropertySetInfo() );
if ( !aXPropSetInfo.is() )
- return sal_False;
+ return false;
#endif
try
{
mAny = mXPropSet->getPropertyValue( rString );
if ( !mAny.hasValue() )
- bRetValue = sal_False;
+ bRetValue = false;
else if ( bGetPropertyState )
ePropState = mXPropState->getPropertyState( rString );
else
@@ -964,16 +970,16 @@ sal_Bool PropStateValue::ImplGetPropertyValue( const String& rString, sal_Bool b
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = sal_False;
+ bRetValue = false;
}
return bRetValue;
}
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplInitSOIface()
+bool PPTWriter::ImplInitSOIface()
{
- while( sal_True )
+ while( true )
{
mXDrawPagesSupplier = ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPagesSupplier >
@@ -997,29 +1003,29 @@ sal_Bool PPTWriter::ImplInitSOIface()
if ( !ImplGetPageByIndex( 0, NORMAL ) )
break;
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplSetCurrentStyleSheet( sal_uInt32 nPageNum )
+bool PPTWriter::ImplSetCurrentStyleSheet( sal_uInt32 nPageNum )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if ( nPageNum >= maStyleSheetList.size() )
nPageNum = 0;
else
- bRet = sal_True;
+ bRet = true;
mpStyleSheet = maStyleSheetList[ nPageNum ];
return bRet;
}
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
+bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
{
- while( sal_True )
+ while( true )
{
if ( ePageType != meLatestPageType )
{
@@ -1030,7 +1036,7 @@ sal_Bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
{
mXDrawPages = mXDrawPagesSupplier->getDrawPages();
if( !mXDrawPages.is() )
- return sal_False;
+ return false;
}
break;
@@ -1038,7 +1044,7 @@ sal_Bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
{
mXDrawPages = mXMasterPagesSupplier->getMasterPages();
if( !mXDrawPages.is() )
- return sal_False;
+ return false;
}
break;
default:
@@ -1073,7 +1079,7 @@ sal_Bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
/* try to get the "real" background PropertySet. If the normal page is not supporting this property, it is
taken the property from the master */
- sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ), sal_True );
+ bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ), true );
if ( bHasBackground )
bHasBackground = ( aAny >>= mXBackgroundPropSet );
if ( !bHasBackground )
@@ -1091,7 +1097,7 @@ sal_Bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
( aXMasterDrawPage, ::com::sun::star::uno::UNO_QUERY );
if ( aXMasterPagePropSet.is() )
{
- sal_Bool bBackground = GetPropertyValue( aAny, aXMasterPagePropSet,
+ bool bBackground = GetPropertyValue( aAny, aXMasterPagePropSet,
String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
if ( bBackground )
{
@@ -1101,18 +1107,18 @@ sal_Bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
}
}
}
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
// ---------------------------------------------------------------------------------------------
-sal_Bool PPTWriter::ImplGetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup )
+bool PPTWriter::ImplGetShapeByIndex( sal_uInt32 nIndex, bool bGroup )
{
- while(sal_True)
+ while(true)
{
- if ( ( bGroup == sal_False ) || ( GetCurrentGroupLevel() == 0 ) )
+ if ( ( bGroup == false ) || ( GetCurrentGroupLevel() == 0 ) )
{
::com::sun::star::uno::Any aAny( mXShapes->getByIndex( nIndex ) );
aAny >>= mXShape;
@@ -1130,29 +1136,102 @@ sal_Bool PPTWriter::ImplGetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup )
if ( !mXPropSet.is() )
break;
- maPosition = ImplMapPoint( mXShape->getPosition() );
- maSize = ImplMapSize( mXShape->getSize() );
- maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
+
+ // get object transformation
+ maObjTrans = ImplGetObjectTransformation();
+
+ // map to PPt metrics
+ maObjTrans.setScale(maMap100thMmToMs* maObjTrans.getScale());
+ maObjTrans.setTranslate(maMap100thMmToMs * maObjTrans.getTranslate());
+
+ // Use translation and scale to create range. Use signed scale
+ // to get the unrotated SnapRect
+ maObjectRange = basegfx::B2DRange(
+ maObjTrans.getTranslate(),
+ maObjTrans.getTranslate() + maObjTrans.getScale());
+
+ // check mirroring
+ bool bMirroredX(maObjTrans.getScale().getX() < 0.0);
+ bool bMirroredY(maObjTrans.getScale().getY() < 0.0);
+
+ // get rotation
+ mfObjectRotation = maObjTrans.getRotate();
+
+ // if mirror is X and Y, replace with 180 degree rotation. Prefer
+ // rotation export over mirror export.
+ if(bMirroredX && bMirroredY)
+ {
+ bMirroredX = bMirroredY = false;
+ mfObjectRotation += F_PI;
+ }
+
+ // reset mirror flags
+ mnMirrorFlags = 0;
+
+ // set mirror flags
+ if(bMirroredX)
+ {
+ mnMirrorFlags |= SHAPEFLAG_FLIPH;
+ }
+
+ if(bMirroredY)
+ {
+ mnMirrorFlags |= SHAPEFLAG_FLIPV;
+ }
+
+ if(bMirroredX != bMirroredY)
+ {
+ // if one axis is mirrored, invert the rotation
+ mfObjectRotation = -mfObjectRotation;
+ }
+
+// mbMirroredX = aObjTrans.getScale().getX() < 0.0;
+// mbMirroredY = aObjTrans.getScale().getY() < 0.0;
+
+ // mbMirroredX and mbMirroredY are new aspects to handle. The text
+ // in offices before transformation ignored mirrorX and used a 180
+ // deg rotation for mirrorY. To get close to the old behaviour, use
+ // mbMirroredY to apply a 180 deg rotation to mimic old behaviour.
+ // Do not forget to adapt the object's range!
+// if(mbMirroredY)
+// {
+// // adapt object range
+// maObjectRange.transform(basegfx::tools::createRotateAroundPoint(maObjectRange.getMaximum(), -M_PI));
+//
+// // add to rotation and clear mirror flag
+// mfObjectRotation += M_PI;
+// mbMirroredX = false;
+// }
+
+ // assert shear (not supported yet)
+ if(!basegfx::fTools::equalZero(maObjTrans.getShearX()))
+ {
+ OSL_ENSURE(false, "PPt export: shear is not supported (!)");
+ }
+
mType = ByteString( String( mXShape->getShapeType() ), RTL_TEXTENCODING_UTF8 );
mType.Erase( 0, 13 ); // "com.sun.star." entfernen
sal_uInt16 nPos = mType.Search( (const char*)"Shape" );
mType.Erase( nPos, 5 );
- mbPresObj = mbEmptyPresObj = sal_False;
+ mbPresObj = mbEmptyPresObj = false;
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsPresentationObject" ) ) ) )
- mAny >>= mbPresObj;
+ {
+ sal_Bool bValue(sal_False);
+ mAny >>= bValue;
+ mbPresObj = bValue;
+ }
if ( mbPresObj && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsEmptyPresentationObject" ) ) ) )
- mAny >>= mbEmptyPresObj;
-
- mnAngle = ( PropValue::GetPropertyValue( aAny,
- mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True ) )
- ? *((sal_Int32*)aAny.getValue() )
- : 0;
+ {
+ sal_Bool bValue(sal_False);
+ mAny >>= bValue;
+ mbEmptyPresObj = bValue;
+ }
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
@@ -1188,10 +1267,10 @@ sal_uInt32 PPTWriter::ImplGetMasterIndex( PageType ePageType )
// -----------------------------------------------------------------------
-sal_Bool PPTWriter::ImplGetStyleSheets()
+bool PPTWriter::ImplGetStyleSheets()
{
int nInstance, nLevel;
- sal_Bool bRetValue = sal_False;
+ bool bRetValue(false);
sal_uInt32 nPageNum;
for ( nPageNum = 0; nPageNum < mnMasterPages; nPageNum++ )
@@ -1327,14 +1406,14 @@ sal_Bool PPTWriter::ImplGetStyleSheets()
void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
{
- sal_Bool bFirstParagraph = sal_True;
+ bool bFirstParagraph(true);
sal_uInt32 nCharCount;
sal_uInt32 nPropertyFlags = 0;
sal_uInt16 nDepth = 0;
sal_Int16 nLineSpacing;
int nInstance = rTextObj.GetInstance();
- for ( ParagraphObj* pPara = rTextObj.First() ; pPara; pPara = rTextObj.Next(), bFirstParagraph = sal_False )
+ for ( ParagraphObj* pPara = rTextObj.First() ; pPara; pPara = rTextObj.Next(), bFirstParagraph = false )
{
PortionObj* pPortion = (PortionObj*)pPara->First();
nCharCount = pPara->Count();
@@ -1433,10 +1512,14 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
sal_uInt32 nBulletColor = pPara->nBulletColor;
if ( nBulletColor == COL_AUTO )
{
- sal_Bool bIsDark = sal_False;
+ bool bIsDark(false);
::com::sun::star::uno::Any aAny;
- if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
- aAny >>= bIsDark;
+ if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), true ) )
+ {
+ sal_Bool bBool(sal_False);
+ aAny >>= bBool;
+ bIsDark = bBool;
+ }
nBulletColor = bIsDark ? 0xffffff : 0x000000;
}
nBulletColor &= 0xffffff;
@@ -1486,10 +1569,14 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
if ( nCharColor == COL_AUTO ) // nCharColor depends to the background color
{
- sal_Bool bIsDark = sal_False;
+ bool bIsDark(false);
::com::sun::star::uno::Any aAny;
- if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
- aAny >>= bIsDark;
+ if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), true ) )
+ {
+ sal_Bool bBool(sal_False);
+ aAny >>= bBool;
+ bIsDark = bBool;
+ }
nCharColor = bIsDark ? 0xffffff : 0x000000;
}
@@ -1512,9 +1599,9 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
case ::com::sun::star::drawing::FillStyle_GRADIENT :
{
- Point aEmptyPoint = Point();
- Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
- EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
+ basegfx::B2DRange aPageRange(0.0, 0.0, 28000.0, 21000.0);
+ EscherPropertyContainer aPropOpt(mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aPageRange);
+
aPropOpt.CreateGradientProperties( mXPropSet );
aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
}
@@ -1535,9 +1622,9 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
case ::com::sun::star::drawing::FillStyle_GRADIENT :
{
- Point aEmptyPoint = Point();
- Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
- EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
+ basegfx::B2DRange aPageRange(0.0, 0.0, 28000.0, 21000.0);
+ EscherPropertyContainer aPropOpt(mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aPageRange);
+
aPropOpt.CreateGradientProperties( mXBackgroundPropSet );
aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
}
@@ -1578,7 +1665,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
if ( aPropSetOfNextShape.is() )
{
if ( PropValue::GetPropertyValue( aAny, aPropSetOfNextShape,
- String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), sal_True ) )
+ String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ), true ) )
{
if ( nCharColor == mpPptEscherEx->GetColor( *((sal_uInt32*)aAny.getValue()) ) )
{
@@ -1655,10 +1742,10 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
// ----------------------------------------------------------------------------------------
// laedt und konvertiert text aus shape, ergebnis ist mnTextSize gespeichert;
-sal_Bool PPTWriter::ImplGetText()
+bool PPTWriter::ImplGetText()
{
mnTextSize = 0;
- mbFontIndependentLineSpacing = sal_False;
+ mbFontIndependentLineSpacing = false;
mXText = ::com::sun::star::uno::Reference<
::com::sun::star::text::XSimpleText >
( mXShape, ::com::sun::star::uno::UNO_QUERY );
@@ -1667,46 +1754,56 @@ sal_Bool PPTWriter::ImplGetText()
{
mnTextSize = mXText->getString().getLength();
::com::sun::star::uno::Any aAny;
- if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FontIndependentLineSpacing" ) ) ), sal_True )
- aAny >>= mbFontIndependentLineSpacing;
+ if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FontIndependentLineSpacing" ) ) ), true )
+ {
+ sal_Bool bBool(sal_False);
+ aAny >>= bBool;
+ mbFontIndependentLineSpacing = bBool;
+ }
}
return ( mnTextSize != 0 );
}
// -----------------------------------------------------------------------
-void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt )
+void PPTWriter::ImplHandleRotation( EscherPropertyContainer& rPropOpt )
{
- if ( mnAngle < 0 )
- mnAngle = ( 36000 + mnAngle ) % 36000;
- else
- mnAngle = ( 36000 - ( mnAngle % 36000 ) );
+ if(!basegfx::fTools::equalZero(mfObjectRotation))
+ {
+ // MS shape format rotates around the object center, so adapt adapt ObjectRange
+ // to be centered at the center of the original shape to do this
+ const basegfx::B2DPoint aCurrentCenter(maObjTrans.getB2DHomMatrix() * basegfx::B2DPoint(0.5, 0.5));
+ const basegfx::B2DPoint aObjectRangeCenter(maObjectRange.getCenter());
- double fCos = cos( (double)mnAngle * F_PI18000 );
- double fSin = sin( (double)mnAngle * F_PI18000 );
+ if(!aCurrentCenter.equal(aObjectRangeCenter))
+ {
+ const basegfx::B2DHomMatrix aAdaptToCenterRotation(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ aCurrentCenter - aObjectRangeCenter));
- double fWidthHalf = maRect.GetWidth() / 2;
- double fHeightHalf = maRect.GetHeight() / 2;
+ maObjectRange.transform(aAdaptToCenterRotation);
+ }
- double fXDiff = fCos * fWidthHalf + fSin * (-fHeightHalf);
- double fYDiff = - ( fSin * fWidthHalf - fCos * ( -fHeightHalf ) );
+ // do not use negative mfObjectRotation here, PPT uses the correct orientation, too
+ sal_Int32 nAngle(basegfx::fround(basegfx::snapToZeroRange(mfObjectRotation / F_PI18000, 36000.0)));
- maRect.Move( (sal_Int32)( -( fWidthHalf - fXDiff ) ), (sal_Int32)( - ( fHeightHalf + fYDiff ) ) );
- mnAngle *= 655;
- mnAngle += 0x8000;
- mnAngle &=~0xffff; // nAngle auf volle Gradzahl runden
- rPropOpt.AddOpt( ESCHER_Prop_Rotation, mnAngle );
+ // adapt angle to MS format
+ nAngle *= 655;
+ nAngle += 0x8000;
+ nAngle &=~0xffff; // round to full degrees
+ rPropOpt.AddOpt(ESCHER_Prop_Rotation, nAngle);
- if ( ( mnAngle >= ( 45 << 16 ) && mnAngle < ( 135 << 16 ) ) ||
- ( mnAngle >= ( 225 << 16 ) && mnAngle < ( 315 << 16 ) ) )
- {
- // In diesen beiden Bereichen steht in PPT gemeinerweise die
- // BoundingBox bereits senkrecht. Daher muss diese VOR
- // DER ROTATION flachgelegt werden.
- ::com::sun::star::awt::Point
- aTopLeft( (sal_Int32)( maRect.Left() + fWidthHalf - fHeightHalf ), (sal_Int32)( maRect.Top() + fHeightHalf - fWidthHalf ) );
- Size aNewSize( maRect.GetHeight(), maRect.GetWidth() );
- maRect = Rectangle( Point( aTopLeft.X, aTopLeft.Y ), aNewSize );
+ if((nAngle >= (45 << 16) && nAngle < (135 << 16)) || (nAngle >= (225 << 16) && nAngle < (315 << 16)))
+ {
+ // in this region of rotation the ObjectRange is already rotated,
+ // so do this here, too
+ const basegfx::B2DHomMatrix aMirrorDiagonal(
+ basegfx::tools::createRotateAroundPoint(
+ maObjectRange.getCenter(),
+ F_PI2));
+
+ maObjectRange.transform(aMirrorDiagonal);
+ }
}
}
@@ -1737,17 +1834,17 @@ PortionObj::PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star
mnFont ( 0 ),
mnAsianOrComplexFont( 0xffff ),
mnTextSize ( 0 ),
- mbLastPortion ( sal_True ),
+ mbLastPortion ( true ),
mpText ( NULL ),
mpFieldEntry ( NULL )
{
mXPropSet = rXPropSet;
- ImplGetPortionValues( rFontCollection, sal_False );
+ ImplGetPortionValues( rFontCollection, false );
}
PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRange,
- sal_Bool bLast, FontCollection& rFontCollection ) :
+ bool bLast, FontCollection& rFontCollection ) :
mnCharAttrHard ( 0 ),
mnCharAttr ( 0 ),
mnFont ( 0 ),
@@ -1758,7 +1855,7 @@ PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text
{
String aString( rXTextRange->getString() );
String aURL;
- sal_Bool bRTL_endingParen = sal_False;
+ bool bRTL_endingParen = false;
mnTextSize = aString.Len();
if ( bLast )
@@ -1776,7 +1873,7 @@ PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text
::com::sun::star::beans::XPropertyState >
( rXTextRange, ::com::sun::star::uno::UNO_QUERY );
- sal_Bool bPropSetsValid = ( mXPropSet.is() && mXPropState.is() );
+ bool bPropSetsValid = ( mXPropSet.is() && mXPropState.is() );
if ( bPropSetsValid )
nFieldType = ImplGetTextField( rXTextRange, mXPropSet, aURL );
if ( nFieldType )
@@ -1788,14 +1885,14 @@ PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text
mpFieldEntry->aFieldUrl = aURL;
}
}
- sal_Bool bSymbol = sal_False;
+ bool bSymbol(false);
- if ( bPropSetsValid && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), sal_False ) )
+ if ( bPropSetsValid && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), false ) )
{
sal_Int16 nCharset;
mAny >>= nCharset;
if ( nCharset == ::com::sun::star::awt::CharSet::SYMBOL )
- bSymbol = sal_True;
+ bSymbol = true;
}
if ( mpFieldEntry && ( nFieldType & 0x800000 ) ) // placeholder ?
{
@@ -1813,7 +1910,7 @@ PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text
if ( bLast && pText[ aString.Len() - 1 ] == sal_Unicode(')') && rFontCollection.GetScriptDirection( aString ) == com::sun::star::i18n::ScriptDirection::RIGHT_TO_LEFT )
{
mnTextSize++;
- bRTL_endingParen = sal_True;
+ bRTL_endingParen = true;
}
mpText = new sal_uInt16[ mnTextSize ];
sal_uInt16 nChar;
@@ -1873,7 +1970,7 @@ PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text
mpText[ mnTextSize - 1 ] = 0xd;
if ( bPropSetsValid )
- ImplGetPortionValues( rFontCollection, sal_True );
+ ImplGetPortionValues( rFontCollection, true );
}
}
@@ -1888,7 +1985,7 @@ PortionObj::~PortionObj()
ImplClear();
}
-void PortionObj::Write( SvStream* pStrm, sal_Bool bLast )
+void PortionObj::Write( SvStream* pStrm, bool bLast )
{
sal_uInt32 nCount = mnTextSize;
if ( bLast && mbLastPortion )
@@ -1897,10 +1994,10 @@ void PortionObj::Write( SvStream* pStrm, sal_Bool bLast )
*pStrm << (sal_uInt16)mpText[ i ];
}
-void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue )
+void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGetPropStateValue )
{
- sal_Bool bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ), bGetPropStateValue );
+ bool bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ), bGetPropStateValue );
meFontName = ePropState;
if ( bOk )
{
@@ -1910,11 +2007,11 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
if ( mnFont == nCount )
{
FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), false ) )
mAny >>= rFontDesc.CharSet;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamily" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamily" ) ), false ) )
mAny >>= rFontDesc.Family;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitch" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitch" ) ), false ) )
mAny >>= rFontDesc.Pitch;
}
}
@@ -1937,11 +2034,11 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
if ( mnAsianOrComplexFont == nCount )
{
FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetAsian" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetAsian" ) ), false ) )
mAny >>= rFontDesc.CharSet;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyAsian" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyAsian" ) ), false ) )
mAny >>= rFontDesc.Family;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchAsian" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchAsian" ) ), false ) )
mAny >>= rFontDesc.Pitch;
}
}
@@ -1958,11 +2055,11 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
if ( mnAsianOrComplexFont == nCount )
{
FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetComplex" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetComplex" ) ), false ) )
mAny >>= rFontDesc.CharSet;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyComplex" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyComplex" ) ), false ) )
mAny >>= rFontDesc.Family;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchComplex" ) ), sal_False ) )
+ if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchComplex" ) ), false ) )
mAny >>= rFontDesc.Pitch;
}
}
@@ -1998,7 +2095,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
}
mnCharHeight = 24;
- if ( GetPropertyValue( mAny, mXPropSet, aCharHeightName, sal_False ) )
+ if ( GetPropertyValue( mAny, mXPropSet, aCharHeightName, false ) )
{
float fVal(0.0);
if ( mAny >>= fVal )
@@ -2007,7 +2104,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
meCharHeight = GetPropertyState( mXPropSet, aCharHeightName );
}
}
- if ( GetPropertyValue( mAny, mXPropSet, aCharWeightName, sal_False ) )
+ if ( GetPropertyValue( mAny, mXPropSet, aCharWeightName, false ) )
{
float fFloat(0.0);
if ( mAny >>= fFloat )
@@ -2018,13 +2115,13 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
mnCharAttrHard |= 1;
}
}
- if ( GetPropertyValue( mAny, mXPropSet, aCharLocaleName, sal_False ) )
+ if ( GetPropertyValue( mAny, mXPropSet, aCharLocaleName, false ) )
{
com::sun::star::lang::Locale eLocale;
if ( mAny >>= eLocale )
meCharLocale = eLocale;
}
- if ( GetPropertyValue( mAny, mXPropSet, aCharPostureName, sal_False ) )
+ if ( GetPropertyValue( mAny, mXPropSet, aCharPostureName, false ) )
{
::com::sun::star::awt::FontSlant aFS;
if ( mAny >>= aFS )
@@ -2060,7 +2157,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ), bGetPropStateValue ) )
{
- sal_Bool bBool(sal_False);
+ bool bBool(sal_False);
mAny >>= bBool;
if ( bBool )
mnCharAttr |= 0x10;
@@ -2159,12 +2256,12 @@ sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com
sal_uInt32 nRetValue = 0;
sal_Int32 nFormat;
::com::sun::star::uno::Any aAny;
- if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextPortionType" ) ), sal_True ) )
+ if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextPortionType" ) ), true ) )
{
String aTextFieldType( *(::rtl::OUString*)aAny.getValue() );
if ( aTextFieldType == String( RTL_CONSTASCII_USTRINGPARAM( "TextField" ) ) )
{
- if ( GetPropertyValue( aAny, rXPropSet, aTextFieldType, sal_True ) )
+ if ( GetPropertyValue( aAny, rXPropSet, aTextFieldType, true ) )
{
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > aXTextField;
if ( aAny >>= aXTextField )
@@ -2175,16 +2272,16 @@ sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com
xFieldPropSet( aXTextField, ::com::sun::star::uno::UNO_QUERY );
if ( xFieldPropSet.is() )
{
- String aFieldKind( aXTextField->getPresentation( sal_True ) );
+ String aFieldKind( aXTextField->getPresentation( true ) );
if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Date" ) ) )
{
- if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), true )
{
sal_Bool bBool;
aAny >>= bBool;
if ( !bBool ) // Fixed DateFields gibt es in PPT nicht
{
- if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), true )
{
nFormat = *(sal_Int32*)aAny.getValue();
switch ( nFormat )
@@ -2206,7 +2303,7 @@ sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com
}
else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) )
{
- if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ), true )
rURL = String( *(::rtl::OUString*)aAny.getValue() );
nRetValue = 4 << 28;
}
@@ -2220,13 +2317,13 @@ sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com
}
else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Time" ) ) )
{
- if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), true )
{
sal_Bool bBool;
aAny >>= bBool;
if ( !bBool )
{
- if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), true )
{
nFormat = *(sal_Int32*)aAny.getValue();
nRetValue |= ( ( ( 2 << 4 ) | nFormat ) << 24 ) | 0x800000;
@@ -2244,13 +2341,13 @@ sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com
}
else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "ExtTime" ) ) )
{
- if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), true )
{
sal_Bool bBool;
aAny >>= bBool;
if ( !bBool )
{
- if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), sal_True )
+ if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), true )
{
nFormat = *(sal_Int32*)aAny.getValue();
switch ( nFormat )
@@ -2311,30 +2408,24 @@ PortionObj& PortionObj::operator=( const PortionObj& rPortionObj )
// -----------------------------------------------------------------------
-ParagraphObj::ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
- PPTExBulletProvider& rProv ) :
- maMapModeSrc ( MAP_100TH_MM ),
- maMapModeDest ( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) )
+ParagraphObj::ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, PPTExBulletProvider& rProv )
{
mXPropSet = rXPropSet;
- bExtendedParameters = sal_False;
+ bExtendedParameters = false;
nDepth = 0;
nBulletFlags = 0;
nParaFlags = 0;
- ImplGetParagraphValues( rProv, sal_False );
+ ImplGetParagraphValues( rProv, false );
}
- ParagraphObj::ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContent,
- ParaFlags aParaFlags, FontCollection& rFontCollection, PPTExBulletProvider& rProv ) :
- maMapModeSrc ( MAP_100TH_MM ),
- maMapModeDest ( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) ),
- mbFirstParagraph ( aParaFlags.bFirstParagraph ),
+ParagraphObj::ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContent, ParaFlags aParaFlags, FontCollection& rFontCollection, PPTExBulletProvider& rProv )
+: mbFirstParagraph ( aParaFlags.bFirstParagraph ),
mbLastParagraph ( aParaFlags.bLastParagraph )
{
- bExtendedParameters = sal_False;
+ bExtendedParameters = false;
nDepth = 0;
nBulletFlags = 0;
@@ -2373,7 +2464,7 @@ ParagraphObj::ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::
}
}
}
- ImplGetParagraphValues( rProv, sal_True );//
+ ImplGetParagraphValues( rProv, true );//
}
}
@@ -2456,7 +2547,7 @@ static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, Str
}
}
-void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nNumberingDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue )
+void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nNumberingDepth, bool bIsBullet, bool bGetPropStateValue )
{
::com::sun::star::uno::Any aAny;
if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "ParaLeftMargin" ) ) ) )
@@ -2488,7 +2579,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
sal_Int32 nPropertyCount = aPropertySequence.getLength();
if ( nPropertyCount )
{
- bExtendedParameters = sal_True;
+ bExtendedParameters = true;
nBulletRealSize = 100;
nMappedNumType = 0;
@@ -2583,7 +2674,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
{
nBulletId = rBuProv.GetId( aUniqueId, aBuGraSize );
if ( nBulletId != 0xffff )
- bExtendedBulletsUsed = sal_True;
+ bExtendedBulletsUsed = true;
}
}
}
@@ -2680,7 +2771,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
{
if ( nNumberingType != SVX_NUM_CHAR_SPECIAL )
{
- bExtendedBulletsUsed = sal_True;
+ bExtendedBulletsUsed = true;
if ( nNumberingDepth & 1 )
cBulletId = 0x2013; // defaulting bullet characters for ppt97
else if ( nNumberingDepth == 4 )
@@ -2820,12 +2911,12 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
nBulletOfs = 0;
}
-void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue )
+void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider& rBuProv, bool bGetPropStateValue )
{
static String sNumberingLevel ( RTL_CONSTASCII_USTRINGPARAM( "NumberingLevel" ) );
::com::sun::star::uno::Any aAny;
- if ( GetPropertyValue( aAny, mXPropSet, sNumberingLevel, sal_True ) )
+ if ( GetPropertyValue( aAny, mXPropSet, sNumberingLevel, true ) )
{
if ( bGetPropStateValue )
meBullet = GetPropertyState( mXPropSet, sNumberingLevel );
@@ -2833,20 +2924,20 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Boo
if ( nDepth < 0 )
{
- mbIsBullet = sal_False;
+ mbIsBullet = false;
nDepth = 0;
}
else
{
if ( nDepth > 4 )
nDepth = 4;
- mbIsBullet = sal_True;
+ mbIsBullet = true;
}
}
else
{
nDepth = 0;
- mbIsBullet = sal_False;
+ mbIsBullet = false;
}
ImplGetNumberingLevel( rBuProv, nDepth, mbIsBullet, bGetPropStateValue );
@@ -2997,8 +3088,8 @@ ImplTextObj::ImplTextObj( int nInstance )
mnTextSize = 0;
mnInstance = nInstance;
mpList = new List;
- mbHasExtendedBullets = sal_False;
- mbFixedCellHeightUsed = sal_False;
+ mbHasExtendedBullets = false;
+ mbFixedCellHeightUsed = false;
}
ImplTextObj::~ImplTextObj()
@@ -3030,11 +3121,11 @@ TextObj::TextObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSim
if ( aAny >>= aXParagraph )
{
if ( !aXTextParagraphE->hasMoreElements() )
- aParaFlags.bLastParagraph = sal_True;
+ aParaFlags.bLastParagraph = true;
ParagraphObj* pPara = new ParagraphObj( aXParagraph, aParaFlags, rFontCollection, rProv );
mpImplTextObj->mbHasExtendedBullets |= pPara->bExtendedBulletsUsed;
mpImplTextObj->mpList->Insert( pPara, LIST_APPEND );
- aParaFlags.bFirstParagraph = sal_False;
+ aParaFlags.bFirstParagraph = false;
}
}
}
@@ -3339,8 +3430,8 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
}
nParaFlags >>= 16;
- sal_uInt32 nDefaultTabSize = ImplMapSize( ::com::sun::star::awt::Size( 2011, 1 ) ).Width;
- sal_uInt32 nDefaultTabs = abs( maRect.GetWidth() ) / nDefaultTabSize;
+ sal_uInt32 nDefaultTabSize = mfMap100thMmToMs * 2011.0;
+ sal_uInt32 nDefaultTabs = basegfx::fround(fabs(maObjectRange.getWidth())) / nDefaultTabSize;
if ( nTabs )
nDefaultTabs -= (sal_Int32)( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize );
if ( (sal_Int32)nDefaultTabs < 0 )
@@ -3992,7 +4083,7 @@ void PPTWriter::ImplWriteObjectEffect( SvStream& rSt,
// -----------------------------------------------------------------------
-void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentation::ClickAction eCa, sal_Bool bMediaClickAction )
+void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentation::ClickAction eCa, bool bMediaClickAction )
{
sal_uInt32 nSoundRef = 0; // a reference to a sound in the sound collection, or NULL.
sal_uInt32 nHyperLinkID = 0;// a persistent unique identifier to an external hyperlink object (only valid when action == HyperlinkAction).
@@ -4149,27 +4240,43 @@ void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentat
// -----------------------------------------------------------------------
-sal_Bool PPTWriter::ImplGetEffect( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPropSet,
+bool PPTWriter::ImplGetEffect( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPropSet,
::com::sun::star::presentation::AnimationEffect& eEffect,
::com::sun::star::presentation::AnimationEffect& eTextEffect,
- sal_Bool& bIsSound )
+ bool& bIsSound )
{
::com::sun::star::uno::Any aAny;
+
if ( GetPropertyValue( aAny, rPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Effect" ) ) ) )
+ {
aAny >>= eEffect;
+ }
else
+ {
eEffect = ::com::sun::star::presentation::AnimationEffect_NONE;
+ }
if ( GetPropertyValue( aAny, rPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextEffect" ) ) ) )
+ {
aAny >>= eTextEffect;
+ }
else
+ {
eTextEffect = ::com::sun::star::presentation::AnimationEffect_NONE;
+ }
+
if ( GetPropertyValue( aAny, rPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "SoundOn" ) ) ) )
- aAny >>= bIsSound;
+ {
+ sal_Bool bBool(sal_False);
+ aAny >>= bBool;
+ bIsSound = bBool;
+ }
else
- bIsSound = sal_False;
+ {
+ bIsSound = false;
+ }
- sal_Bool bHasEffect = ( ( eEffect != ::com::sun::star::presentation::AnimationEffect_NONE )
+ bool bHasEffect = ( ( eEffect != ::com::sun::star::presentation::AnimationEffect_NONE )
|| ( eTextEffect != ::com::sun::star::presentation::AnimationEffect_NONE )
|| bIsSound );
return bHasEffect;
@@ -4177,10 +4284,10 @@ sal_Bool PPTWriter::ImplGetEffect( const ::com::sun::star::uno::Reference< ::com
// -----------------------------------------------------------------------
-sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPage, const PageType /* ePageType */,
+bool PPTWriter::ImplCreatePresentationPlaceholder( const bool bMasterPage, const PageType /* ePageType */,
const sal_uInt32 nStyleInstance, const sal_uInt8 nPlaceHolderId )
{
- sal_Bool bRet = ImplGetText();
+ bool bRet = ImplGetText();
if ( bRet && bMasterPage )
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
@@ -4193,7 +4300,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
+ aPropOpt.CreateFillProperties( mXPropSet, true, mXShape );
sal_uInt32 nLineFlags = 0x90001;
if ( aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line
@@ -4203,11 +4310,14 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
SvMemoryStream aClientTextBox( 0x200, 0x200 );
ImplWriteTextStyleAtom( aClientTextBox, nStyleInstance, 0, NULL, aExtBu, &aPropOpt );
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
aPropOpt.CreateShapeProperties( mXShape );
aPropOpt.Commit( *mpStrm );
mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
- *mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom(); // oben, links, rechts, unten ????
+ *mpStrm << (sal_Int16)basegfx::fround(maObjectRange.getMinY()) // CAUTION! Here, X,Y is exchanged
+ << (sal_Int16)basegfx::fround(maObjectRange.getMinX()) // by PURPOSE, it's not an error (!)
+ << (sal_Int16)basegfx::fround(maObjectRange.getMaxX()) // TTTT: Check for mirrored if Min/Max needs to be exchanged
+ << (sal_Int16)basegfx::fround(maObjectRange.getMaxY());
mpPptEscherEx->OpenContainer( ESCHER_ClientData );
mpPptEscherEx->AddAtom( 8, EPP_OEPlaceholderAtom );
*mpStrm << (sal_uInt32)0 // PlacementID
@@ -4233,7 +4343,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
}
else
- bRet = sal_False;
+ bRet = false;
return bRet;
}
@@ -4242,22 +4352,22 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
void PPTWriter::ImplCreateShape( sal_uInt32 nType, sal_uInt32 nFlags, EscherSolverContainer& rSolver )
{
sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
- mpPptEscherEx->AddShape( nType, nFlags, nId );
+ mpPptEscherEx->AddShape( nType, nFlags | mnMirrorFlags, nId );
rSolver.AddShape( mXShape, nId );
}
-void PPTWriter::ImplCreateTextShape( EscherPropertyContainer& rPropOpt, EscherSolverContainer& rSolver, sal_Bool bFill )
+void PPTWriter::ImplCreateTextShape( EscherPropertyContainer& rPropOpt, EscherSolverContainer& rSolver, bool bFill )
{
mnTextStyle = EPP_TEXTSTYLE_TEXT;
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_TextBox, 0xa00, rSolver );
if ( bFill )
- rPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
+ rPropOpt.CreateFillProperties( mXPropSet, true, mXShape );
if ( ImplGetText() )
- rPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ rPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
}
-void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& aSolverContainer, PageType ePageType, sal_Bool bMasterPage, int nPageNumber )
+void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& aSolverContainer, PageType ePageType, bool bMasterPage, int nPageNumber )
{
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
// sal_uInt32 nGroupLevel = 0;
@@ -4270,18 +4380,16 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
nIndices = nInstance = nLastPer = nShapeCount = nEffectCount = 0;
- sal_Bool bIsTitlePossible = sal_True; // bei mehr als einem title geht powerpoint in die knie
-
+ bool bIsTitlePossible = true; // bei mehr als einem title geht powerpoint in die knie
sal_uInt32 nOutlinerCount = 0; // die gliederungsobjekte muessen dem layout entsprechen,
sal_uInt32 nPrevTextStyle = 0; // es darf nicht mehr als zwei geben
nOlePictureId = 0;
- sal_Bool bAdditionalText = sal_False;
-
- sal_Bool bSecOutl = sal_False;
+ bool bAdditionalText = false;
+ double fTextRotation(0.0);
+ bool bSecOutl(false);
sal_uInt32 nPObjects = 0;
-
SvMemoryStream* pClientTextBox = NULL;
SvMemoryStream* pClientData = NULL;
@@ -4305,34 +4413,35 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
nGroups = GetGroupsClosed();
for ( sal_uInt32 i = 0; i < nGroups; i++, mpPptEscherEx->LeaveGroup() ) ;
- if ( ImplGetShapeByIndex( GetCurrentGroupIndex(), sal_True ) )
+ if ( ImplGetShapeByIndex( GetCurrentGroupIndex(), true ) )
{
- sal_Bool bIsSound;
- sal_Bool bMediaClickAction = sal_False;
+ bool bIsSound(false);
+ bool bMediaClickAction(false);
::com::sun::star::presentation::AnimationEffect eAe;
::com::sun::star::presentation::AnimationEffect eTe;
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "PresentationOrder" ) ) ) )
nEffectCount = *(sal_uInt16*)mAny.getValue();
- sal_Bool bEffect = ImplGetEffect( mXPropSet, eAe, eTe, bIsSound );
+ bool bEffect = ImplGetEffect( mXPropSet, eAe, eTe, bIsSound );
::com::sun::star::presentation::ClickAction eCa = ::com::sun::star::presentation::ClickAction_NONE;
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ) ) )
mAny >>= eCa;
- sal_Bool bGroup = mType == "drawing.Group";
- sal_Bool bOpenBezier = mType == "drawing.OpenBezier";
- sal_Bool bClosedBezier = mType == "drawing.ClosedBezier";
- sal_Bool bPolyPolygon = mType == "drawing.PolyPolygon";
- sal_Bool bPolyLine = mType == "drawing.PolyLine";
+ bool bGroup = mType == "drawing.Group";
+ bool bOpenBezier = mType == "drawing.OpenBezier";
+ bool bClosedBezier = mType == "drawing.ClosedBezier";
+ bool bPolyPolygon = mType == "drawing.PolyPolygon";
+ bool bPolyLine = mType == "drawing.PolyLine";
List aAdjustmentList;
Rectangle aPolyBoundRect;
- const ::com::sun::star::awt::Size aSize100thmm( mXShape->getSize() );
- const ::com::sun::star::awt::Point aPoint100thmm( mXShape->getPosition() );
- Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
- EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
+ basegfx::B2DRange aObjectRange100thmm(maObjectRange);
+
+ aObjectRange100thmm.transform(maInvMap100thMmToMs);
+
+ EscherPropertyContainer aPropOpt(mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aObjectRange100thmm);
if ( bGroup )
{
@@ -4352,20 +4461,20 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
pTmp = new SvMemoryStream( 0x200, 0x200 );
ImplWriteClickAction( *pTmp, eCa, bMediaClickAction );
}
- sal_uInt32 nShapeId = mpPptEscherEx->EnterGroup( &maRect, pTmp );
+ sal_uInt32 nShapeId = mpPptEscherEx->EnterGroup( &maObjectRange, pTmp );
aSolverContainer.AddShape( mXShape, nShapeId );
delete pTmp;
}
}
else
{
- sal_Bool bIsFontwork = sal_False;
- sal_Bool bIsHatching = sal_False;
+ bool bIsFontwork(false);
+ bool bIsHatching(false);
::com::sun::star::uno::Any aAny;
::com::sun::star::drawing::FillStyle eFS;
- if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFontwork" ) ), sal_True ) )
+ if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFontwork" ) ), true ) )
aAny >>= bIsFontwork;
- if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ), sal_True ) )
+ if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ), true ) )
{
aAny >>= eFS;
bIsHatching = eFS == ::com::sun::star::drawing::FillStyle_HATCH;
@@ -4374,51 +4483,49 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "BoundRect" ) ) ) )
{
- ::com::sun::star::awt::Rectangle aRect( *(::com::sun::star::awt::Rectangle*)mAny.getValue() );
- maPosition = ImplMapPoint( ::com::sun::star::awt::Point( aRect.X, aRect.Y ) );
- maSize = ImplMapSize( ::com::sun::star::awt::Size( aRect.Width, aRect.Height ) );
- maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
+ const ::com::sun::star::awt::Rectangle aAwtRect(*(::com::sun::star::awt::Rectangle*)mAny.getValue());
+
+ maObjectRange = basegfx::B2DRange(aAwtRect.X, aAwtRect.Y, aAwtRect.X + aAwtRect.Width, aAwtRect.Y + aAwtRect.Height);
+ maObjectRange.transform(maMap100thMmToMs);
}
mType = "drawing.dontknow";
}
}
- sal_uInt8 nPlaceHolderAtom = EPP_PLACEHOLDER_NONE;
+ sal_uInt8 nPlaceHolderAtom = EPP_PLACEHOLDER_NONE;
mnTextSize = 0;
mnTextStyle = EPP_TEXTSTYLE_NORMAL;
if ( mType == "drawing.Custom" )
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
- sal_uInt32 nMirrorFlags;
+ // TTTT: not needed here sal_uInt32 nMirrorFlags;
rtl::OUString sCustomShapeType;
- MSO_SPT eShapeType = aPropOpt.GetCustomShapeType( mXShape, nMirrorFlags, sCustomShapeType );
+ MSO_SPT eShapeType = aPropOpt.GetCustomShapeType( mXShape, /*nMirrorFlags, */sCustomShapeType );
if ( sCustomShapeType.equalsAscii( "col-502ad400" ) || sCustomShapeType.equalsAscii( "col-60da8460" ) )
{ // sj: creating metafile for customshapes that can't be saved to ms format properly
ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
- if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
+ if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), false ) )
{
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
SdrObject* pObj = GetSdrObjectFromXShape( mXShape );
if ( pObj )
{
- Rectangle aBound = pObj->GetCurrentBoundRect();
- maPosition = ImplMapPoint( ::com::sun::star::awt::Point( aBound.Left(), aBound.Top() ) );
- maSize = ImplMapSize( ::com::sun::star::awt::Size ( aBound.GetWidth(), aBound.GetHeight() ) );
- maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
- mnAngle = 0;
+ maObjectRange = pObj->getObjectRange(0);
+ maObjectRange.transform(maMap100thMmToMs);
+ mfObjectRotation = 0.0;
}
}
}
else
{
- ImplCreateShape( eShapeType, nMirrorFlags | 0xa00, aSolverContainer );
+ ImplCreateShape( eShapeType, /*nMirrorFlags | */0xa00, aSolverContainer ); // Flags: Connector | HasSpt
aPropOpt.CreateCustomShapeProperties( eShapeType, mXShape );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape);
+ aPropOpt.CreateFillProperties( mXPropSet, true, mXShape);
if ( ImplGetText() )
{
if ( !aPropOpt.IsFontWork() )
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_True, sal_True );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, true, true );
}
}
}
@@ -4429,131 +4536,96 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CornerRadius" ) ) ) )
{
mAny >>= nRadius;
- nRadius = ImplMapSize( ::com::sun::star::awt::Size( nRadius, 0 ) ).Width;
+ nRadius = basegfx::fround(mfMap100thMmToMs * nRadius);
}
if ( nRadius )
{
ImplCreateShape( ESCHER_ShpInst_RoundRectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
- sal_Int32 nLenght = maRect.GetWidth();
- if ( nLenght > maRect.GetHeight() )
- nLenght = maRect.GetHeight();
- nLenght >>= 1;
- if ( nRadius >= nLenght )
+ double fLength(fabs(std::min(maObjectRange.getWidth(), maObjectRange.getHeight()) * 0.5));
+
+ if ( nRadius >= fLength )
+ {
nRadius = 0x2a30; // 0x2a30 ist PPTs maximum radius
+ }
else
- nRadius = ( 0x2a30 * nRadius ) / nLenght;
+ {
+ nRadius = ( 0x2a30 * nRadius ) / basegfx::fround(fLength);
+ }
+
aPropOpt.AddOpt( ESCHER_Prop_adjustValue, nRadius );
}
else
{
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
}
- aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
+ aPropOpt.CreateFillProperties( mXPropSet, true, mXShape );
if ( ImplGetText() )
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, false );
}
else if ( mType == "drawing.Ellipse" )
{
- ::com::sun::star::drawing::CircleKind eCircleKind( ::com::sun::star::drawing::CircleKind_FULL );
- PolyStyle ePolyKind = POLY_CHORD;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CircleKind" ) ) ) )
- {
- mAny >>= eCircleKind;
- switch ( eCircleKind )
- {
- case ::com::sun::star::drawing::CircleKind_SECTION :
- {
- ePolyKind = POLY_PIE;
- }
- break;
- case ::com::sun::star::drawing::CircleKind_ARC :
- {
- ePolyKind = POLY_ARC;
- }
- break;
+ // changed to directly use the SdrObject, using the handmade creatin of the polygon data
+ // seemed too dangerous for the moment. Can be changed back to own geometry creation, of
+ // course (e.g. by getting primitives using UNO API and filtering for hairlines)
+ SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(GetSdrObjectFromXShape(mXShape));
- case ::com::sun::star::drawing::CircleKind_CUT :
- {
- ePolyKind = POLY_CHORD;
- }
- break;
+ if(!pCircObj)
+ continue;
- default:
- eCircleKind = ::com::sun::star::drawing::CircleKind_FULL;
- }
- }
- if ( eCircleKind == ::com::sun::star::drawing::CircleKind_FULL )
+ if(CircleType_Circle == pCircObj->GetSdrCircleObjType())
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_Ellipse, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
- aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
+ aPropOpt.CreateFillProperties( mXPropSet, true, mXShape );
if ( ImplGetText() )
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, false );
}
else
{
- sal_Int32 nStartAngle, nEndAngle;
- if ( !ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CircleStartAngle" ) ) ) )
- continue;
- nStartAngle = *( (sal_Int32*)mAny.getValue() );
- if( !ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CircleEndAngle" ) ) ) )
+ const basegfx::B2DPolyPolygon aOutline(pCircObj->TakeXorPoly());
+
+ if(!aOutline.count())
continue;
- nEndAngle = *( (sal_Int32*)mAny.getValue() );
- ::com::sun::star::awt::Point aPoint( mXShape->getPosition() );
- ::com::sun::star::awt::Size aSize( mXShape->getSize() );
- ::com::sun::star::awt::Point aStart, aEnd, aCenter;
- Rectangle aRect( Point( aPoint.X, aPoint.Y ), Size( aSize.Width, aSize.Height ) );
- aStart.X = (sal_Int32)( ( cos( (double)( nStartAngle * F_PI18000 ) ) * 100.0 ) );
- aStart.Y = - (sal_Int32)( ( sin( (double)( nStartAngle * F_PI18000 ) ) * 100.0 ) );
- aEnd.X = (sal_Int32)( ( cos( (double)( nEndAngle * F_PI18000 ) ) * 100.0 ) );
- aEnd.Y = - (sal_Int32)( ( sin( (double)( nEndAngle * F_PI18000 ) ) * 100.0 ) );
- aCenter.X = aPoint.X + ( aSize.Width / 2 );
- aCenter.Y = aPoint.Y + ( aSize.Height / 2 );
- aStart.X += aCenter.X;
- aStart.Y += aCenter.Y;
- aEnd.X += aCenter.X;
- aEnd.Y += aCenter.Y;
- Polygon aPolygon( aRect, Point( aStart.X, aStart.Y ), Point( aEnd.X, aEnd.Y ), ePolyKind );
- sal_Bool bNeedText = sal_True;
- if ( mnAngle )
+
+ Polygon aPolygon(aOutline.getB2DPolygon(0));
+ bool bNeedText(true);
+
+ if ( mfObjectRotation )
{
- aPolygon.Rotate( aRect.TopLeft(), (sal_uInt16)( mnAngle / 10 ) );
+ // already applied to the polygon, nothing to do there
if ( ImplGetText() )
{
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
// mpPptEscherEx->EnterGroup( 0,0 );
// nGroupLevel = mpPptEscherEx->GetGroupLevel();
- bNeedText = sal_False;
- bAdditionalText = sal_True;
+ bNeedText = false;
+ bAdditionalText = true;
+ fTextRotation = mfObjectRotation;
mnTextSize = 0;
}
- mnAngle = 0;
+ mfObjectRotation = 0.0;
}
+
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- switch ( ePolyKind )
- {
- case POLY_PIE :
- case POLY_CHORD :
- {
- if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon ) )
- aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
- }
- break;
- case POLY_ARC :
- {
- if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, &aPolygon ) )
- aPropOpt.CreateLineProperties( mXPropSet, sal_False );
- }
- break;
+ if(aOutline.isClosed())
+ {
+ if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, false, aNewRect, &aPolygon ) )
+ aPropOpt.CreateFillProperties( mXPropSet, true, mXShape );
+ }
+ else
+ {
+ if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, false, aNewRect, &aPolygon ) )
+ aPropOpt.CreateLineProperties( mXPropSet, false );
}
- maRect = ImplMapRectangle( aNewRect );
- maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
- maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
+
+ maObjectRange = basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height);
+ maObjectRange.transform(maMap100thMmToMs);
+
if ( bNeedText && ImplGetText() )
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, false );
}
}
else if ( mType == "drawing.Control" )
@@ -4610,7 +4682,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
::com::sun::star::awt::Size aSize;
String aControlName;
- SvStorageRef xTemp( new SvStorage( new SvMemoryStream(), sal_True ) );
+ SvStorageRef xTemp( new SvStorage( new SvMemoryStream(), true ) );
if ( SvxMSConvertOCXControls::WriteOCXStream( xTemp, aXControlModel, aSize, aControlName ) )
{
String aUserName( xTemp->GetUserName() );
@@ -4665,7 +4737,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
sal_uInt32 nSpFlags = SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE;
ImplCreateShape( ESCHER_ShpInst_HostControl, nSpFlags, aSolverContainer );
- if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
+ if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), false ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
//export form control graphic
else if ( aPropOpt.CreateBlipPropertiesforOLEControl(mXPropSet,mXShape))
@@ -4687,25 +4759,24 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
*pTmp++ = 0;
*pTmp = 0;
- aPropOpt.AddOpt( ESCHER_Prop_wzName, sal_True, nBufSize, pBuf, nBufSize );
+ aPropOpt.AddOpt( ESCHER_Prop_wzName, true, nBufSize, pBuf, nBufSize );
}
}
else if ( mType == "drawing.Connector" )
{
sal_uInt16 nSpType, nSpFlags;
::com::sun::star::awt::Rectangle aNewRect;
- if ( aPropOpt.CreateConnectorProperties( mXShape, aSolverContainer, aNewRect, nSpType, nSpFlags ) == sal_False )
+ if ( aPropOpt.CreateConnectorProperties( mXShape, aSolverContainer, aNewRect, nSpType, nSpFlags ) == false )
continue;
- maRect = ImplMapRectangle( aNewRect );
- maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
- maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
+ maObjectRange = basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height);
+ maObjectRange.transform(maMap100thMmToMs);
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( nSpType, nSpFlags, aSolverContainer );
// #119459# for connector shape, the start point and end point is fixed, and should not be rotated.
- mnAngle = 0;
+ mfObjectRotation = 0.0;
}
else if ( mType == "drawing.Measure" )
{
@@ -4714,109 +4785,142 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
else if ( mType == "drawing.Line" )
{
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_LINE, sal_False, aNewRect, NULL );
- maRect = ImplMapRectangle( aNewRect );
- maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
- maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
+ aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_LINE, false, aNewRect, NULL );
+
+ // remember hor/ver mirror; it is part of aNewRect since it gets created
+ // from the two single points of the line. It's needed for thr flags below.
+ // If the flags are not set the line gets also exported correctly, but start
+ // and end point may be exchanged.
+ const bool bMirrorX(aNewRect.Width < 0);
+ const bool bMirrorY(aNewRect.Height < 0);
+
+ // TTTT this implies that CreatePolygonProperties returns negative values in
+ // ::com::sun::star::awt::Rectangle's Width and Height. SOlve this and the
+ // mirror flags, too
+
+ maObjectRange = basegfx::B2DRange(
+ aNewRect.X, aNewRect.Y,
+ aNewRect.X + fabs((double)aNewRect.Width), aNewRect.Y + fabs((double)aNewRect.Height));
+ maObjectRange.transform(maMap100thMmToMs);
+
if ( ImplGetText() )
{
- aTextRefPoint = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
+ aTextRefPoint = ::com::sun::star::awt::Point(basegfx::fround(maObjectRange.getMinX()), basegfx::fround(maObjectRange.getMinY()));
mnTextSize = 0;
- bAdditionalText = sal_True;
+ bAdditionalText = true;
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
- // mpPptEscherEx->EnterGroup( &maRect,0 );
+ // mpPptEscherEx->EnterGroup( &maObjectRange, 0 );
}
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
- if ( maRect.Top() > maRect.Bottom() )
+
+ if(bMirrorX)
+ {
nFlags |= 0x80; // Flags: VertMirror
- if ( maRect.Left() > maRect.Right() )
+ }
+
+ if(bMirrorY)
+ {
nFlags |= 0x40; // Flags: HorzMirror
+ }
ImplCreateShape( ESCHER_ShpInst_Line, nFlags, aSolverContainer );
aPropOpt.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- aPropOpt.CreateLineProperties( mXPropSet, sal_False );
- mnAngle = 0;
+ aPropOpt.CreateLineProperties( mXPropSet, false );
+ mfObjectRotation = 0.0;
}
else if ( bPolyPolygon )
{
if ( ImplGetText() )
{
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
- // mpPptEscherEx->EnterGroup( 0,0 );
+ // mpPptEscherEx->EnterGroup();
// nGroupLevel = mpPptEscherEx->GetGroupLevel();
- bAdditionalText = sal_True;
+ bAdditionalText = true;
+ fTextRotation = mfObjectRotation;
mnTextSize = 0;
}
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, NULL );
- maRect = ImplMapRectangle( aNewRect );
- maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
- maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
- mnAngle = 0;
+ aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, false, aNewRect, NULL );
+
+ maObjectRange = basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height);
+ maObjectRange.transform(maMap100thMmToMs);
+
+ // TTTT: check if it was by purpose to apply transform only to scale, not to pos
+ // compare with original (!)
+ //maObjectPosition = basegfx::B2DPoint(aNewRect.X, aNewRect.Y);
+ //maObjectScale = maMap100thMmToMs * basegfx::B2DVector(aNewRect.Width, aNewRect.Height);
+
+ aPropOpt.CreateFillProperties( mXPropSet, true , mXShape );
+ mfObjectRotation = 0.0;
}
else if ( bPolyLine )
{
if ( ImplGetText() )
{
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
- // mpPptEscherEx->EnterGroup( 0,0 );
+ // mpPptEscherEx->EnterGroup();
// nGroupLevel = mpPptEscherEx->GetGroupLevel();
- bAdditionalText = sal_True;
+ bAdditionalText = true;
+ fTextRotation = mfObjectRotation;
mnTextSize = 0;
}
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, NULL );
- maRect = ImplMapRectangle( aNewRect );
- maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
- maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
- aPropOpt.CreateLineProperties( mXPropSet, sal_False );
- mnAngle = 0;
+ aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, false, aNewRect, NULL );
+
+ maObjectRange = basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height);
+ maObjectRange.transform(maMap100thMmToMs);
+
+ aPropOpt.CreateLineProperties( mXPropSet, false );
+ mfObjectRotation = 0.0;
}
else if ( bOpenBezier )
{
if ( ImplGetText() )
{
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
- // mpPptEscherEx->EnterGroup( 0,0 );
+ // mpPptEscherEx->EnterGroup();
// nGroupLevel = mpPptEscherEx->GetGroupLevel();
- bAdditionalText = sal_True;
+ bAdditionalText = true;
+ fTextRotation = mfObjectRotation;
mnTextSize = 0;
}
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_True, aNewRect, NULL );
- maRect = ImplMapRectangle( aNewRect );
- maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
- maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
- aPropOpt.CreateLineProperties( mXPropSet, sal_False );
- mnAngle = 0;
+ aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, true, aNewRect, NULL );
+
+ maObjectRange = basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height);
+ maObjectRange.transform(maMap100thMmToMs);
+
+ aPropOpt.CreateLineProperties( mXPropSet, false );
+ mfObjectRotation = 0.0;
}
else if ( bClosedBezier )
{
if ( ImplGetText() )
{
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
- // mpPptEscherEx->EnterGroup( 0,0 );
+ // mpPptEscherEx->EnterGroup();
// nGroupLevel = mpPptEscherEx->GetGroupLevel();
- bAdditionalText = sal_True;
+ bAdditionalText = true;
+ fTextRotation = mfObjectRotation;
mnTextSize = 0;
}
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_True, aNewRect, NULL );
- maRect = ImplMapRectangle( aNewRect );
- maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
- maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
- mnAngle = 0;
+ aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, true, aNewRect, NULL );
+
+ maObjectRange = basegfx::B2DRange(aNewRect.X, aNewRect.Y, aNewRect.X + aNewRect.Width, aNewRect.Y + aNewRect.Height);
+ maObjectRange.transform(maMap100thMmToMs);
+
+ aPropOpt.CreateFillProperties( mXPropSet, true , mXShape );
+ mfObjectRotation = 0.0;
}
else if ( ( mType == "drawing.GraphicObject" ) || ( mType == "presentation.GraphicObject" ) )
{
@@ -4847,7 +4951,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
have to create a simpe Rectangle with fill bitmap instead (while not allowing BitmapMode_Repeat).
*/
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
- if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), sal_True, sal_True, sal_False ) )
+ if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), true, true, false ) )
{
aPropOpt.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapNone );
aPropOpt.AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
@@ -4855,14 +4959,14 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x8000000 );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
if ( ImplGetText() )
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, false );
}
}
else
{
ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
- if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), sal_False, sal_True ) )
+ if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), false, true ) )
{
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}
@@ -4878,7 +4982,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
else
nPlaceHolderAtom = EPP_PLACEHOLDER_NOTESBODY;
}
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
else if ( mType == "presentation.TitleText" )
{
@@ -4889,12 +4993,12 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
nPlaceHolderAtom = EPP_PLACEHOLDER_MASTERNOTESBODYIMAGE;
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x200, aSolverContainer );
- aPropOpt.CreateLineProperties( mXPropSet, sal_False );
+ aPropOpt.CreateLineProperties( mXPropSet, false );
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
}
else if ( rLayout.bTitlePossible && bIsTitlePossible )
{
- bIsTitlePossible = sal_False;
+ bIsTitlePossible = false;
ImplGetText();
TextObj aTextObj( mXText, EPP_TEXTTYPE_Title, maFontCollection, (PPTExBulletProvider&)*this );
@@ -4917,16 +5021,19 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aPropertyOptions.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
aPropertyOptions.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropertyOptions.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
- aPropertyOptions.CreateFillProperties( mXPropSet, sal_True, mXShape );
+ aPropertyOptions.CreateFillProperties( mXPropSet, true, mXShape );
sal_uInt32 nLineFlags = 0x90001;
if ( aPropertyOptions.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line
aPropertyOptions.AddOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags );
- aPropertyOptions.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ aPropertyOptions.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
aPropertyOptions.Commit( *mpStrm );
mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
- *mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom(); // oben, links, rechts, unten ????
+ *mpStrm << (sal_Int16)basegfx::fround(maObjectRange.getMinY()) // CAUTION! Here, X,Y is exchanged
+ << (sal_Int16)basegfx::fround(maObjectRange.getMinX()) // by PURPOSE, it's not an error (!)
+ << (sal_Int16)basegfx::fround(maObjectRange.getMaxX()) // TTTT: Check for mirrored if Min/Max needs to be exchanged
+ << (sal_Int16)basegfx::fround(maObjectRange.getMaxY()); // oben, links, rechts, unten ????
mpPptEscherEx->OpenContainer( ESCHER_ClientData );
mpPptEscherEx->AddAtom( 8, EPP_OEPlaceholderAtom );
*mpStrm << (sal_uInt32)0 // PlacementID
@@ -4962,8 +5069,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
nPlaceHolderAtom = rLayout.nTypeOfTitle;
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterTitle );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, true, mXShape );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
if ( mbEmptyPresObj )
{
@@ -4975,12 +5082,12 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
}
else
- mbPresObj = sal_False;
+ mbPresObj = false;
}
if ( !mbPresObj )
{
mType = "drawing.Text";
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
}
else if ( ( mType == "presentation.Outliner" ) || ( mType == "presentation.Subtitle" ) )
@@ -5011,16 +5118,19 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aPropOpt2.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropOpt2.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90001 );
aPropOpt2.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
- aPropOpt2.CreateFillProperties( mXPropSet, sal_True, mXShape );
+ aPropOpt2.CreateFillProperties( mXPropSet, true, mXShape );
sal_uInt32 nLineFlags = 0x90001;
if ( aPropOpt2.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line
aPropOpt2.AddOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags );
- aPropOpt2.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ aPropOpt2.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt2 );
aPropOpt2.Commit( *mpStrm );
mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
- *mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom(); // oben, links, rechts, unten ????
+ *mpStrm << (sal_Int16)basegfx::fround(maObjectRange.getMinY()) // CAUTION! Here, X,Y is exchanged
+ << (sal_Int16)basegfx::fround(maObjectRange.getMinX()) // by PURPOSE, it's not an error (!)
+ << (sal_Int16)basegfx::fround(maObjectRange.getMaxX()) // TTTT: Check for mirrored if Min/Max needs to be exchanged
+ << (sal_Int16)basegfx::fround(maObjectRange.getMaxY()); // oben, links, rechts, unten ????
mpPptEscherEx->OpenContainer( ESCHER_ClientData );
mpPptEscherEx->AddAtom( 8, EPP_OEPlaceholderAtom );
sal_uInt8 PlaceHolderID = ( mType == "presentation.Subtitle") ? EPP_PLACEHOLDER_MASTERSUBTITLE:EPP_PLACEHOLDER_MASTERBODY;
@@ -5064,8 +5174,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
- aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, true, mXShape );
+ aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
if ( mbEmptyPresObj )
{
@@ -5077,7 +5187,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
}
else
- mbPresObj = sal_False;
+ mbPresObj = false;
}
if ( !mbPresObj )
{
@@ -5089,7 +5199,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
mType = "drawing.Text";
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
}
else if ( ( mType == "drawing.Page" ) || ( mType == "presentation.Page" ) )
@@ -5101,7 +5211,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
else
nPlaceHolderAtom = EPP_PLACEHOLDER_NOTESSLIDEIMAGE;
}
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
else if ( mType == "drawing.Frame" )
{
@@ -5190,9 +5300,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
continue;
else
{
- mbPresObj = sal_False;
+ mbPresObj = false;
mType = "drawing.Text";
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
}
else if ( mType == "presentation.Footer" )
@@ -5201,9 +5311,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
continue;
else
{
- mbPresObj = sal_False;
+ mbPresObj = false;
mType = "drawing.Text";
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
}
else if ( mType == "presentation.DateTime" )
@@ -5212,9 +5322,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
continue;
else
{
- mbPresObj = sal_False;
+ mbPresObj = false;
mType = "drawing.Text";
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
}
else if ( mType == "presentation.SlideNumber" )
@@ -5223,9 +5333,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
continue;
else
{
- mbPresObj = sal_False;
+ mbPresObj = false;
mType = "drawing.Text";
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, true );
}
}
else if ( ( (sal_Char)'3' == mType.GetChar( 8 ) ) && ( (char)'D' == mType.GetChar( 9 ) ) ) // drawing.3D
@@ -5237,18 +5347,18 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
- if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ), sal_False ) )
+ if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Bitmap" ) ), false ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}
else if ( mType == "drawing.Media" )
{
- mnAngle = 0;
+ mfObjectRotation = 0.0;
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
if ( aPropOpt.CreateMediaGraphicProperties( mXShape ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
::com::sun::star::uno::Any aAny;
- if ( PropValue::GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MediaURL" ) ), sal_True ) )
+ if ( PropValue::GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MediaURL" ) ), true ) )
{
rtl::OUString aMediaURL;
if ( (aAny >>= aMediaURL ) && aMediaURL.getLength() )
@@ -5331,10 +5441,10 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
else if ( mType == "drawing.dontknow" )
{
- mnAngle = 0;
+ mfObjectRotation = 0.0;
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
- if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False ) )
+ if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), false ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}
else
@@ -5343,7 +5453,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
sal_Int32 nPlacementID = -1;
- sal_Bool bClientData = ( bEffect || ( eCa != ::com::sun::star::presentation::ClickAction_NONE ) ||
+ bool bClientData = ( bEffect || ( eCa != ::com::sun::star::presentation::ClickAction_NONE ) ||
nPlaceHolderAtom || nOlePictureId );
if ( bClientData )
{
@@ -5424,9 +5534,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
if ( !pClientTextBox )
pClientTextBox = new SvMemoryStream( 0x200, 0x200 );
- if ( mbEmptyPresObj == sal_False )
+ if ( mbEmptyPresObj == false )
{
- if ( ( ePageType == NORMAL ) && ( bMasterPage == sal_False ) )
+ if ( ( ePageType == NORMAL ) && ( bMasterPage == false ) )
{
sal_uInt32 nTextType = EPP_TEXTTYPE_Body;
if ( mnTextStyle == EPP_TEXTSTYLE_BODY )
@@ -5435,7 +5545,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
nTextType = EPP_TEXTTYPE_HalfBody;
else if ( mType == "presentation.Subtitle" )
nTextType = EPP_TEXTTYPE_CenterBody;
- bSecOutl = sal_True;
+ bSecOutl = true;
}
else
nTextType = EPP_TEXTTYPE_Title;
@@ -5496,15 +5606,18 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
aPropOpt.CreateShadowProperties( mXPropSet );
- maRect.Justify();
- if ( mnAngle )
- ImplFlipBoundingBox( aPropOpt );
+
+ if(!basegfx::fTools::equalZero(mfObjectRotation))
+ {
+ ImplHandleRotation( aPropOpt );
+ }
+
aPropOpt.CreateShapeProperties( mXShape );
aPropOpt.Commit( *mpStrm );
if ( GetCurrentGroupLevel() > 0 )
- mpPptEscherEx->AddChildAnchor( maRect );
+ mpPptEscherEx->AddChildAnchor( maObjectRange );
else
- mpPptEscherEx->AddClientAnchor( maRect );
+ mpPptEscherEx->AddClientAnchor( maObjectRange );
if ( pClientData )
{
@@ -5528,45 +5641,44 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
if ( bAdditionalText )
{
- bAdditionalText = sal_False;
-
- ::com::sun::star::uno::Any aAny;
+ bAdditionalText = false;
+ mfObjectRotation = fTextRotation;
EscherPropertyContainer aPropOpt;
- mnAngle = ( PropValue::GetPropertyValue( aAny,
- mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True ) )
- ? *((sal_Int32*)aAny.getValue() )
- : 0;
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
if ( mType == "drawing.Line" )
{
- double fDist = hypot( maRect.GetWidth(), maRect.GetHeight() );
- maRect = Rectangle( Point( aTextRefPoint.X, aTextRefPoint.Y ),
- Point( (sal_Int32)( aTextRefPoint.X + fDist ), aTextRefPoint.Y - 1 ) );
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_False );
+ const double fDist(hypot(maObjectRange.getWidth(), maObjectRange.getHeight()));
+
+ maObjectRange = basegfx::B2DRange(aTextRefPoint.X, aTextRefPoint.Y, aTextRefPoint.X + fDist, aTextRefPoint.Y);
+ ImplCreateTextShape( aPropOpt, aSolverContainer, false );
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x60006 ); // Size Shape To Fit Text
- if ( mnAngle < 0 )
- mnAngle = ( 36000 + mnAngle ) % 36000;
- if ( mnAngle )
- ImplFlipBoundingBox( aPropOpt );
+
+ if(!basegfx::fTools::equalZero(mfObjectRotation))
+ {
+ ImplHandleRotation( aPropOpt );
+ }
}
else
{
- ImplCreateTextShape( aPropOpt, aSolverContainer, sal_False );
- if ( mnAngle < 0 )
- mnAngle = ( 36000 + mnAngle ) % 36000;
- else
- mnAngle = ( 36000 - ( mnAngle % 36000 ) );
-
- mnAngle *= 655;
- mnAngle += 0x8000;
- mnAngle &=~0xffff; // nAngle auf volle Gradzahl runden
- aPropOpt.AddOpt( ESCHER_Prop_Rotation, mnAngle );
+ // TTTT check against original
+ // if ( mnAngle < 0 )
+ // mnAngle = ( 36000 + mnAngle ) % 36000;
+ // else
+ // mnAngle = ( 36000 - ( mnAngle % 36000 ) );
+ ImplCreateTextShape( aPropOpt, aSolverContainer, false );
+ sal_Int32 nAngle(basegfx::fround(basegfx::snapToZeroRange(-mfObjectRotation / F_PI18000, 36000.0)));
+
+ nAngle = ( 36000 - ( nAngle % 36000 ) );
+ nAngle *= 655;
+ nAngle += 0x8000;
+ nAngle &=~0xffff; // nAngle auf volle Gradzahl runden
+ aPropOpt.AddOpt( ESCHER_Prop_Rotation, nAngle );
// #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
- // mpPptEscherEx->SetGroupSnapRect( nGroupLevel, maRect );
- // mpPptEscherEx->SetGroupLogicRect( nGroupLevel, maRect );
+ // mpPptEscherEx->SetGroupSnapPositionAndScale( nGroupLevel, maObjectRange );
+ // mpPptEscherEx->SetGroupLogicPositionAndScale( nGroupLevel, maObjectRange );
}
if ( !pClientTextBox )
pClientTextBox = new SvMemoryStream( 0x200, 0x200 );
@@ -5577,9 +5689,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aPropOpt.CreateShapeProperties( mXShape );
aPropOpt.Commit( *mpStrm );
if ( GetCurrentGroupLevel() > 0 )
- mpPptEscherEx->AddChildAnchor( maRect );
+ mpPptEscherEx->AddChildAnchor( maObjectRange );
else
- mpPptEscherEx->AddClientAnchor( maRect );
+ mpPptEscherEx->AddClientAnchor( maObjectRange );
*mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
<< (sal_uInt32)pClientTextBox->Tell();
@@ -5601,38 +5713,6 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
// -----------------------------------------------------------------------
-::com::sun::star::awt::Point PPTWriter::ImplMapPoint( const ::com::sun::star::awt::Point& rPoint )
-{
- Point aRet( OutputDevice::LogicToLogic( Point( rPoint.X, rPoint.Y ), maMapModeSrc, maMapModeDest ) );
- return ::com::sun::star::awt::Point( aRet.X(), aRet.Y() );
-}
-
-// -----------------------------------------------------------------------
-
-::com::sun::star::awt::Size PPTWriter::ImplMapSize( const ::com::sun::star::awt::Size& rSize )
-{
- Size aRetSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) );
-
- if ( !aRetSize.Width() )
- aRetSize.Width()++;
- if ( !aRetSize.Height() )
- aRetSize.Height()++;
- return ::com::sun::star::awt::Size( aRetSize.Width(), aRetSize.Height() );
-}
-
-// -----------------------------------------------------------------------
-
-Rectangle PPTWriter::ImplMapRectangle( const ::com::sun::star::awt::Rectangle& rRect )
-{
- ::com::sun::star::awt::Point aPoint( rRect.X, rRect.Y );
- ::com::sun::star::awt::Size aSize( rRect.Width, rRect.Height );
- ::com::sun::star::awt::Point aP( ImplMapPoint( aPoint ) );
- ::com::sun::star::awt::Size aS( ImplMapSize( aSize ) );
- return Rectangle( Point( aP.X, aP.Y ), Size( aS.Width, aS.Height ) );
-}
-
-// -----------------------------------------------------------------------
-
struct CellBorder
{
sal_Int32 mnPos; // specifies the distance to the top/left position of the table
@@ -5642,13 +5722,13 @@ struct CellBorder
CellBorder() : mnPos ( 0 ), mnLength( 0 ){};
};
-sal_Bool PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2)
+bool PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2)
{
- sal_Int32 nLineWidth = pCellBorder->maCellBorder.OuterLineWidth + pCellBorder->maCellBorder.InnerLineWidth;
+ const sal_Int32 nLineWidth(2 * (pCellBorder->maCellBorder.OuterLineWidth + pCellBorder->maCellBorder.InnerLineWidth));
+
if ( nLineWidth )
{
- nLineWidth *= 2;
- mnAngle = 0;
+ mfObjectRotation = 0.0;
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
EscherPropertyContainer aPropOptSp;
@@ -5672,14 +5752,14 @@ sal_Bool PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int
<< nX2
<< nY2;
mpPptEscherEx->CloseContainer();
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
//get merged cell's width
sal_Int32 GetCellRight( sal_Int32 nColumn,
- Rectangle& rect,
+ const basegfx::B2DRange& rObjectRange,
std::vector< std::pair< sal_Int32, sal_Int32 > >& aColumns,
uno::Reference< table::XMergeableCell >& xCell )
{
@@ -5690,13 +5770,13 @@ sal_Int32 GetCellRight( sal_Int32 nColumn,
if ( nC < aColumns.size() )
nRight += aColumns[ nC ].second;
else
- nRight = rect.Right();
+ nRight = basegfx::fround(rObjectRange.getMaxX());
}
return nRight;
}
//get merged cell's height
sal_Int32 GetCellBottom( sal_Int32 nRow,
- Rectangle& rect,
+ const basegfx::B2DRange& rObjectRange,
std::vector< std::pair< sal_Int32, sal_Int32 > >& aRows,
uno::Reference< table::XMergeableCell >& xCell )
{
@@ -5707,7 +5787,7 @@ sal_Int32 GetCellBottom( sal_Int32 nRow,
if ( nR < aRows.size() )
nBottom += aRows[ nR ].second;
else
- nBottom = rect.Bottom();
+ nBottom = basegfx::fround(rObjectRange.getMaxY());
}
return nBottom;
}
@@ -5745,39 +5825,52 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
std::vector< std::pair< sal_Int32, sal_Int32 > > aColumns;
std::vector< std::pair< sal_Int32, sal_Int32 > > aRows;
- awt::Point aPosition( ImplMapPoint( rXShape->getPosition() ) );
- sal_uInt32 nPosition = aPosition.X;
+ sal_uInt32 nPosition = basegfx::fround(maObjectRange.getMinX());
+
for ( sal_Int32 x = 0; x < nColumnCount; x++ )
{
uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( x ), uno::UNO_QUERY_THROW );
- awt::Size aS( 0, 0 );
- xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
- awt::Size aM( ImplMapSize( aS ) );
- aColumns.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Width ) );
- nPosition += aM.Width;
- if ( x == nColumnCount - 1 && nPosition != maRect.Right() )
- maRect.Right() = nPosition;
+ long aWidth(0);
+ xPropSet->getPropertyValue( sWidth ) >>= aWidth;
+ aWidth = basegfx::fround(mfMap100thMmToMs * aWidth);
+ aColumns.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aWidth ) );
+ nPosition += aWidth;
}
- nPosition = aPosition.Y;
+ if(nPosition != basegfx::fround(maObjectRange.getMaxX()))
+ {
+ maObjectRange = basegfx::B2DRange(
+ maObjectRange.getMinX(), maObjectRange.getMinY(),
+ nPosition, maObjectRange.getMaxX());
+ }
+
+ nPosition = basegfx::fround(maObjectRange.getMinY());
+
for ( sal_Int32 y = 0; y < nRowCount; y++ )
{
uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( y ), uno::UNO_QUERY_THROW );
- awt::Size aS( 0, 0 );
- xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
- awt::Size aM( ImplMapSize( aS ) );
- aRows.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Height ) );
- nPosition += aM.Height;
- if ( y == nRowCount - 1 && nPosition != maRect.Bottom())
- maRect.Bottom() = nPosition;
+ long aHeight(0);
+ xPropSet->getPropertyValue( sHeight ) >>= aHeight;
+ aHeight = basegfx::fround(mfMap100thMmToMs * aHeight);
+ aRows.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aHeight ) );
+ nPosition += aHeight;
}
+
+ if(nPosition != basegfx::fround(maObjectRange.getMaxY()))
+ {
+ maObjectRange = basegfx::B2DRange(
+ maObjectRange.getMinX(), maObjectRange.getMinY(),
+ maObjectRange.getMaxX(), nPosition);
+ }
+
mpPptEscherEx->OpenContainer( ESCHER_SpgrContainer );
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
mpPptEscherEx->AddAtom( 16, ESCHER_Spgr, 1 );
- *mpStrm << (sal_Int32)maRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (sal_Int32)maRect.Top()
- << (sal_Int32)maRect.Right()
- << (sal_Int32)maRect.Bottom();
+
+ *mpStrm << (sal_Int32)basegfx::fround(maObjectRange.getMinX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)basegfx::fround(maObjectRange.getMinY()) // TTTT: Check for mirrored if Min/Max needs to be exchanged
+ << (sal_Int32)basegfx::fround(maObjectRange.getMaxX())
+ << (sal_Int32)basegfx::fround(maObjectRange.getMaxY());
sal_uInt32 nShapeId = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId ); // Flags: Group | Patriarch
@@ -5787,7 +5880,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
if ( nRowCount )
{
SvMemoryStream aMemStrm;
- aMemStrm.ObjectOwnsMemory( sal_False );
+ aMemStrm.ObjectOwnsMemory( false );
aMemStrm << nRowCount
<< nRowCount
<< (sal_uInt16)4;
@@ -5798,14 +5891,14 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x1000100 );
aPropOpt2.AddOpt( ESCHER_Prop_tableProperties, 1 );
- aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, sal_True, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() );
+ aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, true, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() );
aPropOpt.CreateShapeProperties( rXShape );
aPropOpt.Commit( *mpStrm );
aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp );
if ( GetCurrentGroupLevel() > 0 )
- mpPptEscherEx->AddChildAnchor( maRect );
+ mpPptEscherEx->AddChildAnchor( maObjectRange );
else
- mpPptEscherEx->AddClientAnchor( maRect );
+ mpPptEscherEx->AddClientAnchor( maObjectRange );
mpPptEscherEx->CloseContainer();
@@ -5819,24 +5912,28 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
{
sal_Int32 nLeft = aColumns[ nColumn ].first;
sal_Int32 nTop = aRows[ nRow ].first;
- sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell );
- sal_Int32 nBottom = GetCellBottom( nRow, maRect,aRows,xCell );
+ sal_Int32 nRight = GetCellRight( nColumn, maObjectRange, aColumns, xCell );
+ sal_Int32 nBottom = GetCellBottom( nRow, maObjectRange, aRows, xCell );
- mbFontIndependentLineSpacing = sal_False;
+ mbFontIndependentLineSpacing = false;
mXPropSet = uno::Reference< beans::XPropertySet >( xCell, uno::UNO_QUERY_THROW );
mXText = uno::Reference< text::XSimpleText >( xCell, uno::UNO_QUERY_THROW );
mnTextSize = mXText->getString().getLength();
::com::sun::star::uno::Any aAny;
- if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FontIndependentLineSpacing" ) ) ), sal_True )
- aAny >>= mbFontIndependentLineSpacing;
+ if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FontIndependentLineSpacing" ) ) ), true )
+ {
+ sal_Bool bBool(sal_False);
+ aAny >>= bBool;
+ mbFontIndependentLineSpacing = bBool;
+ }
EscherPropertyContainer aPropOptSp;
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa02, aSolverContainer ); // Flags: Connector | HasSpt | Child
- aPropOptSp.CreateFillProperties( mXPropSet, sal_True );
+ aPropOptSp.CreateFillProperties( mXPropSet, true );
aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
- aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, false, true );
aPropOptSp.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapSquare );
SvMemoryStream aClientTextBox( 0x200, 0x200 );
@@ -5887,7 +5984,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
CellBorder aCellBorder;
aCellBorder.mnPos = aColumns[ nColumn ].first;
aCellBorder.mnLength = aColumns[ nColumn ].second;
- sal_Bool bTop = sal_False;
+ bool bTop(false);
//write nLine*nColumn cell's top border
if ( nLine < xRows->getCount() )
{ // top border
@@ -5898,7 +5995,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
table::BorderLine aBorderLine;
if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine )
aCellBorder.maCellBorder = aBorderLine;
- sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell );
+ sal_Int32 nRight = GetCellRight( nColumn, maObjectRange, aColumns, xCell );
bTop = ImplCreateCellBorder( &aCellBorder, aCellBorder.mnPos,
aRows[ nLine ].first, nRight, aRows[ nLine ].first );
}
@@ -5915,8 +6012,8 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
if ( !xCell->isMerged() )
{
- sal_Int32 nRight = GetCellRight( nColumn, maRect,aColumns,xCell );
- sal_Int32 nBottom = GetCellBottom( nRow - 1, maRect,aRows,xCell );
+ sal_Int32 nRight = GetCellRight( nColumn, maObjectRange, aColumns, xCell );
+ sal_Int32 nBottom = GetCellBottom( nRow - 1, maObjectRange, aRows, xCell );
if ( nBottom == ( aRows[ nLine-1 ].first + aRows[ nLine-1 ].second ) )
{
uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn, nRow - 1 ), uno::UNO_QUERY_THROW );
@@ -5945,7 +6042,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
CellBorder aCellBorder;
aCellBorder.mnPos = aRows[ nRow].first;
aCellBorder.mnLength = aRows[ nRow].second;
- sal_Bool bLeft = sal_False;
+ bool bLeft(false);
if ( nLine < xColumns->getCount() )
{ // left border
uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine, nRow ), uno::UNO_QUERY_THROW );
@@ -5955,7 +6052,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
table::BorderLine aBorderLine;
if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine )
aCellBorder.maCellBorder = aBorderLine;
- sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows,xCell );
+ sal_Int32 nBottom = GetCellBottom( nRow, maObjectRange, aRows, xCell );
bLeft = ImplCreateCellBorder( &aCellBorder, aColumns[nLine].first, aCellBorder.mnPos,
aColumns[nLine].first, nBottom );
}
@@ -5968,8 +6065,8 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
if (!xCell->isMerged() )
{
- sal_Int32 nRight = GetCellRight( nColumn-1, maRect, aColumns,xCell );
- sal_Int32 nBottom = GetCellBottom( nRow, maRect, aRows, xCell );
+ sal_Int32 nRight = GetCellRight( nColumn-1, maObjectRange, aColumns, xCell );
+ sal_Int32 nBottom = GetCellBottom( nRow, maObjectRange, aRows, xCell );
if ( nRight == (aColumns[nLine-1].first + aColumns[nLine-1].second) )
{
uno::Reference< table::XMergeableCell > xCellOwn( xCellRange->getCellByPosition( nColumn - 1, nRow ), uno::UNO_QUERY_THROW );
diff --git a/sd/source/filter/eppt/escherex.cxx b/sd/source/filter/eppt/escherex.cxx
index 1e12712e3e94..0e056a3caf41 100644
--- a/sd/source/filter/eppt/escherex.cxx
+++ b/sd/source/filter/eppt/escherex.cxx
@@ -161,7 +161,7 @@ void PptEscherEx::OpenContainer( sal_uInt16 n_EscherContainer, int nRecInstance
{
if ( !mbEscherDg )
{
- mbEscherDg = sal_True;
+ mbEscherDg = true;
mnCurrentDg = mxGlobal->GenerateDrawingId();
AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
@@ -175,7 +175,7 @@ void PptEscherEx::OpenContainer( sal_uInt16 n_EscherContainer, int nRecInstance
{
if ( mbEscherDg )
{
- mbEscherSpgr = sal_True;
+ mbEscherSpgr = true;
}
}
break;
@@ -211,7 +211,7 @@ void PptEscherEx::CloseContainer()
{
if ( mbEscherDg )
{
- mbEscherDg = sal_False;
+ mbEscherDg = false;
if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
*mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
}
@@ -222,7 +222,7 @@ void PptEscherEx::CloseContainer()
{
if ( mbEscherSpgr )
{
- mbEscherSpgr = sal_False;
+ mbEscherSpgr = false;
}
}
@@ -239,7 +239,9 @@ void PptEscherEx::CloseContainer()
// ---------------------------------------------------------------------------------------------
-sal_uInt32 PptEscherEx::EnterGroup( Rectangle* pBoundRect, SvMemoryStream* pClientData )
+sal_uInt32 PptEscherEx::EnterGroup(
+ const basegfx::B2DRange* pObjectRange,
+ SvMemoryStream* pClientData )
{
sal_uInt32 nShapeId = 0;
/* SJ: #Issue 26747#
@@ -248,18 +250,21 @@ sal_uInt32 PptEscherEx::EnterGroup( Rectangle* pBoundRect, SvMemoryStream* pClie
*/
if ( mnGroupLevel < 12 )
{
- Rectangle aRect;
- if ( pBoundRect )
- aRect = *pBoundRect;
+ basegfx::B2DRange aObjectRange(0.0, 0.0, 1.0, 1.0);
+
+ if(pObjectRange)
+ {
+ aObjectRange = *pObjectRange;
+ }
OpenContainer( ESCHER_SpgrContainer );
OpenContainer( ESCHER_SpContainer );
AddAtom( 16, ESCHER_Spgr, 1 );
PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel, mpOutStrm->Tell() );
- *mpOutStrm << (sal_Int32)aRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (sal_Int32)aRect.Top()
- << (sal_Int32)aRect.Right()
- << (sal_Int32)aRect.Bottom();
+ *mpOutStrm << (sal_Int32)basegfx::fround(aObjectRange.getMinX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)basegfx::fround(aObjectRange.getMinY()) // here minx,y, maxx,y is correct
+ << (sal_Int32)basegfx::fround(aObjectRange.getMaxX())
+ << (sal_Int32)basegfx::fround(aObjectRange.getMaxY());
nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
@@ -271,16 +276,19 @@ sal_uInt32 PptEscherEx::EnterGroup( Rectangle* pBoundRect, SvMemoryStream* pClie
{
AddAtom( 8, ESCHER_ClientAnchor );
PtReplaceOrInsert( ESCHER_Persist_Grouping_Logic | mnGroupLevel, mpOutStrm->Tell() );
- *mpOutStrm << (sal_Int16)aRect.Top() << (sal_Int16)aRect.Left() << (sal_Int16)aRect.Right() << (sal_Int16)aRect.Bottom();
+ *mpOutStrm << (sal_Int16)basegfx::fround(aObjectRange.getMinY()) // CAUTION! Here, X,Y is exchanged
+ << (sal_Int16)basegfx::fround(aObjectRange.getMinX()) // by PURPOSE, it's not an error (!)
+ << (sal_Int16)basegfx::fround(aObjectRange.getMaxX()) // TTTT: Check for mirrored if Min/Max needs to be exchanged
+ << (sal_Int16)basegfx::fround(aObjectRange.getMaxY());
}
else
{
AddAtom( 16, ESCHER_ChildAnchor );
PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel, mpOutStrm->Tell() );
- *mpOutStrm << (sal_Int32)aRect.Left()
- << (sal_Int32)aRect.Top()
- << (sal_Int32)aRect.Right()
- << (sal_Int32)aRect.Bottom();
+ *mpOutStrm << (sal_Int32)basegfx::fround(aObjectRange.getMinX()) // here minx,y, maxx,y is correct
+ << (sal_Int32)basegfx::fround(aObjectRange.getMinY())
+ << (sal_Int32)basegfx::fround(aObjectRange.getMaxX()) // TTTT: Check for mirrored if Min/Max needs to be exchanged
+ << (sal_Int32)basegfx::fround(aObjectRange.getMaxY());
}
}
if ( pClientData )
diff --git a/sd/source/filter/eppt/escherex.hxx b/sd/source/filter/eppt/escherex.hxx
index 8bc22f5212e3..c785b0997449 100644
--- a/sd/source/filter/eppt/escherex.hxx
+++ b/sd/source/filter/eppt/escherex.hxx
@@ -61,7 +61,9 @@ class PptEscherEx : public EscherEx
void OpenContainer( sal_uInt16 n_EscherContainer, int nRecInstance = 0 );
void CloseContainer();
- sal_uInt32 EnterGroup( Rectangle* pBoundRect, SvMemoryStream* pClientData );
+ sal_uInt32 EnterGroup(
+ const basegfx::B2DRange* pObjectRange,
+ SvMemoryStream* pClientData );
sal_uInt32 DrawingGroupContainerSize();
void WriteDrawingGroupContainer( SvStream& rSt );
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index c88563531b81..c161e18bbfd3 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -222,12 +222,13 @@ sal_Bool SdGRFFilter::Import()
SdPage* pPage = mrDocument.GetSdPage( 0, PK_STANDARD );
Point aPos;
- Size aPagSize( pPage->GetSize() );
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
+ Size aPagSize(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY()));
Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(),
aGraphic.GetPrefMapMode(), MAP_100TH_MM ) );
- aPagSize.Width() -= pPage->GetLftBorder() + pPage->GetRgtBorder();
- aPagSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder();
+ aPagSize.Width() -= pPage->GetLeftPageBorder() + pPage->GetRightPageBorder();
+ aPagSize.Height() -= pPage->GetTopPageBorder() + pPage->GetBottomPageBorder();
// scale to fit page
if ( ( ( aGrfSize.Height() > aPagSize.Height() ) || ( aGrfSize.Width() > aPagSize.Width() ) ) &&
@@ -250,10 +251,16 @@ sal_Bool SdGRFFilter::Import()
}
// Ausgaberechteck fuer Grafik setzen
- aPos.X() = ( ( aPagSize.Width() - aGrfSize.Width() ) >> 1 ) + pPage->GetLftBorder();
- aPos.Y() = ( ( aPagSize.Height() - aGrfSize.Height() ) >> 1 ) + pPage->GetUppBorder();
-
- pPage->InsertObject( new SdrGrafObj( aGraphic, Rectangle( aPos, aGrfSize ) ) );
+ aPos.X() = ( ( aPagSize.Width() - aGrfSize.Width() ) >> 1 ) + pPage->GetLeftPageBorder();
+ aPos.Y() = ( ( aPagSize.Height() - aGrfSize.Height() ) >> 1 ) + pPage->GetTopPageBorder();
+
+ SdrGrafObj* pNewSdrGraf = new SdrGrafObj(
+ pPage->getSdrModelFromSdrPage(),
+ aGraphic,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aGrfSize.getWidth(), aGrfSize.getHeight(),
+ aPos.X(), aPos.Y()));
+ pPage->InsertObjectToSdrObjList(*pNewSdrGraf);
bRet = sal_True;
}
}
@@ -282,8 +289,8 @@ sal_Bool SdGRFFilter::Export()
if ( xExporter.is() && xFilter.is() )
{
SdPage* pPage = NULL;
- sd::DrawViewShell* pDrawViewShell = static_cast< ::sd::DrawViewShell* >
- ( ( ( mrDocShell.GetViewShell() && mrDocShell.GetViewShell()->ISA(::sd::DrawViewShell ) ) ? mrDocShell.GetViewShell() : NULL ) );
+
+ sd::DrawViewShell* pDrawViewShell = dynamic_cast< ::sd::DrawViewShell* >(mrDocShell.GetViewShell());
PageKind ePageKind = PK_STANDARD;
if( pDrawViewShell )
@@ -300,7 +307,7 @@ sal_Bool SdGRFFilter::Export()
if ( pPage )
{
// taking the 'correct' page number, seems that there might exist a better method to archive this
- pPage = mrDocument.GetSdPage( pPage->GetPageNum() ? ( pPage->GetPageNum() - 1 ) >> 1 : 0, ePageKind );
+ pPage = mrDocument.GetSdPage( pPage->GetPageNumber() ? ( pPage->GetPageNumber() - 1 ) >> 1 : 0, ePageKind );
if ( pPage )
{
uno::Reference< lang::XComponent > xSource( pPage->getUnoPage(), uno::UNO_QUERY );
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index e88bcadebcdd..6dd9ecd839b5 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -91,6 +91,7 @@
#include "sdresid.hxx"
#include "buttonset.hxx"
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
using ::rtl::OString;
@@ -436,7 +437,7 @@ HtmlExport::~HtmlExport()
// ------------------------------------------------------------------
if(mpImageFiles && mpHTMLFiles && mpPageNames && mpTextFiles)
{
- for ( sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
+ for ( sal_uInt32 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
{
delete mpImageFiles[nSdPage];
delete mpHTMLFiles[nSdPage];
@@ -648,8 +649,7 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams
// calculate image sizes
SdPage* pPage = mpDoc->GetSdPage(0, PK_STANDARD);
- Size aTmpSize( pPage->GetSize() );
- double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
+ const double dRatio(pPage->GetPageScale().getX() / pPage->GetPageScale().getY());
/*
switch( mnWidthPixel )
@@ -678,8 +678,7 @@ void HtmlExport::InitExportParameters( const Sequence< PropertyValue >& rParams
maIndex = aINetURLObj.GetLastName();
mnSdPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
-// sal_uInt16 nHiddenSlides = 0;
- for( sal_uInt16 nPage = 0; nPage < mnSdPageCount; nPage++ )
+ for( sal_uInt32 nPage = 0; nPage < mnSdPageCount; nPage++ )
{
pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
@@ -730,7 +729,7 @@ void HtmlExport::ExportHtml()
//////
- sal_uInt16 nProgrCount = mnSdPageCount;
+ sal_uInt32 nProgrCount = mnSdPageCount;
nProgrCount += mbImpress?mnSdPageCount:0;
nProgrCount += mbContentsPage?1:0;
nProgrCount += (mbFrames && mbNotes)?mnSdPageCount:0;
@@ -885,7 +884,7 @@ void HtmlExport::ExportWebCast()
mnPagesWritten = 0;
InitProgress( mnSdPageCount + 9 );
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
CreateFileNames();
@@ -1027,7 +1026,7 @@ bool HtmlExport::CreateImagesForPresPages()
aDescriptor[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") );
aDescriptor[2].Value <<= aFilterData;
- for (sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
+ for (sal_uInt32 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
{
SdPage* pPage = maPages[ nSdPage ];
@@ -1097,7 +1096,7 @@ bool HtmlExport::CreateHtmlTextForPresPages()
SdrOutliner* pOutliner = mpDoc->GetInternalOutliner();
- for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount && bOk; nSdPage++)
+ for(sal_uInt32 nSdPage = 0; nSdPage < mnSdPageCount && bOk; nSdPage++)
{
SdPage* pPage = maPages[ nSdPage ];
@@ -1360,7 +1359,7 @@ String HtmlExport::ParagraphToHTMLString( SdrOutliner* pOutliner, sal_uLong nPar
// TODO: MALTE!!!
EditEngine& rEditEngine = *(EditEngine*)&pOutliner->GetEditEngine();
bool bOldUpdateMode = rEditEngine.GetUpdateMode();
- rEditEngine.SetUpdateMode(sal_True);
+ rEditEngine.SetUpdateMode(true);
Paragraph* pPara = pOutliner->GetParagraph(nPara);
if(NULL == pPara)
@@ -1410,7 +1409,7 @@ String HtmlExport::TextAttribToHTMLString( SfxItemSet* pSet, HtmlState* pState,
SvxFieldItem* pItem = (SvxFieldItem*)pSet->GetItem( EE_FEATURE_FIELD );
if(pItem)
{
- SvxURLField* pURL = PTR_CAST(SvxURLField, pItem->GetField());
+ const SvxURLField* pURL = dynamic_cast< const SvxURLField* >(pItem->GetField());
if(pURL)
{
aLink = pURL->GetURL();
@@ -1493,7 +1492,7 @@ bool HtmlExport::CreateHtmlForPresPages()
List aClickableObjects;
- for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount && bOk; nSdPage++)
+ for(sal_uInt32 nSdPage = 0; nSdPage < mnSdPageCount && bOk; nSdPage++)
{
// Klickbare Objekte finden (auch auf der Masterpage) und
// in Liste stellen. In umgekehrter Zeichenreihenfolge in
@@ -1577,7 +1576,7 @@ bool HtmlExport::CreateHtmlForPresPages()
aStr += String::CreateFromInt32(nSecs);
aStr.AppendAscii( "; URL=" );
- int nPage = nSdPage + 1;
+ sal_uInt32 nPage = nSdPage + 1;
if( nPage == mnSdPageCount )
nPage = 0;
@@ -1640,16 +1639,15 @@ bool HtmlExport::CreateHtmlForPresPages()
SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObject);
SdIMapInfo* pIMapInfo = mpDoc->GetIMapInfo(pObject);
- Rectangle aRect(pObject->GetCurrentBoundRect());
+ Rectangle aRect(sdr::legacy::GetBoundRect(*pObject));
Point aLogPos(aRect.TopLeft());
bool bIsSquare = aRect.GetWidth() == aRect.GetHeight();
- sal_uLong nPageWidth = pPage->GetSize().Width() - pPage->GetLftBorder() -
- pPage->GetRgtBorder();
+ sal_uLong nPageWidth = pPage->GetPageScale().getX() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder();
// das BoundRect bezieht sich auf den physikalischen
// Seitenursprung, nicht auf den Koordinatenursprung
- aRect.Move(-pPage->GetLftBorder(), -pPage->GetUppBorder());
+ aRect.Move(-pPage->GetLeftPageBorder(), -pPage->GetTopPageBorder());
double fLogicToPixel = ((double)mnWidthPixel) / nPageWidth;
aRect.Left() = (long)(aRect.Left() * fLogicToPixel);
@@ -1675,8 +1673,8 @@ bool HtmlExport::CreateHtmlForPresPages()
// ggfs. Seiten- oder Objektnamen umwandeln in den
// Namen der entsprechenden HTML-Datei
- sal_Bool bIsMasterPage;
- sal_uInt16 nPgNum = mpDoc->GetPageByName( aURL, bIsMasterPage );
+ bool bIsMasterPage;
+ sal_uInt32 nPgNum = mpDoc->GetPageByName( aURL, bIsMasterPage );
SdrObject* pObj = NULL;
if (nPgNum == SDRPAGE_NOTFOUND)
@@ -1684,7 +1682,14 @@ bool HtmlExport::CreateHtmlForPresPages()
// Ist das Bookmark ein Objekt?
pObj = mpDoc->GetObj( aURL );
if (pObj)
- nPgNum = pObj->GetPage()->GetPageNum();
+ {
+ SdrPage* pOwningPage = pObj->getSdrPageFromSdrObject();
+
+ if(pOwningPage)
+ {
+ nPgNum = pOwningPage->GetPageNumber();
+ }
+ }
}
if (nPgNum != SDRPAGE_NOTFOUND)
{
@@ -1700,8 +1705,8 @@ bool HtmlExport::CreateHtmlForPresPages()
GetRectangle(false));
// Umrechnung in Pixelkoordinaten
- aArea.Move(aLogPos.X() - pPage->GetLftBorder(),
- aLogPos.Y() - pPage->GetUppBorder());
+ aArea.Move(aLogPos.X() - pPage->GetLeftPageBorder(),
+ aLogPos.Y() - pPage->GetTopPageBorder());
aArea.Left() = (long)(aArea.Left() * fLogicToPixel);
aArea.Top() = (long)(aArea.Top() * fLogicToPixel);
aArea.Right() = (long)(aArea.Right() * fLogicToPixel);
@@ -1715,8 +1720,8 @@ bool HtmlExport::CreateHtmlForPresPages()
{
Point aCenter(((IMapCircleObject*)pArea)->
GetCenter(false));
- aCenter += Point(aLogPos.X() - pPage->GetLftBorder(),
- aLogPos.Y() - pPage->GetUppBorder());
+ aCenter += Point(aLogPos.X() - pPage->GetLeftPageBorder(),
+ aLogPos.Y() - pPage->GetTopPageBorder());
aCenter.X() = (long)(aCenter.X() * fLogicToPixel);
aCenter.Y() = (long)(aCenter.Y() * fLogicToPixel);
@@ -1732,7 +1737,8 @@ bool HtmlExport::CreateHtmlForPresPages()
case IMAP_OBJ_POLYGON:
{
Polygon aArea(((IMapPolygonObject*)pArea)->GetPolygon(false));
- aStr += CreateHTMLPolygonArea(::basegfx::B2DPolyPolygon(aArea.getB2DPolygon()), Size(aLogPos.X() - pPage->GetLftBorder(), aLogPos.Y() - pPage->GetUppBorder()), fLogicToPixel, aURL);
+ const basegfx::B2DPolyPolygon aPolyPolygon(aArea.getB2DPolygon());
+ aStr += CreateHTMLPolygonArea(aPolyPolygon, Size(aLogPos.X() - pPage->GetLeftPageBorder(), aLogPos.Y() - pPage->GetTopPageBorder()), fLogicToPixel, aURL);
}
break;
@@ -1760,8 +1766,8 @@ bool HtmlExport::CreateHtmlForPresPages()
{
case presentation::ClickAction_BOOKMARK:
{
- sal_Bool bIsMasterPage;
- sal_uInt16 nPgNum = mpDoc->GetPageByName( pInfo->GetBookmark(), bIsMasterPage );
+ bool bIsMasterPage;
+ sal_uInt32 nPgNum = mpDoc->GetPageByName( pInfo->GetBookmark(), bIsMasterPage );
SdrObject* pObj = NULL;
if( nPgNum == SDRPAGE_NOTFOUND )
@@ -1769,7 +1775,14 @@ bool HtmlExport::CreateHtmlForPresPages()
// Ist das Bookmark ein Objekt?
pObj = mpDoc->GetObj(pInfo->GetBookmark());
if (pObj)
- nPgNum = pObj->GetPage()->GetPageNum();
+ {
+ SdrPage* pOwningPage = pObj->getSdrPageFromSdrObject();
+
+ if(pOwningPage)
+ {
+ nPgNum = pOwningPage->GetPageNumber();
+ }
+ }
}
if( SDRPAGE_NOTFOUND != nPgNum )
@@ -1789,7 +1802,7 @@ bool HtmlExport::CreateHtmlForPresPages()
else
nPage = nSdPage - 1;
- aHRef = CreatePageURL( (sal_uInt16) nPage);
+ aHRef = CreatePageURL(nPage);
}
break;
@@ -1801,7 +1814,7 @@ bool HtmlExport::CreateHtmlForPresPages()
else
nPage = nSdPage + 1;
- aHRef = CreatePageURL( (sal_uInt16) nPage);
+ aHRef = CreatePageURL(nPage);
}
break;
@@ -1820,23 +1833,20 @@ bool HtmlExport::CreateHtmlForPresPages()
// jetzt die Areas
if( aHRef.Len() )
{
- // ein Kreis?
- if (pObject->GetObjInventor() == SdrInventor &&
- pObject->GetObjIdentifier() == OBJ_CIRC &&
- bIsSquare )
+ // a circle?
+ if(bIsSquare && dynamic_cast< SdrCircObj* >(pObject))
{
aStr += CreateHTMLCircleArea(aRect.GetWidth() / 2,
aRect.Left() + nRadius,
aRect.Top() + nRadius,
aHRef);
}
- // ein Polygon?
- else if (pObject->GetObjInventor() == SdrInventor &&
- (pObject->GetObjIdentifier() == OBJ_PATHLINE ||
- pObject->GetObjIdentifier() == OBJ_PLIN ||
- pObject->GetObjIdentifier() == OBJ_POLY))
+ // a Polygon?
+ else if(dynamic_cast< SdrPathObj* >(pObject))
{
- aStr += CreateHTMLPolygonArea(((SdrPathObj*)pObject)->GetPathPoly(), Size(-pPage->GetLftBorder(), -pPage->GetUppBorder()), fLogicToPixel, aHRef);
+ const basegfx::B2DPolyPolygon aPolyPolygon(static_cast< SdrPathObj* >(pObject)->getB2DPolyPolygonInObjectCoordinates());
+
+ aStr += CreateHTMLPolygonArea(aPolyPolygon, Size(-pPage->GetLeftPageBorder(), -pPage->GetTopPageBorder()), fLogicToPixel, aHRef);
}
// was anderes: das BoundRect nehmen
else
@@ -1912,7 +1922,7 @@ bool HtmlExport::CreateContentPage()
aStr += RESTOHTML(STR_HTMLEXP_CONTENTS);
aStr.AppendAscii( "</h3>" );
- for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
+ for(sal_uInt32 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
{
String aPageName = *mpPageNames[nSdPage];
aStr.AppendAscii( "<div align=\"left\">" );
@@ -1996,7 +2006,7 @@ bool HtmlExport::CreateNotesPages()
bool bOk = true;
SdrOutliner* pOutliner = mpDoc->GetInternalOutliner();
- for( sal_uInt16 nSdPage = 0; bOk && nSdPage < mnSdPageCount; nSdPage++ )
+ for( sal_uInt32 nSdPage = 0; bOk && nSdPage < mnSdPageCount; nSdPage++ )
{
SdPage* pPage = maNotesPages[nSdPage];
if( mbDocColors )
@@ -2052,7 +2062,7 @@ bool HtmlExport::CreateOutlinePages()
aStr += CreateBodyTag();
SdrOutliner* pOutliner = mpDoc->GetInternalOutliner();
- for(sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
+ for(sal_uInt32 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
{
SdPage* pPage = maPages[ nSdPage ];
@@ -2105,7 +2115,7 @@ void HtmlExport::CreateFileNames()
mbHeader = false; // Ueberschrift auf Uebersichtsseite?
- for (sal_uInt16 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
+ for (sal_uInt32 nSdPage = 0; nSdPage < mnSdPageCount; nSdPage++)
{
String* pName;
if(nSdPage == 0 && !mbContentsPage && !mbFrames )
@@ -2573,7 +2583,7 @@ bool HtmlExport::CreateNavBarFrames()
// ====================================================================
// Buttonleiste fuer Standard ausgeben
// ====================================================================
-String HtmlExport::CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const
+String HtmlExport::CreateNavBar( sal_uInt32 nSdPage, bool bIsText ) const
{
// Navigationsleiste vorbereiten
String aStrNavFirst( SdResId(STR_HTMLEXP_FIRSTPAGE) );
@@ -2905,7 +2915,7 @@ String HtmlExport::StringToHTMLString( const String& rString )
// =====================================================================
// Erzeugt die URL einer bestimmten Seite
// =====================================================================
-String HtmlExport::CreatePageURL( sal_uInt16 nPgNum )
+String HtmlExport::CreatePageURL( sal_uInt32 nPgNum )
{
if(mbFrames)
{
diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx
index b581e678622b..4f70e07ce2e6 100644
--- a/sd/source/filter/html/htmlex.hxx
+++ b/sd/source/filter/html/htmlex.hxx
@@ -104,8 +104,8 @@ class HtmlExport
HtmlPublishMode meMode;
SfxProgress* mpProgress;
bool mbImpress;
- sal_uInt16 mnSdPageCount;
- sal_uInt16 mnPagesWritten;
+ sal_uInt32 mnSdPageCount;
+ sal_uInt32 mnPagesWritten;
bool mbContentsPage;
sal_Int16 mnButtonThema;
sal_uInt16 mnWidthPixel;
@@ -186,7 +186,7 @@ class HtmlExport
String CreateLink( const String& aLink, const String& aText,
const String& aTarget = String()) const;
String CreateImage( const String& aImage, const String& aAltText, sal_Int16 nWidth = -1, sal_Int16 nHeight = -1 ) const;
- String CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const;
+ String CreateNavBar( sal_uInt32 nSdPage, bool bIsText ) const;
String CreateBodyTag() const;
String ParagraphToHTMLString( SdrOutliner* pOutliner, sal_uLong nPara, const Color& rBackgroundColor );
@@ -202,7 +202,7 @@ class HtmlExport
String CreateHTMLRectArea( const Rectangle& rRect,
const String& rHRef ) const;
- String CreatePageURL( sal_uInt16 nPgNum );
+ String CreatePageURL( sal_uInt32 nPgNum );
String InsertSound( const String& rSoundFile );
bool CopyFile( const String& rSourceFile, const String& rDestPath );
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 8c12926fccee..00150e76215a 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -104,39 +104,39 @@ public:
String m_aURL;
// special Kiosk options
- sal_Bool m_bAutoSlide;
+ bool m_bAutoSlide;
sal_uInt32 m_nSlideDuration;
- sal_Bool m_bEndless;
+ bool m_bEndless;
// special HTML options
- sal_Bool m_bContentPage;
- sal_Bool m_bNotes;
+ bool m_bContentPage;
+ bool m_bNotes;
// misc options
sal_uInt16 m_nResolution;
String m_aCompression;
PublishingFormat m_eFormat;
- sal_Bool m_bSlideSound;
- sal_Bool m_bHiddenSlides;
+ bool m_bSlideSound;
+ bool m_bHiddenSlides;
// titel page information
String m_aAuthor;
String m_aEMail;
String m_aWWW;
String m_aMisc;
- sal_Bool m_bDownload;
- sal_Bool m_bCreated; // not used
+ bool m_bDownload;
+ bool m_bCreated; // not used
// buttons and colorscheme
sal_Int16 m_nButtonThema;
- sal_Bool m_bUserAttr;
+ bool m_bUserAttr;
Color m_aBackColor;
Color m_aTextColor;
Color m_aLinkColor;
Color m_aVLinkColor;
Color m_aALinkColor;
- sal_Bool m_bUseAttribs;
- sal_Bool m_bUseColor;
+ bool m_bUseAttribs;
+ bool m_bUseColor;
SdPublishingDesign();
@@ -151,9 +151,8 @@ public:
SdPublishingDesign::SdPublishingDesign()
{
m_eMode = PUBLISH_HTML;
- m_bContentPage = sal_True;
- m_bNotes = sal_True;
-
+ m_bContentPage = true;
+ m_bNotes = true;
m_eFormat = FORMAT_PNG;
String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/JPG" ) );
@@ -170,28 +169,22 @@ SdPublishingDesign::SdPublishingDesign()
m_aAuthor += sal_Unicode(' ');
m_aAuthor += (String)aUserOptions.GetLastName();
m_aEMail = aUserOptions.GetEmail();
- m_bDownload = sal_False;
-//-/ m_bCreated = sal_True;
+ m_bDownload = false;
m_nButtonThema = -1;
-
- m_bUserAttr = sal_False;
- m_bUseAttribs = sal_True;
- m_bUseColor = sal_True;
-
+ m_bUserAttr = false;
+ m_bUseAttribs = true;
+ m_bUseColor = true;
m_aBackColor = COL_WHITE;
m_aTextColor = COL_BLACK;
m_aLinkColor = COL_BLUE;
m_aVLinkColor = COL_LIGHTBLUE;
m_aALinkColor = COL_GRAY;
-
m_eScript = SCRIPT_ASP;
-
- m_bAutoSlide = sal_True;
+ m_bAutoSlide = true;
m_nSlideDuration = 15;
- m_bEndless = sal_True;
-
- m_bSlideSound = sal_True;
- m_bHiddenSlides = sal_False;
+ m_bEndless = true;
+ m_bSlideSound = true;
+ m_bHiddenSlides = false;
}
// =====================================================================
@@ -265,44 +258,41 @@ int SdPublishingDesign::operator ==(const SdPublishingDesign & rDesign) const
SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign)
{
SdIOCompat aIO(rIn, STREAM_READ);
-
sal_uInt16 nTemp16;
+ sal_Bool bTempBOOL;
rIn.ReadByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 );
- rIn >> nTemp16;
- rDesign.m_eMode = (HtmlPublishMode)nTemp16;
- rIn >> rDesign.m_bContentPage;
- rIn >> rDesign.m_bNotes;
+ rIn >> nTemp16; rDesign.m_eMode = (HtmlPublishMode)nTemp16;
+ rIn >> bTempBOOL; rDesign.m_bContentPage = bTempBOOL;
+ rIn >> bTempBOOL; rDesign.m_bNotes = bTempBOOL;
rIn >> rDesign.m_nResolution;
rIn.ReadByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 );
- rIn >> nTemp16;
- rDesign.m_eFormat = (PublishingFormat)nTemp16;
+ rIn >> nTemp16; rDesign.m_eFormat = (PublishingFormat)nTemp16;
rIn.ReadByteString( rDesign.m_aAuthor, RTL_TEXTENCODING_UTF8 );
rIn.ReadByteString( rDesign.m_aEMail, RTL_TEXTENCODING_UTF8 );
rIn.ReadByteString( rDesign.m_aWWW, RTL_TEXTENCODING_UTF8 );
rIn.ReadByteString( rDesign.m_aMisc, RTL_TEXTENCODING_UTF8 );
- rIn >> rDesign.m_bDownload;
- rIn >> rDesign.m_bCreated; // not used
+ rIn >> bTempBOOL; rDesign.m_bDownload = bTempBOOL;
+ rIn >> bTempBOOL; rDesign.m_bCreated = bTempBOOL; // not used
rIn >> rDesign.m_nButtonThema;
- rIn >> rDesign.m_bUserAttr;
+ rIn >> bTempBOOL; rDesign.m_bUserAttr = bTempBOOL;
rIn >> rDesign.m_aBackColor;
rIn >> rDesign.m_aTextColor;
rIn >> rDesign.m_aLinkColor;
rIn >> rDesign.m_aVLinkColor;
rIn >> rDesign.m_aALinkColor;
- rIn >> rDesign.m_bUseAttribs;
- rIn >> rDesign.m_bUseColor;
+ rIn >> bTempBOOL; rDesign.m_bUseAttribs = bTempBOOL;
+ rIn >> bTempBOOL; rDesign.m_bUseColor = bTempBOOL;
- rIn >> nTemp16;
- rDesign.m_eScript = (PublishingScript)nTemp16;
+ rIn >> nTemp16; rDesign.m_eScript = (PublishingScript)nTemp16;
rIn.ReadByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 );
rIn.ReadByteString( rDesign.m_aCGI, RTL_TEXTENCODING_UTF8 );
- rIn >> rDesign.m_bAutoSlide;
+ rIn >> bTempBOOL; rDesign.m_bAutoSlide = bTempBOOL;
rIn >> rDesign.m_nSlideDuration;
- rIn >> rDesign.m_bEndless;
- rIn >> rDesign.m_bSlideSound;
- rIn >> rDesign.m_bHiddenSlides;
+ rIn >> bTempBOOL; rDesign.m_bEndless = bTempBOOL;
+ rIn >> bTempBOOL; rDesign.m_bSlideSound = bTempBOOL;
+ rIn >> bTempBOOL; rDesign.m_bHiddenSlides = bTempBOOL;
return rIn;
}
@@ -319,8 +309,8 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign)
rOut.WriteByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 );
rOut << (sal_uInt16)rDesign.m_eMode;
- rOut << rDesign.m_bContentPage;
- rOut << rDesign.m_bNotes;
+ rOut << (sal_Bool)rDesign.m_bContentPage;
+ rOut << (sal_Bool)rDesign.m_bNotes;
rOut << rDesign.m_nResolution;
rOut.WriteByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 );
rOut << (sal_uInt16)rDesign.m_eFormat;
@@ -328,27 +318,27 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign)
rOut.WriteByteString( rDesign.m_aEMail, RTL_TEXTENCODING_UTF8 );
rOut.WriteByteString( rDesign.m_aWWW, RTL_TEXTENCODING_UTF8 );
rOut.WriteByteString( rDesign.m_aMisc, RTL_TEXTENCODING_UTF8 );
- rOut << rDesign.m_bDownload;
- rOut << rDesign.m_bCreated; // not used
+ rOut << (sal_Bool)rDesign.m_bDownload;
+ rOut << (sal_Bool)rDesign.m_bCreated; // not used
rOut << rDesign.m_nButtonThema;
- rOut << rDesign.m_bUserAttr;
+ rOut << (sal_Bool)rDesign.m_bUserAttr;
rOut << rDesign.m_aBackColor;
rOut << rDesign.m_aTextColor;
rOut << rDesign.m_aLinkColor;
rOut << rDesign.m_aVLinkColor;
rOut << rDesign.m_aALinkColor;
- rOut << rDesign.m_bUseAttribs;
- rOut << rDesign.m_bUseColor;
+ rOut << (sal_Bool)rDesign.m_bUseAttribs;
+ rOut << (sal_Bool)rDesign.m_bUseColor;
rOut << (sal_uInt16)rDesign.m_eScript;
rOut.WriteByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 );
rOut.WriteByteString( rDesign.m_aCGI, RTL_TEXTENCODING_UTF8 );
- rOut << rDesign.m_bAutoSlide;
+ rOut << (sal_Bool)rDesign.m_bAutoSlide;
rOut << rDesign.m_nSlideDuration;
- rOut << rDesign.m_bEndless;
- rOut << rDesign.m_bSlideSound;
- rOut << rDesign.m_bHiddenSlides;
+ rOut << (sal_Bool)rDesign.m_bEndless;
+ rOut << (sal_Bool)rDesign.m_bSlideSound;
+ rOut << (sal_Bool)rDesign.m_bHiddenSlides;
return rOut;
}
@@ -387,8 +377,8 @@ SdPublishingDlg::SdPublishingDlg(Window* pWindow, DocumentType eDocType)
, aNextPageButton(this,SdResId(BUT_NEXT))
, aFinishButton(this,SdResId(BUT_FINISH))
, aAssistentFunc(NOOFPAGES)
-, m_bButtonsDirty(sal_True)
-, m_bDesignListDirty(sal_False)
+, m_bButtonsDirty(true)
+, m_bDesignListDirty(false)
, m_pDesign(NULL)
{
m_bImpress = eDocType == DOCUMENT_TYPE_IMPRESS;
@@ -431,7 +421,7 @@ SdPublishingDlg::SdPublishingDlg(Window* pWindow, DocumentType eDocType)
pPage3_Png->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
pPage3_Gif->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
pPage3_Jpg->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
- pPage3_Quality->Enable(sal_False);
+ pPage3_Quality->Enable(false);
pPage3_Resolution_1->SetClickHdl(LINK(this,SdPublishingDlg, ResolutionHdl ));
pPage3_Resolution_2->SetClickHdl(LINK(this,SdPublishingDlg, ResolutionHdl ));
@@ -791,8 +781,8 @@ void SdPublishingDlg::SetDefaults()
SdPublishingDesign aDefault;
SetDesign(&aDefault);
- pPage1_NewDesign->Check(sal_True);
- pPage1_OldDesign->Check(sal_False);
+ pPage1_NewDesign->Check(true);
+ pPage1_OldDesign->Check(false);
UpdatePage();
}
@@ -980,8 +970,8 @@ IMPL_LINK( SdPublishingDlg, DesignHdl, RadioButton *, pButton )
{
if(pButton == pPage1_NewDesign)
{
- pPage1_NewDesign->Check(sal_True); // wegen DesignDeleteHdl
- pPage1_OldDesign->Check(sal_False);
+ pPage1_NewDesign->Check(true); // wegen DesignDeleteHdl
+ pPage1_OldDesign->Check(false);
pPage1_Designs->Disable();
pPage1_DelDesign->Disable();
m_pDesign = NULL;
@@ -991,7 +981,7 @@ IMPL_LINK( SdPublishingDlg, DesignHdl, RadioButton *, pButton )
}
else
{
- pPage1_NewDesign->Check(sal_False);
+ pPage1_NewDesign->Check(false);
pPage1_Designs->Enable();
pPage1_DelDesign->Enable();
@@ -1047,7 +1037,7 @@ IMPL_LINK( SdPublishingDlg, DesignDeleteHdl, PushButton *, EMPTYARG )
delete pDesign;
- m_bDesignListDirty = sal_True;
+ m_bDesignListDirty = true;
UpdatePage();
@@ -1059,7 +1049,7 @@ IMPL_LINK( SdPublishingDlg, DesignDeleteHdl, PushButton *, EMPTYARG )
// =====================================================================
IMPL_LINK( SdPublishingDlg, WebServerHdl, RadioButton *, pButton )
{
- sal_Bool bASP = pButton == pPage2_ASP;
+ bool bASP = pButton == pPage2_ASP;
pPage2_ASP->Check( bASP );
pPage2_PERL->Check( !bASP );
@@ -1089,7 +1079,7 @@ IMPL_LINK( SdPublishingDlg, BaseHdl, RadioButton *, EMPTYARG )
if(pButton == pPage3_Standard)
pPage3_Frames->Check( pButton == pPage3 );
else
- pPage3_Standard->Check(sal_False);
+ pPage3_Standard->Check(false);
*/
UpdatePage();
@@ -1138,7 +1128,7 @@ IMPL_LINK( SdPublishingDlg, ResolutionHdl, RadioButton *, pButton )
IMPL_LINK( SdPublishingDlg, ButtonsHdl, ValueSet *, EMPTYARG )
{
// wird eine Bitmap Schaltflaeche gewaehlt, TexOnly ausschalten
- pPage5_TextOnly->Check(sal_False);
+ pPage5_TextOnly->Check(false);
return 0;
}
@@ -1180,7 +1170,7 @@ IMPL_LINK( SdPublishingDlg, ColorHdl, PushButton *, pButton)
m_aALinkColor = aDlg.GetColor();
}
- pPage6_User->Check(sal_True);
+ pPage6_User->Check(true);
pPage6_Preview->SetColors( m_aBackColor, m_aTextColor, m_aLinkColor,
m_aVLinkColor, m_aALinkColor );
pPage6_Preview->Invalidate();
@@ -1202,19 +1192,19 @@ IMPL_LINK( SdPublishingDlg, FinishHdl, OKButton *, EMPTYARG )
SdPublishingDesign* pDesign = new SdPublishingDesign();
GetDesign(pDesign);
- sal_Bool bSave = sal_False;
+ bool bSave = false;
if(pPage1_OldDesign->IsChecked() && m_pDesign)
{
// aenderungen??
if(!(*pDesign == *m_pDesign))
- bSave = sal_True;
+ bSave = true;
}
else
{
SdPublishingDesign aDefaultDesign;
if(!(aDefaultDesign == *pDesign))
- bSave = sal_True;
+ bSave = true;
}
if(bSave)
@@ -1223,10 +1213,10 @@ IMPL_LINK( SdPublishingDlg, FinishHdl, OKButton *, EMPTYARG )
if(m_pDesign)
aName = m_pDesign->m_aDesignName;
- sal_Bool bRetry;
+ bool bRetry;
do
{
- bRetry = sal_False;
+ bRetry = false;
SdDesignNameDlg aDlg(this, aName );
@@ -1260,7 +1250,7 @@ IMPL_LINK( SdPublishingDlg, FinishHdl, OKButton *, EMPTYARG )
if(!bRetry)
{
m_pDesignList->Insert(pDesign);
- m_bDesignListDirty = sal_True;
+ m_bDesignListDirty = true;
pDesign = NULL;
}
}
@@ -1330,7 +1320,7 @@ void SdPublishingDlg::UpdatePage()
pPage2_Index_txt->Show();
pPage2_Index->Show();
- sal_Bool bPerl = pPage2_PERL->IsChecked();
+ bool bPerl = pPage2_PERL->IsChecked();
pPage2_Index->Enable(bPerl);
pPage2_Index_txt->Enable(bPerl);
pPage2_URL_txt->Enable(bPerl);
@@ -1359,7 +1349,7 @@ void SdPublishingDlg::UpdatePage()
pPage2_Duration_txt->Show();
pPage2_Duration->Show();
pPage2_Endless->Show();
- sal_Bool bAuto = pPage2_ChgAuto->IsChecked();
+ bool bAuto = pPage2_ChgAuto->IsChecked();
pPage2_Duration->Enable(bAuto);
pPage2_Endless->Enable(bAuto);
}
@@ -1444,7 +1434,7 @@ void SdPublishingDlg::LoadPreviewButtons()
}
pPage5_Buttons->SetItemHeight( nHeight );
- m_bButtonsDirty = sal_False;
+ m_bButtonsDirty = false;
}
}
@@ -1577,7 +1567,7 @@ void SdPublishingDlg::GetDesign( SdPublishingDesign* pDesign )
pDesign->m_aEMail = pPage4_Email->GetText();
pDesign->m_aWWW = pPage4_WWW->GetText();
pDesign->m_aMisc = pPage4_Misc->GetText();
- pDesign->m_bDownload = m_bImpress?pPage4_Download->IsChecked():sal_False;
+ pDesign->m_bDownload = m_bImpress?pPage4_Download->IsChecked():false;
//-/ pDesign->m_bCreated = pPage4_Created->IsChecked();
if(pPage5_TextOnly->IsChecked())
@@ -1616,9 +1606,9 @@ IMPL_LINK( SdPublishingDlg, LastPageHdl, PushButton *, EMPTYARG )
// =====================================================================
// Designs laden
// =====================================================================
-sal_Bool SdPublishingDlg::Load()
+bool SdPublishingDlg::Load()
{
- m_bDesignListDirty = sal_False;
+ m_bDesignListDirty = false;
m_pDesignList = new List();
@@ -1639,18 +1629,18 @@ sal_Bool SdPublishingDlg::Load()
return sal_False;
}
- SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ | STREAM_NOCREATE, sal_True );
+ SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ | STREAM_NOCREATE, true );
SvStream* pStream = aMedium.GetInStream();
if( !pStream )
- return( sal_False );
+ return( false );
sal_uInt16 aCheck;
*pStream >> aCheck;
if(aCheck != nMagic)
- return sal_False;
+ return false;
SdIOCompat aIO(*pStream, STREAM_READ);
@@ -1673,17 +1663,17 @@ sal_Bool SdPublishingDlg::Load()
// =====================================================================
// Designs speichern
// =====================================================================
-sal_Bool SdPublishingDlg::Save()
+bool SdPublishingDlg::Save()
{
INetURLObject aURL( SvtPathOptions().GetUserConfigPath() );
aURL.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "designs.sod" ) ) );
- SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC, sal_False );
+ SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC, false );
aMedium.IsRemote();
SvStream* pStream = aMedium.GetOutStream();
if( !pStream )
- return( sal_False );
+ return( false );
sal_uInt16 aCheck = nMagic;
*pStream << aCheck;
diff --git a/sd/source/filter/ppt/ppt97animations.cxx b/sd/source/filter/ppt/ppt97animations.cxx
index 4577c26bc00d..1ae7667b06ee 100644
--- a/sd/source/filter/ppt/ppt97animations.cxx
+++ b/sd/source/filter/ppt/ppt97animations.cxx
@@ -651,10 +651,12 @@ void Ppt97Animation::UpdateCacheData() const
void Ppt97Animation::createAndSetCustomAnimationEffect( SdrObject* pObj )
{
-
if( !this->HasEffect() )
return;
- if( !pObj || !pObj->GetPage() )
+
+ SdrPage* pOwningPage = pObj ? pObj->getSdrPageFromSdrObject() : 0;
+
+ if( !pObj || !pOwningPage )
{
DBG_ERROR("no valid SdrObject or page found for ppt import");
return;
@@ -666,7 +668,7 @@ void Ppt97Animation::createAndSetCustomAnimationEffect( SdrObject* pObj )
DBG_ERROR("no XShape interface found for ppt import");
return;
}
- ::sd::MainSequencePtr pMainSequence = static_cast<SdPage*>(pObj->GetPage())->getMainSequence();
+ ::sd::MainSequencePtr pMainSequence = static_cast< SdPage* >(pOwningPage)->getMainSequence();
if( !pMainSequence.get() )
{
DBG_ERROR("no MainSequence found for ppt import");
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index f1c226183a0c..ae493eb10c03 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -76,6 +76,7 @@
#include "propread.hxx"
#include <cusshow.hxx>
#include <vcl/bmpacc.hxx>
+#include <svx/svdlegacy.hxx>
#include "../../ui/inc/DrawDocShell.hxx"
#include "../../ui/inc/FrameView.hxx"
@@ -151,7 +152,7 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SvSto
SfxItemSet& rSet = pSheet->GetItemSet();
// if autokerning is set in style, override it, ppt has no autokerning
- if( rSet.GetItemState( EE_CHAR_PAIRKERNING, sal_False ) == SFX_ITEM_SET )
+ if( rSet.GetItemState( EE_CHAR_PAIRKERNING, false ) == SFX_ITEM_SET )
rSet.ClearItem( EE_CHAR_PAIRKERNING );
}
}
@@ -173,7 +174,7 @@ ImplSdPPTImport::ImplSdPPTImport( SdDrawDocument* pDocument, SvStorage& rStorage
: SdrPowerPointImport ( rParam, rMedium.GetBaseURL() )
, mrMed ( rMedium )
, mrStorage ( rStorage_ )
-, mbDocumentFound ( sal_False )
+, mbDocumentFound ( false )
, mnFilterOptions ( 0 )
{
mpDoc = pDocument;
@@ -181,7 +182,7 @@ ImplSdPPTImport::ImplSdPPTImport( SdDrawDocument* pDocument, SvStorage& rStorage
{
mbDocumentFound = SeekToDocument( &maDocHd ); // maDocHd = the latest DocumentHeader
while ( SeekToRec( rStCtrl, PPT_PST_Document, nStreamLen, &maDocHd ) )
- mbDocumentFound = sal_True;
+ mbDocumentFound = true;
sal_uInt32 nDggContainerOfs = 0;
@@ -248,7 +249,7 @@ ImplSdPPTImport::~ImplSdPPTImport()
sal_Bool ImplSdPPTImport::Import()
{
if ( !bOk )
- return sal_False;
+ return false;
pSdrModel->setLock( sal_True );
pSdrModel->EnableUndo(false);
@@ -259,9 +260,9 @@ sal_Bool ImplSdPPTImport::Import()
nControlWord &=~ EE_CNTRL_ULSPACEFIRSTPARA;
((EditEngine&)rOutl.GetEditEngine()).SetControlWord( nControlWord );
- SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
- mnBackgroundLayerID = rAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), sal_False );
- mnBackgroundObjectsLayerID = rAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), sal_False );
+ SdrLayerAdmin& rAdmin = mpDoc->GetModelLayerAdmin();
+ mnBackgroundLayerID = rAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), false );
+ mnBackgroundObjectsLayerID = rAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), false );
::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
if ( pDocShell )
@@ -310,7 +311,7 @@ sal_Bool ImplSdPPTImport::Import()
for ( i = 0; i < nVecCount; i++ )
{
- if ( !aPropItem.Read( aUString, VT_EMPTY, sal_False ) )
+ if ( !aPropItem.Read( aUString, VT_EMPTY, false ) )
break;
aPropItem >> nType;
if ( ( nType != VT_I4 ) && ( nType != VT_UI4 ) )
@@ -349,7 +350,7 @@ sal_Bool ImplSdPPTImport::Import()
}
for ( i = 0; i < nSlideTitleCount; i++ )
{
- if ( !aPropItem.Read( aUString, nType, sal_False ) )
+ if ( !aPropItem.Read( aUString, nType, false ) )
break;
String* pString = new String( aUString );
if ( pString->EqualsAscii( "No Slide Title" ))
@@ -454,7 +455,7 @@ sal_Bool ImplSdPPTImport::Import()
PptSlidePersistList* pPageList = GetPageList( PPT_SLIDEPAGE );
if ( pPageList )
{
- sal_uInt16 nPage = pPageList->FindPage( nNumber );
+ sal_uInt32 nPage = pPageList->FindPage( nNumber );
if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
{
nPageNumber = nPage;
@@ -490,7 +491,7 @@ sal_Bool ImplSdPPTImport::Import()
sal_Int32 nNumber = aStringAry[ nToken ].ToInt32();
if ( ( nNumber & ~0xff ) == 0 )
{
- nPageNumber = (sal_uInt32)nNumber - 1;
+ nPageNumber = nNumber - 1;
bSucceeded = sal_True;
break;
}
@@ -505,7 +506,7 @@ sal_Bool ImplSdPPTImport::Import()
{
pHyperlink->aConvSubString = String( SdResId( STR_PAGE ) );
pHyperlink->aConvSubString.Append( sal_Unicode( ' ' ) );
- pHyperlink->aConvSubString.Append( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) );
+ pHyperlink->aConvSubString.Append( mpDoc->CreatePageNumValue( nPageNumber + 1 ) );
}
}
}
@@ -566,16 +567,16 @@ sal_Bool ImplSdPPTImport::Import()
sal_uInt32 nImportedPages = 0;
{
- sal_uInt16 nMasterAnz = GetPageCount( PPT_MASTERPAGE );
+ sal_uInt32 nMasterAnz = GetPageCount( PPT_MASTERPAGE );
- for ( sal_uInt16 nMasterNum = 0; nMasterNum < nMasterAnz; nMasterNum++ )
+ for ( sal_uInt32 nMasterNum = 0; nMasterNum < nMasterAnz; nMasterNum++ )
{
SetPageNum( nMasterNum, PPT_MASTERPAGE );
- SdPage* pPage = (SdPage*)MakeBlancPage( sal_True );
+ SdPage* pPage = (SdPage*)MakeBlancPage( true );
if ( pPage )
{
- sal_Bool bNotesMaster = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bNotesMaster;
- sal_Bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bStarDrawFiller;
+ bool bNotesMaster = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bNotesMaster;
+ bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bStarDrawFiller;
PageKind ePgKind = ( bNotesMaster ) ? PK_NOTES : PK_STANDARD;
sal_Bool bHandout = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bHandoutMaster;
@@ -585,7 +586,7 @@ sal_Bool ImplSdPPTImport::Import()
pPage->SetPageKind( ePgKind );
pSdrModel->InsertMasterPage( (SdrPage*)pPage );
if ( bNotesMaster && bStarDrawFiller )
- ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_NOTES, sal_True );
+ ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_NOTES, true );
if ( nMasterNum )
{
boost::optional< sal_Int16 > oStartNumbering;
@@ -648,12 +649,14 @@ sal_Bool ImplSdPPTImport::Import()
sal_uInt32 nTitleInstance = TSS_TYPE_PAGETITLE;
sal_uInt32 nOutlinerInstance = TSS_TYPE_BODY;
const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
- sal_Bool bSwapStyleSheet = pSlideLayout->eLayout == PPT_LAYOUT_TITLEMASTERSLIDE;
+ const bool bSwapStyleSheet(PPT_LAYOUT_TITLEMASTERSLIDE == pSlideLayout->eLayout);
+
if ( bSwapStyleSheet )
{
nTitleInstance = TSS_TYPE_TITLE;
nOutlinerInstance = TSS_TYPE_SUBTITLE;
}
+
/////////////////////
// titelstylesheet //
/////////////////////
@@ -727,7 +730,7 @@ sal_Bool ImplSdPPTImport::Import()
}
}
SdPage* pMPage;
- sal_uInt16 i;
+ sal_uInt32 i;
for ( i = 0; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ )
{
SetPageNum( i, PPT_MASTERPAGE );
@@ -742,7 +745,7 @@ sal_Bool ImplSdPPTImport::Import()
if ( pPersist->bStarDrawFiller && pPersist->bNotesMaster && ( nAktPageNum > 2 ) && ( ( nAktPageNum & 1 ) == 0 ) )
{
pSdrModel->DeleteMasterPage( nAktPageNum );
- SdrPage* pNotesClone = ((SdPage*)pSdrModel->GetMasterPage( 2 ))->Clone();
+ SdrPage* pNotesClone = static_cast< SdPage* >(pSdrModel->GetMasterPage( 2 ))->CloneSdrPage();
pSdrModel->InsertMasterPage( pNotesClone, nAktPageNum );
if ( pNotesClone )
{
@@ -751,7 +754,7 @@ sal_Bool ImplSdPPTImport::Import()
((SdPage*)pNotesClone)->SetLayoutName( aLayoutName );
}
}
- else if ( ( pPersist->bStarDrawFiller == sal_False ) )
+ else if ( ( pPersist->bStarDrawFiller == false ) )
{
PptSlidePersistEntry* pE = pPersist;
while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
@@ -762,9 +765,9 @@ sal_Bool ImplSdPPTImport::Import()
else
pE = (*pList)[ nNextMaster ];
}
- SdrObject* pObj = ImportPageBackgroundObject( *pMPage, pE->nBackgroundOffset, sal_True ); // import background
+ SdrObject* pObj = ImportPageBackgroundObject( *pMPage, pE->nBackgroundOffset, true ); // import background
if ( pObj )
- pMPage->NbcInsertObject( pObj );
+ pMPage->InsertObjectToSdrObjList(*pObj);
sal_Bool bNewAnimationsUsed = sal_False;
ProcessData aProcessData( *(*pList)[ nAktPageNum ], (SdPage*)pMPage );
@@ -804,13 +807,13 @@ sal_Bool ImplSdPPTImport::Import()
{
if ( nObjCount++ ) // skipping the first object
{
- Rectangle aEmpty;
+ basegfx::B2DRange aEmpty;
aHd2.SeekToBegOfRecord( rStCtrl );
SdrObject* pImpObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty );
if ( pImpObj )
{
pImpObj->SetLayer( mnBackgroundObjectsLayerID );
- pMPage->NbcInsertObject( pImpObj );
+ pMPage->InsertObjectToSdrObjList(*pImpObj);
}
}
}
@@ -885,8 +888,8 @@ sal_Bool ImplSdPPTImport::Import()
pMPage->getSdrPageProperties().PutItemSet(pObj->GetMergedItemSet());
}
- pMPage->RemoveObject(pObj->GetOrdNum());
- SdrObject::Free(pObj);
+ pMPage->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+ deleteSdrObjectSafeAndClearPointer(pObj);
}
}
}
@@ -902,7 +905,7 @@ sal_Bool ImplSdPPTImport::Import()
PptPageKind ePageKind = eAktPageKind;
sal_uInt16 nPageNum = nAktPageNum;
- SdPage* pHandoutPage = (SdPage*)MakeBlancPage( sal_False );
+ SdPage* pHandoutPage = (SdPage*)MakeBlancPage( false );
pHandoutPage->SetPageKind( PK_HANDOUT );
pSdrModel->InsertPage( pHandoutPage );
@@ -915,7 +918,7 @@ sal_Bool ImplSdPPTImport::Import()
mePresChange = PRESCHANGE_SEMIAUTO;
SetPageNum( nPage, PPT_SLIDEPAGE );
- SdPage* pPage = (SdPage*)MakeBlancPage( sal_False );
+ SdPage* pPage = (SdPage*)MakeBlancPage( false );
PptSlidePersistEntry* pMasterPersist = NULL;
if ( HasMasterPage( nPage, PPT_SLIDEPAGE ) ) // try to get the LayoutName from the masterpage
{
@@ -994,7 +997,7 @@ sal_Bool ImplSdPPTImport::Import()
// creating the corresponding note page
eAktPageKind = PPT_NOTEPAGE;
- SdPage* pNotesPage = (SdPage*)MakeBlancPage( sal_False );
+ SdPage* pNotesPage = (SdPage*)MakeBlancPage( false );
sal_uInt16 nNotesMasterNum = GetMasterPageIndex( nPage, PPT_SLIDEPAGE ) + 1;
sal_uInt32 nNotesPageId = GetNotesPageId( nPage );
if ( nNotesPageId )
@@ -1018,13 +1021,13 @@ sal_Bool ImplSdPPTImport::Import()
pSdrModel->InsertPage( pNotesPage ); // SJ: #i29625# because of form controls, the
ImportPage( pNotesPage, pMasterPersist2 ); // page must be inserted before importing
SetHeaderFooterPageSettings( pNotesPage, pMasterPersist2 );
- pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, sal_False );
+ pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, false );
}
else
{
pNotesPage->SetPageKind( PK_NOTES );
pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
- pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, sal_True );
+ pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, true );
pSdrModel->InsertPage( pNotesPage );
SdrObject* pPageObj = pNotesPage->GetPresObj( PRESOBJ_PAGE, 1 );
if ( pPageObj )
@@ -1040,7 +1043,7 @@ sal_Bool ImplSdPPTImport::Import()
{
// Das kann bei Dokumentvorlagen vorkommen
eAktPageKind = PPT_SLIDEPAGE;
- SdrPage* pPage = MakeBlancPage( sal_False );
+ SdrPage* pPage = MakeBlancPage( false );
pSdrModel->InsertPage( pPage );
// #i37397#, trying to set the title master for the first page
@@ -1065,10 +1068,10 @@ sal_Bool ImplSdPPTImport::Import()
((SdPage*)pPage)->TRG_SetMasterPage( *((SdPage*)pFoundMaster) );
((SdPage*)pPage)->SetLayoutName( ((SdPage*)pFoundMaster)->GetLayoutName() );
}
- ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_TITLE, sal_True, sal_True );
+ ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_TITLE, true, true );
eAktPageKind = PPT_NOTEPAGE;
- SdrPage* pNPage = MakeBlancPage( sal_False );
+ SdrPage* pNPage = MakeBlancPage( false );
pSdrModel->InsertPage( pNPage );
}
SetPageNum( nPageNum, ePageKind );
@@ -1198,14 +1201,14 @@ sal_Bool ImplSdPPTImport::Import()
break;
}
if ( eAutoLayout != AUTOLAYOUT_NONE )
- pPage->SetAutoLayout( eAutoLayout, sal_False );
+ pPage->SetAutoLayout( eAutoLayout, false );
}
}
//////////////////////////////////////////////////////////////
// Handzettel-MasterPage: Autolayout setzen //
//////////////////////////////////////////////////////////////
SdPage* pHandoutMPage = mpDoc->GetMasterSdPage( 0, PK_HANDOUT );
- pHandoutMPage->SetAutoLayout( AUTOLAYOUT_HANDOUT6, sal_True, sal_True );
+ pHandoutMPage->SetAutoLayout( AUTOLAYOUT_HANDOUT6, true, true );
}
sal_uInt32 nSlideCount = GetPageCount();
@@ -1232,7 +1235,7 @@ sal_Bool ImplSdPPTImport::Import()
List* pFrameViewList = mpDoc->GetFrameViewList();
if ( pFrameViewList )
{
- pFrameView = new ::sd::FrameView( mpDoc );
+ pFrameView = new ::sd::FrameView( *mpDoc );
if ( pFrameView )
pFrameViewList->Insert( pFrameView );
}
@@ -1305,7 +1308,7 @@ sal_Bool ImplSdPPTImport::Import()
sal_uInt32 nSCount = aContent.nRecLen >> 2;
if ( pPageList && nSCount )
{
- List* pList = mpDoc->GetCustomShowList( sal_True );
+ List* pList = mpDoc->GetCustomShowList( true );
if ( pList )
{
SdCustomShow* pSdCustomShow = new SdCustomShow( mpDoc );
@@ -1317,7 +1320,7 @@ sal_Bool ImplSdPPTImport::Import()
{
sal_uInt32 nPageNumber;
rStCtrl >> nPageNumber;
- sal_uInt16 nPage = pPageList->FindPage( nPageNumber );
+ sal_uInt32 nPage = pPageList->FindPage( nPageNumber );
if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
{
SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
@@ -1345,17 +1348,19 @@ sal_Bool ImplSdPPTImport::Import()
sal_uInt32 nFlags = 1; // Bit 0: Auto advance
sal_uInt32 nPenColor = 0x1000000;
sal_Int32 nRestartTime = 0x7fffffff;
- sal_uInt16 nStartSlide = 0;
+ sal_uInt32 nStartSlide = 0;
sal_Int16 nEndSlide = 0;
// read the pres. configuration
rStCtrl.Seek( maDocHd.GetRecBegFilePos() + 8 );
if ( SeekToRec( rStCtrl, PPT_PST_SSDocInfoAtom, maDocHd.GetRecEndFilePos(), &aCustomShowHeader ) )
{
+ sal_uInt16 nStartSlideOld(0);
rStCtrl >> nPenColor
>> nRestartTime
- >> nStartSlide
+ >> nStartSlideOld
>> nEndSlide;
+ nStartSlide = nStartSlideOld;
sal_Unicode nChar;
for ( sal_uInt32 i2 = 0; i2 < 32; i2++ )
@@ -1375,7 +1380,7 @@ sal_Bool ImplSdPPTImport::Import()
if ( aCustomShow.Len() )
{
void* pPtr;
- List* pList = mpDoc->GetCustomShowList( sal_False );
+ List* pList = mpDoc->GetCustomShowList( false );
if ( pList )
{
for ( pPtr = pList->First(); pPtr; pPtr = pList->Next() )
@@ -1435,7 +1440,7 @@ void ImplSdPPTImport::SetHeaderFooterPageSettings( SdPage* pPage, const PptSlide
bool bVisible = pHFE->IsToDisplay( i );
if ( ( eAktPageKind == PPT_SLIDEPAGE )
&& ( rSlidePersist.aSlideAtom.aLayout.eLayout == PPT_LAYOUT_TITLESLIDE )
- && ( aDocAtom.bTitlePlaceholdersOmitted == sal_True ) )
+ && ( aDocAtom.bTitlePlaceholdersOmitted == true ) )
{
bVisible = sal_False;
}
@@ -1444,13 +1449,13 @@ void ImplSdPPTImport::SetHeaderFooterPageSettings( SdPage* pPage, const PptSlide
sal_uInt32 nPosition = pHFE->NeedToImportInstance( i, rSlidePersist );
if ( nPosition )
{
- Rectangle aEmpty;
+ basegfx::B2DRange aEmpty;
bVisible = sal_False;
rStCtrl.Seek( nPosition );
ProcessData aProcessData( rSlidePersist, (SdPage*)pPage );
SdrObject* pObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty );
if ( pObj )
- pPage->NbcInsertObject( pObj, 0 );
+ pPage->InsertObjectToSdrObjList(*pObj, 0);
}
}
String aPlaceHolderString;
@@ -1513,7 +1518,7 @@ bool Ppt97AnimationStlSortHelper::operator()( const std::pair< SdrObject*, Ppt97
return true;
if( *p1.second > *p2.second )
return false;
- if( p1.first->GetOrdNum() < p2.first->GetOrdNum() )
+ if( p1.first->GetNavigationPosition() < p2.first->GetNavigationPosition() )
return true;
return false;
}
@@ -1536,7 +1541,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat
if(pPage->TRG_HasMasterPage())
{
SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- aVisibleLayers.Set(mnBackgroundObjectsLayerID, sal_False);
+ aVisibleLayers.Set(mnBackgroundObjectsLayerID, false);
pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
}
}
@@ -1546,9 +1551,9 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat
{
sal_uLong nPageRecEnd = aPageRecHd.GetRecEndFilePos();
- sal_Bool bTryTwice = ( eAktPageKind == PPT_SLIDEPAGE );
- sal_Bool bSSSlideInfoAtom = sal_False;
- while ( sal_True )
+ bool bTryTwice = ( eAktPageKind == PPT_SLIDEPAGE );
+ bool bSSSlideInfoAtom = false;
+ while ( true )
{
while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nPageRecEnd ) )
{
@@ -1558,7 +1563,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat
{
case PPT_PST_SSSlideInfoAtom:
{
- bSSSlideInfoAtom = sal_True;
+ bSSSlideInfoAtom = true;
if ( eAktPageKind == PPT_MASTERPAGE )
{
if ( pActualSlidePersist )
@@ -1811,10 +1816,10 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat
// pPage->SetPresChange( mePresChange );
if ( nBuildFlags & 4 )
- pPage->SetExcluded( sal_True ); // Dia nicht anzeigen
+ pPage->SetExcluded( true ); // Dia nicht anzeigen
if ( nBuildFlags & 16 )
{ // Dia mit Soundeffekt
- pPage->SetSound( sal_True );
+ pPage->SetSound( true );
String aSoundFile( ReadSound( nSoundRef ) );
pPage->SetSoundFile( aSoundFile );
}
@@ -1828,9 +1833,9 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat
}
aHd.SeekToEndOfRecord( rStCtrl );
}
- if ( bTryTwice && ( bSSSlideInfoAtom == sal_False ) )
+ if ( bTryTwice && ( bSSSlideInfoAtom == false ) )
{
- bTryTwice = sal_False;
+ bTryTwice = false;
if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
{
sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
@@ -1912,8 +1917,8 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
{
sal_uInt32 nDataLen = aSoundBlockRecHd.GetRecEndFilePos();
DffRecordHeader aSoundRecHd;
- sal_Bool bRefStrValid = sal_False;
- sal_Bool bDone = sal_False;
+ bool bRefStrValid = false;
+ bool bDone = false;
while( !bDone && SeekToRec( rStCtrl, PPT_PST_Sound, nDataLen, &aSoundRecHd ) )
{
@@ -1923,7 +1928,7 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, NULL, 2 ) )
{
if ( ReadString( aRefStr ) )
- bRefStrValid = sal_True;
+ bRefStrValid = true;
}
if ( bRefStrValid )
{
@@ -1933,7 +1938,7 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, NULL, 0 ) )
{
ReadString( aRetval );
- bDone = sal_True;
+ bDone = true;
}
}
}
@@ -1942,7 +1947,7 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
// ueberpruefen, ob diese Sound-Datei schon
// existiert. Wenn nicht, exportiere diese
// in unser lokales Sound-Verzeichnis.
- sal_Bool bSoundExists = sal_False;
+ bool bSoundExists = false;
List* pSoundList = new List();
GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, *pSoundList );
@@ -1956,7 +1961,7 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
if( aSoundName == aRetval )
{
aRetval = *(String*)pSoundList->GetObject( n );
- bSoundExists = sal_True;
+ bSoundExists = true;
}
}
@@ -2250,7 +2255,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
{
pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
if ( pSheet )
- ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
+ ((SdrAttrObj*)pText)->SdrAttrObj::SetStyleSheet( pSheet, true );
DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for titleobject (SJ)" );
}
break;
@@ -2258,7 +2263,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
{
pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TEXT );
if ( pSheet )
- ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
+ ((SdrAttrObj*)pText)->SdrAttrObj::SetStyleSheet( pSheet, true );
DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for subtitleobject (SJ)" );
}
break;
@@ -2272,13 +2277,13 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
aName.Append( (sal_Unicode)( ' ' ) );
aName.Append( String::CreateFromInt32( nLevel ) );
pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE );
- if ( pSheet )
- pText->StartListening( *pSheet );
+//LSTNo if ( pSheet )
+//LSTNo pText->StartListening( *pSheet );
pStyleSheetAry[ nLevel - 1 ] = pSheet;
}
DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for outlinerobject (SJ)" );
if ( pSheet )
- ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
+ ((SdrAttrObj*)pText)->SdrAttrObj::SetStyleSheet( pSheet, true );
ppStyleSheetAry = &pStyleSheetAry[ 0 ];
}
break;
@@ -2289,7 +2294,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
{
pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
if ( pSheet )
- ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
+ ((SdrAttrObj*)pText)->SdrAttrObj::SetStyleSheet( pSheet, true );
DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for titleobject (SJ)" );
}
else
@@ -2297,7 +2302,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_NOTES );
DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for notesobj (SJ)" );
if ( pSheet )
- ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
+ ((SdrAttrObj*)pText)->SdrAttrObj::SetStyleSheet( pSheet, true );
}
}
break;
@@ -2332,10 +2337,10 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
{
if ( !bIsHeaderFooter )
{
- pText->SetNotVisibleAsMaster( sal_True );
- pText->SetEmptyPresObj( sal_True );
+ pText->SetNotVisibleAsMaster( true );
+ pText->SetEmptyPresObj( true );
}
- pText->SetUserCall( pPage );
+ establishConnectionToSdrObject(pText, pPage);
pPage->InsertPresObj( pText, ePresKind );
SdrOutliner* pOutl = NULL;
if ( pTextObj->GetInstance() == TSS_TYPE_NOTES )
@@ -2349,10 +2354,10 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
if ( pSheet2 )
{
SfxItemSet& rItemSet = pSheet2->GetItemSet();
- rItemSet.Put( (SdrTextLeftDistItem&)pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) );
- rItemSet.Put( (SdrTextRightDistItem&)pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST ) );
- rItemSet.Put( (SdrTextUpperDistItem&)pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST ) );
- rItemSet.Put( (SdrTextLowerDistItem&)pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST ) );
+ rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) );
+ rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST ) );
+ rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST ) );
+ rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST ) );
rItemSet.Put( (SdrTextVertAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST ) );
rItemSet.Put( (SdrTextHorzAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST ) );
if ( pTextObj->GetInstance() == TSS_TYPE_TITLE
@@ -2361,13 +2366,13 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
rItemSet.Put( pText->GetMergedItemSet() );
}
}
- pText->NbcSetStyleSheet( pSheet2, sal_False );
+ pText->SetStyleSheet( pSheet2, false );
}
- SfxItemSet aTempAttr( mpDoc->GetPool() );
- SdrTextMinFrameHeightItem aMinHeight( pText->GetLogicRect().GetSize().Height() );
+ SfxItemSet aTempAttr(pText->GetObjectItemPool());
+ SdrMetricItem aMinHeight(SDRATTR_TEXT_MINFRAMEHEIGHT, sdr::legacy::GetLogicRect(*pText).GetSize().Height() );
aTempAttr.Put( aMinHeight );
- SdrTextAutoGrowHeightItem aAutoGrowHeight( sal_False );
+ SdrOnOffItem aAutoGrowHeight(SDRATTR_TEXT_AUTOGROWHEIGHT, false );
aTempAttr.Put( aAutoGrowHeight );
pText->SetMergedItemSet(aTempAttr);
}
@@ -2438,7 +2443,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
}
else if ( pTextObj->GetShapeType() == mso_sptPictureFrame )
{
- if ( !pTextObj->Count() && pObj->ISA( SdrGrafObj ) )
+ if ( !pTextObj->Count() && dynamic_cast< SdrGrafObj* >(pObj) )
{
bEmptyPresObj = sal_False;
switch ( nPlaceholderId )
@@ -2460,12 +2465,12 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
}
else
{
- SdrObject* pPresObj = pPage->CreatePresObj( ePresObjKind, bVertical, pText->GetLogicRect(), sal_True );
- pPresObj->SetUserCall( pPage );
+ SdrObject* pPresObj = pPage->CreatePresObj( ePresObjKind, bVertical, sdr::legacy::GetLogicRange(*pText), true );
+ establishConnectionToSdrObject(pPresObj, pPage);
SfxItemSet aSet( pSdrModel->GetItemPool() );
ApplyAttributes( rStCtrl, aSet );
- pPresObj->SetLogicRect(pText->GetLogicRect());
+ pPresObj->setSdrObjectTransformation(pText->getSdrObjectTransformation());
ApplyTextAnchorAttributes( *pTextObj, aSet );
//set custom font attribute of the placeholder
if ( pTextObj->Count() == 1 )
@@ -2477,6 +2482,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
pPor->ApplyTo(aSet, (SdrPowerPointImport&)*this, pTextObj->GetDestinationInstance());
}
}
+
pPresObj->SetMergedItemSet(aSet);
if ( ( eAktPageKind != PPT_NOTEPAGE ) && ( pSlideLayout->aPlacementId[ i ] != (sal_uLong)-1 ) )
@@ -2489,13 +2495,13 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
Size aOutlineSize;
if ( pTitleObj )
- aTitleRect = pTitleObj->GetLogicRect();
+ aTitleRect = sdr::legacy::GetLogicRect(*pTitleObj);
if ( pOutlineObj )
{
- aOutlineRect = pOutlineObj->GetLogicRect();
+ aOutlineRect = sdr::legacy::GetLogicRect(*pOutlineObj);
aOutlineSize = aOutlineRect.GetSize();
}
- Rectangle aLogicRect( pPresObj->GetLogicRect() );
+ Rectangle aLogicRect( sdr::legacy::GetLogicRect(*pPresObj) );
Size aLogicSize( aLogicRect.GetSize() );
switch ( pSlideLayout->aPlacementId[ i ] )
@@ -2503,7 +2509,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
case 0 : // Lage im Titelbereich
{
if ( aLogicRect != aTitleRect )
- pPresObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pPresObj);
}
break;
@@ -2512,7 +2518,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
if ( pSlideLayout->eLayout == PPT_LAYOUT_TITLEANDBODYSLIDE )
{ // Lage im Outlinebereich
if ( aLogicRect != aOutlineRect )
- pPresObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pPresObj);
}
else if ( pSlideLayout->eLayout == PPT_LAYOUT_2COLUMNSANDTITLE )
{ // Lage im Outlinebereich links
@@ -2522,7 +2528,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
aLogicSize.Width() / aOutlineSize.Width() < 0.48 ||
aLogicSize.Width() / aOutlineSize.Width() > 0.5)
{
- pPresObj->SetUserCall(NULL);
+ resetConnectionToSdrObject(pPresObj);
}
}
else if ( pSlideLayout->eLayout == PPT_LAYOUT_2ROWSANDTITLE )
@@ -2531,13 +2537,13 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE ||
Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE)
{
- pPresObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pPresObj);
}
}
else if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE)
{ // Lage im Outlinebereich links oben
- pPresObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pPresObj);
}
}
break;
@@ -2552,7 +2558,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
aLogicSize.Width() / aOutlineSize.Width() < 0.48 ||
aLogicSize.Width() / aOutlineSize.Width() > 0.5)
{
- pPresObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pPresObj);
}
}
else if ( pSlideLayout->eLayout == PPT_LAYOUT_2ROWSANDTITLE )
@@ -2561,13 +2567,13 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE ||
Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE)
{
- pPresObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pPresObj);
}
}
else if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE)
{ // Lage im Outlinebereich rechts oben
- pPresObj->SetUserCall(NULL);
+ resetConnectionToSdrObject(pPresObj);
}
}
break;
@@ -2577,7 +2583,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE)
{
- pPresObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pPresObj);
}
}
break;
@@ -2587,7 +2593,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE)
{
- pObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pObj);
}
}
break;
@@ -2604,35 +2610,34 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
}
if ( pRet != pText )
{
- SdrObject* pFree( pText );
- SdrObject::Free( pFree );
+ deleteSdrObjectSafeAndClearPointer( pText );
}
return pRet;
}
-SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, Rectangle& rTextRect, SdrObject* pRet )
+SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, basegfx::B2DRange& rTextRange, SdrObject* pRet )
{
- SdrObject* pObj = SdrPowerPointImport::ProcessObj( rSt, rObjData, pData, rTextRect, pRet );
+ SdrObject* pObj = SdrPowerPointImport::ProcessObj( rSt, rObjData, pData, rTextRange, pRet );
// Animationseffekte des Objektes lesen
if ( pObj )
{
// further setup placeholder objects
- if( pObj->ISA(SdrPageObj) && pData )
+ if( pData && dynamic_cast< SdrPageObj* >(pObj) )
{
const ProcessData* pProcessData=(const ProcessData*)pData;
if( pProcessData->pPage )
pProcessData->pPage->InsertPresObj( pObj, PRESOBJ_PAGE );
}
- sal_Bool bInhabitanceChecked = sal_False;
- sal_Bool bAnimationInfoFound = sal_False;
+ bool bInhabitanceChecked = false;
+ bool bAnimationInfoFound = false;
DffRecordHeader aMasterShapeHd;
if ( maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
DffRecordHeader& rHdClientData = *maShapeRecords.Current();
- while( sal_True )
+ while( true )
{
sal_uInt32 nClientDataLen = rHdClientData.GetRecEndFilePos();
DffRecordHeader aHd;
@@ -2662,8 +2667,9 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObj);
- if( pTextObj && pTextObj->HasText() &&
- !pObj->ISA( SdrObjGroup ) &&
+ if( pTextObj &&
+ pTextObj->HasText() &&
+ !dynamic_cast< SdrObjGroup* >(pObj) &&
pAnimation->HasAnimateAssociatedShape() )
{
const SfxItemSet& rObjItemSet = pObj->GetMergedItemSet();
@@ -2683,7 +2689,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
maAnimations[pObj] = pAnimation;
- bAnimationInfoFound = sal_True;
+ bAnimationInfoFound = true;
}
}
}
@@ -2720,8 +2726,10 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
aMediaURL = ReadSound( nRef );
if ( aMediaURL.Len() )
{
- SdrMediaObj* pMediaObj = new SdrMediaObj( pObj->GetSnapRect() );
- pMediaObj->SetModel( pObj->GetModel() );
+ SdrMediaObj* pMediaObj = new SdrMediaObj(
+ pObj->getSdrModelFromSdrObject(),
+ pObj->getSdrObjectTransformation());
+ // pMediaObj->SetModel( pObj->GetModel() );
pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() );
//--remove object from maAnimations list and add the new object instead
@@ -2737,7 +2745,8 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
//--
- SdrObject::Free( pObj ), pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list
+ deleteSdrObjectSafeAndClearPointer( pObj );
+ pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list
pMediaObj->setURL( aMediaURL );
}
}
@@ -2752,7 +2761,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( bInhabitanceChecked || bAnimationInfoFound )
break;
- bInhabitanceChecked = sal_True;
+ bInhabitanceChecked = true;
if ( ! ( IsProperty( DFF_Prop_hspMaster ) && SeekToShape( rSt, pData, GetPropertyValue( DFF_Prop_hspMaster ) ) ) )
break;
rSt >> aMasterShapeHd;
diff --git a/sd/source/filter/ppt/pptin.hxx b/sd/source/filter/ppt/pptin.hxx
index 436102e291e2..b21c0ff01f4c 100644
--- a/sd/source/filter/ppt/pptin.hxx
+++ b/sd/source/filter/ppt/pptin.hxx
@@ -57,7 +57,7 @@ class ImplSdPPTImport : public SdrPowerPointImport
// SvStream* mpPicStream;
DffRecordHeader maDocHd;
List maSlideNameList;
- sal_Bool mbDocumentFound;
+ bool mbDocumentFound;
sal_uInt32 mnFilterOptions;
SdDrawDocument* mpDoc;
PresChange mePresChange;
@@ -71,7 +71,7 @@ class ImplSdPPTImport : public SdrPowerPointImport
void FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiveInfoAtom* pIAtom, String aMacroName );
- virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj );
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, basegfx::B2DRange& rTextRect, SdrObject* pObj );
virtual SdrObject* ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pText, SdPage* pPage,
SfxStyleSheet*, SfxStyleSheet** ) const;
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index f11dd6601813..3462b82f6673 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -3067,10 +3067,13 @@ sal_Int32 AnimationImporter::importTargetElementContainer( const Atom* pAtom, An
case 8: rSubType = ShapeAnimationSubType::ONLY_TEXT; break;
case 2: // one paragraph
{
- if( ((begin == -1) && (end == -1)) || !pSdrObject->ISA( SdrTextObj ) )
+ if((begin == -1) && (end == -1))
break;
- SdrTextObj* pTextObj = static_cast< SdrTextObj* >( pSdrObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(pSdrObject);
+
+ if(!pTextObj)
+ break;
const OutlinerParaObject* pOPO = pTextObj->GetOutlinerParaObject();
if( pOPO == NULL )
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 10df4331955d..25c1ac6eee62 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -28,6 +28,7 @@
#include "tools/debug.hxx"
#include "rtl/tencinfo.h"
#include "rtl/textenc.h"
+#include <string.h>
// ------------------------------------------------------------------------
@@ -98,7 +99,7 @@ static xub_StrLen lcl_getMaxSafeStrLen(sal_uInt32 nSize)
return static_cast< xub_StrLen >( nSize );
}
-sal_Bool PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign )
+bool PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign )
{
sal_uInt32 i, nItemSize, nType, nItemPos;
sal_Bool bRetValue = sal_False;
diff --git a/sd/source/filter/ppt/propread.hxx b/sd/source/filter/ppt/propread.hxx
index 22ea6e8c800b..870ce9d25e26 100644
--- a/sd/source/filter/ppt/propread.hxx
+++ b/sd/source/filter/ppt/propread.hxx
@@ -112,7 +112,7 @@ class PropItem : public SvMemoryStream
void Clear();
void SetTextEncoding( sal_uInt16 nTextEnc ){ mnTextEnc = nTextEnc; };
- sal_Bool Read( String& rString, sal_uInt32 nType = VT_EMPTY, sal_Bool bDwordAlign = sal_True );
+ bool Read( String& rString, sal_uInt32 nType = VT_EMPTY, sal_Bool bDwordAlign = sal_True );
PropItem& operator=( PropItem& rPropItem );
using SvStream::Read;
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index 789adbcb0ea1..e64c0636008c 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -47,7 +47,7 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::frame;
-typedef sal_Bool ( __LOADONCALLAPI *ExportPPT )( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef&,
+typedef bool ( __LOADONCALLAPI *ExportPPT )( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef&,
Reference< XModel > &,
Reference< XStatusIndicator > &,
SvMemoryStream*, sal_uInt32 nCnvrtFlags );
@@ -55,7 +55,7 @@ typedef sal_Bool ( __LOADONCALLAPI *ExportPPT )( const std::vector< com::sun::st
typedef sal_Bool ( SAL_CALL *ImportPPT )( const ::rtl::OUString&, Sequence< PropertyValue >*,
SdDrawDocument*, SvStream&, SvStorage&, SfxMedium& );
-typedef sal_Bool ( __LOADONCALLAPI *SaveVBA )( SfxObjectShell&, SvMemoryStream*& );
+typedef bool ( __LOADONCALLAPI *SaveVBA )( SfxObjectShell&, SvMemoryStream*& );
// ---------------
// - SdPPTFilter -
@@ -79,7 +79,7 @@ SdPPTFilter::~SdPPTFilter()
sal_Bool SdPPTFilter::Import()
{
sal_Bool bRet = sal_False;
- SotStorageRef pStorage = new SotStorage( mrMedium.GetInStream(), sal_False );
+ SotStorageRef pStorage = new SotStorage( mrMedium.GetInStream(), false );
if( !pStorage->GetError() )
{
/* check if there is a dualstorage, then the
@@ -138,7 +138,7 @@ sal_Bool SdPPTFilter::Export()
{
if( mxModel.is() )
{
- SotStorageRef xStorRef = new SotStorage( mrMedium.GetOutStream(), sal_False );
+ SotStorageRef xStorRef = new SotStorage( mrMedium.GetOutStream(), false );
ExportPPT PPTExport = reinterpret_cast<ExportPPT>(pLibrary->getFunctionSymbol( ::rtl::OUString::createFromAscii("ExportPPT") ));
/* !!!
diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx
index 0eea67ada784..373c92e6a06b 100644
--- a/sd/source/filter/xml/sdtransform.cxx
+++ b/sd/source/filter/xml/sdtransform.cxx
@@ -182,7 +182,7 @@ void SdTransformOOo2xDocument::transformShape( SdrObject& rObj )
SdrObjGroup* pGroupShape = dynamic_cast< SdrObjGroup* >( &rObj );
if( pGroupShape )
{
- SdrObjList* pObjList = pGroupShape->GetSubList();
+ SdrObjList* pObjList = pGroupShape->getChildrenOfSdrObject();
if( pObjList )
transformShapes( *pObjList );
return;
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 99250dbc027e..7a675834b49a 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -854,7 +854,7 @@ sal_Bool SdXMLFilter::Export()
if( !mxModel.is() )
{
DBG_ERROR("Got NO Model in XMLExport");
- return sal_False;
+ return false;
}
sal_Bool bLocked = mxModel->hasControllersLocked();
@@ -868,7 +868,7 @@ sal_Bool SdXMLFilter::Export()
if( !xServiceInfo.is() || !xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GenericDrawingDocument" ) ) ) )
{
DBG_ERROR( "Model is no DrawingDocument in XMLExport" );
- return sal_False;
+ return false;
}
uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() );
@@ -876,7 +876,7 @@ sal_Bool SdXMLFilter::Export()
if( !xServiceFactory.is() )
{
DBG_ERROR( "got no service manager" );
- return sal_False;
+ return false;
}
uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ) );
@@ -884,7 +884,7 @@ sal_Bool SdXMLFilter::Export()
if( !xWriter.is() )
{
DBG_ERROR( "com.sun.star.xml.sax.Writer service missing" );
- return sal_False;
+ return false;
}
uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY );
@@ -971,7 +971,7 @@ sal_Bool SdXMLFilter::Export()
pObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *mrDocShell.GetDoc()->GetPersist(), EMBEDDEDOBJECTHELPER_MODE_WRITE, sal_False );
xObjectResolver = pObjectHelper;
- pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE, sal_False );
+ pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE, false );
xGrfResolver = pGraphicHelper;
}
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index 245d639dbaa7..404cd0c723fd 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -167,11 +167,11 @@ void AccessibleDocumentViewBase::Init (void)
IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener,
VclSimpleEvent*, pEvent)
{
- OSL_ASSERT(pEvent!=NULL && pEvent->ISA(VclWindowEvent));
- if (pEvent!=NULL && pEvent->ISA(VclWindowEvent))
+ VclWindowEvent* pWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+ OSL_ASSERT(pWindowEvent);
+
+ if(pWindowEvent)
{
- VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent);
- // DBG_ASSERT( pVclEvent->GetWindow(), "Window???" );
switch (pWindowEvent->GetId())
{
case VCLEVENT_OBJECT_DYING:
diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
index 470826adbf35..2eee9155a864 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
@@ -144,10 +144,10 @@ namespace accessibility
Point AccessibleOutlineEditSource::LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const
{
- if( IsValid() && mrView.GetModel() )
+ if( IsValid() )
{
Point aPoint( OutputDevice::LogicToLogic( rPoint, rMapMode,
- MapMode(mrView.GetModel()->GetScaleUnit()) ) );
+ MapMode(mrView.getSdrModelFromSdrView().GetExchangeObjectUnit()) ) );
MapMode aMapMode(mrWindow.GetMapMode());
aMapMode.SetOrigin(Point());
return mrWindow.LogicToPixel( aPoint, aMapMode );
@@ -158,13 +158,13 @@ namespace accessibility
Point AccessibleOutlineEditSource::PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const
{
- if( IsValid() && mrView.GetModel() )
+ if( IsValid() )
{
MapMode aMapMode(mrWindow.GetMapMode());
aMapMode.SetOrigin(Point());
Point aPoint( mrWindow.PixelToLogic( rPoint, aMapMode ) );
return OutputDevice::LogicToLogic( aPoint,
- MapMode(mrView.GetModel()->GetScaleUnit()),
+ MapMode(mrView.getSdrModelFromSdrView().GetExchangeObjectUnit()),
rMapMode );
}
@@ -186,9 +186,9 @@ namespace accessibility
}
else
{
- const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >( &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >( &rHint );
- if( pSdrHint && ( pSdrHint->GetKind() == HINT_MODELCLEARED ) )
+ if( pSdrHint && ( pSdrHint->GetSdrHintKind() == HINT_MODELCLEARED ) )
{
// model is dying under us, going defunc
bDispose = true;
diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
index 3850a04c4fa3..1308c78f6f2f 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
@@ -85,19 +85,17 @@ AccessibleOutlineView::AccessibleOutlineView (
// depths of the core. Necessary for making the edit engine accessible.
if( pViewShell && pSdWindow )
{
- ::sd::View* pView = pViewShell->GetView();
+ ::sd::OutlineView* pSdOutlineView = dynamic_cast< ::sd::OutlineView* >(pViewShell->GetView());
- if (pView && pView->ISA(::sd::OutlineView))
+ if (pSdOutlineView)
{
- OutlinerView* pOutlineView = static_cast< ::sd::OutlineView*>(
- pView)->GetViewByWindow( pSdWindow );
- SdrOutliner* pOutliner =
- static_cast< ::sd::OutlineView*>(pView)->GetOutliner();
+ OutlinerView* pOutlineView = pSdOutlineView->GetViewByWindow( pSdWindow );
+ SdrOutliner* pOutliner = pSdOutlineView->GetOutliner();
if( pOutlineView && pOutliner )
{
maTextHelper.SetEditSource( ::std::auto_ptr< SvxEditSource >( new AccessibleOutlineEditSource(
- *pOutliner, *pView, *pOutlineView, *pSdWindow ) ) );
+ *pOutliner, *pViewShell->GetView(), *pOutlineView, *pSdWindow ) ) );
}
}
}
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index 6fb1b353c00b..9b3cf9af5fad 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -444,12 +444,11 @@ Reference<XAccessible> SAL_CALL
Reference<XAccessible> xAccessible;
const vos::OGuard aSolarGuard (Application::GetSolarMutex());
- const Point aTestPoint (aPoint.X, aPoint.Y);
::sd::slidesorter::model::SharedPageDescriptor pHitDescriptor (
- mrSlideSorter.GetController().GetPageAt(aTestPoint));
+ mrSlideSorter.GetController().GetPageAt(Point(aPoint.X, aPoint.Y)));
if (pHitDescriptor.get() != NULL)
xAccessible = mpImpl->GetAccessibleChild(
- (pHitDescriptor->GetPage()->GetPageNum()-1)/2);
+ (pHitDescriptor->GetPage()->GetPageNumber()-1)/2);
return xAccessible;
}
@@ -917,7 +916,7 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAcces
maPageObjects[nIndex] = new AccessibleSlideSorterObject(
&mrAccessibleSlideSorter,
mrSlideSorter,
- (pDescriptor->GetPage()->GetPageNum()-1)/2);
+ (pDescriptor->GetPage()->GetPageNumber()-1)/2);
mrAccessibleSlideSorter.FireAccessibleEvent(
AccessibleEventId::CHILD,
@@ -991,10 +990,12 @@ void AccessibleSlideSorterView::Implementation::Notify (
SfxBroadcaster&,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+ const sd::ViewShellHint* pSdViewShellHint = dynamic_cast< const sd::ViewShellHint* >(&rHint);
+
+ if(pSdrHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrHint->GetSdrHintKind())
{
case HINT_PAGEORDERCHG:
RequestUpdateChildren();
@@ -1003,10 +1004,9 @@ void AccessibleSlideSorterView::Implementation::Notify (
break;
}
}
- else if (rHint.ISA(sd::ViewShellHint))
+ else if(pSdViewShellHint)
{
- sd::ViewShellHint& rViewShellHint (*PTR_CAST(sd::ViewShellHint, &rHint));
- switch (rViewShellHint.GetHintId())
+ switch (pSdViewShellHint->GetHintId())
{
case sd::ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START:
mbModelChangeLocked = true;
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index c2d46ee514f3..3848251a5d01 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -108,7 +108,7 @@ private:
CategoryListBox::CategoryListBox( Window* pParent, const ResId& rResId )
: ListBox( pParent, rResId )
{
- EnableUserDraw( sal_True );
+ EnableUserDraw( true );
SetDoubleClickHdl( LINK( this, CategoryListBox, implDoubleClickHdl ) );
}
@@ -153,7 +153,7 @@ void CategoryListBox::UserDraw( const UserDrawEvent& rUDEvt )
}
else
{
- DrawEntry( rUDEvt, sal_True, sal_True );
+ DrawEntry( rUDEvt, true, true );
}
}
@@ -341,7 +341,7 @@ IMPL_LINK( CustomAnimationCreateTabPage, implDoubleClickHdl, Control*, pControl
if( pControl == mpLBEffects )
{
if( mpLBEffects->GetSelectEntryCount() )
- mpParent->EndDialog( sal_True );
+ mpParent->EndDialog( true );
}
return 0;
}
@@ -488,7 +488,7 @@ bool CustomAnimationCreateTabPage::getIsPreview() const
void CustomAnimationCreateTabPage::setIsPreview( bool bIsPreview )
{
- mpCBXPReview->Check( bIsPreview ? sal_True : sal_False );
+ mpCBXPReview->Check( bIsPreview ? true : false );
}
bool CustomAnimationCreateTabPage::select( const OUString& rsPresetId )
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index ac9bd015a43e..fe825b1263fb 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -176,7 +176,7 @@ void PresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId )
}
else
{
- mpControl->Enable( sal_False );
+ mpControl->Enable( false );
}
}
}
@@ -240,7 +240,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, Window* pParent, con
if ( !pColorTable )
{
pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = sal_True;
+ bKillTable = true;
}
sal_Int32 nColor = 0;
@@ -331,7 +331,7 @@ FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, Window* pParent, const
if(!pFontList)
{
- pFontList = new FontList( Application::GetDefaultDevice(), NULL, sal_False );
+ pFontList = new FontList( Application::GetDefaultDevice(), NULL, false );
bMustDelete = true;
}
@@ -1260,10 +1260,10 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con
if ( !pColorTable )
{
pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() );
- bKillTable = sal_True;
+ bKillTable = true;
}
- mpCLBDimColor->SetUpdateMode( sal_False );
+ mpCLBDimColor->SetUpdateMode( false );
for ( long i = 0; i < pColorTable->Count(); i++ )
{
@@ -1271,7 +1271,7 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con
mpCLBDimColor->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
- mpCLBDimColor->SetUpdateMode( sal_True );
+ mpCLBDimColor->SetUpdateMode( true );
if ( bKillTable )
delete pColorTable;
@@ -1458,11 +1458,10 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( Window* pParent, con
}
else
{
- mpFTTextAnim->Enable( sal_False );
- mpLBTextAnim->Enable( sal_False );
- mpMFTextDelay->Enable( sal_False );
- mpFTTextDelay->Enable( sal_False );
-
+ mpFTTextAnim->Enable( false );
+ mpLBTextAnim->Enable( false );
+ mpMFTextDelay->Enable( false );
+ mpFTTextDelay->Enable( false );
}
if( pSet->getPropertyState( nHandleSoundURL ) != STLPropertyState_AMBIGUOUS )
@@ -1830,8 +1829,8 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
String aStr; aStr += sal_Unicode('%');
aStrWarning.SearchAndReplace( aStr , aFile );
WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (sal_True);
- bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True;
+ aWarningBox.SetModalInputMode (true);
+ bQuitLoop = aWarningBox.Execute()==RET_RETRY ? false : true;
bValidSoundFile=false;
}
@@ -2019,7 +2018,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(Window* pParent,
sal_Int16 nFill = 0;
if( pSet->getPropertyValue( nHandleRewind ) >>= nFill )
{
- mpCBXRewind->Check( (nFill == AnimationFill::REMOVE) ? sal_True : sal_False );
+ mpCBXRewind->Check( (nFill == AnimationFill::REMOVE) ? true : false );
}
else
{
@@ -2078,8 +2077,8 @@ IMPL_LINK( CustomAnimationDurationTabPage, implControlHdl, Control*, pControl )
{
if( pControl == mpLBTrigger.get() )
{
- mpRBClickSequence->Check( sal_False );
- mpRBInteractive->Check( sal_True );
+ mpRBClickSequence->Check( false );
+ mpRBInteractive->Check( true );
}
return 0;
@@ -2319,7 +2318,7 @@ CustomAnimationTextAnimTabPage::CustomAnimationTextAnimTabPage(Window* pParent,
}
else
{
- maCBXAnimateForm.Enable( sal_False );
+ maCBXAnimateForm.Enable( false );
}
maCBXReverse.SetState( STATE_DONTKNOW );
@@ -2413,12 +2412,12 @@ void CustomAnimationTextAnimTabPage::updateControlStates()
if( !mbHasVisibleShapes && nPos > 0 )
{
- maCBXAnimateForm.Check(sal_False);
- maCBXAnimateForm.Enable(sal_False);
+ maCBXAnimateForm.Check(false);
+ maCBXAnimateForm.Enable(false);
}
else
{
- maCBXAnimateForm.Enable(sal_True);
+ maCBXAnimateForm.Enable(true);
}
}
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 407d7d220d03..7b1d65bfcde3 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -363,7 +363,7 @@ class CustomAnimationTriggerEntryItem : public SvLBoxString
public:
CustomAnimationTriggerEntryItem( SvLBoxEntry*,sal_uInt16 nFlags, OUString aDescription, CustomAnimationList* pParent );
virtual ~CustomAnimationTriggerEntryItem();
- virtual sal_uInt16 IsA();
+
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
void Paint( const Point&, SvLBox& rDev, sal_uInt16 nFlags,SvLBoxEntry* );
SvLBoxItem* Create() const;
@@ -389,13 +389,6 @@ CustomAnimationTriggerEntryItem::~CustomAnimationTriggerEntryItem()
// --------------------------------------------------------------------
-sal_uInt16 CustomAnimationTriggerEntryItem::IsA()
-{
- return (sal_uInt16)-1;
-}
-
-// --------------------------------------------------------------------
-
void CustomAnimationTriggerEntryItem::InitViewData( SvLBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
{
if( !pViewData )
@@ -815,7 +808,7 @@ void CustomAnimationList::onSelectionChanged( Any aSelection )
{
try
{
- SelectAll(sal_False);
+ SelectAll(false);
if( aSelection.hasValue() )
{
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index e23512708704..933d0419cc35 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -725,15 +725,15 @@ void CustomAnimationPane::updateControls()
if( !mxView.is() )
{
- mpPBAddEffect->Enable( sal_False );
- mpPBChangeEffect->Enable( sal_False );
- mpPBRemoveEffect->Enable( sal_False );
- mpFLEffect->Enable( sal_False );
- mpFTStart->Enable( sal_False );
- mpLBStart->Enable( sal_False );
- mpPBPropertyMore->Enable( sal_False );
- mpLBProperty->Enable( sal_False );
- mpFTProperty->Enable( sal_False );
+ mpPBAddEffect->Enable( false );
+ mpPBChangeEffect->Enable( false );
+ mpPBRemoveEffect->Enable( false );
+ mpFLEffect->Enable( false );
+ mpFTStart->Enable( false );
+ mpLBStart->Enable( false );
+ mpPBPropertyMore->Enable( false );
+ mpLBProperty->Enable( false );
+ mpFTProperty->Enable( false );
mpCustomAnimationList->clear();
return;
}
@@ -814,9 +814,9 @@ void CustomAnimationPane::updateControls()
else
{
mpLBProperty->setSubControl( 0 );
- mpFTProperty->Enable( sal_False );
- mpLBProperty->Enable( sal_False );
- mpPBPropertyMore->Enable( sal_False );
+ mpFTProperty->Enable( false );
+ mpLBProperty->Enable( false );
+ mpPBPropertyMore->Enable( false );
}
//
@@ -858,19 +858,19 @@ void CustomAnimationPane::updateControls()
mpCBSpeed->SelectEntryPos( nPos );
}
- mpPBPropertyMore->Enable( sal_True );
+ mpPBPropertyMore->Enable( true );
- mpFTChangeOrder->Enable( sal_True );
+ mpFTChangeOrder->Enable( true );
}
else
{
mpLBProperty->setSubControl( 0 );
- mpFTProperty->Enable( sal_False );
- mpLBProperty->Enable( sal_False );
- mpPBPropertyMore->Enable( sal_False );
- mpFTSpeed->Enable(sal_False);
- mpCBSpeed->Enable(sal_False);
- mpFTChangeOrder->Enable( sal_False );
+ mpFTProperty->Enable( false );
+ mpLBProperty->Enable( false );
+ mpPBPropertyMore->Enable( false );
+ mpFTSpeed->Enable(false);
+ mpCBSpeed->Enable(false);
+ mpFTChangeOrder->Enable( false );
mpLBStart->SetNoSelection();
mpCBSpeed->SetNoSelection();
mpFLEffect->SetText( maStrModify );
@@ -1026,7 +1026,9 @@ void CustomAnimationPane::updateMotionPathTags()
}
if( bChanges && pView )
- pView->updateHandles();
+ {
+ pView->SetMarkHandles();
+ }
}
void CustomAnimationPane::onSelectionChanged()
@@ -1999,7 +2001,7 @@ void CustomAnimationPane::onChange( bool bCreate )
{
if( bCreate )
{
- mpCustomAnimationList->SelectAll( sal_False );
+ mpCustomAnimationList->SelectAll( false );
// gather shapes from the selection
std::vector< Any >::iterator aIter( aTargets.begin() );
@@ -2501,7 +2503,7 @@ void CustomAnimationPane::markShapesFromSelectedEffects()
Reference< XShape > xShape( pEffect->getTargetShape() );
SdrObject* pObj = GetSdrObjectFromXShape( xShape );
if( pObj )
- pView->MarkObj(pObj, pView->GetSdrPageView(), sal_False, sal_False);
+ pView->MarkObj(*pObj, false );
}
}
}
diff --git a/sd/source/ui/animations/DialogListBox.cxx b/sd/source/ui/animations/DialogListBox.cxx
index a2ddf96b4ebd..a3cb1346918a 100644
--- a/sd/source/ui/animations/DialogListBox.cxx
+++ b/sd/source/ui/animations/DialogListBox.cxx
@@ -275,7 +275,7 @@ void DialogListBox::StateChanged( StateChangedType nType )
}
else if ( ( nType == STATE_CHANGE_UPDATEMODE ) || ( nType == STATE_CHANGE_DATA ) )
{
- sal_Bool bUpdate = IsUpdateMode();
+ bool bUpdate = IsUpdateMode();
mpChild->SetUpdateMode( bUpdate );
if ( bUpdate && IsReallyVisible() )
ImplCheckScrollBars();
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index a2c67b47865d..4c1567afa1c0 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -129,10 +129,9 @@ struct TransitionEffect
mfDuration = 2.0;
mnTime = 0;
mePresChange = PRESCHANGE_MANUAL;
- mbSoundOn = sal_False;
- mbLoopSound = sal_False;
- mbStopSound = sal_False;
-
+ mbSoundOn = false;
+ mbLoopSound = false;
+ mbStopSound = false;
mbEffectAmbiguous = false;
mbDurationAmbiguous = false;
mbTimeAmbiguous = false;
@@ -180,12 +179,12 @@ struct TransitionEffect
{
if( mbStopSound )
{
- rOutPage.SetStopSound( sal_True );
- rOutPage.SetSound( sal_False );
+ rOutPage.SetStopSound( true );
+ rOutPage.SetSound( false );
}
else
{
- rOutPage.SetStopSound( sal_False );
+ rOutPage.SetStopSound( false );
rOutPage.SetSound( mbSoundOn );
rOutPage.SetSoundFile( maSound );
}
@@ -221,7 +220,7 @@ struct TransitionEffect
double mfDuration;
sal_uLong mnTime;
PresChange mePresChange;
- sal_Bool mbSoundOn;
+ bool mbSoundOn;
String maSound;
bool mbLoopSound;
bool mbStopSound;
@@ -856,8 +855,8 @@ void SlideTransitionPane::updateControls()
if( aEffect.mbPresChangeAmbiguous )
{
- maRB_ADVANCE_ON_MOUSE.Check( sal_False );
- maRB_ADVANCE_AUTO.Check( sal_False );
+ maRB_ADVANCE_ON_MOUSE.Check( false );
+ maRB_ADVANCE_AUTO.Check( false );
}
else
{
@@ -960,7 +959,7 @@ void SlideTransitionPane::openSoundFileDialog()
String aStr( sal_Unicode( '%' ));
aStrWarning.SearchAndReplace( aStr , aFile );
WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (sal_True);
+ aWarningBox.SetModalInputMode (true);
bQuitLoop = (aWarningBox.Execute() != RET_RETRY);
bValidSoundFile = false;
@@ -1186,7 +1185,7 @@ IMPL_LINK( SlideTransitionPane, ApplyToAllButtonClicked, void *, EMPTYARG )
sal_uInt16 nPageCount = mpDrawDoc->GetSdPageCount( PK_STANDARD );
pPages->reserve( nPageCount );
- for( sal_uInt16 i=0; i<nPageCount; ++i )
+ for( sal_uInt32 i=0; i<nPageCount; ++i )
{
SdPage * pPage = mpDrawDoc->GetSdPage( i, PK_STANDARD );
if( pPage )
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 1fc0f667c784..d0fef527fe40 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -63,9 +63,9 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
-using ::sdr::PolyPolygonEditor;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
@@ -88,7 +88,7 @@ protected:
virtual void createSdrDragEntries();
public:
- PathDragMove(SdrDragView& rNewView,
+ PathDragMove(SdrView& rNewView,
const rtl::Reference <MotionPathTag >& xTag,
const basegfx::B2DPolyPolygon& rPathPolyPolygon)
: SdrDragMove(rNewView),
@@ -96,7 +96,7 @@ public:
mxTag( xTag )
{}
- PathDragMove(SdrDragView& rNewView,
+ PathDragMove(SdrView& rNewView,
const rtl::Reference <MotionPathTag >& xTag)
: SdrDragMove(rNewView),
maPathPolyPolygon(),
@@ -127,11 +127,11 @@ bool PathDragMove::BeginSdrDrag()
SdrPathObj* pPathObj = mxTag->getPathObj();
if( pPathObj )
{
- DragStat().SetActionRect(pPathObj->GetCurrentBoundRect());
+ DragStat().SetActionRange(pPathObj->getObjectRange(&DragStat().GetSdrViewFromSdrDragStat()));
}
}
Show();
- return sal_True;
+ return true;
}
bool PathDragMove::EndSdrDrag(bool /*bCopy*/)
@@ -139,7 +139,7 @@ bool PathDragMove::EndSdrDrag(bool /*bCopy*/)
Hide();
if( mxTag.is() )
mxTag->MovePath( DragStat().GetDX(), DragStat().GetDY() );
- return sal_True;
+ return true;
}
// --------------------------------------------------------------------
@@ -152,7 +152,7 @@ protected:
virtual void createSdrDragEntries();
public:
- PathDragResize(SdrDragView& rNewView,
+ PathDragResize(SdrView& rNewView,
const rtl::Reference <MotionPathTag >& xTag,
const basegfx::B2DPolyPolygon& rPathPolyPolygon)
: SdrDragResize(rNewView),
@@ -160,7 +160,7 @@ public:
mxTag( xTag )
{}
- PathDragResize(SdrDragView& rNewView,
+ PathDragResize(SdrView& rNewView,
const rtl::Reference <MotionPathTag >& xTag)
: SdrDragResize(rNewView),
maPathPolyPolygon(),
@@ -190,16 +190,15 @@ bool PathDragResize::EndSdrDrag(bool /*bCopy*/)
SdrPathObj* pPathObj = mxTag->getPathObj();
if( pPathObj )
{
- const Point aRef( DragStat().Ref1() );
- basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-aRef.X(), -aRef.Y()));
+ basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-DragStat().GetRef1()));
aTrans.scale(double(aXFact), double(aYFact));
- aTrans.translate(aRef.X(), aRef.Y());
- basegfx::B2DPolyPolygon aDragPoly(pPathObj->GetPathPoly());
+ aTrans.translate(DragStat().GetRef1());
+ basegfx::B2DPolyPolygon aDragPoly(pPathObj->getB2DPolyPolygonInObjectCoordinates());
aDragPoly.transform(aTrans);
- pPathObj->SetPathPoly( aDragPoly );
+ pPathObj->setB2DPolyPolygonInObjectCoordinates( aDragPoly );
}
}
- return sal_True;
+ return true;
}
// --------------------------------------------------------------------
@@ -213,13 +212,13 @@ protected:
virtual void createSdrDragEntries();
public:
- PathDragObjOwn(SdrDragView& rNewView,
+ PathDragObjOwn(SdrView& rNewView,
const basegfx::B2DPolyPolygon& rPathPolyPolygon)
: SdrDragObjOwn(rNewView),
maPathPolyPolygon(rPathPolyPolygon)
{}
- PathDragObjOwn(SdrDragView& rNewView)
+ PathDragObjOwn(SdrView& rNewView)
: SdrDragObjOwn(rNewView),
maPathPolyPolygon()
{}
@@ -259,23 +258,29 @@ bool PathDragObjOwn::EndSdrDrag(bool /*bCopy*/)
class SdPathHdl : public SmartHdl
{
public:
- SdPathHdl( const SmartTagReference& xTag, SdrPathObj* mpPathObj );
- virtual ~SdPathHdl();
- virtual void CreateB2dIAObject();
- virtual sal_Bool IsFocusHdl() const;
+ SdPathHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const SmartTagReference& xTag);
+ virtual bool IsFocusHdl() const;
virtual Pointer GetSdrDragPointer() const;
virtual bool isMarkable() const;
+protected:
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+ virtual ~SdPathHdl();
+
private:
- SdrPathObj* mpPathObj;
rtl::Reference< MotionPathTag > mxTag;
};
// --------------------------------------------------------------------
-SdPathHdl::SdPathHdl( const SmartTagReference& xTag, SdrPathObj* pPathObj )
-: SmartHdl( xTag, pPathObj->GetCurrentBoundRect().TopLeft() )
-, mpPathObj( pPathObj )
+SdPathHdl::SdPathHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const SmartTagReference& xTag)
+: SmartHdl( rHdlList, &rSdrHdlObject, xTag, HDL_SMARTTAG, rSdrHdlObject.getSdrObjectTranslate() )
, mxTag( dynamic_cast< MotionPathTag* >( xTag.get() ) )
{
}
@@ -288,48 +293,24 @@ SdPathHdl::~SdPathHdl()
// --------------------------------------------------------------------
-void SdPathHdl::CreateB2dIAObject()
-{
- // first throw away old one
- GetRidOfIAObject();
-
- if(pHdlList)
+void SdPathHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
{
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
+ if(GetObj())
{
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager() && mpPathObj)
- {
- const sdr::contact::ViewContact& rVC = mpPathObj->GetViewContact();
+ const sdr::contact::ViewContact& rVC = GetObj()->GetViewContact();
const drawinglayer::primitive2d::Primitive2DSequence aSequence = rVC.getViewIndependentPrimitive2DSequence();
sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence);
- rPageWindow.GetOverlayManager()->add(*pNew);
+ rOverlayManager.add(*pNew);
maOverlayGroup.append(*pNew);
}
}
- }
- }
- }
- }
-}
// --------------------------------------------------------------------
-sal_Bool SdPathHdl::IsFocusHdl() const
+bool SdPathHdl::IsFocusHdl() const
{
- return sal_False;
+ return false;
}
// --------------------------------------------------------------------
@@ -348,7 +329,7 @@ Pointer SdPathHdl::GetSdrDragPointer() const
{
if( mxTag->isSelected() )
{
- if( !mxTag->getView().IsFrameDragSingles() && mxTag->getView().IsInsObjPointMode() )
+ if( !mxTag->getView().IsFrameHandles() && mxTag->getView().IsInsObjPointMode() )
eStyle = POINTER_CROSS;
else
eStyle = POINTER_MOVE;
@@ -369,18 +350,19 @@ MotionPathTag::MotionPathTag( CustomAnimationPane& rPane, ::sd::View& rView, con
, mrPane( rPane )
, mpEffect( pEffect )
, mxOrigin( pEffect->getTargetShape() )
+, maSelectedPoints()
, msLastPath( pEffect->getPath() )
, mbInUpdatePath( false )
{
- mpPathObj = mpEffect->createSdrPathObjFromPath();
- mxPolyPoly = mpPathObj->GetPathPoly();
+ mpPathObj = mpEffect->createSdrPathObjFromPath(rView.getSdrModelFromSdrView());
+ mxPolyPoly = mpPathObj->getB2DPolyPolygonInObjectCoordinates();
maOriginPos = mxOrigin->getPosition();
- SdrPage* pPage = mrView.GetSdrPageView()->GetPage();
+ SdrPage* pPage = mrView.GetSdrPageView() ? &mrView.GetSdrPageView()->getSdrPageFromSdrPageView() : 0;
if( pPage )
{
- mpPathObj->SetPage( pPage );
- mpPathObj->SetObjList( pPage );
+ // mpPathObj->SetPage( pPage );
+ // mpPathObj->SetObjList( pPage );
}
XDash aDash( XDASH_RECT, 1, 80, 1, 80, 80);
@@ -397,15 +379,12 @@ MotionPathTag::MotionPathTag( CustomAnimationPane& rPane, ::sd::View& rView, con
aStartArrow.setClosed(true);
mpPathObj->SetMergedItem(XLineStartItem(aEmpty,::basegfx::B2DPolyPolygon(aStartArrow)));
mpPathObj->SetMergedItem(XLineStartWidthItem(400));
- mpPathObj->SetMergedItem(XLineStartCenterItem(sal_True));
+ mpPathObj->SetMergedItem(XLineStartCenterItem(true));
updatePathAttributes();
mpPathObj->SetMergedItem(XLineTransparenceItem(50));
-
- mpMark = new SdrMark( mpPathObj, mrView.GetSdrPageView() );
-
- mpPathObj->AddListener( *this );
+ StartListening(*mpPathObj);
Reference< XChangesNotifier > xNotifier( mpEffect->getNode(), UNO_QUERY );
if( xNotifier.is() )
@@ -445,7 +424,7 @@ void MotionPathTag::updatePathAttributes()
aEndArrow.setClosed(true);
mpPathObj->SetMergedItem(XLineEndItem(aEmpty,::basegfx::B2DPolyPolygon(aEndArrow)));
mpPathObj->SetMergedItem(XLineEndWidthItem(400));
- mpPathObj->SetMergedItem(XLineEndCenterItem(sal_True));
+ mpPathObj->SetMergedItem(XLineEndCenterItem(true));
}
else
{
@@ -457,12 +436,12 @@ void MotionPathTag::updatePathAttributes()
void MotionPathTag::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( mpPathObj && !mbInUpdatePath && dynamic_cast< const SdrHint* >( &rHint ) && (mpEffect.get() != 0) )
+ if( mpPathObj && !mbInUpdatePath && dynamic_cast< const SdrBaseHint* >( &rHint ) && (mpEffect.get() != 0) )
{
- if( mxPolyPoly != mpPathObj->GetPathPoly() )
+ if( mxPolyPoly != mpPathObj->getB2DPolyPolygonInObjectCoordinates() )
{
mbInUpdatePath = true;
- mxPolyPoly = mpPathObj->GetPathPoly();
+ mxPolyPoly = mpPathObj->getB2DPolyPolygonInObjectCoordinates();
rtl::Reference< MotionPathTag > xTag( this );
mrPane.updatePathFromMotionPathTag( xTag );
msLastPath = mpEffect->getPath();
@@ -478,8 +457,8 @@ void MotionPathTag::MovePath( int nDX, int nDY )
{
if( mpPathObj )
{
- mpPathObj->Move( Size( nDX, nDY ) );
- mrView.updateHandles();
+ sdr::legacy::MoveSdrObject(*mpPathObj, Size( nDX, nDY ) );
+ mrView.SetMarkHandles();
}
}
@@ -508,38 +487,39 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
else if( rMEvt.IsLeft() )
{
OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow();
- Point aMDPos( pOut->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aMDPos(pOut->GetInverseViewTransformation() * aPixelPos);
- if( !mrView.IsFrameDragSingles() && mrView.IsInsObjPointMode() && (rHdl.GetObjHdlNum() == SMART_TAG_HDL_NUM) )
+ if( !mrView.IsFrameHandles() && mrView.IsInsObjPointMode() && (rHdl.GetObjHdlNum() == SMART_TAG_HDL_NUM) )
{
// insert a point in edit mode
const bool bNewObj = rMEvt.IsMod1();
mrView.BrkAction();
- Point aPt(aMDPos); // - pMarkedPV->GetOffset());
+ basegfx::B2DPoint aPt(aMDPos);
if(bNewObj)
- aPt = mrView.GetSnapPos(aPt,mrView.GetSdrPageView());
+ aPt = mrView.GetSnapPos(aPt);
- sal_Bool bClosed0(mpPathObj->IsClosedObj());
+ bool bClosed0(mpPathObj->IsClosedObj());
- sal_uInt32 nInsPointNum = mpPathObj->NbcInsPointOld(aPt, bNewObj, sal_True);
+ sal_uInt32 nInsPointNum = mpPathObj->InsPointOld(Point(basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY())), bNewObj);
if(bClosed0 != mpPathObj->IsClosedObj())
{
// Obj was closed implicit
// object changed
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*mpPathObj);
mpPathObj->SetChanged();
- mpPathObj->BroadcastObjectChange();
}
if(0xffffffff != nInsPointNum)
{
- mrView.UnmarkAllPoints();
- mrView.updateHandles();
+ mrView.MarkPoints(0, true); // unmarkall
+ mrView.SetMarkHandles();
- bool bRet = mrView.BegDragObj(aMDPos, pOut, mrView.GetHdl(nInsPointNum+1), 0, new PathDragObjOwn( mrView ) );
+ bool bRet = mrView.BegDragObj(aMDPos, mrView.GetHdlByIndex(nInsPointNum+1), 0.0, new PathDragObjOwn( mrView ) );
if (bRet)
{
@@ -556,14 +536,14 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
{
if (!rMEvt.IsShift())
{
- mrView.UnmarkAllPoints();
+ mrView.MarkPoints(0, true); // unmarkall
pHdl = dynamic_cast< SmartHdl* >( mrView.PickHandle(aMDPos) );
}
else
{
if (mrView.IsPointMarked(*pHdl) )
{
- mrView.UnmarkPoint(*pHdl);
+ mrView.MarkPoint(*pHdl, true); // unmark
pHdl = NULL;
}
else
@@ -580,19 +560,17 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
if( pHdl && !rMEvt.IsRight() )
{
mrView.BrkAction();
- const sal_uInt16 nDrgLog = (sal_uInt16)pOut->PixelToLogic(Size(DRGPIX,0)).Width();
-
rtl::Reference< MotionPathTag > xTag( this );
SdrDragMethod* pDragMethod;
// #i95646# add DragPoly as geometry to each local SdrDragMethod to be able
// to create the needed local SdrDragEntry for it in createSdrDragEntries()
- const basegfx::B2DPolyPolygon aDragPoly(mpPathObj->GetPathPoly());
+ const basegfx::B2DPolyPolygon aDragPoly(mpPathObj->getB2DPolyPolygonInObjectCoordinates());
if( (pHdl->GetKind() == HDL_MOVE) || (pHdl->GetKind() == HDL_SMARTTAG) )
{
pDragMethod = new PathDragMove( mrView, xTag, aDragPoly );
- pHdl->SetPos( aMDPos );
+ pHdl->setPosition( aMDPos );
}
else if( pHdl->GetKind() == HDL_POLY )
{
@@ -603,7 +581,8 @@ bool MotionPathTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
pDragMethod = new PathDragResize( mrView, xTag, aDragPoly );
}
- mrView.BegDragObj(aMDPos, NULL, pHdl, nDrgLog, pDragMethod );
+ const double fTolerance(basegfx::B2DVector(pOut->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
+ mrView.BegDragObj(aMDPos, pHdl, fTolerance, pDragMethod );
}
return true;
}
@@ -675,9 +654,11 @@ bool MotionPathTag::OnTabHandles( const KeyEvent& rKEvt )
Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
if( pWindow )
{
- Point aHdlPosition(pHdl->GetPos());
- Rectangle aVisRect(aHdlPosition - Point(100, 100), Size(200, 200));
- mrView.MakeVisible(aVisRect, *pWindow);
+ const basegfx::B2DRange aRange(
+ pHdl->getPosition() - basegfx::B2DPoint(100.0, 100.0),
+ pHdl->getPosition() + basegfx::B2DPoint(100.0, 100.0));
+
+ mrView.MakeVisibleAtView(aRange, *pWindow);
}
}
@@ -702,14 +683,14 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
{
if(rKEvt.GetKeyCode().IsShift())
{
- mrView.UnmarkPoint(*pHdl);
+ mrView.MarkPoint(*pHdl, true); // unmark
}
}
else
{
if(!rKEvt.GetKeyCode().IsShift())
{
- mrView.UnmarkAllPoints();
+ mrView.MarkPoints(0, true); // unmarkall
}
mrView.MarkPoint(*pHdl);
}
@@ -721,7 +702,7 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++)
{
- SdrHdl* pAct = rHdlList.GetHdl(a);
+ SdrHdl* pAct = rHdlList.GetHdlByIndex(a);
if(pAct && pAct->GetKind() == HDL_POLY && pAct->GetPolyNum() == nPol && pAct->GetPointNum() == nPnt)
pNewOne = pAct;
@@ -772,8 +753,8 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
if(pHdl)
{
// now move the Handle (nX, nY)
- Point aStartPoint(pHdl->GetPos());
- Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
+ const basegfx::B2DPoint aStartPoint(pHdl->getPosition());
+ const basegfx::B2DPoint aEndPoint(aStartPoint + basegfx::B2DPoint(nX, nY));
// start dragging
rtl::Reference< MotionPathTag > xTag( this );
@@ -790,18 +771,19 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
{
pDragMethod = new PathDragResize( mrView, xTag );
}
- mrView.BegDragObj(aStartPoint, 0, pHdl, 0, pDragMethod);
+
+ mrView.BegDragObj(aStartPoint, pHdl, 0.0, pDragMethod);
if(mrView.IsDragObj())
{
- FASTBOOL bWasNoSnap = mrView.GetDragStat().IsNoSnap();
- sal_Bool bWasSnapEnabled = mrView.IsSnapEnabled();
+ const bool bWasNoSnap(mrView.GetDragStat().IsNoSnap());
+ const bool bWasSnapEnabled(mrView.IsSnapEnabled());
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)mrView.GetDragStat()).SetNoSnap(sal_True);
+ ((SdrDragStat&)mrView.GetDragStat()).SetNoSnap(true);
if(bWasSnapEnabled)
- mrView.SetSnapEnabled(sal_False);
+ mrView.SetSnapEnabled(false);
mrView.MovAction(aEndPoint);
mrView.EndDragObj();
@@ -825,11 +807,11 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
// --------------------------------------------------------------------
-sal_uLong MotionPathTag::GetMarkablePointCount() const
+sal_uInt32 MotionPathTag::GetMarkablePointCount() const
{
if( mpPathObj && isSelected() )
{
- return mpPathObj->GetPointCount();
+ return mpPathObj->GetObjectPointCount();
}
else
{
@@ -839,68 +821,62 @@ sal_uLong MotionPathTag::GetMarkablePointCount() const
// --------------------------------------------------------------------
-sal_uLong MotionPathTag::GetMarkedPointCount() const
+sal_uInt32 MotionPathTag::GetMarkedPointCount() const
{
- if( mpMark )
- {
- const SdrUShortCont* pPts=mpMark->GetMarkedPoints();
- return pPts ? pPts->GetCount() : 0;
- }
- else
- {
- return 0;
- }
+ return maSelectedPoints.size();
}
// --------------------------------------------------------------------
-sal_Bool MotionPathTag::MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark )
+bool MotionPathTag::MarkPoint(SdrHdl& rHdl, bool bUnmark )
{
- sal_Bool bRet=sal_False;
+ bool bRet(false);
+
if( mpPathObj && mrView.IsPointMarkable( rHdl ) && (rHdl.GetKind() != HDL_SMARTTAG) )
{
- SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( &rHdl );
+ const SmartHdl* pSmartHdl = dynamic_cast< const SmartHdl* >( &rHdl );
+
if( pSmartHdl && pSmartHdl->getTag().get() == this )
{
- SdrUShortCont* pPts=mpMark->ForceMarkedPoints();
- pPts->ForceSort();
- if (mrView.MarkPointHelper(&rHdl,mpMark,bUnmark))
+ if (mrView.MarkPointHelper(&rHdl, bUnmark))
{
- pPts->ForceSort();
- mrView.MarkListHasChanged();
- bRet=sal_True;
+// mrView.MarkListHasChanged();
+ bRet = true;
}
}
}
+
return bRet;
}
// --------------------------------------------------------------------
-sal_Bool MotionPathTag::MarkPoints(const Rectangle* pRect, sal_Bool bUnmark )
+bool MotionPathTag::MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark)
{
- sal_Bool bChgd=sal_False;
+ bool bChgd(false);
if( mpPathObj && isSelected() )
{
- sal_Int32 nHdlNum = mrView.GetHdlList().GetHdlCount() - 1;
- while( nHdlNum > 0 )
+ sal_uInt32 nHdlNum(mrView.GetHdlList().GetHdlCount());
+
+ while(nHdlNum)
{
- SmartHdl* pHdl = dynamic_cast< SmartHdl* >( mrView.GetHdl( sal::static_int_cast< sal_uLong >( nHdlNum-- ) ) );
+ nHdlNum--;
+ SmartHdl* pHdl = dynamic_cast< SmartHdl* >(mrView.GetHdlByIndex(nHdlNum));
if( pHdl && (pHdl->getTag().get() == this) && mrView.IsPointMarkable(*pHdl) && pHdl->IsSelected()==bUnmark)
{
- Point aPos(pHdl->GetPos());
- if( pRect==NULL || pRect->IsInside(aPos))
+ const basegfx::B2DPoint aPosPoint(pHdl->getPosition());
+
+ if( !pRange || pRange->isInside(aPosPoint))
{
- if( mrView.MarkPointHelper(pHdl,mpMark,bUnmark) )
- bChgd=sal_True;
+ if( mrView.MarkPointHelper(pHdl, bUnmark) )
+ {
+ bChgd = true;
+ }
}
}
}
-
- if(bChgd)
- mrView.MarkListHasChanged();
}
return bChgd;
@@ -910,7 +886,7 @@ sal_Bool MotionPathTag::MarkPoints(const Rectangle* pRect, sal_Bool bUnmark )
bool MotionPathTag::getContext( SdrViewContext& rContext )
{
- if( mpPathObj && isSelected() && !mrView.IsFrameDragSingles() )
+ if( mpPathObj && isSelected() && !mrView.IsFrameHandles() )
{
rContext = SDRCONTEXT_POINTEDIT;
return true;
@@ -929,13 +905,13 @@ void MotionPathTag::CheckPossibilities()
{
if( isSelected() )
{
- mrView.SetMoveAllowed( true );
+ mrView.SetMoveAllowedOnSelection( true );
mrView.SetMoveProtected( false );
mrView.SetResizeFreeAllowed( true );
mrView.SetResizePropAllowed( true );
mrView.SetResizeProtected( false );
- if( !mrView.IsFrameDragSingles() )
+ if( !mrView.IsFrameHandles() && maSelectedPoints.size() )
{
bool b1stSmooth(true);
bool b1stSegm(true);
@@ -944,7 +920,8 @@ void MotionPathTag::CheckPossibilities()
bool bSegmFuz(false);
basegfx::B2VectorContinuity eSmooth = basegfx::CONTINUITY_NONE;
- mrView.CheckPolyPossibilitiesHelper( mpMark, b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth );
+ mrView.CheckPolyPossibilitiesHelper( *mpPathObj, maSelectedPoints,
+ b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth );
}
}
}
@@ -962,45 +939,27 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList )
const basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(
aPos.X - maOriginPos.X, aPos.Y - maOriginPos.Y));
mxPolyPoly.transform( aTransform );
- mpPathObj->SetPathPoly( mxPolyPoly );
+ mpPathObj->setB2DPolyPolygonInObjectCoordinates( mxPolyPoly );
maOriginPos = aPos;
}
SmartTagReference xThis( this );
- SdPathHdl* pHdl = new SdPathHdl( xThis, mpPathObj );
+ SdPathHdl* pHdl = new SdPathHdl( rHandlerList, *mpPathObj, xThis );
pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
- pHdl->SetPageView( mrView.GetSdrPageView() );
-
-
- pHdl->SetObj(mpPathObj);
- rHandlerList.AddHdl( pHdl );
if( isSelected() )
{
- mrView.GetSdrPageView()->SetHasMarkedObj(sal_True);
-
- if( !mrView.IsFrameDragSingles() )
+ if( !mrView.IsFrameHandles() )
{
- SdrHdlList aTemp( rHandlerList.GetView() );
+ SdrHdlList aTemp( rHandlerList.GetViewFromSdrHdlList() );
mpPathObj->AddToHdlList( aTemp );
- const SdrUShortCont* pMrkPnts=mpMark->GetMarkedPoints();
-
sal_uInt32 nHandle;
for( nHandle = 0; nHandle < aTemp.GetHdlCount(); ++nHandle )
{
- SdrHdl* pTempHdl = aTemp.GetHdl( nHandle );
-
- SmartHdl* pSmartHdl = new SmartHdl( xThis, mpPathObj, pTempHdl->GetPos(), pTempHdl->GetKind() );
- pSmartHdl->SetObjHdlNum( nHandle );
- pSmartHdl->SetPolyNum( pTempHdl->GetPolyNum() );
- pSmartHdl->SetPointNum( pTempHdl->GetPointNum() );
- pSmartHdl->SetPlusHdl( pTempHdl->IsPlusHdl() );
- pSmartHdl->SetSourceHdlNum( pTempHdl->GetSourceHdlNum() );
- pSmartHdl->SetPageView( mrView.GetSdrPageView() );
-
- rHandlerList.AddHdl( pSmartHdl );
+ SdrHdl* pTempHdl = aTemp.GetHdlByIndex( nHandle );
+ SmartHdl* pSmartHdl = new SmartHdl(rHandlerList, mpPathObj, xThis, nHandle, *pTempHdl);
- const bool bSelected= pMrkPnts && pMrkPnts->Exist(sal::static_int_cast< sal_uInt16 >(nHandle));
+ const bool bSelected(maSelectedPoints.count(nHandle));
pSmartHdl->SetSelected(bSelected);
if( mrView.IsPlusHandlesAlwaysVisible() || bSelected )
@@ -1008,52 +967,40 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList )
sal_uInt32 nPlusAnz=mpPathObj->GetPlusHdlCount(*pSmartHdl);
for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusAnz; nPlusNum++)
{
- SdrHdl* pPlusHdl = mpPathObj->GetPlusHdl(*pSmartHdl,nPlusNum);
- if (pPlusHdl!=NULL)
- {
- pPlusHdl->SetObj(mpPathObj);
- pPlusHdl->SetPageView(mrView.GetSdrPageView());
- pPlusHdl->SetPlusHdl(sal_True);
- rHandlerList.AddHdl(pPlusHdl);
- }
+ mpPathObj->GetPlusHdl(rHandlerList, *mpPathObj, *pSmartHdl, nPlusNum);
}
}
}
}
else
{
- Rectangle aRect(mpPathObj->GetCurrentBoundRect());
+ const basegfx::B2DRange aRange(mpPathObj->getObjectRange(&mrView));
- if(!aRect.IsEmpty())
+ if(!aRange.isEmpty())
{
- sal_uLong nCount = rHandlerList.GetHdlCount();
+ sal_uInt32 nCount(rHandlerList.GetHdlCount());
+ const bool bWdt0(basegfx::fTools::equalZero(aRange.getWidth()));
+ const bool bHgt0(basegfx::fTools::equalZero(aRange.getHeight()));
- sal_Bool bWdt0=aRect.Left()==aRect.Right();
- sal_Bool bHgt0=aRect.Top()==aRect.Bottom();
if (bWdt0 && bHgt0)
{
- rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft(),HDL_UPLFT));
+ new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_UPLFT, aRange.getMinimum());
}
else if (bWdt0 || bHgt0)
{
- rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft() ,HDL_UPLFT));
- rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomRight(),HDL_LWRGT));
+ new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_UPLFT, aRange.getMinimum());
+ new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_LWRGT, aRange.getMaximum());
}
else
{
- if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopLeft() ,HDL_UPLFT));
- if ( !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopCenter() ,HDL_UPPER));
- if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.TopRight() ,HDL_UPRGT));
- if (!bWdt0 ) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.LeftCenter() ,HDL_LEFT ));
- if (!bWdt0 ) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.RightCenter() ,HDL_RIGHT));
- if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomLeft() ,HDL_LWLFT));
- if ( !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomCenter(),HDL_LOWER));
- if (!bWdt0 && !bHgt0) rHandlerList.AddHdl(new SmartHdl( xThis, mpPathObj, aRect.BottomRight() ,HDL_LWRGT));
- }
-
- while( nCount < rHandlerList.GetHdlCount() )
- {
- rHandlerList.GetHdl(nCount++)->SetPageView( mrView.GetSdrPageView() );
+ if (!bWdt0 && !bHgt0) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_UPLFT, aRange.getMinimum());
+ if ( !bHgt0) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_UPPER, basegfx::B2DPoint(aRange.getCenterX(), aRange.getMinY()));
+ if (!bWdt0 && !bHgt0) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_UPRGT, basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
+ if (!bWdt0 ) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_LEFT, basegfx::B2DPoint(aRange.getMinX(), aRange.getCenterY()));
+ if (!bWdt0 ) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_RIGHT, basegfx::B2DPoint(aRange.getMaxX(), aRange.getCenterY()));
+ if (!bWdt0 && !bHgt0) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_LWLFT, basegfx::B2DPoint(aRange.getMinX(), aRange.getMaxY()));
+ if ( !bHgt0) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_LOWER, basegfx::B2DPoint(aRange.getCenterX(), aRange.getMaxY()));
+ if (!bWdt0 && !bHgt0) new SmartHdl(rHandlerList, mpPathObj, xThis, HDL_LWRGT, aRange.getMaximum());
}
}
}
@@ -1076,15 +1023,11 @@ void MotionPathTag::disposing()
{
SdrPathObj* pPathObj = mpPathObj;
mpPathObj = 0;
- mrView.updateHandles();
- delete pPathObj;
+ mrView.SetMarkHandles();
+ deleteSdrObjectSafeAndClearPointer(pPathObj);
}
- if( mpMark )
- {
- delete mpMark;
- mpMark = 0;
- }
+ maSelectedPoints.clear();
SmartTag::disposing();
}
@@ -1094,15 +1037,7 @@ void MotionPathTag::disposing()
void MotionPathTag::deselect()
{
SmartTag::deselect();
-
- if( mpMark )
- {
- SdrUShortCont* pPts = mpMark->GetMarkedPoints();
-
- if( pPts )
- pPts->Clear();
- }
-
+ maSelectedPoints.clear();
selectionChanged();
}
@@ -1111,7 +1046,7 @@ void MotionPathTag::selectionChanged()
if( mrView.GetViewShell() && mrView.GetViewShell()->GetViewFrame() )
{
SfxBindings& rBindings = mrView.GetViewShell()->GetViewFrame()->GetBindings();
- rBindings.InvalidateAll(sal_True);
+ rBindings.InvalidateAll(true);
}
}
// --------------------------------------------------------------------
@@ -1124,40 +1059,27 @@ void MotionPathTag::DeleteMarkedPoints()
{
mrView.BrkAction();
- // Description
-// BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_DELETE);
-
- SdrUShortCont* pPts = mpMark->GetMarkedPoints();
-
- if( pPts )
- {
- PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() );
- if( aEditor.DeletePoints( pPts->getContainer() ) )
+ if(maSelectedPoints.size())
{
- if( aEditor.GetPolyPolygon().count() )
+ basegfx::B2DPolyPolygon aPolyPolygon(mpPathObj->getB2DPolyPolygonInObjectCoordinates());
+
+ if( sdr::PolyPolygonEditor::DeletePoints(aPolyPolygon , maSelectedPoints ) )
{
-// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath ));
- mpPathObj->SetPathPoly( aEditor.GetPolyPolygon() );
- }
- else
+ if( aPolyPolygon.count() )
{
-// AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pPath ) );
-// pM->GetPageView()->GetObjList()->RemoveObject(pObj->GetOrdNum());
+ mpPathObj->setB2DPolyPolygonInObjectCoordinates( aPolyPolygon );
}
- mrView.UnmarkAllPoints();
- mrView.MarkListHasChanged();
- mrView.updateHandles();
+ mrView.MarkPoints(0, true); // unmarkall
+ mrView.SetMarkHandles();
}
}
-
-// EndUndo();
}
}
-sal_Bool MotionPathTag::IsDeleteMarkedPointsPossible() const
+bool MotionPathTag::IsDeleteMarkedPointsPossible() const
{
- return mpPathObj && isSelected() && (GetMarkedPointCount() != 0);
+ return mpPathObj && isSelected() && GetMarkedPointCount();
}
void MotionPathTag::RipUpAtMarkedPoints()
@@ -1171,12 +1093,12 @@ bool MotionPathTag::IsRipUpAtMarkedPointsPossible() const
return false;
}
-sal_Bool MotionPathTag::IsSetMarkedSegmentsKindPossible() const
+bool MotionPathTag::IsSetMarkedSegmentsKindPossible() const
{
if( mpPathObj )
return mrView.IsSetMarkedSegmentsKindPossible();
else
- return sal_False;
+ return false;
}
SdrPathSegmentKind MotionPathTag::GetMarkedSegmentsKind() const
@@ -1191,27 +1113,25 @@ void MotionPathTag::SetMarkedSegmentsKind(SdrPathSegmentKind eKind)
{
if(mpPathObj && isSelected() && (GetMarkedPointCount() != 0))
{
- SdrUShortCont* pPts = mpMark->GetMarkedPoints();
- if(pPts)
+ if(maSelectedPoints.size())
{
- PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() );
- if(aEditor.SetSegmentsKind( eKind, pPts->getContainer()) )
+ basegfx::B2DPolyPolygon aPolyPolygon(mpPathObj->getB2DPolyPolygonInObjectCoordinates());
+
+ if(sdr::PolyPolygonEditor::SetSegmentsKind( aPolyPolygon, eKind, maSelectedPoints ) )
{
-// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
- mpPathObj->SetPathPoly(aEditor.GetPolyPolygon());
- mrView.MarkListHasChanged();
- mrView.updateHandles();
+ mpPathObj->setB2DPolyPolygonInObjectCoordinates(aPolyPolygon);
+ mrView.SetMarkHandles();
}
}
}
}
-sal_Bool MotionPathTag::IsSetMarkedPointsSmoothPossible() const
+bool MotionPathTag::IsSetMarkedPointsSmoothPossible() const
{
if( mpPathObj )
return mrView.IsSetMarkedPointsSmoothPossible();
else
- return sal_False;
+ return false;
}
SdrPathSmoothKind MotionPathTag::GetMarkedPointsSmooth() const
@@ -1243,24 +1163,22 @@ void MotionPathTag::SetMarkedPointsSmooth(SdrPathSmoothKind eKind)
return;
}
- if(mpPathObj && mpMark && isSelected() && (GetMarkedPointCount() != 0))
+ if(mpPathObj && isSelected() && (GetMarkedPointCount() != 0))
{
- SdrUShortCont* pPts = mpMark->GetMarkedPoints();
- if(pPts)
+ if(maSelectedPoints.size())
{
- PolyPolygonEditor aEditor( mpPathObj->GetPathPoly(), mpPathObj->IsClosed() );
- if(aEditor.SetPointsSmooth( eFlags, pPts->getContainer() ) )
+ basegfx::B2DPolyPolygon aPolyPolygon(mpPathObj->getB2DPolyPolygonInObjectCoordinates());
+
+ if(sdr::PolyPolygonEditor::SetPointsSmooth( aPolyPolygon, eFlags, maSelectedPoints ) )
{
-// AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
- mpPathObj->SetPathPoly(aEditor.GetPolyPolygon());
- mrView.MarkListHasChanged();
- mrView.updateHandles();
+ mpPathObj->setB2DPolyPolygonInObjectCoordinates(aPolyPolygon);
+ mrView.SetMarkHandles();
}
}
}
}
-void MotionPathTag::CloseMarkedObjects(sal_Bool /*bToggle*/, sal_Bool /*bOpen*/ )
+void MotionPathTag::CloseMarkedObjects(bool /*bToggle*/, bool /*bOpen*/ )
{
// not supported for motion path
}
@@ -1287,7 +1205,7 @@ void SAL_CALL MotionPathTag::changesOccurred( const ChangesEvent& /*Event*/ ) th
mpEffect->updateSdrPathObjFromPath( *mpPathObj );
mbInUpdatePath = false;
updatePathAttributes();
- mrView.updateHandles();
+ mrView.SetMarkHandles();
}
}
diff --git a/sd/source/ui/animations/motionpathtag.hxx b/sd/source/ui/animations/motionpathtag.hxx
index 526ffab1da64..df70f49b211d 100644
--- a/sd/source/ui/animations/motionpathtag.hxx
+++ b/sd/source/ui/animations/motionpathtag.hxx
@@ -60,11 +60,11 @@ public:
virtual bool KeyInput( const KeyEvent& rKEvt );
// callbacks from sdr view
- virtual sal_uLong GetMarkablePointCount() const;
- virtual sal_uLong GetMarkedPointCount() const;
- virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
+ virtual sal_uInt32 GetMarkablePointCount() const;
+ virtual sal_uInt32 GetMarkedPointCount() const;
+ virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark = false);
virtual void CheckPossibilities();
- virtual sal_Bool MarkPoints(const Rectangle* pRect, sal_Bool bUnmark);
+ virtual bool MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark);
const CustomAnimationEffectPtr& getEffect() const { return mpEffect; }
@@ -72,20 +72,20 @@ public:
// IPolyPolygonEditorController
virtual void DeleteMarkedPoints();
- virtual sal_Bool IsDeleteMarkedPointsPossible() const;
+ virtual bool IsDeleteMarkedPointsPossible() const;
virtual void RipUpAtMarkedPoints();
virtual bool IsRipUpAtMarkedPointsPossible() const;
- virtual sal_Bool IsSetMarkedSegmentsKindPossible() const;
+ virtual bool IsSetMarkedSegmentsKindPossible() const;
virtual SdrPathSegmentKind GetMarkedSegmentsKind() const;
virtual void SetMarkedSegmentsKind(SdrPathSegmentKind eKind);
- virtual sal_Bool IsSetMarkedPointsSmoothPossible() const;
+ virtual bool IsSetMarkedPointsSmoothPossible() const;
virtual SdrPathSmoothKind GetMarkedPointsSmooth() const;
virtual void SetMarkedPointsSmooth(SdrPathSmoothKind eKind);
- virtual void CloseMarkedObjects(sal_Bool bToggle, sal_Bool bOpen );
+ virtual void CloseMarkedObjects(bool bToggle, bool bOpen );
virtual bool IsOpenCloseMarkedObjectsPossible() const;
virtual SdrObjClosedKind GetMarkedObjectsClosedState() const;
@@ -118,7 +118,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxOrigin;
SdrPathObj* mpPathObj;
::com::sun::star::awt::Point maOriginPos;
- SdrMark* mpMark;
+ sdr::selection::Indices maSelectedPoints;
rtl::OUString msLastPath;
bool mbInUpdatePath;
};
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index c17bac8a91d2..692e2f783069 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -191,7 +191,7 @@ AnnotationManagerImpl::AnnotationManagerImpl( ViewShellBase& rViewShellBase )
{
SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType());
if( pOptions )
- mbShowAnnotations = pOptions->IsShowComments() == sal_True;
+ mbShowAnnotations = pOptions->IsShowComments();
}
// --------------------------------------------------------------------
@@ -333,7 +333,7 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq)
if( pArgs )
{
const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == pArgs->GetItemState( SID_DELETEALLBYAUTHOR_POSTIT, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( SID_DELETEALLBYAUTHOR_POSTIT, true, &pPoolItem ) )
{
OUString sAuthor( (( const SfxStringItem* ) pPoolItem )->GetValue() );
DeleteAnnotationsByAuthor( sAuthor );
@@ -349,7 +349,7 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq)
if( pArgs )
{
const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == pArgs->GetItemState( SID_DELETE_POSTIT, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( SID_DELETE_POSTIT, true, &pPoolItem ) )
( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue() >>= xAnnotation;
}
}
@@ -381,7 +381,7 @@ void AnnotationManagerImpl::InsertAnnotation()
AnnotationVector aAnnotations( pPage->getAnnotations() );
if( !aAnnotations.empty() )
{
- const int page_width = pPage->GetSize().Width();
+ const int page_width = pPage->GetPageScale().getX();
const int width = 1000;
const int height = 800;
Rectangle aTagRect;
@@ -453,7 +453,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
if( pArgs )
{
const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == pArgs->GetItemState( rReq.GetSlot(), sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( rReq.GetSlot(), true, &pPoolItem ) )
( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue() >>= xAnnotation;
}
@@ -464,7 +464,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
std::auto_ptr< ::Outliner > pOutliner( new ::Outliner(GetAnnotationPool(),OUTLINERMODE_TEXTOBJECT) );
mpDoc->SetCalcFieldValueHdl( pOutliner.get() );
- pOutliner->SetUpdateMode( sal_True );
+ pOutliner->SetUpdateMode( true );
String aStr(SdResId(STR_ANNOTATION_REPLY));
OUString sAuthor( xAnnotation->getAuthor() );
@@ -716,8 +716,8 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
::boost::shared_ptr<DrawViewShell> pDrawViewShell(::boost::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
if (pDrawViewShell.get() != NULL)
{
- pDrawViewShell->ChangeEditMode(pPage->IsMasterPage() ? EM_MASTERPAGE : EM_PAGE, sal_False);
- pDrawViewShell->SwitchPage((pPage->GetPageNum() - 1) >> 1);
+ pDrawViewShell->ChangeEditMode(pPage->IsMasterPage() ? EM_MASTERPAGE : EM_PAGE, false);
+ pDrawViewShell->SwitchPage((pPage->GetPageNumber() - 1) >> 1);
SfxDispatcher* pDispatcher = getDispatcher( mrBase );
if( pDispatcher )
@@ -772,7 +772,7 @@ void AnnotationManagerImpl::onTagDeselected( AnnotationTag& rTag )
// --------------------------------------------------------------------
-void AnnotationManagerImpl::SelectAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, bool bEdit /* = sal_False */ )
+void AnnotationManagerImpl::SelectAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, bool bEdit /* = false */ )
{
mxSelectedAnnotation = xAnnotation;
@@ -856,7 +856,7 @@ IMPL_LINK(AnnotationManagerImpl,UpdateTagsHdl, void *, EMPTYARG)
CreateTags();
if( mrBase.GetDrawView() )
- static_cast< ::sd::View* >( mrBase.GetDrawView() )->updateHandles();
+ static_cast< ::sd::View* >( mrBase.GetDrawView() )->SetMarkHandles();
invalidateSlots();
@@ -1016,7 +1016,7 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
aStr.SearchAndReplaceAscii("%1", aReplace);
pMenu->SetItemText( SID_DELETEALLBYAUTHOR_POSTIT, aStr );
pMenu->EnableItem( SID_REPLYTO_POSTIT, (sAuthor != sCurrentAuthor) && !bReadOnly );
- pMenu->EnableItem( SID_DELETE_POSTIT, (xAnnotation.is() && !bReadOnly) ? sal_True : sal_False );
+ pMenu->EnableItem( SID_DELETE_POSTIT, (xAnnotation.is() && !bReadOnly) ? true : false );
pMenu->EnableItem( SID_DELETEALLBYAUTHOR_POSTIT, !bReadOnly );
pMenu->EnableItem( SID_DELETEALL_POSTIT, !bReadOnly );
@@ -1024,11 +1024,11 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
{
if( pAnnotationWindow->IsProtected() || bReadOnly )
{
- pMenu->EnableItem( SID_ATTR_CHAR_WEIGHT, sal_False );
- pMenu->EnableItem( SID_ATTR_CHAR_POSTURE, sal_False );
- pMenu->EnableItem( SID_ATTR_CHAR_UNDERLINE, sal_False );
- pMenu->EnableItem( SID_ATTR_CHAR_STRIKEOUT, sal_False );
- pMenu->EnableItem( SID_PASTE, sal_False );
+ pMenu->EnableItem( SID_ATTR_CHAR_WEIGHT, false );
+ pMenu->EnableItem( SID_ATTR_CHAR_POSTURE, false );
+ pMenu->EnableItem( SID_ATTR_CHAR_UNDERLINE, false );
+ pMenu->EnableItem( SID_ATTR_CHAR_STRIKEOUT, false );
+ pMenu->EnableItem( SID_PASTE, false );
}
else
{
@@ -1174,7 +1174,7 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
if( pPage == 0 )
return bForeward ? GetFirstPage() : GetLastPage();
- sal_uInt16 nPageNum = (pPage->GetPageNum() - 1) >> 1;
+ sal_uInt32 nPageNum = (pPage->GetPageNumber() - 1) >> 1;
// first all non master pages
if( !pPage->IsMasterPage() )
diff --git a/sd/source/ui/annotations/annotationmanagerimpl.hxx b/sd/source/ui/annotations/annotationmanagerimpl.hxx
index a3741f4468b4..34308749c20b 100644
--- a/sd/source/ui/annotations/annotationmanagerimpl.hxx
+++ b/sd/source/ui/annotations/annotationmanagerimpl.hxx
@@ -75,7 +75,7 @@ public:
void SelectNextAnnotation(bool bForeward);
- void SelectAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, bool bEdit = sal_False );
+ void SelectAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, bool bEdit = false );
void GetSelectedAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation );
void InsertAnnotation();
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index d387adbe1a41..fea4fc236833 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -107,18 +107,18 @@ static OUString getInitials( const OUString& rName )
class AnnotationDragMove : public SdrDragMove
{
public:
- AnnotationDragMove(SdrDragView& rNewView, const rtl::Reference <AnnotationTag >& xTag);
+ AnnotationDragMove(SdrView& rNewView, const rtl::Reference <AnnotationTag >& xTag);
virtual bool BeginSdrDrag();
virtual bool EndSdrDrag(bool bCopy);
- virtual void MoveSdrDrag(const Point& rNoSnapPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rNoSnapPnt);
virtual void CancelSdrDrag();
private:
rtl::Reference <AnnotationTag > mxTag;
- Point maOrigin;
+ basegfx::B2DPoint maOrigin;
};
-AnnotationDragMove::AnnotationDragMove(SdrDragView& rNewView, const rtl::Reference <AnnotationTag >& xTag)
+AnnotationDragMove::AnnotationDragMove(SdrView& rNewView, const rtl::Reference <AnnotationTag >& xTag)
: SdrDragMove(rNewView)
, mxTag( xTag )
{
@@ -126,28 +126,28 @@ AnnotationDragMove::AnnotationDragMove(SdrDragView& rNewView, const rtl::Referen
bool AnnotationDragMove::BeginSdrDrag()
{
- DragStat().Ref1()=GetDragHdl()->GetPos();
+ DragStat().SetRef1(GetDragHdl()->getPosition());
DragStat().SetShown(!DragStat().IsShown());
- maOrigin = GetDragHdl()->GetPos();
- DragStat().SetActionRect(Rectangle(maOrigin,maOrigin));
+ maOrigin = GetDragHdl()->getPosition();
+ DragStat().SetActionRange(basegfx::B2DRange(maOrigin));
return true;
}
-void AnnotationDragMove::MoveSdrDrag(const Point& rNoSnapPnt)
+void AnnotationDragMove::MoveSdrDrag(const basegfx::B2DPoint& rNoSnapPnt)
{
- Point aPnt(rNoSnapPnt);
-
if (DragStat().CheckMinMoved(rNoSnapPnt))
{
- if (aPnt!=DragStat().GetNow())
+ basegfx::B2DPoint aPnt(rNoSnapPnt);
+
+ if(!aPnt.equal(DragStat().GetNow()))
{
Hide();
DragStat().NextMove(aPnt);
- GetDragHdl()->SetPos( maOrigin + Point( DragStat().GetDX(), DragStat().GetDY() ) );
+ GetDragHdl()->setPosition(maOrigin + (DragStat().GetNow() - DragStat().GetPrev()));
Show();
- DragStat().SetActionRect(Rectangle(aPnt,aPnt));
+ DragStat().SetActionRange(basegfx::B2DRange(aPnt));
}
}
}
@@ -157,7 +157,7 @@ bool AnnotationDragMove::EndSdrDrag(bool /*bCopy*/)
Hide();
if( mxTag.is() )
mxTag->Move( DragStat().GetDX(), DragStat().GetDY() );
- return sal_True;
+ return true;
}
void AnnotationDragMove::CancelSdrDrag()
@@ -170,13 +170,18 @@ void AnnotationDragMove::CancelSdrDrag()
class AnnotationHdl : public SmartHdl
{
public:
- AnnotationHdl( const SmartTagReference& xTag, const Reference< XAnnotation >& xAnnotation, const Point& rPnt );
- virtual ~AnnotationHdl();
- virtual void CreateB2dIAObject();
- virtual sal_Bool IsFocusHdl() const;
+ AnnotationHdl(
+ SdrHdlList& rHdlList,
+ const SmartTagReference& xTag,
+ const Reference< XAnnotation >& xAnnotation,
+ const basegfx::B2DPoint& rPnt );
+ virtual bool IsFocusHdl() const;
virtual Pointer GetSdrDragPointer() const;
virtual bool isMarkable() const;
+protected:
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+ virtual ~AnnotationHdl();
private:
Reference< XAnnotation > mxAnnotation;
@@ -185,8 +190,12 @@ private:
// --------------------------------------------------------------------
-AnnotationHdl::AnnotationHdl( const SmartTagReference& xTag, const Reference< XAnnotation >& xAnnotation, const Point& rPnt )
-: SmartHdl( xTag, rPnt )
+AnnotationHdl::AnnotationHdl(
+ SdrHdlList& rHdlList,
+ const SmartTagReference& xTag,
+ const Reference< XAnnotation >& xAnnotation,
+ const basegfx::B2DPoint& rPnt )
+: SmartHdl( rHdlList, 0, xTag, HDL_SMARTTAG, rPnt )
, mxAnnotation( xAnnotation )
, mxTag( dynamic_cast< AnnotationTag* >( xTag.get() ) )
{
@@ -200,78 +209,42 @@ AnnotationHdl::~AnnotationHdl()
// --------------------------------------------------------------------
-void AnnotationHdl::CreateB2dIAObject()
+void AnnotationHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
{
- // first throw away old one
- GetRidOfIAObject();
-
if( mxAnnotation.is() )
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
-
- const Point aTagPos( GetPos() );
- basegfx::B2DPoint aPosition( aTagPos.X(), aTagPos.Y() );
-
- const bool bFocused = IsFocusHdl() && pHdlList && (pHdlList->GetFocusHdl() == this);
+ const bool bFocused = IsFocusHdl() && (mrHdlList.GetFocusHdl() == this);
BitmapEx aBitmapEx( mxTag->CreateAnnotationBitmap(mxTag->isSelected()) );
BitmapEx aBitmapEx2;
if( bFocused )
aBitmapEx2 = mxTag->CreateAnnotationBitmap(!mxTag->isSelected() );
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
+ ::sdr::overlay::OverlayObject* pOverlayObject = 0;
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b = 0; b < pPageView->PageWindowCount(); b++)
- {
- // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow();
- if(rPaintWindow.OutputToWindow() && rPageWindow.GetOverlayManager() )
- {
- ::sdr::overlay::OverlayObject* pOverlayObject = 0;
-
- // animate focused handles
- if(bFocused)
- {
- const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
+ // animate focused handles
+ if(bFocused)
+ {
+ const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
- pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(aPosition, aBitmapEx, aBitmapEx2, nBlinkTime, 0, 0, 0, 0 );
-/*
- (sal_uInt16)(aBitmapEx.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBitmapEx.GetSizePixel().Height() - 1) >> 1,
- (sal_uInt16)(aBitmapEx2.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBitmapEx2.GetSizePixel().Height() - 1) >> 1);
-*/
- }
- else
- {
- pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 );
- }
-
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
- maOverlayGroup.append(*pOverlayObject);
- }
- }
- }
- }
+ pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(getPosition(), aBitmapEx, aBitmapEx2, nBlinkTime, 0, 0, 0, 0 );
+ }
+ else
+ {
+ pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( getPosition(), aBitmapEx, 0, 0 );
}
+
+ rOverlayManager.add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
}
}
// --------------------------------------------------------------------
-sal_Bool AnnotationHdl::IsFocusHdl() const
+bool AnnotationHdl::IsFocusHdl() const
{
- return sal_True;
+ return true;
}
// --------------------------------------------------------------------
@@ -350,7 +323,7 @@ bool AnnotationTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& /*rHdl*/
Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
if( pWindow )
{
- maMouseDownPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
+ maMouseDownPos = pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
if( mpListenWindow )
mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
@@ -464,7 +437,7 @@ void AnnotationTag::Move( int nDX, int nDY )
if( mrManager.GetDoc()->IsUndoEnabled() )
mrManager.GetDoc()->EndUndo();
- mrView.updateHandles();
+ mrView.SetMarkHandles();
}
}
@@ -513,32 +486,30 @@ void AnnotationTag::CheckPossibilities()
// --------------------------------------------------------------------
-sal_uLong AnnotationTag::GetMarkablePointCount() const
+sal_uInt32 AnnotationTag::GetMarkablePointCount() const
{
return 0;
}
// --------------------------------------------------------------------
-sal_uLong AnnotationTag::GetMarkedPointCount() const
+sal_uInt32 AnnotationTag::GetMarkedPointCount() const
{
return 0;
}
// --------------------------------------------------------------------
-sal_Bool AnnotationTag::MarkPoint(SdrHdl& /*rHdl*/, sal_Bool /*bUnmark*/ )
+bool AnnotationTag::MarkPoint(SdrHdl& /*rHdl*/, bool /*bUnmark*/ )
{
- sal_Bool bRet=sal_False;
- return bRet;
+ return false;
}
// --------------------------------------------------------------------
-sal_Bool AnnotationTag::MarkPoints(const Rectangle* /*pRect*/, sal_Bool /*bUnmark*/ )
+bool AnnotationTag::MarkPoints(const basegfx::B2DRange* /*pRange*/, bool /*bUnmark*/ )
{
- sal_Bool bChgd=sal_False;
- return bChgd;
+ return false;
}
// --------------------------------------------------------------------
@@ -555,16 +526,11 @@ void AnnotationTag::addCustomHandles( SdrHdlList& rHandlerList )
if( mxAnnotation.is() )
{
SmartTagReference xThis( this );
- Point aPoint;
- AnnotationHdl* pHdl = new AnnotationHdl( xThis, mxAnnotation, aPoint );
- pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
- pHdl->SetPageView( mrView.GetSdrPageView() );
-
- RealPoint2D aPosition( mxAnnotation->getPosition() );
- Point aBasePos( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) );
- pHdl->SetPos( aBasePos );
+ const RealPoint2D aPosition( mxAnnotation->getPosition() );
+ const basegfx::B2DPoint aB2DPosition(aPosition.X * 100.0, aPosition.Y * 100.0);
+ AnnotationHdl* pHdl = new AnnotationHdl(rHandlerList, xThis, mxAnnotation, aB2DPosition);
- rHandlerList.AddHdl( pHdl );
+ pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
}
}
@@ -599,11 +565,13 @@ void AnnotationTag::select()
Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
if( pWindow )
{
- RealPoint2D aPosition( mxAnnotation->getPosition() );
- Point aPos( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) );
+ const RealPoint2D aPosition( mxAnnotation->getPosition() );
+ const basegfx::B2DPoint aB2DPosition(aPosition.X * 100.0, aPosition.Y * 100.0);
+ const basegfx::B2DRange aRange(
+ aB2DPosition,
+ aB2DPosition + (pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(maSize.getWidth(), maSize.getHeight())));
- Rectangle aVisRect( aPos, pWindow->PixelToLogic(maSize) );
- mrView.MakeVisible(aVisRect, *pWindow);
+ mrView.MakeVisibleAtView(aRange, *pWindow);
}
}
@@ -634,7 +602,7 @@ BitmapEx AnnotationTag::CreateAnnotationBitmap( bool bSelected )
const int BORDER_Y = 4; // pixels
maSize = Size( aVDev.GetTextWidth( sAuthor ) + 2*BORDER_X, aVDev.GetTextHeight() + 2*BORDER_Y );
- aVDev.SetOutputSizePixel( maSize, sal_False );
+ aVDev.SetOutputSizePixel( maSize, false );
Color aBorderColor( maColor );
@@ -756,12 +724,11 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent*, pEvent)
if( pHdl )
{
mrView.BrkAction();
- const sal_uInt16 nDrgLog = (sal_uInt16)pWindow->PixelToLogic(Size(DRGPIX,0)).Width();
-
rtl::Reference< AnnotationTag > xTag( this );
SdrDragMethod* pDragMethod = new AnnotationDragMove( mrView, xTag );
- mrView.BegDragObj(maMouseDownPos, NULL, pHdl, nDrgLog, pDragMethod );
+ const double fTolerance(basegfx::B2DVector(pWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
+ mrView.BegDragObj(maMouseDownPos, pHdl, fTolerance, pDragMethod );
}
}
break;
@@ -772,7 +739,7 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent*, pEvent)
}
}
}
- return sal_True;
+ return true;
}
IMPL_LINK( AnnotationTag, ClosePopupHdl, void *, EMPTYARG )
diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx
index 8b27417b8614..2a3d7c885574 100644
--- a/sd/source/ui/annotations/annotationtag.hxx
+++ b/sd/source/ui/annotations/annotationtag.hxx
@@ -56,11 +56,11 @@ public:
virtual bool Command( const CommandEvent& rCEvt );
// callbacks from sdr view
- virtual sal_uLong GetMarkablePointCount() const;
- virtual sal_uLong GetMarkedPointCount() const;
- virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
+ virtual sal_uInt32 GetMarkablePointCount() const;
+ virtual sal_uInt32 GetMarkedPointCount() const;
+ virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark = false);
virtual void CheckPossibilities();
- virtual sal_Bool MarkPoints(const Rectangle* pRect, sal_Bool bUnmark);
+ virtual bool MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark);
void Move( int nDX, int nDY );
bool OnMove( const KeyEvent& rKEvt );
@@ -94,7 +94,7 @@ private:
Size maSize;
sal_uLong mnClosePopupEvent;
::Window* mpListenWindow;
- Point maMouseDownPos;
+ basegfx::B2DPoint maMouseDownPos;
};
} // end of namespace sd
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index d998ed3e998c..2136ceac25dd 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -334,10 +334,10 @@ void AnnotationWindow::InitControls()
mpOutliner = new ::Outliner(GetAnnotationPool(),OUTLINERMODE_TEXTOBJECT);
Doc()->SetCalcFieldValueHdl( mpOutliner );
- mpOutliner->SetUpdateMode( sal_True );
+ mpOutliner->SetUpdateMode( true );
Rescale();
- OutputDevice* pDev = Doc()->GetRefDevice();
+ OutputDevice* pDev = Doc()->GetReferenceDevice();
if( pDev )
{
mpOutliner->SetRefDevice( pDev );
@@ -377,14 +377,14 @@ void AnnotationWindow::InitControls()
nCntrl &= ~EE_CNTRL_ONLINESPELLING;
*/
mpOutliner->SetControlWord(nCntrl);
-// mpOutliner->SetFlatMode( sal_True );
+// mpOutliner->SetFlatMode( true );
Engine()->SetModifyHdl( Link() );
- Engine()->EnableUndo( sal_False );
+ Engine()->EnableUndo( false );
Engine()->ClearModifyFlag();
Engine()->GetUndoManager().Clear();
- Engine()->EnableUndo( sal_True );
+ Engine()->EnableUndo( true );
Engine()->SetModifyHdl( LINK( this, AnnotationWindow, ModifyHdl ) );
Invalidate();
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 3075a0f44bbd..9c40ca23fcc0 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -132,12 +132,12 @@ void SdOptionsGeneric::Init() const
{
const Any* pValues = aValues.getConstArray();
- pThis->EnableModify( sal_False );
+ pThis->EnableModify( false );
pThis->mbInit = pThis->ReadData( pValues );
- pThis->EnableModify( sal_True );
+ pThis->EnableModify( true );
}
else
- pThis->mbInit = sal_True;
+ pThis->mbInit = true;
}
}
@@ -209,26 +209,26 @@ bool SdOptionsGeneric::isMetricSystem()
|*
\************************************************************************/
-SdOptionsLayout::SdOptionsLayout( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
+SdOptionsLayout::SdOptionsLayout( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
B2U( "Office.Draw/Layout" ) :
B2U( "Office.Impress/Layout" ) ) :
OUString() ),
- bRuler( sal_True ),
- bMoveOutline( sal_True ),
- bDragStripes( sal_False ),
- bHandlesBezier( sal_False ),
- bHelplines( sal_True ),
+ bRuler( true ),
+ bMoveOutline( true ),
+ bDragStripes( false ),
+ bHandlesBezier( false ),
+ bHelplines( true ),
nMetric((sal_uInt16)(isMetricSystem() ? FUNIT_CM : FUNIT_INCH)),
nDefTab( 1250 )
{
- EnableModify( sal_True );
+ EnableModify( true );
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsLayout::operator==( const SdOptionsLayout& rOpt ) const
+bool SdOptionsLayout::operator==( const SdOptionsLayout& rOpt ) const
{
return( IsRulerVisible() == rOpt.IsRulerVisible() &&
IsMoveOutline() == rOpt.IsMoveOutline() &&
@@ -275,7 +275,7 @@ void SdOptionsLayout::GetPropNameArray( const char**& ppNames, sal_uLong& rCount
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsLayout::ReadData( const Any* pValues )
+bool SdOptionsLayout::ReadData( const Any* pValues )
{
if( pValues[0].hasValue() ) SetRulerVisible( *(sal_Bool*) pValues[ 0 ].getValue() );
if( pValues[1].hasValue() ) SetHandlesBezier( *(sal_Bool*) pValues[ 1 ].getValue() );
@@ -285,12 +285,12 @@ sal_Bool SdOptionsLayout::ReadData( const Any* pValues )
if( pValues[5].hasValue() ) SetMetric( (sal_uInt16) *(sal_Int32*) pValues[ 5 ].getValue() );
if( pValues[6].hasValue() ) SetDefTab( (sal_uInt16) *(sal_Int32*) pValues[ 6 ].getValue() );
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsLayout::WriteData( Any* pValues ) const
+bool SdOptionsLayout::WriteData( Any* pValues ) const
{
pValues[ 0 ] <<= IsRulerVisible();
pValues[ 1 ] <<= IsHandlesBezier();
@@ -300,7 +300,7 @@ sal_Bool SdOptionsLayout::WriteData( Any* pValues ) const
pValues[ 5 ] <<= (sal_Int32) GetMetric();
pValues[ 6 ] <<= (sal_Int32) GetDefTab();
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -311,7 +311,7 @@ sal_Bool SdOptionsLayout::WriteData( Any* pValues ) const
SdOptionsLayoutItem::SdOptionsLayoutItem( sal_uInt16 _nWhich )
: SfxPoolItem ( _nWhich )
-, maOptionsLayout ( 0, sal_False )
+, maOptionsLayout ( 0, false )
{
}
@@ -319,7 +319,7 @@ SdOptionsLayoutItem::SdOptionsLayoutItem( sal_uInt16 _nWhich )
SdOptionsLayoutItem::SdOptionsLayoutItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
: SfxPoolItem ( _nWhich )
-, maOptionsLayout ( 0, sal_False )
+, maOptionsLayout ( 0, false )
{
if( pOpts )
{
@@ -384,19 +384,19 @@ void SdOptionsLayoutItem::SetOptions( SdOptions* pOpts ) const
|*
\************************************************************************/
-SdOptionsContents::SdOptionsContents( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
+SdOptionsContents::SdOptionsContents( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
B2U( "Office.Draw/Content" ) :
B2U( "Office.Impress/Content" ) ) :
OUString() )
{
- EnableModify( sal_True );
+ EnableModify( true );
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsContents::operator==(const SdOptionsContents&) const
+bool SdOptionsContents::operator==(const SdOptionsContents&) const
{
return true;
}
@@ -419,14 +419,14 @@ void SdOptionsContents::GetPropNameArray( const char**& ppNames, sal_uLong& rCou
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsContents::ReadData(const Any*)
+bool SdOptionsContents::ReadData(const Any*)
{
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsContents::WriteData( Any* pValues ) const
+bool SdOptionsContents::WriteData( Any* pValues ) const
{
//#i80528# no draft anymore
pValues[ 0 ] <<= (sal_Bool)false;
@@ -434,7 +434,7 @@ sal_Bool SdOptionsContents::WriteData( Any* pValues ) const
pValues[ 2 ] <<= (sal_Bool)false;
pValues[ 3 ] <<= (sal_Bool)false;
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -445,7 +445,7 @@ sal_Bool SdOptionsContents::WriteData( Any* pValues ) const
SdOptionsContentsItem::SdOptionsContentsItem(sal_uInt16 _nWhich, SdOptions*, ::sd::FrameView*)
: SfxPoolItem ( _nWhich )
-, maOptionsContents ( 0, sal_False )
+, maOptionsContents ( 0, false )
{
}
@@ -477,7 +477,7 @@ void SdOptionsContentsItem::SetOptions(SdOptions*) const
|*
\************************************************************************/
-SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
+SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
B2U( "Office.Draw/Misc" ) :
@@ -486,28 +486,27 @@ SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
// #97016#
nDefaultObjectSizeWidth(8000),
nDefaultObjectSizeHeight(5000),
- bStartWithTemplate( sal_True ),
- bMarkedHitMovesAlways( sal_True ),
- bMoveOnlyDragging( sal_False ),
- bCrookNoContortion( sal_False ),
+ bStartWithTemplate( true ),
+ bMarkedHitMovesAlways( true ),
+ bMoveOnlyDragging( false ),
+ bCrookNoContortion( false ),
bQuickEdit( GetConfigId() != SDCFG_DRAW ),
- bMasterPageCache( sal_True ),
- bDragWithCopy( sal_False ),
- bPickThrough( sal_True ),
- bBigHandles( sal_False ),
- bDoubleClickTextEdit( sal_True ),
- bClickChangeRotation( sal_False ),
- bStartWithActualPage( sal_False ),
- bSolidDragging( sal_True ),
- bSolidMarkHdl( sal_True ),
- bSummationOfParagraphs( sal_False ),
- // #90356#
- bShowUndoDeleteWarning( sal_True ),
- bSlideshowRespectZOrder( sal_True ),
- bShowComments( sal_True ),
- bPreviewNewEffects( sal_True ),
- bPreviewChangedEffects( sal_False ),
- bPreviewTransitions( sal_True ),
+ bMasterPageCache( true ),
+ bDragWithCopy( false ),
+ bPickThrough( true ),
+ bBigHandles( false ),
+ bDoubleClickTextEdit( true ),
+ bClickChangeRotation( false ),
+ bStartWithActualPage( false ),
+ bSolidDragging( true ),
+ bSolidMarkHdl( true ),
+ bSummationOfParagraphs( false ),
+ bShowUndoDeleteWarning( true ),
+ bSlideshowRespectZOrder( true ),
+ bShowComments( true ),
+ bPreviewNewEffects( true ),
+ bPreviewChangedEffects( false ),
+ bPreviewTransitions( true ),
mnDisplay( 0 ),
mnPenColor( 0xff0000 ),
mnPenWidth( 150.0 ),
@@ -516,12 +515,12 @@ SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
// formatting.
mnPrinterIndependentLayout (1)
{
- EnableModify( sal_True );
+ EnableModify( true );
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
+bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
{
return( IsStartWithTemplate() == rOpt.IsStartWithTemplate() &&
IsMarkedHitMovesAlways() == rOpt.IsMarkedHitMovesAlways() &&
@@ -606,7 +605,7 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, sal_uLong& rCount )
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsMisc::ReadData( const Any* pValues )
+bool SdOptionsMisc::ReadData( const Any* pValues )
{
if( pValues[0].hasValue() ) SetMarkedHitMovesAlways( *(sal_Bool*) pValues[ 0 ].getValue() );
if( pValues[1].hasValue() ) SetCrookNoContortion( *(sal_Bool*) pValues[ 1 ].getValue() );
@@ -663,12 +662,12 @@ sal_Bool SdOptionsMisc::ReadData( const Any* pValues )
SetPresentationPenWidth( getSafeValue< double >( pValues[ 26 ] ) );
}
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsMisc::WriteData( Any* pValues ) const
+bool SdOptionsMisc::WriteData( Any* pValues ) const
{
pValues[ 0 ] <<= IsMarkedHitMovesAlways();
pValues[ 1 ] <<= IsCrookNoContortion();
@@ -709,7 +708,7 @@ sal_Bool SdOptionsMisc::WriteData( Any* pValues ) const
pValues[ 26 ] <<= GetPresentationPenWidth();
}
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -720,7 +719,7 @@ sal_Bool SdOptionsMisc::WriteData( Any* pValues ) const
SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich )
: SfxPoolItem ( _nWhich )
-, maOptionsMisc ( 0, sal_False )
+, maOptionsMisc ( 0, false )
{
}
@@ -728,7 +727,7 @@ SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich )
SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
: SfxPoolItem ( _nWhich )
-, maOptionsMisc ( 0, sal_False )
+, maOptionsMisc ( 0, false )
{
if( pOpts )
{
@@ -764,8 +763,8 @@ SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd
maOptionsMisc.SetMasterPagePaintCaching( pView->IsMasterPagePaintCaching() );
maOptionsMisc.SetDragWithCopy( pView->IsDragWithCopy() );
- maOptionsMisc.SetPickThrough( (sal_Bool)pView->GetModel()->IsPickThroughTransparentTextFrames() );
- maOptionsMisc.SetBigHandles( (sal_Bool)pView->IsBigHandles() );
+ maOptionsMisc.SetPickThrough( pView->getSdrModelFromSdrView().IsPickThroughTransparentTextFrames() );
+ maOptionsMisc.SetBigHandles( pView->IsBigHandles() );
maOptionsMisc.SetDoubleClickTextEdit( pView->IsDoubleClickTextEdit() );
maOptionsMisc.SetClickChangeRotation( pView->IsClickChangeRotation() );
maOptionsMisc.SetSolidDragging( pView->IsSolidDragging() );
@@ -851,30 +850,30 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
|*
\************************************************************************/
-SdOptionsSnap::SdOptionsSnap( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
+SdOptionsSnap::SdOptionsSnap( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
B2U( "Office.Draw/Snap" ) :
B2U( "Office.Impress/Snap" ) ) :
OUString() ),
- bSnapHelplines( sal_True ),
- bSnapBorder( sal_True ),
- bSnapFrame( sal_False ),
- bSnapPoints( sal_False ),
- bOrtho( sal_False ),
- bBigOrtho( sal_True ),
- bRotate( sal_False ),
+ bSnapHelplines( true ),
+ bSnapBorder( true ),
+ bSnapFrame( false ),
+ bSnapPoints( false ),
+ bOrtho( false ),
+ bBigOrtho( true ),
+ bRotate( false ),
nSnapArea( 5 ),
nAngle( 1500 ),
nBezAngle( 1500 )
{
- EnableModify( sal_True );
+ EnableModify( true );
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsSnap::operator==( const SdOptionsSnap& rOpt ) const
+bool SdOptionsSnap::operator==( const SdOptionsSnap& rOpt ) const
{
return( IsSnapHelplines() == rOpt.IsSnapHelplines() &&
IsSnapBorder() == rOpt.IsSnapBorder() &&
@@ -912,7 +911,7 @@ void SdOptionsSnap::GetPropNameArray( const char**& ppNames, sal_uLong& rCount )
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsSnap::ReadData( const Any* pValues )
+bool SdOptionsSnap::ReadData( const Any* pValues )
{
if( pValues[0].hasValue() ) SetSnapHelplines( *(sal_Bool*) pValues[ 0 ].getValue() );
if( pValues[1].hasValue() ) SetSnapBorder( *(sal_Bool*)pValues[ 1 ].getValue() );
@@ -925,12 +924,12 @@ sal_Bool SdOptionsSnap::ReadData( const Any* pValues )
if( pValues[8].hasValue() ) SetAngle( (sal_Int16) *(sal_Int32*) pValues[ 8 ].getValue() );
if( pValues[9].hasValue() ) SetEliminatePolyPointLimitAngle( (sal_Int16) *(sal_Int32*) pValues[ 9 ].getValue() );
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsSnap::WriteData( Any* pValues ) const
+bool SdOptionsSnap::WriteData( Any* pValues ) const
{
pValues[ 0 ] <<= IsSnapHelplines();
pValues[ 1 ] <<= IsSnapBorder();
@@ -943,7 +942,7 @@ sal_Bool SdOptionsSnap::WriteData( Any* pValues ) const
pValues[ 8 ] <<= (sal_Int32) GetAngle();
pValues[ 9 ] <<= (sal_Int32) GetEliminatePolyPointLimitAngle();
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -954,7 +953,7 @@ sal_Bool SdOptionsSnap::WriteData( Any* pValues ) const
SdOptionsSnapItem::SdOptionsSnapItem( sal_uInt16 _nWhich )
: SfxPoolItem ( _nWhich )
-, maOptionsSnap ( 0, sal_False )
+, maOptionsSnap ( 0, false )
{
}
@@ -962,18 +961,18 @@ SdOptionsSnapItem::SdOptionsSnapItem( sal_uInt16 _nWhich )
SdOptionsSnapItem::SdOptionsSnapItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
: SfxPoolItem ( _nWhich )
-, maOptionsSnap ( 0, sal_False )
+, maOptionsSnap ( 0, false )
{
if( pView )
{
- maOptionsSnap.SetSnapHelplines( pView->IsHlplSnap() );
- maOptionsSnap.SetSnapBorder( pView->IsBordSnap() );
- maOptionsSnap.SetSnapFrame( pView->IsOFrmSnap() );
- maOptionsSnap.SetSnapPoints( pView->IsOPntSnap() );
- maOptionsSnap.SetOrtho( pView->IsOrtho() );
- maOptionsSnap.SetBigOrtho( pView->IsBigOrtho() );
+ maOptionsSnap.SetSnapHelplines( pView->IsHelplineSnap() );
+ maOptionsSnap.SetSnapBorder( pView->IsBorderSnap() );
+ maOptionsSnap.SetSnapFrame( pView->IsOFrameSnap() );
+ maOptionsSnap.SetSnapPoints( pView->IsOPointSnap() );
+ maOptionsSnap.SetOrtho( pView->IsOrthogonal() );
+ maOptionsSnap.SetBigOrtho( pView->IsBigOrthogonal() );
maOptionsSnap.SetRotate( pView->IsAngleSnapEnabled() );
- maOptionsSnap.SetSnapArea( pView->GetSnapMagneticPixel() );
+ maOptionsSnap.SetSnapArea( pView->GetDiscreteMagneticSnap() );
maOptionsSnap.SetAngle( (sal_Int16) pView->GetSnapAngle() );
maOptionsSnap.SetEliminatePolyPointLimitAngle( (sal_Int16) pView->GetEliminatePolyPointLimitAngle() );
}
@@ -1034,7 +1033,7 @@ void SdOptionsSnapItem::SetOptions( SdOptions* pOpts ) const
|*
\************************************************************************/
-SdOptionsZoom::SdOptionsZoom( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
+SdOptionsZoom::SdOptionsZoom( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, ( bUseConfig && ( SDCFG_DRAW == nConfigId ) ) ?
B2U( "Office.Draw/Zoom" ) :
OUString() ),
@@ -1042,12 +1041,12 @@ SdOptionsZoom::SdOptionsZoom( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
nY( 1 )
{
- EnableModify( sal_True );
+ EnableModify( true );
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsZoom::operator==( const SdOptionsZoom& rOpt ) const
+bool SdOptionsZoom::operator==( const SdOptionsZoom& rOpt ) const
{
sal_Int32 nX1, nX2, nY1, nY2;
@@ -1074,7 +1073,7 @@ void SdOptionsZoom::GetPropNameArray( const char**& ppNames, sal_uLong& rCount )
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsZoom::ReadData( const Any* pValues )
+bool SdOptionsZoom::ReadData( const Any* pValues )
{
sal_Int32 x = 1, y = 1;
@@ -1083,12 +1082,12 @@ sal_Bool SdOptionsZoom::ReadData( const Any* pValues )
SetScale( x, y );
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsZoom::WriteData( Any* pValues ) const
+bool SdOptionsZoom::WriteData( Any* pValues ) const
{
sal_Int32 x, y;
@@ -1097,7 +1096,7 @@ sal_Bool SdOptionsZoom::WriteData( Any* pValues ) const
pValues[ 0 ] <<= (sal_Int32) x;
pValues[ 1 ] <<= (sal_Int32) y;
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -1106,16 +1105,16 @@ sal_Bool SdOptionsZoom::WriteData( Any* pValues ) const
|*
\************************************************************************/
-SdOptionsGrid::SdOptionsGrid( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
+SdOptionsGrid::SdOptionsGrid( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
B2U( "Office.Draw/Grid" ) :
B2U( "Office.Impress/Grid" ) ) :
OUString() )
{
- EnableModify( sal_False );
+ EnableModify( false );
SetDefaults();
- EnableModify( sal_True );
+ EnableModify( true );
}
// -----------------------------------------------------------------------------
@@ -1136,15 +1135,15 @@ void SdOptionsGrid::SetDefaults()
SetFldDrawY( nVal );
SetFldSnapX( nVal );
SetFldSnapY( nVal );
- SetUseGridSnap( sal_False );
- SetSynchronize( sal_True );
- SetGridVisible( sal_False );
- SetEqualGrid( sal_True );
+ SetUseGridSnap( false );
+ SetSynchronize( true );
+ SetGridVisible( false );
+ SetEqualGrid( true );
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsGrid::operator==( const SdOptionsGrid& rOpt ) const
+bool SdOptionsGrid::operator==( const SdOptionsGrid& rOpt ) const
{
return( GetFldDrawX() == rOpt.GetFldDrawX() &&
GetFldDivisionX() == rOpt.GetFldDivisionX() &&
@@ -1200,7 +1199,7 @@ void SdOptionsGrid::GetPropNameArray( const char**& ppNames, sal_uLong& rCount )
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsGrid::ReadData( const Any* pValues )
+bool SdOptionsGrid::ReadData( const Any* pValues )
{
if( pValues[0].hasValue() ) SetFldDrawX( *(sal_Int32*) pValues[ 0 ].getValue() );
if( pValues[1].hasValue() ) SetFldDrawY( *(sal_Int32*) pValues[ 1 ].getValue() );
@@ -1224,12 +1223,12 @@ sal_Bool SdOptionsGrid::ReadData( const Any* pValues )
if( pValues[8].hasValue() ) SetGridVisible( *(sal_Bool*) pValues[ 8 ].getValue() );
if( pValues[9].hasValue() ) SetEqualGrid( *(sal_Bool*) pValues[ 9 ].getValue() );
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsGrid::WriteData( Any* pValues ) const
+bool SdOptionsGrid::WriteData( Any* pValues ) const
{
pValues[ 0 ] <<= (sal_Int32) GetFldDrawX();
pValues[ 1 ] <<= (sal_Int32) GetFldDrawY();
@@ -1242,7 +1241,7 @@ sal_Bool SdOptionsGrid::WriteData( Any* pValues ) const
pValues[ 8 ] <<= IsGridVisible();
pValues[ 9 ] <<= IsEqualGrid();
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -1263,12 +1262,12 @@ SdOptionsGridItem::SdOptionsGridItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd
SetFldDrawY( pView->GetGridCoarse().Height() );
SetFldDivisionX( pView->GetGridFine().Width() ? ( GetFldDrawX() / pView->GetGridFine().Width() - 1 ) : 0 );
SetFldDivisionY( pView->GetGridFine().Height() ? ( GetFldDrawY() / pView->GetGridFine().Height() - 1 ) : 0 );
- SetFldSnapX( long(pView->GetSnapGridWidthX()) );
- SetFldSnapY( long(pView->GetSnapGridWidthY()) );
+ SetFldSnapX( basegfx::fround(pView->GetSnapGridWidthX()) );
+ SetFldSnapY( basegfx::fround(pView->GetSnapGridWidthY()) );
SetUseGridSnap( pView->IsGridSnap() );
SetGridVisible( pView->IsGridVisible() );
}
- else
+ else if(pOpts)
{
SetFldDrawX( pOpts->GetFldDrawX() );
SetFldDrawY( pOpts->GetFldDrawY() );
@@ -1281,6 +1280,11 @@ SdOptionsGridItem::SdOptionsGridItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd
}
}
+SfxPoolItem* SdOptionsGridItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdOptionsGridItem( *this );
+}
+
// -----------------------------------------------------------------------
void SdOptionsGridItem::SetOptions( SdOptions* pOpts ) const
@@ -1303,40 +1307,40 @@ void SdOptionsGridItem::SetOptions( SdOptions* pOpts ) const
|*
\************************************************************************/
-SdOptionsPrint::SdOptionsPrint( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
+SdOptionsPrint::SdOptionsPrint( sal_uInt16 nConfigId, bool bUseConfig ) :
SdOptionsGeneric( nConfigId, bUseConfig ?
( ( SDCFG_DRAW == nConfigId ) ?
B2U( "Office.Draw/Print" ) :
B2U( "Office.Impress/Print" ) ) :
OUString() ),
- bDraw( sal_True ),
- bNotes( sal_False ),
- bHandout( sal_False ),
- bOutline( sal_False ),
- bDate( sal_False ),
- bTime( sal_False ),
- bPagename( sal_False ),
- bHiddenPages( sal_True ),
- bPagesize( sal_False ),
- bPagetile( sal_False ),
- bWarningPrinter( sal_True ),
- bWarningSize( sal_False ),
- bWarningOrientation( sal_False ),
- bBooklet( sal_False ),
- bFront( sal_True ),
- bBack( sal_True ),
- bCutPage( sal_False ),
- bPaperbin( sal_False ),
- mbHandoutHorizontal( sal_True ),
+ bDraw( true ),
+ bNotes( false ),
+ bHandout( false ),
+ bOutline( false ),
+ bDate( false ),
+ bTime( false ),
+ bPagename( false ),
+ bHiddenPages( true ),
+ bPagesize( false ),
+ bPagetile( false ),
+ bWarningPrinter( true ),
+ bWarningSize( false ),
+ bWarningOrientation( false ),
+ bBooklet( false ),
+ bFront( true ),
+ bBack( true ),
+ bCutPage( false ),
+ bPaperbin( false ),
+ mbHandoutHorizontal( true ),
mnHandoutPages( 6 ),
nQuality( 0 )
{
- EnableModify( sal_True );
+ EnableModify( true );
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsPrint::operator==( const SdOptionsPrint& rOpt ) const
+bool SdOptionsPrint::operator==( const SdOptionsPrint& rOpt ) const
{
return( IsDraw() == rOpt.IsDraw() &&
IsNotes() == rOpt.IsNotes() &&
@@ -1423,7 +1427,7 @@ void SdOptionsPrint::GetPropNameArray( const char**& ppNames, sal_uLong& rCount
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsPrint::ReadData( const Any* pValues )
+bool SdOptionsPrint::ReadData( const Any* pValues )
{
if( pValues[0].hasValue() ) SetDate( *(sal_Bool*) pValues[ 0 ].getValue() );
if( pValues[1].hasValue() ) SetTime( *(sal_Bool*) pValues[ 1 ].getValue() );
@@ -1448,12 +1452,12 @@ sal_Bool SdOptionsPrint::ReadData( const Any* pValues )
if( pValues[16].hasValue() ) SetHandoutPages( (sal_uInt16)*(sal_Int32*) pValues[16].getValue() );
}
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdOptionsPrint::WriteData( Any* pValues ) const
+bool SdOptionsPrint::WriteData( Any* pValues ) const
{
pValues[ 0 ] <<= IsDate();
pValues[ 1 ] <<= IsTime();
@@ -1478,7 +1482,7 @@ sal_Bool SdOptionsPrint::WriteData( Any* pValues ) const
pValues[ 16 ] <<= GetHandoutPages();
}
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -1489,7 +1493,7 @@ sal_Bool SdOptionsPrint::WriteData( Any* pValues ) const
SdOptionsPrintItem::SdOptionsPrintItem( sal_uInt16 _nWhich )
: SfxPoolItem ( _nWhich )
-, maOptionsPrint ( 0, sal_False )
+, maOptionsPrint ( 0, false )
{
}
@@ -1497,7 +1501,7 @@ SdOptionsPrintItem::SdOptionsPrintItem( sal_uInt16 _nWhich )
SdOptionsPrintItem::SdOptionsPrintItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* )
: SfxPoolItem ( _nWhich )
-, maOptionsPrint ( 0, sal_False )
+, maOptionsPrint ( 0, false )
{
if( pOpts )
{
@@ -1574,13 +1578,13 @@ void SdOptionsPrintItem::SetOptions( SdOptions* pOpts ) const
\************************************************************************/
SdOptions::SdOptions( sal_uInt16 nConfigId ) :
- SdOptionsLayout( nConfigId, sal_True ),
- SdOptionsContents( nConfigId, sal_True ),
- SdOptionsMisc( nConfigId, sal_True ),
- SdOptionsSnap( nConfigId, sal_True ),
- SdOptionsZoom( nConfigId, sal_True ),
- SdOptionsGrid( nConfigId, sal_True ),
- SdOptionsPrint( nConfigId, sal_True )
+ SdOptionsLayout( nConfigId, true ),
+ SdOptionsContents( nConfigId, true ),
+ SdOptionsMisc( nConfigId, true ),
+ SdOptionsSnap( nConfigId, true ),
+ SdOptionsZoom( nConfigId, true ),
+ SdOptionsGrid( nConfigId, true ),
+ SdOptionsPrint( nConfigId, true )
{
}
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index 489719e0cbf6..1204a110f2bb 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -19,19 +19,15 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
#include <editeng/eeitem.hxx>
-
#include <editeng/editeng.hxx>
#include <svx/svdobj.hxx>
#include <unotools/moduleoptions.hxx>
#include <svx/fmobjfac.hxx>
#include <svx/svdfield.hxx>
#include <svx/objfac3d.hxx>
-
#include "sddll.hxx"
#include "DrawDocShell.hxx"
#include "GraphicDocShell.hxx"
@@ -40,7 +36,6 @@
#include "cfgids.hxx"
#include "strmname.h"
#include "SdShapeTypes.hxx"
-
#include <svx/SvxShapeTypes.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -49,6 +44,7 @@
#include <svtools/FilterConfigItem.hxx>
#include <com/sun/star/util/XArchiver.hpp>
#include <comphelper/processfactory.hxx>
+#include <svx/sdrobjectfactory.hxx>
using namespace ::rtl;
using namespace ::com::sun::star;
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index 4e0b9487c5e9..b652a5d854ec 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -64,9 +64,6 @@
#include "res_bmp.hrc"
#include "cfgids.hxx"
#include "tools/SdGlobalResourceContainer.hxx"
-
-TYPEINIT1( SdModule, SfxModule );
-
#define SdModule
#include "sdslots.hxx"
@@ -83,7 +80,7 @@ SFX_IMPL_INTERFACE(SdModule, SfxModule, SdResId(STR_APPLICATIONOBJECTBAR))
\************************************************************************/
SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
-: SfxModule( SfxApplication::CreateResManager("sd"), sal_False,
+: SfxModule( SfxApplication::CreateResManager("sd"), false,
pFact1, pFact2, NULL ),
pTransferClip(NULL),
pTransferDrag(NULL),
@@ -92,7 +89,7 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
pDrawOptions(NULL),
pSearchItem(NULL),
pNumberFormatter( NULL ),
- bWaterCan(sal_False),
+ bWaterCan(false),
mpResourceContainer(new ::sd::SdGlobalResourceContainer())
{
SetName( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarDraw" ) ) ); // Nicht uebersetzen!
@@ -129,7 +126,7 @@ SdModule::~SdModule()
if( pNumberFormatter )
delete pNumberFormatter;
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocShell )
{
::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
@@ -160,8 +157,9 @@ SdModule::~SdModule()
void SdModule::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if( rHint.ISA( SfxSimpleHint ) &&
- ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DEINITIALIZING )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DEINITIALIZING == pSfxSimpleHint->GetId())
{
delete pImpressOptions, pImpressOptions = NULL;
delete pDrawOptions, pDrawOptions = NULL;
@@ -196,7 +194,7 @@ SdOptions* SdModule::GetSdOptions(DocumentType eDocType)
{
sal_uInt16 nMetric = pOptions->GetMetric();
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
SdDrawDocument* pDoc = NULL;
if (pDocSh)
pDoc = pDocSh->GetDoc();
@@ -219,7 +217,7 @@ SdOptions* SdModule::GetSdOptions(DocumentType eDocType)
SvStorageStreamRef SdModule::GetOptionStream( const String& rOptionName,
SdOptionStreamMode eMode )
{
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
SvStorageStreamRef xStm;
if( pDocSh )
@@ -236,7 +234,7 @@ SvStorageStreamRef SdModule::GetOptionStream( const String& rOptionName,
SvStream* pStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE );
if( pStm )
- xOptionStorage = new SvStorage( pStm, sal_True );
+ xOptionStorage = new SvStorage( pStm, true );
}
if( DOCUMENT_TYPE_DRAW == eType )
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 3297c586bc06..39fa3416d1c3 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -127,11 +127,11 @@ void SdModule::Execute(SfxRequest& rReq)
// automatische Rechtschreibpruefung
const SfxPoolItem* pItem;
if( pSet && SFX_ITEM_SET == pSet->GetItemState(
- SID_AUTOSPELL_CHECK, sal_False, &pItem ) )
+ SID_AUTOSPELL_CHECK, false, &pItem ) )
{
- sal_Bool bOnlineSpelling = ( (const SfxBoolItem*) pItem )->GetValue();
+ bool bOnlineSpelling = ( (const SfxBoolItem*) pItem )->GetValue();
// am Dokument sichern:
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocSh )
{
SdDrawDocument* pDoc = pDocSh->GetDoc();
@@ -144,7 +144,7 @@ void SdModule::Execute(SfxRequest& rReq)
case SID_ATTR_METRIC:
{
const SfxPoolItem* pItem;
- if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_ATTR_METRIC, sal_True, &pItem ) )
+ if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_ATTR_METRIC, true, &pItem ) )
{
FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)pItem)->GetValue();
switch( eUnit )
@@ -155,7 +155,7 @@ void SdModule::Execute(SfxRequest& rReq)
case FUNIT_PICA:
case FUNIT_POINT:
{
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
if(pDocSh)
{
DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType();
@@ -183,14 +183,14 @@ void SdModule::Execute(SfxRequest& rReq)
const SfxPoolItem* pItem;
if( pSet &&
(
- SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_LANGUAGE, sal_False, &pItem ) ||
- SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, sal_False, &pItem ) ||
- SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, sal_False, &pItem )
+ SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_LANGUAGE, false, &pItem ) ||
+ SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, false, &pItem ) ||
+ SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, false, &pItem )
)
)
{
// am Dokument sichern:
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if ( pDocSh )
{
LanguageType eLanguage = ( (SvxLanguageItem*)pItem )->GetValue();
@@ -227,8 +227,8 @@ void SdModule::Execute(SfxRequest& rReq)
case SID_OPENHYPERLINK:
case SID_OPENDOC:
{
- sal_Bool bIntercept = sal_False;
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ bool bIntercept = false;
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if (pDocShell)
{
::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
@@ -241,7 +241,7 @@ void SdModule::Execute(SfxRequest& rReq)
// from a shape interaction.
if (rReq.GetArgs() == NULL)
{
- bIntercept = sal_True;
+ bIntercept = true;
}
}
}
@@ -255,7 +255,7 @@ void SdModule::Execute(SfxRequest& rReq)
{
ErrorBox(NULL, WB_OK, String(SdResId(STR_CANT_PERFORM_IN_LIVEMODE))).Execute();
- SFX_REQUEST_ARG( rReq, pLinkItem, SfxLinkItem, SID_DONELINK, sal_False );
+ SFX_REQUEST_ARG( rReq, pLinkItem, SfxLinkItem, SID_DONELINK );
if( pLinkItem )
pLinkItem->GetValue().Call( 0 );
}
@@ -287,7 +287,7 @@ void SdModule::OutlineToImpress (SfxRequest& rRequest)
SfxObjectShellLock xDocShell;
::sd::DrawDocShell* pDocSh;
xDocShell = pDocSh = new ::sd::DrawDocShell(
- SFX_CREATE_MODE_STANDARD, sal_False);
+ SFX_CREATE_MODE_STANDARD, false);
if(pDocSh)
{
pDocSh->DoInitNew(NULL);
@@ -298,7 +298,7 @@ void SdModule::OutlineToImpress (SfxRequest& rRequest)
pDoc->StopWorkStartupDelay();
}
- SFX_REQUEST_ARG( rRequest, pFrmItem, SfxFrameItem, SID_DOCFRAME, sal_False);
+ SFX_REQUEST_ARG( rRequest, pFrmItem, SfxFrameItem, SID_DOCFRAME );
SfxViewFrame::LoadDocumentIntoFrame( *pDocSh, pFrmItem, ::sd::OUTLINE_FACTORY_ID );
::sd::ViewShell* pViewSh = pDocSh->GetViewShell();
@@ -359,7 +359,7 @@ void SdModule::GetState(SfxItemSet& rItemSet)
}
else
{
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if (pDocShell)
{
::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
@@ -376,7 +376,7 @@ void SdModule::GetState(SfxItemSet& rItemSet)
if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_METRIC ) )
{
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
if(pDocSh)
{
DocumentType eDocType = pDocSh->GetDoc()->GetDocumentType();
@@ -404,8 +404,7 @@ void SdModule::GetState(SfxItemSet& rItemSet)
if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_AUTOSPELL_CHECK ) )
{
- ::sd::DrawDocShell* pDocSh =
- PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocSh )
{
SdDrawDocument* pDoc = pDocSh->GetDoc();
@@ -415,28 +414,28 @@ void SdModule::GetState(SfxItemSet& rItemSet)
if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_LANGUAGE ) )
{
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocSh )
rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ), SID_ATTR_LANGUAGE ) );
}
if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_CHAR_CJK_LANGUAGE ) )
{
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocSh )
rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CJK ), SID_ATTR_CHAR_CJK_LANGUAGE ) );
}
if( SFX_ITEM_AVAILABLE == rItemSet.GetItemState( SID_ATTR_CHAR_CTL_LANGUAGE ) )
{
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocSh )
rItemSet.Put( SvxLanguageItem( pDocSh->GetDoc()->GetLanguage( EE_CHAR_LANGUAGE_CTL ), SID_ATTR_CHAR_CTL_LANGUAGE ) );
}
if ( !bOnce )
{
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocShell ) // Impress or Draw ?
{
::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
@@ -463,7 +462,7 @@ IMPL_LINK( SdModule, EventListenerHdl, VclSimpleEvent*, pEvent )
{
case MEDIA_COMMAND_PLAY:
{
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current());
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current());
if( pDocShell ) // Impress or Draw ?
{
::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
@@ -506,7 +505,7 @@ void SdModule::AddSummaryPage (SfxViewFrame* pViewFrame, SdDrawDocument* pDocume
// The summary page, if it exists, is the last page.
SdPage* pSummaryPage = pDocument->GetSdPage (
- (sal_uInt16)nPageCount-1, PK_STANDARD);
+ nPageCount-1, PK_STANDARD);
OSL_ASSERT (pSummaryPage!=NULL);
// Take the change mode of the template page as indication of the
@@ -531,10 +530,9 @@ SfxFrame* SdModule::CreateFromTemplate( const String& rTemplatePath, const Refer
SfxObjectShellLock xDocShell;
SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
- pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
-
- sal_uLong lErr = SFX_APP()->LoadTemplate( xDocShell, rTemplatePath, sal_True, pSet );
+ pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) );
+ sal_uLong lErr = SFX_APP()->LoadTemplate( xDocShell, rTemplatePath, true, pSet );
SfxObjectShell* pDocShell = xDocShell;
if( lErr )
@@ -558,7 +556,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
if ( SvtModuleOptions().IsImpress() )
{
Reference< XFrame > xTargetFrame;
- SFX_REQUEST_ARG( rReq, pFrmItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False);
+ SFX_REQUEST_ARG( rReq, pFrmItem, SfxUnoFrameItem, SID_FILLFRAME );
if ( pFrmItem )
xTargetFrame = pFrmItem->GetFrame();
@@ -601,9 +599,9 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
const sal_Bool bIsDocEmpty = pPilotDlg->IsDocEmpty();
// So that you can open the document without AutoLayout-Dialog
- pOpt->SetStartWithTemplate(sal_False);
+ pOpt->SetStartWithTemplate(false);
if(bNewDocDirect && !pPilotDlg->GetStartWithFlag())
- bStartWithTemplate = sal_False;
+ bStartWithTemplate = false;
if( pPilotDlg->GetStartType() == ST_OPEN )
{
@@ -629,7 +627,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
aSet.Put( aPassword );
const SfxPoolItem* pRet = SfxFrame::OpenDocumentSynchron( aSet, xTargetFrame );
- const SfxViewFrameItem* pFrameItem = PTR_CAST( SfxViewFrameItem, pRet );
+ const SfxViewFrameItem* pFrameItem = dynamic_cast< const SfxViewFrameItem* >(pRet );
if ( pFrameItem && pFrameItem->GetFrame() )
pFrame = &pFrameItem->GetFrame()->GetFrame();
}
@@ -648,13 +646,13 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
try
{
const SfxPoolItem* pRet = SFX_APP()->ExecuteSlot (aRequest);
- const SfxViewFrameItem* pFrameItem = PTR_CAST( SfxViewFrameItem, pRet );
+ const SfxViewFrameItem* pFrameItem = dynamic_cast< const SfxViewFrameItem* >(pRet );
if ( pFrameItem )
pFrame = &pFrameItem->GetFrame()->GetFrame();
}
catch (::com::sun::star::uno::Exception e)
{
- DBG_ASSERT (sal_False, "caught IllegalArgumentException while loading document from Impress autopilot");
+ DBG_ASSERT (false, "caught IllegalArgumentException while loading document from Impress autopilot");
}
}
}
@@ -687,8 +685,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
if( pShell && pViewFrame )
{
- ::sd::DrawDocShell* pDocShell =
- PTR_CAST(::sd::DrawDocShell,pShell);
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(pShell);
SdDrawDocument* pDoc = pDocShell->GetDoc();
::sd::ViewShellBase* pBase =
@@ -733,8 +730,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
xDocProps->setTemplateURL(pPilotDlg->GetDocPath());
pDoc->SetChanged(!bIsDocEmpty);
-
- pDocShell->SetUseUserData(sal_True);
+ pDocShell->SetUseUserData(true);
// #94652# clear UNDO stack after autopilot
pDocShell->ClearUndoBuffer();
@@ -768,7 +764,7 @@ SfxFrame* SdModule::CreateEmptyDocument( DocumentType eDocType, const Reference<
SfxObjectShellLock xDocShell;
::sd::DrawDocShell* pNewDocSh;
- xDocShell = pNewDocSh = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD,sal_False,eDocType);
+ xDocShell = pNewDocSh = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD,false,eDocType);
if(pNewDocSh)
{
pNewDocSh->DoInitNew(NULL);
@@ -797,7 +793,7 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
return;
// settings for the Outputmedium
- Size aNewSize;
+ basegfx::B2DVector aNewSize;
sal_uInt32 nLeft = 0;
sal_uInt32 nRight = 0;
sal_uInt32 nLower = 0;
@@ -807,35 +803,34 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
case OUTPUT_PAGE:
case OUTPUT_OVERHEAD:
{
- SfxPrinter* pPrinter = pDocShell->GetPrinter(sal_True);
+ SfxPrinter* pPrinter = pDocShell->GetPrinter(true);
if( pPrinter && pPrinter->IsValid())
{
// Der Printer gibt leider kein exaktes
// Format (z.B. A4) zurueck
- Size aSize(pPrinter->GetPaperSize());
- Paper ePaper = SvxPaperInfo::GetSvxPaper( aSize, MAP_100TH_MM, sal_True);
+ Size aPrinterSize(pPrinter->GetPaperSize());
+ Paper ePaper = SvxPaperInfo::GetSvxPaper( aPrinterSize, MAP_100TH_MM, true);
if (ePaper != PAPER_USER)
{
// Korrekte Size holen
- aSize = SvxPaperInfo::GetPaperSize(ePaper, MAP_100TH_MM);
+ aPrinterSize = SvxPaperInfo::GetPaperSize(ePaper, MAP_100TH_MM);
}
- if (aSize.Height() > aSize.Width())
+ if (aPrinterSize.Height() > aPrinterSize.Width())
{
- // Stets Querformat
- aNewSize.Width() = aSize.Height();
- aNewSize.Height() = aSize.Width();
+ // !caution! here Width and Height is exchanged by purpse (Stets Querformat)
+ aNewSize = basegfx::B2DVector(aPrinterSize.Height(), aPrinterSize.Width());
}
else
{
- aNewSize = aSize;
+ aNewSize = basegfx::B2DVector(aPrinterSize.Width(), aPrinterSize.Height());
}
}
else
{
- aNewSize=Size(29700, 21000);
+ aNewSize = basegfx::B2DVector(29700.0, 21000.0);
}
if (eMedium == OUTPUT_PAGE)
@@ -857,7 +852,7 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
case OUTPUT_SLIDE:
{
- aNewSize = Size(27000, 18000);
+ aNewSize = basegfx::B2DVector(27000.0, 18000.0);
nLeft =0;
nRight=0;
nUpper=0;
@@ -867,7 +862,7 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
case OUTPUT_PRESENTATION:
{
- aNewSize = Size(28000, 21000);
+ aNewSize = basegfx::B2DVector(28000.0, 21000.0);
nLeft =0;
nRight=0;
nUpper=0;
@@ -876,9 +871,9 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
break;
}
- sal_Bool bScaleAll = sal_True;
- sal_uInt16 nPageCnt = pDoc->GetMasterSdPageCount(PK_STANDARD);
- sal_uInt16 i;
+ bool bScaleAll = true;
+ sal_uInt32 nPageCnt = pDoc->GetMasterSdPageCount(PK_STANDARD);
+ sal_uInt32 i;
SdPage* pPage;
// master pages first
@@ -890,10 +885,9 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
{
if(eMedium != OUTPUT_ORIGINAL)
{
- Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
- pPage->ScaleObjects(aNewSize, aBorderRect, bScaleAll);
- pPage->SetSize(aNewSize);
- pPage->SetBorder(nLeft, nUpper, nRight, nLower);
+ pPage->ScaleObjects(aNewSize, nLeft, nUpper, nRight, nLower, bScaleAll);
+ pPage->SetPageScale(aNewSize);
+ pPage->SetPageBorder(nLeft, nUpper, nRight, nLower);
}
SdPage* pNotesPage = pDoc->GetMasterSdPage(i, PK_NOTES);
DBG_ASSERT( pNotesPage, "Wrong page ordering!" );
@@ -913,10 +907,9 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
{
if(eMedium != OUTPUT_ORIGINAL)
{
- Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
- pPage->ScaleObjects(aNewSize, aBorderRect, bScaleAll);
- pPage->SetSize(aNewSize);
- pPage->SetBorder(nLeft, nUpper, nRight, nLower);
+ pPage->ScaleObjects(aNewSize, nLeft, nUpper, nRight, nLower, bScaleAll);
+ pPage->SetPageScale(aNewSize);
+ pPage->SetPageBorder(nLeft, nUpper, nRight, nLower);
}
SdPage* pNotesPage = pDoc->GetSdPage(i, PK_NOTES);
DBG_ASSERT( pNotesPage, "Wrong page ordering!" );
@@ -926,7 +919,7 @@ void SdModule::ChangeMedium( ::sd::DrawDocShell* pDocShell, SfxViewFrame* pViewF
}
SdPage* pHandoutPage = pDoc->GetSdPage(0, PK_HANDOUT);
- pHandoutPage->CreateTitleAndLayout(sal_True);
+ pHandoutPage->CreateTitleAndLayout(true);
if( (eMedium != OUTPUT_ORIGINAL) && pViewFrame && pViewFrame->GetDispatcher())
{
@@ -1033,8 +1026,8 @@ void OutlineToImpressFinalizer::operator() (bool)
// Call UpdatePreview once for every slide to resync the
// document with the outliner of the OutlineViewShell.
- sal_uInt16 nPageCount (mrDocument.GetSdPageCount(PK_STANDARD));
- for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++)
+ sal_uInt32 nPageCount (mrDocument.GetSdPageCount(PK_STANDARD));
+ for (sal_uInt32 nIndex=0; nIndex<nPageCount; nIndex++)
{
SdPage* pPage = mrDocument.GetSdPage(nIndex, PK_STANDARD);
// Make the page the actual page so that the
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 45d309459496..340897d221af 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -101,13 +101,15 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo
// first try to check if we are inside the outline view
sd::OutlineView* pSdView = NULL;
- if( pViewSh && pViewSh->ISA(sd::OutlineViewShell))
- pSdView = static_cast<sd::OutlineView*> (static_cast<sd::OutlineViewShell*>(pViewSh)->GetView());
+ sd::OutlineViewShell* pSdOutlineViewShell = dynamic_cast< sd::OutlineViewShell* >(pViewSh);
+
+ if(pSdOutlineViewShell)
+ pSdView = static_cast< sd::OutlineView* >(pSdOutlineViewShell->GetView());
if (pSdView != NULL && (pOutliner == pSdView->GetOutliner()))
{
// outline mode
- int nPgNum = 0;
+ sal_uInt32 nPgNum = 0;
Outliner* pOutl = pSdView->GetOutliner();
long nPos = pInfo->GetPara();
sal_uLong nParaPos = 0;
@@ -118,7 +120,7 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo
nPgNum++;
}
- pPage = pViewSh->GetDoc()->GetSdPage( (sal_uInt16)nPgNum, PK_STANDARD );
+ pPage = pViewSh->GetDoc()->GetSdPage( nPgNum, PK_STANDARD );
}
else
{
@@ -140,7 +142,7 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo
if( pTextObj )
{
- pPage = dynamic_cast< SdPage* >( pTextObj->GetPage() );
+ pPage = dynamic_cast< SdPage* >( pTextObj->getSdrPageFromSdrObject() );
}
}
@@ -173,7 +175,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
const SdrTextObj* pTextObj = pSdrOutliner->GetTextObj();
if( pTextObj )
- pDoc = dynamic_cast< SdDrawDocument* >( pTextObj->GetModel() );
+ pDoc = dynamic_cast< SdDrawDocument* >( &pTextObj->getSdrModelFromSdrObject() );
if( pDoc )
pDocShell = pDoc->GetDocSh();
@@ -235,7 +237,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
if(pViewSh == NULL)
{
- ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
+ ::sd::ViewShellBase* pBase = dynamic_cast< ::sd::ViewShellBase* >(SfxViewShell::Current());
if(pBase)
pViewSh = pBase->GetMainViewShell().get();
}
@@ -247,7 +249,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
if( pPage && pDoc && !bMasterView )
{
- int nPgNum;
+ sal_uInt32 nPgNum;
if( (pPage->GetPageKind() == PK_HANDOUT) && pViewSh )
{
@@ -255,9 +257,9 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
}
else
{
- nPgNum = (pPage->GetPageNum() - 1) / 2 + 1;
+ nPgNum = (pPage->GetPageNumber() - 1) / 2 + 1;
}
- aRepresentation = pDoc->CreatePageNumValue((sal_uInt16)nPgNum);
+ aRepresentation = pDoc->CreatePageNumValue(nPgNum);
}
else
{
@@ -275,7 +277,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
::sd::ViewShell* pViewSh = pDocShell ? pDocShell->GetViewShell() : NULL;
if(pViewSh == NULL)
{
- ::sd::ViewShellBase* pBase = PTR_CAST(::sd::ViewShellBase, SfxViewShell::Current());
+ ::sd::ViewShellBase* pBase = dynamic_cast< ::sd::ViewShellBase* >(SfxViewShell::Current());
if(pBase)
pViewSh = pBase->GetMainViewShell().get();
}
@@ -285,7 +287,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
bool bMasterView;
SdPage* pPage = GetCurrentPage( pViewSh, pInfo, bMasterView );
- sal_uInt16 nPageCount = 0;
+ sal_uInt32 nPageCount = 0;
if( !bMasterView )
{
@@ -295,7 +297,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
}
else if( pDoc )
{
- nPageCount = (sal_uInt16)pDoc->GetSdPageCount(PK_STANDARD);
+ nPageCount = pDoc->GetSdPageCount(PK_STANDARD);
}
}
@@ -420,7 +422,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo)
SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
{
::sd::FrameView* pFrameView = NULL;
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
SdDrawDocument* pDoc = NULL;
// Hier wird der DocType vom Optionsdialog gesetzt (nicht Dokument!)
@@ -513,9 +515,9 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
if( pDocSh )
{
SdrPage* pPage = (SdrPage*) pDoc->GetSdPage(0, PK_STANDARD);
- Size aSize(pPage->GetSize());
- nW = aSize.Width();
- nH = aSize.Height();
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
+ nW = basegfx::fround(rPageScale.getX());
+ nH = basegfx::fround(rPageScale.getY());
}
if(pFrameView)
@@ -547,12 +549,12 @@ SfxItemSet* SdModule::CreateItemSet( sal_uInt16 nSlot )
void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
{
const SfxPoolItem* pItem = NULL;
- sal_Bool bNewDefTab = sal_False;
- sal_Bool bNewPrintOptions = sal_False;
- sal_Bool bMiscOptions = sal_False;
+ bool bNewDefTab = false;
+ bool bNewPrintOptions = false;
+ bool bMiscOptions = false;
::sd::FrameView* pFrameView = NULL;
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
SdDrawDocument* pDoc = NULL;
// Hier wird der DocType vom Optionsdialog gesetzt (nicht Dokument!)
DocumentType eDocType = DOCUMENT_TYPE_IMPRESS;
@@ -576,8 +578,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
}
SdOptions* pOptions = GetSdOptions(eDocType);
// Raster
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS ,
- sal_False, (const SfxPoolItem**) &pItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS , false, (const SfxPoolItem**) &pItem ))
{
const SdOptionsGridItem* pGridItem = (SdOptionsGridItem*) pItem;
pGridItem->SetOptions( pOptions );
@@ -585,14 +586,13 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
// Layout
const SdOptionsLayoutItem* pLayoutItem = NULL;
- if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_LAYOUT,
- sal_False, (const SfxPoolItem**) &pLayoutItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_LAYOUT, false, (const SfxPoolItem**) &pLayoutItem ))
{
pLayoutItem->SetOptions( pOptions );
}
// Metric
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC, sal_False, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC, false, &pItem ) )
{
if( pDoc && eDocType == pDoc->GetDocumentType() )
PutItem( *pItem );
@@ -600,19 +600,18 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
}
sal_uInt16 nDefTab = pOptions->GetDefTab();
// Default-Tabulator
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_DEFTABSTOP, sal_False, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_DEFTABSTOP, false, &pItem ) )
{
nDefTab = ( (SfxUInt16Item*) pItem )->GetValue();
pOptions->SetDefTab( nDefTab );
- bNewDefTab = sal_True;
+ bNewDefTab = true;
}
// Massstab
- if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_X, sal_False, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_X, false, &pItem ) )
{
sal_Int32 nX = ( (SfxInt32Item*) pItem )->GetValue();
- if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_Y, sal_False, &pItem ) )
{
sal_Int32 nY = ( (SfxInt32Item*) pItem )->GetValue();
pOptions->SetScale( nX, nY );
@@ -629,25 +628,22 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
// Contents (Inhalte)
const SdOptionsContentsItem* pContentsItem = NULL;
- if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_CONTENTS,
- sal_False, (const SfxPoolItem**) &pContentsItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_CONTENTS, false, (const SfxPoolItem**) &pContentsItem ))
{
pContentsItem->SetOptions( pOptions );
}
// Misc (Sonstiges)
const SdOptionsMiscItem* pMiscItem = NULL;
- if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_MISC,
- sal_False, (const SfxPoolItem**) &pMiscItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_MISC, false, (const SfxPoolItem**) &pMiscItem ))
{
pMiscItem->SetOptions( pOptions );
- bMiscOptions = sal_True;
+ bMiscOptions = true;
}
// Fangen/Einrasten
const SdOptionsSnapItem* pSnapItem = NULL;
- if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SNAP,
- sal_False, (const SfxPoolItem**) &pSnapItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_SNAP, false, (const SfxPoolItem**) &pSnapItem ))
{
pSnapItem->SetOptions( pOptions );
}
@@ -660,8 +656,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
// Drucken
const SdOptionsPrintItem* pPrintItem = NULL;
- if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_PRINT,
- sal_False, (const SfxPoolItem**) &pPrintItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( ATTR_OPTIONS_PRINT, false, (const SfxPoolItem**) &pPrintItem ))
{
pPrintItem->SetOptions( pOptions );
@@ -678,7 +673,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
aPrintSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
aPrintSet.Put( aFlagItem );
- bNewPrintOptions = sal_True;
+ bNewPrintOptions = true;
}
// Nur, wenn auch der Dokumenttyp uebereinstimmt...
@@ -686,7 +681,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
{
if( bNewPrintOptions )
{
- pDocSh->GetPrinter(sal_True)->SetOptions( aPrintSet );
+ pDocSh->GetPrinter(true)->SetOptions( aPrintSet );
}
// Am Model den DefTab setzen
@@ -695,11 +690,11 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
SdDrawDocument* pDocument = pDocSh->GetDoc();
pDocument->SetDefaultTabulator( nDefTab );
- ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False );
+ ::sd::Outliner* pOutl = pDocument->GetOutliner( false );
if( pOutl )
pOutl->SetDefTab( nDefTab );
- ::sd::Outliner* pInternalOutl = pDocument->GetInternalOutliner( sal_False );
+ ::sd::Outliner* pInternalOutl = pDocument->GetInternalOutliner( false );
if( pInternalOutl )
pInternalOutl->SetDefTab( nDefTab );
}
@@ -710,16 +705,16 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
sal_uInt32 nCntrl;
SdDrawDocument* pDocument = pDocSh->GetDoc();
- SdrOutliner& rOutl = pDocument->GetDrawOutliner( sal_False );
+ SdrOutliner& rOutl = pDocument->GetDrawOutliner( false );
nCntrl = rOutl.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
rOutl.SetControlWord( nCntrl | nSum );
- ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False );
+ ::sd::Outliner* pOutl = pDocument->GetOutliner( false );
if( pOutl )
{
nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
pOutl->SetControlWord( nCntrl | nSum );
}
- pOutl = pDocument->GetInternalOutliner( sal_False );
+ pOutl = pDocument->GetInternalOutliner( false );
if( pOutl )
{
nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
@@ -756,7 +751,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
}
if( pViewShell && pViewShell->GetViewFrame() )
- pViewShell->GetViewFrame()->GetBindings().InvalidateAll( sal_True );
+ pViewShell->GetViewFrame()->GetBindings().InvalidateAll( true );
}
SfxTabPage* SdModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet )
diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx
index 31511a1dfbb7..ca5a7feb18d2 100644
--- a/sd/source/ui/app/sdpopup.cxx
+++ b/sd/source/ui/app/sdpopup.cxx
@@ -78,9 +78,10 @@ void SdFieldPopup::Fill( LanguageType eLanguage )
InsertItem( nID++, String( SdResId( STR_VAR ) ), nStyle );
InsertSeparator();
- if( pField->ISA( SvxDateField ) )
+ const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField);
+
+ if( pDateField )
{
- const SvxDateField* pDateField = (const SvxDateField*) pField;
SvxDateField aDateField( *pDateField );
if( pDateField->GetType() == SVXDATETYPE_FIX )
@@ -110,73 +111,83 @@ void SdFieldPopup::Fill( LanguageType eLanguage )
CheckItem( (sal_uInt16) ( pDateField->GetFormat() ) + 1 ); // - 2 + 3 !
}
- else if( pField->ISA( SvxExtTimeField ) )
+ else
{
- const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
- SvxExtTimeField aTimeField( *pTimeField );
-
- if( pTimeField->GetType() == SVXTIMETYPE_FIX )
- CheckItem( 1 );
- else
- CheckItem( 2 );
+ const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField);
- //SVXTIMEFORMAT_APPDEFAULT, // Wird nicht benutzt
- //SVXTIMEFORMAT_SYSTEM, // Wird nicht benutzt
- InsertItem( nID++, String( SdResId( STR_STANDARD_NORMAL ) ), nStyle );
-
- SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter();
- aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49
- InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
- aTimeField.SetFormat( SVXTIMEFORMAT_24_HMS ); // 13:49:38
- InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
- aTimeField.SetFormat( SVXTIMEFORMAT_24_HMSH ); // 13:49:38.78
- InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
-
- aTimeField.SetFormat( SVXTIMEFORMAT_12_HM ); // 01:49
- InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
- aTimeField.SetFormat( SVXTIMEFORMAT_12_HMS ); // 01:49:38
- InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
- aTimeField.SetFormat( SVXTIMEFORMAT_12_HMSH ); // 01:49:38.78
- InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
- //SVXTIMEFORMAT_AM_HM, // 01:49 PM
- //SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM
- //SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM
-
- CheckItem( (sal_uInt16) ( pTimeField->GetFormat() ) + 1 ); // - 2 + 3 !
- }
- else if( pField->ISA( SvxExtFileField ) )
- {
- const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
- //SvxExtFileField aFileField( *pFileField );
-
- if( pFileField->GetType() == SVXFILETYPE_FIX )
- CheckItem( 1 );
+ if( pTimeField )
+ {
+ SvxExtTimeField aTimeField( *pTimeField );
+
+ if( pTimeField->GetType() == SVXTIMETYPE_FIX )
+ CheckItem( 1 );
+ else
+ CheckItem( 2 );
+
+ //SVXTIMEFORMAT_APPDEFAULT, // Wird nicht benutzt
+ //SVXTIMEFORMAT_SYSTEM, // Wird nicht benutzt
+ InsertItem( nID++, String( SdResId( STR_STANDARD_NORMAL ) ), nStyle );
+
+ SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter();
+ aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49
+ InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
+ aTimeField.SetFormat( SVXTIMEFORMAT_24_HMS ); // 13:49:38
+ InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
+ aTimeField.SetFormat( SVXTIMEFORMAT_24_HMSH ); // 13:49:38.78
+ InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
+
+ aTimeField.SetFormat( SVXTIMEFORMAT_12_HM ); // 01:49
+ InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
+ aTimeField.SetFormat( SVXTIMEFORMAT_12_HMS ); // 01:49:38
+ InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
+ aTimeField.SetFormat( SVXTIMEFORMAT_12_HMSH ); // 01:49:38.78
+ InsertItem( nID++, aTimeField.GetFormatted( *pNumberFormatter, eLanguage ), nStyle );
+ //SVXTIMEFORMAT_AM_HM, // 01:49 PM
+ //SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM
+ //SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM
+
+ CheckItem( (sal_uInt16) ( pTimeField->GetFormat() ) + 1 ); // - 2 + 3 !
+ }
else
- CheckItem( 2 );
-
- InsertItem( nID++, String( SdResId( STR_FILEFORMAT_NAME_EXT ) ), nStyle );
- InsertItem( nID++, String( SdResId( STR_FILEFORMAT_FULLPATH ) ), nStyle );
- InsertItem( nID++, String( SdResId( STR_FILEFORMAT_PATH ) ), nStyle );
- InsertItem( nID++, String( SdResId( STR_FILEFORMAT_NAME ) ), nStyle );
+ {
+ const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField);
- CheckItem( (sal_uInt16) ( pFileField->GetFormat() ) + 3 );
- }
- else if( pField->ISA( SvxAuthorField ) )
- {
- const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
- SvxAuthorField aAuthorField( *pAuthorField );
+ if( pFileField )
+ {
+ if( pFileField->GetType() == SVXFILETYPE_FIX )
+ CheckItem( 1 );
+ else
+ CheckItem( 2 );
- if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX )
- CheckItem( 1 );
- else
- CheckItem( 2 );
+ InsertItem( nID++, String( SdResId( STR_FILEFORMAT_NAME_EXT ) ), nStyle );
+ InsertItem( nID++, String( SdResId( STR_FILEFORMAT_FULLPATH ) ), nStyle );
+ InsertItem( nID++, String( SdResId( STR_FILEFORMAT_PATH ) ), nStyle );
+ InsertItem( nID++, String( SdResId( STR_FILEFORMAT_NAME ) ), nStyle );
- for( sal_uInt16 i = 0; i < 4; i++ )
- {
- aAuthorField.SetFormat( (SvxAuthorFormat) i );
- InsertItem( nID++, aAuthorField.GetFormatted(), nStyle );
+ CheckItem( (sal_uInt16) ( pFileField->GetFormat() ) + 3 );
+ }
+ else
+ {
+ const SvxAuthorField* pAuthorField = dynamic_cast< const SvxAuthorField* >(pField);
+
+ if( pAuthorField )
+ {
+ SvxAuthorField aAuthorField( *pAuthorField );
+
+ if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX )
+ CheckItem( 1 );
+ else
+ CheckItem( 2 );
+
+ for( sal_uInt16 i = 0; i < 4; i++ )
+ {
+ aAuthorField.SetFormat( (SvxAuthorFormat) i );
+ InsertItem( nID++, aAuthorField.GetFormatted(), nStyle );
+ }
+ CheckItem( (sal_uInt16) ( pAuthorField->GetFormat() ) + 3 );
+ }
+ }
}
- CheckItem( (sal_uInt16) ( pAuthorField->GetFormat() ) + 3 );
}
}
@@ -191,10 +202,10 @@ SvxFieldData* SdFieldPopup::GetField()
{
SvxFieldData* pNewField = NULL;
sal_uInt16 nCount = GetItemCount();
+ const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField);
- if( pField->ISA( SvxDateField ) )
+ if( pDateField )
{
- const SvxDateField* pDateField = (const SvxDateField*) pField;
SvxDateType eType;
SvxDateFormat eFormat;
sal_uInt16 i;
@@ -225,107 +236,118 @@ SvxFieldData* SdFieldPopup::GetField()
}
}
}
- else if( pField->ISA( SvxExtTimeField ) )
+ else
{
- const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
- SvxTimeType eType;
- SvxTimeFormat eFormat;
- sal_uInt16 i;
-
- if( IsItemChecked( 1 ) )
- eType = SVXTIMETYPE_FIX;
- else
- eType = SVXTIMETYPE_VAR;
+ const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField);
- for( i = 3; i <= nCount; i++ )
+ if( pTimeField )
{
- if( IsItemChecked( i ) )
- break;
- }
- eFormat = (SvxTimeFormat) ( i - 1 );
+ SvxTimeType eType;
+ SvxTimeFormat eFormat;
+ sal_uInt16 i;
- if( pTimeField->GetFormat() != eFormat ||
- pTimeField->GetType() != eType )
- {
- pNewField = new SvxExtTimeField( *pTimeField );
- ( (SvxExtTimeField*) pNewField )->SetType( eType );
- ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat );
+ if( IsItemChecked( 1 ) )
+ eType = SVXTIMETYPE_FIX;
+ else
+ eType = SVXTIMETYPE_VAR;
- if( (pTimeField->GetType() == SVXTIMETYPE_VAR) && (eType == SVXTIMETYPE_FIX) )
+ for( i = 3; i <= nCount; i++ )
{
- Time aTime;
- ( (SvxExtTimeField*) pNewField )->SetFixTime( aTime );
+ if( IsItemChecked( i ) )
+ break;
}
+ eFormat = (SvxTimeFormat) ( i - 1 );
- }
- }
- else if( pField->ISA( SvxExtFileField ) )
- {
- const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
- SvxFileType eType;
- SvxFileFormat eFormat;
- sal_uInt16 i;
-
- if( IsItemChecked( 1 ) )
- eType = SVXFILETYPE_FIX;
- else
- eType = SVXFILETYPE_VAR;
-
- for( i = 3; i <= nCount; i++ )
- {
- if( IsItemChecked( i ) )
- break;
- }
- eFormat = (SvxFileFormat) ( i - 3 );
-
- if( pFileField->GetFormat() != eFormat ||
- pFileField->GetType() != eType )
- {
- ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell,
- SfxObjectShell::Current() );
-
- if( pDocSh )
+ if( pTimeField->GetFormat() != eFormat ||
+ pTimeField->GetType() != eType )
{
- SvxExtFileField aFileField( *pFileField );
+ pNewField = new SvxExtTimeField( *pTimeField );
+ ( (SvxExtTimeField*) pNewField )->SetType( eType );
+ ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat );
- String aName;
- if( pDocSh->HasName() )
- aName = pDocSh->GetMedium()->GetName();
+ if( (pTimeField->GetType() == SVXTIMETYPE_VAR) && (eType == SVXTIMETYPE_FIX) )
+ {
+ Time aTime;
+ ( (SvxExtTimeField*) pNewField )->SetFixTime( aTime );
+ }
- // #91225# Get current filename, not the one stored in the old field
- pNewField = new SvxExtFileField( aName );
- ( (SvxExtFileField*) pNewField )->SetType( eType );
- ( (SvxExtFileField*) pNewField )->SetFormat( eFormat );
}
}
- }
- else if( pField->ISA( SvxAuthorField ) )
- {
- const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
- SvxAuthorType eType;
- SvxAuthorFormat eFormat;
- sal_uInt16 i;
-
- if( IsItemChecked( 1 ) )
- eType = SVXAUTHORTYPE_FIX;
else
- eType = SVXAUTHORTYPE_VAR;
-
- for( i = 3; i <= nCount; i++ )
{
- if( IsItemChecked( i ) )
- break;
- }
- eFormat = (SvxAuthorFormat) ( i - 3 );
+ const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField);
- if( pAuthorField->GetFormat() != eFormat ||
- pAuthorField->GetType() != eType )
- {
- // #91225# Get current state of address, not the old one
- SvtUserOptions aUserOptions;
- pNewField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() );
- ( (SvxAuthorField*) pNewField )->SetType( eType );
- ( (SvxAuthorField*) pNewField )->SetFormat( eFormat );
+ if( pFileField )
+ {
+ SvxFileType eType;
+ SvxFileFormat eFormat;
+ sal_uInt16 i;
+
+ if( IsItemChecked( 1 ) )
+ eType = SVXFILETYPE_FIX;
+ else
+ eType = SVXFILETYPE_VAR;
+
+ for( i = 3; i <= nCount; i++ )
+ {
+ if( IsItemChecked( i ) )
+ break;
+ }
+ eFormat = (SvxFileFormat) ( i - 3 );
+
+ if( pFileField->GetFormat() != eFormat ||
+ pFileField->GetType() != eType )
+ {
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
+
+ if( pDocSh )
+ {
+ SvxExtFileField aFileField( *pFileField );
+
+ String aName;
+ if( pDocSh->HasName() )
+ aName = pDocSh->GetMedium()->GetName();
+
+ // #91225# Get current filename, not the one stored in the old field
+ pNewField = new SvxExtFileField( aName );
+ ( (SvxExtFileField*) pNewField )->SetType( eType );
+ ( (SvxExtFileField*) pNewField )->SetFormat( eFormat );
+ }
+ }
+ }
+ else
+ {
+ const SvxAuthorField* pAuthorField = dynamic_cast< const SvxAuthorField* >(pField);
+
+ if( pAuthorField )
+ {
+ SvxAuthorType eType;
+ SvxAuthorFormat eFormat;
+ sal_uInt16 i;
+
+ if( IsItemChecked( 1 ) )
+ eType = SVXAUTHORTYPE_FIX;
+ else
+ eType = SVXAUTHORTYPE_VAR;
+
+ for( i = 3; i <= nCount; i++ )
+ {
+ if( IsItemChecked( i ) )
+ break;
+ }
+ eFormat = (SvxAuthorFormat) ( i - 3 );
+
+ if( pAuthorField->GetFormat() != eFormat ||
+ pAuthorField->GetType() != eType )
+ {
+ // #91225# Get current state of address, not the old one
+ SvtUserOptions aUserOptions;
+ pNewField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() );
+ ( (SvxAuthorField*) pNewField )->SetType( eType );
+ ( (SvxAuthorField*) pNewField )->SetFormat( eFormat );
+ }
+ }
+ }
}
}
return( pNewField );
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index d49a373a7a87..02f4bf83bf1d 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -51,9 +51,6 @@
#include <svl/urlbmk.hxx>
#include <editeng/outliner.hxx>
-//#ifndef _SVDETC_HXX //autogen
-//#include <svx/svdetc.hxx>
-//#endif
#include <com/sun/star/form/FormButtonType.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <unotools/streamwrap.hxx>
@@ -76,6 +73,7 @@
#include "sdxfer.hxx"
#include "unomodel.hxx"
#include <vcl/virdev.hxx>
+#include <svx/svdlegacy.hxx>
// --------------
// - Namespaces -
@@ -99,7 +97,7 @@ using namespace ::com::sun::star::datatransfer::clipboard;
// - SdTransferable -
// ------------------
-SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, sal_Bool bInitOnGetData )
+SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, bool bInitOnGetData )
: mpPageDocShell( NULL )
, mpOLEDataHelper( NULL )
, mpObjDesc( NULL )
@@ -112,14 +110,13 @@ SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView,
, mpBookmark( NULL )
, mpGraphic( NULL )
, mpImageMap( NULL )
-, mbInternalMove( sal_False )
-, mbOwnDocument( sal_False )
-, mbOwnView( sal_False )
+, mbInternalMove( false )
+, mbOwnDocument( false )
+, mbOwnView( false )
, mbLateInit( bInitOnGetData )
-, mbPageTransferable( sal_False )
-, mbPageTransferablePersistent( sal_False )
+, mbPageTransferable( false )
+, mbPageTransferablePersistent( false )
, mbIsUnoObj( false )
-, maUserData()
{
if( mpSourceDoc )
StartListening( *mpSourceDoc );
@@ -185,20 +182,21 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
delete mpGraphic, mpGraphic = NULL;
delete mpBookmark, mpBookmark = NULL;
delete mpImageMap, mpImageMap = NULL;
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj);
- if( pObj->ISA( SdrOle2Obj ) )
+ if( pSdrOle2Obj )
{
try
{
- uno::Reference < embed::XEmbeddedObject > xObj = static_cast< SdrOle2Obj* >( pObj )->GetObjRef();
+ uno::Reference < embed::XEmbeddedObject > xObj = pSdrOle2Obj->GetObjRef();
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
if( xObj.is() && xPersist.is() && xPersist->hasEntry() )
{
- mpOLEDataHelper = new TransferableDataHelper( new SvEmbedTransferHelper( xObj, static_cast< SdrOle2Obj* >( pObj )->GetGraphic(), static_cast< SdrOle2Obj* >( pObj )->GetAspect() ) );
+ mpOLEDataHelper = new TransferableDataHelper( new SvEmbedTransferHelper( xObj, pSdrOle2Obj->GetGraphic(), pSdrOle2Obj->GetAspect() ) );
// TODO/LATER: the standalone handling of the graphic should not be used any more in future
// The EmbedDataHelper should bring the graphic in future
- Graphic* pObjGr = static_cast< SdrOle2Obj* >( pObj )->GetGraphic();
+ Graphic* pObjGr = pSdrOle2Obj->GetGraphic();
if ( pObjGr )
mpGraphic = new Graphic( *pObjGr );
}
@@ -206,68 +204,80 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
catch( uno::Exception& )
{}
}
- else if( pObj->ISA( SdrGrafObj ) && (mpSourceDoc && !mpSourceDoc->GetAnimationInfo( pObj )) )
- {
- mpGraphic = new Graphic( static_cast< SdrGrafObj* >( pObj )->GetTransformedGraphic() );
- }
- else if( pObj->IsUnoObj() && FmFormInventor == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == (sal_uInt16) OBJ_FM_BUTTON ) )
+ else
{
- SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pObj );
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pObj);
- if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
+ if( pSdrGrafObj && (mpSourceDoc && !mpSourceDoc->GetAnimationInfo( pObj )) )
{
- Reference< ::com::sun::star::awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel() );
+ mpGraphic = new Graphic( pSdrGrafObj->GetTransformedGraphic() );
+ }
+ else
+ {
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pObj );
- if( !xControlModel.is() )
- return;
+ if( pUnoCtrl && FmFormInventor == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == (sal_uInt16) OBJ_FM_BUTTON ) )
+ {
+ if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
+ {
+ Reference< ::com::sun::star::awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel() );
- Reference< ::com::sun::star::beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY );
+ if( !xControlModel.is() )
+ return;
- if( !xPropSet.is() )
- return;
+ Reference< ::com::sun::star::beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY );
- ::com::sun::star::form::FormButtonType eButtonType;
- Any aTmp( xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ) ) ) );
+ if( !xPropSet.is() )
+ return;
- if( aTmp >>= eButtonType )
- {
- ::rtl::OUString aLabel, aURL;
+ ::com::sun::star::form::FormButtonType eButtonType;
+ Any aTmp( xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ) ) ) );
- xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) ) ) >>= aLabel;
- xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TargetURL") ) ) >>= aURL;
+ if( aTmp >>= eButtonType )
+ {
+ ::rtl::OUString aLabel, aURL;
- mpBookmark = new INetBookmark( String( aURL ), String( aLabel ) );
- }
- }
- }
- else if( pObj->ISA( SdrTextObj ) )
- {
- const OutlinerParaObject* pPara;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" ) ) ) >>= aLabel;
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TargetURL") ) ) >>= aURL;
- if( (pPara = static_cast< SdrTextObj* >( pObj )->GetOutlinerParaObject()) != 0 )
- {
- const SvxFieldItem* pField;
-
- if( (pField = pPara->GetTextObject().GetField()) != 0 )
+ mpBookmark = new INetBookmark( String( aURL ), String( aLabel ) );
+ }
+ }
+ }
+ else
{
- const SvxFieldData* pData = pField->GetField();
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pObj);
- if( pData && pData->ISA( SvxURLField ) )
+ if( pSdrTextObj )
{
- const SvxURLField* pURL = (SvxURLField*) pData;
-
- mpBookmark = new INetBookmark( pURL->GetURL(), pURL->GetRepresentation() );
+ const OutlinerParaObject* pPara;
+
+ if( (pPara = pSdrTextObj->GetOutlinerParaObject()) != 0 )
+ {
+ const SvxFieldItem* pField;
+
+ if( (pField = pPara->GetTextObject().GetField()) != 0 )
+ {
+ const SvxURLField* pURL = dynamic_cast< const SvxURLField* >(pField->GetField());
+
+ if( pURL )
+ {
+ mpBookmark = new INetBookmark( pURL->GetURL(), pURL->GetRepresentation() );
+ }
+ }
+ }
}
}
}
}
- SdIMapInfo* pInfo = static_cast< SdDrawDocument* >( pObj->GetModel() )->GetIMapInfo( static_cast< SdrObject* >( pObj ) );
+ SdDrawDocument& rSdDrawDocument = dynamic_cast< SdDrawDocument& >( pObj->getSdrModelFromSdrObject() );
+ SdIMapInfo* pInfo = rSdDrawDocument.GetIMapInfo(pObj);
if( pInfo )
mpImageMap = new ImageMap( pInfo->GetImageMap() );
- mbIsUnoObj = pObj && pObj->IsUnoObj();
+ mbIsUnoObj = pObj && pObj->IsSdrUnoObj();
}
}
@@ -277,7 +287,7 @@ void SdTransferable::CreateData()
{
if( mpSdDrawDocument && !mpSdViewIntern )
{
- mbOwnView = sal_True;
+ mbOwnView = true;
SdPage* pPage = mpSdDrawDocument->GetSdPage(0, PK_STANDARD);
@@ -285,19 +295,18 @@ void SdTransferable::CreateData()
CreateObjectReplacement( pPage->GetObj( 0 ) );
mpVDev = new VirtualDevice( *Application::GetDefaultDevice() );
- mpVDev->SetMapMode( MapMode( mpSdDrawDocumentIntern->GetScaleUnit(), Point(), mpSdDrawDocumentIntern->GetScaleFraction(), mpSdDrawDocumentIntern->GetScaleFraction() ) );
- mpSdViewIntern = new ::sd::View( mpSdDrawDocumentIntern, mpVDev );
+ mpVDev->SetMapMode( MapMode( mpSdDrawDocumentIntern->GetExchangeObjectUnit(), Point(), mpSdDrawDocumentIntern->GetExchangeObjectScale(), mpSdDrawDocumentIntern->GetExchangeObjectScale() ) );
+ mpSdViewIntern = new ::sd::View( *mpSdDrawDocumentIntern, mpVDev );
mpSdViewIntern->EndListening(*mpSdDrawDocumentIntern );
- mpSdViewIntern->hideMarkHandles();
- SdrPageView* pPageView = mpSdViewIntern->ShowSdrPage(pPage);
- ((SdrMarkView*)mpSdViewIntern)->MarkAllObj(pPageView);
+ mpSdViewIntern->ShowSdrPage(*pPage);
+ ((SdrMarkView*)mpSdViewIntern)->MarkAllObj();
}
else if( mpSdView && !mpSdDrawDocumentIntern )
{
- const SdrMarkList& rMarkList = mpSdView->GetMarkedObjectList();
+ SdrObject* pSelected(mpSdView->getSelectedIfSingle());
- if( rMarkList.GetMarkCount() == 1 )
- CreateObjectReplacement( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
+ if( pSelected )
+ CreateObjectReplacement( pSelected );
if( mpSourceDoc )
mpSourceDoc->CreatingDataObj(this);
@@ -311,19 +320,18 @@ void SdTransferable::CreateData()
if( !maDocShellRef.Is() )
{
DBG_ERROR( "SdTransferable::CreateData(), failed to create a model with persist, clipboard operation will fail for OLE objects!" );
- mbOwnDocument = sal_True;
+ mbOwnDocument = true;
}
// Groesse der Source-Seite uebernehmen
SdrPageView* pPgView = mpSdView->GetSdrPageView();
- SdPage* pOldPage = (SdPage*) pPgView->GetPage();
- SdrModel* pOldModel = mpSdView->GetModel();
- SdStyleSheetPool* pOldStylePool = (SdStyleSheetPool*) pOldModel->GetStyleSheetPool();
+ SdPage* pOldPage = pPgView ? (SdPage*) &pPgView->getSdrPageFromSdrPageView() : 0;
+ SdStyleSheetPool* pOldStylePool = (SdStyleSheetPool*) mpSdView->getSdrModelFromSdrView().GetStyleSheetPool();
SdStyleSheetPool* pNewStylePool = (SdStyleSheetPool*) mpSdDrawDocumentIntern->GetStyleSheetPool();
SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PK_STANDARD );
String aOldLayoutName( pOldPage->GetLayoutName() );
- pPage->SetSize( pOldPage->GetSize() );
+ pPage->SetPageScale( pOldPage->GetPageScale() );
pPage->SetLayoutName( aOldLayoutName );
pNewStylePool->CopyGraphicSheets( *pOldStylePool );
pNewStylePool->CopyCellSheets( *pOldStylePool );
@@ -340,32 +348,39 @@ void SdTransferable::CreateData()
{
SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PK_STANDARD );
- if( 1 == mpSdDrawDocumentIntern->GetPageCount() )
+ if(1 == mpSdDrawDocumentIntern->GetPageCount())
{
- // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get
- // fat lines correctly
- Point aOrigin( ( maVisArea = mpSdViewIntern->GetAllMarkedBoundRect() ).TopLeft() );
- Size aVector( -aOrigin.X(), -aOrigin.Y() );
+ const basegfx::B2DRange aAllRange(mpSdViewIntern->getMarkedObjectSnapRange());
+ const basegfx::B2DHomMatrix aTranslate(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ -aAllRange.getMinimum()));
- for( sal_uLong nObj = 0, nObjCount = pPage->GetObjCount(); nObj < nObjCount; nObj++ )
+ for(sal_uInt32 nObj(0), nObjCount = pPage->GetObjCount(); nObj < nObjCount; nObj++)
{
- SdrObject* pObj = pPage->GetObj( nObj );
- pObj->NbcMove( aVector );
+ SdrObject* pObj = pPage->GetObj(nObj);
+
+ sdr::legacy::transformSdrObject(*pObj, aTranslate);
}
+
+ maVisArea.SetSize(Size(basegfx::fround(aAllRange.getWidth()), basegfx::fround(aAllRange.getHeight())));
}
else
- maVisArea.SetSize( pPage->GetSize() );
+ {
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
+
+ maVisArea.SetSize(Size(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY())));
+ }
// Die Ausgabe soll am Nullpunkt erfolgen
- maVisArea.SetPos( Point() );
+ maVisArea.SetPos(Point());
}
}
// -----------------------------------------------------------------------------
-sal_Bool lcl_HasOnlyControls( SdrModel* pModel )
+bool lcl_HasOnlyControls( SdrModel* pModel )
{
- sal_Bool bOnlyControls = sal_False; // default if there are no objects
+ bool bOnlyControls = false; // default if there are no objects
if ( pModel )
{
@@ -376,12 +391,12 @@ sal_Bool lcl_HasOnlyControls( SdrModel* pModel )
SdrObject* pObj = aIter.Next();
if ( pObj )
{
- bOnlyControls = sal_True; // only set if there are any objects at all
+ bOnlyControls = true; // only set if there are any objects at all
while ( pObj )
{
- if (!pObj->ISA(SdrUnoObj))
+ if (!dynamic_cast< SdrUnoObj* >(pObj))
{
- bOnlyControls = sal_False;
+ bOnlyControls = false;
break;
}
pObj = aIter.Next();
@@ -546,12 +561,12 @@ sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor )
else if( nFormat == FORMAT_GDIMETAFILE )
{
if( mpSdViewIntern )
- bOK = SetGDIMetaFile( mpSdViewIntern->GetMarkedObjMetaFile(true), rFlavor );
+ bOK = SetGDIMetaFile(mpSdViewIntern->GetMarkedObjMetaFile(true), rFlavor);
}
else if( nFormat == FORMAT_BITMAP )
{
if( mpSdViewIntern )
- bOK = SetBitmap( mpSdViewIntern->GetMarkedObjBitmapEx(true).GetBitmap(), rFlavor );
+ bOK = SetBitmap(mpSdViewIntern->GetMarkedObjBitmapEx(true).GetBitmap(), rFlavor);
}
else if( ( nFormat == FORMAT_STRING ) && mpBookmark )
{
@@ -584,9 +599,9 @@ sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor )
maDocShellRef = new ::sd::DrawDocShell(
mpSdDrawDocumentIntern,
SFX_CREATE_MODE_EMBEDDED,
- sal_True,
+ true,
mpSdDrawDocumentIntern->GetDocumentType());
- mbOwnDocument = sal_False;
+ mbOwnDocument = false;
maDocShellRef->DoInitNew( NULL );
}
@@ -603,10 +618,6 @@ sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor )
// -----------------------------------------------------------------------------
-/* testcode
-#include <sfx2/docfile.hxx>
-*/
-
sal_Bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject, sal_uInt32 nObjectType, const DataFlavor& )
{
sal_Bool bRet = sal_False;
@@ -617,7 +628,7 @@ sal_Bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject
{
try
{
- static const sal_Bool bDontBurnInStyleSheet = ( getenv( "AVOID_BURN_IN_FOR_GALLERY_THEME" ) != NULL );
+ static const bool bDontBurnInStyleSheet = ( getenv( "AVOID_BURN_IN_FOR_GALLERY_THEME" ) != NULL );
SdDrawDocument* pDoc = (SdDrawDocument*) pObject;
if ( !bDontBurnInStyleSheet )
pDoc->BurnInStyleSheetAttributes();
@@ -632,24 +643,13 @@ sal_Bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject
rxOStm->Commit();
}
- /* testcode
- {
- const rtl::OUString aURL( RTL_CONSTASCII_USTRINGPARAM( "file:///e:/test.xml" ) );
- SfxMedium aMedium( aURL, STREAM_WRITE | STREAM_TRUNC, sal_True );
- aMedium.IsRemote();
- com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xDocOut( new utl::OOutputStreamWrapper( *aMedium.GetOutStream() ) );
- if( SvxDrawingLayerExport( pDoc, xDocOut, xComponent, (pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) ? "com.sun.star.comp.Impress.XMLClipboardExporter" : "com.sun.star.comp.DrawingLayer.XMLExporter" ) )
- aMedium.Commit();
- }
- */
-
xComponent->dispose();
bRet = ( rxOStm->GetError() == ERRCODE_NONE );
}
catch( Exception& )
{
DBG_ERROR( "sd::SdTransferable::WriteObject(), exception catched!" );
- bRet = sal_False;
+ bRet = false;
}
}
break;
@@ -669,7 +669,7 @@ sal_Bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject
pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, sal_False );
// mba: no relative ULRs for clipboard!
SfxMedium aMedium( xWorkStore, String() );
- bRet = pEmbObj->DoSaveObjectAs( aMedium, sal_False );
+ bRet = pEmbObj->DoSaveObjectAs( aMedium, false );
pEmbObj->DoSaveCompleted();
uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY );
@@ -684,7 +684,7 @@ sal_Bool SdTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pObject
delete pSrcStm;
}
- bRet = sal_True;
+ bRet = true;
rxOStm->Commit();
}
catch ( Exception& )
@@ -733,7 +733,7 @@ void SdTransferable::SetObjectDescriptor( const TransferableObjectDescriptor& rO
// -----------------------------------------------------------------------------
-void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPersistent )
+void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, bool bPersistent )
{
if( mpSourceDoc )
{
@@ -741,7 +741,7 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer
mpSdViewIntern->HideSdrPage();
// #116168#
- mpSdDrawDocument->ClearModel(sal_False);
+ mpSdDrawDocument->ClearModel(false);
mpPageDocShell = NULL;
@@ -751,7 +751,7 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer
if( bPersistent )
{
mpSdDrawDocument->CreateFirstPages(mpSourceDoc);
- mpSdDrawDocument->InsertBookmarkAsPage( const_cast< List* >( &rPageBookmarks ), NULL, sal_False, sal_True, 1, sal_True, mpSourceDoc->GetDocSh(), sal_True, sal_True, sal_False );
+ mpSdDrawDocument->InsertBookmarkAsPage( const_cast< List* >( &rPageBookmarks ), NULL, false, true, 1, true, mpSourceDoc->GetDocSh(), true, true, false );
}
else
{
@@ -767,13 +767,13 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer
if( pPage )
{
- ( (SdrMarkView*) mpSdViewIntern )->MarkAllObj( (SdrPageView*) mpSdViewIntern->ShowSdrPage( pPage ) );
+ mpSdViewIntern->ShowSdrPage(*pPage);
+ mpSdViewIntern->MarkAllObj();
}
}
- // set flags for page transferable; if ( mbPageTransferablePersistent == sal_False ),
// don't offer any formats => it's just for internal puposes
- mbPageTransferable = sal_True;
+ mbPageTransferable = true;
mbPageTransferablePersistent = bPersistent;
}
}
@@ -797,40 +797,35 @@ sal_Int64 SAL_CALL SdTransferable::getSomething( const ::com::sun::star::uno::Se
return nRet;
}
-
-
+// -----------------------------------------------------------------------------
SdDrawDocument* SdTransferable::GetSourceDoc (void) const
{
return mpSourceDoc;
}
-
-
+// -----------------------------------------------------------------------------
void SdTransferable::AddUserData (const ::boost::shared_ptr<UserData>& rpData)
{
maUserData.push_back(rpData);
}
-
-
+// -----------------------------------------------------------------------------
void SdTransferable::RemoveUserData (const ::boost::shared_ptr<UserData>& rpData)
{
maUserData.erase(::std::find(maUserData.begin(), maUserData.end(), rpData));
}
-
-
+// -----------------------------------------------------------------------------
sal_Int32 SdTransferable::GetUserDataCount (void) const
{
return maUserData.size();
}
-
-
+// -----------------------------------------------------------------------------
::boost::shared_ptr<SdTransferable::UserData> SdTransferable::GetUserData (const sal_Int32 nIndex) const
{
@@ -840,9 +835,6 @@ sal_Int32 SdTransferable::GetUserDataCount (void) const
return ::boost::shared_ptr<UserData>();
}
-
-
-
// -----------------------------------------------------------------------------
const ::com::sun::star::uno::Sequence< sal_Int8 >& SdTransferable::getUnoTunnelId()
@@ -881,10 +873,11 @@ SdTransferable* SdTransferable::getImplementation( const Reference< XInterface >
// SfxListener
void SdTransferable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >( &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >( &rHint );
+
if( pSdrHint )
{
- if( HINT_MODELCLEARED == pSdrHint->GetKind() )
+ if( HINT_MODELCLEARED == pSdrHint->GetSdrHintKind() )
{
EndListening(*mpSourceDoc);
mpSourceDoc = 0;
diff --git a/sd/source/ui/app/tbxww.cxx b/sd/source/ui/app/tbxww.cxx
index c1aebc8a3550..bc5e2c9675bb 100644
--- a/sd/source/ui/app/tbxww.cxx
+++ b/sd/source/ui/app/tbxww.cxx
@@ -284,7 +284,7 @@ void SdTbxControl::StateChanged( sal_uInt16 nSId,
if( eState == SFX_ITEM_AVAILABLE )
{
- TbxImageItem* pItem = PTR_CAST( TbxImageItem, pState );
+ const TbxImageItem* pItem = dynamic_cast< const TbxImageItem* >(pState );
//DBG_ASSERT( pItem, "TbxImageItem erwartet!" );
// Im StarDesktop kann jetzt auch ein anderes Item ankommen,
// das nicht ausgewertet werden darf (#33802# und #33838#)
@@ -295,7 +295,7 @@ void SdTbxControl::StateChanged( sal_uInt16 nSId,
if( nImage == 0 )
{
if( rTbx.IsItemChecked( nSId ) )
- rTbx.CheckItem( nSId, sal_False );
+ rTbx.CheckItem( nSId, false );
}
else
{
@@ -319,28 +319,28 @@ void SdTbxControl::StateChanged( sal_uInt16 nSId,
{
if( nSId != SID_OBJECT_CHOOSE_MODE &&
rTbx.IsItemChecked( SID_OBJECT_CHOOSE_MODE ) )
- rTbx.CheckItem( SID_OBJECT_CHOOSE_MODE, sal_False );
+ rTbx.CheckItem( SID_OBJECT_CHOOSE_MODE, false );
if( nSId != SID_DRAWTBX_TEXT &&
rTbx.IsItemChecked( SID_DRAWTBX_TEXT ) )
- rTbx.CheckItem( SID_DRAWTBX_TEXT, sal_False );
+ rTbx.CheckItem( SID_DRAWTBX_TEXT, false );
if( nSId != SID_DRAWTBX_RECTANGLES &&
rTbx.IsItemChecked( SID_DRAWTBX_RECTANGLES ) )
- rTbx.CheckItem( SID_DRAWTBX_RECTANGLES, sal_False );
+ rTbx.CheckItem( SID_DRAWTBX_RECTANGLES, false );
if( nSId != SID_DRAWTBX_ELLIPSES &&
rTbx.IsItemChecked( SID_DRAWTBX_ELLIPSES ) )
- rTbx.CheckItem( SID_DRAWTBX_ELLIPSES, sal_False );
+ rTbx.CheckItem( SID_DRAWTBX_ELLIPSES, false );
if( nSId != SID_DRAWTBX_LINES &&
rTbx.IsItemChecked( SID_DRAWTBX_LINES ) )
- rTbx.CheckItem( SID_DRAWTBX_LINES, sal_False );
+ rTbx.CheckItem( SID_DRAWTBX_LINES, false );
if( nSId != SID_DRAWTBX_ARROWS &&
rTbx.IsItemChecked( SID_DRAWTBX_ARROWS ) )
- rTbx.CheckItem( SID_DRAWTBX_ARROWS, sal_False );
+ rTbx.CheckItem( SID_DRAWTBX_ARROWS, false );
if( nSId != SID_DRAWTBX_3D_OBJECTS &&
rTbx.IsItemChecked( SID_DRAWTBX_3D_OBJECTS ) )
- rTbx.CheckItem( SID_DRAWTBX_3D_OBJECTS, sal_False );
+ rTbx.CheckItem( SID_DRAWTBX_3D_OBJECTS, false );
if( nSId != SID_DRAWTBX_CONNECTORS &&
rTbx.IsItemChecked( SID_DRAWTBX_CONNECTORS ) )
- rTbx.CheckItem( SID_DRAWTBX_CONNECTORS, sal_False );
+ rTbx.CheckItem( SID_DRAWTBX_CONNECTORS, false );
}
}
}
@@ -350,7 +350,7 @@ void SdTbxControl::StateChanged( sal_uInt16 nSId,
/*-------------------------------------------------------------------------*/
-sal_Bool SdTbxControl::IsCheckable( sal_uInt16 nSId )
+bool SdTbxControl::IsCheckable( sal_uInt16 nSId )
{
switch( nSId )
{
@@ -459,9 +459,9 @@ sal_Bool SdTbxControl::IsCheckable( sal_uInt16 nSId )
//case SID_ZOOM_OUT:
- return( sal_True );
+ return( true );
}
- return( sal_False );
+ return( false );
}
diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx
index 3bded51c997f..455fc1f0670d 100644
--- a/sd/source/ui/app/tmplctrl.cxx
+++ b/sd/source/ui/app/tmplctrl.cxx
@@ -91,12 +91,19 @@ SdTemplateControl::~SdTemplateControl()
void SdTemplateControl::StateChanged(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
- if( eState != SFX_ITEM_AVAILABLE || pState->ISA( SfxVoidItem ) )
+ if( eState != SFX_ITEM_AVAILABLE || dynamic_cast< const SfxVoidItem* >(pState) )
+ {
GetStatusBar().SetItemText( GetId(), String() );
- else if ( pState->ISA( SfxStringItem ) )
+ }
+ else
{
- msTemplate = ((SfxStringItem*)pState)->GetValue();
- GetStatusBar().SetItemText( GetId(), msTemplate );
+ const SfxStringItem* pSfxStringItem = dynamic_cast< const SfxStringItem* >(pState);
+
+ if ( pSfxStringItem )
+ {
+ msTemplate = pSfxStringItem->GetValue();
+ GetStatusBar().SetItemText( GetId(), msTemplate );
+ }
}
}
@@ -126,10 +133,10 @@ void SdTemplateControl::Command( const CommandEvent& rCEvt )
CaptureMouse();
TemplatePopup_Impl aPop;
{
- const sal_uInt16 nMasterCount = pDoc->GetMasterSdPageCount(PK_STANDARD);
+ const sal_uInt32 nMasterCount = pDoc->GetMasterSdPageCount(PK_STANDARD);
- sal_uInt16 nCount = 0;
- for( sal_uInt16 nPage = 0; nPage < nMasterCount; ++nPage )
+ sal_uInt32 nCount = 0;
+ for( sal_uInt32 nPage = 0; nPage < nMasterCount; ++nPage )
{
SdPage* pMaster = pDoc->GetMasterSdPage(nPage, PK_STANDARD);
if( pMaster )
@@ -137,7 +144,7 @@ void SdTemplateControl::Command( const CommandEvent& rCEvt )
}
aPop.Execute( &GetStatusBar(), rCEvt.GetMousePosPixel());
- sal_uInt16 nCurrId = aPop.GetCurId()-1;
+ sal_uInt32 nCurrId = aPop.GetCurId()-1;
if( nCurrId < nMasterCount )
{
SdPage* pMaster = pDoc->GetMasterSdPage(nCurrId, PK_STANDARD);
diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx
index a85d60010a8e..33ac58eaf66b 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.cxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.cxx
@@ -243,7 +243,7 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
mpLayoutSet2->SetSelectHdl( LINK( this, LayoutToolbarMenu, SelectHdl ) );
mpLayoutSet2->SetColCount( 4 );
- mpLayoutSet2->EnableFullItemMode( sal_False );
+ mpLayoutSet2->EnableFullItemMode( false );
mpLayoutSet2->SetColor( GetControlBackground() );
fillLayoutValueSet( mpLayoutSet2, &v_standard[0], bHighContrast );
@@ -269,7 +269,7 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
sSlotStr = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DuplicatePage" ) );
else
sSlotStr = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Undo" ) );
- aSlotImage = ::GetImage( mxFrame, sSlotStr, sal_False, bHighContrast );
+ aSlotImage = ::GetImage( mxFrame, sSlotStr, false, bHighContrast );
String sSlotTitle;
if( bInsertPage )
diff --git a/sd/source/ui/dlg/AnimationChildWindow.cxx b/sd/source/ui/dlg/AnimationChildWindow.cxx
index dff4fcbd48eb..7440e4b66f62 100644
--- a/sd/source/ui/dlg/AnimationChildWindow.cxx
+++ b/sd/source/ui/dlg/AnimationChildWindow.cxx
@@ -71,7 +71,7 @@ AnimationChildWindow::AnimationChildWindow(
pAnimWin->aFltWinSize = pWindow->GetSizePixel();
*/
- SetHideNotDelete( sal_True );
+ SetHideNotDelete( true );
}
} // end of namespace sd
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 1b5436309bb9..6b968b17cfc8 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -108,7 +108,7 @@ void LayerTabBar::Select()
void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bSetPageID=sal_False;
+ bool bSetPageID=false;
if (rMEvt.IsLeft() && !rMEvt.IsMod1() && !rMEvt.IsMod2())
{
@@ -120,16 +120,20 @@ void LayerTabBar::MouseButtonDown(const MouseEvent& rMEvt)
SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher();
pDispatcher->Execute(SID_INSERTLAYER, SFX_CALLMODE_SYNCHRON);
- bSetPageID=sal_True;
+ bSetPageID=true;
}
else if (rMEvt.IsShift())
{
// Toggle zw. Layer sichtbar / unsichtbar
String aName(GetPageText(aLayerId));
SdrPageView* pPV = pDrViewSh->GetView()->GetSdrPageView();
- sal_Bool bVisible = pPV->IsLayerVisible(aName);
- pPV->SetLayerVisible(aName, !bVisible);
- pDrViewSh->ResetActualLayer();
+
+ if(pPV)
+ {
+ bool bVisible = pPV->IsLayerVisible(aName);
+ pPV->SetLayerVisible(aName, !bVisible);
+ pDrViewSh->ResetActualLayer();
+ }
}
}
@@ -168,11 +172,11 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt )
if( !pDrViewSh->GetDocSh()->IsReadOnly() )
{
- sal_uInt16 nPageId = SDRPAGE_NOTFOUND;
- Point aPos( PixelToLogic( rEvt.maPosPixel ) );
- sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc()->GetLayerAdmin().GetLayerID( GetPageText( GetPageId( aPos ) ), sal_False );
+ const sal_uInt32 nPageId(SDRPAGE_NOTFOUND);
+ const Point aPos( PixelToLogic( rEvt.maPosPixel ) );
+ const SdrLayerID aLayerId(pDrViewSh->GetView()->GetDoc()->GetModelLayerAdmin().GetLayerID( GetPageText( GetPageId( aPos ) ), false ));
- nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, nPageId, nLayerId );
+ nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, nPageId, aLayerId );
SwitchPage( aPos );
}
@@ -188,9 +192,9 @@ sal_Int8 LayerTabBar::AcceptDrop( const AcceptDropEvent& rEvt )
sal_Int8 LayerTabBar::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
- sal_uInt16 nPageId = SDRPAGE_NOTFOUND;
- sal_uInt16 nLayerId = pDrViewSh->GetView()->GetDoc()->GetLayerAdmin().GetLayerID( GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ), sal_False );
- sal_Int8 nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, nPageId, nLayerId );
+ const sal_uInt32 nPageId(SDRPAGE_NOTFOUND);
+ const SdrLayerID aLayerId(pDrViewSh->GetView()->GetDoc()->GetModelLayerAdmin().GetLayerID( GetPageText( GetPageId( PixelToLogic( rEvt.maPosPixel ) ) ), false ));
+ sal_Int8 nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, nPageId, aLayerId );
EndSwitchPage();
@@ -217,7 +221,7 @@ void LayerTabBar::Command(const CommandEvent& rCEvt)
\************************************************************************/
long LayerTabBar::StartRenaming()
{
- sal_Bool bOK = sal_True;
+ bool bOK = true;
String aLayerName = GetPageText( GetEditPageId() );
String aLayoutLayer ( SdResId(STR_LAYER_LAYOUT) );
String aControlsLayer ( SdResId(STR_LAYER_CONTROLS) );
@@ -230,7 +234,7 @@ long LayerTabBar::StartRenaming()
aLayerName == aBackgroundLayer || aLayerName == aBackgroundObjLayer )
{
// Diese Namen duerfen nicht veraendert werden
- bOK = sal_False;
+ bOK = false;
}
else
{
@@ -251,23 +255,23 @@ long LayerTabBar::StartRenaming()
long LayerTabBar::AllowRenaming()
{
- sal_Bool bOK = sal_True;
+ bool bOK = true;
// Ueberpruefung auf schon vorhandene Namen
::sd::View* pView = pDrViewSh->GetView();
SdDrawDocument* pDoc = pView->GetDoc();
String aLayerName = pView->GetActiveLayer();
- SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = pDoc->GetModelLayerAdmin();
String aNewName( GetEditText() );
if ( aNewName.Len() == 0 ||
- (rLayerAdmin.GetLayer( aNewName, sal_False ) && aLayerName != aNewName) )
+ (rLayerAdmin.GetLayer( aNewName, false ) && aLayerName != aNewName) )
{
// Name ist schon vorhanden
WarningBox aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ),
String(SdResId( STR_WARN_NAME_DUPLICATE ) ) );
aWarningBox.Execute();
- bOK = sal_False;
+ bOK = false;
}
if (bOK)
@@ -283,7 +287,7 @@ long LayerTabBar::AllowRenaming()
aNewName == aBackgroundLayer || aNewName == aBackgroundObjLayer )
{
// Diese Namen duerfen nicht vergeben werden
- bOK = sal_False;
+ bOK = false;
}
}
@@ -299,12 +303,12 @@ void LayerTabBar::EndRenaming()
if( !IsEditModeCanceled() )
{
::sd::View* pView = pDrViewSh->GetView();
- DrawView* pDrView = PTR_CAST( DrawView, pView );
+ DrawView* pDrView = dynamic_cast< DrawView* >(pView );
SdDrawDocument* pDoc = pView->GetDoc();
String aLayerName = pView->GetActiveLayer();
- SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
- SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, sal_False);
+ SdrLayerAdmin& rLayerAdmin = pDoc->GetModelLayerAdmin();
+ SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, false);
if (pLayer)
{
@@ -338,7 +342,7 @@ void LayerTabBar::EndRenaming()
// schon bekannt sein muss.
pView->SetActiveLayer(aNewName);
pLayer->SetName(aNewName);
- pDoc->SetChanged(sal_True);
+ pDoc->SetChanged(true);
}
}
}
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx
index 92067843a1d0..37605f04ec4a 100644
--- a/sd/source/ui/dlg/PaneChildWindows.cxx
+++ b/sd/source/ui/dlg/PaneChildWindows.cxx
@@ -74,7 +74,7 @@ PaneChildWindow::PaneChildWindow (
String( SdResId( nTitleBarResId ) ) );
eChildAlignment = eAlignment;
static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
- SetHideNotDelete(sal_True);
+ SetHideNotDelete(true);
ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
if (pBase != NULL)
diff --git a/sd/source/ui/dlg/PaneShells.cxx b/sd/source/ui/dlg/PaneShells.cxx
index 199aa1a4dc83..9eeb75c16018 100644
--- a/sd/source/ui/dlg/PaneShells.cxx
+++ b/sd/source/ui/dlg/PaneShells.cxx
@@ -49,10 +49,6 @@ SFX_IMPL_INTERFACE(LeftImpressPaneShell, SfxShell, SdResId(STR_LEFT_IMPRESS_PANE
::sd::LeftPaneImpressChildWindow::GetChildWindowId());
}
-TYPEINIT1(LeftImpressPaneShell, SfxShell);
-
-
-
LeftImpressPaneShell::LeftImpressPaneShell (void)
: SfxShell()
{
@@ -85,10 +81,6 @@ SFX_IMPL_INTERFACE(LeftDrawPaneShell, SfxShell, SdResId(STR_LEFT_DRAW_PANE_SHELL
::sd::LeftPaneDrawChildWindow::GetChildWindowId());
}
-TYPEINIT1(LeftDrawPaneShell, SfxShell);
-
-
-
LeftDrawPaneShell::LeftDrawPaneShell (void)
: SfxShell()
{
@@ -120,8 +112,6 @@ SFX_IMPL_INTERFACE( ToolPanelPaneShell, SfxShell, SdResId( STR_TOOL_PANEL_SHELL
SFX_CHILDWINDOW_REGISTRATION( ::sd::ToolPanelChildWindow::GetChildWindowId() );
}
-TYPEINIT1( ToolPanelPaneShell, SfxShell );
-
ToolPanelPaneShell::ToolPanelPaneShell()
:SfxShell()
{
diff --git a/sd/source/ui/dlg/SpellDialogChildWindow.cxx b/sd/source/ui/dlg/SpellDialogChildWindow.cxx
index 29ef7eca3e5d..6dd724c28272 100644
--- a/sd/source/ui/dlg/SpellDialogChildWindow.cxx
+++ b/sd/source/ui/dlg/SpellDialogChildWindow.cxx
@@ -106,7 +106,7 @@ void SpellDialogChildWindow::InvalidateSpellDialog (void)
// check.
if (aResult.empty())
{
- SfxBoolItem aItem (SID_SPELL_DIALOG, sal_False);
+ SfxBoolItem aItem (SID_SPELL_DIALOG, false);
GetBindings().GetDispatcher()->Execute(
SID_SPELL_DIALOG,
SFX_CALLMODE_ASYNCHRON,
@@ -157,7 +157,7 @@ void SpellDialogChildWindow::LoseFocus()
void SpellDialogChildWindow::ProvideOutliner (void)
{
- ViewShellBase* pViewShellBase = PTR_CAST (ViewShellBase, SfxViewShell::Current());
+ ViewShellBase* pViewShellBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current());
if (pViewShellBase != NULL)
{
@@ -165,8 +165,8 @@ void SpellDialogChildWindow::ProvideOutliner (void)
// If there already exists an outliner that has been created
// for another view shell then destroy it first.
if (mpSdOutliner != NULL)
- if ((pViewShell->ISA(DrawViewShell) && ! mbOwnOutliner)
- || (pViewShell->ISA(OutlineViewShell) && mbOwnOutliner))
+ if ((dynamic_cast< DrawViewShell* >(pViewShell) && ! mbOwnOutliner)
+ || (dynamic_cast< OutlineViewShell* >(pViewShell) && mbOwnOutliner))
{
mpSdOutliner->EndSpelling();
if (mbOwnOutliner)
@@ -177,7 +177,7 @@ void SpellDialogChildWindow::ProvideOutliner (void)
// Now create/get an outliner if none is present.
if (mpSdOutliner == NULL)
{
- if (pViewShell->ISA(DrawViewShell))
+ if (dynamic_cast< DrawViewShell* >(pViewShell))
{
// We need an outliner for the spell check so we have
// to create one.
@@ -186,7 +186,7 @@ void SpellDialogChildWindow::ProvideOutliner (void)
pViewShell->GetDoc(),
OUTLINERMODE_TEXTOBJECT);
}
- else if (pViewShell->ISA(OutlineViewShell))
+ else if (dynamic_cast< OutlineViewShell* >(pViewShell))
{
// An outline view is already visible. The SdOutliner
// will use it instead of creating its own.
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 49d193ff3eba..20035efa7b5d 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -50,13 +50,11 @@
#include "sdpage.hxx"
#include "res_bmp.hrc"
#include "ViewShell.hxx"
-
-#ifndef _SV_SVAPP_HXX_
#include <vcl/svapp.hxx>
-#endif
-
#include <string>
#include <algorithm>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdetc.hxx>
using namespace ::com::sun::star;
@@ -132,8 +130,8 @@ void SdDisplay::DataChanged( const DataChangedEvent& rDCEvt )
const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
SetBackground( Wallpaper( Color( rStyles.GetFieldColor() ) ) );
SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode()
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR );
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR );
}
}
@@ -170,8 +168,8 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings,
pWin ( pParent ),
pBitmapEx ( NULL ),
- bMovie ( sal_False ),
- bAllObjects ( sal_False ),
+ bMovie ( false ),
+ bAllObjects ( false ),
pBindings ( pInBindings )
{
@@ -185,7 +183,7 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings,
// neues Dokument mit Seite erzeugen
pMyDoc = new SdDrawDocument(DOCUMENT_TYPE_IMPRESS, NULL);
- SdPage* pPage = (SdPage*) pMyDoc->AllocPage(sal_False);
+ SdPage* pPage = (SdPage*) pMyDoc->AllocPage(false);
pMyDoc->InsertPage(pPage);
pControllerItem = new AnimationControllerItem( SID_ANIMATOR_STATE, this, pBindings );
@@ -265,7 +263,7 @@ IMPL_LINK( AnimationWindow, ClickFirstHdl, void *, EMPTYARG )
IMPL_LINK( AnimationWindow, ClickStopHdl, void *, EMPTYARG )
{
- bMovie = sal_False;
+ bMovie = false;
return( 0L );
}
@@ -275,15 +273,15 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p )
{
ScopeLockGuard aGuard( maPlayLock );
- bMovie = sal_True;
- sal_Bool bDisableCtrls = sal_False;
+ bMovie = true;
+ bool bDisableCtrls = false;
sal_uLong nCount = aBmpExList.Count();
- sal_Bool bReverse = p == &aBtnReverse;
+ bool bReverse = p == &aBtnReverse;
// Kann spaeter schwer ermittelt werden
- sal_Bool bRbtGroupEnabled = aRbtGroup.IsEnabled();
- sal_Bool bBtnGetAllObjectsEnabled = aBtnGetAllObjects.IsEnabled();
- sal_Bool bBtnGetOneObjectEnabled = aBtnGetOneObject.IsEnabled();
+ bool bRbtGroupEnabled = aRbtGroup.IsEnabled();
+ bool bBtnGetAllObjectsEnabled = aBtnGetAllObjects.IsEnabled();
+ bool bBtnGetOneObjectEnabled = aBtnGetOneObject.IsEnabled();
// Gesamtzeit ermitteln
Time aTime( 0 );
@@ -304,7 +302,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p )
SfxProgress* pProgress = NULL;
if( nFullTime >= 1000 )
{
- bDisableCtrls = sal_True;
+ bDisableCtrls = true;
aBtnStop.Enable();
aBtnStop.Update();
String aStr( RTL_CONSTASCII_USTRINGPARAM( "Animator:" ) ); // Hier sollte man sich noch etwas gescheites ausdenken!
@@ -313,7 +311,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p )
sal_uLong nTmpTime = 0;
long i = 0;
- sal_Bool bCount = i < (long) nCount;
+ bool bCount = i < (long) nCount;
if( bReverse )
{
i = nCount - 1;
@@ -368,7 +366,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, void *, p )
}
// Um die Controls wieder zu enablen
- bMovie = sal_False;
+ bMovie = false;
if (nCount > 0)
UpdateControl(i);
@@ -403,8 +401,8 @@ IMPL_LINK( AnimationWindow, ClickRbtHdl, void *, p )
if( !pBitmapEx || p == &aRbtGroup || aRbtGroup.IsChecked() )
{
aTimeField.SetText( String() );
- aTimeField.Enable( sal_False );
- aLbLoopCount.Enable( sal_False );
+ aTimeField.Enable( false );
+ aLbLoopCount.Enable( false );
}
else if( p == &aRbtBitmap || aRbtBitmap.IsChecked() )
{
@@ -429,7 +427,7 @@ IMPL_LINK( AnimationWindow, ClickGetObjectHdl, void *, pBtn )
bAllObjects = pBtn == &aBtnGetAllObjects;
// Code jetzt in AddObj()
- SfxBoolItem aItem( SID_ANIMATOR_ADD, sal_True );
+ SfxBoolItem aItem( SID_ANIMATOR_ADD, true );
GetBindings().GetDispatcher()->Execute(
SID_ANIMATOR_ADD, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L );
@@ -465,10 +463,9 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn )
// Objekte vorhanden sein.
if( pObject )
{
- pObject = pPage->RemoveObject(nPos);
+ pObject = pPage->RemoveObjectFromSdrObjList(nPos);
DBG_ASSERT(pObject, "Clone beim Loeschen nicht gefunden");
- SdrObject::Free( pObject );
- pPage->RecalcObjOrdNums();
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
}
@@ -491,10 +488,9 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn )
pObject = pPage->GetObj( i );
if( pObject )
{
- pObject = pPage->RemoveObject( i );
+ pObject = pPage->RemoveObjectFromSdrObjList( i );
DBG_ASSERT(pObject, "Clone beim Loeschen nicht gefunden");
- SdrObject::Free( pObject );
- //pPage->RecalcObjOrdNums();
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
}
@@ -533,7 +529,7 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn )
IMPL_LINK( AnimationWindow, ClickCreateGroupHdl, void *, EMPTYARG )
{
// Code jetzt in CreatePresObj()
- SfxBoolItem aItem( SID_ANIMATOR_CREATE, sal_True );
+ SfxBoolItem aItem( SID_ANIMATOR_CREATE, true );
GetBindings().GetDispatcher()->Execute(
SID_ANIMATOR_CREATE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L );
@@ -575,7 +571,7 @@ IMPL_LINK( AnimationWindow, ModifyTimeHdl, void *, EMPTYARG )
// -----------------------------------------------------------------------
-void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls )
+void AnimationWindow::UpdateControl( sal_uLong nListPos, bool bDisableCtrls )
{
String aString;
@@ -588,7 +584,7 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls
if( pObject )
{
VirtualDevice aVD;
- Rectangle aObjRect( pObject->GetCurrentBoundRect() );
+ Rectangle aObjRect( sdr::legacy::GetBoundRect(*pObject) );
Size aObjSize( aObjRect.GetSize() );
Point aOrigin( Point( -aObjRect.Left(), -aObjRect.Top() ) );
MapMode aMap( aVD.GetMapMode() );
@@ -599,8 +595,8 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls
const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
aVD.SetBackground( Wallpaper( rStyles.GetFieldColor() ) );
aVD.SetDrawMode( rStyles.GetHighContrastMode()
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR );
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR );
aVD.Erase();
pObject->SingleObjectPainter( aVD ); // #110094#-17
aBmp = BitmapEx( aVD.GetBitmap( aObjRect.TopLeft(), aObjSize ) );
@@ -638,15 +634,15 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls
//aFiCount.SetText( String( SdResId( STR_NULL ) ) );
// Wenn kein Objekt in der Liste ist
- aBtnFirst.Enable( sal_False );
- aBtnReverse.Enable( sal_False );
- aBtnPlay.Enable( sal_False );
- aBtnLast.Enable( sal_False );
- aNumFldBitmap.Enable( sal_False );
- aTimeField.Enable( sal_False );
- aLbLoopCount.Enable( sal_False );
- aBtnRemoveBitmap.Enable( sal_False );
- aBtnRemoveAll.Enable( sal_False );
+ aBtnFirst.Enable( false );
+ aBtnReverse.Enable( false );
+ aBtnPlay.Enable( false );
+ aBtnLast.Enable( false );
+ aNumFldBitmap.Enable( false );
+ aTimeField.Enable( false );
+ aLbLoopCount.Enable( false );
+ aBtnRemoveBitmap.Enable( false );
+ aBtnRemoveAll.Enable( false );
//aFtAdjustment.Enable();
//aLbAdjustment.Enable();
@@ -654,13 +650,13 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls
if( bMovie && bDisableCtrls )
{
- aBtnGetOneObject.Enable( sal_False );
- aBtnGetAllObjects.Enable( sal_False );
- aRbtGroup.Enable( sal_False );
- aRbtBitmap.Enable( sal_False );
- aBtnCreateGroup.Enable( sal_False );
- aFtAdjustment.Enable( sal_False );
- aLbAdjustment.Enable( sal_False );
+ aBtnGetOneObject.Enable( false );
+ aBtnGetAllObjects.Enable( false );
+ aRbtGroup.Enable( false );
+ aRbtBitmap.Enable( false );
+ aBtnCreateGroup.Enable( false );
+ aFtAdjustment.Enable( false );
+ aLbAdjustment.Enable( false );
}
else
{
@@ -670,8 +666,8 @@ void AnimationWindow::UpdateControl( sal_uLong nListPos, sal_Bool bDisableCtrls
aRbtBitmap.Enable();
aBtnCreateGroup.Enable(aBmpExList.Count() != 0);
- aFtAdjustment.Enable( sal_True );
- aLbAdjustment.Enable( sal_True );
+ aFtAdjustment.Enable( true );
+ aLbAdjustment.Enable( true );
}
ClickRbtHdl( NULL );
@@ -850,18 +846,18 @@ sal_Bool AnimationWindow::Close()
{
if( maPlayLock.isLocked() )
{
- return sal_False;
+ return false;
}
else
{
- SfxBoolItem aItem( SID_ANIMATION_OBJECTS, sal_False );
+ SfxBoolItem aItem( SID_ANIMATION_OBJECTS, false );
GetBindings().GetDispatcher()->Execute(
SID_ANIMATION_OBJECTS, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
SfxDockingWindow::Close();
- return sal_True;
+ return true;
}
}
@@ -882,29 +878,28 @@ void AnimationWindow::AddObj (::sd::View& rView )
rView.SdrEndTextEdit();
// Objekt(e) clonen und den/die Clone(s) in die Liste stellen
- const SdrMarkList& rMarkList = rView.GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
SdPage* pPage = pMyDoc->GetSdPage(0, PK_STANDARD);
- sal_uLong nCloneCount = pPage->GetObjCount();
- if (nMarkCount > 0)
+ if (aSelection.size())
{
+ const sal_uInt32 nCloneCount(pPage->GetObjCount());
// Wenn es sich um EIN Animationsobjekt oder ein Gruppenobjekt
// handelt, das 'einzeln uebernommen' wurde,
// werden die einzelnen Objekte eingefuegt
- sal_Bool bAnimObj = sal_False;
- if( nMarkCount == 1 )
+ bool bAnimObj = false;
+ if( 1 == aSelection.size() )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObject = pMark->GetMarkedSdrObj();
+ SdrObject* pObject = aSelection[0];
SdAnimationInfo* pAnimInfo = rView.GetDoc()->GetAnimationInfo( pObject );
- sal_uInt32 nInv = pObject->GetObjInventor();
- sal_uInt16 nId = pObject->GetObjIdentifier();
+ const sal_uInt32 nInv = pObject->GetObjInventor();
+ const sal_uInt16 nId = pObject->GetObjIdentifier();
// Animated Bitmap (GIF)
- if( nInv == SdrInventor && nId == OBJ_GRAF && ( (SdrGrafObj*) pObject )->IsAnimated() )
+ const SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(pObject);
+
+ if( pGrafObj && pGrafObj->IsAnimated() )
{
- const SdrGrafObj* pGrafObj = (SdrGrafObj*) pObject;
Graphic aGraphic( pGrafObj->GetTransformedGraphic() );
sal_uInt16 nCount = 0;
@@ -943,37 +938,41 @@ void AnimationWindow::AddObj (::sd::View& rView )
}
// Nachdem ein animated GIF uebernommen wurde, kann auch nur ein solches erstellt werden
aRbtBitmap.Check();
- aRbtGroup.Enable( sal_False );
- bAnimObj = sal_True;
+ aRbtGroup.Enable( false );
+ bAnimObj = true;
}
}
else if( bAllObjects || ( pAnimInfo && pAnimInfo->mbIsMovie ) )
{
// Mehrere Objekte
- SdrObjList* pObjList = ((SdrObjGroup*)pObject)->GetSubList();
+ SdrObjList* pObjList = pObject->getChildrenOfSdrObject();
- for( sal_uInt16 nObject = 0; nObject < pObjList->GetObjCount(); nObject++ )
+ if(pObjList)
{
- SdrObject* pSnapShot = (SdrObject*) pObjList->GetObj( (sal_uLong) nObject );
+ for( sal_uInt32 nObject (0); nObject < pObjList->GetObjCount(); nObject++ )
+ {
+ SdrObject* pSnapShot = (SdrObject*) pObjList->GetObj( nObject );
+ OSL_ENSURE(pSnapShot, "zero SdrObject* in SdrObjList (!)");
- pBitmapEx = new BitmapEx( SdrExchangeView::GetObjGraphic( pSnapShot->GetModel(), pSnapShot ).GetBitmapEx() );
- aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 );
+ pBitmapEx = new BitmapEx(GetObjGraphic(*pSnapShot).GetBitmapEx());
+ aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 );
- // Time
- Time* pTime = new Time( aTimeField.GetTime() );
- aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 );
+ // Time
+ Time* pTime = new Time( aTimeField.GetTime() );
+ aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 );
- // Clone
- pPage->InsertObject( pSnapShot->Clone(), aBmpExList.GetCurPos() + 1 );
+ // Clone
+ pPage->InsertObjectToSdrObjList(*pSnapShot->CloneSdrObject(), aBmpExList.GetCurPos() + 1);
- // Weiterschalten der BitmapListe
- aBmpExList.Next();
+ // Weiterschalten der BitmapListe
+ aBmpExList.Next();
+ }
}
- bAnimObj = sal_True;
+ bAnimObj = true;
}
}
// Auch ein einzelnes animiertes Objekt
- if( !bAnimObj && !( bAllObjects && nMarkCount > 1 ) )
+ if( !bAnimObj && !( bAllObjects && aSelection.size() > 1 ) )
{
pBitmapEx = new BitmapEx( rView.GetAllMarkedGraphic().GetBitmapEx() );
aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 );
@@ -985,46 +984,44 @@ void AnimationWindow::AddObj (::sd::View& rView )
}
// ein einzelnes Objekt
- if( nMarkCount == 1 && !bAnimObj )
+ if( 1 == aSelection.size() && !bAnimObj )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObject = pMark->GetMarkedSdrObj();
- SdrObject* pClone = pObject->Clone();
- pPage->InsertObject(pClone, aBmpExList.GetCurPos() + 1);
+ pPage->InsertObjectToSdrObjList(*aSelection[0]->CloneSdrObject(), aBmpExList.GetCurPos() + 1);
}
- // mehrere Objekte: die Clones zu einer Gruppe zusammenfassen
- else if (nMarkCount > 1)
+ else if (aSelection.size() > 1)
{
+ // mehrere Objekte: die Clones zu einer Gruppe zusammenfassen
// Objekte einzeln uebernehmen
if( bAllObjects )
{
- for( sal_uLong nObject= 0; nObject < nMarkCount; nObject++ )
+ for( sal_uInt32 nObject(0); nObject < aSelection.size(); nObject++ )
{
// Clone
- SdrObject* pObject = rMarkList.GetMark( nObject )->GetMarkedSdrObj();
+ SdrObject* pObject = aSelection[nObject];
- pBitmapEx = new BitmapEx( SdrExchangeView::GetObjGraphic( pObject->GetModel(), pObject ).GetBitmapEx() );
+ pBitmapEx = new BitmapEx(GetObjGraphic(*pObject).GetBitmapEx());
aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 );
// Time
Time* pTime = new Time( aTimeField.GetTime() );
aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 );
- pPage->InsertObject( pObject->Clone(), aBmpExList.GetCurPos() + 1 );
+ pPage->InsertObjectToSdrObjList(*pObject->CloneSdrObject(), aBmpExList.GetCurPos() + 1 );
aBmpExList.Next();
}
- bAnimObj = sal_True; // damit nicht nochmal weitergeschaltet wird
+ bAnimObj = true; // damit nicht nochmal weitergeschaltet wird
}
else
{
- SdrObjGroup* pCloneGroup = new SdrObjGroup;
- SdrObjList* pObjList = pCloneGroup->GetSubList();
+ SdrObjGroup* pCloneGroup = new SdrObjGroup(pPage->getSdrModelFromSdrPage());
- for (sal_uLong nObject= 0; nObject < nMarkCount; nObject++)
- pObjList->InsertObject(rMarkList.GetMark(nObject)->GetMarkedSdrObj()->Clone(), LIST_APPEND);
+ for (sal_uInt32 nObject(0); nObject < aSelection.size(); nObject++)
+ {
+ pCloneGroup->InsertObjectToSdrObjList(*aSelection[nObject]->CloneSdrObject());
+ }
- pPage->InsertObject(pCloneGroup, aBmpExList.GetCurPos() + 1);
+ pPage->InsertObjectToSdrObjList(*pCloneGroup, aBmpExList.GetCurPos() + 1);
}
}
@@ -1082,8 +1079,6 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
aMaxSizePix.Height() = Max( aMaxSizePix.Height(), aTmpSizePix.Height() );
}
- SdrPageView* pPV = rView.GetSdrPageView();
-
if( aRbtBitmap.IsChecked() )
{
// Bitmapgruppe erzeugen (Animated GIF)
@@ -1157,18 +1152,20 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
aAnimBmp.aSizePix = aBitmapSize;
aAnimBmp.nWait = nTime;
aAnimBmp.eDisposal = DISPOSE_BACK;
- aAnimBmp.bUserInput = sal_False;
+ aAnimBmp.bUserInput = false;
aAnimation.Insert( aAnimBmp );
aAnimation.SetDisplaySizePixel( aMaxSizePix );
aAnimation.SetLoopCount( nLoopCount );
}
- SdrGrafObj* pGrafObj = new SdrGrafObj( Graphic( aAnimation ) );
+ SdrGrafObj* pGrafObj = new SdrGrafObj(
+ rView.getSdrModelFromSdrView(),
+ Graphic( aAnimation ) );
const Point aOrg( aWindowCenter.X() - ( aMaxSizeLog.Width() >> 1 ), aWindowCenter.Y() - ( aMaxSizeLog.Height() >> 1 ) );
- pGrafObj->SetLogicRect( Rectangle( aOrg, aMaxSizeLog ) );
- rView.InsertObjectAtView( pGrafObj, *pPV, SDRINSERT_SETDEFLAYER);
+ sdr::legacy::SetLogicRect(*pGrafObj, Rectangle( aOrg, aMaxSizeLog ) );
+ rView.InsertObjectAtView( *pGrafObj, SDRINSERT_SETDEFLAYER);
}
else
{
@@ -1180,7 +1177,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
for(i = 0; i < nCount; i++)
{
pClone = pPage->GetObj(i);
- Rectangle aRect( pClone->GetSnapRect() );
+ Rectangle aRect( sdr::legacy::GetSnapRect(*pClone) );
switch( eBA )
{
@@ -1229,21 +1226,19 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
// SetSnapRect ist fuer Ellipsen leider nicht implementiert !!!
Point aMovePt( aWindowCenter + Point( aOffset.Width(), aOffset.Height() ) - aRect.TopLeft() );
Size aMoveSize( aMovePt.X(), aMovePt.Y() );
- pClone->NbcMove( aMoveSize );
+ sdr::legacy::MoveSdrObject(*pClone, aMoveSize );
}
// Animationsgruppe erzeugen
- SdrObjGroup* pGroup = new SdrObjGroup;
- SdrObjList* pObjList = pGroup->GetSubList();
+ SdrObjGroup* pGroup = new SdrObjGroup(rView.getSdrModelFromSdrView());
for (i = 0; i < nCount; i++)
{
// der Clone verbleibt im Animator; in die Gruppe kommt ein Clone
// des Clones
pClone = pPage->GetObj(i);
- SdrObject* pCloneOfClone = pClone->Clone();
- //SdrObject* pCloneOfClone = pPage->GetObj(i)->Clone();
- pObjList->InsertObject(pCloneOfClone, LIST_APPEND);
+ SdrObject* pCloneOfClone = pClone->CloneSdrObject();
+ pGroup->InsertObjectToSdrObjList(*pCloneOfClone);
}
// bis jetzt liegt die linke obere Ecke der Gruppe in der Fenstermitte;
@@ -1251,17 +1246,17 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
aTemp = aMaxSizeLog;
aTemp.Height() = - aTemp.Height() / 2;
aTemp.Width() = - aTemp.Width() / 2;
- pGroup->NbcMove(aTemp);
+ sdr::legacy::MoveSdrObject(*pGroup, aTemp);
// Animationsinformation erzeugen
SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pGroup,true);
pInfo->meEffect = presentation::AnimationEffect_NONE;
pInfo->meSpeed = presentation::AnimationSpeed_MEDIUM;
- pInfo->mbActive = sal_True;
- pInfo->mbIsMovie = sal_True;
+ pInfo->mbActive = true;
+ pInfo->mbIsMovie = true;
pInfo->maBlueScreen = COL_WHITE;
- rView.InsertObjectAtView( pGroup, *pPV, SDRINSERT_SETDEFLAYER);
+ rView.InsertObjectAtView( *pGroup, SDRINSERT_SETDEFLAYER);
}
ClickFirstHdl( this );
@@ -1299,7 +1294,7 @@ void AnimationControllerItem::StateChanged( sal_uInt16 nSId,
{
if( eState >= SFX_ITEM_AVAILABLE && nSId == SID_ANIMATOR_STATE )
{
- const SfxUInt16Item* pStateItem = PTR_CAST( SfxUInt16Item, pItem );
+ const SfxUInt16Item* pStateItem = dynamic_cast< const SfxUInt16Item* >(pItem );
DBG_ASSERT( pStateItem, "SfxUInt16Item erwartet");
sal_uInt16 nState = pStateItem->GetValue();
diff --git a/sd/source/ui/dlg/assclass.cxx b/sd/source/ui/dlg/assclass.cxx
index cc4adb4cb5fa..42f0802c4ecb 100644
--- a/sd/source/ui/dlg/assclass.cxx
+++ b/sd/source/ui/dlg/assclass.cxx
@@ -45,7 +45,7 @@ Assistent::Assistent(int nNoOfPages)
for(sal_uInt8 i=0;i<mnPages;i++)
{
mpPages[i]=new List();
- mpPageStatus[i] = sal_True;
+ mpPageStatus[i] = true;
}
mnCurrentPage=1;
}
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index 7cd7b612ef7f..ee97afeb656f 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -78,7 +78,7 @@ BreakDlg::BreakDlg(
pProgrInfo->Init( nSumActionCount*3, nObjCount );
pDrView = _pDrView;
- bCancel = sal_False;
+ bCancel = false;
FreeResource();
}
@@ -95,7 +95,7 @@ BreakDlg::~BreakDlg()
// Control-Handler fuer den Abbruch Button
IMPL_LINK( BreakDlg, CancelButtonHdl, void *, EMPTYARG )
{
- bCancel = sal_True;
+ bCancel = true;
aBtnCancel.Disable();
return( 0L );
}
@@ -176,7 +176,7 @@ short BreakDlg::Execute()
IMPL_LINK( BreakDlg, InitialUpdate, Timer*, EMPTYARG )
{
pDrView->DoImportMarkedMtf(pProgrInfo);
- EndDialog(sal_True);
+ EndDialog(true);
return 0L;
}
diff --git a/sd/source/ui/dlg/celltempl.cxx b/sd/source/ui/dlg/celltempl.cxx
index 9405bf7c5b2e..44fa2976ee0a 100644
--- a/sd/source/ui/dlg/celltempl.cxx
+++ b/sd/source/ui/dlg/celltempl.cxx
@@ -52,7 +52,7 @@
\************************************************************************/
SdPresCellTemplateDlg::SdPresCellTemplateDlg( SdrModel* pModel, Window* pParent, SfxStyleSheetBase& rStyleBase )
-: SfxStyleDialog( pParent, SdResId(TAB_CELL_TEMPLATE), rStyleBase, sal_False )
+: SfxStyleDialog( pParent, SdResId(TAB_CELL_TEMPLATE), rStyleBase, false )
, mpColorTab( pModel->GetColorTable() )
, mpGradientList( pModel->GetGradientList() )
, mpHatchingList( pModel->GetHatchList() )
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index 7605f4f1ed4f..647ffbdcd2da 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -112,10 +112,10 @@ CopyDlg::CopyDlg(
FieldUnit eFUnit( SfxModule::GetCurrentFieldUnit() );
- SetFieldUnit( maMtrFldMoveX, eFUnit, sal_True );
- SetFieldUnit( maMtrFldMoveY, eFUnit, sal_True );
- SetFieldUnit( maMtrFldWidth, eFUnit, sal_True );
- SetFieldUnit( maMtrFldHeight, eFUnit, sal_True );
+ SetFieldUnit( maMtrFldMoveX, eFUnit, true );
+ SetFieldUnit( maMtrFldMoveY, eFUnit, true );
+ SetFieldUnit( maMtrFldWidth, eFUnit, true );
+ SetFieldUnit( maMtrFldHeight, eFUnit, true );
Reset(0L);
}
@@ -167,37 +167,37 @@ IMPL_LINK( CopyDlg, Reset, void*, EMPTYARG )
if( aStr.GetTokenCount( TOKEN ) < 8 )
{
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_NUMBER, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_NUMBER, true, &pPoolItem ) )
maNumFldCopies.SetValue( ( ( const SfxUInt16Item* ) pPoolItem )->GetValue() );
else
maNumFldCopies.SetValue( 1L );
long nMoveX = 500L;
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) )
nMoveX = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
SetMetricValue( maMtrFldMoveX, Fraction(nMoveX) / maUIScale, SFX_MAPUNIT_100TH_MM);
long nMoveY = 500L;
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) )
nMoveY = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
SetMetricValue( maMtrFldMoveY, Fraction(nMoveY) / maUIScale, SFX_MAPUNIT_100TH_MM);
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) )
maMtrFldAngle.SetValue( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
else
maMtrFldAngle.SetValue( 0L );
long nWidth = 0L;
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) )
nWidth = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
SetMetricValue( maMtrFldWidth, Fraction(nWidth) / maUIScale, SFX_MAPUNIT_100TH_MM);
long nHeight = 0L;
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) )
nHeight = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() );
SetMetricValue( maMtrFldHeight, Fraction(nHeight) / maUIScale, SFX_MAPUNIT_100TH_MM);
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) )
{
Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
maLbStartColor.SelectEntry( aColor );
@@ -302,16 +302,14 @@ IMPL_LINK( CopyDlg, SelectColorHdl, void *, EMPTYARG )
IMPL_LINK( CopyDlg, SetViewData, void*, EMPTYARG )
{
- Rectangle aRect = mpView->GetAllMarkedRect();
+ const basegfx::B2DRange aAllRange(mpView->getMarkedObjectSnapRange());
- SetMetricValue( maMtrFldMoveX, Fraction( aRect.GetWidth() ) /
- maUIScale, SFX_MAPUNIT_100TH_MM);
- SetMetricValue( maMtrFldMoveY, Fraction( aRect.GetHeight() ) /
- maUIScale, SFX_MAPUNIT_100TH_MM);
+ SetMetricValue(maMtrFldMoveX, Fraction(aAllRange.getWidth() / double(maUIScale)), SFX_MAPUNIT_100TH_MM);
+ SetMetricValue(maMtrFldMoveY, Fraction(aAllRange.getHeight() / double(maUIScale)), SFX_MAPUNIT_100TH_MM);
// Farb-Attribut setzen
const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) )
{
Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
maLbStartColor.SelectEntry( aColor );
@@ -339,7 +337,7 @@ IMPL_LINK( CopyDlg, SetDefault, void*, EMPTYARG )
// Farb-Attribut setzen
const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) )
{
Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
maLbStartColor.SelectEntry( aColor );
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 2c1bd1c17950..684fdf52068b 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -66,7 +66,7 @@ SdCustomShowDlg::SdCustomShowDlg( Window* pWindow,
rDoc ( rDrawDoc ),
pCustomShowList ( NULL ),
pCustomShow ( NULL ),
- bModified ( sal_False )
+ bModified ( false )
{
FreeResource();
@@ -115,7 +115,7 @@ void SdCustomShowDlg::CheckState()
{
sal_uInt16 nPos = aLbCustomShows.GetSelectEntryPos();
- sal_Bool bEnable = nPos != LISTBOX_ENTRY_NOTFOUND;
+ bool bEnable = nPos != LISTBOX_ENTRY_NOTFOUND;
aBtnEdit.Enable( bEnable );
aBtnRemove.Enable( bEnable );
aBtnCopy.Enable( bEnable );
@@ -141,7 +141,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
if( pCustomShow )
{
if( !pCustomShowList )
- pCustomShowList = rDoc.GetCustomShowList( sal_True );
+ pCustomShowList = rDoc.GetCustomShowList( true );
pCustomShowList->Insert( pCustomShow, LIST_APPEND );
pCustomShowList->Last();
@@ -150,7 +150,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
}
if( aDlg.IsModified() )
- bModified = sal_True;
+ bModified = true;
}
else if( pCustomShow )
DELETEZ( pCustomShow );
@@ -176,7 +176,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
aLbCustomShows.SelectEntryPos( nPos );
}
if( aDlg.IsModified() )
- bModified = sal_True;
+ bModified = true;
}
}
}
@@ -189,7 +189,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
delete (SdCustomShow*) pCustomShowList->Remove( nPos );
aLbCustomShows.RemoveEntry( nPos );
aLbCustomShows.SelectEntryPos( nPos == 0 ? nPos : nPos - 1 );
- bModified = sal_True;
+ bModified = true;
}
}
// CustomShow kopieren
@@ -221,17 +221,17 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
}
// Name ueberpruefen...
- sal_Bool bDifferent = sal_False;
+ bool bDifferent = false;
//long nPosToSelect = pCustomShowList->GetCurPos();
while( !bDifferent )
{
- bDifferent = sal_True;
+ bDifferent = true;
for( pCustomShow = (SdCustomShow*) pCustomShowList->First();
pCustomShow != NULL && bDifferent;
pCustomShow = (SdCustomShow*) pCustomShowList->Next() )
{
if( aStr == pCustomShow->GetName() )
- bDifferent = sal_False;
+ bDifferent = false;
}
if( !bDifferent )
{
@@ -253,7 +253,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
aLbCustomShows.SelectEntry( pShow->GetName() );
- bModified = sal_True;
+ bModified = true;
}
}
else if( p == &aLbCustomShows )
@@ -262,11 +262,11 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
if( nPos != LISTBOX_ENTRY_NOTFOUND )
pCustomShowList->Seek( nPos );
- bModified = sal_True;
+ bModified = true;
}
else if( p == &aCbxUseCustomShow )
{
- bModified = sal_True;
+ bModified = true;
}
CheckState();
@@ -287,7 +287,7 @@ IMPL_LINK( SdCustomShowDlg, StartShowHdl, Button *, EMPTYARG )
/*************************************************************************
|* CheckState
\************************************************************************/
-sal_Bool SdCustomShowDlg::IsCustomShow() const
+bool SdCustomShowDlg::IsCustomShow() const
{
return( aCbxUseCustomShow.IsEnabled() && aCbxUseCustomShow.IsChecked() );
}
@@ -322,7 +322,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( Window* pWindow,
rDoc ( rDrawDoc ),
rpCustomShow ( rpCS ),
- bModified ( sal_False )
+ bModified ( false )
{
FreeResource();
@@ -337,11 +337,11 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( Window* pWindow,
SdPage* pPage;
// Listbox mit Seitennamen des Docs fuellen
- for( long nPage = 0L;
+ for( sal_uInt32 nPage = 0;
nPage < rDoc.GetSdPageCount( PK_STANDARD );
nPage++ )
{
- pPage = rDoc.GetSdPage( (sal_uInt16) nPage, PK_STANDARD );
+ pPage = rDoc.GetSdPage( nPage, PK_STANDARD );
String aStr( pPage->GetName() );
aLbPages.InsertEntry( aStr );
}
@@ -372,7 +372,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( Window* pWindow,
aLbCustomPages.SetDragDropMode( SV_DRAGDROP_CTRL_MOVE );
aLbCustomPages.SetHighlightRange();
- aBtnOK.Enable( sal_False );
+ aBtnOK.Enable( false );
CheckState();
}
@@ -390,10 +390,10 @@ SdDefineCustomShowDlg::~SdDefineCustomShowDlg()
\************************************************************************/
void SdDefineCustomShowDlg::CheckState()
{
- sal_Bool bPages = aLbPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND;
- //sal_Bool bCSPages = aLbCustomPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND;
- sal_Bool bCSPages = aLbCustomPages.FirstSelected() != NULL;
- sal_Bool bCount = aLbCustomPages.GetEntryCount() > 0;
+ bool bPages = aLbPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND;
+ //bool bCSPages = aLbCustomPages.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND;
+ bool bCSPages = aLbCustomPages.FirstSelected() != NULL;
+ bool bCount = aLbCustomPages.GetEntryCount() > 0;
aBtnOK.Enable( bCount );
aBtnAdd.Enable( bPages );
@@ -419,17 +419,17 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p )
{
String aStr = aLbPages.GetSelectEntry( i );
pEntry = aLbCustomPages.InsertEntry( aStr,
- 0, sal_False, nPosCP );
+ 0, false, nPosCP );
aLbCustomPages.Select( pEntry );
- SdPage* pPage = rDoc.GetSdPage( (sal_uInt16) aLbPages.
+ SdPage* pPage = rDoc.GetSdPage( aLbPages.
GetSelectEntryPos( i ), PK_STANDARD );
pEntry->SetUserData( pPage );
if( nPosCP != LIST_APPEND )
nPosCP++;
}
- bModified = sal_True;
+ bModified = true;
}
}
else if( p == &aBtnRemove )
@@ -443,14 +443,14 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p )
//aLbCustomPages.RemoveEntry( nPos );
aLbCustomPages.GetModel()->Remove( aLbCustomPages.GetModel()->GetEntryAtAbsPos( nPos ) );
- bModified = sal_True;
+ bModified = true;
}
}
else if( p == &aEdtName )
{
//rpCustomShow->SetName( aEdtName.GetText() );
- bModified = sal_True;
+ bModified = true;
}
CheckState();
@@ -465,7 +465,7 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p )
\************************************************************************/
void SdDefineCustomShowDlg::CheckCustomShow()
{
- sal_Bool bDifferent = sal_False;
+ bool bDifferent = false;
SdPage* pPage = NULL;
SvLBoxEntry* pEntry = NULL;
@@ -473,7 +473,7 @@ void SdDefineCustomShowDlg::CheckCustomShow()
if( rpCustomShow->Count() != aLbCustomPages.GetEntryCount() )
{
rpCustomShow->Clear();
- bDifferent = sal_True;
+ bDifferent = true;
}
// Seiten-Pointer vergleichen
@@ -486,7 +486,7 @@ void SdDefineCustomShowDlg::CheckCustomShow()
if( pPage != pEntry->GetUserData() )
{
rpCustomShow->Clear();
- bDifferent = sal_True;
+ bDifferent = true;
}
}
}
@@ -501,7 +501,7 @@ void SdDefineCustomShowDlg::CheckCustomShow()
pPage = (SdPage*) pEntry->GetUserData();
rpCustomShow->Insert( pPage, LIST_APPEND );
}
- bModified = sal_True;
+ bModified = true;
}
// Name vergleichen und ggfs. setzen
@@ -509,7 +509,7 @@ void SdDefineCustomShowDlg::CheckCustomShow()
if( rpCustomShow->GetName() != aStr )
{
rpCustomShow->SetName( aStr );
- bModified = sal_True;
+ bModified = true;
}
}
@@ -519,7 +519,7 @@ void SdDefineCustomShowDlg::CheckCustomShow()
IMPL_LINK( SdDefineCustomShowDlg, OKHdl, Button *, EMPTYARG )
{
// Name ueberpruefen...
- sal_Bool bDifferent = sal_True;
+ bool bDifferent = true;
List* pCustomShowList = rDoc.GetCustomShowList();
if( pCustomShowList )
{
@@ -532,7 +532,7 @@ IMPL_LINK( SdDefineCustomShowDlg, OKHdl, Button *, EMPTYARG )
pCustomShow = (SdCustomShow*) pCustomShowList->Next() )
{
if( aName == pCustomShow->GetName() && aName != aOldName )
- bDifferent = sal_False;
+ bDifferent = false;
}
pCustomShowList->Seek( nPosToSelect );
}
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 81904ff0b25e..5abdef6643ea 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -149,7 +149,7 @@ private:
class AssistentDlgImpl : public SfxListener
{
public:
- AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot );
+ AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, bool bAutoPilot );
~AssistentDlgImpl();
/// Local mutex used to serialize concurrent method calls.
@@ -164,10 +164,10 @@ public:
files and insert them into a listbox.
*/
void ScanDocmenu (void);
- /** Flag that is set to sal_True after the recently used files have been
+ /** Flag that is set to true after the recently used files have been
scanned.
*/
- sal_Bool mbRecentDocumentsReady;
+ bool mbRecentDocumentsReady;
/** When the list of templates has not been scanned already this is done
when this method is called. That includes requesting the whole list
@@ -180,7 +180,7 @@ public:
/** This method transfers the template folders from the template scanner
to the internal structures of this class. On termination it sets
- the flag <member>mbTemplatesReady</member> to <TRUE/> to indicate
+ the flag <member>mbTemplatesReady</member> to <true/> to indicate
that the templates are available.
@param rTemplateFolders
This is a list of template folders. This method takes ownership
@@ -189,16 +189,16 @@ public:
*/
void TemplateScanDone (std::vector<TemplateDir*>& rTemplateFolders);
- /** Flag that is set to sal_True after the impress templates have been
+ /** Flag that is set to true after the impress templates have been
scanned.
*/
- sal_Bool mbTemplatesReady;
+ bool mbTemplatesReady;
/** Flag used to prevent nested or concurrent calls to the
- <member>UpdatePreview</memember> method. A <TRUE/> value indicates
+ <member>UpdatePreview</memember> method. A <true/> value indicates
that a preview update is currently active.
*/
- sal_Bool mbPreviewUpdating;
+ bool mbPreviewUpdating;
::Window* mpWindow;
@@ -228,7 +228,7 @@ public:
TemplateDir* mpLayoutRegion;
// preview
- sal_Bool mbUserDataDirty;
+ bool mbUserDataDirty;
Timer maPrevTimer;
Timer maEffectPrevTimer;
Timer maUpdatePageListTimer;
@@ -238,19 +238,19 @@ public:
::std::auto_ptr<WindowUpdater> mpWindowUpdater;
- sal_Bool mbPreview;
- sal_uInt16 mnShowPage;
- sal_Bool mbDocPreview;
+ bool mbPreview;
+ sal_uInt32 mnShowPage;
+ bool mbDocPreview;
sal_uLong mnTemplate;
String maPageListFile;
- void UpdatePreview( sal_Bool bDocPreview );
+ void UpdatePreview( bool bDocPreview );
void UpdatePageList();
void UpdateUserData();
- sal_Bool IsOwnFormat( const String& rPath );
+ bool IsOwnFormat( const String& rPath );
// dlg status
void EndDialog( long nResult = 0 );
@@ -361,15 +361,15 @@ public:
// ====================================================================
-AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, sal_Bool bAutoPilot ) :
+AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink, bool bAutoPilot ) :
mpTemplateRegion(NULL),
mpLayoutRegion(NULL),
- mbUserDataDirty(sal_False),
+ mbUserDataDirty(false),
xDocShell (NULL),
mpWindowUpdater (new WindowUpdater()),
- mbPreview(sal_True),
+ mbPreview(true),
mnShowPage(0),
- mbDocPreview(sal_False),
+ mbDocPreview(false),
maAssistentFunc(5),
maPreviewFlag(pWindow,SdResId(CB_PREVIEW)),
maStartWithFlag(pWindow,SdResId(CB_STARTWITH)),
@@ -383,9 +383,9 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink,
maOpenStr(SdResId(STR_OPEN))
{
maPageListFile += sal_Unicode('?'),
- mbRecentDocumentsReady = sal_False;
- mbTemplatesReady = sal_False;
- mbPreviewUpdating = sal_False;
+ mbRecentDocumentsReady = false;
+ mbTemplatesReady = false;
+ mbPreviewUpdating = false;
mpWindow = pWindow;
@@ -444,8 +444,8 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink,
mpPage1OpenPB->SetModeImage(
GetUiIconForCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Open"))),
BMP_COLOR_NORMAL);
- mpPage1OpenPB->EnableImageDisplay(sal_True);
- mpPage1OpenPB->EnableTextDisplay(sal_True);
+ mpPage1OpenPB->EnableImageDisplay(true);
+ mpPage1OpenPB->EnableTextDisplay(true);
mpPage1OpenPB->SetImageAlign(IMAGEALIGN_LEFT);
mpPage1OpenPB->SetStyle(mpPage1OpenPB->GetStyle() | WB_CENTER);
}
@@ -626,7 +626,7 @@ AssistentDlgImpl::AssistentDlgImpl( ::Window* pWindow, const Link& rFinishLink,
mpWindowUpdater->RegisterWindow (&maPreview);
- UpdatePreview( sal_True );
+ UpdatePreview( true );
//check wether we should start with a template document initialy and preselect it
const ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) );
@@ -848,10 +848,10 @@ void AssistentDlgImpl::ScanDocmenu (void)
}
}
}
- mbRecentDocumentsReady = sal_True;
+ mbRecentDocumentsReady = true;
try
{
- UpdatePreview(sal_True);
+ UpdatePreview(true);
}
catch (uno::RuntimeException& )
{
@@ -871,7 +871,7 @@ void AssistentDlgImpl::ProvideTemplates (void)
try
{
- UpdatePreview(sal_True);
+ UpdatePreview(true);
}
catch (uno::RuntimeException& e)
{
@@ -943,7 +943,7 @@ void AssistentDlgImpl::TemplateScanDone (
SelectLayoutRegion (mpPage2RegionLB->GetSelectEntry());
// Make the changes visible.
- mbTemplatesReady = sal_True;
+ mbTemplatesReady = true;
if (mpWindow)
UpdatePage();
}
@@ -1040,18 +1040,17 @@ String AssistentDlgImpl::GetLayoutFileName()
SfxObjectShellLock AssistentDlgImpl::GetDocument()
{
-// mbPreview = sal_False; // Document nicht anzeigen
- UpdatePreview(sal_False); // aber komplett laden
+ UpdatePreview(false); // aber komplett laden
UpdatePageList();
SfxObjectShell* pShell = xDocShell;
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,pShell);
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(pShell);
SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
if(pDoc)
{
- const sal_uInt16 nPageCount = pDoc->GetSdPageCount(PK_STANDARD);
- sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
+ const sal_uInt32 nPageCount = pDoc->GetSdPageCount(PK_STANDARD);
+ bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
sal_uInt32 nNewTime = (sal_uInt32)mpPage3PresTimeTMF->GetTime().GetMSFromTime() / 1000;
if(bKiosk)
{
@@ -1061,8 +1060,8 @@ SfxObjectShellLock AssistentDlgImpl::GetDocument()
rSettings.mbShowPauseLogo = mpPage3LogoCB->IsChecked();
}
- sal_uInt16 nPgAbsNum = 0;
- sal_uInt16 nPgRelNum = 0;
+ sal_uInt32 nPgAbsNum = 0;
+ sal_uInt32 nPgRelNum = 0;
while( nPgAbsNum < nPageCount )
{
SdPage* pPage = pDoc->GetSdPage( nPgRelNum, PK_STANDARD );
@@ -1139,7 +1138,7 @@ void AssistentDlgImpl::UpdatePage()
{
// Elemente auf der ersten Seite abhaengig vom Starttype Zeigen
SetStartType( GetStartType() );
- mpPage1TemplateRB->Enable(sal_True /*mbTemplatesReady*/);
+ mpPage1TemplateRB->Enable(true /*mbTemplatesReady*/);
break;
}
@@ -1150,11 +1149,11 @@ void AssistentDlgImpl::UpdatePage()
if( GetStartType() != ST_EMPTY )
{
- mpPage2Medium5RB->Enable( sal_True );
+ mpPage2Medium5RB->Enable( true );
}
else
{
- mpPage2Medium5RB->Enable( sal_False );
+ mpPage2Medium5RB->Enable( false );
if(mpPage2Medium5RB->IsChecked())
mpPage2Medium1RB->Check();
}
@@ -1175,7 +1174,7 @@ void AssistentDlgImpl::UpdatePage()
if(GetStartType() != ST_TEMPLATE)
maNextPageButton.Enable(false);
- sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
+ bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
mpPage3PresTimeFT->Enable(bKiosk);
mpPage3BreakFT->Enable(bKiosk);
mpPage3PresTimeTMF->Enable(bKiosk);
@@ -1243,10 +1242,10 @@ IMPL_LINK( AssistentDlgImpl, EffectPreviewHdl, Button *, EMPTYARG )
IMPL_LINK( AssistentDlgImpl, PreviewFlagHdl, CheckBox *, EMPTYARG )
{
- if( maPreviewFlag.IsChecked() != mbPreview )
+ if( (bool)maPreviewFlag.IsChecked() != mbPreview )
{
mbPreview = maPreviewFlag.IsChecked();
- UpdatePreview(sal_True);
+ UpdatePreview(true);
}
return 0;
}
@@ -1275,11 +1274,11 @@ IMPL_LINK( AssistentDlgImpl, SelectFileHdl, ListBox *, EMPTYARG )
IMPL_LINK( AssistentDlgImpl, PageSelectHdl, Control *, EMPTYARG )
{
- sal_uInt16 nPage = mpPage5PageListCT->GetSelectedPage();
+ sal_uInt32 nPage = mpPage5PageListCT->GetSelectedPage();
if( mnShowPage != nPage )
{
mnShowPage = nPage;
- UpdatePreview(sal_False);
+ UpdatePreview(false);
}
return 0;
@@ -1293,7 +1292,7 @@ IMPL_LINK( AssistentDlgImpl, UpdatePageListHdl, void *, EMPTYARG )
IMPL_LINK( AssistentDlgImpl, UpdatePreviewHdl, void *, EMPTYARG )
{
- UpdatePreview( sal_True );
+ UpdatePreview( true );
return 0;
}
@@ -1350,7 +1349,7 @@ IMPL_LINK( AssistentDlgImpl, PresTypeHdl, RadioButton*, EMPTYARG )
maNextPageButton.Enable(false);
}
- sal_Bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
+ bool bKiosk = mpPage3PresTypeKioskRB->IsChecked();
mpPage3PresTimeFT->Enable(bKiosk);
mpPage3BreakFT->Enable(bKiosk);
mpPage3PresTimeTMF->Enable(bKiosk);
@@ -1361,7 +1360,7 @@ IMPL_LINK( AssistentDlgImpl, PresTypeHdl, RadioButton*, EMPTYARG )
IMPL_LINK( AssistentDlgImpl, UpdateUserDataHdl, Edit*, EMPTYARG )
{
- mbUserDataDirty = sal_True;
+ mbUserDataDirty = true;
String aTopic = mpPage4AskTopicEDT->GetText();
String aName = mpPage4AskNameEDT->GetText();
String aInfo = mpPage4AskInfoEDT->GetText();
@@ -1427,14 +1426,14 @@ void AssistentDlgImpl::UpdateUserData()
String aInfo = mpPage4AskInfoEDT->GetText();
SfxObjectShell* pShell = xDocShell;
- DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
+ DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell);
SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
SdPage* pPage = pDoc?pDoc->GetSdPage(0, PK_STANDARD):NULL;
if(pPage && ( aTopic.Len() != 0 || aName.Len() != 0 || aInfo.Len() != 0 ) )
{
if( pPage->GetAutoLayout() == AUTOLAYOUT_NONE )
- pPage->SetAutoLayout(AUTOLAYOUT_TITLE, sal_True);
+ pPage->SetAutoLayout(AUTOLAYOUT_TITLE, true);
SdrTextObj* pObj;
String aEmptyString;
@@ -1445,8 +1444,8 @@ void AssistentDlgImpl::UpdateUserData()
if( pObj )
{
pPage->SetObjText( pObj, NULL, PRESOBJ_TITLE, aTopic );
- pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ), sal_True );
- pObj->SetEmptyPresObj(sal_False);
+ pObj->SetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ), true );
+ pObj->SetEmptyPresObj(false);
}
}
@@ -1462,8 +1461,8 @@ void AssistentDlgImpl::UpdateUserData()
if( pObj )
{
pPage->SetObjText( pObj, NULL, PRESOBJ_OUTLINE, aStrTmp );
- pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE ), sal_True );
- pObj->SetEmptyPresObj(sal_False);
+ pObj->SetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE ), true );
+ pObj->SetEmptyPresObj(false);
}
else
{
@@ -1471,27 +1470,27 @@ void AssistentDlgImpl::UpdateUserData()
if( pObj )
{
pPage->SetObjText( pObj, NULL, PRESOBJ_TEXT, aStrTmp );
- pObj->NbcSetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TEXT ), sal_True );
- pObj->SetEmptyPresObj(sal_False);
+ pObj->SetStyleSheet( pPage->GetStyleSheetForPresObj( PRESOBJ_TEXT ), true );
+ pObj->SetEmptyPresObj(false);
}
}
}
}
- mbUserDataDirty = sal_False;
+ mbUserDataDirty = false;
}
void AssistentDlgImpl::UpdatePageList()
{
if(mbDocPreview || !mbPreview)
- UpdatePreview(sal_False);
+ UpdatePreview(false);
else if(maPageListFile == maDocFile)
return;
maPageListFile = maDocFile;
SfxObjectShell* pShell = xDocShell;
- DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
+ DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell);
SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
mpPage5PageListCT->Clear();
@@ -1500,20 +1499,20 @@ void AssistentDlgImpl::UpdatePageList()
mpPage5PageListCT->Fill(pDoc);
}
-void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
+void AssistentDlgImpl::UpdatePreview( bool bDocPreview )
{
// Guard against multiple concurrent execution to this method caused either
// by calls from different threads or recursion.
::osl::MutexGuard aGuard (maMutex);
if (mbPreviewUpdating)
return;
- mbPreviewUpdating = sal_True;
+ mbPreviewUpdating = true;
if(!mbPreview && bDocPreview)
{
maPreview.Invalidate();
maPreview.SetObjectShell(0);
- mbPreviewUpdating = sal_False;
+ mbPreviewUpdating = false;
return;
}
@@ -1523,7 +1522,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
SfxApplication *pSfxApp = SFX_APP();
sal_uLong lErr;
- sal_Bool bChangeMaster = aLayoutFile.Len() != 0;
+ bool bChangeMaster = aLayoutFile.Len() != 0;
if( aDocFile.Len() == 0 )
{
@@ -1533,15 +1532,15 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
CloseDocShell();
DrawDocShell* pNewDocSh;
- xDocShell = pNewDocSh = new DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_False);
+ xDocShell = pNewDocSh = new DrawDocShell(SFX_CREATE_MODE_STANDARD, false);
pNewDocSh->DoInitNew(NULL);
SdDrawDocument* pDoc = pNewDocSh->GetDoc();
pDoc->CreateFirstPages();
pDoc->StopWorkStartupDelay();
- mbDocPreview = sal_False;
+ mbDocPreview = false;
maDocFile = aDocFile;
- mbUserDataDirty = sal_True;
+ mbUserDataDirty = true;
}
else
bChangeMaster = (aLayoutFile.Len() != 0) && (maLayoutFile != aLayoutFile);
@@ -1551,14 +1550,14 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
if( aLayoutFile != maLayoutFile )
{
SfxObjectShell* pShell = xDocShell;
- DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
+ DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell);
::svl::IUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL;
if(pUndoMgr)
pUndoMgr->Undo();
- mbUserDataDirty = sal_True;
+ mbUserDataDirty = true;
}
else
- bChangeMaster = sal_False;
+ bChangeMaster = false;
}
else
{
@@ -1572,11 +1571,11 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
SfxItemSet* pSet = new SfxAllItemSet( pSfxApp->GetPool() );
if(IsOwnFormat(aDocFile))
{
- pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
+ pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) );
if(bDocPreview)
- pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) );
+ pSet->Put( SfxBoolItem( SID_PREVIEW, true ) );
RestorePassword( pSet, aDocFile );
- if( (lErr = pSfxApp->LoadTemplate( xDocShell, aDocFile, sal_True, pSet )) != 0 )
+ if( (lErr = pSfxApp->LoadTemplate( xDocShell, aDocFile, true, pSet )) != 0 )
ErrorHandler::HandleError(lErr);
else
SavePassword( xDocShell, aDocFile );
@@ -1589,10 +1588,10 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aDocFile ));
aReq.AppendItem( SfxStringItem( SID_REFERER, aEmptyStr ) );
aReq.AppendItem( SfxStringItem( SID_TARGETNAME, aTargetStr ) );
- aReq.AppendItem( SfxBoolItem( SID_HIDDEN, sal_True ) );
+ aReq.AppendItem( SfxBoolItem( SID_HIDDEN, true ) );
aReq.AppendItem( SfxBoolItem( SID_PREVIEW, bDocPreview ) );
- const SfxViewFrameItem* pRet = PTR_CAST( SfxViewFrameItem, SFX_APP()->ExecuteSlot( aReq ) );
+ const SfxViewFrameItem* pRet = dynamic_cast< const SfxViewFrameItem* >(SFX_APP()->ExecuteSlot( aReq ) );
if ( pRet && pRet->GetFrame() && pRet->GetFrame()->GetObjectShell() )
xDocShell = pRet->GetFrame()->GetObjectShell();
@@ -1604,7 +1603,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
mnShowPage = 0;
mbDocPreview = bDocPreview;
maDocFile = aDocFile;
- mbUserDataDirty = sal_True;
+ mbUserDataDirty = true;
}
if(bChangeMaster && (aLayoutFile != maDocFile))
@@ -1619,11 +1618,11 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
if(IsOwnFormat(aLayoutFile))
{
- pSet->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
- pSet->Put( SfxBoolItem( SID_PREVIEW, sal_True ) );
+ pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) );
+ pSet->Put( SfxBoolItem( SID_PREVIEW, true ) );
RestorePassword( pSet, aLayoutFile );
- if( (lErr = pSfxApp->LoadTemplate( xLayoutDocShell, aLayoutFile, sal_True, pSet )) != 0 )
+ if( (lErr = pSfxApp->LoadTemplate( xLayoutDocShell, aLayoutFile, true, pSet )) != 0 )
ErrorHandler::HandleError(lErr);
SavePassword( xLayoutDocShell, aLayoutFile );
}
@@ -1632,23 +1631,23 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
// die Implementierung ermitteln
SfxObjectShell* pShell = xDocShell;
- DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell);
+ DrawDocShell* pDocShell = dynamic_cast< DrawDocShell* >(pShell);
SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
pShell = xLayoutDocShell;
- pDocShell = PTR_CAST(DrawDocShell,pShell);
+ pDocShell = dynamic_cast< DrawDocShell* >(pShell);
SdDrawDocument* pLayoutDoc = pDocShell?pDocShell->GetDoc():NULL;
if( pDoc && pLayoutDoc )
{
- pDoc->SetMasterPage(0, aEmptyStr, pLayoutDoc, sal_True, sal_False );
+ pDoc->SetMasterPage(0, aEmptyStr, pLayoutDoc, true, false);
}
else
{
DBG_ERROR("sd::AssistentDlgImpl::UpdatePreview(), no document for preview?");
}
- mbUserDataDirty = sal_True;
+ mbUserDataDirty = true;
}
maLayoutFile = aLayoutFile;
@@ -1662,7 +1661,7 @@ void AssistentDlgImpl::UpdatePreview( sal_Bool bDocPreview )
maPreview.SetObjectShell( xDocShell, mnShowPage );
}
- mbPreviewUpdating = sal_False;
+ mbPreviewUpdating = false;
}
void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPath )
@@ -1674,7 +1673,7 @@ void AssistentDlgImpl::SavePassword( SfxObjectShellLock xDoc, const String& rPat
{
SfxItemSet * pSet = pMedium->GetItemSet();
const SfxPoolItem *pItem = 0;
- if( pSet->GetItemState(SID_PASSWORD, sal_True, &pItem) == SFX_ITEM_SET )
+ if( pSet->GetItemState(SID_PASSWORD, true, &pItem) == SFX_ITEM_SET )
{
//TODO/MBA: testing
String aPass( ((const SfxStringItem*)pItem)->GetValue());
@@ -1737,7 +1736,7 @@ void AssistentDlgImpl::DeletePassords()
}
}
-sal_Bool AssistentDlgImpl::IsOwnFormat( const String& rPath )
+bool AssistentDlgImpl::IsOwnFormat( const String& rPath )
{
INetURLObject aURL( rPath );
String aExt( aURL.GetFileExtension() );
@@ -1869,7 +1868,7 @@ Image AssistentDlgImpl::GetUiIconForCommand (const ::rtl::OUString& sCommandURL)
//////////////////////////////////////////////
-AssistentDlg::AssistentDlg(Window* pParent, sal_Bool bAutoPilot) :
+AssistentDlg::AssistentDlg(Window* pParent, bool bAutoPilot) :
ModalDialog(pParent,SdResId(DLG_ASS))
{
Link aFinishLink = LINK(this,AssistentDlg, FinishHdl);
@@ -1940,7 +1939,7 @@ OutputType AssistentDlg::GetOutputMedium() const
return OUTPUT_ORIGINAL;
}
-sal_Bool AssistentDlg::IsSummary() const
+bool AssistentDlg::IsSummary() const
{
return mpImpl->mpPage5SummaryCB->IsChecked();
}
@@ -1955,12 +1954,12 @@ String AssistentDlg::GetDocPath() const
return mpImpl->GetDocFileName();
}
-sal_Bool AssistentDlg::GetStartWithFlag() const
+bool AssistentDlg::GetStartWithFlag() const
{
return !mpImpl->maStartWithFlag.IsChecked();
}
-sal_Bool AssistentDlg::IsDocEmpty() const
+bool AssistentDlg::IsDocEmpty() const
{
return mpImpl->GetDocFileName().Len() == 0 &&
mpImpl->GetLayoutFileName().Len() == 0;
diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx
index 95bcc29faf72..b881977d9ee1 100644
--- a/sd/source/ui/dlg/dlgassim.cxx
+++ b/sd/source/ui/dlg/dlgassim.cxx
@@ -169,10 +169,10 @@ void SdPageListControl::Fill( SdDrawDocument* pDoc )
pOutliner->Clear();
}
-sal_uInt16 SdPageListControl::GetSelectedPage()
+sal_uInt32 SdPageListControl::GetSelectedPage()
{
SvLBoxEntry* pSelEntry = GetCurEntry();
- sal_uInt16 nPage = 0;
+ sal_uInt32 nPage = 0;
if ( pSelEntry )
{
@@ -192,10 +192,10 @@ sal_uInt16 SdPageListControl::GetSelectedPage()
return nPage;
}
-sal_Bool SdPageListControl::IsPageChecked( sal_uInt16 nPage )
+bool SdPageListControl::IsPageChecked( sal_uInt32 nPage )
{
SvLBoxEntry* pEntry = GetModel()->GetEntry(nPage);
- return pEntry?(sal_Bool)(GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED): sal_False;
+ return pEntry ? (GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED) : false;
}
void SdPageListControl::DataChanged( const DataChangedEvent& rDCEvt )
diff --git a/sd/source/ui/dlg/dlgassim.hxx b/sd/source/ui/dlg/dlgassim.hxx
index 49e90d4a7770..f205b591427e 100644
--- a/sd/source/ui/dlg/dlgassim.hxx
+++ b/sd/source/ui/dlg/dlgassim.hxx
@@ -43,8 +43,8 @@ public:
void Fill( SdDrawDocument* pDoc );
void Clear();
- sal_uInt16 GetSelectedPage();
- sal_Bool IsPageChecked( sal_uInt16 nPage );
+ sal_uInt32 GetSelectedPage();
+ bool IsPageChecked( sal_uInt32 nPage );
DECL_LINK( CheckButtonClickHdl, SvLBoxButtonData * );
diff --git a/sd/source/ui/dlg/dlgctrls.cxx b/sd/source/ui/dlg/dlgctrls.cxx
index 84af83ff748d..181d07c24bfc 100644
--- a/sd/source/ui/dlg/dlgctrls.cxx
+++ b/sd/source/ui/dlg/dlgctrls.cxx
@@ -77,24 +77,6 @@ void FadeEffectLB::Fill()
// -----------------------------------------------------------------------------
-/*
-void FadeEffectLB::SelectEffect( presentation::FadeEffect eFE )
-{
- sal_Bool bFound = sal_False;
-
- for( long i = 0, nCount = sizeof( aEffects ) / sizeof( FadeEffectPair ); ( i < nCount ) && !bFound; i++ )
- {
- if( aEffects[ i ].meFE == eFE )
- {
- SelectEntryPos( (sal_uInt16) i );
- bFound = sal_True;
- }
- }
-}
-*/
-
-// -----------------------------------------------------------------------------
-
void FadeEffectLB::applySelected( SdPage* pSlide ) const
{
const sal_uInt16 nPos = GetSelectEntryPos();
diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx
index 126b3ef0bcfd..a03684d4b663 100644
--- a/sd/source/ui/dlg/dlgfield.cxx
+++ b/sd/source/ui/dlg/dlgfield.cxx
@@ -92,9 +92,10 @@ SvxFieldData* SdModifyFieldDlg::GetField()
aRbtVar.IsChecked() != aRbtVar.GetSavedValue() ||
aLbFormat.GetSelectEntryPos() != aLbFormat.GetSavedValue() )
{
- if( pField->ISA( SvxDateField ) )
+ const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField);
+
+ if( pDateField )
{
- const SvxDateField* pDateField = (const SvxDateField*) pField;
SvxDateType eType;
SvxDateFormat eFormat;
@@ -109,71 +110,84 @@ SvxFieldData* SdModifyFieldDlg::GetField()
( (SvxDateField*) pNewField )->SetType( eType );
( (SvxDateField*) pNewField )->SetFormat( eFormat );
}
- else if( pField->ISA( SvxExtTimeField ) )
+ else
{
- const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
- SvxTimeType eType;
- SvxTimeFormat eFormat;
+ const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField);
- if( aRbtFix.IsChecked() )
- eType = SVXTIMETYPE_FIX;
- else
- eType = SVXTIMETYPE_VAR;
+ if( pTimeField )
+ {
+ SvxTimeType eType;
+ SvxTimeFormat eFormat;
- eFormat = (SvxTimeFormat) ( aLbFormat.GetSelectEntryPos() + 2 );
+ if( aRbtFix.IsChecked() )
+ eType = SVXTIMETYPE_FIX;
+ else
+ eType = SVXTIMETYPE_VAR;
- pNewField = new SvxExtTimeField( *pTimeField );
- ( (SvxExtTimeField*) pNewField )->SetType( eType );
- ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat );
- }
- else if( pField->ISA( SvxExtFileField ) )
- {
- const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
- SvxFileType eType;
- SvxFileFormat eFormat;
+ eFormat = (SvxTimeFormat) ( aLbFormat.GetSelectEntryPos() + 2 );
- if( aRbtFix.IsChecked() )
- eType = SVXFILETYPE_FIX;
+ pNewField = new SvxExtTimeField( *pTimeField );
+ ( (SvxExtTimeField*) pNewField )->SetType( eType );
+ ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat );
+ }
else
- eType = SVXFILETYPE_VAR;
-
- eFormat = (SvxFileFormat) ( aLbFormat.GetSelectEntryPos() );
-
- ::sd::DrawDocShell* pDocSh = PTR_CAST( ::sd::DrawDocShell,
- SfxObjectShell::Current() );
-
- if( pDocSh )
{
- SvxExtFileField aFileField( *pFileField );
-
- String aName;
- if( pDocSh->HasName() )
- aName = pDocSh->GetMedium()->GetName();
-
- // #91225# Get current filename, not the one stored in the old field
- pNewField = new SvxExtFileField( aName );
- ( (SvxExtFileField*) pNewField )->SetType( eType );
- ( (SvxExtFileField*) pNewField )->SetFormat( eFormat );
+ const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField);
+
+ if( pFileField )
+ {
+ SvxFileType eType;
+ SvxFileFormat eFormat;
+
+ if( aRbtFix.IsChecked() )
+ eType = SVXFILETYPE_FIX;
+ else
+ eType = SVXFILETYPE_VAR;
+
+ eFormat = (SvxFileFormat) ( aLbFormat.GetSelectEntryPos() );
+
+ ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
+
+ if( pDocSh )
+ {
+ SvxExtFileField aFileField( *pFileField );
+
+ String aName;
+ if( pDocSh->HasName() )
+ aName = pDocSh->GetMedium()->GetName();
+
+ // #91225# Get current filename, not the one stored in the old field
+ pNewField = new SvxExtFileField( aName );
+ ( (SvxExtFileField*) pNewField )->SetType( eType );
+ ( (SvxExtFileField*) pNewField )->SetFormat( eFormat );
+ }
+ }
+ else
+ {
+ const SvxAuthorField* pSvxAuthorField = dynamic_cast< const SvxAuthorField* >(pField);
+
+ if( pSvxAuthorField )
+ {
+ SvxAuthorType eType;
+ SvxAuthorFormat eFormat;
+
+ if( aRbtFix.IsChecked() )
+ eType = SVXAUTHORTYPE_FIX;
+ else
+ eType = SVXAUTHORTYPE_VAR;
+
+ eFormat = (SvxAuthorFormat) ( aLbFormat.GetSelectEntryPos() );
+
+ // #91225# Get current state of address, not the old one
+ SvtUserOptions aUserOptions;
+ SvxAuthorField* pNewAuthorField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() );
+ pNewAuthorField->SetType( eType );
+ pNewAuthorField->SetFormat( eFormat );
+ pNewField = pNewAuthorField;
+ }
+ }
}
}
- else if( pField->ISA( SvxAuthorField ) )
- {
- SvxAuthorType eType;
- SvxAuthorFormat eFormat;
-
- if( aRbtFix.IsChecked() )
- eType = SVXAUTHORTYPE_FIX;
- else
- eType = SVXAUTHORTYPE_VAR;
-
- eFormat = (SvxAuthorFormat) ( aLbFormat.GetSelectEntryPos() );
-
- // #91225# Get current state of address, not the old one
- SvtUserOptions aUserOptions;
- pNewField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() );
- ( (SvxAuthorField*) pNewField )->SetType( eType );
- ( (SvxAuthorField*) pNewField )->SetFormat( eFormat );
- }
}
return( pNewField );
@@ -191,9 +205,10 @@ void SdModifyFieldDlg::FillFormatList()
aLbFormat.Clear();
- if( pField->ISA( SvxDateField ) )
+ const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField);
+
+ if( pDateField )
{
- const SvxDateField* pDateField = (const SvxDateField*) pField;
SvxDateField aDateField( *pDateField );
//SVXDATEFORMAT_APPDEFAULT, // Wird nicht benutzt
@@ -217,71 +232,82 @@ void SdModifyFieldDlg::FillFormatList()
aLbFormat.SelectEntryPos( (sal_uInt16) ( pDateField->GetFormat() - 2 ) );
}
- else if( pField->ISA( SvxExtTimeField ) )
+ else
{
- const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
- SvxExtTimeField aTimeField( *pTimeField );
+ const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField);
- //SVXTIMEFORMAT_APPDEFAULT, // Wird nicht benutzt
- //SVXTIMEFORMAT_SYSTEM, // Wird nicht benutzt
- aLbFormat.InsertEntry( String( SdResId( STR_STANDARD_NORMAL ) ) );
-
- SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter();
- aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49
- aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
- aTimeField.SetFormat( SVXTIMEFORMAT_24_HMS ); // 13:49:38
- aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
- aTimeField.SetFormat( SVXTIMEFORMAT_24_HMSH ); // 13:49:38.78
- aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
- aTimeField.SetFormat( SVXTIMEFORMAT_12_HM ); // 01:49
- aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
- aTimeField.SetFormat( SVXTIMEFORMAT_12_HMS ); // 01:49:38
- aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
- aTimeField.SetFormat( SVXTIMEFORMAT_12_HMSH ); // 01:49:38.78
- aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
- //SVXTIMEFORMAT_AM_HM, // 01:49 PM
- //SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM
- //SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM
-
- aLbFormat.SelectEntryPos( (sal_uInt16) ( pTimeField->GetFormat() - 2 ) );
- }
- else if( pField->ISA( SvxExtFileField ) )
- {
- const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
- SvxExtFileField aFileField( *pFileField );
+ if( pTimeField )
+ {
+ SvxExtTimeField aTimeField( *pTimeField );
+
+ //SVXTIMEFORMAT_APPDEFAULT, // Wird nicht benutzt
+ //SVXTIMEFORMAT_SYSTEM, // Wird nicht benutzt
+ aLbFormat.InsertEntry( String( SdResId( STR_STANDARD_NORMAL ) ) );
+
+ SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter();
+ aTimeField.SetFormat( SVXTIMEFORMAT_24_HM ); // 13:49
+ aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
+ aTimeField.SetFormat( SVXTIMEFORMAT_24_HMS ); // 13:49:38
+ aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
+ aTimeField.SetFormat( SVXTIMEFORMAT_24_HMSH ); // 13:49:38.78
+ aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
+ aTimeField.SetFormat( SVXTIMEFORMAT_12_HM ); // 01:49
+ aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
+ aTimeField.SetFormat( SVXTIMEFORMAT_12_HMS ); // 01:49:38
+ aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
+ aTimeField.SetFormat( SVXTIMEFORMAT_12_HMSH ); // 01:49:38.78
+ aLbFormat.InsertEntry( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) );
+ //SVXTIMEFORMAT_AM_HM, // 01:49 PM
+ //SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM
+ //SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM
+
+ aLbFormat.SelectEntryPos( (sal_uInt16) ( pTimeField->GetFormat() - 2 ) );
+ }
+ else
+ {
+ const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField);
- aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME_EXT ) ) );
- aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_FULLPATH ) ) );
- aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_PATH ) ) );
- aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME ) ) );
+ if( pFileField )
+ {
+ SvxExtFileField aFileField( *pFileField );
- aLbFormat.SelectEntryPos( (sal_uInt16) ( pFileField->GetFormat() ) );
- }
- else if( pField->ISA( SvxAuthorField ) )
- {
- const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
- SvxAuthorField aAuthorField( *pAuthorField );
+ aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME_EXT ) ) );
+ aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_FULLPATH ) ) );
+ aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_PATH ) ) );
+ aLbFormat.InsertEntry( String( SdResId( STR_FILEFORMAT_NAME ) ) );
- for( sal_uInt16 i = 0; i < 4; i++ )
- {
- aAuthorField.SetFormat( (SvxAuthorFormat) i );
- aLbFormat.InsertEntry( aAuthorField.GetFormatted() );
- }
+ aLbFormat.SelectEntryPos( (sal_uInt16) ( pFileField->GetFormat() ) );
+ }
+ else
+ {
+ const SvxAuthorField* pAuthorField = dynamic_cast< const SvxAuthorField* >(pField);
- aLbFormat.SelectEntryPos( (sal_uInt16) ( pAuthorField->GetFormat() ) );
+ if( pAuthorField )
+ {
+ SvxAuthorField aAuthorField( *pAuthorField );
- }
+ for( sal_uInt16 i = 0; i < 4; i++ )
+ {
+ aAuthorField.SetFormat( (SvxAuthorFormat) i );
+ aLbFormat.InsertEntry( aAuthorField.GetFormatted() );
+ }
+ aLbFormat.SelectEntryPos( (sal_uInt16) ( pAuthorField->GetFormat() ) );
+ }
+ }
+ }
+ }
}
void SdModifyFieldDlg::FillControls()
{
aLbFormat.Clear();
- if( pField->ISA( SvxDateField ) )
+ const SvxDateField* pDateField = dynamic_cast< const SvxDateField* >(pField);
+
+ if( pDateField )
{
- const SvxDateField* pDateField = (const SvxDateField*) pField;
SvxDateField aDateField( *pDateField );
if( pDateField->GetType() == SVXDATETYPE_FIX )
@@ -289,41 +315,54 @@ void SdModifyFieldDlg::FillControls()
else
aRbtVar.Check();
}
- else if( pField->ISA( SvxExtTimeField ) )
+ else
{
- const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField;
- SvxExtTimeField aTimeField( *pTimeField );
+ const SvxExtTimeField* pTimeField = dynamic_cast< const SvxExtTimeField* >(pField);
- if( pTimeField->GetType() == SVXTIMETYPE_FIX )
- aRbtFix.Check();
- else
- aRbtVar.Check();
- }
- else if( pField->ISA( SvxExtFileField ) )
- {
- const SvxExtFileField* pFileField = (const SvxExtFileField*) pField;
- SvxExtFileField aFileField( *pFileField );
+ if( pTimeField )
+ {
+ SvxExtTimeField aTimeField( *pTimeField );
- if( pFileField->GetType() == SVXFILETYPE_FIX )
- aRbtFix.Check();
+ if( pTimeField->GetType() == SVXTIMETYPE_FIX )
+ aRbtFix.Check();
+ else
+ aRbtVar.Check();
+ }
else
- aRbtVar.Check();
- }
- else if( pField->ISA( SvxAuthorField ) )
- {
- const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField;
- SvxAuthorField aAuthorField( *pAuthorField );
+ {
+ const SvxExtFileField* pFileField = dynamic_cast< const SvxExtFileField* >(pField);
- if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX )
- aRbtFix.Check();
- else
- aRbtVar.Check();
+ if( pFileField )
+ {
+ SvxExtFileField aFileField( *pFileField );
+
+ if( pFileField->GetType() == SVXFILETYPE_FIX )
+ aRbtFix.Check();
+ else
+ aRbtVar.Check();
+ }
+ else
+ {
+ const SvxAuthorField* pAuthorField = dynamic_cast< const SvxAuthorField* >(pField);
+
+ if( pAuthorField )
+ {
+ SvxAuthorField aAuthorField( *pAuthorField );
+
+ if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX )
+ aRbtFix.Check();
+ else
+ aRbtVar.Check();
+ }
+ }
+ }
}
+
aRbtFix.SaveValue();
aRbtVar.SaveValue();
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == maInputSet.GetItemState(EE_CHAR_LANGUAGE, sal_True, &pItem ) )
+ if( SFX_ITEM_SET == maInputSet.GetItemState(EE_CHAR_LANGUAGE, true, &pItem ) )
maLbLanguage.SelectLanguage( static_cast<const SvxLanguageItem*>(pItem)->GetLanguage() );
maLbLanguage.SaveValue();
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index c79b13946387..755b9a81b461 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -42,7 +42,6 @@
#include <svx/dialogs.hrc>
#include <svl/intitem.hxx>
-#include <svx/svdmark.hxx>
#include "View.hxx"
#include <svx/svdobj.hxx>
#include <svl/style.hxx>
@@ -73,7 +72,7 @@ OutlineBulletDlg::OutlineBulletDlg(
::sd::View* pView )
: SfxTabDialog ( pParent, SdResId(TAB_OUTLINEBULLET) ),
aInputSet ( *pAttr ),
- bTitle ( sal_False ),
+ bTitle ( false ),
pSdView ( pView )
{
FreeResource();
@@ -84,26 +83,26 @@ OutlineBulletDlg::OutlineBulletDlg(
pOutputSet = new SfxItemSet( *pAttr );
pOutputSet->ClearItem();
- sal_Bool bOutliner = sal_False;
+ bool bOutliner = false;
// Sonderbehandlung wenn eine Title Objekt selektiert wurde
if( pView )
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- const sal_uLong nCount = rMarkList.GetMarkCount();
- for(sal_uLong nNum = 0; nNum < nCount; nNum++)
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nNum(0); nNum < aSelection.size(); nNum++)
{
- SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj();
+ const SdrObject* pObj = aSelection[nNum];
+
if( pObj->GetObjInventor() == SdrInventor )
{
-
switch(pObj->GetObjIdentifier())
{
case OBJ_TITLETEXT:
- bTitle = sal_True;
+ bTitle = true;
break;
case OBJ_OUTLINETEXT:
- bOutliner = sal_True;
+ bOutliner = true;
break;
}
}
@@ -120,7 +119,7 @@ OutlineBulletDlg::OutlineBulletDlg(
aStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " 1" ) );
SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO);
if( pFirstStyleSheet )
- pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, sal_False, (const SfxPoolItem**)&pItem);
+ pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, (const SfxPoolItem**)&pItem);
}
if( pItem == NULL )
@@ -131,25 +130,14 @@ OutlineBulletDlg::OutlineBulletDlg(
aInputSet.Put(*pItem, EE_PARA_NUMBULLET);
}
- /* debug
- if( SFX_ITEM_SET == aInputSet.GetItemState(EE_PARA_NUMBULLET, sal_False, &pItem ))
- {
- SvxNumRule& rItem = *((SvxNumBulletItem*)pItem)->GetNumRule();
- for( int i = 0; i < 9; i++ )
- {
- SvxNumberFormat aNumberFormat = rItem.GetLevel(i);
- }
- }
- */
-
- if(bTitle && aInputSet.GetItemState(EE_PARA_NUMBULLET,sal_True) == SFX_ITEM_ON )
+ if(bTitle && aInputSet.GetItemState(EE_PARA_NUMBULLET,true) == SFX_ITEM_ON )
{
- SvxNumBulletItem* pItem = (SvxNumBulletItem*)aInputSet.GetItem(EE_PARA_NUMBULLET,sal_True);
+ SvxNumBulletItem* pItem = (SvxNumBulletItem*)aInputSet.GetItem(EE_PARA_NUMBULLET,true);
SvxNumRule* pRule = pItem->GetNumRule();
if(pRule)
{
SvxNumRule aNewRule( *pRule );
- aNewRule.SetFeatureFlag( NUM_NO_NUMBERS, sal_True );
+ aNewRule.SetFeatureFlag( NUM_NO_NUMBERS, true );
SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET );
aInputSet.Put(aNewItem);
@@ -210,26 +198,17 @@ const SfxItemSet* OutlineBulletDlg::GetOutputItemSet() const
pOutputSet->Put( aSet );
const SfxPoolItem *pItem = NULL;
- if( SFX_ITEM_SET == pOutputSet->GetItemState(pOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE), sal_False, &pItem ))
+ if( SFX_ITEM_SET == pOutputSet->GetItemState(pOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE), false, &pItem ))
{
SdBulletMapper::MapFontsInNumRule( *((SvxNumBulletItem*)pItem)->GetNumRule(), *pOutputSet );
-
-/* #i35937#
- SfxUInt16Item aBulletState( EE_PARA_BULLETSTATE, 1 );
- pOutputSet->Put(aBulletState);
-*/
}
-/* #i35937#
- SdBulletMapper::PostMapNumBulletForDialog( *pOutputSet );
-*/
-
- if(bTitle && pOutputSet->GetItemState(EE_PARA_NUMBULLET,sal_True) == SFX_ITEM_ON )
+ if(bTitle && pOutputSet->GetItemState(EE_PARA_NUMBULLET,true) == SFX_ITEM_ON )
{
- SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)pOutputSet->GetItem(EE_PARA_NUMBULLET,sal_True);
+ SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)pOutputSet->GetItem(EE_PARA_NUMBULLET,true);
SvxNumRule* pRule = pBulletItem->GetNumRule();
if(pRule)
- pRule->SetFeatureFlag( NUM_NO_NUMBERS, sal_False );
+ pRule->SetFeatureFlag( NUM_NO_NUMBERS, false );
}
return pOutputSet;
diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx
index eeb03420c48f..36002862af8b 100644
--- a/sd/source/ui/dlg/dlgpage.cxx
+++ b/sd/source/ui/dlg/dlgpage.cxx
@@ -51,7 +51,7 @@
|*
\************************************************************************/
-SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) :
+SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, bool bAreaPage ) :
SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ),
mrOutAttrs ( *pAttr ),
mpDocShell ( pDocSh )
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index 105f2ba2f2da..c5f5a541e72e 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -81,46 +81,45 @@ SdSnapLineDlg::SdSnapLineDlg(
aBtnDelete.SetClickHdl(LINK(this, SdSnapLineDlg, ClickHdl));
- SetFieldUnit( aMtrFldX, eUIUnit, sal_True );
- SetFieldUnit( aMtrFldY, eUIUnit, sal_True );
-
- // WorkArea holen
- Rectangle aWorkArea = pView->GetWorkArea();
+ SetFieldUnit( aMtrFldX, eUIUnit, true );
+ SetFieldUnit( aMtrFldY, eUIUnit, true );
// PoolUnit ermitteln
SfxItemPool* pPool = rInAttrs.GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool?" );
SfxMapUnit ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH );
- // #i48497# Consider page origin
+ // get WorkArea, consider page origin
+ basegfx::B2DRange aWorkArea(pView->GetWorkArea());
SdrPageView* pPV = pView->GetSdrPageView();
- Point aLeftTop(aWorkArea.Left()+1, aWorkArea.Top()+1);
- pPV->LogicToPagePos(aLeftTop);
- Point aRightBottom(aWorkArea.Right()-2, aWorkArea.Bottom()-2);
- pPV->LogicToPagePos(aRightBottom);
+
+ if(pPV)
+ {
+ aWorkArea.transform(basegfx::tools::createTranslateB2DHomMatrix(pPV->GetPageOrigin()));
+ }
// Hier werden die Max- und MinWerte in Abhaengigkeit von der
// WorkArea, PoolUnit und der FieldUnit:
- SetMetricValue( aMtrFldX, aLeftTop.X(), ePoolUnit );
+ SetMetricValue( aMtrFldX, basegfx::fround(aWorkArea.getMinX()), ePoolUnit );
long nValue = static_cast<long>(aMtrFldX.GetValue());
nValue = Fraction( nValue ) / aUIScale;
aMtrFldX.SetMin( nValue );
aMtrFldX.SetFirst( nValue );
- SetMetricValue( aMtrFldX, aRightBottom.X(), ePoolUnit );
+ SetMetricValue( aMtrFldX, basegfx::fround(aWorkArea.getMaxX()), ePoolUnit );
nValue = static_cast<long>(aMtrFldX.GetValue());
nValue = Fraction( nValue ) / aUIScale;
aMtrFldX.SetMax( nValue );
aMtrFldX.SetLast( nValue );
- SetMetricValue( aMtrFldY, aLeftTop.Y(), ePoolUnit );
+ SetMetricValue( aMtrFldY, basegfx::fround(aWorkArea.getMinY()), ePoolUnit );
nValue = static_cast<long>(aMtrFldY.GetValue());
nValue = Fraction( nValue ) / aUIScale;
aMtrFldY.SetMin( nValue );
aMtrFldY.SetFirst( nValue );
- SetMetricValue( aMtrFldY, aRightBottom.Y(), ePoolUnit );
+ SetMetricValue( aMtrFldY, basegfx::fround(aWorkArea.getMaxY()), ePoolUnit );
nValue = static_cast<long>(aMtrFldY.GetValue());
nValue = Fraction( nValue ) / aUIScale;
aMtrFldY.SetMax( nValue );
@@ -145,9 +144,9 @@ SdSnapLineDlg::SdSnapLineDlg(
IMPL_LINK( SdSnapLineDlg, ClickHdl, Button *, pBtn )
{
- if ( pBtn == &aRbPoint ) SetInputFields(sal_True, sal_True);
- else if ( pBtn == &aRbHorz ) SetInputFields(sal_False, sal_True);
- else if ( pBtn == &aRbVert ) SetInputFields(sal_True, sal_False);
+ if ( pBtn == &aRbPoint ) SetInputFields(true, true);
+ else if ( pBtn == &aRbHorz ) SetInputFields(false, true);
+ else if ( pBtn == &aRbVert ) SetInputFields(true, false);
else if ( pBtn == &aBtnDelete ) EndDialog(RET_SNAP_DELETE);
return 0;
@@ -195,7 +194,7 @@ void SdSnapLineDlg::HideRadioGroup()
|*
\************************************************************************/
-void SdSnapLineDlg::SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY)
+void SdSnapLineDlg::SetInputFields(bool bEnableX, bool bEnableY)
{
if ( bEnableX )
{
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index 2c0ac40b0020..015059cf20df 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -55,7 +55,7 @@ using namespace ::com::sun::star::uno;
const int SdDocPreviewWin::FRAME = 4;
-void SdDocPreviewWin::SetObjectShell( SfxObjectShell* pObj, sal_uInt16 nShowPage )
+void SdDocPreviewWin::SetObjectShell( SfxObjectShell* pObj, sal_uInt32 nShowPage )
{
mpObj = pObj;
mnShowPage = nShowPage;
@@ -68,7 +68,7 @@ void SdDocPreviewWin::SetObjectShell( SfxObjectShell* pObj, sal_uInt16 nShowPage
}
SdDocPreviewWin::SdDocPreviewWin( Window* pParent, const ResId& rResId )
-: Control(pParent, rResId), pMetaFile( 0 ), bInEffect(sal_False), mpObj(NULL), mnShowPage(0)
+: Control(pParent, rResId), pMetaFile( 0 ), bInEffect(false), mpObj(NULL), mnShowPage(0)
{
SetBorderStyle( WINDOW_BORDER_MONO );
svtools::ColorConfig aColorConfig;
@@ -141,8 +141,8 @@ void SdDocPreviewWin::Paint( const Rectangle& rRect )
SvtAccessibilityOptions aAccOptions;
bool bUseContrast = aAccOptions.GetIsForPagePreviews() && Application::GetSettings().GetStyleSettings().GetHighContrastMode();
SetDrawMode( bUseContrast
- ? ::sd::ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ::sd::ViewShell::OUTPUT_DRAWMODE_COLOR );
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR );
ImpPaint( pMetaFile, (VirtualDevice*)this );
}
@@ -198,7 +198,7 @@ long SdDocPreviewWin::Notify( NotifyEvent& rNEvt )
void SdDocPreviewWin::updateViewSettings()
{
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell,mpObj);
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(mpObj);
SdDrawDocument* pDoc = pDocShell?pDocShell->GetDoc():NULL;
SvtAccessibilityOptions aAccOptions;
@@ -228,28 +228,26 @@ void SdDocPreviewWin::updateViewSettings()
VirtualDevice aVDev;
- const Fraction aFrac( pDoc->GetScaleFraction() );
- const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac );
+ const Fraction aFrac( pDoc->GetExchangeObjectScale() );
+ const MapMode aMap( pDoc->GetExchangeObjectUnit(), Point(), aFrac, aFrac );
aVDev.SetMapMode( aMap );
// #109058# Disable output, as we only want to record a metafile
- aVDev.EnableOutput( sal_False );
+ aVDev.EnableOutput( false );
pMtf->Record( &aVDev );
::sd::DrawView* pView = new ::sd::DrawView(pDocShell, this, NULL);
+ pView->SetBordVisible( false );
+ pView->SetPageVisible( false );
+ pView->ShowSdrPage( *pPage );
- const Size aSize( pPage->GetSize() );
-
- pView->SetBordVisible( sal_False );
- pView->SetPageVisible( sal_False );
- pView->ShowSdrPage( pPage );
-
- const Point aNewOrg( pPage->GetLftBorder(), pPage->GetUppBorder() );
- const Size aNewSize( aSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder(),
- aSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder() );
+ const Point aNewOrg( pPage->GetLeftPageBorder(), pPage->GetTopPageBorder() );
+ const Size aSize(basegfx::fround(pPage->GetPageScale().getX()), basegfx::fround(pPage->GetPageScale().getY()));
+ const Size aNewSize( aSize.Width() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder(),
+ aSize.Height() - pPage->GetTopPageBorder() - pPage->GetBottomPageBorder() );
const Rectangle aClipRect( aNewOrg, aNewSize );
MapMode aVMap( aMap );
@@ -285,7 +283,9 @@ void SdDocPreviewWin::updateViewSettings()
void SdDocPreviewWin::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- if( rHint.ISA( SfxSimpleHint ) && ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_COLORS_CHANGED )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if( pSfxSimpleHint && SFX_HINT_COLORS_CHANGED == pSfxSimpleHint->GetId() )
{
updateViewSettings();
}
diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx
index 6dadf6484b78..76b818e12633 100644
--- a/sd/source/ui/dlg/filedlg.cxx
+++ b/sd/source/ui/dlg/filedlg.cxx
@@ -71,8 +71,8 @@ private:
css::uno::Reference< css::media::XPlayer > mxPlayer;
sal_uLong mnPlaySoundEvent;
- sal_Bool mbUsableSelection;
- sal_Bool mbLabelPlaying;
+ bool mbUsableSelection;
+ bool mbLabelPlaying;
void CheckSelectionState();
@@ -135,7 +135,7 @@ IMPL_LINK( SdFileDialog_Imp, PlayMusicHdl, void *, EMPTYARG )
mxControlAccess->setLabel( css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY,
String( SdResId( STR_PLAY ) ) );
- mbLabelPlaying = sal_False;
+ mbLabelPlaying = false;
}
catch( css::lang::IllegalArgumentException )
{
@@ -169,7 +169,7 @@ IMPL_LINK( SdFileDialog_Imp, PlayMusicHdl, void *, EMPTYARG )
mxControlAccess->setLabel( css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY,
String( SdResId( STR_STOP ) ) );
- mbLabelPlaying = sal_True;
+ mbLabelPlaying = true;
}
catch( css::lang::IllegalArgumentException )
{
@@ -205,7 +205,7 @@ IMPL_LINK( SdFileDialog_Imp, IsMusicStoppedHdl, void *, EMPTYARG )
{
mxControlAccess->setLabel( css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY,
String( SdResId( STR_PLAY ) ) );
- mbLabelPlaying = sal_False;
+ mbLabelPlaying = false;
}
catch( css::lang::IllegalArgumentException )
{
@@ -228,9 +228,9 @@ void SdFileDialog_Imp::CheckSelectionState()
try
{
if( !aCurrFilter.Len() || ( aCurrFilter == String( SdResId( STR_EXPORT_HTML_NAME ) ) ) )
- mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_False );
+ mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, false );
else
- mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_True );
+ mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, true );
}
catch( css::lang::IllegalArgumentException )
{
@@ -247,7 +247,7 @@ SdFileDialog_Imp::SdFileDialog_Imp( const short nDialogType,
FileDialogHelper( nDialogType, 0 ),
mnPlaySoundEvent( 0 ),
mbUsableSelection( bUsableSelection ),
- mbLabelPlaying(sal_False)
+ mbLabelPlaying(false)
{
maUpdateTimer.SetTimeoutHdl(LINK(this, SdFileDialog_Imp, IsMusicStoppedHdl));
@@ -277,7 +277,7 @@ SdFileDialog_Imp::SdFileDialog_Imp( const short nDialogType,
{
try
{
- mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, sal_False );
+ mxControlAccess->enableControl( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION, false );
}
catch( css::lang::IllegalArgumentException )
{
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index 79de97d740fe..28f8dae4a407 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -86,7 +86,7 @@ class PresLayoutPreview : public Control
private:
SdPage* mpMaster;
HeaderFooterSettings maSettings;
- Size maPageSize;
+ basegfx::B2DVector maPageSize;
Rectangle maOutRect;
private:
@@ -216,12 +216,12 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, ::Window* pParent
if( pCurrentPage->GetPageKind() == PK_STANDARD )
{
pSlide = pCurrentPage;
- pNotes = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNum() + 1 );
+ pNotes = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNumber() + 1 );
}
else if( pCurrentPage->GetPageKind() == PK_NOTES )
{
pNotes = pCurrentPage;
- pSlide = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNum() -1 );
+ pSlide = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNumber() -1 );
mpCurrentPage = pSlide;
}
else
@@ -300,7 +300,7 @@ IMPL_LINK( HeaderFooterDialog, ActivatePageHdl, TabControl *, pTabCtrl )
IMPL_LINK( HeaderFooterDialog, DeactivatePageHdl, TabControl *, EMPTYARG )
{
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
@@ -358,11 +358,11 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides )
// apply to all slides
if( bToAll )
{
- int nPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
- int nPage;
+ sal_uInt32 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
+ sal_uInt32 nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
- SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_STANDARD );
+ SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
change( pUndoGroup, pPage, aNewSettings );
}
}
@@ -399,11 +399,11 @@ void HeaderFooterDialog::apply( bool bToAll, bool bForceSlides )
if( !bForceSlides || !(aNewSettings == maNotesHandoutSettings) )
{
// first set to all notes pages
- int nPageCount = mpDoc->GetSdPageCount( PK_NOTES );
- int nPage;
+ sal_uInt32 nPageCount = mpDoc->GetSdPageCount( PK_NOTES );
+ sal_uInt32 nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
- SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_NOTES );
+ SdPage* pPage = mpDoc->GetSdPage( nPage, PK_NOTES );
change( pUndoGroup, pPage, aNewSettings );
}
@@ -720,8 +720,8 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
// if set, set it on all notes master pages
if( bSet )
{
- sal_uInt16 nPageCount = mpDoc->GetMasterSdPageCount( PK_NOTES );
- sal_uInt16 nPage;
+ sal_uInt32 nPageCount = mpDoc->GetMasterSdPageCount( PK_NOTES );
+ sal_uInt32 nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( nPage, PK_NOTES ) );
@@ -736,8 +736,8 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
{
// get the language from the first master page
// or set it to all master pages
- sal_uInt16 nPageCount = bSet ? mpDoc->GetMasterSdPageCount( PK_NOTES ) : 1;
- sal_uInt16 nPage;
+ sal_uInt32 nPageCount = bSet ? mpDoc->GetMasterSdPageCount( PK_NOTES ) : 1;
+ sal_uInt32 nPage;
for( nPage = 0; nPage < nPageCount; nPage++ )
{
GetOrSetDateTimeLanguage( rLanguage, bSet, mpDoc->GetMasterSdPage( nPage, PK_STANDARD ) );
@@ -779,8 +779,12 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
if( aFieldInfo.pFieldItem )
{
const SvxFieldData* pFieldData = aFieldInfo.pFieldItem->GetField();
-// bug119985 2012.06.14
- if( pFieldData && (pFieldData->ISA( SvxDateTimeField ) || pFieldData->ISA( SvxDateField )) )
+
+ // bug119985 2012.06.14
+ if(pFieldData && (dynamic_cast< const SvxDateTimeField* >(pFieldData) || dynamic_cast< const SvxDateField* >(pFieldData)))
+ {
+ break;
+ }
{
break;
}
@@ -826,7 +830,9 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
///////////////////////////////////////////////////////////////////////
PresLayoutPreview::PresLayoutPreview( ::Window* pParent, const ResId& rResId, SdPage* pMaster )
-:Control( pParent, rResId ), mpMaster( pMaster ), maPageSize( pMaster->GetSize() )
+: Control( pParent, rResId ),
+ mpMaster( pMaster ),
+ maPageSize( pMaster->GetPageScale() )
{
}
@@ -849,14 +855,12 @@ void PresLayoutPreview::update( HeaderFooterSettings& rSettings )
void PresLayoutPreview::Paint( OutputDevice& aOut, SdrTextObj* pObj, bool bVisible, bool bDotted /* = false*/ )
{
// get object transformation
- basegfx::B2DHomMatrix aObjectTransform;
- basegfx::B2DPolyPolygon aObjectPolyPolygon;
- pObj->TRGetBaseGeometry(aObjectTransform, aObjectPolyPolygon);
+ basegfx::B2DHomMatrix aObjectTransform(pObj->getSdrObjectTransformation());
// build complete transformation by adding view transformation from
// logic page coordinates to local pixel coordinates
- const double fScaleX((double)maOutRect.getWidth() / (double)maPageSize.Width());
- const double fScaleY((double)maOutRect.getHeight() / (double)maPageSize.Height());
+ const double fScaleX((double)maOutRect.getWidth() / maPageSize.getX());
+ const double fScaleY((double)maOutRect.getHeight() / maPageSize.getY());
aObjectTransform.scale(fScaleX, fScaleY);
aObjectTransform.translate(maOutRect.TopLeft().X(), maOutRect.TopLeft().Y());
@@ -904,15 +908,15 @@ void PresLayoutPreview::Paint( const Rectangle& )
// calculate page size with correct aspect ratio
int nWidth, nHeight;
- if( maPageSize.Width() > maPageSize.Height() )
+ if( basegfx::fTools::more(maPageSize.getX(), maPageSize.getY()) )
{
nWidth = maOutRect.GetWidth();
- nHeight = long( (double)(nWidth * maPageSize.Height()) / (double)maPageSize.Width() );
+ nHeight = long( (nWidth * maPageSize.getY()) / maPageSize.getX() );
}
else
{
nHeight = maOutRect.GetHeight();
- nWidth = long( (double)(nHeight * maPageSize.Width()) / (double)maPageSize.Height() );
+ nWidth = long( (nHeight * maPageSize.getX()) / maPageSize.getY() );
}
maOutRect.nLeft += (maOutRect.GetWidth() - nWidth) >> 1;
diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx
index 526b1dac4bc4..94bf43b84576 100644
--- a/sd/source/ui/dlg/ins_paste.cxx
+++ b/sd/source/ui/dlg/ins_paste.cxx
@@ -45,7 +45,7 @@ SdInsertPasteDlg::SdInsertPasteDlg( Window* pWindow ) :
aBtnHelp( this, SdResId( BTN_HELP ) )
{
FreeResource();
- aRbAfter.Check( sal_True );
+ aRbAfter.Check( true );
}
// -----------------------------------------------------------------------------
@@ -56,7 +56,7 @@ SdInsertPasteDlg::~SdInsertPasteDlg()
// -----------------------------------------------------------------------------
-sal_Bool SdInsertPasteDlg::IsInsertBefore() const
+bool SdInsertPasteDlg::IsInsertBefore() const
{
return( aRbBefore.IsChecked() );
}
diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx
index 1bc1a95ae219..a462b4abd6a6 100644
--- a/sd/source/ui/dlg/inspagob.cxx
+++ b/sd/source/ui/dlg/inspagob.cxx
@@ -113,7 +113,7 @@ void SdInsertPagesObjsDlg::Reset()
aLbTree.SetCollapsedEntryBmp( pEntry, aImgTextH, BMP_COLOR_HIGHCONTRAST );
}
- aCbxMasters.Check( sal_True );
+ aCbxMasters.Check( true );
}
/*************************************************************************
@@ -149,7 +149,7 @@ List* SdInsertPagesObjsDlg::GetList( sal_uInt16 nType )
|*
\************************************************************************/
-sal_Bool SdInsertPagesObjsDlg::IsLink()
+bool SdInsertPagesObjsDlg::IsLink()
{
return( aCbxLink.IsChecked() );
}
@@ -160,7 +160,7 @@ sal_Bool SdInsertPagesObjsDlg::IsLink()
|*
\************************************************************************/
-sal_Bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
+bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
{
return( aCbxMasters.IsChecked() );
}
diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx b/sd/source/ui/dlg/layeroptionsdlg.cxx
index 04cabd39cc38..1b4763befe10 100644
--- a/sd/source/ui/dlg/layeroptionsdlg.cxx
+++ b/sd/source/ui/dlg/layeroptionsdlg.cxx
@@ -56,12 +56,12 @@ SdInsertLayerDlg::SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs,
SetText( aStr );
- maEdtName.SetText( ( ( const SdAttrLayerName& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() );
- maEdtTitle.SetText( ( ( const SdAttrLayerTitle& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() );
- maEdtDesc.SetText( ( ( const SdAttrLayerDesc& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() );
- maCbxVisible.Check( ( ( const SdAttrLayerVisible& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() );
- maCbxPrintable.Check( ( ( const SdAttrLayerPrintable& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() );
- maCbxLocked.Check( ( ( const SdAttrLayerLocked& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() );
+ maEdtName.SetText( ( ( const SfxStringItem& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() );
+ maEdtTitle.SetText( ( ( const SfxStringItem& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() );
+ maEdtDesc.SetText( ( ( const SfxStringItem& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() );
+ maCbxVisible.Check( ( ( const SfxBoolItem& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() );
+ maCbxPrintable.Check( ( ( const SfxBoolItem& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() );
+ maCbxLocked.Check( ( ( const SfxBoolItem& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() );
if( !bDeletable )
{
@@ -72,10 +72,10 @@ SdInsertLayerDlg::SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs,
void SdInsertLayerDlg::GetAttr( SfxItemSet& rAttrs )
{
- rAttrs.Put( SdAttrLayerName( maEdtName.GetText() ) );
- rAttrs.Put( SdAttrLayerTitle( maEdtTitle.GetText() ) );
- rAttrs.Put( SdAttrLayerDesc( maEdtDesc.GetText() ) );
- rAttrs.Put( SdAttrLayerVisible( maCbxVisible.IsChecked() ) );
- rAttrs.Put( SdAttrLayerPrintable( maCbxPrintable.IsChecked() ) );
- rAttrs.Put( SdAttrLayerLocked( maCbxLocked.IsChecked() ) );
+ rAttrs.Put( SfxStringItem( ATTR_LAYER_NAME, maEdtName.GetText() ) );
+ rAttrs.Put( SfxStringItem( ATTR_LAYER_TITLE, maEdtTitle.GetText() ) );
+ rAttrs.Put( SfxStringItem( ATTR_LAYER_DESC, maEdtDesc.GetText() ) );
+ rAttrs.Put( SfxBoolItem( ATTR_LAYER_VISIBLE, maCbxVisible.IsChecked() ) );
+ rAttrs.Put( SfxBoolItem( ATTR_LAYER_PRINTABLE, maCbxPrintable.IsChecked() ) );
+ rAttrs.Put( SfxBoolItem( ATTR_LAYER_LOCKED, maCbxLocked.IsChecked() ) );
}
diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx
index 5fafe9861725..deb37ae36f71 100644
--- a/sd/source/ui/dlg/masterlayoutdlg.cxx
+++ b/sd/source/ui/dlg/masterlayoutdlg.cxx
@@ -72,7 +72,7 @@ MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, S
case PK_STANDARD:
{
// aTitle = String( SdResId( STR_MASTER_LAYOUT_TITLE ) );
- maCBHeader.Enable( sal_False );
+ maCBHeader.Enable( false );
String aSlideNumberStr( SdResId( STR_SLIDE_NUMBER ) );
maCBPageNumber.SetText( aSlideNumberStr );
break;
@@ -116,7 +116,7 @@ void MasterLayoutDialog::applyChanges()
{
mpDoc->BegUndo(GetText());
- if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != maCBHeader.IsChecked() ) )
+ if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != (bool)maCBHeader.IsChecked() ) )
{
if( mbOldHeader )
remove( PRESOBJ_HEADER );
@@ -124,7 +124,7 @@ void MasterLayoutDialog::applyChanges()
create( PRESOBJ_HEADER );
}
- if( mbOldFooter != maCBFooter.IsChecked() )
+ if( mbOldFooter != (bool)maCBFooter.IsChecked() )
{
if( mbOldFooter )
remove( PRESOBJ_FOOTER );
@@ -132,7 +132,7 @@ void MasterLayoutDialog::applyChanges()
create( PRESOBJ_FOOTER );
}
- if( mbOldDate != maCBDate.IsChecked() )
+ if( mbOldDate != (bool)maCBDate.IsChecked() )
{
if( mbOldDate )
remove( PRESOBJ_DATETIME );
@@ -140,7 +140,7 @@ void MasterLayoutDialog::applyChanges()
create( PRESOBJ_DATETIME );
}
- if( mbOldPageNumber != maCBPageNumber.IsChecked() )
+ if( mbOldPageNumber != (bool)maCBPageNumber.IsChecked() )
{
if( mbOldPageNumber )
remove( PRESOBJ_SLIDENUMBER );
@@ -160,16 +160,17 @@ void MasterLayoutDialog::remove( PresObjKind eKind )
{
SdrObject* pObject = mpCurrentPage->GetPresObj( eKind );
- if( pObject )
+ if( pObject && pObject->getParentOfSdrObject() )
{
const bool bUndo = mpDoc->IsUndoEnabled();
if( bUndo )
mpDoc->AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pObject));
- SdrObjList* pOL =pObject->GetObjList();
- sal_uInt32 nOrdNum=pObject->GetOrdNumDirect();
- pOL->RemoveObject(nOrdNum);
+
+ pObject->getParentOfSdrObject()->RemoveObjectFromSdrObjList(pObject->GetNavigationPosition());
if( !bUndo )
- SdrObject::Free(pObject);
+ {
+ deleteSdrObjectSafeAndClearPointer(pObject);
+ }
}
}
diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx
index 2733545d50b0..458757755bc5 100644
--- a/sd/source/ui/dlg/morphdlg.cxx
+++ b/sd/source/ui/dlg/morphdlg.cxx
@@ -79,12 +79,8 @@ MorphDlg::MorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject*
FreeResource();
LoadSettings();
- SfxItemPool* pPool = (SfxItemPool*) pObj1->GetObjectItemPool();
- SfxItemSet aSet1( *pPool );
- SfxItemSet aSet2( *pPool );
-
- aSet1.Put(pObj1->GetMergedItemSet());
- aSet2.Put(pObj2->GetMergedItemSet());
+ SfxItemSet aSet1( pObj1->GetMergedItemSet() );
+ SfxItemSet aSet2( pObj2->GetMergedItemSet() );
const XLineStyle eLineStyle1 = ( (const XLineStyleItem&) aSet1.Get( XATTR_LINESTYLE ) ).GetValue();
const XLineStyle eLineStyle2 = ( (const XLineStyleItem&) aSet2.Get( XATTR_LINESTYLE ) ).GetValue();
@@ -122,18 +118,21 @@ void MorphDlg::LoadSettings()
RTL_CONSTASCII_STRINGPARAM( SD_OPTION_MORPHING ) ),
SD_OPTION_LOAD ) );
sal_uInt16 nSteps;
- sal_Bool bOrient, bAttrib;
+ bool bOrient, bAttrib;
if( xIStm.Is() )
{
SdIOCompat aCompat( *xIStm, STREAM_READ );
+ sal_Bool bTempBOOL;
- *xIStm >> nSteps >> bOrient >> bAttrib;
+ *xIStm >> nSteps;
+ *xIStm >> bTempBOOL; bOrient = bTempBOOL;
+ *xIStm >> bTempBOOL; bAttrib = bTempBOOL;
}
else
{
nSteps = 16;
- bOrient = bAttrib = sal_True;
+ bOrient = bAttrib = true;
}
aMtfSteps.SetValue( nSteps );
@@ -154,8 +153,8 @@ void MorphDlg::SaveSettings() const
SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 );
*xOStm << (sal_uInt16) aMtfSteps.GetValue()
- << aCbxOrientation.IsChecked()
- << aCbxAttributes.IsChecked();
+ << (sal_Bool)aCbxOrientation.IsChecked()
+ << (sal_Bool)aCbxAttributes.IsChecked();
}
}
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 32f03af155ed..651074d8942d 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -78,7 +78,7 @@ SdNavigatorWin::SdNavigatorWin(
, maTlbObjects( this, SdResId( TLB_OBJECTS ) )
, maLbDocs ( this, SdResId( LB_DOCS ) )
, mpChildWinContext( pChWinCtxt )
-, mbDocImported ( sal_False )
+, mbDocImported ( false )
// Bei Aenderung des DragTypes: SelectionMode der TLB anpassen!
, meDragType ( NAVIGATOR_DRAGTYPE_EMBEDDED )
, mpBindings ( pInBindings )
@@ -140,7 +140,7 @@ SdNavigatorWin::SdNavigatorWin(
((SfxDockingWindow*)GetParent())->SetMinOutputSizePixel( maMinSize );
// InitTlb; Wird ueber Slot initiiert
- SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True );
+ SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
mpBindings->GetDispatcher()->Execute(
SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
@@ -182,7 +182,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
// Disable the shape filter drop down menu when there is a running slide
// show.
if (pViewShell!=NULL && sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ))
- maToolbox.EnableItem(TBI_SHAPE_FILTER, sal_False);
+ maToolbox.EnableItem(TBI_SHAPE_FILTER, false);
else
maToolbox.EnableItem(TBI_SHAPE_FILTER);
@@ -190,7 +190,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
{
String aDocName = pDocShell->GetMedium()->GetName();
maTlbObjects.Clear();
- maTlbObjects.Fill( pDoc, (sal_Bool) sal_False, aDocName ); // Nur normale Seiten
+ maTlbObjects.Fill( pDoc, false, aDocName ); // Nur normale Seiten
RefreshDocumentLB();
maLbDocs.SelectEntry( aDocShName );
@@ -210,7 +210,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
SfxViewFrame* pViewFrame = ( ( pViewShell && pViewShell->GetViewFrame() ) ? pViewShell->GetViewFrame() : SfxViewFrame::Current() );
if( pViewFrame )
- pViewFrame->GetBindings().Invalidate(SID_NAVIGATOR_PAGENAME, sal_True, sal_True);
+ pViewFrame->GetBindings().Invalidate(SID_NAVIGATOR_PAGENAME, true, true);
}
/*************************************************************************
@@ -252,7 +252,7 @@ IMPL_LINK( SdNavigatorWin, SelectToolboxHdl, void *, EMPTYARG )
if( nSId > 0 )
{
- SfxBoolItem aItem( nSId, sal_True );
+ SfxBoolItem aItem( nSId, true );
mpBindings->GetDispatcher()->Execute(
nSId, SFX_CALLMODE_SLOT |SFX_CALLMODE_RECORD, &aItem, 0L );
}
@@ -332,8 +332,8 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox )
if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects.IsLinkableSelected() )
{
- pMenu->EnableItem( NAVIGATOR_DRAGTYPE_LINK, sal_False );
- pMenu->EnableItem( NAVIGATOR_DRAGTYPE_URL, sal_False );
+ pMenu->EnableItem( NAVIGATOR_DRAGTYPE_LINK, false );
+ pMenu->EnableItem( NAVIGATOR_DRAGTYPE_URL, false );
meDragType = NAVIGATOR_DRAGTYPE_EMBEDDED;
}
@@ -415,7 +415,7 @@ IMPL_LINK( SdNavigatorWin, SelectDocumentHdl, void *, EMPTYARG )
{
String aStrLb = maLbDocs.GetSelectEntry();
long nPos = maLbDocs.GetSelectEntryPos();
- sal_Bool bFound = sal_False;
+ bool bFound = false;
::sd::DrawDocShell* pDocShell = NULL;
NavDocInfo* pInfo = GetDocInfo();
@@ -429,7 +429,7 @@ IMPL_LINK( SdNavigatorWin, SelectDocumentHdl, void *, EMPTYARG )
{
pDocShell = pInfo->mpDocShell;
- bFound = sal_True;
+ bFound = true;
}
if( bFound )
@@ -441,7 +441,7 @@ IMPL_LINK( SdNavigatorWin, SelectDocumentHdl, void *, EMPTYARG )
::sd::DrawDocShell* pNCDocShell = pNonConstDoc->GetDocSh();
String aDocName = pNCDocShell->GetMedium()->GetName();
maTlbObjects.Clear();
- maTlbObjects.Fill( pDoc, (sal_Bool) sal_False, aDocName ); // Nur normale Seiten
+ maTlbObjects.Fill( pDoc, false, aDocName ); // Nur normale Seiten
}
}
@@ -482,7 +482,7 @@ IMPL_LINK( SdNavigatorWin, MenuSelectHdl, Menu *, pMenu )
{
// Fix, um Endlosschleife zu unterbinden
if( maTlbObjects.GetSelectionCount() > 1 )
- maTlbObjects.SelectAll( sal_False );
+ maTlbObjects.SelectAll( false );
maTlbObjects.SetSelectionMode( SINGLE_SELECTION );
}
@@ -583,10 +583,10 @@ void SdNavigatorWin::Resize()
// -----------------------------------------------------------------------
-sal_Bool SdNavigatorWin::InsertFile(const String& rFileName)
+bool SdNavigatorWin::InsertFile(const String& rFileName)
{
INetURLObject aURL( rFileName );
- sal_Bool bReturn = sal_True;
+ bool bReturn = true;
if( aURL.GetProtocol() == INET_PROT_NOT_VALID )
{
@@ -615,9 +615,9 @@ sal_Bool SdNavigatorWin::InsertFile(const String& rFileName)
if (aFileName != maDropFileName)
{
- SfxMedium aMed(aFileName, (STREAM_READ | STREAM_SHARE_DENYNONE), sal_False);
+ SfxMedium aMed(aFileName, (STREAM_READ | STREAM_SHARE_DENYNONE), false);
SfxFilterMatcher aMatch( String::CreateFromAscii("simpress") );
- aMed.UseInteractionHandler( sal_True );
+ aMed.UseInteractionHandler( true );
nErr = aMatch.GuessFilter(aMed, &pFilter);
}
@@ -627,7 +627,7 @@ sal_Bool SdNavigatorWin::InsertFile(const String& rFileName)
// ersteinmal nachgeschaut, ob es einen Storage enthaelt
SfxMedium* pMedium = new SfxMedium( aFileName,
STREAM_READ | STREAM_NOCREATE,
- sal_True); // Download
+ true); // Download
if (pMedium->IsStorage())
{
@@ -644,20 +644,20 @@ sal_Bool SdNavigatorWin::InsertFile(const String& rFileName)
if( !maTlbObjects.IsEqualToDoc( pDropDoc ) )
{
// Nur normale Seiten
- maTlbObjects.Fill(pDropDoc, (sal_Bool) sal_False, maDropFileName);
+ maTlbObjects.Fill(pDropDoc, false, maDropFileName);
RefreshDocumentLB( &maDropFileName );
}
}
}
else
{
- bReturn = sal_False;
+ bReturn = false;
delete pMedium;
}
}
else
{
- bReturn = sal_False;
+ bReturn = false;
}
}
@@ -676,7 +676,7 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName )
maLbDocs.RemoveEntry( 0 );
maLbDocs.InsertEntry( *pDocName, 0 );
- mbDocImported = sal_True;
+ mbDocImported = true;
}
else
{
@@ -698,12 +698,11 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName )
if( mbDocImported )
maLbDocs.InsertEntry( aStr, 0 );
- ::sd::DrawDocShell* pCurrentDocShell =
- PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
- SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst(0, sal_False);
+ ::sd::DrawDocShell* pCurrentDocShell = dynamic_cast< ::sd::DrawDocShell* >(SfxObjectShell::Current() );
+ SfxObjectShell* pSfxDocShell = SfxObjectShell::GetFirst(0, false);
while( pSfxDocShell )
{
- ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, pSfxDocShell );
+ ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell* >(pSfxDocShell );
if( pDocShell && !pDocShell->IsInDestruction() && ( pDocShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) )
{
NavDocInfo* pInfo = new NavDocInfo();
@@ -713,7 +712,7 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName )
if( aStr.Len() )
pInfo->SetName();
else
- pInfo->SetName( sal_False );
+ pInfo->SetName( false );
// z.Z. wird wieder der Name der Shell genommen (also ohne Pfad)
// da Koose es als Fehler ansieht, wenn er Pfad in URL-Notation
// angezeigt wird!
@@ -725,11 +724,11 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName )
if( pDocShell == pCurrentDocShell )
pInfo->SetActive();
else
- pInfo->SetActive( sal_False );
+ pInfo->SetActive( false );
mpDocList->Insert( pInfo, LIST_APPEND );
}
- pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, 0 , sal_False );
+ pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, 0 , false );
}
}
maLbDocs.SelectEntryPos( nPos );
@@ -737,7 +736,7 @@ void SdNavigatorWin::RefreshDocumentLB( const String* pDocName )
//------------------------------------------------------------------------
-sal_uInt16 SdNavigatorWin::GetDragTypeSdResId( NavigatorDragType eDT, sal_Bool bImage )
+sal_uInt16 SdNavigatorWin::GetDragTypeSdResId( NavigatorDragType eDT, bool bImage )
{
switch( eDT )
{
@@ -783,7 +782,7 @@ NavDocInfo* SdNavigatorWin::GetDocInfo()
long SdNavigatorWin::Notify(NotifyEvent& rNEvt)
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
- long nOK = sal_False;
+ long nOK = false;
if( pKEvt )
{
@@ -792,7 +791,7 @@ long SdNavigatorWin::Notify(NotifyEvent& rNEvt)
if( SdPageObjsTLB::IsInDrag() )
{
// during drag'n'drop we just stop the drag but do not close the navigator
- nOK = sal_True;
+ nOK = true;
}
else
{
@@ -804,7 +803,7 @@ long SdNavigatorWin::Notify(NotifyEvent& rNEvt)
// deletion of the navigator window. Calling the
// parents Notify after this is unsafe. Therefore we
// return now.
- return sal_True;
+ return true;
}
}
}
@@ -825,14 +824,14 @@ long SdNavigatorWin::Notify(NotifyEvent& rNEvt)
void SdNavigatorWin::KeyInput( const KeyEvent& rKEvt )
{
- long nOK = sal_False;
+ long nOK = false;
if (rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE)
{
if( SdPageObjsTLB::IsInDrag() )
{
// during drag'n'drop we just stop the drag but do not close the navigator
- nOK = sal_True;
+ nOK = true;
}
else
{
@@ -860,7 +859,7 @@ void SdNavigatorWin::DataChanged( const DataChangedEvent& rDCEvt )
void SdNavigatorWin::SetDragImage()
{
- maToolbox.SetItemImage( TBI_DRAGTYPE, maToolbox.GetImageList().GetImage( GetDragTypeSdResId( meDragType, sal_True ) ) );
+ maToolbox.SetItemImage( TBI_DRAGTYPE, maToolbox.GetImageList().GetImage( GetDragTypeSdResId( meDragType, true ) ) );
}
void SdNavigatorWin::ApplyImageList()
@@ -897,7 +896,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
{
if( eState >= SFX_ITEM_AVAILABLE && nSId == SID_NAVIGATOR_STATE )
{
- const SfxUInt32Item* pStateItem = PTR_CAST( SfxUInt32Item, pItem );
+ const SfxUInt32Item* pStateItem = dynamic_cast< const SfxUInt32Item* >(pItem );
DBG_ASSERT( pStateItem, "SfxUInt16Item erwartet");
sal_uInt32 nState = pStateItem->GetValue();
@@ -907,13 +906,13 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
pNavigatorWin->maToolbox.EnableItem( TBI_PEN );
if( nState & NAVBTN_PEN_DISABLED &&
pNavigatorWin->maToolbox.IsItemEnabled( TBI_PEN ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_PEN, sal_False );
+ pNavigatorWin->maToolbox.EnableItem( TBI_PEN, false );
if( nState & NAVBTN_PEN_CHECKED &&
!pNavigatorWin->maToolbox.IsItemChecked( TBI_PEN ) )
pNavigatorWin->maToolbox.CheckItem( TBI_PEN );
if( nState & NAVBTN_PEN_UNCHECKED &&
pNavigatorWin->maToolbox.IsItemChecked( TBI_PEN ) )
- pNavigatorWin->maToolbox.CheckItem( TBI_PEN, sal_False );
+ pNavigatorWin->maToolbox.CheckItem( TBI_PEN, false );
// Nur wenn Doc in LB das Aktive ist
NavDocInfo* pInfo = pNavigatorWin->GetDocInfo();
@@ -925,7 +924,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
pNavigatorWin->maToolbox.EnableItem( TBI_FIRST );
if( nState & NAVBTN_FIRST_DISABLED &&
pNavigatorWin->maToolbox.IsItemEnabled( TBI_FIRST ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_FIRST, sal_False );
+ pNavigatorWin->maToolbox.EnableItem( TBI_FIRST, false );
// Prev
if( nState & NAVBTN_PREV_ENABLED &&
@@ -933,7 +932,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS );
if( nState & NAVBTN_PREV_DISABLED &&
pNavigatorWin->maToolbox.IsItemEnabled( TBI_PREVIOUS ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS, sal_False );
+ pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS, false );
// Last
if( nState & NAVBTN_LAST_ENABLED &&
@@ -941,7 +940,7 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
pNavigatorWin->maToolbox.EnableItem( TBI_LAST );
if( nState & NAVBTN_LAST_DISABLED &&
pNavigatorWin->maToolbox.IsItemEnabled( TBI_LAST ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_LAST, sal_False );
+ pNavigatorWin->maToolbox.EnableItem( TBI_LAST, false );
// Next
if( nState & NAVBTN_NEXT_ENABLED &&
@@ -949,12 +948,12 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
pNavigatorWin->maToolbox.EnableItem( TBI_NEXT );
if( nState & NAVBTN_NEXT_DISABLED &&
pNavigatorWin->maToolbox.IsItemEnabled( TBI_NEXT ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_NEXT, sal_False );
+ pNavigatorWin->maToolbox.EnableItem( TBI_NEXT, false );
if( nState & NAVTLB_UPDATE )
{
// InitTlb; Wird ueber Slot initiiert
- SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True );
+ SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
GetBindings().GetDispatcher()->Execute(
SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
}
@@ -987,7 +986,7 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId,
NavDocInfo* pInfo = pNavigatorWin->GetDocInfo();
if( pInfo && pInfo->IsActive() )
{
- const SfxStringItem* pStateItem = PTR_CAST( SfxStringItem, pItem );
+ const SfxStringItem* pStateItem = dynamic_cast< const SfxStringItem* >(pItem );
DBG_ASSERT( pStateItem, "SfxStringItem erwartet");
String aPageName = pStateItem->GetValue();
@@ -996,7 +995,7 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId,
if( pNavigatorWin->maTlbObjects.GetSelectionMode() == MULTIPLE_SELECTION )
{
// Weil sonst immer dazuselektiert wird
- pNavigatorWin->maTlbObjects.SelectAll( sal_False );
+ pNavigatorWin->maTlbObjects.SelectAll( false );
}
pNavigatorWin->maTlbObjects.SelectEntry( aPageName );
}
diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx
index 11b2d1d8376e..87d94a02253d 100644
--- a/sd/source/ui/dlg/paragr.cxx
+++ b/sd/source/ui/dlg/paragr.cxx
@@ -106,8 +106,8 @@ sal_Bool SdParagraphNumTabPage::FillItemSet( SfxItemSet& rSet )
maNewStartNF.GetText() != maNewStartNF.GetSavedValue())
{
mbModified = true;
- sal_Bool bNewStartChecked = STATE_CHECK == maNewStartCB.GetState();
- sal_Bool bNumberNewStartChecked = STATE_CHECK == maNewStartNumberCB.GetState();
+ bool bNewStartChecked = STATE_CHECK == maNewStartCB.GetState();
+ bool bNumberNewStartChecked = STATE_CHECK == maNewStartNumberCB.GetState();
rSet.Put(SfxBoolItem(ATTR_NUMBER_NEWSTART, bNewStartChecked));
const sal_Int16 nStartAt = (sal_Int16)maNewStartNF.GetValue();
@@ -124,7 +124,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet& rSet )
{
const SfxBoolItem& rStart = (const SfxBoolItem&)rSet.Get(ATTR_NUMBER_NEWSTART);
maNewStartCB.SetState( rStart.GetValue() ? STATE_CHECK : STATE_NOCHECK );
- maNewStartCB.EnableTriState(sal_False);
+ maNewStartCB.EnableTriState(false);
}
else
{
@@ -142,7 +142,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet& rSet )
nNewStart = 1;
maNewStartNF.SetValue(nNewStart);
- maNewStartNumberCB.EnableTriState(sal_False);
+ maNewStartNumberCB.EnableTriState(false);
}
else
{
@@ -151,12 +151,12 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet& rSet )
ImplNewStartHdl(&maNewStartCB);
maNewStartNF.SaveValue();
maNewStartNumberCB.SaveValue();
- mbModified = sal_False;
+ mbModified = false;
}
IMPL_LINK( SdParagraphNumTabPage, ImplNewStartHdl, CheckBox*, EMPTYARG )
{
- sal_Bool bEnable = maNewStartCB.IsChecked();
+ bool bEnable = maNewStartCB.IsChecked();
maNewStartNumberCB.Enable(bEnable);
maNewStartNF.Enable(bEnable && maNewStartNumberCB.IsChecked());
return 0;
@@ -178,7 +178,7 @@ SdParagraphDlg::SdParagraphDlg( Window* pParent, const SfxItemSet* pAttr )
AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
- static const sal_Bool bShowParaNumbering = ( getenv( "SD_SHOW_NUMBERING_PAGE" ) != NULL );
+ static const bool bShowParaNumbering = ( getenv( "SD_SHOW_NUMBERING_PAGE" ) != NULL );
if( bShowParaNumbering )
AddTabPage( RID_TABPAGE_PARA_NUMBERING, SdParagraphNumTabPage::Create, SdParagraphNumTabPage::GetRanges );
else
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index b9dd8eeff0ef..c31da4e59f85 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -156,8 +156,8 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow,
aCbxChangePage.Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_CHANGE_PAGE ) ).GetValue() );
aCbxAlwaysOnTop.Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ALWAYS_ON_TOP ) ).GetValue() );
- const sal_Bool bEndless = ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue();
- const sal_Bool bWindow = !( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue();
+ const bool bEndless = ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue();
+ const bool bWindow = !( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue();
const long nPause = ( ( const SfxUInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue();
aTmfPause.SetTime( Time( 0, 0, nPause ) );
@@ -169,11 +169,11 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow,
aCbxAutoLogo.Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_SHOW_PAUSELOGO ) ).GetValue() );
if( bWindow )
- aRbtWindow.Check( sal_True );
+ aRbtWindow.Check( true );
else if( bEndless )
- aRbtAuto.Check( sal_True );
+ aRbtAuto.Check( true );
else
- aRbtStandard.Check( sal_True );
+ aRbtStandard.Check( true );
InitMonitorSettings();
@@ -324,8 +324,8 @@ IMPL_LINK( SdStartPresentationDlg, ClickWindowPresentationHdl, void *, EMPTYARG
if( bWindow )
{
- aCbxAlwaysOnTop.Enable( sal_False );
- aCbxAlwaysOnTop.Check( sal_False );
+ aCbxAlwaysOnTop.Enable( false );
+ aCbxAlwaysOnTop.Check( false );
}
else
aCbxAlwaysOnTop.Enable();
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index 9be3c131cce3..95ac3a5de16d 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -111,14 +111,14 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh,
// Fals in diesem Stylesheet kein Bullet Item ist, holen wir uns
// das aus dem 'Outline 1' Stylesheet.
- if( SFX_ITEM_SET != aInputSet.GetItemState(EE_PARA_NUMBULLET, sal_False, &pItem ))
+ if( SFX_ITEM_SET != aInputSet.GetItemState(EE_PARA_NUMBULLET, false, &pItem ))
{
String aStyleName((SdResId(STR_PSEUDOSHEET_OUTLINE)));
aStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " 1" ) );
SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( aStyleName, SD_STYLE_FAMILY_PSEUDO);
if(pFirstStyleSheet)
- if( SFX_ITEM_SET == pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, sal_False, &pItem) )
+ if( SFX_ITEM_SET == pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, &pItem) )
aInputSet.Put( *pItem );
}
@@ -320,7 +320,7 @@ const SfxItemSet* SdPresLayoutTemplateDlg::GetOutputItemSet() const
pOutSet->Put( *SfxTabDialog::GetOutputItemSet() );
const SvxNumBulletItem *pSvxNumBulletItem = NULL;
- if( SFX_ITEM_SET == pOutSet->GetItemState(EE_PARA_NUMBULLET, sal_False, (const SfxPoolItem**)&pSvxNumBulletItem ))
+ if( SFX_ITEM_SET == pOutSet->GetItemState(EE_PARA_NUMBULLET, false, (const SfxPoolItem**)&pSvxNumBulletItem ))
SdBulletMapper::MapFontsInNumRule( *pSvxNumBulletItem->GetNumRule(), *pOutSet );
return pOutSet;
}
@@ -344,7 +344,7 @@ sal_uInt16 SdPresLayoutTemplateDlg::GetOutlineLevel() const
case PO_OUTLINE_8: return 7;
case PO_OUTLINE_9: return 8;
default:
- DBG_ASSERT( sal_False, "Falscher Po! [CL]");
+ DBG_ASSERT( false, "Falscher Po! [CL]");
}
return 0;
}
diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 48e77fb1a587..62b33f9d75ad 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -154,9 +154,9 @@ sal_Bool SdPrintOptions::FillItemSet( SfxItemSet& rAttrs )
rAttrs.Put( aOptions );
- return( sal_True );
+ return( true );
}
- return( sal_False );
+ return( false );
}
// -----------------------------------------------------------------------
@@ -164,8 +164,7 @@ sal_Bool SdPrintOptions::FillItemSet( SfxItemSet& rAttrs )
void SdPrintOptions::Reset( const SfxItemSet& rAttrs )
{
const SdOptionsPrintItem* pPrintOpts = NULL;
- if( SFX_ITEM_SET == rAttrs.GetItemState( ATTR_OPTIONS_PRINT, sal_False,
- (const SfxPoolItem**) &pPrintOpts ) )
+ if( SFX_ITEM_SET == rAttrs.GetItemState( ATTR_OPTIONS_PRINT, false, (const SfxPoolItem**) &pPrintOpts ) )
{
aCbxDraw.Check( pPrintOpts->GetOptionsPrint().IsDraw() );
aCbxNotes.Check( pPrintOpts->GetOptionsPrint().IsNotes() );
@@ -296,7 +295,7 @@ void SdPrintOptions::PageCreated (SfxAllItemSet
)
{
#ifdef QUARTZ
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG);
if (pFlagItem)
{
sal_uInt32 nFlags=pFlagItem->GetValue();
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index be71806bbb38..a31e63bb11e8 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -86,11 +86,11 @@ void AbstractCopyDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
// AbstractCopyDlg_Impl end
//AbstractSdCustomShowDlg_Impl begin
-sal_Bool AbstractSdCustomShowDlg_Impl::IsModified() const
+bool AbstractSdCustomShowDlg_Impl::IsModified() const
{
return pDlg->IsModified();
}
-sal_Bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const
+bool AbstractSdCustomShowDlg_Impl::IsCustomShow() const
{
return pDlg->IsCustomShow();
}
@@ -197,7 +197,7 @@ OutputType AbstractAssistentDlg_Impl::GetOutputMedium() const
{
return pDlg->GetOutputMedium();
}
-sal_Bool AbstractAssistentDlg_Impl::IsSummary() const
+bool AbstractAssistentDlg_Impl::IsSummary() const
{
return pDlg->IsSummary();
}
@@ -209,11 +209,11 @@ String AbstractAssistentDlg_Impl::GetDocPath() const
{
return pDlg->GetDocPath();
}
-sal_Bool AbstractAssistentDlg_Impl::GetStartWithFlag() const
+bool AbstractAssistentDlg_Impl::GetStartWithFlag() const
{
return pDlg->GetStartWithFlag();
}
-sal_Bool AbstractAssistentDlg_Impl::IsDocEmpty() const
+bool AbstractAssistentDlg_Impl::IsDocEmpty() const
{
return pDlg->IsDocEmpty();
}
@@ -247,7 +247,7 @@ void AbstractSdSnapLineDlg_Impl::HideDeleteBtn()
{
pDlg->HideDeleteBtn();
}
-void AbstractSdSnapLineDlg_Impl::SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY)
+void AbstractSdSnapLineDlg_Impl::SetInputFields(bool bEnableX, bool bEnableY)
{
pDlg->SetInputFields(bEnableX, bEnableY);
}
@@ -269,7 +269,7 @@ void AbstractSdInsertLayerDlg_Impl::SetHelpId( const rtl::OString& rHelpId )
// AbstractSdInsertLayerDlg_Impl end
//AbstractSdInsertPasteDlg_Impl begin
-sal_Bool AbstractSdInsertPasteDlg_Impl::IsInsertBefore() const
+bool AbstractSdInsertPasteDlg_Impl::IsInsertBefore() const
{
return pDlg->IsInsertBefore();
}
@@ -284,11 +284,11 @@ List* AbstractSdInsertPagesObjsDlg_Impl::GetList( sal_uInt16 nType )
{
return pDlg->GetList( nType );
}
-sal_Bool AbstractSdInsertPagesObjsDlg_Impl::IsLink()
+bool AbstractSdInsertPagesObjsDlg_Impl::IsLink()
{
return pDlg->IsLink();
}
-sal_Bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const
+bool AbstractSdInsertPagesObjsDlg_Impl::IsRemoveUnnessesaryMasterPages() const
{
return pDlg->IsRemoveUnnessesaryMasterPages();
}
@@ -303,11 +303,11 @@ sal_uInt16 AbstractMorphDlg_Impl::GetFadeSteps() const
{
return pDlg->GetFadeSteps();
}
-sal_Bool AbstractMorphDlg_Impl::IsAttributeFade() const
+bool AbstractMorphDlg_Impl::IsAttributeFade() const
{
return pDlg->IsAttributeFade();
}
-sal_Bool AbstractMorphDlg_Impl::IsOrientationFade() const
+bool AbstractMorphDlg_Impl::IsOrientationFade() const
{
return pDlg->IsOrientationFade();
}
@@ -411,14 +411,14 @@ SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabCharDialog( ::W
}
-SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, sal_Bool bAreaPage )
+SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage )
{
return new AbstractTabDialog_Impl( new SdPageDlg( pDocShell, pParent, pAttr, bAreaPage ) );
}
// add for SdCharDlg end
//add for AssistentDlg begin
-AbstractAssistentDlg * SdAbstractDialogFactory_Impl::CreateAssistentDlg( ::Window* pParent, sal_Bool bAutoPilot)
+AbstractAssistentDlg * SdAbstractDialogFactory_Impl::CreateAssistentDlg( ::Window* pParent, bool bAutoPilot)
{
return new AbstractAssistentDlg_Impl( new AssistentDlg( pParent, bAutoPilot ) );
}
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 71ca7de2a0ca..f9e1881b739b 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -73,8 +73,8 @@ class SdCustomShowDlg;
class AbstractSdCustomShowDlg_Impl : public AbstractSdCustomShowDlg
{
DECL_ABSTDLG_BASE(AbstractSdCustomShowDlg_Impl,SdCustomShowDlg)
- virtual sal_Bool IsModified() const ;
- virtual sal_Bool IsCustomShow() const ;
+ virtual bool IsModified() const ;
+ virtual bool IsCustomShow() const ;
};
//add for SdCharDlg begin
@@ -128,11 +128,11 @@ class AbstractAssistentDlg_Impl : public AbstractAssistentDlg
DECL_ABSTDLG_BASE(AbstractAssistentDlg_Impl,AssistentDlg)
virtual SfxObjectShellLock GetDocument();
virtual OutputType GetOutputMedium() const;
- virtual sal_Bool IsSummary() const;
+ virtual bool IsSummary() const;
virtual StartType GetStartType() const;
virtual String GetDocPath() const;
- virtual sal_Bool GetStartWithFlag() const;
- virtual sal_Bool IsDocEmpty() const;
+ virtual bool GetStartWithFlag() const;
+ virtual bool IsDocEmpty() const;
virtual String GetPassword();
};
@@ -153,7 +153,7 @@ class AbstractSdSnapLineDlg_Impl : public AbstractSdSnapLineDlg
virtual void GetAttr(SfxItemSet& rOutAttrs);
virtual void HideRadioGroup();
virtual void HideDeleteBtn();
- virtual void SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY);
+ virtual void SetInputFields(bool bEnableX, bool bEnableY);
//from class Window
virtual void SetText( const XubString& rStr );
};
@@ -173,7 +173,7 @@ class SdInsertPasteDlg;
class AbstractSdInsertPasteDlg_Impl : public AbstractSdInsertPasteDlg
{
DECL_ABSTDLG_BASE(AbstractSdInsertPasteDlg_Impl,SdInsertPasteDlg)
- virtual sal_Bool IsInsertBefore() const;
+ virtual bool IsInsertBefore() const;
};
// add for SdInsertPagesObjsDlg
@@ -183,8 +183,8 @@ class AbstractSdInsertPagesObjsDlg_Impl : public AbstractSdInsertPagesObjsDlg
DECL_ABSTDLG_BASE(AbstractSdInsertPagesObjsDlg_Impl,SdInsertPagesObjsDlg)
virtual ::Window * GetWindow(); //this method is added for return a Window type pointer
virtual List* GetList( sal_uInt16 nType );
- virtual sal_Bool IsLink();
- virtual sal_Bool IsRemoveUnnessesaryMasterPages() const;
+ virtual bool IsLink();
+ virtual bool IsRemoveUnnessesaryMasterPages() const;
};
// add for MorphDlg
@@ -193,8 +193,8 @@ class AbstractMorphDlg_Impl : public AbstractMorphDlg
DECL_ABSTDLG_BASE(AbstractMorphDlg_Impl,::sd::MorphDlg)
virtual void SaveSettings() const;
virtual sal_uInt16 GetFadeSteps() const;
- virtual sal_Bool IsAttributeFade() const ;
- virtual sal_Bool IsOrientationFade() const ;
+ virtual bool IsAttributeFade() const ;
+ virtual bool IsOrientationFade() const ;
};
// add for SdStartPresentationDlg
@@ -258,8 +258,8 @@ public:
virtual AbstractCopyDlg* CreateCopyDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, XColorTable* pColTab, ::sd::View* pView );
virtual AbstractSdCustomShowDlg* CreateSdCustomShowDlg( ::Window* pWindow, SdDrawDocument& rDrawDoc );
virtual SfxAbstractTabDialog* CreateSdTabCharDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell );
- virtual SfxAbstractTabDialog* CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, sal_Bool bAreaPage = sal_True );
- virtual AbstractAssistentDlg* CreateAssistentDlg( ::Window* pParent, sal_Bool bAutoPilot);
+ virtual SfxAbstractTabDialog* CreateSdTabPageDialog( ::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage = true );
+ virtual AbstractAssistentDlg* CreateAssistentDlg( ::Window* pParent, bool bAutoPilot);
virtual AbstractSdModifyFieldDlg* CreateSdModifyFieldDlg( ::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet );
virtual AbstractSdSnapLineDlg* CreateSdSnapLineDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView);
virtual AbstractSdInsertLayerDlg* CreateSdInsertLayerDlg( ::Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, String aStr );
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index 95b20c490edd..e578aa38277f 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -111,17 +111,17 @@ void SdPresLayoutDlg::Reset()
long nName;
// MasterPage austauschen
- if( mrOutAttrs.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE, sal_False, &pPoolItem ) == SFX_ITEM_SET )
+ if( mrOutAttrs.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE, false, &pPoolItem ) == SFX_ITEM_SET )
{
- sal_Bool bMasterPage = ( (const SfxBoolItem*) pPoolItem)->GetValue();
+ bool bMasterPage = ( (const SfxBoolItem*) pPoolItem)->GetValue();
maCbxMasterPage.Enable( !bMasterPage );
maCbxMasterPage.Check( bMasterPage );
}
// Nicht verwendete MasterPages entfernen
- maCbxCheckMasters.Check(sal_False);
+ maCbxCheckMasters.Check(false);
- if(mrOutAttrs.GetItemState(ATTR_PRESLAYOUT_NAME, sal_True, &pPoolItem) == SFX_ITEM_SET)
+ if(mrOutAttrs.GetItemState(ATTR_PRESLAYOUT_NAME, true, &pPoolItem) == SFX_ITEM_SET)
maName = ((const SfxStringItem*)pPoolItem)->GetValue();
else
maName.Erase();
@@ -149,7 +149,7 @@ void SdPresLayoutDlg::Reset()
void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs)
{
short nId = maVS.GetSelectItemId();
- sal_Bool bLoad = nId > mnLayoutCount;
+ bool bLoad = nId > mnLayoutCount;
rOutAttrs.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad ) );
String aLayoutName;
@@ -244,7 +244,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG)
Update();
String aFile;
- sal_Bool bCancel = sal_False;
+ bool bCancel = false;
switch (nResult)
{
@@ -263,7 +263,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG)
break;
default:
- bCancel = sal_True;
+ bCancel = true;
}
delete pDlg;
@@ -273,7 +273,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG)
if( !bCancel )
{
// Pruefen, ob Vorlage schon vorhanden
- sal_Bool bExists = sal_False;
+ bool bExists = false;
String* pName = (String*)mpLayoutNames->First();
String aCompareStr( maName );
if( maName.Len() == 0 )
@@ -283,7 +283,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG)
{
if( aCompareStr == *pName )
{
- bExists = sal_True;
+ bExists = true;
// Vorlage selektieren
sal_uInt16 nId = (sal_uInt16) mpLayoutNames->GetCurPos() + 1;
maVS.SelectItem( nId );
@@ -328,7 +328,7 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG)
}
else
{
- bCancel = sal_True;
+ bCancel = true;
}
pDoc->CloseBookmarkDoc();
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 8f63e5b82f75..51fa3f567f4a 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -35,8 +35,8 @@
#include <vcl/svapp.hxx>
#include "cusshow.hxx"
#include <sfx2/childwin.hxx>
-
#include <sfx2/viewfrm.hxx>
+#include <comphelper/processfactory.hxx>
#include "strmname.h"
#include "sdtreelb.hxx"
@@ -49,16 +49,15 @@
#include "strings.hrc"
#endif
#include "res_bmp.hrc"
-#include "ViewShell.hxx"
#include "DrawController.hxx"
#include "ViewShellBase.hxx"
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
-#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <svtools/embedtransfer.hxx>
-#include <comphelper/processfactory.hxx>
#include <tools/diagnose_ex.h>
+#include <ViewShell.hxx>
+#include <svx/svdlegacy.hxx>
using namespace com::sun::star;
@@ -85,9 +84,9 @@ public:
};
-sal_Bool SD_DLLPRIVATE SdPageObjsTLB::bIsInDrag = sal_False;
+bool SD_DLLPRIVATE SdPageObjsTLB::bIsInDrag = false;
-sal_Bool SdPageObjsTLB::IsInDrag()
+bool SdPageObjsTLB::IsInDrag()
{
return bIsInDrag;
}
@@ -104,7 +103,7 @@ SdPageObjsTLB::SdPageObjsTransferable::SdPageObjsTransferable(
::sd::DrawDocShell& rDocShell,
NavigatorDragType eDragType,
const ::com::sun::star::uno::Any& rTreeListBoxData )
- : SdTransferable(rDocShell.GetDoc(), NULL, sal_True),
+ : SdTransferable(rDocShell.GetDoc(), NULL, true),
mrParent( rParent ),
maBookmark( rBookmark ),
mrDocShell( rDocShell ),
@@ -154,7 +153,6 @@ sal_Bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star:
void SdPageObjsTLB::SdPageObjsTransferable::DragFinished( sal_Int8 nDropAction )
{
mrParent.OnDragFinished( nDropAction );
- SdTransferable::DragFinished(nDropAction);
}
// -----------------------------------------------------------------------------
@@ -236,9 +234,6 @@ sal_uInt32 SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId (void)
return mnListBoxDropFormatId;
}
-
-
-
/*************************************************************************
|*
|* Ctor1 SdPageObjsTLB
@@ -256,7 +251,7 @@ SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId )
, maImgGraphic ( BitmapEx( SdResId( BMP_GRAPHIC ) ) )
, maImgOleH ( BitmapEx( SdResId( BMP_OLE_H ) ) )
, maImgGraphicH ( BitmapEx( SdResId( BMP_GRAPHIC_H ) ) )
-, mbLinkableSelected ( sal_False )
+, mbLinkableSelected ( false )
, mpDropNavWin ( NULL )
, mbShowAllShapes ( false )
, mbShowAllPages ( false )
@@ -311,8 +306,15 @@ String SdPageObjsTLB::GetObjectName(
{
aRet = pObject->GetName();
- if( !aRet.Len() && pObject->ISA( SdrOle2Obj ) )
- aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName();
+ if( !aRet.Len() )
+ {
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObject);
+
+ if(pSdrOle2Obj)
+ {
+ aRet = pSdrOle2Obj->GetPersistName();
+ }
+ }
}
if (bCreate
@@ -321,7 +323,7 @@ String SdPageObjsTLB::GetObjectName(
&& pObject!=NULL)
{
aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME);
- aRet.SearchAndReplaceAscii("%1", String::CreateFromInt32(pObject->GetOrdNum() + 1));
+ aRet.SearchAndReplaceAscii("%1", String::CreateFromInt32(pObject->GetNavigationPosition() + 1));
}
return aRet;
@@ -333,9 +335,9 @@ String SdPageObjsTLB::GetObjectName(
|*
\************************************************************************/
-sal_Bool SdPageObjsTLB::SelectEntry( const String& rName )
+bool SdPageObjsTLB::SelectEntry( const String& rName )
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
if( rName.Len() )
{
@@ -347,7 +349,7 @@ sal_Bool SdPageObjsTLB::SelectEntry( const String& rName )
aTmp = GetEntryText( pEntry );
if( aTmp == rName )
{
- bFound = sal_True;
+ bFound = true;
SetCurEntry( pEntry );
}
}
@@ -361,10 +363,10 @@ sal_Bool SdPageObjsTLB::SelectEntry( const String& rName )
|*
\************************************************************************/
-sal_Bool SdPageObjsTLB::HasSelectedChilds( const String& rName )
+bool SdPageObjsTLB::HasSelectedChilds( const String& rName )
{
- sal_Bool bFound = sal_False;
- sal_Bool bChilds = sal_False;
+ bool bFound = false;
+ bool bChilds = false;
if( rName.Len() )
{
@@ -376,11 +378,11 @@ sal_Bool SdPageObjsTLB::HasSelectedChilds( const String& rName )
aTmp = GetEntryText( pEntry );
if( aTmp == rName )
{
- bFound = sal_True;
- sal_Bool bExpanded = IsExpanded( pEntry );
+ bFound = true;
+ bool bExpanded = IsExpanded( pEntry );
long nCount = GetChildSelectionCount( pEntry );
if( bExpanded && nCount > 0 )
- bChilds = sal_True;
+ bChilds = true;
}
}
}
@@ -394,8 +396,7 @@ sal_Bool SdPageObjsTLB::HasSelectedChilds( const String& rName )
|*
\************************************************************************/
-void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, sal_Bool bAllPages,
- const String& rDocName)
+void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, const String& rDocName)
{
String aSelection;
if( GetSelectionCount() > 0 )
@@ -406,7 +407,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, sal_Bool bAllPages,
mpDoc = pInDoc;
maDocName = rDocName;
- mbShowAllPages = (bAllPages == sal_True);
+ mbShowAllPages = bAllPages;
mpMedium = NULL;
SdPage* pPage = NULL;
@@ -423,8 +424,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, sal_Bool bAllPages,
if( (mbShowAllPages || pPage->GetPageKind() == PK_STANDARD)
&& !(pPage->GetPageKind()==PK_HANDOUT) ) //#94954# never list the normal handout page ( handout-masterpage is used instead )
{
- sal_Bool bPageExluded = pPage->IsExcluded();
-
+ bool bPageExluded = pPage->IsExcluded();
bool bPageBelongsToShow = PageBelongsToCurrentShow (pPage);
bPageExluded |= !bPageBelongsToShow;
@@ -475,7 +475,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, SfxMedium* pInMedium,
aImgDocOpen,
aImgDocClosed,
NULL,
- sal_True,
+ true,
LIST_APPEND,
reinterpret_cast< void* >( 1 ) );
@@ -509,7 +509,7 @@ void SdPageObjsTLB::AddShapeList (
aIcon,
aIcon,
pParentEntry,
- sal_False,
+ false,
LIST_APPEND,
pUserData);
@@ -524,9 +524,8 @@ void SdPageObjsTLB::AddShapeList (
SdrObjListIter aIter(
rList,
- !rList.HasObjectNavigationOrder() /* use navigation order, if available */,
IM_FLAT,
- sal_False /*not reverse*/);
+ false /*not reverse*/);
while( aIter.IsMore() )
{
@@ -541,7 +540,7 @@ void SdPageObjsTLB::AddShapeList (
if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2 )
{
SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgOle, maImgOle, pEntry,
- sal_False, LIST_APPEND, pObj);
+ false, LIST_APPEND, pObj);
SetExpandedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
SetCollapsedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
@@ -549,15 +548,15 @@ void SdPageObjsTLB::AddShapeList (
else if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF )
{
SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgGraphic, maImgGraphic, pEntry,
- sal_False, LIST_APPEND, pObj );
+ false, LIST_APPEND, pObj );
SetExpandedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST );
SetCollapsedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST );
}
- else if (pObj->IsGroupObject())
+ else if (pObj->getChildrenOfSdrObject())
{
AddShapeList(
- *pObj->GetSubList(),
+ *pObj->getChildrenOfSdrObject(),
pObj,
aStr,
false,
@@ -567,7 +566,7 @@ void SdPageObjsTLB::AddShapeList (
else
{
SvLBoxEntry* pNewEntry = InsertEntry( aStr, rIconProvider.maImgObjects, rIconProvider.maImgObjects, pEntry,
- sal_False, LIST_APPEND, pObj );
+ false, LIST_APPEND, pObj );
SetExpandedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST );
SetCollapsedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST );
@@ -631,13 +630,13 @@ bool SdPageObjsTLB::GetShowAllShapes (void) const
|*
\************************************************************************/
-sal_Bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
+bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
{
if( pInDoc )
mpDoc = pInDoc;
if( !mpDoc )
- return( sal_False );
+ return( false );
SdrObject* pObj = NULL;
SdPage* pPage = NULL;
@@ -654,17 +653,16 @@ sal_Bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
if( pPage->GetPageKind() == PK_STANDARD )
{
if( !pEntry )
- return( sal_False );
+ return( false );
aName = GetEntryText( pEntry );
if( pPage->GetName() != aName )
- return( sal_False );
+ return( false );
pEntry = Next( pEntry );
SdrObjListIter aIter(
*pPage,
- !pPage->HasObjectNavigationOrder() /* use navigation order, if available */,
IM_DEEPWITHGROUPS );
while( aIter.IsMore() )
@@ -676,12 +674,12 @@ sal_Bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
if( aObjectName.Len() )
{
if( !pEntry )
- return( sal_False );
+ return( false );
aName = GetEntryText( pEntry );
if( aObjectName != aName )
- return( sal_False );
+ return( false );
pEntry = Next( pEntry );
}
@@ -773,7 +771,7 @@ void SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry )
aImgPage,
aImgPage,
pFileEntry,
- sal_False,
+ false,
LIST_APPEND,
reinterpret_cast< void* >( 1 ) );
@@ -864,7 +862,7 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
if( pMed )
{
// in this mode the document is also owned and controlled by this instance
- mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_True);
+ mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, true);
if (mxBookmarkDocShRef->DoLoad(pMed))
mpBookmarkDoc = mxBookmarkDocShRef->GetDoc();
else
@@ -933,12 +931,12 @@ void SdPageObjsTLB::SelectHdl()
{
SvLBoxEntry* pEntry = FirstSelected();
- mbLinkableSelected = sal_True;
+ mbLinkableSelected = true;
while( pEntry && mbLinkableSelected )
{
if( NULL == pEntry->GetUserData() )
- mbLinkableSelected = sal_False;
+ mbLinkableSelected = false;
pEntry = NextSelected( pEntry );
}
@@ -999,26 +997,24 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel)
// Select all entries and disable them as drop targets.
SetSelectionMode(MULTIPLE_SELECTION);
- SetCursor(NULL, sal_False);
- SelectAll(sal_True, sal_False);
- EnableSelectionAsDropTarget(sal_False, sal_True);
+ SetCursor(NULL, false);
+ SelectAll(true, false);
+ EnableSelectionAsDropTarget(false, true);
// Enable only the entries as drop targets that are children of the
// page under the mouse.
SvLBoxEntry* pParent = GetRootLevelParent(pEntry);
if (pParent != NULL)
{
- SelectAll(sal_False, sal_False);
- Select(pParent, sal_True);
- // for (SvLBoxEntry*pChild=FirstChild(pParent); pChild!=NULL; pChild=NextSibling(pChild))
- // Select(pChild, sal_True);
- EnableSelectionAsDropTarget(sal_True, sal_True);//sal_False);
+ SelectAll(false, false);
+ Select(pParent, true);
+ EnableSelectionAsDropTarget(true, true);//false);
}
// Set selection back to the entry under the mouse.
- SelectAll(sal_False,sal_False);
+ SelectAll(false,false);
SetSelectionMode(SINGLE_SELECTION);
- Select(pEntry, sal_True);
+ Select(pEntry, true);
// Aus dem ExecuteDrag heraus kann der Navigator geloescht werden
// (beim Umschalten auf einen anderen Dokument-Typ), das wuerde aber
@@ -1054,15 +1050,10 @@ void SdPageObjsTLB::DoDrag()
if( eDragType == NAVIGATOR_DRAGTYPE_LINK )
nDNDActions = DND_ACTION_LINK; // #93240# Either COPY *or* LINK, never both!
- else if (mpDoc->GetSdPageCount(PK_STANDARD) == 1)
- {
- // Can not move away the last slide in a document.
- nDNDActions = DND_ACTION_COPY;
- }
SvTreeListBox::ReleaseMouse();
- bIsInDrag = sal_True;
+ bIsInDrag = true;
SvLBoxDDInfo aDDInfo;
memset(&aDDInfo,0,sizeof(SvLBoxDDInfo));
@@ -1076,15 +1067,16 @@ void SdPageObjsTLB::DoDrag()
// object is destroyed by internal reference mechanism
SdTransferable* pTransferable = new SdPageObjsTLB::SdPageObjsTransferable(
*this, aBookmark, *pDocShell, eDragType, aTreeListBoxData);
+ OSL_TRACE("created new SdPageObjsTransferable at %x", pTransferable);
// Get the view.
- ::sd::ViewShell* pViewShell = GetViewShellForDocShell(*pDocShell);
- if (pViewShell == NULL)
+ sd::View* pView = NULL;
+ if (pDocShell != NULL)
{
- OSL_ASSERT(pViewShell!=NULL);
- return;
+ ::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
+ if (pViewShell != NULL)
+ pView = pViewShell->GetView();
}
- sd::View* pView = pViewShell->GetView();
if (pView == NULL)
{
OSL_ASSERT(pView!=NULL);
@@ -1095,32 +1087,26 @@ void SdPageObjsTLB::DoDrag()
void* pUserData = GetCurEntry()->GetUserData();
if (pUserData != NULL && pUserData != (void*)1)
pObject = reinterpret_cast<SdrObject*>(pUserData);
- if (pObject != NULL)
- {
- // For shapes without a user supplied name (the automatically
- // created name does not count), a different drag and drop technique
- // is used.
- if (GetObjectName(pObject, false).Len() == 0)
- {
- AddShapeToTransferable(*pTransferable, *pObject);
- pTransferable->SetView(pView);
- SD_MOD()->pTransferDrag = pTransferable;
- }
+ if (pObject == NULL)
+ return;
- // Unnamed shapes have to be selected to be recognized by the
- // current drop implementation. In order to have a consistent
- // behaviour for all shapes, every shape that is to be dragged is
- // selected first.
- SdrPageView* pPageView = pView->GetSdrPageView();
- pView->UnmarkAllObj(pPageView);
- pView->MarkObj(pObject, pPageView);
- }
- else
+ // For shapes without a user supplied name (the automatically
+ // created name does not count), a different drag and drop technique
+ // is used.
+ if (GetObjectName(pObject, false).Len() == 0)
{
+ AddShapeToTransferable(*pTransferable, *pObject);
pTransferable->SetView(pView);
SD_MOD()->pTransferDrag = pTransferable;
}
+ // Unnamed shapes have to be selected to be recognized by the
+ // current drop implementation. In order to have a consistent
+ // behaviour for all shapes, every shape that is to be dragged is
+ // selected first.
+ pView->UnmarkAllObj();
+ pView->MarkObj(*pObject);
+
pTransferable->StartDrag( this, nDNDActions );
}
}
@@ -1145,7 +1131,7 @@ void SdPageObjsTLB::OnDragFinished( sal_uInt8 )
}
mpDropNavWin = NULL;
- bIsInDrag = sal_False;
+ bIsInDrag = false;
}
/*************************************************************************
@@ -1167,7 +1153,7 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
SvLBoxEntry* pEntry = GetDropTarget(rEvent.maPosPixel);
if (rEvent.mbLeaving || !CheckDragAndDropMode( this, rEvent.mnAction ))
{
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ ImplShowTargetEmphasis( pTargetEntry, false );
}
else if( !nDragDropMode )
{
@@ -1180,16 +1166,16 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
// Draw emphasis.
if (pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS))
{
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ ImplShowTargetEmphasis( pTargetEntry, false );
pTargetEntry = pEntry;
- ImplShowTargetEmphasis( pTargetEntry, sal_True );
+ ImplShowTargetEmphasis( pTargetEntry, true );
}
}
}
// Hide emphasis when there is no valid drop action.
if (nResult == DND_ACTION_NONE)
- ImplShowTargetEmphasis(pTargetEntry, sal_False);
+ ImplShowTargetEmphasis(pTargetEntry, false);
return nResult;
}
@@ -1256,7 +1242,7 @@ IMPL_STATIC_LINK(SdPageObjsTLB, ExecDragHdl, void*, EMPTYARG)
bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const
{
- // Return <TRUE/> as default when there is no custom show or when none
+ // Return <true/> as default when there is no custom show or when none
// is used. The page does then belong to the standard show.
bool bBelongsToShow = true;
@@ -1304,27 +1290,27 @@ sal_Bool SdPageObjsTLB::NotifyMoving(
if (pSourceObject == reinterpret_cast<SdrObject*>(1))
pSourceObject = NULL;
- if (pTargetObject != NULL && pSourceObject != NULL)
+ if (pTargetObject && pSourceObject )
{
- SdrPage* pObjectList = pSourceObject->GetPage();
- if (pObjectList != NULL)
+ SdrPage* pObjectList = pSourceObject->getSdrPageFromSdrObject();
+ if (pObjectList )
{
sal_uInt32 nNewPosition;
if (pTargetObject == reinterpret_cast<SdrObject*>(1))
nNewPosition = 0;
else
nNewPosition = pTargetObject->GetNavigationPosition() + 1;
- pObjectList->SetObjectNavigationPosition(*pSourceObject, nNewPosition);
+ pObjectList->SetUserNavigationPosition(*pSourceObject, nNewPosition);
}
// Update the tree list.
- if (pTarget == NULL)
+ if (!pTarget)
{
rpNewParent = 0;
rNewChildPos = 0;
- return sal_True;
+ return true;
}
- else if (GetParent(pDestination) == NULL)
+ else if ( !GetParent(pDestination) )
{
rpNewParent = pDestination;
rNewChildPos = 0;
@@ -1336,10 +1322,10 @@ sal_Bool SdPageObjsTLB::NotifyMoving(
rNewChildPos += nCurEntrySelPos;
nCurEntrySelPos++;
}
- return sal_True;
+ return true;
}
else
- return sal_False;
+ return false;
}
@@ -1351,6 +1337,8 @@ SvLBoxEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation)
if (pEntry == NULL)
return NULL;
+ OSL_TRACE("entry is %s",
+ ::rtl::OUStringToOString(GetEntryText(pEntry), RTL_TEXTENCODING_UTF8).getStr());
if (GetParent(pEntry) == NULL)
{
// Use page entry as insertion position.
@@ -1373,6 +1361,8 @@ SvLBoxEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation)
else
break;
}
+ OSL_TRACE("returning %s",
+ ::rtl::OUStringToOString(GetEntryText(pEntry), RTL_TEXTENCODING_UTF8).getStr());
}
return pEntry;
@@ -1434,15 +1424,14 @@ void SdPageObjsTLB::AddShapeToTransferable (
pDocShell->FillTransferableObjectDescriptor(aObjectDescriptor);
}
- Point aDragPos (rObject.GetCurrentBoundRect().Center());
- //Point aDragPos (0,0);
- aObjectDescriptor.maDragStartPos = aDragPos;
- // aObjectDescriptor.maSize = GetAllMarkedRect().GetSize();
+ const basegfx::B2DPoint aDragPos(rObject.getObjectRange(0).getCenter());
+ aObjectDescriptor.maDragStartPos = Point(basegfx::fround(aDragPos.getX()), basegfx::fround(aDragPos.getY()));
+
if (pDocShell != NULL)
aObjectDescriptor.maDisplayName = pDocShell->GetMedium()->GetURLObject().GetURLNoPass();
else
aObjectDescriptor.maDisplayName = String();
- aObjectDescriptor.mbCanLink = sal_False;
+ aObjectDescriptor.mbCanLink = false;
rTransferable.SetStartPos(aDragPos);
rTransferable.SetObjectDescriptor( aObjectDescriptor );
diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx
index 113f361248a8..ac7cdd15cefa 100644
--- a/sd/source/ui/dlg/tabtempl.cxx
+++ b/sd/source/ui/dlg/tabtempl.cxx
@@ -66,7 +66,7 @@ SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent,
SfxStyleSheetBase& rStyleBase,
SdrModel* pModel,
SdrView* pView ) :
- SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, sal_False ),
+ SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, false ),
rDocShell ( *pDocShell ),
pSdrView ( pView ),
pColorTab ( pModel->GetColorTable() ),
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 18879cf715e0..876200b1b5e0 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -53,6 +53,7 @@
#include <svl/aeitem.hxx>
#include <editeng/colritem.hxx>
#include <svx/svdoole2.hxx>
+#include <svx/svdograf.hxx>
#include <sfx2/docfile.hxx>
#include <sot/storage.hxx>
#include <basic/sbmeth.hxx>
@@ -138,7 +139,7 @@ SdTPAction::SdTPAction( Window* pWindow, const SfxItemSet& rInAttrs ) :
rOutAttrs ( rInAttrs ),
mpView ( NULL ),
mpDoc ( NULL ),
- bTreeUpdated ( sal_False )
+ bTreeUpdated ( false )
{
aEdtSound.SetAccessibleName(String(SdResId(STR_PATHNAME)));
aBtnSeek.SetAccessibleRelationMemberOf( &aFlSeparator );
@@ -200,41 +201,13 @@ void SdTPAction::SetView( const ::sd::View* pSdView )
void SdTPAction::Construct()
{
// OLE-Actionlistbox auffuellen
- SdrOle2Obj* pOleObj = NULL;
- SdrGrafObj* pGrafObj = NULL;
- sal_Bool bOLEAction = sal_False;
+ SdrOle2Obj* pOleObj = dynamic_cast< SdrOle2Obj* >(mpView->getSelectedIfSingle());
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(mpView->getSelectedIfSingle());
+ bool bOLEAction = false;
- if ( mpView->AreObjectsMarked() )
- {
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- SdrObject* pObj;
-
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- pObj = pMark->GetMarkedSdrObj();
-
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
-
- if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
- {
- pOleObj = (SdrOle2Obj*) pObj;
- }
- else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRAF)
- {
- pGrafObj = (SdrGrafObj*) pObj;
- }
-// // VCXControl ?
-// else if( pObj->IsA( TYPE( VCSbxDrawObject ) ) )
-// {
-// bDisableAll = sal_True;
-// }
- }
- }
if( pGrafObj )
{
- bOLEAction = sal_True;
+ bOLEAction = true;
aVerbVector.push_back( 0 );
aLbOLEAction.InsertEntry( MnemonicGenerator::EraseAllMnemonicChars( String( SdResId( STR_EDIT_OBJ ) ) ) );
@@ -244,7 +217,7 @@ void SdTPAction::Construct()
uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef();
if ( xObj.is() )
{
- bOLEAction = sal_True;
+ bOLEAction = true;
uno::Sequence < embed::VerbDescriptor > aVerbs;
try
{
@@ -297,7 +270,7 @@ void SdTPAction::Construct()
sal_Bool SdTPAction::FillItemSet( SfxItemSet& rAttrs )
{
- sal_Bool bModified = sal_False;
+ bool bModified = false;
presentation::ClickAction eCA = presentation::ClickAction_NONE;
if( aLbAction.GetSelectEntryCount() )
@@ -306,12 +279,12 @@ sal_Bool SdTPAction::FillItemSet( SfxItemSet& rAttrs )
if( aLbAction.GetSavedValue() != aLbAction.GetSelectEntryPos() )
{
rAttrs.Put( SfxAllEnumItem( ATTR_ACTION, (sal_uInt16)eCA ) );
- bModified = sal_True;
+ bModified = true;
}
else
rAttrs.InvalidateItem( ATTR_ACTION );
- String aFileName = GetEditText( sal_True );
+ String aFileName = GetEditText( true );
if( aFileName.Len() == 0 )
rAttrs.InvalidateItem( ATTR_ACTION_FILENAME );
else
@@ -327,7 +300,7 @@ sal_Bool SdTPAction::FillItemSet( SfxItemSet& rAttrs )
INetURLObject::DECODE_UNAMBIGUOUS );
rAttrs.Put( SfxStringItem( ATTR_ACTION_FILENAME, aFileName ) );
- bModified = sal_True;
+ bModified = true;
}
else
{
@@ -367,7 +340,7 @@ void SdTPAction::Reset( const SfxItemSet& rAttrs )
case presentation::ClickAction_BOOKMARK:
{
if( !aLbTree.SelectEntry( aFileName ) )
- aLbTree.SelectAll( sal_False );
+ aLbTree.SelectAll( false );
}
break;
@@ -418,8 +391,8 @@ void SdTPAction::UpdateTree()
if( !bTreeUpdated && mpDoc && mpDoc->GetDocSh() && mpDoc->GetDocSh()->GetMedium() )
{
//aLbTree.Clear();
- aLbTree.Fill( mpDoc, sal_True, mpDoc->GetDocSh()->GetMedium()->GetName() );
- bTreeUpdated = sal_True;
+ aLbTree.Fill( mpDoc, true, mpDoc->GetDocSh()->GetMedium()->GetName() );
+ bTreeUpdated = true;
}
}
@@ -429,11 +402,10 @@ void SdTPAction::OpenFileDialog()
{
// Soundpreview nur fuer Interaktionen mit Sound
presentation::ClickAction eCA = GetActualClickAction();
- sal_Bool bSound = ( eCA == presentation::ClickAction_SOUND );
- sal_Bool bPage = ( eCA == presentation::ClickAction_BOOKMARK );
- sal_Bool bDocument = ( eCA == presentation::ClickAction_DOCUMENT ||
- eCA == presentation::ClickAction_PROGRAM );
- sal_Bool bMacro = ( eCA == presentation::ClickAction_MACRO );
+ bool bSound = ( eCA == presentation::ClickAction_SOUND );
+ bool bPage = ( eCA == presentation::ClickAction_BOOKMARK );
+ bool bDocument = ( eCA == presentation::ClickAction_DOCUMENT || eCA == presentation::ClickAction_PROGRAM );
+ bool bMacro = ( eCA == presentation::ClickAction_MACRO );
if( bPage )
{
@@ -708,7 +680,7 @@ IMPL_LINK( SdTPAction, CheckFileHdl, void *, EMPTYARG )
// Ueberpruefen, ob es eine gueltige Draw-Datei ist
SfxMedium aMedium( aFile,
STREAM_READ | STREAM_NOCREATE,
- sal_True ); // Download
+ true ); // Download
if( aMedium.IsStorage() )
{
@@ -730,7 +702,7 @@ IMPL_LINK( SdTPAction, CheckFileHdl, void *, EMPTYARG )
aLastFile = aFile;
aLbTreeDocument.Clear();
- aLbTreeDocument.Fill( pBookmarkDoc, sal_True, aFile );
+ aLbTreeDocument.Fill( pBookmarkDoc, true, aFile );
mpDoc->CloseBookmarkDoc();
aLbTreeDocument.Show();
}
@@ -834,7 +806,7 @@ void SdTPAction::SetEditText( String const & rStr )
//------------------------------------------------------------------------
-String SdTPAction::GetEditText( sal_Bool bFullDocDestination )
+String SdTPAction::GetEditText( bool bFullDocDestination )
{
String aStr;
presentation::ClickAction eCA = GetActualClickAction();
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 527fcb8a3724..f5c8bd743615 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -96,9 +96,6 @@ sal_Bool SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs )
{
SvxGridTabPage::FillItemSet(rAttrs);
SdOptionsSnapItem* pOptsItem = NULL;
-// if(SFX_ITEM_SET != rAttrs.GetItemState( ATTR_OPTIONS_SNAP, sal_False, (const SfxPoolItem**)&pOptsItem ))
-// pExampleSet->GetItemState( ATTR_OPTIONS_SNAP, sal_False, (const SfxPoolItem**)&pOptsItem );
-
SdOptionsSnapItem aOptsItem( ATTR_OPTIONS_SNAP );
aOptsItem.GetOptionsSnap().SetSnapHelplines( aCbxSnapHelplines.IsChecked() );
@@ -117,7 +114,7 @@ sal_Bool SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs )
// Evtl. vorhandenes GridItem wird geholt, um nicht versehentlich
// irgendwelche Standardwerte einzustellen
- return( sal_True );
+ return( true );
}
// -----------------------------------------------------------------------
@@ -178,7 +175,7 @@ SdTpOptionsContents::~SdTpOptionsContents()
sal_Bool SdTpOptionsContents::FillItemSet( SfxItemSet& rAttrs )
{
- sal_Bool bModified = sal_False;
+ bool bModified = false;
if( aCbxRuler.GetSavedValue() != aCbxRuler.IsChecked() ||
aCbxMoveOutline.GetSavedValue() != aCbxMoveOutline.IsChecked() ||
@@ -195,7 +192,7 @@ sal_Bool SdTpOptionsContents::FillItemSet( SfxItemSet& rAttrs )
//aOptsItem.GetOptionsLayout().SetHelplines( aCbxHelplines.IsChecked() );
rAttrs.Put( aOptsItem );
- bModified = sal_True;
+ bModified = true;
}
return( bModified );
}
@@ -353,8 +350,7 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet )
// Metrik ggfs. aendern (da TabPage im Dialog liegt,
// wo die Metrik eingestellt werden kann
const SfxPoolItem* pAttr = NULL;
- if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC , sal_False,
- (const SfxPoolItem**)&pAttr ))
+ if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC , false, (const SfxPoolItem**)&pAttr ))
{
const SfxUInt16Item* pItem = (SfxUInt16Item*) pAttr;
@@ -364,11 +360,11 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet )
{
// Metriken einstellen
sal_Int64 nVal = aMtrFldOriginalWidth.Denormalize( aMtrFldOriginalWidth.GetValue( FUNIT_TWIP ) );
- SetFieldUnit( aMtrFldOriginalWidth, eFUnit, sal_True );
+ SetFieldUnit( aMtrFldOriginalWidth, eFUnit, true );
aMtrFldOriginalWidth.SetValue( aMtrFldOriginalWidth.Normalize( nVal ), FUNIT_TWIP );
nVal = aMtrFldOriginalHeight.Denormalize( aMtrFldOriginalHeight.GetValue( FUNIT_TWIP ) );
- SetFieldUnit( aMtrFldOriginalHeight, eFUnit, sal_True );
+ SetFieldUnit( aMtrFldOriginalHeight, eFUnit, true );
aMtrFldOriginalHeight.SetValue( aMtrFldOriginalHeight.Normalize( nVal ), FUNIT_TWIP );
@@ -417,7 +413,7 @@ int SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet )
sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
{
- sal_Bool bModified = sal_False;
+ bool bModified = false;
if( aCbxStartWithTemplate.GetSavedValue() != aCbxStartWithTemplate.IsChecked() ||
aCbxMarkedHitMovesAlways.GetSavedValue()!= aCbxMarkedHitMovesAlways.IsChecked() ||
@@ -447,7 +443,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
: ::com::sun::star::document::PrinterIndependentLayout::ENABLED);
rAttrs.Put( aOptsItem );
- bModified = sal_True;
+ bModified = true;
}
// Metrik
@@ -455,9 +451,8 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
if ( nMPos != aLbMetric.GetSavedValue() )
{
sal_uInt16 nFieldUnit = (sal_uInt16)(long)aLbMetric.GetEntryData( nMPos );
- rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ),
- (sal_uInt16)nFieldUnit ) );
- bModified |= sal_True;
+ rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ), (sal_uInt16)nFieldUnit ) );
+ bModified = true;
}
// Tabulatorabstand
@@ -467,7 +462,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWh );
SfxUInt16Item aDef( nWh,(sal_uInt16)GetCoreValue( aMtrFldTabstop, eUnit ) );
rAttrs.Put( aDef );
- bModified |= sal_True;
+ bModified = true;
}
sal_Int32 nX, nY;
@@ -476,7 +471,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
rAttrs.Put( SfxInt32Item( ATTR_OPTIONS_SCALE_X, nX ) );
rAttrs.Put( SfxInt32Item( ATTR_OPTIONS_SCALE_Y, nY ) );
- bModified = sal_True;
+ bModified = true;
}
return( bModified );
@@ -756,28 +751,28 @@ String SdTpOptionsMisc::GetScale( sal_Int32 nX, sal_Int32 nY )
// -----------------------------------------------------------------------
-sal_Bool SdTpOptionsMisc::SetScale( const String& aScale, sal_Int32& rX, sal_Int32& rY )
+bool SdTpOptionsMisc::SetScale( const String& aScale, sal_Int32& rX, sal_Int32& rY )
{
if( aScale.GetTokenCount( TOKEN ) != 2 )
- return( sal_False );
+ return( false );
ByteString aTmp( aScale.GetToken( 0, TOKEN ), RTL_TEXTENCODING_ASCII_US );
if( !aTmp.IsNumericAscii() )
- return( sal_False );
+ return( false );
rX = (long) aTmp.ToInt32();
if( rX == 0 )
- return( sal_False );
+ return( false );
aTmp = ByteString( aScale.GetToken( 1, TOKEN ), RTL_TEXTENCODING_ASCII_US );
if( !aTmp.IsNumericAscii() )
- return( sal_False );
+ return( false );
rY = (long) aTmp.ToInt32();
if( rY == 0 )
- return( sal_False );
+ return( false );
- return( sal_True );
+ return( true );
}
@@ -841,7 +836,7 @@ void SdTpOptionsMisc::UpdateCompatibilityControls (void)
void SdTpOptionsMisc::PageCreated (SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG);
if (pFlagItem)
{
sal_uInt32 nFlags=pFlagItem->GetValue();
diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx
index a58b47b599e2..04161778847c 100644
--- a/sd/source/ui/dlg/unchss.cxx
+++ b/sd/source/ui/dlg/unchss.cxx
@@ -29,6 +29,7 @@
#include <svl/style.hxx>
#include <svl/smplhint.hxx>
#include <svx/svdobj.hxx>
+#include <svx/globaldrawitempool.hxx>
#include "unchss.hxx"
@@ -40,34 +41,23 @@
#include "glob.hrc"
-TYPEINIT1(StyleSheetUndoAction, SdUndoAction);
-
-
-
/*************************************************************************
|*
|* Konstruktor
|*
\************************************************************************/
-StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
- SfxStyleSheet* pTheStyleSheet,
- const SfxItemSet* pTheNewItemSet) :
- SdUndoAction(pTheDoc)
+StyleSheetUndoAction::StyleSheetUndoAction(
+ SdDrawDocument& rTheDoc,
+ SfxStyleSheet& rTheStyleSheet,
+ const SfxItemSet& rTheNewItemSet)
+: SdUndoAction(&rTheDoc),
+ mrStyleSheet(rTheStyleSheet),
+ maNewSet(rTheNewItemSet),
+ maOldSet(mrStyleSheet.GetItemSet())
{
- DBG_ASSERT(pTheStyleSheet, "Undo ohne StyleSheet ???");
- pStyleSheet = pTheStyleSheet;
-
- // ItemSets anlegen; Vorsicht, das neue koennte aus einem anderen Pool
- // stammen, also mitsamt seinen Items clonen
- pNewSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(), pTheNewItemSet->GetRanges());
- pTheDoc->MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc );
-
- pOldSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(),pStyleSheet->GetItemSet().GetRanges());
- pTheDoc->MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc );
-
aComment = String(SdResId(STR_UNDO_CHANGE_PRES_OBJECT));
- String aName(pStyleSheet->GetName());
+ String aName(mrStyleSheet.GetName());
// Layoutnamen und Separator loeschen
String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ) );
@@ -122,14 +112,16 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
void StyleSheetUndoAction::Undo()
{
- SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() );
- mpDoc->MigrateItemSet( pOldSet, &aNewSet, mpDoc );
+ mrStyleSheet.GetItemSet().Set(maOldSet);
- pStyleSheet->GetItemSet().Set(aNewSet);
- if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
- ( (SdStyleSheet*)pStyleSheet )->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ if(SD_STYLE_FAMILY_PSEUDO == mrStyleSheet.GetFamily())
+ {
+ static_cast< SdStyleSheet& >(mrStyleSheet).GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ }
else
- pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ {
+ mrStyleSheet.Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ }
}
/*************************************************************************
@@ -140,14 +132,16 @@ void StyleSheetUndoAction::Undo()
void StyleSheetUndoAction::Redo()
{
- SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() );
- mpDoc->MigrateItemSet( pNewSet, &aNewSet, mpDoc );
+ mrStyleSheet.GetItemSet().Set(maNewSet);
- pStyleSheet->GetItemSet().Set(aNewSet);
- if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
- ( (SdStyleSheet*)pStyleSheet )->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ if(SD_STYLE_FAMILY_PSEUDO == mrStyleSheet.GetFamily())
+ {
+ static_cast< SdStyleSheet& >(mrStyleSheet).GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ }
else
- pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ {
+ mrStyleSheet.Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ }
}
/*************************************************************************
@@ -158,8 +152,6 @@ void StyleSheetUndoAction::Redo()
StyleSheetUndoAction::~StyleSheetUndoAction()
{
- delete pNewSet;
- delete pOldSet;
}
/*************************************************************************
@@ -172,3 +164,5 @@ String StyleSheetUndoAction::GetComment() const
{
return aComment;
}
+
+// eof
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 454accb9fe27..5f85ce4b7efe 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -168,7 +168,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale )
void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
{
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
aPrgs.SetValue( 0 );
Fraction aScale;
@@ -236,7 +236,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
}
aPrgs.SetValue( 0 );
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
}
// -----------------------------------------------------------------------------
@@ -276,8 +276,8 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf,
if( aRect.Bottom() > ( rMaxSize.Height() - 1L ) )
aRect.Bottom() = rMaxSize.Height() - 1L;
- rMtf.AddAction( new MetaLineColorAction( aColor, sal_True ) );
- rMtf.AddAction( new MetaFillColorAction( aColor, sal_True ) );
+ rMtf.AddAction( new MetaLineColorAction( aColor, true ) );
+ rMtf.AddAction( new MetaFillColorAction( aColor, true ) );
rMtf.AddAction( new MetaRectAction( aRect ) );
}
@@ -352,19 +352,22 @@ void SdVectorizeDlg::LoadSettings()
sal_uInt16 nLayers;
sal_uInt16 nReduce;
sal_uInt16 nFillHoles;
- sal_Bool bFillHoles;
+ bool bFillHoles;
if( xIStm.Is() )
{
SdIOCompat aCompat( *xIStm, STREAM_READ );
- *xIStm >> nLayers >> nReduce >> nFillHoles >> bFillHoles;
+ sal_Bool bTempBOOL;
+
+ *xIStm >> nLayers >> nReduce >> nFillHoles;
+ *xIStm >> bTempBOOL; bFillHoles = bTempBOOL;
}
else
{
nLayers = 8;
nReduce = 0;
nFillHoles = 32;
- bFillHoles = sal_False;
+ bFillHoles = false;
}
aNmLayers.SetValue( nLayers );
@@ -388,6 +391,6 @@ void SdVectorizeDlg::SaveSettings() const
{
SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 );
*xOStm << (sal_uInt16) aNmLayers.GetValue() << (sal_uInt16) aMtReduce.GetValue();
- *xOStm << (sal_uInt16) aMtFillHoles.GetValue() << aCbFillHoles.IsChecked();
+ *xOStm << (sal_uInt16) aMtFillHoles.GetValue() << (sal_Bool)aCbFillHoles.IsChecked();
}
}
diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index 8b1b007f1b50..0e49e7ed9e50 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -70,11 +70,11 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect)
ClientView* pView = new ClientView(this, pOut, NULL);
- pView->SetHlplVisible(sal_False);
- pView->SetGridVisible(sal_False);
- pView->SetBordVisible(sal_False);
- pView->SetPageVisible(sal_False);
- pView->SetGlueVisible(sal_False);
+ pView->SetHlplVisible(false);
+ pView->SetGridVisible(false);
+ pView->SetBordVisible(false);
+ pView->SetPageVisible(false);
+ pView->SetGlueVisible(false);
SdPage* pSelectedPage = NULL;
@@ -84,7 +84,7 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect)
FrameView* pFrameView = (FrameView*)pFrameViewList->GetObject(0);
if( pFrameView && pFrameView->GetPageKind() == PK_STANDARD )
{
- sal_uInt16 nSelectedPage = pFrameView->GetSelectedPage();
+ sal_uInt32 nSelectedPage = pFrameView->GetSelectedPage();
pSelectedPage = mpDoc->GetSdPage(nSelectedPage, PK_STANDARD);
}
}
@@ -92,10 +92,10 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect)
if( NULL == pSelectedPage )
{
SdPage* pPage = NULL;
- sal_uInt16 nSelectedPage = 0;
- sal_uInt16 nPageCnt = (sal_uInt16) mpDoc->GetSdPageCount(PK_STANDARD);
+ sal_uInt32 nSelectedPage = 0;
+ sal_uInt32 nPageCnt = mpDoc->GetSdPageCount(PK_STANDARD);
- for (sal_uInt16 i = 0; i < nPageCnt; i++)
+ for (sal_uInt32 i = 0; i < nPageCnt; i++)
{
pPage = mpDoc->GetSdPage(i, PK_STANDARD);
@@ -112,7 +112,7 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect)
Rectangle aVisArea = GetVisArea(nAspect);
pOut->IntersectClipRegion(aVisArea);
- pView->ShowSdrPage(pSelectedPage);
+ pView->ShowSdrPage(*pSelectedPage);
if (pOut->GetOutDevType() != OUTDEV_WINDOW)
{
@@ -173,13 +173,9 @@ Rectangle DrawDocShell::GetVisArea(sal_uInt16 nAspect) const
if( ( ASPECT_THUMBNAIL == nAspect ) || ( ASPECT_DOCPRINT == nAspect ) )
{
// Groesse der ersten Seite herausgeben
- MapMode aSrcMapMode(MAP_PIXEL);
- MapMode aDstMapMode(MAP_100TH_MM);
- Size aSize = mpDoc->GetSdPage(0, PK_STANDARD)->GetSize();
- aSrcMapMode.SetMapUnit(MAP_100TH_MM);
+ const basegfx::B2DVector& rPageScale = mpDoc->GetSdPage(0, PK_STANDARD)->GetPageScale();
- aSize = Application::GetDefaultDevice()->LogicToLogic(aSize, &aSrcMapMode, &aDstMapMode);
- aVisArea.SetSize(aSize);
+ aVisArea.SetSize(Size(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY())));
}
else
{
@@ -262,7 +258,8 @@ Size DrawDocShell::GetFirstPageSize()
Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixel)
{
MapMode aMapMode( MAP_100TH_MM );
- const Size aSize( pPage->GetSize() );
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
+ const Size aSize(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY()));
const Point aNullPt;
VirtualDevice aVDev( *Application::GetDefaultDevice() );
@@ -285,7 +282,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
ClientView* pView = new ClientView( this, &aVDev, NULL );
FrameView* pFrameView = GetFrameView();
- pView->ShowSdrPage( pPage );
+ pView->ShowSdrPage( *pPage );
if ( GetFrameView() )
{
@@ -297,22 +294,22 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
pView->SetGridFront( pFrameView->IsGridFront() );
pView->SetSnapAngle( pFrameView->GetSnapAngle() );
pView->SetGridSnap( pFrameView->IsGridSnap() );
- pView->SetBordSnap( pFrameView->IsBordSnap() );
- pView->SetHlplSnap( pFrameView->IsHlplSnap() );
- pView->SetOFrmSnap( pFrameView->IsOFrmSnap() );
- pView->SetOPntSnap( pFrameView->IsOPntSnap() );
- pView->SetOConSnap( pFrameView->IsOConSnap() );
+ pView->SetBorderSnap( pFrameView->IsBorderSnap() );
+ pView->SetHelplineSnap( pFrameView->IsHelplineSnap() );
+ pView->SetOFrameSnap( pFrameView->IsOFrameSnap() );
+ pView->SetOPointSnap( pFrameView->IsOPointSnap() );
+ pView->SetOConnectorSnap( pFrameView->IsOConnectorSnap() );
pView->SetDragStripes( pFrameView->IsDragStripes() );
- pView->SetFrameDragSingles( pFrameView->IsFrameDragSingles() );
- pView->SetSnapMagneticPixel( pFrameView->GetSnapMagneticPixel() );
+ pView->SetFrameHandles( pFrameView->IsFrameHandles() );
+ pView->SetDiscreteMagneticSnap( pFrameView->GetDiscreteMagneticSnap() );
pView->SetMarkedHitMovesAlways( pFrameView->IsMarkedHitMovesAlways() );
pView->SetMoveOnlyDragging( pFrameView->IsMoveOnlyDragging() );
pView->SetSlantButShear( pFrameView->IsSlantButShear() );
pView->SetNoDragXorPolys( pFrameView->IsNoDragXorPolys() );
pView->SetCrookNoContortion( pFrameView->IsCrookNoContortion() );
pView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
- pView->SetBigOrtho( pFrameView->IsBigOrtho() );
- pView->SetOrtho( pFrameView->IsOrtho() );
+ pView->SetBigOrthogonal( pFrameView->IsBigOrthogonal() );
+ pView->SetOrthogonal( pFrameView->IsOrthogonal() );
SdrPageView* pPageView = pView->GetSdrPageView();
@@ -353,12 +350,12 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
/*************************************************************************
|*
|* Pruefen, ob die Seite vorhanden ist und dann den Anwender zwingen einen
-|* noch nicht vorhandenen Namen einzugeben. Wird sal_False zurueckgegeben,
+|* noch nicht vorhandenen Namen einzugeben. Wird false zurueckgegeben,
|* wurde die Aktion vom Anwender abgebrochen.
|*
\************************************************************************/
-sal_Bool DrawDocShell::CheckPageName (::Window* pWin, String& rName )
+bool DrawDocShell::CheckPageName (::Window* pWin, String& rName )
{
const String aStrForDlg( rName );
bool bIsNameValid = IsNewPageNameValid( rName, true );
@@ -388,7 +385,7 @@ sal_Bool DrawDocShell::CheckPageName (::Window* pWin, String& rName )
}
}
- return ( bIsNameValid ? sal_True : sal_False );
+ return (bIsNameValid);
}
bool DrawDocShell::IsNewPageNameValid( String & rInOutPageName, bool bResetStringIfStandardName /* = false */ )
@@ -481,8 +478,8 @@ bool DrawDocShell::IsNewPageNameValid( String & rInOutPageName, bool bResetStrin
{
if( rInOutPageName.Len() > 0 )
{
- sal_Bool bOutDummy;
- sal_uInt16 nExistingPageNum = mpDoc->GetPageByName( rInOutPageName, bOutDummy );
+ bool bOutDummy;
+ sal_uInt32 nExistingPageNum = mpDoc->GetPageByName( rInOutPageName, bOutDummy );
bCanUseNewName = ( nExistingPageNum == SDRPAGE_NOTFOUND );
}
else
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 70148e8df615..7ad01e0ffa34 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -128,9 +128,11 @@ void DrawDocShell::Execute( SfxRequest& rReq )
while (pShell)
{
- if (pShell->ISA(DrawDocShell))
+ DrawDocShell* pDrawDocShell = dynamic_cast< DrawDocShell* >(pShell);
+
+ if (pDrawDocShell)
{
- ( (DrawDocShell*) pShell)->CancelSearching();
+ pDrawDocShell->CancelSearching();
}
pShell = SfxObjectShell::GetNext(*pShell);
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 85c63cc63ed8..a3fff4eb3406 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -64,6 +64,7 @@
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <comphelper/processfactory.hxx>
+#include <svx/svdlegacy.hxx>
#include "app.hrc"
#include "glob.hrc"
@@ -92,6 +93,7 @@
#include "sdgrffilter.hxx"
#include "sdhtmlfilter.hxx"
#include "framework/FrameworkHelper.hxx"
+#include <tools/urlobj.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -106,7 +108,7 @@ namespace sd {
|*
\************************************************************************/
-SfxPrinter* DrawDocShell::GetPrinter(sal_Bool bCreate)
+SfxPrinter* DrawDocShell::GetPrinter(bool bCreate)
{
if (bCreate && !mpPrinter)
{
@@ -131,7 +133,7 @@ SfxPrinter* DrawDocShell::GetPrinter(sal_Bool bCreate)
pSet->Put( aFlagItem );
mpPrinter = new SfxPrinter(pSet);
- mbOwnPrinter = sal_True;
+ mbOwnPrinter = true;
// Ausgabequalitaet setzen
sal_uInt16 nQuality = aPrintItem.GetOptionsPrint().GetOutputQuality();
@@ -174,7 +176,7 @@ void DrawDocShell::SetPrinter(SfxPrinter *pNewPrinter)
}
mpPrinter = pNewPrinter;
- mbOwnPrinter = sal_True;
+ mbOwnPrinter = true;
if ( mpDoc->GetPrinterIndependentLayout() == ::com::sun::star::document::PrinterIndependentLayout::DISABLED )
UpdateFontList();
UpdateRefDevice();
@@ -185,10 +187,10 @@ void DrawDocShell::UpdateFontList()
delete mpFontList;
OutputDevice* pRefDevice = NULL;
if ( mpDoc->GetPrinterIndependentLayout() == ::com::sun::star::document::PrinterIndependentLayout::DISABLED )
- pRefDevice = GetPrinter(sal_True);
+ pRefDevice = GetPrinter(true);
else
pRefDevice = SD_MOD()->GetVirtualRefDevice();
- mpFontList = new FontList( pRefDevice, NULL, sal_False );
+ mpFontList = new FontList( pRefDevice, NULL, false );
SvxFontListItem aFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST );
PutItem( aFontListItem );
}
@@ -200,7 +202,7 @@ void DrawDocShell::UpdateFontList()
\************************************************************************/
Printer* DrawDocShell::GetDocumentPrinter()
{
- return GetPrinter(sal_False);
+ return GetPrinter(false);
}
/*************************************************************************
@@ -229,7 +231,7 @@ void DrawDocShell::OnDocumentPrinterChanged(Printer* pNewPrinter)
SetPrinter((SfxPrinter*) pNewPrinter);
// Printer gehoert dem Container
- mbOwnPrinter = sal_False;
+ mbOwnPrinter = false;
}
}
@@ -263,14 +265,15 @@ void DrawDocShell::UpdateRefDevice()
pRefDevice = mpPrinter;
break;
}
- mpDoc->SetRefDevice( pRefDevice );
- ::sd::Outliner* pOutl = mpDoc->GetOutliner( sal_False );
+ mpDoc->SetReferenceDevice( pRefDevice );
+
+ ::sd::Outliner* pOutl = mpDoc->GetOutliner( false );
if( pOutl )
pOutl->SetRefDevice( pRefDevice );
- ::sd::Outliner* pInternalOutl = mpDoc->GetInternalOutliner( sal_False );
+ ::sd::Outliner* pInternalOutl = mpDoc->GetInternalOutliner( false );
if( pInternalOutl )
pInternalOutl->SetRefDevice( pRefDevice );
@@ -285,7 +288,7 @@ void DrawDocShell::UpdateRefDevice()
sal_Bool DrawDocShell::InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
bRet = SfxObjectShell::InitNew( xStorage );
@@ -295,6 +298,7 @@ sal_Bool DrawDocShell::InitNew( const ::com::sun::star::uno::Reference< ::com::s
if (bRet)
{
mpDoc->SetDrawingLayerPoolDefaults();
+
if( !mbSdDataObj )
mpDoc->NewOrLoadCompleted(NEW_DOC); // otherwise calling
// NewOrLoadCompleted(NEW_LOADED) in
@@ -313,7 +317,7 @@ sal_Bool DrawDocShell::Load( SfxMedium& rMedium )
{
mbNewDocument = sal_False;
- sal_Bool bRet = sal_False;
+ bool bRet = false;
bool bStartPresentation = false;
ErrCode nError = ERRCODE_NONE;
@@ -324,7 +328,7 @@ sal_Bool DrawDocShell::Load( SfxMedium& rMedium )
{
if( ( SFX_ITEM_SET == pSet->GetItemState(SID_PREVIEW ) ) && ( (SfxBoolItem&) ( pSet->Get( SID_PREVIEW ) ) ).GetValue() )
{
- mpDoc->SetStarDrawPreviewMode( sal_True );
+ mpDoc->SetStarDrawPreviewMode( true );
}
if( SFX_ITEM_SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
@@ -355,7 +359,7 @@ sal_Bool DrawDocShell::Load( SfxMedium& rMedium )
SdPage* pPage = mpDoc->GetSdPage( 0, PK_STANDARD );
if( pPage )
- SetVisArea( Rectangle( pPage->GetAllObjBoundRect() ) );
+ SetVisArea( Rectangle( sdr::legacy::GetAllObjBoundRect(pPage->getSdrObjectVector()) ) );
}
FinishedLoading( SFX_LOADED_ALL );
@@ -399,7 +403,7 @@ sal_Bool DrawDocShell::LoadFrom( SfxMedium& rMedium )
if( mpViewShell )
pWait = new WaitObject( (Window*) mpViewShell->GetActiveWindow() );
- sal_Bool bRet = sal_False;
+ bool bRet = false;
/*
// #90691# return to old behaviour (before #80365#): construct own medium
@@ -460,17 +464,17 @@ sal_Bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
mbNewDocument = sal_False;
const String aFilterName( rMedium.GetFilter()->GetFilterName() );
- sal_Bool bRet = sal_False;
+ bool bRet = false;
bool bStartPresentation = false;
- SetWaitCursor( sal_True );
+ SetWaitCursor( true );
SfxItemSet* pSet = rMedium.GetItemSet();
if( pSet )
{
if( ( SFX_ITEM_SET == pSet->GetItemState(SID_PREVIEW ) ) && ( (SfxBoolItem&) ( pSet->Get( SID_PREVIEW ) ) ).GetValue() )
{
- mpDoc->SetStarDrawPreviewMode( sal_True );
+ mpDoc->SetStarDrawPreviewMode( true );
}
if( SFX_ITEM_SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
@@ -527,7 +531,7 @@ sal_Bool DrawDocShell::ConvertFrom( SfxMedium& rMedium )
if( pMediumSet )
pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, 5 ) );
}
- SetWaitCursor( sal_False );
+ SetWaitCursor( false );
// tell SFX to change viewshell when in preview mode
if( IsPreview() || bStartPresentation )
@@ -554,7 +558,7 @@ sal_Bool DrawDocShell::Save()
if( GetCreateMode() == SFX_CREATE_MODE_STANDARD )
SfxObjectShell::SetVisArea( Rectangle() );
- sal_Bool bRet = SfxObjectShell::Save();
+ bool bRet = SfxObjectShell::Save();
if( bRet )
{
@@ -582,7 +586,7 @@ sal_Bool DrawDocShell::SaveAs( SfxMedium& rMedium )
SfxObjectShell::SetVisArea( Rectangle() );
sal_uInt32 nVBWarning = ERRCODE_NONE;
- sal_Bool bRet = SfxObjectShell::SaveAs( rMedium );
+ bool bRet = SfxObjectShell::SaveAs( rMedium );
if( bRet )
{
@@ -605,7 +609,7 @@ sal_Bool DrawDocShell::SaveAs( SfxMedium& rMedium )
sal_Bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if( mpDoc->GetPageCount() )
{
@@ -669,37 +673,38 @@ sal_Bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
sal_Bool DrawDocShell::SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if( SfxObjectShell::SaveCompleted(xStorage) )
{
- mpDoc->NbcSetChanged( sal_False );
+ mpDoc->NbcSetChanged( false );
if( mpViewShell )
{
- if( mpViewShell->ISA( OutlineViewShell ) )
- static_cast<OutlineView*>(mpViewShell->GetView())
- ->GetOutliner()->ClearModifyFlag();
+ if( dynamic_cast< OutlineViewShell* >(mpViewShell) )
+ {
+ static_cast<OutlineView*>(mpViewShell->GetView())->GetOutliner()->ClearModifyFlag();
+ }
SdrOutliner* pOutl = mpViewShell->GetView()->GetTextEditOutliner();
if( pOutl )
{
SdrObject* pObj = mpViewShell->GetView()->GetTextEditObject();
if( pObj )
- pObj->NbcSetOutlinerParaObject( pOutl->CreateParaObject() );
+ pObj->SetOutlinerParaObject( pOutl->CreateParaObject() );
pOutl->ClearModifyFlag();
}
}
- bRet = sal_True;
+ bRet = true;
SfxViewFrame* pFrame = ( mpViewShell && mpViewShell->GetViewFrame() ) ?
mpViewShell->GetViewFrame() :
SfxViewFrame::Current();
if( pFrame )
- pFrame->GetBindings().Invalidate( SID_NAVIGATOR_STATE, sal_True, sal_False );
+ pFrame->GetBindings().Invalidate( SID_NAVIGATOR_STATE, true, false );
}
return bRet;
}
@@ -732,17 +737,17 @@ SfxStyleSheetBasePool* DrawDocShell::GetStyleSheetPool()
|*
\************************************************************************/
-sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
+bool DrawDocShell::GotoBookmark(const String& rBookmark)
{
- sal_Bool bFound = sal_False;
+ bool bFound = false;
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
- if (mpViewShell && mpViewShell->ISA(DrawViewShell))
+ if (pDrawViewShell)
{
- DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(mpViewShell);
ViewShellBase& rBase (mpViewShell->GetViewShellBase());
- sal_Bool bIsMasterPage = sal_False;
- sal_uInt16 nPageNumber = SDRPAGE_NOTFOUND;
+ bool bIsMasterPage = false;
+ sal_uInt32 nPageNumber = SDRPAGE_NOTFOUND;
SdrObject* pObj = NULL;
rtl::OUString sBookmark( rBookmark );
@@ -764,13 +769,13 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
else if ( aDestination.match( String( RTL_CONSTASCII_USTRINGPARAM( "previousslide" ) ) ) )
{
SdPage* pPage = pDrawViewShell->GetActualPage();
- nPageNumber = pPage->GetPageNum();
+ nPageNumber = pPage->GetPageNumber();
nPageNumber = nPageNumber > 2 ? nPageNumber - 2 : SDRPAGE_NOTFOUND;
}
else if ( aDestination.match( String( RTL_CONSTASCII_USTRINGPARAM( "nextslide" ) ) ) )
{
SdPage* pPage = pDrawViewShell->GetActualPage();
- nPageNumber = pPage->GetPageNum() + 2;
+ nPageNumber = pPage->GetPageNumber() + 2;
if ( nPageNumber >= mpDoc->GetPageCount() )
nPageNumber = SDRPAGE_NOTFOUND;
}
@@ -790,7 +795,12 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
if (pObj)
{
- nPageNumber = pObj->GetPage()->GetPageNum();
+ SdrPage* pOwningPage = pObj->getSdrPageFromSdrObject();
+
+ if(pOwningPage)
+ {
+ nPageNumber = pOwningPage->GetPageNumber();
+ }
}
}
}
@@ -798,7 +808,7 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
{
// Jump to the bookmarked page. This is done in three steps.
- bFound = sal_True;
+ bFound = true;
SdPage* pPage;
if (bIsMasterPage)
pPage = (SdPage*) mpDoc->GetMasterPage(nPageNumber);
@@ -810,7 +820,7 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
PageKind eNewPageKind = pPage->GetPageKind();
if( (eNewPageKind != PK_STANDARD) && (mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW) )
- return sal_False;
+ return false;
if (eNewPageKind != pDrawViewShell->GetPageKind())
{
@@ -863,7 +873,7 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
if (eNewEditMode != pDrawViewShell->GetEditMode())
{
// EditMode setzen
- pDrawViewShell->ChangeEditMode(eNewEditMode, sal_False);
+ pDrawViewShell->ChangeEditMode(eNewEditMode, false);
}
// Make the bookmarked page the current page. This is done
@@ -888,12 +898,9 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
if (pObj != NULL)
{
// Objekt einblenden und selektieren
- pDrawViewShell->MakeVisible(pObj->GetLogicRect(),
- *pDrawViewShell->GetActiveWindow());
+ pDrawViewShell->MakeVisibleAtView(sdr::legacy::GetLogicRange(*pObj), *pDrawViewShell->GetActiveWindow());
pDrawViewShell->GetView()->UnmarkAll();
- pDrawViewShell->GetView()->MarkObj(
- pObj,
- pDrawViewShell->GetView()->GetSdrPageView(), sal_False);
+ pDrawViewShell->GetView()->MarkObj(*pObj, false);
}
}
}
@@ -902,7 +909,7 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
? pDrawViewShell->GetViewFrame()
: SfxViewFrame::Current() )->GetBindings();
- rBindings.Invalidate(SID_NAVIGATOR_STATE, sal_True, sal_False);
+ rBindings.Invalidate(SID_NAVIGATOR_STATE, true, false);
rBindings.Invalidate(SID_NAVIGATOR_PAGENAME);
}
@@ -914,7 +921,6 @@ sal_Bool DrawDocShell::GotoBookmark(const String& rBookmark)
|* SaveAsOwnFormat: wenn es eine Dokumentvorlage werden soll,
|*
\************************************************************************/
-#include <tools/urlobj.hxx>
sal_Bool DrawDocShell::SaveAsOwnFormat( SfxMedium& rMedium )
{
@@ -933,7 +939,7 @@ sal_Bool DrawDocShell::SaveAsOwnFormat( SfxMedium& rMedium )
String aLayoutName;
SfxStringItem* pLayoutItem;
- if( rMedium.GetItemSet()->GetItemState(SID_TEMPLATE_NAME, sal_False, (const SfxPoolItem**) & pLayoutItem ) == SFX_ITEM_SET )
+ if( rMedium.GetItemSet()->GetItemState(SID_TEMPLATE_NAME, false, (const SfxPoolItem**) & pLayoutItem ) == SFX_ITEM_SET )
{
aLayoutName = pLayoutItem->GetValue();
}
@@ -1018,7 +1024,7 @@ OutputDevice* DrawDocShell::GetDocumentRefDev (void)
// Only when our parent does not have a reference device then we return
// our own.
if (pReferenceDevice == NULL && mpDoc != NULL)
- pReferenceDevice = mpDoc->GetRefDevice ();
+ pReferenceDevice = mpDoc->GetReferenceDevice();
return pReferenceDevice;
}
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 4d984299a92f..8f80de87cc52 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -114,7 +114,6 @@ GraphicFilter* GetGrfFilter();
|* SFX-Slotmaps und -Definitionen
|*
\************************************************************************/
-TYPEINIT1( DrawDocShell, SfxObjectShell );
SFX_IMPL_OBJECTFACTORY(
DrawDocShell,
@@ -130,7 +129,7 @@ SFX_IMPL_OBJECTFACTORY(
void DrawDocShell::Construct( bool bClipboard )
{
- mbInDestruction = sal_False;
+ mbInDestruction = false;
SetSlotFilter(); // setzt Filter zurueck
mbOwnDocument = mpDoc == 0;
@@ -157,7 +156,7 @@ void DrawDocShell::Construct( bool bClipboard )
\************************************************************************/
DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
- sal_Bool bDataObject,
+ bool bDataObject,
DocumentType eDocumentType) :
SfxObjectShell( eMode == SFX_CREATE_MODE_INTERNAL ? SFX_CREATE_MODE_EMBEDDED : eMode),
mpDoc(NULL),
@@ -168,7 +167,7 @@ DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
meDocType(eDocumentType),
mpFilterSIDs(0),
mbSdDataObj(bDataObject),
- mbOwnPrinter(sal_False),
+ mbOwnPrinter(false),
mbNewDocument( sal_True )
{
Construct( eMode == SFX_CREATE_MODE_INTERNAL );
@@ -180,7 +179,7 @@ DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
|*
\************************************************************************/
-DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, sal_Bool bDataObject, DocumentType eDocumentType ) :
+DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, bool bDataObject, DocumentType eDocumentType ) :
SfxObjectShell( nModelCreationFlags ),
mpDoc(NULL),
mpUndoManager(NULL),
@@ -190,10 +189,10 @@ DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, sal_Bool bData
meDocType(eDocumentType),
mpFilterSIDs(0),
mbSdDataObj(bDataObject),
- mbOwnPrinter(sal_False),
+ mbOwnPrinter(false),
mbNewDocument( sal_True )
{
- Construct( sal_False );
+ Construct( false );
}
/*************************************************************************
@@ -203,7 +202,7 @@ DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, sal_Bool bData
\************************************************************************/
DrawDocShell::DrawDocShell(SdDrawDocument* pDoc, SfxObjectCreateMode eMode,
- sal_Bool bDataObject,
+ bool bDataObject,
DocumentType eDocumentType) :
SfxObjectShell(eMode == SFX_CREATE_MODE_INTERNAL ? SFX_CREATE_MODE_EMBEDDED : eMode),
mpDoc(pDoc),
@@ -214,7 +213,7 @@ DrawDocShell::DrawDocShell(SdDrawDocument* pDoc, SfxObjectCreateMode eMode,
meDocType(eDocumentType),
mpFilterSIDs(0),
mbSdDataObj(bDataObject),
- mbOwnPrinter(sal_False),
+ mbOwnPrinter(false),
mbNewDocument( sal_True )
{
Construct( eMode == SFX_CREATE_MODE_INTERNAL );
@@ -234,7 +233,7 @@ DrawDocShell::~DrawDocShell()
// may be usefull in other places as well.
Broadcast(SfxSimpleHint(SFX_HINT_DYING));
- mbInDestruction = sal_True;
+ mbInDestruction = true;
SetDocShellFunction(0);
@@ -251,7 +250,7 @@ DrawDocShell::~DrawDocShell()
delete mpDoc;
// damit der Navigator das Verschwinden des Dokuments mitbekommt
- SfxBoolItem aItem(SID_NAVIGATOR_INIT, sal_True);
+ SfxBoolItem aItem(SID_NAVIGATOR_INIT, true);
SfxViewFrame* pFrame = mpViewShell ? mpViewShell->GetFrame() : GetFrame();
if( !pFrame )
@@ -290,7 +289,7 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
case SID_CLOSEDOC:
{
- sal_Bool bDisabled = sal_False;
+ bool bDisabled = false;
if (bDisabled)
{
rSet.DisableItem(SID_CLOSEDOC);
@@ -383,12 +382,12 @@ void DrawDocShell::InPlaceActivate( sal_Bool bActive )
{
// Anzahl FrameViews ermitteln
pSfxViewSh = pSfxViewFrame->GetViewShell();
- pViewSh = PTR_CAST( ViewShell, pSfxViewSh );
+ pViewSh = dynamic_cast< ViewShell* >(pSfxViewSh );
if ( pViewSh && pViewSh->GetFrameView() )
{
pViewSh->WriteFrameViewData();
- pFrameViewList->Insert( new FrameView( mpDoc, pViewSh->GetFrameView() ) );
+ pFrameViewList->Insert( new FrameView( *mpDoc, pViewSh->GetFrameView() ) );
}
pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false);
@@ -414,7 +413,7 @@ void DrawDocShell::InPlaceActivate( sal_Bool bActive )
{
// Anzahl FrameViews ermitteln
pSfxViewSh = pSfxViewFrame->GetViewShell();
- pViewSh = PTR_CAST( ViewShell, pSfxViewSh );
+ pViewSh = dynamic_cast< ViewShell* >(pSfxViewSh );
if ( pViewSh )
{
@@ -522,7 +521,7 @@ void DrawDocShell::ApplySlotFilter() const
pDispatcher->SetSlotFilter();
if( pDispatcher->GetBindings() )
- pDispatcher->GetBindings()->InvalidateAll( sal_True );
+ pDispatcher->GetBindings()->InvalidateAll( true );
}
pTestViewShell = SfxViewShell::GetNext( *pTestViewShell );
diff --git a/sd/source/ui/docshell/grdocsh.cxx b/sd/source/ui/docshell/grdocsh.cxx
index 6b48a47ced16..ef0918fa092e 100644
--- a/sd/source/ui/docshell/grdocsh.cxx
+++ b/sd/source/ui/docshell/grdocsh.cxx
@@ -52,7 +52,6 @@ using namespace sd;
namespace sd
{
-TYPEINIT1(GraphicDocShell, DrawDocShell);
SFX_IMPL_INTERFACE(GraphicDocShell, SfxObjectShell, SdResId(0))
{
@@ -63,7 +62,7 @@ SFX_IMPL_INTERFACE(GraphicDocShell, SfxObjectShell, SdResId(0))
SFX_IMPL_OBJECTFACTORY( GraphicDocShell, SvGlobalName(SO3_SDRAW_CLASSID_60), SFXOBJECTSHELL_STD_NORMAL, "sdraw" )
GraphicDocShell::GraphicDocShell(SfxObjectCreateMode eMode,
- sal_Bool bDataObject,
+ bool bDataObject,
DocumentType eDocType) :
DrawDocShell(eMode, bDataObject, eDocType)
{
@@ -71,7 +70,7 @@ GraphicDocShell::GraphicDocShell(SfxObjectCreateMode eMode,
}
GraphicDocShell::GraphicDocShell(const sal_uInt64 nModelCreationFlags,
- sal_Bool bDataObject,
+ bool bDataObject,
DocumentType eDocType) :
DrawDocShell(nModelCreationFlags, bDataObject, eDocType)
{
diff --git a/sd/source/ui/docshell/sdclient.cxx b/sd/source/ui/docshell/sdclient.cxx
index 87eb90a0644f..0dc6af9341c3 100644
--- a/sd/source/ui/docshell/sdclient.cxx
+++ b/sd/source/ui/docshell/sdclient.cxx
@@ -48,6 +48,7 @@
#include "Window.hxx"
#include "sdresid.hxx"
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
using namespace com::sun::star;
@@ -88,79 +89,77 @@ Client::~Client()
|*
\************************************************************************/
-void Client::RequestNewObjectArea( Rectangle& aObjRect )
+void Client::RequestNewObjectArea( Rectangle& rRectangle )
{
+ basegfx::B2DRange aNewRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
::sd::View* pView = mpViewShell->GetView();
+ const SdrObject* pSelected = pView->getSelectedIfSingle();
+ const bool bSizeProtect(pSelected ? pSelected->IsResizeProtect() : false);
+ const bool bPosProtect(pSelected ? pSelected->IsMoveProtect() : false);
+ const Rectangle aOldRectangle(GetObjArea());
+ const basegfx::B2DRange aOldRange(aOldRectangle.Left(), aOldRectangle.Top(), aOldRectangle.Right(), aOldRectangle.Bottom());
- sal_Bool bSizeProtect = sal_False;
- sal_Bool bPosProtect = sal_False;
-
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
+ if ( bPosProtect )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- // no need to check for changes, this method is called only if the area really changed
- bSizeProtect = pObj->IsResizeProtect();
- bPosProtect = pObj->IsMoveProtect();
+ aNewRange = basegfx::B2DRange(
+ aOldRange.getMinimum(),
+ aOldRange.getMinimum() + aNewRange.getRange());
}
- Rectangle aOldRect = GetObjArea();
- if ( bPosProtect )
- aObjRect.SetPos( aOldRect.TopLeft() );
-
if ( bSizeProtect )
- aObjRect.SetSize( aOldRect.GetSize() );
+ {
+ aNewRange = basegfx::B2DRange(
+ aNewRange.getMinimum(),
+ aNewRange.getMinimum() + aOldRange.getRange());
+ }
+
+ const basegfx::B2DRange& rWorkArea(pView->GetWorkArea());
- Rectangle aWorkArea( pView->GetWorkArea() );
- if ( !aWorkArea.IsInside(aObjRect) && !bPosProtect && aObjRect != aOldRect )
+ if(!rWorkArea.isInside(aNewRange) && !bPosProtect && !aNewRange.equal(aOldRange) )
{
// correct position
- Point aPos = aObjRect.TopLeft();
- Size aSize = aObjRect.GetSize();
- Point aWorkAreaTL = aWorkArea.TopLeft();
- Point aWorkAreaBR = aWorkArea.BottomRight();
-
- aPos.X() = Max(aPos.X(), aWorkAreaTL.X());
- aPos.X() = Min(aPos.X(), aWorkAreaBR.X()-aSize.Width());
- aPos.Y() = Max(aPos.Y(), aWorkAreaTL.Y());
- aPos.Y() = Min(aPos.Y(), aWorkAreaBR.Y()-aSize.Height());
+ const basegfx::B2DRange aClampRange(rWorkArea.getMinimum(), rWorkArea.getMaximum() - aNewRange.getRange());
+ const basegfx::B2DPoint aNewTopLeft(aClampRange.clamp(aNewRange.getMinimum()));
- aObjRect.SetPos(aPos);
+ if(!aNewTopLeft.equal(aNewRange.getMinimum()))
+ {
+ aNewRange = basegfx::B2DRange(aNewTopLeft, aNewTopLeft + aNewRange.getRange());
+ }
}
+
+ rRectangle = Rectangle(
+ basegfx::fround(aNewRange.getMinX()), basegfx::fround(aNewRange.getMinY()),
+ basegfx::fround(aNewRange.getMaxX()), basegfx::fround(aNewRange.getMaxY()));
}
void Client::ObjectAreaChanged()
{
::sd::View* pView = mpViewShell->GetView();
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrOle2Obj* pObj = dynamic_cast< SdrOle2Obj* >(pMark->GetMarkedSdrObj());
-
- if(pObj)
- {
- // no need to check for changes, this method is called only if the area really changed
- Rectangle aNewRectangle(GetScaledObjArea());
+ SdrOle2Obj* pSelected = dynamic_cast< SdrOle2Obj* >(pView->getSelectedIfSingle());
- // #i118524# if sheared/rotated, center to non-rotated LogicRect
- pObj->setSuppressSetVisAreaSize(true);
+ if (pSelected)
+ {
+ // no need to check for changes, this method is called only if the area really changed
+ const Rectangle aNewRectangle(GetScaledObjArea());
+ basegfx::B2DRange aNewRange(aNewRectangle.Left(), aNewRectangle.Top(), aNewRectangle.Right(), aNewRectangle.Bottom());
- if(pObj->GetGeoStat().nDrehWink || pObj->GetGeoStat().nShearWink)
- {
- pObj->SetLogicRect( aNewRectangle );
+ // #i118524# if sheared/rotated, center to non-rotated LogicRect
+ pSelected->setSuppressSetVisAreaSize(true);
- const Rectangle& rBoundRect = pObj->GetCurrentBoundRect();
- const Point aDelta(aNewRectangle.Center() - rBoundRect.Center());
+ if(pSelected->isRotatedOrSheared())
+ {
+ sdr::legacy::SetLogicRange(*pSelected, aNewRange);
- aNewRectangle.Move(aDelta.X(), aDelta.Y());
- }
+ const basegfx::B2DRange& rObjectRange = pSelected->getObjectRange(pView);
- pObj->SetLogicRect( aNewRectangle );
- pObj->setSuppressSetVisAreaSize(false);
+ aNewRange.transform(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ aNewRange.getCenterX() - rObjectRange.getCenterX(),
+ aNewRange.getCenterY() - rObjectRange.getCenterY()));
}
+
+ sdr::legacy::SetLogicRange(*pSelected, aNewRange);
+ pSelected->setSuppressSetVisAreaSize(false);
}
}
@@ -189,14 +188,16 @@ void Client::ViewChanged()
::sd::View* pView = mpViewShell->GetView();
if (pView)
{
- Rectangle aLogicRect( pSdrOle2Obj->GetLogicRect() );
+ const Rectangle aLogicRect( sdr::legacy::GetLogicRect(*pSdrOle2Obj) );
Size aLogicSize( aLogicRect.GetWidth(), aLogicRect.GetHeight() );
if( pSdrOle2Obj->IsChart() )
{
+ // should not be needed; SetLogicRect should already broadcast the change as needed
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pSdrOle2Obj);
+
//charts never should be stretched see #i84323# for example
- pSdrOle2Obj->SetLogicRect( Rectangle( aLogicRect.TopLeft(), aLogicSize ) );
- pSdrOle2Obj->BroadcastObjectChange();
+ sdr::legacy::SetLogicRect(*pSdrOle2Obj, Rectangle( aLogicRect.TopLeft(), aLogicSize ) );
return;
}
@@ -218,8 +219,10 @@ void Client::ViewChanged()
aMap100 );
if( aPixelDiff.Width() || aPixelDiff.Height() )
{
- pSdrOle2Obj->SetLogicRect( Rectangle( aLogicRect.TopLeft(), aScaledSize ) );
- pSdrOle2Obj->BroadcastObjectChange();
+ // should not be needed; SetLogicRect should already broadcast the change as needed
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pSdrOle2Obj);
+
+ sdr::legacy::SetLogicRect(*pSdrOle2Obj, Rectangle( aLogicRect.TopLeft(), aScaledSize ) );
}
else
pSdrOle2Obj->ActionChanged();
@@ -236,10 +239,12 @@ void Client::ViewChanged()
void Client::MakeVisible()
{
- if (mpViewShell->ISA(DrawViewShell))
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if (pDrawViewShell)
{
- static_cast<DrawViewShell*>(mpViewShell)->MakeVisible(
- pSdrOle2Obj->GetLogicRect(),
+ pDrawViewShell->MakeVisibleAtView(
+ sdr::legacy::GetLogicRange(*pSdrOle2Obj),
*mpViewShell->GetActiveWindow());
}
}
diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx
index 2bf61bb5cf26..7baeb57eed03 100644
--- a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx
+++ b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx
@@ -76,7 +76,7 @@ public:
void AddRequest (const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::framework::XConfigurationChangeRequest>& rxRequest);
- /** Returns </sal_True> when the queue is empty.
+ /** Returns </true> when the queue is empty.
*/
bool IsEmpty (void) const;
diff --git a/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx b/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx
index 685c89520380..d205181a0572 100644
--- a/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx
+++ b/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx
@@ -52,8 +52,8 @@ public:
that belong to one configuration but not the other, or that belong
to both configurations.
@return
- When the two configurations differ then return <TRUE/>. When
- they are equivalent then return <FALSE/>.
+ When the two configurations differ then return <true/>. When
+ they are equivalent then return <false/>.
*/
bool Partition (void);
diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx
index bc7310bed9d2..cf6f82672104 100644
--- a/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx
+++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx
@@ -111,15 +111,15 @@ private:
css::uno::Reference<
css::drawing::framework::XConfiguration> mxRequestedConfiguration;
- /** This flag is set to </sal_True> when an update of the current
+ /** This flag is set to </true> when an update of the current
configurtion was requested (because the last request in the queue
was processed) but could not be exected because the
ConfigurationController was locked. A call to UpdateConfiguration()
- resets the flag to </sal_False>.
+ resets the flag to </false>.
*/
bool mbUpdatePending;
- /** This flag is set to </sal_True> while the UpdateConfiguration() method
+ /** This flag is set to </true> while the UpdateConfiguration() method
is running. It is used to prevent reentrance problems with this
method.
*/
@@ -194,7 +194,7 @@ private:
bool IsUpdatePossible (void);
/** Lock updates of the current configuration. For intermediate requests
- for updates mbUpdatePending is set to <TRUE/>.
+ for updates mbUpdatePending is set to <true/>.
*/
void LockUpdates (void);
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 1b0e892eafa5..b31d05e4b097 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -604,7 +604,7 @@ void BasicViewFactory::ActivateCenterView (
// have to request a resize now.
rpDescriptor->mpViewShell->UIFeatureChanged();
if (mpBase->GetDocShell()->IsInPlaceActive())
- mpBase->GetViewFrame()->Resize(sal_True);
+ mpBase->GetViewFrame()->Resize(true);
mpBase->GetDrawController().SetSubController(
rpDescriptor->mpViewShell->CreateSubController());
diff --git a/sd/source/ui/framework/factories/ChildWindowPane.cxx b/sd/source/ui/framework/factories/ChildWindowPane.cxx
index 72a468e327fd..4d1413296027 100644
--- a/sd/source/ui/framework/factories/ChildWindowPane.cxx
+++ b/sd/source/ui/framework/factories/ChildWindowPane.cxx
@@ -63,7 +63,7 @@ ChildWindowPane::ChildWindowPane (
{
// The ViewShellBase has already been activated. Make
// the child window visible as soon as possible.
- pViewFrame->SetChildWindow(mnChildWindowId, sal_True);
+ pViewFrame->SetChildWindow(mnChildWindowId, true);
OSL_TRACE("ChildWindowPane:activating now");
}
else
@@ -85,7 +85,7 @@ ChildWindowPane::ChildWindowPane (
// The ViewShellBase has not yet been activated. Hide the
// window and wait a little before it is made visible. See
// comments in the GetWindow() method for an explanation.
- pViewFrame->SetChildWindow(mnChildWindowId, sal_False);
+ pViewFrame->SetChildWindow(mnChildWindowId, false);
OSL_TRACE("ChildWindowPane:base not active");
}
}
@@ -107,7 +107,7 @@ void ChildWindowPane::Hide (void)
if (pViewFrame != NULL)
if (pViewFrame->KnowsChildWindow(mnChildWindowId))
if (pViewFrame->HasChildWindow(mnChildWindowId))
- pViewFrame->SetChildWindow(mnChildWindowId, sal_False);
+ pViewFrame->SetChildWindow(mnChildWindowId, false);
// Release the window because when the child window is shown again it
// may use a different window.
@@ -163,7 +163,7 @@ void SAL_CALL ChildWindowPane::disposing (void)
if ( ! pViewFrame->KnowsChildWindow(mnChildWindowId))
break;
- pViewFrame->SetChildWindow(mnChildWindowId, sal_True);
+ pViewFrame->SetChildWindow(mnChildWindowId, true);
SfxChildWindow* pChildWindow = pViewFrame->GetChildWindow(mnChildWindowId);
if (pChildWindow == NULL)
if (pViewFrame->HasChildWindow(mnChildWindowId))
@@ -171,7 +171,7 @@ void SAL_CALL ChildWindowPane::disposing (void)
// The child window is not yet visible. Ask the view frame
// to show it and try again to get access to the child
// window.
- pViewFrame->ShowChildWindow(mnChildWindowId, sal_True);
+ pViewFrame->ShowChildWindow(mnChildWindowId, true);
pChildWindow = pViewFrame->GetChildWindow(mnChildWindowId);
}
diff --git a/sd/source/ui/framework/factories/FrameWindowPane.hxx b/sd/source/ui/framework/factories/FrameWindowPane.hxx
index 163b73a6f5eb..368276c6543c 100644
--- a/sd/source/ui/framework/factories/FrameWindowPane.hxx
+++ b/sd/source/ui/framework/factories/FrameWindowPane.hxx
@@ -48,7 +48,7 @@ public:
/** A frame window typically can (and should) exists on its own without
children, if only to visualize that something (a view) is missing.
- Therefore this method always returns <FALSE/>.
+ Therefore this method always returns <false/>.
*/
virtual sal_Bool SAL_CALL isAnchorOnly (void)
throw (com::sun::star::uno::RuntimeException);
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 6b3aff7695c0..86a7cb32d9db 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -69,7 +69,7 @@ FullScreenPane::FullScreenPane (
return;
// Create a new top-leve window that is displayed full screen.
- mpWorkWindow->ShowFullScreenMode(sal_True, nScreenNumber);
+ mpWorkWindow->ShowFullScreenMode(true, nScreenNumber);
// For debugging (non-fullscreen) use mpWorkWindow->SetScreenNumber(nScreenNumber);
mpWorkWindow->SetMenuBarMode(MENUBAR_MODE_HIDE);
mpWorkWindow->SetBorderStyle(WINDOW_BORDER_REMOVEBORDER);
@@ -174,7 +174,7 @@ Reference<accessibility::XAccessible> SAL_CALL FullScreenPane::getAccessible (vo
ThrowIfDisposed();
if (mpWorkWindow != NULL)
- return mpWorkWindow->GetAccessible(sal_False);
+ return mpWorkWindow->GetAccessible(false);
else
return NULL;
}
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index c6b75cc8bdaf..bfe00c685774 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -145,7 +145,7 @@ Reference<accessibility::XAccessible> SAL_CALL Pane::getAccessible (void)
ThrowIfDisposed();
::Window* pWindow = GetWindow();
if (pWindow != NULL)
- return pWindow->GetAccessible(sal_False);
+ return pWindow->GetAccessible(false);
else
return NULL;
}
diff --git a/sd/source/ui/framework/module/ReadOnlyModeObserver.hxx b/sd/source/ui/framework/module/ReadOnlyModeObserver.hxx
index d06bcc1b99ab..4cf4a970fdc5 100644
--- a/sd/source/ui/framework/module/ReadOnlyModeObserver.hxx
+++ b/sd/source/ui/framework/module/ReadOnlyModeObserver.hxx
@@ -124,7 +124,7 @@ private:
class ModifyBroadcaster;
::boost::scoped_ptr<ModifyBroadcaster> mpBroadcaster;
- /** Listen for the .uno:EditMode command. Returns <TRUE/> when the connection
+ /** Listen for the .uno:EditMode command. Returns <true/> when the connection
has been established.
*/
bool ConnectToDispatch (void);
diff --git a/sd/source/ui/framework/module/ShellStackGuard.hxx b/sd/source/ui/framework/module/ShellStackGuard.hxx
index da8554aa5cd3..75fd4a89f1b5 100644
--- a/sd/source/ui/framework/module/ShellStackGuard.hxx
+++ b/sd/source/ui/framework/module/ShellStackGuard.hxx
@@ -100,7 +100,7 @@ private:
DECL_LINK(TimeoutHandler, Timer*);
- /** Return <TRUE/> when the printer is printing. Return <FALSE/> when
+ /** Return <true/> when the printer is printing. Return <false/> when
the printer is not printing, or there is no printer, or someting
else went wrong.
*/
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 33535330b231..6c07eeb4f03c 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -652,7 +652,7 @@ void FrameworkHelper::HandleModeChangeSlot (
sal_uLong nSlotId,
SfxRequest& rRequest)
{
- sal_Bool bIsActive = sal_True;
+ bool bIsActive = true;
if ( ! mxConfigurationController.is())
return;
@@ -668,11 +668,7 @@ void FrameworkHelper::HandleModeChangeSlot (
const SfxItemSet* pRequestArguments = rRequest.GetArgs();
if (pRequestArguments)
{
- SFX_REQUEST_ARG (rRequest,
- pIsActive,
- SfxBoolItem,
- (sal_uInt16)nSlotId,
- sal_False);
+ SFX_REQUEST_ARG (rRequest, pIsActive, SfxBoolItem, (sal_uInt16)nSlotId );
bIsActive = pIsActive->GetValue ();
}
}
diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx
index 7820058d3852..8a4152149051 100644
--- a/sd/source/ui/func/bulmaper.cxx
+++ b/sd/source/ui/func/bulmaper.cxx
@@ -57,51 +57,6 @@
#define GetWhich(nSlot) rSet.GetPool()->GetWhich( nSlot )
-/* #i35937#
-
-void SdBulletMapper::PreMapNumBulletForDialog( SfxItemSet& rSet )
-{
- if( SFX_ITEM_SET == rSet.GetItemState( EE_PARA_NUMBULLET, sal_False ) )
- {
- SvxNumRule* pRule = ((SvxNumBulletItem*)rSet.GetItem( EE_PARA_NUMBULLET ))->GetNumRule();
-
- if(pRule && pRule->GetNumRuleType() == SVX_RULETYPE_PRESENTATION_NUMBERING)
- {
- // 10er Bullet Item auf 9er Item mappen
- SvxNumRule aNewRule( pRule->GetFeatureFlags(), 9, sal_False, SVX_RULETYPE_PRESENTATION_NUMBERING );
-
- for( sal_uInt16 i = 0; i < 9; i++ )
- aNewRule.SetLevel(i, pRule->GetLevel(i));
-
- rSet.Put( SvxNumBulletItem( aNewRule, EE_PARA_NUMBULLET ) );
- }
- }
-}
-
-void SdBulletMapper::PostMapNumBulletForDialog( SfxItemSet& rSet )
-{
- if( SFX_ITEM_SET == rSet.GetItemState( EE_PARA_NUMBULLET, sal_False ) )
- {
- SvxNumRule* pRule = ((SvxNumBulletItem*)rSet.GetItem( EE_PARA_NUMBULLET ))->GetNumRule();
-
- if(pRule)
- {
- pRule->UnLinkGraphics();
- if(pRule->GetNumRuleType() == SVX_RULETYPE_PRESENTATION_NUMBERING)
- {
- // 9er Bullet Item auf 10er Item mappen
- SvxNumRule aNewRule( pRule->GetFeatureFlags(), 10, sal_False, SVX_RULETYPE_PRESENTATION_NUMBERING );
-
- for( sal_uInt16 i = 0; i < 9; i++ )
- aNewRule.SetLevel(i, pRule->GetLevel(i));
-
- rSet.Put( SvxNumBulletItem( aNewRule, EE_PARA_NUMBULLET ) );
- }
- }
- }
-}
-*/
-
void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const SfxItemSet& rSet )
{
const sal_uInt16 nCount = aNumRule.GetLevelCount();
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index ce3a5202c111..e77753ebf500 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -45,7 +45,6 @@
#include <svx/dialogs.hrc>
namespace sd {
-TYPEINIT1( FuArea, FuPoor );
/*************************************************************************
|*
@@ -71,7 +70,7 @@ void FuArea::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
- SfxItemSet aNewAttr( mpDoc->GetPool() );
+ SfxItemSet aNewAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aNewAttr );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index fbb1dcd2fe59..8a9ec055f61a 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -61,8 +61,6 @@ const sal_Unicode CHAR_LRM = ((sal_Unicode)0x200E);
const sal_Unicode CHAR_ZWSP = ((sal_Unicode)0x200B);
const sal_Unicode CHAR_ZWNBSP = ((sal_Unicode)0x2060);
-TYPEINIT1( FuBullet, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -118,13 +116,13 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
::Outliner* pOL = NULL;
// depending on ViewShell set Outliner and OutlinerView
- if (mpViewShell->ISA(DrawViewShell))
+ if (dynamic_cast< DrawViewShell* >(mpViewShell))
{
pOV = mpView->GetTextEditOutlinerView();
if (pOV)
pOL = mpView->GetTextEditOutliner();
}
- else if (mpViewShell->ISA(OutlineViewShell))
+ else if (dynamic_cast< OutlineViewShell* >(mpViewShell))
{
pOL = static_cast<OutlineView*>(mpView)->GetOutliner();
pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
@@ -136,7 +134,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
{
// prevent flickering
pOV->HideCursor();
- pOL->SetUpdateMode(sal_False);
+ pOL->SetUpdateMode(false);
// remove old selected text
pOV->InsertText( aEmptyStr );
@@ -148,7 +146,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
// insert given text
String aStr( cMark );
- pOV->InsertText( cMark, sal_True);
+ pOV->InsertText( cMark, true);
ESelection aSel = pOV->GetSelection();
aSel.nStartPara = aSel.nEndPara;
@@ -158,7 +156,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark )
rUndoMgr.LeaveListAction();
// restart repainting
- pOL->SetUpdateMode(sal_True);
+ pOL->SetUpdateMode(true);
pOV->ShowCursor();
}
}
@@ -168,7 +166,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
if( pArgs )
- pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_CHARMAP), sal_False, &pItem);
+ pArgs->GetItemState(mpDoc->GetItemPool().GetWhich(SID_CHARMAP), false, &pItem);
String aChars, aFontName;
Font aFont;
@@ -176,8 +174,8 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
{
aChars = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
- pArgs->GetItemState( mpDoc->GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ pArgs->GetItemState( mpDoc->GetItemPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
+ const SfxStringItem* pFontItem = dynamic_cast< const SfxStringItem* >(pFtItem );
if ( pFontItem )
{
aFontName = pFontItem->GetValue();
@@ -185,7 +183,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
}
else
{
- SfxItemSet aFontAttr( mpDoc->GetPool() );
+ SfxItemSet aFontAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aFontAttr );
const SvxFontItem* pFItem = (const SvxFontItem*)aFontAttr.GetItem( SID_ATTR_CHAR_FONT );
if( pFItem )
@@ -195,10 +193,10 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
if (!aChars.Len() )
{
- SfxAllItemSet aSet( mpDoc->GetPool() );
- aSet.Put( SfxBoolItem( FN_PARAM_1, sal_False ) );
+ SfxAllItemSet aSet( mpDoc->GetItemPool() );
+ aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
- SfxItemSet aFontAttr( mpDoc->GetPool() );
+ SfxItemSet aFontAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aFontAttr );
const SvxFontItem* pFontItem = (const SvxFontItem*)aFontAttr.GetItem( SID_ATTR_CHAR_FONT );
if( pFontItem )
@@ -217,8 +215,8 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
sal_uInt16 nResult = pDlg->Execute();
if( nResult == RET_OK )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFItem, SvxFontItem, SID_ATTR_CHAR_FONT );
if ( pFItem )
{
aFont.SetName( pFItem->GetFamilyName() );
@@ -240,7 +238,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
::Outliner* pOL = NULL;
// je nach ViewShell Outliner und OutlinerView bestimmen
- if(mpViewShell && mpViewShell->ISA(DrawViewShell))
+ if(mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell))
{
pOV = mpView->GetTextEditOutlinerView();
if (pOV)
@@ -248,7 +246,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
pOL = mpView->GetTextEditOutliner();
}
}
- else if(mpViewShell && mpViewShell->ISA(OutlineViewShell))
+ else if(mpViewShell && dynamic_cast< OutlineViewShell* >(mpViewShell))
{
pOL = static_cast<OutlineView*>(mpView)->GetOutliner();
pOV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
@@ -260,7 +258,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
{
// nicht flackern
pOV->HideCursor();
- pOL->SetUpdateMode(sal_False);
+ pOL->SetUpdateMode(false);
// alte Attributierung merken;
// dazu vorher selektierten Bereich loeschen, denn der muss eh weg
@@ -269,13 +267,13 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
// Einfuegen eines Leerstrings geloescht)
pOV->InsertText( aEmptyStr );
- SfxItemSet aOldSet( mpDoc->GetPool(), EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, 0 );
+ SfxItemSet aOldSet( mpDoc->GetItemPool(), EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, 0 );
aOldSet.Put( pOV->GetAttribs() );
::svl::IUndoManager& rUndoMgr = pOL->GetUndoManager();
rUndoMgr.EnterListAction(String(SdResId(STR_UNDO_INSERT_SPECCHAR)),
aEmptyStr );
- pOV->InsertText(aChars, sal_True);
+ pOV->InsertText(aChars, true);
// attributieren (Font setzen)
SfxItemSet aSet(pOL->GetEmptyItemSet());
@@ -299,7 +297,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
rUndoMgr.LeaveListAction();
// ab jetzt wieder anzeigen
- pOL->SetUpdateMode(sal_True);
+ pOL->SetUpdateMode(true);
pOV->ShowCursor();
}
}
diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx
index 9ed3e12c2efc..eb11ae3ec838 100644
--- a/sd/source/ui/func/fuchar.cxx
+++ b/sd/source/ui/func/fuchar.cxx
@@ -45,8 +45,6 @@
namespace sd {
-TYPEINIT1( FuChar, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -76,12 +74,12 @@ void FuChar::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
- SfxItemSet aEditAttr( mpDoc->GetPool() );
+ SfxItemSet aEditAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aEditAttr );
SfxItemSet aNewAttr( mpViewShell->GetPool(),
EE_ITEMS_START, EE_ITEMS_END );
- aNewAttr.Put( aEditAttr, sal_False );
+ aNewAttr.Put( aEditAttr, false );
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
SfxAbstractTabDialog* pDlg = pFact ? pFact->CreateSdTabCharDialog( NULL, &aNewAttr, mpDoc->GetDocSh() ) : 0;
@@ -122,9 +120,9 @@ void FuChar::DoExecute( SfxRequest& rReq )
if( mpDoc->GetOnlineSpell() )
{
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pArgs->GetItemState(EE_CHAR_LANGUAGE, sal_False, &pItem ) ||
- SFX_ITEM_SET == pArgs->GetItemState(EE_CHAR_LANGUAGE_CJK, sal_False, &pItem ) ||
- SFX_ITEM_SET == pArgs->GetItemState(EE_CHAR_LANGUAGE_CTL, sal_False, &pItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState(EE_CHAR_LANGUAGE, false, &pItem ) ||
+ SFX_ITEM_SET == pArgs->GetItemState(EE_CHAR_LANGUAGE_CJK, false, &pItem ) ||
+ SFX_ITEM_SET == pArgs->GetItemState(EE_CHAR_LANGUAGE_CTL, false, &pItem ) )
{
mpDoc->StopOnlineSpelling();
mpDoc->StartOnlineSpelling();
diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index f63fff9e364b..ef4a247a963d 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -26,14 +26,12 @@
#include "fucon3d.hxx"
#include <vcl/waitobj.hxx>
-
#include <svx/svxids.hrc>
#include <svl/aeitem.hxx>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <tools/poly.hxx>
-
#include <math.h>
#include <svx/globl3d.hxx>
#include <svx/scene3d.hxx>
@@ -41,6 +39,8 @@
#include <svx/cube3d.hxx>
#include <svx/lathe3d.hxx>
#include <svx/camera3d.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/svdlegacy.hxx>
#include "app.hrc"
#include "res_bmp.hrc"
@@ -52,14 +52,8 @@
#include "ToolBarManager.hxx"
#include <svx/svx3ditems.hxx>
-// #97016#
-#include <svx/polysc3d.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-
namespace sd {
-TYPEINIT1( FuConstruct3dObject, FuConstruct );
-
/*************************************************************************
|*
|* Konstruktor
@@ -110,6 +104,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
case SID_3D_CUBE:
{
p3DObj = new E3dCubeObj(
+ *GetDoc(),
mpView->Get3DDefaultAttributes(),
::basegfx::B3DPoint(-2500, -2500, -2500),
::basegfx::B3DVector(5000, 5000, 5000));
@@ -119,6 +114,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
case SID_3D_SPHERE:
{
p3DObj = new E3dSphereObj(
+ *GetDoc(),
mpView->Get3DDefaultAttributes(),
::basegfx::B3DPoint(0, 0, 0),
::basegfx::B3DVector(5000, 5000, 5000));
@@ -127,53 +123,81 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
case SID_3D_SHELL:
{
- XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0, 900, sal_False);
- aXPoly.Scale(5.0, 5.0);
+ basegfx::B2DPolygon aB2DPolygon(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ basegfx::B2DPoint(0.0, 1250.0 * 5.0),
+ 2500.0 * 5.0,
+ 2500.0 * 5.0,
+ 270.0 * F_PI / 180.0,
+ 0.0));
- ::basegfx::B2DPolygon aB2DPolygon(aXPoly.getB2DPolygon());
if(aB2DPolygon.areControlPointsUsed())
{
- aB2DPolygon = ::basegfx::tools::adaptiveSubdivideByAngle(aB2DPolygon);
+ aB2DPolygon = basegfx::tools::adaptiveSubdivideByAngle(aB2DPolygon);
}
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aB2DPolygon));
+
+ p3DObj = new E3dLatheObj(
+ *GetDoc(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aB2DPolygon));
// Dies ist ein offenes Objekt, muss daher defaultmaessig
// doppelseitig behandelt werden
- p3DObj->SetMergedItem(Svx3DDoubleSidedItem(sal_True));
+ p3DObj->SetMergedItem(SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, true));
break;
}
case SID_3D_HALF_SPHERE:
{
- XPolygon aXPoly(Point (0, 1250), 2500, 2500, 0, 900, sal_False);
- aXPoly.Scale(5.0, 5.0);
-
- aXPoly.Insert(0, Point (2400*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (2000*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (1500*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (1000*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (500*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (250*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (50*5, 1250*5), XPOLY_NORMAL);
- aXPoly.Insert(0, Point (0*5, 1250*5), XPOLY_NORMAL);
-
- ::basegfx::B2DPolygon aB2DPolygon(aXPoly.getB2DPolygon());
+ basegfx::B2DPolygon aB2DPolygon;
+
+ // add in-between points to the horizontal line to not run into problems
+ // when the vertical segment count gets changed eventually later
+ aB2DPolygon.append(basegfx::B2DPoint(0.0, 1250.0 * 5.0));
+ aB2DPolygon.append(basegfx::B2DPoint(50.0 * 5.0, 1250.0 * 5.0));
+ aB2DPolygon.append(basegfx::B2DPoint(250.0 * 5.0, 1250.0 * 5.0));
+ aB2DPolygon.append(basegfx::B2DPoint(500.0 * 5.0, 1250.0 * 5.0));
+ aB2DPolygon.append(basegfx::B2DPoint(1000.0 * 5.0, 1250.0 * 5.0));
+ aB2DPolygon.append(basegfx::B2DPoint(1500.0 * 5.0, 1250.0 * 5.0));
+ aB2DPolygon.append(basegfx::B2DPoint(2000.0 * 5.0, 1250.0 * 5.0));
+ aB2DPolygon.append(basegfx::B2DPoint(2400.0 * 5.0, 1250.0 * 5.0));
+
+ basegfx::B2DPolygon aHalfSphere(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ basegfx::B2DPoint(0.0, 1250.0 * 5.0),
+ 2500.0 * 5.0,
+ 2500.0 * 5.0,
+ 270.0 * F_PI / 180.0,
+ 0.0));
+
+ aHalfSphere.flip();
+ aB2DPolygon.append(aHalfSphere);
+
if(aB2DPolygon.areControlPointsUsed())
{
aB2DPolygon = ::basegfx::tools::adaptiveSubdivideByAngle(aB2DPolygon);
}
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aB2DPolygon));
+
+ p3DObj = new E3dLatheObj(
+ *GetDoc(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aB2DPolygon));
break;
}
case SID_3D_TORUS:
{
::basegfx::B2DPolygon aB2DPolygon(::basegfx::tools::createPolygonFromCircle(::basegfx::B2DPoint(1000.0, 0.0), 500.0));
+
if(aB2DPolygon.areControlPointsUsed())
{
aB2DPolygon = ::basegfx::tools::adaptiveSubdivideByAngle(aB2DPolygon);
}
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aB2DPolygon));
+
+ p3DObj = new E3dLatheObj(
+ *GetDoc(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aB2DPolygon));
break;
}
@@ -199,7 +223,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
aInnerPoly.append(::basegfx::B2DPoint(0*5, -1000*5));
aInnerPoly.setClosed(true);
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aInnerPoly));
+ p3DObj = new E3dLatheObj(
+ *GetDoc(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aInnerPoly));
break;
}
@@ -223,7 +250,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
aInnerPoly.append(::basegfx::B2DPoint(0*5, 1000*5));
aInnerPoly.setClosed(true);
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aInnerPoly));
+ p3DObj = new E3dLatheObj(
+ *GetDoc(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aInnerPoly));
break;
}
@@ -247,8 +277,11 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
aInnerPoly.append(::basegfx::B2DPoint(0, 1000*5));
aInnerPoly.setClosed(true);
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aInnerPoly));
- p3DObj->SetMergedItem(Svx3DHorizontalSegmentsItem(4));
+ p3DObj = new E3dLatheObj(
+ *GetDoc(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aInnerPoly));
+ p3DObj->SetMergedItem(SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, 4));
break;
}
}
@@ -264,7 +297,7 @@ void FuConstruct3dObject::ImpPrepareBasic3DShape(E3dCompoundObject* p3DObj, E3dS
// get transformed BoundVolume of the new object
basegfx::B3DRange aBoundVol;
basegfx::B3DRange aObjVol(p3DObj->GetBoundVolume());
- aObjVol.transform(p3DObj->GetTransform());
+ aObjVol.transform(p3DObj->GetB3DTransform());
aBoundVol.expand(aObjVol);
double fDeepth(aBoundVol.getDepth());
@@ -316,19 +349,20 @@ void FuConstruct3dObject::ImpPrepareBasic3DShape(E3dCompoundObject* p3DObj, E3dS
break;
}
- pScene->SetTransform(aTransformation * pScene->GetTransform());
+ pScene->SetB3DTransform(aTransformation * pScene->GetB3DTransform());
SfxItemSet aAttr (mpViewShell->GetPool());
pScene->SetMergedItemSetAndBroadcast(aAttr);
}
-sal_Bool FuConstruct3dObject::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuConstruct3dObject::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
+ bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
if ( rMEvt.IsLeft() && !mpView->IsAction() )
{
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
mpWindow->CaptureMouse();
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
@@ -343,13 +377,13 @@ sal_Bool FuConstruct3dObject::MouseButtonDown(const MouseEvent& rMEvt)
// #97016#
ImpPrepareBasic3DShape(p3DObj, pScene);
- bReturn = mpView->BegCreatePreparedObject(aPnt, nDrgLog, pScene);
+ bReturn = mpView->BegCreatePreparedObject(aLogicPos, nDrgLog, pScene);
SdrObject* pObj = mpView->GetCreateObj();
if (pObj)
{
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(mpDoc->GetItemPool());
SetStyleSheet(aAttr, pObj);
// LineStyle rausnehmen
@@ -368,7 +402,7 @@ sal_Bool FuConstruct3dObject::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstruct3dObject::MouseMove(const MouseEvent& rMEvt)
+bool FuConstruct3dObject::MouseMove(const MouseEvent& rMEvt)
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -379,15 +413,14 @@ sal_Bool FuConstruct3dObject::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstruct3dObject::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuConstruct3dObject::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
- if ( mpView->IsCreateObj() && rMEvt.IsLeft() )
+ if ( mpView->GetCreateObj() && rMEvt.IsLeft() )
{
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
mpView->EndCreateObj(SDRCREATE_FORCEEND);
- bReturn = sal_True;
+ bReturn = true;
}
bReturn = FuConstruct::MouseButtonUp(rMEvt) || bReturn;
@@ -402,12 +435,12 @@ sal_Bool FuConstruct3dObject::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuConstruct3dObject::KeyInput(const KeyEvent& rKEvt)
+bool FuConstruct3dObject::KeyInput(const KeyEvent& rKEvt)
{
return( FuConstruct::KeyInput(rKEvt) );
}
@@ -420,7 +453,7 @@ sal_Bool FuConstruct3dObject::KeyInput(const KeyEvent& rKEvt)
void FuConstruct3dObject::Activate()
{
- mpView->SetCurrentObj(OBJ_NONE);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_NONE)));
FuConstruct::Activate();
}
@@ -437,7 +470,7 @@ void FuConstruct3dObject::Deactivate()
}
// #97016#
-SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_3D_CUBE:
// case SID_3D_SHELL:
@@ -453,18 +486,20 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const
// E3dView::SetCurrent3DObj part
// get transformed BoundVolume of the object
basegfx::B3DRange aObjVol(p3DObj->GetBoundVolume());
- aObjVol.transform(p3DObj->GetTransform());
+ aObjVol.transform(p3DObj->GetB3DTransform());
basegfx::B3DRange aVolume(aObjVol);
double fW(aVolume.getWidth());
double fH(aVolume.getHeight());
Rectangle a3DRect(0, 0, (long)fW, (long)fH);
- E3dScene* pScene = new E3dPolyScene(mpView->Get3DDefaultAttributes());
+ E3dScene* pScene = new E3dScene(
+ *GetDoc(),
+ mpView->Get3DDefaultAttributes());
// mpView->InitScene(pScene, fW, fH, aVolume.MaxVec().Z() + ((fW + fH) / 4.0));
// copied code from E3dView::InitScene
double fCamZ(aVolume.getMaxZ() + ((fW + fH) / 4.0));
Camera3D aCam(pScene->GetCamera());
- aCam.SetAutoAdjustProjection(sal_False);
+ aCam.SetAutoAdjustProjection(false);
aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
::basegfx::B3DPoint aLookAt;
double fDefaultCamPosZ = mpView->GetDefaultCamPosZ();
@@ -474,22 +509,22 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const
aCam.SetDefaults(::basegfx::B3DPoint(0.0, 0.0, fDefaultCamPosZ), aLookAt, mpView->GetDefaultCamFocal());
pScene->SetCamera(aCam);
- pScene->Insert3DObj(p3DObj);
- pScene->NbcSetSnapRect(a3DRect);
- pScene->SetModel(mpDoc);
+ pScene->Insert3DObj(*p3DObj);
+ sdr::legacy::SetSnapRect(*pScene, a3DRect);
+ // pScene->SetModel(mpDoc);
ImpPrepareBasic3DShape(p3DObj, pScene);
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(mpDoc->GetItemPool());
SetStyleSheet(aAttr, p3DObj);
aAttr.Put(XLineStyleItem (XLINE_NONE));
p3DObj->SetMergedItemSet(aAttr);
// make object interactive at once
- pScene->SetRectsDirty();
+ pScene->ActionChanged();
// Take care of restrictions for the rectangle
- Rectangle aRect(rRectangle);
+ basegfx::B2DRange aRange(rRange);
switch(nID)
{
@@ -498,7 +533,7 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const
case SID_3D_TORUS:
{
// force quadratic
- ImpForceQuadratic(aRect);
+ ImpForceQuadratic(aRange);
break;
}
@@ -519,7 +554,7 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const
}
// #97016#, #98245# use changed rectangle, not original one
- pScene->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pScene, aRange);
return pScene;
}
diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx
index 1408082e2653..8fb5ac05e996 100644
--- a/sd/source/ui/func/fuconarc.cxx
+++ b/sd/source/ui/func/fuconarc.cxx
@@ -33,9 +33,8 @@
#include <sfx2/dispatch.hxx>
#include <svx/svdobj.hxx>
#include <sfx2/viewfrm.hxx>
-
-
#include <svx/svxids.hrc>
+#include <svx/svdlegacy.hxx>
#include <math.h>
#include "app.hrc"
@@ -47,13 +46,8 @@
#include "ViewShellBase.hxx"
#include "ToolBarManager.hxx"
-// #97016#
-#include <svx/sxciaitm.hxx>
-
namespace sd {
-TYPEINIT1( FuConstructArc, FuConstruct );
-
/*************************************************************************
|*
|* Konstruktor
@@ -91,27 +85,35 @@ void FuConstructArc::DoExecute( SfxRequest& rReq )
if (pArgs)
{
- SFX_REQUEST_ARG (rReq, pCenterX, SfxUInt32Item, ID_VAL_CENTER_X, sal_False);
- SFX_REQUEST_ARG (rReq, pCenterY, SfxUInt32Item, ID_VAL_CENTER_Y, sal_False);
- SFX_REQUEST_ARG (rReq, pAxisX, SfxUInt32Item, ID_VAL_AXIS_X, sal_False);
- SFX_REQUEST_ARG (rReq, pAxisY, SfxUInt32Item, ID_VAL_AXIS_Y, sal_False);
- SFX_REQUEST_ARG (rReq, pPhiStart, SfxUInt32Item, ID_VAL_ANGLESTART, sal_False);
- SFX_REQUEST_ARG (rReq, pPhiEnd, SfxUInt32Item, ID_VAL_ANGLEEND, sal_False);
-
- Rectangle aNewRectangle (pCenterX->GetValue () - pAxisX->GetValue () / 2,
- pCenterY->GetValue () - pAxisY->GetValue () / 2,
- pCenterX->GetValue () + pAxisX->GetValue () / 2,
- pCenterY->GetValue () + pAxisY->GetValue () / 2);
-
- Activate(); // Setzt aObjKind
- SdrCircObj* pNewCircle =
- new SdrCircObj((SdrObjKind) mpView->GetCurrentObjIdentifier(),
- aNewRectangle,
- (long) (pPhiStart->GetValue () * 10.0),
- (long) (pPhiEnd->GetValue () * 10.0));
- SdrPageView *pPV = mpView->GetSdrPageView();
-
- mpView->InsertObjectAtView(pNewCircle, *pPV, SDRINSERT_SETDEFLAYER);
+ SFX_REQUEST_ARG (rReq, pCenterX, SfxUInt32Item, ID_VAL_CENTER_X );
+ SFX_REQUEST_ARG (rReq, pCenterY, SfxUInt32Item, ID_VAL_CENTER_Y );
+ SFX_REQUEST_ARG (rReq, pAxisX, SfxUInt32Item, ID_VAL_AXIS_X );
+ SFX_REQUEST_ARG (rReq, pAxisY, SfxUInt32Item, ID_VAL_AXIS_Y );
+ SFX_REQUEST_ARG (rReq, pPhiStart, SfxUInt32Item, ID_VAL_ANGLESTART );
+ SFX_REQUEST_ARG (rReq, pPhiEnd, SfxUInt32Item, ID_VAL_ANGLEEND );
+
+ const sal_Int32 nWidth(pAxisX->GetValue());
+ const sal_Int32 nHeight(pAxisY->GetValue());
+ const basegfx::B2DHomMatrix aObjTrans(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ nWidth, nHeight,
+ pCenterX->GetValue() - (nWidth / 2), pCenterY->GetValue() - (nHeight / 2)));
+
+ // could not check, found to case to trigger this
+ const double fStart((1800 - pPhiStart->GetValue()) * F_PI1800);
+ const double fEnd((1800 - pPhiEnd->GetValue()) * F_PI1800);
+
+ // sets aObjKind
+ Activate();
+
+ SdrCircObj* pNewCircle = new SdrCircObj(
+ *GetDoc(),
+ mpView->getSdrObjectCreationInfo().getSdrCircleObjType(),
+ aObjTrans,
+ fStart,
+ fEnd);
+
+ mpView->InsertObjectAtView(*pNewCircle, SDRINSERT_SETDEFLAYER);
}
}
@@ -121,29 +123,30 @@ void FuConstructArc::DoExecute( SfxRequest& rReq )
|*
\************************************************************************/
-sal_Bool FuConstructArc::MouseButtonDown( const MouseEvent& rMEvt )
+bool FuConstructArc::MouseButtonDown( const MouseEvent& rMEvt )
{
- sal_Bool bReturn = FuConstruct::MouseButtonDown( rMEvt );
+ bool bReturn = FuConstruct::MouseButtonDown( rMEvt );
if ( rMEvt.IsLeft() && !mpView->IsAction() )
{
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
+
mpWindow->CaptureMouse();
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- mpView->BegCreateObj(aPnt, (OutputDevice*) NULL, nDrgLog);
+ const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
+ mpView->BegCreateObj(aLogicPos, fTolerance);
SdrObject* pObj = mpView->GetCreateObj();
if (pObj)
{
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(mpDoc->GetItemPool());
SetStyleSheet(aAttr, pObj);
-//-/ pObj->NbcSetAttributes(aAttr, sal_False);
pObj->SetMergedItemSet(aAttr);
}
- bReturn = sal_True;
+ bReturn = true;
}
return bReturn;
}
@@ -154,7 +157,7 @@ sal_Bool FuConstructArc::MouseButtonDown( const MouseEvent& rMEvt )
|*
\************************************************************************/
-sal_Bool FuConstructArc::MouseMove( const MouseEvent& rMEvt )
+bool FuConstructArc::MouseMove( const MouseEvent& rMEvt )
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -165,26 +168,25 @@ sal_Bool FuConstructArc::MouseMove( const MouseEvent& rMEvt )
|*
\************************************************************************/
-sal_Bool FuConstructArc::MouseButtonUp( const MouseEvent& rMEvt )
+bool FuConstructArc::MouseButtonUp( const MouseEvent& rMEvt )
{
- sal_Bool bReturn = sal_False;
- sal_Bool bCreated = sal_False;
+ bool bReturn = false;
+ bool bCreated = false;
- if ( mpView->IsCreateObj() && rMEvt.IsLeft() )
+ if(mpView->GetCreateObj() && rMEvt.IsLeft() && mpView->GetSdrPageView())
{
Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
-
- sal_uLong nCount = mpView->GetSdrPageView()->GetObjList()->GetObjCount();
+ sal_uInt32 nCount = mpView->GetSdrPageView()->GetCurrentObjectList()->GetObjCount();
if (mpView->EndCreateObj(SDRCREATE_NEXTPOINT) )
{
- if (nCount != mpView->GetSdrPageView()->GetObjList()->GetObjCount())
+ if (nCount != mpView->GetSdrPageView()->GetCurrentObjectList()->GetObjCount())
{
- bCreated = sal_True;
+ bCreated = true;
}
}
- bReturn = sal_True;
+ bReturn = true;
}
bReturn = FuConstruct::MouseButtonUp (rMEvt) || bReturn;
@@ -199,14 +201,14 @@ sal_Bool FuConstructArc::MouseButtonUp( const MouseEvent& rMEvt )
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuConstructArc::KeyInput(const KeyEvent& rKEvt)
+bool FuConstructArc::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
+ bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
}
@@ -218,14 +220,14 @@ sal_Bool FuConstructArc::KeyInput(const KeyEvent& rKEvt)
void FuConstructArc::Activate()
{
- SdrObjKind aObjKind;
+ SdrCircleObjType aSdrCircleObjType(CircleType_Circle);
switch( nSlotId )
{
case SID_DRAW_ARC :
case SID_DRAW_CIRCLEARC:
{
- aObjKind = OBJ_CARC;
+ aSdrCircleObjType = CircleType_Arc;
}
break;
@@ -234,7 +236,7 @@ void FuConstructArc::Activate()
case SID_DRAW_CIRCLEPIE :
case SID_DRAW_CIRCLEPIE_NOFILL:
{
- aObjKind = OBJ_SECT;
+ aSdrCircleObjType = CircleType_Sector;
}
break;
@@ -243,21 +245,23 @@ void FuConstructArc::Activate()
case SID_DRAW_CIRCLECUT :
case SID_DRAW_CIRCLECUT_NOFILL :
{
- aObjKind = OBJ_CCUT;
+ aSdrCircleObjType = CircleType_Segment;
}
break;
default:
{
- aObjKind = OBJ_CARC;
+ aSdrCircleObjType = CircleType_Arc;
}
break;
}
- mpView->SetCurrentObj((sal_uInt16)aObjKind);
+ SdrObjectCreationInfo aSdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_CIRC));
+
+ aSdrObjectCreationInfo.setSdrCircleObjType(aSdrCircleObjType);
+ mpView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
FuConstruct::Activate();
-// FuDraw::Activate();
}
/*************************************************************************
@@ -273,7 +277,7 @@ void FuConstructArc::Deactivate()
}
// #97016#
-SdrObject* FuConstructArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuConstructArc::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_DRAW_ARC:
// case SID_DRAW_CIRCLEARC:
@@ -287,14 +291,16 @@ SdrObject* FuConstructArc::CreateDefaultObject(const sal_uInt16 nID, const Recta
// case SID_DRAW_CIRCLECUT_NOFILL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- 0L, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->getSdrObjectCreationInfo());
if(pObj)
{
- if(pObj->ISA(SdrCircObj))
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(pObj);
+
+ if(pSdrCircObj)
{
- Rectangle aRect(rRectangle);
+ basegfx::B2DRange aRange(rRange);
if(SID_DRAW_ARC == nID ||
SID_DRAW_CIRCLEARC == nID ||
@@ -304,24 +310,25 @@ SdrObject* FuConstructArc::CreateDefaultObject(const sal_uInt16 nID, const Recta
SID_DRAW_CIRCLECUT_NOFILL == nID)
{
// force quadratic
- ImpForceQuadratic(aRect);
+ ImpForceQuadratic(aRange);
}
- pObj->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pSdrCircObj, aRange);
- SfxItemSet aAttr(mpDoc->GetPool());
- aAttr.Put(SdrCircStartAngleItem(9000));
- aAttr.Put(SdrCircEndAngleItem(0));
+ if(SID_DRAW_ARC != nID || SID_DRAW_CIRCLEARC != nID)
+ {
+ // no full circle, set angles to gat a 3/4 circle
+ pSdrCircObj->SetStartAngle(M_PI + M_PI_2); // was: 9000
+ pSdrCircObj->SetEndAngle(0.0); // was: 0
+ }
if(SID_DRAW_PIE_NOFILL == nID ||
SID_DRAW_CIRCLEPIE_NOFILL == nID ||
SID_DRAW_ELLIPSECUT_NOFILL == nID ||
SID_DRAW_CIRCLECUT_NOFILL == nID)
{
- aAttr.Put(XFillStyleItem(XFILL_NONE));
+ pSdrCircObj->SetMergedItem(XFillStyleItem(XFILL_NONE));
}
-
- pObj->SetMergedItemSet(aAttr);
}
else
{
diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index 91f539ec8631..0a6ce326df59 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -25,7 +25,6 @@
#include "precompiled_sd.hxx"
#include <com/sun/star/presentation/EffectNodeType.hpp>
-
#include "fuconbez.hxx"
#include <svl/aeitem.hxx>
#include <svx/svdopath.hxx>
@@ -35,10 +34,11 @@
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
-
-
#include <svx/svxids.hrc>
#include <svx/svdpagv.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
#include "app.hrc"
#include "ViewShell.hxx"
@@ -48,18 +48,12 @@
#include "ToolBarManager.hxx"
#include "drawdoc.hxx"
#include "res_bmp.hrc"
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-
#include "CustomAnimationEffect.hxx"
using namespace ::com::sun::star::uno;
namespace sd {
-TYPEINIT1( FuConstructBezierPolygon, FuConstruct );
-
-
/*************************************************************************
|*
|* Konstruktor
@@ -94,7 +88,7 @@ void FuConstructBezierPolygon::DoExecute( SfxRequest& rReq )
if( pArgs )
{
const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == pArgs->GetItemState( SID_ADD_MOTION_PATH, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( SID_ADD_MOTION_PATH, true, &pPoolItem ) )
maTargets = ( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue();
}
}
@@ -105,31 +99,31 @@ void FuConstructBezierPolygon::DoExecute( SfxRequest& rReq )
|*
\************************************************************************/
-sal_Bool FuConstructBezierPolygon::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuConstructBezierPolygon::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
+ bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
SdrViewEvent aVEvt;
SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
if (eHit == SDRHIT_HANDLE || rMEvt.IsMod1())
{
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
}
else
{
- mpView->SetEditMode(SDREDITMODE_CREATE);
+ mpView->SetViewEditMode(SDREDITMODE_CREATE);
}
- if (aVEvt.eEvent == SDREVENT_BEGTEXTEDIT)
+ if (aVEvt.meEvent == SDREVENT_BEGTEXTEDIT)
{
// Texteingabe hier nicht zulassen
- aVEvt.eEvent = SDREVENT_BEGDRAGOBJ;
- mpView->EnableExtendedMouseEventDispatcher(sal_False);
+ aVEvt.meEvent = SDREVENT_BEGDRAGOBJ;
+ mpView->EnableExtendedMouseEventDispatcher(false);
}
else
{
- mpView->EnableExtendedMouseEventDispatcher(sal_True);
+ mpView->EnableExtendedMouseEventDispatcher(true);
}
if (eHit == SDRHIT_MARKEDOBJECT && nEditMode == SID_BEZIER_INSERT)
@@ -147,7 +141,7 @@ sal_Bool FuConstructBezierPolygon::MouseButtonDown(const MouseEvent& rMEvt)
if (pObj)
{
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(mpDoc->GetItemPool());
SetStyleSheet(aAttr, pObj);
pObj->SetMergedItemSet(aAttr);
}
@@ -162,9 +156,9 @@ sal_Bool FuConstructBezierPolygon::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstructBezierPolygon::MouseMove(const MouseEvent& rMEvt)
+bool FuConstructBezierPolygon::MouseMove(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuConstruct::MouseMove(rMEvt);
+ bool bReturn = FuConstruct::MouseMove(rMEvt);
return(bReturn);
}
@@ -174,15 +168,16 @@ sal_Bool FuConstructBezierPolygon::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
+bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
{
- sal_Bool bReturn = sal_False;
- sal_Bool bCreated = sal_False;
+ bool bReturn = false;
+ bool bCreated = false;
SdrViewEvent aVEvt;
mpView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt);
+ SdrPageView* pPV = mpView->GetSdrPageView();
- sal_uLong nCount = mpView->GetSdrPageView()->GetObjList()->GetObjCount();
+ sal_uInt32 nCount = pPV ? pPV->GetCurrentObjectList()->GetObjCount() : 0;
if (mpView->IsInsObjPoint())
{
@@ -193,27 +188,26 @@ sal_Bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
mpView->MouseButtonUp(rMEvt, mpWindow);
}
- if (aVEvt.eEvent == SDREVENT_ENDCREATE)
+ if (aVEvt.meEvent == SDREVENT_ENDCREATE)
{
- bReturn = sal_True;
+ bReturn = true;
- if (nCount == (mpView->GetSdrPageView()->GetObjList()->GetObjCount() - 1))
+ if (pPV && nCount == (pPV->GetCurrentObjectList()->GetObjCount() - 1))
{
- bCreated = sal_True;
+ bCreated = true;
}
// Trick, um FuDraw::DoubleClick nicht auszuloesen
- bMBDown = sal_False;
-
+ bMBDown = false;
}
bReturn = FuConstruct::MouseButtonUp(rMEvt) || bReturn;
bool bDeleted = false;
- if( bCreated && maTargets.hasValue() )
+ if( bCreated && maTargets.hasValue() && pPV )
{
- SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >( mpView->GetSdrPageView()->GetObjList()->GetObj( nCount ) );
- SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->GetPage() : 0 );
+ SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >( pPV->GetCurrentObjectList()->GetObj( nCount ) );
+ SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->getSdrPageFromSdrObject() : 0 );
if( pPage )
{
boost::shared_ptr< sd::MainSequence > pMainSequence( pPage->getMainSequence() );
@@ -256,14 +250,14 @@ sal_Bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuConstructBezierPolygon::KeyInput(const KeyEvent& rKEvt)
+bool FuConstructBezierPolygon::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
+ bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
}
@@ -276,58 +270,64 @@ sal_Bool FuConstructBezierPolygon::KeyInput(const KeyEvent& rKEvt)
void FuConstructBezierPolygon::Activate()
{
- mpView->EnableExtendedMouseEventDispatcher(sal_True);
-
- SdrObjKind eKind;
+ mpView->EnableExtendedMouseEventDispatcher(true);
+ bool bCreateFreehandMode(false);
+ SdrPathObjType aSdrPathObjType(PathType_OpenPolygon);
switch (nSlotId)
{
case SID_DRAW_POLYGON_NOFILL:
case SID_DRAW_XPOLYGON_NOFILL:
{
- eKind = OBJ_PLIN;
+ aSdrPathObjType = PathType_OpenPolygon;
}
break;
case SID_DRAW_POLYGON:
case SID_DRAW_XPOLYGON:
{
- eKind = OBJ_POLY;
+ aSdrPathObjType = PathType_ClosedPolygon;
}
break;
case SID_DRAW_BEZIER_NOFILL:
{
- eKind = OBJ_PATHLINE;
+ aSdrPathObjType = PathType_OpenBezier;
}
break;
case SID_DRAW_BEZIER_FILL:
{
- eKind = OBJ_PATHFILL;
+ aSdrPathObjType = PathType_ClosedBezier;
}
break;
case SID_DRAW_FREELINE_NOFILL:
{
- eKind = OBJ_FREELINE;
+ aSdrPathObjType = PathType_OpenBezier;
+ bCreateFreehandMode = true;
}
break;
case SID_DRAW_FREELINE:
{
- eKind = OBJ_FREEFILL;
+ aSdrPathObjType = PathType_ClosedBezier;
+ bCreateFreehandMode = true;
}
break;
default:
{
- eKind = OBJ_PATHLINE;
+ aSdrPathObjType = PathType_OpenBezier;
}
break;
}
- mpView->SetCurrentObj((sal_uInt16)eKind);
+ SdrObjectCreationInfo aSdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_POLY));
+
+ aSdrObjectCreationInfo.setSdrPathObjType(aSdrPathObjType);
+ aSdrObjectCreationInfo.setFreehandMode(bCreateFreehandMode);
+ mpView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
FuConstruct::Activate();
}
@@ -340,7 +340,7 @@ void FuConstructBezierPolygon::Activate()
void FuConstructBezierPolygon::Deactivate()
{
- mpView->EnableExtendedMouseEventDispatcher(sal_False);
+ mpView->EnableExtendedMouseEventDispatcher(false);
FuConstruct::Deactivate();
}
@@ -380,7 +380,7 @@ void FuConstructBezierPolygon::SetEditMode(sal_uInt16 nMode)
}
// #97016#
-SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_DRAW_POLYGON:
// case SID_DRAW_POLYGON_NOFILL:
@@ -392,12 +392,14 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
// case SID_DRAW_BEZIER_NOFILL: // BASIC
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- 0L, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->getSdrObjectCreationInfo());
if(pObj)
{
- if(pObj->ISA(SdrPathObj))
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
{
basegfx::B2DPolyPolygon aPoly;
@@ -405,9 +407,9 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
{
case SID_DRAW_BEZIER_FILL:
{
- const sal_Int32 nWdt(rRectangle.GetWidth() / 2);
- const sal_Int32 nHgt(rRectangle.GetHeight() / 2);
- const basegfx::B2DPolygon aInnerPoly(basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()), nWdt, nHgt));
+ const double fWdt(rRange.getWidth() * 0.5);
+ const double fHgt(rRange.getHeight() * 0.5);
+ const basegfx::B2DPolygon aInnerPoly(basegfx::tools::createPolygonFromEllipse(rRange.getCenter(), fWdt, fHgt));
aPoly.append(aInnerPoly);
break;
@@ -416,19 +418,19 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
{
basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
- const basegfx::B2DPoint aCenterBottom(rRectangle.Center().X(), rRectangle.Bottom());
+ const basegfx::B2DPoint aCenterBottom(rRange.getCenterX(), rRange.getMaxY());
aInnerPoly.appendBezierSegment(
aCenterBottom,
aCenterBottom,
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
+ rRange.getCenter());
- const basegfx::B2DPoint aCenterTop(rRectangle.Center().X(), rRectangle.Top());
+ const basegfx::B2DPoint aCenterTop(rRange.getCenterX(), rRange.getMinY());
aInnerPoly.appendBezierSegment(
aCenterTop,
aCenterTop,
- basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
+ basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY()));
aPoly.append(aInnerPoly);
break;
@@ -438,21 +440,21 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
{
basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()),
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()),
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
+ rRange.getMinimum(),
+ basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()),
+ rRange.getCenter());
aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()),
- basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()),
- basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
+ basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()),
+ rRange.getMaximum(),
+ basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY()));
if(SID_DRAW_FREELINE == nID)
{
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
+ aInnerPoly.append(rRange.getMaximum());
}
else
{
@@ -467,16 +469,16 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
{
basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Center().Y()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
+ aInnerPoly.append(rRange.getMinimum());
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()));
+ aInnerPoly.append(rRange.getCenter());
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxX(), rRange.getCenterY()));
+ aInnerPoly.append(rRange.getMaximum());
if(SID_DRAW_XPOLYGON_NOFILL == nID)
{
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()));
}
else
{
@@ -490,21 +492,21 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
case SID_DRAW_POLYGON_NOFILL:
{
basegfx::B2DPolygon aInnerPoly;
- const sal_Int32 nWdt(rRectangle.GetWidth());
- const sal_Int32 nHgt(rRectangle.GetHeight());
-
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 30) / 100, rRectangle.Top() + (nHgt * 70) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top() + (nHgt * 15) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 65) / 100, rRectangle.Top()));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + nWdt, rRectangle.Top() + (nHgt * 30) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 50) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 75) / 100));
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Bottom(), rRectangle.Right()));
+ const double fWdt(rRange.getWidth());
+ const double fHgt(rRange.getHeight());
+
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.3, rRange.getMinY() + fHgt * 0.7));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + fHgt * 0.15));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.65, rRange.getMinY()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt, rRange.getMinY() + fHgt * 0.3));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.5));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 075));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxY(), rRange.getMaxX()));
if(SID_DRAW_POLYGON_NOFILL == nID)
{
- aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()));
}
else
{
@@ -516,14 +518,14 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
}
}
- ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly);
}
else
{
DBG_ERROR("Object is NO path object");
}
- pObj->SetLogicRect(rRectangle);
+ sdr::legacy::SetLogicRange(*pObj, rRange);
}
return pObj;
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index ea49a31cd623..124046e3718b 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -26,12 +26,9 @@
#include "fuconcs.hxx"
#include <svx/svdpagv.hxx>
-
-
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
-
#include "app.hrc"
#include <svl/aeitem.hxx>
#include <svx/xlnstwit.hxx>
@@ -40,9 +37,7 @@
#include <svx/xlnstit.hxx>
#include <svx/xlnwtit.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svx/sdtmfitm.hxx>
#include <svx/sxekitm.hxx>
-#include <svx/sderitm.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdocirc.hxx>
@@ -53,21 +48,16 @@
#include <svx/sdasitm.hxx>
#include <svx/tbxcustomshapes.hxx>
#include <svx/svdoashp.hxx>
-#include <svx/sdtagitm.hxx>
-
-// #88751#
#include <svx/svdocapt.hxx>
-
-// #97016#
#include <svx/svdomeas.hxx>
#include "ViewShell.hxx"
#include "ViewShellBase.hxx"
#include "ToolBarManager.hxx"
-// #109583#
#include <editeng/writingmodeitem.hxx>
#include <svx/gallery.hxx>
#include <svl/itempool.hxx>
#include <com/sun/star/uno/Any.hxx>
+#include <svx/svdlegacy.hxx>
#include "sdresid.hxx"
#include "View.hxx"
@@ -80,8 +70,6 @@
namespace sd {
-TYPEINIT1( FuConstructCustomShape, FuConstruct );
-
/*************************************************************************
|*
|* Konstruktor
@@ -129,18 +117,19 @@ void FuConstructCustomShape::DoExecute( SfxRequest& rReq )
|*
\************************************************************************/
-sal_Bool FuConstructCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuConstructCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
+ bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
if ( rMEvt.IsLeft() && !mpView->IsAction() )
{
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
mpWindow->CaptureMouse();
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- mpView->BegCreateObj(aPnt, (OutputDevice*) NULL, nDrgLog);
+ mpView->BegCreateObj(aLogicPos, nDrgLog);
SdrObject* pObj = mpView->GetCreateObj();
if ( pObj )
@@ -153,7 +142,7 @@ sal_Bool FuConstructCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
bForceFillStyle = sal_False;
bForceNoFillStyle = sal_True;
}
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(mpDoc->GetItemPool());
SetStyleSheet( aAttr, pObj, bForceFillStyle, bForceNoFillStyle );
pObj->SetMergedItemSet(aAttr);
}
@@ -168,7 +157,7 @@ sal_Bool FuConstructCustomShape::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstructCustomShape::MouseMove(const MouseEvent& rMEvt)
+bool FuConstructCustomShape::MouseMove(const MouseEvent& rMEvt)
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -179,16 +168,16 @@ sal_Bool FuConstructCustomShape::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstructCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuConstructCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn(sal_False);
+ bool bReturn(false);
- if(mpView->IsCreateObj() && rMEvt.IsLeft())
+ if(mpView->GetCreateObj() && rMEvt.IsLeft())
{
SdrObject* pObj = mpView->GetCreateObj();
if( pObj && mpView->EndCreateObj( SDRCREATE_FORCEEND ) )
{
- bReturn = sal_True;
+ bReturn = true;
}
}
bReturn = FuConstruct::MouseButtonUp (rMEvt) || bReturn;
@@ -203,14 +192,15 @@ sal_Bool FuConstructCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuConstructCustomShape::KeyInput(const KeyEvent& rKEvt)
+bool FuConstructCustomShape::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
+ bool bReturn = FuConstruct::KeyInput(rKEvt);
+
return(bReturn);
}
@@ -222,7 +212,7 @@ sal_Bool FuConstructCustomShape::KeyInput(const KeyEvent& rKEvt)
void FuConstructCustomShape::Activate()
{
- mpView->SetCurrentObj( OBJ_CUSTOMSHAPE );
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_CUSTOMSHAPE)));
FuConstruct::Activate();
}
@@ -234,6 +224,7 @@ void FuConstructCustomShape::Activate()
void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
{
+ OSL_ENSURE(pObj, "FuConstructCustomShape::SetAttributes without SdrObject (!)");
sal_Bool bAttributesAppliedFromGallery = sal_False;
if ( GalleryExplorer::GetSdrObjCount( GALLERY_THEME_POWERPOINT ) )
@@ -258,7 +249,7 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
if( pSourceObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
- SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
+ SfxItemSet aDest( pObj->GetObjectItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
@@ -274,11 +265,12 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
0, 0);
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
- sal_Int32 nAngle = pSourceObj->GetRotateAngle();
+
+ const long nAngle(sdr::legacy::GetRotateAngle(*pSourceObj));
if ( nAngle )
{
- double a = nAngle * F_PI18000;
- pObj->NbcRotate( pObj->GetSnapRect().Center(), nAngle, sin( a ), cos( a ) );
+ const Rectangle aOldObjSnapRect(sdr::legacy::GetSnapRect(*pObj));
+ sdr::legacy::RotateSdrObject(*pObj, aOldObjSnapRect.Center(), nAngle);
}
bAttributesAppliedFromGallery = sal_True;
@@ -305,26 +297,30 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
- pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ pObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
((SdrObjCustomShape*)pObj)->MergeDefaultAttributes( &aCustomShape );
}
}
// #97016#
-SdrObject* FuConstructCustomShape::CreateDefaultObject(const sal_uInt16, const Rectangle& rRectangle)
+SdrObject* FuConstructCustomShape::CreateDefaultObject(const sal_uInt16, const basegfx::B2DRange& rRange)
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- 0L, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->getSdrObjectCreationInfo());
if( pObj )
{
- Rectangle aRect( rRectangle );
+ basegfx::B2DRange aRange( rRange );
+
if ( doConstructOrthogonal() )
- ImpForceQuadratic( aRect );
- pObj->SetLogicRect( aRect );
+ {
+ ImpForceQuadratic( aRange );
+ }
+
+ sdr::legacy::SetLogicRange(*pObj, aRange );
SetAttributes( pObj );
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(pObj->GetObjectItemPool());
SetStyleSheet(aAttr, pObj);
pObj->SetMergedItemSet(aAttr);
}
diff --git a/sd/source/ui/func/fuconnct.cxx b/sd/source/ui/func/fuconnct.cxx
index 6ea9402c920f..16567ad85315 100644
--- a/sd/source/ui/func/fuconnct.cxx
+++ b/sd/source/ui/func/fuconnct.cxx
@@ -37,8 +37,6 @@
namespace sd {
-TYPEINIT1( FuConnectionDlg, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -64,7 +62,7 @@ FunctionReference FuConnectionDlg::Create( ViewShell* pViewSh, ::sd::Window* pWi
void FuConnectionDlg::DoExecute( SfxRequest& rReq )
{
- SfxItemSet aNewAttr( mpDoc->GetPool() );
+ SfxItemSet aNewAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aNewAttr );
const SfxItemSet* pArgs = rReq.GetArgs();
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index b2c042d77005..ba89db154606 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -26,12 +26,9 @@
#include "fuconrec.hxx"
#include <svx/svdpagv.hxx>
-
-
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
-
#include "app.hrc"
#include <svl/aeitem.hxx>
#include <svx/xlnstwit.hxx>
@@ -40,9 +37,7 @@
#include <svx/xlnstit.hxx>
#include <svx/xlnwtit.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svx/sdtmfitm.hxx>
#include <svx/sxekitm.hxx>
-#include <svx/sderitm.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdocirc.hxx>
@@ -50,19 +45,15 @@
#include <sfx2/request.hxx>
#include <editeng/adjitem.hxx>
#include <svx/xtable.hxx>
-
-// #88751#
#include <svx/svdocapt.hxx>
-
-// #97016#
#include <svx/svdomeas.hxx>
#include "ViewShell.hxx"
#include "ViewShellBase.hxx"
#include "ToolBarManager.hxx"
-// #109583#
#include <editeng/writingmodeitem.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/svdlegacy.hxx>
#include "sdresid.hxx"
#include "View.hxx"
@@ -75,8 +66,6 @@
namespace sd {
-TYPEINIT1( FuConstructRectangle, FuConstruct );
-
/*************************************************************************
|*
|* Konstruktor
@@ -118,37 +107,44 @@ void FuConstructRectangle::DoExecute( SfxRequest& rReq )
{
case SID_DRAW_ELLIPSE :
{
- SFX_REQUEST_ARG (rReq, pCenterX, SfxUInt32Item, ID_VAL_CENTER_X, sal_False);
- SFX_REQUEST_ARG (rReq, pCenterY, SfxUInt32Item, ID_VAL_CENTER_Y, sal_False);
- SFX_REQUEST_ARG (rReq, pAxisX, SfxUInt32Item, ID_VAL_AXIS_X, sal_False);
- SFX_REQUEST_ARG (rReq, pAxisY, SfxUInt32Item, ID_VAL_AXIS_Y, sal_False);
-
- Rectangle aNewRectangle (pCenterX->GetValue () - pAxisX->GetValue () / 2,
- pCenterY->GetValue () - pAxisY->GetValue () / 2,
- pCenterX->GetValue () + pAxisX->GetValue () / 2,
- pCenterY->GetValue () + pAxisY->GetValue () / 2);
- SdrCircObj *pNewCircle = new SdrCircObj (OBJ_CIRC, aNewRectangle);
- SdrPageView *pPV = mpView->GetSdrPageView();
-
- mpView->InsertObjectAtView(pNewCircle, *pPV, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR);
+ SFX_REQUEST_ARG (rReq, pCenterX, SfxUInt32Item, ID_VAL_CENTER_X );
+ SFX_REQUEST_ARG (rReq, pCenterY, SfxUInt32Item, ID_VAL_CENTER_Y );
+ SFX_REQUEST_ARG (rReq, pAxisX, SfxUInt32Item, ID_VAL_AXIS_X );
+ SFX_REQUEST_ARG (rReq, pAxisY, SfxUInt32Item, ID_VAL_AXIS_Y );
+
+ const sal_Int32 nWidth(pAxisX->GetValue());
+ const sal_Int32 nHeight(pAxisY->GetValue());
+ const basegfx::B2DHomMatrix aObjTrans(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ nWidth, nHeight,
+ pCenterX->GetValue() - (nWidth / 2), pCenterY->GetValue() - (nHeight / 2)));
+ SdrCircObj* pNewCircle = new SdrCircObj(
+ *GetDoc(),
+ CircleType_Circle,
+ aObjTrans);
+
+ mpView->InsertObjectAtView(*pNewCircle, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR);
}
break;
case SID_DRAW_RECT :
{
- SFX_REQUEST_ARG (rReq, pMouseStartX, SfxUInt32Item, ID_VAL_MOUSESTART_X, sal_False);
- SFX_REQUEST_ARG (rReq, pMouseStartY, SfxUInt32Item, ID_VAL_MOUSESTART_Y, sal_False);
- SFX_REQUEST_ARG (rReq, pMouseEndX, SfxUInt32Item, ID_VAL_MOUSEEND_X, sal_False);
- SFX_REQUEST_ARG (rReq, pMouseEndY, SfxUInt32Item, ID_VAL_MOUSEEND_Y, sal_False);
-
- Rectangle aNewRectangle (pMouseStartX->GetValue (),
- pMouseStartY->GetValue (),
- pMouseEndX->GetValue (),
- pMouseEndY->GetValue ());
- SdrRectObj *pNewRect = new SdrRectObj (aNewRectangle);
- SdrPageView *pPV = mpView->GetSdrPageView();
-
- mpView->InsertObjectAtView(pNewRect, *pPV, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR);
+ SFX_REQUEST_ARG (rReq, pMouseStartX, SfxUInt32Item, ID_VAL_MOUSESTART_X );
+ SFX_REQUEST_ARG (rReq, pMouseStartY, SfxUInt32Item, ID_VAL_MOUSESTART_Y );
+ SFX_REQUEST_ARG (rReq, pMouseEndX, SfxUInt32Item, ID_VAL_MOUSEEND_X );
+ SFX_REQUEST_ARG (rReq, pMouseEndY, SfxUInt32Item, ID_VAL_MOUSEEND_Y );
+
+ const sal_Int32 nLeft(pMouseStartX->GetValue());
+ const sal_Int32 nTop(pMouseStartY->GetValue());
+ const basegfx::B2DHomMatrix aObjTrans(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ pMouseEndX->GetValue() - nLeft, pMouseEndY->GetValue() - nTop,
+ nLeft, nTop));
+ SdrRectObj *pNewRect = new SdrRectObj(
+ *GetDoc(),
+ aObjTrans);
+
+ mpView->InsertObjectAtView(*pNewRect, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR);
}
break;
}
@@ -200,40 +196,44 @@ void FuConstructRectangle::DoExecute( SfxRequest& rReq )
|*
\************************************************************************/
-sal_Bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
+ bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
if ( rMEvt.IsLeft() && !mpView->IsAction() )
{
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
mpWindow->CaptureMouse();
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- if (mpView->GetCurrentObjIdentifier() == OBJ_CAPTION)
+ if(OBJ_CAPTION == mpView->getSdrObjectCreationInfo().getIdent())
{
- Size aCaptionSize(846, 846); // (4x2)cm
- bReturn = mpView->BegCreateCaptionObj(aPnt, aCaptionSize,
- (OutputDevice*) NULL, nDrgLog);
+ bReturn = mpView->BegCreateCaptionObj(
+ aLogicPos,
+ basegfx::B2DVector(846.0, 846.0), // (4x2)cm
+ nDrgLog);
}
else
{
- mpView->BegCreateObj(aPnt, (OutputDevice*) NULL, nDrgLog);
+ mpView->BegCreateObj(
+ aLogicPos,
+ nDrgLog);
}
SdrObject* pObj = mpView->GetCreateObj();
if (pObj)
{
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(pObj->GetObjectItemPool());
SetStyleSheet(aAttr, pObj);
SetAttributes(aAttr, pObj);
SetLineEnds(aAttr, pObj);
pObj->SetMergedItemSet(aAttr);
if( nSlotId == SID_DRAW_CAPTION_VERTICAL )
- ( (SdrTextObj*) pObj)->SetVerticalWriting( sal_True );
+ ( (SdrTextObj*) pObj)->SetVerticalWriting( true );
}
}
return bReturn;
@@ -245,7 +245,7 @@ sal_Bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstructRectangle::MouseMove(const MouseEvent& rMEvt)
+bool FuConstructRectangle::MouseMove(const MouseEvent& rMEvt)
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -256,11 +256,11 @@ sal_Bool FuConstructRectangle::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn(sal_False);
+ bool bReturn(false);
- if(mpView->IsCreateObj() && rMEvt.IsLeft())
+ if(mpView->GetCreateObj() && rMEvt.IsLeft())
{
SdrObject* pObj = mpView->GetCreateObj();
@@ -268,13 +268,13 @@ sal_Bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt)
{
if(SID_DRAW_MEASURELINE == nSlotId)
{
- SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rAdmin = mpDoc->GetModelLayerAdmin();
String aStr(SdResId(STR_LAYER_MEASURELINES));
- pObj->SetLayer(rAdmin.GetLayerID(aStr, sal_False));
+ pObj->SetLayer(rAdmin.GetLayerID(aStr, false));
}
// #88751# init text position when vertica caption object is created
- if(pObj->ISA(SdrCaptionObj) && SID_DRAW_CAPTION_VERTICAL == nSlotId)
+ if(SID_DRAW_CAPTION_VERTICAL == nSlotId && dynamic_cast< SdrCaptionObj* >(pObj))
{
// draw text object, needs to be initialized when vertical text is used
SfxItemSet aSet(pObj->GetMergedItemSet());
@@ -291,7 +291,7 @@ sal_Bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt)
pObj->SetMergedItemSet(aSet);
}
- bReturn = sal_True;
+ bReturn = true;
}
}
@@ -307,14 +307,14 @@ sal_Bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuConstructRectangle::KeyInput(const KeyEvent& rKEvt)
+bool FuConstructRectangle::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
+ bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
}
@@ -326,7 +326,8 @@ sal_Bool FuConstructRectangle::KeyInput(const KeyEvent& rKEvt)
void FuConstructRectangle::Activate()
{
- SdrObjKind aObjKind;
+ SdrObjKind aObjKind(OBJ_NONE);
+ SdrPathObjType aSdrPathObjType(PathType_Line);
switch (nSlotId)
{
@@ -341,7 +342,8 @@ void FuConstructRectangle::Activate()
// keine break !
case SID_DRAW_LINE :
case SID_DRAW_XLINE:
- aObjKind = OBJ_LINE;
+ aObjKind = OBJ_POLY;
+ aSdrPathObjType = PathType_Line;
break;
case SID_DRAW_MEASURELINE:
@@ -420,7 +422,10 @@ void FuConstructRectangle::Activate()
break;
}
- mpView->SetCurrentObj((sal_uInt16)aObjKind);
+ SdrObjectCreationInfo aSdrObjectCreationInfo(static_cast< sal_uInt16 >(aObjKind));
+
+ aSdrObjectCreationInfo.setSdrPathObjType(aSdrPathObjType);
+ mpView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
FuConstruct::Activate();
}
@@ -469,7 +474,7 @@ void FuConstructRectangle::Deactivate()
nSlotId == SID_LINE_ARROW_SQUARE ||
nSlotId == SID_LINE_SQUARE_ARROW )
{
- mpView->SetGlueVisible( sal_False );
+ mpView->SetGlueVisible( false );
}
FuConstruct::Deactivate();
}
@@ -491,7 +496,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
/**********************************************************************
* Abgerundete Ecken
**********************************************************************/
- rAttr.Put(SdrEckenradiusItem(500));
+ rAttr.Put(SdrMetricItem(SDRATTR_ECKENRADIUS, 500));
}
else if (nSlotId == SID_CONNECTOR_LINE ||
nSlotId == SID_CONNECTOR_LINE_ARROW_START ||
@@ -537,11 +542,11 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
/**********************************************************************
* Legendenobjekt
**********************************************************************/
- Size aSize(pObj->GetLogicRect().GetSize());
- rAttr.Put( SdrTextMinFrameHeightItem( aSize.Height() ) );
- rAttr.Put( SdrTextMinFrameWidthItem( aSize.Width() ) );
- rAttr.Put( SdrTextAutoGrowHeightItem( sal_True ) );
- rAttr.Put( SdrTextAutoGrowWidthItem( sal_True ) );
+ const Size aSize(sdr::legacy::GetLogicRect(*pObj).GetSize());
+ rAttr.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, aSize.Height() ) );
+ rAttr.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, aSize.Width() ) );
+ rAttr.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true ) );
+ rAttr.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true ) );
// #103516# Support full with for vertical caption objects, too
if(SID_DRAW_CAPTION == nSlotId)
@@ -550,31 +555,34 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
rAttr.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_BLOCK ) );
rAttr.Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) );
- rAttr.Put( SdrTextLeftDistItem( 100 ) );
- rAttr.Put( SdrTextRightDistItem( 100 ) );
- rAttr.Put( SdrTextUpperDistItem( 100 ) );
- rAttr.Put( SdrTextLowerDistItem( 100 ) );
+ rAttr.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 100 ) );
+ rAttr.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 100 ) );
+ rAttr.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 100 ) );
+ rAttr.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 100 ) );
}
else if (nSlotId == SID_DRAW_MEASURELINE)
{
/**********************************************************************
* Masslinie
**********************************************************************/
- SdPage* pPage = (SdPage*) mpView->GetSdrPageView()->GetPage();
+ SdrPageView* pPV = mpView->GetSdrPageView();
+
+ if(pPV)
+ {
+ SdPage& rPage = (SdPage&) pPV->getSdrPageFromSdrPageView();
String aName(SdResId(STR_POOLSHEET_MEASURE));
- SfxStyleSheet* pSheet = (SfxStyleSheet*) pPage->GetModel()->
- GetStyleSheetPool()->
- Find(aName, SD_STYLE_FAMILY_GRAPHICS);
+ SfxStyleSheet* pSheet = (SfxStyleSheet*)rPage.getSdrModelFromSdrPage().GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_GRAPHICS);
DBG_ASSERT(pSheet, "Objektvorlage nicht gefunden");
if (pSheet)
{
- pObj->SetStyleSheet(pSheet, sal_False);
+ pObj->SetStyleSheet(pSheet, false);
}
- SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rAdmin = mpDoc->GetModelLayerAdmin();
String aStr(SdResId(STR_LAYER_MEASURELINES));
- pObj->SetLayer(rAdmin.GetLayerID(aStr, sal_False));
+ pObj->SetLayer(rAdmin.GetLayerID(aStr, false));
+ }
}
else if (nSlotId == OBJ_CUSTOMSHAPE )
{
@@ -666,7 +674,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj)
aSquare.append(aNewSquare);
}
- SfxItemSet aSet( mpDoc->GetPool() );
+ SfxItemSet aSet( mpDoc->GetItemPool() );
mpView->GetAttributes( aSet );
// #i3908# Here, the default Line Start/End width for arrow construction is
@@ -801,70 +809,17 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj)
}
// #97016#
-SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
DBG_ASSERT( (nID != SID_DRAW_FONTWORK) && (nID != SID_DRAW_FONTWORK_VERTICAL ), "FuConstRectangle::CreateDefaultObject can not create Fontwork shapes!" );
- // case SID_DRAW_LINE:
- // case SID_DRAW_XLINE:
- // case SID_DRAW_MEASURELINE:
- // case SID_LINE_ARROW_START:
- // case SID_LINE_ARROW_END:
- // case SID_LINE_ARROWS:
- // case SID_LINE_ARROW_CIRCLE:
- // case SID_LINE_CIRCLE_ARROW:
- // case SID_LINE_ARROW_SQUARE:
- // case SID_LINE_SQUARE_ARROW:
- // case SID_DRAW_RECT:
- // case SID_DRAW_RECT_NOFILL:
- // case SID_DRAW_RECT_ROUND:
- // case SID_DRAW_RECT_ROUND_NOFILL:
- // case SID_DRAW_SQUARE:
- // case SID_DRAW_SQUARE_NOFILL:
- // case SID_DRAW_SQUARE_ROUND:
- // case SID_DRAW_SQUARE_ROUND_NOFILL:
- // case SID_DRAW_ELLIPSE:
- // case SID_DRAW_ELLIPSE_NOFILL:
- // case SID_DRAW_CIRCLE:
- // case SID_DRAW_CIRCLE_NOFILL:
- // case SID_DRAW_CAPTION:
- // case SID_DRAW_CAPTION_VERTICAL:
- // case SID_TOOL_CONNECTOR:
- // case SID_CONNECTOR_ARROW_START:
- // case SID_CONNECTOR_ARROW_END:
- // case SID_CONNECTOR_ARROWS:
- // case SID_CONNECTOR_CIRCLE_START:
- // case SID_CONNECTOR_CIRCLE_END:
- // case SID_CONNECTOR_CIRCLES:
- // case SID_CONNECTOR_LINE:
- // case SID_CONNECTOR_LINE_ARROW_START:
- // case SID_CONNECTOR_LINE_ARROW_END:
- // case SID_CONNECTOR_LINE_ARROWS:
- // case SID_CONNECTOR_LINE_CIRCLE_START:
- // case SID_CONNECTOR_LINE_CIRCLE_END:
- // case SID_CONNECTOR_LINE_CIRCLES:
- // case SID_CONNECTOR_CURVE:
- // case SID_CONNECTOR_CURVE_ARROW_START:
- // case SID_CONNECTOR_CURVE_ARROW_END:
- // case SID_CONNECTOR_CURVE_ARROWS:
- // case SID_CONNECTOR_CURVE_CIRCLE_START:
- // case SID_CONNECTOR_CURVE_CIRCLE_END:
- // case SID_CONNECTOR_CURVE_CIRCLES:
- // case SID_CONNECTOR_LINES:
- // case SID_CONNECTOR_LINES_ARROW_START:
- // case SID_CONNECTOR_LINES_ARROW_END:
- // case SID_CONNECTOR_LINES_ARROWS:
- // case SID_CONNECTOR_LINES_CIRCLE_START:
- // case SID_CONNECTOR_LINES_CIRCLE_END:
- // case SID_CONNECTOR_LINES_CIRCLES:
-
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- 0L, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->getSdrObjectCreationInfo());
if(pObj)
{
- Rectangle aRect(rRectangle);
+ basegfx::B2DRange aRange(rRange);
if(SID_DRAW_SQUARE == nID ||
SID_DRAW_SQUARE_NOFILL == nID ||
@@ -874,11 +829,11 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
SID_DRAW_CIRCLE_NOFILL == nID)
{
// force quadratic
- ImpForceQuadratic(aRect);
+ ImpForceQuadratic(aRange);
}
- Point aStart = aRect.TopLeft();
- Point aEnd = aRect.BottomRight();
+ const basegfx::B2DPoint aStart(aRange.getMinimum());
+ const basegfx::B2DPoint aEnd(aRange.getMaximum());
switch(nID)
{
@@ -892,14 +847,16 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
case SID_LINE_ARROW_SQUARE:
case SID_LINE_SQUARE_ARROW:
{
- if(pObj->ISA(SdrPathObj))
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
{
- sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
+ const double fYMiddle((aRange.getMinY() + aRange.getMaxY()) * 0.5);
::basegfx::B2DPolygon aB2DPolygon;
- aB2DPolygon.append(::basegfx::B2DPoint(aStart.X(), nYMiddle));
- aB2DPolygon.append(::basegfx::B2DPoint(aEnd.X(), nYMiddle));
- ((SdrPathObj*)pObj)->SetPathPoly(::basegfx::B2DPolyPolygon(aB2DPolygon));
+ aB2DPolygon.append(::basegfx::B2DPoint(aStart.getX(), fYMiddle));
+ aB2DPolygon.append(::basegfx::B2DPoint(aEnd.getX(), fYMiddle));
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(::basegfx::B2DPolyPolygon(aB2DPolygon));
}
else
{
@@ -911,11 +868,14 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
case SID_DRAW_MEASURELINE:
{
- if(pObj->ISA(SdrMeasureObj))
+ SdrMeasureObj* pSdrMeasureObj = dynamic_cast< SdrMeasureObj* >(pObj);
+
+ if(pSdrMeasureObj)
{
- sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
- ((SdrMeasureObj*)pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0);
- ((SdrMeasureObj*)pObj)->SetPoint(Point(aEnd.X(), nYMiddle), 1);
+ const double fYMiddle((aRange.getMinY() + aRange.getMaxY()) * 0.5);
+
+ pSdrMeasureObj->SetObjectPoint(basegfx::B2DPoint(aStart.getX(), fYMiddle), 0);
+ pSdrMeasureObj->SetObjectPoint(basegfx::B2DPoint(aEnd.getX(), fYMiddle), 1);
}
else
{
@@ -954,10 +914,12 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
case SID_CONNECTOR_LINES_CIRCLE_END:
case SID_CONNECTOR_LINES_CIRCLES:
{
- if(pObj->ISA(SdrEdgeObj))
+ SdrEdgeObj* pSdrEdgeObj = dynamic_cast< SdrEdgeObj* >(pObj);
+
+ if(pSdrEdgeObj)
{
- ((SdrEdgeObj*)pObj)->SetTailPoint(sal_False, aStart);
- ((SdrEdgeObj*)pObj)->SetTailPoint(sal_True, aEnd);
+ pSdrEdgeObj->SetTailPoint(false, aStart);
+ pSdrEdgeObj->SetTailPoint(true, aEnd);
}
else
{
@@ -969,11 +931,13 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
{
- if(pObj->ISA(SdrCaptionObj))
+ SdrCaptionObj* pSdrCaptionObj = dynamic_cast< SdrCaptionObj* >(pObj);
+
+ if(pSdrCaptionObj)
{
sal_Bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID);
- ((SdrTextObj*)pObj)->SetVerticalWriting(bIsVertical);
+ static_cast< SdrTextObj* >(pObj)->SetVerticalWriting(bIsVertical);
if(bIsVertical)
{
@@ -985,11 +949,10 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
// For task #105815# the default text is not inserted anymore.
// String aText(SdResId(STR_POOLSHEET_TEXT));
- // ((SdrCaptionObj*)pObj)->SetText(aText);
+ // pSdrCaptionObj->SetText(aText);
- ((SdrCaptionObj*)pObj)->SetLogicRect(aRect);
- ((SdrCaptionObj*)pObj)->SetTailPos(
- aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
+ sdr::legacy::SetLogicRange(*pSdrCaptionObj, aRange);
+ pSdrCaptionObj->SetTailPos(aRange.getMinimum() - (aRange.getRange() * 0.5));
}
else
{
@@ -1001,13 +964,13 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
default:
{
- pObj->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pObj, aRange);
break;
}
}
- SfxItemSet aAttr(mpDoc->GetPool());
+ SfxItemSet aAttr(pObj->GetObjectItemPool());
SetStyleSheet(aAttr, pObj);
SetAttributes(aAttr, pObj);
SetLineEnds(aAttr, pObj);
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index b63991492e6f..239e12aa2d5f 100644
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -49,8 +49,6 @@
namespace sd {
-TYPEINIT1( FuConstruct, FuDraw );
-
/*************************************************************************
|*
|* Konstruktor
@@ -64,7 +62,7 @@ FuConstruct::FuConstruct (
SdDrawDocument* pDoc,
SfxRequest& rReq)
: FuDraw(pViewSh, pWin, pView, pDoc, rReq),
- bSelectionChanged(sal_False)
+ bSelectionChanged(false)
{
}
@@ -79,12 +77,12 @@ void FuConstruct::DoExecute( SfxRequest& rReq )
|*
\************************************************************************/
-sal_Bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
+ bool bReturn = FuDraw::MouseButtonDown(rMEvt);
- bMBDown = sal_True;
- bSelectionChanged = sal_False;
+ bMBDown = true;
+ bSelectionChanged = false;
if ( mpView->IsAction() )
{
@@ -92,14 +90,16 @@ sal_Bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
// erasing the last two points when creating a polygon.
// if ( rMEvt.IsRight() )
// mpView->BckAction();
- return sal_True;
+ return true;
}
- bFirstMouseMove = sal_True;
+ bFirstMouseMove = true;
aDragTimer.Start();
- aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
- sal_uInt16 nHitLog = sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width());
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ aMDPos = mpWindow->GetInverseViewTransformation() * aPixelPos;
+ // TTTT: evtl. unify fHitLog/fDrgLog/fHitTol at SdrView?
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
if (rMEvt.IsLeft() && mpView->IsExtendedMouseEventDispatcherEnabled())
{
@@ -107,16 +107,16 @@ sal_Bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
SdrHdl* pHdl = mpView->PickHandle(aMDPos);
- if ( pHdl != NULL || mpView->IsMarkedHit(aMDPos, nHitLog) )
+ if ( pHdl != NULL || mpView->IsMarkedObjHit(aMDPos, fHitLog) )
{
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
- bReturn = sal_True;
+ const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
+ mpView->BegDragObj(aMDPos, pHdl, fTolerance);
+ bReturn = true;
}
- else if ( mpView->AreObjectsMarked() )
+ else if ( mpView->areSdrObjectsSelected() )
{
mpView->UnmarkAll();
- bReturn = sal_True;
+ bReturn = true;
}
}
@@ -129,28 +129,28 @@ sal_Bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstruct::MouseMove(const MouseEvent& rMEvt)
+bool FuConstruct::MouseMove(const MouseEvent& rMEvt)
{
FuDraw::MouseMove(rMEvt);
if (aDragTimer.IsActive() )
{
if( bFirstMouseMove )
- bFirstMouseMove = sal_False;
+ bFirstMouseMove = false;
else
aDragTimer.Stop();
}
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt( mpWindow->PixelToLogic(aPix) );
-
if ( mpView->IsAction() )
{
+ const basegfx::B2DPoint aPix(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPix);
+
ForceScroll(aPix);
- mpView->MovAction(aPnt);
+ mpView->MovAction(aLogicPos);
}
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -159,28 +159,29 @@ sal_Bool FuConstruct::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_True;
+ bool bReturn = true;
if (aDragTimer.IsActive() )
{
aDragTimer.Stop();
- bIsInDragMode = sal_False;
+ bIsInDragMode = false;
}
FuDraw::MouseButtonUp(rMEvt);
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aPnt(mpWindow->GetInverseViewTransformation() * aPixelPos);
if ( mpView && mpView->IsDragObj() )
{
FrameView* pFrameView = mpViewShell->GetFrameView();
- sal_Bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
+ bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
if (bDragWithCopy)
{
- bDragWithCopy = !mpView->IsPresObjSelected(sal_False, sal_True);
+ bDragWithCopy = !mpView->IsPresObjSelected(false, true);
}
mpView->SetDragWithCopy(bDragWithCopy);
@@ -192,7 +193,7 @@ sal_Bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
}
else
{
- bReturn = sal_False;
+ bReturn = false;
}
if ( mpView && !mpView->IsAction() )
@@ -200,34 +201,27 @@ sal_Bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
mpWindow->ReleaseMouse();
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- if ( !mpView->AreObjectsMarked() )
+ if ( !mpView->areSdrObjectsSelected() )
{
SdrObject* pObj;
- SdrPageView* pPV;
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
- if (!mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV))
+ if (!mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj))
{
- mpView->MarkObj(aPnt, nHitLog);
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ mpView->MarkObj(aPnt, fHitLog);
}
mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
}
else if (rMEvt.IsLeft() && !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() &&
!bSelectionChanged &&
- Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
- Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
+ fabs(aPnt.getX() - aMDPos.getX()) < nDrgLog &&
+ fabs(aPnt.getY() - aMDPos.getY()) < nDrgLog)
{
/**************************************************************
* Toggle zw. Selektion und Rotation
**************************************************************/
- SdrObject* pSingleObj = NULL;
- sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount();
-
- if (nMarkCount==1)
- {
- pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- }
+ const SdrObject* pSingleObj = mpView->getSelectedIfSingle();
if (mpView->GetDragMode() == SDRDRAG_MOVE && mpView->IsRotateAllowed() &&
(mpViewShell->GetFrameView()->IsClickChangeRotation() ||
@@ -249,7 +243,8 @@ sal_Bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
{
DoubleClick(rMEvt);
}
- bMBDown = sal_False;
+
+ bMBDown = false;
return bReturn;
}
@@ -258,14 +253,14 @@ sal_Bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuConstruct::KeyInput(const KeyEvent& rKEvt)
+bool FuConstruct::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if ( !bReturn )
bReturn = FuDraw::KeyInput(rKEvt);
@@ -281,7 +276,7 @@ sal_Bool FuConstruct::KeyInput(const KeyEvent& rKEvt)
void FuConstruct::Activate()
{
- mpView->SetEditMode(SDREDITMODE_CREATE);
+ mpView->SetViewEditMode(SDREDITMODE_CREATE);
FuDraw::Activate();
}
@@ -294,7 +289,7 @@ void FuConstruct::Activate()
void FuConstruct::Deactivate()
{
FuDraw::Deactivate();
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
}
/*************************************************************************
@@ -383,27 +378,30 @@ void FuConstruct::SetStyleSheet(SfxItemSet& rAttr, SdrObject* pObj)
void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj,
const sal_Bool bForceFillStyle, const sal_Bool bForceNoFillStyle )
{
- SdPage* pPage = (SdPage*)mpView->GetSdrPageView()->GetPage();
- if ( pPage->IsMasterPage() && pPage->GetPageKind() == PK_STANDARD &&
+ SdrPageView* pPV = mpView->GetSdrPageView();
+
+ if(pPV)
+ {
+ SdPage& rPage = (SdPage&)pPV->getSdrPageFromSdrPageView();
+ if ( rPage.IsMasterPage() && rPage.GetPageKind() == PK_STANDARD &&
mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS )
{
/**********************************************
* Objects was created on the slide master page
***********************************************/
- String aName( pPage->GetLayoutName() );
+ String aName( rPage.GetLayoutName() );
String aSep = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ) );
sal_uInt16 n = aName.Search(aSep);
n = n + aSep.Len();
aName.Erase(n);
aName.Append( String ( SdResId( STR_LAYOUT_BACKGROUNDOBJECTS ) ) );
- SfxStyleSheet* pSheet = (SfxStyleSheet*)pPage->GetModel()->
- GetStyleSheetPool()->
- Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
+ SfxStyleSheet* pSheet = (SfxStyleSheet*)rPage.getSdrModelFromSdrPage().GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
DBG_ASSERT(pSheet, "Objektvorlage nicht gefunden");
+
if (pSheet)
{
// applying style sheet for background objects
- pObj->SetStyleSheet(pSheet, sal_False);
+ pObj->SetStyleSheet(pSheet, false);
SfxItemSet& rSet = pSheet->GetItemSet();
const XFillStyleItem& rFillStyle = (const XFillStyleItem&)rSet.Get(XATTR_FILLSTYLE);
if ( bForceFillStyle )
@@ -426,22 +424,22 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj,
if ( bForceNoFillStyle )
{
String aName(SdResId(STR_POOLSHEET_OBJWITHOUTFILL));
- SfxStyleSheet* pSheet = (SfxStyleSheet*)pPage->GetModel()->
- GetStyleSheetPool()->
- Find(aName, SD_STYLE_FAMILY_GRAPHICS);
+ SfxStyleSheet* pSheet = (SfxStyleSheet*)rPage.getSdrModelFromSdrPage().GetStyleSheetPool()->Find(aName, SD_STYLE_FAMILY_GRAPHICS);
DBG_ASSERT(pSheet, "Objektvorlage nicht gefunden");
+
if (pSheet)
{
- pObj->SetStyleSheet(pSheet, sal_False);
- SfxItemSet aAttr(*mpView->GetDefaultAttr().Clone());
- aAttr.Put(pSheet->GetItemSet().Get(XATTR_FILLSTYLE));
- pObj->SetMergedItemSet(aAttr);
- }
- else
- {
- SfxItemSet aAttr(*mpView->GetDefaultAttr().Clone());
- rAttr.Put(XFillStyleItem(XFILL_NONE));
- pObj->SetMergedItemSet(aAttr);
+ pObj->SetStyleSheet(pSheet, false);
+ SfxItemSet aAttr(*mpView->GetDefaultAttr().Clone());
+ aAttr.Put(pSheet->GetItemSet().Get(XATTR_FILLSTYLE));
+ pObj->SetMergedItemSet(aAttr);
+ }
+ else
+ {
+ SfxItemSet aAttr(*mpView->GetDefaultAttr().Clone());
+ rAttr.Put(XFillStyleItem(XFILL_NONE));
+ pObj->SetMergedItemSet(aAttr);
+ }
}
}
}
diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx
index f41b56f4ee09..301a0d98ab61 100644
--- a/sd/source/ui/func/fuconuno.cxx
+++ b/sd/source/ui/func/fuconuno.cxx
@@ -30,15 +30,11 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/request.hxx>
#include <svl/intitem.hxx>
-
-
#include <svx/fmglob.hxx>
-
#include <svx/dialogs.hrc>
-
+#include <svx/svdlegacy.hxx>
class SbModule;
-
#include "app.hrc"
#include "glob.hrc"
#include "ViewShell.hxx"
@@ -54,8 +50,6 @@ class SbModule;
namespace sd {
-TYPEINIT1( FuConstructUnoControl, FuConstruct );
-
/*************************************************************************
|*
|* Konstruktor
@@ -85,8 +79,8 @@ void FuConstructUnoControl::DoExecute( SfxRequest& rReq )
{
FuConstruct::DoExecute( rReq );
- SFX_REQUEST_ARG( rReq, pInventorItem, SfxUInt32Item, SID_FM_CONTROL_INVENTOR, sal_False );
- SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER, sal_False );
+ SFX_REQUEST_ARG( rReq, pInventorItem, SfxUInt32Item, SID_FM_CONTROL_INVENTOR );
+ SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER );
if( pInventorItem )
nInventor = pInventorItem->GetValue();
if( pIdentifierItem )
@@ -102,17 +96,19 @@ void FuConstructUnoControl::DoExecute( SfxRequest& rReq )
|* MouseButtonDown-event
|*
\************************************************************************/
-sal_Bool FuConstructUnoControl::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuConstructUnoControl::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
+ bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
if ( rMEvt.IsLeft() && !mpView->IsAction() )
{
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
+
mpWindow->CaptureMouse();
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- mpView->BegCreateObj(aPnt, (OutputDevice*) NULL, nDrgLog);
- bReturn = sal_True;
+ const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
+ mpView->BegCreateObj(aLogicPos, fTolerance);
+ bReturn = true;
}
return bReturn;
}
@@ -122,7 +118,7 @@ sal_Bool FuConstructUnoControl::MouseButtonDown(const MouseEvent& rMEvt)
|* MouseMove-event
|*
\************************************************************************/
-sal_Bool FuConstructUnoControl::MouseMove(const MouseEvent& rMEvt)
+bool FuConstructUnoControl::MouseMove(const MouseEvent& rMEvt)
{
return FuConstruct::MouseMove(rMEvt);
}
@@ -132,15 +128,15 @@ sal_Bool FuConstructUnoControl::MouseMove(const MouseEvent& rMEvt)
|* MouseButtonUp-event
|*
\************************************************************************/
-sal_Bool FuConstructUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuConstructUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
- if ( mpView->IsCreateObj() && rMEvt.IsLeft() )
+ if ( mpView->GetCreateObj() && rMEvt.IsLeft() )
{
Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
mpView->EndCreateObj(SDRCREATE_FORCEEND);
- bReturn = sal_True;
+ bReturn = true;
}
bReturn = (FuConstruct::MouseButtonUp(rMEvt) || bReturn);
@@ -155,13 +151,13 @@ sal_Bool FuConstructUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuConstructUnoControl::KeyInput(const KeyEvent& rKEvt)
+bool FuConstructUnoControl::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
+ bool bReturn = FuConstruct::KeyInput(rKEvt);
return(bReturn);
}
@@ -172,7 +168,7 @@ sal_Bool FuConstructUnoControl::KeyInput(const KeyEvent& rKEvt)
\************************************************************************/
void FuConstructUnoControl::Activate()
{
- mpView->SetCurrentObj( nIdentifier, nInventor );
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(nIdentifier, nInventor));
aNewPointer = Pointer(POINTER_DRAW_RECT);
aOldPointer = mpWindow->GetPointer();
@@ -198,17 +194,17 @@ void FuConstructUnoControl::Deactivate()
}
// #97016#
-SdrObject* FuConstructUnoControl::CreateDefaultObject(const sal_uInt16, const Rectangle& rRectangle)
+SdrObject* FuConstructUnoControl::CreateDefaultObject(const sal_uInt16, const basegfx::B2DRange& rRange)
{
// case SID_FM_CREATE_CONTROL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- 0L, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->getSdrObjectCreationInfo());
if(pObj)
{
- pObj->SetLogicRect(rRectangle);
+ sdr::legacy::SetLogicRange(*pObj, rRange);
}
return pObj;
diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx
index 70188a95c6f0..c8e4eec75574 100644
--- a/sd/source/ui/func/fucopy.cxx
+++ b/sd/source/ui/func/fucopy.cxx
@@ -49,8 +49,6 @@
#include "copydlg.hrc"
namespace sd {
-TYPEINIT1( FuCopy, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -76,10 +74,11 @@ FunctionReference FuCopy::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::
void FuCopy::DoExecute( SfxRequest& rReq )
{
- if( mpView->AreObjectsMarked() )
+ if( mpView->areSdrObjectsSelected() )
{
// Undo
- String aString( mpView->GetDescriptionOfMarkedObjects() );
+ const SdrObjectVector aInitialSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
+ String aString(getSelectionDescription(aInitialSelection));
aString.Append( sal_Unicode(' ') );
aString.Append( String( SdResId( STR_UNDO_COPYOBJECTS ) ) );
mpView->BegUndo( aString );
@@ -92,16 +91,16 @@ void FuCopy::DoExecute( SfxRequest& rReq )
ATTR_COPY_START, ATTR_COPY_END, 0 );
// Farb-Attribut angeben
- SfxItemSet aAttr( mpDoc->GetPool() );
+ SfxItemSet aAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aAttr );
const SfxPoolItem* pPoolItem = NULL;
- if( SFX_ITEM_SET == aAttr.GetItemState( XATTR_FILLSTYLE, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == aAttr.GetItemState( XATTR_FILLSTYLE, true, &pPoolItem ) )
{
XFillStyle eStyle = ( ( const XFillStyleItem* ) pPoolItem )->GetValue();
if( eStyle == XFILL_SOLID &&
- SFX_ITEM_SET == aAttr.GetItemState( XATTR_FILLCOLOR, sal_True, &pPoolItem ) )
+ SFX_ITEM_SET == aAttr.GetItemState( XATTR_FILLCOLOR, true, &pPoolItem ) )
{
const XFillColorItem* pItem = ( const XFillColorItem* ) pPoolItem;
XColorItem aXColorItem( ATTR_COPY_START_COLOR, pItem->GetName(),
@@ -139,51 +138,72 @@ void FuCopy::DoExecute( SfxRequest& rReq )
}
}
- Rectangle aRect;
- sal_Int32 lWidth = 0, lHeight = 0, lSizeX = 0L, lSizeY = 0L, lAngle = 0L;
- sal_uInt16 nNumber = 0;
+ basegfx::B2DRange aRange;
+ double lWidth(0.0);
+ double lHeight(0.0);
+ double lSizeX(0.0);
+ double lSizeY(0.0);
+ double lAngle(0.0);
+ sal_uInt16 nNumber(0);
Color aStartColor, aEndColor;
- sal_Bool bColor = sal_False;
- const SfxPoolItem* pPoolItem = NULL;
+ bool bColor(false);
+ const SfxPoolItem* pPoolItem = 0;
// Anzahl
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_NUMBER, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_NUMBER, true, &pPoolItem ) )
+ {
nNumber = ( ( const SfxUInt16Item* ) pPoolItem )->GetValue();
+ }
// Verschiebung
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_X, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) )
+ {
lSizeX = ( ( const SfxInt32Item* ) pPoolItem )->GetValue();
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_Y, sal_True, &pPoolItem ) )
+ }
+
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) )
+ {
lSizeY = ( ( const SfxInt32Item* ) pPoolItem )->GetValue();
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_ANGLE, sal_True, &pPoolItem ) )
- lAngle = ( ( const SfxInt32Item* )pPoolItem )->GetValue();
+ }
+
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) )
+ {
+ const sal_Int32 nAngle(((const SfxInt32Item*)pPoolItem)->GetValue());
+ lAngle = (((360 - nAngle) % 360) * F_PI) / 180.0;
+ }
// Verrgroesserung / Verkleinerung
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_WIDTH, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) )
+ {
lWidth = ( ( const SfxInt32Item* ) pPoolItem )->GetValue();
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_HEIGHT, sal_True, &pPoolItem ) )
+ }
+
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) )
+ {
lHeight = ( ( const SfxInt32Item* ) pPoolItem )->GetValue();
+ }
// Startfarbe / Endfarbe
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_START_COLOR, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) )
{
aStartColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
- bColor = sal_True;
+ bColor = true;
}
- if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_END_COLOR, sal_True, &pPoolItem ) )
+
+ if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_END_COLOR, true, &pPoolItem ) )
{
aEndColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue();
+
if( aStartColor == aEndColor )
- bColor = sal_False;
+ bColor = false;
}
else
- bColor = sal_False;
-
- // Handles wegnehmen
- //HMHmpView->HideMarkHdl();
+ {
+ bColor = false;
+ }
SfxProgress* pProgress = NULL;
- sal_Bool bWaiting = sal_False;
+ bool bWaiting = false;
if( nNumber > 1 )
{
@@ -192,86 +212,88 @@ void FuCopy::DoExecute( SfxRequest& rReq )
aStr.Append( String( SdResId( STR_UNDO_COPYOBJECTS ) ) );
pProgress = new SfxProgress( mpDocSh, aStr, nNumber );
- mpDocSh->SetWaitCursor( sal_True );
- bWaiting = sal_True;
+ mpDocSh->SetWaitCursor( true );
+ bWaiting = true;
}
- const SdrMarkList aMarkList( mpView->GetMarkedObjectList() );
- const sal_uLong nMarkCount = aMarkList.GetMarkCount();
- SdrObject* pObj = NULL;
-
// Anzahl moeglicher Kopien berechnen
- aRect = mpView->GetAllMarkedRect();
+ aRange = mpView->getMarkedObjectSnapRange();
- if( lWidth < 0L )
+ if( lWidth < 0.0 )
{
- long nTmp = ( aRect.Right() - aRect.Left() ) / -lWidth;
- nNumber = (sal_uInt16) Min( nTmp, (long)nNumber );
+ const double fTmp(aRange.getWidth() / -lWidth);
+ nNumber = std::min((sal_uInt16)basegfx::fround(fTmp), nNumber);
}
- if( lHeight < 0L )
+ if( lHeight < 0.0 )
{
- long nTmp = ( aRect.Bottom() - aRect.Top() ) / -lHeight;
- nNumber = (sal_uInt16) Min( nTmp, (long)nNumber );
+ const double fTmp(aRange.getHeight() / -lHeight);
+ nNumber = std::min((sal_uInt16)basegfx::fround(fTmp), nNumber);
}
- for( sal_uInt16 i = 1; i <= nNumber; i++ )
+ for( sal_uInt16 i(1); i <= nNumber; i++ )
{
if( pProgress )
+ {
pProgress->SetState( i );
+ }
- aRect = mpView->GetAllMarkedRect();
+ aRange = mpView->getMarkedObjectSnapRange();
if( ( 1 == i ) && bColor )
{
SfxItemSet aNewSet( mpViewShell->GetPool(), XATTR_FILLSTYLE, XATTR_FILLCOLOR, 0L );
+
aNewSet.Put( XFillStyleItem( XFILL_SOLID ) );
aNewSet.Put( XFillColorItem( String(), aStartColor ) );
mpView->SetAttributes( aNewSet );
}
// make a copy of selected objects
- mpView->CopyMarked();
+ mpView->CopyMarkedObj();
// get newly selected objects
- SdrMarkList aCopyMarkList( mpView->GetMarkedObjectList() );
- sal_uLong j, nCopyMarkCount = aMarkList.GetMarkCount();
+ const SdrObjectVector aSelectedSdrObjects(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt32 j;
// set protection flags at marked copies to null
- for( j = 0; j < nCopyMarkCount; j++ )
+ for(j = 0; j < aSelectedSdrObjects.size(); j++)
{
- pObj = aCopyMarkList.GetMark( j )->GetMarkedSdrObj();
+ SdrObject* pObj = aSelectedSdrObjects[j];
- if( pObj )
- {
- pObj->SetMoveProtect( sal_False );
- pObj->SetResizeProtect( sal_False );
- }
+ pObj->SetMoveProtect(false);
+ pObj->SetResizeProtect(false);
}
- Fraction aWidth( aRect.Right() - aRect.Left() + lWidth, aRect.Right() - aRect.Left() );
- Fraction aHeight( aRect.Bottom() - aRect.Top() + lHeight, aRect.Bottom() - aRect.Top() );
-
if( mpView->IsResizeAllowed() )
- mpView->ResizeAllMarked( aRect.TopLeft(), aWidth, aHeight );
+ {
+ const basegfx::B2DVector aScale(
+ (aRange.getWidth() + lWidth) / (basegfx::fTools::equalZero(aRange.getWidth()) ? 1.0 : aRange.getWidth()),
+ (aRange.getHeight() + lHeight) / (basegfx::fTools::equalZero(aRange.getHeight()) ? 1.0 : aRange.getHeight()));
+
+ mpView->ResizeMarkedObj(aRange.getMinimum(), aScale);
+ }
if( mpView->IsRotateAllowed() )
- mpView->RotateAllMarked( aRect.Center(), lAngle * 100 );
+ {
+ mpView->RotateMarkedObj(aRange.getCenter(), lAngle);
+ }
if( mpView->IsMoveAllowed() )
- mpView->MoveAllMarked( Size( lSizeX, lSizeY ) );
+ {
+ mpView->MoveMarkedObj(basegfx::B2DVector(lSizeX, lSizeY));
+ }
// set protection flags at marked copies to original values
- if( nMarkCount == nCopyMarkCount )
+ if(aInitialSelection.size() == aSelectedSdrObjects.size())
{
- for( j = 0; j < nMarkCount; j++ )
+ for(j = 0; j < aInitialSelection.size(); j++)
{
- SdrObject* pSrcObj = aMarkList.GetMark( j )->GetMarkedSdrObj();
- SdrObject* pDstObj = aCopyMarkList.GetMark( j )->GetMarkedSdrObj();
+ SdrObject* pSrcObj = aInitialSelection[j];
+ SdrObject* pDstObj = aSelectedSdrObjects[j];
- if( pSrcObj && pDstObj &&
- ( pSrcObj->GetObjInventor() == pDstObj->GetObjInventor() ) &&
- ( pSrcObj->GetObjIdentifier() == pDstObj->GetObjIdentifier() ) )
+ if(pSrcObj->GetObjInventor() == pDstObj->GetObjInventor()
+ && pSrcObj->GetObjIdentifier() == pDstObj->GetObjIdentifier())
{
pDstObj->SetMoveProtect( pSrcObj->IsMoveProtect() );
pDstObj->SetResizeProtect( pSrcObj->IsResizeProtect() );
@@ -295,14 +317,17 @@ void FuCopy::DoExecute( SfxRequest& rReq )
}
if ( pProgress )
+ {
delete pProgress;
+ }
if ( bWaiting )
- mpDocSh->SetWaitCursor( sal_False );
+ {
+ mpDocSh->SetWaitCursor( false );
+ }
- // Handles zeigen
- mpView->AdjustMarkHdl(); //HMH sal_True );
- //HMHpView->ShowMarkHdl();
+ // adapt handles
+ mpView->SetMarkHandles();
mpView->EndUndo();
}
diff --git a/sd/source/ui/func/fucushow.cxx b/sd/source/ui/func/fucushow.cxx
index d0655ebe9176..bba2d23e0d17 100644
--- a/sd/source/ui/func/fucushow.cxx
+++ b/sd/source/ui/func/fucushow.cxx
@@ -41,9 +41,6 @@
namespace sd {
-TYPEINIT1( FuCustomShowDlg, FuPoor );
-
-
/*************************************************************************
|*
|* Konstruktor
@@ -76,7 +73,7 @@ void FuCustomShowDlg::DoExecute( SfxRequest& )
sal_uInt16 nRet = pDlg->Execute();
if( pDlg->IsModified() )
{
- mpDoc->SetChanged( sal_True );
+ mpDoc->SetChanged( true );
sd::PresentationSettings& rSettings = mpDoc->getPresentationSettings();
rSettings.mbCustomShow = pDlg->IsCustomShow();
}
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index e72c29852d6a..82ab8ebafdb5 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -27,7 +27,6 @@
#include <sot/object.hxx>
#include <editeng/eeitem.hxx>
#include <vcl/waitobj.hxx>
-
#include <editeng/flditem.hxx>
#include <svx/svdogrp.hxx>
#include <tools/urlobj.hxx>
@@ -41,11 +40,9 @@
#include <svtools/imapobj.hxx>
#include <svx/svxids.hrc>
#include <svx/obj3d.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/svdpagv.hxx>
-
#include <sfx2/viewfrm.hxx>
-
+#include <svx/svdlegacy.hxx>
#include "anminfo.hxx"
#include "anmdef.hxx"
#include "imapinfo.hxx"
@@ -53,7 +50,6 @@
#include "glob.hrc"
#include "strings.hrc"
#include "res_bmp.hrc"
-
#include "app.hxx"
#include "GraphicDocShell.hxx"
#include "fudraw.hxx"
@@ -73,13 +69,12 @@
#include <vcl/msgbox.hxx>
#include "slideshow.hxx"
#include <svx/sdrhittesthelper.hxx>
+#include <svx/scene3d.hxx>
using namespace ::com::sun::star;
namespace sd {
-TYPEINIT1( FuDraw, FuPoor );
-
/*************************************************************************
|*
|* Base-class for all drawmodul-specific functions
@@ -89,9 +84,9 @@ TYPEINIT1( FuDraw, FuPoor );
FuDraw::FuDraw(ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView,
SdDrawDocument* pDoc, SfxRequest& rReq) :
FuPoor(pViewSh, pWin, pView, pDoc, rReq),
- bMBDown(sal_False),
- bDragHelpLine(sal_False),
- bPermanent(sal_False)
+ bMBDown(false),
+ bDragHelpLine(false),
+ bPermanent(false)
{
}
@@ -112,36 +107,31 @@ FuDraw::~FuDraw()
|*
\************************************************************************/
-sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
+ bool bReturn = false;
+ bDragHelpLine = false;
- sal_Bool bReturn = sal_False;
-
- bDragHelpLine = sal_False;
-
- aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ aMDPos = mpWindow->GetInverseViewTransformation() * aPixelPos;
if ( rMEvt.IsLeft() )
{
FrameView* pFrameView = mpViewShell->GetFrameView();
-
-// sal_Bool bOrtho = mpView->IsOrthoDesired() || pFrameView->IsOrtho();
-// bOrtho = bOrtho != rMEvt.IsShift();
- sal_Bool bOrtho = sal_False;
-
- sal_Bool bRestricted = sal_True;
+ bool bOrtho = false;
+ bool bRestricted = true;
if (mpView->IsDragObj())
{
// object is dragged (move, resize,...)
- const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
+ const SdrHdl* pHdl = mpView->GetDragStat().GetActiveHdl();
if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
{
// Move
- bRestricted = sal_False;
+ bRestricted = false;
}
}
@@ -154,58 +144,58 @@ sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
}
else
{
- bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
+ bOrtho = (bool)rMEvt.IsShift() != pFrameView->IsOrthogonal();
}
if (!mpView->IsSnapEnabled())
- mpView->SetSnapEnabled(sal_True);
- sal_Bool bSnapModPressed = rMEvt.IsMod1();
+ mpView->SetSnapEnabled(true);
- sal_Bool bGridSnap = pFrameView->IsGridSnap();
+ const bool bSnapModPressed = rMEvt.IsMod1();
+ bool bGridSnap = pFrameView->IsGridSnap();
bGridSnap = (bSnapModPressed != bGridSnap);
if (mpView->IsGridSnap() != bGridSnap)
mpView->SetGridSnap(bGridSnap);
- sal_Bool bBordSnap = pFrameView->IsBordSnap();
+ bool bBordSnap = pFrameView->IsBorderSnap();
bBordSnap = (bSnapModPressed != bBordSnap);
- if (mpView->IsBordSnap() != bBordSnap)
- mpView->SetBordSnap(bBordSnap);
+ if (mpView->IsBorderSnap() != bBordSnap)
+ mpView->SetBorderSnap(bBordSnap);
- sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
+ bool bHlplSnap = pFrameView->IsHelplineSnap();
bHlplSnap = (bSnapModPressed != bHlplSnap);
- if (mpView->IsHlplSnap() != bHlplSnap)
- mpView->SetHlplSnap(bHlplSnap);
+ if (mpView->IsHelplineSnap() != bHlplSnap)
+ mpView->SetHelplineSnap(bHlplSnap);
- sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
+ bool bOFrmSnap = pFrameView->IsOFrameSnap();
bOFrmSnap = (bSnapModPressed != bOFrmSnap);
- if (mpView->IsOFrmSnap() != bOFrmSnap)
- mpView->SetOFrmSnap(bOFrmSnap);
+ if (mpView->IsOFrameSnap() != bOFrmSnap)
+ mpView->SetOFrameSnap(bOFrmSnap);
- sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
+ bool bOPntSnap = pFrameView->IsOPointSnap();
bOPntSnap = (bSnapModPressed != bOPntSnap);
- if (mpView->IsOPntSnap() != bOPntSnap)
- mpView->SetOPntSnap(bOPntSnap);
+ if (mpView->IsOPointSnap() != bOPntSnap)
+ mpView->SetOPointSnap(bOPntSnap);
- sal_Bool bOConSnap = pFrameView->IsOConSnap();
+ bool bOConSnap = pFrameView->IsOConnectorSnap();
bOConSnap = (bSnapModPressed != bOConSnap);
- if (mpView->IsOConSnap() != bOConSnap)
- mpView->SetOConSnap(bOConSnap);
+ if (mpView->IsOConnectorSnap() != bOConSnap)
+ mpView->SetOConnectorSnap(bOConSnap);
- sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
+ bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
if (mpView->IsAngleSnapEnabled() != bAngleSnap)
mpView->SetAngleSnapEnabled(bAngleSnap);
- if (mpView->IsOrtho() != bOrtho)
- mpView->SetOrtho(bOrtho);
+ if (mpView->IsOrthogonal() != bOrtho)
+ mpView->SetOrthogonal(bOrtho);
- sal_Bool bCenter = rMEvt.IsMod2();
+ bool bCenter = rMEvt.IsMod2();
if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
mpView->IsResizeAtCenter() != bCenter )
@@ -214,23 +204,22 @@ sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
mpView->SetResizeAtCenter(bCenter);
}
- SdrPageView* pPV = 0;
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
// #76572# look only for HelpLines when they are visible (!)
- sal_Bool bHelpLine(sal_False);
+ bool bHelpLine(false);
if(mpView->IsHlplVisible())
- bHelpLine = mpView->PickHelpLine(aMDPos, nHitLog, *mpWindow, nHelpLine, pPV);
- sal_Bool bHitHdl = (mpView->PickHandle(aMDPos) != NULL);
+ bHelpLine = mpView->PickHelpLine(aMDPos, fHitLog, nHelpLine);
+ bool bHitHdl = (mpView->PickHandle(aMDPos) != NULL);
if ( bHelpLine
- && !mpView->IsCreateObj()
- && ((mpView->GetEditMode() == SDREDITMODE_EDIT && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) )
+ && !mpView->GetCreateObj()
+ && ((SDREDITMODE_EDIT == mpView->GetViewEditMode() && !bHitHdl) || (rMEvt.IsShift() && bSnapModPressed)) )
{
mpWindow->CaptureMouse();
- mpView->BegDragHelpLine(nHelpLine, pPV);
+ mpView->BegDragHelpLine(nHelpLine);
bDragHelpLine = mpView->IsDragHelpLine();
- bReturn = sal_True;
+ bReturn = true;
}
}
ForcePointer(&rMEvt);
@@ -244,26 +233,23 @@ sal_Bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
+bool FuDraw::MouseMove(const MouseEvent& rMEvt)
{
FrameView* pFrameView = mpViewShell->GetFrameView();
- Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
-
-// sal_Bool bOrtho = mpView->IsOrthoDesired() || pFrameView->IsOrtho();
-// bOrtho = bOrtho != rMEvt.IsShift();
- sal_Bool bOrtho = sal_False;
-
- sal_Bool bRestricted = sal_True;
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
+ bool bOrtho = false;
+ bool bRestricted = true;
if (mpView->IsDragObj())
{
// object is dragged (move, resize, ...)
- const SdrHdl* pHdl = mpView->GetDragStat().GetHdl();
+ const SdrHdl* pHdl = mpView->GetDragStat().GetActiveHdl();
if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
{
// Move
- bRestricted = sal_False;
+ bRestricted = false;
}
}
@@ -278,57 +264,57 @@ sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
}
else
{
- bOrtho = rMEvt.IsShift() != pFrameView->IsOrtho();
+ bOrtho = (bool)rMEvt.IsShift() != pFrameView->IsOrthogonal();
}
- sal_Bool bSnapModPressed = rMEvt.IsMod2();
+ const bool bSnapModPressed = rMEvt.IsMod2();
mpView->SetDragWithCopy(rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
- sal_Bool bGridSnap = pFrameView->IsGridSnap();
+ bool bGridSnap = pFrameView->IsGridSnap();
bGridSnap = (bSnapModPressed != bGridSnap);
if (mpView->IsGridSnap() != bGridSnap)
mpView->SetGridSnap(bGridSnap);
- sal_Bool bBordSnap = pFrameView->IsBordSnap();
+ bool bBordSnap = pFrameView->IsBorderSnap();
bBordSnap = (bSnapModPressed != bBordSnap);
- if (mpView->IsBordSnap() != bBordSnap)
- mpView->SetBordSnap(bBordSnap);
+ if (mpView->IsBorderSnap() != bBordSnap)
+ mpView->SetBorderSnap(bBordSnap);
- sal_Bool bHlplSnap = pFrameView->IsHlplSnap();
+ bool bHlplSnap = pFrameView->IsHelplineSnap();
bHlplSnap = (bSnapModPressed != bHlplSnap);
- if (mpView->IsHlplSnap() != bHlplSnap)
- mpView->SetHlplSnap(bHlplSnap);
+ if (mpView->IsHelplineSnap() != bHlplSnap)
+ mpView->SetHelplineSnap(bHlplSnap);
- sal_Bool bOFrmSnap = pFrameView->IsOFrmSnap();
+ bool bOFrmSnap = pFrameView->IsOFrameSnap();
bOFrmSnap = (bSnapModPressed != bOFrmSnap);
- if (mpView->IsOFrmSnap() != bOFrmSnap)
- mpView->SetOFrmSnap(bOFrmSnap);
+ if (mpView->IsOFrameSnap() != bOFrmSnap)
+ mpView->SetOFrameSnap(bOFrmSnap);
- sal_Bool bOPntSnap = pFrameView->IsOPntSnap();
+ bool bOPntSnap = pFrameView->IsOPointSnap();
bOPntSnap = (bSnapModPressed != bOPntSnap);
- if (mpView->IsOPntSnap() != bOPntSnap)
- mpView->SetOPntSnap(bOPntSnap);
+ if (mpView->IsOPointSnap() != bOPntSnap)
+ mpView->SetOPointSnap(bOPntSnap);
- sal_Bool bOConSnap = pFrameView->IsOConSnap();
+ bool bOConSnap = pFrameView->IsOConnectorSnap();
bOConSnap = (bSnapModPressed != bOConSnap);
- if (mpView->IsOConSnap() != bOConSnap)
- mpView->SetOConSnap(bOConSnap);
+ if (mpView->IsOConnectorSnap() != bOConSnap)
+ mpView->SetOConnectorSnap(bOConSnap);
- sal_Bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
+ bool bAngleSnap = rMEvt.IsShift() == !pFrameView->IsAngleSnapEnabled();
if (mpView->IsAngleSnapEnabled() != bAngleSnap)
mpView->SetAngleSnapEnabled(bAngleSnap);
- if (mpView->IsOrtho() != bOrtho)
- mpView->SetOrtho(bOrtho);
+ if (mpView->IsOrthogonal() != bOrtho)
+ mpView->SetOrthogonal(bOrtho);
- sal_Bool bCenter = rMEvt.IsMod2();
+ bool bCenter = rMEvt.IsMod2();
if ( mpView->IsCreate1stPointAsCenter() != bCenter ||
mpView->IsResizeAtCenter() != bCenter )
@@ -338,16 +324,16 @@ sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
}
if ( mpView->IsDragHelpLine() )
- mpView->MovDragHelpLine(aPos);
+ mpView->MovDragHelpLine(aLogicPos);
}
- sal_Bool bReturn = mpView->MouseMove(rMEvt, mpWindow);
+ bool bReturn = mpView->MouseMove(rMEvt, mpWindow);
if (mpView->IsAction())
{
// Because the flag set back if necessary in MouseMove
- if (mpView->IsOrtho() != bOrtho)
- mpView->SetOrtho(bOrtho);
+ if (mpView->IsOrthogonal() != bOrtho)
+ mpView->SetOrthogonal(bOrtho);
}
ForcePointer(&rMEvt);
@@ -361,7 +347,7 @@ sal_Bool FuDraw::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
{
if ( mpView->IsDragHelpLine() )
mpView->EndDragHelpLine();
@@ -370,44 +356,46 @@ sal_Bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
{
Rectangle aOutputArea(Point(0,0), mpWindow->GetOutputSizePixel());
- if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) )
+ if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) && mpView->GetSdrPageView())
+ {
mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine);
+ }
mpWindow->ReleaseMouse();
}
FrameView* pFrameView = mpViewShell->GetFrameView();
- mpView->SetOrtho( pFrameView->IsOrtho() );
+ mpView->SetOrthogonal( pFrameView->IsOrthogonal() );
mpView->SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
- mpView->SetSnapEnabled(sal_True);
- mpView->SetCreate1stPointAsCenter(sal_False);
- mpView->SetResizeAtCenter(sal_False);
+ mpView->SetSnapEnabled(true);
+ mpView->SetCreate1stPointAsCenter(false);
+ mpView->SetResizeAtCenter(false);
mpView->SetDragWithCopy(pFrameView->IsDragWithCopy());
mpView->SetGridSnap(pFrameView->IsGridSnap());
- mpView->SetBordSnap(pFrameView->IsBordSnap());
- mpView->SetHlplSnap(pFrameView->IsHlplSnap());
- mpView->SetOFrmSnap(pFrameView->IsOFrmSnap());
- mpView->SetOPntSnap(pFrameView->IsOPntSnap());
- mpView->SetOConSnap(pFrameView->IsOConSnap());
+ mpView->SetBorderSnap(pFrameView->IsBorderSnap());
+ mpView->SetHelplineSnap(pFrameView->IsHelplineSnap());
+ mpView->SetOFrameSnap(pFrameView->IsOFrameSnap());
+ mpView->SetOPointSnap(pFrameView->IsOPointSnap());
+ mpView->SetOConnectorSnap(pFrameView->IsOConnectorSnap());
- bIsInDragMode = sal_False;
+ bIsInDragMode = false;
ForcePointer(&rMEvt);
FuPoor::MouseButtonUp(rMEvt);
- return sal_False;
+ return false;
}
/*************************************************************************
|*
|* Process keyboard-events
|*
-|* When processing a KeyEvent the returnvalue is sal_True, otherwise sal_False.
+|* When processing a KeyEvent the returnvalue is true, otherwise false.
|*
\************************************************************************/
-sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
+bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
switch ( rKEvt.GetKeyCode().GetCode() )
{
@@ -422,7 +410,7 @@ sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
if (!mpDocSh->IsReadOnly())
{
- if ( mpView && mpView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
+ if ( mpView && mpView->IsPresObjSelected(false, true, false, true) )
{
InfoBox(mpWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
}
@@ -448,7 +436,7 @@ sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
mpView->DeleteMarked();
}
}
- bReturn = sal_True;
+ bReturn = true;
}
break;
@@ -477,10 +465,12 @@ sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
}
// #97016# II
- if(mpView->AreObjectsMarked())
- mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
+ if(mpView->areSdrObjectsSelected())
+ {
+ mpView->MakeVisibleAtView(mpView->getMarkedObjectSnapRange(), *mpWindow);
+ }
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -493,13 +483,15 @@ sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// #97016# mark last object
mpView->UnmarkAllObj();
- mpView->MarkNextObj(sal_False);
+ mpView->MarkNextObj(false);
// #97016# II
- if(mpView->AreObjectsMarked())
- mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
+ if(mpView->areSdrObjectsSelected())
+ {
+ mpView->MakeVisibleAtView(mpView->getMarkedObjectSnapRange(), *mpWindow);
+ }
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -512,13 +504,15 @@ sal_Bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{
// #97016# mark first object
mpView->UnmarkAllObj();
- mpView->MarkNextObj(sal_True);
+ mpView->MarkNextObj(true);
// #97016# II
- if(mpView->AreObjectsMarked())
- mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
+ if(mpView->areSdrObjectsSelected())
+ {
+ mpView->MakeVisibleAtView(mpView->getMarkedObjectSnapRange(), *mpWindow);
+ }
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -591,20 +585,22 @@ void FuDraw::Deactivate()
void FuDraw::ForcePointer(const MouseEvent* pMEvt)
{
- Point aPnt;
+ basegfx::B2DPoint aPnt;
sal_uInt16 nModifier = 0;
- sal_Bool bLeftDown = sal_False;
- sal_Bool bDefPointer = sal_True;
+ bool bLeftDown = false;
+ bool bDefPointer = true;
if (pMEvt)
{
- aPnt = mpWindow->PixelToLogic(pMEvt->GetPosPixel());
+ const basegfx::B2DPoint aPixelPos(pMEvt->GetPosPixel().X(), pMEvt->GetPosPixel().Y());
+ aPnt = mpWindow->GetInverseViewTransformation() * aPixelPos;
nModifier = pMEvt->GetModifier();
bLeftDown = pMEvt->IsLeft();
}
else
{
- aPnt = mpWindow->PixelToLogic(mpWindow->GetPointerPosPixel());
+ const basegfx::B2DPoint aPixelPos(mpWindow->GetPointerPosPixel().X(), mpWindow->GetPointerPosPixel().Y());
+ aPnt = mpWindow->GetInverseViewTransformation() * aPixelPos;
}
if (mpView->IsDragObj())
@@ -614,7 +610,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
/******************************************************************
* Giesskannenmodus
******************************************************************/
- bDefPointer = sal_False;
+ bDefPointer = false;
mpWindow->SetPointer(Pointer(POINTER_FILL));
}
}
@@ -627,7 +623,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
/******************************************************************
* Giesskannenmodus
******************************************************************/
- bDefPointer = sal_False;
+ bDefPointer = false;
mpWindow->SetPointer(Pointer(POINTER_FILL));
}
else if (!pHdl &&
@@ -640,71 +636,70 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
if (pMask && pMask->IsEyedropping())
{
- bDefPointer = sal_False;
+ bDefPointer = false;
mpWindow->SetPointer(Pointer(POINTER_REFHAND));
}
}
else if (!mpView->IsAction())
{
SdrObject* pObj = NULL;
- SdrPageView* pPV = NULL;
SdrViewEvent aVEvt;
SdrHitKind eHit = SDRHIT_NONE;
- SdrDragMode eDragMode = mpView->GetDragMode();
+ const SdrDragMode eDragMode(mpView->GetDragMode());
if (pMEvt)
{
eHit = mpView->PickAnything(*pMEvt, SDRMOUSEMOVE, aVEvt);
}
- if ((eDragMode == SDRDRAG_ROTATE) && (eHit == SDRHIT_MARKEDOBJECT))
+ if ((SDRDRAG_ROTATE == eDragMode) && (SDRHIT_MARKEDOBJECT == eHit))
{
// The goal of this request is show always the rotation-arrow for 3D-objects at rotation-modus
// Independent of the settings at Extras->Optionen->Grafik "Objekte immer verschieben"
// 2D-objects acquit in an other way. Otherwise, the rotation of 3d-objects around any axises
// wouldn't be possible per default.
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ((pObject->ISA(E3dObject)) && (rMarkList.GetMarkCount() == 1))
+ E3dObject* pSelected = dynamic_cast< E3dObject* >(mpView->getSelectedIfSingle());
+
+ if(pSelected)
{
mpWindow->SetPointer(Pointer(POINTER_ROTATE));
- bDefPointer = sal_False; // Otherwise it'll be calles Joes routine and the mousepointer will reconfigurate again
+ bDefPointer = false; // Otherwise it'll be calles Joes routine and the mousepointer will reconfigurate again
}
}
if (eHit == SDRHIT_NONE)
{
// found nothing -> look after at the masterpage
- mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER);
+ mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER);
}
else if (eHit == SDRHIT_UNMARKEDOBJECT)
{
- pObj = aVEvt.pObj;
+ pObj = aVEvt.mpObj;
}
- else if (eHit == SDRHIT_TEXTEDITOBJ && this->ISA(FuSelection))
+ else if(SDRHIT_TEXTEDITOBJ == eHit && dynamic_cast< FuSelection* >(this))
{
- sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier();
+ sal_uInt16 nSdrObjKind = aVEvt.mpObj->GetObjIdentifier();
if ( nSdrObjKind != OBJ_TEXT &&
nSdrObjKind != OBJ_TITLETEXT &&
nSdrObjKind != OBJ_OUTLINETEXT &&
- aVEvt.pObj->IsEmptyPresObj() )
+ aVEvt.mpObj->IsEmptyPresObj() )
{
pObj = NULL;
- bDefPointer = sal_False;
+ bDefPointer = false;
mpWindow->SetPointer(Pointer(POINTER_ARROW));
}
}
- if (pObj && pMEvt && !pMEvt->IsMod2() && this->ISA(FuSelection))
+ if (pObj && pMEvt && !pMEvt->IsMod2() && dynamic_cast< FuSelection* >(this))
{
// Auf Animation oder ImageMap pruefen
bDefPointer = !SetPointer(pObj, aPnt);
- if (bDefPointer && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
+ if (bDefPointer && (dynamic_cast< SdrObjGroup* >(pObj) || dynamic_cast< E3dScene* >(pObj)))
{
// In die Gruppe hineinschauen
- if (mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
+ if (mpView->PickObj(aPnt, mpView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
bDefPointer = !SetPointer(pObj, aPnt);
}
}
@@ -724,38 +719,29 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
|*
\************************************************************************/
-sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
+bool FuDraw::SetPointer(SdrObject* pObj, const basegfx::B2DPoint& rPos)
{
- sal_Bool bSet = sal_False;
-
- sal_Bool bAnimationInfo = (!mpDocSh->ISA(GraphicDocShell) &&
- mpDoc->GetAnimationInfo(pObj)) ? sal_True:sal_False;
-
- sal_Bool bImageMapInfo = sal_False;
+ bool bSet = false;
+ bool bAnimationInfo = (!dynamic_cast< GraphicDocShell* >(mpDocSh) && mpDoc->GetAnimationInfo(pObj)) ? true : false;
+ bool bImageMapInfo = false;
if (!bAnimationInfo)
- bImageMapInfo = mpDoc->GetIMapInfo(pObj) ? sal_True:sal_False;
+ bImageMapInfo = mpDoc->GetIMapInfo(pObj) ? true : false;
if (bAnimationInfo || bImageMapInfo)
{
- const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers();
- sal_uInt16 nHitLog(sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width()));
- long n2HitLog(nHitLog * 2);
- Point aHitPosR(rPos);
- Point aHitPosL(rPos);
- Point aHitPosT(rPos);
- Point aHitPosB(rPos);
-
- aHitPosR.X() += n2HitLog;
- aHitPosL.X() -= n2HitLog;
- aHitPosT.Y() += n2HitLog;
- aHitPosB.Y() -= n2HitLog;
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ const double f2HitLog(fHitLog * 2.0);
+ const basegfx::B2DPoint aHitPosR(rPos.getX() + f2HitLog, rPos.getY());
+ const basegfx::B2DPoint aHitPosL(rPos.getX() - f2HitLog, rPos.getY());
+ const basegfx::B2DPoint aHitPosT(rPos.getX(), rPos.getY() + f2HitLog);
+ const basegfx::B2DPoint aHitPosB(rPos.getX(), rPos.getY() - f2HitLog);
if ( !pObj->IsClosedObj() ||
- ( SdrObjectPrimitiveHit(*pObj, aHitPosR, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pObj, aHitPosL, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pObj, aHitPosT, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pObj, aHitPosB, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false)))
+ ( SdrObjectPrimitiveHit(*pObj, aHitPosR, fHitLog, *mpView, false, 0) &&
+ SdrObjectPrimitiveHit(*pObj, aHitPosL, fHitLog, *mpView, false, 0) &&
+ SdrObjectPrimitiveHit(*pObj, aHitPosT, fHitLog, *mpView, false, 0) &&
+ SdrObjectPrimitiveHit(*pObj, aHitPosB, fHitLog, *mpView, false, 0)))
{
/**********************************************************
* hit inside the object (without margin) or open object
@@ -767,8 +753,9 @@ sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
* Click-Action
******************************************************/
SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
+ DrawView* pDrawView = dynamic_cast< DrawView* >(mpView);
- if ((mpView->ISA(DrawView) &&
+ if ((pDrawView &&
(pInfo->meClickAction == presentation::ClickAction_BOOKMARK ||
pInfo->meClickAction == presentation::ClickAction_DOCUMENT ||
pInfo->meClickAction == presentation::ClickAction_PREVPAGE ||
@@ -780,7 +767,7 @@ sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
pInfo->meClickAction == presentation::ClickAction_MACRO ||
pInfo->meClickAction == presentation::ClickAction_SOUND))
||
- (mpView->ISA(DrawView) &&
+ (pDrawView &&
SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) &&
(pInfo->meClickAction == presentation::ClickAction_VANISH ||
pInfo->meClickAction == presentation::ClickAction_INVISIBLE ||
@@ -790,17 +777,16 @@ sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
pInfo->meTextEffect != presentation::AnimationEffect_NONE )))))
{
// Animations-Objekt
- bSet = sal_True;
+ bSet = true;
mpWindow->SetPointer(Pointer(POINTER_REFHAND));
}
}
- else if (bImageMapInfo &&
- mpDoc->GetHitIMapObject(pObj, rPos, *mpWindow))
+ else if (bImageMapInfo && mpDoc->GetHitIMapObject(pObj, rPos, *mpWindow))
{
/******************************************************
* ImageMap
******************************************************/
- bSet = sal_True;
+ bSet = true;
mpWindow->SetPointer(Pointer(POINTER_REFHAND));
}
}
@@ -819,19 +805,14 @@ sal_Bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos)
void FuDraw::DoubleClick(const MouseEvent& rMEvt)
{
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
-
- if ( mpView->AreObjectsMarked() )
+ if ( mpView->areSdrObjectsSelected() )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ const SdrObject* pSelected = mpView->getSelectedIfSingle();
- if (rMarkList.GetMarkCount() == 1)
+ if (pSelected)
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
+ const sal_uInt32 nInv = pSelected->GetObjInventor();
+ const sal_uInt16 nSdrObjKind = pSelected->GetObjIdentifier();
if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
{
@@ -842,17 +823,16 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt)
/**********************************************************
* aktivate OLE-object
**********************************************************/
- //HMHmpView->HideMarkHdl();
- mpViewShell->ActivateObject( (SdrOle2Obj*) pObj, 0);
+ mpViewShell->ActivateObject( (SdrOle2Obj*) pSelected, 0);
}
}
- else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRAF && pObj->IsEmptyPresObj() )
+ else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRAF && pSelected->IsEmptyPresObj() )
{
mpViewShell->GetViewFrame()->
GetDispatcher()->Execute( SID_INSERT_GRAPHIC,
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
}
- else if ( ( pObj->ISA(SdrTextObj) || pObj->ISA(SdrObjGroup) ) &&
+ else if ( ( dynamic_cast< const SdrTextObj* >(pSelected) || dynamic_cast< const SdrObjGroup* >(pSelected) ) &&
!SD_MOD()->GetWaterCan() &&
mpViewShell->GetFrameView()->IsDoubleClickTextEdit() &&
!mpDocSh->IsReadOnly())
@@ -865,13 +845,16 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt)
else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRUP)
{
// hit group -> select subobject
- mpView->UnMarkAll();
- mpView->MarkObj(aMDPos, nHitLog, rMEvt.IsShift(), sal_True);
+ mpView->UnmarkAllObj();
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ mpView->MarkObj(aMDPos, fHitLog, rMEvt.IsShift(), true);
}
}
}
else
+ {
mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
+ }
}
/*************************************************************************
@@ -880,9 +863,9 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
+bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if (Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled())
{
@@ -892,7 +875,7 @@ sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
SdrHitKind eHit = mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- SdrObject* pObj = aVEvt.pObj;
+ SdrObject* pObj = aVEvt.mpObj;
if (eHit != SDRHIT_NONE && pObj != NULL)
{
@@ -900,14 +883,14 @@ sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
- if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
+ if (!bReturn && (dynamic_cast< SdrObjGroup* >(pObj) || dynamic_cast< E3dScene* >(pObj)))
{
// In die Gruppe hineinschauen
- SdrPageView* pPV = NULL;
-
- Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(aPosPixel)));
+ const Point aOutputPixel(mpWindow->ScreenToOutputPixel(aPosPixel));
+ const basegfx::B2DPoint aPixelPos(aOutputPixel.X(), aOutputPixel.Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
- if (mpView->PickObj(aPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
+ if (mpView->PickObj(aLogicPos, mpView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
bReturn = SetHelpText(pObj, aPosPixel, aVEvt);
}
}
@@ -929,16 +912,17 @@ sal_Bool FuDraw::RequestHelp(const HelpEvent& rHEvt)
|*
\************************************************************************/
-sal_Bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewEvent& rVEvt)
+bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewEvent& rVEvt)
{
- sal_Bool bSet = sal_False;
+ bool bSet = false;
String aHelpText;
- Point aPos(mpWindow->PixelToLogic(mpWindow->ScreenToOutputPixel(rPosPixel)));
+ const basegfx::B2DPoint aPixelPos(rPosPixel.X(), rPosPixel.Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
// URL fuer IMapObject unter Pointer ist Hilfetext
if ( mpDoc->GetIMapInfo(pObj) )
{
- IMapObject* pIMapObj = mpDoc->GetHitIMapObject(pObj, aPos, *mpWindow );
+ IMapObject* pIMapObj = mpDoc->GetHitIMapObject(pObj, aLogicPos, *mpWindow );
if ( pIMapObj )
{
@@ -952,7 +936,7 @@ sal_Bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrV
}
}
}
- else if (!mpDocSh->ISA(GraphicDocShell) && mpDoc->GetAnimationInfo(pObj))
+ else if (!dynamic_cast< GraphicDocShell* >(mpDocSh) && mpDoc->GetAnimationInfo(pObj))
{
SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo(pObj);
@@ -1060,18 +1044,18 @@ sal_Bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrV
break;
}
}
- else if (rVEvt.pURLField)
+ else if (rVEvt.maURLField.Len())
{
/**************************************************************
* URL-Field
**************************************************************/
- aHelpText = INetURLObject::decode( rVEvt.pURLField->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
+ aHelpText = INetURLObject::decode( rVEvt.maURLField, '%', INetURLObject::DECODE_WITH_CHARSET );
}
if (aHelpText.Len())
{
- bSet = sal_True;
- Rectangle aLogicPix = mpWindow->LogicToPixel(pObj->GetLogicRect());
+ bSet = true;
+ Rectangle aLogicPix = mpWindow->LogicToPixel(sdr::legacy::GetLogicRect(*pObj));
Rectangle aScreenRect(mpWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
mpWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
@@ -1109,7 +1093,7 @@ bool FuDraw::cancel()
rBindings.Invalidate( SID_PARASPACE_INCREASE );
rBindings.Invalidate( SID_PARASPACE_DECREASE );
}
- else if ( mpView->AreObjectsMarked() )
+ else if ( mpView->areSdrObjectsSelected() )
{
// #97016# II
const SdrHdlList& rHdlList = mpView->GetHdlList();
diff --git a/sd/source/ui/func/fudspord.cxx b/sd/source/ui/func/fudspord.cxx
index 9a33a6849c47..415ab61547ea 100644
--- a/sd/source/ui/func/fudspord.cxx
+++ b/sd/source/ui/func/fudspord.cxx
@@ -42,8 +42,6 @@
namespace sd {
-TYPEINIT1( FuDisplayOrder, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -89,12 +87,12 @@ FunctionReference FuDisplayOrder::Create( ViewShell* pViewSh, ::sd::Window* pWin
|*
\************************************************************************/
-sal_Bool FuDisplayOrder::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuDisplayOrder::MouseButtonDown(const MouseEvent& rMEvt)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -103,13 +101,12 @@ sal_Bool FuDisplayOrder::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuDisplayOrder::MouseMove(const MouseEvent& rMEvt)
+bool FuDisplayOrder::MouseMove(const MouseEvent& rMEvt)
{
SdrObject* pPickObj;
- SdrPageView* pPV;
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPnt(mpWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
- if ( mpView->PickObj(aPnt, mpView->getHitTolLog(), pPickObj, pPV) )
+ if ( mpView->PickObj(aPnt, mpView->getHitTolLog(), pPickObj) )
{
if (mpRefObj != pPickObj)
{
@@ -129,7 +126,7 @@ sal_Bool FuDisplayOrder::MouseMove(const MouseEvent& rMEvt)
implClearOverlay();
}
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -138,15 +135,13 @@ sal_Bool FuDisplayOrder::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuDisplayOrder::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuDisplayOrder::MouseButtonUp(const MouseEvent& rMEvt)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
+ const basegfx::B2DPoint aPnt(mpWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
- SdrPageView* pPV = NULL;
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
-
- if ( mpView->PickObj(aPnt, mpView->getHitTolLog(), mpRefObj, pPV) )
+ if ( mpView->PickObj(aPnt, mpView->getHitTolLog(), mpRefObj) )
{
if (nSlotId == SID_BEFORE_OBJ)
{
@@ -160,7 +155,7 @@ sal_Bool FuDisplayOrder::MouseButtonUp(const MouseEvent& rMEvt)
mpViewShell->Cancel();
- return sal_True;
+ return true;
}
/*************************************************************************
diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx
index ade3e5866183..f6af21597913 100644
--- a/sd/source/ui/func/fuediglu.cxx
+++ b/sd/source/ui/func/fuediglu.cxx
@@ -48,8 +48,6 @@
namespace sd {
-TYPEINIT1( FuEditGluePoints, FuDraw );
-
/*************************************************************************
|*
|* Konstruktor
@@ -62,7 +60,8 @@ FuEditGluePoints::FuEditGluePoints (
::sd::View* pView,
SdDrawDocument* pDoc,
SfxRequest& rReq)
- : FuDraw(pViewSh, pWin, pView, pDoc, rReq)
+ : FuDraw(pViewSh, pWin, pView, pDoc, rReq),
+ meLastSdrViewEditMode(SDREDITMODE_EDIT)
{
}
@@ -78,7 +77,7 @@ FunctionReference FuEditGluePoints::Create( ViewShell* pViewSh, ::sd::Window* pW
void FuEditGluePoints::DoExecute( SfxRequest& rReq )
{
FuDraw::DoExecute( rReq );
- mpView->SetInsGluePointMode(sal_False);
+ mpView->SetInsGluePointMode(false);
mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBar(
ToolBarManager::TBG_FUNCTION,
ToolBarManager::msGluePointsToolBar);
@@ -93,8 +92,8 @@ void FuEditGluePoints::DoExecute( SfxRequest& rReq )
FuEditGluePoints::~FuEditGluePoints()
{
mpView->BrkAction();
- mpView->UnmarkAllGluePoints();
- mpView->SetInsGluePointMode(sal_False);
+ mpView->MarkGluePoints(0, true);
+ mpView->SetInsGluePointMode(false);
}
/*************************************************************************
@@ -103,25 +102,25 @@ FuEditGluePoints::~FuEditGluePoints()
|*
\************************************************************************/
-sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
{
- mpView->SetActualWin( mpWindow );
+ mpView->SetActualOutDev( mpWindow );
- sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
+ bool bReturn = FuDraw::MouseButtonDown(rMEvt);
if (mpView->IsAction())
{
if (rMEvt.IsRight())
mpView->BckAction();
- return sal_True;
+ return true;
}
if (rMEvt.IsLeft())
{
- bReturn = sal_True;
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
+ bReturn = true;
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ const double fDrgLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
mpWindow->CaptureMouse();
SdrViewEvent aVEvt;
@@ -132,18 +131,18 @@ sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
/******************************************************************
* Handle draggen
******************************************************************/
- SdrHdl* pHdl = aVEvt.pHdl;
+ const SdrHdl* pHdl = aVEvt.mpHdl;
- if (mpView->IsGluePointMarked(aVEvt.pObj, aVEvt.nGlueId) && rMEvt.IsShift())
+ if (mpView->IsGluePointMarked(*aVEvt.mpObj, aVEvt.mnGlueId) && rMEvt.IsShift())
{
- mpView->UnmarkGluePoint(aVEvt.pObj, aVEvt.nGlueId, aVEvt.pPV);
+ mpView->MarkGluePoint(aVEvt.mpObj, aVEvt.mnGlueId, true); // unmark
pHdl = NULL;
}
if (pHdl)
{
// Handle draggen
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog);
}
}
else if (eHit == SDRHIT_MARKEDOBJECT && mpView->IsInsGluePointMode())
@@ -159,7 +158,7 @@ sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
* Klebepunkt selektieren
******************************************************************/
if (!rMEvt.IsShift())
- mpView->UnmarkAllGluePoints();
+ mpView->MarkGluePoints(0, true);
mpView->BegMarkGluePoints(aMDPos);
}
@@ -168,7 +167,7 @@ sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
/******************************************************************
* Objekt verschieben
******************************************************************/
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, NULL, nDrgLog);
+ mpView->BegDragObj(aMDPos, NULL, fDrgLog);
}
else if (eHit == SDRHIT_GLUEPOINT)
{
@@ -176,14 +175,14 @@ sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
* Klebepunkt selektieren
******************************************************************/
if (!rMEvt.IsShift())
- mpView->UnmarkAllGluePoints();
+ mpView->MarkGluePoints(0, true);
- mpView->MarkGluePoint(aVEvt.pObj, aVEvt.nGlueId, aVEvt.pPV);
- SdrHdl* pHdl = mpView->GetGluePointHdl(aVEvt.pObj, aVEvt.nGlueId);
+ mpView->MarkGluePoint(aVEvt.mpObj, aVEvt.mnGlueId);
+ SdrHdl* pHdl = mpView->GetGluePointHdl(aVEvt.mpObj, aVEvt.mnGlueId);
if (pHdl)
{
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, pHdl, fDrgLog);
}
}
else
@@ -196,17 +195,17 @@ sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
mpView->UnmarkAllObj();
}
- sal_Bool bMarked = sal_False;
+ bool bMarked = false;
if (!rMEvt.IsMod1())
{
if (rMEvt.IsMod2())
{
- bMarked = mpView->MarkNextObj(aMDPos, nHitLog, rMEvt.IsShift());
+ bMarked = mpView->MarkNextObj(aMDPos, fHitLog, rMEvt.IsShift());
}
else
{
- bMarked = mpView->MarkObj(aMDPos, nHitLog, rMEvt.IsShift());
+ bMarked = mpView->MarkObj(aMDPos, fHitLog, rMEvt.IsShift());
}
}
@@ -214,15 +213,15 @@ sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
(!rMEvt.IsShift() || eHit == SDRHIT_MARKEDOBJECT))
{
// Objekt verschieben
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog);
}
- else if (mpView->AreObjectsMarked())
+ else if (mpView->areSdrObjectsSelected())
{
/**************************************************************
* Klebepunkt selektieren
**************************************************************/
if (!rMEvt.IsShift())
- mpView->UnmarkAllGluePoints();
+ mpView->MarkGluePoints(0, true);
mpView->BegMarkGluePoints(aMDPos);
}
@@ -247,23 +246,24 @@ sal_Bool FuEditGluePoints::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuEditGluePoints::MouseMove(const MouseEvent& rMEvt)
+bool FuEditGluePoints::MouseMove(const MouseEvent& rMEvt)
{
- mpView->SetActualWin( mpWindow );
+ mpView->SetActualOutDev( mpWindow );
FuDraw::MouseMove(rMEvt);
if (mpView->IsAction())
{
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt( mpWindow->PixelToLogic(aPix) );
+ const basegfx::B2DPoint aPix(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPix);
+
ForceScroll(aPix);
- mpView->MovAction(aPnt);
+ mpView->MovAction(aLogicPos);
}
ForcePointer(&rMEvt);
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -272,15 +272,15 @@ sal_Bool FuEditGluePoints::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuEditGluePoints::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuEditGluePoints::MouseButtonUp(const MouseEvent& rMEvt)
{
- mpView->SetActualWin( mpWindow );
+ mpView->SetActualOutDev( mpWindow );
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if (mpView->IsAction())
{
- bReturn = sal_True;
+ bReturn = true;
mpView->EndAction();
}
@@ -289,8 +289,8 @@ sal_Bool FuEditGluePoints::MouseButtonUp(const MouseEvent& rMEvt)
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
- if (Abs(aMDPos.X() - aPos.X()) < nDrgLog &&
- Abs(aMDPos.Y() - aPos.Y()) < nDrgLog &&
+ if (fabs(aMDPos.getX() - aPos.getX()) < nDrgLog &&
+ fabs(aMDPos.getY() - aPos.getY()) < nDrgLog &&
!rMEvt.IsShift() && !rMEvt.IsMod2())
{
SdrViewEvent aVEvt;
@@ -312,16 +312,16 @@ sal_Bool FuEditGluePoints::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt)
+bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt)
{
- mpView->SetActualWin( mpWindow );
+ mpView->SetActualOutDev( mpWindow );
- sal_Bool bReturn = FuDraw::KeyInput(rKEvt);
+ bool bReturn = FuDraw::KeyInput(rKEvt);
return bReturn;
}
@@ -332,9 +332,9 @@ sal_Bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt)
|*
\************************************************************************/
-sal_Bool FuEditGluePoints::Command(const CommandEvent& rCEvt)
+bool FuEditGluePoints::Command(const CommandEvent& rCEvt)
{
- mpView->SetActualWin( mpWindow );
+ mpView->SetActualOutDev( mpWindow );
return FuPoor::Command( rCEvt );
}
@@ -346,7 +346,8 @@ sal_Bool FuEditGluePoints::Command(const CommandEvent& rCEvt)
void FuEditGluePoints::Activate()
{
- mpView->SetGluePointEditMode();
+ meLastSdrViewEditMode = mpView->GetViewEditMode();
+ mpView->SetViewEditMode(SDREDITMODE_GLUEPOINTEDIT);
FuDraw::Activate();
}
@@ -358,7 +359,7 @@ void FuEditGluePoints::Activate()
void FuEditGluePoints::Deactivate()
{
- mpView->SetGluePointEditMode( sal_False );
+ mpView->SetViewEditMode(meLastSdrViewEditMode);
FuDraw::Deactivate();
}
@@ -410,44 +411,44 @@ void FuEditGluePoints::ReceiveRequest(SfxRequest& rReq)
{
const SfxItemSet* pSet = rReq.GetArgs();
const SfxPoolItem& rItem = pSet->Get(SID_GLUE_PERCENT);
- sal_Bool bPercent = ((const SfxBoolItem&) rItem).GetValue();
+ bool bPercent = ((const SfxBoolItem&) rItem).GetValue();
mpView->SetMarkedGluePointsPercent(bPercent);
}
break;
case SID_GLUE_HORZALIGN_CENTER:
{
- mpView->SetMarkedGluePointsAlign(sal_False, SDRHORZALIGN_CENTER);
+ mpView->SetMarkedGluePointsAlign(false, SDRHORZALIGN_CENTER);
}
break;
case SID_GLUE_HORZALIGN_LEFT:
{
- mpView->SetMarkedGluePointsAlign(sal_False, SDRHORZALIGN_LEFT);
+ mpView->SetMarkedGluePointsAlign(false, SDRHORZALIGN_LEFT);
}
break;
case SID_GLUE_HORZALIGN_RIGHT:
{
- mpView->SetMarkedGluePointsAlign(sal_False, SDRHORZALIGN_RIGHT);
+ mpView->SetMarkedGluePointsAlign(false, SDRHORZALIGN_RIGHT);
}
break;
case SID_GLUE_VERTALIGN_CENTER:
{
- mpView->SetMarkedGluePointsAlign(sal_True, SDRVERTALIGN_CENTER);
+ mpView->SetMarkedGluePointsAlign(true, SDRVERTALIGN_CENTER);
}
break;
case SID_GLUE_VERTALIGN_TOP:
{
- mpView->SetMarkedGluePointsAlign(sal_True, SDRVERTALIGN_TOP);
+ mpView->SetMarkedGluePointsAlign(true, SDRVERTALIGN_TOP);
}
break;
case SID_GLUE_VERTALIGN_BOTTOM:
{
- mpView->SetMarkedGluePointsAlign(sal_True, SDRVERTALIGN_BOTTOM);
+ mpView->SetMarkedGluePointsAlign(true, SDRVERTALIGN_BOTTOM);
}
break;
}
diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx
index 7fcc27ee0ec5..0fc994a5606f 100644
--- a/sd/source/ui/func/fuexpand.cxx
+++ b/sd/source/ui/func/fuexpand.cxx
@@ -53,8 +53,6 @@
namespace sd {
-TYPEINIT1( FuExpandPage, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -85,8 +83,8 @@ void FuExpandPage::DoExecute( SfxRequest& )
// Selektierte Seite finden (nur Standard-Seiten)
SdPage* pActualPage = NULL;
- sal_uInt16 i = 0;
- sal_uInt16 nCount = mpDoc->GetSdPageCount(PK_STANDARD);
+ sal_uInt32 i = 0;
+ sal_uInt32 nCount = mpDoc->GetSdPageCount(PK_STANDARD);
while (!pActualPage && i < nCount)
{
@@ -102,8 +100,8 @@ void FuExpandPage::DoExecute( SfxRequest& )
{
::sd::Outliner* pOutl =
new ::sd::Outliner( mpDoc, OUTLINERMODE_OUTLINEOBJECT );
- pOutl->SetUpdateMode(sal_False);
- pOutl->EnableUndo(sal_False);
+ pOutl->SetUpdateMode(false);
+ pOutl->EnableUndo(false);
if (mpDocSh)
pOutl->SetRefDevice( SD_MOD()->GetRefDevice( *mpDocSh ) );
@@ -112,7 +110,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool());
SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers();
- sal_uInt16 nActualPageNum = pActualPage->GetPageNum();
+ sal_uInt32 nActualPageNum = pActualPage->GetPageNumber();
SdPage* pActualNotesPage = (SdPage*) mpDoc->GetPage(nActualPageNum + 1);
SdrTextObj* pActualOutline = (SdrTextObj*) pActualPage->GetPresObj(PRESOBJ_OUTLINE);
@@ -128,7 +126,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
pOutl->SetText(*pParaObj);
// Harte Absatz- und Zeichenattribute entfernen
- SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
+ SfxItemSet aEmptyEEAttr(mpDoc->GetItemPool(), EE_ITEMS_START, EE_ITEMS_END);
sal_uLong nParaCount1 = pOutl->GetParagraphCount();
for (sal_uInt16 nPara = 0; nPara < nParaCount1; nPara++)
@@ -137,7 +135,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
pOutl->SetParaAttribs(nPara, aEmptyEEAttr);
}
- sal_uInt16 nPos = 2;
+ sal_uInt32 nPos = 2;
Paragraph* pPara = pOutl->GetParagraph( 0 );
while (pPara)
@@ -147,12 +145,12 @@ void FuExpandPage::DoExecute( SfxRequest& )
if ( nDepth == 0 )
{
// Seite mit Titel & Gliederung!
- SdPage* pPage = (SdPage*) mpDoc->AllocPage(sal_False);
- pPage->SetSize(pActualPage->GetSize() );
- pPage->SetBorder(pActualPage->GetLftBorder(),
- pActualPage->GetUppBorder(),
- pActualPage->GetRgtBorder(),
- pActualPage->GetLwrBorder() );
+ SdPage* pPage = (SdPage*) mpDoc->AllocPage(false);
+ pPage->SetPageScale(pActualPage->GetPageScale() );
+ pPage->SetPageBorder(pActualPage->GetLeftPageBorder(),
+ pActualPage->GetTopPageBorder(),
+ pActualPage->GetRightPageBorder(),
+ pActualPage->GetBottomPageBorder() );
pPage->SetName(String());
// Seite hinter aktueller Seite einfuegen
@@ -165,16 +163,16 @@ void FuExpandPage::DoExecute( SfxRequest& )
// MasterPage der aktuellen Seite verwenden
pPage->TRG_SetMasterPage(pActualPage->TRG_GetMasterPage());
pPage->SetLayoutName(pActualPage->GetLayoutName());
- pPage->SetAutoLayout(AUTOLAYOUT_ENUM, sal_True);
+ pPage->SetAutoLayout(AUTOLAYOUT_ENUM, true);
pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
// Notiz-Seite
- SdPage* pNotesPage = (SdPage*) mpDoc->AllocPage(sal_False);
- pNotesPage->SetSize(pActualNotesPage->GetSize());
- pNotesPage->SetBorder(pActualNotesPage->GetLftBorder(),
- pActualNotesPage->GetUppBorder(),
- pActualNotesPage->GetRgtBorder(),
- pActualNotesPage->GetLwrBorder() );
+ SdPage* pNotesPage = (SdPage*) mpDoc->AllocPage(false);
+ pNotesPage->SetPageScale(pActualNotesPage->GetPageScale());
+ pNotesPage->SetPageBorder(pActualNotesPage->GetLeftPageBorder(),
+ pActualNotesPage->GetTopPageBorder(),
+ pActualNotesPage->GetRightPageBorder(),
+ pActualNotesPage->GetBottomPageBorder() );
pNotesPage->SetPageKind(PK_NOTES);
pNotesPage->SetName(String());
@@ -188,7 +186,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
// MasterPage der aktuellen Seite verwenden
pNotesPage->TRG_SetMasterPage(pActualNotesPage->TRG_GetMasterPage());
pNotesPage->SetLayoutName(pActualNotesPage->GetLayoutName());
- pNotesPage->SetAutoLayout(pActualNotesPage->GetAutoLayout(), sal_True);
+ pNotesPage->SetAutoLayout(pActualNotesPage->GetAutoLayout(), true);
pNotesPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
// Title-Textobjekt erstellen
@@ -214,10 +212,10 @@ void FuExpandPage::DoExecute( SfxRequest& )
pTextObj->SetOutlinerParaObject(pOutlinerParaObject);
- pTextObj->SetEmptyPresObj(sal_False);
+ pTextObj->SetEmptyPresObj(false);
SfxStyleSheet* pSheet = pPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
- pTextObj->NbcSetStyleSheet(pSheet, sal_False);
+ pTextObj->SetStyleSheet(pSheet, false);
sal_uLong nChildCount = pOutl->GetChildCount(pPara);
@@ -248,10 +246,10 @@ void FuExpandPage::DoExecute( SfxRequest& )
// --
pOutlineObj->SetOutlinerParaObject( pOPO );
- pOutlineObj->SetEmptyPresObj(sal_False);
+ pOutlineObj->SetEmptyPresObj(false);
- // Harte Attribute entfernen (Flag auf sal_True)
- SfxItemSet aAttr(mpDoc->GetPool());
+ // Harte Attribute entfernen (Flag auf true)
+ SfxItemSet aAttr(pOutlineObj->GetObjectItemPool());
aAttr.Put(XLineStyleItem(XLINE_NONE));
aAttr.Put(XFillStyleItem(XFILL_NONE));
pOutlineObj->SetMergedItemSet(aAttr);
diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx
index 3968e4972def..0c54d078bac9 100644
--- a/sd/source/ui/func/fuformatpaintbrush.cxx
+++ b/sd/source/ui/func/fuformatpaintbrush.cxx
@@ -55,8 +55,6 @@
namespace sd {
-TYPEINIT1( FuFormatPaintBrush, FuText );
-
FuFormatPaintBrush::FuFormatPaintBrush( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
: FuText(pViewSh, pWin, pView, pDoc, rReq)
, mbPermanent( false )
@@ -98,34 +96,34 @@ void FuFormatPaintBrush::implcancel()
static void unmarkimpl( SdrView* pView )
{
pView->SdrEndTextEdit();
- pView->UnMarkAll();
+ pView->UnmarkAllObj();
}
-sal_Bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt)
{
if(mpView&&mpWindow)
{
SdrViewEvent aVEvt;
SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
- if( (eHit == SDRHIT_TEXTEDIT) || (eHit == SDRHIT_TEXTEDITOBJ && ( mpViewShell->GetFrameView()->IsQuickEdit() || dynamic_cast< sdr::table::SdrTableObj* >( aVEvt.pObj ) != NULL ) ))
+ if( (eHit == SDRHIT_TEXTEDIT) || (eHit == SDRHIT_TEXTEDITOBJ && ( mpViewShell->GetFrameView()->IsQuickEdit() || dynamic_cast< sdr::table::SdrTableObj* >( aVEvt.mpObj ) != NULL ) ))
{
SdrObject* pPickObj=0;
- SdrPageView* pPV=0;
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
- mpView->PickObj( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ),nHitLog, pPickObj, pPV, SDRSEARCH_PICKMARKABLE);
+ const basegfx::B2DPoint aPnt(mpWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+ mpView->PickObj( aPnt, fHitLog, pPickObj, SDRSEARCH_PICKMARKABLE);
- if( (pPickObj != 0) && !pPickObj->IsEmptyPresObj() )
+ if( pPickObj && !pPickObj->IsEmptyPresObj() )
{
// if we text hit another shape than the one currently selected, unselect the old one now
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() >= 1 )
+ const SdrObjectVector aSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if( aSelection.size() )
{
- if( rMarkList.GetMarkCount() == 1 )
+ if( 1 == aSelection.size() )
{
- if( rMarkList.GetMark(0)->GetMarkedSdrObj() != pPickObj )
+ if( aSelection[0] != pPickObj )
{
-
// if current selected shape is not that of the hit text edit, deselect it
unmarkimpl( mpView );
}
@@ -140,26 +138,29 @@ sal_Bool FuFormatPaintBrush::MouseButtonDown(const MouseEvent& rMEvt)
return FuText::MouseButtonDown(aMEvt);
}
- if( aVEvt.pObj == 0 )
- aVEvt.pObj = pPickObj;
+ if( aVEvt.mpObj == 0 )
+ aVEvt.mpObj = pPickObj;
}
unmarkimpl( mpView );
- if( aVEvt.pObj )
+ if( aVEvt.mpObj )
{
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
- sal_Bool bToggle = sal_False;
- mpView->MarkObj(mpWindow->PixelToLogic( rMEvt.GetPosPixel() ), nHitLog, bToggle, sal_False);
- return sal_True;
+ const bool bToggle(false);
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
+
+ mpView->MarkObj(aLogicPos, fHitLog, bToggle, false);
+
+ return true;
}
}
- return sal_False;
+ return false;
}
-sal_Bool FuFormatPaintBrush::MouseMove(const MouseEvent& rMEvt)
+bool FuFormatPaintBrush::MouseMove(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if( mpWindow && mpView )
{
if ( mpView->IsTextEdit() )
@@ -169,12 +170,12 @@ sal_Bool FuFormatPaintBrush::MouseMove(const MouseEvent& rMEvt)
}
else
{
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
SdrObject* pObj=0;
- SdrPageView* pPV=0;
- sal_Bool bOverMarkableObject = mpView->PickObj( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ),nHitLog, pObj, pPV, SDRSEARCH_PICKMARKABLE);
+ const basegfx::B2DPoint aPnt(mpWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+ bool bOverMarkableObject = mpView->PickObj( aPnt, fHitLog, pObj, SDRSEARCH_PICKMARKABLE);
- if(bOverMarkableObject && HasContentForThisType(pObj->GetObjInventor(),pObj->GetObjIdentifier()) )
+ if(bOverMarkableObject && pObj && HasContentForThisType(*pObj) )
mpWindow->SetPointer(Pointer(POINTER_FILL));
else
mpWindow->SetPointer(Pointer(POINTER_ARROW));
@@ -183,9 +184,9 @@ sal_Bool FuFormatPaintBrush::MouseMove(const MouseEvent& rMEvt)
return bReturn;
}
-sal_Bool FuFormatPaintBrush::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuFormatPaintBrush::MouseButtonUp(const MouseEvent& rMEvt)
{
- if( mpItemSet.get() && mpView && mpView->AreObjectsMarked() )
+ if( mpItemSet.get() && mpView && mpView->areSdrObjectsSelected() )
{
bool bNoCharacterFormats = false;
bool bNoParagraphFormats = false;
@@ -205,19 +206,19 @@ sal_Bool FuFormatPaintBrush::MouseButtonUp(const MouseEvent& rMEvt)
mpViewShell->GetViewFrame()->GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
if( mbPermanent )
- return sal_True;
+ return true;
}
implcancel();
- return sal_True;
+ return true;
}
-sal_Bool FuFormatPaintBrush::KeyInput(const KeyEvent& rKEvt)
+bool FuFormatPaintBrush::KeyInput(const KeyEvent& rKEvt)
{
if( (rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE) && mpViewShell )
{
implcancel();
- return sal_True;
+ return true;
}
return FuPoor::KeyInput(rKEvt);
}
@@ -227,8 +228,8 @@ void FuFormatPaintBrush::Activate()
mbOldIsQuickTextEditMode = mpViewShell->GetFrameView()->IsQuickEdit();
if( !mbOldIsQuickTextEditMode )
{
- mpViewShell->GetFrameView()->SetQuickEdit(sal_True);
- mpView->SetQuickTextEditMode(sal_True);
+ mpViewShell->GetFrameView()->SetQuickEdit(true);
+ mpView->SetQuickTextEditMode(true);
}
}
@@ -236,54 +237,55 @@ void FuFormatPaintBrush::Deactivate()
{
if( !mbOldIsQuickTextEditMode )
{
- mpViewShell->GetFrameView()->SetQuickEdit(sal_False);
- mpView->SetQuickTextEditMode(sal_False);
+ mpViewShell->GetFrameView()->SetQuickEdit(false);
+ mpView->SetQuickTextEditMode(false);
}
}
-bool FuFormatPaintBrush::HasContentForThisType( sal_uInt32 nObjectInventor, sal_uInt16 nObjectIdentifier ) const
+bool FuFormatPaintBrush::HasContentForThisType( const SdrObject& rSdrObject ) const
{
if( mpItemSet.get() == 0 )
return false;
- if( !mpView || (!mpView->SupportsFormatPaintbrush( nObjectInventor, nObjectIdentifier) ) )
+ if( !mpView || (!mpView->SupportsFormatPaintbrush( rSdrObject ) ) )
return false;
return true;
}
void FuFormatPaintBrush::Paste( bool bNoCharacterFormats, bool bNoParagraphFormats )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if(mpItemSet.get() && (rMarkList.GetMarkCount() == 1) )
+ if(mpItemSet.get())
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ SdrObject* pSelected = mpView->getSelectedIfSingle();
- if( mpDoc->IsUndoEnabled() )
+ if(pSelected)
{
- String sLabel( mpViewShell->GetViewShellBase().RetrieveLabelFromCommand( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatPaintbrush" ) ) ) );
- mpDoc->BegUndo( sLabel );
- mpDoc->AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoAttrObject(*pObj,sal_False,sal_True));
- }
+ if( mpDoc->IsUndoEnabled() )
+ {
+ String sLabel( mpViewShell->GetViewShellBase().RetrieveLabelFromCommand( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatPaintbrush" ) ) ) );
+ mpDoc->BegUndo( sLabel );
+ mpDoc->AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoAttrObject(*pSelected, false, true));
+ }
- mpView->ApplyFormatPaintBrush( *mpItemSet.get(), bNoCharacterFormats, bNoParagraphFormats );
+ mpView->ApplyFormatPaintBrush( *mpItemSet.get(), bNoCharacterFormats, bNoParagraphFormats );
- if( mpDoc->IsUndoEnabled() )
- {
- mpDoc->EndUndo();
+ if( mpDoc->IsUndoEnabled() )
+ {
+ mpDoc->EndUndo();
+ }
}
}
}
/* static */ void FuFormatPaintBrush::GetMenuState( DrawViewShell& rDrawViewShell, SfxItemSet &rSet )
{
- const SdrMarkList& rMarkList = rDrawViewShell.GetDrawView()->GetMarkedObjectList();
- const sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ const SdrObject* pSelected = rDrawViewShell.GetDrawView()->getSelectedIfSingle();
- if( nMarkCount == 1 )
+ if( pSelected )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if( pObj && rDrawViewShell.GetDrawView()->SupportsFormatPaintbrush(pObj->GetObjInventor(),pObj->GetObjIdentifier()) )
+ if( rDrawViewShell.GetDrawView()->SupportsFormatPaintbrush(*pSelected) )
return;
}
+
rSet.DisableItem( SID_FORMATPAINTBRUSH );
}
diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx
index b0961945dd7f..547bbee4aa60 100644
--- a/sd/source/ui/func/fuhhconv.cxx
+++ b/sd/source/ui/func/fuhhconv.cxx
@@ -59,8 +59,6 @@ namespace sd {
class ViewShell;
-TYPEINIT1( FuHangulHanjaConversion, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -75,16 +73,16 @@ FuHangulHanjaConversion::FuHangulHanjaConversion (
SfxRequest& rReq )
: FuPoor(pViewSh, pWin, pView, pDocument, rReq),
pSdOutliner(NULL),
- bOwnOutliner(sal_False)
+ bOwnOutliner(false)
{
- if ( mpViewShell->ISA(DrawViewShell) )
+ if ( dynamic_cast< DrawViewShell* >(mpViewShell) )
{
- bOwnOutliner = sal_True;
+ bOwnOutliner = true;
pSdOutliner = new Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT );
}
- else if ( mpViewShell->ISA(OutlineViewShell) )
+ else if ( dynamic_cast< OutlineViewShell* >(mpViewShell) )
{
- bOwnOutliner = sal_False;
+ bOwnOutliner = false;
pSdOutliner = mpDoc->GetOutliner();
}
@@ -122,32 +120,32 @@ FunctionReference FuHangulHanjaConversion::Create( ViewShell* pViewSh, ::sd::Win
\************************************************************************/
void FuHangulHanjaConversion::StartConversion( sal_Int16 nSourceLanguage, sal_Int16 nTargetLanguage,
- const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive )
+ const Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive )
{
String aString( SdResId(STR_UNDO_HANGULHANJACONVERSION) );
mpView->BegUndo( aString );
- ViewShellBase* pBase = PTR_CAST(ViewShellBase, SfxViewShell::Current());
+ ViewShellBase* pBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current());
if (pBase != NULL)
mpViewShell = pBase->GetMainViewShell().get();
if( mpViewShell )
{
- if ( pSdOutliner && mpViewShell->ISA(DrawViewShell) && !bOwnOutliner )
+ if ( pSdOutliner && dynamic_cast< DrawViewShell* >(mpViewShell) && !bOwnOutliner )
{
pSdOutliner->EndConversion();
- bOwnOutliner = sal_True;
+ bOwnOutliner = true;
pSdOutliner = new Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT );
pSdOutliner->BeginConversion();
}
- else if ( pSdOutliner && mpViewShell->ISA(OutlineViewShell) && bOwnOutliner )
+ else if ( pSdOutliner && dynamic_cast< OutlineViewShell* >(mpViewShell) && bOwnOutliner )
{
pSdOutliner->EndConversion();
delete pSdOutliner;
- bOwnOutliner = sal_False;
+ bOwnOutliner = false;
pSdOutliner = mpDoc->GetOutliner();
pSdOutliner->BeginConversion();
}
@@ -191,11 +189,11 @@ void FuHangulHanjaConversion::ConvertStyles( sal_Int16 nTargetLanguage, const Fo
const bool bHasParent = pStyle->GetParent().Len() != 0;
- if( !bHasParent || rSet.GetItemState( EE_CHAR_LANGUAGE_CJK, sal_False ) == SFX_ITEM_SET )
+ if( !bHasParent || rSet.GetItemState( EE_CHAR_LANGUAGE_CJK, false ) == SFX_ITEM_SET )
rSet.Put( SvxLanguageItem( nTargetLanguage, EE_CHAR_LANGUAGE_CJK ) );
if( pTargetFont &&
- ( !bHasParent || rSet.GetItemState( EE_CHAR_FONTINFO_CJK, sal_False ) == SFX_ITEM_SET ) )
+ ( !bHasParent || rSet.GetItemState( EE_CHAR_FONTINFO_CJK, false ) == SFX_ITEM_SET ) )
{
// set new font attribute
SvxFontItem aFontItem( (SvxFontItem&) rSet.Get( EE_CHAR_FONTINFO_CJK ) );
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 0fe881b4f0ee..9c4004ee63ab 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -35,7 +35,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
-
#include <tools/urlobj.hxx>
#include <svl/urihelper.hxx>
#include <sfx2/msgpool.hxx>
@@ -72,7 +71,8 @@
#endif
#include <sfx2/opengrf.hxx>
#include <sfx2/viewfrm.hxx>
-#include <svx/charthelper.hxx>
+#include <svx/svdlegacy.hxx>
+#include <vcl/svapp.hxx>
#include "app.hrc"
#include "misc.hxx"
@@ -88,7 +88,6 @@
#include "drawdoc.hxx"
#include "sdgrffilter.hxx"
#include "sdxfer.hxx"
-#include <vcl/svapp.hxx>
#include "undo/undoobjects.hxx"
#include "glob.hrc"
@@ -96,11 +95,6 @@ using namespace com::sun::star;
namespace sd {
-TYPEINIT1( FuInsertGraphic, FuPoor );
-TYPEINIT1( FuInsertClipboard, FuPoor );
-TYPEINIT1( FuInsertOLE, FuPoor );
-TYPEINIT1( FuInsertAVMedia, FuPoor );
-
/*************************************************************************
|*
|* FuInsertGraphic::Konstruktor
@@ -124,9 +118,10 @@ FunctionReference FuInsertGraphic::Create( ViewShell* pViewSh, ::sd::Window* pWi
return xFunc;
}
-#ifdef _MSC_VER
-#pragma optimize ( "", off )
-#endif
+// TTTT needed? Check!
+//#ifdef _MSC_VER
+//#pragma optimize ( "", off )
+//#endif
void FuInsertGraphic::DoExecute( SfxRequest& )
{
@@ -134,28 +129,34 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
if( aDlg.Execute() == GRFILTER_OK )
{
- Graphic aGraphic;
- int nError = aDlg.GetGraphic(aGraphic);
- if( nError == GRFILTER_OK )
+ Graphic aGraphic;
+ int nError(aDlg.GetGraphic(aGraphic));
+
+ if(GRFILTER_OK == nError)
{
- if( mpViewShell && mpViewShell->ISA(DrawViewShell))
+ if(mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell))
{
- sal_Int8 nAction = DND_ACTION_COPY;
- SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC );
- if( pPickObj )
+ sal_Int8 nAction(DND_ACTION_COPY);
+ SdrObject* pPickObj = mpView->GetEmptyPresentationObject(PRESOBJ_GRAPHIC);
+
+ if(pPickObj)
+ {
nAction = DND_ACTION_LINK;
+ }
- Point aPos;
- Rectangle aRect(aPos, mpWindow->GetOutputSizePixel() );
- aPos = aRect.Center();
- aPos = mpWindow->PixelToLogic(aPos);
- SdrGrafObj* pGrafObj = mpView->InsertGraphic(aGraphic, nAction, aPos, pPickObj, NULL);
+ SdrGrafObj* pGrafObj = mpView->InsertGraphic(
+ aGraphic,
+ nAction,
+ mpWindow->GetLogicRange().getCenter(),
+ pPickObj,
+ 0);
if(pGrafObj && aDlg.IsAsLink())
{
// store link only?
String aFltName(aDlg.GetCurrentFilter());
String aPath(aDlg.GetPath());
+
pGrafObj->SetGraphicLink(aPath, aFltName);
}
}
@@ -167,9 +168,10 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
}
}
-#ifdef _MSC_VER
-#pragma optimize ( "", on )
-#endif
+// TTTT needed? Check!
+//#ifdef _MSC_VER
+//#pragma optimize ( "", on )
+//#endif
/*************************************************************************
|*
@@ -225,9 +227,9 @@ void FuInsertClipboard::DoExecute( SfxRequest& )
sal_Int8 nAction = DND_ACTION_COPY;
if( !mpView->InsertData( aDataHelper,
- mpWindow->PixelToLogic( Rectangle( Point(), mpWindow->GetOutputSizePixel() ).Center() ),
- nAction, sal_False, nFormatId ) &&
- ( mpViewShell && mpViewShell->ISA( DrawViewShell ) ) )
+ mpWindow->GetLogicRange().getCenter(),
+ nAction, false, nFormatId ) &&
+ ( mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell) ) )
{
DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>(mpViewShell);
INetBookmark aINetBookmark( aEmptyStr, aEmptyStr );
@@ -239,7 +241,7 @@ void FuInsertClipboard::DoExecute( SfxRequest& )
( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
{
- pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
+ pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, 0);
}
}
}
@@ -302,20 +304,22 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
+ basegfx::B2DHomMatrix aObjTrans;
- Rectangle aRect;
if( pPickObj )
{
- aRect = pPickObj->GetLogicRect();
-
+ const basegfx::B2DVector& rScale(pPickObj->getSdrObjectScale());
awt::Size aSz;
- aSz.Width = aRect.GetWidth();
- aSz.Height = aRect.GetHeight();
+
+ aObjTrans = pPickObj->getSdrObjectTransformation();
+ aSz.Width = basegfx::fround(fabs(rScale.getX()));
+ aSz.Height = basegfx::fround(fabs(rScale.getY()));
xObj->setVisualAreaSize( nAspect, aSz );
}
else
{
awt::Size aSz;
+
try
{
aSz = xObj->getVisualAreaSize( nAspect );
@@ -325,51 +329,58 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
// the default size will be set later
}
- Size aSize( aSz.Width, aSz.Height );
+ basegfx::B2DVector aScale(aSz.Width, aSz.Height);
- if (aSize.Height() == 0 || aSize.Width() == 0)
+ if(basegfx::fTools::equalZero(aScale.getX()) || basegfx::fTools::equalZero(aScale.getY()))
{
// Rechteck mit ausgewogenem Kantenverhaeltnis
- aSize.Width() = 14100;
- aSize.Height() = 10000;
- Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aUnit );
- aSz.Width = aTmp.Width();
- aSz.Height = aTmp.Height();
- xObj->setVisualAreaSize( nAspect, aSz );
+ const double fFactor(OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, aUnit));
+
+ aScale = basegfx::B2DVector(14100.0, 10000.0);
+ aSz.Width = basegfx::fround(fabs(aScale.getX() * fFactor));
+ aSz.Height = basegfx::fround(fabs(aScale.getY() * fFactor));
+ xObj->setVisualAreaSize(nAspect, aSz);
}
else
{
- aSize = OutputDevice::LogicToLogic(aSize, aUnit, MAP_100TH_MM);
+ aScale *= OutputDevice::GetFactorLogicToLogic(aUnit, MAP_100TH_MM);
}
- Point aPos;
- Rectangle aWinRect(aPos, mpWindow->GetOutputSizePixel() );
- aPos = aWinRect.Center();
- aPos = mpWindow->PixelToLogic(aPos);
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- aRect = Rectangle(aPos, aSize);
+ aObjTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ mpWindow->GetLogicRange().getCenter() - (aScale * 0.5));
}
- SdrOle2Obj* pOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aObjName, aRect );
- SdrPageView* pPV = mpView->GetSdrPageView();
+ SdrOle2Obj* pOleObj = new SdrOle2Obj(
+ mpView->getSdrModelFromSdrView(),
+ svt::EmbeddedObjectRef( xObj, nAspect ),
+ aObjName,
+ aObjTrans);
// if we have a pick obj we need to make this new ole a pres obj replacing the current pick obj
if( pPickObj )
{
- SdPage* pPage = static_cast< SdPage* >(pPickObj->GetPage());
+ SdPage* pPage = static_cast< SdPage* >(pPickObj->getSdrPageFromSdrObject());
if(pPage && pPage->IsPresObj(pPickObj))
{
pPage->InsertPresObj( pOleObj, ePresObjKind );
- pOleObj->SetUserCall(pPickObj->GetUserCall());
+
+ // replace formally used 'pOleObj->SetUserCall(pPickObj->GetUserCall())' by
+ // new notify/listener mechanism
+ SdPage* pCurrentlyConnectedSdPage = findConnectionToSdrObject(pPickObj);
+ establishConnectionToSdrObject(pOleObj, pCurrentlyConnectedSdPage);
}
}
bool bRet = true;
if( pPickObj )
- mpView->ReplaceObjectAtView(pPickObj, *pPV, pOleObj, sal_True );
+ {
+ mpView->ReplaceObjectAtView(*pPickObj, *pOleObj, true );
+ }
else
- bRet = mpView->InsertObjectAtView(pOleObj, *pPV, SDRINSERT_SETDEFLAYER);
+ {
+ bRet = mpView->InsertObjectAtView(*pOleObj, SDRINSERT_SETDEFLAYER);
+ }
if( bRet )
{
@@ -386,9 +397,11 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
pOleObj->SetProgName( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarMath" ) ) );
}
- //HMHmpView->HideMarkHdl();
- pOleObj->SetLogicRect(aRect);
- Size aTmp( OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aUnit ) );
+ pOleObj->setSdrObjectTransformation(aObjTrans);
+ const basegfx::B2DVector& rScale = pOleObj->getSdrObjectScale();
+ const sal_Int32 nWidth(basegfx::fround(fabs(rScale.getX())));
+ const sal_Int32 nHeight(basegfx::fround(fabs(rScale.getY())));
+ Size aTmp(OutputDevice::LogicToLogic(Size(nWidth, nHeight), MAP_100TH_MM, aUnit));
awt::Size aVisualSize;
aVisualSize.Width = aTmp.Width();
aVisualSize.Height = aTmp.Height();
@@ -400,7 +413,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
// note, that this call modified the chart model which
// results in a change notification. So call this after
// everything else is finished.
- ChartHelper::AdaptDefaultsForChart( xObj );
+ mpViewShell->AdaptDefaultsForChart( xObj );
}
}
}
@@ -416,7 +429,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
* Objekt einfuegen
**********************************************************************/
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
- sal_Bool bCreateNew = sal_False;
+ bool bCreateNew = false;
uno::Reference < embed::XEmbeddedObject > xObj;
uno::Reference < embed::XStorage > xStorage = comphelper::OStorageHelper::GetTemporaryStorage();
SvObjectServerList aServerLst;
@@ -425,7 +438,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
::rtl::OUString aIconMediaType;
uno::Reference< io::XInputStream > xIconMetaFile;
- SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT );
if ( nSlotId == SID_INSERT_OBJECT && pNameItem )
{
SvGlobalName aClassName = pNameItem->GetValue();
@@ -524,12 +537,12 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
{
//TODO/LATER: needs status for RESIZEONPRINTERCHANGE
//if( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->getStatus( nAspect ) )
- // aIPObj->OnDocumentPrinterChanged( mpDocSh->GetPrinter(sal_False) );
+ // aIPObj->OnDocumentPrinterChanged( mpDocSh->GetPrinter(false) );
- sal_Bool bInsertNewObject = sal_True;
-
- Size aSize;
+ bool bInsertNewObject = true;
+ basegfx::B2DVector aSize(0.0, 0.0);
MapUnit aMapUnit = MAP_100TH_MM;
+
if ( nAspect != embed::Aspects::MSOLE_ICON )
{
awt::Size aSz;
@@ -542,98 +555,90 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
// the default size will be set later
}
- aSize =Size( aSz.Width, aSz.Height );
+ aSize = basegfx::B2DVector( aSz.Width, aSz.Height );
aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- if (aSize.Height() == 0 || aSize.Width() == 0)
+ if(basegfx::fTools::equalZero(aSize.getX()) || basegfx::fTools::equalZero(aSize.getY()))
{
// Rechteck mit ausgewogenem Kantenverhaeltnis
- aSize.Width() = 14100;
- aSize.Height() = 10000;
- Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aMapUnit );
- aSz.Width = aTmp.Width();
- aSz.Height = aTmp.Height();
+ aSize.setX(14100.0);
+ aSize.setY(10000.0);
+ const basegfx::B2DVector aTemp(aSize * OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, aMapUnit));
+ aSz.Width = basegfx::fround(aTemp.getX());
+ aSz.Height = basegfx::fround(aTemp.getY());
xObj->setVisualAreaSize( nAspect, aSz );
}
else
{
- aSize = OutputDevice::LogicToLogic(aSize, aMapUnit, MAP_100TH_MM);
+ aSize *= OutputDevice::GetFactorLogicToLogic(aMapUnit, MAP_100TH_MM);
}
}
- if ( mpView->AreObjectsMarked() )
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(mpView->getSelectedIfSingle());
+
+ if ( pSdrOle2Obj )
{
/**********************************************************
* Ist ein leeres OLE-Objekt vorhanden?
**********************************************************/
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- if (pObj->GetObjInventor() == SdrInventor &&
- pObj->GetObjIdentifier() == OBJ_OLE2)
- {
- if ( !( (SdrOle2Obj*) pObj)->GetObjRef().is() )
+ if ( !pSdrOle2Obj->GetObjRef().is() )
{
/**************************************************
* Das leere OLE-Objekt bekommt ein neues IPObj
**************************************************/
- bInsertNewObject = sal_False;
- pObj->SetEmptyPresObj(sal_False);
- ( (SdrOle2Obj*) pObj)->SetOutlinerParaObject(NULL);
- ( (SdrOle2Obj*) pObj)->SetObjRef(xObj);
- ( (SdrOle2Obj*) pObj)->SetPersistName(aName);
- ( (SdrOle2Obj*) pObj)->SetName(aName);
- ( (SdrOle2Obj*) pObj)->SetAspect(nAspect);
- Rectangle aRect = ( (SdrOle2Obj*) pObj)->GetLogicRect();
-
- //HMHmpView->HideMarkHdl();
+ bInsertNewObject = false;
+ pSdrOle2Obj->SetEmptyPresObj(false);
+ pSdrOle2Obj->SetOutlinerParaObject(NULL);
+ pSdrOle2Obj->SetObjRef(xObj);
+ pSdrOle2Obj->SetPersistName(aName);
+ pSdrOle2Obj->SetName(aName);
+ pSdrOle2Obj->SetAspect(nAspect);
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
if( xIconMetaFile.is() )
- ( (SdrOle2Obj*) pObj)->SetGraphicToObj( xIconMetaFile, aIconMediaType );
+ pSdrOle2Obj->SetGraphicToObj( xIconMetaFile, aIconMediaType );
}
else
{
- Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aMapUnit );
- awt::Size aSz( aTmp.Width(), aTmp.Height() );
+ const basegfx::B2DVector aTemp(sdr::legacy::GetLogicRange(*pSdrOle2Obj).getRange() *
+ OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, aMapUnit));
+ const awt::Size aSz(basegfx::fround(aTemp.getX()), basegfx::fround(aTemp.getY()));
+
xObj->setVisualAreaSize( nAspect, aSz );
}
}
}
- }
- }
if (bInsertNewObject)
{
/**************************************************************
* Ein neues OLE-Objekt wird erzeugt
**************************************************************/
- SdrPageView* pPV = mpView->GetSdrPageView();
- Size aPageSize = pPV->GetPage()->GetSize();
-
// get the size from the iconified object
::svt::EmbeddedObjectRef aObjRef( xObj, nAspect );
+
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
aObjRef.SetGraphicStream( xIconMetaFile, aIconMediaType );
MapMode aMapMode( MAP_100TH_MM );
- aSize = aObjRef.GetSize( &aMapMode );
+ const Size aOldSize(aObjRef.GetSize( &aMapMode ));
+ aSize = basegfx::B2DVector(aOldSize.Width(), aOldSize.Height());
}
- Point aPnt ((aPageSize.Width() - aSize.Width()) / 2,
- (aPageSize.Height() - aSize.Height()) / 2);
- Rectangle aRect (aPnt, aSize);
+ SdrPageView* pPV = mpView->GetSdrPageView();
+ const basegfx::B2DVector aPageScale(pPV ? pPV->getSdrPageFromSdrPageView().GetPageScale() : basegfx::B2DVector(0.0, 0.0));
+ const basegfx::B2DPoint aPnt((aPageScale - aSize) * 0.5);
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect);
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ mpView->getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aSize, aPnt));
- if( mpView->InsertObjectAtView(pObj, *pPV, SDRINSERT_SETDEFLAYER) )
+ if( mpView->InsertObjectAtView(*pObj, SDRINSERT_SETDEFLAYER) )
{
- // #73279# Math objects change their object size during InsertObject.
+ // #73279# Math objects change their object size during InsertObjectToSdrObjList.
// New size must be set in SdrObject, or a wrong scale will be set at
// ActivateObject.
@@ -641,14 +646,13 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
{
try
{
- awt::Size aSz = xObj->getVisualAreaSize( nAspect );
+ const awt::Size aSz = xObj->getVisualAreaSize( nAspect );
+ const basegfx::B2DVector aNewSize(basegfx::B2DVector(aSz.Width, aSz.Height) *
+ Window::GetFactorLogicToLogic(aMapUnit, MAP_100TH_MM));
- Size aNewSize = Window::LogicToLogic( Size( aSz.Width, aSz.Height ),
- MapMode( aMapUnit ), MapMode( MAP_100TH_MM ) );
- if ( aNewSize != aSize )
+ if(!aNewSize.equal(aSize))
{
- aRect.SetSize( aNewSize );
- pObj->SetLogicRect( aRect );
+ sdr::legacy::SetLogicRange(*pObj, basegfx::B2DRange(aPnt, aPnt + aNewSize));
}
}
catch( embed::NoVisualAreaSizeException& )
@@ -657,23 +661,24 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
if (bCreateNew)
{
- //HMHmpView->HideMarkHdl();
- pObj->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pObj, basegfx::B2DRange(aPnt, aPnt + aSize));
if ( nAspect != embed::Aspects::MSOLE_ICON )
{
- Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MAP_100TH_MM, aMapUnit );
- awt::Size aSz( aTmp.Width(), aTmp.Height() );
+ const basegfx::B2DVector aTemp(aSize * OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, aMapUnit));
+ const awt::Size aSz(basegfx::fround(aTemp.getX()), basegfx::fround(aTemp.getY()));
xObj->setVisualAreaSize( nAspect, aSz );
}
mpViewShell->ActivateObject(pObj, SVVERB_SHOW);
}
- Size aVisSizePixel = mpWindow->GetOutputSizePixel();
- Rectangle aVisAreaWin = mpWindow->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- mpViewShell->VisAreaChanged(aVisAreaWin);
- mpDocSh->SetVisArea(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(mpWindow->GetLogicRange());
+ const Rectangle aOldArea(
+ basegfx::fround(aVisAreaWin.getMinX()), basegfx::fround(aVisAreaWin.getMinY()),
+ basegfx::fround(aVisAreaWin.getMaxX()), basegfx::fround(aVisAreaWin.getMaxY()));
+ mpViewShell->VisAreaChanged(aOldArea);
+ mpDocSh->SetVisArea(aOldArea);
}
}
}
@@ -718,7 +723,7 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
if( pReqArgs )
{
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, &pReqArgs->Get( rReq.GetSlot() ) );
+ const SfxStringItem* pStringItem = dynamic_cast< const SfxStringItem* >(&pReqArgs->Get( rReq.GetSlot() ) );
if( pStringItem )
{
@@ -744,31 +749,35 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq )
}
else
{
- Point aPos;
- Size aSize;
- sal_Int8 nAction = DND_ACTION_COPY;
+ basegfx::B2DPoint aPosition(0.0, 0.0);
+ basegfx::B2DVector aScale(aPrefSize.Width(), aPrefSize.Height());
- if( aPrefSize.Width() && aPrefSize.Height() )
+ if(basegfx::fTools::equalZero(aScale.getX()) || basegfx::fTools::equalZero(aScale.getY()))
{
- if( mpWindow )
- aSize = mpWindow->PixelToLogic( aPrefSize, MAP_100TH_MM );
- else
- aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
+ aScale = basegfx::B2DVector(5000.0, 5000.0);
}
else
- aSize = Size( 5000, 5000 );
+ {
+ aScale *= Application::GetDefaultDevice()->GetFactorLogicToLogic(MAP_PIXEL, MAP_100TH_MM);
+ }
- if( mpWindow )
+ if(mpWindow)
{
- aPos = mpWindow->PixelToLogic( Rectangle( aPos, mpWindow->GetOutputSizePixel() ).Center() );
- aPos.X() -= aSize.Width() >> 1;
- aPos.Y() -= aSize.Height() >> 1;
+ aPosition = mpWindow->GetLogicRange().getCenter() - (aScale * 0.5);
}
- mpView->InsertMediaURL( aURL, nAction, aPos, aSize ) ;
+ sal_Int8 nAction(DND_ACTION_COPY);
- if( mpWindow )
+ mpView->InsertMediaURL(
+ aURL,
+ nAction,
+ aPosition,
+ aScale);
+
+ if(mpWindow)
+ {
mpWindow->LeaveWait();
+ }
}
}
}
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 54c5a0f7dd27..d1251689327b 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -52,6 +52,7 @@
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <svx/svdlegacy.hxx>
#include "sdresid.hxx"
#include "drawdoc.hxx"
@@ -80,8 +81,6 @@ using namespace ::com::sun::star;
namespace sd {
-TYPEINIT1( FuInsertFile, FuPoor );
-
#define POOL_BUFFER_SIZE (sal_uInt16)32768
#define BASIC_BUFFER_SIZE (sal_uInt16)8192
#define DOCUMENT_BUFFER_SIZE (sal_uInt16)32768
@@ -255,8 +254,8 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
}
else
{
- SFX_REQUEST_ARG (rReq, pFileName, SfxStringItem, ID_VAL_DUMMY0, sal_False);
- SFX_REQUEST_ARG (rReq, pFilterName, SfxStringItem, ID_VAL_DUMMY1, sal_False);
+ SFX_REQUEST_ARG (rReq, pFileName, SfxStringItem, ID_VAL_DUMMY0 );
+ SFX_REQUEST_ARG (rReq, pFilterName, SfxStringItem, ID_VAL_DUMMY1 );
aFile = pFileName->GetValue ();
@@ -264,15 +263,15 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
aFilterName = pFilterName->GetValue ();
}
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
- SfxMedium* pMedium = new SfxMedium( aFile, STREAM_READ | STREAM_NOCREATE, sal_False );
+ SfxMedium* pMedium = new SfxMedium( aFile, STREAM_READ | STREAM_NOCREATE, false );
const SfxFilter* pFilter = NULL;
SFX_APP()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
- sal_Bool bDrawMode = mpViewShell && mpViewShell->ISA(DrawViewShell);
- sal_Bool bInserted = sal_False;
+ bool bDrawMode = mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell);
+ bool bInserted = false;
if( pFilter )
{
@@ -292,19 +291,19 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
InsSDDinOlMode( pMedium );
// don't delete Medium here, ownership of pMedium has changed in this case
- bInserted = sal_True;
+ bInserted = true;
}
}
else
{
- sal_Bool bFound = ( ::std::find( aFilterVector.begin(), aFilterVector.end(), pFilter->GetMimeType() ) != aFilterVector.end() );
+ bool bFound = ( ::std::find( aFilterVector.begin(), aFilterVector.end(), pFilter->GetMimeType() ) != aFilterVector.end() );
if( !bFound &&
( aFilterName.SearchAscii( "Text" ) != STRING_NOTFOUND ||
aFilterName.SearchAscii( "Rich" ) != STRING_NOTFOUND ||
aFilterName.SearchAscii( "RTF" ) != STRING_NOTFOUND ||
aFilterName.SearchAscii( "HTML" ) != STRING_NOTFOUND ) )
{
- bFound = sal_True;
+ bFound = true;
}
if( bFound )
@@ -314,13 +313,13 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
else
InsTextOrRTFinOlMode(pMedium);
- bInserted = sal_True;
+ bInserted = true;
delete pMedium;
}
}
}
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
if( !bInserted )
{
@@ -332,19 +331,19 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
// -----------------------------------------------------------------------------
-sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
+bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
{
- sal_Bool bOK = sal_False;
+ bool bOK = false;
// Liste mit Seitennamen (wenn NULL, dann alle Seiten)
List* pBookmarkList = NULL;
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
AbstractSdInsertPagesObjsDlg* pDlg = pFact ? pFact->CreateSdInsertPagesObjsDlg( NULL, mpDoc, pMedium, aFile ) : 0;
if( !pDlg )
- return sal_False;
+ return false;
// Ev. wird eine QueryBox geoeffnet ("Links aktualisieren?"),
// daher wird der Dialog der aktuelle DefModalDialogParent
@@ -355,41 +354,44 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
GetpApp()->SetDefDialogParent(pDefParent);
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
if( nRet == RET_OK )
{
// Zuerst Seiten einfuegen
pBookmarkList = pDlg->GetList( 1 ); // Seiten
- sal_Bool bLink = pDlg->IsLink();
- sal_Bool bReplace = sal_False;
+ bool bLink = pDlg->IsLink();
+ bool bReplace = false;
SdPage* pPage = NULL;
::sd::View* pView = mpViewShell->GetView();
- if (pView->ISA(OutlineView))
+ if (dynamic_cast< OutlineView* >(pView))
{
pPage = static_cast<OutlineView*>(pView)->GetActualPage();
}
else
{
- pPage = static_cast<SdPage*>(pView->GetSdrPageView()->GetPage());
+ if(pView->GetSdrPageView())
+ {
+ pPage = static_cast< SdPage* >(&pView->GetSdrPageView()->getSdrPageFromSdrPageView());
+ }
}
- sal_uInt16 nPos = 0xFFFF;
+ sal_uInt32 nPos = 0xffffffff;
if (pPage && !pPage->IsMasterPage())
{
if (pPage->GetPageKind() == PK_STANDARD)
{
- nPos = pPage->GetPageNum() + 2;
+ nPos = pPage->GetPageNumber() + 2;
}
else if (pPage->GetPageKind() == PK_NOTES)
{
- nPos = pPage->GetPageNum() + 1;
+ nPos = pPage->GetPageNumber() + 1;
}
}
- sal_Bool bNameOK;
+ bool bNameOK;
List* pObjectBookmarkList = pDlg->GetList( 2 ); // Objekte
List* pExchangeList = NULL;
@@ -400,13 +402,13 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
// Um zu gewaehrleisten, dass alle Seitennamen eindeutig sind, werden
// die einzufuegenden geprueft und gegebenenfalls in einer Ersatzliste
// aufgenommen
- // bNameOK == sal_False -> Benutzer hat abgebrochen
+ // bNameOK == false -> Benutzer hat abgebrochen
bNameOK = mpView->GetExchangeList( pExchangeList, pBookmarkList, 0 );
if( bNameOK )
bOK = mpDoc->InsertBookmarkAsPage( pBookmarkList, pExchangeList,
bLink, bReplace, nPos,
- sal_False, NULL, sal_True, sal_True, sal_False );
+ false, NULL, true, true, false );
// Loeschen der BookmarkList
if( pBookmarkList )
@@ -487,10 +489,10 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
if( !pDlg )
return;
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
sal_uInt16 nRet = pDlg->Execute();
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
if( nRet == RET_OK )
{
@@ -522,7 +524,8 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
aLayoutName = pPage->GetLayoutName();
aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR));
- pOutliner->SetPaperSize(pPage->GetSize());
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
+ pOutliner->SetPaperSize(Size(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY())));
SvStream* pStream = pMedium->GetInStream();
DBG_ASSERT( pStream, "Kein InStream!" );
@@ -576,30 +579,33 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
}
else
{
- SdrRectObj* pTO = new SdrRectObj(OBJ_TEXT);
+ const bool bUndo(mpView->IsUndoEnabled());
+ SdrRectObj* pTO = new SdrRectObj(
+ *GetDoc(),
+ basegfx::B2DHomMatrix(),
+ OBJ_TEXT,
+ true);
pTO->SetOutlinerParaObject(pOPO);
- const bool bUndo = mpView->IsUndoEnabled();
if( bUndo )
+ {
mpView->BegUndo(String(SdResId(STR_UNDO_INSERT_TEXTFRAME)));
- pPage->InsertObject(pTO);
+ }
+
+ pPage->InsertObjectToSdrObjList(*pTO);
- // koennte groesser sein als die max. erlaubte Groesse:
- // falls noetig, die Objektgroesse begrenzen
- Size aSize(pOutliner->CalcTextSize());
- Size aMaxSize = mpDoc->GetMaxObjSize();
- aSize.Height() = Min(aSize.Height(), aMaxSize.Height());
- aSize.Width() = Min(aSize.Width(), aMaxSize.Width());
- aSize = mpWindow->LogicToPixel(aSize);
+ // limit object size
+ const Size aSize(pOutliner->CalcTextSize());
+ const basegfx::B2DVector aObjectScale(basegfx::minimum(basegfx::B2DTuple(aSize.Width(), aSize.Height()), mpDoc->GetMaxObjectScale()));
// in der Mitte des Fensters absetzen
- Size aTemp(mpWindow->GetOutputSizePixel());
- Point aPos(aTemp.Width() / 2, aTemp.Height() / 2);
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- aSize = mpWindow->PixelToLogic(aSize);
- aPos = mpWindow->PixelToLogic(aPos);
- pTO->SetLogicRect(Rectangle(aPos, aSize));
+ const basegfx::B2DRange aVisible(mpWindow->GetLogicRange());
+ const basegfx::B2DPoint aObjectPos(aVisible.getCenter() - (aObjectScale * 0.5));
+
+ pTO->setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aObjectScale,
+ aObjectPos));
if (pDlg->IsLink())
{
@@ -643,7 +649,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
sal_uLong nTargetPos = pDocliner->GetAbsPos(pPara) + 1;
// Layout der Vorgaengerseite uebernehmen
- sal_uInt16 nPage = 0;
+ sal_uInt32 nPage = 0;
pPara = pDocliner->GetParagraph( pDocliner->GetAbsPos( pPara ) - 1 );
while (pPara)
{
@@ -697,7 +703,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
pPara = pOutliner->GetParagraph( ++nPos );
}
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
SfxProgress* pProgress = new SfxProgress( mpDocSh, String( SdResId(STR_CREATE_PAGES)), nNewPages);
if( pProgress )
@@ -746,7 +752,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
if( pProgress )
delete pProgress;
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
}
delete pOutliner;
@@ -754,7 +760,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
// -----------------------------------------------------------------------------
-sal_Bool FuInsertFile::InsSDDinOlMode(SfxMedium* pMedium)
+bool FuInsertFile::InsSDDinOlMode(SfxMedium* pMedium)
{
OutlineView* pOlView = static_cast<OutlineView*>(mpView);
@@ -792,10 +798,10 @@ sal_Bool FuInsertFile::InsSDDinOlMode(SfxMedium* pMedium)
pOutliner->SetEndMovingHdl(aOldEndMovingHdl);
pOutliner->SetStatusEventHdl(aOldStatusEventHdl);
- return sal_True;
+ return true;
}
else
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
diff --git a/sd/source/ui/func/fuline.cxx b/sd/source/ui/func/fuline.cxx
index d7e4108b5d94..6b3ab8b2e891 100644
--- a/sd/source/ui/func/fuline.cxx
+++ b/sd/source/ui/func/fuline.cxx
@@ -49,8 +49,6 @@
namespace sd {
-TYPEINIT1( FuLine, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -76,18 +74,13 @@ FunctionReference FuLine::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::
void FuLine::DoExecute( SfxRequest& rReq )
{
- sal_Bool bHasMarked = mpView->AreObjectsMarked();
-
+ bool bHasMarked = mpView->areSdrObjectsSelected();
const SfxItemSet* pArgs = rReq.GetArgs();
if( !pArgs )
{
- const SdrObject* pObj = NULL;
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- SfxItemSet* pNewAttr = new SfxItemSet( mpDoc->GetPool() );
+ const SdrObject* pObj = mpView->getSelectedIfSingle();
+ SfxItemSet* pNewAttr = new SfxItemSet( mpDoc->GetItemPool() );
mpView->GetAttributes( *pNewAttr );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index 41b3676c8bc1..2c25d6596e78 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -48,8 +48,6 @@ namespace sd {
#define BITMAP_WIDTH 32
#define BITMAP_HEIGHT 12
-TYPEINIT1( FuLineEnd, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -71,42 +69,41 @@ FunctionReference FuLineEnd::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::s
void FuLineEnd::DoExecute( SfxRequest& )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ const SdrObject* pSelected = mpView->getSelectedIfSingle();
- if( rMarkList.GetMarkCount() == 1 )
+ if( pSelected )
{
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
const SdrObject* pNewObj;
SdrObject* pConvPolyObj = NULL;
- if( pObj->ISA( SdrPathObj ) )
+ if( dynamic_cast< const SdrPathObj* >(pSelected) )
{
- pNewObj = pObj;
+ pNewObj = pSelected;
}
else
{
SdrObjTransformInfoRec aInfoRec;
- pObj->TakeObjInfo( aInfoRec );
+ pSelected->TakeObjInfo( aInfoRec );
- if( aInfoRec.bCanConvToPath &&
- pObj->GetObjInventor() == SdrInventor &&
- pObj->GetObjIdentifier() != OBJ_GRUP )
- // bCanConvToPath ist bei Gruppenobjekten sal_True,
+ if( aInfoRec.mbCanConvToPath &&
+ pSelected->GetObjInventor() == SdrInventor &&
+ pSelected->GetObjIdentifier() != OBJ_GRUP )
+ // mbCanConvToPath ist bei Gruppenobjekten true,
// stuerzt aber bei ConvertToPathObj() ab !
{
- pNewObj = pConvPolyObj = pObj->ConvertToPolyObj( sal_True, sal_False );
+ pNewObj = pConvPolyObj = pSelected->ConvertToPolyObj( true, false );
- if( !pNewObj || !pNewObj->ISA( SdrPathObj ) )
+ if( !pNewObj || !dynamic_cast< const SdrPathObj* >(pNewObj) )
return; // Abbruch, zusaetzliche Sicherheit, die bei
// Gruppenobjekten aber nichts bringt.
}
else return; // Abbruch
}
- const ::basegfx::B2DPolyPolygon aPolyPolygon = ( (SdrPathObj*) pNewObj )->GetPathPoly();
+ const ::basegfx::B2DPolyPolygon aPolyPolygon = ( (SdrPathObj*) pNewObj )->getB2DPolyPolygonInObjectCoordinates();
// Loeschen des angelegten PolyObjektes
- SdrObject::Free( pConvPolyObj );
+ deleteSdrObjectSafeAndClearPointer( pConvPolyObj );
XLineEndList* pLineEndList = mpDoc->GetLineEndList();
XLineEndEntry* pEntry;
@@ -117,18 +114,18 @@ void FuLineEnd::DoExecute( SfxRequest& )
long nCount = pLineEndList->Count();
long j = 1;
- sal_Bool bDifferent = sal_False;
+ bool bDifferent = false;
while( !bDifferent )
{
aName = aNewName;
aName.Append( sal_Unicode(' ') );
aName.Append( UniString::CreateFromInt32( j++ ) );
- bDifferent = sal_True;
+ bDifferent = true;
for( long i = 0; i < nCount && bDifferent; i++ )
{
if( aName == pLineEndList->GetLineEnd( i )->GetName() )
- bDifferent = sal_False;
+ bDifferent = false;
}
}
@@ -142,12 +139,12 @@ void FuLineEnd::DoExecute( SfxRequest& )
if( pDlg->Execute() == RET_OK )
{
pDlg->GetName( aName );
- bDifferent = sal_True;
+ bDifferent = true;
for( long i = 0; i < nCount && bDifferent; i++ )
{
if( aName == pLineEndList->GetLineEnd( i )->GetName() )
- bDifferent = sal_False;
+ bDifferent = false;
}
if( bDifferent )
diff --git a/sd/source/ui/func/fulink.cxx b/sd/source/ui/func/fulink.cxx
index 3542671d2b9a..97b8321a2139 100644
--- a/sd/source/ui/func/fulink.cxx
+++ b/sd/source/ui/func/fulink.cxx
@@ -45,8 +45,6 @@ class SfxRequest;
namespace sd {
-TYPEINIT1( FuLink, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
diff --git a/sd/source/ui/func/fumeasur.cxx b/sd/source/ui/func/fumeasur.cxx
index 78c57bb2b26c..9b6a58c976f8 100644
--- a/sd/source/ui/func/fumeasur.cxx
+++ b/sd/source/ui/func/fumeasur.cxx
@@ -36,8 +36,6 @@
namespace sd {
-TYPEINIT1( FuMeasureDlg, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -63,7 +61,7 @@ FunctionReference FuMeasureDlg::Create( ViewShell* pViewSh, ::sd::Window* pWin,
void FuMeasureDlg::DoExecute( SfxRequest& rReq )
{
- SfxItemSet aNewAttr( mpDoc->GetPool() );
+ SfxItemSet aNewAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aNewAttr );
const SfxItemSet* pArgs = rReq.GetArgs();
diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx
index 6cce2090ec86..14bd476ffcf7 100644
--- a/sd/source/ui/func/fumorph.cxx
+++ b/sd/source/ui/func/fumorph.cxx
@@ -35,6 +35,7 @@
#include <svx/svdogrp.hxx>
#include <editeng/eeitem.hxx>
+#include "drawdoc.hxx"
#include "View.hxx"
#include "ViewShell.hxx"
#include "Window.hxx"
@@ -56,7 +57,6 @@
namespace sd {
#define ITEMVALUE( ItemSet, Id, Cast ) ( ( (const Cast&) (ItemSet).Get( (Id) ) ).GetValue() )
-TYPEINIT1( FuMorph, FuPoor );
//////////////////////////////////////////////////////////////////////////////
// constructor
@@ -80,23 +80,23 @@ FunctionReference FuMorph::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd:
void FuMorph::DoExecute( SfxRequest& )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ const SdrObjectVector aSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
- if(rMarkList.GetMarkCount() == 2)
+ if(2 == aSelection.size())
{
// Clones erzeugen
- SdrObject* pObj1 = rMarkList.GetMark(0)->GetMarkedSdrObj();
- SdrObject* pObj2 = rMarkList.GetMark(1)->GetMarkedSdrObj();
- SdrObject* pCloneObj1 = pObj1->Clone();
- SdrObject* pCloneObj2 = pObj2->Clone();
+ SdrObject* pObj1 = aSelection[0];
+ SdrObject* pObj2 = aSelection[1];
+ SdrObject* pCloneObj1 = pObj1->CloneSdrObject();
+ SdrObject* pCloneObj2 = pObj2->CloneSdrObject();
// Text am Clone loeschen, da wir sonst kein richtiges PathObj bekommen
pCloneObj1->SetOutlinerParaObject(NULL);
pCloneObj2->SetOutlinerParaObject(NULL);
// Path-Objekte erzeugen
- SdrObject* pPolyObj1 = pCloneObj1->ConvertToPolyObj(sal_False, sal_False);
- SdrObject* pPolyObj2 = pCloneObj2->ConvertToPolyObj(sal_False, sal_False);
+ SdrObject* pPolyObj1 = pCloneObj1->ConvertToPolyObj(false, false);
+ SdrObject* pPolyObj2 = pCloneObj2->ConvertToPolyObj(false, false);
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
AbstractMorphDlg* pDlg = pFact ? pFact->CreateMorphDlg( static_cast< ::Window*>(mpWindow), pObj1, pObj2 ) : 0;
if(pPolyObj1 && pPolyObj2 && pDlg && (pDlg->Execute() == RET_OK))
@@ -115,16 +115,22 @@ void FuMorph::DoExecute( SfxRequest& )
while(aIter1.IsMore())
{
- SdrObject* pObj = aIter1.Next();
- if(pObj && pObj->ISA(SdrPathObj))
- aPolyPoly1.append(((SdrPathObj*)pObj)->GetPathPoly());
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(aIter1.Next());
+
+ if(pSdrPathObj)
+ {
+ aPolyPoly1.append(pSdrPathObj->getB2DPolyPolygonInObjectCoordinates());
+ }
}
while(aIter2.IsMore())
{
- SdrObject* pObj = aIter2.Next();
- if(pObj && pObj->ISA(SdrPathObj))
- aPolyPoly2.append(((SdrPathObj*)pObj)->GetPathPoly());
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(aIter2.Next());
+
+ if(pSdrPathObj)
+ {
+ aPolyPoly2.append(pSdrPathObj->getB2DPolyPolygonInObjectCoordinates());
+ }
}
// Morphing durchfuehren
@@ -169,7 +175,7 @@ void FuMorph::DoExecute( SfxRequest& )
if(ImpMorphPolygons(aPolyPoly1, aPolyPoly2, pDlg->GetFadeSteps(), aPolyPolyList))
{
- String aString(mpView->GetDescriptionOfMarkedObjects());
+ String aString(getSelectionDescription(aSelection));
aString.Append(sal_Unicode(' '));
aString.Append(String(SdResId(STR_UNDO_MORPHING)));
@@ -187,11 +193,11 @@ void FuMorph::DoExecute( SfxRequest& )
}
}
delete pDlg;
- SdrObject::Free( pCloneObj1 );
- SdrObject::Free( pCloneObj2 );
+ deleteSdrObjectSafeAndClearPointer( pCloneObj1 );
+ deleteSdrObjectSafeAndClearPointer( pCloneObj2 );
- SdrObject::Free( pPolyObj1 );
- SdrObject::Free( pPolyObj2 );
+ deleteSdrObjectSafeAndClearPointer( pPolyObj1 );
+ deleteSdrObjectSafeAndClearPointer( pPolyObj2 );
}
}
@@ -327,7 +333,7 @@ void FuMorph::ImpAddPolys(::basegfx::B2DPolyPolygon& rSmaller, const ::basegfx::
//////////////////////////////////////////////////////////////////////////////
// create group object with morphed polygons
//
-void FuMorph::ImpInsertPolygons(List& rPolyPolyList3D, sal_Bool bAttributeFade,
+void FuMorph::ImpInsertPolygons(List& rPolyPolyList3D, bool bAttributeFade,
const SdrObject* pObj1, const SdrObject* pObj2)
{
Color aStartFillCol;
@@ -336,15 +342,13 @@ void FuMorph::ImpInsertPolygons(List& rPolyPolyList3D, sal_Bool bAttributeFade,
Color aEndLineCol;
long nStartLineWidth = 0;
long nEndLineWidth = 0;
- SdrPageView* pPageView = mpView->GetSdrPageView();
- SfxItemPool* pPool = pObj1->GetObjectItemPool();
- SfxItemSet aSet1( *pPool,SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END,0 );
+ SfxItemSet aSet1( pObj1->GetObjectItemPool(), SDRATTR_START, SDRATTR_NOTPERSIST_FIRST-1, EE_ITEMS_START, EE_ITEMS_END, 0, 0 );
SfxItemSet aSet2( aSet1 );
- sal_Bool bLineColor = sal_False;
- sal_Bool bFillColor = sal_False;
- sal_Bool bLineWidth = sal_False;
- sal_Bool bIgnoreLine = sal_False;
- sal_Bool bIgnoreFill = sal_False;
+ bool bLineColor = false;
+ bool bFillColor = false;
+ bool bLineWidth = false;
+ bool bIgnoreLine = false;
+ bool bIgnoreFill = false;
aSet1.Put(pObj1->GetMergedItemSet());
aSet2.Put(pObj2->GetMergedItemSet());
@@ -358,7 +362,7 @@ void FuMorph::ImpInsertPolygons(List& rPolyPolyList3D, sal_Bool bAttributeFade,
{
if ( ( eLineStyle1 != XLINE_NONE ) && ( eLineStyle2 != XLINE_NONE ) )
{
- bLineWidth = bLineColor = sal_True;
+ bLineWidth = bLineColor = true;
aStartLineCol = static_cast< XLineColorItem const & >(
aSet1.Get(XATTR_LINECOLOR)).GetColorValue();
@@ -369,72 +373,70 @@ void FuMorph::ImpInsertPolygons(List& rPolyPolyList3D, sal_Bool bAttributeFade,
nEndLineWidth = ITEMVALUE( aSet2, XATTR_LINEWIDTH, XLineWidthItem );
}
else if ( ( eLineStyle1 == XLINE_NONE ) && ( eLineStyle2 == XLINE_NONE ) )
- bIgnoreLine = sal_True;
+ bIgnoreLine = true;
if ( ( eFillStyle1 == XFILL_SOLID ) && ( eFillStyle2 == XFILL_SOLID ) )
{
- bFillColor = sal_True;
+ bFillColor = true;
aStartFillCol = static_cast< XFillColorItem const & >(
aSet1.Get(XATTR_FILLCOLOR)).GetColorValue();
aEndFillCol = static_cast< XFillColorItem const & >(
aSet2.Get(XATTR_FILLCOLOR)).GetColorValue();
}
else if ( ( eFillStyle1 == XFILL_NONE ) && ( eFillStyle2 == XFILL_NONE ) )
- bIgnoreFill = sal_True;
+ bIgnoreFill = true;
}
- if ( pPageView )
- {
- SfxItemSet aSet( aSet1 );
- SdrObjGroup* pObjGroup = new SdrObjGroup;
- SdrObjList* pObjList = pObjGroup->GetSubList();
- const sal_uLong nCount = rPolyPolyList3D.Count();
- const double fStep = 1. / ( nCount + 1 );
- const double fDelta = nEndLineWidth - nStartLineWidth;
- double fFactor = fStep;
-
- aSet.Put( XLineStyleItem( XLINE_SOLID ) );
- aSet.Put( XFillStyleItem( XFILL_SOLID ) );
-
- for ( sal_uLong i = 0; i < nCount; i++, fFactor += fStep )
- {
- const ::basegfx::B2DPolyPolygon& rPolyPoly3D = *(::basegfx::B2DPolyPolygon*)rPolyPolyList3D.GetObject(i);
- SdrPathObj* pNewObj = new SdrPathObj(OBJ_POLY, rPolyPoly3D);
-
- // Linienfarbe
- if ( bLineColor )
- {
- const basegfx::BColor aLineColor(basegfx::interpolate(aStartLineCol.getBColor(), aEndLineCol.getBColor(), fFactor));
- aSet.Put( XLineColorItem( aEmptyStr, Color(aLineColor)));
- }
- else if ( bIgnoreLine )
- aSet.Put( XLineStyleItem( XLINE_NONE ) );
-
- // Fuellfarbe
- if ( bFillColor )
- {
- const basegfx::BColor aFillColor(basegfx::interpolate(aStartFillCol.getBColor(), aEndFillCol.getBColor(), fFactor));
- aSet.Put( XFillColorItem( aEmptyStr, Color(aFillColor)));
- }
- else if ( bIgnoreFill )
- aSet.Put( XFillStyleItem( XFILL_NONE ) );
+ SfxItemSet aSet( aSet1 );
+ SdrObjGroup* pObjGroup = new SdrObjGroup(*GetDoc());
+ const sal_uInt32 nCount = rPolyPolyList3D.Count();
+ const double fStep = 1. / ( nCount + 1 );
+ const double fDelta = nEndLineWidth - nStartLineWidth;
+ double fFactor = fStep;
- // Linienstaerke
- if ( bLineWidth )
- aSet.Put( XLineWidthItem( nStartLineWidth + (long) ( fFactor * fDelta + 0.5 ) ) );
+ aSet.Put( XLineStyleItem( XLINE_SOLID ) );
+ aSet.Put( XFillStyleItem( XFILL_SOLID ) );
- pNewObj->SetMergedItemSetAndBroadcast(aSet);
+ for ( sal_uLong i = 0; i < nCount; i++, fFactor += fStep )
+ {
+ const ::basegfx::B2DPolyPolygon& rPolyPoly3D = *(::basegfx::B2DPolyPolygon*)rPolyPolyList3D.GetObject(i);
+ SdrPathObj* pNewObj = new SdrPathObj(
+ *GetDoc(),
+ rPolyPoly3D);
- pObjList->InsertObject( pNewObj, LIST_APPEND );
+ // Linienfarbe
+ if ( bLineColor )
+ {
+ const basegfx::BColor aLineColor(basegfx::interpolate(aStartLineCol.getBColor(), aEndLineCol.getBColor(), fFactor));
+ aSet.Put( XLineColorItem( aEmptyStr, Color(aLineColor)));
}
+ else if ( bIgnoreLine )
+ aSet.Put( XLineStyleItem( XLINE_NONE ) );
- if ( nCount )
+ // Fuellfarbe
+ if ( bFillColor )
{
- pObjList->InsertObject( pObj1->Clone(), 0 );
- pObjList->InsertObject( pObj2->Clone(), LIST_APPEND );
- mpView->DeleteMarked();
- mpView->InsertObjectAtView( pObjGroup, *pPageView, SDRINSERT_SETDEFLAYER );
+ const basegfx::BColor aFillColor(basegfx::interpolate(aStartFillCol.getBColor(), aEndFillCol.getBColor(), fFactor));
+ aSet.Put( XFillColorItem( aEmptyStr, Color(aFillColor)));
}
+ else if ( bIgnoreFill )
+ aSet.Put( XFillStyleItem( XFILL_NONE ) );
+
+ // Linienstaerke
+ if ( bLineWidth )
+ aSet.Put( XLineWidthItem( nStartLineWidth + (long) ( fFactor * fDelta + 0.5 ) ) );
+
+ pNewObj->SetMergedItemSetAndBroadcast(aSet);
+
+ pObjGroup->InsertObjectToSdrObjList(*pNewObj);
+ }
+
+ if ( nCount )
+ {
+ pObjGroup->InsertObjectToSdrObjList(*pObj1->CloneSdrObject(), 0 );
+ pObjGroup->InsertObjectToSdrObjList(*pObj2->CloneSdrObject());
+ mpView->DeleteMarked();
+ mpView->InsertObjectAtView( *pObjGroup, SDRINSERT_SETDEFLAYER );
}
}
@@ -502,7 +504,7 @@ sal_Bool FuMorph::ImpMorphPolygons(
rPolyPolyList3D.Insert(pNewPolyPoly2D, LIST_APPEND);
}
}
- return sal_True;
+ return true;
}
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index 51d3311ed3c2..326e9bde8dd8 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -24,9 +24,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
-
#include "fuoaprms.hxx"
-
#include "sdattr.hxx"
#include <svx/svdpagv.hxx>
#include <editeng/colritem.hxx>
@@ -41,6 +39,9 @@
#endif
#include <svl/aeitem.hxx>
#include "svx/xtable.hxx"
+#include <svx/svdlegacy.hxx>
+#include <vcl/salbtype.hxx> // FRound
+#include <basegfx/polygon/b2dpolygon.hxx>
#include "strings.hrc"
#include "glob.hrc"
@@ -52,15 +53,11 @@
#include "View.hxx"
#include "sdabstdlg.hxx"
#include "sdresid.hxx"
-#include <vcl/salbtype.hxx> // FRound
-#include <basegfx/polygon/b2dpolygon.hxx>
using namespace ::com::sun::star;
namespace sd {
-TYPEINIT1( FuObjectAnimationParameters, FuPoor );
-
#define ATTR_MISSING 0 // Attribut nicht verfuegbar
#define ATTR_MIXED 1 // Attribut uneindeutig (bei Mehrfachselektion)
#define ATTR_SET 2 // Attribut eindeutig
@@ -91,10 +88,7 @@ FunctionReference FuObjectAnimationParameters::Create( ViewShell* pViewSh, ::sd:
void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
{
::svl::IUndoManager* pUndoMgr = mpViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager();
-
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- sal_uLong nCount = rMarkList.GetMarkCount();
- sal_uLong nObject = 0;
+ sal_uInt32 nObject = 0;
short nAnimationSet = ATTR_MISSING;
short nEffectSet = ATTR_MISSING;
@@ -114,36 +108,35 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
short nSecondSoundOnSet = ATTR_MISSING;
short nSecondPlayFullSet = ATTR_MISSING;
-
-
-// sal_Bool bDontKnow = sal_False;
-
// defaulten (fuer Undo-Aktion)
presentation::AnimationEffect eEffect = presentation::AnimationEffect_NONE;
presentation::AnimationEffect eTextEffect = presentation::AnimationEffect_NONE;
presentation::AnimationSpeed eSpeed = presentation::AnimationSpeed_MEDIUM;
- sal_Bool bActive = sal_False;
- sal_Bool bFadeOut = sal_False;
+ bool bActive = false;
+ bool bFadeOut = false;
Color aFadeColor = COL_LIGHTGRAY;
- sal_Bool bInvisible = sal_False;
- sal_Bool bSoundOn = sal_False;
+ bool bInvisible = false;
+ bool bSoundOn = false;
String aSound;
- sal_Bool bPlayFull = sal_False;
+ bool bPlayFull = false;
presentation::ClickAction eClickAction = presentation::ClickAction_NONE;
String aBookmark;
presentation::AnimationEffect eSecondEffect = presentation::AnimationEffect_NONE;
presentation::AnimationSpeed eSecondSpeed = presentation::AnimationSpeed_MEDIUM;
- sal_Bool bSecondSoundOn = sal_False;
- sal_Bool bSecondPlayFull = sal_False;
-
+ bool bSecondSoundOn = false;
+ bool bSecondPlayFull = false;
- SdAnimationInfo* pInfo;
- SdrMark* pMark;
+ SdAnimationInfo* pInfo(0);
// das erste Objekt untersuchen
- pMark = rMarkList.GetMark(0);
- pInfo = mpDoc->GetAnimationInfo(pMark->GetMarkedSdrObj());
+ const SdrObjectVector aSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSelection.size())
+ {
+ pInfo = mpDoc->GetAnimationInfo(aSelection[0]);
+ }
+
if( pInfo )
{
bActive = pInfo->mbActive;
@@ -196,11 +189,11 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
}
// ggfs. weitere Objekte untersuchen
- for( nObject = 1; nObject < nCount; nObject++ )
+ for( nObject = 1; nObject < aSelection.size(); nObject++ )
{
- pMark = rMarkList.GetMark( nObject );
- SdrObject* pObject = pMark->GetMarkedSdrObj();
+ SdrObject* pObject = aSelection[nObject];
pInfo = mpDoc->GetAnimationInfo(pObject);
+
if( pInfo )
{
if( bActive != pInfo->mbActive )
@@ -253,7 +246,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
}
else
{
- if (nAnimationSet == ATTR_SET && bActive == sal_True)
+ if (nAnimationSet == ATTR_SET && bActive == true)
nAnimationSet = ATTR_MIXED;
if (nEffectSet == ATTR_SET && eEffect != presentation::AnimationEffect_NONE)
@@ -265,22 +258,22 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
if (nSpeedSet == ATTR_SET)
nSpeedSet = ATTR_MIXED;
- if (nFadeOutSet == ATTR_SET && bFadeOut == sal_True)
+ if (nFadeOutSet == ATTR_SET && bFadeOut == true)
nFadeOutSet = ATTR_MIXED;
if (nFadeColorSet == ATTR_SET)
nFadeColorSet = ATTR_MIXED;
- if (nInvisibleSet == ATTR_SET && bInvisible == sal_True)
+ if (nInvisibleSet == ATTR_SET && bInvisible == true)
nInvisibleSet = ATTR_MIXED;
- if (nSoundOnSet == ATTR_SET && bSoundOn == sal_True)
+ if (nSoundOnSet == ATTR_SET && bSoundOn == true)
nSoundOnSet = ATTR_MIXED;
if (nSoundFileSet == ATTR_SET)
nSoundFileSet = ATTR_MIXED;
- if (nPlayFullSet == ATTR_SET && bPlayFull == sal_True)
+ if (nPlayFullSet == ATTR_SET && bPlayFull == true)
nPlayFullSet = ATTR_MIXED;
if (nClickActionSet == ATTR_SET && eClickAction != presentation::ClickAction_NONE)
@@ -295,42 +288,42 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
if (nSecondSpeedSet == ATTR_SET)
nSecondSpeedSet = ATTR_MIXED;
- if (nSecondSoundOnSet == ATTR_SET && bSecondSoundOn == sal_True)
+ if (nSecondSoundOnSet == ATTR_SET && bSecondSoundOn == true)
nSecondSoundOnSet = ATTR_MIXED;
- if (nSecondPlayFullSet == ATTR_SET && bSecondPlayFull == sal_True)
+ if (nSecondPlayFullSet == ATTR_SET && bSecondPlayFull == true)
nSecondPlayFullSet = ATTR_MIXED;
}
}
// Genau zwei Objekte mit Pfadeffekt? Dann gilt nur die Animationsinfo
// am bewegten Objekt.
- if (nCount == 2)
+ if (2 == aSelection.size())
{
- SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj();
- SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj();
- SdrObjKind eKind1 = (SdrObjKind)pObject1->GetObjIdentifier();
- SdrObjKind eKind2 = (SdrObjKind)pObject2->GetObjIdentifier();
+ SdrObject* pObject1 = aSelection[0];
+ SdrObject* pObject2 = aSelection[1];
SdAnimationInfo* pInfo1 = mpDoc->GetAnimationInfo(pObject1);
SdAnimationInfo* pInfo2 = mpDoc->GetAnimationInfo(pObject2);
pInfo = NULL;
- if (pObject1->GetObjInventor() == SdrInventor &&
- ((eKind1 == OBJ_LINE) || // 2-Punkt-Linie
- (eKind1 == OBJ_PLIN) || // Polygon
- (eKind1 == OBJ_PATHLINE)) && // Bezier-Kurve
- (pInfo2 && pInfo2->meEffect == presentation::AnimationEffect_PATH))
+ if(pObject1 && pInfo2 && pInfo2->meEffect == presentation::AnimationEffect_PATH)
{
- pInfo = pInfo2;
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObject1);
+
+ if(pSdrPathObj && !pSdrPathObj->isClosed())
+ {
+ pInfo = pInfo2;
+ }
}
- if (pObject2->GetObjInventor() == SdrInventor &&
- ((eKind2 == OBJ_LINE) || // 2-Punkt-Linie
- (eKind2 == OBJ_PLIN) || // Polygon
- (eKind2 == OBJ_PATHLINE)) && // Bezier-Kurve
- (pInfo1 && pInfo1->meEffect == presentation::AnimationEffect_PATH))
+ if(pObject2 && pInfo1 && pInfo1->meEffect == presentation::AnimationEffect_PATH)
{
- pInfo = pInfo1;
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObject2);
+
+ if(pSdrPathObj && !pSdrPathObj->isClosed())
+ {
+ pInfo = pInfo1;
+ }
}
if (pInfo)
@@ -359,7 +352,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
if(!pArgs)
{
// ItemSet fuer Dialog fuellen
- SfxItemSet aSet(mpDoc->GetPool(), ATTR_ANIMATION_START, ATTR_ACTION_END);
+ SfxItemSet aSet(mpDoc->GetItemPool(), ATTR_ANIMATION_START, ATTR_ACTION_END);
// das Set besetzen
if (nAnimationSet == ATTR_SET)
@@ -367,7 +360,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
else if (nAnimationSet == ATTR_MIXED)
aSet.InvalidateItem(ATTR_ANIMATION_ACTIVE);
else
- aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, sal_False));
+ aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, false));
if (nEffectSet == ATTR_SET)
aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, (sal_uInt16)eEffect));
@@ -393,7 +386,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
else if (nFadeOutSet == ATTR_MIXED)
aSet.InvalidateItem(ATTR_ANIMATION_FADEOUT);
else
- aSet.Put(SfxBoolItem(ATTR_ANIMATION_FADEOUT, sal_False));
+ aSet.Put(SfxBoolItem(ATTR_ANIMATION_FADEOUT, false));
if (nFadeColorSet == ATTR_SET)
aSet.Put(SvxColorItem(aFadeColor, ATTR_ANIMATION_COLOR));
@@ -407,14 +400,14 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
else if (nInvisibleSet == ATTR_MIXED)
aSet.InvalidateItem(ATTR_ANIMATION_INVISIBLE);
else
- aSet.Put(SfxBoolItem(ATTR_ANIMATION_INVISIBLE, sal_False));
+ aSet.Put(SfxBoolItem(ATTR_ANIMATION_INVISIBLE, false));
if (nSoundOnSet == ATTR_SET)
aSet.Put(SfxBoolItem(ATTR_ANIMATION_SOUNDON, bSoundOn));
else if (nSoundOnSet == ATTR_MIXED)
aSet.InvalidateItem(ATTR_ANIMATION_SOUNDON);
else
- aSet.Put(SfxBoolItem(ATTR_ANIMATION_SOUNDON, sal_False));
+ aSet.Put(SfxBoolItem(ATTR_ANIMATION_SOUNDON, false));
if (nSoundFileSet == ATTR_SET)
aSet.Put(SfxStringItem(ATTR_ANIMATION_SOUNDFILE, aSound));
@@ -426,7 +419,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
else if (nPlayFullSet == ATTR_MIXED)
aSet.InvalidateItem(ATTR_ANIMATION_PLAYFULL);
else
- aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, sal_False));
+ aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, false));
if (nClickActionSet == ATTR_SET)
aSet.Put(SfxAllEnumItem(ATTR_ACTION, (sal_uInt16)eClickAction));
@@ -457,14 +450,14 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
else if (nSecondSoundOnSet == ATTR_MIXED)
aSet.InvalidateItem(ATTR_ACTION_SOUNDON);
else
- aSet.Put(SfxBoolItem(ATTR_ACTION_SOUNDON, sal_False));
+ aSet.Put(SfxBoolItem(ATTR_ACTION_SOUNDON, false));
if (nSecondPlayFullSet == ATTR_SET)
aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, bSecondPlayFull));
else if (nPlayFullSet == ATTR_MIXED)
aSet.InvalidateItem(ATTR_ACTION_PLAYFULL);
else
- aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, sal_False));
+ aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, false));
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
SfxAbstractDialog* pDlg = pFact ? pFact->CreatSdActionDialog( NULL, &aSet, mpView ) : 0;
@@ -654,59 +647,57 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
SdrPathObj* pPath = NULL;
if (eEffect == presentation::AnimationEffect_PATH && nEffectSet == ATTR_SET)
{
- DBG_ASSERT(nCount == 2, "dieser Effekt braucht genau 2 selektierte Objekte");
- SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj();
- SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj();
+ DBG_ASSERT(2 == aSelection.size(), "dieser Effekt braucht genau 2 selektierte Objekte");
+ SdrObject* pObject1 = aSelection[0];
+ SdrObject* pObject2 = aSelection[1];
SdrObjKind eKind1 = (SdrObjKind)pObject1->GetObjIdentifier();
SdrObjKind eKind2 = (SdrObjKind)pObject2->GetObjIdentifier();
- if (pObject1->GetObjInventor() == SdrInventor &&
- ((eKind1 == OBJ_LINE) || // 2-Punkt-Linie
- (eKind1 == OBJ_PLIN) || // Polygon
- (eKind1 == OBJ_PATHLINE))) // Bezier-Kurve
+ if(pObject1)
{
- pPath = (SdrPathObj*)pObject1;
- pRunningObj = pObject2;
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObject1);
+
+ if(pSdrPathObj && !pSdrPathObj->isClosed())
+ {
+ pPath = pSdrPathObj;
+ pRunningObj = pObject2;
+ }
}
- if (pObject2->GetObjInventor() == SdrInventor &&
- ((eKind2 == OBJ_LINE) || // 2-Punkt-Linie
- (eKind2 == OBJ_PLIN) || // Polygon
- (eKind2 == OBJ_PATHLINE))) // Bezier-Kurve
+ if(pObject2)
{
- pPath = (SdrPathObj*)pObject2;
- pRunningObj = pObject1;
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObject2);
+
+ if(pSdrPathObj && !pSdrPathObj->isClosed())
+ {
+ pPath = pSdrPathObj;
+ pRunningObj = pObject1;
+ }
}
DBG_ASSERT(pPath, "keine Kurve gefunden");
-
// das laufende Objekt auf das Kurvenende schieben
- Rectangle aCurRect(pRunningObj->GetLogicRect());
- Point aCurCenter(aCurRect.Center());
- const ::basegfx::B2DPolyPolygon& rPolyPolygon = pPath->GetPathPoly();
- sal_uInt32 nNoOfPolygons(rPolyPolygon.count());
- const ::basegfx::B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(nNoOfPolygons - 1L));
- sal_uInt32 nPoints(aPolygon.count());
- const ::basegfx::B2DPoint aNewB2DCenter(aPolygon.getB2DPoint(nPoints - 1L));
- const Point aNewCenter(FRound(aNewB2DCenter.getX()), FRound(aNewB2DCenter.getY()));
- Size aDistance(aNewCenter.X() - aCurCenter.X(), aNewCenter.Y() - aCurCenter.Y());
- pRunningObj->Move(aDistance);
-
- pUndoMgr->AddUndoAction(mpDoc->GetSdrUndoFactory().CreateUndoMoveObject( *pRunningObj, aDistance));
+ const basegfx::B2DRange aCurRange(sdr::legacy::GetLogicRange(*pRunningObj));
+ const basegfx::B2DPolyPolygon aPolyPolygon(pPath->getB2DPolyPolygonInObjectCoordinates());
+ const basegfx::B2DPolygon aPolygon(aPolyPolygon.count() ? aPolyPolygon.getB2DPolygon(aPolyPolygon.count() - 1) : basegfx::B2DPolygon());
+ const basegfx::B2DPoint aNewB2DCenter(aPolygon.count() ? aPolygon.getB2DPoint(aPolygon.count() - 1) : basegfx::B2DPoint());
+
+ sdr::legacy::transformSdrObject(*pRunningObj, basegfx::tools::createTranslateB2DHomMatrix(aNewB2DCenter - aCurRange.getCenter()));
+
+ pUndoMgr->AddUndoAction(mpDoc->GetSdrUndoFactory().CreateUndoGeoObject( *pRunningObj ));
}
- for (nObject = 0; nObject < nCount; nObject++)
+ for (nObject = 0; nObject < aSelection.size(); nObject++)
{
- SdrObject* pObject = rMarkList.GetMark(nObject)->GetMarkedSdrObj();
-
+ SdrObject* pObject = aSelection[nObject];
pInfo = mpDoc->GetAnimationInfo(pObject);
- sal_Bool bCreated = sal_False;
+ bool bCreated = false;
if( !pInfo )
{
pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
- bCreated = sal_True;
+ bCreated = true;
}
// das Pfadobjekt fuer 'an Kurve entlang'?
@@ -727,7 +718,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
// pAction->SetPathObj(pInfo->mpPathObj, pInfo->mpPathObj);
pAction->SetClickAction(pInfo->meClickAction, pInfo->meClickAction);
pAction->SetBookmark(pInfo->GetBookmark(), pInfo->GetBookmark());
-// pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation, sal_True);
+// pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation, true);
pAction->SetVerb(pInfo->mnVerb, pInfo->mnVerb);
pAction->SetSecondEffect(pInfo->meSecondEffect, pInfo->meSecondEffect);
pAction->SetSecondSpeed(pInfo->meSecondSpeed, pInfo->meSecondSpeed);
@@ -735,7 +726,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
pAction->SetSecondPlayFull(pInfo->mbSecondPlayFull, pInfo->mbSecondPlayFull);
pUndoGroup->AddAction(pAction);
-// pInfo->mbInvisibleInPresentation = sal_True;
+// pInfo->mbInvisibleInPresentation = true;
}
else
{
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index e96979b1818d..ed2cf0334a66 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -46,8 +46,6 @@
namespace sd {
-TYPEINIT1( FuOutlineBullet, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -75,12 +73,12 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
// ItemSet fuer Dialog fuellen
- SfxItemSet aEditAttr( mpDoc->GetPool() );
+ SfxItemSet aEditAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aEditAttr );
SfxItemSet aNewAttr( mpViewShell->GetPool(),
EE_ITEMS_START, EE_ITEMS_END );
- aNewAttr.Put( aEditAttr, sal_False );
+ aNewAttr.Put( aEditAttr, false );
// Dialog hochfahren und ausfuehren
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
@@ -98,13 +96,12 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
+ OutlineView* pOutlineView = dynamic_cast< OutlineView* >(mpView);
- if (mpView->ISA(OutlineView))
+ if (pOutlineView)
{
- pOLV = static_cast<OutlineView*>(mpView)
- ->GetViewByWindow(mpViewShell->GetActiveWindow());
-
- aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
+ pOLV = pOutlineView->GetViewByWindow(mpViewShell->GetActiveWindow());
+ aGuard.reset( new OutlineViewModelChangeGuard( *pOutlineView ) );
}
if( pOLV )
diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx
index 82010cbe5d6e..e8b97ea9f45e 100644
--- a/sd/source/ui/func/fuoltext.cxx
+++ b/sd/source/ui/func/fuoltext.cxx
@@ -86,8 +86,6 @@ static sal_uInt16 SidArray[] = {
SID_PARASPACE_DECREASE,
0 };
-TYPEINIT1( FuOutlineText, FuOutline );
-
/*************************************************************************
|*
|* Konstruktor
@@ -114,9 +112,9 @@ FunctionReference FuOutlineText::Create( ViewShell* pViewSh, ::sd::Window* pWin,
|*
\************************************************************************/
-sal_Bool FuOutlineText::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuOutlineText::MouseButtonDown(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
mpWindow->GrabFocus();
@@ -141,9 +139,9 @@ sal_Bool FuOutlineText::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuOutlineText::MouseMove(const MouseEvent& rMEvt)
+bool FuOutlineText::MouseMove(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
bReturn = pOutlineView->GetViewByWindow(mpWindow)->MouseMove(rMEvt);
@@ -152,22 +150,6 @@ sal_Bool FuOutlineText::MouseMove(const MouseEvent& rMEvt)
bReturn = FuOutline::MouseMove(rMEvt);
}
- // MT 07/2002: Done in OutlinerView::MouseMove
- /*
- const SvxFieldItem* pFieldItem = pOutlineView->GetViewByWindow( mpWindow )->
- GetFieldUnderMousePointer();
- const SvxFieldData* pField = NULL;
- if( pFieldItem )
- pField = pFieldItem->GetField();
-
- if( pField && pField->ISA( SvxURLField ) )
- {
- mpWindow->SetPointer( Pointer( POINTER_REFHAND ) );
- }
- else
- mpWindow->SetPointer( Pointer( POINTER_TEXT ) );
- */
-
return (bReturn);
}
@@ -177,9 +159,9 @@ sal_Bool FuOutlineText::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
bReturn = pOutlineView->GetViewByWindow(mpWindow)->MouseButtonUp(rMEvt);
@@ -195,13 +177,13 @@ sal_Bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt)
{
const SvxFieldData* pField = pFieldItem->GetField();
- if( pField && pField->ISA( SvxURLField ) )
+ if( pField && dynamic_cast< const SvxURLField* >(pField) )
{
- bReturn = sal_True;
+ bReturn = true;
mpWindow->ReleaseMouse();
SfxStringItem aStrItem( SID_FILE_NAME, ( (SvxURLField*) pField)->GetURL() );
SfxStringItem aReferer( SID_REFERER, mpDocSh->GetMedium()->GetName() );
- SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
+ SfxBoolItem aBrowseItem( SID_BROWSE, true );
SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
if ( rMEvt.IsMod1() )
@@ -231,15 +213,14 @@ sal_Bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuOutlineText::KeyInput(const KeyEvent& rKEvt)
+bool FuOutlineText::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
-
+ bool bReturn = false;
sal_uInt16 nKeyGroup = rKEvt.GetKeyCode().GetGroup();
if( !mpDocSh->IsReadOnly() || nKeyGroup == KEYGROUP_CURSOR )
{
diff --git a/sd/source/ui/func/fuoutl.cxx b/sd/source/ui/func/fuoutl.cxx
index c31ab42796bd..380de6bae880 100644
--- a/sd/source/ui/func/fuoutl.cxx
+++ b/sd/source/ui/func/fuoutl.cxx
@@ -36,8 +36,6 @@
namespace sd {
-TYPEINIT1( FuOutline, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -62,9 +60,9 @@ FuOutline::FuOutline (
|*
\************************************************************************/
-sal_Bool FuOutline::Command(const CommandEvent& rCEvt)
+bool FuOutline::Command(const CommandEvent& rCEvt)
{
- sal_Bool bResult = sal_False;
+ bool bResult = false;
OutlinerView* pOlView =
static_cast<OutlineView*>(mpView)->GetViewByWindow(mpWindow);
@@ -73,7 +71,7 @@ sal_Bool FuOutline::Command(const CommandEvent& rCEvt)
if (pOlView)
{
pOlView->Command(rCEvt); // liefert leider keinen Returnwert
- bResult = sal_True;
+ bResult = true;
}
return bResult;
}
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 5669633976d2..0fbd1d951ceb 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -88,8 +88,6 @@ class Window;
#define MAXWIDTH 28350
-TYPEINIT1( FuPage, FuPoor );
-
void mergeItemSetsImpl( SfxItemSet& rTarget, const SfxItemSet& rSource )
{
const sal_uInt16* pPtr = rSource.GetRanges();
@@ -181,9 +179,9 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
{
PageKind ePageKind = mpDrawViewShell->GetPageKind();
- SfxItemSet aNewAttr(mpDoc->GetPool(),
- mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
- mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE),
+ SfxItemSet aNewAttr(mpDoc->GetItemPool(),
+ mpDoc->GetItemPool().GetWhich(SID_ATTR_LRSPACE),
+ mpDoc->GetItemPool().GetWhich(SID_ATTR_ULSPACE),
SID_ATTR_PAGE, SID_ATTR_PAGE_BSP,
SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER,
SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW,
@@ -209,13 +207,13 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
SvxPageItem aPageItem( SID_ATTR_PAGE );
aPageItem.SetDescName( mpPage->GetName() );
aPageItem.SetPageUsage( (SvxPageUsage) SVX_PAGE_ALL );
- aPageItem.SetLandscape( mpPage->GetOrientation() == ORIENTATION_LANDSCAPE ? sal_True: sal_False );
+ aPageItem.SetLandscape( mpPage->GetOrientation() == ORIENTATION_LANDSCAPE ? true: false );
aPageItem.SetNumType( mpDoc->GetPageNumType() );
aNewAttr.Put( aPageItem );
// size
- maSize = mpPage->GetSize();
- SvxSizeItem aSizeItem( SID_ATTR_PAGE_SIZE, maSize );
+ maSize = mpPage->GetPageScale();
+ SvxSizeItem aSizeItem( SID_ATTR_PAGE_SIZE, Size(basegfx::fround(maSize.getX()), basegfx::fround(maSize.getY())));
aNewAttr.Put( aSizeItem );
// Max size
@@ -226,17 +224,17 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
SvxPaperBinItem aPaperBinItem( SID_ATTR_PAGE_PAPERBIN, (const sal_uInt8)mpPage->GetPaperBin() );
aNewAttr.Put( aPaperBinItem );
- SvxLRSpaceItem aLRSpaceItem( (sal_uInt16)mpPage->GetLftBorder(), (sal_uInt16)mpPage->GetRgtBorder(), 0, 0, mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE));
+ SvxLRSpaceItem aLRSpaceItem( (sal_uInt16)mpPage->GetLeftPageBorder(), (sal_uInt16)mpPage->GetRightPageBorder(), 0, 0, mpDoc->GetItemPool().GetWhich(SID_ATTR_LRSPACE));
aNewAttr.Put( aLRSpaceItem );
- SvxULSpaceItem aULSpaceItem( (sal_uInt16)mpPage->GetUppBorder(), (sal_uInt16)mpPage->GetLwrBorder(), mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE));
+ SvxULSpaceItem aULSpaceItem( (sal_uInt16)mpPage->GetTopPageBorder(), (sal_uInt16)mpPage->GetBottomPageBorder(), mpDoc->GetItemPool().GetWhich(SID_ATTR_ULSPACE));
aNewAttr.Put( aULSpaceItem );
// Applikation
bool bScale = mpDoc->GetDocumentType() != DOCUMENT_TYPE_DRAW;
- aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT1, bScale ? sal_True : sal_False ) );
+ aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT1, bScale ? true : false ) );
- sal_Bool bFullSize = mpPage->IsMasterPage() ?
+ bool bFullSize = mpPage->IsMasterPage() ?
mpPage->IsBackgroundFullSize() : ((SdPage&)mpPage->TRG_GetMasterPage()).IsBackgroundFullSize();
aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT2, bFullSize ) );
@@ -306,14 +304,24 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
int nError = aDlg.GetGraphic(aGraphic);
if( nError == GRFILTER_OK )
{
- pTempSet.reset( new SfxItemSet( mpDoc->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0) );
+ pTempSet.reset( new SfxItemSet( mpDoc->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0) );
pTempSet->Put( XFillStyleItem( XFILL_BITMAP ) );
- // MigrateItemSet makes sure the XFillBitmapItem will have a unique name
- SfxItemSet aMigrateSet( mpDoc->GetPool(), XATTR_FILLBITMAP, XATTR_FILLBITMAP );
- aMigrateSet.Put(XFillBitmapItem(String(RTL_CONSTASCII_USTRINGPARAM("background")), aGraphic));
- mpDoc->MigrateItemSet( &aMigrateSet, pTempSet.get(), NULL );
+ // Need to be sure that the name for the XFillBitmapItem is unique due to
+ // usage in the UNO API. Use checkForUniqueItem at the default item; it will
+ // always return something. If the name already was unique, it returns a pointer
+ // to the item it was triggered at, thus the new item needs to be deleted
+ // when it is not equal to the address of it.
+ const XFillBitmapItem aNewItem(String(RTL_CONSTASCII_USTRINGPARAM("background")), aGraphic);
+ const XFillBitmapItem* pSaveItem = aNewItem.checkForUniqueItem(mpDoc);
+
+ pTempSet->Put( *pSaveItem );
+
+ if(pSaveItem != &aNewItem)
+ {
+ delete pSaveItem;
+ }
pTempSet->Put( XFillBmpStretchItem( sal_True ));
pTempSet->Put( XFillBmpTileItem( sal_False ));
@@ -331,168 +339,171 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
if( pTempSet.get() )
{
- pStyleSheet->AdjustToFontHeight(*pTempSet);
-
- if( mbDisplayBackgroundTabPage )
+ if(pStyleSheet)
{
- // if some fillstyle-items are not set in the dialog, then
- // try to use the items before
- sal_Bool bChanges = sal_False;
- for( sal_uInt16 i=XATTR_FILL_FIRST; i<XATTR_FILL_LAST; i++ )
+ pStyleSheet->AdjustToFontHeight(*pTempSet);
+
+ if( mbDisplayBackgroundTabPage )
{
- if( aMergedAttr.GetItemState( i ) != SFX_ITEM_DEFAULT )
+ // if some fillstyle-items are not set in the dialog, then
+ // try to use the items before
+ bool bChanges = false;
+ for( sal_uInt16 i=XATTR_FILL_FIRST; i<XATTR_FILL_LAST; i++ )
{
- if( pTempSet->GetItemState( i ) == SFX_ITEM_DEFAULT )
- pTempSet->Put( aMergedAttr.Get( i ) );
- else
- if( aMergedAttr.GetItem( i ) != pTempSet->GetItem( i ) )
- bChanges = sal_True;
+ if( aMergedAttr.GetItemState( i ) != SFX_ITEM_DEFAULT )
+ {
+ if( pTempSet->GetItemState( i ) == SFX_ITEM_DEFAULT )
+ pTempSet->Put( aMergedAttr.Get( i ) );
+ else
+ if( aMergedAttr.GetItem( i ) != pTempSet->GetItem( i ) )
+ bChanges = true;
+ }
}
- }
-
- // if the background for this page was set to invisible, the background-object has to be deleted, too.
- if( ( ( (XFillStyleItem*) pTempSet->GetItem( XATTR_FILLSTYLE ) )->GetValue() == XFILL_NONE ) ||
- ( ( pTempSet->GetItemState( XATTR_FILLSTYLE ) == SFX_ITEM_DEFAULT ) &&
- ( ( (XFillStyleItem*) aMergedAttr.GetItem( XATTR_FILLSTYLE ) )->GetValue() == XFILL_NONE ) ) )
- mbPageBckgrdDeleted = sal_True;
- bool bSetToAllPages = false;
+ // if the background for this page was set to invisible, the background-object has to be deleted, too.
+ if( ( ( (XFillStyleItem*) pTempSet->GetItem( XATTR_FILLSTYLE ) )->GetValue() == XFILL_NONE ) ||
+ ( ( pTempSet->GetItemState( XATTR_FILLSTYLE ) == SFX_ITEM_DEFAULT ) &&
+ ( ( (XFillStyleItem*) aMergedAttr.GetItem( XATTR_FILLSTYLE ) )->GetValue() == XFILL_NONE ) ) )
+ mbPageBckgrdDeleted = true;
- // Ask, wether the setting are for the background-page or for the current page
- if( !mbMasterPage && bChanges )
- {
- // But don't ask in notice-view, because we can't change the background of
- // notice-masterpage (at the moment)
- if( ePageKind != PK_NOTES )
- {
- String aTit(SdResId( STR_PAGE_BACKGROUND_TITLE ));
- String aTxt(SdResId( STR_PAGE_BACKGROUND_TXT ));
- MessBox aQuestionBox (
- pParent,
- WB_YES_NO | WB_DEF_YES,
- aTit,
- aTxt );
- aQuestionBox.SetImage( QueryBox::GetStandardImage() );
- bSetToAllPages = ( RET_YES == aQuestionBox.Execute() );
- }
+ bool bSetToAllPages = false;
- if( mbPageBckgrdDeleted )
+ // Ask, wether the setting are for the background-page or for the current page
+ if( !mbMasterPage && bChanges )
{
- mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction(
- *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet());
+ // But don't ask in notice-view, because we can't change the background of
+ // notice-masterpage (at the moment)
+ if( ePageKind != PK_NOTES )
+ {
+ String aTit(SdResId( STR_PAGE_BACKGROUND_TITLE ));
+ String aTxt(SdResId( STR_PAGE_BACKGROUND_TXT ));
+ MessBox aQuestionBox (
+ pParent,
+ WB_YES_NO | WB_DEF_YES,
+ aTit,
+ aTxt );
+ aQuestionBox.SetImage( QueryBox::GetStandardImage() );
+ bSetToAllPages = ( RET_YES == aQuestionBox.Execute() );
+ }
- if(!mpPage->IsMasterPage())
+ if( mbPageBckgrdDeleted )
{
- // on normal pages, switch off fill attribute usage
- SdrPageProperties& rPageProperties = mpPage->getSdrPageProperties();
- rPageProperties.ClearItem( XATTR_FILLBITMAP );
- rPageProperties.ClearItem( XATTR_FILLGRADIENT );
- rPageProperties.ClearItem( XATTR_FILLHATCH );
- rPageProperties.PutItem(XFillStyleItem(XFILL_NONE));
+ mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction(
+ *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet());
+
+ if(!mpPage->IsMasterPage())
+ {
+ // on normal pages, switch off fill attribute usage
+ SdrPageProperties& rPageProperties = mpPage->getSdrPageProperties();
+ rPageProperties.ClearItem( XATTR_FILLBITMAP );
+ rPageProperties.ClearItem( XATTR_FILLGRADIENT );
+ rPageProperties.ClearItem( XATTR_FILLHATCH );
+ rPageProperties.PutItem(XFillStyleItem(XFILL_NONE));
+ }
}
}
- }
- // Sonderbehandlung: die INVALIDS auf NULL-Pointer
- // zurueckgesetzen (sonst landen INVALIDs oder
- // Pointer auf die DefaultItems in der Vorlage;
- // beides wuerde die Attribut-Vererbung unterbinden)
- pTempSet->ClearInvalidItems();
+ // Sonderbehandlung: die INVALIDS auf NULL-Pointer
+ // zurueckgesetzen (sonst landen INVALIDs oder
+ // Pointer auf die DefaultItems in der Vorlage;
+ // beides wuerde die Attribut-Vererbung unterbinden)
+ pTempSet->ClearInvalidItems();
- if( mbMasterPage )
- {
- StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, (SfxStyleSheet*)pStyleSheet, &(*pTempSet.get()));
- mpDocSh->GetUndoManager()->AddUndoAction(pAction);
- pStyleSheet->GetItemSet().Put( *(pTempSet.get()) );
- sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() );
- pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
- }
- else if( bSetToAllPages )
- {
- String aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
- ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
- pUndoMgr->EnterListAction(aComment, aComment);
- SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
- pUndoGroup->SetComment(aComment);
-
- //Set background on all master pages
- sal_uInt16 nMasterPageCount = mpDoc->GetMasterSdPageCount(ePageKind);
- for (sal_uInt16 i = 0; i < nMasterPageCount; ++i)
+ if( mbMasterPage )
{
- SdPage *pMasterPage = mpDoc->GetMasterSdPage(i, ePageKind);
- SdStyleSheet *pStyle =
- pMasterPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND);
- StyleSheetUndoAction* pAction =
- new StyleSheetUndoAction(mpDoc, (SfxStyleSheet*)pStyle, &(*pTempSet.get()));
- pUndoGroup->AddAction(pAction);
- pStyle->GetItemSet().Put( *(pTempSet.get()) );
+ StyleSheetUndoAction* pAction = new StyleSheetUndoAction(*mpDoc, *pStyleSheet, *pTempSet.get());
+ mpDocSh->GetUndoManager()->AddUndoAction(pAction);
+ pStyleSheet->GetItemSet().Put( *(pTempSet.get()) );
sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() );
- pStyle->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
}
-
- //Remove background from all pages to reset to the master bg
- sal_uInt16 nPageCount(mpDoc->GetSdPageCount(ePageKind));
- for(sal_uInt16 i=0; i<nPageCount; ++i)
+ else if( bSetToAllPages )
{
- SdPage *pPage = mpDoc->GetSdPage(i, ePageKind);
+ String aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
+ ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager();
+ pUndoMgr->EnterListAction(aComment, aComment);
+ SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
+ pUndoGroup->SetComment(aComment);
+
+ //Set background on all master pages
+ sal_uInt32 nMasterPageCount = mpDoc->GetMasterSdPageCount(ePageKind);
+ for (sal_uInt32 i = 0; i < nMasterPageCount; ++i)
+ {
+ SdPage *pMasterPage = mpDoc->GetMasterSdPage(i, ePageKind);
+ SdStyleSheet *pStyle = pMasterPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND);
+ StyleSheetUndoAction* pAction = new StyleSheetUndoAction(*mpDoc, *pStyle, *pTempSet.get());
+ pUndoGroup->AddAction(pAction);
+ pStyle->GetItemSet().Put( *(pTempSet.get()) );
+ sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() );
+ pStyle->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
+ }
- const SfxItemSet& rFillAttributes = pPage->getSdrPageProperties().GetItemSet();
- if(XFILL_NONE != ((const XFillStyleItem&)rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue())
+ //Remove background from all pages to reset to the master bg
+ sal_uInt32 nPageCount(mpDoc->GetSdPageCount(ePageKind));
+ for(sal_uInt32 i=0; i<nPageCount; ++i)
{
- SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes);
- pUndoGroup->AddAction(pBackgroundObjUndoAction);
+ SdPage *pPage = mpDoc->GetSdPage(i, ePageKind);
+
+ const SfxItemSet& rFillAttributes = pPage->getSdrPageProperties().GetItemSet();
+ if(XFILL_NONE != ((const XFillStyleItem&)rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue())
+ {
+ SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes);
+ pUndoGroup->AddAction(pBackgroundObjUndoAction);
+
+ SdrPageProperties& rPageProperties = pPage->getSdrPageProperties();
+ rPageProperties.ClearItem( XATTR_FILLBITMAP );
+ rPageProperties.ClearItem( XATTR_FILLGRADIENT );
+ rPageProperties.ClearItem( XATTR_FILLHATCH );
+ rPageProperties.PutItem(XFillStyleItem(XFILL_NONE));
+
+ pPage->ActionChanged();
+ }
+ }
- SdrPageProperties& rPageProperties = pPage->getSdrPageProperties();
- rPageProperties.ClearItem( XATTR_FILLBITMAP );
- rPageProperties.ClearItem( XATTR_FILLGRADIENT );
- rPageProperties.ClearItem( XATTR_FILLHATCH );
- rPageProperties.PutItem(XFillStyleItem(XFILL_NONE));
+ pUndoMgr->AddUndoAction(pUndoGroup);
+ pUndoMgr->LeaveListAction();
- pPage->ActionChanged();
- }
}
- pUndoMgr->AddUndoAction(pUndoGroup);
- pUndoMgr->LeaveListAction();
-
- }
+ // if background filling is set to master pages then clear from page set
+ if( mbMasterPage || bSetToAllPages )
+ {
+ for( sal_uInt16 nWhich = XATTR_FILL_FIRST; nWhich <= XATTR_FILL_LAST; nWhich++ )
+ {
+ pTempSet->ClearItem( nWhich );
+ }
+ pTempSet->Put(XFillStyleItem(XFILL_NONE));
+ }
- // if background filling is set to master pages then clear from page set
- if( mbMasterPage || bSetToAllPages )
- {
- for( sal_uInt16 nWhich = XATTR_FILL_FIRST; nWhich <= XATTR_FILL_LAST; nWhich++ )
+ const SfxPoolItem *pItem;
+ if( SFX_ITEM_SET == pTempSet->GetItemState( EE_PARA_WRITINGDIR, sal_False, &pItem ) )
{
- pTempSet->ClearItem( nWhich );
+ sal_uInt32 nVal = ((SvxFrameDirectionItem*)pItem)->GetValue();
+ mpDoc->SetDefaultWritingMode( nVal == FRMDIR_HORI_RIGHT_TOP ? ::com::sun::star::text::WritingMode_RL_TB : ::com::sun::star::text::WritingMode_LR_TB );
}
- pTempSet->Put(XFillStyleItem(XFILL_NONE));
- }
- const SfxPoolItem *pItem;
- if( SFX_ITEM_SET == pTempSet->GetItemState( EE_PARA_WRITINGDIR, sal_False, &pItem ) )
- {
- sal_uInt32 nVal = ((SvxFrameDirectionItem*)pItem)->GetValue();
- mpDoc->SetDefaultWritingMode( nVal == FRMDIR_HORI_RIGHT_TOP ? ::com::sun::star::text::WritingMode_RL_TB : ::com::sun::star::text::WritingMode_LR_TB );
+ mpDoc->SetChanged(true);
+
+ // BackgroundFill of Masterpage: no hard attributes allowed
+ SdrPage& rUsedMasterPage = mpPage->IsMasterPage() ? *mpPage : mpPage->TRG_GetMasterPage();
+ OSL_ENSURE(rUsedMasterPage.IsMasterPage(), "No MasterPage (!)");
+ rUsedMasterPage.getSdrPageProperties().ClearItem();
+ OSL_ENSURE(0 != rUsedMasterPage.getSdrPageProperties().GetStyleSheet(),
+ "MasterPage without StyleSheet detected (!)");
}
- mpDoc->SetChanged(sal_True);
+ aNewAttr.Put(*(pTempSet.get()));
+ mrReq.Done( aNewAttr );
- // BackgroundFill of Masterpage: no hard attributes allowed
- SdrPage& rUsedMasterPage = mpPage->IsMasterPage() ? *mpPage : mpPage->TRG_GetMasterPage();
- OSL_ENSURE(rUsedMasterPage.IsMasterPage(), "No MasterPage (!)");
- rUsedMasterPage.getSdrPageProperties().ClearItem();
- OSL_ENSURE(0 != rUsedMasterPage.getSdrPageProperties().GetStyleSheet(),
- "MasterPage without StyleSheet detected (!)");
+ return mrReq.GetArgs();
+ }
+ else
+ {
+ OSL_ENSURE(false, "pStyleSheet not set (!)");
}
-
- aNewAttr.Put(*(pTempSet.get()));
- mrReq.Done( aNewAttr );
-
- return mrReq.GetArgs();
- }
- else
- {
- return 0;
}
+
+ return 0;
}
void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
@@ -504,16 +515,19 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
// Set new page-attributes
PageKind ePageKind = mpDrawViewShell->GetPageKind();
const SfxPoolItem* pPoolItem;
- sal_Bool bSetPageSizeAndBorder = sal_False;
- Size aNewSize(maSize);
- sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1;
- sal_Bool bScaleAll = sal_True;
+ bool bSetPageSizeAndBorder = false;
+ basegfx::B2DVector aNewSize(maSize);
+ double fLeft(-1.0);
+ double fRight(-1.0);
+ double fTop(-1.0);
+ double fBottom(-1.0);
+ bool bScaleAll = true;
Orientation eOrientation = mpPage->GetOrientation();
SdPage* pMasterPage = mpPage->IsMasterPage() ? mpPage : &(SdPage&)(mpPage->TRG_GetMasterPage());
- sal_Bool bFullSize = pMasterPage->IsBackgroundFullSize();
+ bool bFullSize = pMasterPage->IsBackgroundFullSize();
sal_uInt16 nPaperBin = mpPage->GetPaperBin();
- if( pArgs->GetItemState(SID_ATTR_PAGE, sal_True, &pPoolItem) == SFX_ITEM_SET )
+ if( pArgs->GetItemState(SID_ATTR_PAGE, true, &pPoolItem) == SFX_ITEM_SET )
{
mpDoc->SetPageNumType(((const SvxPageItem*) pPoolItem)->GetNumType());
@@ -521,82 +535,88 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT;
if( mpPage->GetOrientation() != eOrientation )
- bSetPageSizeAndBorder = sal_True;
+ bSetPageSizeAndBorder = true;
mpDrawViewShell->ResetActualPage();
}
- if( pArgs->GetItemState(SID_ATTR_PAGE_SIZE, sal_True, &pPoolItem) == SFX_ITEM_SET )
+ if( pArgs->GetItemState(SID_ATTR_PAGE_SIZE, true, &pPoolItem) == SFX_ITEM_SET )
{
- aNewSize = ((const SvxSizeItem*) pPoolItem)->GetSize();
+ const Size aItemSize(((const SvxSizeItem*)pPoolItem)->GetSize());
+ aNewSize = basegfx::B2DVector(aItemSize.Width(), aItemSize.Height());
- if( mpPage->GetSize() != aNewSize )
- bSetPageSizeAndBorder = sal_True;
+ if(!mpPage->GetPageScale().equal(aNewSize))
+ {
+ bSetPageSizeAndBorder = true;
+ }
}
- if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
- sal_True, &pPoolItem) == SFX_ITEM_SET )
+ if( pArgs->GetItemState(mpDoc->GetItemPool().GetWhich(SID_ATTR_LRSPACE), true, &pPoolItem) == SFX_ITEM_SET )
{
- nLeft = ((const SvxLRSpaceItem*) pPoolItem)->GetLeft();
- nRight = ((const SvxLRSpaceItem*) pPoolItem)->GetRight();
-
- if( mpPage->GetLftBorder() != nLeft || mpPage->GetRgtBorder() != nRight )
- bSetPageSizeAndBorder = sal_True;
+ fLeft = ((const SvxLRSpaceItem*) pPoolItem)->GetLeft();
+ fRight = ((const SvxLRSpaceItem*) pPoolItem)->GetRight();
+ if( !basegfx::fTools::equal(mpPage->GetLeftPageBorder(), fLeft) ||
+ !basegfx::fTools::equal(mpPage->GetRightPageBorder(), fRight ))
+ {
+ bSetPageSizeAndBorder = true;
+ }
}
- if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE),
- sal_True, &pPoolItem) == SFX_ITEM_SET )
+ if( pArgs->GetItemState(mpDoc->GetItemPool().GetWhich(SID_ATTR_ULSPACE), true, &pPoolItem) == SFX_ITEM_SET )
{
- nUpper = ((const SvxULSpaceItem*) pPoolItem)->GetUpper();
- nLower = ((const SvxULSpaceItem*) pPoolItem)->GetLower();
+ fTop = ((const SvxULSpaceItem*) pPoolItem)->GetUpper();
+ fBottom = ((const SvxULSpaceItem*) pPoolItem)->GetLower();
- if( mpPage->GetUppBorder() != nUpper || mpPage->GetLwrBorder() != nLower )
- bSetPageSizeAndBorder = sal_True;
+ if( !basegfx::fTools::equal(mpPage->GetTopPageBorder(), fTop) ||
+ !basegfx::fTools::equal(mpPage->GetBottomPageBorder(), fBottom ))
+ {
+ bSetPageSizeAndBorder = true;
+ }
}
- if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_EXT1), sal_True, &pPoolItem) == SFX_ITEM_SET )
+ if( pArgs->GetItemState(mpDoc->GetItemPool().GetWhich(SID_ATTR_PAGE_EXT1), true, &pPoolItem) == SFX_ITEM_SET )
{
bScaleAll = ((const SfxBoolItem*) pPoolItem)->GetValue();
}
- if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_EXT2), sal_True, &pPoolItem) == SFX_ITEM_SET )
+ if( pArgs->GetItemState(mpDoc->GetItemPool().GetWhich(SID_ATTR_PAGE_EXT2), true, &pPoolItem) == SFX_ITEM_SET )
{
bFullSize = ((const SfxBoolItem*) pPoolItem)->GetValue();
if(pMasterPage->IsBackgroundFullSize() != bFullSize )
- bSetPageSizeAndBorder = sal_True;
+ bSetPageSizeAndBorder = true;
}
// Papierschacht (PaperBin)
- if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_PAPERBIN), sal_True, &pPoolItem) == SFX_ITEM_SET )
+ if( pArgs->GetItemState(mpDoc->GetItemPool().GetWhich(SID_ATTR_PAGE_PAPERBIN), true, &pPoolItem) == SFX_ITEM_SET )
{
nPaperBin = ((const SvxPaperBinItem*) pPoolItem)->GetValue();
if( mpPage->GetPaperBin() != nPaperBin )
- bSetPageSizeAndBorder = sal_True;
+ bSetPageSizeAndBorder = true;
}
- if (nLeft == -1 && nUpper != -1)
+ if (fLeft < 0.0 && fTop >= 0.0)
{
- bSetPageSizeAndBorder = sal_True;
- nLeft = mpPage->GetLftBorder();
- nRight = mpPage->GetRgtBorder();
+ bSetPageSizeAndBorder = true;
+ fLeft = mpPage->GetLeftPageBorder();
+ fRight = mpPage->GetRightPageBorder();
}
- else if (nLeft != -1 && nUpper == -1)
+ else if (fLeft >= 0.0 && fTop < 0.0)
{
- bSetPageSizeAndBorder = sal_True;
- nUpper = mpPage->GetUppBorder();
- nLower = mpPage->GetLwrBorder();
+ bSetPageSizeAndBorder = true;
+ fTop = mpPage->GetTopPageBorder();
+ fBottom = mpPage->GetBottomPageBorder();
}
if( bSetPageSizeAndBorder || !mbMasterPage )
- mpDrawViewShell->SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
+ mpDrawViewShell->SetPageSizeAndBorder(ePageKind, aNewSize, fLeft, fRight, fTop, fBottom, bScaleAll, eOrientation, nPaperBin, bFullSize );
////////////////////////////////////////////////////////////////////////////////
//
- // if bMasterPage==sal_False then create a background-object for this page with the
- // properties set in the dialog before, but if mbPageBckgrdDeleted==sal_True then
+ // if bMasterPage==false then create a background-object for this page with the
+ // properties set in the dialog before, but if mbPageBckgrdDeleted==true then
// the background of this page was set to invisible, so it would be a mistake
// to create a new background-object for this page !
//
@@ -620,7 +640,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
if( mpBackgroundObjUndoAction )
{
// set merge flag, because a SdUndoGroupAction could have been inserted before
- mpDocSh->GetUndoManager()->AddUndoAction( mpBackgroundObjUndoAction, sal_True );
+ mpDocSh->GetUndoManager()->AddUndoAction( mpBackgroundObjUndoAction, true );
mpBackgroundObjUndoAction = 0;
}
@@ -628,9 +648,10 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
//
// Objekte koennen max. so gross wie die ViewSize werden
//
- Size aPageSize = mpDoc->GetSdPage(0, ePageKind)->GetSize();
- Size aViewSize = Size(aPageSize.Width() * 3, aPageSize.Height() * 2);
- mpDoc->SetMaxObjSize(aViewSize);
+ {
+ const SdPage* pSdPage = mpDoc->GetSdPage(0, ePageKind);
+ mpDoc->SetMaxObjectScale(pSdPage->GetPageScale() * basegfx::B2DTuple(3.0, 2.0));
+ }
///////////////////////////////////////////////////////////////////////////
//
diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx
index 65f08860860f..418c75adb8df 100644
--- a/sd/source/ui/func/fuparagr.cxx
+++ b/sd/source/ui/func/fuparagr.cxx
@@ -48,8 +48,6 @@
namespace sd {
-TYPEINIT1( FuParagraph, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -82,7 +80,7 @@ void FuParagraph::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
- SfxItemSet aEditAttr( mpDoc->GetPool() );
+ SfxItemSet aEditAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aEditAttr );
SfxItemPool *pPool = aEditAttr.GetPool();
SfxItemSet aNewAttr( *pPool,
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index daa6e36163d9..a1663e791472 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -74,8 +74,6 @@ using ::com::sun::star::uno::Reference;
namespace sd {
-TYPEINIT0( FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -96,11 +94,11 @@ FuPoor::FuPoor (
nSlotId( rReq.GetSlot() ),
nSlotValue(0),
pDialog(NULL),
- bIsInDragMode(sal_False),
- bNoScrollUntilInside (sal_True),
- bScrollable (sal_False),
- bDelayActive (sal_False),
- bFirstMouseMove (sal_False),
+ bIsInDragMode(false),
+ bNoScrollUntilInside (true),
+ bScrollable (false),
+ bDelayActive (false),
+ bFirstMouseMove (false),
// #95491# remember MouseButton state
mnCode(0)
{
@@ -158,7 +156,7 @@ void FuPoor::Deactivate()
aScrollTimer.Stop();
aDelayToScrollTimer.Stop ();
bScrollable =
- bDelayActive = sal_False;
+ bDelayActive = false;
if (pDialog)
{
@@ -175,7 +173,7 @@ void FuPoor::Deactivate()
|*
\************************************************************************/
-void FuPoor::ForceScroll(const Point& aPixPos)
+void FuPoor::ForceScroll(const basegfx::B2DPoint& aPixPos)
{
aScrollTimer.Stop();
@@ -190,13 +188,13 @@ void FuPoor::ForceScroll(const Point& aPixPos)
if ( aPixPos.Y() <= 0 ) dy = -1;
if ( aPixPos.Y() >= aSize.Height() ) dy = 1;
*/
- Point aPos = mpWindow->OutputToScreenPixel(aPixPos);
+ const Point aPos = mpWindow->OutputToScreenPixel(Point(basegfx::fround(aPixPos.getX()), basegfx::fround(aPixPos.getY())));
const Rectangle& rRect = mpViewShell->GetAllWindowRect();
if ( bNoScrollUntilInside )
{
if ( rRect.IsInside(aPos) )
- bNoScrollUntilInside = sal_False;
+ bNoScrollUntilInside = false;
}
else
{
@@ -213,7 +211,7 @@ void FuPoor::ForceScroll(const Point& aPixPos)
{
// Scrollaktion in abgeleiteter Klasse
ScrollStart();
- mpViewShell->ScrollLines(dx, dy);
+ mpViewShell->ScrollLines(basegfx::B2DVector(dx, dy));
ScrollEnd();
aScrollTimer.Start();
}
@@ -245,16 +243,16 @@ IMPL_LINK_INLINE_END( FuPoor, ScrollHdl, Timer *, pTimer )
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
+bool FuPoor::KeyInput(const KeyEvent& rKEvt)
{
sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
- sal_Bool bReturn = sal_False;
- sal_Bool bSlideShow = SlideShow::IsRunning( mpViewShell->GetViewShellBase() );
+ bool bReturn = false;
+ bool bSlideShow = SlideShow::IsRunning( mpViewShell->GetViewShellBase() );
switch (nCode)
{
@@ -263,10 +261,10 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
{
if(rKEvt.GetKeyCode().IsMod1())
{
- if(mpViewShell && mpViewShell->ISA(DrawViewShell))
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if(pDrawViewShell)
{
- DrawViewShell* pDrawViewShell =
- static_cast<DrawViewShell*>(mpViewShell);
SdPage* pActualPage = pDrawViewShell->GetActualPage();
SdrTextObj* pCandidate = 0L;
@@ -276,17 +274,16 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
while(aIter.IsMore() && !pCandidate)
{
- SdrObject* pObj = aIter.Next();
+ SdrTextObj* pObj = dynamic_cast< SdrTextObj* >(aIter.Next());
- if(pObj && pObj->ISA(SdrTextObj))
+ if(pObj)
{
sal_uInt32 nInv(pObj->GetObjInventor());
sal_uInt16 nKnd(pObj->GetObjIdentifier());
- if(SdrInventor == nInv &&
- (OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd))
+ if(SdrInventor == nInv && (OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd))
{
- pCandidate = (SdrTextObj*)pObj;
+ pCandidate = pObj;
}
}
}
@@ -294,8 +291,8 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
if(pCandidate)
{
- mpView->UnMarkAll();
- mpView->MarkObj(pCandidate, mpView->GetSdrPageView());
+ mpView->UnmarkAllObj();
+ mpView->MarkObj(*pCandidate);
mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
SID_ATTR_CHAR, SFX_CALLMODE_ASYNCHRON);
@@ -308,35 +305,37 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
}
// consumed
- bReturn = sal_True;
+ bReturn = true;
}
}
else
{
// #98255# activate OLE object on RETURN for selected object
// #98198# activate text edit on RETURN for selected object
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
- if( !mpView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
+ if( !mpView->IsTextEdit() )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(mpView->getSelectedIfSingle());
- if( pObj && pObj->ISA( SdrOle2Obj ) && !mpDocSh->IsUIActive() )
+ if( pSdrOle2Obj && !mpDocSh->IsUIActive() )
{
- //HMHmpView->HideMarkHdl();
- mpViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
- }
- else if( pObj && pObj->IsEmptyPresObj() && pObj->ISA( SdrGrafObj ) )
- {
- mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_GRAPHIC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
+ mpViewShell->ActivateObject( pSdrOle2Obj, 0 );
}
else
{
- mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_CHAR, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(mpView->getSelectedIfSingle());
+
+ if( pSdrGrafObj && pSdrGrafObj->IsEmptyPresObj() )
+ {
+ mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_GRAPHIC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
+ }
+ else
+ {
+ mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_CHAR, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
+ }
}
// consumed
- bReturn = sal_True;
+ bReturn = true;
}
}
}
@@ -359,13 +358,15 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
if(pHdl)
{
- Point aHdlPosition(pHdl->GetPos());
- Rectangle aVisRect(aHdlPosition - Point(100, 100), Size(200, 200));
- mpView->MakeVisible(aVisRect, *mpWindow);
+ const basegfx::B2DRange aRange(
+ pHdl->getPosition() - basegfx::B2DPoint(100.0, 100.0),
+ pHdl->getPosition() + basegfx::B2DPoint(100.0, 100.0));
+
+ mpView->MakeVisibleAtView(aRange, *mpWindow);
}
// consumed
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -383,11 +384,14 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// Zoom vergroessern
mpViewShell->SetZoom(mpWindow->GetZoom() * 3 / 2);
- if (mpViewShell->ISA(DrawViewShell))
- static_cast<DrawViewShell*>(mpViewShell)
- ->SetZoomOnPage(sal_False);
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
- bReturn = sal_True;
+ if(pDrawViewShell)
+ {
+ pDrawViewShell->SetZoomOnPage(false);
+ }
+
+ bReturn = true;
}
}
break;
@@ -399,11 +403,14 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// Zoom verringern
mpViewShell->SetZoom(mpWindow->GetZoom() * 2 / 3);
- if (mpViewShell->ISA(DrawViewShell))
- static_cast<DrawViewShell*>(mpViewShell)
- ->SetZoomOnPage(sal_False);
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if(pDrawViewShell)
+ {
+ pDrawViewShell->SetZoomOnPage(false);
+ }
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -415,7 +422,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// Zoom auf Seite
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_SIZE_PAGE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -427,7 +434,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// Zoom auf selektierte Objekte
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_SIZE_OPTIMAL, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -439,8 +446,8 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
if (!mpView->IsTextEdit() && pZoomList->IsNextPossible() && !bSlideShow && !mpDocSh->IsUIActive())
{
// Naechstes ZoomRect einstellen
- mpViewShell->SetZoomRect(pZoomList->GetNextZoomRect());
- bReturn = sal_True;
+ mpViewShell->SetZoomRange(pZoomList->GetNextZoomRange());
+ bReturn = true;
}
}
break;
@@ -452,38 +459,41 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
if (!mpView->IsTextEdit() && pZoomList->IsPreviousPossible() && !bSlideShow && !mpDocSh->IsUIActive())
{
// Vorheriges ZoomRect einstellen
- mpViewShell->SetZoomRect(pZoomList->GetPreviousZoomRect());
- bReturn = sal_True;
+ mpViewShell->SetZoomRange(pZoomList->GetPreviousZoomRange());
+ bReturn = true;
}
}
break;
case KEY_HOME:
{
- if (!mpView->IsTextEdit()
- && mpViewShell->ISA(DrawViewShell)
- && !bSlideShow)
+ if (!mpView->IsTextEdit() && !bSlideShow)
{
- // Sprung zu erster Seite
- static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(0);
- bReturn = sal_True;
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if(pDrawViewShell)
+ {
+ // Sprung zu erster Seite
+ pDrawViewShell->SwitchPage(0);
+ bReturn = true;
+ }
}
}
break;
case KEY_END:
{
- if (!mpView->IsTextEdit()
- && mpViewShell->ISA(DrawViewShell)
- && !bSlideShow)
+ if(!mpView->IsTextEdit() && !bSlideShow)
{
- // Sprung zu letzter Seite
- SdPage* pPage =
- static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
- static_cast<DrawViewShell*>(mpViewShell)
- ->SwitchPage(mpDoc->GetSdPageCount(
- pPage->GetPageKind()) - 1);
- bReturn = sal_True;
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if(pDrawViewShell)
+ {
+ // Sprung zu letzter Seite
+ SdPage* pPage = pDrawViewShell->GetActualPage();
+ pDrawViewShell->SwitchPage(mpDoc->GetSdPageCount(pPage->GetPageKind()) - 1);
+ bReturn = true;
+ }
}
}
break;
@@ -493,43 +503,46 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
break;
- if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
+ if(!bSlideShow)
{
- // The page-up key switches layers or pages depending on the
- // modifier key.
- if ( ! rKEvt.GetKeyCode().GetAllModifier())
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if(pDrawViewShell)
{
- // With no modifier pressed we move to the previous
- // slide.
- mpView->SdrEndTextEdit();
+ // The page-up key switches layers or pages depending on the
+ // modifier key.
+ if ( ! rKEvt.GetKeyCode().GetAllModifier())
+ {
+ // With no modifier pressed we move to the previous
+ // slide.
+ mpView->SdrEndTextEdit();
- // Previous page.
- bReturn = sal_True;
- SdPage* pPage = static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
- sal_uInt16 nSdPage = (pPage->GetPageNum() - 1) / 2;
+ // Previous page.
+ bReturn = true;
+ SdPage* pPage = pDrawViewShell->GetActualPage();
+ sal_uInt32 nSdPage = (pPage->GetPageNumber() - 1) / 2;
- if (nSdPage > 0)
- {
- // Switch the page and send events regarding
- // deactivation the old page and activating the new
- // one.
- TabControl* pPageTabControl =
- static_cast<DrawViewShell*>(mpViewShell)
- ->GetPageTabControl();
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendDeactivatePageEvent ();
- static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage - 1);
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendActivatePageEvent ();
+ if (nSdPage > 0)
+ {
+ // Switch the page and send events regarding
+ // deactivation the old page and activating the new
+ // one.
+ TabControl* pPageTabControl = pDrawViewShell->GetPageTabControl();
+ if (pPageTabControl->IsReallyShown())
+ pPageTabControl->SendDeactivatePageEvent ();
+ pDrawViewShell->SwitchPage(nSdPage - 1);
+ if (pPageTabControl->IsReallyShown())
+ pPageTabControl->SendActivatePageEvent ();
+ }
}
- }
- else if (rKEvt.GetKeyCode().IsMod1())
- {
- // With the CONTROL modifier we switch layers.
- if (static_cast<DrawViewShell*>(mpViewShell)->IsLayerModeActive())
+ else if (rKEvt.GetKeyCode().IsMod1())
{
- // Moves to the previous layer.
- SwitchLayer (-1);
+ // With the CONTROL modifier we switch layers.
+ if (pDrawViewShell->IsLayerModeActive())
+ {
+ // Moves to the previous layer.
+ SwitchLayer (-1);
+ }
}
}
}
@@ -540,42 +553,47 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
{
if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
break;
- if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
+
+ if(!bSlideShow)
{
- // The page-down key switches layers or pages depending on the
- // modifier key.
- if ( ! rKEvt.GetKeyCode().GetAllModifier())
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if(pDrawViewShell)
{
- // With no modifier pressed we move to the next slide.
- mpView->SdrEndTextEdit();
+ // The page-down key switches layers or pages depending on the
+ // modifier key.
+ if ( ! rKEvt.GetKeyCode().GetAllModifier())
+ {
+ // With no modifier pressed we move to the next slide.
+ mpView->SdrEndTextEdit();
- // Next page.
- bReturn = sal_True;
- SdPage* pPage = static_cast<DrawViewShell*>(mpViewShell)->GetActualPage();
- sal_uInt16 nSdPage = (pPage->GetPageNum() - 1) / 2;
+ // Next page.
+ bReturn = true;
+ SdPage* pPage = pDrawViewShell->GetActualPage();
+ sal_uInt32 nSdPage = (pPage->GetPageNumber() - 1) / 2;
- if (nSdPage < mpDoc->GetSdPageCount(pPage->GetPageKind()) - 1)
- {
- // Switch the page and send events regarding
- // deactivation the old page and activating the new
- // one.
- TabControl* pPageTabControl =
- static_cast<DrawViewShell*>(mpViewShell)->GetPageTabControl();
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendDeactivatePageEvent ();
- static_cast<DrawViewShell*>(mpViewShell)->SwitchPage(nSdPage + 1);
- if (pPageTabControl->IsReallyShown())
- pPageTabControl->SendActivatePageEvent ();
+ if (nSdPage < mpDoc->GetSdPageCount(pPage->GetPageKind()) - 1)
+ {
+ // Switch the page and send events regarding
+ // deactivation the old page and activating the new
+ // one.
+ TabControl* pPageTabControl = pDrawViewShell->GetPageTabControl();
+ if (pPageTabControl->IsReallyShown())
+ pPageTabControl->SendDeactivatePageEvent ();
+ pDrawViewShell->SwitchPage(nSdPage + 1);
+ if (pPageTabControl->IsReallyShown())
+ pPageTabControl->SendActivatePageEvent ();
+ }
}
- }
- else if (rKEvt.GetKeyCode().IsMod1())
- {
- // With the CONTROL modifier we switch layers.
- if (static_cast<DrawViewShell*>(mpViewShell)->IsLayerModeActive())
+ else if (rKEvt.GetKeyCode().IsMod1())
{
- // With the layer mode active pressing page-down
- // moves to the next layer.
- SwitchLayer (+1);
+ // With the CONTROL modifier we switch layers.
+ if (pDrawViewShell->IsLayerModeActive())
+ {
+ // With the layer mode active pressing page-down
+ // moves to the next layer.
+ SwitchLayer (+1);
+ }
}
}
}
@@ -600,14 +618,14 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
{
if(rKEvt.GetKeyCode().IsShift())
{
- mpView->UnmarkPoint(*pHdl);
+ mpView->MarkPoint(*pHdl, true); // unmark
}
}
else
{
if(!rKEvt.GetKeyCode().IsShift())
{
- mpView->UnmarkAllPoints();
+ mpView->MarkPoints(0, true); // unmarkall
}
mpView->MarkPoint(*pHdl);
@@ -620,7 +638,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++)
{
- SdrHdl* pAct = rHdlList.GetHdl(a);
+ SdrHdl* pAct = rHdlList.GetHdlByIndex(a);
if(pAct
&& pAct->GetKind() == HDL_POLY
@@ -637,7 +655,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
}
}
- bReturn = sal_True;
+ bReturn = true;
}
}
}
@@ -650,35 +668,30 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
{
if (!mpView->IsTextEdit() && !bSlideShow)
{
- long nX = 0;
- long nY = 0;
+ basegfx::B2DVector aMove(0.0, 0.0);
if (nCode == KEY_UP)
{
// Scroll nach oben
- nX = 0;
- nY =-1;
+ aMove = basegfx::B2DPoint(0.0, -1.0);
}
else if (nCode == KEY_DOWN)
{
// Scroll nach unten
- nX = 0;
- nY = 1;
+ aMove = basegfx::B2DPoint(0.0, 1.0);
}
else if (nCode == KEY_LEFT)
{
// Scroll nach links
- nX =-1;
- nY = 0;
+ aMove = basegfx::B2DPoint(-1.0, 0.0);
}
else if (nCode == KEY_RIGHT)
{
// Scroll nach rechts
- nX = 1;
- nY = 0;
+ aMove = basegfx::B2DPoint(1.0, 0.0);
}
- if (mpView->AreObjectsMarked() && !rKEvt.GetKeyCode().IsMod1() &&
+ if (mpView->areSdrObjectsSelected() && !rKEvt.GetKeyCode().IsMod1() &&
!mpDocSh->IsReadOnly())
{
// #97016# II
@@ -686,26 +699,25 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
SdrHdl* pHdl = rHdlList.GetFocusHdl();
// #109007#
- sal_Bool bIsMoveOfConnectedHandle(sal_False);
- sal_Bool bOldSuppress = false;
- SdrEdgeObj* pEdgeObj = 0L;
+ bool bIsMoveOfConnectedHandle(false);
+ bool bOldSuppress(false);
+ SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >(pHdl ? const_cast< SdrObject* >(pHdl->GetObj()) : 0);
- if(pHdl && pHdl->GetObj() && pHdl->GetObj()->ISA(SdrEdgeObj) && 0 == pHdl->GetPolyNum())
+ if(pEdgeObj && 0 == pHdl->GetPolyNum())
{
- pEdgeObj = (SdrEdgeObj*)pHdl->GetObj();
-
- if(0L == pHdl->GetPointNum())
+ if(0 == pHdl->GetPointNum())
{
- if(pEdgeObj->GetConnection(sal_True).GetObject())
+ if(pEdgeObj->GetConnection(true).GetObject())
{
- bIsMoveOfConnectedHandle = sal_True;
+ bIsMoveOfConnectedHandle = true;
}
}
- if(1L == pHdl->GetPointNum())
+
+ if(1 == pHdl->GetPointNum())
{
- if(pEdgeObj->GetConnection(sal_False).GetObject())
+ if(pEdgeObj->GetConnection(false).GetObject())
{
- bIsMoveOfConnectedHandle = sal_True;
+ bIsMoveOfConnectedHandle = true;
}
}
}
@@ -721,37 +733,32 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// #109007#
if(bIsMoveOfConnectedHandle)
{
- sal_uInt16 nMarkHdSiz(mpView->GetMarkHdlSizePixel());
- Size aHalfConSiz(nMarkHdSiz + 1, nMarkHdSiz + 1);
- aHalfConSiz = mpWindow->PixelToLogic(aHalfConSiz);
+ basegfx::B2DVector aDist(
+ mpWindow->GetInverseViewTransformation() *
+ basegfx::B2DVector(mpView->GetMarkHdlSizePixel(), mpView->GetMarkHdlSizePixel()));
- if(100 < aHalfConSiz.Width())
- nX *= aHalfConSiz.Width();
- else
- nX *= 100;
+ aDist.setX(std::min(100.0, aDist.getX()));
+ aDist.setY(std::min(100.0, aDist.getY()));
- if(100 < aHalfConSiz.Height())
- nY *= aHalfConSiz.Height();
- else
- nY *= 100;
+ aMove *= aDist;
}
else if(rKEvt.GetKeyCode().IsMod2())
{
// #97016# move in 1 pixel distance
- Size aLogicSizeOnePixel = (mpWindow) ? mpWindow->PixelToLogic(Size(1,1)) : Size(100, 100);
- nX *= aLogicSizeOnePixel.Width();
- nY *= aLogicSizeOnePixel.Height();
+ const basegfx::B2DVector aDist(mpWindow
+ ? mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0)
+ : basegfx::B2DVector(100.0, 100.0));
+
+ aMove *= aDist;
}
else if(rKEvt.GetKeyCode().IsShift())
{
- nX *= 1000;
- nY *= 1000;
+ aMove *= 1000.0;
}
else
{
// old, fixed move distance
- nX *= 100;
- nY *= 100;
+ aMove *= 100;
}
if(0L == pHdl)
@@ -760,70 +767,70 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
if(mpView->IsMoveAllowed())
{
// #90129# restrict movement to WorkArea
- const Rectangle& rWorkArea = mpView->GetWorkArea();
+ const basegfx::B2DRange& rWorkArea = mpView->GetWorkArea();
- if(!rWorkArea.IsEmpty())
+ if(!rWorkArea.isEmpty())
{
- Rectangle aMarkRect(mpView->GetMarkedObjRect());
- aMarkRect.Move(nX, nY);
+ basegfx::B2DRange aMarkRange(mpView->getMarkedObjectSnapRange());
+ aMarkRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aMove));
- if(!aMarkRect.IsInside(rWorkArea))
+ if(!aMarkRange.isInside(rWorkArea))
{
- if(aMarkRect.Left() < rWorkArea.Left())
+ if(aMarkRange.getMinX() < rWorkArea.getMinX())
{
- nX += rWorkArea.Left() - aMarkRect.Left();
+ aMove.setX(aMove.getX() + rWorkArea.getMinX() - aMarkRange.getMinX());
}
- if(aMarkRect.Right() > rWorkArea.Right())
+ if(aMarkRange.getMaxX() > rWorkArea.getMaxX())
{
- nX -= aMarkRect.Right() - rWorkArea.Right();
+ aMove.setX(aMove.getX() - aMarkRange.getMaxX() - rWorkArea.getMaxX());
}
- if(aMarkRect.Top() < rWorkArea.Top())
+ if(aMarkRange.getMinY() < rWorkArea.getMinY())
{
- nY += rWorkArea.Top() - aMarkRect.Top();
+ aMove.setY(aMove.getY() + rWorkArea.getMinY() - aMarkRange.getMinY());
}
- if(aMarkRect.Bottom() > rWorkArea.Bottom())
+ if(aMarkRange.getMaxY() > rWorkArea.getMaxY())
{
- nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
+ aMove.setY(aMove.getY() - aMarkRange.getMaxY() - rWorkArea.getMaxY());
}
}
}
// no handle selected
- if(0 != nX || 0 != nY)
+ if(!aMove.equalZero())
{
- mpView->MoveAllMarked(Size(nX, nY));
+ mpView->MoveMarkedObj(aMove);
// #97016# II
- mpView->MakeVisible(mpView->GetAllMarkedRect(), *mpWindow);
+ mpView->MakeVisibleAtView(mpView->getMarkedObjectSnapRange(), *mpWindow);
}
}
}
else
{
// move handle with index nHandleIndex
- if(pHdl && (nX || nY))
+ if(pHdl && !aMove.equalZero())
{
- // now move the Handle (nX, nY)
- Point aStartPoint(pHdl->GetPos());
- Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
+ // now move the Handle
+ const basegfx::B2DPoint aStartPoint(pHdl->getPosition());
+ const basegfx::B2DPoint aEndPoint(aStartPoint + aMove);
const SdrDragStat& rDragStat = mpView->GetDragStat();
// start dragging
- mpView->BegDragObj(aStartPoint, 0, pHdl, 0);
+ mpView->BegDragObj(aStartPoint, pHdl, 0.0);
if(mpView->IsDragObj())
{
- FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
- sal_Bool bWasSnapEnabled = mpView->IsSnapEnabled();
+ const bool bWasNoSnap(rDragStat.IsNoSnap());
+ const bool bWasSnapEnabled(mpView->IsSnapEnabled());
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap(sal_True);
+ ((SdrDragStat&)rDragStat).SetNoSnap(true);
if(bWasSnapEnabled)
- mpView->SetSnapEnabled(sal_False);
+ mpView->SetSnapEnabled(false);
mpView->MovAction(aEndPoint);
mpView->EndDragObj();
@@ -836,8 +843,11 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
}
// make moved handle visible
- Rectangle aVisRect(aEndPoint - Point(100, 100), Size(200, 200));
- mpView->MakeVisible(aVisRect, *mpWindow);
+ const basegfx::B2DRange aVisRange(
+ aEndPoint - basegfx::B2DPoint(100.0, 100.0),
+ aEndPoint + basegfx::B2DPoint(100.0, 100.0));
+
+ mpView->MakeVisibleAtView(aVisRange, *mpWindow);
}
}
@@ -852,11 +862,11 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
{
// Seite scrollen
ScrollStart();
- mpViewShell->ScrollLines(nX, nY);
+ mpViewShell->ScrollLines(aMove);
ScrollEnd();
}
- bReturn = sal_True;
+ bReturn = true;
}
}
break;
@@ -870,88 +880,81 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
// #98198# when a text-editable object is selected and the
// input character is printable, activate text edit on that object
// and feed character to object
- if(!bReturn && !mpDocSh->IsReadOnly())
+ if(!bReturn && !mpDocSh->IsReadOnly() && !mpView->IsTextEdit() && mpViewShell)
{
- if(!mpView->IsTextEdit() && mpViewShell)
- {
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ SdrObject* pSelected = mpView->getSelectedIfSingle();
- if(1 == rMarkList.GetMarkCount())
+ if(pSelected)
+ {
+ if(dynamic_cast< SdrTextObj* >(pSelected) && pSelected->HasTextEdit() && !dynamic_cast< SdrOle2Obj* >(pSelected))
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ // #98533# use common IsSimpleCharInput from
+ // the EditEngine.
+ bool bPrintable(EditEngine::IsSimpleCharInput(rKEvt));
- // #i118485# allow TextInput for OLEs, too
- if(pObj->ISA(SdrTextObj) && pObj->HasTextEdit())
+ if(bPrintable)
{
- // #98533# use common IsSimpleCharInput from
- // the EditEngine.
- sal_Bool bPrintable(EditEngine::IsSimpleCharInput(rKEvt));
-
- if(bPrintable)
- {
- // try to activate textedit mode for the selected object
- SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode()));
+ // try to activate textedit mode for the selected object
+ SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode()));
- mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
- SID_ATTR_CHAR,
- SFX_CALLMODE_ASYNCHRON,
- &aInputString,
- 0L);
+ mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
+ SID_ATTR_CHAR,
+ SFX_CALLMODE_ASYNCHRON,
+ &aInputString,
+ 0L);
- // consumed
- bReturn = sal_True;
- }
+ // consumed
+ bReturn = true;
}
}
- else
+ }
+ else
+ {
+ // #99039# test if there is a title object there. If yes, try to
+ // set it to edit mode and start typing...
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if(pDrawViewShell && EditEngine::IsSimpleCharInput(rKEvt))
{
- // #99039# test if there is a title object there. If yes, try to
- // set it to edit mode and start typing...
- if(mpViewShell->ISA(DrawViewShell)
- && EditEngine::IsSimpleCharInput(rKEvt))
+ SdPage* pActualPage = pDrawViewShell->GetActualPage();
+ SdrTextObj* pCandidate = 0L;
+
+ if(pActualPage)
{
- DrawViewShell* pDrawViewShell =
- static_cast<DrawViewShell*>(mpViewShell);
- SdPage* pActualPage = pDrawViewShell->GetActualPage();
- SdrTextObj* pCandidate = 0L;
+ SdrObjListIter aIter(*pActualPage, IM_DEEPNOGROUPS);
- if(pActualPage)
+ while(aIter.IsMore() && !pCandidate)
{
- SdrObjListIter aIter(*pActualPage, IM_DEEPNOGROUPS);
+ SdrTextObj* pObj = dynamic_cast< SdrTextObj* >(aIter.Next());
- while(aIter.IsMore() && !pCandidate)
+ if(pObj)
{
- SdrObject* pObj = aIter.Next();
+ sal_uInt32 nInv(pObj->GetObjInventor());
+ sal_uInt16 nKnd(pObj->GetObjIdentifier());
- if(pObj && pObj->ISA(SdrTextObj))
+ if(SdrInventor == nInv && OBJ_TITLETEXT == nKnd)
{
- sal_uInt32 nInv(pObj->GetObjInventor());
- sal_uInt16 nKnd(pObj->GetObjIdentifier());
-
- if(SdrInventor == nInv && OBJ_TITLETEXT == nKnd)
- {
- pCandidate = (SdrTextObj*)pObj;
- }
+ pCandidate = pObj;
}
}
}
+ }
- // when candidate found and candidate is untouched, start editing text...
- if(pCandidate && pCandidate->IsEmptyPresObj())
- {
- mpView->UnMarkAll();
- mpView->MarkObj(pCandidate, mpView->GetSdrPageView());
- SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode()));
+ // when candidate found and candidate is untouched, start editing text...
+ if(pCandidate && pCandidate->IsEmptyPresObj())
+ {
+ mpView->UnmarkAllObj();
+ mpView->MarkObj(*pCandidate);
+ SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode()));
- mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
- SID_ATTR_CHAR,
- SFX_CALLMODE_ASYNCHRON,
- &aInputString,
- 0L);
+ mpViewShell->GetViewFrame()->GetDispatcher()->Execute(
+ SID_ATTR_CHAR,
+ SFX_CALLMODE_ASYNCHRON,
+ &aInputString,
+ 0L);
// consumed
- bReturn = sal_True;
- }
+ bReturn = true;
}
}
}
@@ -960,16 +963,16 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt)
return(bReturn);
}
-sal_Bool FuPoor::MouseMove(const MouseEvent& )
+bool FuPoor::MouseMove(const MouseEvent& )
{
- return sal_False;
+ return false;
}
-// #97016# II
void FuPoor::SelectionHasChanged()
{
- const SdrHdlList& rHdlList = mpView->GetHdlList();
- ((SdrHdlList&)rHdlList).ResetFocusHdl();
+ // Not needed TTTT
+ // const SdrHdlList& rHdlList = mpView->GetHdlList();
+ // ((SdrHdlList&)rHdlList).ResetFocusHdl();
}
/*************************************************************************
@@ -1027,12 +1030,13 @@ IMPL_LINK( FuPoor, DragHdl, Timer *, EMPTYARG )
sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
SdrHdl* pHdl = mpView->PickHandle(aMDPos);
- if ( pHdl==NULL && mpView->IsMarkedHit(aMDPos, nHitLog)
- && !mpView->IsPresObjSelected(sal_False, sal_True) )
+ if ( pHdl==NULL && mpView->IsMarkedObjHit(aMDPos, nHitLog)
+ && !mpView->IsPresObjSelected(false, true) )
{
mpWindow->ReleaseMouse();
- bIsInDragMode = sal_True;
- mpView->StartDrag( aMDPos, mpWindow );
+ bIsInDragMode = true;
+ const Point aPoint(basegfx::fround(aMDPos.getX()), basegfx::fround(aMDPos.getY()));
+ mpView->StartDrag( aPoint, mpWindow );
}
}
return 0;
@@ -1044,7 +1048,7 @@ IMPL_LINK( FuPoor, DragHdl, Timer *, EMPTYARG )
|*
\************************************************************************/
-sal_Bool FuPoor::Command(const CommandEvent& rCEvt)
+bool FuPoor::Command(const CommandEvent& rCEvt)
{
return( mpView->Command(rCEvt,mpWindow) );
}
@@ -1058,7 +1062,7 @@ sal_Bool FuPoor::Command(const CommandEvent& rCEvt)
IMPL_LINK_INLINE_START( FuPoor, DelayHdl, Timer *, EMPTYARG )
{
aDelayToScrollTimer.Stop ();
- bScrollable = sal_True;
+ bScrollable = true;
Point aPnt(mpWindow->GetPointerPosPixel());
@@ -1076,22 +1080,22 @@ IMPL_LINK_INLINE_END( FuPoor, DelayHdl, Timer *, pTimer )
|*
\************************************************************************/
-sal_Bool FuPoor::MouseButtonUp (const MouseEvent& rMEvt)
+bool FuPoor::MouseButtonUp (const MouseEvent& rMEvt)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
aDelayToScrollTimer.Stop ();
return bScrollable =
- bDelayActive = sal_False;
+ bDelayActive = false;
}
-sal_Bool FuPoor::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuPoor::MouseButtonDown(const MouseEvent& rMEvt)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- return sal_False;
+ return false;
}
/*************************************************************************
@@ -1102,7 +1106,7 @@ sal_Bool FuPoor::MouseButtonDown(const MouseEvent& rMEvt)
void FuPoor::StartDelayToScrollTimer ()
{
- bDelayActive = sal_True;
+ bDelayActive = true;
aDelayToScrollTimer.Start ();
}
@@ -1112,20 +1116,17 @@ void FuPoor::StartDelayToScrollTimer ()
|*
\************************************************************************/
-sal_Bool FuPoor::RequestHelp(const HelpEvent& rHEvt)
+bool FuPoor::RequestHelp(const HelpEvent& rHEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
SdrPageView* pPV = mpView->GetSdrPageView();
if (pPV)
{
- SdPage* pPage = (SdPage*) pPV->GetPage();
+ SdPage& rPage = (SdPage&) pPV->getSdrPageFromSdrPageView();
- if (pPage)
- {
- bReturn = pPage->RequestHelp(mpWindow, mpView, rHEvt);
- }
+ bReturn = rPage.RequestHelp(mpWindow, mpView, rHEvt);
}
return(bReturn);
@@ -1149,11 +1150,11 @@ void FuPoor::ReceiveRequest(SfxRequest& rReq)
{
if( pSet->GetItemState( nSlotId ) == SFX_ITEM_SET )
{
- const SfxPoolItem& rItem = pSet->Get( nSlotId );
+ const SfxAllEnumItem* pItem = dynamic_cast< const SfxAllEnumItem* >(&pSet->Get( nSlotId ));
- if( rItem.ISA( SfxAllEnumItem ) )
+ if( pItem )
{
- nSlotValue = ( ( const SfxAllEnumItem& ) rItem ).GetValue();
+ nSlotValue = pItem->GetValue();
}
}
}
@@ -1165,38 +1166,34 @@ void FuPoor::ReceiveRequest(SfxRequest& rReq)
|*
\************************************************************************/
-SdrObject* FuPoor::CreateDefaultObject(const sal_uInt16, const Rectangle& )
+SdrObject* FuPoor::CreateDefaultObject(const sal_uInt16, const basegfx::B2DRange& )
{
// empty base implementation
return 0L;
}
-void FuPoor::ImpForceQuadratic(Rectangle& rRect)
+void FuPoor::ImpForceQuadratic(basegfx::B2DRange& rRange)
{
- if(rRect.GetWidth() > rRect.GetHeight())
+ basegfx::B2DPoint aNewTopLeft(0.0, 0.0);
+
+ if(rRange.getWidth() > rRange.getHeight())
{
- rRect = Rectangle(
- Point(rRect.Left() + ((rRect.GetWidth() - rRect.GetHeight()) / 2), rRect.Top()),
- Size(rRect.GetHeight(), rRect.GetHeight()));
+ aNewTopLeft = basegfx::B2DPoint(rRange.getMinX() + ((rRange.getWidth() - rRange.getHeight()) * 0.5), rRange.getMinY());
}
else
{
- rRect = Rectangle(
- Point(rRect.Left(), rRect.Top() + ((rRect.GetHeight() - rRect.GetWidth()) / 2)),
- Size(rRect.GetWidth(), rRect.GetWidth()));
+ aNewTopLeft = basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + ((rRange.getHeight() - rRange.getWidth()) * 0.5));
}
-}
-
-
+ rRange = basegfx::B2DRange(aNewTopLeft, aNewTopLeft + rRange.getRange());
+}
void FuPoor::SwitchLayer (sal_Int32 nOffset)
{
- if(mpViewShell && mpViewShell->ISA(DrawViewShell))
- {
- DrawViewShell* pDrawViewShell =
- static_cast<DrawViewShell*>(mpViewShell);
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+ if(pDrawViewShell)
+ {
// Calculate the new index.
sal_Int32 nIndex = pDrawViewShell->GetActiveTabLayerIndex() + nOffset;
@@ -1209,8 +1206,7 @@ void FuPoor::SwitchLayer (sal_Int32 nOffset)
// Set the new active layer.
if (nIndex != pDrawViewShell->GetActiveTabLayerIndex ())
{
- LayerTabBar* pLayerTabControl =
- static_cast<DrawViewShell*>(mpViewShell)->GetLayerTabControl();
+ LayerTabBar* pLayerTabControl = pDrawViewShell->GetLayerTabControl();
if (pLayerTabControl != NULL)
pLayerTabControl->SendDeactivatePageEvent ();
@@ -1230,7 +1226,7 @@ void FuPoor::SwitchLayer (sal_Int32 nOffset)
*/
bool FuPoor::cancel()
{
- if ( !this->ISA(FuSelection) )
+ if ( !dynamic_cast< FuSelection* >(this) )
{
mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
return true;
diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx
index 03e93c7eee4d..3a000393d78b 100644
--- a/sd/source/ui/func/fuprlout.cxx
+++ b/sd/source/ui/func/fuprlout.cxx
@@ -70,8 +70,6 @@ namespace sd
SO2_DECL_REF(SvStorage)
#endif
-TYPEINIT1( FuPresentationLayout, FuPoor );
-
#define POOL_BUFFER_SIZE (sal_uInt16)32768
#define DOCUMENT_BUFFER_SIZE (sal_uInt16)32768
#define DOCUMENT_TOKEN (sal_Unicode('#'))
@@ -110,11 +108,11 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
mpView->UnmarkAll();
}
- sal_Bool bError = sal_False;
+ bool bError = false;
// die aktive Seite ermitteln
- sal_uInt16 nSelectedPage = SDRPAGE_NOTFOUND;
- for (sal_uInt16 nPage = 0; nPage < mpDoc->GetSdPageCount(PK_STANDARD); nPage++)
+ sal_uInt32 nSelectedPage = SDRPAGE_NOTFOUND;
+ for (sal_uInt32 nPage = 0; nPage < mpDoc->GetSdPageCount(PK_STANDARD); nPage++)
{
if (mpDoc->GetSdPage(nPage, PK_STANDARD)->IsSelected())
{
@@ -131,22 +129,23 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
// wenn wir auf einer Masterpage sind, gelten die Aenderungen fuer alle
// Seiten und Notizseiten, die das betreffende Layout benutzen
- sal_Bool bOnMaster = sal_False;
- if( mpViewShell && mpViewShell->ISA(DrawViewShell))
+ bool bOnMaster = false;
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if( pDrawViewShell )
{
- EditMode eEditMode =
- static_cast<DrawViewShell*>(mpViewShell)->GetEditMode();
+ EditMode eEditMode = pDrawViewShell->GetEditMode();
if (eEditMode == EM_MASTERPAGE)
- bOnMaster = sal_True;
+ bOnMaster = true;
}
- sal_Bool bMasterPage = bOnMaster;
- sal_Bool bCheckMasters = sal_False;
+ bool bMasterPage = bOnMaster;
+ bool bCheckMasters = false;
// Dialog aufrufen
- sal_Bool bLoad = sal_False; // tauchen neue Masterpages auf?
+ bool bLoad = false; // tauchen neue Masterpages auf?
String aFile;
- SfxItemSet aSet(mpDoc->GetPool(), ATTR_PRESLAYOUT_START, ATTR_PRESLAYOUT_END);
+ SfxItemSet aSet(mpDoc->GetItemPool(), ATTR_PRESLAYOUT_START, ATTR_PRESLAYOUT_END);
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad));
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_MASTER_PAGE, bMasterPage ) );
@@ -192,14 +191,14 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
break;
default:
- bError = sal_True;
+ bError = true;
}
delete pDlg;
}
if (!bError)
{
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
// Hier werden nur Masterpages ausgewechselt, d.h. die aktuelle Seite
// bleibt aktuell. Damit beim Ein- und Ausfuegen der Masterpages nicht
@@ -208,8 +207,10 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
// That isn't quitely right. If the masterpageview is active and you are
// removing a masterpage, it's possible that you are removing the
// current masterpage. So you have to call ResetActualPage !
- if( mpViewShell->ISA(DrawViewShell) && !bCheckMasters )
- static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(sal_True);
+ if( pDrawViewShell && !bCheckMasters )
+ {
+ static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(true);
+ }
if (bLoad)
{
@@ -233,8 +234,10 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
}
// Blockade wieder aufheben
- if (mpViewShell->ISA(DrawViewShell) && !bCheckMasters )
- static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(sal_False);
+ if ( pDrawViewShell && !bCheckMasters )
+ {
+ static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(false);
+ }
/*************************************************************************
|* Falls dargestellte Masterpage sichtbar war, neu darstellen
@@ -243,17 +246,15 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
{
if (bOnMaster)
{
- if (mpViewShell->ISA(DrawViewShell))
+ if (pDrawViewShell)
{
- ::sd::View* pView =
- static_cast<DrawViewShell*>(mpViewShell)->GetView();
- sal_uInt16 nPgNum = pSelectedPage->TRG_GetMasterPage().GetPageNum();
+ ::sd::View* pView = pDrawViewShell->GetView();
+ sal_uInt32 nPgNum = pSelectedPage->TRG_GetMasterPage().GetPageNumber();
if (static_cast<DrawViewShell*>(mpViewShell)->GetPageKind() == PK_NOTES)
nPgNum++;
- pView->HideSdrPage();
- pView->ShowSdrPage(pView->GetModel()->GetMasterPage(nPgNum));
+ pView->ShowSdrPage(*pView->getSdrModelFromSdrView().GetMasterPage(nPgNum));
}
// damit TabBar aktualisiert wird
@@ -266,17 +267,15 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
}
// fake a mode change to repaint the page tab bar
- if( mpViewShell && mpViewShell->ISA( DrawViewShell ) )
+ if( pDrawViewShell )
{
- DrawViewShell* pDrawViewSh =
- static_cast<DrawViewShell*>(mpViewShell);
- EditMode eMode = pDrawViewSh->GetEditMode();
- sal_Bool bLayer = pDrawViewSh->IsLayerModeActive();
- pDrawViewSh->ChangeEditMode( eMode, !bLayer );
- pDrawViewSh->ChangeEditMode( eMode, bLayer );
+ EditMode eMode = pDrawViewShell->GetEditMode();
+ bool bLayer = pDrawViewShell->IsLayerModeActive();
+ pDrawViewShell->ChangeEditMode( eMode, !bLayer );
+ pDrawViewShell->ChangeEditMode( eMode, bLayer );
}
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
}
}
diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx
index c72b21051fdb..0fc5ac981dfb 100644
--- a/sd/source/ui/func/fuprobjs.cxx
+++ b/sd/source/ui/func/fuprobjs.cxx
@@ -53,9 +53,6 @@
#include "sdabstdlg.hxx"
namespace sd {
-TYPEINIT1( FuPresentationObjects, FuPoor );
-
-
/*************************************************************************
|*
|* Konstruktor
@@ -93,7 +90,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
String aLayoutName = (((SfxStringItem&)aSet.Get(SID_STATUS_LAYOUT)).GetValue());
DBG_ASSERT(aLayoutName.Len(), "Layout unbestimmt");
- sal_Bool bUnique = sal_False;
+ bool bUnique = false;
sal_Int16 nDepth, nTmp;
OutlineView* pOlView = static_cast<OutlineView*>(pOutlineViewShell->GetView());
OutlinerView* pOutlinerView = pOlView->GetViewByWindow( (Window*) mpWindow );
@@ -109,16 +106,16 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
if( nDepth != nTmp )
{
- bUnique = sal_False;
+ bUnique = false;
break;
}
if( pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) != bPage )
{
- bUnique = sal_False;
+ bUnique = false;
break;
}
- bUnique = sal_True;
+ bUnique = true;
pPara = (Paragraph*) pList->Next();
}
@@ -146,26 +143,22 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
}
SfxStyleSheetBasePool* pStyleSheetPool = mpDocSh->GetStyleSheetPool();
- SfxStyleSheetBase* pStyleSheet = pStyleSheetPool->Find( aStyleName, SD_STYLE_FAMILY_MASTERPAGE );
- DBG_ASSERT(pStyleSheet, "StyleSheet nicht gefunden");
+ SfxStyleSheet* pStyleSheet = dynamic_cast< SfxStyleSheet* >(pStyleSheetPool->Find(aStyleName, SD_STYLE_FAMILY_MASTERPAGE));
+ OSL_ENSURE(pStyleSheet, "StyleSheet not found or not based on SfxStyleSheet");
if( pStyleSheet )
{
- SfxStyleSheetBase& rStyleSheet = *pStyleSheet;
-
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- SfxAbstractTabDialog* pDlg = pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, NULL, SdResId( nDlgId ), rStyleSheet, ePO, pStyleSheetPool ) : 0;
+ SfxAbstractTabDialog* pDlg = pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, NULL, SdResId( nDlgId ), *pStyleSheet, ePO, pStyleSheetPool ) : 0;
if( pDlg && (pDlg->Execute() == RET_OK) )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
// Undo-Action
- StyleSheetUndoAction* pAction = new StyleSheetUndoAction
- (mpDoc, (SfxStyleSheet*)pStyleSheet,
- pOutSet);
- mpDocSh->GetUndoManager()->AddUndoAction(pAction);
+ StyleSheetUndoAction* pAction = new StyleSheetUndoAction(*mpDoc, *pStyleSheet, *pOutSet);
+ mpDocSh->GetUndoManager()->AddUndoAction(pAction);
pStyleSheet->GetItemSet().Put( *pOutSet );
- ( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
+ pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
}
delete( pDlg );
}
diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx
index ffbbfdd865ad..35287fd3fea1 100644
--- a/sd/source/ui/func/fuscale.cxx
+++ b/sd/source/ui/func/fuscale.cxx
@@ -55,8 +55,6 @@
namespace sd {
-TYPEINIT1( FuScale, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -88,15 +86,16 @@ void FuScale::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
- SfxItemSet aNewAttr( mpDoc->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
+ SfxItemSet aNewAttr( mpDoc->GetItemPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
SvxZoomItem* pZoomItem;
sal_uInt16 nZoomValues = SVX_ZOOM_ENABLE_ALL;
nValue = (sal_Int16) mpWindow->GetZoom();
// Zoom auf Seitengroesse ?
- if( mpViewShell && mpViewShell->ISA( DrawViewShell ) &&
- static_cast<DrawViewShell*>(mpViewShell)->IsZoomOnPage() )
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if( pDrawViewShell && pDrawViewShell->IsZoomOnPage() )
{
pZoomItem = new SvxZoomItem( SVX_ZOOM_WHOLEPAGE, nValue );
}
@@ -108,16 +107,15 @@ void FuScale::DoExecute( SfxRequest& rReq )
// Bereich einschraenken
if( mpViewShell )
{
- if( mpViewShell->ISA( DrawViewShell ) )
+ if( pDrawViewShell )
{
SdrPageView* pPageView = mpView->GetSdrPageView();
- if( ( pPageView && pPageView->GetObjList()->GetObjCount() == 0 ) )
- // || ( mpView->GetMarkedObjectList().GetMarkCount() == 0 ) )
+ if( ( pPageView && pPageView->GetCurrentObjectList()->GetObjCount() == 0 ) )
{
nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
}
}
- else if( mpViewShell->ISA( OutlineViewShell ) )
+ else if( dynamic_cast< OutlineViewShell* >(mpViewShell) )
{
nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
nZoomValues &= ~SVX_ZOOM_ENABLE_WHOLEPAGE;
@@ -151,7 +149,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
default:
{
rReq.Ignore ();
- /*
+ /*
rReq.Done( *( pDlg->GetOutputItemSet() ) );
pArgs = rReq.GetArgs();*/
}
@@ -176,7 +174,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
case SVX_ZOOM_OPTIMAL:
{
- if( mpViewShell->ISA( DrawViewShell ) )
+ if( pDrawViewShell )
{
// Namensverwirrung: SID_SIZE_ALL -> Zoom auf alle Objekte
// --> Wird als Optimal im Programm angeboten
@@ -201,7 +199,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
}
else if(mpViewShell && (pArgs->Count () == 1))
{
- SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM, sal_False);
+ SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM );
mpViewShell->SetZoom (pScale->GetValue ());
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArrayZoom );
diff --git a/sd/source/ui/func/fusearch.cxx b/sd/source/ui/func/fusearch.cxx
index add97c8b49b3..056738f675cc 100644
--- a/sd/source/ui/func/fusearch.cxx
+++ b/sd/source/ui/func/fusearch.cxx
@@ -58,8 +58,6 @@ static sal_uInt16 SidArraySpell[] = {
SID_HANDOUTMODE,
0 };
-TYPEINIT1( FuSearch, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -74,7 +72,7 @@ FuSearch::FuSearch (
SfxRequest& rReq )
: FuPoor(pViewSh, pWin, pView, pDoc, rReq),
pSdOutliner(NULL),
- bOwnOutliner(sal_False)
+ bOwnOutliner(false)
{
}
@@ -89,14 +87,14 @@ void FuSearch::DoExecute( SfxRequest& )
{
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArraySpell );
- if ( mpViewShell->ISA(DrawViewShell) )
+ if ( dynamic_cast< DrawViewShell* >(mpViewShell) )
{
- bOwnOutliner = sal_True;
+ bOwnOutliner = true;
pSdOutliner = new ::sd::Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT );
}
- else if ( mpViewShell->ISA(OutlineViewShell) )
+ else if ( dynamic_cast< OutlineViewShell* >(mpViewShell) )
{
- bOwnOutliner = sal_False;
+ bOwnOutliner = false;
pSdOutliner = mpDoc->GetOutliner();
}
@@ -131,34 +129,34 @@ FuSearch::~FuSearch()
void FuSearch::SearchAndReplace( const SvxSearchItem* pSearchItem )
{
- ViewShellBase* pBase = PTR_CAST(ViewShellBase, SfxViewShell::Current());
+ ViewShellBase* pBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current());
ViewShell* pViewShell = NULL;
if (pBase != NULL)
pViewShell = pBase->GetMainViewShell().get();
if (pViewShell != NULL)
{
- if ( pSdOutliner && pViewShell->ISA(DrawViewShell) && !bOwnOutliner )
+ if ( pSdOutliner && dynamic_cast< DrawViewShell* >(pViewShell) && !bOwnOutliner )
{
pSdOutliner->EndSpelling();
- bOwnOutliner = sal_True;
+ bOwnOutliner = true;
pSdOutliner = new ::sd::Outliner( mpDoc, OUTLINERMODE_TEXTOBJECT );
pSdOutliner->PrepareSpelling();
}
- else if ( pSdOutliner && pViewShell->ISA(OutlineViewShell) && bOwnOutliner )
+ else if ( pSdOutliner && dynamic_cast< OutlineViewShell* >(pViewShell) && bOwnOutliner )
{
pSdOutliner->EndSpelling();
delete pSdOutliner;
- bOwnOutliner = sal_False;
+ bOwnOutliner = false;
pSdOutliner = mpDoc->GetOutliner();
pSdOutliner->PrepareSpelling();
}
if (pSdOutliner)
{
- sal_Bool bEndSpelling = pSdOutliner->StartSearchAndReplace(pSearchItem);
+ bool bEndSpelling = pSdOutliner->StartSearchAndReplace(pSearchItem);
if (bEndSpelling)
{
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index cdf2f1224e58..a9106776c2f7 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -24,13 +24,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
-
#include "fusel.hxx"
#include <vos/process.hxx>
#include <basic/sbstar.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdogrp.hxx>
-#include <svx/polysc3d.hxx>
#include "drawview.hxx"
#include <svtools/imapobj.hxx>
#include <svl/urihelper.hxx>
@@ -48,9 +46,12 @@
#include <tools/debug.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
-
#include <svx/svdotable.hxx>
-
+#include <svx/svdtrans.hxx>
+#include <svx/globl3d.hxx>
+#include <svx/svdundo.hxx>
+#include <avmedia/mediawindow.hxx>
+#include <svx/sdrhittesthelper.hxx>
#include "app.hrc"
#include "strings.hrc"
#include "res_bmp.hrc"
@@ -75,23 +76,14 @@
#include "DrawViewShell.hxx"
#include "ToolBarManager.hxx"
#include "pgjump.hxx"
-#include <svx/globl3d.hxx>
#include "Client.hxx"
-
#include "slideshow.hxx"
-
-// #108981#
-#include <svx/svdundo.hxx>
-#include <avmedia/mediawindow.hxx>
-
-#include <svx/sdrhittesthelper.hxx>
+#include <svx/scene3d.hxx>
using namespace ::com::sun::star;
namespace sd {
-TYPEINIT1( FuSelection, FuDraw );
-
/*************************************************************************
|*
|* Konstruktor
@@ -105,12 +97,12 @@ FuSelection::FuSelection (
SdDrawDocument* pDoc,
SfxRequest& rReq)
: FuDraw(pViewSh, pWin, pView, pDoc, rReq),
- bTempRotation(sal_False),
- bSelectionChanged(sal_False),
- bHideAndAnimate(sal_False),
+ bTempRotation(false),
+ bSelectionChanged(false),
+ bHideAndAnimate(false),
pHdl(NULL),
- bSuppressChangesOfSelection(sal_False),
- bMirrorSide0(sal_False),
+ bSuppressChangesOfSelection(false),
+ bMirrorSide0(false),
nEditMode(SID_BEZIER_MOVE),
pWaterCanCandidate(NULL)
{
@@ -139,7 +131,7 @@ void FuSelection::DoExecute( SfxRequest& rReq )
FuSelection::~FuSelection()
{
- mpView->UnmarkAllPoints();
+ mpView->MarkPoints(0, true); // unmarkall
mpView->ResetCreationActive();
if ( mpView->GetDragMode() != SDRDRAG_MOVE )
@@ -154,42 +146,42 @@ FuSelection::~FuSelection()
|*
\************************************************************************/
-sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
{
// Hack fuer #?????#
- bHideAndAnimate = sal_False;
+ bHideAndAnimate = false;
pHdl = NULL;
- sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
- sal_Bool bWaterCan = SD_MOD()->GetWaterCan();
+ bool bReturn = FuDraw::MouseButtonDown(rMEvt);
+ bool bWaterCan = SD_MOD()->GetWaterCan();
const bool bReadOnly = mpDocSh->IsReadOnly();
// When the right mouse button is pressed then only select objects
// (and deselect others) as a preparation for showing the context
// menu.
const bool bSelectionOnly = rMEvt.IsRight();
- bMBDown = sal_True;
- bSelectionChanged = sal_False;
+ bMBDown = true;
+ bSelectionChanged = false;
if ( mpView->IsAction() )
{
if ( rMEvt.IsRight() )
mpView->BckAction();
- return sal_True;
+ return true;
}
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ const double fDrgLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
// The following code is executed for right clicks as well as for left
// clicks in order to modify the selection for the right button as a
// preparation for the context menu. The functions BegMarkObject() and
// BegDragObject(), however, are not called for right clicks because a)
- // it makes no sense and b) to have IsAction() return sal_False when called
+ // it makes no sense and b) to have IsAction() return false when called
// from Command() which is a prerequisite for the context menu.
if ((rMEvt.IsLeft() || rMEvt.IsRight())
&& !mpView->IsAction()
- && (mpView->IsFrameDragSingles() || !mpView->HasMarkablePoints()))
+ && (mpView->IsFrameHandles() || !mpView->HasMarkablePoints()))
{
/******************************************************************
* KEIN BEZIER_EDITOR
@@ -197,12 +189,12 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
mpWindow->CaptureMouse();
pHdl = mpView->PickHandle(aMDPos);
SdrObject* pObj;
- SdrPageView* pPV;
- long nAngle0 = GetAngle(aMDPos - mpView->GetRef1());
+ const basegfx::B2DVector aDelta(aMDPos - mpView->GetRef1());
+ long nAngle0 = GetAngle(Point(basegfx::fround(aDelta.getX()), basegfx::fround(aDelta.getY())));
nAngle0 -= 27000;
nAngle0 = NormAngle360(nAngle0);
- bMirrorSide0 = sal_Bool (nAngle0 < 18000L);
+ bMirrorSide0 = (nAngle0 < 18000L);
if (!pHdl && mpView->Is3DRotationCreationActive())
{
@@ -210,28 +202,28 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
* Wenn 3D-Rotationskoerper erstellt werden sollen, jetzt
* die Erstellung beenden
******************************************************************/
- bSuppressChangesOfSelection = sal_True;
+ bSuppressChangesOfSelection = true;
if(mpWindow)
mpWindow->EnterWait();
mpView->End3DCreation();
- bSuppressChangesOfSelection = sal_False;
+ bSuppressChangesOfSelection = false;
mpView->ResetCreationActive();
if(mpWindow)
mpWindow->LeaveWait();
}
- sal_Bool bTextEdit = sal_False;
+ bool bTextEdit = false;
SdrViewEvent aVEvt;
SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- if ( eHit == SDRHIT_TEXTEDITOBJ && ( mpViewShell->GetFrameView()->IsQuickEdit() || dynamic_cast< sdr::table::SdrTableObj* >( aVEvt.pObj ) != NULL ) )
+ if ( eHit == SDRHIT_TEXTEDITOBJ && ( mpViewShell->GetFrameView()->IsQuickEdit() || dynamic_cast< sdr::table::SdrTableObj* >( aVEvt.mpObj ) != NULL ) )
{
- bTextEdit = sal_True;
+ bTextEdit = true;
}
if(!bTextEdit
&& !mpDocSh->IsReadOnly()
- && ((mpView->IsMarkedHit(aMDPos, nHitLog) && !rMEvt.IsShift() && !rMEvt.IsMod2()) || pHdl != NULL)
+ && ((mpView->IsMarkedObjHit(aMDPos, fHitLog) && !rMEvt.IsShift() && !rMEvt.IsMod2()) || pHdl != NULL)
&& (rMEvt.GetClicks() != 2)
)
{
@@ -249,30 +241,30 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
else
{
// Handle oder markiertes Objekt getroffen
- bFirstMouseMove = sal_True;
+ bFirstMouseMove = true;
aDragTimer.Start();
}
if ( ! rMEvt.IsRight())
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
- bReturn = sal_True;
+ mpView->BegDragObj(aMDPos, pHdl, fDrgLog);
+ bReturn = true;
}
else
{
- if (!rMEvt.IsMod2() && mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO))
+ if (!rMEvt.IsMod2() && mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO))
{
- mpView->BegMacroObj(aMDPos, nHitLog, pObj, pPV, mpWindow);
- bReturn = sal_True;
+ mpView->BegMacroObj(aMDPos, fHitLog, pObj, mpWindow);
+ bReturn = true;
}
else if ( bTextEdit )
{
- sal_uInt16 nSdrObjKind = aVEvt.pObj->GetObjIdentifier();
+ sal_uInt16 nSdrObjKind = aVEvt.mpObj->GetObjIdentifier();
- if (aVEvt.pObj->GetObjInventor() == SdrInventor &&
+ if (aVEvt.mpObj->GetObjInventor() == SdrInventor &&
(nSdrObjKind == OBJ_TEXT ||
nSdrObjKind == OBJ_TITLETEXT ||
nSdrObjKind == OBJ_OUTLINETEXT ||
- !aVEvt.pObj->IsEmptyPresObj()))
+ !aVEvt.mpObj->IsEmptyPresObj()))
{
// Seamless Editing: Verzweigen zur Texteingabe
if (!rMEvt.IsShift())
@@ -286,12 +278,12 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
}
else if ( !rMEvt.IsMod2() && rMEvt.GetClicks() == 1 &&
- aVEvt.eEvent == SDREVENT_EXECUTEURL )
+ aVEvt.meEvent == SDREVENT_EXECUTEURL )
{
mpWindow->ReleaseMouse();
- SfxStringItem aStrItem(SID_FILE_NAME, aVEvt.pURLField->GetURL());
+ SfxStringItem aStrItem(SID_FILE_NAME, aVEvt.maURLField);
SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
- SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
+ SfxBoolItem aBrowseItem( SID_BROWSE, true );
SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
mpWindow->ReleaseMouse();
@@ -309,47 +301,50 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
&aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
}
- bReturn = sal_True;
+ bReturn = true;
}
- else if(!rMEvt.IsMod2()
- && mpViewShell->ISA(DrawViewShell)
- )
+ else if(!rMEvt.IsMod2() && dynamic_cast< DrawViewShell* >(mpViewShell) )
{
- if(mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER))
+ if(mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER))
{
// Animate object when not just selecting.
if ( ! bSelectionOnly)
bReturn = AnimateObj(pObj, aMDPos);
- if (!bReturn && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dPolyScene)))
+ if (!bReturn && (dynamic_cast< SdrObjGroup* >(pObj) || dynamic_cast< E3dScene* >(pObj)))
{
if(rMEvt.GetClicks() == 1)
{
// In die Gruppe hineinschauen
- if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
+ if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, SDRSEARCH_ALSOONMASTER | SDRSEARCH_DEEP))
bReturn = AnimateObj(pObj, aMDPos);
}
else if( !bReadOnly && rMEvt.GetClicks() == 2)
{
// Neu: Doppelklick auf selektiertes Gruppenobjekt
// Gruppe betreten
- if ( ! bSelectionOnly
- && pObj
- && pObj->GetPage() == pPV->GetPage())
- bReturn = pPV->EnterGroup(pObj);
+ if ( ! bSelectionOnly && pObj)
+ {
+ SdrPageView* pSdrPageView = mpView->GetSdrPageView();
+
+ if(pSdrPageView && pObj->getSdrPageFromSdrObject() == &pSdrPageView->getSdrPageFromSdrPageView())
+ {
+ bReturn = pSdrPageView->EnterGroup(pObj);
+ }
+ }
}
}
}
// #i71727# replaced else here with two possibilities, once the original else (!pObj)
// and also ignoring the found object when it's on a masterpage
- if(!pObj || (pObj->GetPage() && pObj->GetPage()->IsMasterPage()))
+ if(!pObj || (pObj->getSdrPageFromSdrObject() && pObj->getSdrPageFromSdrObject()->IsMasterPage()))
{
if(mpView->IsGroupEntered() && 2 == rMEvt.GetClicks())
{
// New: double click on empty space/on obj on MasterPage, leave group
mpView->LeaveOneGroup();
- bReturn = sal_True;
+ bReturn = true;
}
}
}
@@ -368,8 +363,8 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
else
{
- bReturn = sal_True;
- sal_Bool bDeactivateOLE = sal_False;
+ bReturn = true;
+ bool bDeactivateOLE = false;
if ( !rMEvt.IsShift() && !rMEvt.IsMod2() )
{
@@ -380,31 +375,31 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
if (pIPClient && pIPClient->IsObjectInPlaceActive())
{
// OLE-Objekt wird im nachfolgenden UnmarkAll() deaktiviert
- bDeactivateOLE = sal_True;
+ bDeactivateOLE = true;
}
mpView->UnmarkAll();
}
- sal_Bool bMarked = sal_False;
+ bool bMarked = false;
if ( !rMEvt.IsMod1() && !bDeactivateOLE)
{
if ( rMEvt.IsMod2() )
{
- bMarked = mpView->MarkNextObj(aMDPos, nHitLog, rMEvt.IsShift() );
+ bMarked = mpView->MarkNextObj(aMDPos, fHitLog, rMEvt.IsShift() );
}
else
{
- sal_Bool bToggle = sal_False;
+ bool bToggle = false;
- if (rMEvt.IsShift() && mpView->GetMarkedObjectList().GetMarkCount() > 1)
+ if (rMEvt.IsShift() && mpView->getSelectedSdrObjectCount() > 1)
{
// Bei Einfachselektion kein Toggle
- bToggle = sal_True;
+ bToggle = true;
}
- bMarked = mpView->MarkObj(aMDPos, nHitLog, bToggle, sal_False);
+ bMarked = mpView->MarkObj(aMDPos, fHitLog, bToggle, false);
}
}
@@ -412,7 +407,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
{
if ( !bReadOnly &&
bMarked &&
- (!rMEvt.IsShift() || mpView->IsMarkedHit(aMDPos, nHitLog)))
+ (!rMEvt.IsShift() || mpView->IsMarkedObjHit(aMDPos, fHitLog)))
{
/**********************************************************
* Objekt verschieben
@@ -421,7 +416,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
pHdl=mpView->PickHandle(aMDPos);
if ( ! rMEvt.IsRight())
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, pHdl, fDrgLog);
}
else
{
@@ -453,13 +448,13 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
SdrViewEvent aVEvt;
SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- if (eHit == SDRHIT_HANDLE && aVEvt.pHdl->GetKind() == HDL_BWGT)
+ if (eHit == SDRHIT_HANDLE && aVEvt.mpHdl->GetKind() == HDL_BWGT)
{
/******************************************************************
* Handle draggen
******************************************************************/
if ( ! rMEvt.IsRight())
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog);
}
else if (eHit == SDRHIT_MARKEDOBJECT && nEditMode == SID_BEZIER_INSERT)
{
@@ -474,10 +469,14 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
* Klebepunkt selektieren
******************************************************************/
if (!rMEvt.IsShift())
- mpView->UnmarkAllPoints();
+ {
+ mpView->MarkPoints(0, true); // unmarkall
+ }
if ( ! rMEvt.IsRight())
+ {
mpView->BegMarkPoints(aMDPos);
+ }
}
else if (eHit == SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() && !rMEvt.IsMod2())
{
@@ -485,25 +484,26 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
* Objekt verschieben
******************************************************************/
if ( ! rMEvt.IsRight())
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, NULL, nDrgLog);
+ mpView->BegDragObj(aMDPos, NULL, fDrgLog);
}
else if (eHit == SDRHIT_HANDLE)
{
/******************************************************************
* Klebepunkt selektieren
******************************************************************/
- if (!mpView->IsPointMarked(*aVEvt.pHdl) || rMEvt.IsShift())
+ if (!mpView->IsPointMarked(*aVEvt.mpHdl) || rMEvt.IsShift())
{
if (!rMEvt.IsShift())
{
- mpView->UnmarkAllPoints();
+ mpView->MarkPoints(0, true); // unmarkall
+ mpView->forceSelectionChange();
pHdl = mpView->PickHandle(aMDPos);
}
else
{
- if (mpView->IsPointMarked(*aVEvt.pHdl))
+ if (mpView->IsPointMarked(*aVEvt.mpHdl))
{
- mpView->UnmarkPoint(*aVEvt.pHdl);
+ mpView->MarkPoint(const_cast< SdrHdl& >(*aVEvt.mpHdl), true); // unmark
pHdl = NULL;
}
else
@@ -514,9 +514,32 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
if (pHdl)
{
+ // mark this point. If it was not yet marked, this will change
+ // the selection (seel below)
mpView->MarkPoint(*pHdl);
+
if ( ! rMEvt.IsRight())
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+ {
+ // here HAVE to check for pending selection change; if this
+ // is the case, pHdl WILL be deleted on the next execution of this
+ // pending change and a new one will be created. Need to force
+ // that change to get the new created pHdl to not continue
+ // processing on the dying one
+ if(mpView->isSelectionChangePending()) // TTTT: Check again: Is this needed?
+ {
+ mpView->forceSelectionChange();
+ pHdl = mpView->PickHandle(aMDPos);
+ }
+
+ if(pHdl)
+ {
+ mpView->BegDragObj(aMDPos, pHdl, fDrgLog);
+ }
+ else
+ {
+ OSL_ENSURE(false, "OOps, got no new SdrHdl after after selection change (!)");
+ }
+ }
}
}
else
@@ -526,7 +549,7 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
pHdl = mpView->PickHandle(aMDPos);
if(pHdl)
if ( ! rMEvt.IsRight())
- mpView->BegDragObj(aMDPos, (OutputDevice*)NULL, pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, pHdl, fDrgLog);
}
}
else
@@ -539,17 +562,17 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
mpView->UnmarkAllObj();
}
- sal_Bool bMarked = sal_False;
+ bool bMarked = false;
if (!rMEvt.IsMod1())
{
if (rMEvt.IsMod2())
{
- bMarked = mpView->MarkNextObj(aMDPos, nHitLog, rMEvt.IsShift());
+ bMarked = mpView->MarkNextObj(aMDPos, fHitLog, rMEvt.IsShift());
}
else
{
- bMarked = mpView->MarkObj(aMDPos, nHitLog, rMEvt.IsShift(), sal_False);
+ bMarked = mpView->MarkObj(aMDPos, fHitLog, rMEvt.IsShift(), false);
}
}
@@ -558,18 +581,22 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
{
// Objekt verschieben
if ( ! rMEvt.IsRight())
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fDrgLog);
}
- else if (mpView->AreObjectsMarked())
+ else if (mpView->areSdrObjectsSelected())
{
/**************************************************************
* Klebepunkt selektieren
**************************************************************/
if (!rMEvt.IsShift())
- mpView->UnmarkAllPoints();
+ {
+ mpView->MarkPoints(0, true); // unmarkall
+ }
if ( ! rMEvt.IsRight())
+ {
mpView->BegMarkPoints(aMDPos);
+ }
}
else
{
@@ -577,7 +604,9 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
* Objekt selektieren
**************************************************************/
if ( ! rMEvt.IsRight())
+ {
mpView->BegMarkObj(aMDPos);
+ }
}
ForcePointer(&rMEvt);
@@ -598,15 +627,15 @@ sal_Bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuSelection::MouseMove(const MouseEvent& rMEvt)
+bool FuSelection::MouseMove(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuDraw::MouseMove(rMEvt);
+ bool bReturn = FuDraw::MouseMove(rMEvt);
if (aDragTimer.IsActive())
{
if(bFirstMouseMove)
{
- bFirstMouseMove = sal_False;
+ bFirstMouseMove = false;
}
else
{
@@ -616,18 +645,18 @@ sal_Bool FuSelection::MouseMove(const MouseEvent& rMEvt)
if (mpView->IsAction())
{
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt(mpWindow->PixelToLogic(aPix));
+ const basegfx::B2DPoint aPix(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPix);
ForceScroll(aPix);
if (mpView->IsInsObjPoint())
{
- mpView->MovInsObjPoint(aPnt);
+ mpView->MovInsObjPoint(aLogicPos);
}
else
{
- mpView->MovAction(aPnt);
+ mpView->MovAction(aLogicPos);
}
}
@@ -642,9 +671,9 @@ sal_Bool FuSelection::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
// When the right mouse button is pressed then only select objects
// (and deselect others) as a preparation for showing the context
// menu.
@@ -653,26 +682,34 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
if (bHideAndAnimate)
{
// Animation laeuft noch -> sofort returnieren
- bHideAndAnimate = sal_False;
+ bHideAndAnimate = false;
pHdl = NULL;
mpWindow->ReleaseMouse();
- return(sal_True);
+ return(true);
}
if (aDragTimer.IsActive() )
{
aDragTimer.Stop();
- bIsInDragMode = sal_False;
+ bIsInDragMode = false;
}
if( !mpView )
- return (sal_False);
+ return false;
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
+ if(mpView->isSelectionChangePending())
+ {
+ // force trigger selection change to get bSelectionChanged
+ // set in FuSelection::SelectionHasChanged() call eventually
+ mpView->forceSelectionChange();
+ }
- if (mpView->IsFrameDragSingles() || !mpView->HasMarkablePoints())
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ const double fDrgLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
+
+ if (mpView->IsFrameHandles() || !mpView->HasMarkablePoints())
{
/**********************************************************************
* KEIN BEZIER_EDITOR
@@ -683,33 +720,25 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
* Objekt wurde verschoben
******************************************************************/
FrameView* pFrameView = mpViewShell->GetFrameView();
- sal_Bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
+ bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
if (bDragWithCopy)
{
- bDragWithCopy = !mpView->IsPresObjSelected(sal_False, sal_True);
+ bDragWithCopy = !mpView->IsPresObjSelected(false, true);
}
mpView->SetDragWithCopy(bDragWithCopy);
mpView->EndDragObj( mpView->IsDragWithCopy() );
- mpView->ForceMarkedToAnotherPage();
-
if (!rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() &&
!bSelectionChanged &&
- Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
- Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
+ fabs(aLogicPos.getX() - aMDPos.getX()) < fDrgLog &&
+ fabs(aLogicPos.getY() - aMDPos.getY()) < fDrgLog)
{
/**************************************************************
* Toggle zw. Selektion und Rotation
**************************************************************/
- SdrObject* pSingleObj = NULL;
- sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount();
-
- if (nMarkCount==1)
- {
- pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- }
+ SdrObject* pSingleObj = mpView->getSelectedIfSingle();
if (nSlotId == SID_OBJECT_SELECT
&& mpView->IsRotateAllowed()
@@ -721,7 +750,7 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
&& ! bSelectionOnly)
{
- bTempRotation = sal_True;
+ bTempRotation = true;
nSlotId = SID_OBJECT_ROTATE;
Activate();
}
@@ -735,9 +764,9 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
{
if (!pHdl)
{
- bSuppressChangesOfSelection = sal_True;
+ bSuppressChangesOfSelection = true;
mpView->Start3DCreation();
- bSuppressChangesOfSelection = sal_False;
+ bSuppressChangesOfSelection = false;
}
else if (pHdl->GetKind() != HDL_MIRX &&
pHdl->GetKind() != HDL_REF1 &&
@@ -747,18 +776,19 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
* Wenn 3D-Rotationskoerper erstellt werden sollen, jetzt
* die Erstellung beenden
**********************************************************/
- long nAngle1 = GetAngle(aPnt - mpView->GetRef1());
- nAngle1 -= 27000;
- nAngle1 = NormAngle360(nAngle1);
- sal_Bool bMirrorSide1 = sal_Bool (nAngle1 < 18000L);
+ const basegfx::B2DVector aDelta(aLogicPos - mpView->GetRef1());
+ long nAngle1 = GetAngle(Point(basegfx::fround(aDelta.getX()), basegfx::fround(aDelta.getY())));
+ nAngle1 -= 27000;
+ nAngle1 = NormAngle360(nAngle1);
+ bool bMirrorSide1 = bool (nAngle1 < 18000L);
if (bMirrorSide0 != bMirrorSide1)
{
- bSuppressChangesOfSelection = sal_True;
+ bSuppressChangesOfSelection = true;
if(mpWindow)
mpWindow->EnterWait();
mpView->End3DCreation();
- bSuppressChangesOfSelection = sal_False;
+ bSuppressChangesOfSelection = false;
nSlotId = SID_OBJECT_SELECT;
if(mpWindow)
mpWindow->LeaveWait();
@@ -769,11 +799,11 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
}
else if (rMEvt.IsMod1()
&& !rMEvt.IsMod2()
- && Abs(aPnt.X() - aMDPos.X()) < nDrgLog
- && Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
+ && fabs(aLogicPos.getX() - aMDPos.getX()) < fDrgLog
+ && fabs(aLogicPos.getY() - aMDPos.getY()) < fDrgLog)
{
// Gruppe betreten
- mpView->MarkObj(aPnt, nHitLog, rMEvt.IsShift(), rMEvt.IsMod1());
+ mpView->MarkObj(aLogicPos, fHitLog, rMEvt.IsShift(), rMEvt.IsMod1());
}
if (mpView->IsAction() )
@@ -791,7 +821,7 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
else if (pWaterCanCandidate != NULL)
{
// Is the candiate object still under the mouse?
- if (pickObject (aPnt) == pWaterCanCandidate)
+ if (pickObject (aLogicPos) == pWaterCanCandidate)
{
SdStyleSheetPool* pPool = static_cast<SdStyleSheetPool*>(
mpDocSh->GetStyleSheetPool());
@@ -809,7 +839,7 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
mpView->AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoGeoObject(*pWaterCanCandidate));
mpView->AddUndo(pUndoAttr);
- pWaterCanCandidate->SetStyleSheet (pStyleSheet, sal_False);
+ pWaterCanCandidate->SetStyleSheet (pStyleSheet, false);
// #108981#
mpView->EndUndo();
@@ -830,20 +860,14 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
DoubleClick(rMEvt);
}
- bMBDown = sal_False;
+ bMBDown = false;
ForcePointer(&rMEvt);
pHdl = NULL;
mpWindow->ReleaseMouse();
- SdrObject* pSingleObj = NULL;
- sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount();
-
- if (nMarkCount==1)
- {
- pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- }
+ SdrObject* pSingleObj = mpView->getSelectedIfSingle();
- if ( (nSlotId != SID_OBJECT_SELECT && nMarkCount==0) ||
+ if ( (nSlotId != SID_OBJECT_SELECT && !mpView->areSdrObjectsSelected()) ||
( mpView->GetDragMode() == SDRDRAG_CROOK &&
!mpView->IsCrookAllowed( mpView->IsCrookNoContortion() ) ) ||
( mpView->GetDragMode() == SDRDRAG_SHEAR &&
@@ -852,7 +876,7 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
(pSingleObj->GetObjInventor() != SdrInventor ||
pSingleObj->GetObjIdentifier() == OBJ_MEASURE) ) )
{
- bReturn = sal_True;
+ bReturn = true;
ForcePointer(&rMEvt);
pHdl = NULL;
mpWindow->ReleaseMouse();
@@ -877,11 +901,11 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
else if ( mpView->IsDragObj() )
{
FrameView* pFrameView = mpViewShell->GetFrameView();
- sal_Bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
+ bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
if (bDragWithCopy)
{
- bDragWithCopy = !mpView->IsPresObjSelected(sal_False, sal_True);
+ bDragWithCopy = !mpView->IsPresObjSelected(false, true);
}
mpView->SetDragWithCopy(bDragWithCopy);
@@ -890,13 +914,12 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
else
{
mpView->EndAction();
+ const basegfx::B2DVector aDelta(aMDPos - aLogicPos);
- sal_uInt16 nDrgLog2 = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
-
- if (Abs(aMDPos.X() - aPos.X()) < nDrgLog2 &&
- Abs(aMDPos.Y() - aPos.Y()) < nDrgLog2 &&
- !rMEvt.IsShift() && !rMEvt.IsMod2())
+ if(fabs(aDelta.getX()) < fDrgLog
+ && fabs(aDelta.getY()) < fDrgLog
+ && !rMEvt.IsShift()
+ && !rMEvt.IsMod2())
{
SdrViewEvent aVEvt;
SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
@@ -910,11 +933,11 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
}
}
else if (!rMEvt.IsShift() && rMEvt.IsMod1() && !rMEvt.IsMod2() &&
- Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
- Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
+ fabs(aLogicPos.getX() - aMDPos.getX()) < fDrgLog &&
+ fabs(aLogicPos.getY() - aMDPos.getY()) < fDrgLog)
{
// Gruppe betreten
- mpView->MarkObj(aPnt, nHitLog, sal_False, rMEvt.IsMod1());
+ mpView->MarkObj(aLogicPos, fHitLog, false, rMEvt.IsMod1());
}
@@ -932,14 +955,14 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuSelection::KeyInput(const KeyEvent& rKEvt)
+bool FuSelection::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
switch (rKEvt.GetKeyCode().GetCode())
{
@@ -954,7 +977,7 @@ sal_Bool FuSelection::KeyInput(const KeyEvent& rKEvt)
{
bReturn = FuDraw::KeyInput(rKEvt);
- if(mpView->GetMarkedObjectList().GetMarkCount() == 0)
+ if(!mpView->areSdrObjectsSelected())
{
mpView->ResetCreationActive();
@@ -977,17 +1000,18 @@ void FuSelection::Activate()
{
SdrDragMode eMode;
mpView->ResetCreationActive();
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
switch( nSlotId )
{
case SID_OBJECT_ROTATE:
{
// (gemapter) Slot wird explizit auf Rotate gesetzt #31052#
- if( mpViewShell->ISA(DrawViewShell) )
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell);
+
+ if( pDrawViewShell )
{
- sal_uInt16* pSlotArray =
- static_cast<DrawViewShell*>(mpViewShell)->GetSlotArray();
+ sal_uInt16* pSlotArray = pDrawViewShell->GetSlotArray();
pSlotArray[ 1 ] = SID_OBJECT_ROTATE;
}
@@ -1082,7 +1106,7 @@ void FuSelection::Activate()
case SID_CONVERT_TO_3D_LATHE:
{
eMode = SDRDRAG_MIRROR;
- bSuppressChangesOfSelection = sal_True;
+ bSuppressChangesOfSelection = true;
if ( mpView->GetDragMode() != eMode )
mpView->SetDragMode(eMode);
@@ -1090,7 +1114,7 @@ void FuSelection::Activate()
if (!mpView->Is3DRotationCreationActive())
mpView->Start3DCreation();
- bSuppressChangesOfSelection = sal_False;
+ bSuppressChangesOfSelection = false;
}
break;
@@ -1106,7 +1130,7 @@ void FuSelection::Activate()
if (nSlotId != SID_OBJECT_ROTATE)
{
- bTempRotation = sal_False;
+ bTempRotation = false;
}
FuDraw::Activate();
@@ -1134,7 +1158,7 @@ void FuSelection::Deactivate()
void FuSelection::SelectionHasChanged()
{
- bSelectionChanged = sal_True;
+ bSelectionChanged = true;
FuDraw::SelectionHasChanged();
@@ -1163,11 +1187,11 @@ void FuSelection::SetEditMode(sal_uInt16 nMode)
if (nEditMode == SID_BEZIER_INSERT)
{
- mpView->SetInsObjPointMode(sal_True);
+ mpView->SetInsObjPointMode(true);
}
else
{
- mpView->SetInsObjPointMode(sal_False);
+ mpView->SetInsObjPointMode(false);
}
ForcePointer();
@@ -1183,41 +1207,25 @@ void FuSelection::SetEditMode(sal_uInt16 nMode)
|*
\************************************************************************/
-sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
-{
- sal_Bool bAnimated = sal_False;
- sal_Bool bClosed = pObj->IsClosedObj();
- sal_Bool bFilled = sal_False;
-
- if (bClosed)
+bool FuSelection::AnimateObj(SdrObject* pObj, const basegfx::B2DPoint& rPos)
{
- SfxItemSet aSet(mpDoc->GetPool());
-
- aSet.Put(pObj->GetMergedItemSet());
-
- const XFillStyleItem& rFillStyle = (const XFillStyleItem&) aSet.Get(XATTR_FILLSTYLE);
- bFilled = rFillStyle.GetValue() != XFILL_NONE;
- }
+ bool bAnimated(false);
+ const bool bClosed(pObj->IsClosedObj());
+ const bool bFilled(bClosed? pObj->HasFillStyle() : false);
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ double f2HitLog(fHitLog * 2);
- const SetOfByte* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers();
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
- const long n2HitLog = nHitLog * 2;
- Point aHitPosR(rPos);
- Point aHitPosL(rPos);
- Point aHitPosT(rPos);
- Point aHitPosB(rPos);
-
- aHitPosR.X() += n2HitLog;
- aHitPosL.X() -= n2HitLog;
- aHitPosT.Y() += n2HitLog;
- aHitPosB.Y() -= n2HitLog;
+ const basegfx::B2DPoint aHitPosR(rPos.getX() + f2HitLog, rPos.getY());
+ const basegfx::B2DPoint aHitPosL(rPos.getX() - f2HitLog, rPos.getY());
+ const basegfx::B2DPoint aHitPosT(rPos.getX(), rPos.getY() + f2HitLog);
+ const basegfx::B2DPoint aHitPosB(rPos.getX(), rPos.getY() - f2HitLog);
if ( !bClosed ||
!bFilled ||
- (SdrObjectPrimitiveHit(*pObj, aHitPosR, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pObj, aHitPosL, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pObj, aHitPosT, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pObj, aHitPosB, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) ) )
+ (SdrObjectPrimitiveHit(*pObj, aHitPosR, fHitLog, *mpView, false, 0) &&
+ SdrObjectPrimitiveHit(*pObj, aHitPosL, fHitLog, *mpView, false, 0) &&
+ SdrObjectPrimitiveHit(*pObj, aHitPosT, fHitLog, *mpView, false, 0) &&
+ SdrObjectPrimitiveHit(*pObj, aHitPosB, fHitLog, *mpView, false, 0) ) )
{
if ( mpDoc->GetIMapInfo( pObj ) )
{
@@ -1231,18 +1239,18 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
- SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
+ SfxBoolItem aBrowseItem( SID_BROWSE, true );
mpWindow->ReleaseMouse();
pFrame->GetDispatcher()->
Execute(SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
&aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
- bAnimated = sal_True;
+ bAnimated = true;
}
}
- else if (!mpDocSh->ISA(GraphicDocShell) &&
- mpView->ISA(DrawView) &&
- mpDoc->GetAnimationInfo(pObj))
+ else if(!dynamic_cast< GraphicDocShell* >(mpDocSh)
+ && dynamic_cast< DrawView* >(mpView)
+ && mpDoc->GetAnimationInfo(pObj))
{
/**********************************************************
* Animations-Objekt in der Mitte getroffen -> Interaktion
@@ -1259,7 +1267,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
SfxStringItem aItem(SID_NAVIGATOR_OBJECT, pInfo->GetBookmark());
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_NAVIGATOR_OBJECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aItem, 0L);
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1273,13 +1281,13 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
SfxStringItem aStrItem(SID_FILE_NAME, sBookmark);
SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
- SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
+ SfxBoolItem aBrowseItem( SID_BROWSE, true );
pFrame->GetDispatcher()->
Execute(SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
&aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
}
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1290,7 +1298,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
&aItem, 0L);
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1301,7 +1309,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
&aItem, 0L);
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1312,7 +1320,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
&aItem, 0L);
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1323,7 +1331,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_NAVIGATOR_PAGE, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
&aItem, 0L);
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1338,7 +1346,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
{
(void)e;
}
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1346,9 +1354,9 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
{
// Verb zuweisen
mpView->UnmarkAll();
- mpView->MarkObj(pObj, mpView->GetSdrPageView(), sal_False, sal_False);
+ mpView->MarkObj(*pObj, false );
pDrViewSh->DoVerb((sal_Int16)pInfo->mnVerb);
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1362,7 +1370,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
if( INET_PROT_FILE == aURL.GetProtocol() )
{
SfxStringItem aUrl( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) );
- SfxBoolItem aBrowsing( SID_BROWSE, sal_True );
+ SfxBoolItem aBrowsing( SID_BROWSE, true );
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
@@ -1373,7 +1381,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
0L );
}
- bAnimated = sal_True;
+ bAnimated = true;
}
break;
@@ -1394,17 +1402,17 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
*pInArgs, aRet, aOutArgsIndex, aOutArgs);
// Check the return value from the script
- sal_Bool bTmp = sal_False;
+ bool bTmp = false;
if ( eErr == ERRCODE_NONE &&
aRet.getValueType() == getCppuBooleanType() &&
sal_True == ( aRet >>= bTmp ) &&
- bTmp == sal_True )
+ bTmp == true )
{
- bAnimated = sal_True;
+ bAnimated = true;
}
else
{
- bAnimated = sal_False;
+ bAnimated = false;
}
}
else
@@ -1433,17 +1441,17 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
default:
{
- bAnimated = sal_False;
+ bAnimated = false;
}
break;
}
}
- if (!bAnimated &&
- mpView->ISA(DrawView) &&
- !mpDocSh->ISA(GraphicDocShell) &&
- SlideShow::IsRunning( mpViewShell->GetViewShellBase() ) &&
- mpDoc->GetAnimationInfo(pObj))
+ if (!bAnimated
+ && dynamic_cast< DrawView* >(mpView)
+ && !dynamic_cast< GraphicDocShell* >(mpDocSh)
+ && SlideShow::IsRunning( mpViewShell->GetViewShellBase() )
+ && mpDoc->GetAnimationInfo(pObj))
{
/**********************************************************
* Effekt-Objekt in der Mitte getroffen -> Effekt abspielen
@@ -1457,7 +1465,7 @@ sal_Bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
break;
default:
- bAnimated = sal_False;
+ bAnimated = false;
break;
}
}
@@ -1491,12 +1499,13 @@ bool FuSelection::cancel()
-SdrObject* FuSelection::pickObject (const Point& rTestPoint)
+SdrObject* FuSelection::pickObject (const basegfx::B2DPoint& rTestPoint)
{
- SdrObject* pObject = NULL;
- SdrPageView* pPageView;
- sal_uInt16 nHitLog = sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width());
- mpView->PickObj (rTestPoint, nHitLog, pObject, pPageView, SDRSEARCH_PICKMARKABLE);
+ SdrObject* pObject = 0;
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+
+ mpView->PickObj(rTestPoint, fHitLog, pObject, SDRSEARCH_PICKMARKABLE);
+
return pObject;
}
} // end of namespace sd
diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx
index 73dde07bcd14..ac0df54cb971 100644
--- a/sd/source/ui/func/fusldlg.cxx
+++ b/sd/source/ui/func/fusldlg.cxx
@@ -47,9 +47,6 @@ namespace sd {
#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
-TYPEINIT1( FuSlideShowDlg, FuPoor );
-
-
/*************************************************************************
|*
|* Konstruktor
@@ -77,23 +74,23 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
{
PresentationSettings& rPresentationSettings = mpDoc->getPresentationSettings();
- SfxItemSet aDlgSet( mpDoc->GetPool(), ATTR_PRESENT_START, ATTR_PRESENT_END );
+ SfxItemSet aDlgSet( mpDoc->GetItemPool(), ATTR_PRESENT_START, ATTR_PRESENT_END );
List aPageNameList;
const String& rPresPage = rPresentationSettings.maPresPage;
String aFirstPage;
String aStandardName( SdResId( STR_PAGE ) );
SdPage* pPage = NULL;
- long nPage;
+ sal_uInt32 nPage(0);
- for( nPage = mpDoc->GetSdPageCount( PK_STANDARD ) - 1L; nPage >= 0L; nPage-- )
+ for( nPage = mpDoc->GetSdPageCount( PK_STANDARD ); nPage > 0; nPage-- )
{
- pPage = mpDoc->GetSdPage( (sal_uInt16) nPage, PK_STANDARD );
+ pPage = mpDoc->GetSdPage( nPage - 1, PK_STANDARD );
String* pStr = new String( pPage->GetName() );
if ( !pStr->Len() )
{
*pStr = String( SdResId( STR_PAGE ) );
- (*pStr).Append( UniString::CreateFromInt32( nPage + 1 ) );
+ (*pStr).Append( UniString::CreateFromInt32( nPage ) );
}
aPageNameList.Insert( pStr, (sal_uLong) 0 );
@@ -106,7 +103,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
}
List* pCustomShowList = mpDoc->GetCustomShowList(); // No Create
- sal_Bool bStartWithActualPage = SD_MOD()->GetSdOptions( mpDoc->GetDocumentType() )->IsStartWithActualPage();
+ bool bStartWithActualPage = SD_MOD()->GetSdOptions( mpDoc->GetDocumentType() )->IsStartWithActualPage();
/* #109180# change in behaviour, even when always start with current page is enabled, range settings are
still used
if( bStartWithActualPage )
@@ -144,7 +141,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
rtl::OUString aPage;
long nValue32;
sal_Bool bValue;
- bool bValuesChanged = sal_False;
+ bool bValuesChanged = false;
pDlg->GetAttr( aDlgSet );
@@ -250,7 +247,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
// wenn sich etwas geaendert hat, setzen wir das Modified-Flag,
if ( bValuesChanged )
- mpDoc->SetChanged( sal_True );
+ mpDoc->SetChanged( true );
}
delete pDlg;
// Strings aus Liste loeschen
diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx
index 6edf58c6890f..d6f12fe70a72 100644
--- a/sd/source/ui/func/fusnapln.cxx
+++ b/sd/source/ui/func/fusnapln.cxx
@@ -47,8 +47,6 @@
namespace sd {
-TYPEINIT1( FuSnapLine, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -71,15 +69,14 @@ FunctionReference FuSnapLine::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::
void FuSnapLine::DoExecute( SfxRequest& rReq )
{
const SfxItemSet* pArgs = rReq.GetArgs();
- SdrPageView* pPV = 0;
- sal_uInt16 nHelpLine = 0;
- sal_Bool bCreateNew = sal_True;
+ sal_uInt32 nHelpLine(0);
+ bool bCreateNew = true;
// Get index of snap line or snap point from the request.
- SFX_REQUEST_ARG (rReq, pHelpLineIndex, SfxUInt32Item, ID_VAL_INDEX, sal_False);
+ SFX_REQUEST_ARG (rReq, pHelpLineIndex, SfxUInt32Item, ID_VAL_INDEX );
if (pHelpLineIndex != NULL)
{
- nHelpLine = static_cast<sal_uInt16>(pHelpLineIndex->GetValue());
+ nHelpLine = pHelpLineIndex->GetValue();
// Reset the argument pointer to trigger the display of the dialog.
pArgs = NULL;
}
@@ -88,71 +85,75 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
{
SfxItemSet aNewAttr(mpViewShell->GetPool(), ATTR_SNAPLINE_START, ATTR_SNAPLINE_END);
bool bLineExist (false);
- pPV = mpView->GetSdrPageView();
- Point aLinePos;
+ basegfx::B2DPoint aLinePos;
- if (pHelpLineIndex == NULL)
+ if(mpView->GetSdrPageView())
{
- // The index of the snap line is not provided as argument to the
- // request. Determine it from the mouse position.
-
- aLinePos = static_cast<DrawViewShell*>(mpViewShell)->GetMousePos();
- static_cast<DrawViewShell*>(mpViewShell)->SetMousePosFreezed( sal_False );
-
-
- if ( aLinePos.X() >= 0 )
+ if (pHelpLineIndex == NULL)
{
- aLinePos = mpWindow->PixelToLogic(aLinePos);
- sal_uInt16 nHitLog = (sal_uInt16) mpWindow->PixelToLogic(Size(HITPIX,0)).Width();
- bLineExist = mpView->PickHelpLine(aLinePos, nHitLog, *mpWindow, nHelpLine, pPV);
- if ( bLineExist )
- aLinePos = (pPV->GetHelpLines())[nHelpLine].GetPos();
- else
- pPV = mpView->GetSdrPageView();
+ // The index of the snap line is not provided as argument to the
+ // request. Determine it from the mouse position.
+ static_cast<DrawViewShell*>(mpViewShell)->SetMousePosFreezed( false );
+ aLinePos = static_cast<DrawViewShell*>(mpViewShell)->GetMousePos();
- pPV->LogicToPagePos(aLinePos);
+ if(basegfx::fTools::moreOrEqual(aLinePos.getX(), 0.0))
+ {
+ aLinePos = mpWindow->GetInverseViewTransformation() * aLinePos;
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ bLineExist = mpView->PickHelpLine(aLinePos, fHitLog, nHelpLine);
+
+ if(bLineExist)
+ {
+ aLinePos = (mpView->GetSdrPageView()->GetHelpLines())[nHelpLine].GetPos();
+ aLinePos -= mpView->GetSdrPageView()->GetPageOrigin();
+ }
+ }
+ else
+ {
+ aLinePos = basegfx::B2DPoint(0.0, 0.0);
+ }
}
else
- aLinePos = Point(0,0);
- }
- else
- {
- OSL_ASSERT(pPV!=NULL);
- aLinePos = (pPV->GetHelpLines())[nHelpLine].GetPos();
- pPV->LogicToPagePos(aLinePos);
- bLineExist = true;
+ {
+ aLinePos = (mpView->GetSdrPageView()->GetHelpLines())[nHelpLine].GetPos();
+ aLinePos -= mpView->GetSdrPageView()->GetPageOrigin();
+ bLineExist = true;
+ }
}
- aNewAttr.Put(SfxUInt32Item(ATTR_SNAPLINE_X, aLinePos.X()));
- aNewAttr.Put(SfxUInt32Item(ATTR_SNAPLINE_Y, aLinePos.Y()));
+
+ aNewAttr.Put(SfxUInt32Item(ATTR_SNAPLINE_X, basegfx::fround(aLinePos.getX())));
+ aNewAttr.Put(SfxUInt32Item(ATTR_SNAPLINE_Y, basegfx::fround(aLinePos.getY())));
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
AbstractSdSnapLineDlg* pDlg = pFact ? pFact->CreateSdSnapLineDlg( NULL, aNewAttr, mpView ) : 0;
if( pDlg )
{
- if ( bLineExist )
+ if ( bLineExist ) // includes mpView->GetSdrPageView() != 0
{
pDlg->HideRadioGroup();
- const SdrHelpLine& rHelpLine = (pPV->GetHelpLines())[nHelpLine];
+ const SdrHelpLine& rHelpLine = (mpView->GetSdrPageView()->GetHelpLines())[nHelpLine];
if ( rHelpLine.GetKind() == SDRHELPLINE_POINT )
{
pDlg->SetText(String(SdResId(STR_SNAPDLG_SETPOINT)));
- pDlg->SetInputFields(sal_True, sal_True);
+ pDlg->SetInputFields(true, true);
}
else
{
pDlg->SetText(String(SdResId(STR_SNAPDLG_SETLINE)));
if ( rHelpLine.GetKind() == SDRHELPLINE_VERTICAL )
- pDlg->SetInputFields(sal_True, sal_False);
+ pDlg->SetInputFields(true, false);
else
- pDlg->SetInputFields(sal_False, sal_True);
+ pDlg->SetInputFields(false, true);
}
- bCreateNew = sal_False;
+ bCreateNew = false;
}
else
+ {
pDlg->HideDeleteBtn();
+ }
sal_uInt16 nResult = pDlg->Execute();
@@ -168,39 +169,44 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
case RET_SNAP_DELETE:
// Fangobjekt loeschen
- if ( !bCreateNew )
- pPV->DeleteHelpLine(nHelpLine);
+ if ( !bCreateNew && mpView->GetSdrPageView())
+ {
+ mpView->GetSdrPageView()->DeleteHelpLine(nHelpLine);
+ }
// und weiter wie bei default
default:
return;
}
}
}
- Point aHlpPos;
- aHlpPos.X() = ((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_X)).GetValue();
- aHlpPos.Y() = ((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_Y)).GetValue();
- pPV->PagePosToLogic(aHlpPos);
-
- if ( bCreateNew )
+ if(mpView->GetSdrPageView())
{
- SdrHelpLineKind eKind;
+ basegfx::B2DPoint aHlpPos;
+ aHlpPos.setX(((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_X)).GetValue());
+ aHlpPos.setY(((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_Y)).GetValue());
+ aHlpPos += mpView->GetSdrPageView()->GetPageOrigin();
+
+ if ( bCreateNew )
+ {
+ SdrHelpLineKind eKind;
- pPV = mpView->GetSdrPageView();
+ switch ( (SnapKind) ((const SfxAllEnumItem&)
+ pArgs->Get(ATTR_SNAPLINE_KIND)).GetValue() )
+ {
+ case SK_HORIZONTAL : eKind = SDRHELPLINE_HORIZONTAL; break;
+ case SK_VERTICAL : eKind = SDRHELPLINE_VERTICAL; break;
+ default : eKind = SDRHELPLINE_POINT; break;
+ }
- switch ( (SnapKind) ((const SfxAllEnumItem&)
- pArgs->Get(ATTR_SNAPLINE_KIND)).GetValue() )
+ mpView->GetSdrPageView()->InsertHelpLine(SdrHelpLine(eKind, aHlpPos));
+ }
+ else
{
- case SK_HORIZONTAL : eKind = SDRHELPLINE_HORIZONTAL; break;
- case SK_VERTICAL : eKind = SDRHELPLINE_VERTICAL; break;
- default : eKind = SDRHELPLINE_POINT; break;
+ const SdrHelpLine& rHelpLine = (mpView->GetSdrPageView()->GetHelpLines())[nHelpLine];
+
+ mpView->GetSdrPageView()->SetHelpLine(nHelpLine, SdrHelpLine(rHelpLine.GetKind(), aHlpPos));
}
- pPV->InsertHelpLine(SdrHelpLine(eKind, aHlpPos));
- }
- else
- {
- const SdrHelpLine& rHelpLine = (pPV->GetHelpLines())[nHelpLine];
- pPV->SetHelpLine(nHelpLine, SdrHelpLine(rHelpLine.GetKind(), aHlpPos));
}
}
diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx
index ebe018f2e172..f262c8481eff 100644
--- a/sd/source/ui/func/fusumry.cxx
+++ b/sd/source/ui/func/fusumry.cxx
@@ -48,8 +48,6 @@
namespace sd {
-TYPEINIT1( FuSummaryPage, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -76,10 +74,10 @@ void FuSummaryPage::DoExecute( SfxRequest& )
{
::sd::Outliner* pOutl = NULL;
SdPage* pSummaryPage = NULL;
- sal_uInt16 i = 0;
- sal_uInt16 nFirstPage = SDRPAGE_NOTFOUND;
- sal_uInt16 nSelectedPages = 0;
- sal_uInt16 nCount = mpDoc->GetSdPageCount(PK_STANDARD);
+ sal_uInt32 i = 0;
+ sal_uInt32 nFirstPage = SDRPAGE_NOTFOUND;
+ sal_uInt32 nSelectedPages = 0;
+ sal_uInt32 nCount = mpDoc->GetSdPageCount(PK_STANDARD);
while (i < nCount && nSelectedPages <= 1)
{
@@ -134,12 +132,12 @@ void FuSummaryPage::DoExecute( SfxRequest& )
SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers();
// Seite mit Titel & Gliederung!
- pSummaryPage = (SdPage*) mpDoc->AllocPage(sal_False);
- pSummaryPage->SetSize(pActualPage->GetSize() );
- pSummaryPage->SetBorder(pActualPage->GetLftBorder(),
- pActualPage->GetUppBorder(),
- pActualPage->GetRgtBorder(),
- pActualPage->GetLwrBorder() );
+ pSummaryPage = (SdPage*) mpDoc->AllocPage(false);
+ pSummaryPage->SetPageScale(pActualPage->GetPageScale() );
+ pSummaryPage->SetPageBorder(pActualPage->GetLeftPageBorder(),
+ pActualPage->GetTopPageBorder(),
+ pActualPage->GetRightPageBorder(),
+ pActualPage->GetBottomPageBorder() );
// Seite hinten einfuegen
mpDoc->InsertPage(pSummaryPage, nCount * 2 + 1);
@@ -149,17 +147,17 @@ void FuSummaryPage::DoExecute( SfxRequest& )
// MasterPage der aktuellen Seite verwenden
pSummaryPage->TRG_SetMasterPage(pActualPage->TRG_GetMasterPage());
pSummaryPage->SetLayoutName(pActualPage->GetLayoutName());
- pSummaryPage->SetAutoLayout(AUTOLAYOUT_ENUM, sal_True);
+ pSummaryPage->SetAutoLayout(AUTOLAYOUT_ENUM, true);
pSummaryPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
pSummaryPage->setHeaderFooterSettings(pActualPage->getHeaderFooterSettings());
// Notiz-Seite
- SdPage* pNotesPage = (SdPage*) mpDoc->AllocPage(sal_False);
- pNotesPage->SetSize(pActualNotesPage->GetSize());
- pNotesPage->SetBorder(pActualNotesPage->GetLftBorder(),
- pActualNotesPage->GetUppBorder(),
- pActualNotesPage->GetRgtBorder(),
- pActualNotesPage->GetLwrBorder() );
+ SdPage* pNotesPage = (SdPage*) mpDoc->AllocPage(false);
+ pNotesPage->SetPageScale(pActualNotesPage->GetPageScale());
+ pNotesPage->SetPageBorder(pActualNotesPage->GetLeftPageBorder(),
+ pActualNotesPage->GetTopPageBorder(),
+ pActualNotesPage->GetRightPageBorder(),
+ pActualNotesPage->GetBottomPageBorder() );
pNotesPage->SetPageKind(PK_NOTES);
// Seite hinten einfuegen
@@ -171,13 +169,13 @@ void FuSummaryPage::DoExecute( SfxRequest& )
// MasterPage der aktuellen Seite verwenden
pNotesPage->TRG_SetMasterPage(pActualNotesPage->TRG_GetMasterPage());
pNotesPage->SetLayoutName(pActualNotesPage->GetLayoutName());
- pNotesPage->SetAutoLayout(pActualNotesPage->GetAutoLayout(), sal_True);
+ pNotesPage->SetAutoLayout(pActualNotesPage->GetAutoLayout(), true);
pNotesPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
pNotesPage->setHeaderFooterSettings(pActualNotesPage->getHeaderFooterSettings());
pOutl = new ::sd::Outliner( mpDoc, OUTLINERMODE_OUTLINEOBJECT );
- pOutl->SetUpdateMode(sal_False);
- pOutl->EnableUndo(sal_False);
+ pOutl->SetUpdateMode(false);
+ pOutl->EnableUndo(false);
if (mpDocSh)
pOutl->SetRefDevice(SD_MOD()->GetRefDevice( *mpDocSh ));
@@ -207,7 +205,7 @@ void FuSummaryPage::DoExecute( SfxRequest& )
SdrTextObj* pTextObj = (SdrTextObj*) pSummaryPage->GetPresObj(PRESOBJ_OUTLINE);
// Harte Absatz- und Zeichenattribute entfernen
- SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
+ SfxItemSet aEmptyEEAttr(mpDoc->GetItemPool(), EE_ITEMS_START, EE_ITEMS_END);
sal_uLong nParaCount = pOutl->GetParagraphCount();
for (sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
@@ -219,10 +217,10 @@ void FuSummaryPage::DoExecute( SfxRequest& )
}
pTextObj->SetOutlinerParaObject( pOutl->CreateParaObject() );
- pTextObj->SetEmptyPresObj(sal_False);
+ pTextObj->SetEmptyPresObj(false);
- // Harte Attribute entfernen (Flag auf sal_True)
- SfxItemSet aAttr(mpDoc->GetPool());
+ // Harte Attribute entfernen (Flag auf true)
+ SfxItemSet aAttr(pTextObj->GetObjectItemPool());
aAttr.Put(XLineStyleItem(XLINE_NONE));
aAttr.Put(XFillStyleItem(XFILL_NONE));
pTextObj->SetMergedItemSet(aAttr);
@@ -234,7 +232,7 @@ void FuSummaryPage::DoExecute( SfxRequest& )
DrawViewShell* pDrawViewShell= dynamic_cast< DrawViewShell* >( mpViewShell );
if(pDrawViewShell)
{
- pDrawViewShell->SwitchPage( (pSummaryPage->GetPageNum() - 1) / 2);
+ pDrawViewShell->SwitchPage( (pSummaryPage->GetPageNumber() - 1) / 2);
}
}
}
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index 63ff2d03f685..ffa1f62cf353 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -85,8 +85,6 @@ using namespace com::sun::star::style;
namespace sd
{
-TYPEINIT1( FuTemplate, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -122,13 +120,13 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
const SfxPoolItem* pItem;
sal_uInt16 nFamily = USHRT_MAX;
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_FAMILY,
- sal_False, &pItem ))
+ false, &pItem ))
{
nFamily = ( (const SfxUInt16Item &) pArgs->Get( SID_STYLE_FAMILY ) ).GetValue();
}
else
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME,
- sal_False, &pItem ))
+ false, &pItem ))
{
String sFamily = ( (const SfxStringItem &) pArgs->Get( SID_STYLE_FAMILYNAME ) ).GetValue();
if (sFamily.CompareToAscii("graphics") == COMPARE_EQUAL)
@@ -148,8 +146,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
case SID_STYLE_FAMILY:
case SID_STYLE_NEW_BY_EXAMPLE:
{
- SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE, sal_False );
- SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE );
+ SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME );
if ( pFamilyItem && pNameItem )
{
try
@@ -202,7 +200,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
{
// Z.Z. geht immer noch der Dialog auf, um den Namen
// der Vorlage einzugeben.
- if( mpView->AreObjectsMarked() || sal_True )
+ if( mpView->areSdrObjectsSelected() || true )
{
SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_ALL );
if(p)
@@ -225,12 +223,12 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( pStyleSheet )
{
pSSPool->Remove( pStyleSheet );
- nRetMask = sal_True;
- mpDoc->SetChanged(sal_True);
+ nRetMask = true;
+ mpDoc->SetChanged(true);
}
else
{
- nRetMask = sal_False;
+ nRetMask = false;
}
break;
@@ -257,7 +255,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
(pOldStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE && mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW) )
{
mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet);
- mpDoc->SetChanged(sal_True);
+ mpDoc->SetChanged(true);
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
}
}
@@ -273,7 +271,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( pArgs->GetItemState( nSId ) == SFX_ITEM_SET )
{
aStyleName = ( ( (const SfxStringItem &) pArgs->Get( nSId ) ).GetValue() );
- SD_MOD()->SetWaterCan( sal_True );
+ SD_MOD()->SetWaterCan( true );
pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
}
// keine Praesentationsobjektvorlagen, die werden nur
@@ -288,11 +286,11 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
}
else
- SD_MOD()->SetWaterCan( sal_False );
+ SD_MOD()->SetWaterCan( false );
}
else
{
- SD_MOD()->SetWaterCan( sal_False );
+ SD_MOD()->SetWaterCan( false );
// Werkzeugleiste muss wieder enabled werden
mpViewShell->Invalidate();
}
@@ -315,7 +313,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
SfxAbstractTabDialog* pStdDlg = NULL;
SfxAbstractTabDialog* pPresDlg = NULL;
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- sal_Bool bOldDocInOtherLanguage = sal_False;
+ bool bOldDocInOtherLanguage = false;
SfxItemSet aOriSet( pStyleSheet->GetItemSet() );
SfxStyleFamily eFamily = pStyleSheet->GetFamily();
@@ -383,7 +381,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
else
{
DBG_ERROR("Vorlage aus aelterer anderssprachiger Version");
- bOldDocInOtherLanguage = sal_True;
+ bOldDocInOtherLanguage = true;
}
if( !bOldDocInOtherLanguage )
@@ -569,12 +567,11 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
SdrObjListIter aIter( *pPage );
while( aIter.IsMore() )
{
- SdrObject* pObj = aIter.Next();
- if( pObj->ISA(SdrPageObj) )
+ SdrPageObj* pObj = dynamic_cast< SdrPageObj* >(aIter.Next());
+
+ if( pObj )
{
- // repaint only
pObj->ActionChanged();
- // pObj->SendRepaintBroadcast();
}
}
}
@@ -584,16 +581,16 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( mpDoc->GetOnlineSpell() )
{
const SfxPoolItem* pTempItem;
- if( SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE, sal_False, &pTempItem ) ||
- SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CJK, sal_False, &pTempItem ) ||
- SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CTL, sal_False, &pTempItem ) )
+ if( SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE, false, &pTempItem ) ||
+ SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CJK, false, &pTempItem ) ||
+ SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CTL, false, &pTempItem ) )
{
mpDoc->StopOnlineSpelling();
mpDoc->StartOnlineSpelling();
}
}
- mpDoc->SetChanged(sal_True);
+ mpDoc->SetChanged(true);
}
break;
@@ -617,8 +614,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( pStyleSheet )
{
nRetMask = pStyleSheet->GetMask();
- SfxItemSet aCoreSet( mpDoc->GetPool() );
- mpView->GetAttributes( aCoreSet, sal_True );
+ SfxItemSet aCoreSet( mpDoc->GetItemPool() );
+ mpView->GetAttributes( aCoreSet, true );
// wenn das Objekt eine Vorlage hatte, wird diese Parent
// der neuen Vorlage
@@ -644,7 +641,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
}
( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
- mpDoc->SetChanged(sal_True);
+ mpDoc->SetChanged(true);
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
}
@@ -654,15 +651,14 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
case SID_STYLE_UPDATE_BY_EXAMPLE:
{
- if ((mpView->AreObjectsMarked() && mpView->GetMarkedObjectList().GetMarkCount() == 1) ||
- mpView->ISA(OutlineView))
+ if (mpView->getSelectedIfSingle() || dynamic_cast< OutlineView* >(mpView))
{
pStyleSheet = mpView->GetStyleSheet();
if( pStyleSheet )
{
nRetMask = pStyleSheet->GetMask();
- SfxItemSet aCoreSet( mpDoc->GetPool() );
+ SfxItemSet aCoreSet( mpDoc->GetItemPool() );
mpView->GetAttributes( aCoreSet );
SfxItemSet* pStyleSet = &pStyleSheet->GetItemSet();
@@ -671,7 +667,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet);
( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
- mpDoc->SetChanged(sal_True);
+ mpDoc->SetChanged(true);
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
}
}
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 3cb88f4530a1..928e5a86c82a 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -51,12 +51,10 @@
#include <comphelper/processfactory.hxx>
#include <editeng/outlobj.hxx>
#include <svtools/langtab.hxx>
-
-// #104122#
#include <editeng/frmdiritem.hxx>
-
#include <svx/svdetc.hxx>
#include <editeng/editview.hxx>
+#include <svx/svdlegacy.hxx>
#include "sdresid.hxx"
#include "app.hrc"
@@ -122,10 +120,7 @@ static sal_uInt16 SidArray[] = {
SID_PARASPACE_DECREASE, // 27347
0 };
-TYPEINIT1( FuText, FuConstruct );
-
-
-static sal_Bool bTestText = 0;
+static bool bTestText = 0;
/*************************************************************************
|*
@@ -135,7 +130,7 @@ static sal_Bool bTestText = 0;
FuText::FuText( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
: FuConstruct(pViewSh, pWin, pView, pDoc, rReq)
-, bFirstObjCreated(sal_False)
+, bFirstObjCreated(false)
, rRequest (rReq)
{
}
@@ -156,7 +151,7 @@ void FuText::disposing()
{
if(mpView)
{
- if(mpView->SdrEndTextEdit(sal_False) == SDRENDTEXTEDIT_DELETED)
+ if(mpView->SdrEndTextEdit(false) == SDRENDTEXTEDIT_DELETED)
mxTextObj.reset( 0 );
// die RequestHandler der benutzten Outliner zuruecksetzen auf den
@@ -188,49 +183,41 @@ void FuText::DoExecute( SfxRequest& )
ToolBarManager::TBG_FUNCTION,
RID_DRAW_TEXT_TOOLBOX);
- mpView->SetCurrentObj(OBJ_TEXT);
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
MouseEvent aMEvt(mpWindow->GetPointerPosPixel());
+ SdrObject* pSelected = mpView->getSelectedIfSingle();
if (nSlotId == SID_TEXTEDIT)
{
// Try to select an object
- SdrPageView* pPV = mpView->GetSdrPageView();
SdrViewEvent aVEvt;
mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- mpView->MarkObj(aVEvt.pRootObj, pPV);
+ mpView->MarkObj(*aVEvt.mpRootObj);
- mxTextObj.reset( dynamic_cast< SdrTextObj* >( aVEvt.pObj ) );
+ mxTextObj.reset( dynamic_cast< SdrTextObj* >( aVEvt.mpObj ) );
}
- else if (mpView->AreObjectsMarked())
+ else
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ SdrTextObj* pSelectedText = dynamic_cast< SdrTextObj* >(pSelected);
- if (rMarkList.GetMarkCount() == 1)
+ if (pSelectedText)
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- mxTextObj.reset( dynamic_cast< SdrTextObj* >( pObj ) );
+ mxTextObj.reset( pSelectedText );
}
}
// check for table
- if (mpView->AreObjectsMarked())
+ if (pSelected)
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
+ if( (pSelected->GetObjInventor() == SdrInventor ) && (pSelected->GetObjIdentifier() == OBJ_TABLE) )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if( pObj && (pObj->GetObjInventor() == SdrInventor ) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
- {
- mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBarShell( ToolBarManager::TBG_FUNCTION, RID_DRAW_TABLE_TOOLBOX );
- }
+ mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBarShell( ToolBarManager::TBG_FUNCTION, RID_DRAW_TABLE_TOOLBOX );
}
}
- sal_Bool bQuickDrag = sal_True;
-
+ bool bQuickDrag = true;
const SfxItemSet* pArgs = rRequest.GetArgs();
if (pArgs
@@ -242,7 +229,7 @@ void FuText::DoExecute( SfxRequest& )
&& (sal_uInt16)((SfxUInt16Item&)pArgs->Get(SID_TEXTEDIT)).GetValue() == 2)
{
// Selection by doubleclick -> don't allow QuickDrag
- bQuickDrag = sal_False;
+ bQuickDrag = false;
}
SetInEditMode(aMEvt, bQuickDrag);
@@ -254,22 +241,20 @@ void FuText::DoExecute( SfxRequest& )
|*
\************************************************************************/
-sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
{
- bMBDown = sal_True;
-
- sal_Bool bReturn = FuDraw::MouseButtonDown(rMEvt);
+ bMBDown = true;
+ bool bReturn = FuDraw::MouseButtonDown(rMEvt);
/* af: (de)Select object before showing the context menu.
// Fuer PopupMenu (vorher DrawViewShell)
if ((rMEvt.GetButtons() == MOUSE_RIGHT) && rMEvt.GetClicks() == 1 &&
mpView->IsTextEdit())
{
- return (sal_True);
+ return (true);
}
*/
- mpView->SetMarkHdlWhenTextEdit(sal_True);
SdrViewEvent aVEvt;
SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
@@ -277,7 +262,7 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
{
// Text getroffen -> Event von SdrView auswerten lassen
if (mpView->MouseButtonDown(rMEvt, mpWindow))
- return (sal_True);
+ return true;
}
if (rMEvt.GetClicks() == 1)
@@ -299,32 +284,33 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
}
- mpView->SetCurrentObj(OBJ_TEXT);
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
}
if (rMEvt.IsLeft() || rMEvt.IsRight())
{
mpWindow->CaptureMouse();
SdrObject* pObj;
- SdrPageView* pPV = mpView->GetSdrPageView();
if (eHit == SDRHIT_TEXTEDIT)
{
- SetInEditMode(rMEvt, sal_False);
+ SetInEditMode(rMEvt, false);
}
else
{
- sal_Bool bMacro = sal_False;
+ bool bMacro = false;
- if (bMacro && mpView->PickObj(aMDPos,mpView->getHitTolLog(),pObj,pPV,SDRSEARCH_PICKMACRO))
+ if (bMacro && mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO))
{
// Makro
- sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
- mpView->BegMacroObj(aMDPos,nHitLog,pObj,pPV,mpWindow);
+ const double fHitLog(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(HITPIX, 0.0)).getLength());
+ mpView->BegMacroObj(aMDPos, fHitLog, pObj, mpWindow);
}
else
{
+ const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
+
if (eHit != SDRHIT_HANDLE)
{
// Selektion aufheben
@@ -335,7 +321,7 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
}
}
- if ( aVEvt.eEvent == SDREVENT_EXECUTEURL ||
+ if ( aVEvt.meEvent == SDREVENT_EXECUTEURL ||
eHit == SDRHIT_HANDLE ||
eHit == SDRHIT_MARKEDOBJECT ||
eHit == SDRHIT_TEXTEDITOBJ ||
@@ -351,24 +337,26 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
* Text eines unmarkierten Objekts getroffen:
* Objekt wird selektiert und in EditMode versetzt
******************************************************/
- mpView->MarkObj(aVEvt.pRootObj, pPV);
+ mpView->MarkObj(*aVEvt.mpRootObj);
+
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(aVEvt.mpObj);
- if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj))
+ if (pSdrTextObj)
{
- mxTextObj.reset( static_cast<SdrTextObj*>(aVEvt.pObj) );
+ mxTextObj.reset( pSdrTextObj );
}
- SetInEditMode(rMEvt, sal_True);
+ SetInEditMode(rMEvt, true);
}
- else if (aVEvt.eEvent == SDREVENT_EXECUTEURL && !rMEvt.IsMod2())
+ else if (aVEvt.meEvent == SDREVENT_EXECUTEURL && !rMEvt.IsMod2())
{
/******************************************************
* URL ausfuehren
******************************************************/
mpWindow->ReleaseMouse();
- SfxStringItem aStrItem(SID_FILE_NAME, aVEvt.pURLField->GetURL());
+ SfxStringItem aStrItem(SID_FILE_NAME, aVEvt.maURLField);
SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
- SfxBoolItem aBrowseItem( SID_BROWSE, sal_True );
+ SfxBoolItem aBrowseItem( SID_BROWSE, true );
SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
mpWindow->ReleaseMouse();
@@ -410,27 +398,27 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
{
mpView->SdrEndTextEdit();
- if(aVEvt.pHdl)
+ if(aVEvt.mpHdl)
{
// force new handle identification, the pointer will be dead here
// since SdrEndTextEdit has resetted (deleted) the handles.
- aVEvt.pHdl = 0;
+ aVEvt.mpHdl = 0;
mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
}
}
- if (!aVEvt.pHdl)
+ if (!aVEvt.mpHdl)
{
if( eHit == SDRHIT_UNMARKEDOBJECT )
{
if ( !rMEvt.IsShift() )
mpView->UnmarkAll();
- mpView->MarkObj(aVEvt.pRootObj, pPV);
+ mpView->MarkObj(*aVEvt.mpRootObj);
}
// Objekt draggen
- bFirstMouseMove = sal_True;
+ bFirstMouseMove = true;
aDragTimer.Start();
}
@@ -441,8 +429,7 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
if( (eHit == SDRHIT_HANDLE) || (eHit == SDRHIT_MARKEDOBJECT) )
{
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
+ mpView->BegDragObj(aMDPos, aVEvt.mpHdl, fTolerance);
}
}
bReturn = true;
@@ -454,10 +441,9 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
/**********************************************************
* Objekt erzeugen
**********************************************************/
- mpView->SetCurrentObj(OBJ_TEXT);
- mpView->SetEditMode(SDREDITMODE_CREATE);
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- mpView->BegCreateObj(aMDPos, (OutputDevice*) NULL, nDrgLog);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+ mpView->SetViewEditMode(SDREDITMODE_CREATE);
+ mpView->BegCreateObj(aMDPos, fTolerance);
}
else
{
@@ -476,7 +462,7 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
else if ( rMEvt.GetClicks() == 2 && !mpView->IsTextEdit() )
{
MouseEvent aMEvt( mpWindow->GetPointerPosPixel() );
- SetInEditMode( aMEvt, sal_False );
+ SetInEditMode( aMEvt, false );
}
if (!bIsInDragMode)
@@ -494,25 +480,25 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuText::MouseMove(const MouseEvent& rMEvt)
+bool FuText::MouseMove(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = FuDraw::MouseMove(rMEvt);
+ bool bReturn = FuDraw::MouseMove(rMEvt);
if (aDragTimer.IsActive() )
{
if( bFirstMouseMove )
- bFirstMouseMove = sal_False;
+ bFirstMouseMove = false;
else
aDragTimer.Stop();
}
if (!bReturn && mpView->IsAction() && !mpDocSh->IsReadOnly())
{
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt(mpWindow->PixelToLogic(aPix));
+ const basegfx::B2DPoint aPix(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPix);
ForceScroll(aPix);
- mpView->MovAction(aPnt);
+ mpView->MovAction(aLogicPos);
}
ForcePointer(&rMEvt);
@@ -531,32 +517,34 @@ void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
{
if(mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
{
+ const Rectangle aOldLogicRect(sdr::legacy::GetLogicRect(*pTxtObj));
if( nSlotId == SID_ATTR_CHAR )
{
// Impress-Textobjekt wird erzeugt (faellt auf Zeilenhoehe zusammen)
// Damit das Objekt beim anschliessenden Erzeugen gleich die richtige
// Hoehe bekommt (sonst wird zuviel gepainted)
SfxItemSet aSet(mpViewShell->GetPool());
- aSet.Put(SdrTextMinFrameHeightItem(0));
- aSet.Put(SdrTextAutoGrowWidthItem(sal_False));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_True));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, 0));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true));
+
pTxtObj->SetMergedItemSet(aSet);
pTxtObj->AdjustTextFrameWidthAndHeight();
- aSet.Put(SdrTextMaxFrameHeightItem(pTxtObj->GetLogicRect().GetSize().Height()));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT, aOldLogicRect.GetSize().Height()));
pTxtObj->SetMergedItemSet(aSet);
}
else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
{
SfxItemSet aSet(mpViewShell->GetPool());
- aSet.Put(SdrTextMinFrameWidthItem(0));
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, 0));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
// #91853# Needs to be set since default is SDRTEXTHORZADJUST_BLOCK
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
pTxtObj->SetMergedItemSet(aSet);
pTxtObj->AdjustTextFrameWidthAndHeight();
- aSet.Put(SdrTextMaxFrameWidthItem(pTxtObj->GetLogicRect().GetSize().Width()));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH, aOldLogicRect.GetSize().Width()));
pTxtObj->SetMergedItemSet(aSet);
}
}
@@ -568,8 +556,8 @@ void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
SfxItemSet aSet(mpViewShell->GetPool());
// #91510#
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
// #91508#
//aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
@@ -595,8 +583,9 @@ void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
SfxItemSet aSet(mpViewShell->GetPool(), SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
- aSet.Put(SdrTextAutoGrowWidthItem(sal_False));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
+
pTxtObj->SetMergedItemSet(aSet);
pTxtObj->AdjustTextFrameWidthAndHeight();
}
@@ -608,8 +597,9 @@ void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj)
SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
- aSet.Put(SdrTextAutoGrowWidthItem(sal_False));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
+
pTxtObj->SetMergedItemSet(aSet);
pTxtObj->AdjustTextFrameWidthAndHeight();
}
@@ -624,19 +614,21 @@ void FuText::ImpSetAttributesFitCommon(SdrTextObj* pTxtObj)
{
// Impress-Textobjekt (faellt auf Zeilenhoehe zusammen)
SfxItemSet aSet(mpViewShell->GetPool());
- aSet.Put(SdrTextMinFrameHeightItem(0));
- aSet.Put(SdrTextMaxFrameHeightItem(0));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_True));
- aSet.Put(SdrTextAutoGrowWidthItem(sal_False));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, 0));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT, 0));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
+
pTxtObj->SetMergedItemSet(aSet);
}
else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
{
SfxItemSet aSet(mpViewShell->GetPool());
- aSet.Put(SdrTextMinFrameWidthItem(0));
- aSet.Put(SdrTextMaxFrameWidthItem(0));
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, 0));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH, 0));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
+
pTxtObj->SetMergedItemSet(aSet);
}
@@ -644,36 +636,35 @@ void FuText::ImpSetAttributesFitCommon(SdrTextObj* pTxtObj)
}
}
-sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if (aDragTimer.IsActive())
{
aDragTimer.Stop();
- bIsInDragMode = sal_False;
+ bIsInDragMode = false;
}
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
- Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * aPixelPos);
if( (mpView && mpView->MouseButtonUp(rMEvt, mpWindow)) || rMEvt.GetClicks() == 2 )
- return (sal_True); // Event von der SdrView ausgewertet
+ return (true); // Event von der SdrView ausgewertet
- sal_Bool bEmptyTextObj = sal_False;
+ bool bEmptyTextObj = false;
+ const double fTolerance(basegfx::B2DVector(mpWindow->GetInverseViewTransformation() * basegfx::B2DVector(DRGPIX, 0.0)).getLength());
if (mxTextObj.is())
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1
- && ( rMarkList.GetMark(0)->GetMarkedSdrObj() == mxTextObj.get()) )
+ if(mpView->getSelectedIfSingle() == mxTextObj.get())
{
if( mxTextObj.is() && !GetTextObj()->GetOutlinerParaObject() )
- bEmptyTextObj = sal_True;
+ bEmptyTextObj = true;
else
- bFirstObjCreated = sal_True;
+ bFirstObjCreated = true;
}
else
{
@@ -687,30 +678,27 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
* Objekt wurde verschoben
**********************************************************************/
FrameView* pFrameView = mpViewShell->GetFrameView();
- sal_Bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
+ bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
if (bDragWithCopy)
{
- bDragWithCopy = !mpView->IsPresObjSelected(sal_False, sal_True);
+ bDragWithCopy = !mpView->IsPresObjSelected(false, true);
}
mpView->SetDragWithCopy(bDragWithCopy);
mpView->EndDragObj( mpView->IsDragWithCopy() );
- mpView->ForceMarkedToAnotherPage();
- mpView->SetCurrentObj(OBJ_TEXT);
-
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
if ( mpView->IsRotateAllowed() && mpViewShell->GetFrameView()->IsClickChangeRotation() && (rMEvt.GetClicks() != 2) &&
!rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() &&
- Abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
- Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
+ fabs(aLogicPos.getX() - aMDPos.getX()) < fTolerance &&
+ fabs(aLogicPos.getY() - aMDPos.getY()) < fTolerance)
{
// toggle to rotation mode
mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_ROTATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
}
}
- else if( mpView && mpView->IsCreateObj() && rMEvt.IsLeft())
+ else if( mpView && mpView->GetCreateObj() && rMEvt.IsLeft())
{
/**********************************************************************
* Objekt wurde erzeugt
@@ -723,8 +711,8 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
// outliner object up to now; also it needs to be set back to not
// vertical when there was a vertical one used last time.
OutlinerParaObject* pOPO = GetTextObj()->GetOutlinerParaObject();
- SdrOutliner& rOutl = mxTextObj->GetModel()->GetDrawOutliner(GetTextObj());
- sal_Bool bVertical((pOPO && pOPO->IsVertical())
+ SdrOutliner& rOutl = mxTextObj->getSdrModelFromSdrObject().GetDrawOutliner(GetTextObj());
+ bool bVertical((pOPO && pOPO->IsVertical())
|| nSlotId == SID_ATTR_CHAR_VERTICAL
|| nSlotId == SID_TEXT_FITTOSIZE_VERTICAL);
rOutl.SetVertical(bVertical);
@@ -762,24 +750,24 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
// #97016#
ImpSetAttributesFitToSize(GetTextObj());
- SetInEditMode(rMEvt, sal_False);
+ SetInEditMode(rMEvt, false);
}
else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
{
// #97016#
ImpSetAttributesFitToSizeVertical(GetTextObj());
- SetInEditMode(rMEvt, sal_False);
+ SetInEditMode(rMEvt, false);
}
else
{
// #97016#
ImpSetAttributesFitCommon(GetTextObj());
- // Damit die Handles und der graue Rahmen stimmen
- mpView->AdjustMarkHdl();
- mpView->PickHandle(aPnt);
- SetInEditMode(rMEvt, sal_False);
+ // adapt handles
+ mpView->SetMarkHandles();
+ mpView->PickHandle(aLogicPos);
+ SetInEditMode(rMEvt, false);
}
}
else if ( mpView && mpView->IsAction())
@@ -789,17 +777,19 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
ForcePointer(&rMEvt);
mpWindow->ReleaseMouse();
- sal_uInt16 nDrgLog1 = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- if ( mpView && !mpView->AreObjectsMarked() &&
- Abs(aMDPos.X() - aPnt.X()) < nDrgLog1 &&
- Abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 &&
+ if ( mpView && !mpView->areSdrObjectsSelected() &&
+ fabs(aMDPos.getX() - aLogicPos.getX()) < fTolerance &&
+ fabs(aMDPos.getY() - aLogicPos.getY()) < fTolerance &&
!rMEvt.IsShift() && !rMEvt.IsMod2() )
{
- SdrPageView* pPV = mpView->GetSdrPageView();
SdrViewEvent aVEvt;
mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- mpView->MarkObj(aVEvt.pRootObj, pPV);
+
+ if(aVEvt.mpRootObj)
+ {
+ mpView->MarkObj(*aVEvt.mpRootObj);
+ }
}
if ( !mxTextObj.is() && mpView )
@@ -812,27 +802,21 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
/**********************************************************************
* Mengentext (linksbuendiges AutoGrow)
**********************************************************************/
- mpView->SetCurrentObj(OBJ_TEXT);
- mpView->SetEditMode(SDREDITMODE_CREATE);
- sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
- mpView->BegCreateObj(aMDPos, (OutputDevice*) NULL, nDrgLog);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+ mpView->SetViewEditMode(SDREDITMODE_CREATE);
+ mpView->BegCreateObj(aMDPos, fTolerance);
- sal_Bool bSnapEnabled = mpView->IsSnapEnabled();
+ bool bSnapEnabled = mpView->IsSnapEnabled();
if (bSnapEnabled)
- mpView->SetSnapEnabled(sal_False);
+ mpView->SetSnapEnabled(false);
- aPnt.X() += nDrgLog + nDrgLog;
- aPnt.Y() += nDrgLog + nDrgLog;
- mpView->MovAction(aPnt);
+ aLogicPos.setX(aLogicPos.getX() + fTolerance + fTolerance);
+ aLogicPos.setY(aLogicPos.getY() + fTolerance + fTolerance);
+ mpView->MovAction(aLogicPos);
mxTextObj.reset( dynamic_cast< SdrTextObj* >( mpView->GetCreateObj() ) );
- if(mxTextObj.is())
- {
- GetTextObj()->SetDisableAutoWidthOnDragging(sal_True);
- }
-
if(!mpView->EndCreateObj(SDRCREATE_FORCEEND))
{
mxTextObj.reset(0);
@@ -844,10 +828,10 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
if(mxTextObj.is())
{
SfxItemSet aSet(mpViewShell->GetPool());
- aSet.Put(SdrTextMinFrameHeightItem(0));
- aSet.Put(SdrTextMinFrameWidthItem(0));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_True));
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, 0));
+ aSet.Put(SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, 0));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
// #91508#
if(nSlotId == SID_ATTR_CHAR_VERTICAL)
@@ -925,11 +909,11 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
}
GetTextObj()->SetMergedItemSet(aSet);
- GetTextObj()->SetDisableAutoWidthOnDragging(sal_True);
- SetInEditMode(rMEvt, sal_False);
+ GetTextObj()->SetDisableAutoWidthOnDragging(true);
+ SetInEditMode(rMEvt, false);
}
- bFirstObjCreated = sal_True;
+ bFirstObjCreated = true;
}
else
{
@@ -944,7 +928,7 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
}
}
- bMBDown = sal_False;
+ bMBDown = false;
FuConstruct::MouseButtonUp(rMEvt);
return (bReturn);
}
@@ -953,31 +937,22 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
|*
|* Tastaturereignisse bearbeiten
|*
-|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
-|* sal_False.
+|* Wird ein KeyEvent bearbeitet, so ist der Return-Wert true, andernfalls
+|* false.
|*
\************************************************************************/
-sal_Bool FuText::KeyInput(const KeyEvent& rKEvt)
+bool FuText::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
- mpView->SetMarkHdlWhenTextEdit(sal_True);
-
+ bool bReturn = false;
KeyCode nCode = rKEvt.GetKeyCode();
- sal_Bool bShift = nCode.IsShift();
+ bool bShift = nCode.IsShift();
// #97016# IV
if(mxTextObj.is())
{
// maybe object is deleted, test if it's equal to the selected object
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- SdrObject* pSelectedObj = 0L;
-
- if(1 == rMarkList.GetMarkCount())
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- pSelectedObj = pMark->GetMarkedSdrObj();
- }
+ SdrObject* pSelectedObj = mpView->getSelectedIfSingle();
if(mxTextObj.get() != pSelectedObj)
{
@@ -988,14 +963,14 @@ sal_Bool FuText::KeyInput(const KeyEvent& rKEvt)
if ( mxTextObj.is() && mxTextObj->GetObjInventor() == SdrInventor && mxTextObj->GetObjIdentifier() == OBJ_TITLETEXT && rKEvt.GetKeyCode().GetCode() == KEY_RETURN )
{
// Titeltext-Objekt: immer "weiche" Umbrueche
- bShift = sal_True;
+ bShift = true;
}
sal_uInt16 nKey = nCode.GetCode();
KeyCode aKeyCode (nKey, bShift, nCode.IsMod1(), nCode.IsMod2(), nCode.IsMod3() );
KeyEvent aKEvt(rKEvt.GetCharCode(), aKeyCode);
- sal_Bool bOK = sal_True;
+ bool bOK = true;
if (mpDocSh->IsReadOnly())
{
@@ -1003,17 +978,14 @@ sal_Bool FuText::KeyInput(const KeyEvent& rKEvt)
}
if( aKeyCode.GetCode() == KEY_PAGEUP || aKeyCode.GetCode() == KEY_PAGEDOWN )
{
- bOK = sal_False; // default handling in base class
+ bOK = false; // default handling in base class
}
if (bOK && mpView->KeyInput(aKEvt, mpWindow) )
{
- bReturn = sal_True;
+ bReturn = true;
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
-
-// if ( pTextObj )
-// pTextObj->SetEmptyPresObj(sal_False);
}
else if (aKeyCode == KEY_ESCAPE)
{
@@ -1022,8 +994,8 @@ sal_Bool FuText::KeyInput(const KeyEvent& rKEvt)
if( bPermanent )
{
- mpView->SetCurrentObj(OBJ_TEXT);
- mpView->SetEditMode(SDREDITMODE_CREATE);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+ mpView->SetViewEditMode(SDREDITMODE_CREATE);
}
if (!bReturn)
@@ -1058,7 +1030,7 @@ void FuText::Activate()
FuConstruct::Activate();
if( pOLV )
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
}
@@ -1087,19 +1059,19 @@ void FuText::Deactivate()
|*
\************************************************************************/
-void FuText::SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag)
+void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag)
{
SdrPageView* pPV = mpView->GetSdrPageView();
- if( mxTextObj.is() && (mxTextObj->GetPage() == pPV->GetPage()) )
+ if( pPV && mxTextObj.is() && (mxTextObj->getSdrPageFromSdrObject() == &pPV->getSdrPageFromSdrPageView()) )
{
- mpView->SetCurrentObj(OBJ_TEXT);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
if( bPermanent )
- mpView->SetEditMode(SDREDITMODE_CREATE);
+ mpView->SetViewEditMode(SDREDITMODE_CREATE);
else
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
- sal_Bool bEmptyOutliner = sal_False;
+ bool bEmptyOutliner = false;
if (!GetTextObj()->GetOutlinerParaObject() && mpView->GetTextEditOutliner())
{
@@ -1112,7 +1084,7 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag)
// Bei nur einem Pararaph
if (pOutl->GetText(p1stPara).Len() == 0)
{
- bEmptyOutliner = sal_True;
+ bEmptyOutliner = true;
}
}
}
@@ -1137,27 +1109,59 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag)
if( pTextObj )
{
OutlinerParaObject* pOPO = pTextObj->GetOutlinerParaObject();
+ const basegfx::B2DPoint aLogicPos(mpWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+
if( ( pOPO && pOPO->IsVertical() ) || (nSlotId == SID_ATTR_CHAR_VERTICAL) || (nSlotId == SID_TEXT_FITTOSIZE_VERTICAL) )
- pOutl->SetVertical( sal_True );
+ pOutl->SetVertical( true );
if( pTextObj->getTextCount() > 1 )
{
- Point aPix(rMEvt.GetPosPixel());
- Point aPnt(mpWindow->PixelToLogic(aPix));
- pTextObj->setActiveText( pTextObj->CheckTextHit(aPnt ) );
+ pTextObj->setActiveText( pTextObj->CheckTextHit(aLogicPos) );
}
- if (mpView->SdrBeginTextEdit(pTextObj, pPV, mpWindow, sal_True, pOutl) && mxTextObj->GetObjInventor() == SdrInventor)
+ if (mpView->SdrBeginTextEdit(pTextObj, mpWindow, sal_True, pOutl) && mxTextObj->GetObjInventor() == SdrInventor)
{
- bFirstObjCreated = sal_True;
- DeleteDefaultText();
-
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+ OSL_ENSURE(pOLV, "TextEdit start, but no OLV");
+ bFirstObjCreated = true;
+ DeleteDefaultText();
nSdrObjKind = mxTextObj->GetObjIdentifier();
-
SdrViewEvent aVEvt;
- SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ Point aHitMousePosition(rMEvt.GetPosPixel());
+
+ if(pTextObj->isRotatedOrSheared() || pTextObj->isMirrored())
+ {
+ // need to adapt HitMousePosition. Activated TextEdit is centered at
+ // fully transformed text, but without shear, rotate and mirror, see
+ // getScaledCenteredTextRange() and it's usages. Without that adaption
+ // the MouseButtonDown would not set the text cursor to the correct
+ // position.
+ basegfx::B2DHomMatrix aTransform(pTextObj->getSdrObjectTransformation());
+
+ // Candidate is aLogicPos, MousePos in logic coordinates. Transform
+ // to unified object coordinates
+ aTransform.invert();
+
+ // move to object center
+ aTransform.translate(-0.5, -0.5);
+
+ // scale by absolute object size, leave out mirroring
+ aTransform.scale(basegfx::absolute(pTextObj->getSdrObjectScale()));
+
+ // translate new center to curent object center
+ aTransform.translate(pTextObj->getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5));
+
+ // go back to discrete (pixel) coordinates
+ aTransform *= mpWindow->GetViewTransformation();
+
+ // apply and use
+ const basegfx::B2DPoint aCorrected(aTransform * aLogicPos);
+ aHitMousePosition = Point(basegfx::fround(aCorrected.getX()), basegfx::fround(aCorrected.getY()));
+ }
+
+ const MouseEvent aAdaptedEvent(aHitMousePosition, rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier());
+ const SdrHitKind eHit(mpView->PickAnything(aAdaptedEvent, SDRMOUSEBUTTONDOWN, aVEvt));
if (eHit == SDRHIT_TEXTEDIT)
{
@@ -1169,14 +1173,14 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag)
nSlotId == SID_TEXTEDIT ||
!bQuickDrag)
{
- pOLV->MouseButtonDown(rMEvt);
- pOLV->MouseMove(rMEvt);
- pOLV->MouseButtonUp(rMEvt);
+ pOLV->MouseButtonDown(aAdaptedEvent);
+ pOLV->MouseMove(aAdaptedEvent);
+ pOLV->MouseButtonUp(aAdaptedEvent);
}
if (mpViewShell->GetFrameView()->IsQuickEdit() && bQuickDrag && GetTextObj()->GetOutlinerParaObject())
{
- pOLV->MouseButtonDown(rMEvt);
+ pOLV->MouseButtonDown(aAdaptedEvent);
}
}
else
@@ -1206,14 +1210,14 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag)
|*
\************************************************************************/
-sal_Bool FuText::DeleteDefaultText()
+bool FuText::DeleteDefaultText()
{
- sal_Bool bDeleted = sal_False;
+ bool bDeleted = false;
if ( mxTextObj.is() && mxTextObj->IsEmptyPresObj() )
{
String aString;
- SdPage* pPage = (SdPage*) mxTextObj->GetPage();
+ SdPage* pPage = (SdPage*) mxTextObj->getSdrPageFromSdrObject();
if (pPage)
{
@@ -1227,21 +1231,21 @@ sal_Bool FuText::DeleteDefaultText()
{
::Outliner* pOutliner = mpView->GetTextEditOutliner();
SfxStyleSheet* pSheet = pOutliner->GetStyleSheet( 0 );
- sal_Bool bIsUndoEnabled = pOutliner->IsUndoEnabled();
+ bool bIsUndoEnabled = pOutliner->IsUndoEnabled();
if( bIsUndoEnabled )
- pOutliner->EnableUndo(sal_False);
+ pOutliner->EnableUndo(false);
pOutliner->SetText( String(), pOutliner->GetParagraph( 0 ) );
if( bIsUndoEnabled )
- pOutliner->EnableUndo(sal_True);
+ pOutliner->EnableUndo(true);
if (pSheet &&
(ePresObjKind == PRESOBJ_NOTES || ePresObjKind == PRESOBJ_TEXT))
pOutliner->SetStyleSheet(0, pSheet);
- mxTextObj->SetEmptyPresObj(sal_True);
- bDeleted = sal_True;
+ mxTextObj->SetEmptyPresObj(true);
+ bDeleted = true;
}
}
}
@@ -1255,7 +1259,7 @@ sal_Bool FuText::DeleteDefaultText()
|*
\************************************************************************/
-sal_Bool FuText::Command(const CommandEvent& rCEvt)
+bool FuText::Command(const CommandEvent& rCEvt)
{
return( FuPoor::Command(rCEvt) );
}
@@ -1266,9 +1270,9 @@ sal_Bool FuText::Command(const CommandEvent& rCEvt)
|*
\************************************************************************/
-sal_Bool FuText::RequestHelp(const HelpEvent& rHEvt)
+bool FuText::RequestHelp(const HelpEvent& rHEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
@@ -1278,17 +1282,18 @@ sal_Bool FuText::RequestHelp(const HelpEvent& rHEvt)
String aHelpText;
const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
const SvxFieldData* pField = pFieldItem->GetField();
+ const SvxURLField* pSvxURLField = dynamic_cast< const SvxURLField* >(pField);
- if (pField && pField->ISA(SvxURLField))
+ if (pSvxURLField)
{
/******************************************************************
* URL-Field
******************************************************************/
- aHelpText = INetURLObject::decode( ((const SvxURLField*)pField)->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
+ aHelpText = INetURLObject::decode( pSvxURLField->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET );
}
if (aHelpText.Len())
{
- Rectangle aLogicPix = mpWindow->LogicToPixel(mxTextObj->GetLogicRect());
+ Rectangle aLogicPix = mpWindow->LogicToPixel(sdr::legacy::GetLogicRect(*mxTextObj.get()));
Rectangle aScreenRect(mpWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
mpWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
@@ -1339,33 +1344,29 @@ void FuText::ReceiveRequest(SfxRequest& rReq)
if (!mxTextObj.is())
{
// Versuchen, ein Obj zu selektieren
- SdrPageView* pPV = mpView->GetSdrPageView();
SdrViewEvent aVEvt;
mpView->PickAnything(aMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- mpView->MarkObj(aVEvt.pRootObj, pPV);
+ mpView->MarkObj(*aVEvt.mpRootObj);
+
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(aVEvt.mpObj);
- if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj))
+ if (pSdrTextObj)
{
- mxTextObj.reset( static_cast< SdrTextObj* >( aVEvt.pObj ) );
+ mxTextObj.reset( pSdrTextObj );
}
}
}
- else if (mpView->AreObjectsMarked())
+ else
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ SdrTextObj* pObj = dynamic_cast< SdrTextObj* >(mpView->getSelectedIfSingle());
- if (rMarkList.GetMarkCount() == 1)
+ if (pObj)
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- if (pObj->ISA(SdrTextObj))
- {
- mxTextObj.reset( static_cast< SdrTextObj* >( pObj ) );
- }
+ mxTextObj.reset( pObj );
}
}
- sal_Bool bQuickDrag = sal_True;
+ bool bQuickDrag = true;
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -1378,7 +1379,7 @@ void FuText::ReceiveRequest(SfxRequest& rReq)
&& (sal_uInt16) ((SfxUInt16Item&) pArgs->Get(SID_TEXTEDIT)).GetValue() == 2)
{
// Anwahl per Doppelklick -> kein QuickDrag zulassen
- bQuickDrag = sal_False;
+ bQuickDrag = false;
}
SetInEditMode(aMEvt, bQuickDrag);
@@ -1416,7 +1417,7 @@ void FuText::DoubleClick(const MouseEvent& )
#105815# Removed the insertion of default text and putting a new text
object directly into edit mode.
*/
-SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
+SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange)
{
// case SID_TEXTEDIT: // BASIC ???
// case SID_ATTR_CHAR:
@@ -1424,47 +1425,43 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR
// case SID_TEXT_FITTOSIZE:
// case SID_TEXT_FITTOSIZE_VERTICAL:
- SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- 0L, mpDoc);
+ SdrTextObj* pObj = dynamic_cast< SdrTextObj* >(
+ SdrObjFactory::MakeNewObject(
+ mpView->getSdrModelFromSdrView(),
+ mpView->getSdrObjectCreationInfo()));
if(pObj)
{
- if(pObj->ISA(SdrTextObj))
- {
- SdrTextObj* pText = (SdrTextObj*)pObj;
- pText->SetLogicRect(rRectangle);
+ sdr::legacy::SetLogicRange(*pObj, rRange);
sal_Bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID);
- pText->SetVerticalWriting(bVertical);
+ pObj->SetVerticalWriting(bVertical);
// #97016#
- ImpSetAttributesForNewTextObject(pText);
-
- if (nSlotId == SID_TEXT_FITTOSIZE)
- {
- // #97016#
- ImpSetAttributesFitToSize(pText);
- }
- else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
- {
- // #97016#
- ImpSetAttributesFitToSizeVertical(pText);
- }
- else
- {
- // #97016#
- ImpSetAttributesFitCommon(pText);
- }
+ ImpSetAttributesForNewTextObject(pObj);
- // Put text object into edit mode.
- SdrPageView* pPV = mpView->GetSdrPageView();
- mpView->SdrBeginTextEdit(pText, pPV);
+ if (nSlotId == SID_TEXT_FITTOSIZE)
+ {
+ // #97016#
+ ImpSetAttributesFitToSize(pObj);
+ }
+ else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
+ {
+ // #97016#
+ ImpSetAttributesFitToSizeVertical(pObj);
}
else
{
- DBG_ERROR("Object is NO text object");
+ // #97016#
+ ImpSetAttributesFitCommon(pObj);
}
+
+ // Put text object into edit mode.
+ mpView->SdrBeginTextEdit(pObj);
+ }
+ else
+ {
+ DBG_ERROR("Object is NO text object");
}
return pObj;
@@ -1486,8 +1483,8 @@ bool FuText::cancel()
if(mpView->SdrEndTextEdit() == SDRENDTEXTEDIT_DELETED)
mxTextObj.reset(0);
- mpView->SetCurrentObj(OBJ_TEXT);
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TEXT)));
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
return true;
}
else
@@ -1507,12 +1504,12 @@ void FuText::ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFo
}
else
{
-// SdDrawDocument* pDoc = pView->GetDoc();
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- for( sal_uInt32 nMark = 0; nMark < rMarkList.GetMarkCount(); nMark++ )
+ for( sal_uInt32 nMark(0); nMark < aSelection.size(); nMark++ )
{
- SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( rMarkList.GetMark(nMark)->GetMarkedSdrObj() );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( aSelection[nMark] );
+
if( pTextObj )
{
for( sal_Int32 nText = 0; nText < pTextObj->getTextCount(); nText++ )
@@ -1520,8 +1517,7 @@ void FuText::ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFo
pTextObj->setActiveText( nText );
// Put text object into edit mode.
- SdrPageView* pPV = pView->GetSdrPageView();
- pView->SdrBeginTextEdit(pTextObj, pPV);
+ pView->SdrBeginTextEdit(pTextObj);
pOLV = pView->GetTextEditOutlinerView();
if( pOLV )
diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx
index 52f244f62b75..4abeaf4b4076 100644
--- a/sd/source/ui/func/futhes.cxx
+++ b/sd/source/ui/func/futhes.cxx
@@ -62,8 +62,6 @@ class SfxRequest;
namespace sd {
-TYPEINIT1( FuThesaurus, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -88,26 +86,9 @@ void FuThesaurus::DoExecute( SfxRequest& )
SfxErrorContext aContext(ERRCTX_SVX_LINGU_THESAURUS, String(),
mpWindow, RID_SVXERRCTX, &DIALOG_MGR() );
- if( mpViewShell && mpViewShell->ISA(DrawViewShell) )
- {
- SdrTextObj* pTextObj = NULL;
-
- if ( mpView->AreObjectsMarked() )
+ if( mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell) )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
- if ( rMarkList.GetMarkCount() == 1 )
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- if ( pObj->ISA(SdrTextObj) )
- {
- pTextObj = (SdrTextObj*) pObj;
- }
- }
- }
-
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(mpView->getSelectedIfSingle());
::Outliner* pOutliner = mpView->GetTextEditOutliner();
const OutlinerView* pOutlView = mpView->GetTextEditOutlinerView();
@@ -135,7 +116,7 @@ void FuThesaurus::DoExecute( SfxRequest& )
}
}
}
- else if ( mpViewShell->ISA(OutlineViewShell) )
+ else if ( dynamic_cast< OutlineViewShell* >(mpViewShell) )
{
Outliner* pOutliner = mpDoc->GetOutliner();
OutlinerView* pOutlView = pOutliner->GetView(0);
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index 43b65e5ee56b..fda83c730f77 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -28,7 +28,6 @@
#include "futransf.hxx"
#include <svx/dialogs.hrc>
-#include <svx/polysc3d.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/request.hxx>
@@ -39,11 +38,10 @@
#include "drawdoc.hxx"
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
+#include <svx/svdocapt.hxx>
namespace sd {
-TYPEINIT1( FuTransform, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -65,7 +63,7 @@ FunctionReference FuTransform::Create( ViewShell* pViewSh, ::sd::Window* pWin, :
void FuTransform::DoExecute( SfxRequest& rReq )
{
- if( mpView->AreObjectsMarked() )
+ if( mpView->areSdrObjectsSelected() )
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -73,15 +71,12 @@ void FuTransform::DoExecute( SfxRequest& rReq )
{
// --------- itemset for size and position --------
SfxItemSet aSet( mpView->GetGeoAttrFromMarked() );
+ SdrCaptionObj* pSelected = dynamic_cast< SdrCaptionObj* >(mpView->getSelectedIfSingle());
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if( rMarkList.GetMarkCount() == 1 &&
- pObj->GetObjInventor() == SdrInventor &&
- pObj->GetObjIdentifier() == OBJ_CAPTION )
+ if( pSelected )
{
// --------- itemset for caption --------
- SfxItemSet aNewAttr( mpDoc->GetPool() );
+ SfxItemSet aNewAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aNewAttr );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -120,7 +115,8 @@ void FuTransform::DoExecute( SfxRequest& rReq )
if( pArgs )
{
// Undo
- String aString( mpView->GetDescriptionOfMarkedObjects() );
+ const SdrObjectVector aSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
+ String aString( getSelectionDescription(aSelection) );
aString.Append( sal_Unicode(' ') );
aString.Append( String( SdResId( STR_TRANSFORM ) ) );
mpView->BegUndo( aString );
diff --git a/sd/source/ui/func/futxtatt.cxx b/sd/source/ui/func/futxtatt.cxx
index 602ee63e8e41..ff994af4f67a 100644
--- a/sd/source/ui/func/futxtatt.cxx
+++ b/sd/source/ui/func/futxtatt.cxx
@@ -37,8 +37,6 @@
namespace sd {
-TYPEINIT1( FuTextAttrDlg, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -64,7 +62,7 @@ FunctionReference FuTextAttrDlg::Create( ViewShell* pViewSh, ::sd::Window* pWin,
void FuTextAttrDlg::DoExecute( SfxRequest& rReq )
{
- SfxItemSet aNewAttr( mpDoc->GetPool() );
+ SfxItemSet aNewAttr( mpDoc->GetItemPool() );
mpView->GetAttributes( aNewAttr );
const SfxItemSet* pArgs = rReq.GetArgs();
diff --git a/sd/source/ui/func/fuvect.cxx b/sd/source/ui/func/fuvect.cxx
index e2a106f1295e..739fe82cdff3 100644
--- a/sd/source/ui/func/fuvect.cxx
+++ b/sd/source/ui/func/fuvect.cxx
@@ -49,8 +49,6 @@
namespace sd
{
-TYPEINIT1( FuVectorize, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -76,36 +74,31 @@ FunctionReference FuVectorize::Create( ViewShell* pViewSh, ::sd::Window* pWin, :
void FuVectorize::DoExecute( SfxRequest& )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >(mpView->getSelectedIfSingle());
- if( rMarkList.GetMarkCount() == 1 )
+ if( pObj )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-
- if( pObj && pObj->ISA( SdrGrafObj ) )
+ SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
+ AbstractSdVectorizeDlg* pDlg = pFact ? pFact->CreateSdVectorizeDlg( mpWindow, pObj->GetGraphic().GetBitmap(), mpDocSh ) : 0;
+ if( pDlg && pDlg->Execute() == RET_OK )
{
- SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- AbstractSdVectorizeDlg* pDlg = pFact ? pFact->CreateSdVectorizeDlg( mpWindow, ( (SdrGrafObj*) pObj )->GetGraphic().GetBitmap(), mpDocSh ) : 0;
- if( pDlg && pDlg->Execute() == RET_OK )
- {
- const GDIMetaFile& rMtf = pDlg->GetGDIMetaFile();
- SdrPageView* pPageView = mpView->GetSdrPageView();
+ const GDIMetaFile& rMtf = pDlg->GetGDIMetaFile();
- if( pPageView && rMtf.GetActionCount() )
- {
- SdrGrafObj* pVectObj = (SdrGrafObj*) pObj->Clone();
- String aStr( mpView->GetDescriptionOfMarkedObjects() );
+ if( rMtf.GetActionCount() )
+ {
+ SdrGrafObj* pVectObj = static_cast< SdrGrafObj* >(pObj->CloneSdrObject());
+ String aStr;
+ pObj->TakeObjNameSingul(aStr);
aStr.Append( sal_Unicode(' ') );
aStr.Append( String( SdResId( STR_UNDO_VECTORIZE ) ) );
mpView->BegUndo( aStr );
pVectObj->SetGraphic( rMtf );
- mpView->ReplaceObjectAtView( pObj, *pPageView, pVectObj );
+ mpView->ReplaceObjectAtView( *pObj, *pVectObj );
mpView->EndUndo();
- }
}
- delete pDlg;
}
+ delete pDlg;
}
}
diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx
index da8fb0812036..081c4c00ba8e 100644
--- a/sd/source/ui/func/fuzoom.cxx
+++ b/sd/source/ui/func/fuzoom.cxx
@@ -52,8 +52,6 @@ sal_uInt16 SidArrayZoom[] = {
SID_ZOOM_IN,
0 };
-TYPEINIT1( FuZoom, FuPoor );
-
/*************************************************************************
|*
|* Konstruktor
@@ -67,8 +65,13 @@ FuZoom::FuZoom(
SdDrawDocument* pDoc,
SfxRequest& rReq)
: FuPoor(pViewSh, pWin, pView, pDoc, rReq),
- bVisible(sal_False),
- bStartDrag(sal_False)
+ maBeginPosPixel(),
+ maBeginPos(),
+ maEndPos(),
+ maZoomRange(),
+ maPtr(),
+ mbVisible(false),
+ mbStartDrag(false)
{
}
@@ -80,13 +83,13 @@ FuZoom::FuZoom(
FuZoom::~FuZoom()
{
- if (bVisible)
+ if (mbVisible)
{
// Hide ZoomRect
- mpViewShell->DrawMarkRect(aZoomRect);
+ mpViewShell->DrawMarkRange(maZoomRange);
- bVisible = sal_False;
- bStartDrag = sal_False;
+ mbVisible = false;
+ mbStartDrag = false;
}
}
@@ -102,18 +105,18 @@ FunctionReference FuZoom::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::
|*
\************************************************************************/
-sal_Bool FuZoom::MouseButtonDown(const MouseEvent& rMEvt)
+bool FuZoom::MouseButtonDown(const MouseEvent& rMEvt)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
mpWindow->CaptureMouse();
- bStartDrag = sal_True;
+ mbStartDrag = true;
- aBeginPosPix = rMEvt.GetPosPixel();
- aBeginPos = mpWindow->PixelToLogic(aBeginPosPix);
+ maBeginPosPixel = basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ maBeginPos = mpWindow->GetInverseViewTransformation() * maBeginPosPixel;
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -122,53 +125,50 @@ sal_Bool FuZoom::MouseButtonDown(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuZoom::MouseMove(const MouseEvent& rMEvt)
+bool FuZoom::MouseMove(const MouseEvent& rMEvt)
{
- if (bStartDrag)
+ if (mbStartDrag)
{
- if (bVisible)
+ if (mbVisible)
{
- mpViewShell->DrawMarkRect(aZoomRect);
+ mpViewShell->DrawMarkRange(maZoomRange);
}
- Point aPosPix = rMEvt.GetPosPixel();
- ForceScroll(aPosPix);
+ const basegfx::B2DPoint aPosPix(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
- aEndPos = mpWindow->PixelToLogic(aPosPix);
- aBeginPos = mpWindow->PixelToLogic(aBeginPosPix);
+ ForceScroll(aPosPix);
+ maEndPos = mpWindow->GetInverseViewTransformation() * aPosPix;
+ maBeginPos = mpWindow->GetInverseViewTransformation() * maBeginPosPixel;
if (nSlotId == SID_ZOOM_PANNING)
{
// Panning
+ basegfx::B2DVector aScroll(maBeginPos - maEndPos);
- Point aScroll = aBeginPos - aEndPos;
-
- // #i2237#
- // removed old stuff here which still forced zoom to be
- // %BRUSH_SIZE which is outdated now
-
- if (aScroll.X() != 0 || aScroll.Y() != 0)
+ if(!aScroll.equalZero() && mpView->GetSdrPageView())
{
- Size aWorkSize = mpView->GetWorkArea().GetSize();
- Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize();
- aScroll.X() /= aWorkSize.Width() / aPageSize.Width();
- aScroll.Y() /= aWorkSize.Height() / aPageSize.Height();
- mpViewShell->Scroll(aScroll.X(), aScroll.Y());
- aBeginPosPix = aPosPix;
+ const basegfx::B2DVector aWorkRange(mpView->GetWorkArea().getRange());
+ const SdrPage& rPage = mpView->GetSdrPageView()->getSdrPageFromSdrPageView();
+ const basegfx::B2DVector aPageRange(rPage.GetPageScale());
+ const basegfx::B2DVector aFactor(
+ aPageRange.getX() / (basegfx::fTools::equalZero(aWorkRange.getX()) ? 1.0 : aWorkRange.getX()),
+ aPageRange.getY() / (basegfx::fTools::equalZero(aWorkRange.getY()) ? 1.0 : aWorkRange.getY()));
+
+ aScroll *= aFactor;
+ mpViewShell->Scroll(basegfx::fround(aScroll.getX()), basegfx::fround(aScroll.getY()));
+ maBeginPosPixel = aPosPix;
}
}
else
{
- Rectangle aRect(aBeginPos, aEndPos);
- aZoomRect = aRect;
- aZoomRect.Justify();
- mpViewShell->DrawMarkRect(aZoomRect);
+ maZoomRange = basegfx::B2DRange(maBeginPos, maEndPos);
+ mpViewShell->DrawMarkRange(maZoomRange);
}
- bVisible = sal_True;
+ mbVisible = true;
}
- return bStartDrag;
+ return mbStartDrag;
}
/*************************************************************************
@@ -177,51 +177,45 @@ sal_Bool FuZoom::MouseMove(const MouseEvent& rMEvt)
|*
\************************************************************************/
-sal_Bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt)
+bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode(rMEvt.GetButtons());
- if (bVisible)
+ if (mbVisible)
{
// Hide ZoomRect
- mpViewShell->DrawMarkRect(aZoomRect);
- bVisible = sal_False;
+ mpViewShell->DrawMarkRange(maZoomRange);
+ mbVisible = false;
}
- Point aPosPix = rMEvt.GetPosPixel();
+ const basegfx::B2DPoint aPosPix(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
if(SID_ZOOM_PANNING != nSlotId)
{
// Zoom
- Size aZoomSizePixel = mpWindow->LogicToPixel(aZoomRect).GetSize();
- sal_uLong nTol = DRGPIX + DRGPIX;
+ const basegfx::B2DVector aZoomSizePixel(mpWindow->GetInverseViewTransformation() * maZoomRange.getRange());
+ const double fTol(DRGPIX + DRGPIX);
- if ( aZoomSizePixel.Width() < (long) nTol && aZoomSizePixel.Height() < (long) nTol )
+ if ( aZoomSizePixel.getX() < fTol && aZoomSizePixel.getY() < fTol )
{
// Klick auf der Stelle: Zoomfaktor verdoppeln
- Point aPos = mpWindow->PixelToLogic(aPosPix);
- Size aSize = mpWindow->PixelToLogic(mpWindow->GetOutputSizePixel());
- aSize.Width() /= 2;
- aSize.Height() /= 2;
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- aZoomRect.SetPos(aPos);
- aZoomRect.SetSize(aSize);
+ const basegfx::B2DPoint aPos(mpWindow->GetInverseViewTransformation() * aPosPix);
+ const basegfx::B2DVector aScale(mpWindow->GetLogicVector() * 0.25);
+
+ maZoomRange = basegfx::B2DRange(aPos - aScale, aScale * 2.0);
}
- mpViewShell->SetZoomRect(aZoomRect);
+ mpViewShell->SetZoomRange(maZoomRange);
}
- Rectangle aVisAreaWin = mpWindow->PixelToLogic(Rectangle(Point(0,0),
- mpWindow->GetOutputSizePixel()));
- mpViewShell->GetZoomList()->InsertZoomRect(aVisAreaWin);
+ mpViewShell->GetZoomList()->InsertZoomRange(mpWindow->GetLogicRange());
- bStartDrag = sal_False;
+ mbStartDrag = false;
mpWindow->ReleaseMouse();
mpViewShell->Cancel();
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -232,7 +226,7 @@ sal_Bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt)
void FuZoom::Activate()
{
- aPtr = mpWindow->GetPointer();
+ maPtr = mpWindow->GetPointer();
if (nSlotId == SID_ZOOM_PANNING)
{
@@ -252,7 +246,7 @@ void FuZoom::Activate()
void FuZoom::Deactivate()
{
- mpWindow->SetPointer( aPtr );
+ mpWindow->SetPointer( maPtr );
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArrayZoom );
}
} // end of namespace sd
diff --git a/sd/source/ui/func/makefile.mk b/sd/source/ui/func/makefile.mk
index c1d541ea71b3..ce33f5a60913 100644
--- a/sd/source/ui/func/makefile.mk
+++ b/sd/source/ui/func/makefile.mk
@@ -58,7 +58,6 @@ SLOFILES = \
$(SLO)$/futransf.obj \
$(SLO)$/futext.obj \
$(SLO)$/fuline.obj \
- $(SLO)$/sdundo.obj \
$(SLO)$/sdundogr.obj \
$(SLO)$/fuoaprms.obj \
$(SLO)$/unoaprms.obj \
@@ -127,7 +126,6 @@ LIB1OBJFILES= \
$(SLO)$/futransf.obj \
$(SLO)$/futext.obj \
$(SLO)$/fuline.obj \
- $(SLO)$/sdundo.obj \
$(SLO)$/sdundogr.obj \
$(SLO)$/fuoaprms.obj \
$(SLO)$/unoaprms.obj \
diff --git a/sd/source/ui/func/sdundogr.cxx b/sd/source/ui/func/sdundogr.cxx
index 595fea2765bc..290719f4bcac 100644
--- a/sd/source/ui/func/sdundogr.cxx
+++ b/sd/source/ui/func/sdundogr.cxx
@@ -28,8 +28,6 @@
#include "sdundogr.hxx"
-TYPEINIT1(SdUndoGroup, SdUndoAction);
-
/*************************************************************************
|*
|* Destruktor
@@ -54,16 +52,17 @@ SdUndoGroup::~SdUndoGroup()
sal_Bool SdUndoGroup::Merge( SfxUndoAction* pNextAction )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
+ SdUndoAction* pSdUndoAction = dynamic_cast< SdUndoAction* >(pNextAction);
- if( pNextAction && pNextAction->ISA( SdUndoAction ) )
+ if( pSdUndoAction )
{
- SdUndoAction* pClone = static_cast< SdUndoAction* >( pNextAction )->Clone();
+ SdUndoAction* pClone = pSdUndoAction->Clone();
if( pClone )
{
AddAction( pClone );
- bRet = sal_True;
+ bRet = true;
}
}
diff --git a/sd/source/ui/func/smarttag.cxx b/sd/source/ui/func/smarttag.cxx
index 8ee401ef0c4f..672b32bfd421 100644
--- a/sd/source/ui/func/smarttag.cxx
+++ b/sd/source/ui/func/smarttag.cxx
@@ -117,30 +117,30 @@ bool SmartTag::getContext( SdrViewContext& /*rContext*/ )
// --------------------------------------------------------------------
-sal_uLong SmartTag::GetMarkablePointCount() const
+sal_uInt32 SmartTag::GetMarkablePointCount() const
{
return 0;
}
// --------------------------------------------------------------------
-sal_uLong SmartTag::GetMarkedPointCount() const
+sal_uInt32 SmartTag::GetMarkedPointCount() const
{
return 0;
}
// --------------------------------------------------------------------
-sal_Bool SmartTag::MarkPoint(SdrHdl& /*rHdl*/, sal_Bool /*bUnmark*/ )
+bool SmartTag::MarkPoint(SdrHdl& /*rHdl*/, bool /*bUnmark*/ )
{
- return sal_False;
+ return false;
}
// --------------------------------------------------------------------
-sal_Bool SmartTag::MarkPoints(const Rectangle* /*pRect*/, sal_Bool /*bUnmark*/ )
+bool SmartTag::MarkPoints(const basegfx::B2DRange* /*pRange*/, bool /*bUnmark*/ )
{
- return sal_False;
+ return false;
}
// --------------------------------------------------------------------
@@ -217,10 +217,10 @@ void SmartTagSet::select( const SmartTagReference& xTag )
mxSelectedTag = xTag;
mxSelectedTag->select();
mrView.SetPossibilitiesDirty();
- if( mrView.GetMarkedObjectCount() > 0 )
+ if( mrView.areSdrObjectsSelected() )
mrView.UnmarkAllObj();
else
- mrView.updateHandles();
+ mrView.SetMarkHandles();
}
}
@@ -233,7 +233,7 @@ void SmartTagSet::deselect()
mxSelectedTag->deselect();
mxSelectedTag.clear();
mrView.SetPossibilitiesDirty();
- mrView.updateHandles();
+ mrView.SetMarkHandles();
}
}
@@ -241,7 +241,8 @@ void SmartTagSet::deselect()
bool SmartTagSet::MouseButtonDown( const MouseEvent& rMEvt )
{
- Point aMDPos( mrView.GetViewShell()->GetActiveWindow()->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aMDPos(mrView.GetViewShell()->GetActiveWindow()->GetInverseViewTransformation() * aPixelPos);
SdrHdl* pHdl = mrView.PickHandle(aMDPos);
// check if a smart tag is selected and no handle is hit
@@ -289,7 +290,8 @@ bool SmartTagSet::KeyInput( const KeyEvent& rKEvt )
bool SmartTagSet::RequestHelp( const HelpEvent& rHEvt )
{
- Point aMDPos( mrView.GetViewShell()->GetActiveWindow()->PixelToLogic( rHEvt.GetMousePosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rHEvt.GetMousePosPixel().X(), rHEvt.GetMousePosPixel().Y());
+ const basegfx::B2DPoint aMDPos(mrView.GetViewShell()->GetActiveWindow()->GetInverseViewTransformation() * aPixelPos);
SdrHdl* pHdl = mrView.PickHandle(aMDPos);
if( pHdl )
@@ -313,7 +315,8 @@ bool SmartTagSet::Command( const CommandEvent& rCEvt )
{
if( rCEvt.IsMouseEvent() )
{
- Point aMDPos( mrView.GetViewShell()->GetActiveWindow()->PixelToLogic( rCEvt.GetMousePosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rCEvt.GetMousePosPixel().X(), rCEvt.GetMousePosPixel().Y());
+ const basegfx::B2DPoint aMDPos(mrView.GetViewShell()->GetActiveWindow()->GetInverseViewTransformation() * aPixelPos);
SdrHdl* pHdl = mrView.PickHandle(aMDPos);
if( pHdl )
@@ -364,14 +367,14 @@ bool SmartTagSet::getContext( SdrViewContext& rContext ) const
// support point editing
// --------------------------------------------------------------------
-sal_Bool SmartTagSet::HasMarkablePoints() const
+bool SmartTagSet::HasMarkablePoints() const
{
- return GetMarkablePointCount() != 0 ? sal_True : sal_False;
+ return 0 != GetMarkablePointCount();
}
// --------------------------------------------------------------------
-sal_uLong SmartTagSet::GetMarkablePointCount() const
+sal_uInt32 SmartTagSet::GetMarkablePointCount() const
{
if( mxSelectedTag.is() )
return mxSelectedTag->GetMarkablePointCount();
@@ -380,14 +383,14 @@ sal_uLong SmartTagSet::GetMarkablePointCount() const
// --------------------------------------------------------------------
-sal_Bool SmartTagSet::HasMarkedPoints() const
+bool SmartTagSet::HasMarkedPoints() const
{
- return GetMarkedPointCount() != 0 ? sal_True : sal_False;
+ return 0 != GetMarkedPointCount();
}
// --------------------------------------------------------------------
-sal_uLong SmartTagSet::GetMarkedPointCount() const
+sal_uInt32 SmartTagSet::GetMarkedPointCount() const
{
if( mxSelectedTag.is() )
return mxSelectedTag->GetMarkedPointCount();
@@ -397,7 +400,7 @@ sal_uLong SmartTagSet::GetMarkedPointCount() const
// --------------------------------------------------------------------
-sal_Bool SmartTagSet::IsPointMarkable(const SdrHdl& rHdl) const
+bool SmartTagSet::IsPointMarkable(const SdrHdl& rHdl) const
{
const SmartHdl* pSmartHdl = dynamic_cast< const SmartHdl* >( &rHdl );
@@ -406,21 +409,24 @@ sal_Bool SmartTagSet::IsPointMarkable(const SdrHdl& rHdl) const
// --------------------------------------------------------------------
-sal_Bool SmartTagSet::MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark )
+bool SmartTagSet::MarkPoint(SdrHdl& rHdl, bool bUnmark )
{
if( mxSelectedTag.is() )
return mxSelectedTag->MarkPoint( rHdl, bUnmark );
- return sal_False;
+ return false;
}
// --------------------------------------------------------------------
-sal_Bool SmartTagSet::MarkPoints(const Rectangle* pRect, sal_Bool bUnmark)
+bool SmartTagSet::MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark)
{
if( mxSelectedTag.is() )
- return mxSelectedTag->MarkPoints( pRect, bUnmark );
- return sal_False;
+ {
+ return mxSelectedTag->MarkPoints( pRange, bUnmark );
+ }
+
+ return false;
}
// --------------------------------------------------------------------
@@ -433,19 +439,35 @@ void SmartTagSet::CheckPossibilities()
// ====================================================================
-SmartHdl::SmartHdl( const SmartTagReference& xTag, SdrObject* pObject, const Point& rPnt, SdrHdlKind eNewKind /*=HDL_MOVE*/ )
-: SdrHdl( rPnt, eNewKind )
+SmartHdl::SmartHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject,
+ const SmartTagReference& xTag,
+ SdrHdlKind eNewKind,
+ const basegfx::B2DPoint& rPnt)
+: SdrHdl( rHdlList, pSdrHdlObject, eNewKind, rPnt )
, mxTag( xTag )
{
- SetObj( pObject );
}
-// --------------------------------------------------------------------
-
-SmartHdl::SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind eNewKind /*=HDL_MOVE*/ )
-: SdrHdl( rPnt, eNewKind )
+SmartHdl::SmartHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject,
+ const SmartTagReference& xTag,
+ sal_uInt32 nObjHandleNum,
+ SdrHdl& rSource)
+: SdrHdl( rHdlList, pSdrHdlObject, rSource.GetKind(), rSource.getPosition())
, mxTag( xTag )
{
+ mnObjHdlNum = nObjHandleNum;
+ mnPolyNum = rSource.GetPolyNum();
+ mnPPntNum = rSource.GetPointNum();
+ mbPlusHdl = rSource.IsPlusHdl();
+ mnSourceHdlNum = rSource.GetSourceHdlNum();
+}
+
+SmartHdl::~SmartHdl()
+{
}
// --------------------------------------------------------------------
diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index 2f478265bafc..2c279f1be4c5 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -34,10 +34,6 @@
// - BackgroundObjUndoAction -
// ---------------------------
-TYPEINIT1( SdBackgroundObjUndoAction, SdUndoAction );
-
-// -----------------------------------------------------------------------------
-
SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
SdDrawDocument& rDoc,
SdPage& rPage,
diff --git a/sd/source/ui/func/undoheaderfooter.cxx b/sd/source/ui/func/undoheaderfooter.cxx
index 1833cce760b8..fdce6399d6b1 100644
--- a/sd/source/ui/func/undoheaderfooter.cxx
+++ b/sd/source/ui/func/undoheaderfooter.cxx
@@ -33,8 +33,6 @@
#include "drawview.hxx"
#include "undoheaderfooter.hxx"
-TYPEINIT1(SdHeaderFooterUndoAction, SdUndoAction);
-
SdHeaderFooterUndoAction::SdHeaderFooterUndoAction( SdDrawDocument* pDoc, SdPage* pPage, const sd::HeaderFooterSettings& rNewSettings )
: SdUndoAction(pDoc),
mpPage(pPage),
diff --git a/sd/source/ui/func/undolayer.cxx b/sd/source/ui/func/undolayer.cxx
index 4658f9e0b5b8..8b808f73013a 100644
--- a/sd/source/ui/func/undolayer.cxx
+++ b/sd/source/ui/func/undolayer.cxx
@@ -32,8 +32,6 @@
#include "strings.hrc"
#include "sdresid.hxx"
-TYPEINIT1(SdLayerModifyUndoAction, SdUndoAction);
-
SdLayerModifyUndoAction::SdLayerModifyUndoAction(
SdDrawDocument* _pDoc, SdrLayer* pLayer,
const String& rOldLayerName, const String& rOldLayerTitle, const String& rOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable,
@@ -62,8 +60,7 @@ void SdLayerModifyUndoAction::Undo()
::sd::DrawDocShell* mpDocSh = mpDoc->GetDocSh();
if( mpDocSh )
{
- ::sd::DrawViewShell* pDrViewSh =
- PTR_CAST(::sd::DrawViewShell, mpDocSh->GetViewShell() );
+ ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >(mpDocSh->GetViewShell() );
if( pDrViewSh )
{
pDrViewSh->ModifyLayer( mpLayer, maOldLayerName, maOldLayerTitle, maOldLayerDesc, mbOldIsVisible, mbOldIsLocked, mbOldIsPrintable );
@@ -76,8 +73,7 @@ void SdLayerModifyUndoAction::Redo()
::sd::DrawDocShell* mpDocSh = mpDoc->GetDocSh();
if( mpDocSh )
{
- ::sd::DrawViewShell* pDrViewSh =
- PTR_CAST(::sd::DrawViewShell, mpDocSh->GetViewShell() );
+ ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >(mpDocSh->GetViewShell() );
if( pDrViewSh )
{
pDrViewSh->ModifyLayer( mpLayer, maNewLayerName, maNewLayerTitle, maNewLayerDesc, mbNewIsVisible, mbNewIsLocked, mbNewIsPrintable );
diff --git a/sd/source/ui/func/undopage.cxx b/sd/source/ui/func/undopage.cxx
index b135efc0d6f5..8285d2646819 100644
--- a/sd/source/ui/func/undopage.cxx
+++ b/sd/source/ui/func/undopage.cxx
@@ -39,11 +39,6 @@
-TYPEINIT1(SdPageFormatUndoAction, SdUndoAction);
-TYPEINIT1(SdPageLRUndoAction, SdUndoAction);
-TYPEINIT1(SdPageULUndoAction, SdUndoAction);
-
-
/*************************************************************************
|*
|* Destruktor
@@ -62,13 +57,12 @@ SdPageFormatUndoAction::~SdPageFormatUndoAction()
void SdPageFormatUndoAction::Undo()
{
- Rectangle aOldBorderRect(mnOldLeft, mnOldUpper, mnOldRight, mnOldLower);
- mpPage->ScaleObjects(maOldSize, aOldBorderRect, mbNewScale);
- mpPage->SetSize(maOldSize);
- mpPage->SetLftBorder(mnOldLeft);
- mpPage->SetRgtBorder(mnOldRight);
- mpPage->SetUppBorder(mnOldUpper);
- mpPage->SetLwrBorder(mnOldLower);
+ mpPage->ScaleObjects(maOldSize, mfOldLeft, mfOldTop, mfOldRight, mfOldBottom, mbNewScale);
+ mpPage->SetPageScale(maOldSize);
+ mpPage->SetLeftPageBorder(mfOldLeft);
+ mpPage->SetRightPageBorder(mfOldRight);
+ mpPage->SetTopPageBorder(mfOldTop);
+ mpPage->SetBottomPageBorder(mfOldBottom);
mpPage->SetOrientation(meOldOrientation);
mpPage->SetPaperBin( mnOldPaperBin );
@@ -80,13 +74,12 @@ void SdPageFormatUndoAction::Undo()
void SdPageFormatUndoAction::Redo()
{
- Rectangle aNewBorderRect(mnNewLeft, mnNewUpper, mnNewRight, mnNewLower);
- mpPage->ScaleObjects(maNewSize, aNewBorderRect, mbNewScale);
- mpPage->SetSize(maNewSize);
- mpPage->SetLftBorder(mnNewLeft);
- mpPage->SetRgtBorder(mnNewRight);
- mpPage->SetUppBorder(mnNewUpper);
- mpPage->SetLwrBorder(mnNewLower);
+ mpPage->ScaleObjects(maNewSize, mfNewLeft, mfNewTop, mfNewRight, mfNewBottom, mbNewScale);
+ mpPage->SetPageScale(maNewSize);
+ mpPage->SetLeftPageBorder(mfNewLeft);
+ mpPage->SetRightPageBorder(mfNewRight);
+ mpPage->SetTopPageBorder(mfNewTop);
+ mpPage->SetBottomPageBorder(mfNewBottom);
mpPage->SetOrientation(meNewOrientation);
mpPage->SetPaperBin( mnNewPaperBin );
@@ -96,41 +89,47 @@ void SdPageFormatUndoAction::Redo()
}
+/*************************************************************************
+|*
+|* LR-Redo()
+|*
+\************************************************************************/
+
SdPageLRUndoAction::~SdPageLRUndoAction()
{
}
void SdPageLRUndoAction::Undo()
{
- mpPage->SetLftBorder(mnOldLeft);
- mpPage->SetRgtBorder(mnOldRight);
+ mpPage->SetLeftPageBorder(mfOldLeft);
+ mpPage->SetRightPageBorder(mfOldRight);
}
void SdPageLRUndoAction::Redo()
{
- mpPage->SetLftBorder(mnNewLeft);
- mpPage->SetRgtBorder(mnNewRight);
+ mpPage->SetLeftPageBorder(mfNewLeft);
+ mpPage->SetRightPageBorder(mfNewRight);
}
+/*************************************************************************
+|*
+|* UL-Redo()
+|*
+\************************************************************************/
+
SdPageULUndoAction::~SdPageULUndoAction()
{
}
void SdPageULUndoAction::Undo()
{
- mpPage->SetUppBorder(mnOldUpper);
- mpPage->SetLwrBorder(mnOldLower);
+ mpPage->SetTopPageBorder(mfOldTop);
+ mpPage->SetBottomPageBorder(mfOldBottom);
}
-/*************************************************************************
-|*
-|* UL-Redo()
-|*
-\************************************************************************/
-
void SdPageULUndoAction::Redo()
{
- mpPage->SetUppBorder(mnNewUpper);
- mpPage->SetLwrBorder(mnNewLower);
+ mpPage->SetTopPageBorder(mfNewTop);
+ mpPage->SetBottomPageBorder(mfNewBottom);
}
diff --git a/sd/source/ui/func/unoaprms.cxx b/sd/source/ui/func/unoaprms.cxx
index ad035cc01c7e..40339d507029 100644
--- a/sd/source/ui/func/unoaprms.cxx
+++ b/sd/source/ui/func/unoaprms.cxx
@@ -30,9 +30,6 @@
#include "anminfo.hxx"
-TYPEINIT1(SdAnimationPrmsUndoAction, SdUndoAction);
-
-
/*************************************************************************
|*
|* Undo()
@@ -41,47 +38,47 @@ TYPEINIT1(SdAnimationPrmsUndoAction, SdUndoAction);
void SdAnimationPrmsUndoAction::Undo()
{
+ OSL_ENSURE(pObject, "SdAnimationPrmsUndoAction with no pObject (!)");
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObject);
+
// keine neu Info erzeugt: Daten restaurieren
if (!bInfoCreated)
{
- SdDrawDocument* pDoc = (SdDrawDocument*)pObject->GetModel();
- if( pDoc )
- {
- SdAnimationInfo* pInfo = pDoc->GetAnimationInfo( pObject );
- // So nicht...
- //SdAnimationInfo* pInfo = (SdAnimationInfo*)pObject->GetUserData(0);
- pInfo->mbActive = bOldActive;
- pInfo->meEffect = eOldEffect;
- pInfo->meTextEffect = eOldTextEffect;
- pInfo->meSpeed = eOldSpeed;
- pInfo->mbDimPrevious = bOldDimPrevious;
- pInfo->maDimColor = aOldDimColor;
- pInfo->mbDimHide = bOldDimHide;
- pInfo->mbSoundOn = bOldSoundOn;
- pInfo->maSoundFile = aOldSoundFile;
- pInfo->mbPlayFull = bOldPlayFull;
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(pObject->getSdrModelFromSdrObject());
+ SdAnimationInfo* pInfo = rDoc.GetAnimationInfo( pObject );
+ // So nicht...
+ //SdAnimationInfo* pInfo = (SdAnimationInfo*)pObject->GetUserData(0);
+ pInfo->mbActive = bOldActive;
+ pInfo->meEffect = eOldEffect;
+ pInfo->meTextEffect = eOldTextEffect;
+ pInfo->meSpeed = eOldSpeed;
+ pInfo->mbDimPrevious = bOldDimPrevious;
+ pInfo->maDimColor = aOldDimColor;
+ pInfo->mbDimHide = bOldDimHide;
+ pInfo->mbSoundOn = bOldSoundOn;
+ pInfo->maSoundFile = aOldSoundFile;
+ pInfo->mbPlayFull = bOldPlayFull;
// pInfo->mSetPath(pOldPathObj);
- pInfo->meClickAction = eOldClickAction;
- pInfo->SetBookmark( aOldBookmark );
+ pInfo->meClickAction = eOldClickAction;
+ pInfo->SetBookmark( aOldBookmark );
// pInfo->mbInvisibleInPresentation = bOldInvisibleInPres;
- pInfo->mnVerb = nOldVerb;
- pInfo->mnPresOrder = nOldPresOrder;
-
- pInfo->meSecondEffect = eOldSecondEffect;
- pInfo->meSecondSpeed = eOldSecondSpeed;
- pInfo->mbSecondSoundOn = bOldSecondSoundOn;
- pInfo->mbSecondPlayFull = bOldSecondPlayFull;
- }
+ pInfo->mnVerb = nOldVerb;
+ pInfo->mnPresOrder = nOldPresOrder;
+
+ pInfo->meSecondEffect = eOldSecondEffect;
+ pInfo->meSecondSpeed = eOldSecondSpeed;
+ pInfo->mbSecondSoundOn = bOldSecondSoundOn;
+ pInfo->mbSecondPlayFull = bOldSecondPlayFull;
}
// Info wurde durch Aktion erzeugt: Info loeschen
else
{
pObject->DeleteUserData(0);
}
- // Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
+
+ // Damit ein LazyReactOnObjectChanges() ausgeloest wird, um das Effekte-Window
// auf Stand zu bringen (Animations-Reihenfolge)
pObject->SetChanged();
- pObject->BroadcastObjectChange();
}
/*************************************************************************
@@ -93,6 +90,7 @@ void SdAnimationPrmsUndoAction::Undo()
void SdAnimationPrmsUndoAction::Redo()
{
SdAnimationInfo* pInfo = NULL;
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObject);
pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
@@ -118,10 +116,9 @@ void SdAnimationPrmsUndoAction::Redo()
pInfo->mbSecondSoundOn = bNewSecondSoundOn;
pInfo->mbSecondPlayFull = bNewSecondPlayFull;
- // Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
+ // Damit ein LazyReactOnObjectChanges() ausgeloest wird, um das Effekte-Window
// auf Stand zu bringen (Animations-Reihenfolge)
pObject->SetChanged();
- pObject->BroadcastObjectChange();
}
/*************************************************************************
diff --git a/sd/source/ui/func/unprlout.cxx b/sd/source/ui/func/unprlout.cxx
index 6450142fdccb..2a524ed1fd0a 100644
--- a/sd/source/ui/func/unprlout.cxx
+++ b/sd/source/ui/func/unprlout.cxx
@@ -33,10 +33,6 @@
#include "sdresid.hxx"
-TYPEINIT1(SdPresentationLayoutUndoAction, SdUndoAction);
-
-
-
/*************************************************************************
|*
|* Konstruktor
@@ -49,7 +45,7 @@ SdPresentationLayoutUndoAction::SdPresentationLayoutUndoAction(
String aTheNewLayoutName,
AutoLayout eTheOldAutoLayout,
AutoLayout eTheNewAutoLayout,
- sal_Bool bSet,
+ bool bSet,
SdPage* pThePage):
SdUndoAction(pTheDoc)
{
@@ -72,9 +68,9 @@ SdPresentationLayoutUndoAction::SdPresentationLayoutUndoAction(
void SdPresentationLayoutUndoAction::Undo()
{
- pPage->SetPresentationLayout(aOldLayoutName, sal_True, sal_True, sal_True);
+ pPage->SetPresentationLayout(aOldLayoutName, true, true, true);
if (bSetAutoLayout)
- pPage->SetAutoLayout(eOldAutoLayout, sal_True);
+ pPage->SetAutoLayout(eOldAutoLayout, true);
}
/*************************************************************************
@@ -87,7 +83,7 @@ void SdPresentationLayoutUndoAction::Redo()
{
pPage->SetPresentationLayout(aNewLayoutName);
if (bSetAutoLayout)
- pPage->SetAutoLayout(eNewAutoLayout, sal_True);
+ pPage->SetAutoLayout(eNewAutoLayout, true);
}
/*************************************************************************
diff --git a/sd/source/ui/inc/AccessibleSlideView.hxx b/sd/source/ui/inc/AccessibleSlideView.hxx
index 0c6461b025d5..4ff94d19c223 100644
--- a/sd/source/ui/inc/AccessibleSlideView.hxx
+++ b/sd/source/ui/inc/AccessibleSlideView.hxx
@@ -64,7 +64,7 @@ private:
AccessibleSlideView* mpManager;
/// client id in the AccessibleEventNotifier queue
sal_uInt32 mnClientId;
- sal_uInt16 mnPage;
+ sal_uInt32 mnPage;
sal_Bool mbVisible;
sal_Bool mbValid;
@@ -146,7 +146,7 @@ public:
*/
void Destroyed (void);
- sal_uInt16 GetPageNum() const { return mnPage; }
+ sal_uInt32 GetPageNum() const { return mnPage; }
void SetVisible( sal_Bool bVisible );
sal_Bool IsVisible() const;
diff --git a/sd/source/ui/inc/BezierObjectBar.hxx b/sd/source/ui/inc/BezierObjectBar.hxx
index b6832d6bd40b..2096b8ee0ecb 100644
--- a/sd/source/ui/inc/BezierObjectBar.hxx
+++ b/sd/source/ui/inc/BezierObjectBar.hxx
@@ -37,7 +37,6 @@ class BezierObjectBar
: public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDDRAWBEZIEROBJECTBAR)
BezierObjectBar (ViewShell* pSdViewShell, View* pSdView);
diff --git a/sd/source/ui/inc/BreakDlg.hxx b/sd/source/ui/inc/BreakDlg.hxx
index b6d634b92a07..7964893e6b89 100644
--- a/sd/source/ui/inc/BreakDlg.hxx
+++ b/sd/source/ui/inc/BreakDlg.hxx
@@ -75,7 +75,7 @@ private:
CancelButton aBtnCancel;
DrawView* pDrView;
- sal_Bool bCancel;
+ bool bCancel;
Timer aTimer;
SvdProgressInfo *pProgrInfo;
diff --git a/sd/source/ui/inc/ClientView.hxx b/sd/source/ui/inc/ClientView.hxx
index 9cea50be5a7c..e91cd66279a3 100644
--- a/sd/source/ui/inc/ClientView.hxx
+++ b/sd/source/ui/inc/ClientView.hxx
@@ -52,7 +52,7 @@ public:
// man diese beiden folgenden Methoden ueberladen und entsprechend anders
// reagieren.
virtual void InvalidateOneWin(::Window& rWin);
- virtual void InvalidateOneWin(::Window& rWin, const Rectangle& rRect);
+ virtual void InvalidateOneWin(::Window& rWin, const basegfx::B2DRange& rRange);
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx
index d016cb42b6d2..13c80f71a2e8 100644
--- a/sd/source/ui/inc/DrawController.hxx
+++ b/sd/source/ui/inc/DrawController.hxx
@@ -262,7 +262,7 @@ protected:
@param nHandle
The handle of the proberty.
@return
- <TRUE/> if the value is converted successfully.
+ <true/> if the value is converted successfully.
@throws IllegalArgumentException
*/
virtual sal_Bool SAL_CALL convertFastPropertyValue(
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index c18bb5c6130e..287ef9ebb229 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -60,24 +60,23 @@ class ViewShell;
class SD_DLLPUBLIC DrawDocShell : public SfxObjectShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDDRAWDOCSHELL)
SFX_DECL_OBJECTFACTORY();
DrawDocShell (
SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
- sal_Bool bSdDataObj=sal_False,
+ bool bSdDataObj=false,
DocumentType=DOCUMENT_TYPE_IMPRESS);
DrawDocShell (
const sal_uInt64 nModelCreationFlags,
- sal_Bool bSdDataObj=sal_False,
+ bool bSdDataObj=false,
DocumentType=DOCUMENT_TYPE_IMPRESS);
DrawDocShell (
SdDrawDocument* pDoc,
SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
- sal_Bool bSdDataObj=sal_False,
+ bool bSdDataObj=false,
DocumentType=DOCUMENT_TYPE_IMPRESS);
virtual ~DrawDocShell();
@@ -105,7 +104,7 @@ public:
virtual void SetOrganizerSearchMask(SfxStyleSheetBasePool* pBasePool) const;
virtual Size GetFirstPageSize();
virtual void FillClass(SvGlobalName* pClassName, sal_uInt32* pFormat, String* pAppName, String* pFullTypeName, String* pShortTypeName, sal_Int32 nFileFormat, sal_Bool bTemplate = sal_False ) const;
- virtual void SetModified( sal_Bool = sal_True );
+ virtual void SetModified( sal_Bool = true );
using SotObject::GetInterface;
using SfxObjectShell::GetVisArea;
@@ -119,11 +118,11 @@ public:
SdDrawDocument* GetDoc();
DocumentType GetDocumentType() const { return meDocType; }
- SfxPrinter* GetPrinter(sal_Bool bCreate);
+ SfxPrinter* GetPrinter(bool bCreate);
void SetPrinter(SfxPrinter *pNewPrinter);
void UpdateFontList();
- sal_Bool IsInDestruction() const { return mbInDestruction; }
+ bool IsInDestruction() const { return mbInDestruction; }
void CancelSearching();
@@ -134,7 +133,7 @@ public:
void Disconnect(sd::ViewShell* pViewSh);
void UpdateTablePointers();
- sal_Bool GotoBookmark(const String& rBookmark);
+ bool GotoBookmark(const String& rBookmark);
Bitmap GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixel);
@@ -149,13 +148,13 @@ public:
@param rName the new name that is to be set for a slide. This string
may be set to an empty string (see below).
- @return sal_True, if the new name is unique. Note that if the user entered
+ @return true, if the new name is unique. Note that if the user entered
a default name of a not-yet-existing slide (e.g. 'Slide 17'),
- sal_True is returned, but rName is set to an empty string.
+ true is returned, but rName is set to an empty string.
*/
- sal_Bool CheckPageName(::Window* pWin, String& rName );
+ bool CheckPageName(::Window* pWin, String& rName );
- void SetSlotFilter(sal_Bool bEnable = sal_False, sal_uInt16 nCount = 0, const sal_uInt16* pSIDs = NULL) { mbFilterEnable = bEnable; mnFilterCount = nCount; mpFilterSIDs = pSIDs; }
+ void SetSlotFilter(bool bEnable = false, sal_uInt16 nCount = 0, const sal_uInt16* pSIDs = NULL) { mbFilterEnable = bEnable; mnFilterCount = nCount; mpFilterSIDs = pSIDs; }
void ApplySlotFilter() const;
sal_uInt16 GetStyleFamily() const { return mnStyleFamily; }
@@ -216,11 +215,11 @@ protected:
sal_uInt16 mnStyleFamily;
const sal_uInt16* mpFilterSIDs;
sal_uInt16 mnFilterCount;
- sal_Bool mbFilterEnable;
- sal_Bool mbSdDataObj;
- sal_Bool mbInDestruction;
- sal_Bool mbOwnPrinter;
- sal_Bool mbNewDocument;
+ bool mbFilterEnable;
+ bool mbSdDataObj;
+ bool mbInDestruction;
+ bool mbOwnPrinter;
+ bool mbNewDocument;
bool mbOwnDocument; // if true, we own mpDoc and will delete it in our d'tor
void Construct(bool bClipboard);
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 90e66012b0fe..dab4c796256a 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -70,8 +70,6 @@ class DrawViewShell
public:
static const int SLOTARRAY_COUNT = 24;
- TYPEINFO();
-
SFX_DECL_INTERFACE(SD_IF_SDDRAWVIEWSHELL)
/** Create a new stackable shell that may take some information
@@ -128,7 +126,7 @@ public:
void HidePage();
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
+ virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
virtual void MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin);
virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
virtual void MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin);
@@ -136,7 +134,7 @@ public:
virtual void Resize (void);
- void ShowMousePosInfo(const Rectangle& rRect, ::sd::Window* pWin);
+ void ShowMousePosInfo(const basegfx::B2DRange& rRange, ::sd::Window* pWin);
virtual void AddWindow(::sd::Window* pWin);
virtual void RemoveWindow(::sd::Window* pWin);
@@ -144,23 +142,21 @@ public:
virtual void ChangeEditMode (EditMode eMode, bool bIsLayerModeActive);
virtual void SetZoom( long nZoom );
- virtual void SetZoomRect( const Rectangle& rZoomRect );
+ virtual void SetZoomRange( const basegfx::B2DRange& rZoomRange );
- void InsertURLField(const String& rURL, const String& rText, const String& rTarget,
- const Point* pPos);
- void InsertURLButton(const String& rURL, const String& rText, const String& rTarget,
- const Point* pPos);
+ void InsertURLField(const String& rURL, const String& rText, const String& rTarget, const basegfx::B2DPoint* pPos);
+ void InsertURLButton(const String& rURL, const String& rText, const String& rTarget, const basegfx::B2DPoint* pPos);
virtual void SetUIUnit(FieldUnit eUnit);
void SelectionHasChanged();
- void ModelHasChanged();
+ void LazyReactOnObjectChanges();
virtual void Activate(sal_Bool bIsMDIActivate);
virtual void Deactivate(sal_Bool IsMDIActivate);
virtual void UIActivating( SfxInPlaceClient* );
virtual void UIDeactivated( SfxInPlaceClient* );
- virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
- virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
+ virtual String GetSelectionText( bool bCompleteWords = false );
+ virtual bool HasSelection( bool bText = true ) const;
void ExecCtrl(SfxRequest& rReq);
void GetCtrlState(SfxItemSet& rSet);
@@ -225,13 +221,13 @@ public:
const Ruler& rRuler,
const MouseEvent& rMEvt);
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual sal_uInt16 PrepareClose( bool bUI = true, bool bForBrowsing = false );
PageKind GetPageKind() { return mePageKind; }
- Point GetMousePos() { return maMousePos; }
- sal_Bool IsMousePosFreezed() { return mbMousePosFreezed; }
- void SetMousePosFreezed( sal_Bool bIn ) { mbMousePosFreezed = bIn; }
+ basegfx::B2DPoint GetMousePos() { return maMousePos; }
+ bool IsMousePosFreezed() { return mbMousePosFreezed; }
+ void SetMousePosFreezed( bool bIn ) { mbMousePosFreezed = bIn; }
EditMode GetEditMode() const { return meEditMode; }
virtual SdPage* GetActualPage() { return mpActualPage; }
@@ -241,20 +237,20 @@ public:
void ResetActualPage();
void ResetActualLayer();
- sal_Bool SwitchPage(sal_uInt16 nPage);
- sal_Bool IsSwitchPageAllowed() const;
+ bool SwitchPage(sal_uInt32 nPage);
+ bool IsSwitchPageAllowed() const;
- sal_Bool GotoBookmark(const String& rBookmark);
- void MakeVisible(const Rectangle& rRect, ::Window& rWin);
+ bool GotoBookmark(const String& rBookmark);
+ void MakeVisibleAtView(const basegfx::B2DRange& rRange, ::Window& rWin);
virtual void ReadFrameViewData(FrameView* pView);
virtual void WriteFrameViewData();
virtual ErrCode DoVerb(long nVerb);
- virtual sal_Bool ActivateObject(SdrOle2Obj* pObj, long nVerb);
+ virtual bool ActivateObject(SdrOle2Obj* pObj, long nVerb);
- void SetZoomOnPage( sal_Bool bZoom = sal_True ) { mbZoomOnPage = bZoom; }
- sal_Bool IsZoomOnPage() { return mbZoomOnPage; }
+ void SetZoomOnPage( bool bZoom = true ) { mbZoomOnPage = bZoom; }
+ bool IsZoomOnPage() { return mbZoomOnPage; }
void CheckLineTo (SfxRequest& rReq);
void FuTemp01(SfxRequest& rReq);
void FuTemp02(SfxRequest& rReq);
@@ -266,7 +262,7 @@ public:
void LockInput();
void UnlockInput();
- sal_Bool IsInputLocked() const { return mnLockCount > 0UL; }
+ bool IsInputLocked() const { return mnLockCount > 0UL; }
sal_uInt16 GetCurPageId() { return( maTabControl.GetCurPageId() ); }
@@ -283,9 +279,9 @@ public:
sal_uInt16* GetSlotArray() const { return mpSlotArray; }
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
- ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
+ ::sd::Window* pTargetWindow, sal_uInt32 nPage, SdrLayerID sLayer );
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
- ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
+ ::sd::Window* pTargetWindow, sal_uInt32 nPage, SdrLayerID aLayer );
virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
@@ -349,7 +345,7 @@ public:
<p>Implemented in <code>drviews8.cxx</code>.</p>
*/
- bool RenameSlide( sal_uInt16 nPageId, const String & rName );
+ bool RenameSlide( sal_uInt32 nPageId, const String & rName );
/** modifies the given layer with the given values */
void ModifyLayer( SdrLayer* pLayer, const String& rLayerName, const String& rLayerTitle, const String& rLayerDesc, bool bIsVisible, bool bIsLocked, bool bIsPrintable );
@@ -359,27 +355,27 @@ public:
DrawView* GetDrawView() const { return mpDrawView; }
/** Relocation to a new parent window is not supported for DrawViewShell
- objects so this method always returns <FALSE/>.
+ objects so this method always returns <false/>.
*/
virtual bool RelocateToParentWindow (::Window* pParentWindow);
protected:
DrawView* mpDrawView;
SdPage* mpActualPage;
- Rectangle maMarkRect;
- Point maMousePos;
- sal_Bool mbMousePosFreezed;
+ basegfx::B2DRange maMarkRange;
+ basegfx::B2DPoint maMousePos;
+ bool mbMousePosFreezed;
TabControl maTabControl;
EditMode meEditMode;
PageKind mePageKind;
- sal_Bool mbZoomOnPage;
- sal_Bool mbIsRulerDrag;
+ bool mbZoomOnPage;
+ bool mbIsRulerDrag;
sal_uLong mnLockCount;
Timer maCloseTimer;
- sal_Bool mbReadOnly;
+ bool mbReadOnly;
sal_uInt16* mpSlotArray;
- static sal_Bool mbPipette;
+ static bool mbPipette;
DECL_LINK( ClipboardChanged, TransferableDataHelper* );
DECL_LINK( CloseHdl, Timer* pTimer );
@@ -390,7 +386,7 @@ protected:
void DeleteActualPage();
void DeleteActualLayer();
- virtual SvxRuler* CreateHRuler(::sd::Window* pWin, sal_Bool bIsFirst);
+ virtual SvxRuler* CreateHRuler(::sd::Window* pWin, bool bIsFirst);
virtual SvxRuler* CreateVRuler(::sd::Window* pWin);
virtual void UpdateHRuler();
virtual void UpdateVRuler();
@@ -398,12 +394,12 @@ protected:
virtual void SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY);
virtual Size GetOptimalSizePixel() const;
- void SetupPage( Size &rSize, long nLeft, long nRight, long nUpper, long nLower,
- sal_Bool bSize, sal_Bool bMargin, sal_Bool bScaleAll );
+ void SetupPage( const basegfx::B2DVector& rSize, double fLeft, double fRight, double fTop, double fBottom,
+ bool bSize, bool bMargin, bool bScaleAll );
sal_uInt16 GetIdBySubId( sal_uInt16 nSId );
void MapSlot( sal_uInt16 nSId );
- void UpdateToolboxImages( SfxItemSet &rSet, sal_Bool bPermanent = sal_True );
+ void UpdateToolboxImages( SfxItemSet &rSet, bool bPermanent = true );
sal_uInt16 GetMappedSlot( sal_uInt16 nSId );
sal_uInt16 GetArrayId( sal_uInt16 nSId );
@@ -445,7 +441,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::scanner::XScannerManager > mxScannerManager;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxScannerListener;
TransferableClipboardListener* mpClipEvtLstnr;
- sal_Bool mbPastePossible;
+ bool mbPastePossible;
virtual void Notify (SfxBroadcaster& rBC, const SfxHint& rHint);
@@ -455,11 +451,11 @@ private:
b) the given flag bCloseFrame is true.
@param bCloseFrame
Be carefull with this flag when stopping a full screen show.
- When called from the destructor the flag has to be <FALSE/> or
+ When called from the destructor the flag has to be <false/> or
otherwise we run into a loop of calls to destructors of the view
and the frame.
- When called from other places the flag should be <TRUE/> so that
- not an empty frame remains. When called with <TRUE/> it is the
+ When called from other places the flag should be <true/> so that
+ not an empty frame remains. When called with <true/> it is the
responsibility of the caller to avoid an illegal reentrant
call.
*/
@@ -480,7 +476,7 @@ private:
*/
void ShowSnapLineContextMenu (
SdrPageView& rPageView,
- const sal_uInt16 nSnapLineIndex,
+ const sal_uInt32 nSnapLineIndex,
const Point& rMouseLocation);
using ViewShell::Notify;
diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx
index 3f5f877e69c4..45d6eb05be57 100644
--- a/sd/source/ui/inc/FrameView.hxx
+++ b/sd/source/ui/inc/FrameView.hxx
@@ -38,11 +38,10 @@ namespace sd {
|* View fuer den MDIFrame
|*
\************************************************************************/
-class FrameView
- : public SdrView
+class FrameView : public SdrView
{
public:
- SD_DLLPUBLIC FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView = NULL );
+ SD_DLLPUBLIC FrameView(SdDrawDocument& rDrawDoc, FrameView* pFrameView = NULL );
FrameView(const FrameView& rFrameView);
virtual ~FrameView();
@@ -73,17 +72,17 @@ public:
{ maPrintableLayers = rPrintableLayers; }
const SetOfByte& GetPrintableLayers() { return maPrintableLayers; }
- void SetRuler(const sal_Bool bRulerOn)
+ void SetRuler(const bool bRulerOn)
{ mbRuler = bRulerOn; }
- sal_Bool HasRuler() const { return mbRuler; }
+ bool HasRuler() const { return mbRuler; }
- void SetNoColors(const sal_Bool bNoCol)
+ void SetNoColors(const bool bNoCol)
{ mbNoColors = bNoCol; }
- sal_Bool IsNoColors() const { return mbNoColors; }
+ bool IsNoColors() const { return mbNoColors; }
- void SetNoAttribs(const sal_Bool bNoAttr)
+ void SetNoAttribs(const bool bNoAttr)
{ mbNoAttribs = bNoAttr; }
- sal_Bool IsNoAttribs() const { return mbNoAttribs; }
+ bool IsNoAttribs() const { return mbNoAttribs; }
void SetVisArea(const Rectangle& rVisArea)
{ maVisArea = rVisArea; }
@@ -99,15 +98,15 @@ public:
/** can be used to get the page kind that was selected on last save of this document */
PageKind GetPageKindOnLoad() const { return mePageKindOnLoad; }
- SD_DLLPUBLIC void SetSelectedPage (sal_uInt16 nPage);
- sal_uInt16 GetSelectedPage () const;
+ SD_DLLPUBLIC void SetSelectedPage (sal_uInt32 nPage);
+ sal_uInt32 GetSelectedPage () const;
/** is used in FrameView::ReadUserDataSequence() only to store the
page that was selected while last saving this document */
- void SetSelectedPageOnLoad (sal_uInt16 nPage) { mnSelectedPageOnLoad = nPage; }
+ void SetSelectedPageOnLoad (sal_uInt32 nPage) { mnSelectedPageOnLoad = nPage; }
/** can be used to get the page that was selected on last save of this document */
- sal_uInt16 GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; }
+ sal_uInt32 GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; }
SD_DLLPUBLIC void SetViewShEditMode(EditMode eMode, PageKind eKind);
EditMode GetViewShEditMode (PageKind eKind);
@@ -122,22 +121,22 @@ public:
*/
EditMode GetViewShEditModeOnLoad (void) const;
- void SetLayerMode(sal_Bool bMode)
+ void SetLayerMode(bool bMode)
{ mbLayerMode = bMode; }
- sal_Bool IsLayerMode() const { return mbLayerMode; }
+ bool IsLayerMode() const { return mbLayerMode; }
- void SetQuickEdit(sal_Bool bQEdit)
+ void SetQuickEdit(bool bQEdit)
{ mbQuickEdit = bQEdit; }
- sal_Bool IsQuickEdit() const { return mbQuickEdit; }
+ bool IsQuickEdit() const { return mbQuickEdit; }
- void SetBigHandles( sal_Bool bOn = sal_True ) { mbBigHandles = bOn; }
- sal_Bool IsBigHandles() const { return mbBigHandles; }
+ void SetBigHandles( bool bOn = true ) { mbBigHandles = bOn; }
+ bool IsBigHandles() const { return mbBigHandles; }
- void SetDoubleClickTextEdit( sal_Bool bOn = sal_True ) { mbDoubleClickTextEdit = bOn; }
- sal_Bool IsDoubleClickTextEdit() const { return mbDoubleClickTextEdit; }
+ void SetDoubleClickTextEdit( bool bOn = true ) { mbDoubleClickTextEdit = bOn; }
+ bool IsDoubleClickTextEdit() const { return mbDoubleClickTextEdit; }
- void SetClickChangeRotation( sal_Bool bOn = sal_True ) { mbClickChangeRotation = bOn; }
- sal_Bool IsClickChangeRotation() const { return mbClickChangeRotation; }
+ void SetClickChangeRotation( bool bOn = true ) { mbClickChangeRotation = bOn; }
+ bool IsClickChangeRotation() const { return mbClickChangeRotation; }
/** Remember the type of the view shell that was (or soon will be)
previously associated with this frame view.
@@ -184,36 +183,36 @@ public:
private:
sal_uInt16 mnRefCount;
VirtualDevice* mpVDev;
- sal_Bool mbRuler;
+ bool mbRuler;
SetOfByte maVisibleLayers;
SetOfByte maLockedLayers;
SetOfByte maPrintableLayers;
SdrHelpLineList maStandardHelpLines;
SdrHelpLineList maNotesHelpLines;
SdrHelpLineList maHandoutHelpLines;
- sal_Bool mbNoColors; // Gliederungsmodus
- sal_Bool mbNoAttribs; // Gliederungsmodus
+ bool mbNoColors; // Gliederungsmodus
+ bool mbNoAttribs; // Gliederungsmodus
Rectangle maVisArea; // Sichtbarer Bereich
PageKind mePageKind; // Seitentyp (Standard, Notizen, Handzettel)
sal_uInt16 mnSelectedPage; // Selektierte Seite
PageKind mePageKindOnLoad;
- sal_uInt16 mnSelectedPageOnLoad;
+ sal_uInt32 mnSelectedPageOnLoad;
EditMode meStandardEditMode; // Editmode im Zeichenmodus (Page/MasterPage)
EditMode meNotesEditMode; // Editmode im Notizen-Modus (Page/MasterPage)
EditMode meHandoutEditMode; // Editmode im Handzettel-Modus (Page/MasterPage)
EditMode meEditModeOnLoad;
- sal_Bool mbLayerMode; // Layer an/aus
- sal_Bool mbQuickEdit; // QuickEdit an/aus
- sal_Bool mbBigHandles; // Grosse Handles
- sal_Bool mbDoubleClickTextEdit; // Textmodus nach Doppelklick
- sal_Bool mbClickChangeRotation; // Einfachklick wechselt Selektions-/Rotationsmodus
+ bool mbLayerMode; // Layer an/aus
+ bool mbQuickEdit; // QuickEdit an/aus
+ bool mbBigHandles; // Grosse Handles
+ bool mbDoubleClickTextEdit; // Textmodus nach Doppelklick
+ bool mbClickChangeRotation; // Einfachklick wechselt Selektions-/Rotationsmodus
sal_uInt16 mnPresViewShellId; // ViewShell aus der die Pres. gestartet wurde
sal_uInt16 mnSlotId; // SlotId, welche initial ausgefuehrt wird
sal_uInt16 mnSlidesPerRow; // Dias pro Reihe auf dem Diatisch
sal_uLong mnDrawMode; // Drawmode fuer das normale Fenster
double mnTabCtrlPercent;
- /** Remember whether the navigator shows all shapes (<TRUE/>) or only
- the names ones (<FALSE/>). Not persistent.
+ /** Remember whether the navigator shows all shapes (<true/>) or only
+ the names ones (<false/>). Not persistent.
*/
bool mbIsNavigatorShowingAllShapes;
diff --git a/sd/source/ui/inc/GraphicDocShell.hxx b/sd/source/ui/inc/GraphicDocShell.hxx
index 92c3204bbaea..31b9d5a563f8 100644
--- a/sd/source/ui/inc/GraphicDocShell.hxx
+++ b/sd/source/ui/inc/GraphicDocShell.hxx
@@ -43,8 +43,6 @@ class GraphicDocShell
: public DrawDocShell
{
public:
- TYPEINFO();
-
SFX_DECL_INTERFACE(SD_IF_SDGRAPHICDOCSHELL)
SFX_DECL_OBJECTFACTORY();
@@ -52,12 +50,12 @@ public:
GraphicDocShell (
SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
- sal_Bool bSdDataObj=sal_False,
+ bool bSdDataObj=false,
DocumentType=DOCUMENT_TYPE_DRAW);
GraphicDocShell (
const sal_uInt64 nModelCreationFlags,
- sal_Bool bSdDataObj=sal_False,
+ bool bSdDataObj=false,
DocumentType=DOCUMENT_TYPE_DRAW);
virtual ~GraphicDocShell (void);
diff --git a/sd/source/ui/inc/GraphicObjectBar.hxx b/sd/source/ui/inc/GraphicObjectBar.hxx
index dd06bdb0a75d..f8c3c7c31bfa 100644
--- a/sd/source/ui/inc/GraphicObjectBar.hxx
+++ b/sd/source/ui/inc/GraphicObjectBar.hxx
@@ -38,7 +38,6 @@ class GraphicObjectBar
: public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE( SD_IF_SDDRAWGRAFOBJECTBAR )
GraphicObjectBar (ViewShell* pSdViewShell, ::sd::View* pSdView);
diff --git a/sd/source/ui/inc/GraphicViewShell.hxx b/sd/source/ui/inc/GraphicViewShell.hxx
index 1a4fdefbd405..ea2ff4de39ee 100644
--- a/sd/source/ui/inc/GraphicViewShell.hxx
+++ b/sd/source/ui/inc/GraphicViewShell.hxx
@@ -43,8 +43,6 @@ class GraphicViewShell
: public DrawViewShell
{
public:
- TYPEINFO();
-
SFX_DECL_VIEWFACTORY(GraphicViewShell);
SFX_DECL_INTERFACE(SD_IF_SDGRAPHICVIEWSHELL)
diff --git a/sd/source/ui/inc/GraphicViewShellBase.hxx b/sd/source/ui/inc/GraphicViewShellBase.hxx
index c81793c0c44b..40162ca93e4b 100644
--- a/sd/source/ui/inc/GraphicViewShellBase.hxx
+++ b/sd/source/ui/inc/GraphicViewShellBase.hxx
@@ -36,7 +36,6 @@ class GraphicViewShellBase
: public ViewShellBase
{
public:
- TYPEINFO();
SFX_DECL_VIEWFACTORY(GraphicViewShellBase);
/** This constructor is used by the view factory of the SFX
diff --git a/sd/source/ui/inc/ImpressViewShellBase.hxx b/sd/source/ui/inc/ImpressViewShellBase.hxx
index cd45b681357e..5f4516c66be2 100644
--- a/sd/source/ui/inc/ImpressViewShellBase.hxx
+++ b/sd/source/ui/inc/ImpressViewShellBase.hxx
@@ -36,7 +36,6 @@ class ImpressViewShellBase
: public ViewShellBase
{
public:
- TYPEINFO();
SFX_DECL_VIEWFACTORY(ImpressViewShellBase);
/** This constructor is used by the view factory of the SFX
diff --git a/sd/source/ui/inc/MediaObjectBar.hxx b/sd/source/ui/inc/MediaObjectBar.hxx
index a34aa1e1e098..a785699af0a8 100644
--- a/sd/source/ui/inc/MediaObjectBar.hxx
+++ b/sd/source/ui/inc/MediaObjectBar.hxx
@@ -38,7 +38,6 @@ class MediaObjectBar
: public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE( SD_IF_SDDRAWMEDIAOBJECTBAR )
MediaObjectBar (ViewShell* pSdViewShell, ::sd::View* pSdView);
diff --git a/sd/source/ui/inc/OutlineBulletDlg.hxx b/sd/source/ui/inc/OutlineBulletDlg.hxx
index a71c22f0cdef..d309b741d999 100644
--- a/sd/source/ui/inc/OutlineBulletDlg.hxx
+++ b/sd/source/ui/inc/OutlineBulletDlg.hxx
@@ -57,7 +57,7 @@ private:
SfxItemSet aInputSet;
SfxItemSet *pOutputSet;
- sal_Bool bTitle;
+ bool bTitle;
::sd::View *pSdView;
};
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index 56f04efd5f11..3bcd3f2239e5 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -75,8 +75,6 @@ public:
void ConnectToApplication (void);
void DisconnectFromApplication (void);
- TYPEINFO();
-
SdrTextObj* GetTitleTextObject(SdrPage* pPage);
SdrTextObj* GetOutlineTextObject(SdrPage* pPage);
@@ -119,12 +117,11 @@ public:
sal_uLong GetPaperWidth() const { return 2*21000; } // DIN A4 Breite
- sal_Bool PrepareClose(sal_Bool bUI = sal_True);
+ bool PrepareClose(bool bUI = true);
- virtual sal_Bool GetAttributes( SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False ) const;
- virtual sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll = sal_False);
+ virtual bool GetAttributes( SfxItemSet& rTargetSet, bool bOnlyHardAttr = false ) const;
+ virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false);
-// virtual sal_Bool HasMarkedObjUnused() const;
void FillOutliner();
void SetLinks();
void ResetLinks() const;
@@ -137,20 +134,20 @@ public:
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
virtual sal_Int8 ExecuteDrop (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
// #97766# Re-implement GetScriptType for this view to get correct results
virtual sal_uInt16 GetScriptType() const;
- /** After this method has been called with <TRUE/> following changes of
+ /** After this method has been called with <true/> following changes of
the current page are ignored in that the corresponding text is not
selected.
This is used to supress unwanted side effects between selection and
@@ -198,7 +195,7 @@ private:
sal_uInt16 mnPagesToProcess; // fuer die Fortschrittsanzeige
sal_uInt16 mnPagesProcessed;
- sal_Bool mbFirstPaint;
+ bool mbFirstPaint;
SfxProgress* mpProgress;
diff --git a/sd/source/ui/inc/OutlineViewShell.hxx b/sd/source/ui/inc/OutlineViewShell.hxx
index 922869a62c97..2ab4f28101d2 100644
--- a/sd/source/ui/inc/OutlineViewShell.hxx
+++ b/sd/source/ui/inc/OutlineViewShell.hxx
@@ -42,8 +42,6 @@ class OutlineViewShell
: public ViewShell
{
public:
- TYPEINFO();
-
SFX_DECL_VIEWFACTORY(OutlineViewShell);
SFX_DECL_INTERFACE(SD_IF_SDOUTLINEVIEWSHELL)
@@ -76,7 +74,7 @@ public:
*/
virtual void ArrangeGUIElements (void);
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual sal_uInt16 PrepareClose( bool bUI = true, bool bForBrowsing = false );
virtual long VirtHScrollHdl(ScrollBar* pHScroll);
virtual long VirtVScrollHdl(ScrollBar* pVHScroll);
@@ -107,9 +105,9 @@ public:
void FuSupport(SfxRequest &rReq);
virtual void SetZoom(long nZoom);
- virtual void SetZoomRect(const Rectangle& rZoomRect);
- virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
- virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
+ virtual void SetZoomRange(const basegfx::B2DRange& rZoomRange);
+ virtual String GetSelectionText( bool bCompleteWords = false );
+ virtual bool HasSelection( bool bText = true ) const;
void Execute(SfxRequest& rReq);
@@ -117,7 +115,7 @@ public:
virtual void WriteFrameViewData();
virtual void Command( const CommandEvent& rCEvt, ::sd::Window* pWin );
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
+ virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
sal_uLong Read(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
@@ -141,7 +139,7 @@ public:
/** Update the preview to show the specified page.
*/
- virtual void UpdatePreview (SdPage* pPage, sal_Bool bInit = sal_False);
+ virtual void UpdatePreview (SdPage* pPage, bool bInit = false);
virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
@@ -163,7 +161,7 @@ private:
OutlineView* pOlView;
SdPage* pLastPage; // Zur performanten Aufbereitung der Preview
TransferableClipboardListener* pClipEvtLstnr;
- sal_Bool bPastePossible;
+ bool bPastePossible;
bool mbInitialized;
void Construct (DrawDocShell* pDocSh);
diff --git a/sd/source/ui/inc/OutlineViewShellBase.hxx b/sd/source/ui/inc/OutlineViewShellBase.hxx
index 8098d46c8514..1728738f8c22 100644
--- a/sd/source/ui/inc/OutlineViewShellBase.hxx
+++ b/sd/source/ui/inc/OutlineViewShellBase.hxx
@@ -36,7 +36,6 @@ class OutlineViewShellBase
: public ImpressViewShellBase
{
public:
- TYPEINFO();
SFX_DECL_VIEWFACTORY(OutlineViewShellBase);
/** This constructor is used by the view factory of the SFX
diff --git a/sd/source/ui/inc/OutlinerIteratorImpl.hxx b/sd/source/ui/inc/OutlinerIteratorImpl.hxx
index 5b7dec28c627..11e2c586be40 100644
--- a/sd/source/ui/inc/OutlinerIteratorImpl.hxx
+++ b/sd/source/ui/inc/OutlinerIteratorImpl.hxx
@@ -55,7 +55,7 @@ public:
@param pViewShellWeak
Some information has to be taken from the view shell.
@param bDirectionIsForward
- This flag defines the iteration direction. When <TRUE/> then
+ This flag defines the iteration direction. When <true/> then
the direction is forwards otherwise it is backwards.
*/
IteratorImplBase (SdDrawDocument* pDocument,
@@ -95,7 +95,7 @@ public:
@param rIterator
The iterator to compare to.
@return
- When both iterators ar equal <TRUE/> is returned, <FALSE/> otherwise.
+ When both iterators ar equal <true/> is returned, <false/> otherwise.
*/
virtual bool operator== (const IteratorImplBase& rIterator) const;
/** This method is used by the equality operator. Additionaly to the
@@ -106,7 +106,7 @@ public:
@param aType
The type of the iterator.
@return
- Returns <TRUE/> when both iterators point to the same object.
+ Returns <true/> when both iterators point to the same object.
*/
virtual bool IsEqual (const IteratorImplBase& rIterator, IteratorType aType) const;
/** Reverse the direction of iteration. The current object stays the same.
@@ -141,7 +141,7 @@ class SelectionIteratorImpl
{
public:
SelectionIteratorImpl (
- const ::std::vector< SdrObjectWeakRef >& rObjectList,
+ const SdrObjectVector& rObjectList,
sal_Int32 nObjectIndex,
SdDrawDocument* pDocument,
const ::boost::weak_ptr<ViewShell>& rpViewShellWeak,
@@ -155,7 +155,7 @@ public:
virtual bool operator== (const IteratorImplBase& rIterator) const;
private:
- const ::std::vector<SdrObjectWeakRef>& mrObjectList;
+ const SdrObjectVector& mrObjectList;
sal_Int32 mnObjectIndex;
/** Compare the given iterator with this object. This method handles
@@ -165,7 +165,7 @@ private:
@param aType
The type of the iterator.
@return
- Returns <TRUE/> when both iterators point to the same object.
+ Returns <true/> when both iterators point to the same object.
*/
virtual bool IsEqual (const IteratorImplBase& rIterator, IteratorType aType) const;
diff --git a/sd/source/ui/inc/PaneShells.hxx b/sd/source/ui/inc/PaneShells.hxx
index 3c81021e9f48..8868e6170eb2 100644
--- a/sd/source/ui/inc/PaneShells.hxx
+++ b/sd/source/ui/inc/PaneShells.hxx
@@ -41,7 +41,6 @@ class LeftImpressPaneShell
: public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDLEFTIMPRESSPANESHELL)
LeftImpressPaneShell (void);
@@ -58,7 +57,6 @@ class LeftDrawPaneShell
: public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDLEFTDRAWPANESHELL)
LeftDrawPaneShell (void);
@@ -74,7 +72,6 @@ public:
class ToolPanelPaneShell : public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE( SD_IF_SDTOOLPANELPANESHELL )
ToolPanelPaneShell();
diff --git a/sd/source/ui/inc/PresentationViewShell.hxx b/sd/source/ui/inc/PresentationViewShell.hxx
index 72b238eebf58..3ef37abed620 100644
--- a/sd/source/ui/inc/PresentationViewShell.hxx
+++ b/sd/source/ui/inc/PresentationViewShell.hxx
@@ -36,8 +36,6 @@ namespace sd {
class PresentationViewShell : public DrawViewShell
{
public:
- TYPEINFO();
-
SFX_DECL_VIEWFACTORY(PresViewShell);
SFX_DECL_INTERFACE( SD_IF_SDPRESVIEWSHELL )
@@ -56,13 +54,13 @@ public:
virtual void Resize (void);
protected:
- virtual SvxRuler* CreateHRuler(::sd::Window* pWin, sal_Bool bIsFirst);
+ virtual SvxRuler* CreateHRuler(::sd::Window* pWin, bool bIsFirst);
virtual SvxRuler* CreateVRuler(::sd::Window* pWin);
private:
Rectangle maOldVisArea;
- virtual void Activate (sal_Bool bIsMDIActivate);
+ virtual void Activate (bool bIsMDIActivate);
virtual void Paint (const Rectangle& rRect, ::sd::Window* pWin);
};
diff --git a/sd/source/ui/inc/PresentationViewShellBase.hxx b/sd/source/ui/inc/PresentationViewShellBase.hxx
index bd3eec5b1afe..4ece363cee06 100644
--- a/sd/source/ui/inc/PresentationViewShellBase.hxx
+++ b/sd/source/ui/inc/PresentationViewShellBase.hxx
@@ -36,7 +36,6 @@ class PresentationViewShellBase
: public ViewShellBase
{
public:
- TYPEINFO();
SFX_DECL_VIEWFACTORY(PresentationViewShellBase);
/** This constructor is used by the view factory of the SFX
diff --git a/sd/source/ui/inc/PreviewRenderer.hxx b/sd/source/ui/inc/PreviewRenderer.hxx
index c2508e8c1043..2e147054e8b2 100644
--- a/sd/source/ui/inc/PreviewRenderer.hxx
+++ b/sd/source/ui/inc/PreviewRenderer.hxx
@@ -50,7 +50,7 @@ public:
@param pTemplate
May be NULL.
@param bPaintFrame
- When <TRUE/> (the default) then a frame is painted around the
+ When <true/> (the default) then a frame is painted around the
preview. This makes the actual preview smaller.
*/
PreviewRenderer (
@@ -72,9 +72,9 @@ public:
this text is painted in an empty rectangle of the requested size
instead.
@param bObeyHighContrastMode
- When <FALSE/> then the high contrast mode of the application is
+ When <false/> then the high contrast mode of the application is
ignored and the preview is rendered in normal mode. When
- <TRUE/> and high contrast mode is active then the preview is
+ <true/> and high contrast mode is active then the preview is
rendered in high contrast mode.
@param bDisplayPresentationObjects
When <FALSE/> then the PresObj place holders are not displayed
@@ -97,9 +97,9 @@ public:
this text is painted in an empty rectangle of the requested size
instead.
@param bObeyHighContrastMode
- When <FALSE/> then the high contrast mode of the application is
+ When <false/> then the high contrast mode of the application is
ignored and the preview is rendered in normal mode. When
- <TRUE/> and high contrast mode is active then the preview is
+ <true/> and high contrast mode is active then the preview is
rendered in high contrast mode.
@param bDisplayPresentationObjects
When <FALSE/> then the PresObj place holders are not displayed
diff --git a/sd/source/ui/inc/Ruler.hxx b/sd/source/ui/inc/Ruler.hxx
index 099747c6d1fe..b637b9e6159e 100644
--- a/sd/source/ui/inc/Ruler.hxx
+++ b/sd/source/ui/inc/Ruler.hxx
@@ -56,7 +56,7 @@ public:
void SetNullOffset(const Point& rOffset);
- sal_Bool IsHorizontal() const { return bHorz; }
+ bool IsHorizontal() const { return bHorz; }
using ::Ruler::SetNullOffset;
protected:
@@ -64,7 +64,7 @@ protected:
::sd::Window* pSdWin;
DrawViewShell* pDrViewShell;
RulerCtrlItem* pCtrlItem;
- sal_Bool bHorz;
+ bool bHorz;
virtual void MouseButtonDown(const MouseEvent& rMEvt);
virtual void MouseButtonUp(const MouseEvent& rMEvt);
diff --git a/sd/source/ui/inc/SlideSorter.hxx b/sd/source/ui/inc/SlideSorter.hxx
index 62c2757b73d5..83a52afcea9c 100644
--- a/sd/source/ui/inc/SlideSorter.hxx
+++ b/sd/source/ui/inc/SlideSorter.hxx
@@ -84,7 +84,7 @@ public:
virtual ~SlideSorter (void);
/** Return whether the called SlideSorter object is valid and calling
- its Get(Model,View,Controller) methods is safe. When <FALSE/> is
+ its Get(Model,View,Controller) methods is safe. When <false/> is
called then no other methods should be called.
Calling this method should be necessary only during startup and
shutdown (when that can be detected).
@@ -238,7 +238,7 @@ private:
::boost::shared_ptr<ScrollBar> mpVerticalScrollBar;
::boost::shared_ptr<ScrollBarBox> mpScrollBarBox;
- /** Set this flag to <TRUE/> to force a layout before the next paint.
+ /** Set this flag to <true/> to force a layout before the next paint.
*/
bool mbLayoutPending;
diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx
index b088c8fb1e49..2d9c5c9283ea 100644
--- a/sd/source/ui/inc/SlideSorterViewShell.hxx
+++ b/sd/source/ui/inc/SlideSorterViewShell.hxx
@@ -46,7 +46,6 @@ class SlideSorterViewShell
friend class controller::SlotManager;
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDSLIDESORTERVIEWSHELL)
static ::boost::shared_ptr<SlideSorterViewShell> Create(
@@ -101,7 +100,7 @@ public:
factor.
*/
virtual void SetZoom (long int nZoom);
- virtual void SetZoomRect (const Rectangle& rZoomRect);
+ virtual void SetZoomRange(const basegfx::B2DRange& rZoomRange);
/** This is a callback method used by the active window to delegate its
Paint() call to. This view shell itself delegates it to the view.
@@ -119,7 +118,7 @@ public:
//===== Drag and Drop =====================================================
virtual void StartDrag (
- const Point& rDragPt,
+ const basegfx::B2DPoint& rDragPt,
::Window* pWindow );
virtual void DragFinished (
sal_Int8 nDropAction);
@@ -127,14 +126,14 @@ public:
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
virtual sal_Int8 ExecuteDrop (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
typedef ::std::vector<SdPage*> PageSelection;
diff --git a/sd/source/ui/inc/SlideSorterViewShellBase.hxx b/sd/source/ui/inc/SlideSorterViewShellBase.hxx
index 3598317c6159..c9908878dc38 100644
--- a/sd/source/ui/inc/SlideSorterViewShellBase.hxx
+++ b/sd/source/ui/inc/SlideSorterViewShellBase.hxx
@@ -36,7 +36,6 @@ class SlideSorterViewShellBase
: public ImpressViewShellBase
{
public:
- TYPEINFO();
SFX_DECL_VIEWFACTORY(SlideSorterViewShellBase);
/** This constructor is used by the view factory of the SFX
diff --git a/sd/source/ui/inc/SlideView.hxx b/sd/source/ui/inc/SlideView.hxx
index 5e2493c15c6e..e088d639abaf 100644
--- a/sd/source/ui/inc/SlideView.hxx
+++ b/sd/source/ui/inc/SlideView.hxx
@@ -58,29 +58,27 @@ class SlideView
: public ::sd::View
{
public:
- TYPEINFO();
-
SlideView (
SdDrawDocument* pDoc,
::Window* pWindow,
SlideViewShell* pSlideVShell);
virtual ~SlideView (void);
- void Select( sal_uInt16 nSdPageNum, sal_Bool bSelect );
- void SelectAllSlides( sal_Bool bSelect );
+ void Select( sal_uInt16 nSdPageNum, bool bSelect );
+ void SelectAllSlides( bool bSelect );
void MoveFocus( SlideViewFocusMove eMove );
sal_uInt16 GetFocusPage() const;
- sal_Bool HasFocus() const;
+ bool HasFocus() const;
sal_uInt16 ChangePagesPerRow( sal_uInt16 nNum );
sal_uInt16 GetPagesPerRow() const { return nPagesPerRow; }
virtual void InvalidateOneWin( ::Window& rWin );
- virtual void InvalidateOneWin( ::Window& rWin, const Rectangle& rRect );
+ virtual void InvalidateOneWin( ::Window& rWin, const basegfx::B2DRange& rRange );
- void SetAllowInvalidate( sal_Bool bFlag );
- sal_Bool IsInvalidateAllowed() const;
+ void SetAllowInvalidate( bool bFlag );
+ bool IsInvalidateAllowed() const;
void Paint(const Rectangle& rRect, OutputDevice* pOut);
void DrawSelectionRect(sal_uInt16 nPage);
@@ -110,12 +108,12 @@ public:
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
void UpdateAllPages();
@@ -128,11 +126,11 @@ private:
sal_uInt16 nAllowInvalidateSmph;
sal_uInt16 nPagesPerRow;
sal_uInt16 nFocusPage;
- sal_Bool bInPaint;
- sal_Bool bInDelayedPaint;
+ bool bInPaint;
+ bool bInDelayedPaint;
DECL_LINK( PaintDelayed, Timer * );
- void CreateSlideTransferable (::Window* pWindow, sal_Bool bDrag);
+ void CreateSlideTransferable (::Window* pWindow, bool bDrag);
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/SlideViewShell.hxx b/sd/source/ui/inc/SlideViewShell.hxx
index f5e1195f5155..7b0d5ddac32e 100644
--- a/sd/source/ui/inc/SlideViewShell.hxx
+++ b/sd/source/ui/inc/SlideViewShell.hxx
@@ -50,8 +50,6 @@ class SlideViewShell
{
public:
- TYPEINFO();
-
SFX_DECL_VIEWFACTORY(SlideViewShell);
SFX_DECL_INTERFACE(SD_IF_SDSLIDEVIEWSHELL)
@@ -84,7 +82,7 @@ public:
virtual void AddWindow(::sd::Window* pWin) { pSlideView->AddWindowToPaintView((OutputDevice*) pWin); }
virtual void RemoveWindow(::sd::Window* pWin) { pSlideView->DeleteWindowFromPaintView((OutputDevice*) pWin); }
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
+ virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
virtual void MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin);
virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
virtual void MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin);
@@ -115,9 +113,9 @@ public:
virtual void WriteFrameViewData();
virtual void SetZoom(long nZoom);
- virtual void SetZoomRect(const Rectangle& rZoomRect);
+ virtual void SetZoomRange(const basegfx::B2DRange& rZoomRange);
- virtual sal_Bool HasSelection( sal_Bool bText = sal_True ) const;
+ virtual bool HasSelection( bool bText = true ) const;
/** Draw the rectangle arround the specified slide that indicates whether
the slide is selected or not. When not selected the rectangle is
@@ -142,11 +140,11 @@ public:
void SelectionHasChanged();
void PageLayoutHasChanged();
void FocusHasChanged( sal_uInt16 nOldFocusPage, sal_uInt16 nNewFocusPage );
- void PageVisibilityHasChanged( sal_uInt16 nPage, sal_Bool bVisible );
+ void PageVisibilityHasChanged( sal_uInt16 nPage, bool bVisible );
/** On activation the preview is turned off.
*/
- virtual void Activate (sal_Bool IsMDIActivate);
+ virtual void Activate (bool IsMDIActivate);
protected:
virtual Size GetOptimalSizePixel() const;
@@ -163,7 +161,7 @@ private:
bool bInitializeWinPos;
void Construct(SdDrawDocument* pDoc);
- void ImplDrawFocusRect( sal_uInt16 nPage, sal_Bool bVisible );
+ void ImplDrawFocusRect( sal_uInt16 nPage, bool bVisible );
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/SpellDialogChildWindow.hxx b/sd/source/ui/inc/SpellDialogChildWindow.hxx
index 14e29954421e..08987f055194 100644
--- a/sd/source/ui/inc/SpellDialogChildWindow.hxx
+++ b/sd/source/ui/inc/SpellDialogChildWindow.hxx
@@ -73,7 +73,7 @@ private:
*/
Outliner* mpSdOutliner;
- /** When this flag is <TRUE/> then eventually we have to destroy
+ /** When this flag is <true/> then eventually we have to destroy
the outliner in mpSdOutliner.
*/
bool mbOwnOutliner;
diff --git a/sd/source/ui/inc/TabControl.hxx b/sd/source/ui/inc/TabControl.hxx
index 0183d4e06f19..0d27f5511218 100644
--- a/sd/source/ui/inc/TabControl.hxx
+++ b/sd/source/ui/inc/TabControl.hxx
@@ -60,7 +60,7 @@ public:
protected:
DrawViewShell* pDrViewSh;
- sal_Bool bInternalMove;
+ bool bInternalMove;
// TabBar
virtual void Select();
diff --git a/sd/source/ui/inc/TemplateScanner.hxx b/sd/source/ui/inc/TemplateScanner.hxx
index 1c8ff16ec882..99553916a7df 100644
--- a/sd/source/ui/inc/TemplateScanner.hxx
+++ b/sd/source/ui/inc/TemplateScanner.hxx
@@ -81,7 +81,7 @@ public:
and collect the supported ones in a tree structure. This structure is
returned by GetFolderList().
2. The new way implements the AsynchronousTask interface. Call
- RunNextStep() as long HasNextStep() returns <TRUE/>. After every step
+ RunNextStep() as long HasNextStep() returns <true/>. After every step
GetLastAddedEntry() returns the template that was scanned (and has a
supported format) last. When a step does not add a new template then
the value of the previous step is returned.
diff --git a/sd/source/ui/inc/TextObjectBar.hxx b/sd/source/ui/inc/TextObjectBar.hxx
index a86512808d26..041c93d56e6c 100644
--- a/sd/source/ui/inc/TextObjectBar.hxx
+++ b/sd/source/ui/inc/TextObjectBar.hxx
@@ -41,7 +41,6 @@ class TextObjectBar
: public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDDRAWTEXTOBJECTBAR)
TextObjectBar (
diff --git a/sd/source/ui/inc/UpdateLockManager.hxx b/sd/source/ui/inc/UpdateLockManager.hxx
index 6e5506af0882..9f988b5a0c5f 100644
--- a/sd/source/ui/inc/UpdateLockManager.hxx
+++ b/sd/source/ui/inc/UpdateLockManager.hxx
@@ -70,7 +70,7 @@ public:
/** Return whether the ViewShellBase object is locked. When locking is
disabled, i.e. Disable() has been called before, then this method
- always returns <FALSE/>.
+ always returns <false/>.
*/
bool IsLocked (void) const;
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index abe3811df04a..a9f691f4896e 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -28,10 +28,6 @@
#include <tools/gen.hxx>
#include <svtools/transfer.hxx>
#include <svx/fmview.hxx>
-#include <svx/svdmark.hxx>
-//#ifndef _SVDVMARK_HXX //autogen
-//#include <svx/svdvmark.hxx>
-//#endif
#include <svx/svdpage.hxx>
#include "fupoor.hxx"
@@ -73,40 +69,38 @@ struct SdViewRedrawRec
class View : public FmFormView
{
public:
- TYPEINFO();
-
View (
- SdDrawDocument* pDrawDoc,
+ SdDrawDocument& rDrawDoc,
OutputDevice* pOutDev,
ViewShell* pViewSh=NULL);
virtual ~View (void);
void CompleteRedraw( OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L);
- virtual sal_Bool GetAttributes( SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False ) const;
- virtual sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll = sal_False);
- virtual void MarkListHasChanged();
- virtual void ModelHasChanged();
+ virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr = false ) const;
+ virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false);
+ virtual void handleSelectionChange();
+ virtual void LazyReactOnObjectChanges();
virtual void SelectAll();
virtual void DoCut(::Window* pWindow=NULL);
virtual void DoCopy(::Window* pWindow=NULL);
virtual void DoPaste(::Window* pWindow=NULL);
virtual void DoConnect(SdrOle2Obj* pOleObj);
- virtual sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr = sal_False);
+ virtual bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr = false);
virtual void StartDrag( const Point& rStartPos, ::Window* pWindow );
virtual void DragFinished( sal_Int8 nDropAction );
virtual sal_Int8 AcceptDrop (
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
virtual sal_Int8 ExecuteDrop (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable>
@@ -119,56 +113,54 @@ public:
::com::sun::star::datatransfer::XTransferable>
CreateSelectionDataObject (::sd::View*, ::Window& rWindow);
- void UpdateSelectionClipboard( sal_Bool bForceDeselect );
+ void UpdateSelectionClipboard( bool bForceDeselect );
inline DrawDocShell* GetDocSh (void) const;
inline SdDrawDocument* GetDoc (void) const;
inline ViewShell* GetViewShell (void) const;
- virtual sal_Bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = 0L, ::Window* pWin = 0L, sal_Bool bIsNewObj = sal_False,
- SdrOutliner* pGivenOutliner = 0L, OutlinerView* pGivenOutlinerView = 0L,
- sal_Bool bDontDeleteOutliner = sal_False, sal_Bool bOnlyOneView = sal_False, sal_Bool bGrabFocus = sal_True);
+ virtual bool SdrBeginTextEdit(SdrObject* pObj, ::Window* pWin = 0, bool bIsNewObj = false,
+ SdrOutliner* pGivenOutliner = 0, OutlinerView* pGivenOutlinerView = 0,
+ bool bDontDeleteOutliner = false, bool bOnlyOneView = false, bool bGrabFocus = true);
- virtual SdrEndTextEditKind SdrEndTextEdit(sal_Bool bDontDeleteReally = sal_False);
+ virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally = false);
bool RestoreDefaultText( SdrTextObj* pTextObj );
- sal_Bool InsertData( const TransferableDataHelper& rDataHelper,
- const Point& rPos, sal_Int8& rDnDAction, sal_Bool bDrag,
- sal_uLong nFormat = 0, sal_uInt16 nPage = SDRPAGE_NOTFOUND, sal_uInt16 nLayer = SDRLAYER_NOTFOUND );
+ bool InsertData( const TransferableDataHelper& rDataHelper,
+ const basegfx::B2DPoint& rPos, sal_Int8& rDnDAction, bool bDrag,
+ sal_uInt32 nFormat = 0, sal_uInt32 nPage = SDRPAGE_NOTFOUND, sal_uInt32 nLayer = SDRLAYER_NOTFOUND );
/** gets the metafile from the given transferable helper and insert it as a graphic shape.
@param bOptimize if set to true, the metafile is analyzed and if only one bitmap action is
present, then is is inserted as a single graphic.
*/
- bool InsertMetaFile( TransferableDataHelper& rDataHelper,
- const Point& rInsertPos,
- ImageMap* pImageMap, bool bOptimize );
+ bool InsertMetaFile( TransferableDataHelper& rDataHelper, const basegfx::B2DPoint& rInsertPos, ImageMap* pImageMap, bool bOptimize );
SdrGrafObj* InsertGraphic( const Graphic& rGraphic,
- sal_Int8& rAction, const Point& rPos,
+ sal_Int8& rAction, const basegfx::B2DPoint& rPos,
SdrObject* pSelectedObj, ImageMap* pImageMap );
SdrMediaObj* InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAction,
- const Point& rPos, const Size& rSize );
+ const basegfx::B2DPoint& rPos, const basegfx::B2DVector& rSize );
- bool PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nPasteOptions );
+ bool PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uInt32 nPasteOptions );
- sal_Bool IsPresObjSelected(sal_Bool bOnPage=sal_True, sal_Bool bOnMasterPage=sal_True, sal_Bool bCheckPresObjListOnly=sal_False, sal_Bool bCheckLayoutOnly=sal_False) const;
+ bool IsPresObjSelected(bool bOnPage=true, bool bOnMasterPage=true, bool bCheckPresObjListOnly=false, bool bCheckLayoutOnly=false) const;
void SetMarkedOriginalSize();
- void LockRedraw(sal_Bool bLock);
+ void LockRedraw(bool bLock);
- sal_Bool IsMorphingAllowed() const;
- sal_Bool IsVectorizeAllowed() const;
+ bool IsMorphingAllowed() const;
+ bool IsVectorizeAllowed() const;
virtual SfxStyleSheet* GetStyleSheet() const;
- sal_Bool GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType );
+ bool GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType );
virtual void onAccessibilityOptionsChanged();
virtual SdrModel* GetMarkedObjModel() const;
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ virtual bool Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
using SdrExchangeView::Paste;
/** returns true if we have an undo manager and there is an open list undo action */
@@ -178,28 +170,24 @@ public:
SmartTagSet& getSmartTags() { return maSmartTags; }
void selectSmartTag( const SmartTagReference& xTag );
- void updateHandles();
virtual SdrViewContext GetContext() const;
- virtual sal_Bool HasMarkablePoints() const;
- virtual sal_uLong GetMarkablePointCount() const;
- virtual sal_Bool HasMarkedPoints() const;
- virtual sal_uLong GetMarkedPointCount() const;
- virtual sal_Bool IsPointMarkable(const SdrHdl& rHdl) const;
- virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
+ virtual bool HasMarkablePoints() const;
+ virtual sal_uInt32 GetMarkablePointCount() const;
+ virtual bool HasMarkedPoints() const;
+ virtual sal_uInt32 GetMarkedPointCount() const;
+ virtual bool IsPointMarkable(const SdrHdl& rHdl) const;
+ virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark = false);
virtual void CheckPossibilities();
- virtual sal_Bool MarkPoints(const ::Rectangle* pRect, sal_Bool bUnmark);
+ virtual void MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark);
using SdrMarkView::MarkPoints;
- void SetPossibilitiesDirty() { bPossibilitiesDirty = true; }
- void SetMoveAllowed( bool bSet ) { bMoveAllowed = bSet; }
- void SetMoveProtected( bool bSet ) { bMoveProtect = bSet; }
- void SetResizeFreeAllowed( bool bSet ) { bResizeFreeAllowed = bSet; }
- void SetResizePropAllowed( bool bSet ) { bResizePropAllowed = bSet; }
- void SetResizeProtected( bool bSet ) { bResizeProtect = bSet; }
-
- void SetMarkedPointsSmoothPossible( bool bSet ) { bSetMarkedPointsSmoothPossible = bSet; }
- void SetMarkedSegmentsKindPossible( bool bSet ) { bSetMarkedSegmentsKindPossible = bSet; }
+ void SetPossibilitiesDirty() { if(mbPossibilitiesDirty != true) mbPossibilitiesDirty = true; }
+ void SetMoveAllowedOnSelection( bool bSet ) { mbMoveAllowedOnSelection = bSet; }
+ void SetMoveProtected( bool bSet ) { if(mbMoveProtect != bSet) mbMoveProtect = bSet; }
+ void SetResizeFreeAllowed( bool bSet ) { if(mbResizeFreeAllowed != bSet) mbResizeFreeAllowed = bSet; }
+ void SetResizePropAllowed( bool bSet ) { if(mbResizePropAllowed != bSet) mbResizePropAllowed = bSet; }
+ void SetResizeProtected( bool bSet ) { if(mbResizeProtect != bSet) mbResizeProtect = bSet; }
SdrObject* GetEmptyPresentationObject( PresObjKind eKind );
protected:
@@ -212,11 +200,11 @@ protected:
SdDrawDocument* mpDoc;
DrawDocShell* mpDocSh;
ViewShell* mpViewSh;
- SdrMarkList* mpDragSrcMarkList;
+ SdrObjectVector maDragSrcMarkList;
SdrObject* mpDropMarkerObj;
SdrDropMarkerOverlay* mpDropMarker;
- sal_uInt16 mnDragSrcPgNum;
- Point maDropPos;
+ sal_uInt32 mnDragSrcPgNum;
+ basegfx::B2DPoint maDropPos;
::std::vector< String > maDropFileVector;
sal_Int8 mnAction;
Timer maDropErrorTimer;
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 264ae75d175d..4c86357c0450 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -63,6 +63,11 @@ namespace embed {
namespace css = ::com::sun::star;
+#define SD_OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT)
+#define SD_OUTPUT_DRAWMODE_GRAYSCALE (DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_BLACKTEXT | DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT)
+#define SD_OUTPUT_DRAWMODE_BLACKWHITE (DRAWMODE_BLACKLINE | DRAWMODE_BLACKTEXT | DRAWMODE_WHITEFILL | DRAWMODE_GRAYBITMAP | DRAWMODE_WHITEGRADIENT)
+#define SD_OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT)
+
namespace sd {
class Client;
@@ -80,9 +85,6 @@ class Window;
class WindowUpdater;
class ZoomList;
-#undef OUTPUT_DRAWMODE_COLOR
-#undef OUTPUT_DRAWMODE_CONTRAST
-
/** Base class of the stacked shell hierarchy.
<p>Despite its name this class is not a descendant of SfxViewShell
@@ -113,24 +115,6 @@ public:
ST_PRESENTATION,
ST_TASK_PANE
};
- static const int MAX_HSPLIT_CNT = 1;
- static const int MAX_VSPLIT_CNT = 1;
- static const int MIN_SCROLLBAR_SIZE = 50;
-
- static const sal_uLong OUTPUT_DRAWMODE_COLOR = DRAWMODE_DEFAULT;
- static const sal_uLong OUTPUT_DRAWMODE_GRAYSCALE
- = DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL
- | DRAWMODE_BLACKTEXT | DRAWMODE_GRAYBITMAP
- | DRAWMODE_GRAYGRADIENT;
- static const int OUTPUT_DRAWMODE_BLACKWHITE
- = DRAWMODE_BLACKLINE | DRAWMODE_BLACKTEXT
- | DRAWMODE_WHITEFILL | DRAWMODE_GRAYBITMAP
- | DRAWMODE_WHITEGRADIENT;
- static const int OUTPUT_DRAWMODE_CONTRAST
- = DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL
- | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT;
-
- TYPEINFO();
ViewShell (
SfxViewFrame *pFrame,
@@ -197,12 +181,12 @@ public:
// Mouse- & Key-Events
virtual void PrePaint();
virtual void Paint (const Rectangle& rRect, ::sd::Window* pWin);
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
+ virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin);
virtual void MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin);
virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin);
virtual void MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin);
virtual void Command(const CommandEvent& rCEvt, ::sd::Window* pWin);
- virtual sal_Bool RequestHelp( const HelpEvent& rEvt, ::sd::Window* pWin );
+ virtual bool RequestHelp( const HelpEvent& rEvt, ::sd::Window* pWin );
virtual long Notify( NotifyEvent& rNEvt, ::sd::Window* pWin );
virtual bool HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWin);
@@ -212,8 +196,8 @@ public:
virtual void SetUIUnit(FieldUnit eUnit);
virtual void SetDefTabHRuler( sal_uInt16 nDefTab );
- sal_Bool HasRuler (void);
- void SetRuler(sal_Bool bRuler);
+ bool HasRuler (void);
+ void SetRuler(bool bRuler);
/** Set internal values of all scroll bars that determine thumb size and
position. The external values like size and position of the scroll
@@ -221,19 +205,18 @@ public:
*/
virtual void UpdateScrollBars (void);
void Scroll(long nX, long nY);
- void ScrollLines(long nX, long nY);
+ void ScrollLines(const basegfx::B2DVector& rDelta);
virtual void SetZoom(long nZoom);
- virtual void SetZoomRect(const Rectangle& rZoomRect);
- void InitWindows(const Point& rViewOrigin, const Size& rViewSize,
- const Point& rWinPos, sal_Bool bUpdate = sal_False);
+ virtual void SetZoomRange(const basegfx::B2DRange& rZoomRange);
+ void InitWindows(const basegfx::B2DPoint& rViewOrigin, const basegfx::B2DVector& rViewSize, const basegfx::B2DPoint& rWinPos, bool bUpdate = false);
void InvalidateWindows();
/** This method is still used by the OutlineViewShell to update the
model according to the content of the outline view. This in turn
updates the previews in the slide sorter.
*/
- virtual void UpdatePreview (SdPage* pPage, sal_Bool bInit = sal_False);
+ virtual void UpdatePreview (SdPage* pPage, bool bInit = false);
- void DrawMarkRect(const Rectangle& rRect) const;
+ void DrawMarkRange(const basegfx::B2DRange& rRange) const;
void ExecReq( SfxRequest &rReq );
@@ -251,7 +234,7 @@ public:
virtual void WriteUserData(String& rString);
virtual void ReadUserData(const String& rString);
- virtual sal_Bool ActivateObject(SdrOle2Obj* pObj, long nVerb);
+ virtual bool ActivateObject(SdrOle2Obj* pObj, long nVerb);
/** @returns
current or selected page or 0. This method
@@ -276,13 +259,13 @@ public:
void SetOldFunction(const FunctionReference& xFunction);
void DeactivateCurrentFunction( bool bPermanent = false );
- void SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
- long nLeft, long nRight, long nUpper, long nLower,
- sal_Bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin,
- sal_Bool bBackgroundFullSize );
+ void SetPageSizeAndBorder(PageKind ePageKind, const basegfx::B2DVector& rNewSize,
+ double fLeft, double fRight, double fTop, double fBottom,
+ bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin,
+ bool bBackgroundFullSize );
- void SetStartShowWithDialog( sal_Bool bIn = sal_True ) { mbStartShowWithDialog = bIn; }
- sal_Bool IsStartShowWithDialog() const { return mbStartShowWithDialog; }
+ void SetStartShowWithDialog( bool bIn = true ) { mbStartShowWithDialog = bIn; }
+ bool IsStartShowWithDialog() const { return mbStartShowWithDialog; }
sal_uInt16 GetPrintedHandoutPageNum (void) const { return mnPrintedHandoutPageNum; }
void SetPrintedHandoutPageNum (sal_uInt16 nPageNumber) {mnPrintedHandoutPageNum=nPageNumber; }
@@ -290,14 +273,14 @@ public:
sal_uInt16 GetPrintedHandoutPageCount(void) const { return mnPrintedHandoutPageCount; }
void SetPrintedHandoutPageCount (sal_uInt16 nPageCount) {mnPrintedHandoutPageCount=nPageCount; }
- virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
+ virtual sal_uInt16 PrepareClose( bool bUI = true, bool bForBrowsing = false );
void GetMenuState(SfxItemSet& rSet);
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
- ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
+ ::sd::Window* pTargetWindow, sal_uInt32 nPage, SdrLayerID aLayer );
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
- ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer );
+ ::sd::Window* pTargetWindow, sal_uInt32 nPage, SdrLayerID aLayer );
virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
@@ -317,9 +300,9 @@ public:
::com::sun::star::accessibility::XAccessible>
CreateAccessibleDocumentView (::sd::Window* pWindow);
- void SetWinViewPos(const Point& rWinPos, bool bUpdate);
- Point GetWinViewPos() const;
- Point GetViewOrigin() const;
+ void SetWinViewPos(const basegfx::B2DPoint& rWinPos, bool bUpdate);
+ basegfx::B2DPoint GetWinViewPos() const;
+ basegfx::B2DPoint GetViewOrigin() const;
/** Return the window updater of this view shell.
@return
@@ -331,11 +314,11 @@ public:
/** Return the border that is drawn arround the actual document view.
The border contains typically rulers and scroll bars.
@param bOuterResize
- When this flag is <TRUE/> then the border is used for an
+ When this flag is <true/> then the border is used for an
OuterResizePixel(), i.e. there is a given window size and the
border elements are placed inside so that the document view has
the given window size minus the border.
- When the flag is <FALSE/> then the border is used for an
+ When the flag is <false/> then the border is used for an
InnerResizePixel(), i.e. the document view has a given size and
the border is placed outside. In this scenario the parent
window has the size of the document view plus the border.
@@ -381,7 +364,7 @@ public:
ViewShellBase& GetViewShellBase (void) const;
- /** Return <TRUE/> when the called view shell is the main sub shell of
+ /** Return <true/> when the called view shell is the main sub shell of
its ViewShellBase object, i.e. is display in the center pane. This
convenience function is equivalent to comparing the this pointer to
the result of ViewShellBase::GetViewShell(PT_CENTER).
@@ -390,7 +373,7 @@ public:
/** Set or reset the flag that indicates whether the called shell is the
one displayed in the center pane. By default this flag is set to
- <FALSE/>. For the main view shell it thus has to be set to <TRUE/>.
+ <false/>. For the main view shell it thus has to be set to <true/>.
*/
void SetIsMainViewShell (bool bIsMainViewShell);
@@ -426,7 +409,7 @@ public:
As a result the border is adapted.
*/
virtual void ShowUIControls (bool bVisible = true);
- sal_Bool IsPageFlipMode(void) const;
+ bool IsPageFlipMode(void) const;
/** Set the given window as new parent window. This is not possible for
all views, so the return value tells the caller if the relocation
@@ -434,6 +417,9 @@ public:
*/
virtual bool RelocateToParentWindow (::Window* pParentWindow);
+ void AdaptDefaultsForChart(
+ const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > & xEmbObj );
+
/** Depending on the given request create a new page or duplicate an
existing one. A new page is created behind the given slide.
@param rRequest
@@ -502,15 +488,12 @@ protected:
Size maViewSize;
Size maScrBarWH;
- sal_Bool mbCenterAllowed; // wird an Fenster weitergegeben
+ bool mbCenterAllowed; // wird an Fenster weitergegeben
- sal_Bool mbStartShowWithDialog; // Praesentation wurde ueber Dialog gestartet
+ bool mbStartShowWithDialog; // Praesentation wurde ueber Dialog gestartet
sal_uInt16 mnPrintedHandoutPageNum; // Page number of the handout page that is to be printed.
sal_uInt16 mnPrintedHandoutPageCount; // Page count of the handout pages that are to be printed.
- //af sal_Bool bPrintDirectSelected; // Print only selected objects in direct print
- //afString sPageRange; // pagerange if selected objects in direct print
-
/** Area covered by all windows, i.e. the area of the parent window
without the controls at the borders like rulers, scroll bars, tab
bar, buttons.
@@ -530,8 +513,8 @@ protected:
virtual ::svl::IUndoManager* ImpGetUndoManager (void) const;
void ImpGetUndoStrings(SfxItemSet &rSet) const;
void ImpGetRedoStrings(SfxItemSet &rSet) const;
- void ImpSidUndo(sal_Bool bDrawViewShell, SfxRequest& rReq);
- void ImpSidRedo(sal_Bool bDrawViewShell, SfxRequest& rReq);
+ void ImpSidUndo(bool bDrawViewShell, SfxRequest& rReq);
+ void ImpSidRedo(bool bDrawViewShell, SfxRequest& rReq);
DECL_LINK( HScrollHdl, ScrollBar * );
DECL_LINK( VScrollHdl, ScrollBar * );
@@ -541,7 +524,7 @@ protected:
virtual long VirtVScrollHdl(ScrollBar* pVScroll);
// virtuelle Funktionen fuer Lineal-Handling
- virtual SvxRuler* CreateHRuler(::sd::Window* pWin, sal_Bool bIsFirst);
+ virtual SvxRuler* CreateHRuler(::sd::Window* pWin, bool bIsFirst);
virtual SvxRuler* CreateVRuler(::sd::Window* pWin);
virtual void UpdateHRuler();
virtual void UpdateVRuler();
@@ -574,6 +557,10 @@ private:
/** Create the rulers.
*/
void SetupRulers (void);
+
+ /** Update VisAreaChanged by using size ouf OutDev
+ */
+ void UpdateVisAreaChanged();
};
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index 3d8ffa89a1ba..4443b1172e4e 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -69,7 +69,6 @@ class ViewShellBase
: public SfxViewShell
{
public:
- TYPEINFO();
SFX_DECL_VIEWFACTORY(ViewShellBase);
SFX_DECL_INTERFACE(SD_IF_SDVIEWSHELLBASE)
@@ -132,7 +131,7 @@ public:
virtual com::sun::star::uno::Reference<com::sun::star::view::XRenderable> GetRenderable (void);
/// Forwarded to the print manager.
- virtual SfxPrinter* GetPrinter (sal_Bool bCreate = sal_False);
+ virtual SfxPrinter* GetPrinter (sal_Bool bCreate = false);
/// Forwarded to the print manager.
virtual sal_uInt16 SetPrinter (
@@ -172,7 +171,7 @@ public:
virtual SdrView* GetDrawView (void) const;
virtual void AdjustPosSizePixel (const Point &rOfs, const Size &rSize);
- /** When <TRUE/> is given, then the mouse shape is set to hour glass (or
+ /** When <true/> is given, then the mouse shape is set to hour glass (or
whatever the busy shape looks like on the system.)
*/
void SetBusyState (bool bBusy);
diff --git a/sd/source/ui/inc/ViewShellHint.hxx b/sd/source/ui/inc/ViewShellHint.hxx
index 8406781c89b7..a70362b37f62 100644
--- a/sd/source/ui/inc/ViewShellHint.hxx
+++ b/sd/source/ui/inc/ViewShellHint.hxx
@@ -49,8 +49,6 @@ public:
HINT_COMPLEX_MODEL_CHANGE_END
};
- TYPEINFO();
-
ViewShellHint (HintId nHintId);
HintId GetHintId (void) const;
diff --git a/sd/source/ui/inc/ViewShellImplementation.hxx b/sd/source/ui/inc/ViewShellImplementation.hxx
index 9f8671fb5557..ceceae4479d7 100644
--- a/sd/source/ui/inc/ViewShellImplementation.hxx
+++ b/sd/source/ui/inc/ViewShellImplementation.hxx
@@ -74,11 +74,11 @@ public:
static ::boost::shared_ptr<ToolBarManagerLock> Create (
const ::boost::shared_ptr<ToolBarManager>& rpManager);
/** Release the lock. When the UI is captured
- (Application::IsUICaptured() returns <TRUE/>) then the lock is
+ (Application::IsUICaptured() returns <true/>) then the lock is
released later asynchronously.
@param bForce
- When this flag is <TRUE/> then the lock is released even
- when IsUICaptured() returns <TRUE/>.
+ When this flag is <true/> then the lock is released even
+ when IsUICaptured() returns <true/>.
*/
void Release (bool bForce = false);
DECL_LINK(TimeoutCallback,Timer*);
diff --git a/sd/source/ui/inc/ViewShellManager.hxx b/sd/source/ui/inc/ViewShellManager.hxx
index 685e922d5362..90591074de75 100644
--- a/sd/source/ui/inc/ViewShellManager.hxx
+++ b/sd/source/ui/inc/ViewShellManager.hxx
@@ -114,7 +114,7 @@ public:
@param pFormShell
The form shell.
@param bAbove
- When <TRUE/> then the form shell will be placed directly above
+ When <true/> then the form shell will be placed directly above
pViewShell on the SFX shell stack. Otherwise the form shell is
placed directly below the view shell.
*/
diff --git a/sd/source/ui/inc/ViewTabControl.hxx b/sd/source/ui/inc/ViewTabControl.hxx
index bd8a7b7f93ef..ffe192397a88 100644
--- a/sd/source/ui/inc/ViewTabControl.hxx
+++ b/sd/source/ui/inc/ViewTabControl.hxx
@@ -60,7 +60,7 @@ public:
protected:
DrawViewShell* pDrViewSh;
- sal_Bool bInternalMove;
+ bool bInternalMove;
// TabBar
virtual void Select();
diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx
index 63108acfdff6..30c8f6937846 100644
--- a/sd/source/ui/inc/Window.hxx
+++ b/sd/source/ui/inc/Window.hxx
@@ -67,7 +67,7 @@ public:
@param nZoom
The zoom factor is given as integral percent value.
*/
- void SetZoomIntegral(long nZoom);
+ void SetZoomIntegral(double fZoom);
/** This internally used method performs the actual adaption of the
window's map mode to the specified zoom factor.
@@ -80,7 +80,7 @@ public:
forced into that interval. Therefore the returned value is a
valid zoom factor.
*/
- long SetZoomFactor(long nZoom);
+ double SetZoomFactor(double fZoom);
/** This method is called when the whole page shall be displayed in the
window. Position and zoom factor are set so that the given
@@ -88,15 +88,15 @@ public:
the same time maintaining the rectangle's aspect ratio and adding a
small space at all its four sides (about 3% of width and height).
The map mode is adapted accordingly.
- @param rZoomRect
+ @param rZoomRange
The rectangle is expected to be given relative to the upper left
corner of the window in logical coordinates (100th of mm).
@return
The new zoom factor is returned as integral percent value.
*/
- long SetZoomRect (const Rectangle& rZoomRect);
+ double SetZoomRange(const basegfx::B2DRange& rZoomRange);
- long GetZoomForRect( const Rectangle& rZoomRect );
+ double GetZoomForRange( const basegfx::B2DRange& rZoomRange );
void SetMinZoomAutoCalc (bool bAuto);
@@ -110,22 +110,22 @@ public:
factor.
<p>This calculation is performed only when the
- <member>bMinZoomAutoCalc</member> is set (to <TRUE/>).</p>
+ <member>bMinZoomAutoCalc</member> is set (to <true/>).</p>
*/
void CalcMinZoom (void);
- void SetMinZoom (long int nMin);
- long GetMinZoom (void) const;
- void SetMaxZoom (long int nMax);
- long GetMaxZoom (void) const;
-
- long GetZoom (void) const;
-
- Point GetWinViewPos (void) const;
- Point GetViewOrigin (void) const;
- Size GetViewSize (void) const;
- void SetWinViewPos(const Point& rPnt);
- void SetViewOrigin(const Point& rPnt);
- void SetViewSize(const Size& rSize);
+ void SetMinZoom (double fMin);
+ double GetMinZoom (void) const;
+ void SetMaxZoom (double fMax);
+ double GetMaxZoom (void) const;
+
+ double GetZoom (void) const;
+
+ basegfx::B2DPoint GetWinViewPos (void) const;
+ basegfx::B2DPoint GetViewOrigin (void) const;
+ basegfx::B2DVector GetViewSize (void) const;
+ void SetWinViewPos(const basegfx::B2DPoint& rPnt);
+ void SetViewOrigin(const basegfx::B2DPoint& rPnt);
+ void SetViewSize(const basegfx::B2DVector& rSize);
void SetCenterAllowed (bool bIsAllowed);
/** Calculate origin of the map mode accoring to the size of the view
@@ -135,15 +135,15 @@ public:
larger than the view or the value of aWinPos in this direction is -1
then the window is centered in this direction.
*/
- void UpdateMapOrigin (sal_Bool bInvalidate = sal_True);
+ void UpdateMapOrigin (bool bInvalidate = true);
void UpdateMapMode (void);
double GetVisibleX(); // Interface fuer ScrollBars
double GetVisibleY();
void SetVisibleXY(double fX, double fY);
- double GetVisibleWidth();
- double GetVisibleHeight();
+ double GetVisibleWidthRelativeToView();
+ double GetVisibleHeightRelativeToView();
double GetScrlLineWidth();
double GetScrlLineHeight();
double GetScrlPageWidth();
@@ -160,22 +160,22 @@ public:
you can control whether DropScroll() shall be used.
*/
void SetUseDropScroll (bool bUseDropScroll);
- void DropScroll (const Point& rMousePos);
+ void DropScroll (const basegfx::B2DPoint& rMousePos);
protected:
::sd::Window* mpShareWin;
- Point maWinPos;
- Point maViewOrigin;
- Size maViewSize;
- sal_uInt16 mnMinZoom;
- sal_uInt16 mnMaxZoom;
+ basegfx::B2DPoint maWinPos;
+ basegfx::B2DPoint maViewOrigin;
+ basegfx::B2DVector maViewSize;
+ double mfMinZoom;
+ double mfMaxZoom;
/** This flag tells whether to re-calculate the minimal zoom factor
depening on the current zoom factor. According to task #105436# its
- default value is now sal_False.
+ default value is now false.
*/
bool mbMinZoomAutoCalc;
bool mbCalcMinZoomByMinSide;
bool mbCenterAllowed;
- long mnTicks;
+ sal_uInt32 mnTicks;
bool mbDraggedFrom;
ViewShell* mpViewShell;
diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx
index 7cdd5d6df826..d2c171ba206b 100644
--- a/sd/source/ui/inc/animobjs.hxx
+++ b/sd/source/ui/inc/animobjs.hxx
@@ -145,8 +145,8 @@ private:
Size aFltWinSize;
Size aDisplaySize;
Size aBmpSize;
- sal_Bool bMovie;
- sal_Bool bAllObjects;
+ bool bMovie;
+ bool bAllObjects;
SfxBindings* pBindings;
AnimationControllerItem* pControllerItem;
@@ -165,7 +165,7 @@ private:
DECL_LINK( ModifyBitmapHdl, void * );
DECL_LINK( ModifyTimeHdl, void * );
- void UpdateControl( sal_uLong nPos, sal_Bool bDisableCtrls = sal_False );
+ void UpdateControl( sal_uLong nPos, bool bDisableCtrls = false );
void ResetAttrs();
void WaitInEffect( sal_uLong nMilliSeconds, sal_uLong nTime,
SfxProgress* pStbMgr ) const;
diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx
index 36c567508e66..850984cf7e16 100644
--- a/sd/source/ui/inc/custsdlg.hxx
+++ b/sd/source/ui/inc/custsdlg.hxx
@@ -55,7 +55,7 @@ private:
SdDrawDocument& rDoc;
List* pCustomShowList;
SdCustomShow* pCustomShow;
- sal_Bool bModified;
+ bool bModified;
void CheckState();
@@ -66,8 +66,8 @@ public:
SdCustomShowDlg( Window* pWindow, SdDrawDocument& rDrawDoc );
~SdCustomShowDlg();
- sal_Bool IsModified() const { return( bModified ); }
- sal_Bool IsCustomShow() const;
+ bool IsModified() const { return( bModified ); }
+ bool IsCustomShow() const;
};
@@ -90,7 +90,7 @@ private:
SdDrawDocument& rDoc;
SdCustomShow*& rpCustomShow;
- sal_Bool bModified;
+ bool bModified;
String aOldName;
void CheckState();
@@ -105,7 +105,7 @@ public:
SdDrawDocument& rDrawDoc, SdCustomShow*& rpCS );
~SdDefineCustomShowDlg();
- sal_Bool IsModified() const { return( bModified ); }
+ bool IsModified() const { return( bModified ); }
};
#endif // _SD_CUSTSDLG_HXX
diff --git a/sd/source/ui/inc/dlgass.hxx b/sd/source/ui/inc/dlgass.hxx
index 0f30fd6e7f72..28baba87c8fc 100644
--- a/sd/source/ui/inc/dlgass.hxx
+++ b/sd/source/ui/inc/dlgass.hxx
@@ -54,19 +54,19 @@ private:
AssistentDlgImpl* mpImpl;
public:
- AssistentDlg(Window* pParent, sal_Bool bAutoPilot);
+ AssistentDlg(Window* pParent, bool bAutoPilot);
~AssistentDlg();
DECL_LINK( FinishHdl, OKButton * );
SfxObjectShellLock GetDocument();
OutputType GetOutputMedium() const;
- sal_Bool IsSummary() const;
+ bool IsSummary() const;
StartType GetStartType() const;
String GetDocPath() const;
- sal_Bool GetStartWithFlag() const;
+ bool GetStartWithFlag() const;
- sal_Bool IsDocEmpty() const;
+ bool IsDocEmpty() const;
String GetPassword();
};
diff --git a/sd/source/ui/inc/dlgpage.hxx b/sd/source/ui/inc/dlgpage.hxx
index 0e6408dd0a27..f5c4a80b2aac 100644
--- a/sd/source/ui/inc/dlgpage.hxx
+++ b/sd/source/ui/inc/dlgpage.hxx
@@ -54,7 +54,7 @@ private:
XBitmapList* mpBitmapList;
public:
- SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage = sal_True );
+ SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, bool bAreaPage = true );
~SdPageDlg() {};
virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage);
diff --git a/sd/source/ui/inc/dlgsnap.hxx b/sd/source/ui/inc/dlgsnap.hxx
index dc92bd6fc910..ad5dea77a587 100644
--- a/sd/source/ui/inc/dlgsnap.hxx
+++ b/sd/source/ui/inc/dlgsnap.hxx
@@ -89,7 +89,7 @@ public:
void HideRadioGroup();
void HideDeleteBtn() { aBtnDelete.Hide(); }
- void SetInputFields(sal_Bool bEnableX, sal_Bool bEnableY);
+ void SetInputFields(bool bEnableX, bool bEnableY);
};
diff --git a/sd/source/ui/inc/docprev.hxx b/sd/source/ui/inc/docprev.hxx
index e29f2ec5d2f4..8b7e96fe4a30 100644
--- a/sd/source/ui/inc/docprev.hxx
+++ b/sd/source/ui/inc/docprev.hxx
@@ -45,10 +45,10 @@ class SD_DLLPUBLIC SdDocPreviewWin : public Control, public SfxListener
{
protected:
GDIMetaFile* pMetaFile;
- sal_Bool bInEffect;
+ bool bInEffect;
Link aClickHdl;
SfxObjectShell* mpObj;
- sal_uInt16 mnShowPage;
+ sal_uInt32 mnShowPage;
Color maDocumentColor;
rtl::Reference< sd::SlideShow > mxSlideShow;
@@ -67,7 +67,7 @@ protected:
public:
SdDocPreviewWin( Window* pParent, const ResId& rResId );
~SdDocPreviewWin();
- void SetObjectShell( SfxObjectShell* pObj, sal_uInt16 nShowPage = 0 );
+ void SetObjectShell( SfxObjectShell* pObj, sal_uInt32 nShowPage = 0 );
virtual void Resize();
void startPreview();
diff --git a/sd/source/ui/inc/drawview.hxx b/sd/source/ui/inc/drawview.hxx
index 7b7e704606bf..4ddc0e11281c 100644
--- a/sd/source/ui/inc/drawview.hxx
+++ b/sd/source/ui/inc/drawview.hxx
@@ -45,34 +45,33 @@ class SlideShow;
class DrawView : public ::sd::View
{
public:
- TYPEINFO();
-
DrawView (
DrawDocShell* pDocSh,
OutputDevice* pOutDev,
DrawViewShell* pShell);
virtual ~DrawView (void);
- virtual void MarkListHasChanged();
+ virtual void handleSelectionChange();
void CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L);
- virtual sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll = sal_False);
+ virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false);
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- void BlockPageOrderChangedHint(sal_Bool bBlock);
+ void BlockPageOrderChangedHint(bool bBlock);
- sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr = sal_False);
- virtual sal_Bool IsObjMarkable(SdrObject* pObj, SdrPageView* pPV) const;
+ bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr = false);
+ virtual bool IsObjMarkable(const SdrObject& rObj) const;
- virtual void MakeVisible(const Rectangle& rRect, ::Window& rWin);
- virtual void HideSdrPage(); // SdrPageView* pPV);
+ virtual void MakeVisibleAtView(const basegfx::B2DRange& rRange, ::Window& rWin);
+ virtual void HideSdrPage();
void PresPaint(const Region& rRegion);
virtual void DeleteMarked(); // from SdrView
+
protected:
- virtual void ModelHasChanged();
+ virtual void LazyReactOnObjectChanges();
private:
friend class DrawViewRedirector;
diff --git a/sd/source/ui/inc/framework/Configuration.hxx b/sd/source/ui/inc/framework/Configuration.hxx
index 9be4198b154b..3350471ae3bb 100644
--- a/sd/source/ui/inc/framework/Configuration.hxx
+++ b/sd/source/ui/inc/framework/Configuration.hxx
@@ -77,9 +77,9 @@ public:
This broadcaster is typically the same as the one used by the
ConfigurationController.
@param bBroadcastRequestEvents
- When this is <TRUE/> then modifications to the configuration
+ When this is <true/> then modifications to the configuration
trigger the broadcasting of "ResourceActivationRequestEvent" and
- "ResourceDeactivationRequestEvent". When this flag is <FALSE/>
+ "ResourceDeactivationRequestEvent". When this flag is <false/>
then events with type "ResourceActivationEvent" and
"ResourceDeactivationEvent" are broadcasted.
*/
diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx
index 9c9c642b98a2..4395692b92d2 100644
--- a/sd/source/ui/inc/framework/FrameworkHelper.hxx
+++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx
@@ -168,7 +168,7 @@ public:
/** Test whether the called FrameworkHelper object is valid.
@return
- When the object has already been disposed then <FALSE/> is returned.
+ When the object has already been disposed then <false/> is returned.
*/
bool IsValid (void);
@@ -372,7 +372,7 @@ private:
@param rsEventType
Run rCallback only on this event.
@param rFilter
- This filter has to return <TRUE/> in order for rCallback to be
+ This filter has to return <true/> in order for rCallback to be
called.
@param rCallback
The callback functor to be called.
diff --git a/sd/source/ui/inc/framework/Pane.hxx b/sd/source/ui/inc/framework/Pane.hxx
index 7e85559f929d..167ba9585d6c 100644
--- a/sd/source/ui/inc/framework/Pane.hxx
+++ b/sd/source/ui/inc/framework/Pane.hxx
@@ -133,7 +133,7 @@ public:
throw (::com::sun::star::uno::RuntimeException);
/** For the typical pane it makes no sense to be dislayed without a
- view. Therefore this default implementation returns always <TRUE/>.
+ view. Therefore this default implementation returns always <true/>.
*/
virtual sal_Bool SAL_CALL isAnchorOnly (void)
throw (com::sun::star::uno::RuntimeException);
diff --git a/sd/source/ui/inc/framework/ResourceId.hxx b/sd/source/ui/inc/framework/ResourceId.hxx
index 42c03a56aad1..4ce54e0384fa 100644
--- a/sd/source/ui/inc/framework/ResourceId.hxx
+++ b/sd/source/ui/inc/framework/ResourceId.hxx
@@ -211,7 +211,7 @@ private:
present independently of psFirstAnchorURL.
@param eMode
This specifies whether the called resource has to be directly
- bound to the given anchor in order to return <TRUE/> or whether
+ bound to the given anchor in order to return <true/> or whether
it can be bound indirectly, too.
*/
bool IsBoundToAnchor (
@@ -225,7 +225,7 @@ private:
A possibly empty list of anchor URLs.
@param eMode
This specifies whether the called resource has to be directly
- bound to the given anchor in order to return <TRUE/> or whether
+ bound to the given anchor in order to return <true/> or whether
it can be bound indirectly, too.
*/
bool IsBoundToAnchor (
diff --git a/sd/source/ui/inc/fuarea.hxx b/sd/source/ui/inc/fuarea.hxx
index dbe528f9a0c3..689ea5ef33a1 100644
--- a/sd/source/ui/inc/fuarea.hxx
+++ b/sd/source/ui/inc/fuarea.hxx
@@ -31,8 +31,6 @@ namespace sd {
class FuArea : public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void Activate();
diff --git a/sd/source/ui/inc/fubullet.hxx b/sd/source/ui/inc/fubullet.hxx
index 4b2a656a2824..f051ca49a7fe 100644
--- a/sd/source/ui/inc/fubullet.hxx
+++ b/sd/source/ui/inc/fubullet.hxx
@@ -36,8 +36,6 @@ class ViewShell;
class FuBullet : public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuchar.hxx b/sd/source/ui/inc/fuchar.hxx
index 8e1bce657a2a..e8beeba6b86e 100644
--- a/sd/source/ui/inc/fuchar.hxx
+++ b/sd/source/ui/inc/fuchar.hxx
@@ -32,8 +32,6 @@ class FuChar
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fucon3d.hxx b/sd/source/ui/inc/fucon3d.hxx
index d875913b38b8..e58b09671798 100644
--- a/sd/source/ui/inc/fucon3d.hxx
+++ b/sd/source/ui/inc/fucon3d.hxx
@@ -37,22 +37,20 @@ class FuConstruct3dObject
: public FuConstruct
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
private:
FuConstruct3dObject (
diff --git a/sd/source/ui/inc/fuconarc.hxx b/sd/source/ui/inc/fuconarc.hxx
index df191838f672..d1e63a52083a 100644
--- a/sd/source/ui/inc/fuconarc.hxx
+++ b/sd/source/ui/inc/fuconarc.hxx
@@ -33,22 +33,20 @@ class FuConstructArc
: public FuConstruct
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
protected:
FuConstructArc (
diff --git a/sd/source/ui/inc/fuconbez.hxx b/sd/source/ui/inc/fuconbez.hxx
index 8aaf7844774f..40c51717137e 100644
--- a/sd/source/ui/inc/fuconbez.hxx
+++ b/sd/source/ui/inc/fuconbez.hxx
@@ -40,16 +40,14 @@ class FuConstructBezierPolygon
: public FuConstruct
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
@@ -60,7 +58,7 @@ public:
sal_uInt16 GetEditMode() { return nEditMode; }
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
protected:
FuConstructBezierPolygon (
diff --git a/sd/source/ui/inc/fuconcs.hxx b/sd/source/ui/inc/fuconcs.hxx
index a8895d443796..af905a04a258 100644
--- a/sd/source/ui/inc/fuconcs.hxx
+++ b/sd/source/ui/inc/fuconcs.hxx
@@ -44,23 +44,21 @@ class FuConstructCustomShape
: public FuConstruct
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
void SetAttributes( SdrObject* pObj );
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
// #i33136#
virtual bool doConstructOrthogonal() const;
diff --git a/sd/source/ui/inc/fuconnct.hxx b/sd/source/ui/inc/fuconnct.hxx
index b1353928b3fa..938ef53ca7a3 100644
--- a/sd/source/ui/inc/fuconnct.hxx
+++ b/sd/source/ui/inc/fuconnct.hxx
@@ -32,8 +32,6 @@ class FuConnectionDlg
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuconrec.hxx b/sd/source/ui/inc/fuconrec.hxx
index 8e55d6a84095..89439e565eb3 100644
--- a/sd/source/ui/inc/fuconrec.hxx
+++ b/sd/source/ui/inc/fuconrec.hxx
@@ -44,16 +44,14 @@ class FuConstructRectangle
: public FuConstruct
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
@@ -62,7 +60,7 @@ public:
void SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj);
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
protected:
FuConstructRectangle (
diff --git a/sd/source/ui/inc/fuconstr.hxx b/sd/source/ui/inc/fuconstr.hxx
index c4707e05edd5..6a5a8faf61cd 100644
--- a/sd/source/ui/inc/fuconstr.hxx
+++ b/sd/source/ui/inc/fuconstr.hxx
@@ -44,20 +44,18 @@ class FuConstruct
public:
static const int MIN_FREEHAND_DISTANCE = 10;
- TYPEINFO();
-
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
- virtual void SelectionHasChanged() { bSelectionChanged = sal_True; }
+ virtual void SelectionHasChanged() { bSelectionChanged = true; }
// SJ: setting stylesheet, the use of a filled or unfilled style
// is determined by the member nSlotId :
diff --git a/sd/source/ui/inc/fuconuno.hxx b/sd/source/ui/inc/fuconuno.hxx
index 861b1180aa1b..00eb03fa57c2 100644
--- a/sd/source/ui/inc/fuconuno.hxx
+++ b/sd/source/ui/inc/fuconuno.hxx
@@ -39,22 +39,20 @@ class FuConstructUnoControl
: public FuConstruct
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
protected:
FuConstructUnoControl(
diff --git a/sd/source/ui/inc/fucopy.hxx b/sd/source/ui/inc/fucopy.hxx
index a579a9146da0..b82b6fe94041 100644
--- a/sd/source/ui/inc/fucopy.hxx
+++ b/sd/source/ui/inc/fucopy.hxx
@@ -32,8 +32,6 @@ class FuCopy
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fucushow.hxx b/sd/source/ui/inc/fucushow.hxx
index 468380222650..a4bcd22dd591 100644
--- a/sd/source/ui/inc/fucushow.hxx
+++ b/sd/source/ui/inc/fucushow.hxx
@@ -32,8 +32,6 @@ class FuCustomShowDlg
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fudraw.hxx b/sd/source/ui/inc/fudraw.hxx
index 1957257ccf26..0a43cca0d0d4 100644
--- a/sd/source/ui/inc/fudraw.hxx
+++ b/sd/source/ui/inc/fudraw.hxx
@@ -44,13 +44,11 @@ class FuDraw
: public FuPoor
{
public:
- TYPEINFO();
-
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual sal_Bool RequestHelp(const HelpEvent& rHEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool RequestHelp(const HelpEvent& rHEvt);
virtual void ScrollStart();
virtual void ScrollEnd();
@@ -62,10 +60,10 @@ public:
virtual void DoubleClick(const MouseEvent& rMEvt);
- sal_Bool SetPointer(SdrObject* pObj, const Point& rPos);
- sal_Bool SetHelpText(SdrObject* pObj, const Point& rPos, const SdrViewEvent& rVEvt);
+ bool SetPointer(SdrObject* pObj, const basegfx::B2DPoint& rPos);
+ bool SetHelpText(SdrObject* pObj, const Point& rPos, const SdrViewEvent& rVEvt);
- void SetPermanent(sal_Bool bSet) { bPermanent = bSet; }
+ void SetPermanent(bool bSet) { bPermanent = bSet; }
/** is called when the currenct function should be aborted. <p>
This is used when a function gets a KEY_ESCAPE but can also
@@ -86,11 +84,10 @@ protected:
Pointer aNewPointer;
Pointer aOldPointer;
- sal_Bool bMBDown;
- sal_Bool bDragHelpLine;
- sal_uInt16 nHelpLine;
- sal_Bool bPermanent;
-
+ bool bMBDown;
+ bool bDragHelpLine;
+ sal_uInt32 nHelpLine;
+ bool bPermanent;
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/fudspord.hxx b/sd/source/ui/inc/fudspord.hxx
index 30825a831532..fd2e6cc424cb 100644
--- a/sd/source/ui/inc/fudspord.hxx
+++ b/sd/source/ui/inc/fudspord.hxx
@@ -43,14 +43,12 @@ class FuDisplayOrder
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
diff --git a/sd/source/ui/inc/fuediglu.hxx b/sd/source/ui/inc/fuediglu.hxx
index 55cd37c29ea1..03302a068389 100644
--- a/sd/source/ui/inc/fuediglu.hxx
+++ b/sd/source/ui/inc/fuediglu.hxx
@@ -25,6 +25,7 @@
#define SD_FU_EDIT_GLUE_POINTS_HXX
#include "fudraw.hxx"
+#include <svx/svdview.hxx>
namespace sd {
@@ -38,17 +39,15 @@ class FuEditGluePoints
: public FuDraw
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual sal_Bool Command(const CommandEvent& rCEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool Command(const CommandEvent& rCEvt);
virtual void ReceiveRequest(SfxRequest& rReq);
virtual void Activate(); // Function aktivieren
@@ -62,6 +61,8 @@ protected:
SdDrawDocument* pDoc,
SfxRequest& rReq);
virtual ~FuEditGluePoints (void);
+
+ SdrViewEditMode meLastSdrViewEditMode;
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/fuexpand.hxx b/sd/source/ui/inc/fuexpand.hxx
index e1154ab96fbf..9f34d637e2bc 100644
--- a/sd/source/ui/inc/fuexpand.hxx
+++ b/sd/source/ui/inc/fuexpand.hxx
@@ -32,8 +32,6 @@ class FuExpandPage
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuformatpaintbrush.hxx b/sd/source/ui/inc/fuformatpaintbrush.hxx
index 7d190f860b25..35d00d54d8e0 100644
--- a/sd/source/ui/inc/fuformatpaintbrush.hxx
+++ b/sd/source/ui/inc/fuformatpaintbrush.hxx
@@ -37,14 +37,12 @@ class DrawViewShell;
class FuFormatPaintBrush : public FuText
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
virtual void Activate();
virtual void Deactivate();
@@ -57,7 +55,7 @@ private:
void DoExecute( SfxRequest& rReq );
- bool HasContentForThisType( sal_uInt32 nObjectInventor, sal_uInt16 nObjectIdentifier ) const;
+ bool HasContentForThisType(const SdrObject& rSdrObject) const;
void Paste( bool, bool );
void implcancel();
diff --git a/sd/source/ui/inc/fugrid.hxx b/sd/source/ui/inc/fugrid.hxx
index 825b10f1dfcb..6117f019efd4 100644
--- a/sd/source/ui/inc/fugrid.hxx
+++ b/sd/source/ui/inc/fugrid.hxx
@@ -32,8 +32,6 @@ class FuGrid
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void Activate();
diff --git a/sd/source/ui/inc/fuhhconv.hxx b/sd/source/ui/inc/fuhhconv.hxx
index 01d635d438d5..f3cb094e58d0 100644
--- a/sd/source/ui/inc/fuhhconv.hxx
+++ b/sd/source/ui/inc/fuhhconv.hxx
@@ -36,12 +36,10 @@ class Outliner;
class FuHangulHanjaConversion : public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
void StartConversion( sal_Int16 nSourceLanguage, sal_Int16 nTargetLanguage,
- const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive );
+ const Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
void StartChineseConversion();
@@ -53,7 +51,7 @@ class FuHangulHanjaConversion : public FuPoor
~FuHangulHanjaConversion();
Outliner* pSdOutliner;
- sal_Bool bOwnOutliner;
+ bool bOwnOutliner;
private:
FuHangulHanjaConversion (
diff --git a/sd/source/ui/inc/fuinsert.hxx b/sd/source/ui/inc/fuinsert.hxx
index b09b0c66a703..fd2348ccea71 100644
--- a/sd/source/ui/inc/fuinsert.hxx
+++ b/sd/source/ui/inc/fuinsert.hxx
@@ -32,8 +32,6 @@ class FuInsertGraphic
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
@@ -54,8 +52,6 @@ class FuInsertClipboard
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
@@ -75,8 +71,6 @@ class FuInsertOLE
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
@@ -95,8 +89,6 @@ class FuInsertAVMedia
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuinsfil.hxx b/sd/source/ui/inc/fuinsfil.hxx
index 0f379713d450..93c47890d104 100644
--- a/sd/source/ui/inc/fuinsfil.hxx
+++ b/sd/source/ui/inc/fuinsfil.hxx
@@ -36,8 +36,6 @@ class FuInsertFile
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
@@ -56,9 +54,9 @@ private:
String aFile; // gewaehlter Dateiname
void InsTextOrRTFinOlMode(SfxMedium* pMedium);
- sal_Bool InsSDDinOlMode(SfxMedium* pMedium);
+ bool InsSDDinOlMode(SfxMedium* pMedium);
void InsTextOrRTFinDrMode(SfxMedium* pMedium);
- sal_Bool InsSDDinDrMode(SfxMedium* pMedium);
+ bool InsSDDinDrMode(SfxMedium* pMedium);
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/fuline.hxx b/sd/source/ui/inc/fuline.hxx
index 2982f112b3ba..d8f938f0ee52 100644
--- a/sd/source/ui/inc/fuline.hxx
+++ b/sd/source/ui/inc/fuline.hxx
@@ -32,8 +32,6 @@ class FuLine
: public FuPoor
{
public:
- TYPEINFO();
-
virtual void Activate();
virtual void Deactivate();
diff --git a/sd/source/ui/inc/fulinend.hxx b/sd/source/ui/inc/fulinend.hxx
index 1e0f4f1f9563..5d7f7e4db43f 100644
--- a/sd/source/ui/inc/fulinend.hxx
+++ b/sd/source/ui/inc/fulinend.hxx
@@ -32,8 +32,6 @@ class FuLineEnd
: public FuPoor
{
public:
- TYPEINFO();
-
virtual void Activate();
virtual void Deactivate();
diff --git a/sd/source/ui/inc/fulink.hxx b/sd/source/ui/inc/fulink.hxx
index 670c89e138ce..c1249329131e 100644
--- a/sd/source/ui/inc/fulink.hxx
+++ b/sd/source/ui/inc/fulink.hxx
@@ -32,8 +32,6 @@ class FuLink
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fumeasur.hxx b/sd/source/ui/inc/fumeasur.hxx
index 445bd47567da..2be5a42bc86e 100644
--- a/sd/source/ui/inc/fumeasur.hxx
+++ b/sd/source/ui/inc/fumeasur.hxx
@@ -32,8 +32,6 @@ class FuMeasureDlg
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fumorph.hxx b/sd/source/ui/inc/fumorph.hxx
index 0999a3c26db1..b1fde27bb912 100644
--- a/sd/source/ui/inc/fumorph.hxx
+++ b/sd/source/ui/inc/fumorph.hxx
@@ -44,8 +44,6 @@ class FuMorph
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
@@ -57,7 +55,7 @@ private:
SdDrawDocument* pDoc,
SfxRequest& rReq);
- void ImpInsertPolygons(List& rPolyPolyList3D, sal_Bool bAttributeFade,
+ void ImpInsertPolygons(List& rPolyPolyList3D, bool bAttributeFade,
const SdrObject* pObj1, const SdrObject* pObj2);
::basegfx::B2DPolyPolygon* ImpCreateMorphedPolygon(
const ::basegfx::B2DPolyPolygon& rPolyPolyStart,
diff --git a/sd/source/ui/inc/fuoaprms.hxx b/sd/source/ui/inc/fuoaprms.hxx
index 26d4205442c6..7651c473dc7d 100644
--- a/sd/source/ui/inc/fuoaprms.hxx
+++ b/sd/source/ui/inc/fuoaprms.hxx
@@ -32,8 +32,6 @@ class FuObjectAnimationParameters
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuolbull.hxx b/sd/source/ui/inc/fuolbull.hxx
index d7683506b357..bf0f737f804a 100644
--- a/sd/source/ui/inc/fuolbull.hxx
+++ b/sd/source/ui/inc/fuolbull.hxx
@@ -45,8 +45,6 @@ class FuOutlineBullet
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuoltext.hxx b/sd/source/ui/inc/fuoltext.hxx
index dcb0da440dd4..f15a361cacbe 100644
--- a/sd/source/ui/inc/fuoltext.hxx
+++ b/sd/source/ui/inc/fuoltext.hxx
@@ -44,14 +44,12 @@ class FuOutlineText
: public FuOutline
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void DoCut();
virtual void DoCopy();
diff --git a/sd/source/ui/inc/fuoutl.hxx b/sd/source/ui/inc/fuoutl.hxx
index 9b62b219244e..74b8646de1d0 100644
--- a/sd/source/ui/inc/fuoutl.hxx
+++ b/sd/source/ui/inc/fuoutl.hxx
@@ -48,9 +48,7 @@ class FuOutline
: public FuPoor
{
public:
- TYPEINFO();
-
- virtual sal_Bool Command(const CommandEvent& rCEvt);
+ virtual bool Command(const CommandEvent& rCEvt);
virtual void ScrollStart();
virtual void ScrollEnd();
diff --git a/sd/source/ui/inc/fupage.hxx b/sd/source/ui/inc/fupage.hxx
index db64b806754e..1903581d9d23 100644
--- a/sd/source/ui/inc/fupage.hxx
+++ b/sd/source/ui/inc/fupage.hxx
@@ -25,6 +25,7 @@
#define SD_FU_PAGE_HXX
#include "fupoor.hxx"
+#include <basegfx/vector/b2dvector.hxx>
class SfxItemSet;
class SdBackgroundObjUndoAction;
@@ -37,8 +38,6 @@ class FuPage
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
@@ -63,7 +62,7 @@ private:
SfxRequest& mrReq;
const SfxItemSet* mpArgs;
SdBackgroundObjUndoAction* mpBackgroundObjUndoAction;
- Size maSize;
+ basegfx::B2DVector maSize;
bool mbPageBckgrdDeleted;
bool mbMasterPage;
bool mbDisplayBackgroundTabPage;
diff --git a/sd/source/ui/inc/fuparagr.hxx b/sd/source/ui/inc/fuparagr.hxx
index bc39a0f91331..99dd67c65e32 100644
--- a/sd/source/ui/inc/fuparagr.hxx
+++ b/sd/source/ui/inc/fuparagr.hxx
@@ -32,8 +32,6 @@ class FuParagraph
: public FuPoor
{
public:
- TYPEINFO();
-
virtual void Activate();
virtual void Deactivate();
diff --git a/sd/source/ui/inc/fupoor.hxx b/sd/source/ui/inc/fupoor.hxx
index a7e9ac8bb8fd..2687071379fa 100644
--- a/sd/source/ui/inc/fupoor.hxx
+++ b/sd/source/ui/inc/fupoor.hxx
@@ -24,12 +24,12 @@
#ifndef SD_FU_POOR_HXX
#define SD_FU_POOR_HXX
-#include <tools/rtti.hxx>
#include <vcl/timer.hxx>
#include <tools/link.hxx>
#include <tools/gen.hxx>
#include <vcl/event.hxx>
#include <rtl/ref.hxx>
+#include <basegfx/point/b2dpoint.hxx>
#ifndef _SALHELPER_SIMPLEREFERENCECOMPONENT_HXX_
#include "helper/simplereferencecomponent.hxx"
@@ -39,6 +39,7 @@ class SdDrawDocument;
class SfxRequest;
class Dialog;
class SdrObject;
+namespace basegfx { class B2DRange; }
namespace sd {
@@ -59,8 +60,6 @@ public:
static const int HITPIX = 2; // Hit-Toleranz in Pixel
static const int DRGPIX = 2; // Drag MinMove in Pixel
- TYPEINFO();
-
virtual void DoExecute( SfxRequest& rReq );
// #95491# see member
@@ -74,16 +73,16 @@ public:
virtual void DoCopy();
virtual void DoPaste();
- // Mouse- & Key-Events; Returnwert=sal_True: Event wurde bearbeitet
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& );
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
+ // Mouse- & Key-Events; Returnwert=true: Event wurde bearbeitet
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& );
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
// #95491# moved from inline to *.cxx
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual sal_Bool Command(const CommandEvent& rCEvt);
- virtual sal_Bool RequestHelp(const HelpEvent& rHEvt);
+ virtual bool Command(const CommandEvent& rCEvt);
+ virtual bool RequestHelp(const HelpEvent& rHEvt);
virtual void Paint(const Rectangle&, ::sd::Window* );
virtual void ReceiveRequest(SfxRequest& rReq);
@@ -94,20 +93,18 @@ public:
virtual void ScrollEnd() {} // ForceScroll aufgerufen
void SetWindow(::sd::Window* pWin) { mpWindow = pWin; }
-
- // #97016# II
virtual void SelectionHasChanged();
sal_uInt16 GetSlotID() const { return( nSlotId ); }
sal_uInt16 GetSlotValue() const { return( nSlotValue ); }
- void SetNoScrollUntilInside(sal_Bool bNoScroll = sal_True)
+ void SetNoScrollUntilInside(bool bNoScroll = true)
{ bNoScrollUntilInside = bNoScroll; }
void StartDelayToScrollTimer ();
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
/** is called when the currenct function should be aborted. <p>
This is used when a function gets a KEY_ESCAPE but can also
@@ -141,7 +138,7 @@ protected:
DECL_LINK( DelayHdl, Timer * );
- void ImpForceQuadratic(Rectangle& rRect);
+ void ImpForceQuadratic(basegfx::B2DRange& rRange);
/** Switch to another layer. The layer to switch to is specified by an
offset relative to the active layer. With respect to the layer bar
@@ -174,23 +171,23 @@ protected:
Timer aScrollTimer; // fuer Autoscrolling
DECL_LINK( ScrollHdl, Timer * );
- void ForceScroll(const Point& aPixPos);
+ void ForceScroll(const basegfx::B2DPoint& aPixPos);
Timer aDragTimer; // fuer Drag&Drop
DECL_LINK( DragHdl, Timer * );
- sal_Bool bIsInDragMode;
- Point aMDPos; // Position von MouseButtonDown
+ bool bIsInDragMode;
+ basegfx::B2DPoint aMDPos; // Position von MouseButtonDown
// Flag, um AutoScrolling zu verhindern, bis von ausserhalb in das
// Fenster hinein gedragt wurde
- sal_Bool bNoScrollUntilInside;
+ bool bNoScrollUntilInside;
// Timer um das scrolling zu verzoegern, wenn aus dem fenster
// herausgedraggt wird (ca. 1 sec.)
Timer aDelayToScrollTimer; // fuer Verzoegerung bis scroll
- sal_Bool bScrollable;
- sal_Bool bDelayActive;
- sal_Bool bFirstMouseMove;
+ bool bScrollable;
+ bool bDelayActive;
+ bool bFirstMouseMove;
// #95491# member to hold state of the mouse buttons for creation
// of own MouseEvents (like in ScrollHdl)
diff --git a/sd/source/ui/inc/fuprlout.hxx b/sd/source/ui/inc/fuprlout.hxx
index aed0e88b0a69..fb3f5829fe34 100644
--- a/sd/source/ui/inc/fuprlout.hxx
+++ b/sd/source/ui/inc/fuprlout.hxx
@@ -40,8 +40,6 @@ class FuPresentationLayout
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuprobjs.hxx b/sd/source/ui/inc/fuprobjs.hxx
index e5735f4e7a14..25c24a7dbb30 100644
--- a/sd/source/ui/inc/fuprobjs.hxx
+++ b/sd/source/ui/inc/fuprobjs.hxx
@@ -40,8 +40,6 @@ class FuPresentationObjects
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuscale.hxx b/sd/source/ui/inc/fuscale.hxx
index aedd21bd1595..d2a39017b2da 100644
--- a/sd/source/ui/inc/fuscale.hxx
+++ b/sd/source/ui/inc/fuscale.hxx
@@ -32,8 +32,6 @@ class FuScale
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fusearch.hxx b/sd/source/ui/inc/fusearch.hxx
index 22aa8a260fba..bd6a0f2c8edb 100644
--- a/sd/source/ui/inc/fusearch.hxx
+++ b/sd/source/ui/inc/fusearch.hxx
@@ -36,8 +36,6 @@ class FuSearch
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
@@ -49,7 +47,7 @@ protected:
virtual ~FuSearch (void);
::sd::Outliner* pSdOutliner;
- sal_Bool bOwnOutliner;
+ bool bOwnOutliner;
private:
FuSearch (
diff --git a/sd/source/ui/inc/fusel.hxx b/sd/source/ui/inc/fusel.hxx
index ba7846008482..3106a71e1cb6 100644
--- a/sd/source/ui/inc/fusel.hxx
+++ b/sd/source/ui/inc/fusel.hxx
@@ -39,16 +39,14 @@ class FuSelection
: public FuDraw
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
@@ -58,7 +56,7 @@ public:
void SetEditMode(sal_uInt16 nMode);
sal_uInt16 GetEditMode() { return nEditMode; }
- sal_Bool AnimateObj(SdrObject* pObj, const Point& rPos);
+ bool AnimateObj(SdrObject* pObj, const basegfx::B2DPoint& rPos);
/** is called when the currenct function should be aborted. <p>
This is used when a function gets a KEY_ESCAPE but can also
@@ -77,12 +75,12 @@ protected:
virtual ~FuSelection();
- sal_Bool bTempRotation;
- sal_Bool bSelectionChanged;
- sal_Bool bHideAndAnimate;
+ bool bTempRotation;
+ bool bSelectionChanged;
+ bool bHideAndAnimate;
SdrHdl* pHdl;
- sal_Bool bSuppressChangesOfSelection;
- sal_Bool bMirrorSide0;
+ bool bSuppressChangesOfSelection;
+ bool bMirrorSide0;
sal_uInt16 nEditMode;
::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
@@ -99,7 +97,7 @@ private:
The shape at the test point. When there is no shape at this
position then NULL is returned.
*/
- SdrObject* pickObject (const Point& rTestPoint);
+ SdrObject* pickObject (const basegfx::B2DPoint& rTestPoint);
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/fusldlg.hxx b/sd/source/ui/inc/fusldlg.hxx
index da3876493da6..e19f1083bdda 100644
--- a/sd/source/ui/inc/fusldlg.hxx
+++ b/sd/source/ui/inc/fusldlg.hxx
@@ -32,8 +32,6 @@ class FuSlideShowDlg
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuslhide.hxx b/sd/source/ui/inc/fuslhide.hxx
index 37d1942e2f75..f2f7b117741e 100644
--- a/sd/source/ui/inc/fuslhide.hxx
+++ b/sd/source/ui/inc/fuslhide.hxx
@@ -38,8 +38,6 @@ class FuSlideHide
: public FuSlide
{
public:
- TYPEINFO();
-
static FunctionReference Create( SlideViewShell* pViewSh, ::sd::Window* pWin, SlideView* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuslid.hxx b/sd/source/ui/inc/fuslid.hxx
index bed1efb9b830..a7ed21dac7a7 100644
--- a/sd/source/ui/inc/fuslid.hxx
+++ b/sd/source/ui/inc/fuslid.hxx
@@ -45,13 +45,11 @@ class FuSlide
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( SlideViewShell* pViewSh, ::sd::Window* pWin, SlideView* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void ScrollStart();
virtual void ScrollEnd();
diff --git a/sd/source/ui/inc/fuslsel.hxx b/sd/source/ui/inc/fuslsel.hxx
index baadffe8fbb0..ee424f3db67d 100644
--- a/sd/source/ui/inc/fuslsel.hxx
+++ b/sd/source/ui/inc/fuslsel.hxx
@@ -38,8 +38,8 @@ class Window;
struct FSS_IsShowingEffectInfo
{
- sal_Bool bIsShowingEffect; // sal_True while we show a fade effect one the slide view
- sal_Bool bDisposed; // sal_True if the FuSlideSelection was deleted during fade effect
+ bool bIsShowingEffect; // true while we show a fade effect one the slide view
+ bool bDisposed; // true if the FuSlideSelection was deleted during fade effect
};
@@ -47,16 +47,14 @@ class FuSlideSelection
: public FuSlide
{
public:
- TYPEINFO();
-
static FunctionReference Create( SlideViewShell* pViewSh, ::sd::Window* pWin, SlideView* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin);
virtual void Activate(); // Function aktivieren
@@ -65,7 +63,7 @@ public:
virtual void ScrollStart();
virtual void ScrollEnd();
- sal_Bool IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; }
+ bool IsShowingEffect() const { return pIsShowingEffectInfo && pIsShowingEffectInfo->bIsShowingEffect; }
/** is called when the currenct function should be aborted. <p>
This is used when a function gets a KEY_ESCAPE but can also
@@ -85,17 +83,17 @@ protected:
virtual ~FuSlideSelection (void);
private:
- sal_Bool bSubstShown;
- sal_Bool bPageHit;
+ bool bSubstShown;
+ bool bPageHit;
List aSubstList; // Liste mit Ertsatzdarstellungen
Point aDragPos; // hier wird die Seite angefasst
- sal_Bool bDragSelection;
+ bool bDragSelection;
Point aDragSelRectAnchor; // fester Punkt des Selektionsrechtecks
Rectangle aDragSelRect;
Point aPosOfInsertMarker;
FSS_IsShowingEffectInfo* pIsShowingEffectInfo;
- void DrawInsertMarker(sal_Bool bShow);
+ void DrawInsertMarker(bool bShow);
Point CalcPosOfInsertMarker(const Point& rPoint);
sal_uInt16 GetTargetPage(const Point& rPoint) const;
diff --git a/sd/source/ui/inc/fusnapln.hxx b/sd/source/ui/inc/fusnapln.hxx
index a9e9a380eab2..6b91f3e199c6 100644
--- a/sd/source/ui/inc/fusnapln.hxx
+++ b/sd/source/ui/inc/fusnapln.hxx
@@ -32,8 +32,6 @@ class FuSnapLine
: public FuPoor
{
public:
- TYPEINFO();
-
virtual void Activate();
virtual void Deactivate();
diff --git a/sd/source/ui/inc/fusumry.hxx b/sd/source/ui/inc/fusumry.hxx
index a6c76635dacc..775565086e46 100644
--- a/sd/source/ui/inc/fusumry.hxx
+++ b/sd/source/ui/inc/fusumry.hxx
@@ -32,8 +32,6 @@ class FuSummaryPage
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/futempl.hxx b/sd/source/ui/inc/futempl.hxx
index 924327faba7e..0219623a0137 100644
--- a/sd/source/ui/inc/futempl.hxx
+++ b/sd/source/ui/inc/futempl.hxx
@@ -32,8 +32,6 @@ class FuTemplate
: public FuPoor
{
public:
- TYPEINFO();
-
virtual void Activate();
virtual void Deactivate();
diff --git a/sd/source/ui/inc/futext.hxx b/sd/source/ui/inc/futext.hxx
index 11dd97a582a1..738b37b8842c 100644
--- a/sd/source/ui/inc/futext.hxx
+++ b/sd/source/ui/inc/futext.hxx
@@ -48,31 +48,30 @@ class FuText
: public FuConstruct
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual sal_Bool Command(const CommandEvent& rCEvt);
- virtual sal_Bool RequestHelp(const HelpEvent& rHEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool Command(const CommandEvent& rCEvt);
+ virtual bool RequestHelp(const HelpEvent& rHEvt);
+
virtual void ReceiveRequest(SfxRequest& rReq);
virtual void DoubleClick(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
- void SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag);
- sal_Bool DeleteDefaultText();
+ void SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag);
+ bool DeleteDefaultText();
SdrTextObj* GetTextObj() { return static_cast< SdrTextObj* >( mxTextObj.get() ); }
DECL_LINK(SpellError, void* );
// #97016#
- virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
+ virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange);
/** is called when the currenct function should be aborted. <p>
This is used when a function gets a KEY_ESCAPE but can also
@@ -95,7 +94,7 @@ protected:
SdrObjectWeakRef mxTextObj;
Link aOldLink;
- sal_Bool bFirstObjCreated;
+ bool bFirstObjCreated;
SfxRequest& rRequest;
diff --git a/sd/source/ui/inc/futhes.hxx b/sd/source/ui/inc/futhes.hxx
index 613a33010836..b96599a6ed03 100644
--- a/sd/source/ui/inc/futhes.hxx
+++ b/sd/source/ui/inc/futhes.hxx
@@ -32,8 +32,6 @@ class FuThesaurus
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/futransf.hxx b/sd/source/ui/inc/futransf.hxx
index 8849a9fc3357..d9dacdbb017e 100644
--- a/sd/source/ui/inc/futransf.hxx
+++ b/sd/source/ui/inc/futransf.hxx
@@ -35,8 +35,6 @@ class FuTransform
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/futxtatt.hxx b/sd/source/ui/inc/futxtatt.hxx
index 694e202acd28..a023c3678c57 100644
--- a/sd/source/ui/inc/futxtatt.hxx
+++ b/sd/source/ui/inc/futxtatt.hxx
@@ -32,8 +32,6 @@ class FuTextAttrDlg
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuvect.hxx b/sd/source/ui/inc/fuvect.hxx
index c4730340bd2e..f30760c2a23f 100644
--- a/sd/source/ui/inc/fuvect.hxx
+++ b/sd/source/ui/inc/fuvect.hxx
@@ -32,8 +32,6 @@ class FuVectorize
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
virtual void DoExecute( SfxRequest& rReq );
diff --git a/sd/source/ui/inc/fuzoom.hxx b/sd/source/ui/inc/fuzoom.hxx
index 335eeab03fdc..786dc01006f6 100644
--- a/sd/source/ui/inc/fuzoom.hxx
+++ b/sd/source/ui/inc/fuzoom.hxx
@@ -28,6 +28,7 @@
#include <vcl/pointr.hxx>
#endif
#include "fupoor.hxx"
+#include <basegfx/range/b2drange.hxx>
namespace sd {
@@ -37,14 +38,12 @@ class FuZoom
: public FuPoor
{
public:
- TYPEINFO();
-
static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
// Mouse- & Key-Events
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
@@ -52,13 +51,15 @@ public:
protected:
virtual ~FuZoom (void);
- Point aBeginPosPix;
- Point aBeginPos;
- Point aEndPos;
- Rectangle aZoomRect;
- sal_Bool bVisible;
- sal_Bool bStartDrag;
- Pointer aPtr;
+ basegfx::B2DPoint maBeginPosPixel;
+ basegfx::B2DPoint maBeginPos;
+ basegfx::B2DPoint maEndPos;
+ basegfx::B2DRange maZoomRange;
+ Pointer maPtr;
+
+ /// bitfield
+ bool mbVisible : 1;
+ bool mbStartDrag : 1;
private:
FuZoom (
diff --git a/sd/source/ui/inc/ins_paste.hxx b/sd/source/ui/inc/ins_paste.hxx
index 723331341010..7e448555c48e 100644
--- a/sd/source/ui/inc/ins_paste.hxx
+++ b/sd/source/ui/inc/ins_paste.hxx
@@ -49,7 +49,7 @@ public:
SdInsertPasteDlg( Window* pWindow );
~SdInsertPasteDlg();
- sal_Bool IsInsertBefore() const;
+ bool IsInsertBefore() const;
};
#endif // _SD_INS_PASTE_HXX_
diff --git a/sd/source/ui/inc/inspagob.hxx b/sd/source/ui/inc/inspagob.hxx
index 73e5d8e918e1..9c4fafff05cc 100644
--- a/sd/source/ui/inc/inspagob.hxx
+++ b/sd/source/ui/inc/inspagob.hxx
@@ -59,8 +59,8 @@ public:
~SdInsertPagesObjsDlg();
List* GetList( sal_uInt16 nType );
- sal_Bool IsLink();
- sal_Bool IsRemoveUnnessesaryMasterPages() const;
+ bool IsLink();
+ bool IsRemoveUnnessesaryMasterPages() const;
};
diff --git a/sd/source/ui/inc/masterlayoutdlg.hxx b/sd/source/ui/inc/masterlayoutdlg.hxx
index 43d6962d7019..042a613c776d 100644
--- a/sd/source/ui/inc/masterlayoutdlg.hxx
+++ b/sd/source/ui/inc/masterlayoutdlg.hxx
@@ -52,10 +52,10 @@ private:
OKButton maPBOK;
CancelButton maPBCancel;
- sal_Bool mbOldHeader;
- sal_Bool mbOldFooter;
- sal_Bool mbOldDate;
- sal_Bool mbOldPageNumber;
+ bool mbOldHeader;
+ bool mbOldFooter;
+ bool mbOldDate;
+ bool mbOldPageNumber;
void applyChanges();
void remove( PresObjKind eKind );
diff --git a/sd/source/ui/inc/morphdlg.hxx b/sd/source/ui/inc/morphdlg.hxx
index b194b561d2e4..240790d62234 100644
--- a/sd/source/ui/inc/morphdlg.hxx
+++ b/sd/source/ui/inc/morphdlg.hxx
@@ -52,8 +52,8 @@ public:
void SaveSettings() const;
sal_uInt16 GetFadeSteps() const { return (sal_uInt16) aMtfSteps.GetValue(); }
- sal_Bool IsAttributeFade() const { return aCbxAttributes.IsChecked(); }
- sal_Bool IsOrientationFade() const { return aCbxOrientation.IsChecked(); }
+ bool IsAttributeFade() const { return aCbxAttributes.IsChecked(); }
+ bool IsOrientationFade() const { return aCbxOrientation.IsChecked(); }
private:
FixedLine aGrpPreset;
diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx
index 4967b7dbdd84..8bc7d1fa5ed7 100644
--- a/sd/source/ui/inc/navigatr.hxx
+++ b/sd/source/ui/inc/navigatr.hxx
@@ -69,16 +69,16 @@ class NavDocInfo
public:
NavDocInfo() { mpDocShell = NULL; }
- sal_Bool HasName() { return( (sal_Bool) bName ); }
- sal_Bool IsActive() { return( (sal_Bool) bActive ); }
+ bool HasName() { return( bName ); }
+ bool IsActive() { return( bActive ); }
- void SetName( sal_Bool bOn = sal_True ) { bName = bOn; }
- void SetActive( sal_Bool bOn = sal_True ) { bActive = bOn; }
+ void SetName( bool bOn = true ) { bName = bOn; }
+ void SetActive( bool bOn = true ) { bActive = bOn; }
private:
friend class SdNavigatorWin;
- sal_Bool bName : 1;
- sal_Bool bActive : 1;
+ bool bName : 1;
+ bool bActive : 1;
::sd::DrawDocShell* mpDocShell;
};
@@ -100,7 +100,7 @@ public:
void InitTreeLB( const SdDrawDocument* pDoc );
void RefreshDocumentLB( const String* pDocName = NULL );
- sal_Bool InsertFile(const String& rFileName);
+ bool InsertFile(const String& rFileName);
NavigatorDragType GetNavigatorDragType();
void SetNavigatorDragType(NavigatorDragType eType) { meDragType = eType; }
@@ -123,7 +123,7 @@ private:
Size maSize;
Size maMinSize;
// Size maFltWinSize;
- sal_Bool mbDocImported;
+ bool mbDocImported;
String maDropFileName;
NavigatorDragType meDragType;
List* mpDocList;
@@ -139,7 +139,7 @@ private:
*/
bool mbShowAllShapes;
- sal_uInt16 GetDragTypeSdResId( NavigatorDragType eDT, sal_Bool bImage = sal_False );
+ sal_uInt16 GetDragTypeSdResId( NavigatorDragType eDT, bool bImage = false );
NavDocInfo* GetDocInfo();
DECL_LINK( GetFocusObjectsHdl, void * );
diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx
index 704aabc4a119..feacd51d82fa 100644
--- a/sd/source/ui/inc/optsitem.hxx
+++ b/sd/source/ui/inc/optsitem.hxx
@@ -100,8 +100,8 @@ private:
::rtl::OUString maSubTree;
SdOptionsItem* mpCfgItem;
sal_uInt16 mnConfigId;
- sal_Bool mbInit : 1;
- sal_Bool mbEnableModify : 1;
+ bool mbInit : 1;
+ bool mbEnableModify : 1;
SD_DLLPRIVATE void Commit( SdOptionsItem& rCfgItem ) const;
SD_DLLPRIVATE ::com::sun::star::uno::Sequence< ::rtl::OUString > GetPropertyNames() const;
@@ -114,8 +114,8 @@ protected:
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const = 0;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues ) = 0;
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const = 0;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues ) = 0;
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const = 0;
public:
@@ -125,7 +125,7 @@ public:
const ::rtl::OUString& GetSubTree() const { return maSubTree; }
sal_uInt16 GetConfigId() const { return mnConfigId; }
- void EnableModify( sal_Bool bModify ) { mbEnableModify = bModify; }
+ void EnableModify( bool bModify ) { mbEnableModify = bModify; }
void Store();
@@ -141,39 +141,39 @@ class SD_DLLPUBLIC SdOptionsLayout : public SdOptionsGeneric
{
private:
- sal_Bool bRuler : 1; // Layout/Display/Ruler
- sal_Bool bMoveOutline : 1; // Layout/Display/Contur
- sal_Bool bDragStripes : 1; // Layout/Display/Guide
- sal_Bool bHandlesBezier : 1; // Layout/Display/Bezier
- sal_Bool bHelplines : 1; // Layout/Display/Helpline
+ bool bRuler : 1; // Layout/Display/Ruler
+ bool bMoveOutline : 1; // Layout/Display/Contur
+ bool bDragStripes : 1; // Layout/Display/Guide
+ bool bHandlesBezier : 1; // Layout/Display/Bezier
+ bool bHelplines : 1; // Layout/Display/Helpline
sal_uInt16 nMetric; // Layout/Other/MeasureUnit
sal_uInt16 nDefTab; // Layout/Other/TabStop
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues );
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues );
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
public:
- SdOptionsLayout( sal_uInt16 nConfigId, sal_Bool bUseConfig );
+ SdOptionsLayout( sal_uInt16 nConfigId, bool bUseConfig );
virtual ~SdOptionsLayout() {}
- sal_Bool operator==( const SdOptionsLayout& rOpt ) const;
+ bool operator==( const SdOptionsLayout& rOpt ) const;
- sal_Bool IsRulerVisible() const { Init(); return (sal_Bool) bRuler; }
- sal_Bool IsMoveOutline() const { Init(); return (sal_Bool) bMoveOutline; }
- sal_Bool IsDragStripes() const { Init(); return (sal_Bool) bDragStripes; }
- sal_Bool IsHandlesBezier() const { Init(); return (sal_Bool) bHandlesBezier; }
- sal_Bool IsHelplines() const { Init(); return (sal_Bool) bHelplines; }
+ bool IsRulerVisible() const { Init(); return bRuler; }
+ bool IsMoveOutline() const { Init(); return bMoveOutline; }
+ bool IsDragStripes() const { Init(); return bDragStripes; }
+ bool IsHandlesBezier() const { Init(); return bHandlesBezier; }
+ bool IsHelplines() const { Init(); return bHelplines; }
sal_uInt16 GetMetric() const { Init(); return( ( 0xffff == nMetric ) ? (sal_uInt16)SfxModule::GetCurrentFieldUnit() : nMetric ); }
sal_uInt16 GetDefTab() const { Init(); return nDefTab; }
- void SetRulerVisible( sal_Bool bOn = sal_True ) { if( bRuler != bOn ) { OptionsChanged(); bRuler = bOn; } }
- void SetMoveOutline( sal_Bool bOn = sal_True ) { if( bMoveOutline != bOn ) { OptionsChanged(); bMoveOutline = bOn; } }
- void SetDragStripes( sal_Bool bOn = sal_True ) { if( bDragStripes != bOn ) { OptionsChanged(); bDragStripes = bOn; } }
- void SetHandlesBezier( sal_Bool bOn = sal_True ) { if( bHandlesBezier != bOn ) { OptionsChanged(); bHandlesBezier = bOn; } }
- void SetHelplines( sal_Bool bOn = sal_True ) { if( bHelplines != bOn ) { OptionsChanged(); bHelplines = bOn; } }
+ void SetRulerVisible( bool bOn = true ) { if( bRuler != bOn ) { OptionsChanged(); bRuler = bOn; } }
+ void SetMoveOutline( bool bOn = true ) { if( bMoveOutline != bOn ) { OptionsChanged(); bMoveOutline = bOn; } }
+ void SetDragStripes( bool bOn = true ) { if( bDragStripes != bOn ) { OptionsChanged(); bDragStripes = bOn; } }
+ void SetHandlesBezier( bool bOn = true ) { if( bHandlesBezier != bOn ) { OptionsChanged(); bHandlesBezier = bOn; } }
+ void SetHelplines( bool bOn = true ) { if( bHelplines != bOn ) { OptionsChanged(); bHelplines = bOn; } }
void SetMetric( sal_uInt16 nInMetric ) { if( nMetric != nInMetric ) { OptionsChanged(); nMetric = nInMetric; } }
void SetDefTab( sal_uInt16 nTab ) { if( nDefTab != nTab ) { OptionsChanged(); nDefTab = nTab; } }
};
@@ -207,15 +207,15 @@ private:
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues );
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues );
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
public:
- SdOptionsContents( sal_uInt16 nConfigId, sal_Bool bUseConfig );
+ SdOptionsContents( sal_uInt16 nConfigId, bool bUseConfig );
virtual ~SdOptionsContents() {}
- sal_Bool operator==( const SdOptionsContents& rOpt ) const;
+ bool operator==( const SdOptionsContents& rOpt ) const;
};
// -----------------------------------------------------------------------------
@@ -248,26 +248,26 @@ private:
sal_uLong nDefaultObjectSizeWidth;
sal_uLong nDefaultObjectSizeHeight;
- sal_Bool bStartWithTemplate : 1; // Misc/NewDoc/AutoPilot
- sal_Bool bMarkedHitMovesAlways : 1; // Misc/ObjectMoveable
- sal_Bool bMoveOnlyDragging : 1; // Currently, not in use !!!
- sal_Bool bCrookNoContortion : 1; // Misc/NoDistort
- sal_Bool bQuickEdit : 1; // Misc/TextObject/QuickEditing
- sal_Bool bMasterPageCache : 1; // Misc/BackgroundCache
- sal_Bool bDragWithCopy : 1; // Misc/CopyWhileMoving
- sal_Bool bPickThrough : 1; // Misc/TextObject/Selectable
- sal_Bool bBigHandles : 1; // Misc/BigHandles
- sal_Bool bDoubleClickTextEdit : 1; // Misc/DclickTextedit
- sal_Bool bClickChangeRotation : 1; // Misc/RotateClick
- sal_Bool bStartWithActualPage : 1; // Misc/Start/CurrentPage
- sal_Bool bSolidDragging : 1; // Misc/ModifyWithAttributes
- sal_Bool bSolidMarkHdl : 1; // /Misc/SimpleHandles
- sal_Bool bSummationOfParagraphs : 1; // misc/SummationOfParagraphs
+ bool bStartWithTemplate : 1; // Misc/NewDoc/AutoPilot
+ bool bMarkedHitMovesAlways : 1; // Misc/ObjectMoveable
+ bool bMoveOnlyDragging : 1; // Currently, not in use !!!
+ bool bCrookNoContortion : 1; // Misc/NoDistort
+ bool bQuickEdit : 1; // Misc/TextObject/QuickEditing
+ bool bMasterPageCache : 1; // Misc/BackgroundCache
+ bool bDragWithCopy : 1; // Misc/CopyWhileMoving
+ bool bPickThrough : 1; // Misc/TextObject/Selectable
+ bool bBigHandles : 1; // Misc/BigHandles
+ bool bDoubleClickTextEdit : 1; // Misc/DclickTextedit
+ bool bClickChangeRotation : 1; // Misc/RotateClick
+ bool bStartWithActualPage : 1; // Misc/Start/CurrentPage
+ bool bSolidDragging : 1; // Misc/ModifyWithAttributes
+ bool bSolidMarkHdl : 1; // /Misc/SimpleHandles
+ bool bSummationOfParagraphs : 1; // misc/SummationOfParagraphs
// #90356#
- sal_Bool bShowUndoDeleteWarning : 1; // Misc/ShowUndoDeleteWarning
+ bool bShowUndoDeleteWarning : 1; // Misc/ShowUndoDeleteWarning
// #i75315#
- sal_Bool bSlideshowRespectZOrder : 1; // Misc/SlideshowRespectZOrder
- sal_Bool bShowComments : 1; // Misc/ShowComments
+ bool bSlideshowRespectZOrder : 1; // Misc/SlideshowRespectZOrder
+ bool bShowComments : 1; // Misc/ShowComments
sal_Bool bPreviewNewEffects;
sal_Bool bPreviewChangedEffects;
@@ -289,31 +289,31 @@ private:
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues );
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues );
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
public:
- SdOptionsMisc( sal_uInt16 nConfigId, sal_Bool bUseConfig );
+ SdOptionsMisc( sal_uInt16 nConfigId, bool bUseConfig );
virtual ~SdOptionsMisc() {}
- sal_Bool operator==( const SdOptionsMisc& rOpt ) const;
-
- sal_Bool IsStartWithTemplate() const { Init(); return (sal_Bool) bStartWithTemplate; }
- sal_Bool IsMarkedHitMovesAlways() const { Init(); return (sal_Bool) bMarkedHitMovesAlways; }
- sal_Bool IsMoveOnlyDragging() const { Init(); return (sal_Bool) bMoveOnlyDragging; }
- sal_Bool IsCrookNoContortion() const { Init(); return (sal_Bool) bCrookNoContortion; }
- sal_Bool IsQuickEdit() const { Init(); return (sal_Bool) bQuickEdit; }
- sal_Bool IsMasterPagePaintCaching() const { Init(); return (sal_Bool) bMasterPageCache; }
- sal_Bool IsDragWithCopy() const { Init(); return (sal_Bool) bDragWithCopy; }
- sal_Bool IsPickThrough() const { Init(); return (sal_Bool) bPickThrough; }
- sal_Bool IsBigHandles() const { Init(); return (sal_Bool) bBigHandles; }
- sal_Bool IsDoubleClickTextEdit() const { Init(); return (sal_Bool) bDoubleClickTextEdit; }
- sal_Bool IsClickChangeRotation() const { Init(); return (sal_Bool) bClickChangeRotation; }
- sal_Bool IsStartWithActualPage() const { Init(); return (sal_Bool) bStartWithActualPage; }
- sal_Bool IsSolidDragging() const { Init(); return (sal_Bool) bSolidDragging; }
- sal_Bool IsSolidMarkHdl() const { Init(); return (sal_Bool) bSolidMarkHdl; }
- sal_Bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs != 0; };
+ bool operator==( const SdOptionsMisc& rOpt ) const;
+
+ bool IsStartWithTemplate() const { Init(); return bStartWithTemplate; }
+ bool IsMarkedHitMovesAlways() const { Init(); return bMarkedHitMovesAlways; }
+ bool IsMoveOnlyDragging() const { Init(); return bMoveOnlyDragging; }
+ bool IsCrookNoContortion() const { Init(); return bCrookNoContortion; }
+ bool IsQuickEdit() const { Init(); return bQuickEdit; }
+ bool IsMasterPagePaintCaching() const { Init(); return bMasterPageCache; }
+ bool IsDragWithCopy() const { Init(); return bDragWithCopy; }
+ bool IsPickThrough() const { Init(); return bPickThrough; }
+ bool IsBigHandles() const { Init(); return bBigHandles; }
+ bool IsDoubleClickTextEdit() const { Init(); return bDoubleClickTextEdit; }
+ bool IsClickChangeRotation() const { Init(); return bClickChangeRotation; }
+ bool IsStartWithActualPage() const { Init(); return bStartWithActualPage; }
+ bool IsSolidDragging() const { Init(); return bSolidDragging; }
+ bool IsSolidMarkHdl() const { Init(); return bSolidMarkHdl; }
+ bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs != 0; };
/** Return the currently selected printer independent layout mode.
@return
@@ -322,8 +322,8 @@ public:
*/
sal_uInt16 GetPrinterIndependentLayout() const { Init(); return mnPrinterIndependentLayout; };
// #90356#
- sal_Bool IsShowUndoDeleteWarning() const { Init(); return (sal_Bool) bShowUndoDeleteWarning; }
- sal_Bool IsSlideshowRespectZOrder() const { Init(); return (sal_Bool) bSlideshowRespectZOrder; }
+ bool IsShowUndoDeleteWarning() const { Init(); return bShowUndoDeleteWarning; }
+ bool IsSlideshowRespectZOrder() const { Init(); return bSlideshowRespectZOrder; }
// #97016#
sal_uLong GetDefaultObjectSizeWidth() const { Init(); return nDefaultObjectSizeWidth; }
sal_uLong GetDefaultObjectSizeHeight() const { Init(); return nDefaultObjectSizeHeight; }
@@ -341,19 +341,19 @@ public:
double GetPresentationPenWidth() const { Init(); return mnPenWidth; }
void SetPresentationPenWidth( double nPenWidth ) { if( mnPenWidth != nPenWidth ) { OptionsChanged(); mnPenWidth = nPenWidth; } }
- void SetStartWithTemplate( sal_Bool bOn = sal_True ) { if( bStartWithTemplate != bOn ) { OptionsChanged(); bStartWithTemplate = bOn; } }
- void SetMarkedHitMovesAlways( sal_Bool bOn = sal_True ) { if( bMarkedHitMovesAlways != bOn ) { OptionsChanged(); bMarkedHitMovesAlways = bOn; } }
- void SetMoveOnlyDragging( sal_Bool bOn = sal_True ) { if( bMoveOnlyDragging != bOn ) { OptionsChanged(); bMoveOnlyDragging = bOn; } }
- void SetCrookNoContortion( sal_Bool bOn = sal_True ) { if( bCrookNoContortion != bOn ) { OptionsChanged(); bCrookNoContortion = bOn; } }
- void SetQuickEdit( sal_Bool bOn = sal_True ) { if( bQuickEdit != bOn ) { OptionsChanged(); bQuickEdit = bOn; } }
- void SetMasterPagePaintCaching( sal_Bool bOn = sal_True ) { if( bMasterPageCache != bOn ) { OptionsChanged(); bMasterPageCache = bOn; } }
- void SetDragWithCopy( sal_Bool bOn = sal_True ) { if( bDragWithCopy != bOn ) { OptionsChanged(); bDragWithCopy = bOn; } }
- void SetPickThrough( sal_Bool bOn = sal_True ) { if( bPickThrough != bOn ) { OptionsChanged(); bPickThrough = bOn; } }
- void SetBigHandles( sal_Bool bOn = sal_True ) { if( bBigHandles != bOn ) { OptionsChanged(); bBigHandles = bOn; } }
- void SetDoubleClickTextEdit( sal_Bool bOn = sal_True ) { if( bDoubleClickTextEdit != bOn ) { OptionsChanged(); bDoubleClickTextEdit = bOn; } }
- void SetClickChangeRotation( sal_Bool bOn = sal_True ) { if( bClickChangeRotation != bOn ) { OptionsChanged(); bClickChangeRotation = bOn; } }
- void SetStartWithActualPage( sal_Bool bOn = sal_True ) { if( bStartWithActualPage != bOn ) { OptionsChanged(); bStartWithActualPage = bOn; } }
- void SetSummationOfParagraphs( sal_Bool bOn = sal_True ){ if ( bOn != bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
+ void SetStartWithTemplate( bool bOn = true ) { if( bStartWithTemplate != bOn ) { OptionsChanged(); bStartWithTemplate = bOn; } }
+ void SetMarkedHitMovesAlways( bool bOn = true ) { if( bMarkedHitMovesAlways != bOn ) { OptionsChanged(); bMarkedHitMovesAlways = bOn; } }
+ void SetMoveOnlyDragging( bool bOn = true ) { if( bMoveOnlyDragging != bOn ) { OptionsChanged(); bMoveOnlyDragging = bOn; } }
+ void SetCrookNoContortion( bool bOn = true ) { if( bCrookNoContortion != bOn ) { OptionsChanged(); bCrookNoContortion = bOn; } }
+ void SetQuickEdit( bool bOn = true ) { if( bQuickEdit != bOn ) { OptionsChanged(); bQuickEdit = bOn; } }
+ void SetMasterPagePaintCaching( bool bOn = true ) { if( bMasterPageCache != bOn ) { OptionsChanged(); bMasterPageCache = bOn; } }
+ void SetDragWithCopy( bool bOn = true ) { if( bDragWithCopy != bOn ) { OptionsChanged(); bDragWithCopy = bOn; } }
+ void SetPickThrough( bool bOn = true ) { if( bPickThrough != bOn ) { OptionsChanged(); bPickThrough = bOn; } }
+ void SetBigHandles( bool bOn = true ) { if( bBigHandles != bOn ) { OptionsChanged(); bBigHandles = bOn; } }
+ void SetDoubleClickTextEdit( bool bOn = true ) { if( bDoubleClickTextEdit != bOn ) { OptionsChanged(); bDoubleClickTextEdit = bOn; } }
+ void SetClickChangeRotation( bool bOn = true ) { if( bClickChangeRotation != bOn ) { OptionsChanged(); bClickChangeRotation = bOn; } }
+ void SetStartWithActualPage( bool bOn = true ) { if( bStartWithActualPage != bOn ) { OptionsChanged(); bStartWithActualPage = bOn; } }
+ void SetSummationOfParagraphs( bool bOn = true ){ if ( bOn != bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
/** Set the printer independent layout mode.
@param nOn
The default value is to switch printer independent layout on,
@@ -361,11 +361,11 @@ public:
values are reserved for future use.
*/
void SetPrinterIndependentLayout (sal_uInt16 nOn = 1 ){ if ( nOn != mnPrinterIndependentLayout ) { OptionsChanged(); mnPrinterIndependentLayout = nOn; } }
- void SetSolidDragging( sal_Bool bOn = sal_True ) { if( bSolidDragging != bOn ) { OptionsChanged(); bSolidDragging = bOn; } }
- void SetSolidMarkHdl( sal_Bool bOn = sal_True ) { if( bSolidMarkHdl != bOn ) { OptionsChanged(); bSolidMarkHdl = bOn; } }
+ void SetSolidDragging( bool bOn = true ) { if( bSolidDragging != bOn ) { OptionsChanged(); bSolidDragging = bOn; } }
+ void SetSolidMarkHdl( bool bOn = true ) { if( bSolidMarkHdl != bOn ) { OptionsChanged(); bSolidMarkHdl = bOn; } }
// #90356#
- void SetShowUndoDeleteWarning( sal_Bool bOn = sal_True ) { if( bShowUndoDeleteWarning != bOn ) { OptionsChanged(); bShowUndoDeleteWarning = bOn; } }
- void SetSlideshowRespectZOrder( sal_Bool bOn = sal_True ) { if( bSlideshowRespectZOrder != bOn ) { OptionsChanged(); bSlideshowRespectZOrder = bOn; } }
+ void SetShowUndoDeleteWarning( bool bOn = true ) { if( bShowUndoDeleteWarning != bOn ) { OptionsChanged(); bShowUndoDeleteWarning = bOn; } }
+ void SetSlideshowRespectZOrder( bool bOn = true ) { if( bSlideshowRespectZOrder != bOn ) { OptionsChanged(); bSlideshowRespectZOrder = bOn; } }
// #97016#
void SetDefaultObjectSizeWidth( sal_uLong nWidth ) { if( nDefaultObjectSizeWidth != nWidth ) { OptionsChanged(); nDefaultObjectSizeWidth = nWidth; } }
void SetDefaultObjectSizeHeight( sal_uLong nHeight ) { if( nDefaultObjectSizeHeight != nHeight ) { OptionsChanged(); nDefaultObjectSizeHeight = nHeight; } }
@@ -374,8 +374,8 @@ public:
void SetPreviewChangedEffects( sal_Bool bOn ) { if( bPreviewChangedEffects != bOn ) { OptionsChanged(); bPreviewChangedEffects = bOn; } }
void SetPreviewTransitions( sal_Bool bOn ) { if( bPreviewTransitions != bOn ) { OptionsChanged(); bPreviewTransitions = bOn; } }
- sal_Bool IsShowComments() const { Init(); return bShowComments; }
- void SetShowComments( sal_Bool bShow ) { if( bShowComments != bShow ) { OptionsChanged(); bShowComments = bShow; } }
+ bool IsShowComments() const { Init(); return bShowComments; }
+ void SetShowComments( bool bShow ) { if( bShowComments != bShow ) { OptionsChanged(); bShowComments = bShow; } }
};
// -----------------------------------------------------------------------------
@@ -406,13 +406,13 @@ class SD_DLLPUBLIC SdOptionsSnap : public SdOptionsGeneric
{
private:
- sal_Bool bSnapHelplines : 1; // Snap/Object/SnapLine
- sal_Bool bSnapBorder : 1; // Snap/Object/PageMargin
- sal_Bool bSnapFrame : 1; // Snap/Object/ObjectFrame
- sal_Bool bSnapPoints : 1; // Snap/Object/ObjectPoint
- sal_Bool bOrtho : 1; // Snap/Position/CreatingMoving
- sal_Bool bBigOrtho : 1; // Snap/Position/ExtendEdges
- sal_Bool bRotate : 1; // Snap/Position/Rotating
+ bool bSnapHelplines : 1; // Snap/Object/SnapLine
+ bool bSnapBorder : 1; // Snap/Object/PageMargin
+ bool bSnapFrame : 1; // Snap/Object/ObjectFrame
+ bool bSnapPoints : 1; // Snap/Object/ObjectPoint
+ bool bOrtho : 1; // Snap/Position/CreatingMoving
+ bool bBigOrtho : 1; // Snap/Position/ExtendEdges
+ bool bRotate : 1; // Snap/Position/Rotating
sal_Int16 nSnapArea; // Snap/Object/Range
sal_Int16 nAngle; // Snap/Position/RotatingValue
sal_Int16 nBezAngle; // Snap/Position/PointReduction
@@ -420,34 +420,34 @@ private:
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues );
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues );
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
public:
- SdOptionsSnap( sal_uInt16 nConfigId, sal_Bool bUseConfig );
+ SdOptionsSnap( sal_uInt16 nConfigId, bool bUseConfig );
virtual ~SdOptionsSnap() {}
- sal_Bool operator==( const SdOptionsSnap& rOpt ) const;
+ bool operator==( const SdOptionsSnap& rOpt ) const;
- sal_Bool IsSnapHelplines() const { Init(); return (sal_Bool) bSnapHelplines; }
- sal_Bool IsSnapBorder() const { Init(); return (sal_Bool) bSnapBorder; }
- sal_Bool IsSnapFrame() const { Init(); return (sal_Bool) bSnapFrame; }
- sal_Bool IsSnapPoints() const { Init(); return (sal_Bool) bSnapPoints; }
- sal_Bool IsOrtho() const { Init(); return (sal_Bool) bOrtho; }
- sal_Bool IsBigOrtho() const { Init(); return (sal_Bool) bBigOrtho; }
- sal_Bool IsRotate() const { Init(); return (sal_Bool) bRotate; }
+ bool IsSnapHelplines() const { Init(); return bSnapHelplines; }
+ bool IsSnapBorder() const { Init(); return bSnapBorder; }
+ bool IsSnapFrame() const { Init(); return bSnapFrame; }
+ bool IsSnapPoints() const { Init(); return bSnapPoints; }
+ bool IsOrtho() const { Init(); return bOrtho; }
+ bool IsBigOrtho() const { Init(); return bBigOrtho; }
+ bool IsRotate() const { Init(); return bRotate; }
sal_Int16 GetSnapArea() const { Init(); return nSnapArea; }
sal_Int16 GetAngle() const { Init(); return nAngle; }
sal_Int16 GetEliminatePolyPointLimitAngle() const { Init(); return nBezAngle; }
- void SetSnapHelplines( sal_Bool bOn = sal_True ) { if( bSnapHelplines != bOn ) { OptionsChanged(); bSnapHelplines = bOn; } }
- void SetSnapBorder( sal_Bool bOn = sal_True ) { if( bSnapBorder != bOn ) { OptionsChanged(); bSnapBorder = bOn; } }
- void SetSnapFrame( sal_Bool bOn = sal_True ) { if( bSnapFrame != bOn ) { OptionsChanged(); bSnapFrame = bOn; } }
- void SetSnapPoints( sal_Bool bOn = sal_True ) { if( bSnapPoints != bOn ) { OptionsChanged(); bSnapPoints = bOn; } }
- void SetOrtho( sal_Bool bOn = sal_True ) { if( bOrtho != bOn ) { OptionsChanged(); bOrtho = bOn; } }
- void SetBigOrtho( sal_Bool bOn = sal_True ) { if( bBigOrtho != bOn ) { OptionsChanged(); bBigOrtho = bOn; } }
- void SetRotate( sal_Bool bOn = sal_True ) { if( bRotate != bOn ) { OptionsChanged(); bRotate = bOn; } }
+ void SetSnapHelplines( bool bOn = true ) { if( bSnapHelplines != bOn ) { OptionsChanged(); bSnapHelplines = bOn; } }
+ void SetSnapBorder( bool bOn = true ) { if( bSnapBorder != bOn ) { OptionsChanged(); bSnapBorder = bOn; } }
+ void SetSnapFrame( bool bOn = true ) { if( bSnapFrame != bOn ) { OptionsChanged(); bSnapFrame = bOn; } }
+ void SetSnapPoints( bool bOn = true ) { if( bSnapPoints != bOn ) { OptionsChanged(); bSnapPoints = bOn; } }
+ void SetOrtho( bool bOn = true ) { if( bOrtho != bOn ) { OptionsChanged(); bOrtho = bOn; } }
+ void SetBigOrtho( bool bOn = true ) { if( bBigOrtho != bOn ) { OptionsChanged(); bBigOrtho = bOn; } }
+ void SetRotate( bool bOn = true ) { if( bRotate != bOn ) { OptionsChanged(); bRotate = bOn; } }
void SetSnapArea( sal_Int16 nIn ) { if( nSnapArea != nIn ) { OptionsChanged(); nSnapArea = nIn; } }
void SetAngle( sal_Int16 nIn ) { if( nAngle != nIn ) { OptionsChanged(); nAngle = nIn; } }
void SetEliminatePolyPointLimitAngle( sal_Int16 nIn ) { if( nBezAngle != nIn ) { OptionsChanged(); nBezAngle = nIn; } }
@@ -486,15 +486,15 @@ private:
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues );
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues );
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
public:
- SdOptionsZoom( sal_uInt16 nConfigId, sal_Bool bUseConfig );
+ SdOptionsZoom( sal_uInt16 nConfigId, bool bUseConfig );
virtual ~SdOptionsZoom() {}
- sal_Bool operator==( const SdOptionsZoom& rOpt ) const;
+ bool operator==( const SdOptionsZoom& rOpt ) const;
void GetScale( sal_Int32& rX, sal_Int32& rY ) const { Init(); rX = nX; rY = nY; }
void SetScale( sal_Int32 nInX, sal_Int32 nInY ) { if( nX != nInX || nY != nInY ) { OptionsChanged(); nX = nInX; nY = nInY; } }
@@ -511,16 +511,16 @@ class SdOptionsGrid : public SdOptionsGeneric, public SvxOptionsGrid
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues );
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues );
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
public:
- SdOptionsGrid( sal_uInt16 nConfigId, sal_Bool bUseConfig );
+ SdOptionsGrid( sal_uInt16 nConfigId, bool bUseConfig );
virtual ~SdOptionsGrid();
void SetDefaults();
- sal_Bool operator==( const SdOptionsGrid& rOpt ) const;
+ bool operator==( const SdOptionsGrid& rOpt ) const;
sal_uInt32 GetFldDrawX() const { Init(); return SvxOptionsGrid::GetFldDrawX(); }
sal_uInt32 GetFldDivisionX() const { Init(); return SvxOptionsGrid::GetFldDivisionX(); }
@@ -528,10 +528,10 @@ public:
sal_uInt32 GetFldDivisionY() const { Init(); return SvxOptionsGrid::GetFldDivisionY(); }
sal_uInt32 GetFldSnapX() const { Init(); return SvxOptionsGrid::GetFldSnapX(); }
sal_uInt32 GetFldSnapY() const { Init(); return SvxOptionsGrid::GetFldSnapY(); }
- sal_Bool IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
- sal_Bool IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
- sal_Bool IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
- sal_Bool IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
+ bool IsUseGridSnap() const { Init(); return SvxOptionsGrid::GetUseGridSnap(); }
+ bool IsSynchronize() const { Init(); return SvxOptionsGrid::GetSynchronize(); }
+ bool IsGridVisible() const { Init(); return SvxOptionsGrid::GetGridVisible(); }
+ bool IsEqualGrid() const { Init(); return SvxOptionsGrid::GetEqualGrid(); }
void SetFldDrawX( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFldDrawX() ) { OptionsChanged(); SvxOptionsGrid::SetFldDrawX( nSet ); } }
void SetFldDivisionX( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFldDivisionX() ) { OptionsChanged(); SvxOptionsGrid::SetFldDivisionX( nSet ); } }
@@ -539,10 +539,10 @@ public:
void SetFldDivisionY( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFldDivisionY() ) { OptionsChanged(); SvxOptionsGrid::SetFldDivisionY( nSet ); } }
void SetFldSnapX( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFldSnapX() ) { OptionsChanged(); SvxOptionsGrid::SetFldSnapX( nSet ); } }
void SetFldSnapY( sal_uInt32 nSet ) { if( nSet != SvxOptionsGrid::GetFldSnapY() ) { OptionsChanged(); SvxOptionsGrid::SetFldSnapY( nSet ); } }
- void SetUseGridSnap( sal_Bool bSet ) { if( bSet != SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet ); } }
- void SetSynchronize( sal_Bool bSet ) { if( bSet != SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet ); } }
- void SetGridVisible( sal_Bool bSet ) { if( bSet != SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet ); } }
- void SetEqualGrid( sal_Bool bSet ) { if( bSet != SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet ); } }
+ void SetUseGridSnap( bool bSet ) { if( bSet != SvxOptionsGrid::GetUseGridSnap() ) { OptionsChanged(); SvxOptionsGrid::SetUseGridSnap( bSet ); } }
+ void SetSynchronize( bool bSet ) { if( bSet != SvxOptionsGrid::GetSynchronize() ) { OptionsChanged(); SvxOptionsGrid::SetSynchronize( bSet ); } }
+ void SetGridVisible( bool bSet ) { if( bSet != SvxOptionsGrid::GetGridVisible() ) { OptionsChanged(); SvxOptionsGrid::SetGridVisible( bSet ); } }
+ void SetEqualGrid( bool bSet ) { if( bSet != SvxOptionsGrid::GetEqualGrid() ) { OptionsChanged(); SvxOptionsGrid::SetEqualGrid( bSet ); } }
};
// -----------------------------------------------
@@ -553,6 +553,7 @@ class SdOptionsGridItem : public SvxGridItem
public:
SdOptionsGridItem( sal_uInt16 nWhich, SdOptions* pOpts, ::sd::FrameView* pView = NULL );
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
void SetOptions( SdOptions* pOpts ) const;
};
@@ -564,83 +565,83 @@ class SD_DLLPUBLIC SdOptionsPrint : public SdOptionsGeneric
{
private:
- sal_Bool bDraw : 1; // Print/Content/Drawing
- sal_Bool bNotes : 1; // Print/Content/Note
- sal_Bool bHandout : 1; // Print/Content/Handout
- sal_Bool bOutline : 1; // Print/Content/Outline
- sal_Bool bDate : 1; // Print/Other/Date
- sal_Bool bTime : 1; // Print/Other/Time
- sal_Bool bPagename : 1; // Print/Other/PageName
- sal_Bool bHiddenPages : 1; // Print/Other/HiddenPage
- sal_Bool bPagesize : 1; // Print/Page/PageSize
- sal_Bool bPagetile : 1; // Print/Page/PageTile
- sal_Bool bWarningPrinter : 1; // These flags you get
- sal_Bool bWarningSize : 1; // from the common options,
- sal_Bool bWarningOrientation : 1; // currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
- sal_Bool bBooklet : 1; // Print/Page/Booklet
- sal_Bool bFront : 1; // Print/Page/BookletFront
- sal_Bool bBack : 1; // Print/Page/BookletFront
- sal_Bool bCutPage : 1; // NOT persistent !!!
- sal_Bool bPaperbin : 1; // Print/Other/FromPrinterSetup
- sal_Bool mbHandoutHorizontal : 1; // Order Page previews on Handout Pages horizontal
+ bool bDraw : 1; // Print/Content/Drawing
+ bool bNotes : 1; // Print/Content/Note
+ bool bHandout : 1; // Print/Content/Handout
+ bool bOutline : 1; // Print/Content/Outline
+ bool bDate : 1; // Print/Other/Date
+ bool bTime : 1; // Print/Other/Time
+ bool bPagename : 1; // Print/Other/PageName
+ bool bHiddenPages : 1; // Print/Other/HiddenPage
+ bool bPagesize : 1; // Print/Page/PageSize
+ bool bPagetile : 1; // Print/Page/PageTile
+ bool bWarningPrinter : 1; // These flags you get
+ bool bWarningSize : 1; // from the common options,
+ bool bWarningOrientation : 1; // currently org.openoffice.Office.Common.xml (class OfaMiscCfg ; sfx2/misccfg.hxx )
+ bool bBooklet : 1; // Print/Page/Booklet
+ bool bFront : 1; // Print/Page/BookletFront
+ bool bBack : 1; // Print/Page/BookletFront
+ bool bCutPage : 1; // NOT persistent !!!
+ bool bPaperbin : 1; // Print/Other/FromPrinterSetup
+ bool mbHandoutHorizontal : 1; // Order Page previews on Handout Pages horizontal
sal_uInt16 mnHandoutPages; // Number of page previews on handout page (only 1/2/4/6/9 are supported)
sal_uInt16 nQuality; // Print/Other/Quality
protected:
virtual void GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const;
- virtual sal_Bool ReadData( const ::com::sun::star::uno::Any* pValues );
- virtual sal_Bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
+ virtual bool ReadData( const ::com::sun::star::uno::Any* pValues );
+ virtual bool WriteData( ::com::sun::star::uno::Any* pValues ) const;
public:
- SdOptionsPrint( sal_uInt16 nConfigId, sal_Bool bUseConfig );
+ SdOptionsPrint( sal_uInt16 nConfigId, bool bUseConfig );
virtual ~SdOptionsPrint() {}
- sal_Bool operator==( const SdOptionsPrint& rOpt ) const;
-
- sal_Bool IsDraw() const { Init(); return (sal_Bool) bDraw; }
- sal_Bool IsNotes() const { Init(); return (sal_Bool) bNotes; }
- sal_Bool IsHandout() const { Init(); return (sal_Bool) bHandout; }
- sal_Bool IsOutline() const { Init(); return (sal_Bool) bOutline; }
- sal_Bool IsDate() const { Init(); return (sal_Bool) bDate; }
- sal_Bool IsTime() const { Init(); return (sal_Bool) bTime; }
- sal_Bool IsPagename() const { Init(); return (sal_Bool) bPagename; }
- sal_Bool IsHiddenPages() const { Init(); return (sal_Bool) bHiddenPages; }
- sal_Bool IsPagesize() const { Init(); return (sal_Bool) bPagesize; }
- sal_Bool IsPagetile() const { Init(); return (sal_Bool) bPagetile; }
- sal_Bool IsWarningPrinter() const { Init(); return (sal_Bool) bWarningPrinter; }
- sal_Bool IsWarningSize() const { Init(); return (sal_Bool) bWarningSize; }
- sal_Bool IsWarningOrientation() const { Init(); return (sal_Bool) bWarningOrientation; }
- sal_Bool IsBooklet() const { Init(); return (sal_Bool) bBooklet; }
- sal_Bool IsFrontPage() const { Init(); return (sal_Bool) bFront; }
- sal_Bool IsBackPage() const { Init(); return (sal_Bool) bBack; }
- sal_Bool IsCutPage() const { Init(); return (sal_Bool) bCutPage; }
- sal_Bool IsPaperbin() const { Init(); return (sal_Bool) bPaperbin; }
+ bool operator==( const SdOptionsPrint& rOpt ) const;
+
+ bool IsDraw() const { Init(); return bDraw; }
+ bool IsNotes() const { Init(); return bNotes; }
+ bool IsHandout() const { Init(); return bHandout; }
+ bool IsOutline() const { Init(); return bOutline; }
+ bool IsDate() const { Init(); return bDate; }
+ bool IsTime() const { Init(); return bTime; }
+ bool IsPagename() const { Init(); return bPagename; }
+ bool IsHiddenPages() const { Init(); return bHiddenPages; }
+ bool IsPagesize() const { Init(); return bPagesize; }
+ bool IsPagetile() const { Init(); return bPagetile; }
+ bool IsWarningPrinter() const { Init(); return bWarningPrinter; }
+ bool IsWarningSize() const { Init(); return bWarningSize; }
+ bool IsWarningOrientation() const { Init(); return bWarningOrientation; }
+ bool IsBooklet() const { Init(); return bBooklet; }
+ bool IsFrontPage() const { Init(); return bFront; }
+ bool IsBackPage() const { Init(); return bBack; }
+ bool IsCutPage() const { Init(); return bCutPage; }
+ bool IsPaperbin() const { Init(); return bPaperbin; }
sal_uInt16 GetOutputQuality() const { Init(); return nQuality; }
- sal_Bool IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal; }
+ bool IsHandoutHorizontal() const { Init(); return mbHandoutHorizontal; }
sal_uInt16 GetHandoutPages() const { Init(); return mnHandoutPages; }
- void SetDraw( sal_Bool bOn = sal_True ) { if( bDraw != bOn ) { OptionsChanged(); bDraw = bOn; } }
- void SetNotes( sal_Bool bOn = sal_True ) { if( bNotes != bOn ) { OptionsChanged(); bNotes = bOn; } }
- void SetHandout( sal_Bool bOn = sal_True ) { if( bHandout != bOn ) { OptionsChanged(); bHandout = bOn; } }
- void SetOutline( sal_Bool bOn = sal_True ) { if( bOutline != bOn ) { OptionsChanged(); bOutline = bOn; } }
- void SetDate( sal_Bool bOn = sal_True ) { if( bDate != bOn ) { OptionsChanged(); bDate = bOn; } }
- void SetTime( sal_Bool bOn = sal_True ) { if( bTime != bOn ) { OptionsChanged(); bTime = bOn; } }
- void SetPagename( sal_Bool bOn = sal_True ) { if( bPagename != bOn ) { OptionsChanged(); bPagename = bOn; } }
- void SetHiddenPages( sal_Bool bOn = sal_True ) { if( bHiddenPages != bOn ) { OptionsChanged(); bHiddenPages = bOn; } }
- void SetPagesize( sal_Bool bOn = sal_True ) { if( bPagesize != bOn ) { OptionsChanged(); bPagesize = bOn; } }
- void SetPagetile( sal_Bool bOn = sal_True ) { if( bPagetile != bOn ) { OptionsChanged(); bPagetile = bOn; } }
- void SetWarningPrinter( sal_Bool bOn = sal_True ) { if( bWarningPrinter != bOn ) { OptionsChanged(); bWarningPrinter = bOn; } }
- void SetWarningSize( sal_Bool bOn = sal_True ) { if( bWarningSize != bOn ) { OptionsChanged(); bWarningSize = bOn; } }
- void SetWarningOrientation( sal_Bool bOn = sal_True ) { if( bWarningOrientation != bOn ) { OptionsChanged(); bWarningOrientation = bOn; } }
- void SetBooklet( sal_Bool bOn = sal_True ) { if( bBooklet != bOn ) { OptionsChanged(); bBooklet = bOn; } }
- void SetFrontPage( sal_Bool bOn = sal_True ) { if( bFront != bOn ) { OptionsChanged(); bFront = bOn; } }
- void SetBackPage( sal_Bool bOn = sal_True ) { if( bBack != bOn ) { OptionsChanged(); bBack = bOn; } }
- void SetCutPage( sal_Bool bOn = sal_True ) { if( bCutPage != bOn ) { OptionsChanged(); bCutPage = bOn; } }
- void SetPaperbin( sal_Bool bOn = sal_True ) { if( bPaperbin != bOn ) { OptionsChanged(); bPaperbin = bOn; } }
+ void SetDraw( bool bOn = true ) { if( bDraw != bOn ) { OptionsChanged(); bDraw = bOn; } }
+ void SetNotes( bool bOn = true ) { if( bNotes != bOn ) { OptionsChanged(); bNotes = bOn; } }
+ void SetHandout( bool bOn = true ) { if( bHandout != bOn ) { OptionsChanged(); bHandout = bOn; } }
+ void SetOutline( bool bOn = true ) { if( bOutline != bOn ) { OptionsChanged(); bOutline = bOn; } }
+ void SetDate( bool bOn = true ) { if( bDate != bOn ) { OptionsChanged(); bDate = bOn; } }
+ void SetTime( bool bOn = true ) { if( bTime != bOn ) { OptionsChanged(); bTime = bOn; } }
+ void SetPagename( bool bOn = true ) { if( bPagename != bOn ) { OptionsChanged(); bPagename = bOn; } }
+ void SetHiddenPages( bool bOn = true ) { if( bHiddenPages != bOn ) { OptionsChanged(); bHiddenPages = bOn; } }
+ void SetPagesize( bool bOn = true ) { if( bPagesize != bOn ) { OptionsChanged(); bPagesize = bOn; } }
+ void SetPagetile( bool bOn = true ) { if( bPagetile != bOn ) { OptionsChanged(); bPagetile = bOn; } }
+ void SetWarningPrinter( bool bOn = true ) { if( bWarningPrinter != bOn ) { OptionsChanged(); bWarningPrinter = bOn; } }
+ void SetWarningSize( bool bOn = true ) { if( bWarningSize != bOn ) { OptionsChanged(); bWarningSize = bOn; } }
+ void SetWarningOrientation( bool bOn = true ) { if( bWarningOrientation != bOn ) { OptionsChanged(); bWarningOrientation = bOn; } }
+ void SetBooklet( bool bOn = true ) { if( bBooklet != bOn ) { OptionsChanged(); bBooklet = bOn; } }
+ void SetFrontPage( bool bOn = true ) { if( bFront != bOn ) { OptionsChanged(); bFront = bOn; } }
+ void SetBackPage( bool bOn = true ) { if( bBack != bOn ) { OptionsChanged(); bBack = bOn; } }
+ void SetCutPage( bool bOn = true ) { if( bCutPage != bOn ) { OptionsChanged(); bCutPage = bOn; } }
+ void SetPaperbin( bool bOn = true ) { if( bPaperbin != bOn ) { OptionsChanged(); bPaperbin = bOn; } }
void SetOutputQuality( sal_uInt16 nInQuality ) { if( nQuality != nInQuality ) { OptionsChanged(); nQuality = nInQuality; } }
- void SetHandoutHorizontal( sal_Bool bHandoutHorizontal ) { if( mbHandoutHorizontal != bHandoutHorizontal ) { OptionsChanged(); mbHandoutHorizontal = bHandoutHorizontal; } }
+ void SetHandoutHorizontal( bool bHandoutHorizontal ) { if( mbHandoutHorizontal != bHandoutHorizontal ) { OptionsChanged(); mbHandoutHorizontal = bHandoutHorizontal; } }
void SetHandoutPages( sal_uInt16 nHandoutPages ) { if( nHandoutPages != mnHandoutPages ) { OptionsChanged(); mnHandoutPages = nHandoutPages; } }
};
diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx
index 223eae67b284..cdd7522efd4b 100644
--- a/sd/source/ui/inc/pubdlg.hxx
+++ b/sd/source/ui/inc/pubdlg.hxx
@@ -180,8 +180,8 @@ private:
Assistent aAssistentFunc;
- sal_Bool m_bImpress;
- sal_Bool m_bButtonsDirty;
+ bool m_bImpress;
+ bool m_bButtonsDirty;
void SetDefaults();
void CreatePages();
@@ -194,10 +194,10 @@ private:
void UpdatePage();
List* m_pDesignList;
- sal_Bool m_bDesignListDirty;
+ bool m_bDesignListDirty;
SdPublishingDesign* m_pDesign;
- sal_Bool Load();
- sal_Bool Save();
+ bool Load();
+ bool Save();
void GetDesign( SdPublishingDesign* pDesign );
void SetDesign( SdPublishingDesign* pDesign );
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index a22e7654b11f..4f234bb00dfb 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -67,8 +67,7 @@ SV_DECL_REF(DrawDocShell)
class SD_DLLPUBLIC SdPageObjsTLB : public SvTreeListBox
{
private:
-
- static sal_Bool SD_DLLPRIVATE bIsInDrag; // static, falls der Navigator im ExecuteDrag geloescht wird
+ static bool SD_DLLPRIVATE bIsInDrag; // static, falls der Navigator im ExecuteDrag geloescht wird
public:
@@ -121,7 +120,7 @@ public:
Pointer to the page for which to check whether it belongs to the
show.
@return
- Returns <FALSE/> if there is no custom show or if the current
+ Returns <false/> if there is no custom show or if the current
show does not contain the specified page at least once.
*/
bool PageBelongsToCurrentShow (const SdPage* pPage) const;
@@ -137,8 +136,8 @@ protected:
Image maImgGraphic;
Image maImgOleH;
Image maImgGraphicH;
- sal_Bool mbLinkableSelected;
- sal_Bool mbDragEnabled;
+ bool mbLinkableSelected;
+ bool mbDragEnabled;
String maDocName;
::sd::DrawDocShellRef mxBookmarkDocShRef; // Zum Laden von Bookmarks
::sd::DrawDocShell* mpDropDocSh;
@@ -158,10 +157,10 @@ protected:
void OnDragFinished( sal_uInt8 nDropAction );
/** Return the name of the object. When the object has no user supplied
- name and the bCreate flag is <TRUE/> then a name is created
+ name and the bCreate flag is <true/> then a name is created
automatically. Additionally the mbShowAllShapes flag is taken into
account when there is no user supplied name. When this flag is
- <FALSE/> then no name is created.
+ <false/> then no name is created.
@param pObject
When this is NULL then an empty string is returned, regardless
of the value of bCreate.
@@ -200,21 +199,21 @@ public:
void SetViewFrame( SfxViewFrame* pViewFrame ) { mpFrame = pViewFrame; }
SfxViewFrame* GetViewFrame() const { return mpFrame; }
- void Fill( const SdDrawDocument*, sal_Bool bAllPages, const String& rDocName );
+ void Fill( const SdDrawDocument*, bool bAllPages, const String& rDocName );
void Fill( const SdDrawDocument*, SfxMedium* pSfxMedium, const String& rDocName );
void SetShowAllShapes (const bool bShowAllShapes, const bool bFill);
bool GetShowAllShapes (void) const;
- sal_Bool IsEqualToDoc( const SdDrawDocument* pInDoc = NULL );
- sal_Bool HasSelectedChilds( const String& rName );
- sal_Bool SelectEntry( const String& rName );
+ bool IsEqualToDoc( const SdDrawDocument* pInDoc = NULL );
+ bool HasSelectedChilds( const String& rName );
+ bool SelectEntry( const String& rName );
String GetSelectEntry();
List* GetSelectEntryList( sal_uInt16 nDepth );
SdDrawDocument* GetBookmarkDoc(SfxMedium* pMedium = NULL);
::sd::DrawDocShell* GetDropDocSh() { return(mpDropDocSh); }
- sal_Bool IsLinkableSelected() const { return mbLinkableSelected; }
+ bool IsLinkableSelected() const { return mbLinkableSelected; }
- static sal_Bool IsInDrag();
+ static bool IsInDrag();
using SvLBox::ExecuteDrop;
using SvTreeListBox::SelectEntry;
@@ -238,7 +237,7 @@ private:
*/
bool mbShowAllPages;
- /** Return <TRUE/> when the current transferable may be dropped at the
+ /** Return <true/> when the current transferable may be dropped at the
given list box entry.
*/
bool IsDropAllowed (SvLBoxEntry* pEntry);
diff --git a/sd/source/ui/inc/sdundogr.hxx b/sd/source/ui/inc/sdundogr.hxx
index 6f0c69679f60..58a87d1281ec 100644
--- a/sd/source/ui/inc/sdundogr.hxx
+++ b/sd/source/ui/inc/sdundogr.hxx
@@ -32,7 +32,6 @@ class SD_DLLPUBLIC SdUndoGroup : public SdUndoAction
{
Container aCtn;
public:
- TYPEINFO();
SdUndoGroup(SdDrawDocument* pSdDrawDocument)
: SdUndoAction(pSdDrawDocument),
aCtn(16, 16, 16) {}
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index 3fe3e09d9c0f..a5c09857bfa2 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -49,7 +49,7 @@ class SdTransferable : public TransferableHelper, public SfxListener
{
public:
- SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, sal_Bool bInitOnGetData );
+ SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, bool bInitOnGetData );
~SdTransferable();
void SetDocShell( const SfxObjectShellRef& rRef ) { maDocShellRef = rRef; }
@@ -63,17 +63,17 @@ public:
void SetObjectDescriptor( const TransferableObjectDescriptor& rObjDesc );
- void SetStartPos( const Point& rStartPos ) { maStartPos = rStartPos; }
- const Point& GetStartPos() const { return maStartPos; }
+ void SetStartPos( const basegfx::B2DPoint& rStartPos ) { maStartPos = rStartPos; }
+ const basegfx::B2DPoint& GetStartPos() const { return maStartPos; }
- void SetInternalMove( sal_Bool bSet ) { mbInternalMove = bSet; }
- sal_Bool IsInternalMove() const { return mbInternalMove; }
+ void SetInternalMove( bool bSet ) { mbInternalMove = bSet; }
+ bool IsInternalMove() const { return mbInternalMove; }
- sal_Bool HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); }
+ bool HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); }
- void SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPersistent );
- sal_Bool IsPageTransferable() const { return mbPageTransferable; }
- sal_Bool HasPageBookmarks() const { return( mpPageDocShell && ( maPageBookmarks.Count() > 0 ) ); }
+ void SetPageBookmarks( const List& rPageBookmarks, bool bPersistent );
+ bool IsPageTransferable() const { return mbPageTransferable; }
+ bool HasPageBookmarks() const { return( mpPageDocShell && ( maPageBookmarks.Count() > 0 ) ); }
const List& GetPageBookmarks() const { return maPageBookmarks; }
::sd::DrawDocShell* GetPageDocShell() const { return mpPageDocShell; }
@@ -141,13 +141,13 @@ private:
Graphic* mpGraphic;
ImageMap* mpImageMap;
Rectangle maVisArea;
- Point maStartPos;
- sal_Bool mbInternalMove : 1;
- sal_Bool mbOwnDocument : 1;
- sal_Bool mbOwnView : 1;
- sal_Bool mbLateInit : 1;
- sal_Bool mbPageTransferable : 1;
- sal_Bool mbPageTransferablePersistent : 1;
+ basegfx::B2DPoint maStartPos;
+ bool mbInternalMove : 1;
+ bool mbOwnDocument : 1;
+ bool mbOwnView : 1;
+ bool mbLateInit : 1;
+ bool mbPageTransferable : 1;
+ bool mbPageTransferablePersistent : 1;
bool mbIsUnoObj : 1;
::std::vector<boost::shared_ptr<UserData> > maUserData;
diff --git a/sd/source/ui/inc/smarttag.hxx b/sd/source/ui/inc/smarttag.hxx
index fcba374f0ccd..afc7b828ce7e 100644
--- a/sd/source/ui/inc/smarttag.hxx
+++ b/sd/source/ui/inc/smarttag.hxx
@@ -72,11 +72,11 @@ public:
::sd::View& getView() const { return mrView; }
protected:
- virtual sal_uLong GetMarkablePointCount() const;
- virtual sal_uLong GetMarkedPointCount() const;
- virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
+ virtual sal_uInt32 GetMarkablePointCount() const;
+ virtual sal_uInt32 GetMarkedPointCount() const;
+ virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark = false);
virtual void CheckPossibilities();
- virtual sal_Bool MarkPoints(const Rectangle* pRect, sal_Bool bUnmark);
+ virtual bool MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark);
virtual void addCustomHandles( SdrHdlList& rHandlerList );
virtual void select();
@@ -135,13 +135,13 @@ public:
bool getContext( SdrViewContext& rContext ) const;
// support point editing
- sal_Bool HasMarkablePoints() const;
- sal_uLong GetMarkablePointCount() const;
- sal_Bool HasMarkedPoints() const;
- sal_uLong GetMarkedPointCount() const;
- sal_Bool IsPointMarkable(const SdrHdl& rHdl) const;
- sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
- sal_Bool MarkPoints(const Rectangle* pRect, sal_Bool bUnmark);
+ bool HasMarkablePoints() const;
+ sal_uInt32 GetMarkablePointCount() const;
+ bool HasMarkedPoints() const;
+ sal_uInt32 GetMarkedPointCount() const;
+ bool IsPointMarkable(const SdrHdl& rHdl) const;
+ bool MarkPoint(SdrHdl& rHdl, bool bUnmark = false);
+ bool MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark);
void CheckPossibilities();
@@ -168,13 +168,28 @@ private:
class SmartHdl : public SdrHdl
{
public:
- SmartHdl( const SmartTagReference& xTag, SdrObject* pObject, const Point& rPnt, SdrHdlKind eNewKind=HDL_SMARTTAG );
- SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind eNewKind=HDL_SMARTTAG );
+ SmartHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject,
+ const SmartTagReference& xTag,
+ SdrHdlKind eNewKind, // HDL_SMARTTAG
+ const basegfx::B2DPoint& rPnt);
+
+ // for handle copying support in MotionPathTag::addCustomHandles
+ SmartHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject,
+ const SmartTagReference& xTag,
+ sal_uInt32 nObjHandleNum,
+ SdrHdl& rSource);
const SmartTagReference& getTag() const { return mxTag; }
virtual bool isMarkable() const;
+
protected:
+ virtual ~SmartHdl();
+
SmartTagReference mxTag;
};
diff --git a/sd/source/ui/inc/sprite.hxx b/sd/source/ui/inc/sprite.hxx
index a644f118c550..464b14eed647 100644
--- a/sd/source/ui/inc/sprite.hxx
+++ b/sd/source/ui/inc/sprite.hxx
@@ -46,7 +46,7 @@ public:
Sprite( List* pListOfBmpEx );
~Sprite();
- sal_Bool StartMoving( OutputDevice* pOut,
+ bool StartMoving( OutputDevice* pOut,
OutputDevice* pBottomLayer = NULL,
BitmapEx* pTopLayer = NULL,
MetaFile** ppTopMtf = NULL,
@@ -72,9 +72,9 @@ protected:
Marker* pObjEndMarker;
List* pListOfBmpEx;
sal_uLong nLastTime;
- sal_Bool bClipRegion;
+ bool bClipRegion;
- sal_Bool ImplPrepareMoveTo();
+ bool ImplPrepareMoveTo();
void ImplDrawSprite( OutputDevice* pOut, const Point& rPt, const Size& rSz );
};
diff --git a/sd/source/ui/inc/taskpane/ControlContainer.hxx b/sd/source/ui/inc/taskpane/ControlContainer.hxx
index 1bb23f81b0a0..be5344c2c2a9 100644
--- a/sd/source/ui/inc/taskpane/ControlContainer.hxx
+++ b/sd/source/ui/inc/taskpane/ControlContainer.hxx
@@ -122,9 +122,9 @@ public:
@param bIncludeHidden
This flag tells the method whether to include the controls that
are not visible in the search for the previous control. When it
- is <FALSE/> the hidden controls are skipped.
+ is <false/> the hidden controls are skipped.
@param bCycle
- When this flag is <TRUE/> then the search for the previous
+ When this flag is <true/> then the search for the previous
control wraps arround when reaching the first control.
@return
Returns the index to the previous control or (sal_uInt32)-1 when
@@ -144,9 +144,9 @@ public:
@param bIncludeHidden
This flag tells the method whether to include the controls that
are not visible in the search for the next control. When it is
- <FALSE/> the hidden controls are skipped.
+ <false/> the hidden controls are skipped.
@param bCycle
- When this flag is <TRUE/> then the search for the next control
+ When this flag is <true/> then the search for the next control
wraps arround when reaching the last control.
@return
Returns the index to the next control or (sal_uInt32)-1 when
diff --git a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
index 5b845974f60f..881d5298f7c4 100644
--- a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
+++ b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
@@ -113,7 +113,7 @@ private:
typedef ::std::vector<PageDescriptor> PageDescriptorList;
PageDescriptorList maPageDescriptors;
- Rectangle GetPageBox (sal_Int32 nPageIndex);
+ basegfx::B2DRange GetPageBox (sal_Int32 nPageIndex);
void ProvideSize (sal_Int32 nPageIndex);
@@ -129,9 +129,9 @@ void SscdSetStatus (const SdrPage* pPage,
{
::sd::toolpanel::SlideSorterCacheDisplay* pDisplay
= ::sd::toolpanel::SlideSorterCacheDisplay::Instance(
- dynamic_cast<SdDrawDocument*>(pPage->GetModel()));
- if (pDisplay != NULL)
- pDisplay->SetPageStatus((pPage->GetPageNum()-1)/2, eStatus);
+ dynamic_cast< SdDrawDocument* >(&pPage->getSdrModelFromSdrPage()));
+ if (pDisplay)
+ pDisplay->SetPageStatus((pPage->GetPageNumber()-1)/2, eStatus);
}
void SscdSetRequestClass (const SdrPage* pPage, sal_Int32 nClass)
@@ -166,9 +166,9 @@ void SscdSetUpToDate (const SdrPage* pPage, bool bUpToDate)
{
::sd::toolpanel::SlideSorterCacheDisplay* pDisplay
= ::sd::toolpanel::SlideSorterCacheDisplay::Instance(
- dynamic_cast<const SdDrawDocument*>(pPage->GetModel()));
+ dynamic_cast< const SdDrawDocument* >(&pPage->getSdrModelFromSdrPage()));
if (pDisplay != NULL)
- pDisplay->SetUpToDate((pPage->GetPageNum()-1)/2, bUpToDate);
+ pDisplay->SetUpToDate((pPage->GetPageNumber()-1)/2, bUpToDate);
}
diff --git a/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx b/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx
index 24d07acc40f8..3bfd57d3e989 100644
--- a/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx
+++ b/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx
@@ -81,7 +81,7 @@ public:
*/
virtual sal_Int32 GetMinimumWidth (void);
- /** The default implementaion always returns <FALSE/>
+ /** The default implementaion always returns <false/>
*/
virtual bool IsResizable (void);
@@ -98,22 +98,22 @@ public:
virtual void RequestResize (void);
/** The default implementation shows the window (when it exists) when
- bExpansionState is <TRUE/>. It hides the window otherwise.
+ bExpansionState is <true/>. It hides the window otherwise.
@return
- Returns <TRUE/> when the expansion state changes. When an
+ Returns <true/> when the expansion state changes. When an
expansion state is requested that is already in place then
- <FALSE/> is returned.
+ <false/> is returned.
*/
virtual bool Expand (bool bExpansionState);
/** The default implementation returns whether the window is showing.
- When there is no window then it returns <FALSE/>.
+ When there is no window then it returns <false/>.
*/
virtual bool IsExpanded (void) const;
/** Return whether the node can be expanded or collapsed. The default
- implementation always returns <TRUE/> when there is window and
- <FALSE/> otherwise. If <FALSE/> is returned
+ implementation always returns <true/> when there is window and
+ <false/> otherwise. If <false/> is returned
then Expand() may be called but it will not change the expansion
state.
*/
diff --git a/sd/source/ui/inc/taskpane/TitleBar.hxx b/sd/source/ui/inc/taskpane/TitleBar.hxx
index 06876a94baba..df0175a4a0f2 100644
--- a/sd/source/ui/inc/taskpane/TitleBar.hxx
+++ b/sd/source/ui/inc/taskpane/TitleBar.hxx
@@ -106,7 +106,7 @@ private:
/** Return whether this TitleBar object has an expansion indicator
bitmap. It is safe to call GetExpansionIndicator() when this method
- returns <FALSE/> but unnecessary.
+ returns <false/> but unnecessary.
*/
bool HasExpansionIndicator (void) const;
diff --git a/sd/source/ui/inc/taskpane/TitledControl.hxx b/sd/source/ui/inc/taskpane/TitledControl.hxx
index 9fbdc2b71ed7..c4a0f4f21ba7 100644
--- a/sd/source/ui/inc/taskpane/TitledControl.hxx
+++ b/sd/source/ui/inc/taskpane/TitledControl.hxx
@@ -92,7 +92,7 @@ public:
TitleBar* GetTitleBar (void);
/** Return the control child. When a control factory has been given and
- the control has not yet been created and the given flag is <TRUE/>
+ the control has not yet been created and the given flag is <true/>
then the control is created.
*/
TreeNode* GetControl (void);
@@ -105,13 +105,13 @@ public:
higher level expand command. You may want to use
ExpandViaContainer() instead.
@param bExpanded
- When <TRUE/> then the control is expanded, otherwise it is
+ When <true/> then the control is expanded, otherwise it is
collapsed.
*/
virtual bool Expand (bool bExpanded = true);
- /** Return whether the control is currently expanded (<TRUE/>) or
- not (<FALSE/>).
+ /** Return whether the control is currently expanded (<true/>) or
+ not (<false/>).
*/
virtual bool IsExpanded (void) const;
diff --git a/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx
index 1e57a2832dfc..d7c2b66fd72b 100644
--- a/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx
+++ b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx
@@ -64,7 +64,6 @@ class ToolPanelViewShell
: public ViewShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDTOOLPANELSHELL)
ToolPanelViewShell (
@@ -119,7 +118,7 @@ public:
*/
virtual bool RelocateToParentWindow (::Window* pParentWindow);
- /// returns <TRUE/> if and only if the given window is the panel anchor window of our ToolPanelDeck
+ /// returns <true/> if and only if the given window is the panel anchor window of our ToolPanelDeck
bool IsPanelAnchorWindow( const ::Window& i_rWindow ) const;
/** creates an XUIElement for the given standard panel
@@ -151,7 +150,7 @@ private:
/** Initialize the task pane view shell if that has not yet been done
- before. If mbIsInitialized is already set to <TRUE/> then this
+ before. If mbIsInitialized is already set to <true/> then this
method returns immediately.
*/
void Initialize (void);
diff --git a/sd/source/ui/inc/tbx_ww.hxx b/sd/source/ui/inc/tbx_ww.hxx
index 842fc36d2e10..6282353bac9a 100644
--- a/sd/source/ui/inc/tbx_ww.hxx
+++ b/sd/source/ui/inc/tbx_ww.hxx
@@ -67,7 +67,7 @@ private:
class SdTbxControl : public SfxToolBoxControl
{
private:
- sal_Bool IsCheckable( sal_uInt16 nSId );
+ bool IsCheckable( sal_uInt16 nSId );
public:
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/sd/source/ui/inc/tools/AsynchronousTask.hxx b/sd/source/ui/inc/tools/AsynchronousTask.hxx
index de9b75a2c266..f1a3dafced4c 100644
--- a/sd/source/ui/inc/tools/AsynchronousTask.hxx
+++ b/sd/source/ui/inc/tools/AsynchronousTask.hxx
@@ -39,8 +39,8 @@ public:
*/
virtual void RunNextStep (void) = 0;
- /** Return <TRUE/> when there is at least one more step to execute.
- When the task has been executed completely then <FALSE/> is
+ /** Return <true/> when there is at least one more step to execute.
+ When the task has been executed completely then <false/> is
returned.
*/
virtual bool HasNextStep (void) = 0;
diff --git a/sd/source/ui/inc/tools/TimerBasedTaskExecution.hxx b/sd/source/ui/inc/tools/TimerBasedTaskExecution.hxx
index 30e971c1a498..1268296e71e5 100644
--- a/sd/source/ui/inc/tools/TimerBasedTaskExecution.hxx
+++ b/sd/source/ui/inc/tools/TimerBasedTaskExecution.hxx
@@ -36,7 +36,7 @@ class AsynchronousTask;
nMillisecondsBetweenSteps milliseconds as much steps are executed as fit
into a nMaxTimePerStep millisecond intervall.
- When a task is executed completely, i.e. HasNextStep() returns <FALSE/>,
+ When a task is executed completely, i.e. HasNextStep() returns <false/>,
the TimerBasedTaskExecution destroys itself. This, of course, works
only if the creating instance does not hold a shared_ptr to that object.
*/
diff --git a/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx
index 029899f6dabf..ed78bc93a115 100644
--- a/sd/source/ui/inc/tpaction.hxx
+++ b/sd/source/ui/inc/tpaction.hxx
@@ -91,7 +91,7 @@ private:
SdDrawDocument* mpDoc;
XColorTable* pColTab;
- sal_Bool bTreeUpdated;
+ bool bTreeUpdated;
List* pCurrentActions;
String aLastFile;
::std::vector< long > aVerbVector;
@@ -109,7 +109,7 @@ private:
void SetActualClickAction( ::com::sun::star::presentation::ClickAction eCA );
void SetActualAnimationEffect( ::com::sun::star::presentation::AnimationEffect eAE );
void SetEditText( String const & rStr );
- String GetEditText( sal_Bool bURL = sal_False );
+ String GetEditText( bool bURL = false );
sal_uInt16 GetClickActionSdResId( ::com::sun::star::presentation::ClickAction eCA );
sal_uInt16 GetAnimationEffectSdResId( ::com::sun::star::presentation::AnimationEffect eAE );
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index 47f7de97b633..785383633b37 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -149,7 +149,7 @@ private:
SfxMapUnit ePoolUnit;
String GetScale( sal_Int32 nX, sal_Int32 nY );
- sal_Bool SetScale( const String& aScale, sal_Int32& rX, sal_Int32& rY );
+ bool SetScale( const String& aScale, sal_Int32& rX, sal_Int32& rY );
DECL_LINK( ModifyScaleHdl, void * );
DECL_LINK( ModifyOriginalScaleHdl, void * );
diff --git a/sd/source/ui/inc/unchss.hxx b/sd/source/ui/inc/unchss.hxx
index 15d22bd3d1d2..21262301d0f2 100644
--- a/sd/source/ui/inc/unchss.hxx
+++ b/sd/source/ui/inc/unchss.hxx
@@ -25,24 +25,23 @@
#define _SD_UNCHSS_HXX
#include "sdundo.hxx"
+#include <svl/itemset.hxx>
-class SfxItemSet;
class SfxStyleSheet;
class SdDrawDocument;
class StyleSheetUndoAction : public SdUndoAction
{
- SfxStyleSheet* pStyleSheet;
-
- SfxItemSet* pNewSet;
- SfxItemSet* pOldSet;
+ SfxStyleSheet& mrStyleSheet;
+ SfxItemSet maNewSet;
+ SfxItemSet maOldSet;
String aComment;
public:
- TYPEINFO();
- StyleSheetUndoAction(SdDrawDocument* pTheDoc,
- SfxStyleSheet* pTheStyleSheet,
- const SfxItemSet* pTheNewItemSet);
+ StyleSheetUndoAction(
+ SdDrawDocument& rTheDoc,
+ SfxStyleSheet& rTheStyleSheet,
+ const SfxItemSet& rTheNewItemSet);
virtual ~StyleSheetUndoAction();
virtual void Undo();
@@ -53,3 +52,4 @@ public:
#endif // _SD_UNCHSS_HXX
+// eof
diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index caef761c86b2..517a13af7f9a 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -45,8 +45,6 @@ private:
public:
- TYPEINFO();
-
SdBackgroundObjUndoAction(
SdDrawDocument& rDoc,
SdPage& rPage,
diff --git a/sd/source/ui/inc/undoheaderfooter.hxx b/sd/source/ui/inc/undoheaderfooter.hxx
index 22fc621513bb..d4c1028dd510 100644
--- a/sd/source/ui/inc/undoheaderfooter.hxx
+++ b/sd/source/ui/inc/undoheaderfooter.hxx
@@ -41,7 +41,6 @@ class SD_DLLPUBLIC SdHeaderFooterUndoAction : public SdUndoAction
const sd::HeaderFooterSettings maNewSettings;
public:
- TYPEINFO();
SdHeaderFooterUndoAction( SdDrawDocument* pDoc, SdPage* pPage, const sd::HeaderFooterSettings& rNewSettings );
virtual ~SdHeaderFooterUndoAction();
diff --git a/sd/source/ui/inc/undolayer.hxx b/sd/source/ui/inc/undolayer.hxx
index 94b08f814b65..137b41d07095 100644
--- a/sd/source/ui/inc/undolayer.hxx
+++ b/sd/source/ui/inc/undolayer.hxx
@@ -35,7 +35,6 @@ class SdLayerModifyUndoAction : public SdUndoAction
{
public:
- TYPEINFO();
SdLayerModifyUndoAction( SdDrawDocument* _pDoc, SdrLayer* pLayer,
const String& rOldLayerName, const String& rOldLayerTitle, const String& rOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable,
const String& rNewLayerName, const String& rNewLayerTitle, const String& rNewLayerDesc, bool bNewIsVisible, bool bNewIsLocked, bool bNewIsPrintable );
diff --git a/sd/source/ui/inc/undopage.hxx b/sd/source/ui/inc/undopage.hxx
index c6f50ffe7918..4f927e8391ff 100644
--- a/sd/source/ui/inc/undopage.hxx
+++ b/sd/source/ui/inc/undopage.hxx
@@ -26,8 +26,8 @@
#include <tools/gen.hxx>
#include <vcl/prntypes.hxx>
-
#include "sdundo.hxx"
+#include <basegfx/vector/b2dvector.hxx>
class SdDrawDocument;
class SdPage;
@@ -38,74 +38,74 @@ class SdPageFormatUndoAction : public SdUndoAction
{
SdPage* mpPage;
- Size maOldSize;
- sal_Int32 mnOldLeft;
- sal_Int32 mnOldRight;
- sal_Int32 mnOldUpper;
- sal_Int32 mnOldLower;
- sal_Bool mbOldScale;
+ basegfx::B2DVector maOldSize;
+ double mfOldLeft;
+ double mfOldRight;
+ double mfOldTop;
+ double mfOldBottom;
+ bool mbOldScale;
Orientation meOldOrientation;
sal_uInt16 mnOldPaperBin;
- sal_Bool mbOldFullSize;
-
- Size maNewSize;
- sal_Int32 mnNewLeft;
- sal_Int32 mnNewRight;
- sal_Int32 mnNewUpper;
- sal_Int32 mnNewLower;
- sal_Bool mbNewScale;
+ bool mbOldFullSize;
+
+ basegfx::B2DVector maNewSize;
+ double mfNewLeft;
+ double mfNewRight;
+ double mfNewTop;
+ double mfNewBottom;
+ bool mbNewScale;
Orientation meNewOrientation;
sal_uInt16 mnNewPaperBin;
- sal_Bool mbNewFullSize;
+ bool mbNewFullSize;
public:
- TYPEINFO();
- SdPageFormatUndoAction( SdDrawDocument* pDoc,
+ SdPageFormatUndoAction(
+ SdDrawDocument* pDoc,
SdPage* pThePage,
- const Size& rOldSz,
- sal_Int32 nOldLft,
- sal_Int32 nOldRgt,
- sal_Int32 nOldUpr,
- sal_Int32 nOldLwr,
- sal_Bool bOldScl,
+ const basegfx::B2DVector& rOldSz,
+ double fOldLeft,
+ double fOldRight,
+ double fOldTop,
+ double fOldBottom,
+ bool bOldScl,
Orientation eOldOrient,
sal_uInt16 nOPaperBin,
- sal_Bool bOFullSize,
-
- const Size& rNewSz,
- sal_Int32 nNewLft,
- sal_Int32 nNewRgt,
- sal_Int32 nNewUpr,
- sal_Int32 nNewLwr,
- sal_Bool bNewScl,
+ bool bOFullSize,
+
+ const basegfx::B2DVector& rNewSz,
+ double fNewLeft,
+ double fNewRight,
+ double fNewTop,
+ double fNewBottom,
+ bool bNewScl,
Orientation eNewOrient,
sal_uInt16 nNPaperBin,
- sal_Bool bNFullSize
- ) :
- SdUndoAction(pDoc),
+ bool bNFullSize)
+
+ : SdUndoAction(pDoc),
mpPage (pThePage),
maOldSize (rOldSz),
- mnOldLeft (nOldLft),
- mnOldRight (nOldRgt),
- mnOldUpper (nOldUpr),
- mnOldLower (nOldLwr),
+ mfOldLeft(fOldLeft),
+ mfOldRight(fOldRight),
+ mfOldTop(fOldTop),
+ mfOldBottom(fOldBottom),
mbOldScale (bOldScl),
meOldOrientation(eOldOrient),
mnOldPaperBin (nOPaperBin),
mbOldFullSize (bOFullSize),
-
maNewSize (rNewSz),
- mnNewLeft (nNewLft),
- mnNewRight (nNewRgt),
- mnNewUpper (nNewUpr),
- mnNewLower (nNewLwr),
+ mfNewLeft(fNewLeft),
+ mfNewRight(fNewRight),
+ mfNewTop(fNewTop),
+ mfNewBottom(fNewBottom),
mbNewScale (bNewScl),
meNewOrientation(eNewOrient),
mnNewPaperBin (nNPaperBin),
mbNewFullSize (bNFullSize)
+ {
+ }
- {}
virtual ~SdPageFormatUndoAction();
virtual void Undo();
@@ -118,23 +118,28 @@ class SdPageLRUndoAction : public SdUndoAction
{
SdPage* mpPage;
- sal_Int32 mnOldLeft;
- sal_Int32 mnOldRight;
- sal_Int32 mnNewLeft;
- sal_Int32 mnNewRight;
+ double mfOldLeft;
+ double mfOldRight;
+ double mfNewLeft;
+ double mfNewRight;
public:
- TYPEINFO();
- SdPageLRUndoAction( SdDrawDocument* pDoc, SdPage* pThePage,
- sal_Int32 nOldLft, sal_Int32 nOldRgt,
- sal_Int32 nNewLft, sal_Int32 nNewRgt ) :
- SdUndoAction(pDoc),
+ SdPageLRUndoAction(
+ SdDrawDocument* pDoc,
+ SdPage* pThePage,
+ double fOldLeft,
+ double fOldRight,
+ double fNewLeft,
+ double fNewRight )
+ : SdUndoAction(pDoc),
mpPage (pThePage),
- mnOldLeft (nOldLft),
- mnOldRight (nOldRgt),
- mnNewLeft (nNewLft),
- mnNewRight (nNewRgt)
- {}
+ mfOldLeft (fOldLeft),
+ mfOldRight (fOldRight),
+ mfNewLeft (fNewLeft),
+ mfNewRight (fNewRight)
+ {
+ }
+
virtual ~SdPageLRUndoAction();
virtual void Undo();
@@ -147,23 +152,28 @@ class SdPageULUndoAction : public SdUndoAction
{
SdPage* mpPage;
- sal_Int32 mnOldUpper;
- sal_Int32 mnOldLower;
- sal_Int32 mnNewUpper;
- sal_Int32 mnNewLower;
+ double mfOldTop;
+ double mfOldBottom;
+ double mfNewTop;
+ double mfNewBottom;
public:
- TYPEINFO();
- SdPageULUndoAction( SdDrawDocument* pDoc, SdPage* pThePage,
- sal_Int32 nOldUpr, sal_Int32 nOldLwr,
- sal_Int32 nNewUpr, sal_Int32 nNewLwr ) :
- SdUndoAction(pDoc),
+ SdPageULUndoAction(
+ SdDrawDocument* pDoc,
+ SdPage* pThePage,
+ double fOldTop,
+ double fOldBottom,
+ double fNewTop,
+ double fNewBottom )
+ : SdUndoAction(pDoc),
mpPage (pThePage),
- mnOldUpper (nOldUpr),
- mnOldLower (nOldLwr),
- mnNewUpper (nNewUpr),
- mnNewLower (nNewLwr)
- {}
+ mfOldTop (fOldTop),
+ mfOldBottom (fOldBottom),
+ mfNewTop (fNewTop),
+ mfNewBottom (fNewBottom)
+ {
+ }
+
virtual ~SdPageULUndoAction();
virtual void Undo();
diff --git a/sd/source/ui/inc/unmodpg.hxx b/sd/source/ui/inc/unmodpg.hxx
index f2ab5a1e0c4f..62bc1f25c409 100644
--- a/sd/source/ui/inc/unmodpg.hxx
+++ b/sd/source/ui/inc/unmodpg.hxx
@@ -37,22 +37,21 @@ class ModifyPageUndoAction : public SdUndoAction
String maNewName;
AutoLayout meOldAutoLayout;
AutoLayout meNewAutoLayout;
- sal_Bool mbOldBckgrndVisible;
- sal_Bool mbNewBckgrndVisible;
- sal_Bool mbOldBckgrndObjsVisible;
- sal_Bool mbNewBckgrndObjsVisible;
+ bool mbOldBckgrndVisible;
+ bool mbNewBckgrndVisible;
+ bool mbOldBckgrndObjsVisible;
+ bool mbNewBckgrndObjsVisible;
String maComment;
public:
- TYPEINFO();
ModifyPageUndoAction(
SdDrawDocument* pTheDoc,
SdPage* pThePage,
String aTheNewName,
AutoLayout eTheNewAutoLayout,
- sal_Bool bTheNewBckgrndVisible,
- sal_Bool bTheNewBckgrndObjsVisible);
+ bool bTheNewBckgrndVisible,
+ bool bTheNewBckgrndObjsVisible);
virtual ~ModifyPageUndoAction();
virtual void Undo();
diff --git a/sd/source/ui/inc/unoaprms.hxx b/sd/source/ui/inc/unoaprms.hxx
index d7453a697799..eaac8b3e023b 100644
--- a/sd/source/ui/inc/unoaprms.hxx
+++ b/sd/source/ui/inc/unoaprms.hxx
@@ -39,20 +39,20 @@ class SdrObject;
class SdAnimationPrmsUndoAction : public SdUndoAction
{
SdrObject* pObject;
- sal_Bool bOldActive;
- sal_Bool bNewActive;
- sal_Bool bOldDimPrevious;
- sal_Bool bNewDimPrevious;
- sal_Bool bOldDimHide;
- sal_Bool bNewDimHide;
- sal_Bool bOldSoundOn;
- sal_Bool bNewSoundOn;
- sal_Bool bOldSecondSoundOn;
- sal_Bool bNewSecondSoundOn;
- sal_Bool bOldPlayFull;
- sal_Bool bNewPlayFull;
- sal_Bool bOldSecondPlayFull;
- sal_Bool bNewSecondPlayFull;
+ bool bOldActive;
+ bool bNewActive;
+ bool bOldDimPrevious;
+ bool bNewDimPrevious;
+ bool bOldDimHide;
+ bool bNewDimHide;
+ bool bOldSoundOn;
+ bool bNewSoundOn;
+ bool bOldSecondSoundOn;
+ bool bNewSecondSoundOn;
+ bool bOldPlayFull;
+ bool bNewPlayFull;
+ bool bOldSecondPlayFull;
+ bool bNewSecondPlayFull;
::com::sun::star::presentation::AnimationEffect eOldEffect;
::com::sun::star::presentation::AnimationEffect eNewEffect;
::com::sun::star::presentation::AnimationEffect eOldTextEffect;
@@ -75,25 +75,24 @@ class SdAnimationPrmsUndoAction : public SdUndoAction
::com::sun::star::presentation::ClickAction eNewClickAction;
String aOldBookmark;
String aNewBookmark;
- sal_Bool bOldInvisibleInPres;
- sal_Bool bNewInvisibleInPres;
+ bool bOldInvisibleInPres;
+ bool bNewInvisibleInPres;
sal_uInt16 nOldVerb;
sal_uInt16 nNewVerb;
sal_uLong nOldPresOrder;
sal_uLong nNewPresOrder;
- sal_Bool bInfoCreated;
+ bool bInfoCreated;
public:
- TYPEINFO();
SdAnimationPrmsUndoAction(SdDrawDocument* pTheDoc, SdrObject* pObj,
- sal_Bool bCreated):
+ bool bCreated):
SdUndoAction (pTheDoc),
pObject (pObj),
bInfoCreated (bCreated)
{}
- void SetActive(sal_Bool bTheOldActive, sal_Bool bTheNewActive)
+ void SetActive(bool bTheOldActive, bool bTheNewActive)
{ bOldActive = bTheOldActive; bNewActive = bTheNewActive; }
void SetEffect(::com::sun::star::presentation::AnimationEffect eTheOldEffect, ::com::sun::star::presentation::AnimationEffect eTheNewEffect)
{ eOldEffect = eTheOldEffect; eNewEffect = eTheNewEffect; }
@@ -101,19 +100,19 @@ public:
{ eOldTextEffect = eTheOldEffect; eNewTextEffect = eTheNewEffect; }
void SetSpeed(::com::sun::star::presentation::AnimationSpeed eTheOldSpeed, ::com::sun::star::presentation::AnimationSpeed eTheNewSpeed)
{ eOldSpeed = eTheOldSpeed; eNewSpeed = eTheNewSpeed; }
- void SetDim(sal_Bool bTheOldDim, sal_Bool bTheNewDim)
+ void SetDim(bool bTheOldDim, bool bTheNewDim)
{ bOldDimPrevious = bTheOldDim; bNewDimPrevious = bTheNewDim; }
void SetDimColor(Color aTheOldDimColor, Color aTheNewDimColor)
{ aOldDimColor = aTheOldDimColor; aNewDimColor = aTheNewDimColor; }
- void SetDimHide(sal_Bool bTheOldDimHide, sal_Bool bTheNewDimHide)
+ void SetDimHide(bool bTheOldDimHide, bool bTheNewDimHide)
{ bOldDimHide = bTheOldDimHide; bNewDimHide = bTheNewDimHide; }
- void SetSoundOn(sal_Bool bTheOldSoundOn, sal_Bool bTheNewSoundOn)
+ void SetSoundOn(bool bTheOldSoundOn, bool bTheNewSoundOn)
{ bOldSoundOn = bTheOldSoundOn; bNewSoundOn = bTheNewSoundOn; }
void SetSound(String aTheOldSound, String aTheNewSound)
{ aOldSoundFile = aTheOldSound; aNewSoundFile = aTheNewSound; }
void SetBlueScreen(Color aTheOldBlueScreen, Color aTheNewBlueScreen)
{ aOldBlueScreen = aTheOldBlueScreen; aNewBlueScreen = aTheNewBlueScreen; }
- void SetPlayFull(sal_Bool bTheOldPlayFull, sal_Bool bTheNewPlayFull)
+ void SetPlayFull(bool bTheOldPlayFull, bool bTheNewPlayFull)
{ bOldPlayFull = bTheOldPlayFull; bNewPlayFull = bTheNewPlayFull; }
void SetPathObj(SdrPathObj* pTheOldPath, SdrPathObj* pTheNewPath)
{ pOldPathObj = pTheOldPath; pNewPathObj = pTheNewPath; }
@@ -121,7 +120,7 @@ public:
{ eOldClickAction = eTheOldAction; eNewClickAction = eTheNewAction; }
void SetBookmark(String aTheOldBookmark, String aTheNewBookmark)
{ aOldBookmark = aTheOldBookmark; aNewBookmark = aTheNewBookmark; }
- void SetInvisibleInPres(sal_Bool bTheOldInvisibleInPres, sal_Bool bTheNewInvisibleInPres)
+ void SetInvisibleInPres(bool bTheOldInvisibleInPres, bool bTheNewInvisibleInPres)
{ bOldInvisibleInPres = bTheOldInvisibleInPres; bNewInvisibleInPres = bTheNewInvisibleInPres; }
void SetVerb(sal_uInt16 nTheOldVerb, sal_uInt16 nTheNewVerb)
{ nOldVerb = nTheOldVerb; nNewVerb = nTheNewVerb; }
@@ -129,9 +128,9 @@ public:
{ eOldSecondEffect = eTheOldEffect; eNewSecondEffect = eTheNewEffect; }
void SetSecondSpeed(::com::sun::star::presentation::AnimationSpeed eTheOldSpeed, ::com::sun::star::presentation::AnimationSpeed eTheNewSpeed)
{ eOldSecondSpeed = eTheOldSpeed; eNewSecondSpeed = eTheNewSpeed; }
- void SetSecondSoundOn(sal_Bool bTheOldSoundOn, sal_Bool bTheNewSoundOn)
+ void SetSecondSoundOn(bool bTheOldSoundOn, bool bTheNewSoundOn)
{ bOldSecondSoundOn = bTheOldSoundOn; bNewSecondSoundOn = bTheNewSoundOn; }
- void SetSecondPlayFull(sal_Bool bTheOldPlayFull, sal_Bool bTheNewPlayFull)
+ void SetSecondPlayFull(bool bTheOldPlayFull, bool bTheNewPlayFull)
{ bOldSecondPlayFull = bTheOldPlayFull; bNewSecondPlayFull = bTheNewPlayFull; }
void SetPresOrder(sal_uLong nTheOldPresOrder, sal_uLong nTheNewPresOrder)
{ nOldPresOrder = nTheOldPresOrder; nNewPresOrder = nTheNewPresOrder; }
diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx
index ec551921eb94..763a27663900 100644
--- a/sd/source/ui/inc/unokywds.hxx
+++ b/sd/source/ui/inc/unokywds.hxx
@@ -176,7 +176,7 @@ SD_CONSTASCII_ACTION( sUNO_View_IsSnapToObjectPoints, "IsSnapToObjectP
SD_CONSTASCII_ACTION( sUNO_View_IsSnapLinesVisible, "IsSnapLinesVisible" );
SD_CONSTASCII_ACTION( sUNO_View_IsDragStripes, "IsDragStripes" );
SD_CONSTASCII_ACTION( sUNO_View_IsPlusHandlesAlwaysVisible, "IsPlusHandlesAlwaysVisible" );
-SD_CONSTASCII_ACTION( sUNO_View_IsFrameDragSingles, "IsFrameDragSingles" );
+SD_CONSTASCII_ACTION( sUNO_View_IsFrameDragSingles, "IsFrameDragSingles" ); // other name for IsFrameHandles
SD_CONSTASCII_ACTION( sUNO_View_IsMarkedHitMovesAlways, "IsMarkedHitMovesAlways" );
SD_CONSTASCII_ACTION( sUNO_View_EliminatePolyPointLimitAngle, "EliminatePolyPointLimitAngle" );
SD_CONSTASCII_ACTION( sUNO_View_IsEliminatePolyPoints, "IsEliminatePolyPoints" );
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index d78bb34d9828..3b6d113c5468 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -93,7 +93,7 @@ private:
SdDrawDocument* mpDoc;
bool mbDisposed;
- SdPage* InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate = sal_False ) throw();
+ SdPage* InsertSdPage( sal_uInt32 nPage, sal_Bool bDuplicate = sal_False ) throw();
const sal_Bool mbImpressDoc;
bool mbClipBoard;
@@ -122,6 +122,11 @@ private:
rtl::OUString maBuildId;
void initializeDocument();
+
+protected:
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModel() const;
+
public:
SdXImpressDocument( ::sd::DrawDocShell* pShell, bool bClipBoard = false ) throw();
SdXImpressDocument( SdDrawDocument* pDoc, bool bClipBoard = false ) throw();
diff --git a/sd/source/ui/inc/unprlout.hxx b/sd/source/ui/inc/unprlout.hxx
index 78a6abdbe87c..e59211f8eb57 100644
--- a/sd/source/ui/inc/unprlout.hxx
+++ b/sd/source/ui/inc/unprlout.hxx
@@ -36,18 +36,17 @@ class SdPresentationLayoutUndoAction : public SdUndoAction
String aNewLayoutName;
AutoLayout eOldAutoLayout;
AutoLayout eNewAutoLayout;
- sal_Bool bSetAutoLayout; // sal_True: AutoLayout aendern
+ bool bSetAutoLayout; // true: AutoLayout aendern
SdPage* pPage;
String aComment;
public:
- TYPEINFO();
SdPresentationLayoutUndoAction(SdDrawDocument* pTheDoc,
String aTheOldLayoutName,
String aTheNewLayoutName,
AutoLayout eTheOldAutoLayout,
AutoLayout eTheNewAutoLayout,
- sal_Bool bSet,
+ bool bSet,
SdPage* pThePage);
virtual ~SdPresentationLayoutUndoAction();
diff --git a/sd/source/ui/inc/unslsel.hxx b/sd/source/ui/inc/unslsel.hxx
index ad9c2e9d12f0..774b4c58516a 100644
--- a/sd/source/ui/inc/unslsel.hxx
+++ b/sd/source/ui/inc/unslsel.hxx
@@ -32,7 +32,6 @@ class SlideSelectionUndoAction : public SdUndoAction
Container* pNewOrder;
public:
- TYPEINFO();
SlideSelectionUndoAction(SdDrawDocument* pTheDoc,
Container* pOld, Container* pNew)
: SdUndoAction(pTheDoc),
diff --git a/sd/source/ui/inc/zoomlist.hxx b/sd/source/ui/inc/zoomlist.hxx
index 5d298ee03d2e..2efeb73c6169 100644
--- a/sd/source/ui/inc/zoomlist.hxx
+++ b/sd/source/ui/inc/zoomlist.hxx
@@ -24,10 +24,9 @@
#ifndef SD_ZOOM_LIST_HXX
#define SD_ZOOM_LIST_HXX
-
#include <tools/gen.hxx>
#include <tools/list.hxx>
-
+#include <basegfx/range/b2drange.hxx>
namespace sd {
@@ -39,15 +38,15 @@ public:
ZoomList(ViewShell* pViewShell);
virtual ~ZoomList();
- void InsertZoomRect(const Rectangle& rRect);
- Rectangle GetNextZoomRect();
- Rectangle GetPreviousZoomRect();
- sal_Bool IsNextPossible() const;
- sal_Bool IsPreviousPossible() const;
+ void InsertZoomRange(const basegfx::B2DRange& rRange);
+ basegfx::B2DRange GetNextZoomRange();
+ basegfx::B2DRange GetPreviousZoomRange();
+ bool IsNextPossible() const;
+ bool IsPreviousPossible() const;
private:
ViewShell* mpViewShell;
- sal_uLong mnCurPos;
+ sal_uInt32 mnCurPos;
};
} // end of namespace sd
diff --git a/sd/source/ui/notes/EditWindow.cxx b/sd/source/ui/notes/EditWindow.cxx
index daacf0ae7c34..38d4e75fe915 100644
--- a/sd/source/ui/notes/EditWindow.cxx
+++ b/sd/source/ui/notes/EditWindow.cxx
@@ -203,7 +203,7 @@ EditEngine* EditWindow::CreateEditEngine (void)
pEditEngine = new EditEngine (mpEditEngineItemPool);
- pEditEngine->EnableUndo (sal_True);
+ pEditEngine->EnableUndo (true);
pEditEngine->SetDefTab (sal_uInt16(
Application::GetDefaultDevice()->GetTextWidth(
UniString::CreateFromAscii("XXXX"))));
@@ -396,66 +396,6 @@ IMPL_LINK_INLINE_END( EditWindow, MenuSelectHdl, Menu *, EMPTYARG )
void EditWindow::KeyInput(const KeyEvent& )
{
- /* if (rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE)
- {
- sal_Bool bCallBase = sal_True;
- SfxViewShell* pViewShell = SfxViewShell::Current();
- if ( pViewShell && pViewShell->ISA(SmViewShell) )
- {
- SmDocShell* pDocSh = (SmDocShell*) pViewShell->GetViewFrame()->GetObjectShell();
- if (pDocSh)
- {
- // fuert zum (sofortigen) Zerstoeren von this!
- pDocSh->DoInPlaceActivate( sal_False );
- bCallBase = sal_False;
- }
- }
- if ( bCallBase )
- Window::KeyInput( rKEvt );
- }
- else
- {
- // Timer neu starten, um den Handler (auch bei längeren Eingaben)
- // möglichst nur einmal am Ende aufzurufen.
- aCursorMoveTimer.Start();
-
- DBG_ASSERT( mpEditView, "EditView missing (NULL pointer)" );
- if (!mpEditView)
- CreateEditView();
- if ( !mpEditView->PostKeyEvent(rKEvt) )
- {
- if ( !SfxViewShell::Current()->KeyInput(rKEvt) )
- {
- // fuert bei F1 (Hilfe) zum Zerstoeren von this!
- Flush();
- if ( aModifyTimer.IsActive() )
- aModifyTimer.Stop();
- Window::KeyInput(rKEvt);
- }
- else
- {
- //SFX hat evtl. Slot an der View gecallt und dabei (wg. Hack
- //im SFX) den Focus auf die View gesetzt
- SfxViewShell* pVShell = SfxViewShell::Current();
- if ( pVShell && pVShell->ISA(SmViewShell) &&
- ((SmViewShell*)pVShell)->GetGraphicWindow().HasFocus() )
- {
- GrabFocus();
- }
- }
- }
- else
- {
- // have doc-shell modified only for formula input/change and not
- // cursor travelling and such things...
- SmDocShell *pDocShell = GetDoc();
- if (pDocShell)
- pDocShell->SetModified( GetEditEngine()->IsModified() );
-
- aModifyTimer.Start();
- }
- }
- */
}
@@ -499,7 +439,7 @@ void EditWindow::CreateEditView (void)
mpEditView->SetSelection(eSelection);
Update();
- mpEditView->ShowCursor(sal_True, sal_True);
+ mpEditView->ShowCursor(true, true);
pEditEngine->SetStatusEventHdl(
LINK(this, EditWindow, EditStatusHdl));
@@ -669,9 +609,9 @@ void EditWindow::LoseFocus()
}
-sal_Bool EditWindow::IsAllSelected() const
+bool EditWindow::IsAllSelected() const
{
- sal_Bool bRes = sal_False;
+ bool bRes = false;
EditEngine *pEditEngine = ((EditWindow *) this)->GetEditEngine();
DBG_ASSERT( mpEditView, "NULL pointer" );
DBG_ASSERT( pEditEngine, "NULL pointer" );
@@ -787,7 +727,7 @@ void EditWindow::SelPrevMark()
}
}
-sal_Bool EditWindow::HasMark(const String& rText) const
+bool EditWindow::HasMark(const String& rText) const
// returns true iff 'rText' contains a mark
{
return rText.SearchAscii("<?>", 0) != STRING_NOTFOUND;
@@ -827,15 +767,15 @@ void EditWindow::SetSelection(const ESelection &rSel)
mpEditView->SetSelection(rSel);
}
-sal_Bool EditWindow::IsEmpty() const
+bool EditWindow::IsEmpty() const
{
EditEngine *pEditEngine = ((EditWindow *) this)->GetEditEngine();
- return (pEditEngine && (pEditEngine->GetTextLen() == 0)) ? sal_True : sal_False;
+ return (pEditEngine && (pEditEngine->GetTextLen() == 0)) ? true : false;
}
-sal_Bool EditWindow::IsSelected() const
+bool EditWindow::IsSelected() const
{
- return mpEditView ? mpEditView->HasSelection() : sal_False;
+ return mpEditView ? mpEditView->HasSelection() : false;
}
void EditWindow::Cut()
diff --git a/sd/source/ui/notes/EditWindow.hxx b/sd/source/ui/notes/EditWindow.hxx
index e5bfa1c68d59..651654087fe4 100644
--- a/sd/source/ui/notes/EditWindow.hxx
+++ b/sd/source/ui/notes/EditWindow.hxx
@@ -102,9 +102,10 @@ private:
ESelection GetSelection() const;
void SetSelection(const ESelection &rSel);
- sal_Bool IsEmpty() const;
- sal_Bool IsSelected() const;
- sal_Bool IsAllSelected() const;
+ bool IsEmpty() const;
+ bool IsSelected() const;
+ bool IsAllSelected() const;
+
void Cut();
void Copy();
void Paste();
@@ -113,7 +114,8 @@ private:
void MarkError(const Point &rPos);
void SelNextMark();
void SelPrevMark();
- sal_Bool HasMark(const String &rText) const;
+
+ bool HasMark(const String &rText) const;
void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
};
diff --git a/sd/source/ui/notes/NotesDockingWindow.cxx b/sd/source/ui/notes/NotesDockingWindow.cxx
index 19961a500fc6..6505d645b0d1 100644
--- a/sd/source/ui/notes/NotesDockingWindow.cxx
+++ b/sd/source/ui/notes/NotesDockingWindow.cxx
@@ -54,7 +54,7 @@ NotesDockingWindow::NotesDockingWindow (
if (pBase != NULL)
{
SdDrawDocument* pDocument = pBase->GetDocument();
- mpEditWindow = new EditWindow (this, &pDocument->GetPool());
+ mpEditWindow = new EditWindow (this, &pDocument->GetItemPool());
mpEditWindow->Show();
TextLogger::Instance().ConnectToEditWindow (mpEditWindow);
}
diff --git a/sd/source/ui/notes/TextLogger.cxx b/sd/source/ui/notes/TextLogger.cxx
index 644b01b4c2ea..5e958bd1176b 100644
--- a/sd/source/ui/notes/TextLogger.cxx
+++ b/sd/source/ui/notes/TextLogger.cxx
@@ -118,7 +118,7 @@ IMPL_LINK(TextLogger, WindowEventHandler, VclWindowEvent*, pEvent)
break;
}
}
- return sal_True;
+ return true;
}
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 9f2319d395cd..2dc10fe0df31 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -131,7 +131,7 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
// Make the frame window transparent and make the parent able to
// draw behind it.
if (pParentWindow != NULL)
- pParentWindow->EnableChildTransparentMode(sal_True);
+ pParentWindow->EnableChildTransparentMode(true);
}
if (pWindow != NULL)
@@ -143,12 +143,12 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
if ( ! bEnableParentClip)
{
pWindow->SetParentClipMode(PARENTCLIPMODE_NOCLIP);
- pWindow->SetPaintTransparent(sal_True);
+ pWindow->SetPaintTransparent(true);
}
else
{
pWindow->SetParentClipMode(PARENTCLIPMODE_CLIP);
- pWindow->SetPaintTransparent(sal_False);
+ pWindow->SetPaintTransparent(false);
}
}
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 92d8aa51fb2f..2d216c630602 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -399,7 +399,7 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine (void)
pEditEngine = new EditEngine (mpEditEngineItemPool);
- pEditEngine->EnableUndo (sal_True);
+ pEditEngine->EnableUndo (true);
pEditEngine->SetDefTab (sal_uInt16(
Application::GetDefaultDevice()->GetTextWidth(
UniString::CreateFromAscii("XXXX"))));
@@ -454,8 +454,8 @@ void PresenterTextView::Implementation::SetBackgroundColor (const Color aColor)
DBG_ASSERT(mpEditEngine!=NULL, "EditEngine missing");
DBG_ASSERT(mpEditEngineItemPool!=NULL, "EditEngineItemPool missing");
mpEditEngine->SetBackgroundColor(aColor);
- mpEditEngine->EnableAutoColor(sal_False);
- mpEditEngine->ForceAutoColor(sal_False);
+ mpEditEngine->EnableAutoColor(false);
+ mpEditEngine->ForceAutoColor(false);
}
@@ -572,7 +572,7 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap (void
delete mpOutputDevice;
mpOutputDevice = new VirtualDevice(*Application::GetDefaultDevice(), 0, 0);
mpOutputDevice->SetMapMode(MAP_PIXEL);
- mpOutputDevice->SetOutputSizePixel(maSize, sal_True);
+ mpOutputDevice->SetOutputSizePixel(maSize, true);
mpOutputDevice->SetLineColor();
mpOutputDevice->SetFillColor();
mpOutputDevice->SetBackground(Wallpaper());
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index b8534bdb993c..9413dfff3ac5 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -203,8 +203,8 @@ BitmapEx SlideRenderer::CreatePreview (
0);
// Determine the size of the current slide and its aspect ratio.
- Size aPageSize = pPage->GetSize();
- if (aPageSize.Height() <= 0)
+ const basegfx::B2DVector& rPageSize = pPage->GetPageScale();
+ if (basegfx::fTools::lessOrEqual(rPageSize.getY(), 0.0))
throw lang::IllegalArgumentException(
OUString::createFromAscii("SlideRenderer::createPreview() called with invalid size"),
static_cast<XWeak*>(this),
@@ -215,7 +215,7 @@ BitmapEx SlideRenderer::CreatePreview (
// a) will have the aspect ratio of the page and
// b) will be as large as possible.
awt::Size aPreviewSize (calculatePreviewSize(
- double(aPageSize.Width()) / double(aPageSize.Height()),
+ rPageSize.getX() / rPageSize.getY(),
rMaximalSize));
if (aPreviewSize.Width <= 0 || aPreviewSize.Height <= 0)
return BitmapEx();
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index 25f98b0faf79..aa1d7c36d9cb 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -55,7 +55,7 @@ ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, ::
, mnPauseTimeout( SLIDE_NO_TIMEOUT )
, mnRestartPageIndex( PAGE_NO_END )
, meShowWindowMode(SHOWWINDOWMODE_NORMAL)
-, mbShowNavigatorAfterSpecialMode( sal_False )
+, mbShowNavigatorAfterSpecialMode( false )
, mbMouseAutoHide(true)
, mbMouseCursorHidden(false)
, mnFirstMouseMove(0)
@@ -65,7 +65,7 @@ ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, ::
// Do never mirror the preview window. This explicitly includes right
// to left writing environments.
- EnableRTL (sal_False);
+ EnableRTL (false);
MapMode aMap(GetMapMode());
aMap.SetMapUnit(MAP_100TH_MM);
@@ -101,7 +101,7 @@ ShowWindow::~ShowWindow(void)
void ShowWindow::KeyInput(const KeyEvent& rKEvt)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if( SHOWWINDOWMODE_PREVIEW == meShowWindowMode )
{
@@ -218,7 +218,7 @@ void ShowWindow::MouseMove(const MouseEvent& /*rMEvt*/)
sal_uLong nTime = Time::GetSystemTicks();
if( (nTime - mnFirstMouseMove) >= SHOW_MOUSE_TIMEOUT )
{
- ShowPointer( sal_True );
+ ShowPointer( true );
mnFirstMouseMove = 0;
mbMouseCursorHidden = false;
maMouseTimer.SetTimeout( HIDE_MOUSE_TIMEOUT );
@@ -314,7 +314,7 @@ void ShowWindow::Paint(const Rectangle& rRect)
}
else if( SHOWWINDOWMODE_PAUSE == meShowWindowMode )
{
- DrawPauseScene( sal_False );
+ DrawPauseScene( false );
}
else if( SHOWWINDOWMODE_BLANK == meShowWindowMode )
{
@@ -331,18 +331,7 @@ void ShowWindow::Paint(const Rectangle& rRect)
long ShowWindow::Notify(NotifyEvent& rNEvt)
{
- long nOK = sal_False;
-/*
- if( mpViewShell && rNEvt.GetType() == EVENT_GETFOCUS )
- {
- NotifyEvent aNEvt(EVENT_GETFOCUS, this);
- nOK = mpViewShell->GetViewFrame()->GetWindow().Notify(aNEvt);
- }
-*/
- if (!nOK)
- nOK = Window::Notify(rNEvt);
-
- return nOK;
+ return Window::Notify(rNEvt);
}
@@ -387,7 +376,7 @@ void ShowWindow::Move()
// -----------------------------------------------------------------------------
-sal_Bool ShowWindow::SetEndMode()
+bool ShowWindow::SetEndMode()
{
if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
{
@@ -400,8 +389,8 @@ sal_Bool ShowWindow::SetEndMode()
// hide navigator if it is visible
if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
{
- mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
- mbShowNavigatorAfterSpecialMode = sal_True;
+ mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, false );
+ mbShowNavigatorAfterSpecialMode = true;
}
Invalidate();
@@ -412,7 +401,7 @@ sal_Bool ShowWindow::SetEndMode()
// -----------------------------------------------------------------------------
-sal_Bool ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout, Graphic* pLogo )
+bool ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeout, Graphic* pLogo )
{
rtl::Reference< SlideShow > xSlideShow;
@@ -436,8 +425,8 @@ sal_Bool ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTim
// hide navigator if it is visible
if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
{
- mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
- mbShowNavigatorAfterSpecialMode = sal_True;
+ mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, false );
+ mbShowNavigatorAfterSpecialMode = true;
}
if( pLogo )
@@ -454,7 +443,7 @@ sal_Bool ShowWindow::SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTim
// -----------------------------------------------------------------------------
-sal_Bool ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor )
+bool ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor )
{
if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
{
@@ -468,8 +457,8 @@ sal_Bool ShowWindow::SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& r
// hide navigator if it is visible
if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
{
- mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_False );
- mbShowNavigatorAfterSpecialMode = sal_True;
+ mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, false );
+ mbShowNavigatorAfterSpecialMode = true;
}
Invalidate();
@@ -503,8 +492,8 @@ void ShowWindow::TerminateShow()
// show navigator?
if( mbShowNavigatorAfterSpecialMode )
{
- mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True );
- mbShowNavigatorAfterSpecialMode = sal_False;
+ mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, true );
+ mbShowNavigatorAfterSpecialMode = false;
}
}
@@ -561,14 +550,14 @@ void ShowWindow::RestartShow( sal_Int32 nPageIndexToRestart )
// show navigator?
if( mbShowNavigatorAfterSpecialMode )
{
- mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, sal_True );
- mbShowNavigatorAfterSpecialMode = sal_False;
+ mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, true );
+ mbShowNavigatorAfterSpecialMode = false;
}
}
// -----------------------------------------------------------------------------
-void ShowWindow::DrawPauseScene( sal_Bool bTimeoutOnly )
+void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
{
const MapMode& rMap = GetMapMode();
const Point aOutOrg( PixelToLogic( Point() ) );
@@ -576,7 +565,7 @@ void ShowWindow::DrawPauseScene( sal_Bool bTimeoutOnly )
const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, rMap ) );
const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MAP_100TH_MM, rMap ) );
String aText( SdResId( STR_PRES_PAUSE ) );
- sal_Bool bDrawn = sal_False;
+ bool bDrawn = false;
Font aFont( GetSettings().GetStyleSettings().GetMenuFont() );
const Font aOldFont( GetFont() );
@@ -629,7 +618,7 @@ void ShowWindow::DrawPauseScene( sal_Bool bTimeoutOnly )
aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " )" ));
aVDev.DrawText( Point( aOffset.Width(), 0 ), aText );
DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, aVDev );
- bDrawn = sal_True;
+ bDrawn = true;
}
}
@@ -676,7 +665,7 @@ IMPL_LINK( ShowWindow, PauseTimeoutHdl, Timer*, pTimer )
RestartShow();
else
{
- DrawPauseScene( sal_True );
+ DrawPauseScene( true );
pTimer->Start();
}
@@ -694,7 +683,7 @@ IMPL_LINK( ShowWindow, MouseTimeoutHdl, Timer*, EMPTYARG )
else
{
// mouse has been idle to long, hide pointer
- ShowPointer( sal_False );
+ ShowPointer( false );
mbMouseCursorHidden = true;
}
return 0L;
@@ -725,7 +714,7 @@ void ShowWindow::DeleteWindowFromPaintView()
sal_uInt16 nChild = GetChildCount();
while( nChild-- )
- GetChild( nChild )->Show( sal_False );
+ GetChild( nChild )->Show( false );
}
void ShowWindow::AddWindowToPaintView()
@@ -735,7 +724,7 @@ void ShowWindow::AddWindowToPaintView()
sal_uInt16 nChild = GetChildCount();
while( nChild-- )
- GetChild( nChild )->Show( sal_True );
+ GetChild( nChild )->Show( true );
}
} // end of namespace sd
diff --git a/sd/source/ui/slideshow/showwindow.hxx b/sd/source/ui/slideshow/showwindow.hxx
index 1a33f52c81b9..2db511087035 100644
--- a/sd/source/ui/slideshow/showwindow.hxx
+++ b/sd/source/ui/slideshow/showwindow.hxx
@@ -75,9 +75,9 @@ public:
ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, ::Window* pParent );
virtual ~ShowWindow (void);
- sal_Bool SetEndMode();
- sal_Bool SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL );
- sal_Bool SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
+ bool SetEndMode();
+ bool SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL );
+ bool SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
const Color& GetBlankColor() const { return maShowBackground.GetColor(); }
@@ -107,7 +107,7 @@ public:
void RestartShow();
private:
- void DrawPauseScene( sal_Bool bTimeoutOnly );
+ void DrawPauseScene( bool bTimeoutOnly );
void DrawEndScene();
void DrawBlankScene();
@@ -122,7 +122,7 @@ private:
sal_uLong mnPauseTimeout;
sal_Int32 mnRestartPageIndex;
ShowWindowMode meShowWindowMode;
- sal_Bool mbShowNavigatorAfterSpecialMode;
+ bool mbShowNavigatorAfterSpecialMode;
Rectangle maPresArea;
bool mbMouseAutoHide;
bool mbMouseCursorHidden;
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 3b63dec31b46..29f4e53e19a7 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -44,6 +44,7 @@
#include <toolkit/unohlp.hxx>
#include <svx/unoprov.hxx>
+#include <svx/globaldrawitempool.hxx>
#include "framework/FrameworkHelper.hxx"
@@ -165,7 +166,7 @@ const SfxItemPropertyMapEntry* ImplGetPresentationPropertyMap()
SlideShow::SlideShow( SdDrawDocument* pDoc )
: SlideshowBase( m_aMutex )
-, maPropSet(ImplGetPresentationPropertyMap(), SdrObject::GetGlobalDrawObjectItemPool())
+, maPropSet(ImplGetPresentationPropertyMap(), GetGlobalDrawObjectItemPool())
, mbIsInStartup(false)
, mpDoc( pDoc )
, mpCurrentViewShellBase( 0 )
@@ -747,7 +748,7 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame().GetWindow().GetParent());
if( pWorkWindow )
{
- pWorkWindow->StartPresentationMode( sal_False, isAlwaysOnTop() );
+ pWorkWindow->StartPresentationMode( false, isAlwaysOnTop() );
}
}
}
@@ -786,7 +787,7 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
framework::FrameworkHelper::GetViewURL(ePreviousType),
framework::FrameworkHelper::msCenterPaneURL);
- pViewShell->GetViewFrame()->GetBindings().InvalidateAll( sal_True );
+ pViewShell->GetViewFrame()->GetBindings().InvalidateAll( true );
}
}
}
@@ -805,7 +806,7 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
// switch to the previously visible Slide
DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>( pViewShell );
if( pDrawViewShell )
- pDrawViewShell->SwitchPage( (sal_uInt16)xController->getRestoreSlide() );
+ pDrawViewShell->SwitchPage( xController->getRestoreSlide() );
else
{
Reference<XDrawView> xDrawView (
@@ -1231,8 +1232,8 @@ void SlideShow::StartFullscreenPresentation( )
const sal_Int32 nDisplay (GetDisplay());
WorkWindow* pWorkWindow = new FullScreenWorkWindow(this, mpCurrentViewShellBase);
pWorkWindow->SetBackground(Wallpaper(COL_BLACK));
- pWorkWindow->StartPresentationMode( sal_True, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PRESENTATION_HIDEALLAPPS : 0, nDisplay);
- // pWorkWindow->ShowFullScreenMode(sal_False, nDisplay);
+ pWorkWindow->StartPresentationMode(true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PRESENTATION_HIDEALLAPPS : 0, nDisplay);
+ // pWorkWindow->ShowFullScreenMode(FALSE, nDisplay);
if (pWorkWindow->IsVisible())
{
@@ -1244,7 +1245,7 @@ void SlideShow::StartFullscreenPresentation( )
if( mpFullScreenFrameView )
delete mpFullScreenFrameView;
- mpFullScreenFrameView = new FrameView(mpDoc, pOriginalFrameView);
+ mpFullScreenFrameView = new FrameView(*mpDoc, pOriginalFrameView);
// Reference<XController> xController;
@@ -1252,7 +1253,7 @@ void SlideShow::StartFullscreenPresentation( )
// new view shell--a prerequisite to process slot calls and initialize
// its panes--a GrabFocus() has to be called later on.
SfxFrame* pNewFrame = SfxFrame::Create( *mpDoc->GetDocSh(), *pWorkWindow, PRESENTATION_FACTORY_ID, true );
- pNewFrame->SetPresentationMode(sal_True);
+ pNewFrame->SetPresentationMode(true);
mpFullScreenViewShellBase = static_cast<ViewShellBase*>(pNewFrame->GetCurrentViewFrame()->GetViewShell());
if(mpFullScreenViewShellBase != NULL)
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 3665b5858180..afb0c4e936d9 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -686,7 +686,7 @@ void SAL_CALL SlideshowImpl::disposing()
mpView->DeleteWindowFromPaintView( mpShowWindow );
if( mpView )
- mpView->SetAnimationPause( sal_False );
+ mpView->SetAnimationPause( false );
if( mpViewShell )
{
@@ -722,7 +722,7 @@ void SAL_CALL SlideshowImpl::disposing()
}
// aktuelle Fenster wieder einblenden
- if( mpViewShell && !mpViewShell->ISA(PresentationViewShell))
+ if( mpViewShell && !dynamic_cast< PresentationViewShell* >(mpViewShell))
{
if( meAnimationMode == ANIMATIONMODE_SHOW )
{
@@ -764,7 +764,7 @@ void SAL_CALL SlideshowImpl::disposing()
// restart the custom show dialog if he started us
if( mpViewShell->IsStartShowWithDialog() && getDispatcher() )
{
- mpViewShell->SetStartShowWithDialog( sal_False );
+ mpViewShell->SetStartShowWithDialog( false );
getDispatcher()->Execute( SID_CUSTOMSHOW_DLG, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
}
@@ -848,7 +848,7 @@ bool SlideshowImpl::startPreview(
if( mpView )
{
mpView->AddWindowToPaintView( mpShowWindow );
- mpView->SetAnimationPause( sal_True );
+ mpView->SetAnimationPause( true );
}
// call resize handler
@@ -955,7 +955,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
{
// we are in notes page mode, so get
// the corresponding draw page
- const sal_uInt16 nPgNum = ( pStartPage->GetPageNum() - 2 ) >> 1;
+ const sal_uInt32 nPgNum = ( pStartPage->GetPageNumber() - 2 ) >> 1;
pStartPage = mpDoc->GetSdPage( nPgNum, PK_STANDARD );
}
}
@@ -988,7 +988,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
if( bStartWithActualSlide )
{
- sal_Int32 nSlideNum = ( pStartPage->GetPageNum() - 1 ) >> 1;
+ sal_Int32 nSlideNum = ( pStartPage->GetPageNumber() - 1 ) >> 1;
if( !maPresSettings.mbAll && !maPresSettings.mbCustomShow )
{
@@ -997,7 +997,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
sal_Int32 nSlide;
for( nSlide = 0; (nSlide < nSlideCount); nSlide++ )
{
- if( mpDoc->GetSdPage( (sal_uInt16) nSlide, PK_STANDARD )->GetName() == aPresSlide )
+ if( mpDoc->GetSdPage( (sal_uInt32) nSlide, PK_STANDARD )->GetName() == aPresSlide )
break;
}
@@ -1011,7 +1011,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
// remember Slide number from where the show was started
if( pStartPage )
- mnRestoreSlide = ( pStartPage->GetPageNum() - 1 ) / 2;
+ mnRestoreSlide = ( pStartPage->GetPageNumber() - 1 ) / 2;
if( mpSlideController->hasSlides() )
{
@@ -1036,7 +1036,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
// these Slots are forbiden in other views for this document
if( mpDocSh )
{
- mpDocSh->SetSlotFilter( sal_True, sizeof( pAllowed ) / sizeof( sal_uInt16 ), pAllowed );
+ mpDocSh->SetSlotFilter( true, sizeof( pAllowed ) / sizeof( sal_uInt16 ), pAllowed );
mpDocSh->ApplySlotFilter();
}
@@ -1086,7 +1086,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
if( mpView )
{
mpView->AddWindowToPaintView( mpShowWindow );
- mpView->SetAnimationPause( sal_True );
+ mpView->SetAnimationPause( true );
}
SfxBindings* pBindings = getBindings();
@@ -1658,7 +1658,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape, const ::com::sun::
if( INET_PROT_FILE == aURL.GetProtocol() )
{
SfxStringItem aUrl( SID_FILE_NAME, aURL.GetMainURL( INetURLObject::NO_DECODE ) );
- SfxBoolItem aBrowsing( SID_BROWSE, sal_True );
+ SfxBoolItem aBrowsing( SID_BROWSE, true );
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
@@ -1707,7 +1707,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape, const ::com::sun::
{
// todo, better do it async?
SdrObject* pObj = GetSdrObjectFromXShape( xShape );
- SdrOle2Obj* pOleObject = PTR_CAST(SdrOle2Obj, pObj);
+ SdrOle2Obj* pOleObject = dynamic_cast< SdrOle2Obj* >(pObj);
if (pOleObject && mpViewShell )
mpViewShell->ActivateObject(pOleObject, pEvent->mnVerb);
}
@@ -1721,9 +1721,9 @@ void SlideshowImpl::click( const Reference< XShape >& xShape, const ::com::sun::
sal_Int32 SlideshowImpl::getSlideNumberForBookmark( const OUString& rStrBookmark )
{
- sal_Bool bIsMasterPage;
+ bool bIsMasterPage;
OUString aBookmark = getUiNameFromPageApiNameImpl( rStrBookmark );
- sal_uInt16 nPgNum = mpDoc->GetPageByName( aBookmark, bIsMasterPage );
+ sal_uInt32 nPgNum = mpDoc->GetPageByName( aBookmark, bIsMasterPage );
if( nPgNum == SDRPAGE_NOTFOUND )
{
@@ -1732,8 +1732,13 @@ sal_Int32 SlideshowImpl::getSlideNumberForBookmark( const OUString& rStrBookmark
if( pObj )
{
- nPgNum = pObj->GetPage()->GetPageNum();
- bIsMasterPage = (sal_Bool)pObj->GetPage()->IsMasterPage();
+ SdrPage* pOwningPage = pObj->getSdrPageFromSdrObject();
+
+ if(pOwningPage)
+ {
+ nPgNum = pOwningPage->GetPageNumber();
+ bIsMasterPage = pOwningPage->IsMasterPage();
+ }
}
}
@@ -2246,13 +2251,13 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
Reference< ::com::sun::star::frame::XFrame > xFrame( pViewFrame->GetFrame().GetFrameInterface() );
if( xFrame.is() )
{
- pMenu->SetItemImage( CM_NEXT_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10617") ), sal_False, sal_False ) );
- pMenu->SetItemImage( CM_PREV_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10618") ), sal_False, sal_False ) );
+ pMenu->SetItemImage( CM_NEXT_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10617") ), false, false ) );
+ pMenu->SetItemImage( CM_PREV_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10618") ), false, false ) );
if( pPageMenu )
{
- pPageMenu->SetItemImage( CM_FIRST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10616") ), sal_False, sal_False ) );
- pPageMenu->SetItemImage( CM_LAST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10619") ), sal_False, sal_False ) );
+ pPageMenu->SetItemImage( CM_FIRST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10616") ), false, false ) );
+ pPageMenu->SetItemImage( CM_LAST_SLIDE, GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( "slot:10619") ), false, false ) );
}
}
}
@@ -2263,7 +2268,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
const sal_Int32 nPageNumberCount = mpSlideController->getSlideNumberCount();
if( nPageNumberCount <= 1 )
{
- pMenu->EnableItem( CM_GOTO, sal_False );
+ pMenu->EnableItem( CM_GOTO, false );
}
else
{
@@ -2280,7 +2285,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG )
{
if( mpSlideController->isVisibleSlideNumber( nPageNumber ) )
{
- SdPage* pPage = mpDoc->GetSdPage((sal_uInt16)nPageNumber, PK_STANDARD);
+ SdPage* pPage = mpDoc->GetSdPage((sal_uInt32)nPageNumber, PK_STANDARD);
if (pPage)
{
pPageMenu->InsertItem( (sal_uInt16)(CM_SLIDES + nPageNumber), pPage->GetName() );
@@ -2559,16 +2564,16 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
if( rPresSlide.Len() )
{
sal_Int32 nSlide;
- sal_Bool bTakeNextAvailable = sal_False;
+ bool bTakeNextAvailable = false;
for( nSlide = 0, nFirstSlide = -1; ( nSlide < nSlideCount ) && ( -1 == nFirstSlide ); nSlide++ )
{
- SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt16)nSlide, PK_STANDARD );
+ SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt32)nSlide, PK_STANDARD );
if( pTestSlide->GetName() == rPresSlide )
{
if( pTestSlide->IsExcluded() )
- bTakeNextAvailable = sal_True;
+ bTakeNextAvailable = true;
else
nFirstSlide = nSlide;
}
@@ -2583,7 +2588,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
for( sal_Int32 i = 0; i < nSlideCount; i++ )
{
- bool bVisible = ( mpDoc->GetSdPage( (sal_uInt16)i, PK_STANDARD ) )->IsExcluded() ? false : true;
+ bool bVisible = ( mpDoc->GetSdPage( (sal_uInt32)i, PK_STANDARD ) )->IsExcluded() ? false : true;
if( bVisible || (eMode == AnimationSlideController::ALL) )
mpSlideController->insertSlideNumber( i, bVisible );
}
@@ -2596,7 +2601,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
{
sal_Int32 nSlide;
for( nSlide = 0; nSlide < nSlideCount; nSlide++ )
- if( rPresSlide == mpDoc->GetSdPage( (sal_uInt16) nSlide, PK_STANDARD )->GetName() )
+ if( rPresSlide == mpDoc->GetSdPage( (sal_uInt32) nSlide, PK_STANDARD )->GetName() )
break;
if( nSlide < nSlideCount )
@@ -2607,7 +2612,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
sal_Int32 nSlideIndex;
for( pCustomSlide = pCustomShow->First(),nSlideIndex=0; pCustomSlide; pCustomSlide = pCustomShow->Next(), nSlideIndex++ )
{
- const sal_uInt16 nSdSlide = ( ( (SdPage*) pCustomSlide )->GetPageNum() - 1 ) / 2;
+ const sal_uInt32 nSdSlide = ( ( (SdPage*) pCustomSlide )->GetPageNumber() - 1 ) / 2;
if( !( mpDoc->GetSdPage( nSdSlide, PK_STANDARD ) )->IsExcluded())
mpSlideController->insertSlideNumber( nSdSlide );
@@ -2656,7 +2661,7 @@ void SlideshowImpl::hideChildWindows()
if( pViewFrame->GetChildWindow( nId ) )
{
- pViewFrame->SetChildWindow( nId, sal_False );
+ pViewFrame->SetChildWindow( nId, false );
mnChildMask |= 1 << i;
}
}
@@ -2678,7 +2683,7 @@ void SlideshowImpl::showChildWindows()
for( sal_uLong i = 0, nCount = sizeof( aShowChilds ) / sizeof( FncGetChildWindowId ); i < nCount; i++ )
{
if( mnChildMask & ( 1 << i ) )
- pViewFrame->SetChildWindow( ( *aShowChilds[ i ] )(), sal_True );
+ pViewFrame->SetChildWindow( ( *aShowChilds[ i ] )(), true );
}
}
}
@@ -2753,7 +2758,7 @@ void SlideshowImpl::setActiveXToolbarsVisible( sal_Bool bVisible )
// actually it runs always in window mode in case of ActiveX control
if ( !maPresSettings.mbFullScreen && mpDocSh && mpDocSh->GetMedium() )
{
- SFX_ITEMSET_ARG( mpDocSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY, sal_False );
+ SFX_ITEMSET_ARG( mpDocSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY );
if ( pItem && pItem->GetValue() )
{
// this is a plugin/activex mode, no toolbars should be visible during slide show
@@ -2806,11 +2811,11 @@ void SAL_CALL SlideshowImpl::activate() throw (RuntimeException)
if( pDispatcher )
{
// filter all forbiden slots
- pDispatcher->SetSlotFilter( sal_True, sizeof(pAllowed) / sizeof(sal_uInt16), pAllowed );
+ pDispatcher->SetSlotFilter( true, sizeof(pAllowed) / sizeof(sal_uInt16), pAllowed );
}
if( getBindings() )
- getBindings()->InvalidateAll(sal_True);
+ getBindings()->InvalidateAll(true);
mpShowWindow->GrabFocus();
}
@@ -2895,8 +2900,8 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq)
const String aTarget( ((SfxStringItem&) pArgs->Get(SID_NAVIGATOR_OBJECT)).GetValue() );
// is the bookmark a Slide?
- sal_Bool bIsMasterPage;
- sal_uInt16 nPgNum = mpDoc->GetPageByName( aTarget, bIsMasterPage );
+ bool bIsMasterPage;
+ sal_uInt32 nPgNum = mpDoc->GetPageByName( aTarget, bIsMasterPage );
SdrObject* pObj = NULL;
if( nPgNum == SDRPAGE_NOTFOUND )
@@ -2905,7 +2910,14 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq)
pObj = mpDoc->GetObj( aTarget );
if( pObj )
- nPgNum = pObj->GetPage()->GetPageNum();
+ {
+ SdrPage* pOwningPage = pObj->getSdrPageFromSdrObject();
+
+ if(pOwningPage)
+ {
+ nPgNum = pOwningPage->GetPageNumber();
+ }
+ }
}
if( nPgNum != SDRPAGE_NOTFOUND )
diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx
index 839ca130ef70..8fe137207e5c 100644
--- a/sd/source/ui/slideshow/slideshowviewimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx
@@ -362,18 +362,18 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation( ) throw (Ru
}
SdPage* pP = mpDoc->GetSdPage( 0, PK_STANDARD );
- Size aPageSize( pP->GetSize() );
+ const basegfx::B2DVector& rPageSize = pP->GetPageScale();
- const double page_ratio = (double)aPageSize.Width() / (double)aPageSize.Height();
+ const double page_ratio = rPageSize.getX() / rPageSize.getY();
const double output_ratio = (double)aOutputSize.Width() / (double)aOutputSize.Height();
if( page_ratio > output_ratio )
{
- aOutputSize.Height() = ( aOutputSize.Width() * aPageSize.Height() ) / aPageSize.Width();
+ aOutputSize.Height() = basegfx::fround(( aOutputSize.Width() * rPageSize.getY() ) / rPageSize.getX());
}
else if( page_ratio < output_ratio )
{
- aOutputSize.Width() = ( aOutputSize.Height() * aPageSize.Width() ) / aPageSize.Height();
+ aOutputSize.Width() = basegfx::fround(( aOutputSize.Height() * rPageSize.getX() ) / rPageSize.getY());
}
Point aOutputOffset( ( aWindowSize.Width() - aOutputSize.Width() ) >> 1,
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx
index 43f90da65d7d..297b24ea23ac 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx
@@ -81,7 +81,7 @@ public:
*/
void Clear (void);
- /** Return <TRUE/> when the cache is full, i.e. the cache compactor had
+ /** Return <true/> when the cache is full, i.e. the cache compactor had
to be run.
*/
bool IsFull (void) const;
@@ -91,11 +91,11 @@ public:
*/
sal_Int32 GetSize (void);
- /** Return <TRUE/> when a preview bitmap exists for the given key.
+ /** Return <true/> when a preview bitmap exists for the given key.
*/
bool HasBitmap (const CacheKey& rKey);
- /** Return <TRUE/> when a preview bitmap exists for the given key and
+ /** Return <true/> when a preview bitmap exists for the given key and
when it is up-to-date.
*/
bool BitmapIsUpToDate (const CacheKey& rKey);
@@ -158,12 +158,12 @@ public:
part of) the cache. The entries of the index are sorted according
to last access times with the least recently access time first.
@param bIncludePrecious
- When this flag is <TRUE/> entries with the precious flag set are
- included in the index. When the flag is <FALSE/> these entries
+ When this flag is <true/> entries with the precious flag set are
+ included in the index. When the flag is <false/> these entries
are ommited.
@param bIncludeNoPreview
- When this flag is <TRUE/> entries with that have no preview
- bitmaps are included in the index. When the flag is <FALSE/> these entries
+ When this flag is <true/> entries with that have no preview
+ bitmaps are included in the index. When the flag is <false/> these entries
are ommited.
*/
::std::auto_ptr<CacheIndex> GetCacheIndex (
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx
index 66b05242e959..34a43f7d3a05 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx
@@ -25,11 +25,11 @@
#include "precompiled_sd.hxx"
#include "SlsBitmapCompressor.hxx"
-
#include <tools/stream.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/pngread.hxx>
#include <vcl/pngwrite.hxx>
+#include <memory.h>
namespace sd { namespace slidesorter { namespace cache {
diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx
index 1852e7e5600b..d29eeb704979 100644
--- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx
@@ -131,7 +131,7 @@ void RequestQueue::AddRequest (
#ifdef VERBOSE
OSL_TRACE("%s request for page %d with priority class %d",
bRemoved?"replaced":"added",
- (rRequestData.GetPage()->GetPageNum()-1)/2,
+ (rRequestData.GetPage()->GetPageNumber()-1)/2,
eRequestClass);
#endif
}
diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx
index 0c9f08465d3e..08d3fb21959a 100644
--- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx
@@ -53,8 +53,8 @@ public:
The priority class in which to insert the request with highest
or lowest priority.
@param bInsertWithHighestPriority
- When this flag is <TRUE/> the request is inserted with highes
- priority in its class. When <FALSE/> the request is inserted
+ When this flag is <true/> the request is inserted with highes
+ priority in its class. When <false/> the request is inserted
with lowest priority.
*/
void AddRequest (
@@ -67,9 +67,9 @@ public:
It is OK when the specified request is not a member of the
queue.
@return
- Returns <TRUE/> when the request has been successfully been
+ Returns <true/> when the request has been successfully been
removed from the queue. Otherwise, e.g. because the request was
- not a member of the queue, <FALSE/> is returned.
+ not a member of the queue, <false/> is returned.
*/
bool RemoveRequest (CacheKey aKey);
@@ -90,7 +90,7 @@ public:
*/
void PopFront (void);
- /** Returns <TRUE/> when there is no element in the queue.
+ /** Returns <true/> when there is no element in the queue.
*/
bool IsEmpty (void);
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 6b3a7bbc50cb..fbeeaf3edb9a 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -142,7 +142,8 @@ SlideSorterController::SlideSorterController (SlideSorter& rSlideSorter)
pWindow->SetBackground(Wallpaper());
pWindow->SetCenterAllowed(false);
pWindow->SetMapMode(MapMode(MAP_PIXEL));
- pWindow->SetViewSize(mrView.GetModelArea().GetSize());
+ const Size aNewSize(mrView.GetModelArea().GetSize());
+ pWindow->SetViewSize(basegfx::B2DVector(aNewSize.Width(), aNewSize.Height()));
}
}
@@ -212,9 +213,9 @@ void SlideSorterController::Dispose (void)
model::SharedPageDescriptor SlideSorterController::GetPageAt (
const Point& aWindowPosition)
{
- sal_Int32 nHitPageIndex (mrView.GetPageIndexAtPoint(aWindowPosition));
+ sal_uInt32 nHitPageIndex (mrView.GetPageIndexAtPoint(aWindowPosition));
model::SharedPageDescriptor pDescriptorAtPoint;
- if (nHitPageIndex >= 0)
+ if (SDRPAGE_NOTFOUND != nHitPageIndex)
{
pDescriptorAtPoint = mrModel.GetPageDescriptor(nHitPageIndex);
@@ -584,8 +585,9 @@ void SlideSorterController::PostModelChange (void)
mrView.PostModelChange ();
- pWindow->SetViewOrigin (Point (0,0));
- pWindow->SetViewSize (mrView.GetModelArea().GetSize());
+ pWindow->SetViewOrigin(basegfx::B2DPoint(0.0, 0.0));
+ const Size aOldSize(mrView.GetModelArea().GetSize());
+ pWindow->SetViewSize(basegfx::B2DVector(aOldSize.Width(), aOldSize.Height()));
// The visibility of the scroll bars may have to be changed. Then
// the size of the view has to change, too. Let Rearrange() handle
@@ -661,8 +663,8 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
// Update the draw mode.
sal_uLong nDrawMode (Application::GetSettings().GetStyleSettings().GetHighContrastMode()
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR);
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR);
if (mrSlideSorter.GetViewShell() != NULL)
mrSlideSorter.GetViewShell()->GetFrameView()->SetDrawMode(nDrawMode);
if (pActiveWindow != NULL)
@@ -685,7 +687,7 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
}
}
- return sal_True;
+ return true;
}
@@ -722,34 +724,30 @@ void SlideSorterController::GetCtrlState (SfxItemSet& rSet)
switch (nMode)
{
- case ViewShell::OUTPUT_DRAWMODE_COLOR:
+ case SD_OUTPUT_DRAWMODE_COLOR:
nQuality = 0;
break;
- case ViewShell::OUTPUT_DRAWMODE_GRAYSCALE:
+ case SD_OUTPUT_DRAWMODE_GRAYSCALE:
nQuality = 1;
break;
- case ViewShell::OUTPUT_DRAWMODE_BLACKWHITE:
+ case SD_OUTPUT_DRAWMODE_BLACKWHITE:
nQuality = 2;
break;
- case ViewShell::OUTPUT_DRAWMODE_CONTRAST:
+ case SD_OUTPUT_DRAWMODE_CONTRAST:
nQuality = 3;
break;
}
- rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_COLOR,
- (sal_Bool)(nQuality==0)));
- rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_GRAYSCALE,
- (sal_Bool)(nQuality==1)));
- rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_BLACKWHITE,
- (sal_Bool)(nQuality==2)));
- rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_CONTRAST,
- (sal_Bool)(nQuality==3)));
+ rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_COLOR, nQuality == 0));
+ rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_GRAYSCALE, nQuality == 1));
+ rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_BLACKWHITE, nQuality == 2));
+ rSet.Put (SfxBoolItem (SID_OUTPUT_QUALITY_CONTRAST, nQuality == 3));
}
}
if (rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) == SFX_ITEM_AVAILABLE)
{
- rSet.Put (SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, sal_True));
+ rSet.Put (SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, true));
}
}
@@ -917,7 +915,7 @@ void SlideSorterController::PrepareEditModeChange (void)
// Remember the current page.
if (mrSlideSorter.GetViewShell() != NULL)
mnCurrentPageBeforeSwitch = (mrSlideSorter.GetViewShell()->GetViewShellBase()
- .GetMainViewShell()->GetActualPage()->GetPageNum()-1)/2;
+ .GetMainViewShell()->GetActualPage()->GetPageNumber()-1)/2;
}
}
@@ -996,7 +994,7 @@ void SlideSorterController::PageNameHasChanged (int nPageIndex, const String& rs
break;
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
- xAccessible (pWindow->GetAccessible(sal_False));
+ xAccessible (pWindow->GetAccessible(false));
if ( ! xAccessible.is())
break;
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 68273be72112..eb08f0c514bf 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -266,7 +266,7 @@ void Clipboard::DoDelete (::Window* )
void Clipboard::DoCopy (::Window* pWindow )
{
- CreateSlideTransferable( pWindow, sal_False );
+ CreateSlideTransferable( pWindow, false );
}
@@ -354,14 +354,14 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition)
rModel.GetDocument()->InsertBookmarkAsPage(
const_cast<List*>(&rBookmarkList),
NULL,
- sal_False,
- sal_False,
+ false,
+ false,
nInsertIndex,
- sal_False,
+ false,
pClipTransferable->GetPageDocShell(),
- sal_True,
+ true,
bMergeMasterPages,
- sal_False);
+ false);
}
else
{
@@ -379,14 +379,14 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition)
rModel.GetDocument()->InsertBookmarkAsPage(
NULL,
NULL,
- sal_False,
- sal_False,
+ false,
+ false,
nInsertIndex,
- sal_False,
+ false,
pDataDocSh,
- sal_True,
+ true,
bMergeMasterPages,
- sal_False);
+ false);
}
}
mrController.HandleModelChange();
@@ -497,8 +497,9 @@ void Clipboard::CreateSlideTransferable (
pActionWindow = pViewShell->GetActiveWindow();
}
- pTransferable->SetStartPos (pActionWindow->PixelToLogic(
- pActionWindow->GetPointerPosPixel()));
+ const basegfx::B2DPoint aPointerPosPixel(pActionWindow->GetPointerPosPixel().X(), pActionWindow->GetPointerPosPixel().Y());
+
+ pTransferable->SetStartPos(pActionWindow->GetInverseViewTransformation() * aPointerPosPixel);
pTransferable->SetObjectDescriptor (aObjDesc);
{
@@ -565,7 +566,7 @@ void Clipboard::CreateSlideTransferable (
SdDrawDocument* pTransferableDocument = rSlideSorter.GetModel().GetDocument();
if (pTransferableDocument == NULL)
break;
- sal_Bool bIsMasterPage = sal_False;
+ bool bIsMasterPage(false);
const sal_uInt16 nPageIndex (pTransferableDocument->GetPageByName(sBookmark, bIsMasterPage));
if (nPageIndex == SDRPAGE_NOTFOUND)
break;
@@ -709,8 +710,8 @@ sal_Int8 Clipboard::AcceptDrop (
const AcceptDropEvent& rEvent,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
sal_Int8 nAction (DND_ACTION_NONE);
@@ -756,12 +757,12 @@ sal_Int8 Clipboard::AcceptDrop (
case DT_SHAPE:
nAction = ExecuteOrAcceptShapeDrop(
DC_ACCEPT,
- rEvent.maPosPixel,
+ basegfx::B2DPoint(rEvent.maPosPixel.X(), rEvent.maPosPixel.Y()),
&rEvent,
rTargetHelper,
pTargetWindow,
nPage,
- nLayer);
+ aLayer);
break;
default:
@@ -780,8 +781,8 @@ sal_Int8 Clipboard::ExecuteDrop (
const ExecuteDropEvent& rEvent,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
sal_Int8 nResult = DND_ACTION_NONE;
mpUndoContext.reset();
@@ -795,9 +796,9 @@ sal_Int8 Clipboard::ExecuteDrop (
SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag;
const Point aEventModelPosition (
pTargetWindow->PixelToLogic (rEvent.maPosPixel));
- const sal_Int32 nXOffset (labs (pDragTransferable->GetStartPos().X()
+ const sal_Int32 nXOffset (labs (basegfx::fround(pDragTransferable->GetStartPos().getX())
- aEventModelPosition.X()));
- const sal_Int32 nYOffset (labs (pDragTransferable->GetStartPos().Y()
+ const sal_Int32 nYOffset (labs (basegfx::fround(pDragTransferable->GetStartPos().getY())
- aEventModelPosition.Y()));
bool bContinue =
( pDragTransferable->GetView() != &mrSlideSorter.GetView() )
@@ -865,12 +866,12 @@ sal_Int8 Clipboard::ExecuteDrop (
case DT_SHAPE:
nResult = ExecuteOrAcceptShapeDrop(
DC_EXECUTE,
- rEvent.maPosPixel,
+ basegfx::B2DPoint(rEvent.maPosPixel.X(), rEvent.maPosPixel.Y()),
&rEvent,
rTargetHelper,
pTargetWindow,
nPage,
- nLayer);
+ aLayer);
break;
default:
@@ -981,12 +982,12 @@ Clipboard::DropType Clipboard::IsDropAccepted (DropTargetHelper&) const
sal_Int8 Clipboard::ExecuteOrAcceptShapeDrop (
DropCommand eCommand,
- const Point& rPosition,
+ const basegfx::B2DPoint& rPosition,
const void* pDropEvent,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
sal_Int8 nResult = 0;
@@ -1008,9 +1009,10 @@ sal_Int8 Clipboard::ExecuteOrAcceptShapeDrop (
// number of the page under the mouse.
if (nPage == SDRPAGE_NOTFOUND)
{
+ const Point aOldPoint(basegfx::fround(rPosition.getX()), basegfx::fround(rPosition.getY()));
model::SharedPageDescriptor pDescriptor (
mrSlideSorter.GetModel().GetPageDescriptor(
- mrSlideSorter.GetView().GetPageIndexAtPoint(rPosition)));
+ mrSlideSorter.GetView().GetPageIndexAtPoint(aOldPoint)));
if (pDescriptor)
nPage = pDescriptor->GetPageIndex();
}
@@ -1027,7 +1029,7 @@ sal_Int8 Clipboard::ExecuteOrAcceptShapeDrop (
rTargetHelper,
pTargetWindow,
nPage,
- nLayer);
+ aLayer);
break;
case DC_EXECUTE:
@@ -1036,7 +1038,7 @@ sal_Int8 Clipboard::ExecuteOrAcceptShapeDrop (
rTargetHelper,
pTargetWindow,
nPage,
- nLayer);
+ aLayer);
break;
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
index 0aa9f0859393..2235049e85ad 100644
--- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
@@ -116,7 +116,7 @@ void CurrentSlideManager::ReleaseCurrentSlide (void)
bool CurrentSlideManager::IsCurrentSlideIsValid (void)
{
- return mnCurrentSlideIndex >= 0 && mnCurrentSlideIndex<mrSlideSorter.GetModel().GetPageCount();
+ return mnCurrentSlideIndex >= 0 && mnCurrentSlideIndex < (sal_Int32)mrSlideSorter.GetModel().GetPageCount();
}
@@ -157,7 +157,7 @@ void CurrentSlideManager::SwitchCurrentSlide (
if (rpDescriptor.get() != NULL && mpCurrentSlide!=rpDescriptor)
{
ReleaseCurrentSlide();
- AcquireCurrentSlide((rpDescriptor->GetPage()->GetPageNum()-1)/2);
+ AcquireCurrentSlide((rpDescriptor->GetPage()->GetPageNumber()-1)/2);
ViewShell* pViewShell = mrSlideSorter.GetViewShell();
if (pViewShell != NULL && pViewShell->IsMainViewShell())
@@ -165,7 +165,7 @@ void CurrentSlideManager::SwitchCurrentSlide (
// The slide sorter is the main view.
FrameView* pFrameView = pViewShell->GetFrameView();
if (pFrameView != NULL)
- pFrameView->SetSelectedPage(sal::static_int_cast<sal_uInt16>(mnCurrentSlideIndex));
+ pFrameView->SetSelectedPage(sal::static_int_cast< sal_uInt32 >(mnCurrentSlideIndex));
mrSlideSorter.GetController().GetPageSelector().SetCoreSelection();
}
@@ -208,7 +208,7 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescri
pBase->GetMainViewShell().get());
if (pDrawViewShell != NULL)
{
- sal_uInt16 nPageNumber = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
+ sal_uInt32 nPageNumber = (rpDescriptor->GetPage()->GetPageNumber()-1)/2;
pDrawViewShell->SwitchPage(nPageNumber);
pDrawViewShell->GetPageTabControl()->SetCurPageId(nPageNumber+1);
}
@@ -229,8 +229,8 @@ void CurrentSlideManager::SetCurrentSlideAtTabControl (const SharedPageDescripto
::boost::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell()));
if (pDrawViewShell)
{
- sal_uInt16 nPageNumber = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
- pDrawViewShell->GetPageTabControl()->SetCurPageId(nPageNumber+1);
+ sal_uInt32 nPageNumber = (rpDescriptor->GetPage()->GetPageNumber()-1)/2;
+ pDrawViewShell->GetPageTabControl()->SetCurPageId(sal_uInt16(nPageNumber+1));
}
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
index a635abb7d00a..ea77c41ef9fb 100644
--- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
@@ -98,8 +98,8 @@ void DragAndDropContext::GetPagesFromBookmarks (
for (sal_uLong nIndex=0,nCount=rBookmarks.Count(); nIndex<nCount; ++nIndex)
{
const String sPageName (*static_cast<String*>(rBookmarks.GetObject(nIndex)));
- sal_Bool bIsMasterPage (sal_False);
- const sal_uInt16 nPageIndex (pDocument->GetPageByName(sPageName, bIsMasterPage));
+ bool bIsMasterPage (false);
+ const sal_uInt32 nPageIndex (pDocument->GetPageByName(sPageName, bIsMasterPage));
if (nPageIndex == SDRPAGE_NOTFOUND)
continue;
diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
index 9ffd7b867ef8..d83863a24986 100644
--- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
@@ -247,7 +247,7 @@ void FocusManager::SetFocusedPage (const model::SharedPageDescriptor& rpDescript
if (rpDescriptor.get() != NULL)
{
FocusHider aFocusHider (*this);
- mnPageIndex = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
+ mnPageIndex = (rpDescriptor->GetPage()->GetPageNumber()-1)/2;
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx b/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx
index 047fead3bfe8..4683385ca682 100644
--- a/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx
@@ -42,8 +42,6 @@
namespace sd { namespace slidesorter { namespace controller {
-TYPEINIT1(HideSlideFunction, SlideFunction);
-
HideSlideFunction::HideSlideFunction (
SlideSorter& rSlideSorter,
SfxRequest& rRequest)
@@ -127,7 +125,7 @@ HideSlideFunction::ExclusionState HideSlideFunction::GetExclusionState (
model::PageEnumeration& rPageSet)
{
ExclusionState eState (UNDEFINED);
- sal_Bool bState;
+ bool bState;
// Get toggle state of the selected pages.
while (rPageSet.HasMoreElements() && eState!=MIXED)
diff --git a/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.hxx b/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.hxx
index d28df5eaef6e..8a063b947fcc 100644
--- a/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.hxx
+++ b/sd/source/ui/slidesorter/controller/SlsHideSlideFunction.hxx
@@ -39,8 +39,6 @@ class HideSlideFunction
: public SlideFunction
{
public:
- TYPEINFO();
-
virtual ~HideSlideFunction (void);
static FunctionReference Create( SlideSorter& rSlideSorter, SfxRequest& rRequest );
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index 64965d405289..5568ebc4533d 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -304,63 +304,72 @@ void Listener::Notify (
SfxBroadcaster& rBroadcaster,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrBaseHint* pSdrBaseHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrBaseHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrBaseHint->GetSdrHintKind())
{
case HINT_PAGEORDERCHG:
if (&rBroadcaster == mrSlideSorter.GetModel().GetDocument())
- HandleModelChange(rSdrHint.GetPage());
+ HandleModelChange(pSdrBaseHint->GetSdrHintPage());
break;
default:
break;
}
}
- else if (rHint.ISA(ViewShellHint))
+ else
{
- ViewShellHint& rViewShellHint (*PTR_CAST(ViewShellHint,&rHint));
- switch (rViewShellHint.GetHintId())
- {
- case ViewShellHint::HINT_PAGE_RESIZE_START:
- // Initiate a model change but do nothing (well, not much)
- // until we are told that all slides have been resized.
- mpModelChangeLock.reset(new SlideSorterController::ModelChangeLock(mrController));
- mrController.HandleModelChange();
- break;
-
- case ViewShellHint::HINT_PAGE_RESIZE_END:
- // All slides have been resized. The model has to be updated.
- mpModelChangeLock.reset();
- break;
-
- case ViewShellHint::HINT_CHANGE_EDIT_MODE_START:
- mrController.PrepareEditModeChange();
- break;
-
- case ViewShellHint::HINT_CHANGE_EDIT_MODE_END:
- mrController.FinishEditModeChange();
- break;
+ const ViewShellHint* pViewShellHint = dynamic_cast< const ViewShellHint* >(&rHint);
- case ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START:
- mpModelChangeLock.reset(new SlideSorterController::ModelChangeLock(mrController));
- break;
-
- case ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END:
- mpModelChangeLock.reset();
- break;
+ if (pViewShellHint)
+ {
+ switch (pViewShellHint->GetHintId())
+ {
+ case ViewShellHint::HINT_PAGE_RESIZE_START:
+ // Initiate a model change but do nothing (well, not much)
+ // until we are told that all slides have been resized.
+ mpModelChangeLock.reset(new SlideSorterController::ModelChangeLock(mrController));
+ mrController.HandleModelChange();
+ break;
+
+ case ViewShellHint::HINT_PAGE_RESIZE_END:
+ // All slides have been resized. The model has to be updated.
+ mpModelChangeLock.reset();
+ break;
+
+ case ViewShellHint::HINT_CHANGE_EDIT_MODE_START:
+ mrController.PrepareEditModeChange();
+ break;
+
+ case ViewShellHint::HINT_CHANGE_EDIT_MODE_END:
+ mrController.FinishEditModeChange();
+ break;
+
+ case ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START:
+ mpModelChangeLock.reset(new SlideSorterController::ModelChangeLock(mrController));
+ break;
+
+ case ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END:
+ mpModelChangeLock.reset();
+ break;
+ }
}
- }
- else if (rHint.ISA(SfxSimpleHint))
- {
- SfxSimpleHint& rSfxSimpleHint (*PTR_CAST(SfxSimpleHint,&rHint));
- switch (rSfxSimpleHint.GetId())
+ else
{
- case SFX_HINT_DOCCHANGED:
- mrController.CheckForMasterPageAssignment();
- mrController.CheckForSlideTransitionAssignment();
- break;
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
+ {
+ switch (pSfxSimpleHint->GetId())
+ {
+ case SFX_HINT_DOCCHANGED:
+ mrController.CheckForMasterPageAssignment();
+ mrController.CheckForSlideTransitionAssignment();
+ break;
+ }
+ }
}
}
}
@@ -424,7 +433,7 @@ IMPL_LINK(Listener, EventMultiplexerCallback, ::sd::tools::EventMultiplexerEvent
if (pEvent->mpUserData != NULL)
{
const SdrObject* pObject = static_cast<const SdrObject*>(pEvent->mpUserData);
- HandleShapeModification(pObject->GetPage());
+ HandleShapeModification(pObject->getSdrPageFromSdrObject());
}
break;
@@ -663,7 +672,7 @@ void Listener::HandleShapeModification (const SdrPage* pPage)
// pages that are linked to this master page.
if (pPage->IsMasterPage())
{
- for (sal_uInt16 nIndex=0,nCount=pDocument->GetSdPageCount(PK_STANDARD);
+ for (sal_uInt32 nIndex=0,nCount=pDocument->GetSdPageCount(PK_STANDARD);
nIndex<nCount;
++nIndex)
{
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.hxx b/sd/source/ui/slidesorter/controller/SlsListener.hxx
index ec83e09ecb51..75589ca0d70d 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.hxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.hxx
@@ -83,7 +83,7 @@ public:
This method is called once during initialization and every time a
FrameActionEvent signals the current controller being exchanged.
When the connection is successfull then the flag
- mbListeningToController is set to <TRUE/>.
+ mbListeningToController is set to <true/>.
*/
void ConnectToController (void);
@@ -91,7 +91,7 @@ public:
listener. This method is called once during initialization and
every time a FrameActionEvent signals the current controller being
exchanged. When this method terminates then mbListeningToController
- is <FALSE/>.
+ is <false/>.
*/
void DisconnectFromController (void);
diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
index ca9a9cc4bc84..d56b7a4e8700 100644
--- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
@@ -306,7 +306,7 @@ IMPL_LINK(ScrollBarManager, VerticalScrollBarHandler, ScrollBar*, pScrollBar)
mrSlideSorter.GetContentWindow()->SetVisibleXY(-1, nRelativePosition);
mrSlideSorter.GetController().GetVisibleAreaManager().DeactivateCurrentSlideTracking();
}
- return sal_True;
+ return true;
}
@@ -325,7 +325,7 @@ IMPL_LINK(ScrollBarManager, HorizontalScrollBarHandler, ScrollBar*, pScrollBar)
mrSlideSorter.GetContentWindow()->SetVisibleXY(nRelativePosition, -1);
mrSlideSorter.GetController().GetVisibleAreaManager().DeactivateCurrentSlideTracking();
}
- return sal_True;
+ return true;
}
@@ -339,11 +339,8 @@ void ScrollBarManager::SetWindowOrigin (
mnVerticalPosition = nVerticalPosition;
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
- Size aViewSize (pWindow->GetViewSize());
- Point aOrigin (
- (long int) (mnHorizontalPosition * aViewSize.Width()),
- (long int) (mnVerticalPosition * aViewSize.Height()));
-
+ const basegfx::B2DVector aViewSize (pWindow->GetViewSize());
+ const basegfx::B2DPoint aOrigin (mnHorizontalPosition * aViewSize.getX(), mnVerticalPosition * aViewSize.getY());
pWindow->SetWinViewPos (aOrigin);
pWindow->UpdateMapMode ();
pWindow->Invalidate ();
@@ -430,10 +427,11 @@ bool ScrollBarManager::TestScrollBarVisibilities (
// Tell the view to rearrange its page objects and check whether the
// page objects can be shown without clipping.
+ const basegfx::B2DVector& rPageScale = rModel.GetPageDescriptor(0)->GetPage()->GetPageScale();
bool bRearrangeSuccess (mrSlideSorter.GetView().GetLayouter().Rearrange (
mrSlideSorter.GetView().GetOrientation(),
aBrowserSize,
- rModel.GetPageDescriptor(0)->GetPage()->GetSize(),
+ Size(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY())),
rModel.GetPageCount()));
if (bRearrangeSuccess)
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index e0bf682ce2c1..bab8dd007626 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -350,7 +350,6 @@ protected:
//===== SelectionFunction =====================================================
-TYPEINIT1(SelectionFunction, FuPoor);
SelectionFunction::SelectionFunction (
@@ -394,24 +393,24 @@ FunctionReference SelectionFunction::Create(
-sal_Bool SelectionFunction::MouseButtonDown (const MouseEvent& rEvent)
+bool SelectionFunction::MouseButtonDown (const MouseEvent& rEvent)
{
// #95491# remember button state for creation of own MouseEvents
SetMouseButtonCode (rEvent.GetButtons());
- aMDPos = rEvent.GetPosPixel();
+ aMDPos = basegfx::B2DPoint(rEvent.GetPosPixel().X(), rEvent.GetPosPixel().Y());
mbProcessingMouseButtonDown = true;
// mpWindow->CaptureMouse();
ProcessMouseEvent(BUTTON_DOWN, rEvent);
- return sal_True;
+ return true;
}
-sal_Bool SelectionFunction::MouseMove (const MouseEvent& rEvent)
+bool SelectionFunction::MouseMove (const MouseEvent& rEvent)
{
ProcessMouseEvent(MOUSE_MOTION, rEvent);
return sal_True;
@@ -420,7 +419,7 @@ sal_Bool SelectionFunction::MouseMove (const MouseEvent& rEvent)
-sal_Bool SelectionFunction::MouseButtonUp (const MouseEvent& rEvent)
+bool SelectionFunction::MouseButtonUp (const MouseEvent& rEvent)
{
mrController.GetScrollBarManager().StopAutoScroll ();
@@ -429,7 +428,7 @@ sal_Bool SelectionFunction::MouseButtonUp (const MouseEvent& rEvent)
mbProcessingMouseButtonDown = false;
// mpWindow->ReleaseMouse();
- return sal_True;
+ return true;
}
@@ -443,12 +442,12 @@ void SelectionFunction::NotifyDragFinished (void)
-sal_Bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
+bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
{
view::SlideSorterView::DrawLock aDrawLock (mrSlideSorter);
PageSelector::UpdateLock aLock (mrSlideSorter);
FocusManager& rFocusManager (mrController.GetFocusManager());
- sal_Bool bResult = sal_False;
+ bool bResult = false;
const KeyCode& rCode (rEvent.GetKeyCode());
switch (rCode.GetCode())
@@ -473,7 +472,7 @@ sal_Bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
SID_INSERTPAGE,
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
}
- bResult = sal_True;
+ bResult = true;
}
break;
}
@@ -505,7 +504,7 @@ sal_Bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
else
mrController.GetPageSelector().SelectPage(pDescriptor);
}
- bResult = sal_True;
+ bResult = true;
}
break;
@@ -537,13 +536,13 @@ sal_Bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
// Go to previous page. No wrap around.
case KEY_PAGEUP:
GotoNextPage(-1);
- bResult = sal_True;
+ bResult = true;
break;
// Go to next page. No wrap around..
case KEY_PAGEDOWN:
GotoNextPage(+1);
- bResult = sal_True;
+ bResult = true;
break;
case KEY_HOME:
@@ -733,7 +732,7 @@ void SelectionFunction::GotoNextPage (int nOffset)
{
SdPage* pPage = pDescriptor->GetPage();
OSL_ASSERT(pPage!=NULL);
- sal_Int32 nIndex = (pPage->GetPageNum()-1) / 2;
+ sal_Int32 nIndex = (pPage->GetPageNumber()-1) / 2;
GotoPage(nIndex + nOffset);
}
ResetShiftKeySelectionAnchor();
@@ -742,14 +741,12 @@ void SelectionFunction::GotoNextPage (int nOffset)
-void SelectionFunction::GotoPage (int nIndex)
+void SelectionFunction::GotoPage (sal_uInt32 nIndex)
{
- sal_uInt16 nPageCount = (sal_uInt16)mrSlideSorter.GetModel().GetPageCount();
+ const sal_uInt32 nPageCount = mrSlideSorter.GetModel().GetPageCount();
if (nIndex >= nPageCount)
nIndex = nPageCount - 1;
- if (nIndex < 0)
- nIndex = 0;
mrController.GetFocusManager().SetFocusedPage(nIndex);
model::SharedPageDescriptor pNextPageDescriptor (
@@ -1258,7 +1255,7 @@ void SelectionFunction::ModeHandler::SwitchView (const model::SharedPageDescript
{
mrSlideSorter.GetModel().GetDocument()->SetSelected(rpDescriptor->GetPage(), sal_True);
pViewShell->GetFrameView()->SetSelectedPage(
- (rpDescriptor->GetPage()->GetPageNum()-1)/2);
+ (rpDescriptor->GetPage()->GetPageNumber()-1)/2);
}
if (mrSlideSorter.GetViewShellBase() != NULL)
framework::FrameworkHelper::Instance(*mrSlideSorter.GetViewShellBase())->RequestView(
@@ -1538,8 +1535,8 @@ void NormalModeHandler::RangeSelect (const model::SharedPageDescriptor& rpDescri
{
// Select all pages between the anchor and the given one, including
// the two.
- const sal_uInt16 nAnchorIndex ((pAnchor->GetPage()->GetPageNum()-1) / 2);
- const sal_uInt16 nOtherIndex ((rpDescriptor->GetPage()->GetPageNum()-1) / 2);
+ const sal_uInt16 nAnchorIndex ((pAnchor->GetPage()->GetPageNumber()-1) / 2);
+ const sal_uInt16 nOtherIndex ((rpDescriptor->GetPage()->GetPageNumber()-1) / 2);
// Iterate over all pages in the range. Start with the anchor
// page. This way the PageSelector will recognize it again as
@@ -1833,7 +1830,7 @@ DragAndDropModeHandler::DragAndDropModeHandler (
SlideSorterViewShell* pSlideSorterViewShell
= dynamic_cast<SlideSorterViewShell*>(mrSlideSorter.GetViewShell());
if (pSlideSorterViewShell != NULL)
- pSlideSorterViewShell->StartDrag(rMousePosition, pWindow);
+ pSlideSorterViewShell->StartDrag(basegfx::B2DPoint(rMousePosition.X(), rMousePosition.Y()), pWindow);
pDragTransferable = SD_MOD()->pTransferDrag;
}
@@ -2016,5 +2013,4 @@ bool ButtonModeHandler::ProcessMotionEvent (SelectionFunction::EventDescriptor&
-
} } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
index bcbf3cc8d1a2..6b539c213e36 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
@@ -154,7 +154,7 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage)
// Set the new current slide.
if (nNewCurrentSlide < 0)
nNewCurrentSlide = 0;
- else if (nNewCurrentSlide >= mrSlideSorter.GetModel().GetPageCount())
+ else if (nNewCurrentSlide >= (sal_Int32)mrSlideSorter.GetModel().GetPageCount())
nNewCurrentSlide = mrSlideSorter.GetModel().GetPageCount()-1;
mrController.GetPageSelector().CountSelectedPages();
mrController.GetPageSelector().SelectPage(nNewCurrentSlide);
@@ -185,7 +185,7 @@ void SelectionManager::DeleteSelectedNormalPages (const ::std::vector<SdPage*>&
if (xPages->getCount() <= 1)
break;
- const sal_uInt16 nPage (model::FromCoreIndex((*aI)->GetPageNum()));
+ const sal_uInt32 nPage(model::FromCoreIndex((*aI)->GetPageNumber()));
Reference< XDrawPage > xPage( xPages->getByIndex( nPage ), UNO_QUERY_THROW );
xPages->remove(xPage);
@@ -221,7 +221,7 @@ void SelectionManager::DeleteSelectedMasterPages (const ::std::vector<SdPage*>&
if (xPages->getCount() <= 1)
break;
- const sal_uInt16 nPage (model::FromCoreIndex((*aI)->GetPageNum()));
+ const sal_uInt32 nPage (model::FromCoreIndex((*aI)->GetPageNumber()));
Reference< XDrawPage > xPage( xPages->getByIndex( nPage ), UNO_QUERY_THROW );
xPages->remove(xPage);
@@ -317,7 +317,7 @@ sal_Int32 SelectionManager::GetInsertionPosition (void) const
nInsertionPosition = mrSlideSorter.GetModel().GetPageCount();
while (aSelectedPages.HasMoreElements())
{
- const sal_Int32 nPosition (aSelectedPages.GetNextElement()->GetPage()->GetPageNum());
+ const sal_Int32 nPosition (aSelectedPages.GetNextElement()->GetPage()->GetPageNumber());
// Convert *2+1 index to straight index (n-1)/2 after the page
// (+1).
nInsertionPosition = model::FromCoreIndex(nPosition) + 1;
@@ -334,10 +334,10 @@ void SelectionManager::SetInsertionPosition (const sal_Int32 nInsertionPosition)
{
if (nInsertionPosition < 0)
mnInsertionPosition = -1;
- else if (nInsertionPosition > mrSlideSorter.GetModel().GetPageCount())
+ else if (nInsertionPosition > (sal_Int32)mrSlideSorter.GetModel().GetPageCount())
{
// Assert but then ignore invalid values.
- OSL_ASSERT(nInsertionPosition<=mrSlideSorter.GetModel().GetPageCount());
+ OSL_ASSERT(nInsertionPosition <= (sal_Int32)mrSlideSorter.GetModel().GetPageCount());
return;
}
else
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
index 6ffc07d0581b..ffa76e0787a5 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
@@ -108,7 +108,7 @@ void SelectionObserver::NotifyPageEvent (const SdrPage* pSdrPage)
if (iPage != maInsertedPages.end())
maInsertedPages.erase(iPage);
- maDeletedPages.push_back(pPage->GetPageNum());
+ maDeletedPages.push_back(pPage->GetPageNumber());
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsSlideFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSlideFunction.cxx
index 84ff1f8f373a..ba50bfa26d5d 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlideFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlideFunction.cxx
@@ -34,9 +34,6 @@
namespace sd { namespace slidesorter { namespace controller {
-TYPEINIT1(SlideFunction, FuPoor);
-
-
SlideFunction::SlideFunction (
SlideSorter& rSlideSorter,
SfxRequest& rRequest)
@@ -57,20 +54,19 @@ void SlideFunction::ScrollEnd (void)
{
}
-sal_Bool SlideFunction::MouseMove(const MouseEvent& )
+bool SlideFunction::MouseMove(const MouseEvent& )
{
- return sal_False;
+ return false;
}
-sal_Bool SlideFunction::MouseButtonUp(const MouseEvent& )
+bool SlideFunction::MouseButtonUp(const MouseEvent& )
{
- return sal_False;
-
+ return false;
}
-sal_Bool SlideFunction::MouseButtonDown(const MouseEvent& )
+bool SlideFunction::MouseButtonDown(const MouseEvent& )
{
- return sal_False;
+ return false;
}
} } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 22d6dcdbd673..af53cd24326a 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -159,8 +159,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
case SID_PAGES_PER_ROW:
if (rRequest.GetArgs() != NULL)
{
- SFX_REQUEST_ARG(rRequest, pPagesPerRow, SfxUInt16Item,
- SID_PAGES_PER_ROW, sal_False);
+ SFX_REQUEST_ARG(rRequest, pPagesPerRow, SfxUInt16Item, SID_PAGES_PER_ROW);
if (pPagesPerRow != NULL)
{
sal_Int32 nColumnCount = pPagesPerRow->GetValue();
@@ -524,13 +523,13 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
{
sal_uInt16 nSId = pShell->GetCurrentFunction()->GetSlotID();
- rSet.Put( SfxBoolItem( nSId, sal_True ) );
+ rSet.Put( SfxBoolItem( nSId, true ) );
}
- rSet.Put( SfxBoolItem( SID_DRAWINGMODE, sal_False ) );
- rSet.Put( SfxBoolItem( SID_DIAMODE, sal_True ) );
- rSet.Put( SfxBoolItem( SID_OUTLINEMODE, sal_False ) );
- rSet.Put( SfxBoolItem( SID_NOTESMODE, sal_False ) );
- rSet.Put( SfxBoolItem( SID_HANDOUTMODE, sal_False ) );
+ rSet.Put( SfxBoolItem( SID_DRAWINGMODE, false ) );
+ rSet.Put( SfxBoolItem( SID_DIAMODE, true ) );
+ rSet.Put( SfxBoolItem( SID_OUTLINEMODE, false ) );
+ rSet.Put( SfxBoolItem( SID_NOTESMODE, false ) );
+ rSet.Put( SfxBoolItem( SID_HANDOUTMODE, false ) );
// Vorlagenkatalog darf nicht aufgerufen werden
rSet.DisableItem(SID_STYLE_CATALOG);
@@ -612,7 +611,7 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PRESENTATION ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_REHEARSE_TIMINGS ) )
{
- sal_Bool bDisable = sal_True;
+ bool bDisable = true;
model::PageEnumeration aAllPages (
model::PageEnumerationProvider::CreateAllPagesEnumeration(mrSlideSorter.GetModel()));
while (aAllPages.HasMoreElements())
@@ -620,7 +619,7 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
SdPage* pPage = aAllPages.GetNextElement()->GetPage();
if( !pPage->IsExcluded() )
- bDisable = sal_False;
+ bDisable = false;
}
if( bDisable || pDocShell->IsPreview())
{
@@ -826,8 +825,8 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
*/
SdPage* pPage = NULL;
SdPage* pFirstPage = NULL;
- sal_uInt16 nFirstPage;
- sal_uInt16 nSelectedPages = (sal_uInt16)mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
+ sal_uInt32 nFirstPage;
+ sal_uInt32 nSelectedPages = mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
String aPageStr;
String aLayoutStr;
@@ -843,7 +842,7 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
if (pDescriptor)
{
pPage = pDescriptor->GetPage();
- nFirstPage = pPage->GetPageNum()/2;
+ nFirstPage = pPage->GetPageNumber()/2;
pFirstPage = pPage;
aPageStr += sal_Unicode(' ');
@@ -922,7 +921,7 @@ void SlotManager::RenameSlide (void)
bool bResult =
#endif
RenameSlideFromDrawViewShell(
- pSelectedPage->GetPageNum()/2, aNewName );
+ pSelectedPage->GetPageNumber()/2, aNewName );
DBG_ASSERT( bResult, "Couldn't rename slide" );
}
}
@@ -931,7 +930,7 @@ void SlotManager::RenameSlide (void)
// Tell the slide sorter about the name change (necessary for
// accessibility.)
mrSlideSorter.GetController().PageNameHasChanged(
- (pSelectedPage->GetPageNum()-1)/2, aPageName);
+ (pSelectedPage->GetPageNumber()-1)/2, aPageName);
}
}
}
@@ -955,11 +954,11 @@ IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog*, pDialog)
&& mrSlideSorter.GetViewShell()->GetDocSh()->IsNewPageNameValid( aNewName ) ));
}
-bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const String & rName )
+bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt32 nPageId, const String & rName )
{
- sal_Bool bOutDummy;
+ bool bOutDummy;
SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument();
- if( pDocument->GetPageByName( rName, bOutDummy ) != SDRPAGE_NOTFOUND )
+ if( SDRPAGE_NOTFOUND != pDocument->GetPageByName( rName, bOutDummy ) )
return false;
SdPage* pPageToRename = NULL;
@@ -978,9 +977,9 @@ bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const String
{
// Undo
SdPage* pUndoPage = pPageToRename;
- SdrLayerAdmin & rLayerAdmin = pDocument->GetLayerAdmin();
- sal_uInt8 nBackground = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), sal_False );
- sal_uInt8 nBgObj = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), sal_False );
+ SdrLayerAdmin & rLayerAdmin = pDocument->GetModelLayerAdmin();
+ sal_uInt8 nBackground = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), false );
+ sal_uInt8 nBgObj = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), false );
SetOfByte aVisibleLayers = pPageToRename->TRG_GetMasterPageVisibleLayers();
// (#67720#)
@@ -1014,7 +1013,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const String
}
}
- bool bSuccess = pPageToRename!=NULL && ( sal_False != rName.Equals( pPageToRename->GetName()));
+ bool bSuccess = pPageToRename!=NULL && ( false != rName.Equals( pPageToRename->GetName()));
if( bSuccess )
{
@@ -1022,10 +1021,10 @@ bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const String
// aTabControl.SetPageText( nPageId, rName );
// set document to modified state
- pDocument->SetChanged( sal_True );
+ pDocument->SetChanged( true );
// inform navigator about change
- SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True );
+ SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
if (mrSlideSorter.GetViewShell() != NULL)
mrSlideSorter.GetViewShell()->GetDispatcher()->Execute(
SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
@@ -1088,8 +1087,8 @@ void SlotManager::InsertSlide (SfxRequest& rRequest)
// Create shapes for the default layout.
pNewPage = pDocument->GetMasterSdPage(
- (sal_uInt16)(nInsertionIndex+1), PK_STANDARD);
- pNewPage->CreateTitleAndLayout (sal_True,sal_True);
+ nInsertionIndex+1, PK_STANDARD);
+ pNewPage->CreateTitleAndLayout (true, true);
}
}
}
@@ -1121,7 +1120,7 @@ void SlotManager::DuplicateSelectedSlides (SfxRequest& rRequest)
if (pDescriptor && pDescriptor->GetPage())
{
aPagesToDuplicate.push_back(pDescriptor->GetPage());
- nInsertPosition = pDescriptor->GetPage()->GetPageNum()+2;
+ nInsertPosition = pDescriptor->GetPage()->GetPageNumber()+2;
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
index 90990f6dc8df..dc4a85184d99 100644
--- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx
@@ -107,10 +107,11 @@ void TransferableData::DragFinished (sal_Int8 nDropAction)
void TransferableData::Notify (SfxBroadcaster&, const SfxHint& rHint)
{
- if (rHint.ISA(SfxSimpleHint) && mpViewShell!=NULL)
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && mpViewShell)
{
- SfxSimpleHint& rSimpleHint (*PTR_CAST(SfxSimpleHint, &rHint));
- if (rSimpleHint.GetId() == SFX_HINT_DYING)
+ if(SFX_HINT_DYING == pSfxSimpleHint->GetId())
{
// This hint may come either from the ViewShell or from the
// document (registered by SdTransferable). We do not know
diff --git a/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx b/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx
index 00f60ec23fbc..c5cf03b8174b 100644
--- a/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx
+++ b/sd/source/ui/slidesorter/inc/cache/SlsCacheContext.hxx
@@ -74,7 +74,7 @@ public:
the list of visible entries and maybe for the list of not visible
entries and creates preview creation requests for them.
@param bVisible
- When this is <FALSE/> then the implementation can decide whether
+ When this is <false/> then the implementation can decide whether
to allow rendering of previews that are not visible (ahead of
time). When not then return an empty pointer or an empty vector.
*/
diff --git a/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx b/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
index aecbbd5fa389..a562ed922428 100644
--- a/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
+++ b/sd/source/ui/slidesorter/inc/cache/SlsPageCache.hxx
@@ -150,8 +150,8 @@ public:
This is the case when the size of the page objects on the screen has
changed or when the model has changed.
@param bUpdateCache
- When this flags is <TRUE/> then requests for updated previews
- are created. When it is <FALSE/> the existing previews are only
+ When this flags is <true/> then requests for updated previews
+ are created. When it is <false/> the existing previews are only
marked as not being up-to-date anymore.
*/
void InvalidateCache (const bool bUpdateCache = true);
diff --git a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
index 9e5f932745ff..7ee33d4fc256 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx
@@ -96,7 +96,7 @@ public:
filler, the actual slide sorter view--are visible and place them in
the area last passed to Resize().
@param bForce
- When <TRUE/> is given (<FALSE/> is the default) then the content
+ When <true/> is given (<false/> is the default) then the content
window and with it the SlideSorterView is resized event when its
size does not change (the size does change when the visibility
of scroll bars changes.)
@@ -113,7 +113,7 @@ public:
reference because when no page is found at the position
then NULL is returned to indicate this.
*/
- model::SharedPageDescriptor GetPageAt (const Point& rPixelPosition);
+ model::SharedPageDescriptor GetPageAt (const Point& aWindowPosition);
PageSelector& GetPageSelector (void);
FocusManager& GetFocusManager (void);
@@ -199,7 +199,7 @@ public:
this method should be called between calls to
PrepareEditModeChange() and FinishEditModeChange().
@return
- A return value of <TRUE/> indicates that the edit mode has
+ A return value of <true/> indicates that the edit mode has
changed.
*/
bool ChangeEditMode (EditMode eEditMode);
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
index 7b17cd907033..8cec191d68e0 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsAnimator.hxx
@@ -119,7 +119,7 @@ private:
@param nTime
Time measured in milli seconds with some arbitrary reference point.
@return
- When one or more animation has finished then <TRUE/> is
+ When one or more animation has finished then <true/> is
returned. Call CleanUpAnimationList() in this case.
*/
bool ProcessAnimations (const double nTime);
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
index c940ae0aecfa..86cfa8feb5fa 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
@@ -40,7 +40,7 @@ class Window;
struct AcceptDropEvent;
class DropTargetHelper;
struct ExecuteDropEvent;
-class Point;
+class basegfx::B2DPoint;
class SdPage;
class Window;
@@ -93,15 +93,15 @@ public:
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
sal_Int8 ExecuteDrop (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow = NULL,
- sal_uInt16 nPage = SDRPAGE_NOTFOUND,
- sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
+ sal_uInt32 nPage = SDRPAGE_NOTFOUND,
+ SdrLayerID aLayer = SDRLAYER_NOTFOUND);
void Abort (void);
@@ -132,7 +132,7 @@ private:
/** When pages are moved or copied then the selection of the slide
sorter has to be updated. This flag is used to remember whether the
- selection has to be updated or can stay as it is (sal_False).
+ selection has to be updated or can stay as it is (false).
*/
bool mbUpdateSelectionPending;
@@ -185,7 +185,7 @@ private:
*/
void SelectPageRange (sal_Int32 nFirstIndex, sal_Int32 nPageCount);
- /** Return <TRUE/> when the current transferable in the current state of
+ /** Return <true/> when the current transferable in the current state of
the slidesorter is acceptable to be pasted. For this the
transferable has to
a) exist,
@@ -220,12 +220,12 @@ private:
enum DropCommand { DC_ACCEPT, DC_EXECUTE };
sal_Int8 ExecuteOrAcceptShapeDrop (
DropCommand eCommand,
- const Point& rPosition,
+ const basegfx::B2DPoint& rPosition,
const void* pDropEvent ,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer);
+ sal_uInt32 nPage,
+ SdrLayerID aLayer);
/** Return whether the insertion defined by the transferable is
trivial, ie would not change either source nor target document.
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
index 40da3910109a..5f00e0f2e41d 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
@@ -81,7 +81,7 @@ public:
/** Show the focus indicator of the current slide.
@param bScrollToFocus
- When <TRUE/> (the default) then the view is scrolled so that the
+ When <true/> (the default) then the view is scrolled so that the
focus rectangle lies inside its visible area.
*/
void ShowFocus (const bool bScrollToFocus = true);
@@ -135,7 +135,7 @@ public:
/** Return <TRUE/> when the focus inidcator is currently shown. A
prerequisite is that the window managed by this focus manager has
- the input focus as indicated by a <TRUE/> return value of
+ the input focus as indicated by a <true/> return value of
HasFocus(). It is not necessary that the focus indicator is
visible. It may have been scrolled outside the visible area.
*/
@@ -210,7 +210,7 @@ private:
@param pDescriptor
When NULL is given then the call is ignored.
@param bScrollToFocus
- When <TRUE/> (the default) then the view is scrolled so that the
+ When <true/> (the default) then the view is scrolled so that the
focus rectangle lies inside its visible area.
*/
void ShowFocusIndicator (
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx b/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx
index 6d32e0723afa..baa6f7104d00 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsProperties.hxx
@@ -47,38 +47,38 @@ public:
bool IsHighlightCurrentSlide (void) const;
void SetHighlightCurrentSlide (const bool bIsHighlightCurrentSlide);
- /** When this method returns <TRUE/> then the selection is indicated in
+ /** When this method returns <true/> then the selection is indicated in
the view (typically by drawing rectangles around the selected
- slides.) The default value is <TRUE/>.
+ slides.) The default value is <true/>.
*/
bool IsShowSelection (void) const;
void SetShowSelection (const bool bIsShowSelection);
- /** When this method returns <TRUE/> then the focusdselection is indicated in
+ /** When this method returns <true/> then the focusdselection is indicated in
the view (typically by drawing dotted rectangles around the selected
- slides.) The default value is <TRUE/>.
+ slides.) The default value is <true/>.
*/
bool IsShowFocus (void) const;
void SetShowFocus (const bool bIsShowFocus);
- /** When this method returns <TRUE/> then on a selection change the
+ /** When this method returns <true/> then on a selection change the
visible area is adapted so that the selected slides are shown
centered in the view. This can be used to center the current slide
- by selecting only the current slide. The default value is <FALSE/>.
+ by selecting only the current slide. The default value is <false/>.
*/
bool IsCenterSelection (void) const;
void SetCenterSelection (const bool bIsCenterSelection);
- /** When this mehod returns <TRUE/> then the view may try to change the
+ /** When this mehod returns <true/> then the view may try to change the
visible area by scrolling it smoothly on the screen. Experimental.
- Default value is <FALSE/>.
+ Default value is <false/>.
*/
bool IsSmoothSelectionScrolling (void) const;
void SetSmoothSelectionScrolling (const bool bIsSmoothSelectionScrolling);
- /** When this method returns <TRUE/> then during a full screen
+ /** When this method returns <true/> then during a full screen
presentation the previews in a slide sorter are not updated.
- Default value is <TRUE/>.
+ Default value is <true/>.
*/
bool IsSuspendPreviewUpdatesDuringFullScreenPresentation (void) const;
void SetSuspendPreviewUpdatesDuringFullScreenPresentation (const bool bFlag);
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
index 954a24cae0c4..5676558a1484 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
@@ -97,10 +97,10 @@ public:
were inserted or deleted, the layout or the zoom factor has
changed.
@param bResetThumbPosition
- When <TRUE/> then set the thumb position to position 0. This is
+ When <true/> then set the thumb position to position 0. This is
done when e.g. switching between master page mode and draw mode.
@param bScrollToCurrentPosition
- When <TRUE/> then scroll the window to the new offset that is
+ When <true/> then scroll the window to the new offset that is
defined by the scroll bars. Otherwise the new offset is simply
set and the whole window is repainted.
*/
@@ -162,8 +162,8 @@ public:
@param rAutoScrollFunctor
Every time when the window is scrolled then this functor is executed.
@return
- When the window is scrolled then this method returns <TRUE/>.
- When the window is not changed then <FALSE/> is returned.
+ When the window is scrolled then this method returns <true/>.
+ When the window is not changed then <false/> is returned.
*/
bool AutoScroll (
const Point& rMouseWindowPosition,
@@ -254,7 +254,7 @@ private:
or hidden.
@return
When the window content can be shown with only being clipped in
- an orientation where the scroll bar would be shown then <TRUE/>
+ an orientation where the scroll bar would be shown then <true/>
is returned.
*/
bool TestScrollBarVisibilities (
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
index 108bbbfe4323..951afeba3535 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSelectionFunction.hxx
@@ -53,15 +53,13 @@ class SelectionFunction
private ::boost::noncopyable
{
public:
- TYPEINFO();
-
static FunctionReference Create( SlideSorter& rSlideSorter, SfxRequest& rRequest );
// Mouse- & Key-Events
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
+ virtual bool KeyInput(const KeyEvent& rKEvt);
+ virtual bool MouseMove(const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt);
virtual void Activate();
virtual void Deactivate();
@@ -176,7 +174,7 @@ private:
Index of the new current slide. When the new index is outside
the range of valid page numbers it is clipped to that range.
*/
- void GotoPage (int nIndex);
+ void GotoPage (sal_uInt32 nIndex);
void ProcessMouseEvent (sal_uInt32 nEventType, const MouseEvent& rEvent);
void ProcessKeyEvent (const KeyEvent& rEvent);
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSlideFunction.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSlideFunction.hxx
index 470aa52eb30d..abca0183f7e1 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSlideFunction.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSlideFunction.hxx
@@ -44,11 +44,9 @@ class SlideFunction
: public FuPoor
{
public:
- TYPEINFO();
-
- virtual sal_Bool MouseMove (const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonUp (const MouseEvent& rMEvt);
- virtual sal_Bool MouseButtonDown (const MouseEvent& rMEvt);
+ virtual bool MouseMove (const MouseEvent& rMEvt);
+ virtual bool MouseButtonUp (const MouseEvent& rMEvt);
+ virtual bool MouseButtonDown (const MouseEvent& rMEvt);
/** Called from ForceScroll() before the actual scrolling.
*/
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
index fdffa5696437..ef3e1799ba64 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
@@ -99,7 +99,7 @@ private:
*/
void RenameSlide (void);
DECL_LINK(RenameSlideHdl, AbstractSvxNameDialog*);
- bool RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const String& rName);
+ bool RenameSlideFromDrawViewShell( sal_uInt32 nPageId, const String& rName);
/** Handle SID_INSERTPAGE slot calls.
*/
diff --git a/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx b/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx
index d195f2846711..46ae8b45ca80 100644
--- a/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx
+++ b/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx
@@ -82,7 +82,7 @@ public:
previous page descriptor list is replaced by a new one which
has to be repainted.
@return
- A return value of <TRUE/> indicates that the edit mode has
+ A return value of <true/> indicates that the edit mode has
changed and thus the page descriptor list has been set up
to reflect that change. A repaint is necessary.
*/
@@ -99,7 +99,7 @@ public:
The number of slides depends on the set of slides available through
the XIndexAccess given to SetDocumentSlides().
*/
- sal_Int32 GetPageCount (void) const;
+ sal_uInt32 GetPageCount (void) const;
/** Return a page descriptor for the page with the specified index.
Page descriptors are created on demand. The page descriptor is
@@ -108,8 +108,8 @@ public:
The index of the requested slide. The valid values
are 0 to GetPageCount()-1.
@param bCreate
- When <TRUE/> and the requested page descriptor is missing then
- it is created. When <FALSE/> then an empty reference is
+ When <true/> and the requested page descriptor is missing then
+ it is created. When <false/> then an empty reference is
returned for missing descriptors.
@return
When the given index is not valid, i.e. lower then zero or
@@ -118,7 +118,7 @@ public:
between calls to GetPageCount() and GetPageDescriptor().
*/
SharedPageDescriptor GetPageDescriptor (
- const sal_Int32 nPageIndex,
+ const sal_uInt32 nPageIndex,
const bool bCreate = true) const;
/** Return a page descriptor for the given XDrawPage. Page descriptors
diff --git a/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx b/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx
index 353f2bddd8c9..e129fbbcecaa 100644
--- a/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx
+++ b/sd/source/ui/slidesorter/inc/model/SlsPageDescriptor.hxx
@@ -109,9 +109,9 @@ public:
page it describes and determine whether a redraw to update the
selection indicator is necessary.
@return
- When the two selection states were different <TRUE/> is
+ When the two selection states were different <true/> is
returned. When they were the same this method returns
- <FALSE/>.
+ <false/>.
*/
bool GetCoreSelection (void);
diff --git a/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx b/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx
index f482f6da1435..74befbb3ea5a 100644
--- a/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx
+++ b/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx
@@ -55,7 +55,7 @@ public:
The new page enumeration enumerates the pages of this model.
@param rPredicate
This predicate determines which pages to include in the
- enumeration. Pages for which rPredicate returns <FALSE/> are
+ enumeration. Pages for which rPredicate returns <false/> are
exclude.
*/
typedef ::boost::function<bool(const SharedPageDescriptor&)> PagePredicate;
@@ -74,8 +74,8 @@ public:
constructor only when you know what you are doing. When in doubt,
use the one argument version.
@param bCloneImpl
- When <TRUE/> is given this constructor behaves exactly like its
- one argument version. When <FALSE/> is given then the
+ When <true/> is given this constructor behaves exactly like its
+ one argument version. When <false/> is given then the
implementation object is not copied but moved from the given
enumeration to the newly created one. The given enumeration
thus becomes empty.
@@ -88,7 +88,7 @@ public:
PageEnumeration& operator= (const PageEnumeration& rEnumeration);
- /** Return <TRUE/> when the enumeration has more elements, i.e. it is
+ /** Return <true/> when the enumeration has more elements, i.e. it is
save to call GetNextElement() at least one more time.
*/
virtual bool HasMoreElements (void) const;
@@ -96,7 +96,7 @@ public:
/** Return the next element of the enumeration. Call the
HasMoreElements() before to make sure that there exists at least one
more element. Calling this method with HasMoreElements() returning
- <FALSE/> is an error.
+ <false/> is an error.
*/
virtual SharedPageDescriptor GetNextElement (void);
diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
index 70a2707e01ae..a4fdfeb43657 100644
--- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
@@ -72,8 +72,6 @@ class SlideSorterView
public ::boost::noncopyable
{
public:
- TYPEINFO ();
-
/** Create a new view for the slide sorter.
@param rViewShell
This reference is simply passed to the base class and not used
@@ -103,14 +101,14 @@ public:
@param rPosition
The position is expected to be in pixel coordinates.
@return
- The returned index is -1 when there is no page object at the
+ The returned index is SDRPAGE_NOTFOUND when there is no page object at the
given position.
*/
- sal_Int32 GetPageIndexAtPoint (const Point& rPosition) const;
+ sal_uInt32 GetPageIndexAtPoint (const Point& rPosition) const;
view::Layouter& GetLayouter (void);
- virtual void ModelHasChanged (void);
+ virtual void LazyReactOnObjectChanges(void);
void LocalModelHasChanged(void);
diff --git a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
index ab4e9dc52af4..74d42709ea94 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
@@ -126,7 +126,7 @@ public:
page objects.
@return
The return value indicates whether the Get... methods can be
- used to obtain valid values (<TRUE/>).
+ used to obtain valid values (<true/>).
*/
bool Rearrange (
const Orientation eOrientation,
@@ -157,7 +157,7 @@ public:
*/
Fraction GetScaleFactor (void) const;
- Size GetPageObjectSize (void) const;
+ const Size& GetPageObjectSize (void) const;
/** Return the bounding box in window coordinates of the nIndex-th page
object.
@@ -185,7 +185,7 @@ public:
The position is expected to be in model coordinates relative to
the page origin.
@param bIncludePageBorders
- When <TRUE/> then include the page borders into the calculation,
+ When <true/> then include the page borders into the calculation,
i.e. when a point lies in the border of a page object but not on
the actual page area the index of that page is returned;
otherwise -1 would be returned to indicate that no page object
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewContact.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewContact.hxx
index e8894afd98b5..33c2abdce77e 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewContact.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewContact.hxx
@@ -72,7 +72,7 @@ protected:
virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
private:
- /** This flag is set to <TRUE/> when the destructor is called to
+ /** This flag is set to <true/> when the destructor is called to
indicate that further calls made to it must not call outside.
*/
bool mbInDestructor;
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewObjectContact.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewObjectContact.hxx
index 5f22ab5cb373..1f710120df3f 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewObjectContact.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectViewObjectContact.hxx
@@ -127,7 +127,7 @@ public:
/** Paint a mouse over effect.
@param bVisible
- When bVisible is <FALSE/> then paint the area of the mouse over
+ When bVisible is <false/> then paint the area of the mouse over
effect in the background color, i.e. erase it.
*/
drawinglayer::primitive2d::Primitive2DSequence createMouseOverEffectPrimitive2DSequence();
@@ -164,7 +164,7 @@ public:
The bounding box can be returned in model and in pixel
(window) coordinates.
*/
- Rectangle GetBoundingBox (
+ basegfx::B2DRange GetBoundingBox (
OutputDevice& rDevice,
BoundingBoxType eType,
CoordinateSystem eCoordinateSystem) const;
@@ -193,7 +193,7 @@ private:
static const sal_Int32 mnMouseOverEffectOffset;
static const sal_Int32 mnMouseOverEffectThickness;
- /** This flag is set to <TRUE/> when the destructor is called to
+ /** This flag is set to <true/> when the destructor is called to
indicate that further calls made to it must not call outside.
*/
bool mbInDestructor;
@@ -208,7 +208,7 @@ private:
BitmapEx GetPreview (
const sdr::contact::DisplayInfo& rDisplayInfo,
- const Rectangle& rNewSizePixel);
+ const basegfx::B2DRange& rNewSizePixel);
/** Return the bounding box of where the page number is painted (when it
is painted).
diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
index f0e7ec827e88..e34c40ee149c 100644
--- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
+++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
@@ -76,7 +76,7 @@ namespace {
nIndex,
pDescriptor->GetPageIndex(),
pDescriptor->GetVisualState().mnPageId,
- FromCoreIndex(pDescriptor->GetPage()->GetPageNum()),
+ FromCoreIndex(pDescriptor->GetPage()->GetPageNumber()),
pDescriptor->GetPage());
}
else
@@ -198,7 +198,7 @@ PageKind SlideSorterModel::GetPageType (void) const
-sal_Int32 SlideSorterModel::GetPageCount (void) const
+sal_uInt32 SlideSorterModel::GetPageCount (void) const
{
return maPageDescriptors.size();
}
@@ -207,14 +207,14 @@ sal_Int32 SlideSorterModel::GetPageCount (void) const
SharedPageDescriptor SlideSorterModel::GetPageDescriptor (
- const sal_Int32 nPageIndex,
+ const sal_uInt32 nPageIndex,
const bool bCreate) const
{
::osl::MutexGuard aGuard (maMutex);
SharedPageDescriptor pDescriptor;
- if (nPageIndex>=0 && nPageIndex<GetPageCount())
+ if (SDRPAGE_NOTFOUND != nPageIndex && nPageIndex < GetPageCount())
{
pDescriptor = maPageDescriptors[nPageIndex];
if (pDescriptor == NULL && bCreate && mxSlides.is())
@@ -294,7 +294,7 @@ sal_Int32 SlideSorterModel::GetIndex (const SdrPage* pPage) const
::osl::MutexGuard aGuard (maMutex);
// First try to guess the right index.
- sal_Int16 nNumber ((pPage->GetPageNum()-1)/2);
+ sal_Int16 nNumber ((pPage->GetPageNumber()-1)/2);
SharedPageDescriptor pDescriptor (GetPageDescriptor(nNumber, false));
if (pDescriptor.get() != NULL
&& pDescriptor->GetPage() == pPage)
@@ -331,7 +331,7 @@ sal_uInt16 SlideSorterModel::GetCoreIndex (const sal_Int32 nIndex) const
{
SharedPageDescriptor pDescriptor (GetPageDescriptor(nIndex));
if (pDescriptor)
- return pDescriptor->GetPage()->GetPageNum();
+ return pDescriptor->GetPage()->GetPageNumber();
else
return mxSlides->getCount()*2+1;
}
@@ -642,7 +642,7 @@ bool SlideSorterModel::NotifyPageEvent (const SdrPage* pSdrPage)
void SlideSorterModel::InsertSlide (SdPage* pPage)
{
// Find the index at which to insert the given page.
- sal_uInt16 nCoreIndex (pPage->GetPageNum());
+ sal_uInt32 nCoreIndex (pPage->GetPageNumber());
sal_Int32 nIndex (FromCoreIndex(nCoreIndex));
if (pPage != GetPage(nIndex))
return;
@@ -687,7 +687,7 @@ void SlideSorterModel::DeleteSlide (const SdPage* pPage)
else
{
// if not inserted, search for page
- for(; nIndex < static_cast<sal_Int32>(maPageDescriptors.size()); nIndex++)
+ for(; nIndex < maPageDescriptors.size(); nIndex++)
{
if(maPageDescriptors[nIndex]->GetPage() == pPage)
{
@@ -696,7 +696,7 @@ void SlideSorterModel::DeleteSlide (const SdPage* pPage)
}
}
- if(nIndex >= 0 && nIndex < static_cast<sal_Int32>(maPageDescriptors.size()))
+ if(nIndex >= 0 && nIndex < maPageDescriptors.size())
{
if (maPageDescriptors[nIndex])
if (maPageDescriptors[nIndex]->GetPage() != pPage)
@@ -744,9 +744,9 @@ SdPage* SlideSorterModel::GetPage (const sal_Int32 nSdIndex) const
if (pModel != NULL)
{
if (meEditMode == EM_PAGE)
- return pModel->GetSdPage ((sal_uInt16)nSdIndex, mePageKind);
+ return pModel->GetSdPage ((sal_uInt32)nSdIndex, mePageKind);
else
- return pModel->GetMasterSdPage ((sal_uInt16)nSdIndex, mePageKind);
+ return pModel->GetMasterSdPage ((sal_uInt32)nSdIndex, mePageKind);
}
else
return NULL;
diff --git a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx
index 27e74fac5def..67e0dfc8d9b9 100644
--- a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx
+++ b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx
@@ -225,7 +225,7 @@ PageEnumerationImpl::~PageEnumerationImpl (void)
bool PageEnumerationImpl::HasMoreElements (void) const
{
- return (mnIndex < mrModel.GetPageCount());
+ return (mnIndex < (sal_Int32)mrModel.GetPageCount());
}
@@ -258,7 +258,7 @@ void PageEnumerationImpl::Rewind (void)
void PageEnumerationImpl::AdvanceToNextValidElement (void)
{
- while (mnIndex < mrModel.GetPageCount())
+ while (mnIndex < (sal_Int32)mrModel.GetPageCount())
{
SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(mnIndex));
diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index 13a428bcf21c..07ef4f7b3eb9 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -199,7 +199,7 @@ void SlideSorter::Init (void)
if (pParentWindow != NULL)
pParentWindow->SetBackground(Wallpaper());
pContentWindow->SetBackground(Wallpaper());
- pContentWindow->SetViewOrigin (Point(0,0));
+ pContentWindow->SetViewOrigin(basegfx::B2DPoint(0.0, 0.0));
// We do our own scrolling while dragging a page selection.
pContentWindow->SetUseDropScroll (false);
// Change the winbits so that the active window accepts the focus.
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterChildWindow.cxx b/sd/source/ui/slidesorter/shell/SlideSorterChildWindow.cxx
index f5be470a08a2..d2c3bf49dd5b 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterChildWindow.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterChildWindow.cxx
@@ -47,7 +47,6 @@ SlideSorterChildWindow::SlideSorterChildWindow (
pParentWindow);
eChildAlignment = SFX_ALIGN_LEFT;
static_cast<SfxDockingWindow*>(pWindow)->Initialize (pInfo);
- // SetHideNotDelete (sal_True);
}
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index 0cd00699140f..7eb3cb50772f 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -87,10 +87,6 @@ SFX_IMPL_INTERFACE(SlideSorterViewShell, SfxShell, SdResId(STR_SLIDESORTERVIEWSH
-TYPEINIT1(SlideSorterViewShell, ViewShell);
-
-
-
::boost::shared_ptr<SlideSorterViewShell> SlideSorterViewShell::Create (
SfxViewFrame* pFrame,
ViewShellBase& rViewShellBase,
@@ -130,13 +126,13 @@ SlideSorterViewShell::SlideSorterViewShell (
{
meShellType = ST_SLIDE_SORTER;
- SetPool( &GetDoc()->GetPool() );
+ SetPool( &GetDoc()->GetItemPool() );
SetUndoManager( GetDoc()->GetDocSh()->GetUndoManager() );
if (pFrameViewArgument != NULL)
mpFrameView = pFrameViewArgument;
else
- mpFrameView = new FrameView(GetDoc());
+ mpFrameView = new FrameView(*GetDoc());
GetFrameView()->Connect();
SetName (String (RTL_CONSTASCII_USTRINGPARAM("SlideSorterViewShell")));
@@ -628,7 +624,7 @@ void SlideSorterViewShell::WriteFrameViewData (void)
if (pActualPage != NULL)
{
if (IsMainViewShell())
- mpFrameView->SetSelectedPage((pActualPage->GetPageNum()- 1) / 2);
+ mpFrameView->SetSelectedPage((pActualPage->GetPageNumber()- 1) / 2);
// else
// The slide sorter is not expected to switch the current page
// other then by double clicks. That is handled seperatly.
@@ -638,7 +634,7 @@ void SlideSorterViewShell::WriteFrameViewData (void)
// We have no current page to set but at least we can make sure
// that the index of the frame view has a legal value.
if (mpFrameView->GetSelectedPage() >= mpSlideSorter->GetModel().GetPageCount())
- mpFrameView->SetSelectedPage((sal_uInt16)mpSlideSorter->GetModel().GetPageCount()-1);
+ mpFrameView->SetSelectedPage(mpSlideSorter->GetModel().GetPageCount()-1);
}
}
}
@@ -656,40 +652,45 @@ void SlideSorterViewShell::SetZoom (long int )
-void SlideSorterViewShell::SetZoomRect (const Rectangle& rZoomRect)
+void SlideSorterViewShell::SetZoomRange(const basegfx::B2DRange& rZoomRange)
{
OSL_ASSERT(mpSlideSorter.get()!=NULL);
Size aPageSize (mpSlideSorter->GetView().GetLayouter().GetPageObjectSize());
+ basegfx::B2DRange aRange(rZoomRange);
- Rectangle aRect(rZoomRect);
-
- if (aRect.GetWidth() < aPageSize.Width())
+ if (aRange.getWidth() < aPageSize.Width())
{
- long nWidthDiff = (aPageSize.Width() - aRect.GetWidth()) / 2;
+ const double fWidthDiff((aPageSize.Width() - aRange.getWidth()) * 0.5);
- aRect.Left() -= nWidthDiff;
- aRect.Right() += nWidthDiff;
+ aRange = basegfx::B2DRange(
+ aRange.getMinX() - fWidthDiff, aRange.getMinY(),
+ aRange.getMaxX() + fWidthDiff, aRange.getMaxY());
- if (aRect.Left() < 0)
+ if (aRange.getMinX() < 0.0)
{
- aRect.SetPos(Point(0, aRect.Top()));
+ aRange = basegfx::B2DRange(
+ 0.0, aRange.getMinY(),
+ aRange.getHeight(), aRange.getMaxY());
}
}
- if (aRect.GetHeight() < aPageSize.Height())
+ if (aRange.getHeight() < aPageSize.Height())
{
- long nHeightDiff = (aPageSize.Height() - aRect.GetHeight()) / 2;
+ const double fHeightDiff((aPageSize.Height() - aRange.getHeight()) * 0.5);
- aRect.Top() -= nHeightDiff;
- aRect.Bottom() += nHeightDiff;
+ aRange = basegfx::B2DRange(
+ aRange.getMinX(), aRange.getMinY() - fHeightDiff,
+ aRange.getMaxX(), aRange.getMaxY() + fHeightDiff);
- if (aRect.Top() < 0)
+ if (aRange.getMinY() < 0.0)
{
- aRect.SetPos(Point(aRect.Left(), 0));
+ aRange = basegfx::B2DRange(
+ aRange.getMinX(), 0.0,
+ aRange.getMaxX(), aRange.getWidth());
}
}
- ViewShell::SetZoomRect(aRect);
+ ViewShell::SetZoomRange(aRange);
// #106268#
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
@@ -710,12 +711,13 @@ void SlideSorterViewShell::UpdateScrollBars (void)
void SlideSorterViewShell::StartDrag (
- const Point& rDragPt,
+ const basegfx::B2DPoint& rDragPt,
::Window* pWindow )
{
OSL_ASSERT(mpSlideSorter.get()!=NULL);
+ const Point aOldPoint(basegfx::fround(rDragPt.getX()), basegfx::fround(rDragPt.getY()));
mpSlideSorter->GetController().GetClipboard().StartDrag (
- rDragPt,
+ aOldPoint,
pWindow);
}
@@ -736,8 +738,8 @@ sal_Int8 SlideSorterViewShell::AcceptDrop (
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
OSL_ASSERT(mpSlideSorter.get()!=NULL);
return mpSlideSorter->GetController().GetClipboard().AcceptDrop (
@@ -745,7 +747,7 @@ sal_Int8 SlideSorterViewShell::AcceptDrop (
rTargetHelper,
pTargetWindow,
nPage,
- nLayer);
+ aLayer);
}
@@ -755,8 +757,8 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
OSL_ASSERT(mpSlideSorter.get()!=NULL);
return mpSlideSorter->GetController().GetClipboard().ExecuteDrop (
@@ -764,7 +766,7 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop (
rTargetHelper,
pTargetWindow,
nPage,
- nLayer);
+ aLayer);
}
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index 28b3ee67e6d3..5ebec196dcfc 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -68,6 +68,7 @@
#include <algorithm>
#include <svx/sdrpagewindow.hxx>
#include <svl/itempool.hxx>
+#include <svx/svdlegacy.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -81,7 +82,6 @@
#endif
#include <boost/foreach.hpp>
-
using namespace std;
using namespace ::sd::slidesorter::model;
using namespace ::drawinglayer::primitive2d;
@@ -140,11 +140,9 @@ private:
-TYPEINIT1(SlideSorterView, ::sd::View);
-
SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
: ::sd::View (
- rSlideSorter.GetModel().GetDocument(),
+ *rSlideSorter.GetModel().GetDocument(),
rSlideSorter.GetContentWindow().get(),
rSlideSorter.GetViewShell()),
mrSlideSorter(rSlideSorter),
@@ -172,7 +170,7 @@ SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
maVisibilityChangeListeners()
{
// Hide the page that contains the page objects.
- SetPageVisible (sal_False);
+ SetPageVisible (false);
// Register the background painter on level 1 to avoid the creation of a
// background buffer.
@@ -239,18 +237,19 @@ void SlideSorterView::Dispose (void)
-sal_Int32 SlideSorterView::GetPageIndexAtPoint (const Point& rWindowPosition) const
+sal_uInt32 SlideSorterView::GetPageIndexAtPoint (const Point& rPosition) const
{
- sal_Int32 nIndex (-1);
+ sal_uInt32 nIndex (SDRPAGE_NOTFOUND);
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
- nIndex = mpLayouter->GetIndexAtPoint(pWindow->PixelToLogic(rWindowPosition), false, false);
+ const Point aLogicPos(pWindow->PixelToLogic(rPosition));
+ nIndex = mpLayouter->GetIndexAtPoint(aLogicPos, false, false);
// Clip the page index against the page count.
if (nIndex >= mrModel.GetPageCount())
- nIndex = -1;
+ nIndex = SDRPAGE_NOTFOUND;
}
return nIndex;
@@ -267,9 +266,9 @@ Layouter& SlideSorterView::GetLayouter (void)
-void SlideSorterView::ModelHasChanged (void)
+void SlideSorterView::LazyReactOnObjectChanges(void)
{
- // Ignore this call. Rely on hints sent by the model to get informed of
+ // Ignore this call, do NOT call parent. Rely on hints sent by the model to get informed of
// model changes.
}
@@ -281,7 +280,7 @@ void SlideSorterView::LocalModelHasChanged(void)
mbModelChangedWhileModifyEnabled = false;
// First call our base class.
- View::ModelHasChanged ();
+ View::LazyReactOnObjectChanges();
}
@@ -394,11 +393,12 @@ void SlideSorterView::Rearrange (void)
if (aWindowSize.Width()<=0 || aWindowSize.Height()<=0)
return;
+ const basegfx::B2DVector& rPageScale(mrModel.GetPageDescriptor(0)->GetPage()->GetPageScale());
const bool bRearrangeSuccess (
mpLayouter->Rearrange (
meOrientation,
aWindowSize,
- mrModel.GetPageDescriptor(0)->GetPage()->GetSize(),
+ Size(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY())),
mrModel.GetPageCount()));
if (bRearrangeSuccess)
{
@@ -491,8 +491,8 @@ void SlideSorterView::Layout ()
// Set the model area, i.e. the smallest rectangle that includes all
// page objects.
const Rectangle aViewBox (mpLayouter->GetTotalBoundingBox());
- pWindow->SetViewOrigin (aViewBox.TopLeft());
- pWindow->SetViewSize (aViewBox.GetSize());
+ pWindow->SetViewOrigin(basegfx::B2DPoint(aViewBox.Left(), aViewBox.Top()));
+ pWindow->SetViewSize(basegfx::B2DVector(aViewBox.getWidth(), aViewBox.getHeight()));
::boost::shared_ptr<PageObjectLayouter> pPageObjectLayouter(
mpLayouter->GetPageObjectLayouter());
@@ -830,9 +830,10 @@ void SlideSorterView::ConfigurationChanged (
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
if (pWindow && mpPreviewCache.get() == NULL)
{
+ const Size& rPageObjSize = mpLayouter->GetPageObjectSize();
mpPreviewCache.reset(
new cache::PageCache(
- mpLayouter->GetPageObjectSize(),
+ rPageObjSize,
false,
cache::SharedCacheContext(new ViewCacheContext(mrSlideSorter))));
}
diff --git a/sd/source/ui/slidesorter/view/SlsFontProvider.cxx b/sd/source/ui/slidesorter/view/SlsFontProvider.cxx
index 80b8262ef8bc..263ba506ae1c 100644
--- a/sd/source/ui/slidesorter/view/SlsFontProvider.cxx
+++ b/sd/source/ui/slidesorter/view/SlsFontProvider.cxx
@@ -107,7 +107,7 @@ FontProvider::SharedFontPointer FontProvider::GetFont (const OutputDevice& rDevi
{
// Initialize the font from the application style settings.
maFont.reset(new Font (Application::GetSettings().GetStyleSettings().GetAppFont()));
- maFont->SetTransparent(sal_True);
+ maFont->SetTransparent(true);
maFont->SetWeight(WEIGHT_NORMAL);
// Transform the point size to pixel size.
diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
index 9332fc6b8976..9cde6d73c8e4 100644
--- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
@@ -454,7 +454,7 @@ sal_Int32 Layouter::GetIndex (const sal_Int32 nRow, const sal_Int32 nColumn) con
-Size Layouter::GetPageObjectSize (void) const
+const Size& Layouter::GetPageObjectSize (void) const
{
return mpImplementation->maPageObjectSize;
}
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 84a7f91fe023..20022caf4a4d 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -232,8 +232,8 @@ void PageObjectPainter::PaintBackground (
SdPage* pPage = rpDescriptor->GetPage();
if (pPage != NULL)
{
- rDevice.SetFillColor(pPage->GetPageBackgroundColor(NULL));
- rDevice.SetLineColor(pPage->GetPageBackgroundColor(NULL));
+ rDevice.SetFillColor(pPage->GetPageBackgroundColor());
+ rDevice.SetLineColor(pPage->GetPageBackgroundColor());
const Rectangle aPreviewBox (mpPageObjectLayouter->GetBoundingBox(
rpDescriptor,
PageObjectLayouter::Preview,
@@ -382,7 +382,7 @@ void PageObjectPainter::PaintPageNumber (
// Paint the page number.
OSL_ASSERT(rpDescriptor->GetPage()!=NULL);
- const sal_Int32 nPageNumber ((rpDescriptor->GetPage()->GetPageNum() - 1) / 2 + 1);
+ const sal_Int32 nPageNumber ((rpDescriptor->GetPage()->GetPageNumber() - 1) / 2 + 1);
const String sPageNumber (String::CreateFromInt32(nPageNumber));
rDevice.SetFont(*mpPageNumberFont);
rDevice.SetTextColor(aPageNumberColor);
diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
index f08cb6ce8c46..0361b163eba5 100644
--- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
+++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
@@ -129,7 +129,7 @@ const SdrPage* ViewCacheContext::GetPage (cache::CacheKey aKey)
sal_Int32 ViewCacheContext::GetPriority (cache::CacheKey aKey)
{
- return - (static_cast<const SdrPage*>(aKey)->GetPageNum()-1) / 2;
+ return - (static_cast<const SdrPage*>(aKey)->GetPageNumber()-1) / 2;
}
@@ -137,7 +137,7 @@ sal_Int32 ViewCacheContext::GetPriority (cache::CacheKey aKey)
model::SharedPageDescriptor ViewCacheContext::GetDescriptor (cache::CacheKey aKey)
{
- sal_uInt16 nPageIndex ((static_cast<const SdrPage*>(aKey)->GetPageNum() - 1) / 2);
+ sal_uInt16 nPageIndex ((static_cast<const SdrPage*>(aKey)->GetPageNumber() - 1) / 2);
return mrModel.GetPageDescriptor(nPageIndex);
}
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index e49cffbaecdf..4b376b7fe77b 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -384,7 +384,7 @@ void TableDesignPane::updateLayout()
Size aSize( mxControls[nId]->GetSizePixel() );
aSize.Width() = aPaneSize.Width() - aOffset.X() - mxControls[nId]->GetPosPixel().X();
mxControls[nId]->SetSizePixel( aSize );
- mxControls[nId]->SetPaintTransparent(sal_True);
+ mxControls[nId]->SetPaintTransparent(true);
mxControls[nId]->SetBackground();
}
aValueSetSize = Size( pValueSet->GetSizePixel().Width(), nStylesHeight - mxControls[FL_TABLE_STYLES]->GetSizePixel().Height() - mnOrgOffsetY[FL_TABLE_STYLES] );
@@ -483,8 +483,8 @@ void TableDesignPane::updateControls()
{
DBG_ERROR("sd::TableDesignPane::updateControls(), exception caught!");
}
- static_cast< CheckBox* >( mxControls[i].get() )->Check( bUse ? sal_True : sal_False );
- mxControls[i]->Enable(bHasTable ? sal_True : sal_False );
+ static_cast< CheckBox* >( mxControls[i].get() )->Check( bUse ? true : false );
+ mxControls[i]->Enable(bHasTable ? true : false );
}
FillDesignPreviewControl();
@@ -921,9 +921,9 @@ short TableDesignDialog::Execute()
if( mpDesignPane->isOptionsChanged() )
mpDesignPane->ApplyOptions();
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
// ====================================================================
diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx
index b78238337678..162c56512ae6 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -49,6 +49,7 @@
#include <svx/sdr/table/tabledesign.hxx>
#include <svx/svxdlg.hxx>
#include <vcl/msgbox.hxx>
+#include <svx/svdlegacy.hxx>
#include <svl/itempool.hxx>
#include <sfx2/viewfrm.hxx>
@@ -119,9 +120,9 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
sal_Int32 nRows = 0;
OUString sTableStyle;
- SFX_REQUEST_ARG( rReq, pCols, SfxUInt16Item, SID_ATTR_TABLE_COLUMN, sal_False );
- SFX_REQUEST_ARG( rReq, pRows, SfxUInt16Item, SID_ATTR_TABLE_ROW, sal_False );
- SFX_REQUEST_ARG( rReq, pStyle, SfxStringItem, SID_TABLE_STYLE, sal_False );
+ SFX_REQUEST_ARG( rReq, pCols, SfxUInt16Item, SID_ATTR_TABLE_COLUMN );
+ SFX_REQUEST_ARG( rReq, pRows, SfxUInt16Item, SID_ATTR_TABLE_ROW );
+ SFX_REQUEST_ARG( rReq, pStyle, SfxStringItem, SID_TABLE_STYLE );
if( pCols )
nColumns = pCols->GetValue();
@@ -144,55 +145,64 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
nRows = pDlg->getRows();
}
- Rectangle aRect;
+ basegfx::B2DHomMatrix aObjTrans;
SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_TABLE );
if( pPickObj )
{
- aRect = pPickObj->GetLogicRect();
- aRect.setHeight( 200 );
+ aObjTrans = pPickObj->getSdrObjectTransformation();
+ const basegfx::B2DPoint aTopLeft(aObjTrans * basegfx::B2DPoint(0.0, 0.0));
+ const basegfx::B2DPoint aBottomLeft(aObjTrans * basegfx::B2DPoint(0.0, 1.0));
+ const double fLength(basegfx::B2DVector(aBottomLeft - aTopLeft).getLength());
+ const double fScaleFactor(200.0 / (basegfx::fTools::equalZero(fLength) ? 1.0 : fLength));
+
+ aObjTrans = basegfx::tools::createScaleB2DHomMatrix(1.0, fScaleFactor) * aObjTrans;
}
else
{
- Size aSize( 14100, 200 );
-
- Point aPos;
- Rectangle aWinRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
- aPos = aWinRect.Center();
- aPos = GetActiveWindow()->PixelToLogic(aPos);
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- aRect = Rectangle(aPos, aSize);
+ const basegfx::B2DPoint aCenter(GetActiveWindow()->GetLogicRange().getCenter());
+ const basegfx::B2DVector aScale(14100.0, 200.0);
+
+ aObjTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aCenter - (aScale * 0.5));
}
- ::sdr::table::SdrTableObj* pObj = new ::sdr::table::SdrTableObj( GetDoc(), aRect, nColumns, nRows );
- pObj->NbcSetStyleSheet( GetDoc()->GetDefaultStyleSheet(), sal_True );
+ ::sdr::table::SdrTableObj* pObj = new ::sdr::table::SdrTableObj(
+ *GetDoc(),
+ aObjTrans,
+ nColumns,
+ nRows);
+
+ pObj->SetStyleSheet( GetDoc()->GetDefaultStyleSheet(), sal_True );
apply_table_style( pObj, GetDoc(), sTableStyle );
- SdrPageView* pPV = mpView->GetSdrPageView();
// if we have a pick obj we need to make this new ole a pres obj replacing the current pick obj
if( pPickObj )
{
- SdPage* pPage = static_cast< SdPage* >(pPickObj->GetPage());
+ SdPage* pPage = static_cast< SdPage* >(pPickObj->getSdrPageFromSdrObject());
if(pPage && pPage->IsPresObj(pPickObj))
{
- pObj->SetUserCall( pPickObj->GetUserCall() );
+ // replace formally used 'pObj->SetUserCall(pPickObj->GetUserCall())' by
+ // new notify/listener mechanism
+ SdPage* pCurrentlyConnectedSdPage = findConnectionToSdrObject(pPickObj);
+ establishConnectionToSdrObject(pObj, pCurrentlyConnectedSdPage);
+
pPage->InsertPresObj( pObj, PRESOBJ_TABLE );
}
}
- GetParentWindow()->GrabFocus();
if( pPickObj )
- mpView->ReplaceObjectAtView(pPickObj, *pPV, pObj, sal_True );
+ {
+ mpView->ReplaceObjectAtView(*pPickObj, *pObj, true);
+ }
else
- mpView->InsertObjectAtView(pObj, *pPV, SDRINSERT_SETDEFLAYER);
+ {
+ mpView->InsertObjectAtView(*pObj, SDRINSERT_SETDEFLAYER);
+ }
Invalidate(SID_DRAWTBX_INSERT);
rReq.Ignore();
-SfxViewShell* pViewShell = GetViewShell();
- OSL_ASSERT (pViewShell!=NULL);
- SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
- rBindings.Invalidate( SID_INSERT_TABLE, sal_True, sal_False );
break;
}
case SID_TABLEDESIGN:
@@ -244,27 +254,24 @@ void DrawViewShell::GetTableMenuState( SfxItemSet &rSet )
// --------------------------------------------------------------------
-void CreateTableFromRTF( SvStream& rStream, SdDrawDocument* pModel )
+void CreateTableFromRTF( SvStream& rStream, SdDrawDocument& rModel )
{
rStream.Seek( 0 );
+ SdrPage* pPage = rModel.GetPage(0);
- if( pModel )
+ if( pPage )
{
- SdrPage* pPage = pModel->GetPage(0);
- if( pPage )
- {
- Size aSize( 200, 200 );
- Point aPos;
- Rectangle aRect (aPos, aSize);
- ::sdr::table::SdrTableObj* pObj = new ::sdr::table::SdrTableObj( pModel, aRect, 1, 1 );
- pObj->NbcSetStyleSheet( pModel->GetDefaultStyleSheet(), sal_True );
- OUString sTableStyle;
- apply_table_style( pObj, pModel, sTableStyle );
+ ::sdr::table::SdrTableObj* pObj = new ::sdr::table::SdrTableObj(
+ rModel,
+ basegfx::tools::createScaleB2DHomMatrix(
+ 200.0, 200.0));
+ pObj->SetStyleSheet( rModel.GetDefaultStyleSheet(), sal_True );
+ OUString sTableStyle;
+ apply_table_style( pObj, &rModel, sTableStyle );
- pPage->NbcInsertObject( pObj );
+ pPage->InsertObjectToSdrObjList(*pObj);
- sdr::table::SdrTableObj::ImportAsRTF( rStream, *pObj );
- }
+ sdr::table::SdrTableObj::ImportAsRTF( rStream, *pObj );
}
}
diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx
index 60f65856d889..ac18a7c0309d 100644
--- a/sd/source/ui/table/tableobjectbar.cxx
+++ b/sd/source/ui/table/tableobjectbar.cxx
@@ -80,10 +80,6 @@ void RegisterInterfaces(SfxModule* pMod)
// - TableObjectBar -
// ------------------
-TYPEINIT1( TableObjectBar, SfxShell );
-
-// -----------------------------------------------------------------------------
-
SFX_IMPL_INTERFACE( TableObjectBar, SfxShell, SdResId( STR_TABLEOBJECTBARSHELL ) )
{
}
@@ -196,7 +192,7 @@ void TableObjectBar::Execute( SfxRequest& rReq )
case SID_TABLE_INSERT_ROW:
case SID_TABLE_INSERT_COL:
{
- pView->AdjustMarkHdl();
+ pView->SetMarkHandles();
pBindings->Invalidate( SID_TABLE_DELETE_ROW );
pBindings->Invalidate( SID_TABLE_DELETE_COL );
pBindings->Invalidate( SID_FRAME_LINESTYLE );
diff --git a/sd/source/ui/table/tableobjectbar.hxx b/sd/source/ui/table/tableobjectbar.hxx
index 70ef7f530abf..4d19a24c23a9 100644
--- a/sd/source/ui/table/tableobjectbar.hxx
+++ b/sd/source/ui/table/tableobjectbar.hxx
@@ -40,7 +40,6 @@ namespace sd { namespace ui { namespace table {
class TableObjectBar : public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE( SD_IF_SDDRAWTABLEOBJECTBAR )
TableObjectBar( ::sd::ViewShell* pSdViewShell, ::sd::View* pSdView);
diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx
index 9fb6e4c2c5ab..0a66b77bc927 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.cxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.cxx
@@ -113,8 +113,6 @@ SFX_IMPL_INTERFACE(LayoutMenu, SfxShell,
SFX_POPUPMENU_REGISTRATION(SdResId(RID_TASKPANE_LAYOUTMENU_POPUP));
}
-TYPEINIT1(LayoutMenu, SfxShell);
-
struct snewfoil_value_info
{
sal_uInt16 mnBmpResId;
@@ -203,7 +201,7 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
SetStyle (GetStyle() | WB_VSCROLL);
SetExtraSpacing(2);
SetSelectHdl (LINK(this, LayoutMenu, ClickHandler));
- SetPool (&rDocumentShell.GetDoc()->GetPool());
+ SetPool (&rDocumentShell.GetDoc()->GetItemPool());
SetName(String(RTL_CONSTASCII_USTRINGPARAM("LayoutMenu")));
InvalidateContent();
@@ -605,7 +603,6 @@ int LayoutMenu::CalculateRowCount (const Size&, int nColumnCount)
if (GetItemCount() > 0 && nColumnCount > 0)
{
nRowCount = (GetItemCount() + nColumnCount - 1) / nColumnCount;
- // nRowCount = GetOutputSizePixel().Height() / rItemSize.Height();
if (nRowCount < 1)
nRowCount = 1;
}
@@ -700,16 +697,16 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
::std::vector<SdPage*>::iterator iPage;
for (iPage=pPageSelection->begin(); iPage!=pPageSelection->end(); ++iPage)
- {
- if ((*iPage) == NULL)
- continue;
-
- // Call the SID_ASSIGN_LAYOUT slot with all the necessary parameters.
- SfxRequest aRequest (mrBase.GetViewFrame(), SID_ASSIGN_LAYOUT);
- aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATPAGE, ((*iPage)->GetPageNum()-1)/2));
- aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout));
- pMainViewShell->ExecuteSlot (aRequest, sal_Bool(sal_False));
- }
+ {
+ if ((*iPage) == NULL)
+ continue;
+
+ // Call the SID_ASSIGN_LAYOUT slot with all the necessary parameters.
+ SfxRequest aRequest (mrBase.GetViewFrame(), SID_ASSIGN_LAYOUT);
+ aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATPAGE, ((*iPage)->GetPageNumber()-1)/2));
+ aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout));
+ pMainViewShell->ExecuteSlot (aRequest, sal_False);
+ }
}
while(false);
}
@@ -725,11 +722,11 @@ SfxRequest LayoutMenu::CreateRequest (
do
{
- SdrLayerAdmin& rLayerAdmin (mrBase.GetDocument()->GetLayerAdmin());
+ SdrLayerAdmin& rLayerAdmin (mrBase.GetDocument()->GetModelLayerAdmin());
sal_uInt8 aBackground (rLayerAdmin.GetLayerID(
- String(SdResId(STR_LAYER_BCKGRND)), sal_False));
+ String(SdResId(STR_LAYER_BCKGRND)), false));
sal_uInt8 aBackgroundObject (rLayerAdmin.GetLayerID(
- String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False));
+ String(SdResId(STR_LAYER_BCKGRNDOBJ)), false));
ViewShell* pViewShell = mrBase.GetMainViewShell().get();
if (pViewShell == NULL)
break;
@@ -882,8 +879,9 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
// popup menu at the center of the current item.
if (GetSelectItemId() != (sal_uInt16)-1)
{
- Rectangle aBBox (GetItemRect(GetSelectItemId()));
- Point aPosition (aBBox.Center());
+ const Rectangle aBBox(GetItemRect(GetSelectItemId()));
+ const Point aPosition(aBBox.Center());
+
mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
SdResId(RID_TASKPANE_LAYOUTMENU_POPUP),
this,
diff --git a/sd/source/ui/toolpanel/LayoutMenu.hxx b/sd/source/ui/toolpanel/LayoutMenu.hxx
index fe276d0ab50c..d6281de0f99a 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.hxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.hxx
@@ -67,7 +67,6 @@ class LayoutMenu
public DropTargetHelper
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDLAYOUTMENU)
/** Create a new layout menu. Depending on the given flag it
diff --git a/sd/source/ui/toolpanel/ScrollPanel.cxx b/sd/source/ui/toolpanel/ScrollPanel.cxx
index c32d8bb21df0..999431a8ce01 100644
--- a/sd/source/ui/toolpanel/ScrollPanel.cxx
+++ b/sd/source/ui/toolpanel/ScrollPanel.cxx
@@ -76,10 +76,10 @@ void ScrollPanel::Construct()
// Initialize the scroll bars.
maVerticalScrollBar.SetScrollHdl (
LINK(this, ScrollPanel, ScrollBarHandler));
- maVerticalScrollBar.EnableDrag (sal_True);
+ maVerticalScrollBar.EnableDrag (true);
maHorizontalScrollBar.SetScrollHdl (
LINK(this, ScrollPanel, ScrollBarHandler));
- maHorizontalScrollBar.EnableDrag (sal_True);
+ maHorizontalScrollBar.EnableDrag (true);
}
@@ -652,15 +652,12 @@ IMPL_LINK(ScrollPanel, ScrollBarHandler, ScrollBar*, EMPTYARG)
long ScrollPanel::Notify( NotifyEvent& rNEvt )
{
- long nRet = sal_False;
+ long nRet = false;
if( rNEvt.GetType() == EVENT_COMMAND )
{
// note: dynamic_cast is not possible as GetData() returns a void*
CommandEvent* pCmdEvent = reinterpret_cast< CommandEvent* >(rNEvt.GetData());
- DBG_ASSERT( pCmdEvent!=0 &&
- ( pCmdEvent->IsMouseEvent() == sal_True ||
- pCmdEvent->IsMouseEvent() == sal_False ),
- "Invalid CommandEvent" );
+ DBG_ASSERT( pCmdEvent, "Invalid CommandEvent" );
if (pCmdEvent)
switch (pCmdEvent->GetCommand())
{
diff --git a/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx b/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx
index 009a3e5a4094..1c199598bade 100644
--- a/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx
+++ b/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx
@@ -117,17 +117,19 @@ void SlideSorterCacheDisplay::Paint (const Rectangle& rBoundingBox)
sal_Int32 nPageIndex (nC + nR*mnColumnCount);
if (nPageIndex < mnPageCount)
{
- Rectangle aBox (GetPageBox(nPageIndex));
+ basegfx::B2DRange aBox(GetPageBox(nPageIndex));
+
if ( ! maPageDescriptors[nPageIndex].mbVisible)
{
mpWindow->SetLineColor();
mpWindow->SetFillColor(maBackgroundColor);
mpWindow->DrawRect(aBox);
- aBox.Left() += maCellSize.Width()/4;
- aBox.Right() -= maCellSize.Width()/4;
- aBox.Top() += maCellSize.Height()/4;
- aBox.Bottom() -= maCellSize.Height()/4;
+ aBox = basegfx::B2DRange(
+ aBox.getMinX() + (maCellSize.getX() * 0.25),
+ aBox.getMinY() + (maCellSize.getY() * 0.25),
+ aBox.getMaxX() - (maCellSize.getX() * 0.25),
+ aBox.getMaxY() - (maCellSize.getY() * 0.25));
}
switch (maPageDescriptors[nPageIndex].meStatus)
@@ -143,7 +145,7 @@ void SlideSorterCacheDisplay::Paint (const Rectangle& rBoundingBox)
mpWindow->DrawRect(aBox);
if ( ! maPageDescriptors[nPageIndex].mbUpToDate)
- mpWindow->DrawLine(aBox.TopLeft(), aBox.BottomRight());
+ mpWindow->DrawLine(aBox.getMinimum(), aBox.getMaximum());
}
}
mpWindow->SetLineColor(maSavedLineColor);
@@ -251,14 +253,15 @@ void SlideSorterCacheDisplay::SetUpToDate (sal_Int32 nPageIndex, bool bUpToDate)
-Rectangle SlideSorterCacheDisplay::GetPageBox (sal_Int32 nPageIndex)
+basegfx::B2DRange SlideSorterCacheDisplay::GetPageBox (sal_Int32 nPageIndex)
{
- sal_Int32 nRow = nPageIndex / mnColumnCount;
- sal_Int32 nColumn = nPageIndex % mnColumnCount;
- return Rectangle(
- Point(mnHorizontalBorder + nColumn * maCellSize.Width() + nColumn*mnHorizontalGap,
- mnVerticalBorder + nRow * maCellSize.Height() + nRow*mnVerticalGap),
- maCellSize);
+ const sal_Int32 nRow(nPageIndex / mnColumnCount);
+ const sal_Int32 nColumn(nPageIndex % mnColumnCount);
+ const basegfx::B2DPoint aTopLeft(
+ mnHorizontalBorder + nColumn * maCellSize.Width() + nColumn * mnHorizontalGap,
+ mnVerticalBorder + nRow * maCellSize.Height() + nRow * mnVerticalGap);
+
+ return basegfx::B2DRange(aTopLeft, aTopLeft + maCellSize);
}
diff --git a/sd/source/ui/toolpanel/SubToolPanel.cxx b/sd/source/ui/toolpanel/SubToolPanel.cxx
index 18807152c2a0..a012dbb86e53 100644
--- a/sd/source/ui/toolpanel/SubToolPanel.cxx
+++ b/sd/source/ui/toolpanel/SubToolPanel.cxx
@@ -352,9 +352,10 @@ sal_Int32 SubToolPanel::LayoutChildren (void)
IMPL_LINK(SubToolPanel, WindowEventListener, VclSimpleEvent*, pEvent)
{
- if (pEvent!=NULL && pEvent->ISA(VclWindowEvent))
+ VclWindowEvent* pWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+
+ if (pWindowEvent)
{
- VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent);
switch (pWindowEvent->GetId())
{
case VCLEVENT_WINDOW_SHOW:
diff --git a/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx b/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
index 79ed39912751..8cdbd84f8d88 100644
--- a/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
@@ -303,9 +303,10 @@ bool FocusManager::TransferFocus (
IMPL_LINK(FocusManager, WindowEventListener, VclSimpleEvent*, pEvent)
{
- if (pEvent!=NULL && pEvent->ISA(VclWindowEvent))
+ VclWindowEvent* pWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+
+ if (pWindowEvent)
{
- VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent);
switch (pWindowEvent->GetId())
{
case VCLEVENT_WINDOW_KEYINPUT:
diff --git a/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx b/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx
index 271953d46b08..fc257e6192c4 100644
--- a/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx
@@ -212,7 +212,7 @@ TaskPaneShellManager* TreeNode::GetShellManager (void)
::Window* pWindow = GetWindow();
if (pWindow != NULL)
{
- xAccessible = pWindow->GetAccessible(sal_False);
+ xAccessible = pWindow->GetAccessible(false);
if ( ! xAccessible.is())
{
::com::sun::star::uno::Reference<
diff --git a/sd/source/ui/toolpanel/TestMenu.cxx b/sd/source/ui/toolpanel/TestMenu.cxx
index da9ef821cc8b..0d3db72d47e8 100644
--- a/sd/source/ui/toolpanel/TestMenu.cxx
+++ b/sd/source/ui/toolpanel/TestMenu.cxx
@@ -169,14 +169,11 @@ bool ColorMenu::IsResizable (void)
void ColorMenu::Resize (void)
{
::Window::Resize();
- Size aWindowSize = GetOutputSizePixel();
+ const Size aWindowSize(GetOutputSizePixel());
maSet.SetPosSizePixel (Point(0,0), aWindowSize);
+
if (IsVisible() && aWindowSize.Width() > 0)
{
- // maSet.SetPosSizePixel (
- // Point (0,0),
- // aWindowSize);
-
// Calculate the number of rows and columns.
if (maSet.GetItemCount() > 0)
{
diff --git a/sd/source/ui/toolpanel/TitleBar.cxx b/sd/source/ui/toolpanel/TitleBar.cxx
index 9e9bc28eb7f4..5a99df795495 100644
--- a/sd/source/ui/toolpanel/TitleBar.cxx
+++ b/sd/source/ui/toolpanel/TitleBar.cxx
@@ -65,7 +65,7 @@ TitleBar::TitleBar ( ::Window* pParent, const String& rsTitle, TitleBarType eTyp
, mpDevice(new VirtualDevice (*this))
, mbIsExpandable (bIsExpandable)
{
- EnableMapMode (sal_False);
+ EnableMapMode (false);
SetBackground (Wallpaper());
@@ -306,7 +306,7 @@ void TitleBar::PaintFocusIndicator (const Rectangle& rTextBox)
if (mbFocused)
{
Rectangle aTextPixelBox (mpDevice->LogicToPixel (rTextBox));
- mpDevice->EnableMapMode (sal_False);
+ mpDevice->EnableMapMode (false);
Rectangle aBox (rTextBox);
aBox.Top() -= 1;
aBox.Bottom() += 1;
@@ -323,7 +323,7 @@ void TitleBar::PaintFocusIndicator (const Rectangle& rTextBox)
mpDevice->SetLineColor (COL_BLACK);
mpDevice->DrawPolyLine (Polygon(aTextPixelBox), aDottedStyle);
- mpDevice->EnableMapMode (sal_False);
+ mpDevice->EnableMapMode (false);
}
else
HideFocus ();
diff --git a/sd/source/ui/toolpanel/TitledControl.cxx b/sd/source/ui/toolpanel/TitledControl.cxx
index bdd90ceb8fa7..ec00a5f9f821 100644
--- a/sd/source/ui/toolpanel/TitledControl.cxx
+++ b/sd/source/ui/toolpanel/TitledControl.cxx
@@ -350,9 +350,10 @@ void TitledControl::UpdateStates (void)
IMPL_LINK(TitledControl, WindowEventListener,
VclSimpleEvent*, pEvent)
{
- if (pEvent!=NULL && pEvent->ISA(VclWindowEvent))
+ VclWindowEvent* pWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+
+ if (pWindowEvent)
{
- VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent);
switch (pWindowEvent->GetId())
{
case VCLEVENT_WINDOW_MOUSEBUTTONUP:
diff --git a/sd/source/ui/toolpanel/ToolPanel.cxx b/sd/source/ui/toolpanel/ToolPanel.cxx
index 3e229cda9776..22e7403ad9df 100644
--- a/sd/source/ui/toolpanel/ToolPanel.cxx
+++ b/sd/source/ui/toolpanel/ToolPanel.cxx
@@ -90,7 +90,7 @@ namespace sd { namespace toolpanel
Reference< XAccessible > SAL_CALL ToolPanel::createAccessible( const Reference< XAccessible >& i_rParentAccessible ) throw (RuntimeException)
{
ToolPanelGuard aGuard( *this );
- Reference< XAccessible > xAccessible( m_pControl->GetWindow()->GetAccessible( sal_False ) );
+ Reference< XAccessible > xAccessible( m_pControl->GetWindow()->GetAccessible( false ) );
if ( !xAccessible.is() )
{
xAccessible.set( m_pControl->CreateAccessibleObject( i_rParentAccessible ) );
diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
index ba49bac8f0d7..57aa9ca0c6f3 100644
--- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
+++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
@@ -359,9 +359,6 @@ SFX_IMPL_INTERFACE(ToolPanelViewShell, SfxShell, SdResId(STR_TASKPANEVIEWSHELL))
}
// ---------------------------------------------------------------------------------------------------------------------
-TYPEINIT1(ToolPanelViewShell, ViewShell);
-
-// ---------------------------------------------------------------------------------------------------------------------
ToolPanelViewShell_Impl::InitialPanel ToolPanelViewShell_Impl::impl_determineInitialPanel()
{
InitialPanel aPanelToActivate;
@@ -491,12 +488,12 @@ ToolPanelViewShell::ToolPanelViewShell( SfxViewFrame* pFrame, ViewShellBase& rVi
mpImpl->ConnectToDockingWindow();
- SetPool( &GetDoc()->GetPool() );
+ SetPool( &GetDoc()->GetItemPool() );
if ( pFrameViewArgument )
mpFrameView = pFrameViewArgument;
else
- mpFrameView = new FrameView( GetDoc() );
+ mpFrameView = new FrameView( *GetDoc() );
GetFrameView()->Connect();
// Hide or delete unused controls that we have inherited from the
@@ -880,7 +877,7 @@ void ToolPanelViewShell_Impl::ConnectToDockingWindow()
// ---------------------------------------------------------------------------------------------------------------------
Reference< XAccessible > ToolPanelViewShell_Impl::CreateAccessible( ::sd::Window& i_rWindow )
{
- Reference< XAccessible > xAccessible( GetToolPanelDeck().GetAccessible( sal_False ) );
+ Reference< XAccessible > xAccessible( GetToolPanelDeck().GetAccessible( false ) );
if ( !xAccessible.is() )
{
// determine the XAccessible which is the parent of the to-be-created object
@@ -888,7 +885,7 @@ Reference< XAccessible > ToolPanelViewShell_Impl::CreateAccessible( ::sd::Window
OSL_ENSURE( pAccessibleParent, "ToolPanelViewShell_Impl::CreateAccessible: illegal accessible parent provided by the sd::Window!" );
GetToolPanelDeck().SetAccessibleParentWindow( pAccessibleParent );
- xAccessible = GetToolPanelDeck().GetAccessible( sal_True );
+ xAccessible = GetToolPanelDeck().GetAccessible( true );
ENSURE_OR_RETURN( xAccessible.is(), "ToolPanelViewShell_Impl::CreateAccessible: illegal ToolPanelDeck accessible!", NULL );
OSL_ENSURE( xAccessible->getAccessibleContext().is()
&& xAccessible->getAccessibleContext()->getAccessibleParent() == pAccessibleParent->GetAccessible(),
diff --git a/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx b/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx
index ecbf497c0143..608c54923fd7 100644
--- a/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx
+++ b/sd/source/ui/toolpanel/controls/AllMasterPagesSelector.hxx
@@ -66,7 +66,7 @@ private:
void AddTemplate (const TemplateEntry& rEntry);
- /** This filter returns <TRUE/> when the master page specified by the
+ /** This filter returns <true/> when the master page specified by the
given file name belongs to the set of Impress master pages.
*/
bool FileFilter (const String& sFileName);
diff --git a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
index e4d073727704..9f5cc47da410 100644
--- a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
@@ -115,12 +115,12 @@ void CurrentMasterPagesSelector::LateInit (void)
void CurrentMasterPagesSelector::Fill (ItemList& rItemList)
{
- sal_uInt16 nPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD);
+ sal_uInt32 nPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD);
SdPage* pMasterPage;
// Remember the names of the master pages that have been inserted to
// avoid double insertion.
::std::set<String> aMasterPageNames;
- for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++)
+ for (sal_uInt32 nIndex=0; nIndex<nPageCount; nIndex++)
{
pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD);
if (pMasterPage == NULL)
@@ -168,10 +168,10 @@ void CurrentMasterPagesSelector::UpdateSelection (void)
{
// Iterate over all pages and for the selected ones put the name of
// their master page into a set.
- sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD);
+ sal_uInt32 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD);
SdPage* pPage;
::std::set<String> aNames;
- sal_uInt16 nIndex;
+ sal_uInt32 nIndex;
bool bLoop (true);
for (nIndex=0; nIndex<nPageCount && bLoop; nIndex++)
{
@@ -228,7 +228,7 @@ void CurrentMasterPagesSelector::Execute (SfxRequest& rRequest)
// Removing the precious flag so that the following call to
// RemoveUnnessesaryMasterPages() will remove this master page.
pMasterPage->SetPrecious(false);
- mrDocument.RemoveUnnecessaryMasterPages(pMasterPage, sal_False, sal_True);
+ mrDocument.RemoveUnnecessaryMasterPages(pMasterPage, false, true);
}
}
break;
diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
index b3148bb2a946..63727f664c4a 100644
--- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
+++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
@@ -58,14 +58,11 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
break;
// Check the presence of the source document.
- SdDrawDocument* pSourceDocument = static_cast<SdDrawDocument*>(
- pMasterPage->GetModel());
- if (pSourceDocument == NULL)
- break;
+ SdDrawDocument& rSourceDocument = static_cast< SdDrawDocument& >(pMasterPage->getSdrModelFromSdrPage());
// When the given master page already belongs to the target document
// then there is nothing more to do.
- if (pSourceDocument == &rTargetDocument)
+ if (&rSourceDocument == &rTargetDocument)
{
pNewMasterPage = pMasterPage;
break;
@@ -75,22 +72,22 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
// present. This is not the case when we are called during the
// creation of the slide master page because then the notes master
// page is not there.
- sal_uInt16 nSourceMasterPageCount = pSourceDocument->GetMasterPageCount();
+ sal_uInt32 nSourceMasterPageCount = rSourceDocument.GetMasterPageCount();
if (nSourceMasterPageCount%2 == 0)
// There should be 1 handout page + n slide masters + n notes
// masters = 2*n+1. An even value indicates that a new slide
// master but not yet the notes master has been inserted.
break;
- sal_uInt16 nIndex = pMasterPage->GetPageNum();
+ sal_uInt32 nIndex = pMasterPage->GetPageNumber();
if (nSourceMasterPageCount <= nIndex+1)
break;
// Get the slide master page.
if (pMasterPage != static_cast<SdPage*>(
- pSourceDocument->GetMasterPage(nIndex)))
+ rSourceDocument.GetMasterPage(nIndex)))
break;
// Get the notes master page.
SdPage* pNotesMasterPage = static_cast<SdPage*>(
- pSourceDocument->GetMasterPage(nIndex+1));
+ rSourceDocument.GetMasterPage(nIndex+1));
if (pNotesMasterPage == NULL)
break;
@@ -98,8 +95,8 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
// Check if a master page with the same name as that of the given
// master page already exists.
bool bPageExists (false);
- sal_uInt16 nMasterPageCount(rTargetDocument.GetMasterSdPageCount(PK_STANDARD));
- for (sal_uInt16 nMaster=0; nMaster<nMasterPageCount; nMaster++)
+ sal_uInt32 nMasterPageCount(rTargetDocument.GetMasterSdPageCount(PK_STANDARD));
+ for (sal_uInt32 nMaster=0; nMaster<nMasterPageCount; nMaster++)
{
SdPage* pCandidate = static_cast<SdPage*>(
rTargetDocument.GetMasterSdPage (nMaster, PK_STANDARD));
@@ -131,7 +128,7 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
PK_STANDARD);
if (pSlide == NULL)
break;
- pSlide->SetAutoLayout(AUTOLAYOUT_TITLE, sal_True);
+ pSlide->SetAutoLayout(AUTOLAYOUT_TITLE, true);
// Create a copy of the master page and the associated notes
// master page and insert them into our document.
@@ -149,9 +146,9 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
rTargetDocument.GetSdPageCount(PK_STANDARD)-1,
pNewMasterPage->GetName(),
&rTargetDocument,
- sal_False, // Connect the new master page with the new slide but
+ false, // Connect the new master page with the new slide but
// do not modify other (master) pages.
- sal_True);
+ true);
}
while (false);
@@ -167,23 +164,23 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
SdPage* DocumentHelper::GetSlideForMasterPage (SdPage* pMasterPage)
{
- SdPage* pCandidate = NULL;
+ if(!pMasterPage)
+ return 0;
- SdDrawDocument* pDocument = NULL;
- if (pMasterPage != NULL)
- pDocument = dynamic_cast<SdDrawDocument*>(pMasterPage->GetModel());
+ SdPage* pCandidate = NULL;
+ SdDrawDocument& rDocument = dynamic_cast< SdDrawDocument& >(pMasterPage->getSdrModelFromSdrPage());
// Iterate over all pages and check if it references the given master
// page.
- if (pDocument!=NULL && pDocument->GetSdPageCount(PK_STANDARD) > 0)
+ if (rDocument.GetSdPageCount(PK_STANDARD) > 0)
{
// In most cases a new slide has just been inserted so start with
// the last page.
- sal_uInt16 nPageIndex (pDocument->GetSdPageCount(PK_STANDARD)-1);
+ sal_uInt32 nPageIndex (rDocument.GetSdPageCount(PK_STANDARD)-1);
bool bFound (false);
while ( ! bFound)
{
- pCandidate = pDocument->GetSdPage(
+ pCandidate = rDocument.GetSdPage(
nPageIndex,
PK_STANDARD);
if (pCandidate != NULL)
@@ -225,13 +222,11 @@ SdPage* DocumentHelper::AddMasterPage (
try
{
// Duplicate the master page.
- pClonedMasterPage = static_cast<SdPage*>(pMasterPage->Clone());
+ pClonedMasterPage = static_cast<SdPage*>(pMasterPage->CloneSdrPage(&rTargetDocument));
// Copy the necessary styles.
- SdDrawDocument* pSourceDocument
- = static_cast<SdDrawDocument*>(pMasterPage->GetModel());
- if (pSourceDocument != NULL)
- ProvideStyles (*pSourceDocument, rTargetDocument, pClonedMasterPage);
+ SdDrawDocument& rSourceDocument = static_cast< SdDrawDocument& >(pMasterPage->getSdrModelFromSdrPage());
+ ProvideStyles(rSourceDocument, rTargetDocument, pClonedMasterPage);
// Copy the precious flag.
pClonedMasterPage->SetPrecious(pMasterPage->IsPrecious());
@@ -293,7 +288,7 @@ void DocumentHelper::ProvideStyles (
new SdMoveStyleSheetsUndoAction (
&rTargetDocument,
aCreatedStyles,
- sal_True);
+ true);
pUndoManager->AddUndoAction (pMovStyles);
}
}
@@ -327,7 +322,7 @@ void DocumentHelper::AssignMasterPageToPageList (
::std::vector<SdPage*> aCleanedList;
for (iPage=rpPageList->begin(); iPage!=rpPageList->end(); ++iPage)
{
- OSL_ASSERT(*iPage!=NULL && (*iPage)->GetModel() == &rTargetDocument);
+ OSL_ASSERT(*iPage!=NULL && &(*iPage)->getSdrModelFromSdrPage() == &rTargetDocument);
if (*iPage != NULL
&& (*iPage)->GetLayoutName().CompareTo(sFullLayoutName)!=0)
{
@@ -375,17 +370,14 @@ SdPage* DocumentHelper::AddMasterPage (
if (pMasterPage!=NULL)
{
// Duplicate the master page.
- pClonedMasterPage = static_cast<SdPage*>(pMasterPage->Clone());
+ pClonedMasterPage = static_cast<SdPage*>(pMasterPage->CloneSdrPage(&rTargetDocument));
// Copy the precious flag.
pClonedMasterPage->SetPrecious(pMasterPage->IsPrecious());
// Copy the necessary styles.
- SdDrawDocument* pSourceDocument
- = static_cast<SdDrawDocument*>(pMasterPage->GetModel());
- if (pSourceDocument != NULL)
- {
- ProvideStyles (*pSourceDocument, rTargetDocument, pClonedMasterPage);
+ SdDrawDocument& rSourceDocument = static_cast< SdDrawDocument& >(pMasterPage->getSdrModelFromSdrPage());
+ ProvideStyles(rSourceDocument, rTargetDocument, pClonedMasterPage);
// Now that the styles are available we can insert the cloned
// master page.
@@ -393,16 +385,12 @@ SdPage* DocumentHelper::AddMasterPage (
// Adapt the size of the new master page to that of the pages in
// the document.
- Size aNewSize (rTargetDocument.GetSdPage(0, pMasterPage->GetPageKind())->GetSize());
- Rectangle aBorders (
- pClonedMasterPage->GetLftBorder(),
- pClonedMasterPage->GetUppBorder(),
- pClonedMasterPage->GetRgtBorder(),
- pClonedMasterPage->GetLwrBorder());
- pClonedMasterPage->ScaleObjects(aNewSize, aBorders, sal_True);
- pClonedMasterPage->SetSize(aNewSize);
- pClonedMasterPage->CreateTitleAndLayout(sal_True);
- }
+ const basegfx::B2DVector& rNewSize(rTargetDocument.GetSdPage(0, pMasterPage->GetPageKind())->GetPageScale());
+ pClonedMasterPage->ScaleObjects(rNewSize, pClonedMasterPage->GetLeftPageBorder(),
+ pClonedMasterPage->GetTopPageBorder(), pClonedMasterPage->GetRightPageBorder(),
+ pClonedMasterPage->GetBottomPageBorder(), true);
+ pClonedMasterPage->SetPageScale(rNewSize);
+ pClonedMasterPage->CreateTitleAndLayout(true);
}
return pClonedMasterPage;
@@ -432,36 +420,35 @@ void DocumentHelper::AssignMasterPageToPage (
// Leave early when the parameters are invalid.
if (pPage == NULL || pMasterPage == NULL)
return;
- SdDrawDocument* pDocument = dynamic_cast<SdDrawDocument*>(pPage->GetModel());
- if (pDocument == NULL)
- return;
+
+ SdDrawDocument& rDocument = dynamic_cast< SdDrawDocument& >(pPage->getSdrModelFromSdrPage());
if ( ! pPage->IsMasterPage())
{
// 1. Remove the background object (so that that, if it exists, does
// not override the new master page) and assign the master page to
// the regular slide.
- pDocument->GetDocSh()->GetUndoManager()->AddUndoAction(
+ rDocument.GetDocSh()->GetUndoManager()->AddUndoAction(
new SdBackgroundObjUndoAction(
- *pDocument, *pPage, pPage->getSdrPageProperties().GetItemSet()),
- sal_True);
+ rDocument, *pPage, pPage->getSdrPageProperties().GetItemSet()),
+ true);
pPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE));
- pDocument->SetMasterPage (
- (pPage->GetPageNum()-1)/2,
+ rDocument.SetMasterPage (
+ (pPage->GetPageNumber()-1)/2,
rsBaseLayoutName,
- pDocument,
- sal_False,
- sal_False);
+ &rDocument,
+ false,
+ false);
}
else
{
// Find first slide that uses the master page.
SdPage* pSlide = NULL;
- sal_uInt16 nPageCount = pDocument->GetSdPageCount(PK_STANDARD);
- for (sal_uInt16 nPage=0; nPage<nPageCount&&pSlide==NULL; nPage++)
+ sal_uInt32 nPageCount = rDocument.GetSdPageCount(PK_STANDARD);
+ for (sal_uInt32 nPage=0; nPage<nPageCount&&pSlide==NULL; nPage++)
{
- SdrPage* pCandidate = pDocument->GetSdPage(nPage,PK_STANDARD);
+ SdrPage* pCandidate = rDocument.GetSdPage(nPage,PK_STANDARD);
if (pCandidate != NULL
&& pCandidate->TRG_HasMasterPage()
&& &(pCandidate->TRG_GetMasterPage()) == pPage)
@@ -474,19 +461,19 @@ void DocumentHelper::AssignMasterPageToPage (
{
// 2. Assign the given master pages to the first slide that was
// found above that uses the master page.
- pDocument->SetMasterPage (
- (pSlide->GetPageNum()-1)/2,
+ rDocument.SetMasterPage (
+ (pSlide->GetPageNumber()-1)/2,
rsBaseLayoutName,
- pDocument,
- sal_False,
- sal_False);
+ &rDocument,
+ false,
+ false);
}
else
{
// 3. Replace the master page A by a copy of the given master
// page B.
- pDocument->RemoveUnnecessaryMasterPages (
- pPage, sal_False);
+ rDocument.RemoveUnnecessaryMasterPages (
+ pPage, false);
}
}
}
@@ -508,11 +495,10 @@ SdPage* DocumentHelper::ProvideMasterPage (
OSL_ASSERT(pMasterPage != NULL);
return NULL;
}
- SdDrawDocument* pSourceDocument = static_cast<SdDrawDocument*>(pMasterPage->GetModel());
- if (pSourceDocument == NULL)
- return NULL;
- SdPage* pNotesMasterPage = static_cast<SdPage*>(
- pSourceDocument->GetMasterPage(pMasterPage->GetPageNum()+1));
+
+ SdDrawDocument& rSourceDocument = static_cast< SdDrawDocument& >(pMasterPage->getSdrModelFromSdrPage());
+ SdPage* pNotesMasterPage = static_cast<SdPage*>(rSourceDocument.GetMasterPage(pMasterPage->GetPageNumber()+1));
+
if (pNotesMasterPage == NULL)
{
// The model is not in a valid state. Maybe a new master page
@@ -547,11 +533,11 @@ SdPage* DocumentHelper::ProvideMasterPage (
sal_uInt16 nInsertionIndex = rTargetDocument.GetMasterPageCount();
if (rpPageList->front()->IsMasterPage())
{
- nInsertionIndex = rpPageList->back()->GetPageNum();
+ nInsertionIndex = rpPageList->back()->GetPageNumber();
}
// Clone the master page.
- if (pMasterPage->GetModel() != &rTargetDocument)
+ if (&pMasterPage->getSdrModelFromSdrPage() != &rTargetDocument)
{
pMasterPageInDocument = AddMasterPage (rTargetDocument, pMasterPage, nInsertionIndex);
if( rTargetDocument.IsUndoEnabled() )
@@ -562,7 +548,7 @@ SdPage* DocumentHelper::ProvideMasterPage (
pMasterPageInDocument = pMasterPage;
// Clone the notes master.
- if (pNotesMasterPage->GetModel() != &rTargetDocument)
+ if (&pNotesMasterPage->getSdrModelFromSdrPage() != &rTargetDocument)
{
SdPage* pClonedNotesMasterPage
= AddMasterPage (rTargetDocument, pNotesMasterPage, nInsertionIndex+1);
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
index 1d5144336d5b..77da2e8979bd 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx
@@ -705,9 +705,9 @@ void MasterPageContainer::Implementation::UpdatePreviewSizePixel (void)
for (iDescriptor=maContainer.begin(); iDescriptor!=iContainerEnd; ++iDescriptor)
if (*iDescriptor!=NULL && (*iDescriptor)->mpMasterPage != NULL)
{
- Size aPageSize ((*iDescriptor)->mpMasterPage->GetSize());
- nWidth = aPageSize.Width();
- nHeight = aPageSize.Height();
+ const basegfx::B2DVector& rPageSize = (*iDescriptor)->mpMasterPage->GetPageScale();
+ nWidth = basegfx::fround(rPageSize.getX());
+ nHeight = basegfx::fround(rPageSize.getY());
mbFirstPageObjectSeen = true;
break;
}
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.hxx b/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.hxx
index 847eb49eb487..49da0148ced2 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.hxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainerFiller.hxx
@@ -62,8 +62,8 @@ public:
*/
virtual void RunNextStep (void);
- /** Return <TRUE/> when there is at least one more step to execute.
- When the task has been executed completely then <FALSE/> is
+ /** Return <true/> when there is at least one more step to execute.
+ When the task has been executed completely then <false/> is
returned.
*/
virtual bool HasNextStep (void);
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx
index 5ddf82d3884b..7e3512300149 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx
@@ -302,14 +302,14 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume
{
SfxApplication* pSfxApp = SFX_APP();
SfxItemSet* pSet = new SfxAllItemSet (pSfxApp->GetPool());
- pSet->Put (SfxBoolItem (SID_TEMPLATE, sal_True));
- pSet->Put (SfxBoolItem (SID_PREVIEW, sal_True));
- if (pSfxApp->LoadTemplate (mxDocumentShell, sFileName, sal_True, pSet))
+ pSet->Put (SfxBoolItem (SID_TEMPLATE, true));
+ pSet->Put (SfxBoolItem (SID_PREVIEW, true));
+ if (pSfxApp->LoadTemplate (mxDocumentShell, sFileName, true, pSet))
{
mxDocumentShell = NULL;
}
SfxObjectShell* pShell = mxDocumentShell;
- return PTR_CAST(::sd::DrawDocShell,pShell);
+ return dynamic_cast< ::sd::DrawDocShell* >(pShell);
}
@@ -350,8 +350,7 @@ SdPage* DefaultPageObjectProvider::operator () (SdDrawDocument* pContainerDocume
SdPage* pLocalMasterPage = NULL;
if (pContainerDocument != NULL)
{
- sal_Int32 nIndex (0);
- SdPage* pLocalSlide = pContainerDocument->GetSdPage((sal_uInt16)nIndex, PK_STANDARD);
+ SdPage* pLocalSlide = pContainerDocument->GetSdPage(0, PK_STANDARD);
if (pLocalSlide!=NULL && pLocalSlide->TRG_HasMasterPage())
pLocalMasterPage = dynamic_cast<SdPage*>(&pLocalSlide->TRG_GetMasterPage());
}
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.hxx b/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.hxx
index 7348da644644..4d2992315ed9 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.hxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.hxx
@@ -62,12 +62,12 @@ public:
*/
bool RequestPreview (const SharedMasterPageDescriptor& rDescriptor);
- /** Return <TRUE/> when there is a request currently in the queue for
+ /** Return <true/> when there is a request currently in the queue for
the given token.
*/
bool HasRequest (MasterPageContainer::Token aToken) const;
- /** Return <TRUE/> when there is at least one request in the queue.
+ /** Return <true/> when there is at least one request in the queue.
*/
bool IsEmpty (void) const;
diff --git a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx
index 49a761cd1ed4..a1eb96f46133 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx
@@ -78,7 +78,7 @@ public:
/** Use the PreviewProvider to get access to a preview of the master
page.
- Note that this is only done, when either bForce is <TRUE/> or
+ Note that this is only done, when either bForce is <true/> or
the PreviewProvider::GetCostIndex() returns 0.
The small preview is created by scaling the large one, not by
@@ -87,7 +87,7 @@ public:
It is the responsibility of the caller to call UpdatePageObject()
before calling this method when the PreviewProvider can only work
when the master page object is present, i.e. its NeedsPageObject()
- method returns <TRUE/>.
+ method returns <true/>.
@param nCostThreshold
When this is zero or positive then the preview is created only
@@ -101,7 +101,7 @@ public:
@param rRenderer
A PreviewRenderer object that may be used to create a preview.
@return
- When the previews are successfully provided then <TRUE/> is
+ When the previews are successfully provided then <true/> is
returned.
*/
bool UpdatePreview (
@@ -112,7 +112,7 @@ public:
/** Use the PageObjectProvider to get access to the master page object.
- Note that this is only done, when either bForce is <TRUE/> or the
+ Note that this is only done, when either bForce is <true/> or the
PreviewProvider::GetCostIndex() returns 0.
@param nCostThreshold
@@ -125,7 +125,7 @@ public:
a page object with or store one in.
@return
When the master page object is successfully provided then
- <TRUE/> is returned.
+ <true/> is returned.
*/
bool UpdatePageObject (
sal_Int32 nCostThreshold,
diff --git a/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx b/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx
index c2e40748fd46..4c4313836d82 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx
@@ -190,8 +190,8 @@ void MasterPageObserver::Implementation::RegisterDocument (
{
// Gather the names of all the master pages in the given document.
MasterPageContainer::data_type aMasterPageSet;
- sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD);
- for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++)
+ sal_uInt32 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD);
+ for (sal_uInt32 nIndex=0; nIndex<nMasterPageCount; nIndex++)
{
SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD);
if (pMasterPage != NULL)
@@ -290,28 +290,30 @@ void MasterPageObserver::Implementation::Notify(
SfxBroadcaster& rBroadcaster,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if (pSdrHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrHint->GetSdrHintKind())
{
case HINT_PAGEORDERCHG:
+ {
// Process the modified set of pages only when the number of
// standard and notes master pages are equal. This test
// filters out events that are sent in between the insertion
// of a new standard master page and a new notes master
// page.
- if (rBroadcaster.ISA(SdDrawDocument))
+ SdDrawDocument* pSdDrawDocument = dynamic_cast< SdDrawDocument* >(&rBroadcaster);
+
+ if (pSdDrawDocument)
{
- SdDrawDocument& rDocument (
- static_cast<SdDrawDocument&>(rBroadcaster));
- if (rDocument.GetMasterSdPageCount(PK_STANDARD)
- == rDocument.GetMasterSdPageCount(PK_NOTES))
+ if(pSdDrawDocument->GetMasterSdPageCount(PK_STANDARD) == pSdDrawDocument->GetMasterSdPageCount(PK_NOTES))
{
- AnalyzeUsedMasterPages (rDocument);
+ AnalyzeUsedMasterPages (*pSdDrawDocument);
}
}
break;
+ }
default:
break;
@@ -326,9 +328,9 @@ void MasterPageObserver::Implementation::AnalyzeUsedMasterPages (
SdDrawDocument& rDocument)
{
// Create a set of names of the master pages used by the given document.
- sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD);
+ sal_uInt32 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD);
::std::set<String> aCurrentMasterPages;
- for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++)
+ for (sal_uInt32 nIndex=0; nIndex<nMasterPageCount; nIndex++)
{
SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD);
if (pMasterPage != NULL)
diff --git a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
index 576284bf6a4a..55d4f4107f6c 100644
--- a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx
@@ -87,9 +87,6 @@ SFX_IMPL_INTERFACE(MasterPagesSelector, SfxShell,
SFX_POPUPMENU_REGISTRATION( SdResId(RID_TASKPANE_MASTERPAGESSELECTOR_POPUP) );
}
-TYPEINIT1(MasterPagesSelector, SfxShell);
-
-
MasterPagesSelector::MasterPagesSelector (
TreeNode* pParent,
@@ -109,7 +106,7 @@ MasterPagesSelector::MasterPagesSelector (
maTokenToValueSetIndex(),
maLockedMasterPages()
{
- SetPool (&rDocument.GetPool());
+ SetPool (&rDocument.GetItemPool());
mpPageSet->SetSelectHdl (
LINK(this, MasterPagesSelector, ClickHandler));
@@ -289,18 +286,20 @@ IMPL_LINK(MasterPagesSelector, ContextMenuCallback, CommandEvent*, pEvent)
// taken either from the mouse position (when the command was sent
// as reaction to a right click) or in the center of the selected
// item (when the command was sent as reaction to Shift+F10.)
- Point aPosition (pEvent->GetMousePosPixel());
+ Point aDiscretePos(pEvent->GetMousePosPixel());
+
if ( ! pEvent->IsMouseEvent())
{
- Rectangle aBBox (mpPageSet->GetItemRect(nIndex));
- aPosition = aBBox.Center();
+ const Rectangle aBBox(mpPageSet->GetItemRect(nIndex));
+
+ aDiscretePos = aBBox.Center();
}
const ResId aPopupResId (GetContextMenuResId());
mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
aPopupResId,
mpPageSet.get(),
- &aPosition);
+ &aDiscretePos);
}
return 0;
@@ -346,7 +345,7 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage)
if (pMasterPage == NULL)
break;
- sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD);
+ sal_uInt32 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD);
if (nPageCount == 0)
break;
@@ -356,7 +355,7 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage)
String sFullLayoutName (pMasterPage->GetLayoutName());
::sd::slidesorter::SharedPageSelection pPageList (
new ::sd::slidesorter::SlideSorterViewShell::PageSelection());
- for (sal_uInt16 nPageIndex=0; nPageIndex<nPageCount; nPageIndex++)
+ for (sal_uInt32 nPageIndex=0; nPageIndex<nPageCount; nPageIndex++)
{
SdPage* pPage = mrDocument.GetSdPage (nPageIndex, PK_STANDARD);
if (pPage != NULL
diff --git a/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx b/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx
index c7d4edf754f1..e9bcb681e6f6 100644
--- a/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx
+++ b/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx
@@ -60,7 +60,6 @@ class MasterPagesSelector
public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SD_IF_SDMASTERPAGESSELECTOR)
MasterPagesSelector (
diff --git a/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx
index 87cffd4bd33a..d42347ce757d 100644
--- a/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/RecentMasterPagesSelector.cxx
@@ -86,8 +86,8 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList)
{
// Create a set of names of the master pages used by the document.
MasterPageObserver::MasterPageNameSet aCurrentNames;
- sal_uInt16 nMasterPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD);
- sal_uInt16 nIndex;
+ sal_uInt32 nMasterPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD);
+ sal_uInt32 nIndex;
for (nIndex=0; nIndex<nMasterPageCount; nIndex++)
{
SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD);
@@ -98,7 +98,7 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList)
// Insert the recently used master pages that are currently not used.
RecentlyUsedMasterPages& rInstance (RecentlyUsedMasterPages::Instance());
- int nPageCount = rInstance.GetMasterPageCount();
+ sal_uInt32 nPageCount = rInstance.GetMasterPageCount();
for (nIndex=0; nIndex<nPageCount; nIndex++)
{
// Add an entry when a) the page is already known to the
diff --git a/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.hxx b/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.hxx
index 22439c1c45a5..62ebb699c905 100644
--- a/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.hxx
+++ b/sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages.hxx
@@ -95,9 +95,9 @@ private:
member of that list the associated descriptor is moved to the end of
the list to make it the most recently used entry.
@param bMakePersistent
- When <TRUE/> is given then the new list of recently used master
+ When <true/> is given then the new list of recently used master
pages is written back into the configuration to make it
- persistent. Giving <FALSE/> to ommit this is used while loading
+ persistent. Giving <false/> to ommit this is used while loading
the persistent list from the configuration.
*/
void AddMasterPage (
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index 048bf281d910..55ee2e367f7d 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -725,10 +725,11 @@ void EventMultiplexer::Implementation::Notify (
SfxBroadcaster&,
const SfxHint& rHint)
{
- if (rHint.ISA(SdrHint))
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if (pSdrHint)
{
- SdrHint& rSdrHint (*PTR_CAST(SdrHint,&rHint));
- switch (rSdrHint.GetKind())
+ switch (pSdrHint->GetSdrHintKind())
{
case HINT_MODELCLEARED:
case HINT_PAGEORDERCHG:
@@ -739,31 +740,37 @@ void EventMultiplexer::Implementation::Notify (
CallListeners (EventMultiplexerEvent::EID_CURRENT_PAGE);
break;
- case HINT_OBJCHG:
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
+ case HINT_OBJCHG_ATTR:
CallListeners(EventMultiplexerEvent::EID_SHAPE_CHANGED,
- const_cast<void*>(static_cast<const void*>(rSdrHint.GetPage())));
+ const_cast<void*>(static_cast<const void*>(pSdrHint->GetSdrHintPage())));
break;
case HINT_OBJINSERTED:
CallListeners(EventMultiplexerEvent::EID_SHAPE_INSERTED,
- const_cast<void*>(static_cast<const void*>(rSdrHint.GetPage())));
+ const_cast<void*>(static_cast<const void*>(pSdrHint->GetSdrHintPage())));
break;
case HINT_OBJREMOVED:
CallListeners(EventMultiplexerEvent::EID_SHAPE_REMOVED,
- const_cast<void*>(static_cast<const void*>(rSdrHint.GetPage())));
+ const_cast<void*>(static_cast<const void*>(pSdrHint->GetSdrHintPage())));
break;
default:
break;
}
}
- else if (rHint.ISA(SfxSimpleHint))
+ else
{
- SfxSimpleHint& rSimpleHint (*PTR_CAST(SfxSimpleHint, &rHint));
- if (rSimpleHint.GetId() == SFX_HINT_DYING)
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
+ {
+ if (SFX_HINT_DYING == pSfxSimpleHint->GetId() )
mpDocument = NULL;
}
}
+}
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index 2c85e5059d56..262d3904137c 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -114,12 +114,11 @@ Image PreviewRenderer::RenderPage (
{
if (pPage != NULL)
{
- const Size aPageModelSize (pPage->GetSize());
- const double nAspectRatio (
- double(aPageModelSize.Width()) / double(aPageModelSize.Height()));
+ const basegfx::B2DVector& aPageModelSize = pPage->GetPageScale();
+ const double fAspectRatio(aPageModelSize.getX() / aPageModelSize.getY());
const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0);
const sal_Int32 nHeight (sal::static_int_cast<sal_Int32>(
- (nWidth - 2*nFrameWidth) / nAspectRatio + 2*nFrameWidth + 0.5));
+ (nWidth - 2*nFrameWidth) / fAspectRatio + 2*nFrameWidth + 0.5));
return RenderPage (
pPage,
Size(nWidth,nHeight),
@@ -188,8 +187,8 @@ Image PreviewRenderer::RenderSubstitution (
const bool bUseContrast (
Application::GetSettings().GetStyleSettings().GetHighContrastMode());
mpPreviewDevice->SetDrawMode (bUseContrast
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR);
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR);
// Set a map mode that makes a typical substitution text completely
// visible.
@@ -207,12 +206,12 @@ Image PreviewRenderer::RenderSubstitution (
const Rectangle aPaintRectangle (
Point(0,0),
mpPreviewDevice->GetOutputSizePixel());
- mpPreviewDevice->EnableMapMode(sal_False);
+ mpPreviewDevice->EnableMapMode(false);
mpPreviewDevice->SetLineColor();
svtools::ColorConfig aColorConfig;
mpPreviewDevice->SetFillColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
mpPreviewDevice->DrawRect (aPaintRectangle);
- mpPreviewDevice->EnableMapMode(sal_True);
+ mpPreviewDevice->EnableMapMode(true);
// Paint substitution text and a frame around it.
PaintSubstitutionText (rSubstitutionText);
@@ -245,15 +244,9 @@ bool PreviewRenderer::Initialize (
if (pPage == NULL)
break;
- SdrModel* pModel = pPage->GetModel();
- if (pModel == NULL)
- break;
-
SetupOutputSize(*pPage, rPixelSize);
-
- SdDrawDocument* pDocument
- = static_cast<SdDrawDocument*>(pPage->GetModel());
- DrawDocShell* pDocShell = pDocument->GetDocSh();
+ SdDrawDocument& rDocument = static_cast< SdDrawDocument& >(pPage->getSdrModelFromSdrPage());
+ DrawDocShell* pDocShell = rDocument.GetDocSh();
// Create view
ProvideView (pDocShell);
@@ -264,19 +257,19 @@ bool PreviewRenderer::Initialize (
bool bUseContrast (bObeyHighContrastMode
&& Application::GetSettings().GetStyleSettings().GetHighContrastMode());
mpPreviewDevice->SetDrawMode (bUseContrast
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR);
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR);
mpPreviewDevice->SetSettings(Application::GetSettings());
// Tell the view to show the given page.
SdPage* pNonConstPage = const_cast<SdPage*>(pPage);
if (pPage->IsMasterPage())
{
- mpView->ShowSdrPage(mpView->GetModel()->GetMasterPage(pPage->GetPageNum()));
+ mpView->ShowSdrPage(*mpView->getSdrModelFromSdrView().GetMasterPage(pPage->GetPageNumber()));
}
else
{
- mpView->ShowSdrPage(pNonConstPage);
+ mpView->ShowSdrPage(*pNonConstPage);
}
// Make sure that a page view exists.
@@ -303,9 +296,9 @@ bool PreviewRenderer::Initialize (
}
pPageView->SetApplicationDocumentColor(aApplicationDocumentColor);
- SdrOutliner& rOutliner(pDocument->GetDrawOutliner(NULL));
+ SdrOutliner& rOutliner(rDocument.GetDrawOutliner(NULL));
rOutliner.SetBackgroundColor(aApplicationDocumentColor);
- rOutliner.SetDefaultLanguage(pDocument->GetLanguage(EE_CHAR_LANGUAGE));
+ rOutliner.SetDefaultLanguage(rDocument.GetLanguage(EE_CHAR_LANGUAGE));
mpPreviewDevice->SetBackground(Wallpaper(aApplicationDocumentColor));
mpPreviewDevice->Erase();
@@ -332,8 +325,8 @@ void PreviewRenderer::PaintPage (
const bool bDisplayPresentationObjects)
{
// Paint the page.
- Rectangle aPaintRectangle (Point(0,0), pPage->GetSize());
- Region aRegion (aPaintRectangle);
+ const Rectangle aPaintRectangle(0, 0, basegfx::fround(pPage->GetPageScale().getX()), basegfx::fround(pPage->GetPageScale().getY()));
+ const Region aRegion (aPaintRectangle);
// Turn off online spelling and redlining.
SdrOutliner* pOutliner = NULL;
@@ -406,11 +399,11 @@ void PreviewRenderer::PaintFrame (void)
Rectangle aPaintRectangle (
Point(0,0),
mpPreviewDevice->GetOutputSizePixel());
- mpPreviewDevice->EnableMapMode(sal_False);
+ mpPreviewDevice->EnableMapMode(false);
mpPreviewDevice->SetLineColor(maFrameColor);
mpPreviewDevice->SetFillColor();
mpPreviewDevice->DrawRect(aPaintRectangle);
- mpPreviewDevice->EnableMapMode(sal_True);
+ mpPreviewDevice->EnableMapMode(true);
}
}
@@ -427,7 +420,7 @@ void PreviewRenderer::SetupOutputSize (
aMapMode.SetMapUnit(MAP_PIXEL);
// Adapt it to the desired width.
- const Size aPageModelSize (rPage.GetSize());
+ const Size aPageModelSize(basegfx::fround(rPage.GetPageScale().getX()), basegfx::fround(rPage.GetPageScale().getY()));
if (aPageModelSize.Width()>0 || aPageModelSize.Height()>0)
{
const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0);
@@ -498,8 +491,8 @@ Image PreviewRenderer::ScaleBitmap (
bool bUseContrast = Application::GetSettings().GetStyleSettings().
GetHighContrastMode();
mpPreviewDevice->SetDrawMode (bUseContrast
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR);
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR);
// Set output size.
Size aSize (rBitmapEx.GetSizePixel());
@@ -543,12 +536,11 @@ Image PreviewRenderer::ScaleBitmap (
void PreviewRenderer::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
- if (rHint.IsA(TYPE(SfxSimpleHint))
- && mpDocShellOfView != NULL)
+ if(mpDocShellOfView)
{
- const SfxSimpleHint* pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
- if (pSimpleHint != NULL
- && pSimpleHint->GetId() == SFX_HINT_DYING)
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSimpleHint && SFX_HINT_DYING == pSimpleHint->GetId())
{
// The doc shell is dying. Our view uses its item pool and
// has to be destroyed as well. The next call to
@@ -586,8 +578,9 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
const sdr::contact::DisplayInfo& rDisplayInfo)
{
SdrObject* pObject = rOriginal.GetViewContact().TryToGetSdrObject();
+ SdrPage* pOwningPage = pObject ? pObject->getSdrPageFromSdrObject() : 0;
- if (pObject==NULL || pObject->GetPage() == NULL)
+ if(!pObject || !pOwningPage)
{
// not a SdrObject visualisation (maybe e.g. page) or no page
return sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
@@ -595,10 +588,10 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
rDisplayInfo);
}
- const bool bDoCreateGeometry (pObject->GetPage()->checkVisibility( rOriginal, rDisplayInfo, true));
+ const bool bDoCreateGeometry(pOwningPage->checkVisibility( rOriginal, rDisplayInfo, true));
if ( ! bDoCreateGeometry
- && (pObject->GetObjInventor() != SdrInventor || pObject->GetObjIdentifier() != OBJ_PAGE))
+ && (SdrInventor != pObject->GetObjInventor() || OBJ_PAGE != pObject->GetObjIdentifier()))
{
return drawinglayer::primitive2d::Primitive2DSequence();
}
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index c6dccaa3e250..297684961d2f 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -138,8 +138,8 @@ Reference<drawing::XLayer> SdUnoDrawView::getActiveLayer (void) throw ()
break;
// From the model get the current SdrLayer object via the layer admin.
- SdrLayerAdmin& rLayerAdmin = pSdModel->GetLayerAdmin ();
- SdrLayer* pLayer = rLayerAdmin.GetLayer (mrView.GetActiveLayer(), sal_True);
+ SdrLayerAdmin& rLayerAdmin = pSdModel->GetModelLayerAdmin();
+ SdrLayer* pLayer = rLayerAdmin.GetLayer (mrView.GetActiveLayer(), true);
if (pLayer == NULL)
break;
@@ -192,7 +192,7 @@ sal_Bool SAL_CALL SdUnoDrawView::select( const Any& aSelection )
{
bool bOk = true;
- ::std::vector<SdrObject*> aObjects;
+ SdrObjectVector aObjects;
SdrPage* pSdrPage = NULL;
@@ -205,7 +205,7 @@ sal_Bool SAL_CALL SdUnoDrawView::select( const Any& aSelection )
if( pShape && (pShape->GetSdrObject() != NULL) )
{
SdrObject* pObj = pShape->GetSdrObject();
- pSdrPage = pObj->GetPage();
+ pSdrPage = pObj->getSdrPageFromSdrObject();
aObjects.push_back( pObj );
}
else
@@ -236,9 +236,9 @@ sal_Bool SAL_CALL SdUnoDrawView::select( const Any& aSelection )
if( pSdrPage == NULL )
{
- pSdrPage = pObj->GetPage();
+ pSdrPage = pObj->getSdrPageFromSdrObject();
}
- else if( pSdrPage != pObj->GetPage() )
+ else if( pSdrPage != pObj->getSdrPageFromSdrObject() )
{
bOk = false;
break;
@@ -255,28 +255,19 @@ sal_Bool SAL_CALL SdUnoDrawView::select( const Any& aSelection )
if( pSdrPage )
{
setMasterPageMode( pSdrPage->IsMasterPage() );
- mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNum() - 1) >> 1 );
+ mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNumber() - 1) >> 1 );
mrDrawViewShell.WriteFrameViewData();
}
- SdrPageView *pPV = mrView.GetSdrPageView();
-
- if(pPV)
- {
// first deselect all
- mrView.UnmarkAllObj( pPV );
+ mrView.UnmarkAllObj();
- ::std::vector<SdrObject*>::iterator aIter( aObjects.begin() );
- const ::std::vector<SdrObject*>::iterator aEnd( aObjects.end() );
+ SdrObjectVector::iterator aIter( aObjects.begin() );
+ const SdrObjectVector::iterator aEnd( aObjects.end() );
while( aIter != aEnd )
{
SdrObject* pObj = (*aIter++);
- mrView.MarkObj( pObj, pPV );
- }
- }
- else
- {
- bOk = false;
+ mrView.MarkObj( *pObj );
}
}
@@ -296,29 +287,27 @@ Any SAL_CALL SdUnoDrawView::getSelection()
if( !aAny.hasValue() )
{
- const SdrMarkList& rMarkList = mrView.GetMarkedObjectList();
- sal_uInt32 nCount = rMarkList.GetMarkCount();
- if( nCount )
+ const SdrObjectVector aSelection(mrView.getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if( aSelection.size() )
{
Reference< drawing::XShapes > xShapes( SvxShapeCollection_NewInstance(), UNO_QUERY );
- for( sal_uInt32 nNum = 0; nNum < nCount; nNum++)
+
+ for( sal_uInt32 nNum(0); nNum < aSelection.size(); nNum++)
{
- SdrMark *pMark = rMarkList.GetMark(nNum);
- if(pMark==NULL)
- continue;
+ SdrObject* pObj = aSelection[nNum];
- SdrObject *pObj = pMark->GetMarkedSdrObj();
- if(pObj==NULL || pObj->GetPage() == NULL)
+ if(!pObj->getSdrPageFromSdrObject())
continue;
- Reference< drawing::XDrawPage > xPage( pObj->GetPage()->getUnoPage(), UNO_QUERY);
+ Reference< drawing::XDrawPage > xPage( pObj->getSdrPageFromSdrObject()->getUnoPage(), UNO_QUERY);
if(!xPage.is())
continue;
SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
- if(pDrawPage==NULL)
+ if(!pDrawPage)
continue;
Reference< drawing::XShape > xShape( pObj->getUnoShape(), UNO_QUERY );
@@ -492,7 +481,7 @@ void SAL_CALL SdUnoDrawView::setCurrentPage (
mrDrawViewShell.GetView()->SdrEndTextEdit();
setMasterPageMode( pSdrPage->IsMasterPage() );
- mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNum() - 1) >> 1 );
+ mrDrawViewShell.SwitchPage( (pSdrPage->GetPageNumber() - 1) >> 1 );
mrDrawViewShell.WriteFrameViewData();
}
}
@@ -505,7 +494,7 @@ Reference< drawing::XDrawPage > SAL_CALL SdUnoDrawView::getCurrentPage()
Reference< drawing::XDrawPage > xPage;
SdrPageView *pPV = mrView.GetSdrPageView();
- SdrPage* pPage = pPV ? pPV->GetPage() : NULL;
+ SdrPage* pPage = pPV ? &pPV->getSdrPageFromSdrPageView() : NULL;
if(pPage)
xPage = Reference< drawing::XDrawPage >::query( pPage->getUnoPage() );
@@ -544,19 +533,19 @@ void SdUnoDrawView::SetZoom( sal_Int16 nZoom )
void SdUnoDrawView::SetViewOffset(const awt::Point& rWinPos )
{
- Point aWinPos( rWinPos.X, rWinPos.Y );
+ basegfx::B2DPoint aWinPos( rWinPos.X, rWinPos.Y );
aWinPos += mrDrawViewShell.GetViewOrigin();
mrDrawViewShell.SetWinViewPos( aWinPos, true );
}
awt::Point SdUnoDrawView::GetViewOffset() const
{
- Point aRet;
+ basegfx::B2DPoint aRet;
aRet = mrDrawViewShell.GetWinViewPos();
aRet -= mrDrawViewShell.GetViewOrigin();
- return awt::Point( aRet.X(), aRet.Y() );
+ return awt::Point( basegfx::fround(aRet.getX()), basegfx::fround(aRet.getY()) );
}
void SdUnoDrawView::SetZoomType ( sal_Int16 nType )
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 1c14255c2362..bc0667944c2c 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -248,11 +248,11 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
SdOptionsPrintItem aOptionsPrintItem( ATTR_OPTIONS_PRINT );
- SfxPrinter* pPrinter = pDocSh->GetPrinter( sal_False );
+ SfxPrinter* pPrinter = pDocSh->GetPrinter( false );
if( pPrinter )
{
SdOptionsPrintItem* pPrinterOptions = NULL;
- if(pPrinter->GetOptions().GetItemState( ATTR_OPTIONS_PRINT, sal_False, (const SfxPoolItem**) &pPrinterOptions) == SFX_ITEM_SET)
+ if(pPrinter->GetOptions().GetItemState( ATTR_OPTIONS_PRINT, false, (const SfxPoolItem**) &pPrinterOptions) == SFX_ITEM_SET)
aOptionsPrintItem.GetOptionsPrint() = pPrinterOptions->GetOptionsPrint();
}
else
@@ -278,7 +278,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- XColorTable* pColTab = new XColorTable( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() );
+ XColorTable* pColTab = new XColorTable( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetItemPool() );
pColTab->SetName( aURL.getName() );
if( pColTab->Load() )
{
@@ -300,7 +300,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- XDashList* pDashTab = new XDashList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() );
+ XDashList* pDashTab = new XDashList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetItemPool() );
pDashTab->SetName( aURL.getName() );
if( pDashTab->Load() )
{
@@ -322,7 +322,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- XLineEndList* pTab = new XLineEndList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() );
+ XLineEndList* pTab = new XLineEndList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetItemPool() );
pTab->SetName( aURL.getName() );
if( pTab->Load() )
{
@@ -344,7 +344,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- XHatchList* pTab = new XHatchList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() );
+ XHatchList* pTab = new XHatchList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetItemPool() );
pTab->SetName( aURL.getName() );
if( pTab->Load() )
{
@@ -366,7 +366,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- XGradientList* pTab = new XGradientList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() );
+ XGradientList* pTab = new XGradientList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetItemPool() );
pTab->SetName( aURL.getName() );
if( pTab->Load() )
{
@@ -388,7 +388,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- XBitmapList* pTab = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() );
+ XBitmapList* pTab = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetItemPool() );
pTab->SetName( aURL.getName() );
if( pTab->Load() )
{
@@ -418,7 +418,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTDRAWING:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsDraw() != bValue )
+ if( aPrintOpts.IsDraw() != (bool)bValue )
{
aPrintOpts.SetDraw( bValue );
bOptionsChanged = true;
@@ -430,7 +430,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTNOTES:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsNotes() != bValue )
+ if( aPrintOpts.IsNotes() != (bool)bValue )
{
aPrintOpts.SetNotes( bValue );
bOptionsChanged = true;
@@ -442,7 +442,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTHANDOUT:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsHandout() != bValue)
+ if( aPrintOpts.IsHandout() != (bool)bValue)
{
aPrintOpts.SetHandout( bValue );
bOptionsChanged = true;
@@ -454,7 +454,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTOUTLINE:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsOutline() != bValue)
+ if( aPrintOpts.IsOutline() != (bool)bValue)
{
aPrintOpts.SetOutline( bValue );
bOptionsChanged = true;
@@ -479,7 +479,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_HANDOUTHORIZONTAL:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsHandoutHorizontal() != bValue )
+ if( aPrintOpts.IsHandoutHorizontal() != (bool)bValue )
{
aPrintOpts.SetHandoutHorizontal( bValue );
bOptionsChanged = true;
@@ -491,7 +491,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTPAGENAME:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsPagename() != bValue)
+ if( aPrintOpts.IsPagename() != (bool)bValue)
{
aPrintOpts.SetPagename( bValue );
bOptionsChanged = true;
@@ -502,7 +502,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTDATE:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsDate() != bValue)
+ if( aPrintOpts.IsDate() != (bool)bValue)
{
aPrintOpts.SetDate( bValue );
bOptionsChanged = true;
@@ -513,7 +513,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTTIME:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsDate() != bValue)
+ if( aPrintOpts.IsDate() != (bool)bValue)
{
aPrintOpts.SetTime( bValue );
bOptionsChanged = true;
@@ -524,7 +524,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTHIDENPAGES:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsHiddenPages() != bValue)
+ if( aPrintOpts.IsHiddenPages() != (bool)bValue)
{
aPrintOpts.SetHiddenPages( bValue );
bOptionsChanged = true;
@@ -535,7 +535,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTFITPAGE:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsPagesize() != bValue)
+ if( aPrintOpts.IsPagesize() != (bool)bValue)
{
aPrintOpts.SetPagesize( bValue );
bOptionsChanged = true;
@@ -546,7 +546,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTTILEPAGE:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsPagetile() != bValue)
+ if( aPrintOpts.IsPagetile() != (bool)bValue)
{
aPrintOpts.SetPagetile( bValue );
bOptionsChanged = true;
@@ -557,7 +557,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTBOOKLET:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsBooklet() != bValue)
+ if( aPrintOpts.IsBooklet() != (bool)bValue)
{
aPrintOpts.SetBooklet( bValue );
bOptionsChanged = true;
@@ -568,7 +568,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTBOOKLETFRONT:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsFrontPage() != bValue)
+ if( aPrintOpts.IsFrontPage() != (bool)bValue)
{
aPrintOpts.SetFrontPage( bValue );
bOptionsChanged = true;
@@ -579,7 +579,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
case HANDLE_PRINTBOOKLETBACK:
if( *pValues >>= bValue )
{
- if( aPrintOpts.IsBackPage() != bValue)
+ if( aPrintOpts.IsBackPage() != (bool)bValue)
{
aPrintOpts.SetBackPage( bValue );
bOptionsChanged = true;
@@ -699,7 +699,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
}
else
{
- pItemSet = new SfxItemSet(pDoc->GetPool(),
+ pItemSet = new SfxItemSet(pDoc->GetItemPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
@@ -734,16 +734,16 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
pDoc->SetSummationOfParagraphs( bIsSummationOfParagraphs );
SdDrawDocument* pDocument = pDocSh->GetDoc();
- SdrOutliner& rOutl = pDocument->GetDrawOutliner( sal_False );
+ SdrOutliner& rOutl = pDocument->GetDrawOutliner( false );
nCntrl = rOutl.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
rOutl.SetControlWord( nCntrl | nSum );
- ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False );
+ ::sd::Outliner* pOutl = pDocument->GetOutliner( false );
if( pOutl )
{
nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
pOutl->SetControlWord( nCntrl | nSum );
}
- pOutl = pDocument->GetInternalOutliner( sal_False );
+ pOutl = pDocument->GetInternalOutliner( false );
if( pOutl )
{
nCntrl = pOutl->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION;
@@ -763,14 +763,14 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
pDoc->SetCharCompressType( (sal_uInt16)nCharCompressType );
SdDrawDocument* pDocument = pDocSh->GetDoc();
- SdrOutliner& rOutl = pDocument->GetDrawOutliner( sal_False );
+ SdrOutliner& rOutl = pDocument->GetDrawOutliner( false );
rOutl.SetAsianCompressionMode( (sal_uInt16)nCharCompressType );
- ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False );
+ ::sd::Outliner* pOutl = pDocument->GetOutliner( false );
if( pOutl )
{
pOutl->SetAsianCompressionMode( (sal_uInt16)nCharCompressType );
}
- pOutl = pDocument->GetInternalOutliner( sal_False );
+ pOutl = pDocument->GetInternalOutliner( false );
if( pOutl )
{
pOutl->SetAsianCompressionMode( (sal_uInt16)nCharCompressType );
@@ -788,14 +788,14 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
pDoc->SetKernAsianPunctuation( bAsianPunct );
SdDrawDocument* pDocument = pDocSh->GetDoc();
- SdrOutliner& rOutl = pDocument->GetDrawOutliner( sal_False );
+ SdrOutliner& rOutl = pDocument->GetDrawOutliner( false );
rOutl.SetKernAsianPunctuation( bAsianPunct );
- ::sd::Outliner* pOutl = pDocument->GetOutliner( sal_False );
+ ::sd::Outliner* pOutl = pDocument->GetOutliner( false );
if( pOutl )
{
pOutl->SetKernAsianPunctuation( bAsianPunct );
}
- pOutl = pDocument->GetInternalOutliner( sal_False );
+ pOutl = pDocument->GetInternalOutliner( false );
if( pOutl )
{
pOutl->SetKernAsianPunctuation( bAsianPunct );
@@ -870,7 +870,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c
if( bOptionsChanged )
{
if( !pPrinter )
- pPrinter = pDocSh->GetPrinter( sal_True );
+ pPrinter = pDocSh->GetPrinter( true );
SfxItemSet aNewOptions( pPrinter->GetOptions() );
aNewOptions.Put( aOptionsPrintItem );
pPrinter->SetOptions( aNewOptions );
@@ -891,11 +891,11 @@ void DocumentSettings::_getPropertyValues( const PropertyMapEntry** ppEntries, A
SdOptionsPrintItem aOptionsPrintItem( ATTR_OPTIONS_PRINT );
- SfxPrinter* pPrinter = pDocSh->GetPrinter( sal_False );
+ SfxPrinter* pPrinter = pDocSh->GetPrinter( false );
if( pPrinter )
{
SdOptionsPrintItem* pPrinterOptions = NULL;
- if(pPrinter->GetOptions().GetItemState( ATTR_OPTIONS_PRINT, sal_False, (const SfxPoolItem**) &pPrinterOptions) == SFX_ITEM_SET)
+ if(pPrinter->GetOptions().GetItemState( ATTR_OPTIONS_PRINT, false, (const SfxPoolItem**) &pPrinterOptions) == SFX_ITEM_SET)
aOptionsPrintItem.GetOptionsPrint() = pPrinterOptions->GetOptionsPrint();
}
else
diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index 5aa8a71c93b0..372da91088e8 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -176,7 +176,7 @@ SdFilterDetect::~SdFilterDetect()
SfxApplication* pApp = SFX_APP();
SfxAllItemSet *pSet = new SfxAllItemSet( pApp->GetPool() );
TransformParameters( SID_OPENDOC, lDescriptor, *pSet );
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY );
bWasReadOnly = pItem && pItem->GetValue();
@@ -204,8 +204,8 @@ SdFilterDetect::~SdFilterDetect()
else
{
// ctor of SfxMedium uses owner transition of ItemSet
- SfxMedium aMedium( aURL, bWasReadOnly ? STREAM_STD_READ : STREAM_STD_READWRITE, sal_False, NULL, pSet );
- aMedium.UseInteractionHandler( sal_True );
+ SfxMedium aMedium( aURL, bWasReadOnly ? STREAM_STD_READ : STREAM_STD_READWRITE, false, NULL, pSet );
+ aMedium.UseInteractionHandler( true );
if ( aPreselectedFilterName.Len() )
pFilter = SfxFilter::GetFilterByName( aPreselectedFilterName );
else if( aTypeName.Len() )
@@ -221,7 +221,7 @@ SdFilterDetect::~SdFilterDetect()
xStream = aMedium.GetInputStream();
xContent = aMedium.GetContent();
bReadOnly = aMedium.IsReadOnly();
- sal_Bool bIsStorage = aMedium.IsStorage();
+ bool bIsStorage = aMedium.IsStorage();
if (aMedium.GetError() == SVSTREAM_OK)
{
@@ -269,7 +269,7 @@ SdFilterDetect::~SdFilterDetect()
String sFilterName;
if ( pFilter )
sFilterName = pFilter->GetName();
- aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pFilter ? pFilter->IsOwnTemplateFormat() : sal_False, &sFilterName );
+ aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pFilter ? pFilter->IsOwnTemplateFormat() : false, &sFilterName );
}
catch( lang::WrappedTargetException& aWrap )
{
@@ -337,7 +337,7 @@ SdFilterDetect::~SdFilterDetect()
}
else
{
- SotStorageRef aStorage = new SotStorage ( pStm, sal_False );
+ SotStorageRef aStorage = new SotStorage ( pStm, false );
if ( !aStorage->GetError() )
{
String aStreamName = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "PowerPoint Document" ) );
@@ -360,7 +360,7 @@ SdFilterDetect::~SdFilterDetect()
const String aFileName( aMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) );
GraphicDescriptor aDesc( *pStm, &aFileName );
GraphicFilter* pGrfFilter = GraphicFilter::GetGraphicFilter();
- if( !aDesc.Detect( sal_False ) )
+ if( !aDesc.Detect( false ) )
{
pFilter = 0;
if( SvtModuleOptions().IsImpress() )
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx
index b5c6146c3b39..4281323d2038 100644
--- a/sd/source/ui/unoidl/unocpres.cxx
+++ b/sd/source/ui/unoidl/unocpres.cxx
@@ -111,7 +111,7 @@ void SAL_CALL SdXCustomPresentation::insertByIndex( sal_Int32 Index, const uno::
if(pPage)
{
- if( NULL == mpModel )
+ if( !mpModel )
mpModel = pPage->GetModel();
if( NULL != mpModel && NULL == mpSdCustomShow && mpModel->GetDoc() )
diff --git a/sd/source/ui/unoidl/unocpres.hxx b/sd/source/ui/unoidl/unocpres.hxx
index e1b4238648b9..de57109b1170 100644
--- a/sd/source/ui/unoidl/unocpres.hxx
+++ b/sd/source/ui/unoidl/unocpres.hxx
@@ -54,7 +54,7 @@ private:
// for xComponent
::osl::Mutex aDisposeContainerMutex;
::cppu::OInterfaceContainerHelper aDisposeListeners;
- sal_Bool bDisposing;
+ bool bDisposing;
public:
SdXCustomPresentation() throw();
diff --git a/sd/source/ui/unoidl/unodoc.cxx b/sd/source/ui/unoidl/unodoc.cxx
index 8a11416f16ad..63bdbaeff2f8 100644
--- a/sd/source/ui/unoidl/unodoc.cxx
+++ b/sd/source/ui/unoidl/unodoc.cxx
@@ -64,7 +64,7 @@ uno::Reference< uno::XInterface > SAL_CALL SdDrawingDocument_createInstance(
SfxObjectShell* pShell =
new ::sd::GraphicDocShell(
- _nCreationFlags, sal_False, DOCUMENT_TYPE_DRAW );
+ _nCreationFlags, false, DOCUMENT_TYPE_DRAW );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
@@ -93,7 +93,7 @@ uno::Reference< uno::XInterface > SAL_CALL SdPresentationDocument_createInstance
SfxObjectShell* pShell =
new ::sd::DrawDocShell(
- _nCreationFlags, sal_False, DOCUMENT_TYPE_IMPRESS );
+ _nCreationFlags, false, DOCUMENT_TYPE_IMPRESS );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index 80c8a659d3dd..8ece62f438dc 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -60,6 +60,7 @@
#include "unokywds.hxx"
#include "unowcntr.hxx"
#include <vcl/svapp.hxx>
+#include <svx/globaldrawitempool.hxx>
using namespace ::rtl;
using namespace ::vos;
@@ -88,7 +89,7 @@ const SvxItemPropertySet* ImplGetSdLayerPropertySet()
{ MAP_CHAR_LEN("Description"), WID_LAYER_DESC, &::getCppuType((const OUString*)0), 0, 0 },
{ 0,0,0,0,0,0}
};
- static SvxItemPropertySet aSDLayerPropertySet_Impl( aSdLayerPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aSDLayerPropertySet_Impl( aSdLayerPropertyMap_Impl, GetGlobalDrawObjectItemPool() );
return &aSDLayerPropertySet_Impl;
}
@@ -541,7 +542,7 @@ uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::insertNewByIndex( sal
if( mpModel->mpDoc )
{
- SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin();
sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount();
sal_uInt16 nLayer = nLayerCnt - 2 + 1;
String aLayerName;
@@ -554,7 +555,7 @@ uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::insertNewByIndex( sal
nLayer++;
}
- SdrLayerAdmin& rLA=mpModel->mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLA=mpModel->mpDoc->GetModelLayerAdmin();
const sal_Int32 nMax=rLA.GetLayerCount();
if (nIndex>nMax) nIndex=nMax;
xLayer = GetLayer (rLA.NewLayer(aLayerName,(sal_uInt16)nIndex));
@@ -622,7 +623,7 @@ uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::getLayerForShape( con
if(pObj)
{
SdrLayerID aId = pObj->GetLayer();
- SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin();
xLayer = GetLayer (rLayerAdmin.GetLayerPerID(aId));
}
}
@@ -640,7 +641,7 @@ sal_Int32 SAL_CALL SdLayerManager::getCount()
if( mpModel->mpDoc )
{
- SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin();
return rLayerAdmin.GetLayerCount();
}
@@ -662,7 +663,7 @@ uno::Any SAL_CALL SdLayerManager::getByIndex( sal_Int32 nLayer )
if( mpModel->mpDoc )
{
- SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin();
uno::Reference<drawing::XLayer> xLayer (GetLayer (rLayerAdmin.GetLayer((sal_uInt16)nLayer)));
aAny <<= xLayer;
}
@@ -679,8 +680,8 @@ uno::Any SAL_CALL SdLayerManager::getByName( const OUString& aName )
if( (mpModel == 0) || (mpModel->mpDoc == 0 ) )
throw lang::DisposedException();
- SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
- SdrLayer* pLayer = rLayerAdmin.GetLayer( SdLayer::convertToInternalName( aName ), sal_False );
+ SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin();
+ SdrLayer* pLayer = rLayerAdmin.GetLayer( SdLayer::convertToInternalName( aName ), false );
if( pLayer == NULL )
throw container::NoSuchElementException();
@@ -695,7 +696,7 @@ uno::Sequence< OUString > SAL_CALL SdLayerManager::getElementNames()
if( mpModel == 0 )
throw lang::DisposedException();
- SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin();
const sal_uInt16 nLayerCount = rLayerAdmin.GetLayerCount();
uno::Sequence< OUString > aSeq( nLayerCount );
@@ -720,9 +721,9 @@ sal_Bool SAL_CALL SdLayerManager::hasByName( const OUString& aName ) throw(uno::
if( mpModel == 0 )
throw lang::DisposedException();
- SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin();
- return NULL != rLayerAdmin.GetLayer( SdLayer::convertToInternalName( aName ), sal_False );
+ return NULL != rLayerAdmin.GetLayer( SdLayer::convertToInternalName( aName ), false );
}
// XElementAccess
@@ -743,8 +744,7 @@ void SdLayerManager::UpdateLayerView( sal_Bool modify ) const throw()
{
if(mpModel->mpDocShell)
{
- ::sd::DrawViewShell* pDrViewSh =
- PTR_CAST(::sd::DrawViewShell, mpModel->mpDocShell->GetViewShell());
+ ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >(mpModel->mpDocShell->GetViewShell());
if(pDrViewSh)
{
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index db264f6e0ba5..1cc316d65deb 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -109,10 +109,10 @@
#include <com/sun/star/geometry/RealPoint2D.hpp>
#include <com/sun/star/util/DateTime.hpp>
-using ::rtl::OUString;
-
#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
+#include <svx/globaldrawitempool.hxx>
+using ::rtl::OUString;
using namespace ::osl;
using namespace ::vos;
using namespace ::cppu;
@@ -158,11 +158,11 @@ SdUnoForbiddenCharsTable::~SdUnoForbiddenCharsTable()
void SdUnoForbiddenCharsTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
if( pSdrHint )
{
- if( HINT_MODELCLEARED == pSdrHint->GetKind() )
+ if( HINT_MODELCLEARED == pSdrHint->GetSdrHintKind() )
{
mpModel = NULL;
}
@@ -203,7 +203,7 @@ const SvxItemPropertySet* ImplGetDrawModelPropertySet()
{ MAP_CHAR_LEN(sUNO_Prop_HasValidSignatures), WID_MODEL_HASVALIDSIGNATURES, &::getCppuType(static_cast< const sal_Bool * >(0)), beans::PropertyAttribute::READONLY, 0 },
{ 0,0,0,0,0,0 }
};
- static SvxItemPropertySet aDrawModelPropertySet_Impl( aDrawModelPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aDrawModelPropertySet_Impl( aDrawModelPropertyMap_Impl, GetGlobalDrawObjectItemPool() );
return &aDrawModelPropertySet_Impl;
}
@@ -445,7 +445,7 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if( mpDoc )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
if( pSdrHint )
{
@@ -456,7 +456,7 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
notifyEvent( aEvent );
}
- if( pSdrHint->GetKind() == HINT_MODELCLEARED )
+ if( pSdrHint->GetSdrHintKind() == HINT_MODELCLEARED )
{
if( mpDoc )
EndListening( *mpDoc );
@@ -466,7 +466,7 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
- const SfxSimpleHint* pSfxHint = PTR_CAST(SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSfxHint = dynamic_cast< const SfxSimpleHint* >(&rHint );
// ist unser SdDrawDocument gerade gestorben?
if(pSfxHint && pSfxHint->GetId() == SFX_HINT_DYING)
@@ -493,12 +493,12 @@ void SdXImpressDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
/******************************************************************************
* *
******************************************************************************/
-SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate ) throw()
+SdPage* SdXImpressDocument::InsertSdPage( sal_uInt32 nPage, sal_Bool bDuplicate ) throw()
{
- sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
- SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ sal_uInt32 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD );
+ SdrLayerAdmin& rLayerAdmin = mpDoc->GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SdPage* pStandardPage = NULL;
@@ -507,14 +507,14 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate
// this is only used for clipboard where we only have one page
pStandardPage = (SdPage*) mpDoc->AllocPage(sal_False);
- Size aDefSize(21000, 29700); // A4-Hochformat
- pStandardPage->SetSize( aDefSize );
+ basegfx::B2DVector aDefSize(21000.0, 29700.0); // A4-Hochformat
+ pStandardPage->SetPageScale( aDefSize );
mpDoc->InsertPage(pStandardPage, 0);
}
else
{
// Hier wird die Seite ermittelt, hinter der eingefuegt werden soll
- SdPage* pPreviousStandardPage = mpDoc->GetSdPage( Min( (sal_uInt16)(nPageCount - 1), nPage ), PK_STANDARD );
+ SdPage* pPreviousStandardPage = mpDoc->GetSdPage( Min( (nPageCount - 1), nPage ), PK_STANDARD );
SetOfByte aVisibleLayers = pPreviousStandardPage->TRG_GetMasterPageVisibleLayers();
sal_Bool bIsPageBack = aVisibleLayers.IsSet( aBckgrnd );
sal_Bool bIsPageObj = aVisibleLayers.IsSet( aBckgrndObj );
@@ -528,9 +528,9 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate
* Standardseite stets die zugehoerige Notizseite folgt.
**************************************************************/
- sal_uInt16 nStandardPageNum = pPreviousStandardPage->GetPageNum() + 2;
+ sal_uInt32 nStandardPageNum = pPreviousStandardPage->GetPageNumber() + 2;
SdPage* pPreviousNotesPage = (SdPage*) mpDoc->GetPage( nStandardPageNum - 1 );
- sal_uInt16 nNotesPageNum = nStandardPageNum + 1;
+ sal_uInt32 nNotesPageNum = nStandardPageNum + 1;
String aStandardPageName;
String aNotesPageName;
@@ -538,15 +538,15 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate
* Standardseite
**************************************************************/
if( bDuplicate )
- pStandardPage = (SdPage*) pPreviousStandardPage->Clone();
+ pStandardPage = (SdPage*) pPreviousStandardPage->CloneSdrPage();
else
pStandardPage = (SdPage*) mpDoc->AllocPage(sal_False);
- pStandardPage->SetSize( pPreviousStandardPage->GetSize() );
- pStandardPage->SetBorder( pPreviousStandardPage->GetLftBorder(),
- pPreviousStandardPage->GetUppBorder(),
- pPreviousStandardPage->GetRgtBorder(),
- pPreviousStandardPage->GetLwrBorder() );
+ pStandardPage->SetPageScale( pPreviousStandardPage->GetPageScale() );
+ pStandardPage->SetPageBorder( pPreviousStandardPage->GetLeftPageBorder(),
+ pPreviousStandardPage->GetTopPageBorder(),
+ pPreviousStandardPage->GetRightPageBorder(),
+ pPreviousStandardPage->GetBottomPageBorder() );
pStandardPage->SetOrientation( pPreviousStandardPage->GetOrientation() );
pStandardPage->SetName(aStandardPageName);
@@ -573,15 +573,15 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate
SdPage* pNotesPage = NULL;
if( bDuplicate )
- pNotesPage = (SdPage*) pPreviousNotesPage->Clone();
+ pNotesPage = (SdPage*) pPreviousNotesPage->CloneSdrPage();
else
pNotesPage = (SdPage*) mpDoc->AllocPage(sal_False);
- pNotesPage->SetSize( pPreviousNotesPage->GetSize() );
- pNotesPage->SetBorder( pPreviousNotesPage->GetLftBorder(),
- pPreviousNotesPage->GetUppBorder(),
- pPreviousNotesPage->GetRgtBorder(),
- pPreviousNotesPage->GetLwrBorder() );
+ pNotesPage->SetPageScale( pPreviousNotesPage->GetPageScale() );
+ pNotesPage->SetPageBorder( pPreviousNotesPage->GetLeftPageBorder(),
+ pPreviousNotesPage->GetTopPageBorder(),
+ pPreviousNotesPage->GetRightPageBorder(),
+ pPreviousNotesPage->GetBottomPageBorder() );
pNotesPage->SetOrientation( pPreviousNotesPage->GetOrientation() );
pNotesPage->SetName(aNotesPageName);
pNotesPage->SetPageKind(PK_NOTES);
@@ -731,7 +731,7 @@ void SAL_CALL SdXImpressDocument::setViewData( const uno::Reference < container:
{
if( xData->getByIndex( nIndex ) >>= aSeq )
{
- pFrameView = new ::sd::FrameView( mpDoc );
+ pFrameView = new ::sd::FrameView( *mpDoc );
pFrameView->ReadUserDataSequence( aSeq );
pFrameViewList->Insert( pFrameView );
}
@@ -754,7 +754,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::duplicate( con
if( pSvxPage )
{
SdPage* pPage = (SdPage*) pSvxPage->GetSdrPage();
- sal_uInt16 nPos = pPage->GetPageNum();
+ sal_uInt32 nPos = pPage->GetPageNumber();
nPos = ( nPos - 1 ) / 2;
pPage = InsertSdPage( nPos, sal_True );
if( pPage )
@@ -1037,76 +1037,76 @@ uno::Reference< uno::XInterface > SAL_CALL SdXImpressDocument::createInstance( c
if( aType.EqualsAscii( "com.sun.star.presentation.", 0, 26 ) )
{
SvxShape* pShape = NULL;
+ SvxShapeKind aSvxShapeKind(SvxShapeKind_Text);
- sal_uInt16 nType = OBJ_TEXT;
// create a shape wrapper
if( aType.EqualsAscii( "TitleTextShape", 26, 14 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "OutlinerShape", 26, 13 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "SubtitleShape", 26, 13 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "GraphicObjectShape", 26, 18 ) )
{
- nType = OBJ_GRAF;
+ aSvxShapeKind = SvxShapeKind_Graphic;
}
else if( aType.EqualsAscii( "PageShape", 26, 9 ) )
{
- nType = OBJ_PAGE;
+ aSvxShapeKind = SvxShapeKind_Page;
}
else if( aType.EqualsAscii( "OLE2Shape", 26, 9 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "ChartShape", 26, 10 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "CalcShape", 26, 9 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "TableShape", 26, 10 ) )
{
- nType = OBJ_TABLE;
+ aSvxShapeKind = SvxShapeKind_Table;
}
else if( aType.EqualsAscii( "OrgChartShape", 26, 13 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "NotesShape", 26, 13 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "HandoutShape", 26, 13 ) )
{
- nType = OBJ_PAGE;
+ aSvxShapeKind = SvxShapeKind_Page;
}
else if( aType.EqualsAscii( "FooterShape", 26, 12 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "HeaderShape", 26, 12 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "SlideNumberShape", 26, 17 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "DateTimeShape", 26, 17 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "MediaShape", 26, 10 ) )
{
- nType = OBJ_MEDIA;
+ aSvxShapeKind = SvxShapeKind_Media;
}
else
{
@@ -1114,19 +1114,24 @@ uno::Reference< uno::XInterface > SAL_CALL SdXImpressDocument::createInstance( c
}
// create the API wrapper
- pShape = CreateSvxShapeByTypeAndInventor( nType, SdrInventor );
+ pShape = SvxDrawPage::CreateShapeBySvxShapeKind(aSvxShapeKind);
// set shape type
if( pShape && !mbClipBoard )
+ {
pShape->SetShapeType(aServiceSpecifier);
+ }
xRet = (uno::XWeak*)pShape;
}
else if( aServiceSpecifier.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape") ) )
{
- SvxShape* pShape = CreateSvxShapeByTypeAndInventor( OBJ_TABLE, SdrInventor );
+ SvxShape* pShape = SvxDrawPage::CreateShapeBySvxShapeKind(SvxShapeKind_Table);
+
if( pShape && !mbClipBoard )
+ {
pShape->SetShapeType(aServiceSpecifier);
+ }
xRet = (uno::XWeak*)pShape;
}
@@ -1514,8 +1519,8 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SdXImpressDocument::getRenderer(
awt::Size aPageSize;
if ( bExportNotesPages )
{
- Size aNotesPageSize = mpDoc->GetSdPage( 0, PK_NOTES )->GetSize();
- aPageSize = awt::Size( aNotesPageSize.Width(), aNotesPageSize.Height() );
+ const basegfx::B2DVector& rNotesPageScale = mpDoc->GetSdPage( 0, PK_NOTES )->GetPageScale();
+ aPageSize = awt::Size(basegfx::fround(rNotesPageScale.getX()), basegfx::fround(rNotesPageScale.getY()));
}
else
{
@@ -1577,8 +1582,8 @@ sal_Int32 ImplPDFGetBookmarkPage( const String& rBookmark, SdDrawDocument& rDoc
aBookmark = rBookmark.Copy( 1 );
// is the bookmark a page ?
- sal_Bool bIsMasterPage;
- sal_uInt16 nPgNum = rDoc.GetPageByName( aBookmark, bIsMasterPage );
+ bool bIsMasterPage;
+ sal_uInt32 nPgNum = rDoc.GetPageByName( aBookmark, bIsMasterPage );
SdrObject* pObj = NULL;
if ( nPgNum == SDRPAGE_NOTFOUND )
@@ -1586,7 +1591,14 @@ sal_Int32 ImplPDFGetBookmarkPage( const String& rBookmark, SdDrawDocument& rDoc
// is the bookmark a object ?
pObj = rDoc.GetObj( aBookmark );
if (pObj)
- nPgNum = pObj->GetPage()->GetPageNum();
+ {
+ SdrPage* pOwningPage = pObj->getSdrPageFromSdrObject();
+
+ if(pOwningPage)
+ {
+ nPgNum = pOwningPage->GetPageNumber();
+ }
+ }
}
if ( nPgNum != SDRPAGE_NOTFOUND )
nPage = ( nPgNum - 1 ) / 2;
@@ -1654,13 +1666,11 @@ void ImplPDFExportShapeInteraction( uno::Reference< drawing::XShape > xShape, Sd
uno::Reference< beans::XPropertySet > xShapePropSet( xShape, uno::UNO_QUERY );
if( xShapePropSet.is() )
{
- Size aPageSize( rDoc.GetSdPage( 0, PK_STANDARD )->GetSize() );
- Point aPoint( 0, 0 );
- Rectangle aPageRect( aPoint, aPageSize );
-
- awt::Point aShapePos( xShape->getPosition() );
- awt::Size aShapeSize( xShape->getSize() );
- Rectangle aLinkRect( Point( aShapePos.X, aShapePos.Y ), Size( aShapeSize.Width, aShapeSize.Height ) );
+ const basegfx::B2DVector& rPageSize = rDoc.GetSdPage( 0, PK_STANDARD )->GetPageScale();
+ const Rectangle aPageRect(0, 0, basegfx::fround(rPageSize.getX()), basegfx::fround(rPageSize.getY()));
+ const awt::Point aShapePos( xShape->getPosition() );
+ const awt::Size aShapeSize( xShape->getSize() );
+ const Rectangle aLinkRect( Point( aShapePos.X, aShapePos.Y ), Size( aShapeSize.Width, aShapeSize.Height ) );
presentation::ClickAction eCa;
uno::Any aAny( xShapePropSet->getPropertyValue( sOnClick ) );
@@ -1762,7 +1772,7 @@ vcl::PDFWriter::StructElement ImplRenderPaintProc::ImplBegStructureTag( SdrObjec
{
sal_uInt32 nInventor = rObject.GetObjInventor();
sal_uInt16 nIdentifier = rObject.GetObjIdentifier();
- sal_Bool bIsTextObj = rObject.ISA( SdrTextObj );
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(&rObject);
if ( nInventor == SdrInventor )
{
@@ -1772,7 +1782,7 @@ vcl::PDFWriter::StructElement ImplRenderPaintProc::ImplBegStructureTag( SdrObjec
eElement = vcl::PDFWriter::Heading;
else if ( nIdentifier == OBJ_OUTLINETEXT )
eElement = vcl::PDFWriter::Division;
- else if ( !bIsTextObj || !((SdrTextObj&)rObject).HasText() )
+ else if ( !pSdrTextObj || !pSdrTextObj->HasText() )
eElement = vcl::PDFWriter::Figure;
}
}
@@ -1790,9 +1800,9 @@ drawinglayer::primitive2d::Primitive2DSequence ImplRenderPaintProc::createRedire
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- if(pObject->GetPage())
+ if(pObject->getSdrPageFromSdrObject())
{
- if(pObject->GetPage()->checkVisibility(rOriginal, rDisplayInfo, false))
+ if(pObject->getSdrPageFromSdrObject()->checkVisibility(rOriginal, rDisplayInfo, false))
{
if(IsVisible(pObject) && IsPrintable(pObject))
{
@@ -1880,17 +1890,17 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
}
}
- if( xRenderDevice.is() && nPageNumber && ( nPageNumber <= mpDoc->GetSdPageCount( ePageKind ) ) )
+ if( xRenderDevice.is() && nPageNumber && ( nPageNumber <= (sal_Int32)mpDoc->GetSdPageCount( ePageKind ) ) )
{
VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice );
OutputDevice* pOut = pDevice ? pDevice->GetOutputDevice() : NULL;
if( pOut )
{
- vcl::PDFExtOutDevData* pPDFExtOutDevData = PTR_CAST( vcl::PDFExtOutDevData, pOut->GetExtOutDevData() );
-
+ vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >(pOut->GetExtOutDevData() );
::sd::ClientView* pView = new ::sd::ClientView( mpDocShell, pOut, NULL );
- Rectangle aVisArea = Rectangle( Point(), mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1, ePageKind )->GetSize() );
+ const basegfx::B2DVector& rPageScale = mpDoc->GetSdPage( nPageNumber - 1, ePageKind )->GetPageScale();
+ const Rectangle aVisArea(0, 0, basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY()));
Region aRegion( aVisArea );
Point aOrigin;
@@ -1916,7 +1926,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
if( xModel == mpDocShell->GetModel() )
{
- pView->ShowSdrPage( mpDoc->GetSdPage( (sal_uInt16)nPageNumber - 1, ePageKind ));
+ pView->ShowSdrPage( *mpDoc->GetSdPage( nPageNumber - 1, ePageKind ));
SdrPageView* pPV = pView->GetSdrPageView();
if( pOldSdView )
@@ -1929,13 +1939,11 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
}
}
- ImplRenderPaintProc aImplRenderPaintProc( mpDoc->GetLayerAdmin(),
+ ImplRenderPaintProc aImplRenderPaintProc( mpDoc->GetModelLayerAdmin(),
pPV, pPDFExtOutDevData );
// background color for outliner :o
- SdPage* pPage = (SdPage*)pPV->GetPage();
- if( pPage )
- {
+ SdPage& rPage = (SdPage&)pPV->getSdrPageFromSdrPageView();
SdrOutliner& rOutl = mpDoc->GetDrawOutliner( NULL );
bool bScreenDisplay(true);
@@ -1955,8 +1963,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
// #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and
// hint value if screen display. Only then the AutoColor mechanisms shall be applied
- rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor( pPV, bScreenDisplay ) );
- }
+ rOutl.SetBackgroundColor( rPage.GetPageBackgroundColor( pPV, bScreenDisplay ) );
pView->SdrPaintView::CompleteRedraw( pOut, aRegion, &aImplRenderPaintProc );
if ( pPDFExtOutDevData )
@@ -1964,7 +1971,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
try
{
uno::Any aAny;
- uno::Reference< drawing::XDrawPage > xPage( uno::Reference< drawing::XDrawPage >::query( pPage->getUnoPage() ) );
+ uno::Reference< drawing::XDrawPage > xPage( uno::Reference< drawing::XDrawPage >::query( rPage.getUnoPage() ) );
if ( xPage.is() )
{
if ( pPDFExtOutDevData->GetIsExportNotes() )
@@ -2095,9 +2102,9 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
}
}
}
- Size aPageSize( mpDoc->GetSdPage( 0, PK_STANDARD )->GetSize() );
- Point aPoint( 0, 0 );
- Rectangle aPageRect( aPoint, aPageSize );
+
+ const basegfx::B2DVector& rPageScale1 = mpDoc->GetSdPage( 0, PK_STANDARD )->GetPageScale();
+ const Rectangle aPageRect(0, 0, basegfx::fround(rPageScale1.getX()), basegfx::fround(rPageScale1.getY()));
// resolving links found in this page by the method ImpEditEngine::Paint
std::vector< vcl::PDFExtOutDevBookmarkEntry >& rBookmarks = pPDFExtOutDevData->GetBookmarks();
@@ -2155,9 +2162,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
if( xShapes.is() && xShapes->getCount() )
{
- SdrPageView* pPV = NULL;
-
- ImplRenderPaintProc aImplRenderPaintProc( mpDoc->GetLayerAdmin(),
+ ImplRenderPaintProc aImplRenderPaintProc( mpDoc->GetModelLayerAdmin(),
pOldSdView ? pOldSdView->GetSdrPageView() : NULL, pPDFExtOutDevData );
for( sal_uInt32 i = 0, nCount = xShapes->getCount(); i < nCount; i++ )
@@ -2172,15 +2177,16 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
if( pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
- if( pObj && pObj->GetPage()
+ if( pObj && pObj->getSdrPageFromSdrObject()
&& aImplRenderPaintProc.IsVisible( pObj )
&& aImplRenderPaintProc.IsPrintable( pObj ) )
{
- if( !pPV )
- pPV = pView->ShowSdrPage( pObj->GetPage() );
+ if( !pView->GetSdrPageView() )
+ {
+ pView->ShowSdrPage( *pObj->getSdrPageFromSdrObject() );
+ }
- if( pPV )
- pView->MarkObj( pObj, pPV );
+ pView->MarkObj( *pObj );
}
}
}
@@ -2227,6 +2233,11 @@ void SdXImpressDocument::initializeDocument()
}
}
+SdrModel* SdXImpressDocument::getSdrModel() const
+{
+ return GetDoc();
+}
+
void SAL_CALL SdXImpressDocument::dispose() throw (::com::sun::star::uno::RuntimeException)
{
if( !mbDisposed )
@@ -2364,10 +2375,10 @@ uno::Any SAL_CALL SdDrawPagesAccess::getByIndex( sal_Int32 Index )
uno::Any aAny;
- if( (Index < 0) || (Index >= mpModel->mpDoc->GetSdPageCount( PK_STANDARD ) ) )
+ if( (Index < 0) || (Index >= (sal_Int32)mpModel->mpDoc->GetSdPageCount( PK_STANDARD ) ) )
throw lang::IndexOutOfBoundsException();
- SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)Index, PK_STANDARD );
+ SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt32)Index, PK_STANDARD );
if( pPage )
{
uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY );
@@ -2387,8 +2398,8 @@ uno::Any SAL_CALL SdDrawPagesAccess::getByName( const OUString& aName ) throw(co
if( aName.getLength() != 0 )
{
- const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD );
- sal_uInt16 nPage;
+ const sal_uInt32 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD );
+ sal_uInt32 nPage;
for( nPage = 0; nPage < nCount; nPage++ )
{
SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PK_STANDARD );
@@ -2415,11 +2426,11 @@ uno::Sequence< OUString > SAL_CALL SdDrawPagesAccess::getElementNames() throw(un
if( NULL == mpModel )
throw lang::DisposedException();
- const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD );
+ const sal_uInt32 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD );
uno::Sequence< OUString > aNames( nCount );
OUString* pNames = aNames.getArray();
- sal_uInt16 nPage;
+ sal_uInt32 nPage;
for( nPage = 0; nPage < nCount; nPage++ )
{
SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PK_STANDARD );
@@ -2436,8 +2447,8 @@ sal_Bool SAL_CALL SdDrawPagesAccess::hasByName( const OUString& aName ) throw(un
if( NULL == mpModel )
throw lang::DisposedException();
- const sal_uInt16 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD );
- sal_uInt16 nPage;
+ const sal_uInt32 nCount = mpModel->mpDoc->GetSdPageCount( PK_STANDARD );
+ sal_uInt32 nPage;
for( nPage = 0; nPage < nCount; nPage++ )
{
SdPage* pPage = mpModel->mpDoc->GetSdPage( nPage, PK_STANDARD );
@@ -2480,7 +2491,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdDrawPagesAccess::insertNewByInde
if( mpModel->mpDoc )
{
- SdPage* pPage = mpModel->InsertSdPage( (sal_uInt16)nIndex );
+ SdPage* pPage = mpModel->InsertSdPage( (sal_uInt32)nIndex );
if( pPage )
{
uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY );
@@ -2516,7 +2527,7 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag
SdPage* pPage = (SdPage*) pSvxPage->GetSdrPage();
if(pPage && ( pPage->GetPageKind() == PK_STANDARD ) )
{
- sal_uInt16 nPage = pPage->GetPageNum();
+ sal_uInt32 nPage = pPage->GetPageNumber();
SdPage* pNotesPage = static_cast< SdPage* >( rDoc.GetPage( nPage+1 ) );
@@ -2640,10 +2651,10 @@ uno::Any SAL_CALL SdMasterPagesAccess::getByIndex( sal_Int32 Index )
uno::Any aAny;
- if( (Index < 0) || (Index >= mpModel->mpDoc->GetMasterSdPageCount( PK_STANDARD ) ) )
+ if( (Index < 0) || (Index >= (sal_Int32)mpModel->mpDoc->GetMasterSdPageCount( PK_STANDARD ) ) )
throw lang::IndexOutOfBoundsException();
- SdPage* pPage = mpModel->mpDoc->GetMasterSdPage( (sal_uInt16)Index, PK_STANDARD );
+ SdPage* pPage = mpModel->mpDoc->GetMasterSdPage( (sal_uInt32)Index, PK_STANDARD );
if( pPage )
{
uno::Reference< drawing::XDrawPage > xDrawPage( pPage->getUnoPage(), uno::UNO_QUERY );
@@ -2723,18 +2734,18 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn
((SdStyleSheetPool*)mpDoc->GetStyleSheetPool())->CreateLayoutStyleSheets( aPrefix );
// get the first page for initial size and border settings
- SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PK_STANDARD );
- SdPage* pRefNotesPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PK_NOTES);
+ SdPage* pPage = mpModel->mpDoc->GetSdPage( 0, PK_STANDARD );
+ SdPage* pRefNotesPage = mpModel->mpDoc->GetSdPage( 0, PK_NOTES);
// create and instert new draw masterpage
SdPage* pMPage = (SdPage*)mpModel->mpDoc->AllocPage(sal_True);
- pMPage->SetSize( pPage->GetSize() );
- pMPage->SetBorder( pPage->GetLftBorder(),
- pPage->GetUppBorder(),
- pPage->GetRgtBorder(),
- pPage->GetLwrBorder() );
+ pMPage->SetPageScale( pPage->GetPageScale() );
+ pMPage->SetPageBorder( pPage->GetLeftPageBorder(),
+ pPage->GetTopPageBorder(),
+ pPage->GetRightPageBorder(),
+ pPage->GetBottomPageBorder() );
pMPage->SetLayoutName( aLayoutName );
- mpDoc->InsertMasterPage(pMPage, (sal_uInt16)nInsertPos);
+ mpDoc->InsertMasterPage(pMPage, nInsertPos);
{
// ensure default MasterPage fill
@@ -2745,15 +2756,15 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn
// create and instert new notes masterpage
SdPage* pMNotesPage = (SdPage*)mpModel->mpDoc->AllocPage(sal_True);
- pMNotesPage->SetSize( pRefNotesPage->GetSize() );
+ pMNotesPage->SetPageScale( pRefNotesPage->GetPageScale() );
pMNotesPage->SetPageKind(PK_NOTES);
- pMNotesPage->SetBorder( pRefNotesPage->GetLftBorder(),
- pRefNotesPage->GetUppBorder(),
- pRefNotesPage->GetRgtBorder(),
- pRefNotesPage->GetLwrBorder() );
+ pMNotesPage->SetPageBorder( pRefNotesPage->GetLeftPageBorder(),
+ pRefNotesPage->GetTopPageBorder(),
+ pRefNotesPage->GetRightPageBorder(),
+ pRefNotesPage->GetBottomPageBorder() );
pMNotesPage->SetLayoutName( aLayoutName );
- mpDoc->InsertMasterPage(pMNotesPage, (sal_uInt16)nInsertPos + 1);
-// pMNotesPage->InsertMasterPage( pMPage->GetPageNum() );
+ mpDoc->InsertMasterPage(pMNotesPage, nInsertPos + 1);
+// pMNotesPage->InsertMasterPage( pMPage->GetPageNumber() );
pMNotesPage->SetAutoLayout(AUTOLAYOUT_NOTES, sal_True, sal_True);
mpModel->SetModified();
}
@@ -2790,7 +2801,7 @@ void SAL_CALL SdMasterPagesAccess::remove( const uno::Reference< drawing::XDrawP
// only standard pages can be removed directly
if( pPage->GetPageKind() == PK_STANDARD )
{
- sal_uInt16 nPage = pPage->GetPageNum();
+ sal_uInt32 nPage = pPage->GetPageNumber();
SdPage* pNotesPage = static_cast< SdPage* >( rDoc.GetMasterPage( nPage+1 ) );
@@ -2908,13 +2919,13 @@ uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getElementNames()
if( mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW )
{
- const sal_uInt16 nMaxPages = mpDoc->GetSdPageCount( PK_STANDARD );
- const sal_uInt16 nMaxMasterPages = mpDoc->GetMasterSdPageCount( PK_STANDARD );
+ const sal_uInt32 nMaxPages = mpDoc->GetSdPageCount( PK_STANDARD );
+ const sal_uInt32 nMaxMasterPages = mpDoc->GetMasterSdPageCount( PK_STANDARD );
uno::Sequence< OUString > aSeq( nMaxPages + nMaxMasterPages );
OUString* pStr = aSeq.getArray();
- sal_uInt16 nPage;
+ sal_uInt32 nPage;
// standard pages
for( nPage = 0; nPage < nMaxPages; nPage++ )
*pStr++ = mpDoc->GetSdPage( nPage, PK_STANDARD )->GetName();
@@ -2926,13 +2937,13 @@ uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getElementNames()
}
else
{
- const sal_uInt16 nMaxPages = mpDoc->GetPageCount();
- const sal_uInt16 nMaxMasterPages = mpDoc->GetMasterPageCount();
+ const sal_uInt32 nMaxPages = mpDoc->GetPageCount();
+ const sal_uInt32 nMaxMasterPages = mpDoc->GetMasterPageCount();
uno::Sequence< OUString > aSeq( nMaxPages + nMaxMasterPages );
OUString* pStr = aSeq.getArray();
- sal_uInt16 nPage;
+ sal_uInt32 nPage;
// standard pages
for( nPage = 0; nPage < nMaxPages; nPage++ )
*pStr++ = ((SdPage*)mpDoc->GetPage( nPage ))->GetName();
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 358f0adee0e4..44e118d24462 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -78,6 +78,7 @@
#include "unolayer.hxx"
#include "imapinfo.hxx"
#include "EffectMigration.hxx"
+#include <svx/globaldrawitempool.hxx>
#ifndef SEQTYPE
#if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)
@@ -109,7 +110,7 @@ DECLARE_STL_STDKEY_MAP(sal_uIntPtr, SfxExtItemPropertySetInfo*, SdExtPropertySet
static SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
static SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache;
-DECLARE_STL_STDKEY_MAP(sal_uInt32, uno::Sequence< uno::Type >*, SdTypesCache);
+DECLARE_STL_STDKEY_MAP(SvxShapeKind, uno::Sequence< uno::Type >*, SdTypesCache);
static SdTypesCache gImplTypesCache;
///////////////////////////////////////////////////////////////////////
@@ -144,141 +145,141 @@ static SdTypesCache gImplTypesCache;
- #define IMPRESS_MAP_ENTRIES \
- { MAP_CHAR_LEN(UNO_NAME_OBJ_ANIMATIONPATH), WID_ANIMPATH, &ITYPE(drawing::XShape), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMCOLOR), WID_DIMCOLOR, &::getCppuType((const sal_Int32*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMHIDE), WID_DIMHIDE, &::getBooleanCppuType(), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMPREV), WID_DIMPREV, &::getBooleanCppuType(), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_EFFECT), WID_EFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_ISEMPTYPRESOBJ),WID_ISEMPTYPRESOBJ, &::getBooleanCppuType(), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_ISPRESOBJ), WID_ISPRESOBJ, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_MASTERDEPENDENT),WID_MASTERDEPEND, &::getBooleanCppuType(), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_PLAYFULL), WID_PLAYFULL, &::getBooleanCppuType(), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_PRESORDER), WID_PRESORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE( style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDFILE), WID_SOUNDFILE, &::getCppuType((const OUString*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDON), WID_SOUNDON, &::getBooleanCppuType(), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_SPEED), WID_SPEED, &::getCppuType((const presentation::AnimationSpeed*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_TEXTEFFECT), WID_TEXTEFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_BLUESCREEN), WID_BLUESCREEN, &::getCppuType((const sal_Int32*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_VERB), WID_VERB, &::getCppuType((const sal_Int32*)0), 0, 0},\
- { MAP_CHAR_LEN("IsAnimation"), WID_ISANIMATION, &::getBooleanCppuType(), 0, 0},\
- { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\
- { 0,0,0,0,0,0}
-
+#define IMPRESS_MAP_ENTRIES \
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_ANIMATIONPATH), WID_ANIMPATH, &ITYPE(drawing::XShape), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMCOLOR), WID_DIMCOLOR, &::getCppuType((const sal_Int32*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMHIDE), WID_DIMHIDE, &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_DIMPREV), WID_DIMPREV, &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_EFFECT), WID_EFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_ISEMPTYPRESOBJ),WID_ISEMPTYPRESOBJ, &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_ISPRESOBJ), WID_ISPRESOBJ, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_MASTERDEPENDENT),WID_MASTERDEPEND, &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_PLAYFULL), WID_PLAYFULL, &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_PRESORDER), WID_PRESORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE( style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDFILE), WID_SOUNDFILE, &::getCppuType((const OUString*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_SOUNDON), WID_SOUNDON, &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_SPEED), WID_SPEED, &::getCppuType((const presentation::AnimationSpeed*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_TEXTEFFECT), WID_TEXTEFFECT, &::getCppuType((const presentation::AnimationEffect*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_BLUESCREEN), WID_BLUESCREEN, &::getCppuType((const sal_Int32*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_VERB), WID_VERB, &::getCppuType((const sal_Int32*)0), 0, 0},\
+ { MAP_CHAR_LEN("IsAnimation"), WID_ISANIMATION, &::getBooleanCppuType(), 0, 0},\
+ { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\
+ { 0,0,0,0,0,0}
+
+
+const SfxItemPropertyMapEntry* lcl_GetImpress_SdXShapePropertyGraphicMap_Impl()
+{
- const SfxItemPropertyMapEntry* lcl_GetImpress_SdXShapePropertyGraphicMap_Impl()
+ static const SfxItemPropertyMapEntry aImpress_SdXShapePropertyGraphicMap_Impl[] =
{
+ { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &::getCppuType((const uno::Reference< container::XIndexContainer >*)0), 0, 0 },
+ IMPRESS_MAP_ENTRIES
+ };
+ return aImpress_SdXShapePropertyGraphicMap_Impl;
+}
- static const SfxItemPropertyMapEntry aImpress_SdXShapePropertyGraphicMap_Impl[] =
- {
- { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &::getCppuType((const uno::Reference< container::XIndexContainer >*)0), 0, 0 },
- IMPRESS_MAP_ENTRIES
- };
- return aImpress_SdXShapePropertyGraphicMap_Impl;
- }
+const SfxItemPropertyMapEntry* lcl_GetImpress_SdXShapePropertySimpleMap_Impl()
+{
- const SfxItemPropertyMapEntry* lcl_GetImpress_SdXShapePropertySimpleMap_Impl()
+ static const SfxItemPropertyMapEntry aImpress_SdXShapePropertySimpleMap_Impl[] =
{
+ IMPRESS_MAP_ENTRIES
+ };
+ return aImpress_SdXShapePropertySimpleMap_Impl;
+}
- static const SfxItemPropertyMapEntry aImpress_SdXShapePropertySimpleMap_Impl[] =
- {
- IMPRESS_MAP_ENTRIES
- };
- return aImpress_SdXShapePropertySimpleMap_Impl;
- }
-
- #define DRAW_MAP_ENTRIES\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0),0, 0},\
- { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE(style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},\
- { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\
- { 0,0,0,0,0,0}
+#define DRAW_MAP_ENTRIES\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_BOOKMARK), WID_BOOKMARK, &::getCppuType((const OUString*)0), 0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_CLICKACTION), WID_CLICKACTION, &::getCppuType((const presentation::ClickAction*)0),0, 0},\
+ { MAP_CHAR_LEN(UNO_NAME_OBJ_STYLE), WID_STYLE, &ITYPE(style::XStyle), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},\
+ { MAP_CHAR_LEN("NavigationOrder"), WID_NAVORDER, &::getCppuType((const sal_Int32*)0), 0, 0},\
+ { 0,0,0,0,0,0}
- const SfxItemPropertyMapEntry* lcl_GetDraw_SdXShapePropertySimpleMap_Impl()
+const SfxItemPropertyMapEntry* lcl_GetDraw_SdXShapePropertySimpleMap_Impl()
+{
+ static const SfxItemPropertyMapEntry aDraw_SdXShapePropertyMap_Impl[] =
{
- static const SfxItemPropertyMapEntry aDraw_SdXShapePropertyMap_Impl[] =
- {
- DRAW_MAP_ENTRIES
- };
- return aDraw_SdXShapePropertyMap_Impl;
+ DRAW_MAP_ENTRIES
+ };
+ return aDraw_SdXShapePropertyMap_Impl;
+}
+const SfxItemPropertyMapEntry* lcl_GetDraw_SdXShapePropertyGraphicMap_Impl()
+{
+ static const SfxItemPropertyMapEntry aDraw_SdXShapePropertyGraphicMap_Impl[] =
+ {
+ { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &::getCppuType((const uno::Reference< container::XIndexContainer >*)0), 0, 0 },
+ DRAW_MAP_ENTRIES
+ };
+ return aDraw_SdXShapePropertyGraphicMap_Impl;
+}
+const SfxItemPropertyMapEntry* lcl_ImplGetShapePropertyMap( sal_Bool bImpress, sal_Bool bGraphicObj )
+{
+ const SfxItemPropertyMapEntry* pRet = 0;
+ if( bImpress )
+ {
+ if( bGraphicObj )
+ pRet = lcl_GetImpress_SdXShapePropertyGraphicMap_Impl();
+ else
+ pRet = lcl_GetImpress_SdXShapePropertySimpleMap_Impl();
}
- const SfxItemPropertyMapEntry* lcl_GetDraw_SdXShapePropertyGraphicMap_Impl()
+ else
{
- static const SfxItemPropertyMapEntry aDraw_SdXShapePropertyGraphicMap_Impl[] =
- {
- { MAP_CHAR_LEN("ImageMap"), WID_IMAGEMAP, &::getCppuType((const uno::Reference< container::XIndexContainer >*)0), 0, 0 },
- DRAW_MAP_ENTRIES
- };
- return aDraw_SdXShapePropertyGraphicMap_Impl;
+ if( bGraphicObj )
+ pRet = lcl_GetDraw_SdXShapePropertyGraphicMap_Impl();
+ else
+ pRet = lcl_GetDraw_SdXShapePropertySimpleMap_Impl();
}
- const SfxItemPropertyMapEntry* lcl_ImplGetShapePropertyMap( sal_Bool bImpress, sal_Bool bGraphicObj )
+ return pRet;
+
+}
+const SvxItemPropertySet* lcl_ImplGetShapePropertySet( sal_Bool bImpress, sal_Bool bGraphicObj )
+{
+ const SvxItemPropertySet* pRet = 0;
+ if( bImpress )
{
- const SfxItemPropertyMapEntry* pRet = 0;
- if( bImpress )
+ if( bGraphicObj )
{
- if( bGraphicObj )
- pRet = lcl_GetImpress_SdXShapePropertyGraphicMap_Impl();
- else
- pRet = lcl_GetImpress_SdXShapePropertySimpleMap_Impl();
+ static SvxItemPropertySet aImpress_SdXShapePropertyGraphicSet_Impl( lcl_GetImpress_SdXShapePropertyGraphicMap_Impl(), GetGlobalDrawObjectItemPool());
+ pRet = &aImpress_SdXShapePropertyGraphicSet_Impl;
}
else
{
- if( bGraphicObj )
- pRet = lcl_GetDraw_SdXShapePropertyGraphicMap_Impl();
- else
- pRet = lcl_GetDraw_SdXShapePropertySimpleMap_Impl();
+ static SvxItemPropertySet aImpress_SdXShapePropertySet_Impl(lcl_GetImpress_SdXShapePropertySimpleMap_Impl(), GetGlobalDrawObjectItemPool());
+ pRet = &aImpress_SdXShapePropertySet_Impl;
}
- return pRet;
-
}
- const SvxItemPropertySet* lcl_ImplGetShapePropertySet( sal_Bool bImpress, sal_Bool bGraphicObj )
+ else
{
- const SvxItemPropertySet* pRet = 0;
- if( bImpress )
+ if( bGraphicObj )
{
- if( bGraphicObj )
- {
- static SvxItemPropertySet aImpress_SdXShapePropertyGraphicSet_Impl( lcl_GetImpress_SdXShapePropertyGraphicMap_Impl(), SdrObject::GetGlobalDrawObjectItemPool());
- pRet = &aImpress_SdXShapePropertyGraphicSet_Impl;
- }
- else
- {
- static SvxItemPropertySet aImpress_SdXShapePropertySet_Impl(lcl_GetImpress_SdXShapePropertySimpleMap_Impl(), SdrObject::GetGlobalDrawObjectItemPool());
- pRet = &aImpress_SdXShapePropertySet_Impl;
- }
+ static SvxItemPropertySet aDraw_SdXShapePropertyGraphicSet_Impl(lcl_GetDraw_SdXShapePropertyGraphicMap_Impl(), GetGlobalDrawObjectItemPool());
+ pRet = &aDraw_SdXShapePropertyGraphicSet_Impl;
}
else
{
- if( bGraphicObj )
- {
- static SvxItemPropertySet aDraw_SdXShapePropertyGraphicSet_Impl(lcl_GetDraw_SdXShapePropertyGraphicMap_Impl(), SdrObject::GetGlobalDrawObjectItemPool());
- pRet = &aDraw_SdXShapePropertyGraphicSet_Impl;
- }
- else
- {
- static SvxItemPropertySet aDraw_SdXShapePropertySet_Impl( lcl_GetDraw_SdXShapePropertySimpleMap_Impl(), SdrObject::GetGlobalDrawObjectItemPool());
- pRet = &aDraw_SdXShapePropertySet_Impl;
- }
+ static SvxItemPropertySet aDraw_SdXShapePropertySet_Impl( lcl_GetDraw_SdXShapePropertySimpleMap_Impl(), GetGlobalDrawObjectItemPool());
+ pRet = &aDraw_SdXShapePropertySet_Impl;
}
- return pRet;
}
- const SfxItemPropertyMapEntry* lcl_GetEmpty_SdXShapePropertyMap_Impl()
+ return pRet;
+}
+const SfxItemPropertyMapEntry* lcl_GetEmpty_SdXShapePropertyMap_Impl()
+{
+ static SfxItemPropertyMapEntry aEmpty_SdXShapePropertyMap_Impl[] =
{
- static SfxItemPropertyMapEntry aEmpty_SdXShapePropertyMap_Impl[] =
- {
- { 0,0,0,0,0,0}
- };
- return aEmpty_SdXShapePropertyMap_Impl;
- }
+ { 0,0,0,0,0,0}
+ };
+ return aEmpty_SdXShapePropertyMap_Impl;
+}
- static const SvxItemPropertySet* lcl_GetEmpty_SdXShapePropertySet_Impl()
- {
- static SvxItemPropertySet aEmptyPropSet( lcl_GetEmpty_SdXShapePropertyMap_Impl(), SdrObject::GetGlobalDrawObjectItemPool() );
- return &aEmptyPropSet;
- }
+static const SvxItemPropertySet* lcl_GetEmpty_SdXShapePropertySet_Impl()
+{
+ static SvxItemPropertySet aEmptyPropSet( lcl_GetEmpty_SdXShapePropertyMap_Impl(), GetGlobalDrawObjectItemPool() );
+ return &aEmptyPropSet;
+}
const SvEventDescription* ImplGetSupportedMacroItems()
{
static const SvEventDescription aMacroDescriptionsImpl[] =
@@ -310,10 +311,10 @@ extern "C" int __LOADONCALLAPI SortFunc( const void* p1, const void* p2 );
SdXShape::SdXShape( SvxShape* pShape, SdXImpressDocument* pModel) throw()
: mpShape( pShape ),
mpPropSet( pModel?
- lcl_ImplGetShapePropertySet(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF )
+ lcl_ImplGetShapePropertySet(pModel->IsImpressDocument(), SvxShapeKind_Graphic == pShape->getSvxShapeKind() )
: lcl_GetEmpty_SdXShapePropertySet_Impl() ),
mpMap( pModel?
- lcl_ImplGetShapePropertyMap(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF )
+ lcl_ImplGetShapePropertyMap(pModel->IsImpressDocument(), SvxShapeKind_Graphic == pShape->getSvxShapeKind() )
: lcl_GetEmpty_SdXShapePropertyMap_Impl() ),
mpModel(pModel),
mpImplementationId( NULL )
@@ -379,9 +380,9 @@ uno::Sequence< uno::Type > SAL_CALL SdXShape::getTypes()
}
else
{
- const sal_uInt32 nObjId = mpShape->getShapeKind();
+ const SvxShapeKind eSvxShapeKind(mpShape->getSvxShapeKind());
uno::Sequence< uno::Type >* pTypes;
- SdTypesCache::iterator aIter( gImplTypesCache.find( nObjId ) );
+ SdTypesCache::iterator aIter( gImplTypesCache.find( eSvxShapeKind ) );
if( aIter == gImplTypesCache.end() )
{
pTypes = new uno::Sequence< uno::Type >( mpShape->_getTypes() );
@@ -389,7 +390,7 @@ uno::Sequence< uno::Type > SAL_CALL SdXShape::getTypes()
pTypes->realloc( nCount+1 );
(*pTypes)[nCount] = ::getCppuType((const uno::Reference< lang::XTypeProvider>*)0);
- gImplTypesCache[ nObjId ] = pTypes;
+ gImplTypesCache[ eSvxShapeKind ] = pTypes;
}
else
{
@@ -412,8 +413,19 @@ beans::PropertyState SAL_CALL SdXShape::getPropertyState( const OUString& Proper
else
{
SdrObject* pObj = mpShape->GetSdrObject();
- if( pObj == NULL || ( pObj->GetPage()->IsMasterPage() && pObj->IsEmptyPresObj() ) )
+
+ if( !pObj )
+ {
return beans::PropertyState_DEFAULT_VALUE;
+ }
+
+ if( pObj->IsEmptyPresObj() )
+ {
+ if( pObj->getSdrPageFromSdrObject() && pObj->getSdrPageFromSdrObject()->IsMasterPage() )
+ {
+ return beans::PropertyState_DEFAULT_VALUE;
+ }
+ }
return mpShape->_getPropertyState( PropertyName );
}
@@ -509,9 +521,9 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName,
if(!(aValue >>= nNavOrder))
throw lang::IllegalArgumentException();
- SdrObjList* pObjList = pObj->GetObjList();
+ SdrObjList* pObjList = pObj->getParentOfSdrObject();
if( pObjList )
- pObjList->SetObjectNavigationPosition( *pObj, (nNavOrder < 0) ? SAL_MAX_UINT32 : static_cast< sal_uInt32 >( nNavOrder ) );
+ pObjList->SetUserNavigationPosition( *pObj, (nNavOrder < 0) ? SAL_MAX_UINT32 : static_cast< sal_uInt32 >( nNavOrder ) );
break;
}
@@ -654,17 +666,36 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName,
case WID_MASTERDEPEND:
SetMasterDepend( ::cppu::any2bool(aValue) );
break;
+/* todo
case WID_ANIMPATH:
{
- uno::Reference< drawing::XShape > xShape( aValue, uno::UNO_QUERY );
- SdrPathObj* pObj2 = xShape.is() ? dynamic_cast< SdrPathObj* >( GetSdrObjectFromXShape( xShape ) ) : NULL;
+ uno::Reference< drawing::XShape > xShape;
+ aValue >>= xShape;
+
+ SdrObject* pObj = NULL;
+ if(xShape.is())
+ pObj = GetSdrObjectFromXShape( xShape );
- if( pObj2 == NULL )
+ if( pObj == NULL || !dynamic_cast< SdrPathObj* >(pObj) )
throw lang::IllegalArgumentException();
- EffectMigration::SetAnimationPath( mpShape, pObj2 );
+ pInfo->mpPathObj = (SdrPathObj*)pObj;
+
+ SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL;
+ if( pDoc )
+ {
+ pInfo = pDoc->GetAnimationInfo(pObj);
+ if( pInfo == NULL )
+ {
+ pInfo = new SdAnimationInfo(pDoc);
+ pObj->InsertUserData( pInfo );
+ }
+ pInfo->mbInvisibleInPresentation = sal_True;
+ }
+
break;
}
+*/
case WID_IMAGEMAP:
{
SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL;
@@ -763,7 +794,7 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName,
{
SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL;
// is the bookmark a page?
- sal_Bool bIsMasterPage;
+ bool bIsMasterPage;
if(pDoc->GetPageByName( pInfo->GetBookmark(), bIsMasterPage ) != SDRPAGE_NOTFOUND)
{
aString = SdDrawPage::getPageApiNameFromUiName( pInfo->GetBookmark() );
@@ -911,7 +942,7 @@ sal_Bool SdXShape::IsPresObj() const throw()
SdrObject* pObj = mpShape->GetSdrObject();
if(pObj)
{
- SdPage* pPage = PTR_CAST(SdPage,pObj->GetPage());
+ SdPage* pPage = dynamic_cast< SdPage* >(pObj->getSdrPageFromSdrObject());
if(pPage)
return pPage->GetPresObjKind(pObj) != PRESOBJ_NONE;
}
@@ -956,7 +987,7 @@ void SdXShape::SetEmptyPresObj( sal_Bool bEmpty ) throw()
if( pObj == NULL )
return;
- if( pObj->IsEmptyPresObj() != bEmpty )
+ if( pObj->IsEmptyPresObj() != (bool)bEmpty )
{
if(!bEmpty)
{
@@ -964,11 +995,11 @@ void SdXShape::SetEmptyPresObj( sal_Bool bEmpty ) throw()
const sal_Bool bVertical = pOutlinerParaObject ? pOutlinerParaObject->IsVertical() : sal_False;
// really delete SdrOutlinerObj at pObj
- pObj->NbcSetOutlinerParaObject(0L);
- if( bVertical && PTR_CAST( SdrTextObj, pObj ) )
+ pObj->SetOutlinerParaObject(0L);
+ if( bVertical && dynamic_cast< SdrTextObj* >(pObj ) )
((SdrTextObj*)pObj)->SetVerticalWriting( sal_True );
- SdrGrafObj* pGraphicObj = PTR_CAST( SdrGrafObj, pObj );
+ SdrGrafObj* pGraphicObj = dynamic_cast< SdrGrafObj* >(pObj );
if( pGraphicObj )
{
Graphic aEmpty;
@@ -976,7 +1007,7 @@ void SdXShape::SetEmptyPresObj( sal_Bool bEmpty ) throw()
}
else
{
- SdrOle2Obj* pOleObj = PTR_CAST( SdrOle2Obj, pObj );
+ SdrOle2Obj* pOleObj = dynamic_cast< SdrOle2Obj* >(pObj );
if( pOleObj )
{
pOleObj->SetGraphic( NULL );
@@ -1000,7 +1031,7 @@ void SdXShape::SetEmptyPresObj( sal_Bool bEmpty ) throw()
if( pOutliner == NULL )
break;
- SdPage* pPage = PTR_CAST(SdPage,pObj->GetPage());
+ SdPage* pPage = dynamic_cast< SdPage* >(pObj->getSdrPageFromSdrObject());
DBG_ASSERT( pPage, "no page?" );
if( pPage == NULL )
break;
@@ -1027,7 +1058,7 @@ void SdXShape::SetEmptyPresObj( sal_Bool bEmpty ) throw()
sal_Bool SdXShape::IsMasterDepend() const throw()
{
SdrObject* pObj = mpShape->GetSdrObject();
- return pObj && pObj->GetUserCall() != NULL;
+ return pObj && findConnectionToSdrObject(pObj) != NULL;
}
void SdXShape::SetMasterDepend( sal_Bool bDepend ) throw()
@@ -1039,12 +1070,12 @@ void SdXShape::SetMasterDepend( sal_Bool bDepend ) throw()
{
if( bDepend )
{
- SdPage* pPage = PTR_CAST(SdPage,pObj->GetPage());
- pObj->SetUserCall( pPage );
+ SdPage* pPage = dynamic_cast< SdPage* >(pObj->getSdrPageFromSdrObject());
+ establishConnectionToSdrObject(pObj, pPage);
}
else
{
- pObj->SetUserCall( NULL );
+ resetConnectionToSdrObject(pObj);
}
}
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 2218d9804e3b..e4ab356cd3e1 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -81,6 +81,7 @@
#include "unokywds.hxx"
#include "unopback.hxx"
#include "unohelp.hxx"
+#include <svx/globaldrawitempool.hxx>
using ::com::sun::star::animations::XAnimationNode;
using ::com::sun::star::animations::XAnimationNodeSupplier;
@@ -247,35 +248,35 @@ const SvxItemPropertySet* ImplGetDrawPagePropertySet( sal_Bool bImpress, PageKin
if( ePageKind == PK_STANDARD )
{
//PK_STANDARD always has a background property
- static SvxItemPropertySet aDrawPagePropertySet_Impl( aDrawPagePropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aDrawPagePropertySet_Impl( aDrawPagePropertyMap_Impl, GetGlobalDrawObjectItemPool() );
pRet = &aDrawPagePropertySet_Impl;
}
else
{
if(bWithoutBackground)
{
- static SvxItemPropertySet aDrawPageNotesHandoutPropertyNoBackSet_Impl( aDrawPageNotesHandoutPropertyNoBackMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aDrawPageNotesHandoutPropertyNoBackSet_Impl( aDrawPageNotesHandoutPropertyNoBackMap_Impl, GetGlobalDrawObjectItemPool() );
pRet = &aDrawPageNotesHandoutPropertyNoBackSet_Impl;
}
else
{
- static SvxItemPropertySet aDrawPageNotesHandoutPropertySet_Impl( aDrawPageNotesHandoutPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aDrawPageNotesHandoutPropertySet_Impl( aDrawPageNotesHandoutPropertyMap_Impl, GetGlobalDrawObjectItemPool() );
pRet = &aDrawPageNotesHandoutPropertySet_Impl;
}
}
}
else
{
- if(bWithoutBackground)
- {
- static SvxItemPropertySet aGraphicPagePropertyNoBackSet_Impl( aGraphicPagePropertyNoBackMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
- pRet = &aGraphicPagePropertyNoBackSet_Impl;
- }
- else
- {
- static SvxItemPropertySet aGraphicPagePropertySet_Impl( aGraphicPagePropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
- pRet = &aGraphicPagePropertySet_Impl;
- }
+ if(bWithoutBackground)
+ {
+ static SvxItemPropertySet aGraphicPagePropertyNoBackSet_Impl( aGraphicPagePropertyNoBackMap_Impl, GetGlobalDrawObjectItemPool() );
+ pRet = &aGraphicPagePropertyNoBackSet_Impl;
+ }
+ else
+ {
+ static SvxItemPropertySet aGraphicPagePropertySet_Impl( aGraphicPagePropertyMap_Impl, GetGlobalDrawObjectItemPool() );
+ pRet = &aGraphicPagePropertySet_Impl;
+ }
}
return pRet;
}
@@ -330,12 +331,12 @@ const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKind )
const SvxItemPropertySet* pRet = 0;
if( ePageKind == PK_HANDOUT )
{
- static SvxItemPropertySet aHandoutMasterPagePropertySet_Impl( aHandoutMasterPagePropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aHandoutMasterPagePropertySet_Impl( aHandoutMasterPagePropertyMap_Impl, GetGlobalDrawObjectItemPool() );
pRet = &aHandoutMasterPagePropertySet_Impl;
}
else
{
- static SvxItemPropertySet aMasterPagePropertySet_Impl( aMasterPagePropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aMasterPagePropertySet_Impl( aMasterPagePropertyMap_Impl, GetGlobalDrawObjectItemPool() );
pRet = &aMasterPagePropertySet_Impl;
}
return pRet;
@@ -343,31 +344,31 @@ const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKind )
const ::com::sun::star::uno::Sequence< sal_Int8 > & SdGenericDrawPage::getUnoTunnelId() throw()
{
- static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
+ static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
+ if( !pSeq )
+ {
+ ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
if( !pSeq )
{
- ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
+ static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
+ rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
+ pSeq = &aSeq;
}
- return *pSeq;
+ }
+ return *pSeq;
}
sal_Int64 SAL_CALL SdGenericDrawPage::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException)
{
- if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- {
- return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
- }
- else
- {
- return SvxFmDrawPage::getSomething( rId );
- }
+ if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+ rId.getConstArray(), 16 ) )
+ {
+ return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
+ }
+ else
+ {
+ return SvxFmDrawPage::getSomething( rId );
+ }
}
/***********************************************************************
@@ -385,7 +386,6 @@ SdGenericDrawPage::SdGenericDrawPage( SdXImpressDocument* _pModel, SdPage* pInPa
mpSdrModel = SvxFmDrawPage::mpModel;
if( mpModel )
mbIsImpressDocument = mpModel->IsImpressDocument() ? true : false;
-
}
SdGenericDrawPage::~SdGenericDrawPage() throw()
@@ -432,9 +432,8 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap
SdrObject* pObj = SvxFmDrawPage::_CreateSdrObject( xShape );
if( pObj && ( (pObj->GetObjInventor() != SdrInventor) || (pObj->GetObjIdentifier() != OBJ_PAGE) ) )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
- if( pDoc )
- pObj->NbcSetStyleSheet( pDoc->GetDefaultStyleSheet(), sal_True );
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
+ pObj->SetStyleSheet( rDoc.GetDefaultStyleSheet(), sal_True );
}
return pObj;
}
@@ -519,12 +518,11 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap
eObjKind = PRESOBJ_MEDIA;
}
- Rectangle aRect( eObjKind == PRESOBJ_TITLE ? GetPage()->GetTitleRect() : GetPage()->GetLayoutRect() );
-
- const awt::Point aPos( aRect.Left(), aRect.Top() );
+ const basegfx::B2DRange aRange( eObjKind == PRESOBJ_TITLE ? GetPage()->GetTitleRange() : GetPage()->GetLayoutRange() );
+ const awt::Point aPos( basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()) );
xShape->setPosition( aPos );
- const awt::Size aSize( aRect.GetWidth(), aRect.GetHeight() );
+ const awt::Size aSize( basegfx::fround(aRange.getWidth()), basegfx::fround(aRange.getHeight()) );
xShape->setSize( aSize );
SdrObject *pPresObj = 0;
@@ -533,19 +531,18 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap
pPresObj = SvxFmDrawPage::_CreateSdrObject( xShape );
if( pPresObj )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
- if( pDoc )
- pPresObj->NbcSetStyleSheet( pDoc->GetDefaultStyleSheet(), sal_True );
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
+ pPresObj->SetStyleSheet( rDoc.GetDefaultStyleSheet(), sal_True );
GetPage()->InsertPresObj( pPresObj, eObjKind );
}
}
else
{
- pPresObj = GetPage()->CreatePresObj( eObjKind, sal_False, aRect, sal_True );
+ pPresObj = GetPage()->CreatePresObj( eObjKind, false, aRange, true );
}
if( pPresObj )
- pPresObj->SetUserCall( GetPage() );
+ establishConnectionToSdrObject(pPresObj, GetPage());
return pPresObj;
}
@@ -622,16 +619,16 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
switch( pEntry->nWID )
{
case WID_PAGE_LEFT:
- SetLftBorder(nValue);
+ SetLeftPageBorder(nValue);
break;
case WID_PAGE_RIGHT:
- SetRgtBorder( nValue );
+ SetRightPageBorder( nValue );
break;
case WID_PAGE_TOP:
- SetUppBorder( nValue );
+ SetTopPageBorder( nValue );
break;
case WID_PAGE_BOTTOM:
- SetLwrBorder( nValue );
+ SetBottomPageBorder( nValue );
break;
case WID_PAGE_CHANGE:
GetPage()->SetPresChange( (PresChange)nValue );
@@ -673,21 +670,21 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
if( eOri != GetPage()->GetOrientation() )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
const PageKind ePageKind = GetPage()->GetPageKind();
+ sal_uInt32 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind);
- sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetMasterSdPage(i, ePageKind);
+ SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind);
pPage->SetOrientation( eOri );
}
- nPageCnt = pDoc->GetSdPageCount(ePageKind);
+ nPageCnt = rDoc.GetSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetSdPage(i, ePageKind);
+ SdPage* pPage = rDoc.GetSdPage(i, ePageKind);
pPage->SetOrientation( eOri );
}
}
@@ -719,7 +716,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
sal_Bool bVisible = sal_False;
if( ! ( aValue >>= bVisible ) )
throw lang::IllegalArgumentException();
- GetPage()->SetExcluded( bVisible == sal_False );
+ GetPage()->SetExcluded( bVisible == false );
break;
}
case WID_PAGE_SOUNDFILE :
@@ -770,12 +767,13 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
SdrPage* pPage = GetPage();
if( pPage )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel();
- if( pDoc->GetMasterPageCount() )
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(pPage->getSdrModelFromSdrPage());
+
+ if( rDoc.GetMasterPageCount() )
{
- SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = rDoc.GetModelLayerAdmin();
SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- aVisibleLayers.Set(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False), bVisible);
+ aVisibleLayers.Set(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false), bVisible);
pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
}
}
@@ -790,12 +788,13 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
SdrPage* pPage = GetPage();
if( pPage )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel();
- if( pDoc->GetMasterPageCount() )
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(pPage->getSdrModelFromSdrPage());
+
+ if( rDoc.GetMasterPageCount() )
{
- SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = rDoc.GetModelLayerAdmin();
SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- aVisibleLayers.Set(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False), bVisible);
+ aVisibleLayers.Set(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false), bVisible);
pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
}
}
@@ -1013,22 +1012,22 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
aAny = getNavigationOrder();
break;
case WID_PAGE_LEFT:
- aAny <<= (sal_Int32)( GetPage()->GetLftBorder() );
+ aAny <<= (sal_Int32)( GetPage()->GetLeftPageBorder() );
break;
case WID_PAGE_RIGHT:
- aAny <<= (sal_Int32)( GetPage()->GetRgtBorder() );
+ aAny <<= (sal_Int32)( GetPage()->GetRightPageBorder() );
break;
case WID_PAGE_TOP:
- aAny <<= (sal_Int32)( GetPage()->GetUppBorder() );
+ aAny <<= (sal_Int32)( GetPage()->GetTopPageBorder() );
break;
case WID_PAGE_BOTTOM:
- aAny <<= (sal_Int32)( GetPage()->GetLwrBorder() );
+ aAny <<= (sal_Int32)( GetPage()->GetBottomPageBorder() );
break;
case WID_PAGE_WIDTH:
- aAny <<= (sal_Int32)( GetPage()->GetSize().getWidth() );
+ aAny <<= (sal_Int32)( basegfx::fround( GetPage()->GetPageScale().getX() ) );
break;
case WID_PAGE_HEIGHT:
- aAny <<= (sal_Int32)( GetPage()->GetSize().getHeight() );
+ aAny <<= (sal_Int32)( basegfx::fround( GetPage()->GetPageScale().getY() ) );
break;
case WID_PAGE_ORIENT:
aAny = ::cppu::int2enum( (sal_Int32)((GetPage()->GetOrientation() == ORIENTATION_PORTRAIT)? view::PaperOrientation_PORTRAIT: view::PaperOrientation_LANDSCAPE), ::getCppuType((const view::PaperOrientation*)0) );
@@ -1050,7 +1049,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
break;
case WID_PAGE_NUMBER:
{
- const sal_uInt16 nPageNumber(GetPage()->GetPageNum());
+ const sal_uInt32 nPageNumber(GetPage()->GetPageNumber());
if(nPageNumber > 0)
{
@@ -1074,7 +1073,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
}
case WID_PAGE_LDBITMAP:
{
- sal_Bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
+ bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
Reference< awt::XBitmap > xBitmap(
VCLUnoHelper::CreateBitmap( BitmapEx( SdResId( bHC ? BMP_PAGE_H : BMP_PAGE ) ) ) );
aAny <<= xBitmap;
@@ -1085,36 +1084,36 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
break;
case WID_PAGE_PREVIEW :
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
- if ( pDoc )
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
+ ::sd::DrawDocShell* pDocShell = rDoc.GetDocSh();
+
+ if ( pDocShell )
{
- ::sd::DrawDocShell* pDocShell = pDoc->GetDocSh();
- if ( pDocShell )
+ sal_uInt32 nPgNum = 0;
+ sal_uInt32 nPageCount = rDoc.GetSdPageCount( PK_STANDARD );
+ sal_uInt32 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNumber() - 1 ) >> 1 );
+ while( nPgNum < nPageCount )
{
- sal_uInt16 nPgNum = 0;
- sal_uInt16 nPageCount = pDoc->GetSdPageCount( PK_STANDARD );
- sal_uInt16 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNum() - 1 ) >> 1 );
- while( nPgNum < nPageCount )
- {
- pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PK_STANDARD ), nPgNum == nPageNumber );
+ rDoc.SetSelected( rDoc.GetSdPage( nPgNum, PK_STANDARD ), nPgNum == nPageNumber );
nPgNum++;
- }
- ::boost::shared_ptr<GDIMetaFile> pMetaFile =
- pDocShell->GetPreviewMetaFile();
- if ( pMetaFile )
- {
- Point aPoint;
- Size aSize( GetPage()->GetSize() );
- pMetaFile->AddAction( (MetaAction*) new MetaFillColorAction( COL_WHITE, sal_True ), 0 );
- pMetaFile->AddAction( (MetaAction*) new MetaRectAction( Rectangle( aPoint, aSize ) ), 1 );
- pMetaFile->SetPrefMapMode( MAP_100TH_MM );
- pMetaFile->SetPrefSize( aSize );
-
- SvMemoryStream aDestStrm( 65535, 65535 );
- ConvertGDIMetaFileToWMF( *pMetaFile, aDestStrm, NULL, sal_False );
- Sequence<sal_Int8> aSeq( (sal_Int8*)aDestStrm.GetData(), aDestStrm.Tell() );
- aAny <<= aSeq;
- }
+ }
+
+ ::boost::shared_ptr<GDIMetaFile> pMetaFile = pDocShell->GetPreviewMetaFile();
+
+ if ( pMetaFile )
+ {
+ const basegfx::B2DVector& rPageScale = GetPage()->GetPageScale();
+ const Point aPoint;
+ const Size aSize(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY()));
+ pMetaFile->AddAction( (MetaAction*) new MetaFillColorAction( COL_WHITE, true ), 0 );
+ pMetaFile->AddAction( (MetaAction*) new MetaRectAction( Rectangle( aPoint, aSize ) ), 1 );
+ pMetaFile->SetPrefMapMode( MAP_100TH_MM );
+ pMetaFile->SetPrefSize( aSize );
+
+ SvMemoryStream aDestStrm( 65535, 65535 );
+ ConvertGDIMetaFileToWMF( *pMetaFile, aDestStrm, NULL, sal_False );
+ Sequence<sal_Int8> aSeq( (sal_Int8*)aDestStrm.GetData(), aDestStrm.Tell() );
+ aAny <<= aSeq;
}
}
}
@@ -1122,31 +1121,30 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
case WID_PAGE_PREVIEWBITMAP :
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
- if ( pDoc )
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
+ ::sd::DrawDocShell* pDocShell = rDoc.GetDocSh();
+
+ if ( pDocShell )
{
- ::sd::DrawDocShell* pDocShell = pDoc->GetDocSh();
- if ( pDocShell )
+ sal_uInt32 nPgNum = 0;
+ sal_uInt32 nPageCount = rDoc.GetSdPageCount( PK_STANDARD );
+ sal_uInt32 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNumber() - 1 ) >> 1 );
+ while( nPgNum < nPageCount )
{
- sal_uInt16 nPgNum = 0;
- sal_uInt16 nPageCount = pDoc->GetSdPageCount( PK_STANDARD );
- sal_uInt16 nPageNumber = (sal_uInt16)( ( GetPage()->GetPageNum() - 1 ) >> 1 );
- while( nPgNum < nPageCount )
- {
- pDoc->SetSelected( pDoc->GetSdPage( nPgNum, PK_STANDARD ), nPgNum == nPageNumber );
+ rDoc.SetSelected( rDoc.GetSdPage( nPgNum, PK_STANDARD ), nPgNum == nPageNumber );
nPgNum++;
- }
- ::boost::shared_ptr<GDIMetaFile> pMetaFile =
- pDocShell->GetPreviewMetaFile();
- BitmapEx aBitmap;
- if ( pMetaFile && pMetaFile->CreateThumbnail( 160, /* magic value taken from GraphicHelper::getThumbnailFormatFromGDI_Impl() */
- aBitmap ) )
- {
- SvMemoryStream aMemStream;
- aBitmap.GetBitmap().Write( aMemStream, sal_False, sal_False );
- uno::Sequence<sal_Int8> aSeq( (sal_Int8*)aMemStream.GetData(), aMemStream.Tell() );
- aAny <<= aSeq;
- }
+ }
+
+ ::boost::shared_ptr<GDIMetaFile> pMetaFile = pDocShell->GetPreviewMetaFile();
+ BitmapEx aBitmap;
+
+ if ( pMetaFile && pMetaFile->CreateThumbnail( 160, /* magic value taken from GraphicHelper::getThumbnailFormatFromGDI_Impl() */
+ aBitmap ) )
+ {
+ SvMemoryStream aMemStream;
+ aBitmap.GetBitmap().Write( aMemStream, false, false );
+ uno::Sequence<sal_Int8> aSeq( (sal_Int8*)aMemStream.GetData(), aMemStream.Tell() );
+ aAny <<= aSeq;
}
}
}
@@ -1154,7 +1152,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
case WID_PAGE_VISIBLE :
{
- sal_Bool bVisible = GetPage()->IsExcluded() == sal_False;
+ sal_Bool bVisible = GetPage()->IsExcluded() == false;
aAny <<= Any( &bVisible, ::getBooleanCppuType() );
break;
}
@@ -1190,12 +1188,13 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
SdrPage* pPage = GetPage();
if( pPage )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel();
- if( pDoc->GetMasterPageCount() )
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(pPage->getSdrModelFromSdrPage());
+
+ if( rDoc.GetMasterPageCount() )
{
- SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = rDoc.GetModelLayerAdmin();
SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- aAny <<= (sal_Bool)aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False));
+ aAny <<= (sal_Bool)aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false));
}
else
{
@@ -1209,12 +1208,13 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
SdrPage* pPage = GetPage();
if( pPage )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel();
- if( pDoc->GetMasterPageCount() )
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(pPage->getSdrModelFromSdrPage());
+
+ if( rDoc.GetMasterPageCount() )
{
- SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = rDoc.GetModelLayerAdmin();
SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- aAny <<= (sal_Bool)aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False));
+ aAny <<= (sal_Bool)aVisibleLayers.IsSet(rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false));
}
else
{
@@ -1581,19 +1581,16 @@ Reference< drawing::XShape > SAL_CALL SdGenericDrawPage::combine( const Referenc
if(mpView==NULL||!xShapes.is()||GetPage()==NULL)
return xShape;
- SdrPageView* pPageView = mpView->ShowSdrPage( GetPage() );
-
- _SelectObjectsInView( xShapes, pPageView );
-
+ mpView->ShowSdrPage( *GetPage() );
+ _SelectObjectsInView( xShapes );
mpView->CombineMarkedObjects( sal_False );
+ mpView->SetMarkHandles();
+
+ SdrObject* pSelected = mpView->getSelectedIfSingle();
- mpView->AdjustMarkHdl();
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ if( pSelected )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if( pObj )
- xShape = Reference< drawing::XShape >::query( pObj->getUnoShape() );
+ xShape = Reference< drawing::XShape >::query( pSelected->getUnoShape() );
}
mpView->HideSdrPage();
@@ -1614,8 +1611,8 @@ void SAL_CALL SdGenericDrawPage::split( const Reference< drawing::XShape >& xGro
if(mpView==NULL||!xGroup.is()||GetPage()==NULL)
return;
- SdrPageView* pPageView = mpView->ShowSdrPage( GetPage() );
- _SelectObjectInView( xGroup, pPageView );
+ mpView->ShowSdrPage( *GetPage() );
+ _SelectObjectInView( xGroup );
mpView->DismantleMarkedObjects( sal_False );
mpView->HideSdrPage();
@@ -1634,19 +1631,16 @@ Reference< drawing::XShape > SAL_CALL SdGenericDrawPage::bind( const Reference<
if(mpView==NULL||!xShapes.is()||GetPage()==NULL)
return xShape;
- SdrPageView* pPageView = mpView->ShowSdrPage( GetPage() );
-
- _SelectObjectsInView( xShapes, pPageView );
-
+ mpView->ShowSdrPage( *GetPage() );
+ _SelectObjectsInView( xShapes );
mpView->CombineMarkedObjects( sal_True );
+ mpView->SetMarkHandles();
+
+ SdrObject* pSelected = mpView->getSelectedIfSingle();
- mpView->AdjustMarkHdl();
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ if( pSelected )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if( pObj )
- xShape = Reference< drawing::XShape >::query( pObj->getUnoShape() );
+ xShape = Reference< drawing::XShape >::query( pSelected->getUnoShape() );
}
mpView->HideSdrPage();
@@ -1667,106 +1661,106 @@ void SAL_CALL SdGenericDrawPage::unbind( const Reference< drawing::XShape >& xSh
if(mpView==NULL||!xShape.is()||GetPage()==NULL)
return;
- SdrPageView* pPageView = mpView->ShowSdrPage( GetPage() );
- _SelectObjectInView( xShape, pPageView );
+ mpView->ShowSdrPage( *GetPage() );
+ _SelectObjectInView( xShape );
mpView->DismantleMarkedObjects( sal_True );
mpView->HideSdrPage();
GetModel()->SetModified();
}
-void SdGenericDrawPage::SetLftBorder( sal_Int32 nValue )
+void SdGenericDrawPage::SetLeftPageBorder( sal_Int32 nValue )
{
- if( nValue != GetPage()->GetLftBorder() )
+ if( nValue != GetPage()->GetLeftPageBorder() )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
const PageKind ePageKind = GetPage()->GetPageKind();
- sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind);
+ sal_uInt32 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetMasterSdPage(i, ePageKind);
- pPage->SetLftBorder( nValue );
+ SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind);
+ pPage->SetLeftPageBorder( nValue );
}
- nPageCnt = pDoc->GetSdPageCount(ePageKind);
+ nPageCnt = rDoc.GetSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetSdPage(i, ePageKind);
- pPage->SetLftBorder( nValue );
+ SdPage* pPage = rDoc.GetSdPage(i, ePageKind);
+ pPage->SetLeftPageBorder( nValue );
}
}
}
-void SdGenericDrawPage::SetRgtBorder( sal_Int32 nValue )
+void SdGenericDrawPage::SetRightPageBorder( sal_Int32 nValue )
{
- if( nValue != GetPage()->GetRgtBorder() )
+ if( nValue != GetPage()->GetRightPageBorder() )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
const PageKind ePageKind = GetPage()->GetPageKind();
+ sal_uInt32 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind);
- sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetMasterSdPage(i, ePageKind);
- pPage->SetRgtBorder( nValue );
+ SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind);
+ pPage->SetRightPageBorder( nValue );
}
- nPageCnt = pDoc->GetSdPageCount(ePageKind);
+ nPageCnt = rDoc.GetSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetSdPage(i, ePageKind);
- pPage->SetRgtBorder( nValue );
+ SdPage* pPage = rDoc.GetSdPage(i, ePageKind);
+ pPage->SetRightPageBorder( nValue );
}
}
}
-void SdGenericDrawPage::SetUppBorder( sal_Int32 nValue )
+void SdGenericDrawPage::SetTopPageBorder( sal_Int32 nValue )
{
- if( nValue != GetPage()->GetUppBorder() )
+ if( nValue != GetPage()->GetTopPageBorder() )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
const PageKind ePageKind = GetPage()->GetPageKind();
- sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind);
+ sal_uInt32 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetMasterSdPage(i, ePageKind);
- pPage->SetUppBorder( nValue );
+ SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind);
+ pPage->SetTopPageBorder( nValue );
}
- nPageCnt = pDoc->GetSdPageCount(ePageKind);
+ nPageCnt = rDoc.GetSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetSdPage(i, ePageKind);
- pPage->SetUppBorder( nValue );
+ SdPage* pPage = rDoc.GetSdPage(i, ePageKind);
+ pPage->SetTopPageBorder( nValue );
}
}
}
-void SdGenericDrawPage::SetLwrBorder( sal_Int32 nValue )
+void SdGenericDrawPage::SetBottomPageBorder( sal_Int32 nValue )
{
- if( nValue != GetPage()->GetLwrBorder() )
+ if( nValue != GetPage()->GetBottomPageBorder() )
{
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
const PageKind ePageKind = GetPage()->GetPageKind();
+ sal_uInt32 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind);
- sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetMasterSdPage(i, ePageKind);
- pPage->SetLwrBorder( nValue );
+ SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind);
+ pPage->SetBottomPageBorder( nValue );
}
- nPageCnt = pDoc->GetSdPageCount(ePageKind);
+ nPageCnt = rDoc.GetSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetSdPage(i, ePageKind);
- pPage->SetLwrBorder( nValue );
+ SdPage* pPage = rDoc.GetSdPage(i, ePageKind);
+ pPage->SetBottomPageBorder( nValue );
}
}
}
@@ -1780,20 +1774,17 @@ static void refreshpage( SdDrawDocument* pDoc, const PageKind ePageKind )
if( pViewSh )
{
- if( pViewSh->ISA(::sd::DrawViewShell ) )
- static_cast< ::sd::DrawViewShell*>(pViewSh)->ResetActualPage();
+ ::sd::DrawViewShell* pSdDrawViewShell = dynamic_cast< ::sd::DrawViewShell* >(pViewSh);
- Size aPageSize = pDoc->GetSdPage(0, ePageKind)->GetSize();
- const long nWidth = aPageSize.Width();
- const long nHeight = aPageSize.Height();
+ if( pSdDrawViewShell )
+ pSdDrawViewShell->ResetActualPage();
- Point aPageOrg = Point(nWidth, nHeight / 2);
- Size aViewSize = Size(nWidth * 3, nHeight * 2);
-
- pDoc->SetMaxObjSize(aViewSize);
-
- pViewSh->InitWindows(aPageOrg, aViewSize, Point(-1, -1), sal_True);
+ const basegfx::B2DVector& rPageScale = pDoc->GetSdPage(0, ePageKind)->GetPageScale();
+ const basegfx::B2DPoint aPageOrg(rPageScale.getX(), rPageScale.getY() * 0.5);
+ const basegfx::B2DVector aViewSize(rPageScale.getX() * 3.0, rPageScale.getY() * 2.0);
+ pDoc->SetMaxObjectScale(aViewSize);
+ pViewSh->InitWindows(aPageOrg, aViewSize, basegfx::B2DPoint(-1.0, -1.0), true);
pViewSh->UpdateScrollBars();
}
}
@@ -1801,59 +1792,60 @@ static void refreshpage( SdDrawDocument* pDoc, const PageKind ePageKind )
void SdGenericDrawPage::SetWidth( sal_Int32 nWidth )
{
- Size aSize( GetPage()->GetSize() );
- if( aSize.getWidth() != nWidth )
+ basegfx::B2DVector aSize( GetPage()->GetPageScale() );
+
+ if( basegfx::fround(aSize.getX()) != nWidth )
{
- aSize.setWidth( nWidth );
+ aSize.setX( nWidth );
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
const PageKind ePageKind = GetPage()->GetPageKind();
+ sal_uInt32 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind);
- sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetMasterSdPage(i, ePageKind);
- pPage->SetSize(aSize);
+ SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind);
+ pPage->SetPageScale(aSize);
}
- nPageCnt = pDoc->GetSdPageCount(ePageKind);
+ nPageCnt = rDoc.GetSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetSdPage(i, ePageKind);
- pPage->SetSize(aSize);
+ SdPage* pPage = rDoc.GetSdPage(i, ePageKind);
+ pPage->SetPageScale(aSize);
}
- refreshpage( pDoc, ePageKind );
+ refreshpage( &rDoc, ePageKind );
}
}
void SdGenericDrawPage::SetHeight( sal_Int32 nHeight )
{
- Size aSize( GetPage()->GetSize() );
- if( aSize.getHeight() != nHeight )
+ basegfx::B2DVector aSize( GetPage()->GetPageScale() );
+ if( basegfx::fround(aSize.getY()) != nHeight )
{
- aSize.setHeight( nHeight );
+ aSize.setY( nHeight );
- SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage());
const PageKind ePageKind = GetPage()->GetPageKind();
+ sal_uInt32 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind);
- sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetMasterSdPage(i, ePageKind);
- pPage->SetSize(aSize);
+ SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind);
+ pPage->SetPageScale(aSize);
}
- nPageCnt = pDoc->GetSdPageCount(ePageKind);
+ nPageCnt = rDoc.GetSdPageCount(ePageKind);
for (i = 0; i < nPageCnt; i++)
{
- SdPage* pPage = pDoc->GetSdPage(i, ePageKind);
- pPage->SetSize(aSize);
+ SdPage* pPage = rDoc.GetSdPage(i, ePageKind);
+ pPage->SetPageScale(aSize);
}
- refreshpage( pDoc, ePageKind );
+ refreshpage( &rDoc, ePageKind );
}
}
@@ -1919,10 +1911,14 @@ sal_Bool SAL_CALL SdPageLinkTargets::hasElements()
{
SdrObject* pObj = aIter.Next();
String aStr( pObj->GetName() );
- if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) )
- aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName();
+
if( aStr.Len() )
return sal_True;
+
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj);
+
+ if( pSdrOle2Obj )
+ aStr = pSdrOle2Obj->GetPersistName();
}
}
@@ -1966,11 +1962,20 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames()
{
SdrObject* pObj = aIter.Next();
String aStr( pObj->GetName() );
- if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) )
- aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName();
+
if( aStr.Len() )
+ {
nObjCount++;
}
+ else
+ {
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj);
+
+ if( pSdrOle2Obj )
+ aStr = pSdrOle2Obj->GetPersistName();
+ }
+
+ }
}
Sequence< OUString > aSeq( nObjCount );
@@ -1983,11 +1988,18 @@ Sequence< OUString > SAL_CALL SdPageLinkTargets::getElementNames()
{
SdrObject* pObj = aIter.Next();
String aStr( pObj->GetName() );
- if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) )
- aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName();
if( aStr.Len() )
+ {
*pStr++ = aStr;
}
+ else
+ {
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj);
+
+ if( pSdrOle2Obj )
+ aStr = pSdrOle2Obj->GetPersistName();
+ }
+ }
}
return aSeq;
@@ -2016,10 +2028,17 @@ SdrObject* SdPageLinkTargets::FindObject( const String& rName ) const throw()
{
SdrObject* pObj = aIter.Next();
String aStr( pObj->GetName() );
- if( !aStr.Len() && pObj->ISA( SdrOle2Obj ) )
- aStr = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName();
+
if( aStr.Len() && (aStr == rName) )
return pObj;
+
+ if( !aStr.Len() )
+ {
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj);
+
+ if(pSdrOle2Obj)
+ aStr = pSdrOle2Obj->GetPersistName();
+ }
}
return NULL;
@@ -2176,7 +2195,7 @@ OUString getPageApiName( SdPage* pPage )
{
OUStringBuffer sBuffer;
sBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( sEmptyPageName ) );
- const sal_Int32 nPageNum = ( ( pPage->GetPageNum() - 1 ) >> 1 ) + 1;
+ const sal_Int32 nPageNum = ( ( pPage->GetPageNumber() - 1 ) >> 1 ) + 1;
sBuffer.append( nPageNum );
aPageName = sBuffer.makeStringAndClear();
}
@@ -2319,7 +2338,7 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName )
}
}
- if( nPageNumber == ( ( GetPage()->GetPageNum() - 1 ) >> 1 ) + 1 )
+ if( nPageNumber == ( ( (sal_Int32)GetPage()->GetPageNumber() - 1 ) >> 1 ) + 1 )
aName = OUString();
}
else
@@ -2332,7 +2351,7 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName )
GetPage()->SetName( aName );
- sal_uInt16 nNotesPageNum = (GetPage()->GetPageNum()-1)>>1;
+ sal_uInt32 nNotesPageNum = (GetPage()->GetPageNumber()-1)>>1;
if( GetModel()->GetDoc()->GetSdPageCount( PK_NOTES ) > nNotesPageNum )
{
SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( nNotesPageNum, PK_NOTES );
@@ -2343,15 +2362,15 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName )
// fake a mode change to repaint the page tab bar
::sd::DrawDocShell* pDocSh = GetModel()->GetDocShell();
::sd::ViewShell* pViewSh = pDocSh ? pDocSh->GetViewShell() : NULL;
- if( pViewSh && pViewSh->ISA(::sd::DrawViewShell))
+ ::sd::DrawViewShell* pDrawViewSh = dynamic_cast< ::sd::DrawViewShell* >(pViewSh);
+
+ if( pDrawViewSh )
{
- ::sd::DrawViewShell* pDrawViewSh = static_cast<
- ::sd::DrawViewShell*>(pViewSh);
EditMode eMode = pDrawViewSh->GetEditMode();
if( eMode == EM_PAGE )
{
- sal_Bool bLayer = pDrawViewSh->IsLayerModeActive();
+ bool bLayer = pDrawViewSh->IsLayerModeActive();
pDrawViewSh->ChangeEditMode( eMode, !bLayer );
pDrawViewSh->ChangeEditMode( eMode, bLayer );
@@ -2413,19 +2432,19 @@ void SAL_CALL SdDrawPage::setMasterPage( const Reference< drawing::XDrawPage >&
SdPage* pSdPage = (SdPage*) pMasterPage->GetSdrPage();
SvxFmDrawPage::mpPage->TRG_SetMasterPage(*pSdPage);
- SvxFmDrawPage::mpPage->SetBorder(pSdPage->GetLftBorder(),pSdPage->GetUppBorder(),
- pSdPage->GetRgtBorder(),pSdPage->GetLwrBorder() );
+ SvxFmDrawPage::mpPage->SetPageBorder(pSdPage->GetLeftPageBorder(),pSdPage->GetTopPageBorder(),
+ pSdPage->GetRightPageBorder(),pSdPage->GetBottomPageBorder() );
- SvxFmDrawPage::mpPage->SetSize( pSdPage->GetSize() );
+ SvxFmDrawPage::mpPage->SetPageScale( pSdPage->GetPageScale() );
SvxFmDrawPage::mpPage->SetOrientation( pSdPage->GetOrientation() );
((SdPage*)SvxFmDrawPage::mpPage)->SetLayoutName( ( (SdPage*)pSdPage )->GetLayoutName() );
// set notes master also
- SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PK_NOTES );
+ SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNumber()-1)>>1, PK_NOTES );
pNotesPage->TRG_ClearMasterPage();
- sal_uInt16 nNum = (SvxFmDrawPage::mpPage->TRG_GetMasterPage()).GetPageNum() + 1;
- pNotesPage->TRG_SetMasterPage(*SvxFmDrawPage::mpPage->GetModel()->GetMasterPage(nNum));
+ sal_uInt32 nNum = (SvxFmDrawPage::mpPage->TRG_GetMasterPage()).GetPageNumber() + 1;
+ pNotesPage->TRG_SetMasterPage(*SvxFmDrawPage::mpPage->getSdrModelFromSdrPage().GetMasterPage(nNum));
pNotesPage->SetLayoutName( ( (SdPage*)pSdPage )->GetLayoutName() );
GetModel()->SetModified();
@@ -2442,9 +2461,9 @@ Reference< drawing::XDrawPage > SAL_CALL SdDrawPage::getNotesPage()
throwIfDisposed();
- if(SvxFmDrawPage::mpPage && GetModel()->GetDoc() && SvxFmDrawPage::mpPage->GetPageNum() )
+ if(SvxFmDrawPage::mpPage && GetModel()->GetDoc() && SvxFmDrawPage::mpPage->GetPageNumber() )
{
- SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PK_NOTES );
+ SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNumber()-1)>>1, PK_NOTES );
if( pNotesPage )
{
Reference< drawing::XDrawPage > xPage( pNotesPage->getUnoPage(), uno::UNO_QUERY );
@@ -2500,7 +2519,7 @@ void SAL_CALL SdDrawPage::remove( const Reference< drawing::XShape >& xShape ) t
if( pObj )
{
GetPage()->RemovePresObj(pObj);
- pObj->SetUserCall(NULL);
+ resetConnectionToSdrObject(pObj);
}
}
@@ -2525,11 +2544,11 @@ void SdDrawPage::setBackground( const Any& rValue )
// is it our own implementation?
SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xSet );
- SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
+ SfxItemSet aSet( GetModel()->GetDoc()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
if( pBack )
{
- pBack->fillItemSet( (SdDrawDocument*)GetPage()->GetModel(), aSet );
+ pBack->fillItemSet( (SdDrawDocument*)(&GetPage()->getSdrModelFromSdrPage()), aSet );
}
else
{
@@ -2553,7 +2572,7 @@ void SdDrawPage::setBackground( const Any& rValue )
pProp++;
}
- pBackground->fillItemSet( (SdDrawDocument*)GetPage()->GetModel(), aSet );
+ pBackground->fillItemSet( (SdDrawDocument*)(&GetPage()->getSdrModelFromSdrPage()), aSet );
}
//-/ pObj->NbcSetAttributes( aSet, sal_False );
@@ -2621,14 +2640,14 @@ void SdGenericDrawPage::setNavigationOrder( const Any& rValue )
{
if( dynamic_cast< SdDrawPage* >( xIA.get() ) == this )
{
- if( GetPage()->HasObjectNavigationOrder() )
- GetPage()->ClearObjectNavigationOrder();
+ if( GetPage()->HasUserNavigationOrder() )
+ GetPage()->ClearUserNavigationOrder();
return;
}
else if( xIA->getCount() == static_cast< sal_Int32 >( GetPage()->GetObjCount() ) )
{
- GetPage()->SetNavigationOrder(xIA);
+ GetPage()->SetUserNavigationOrder(xIA);
return;
}
}
@@ -2696,7 +2715,7 @@ sal_Bool SAL_CALL NavigationOrderAccess::hasElements( ) throw (RuntimeException
Any SdGenericDrawPage::getNavigationOrder()
{
- if( GetPage()->HasObjectNavigationOrder() )
+ if( GetPage()->HasUserNavigationOrder() )
{
return Any( Reference< XIndexAccess >( new NavigationOrderAccess( GetPage() ) ) );
}
@@ -2933,11 +2952,11 @@ void SdMasterPage::setBackground( const Any& rValue )
// is it our own implementation?
SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xInputSet );
- SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
+ SfxItemSet aSet( GetModel()->GetDoc()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
if( pBack )
{
- pBack->fillItemSet( (SdDrawDocument*)GetPage()->GetModel(), aSet );
+ pBack->fillItemSet( (SdDrawDocument*)(&GetPage()->getSdrModelFromSdrPage()), aSet );
}
else
{
@@ -2960,12 +2979,12 @@ void SdMasterPage::setBackground( const Any& rValue )
pProp++;
}
- pBackground->fillItemSet( (SdDrawDocument*)SvxFmDrawPage::mpPage->GetModel(), aSet );
+ pBackground->fillItemSet( (SdDrawDocument*)(&SvxFmDrawPage::mpPage->getSdrModelFromSdrPage()), aSet );
}
// if we find the background style, copy the set to the background
- SdDrawDocument* pDoc = (SdDrawDocument*)SvxFmDrawPage::mpPage->GetModel();
- SfxStyleSheetBasePool* pSSPool = (SfxStyleSheetBasePool*)pDoc->GetStyleSheetPool();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(SvxFmDrawPage::mpPage->getSdrModelFromSdrPage());
+ SfxStyleSheetBasePool* pSSPool = dynamic_cast< SfxStyleSheetBasePool* >(rDoc.GetStyleSheetPool());
if(pSSPool)
{
String aLayoutName( static_cast< SdPage* >( SvxFmDrawPage::mpPage )->GetLayoutName() );
@@ -3008,8 +3027,8 @@ void SdMasterPage::getBackground( Any& rValue ) throw()
}
else
{
- SdDrawDocument* pDoc = (SdDrawDocument*)SvxFmDrawPage::mpPage->GetModel();
- SfxStyleSheetBasePool* pSSPool = (SfxStyleSheetBasePool*)pDoc->GetStyleSheetPool();
+ SdDrawDocument& rDoc = static_cast< SdDrawDocument& >(SvxFmDrawPage::mpPage->getSdrModelFromSdrPage());
+ SfxStyleSheetBasePool* pSSPool = dynamic_cast< SfxStyleSheetBasePool* >(rDoc.GetStyleSheetPool());
if(pSSPool)
{
String aLayoutName( static_cast< SdPage* >(SvxFmDrawPage::mpPage)->GetLayoutName() );
@@ -3022,7 +3041,7 @@ void SdMasterPage::getBackground( Any& rValue ) throw()
SfxItemSet aStyleSet( pStyleSheet->GetItemSet());
if( aStyleSet.Count() )
{
- rValue <<= Reference< beans::XPropertySet >( new SdUnoPageBackground( pDoc, &aStyleSet ) );
+ rValue <<= Reference< beans::XPropertySet >( new SdUnoPageBackground( &rDoc, &aStyleSet ) );
return;
}
}
@@ -3069,15 +3088,14 @@ void SAL_CALL SdMasterPage::setName( const OUString& aName )
// fake a mode change to repaint the page tab bar
::sd::DrawDocShell* pDocSh = GetModel()->GetDocShell();
::sd::ViewShell* pViewSh = pDocSh ? pDocSh->GetViewShell() : NULL;
- if( pViewSh && pViewSh->ISA(::sd::DrawViewShell ) )
- {
- ::sd::DrawViewShell* pDrawViewSh =
- static_cast< ::sd::DrawViewShell*>(pViewSh);
+ ::sd::DrawViewShell* pDrawViewSh = dynamic_cast< ::sd::DrawViewShell* >(pViewSh);
+ if( pDrawViewSh )
+ {
EditMode eMode = pDrawViewSh->GetEditMode();
if( eMode == EM_MASTERPAGE )
{
- sal_Bool bLayer = pDrawViewSh->IsLayerModeActive();
+ bool bLayer = pDrawViewSh->IsLayerModeActive();
pDrawViewSh->ChangeEditMode( eMode, !bLayer );
pDrawViewSh->ChangeEditMode( eMode, bLayer );
@@ -3116,7 +3134,7 @@ Reference< drawing::XDrawPage > SAL_CALL SdMasterPage::getNotesPage()
if(SvxFmDrawPage::mpPage && GetModel()->GetDoc() )
{
- SdPage* pNotesPage = GetModel()->GetDoc()->GetMasterSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PK_NOTES );
+ SdPage* pNotesPage = GetModel()->GetDoc()->GetMasterSdPage( (SvxFmDrawPage::mpPage->GetPageNumber()-1)>>1, PK_NOTES );
if( pNotesPage )
{
Reference< drawing::XDrawPage > xPage( pNotesPage->getUnoPage(), uno::UNO_QUERY );
@@ -3157,9 +3175,9 @@ Reference< uno::XInterface > createUnoPageImpl( SdPage* pPage )
{
Reference< uno::XInterface > xPage;
- if( pPage && pPage->GetModel() )
+ if( pPage )
{
- SdXImpressDocument* pModel = SdXImpressDocument::getImplementation( pPage->GetModel()->getUnoModel() );
+ SdXImpressDocument* pModel = SdXImpressDocument::getImplementation( pPage->getSdrModelFromSdrPage().getUnoModel() );
if( pModel )
{
if( pPage->IsMasterPage() )
diff --git a/sd/source/ui/unoidl/unopage.hxx b/sd/source/ui/unoidl/unopage.hxx
index 89b9f53fce07..45fba09c2c3b 100644
--- a/sd/source/ui/unoidl/unopage.hxx
+++ b/sd/source/ui/unoidl/unopage.hxx
@@ -83,10 +83,10 @@ protected:
rtl::OUString getBookmarkURL() const;
void setBookmarkURL( rtl::OUString& rURL );
- void SetLftBorder( sal_Int32 nValue );
- void SetRgtBorder( sal_Int32 nValue );
- void SetUppBorder( sal_Int32 nValue );
- void SetLwrBorder( sal_Int32 nValue );
+ void SetLeftPageBorder( sal_Int32 nValue );
+ void SetRightPageBorder( sal_Int32 nValue );
+ void SetTopPageBorder( sal_Int32 nValue );
+ void SetBottomPageBorder( sal_Int32 nValue );
void SetWidth( sal_Int32 nWidth );
void SetHeight( sal_Int32 nHeight );
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index b4986311ad16..0b631ddd96c9 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -42,6 +42,7 @@
#include "unohelp.hxx"
#include "drawdoc.hxx"
#include "unokywds.hxx"
+#include <svx/globaldrawitempool.hxx>
using namespace ::rtl;
using namespace ::vos;
@@ -55,7 +56,7 @@ const SvxItemPropertySet* ImplGetPageBackgroundPropertySet()
{0,0,0,0,0,0}
};
- static SvxItemPropertySet aPageBackgroundPropertySet_Impl( aPageBackgroundPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aPageBackgroundPropertySet_Impl( aPageBackgroundPropertyMap_Impl, GetGlobalDrawObjectItemPool() );
return &aPageBackgroundPropertySet_Impl;
}
@@ -71,7 +72,7 @@ SdUnoPageBackground::SdUnoPageBackground(
if( pDoc )
{
StartListening( *pDoc );
- mpSet = new SfxItemSet( pDoc->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
+ mpSet = new SfxItemSet( pDoc->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
if( pSet )
mpSet->Put(*pSet);
@@ -89,13 +90,13 @@ SdUnoPageBackground::~SdUnoPageBackground() throw()
void SdUnoPageBackground::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
if( pSdrHint )
{
// delete item set if document is dying because then the pool
// will also die
- if( pSdrHint->GetKind() == HINT_MODELCLEARED )
+ if( pSdrHint->GetSdrHintKind() == HINT_MODELCLEARED )
{
delete mpSet;
mpSet = NULL;
diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
index 4d65427d5bf7..bc376fdb438b 100644
--- a/sd/source/ui/unoidl/unosrch.cxx
+++ b/sd/source/ui/unoidl/unosrch.cxx
@@ -38,6 +38,7 @@
#include "unohelp.hxx"
#include "unoprnms.hxx"
#include "unosrch.hxx"
+#include <svx/globaldrawitempool.hxx>
using namespace ::vos;
using namespace ::rtl;
@@ -719,7 +720,7 @@ UNO3_GETIMPLEMENTATION_IMPL( SdUnoSearchReplaceDescriptor );
SdUnoSearchReplaceDescriptor::SdUnoSearchReplaceDescriptor( sal_Bool bReplace ) throw()
{
- mpPropSet = new SvxItemPropertySet(ImplGetSearchPropertyMap(), SdrObject::GetGlobalDrawObjectItemPool());
+ mpPropSet = new SvxItemPropertySet(ImplGetSearchPropertyMap(), GetGlobalDrawObjectItemPool());
mbBackwards = sal_False;
mbCaseSensitive = sal_False;
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 8b2fcf42be12..c2ee9c9a026f 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -214,7 +214,7 @@ namespace {
/** When the value of the property with name pName is a boolean then
return its value. When the property is unknown then
- bDefaultValue is returned. Otherwise <FALSE/> is returned.
+ bDefaultValue is returned. Otherwise <false/> is returned.
*/
bool GetBoolValue (
const sal_Char* pName,
@@ -224,9 +224,9 @@ namespace {
return bValue;
}
- /** Return <TRUE/> when the value of the property with name pName is
+ /** Return <true/> when the value of the property with name pName is
a string and its value equals pValue. When the property is
- unknown then bDefaultValue is returned. Otherwise <FALSE/> is
+ unknown then bDefaultValue is returned. Otherwise <false/> is
returned.
*/
bool GetBoolValue (
@@ -241,8 +241,8 @@ namespace {
return bDefaultValue;
}
- /** Return <TRUE/> when the value of the property with name pName is
- an integer and its value is nTriggerValue. Otherwise <FALSE/> is
+ /** Return <true/> when the value of the property with name pName is
+ an integer and its value is nTriggerValue. Otherwise <false/> is
returned.
*/
bool GetBoolValue (
@@ -266,7 +266,7 @@ namespace {
Selection (const OUString& rsSelection, const SdPage* pCurrentPage)
: mbAreAllPagesSelected(rsSelection.equalsAscii("all")),
mbIsShapeSelection(rsSelection.equalsAscii("selection")),
- mnCurrentPageIndex(pCurrentPage!=NULL ? (pCurrentPage->GetPageNum()-1)/2 : -1),
+ mnCurrentPageIndex(pCurrentPage!=NULL ? (pCurrentPage->GetPageNumber()-1)/2 : -1),
mpSelectedPages()
{
if ( ! (mbAreAllPagesSelected || mbIsShapeSelection))
@@ -348,20 +348,30 @@ namespace {
const SetOfByte& rVisibleLayers,
const SetOfByte& rPrintableLayers)
{
- rPrintView.ShowSdrPage(&rPage);
+ rPrintView.ShowSdrPage(rPage);
const MapMode aOriginalMapMode (rPrinter.GetMapMode());
// Set the visible layers
SdrPageView* pPageView = rPrintView.GetSdrPageView();
OSL_ASSERT(pPageView!=NULL);
- pPageView->SetVisibleLayers(rVisibleLayers);
- pPageView->SetPrintableLayers(rPrintableLayers);
+
+ if(pPageView)
+ {
+ pPageView->SetVisibleLayers(rVisibleLayers);
+ pPageView->SetPrintableLayers(rPrintableLayers);
+ }
if (pView!=NULL && bPrintMarkedOnly)
+ {
pView->DrawMarkedObj(rPrinter);
+ }
else
- rPrintView.CompleteRedraw(&rPrinter, Rectangle(Point(0,0), rPage.GetSize()));
+ {
+ const Region aRegion(Rectangle(0, 0, basegfx::fround(rPage.GetPageScale().getX()), basegfx::fround(rPage.GetPageScale().getY())));
+
+ rPrintView.CompleteRedraw(&rPrinter, aRegion);
+ }
rPrinter.SetMapMode(aOriginalMapMode);
@@ -865,13 +875,13 @@ namespace {
return;
MapMode aMap (rPrinter.GetMapMode());
- const Size aPageSize (pPageToPrint->GetSize());
- const Size aPrintSize (rPrinter.GetOutputSize());
+ const Size aPageSize(basegfx::fround(pPageToPrint->GetPageScale().getX()), basegfx::fround(pPageToPrint->GetPageScale().getY()));
+ const Size aPrintSize(rPrinter.GetOutputSize());
const sal_Int32 nPageWidth (aPageSize.Width() + mnGap
- - pPageToPrint->GetLftBorder() - pPageToPrint->GetRgtBorder());
+ - pPageToPrint->GetLeftPageBorder() - pPageToPrint->GetRightPageBorder());
const sal_Int32 nPageHeight (aPageSize.Height() + mnGap
- - pPageToPrint->GetUppBorder() - pPageToPrint->GetLwrBorder());
+ - pPageToPrint->GetTopPageBorder() - pPageToPrint->GetBottomPageBorder());
if (nPageWidth<=0 || nPageHeight<=0)
return;
@@ -979,8 +989,8 @@ namespace {
}
private:
- const sal_uInt16 mnFirstPageIndex;
- const sal_uInt16 mnSecondPageIndex;
+ const sal_uInt32 mnFirstPageIndex;
+ const sal_uInt32 mnSecondPageIndex;
const Point maFirstOffset;
const Point maSecondOffset;
};
@@ -994,8 +1004,8 @@ namespace {
{
public:
HandoutPrinterPage (
- const sal_uInt16 nHandoutPageIndex,
- const ::std::vector<sal_uInt16>& rPageIndices,
+ const sal_uInt32 nHandoutPageIndex,
+ const ::std::vector< sal_uInt32 >& rPageIndices,
const MapMode& rMapMode,
const ::rtl::OUString& rsPageString,
const Point& rPageStringOffset,
@@ -1037,7 +1047,7 @@ namespace {
// Connect page objects with pages.
std::vector<SdrPageObj*>::iterator aPageObjIter (aHandoutPageObjects.begin());
- for (std::vector<sal_uInt16>::const_iterator
+ for (std::vector< sal_uInt32 >::const_iterator
iPageIndex(maPageIndices.begin()),
iEnd(maPageIndices.end());
iPageIndex!=iEnd && aPageObjIter!=aHandoutPageObjects.end();
@@ -1126,8 +1136,8 @@ namespace {
}
private:
- const sal_uInt16 mnHandoutPageIndex;
- const ::std::vector<sal_uInt16> maPageIndices;
+ const sal_uInt32 mnHandoutPageIndex;
+ const ::std::vector< sal_uInt32 > maPageIndices;
};
@@ -1180,12 +1190,12 @@ namespace {
const Rectangle aOutRect (rPrinter.GetPageOffset(), rPrinter.GetOutputSize());
Outliner* pOutliner = rDocument.GetInternalOutliner();
const sal_uInt16 nSavedOutlMode (pOutliner->GetMode());
- const sal_Bool bSavedUpdateMode (pOutliner->GetUpdateMode());
+ const bool bSavedUpdateMode (pOutliner->GetUpdateMode());
const Size aSavedPaperSize (pOutliner->GetPaperSize());
pOutliner->Init(OUTLINERMODE_OUTLINEVIEW);
pOutliner->SetPaperSize(aOutRect.GetSize());
- pOutliner->SetUpdateMode(sal_True);
+ pOutliner->SetUpdateMode(true);
pOutliner->Clear();
pOutliner->SetText(*mpParaObject);
@@ -1507,8 +1517,10 @@ private:
rOutliner.SetControlWord( nCntrl );
// When in outline view then apply all pending changes to the model.
- if (pShell->ISA(OutlineViewShell))
- static_cast<OutlineViewShell*>(pShell)->PrepareClose (sal_False, sal_False);
+ OutlineViewShell* pOutlineViewShell = dynamic_cast< OutlineViewShell* >(pShell);
+
+ if (pOutlineViewShell)
+ pOutlineViewShell->PrepareClose (false, false);
// Collect some frequently used data.
if (mpOptions->IsDate())
@@ -1518,7 +1530,7 @@ private:
}
if (mpOptions->IsTime())
- aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time(), sal_False, sal_False );
+ aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time(), false, false );
aInfo.maPrintSize = aInfo.mpPrinter->GetOutputSize();
maPrintSize = awt::Size(
aInfo.mpPrinter->GetPaperSize().Width(),
@@ -1542,13 +1554,6 @@ private:
aInfo.mnDrawMode = DRAWMODE_DEFAULT;
}
- // check if selected range of pages contains transparent objects
- /*
- const bool bPrintPages (bPrintNotes || bPrintDraw || bPrintHandout);
- const bool bContainsTransparency (bPrintPages && ContainsTransparency());
- if (pPrinter->InitJob (mrBase.GetWindow(), !bIsAPI && bContainsTransparency))
- */
-
if (mpOptions->IsDraw())
PrepareStdOrNotes(PK_STANDARD, aInfo);
if (mpOptions->IsNotes())
@@ -1604,44 +1609,50 @@ private:
// delete all previous shapes from handout page
while( pHandout->GetObjCount() )
{
- SdrObject* pObj = pHandout->NbcRemoveObject(0);
+ SdrObject* pObj = pHandout->RemoveObjectFromSdrObjList(pHandout->GetObjCount() - 1);
if( pObj )
- SdrObject::Free( pObj );
+ {
+ deleteSdrObjectSafeAndClearPointer( pObj );
+ }
}
const bool bDrawLines (eLayout == AUTOLAYOUT_HANDOUT3);
- std::vector< Rectangle > aAreas;
+ std::vector< basegfx::B2DRange > aAreas;
SdPage::CalculateHandoutAreas( rModel, eLayout, bHandoutHorizontal, aAreas );
- std::vector< Rectangle >::iterator iter( aAreas.begin() );
+ std::vector< basegfx::B2DRange >::iterator iter( aAreas.begin() );
while( iter != aAreas.end() )
{
- pHandout->NbcInsertObject( new SdrPageObj((*iter++)) );
+ basegfx::B2DRange aRange(*iter++);
+ SdrPageObj* pNewSdrPageObj = new SdrPageObj(
+ rModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aRange.getRange(), aRange.getMinimum()));
+ pHandout->InsertObjectToSdrObjList(*pNewSdrPageObj);
if( bDrawLines && (iter != aAreas.end()) )
{
- Rectangle aRect( (*iter++) );
-
+ aRange = *iter++;
basegfx::B2DPolygon aPoly;
- aPoly.insert(0, basegfx::B2DPoint( aRect.Left(), aRect.Top() ) );
- aPoly.insert(1, basegfx::B2DPoint( aRect.Right(), aRect.Top() ) );
-
- basegfx::B2DHomMatrix aMatrix;
- aMatrix.translate( 0.0, static_cast< double >( aRect.GetHeight() / 7 ) );
+ aPoly.append( aRange.getMinimum() );
+ aPoly.append( basegfx::B2DPoint( aRange.getMaxX(), aRange.getMinY() ) );
+ const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( 0.0, aRange.getHeight() / 7.0));
basegfx::B2DPolyPolygon aPathPoly;
+
for( sal_uInt16 nLine = 0; nLine < 7; nLine++ )
{
aPoly.transform( aMatrix );
aPathPoly.append( aPoly );
}
- SdrPathObj* pPathObj = new SdrPathObj(OBJ_PATHLINE, aPathPoly );
+ SdrPathObj* pPathObj = new SdrPathObj(
+ rModel,
+ aPathPoly );
+
pPathObj->SetMergedItem(XLineStyleItem(XLINE_SOLID));
pPathObj->SetMergedItem(XLineColorItem(String(), Color(COL_BLACK)));
-
- pHandout->NbcInsertObject( pPathObj );
+ pHandout->InsertObjectToSdrObjList(*pPathObj);
}
}
}
@@ -1649,35 +1660,6 @@ private:
- /** Detect whether any of the slides that are to be printed contains
- partially transparent or translucent shapes.
- */
- bool ContainsTransparency (const PrintInfo& rInfo) const
- {
- // const bool bPrintExcluded (mpOptions->IsPrintExcluded());
- bool bContainsTransparency = false;
-
- for (sal_uInt16
- nIndex=0,
- nCount=mrBase.GetDocument()->GetSdPageCount(PK_STANDARD);
- nIndex < nCount && !bContainsTransparency;
- ++nIndex)
- {
- SdPage* pPage = GetFilteredPage(nIndex, PK_STANDARD, rInfo);
- if (pPage == NULL)
- continue;
-
- bContainsTransparency = pPage->HasTransparentObjects();
- if ( ! bContainsTransparency && pPage->TRG_HasMasterPage())
- bContainsTransparency = pPage->TRG_GetMasterPage().HasTransparentObjects();
- }
-
- return bContainsTransparency;
- }
-
-
-
-
/** Detect whether the specified slide is to be printed.
@return
When the slide is not to be printed then <NULL/> is returned.
@@ -1693,7 +1675,7 @@ private:
if ( ! rInfo.maSelection.IsSelected(nPageIndex))
return NULL;
SdPage* pPage = mrBase.GetDocument()->GetSdPage(
- sal::static_int_cast<sal_uInt16>(nPageIndex),
+ sal::static_int_cast< sal_uInt32 >(nPageIndex),
ePageKind);
if (pPage == NULL)
return NULL;
@@ -1735,11 +1717,11 @@ private:
Outliner* pOutliner = mrBase.GetDocument()->GetInternalOutliner();
pOutliner->Init(OUTLINERMODE_OUTLINEVIEW);
const sal_uInt16 nSavedOutlMode (pOutliner->GetMode());
- const sal_Bool bSavedUpdateMode (pOutliner->GetUpdateMode());
+ const bool bSavedUpdateMode (pOutliner->GetUpdateMode());
const Size aSavedPaperSize (pOutliner->GetPaperSize());
const MapMode aSavedMapMode (pOutliner->GetRefMapMode());
pOutliner->SetPaperSize(aOutRect.GetSize());
- pOutliner->SetUpdateMode(sal_True);
+ pOutliner->SetUpdateMode(true);
long nPageH = aOutRect.GetHeight();
@@ -1908,7 +1890,7 @@ private:
if ( bScalePage )
{
- const Size aPageSize (rHandoutPage.GetSize());
+ const Size aPageSize(basegfx::fround(rHandoutPage.GetPageScale().getX()), basegfx::fround(rHandoutPage.GetPageScale().getY()));
const Size aPrintSize (rInfo.mpPrinter->GetOutputSize());
const double fHorz = (double) aPrintSize.Width() / aPageSize.Width();
@@ -1944,8 +1926,9 @@ private:
mrBase.GetDocument()->setHandoutPageCount( nHandoutPageCount );
// Distribute pages to handout pages.
- ::std::vector<sal_uInt16> aPageIndices;
- for (sal_uInt16
+ ::std::vector< sal_uInt32 > aPageIndices;
+ std::vector<SdPage*> aPagesVector;
+ for (sal_uInt32
nIndex=0,
nCount= nPageCount,
nHandoutPageIndex=0;
@@ -1961,7 +1944,8 @@ private:
// Create a printer page when we have found one page for each
// placeholder or when this is the last (and special) loop.
- if (!aPageIndices.empty() && (aPageIndices.size() == nShapeCount || nIndex==nCount))
+ if (aPageIndices.size() == nShapeCount
+ || nIndex==nCount)
{
maPrinterPages.push_back(
::boost::shared_ptr<PrinterPage>(
@@ -1995,7 +1979,7 @@ private:
if (pDocument->GetSdPageCount(ePageKind) == 0)
return;
SdPage* pRefPage = pDocument->GetSdPage(0, ePageKind);
- rInfo.maPageSize = pRefPage->GetSize();
+ rInfo.maPageSize = Size(basegfx::fround(pRefPage->GetPageScale().getX()), basegfx::fround(pRefPage->GetPageScale().getY()));
if ( ! SetupPaperOrientation(ePageKind, rInfo))
return;
@@ -2036,7 +2020,7 @@ private:
MapMode aMap (rInfo.maMap);
// Kann sich die Seitengroesse geaendert haben?
- const Size aPageSize = pPage->GetSize();
+ const Size aPageSize(basegfx::fround(pPage->GetPageScale().getX()), basegfx::fround(pPage->GetPageScale().getY()));
if (mpOptions->IsPageSize())
{
@@ -2063,18 +2047,18 @@ private:
rInfo.msPageString = ::rtl::OUString();
rInfo.msPageString += rInfo.msTimeDate;
- long aPageWidth = aPageSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder();
- long aPageHeight = aPageSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder();
+ long aPageWidth = aPageSize.Width() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder();
+ long aPageHeight = aPageSize.Height() - pPage->GetTopPageBorder() - pPage->GetBottomPageBorder();
// Bugfix zu 44530:
// Falls implizit umgestellt wurde (Landscape/Portrait)
// wird dies beim Kacheln, bzw. aufteilen (Poster) beruecksichtigt
- sal_Bool bSwitchPageSize = sal_False;
+ bool bSwitchPageSize = false;
if( ( rInfo.maPrintSize.Width() > rInfo.maPrintSize.Height()
&& aPageWidth < aPageHeight )
|| ( rInfo.maPrintSize.Width() < rInfo.maPrintSize.Height()
&& aPageWidth > aPageHeight ) )
{
- bSwitchPageSize = sal_True;
+ bSwitchPageSize = true;
const sal_Int32 nTmp (rInfo.maPrintSize.Width());
rInfo.maPrintSize.Width() = rInfo.maPrintSize.Height();
rInfo.maPrintSize.Height() = nTmp;
@@ -2312,9 +2296,9 @@ private:
// keep the page content at its position if it fits, otherwise
// move it to the printable area
const long nPageWidth (
- rInfo.maPageSize.Width() - rPage.GetLftBorder() - rPage.GetRgtBorder());
+ rInfo.maPageSize.Width() - rPage.GetLeftPageBorder() - rPage.GetRightPageBorder());
const long nPageHeight (
- rInfo.maPageSize.Height() - rPage.GetUppBorder() - rPage.GetLwrBorder());
+ rInfo.maPageSize.Height() - rPage.GetTopPageBorder() - rPage.GetBottomPageBorder());
#if 0
Point aOrigin (
nPageWidth < rInfo.maPrintSize.Width() ? -aPageOffset.X() : 0,
diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx
index 19fa0b1f878a..b7fb6b22dab0 100644
--- a/sd/source/ui/view/GraphicObjectBar.cxx
+++ b/sd/source/ui/view/GraphicObjectBar.cxx
@@ -70,9 +70,6 @@ SFX_IMPL_INTERFACE( GraphicObjectBar, SfxShell, SdResId( STR_GRAFOBJECTBARSHELL
{
}
-// -----------------------------------------------------------------------------
-
-TYPEINIT1( GraphicObjectBar, SfxShell );
// -----------------------------------------------------------------------------
@@ -123,16 +120,8 @@ void GraphicObjectBar::Execute( SfxRequest& rReq )
void GraphicObjectBar::GetFilterState( SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- sal_Bool bEnable = sal_False;
-
- if( rMarkList.GetMarkCount() == 1 )
- {
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-
- if( pObj && pObj->ISA( SdrGrafObj ) && ( ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) )
- bEnable = sal_True;
- }
+ const SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >(mpView->getSelectedIfSingle());
+ const bool bEnable(pObj && GRAPHIC_BITMAP == pObj->GetGraphicType());
if( !bEnable )
SvxGraphicFilter::DisableGraphicFilterSlots( rSet );
@@ -142,36 +131,26 @@ void GraphicObjectBar::GetFilterState( SfxItemSet& rSet )
void GraphicObjectBar::ExecuteFilter( SfxRequest& rReq )
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+ SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >(mpView->getSelectedIfSingle());
- if( rMarkList.GetMarkCount() == 1 )
+ if( pObj && GRAPHIC_BITMAP == pObj->GetGraphicType())
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ GraphicObject aFilterObj( pObj->GetGraphicObject() );
- if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
+ if( SVX_GRAPHICFILTER_ERRCODE_NONE == SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) )
{
- GraphicObject aFilterObj( ( (SdrGrafObj*) pObj )->GetGraphicObject() );
-
- if( SVX_GRAPHICFILTER_ERRCODE_NONE ==
- SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) )
- {
- SdrPageView* pPageView = mpView->GetSdrPageView();
-
- if( pPageView )
- {
- SdrGrafObj* pFilteredObj = (SdrGrafObj*) pObj->Clone();
- String aStr( mpView->GetDescriptionOfMarkedObjects() );
-
- aStr.Append( sal_Unicode(' ') );
- aStr.Append( String( SdResId( STR_UNDO_GRAFFILTER ) ) );
- mpView->BegUndo( aStr );
- pFilteredObj->SetGraphicObject( aFilterObj );
- ::sd::View* const pView = mpView;
- pView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
- pView->EndUndo();
- return;
- }
- }
+ SdrGrafObj* pFilteredObj = static_cast< SdrGrafObj* >(pObj->CloneSdrObject());
+ String aStr;
+
+ pObj->TakeObjNameSingul(aStr);
+ aStr.Append( sal_Unicode(' ') );
+ aStr.Append( String( SdResId( STR_UNDO_GRAFFILTER ) ) );
+ mpView->BegUndo( aStr );
+ pFilteredObj->SetGraphicObject( aFilterObj );
+ ::sd::View* const pView = mpView;
+ pView->ReplaceObjectAtView( *pObj, *pFilteredObj );
+ pView->EndUndo();
+ return;
}
}
diff --git a/sd/source/ui/view/GraphicViewShellBase.cxx b/sd/source/ui/view/GraphicViewShellBase.cxx
index d666c52009d8..537f3e29f8f7 100644
--- a/sd/source/ui/view/GraphicViewShellBase.cxx
+++ b/sd/source/ui/view/GraphicViewShellBase.cxx
@@ -36,8 +36,6 @@
namespace sd {
-TYPEINIT1(GraphicViewShellBase, ViewShellBase);
-
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
// new GraphicViewShellBase object has been constructed.
diff --git a/sd/source/ui/view/ImpressViewShellBase.cxx b/sd/source/ui/view/ImpressViewShellBase.cxx
index efc762baea6a..e46411fbc139 100644
--- a/sd/source/ui/view/ImpressViewShellBase.cxx
+++ b/sd/source/ui/view/ImpressViewShellBase.cxx
@@ -36,8 +36,6 @@
namespace sd {
-TYPEINIT1(ImpressViewShellBase, ViewShellBase);
-
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
// new ImpressViewShellBase object has been constructed.
diff --git a/sd/source/ui/view/MediaObjectBar.cxx b/sd/source/ui/view/MediaObjectBar.cxx
index ab8e9b534811..94b85f9a2f0a 100644
--- a/sd/source/ui/view/MediaObjectBar.cxx
+++ b/sd/source/ui/view/MediaObjectBar.cxx
@@ -58,10 +58,6 @@ namespace sd {
// - MediaObjectBar -
// ------------------
-TYPEINIT1( MediaObjectBar, SfxShell );
-
-// -----------------------------------------------------------------------------
-
SFX_IMPL_INTERFACE( MediaObjectBar, SfxShell, SdResId( STR_MEDIAOBJECTBARSHELL ) )
{
}
@@ -93,37 +89,29 @@ MediaObjectBar::~MediaObjectBar()
void MediaObjectBar::GetState( SfxItemSet& rSet )
{
- SfxWhichIter aIter( rSet );
- sal_uInt16 nWhich = aIter.FirstWhich();
+ SdrMediaObj* pObj = mpView ? dynamic_cast< SdrMediaObj* >(mpView->getSelectedIfSingle()) : 0;
- while( nWhich )
+ if(pObj)
{
- if( SID_AVMEDIA_TOOLBOX == nWhich )
- {
- SdrMarkList* pMarkList = new SdrMarkList( mpView->GetMarkedObjectList() );
- bool bDisable = true;
+ SfxWhichIter aIter( rSet );
+ sal_uInt16 nWhich = aIter.FirstWhich();
+ bool bDisable = true;
- if( 1 == pMarkList->GetMarkCount() )
+ while( nWhich )
+ {
+ if( SID_AVMEDIA_TOOLBOX == nWhich )
{
- SdrObject* pObj =pMarkList->GetMark( 0 )->GetMarkedSdrObj();
-
- if( pObj && pObj->ISA( SdrMediaObj ) )
- {
- ::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX );
-
- static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).updateMediaItem( aItem );
- rSet.Put( aItem );
- bDisable = false;
- }
+ ::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX );
+ static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).updateMediaItem( aItem );
+ rSet.Put( aItem );
+ bDisable = false;
}
- if( bDisable )
- rSet.DisableItem( SID_AVMEDIA_TOOLBOX );
-
- delete pMarkList;
+ nWhich = aIter.NextWhich();
}
- nWhich = aIter.NextWhich();
+ if( bDisable )
+ rSet.DisableItem( SID_AVMEDIA_TOOLBOX );
}
}
@@ -133,28 +121,21 @@ void MediaObjectBar::Execute( SfxRequest& rReq )
{
if( SID_AVMEDIA_TOOLBOX == rReq.GetSlot() )
{
- const SfxItemSet* pArgs = rReq.GetArgs();
- const SfxPoolItem* pItem;
-
- if( !pArgs || ( SFX_ITEM_SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, sal_False, &pItem ) ) )
- pItem = NULL;
+ SdrMediaObj* pObj = dynamic_cast< SdrMediaObj* >(mpView->getSelectedIfSingle());
- if( pItem )
+ if(pObj)
{
- SdrMarkList* pMarkList = new SdrMarkList( mpView->GetMarkedObjectList() );
+ const SfxItemSet* pArgs = rReq.GetArgs();
+ const SfxPoolItem* pItem;
- if( 1 == pMarkList->GetMarkCount() )
- {
- SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
+ if( !pArgs || ( SFX_ITEM_SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, false, &pItem ) ) )
+ pItem = NULL;
- if( pObj && pObj->ISA( SdrMediaObj ) )
- {
- static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem(
- static_cast< const ::avmedia::MediaItem& >( *pItem ) );
- }
+ if( pItem && mpView )
+ {
+ static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem(
+ static_cast< const ::avmedia::MediaItem& >( *pItem ) );
}
-
- delete pMarkList;
}
}
}
diff --git a/sd/source/ui/view/OutlineViewShellBase.cxx b/sd/source/ui/view/OutlineViewShellBase.cxx
index 2388db20f10b..065292a9cd02 100644
--- a/sd/source/ui/view/OutlineViewShellBase.cxx
+++ b/sd/source/ui/view/OutlineViewShellBase.cxx
@@ -34,8 +34,6 @@ namespace sd {
class DrawDocShell;
-TYPEINIT1(OutlineViewShellBase, ViewShellBase);
-
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
// new OutlineViewShellBase object has been constructed.
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e3289092858b..d2790b87321e 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -75,6 +75,7 @@
#include "framework/FrameworkHelper.hxx"
#include <svx/svxids.hrc>
#include <editeng/editerr.hxx>
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -150,13 +151,13 @@ Outliner::Outliner( SdDrawDocument* pDoc, sal_uInt16 nMode )
mpDrawDocument(pDoc),
mnConversionLanguage(LANGUAGE_NONE),
mnIgnoreCurrentPageChangesLevel(0),
- mbStringFound(sal_False),
+ mbStringFound(false),
mbMatchMayExist(false),
mnPageCount(0),
mnObjectCount(0),
- mbEndOfSearch(sal_False),
- mbFoundObject(sal_False),
- mbError(sal_False),
+ mbEndOfSearch(false),
+ mbFoundObject(false),
+ mbError(false),
mbDirectionIsForward(true),
mbRestrictSearchToSelection(false),
maMarkListCopy(),
@@ -192,7 +193,7 @@ Outliner::Outliner( SdDrawDocument* pDoc, sal_uInt16 nMode )
nCntrl |= EE_CNTRL_MARKFIELDS;
nCntrl |= EE_CNTRL_AUTOCORRECT;
- sal_Bool bOnlineSpell = false;
+ bool bOnlineSpell = false;
DrawDocShell* pDocSh = mpDrawDocument->GetDocSh();
@@ -275,21 +276,21 @@ void Outliner::PrepareSpelling (void)
{
mbPrepareSpellingPending = false;
- ViewShellBase* pBase = PTR_CAST(ViewShellBase,SfxViewShell::Current());
- if (pBase != NULL)
- SetViewShell (pBase->GetMainViewShell());
+ ViewShellBase* pBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current());
+ if (pBase)
+ SetViewShell(pBase->GetMainViewShell());
SetRefDevice( SD_MOD()->GetRefDevice( *mpDrawDocument->GetDocSh() ) );
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
- if (pViewShell)
+ ::boost::shared_ptr< ViewShell > pViewShell (mpWeakViewShell.lock());
+ if(pViewShell)
{
- mbStringFound = sal_False;
+ mbStringFound = false;
mbWholeDocumentProcessed = false;
// Supposed that we are not located at the very beginning/end of
// the document then there may be a match in the document
// prior/after the current position.
- mbMatchMayExist = sal_True;
+ mbMatchMayExist = true;
maObjectIterator = ::sd::outliner::Iterator();
maSearchStartPosition = ::sd::outliner::Iterator();
@@ -325,11 +326,11 @@ void Outliner::StartSpelling(EditView& rView, unsigned char c)
void Outliner::EndSpelling (void)
{
// Keep old view shell alive until we release the outliner view.
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
- ::boost::shared_ptr<ViewShell> pOldViewShell (pViewShell);
+ ::boost::shared_ptr< ViewShell > pViewShell (mpWeakViewShell.lock());
+ ::boost::shared_ptr< ViewShell > pOldViewShell (pViewShell);
- ViewShellBase* pBase = PTR_CAST(ViewShellBase,SfxViewShell::Current());
- if (pBase != NULL)
+ ViewShellBase* pBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current());
+ if (pBase)
pViewShell = pBase->GetMainViewShell();
else
pViewShell.reset();
@@ -337,12 +338,12 @@ void Outliner::EndSpelling (void)
// When in <member>PrepareSpelling()</member> a new outline view has
// been created then delete it here.
- sal_Bool bViewIsDrawViewShell(pViewShell && pViewShell->ISA(DrawViewShell));
+ const bool bViewIsDrawViewShell(dynamic_cast< DrawViewShell* >(pViewShell.get()));
if (bViewIsDrawViewShell)
{
SetStatusEventHdl(Link());
mpView = pViewShell->GetView();
- mpView->UnmarkAllObj (mpView->GetSdrPageView());
+ mpView->UnmarkAllObj();
mpView->SdrEndTextEdit();
// Make FuSelection the current function.
pViewShell->GetDispatcher()->Execute(
@@ -358,15 +359,29 @@ void Outliner::EndSpelling (void)
mpImpl->ReleaseOutlinerView();
}
- SetUpdateMode(sal_True);
+ SetUpdateMode(true);
+ }
+
+ // Remove and, if previously created by us, delete the outline
+ // view.
+ OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ if (pOutlinerView != NULL)
+ {
+ RemoveView(pOutlinerView);
+ mpImpl->ReleaseOutlinerView();
}
+ SetUpdateMode(sal_True);
+
// #95811# Before clearing the modify flag use it as a hint that
// changes were done at SpellCheck
if(IsModified())
{
- if(mpView && mpView->ISA(OutlineView))
- static_cast<OutlineView*>(mpView)->PrepareClose(sal_False);
+ OutlineView* pOutlineView = dynamic_cast< OutlineView* >(mpView);
+
+ if(pOutlineView)
+ pOutlineView->PrepareClose(sal_False);
+
if(mpDrawDocument && !mpDrawDocument->IsChanged())
mpDrawDocument->SetChanged(sal_True);
}
@@ -389,8 +404,9 @@ void Outliner::EndSpelling (void)
sal_Bool Outliner::SpellNextDocument (void)
{
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
- if (pViewShell->ISA(OutlineViewShell))
+ ::boost::shared_ptr< ViewShell > pViewShell(mpWeakViewShell.lock());
+
+ if (dynamic_cast< OutlineViewShell* >(pViewShell.get()))
{
// When doing a spell check in the outline view then there is
// only one document.
@@ -399,9 +415,12 @@ sal_Bool Outliner::SpellNextDocument (void)
}
else
{
- if (mpView->ISA(OutlineView))
- ((OutlineView*)mpView)->PrepareClose(sal_False);
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_True );
+ OutlineView* pOutlineView = dynamic_cast< OutlineView* >(mpView);
+
+ if (pOutlineView)
+ pOutlineView->PrepareClose(false);
+
+ mpDrawDocument->GetDocSh()->SetWaitCursor( true );
Initialize (true);
@@ -411,12 +430,11 @@ sal_Bool Outliner::SpellNextDocument (void)
pOutlinerView->SetWindow(mpWindow);
ProvideNextTextObject ();
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False );
+ mpDrawDocument->GetDocSh()->SetWaitCursor( false );
ClearModifyFlag();
}
- return mbEndOfSearch ? sal_False : sal_True;
-
+ return mbEndOfSearch ? false : true;
}
@@ -475,12 +493,12 @@ sal_Bool Outliner::SpellNextDocument (void)
*/
bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
{
- sal_Bool bEndOfSearch = sal_True;
+ bool bEndOfSearch = true;
mpDrawDocument->GetDocSh()->SetWaitCursor( sal_True );
if (mbPrepareSpellingPending)
PrepareSpelling();
- ViewShellBase* pBase = PTR_CAST(ViewShellBase,SfxViewShell::Current());
+ ViewShellBase* pBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current());
// Determine whether we have to abort the search. This is necessary
// when the main view shell does not support searching.
bool bAbort = false;
@@ -557,7 +575,7 @@ void Outliner::Initialize (bool bDirectionIsForward)
maObjectIterator = ::sd::outliner::OutlinerContainer(this).current();
maCurrentPosition = *maObjectIterator;
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
if ( ! pViewShell)
{
OSL_ASSERT(pViewShell);
@@ -566,7 +584,7 @@ void Outliner::Initialize (bool bDirectionIsForward)
// In case we are searching in an outline view then first remove the
// current selection and place cursor at its start or end.
- if (pViewShell->ISA(OutlineViewShell))
+ if (dynamic_cast< OutlineViewShell* >(pViewShell.get()))
{
ESelection aSelection = mpImpl->GetOutlinerView()->GetSelection ();
if (mbDirectionIsForward)
@@ -621,14 +639,15 @@ bool Outliner::SearchAndReplaceAll (void)
// matches.
RememberStartPosition ();
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
+
if ( ! pViewShell)
{
OSL_ASSERT(pViewShell);
return true;
}
- if (pViewShell->ISA(OutlineViewShell))
+ if (dynamic_cast< OutlineViewShell* >(pViewShell.get()))
{
// Put the cursor to the beginning/end of the outliner.
mpImpl->GetOutlinerView()->SetSelection (GetSearchStartPosition ());
@@ -636,7 +655,7 @@ bool Outliner::SearchAndReplaceAll (void)
// The outliner does all the work for us when we are in this mode.
SearchAndReplaceOnce();
}
- else if (pViewShell->ISA(DrawViewShell))
+ else if (dynamic_cast< DrawViewShell* >(pViewShell.get()))
{
// Go to beginning/end of document.
maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin();
@@ -676,14 +695,15 @@ bool Outliner::SearchAndReplaceOnce (void)
if( NULL == pOutlinerView || !GetEditEngine().HasView( &pOutlinerView->GetEditView() ) )
return true;
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
- if (pViewShell != NULL)
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
+
+ if (pViewShell)
{
mpView = pViewShell->GetView();
mpWindow = pViewShell->GetActiveWindow();
pOutlinerView->SetWindow(mpWindow);
- if (pViewShell->ISA(DrawViewShell) )
+ if (dynamic_cast< DrawViewShell* >(pViewShell.get()) )
{
// When replacing we first check if there is a selection
// indicating a match. If there is then replace it. The
@@ -719,7 +739,7 @@ bool Outliner::SearchAndReplaceOnce (void)
"SearchAndReplace without valid view!" );
if ( ! GetEditEngine().HasView( &pOutlinerView->GetEditView() ) )
{
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False );
+ mpDrawDocument->GetDocSh()->SetWaitCursor( false );
return true;
}
@@ -728,9 +748,9 @@ bool Outliner::SearchAndReplaceOnce (void)
}
}
}
- else if (pViewShell->ISA(OutlineViewShell))
+ else if (dynamic_cast< OutlineViewShell* >(pViewShell.get()))
{
- mpDrawDocument->GetDocSh()->SetWaitCursor (sal_False);
+ mpDrawDocument->GetDocSh()->SetWaitCursor (false);
// The following loop is executed more then once only when a
// wrap arround search is done.
while (true)
@@ -751,7 +771,7 @@ bool Outliner::SearchAndReplaceOnce (void)
}
}
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False );
+ mpDrawDocument->GetDocSh()->SetWaitCursor( false );
return mbEndOfSearch;
}
@@ -777,12 +797,9 @@ void Outliner::DetectChange (void)
{
// Either the edit mode or the page kind has changed.
SetStatusEventHdl(Link());
-
- SdrPageView* pPageView = mpView->GetSdrPageView();
- if (pPageView != NULL)
- mpView->UnmarkAllObj (pPageView);
+ mpView->UnmarkAllObj();
mpView->SdrEndTextEdit();
- SetUpdateMode(sal_False);
+ SetUpdateMode(false);
OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
if (pOutlinerView != NULL)
pOutlinerView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
@@ -827,34 +844,35 @@ void Outliner::DetectChange (void)
bool Outliner::DetectSelectionChange (void)
{
- bool bSelectionHasChanged = false;
- sal_uLong nMarkCount = mpView->GetMarkedObjectList().GetMarkCount();
+ bool bSelectionHasChanged(false);
- // If mpObj is NULL then we have not yet found our first match.
- // Detecting a change makes no sense.
- if (mpObj != NULL)
- switch (nMarkCount)
+ if(mpObj)
+ {
+ SdrObject* pSingleSelected = mpView->getSelectedIfSingle();
+
+ if(pSingleSelected)
{
- case 0:
- // The selection has changed when previously there have been
- // selected objects.
- bSelectionHasChanged = mbRestrictSearchToSelection;
- break;
- case 1:
// Check if the only selected object is not the one that we
// had selected.
- if (mpView != NULL)
- {
- SdrMark* pMark = mpView->GetMarkedObjectList().GetMark(0);
- if (pMark != NULL)
- bSelectionHasChanged = (mpObj != pMark->GetMarkedSdrObj ());
- }
- break;
- default:
+ bSelectionHasChanged = mpObj != pSingleSelected;
+ }
+ else
+ {
+ const SdrObjectVector aSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSelection.size())
+ {
// We had selected exactly one object.
bSelectionHasChanged = true;
- break;
+ }
+ else
+ {
+ // The selection has changed when previously there have been
+ // selected objects.
+ bSelectionHasChanged = mbRestrictSearchToSelection;
+ }
}
+ }
return bSelectionHasChanged;
}
@@ -864,14 +882,15 @@ bool Outliner::DetectSelectionChange (void)
void Outliner::RememberStartPosition (void)
{
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
+
if ( ! pViewShell)
{
OSL_ASSERT(pViewShell);
return;
}
- if (pViewShell->ISA(DrawViewShell))
+ if (dynamic_cast< DrawViewShell* >(pViewShell.get()))
{
::boost::shared_ptr<DrawViewShell> pDrawViewShell (
::boost::dynamic_pointer_cast<DrawViewShell>(pViewShell));
@@ -899,7 +918,7 @@ void Outliner::RememberStartPosition (void)
}
}
}
- else if (pViewShell->ISA(OutlineViewShell))
+ else if (dynamic_cast< OutlineViewShell* >(pViewShell.get()))
{
// Remember the current cursor position.
OutlinerView* pView = GetView(0);
@@ -922,14 +941,16 @@ void Outliner::RestoreStartPosition (void)
// start position is not requested.
if (mnStartPageIndex == (sal_uInt16)-1 )
bRestore = false;
+
// Dont't restore when the view shell is not valid.
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
+
if (pViewShell == NULL)
bRestore = false;
if (bRestore)
{
- if (pViewShell->ISA(DrawViewShell))
+ if (dynamic_cast< DrawViewShell* >(pViewShell.get()))
{
::boost::shared_ptr<DrawViewShell> pDrawViewShell (
::boost::dynamic_pointer_cast<DrawViewShell>(pViewShell));
@@ -957,7 +978,7 @@ void Outliner::RestoreStartPosition (void)
}
}
}
- else if (pViewShell->ISA(OutlineViewShell))
+ else if (dynamic_cast< OutlineViewShell* >(pViewShell.get()))
{
// Set cursor to its old position.
OutlinerView* pView = GetView(0);
@@ -975,14 +996,14 @@ void Outliner::RestoreStartPosition (void)
until a text object has been found that contains at least one match or
until no such object can be found anymore. These two conditions are
expressed by setting one of the flags <member>mbFoundObject</member> or
- <member>mbEndOfSearch</member> to <TRUE/>.
+ <member>mbEndOfSearch</member> to <true/>.
*/
void Outliner::ProvideNextTextObject (void)
{
mbEndOfSearch = false;
mbFoundObject = false;
- mpView->UnmarkAllObj (mpView->GetSdrPageView());
+ mpView->UnmarkAllObj();
try
{
mpView->SdrEndTextEdit();
@@ -991,7 +1012,7 @@ void Outliner::ProvideNextTextObject (void)
{
DBG_UNHANDLED_EXCEPTION();
}
- SetUpdateMode(sal_False);
+ SetUpdateMode(false);
OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
if (pOutlinerView != NULL)
pOutlinerView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
@@ -1051,7 +1072,8 @@ void Outliner::ProvideNextTextObject (void)
void Outliner::EndOfSearch (void)
{
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
+
if ( ! pViewShell)
{
OSL_ASSERT(pViewShell);
@@ -1061,7 +1083,7 @@ void Outliner::EndOfSearch (void)
// Before we display a dialog we first jump to where the last valid text
// object was found. All page and view mode switching since then was
// temporary and should not be visible to the user.
- if ( ! pViewShell->ISA(OutlineViewShell))
+ if ( ! dynamic_cast< OutlineViewShell* >(pViewShell.get()))
SetObject (maLastValidPosition);
if (mbRestrictSearchToSelection)
@@ -1072,7 +1094,7 @@ void Outliner::EndOfSearch (void)
if ( ! mbMatchMayExist)
{
ShowEndOfSearchDialog ();
- mbEndOfSearch = sal_True;
+ mbEndOfSearch = true;
}
// Ask the user whether to wrap arround and continue the search or
// to terminate.
@@ -1081,7 +1103,7 @@ void Outliner::EndOfSearch (void)
mbMatchMayExist = false;
// Everything back to beginning (or end?) of the document.
maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin();
- if (pViewShell->ISA(OutlineViewShell))
+ if (dynamic_cast< OutlineViewShell* >(pViewShell.get()))
{
// Set cursor to first character of the document.
OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
@@ -1111,7 +1133,7 @@ void Outliner::ShowEndOfSearchDialog (void)
}
else
{
- if (mpView->AreObjectsMarked())
+ if (mpView->areSdrObjectsSelected())
aString = String(SdResId(STR_END_SPELLING_OBJ));
else
aString = String(SdResId(STR_END_SPELLING));
@@ -1148,7 +1170,7 @@ bool Outliner::ShowWrapArroundDialog (void)
if (bShowDialog)
{
// The question text depends on the search direction.
- sal_Bool bImpress = mpDrawDocument!=NULL
+ bool bImpress = mpDrawDocument!=NULL
&& mpDrawDocument->GetDocumentType() == DOCUMENT_TYPE_IMPRESS;
sal_uInt16 nStringId;
if (mbDirectionIsForward)
@@ -1217,8 +1239,8 @@ void Outliner::PrepareSpellCheck (void)
if (eState == EE_SPELL_NOLANGUAGE)
{
- mbError = sal_True;
- mbEndOfSearch = sal_True;
+ mbError = true;
+ mbEndOfSearch = true;
ErrorBox aErrorBox (NULL,
WB_OK,
String(SdResId(STR_NOLANGUAGE)));
@@ -1240,7 +1262,7 @@ void Outliner::PrepareSpellCheck (void)
}
}
- EnterEditMode( sal_False );
+ EnterEditMode( false );
}
}
@@ -1256,7 +1278,7 @@ void Outliner::PrepareSearchAndReplace (void)
EnterEditMode ();
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False );
+ mpDrawDocument->GetDocSh()->SetWaitCursor( false );
// Start seach at the right end of the current object's text
// depending on the search direction.
OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
@@ -1276,7 +1298,7 @@ void Outliner::SetViewMode (PageKind ePageKind)
if (pDrawViewShell.get()!=NULL && ePageKind != pDrawViewShell->GetPageKind())
{
// Restore old edit mode.
- pDrawViewShell->ChangeEditMode(mpImpl->meOriginalEditMode, sal_False);
+ pDrawViewShell->ChangeEditMode(mpImpl->meOriginalEditMode, false);
SetStatusEventHdl(Link());
::rtl::OUString sViewURL;
@@ -1345,7 +1367,7 @@ void Outliner::SetPage (EditMode eEditMode, sal_uInt16 nPageIndex)
OSL_ASSERT(pDrawViewShell.get()!=NULL);
if (pDrawViewShell.get() != NULL)
{
- pDrawViewShell->ChangeEditMode(eEditMode, sal_False);
+ pDrawViewShell->ChangeEditMode(eEditMode, false);
pDrawViewShell->SwitchPage(nPageIndex);
}
}
@@ -1354,14 +1376,13 @@ void Outliner::SetPage (EditMode eEditMode, sal_uInt16 nPageIndex)
-void Outliner::EnterEditMode (sal_Bool bGrabFocus)
+void Outliner::EnterEditMode (bool bGrabFocus)
{
OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
if (pOutlinerView != NULL)
{
pOutlinerView->SetOutputArea( Rectangle( Point(), Size(1, 1)));
- SetPaperSize( mpTextObj->GetLogicRect().GetSize() );
- SdrPageView* pPV = mpView->GetSdrPageView();
+ SetPaperSize( sdr::legacy::GetLogicRect(*mpTextObj).GetSize() );
// Make FuText the current function.
SfxUInt16Item aItem (SID_TEXTEDIT, 1);
@@ -1375,17 +1396,17 @@ void Outliner::EnterEditMode (sal_Bool bGrabFocus)
// Starting the text edit mode is not enough so we do it here by
// hand.
mbExpectingSelectionChangeEvent = true;
- mpView->UnmarkAllObj (pPV);
- mpView->MarkObj (mpTextObj, pPV);
+ mpView->UnmarkAllObj();
+ mpView->MarkObj(*mpTextObj);
if( mpTextObj )
mpTextObj->setActiveText( mnText );
// Turn on the edit mode for the text object.
- mpView->SdrBeginTextEdit(mpTextObj, pPV, mpWindow, sal_True, this, pOutlinerView, sal_True, sal_True, bGrabFocus);
+ mpView->SdrBeginTextEdit(mpTextObj, mpWindow, sal_True, this, pOutlinerView, sal_True, sal_True, bGrabFocus);
- SetUpdateMode(sal_True);
- mbFoundObject = sal_True;
+ SetUpdateMode(true);
+ mbFoundObject = true;
}
}
@@ -1448,7 +1469,7 @@ bool Outliner::HasNoPreviousMatch (void)
// Detect whether the cursor stands at the beginning
// resp. at the end of the text.
- return pOutlinerView->GetSelection().IsEqual(GetSearchStartPosition ()) == sal_True;
+ return pOutlinerView->GetSelection().IsEqual(GetSearchStartPosition ());
}
@@ -1533,22 +1554,18 @@ void Outliner::SetViewShell (const ::boost::shared_ptr<ViewShell>& rpViewShell)
void Outliner::HandleChangedSelection (void)
{
maMarkListCopy.clear();
- mbRestrictSearchToSelection = (mpView->AreObjectsMarked()==sal_True);
+ mbRestrictSearchToSelection = (mpView->areSdrObjectsSelected()==true);
+
if (mbRestrictSearchToSelection)
{
// Make a copy of the current mark list.
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- sal_uLong nCount = rMarkList.GetMarkCount();
- if (nCount > 0)
+ maMarkListCopy = mpView->getSelectedSdrObjectVectorFromSdrMarkView();
+
+ if(!maMarkListCopy.size())
{
- maMarkListCopy.clear();
- maMarkListCopy.reserve (nCount);
- for (sal_uLong i=0; i<nCount; i++)
- maMarkListCopy.push_back (rMarkList.GetMark(i)->GetMarkedSdrObj ());
- }
- else
// No marked object. Is this case possible?
mbRestrictSearchToSelection = false;
+ }
}
}
@@ -1557,10 +1574,10 @@ void Outliner::HandleChangedSelection (void)
void Outliner::StartConversion( sal_Int16 nSourceLanguage, sal_Int16 nTargetLanguage,
- const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive )
+ const Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive )
{
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
- sal_Bool bMultiDoc = pViewShell->ISA(DrawViewShell);
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
+ const bool bMultiDoc = dynamic_cast< DrawViewShell* >(pViewShell.get());
meMode = TEXT_CONVERSION;
mbDirectionIsForward = true;
@@ -1596,12 +1613,12 @@ void Outliner::PrepareConversion (void)
if( HasConvertibleTextPortion( mnConversionLanguage ) )
{
SetUpdateMode(sal_False);
- mbStringFound = sal_True;
- mbMatchMayExist = sal_True;
+ mbStringFound = true;
+ mbMatchMayExist = true;
EnterEditMode ();
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False );
+ mpDrawDocument->GetDocSh()->SetWaitCursor( false );
// Start seach at the right end of the current object's text
// depending on the search direction.
// mpOutlineView->SetSelection (GetSearchStartPosition ());
@@ -1619,19 +1636,19 @@ void Outliner::BeginConversion (void)
{
SetRefDevice( SD_MOD()->GetRefDevice( *mpDrawDocument->GetDocSh() ) );
- ViewShellBase* pBase = PTR_CAST(ViewShellBase, SfxViewShell::Current());
+ ViewShellBase* pBase = dynamic_cast< ViewShellBase* >(SfxViewShell::Current());
if (pBase != NULL)
SetViewShell (pBase->GetMainViewShell());
::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
if (pViewShell)
{
- mbStringFound = sal_False;
+ mbStringFound = false;
// Supposed that we are not located at the very beginning/end of the
// document then there may be a match in the document prior/after
// the current position.
- mbMatchMayExist = sal_True;
+ mbMatchMayExist = true;
maObjectIterator = ::sd::outliner::Iterator();
maSearchStartPosition = ::sd::outliner::Iterator();
@@ -1657,11 +1674,12 @@ void Outliner::EndConversion()
sal_Bool Outliner::ConvertNextDocument()
{
- ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
- if (pViewShell && pViewShell->ISA(OutlineViewShell) )
+ ::boost::shared_ptr<ViewShell> pViewShell(mpWeakViewShell.lock());
+
+ if( pViewShell && dynamic_cast< OutlineViewShell* >(pViewShell.get()) )
return false;
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_True );
+ mpDrawDocument->GetDocSh()->SetWaitCursor( true );
Initialize ( true );
@@ -1673,7 +1691,7 @@ sal_Bool Outliner::ConvertNextDocument()
}
ProvideNextTextObject ();
- mpDrawDocument->GetDocSh()->SetWaitCursor( sal_False );
+ mpDrawDocument->GetDocSh()->SetWaitCursor( false );
ClearModifyFlag();
// for text conversion we automaticly wrap around one
@@ -1725,13 +1743,13 @@ sal_uInt16 Outliner::ShowModalMessageBox (Dialog& rMessageBox)
if (pChildWindow != NULL)
pSearchDialog = pChildWindow->GetWindow();
if (pSearchDialog != NULL)
- pSearchDialog->EnableInput(sal_False,sal_True);
+ pSearchDialog->EnableInput(false,true);
sal_uInt16 nResult = rMessageBox.Execute();
// Unlock the search dialog.
if (pSearchDialog != NULL)
- pSearchDialog->EnableInput(sal_True,sal_True);
+ pSearchDialog->EnableInput(true,true);
return nResult;
}
@@ -1808,7 +1826,7 @@ void Outliner::Implementation::ProvideOutlinerView (
mpOutlineView->SetControlWord(nStat);
if (bInsert)
rOutliner.InsertView( mpOutlineView );
- rOutliner.SetUpdateMode(sal_False);
+ rOutliner.SetUpdateMode(false);
mpOutlineView->SetOutputArea (Rectangle (Point(), Size(1, 1)));
rOutliner.SetPaperSize( Size(1, 1) );
rOutliner.SetText( String(), rOutliner.GetParagraph( 0 ) );
diff --git a/sd/source/ui/view/OutlinerIterator.cxx b/sd/source/ui/view/OutlinerIterator.cxx
index c87294dfac8d..421ea30d0fc7 100644
--- a/sd/source/ui/view/OutlinerIterator.cxx
+++ b/sd/source/ui/view/OutlinerIterator.cxx
@@ -209,7 +209,7 @@ Iterator OutlinerContainer::CreateIterator (IteratorLocation aLocation)
}
Iterator OutlinerContainer::CreateSelectionIterator (
- const ::std::vector<SdrObjectWeakRef>& rObjectList,
+ const SdrObjectVector& rObjectList,
SdDrawDocument* pDocument,
const ::boost::shared_ptr<ViewShell>& rpViewShell,
bool bDirectionIsForward,
@@ -349,7 +349,7 @@ sal_Int32 OutlinerContainer::GetPageIndex (
{
const SdPage* pPage = rpViewShell->GetActualPage();
if (pPage != NULL)
- nPageIndex = (pPage->GetPageNum()-1)/2;
+ nPageIndex = (pPage->GetPageNumber()-1)/2;
else
nPageIndex = 0;
}
@@ -463,7 +463,7 @@ void IteratorImplBase::Reverse (void)
//===== SelectionIteratorImpl ===========================================
SelectionIteratorImpl::SelectionIteratorImpl (
- const ::std::vector<SdrObjectWeakRef>& rObjectList,
+ const SdrObjectVector& rObjectList,
sal_Int32 nObjectIndex,
SdDrawDocument* pDocument,
const ::boost::weak_ptr<ViewShell>& rpViewShellWeak,
@@ -489,7 +489,7 @@ IteratorImplBase* SelectionIteratorImpl::Clone (IteratorImplBase* pObject) const
void SelectionIteratorImpl::GotoNextText (void)
{
- SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mrObjectList.at(mnObjectIndex).get() );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mrObjectList[mnObjectIndex] );
if (mbDirectionIsForward)
{
if( pTextObj )
@@ -525,7 +525,7 @@ void SelectionIteratorImpl::GotoNextText (void)
if( (maPosition.mnText == -1) && (mnObjectIndex >= 0) )
{
- pTextObj = dynamic_cast< SdrTextObj* >( mrObjectList.at(mnObjectIndex).get() );
+ pTextObj = dynamic_cast< SdrTextObj* >( mrObjectList[mnObjectIndex] );
if( pTextObj )
maPosition.mnText = pTextObj->getTextCount() - 1;
}
@@ -538,7 +538,7 @@ void SelectionIteratorImpl::GotoNextText (void)
const IteratorPosition& SelectionIteratorImpl::GetPosition (void)
{
- maPosition.mxObject = mrObjectList.at(mnObjectIndex);
+ maPosition.mxObject = mrObjectList[mnObjectIndex];
return maPosition;
}
@@ -712,11 +712,11 @@ void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex)
{
if (maPosition.meEditMode == EM_PAGE)
mpPage = mpDocument->GetSdPage (
- (sal_uInt16)nPageIndex,
+ (sal_uInt32)nPageIndex,
maPosition.mePageKind);
else
mpPage = mpDocument->GetMasterSdPage (
- (sal_uInt16)nPageIndex,
+ (sal_uInt32)nPageIndex,
maPosition.mePageKind);
}
else
diff --git a/sd/source/ui/view/PresentationViewShellBase.cxx b/sd/source/ui/view/PresentationViewShellBase.cxx
index d728856b5ec2..a3c786c43bc3 100644
--- a/sd/source/ui/view/PresentationViewShellBase.cxx
+++ b/sd/source/ui/view/PresentationViewShellBase.cxx
@@ -43,8 +43,6 @@ namespace sd {
class DrawDocShell;
-TYPEINIT1(PresentationViewShellBase, ViewShellBase);
-
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
// new PresentationViewShellBase object has been constructed.
diff --git a/sd/source/ui/view/SlideSorterViewShellBase.cxx b/sd/source/ui/view/SlideSorterViewShellBase.cxx
index c02aecb58580..902fdca7c597 100644
--- a/sd/source/ui/view/SlideSorterViewShellBase.cxx
+++ b/sd/source/ui/view/SlideSorterViewShellBase.cxx
@@ -34,8 +34,6 @@ namespace sd {
class DrawDocShell;
-TYPEINIT1(SlideSorterViewShellBase, ViewShellBase);
-
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
// new SlideSorterViewShellBase object has been constructed.
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index 73ea33ddc795..6bbaca06c4b4 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -1083,7 +1083,7 @@ bool ToolBarManager::Implementation::CheckPlugInMode (const ::rtl::OUString& rsN
if (pMedium == NULL)
break;
- SFX_ITEMSET_ARG(pMedium->GetItemSet(),pViewOnlyItem,SfxBoolItem,SID_VIEWONLY,sal_False);
+ SFX_ITEMSET_ARG(pMedium->GetItemSet(),pViewOnlyItem,SfxBoolItem,SID_VIEWONLY);
if (pViewOnlyItem == NULL)
break;
diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx
index 9f8c57cc3642..baada9eee392 100644
--- a/sd/source/ui/view/ViewClipboard.cxx
+++ b/sd/source/ui/view/ViewClipboard.cxx
@@ -99,12 +99,12 @@ SdPage* ViewClipboard::GetFirstMasterPage (const SdTransferable& rTransferable)
for (int nIndex=0; nIndex<nBookmarkCount; nIndex++)
{
String sName (*(String*) pBookmarks->GetObject(nIndex));
- sal_Bool bIsMasterPage;
+ bool bIsMasterPage;
// SdPage* GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
// sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const;
- sal_uInt16 nBMPage = pDocument->GetPageByName (
+ sal_uInt32 nBMPage = pDocument->GetPageByName (
sName, bIsMasterPage);
if ( ! bIsMasterPage)
{
@@ -145,10 +145,7 @@ void ViewClipboard::AssignMasterPage (
if (pPageView == NULL)
break;
- SdPage* pPage = static_cast<SdPage*>(pPageView->GetPage());
- if (pPage == NULL)
- break;
-
+ SdPage& rPage = static_cast< SdPage& >(pPageView->getSdrPageFromSdrPageView());
SdDrawDocument* pDocument = mrView.GetDoc();
if (pDocument == NULL)
break;
@@ -175,11 +172,11 @@ void ViewClipboard::AssignMasterPage (
sLayoutName = String(sLayoutName, 0, sLayoutName.Len()-nLength);
pDocument->SetMasterPage (
- pPage->GetPageNum() / 2,
+ rPage.GetPageNumber() / 2,
sLayoutName,
pSourceDocument,
- sal_False, // Exchange the master page of only the target page.
- sal_False // Keep unused master pages.
+ false, // Exchange the master page of only the target page.
+ false // Keep unused master pages.
);
}
while (false);
@@ -192,12 +189,12 @@ sal_uInt16 ViewClipboard::DetermineInsertPosition (
const SdTransferable& )
{
SdDrawDocument* pDoc = mrView.GetDoc();
- sal_uInt16 nPgCnt = pDoc->GetSdPageCount( PK_STANDARD );
+ sal_uInt32 nPgCnt = pDoc->GetSdPageCount( PK_STANDARD );
// Insert position is the behind the last selected page or behind the
// last page when the selection is empty.
- sal_uInt16 nInsertPos = pDoc->GetSdPageCount( PK_STANDARD ) * 2 + 1;
- for( sal_uInt16 nPage = 0; nPage < nPgCnt; nPage++ )
+ sal_uInt32 nInsertPos = pDoc->GetSdPageCount( PK_STANDARD ) * 2 + 1;
+ for( sal_uInt32 nPage = 0; nPage < nPgCnt; nPage++ )
{
SdPage* pPage = pDoc->GetSdPage( nPage, PK_STANDARD );
@@ -218,7 +215,7 @@ sal_uInt16 ViewClipboard::InsertSlides (
SdDrawDocument* pDoc = mrView.GetDoc();
sal_uInt16 nInsertPgCnt = 0;
- sal_Bool bMergeMasterPages = !rTransferable.HasSourceDoc( pDoc );
+ bool bMergeMasterPages = !rTransferable.HasSourceDoc( pDoc );
// Prepare the insertion.
const List* pBookmarkList;
@@ -246,7 +243,7 @@ sal_uInt16 ViewClipboard::InsertSlides (
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
::sd::Window* pWin = mrView.GetViewShell()->GetActiveWindow();
- const sal_Bool bWait = pWin && pWin->IsWait();
+ const bool bWait = pWin && pWin->IsWait();
if( bWait )
pWin->LeaveWait();
@@ -254,14 +251,14 @@ sal_uInt16 ViewClipboard::InsertSlides (
pDoc->InsertBookmarkAsPage(
const_cast<List*>(pBookmarkList),
NULL,
- sal_False,
- sal_False,
+ false,
+ false,
nInsertPosition,
(&rTransferable == SD_MOD()->pTransferDrag),
pDataDocSh,
- sal_True,
+ true,
bMergeMasterPages,
- sal_False);
+ false);
if( bWait )
pWin->EnterWait();
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index a9898e40d935..ad82813a9746 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -167,7 +167,7 @@ public:
/** Show or hide the ViewTabBar.
@param bShow
- When <TRUE/> then the ViewTabBar is shown, otherwise it is hidden.
+ When <true/> then the ViewTabBar is shown, otherwise it is hidden.
*/
void ShowViewTabBar (bool bShow);
@@ -232,8 +232,6 @@ private:
//===== ViewShellBase =========================================================
-TYPEINIT1(ViewShellBase, SfxViewShell);
-
// We have to expand the SFX_IMPL_VIEWFACTORY macro to call LateInit() after a
// new ViewShellBase object has been constructed.
@@ -284,11 +282,11 @@ ViewShellBase::ViewShellBase (
_pFrame->GetWindow().SetBackground(Wallpaper());
// Set up the members in the correct order.
- if (GetViewFrame()->GetObjectShell()->ISA(DrawDocShell))
- mpDocShell = static_cast<DrawDocShell*>(
- GetViewFrame()->GetObjectShell());
- if (mpDocShell != NULL)
+ mpDocShell = dynamic_cast< DrawDocShell* >(GetViewFrame()->GetObjectShell());
+
+ if (mpDocShell )
mpDocument = mpDocShell->GetDoc();
+
mpImpl->mpViewShellManager.reset(new ViewShellManager(*this));
SetWindow(mpImpl->mpViewWindow.get());
@@ -335,8 +333,8 @@ ViewShellBase::~ViewShellBase (void)
void ViewShellBase::LateInit (const ::rtl::OUString& rsDefaultView)
{
- StartListening(*GetViewFrame(),sal_True);
- StartListening(*GetDocShell(),sal_True);
+ StartListening(*GetViewFrame(),true);
+ StartListening(*GetDocShell(),true);
mpImpl->LateInit();
InitializeFramework();
@@ -439,8 +437,7 @@ ViewShellBase* ViewShellBase::GetViewShellBase (SfxViewFrame* pViewFrame)
// Get the view shell for the frame and cast it to
// sd::ViewShellBase.
SfxViewShell* pSfxViewShell = pViewFrame->GetViewShell();
- if (pSfxViewShell!=NULL && pSfxViewShell->ISA(::sd::ViewShellBase))
- pBase = static_cast<ViewShellBase*>(pSfxViewShell);
+ pBase = dynamic_cast< ::sd::ViewShellBase* >(pSfxViewShell);
}
return pBase;
@@ -467,10 +464,11 @@ SdDrawDocument* ViewShellBase::GetDocument (void) const
void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
SfxViewShell::Notify(rBC, rHint);
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
- if (rHint.IsA(TYPE(SfxEventHint)))
+ if(pSfxEventHint)
{
- switch (static_cast<const SfxEventHint&>(rHint).GetEventId())
+ switch(pSfxEventHint->GetEventId())
{
case SFX_EVENT_OPENDOC:
if( GetDocument() && GetDocument()->IsStartWithPresentation() )
@@ -551,7 +549,7 @@ void ViewShellBase::Rearrange (void)
OSL_TRACE("Rearrange: window missing");
}
- GetViewFrame()->Resize(sal_True);
+ GetViewFrame()->Resize(true);
}
@@ -607,9 +605,8 @@ sal_uInt16 ViewShellBase::SetPrinter (
aMap.SetMapUnit(MAP_100TH_MM);
MapMode aOldMap = pNewPrinter->GetMapMode();
pNewPrinter->SetMapMode(aMap);
- Size aNewSize = pNewPrinter->GetOutputSize();
- sal_Bool bScaleAll = sal_False;
+ bool bScaleAll = false;
if ( bIsAPI )
{
WarningBox aWarnBox (
@@ -625,10 +622,15 @@ sal_uInt16 ViewShellBase::SetPrinter (
{
SdPage* pPage = GetDocument()->GetSdPage(
0, PK_STANDARD );
+ const Size aNewSize(pNewPrinter->GetOutputSize());
+
pDrawViewShell->SetPageSizeAndBorder (
pDrawViewShell->GetPageKind(),
- aNewSize,
- -1,-1,-1,-1,
+ basegfx::B2DVector(aNewSize.Width(), aNewSize.Height()),
+ -1.0,
+ -1.0,
+ -1.0,
+ -1.0,
bScaleAll,
pNewPrinter->GetOrientation(),
pPage->GetPaperBin(),
@@ -819,7 +821,7 @@ void ViewShellBase::ReadUserDataSequence (
case ViewShell::ST_HANDOUT:
{
::rtl::OUString sViewURL;
- switch (PTR_CAST(DrawViewShell, pShell)->GetPageKind())
+ switch (dynamic_cast< DrawViewShell* >(pShell)->GetPageKind())
{
default:
case PK_STANDARD:
@@ -892,7 +894,7 @@ sal_uInt16 ViewShellBase::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
{
sal_uInt16 nResult = SfxViewShell::PrepareClose (bUI, bForBrowsing);
- if (nResult == sal_True)
+ if (nResult )
{
mpImpl->mbIsClosing = true;
@@ -1285,10 +1287,9 @@ void ViewShellBase::Implementation::ProcessRestoreEditingViewSlot (void)
void ViewShellBase::Implementation::ShowViewTabBar (bool bShow)
{
- if (mpViewTabBar.is()
- && (mpViewTabBar->GetTabControl()->IsVisible()==sal_True) != bShow)
+ if (mpViewTabBar.is() && (bool)(mpViewTabBar->GetTabControl()->IsVisible()) != bShow)
{
- mpViewTabBar->GetTabControl()->Show(bShow ? sal_True : sal_False);
+ mpViewTabBar->GetTabControl()->Show(bShow ? true : false);
mrBase.Rearrange();
}
}
@@ -1364,7 +1365,7 @@ void ViewShellBase::Implementation::SetPaneVisibility (
// Determine the new visibility state.
const SfxItemSet* pArguments = rRequest.GetArgs();
- sal_Bool bShowChildWindow;
+ bool bShowChildWindow;
sal_uInt16 nSlotId = rRequest.GetSlot();
if (pArguments != NULL)
bShowChildWindow = static_cast<const SfxBoolItem&>(
@@ -1515,9 +1516,9 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet)
ViewShell* pCenterViewShell = FrameworkHelper::Instance(mrBase)->GetViewShell(
FrameworkHelper::msCenterPaneURL).get();
bool bMasterPageMode (false);
- if (pCenterViewShell!=NULL && pCenterViewShell->ISA(DrawViewShell))
- if (PTR_CAST(DrawViewShell,pCenterViewShell)->GetEditMode()
- == EM_MASTERPAGE)
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(pCenterViewShell);
+
+ if(pDrawViewShell && EM_MASTERPAGE == pDrawViewShell->GetEditMode())
{
bMasterPageMode = true;
}
@@ -1552,7 +1553,7 @@ void ViewShellBase::Implementation::ProcessTaskPaneSlot (SfxRequest& rRequest)
{
// Set the visibility state of the toolpanel and one of its top
// level panels.
- sal_Bool bShowToolPanel = sal_True;
+ bool bShowToolPanel = true;
toolpanel::PanelId nPanelId (
toolpanel::PID_UNKNOWN);
bool bPanelIdGiven = false;
@@ -1563,15 +1564,13 @@ void ViewShellBase::Implementation::ProcessTaskPaneSlot (SfxRequest& rRequest)
{
if ((pArgs->Count() == 1) || (pArgs->Count() == 2))
{
- SFX_REQUEST_ARG (rRequest, pIsPanelVisible,
- SfxBoolItem, ID_VAL_ISVISIBLE, sal_False);
+ SFX_REQUEST_ARG (rRequest, pIsPanelVisible, SfxBoolItem, ID_VAL_ISVISIBLE );
if (pIsPanelVisible != NULL)
bShowToolPanel = pIsPanelVisible->GetValue();
}
if (pArgs->Count() == 2)
{
- SFX_REQUEST_ARG (rRequest, pPanelId, SfxUInt32Item,
- ID_VAL_PANEL_INDEX, sal_False);
+ SFX_REQUEST_ARG (rRequest, pPanelId, SfxUInt32Item, ID_VAL_PANEL_INDEX );
if (pPanelId != NULL)
{
nPanelId = static_cast<
diff --git a/sd/source/ui/view/ViewShellHint.cxx b/sd/source/ui/view/ViewShellHint.cxx
index cec1cc078b95..260921d4983f 100644
--- a/sd/source/ui/view/ViewShellHint.cxx
+++ b/sd/source/ui/view/ViewShellHint.cxx
@@ -28,8 +28,6 @@
namespace sd {
-TYPEINIT1(ViewShellHint, SfxHint);
-
ViewShellHint::ViewShellHint (HintId eHintId)
: SfxHint(),
meHintId(eHintId)
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx
index b9a2cb9721b9..b04f3e37efb1 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -89,7 +89,7 @@ ViewShell::Implementation::~Implementation (void)
if (pLock.get() != NULL)
{
// Force the ToolBarManagerLock to be released even when the
- // IsUICaptured() returns <TRUE/>.
+ // IsUICaptured() returns <true/>.
pLock->Release(true);
}
}
@@ -104,11 +104,11 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
PageKind ePageKind)
{
SdDrawDocument* pDocument = mrViewShell.GetDoc();
- SdrLayerAdmin& rLayerAdmin = pDocument->GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = pDocument->GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SetOfByte aVisibleLayers;
- sal_Bool bHandoutMode = sal_False;
+ bool bHandoutMode = false;
SdPage* pHandoutMPage = NULL;
String aNewName;
@@ -117,8 +117,8 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
AutoLayout aNewAutoLayout;
- sal_Bool bBVisible;
- sal_Bool bBObjsVisible;
+ bool bBVisible;
+ bool bBObjsVisible;
const SfxItemSet* pArgs = rRequest.GetArgs();
if (pCurrentPage != NULL && pCurrentPage->TRG_HasMasterPage())
@@ -140,14 +140,14 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
// dialog. We could select that layout in the
// layout panel instead.
/*
- SFX_REQUEST_ARG (rRequest, pNewAutoLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT, sal_False);
+ SFX_REQUEST_ARG (rRequest, pNewAutoLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT );
eNewAutoLayout = (AutoLayout) pNewAutoLayout->GetValue
();
*/
}
// Make the layout menu visible in the tool pane.
- SfxBoolItem aMakeToolPaneVisible (ID_VAL_ISVISIBLE, sal_True);
+ SfxBoolItem aMakeToolPaneVisible (ID_VAL_ISVISIBLE, true);
SfxUInt32Item aPanelId (ID_VAL_PANEL_INDEX,
::sd::toolpanel::PID_LAYOUT);
SfxViewFrame* pFrame = mrViewShell.GetViewFrame();
@@ -173,10 +173,10 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
}
else if (pArgs->Count() == 4)
{
- SFX_REQUEST_ARG (rRequest, pNewName, SfxStringItem, ID_VAL_PAGENAME, sal_False);
- SFX_REQUEST_ARG (rRequest, pNewAutoLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT, sal_False);
- SFX_REQUEST_ARG (rRequest, pBVisible, SfxBoolItem, ID_VAL_ISPAGEBACK, sal_False);
- SFX_REQUEST_ARG (rRequest, pBObjsVisible, SfxBoolItem, ID_VAL_ISPAGEOBJ, sal_False);
+ SFX_REQUEST_ARG (rRequest, pNewName, SfxStringItem, ID_VAL_PAGENAME );
+ SFX_REQUEST_ARG (rRequest, pNewAutoLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT );
+ SFX_REQUEST_ARG (rRequest, pBVisible, SfxBoolItem, ID_VAL_ISPAGEBACK );
+ SFX_REQUEST_ARG (rRequest, pBObjsVisible, SfxBoolItem, ID_VAL_ISPAGEOBJ );
AutoLayout aLayout ((AutoLayout)pNewAutoLayout->GetValue ());
if (aLayout >= AUTOLAYOUT__START
&& aLayout < AUTOLAYOUT__END)
@@ -194,7 +194,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
}
if (ePageKind == PK_HANDOUT)
{
- bHandoutMode = sal_True;
+ bHandoutMode = true;
pHandoutMPage = pDocument->GetMasterSdPage(0, PK_HANDOUT);
}
}
@@ -231,34 +231,34 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
if (ePageKind == PK_STANDARD)
{
- sal_uInt16 nPage = (pCurrentPage->GetPageNum()-1) / 2;
+ sal_uInt32 nPage = (pCurrentPage->GetPageNumber()-1) / 2;
SdPage* pNotesPage = pDocument->GetSdPage(nPage, PK_NOTES);
if (pNotesPage != NULL)
pNotesPage->SetName(aNewName);
}
}
- pCurrentPage->SetAutoLayout(aNewAutoLayout, sal_True);
+ pCurrentPage->SetAutoLayout(aNewAutoLayout, true);
- aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
aVisibleLayers.Set(aBckgrnd, bBVisible);
aVisibleLayers.Set(aBckgrndObj, bBObjsVisible);
pCurrentPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
}
else
{
- pHandoutMPage->SetAutoLayout(aNewAutoLayout, sal_True);
+ pHandoutMPage->SetAutoLayout(aNewAutoLayout, true);
}
mrViewShell.GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHPAGE,
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
- sal_Bool bSetModified = sal_True;
+ bool bSetModified = true;
if (pArgs && pArgs->Count() == 1)
{
- bSetModified = (sal_Bool) ((SfxBoolItem&) pArgs->Get(SID_MODIFYPAGE)).GetValue();
+ bSetModified = ((SfxBoolItem&) pArgs->Get(SID_MODIFYPAGE)).GetValue();
}
pUndoManager->AddUndoAction( new UndoAutoLayoutPosAndSize( *pUndoPage ) );
@@ -275,8 +275,8 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind ePageKind )
{
- const SfxUInt32Item* pWhatPage = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATPAGE, sal_False, TYPE(SfxUInt32Item) ) );
- const SfxUInt32Item* pWhatLayout = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATLAYOUT, sal_False, TYPE(SfxUInt32Item) ) );
+ const SfxUInt32Item* pWhatPage = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATPAGE ) );
+ const SfxUInt32Item* pWhatLayout = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATLAYOUT ) );
SdDrawDocument* pDocument = mrViewShell.GetDoc();
if( !pDocument )
@@ -285,7 +285,7 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind eP
SdPage* pPage = 0;
if( pWhatPage )
{
- pPage = pDocument->GetSdPage(static_cast<sal_uInt16>(pWhatPage->GetValue()), ePageKind);
+ pPage = pDocument->GetSdPage(static_cast< sal_uInt32 >(pWhatPage->GetValue()), ePageKind);
}
if( pPage == 0 )
@@ -300,9 +300,9 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind eP
// Transform the given request into the four argument form that is
// understood by ProcessModifyPageSlot().
- SdrLayerAdmin& rLayerAdmin (mrViewShell.GetViewShellBase().GetDocument()->GetLayerAdmin());
- sal_uInt8 aBackground (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False));
- sal_uInt8 aBackgroundObject (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False));
+ SdrLayerAdmin& rLayerAdmin (mrViewShell.GetViewShellBase().GetDocument()->GetModelLayerAdmin());
+ sal_uInt8 aBackground (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false));
+ sal_uInt8 aBackgroundObject (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false));
SetOfByte aVisibleLayers;
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index 0872e034a814..6349db5f1c28 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -1183,7 +1183,7 @@ IMPL_LINK(ViewShellManager::Implementation, WindowEventHandler, VclWindowEvent*,
break;
}
}
- return sal_True;
+ return true;
}
@@ -1369,7 +1369,7 @@ void ViewShellManager::Implementation::Deactivate (SfxShell* pShell)
}
// Now we can deactivate the shell.
- pShell->Deactivate(sal_True);
+ pShell->Deactivate(true);
}
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index 3695622de389..02b323dde9e9 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -642,8 +642,8 @@ void ViewTabBar::UpdateActiveButton (void)
void ViewTabBar::UpdateTabBarButtons (void)
{
TabBarButtonList::const_iterator iTab;
- sal_uInt16 nPageCount (mpTabControl->GetPageCount());
- sal_uInt16 nIndex;
+ sal_uInt32 nPageCount (mpTabControl->GetPageCount());
+ sal_uInt32 nIndex;
for (iTab=maTabBarButtons.begin(),nIndex=1; iTab!=maTabBarButtons.end(); ++iTab,++nIndex)
{
// Create a new tab when there are not enough.
diff --git a/sd/source/ui/view/clview.cxx b/sd/source/ui/view/clview.cxx
index 78f60c00222a..1db0867d4ba2 100644
--- a/sd/source/ui/view/clview.cxx
+++ b/sd/source/ui/view/clview.cxx
@@ -82,9 +82,16 @@ void ClientView::InvalidateOneWin(::Window& rWin)
|*
\************************************************************************/
-void ClientView::InvalidateOneWin(::Window& rWin, const Rectangle& rRect)
+void ClientView::InvalidateOneWin(::Window& rWin, const basegfx::B2DRange& rRange)
{
- CompleteRedraw(&rWin, rRect);
+ if(!rRange.isEmpty())
+ {
+ const Region aRegion(Rectangle(
+ basegfx::fround(rRange.getMinX()), basegfx::fround(rRange.getMinY()),
+ basegfx::fround(rRange.getMaxX()), basegfx::fround(rRange.getMaxY())));
+
+ CompleteRedraw(&rWin, aRegion);
+ }
}
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index e21ac28ba707..a750ed1dcc79 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -80,6 +80,7 @@
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
+#include <svx/svdlegacy.hxx>
#include "undo/undomanager.hxx"
@@ -87,8 +88,6 @@ using namespace ::com::sun::star;
namespace sd {
-TYPEINIT1(DrawView, View);
-
/*************************************************************************
|*
|* Konstruktor
@@ -98,13 +97,13 @@ TYPEINIT1(DrawView, View);
\************************************************************************/
DrawView::DrawView( DrawDocShell* pDocSh, OutputDevice* pOutDev, DrawViewShell* pShell)
-: ::sd::View(pDocSh->GetDoc(), pOutDev, pShell)
+: ::sd::View(*pDocSh->GetDoc(), pOutDev, pShell)
, mpDocShell(pDocSh)
, mpDrawViewShell(pShell)
, mpVDev(NULL)
, mnPOCHSmph(0)
{
- SetCurrentObj(OBJ_RECT, SdrInventor);
+ setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_RECT), SdrInventor));
}
/*************************************************************************
@@ -115,6 +114,12 @@ DrawView::DrawView( DrawDocShell* pDocSh, OutputDevice* pOutDev, DrawViewShell*
DrawView::~DrawView()
{
+ // call here when still set due to it's virtual nature
+ if(GetSdrPageView())
+ {
+ HideSdrPage();
+ }
+
delete mpVDev;
}
@@ -124,10 +129,12 @@ DrawView::~DrawView()
|*
\************************************************************************/
-void DrawView::MarkListHasChanged()
+void DrawView::handleSelectionChange()
{
- ::sd::View::MarkListHasChanged();
+ // call parent
+ ::sd::View::handleSelectionChange();
+ // local reactions
if (mpDrawViewShell)
mpDrawViewShell->SelectionHasChanged();
}
@@ -138,17 +145,18 @@ void DrawView::MarkListHasChanged()
|*
\************************************************************************/
-void DrawView::ModelHasChanged()
+void DrawView::LazyReactOnObjectChanges()
{
- ::sd::View::ModelHasChanged();
+ ::sd::View::LazyReactOnObjectChanges();
// den Gestalter zur Neudarstellung zwingen
SfxStyleSheetBasePool* pSSPool = mpDoc->GetStyleSheetPool();
pSSPool->Broadcast(SfxStyleSheetPoolHint(SFX_STYLESHEETPOOL_CHANGES));
if( mpDrawViewShell )
- mpDrawViewShell->ModelHasChanged();
-
+ {
+ mpDrawViewShell->LazyReactOnObjectChanges();
+ }
}
/*************************************************************************
@@ -158,10 +166,9 @@ void DrawView::ModelHasChanged()
|*
\************************************************************************/
-sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
- sal_Bool bReplaceAll)
+bool DrawView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
- sal_Bool bOk = sal_False;
+ bool bOk = false;
// wird eine Masterpage bearbeitet?
if ( mpDrawViewShell && mpDrawViewShell->GetEditMode() == EM_MASTERPAGE )
@@ -195,12 +202,12 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
aTempSet.ClearInvalidItems();
// Undo-Action
- StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+ StyleSheetUndoAction* pAction = new StyleSheetUndoAction(*mpDoc, *pSheet, aTempSet);
mpDocSh->GetUndoManager()->AddUndoAction(pAction);
pSheet->GetItemSet().Put(aTempSet);
pSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
- bOk = sal_True;
+ bOk = true;
}
else if (eObjKind == OBJ_OUTLINETEXT)
{
@@ -210,8 +217,8 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
List* pList = (List*)pOV->CreateSelectionList();
aTemplateName += String(SdResId(STR_LAYOUT_OUTLINE));
- pOutliner->SetUpdateMode(sal_False);
- mpDocSh->SetWaitCursor( sal_True );
+ pOutliner->SetUpdateMode(false);
+ mpDocSh->SetWaitCursor( true );
// Platzhalter durch Vorlagennamen ersetzen
String aComment(SdResId(STR_UNDO_CHANGE_PRES_OBJECT));
@@ -242,7 +249,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
}
// Undo-Action
- StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+ StyleSheetUndoAction* pAction = new StyleSheetUndoAction(*mpDoc, *pSheet, aTempSet);
mpDocSh->GetUndoManager()->AddUndoAction(pAction);
pSheet->GetItemSet().Put(aTempSet);
@@ -268,13 +275,13 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
pPara = pOutliner->GetParagraph( 0 ); // Put NumBulletItem in outline level 1
}
- mpDocSh->SetWaitCursor( sal_False );
- pOV->GetOutliner()->SetUpdateMode(sal_True);
+ mpDocSh->SetWaitCursor( false );
+ pOV->GetOutliner()->SetUpdateMode(true);
mpDocSh->GetUndoManager()->LeaveListAction();
delete pList;
- bOk = sal_True;
+ bOk = true;
}
else
{
@@ -285,11 +292,11 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
else
{
// Selection
- const SdrMarkList& rList = GetMarkedObjectList();
- sal_uLong nMarkCount = rList.GetMarkCount();
- for (sal_uLong nMark = 0; nMark < nMarkCount; nMark++)
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 nMark(0); nMark < aSelection.size(); nMark++)
{
- SdrObject* pObject = rList.GetMark(nMark)->GetMarkedSdrObj();
+ SdrObject* pObject = aSelection[nMark];
sal_uInt32 nInv = pObject->GetObjInventor();
if (nInv == SdrInventor)
@@ -310,12 +317,12 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
aTempSet.ClearInvalidItems();
// Undo-Action
- StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+ StyleSheetUndoAction* pAction = new StyleSheetUndoAction(*mpDoc, *pSheet, aTempSet);
mpDocSh->GetUndoManager()->AddUndoAction(pAction);
pSheet->GetItemSet().Put(aTempSet,false);
pSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
- bOk = sal_True;
+ bOk = true;
}
else if (eObjKind == OBJ_OUTLINETEXT)
{
@@ -355,7 +362,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
aTempSet.ClearInvalidItems();
// Undo-Action
- StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, pSheet, &aTempSet);
+ StyleSheetUndoAction* pAction = new StyleSheetUndoAction(*mpDoc, *pSheet, aTempSet);
mpDocSh->GetUndoManager()->AddUndoAction(pAction);
pSheet->GetItemSet().Set(aTempSet,false);
@@ -372,7 +379,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
nWhich = aWhichIter.NextWhich();
}
- bOk = sal_True;
+ bOk = true;
}
}
}
@@ -397,9 +404,11 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- if ( mpDrawViewShell && rHint.ISA(SdrHint) )
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if ( mpDrawViewShell && pSdrHint )
{
- SdrHintKind eHintKind = ( (SdrHint&) rHint).GetKind();
+ SdrHintKind eHintKind = pSdrHint->GetSdrHintKind();
if ( mnPOCHSmph == 0 && eHintKind == HINT_PAGEORDERCHG )
{
@@ -413,13 +422,13 @@ void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
// #94278# switch to that page when it's not a master page
if(HINT_SWITCHTOPAGE == eHintKind)
{
- const SdrPage* pPage = ((const SdrHint&)rHint).GetPage();
+ const SdrPage* pPage = pSdrHint->GetSdrHintPage();
if(pPage && !pPage->IsMasterPage())
{
if(mpDrawViewShell->GetActualPage() != pPage)
{
- sal_uInt16 nPageNum = (pPage->GetPageNum() - 1) / 2; // Sdr --> Sd
+ sal_uInt32 nPageNum = (pPage->GetPageNumber() - 1) / 2; // Sdr --> Sd
mpDrawViewShell->SwitchPage(nPageNum);
}
}
@@ -435,7 +444,7 @@ void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
|*
\************************************************************************/
-void DrawView::BlockPageOrderChangedHint(sal_Bool bBlock)
+void DrawView::BlockPageOrderChangedHint(bool bBlock)
{
if (bBlock)
mnPOCHSmph++;
@@ -453,19 +462,17 @@ void DrawView::BlockPageOrderChangedHint(sal_Bool bBlock)
|*
\************************************************************************/
-sal_Bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
- sal_Bool bResult = sal_True;
+ bool bResult = true;
// wird eine Masterpage bearbeitet?
if (mpDrawViewShell && mpDrawViewShell->GetEditMode() == EM_MASTERPAGE)
{
- if (IsPresObjSelected(sal_False, sal_True))
+ if (IsPresObjSelected(false, true))
{
-
- InfoBox(mpDrawViewShell->GetActiveWindow(),
- String(SdResId(STR_ACTION_NOTPOSSIBLE))).Execute();
- bResult = sal_False;
+ InfoBox(mpDrawViewShell->GetActiveWindow(), String(SdResId(STR_ACTION_NOTPOSSIBLE))).Execute();
+ bResult = false;
}
else
{
@@ -476,6 +483,7 @@ sal_Bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemov
{
bResult = ::sd::View::SetStyleSheet(pStyleSheet, bDontRemoveHardAttr);
}
+
return bResult;
}
@@ -493,7 +501,7 @@ void DrawView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::co
mpVDev = NULL;
}
- sal_Bool bStandardPaint = sal_True;
+ bool bStandardPaint = true;
SdDrawDocument* pDoc = mpDocShell->GetDoc();
if( pDoc && pDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
@@ -506,7 +514,7 @@ void DrawView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::co
{
if( pShowWindow == pOutDev )
PresPaint(rReg);
- bStandardPaint = sal_False;
+ bStandardPaint = false;
}
}
}
@@ -538,9 +546,9 @@ void DrawView::PresPaint(const Region& rRegion)
|* erschienene Animationsobjekte in der Diashow)
\************************************************************************/
-sal_Bool DrawView::IsObjMarkable(SdrObject* pObj, SdrPageView* pPV) const
+bool DrawView::IsObjMarkable(const SdrObject& rObj) const
{
- return FmFormView::IsObjMarkable(pObj, pPV);;
+ return FmFormView::IsObjMarkable(rObj);
}
/*************************************************************************
@@ -549,11 +557,11 @@ sal_Bool DrawView::IsObjMarkable(SdrObject* pObj, SdrPageView* pPV) const
|*
\************************************************************************/
-void DrawView::MakeVisible(const Rectangle& rRect, ::Window& rWin)
+void DrawView::MakeVisibleAtView(const basegfx::B2DRange& rRange, ::Window& rWin)
{
- if (!rRect.IsEmpty())
+ if (!rRange.isEmpty())
{
- mpDrawViewShell->MakeVisible(rRect, rWin);
+ mpDrawViewShell->MakeVisibleAtView(rRange, rWin);
}
}
/*************************************************************************
@@ -578,28 +586,26 @@ void DrawView::DeleteMarked()
sd::UndoManager* pUndoManager = mpDoc->GetUndoManager();
DBG_ASSERT( pUndoManager, "sd::DrawView::DeleteMarked(), ui action without undo manager!?" );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
if( pUndoManager )
{
String aUndo( SVX_RES(STR_EditDelete) );
String aSearchString(RTL_CONSTASCII_USTRINGPARAM("%1"));
- aUndo.SearchAndReplace(aSearchString, GetDescriptionOfMarkedObjects());
+ aUndo.SearchAndReplace(aSearchString, getSelectionDescription(aSelection));
pUndoManager->EnterListAction(aUndo, aUndo);
}
SdPage* pPage = 0;
bool bResetLayout = false;
- const sal_uLong nMarkCount = GetMarkedObjectList().GetMarkCount();
- if( nMarkCount )
+ for (sal_uInt32 nMark(0); nMark < aSelection.size(); nMark++)
{
- SdrMarkList aList( GetMarkedObjectList() );
- for (sal_uLong nMark = 0; nMark < nMarkCount; nMark++)
- {
- SdrObject* pObj = aList.GetMark(nMark)->GetMarkedSdrObj();
- if( pObj && !pObj->IsEmptyPresObj() && pObj->GetUserCall() )
+ SdrObject* pObj = aSelection[nMark];
+
+ if( !pObj->IsEmptyPresObj() && findConnectionToSdrObject(pObj) )
{
- pPage = static_cast< SdPage* >( pObj->GetPage() );
+ pPage = static_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
PresObjKind ePresObjKind;
if( pPage && ((ePresObjKind = pPage->GetPresObjKind(pObj)) != PRESOBJ_NONE))
{
@@ -620,17 +626,17 @@ void DrawView::DeleteMarked()
}
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
bool bVertical = pTextObj && pTextObj->IsVerticalWriting();
- Rectangle aRect( pObj->GetLogicRect() );
- SdrObject* pNewObj = pPage->InsertAutoLayoutShape( 0, ePresObjKind, bVertical, aRect, true );
+ const basegfx::B2DRange aRange(sdr::legacy::GetLogicRange(*pObj));
+ SdrObject* pNewObj = pPage->InsertAutoLayoutShape( 0, ePresObjKind, bVertical, aRange, true );
// Move the new PresObj to the position before the
// object it will replace.
pUndoManager->AddUndoAction(
mpDoc->GetSdrUndoFactory().CreateUndoObjectOrdNum(
*pNewObj,
- pNewObj->GetOrdNum(),
- pObj->GetOrdNum()));
- pPage->SetObjectOrdNum( pNewObj->GetOrdNum(), pObj->GetOrdNum() );
+ pNewObj->GetNavigationPosition(),
+ pObj->GetNavigationPosition()));
+ pPage->SetNavigationPosition( pNewObj->GetNavigationPosition(), pObj->GetNavigationPosition() );
bResetLayout = true;
@@ -638,7 +644,6 @@ void DrawView::DeleteMarked()
}
}
}
- }
::sd::View::DeleteMarked();
diff --git a/sd/source/ui/view/drbezob.cxx b/sd/source/ui/view/drbezob.cxx
index bcf63c787e4a..d413e10a5ece 100644
--- a/sd/source/ui/view/drbezob.cxx
+++ b/sd/source/ui/view/drbezob.cxx
@@ -76,8 +76,6 @@ SFX_IMPL_INTERFACE(BezierObjectBar, ::SfxShell, SdResId(STR_BEZIEROBJECTBARSHELL
{
}
-TYPEINIT1(BezierObjectBar, ::SfxShell);
-
/*************************************************************************
|*
|* Standard-Konstruktor
@@ -119,23 +117,30 @@ BezierObjectBar::~BezierObjectBar()
void BezierObjectBar::GetAttrState(SfxItemSet& rSet)
{
- SfxItemSet aAttrSet( mpView->GetDoc()->GetPool() );
+ SfxItemSet aAttrSet( mpView->GetDoc()->GetItemPool() );
mpView->GetAttributes( aAttrSet );
- rSet.Put(aAttrSet, sal_False); // <- sal_False, damit DontCare-Status uebernommen wird
+ rSet.Put(aAttrSet, false); // <- false, damit DontCare-Status uebernommen wird
FunctionReference xFunc( mpViewSh->GetCurrentFunction() );
if(xFunc.is())
{
- if(xFunc->ISA(FuSelection))
+ FuSelection* pFuSelection = dynamic_cast< FuSelection* >(xFunc.get());
+
+ if(pFuSelection)
{
- sal_uInt16 nEditMode = static_cast<FuSelection*>(xFunc.get())->GetEditMode();
- rSet.Put(SfxBoolItem(nEditMode, sal_True));
+ sal_uInt16 nEditMode = pFuSelection->GetEditMode();
+ rSet.Put(SfxBoolItem(nEditMode, true));
}
- else if (xFunc->ISA(FuConstructBezierPolygon))
+ else
{
- sal_uInt16 nEditMode = static_cast<FuConstructBezierPolygon*>(xFunc.get())->GetEditMode();
- rSet.Put(SfxBoolItem(nEditMode, sal_True));
+ FuConstructBezierPolygon* pFuConstructBezierPolygon = dynamic_cast< FuConstructBezierPolygon* >(xFunc.get());
+
+ if (pFuConstructBezierPolygon)
+ {
+ sal_uInt16 nEditMode = pFuConstructBezierPolygon->GetEditMode();
+ rSet.Put(SfxBoolItem(nEditMode, true));
+ }
}
}
@@ -160,7 +165,7 @@ void BezierObjectBar::GetAttrState(SfxItemSet& rSet)
else
{
IPolyPolygonEditorController* pIPPEC = 0;
- if( mpView->GetMarkedObjectList().GetMarkCount() )
+ if( mpView->areSdrObjectsSelected() )
pIPPEC = mpView;
else
pIPPEC = dynamic_cast< IPolyPolygonEditorController* >( mpView->getSmartTags().getSelected().get() );
@@ -183,8 +188,8 @@ void BezierObjectBar::GetAttrState(SfxItemSet& rSet)
switch (eSegm)
{
case SDRPATHSEGMENT_DONTCARE: rSet.InvalidateItem(SID_BEZIER_CONVERT); break;
- case SDRPATHSEGMENT_LINE : rSet.Put(SfxBoolItem(SID_BEZIER_CONVERT,sal_False)); break; // Button reingedrueckt = Kurve
- case SDRPATHSEGMENT_CURVE : rSet.Put(SfxBoolItem(SID_BEZIER_CONVERT,sal_True)); break;
+ case SDRPATHSEGMENT_LINE : rSet.Put(SfxBoolItem(SID_BEZIER_CONVERT,false)); break; // Button reingedrueckt = Kurve
+ case SDRPATHSEGMENT_CURVE : rSet.Put(SfxBoolItem(SID_BEZIER_CONVERT,true)); break;
default: break;
}
}
@@ -200,9 +205,9 @@ void BezierObjectBar::GetAttrState(SfxItemSet& rSet)
switch (eSmooth)
{
case SDRPATHSMOOTH_DONTCARE : break;
- case SDRPATHSMOOTH_ANGULAR : rSet.Put(SfxBoolItem(SID_BEZIER_EDGE, sal_True)); break;
- case SDRPATHSMOOTH_ASYMMETRIC: rSet.Put(SfxBoolItem(SID_BEZIER_SMOOTH,sal_True)); break;
- case SDRPATHSMOOTH_SYMMETRIC : rSet.Put(SfxBoolItem(SID_BEZIER_SYMMTR,sal_True)); break;
+ case SDRPATHSMOOTH_ANGULAR : rSet.Put(SfxBoolItem(SID_BEZIER_EDGE, true)); break;
+ case SDRPATHSMOOTH_ASYMMETRIC: rSet.Put(SfxBoolItem(SID_BEZIER_SMOOTH,true)); break;
+ case SDRPATHSMOOTH_SYMMETRIC : rSet.Put(SfxBoolItem(SID_BEZIER_SYMMTR,true)); break;
}
}
if (!pIPPEC || !pIPPEC->IsOpenCloseMarkedObjectsPossible())
@@ -215,8 +220,8 @@ void BezierObjectBar::GetAttrState(SfxItemSet& rSet)
switch (eClose)
{
case SDROBJCLOSED_DONTCARE: rSet.InvalidateItem(SID_BEZIER_CLOSE); break;
- case SDROBJCLOSED_OPEN : rSet.Put(SfxBoolItem(SID_BEZIER_CLOSE,sal_False)); break;
- case SDROBJCLOSED_CLOSED : rSet.Put(SfxBoolItem(SID_BEZIER_CLOSE,sal_True)); break;
+ case SDROBJCLOSED_OPEN : rSet.Put(SfxBoolItem(SID_BEZIER_CLOSE,false)); break;
+ case SDROBJCLOSED_CLOSED : rSet.Put(SfxBoolItem(SID_BEZIER_CLOSE,true)); break;
default: break;
}
}
@@ -249,10 +254,8 @@ void BezierObjectBar::Execute(SfxRequest& rReq)
case SID_BEZIER_SYMMTR:
case SID_BEZIER_CLOSE:
{
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
IPolyPolygonEditorController* pIPPEC = 0;
- if( rMarkList.GetMarkCount() )
+ if( mpView->areSdrObjectsSelected() )
pIPPEC = mpView;
else
pIPPEC = dynamic_cast< IPolyPolygonEditorController* >( mpView->getSmartTags().getSelected().get() );
@@ -295,26 +298,32 @@ void BezierObjectBar::Execute(SfxRequest& rReq)
case SID_BEZIER_CLOSE:
{
- SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj();
- const bool bUndo = mpView->IsUndoEnabled();
- if( bUndo )
- mpView->BegUndo(String(SdResId(STR_UNDO_BEZCLOSE)));
+ SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >(mpView->getSelectedIfSingle());
+ OSL_ENSURE(pPathObj, "Here the single selected object should be a SdrPathObj (!)");
- mpView->UnmarkAllPoints();
+ if(pPathObj)
+ {
+ const bool bUndo = mpView->IsUndoEnabled();
- if( bUndo )
- mpView->AddUndo(mpView->GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPathObj));
+ if( bUndo )
+ mpView->BegUndo(String(SdResId(STR_UNDO_BEZCLOSE)));
- pPathObj->ToggleClosed();
+ mpView->MarkPoints(0, true); // unmarkall
- if( bUndo )
- mpView->EndUndo();
+ if( bUndo )
+ mpView->AddUndo(mpView->getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pPathObj));
+
+ pPathObj->ToggleClosed();
+
+ if( bUndo )
+ mpView->EndUndo();
+ }
break;
}
}
}
- if( (pIPPEC == mpView) && !mpView->AreObjectsMarked() )
+ if( (pIPPEC == mpView) && !mpView->areSdrObjectsSelected() )
mpViewSh->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
rReq.Ignore();
@@ -336,13 +345,20 @@ void BezierObjectBar::Execute(SfxRequest& rReq)
if(xFunc.is())
{
- if(xFunc->ISA(FuSelection))
+ FuSelection* pFuSelection = dynamic_cast< FuSelection* >(xFunc.get());
+
+ if(pFuSelection)
{
- static_cast<FuSelection*>(xFunc.get())->SetEditMode(rReq.GetSlot());
+ pFuSelection->SetEditMode(rReq.GetSlot());
}
- else if(xFunc->ISA(FuConstructBezierPolygon))
+ else
{
- static_cast<FuConstructBezierPolygon*>(xFunc.get())->SetEditMode(rReq.GetSlot());
+ FuConstructBezierPolygon* pFuConstructBezierPolygon = dynamic_cast< FuConstructBezierPolygon* >(xFunc.get());
+
+ if(pFuConstructBezierPolygon)
+ {
+ pFuConstructBezierPolygon->SetEditMode(rReq.GetSlot());
+ }
}
}
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index e6bc04110ed4..607b58658411 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -95,8 +95,6 @@ SFX_IMPL_INTERFACE( TextObjectBar, SfxShell, SdResId(STR_TEXTOBJECTBARSHELL) )
{
}
-TYPEINIT1( TextObjectBar, SfxShell );
-
/*************************************************************************
|*
|* Standard-Konstruktor
@@ -163,8 +161,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
{
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
- sal_Bool bTemplate = sal_False;
- SfxItemSet aAttrSet( mpView->GetDoc()->GetPool() );
+ bool bTemplate = false;
+ SfxItemSet aAttrSet( mpView->GetDoc()->GetItemPool() );
SvtLanguageOptions aLangOpt;
sal_Bool bDisableParagraphTextDirection = !aLangOpt.IsCTLFontEnabled();
sal_Bool bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled();
@@ -185,7 +183,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
case SID_ATTR_CHAR_POSTURE:
{
SvxScriptSetItem aSetItem( nSlotId, GetPool() );
- aSetItem.GetItemSet().Put( aAttrSet, sal_False );
+ aSetItem.GetItemSet().Put( aAttrSet, false );
sal_uInt16 nScriptType = mpView->GetScriptType();
@@ -194,11 +192,11 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
// #42732# input language should be preferred over
// current cursor position to detect script type
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+ OutlineView* pOutlineView = dynamic_cast< OutlineView* >(mpView);
- if (mpView->ISA(OutlineView))
+ if (pOutlineView)
{
- pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
- mpViewShell->GetActiveWindow());
+ pOLV = pOutlineView->GetViewByWindow(mpViewShell->GetActiveWindow());
}
if(pOLV && !pOLV->GetSelection().HasRange())
@@ -231,7 +229,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
{
rSet.Put( SfxTemplateItem( nWhich, String() ) );
}
- bTemplate = sal_True;
+ bTemplate = true;
}
break;
@@ -240,19 +238,19 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
case SID_OUTLINE_UP:
case SID_OUTLINE_DOWN:
{
- sal_Bool bDisableLeft = sal_True;
- sal_Bool bDisableRight = sal_True;
- sal_Bool bDisableUp = sal_True;
- sal_Bool bDisableDown = sal_True;
+ bool bDisableLeft = true;
+ bool bDisableRight = true;
+ bool bDisableUp = true;
+ bool bDisableDown = true;
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+ OutlineView* pOutlineView = dynamic_cast< OutlineView* >(mpView);
- if (mpView->ISA(OutlineView))
+ if (pOutlineView)
{
- pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow(
- mpViewShell->GetActiveWindow());
+ pOLV = pOutlineView->GetViewByWindow(mpViewShell->GetActiveWindow());
}
- sal_Bool bOutlineViewSh = mpViewShell->ISA(OutlineViewShell);
+ bool bOutlineViewSh = dynamic_cast< OutlineViewShell* >(mpViewShell);
if (pOLV &&
( pOLV->GetOutliner()->GetMode() == OUTLINERMODE_OUTLINEOBJECT || bOutlineViewSh ) )
@@ -263,7 +261,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
Paragraph* pPara = (Paragraph*) pList->First();
// #96539# find out if we are a OutlineView
- sal_Bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == pOLV->GetOutliner()->GetMode());
+ bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == pOLV->GetOutliner()->GetMode());
// #96539# This is ONLY for OutlineViews
if(bIsOutlineView)
@@ -283,7 +281,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
if(pOutl->GetAbsPos(pPara) > 0)
{
// Nicht ganz oben
- bDisableUp = sal_False;
+ bDisableUp = false;
}
}
@@ -294,14 +292,14 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
if (nDepth > 0 || (bOutlineViewSh && (nDepth <= 0) && !pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) )
{
// Nicht minimale Tiefe
- bDisableLeft = sal_False;
+ bDisableLeft = false;
}
if( (nDepth < pOLV->GetOutliner()->GetMaxDepth() && ( !bOutlineViewSh || pOutl->GetAbsPos(pPara) != 0 )) ||
(bOutlineViewSh && (nDepth <= 0) && pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) && pOutl->GetAbsPos(pPara) != 0) )
{
// Nicht maximale Tiefe und nicht ganz oben
- bDisableRight = sal_False;
+ bDisableRight = false;
}
pPara = static_cast<Paragraph*>( pList->Next() );
@@ -311,7 +309,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
( pOutl->GetParagraphCount() > 1 || !bOutlineViewSh) )
{
// Nicht letzter Absatz
- bDisableDown = sal_False;
+ bDisableDown = false;
}
// #96250# and #78665#
@@ -324,7 +322,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
&& !pOutl->HasParaFlag( pOutl->GetParagraph(1), PARAFLAG_ISPAGE ) )
{
// Needs to be disabled
- bDisableDown = sal_True;
+ bDisableDown = true;
}
delete pList;
@@ -351,13 +349,13 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
}
else
{
- sal_Bool bLeftToRight = sal_True;
+ bool bLeftToRight = true;
SdrOutliner* pOutl = mpView->GetTextEditOutliner();
if( pOutl )
{
if( pOutl->IsVertical() )
- bLeftToRight = sal_False;
+ bLeftToRight = false;
}
else
bLeftToRight = ( (const SvxWritingModeItem&) aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB;
@@ -411,11 +409,11 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
nWhich = aIter.NextWhich();
}
- rSet.Put( aAttrSet, sal_False ); // <- sal_False, damit DontCare-Status uebernommen wird
+ rSet.Put( aAttrSet, false ); // <- false, damit DontCare-Status uebernommen wird
// die sind im Gliederungsmodus disabled
- if (!mpViewShell->ISA(DrawViewShell))
+ if (!dynamic_cast< DrawViewShell* >(mpViewShell))
{
rSet.DisableItem( SID_ATTR_PARA_ADJUST_LEFT );
rSet.DisableItem( SID_ATTR_PARA_ADJUST_RIGHT );
@@ -468,16 +466,16 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
switch( eAdj )
{
case SVX_ADJUST_LEFT:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_LEFT, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_LEFT, true ) );
break;
case SVX_ADJUST_CENTER:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_CENTER, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_CENTER, true ) );
break;
case SVX_ADJUST_RIGHT:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, true ) );
break;
case SVX_ADJUST_BLOCK:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, true ) );
break;
default:
break;
@@ -502,13 +500,13 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
break;
case FRMDIR_HORI_LEFT_TOP:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, sal_True ) );
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, sal_False ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, true ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, false ) );
break;
case FRMDIR_HORI_RIGHT_TOP:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, sal_False ) );
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, false ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, true ) );
break;
// #107865#
@@ -539,11 +537,11 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
if (aBulletState.GetValue() != 0)
{
- rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, sal_True));
+ rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, true));
}
else
{
- rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, sal_False));
+ rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON, false));
}
}
*/
@@ -552,13 +550,13 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
switch( nLineSpace )
{
case 100:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_10, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_10, true ) );
break;
case 150:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_15, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_15, true ) );
break;
case 200:
- rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_20, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_ATTR_PARA_LINESPACE_20, true ) );
break;
}
}
@@ -568,9 +566,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
- rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
else if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
- rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_SET_SUB_SCRIPT, true ) );
}
/*************************************************************************
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index eeffc210fa89..f26adc2b0498 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -91,18 +91,17 @@ void TextObjectBar::Execute( SfxRequest &rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
const SfxPoolItem* pPoolItem = NULL;
sal_uInt16 nSlot = rReq.GetSlot();
- sal_Bool bOutlineMode = sal_False;
+ bool bOutlineMode = false;
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
-
std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
+ OutlineView* pOutlineView = dynamic_cast< OutlineView* >(mpView);
- if (mpView->ISA(OutlineView))
+ if (pOutlineView)
{
- bOutlineMode = sal_True;
- pOLV = static_cast<OutlineView*>(mpView)
- ->GetViewByWindow(mpViewShell->GetActiveWindow());
+ bOutlineMode = true;
+ pOLV = pOutlineView->GetViewByWindow(mpViewShell->GetActiveWindow());
- aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
+ aGuard.reset( new OutlineViewModelChangeGuard( *pOutlineView ) );
}
switch (nSlot)
@@ -160,7 +159,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
{
SfxItemSet aAttr( pStyleSheet->GetItemSet() );
SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( (sal_uInt16) nPara ) );
- aAttr.Put( aTmpSet, sal_False ); // sal_False= InvalidItems nicht als Default, sondern als "Loecher" betrachten
+ aAttr.Put( aTmpSet, false ); // false= InvalidItems nicht als Default, sondern als "Loecher" betrachten
const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aAttr.Get( EE_PARA_ULSPACE );
SvxULSpaceItem* pNewItem = (SvxULSpaceItem*) rItem.Clone();
@@ -197,7 +196,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
// JOE einen richtigen Status (DontCare) bekomme;
// Wird enabled, obwohl es nicht richtig funktioniert (s.o.)
- SfxItemSet aEditAttr( mpView->GetDoc()->GetPool() );
+ SfxItemSet aEditAttr( mpView->GetDoc()->GetItemPool() );
mpView->GetAttributes( aEditAttr );
if( aEditAttr.GetItemState( EE_PARA_ULSPACE ) >= SFX_ITEM_AVAILABLE )
{
@@ -236,7 +235,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
Invalidate();
// Um die Preview (im Gliederungsmodus) zu aktualisieren muss
// der Slot invalidiert werden:
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
}
break;
@@ -249,7 +248,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
// Ensure bold/italic etc. icon state updates
Invalidate();
// #96551# trigger preview refresh
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
}
rReq.Done();
}
@@ -264,7 +263,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
// Ensure bold/italic etc. icon state updates
Invalidate();
// #96551# trigger preview refresh
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
}
rReq.Done();
}
@@ -277,7 +276,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
pOLV->AdjustHeight( -1 );
// #96551# trigger preview refresh
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
}
rReq.Done();
}
@@ -290,7 +289,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
pOLV->AdjustHeight( 1 );
// #96551# trigger preview refresh
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
}
rReq.Done();
}
@@ -300,7 +299,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
{
mpView->SdrEndTextEdit();
- SfxItemSet aAttr( mpView->GetDoc()->GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
+ SfxItemSet aAttr( mpView->GetDoc()->GetItemPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
aAttr.Put( SvxWritingModeItem(
nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
com::sun::star::text::WritingMode_LR_TB : com::sun::star::text::WritingMode_TB_RL,
@@ -308,7 +307,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
rReq.Done( aAttr );
mpView->SetAttributes( aAttr );
Invalidate();
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
}
break;
@@ -334,7 +333,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
case SID_THES:
{
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -344,7 +343,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
default:
{
- SfxItemSet aEditAttr( mpView->GetDoc()->GetPool() );
+ SfxItemSet aEditAttr( mpView->GetDoc()->GetItemPool() );
mpView->GetAttributes( aEditAttr );
SfxItemSet aNewAttr(*(aEditAttr.GetPool()), aEditAttr.GetRanges());
@@ -484,7 +483,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
{
if( pArgs )
{
- if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTINFO, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTINFO, true, &pPoolItem ) )
aNewAttr.Put( *pPoolItem );
}
else
@@ -496,7 +495,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
{
if( pArgs )
{
- if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTHEIGHT, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_FONTHEIGHT, true, &pPoolItem ) )
aNewAttr.Put( *pPoolItem );
}
else
@@ -506,7 +505,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
break;
case SID_ATTR_CHAR_COLOR:
{
- if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_COLOR, sal_True, &pPoolItem ) )
+ if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( EE_CHAR_COLOR, true, &pPoolItem ) )
aNewAttr.Put( *pPoolItem );
}
break;
@@ -547,7 +546,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
sal_uInt16 nAdjust = SVX_ADJUST_LEFT;
- if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, sal_True, &pPoolItem ) )
+ if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) )
nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue();
if( bLeftToRight )
@@ -578,7 +577,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
if (nSlot == SID_ATTR_CHAR_FONT)
nScriptType = mpView->GetScriptType();
- SfxItemPool& rPool = mpView->GetDoc()->GetPool();
+ SfxItemPool& rPool = mpView->GetDoc()->GetItemPool();
SvxScriptSetItem aSvxScriptSetItem( nSlot, rPool );
aSvxScriptSetItem.PutItemForScriptType( nScriptType, pArgs->Get( rPool.GetWhich( nSlot ) ) );
aNewAttr.Put( aSvxScriptSetItem.GetItemSet() );
@@ -594,7 +593,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
// Um die Preview (im Gliederungsmodus) zu aktualisieren muss
// der Slot invalidiert werden:
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, sal_True, sal_False );
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
}
break;
}
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index e8594a53b289..34554fcbdc1e 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -182,36 +182,20 @@ void DrawViewShell::SelectionHasChanged (void)
Invalidate();
//Update3DWindow(); // 3D-Controller
- SfxBoolItem aItem( SID_3D_STATE, sal_True );
+ SfxBoolItem aItem( SID_3D_STATE, true );
GetViewFrame()->GetDispatcher()->Execute(
SID_3D_STATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
- SdrOle2Obj* pOleObj = NULL;
- SdrGrafObj* pGrafObj = NULL;
+ SdrOle2Obj* pOleObj = dynamic_cast< SdrOle2Obj* >(mpDrawView->getSelectedIfSingle());
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(mpDrawView->getSelectedIfSingle());
- if ( mpDrawView->AreObjectsMarked() )
+ if (pOleObj)
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
-
- if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
- {
- pOleObj = (SdrOle2Obj*) pObj;
- UpdateIMapDlg( pObj );
- }
- else if (nSdrObjKind == OBJ_GRAF)
- {
- pGrafObj = (SdrGrafObj*) pObj;
- UpdateIMapDlg( pObj );
- }
- }
+ UpdateIMapDlg( pOleObj );
+ }
+ else if (pGrafObj)
+ {
+ UpdateIMapDlg( pGrafObj );
}
ViewShellBase& rBase = GetViewShellBase();
@@ -233,7 +217,6 @@ void DrawViewShell::SelectionHasChanged (void)
//#i47279# disable frame until after object has completed unload
LockUI aUILock(GetViewFrame());
pIPClient->DeactivateObject();
- //HMHmpDrView->ShowMarkHdl();
}
else
{
@@ -279,8 +262,9 @@ void DrawViewShell::SelectionHasChanged (void)
RTL_TEXTENCODING_UTF8 )).getStr() );
}
- if( HasCurrentFunction() )
+ if(HasCurrentFunction())
{
+ // SelectionHasChanged() needs to be triggered for current founction
GetCurrentFunction()->SelectionHasChanged();
}
else
@@ -291,7 +275,7 @@ void DrawViewShell::SelectionHasChanged (void)
// #96124# Invalidate for every subshell
GetViewShellBase().GetViewShellManager()->InvalidateAllSubShells(this);
- mpDrawView->UpdateSelectionClipboard( sal_False );
+ mpDrawView->UpdateSelectionClipboard( false );
GetViewShellBase().GetDrawController().FireSelectionChangeListener();
}
@@ -307,7 +291,7 @@ void DrawViewShell::SetZoom( long nZoom )
{
// Make sure that the zoom factor will not be recalculated on
// following window resizings.
- mbZoomOnPage = sal_False;
+ mbZoomOnPage = false;
ViewShell::SetZoom( nZoom );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
@@ -320,9 +304,9 @@ void DrawViewShell::SetZoom( long nZoom )
|*
\************************************************************************/
-void DrawViewShell::SetZoomRect( const Rectangle& rZoomRect )
+void DrawViewShell::SetZoomRange( const basegfx::B2DRange& rZoomRange )
{
- ViewShell::SetZoomRect( rZoomRect );
+ ViewShell::SetZoomRange( rZoomRange );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
mpViewOverlayManager->onZoomChanged();
@@ -335,12 +319,12 @@ void DrawViewShell::SetZoomRect( const Rectangle& rZoomRect )
|*
\************************************************************************/
-sal_uInt16 DrawViewShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+sal_uInt16 DrawViewShell::PrepareClose( bool bUI, bool bForBrowsing )
{
- if ( ViewShell::PrepareClose(bUI, bForBrowsing) != sal_True )
- return sal_False;
+ if ( !ViewShell::PrepareClose(bUI, bForBrowsing) )
+ return false;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
if( bRet && HasCurrentFunction() )
{
@@ -421,9 +405,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
SdPage* pPage;
String aPageName;
- sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
+ sal_uInt32 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
- for (sal_uInt16 i = 0; i < nPageCnt; i++)
+ for (sal_uInt32 i = 0; i < nPageCnt; i++)
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
aPageName = pPage->GetName();
@@ -445,7 +429,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
* MASTERPAGE
******************************************************************/
GetViewFrame()->SetChildWindow(
- AnimationChildWindow::GetChildWindowId(), sal_False );
+ AnimationChildWindow::GetChildWindowId(), false );
if (!mpActualPage)
{
@@ -454,10 +438,10 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
}
maTabControl.Clear();
- sal_uInt16 nActualMasterPageNum = 0;
- sal_uInt16 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
+ sal_uInt32 nActualMasterPageNum = 0;
+ sal_uInt32 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
- for (sal_uInt16 i = 0; i < nMasterPageCnt; i++)
+ for (sal_uInt32 i = 0; i < nMasterPageCnt; i++)
{
SdPage* pMaster = GetDoc()->GetMasterSdPage(i, mePageKind);
String aLayoutName(pMaster->GetLayoutName());
@@ -547,7 +531,7 @@ long DrawViewShell::GetHCtrlWidth()
|*
\************************************************************************/
-SvxRuler* DrawViewShell::CreateHRuler (::sd::Window* pWin, sal_Bool bIsFirst)
+SvxRuler* DrawViewShell::CreateHRuler (::sd::Window* pWin, bool bIsFirst)
{
Ruler* pRuler;
WinBits aWBits;
@@ -700,11 +684,11 @@ SdPage* DrawViewShell::getCurrentPage() const
if (meEditMode == EM_PAGE)
{
- return GetDoc()->GetSdPage((sal_uInt16)nCurrentPage, mePageKind);
+ return GetDoc()->GetSdPage(nCurrentPage, mePageKind);
}
else // EM_MASTERPAGE
{
- return GetDoc()->GetMasterSdPage((sal_uInt16)nCurrentPage, mePageKind);
+ return GetDoc()->GetMasterSdPage(nCurrentPage, mePageKind);
}
}
@@ -717,10 +701,10 @@ SdPage* DrawViewShell::getCurrentPage() const
void DrawViewShell::ResetActualPage()
{
- sal_uInt16 nCurrentPage = maTabControl.GetCurPageId() - 1;
- sal_uInt16 nPageCount = (meEditMode == EM_PAGE)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind);
+ sal_uInt32 nCurrentPage = maTabControl.GetCurPageId() - 1;
+ sal_uInt32 nPageCount = (meEditMode == EM_PAGE)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind);
if (nPageCount > 0)
- nCurrentPage = Min((sal_uInt16)(nPageCount - 1), nCurrentPage);
+ nCurrentPage = Min((sal_uInt32)(nPageCount - 1), nCurrentPage);
else
nCurrentPage = 0;
@@ -733,7 +717,7 @@ void DrawViewShell::ResetActualPage()
SdPage* pPage = NULL;
String aPageName;
- for (sal_uInt16 i = 0; i < nPageCount; i++)
+ for (sal_uInt32 i = 0; i < nPageCount; i++)
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
aPageName = pPage->GetName();
@@ -751,8 +735,8 @@ void DrawViewShell::ResetActualPage()
maTabControl.Clear();
sal_uInt16 nActualMasterPageNum = 0;
- sal_uInt16 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
- for (sal_uInt16 i = 0; i < nMasterPageCnt; i++)
+ sal_uInt32 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
+ for (sal_uInt32 i = 0; i < nMasterPageCnt; i++)
{
SdPage* pMaster = GetDoc()->GetMasterSdPage(i, mePageKind);
String aLayoutName(pMaster->GetLayoutName());
@@ -780,28 +764,27 @@ void DrawViewShell::ResetActualPage()
ErrCode DrawViewShell::DoVerb(long nVerb)
{
- if ( mpDrawView->AreObjectsMarked() )
+ SdrObject* pSelected = mpDrawView->getSelectedIfSingle();
+
+ if ( pSelected )
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ const sal_uInt32 nInv = pSelected->GetObjInventor();
+ const sal_uInt16 nSdrObjKind = pSelected->GetObjIdentifier();
- if (rMarkList.GetMarkCount() == 1)
+ if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
-
- if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2)
- {
- ActivateObject( (SdrOle2Obj*) pObj, nVerb);
- }
+ ActivateObject( (SdrOle2Obj*) pSelected, nVerb);
+ }
#ifdef STARIMAGE_AVAILABLE
- else if (nInv = SdrInventor && nSdrObjKind == OBJ_GRAF &&
- ((SdrGrafObj*) pObj)->GetGraphicType() == GRAPHIC_BITMAP &&
- SFX_APP()->HasFeature(SFX_FEATURE_SIMAGE))
+ else if (nInv = SdrInventor && nSdrObjKind == OBJ_GRAF &&
+ ((SdrGrafObj*) pSelected)->GetGraphicType() == GRAPHIC_BITMAP &&
+ SFX_APP()->HasFeature(SFX_FEATURE_SIMAGE))
+ {
+ SdrPageView* pSdrPageView = mpDrawView->GetSdrPageView();
+
+ if(pSdrPageView)
{
- SdrGrafObj* pSdrGrafObj = (SdrGrafObj*) pObj;
+ SdrGrafObj* pSdrGrafObj = (SdrGrafObj*) pSelected;
short nOK = RET_YES;
if ( pSdrGrafObj->GetFileName().Len() )
@@ -824,8 +807,6 @@ ErrCode DrawViewShell::DoVerb(long nVerb)
* OLE-Objekt erzeugen, StarImage starten
* Grafik-Objekt loeschen (durch OLE-Objekt ersetzt)
**************************************************************/
- //HMHmpDrView->HideMarkHdl();
-
SvStorageRef aStor = new SvStorage(String());
SvInPlaceObjectRef aNewIPObj = &((SvFactory*)SvInPlaceObject::ClassFactory())
->CreateAndInit(SimModuleDummy::GetID(SOFFICE_FILEFORMAT_CURRENT), aStor);
@@ -843,14 +824,15 @@ ErrCode DrawViewShell::DoVerb(long nVerb)
aName = pInfo->GetObjName();
}
- Rectangle aRect = pObj->GetLogicRect();
- SdrOle2Obj* pSdrOle2Obj = new SdrOle2Obj( aNewIPObj,
- aName, aRect );
+ Rectangle aRect = pSelected->GetLogicRect();
+ SdrOle2Obj* pSdrOle2Obj = new SdrOle2Obj(
+ mpDrawView->getSdrModelFromSdrView(),
+ aNewIPObj,
+ aName,
+ aRect );
- SdrPageView* pPV = mpDrawView->GetSdrPageView();
-
- pPV->GetObjList()->InsertObject( pSdrOle2Obj );
- mpDrawView->ReplaceObjectAtView( pObj, *pPV, pTempSdrGrafObj );
+ pSdrPageView->GetCurrentObjectList()->InsertObjectToSdrObjList(*pSdrOle2Obj);
+ mpDrawView->ReplaceObjectAtView( *pSelected, *pTempSdrGrafObj );
pSdrOle2Obj->SetLogicRect(aRect);
aNewIPObj->SetVisAreaSize(aRect.GetSize());
@@ -865,8 +847,8 @@ ErrCode DrawViewShell::DoVerb(long nVerb)
}
}
}
-#endif
}
+#endif
}
return 0;
@@ -879,9 +861,9 @@ ErrCode DrawViewShell::DoVerb(long nVerb)
|*
\************************************************************************/
-sal_Bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
+bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
{
- sal_Bool bActivated = sal_False;
+ bool bActivated = false;
if ( !GetDocSh()->IsUIActive() )
{
@@ -907,7 +889,7 @@ sal_Bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
void LclResetFlag (bool& rbFlag) {rbFlag = false;}
-sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
+bool DrawViewShell::SwitchPage(sal_uInt32 nSelectedPage)
{
/** Under some circumstances there are nested calls to SwitchPage() and
may crash the application (activation of form controls when the
@@ -916,7 +898,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
would jump to the wrong page anyway.)
*/
if (mbIsInSwitchPage)
- return sal_False;
+ return false;
mbIsInSwitchPage = true;
comphelper::ScopeGuard aGuard (::boost::bind(LclResetFlag, ::boost::ref(mbIsInSwitchPage)));
@@ -928,10 +910,10 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
::std::mem_fun(&DrawViewShell::SwitchPage),
this,
nSelectedPage));
- return sal_False;
+ return false;
}
- sal_Bool bOK = sal_False;
+ bool bOK = false;
// With the current implementation of FuSlideShow there is a problem
// when it dsplays the show in a window: When the show is stopped it
@@ -949,7 +931,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
{
// Make sure that the given page index points to an existing page. Move
// the index into the valid range if necessary.
- sal_uInt16 nPageCount = (meEditMode == EM_PAGE)
+ sal_uInt32 nPageCount = (meEditMode == EM_PAGE)
? GetDoc()->GetSdPageCount(mePageKind)
: GetDoc()->GetMasterSdPageCount(mePageKind);
if (nSelectedPage >= nPageCount)
@@ -960,7 +942,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
{
ModifyGuard aGuard2( GetDoc() );
- bOK = sal_True;
+ bOK = true;
if (mpActualPage)
{
@@ -969,20 +951,22 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
if (meEditMode == EM_MASTERPAGE)
{
if( GetDoc()->GetMasterSdPageCount(mePageKind) > nSelectedPage )
+ {
pNewPage = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
+ }
if( pNewPage )
{
- SdrPageView* pPV = mpDrawView->GetSdrPageView();
-
+ SdrPageView* pSdrPageView = mpDrawView->GetSdrPageView();
String sPageText (pNewPage->GetLayoutName());
sPageText.Erase(sPageText.SearchAscii(SD_LT_SEPARATOR));
- if (pPV
- && pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() )
+
+ if (pSdrPageView
+ && pNewPage == dynamic_cast< SdPage* >( &pSdrPageView->getSdrPageFromSdrPageView() )
&& sPageText == maTabControl.GetPageText(nSelectedPage+1))
{
// this slide is already visible
- return sal_True;
+ return true;
}
}
}
@@ -996,15 +980,18 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
if (mpActualPage == pNewPage)
{
- SdrPageView* pPV = mpDrawView->GetSdrPageView();
+ SdrPageView* pSdrPageView = mpDrawView->GetSdrPageView();
- SdPage* pCurrentPage = dynamic_cast< SdPage* >( pPV->GetPage());
- if (pPV
- && pNewPage == pCurrentPage
- && pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1))
+ if(pSdrPageView)
{
- // this slide is already visible
- return sal_True;
+ SdPage* pCurrentPage = dynamic_cast< SdPage* >( &pSdrPageView->getSdrPageFromSdrPageView());
+
+ if (pNewPage == pCurrentPage
+ && pNewPage->GetName() == maTabControl.GetPageText(nSelectedPage+1))
+ {
+ // this slide is already visible
+ return true;
+ }
}
}
}
@@ -1024,8 +1011,8 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
// Passt die selektierte Seite zur MasterPage?
- sal_uInt16 nPageCount = GetDoc()->GetSdPageCount(mePageKind);
- for (sal_uInt16 i = 0; i < nPageCount; i++)
+ sal_uInt32 nPageCount = GetDoc()->GetSdPageCount(mePageKind);
+ for (sal_uInt32 i = 0; i < nPageCount; i++)
{
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
if(pPage && pPage->IsSelected() && pMaster == &(pPage->TRG_GetMasterPage()))
@@ -1038,7 +1025,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
if (!mpActualPage)
{
// Die erste Seite nehmen, welche zur MasterPage passt
- for (sal_uInt16 i = 0; i < nPageCount; i++)
+ for (sal_uInt32 i = 0; i < nPageCount; i++)
{
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
if(pPage && pMaster == &(pPage->TRG_GetMasterPage()))
@@ -1050,10 +1037,10 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
}
}
- for (sal_uInt16 i = 0; i < GetDoc()->GetSdPageCount(mePageKind); i++)
+ for (sal_uInt32 i = 0; i < GetDoc()->GetSdPageCount(mePageKind); i++)
{
// Alle Seiten deselektieren
- GetDoc()->SetSelected( GetDoc()->GetSdPage(i, mePageKind), sal_False);
+ GetDoc()->SetSelected( GetDoc()->GetSdPage(i, mePageKind), false);
}
if (!mpActualPage)
@@ -1064,7 +1051,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
// diese Seite auch selektieren (mpActualPage zeigt immer auf Zeichenseite,
// nie auf eine Masterpage)
- GetDoc()->SetSelected(mpActualPage, sal_True);
+ GetDoc()->SetSelected(mpActualPage, true);
rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetDoc() ) );
if( !xSlideshow.is() || !xSlideshow->isRunning() || ( xSlideshow->getAnimationMode() != ANIMATIONMODE_SHOW ) )
@@ -1081,7 +1068,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
/**********************************************************************
* PAGEMODE
**********************************************************************/
- GetDoc()->SetSelected(mpActualPage, sal_True);
+ GetDoc()->SetSelected(mpActualPage, true);
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
@@ -1105,8 +1092,7 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
}
}
- mpDrawView->HideSdrPage();
- mpDrawView->ShowSdrPage(mpActualPage);
+ mpDrawView->ShowSdrPage(*mpActualPage);
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(mpActualPage);
SdrPageView* pNewPageView = mpDrawView->GetSdrPageView();
@@ -1166,15 +1152,13 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
}
}
- mpDrawView->HideSdrPage();
-
SdPage* pMaster = GetDoc()->GetMasterSdPage(nSelectedPage, mePageKind);
if( !pMaster ) // Falls es diese Page nicht geben sollte
pMaster = GetDoc()->GetMasterSdPage(0, mePageKind);
- sal_uInt16 nNum = pMaster->GetPageNum();
- mpDrawView->ShowSdrPage(mpDrawView->GetModel()->GetMasterPage(nNum));
+ sal_uInt32 nNum = pMaster->GetPageNumber();
+ mpDrawView->ShowSdrPage(*mpDrawView->getSdrModelFromSdrView().GetMasterPage(nNum));
GetViewShellBase().GetDrawController().FireSwitchCurrentPage(pMaster);
@@ -1214,15 +1198,15 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
{
// set pages for all available handout presentation objects
sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList();
- SdrObject* pObj = 0;
+ const SdrObject* pObj = 0;
while( (pObj = rShapeList.getNextShape(pObj)) != 0 )
{
- if( pMaster->GetPresObjKind(pObj) == PRESOBJ_HANDOUT )
+ if( PRESOBJ_HANDOUT == pMaster->GetPresObjKind(pObj) )
{
// #i105146# We want no content to be displayed for PK_HANDOUT,
// so just never set a page as content
- static_cast<SdrPageObj*>(pObj)->SetReferencedPage(0);
+ static_cast< SdrPageObj* >(const_cast< SdrObject* >(pObj))->SetReferencedPage(0);
}
}
}
@@ -1235,15 +1219,15 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
// Damit der Navigator (und das Effekte-Window) das mitbekommt (/-men)
SfxBindings& rBindings = GetViewFrame()->GetBindings();
- rBindings.Invalidate(SID_NAVIGATOR_PAGENAME, sal_True, sal_False);
- rBindings.Invalidate(SID_STATUS_PAGE, sal_True, sal_False);
- rBindings.Invalidate(SID_DELETE_MASTER_PAGE, sal_True, sal_False);
- rBindings.Invalidate(SID_DELETE_PAGE, sal_True, sal_False);
- rBindings.Invalidate(SID_ASSIGN_LAYOUT,sal_True,sal_False);
- rBindings.Invalidate(SID_INSERTPAGE,sal_True,sal_False);
+ rBindings.Invalidate(SID_NAVIGATOR_PAGENAME, true, false);
+ rBindings.Invalidate(SID_STATUS_PAGE, true, false);
+ rBindings.Invalidate(SID_DELETE_MASTER_PAGE, true, false);
+ rBindings.Invalidate(SID_DELETE_PAGE, true, false);
+ rBindings.Invalidate(SID_ASSIGN_LAYOUT,true,false);
+ rBindings.Invalidate(SID_INSERTPAGE,true,false);
UpdatePreview( mpActualPage );
- mpDrawView->AdjustMarkHdl();
+ mpDrawView->SetMarkHandles();
}
return (bOK);
@@ -1256,12 +1240,12 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
|*
\************************************************************************/
-sal_Bool DrawViewShell::IsSwitchPageAllowed() const
+bool DrawViewShell::IsSwitchPageAllowed() const
{
bool bOK = true;
FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
- if (pFormShell!=NULL && !pFormShell->PrepareClose (sal_False))
+ if (pFormShell!=NULL && !pFormShell->PrepareClose (false))
bOK = false;
return bOK;
@@ -1297,17 +1281,17 @@ void DrawViewShell::ResetActualLayer()
String aLayoutLayer( SdResId(STR_LAYER_LAYOUT) );
String aControlsLayer( SdResId(STR_LAYER_CONTROLS) );
String aMeasureLinesLayer( SdResId(STR_LAYER_MEASURELINES) );
- sal_uInt16 nActiveLayer = SDRLAYER_NOTFOUND;
- SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
- sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount();
+ SdrLayerID aTheActiveLayer(SDRLAYER_NOTFOUND);
+ SdrLayerAdmin& rLayerAdmin = GetDoc()->GetModelLayerAdmin();
+ const SdrLayerID aLayerCnt(rLayerAdmin.GetLayerCount());
- for ( sal_uInt16 nLayer = 0; nLayer < nLayerCnt; nLayer++ )
+ for ( SdrLayerID aLayer = 0; aLayer < aLayerCnt; aLayer++ )
{
- aName = rLayerAdmin.GetLayer(nLayer)->GetName();
+ aName = rLayerAdmin.GetLayer(aLayer)->GetName();
if ( aName == aActiveLayer )
{
- nActiveLayer = nLayer;
+ aTheActiveLayer = aLayer;
}
if ( aName != aBackgroundLayer )
@@ -1319,18 +1303,17 @@ void DrawViewShell::ResetActualLayer()
aName != aControlsLayer &&
aName != aMeasureLinesLayer)
{
- pLayerBar->InsertPage(nLayer+1, aName);
-
+ pLayerBar->InsertPage(aLayer + 1, aName);
TabBarPageBits nBits = 0;
- SdrPageView* pPV = mpDrawView->GetSdrPageView();
+ SdrPageView* pSdrPageView = mpDrawView->GetSdrPageView();
- if (pPV && !pPV->IsLayerVisible(aName))
+ if (pSdrPageView && !pSdrPageView->IsLayerVisible(aName))
{
// Unsichtbare Layer werden anders dargestellt
nBits = TPB_SPECIAL;
}
- pLayerBar->SetPageBits(nLayer+1, nBits);
+ pLayerBar->SetPageBits(aLayer + 1, nBits);
}
}
else
@@ -1338,37 +1321,37 @@ void DrawViewShell::ResetActualLayer()
// Layer der MasterPage nicht auf Page anzeigen
if ( aName != aBackgroundObjLayer )
{
- pLayerBar->InsertPage(nLayer+1, aName);
-
+ pLayerBar->InsertPage(aLayer + 1, aName);
TabBarPageBits nBits = 0;
+ SdrPageView* pSdrPageView = mpDrawView->GetSdrPageView();
- if (!mpDrawView->GetSdrPageView()->IsLayerVisible(aName))
+ if(pSdrPageView && !pSdrPageView->IsLayerVisible(aName))
{
// Unsichtbare Layer werden anders dargestellt
nBits = TPB_SPECIAL;
}
- pLayerBar->SetPageBits(nLayer+1, nBits);
+ pLayerBar->SetPageBits(aLayer + 1, nBits);
}
}
}
}
- if ( nActiveLayer == SDRLAYER_NOTFOUND )
+ if ( aTheActiveLayer == SDRLAYER_NOTFOUND )
{
if( nOldLayerCnt == pLayerBar->GetPageCount() )
{
- nActiveLayer = nOldLayerId - 1;
+ aTheActiveLayer = nOldLayerId - 1;
}
else
{
- nActiveLayer = ( meEditMode == EM_MASTERPAGE ) ? 2 : 0;
+ aTheActiveLayer = ( meEditMode == EM_MASTERPAGE ) ? 2 : 0;
}
- mpDrawView->SetActiveLayer( pLayerBar->GetPageText(nActiveLayer + 1) );
+ mpDrawView->SetActiveLayer( pLayerBar->GetPageText(aTheActiveLayer + 1) );
}
- pLayerBar->SetCurPageId(nActiveLayer + 1);
+ pLayerBar->SetCurPageId(aTheActiveLayer + 1);
GetViewFrame()->GetBindings().Invalidate( SID_MODIFYLAYER );
GetViewFrame()->GetBindings().Invalidate( SID_DELETE_LAYER );
}
@@ -1397,16 +1380,16 @@ sal_Int8 DrawViewShell::AcceptDrop (
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer )
+ sal_uInt32 nPage,
+ SdrLayerID aLayer )
{
if( nPage != SDRPAGE_NOTFOUND )
- nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
+ nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNumber();
if( SlideShow::IsRunning( GetViewShellBase() ) )
return DND_ACTION_NONE;
- return mpDrawView->AcceptDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer );
+ return mpDrawView->AcceptDrop( rEvt, rTargetHelper, pTargetWindow, nPage, aLayer );
}
/*************************************************************************
@@ -1419,17 +1402,17 @@ sal_Int8 DrawViewShell::ExecuteDrop (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
if( nPage != SDRPAGE_NOTFOUND )
- nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNum();
+ nPage = GetDoc()->GetSdPage( nPage, mePageKind )->GetPageNumber();
if( SlideShow::IsRunning( GetViewShellBase() ) )
return DND_ACTION_NONE;
Broadcast(ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START));
- sal_Int8 nResult (mpDrawView->ExecuteDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer ));
+ sal_Int8 nResult (mpDrawView->ExecuteDrop( rEvt, rTargetHelper, pTargetWindow, nPage, aLayer ));
Broadcast(ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END));
return nResult;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 7cc906faa92b..9a679765013a 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -58,8 +58,6 @@
#include <svx/xlnwtit.hxx>
#include <svx/svdoattr.hxx>
#include <svx/xlnstwit.hxx>
-#include <svx/sdtmfitm.hxx>
-#include <svx/sdtagitm.hxx>
#include <svx/xlnedwit.hxx>
#include <svx/fontworkbar.hxx>
@@ -91,6 +89,7 @@
#include "sdabstdlg.hxx"
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <svx/svdlegacy.hxx>
#include <strings.hrc>
@@ -146,29 +145,27 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
if( rReq.GetArgs() )
{
- sal_Bool bMergeUndo = sal_False;
+ bool bMergeUndo = false;
::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
// Anpassungen Start/EndWidth #63083#
if(nSId == SID_ATTR_LINE_WIDTH)
{
- SdrObject* pObj = NULL;
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nCount = rMarkList.GetMarkCount();
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
const sal_Int32 nNewLineWidth(((const XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue());
const bool bUndo(mpDrawView->IsUndoEnabled());
- for (sal_uLong i=0; i<nCount; i++)
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SfxItemSet aAttr(GetDoc()->GetPool());
- pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ SfxItemSet aAttr(GetDoc()->GetItemPool());
+ SdrObject* pObj = aSelection[i];
aAttr.Put(pObj->GetMergedItemSet());
sal_Int32 nActLineWidth = ((const XLineWidthItem&)aAttr.Get(XATTR_LINEWIDTH)).GetValue();
if(nActLineWidth != nNewLineWidth)
{
- sal_Bool bSetItemSet(sal_False);
+ bool bSetItemSet(false);
// #86265# do this for SFX_ITEM_DEFAULT and for SFX_ITEM_SET
if(SFX_ITEM_DONTCARE != aAttr.GetItemState(XATTR_LINESTARTWIDTH))
@@ -177,7 +174,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
if(nValNew < 0)
nValNew = 0;
- bSetItemSet = sal_True;
+ bSetItemSet = true;
aAttr.Put(XLineStartWidthItem(nValNew));
}
@@ -188,7 +185,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
if(nValNew < 0)
nValNew = 0;
- bSetItemSet = sal_True;
+ bSetItemSet = true;
aAttr.Put(XLineEndWidthItem(nValNew));
}
@@ -220,18 +217,16 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (nSId == SID_ATTR_FILL_SHADOW)
{
// Ggf. werden transparente Objekte wei?gefuellt
- SdrObject* pObj = NULL;
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nCount = rMarkList.GetMarkCount();
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
const bool bUndo = mpDrawView->IsUndoEnabled();
- for (sal_uLong i=0; i<nCount; i++)
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SfxItemSet aAttr(GetDoc()->GetPool());
- pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ SfxItemSet aAttr(GetDoc()->GetItemPool());
+ SdrObject* pObj = aSelection[i];
// #i25616#
- if(!pObj->ISA(SdrGrafObj))
+ if(!static_cast< SdrGrafObj* >(pObj))
{
aAttr.Put(pObj->GetMergedItemSet());
@@ -246,7 +241,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
// daher hart attributieren: Fuellung setzen
if (!bMergeUndo)
{
- bMergeUndo = sal_True;
+ bMergeUndo = true;
pUndoManager->EnterListAction( String(), String() );
mpDrawView->BegUndo();
}
@@ -308,12 +303,12 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
// const SfxPoolItem* pItem = rReq.GetArg( SID_HYPHENATION );
// ^-- Soll so nicht benutzt werden (Defaults sind falsch) !
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_HYPHENATION, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_HYPHENATION );
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
- sal_Bool bValue = ( (const SfxBoolItem*) pItem)->GetValue();
+ bool bValue = ( (const SfxBoolItem*) pItem)->GetValue();
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
mpDrawView->SetAttributes( aSet );
}
@@ -321,7 +316,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
DBG_ERROR(" Kein Wert fuer Silbentrennung!");
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
- sal_Bool bValue = sal_True;
+ bool bValue = true;
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
mpDrawView->SetAttributes( aSet );
}
@@ -339,7 +334,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if(HasCurrentFunction(SID_BEZIER_EDIT) )
GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
if (pNewPage != NULL)
- SwitchPage((pNewPage->GetPageNum()-1)/2);
+ SwitchPage((pNewPage->GetPageNumber()-1)/2);
rReq.Done ();
}
break;
@@ -355,13 +350,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
xMasterPagesSupplier->getMasterPages());
if (xMasterPages.is())
{
- sal_uInt16 nIndex = GetCurPageId();
+ sal_uInt32 nIndex = GetCurPageId();
xMasterPages->insertNewByIndex (nIndex);
// Create shapes for the default layout.
SdPage* pMasterPage = GetDoc()->GetMasterSdPage(
nIndex, PK_STANDARD);
- pMasterPage->CreateTitleAndLayout (sal_True,sal_True);
+ pMasterPage->CreateTitleAndLayout (true,true);
}
}
@@ -382,7 +377,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
mpDrawView->SdrEndTextEdit();
}
- sal_uInt16 nPage = maTabControl.GetCurPageId() - 1;
+ sal_uInt32 nPage = maTabControl.GetCurPageId() - 1;
mpActualPage = GetDoc()->GetSdPage(nPage, mePageKind);
::sd::ViewShell::mpImpl->ProcessModifyPageSlot (
rReq,
@@ -419,7 +414,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
mpDrawView->SdrEndTextEdit();
}
- sal_uInt16 nPageId = maTabControl.GetCurPageId();
+ sal_uInt32 nPageId = maTabControl.GetCurPageId();
SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE )
? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() )
: GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() );
@@ -481,13 +476,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (pArgs)
if (pArgs->Count () == 3)
{
- SFX_REQUEST_ARG (rReq, pWidth, SfxUInt32Item, ID_VAL_PAGEWIDTH, sal_False);
- SFX_REQUEST_ARG (rReq, pHeight, SfxUInt32Item, ID_VAL_PAGEHEIGHT, sal_False);
- SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
+ SFX_REQUEST_ARG (rReq, pWidth, SfxUInt32Item, ID_VAL_PAGEWIDTH );
+ SFX_REQUEST_ARG (rReq, pHeight, SfxUInt32Item, ID_VAL_PAGEHEIGHT );
+ SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS );
- Size aSize (pWidth->GetValue (), pHeight->GetValue ());
+ const basegfx::B2DVector aSize (pWidth->GetValue (), pHeight->GetValue ());
- SetupPage (aSize, 0, 0, 0, 0, sal_True, sal_False, pScaleAll->GetValue ());
+ SetupPage (aSize, 0, 0, 0, 0, true, false, pScaleAll->GetValue ());
rReq.Ignore ();
break;
}
@@ -504,17 +499,17 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (pArgs)
if (pArgs->Count () == 5)
{
- SFX_REQUEST_ARG (rReq, pLeft, SfxUInt32Item, ID_VAL_PAGELEFT, sal_False);
- SFX_REQUEST_ARG (rReq, pRight, SfxUInt32Item, ID_VAL_PAGERIGHT, sal_False);
- SFX_REQUEST_ARG (rReq, pUpper, SfxUInt32Item, ID_VAL_PAGETOP, sal_False);
- SFX_REQUEST_ARG (rReq, pLower, SfxUInt32Item, ID_VAL_PAGEBOTTOM, sal_False);
- SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
+ SFX_REQUEST_ARG (rReq, pLeft, SfxUInt32Item, ID_VAL_PAGELEFT );
+ SFX_REQUEST_ARG (rReq, pRight, SfxUInt32Item, ID_VAL_PAGERIGHT );
+ SFX_REQUEST_ARG (rReq, pUpper, SfxUInt32Item, ID_VAL_PAGETOP );
+ SFX_REQUEST_ARG (rReq, pLower, SfxUInt32Item, ID_VAL_PAGEBOTTOM );
+ SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS );
- Size aEmptySize (0, 0);
+ const basegfx::B2DVector aEmptySize (0.0, 0.0);
SetupPage (aEmptySize, pLeft->GetValue (), pRight->GetValue (),
pUpper->GetValue (), pLower->GetValue (),
- sal_False, sal_True, pScaleAll->GetValue ());
+ false, true, pScaleAll->GetValue ());
rReq.Ignore ();
break;
}
@@ -530,7 +525,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (pArgs && pArgs->Count () == 1 )
{
- SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER, sal_False);
+ SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER );
if (CHECK_RANGE (5, pScale->GetValue (), 3000))
{
SetZoom (pScale->GetValue ());
@@ -555,7 +550,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (pArgs)
if (pArgs->Count () == 1)
{
- SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM, sal_False);
+ SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM );
if (CHECK_RANGE (10, pScale->GetValue (), 1000))
{
SetZoom (pScale->GetValue ());
@@ -580,7 +575,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ATTR_ZOOM:
{
const SfxItemSet* pArgs = rReq.GetArgs();
- mbZoomOnPage = sal_False;
+ mbZoomOnPage = false;
if ( pArgs )
{
@@ -640,7 +635,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( rReq.GetSlot() == SID_CHANGEBEZIER )
{
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->ConvertMarkedToPathObj(sal_False);
+ mpDrawView->ConvertMarkedToPathObj(false);
}
else
{
@@ -651,7 +646,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
else
{
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->ConvertMarkedToPolyObj(sal_False);
+ mpDrawView->ConvertMarkedToPolyObj(false);
}
}
@@ -683,7 +678,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
else
{
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->ConvertMarkedToPathObj(sal_True);
+ mpDrawView->ConvertMarkedToPathObj(true);
Invalidate(SID_CONVERT_TO_CONTOUR);
}
@@ -731,6 +726,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
bool bDone(false);
+ // aw080: Take a look at AAed graphic creation
// I have to get the image here directly since GetMarkedObjBitmapEx works
// based on Bitmaps, but not on BitmapEx, thus throwing away the alpha
// channel. Argh! GetMarkedObjBitmapEx itself is too widely used to safely
@@ -738,15 +734,12 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
// exception to get good results for Svgs. This is how the code gets more
// and more crowded, at last I made a remark for myself to change this
// as one of the next tasks.
- if(1 == mpDrawView->GetMarkedObjectCount())
- {
- const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->GetMarkedObjectByIndex(0));
+ const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->getSelectedIfSingle());
- if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg())
- {
- aGraphic = Graphic(pSdrGrafObj->GetGraphic().getSvgData()->getReplacement());
- bDone = true;
- }
+ if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg())
+ {
+ aGraphic = Graphic(pSdrGrafObj->GetGraphic().getSvgData()->getReplacement());
+ bDone = true;
}
if(!bDone)
@@ -758,37 +751,34 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
// create new object
- SdrGrafObj* pGraphicObj = new SdrGrafObj (aGraphic);
+ SdrGrafObj* pGraphicObj = new SdrGrafObj(
+ *GetDoc(),
+ aGraphic);
// get some necessary info and ensure it
- const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList());
- const sal_uInt32 nMarkCount(rMarkList.GetMarkCount());
- SdrPageView* pPageView = mpDrawView->GetSdrPageView();
- OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
- OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)");
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+ OSL_ENSURE(aSelection.size(), "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
// fit rectangle of new graphic object to selection's mark rect
- Rectangle aAllMarkedRect;
- rMarkList.TakeBoundRect(pPageView, aAllMarkedRect);
- pGraphicObj->SetLogicRect(aAllMarkedRect);
+ const basegfx::B2DRange aAllMarkedRange(sdr::legacy::GetAllObjBoundRange(aSelection));
+ sdr::legacy::SetLogicRange(*pGraphicObj, aAllMarkedRange);
// #i71540# to keep the order, it is necessary to replace the lowest object
// of the selection with the new object. This also means that with multi
// selection, all other objects need to be deleted first
- SdrMark* pFirstMark = rMarkList.GetMark(0L);
- SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj();
+ SdrObject* pReplacementCandidate = aSelection[0];
- if(nMarkCount > 1L)
+ if(aSelection.size() > 1)
{
// take first object out of selection
- mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true);
+ mpDrawView->MarkObj(*pReplacementCandidate, true );
// clear remaining selection
mpDrawView->DeleteMarkedObj();
}
// now replace lowest object with new one
- mpDrawView->ReplaceObjectAtView(pReplacementCandidate, *pPageView, pGraphicObj);
+ mpDrawView->ReplaceObjectAtView(*pReplacementCandidate, *pGraphicObj);
// switch off undo
mpDrawView->EndUndo();
@@ -809,95 +799,96 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
::Outliner* pOutl = mpDrawView->GetTextEditOutliner();
if (pOutl)
{
- pOutl->RemoveFields(sal_True, (TypeId) SvxURLField::StaticType());
+ pOutl->RemoveFields(true, &typeid(SvxURLField));
}
pSet = new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
- mpDrawView->SetAttributes( *pSet, sal_True );
+ mpDrawView->SetAttributes( *pSet, true );
}
else
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nCount = rMarkList.GetMarkCount();
-
- // In diese Liste werden fuer jedes Praesentationsobjekt ein SfxItemSet
- // der harten Attribute sowie der UserCall eingetragen, da diese beim nachfolgenden
- // mpDrawView->SetAttributes( *pSet, sal_True ) verloren gehen und spaeter restauriert
- // werden muessen
- List* pAttrList = new List();
- SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage();
- sal_uLong i;
-
- for ( i = 0; i < nCount; i++ )
+ if(mpDrawView->GetSdrPageView())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
-
- if( pPresPage->IsPresObj( pObj ) )
+ // In diese Liste werden fuer jedes Praesentationsobjekt ein SfxItemSet
+ // der harten Attribute sowie die connection zum SdrObject eingetragen, da diese beim nachfolgenden
+ // mpDrawView->SetAttributes( *pSet, true ) verloren gehen und spaeter restauriert
+ // werden muessen
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+ ::std::vector< SfxItemSet* > aAttrVector;
+ ::std::vector< SdrPage* > aPageVector;
+ SdPage& rPresPage = (SdPage&) mpDrawView->GetSdrPageView()->getSdrPageFromSdrPageView();
+ sal_uInt32 i;
+
+ for ( i = 0; i < aSelection.size(); i++ )
{
- SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
- pNewSet->Put(pObj->GetMergedItemSet());
- pAttrList->Insert( pNewSet, LIST_APPEND );
- pAttrList->Insert( pObj->GetUserCall(), LIST_APPEND );
- }
- }
+ SdrObject* pObj = aSelection[i];
- pSet = new SfxItemSet( GetPool() );
- mpDrawView->SetAttributes( *pSet, sal_True );
+ if( rPresPage.IsPresObj( pObj ) )
+ {
+ SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetItemPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
+ pNewSet->Put(pObj->GetMergedItemSet());
+ aAttrVector.push_back( pNewSet );
+ aPageVector.push_back( findConnectionToSdrObject(pObj) );
+ }
+ }
- sal_uLong j = 0;
+ pSet = new SfxItemSet( GetPool() );
+ mpDrawView->SetAttributes( *pSet, true );
+ sal_uInt32 j = 0;
- for ( i = 0; i < nCount; i++ )
- {
- SfxStyleSheet* pSheet = NULL;
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
-
- if (pObj->GetObjIdentifier() == OBJ_TITLETEXT)
- {
- pSheet = mpActualPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
- if (pSheet)
- pObj->SetStyleSheet(pSheet, sal_False);
- }
- else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
+ for ( i = 0; i < aSelection.size(); i++ )
{
- for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
+ SfxStyleSheet* pSheet = NULL;
+ SdrObject* pObj = aSelection[i];
+
+ if (pObj->GetObjIdentifier() == OBJ_TITLETEXT)
{
- pSheet = mpActualPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
- DBG_ASSERT(pSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden");
+ pSheet = mpActualPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
if (pSheet)
+ pObj->SetStyleSheet(pSheet, false);
+ }
+ else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
+ {
+ for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
{
- pObj->StartListening(*pSheet);
+ pSheet = mpActualPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
+ DBG_ASSERT(pSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden");
+ if (pSheet)
+ {
+ pObj->StartListening(*pSheet);
- if( nLevel == 1 )
+ if( nLevel == 1 )
// Textrahmen hoert auf StyleSheet der Ebene1
- pObj->NbcSetStyleSheet(pSheet, sal_False);
-
+ pObj->SetStyleSheet(pSheet, false);
+ }
}
}
- }
- if( pPresPage->IsPresObj( pObj ) )
- {
- SfxItemSet* pNewSet = (SfxItemSet*) pAttrList->GetObject(j++);
- SdrObjUserCall* pUserCall = (SdrObjUserCall*) pAttrList->GetObject(j++);
-
- if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SFX_ITEM_ON )
+ if( rPresPage.IsPresObj( pObj ) )
{
- pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT));
- }
+ SfxItemSet* pNewSet = aAttrVector[j];
- if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SFX_ITEM_ON )
- {
- pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT));
- }
+ if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SFX_ITEM_ON )
+ {
+ pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT));
+ }
- if( pUserCall )
- pObj->SetUserCall( pUserCall );
+ if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SFX_ITEM_ON )
+ {
+ pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT));
+ }
+
+ SdPage* pConnectionToSdrObject = dynamic_cast< SdPage* >(aPageVector[j++]);
+
+ if( pConnectionToSdrObject )
+ {
+ establishConnectionToSdrObject(pObj, pConnectionToSdrObject);
+ }
- delete pNewSet;
+ delete pNewSet;
+ }
}
}
-
- delete pAttrList;
}
delete pSet;
@@ -907,18 +898,19 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_DELETE_SNAPITEM:
{
- SdrPageView* pPV;
- Point aMPos = GetActiveWindow()->PixelToLogic( maMousePos );
- sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( Size(
- FuPoor::HITPIX, 0 ) ).Width();
- sal_uInt16 nHelpLine;
+ const basegfx::B2DPoint aMPos(GetActiveWindow()->GetInverseViewTransformation() * maMousePos);
+ const double fHitLog(basegfx::B2DVector(GetActiveWindow()->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength());
+ sal_uInt32 nHelpLine;
+ mbMousePosFreezed = false;
- mbMousePosFreezed = sal_False;
-
- if( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
+ if( mpDrawView->PickHelpLine( aMPos, fHitLog, nHelpLine) )
{
- pPV->DeleteHelpLine( nHelpLine );
+ if(mpDrawView->GetSdrPageView())
+ {
+ mpDrawView->GetSdrPageView()->DeleteHelpLine( nHelpLine );
+ }
}
+
Cancel();
rReq.Ignore ();
}
@@ -954,16 +946,14 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_SAVEGRAPHIC:
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(mpDrawView->getSelectedIfSingle());
+
+ if(pGrafObj )
{
- SdrGrafObj *pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
- if(pGrafObj )
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape( pGrafObj->getUnoShape(), com::sun::star::uno::UNO_QUERY );
- SdGRFFilter::SaveGraphic( xShape );
- }
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape( pGrafObj->getUnoShape(), com::sun::star::uno::UNO_QUERY );
+ SdGRFFilter::SaveGraphic( xShape );
}
+
Cancel();
rReq.Ignore();
}
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index af25326bc0d5..f2748d206f94 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -96,6 +96,7 @@
#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
#include <com/sun/star/drawing/framework/XConfiguration.hpp>
#include <com/sun/star/frame/XFrame.hpp>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework;
@@ -150,12 +151,12 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
{
case SID_SWITCHPAGE: // BASIC
{
- sal_Bool bWasBasic = sal_False;
+ bool bWasBasic = false;
// switch page in running slide show
if(SlideShow::IsRunning(GetViewShellBase()) && rReq.GetArgs())
{
- SFX_REQUEST_ARG(rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE, sal_False);
+ SFX_REQUEST_ARG(rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE );
SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber((sal_Int32)((pWhatPage->GetValue()-1)>>1));
}
else
@@ -169,8 +170,8 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
}
else if (pArgs->Count () == 2)
{
- SFX_REQUEST_ARG (rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE, sal_False);
- SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND, sal_False);
+ SFX_REQUEST_ARG (rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE );
+ SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND );
sal_Int32 nWhatPage = (sal_Int32)pWhatPage->GetValue ();
sal_Int32 nWhatKind = (sal_Int32)pWhatKind->GetValue ();
@@ -182,7 +183,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
}
else if (meEditMode != EM_MASTERPAGE)
{
- if (! CHECK_RANGE (0, nWhatPage, GetDoc()->GetSdPageCount((PageKind)nWhatKind)))
+ if (! CHECK_RANGE (0, nWhatPage, (sal_Int32)GetDoc()->GetSdPageCount((PageKind)nWhatKind)))
{
StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
rReq.Ignore ();
@@ -191,7 +192,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
nSelectedPage = (short) nWhatPage;
mePageKind = (PageKind) nWhatKind;
- bWasBasic = sal_True;
+ bWasBasic = true;
}
}
else
@@ -224,7 +225,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if( pArgs && pArgs->Count () == 1)
{
- SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
+ SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER );
if( pWhatLayer )
nCurPage = (short) pWhatLayer->GetValue ();
}
@@ -243,8 +244,8 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if ( pArgs && pArgs->Count () == 2)
{
- SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
- SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND, sal_False);
+ SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, ID_VAL_ISACTIVE );
+ SFX_REQUEST_ARG (rReq, pWhatKind, SfxUInt32Item, ID_VAL_WHATKIND );
sal_Int32 nWhatKind = (sal_Int32)pWhatKind->GetValue ();
if (CHECK_RANGE (PK_STANDARD, nWhatKind, PK_HANDOUT))
@@ -271,8 +272,8 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if ( pArgs && pArgs->Count () == 2)
{
- SFX_REQUEST_ARG (rReq, pWhatLayerMode, SfxBoolItem, ID_VAL_ISACTIVE, sal_False);
- SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
+ SFX_REQUEST_ARG (rReq, pWhatLayerMode, SfxBoolItem, ID_VAL_ISACTIVE );
+ SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER );
sal_Int32 nWhatLayer = (sal_Int32)pWhatLayer->GetValue ();
if (CHECK_RANGE (EM_PAGE, nWhatLayer, EM_MASTERPAGE))
@@ -339,30 +340,17 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
{
- const SfxRectangleItem& rRect =
- (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE);
- Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) );
+ SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >(mpDrawView->getSelectedIfSingle());
- if ( mpDrawView->AreObjectsMarked() )
- {
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( pObj );
- if(pOle2Obj)
- {
- if( pOle2Obj->GetObjRef().is() )
+ if(pOle2Obj && pOle2Obj->GetObjRef().is() )
{
- pOle2Obj->SetLogicRect(aRect);
- }
- }
- }
+ const SfxRectangleItem& rRect =
+ (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE);
+ const Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) );
+ sdr::legacy::SetLogicRect(*pOle2Obj, aRect);
}
}
+
rReq.Ignore ();
break;
}
@@ -421,7 +409,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
{
if( rReq.GetArgs() )
{
- SFX_REQUEST_ARG(rReq, pBookmark, SfxStringItem, SID_JUMPTOMARK, sal_False);
+ SFX_REQUEST_ARG(rReq, pBookmark, SfxStringItem, SID_JUMPTOMARK );
if (pBookmark)
{
@@ -464,7 +452,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
{
const SfxPoolItem* pItem;
if (rReq.GetArgs()->GetItemState(
- SID_ATTR_YEAR2000, sal_True, &pItem) == SFX_ITEM_SET)
+ SID_ATTR_YEAR2000, true, &pItem) == SFX_ITEM_SET)
pFormShell->SetY2KState (
static_cast<const SfxUInt16Item*>(pItem)->GetValue());
}
@@ -500,13 +488,12 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
CheckLineTo (rReq);
const SfxItemSet* pArgs = rReq.GetArgs();
- const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
- Size aPageSize = mpActualPage->GetSize();
- Size aViewSize = GetActiveWindow()->GetViewSize();
+ const basegfx::B2DPoint aPagePos(GetActiveWindow()->GetViewOrigin());
+ const basegfx::B2DVector aPageSize(mpActualPage->GetPageScale());
+ const basegfx::B2DVector aViewSize(GetActiveWindow()->GetViewSize());
SdUndoGroup* pUndoGroup = NULL;
- if ( rReq.GetSlot() == SID_ATTR_LONG_LRSPACE ||
- rReq.GetSlot() == SID_ATTR_LONG_ULSPACE )
+ if ( rReq.GetSlot() == SID_ATTR_LONG_LRSPACE || rReq.GetSlot() == SID_ATTR_LONG_ULSPACE )
{
pUndoGroup = new SdUndoGroup(GetDoc());
String aString(SdResId(STR_UNDO_CHANGE_PAGEBORDER));
@@ -522,37 +509,38 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
if( mpDrawView->IsTextEdit() )
{
- Rectangle aRect = maMarkRect;
- aRect.SetPos(aRect.TopLeft() + aPagePos);
- aRect.Left() = rLRSpace.GetLeft();
- aRect.Right() = aViewSize.Width() - rLRSpace.GetRight();
- aRect.SetPos(aRect.TopLeft() - aPagePos);
- if ( aRect != maMarkRect)
+ const basegfx::B2DRange aRange(
+ rLRSpace.GetLeft() - aPagePos.getY(),
+ maMarkRange.getMinY(),
+ aViewSize.getX() - rLRSpace.GetRight() - aPagePos.getY(),
+ maMarkRange.getMaxY());
+
+ if(aRange != maMarkRange)
{
- mpDrawView->SetAllMarkedRect(aRect);
- maMarkRect = mpDrawView->GetAllMarkedRect();
+ mpDrawView->SetMarkedObjSnapRange(aRange);
+ maMarkRange = mpDrawView->getMarkedObjectSnapRange();
Invalidate( SID_RULER_OBJECT );
}
}
else
{
- long nLeft = Max(0L, rLRSpace.GetLeft() - aPagePos.X());
- long nRight = Max(0L, rLRSpace.GetRight() + aPagePos.X() +
- aPageSize.Width() - aViewSize.Width());
+ const double fLeft(std::max(0.0, rLRSpace.GetLeft() - aPagePos.getX()));
+ const double fRight(std::max(0.0, rLRSpace.GetRight() + aPagePos.getX() + aPageSize.getX() - aViewSize.getX()));
+ sal_uInt32 nPageCnt(GetDoc()->GetSdPageCount(mePageKind));
+ sal_uInt32 i;
- sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
- sal_uInt16 i;
for ( i = 0; i < nPageCnt; i++)
{
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
pPage,
- pPage->GetLftBorder(),
- pPage->GetRgtBorder(),
- nLeft, nRight);
+ pPage->GetLeftPageBorder(),
+ pPage->GetRightPageBorder(),
+ fLeft,
+ fRight);
pUndoGroup->AddAction(pUndo);
- pPage->SetLftBorder(nLeft);
- pPage->SetRgtBorder(nRight);
+ pPage->SetLeftPageBorder(fLeft);
+ pPage->SetRightPageBorder(fRight);
}
nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
@@ -561,12 +549,12 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
SdUndoAction* pUndo = new SdPageLRUndoAction(GetDoc(),
pPage,
- pPage->GetLftBorder(),
- pPage->GetRgtBorder(),
- nLeft, nRight);
+ pPage->GetLeftPageBorder(),
+ pPage->GetRightPageBorder(),
+ fLeft, fRight);
pUndoGroup->AddAction(pUndo);
- pPage->SetLftBorder(nLeft);
- pPage->SetRgtBorder(nRight);
+ pPage->SetLeftPageBorder(fLeft);
+ pPage->SetRightPageBorder(fRight);
}
InvalidateWindows();
}
@@ -579,39 +567,40 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
if( mpDrawView->IsTextEdit() )
{
- Rectangle aRect = maMarkRect;
- aRect.SetPos(aRect.TopLeft() + aPagePos);
- aRect.Top() = rULSpace.GetUpper();
- aRect.Bottom() = aViewSize.Height() - rULSpace.GetLower();
- aRect.SetPos(aRect.TopLeft() - aPagePos);
+ const basegfx::B2DRange aRange(
+ maMarkRange.getMinX(),
+ rULSpace.GetUpper() - aPagePos.getY(),
+ maMarkRange.getMaxX(),
+ aViewSize.getY() - rULSpace.GetLower() - aPagePos.getY());
- if ( aRect != maMarkRect)
+ if(!aRange.equal(maMarkRange))
{
- mpDrawView->SetAllMarkedRect(aRect);
- maMarkRect = mpDrawView->GetAllMarkedRect();
+ mpDrawView->SetMarkedObjSnapRange(aRange);
+ maMarkRange = mpDrawView->getMarkedObjectSnapRange();
Invalidate( SID_RULER_OBJECT );
}
}
else
{
- long nUpper = Max(0L, rULSpace.GetUpper() - aPagePos.Y());
- long nLower = Max(0L, rULSpace.GetLower() + aPagePos.Y() +
- aPageSize.Height() - aViewSize.Height());
+ const double fUpper(std::max(0.0, rULSpace.GetUpper() - aPagePos.getY()));
+ const double fLower(std::max(0.0, rULSpace.GetLower() + aPagePos.getY() + aPageSize.getX() - aViewSize.getY()));
+ sal_uInt32 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
+ sal_uInt32 i;
- sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
- sal_uInt16 i;
for ( i = 0; i < nPageCnt; i++)
{
SdPage* pPage = GetDoc()->GetSdPage(i, mePageKind);
SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
pPage,
- pPage->GetUppBorder(),
- pPage->GetLwrBorder(),
- nUpper, nLower);
+ pPage->GetTopPageBorder(),
+ pPage->GetBottomPageBorder(),
+ fUpper,
+ fLower);
pUndoGroup->AddAction(pUndo);
- pPage->SetUppBorder(nUpper);
- pPage->SetLwrBorder(nLower);
+ pPage->SetTopPageBorder(fUpper);
+ pPage->SetBottomPageBorder(fLower);
}
+
nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
for (i = 0; i < nPageCnt; i++)
@@ -619,13 +608,15 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
SdPage* pPage = GetDoc()->GetMasterSdPage(i, mePageKind);
SdUndoAction* pUndo = new SdPageULUndoAction(GetDoc(),
pPage,
- pPage->GetUppBorder(),
- pPage->GetLwrBorder(),
- nUpper, nLower);
+ pPage->GetTopPageBorder(),
+ pPage->GetBottomPageBorder(),
+ fUpper,
+ fLower);
pUndoGroup->AddAction(pUndo);
- pPage->SetUppBorder(nUpper);
- pPage->SetLwrBorder(nLower);
+ pPage->SetTopPageBorder(fUpper);
+ pPage->SetBottomPageBorder(fLower);
}
+
InvalidateWindows();
}
break;
@@ -633,27 +624,33 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_RULER_OBJECT:
{
- Rectangle aRect = maMarkRect;
- aRect.SetPos(aRect.TopLeft() + aPagePos);
+ basegfx::B2DRange aRange(maMarkRange);
+
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aPagePos));
const SvxObjectItem& rOI = (const SvxObjectItem&)
pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT));
if ( rOI.GetStartX() != rOI.GetEndX() )
{
- aRect.Left() = rOI.GetStartX();
- aRect.Right() = rOI.GetEndX();
+ aRange = basegfx::B2DRange(
+ rOI.GetStartX(), aRange.getMinY(),
+ rOI.GetEndX(), aRange.getMaxY());
}
+
if ( rOI.GetStartY() != rOI.GetEndY() )
{
- aRect.Top() = rOI.GetStartY();
- aRect.Bottom() = rOI.GetEndY();
+ aRange = basegfx::B2DRange(
+ aRange.getMinX(), rOI.GetStartY(),
+ aRange.getMaxX(), rOI.GetEndY());
}
- aRect.SetPos(aRect.TopLeft() - aPagePos);
- if ( aRect != maMarkRect)
+
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-aPagePos));
+
+ if(!aRange.equal(maMarkRange))
{
- mpDrawView->SetAllMarkedRect(aRect);
- maMarkRect = mpDrawView->GetAllMarkedRect();
+ mpDrawView->SetMarkedObjSnapRange(aRange);
+ maMarkRange = mpDrawView->getMarkedObjectSnapRange();
Invalidate( SID_RULER_OBJECT );
}
break;
@@ -713,26 +710,26 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
\************************************************************************/
void DrawViewShell::GetRulerState(SfxItemSet& rSet)
{
- Point aOrigin;
+ basegfx::B2DPoint aOrigin;
if (mpDrawView->GetSdrPageView())
{
aOrigin = mpDrawView->GetSdrPageView()->GetPageOrigin();
}
- Size aViewSize = GetActiveWindow()->GetViewSize();
+ const basegfx::B2DVector aViewSize(GetActiveWindow()->GetViewSize());
+ const basegfx::B2DPoint aPagePos(GetActiveWindow()->GetViewOrigin());
+ const basegfx::B2DVector aPageSize(mpActualPage->GetPageScale());
- const Point aPagePos( GetActiveWindow()->GetViewOrigin() );
- Size aPageSize = mpActualPage->GetSize();
-
- Rectangle aRect(aPagePos, Point( aViewSize.Width() - (aPagePos.X() + aPageSize.Width()),
- aViewSize.Height() - (aPagePos.Y() + aPageSize.Height())));
+ const Rectangle aRect(
+ basegfx::fround(aPagePos.getX()), basegfx::fround(aPagePos.getY()),
+ basegfx::fround(aViewSize.getX() - (aPagePos.getX() + aPageSize.getX())),
+ basegfx::fround(aViewSize.getY() - (aPagePos.getY() + aPageSize.getY())));
if( mpDrawView->IsTextEdit() )
{
- Point aPnt1 = GetActiveWindow()->GetWinViewPos();
- Point aPnt2 = GetActiveWindow()->GetViewOrigin();
- Rectangle aMinMaxRect = Rectangle( aPnt1, Size(ULONG_MAX, ULONG_MAX) );
+ const basegfx::B2DPoint aPnt1(GetActiveWindow()->GetWinViewPos());
+ const Rectangle aMinMaxRect(Point(basegfx::fround(aPnt1.getX()), basegfx::fround(aPnt1.getY())), Size(ULONG_MAX, ULONG_MAX));
rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) );
}
else
@@ -740,38 +737,42 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet)
rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aRect) );
}
- SvxLongLRSpaceItem aLRSpace(aPagePos.X() + mpActualPage->GetLftBorder(),
- aRect.Right() + mpActualPage->GetRgtBorder(),
+ SvxLongLRSpaceItem aLRSpace(
+ basegfx::fround(aPagePos.getX() + mpActualPage->GetLeftPageBorder()),
+ basegfx::fround(aRect.Right() + mpActualPage->GetRightPageBorder()),
GetPool().GetWhich(SID_ATTR_LONG_LRSPACE));
- SvxLongULSpaceItem aULSpace(aPagePos.Y() + mpActualPage->GetUppBorder(),
- aRect.Bottom() + mpActualPage->GetLwrBorder(),
+ SvxLongULSpaceItem aULSpace(
+ basegfx::fround(aPagePos.getY() + mpActualPage->GetTopPageBorder()),
+ basegfx::fround(aRect.Bottom() + mpActualPage->GetBottomPageBorder()),
GetPool().GetWhich(SID_ATTR_LONG_ULSPACE));
- rSet.Put(SvxPagePosSizeItem(Point(0,0) - aPagePos, aViewSize.Width(),
- aViewSize.Height()));
- SfxPointItem aPointItem( SID_RULER_NULL_OFFSET, aPagePos + aOrigin );
+ rSet.Put(SvxPagePosSizeItem(Point(basegfx::fround(-aPagePos.getX()), basegfx::fround(-aPagePos.getY())),
+ basegfx::fround(aViewSize.getX()), basegfx::fround(aViewSize.getY())));
+ SfxPointItem aPointItem( SID_RULER_NULL_OFFSET,
+ Point(basegfx::fround(aPagePos.getX() + aOrigin.getX()), basegfx::fround(aPagePos.getY() + aOrigin.getY())));
SvxProtectItem aProtect( SID_RULER_PROTECT );
- maMarkRect = mpDrawView->GetAllMarkedRect();
+ maMarkRange = mpDrawView->getMarkedObjectSnapRange();
const sal_Bool bRTL = GetDoc() && GetDoc()->GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB;
rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, bRTL));
- if( mpDrawView->AreObjectsMarked() )
+ if( mpDrawView->areSdrObjectsSelected() )
{
if( mpDrawView->IsTextEdit() )
{
- SdrObject* pObj = mpDrawView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj();
- if( pObj->GetObjInventor() == SdrInventor)
+ SdrObject* pObj = mpDrawView->getSelectedIfSingle();
+
+ if( pObj && pObj->GetObjInventor() == SdrInventor)
{
- SfxItemSet aEditAttr( GetDoc()->GetPool() );
+ SfxItemSet aEditAttr( GetDoc()->GetItemPool() );
mpDrawView->GetAttributes( aEditAttr );
if( aEditAttr.GetItemState( EE_PARA_TABS ) >= SFX_ITEM_AVAILABLE )
{
const SvxTabStopItem& rItem = (const SvxTabStopItem&) aEditAttr.Get( EE_PARA_TABS );
rSet.Put( rItem );
- //Rectangle aRect = maMarkRect;
+ //Rectangle aRect = maMarkRange;
const SvxLRSpaceItem& rLRSpaceItem = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE );
sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
@@ -780,37 +781,35 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet)
rLRSpaceItem.GetTxtFirstLineOfst(), nId );
rSet.Put( aLRSpaceItem );
- Point aPos( aPagePos + maMarkRect.TopLeft() );
+ basegfx::B2DPoint aPos( aPagePos + maMarkRange.getMinimum() );
if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
{
- const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
- aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
+ const SdrMetricItem& rTLDItem = (const SdrMetricItem&)aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
long nLD = rTLDItem.GetValue();
- aPos.X() += nLD;
+ aPos.setX(aPos.getX() + nLD);
}
- aPointItem.SetValue( aPos );
+ aPointItem.SetValue(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())));
- aLRSpace.SetLeft( aPagePos.X() + maMarkRect.Left() );
+ aLRSpace.SetLeft(basegfx::fround(aPagePos.getX() + maMarkRange.getMinX()));
if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SFX_ITEM_ON )
{
- const SdrTextLeftDistItem& rTLDItem = (const SdrTextLeftDistItem&)
- aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
+ const SdrMetricItem& rTLDItem = (const SdrMetricItem&)aEditAttr.Get( SDRATTR_TEXT_LEFTDIST );
long nLD = rTLDItem.GetValue();
aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD );
}
- aLRSpace.SetRight( aRect.Right() + aPageSize.Width() - maMarkRect.Right() );
- aULSpace.SetUpper( aPagePos.Y() + maMarkRect.Top() );
- aULSpace.SetLower( aRect.Bottom() + aPageSize.Height() - maMarkRect.Bottom() );
+ aLRSpace.SetRight(basegfx::fround(aRect.Right() + aPageSize.getX() - maMarkRange.getMaxX()));
+ aULSpace.SetUpper(basegfx::fround(aPagePos.getY() + maMarkRange.getMinY()));
+ aULSpace.SetLower(basegfx::fround(aRect.Bottom() + aPageSize.getY() - maMarkRange.getMaxY()));
rSet.DisableItem( SID_RULER_OBJECT );
// Seitenraender werden gelocked
- aProtect.SetSizeProtect( sal_True );
- aProtect.SetPosProtect( sal_True );
+ aProtect.SetSizeProtect( true );
+ aProtect.SetPosProtect( true );
}
if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SFX_ITEM_AVAILABLE )
@@ -825,13 +824,15 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet)
rSet.DisableItem( EE_PARA_TABS );
rSet.DisableItem( SID_RULER_TEXT_RIGHT_TO_LEFT );
- if( mpDrawView->IsResizeAllowed(sal_True) )
+ if( mpDrawView->IsResizeAllowed(true) )
{
- Rectangle aResizeRect( maMarkRect );
+ basegfx::B2DRange aResizeRange(maMarkRange);
+ aResizeRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aPagePos));
+
+ SvxObjectItem aObjItem(
+ basegfx::fround(aResizeRange.getMinX()), basegfx::fround(aResizeRange.getMaxX()),
+ basegfx::fround(aResizeRange.getMinY()), basegfx::fround(aResizeRange.getMaxY()));
- aResizeRect.SetPos(aResizeRect.TopLeft() + aPagePos);
- SvxObjectItem aObjItem(aResizeRect.Left(), aResizeRect.Right(),
- aResizeRect.Top(), aResizeRect.Bottom());
rSet.Put(aObjItem);
rSet.DisableItem( EE_PARA_TABS );
}
@@ -893,15 +894,15 @@ void DrawViewShell::ExecStatusBar(SfxRequest& rReq)
void DrawViewShell::GetSnapItemState( SfxItemSet &rSet )
{
- SdrPageView* pPV;
- Point aMPos = GetActiveWindow()->PixelToLogic(maMousePos);
- sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic(
- Size(FuPoor::HITPIX,0)).Width();
- sal_uInt16 nHelpLine;
+ const basegfx::B2DPoint aMPos(GetActiveWindow()->GetInverseViewTransformation() * maMousePos);
+ const double fHitLog(basegfx::B2DVector(GetActiveWindow()->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength());
+ sal_uInt32 nHelpLine;
- if ( mpDrawView->PickHelpLine(aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
+ if ( mpDrawView->PickHelpLine(aMPos, fHitLog, nHelpLine) )
{
- const SdrHelpLine& rHelpLine = (pPV->GetHelpLines())[nHelpLine];
+ if(mpDrawView->GetSdrPageView())
+ {
+ const SdrHelpLine& rHelpLine = (mpDrawView->GetSdrPageView()->GetHelpLines())[nHelpLine];
if ( rHelpLine.GetKind() == SDRHELPLINE_POINT )
{
@@ -919,6 +920,7 @@ void DrawViewShell::GetSnapItemState( SfxItemSet &rSet )
}
}
}
+}
/*************************************************************************
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 2b5e1d1077ce..3ca68b3880e2 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -25,7 +25,6 @@
#include "precompiled_sd.hxx"
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-
#include "DrawViewShell.hxx"
#include <vcl/msgbox.hxx>
#include <svl/urlbmk.hxx>
@@ -33,20 +32,12 @@
#include <svx/svdundo.hxx>
#include <svx/fmglob.hxx>
#include <editeng/eeitem.hxx>
-#ifndef _FLDITEM_HXX
#include <editeng/flditem.hxx>
-#endif
-#ifndef _SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <svx/ruler.hxx>
-#ifndef _GLOBL3D_HXX
#include <svx/globl3d.hxx>
-#endif
#include <editeng/outliner.hxx>
-#ifndef _SFX_CLIENTSH_HXX
#include <sfx2/ipclient.hxx>
-#endif
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svdopath.hxx>
@@ -54,7 +45,6 @@
#include <editeng/editview.hxx>
#include <vcl/cursor.hxx>
-
#include "app.hrc"
#include "glob.hrc"
#include "strings.hrc"
@@ -75,8 +65,7 @@
#include "drawview.hxx"
#include <svx/bmpmask.hxx>
#include "LayerTabBar.hxx"
-
-// #97016# IV
+#include <svx/svdlegacy.hxx>
#include <svx/svditer.hxx>
namespace sd {
@@ -123,7 +112,7 @@ void DrawViewShell::DeleteActualPage()
void DrawViewShell::DeleteActualLayer()
{
- SdrLayerAdmin& rAdmin = GetDoc()->GetLayerAdmin();
+ SdrLayerAdmin& rAdmin = GetDoc()->GetModelLayerAdmin();
const String& rName = GetLayerTabControl()->GetPageText(GetLayerTabControl()->GetCurPageId());
String aString(SdResId(STR_ASK_DELETE_LAYER));
@@ -134,7 +123,7 @@ void DrawViewShell::DeleteActualLayer()
if (QueryBox(GetActiveWindow(), WB_YES_NO, aString).Execute() == RET_YES)
{
- const SdrLayer* pLayer = rAdmin.GetLayer(rName, sal_False);
+ const SdrLayer* pLayer = rAdmin.GetLayer(rName, false);
mpDrawView->DeleteLayer( pLayer->GetName() );
// damit TabBar und Window neu gezeichnet werden;
@@ -154,9 +143,9 @@ void DrawViewShell::DeleteActualLayer()
|*
\************************************************************************/
-sal_Bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin)
+bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin)
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if ( !IsInputLocked() || ( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE ) )
{
@@ -167,28 +156,23 @@ sal_Bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin)
{
// this should be used for cursor travelling.
SdPage* pActualPage = GetActualPage();
- const SdrMarkList& rMarkList = GetView()->GetMarkedObjectList();
SdrTextObj* pCandidate = 0L;
+ SdrObject* pSelected = GetView()->getSelectedIfSingle();
- if(pActualPage && 1 == rMarkList.GetMarkCount())
+ if(pActualPage && pSelected)
{
- SdrMark* pMark = rMarkList.GetMark(0);
-
- // remember which object was the text in edit mode
- SdrObject* pOldObj = pMark->GetMarkedSdrObj();
-
// end text edit now
GetView()->SdrEndTextEdit();
- // look for a new candidate, a successor of pOldObj
+ // look for a new candidate, a successor of pSelected
SdrObjListIter aIter(*pActualPage, IM_DEEPNOGROUPS);
- sal_Bool bDidVisitOldObject(sal_False);
+ bool bDidVisitOldObject(false);
while(aIter.IsMore() && !pCandidate)
{
- SdrObject* pObj = aIter.Next();
+ SdrTextObj* pObj = dynamic_cast< SdrTextObj* >(aIter.Next());
- if(pObj && pObj->ISA(SdrTextObj))
+ if(pObj)
{
sal_uInt32 nInv(pObj->GetObjInventor());
sal_uInt16 nKnd(pObj->GetObjIdentifier());
@@ -197,12 +181,12 @@ sal_Bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin)
(OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd)
&& bDidVisitOldObject)
{
- pCandidate = (SdrTextObj*)pObj;
+ pCandidate = pObj;
}
- if(pObj == pOldObj)
+ if(pObj == pSelected)
{
- bDidVisitOldObject = sal_True;
+ bDidVisitOldObject = true;
}
}
}
@@ -211,8 +195,8 @@ sal_Bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin)
if(pCandidate)
{
// set the new candidate to text edit mode
- GetView()->UnMarkAll();
- GetView()->MarkObj(pCandidate, GetView()->GetSdrPageView());
+ GetView()->UnmarkAllObj();
+ GetView()->MarkObj(*pCandidate);
GetViewFrame()->GetDispatcher()->Execute(
SID_ATTR_CHAR, SFX_CALLMODE_ASYNCHRON);
@@ -245,18 +229,19 @@ void DrawViewShell::StartRulerDrag (
{
GetActiveWindow()->CaptureMouse();
- Point aWPos = GetActiveWindow()->PixelToLogic(GetActiveWindow()->GetPointerPosPixel());
+ const basegfx::B2DPoint aWPos(GetActiveWindow()->GetInverseViewTransformation() *
+ basegfx::B2DPoint(GetActiveWindow()->GetPointerPosPixel().X(), GetActiveWindow()->GetPointerPosPixel().Y()));
if ( rRuler.GetExtraRect().IsInside(rMEvt.GetPosPixel()) )
{
mpDrawView->BegSetPageOrg(aWPos);
- mbIsRulerDrag = sal_True;
+ mbIsRulerDrag = true;
}
else
{
// #i34536# if no guide-lines are visible yet, that show them
if( ! mpDrawView->IsHlplVisible())
- mpDrawView->SetHlplVisible( sal_True );
+ mpDrawView->SetHlplVisible( true );
SdrHelpLineKind eKind;
@@ -268,7 +253,7 @@ void DrawViewShell::StartRulerDrag (
eKind = SDRHELPLINE_VERTICAL;
mpDrawView->BegDragHelpLine(aWPos, eKind);
- mbIsRulerDrag = sal_True;
+ mbIsRulerDrag = true;
}
}
@@ -289,7 +274,7 @@ void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt,
// would work on deleted objects or the context menu has no parent anymore)
// See #126086# and #128122#
SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient();
- sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
+ bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
if ( bIsOleActive && PopupMenu::IsInExecute() )
return;
@@ -320,7 +305,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
if ( !aOutputArea.IsInside(rMEvt.GetPosPixel()) )
{
- sal_Bool bInsideOtherWindow = sal_False;
+ bool bInsideOtherWindow = false;
if (mpContentWindow.get() != NULL)
{
@@ -329,7 +314,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
Point aPos = mpContentWindow->GetPointerPosPixel();
if ( aOutputArea.IsInside(aPos) )
- bInsideOtherWindow = sal_True;
+ bInsideOtherWindow = true;
}
if (! GetActiveWindow()->HasFocus ())
@@ -372,34 +357,35 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
ViewShell::MouseMove(rMEvt, pWin);
if( !mbMousePosFreezed )
- maMousePos = rMEvt.GetPosPixel();
-
- Rectangle aRect;
+ {
+ maMousePos = basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ }
if ( mbIsRulerDrag )
{
- Point aLogPos = GetActiveWindow()->PixelToLogic(maMousePos);
- mpDrawView->MovAction(aLogPos);
+ const basegfx::B2DPoint aLogicPos(GetActiveWindow()->GetInverseViewTransformation() * maMousePos);
+ mpDrawView->MovAction(aLogicPos);
}
+ basegfx::B2DRange aRange;
+
if ( mpDrawView->IsAction() )
{
- mpDrawView->TakeActionRect(aRect);
- aRect = GetActiveWindow()->LogicToPixel(aRect);
+ aRange = GetActiveWindow()->GetViewTransformation() * mpDrawView->TakeActionRange();
}
else
{
- aRect = Rectangle(maMousePos, maMousePos);
+ aRange = basegfx::B2DRange(maMousePos);
}
- ShowMousePosInfo(aRect, pWin);
+ ShowMousePosInfo(aRange, pWin);
if ( mbPipette && GetViewFrame()->HasChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() ) )
{
- const long nStartX = maMousePos.X() - PIPETTE_RANGE;
- const long nEndX = maMousePos.X() + PIPETTE_RANGE;
- const long nStartY = maMousePos.Y() - PIPETTE_RANGE;
- const long nEndY = maMousePos.Y() + PIPETTE_RANGE;
+ const long nStartX = basegfx::fround(maMousePos.getX()) - PIPETTE_RANGE;
+ const long nEndX = basegfx::fround(maMousePos.getX()) + PIPETTE_RANGE;
+ const long nStartY = basegfx::fround(maMousePos.getY()) - PIPETTE_RANGE;
+ const long nEndY = basegfx::fround(maMousePos.getY()) + PIPETTE_RANGE;
long nRed = 0;
long nGreen = 0;
long nBlue = 0;
@@ -436,7 +422,7 @@ void DrawViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
{
if ( !IsInputLocked() )
{
- FASTBOOL bIsSetPageOrg = mpDrawView->IsSetPageOrg();
+ bool bIsSetPageOrg = mpDrawView->IsSetPageOrg();
if (mbIsRulerDrag)
{
@@ -452,9 +438,14 @@ void DrawViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
else if (rMEvt.IsLeft() && bIsSetPageOrg)
{
mpDrawView->BrkAction();
- SdPage* pPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage();
- Point aOrg(pPage->GetLftBorder(), pPage->GetUppBorder());
- mpDrawView->GetSdrPageView()->SetPageOrigin(aOrg);
+
+ if(mpDrawView->GetSdrPageView())
+ {
+ SdPage& rPage = (SdPage&) mpDrawView->GetSdrPageView()->getSdrPageFromSdrPageView();
+ const basegfx::B2DPoint aOrg(rPage.GetLeftPageBorder(), rPage.GetTopPageBorder());
+ mpDrawView->GetSdrPageView()->SetPageOrigin(aOrg);
+ }
+
GetViewFrame()->GetBindings().Invalidate(SID_RULER_NULL_OFFSET);
}
else
@@ -463,7 +454,7 @@ void DrawViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
}
GetActiveWindow()->ReleaseMouse();
- mbIsRulerDrag = sal_False;
+ mbIsRulerDrag = false;
}
else
ViewShell::MouseButtonUp(rMEvt, pWin);
@@ -484,7 +475,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
// windows and code on the stack.
// For more information, see #126086# and #128122#
SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient();
- sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
+ bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
if ( bIsOleActive && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ))
{
// Deactivate OLE object
@@ -506,13 +497,15 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
if( aDataHelper.GetTransferable().is() )
{
- Point aPos;
+ basegfx::B2DPoint aPos(0.0, 0.0);
sal_Int8 nDnDAction = DND_ACTION_COPY;
if( GetActiveWindow() )
- aPos = GetActiveWindow()->PixelToLogic( rCEvt.GetMousePosPixel() );
+ {
+ aPos = GetActiveWindow()->GetInverseViewTransformation() * basegfx::B2DPoint(rCEvt.GetMousePosPixel().X(), rCEvt.GetMousePosPixel().Y());
+ }
- if( !mpDrawView->InsertData( aDataHelper, aPos, nDnDAction, sal_False ) )
+ if( !mpDrawView->InsertData( aDataHelper, aPos, nDnDAction, false ) )
{
INetBookmark aINetBookmark( aEmptyStr, aEmptyStr );
@@ -523,7 +516,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
{
- InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
+ InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, 0);
}
}
}
@@ -532,17 +525,15 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
pWin != NULL && !mpDrawView->IsAction() && !SD_MOD()->GetWaterCan() )
{
sal_uInt16 nSdResId = 0; // ResourceID fuer Popup-Menue
- sal_Bool bGraphicShell = this->ISA(GraphicViewShell);
+ bool bGraphicShell = dynamic_cast< GraphicViewShell* >(this);
// Ist ein Fangobjekt unter dem Mauszeiger?
- SdrPageView* pPV;
- Point aMPos = pWin->PixelToLogic( maMousePos );
- sal_uInt16 nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic(
- Size(FuPoor::HITPIX, 0 ) ).Width();
- sal_uInt16 nHelpLine;
+ basegfx::B2DPoint aMPos(pWin->GetInverseViewTransformation() * maMousePos);
+ const double fHitLog(basegfx::B2DVector(GetActiveWindow()->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength());
+ sal_uInt32 nHelpLine;
// fuer Klebepunkt
SdrObject* pObj = NULL;
- sal_uInt16 nPickId = 0;
+ sal_uInt32 nPickId = 0;
// fuer Feldbefehl
OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
const SvxFieldItem* pFldItem = NULL;
@@ -551,23 +542,26 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
//pFldItem = pOLV->GetFieldUnderMousePointer();
// Hilfslinie
- if ( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
+ if ( mpDrawView->PickHelpLine( aMPos, fHitLog, nHelpLine) )
{
- nSdResId = RID_DRAW_SNAPOBJECT_POPUP;
- ShowSnapLineContextMenu(*pPV, nHelpLine, rCEvt.GetMousePosPixel());
- return;
+ if(mpDrawView->GetSdrPageView())
+ {
+ nSdResId = RID_DRAW_SNAPOBJECT_POPUP;
+ ShowSnapLineContextMenu(*mpDrawView->GetSdrPageView(), nHelpLine, rCEvt.GetMousePosPixel());
+ return;
+ }
}
// Klebepunkt unter dem Mauszeiger markiert?
- else if( mpDrawView->PickGluePoint( aMPos, pObj, nPickId, pPV ) &&
- mpDrawView->IsGluePointMarked( pObj, nPickId ) )
+ else if( mpDrawView->PickGluePoint( aMPos, pObj, nPickId ) && mpDrawView->IsGluePointMarked( *pObj, nPickId ) )
{
nSdResId = RID_DRAW_GLUEPOINT_POPUP;
}
// Feldbefehl ?
- else if( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) ||
- pFldItem->GetField()->ISA( SvxExtTimeField ) ||
- pFldItem->GetField()->ISA( SvxExtFileField ) ||
- pFldItem->GetField()->ISA( SvxAuthorField ) ) )
+ else if( pFldItem && (
+ dynamic_cast< const SvxDateField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtTimeField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtFileField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxAuthorField* >(pFldItem->GetField()) ) )
{
LanguageType eLanguage( LANGUAGE_SYSTEM );
@@ -581,10 +575,15 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
SdFieldPopup aFieldPopup( pFldItem->GetField(), eLanguage );
if ( rCEvt.IsMouseEvent() )
- aMPos = rCEvt.GetMousePosPixel();
+ {
+ aMPos = basegfx::B2DPoint(rCEvt.GetMousePosPixel().X(), rCEvt.GetMousePosPixel().Y());
+ }
else
- aMPos = Point( 20, 20 );
- aFieldPopup.Execute( pWin, aMPos );
+ {
+ aMPos = basegfx::B2DPoint( 20.0, 20.0 );
+ }
+
+ aFieldPopup.Execute( pWin, Point(basegfx::fround(aMPos.getX()), basegfx::fround(aMPos.getY())) );
SvxFieldData* pField = aFieldPopup.GetField();
if( pField )
@@ -593,10 +592,10 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
//pOLV->DeleteSelected(); <-- fehlt leider !
// Feld selektieren, so dass es beim Insert geloescht wird
ESelection aSel = pOLV->GetSelection();
- sal_Bool bSel = sal_True;
+ bool bSel = true;
if( aSel.nStartPos == aSel.nEndPos )
{
- bSel = sal_False;
+ bSel = false;
aSel.nEndPos++;
}
pOLV->SetSelection( aSel );
@@ -614,10 +613,10 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
else
{
// ist etwas selektiert?
- if (mpDrawView->AreObjectsMarked() &&
- mpDrawView->GetMarkedObjectList().GetMarkCount() == 1 )
+ pObj = mpDrawView->getSelectedIfSingle();
+
+ if(pObj)
{
- pObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
if( HasCurrentFunction(SID_BEZIER_EDIT) && (dynamic_cast< SdrPathObj * >( pObj ) != 0 ) )
{
nSdResId = RID_BEZIER_POPUP;
@@ -683,23 +682,48 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
RID_DRAW_TEXTOBJ_POPUP;
break;
- case OBJ_PATHLINE:
- case OBJ_PLIN:
- nSdResId = bGraphicShell ? RID_GRAPHIC_POLYLINEOBJ_POPUP :
- RID_DRAW_POLYLINEOBJ_POPUP;
+ case OBJ_POLY:
+ {
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
+ {
+ switch(pSdrPathObj->getSdrPathObjType())
+ {
+ case PathType_Line:
+ {
+ nSdResId = bGraphicShell ? RID_GRAPHIC_LINEOBJ_POPUP :
+ RID_DRAW_LINEOBJ_POPUP;
+ break;
+ }
+ case PathType_OpenPolygon:
+ case PathType_OpenBezier:
+ {
+ nSdResId = bGraphicShell ? RID_GRAPHIC_POLYLINEOBJ_POPUP :
+ RID_DRAW_POLYLINEOBJ_POPUP;
+ break;
+ }
+ case PathType_ClosedPolygon:
+ case PathType_ClosedBezier:
+ {
+ nSdResId = bGraphicShell ? RID_GRAPHIC_GEOMOBJ_POPUP :
+ RID_DRAW_GEOMOBJ_POPUP;
+ break;
+ }
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "OOps, SdrObjKind and dynamic_cast do not fit (!)");
+ }
break;
+ }
- case OBJ_FREELINE:
case OBJ_EDGE: // Connector
nSdResId = bGraphicShell ? RID_GRAPHIC_EDGEOBJ_POPUP :
RID_DRAW_EDGEOBJ_POPUP;
break;
- case OBJ_LINE:
- nSdResId = bGraphicShell ? RID_GRAPHIC_LINEOBJ_POPUP :
- RID_DRAW_LINEOBJ_POPUP;
- break;
-
case OBJ_MEASURE:
nSdResId = bGraphicShell ? RID_GRAPHIC_MEASUREOBJ_POPUP :
RID_DRAW_MEASUREOBJ_POPUP;
@@ -707,12 +731,6 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
case OBJ_RECT:
case OBJ_CIRC:
- case OBJ_FREEFILL:
- case OBJ_PATHFILL:
- case OBJ_POLY:
- case OBJ_SECT:
- case OBJ_CARC:
- case OBJ_CCUT:
nSdResId = bGraphicShell ? RID_GRAPHIC_GEOMOBJ_POPUP :
RID_DRAW_GEOMOBJ_POPUP;
break;
@@ -746,9 +764,9 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
break;
}
}
- else if( nInv == E3dInventor /*&& nId == E3D_POLYSCENE_ID*/)
+ else if( nInv == E3dInventor )
{
- if( nId == E3D_POLYSCENE_ID || nId == E3D_SCENE_ID )
+ if( nId == E3D_SCENE_ID )
{
if( !mpDrawView->IsGroupEntered() )
nSdResId = bGraphicShell ? RID_GRAPHIC_3DSCENE_POPUP :
@@ -768,18 +786,15 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
}
}
}
-
- // Mehrfachselektion
- else if (mpDrawView->AreObjectsMarked() &&
- mpDrawView->GetMarkedObjectList().GetMarkCount() > 1 )
+ else if (mpDrawView->getSelectedSdrObjectCount() > 1 )
{
+ // Mehrfachselektion
nSdResId = bGraphicShell ? RID_GRAPHIC_MULTISELECTION_POPUP :
RID_DRAW_MULTISELECTION_POPUP;
}
-
- // nichts selektiert
else
{
+ // nichts selektiert
nSdResId = bGraphicShell ? RID_GRAPHIC_NOSEL_POPUP :
RID_DRAW_NOSEL_POPUP;
}
@@ -790,37 +805,54 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
GetActiveWindow()->ReleaseMouse();
if(rCEvt.IsMouseEvent())
+ {
GetViewFrame()->GetDispatcher()->ExecutePopup(SdResId(nSdResId));
+ }
else
{
//#106326# don't open contextmenu at mouse position if not opened via mouse
//middle of the window if nothing is marked
- Point aMenuPos(GetActiveWindow()->GetSizePixel().Width()/2
- ,GetActiveWindow()->GetSizePixel().Height()/2);
+ basegfx::B2DPoint aMenuPos(
+ GetActiveWindow()->GetSizePixel().Width()/2,
+ GetActiveWindow()->GetSizePixel().Height()/2);
//middle of the bounding rect if something is marked
- if( mpDrawView->AreObjectsMarked() && mpDrawView->GetMarkedObjectList().GetMarkCount() >= 1 )
+ if( mpDrawView->areSdrObjectsSelected() )
{
- Rectangle aMarkRect;
- mpDrawView->GetMarkedObjectList().TakeBoundRect(NULL,aMarkRect);
- aMenuPos = GetActiveWindow()->LogicToPixel( aMarkRect.Center() );
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+ const basegfx::B2DRange aMarkRange(sdr::legacy::GetAllObjBoundRange(aSelection));
+
+ aMenuPos = GetActiveWindow()->GetViewTransformation() * aMarkRange.getCenter();
//move the point into the visible window area
- if( aMenuPos.X() < 0 )
- aMenuPos.X() = 0;
- if( aMenuPos.Y() < 0 )
- aMenuPos.Y() = 0;
- if( aMenuPos.X() > GetActiveWindow()->GetSizePixel().Width() )
- aMenuPos.X() = GetActiveWindow()->GetSizePixel().Width();
- if( aMenuPos.Y() > GetActiveWindow()->GetSizePixel().Height() )
- aMenuPos.Y() = GetActiveWindow()->GetSizePixel().Height();
+ if( aMenuPos.getX() < 0 )
+ {
+ aMenuPos.setX(0.0);
+ }
+
+ if( aMenuPos.getY() < 0 )
+ {
+ aMenuPos.setY(0.0);
+ }
+
+ if( aMenuPos.getX() > GetActiveWindow()->GetSizePixel().Width() )
+ {
+ aMenuPos.setX(GetActiveWindow()->GetSizePixel().Width());
+ }
+
+ if( aMenuPos.getY() > GetActiveWindow()->GetSizePixel().Height() )
+ {
+ aMenuPos.setY(GetActiveWindow()->GetSizePixel().Height());
+ }
}
//open context menu at that point
- GetViewFrame()->GetDispatcher()->ExecutePopup(SdResId(nSdResId),GetActiveWindow(),&aMenuPos);
+ const Point aOldMenuPos(basegfx::fround(aMenuPos.getX()), basegfx::fround(aMenuPos.getY()));
+ GetViewFrame()->GetDispatcher()->ExecutePopup(SdResId(nSdResId),GetActiveWindow(),&aOldMenuPos);
}
- mbMousePosFreezed = sal_False;
+
+ mbMousePosFreezed = false;
}
}
else
@@ -836,7 +868,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
|*
\************************************************************************/
-void DrawViewShell::ShowMousePosInfo(const Rectangle& rRect,
+void DrawViewShell::ShowMousePosInfo(const basegfx::B2DRange& rRange,
::sd::Window* pWin)
{
if (mbHasRulers && pWin )
@@ -866,15 +898,15 @@ void DrawViewShell::ShowMousePosInfo(const Rectangle& rRect,
}
nCnt = 1;
- pHLines[0].nPos = rRect.Left() - nHOffs;
- pVLines[0].nPos = rRect.Top() - nVOffs;
+ pHLines[0].nPos = basegfx::fround(rRange.getMinX()) - nHOffs;
+ pVLines[0].nPos = basegfx::fround(rRange.getMinY()) - nVOffs;
pHLines[0].nStyle = 0;
pVLines[0].nStyle = 0;
- if ( rRect.Right() != rRect.Left() || rRect.Bottom() != rRect.Top() )
+ if(!basegfx::fTools::equal(rRange.getMaxX(), rRange.getMinX()) || !basegfx::fTools::equal(rRange.getMaxY(), rRange.getMinY()))
{
- pHLines[1].nPos = rRect.Right() - nHOffs;
- pVLines[1].nPos = rRect.Bottom() - nVOffs;
+ pHLines[1].nPos = basegfx::fround(rRange.getMaxX()) - nHOffs;
+ pVLines[1].nPos = basegfx::fround(rRange.getMaxY()) - nVOffs;
pHLines[1].nStyle = 0;
pVLines[1].nStyle = 0;
nCnt++;
@@ -936,7 +968,7 @@ void DrawViewShell::UnlockInput()
void DrawViewShell::ShowSnapLineContextMenu (
SdrPageView& rPageView,
- const sal_uInt16 nSnapLineIndex,
+ const sal_uInt32 nSnapLineIndex,
const Point& rMouseLocation)
{
const SdrHelpLine& rHelpLine (rPageView.GetHelpLines()[nSnapLineIndex]);
@@ -963,7 +995,7 @@ void DrawViewShell::ShowSnapLineContextMenu (
String(SdResId(STR_POPUP_DELETE_SNAPLINE)));
}
- pMenu->RemoveDisabledEntries(sal_False, sal_False);
+ pMenu->RemoveDisabledEntries(false, false);
const sal_uInt16 nResult = pMenu->Execute(
GetActiveWindow(),
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index e491ad32bac2..4af7cf8c8521 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -83,14 +83,14 @@ static const int PAPER_SHADOW_EXT_PIXEL = 2;
|*
\************************************************************************/
-void DrawViewShell::ModelHasChanged()
+void DrawViewShell::LazyReactOnObjectChanges()
{
Invalidate();
// Damit der Navigator auch einen aktuellen Status bekommt
- GetViewFrame()->GetBindings().Invalidate( SID_NAVIGATOR_STATE, sal_True, sal_False );
+ GetViewFrame()->GetBindings().Invalidate( SID_NAVIGATOR_STATE, true, false );
//Update3DWindow();
- SfxBoolItem aItem( SID_3D_STATE, sal_True );
+ SfxBoolItem aItem( SID_3D_STATE, true );
GetViewFrame()->GetDispatcher()->Execute(
SID_3D_STATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
@@ -113,7 +113,10 @@ void DrawViewShell::Resize (void)
if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
- SetZoomRect( GetDocSh()->GetVisArea(ASPECT_CONTENT) );
+ const Rectangle aVisArea(GetDocSh()->GetVisArea(ASPECT_CONTENT));
+ const basegfx::B2DRange aVisRange(aVisArea.Left(), aVisArea.Top(), aVisArea.Right(), aVisArea.Bottom());
+
+ SetZoomRange(aVisRange);
}
rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
@@ -135,21 +138,16 @@ void DrawViewShell::ArrangeGUIElements (void)
GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize();
maScrBarWH = Size (nScrollBarSize, nScrollBarSize);
- Point aHPos = maViewPos;
- aHPos.Y() += maViewSize.Height();
-
-
ViewShell::ArrangeGUIElements ();
-
maTabControl.Hide();
OSL_ASSERT (GetViewShell()!=NULL);
Client* pIPClient = static_cast<Client*>(GetViewShell()->GetIPClient());
- sal_Bool bClientActive = sal_False;
+ bool bClientActive = false;
if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
- bClientActive = sal_True;
+ bClientActive = true;
- sal_Bool bInPlaceActive = GetViewFrame()->GetFrame().IsInPlace();
+ bool bInPlaceActive = GetViewFrame()->GetFrame().IsInPlace();
if ( mbZoomOnPage && !bInPlaceActive && !bClientActive )
{
@@ -184,7 +182,7 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
if (mpDrawView->GetGridFine() != pView->GetGridFine())
mpDrawView->SetGridFine( pView->GetGridFine() );
- if (mpDrawView->GetSnapGridWidthX() != pView->GetSnapGridWidthX() || mpDrawView->GetSnapGridWidthY() != pView->GetSnapGridWidthY())
+ if (!basegfx::fTools::equal(mpDrawView->GetSnapGridWidthX(), pView->GetSnapGridWidthX()) || !basegfx::fTools::equal(mpDrawView->GetSnapGridWidthY(), pView->GetSnapGridWidthY()))
mpDrawView->SetSnapGridWidth(pView->GetSnapGridWidthX(), pView->GetSnapGridWidthY());
if (mpDrawView->IsGridVisible() != pView->IsGridVisible())
@@ -199,20 +197,20 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
if (mpDrawView->IsGridSnap() != pView->IsGridSnap() )
mpDrawView->SetGridSnap( pView->IsGridSnap() );
- if (mpDrawView->IsBordSnap() != pView->IsBordSnap() )
- mpDrawView->SetBordSnap( pView->IsBordSnap() );
+ if (mpDrawView->IsBorderSnap() != pView->IsBorderSnap() )
+ mpDrawView->SetBorderSnap( pView->IsBorderSnap() );
- if (mpDrawView->IsHlplSnap() != pView->IsHlplSnap() )
- mpDrawView->SetHlplSnap( pView->IsHlplSnap() );
+ if (mpDrawView->IsHelplineSnap() != pView->IsHelplineSnap() )
+ mpDrawView->SetHelplineSnap( pView->IsHelplineSnap() );
- if (mpDrawView->IsOFrmSnap() != pView->IsOFrmSnap() )
- mpDrawView->SetOFrmSnap( pView->IsOFrmSnap() );
+ if (mpDrawView->IsOFrameSnap() != pView->IsOFrameSnap() )
+ mpDrawView->SetOFrameSnap( pView->IsOFrameSnap() );
- if (mpDrawView->IsOPntSnap() != pView->IsOPntSnap() )
- mpDrawView->SetOPntSnap( pView->IsOPntSnap() );
+ if (mpDrawView->IsOPointSnap() != pView->IsOPointSnap() )
+ mpDrawView->SetOPointSnap( pView->IsOPointSnap() );
- if (mpDrawView->IsOConSnap() != pView->IsOConSnap() )
- mpDrawView->SetOConSnap( pView->IsOConSnap() );
+ if (mpDrawView->IsOConnectorSnap() != pView->IsOConnectorSnap() )
+ mpDrawView->SetOConnectorSnap( pView->IsOConnectorSnap() );
if (mpDrawView->IsHlplVisible() != pView->IsHlplVisible() )
mpDrawView->SetHlplVisible( pView->IsHlplVisible() );
@@ -223,8 +221,8 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
if (mpDrawView->IsPlusHandlesAlwaysVisible() != pView->IsPlusHandlesAlwaysVisible() )
mpDrawView->SetPlusHandlesAlwaysVisible( pView->IsPlusHandlesAlwaysVisible() );
- if (mpDrawView->GetSnapMagneticPixel() != pView->GetSnapMagneticPixel() )
- mpDrawView->SetSnapMagneticPixel( pView->GetSnapMagneticPixel() );
+ if (mpDrawView->GetDiscreteMagneticSnap() != pView->GetDiscreteMagneticSnap() )
+ mpDrawView->SetDiscreteMagneticSnap( pView->GetDiscreteMagneticSnap() );
if (mpDrawView->IsMarkedHitMovesAlways() != pView->IsMarkedHitMovesAlways() )
mpDrawView->SetMarkedHitMovesAlways( pView->IsMarkedHitMovesAlways() );
@@ -243,11 +241,11 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
if (mpDrawView->IsAngleSnapEnabled() != pView->IsAngleSnapEnabled() )
mpDrawView->SetAngleSnapEnabled( pView->IsAngleSnapEnabled() );
- if (mpDrawView->IsBigOrtho() != pView->IsBigOrtho() )
- mpDrawView->SetBigOrtho( pView->IsBigOrtho() );
+ if (mpDrawView->IsBigOrthogonal() != pView->IsBigOrthogonal() )
+ mpDrawView->SetBigOrthogonal( pView->IsBigOrthogonal() );
- if (mpDrawView->IsOrtho() != pView->IsOrtho() )
- mpDrawView->SetOrtho( pView->IsOrtho() );
+ if (mpDrawView->IsOrthogonal() != pView->IsOrthogonal() )
+ mpDrawView->SetOrthogonal( pView->IsOrthogonal() );
if (mpDrawView->GetEliminatePolyPointLimitAngle() != pView->GetEliminatePolyPointLimitAngle() )
mpDrawView->SetEliminatePolyPointLimitAngle( pView->GetEliminatePolyPointLimitAngle() );
@@ -311,7 +309,7 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
if ( mpDrawView->GetActiveLayer() != pView->GetActiveLayer() )
mpDrawView->SetActiveLayer( pView->GetActiveLayer() );
- sal_uInt16 nSelectedPage = 0;
+ sal_uInt32 nSelectedPage = 0;
if (mePageKind != PK_HANDOUT)
{
@@ -319,7 +317,7 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
}
EditMode eNewEditMode = pView->GetViewShEditMode(mePageKind);
- sal_Bool bNewLayerMode = pView->IsLayerMode();
+ bool bNewLayerMode = pView->IsLayerMode();
ChangeEditMode(eNewEditMode, bNewLayerMode);
SwitchPage(nSelectedPage);
@@ -334,8 +332,8 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView)
}
// Muss am Ende gerufen werden, da ein WriteFrameViewData() ausgeloest wird
- if (mpDrawView->IsFrameDragSingles() != pView->IsFrameDragSingles() )
- mpDrawView->SetFrameDragSingles( pView->IsFrameDragSingles() );
+ if (mpDrawView->IsFrameHandles() != pView->IsFrameHandles() )
+ mpDrawView->SetFrameHandles( pView->IsFrameHandles() );
}
/*************************************************************************
@@ -355,20 +353,20 @@ void DrawViewShell::WriteFrameViewData()
mpFrameView->SetGridFront( mpDrawView->IsGridFront() );
mpFrameView->SetSnapAngle( mpDrawView->GetSnapAngle() );
mpFrameView->SetGridSnap( mpDrawView->IsGridSnap() );
- mpFrameView->SetBordSnap( mpDrawView->IsBordSnap() );
- mpFrameView->SetHlplSnap( mpDrawView->IsHlplSnap() );
- mpFrameView->SetOFrmSnap( mpDrawView->IsOFrmSnap() );
- mpFrameView->SetOPntSnap( mpDrawView->IsOPntSnap() );
- mpFrameView->SetOConSnap( mpDrawView->IsOConSnap() );
+ mpFrameView->SetBorderSnap( mpDrawView->IsBorderSnap() );
+ mpFrameView->SetHelplineSnap( mpDrawView->IsHelplineSnap() );
+ mpFrameView->SetOFrameSnap( mpDrawView->IsOFrameSnap() );
+ mpFrameView->SetOPointSnap( mpDrawView->IsOPointSnap() );
+ mpFrameView->SetOConnectorSnap( mpDrawView->IsOConnectorSnap() );
mpFrameView->SetHlplVisible( mpDrawView->IsHlplVisible() );
mpFrameView->SetDragStripes( mpDrawView->IsDragStripes() );
mpFrameView->SetPlusHandlesAlwaysVisible( mpDrawView->IsPlusHandlesAlwaysVisible() );
- mpFrameView->SetFrameDragSingles( mpDrawView->IsFrameDragSingles() );
+ mpFrameView->SetFrameHandles( mpDrawView->IsFrameHandles() );
mpFrameView->SetMarkedHitMovesAlways( mpDrawView->IsMarkedHitMovesAlways() );
mpFrameView->SetMoveOnlyDragging( mpDrawView->IsMoveOnlyDragging() );
mpFrameView->SetNoDragXorPolys( mpDrawView->IsNoDragXorPolys() );
mpFrameView->SetCrookNoContortion( mpDrawView->IsCrookNoContortion() );
- mpFrameView->SetBigOrtho( mpDrawView->IsBigOrtho() );
+ mpFrameView->SetBigOrthogonal( mpDrawView->IsBigOrthogonal() );
mpFrameView->SetEliminatePolyPointLimitAngle( mpDrawView->GetEliminatePolyPointLimitAngle() );
mpFrameView->SetEliminatePolyPoints( mpDrawView->IsEliminatePolyPoints() );
@@ -498,8 +496,8 @@ void DrawViewShell::Paint(const Rectangle& rRect, ::sd::Window* pWin)
void DrawViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY)
{
ViewShell::SetZoomFactor(rZoomX, rZoomY);
- mbZoomOnPage = sal_False;
- Point aOrigin = GetActiveWindow()->GetViewOrigin();
+ mbZoomOnPage = false;
+ const basegfx::B2DPoint aOrigin(GetActiveWindow()->GetViewOrigin());
GetActiveWindow()->SetWinViewPos(aOrigin);
}
@@ -516,22 +514,23 @@ Size DrawViewShell::GetOptimalSizePixel() const
SdrPageView* pPV = mpDrawView->GetSdrPageView();
if (pPV)
{
- SdPage* pPage = (SdPage*) pPV->GetPage();
+ SdPage& rPage = (SdPage&) pPV->getSdrPageFromSdrPageView();
- if (pPage)
+ if (!mbZoomOnPage)
{
- if (!mbZoomOnPage)
- {
- // Gegenwaertigen MapMode beruecksichtigen
- aSize = GetActiveWindow()->LogicToPixel( pPage->GetSize() );
- }
- else
- {
- // 1:1 Darstellung
- MapMode aMapMode(MAP_100TH_MM);
- aSize = GetActiveWindow()->LogicToPixel( pPage->GetSize(), aMapMode );
- const_cast< DrawViewShell* >(this)->mbZoomOnPage = sal_True;
- }
+ // Gegenwaertigen MapMode beruecksichtigen
+ const basegfx::B2DVector aDiscreteScale(GetActiveWindow()->GetInverseViewTransformation() * rPage.GetPageScale());
+
+ aSize = Size(basegfx::fround(aDiscreteScale.getX()), basegfx::fround(aDiscreteScale.getY()));
+ }
+ else
+ {
+ // 1:1 Darstellung
+ const MapMode aMapMode(MAP_100TH_MM);
+ const basegfx::B2DVector aDiscreteScale(GetActiveWindow()->GetInverseViewTransformation(aMapMode) * rPage.GetPageScale());
+
+ aSize = Size(basegfx::fround(aDiscreteScale.getX()), basegfx::fround(aDiscreteScale.getY()));
+ const_cast< DrawViewShell* >(this)->mbZoomOnPage = true;
}
}
@@ -549,7 +548,7 @@ void DrawViewShell::HidePage()
{
FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
if (pFormShell != NULL)
- pFormShell->PrepareClose (sal_False);
+ pFormShell->PrepareClose (false);
}
@@ -630,7 +629,8 @@ void DrawViewShell::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence
pView->VisAreaChanged(GetActiveWindow());
}
- SetZoomRect(aVisArea);
+ const basegfx::B2DRange aVisRange(aVisArea.Left(), aVisArea.Top(), aVisArea.Right(), aVisArea.Bottom());
+ SetZoomRange(aVisRange);
}
ChangeEditMode (meEditMode, ! IsLayerModeActive());
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index 17ec4618c075..10364895ff1c 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -95,10 +95,9 @@ void DrawViewShell::ExecFormText(SfxRequest& rReq)
CheckLineTo (rReq);
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ SdrObject* pSelected = mpDrawView ? mpDrawView->getSelectedIfSingle() : 0;
- if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() &&
- mpDrawView && !mpDrawView->IsPresObjSelected() )
+ if(pSelected && rReq.GetArgs() && !mpDrawView->IsPresObjSelected() )
{
const SfxItemSet& rSet = *rReq.GetArgs();
const SfxPoolItem* pItem;
@@ -106,7 +105,7 @@ void DrawViewShell::ExecFormText(SfxRequest& rReq)
if ( mpDrawView->IsTextEdit() )
mpDrawView->SdrEndTextEdit();
- if ( rSet.GetItemState(XATTR_FORMTXTSTDFORM, sal_True, &pItem) ==
+ if ( rSet.GetItemState(XATTR_FORMTXTSTDFORM, true, &pItem) ==
SFX_ITEM_SET &&
((const XFormTextStdFormItem*) pItem)->GetValue() != XFTFORM_NONE )
{
@@ -116,8 +115,8 @@ void DrawViewShell::ExecFormText(SfxRequest& rReq)
SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*)GetViewFrame()->
GetChildWindow(nId)->GetWindow();
- pDlg->CreateStdFormObj(*mpDrawView, *mpDrawView->GetSdrPageView(),
- rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
+ pDlg->CreateStdFormObj(*mpDrawView,
+ rSet, *pSelected,
((const XFormTextStdFormItem*) pItem)->
GetValue());
@@ -128,9 +127,11 @@ void DrawViewShell::ExecFormText(SfxRequest& rReq)
}
}
else
+ {
mpDrawView->SetAttributes(rSet);
}
}
+}
/*************************************************************************
|*
@@ -140,24 +141,18 @@ void DrawViewShell::ExecFormText(SfxRequest& rReq)
void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- const SdrObject* pObj = NULL;
+ const SdrObject* pObj = mpDrawView->getSelectedIfSingle();
SvxFontWorkDialog* pDlg = NULL;
-
sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
if ( GetViewFrame()->HasChildWindow(nId) )
pDlg = (SvxFontWorkDialog*)(GetViewFrame()->GetChildWindow(nId)->GetWindow());
- if ( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
- !((SdrTextObj*) pObj)->HasText() )
+ if ( !pObj || !dynamic_cast< const SdrTextObj* >(pObj) || !static_cast< const SdrTextObj* >(pObj)->HasText() )
{
// automatisches Auf/Zuklappen des FontWork-Dialog; erstmal deaktiviert
// if ( pDlg )
-// pDlg->SetActive(sal_False);
+// pDlg->SetActive(false);
rSet.DisableItem(XATTR_FORMTXTSTYLE);
rSet.DisableItem(XATTR_FORMTXTADJUST);
@@ -180,7 +175,7 @@ void DrawViewShell::GetFormTextState(SfxItemSet& rSet)
pDlg->SetColorTable(GetDoc()->GetColorTable());
}
- SfxItemSet aSet( GetDoc()->GetPool() );
+ SfxItemSet aSet( GetDoc()->GetItemPool() );
mpDrawView->GetAttributes( aSet );
rSet.Set( aSet );
}
@@ -244,37 +239,53 @@ void DrawViewShell::ExecAnimationWin( SfxRequest& rReq )
void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet )
{
// Hier koennten Buttons etc. disabled werden
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
sal_uInt16 nValue;
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
-
- if( nMarkCount == 0 )
+ if( !aSelection.size() )
+ {
nValue = 0;
- else if( nMarkCount > 1 )
+ }
+ else if( aSelection.size() > 1 )
+ {
nValue = 3;
- else // 1 Objekt
+ }
+ else
{
- const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nId = pObj->GetObjIdentifier();
+ // 1 Objekt
+ const SdrObject* pObj = aSelection[0];
+ const sal_uInt32 nInv = pObj->GetObjInventor();
+ const sal_uInt16 nId = pObj->GetObjIdentifier();
+
// 1 selektiertes Gruppenobjekt
if( nInv == SdrInventor && nId == OBJ_GRUP )
+ {
nValue = 3;
+ }
else if( nInv == SdrInventor && nId == OBJ_GRAF ) // Anim. GIF ?
{
sal_uInt16 nCount = 0;
if( ( (SdrGrafObj*) pObj )->IsAnimated() )
+ {
nCount = ( (SdrGrafObj*) pObj )->GetGraphic().GetAnimation().Count();
+ }
+
if( nCount > 0 )
+ {
nValue = 2;
+ }
else
+ {
nValue = 1;
+ }
}
else
+ {
nValue = 1;
+ }
}
+
rSet.Put( SfxUInt16Item( SID_ANIMATOR_STATE, nValue ) );
}
@@ -363,14 +374,12 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
case ( SID_BMPMASK_EXEC ) :
{
- SdrGrafObj* pObj = 0;
- if( mpDrawView && mpDrawView->GetMarkedObjectList().GetMarkCount() )
- pObj = dynamic_cast< SdrGrafObj* >( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() );
+ SdrGrafObj* pObj = mpDrawView ? dynamic_cast< SdrGrafObj* >(mpDrawView->getSelectedIfSingle()) : 0;
if ( pObj && !mpDrawView->IsTextEdit() )
{
- SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone();
- sal_Bool bCont = sal_True;
+ SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->CloneSdrObject();
+ bool bCont = true;
if( pNewObj->IsLinkedGraphic() )
{
@@ -381,8 +390,8 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
pNewObj->ReleaseGraphicLink();
else
{
- delete pNewObj;
- bCont = sal_False;
+ deleteSdrObjectSafeAndClearPointer(pNewObj);
+ bCont = false;
}
}
@@ -395,18 +404,18 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
if( aNewGraphic != rOldGraphic )
{
- SdrPageView* pPV = mpDrawView->GetSdrPageView();
-
- pNewObj->SetEmptyPresObj( sal_False );
+ pNewObj->SetEmptyPresObj( false );
pNewObj->SetGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow(
SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->
Mask( pNewObj->GetGraphic() ) );
- String aStr( mpDrawView->GetDescriptionOfMarkedObjects() );
+ String aStr;
+
+ pObj->TakeObjNameSingul(aStr);
aStr += (sal_Unicode)( ' ' ), aStr += String( SdResId( STR_EYEDROPPER ) );
mpDrawView->BegUndo( aStr );
- mpDrawView->ReplaceObjectAtView( pObj, *pPV, pNewObj );
+ mpDrawView->ReplaceObjectAtView( *pObj, *pNewObj );
mpDrawView->EndUndo();
}
}
@@ -427,29 +436,23 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- const SdrObject* pObj = NULL;
sal_uInt16 nId = SvxBmpMaskChildWindow::GetChildWindowId();
- SvxBmpMask* pDlg = NULL;
- sal_Bool bEnable = sal_False;
+ bool bEnable = false;
if ( GetViewFrame()->HasChildWindow( nId ) )
{
- pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
+ SvxBmpMask* pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() );
if ( pDlg->NeedsColorTable() )
pDlg->SetColorTable( GetDoc()->GetColorTable() );
}
- if ( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
// valid graphic object?
- if( pObj && pObj->ISA( SdrGrafObj ) &&
- !((SdrGrafObj*) pObj)->IsEPS() &&
- !mpDrawView->IsTextEdit() )
+ const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->getSelectedIfSingle());
+
+ if(pSdrGrafObj && !pSdrGrafObj->IsEPS() && !mpDrawView->IsTextEdit())
{
- bEnable = sal_True;
+ bEnable = true;
}
// put value
@@ -632,13 +635,13 @@ void DrawViewShell::FuTemp04(SfxRequest& rReq)
case SID_CONVERT_TO_3D_LATHE_FAST:
{
// Der Aufruf ist ausreichend. Die Initialisierung per Start3DCreation und CreateMirrorPolygons
- // ist nicht mehr noetig, falls der Parameter sal_True uebergeben wird. Dann wird sofort und
+ // ist nicht mehr noetig, falls der Parameter true uebergeben wird. Dann wird sofort und
// ohne Benutzereingriff ein gekippter Rotationskoerper mit einer Achse links neben dem
// Umschliessenden Rechteck der slektierten Objekte gezeichnet.
mpDrawView->SdrEndTextEdit();
if(GetActiveWindow())
GetActiveWindow()->EnterWait();
- mpDrawView->End3DCreation(sal_True);
+ mpDrawView->End3DCreation(true);
Cancel();
rReq.Ignore();
if(GetActiveWindow())
@@ -715,12 +718,12 @@ void DrawViewShell::FuTemp04(SfxRequest& rReq)
&& GetDoc() != NULL)
{
SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = GetDoc()->GetModelLayerAdmin();
sal_uInt8 aLayerId;
if (nSId == SID_DISPLAY_MASTER_BACKGROUND)
- aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
+ aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
else
- aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ aLayerId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
aVisibleLayers.Set(aLayerId, !aVisibleLayers.IsSet(aLayerId));
pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
}
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index cb1423cc359d..a341dead7626 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -223,7 +223,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
ViewShell::GetMenuState(rSet);
- sal_Bool bDisableVerticalText = !SvtLanguageOptions().IsVerticalTextEnabled();
+ bool bDisableVerticalText = !SvtLanguageOptions().IsVerticalTextEnabled();
if ( bDisableVerticalText )
{
@@ -233,10 +233,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem( SID_DRAW_TEXT_VERTICAL );
}
- FASTBOOL bConvertToPathPossible = mpDrawView->IsConvertToPathObjPossible(sal_False);
-
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- const sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ bool bConvertToPathPossible = mpDrawView->IsConvertToPathObjPossible(false);
//format paintbrush
FuFormatPaintBrush::GetMenuState( *this, rSet );
@@ -245,13 +242,13 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
SetChildWindowState( rSet );
// Images der Toolboxen mappen (nur Zoom)
- UpdateToolboxImages( rSet, sal_False );
+ UpdateToolboxImages( rSet, false );
if(HasCurrentFunction())
{
sal_uInt16 nSId = GetCurrentFunction()->GetSlotID();
- rSet.Put( SfxBoolItem( nSId, sal_True ) );
+ rSet.Put( SfxBoolItem( nSId, true ) );
// Bewirkt ein uncheck eines simulierten Slots
sal_uInt16 nId = GetIdBySubId( nSId );
@@ -292,7 +289,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
bool bDisable = true;
if( pPageView )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( &pPageView->getSdrPageFromSdrPageView() );
if( pPage && !pPage->IsMasterPage() )
{
@@ -312,7 +309,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
bool bDisable = true;
if( pPageView )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( &pPageView->getSdrPageFromSdrPageView() );
if( pPage && (pPage->GetPageKind() == PK_STANDARD) && !pPage->IsMasterPage() )
{
@@ -353,7 +350,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
bool bDisable = true;
if( pPageView )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( &pPageView->getSdrPageFromSdrPageView() );
if( pPage && (pPage->GetPageKind() == PK_STANDARD) && !pPage->IsMasterPage() )
{
@@ -377,7 +374,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
bool bDisable = true;
if( pPageView )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( &pPageView->getSdrPageFromSdrPageView() );
if( pPage && !pPage->IsMasterPage() )
{
@@ -396,15 +393,15 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PRESENTATION ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_REHEARSE_TIMINGS ) )
{
- sal_Bool bDisable = sal_True;
- sal_uInt16 nCount = GetDoc()->GetSdPageCount( PK_STANDARD );
+ bool bDisable = true;
+ sal_uInt32 nCount = GetDoc()->GetSdPageCount( PK_STANDARD );
- for( sal_uInt16 i = 0; i < nCount && bDisable; i++ )
+ for( sal_uInt32 i = 0; i < nCount && bDisable; i++ )
{
SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD);
if( !pPage->IsExcluded() )
- bDisable = sal_False;
+ bDisable = false;
}
if( bDisable || GetDocSh()->IsPreview())
@@ -450,12 +447,12 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
else
{
// Horizontale Ausrichtung
- sal_uInt16 nHorz = mpDrawView->GetMarkedGluePointsAlign( sal_False );
+ sal_uInt16 nHorz = mpDrawView->GetMarkedGluePointsAlign( false );
rSet.Put( SfxBoolItem( SID_GLUE_HORZALIGN_CENTER, nHorz == SDRHORZALIGN_CENTER ) );
rSet.Put( SfxBoolItem( SID_GLUE_HORZALIGN_LEFT, nHorz == SDRHORZALIGN_LEFT ) );
rSet.Put( SfxBoolItem( SID_GLUE_HORZALIGN_RIGHT, nHorz == SDRHORZALIGN_RIGHT ) );
// Vertikale Ausrichtung
- sal_uInt16 nVert = mpDrawView->GetMarkedGluePointsAlign( sal_True );
+ sal_uInt16 nVert = mpDrawView->GetMarkedGluePointsAlign( true );
rSet.Put( SfxBoolItem( SID_GLUE_VERTALIGN_CENTER, nVert == SDRVERTALIGN_CENTER ) );
rSet.Put( SfxBoolItem( SID_GLUE_VERTALIGN_TOP, nVert == SDRVERTALIGN_TOP ) );
rSet.Put( SfxBoolItem( SID_GLUE_VERTALIGN_BOTTOM, nVert == SDRVERTALIGN_BOTTOM ) );
@@ -498,17 +495,17 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
rSet.Put( SfxBoolItem( SID_HELPLINES_FRONT, mpDrawView->IsHlplFront() ) );
}
- if (!mpDrawView->IsFrameDragSingles())
- rSet.Put(SfxBoolItem(SID_BEZIER_EDIT, sal_True));
+ if (!mpDrawView->IsFrameHandles())
+ rSet.Put(SfxBoolItem(SID_BEZIER_EDIT, true));
else
- rSet.Put(SfxBoolItem(SID_BEZIER_EDIT, sal_False));
+ rSet.Put(SfxBoolItem(SID_BEZIER_EDIT, false));
if(dynamic_cast<FuEditGluePoints*>( GetCurrentFunction().get()))
- rSet.Put(SfxBoolItem(SID_GLUE_EDITMODE, sal_True));
+ rSet.Put(SfxBoolItem(SID_GLUE_EDITMODE, true));
else
- rSet.Put(SfxBoolItem(SID_GLUE_EDITMODE, sal_False));
+ rSet.Put(SfxBoolItem(SID_GLUE_EDITMODE, false));
- if( !mpDrawView->IsMirrorAllowed( sal_True, sal_True ) )
+ if( !mpDrawView->IsMirrorAllowed( true, true ) )
{
rSet.DisableItem( SID_HORIZONTAL );
rSet.DisableItem( SID_VERTICAL );
@@ -558,12 +555,12 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if ( !mpDrawView->IsGroupEntered() )
{
rSet.DisableItem( SID_LEAVE_GROUP );
- rSet.Put( SfxBoolItem( SID_LEAVE_ALL_GROUPS, sal_False ) );
+ rSet.Put( SfxBoolItem( SID_LEAVE_ALL_GROUPS, false ) );
rSet.ClearItem( SID_LEAVE_ALL_GROUPS );
rSet.DisableItem( SID_LEAVE_ALL_GROUPS );
}
else
- rSet.Put( SfxBoolItem( SID_LEAVE_ALL_GROUPS, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_LEAVE_ALL_GROUPS, true ) );
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_THESAURUS ) )
{
@@ -592,7 +589,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SELECTALL ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SIZE_ALL ) )
{
- if( pPageView && pPageView->GetObjList()->GetObjCount() == 0 )
+ if( pPageView && pPageView->GetCurrentObjectList()->GetObjCount() == 0 )
{
// Sollte disabled sein, wenn kein Objekt auf der Zeichenflaeche ist:
rSet.DisableItem( SID_SELECTALL );
@@ -613,19 +610,19 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
// SSA: #108717# avoid clipboard initialization for
// read-only presentation views (workaround for NT4.0
// clipboard prob...)
- if( !ISA(PresentationViewShell) )
+ if( !dynamic_cast< PresentationViewShell* >(this) )
{
// create listener
mpClipEvtLstnr = new TransferableClipboardListener( LINK( this, DrawViewShell, ClipboardChanged ) );
mpClipEvtLstnr->acquire();
- mpClipEvtLstnr->AddRemoveListener( GetActiveWindow(), sal_True );
+ mpClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true );
// get initial state
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );
mbPastePossible = ( aDataHelper.GetFormatCount() != 0 );
}
else
- mbPastePossible = sal_False;
+ mbPastePossible = false;
}
if( !mbPastePossible )
@@ -658,10 +655,10 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
return;
}
- if( !( mpDrawView->IsConvertToPolyObjPossible(sal_False) || mpDrawView->IsVectorizeAllowed() ) )
+ if( !( mpDrawView->IsConvertToPolyObjPossible(false) || mpDrawView->IsVectorizeAllowed() ) )
rSet.DisableItem(SID_CHANGEPOLYGON);
- if( !( mpDrawView->IsConvertToPolyObjPossible(sal_False) || mpDrawView->IsConvertToContourPossible() ) )
+ if( !( mpDrawView->IsConvertToPolyObjPossible(false) || mpDrawView->IsConvertToContourPossible() ) )
rSet.DisableItem(SID_CONVERT_TO_CONTOUR);
if ( !mpDrawView->IsConvertTo3DObjPossible() )
@@ -747,19 +744,19 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
/**********************************************************************
* Seiten-Modus
**********************************************************************/
- rSet.Put(SfxBoolItem(SID_PAGEMODE, sal_True));
- rSet.Put(SfxBoolItem(SID_MASTERPAGE, sal_False));
- rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, sal_False));
- rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, sal_False));
- rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, sal_False));
+ rSet.Put(SfxBoolItem(SID_PAGEMODE, true));
+ rSet.Put(SfxBoolItem(SID_MASTERPAGE, false));
+ rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, false));
+ rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, false));
+ rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, false));
if (mePageKind == PK_STANDARD &&
rSet.GetItemState(SID_TITLE_MASTERPAGE) == SFX_ITEM_AVAILABLE)
{
// Gibt es eine Seite mit dem AutoLayout "Titel"?
- sal_Bool bDisable = sal_True;
- sal_uInt16 i = 0;
- sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
+ bool bDisable = true;
+ sal_uInt32 i = 0;
+ sal_uInt32 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
while (i < nCount && bDisable)
{
@@ -767,7 +764,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if (pPage->GetAutoLayout() == AUTOLAYOUT_TITLE)
{
- bDisable = sal_False;
+ bDisable = false;
}
i++;
@@ -779,7 +776,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
else
{
- rSet.Put(SfxBoolItem(SID_TITLE_MASTERPAGE, sal_False));
+ rSet.Put(SfxBoolItem(SID_TITLE_MASTERPAGE, false));
}
}
else
@@ -794,28 +791,28 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
else
{
- rSet.Put(SfxBoolItem(SID_PAGEMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_MASTERPAGE, sal_True));
+ rSet.Put(SfxBoolItem(SID_PAGEMODE, false));
+ rSet.Put(SfxBoolItem(SID_MASTERPAGE, true));
/**********************************************************************
* Hintergrundseiten-Modus
**********************************************************************/
if (mePageKind == PK_STANDARD)
{
- rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, sal_True));
- rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, sal_False));
- rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, sal_False));
+ rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, true));
+ rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, false));
+ rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, false));
if (rSet.GetItemState(SID_TITLE_MASTERPAGE) == SFX_ITEM_AVAILABLE)
{
- sal_Bool bCheck = sal_False;
- sal_Bool bDisable = sal_True;
+ bool bCheck = false;
+ bool bDisable = true;
if( pPageView )
{
- SdPage* pMPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
+ SdPage* pMPage = dynamic_cast< SdPage* >( &pPageView->getSdrPageFromSdrPageView() );
- sal_uInt16 i = 0;
- sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
+ sal_uInt32 i = 0;
+ sal_uInt32 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
// Referenziert eine Seite mit dem AutoLayout "Titel" die
// aktuelle MasterPage?
@@ -827,7 +824,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if (pPage->GetAutoLayout() == AUTOLAYOUT_TITLE)
{
// Eine Seite hat das AutoLayout "Titel"
- bDisable = sal_False;
+ bDisable = false;
SdPage& rRefMPage = (SdPage&)(pPage->TRG_GetMasterPage());
@@ -835,7 +832,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
// Eine Seite mit dem AutoLayout "Titel"
// referenziert die aktuelle MasterPage
- bCheck = sal_True;
+ bCheck = true;
}
}
@@ -845,7 +842,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if (bCheck)
{
- rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, sal_False));
+ rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, false));
}
rSet.Put(SfxBoolItem(SID_TITLE_MASTERPAGE, bCheck));
@@ -859,17 +856,17 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
else if (mePageKind == PK_NOTES)
{
- rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, sal_False));
+ rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, false));
rSet.DisableItem(SID_TITLE_MASTERPAGE);
- rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, sal_True));
- rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, sal_False));
+ rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, true));
+ rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, false));
}
else if (mePageKind == PK_HANDOUT)
{
- rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, sal_False));
+ rSet.Put(SfxBoolItem(SID_SLIDE_MASTERPAGE, false));
rSet.DisableItem(SID_TITLE_MASTERPAGE);
- rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, sal_False));
- rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, sal_True));
+ rSet.Put(SfxBoolItem(SID_NOTES_MASTERPAGE, false));
+ rSet.Put(SfxBoolItem(SID_HANDOUT_MASTERPAGE, true));
}
}
@@ -923,22 +920,25 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
// Sonderbehandlung für SID_OUTLINE_BULLET wenn Objekte
// mit unterschiedlichen arten von NumBullet Items markiert
// sind
- sal_Bool bHasOutliner = sal_False;
- sal_Bool bHasOther = sal_False;
- for(sal_uLong nNum = 0; nNum < nMarkCount; nNum++)
+ bool bHasOutliner = false;
+ bool bHasOther = false;
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[a];
+
if( pObj->GetObjInventor() == SdrInventor )
{
if( pObj->GetObjIdentifier() == OBJ_OUTLINETEXT )
{
- bHasOutliner = sal_True;
+ bHasOutliner = true;
if(bHasOther)
break;
}
else
{
- bHasOther = sal_True;
+ bHasOther = true;
if(bHasOutliner)
break;
}
@@ -1017,7 +1017,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
nCurrentSId != SID_ATTR_CHAR_VERTICAL )
nCurrentSId = SID_ATTR_CHAR;
- rSet.Put( SfxBoolItem( nCurrentSId, sal_True ) );
+ rSet.Put( SfxBoolItem( nCurrentSId, true ) );
// Kurzform von UpdateToolboxImages()
rSet.Put( TbxImageItem( SID_DRAWTBX_TEXT, nCurrentSId ) );
@@ -1031,11 +1031,11 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
if (GetDoc()->GetOnlineSpell())
{
- rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, sal_True));
+ rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, true));
}
else
{
- rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, sal_False));
+ rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, false));
}
}
@@ -1380,86 +1380,119 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
bool bSingleGraphicSelected = false;
- if (!mpDrawView->AreObjectsMarked())
+ if (!mpDrawView->areSdrObjectsSelected())
{
rSet.DisableItem (SID_CONVERT_TO_METAFILE);
rSet.DisableItem (SID_CONVERT_TO_BITMAP);
}
else
{
- // get marklist
- SdrMarkList aMarkList = mpDrawView->GetMarkedObjectList();
-
- sal_Bool bFoundBitmap = sal_False;
- sal_Bool bFoundMetafile = sal_False;
- sal_Bool bFoundObjNoLine = sal_False;
- sal_Bool bFoundObjNoArea = sal_False;
- sal_Bool bFoundNoGraphicObj = sal_False;
- sal_Bool bFoundAny = sal_False;
- bool bFoundTable = false;
-
-// const int nMarkCount = (int) aMarkList.GetMarkCount();
- for (sal_uLong i=0; i < nMarkCount && !bFoundAny; i++)
+ // get selection
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bFoundBitmap(false);
+ bool bFoundMetafile(false);
+ bool bFoundObjNoLine(false);
+ bool bFoundObjNoArea(false);
+ bool bFoundNoGraphicObj(false);
+ bool bFoundAny(false);
+ bool bFoundTable(false);
+
+ for(sal_uInt32 i(0); i < aSelection.size() && !bFoundAny; i++)
{
- SdrObject* pObj= aMarkList.GetMark(i)->GetMarkedSdrObj();
- sal_uInt16 nId = pObj->GetObjIdentifier();
- sal_uInt32 nInv = pObj->GetObjInventor();
+ SdrObject* pObj = aSelection[i];
+ const sal_uInt16 nId(pObj->GetObjIdentifier());
+ const sal_uInt32 nInv(pObj->GetObjInventor());
if(nInv == SdrInventor)
{
// 2D objects
switch( nId )
{
- case OBJ_PATHLINE :
- case OBJ_PLIN :
- case OBJ_LINE:
- case OBJ_FREELINE :
+ case OBJ_POLY:
+ {
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
+ {
+ switch(pSdrPathObj->getSdrPathObjType())
+ {
+ case PathType_Line:
+ case PathType_OpenPolygon:
+ case PathType_OpenBezier:
+ {
+ bFoundObjNoArea = true;
+ bFoundNoGraphicObj = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "OOps, SdrObjKind and dynamic_cast do not fit (!)");
+ }
+ break;
+ }
+ case OBJ_CIRC:
+ {
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(pObj);
+
+ if(pSdrCircObj)
+ {
+ if(CircleType_Arc == pSdrCircObj->GetSdrCircleObjType())
+ {
+ bFoundObjNoArea = true;
+ bFoundNoGraphicObj = true;
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "OOps, SdrObjKind and dynamic_cast do not fit (!)");
+ }
+ break;
+ }
case OBJ_EDGE:
- case OBJ_CARC :
- bFoundObjNoArea = sal_True;
- bFoundNoGraphicObj = sal_True;
+ bFoundObjNoArea = true;
+ bFoundNoGraphicObj = true;
break;
case OBJ_OLE2 :
// #i118485# #i118525# Allow Line, Area and Graphic (Metafile, Bitmap)
- bSingleGraphicSelected = nMarkCount == 1;
+ bSingleGraphicSelected = (1 == aSelection.size());
bFoundBitmap = true;
bFoundMetafile = true;
break;
case OBJ_GRAF :
{
- bSingleGraphicSelected = nMarkCount == 1;
+ bSingleGraphicSelected = (1 == aSelection.size());
const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj);
switch(pSdrGrafObj->GetGraphicType())
{
case GRAPHIC_BITMAP :
- bFoundBitmap = sal_True;
+ bFoundBitmap = true;
if(pSdrGrafObj->isEmbeddedSvg())
{
bFoundMetafile = true;
}
break;
case GRAPHIC_GDIMETAFILE :
- bFoundMetafile = sal_True;
+ bFoundMetafile = true;
break;
default:
break;
}
- // #i25616# bFoundObjNoLine = sal_True;
- // #i25616# bFoundObjNoArea = sal_True;
break;
}
case OBJ_TABLE:
bFoundTable = true;
break;
default :
- bFoundAny = sal_True;
+ bFoundAny = true;
}
}
else if(nInv == E3dInventor)
{
// 3D objects
- bFoundAny = sal_True;
+ bFoundAny = true;
}
}
@@ -1504,7 +1537,9 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
// Disable, if there is no hyperlink
//
sal_Bool bDisableEditHyperlink = sal_True;
- if( mpDrawView->AreObjectsMarked() && ( mpDrawView->GetMarkedObjectList().GetMarkCount() == 1 ) )
+ SdrObject* pSelected = mpDrawView->getSelectedIfSingle();
+
+ if( pSelected )
{
if( mpDrawView->IsTextEdit() )
{
@@ -1518,7 +1553,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 )
{
const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField->ISA(SvxURLField) )
+ if ( dynamic_cast< const SvxURLField* >(pField) )
bDisableEditHyperlink = sal_False;
}
}
@@ -1526,7 +1561,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
else
{
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj());
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >(pSelected);
if ( pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor() )
{
@@ -1593,9 +1628,9 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
&& GetDoc() != NULL)
{
SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
- sal_uInt8 aBackgroundId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aObjectId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = GetDoc()->GetModelLayerAdmin();
+ sal_uInt8 aBackgroundId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aObjectId = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
rSet.Put(SfxBoolItem(SID_DISPLAY_MASTER_BACKGROUND,
aVisibleLayers.IsSet(aBackgroundId)));
rSet.Put(SfxBoolItem(SID_DISPLAY_MASTER_OBJECTS,
@@ -1609,25 +1644,25 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
void DrawViewShell::GetModeSwitchingMenuState (SfxItemSet &rSet)
{
//draview
- rSet.Put(SfxBoolItem(SID_DIAMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_OUTLINEMODE, sal_False));
+ rSet.Put(SfxBoolItem(SID_DIAMODE, false));
+ rSet.Put(SfxBoolItem(SID_OUTLINEMODE, false));
if (mePageKind == PK_NOTES)
{
- rSet.Put(SfxBoolItem(SID_DRAWINGMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_NOTESMODE, sal_True));
- rSet.Put(SfxBoolItem(SID_HANDOUTMODE, sal_False));
+ rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false));
+ rSet.Put(SfxBoolItem(SID_NOTESMODE, true));
+ rSet.Put(SfxBoolItem(SID_HANDOUTMODE, false));
}
else if (mePageKind == PK_HANDOUT)
{
- rSet.Put(SfxBoolItem(SID_DRAWINGMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_NOTESMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_HANDOUTMODE, sal_True));
+ rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false));
+ rSet.Put(SfxBoolItem(SID_NOTESMODE, false));
+ rSet.Put(SfxBoolItem(SID_HANDOUTMODE, true));
}
else
{
- rSet.Put(SfxBoolItem(SID_DRAWINGMODE, sal_True));
- rSet.Put(SfxBoolItem(SID_NOTESMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_HANDOUTMODE, sal_False));
+ rSet.Put(SfxBoolItem(SID_DRAWINGMODE, true));
+ rSet.Put(SfxBoolItem(SID_NOTESMODE, false));
+ rSet.Put(SfxBoolItem(SID_HANDOUTMODE, false));
}
// #101976# Removed [GetDocSh()->GetCurrentFunction() ||] from the following
diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx
index 4fb718846b2a..8c0ddc1d3891 100644
--- a/sd/source/ui/view/drviews8.cxx
+++ b/sd/source/ui/view/drviews8.cxx
@@ -83,6 +83,7 @@
#include <vos/mutex.hxx>
#include <vcl/salbtype.hxx> // FRound
#include <vcl/svapp.hxx>
+#include "drawdoc.hxx"
namespace sd {
@@ -208,7 +209,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
case SID_COPYOBJECTS:
{
- if ( mpDrawView->IsPresObjSelected(sal_False, sal_True) )
+ if ( mpDrawView->IsPresObjSelected(false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
@@ -251,7 +252,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
case SID_ZOOM_OUT:
case SID_ZOOM_PANNING:
{
- mbZoomOnPage = sal_False;
+ mbZoomOnPage = false;
SetCurrentFunction( FuZoom::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
// Beendet sich selbst, kein Cancel() notwendig!
Invalidate( SID_ZOOM_TOOLBOX );
@@ -293,8 +294,10 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
break;
case SID_CAPTUREPOINT:
+ {
// negative Werte um Aufruf aus Menue zu signalisieren
- maMousePos = Point(-1,-1);
+ maMousePos = basegfx::B2DPoint(-1.0, -1.0);
+ }
case SID_SET_SNAPITEM:
{
SetCurrentFunction( FuSnapLine::Create(this, GetActiveWindow(), mpDrawView, GetDoc(), rReq) );
@@ -345,7 +348,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
case SID_CONNECTION_NEW_ROUTING:
{
SfxItemSet aDefAttr( GetPool(), SDRATTR_EDGELINE1DELTA, SDRATTR_EDGELINE3DELTA );
- GetView()->SetAttributes( aDefAttr, sal_True ); // (ReplaceAll)
+ GetView()->SetAttributes( aDefAttr, true ); // (ReplaceAll)
Cancel();
rReq.Done();
@@ -354,7 +357,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
case SID_TWAIN_SELECT:
{
- sal_Bool bDone = sal_False;
+ bool bDone = false;
if( mxScannerManager.is() )
{
@@ -381,7 +384,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
case SID_TWAIN_TRANSFER:
{
- sal_Bool bDone = sal_False;
+ bool bDone = false;
if( mxScannerManager.is() )
{
@@ -392,7 +395,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
if( aContexts.getLength() )
{
mxScannerManager->startScan( aContexts.getConstArray()[ 0 ], mxScannerListener );
- bDone = sal_True;
+ bDone = true;
}
}
catch( ... )
@@ -469,11 +472,12 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& )
{
const BitmapEx aScanBmp( VCLUnoHelper::GetBitmap( xBitmap ) );
- if( !!aScanBmp )
+ if( !!aScanBmp && mpDrawView->GetSdrPageView() )
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage();
- Size aBmpSize( aScanBmp.GetPrefSize() ), aPageSize( pPage->GetSize() );
+ SdrPage& rPage = mpDrawView->GetSdrPageView()->getSdrPageFromSdrPageView();
+ Size aBmpSize( aScanBmp.GetPrefSize() );
+ Size aPageSize(basegfx::fround(rPage.GetPageScale().getX()), basegfx::fround(rPage.GetPageScale().getY()));
const MapMode aMap100( MAP_100TH_MM );
if( !aBmpSize.Width() || !aBmpSize.Height() )
@@ -484,8 +488,8 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& )
else
aBmpSize = OutputDevice::LogicToLogic( aBmpSize, aScanBmp.GetPrefMapMode(), aMap100 );
- aPageSize.Width() -= pPage->GetLftBorder() + pPage->GetRgtBorder();
- aPageSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder();
+ aPageSize.Width() -= rPage.GetLeftPageBorder() + rPage.GetRightPageBorder();
+ aPageSize.Height() -= rPage.GetTopPageBorder() + rPage.GetBottomPageBorder();
if( ( ( aBmpSize.Height() > aPageSize.Height() ) || ( aBmpSize.Width() > aPageSize.Width() ) ) && aBmpSize.Height() && aPageSize.Height() )
{
@@ -505,40 +509,28 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& )
}
Point aPnt ( ( aPageSize.Width() - aBmpSize.Width() ) >> 1, ( aPageSize.Height() - aBmpSize.Height() ) >> 1 );
- aPnt += Point( pPage->GetLftBorder(), pPage->GetUppBorder() );
- Rectangle aRect( aPnt, aBmpSize );
+ aPnt += Point( rPage.GetLeftPageBorder(), rPage.GetTopPageBorder() );
SdrGrafObj* pGrafObj = NULL;
- sal_Bool bInsertNewObject = sal_True;
-
- if( GetView()->AreObjectsMarked() )
- {
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ bool bInsertNewObject = true;
+ SdrGrafObj* pTargetObj = dynamic_cast< SdrGrafObj* >(GetView()->getSelectedIfSingle());
- if( rMarkList.GetMarkCount() == 1 )
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- if( pObj->ISA( SdrGrafObj ) )
+ if(pTargetObj && pTargetObj->IsEmptyPresObj() )
{
- pGrafObj = static_cast< SdrGrafObj* >( pObj );
-
- if( pGrafObj->IsEmptyPresObj() )
- {
- bInsertNewObject = sal_False;
- pGrafObj->SetEmptyPresObj(sal_False);
- pGrafObj->SetOutlinerParaObject(NULL);
- pGrafObj->SetGraphic( Graphic( aScanBmp ) );
- }
- }
- }
+ bInsertNewObject = false;
+ pTargetObj->SetEmptyPresObj(false);
+ pTargetObj->SetOutlinerParaObject(NULL);
+ pTargetObj->SetGraphic( Graphic( aScanBmp ) );
}
if( bInsertNewObject )
{
- pGrafObj = new SdrGrafObj( Graphic( aScanBmp ), aRect );
- SdrPageView* pPV = GetView()->GetSdrPageView();
- GetView()->InsertObjectAtView( pGrafObj, *pPV, SDRINSERT_SETDEFLAYER );
+ pGrafObj = new SdrGrafObj(
+ *GetDoc(),
+ Graphic( aScanBmp ),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aBmpSize.getWidth(), aBmpSize.getHeight(),
+ aPnt.X(), aPnt.Y()));
+ GetView()->InsertObjectAtView( *pGrafObj, SDRINSERT_SETDEFLAYER );
}
}
}
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 67670ef4bc81..a07ff1a84de6 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -101,108 +101,78 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
if ( pGal )
{
- GetDocSh()->SetWaitCursor( sal_True );
+ GetDocSh()->SetWaitCursor( true );
// Graphik einfuegen
- if (nFormats & SGA_FORMAT_GRAPHIC)
+ if (nFormats & SGA_FORMAT_GRAPHIC && mpDrawView->GetSdrPageView())
{
Graphic aGraphic = pGal->GetGraphic();
// Ggf. Groesse reduzieren
- Window aWindow (GetActiveWindow());
- aWindow.SetMapMode(aGraphic.GetPrefMapMode());
- Size aSizePix = aWindow.LogicToPixel(aGraphic.GetPrefSize());
- aWindow.SetMapMode( MapMode(MAP_100TH_MM) );
- Size aSize = aWindow.PixelToLogic(aSizePix);
+ const Size aSiz100thmm(GetActiveWindow()->LogicToLogic(aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), MapMode(MAP_100TH_MM)));
+ basegfx::B2DVector aSizeLogic(aSiz100thmm.Width(), aSiz100thmm.Height());
// Groesse ggf. auf Seitengroesse begrenzen
- SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage();
- Size aPageSize = pPage->GetSize();
- aPageSize.Width() -= pPage->GetLftBorder() + pPage->GetRgtBorder();
- aPageSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder();
-
-
- // Falls Grafik zu gross, wird die Grafik
- // in die Seite eingepasst
- if ( ( ( aSize.Height() > aPageSize.Height() ) || ( aSize.Width() > aPageSize.Width() ) ) &&
- aSize.Height() && aPageSize.Height() )
+ SdrPage& rPage = mpDrawView->GetSdrPageView()->getSdrPageFromSdrPageView();
+ const basegfx::B2DVector aInnerPageScale(rPage.GetInnerPageScale());
+
+ // Falls Grafik zu gross, wird die Grafik in die Seite eingepasst
+ if(!basegfx::fTools::equalZero(aSizeLogic.getY())
+ && !basegfx::fTools::equalZero(aInnerPageScale.getY())
+ && (basegfx::fTools::more(aSizeLogic.getY(), aInnerPageScale.getY())
+ || basegfx::fTools::more(aSizeLogic.getX(), aInnerPageScale.getX())))
{
- float fGrfWH = (float)aSize.Width() /
- (float)aSize.Height();
- float fWinWH = (float)aPageSize.Width() /
- (float)aPageSize.Height();
+ const double fGrfWH(aSizeLogic.getX() / aSizeLogic.getY());
+ const double fWinWH(aInnerPageScale.getX() / aInnerPageScale.getY());
// Grafik an Pagesize anpassen (skaliert)
- if ((fGrfWH != 0.F) && (fGrfWH < fWinWH))
+ if(!basegfx::fTools::equalZero(fGrfWH) && basegfx::fTools::less(fGrfWH, fWinWH))
{
- aSize.Width() = (long)(aPageSize.Height() * fGrfWH);
- aSize.Height()= aPageSize.Height();
+ aSizeLogic.setX(aInnerPageScale.getY() * fGrfWH);
+ aSizeLogic.setY(aInnerPageScale.getY());
}
else
{
- aSize.Width() = aPageSize.Width();
- aSize.Height()= (long)(aPageSize.Width() / fGrfWH);
+ aSizeLogic.setX(aInnerPageScale.getX());
+ aSizeLogic.setY(aInnerPageScale.getX() / fGrfWH);
}
}
-
// Ausgaberechteck fuer Grafik setzen
- Point aPnt ((aPageSize.Width() - aSize.Width()) / 2,
- (aPageSize.Height() - aSize.Height()) / 2);
- aPnt += Point(pPage->GetLftBorder(), pPage->GetUppBorder());
- Rectangle aRect (aPnt, aSize);
-
- SdrGrafObj* pGrafObj = NULL;
+ const basegfx::B2DPoint aPnt(((aInnerPageScale - aSizeLogic) * 0.5) + basegfx::B2DPoint(rPage.GetLeftPageBorder(), rPage.GetTopPageBorder()));
+ bool bInsertNewObject = true;
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >(mpDrawView->getSelectedIfSingle());
- sal_Bool bInsertNewObject = sal_True;
-
- if ( mpDrawView->AreObjectsMarked() )
+ if(pGrafObj && pGrafObj->IsEmptyPresObj() )
{
- /******************************************************
- * Ist ein leeres Graphik-Objekt vorhanden?
- ******************************************************/
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- if (pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF)
- {
- pGrafObj = (SdrGrafObj*) pObj;
-
- if( pGrafObj->IsEmptyPresObj() )
- {
- /******************************************
- * Das leere Graphik-Objekt bekommt eine neue
- * Graphik
- ******************************************/
- bInsertNewObject = sal_False;
-
- SdrGrafObj* pNewGrafObj = (SdrGrafObj*) pGrafObj->Clone();
- pNewGrafObj->SetEmptyPresObj(sal_False);
+ /******************************************
+ * Das leere Graphik-Objekt bekommt eine neue
+ * Graphik
+ ******************************************/
+ bInsertNewObject = false;
+
+ SdrGrafObj* pNewGrafObj = (SdrGrafObj*) pGrafObj->CloneSdrObject();
+ pNewGrafObj->SetEmptyPresObj(false);
pNewGrafObj->SetOutlinerParaObject(NULL);
pNewGrafObj->SetGraphic(aGraphic);
- String aStr(mpDrawView->GetDescriptionOfMarkedObjects());
+ String aStr;
+
+ pGrafObj->TakeObjNameSingul(aStr);
aStr += sal_Unicode(' ');
aStr += String(SdResId(STR_UNDO_REPLACE));
mpDrawView->BegUndo(aStr);
- SdrPageView* pPV = mpDrawView->GetSdrPageView();
- mpDrawView->ReplaceObjectAtView(pGrafObj, *pPV, pNewGrafObj);
+ mpDrawView->ReplaceObjectAtView(*pGrafObj, *pNewGrafObj);
mpDrawView->EndUndo();
- }
- }
- }
}
-
if( bInsertNewObject )
{
- pGrafObj = new SdrGrafObj(aGraphic, aRect);
- SdrPageView* pPV = mpDrawView->GetSdrPageView();
- mpDrawView->InsertObjectAtView(pGrafObj, *pPV, SDRINSERT_SETDEFLAYER);
+ pGrafObj = new SdrGrafObj(
+ *GetDoc(),
+ aGraphic,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aSizeLogic, aPnt));
+ mpDrawView->InsertObjectAtView(*pGrafObj, SDRINSERT_SETDEFLAYER);
}
// Soll nur ein Link benutzt werden?
@@ -216,7 +186,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_AVMEDIA, SFX_CALLMODE_SYNCHRON, &aMediaURLItem, 0L );
}
- GetDocSh()->SetWaitCursor( sal_False );
+ GetDocSh()->SetWaitCursor( false );
}
}
}
@@ -255,7 +225,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
CheckLineTo (rReq);
SfxBindings& rBindings = GetViewFrame()->GetBindings();
- SfxItemSet* pAttr = new SfxItemSet ( GetDoc()->GetPool() );
+ SfxItemSet* pAttr = new SfxItemSet ( GetDoc()->GetItemPool() );
GetView()->GetAttributes( *pAttr );
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -267,7 +237,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 1)
{
- SFX_REQUEST_ARG (rReq, pFillStyle, SfxUInt32Item, ID_VAL_STYLE, sal_False);
+ SFX_REQUEST_ARG (rReq, pFillStyle, SfxUInt32Item, ID_VAL_STYLE );
if (CHECK_RANGE (XFILL_NONE, (sal_Int32)pFillStyle->GetValue (), XFILL_BITMAP))
{
pAttr->ClearItem (XATTR_FILLSTYLE);
@@ -287,7 +257,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 1)
{
- SFX_REQUEST_ARG (rReq, pLineStyle, SfxUInt32Item, ID_VAL_STYLE, sal_False);
+ SFX_REQUEST_ARG (rReq, pLineStyle, SfxUInt32Item, ID_VAL_STYLE );
if (CHECK_RANGE (XLINE_NONE, (sal_Int32)pLineStyle->GetValue (), XLINE_DASH))
{
pAttr->ClearItem (XATTR_LINESTYLE);
@@ -307,7 +277,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 1)
{
- SFX_REQUEST_ARG (rReq, pLineWidth, SfxUInt32Item, ID_VAL_WIDTH, sal_False);
+ SFX_REQUEST_ARG (rReq, pLineWidth, SfxUInt32Item, ID_VAL_WIDTH );
pAttr->ClearItem (XATTR_LINEWIDTH);
pAttr->Put (XLineWidthItem (pLineWidth->GetValue ()), XATTR_LINEWIDTH);
rBindings.Invalidate (SID_ATTR_LINE_WIDTH);
@@ -321,9 +291,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 3)
{
- SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED, sal_False);
- SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN, sal_False);
- SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE, sal_False);
+ SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED );
+ SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN );
+ SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE );
pAttr->ClearItem (XATTR_FILLCOLOR);
pAttr->ClearItem (XATTR_FILLSTYLE);
@@ -344,9 +314,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 3)
{
- SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED, sal_False);
- SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN, sal_False);
- SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE, sal_False);
+ SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED );
+ SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN );
+ SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE );
pAttr->ClearItem (XATTR_LINECOLOR);
pAttr->Put (XLineColorItem (-1, Color ((sal_uInt8) pRed->GetValue (),
@@ -365,10 +335,10 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 4)
{
- SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX, sal_False);
- SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED, sal_False);
- SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN, sal_False);
- SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE, sal_False);
+ SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX );
+ SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED );
+ SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN );
+ SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE );
XGradientList *pGradientList = GetDoc()->GetGradientList ();
long nCounts = pGradientList->Count ();
@@ -425,10 +395,10 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 4)
{
- SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX, sal_False);
- SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED, sal_False);
- SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN, sal_False);
- SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE, sal_False);
+ SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX );
+ SFX_REQUEST_ARG (rReq, pRed, SfxUInt32Item, ID_VAL_RED );
+ SFX_REQUEST_ARG (rReq, pGreen, SfxUInt32Item, ID_VAL_GREEN );
+ SFX_REQUEST_ARG (rReq, pBlue, SfxUInt32Item, ID_VAL_BLUE );
XHatchList *pHatchList = GetDoc()->GetHatchList ();
long nCounts = pHatchList->Count ();
@@ -479,13 +449,13 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 7)
{
- SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX, sal_False);
- SFX_REQUEST_ARG (rReq, pStyle, SfxUInt32Item, ID_VAL_STYLE, sal_False);
- SFX_REQUEST_ARG (rReq, pDots, SfxUInt32Item, ID_VAL_DOTS, sal_False);
- SFX_REQUEST_ARG (rReq, pDotLen, SfxUInt32Item, ID_VAL_DOTLEN, sal_False);
- SFX_REQUEST_ARG (rReq, pDashes, SfxUInt32Item, ID_VAL_DASHES, sal_False);
- SFX_REQUEST_ARG (rReq, pDashLen, SfxUInt32Item, ID_VAL_DASHLEN, sal_False);
- SFX_REQUEST_ARG (rReq, pDistance, SfxUInt32Item, ID_VAL_DISTANCE, sal_False);
+ SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX );
+ SFX_REQUEST_ARG (rReq, pStyle, SfxUInt32Item, ID_VAL_STYLE );
+ SFX_REQUEST_ARG (rReq, pDots, SfxUInt32Item, ID_VAL_DOTS );
+ SFX_REQUEST_ARG (rReq, pDotLen, SfxUInt32Item, ID_VAL_DOTLEN );
+ SFX_REQUEST_ARG (rReq, pDashes, SfxUInt32Item, ID_VAL_DASHES );
+ SFX_REQUEST_ARG (rReq, pDashLen, SfxUInt32Item, ID_VAL_DASHLEN );
+ SFX_REQUEST_ARG (rReq, pDistance, SfxUInt32Item, ID_VAL_DISTANCE );
if (CHECK_RANGE (XDASH_RECT, (sal_Int32)pStyle->GetValue (), XDASH_ROUNDRELATIVE))
{
@@ -527,14 +497,14 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 8)
{
- SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX, sal_False);
- SFX_REQUEST_ARG (rReq, pStyle, SfxUInt32Item, ID_VAL_STYLE, sal_False);
- SFX_REQUEST_ARG (rReq, pAngle, SfxUInt32Item, ID_VAL_ANGLE, sal_False);
- SFX_REQUEST_ARG (rReq, pBorder, SfxUInt32Item, ID_VAL_BORDER, sal_False);
- SFX_REQUEST_ARG (rReq, pCenterX, SfxUInt32Item, ID_VAL_CENTER_X, sal_False);
- SFX_REQUEST_ARG (rReq, pCenterY, SfxUInt32Item, ID_VAL_CENTER_Y, sal_False);
- SFX_REQUEST_ARG (rReq, pStart, SfxUInt32Item, ID_VAL_STARTINTENS, sal_False);
- SFX_REQUEST_ARG (rReq, pEnd, SfxUInt32Item, ID_VAL_ENDINTENS, sal_False);
+ SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX );
+ SFX_REQUEST_ARG (rReq, pStyle, SfxUInt32Item, ID_VAL_STYLE );
+ SFX_REQUEST_ARG (rReq, pAngle, SfxUInt32Item, ID_VAL_ANGLE );
+ SFX_REQUEST_ARG (rReq, pBorder, SfxUInt32Item, ID_VAL_BORDER );
+ SFX_REQUEST_ARG (rReq, pCenterX, SfxUInt32Item, ID_VAL_CENTER_X );
+ SFX_REQUEST_ARG (rReq, pCenterY, SfxUInt32Item, ID_VAL_CENTER_Y );
+ SFX_REQUEST_ARG (rReq, pStart, SfxUInt32Item, ID_VAL_STARTINTENS );
+ SFX_REQUEST_ARG (rReq, pEnd, SfxUInt32Item, ID_VAL_ENDINTENS );
if (CHECK_RANGE (XGRAD_LINEAR, (sal_Int32)pStyle->GetValue (), XGRAD_RECT) &&
CHECK_RANGE (0, (sal_Int32)pAngle->GetValue (), 360) &&
@@ -602,10 +572,10 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 4)
{
- SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX, sal_False);
- SFX_REQUEST_ARG (rReq, pStyle, SfxUInt32Item, ID_VAL_STYLE, sal_False);
- SFX_REQUEST_ARG (rReq, pDistance, SfxUInt32Item, ID_VAL_DISTANCE, sal_False);
- SFX_REQUEST_ARG (rReq, pAngle, SfxUInt32Item, ID_VAL_ANGLE, sal_False);
+ SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX );
+ SFX_REQUEST_ARG (rReq, pStyle, SfxUInt32Item, ID_VAL_STYLE );
+ SFX_REQUEST_ARG (rReq, pDistance, SfxUInt32Item, ID_VAL_DISTANCE );
+ SFX_REQUEST_ARG (rReq, pAngle, SfxUInt32Item, ID_VAL_ANGLE );
if (CHECK_RANGE (XHATCH_SINGLE, (sal_Int32)pStyle->GetValue (), XHATCH_TRIPLE) &&
CHECK_RANGE (0, (sal_Int32)pAngle->GetValue (), 360))
@@ -661,7 +631,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 1)
{
- SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX, sal_False);
+ SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX );
XGradientList *pGradientList = GetDoc()->GetGradientList ();
long nCounts = pGradientList->Count ();
@@ -695,7 +665,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (pArgs)
if (pArgs->Count () == 1)
{
- SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX, sal_False);
+ SFX_REQUEST_ARG (rReq, pName, SfxStringItem, ID_VAL_INDEX );
XHatchList *pHatchList = GetDoc()->GetHatchList ();
long nCounts = pHatchList->Count ();
@@ -777,7 +747,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet)
{
SfxWhichIter aIter (rSet);
sal_uInt16 nWhich = aIter.FirstWhich ();
- SfxItemSet aAttr( GetDoc()->GetPool() );
+ SfxItemSet aAttr( GetDoc()->GetItemPool() );
mpDrawView->GetAttributes( aAttr );
while (nWhich)
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 8ecc12b695e6..fda5ba131c3d 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -91,7 +91,7 @@ static const ::rtl::OUString MASTER_VIEW_TOOL_BAR_NAME(
namespace sd {
-sal_Bool DrawViewShell::mbPipette = sal_False;
+bool DrawViewShell::mbPipette = false;
// ------------------------
// - ScannerEventListener -
@@ -142,7 +142,7 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas
if (pFrameViewArgument != NULL)
mpFrameView = pFrameViewArgument;
else
- mpFrameView = new FrameView(GetDoc());
+ mpFrameView = new FrameView(*GetDoc());
Construct(GetDocSh(), ePageKind);
}
@@ -182,25 +182,25 @@ DrawViewShell::~DrawViewShell()
DisposeFunctions();
SdPage* pPage;
- sal_uInt16 aPageCnt = GetDoc()->GetSdPageCount(mePageKind);
+ sal_uInt32 aPageCnt = GetDoc()->GetSdPageCount(mePageKind);
- for (sal_uInt16 i = 0; i < aPageCnt; i++)
+ for (sal_uInt32 i = 0; i < aPageCnt; i++)
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
if (pPage == mpActualPage)
{
- GetDoc()->SetSelected(pPage, sal_True);
+ GetDoc()->SetSelected(pPage, true);
}
else
{
- GetDoc()->SetSelected(pPage, sal_False);
+ GetDoc()->SetSelected(pPage, false);
}
}
if ( mpClipEvtLstnr )
{
- mpClipEvtLstnr->AddRemoveListener( GetActiveWindow(), sal_False );
+ mpClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false );
mpClipEvtLstnr->ClearCallbackLink(); // #103849# prevent callback if another thread is waiting
mpClipEvtLstnr->release();
}
@@ -223,11 +223,11 @@ DrawViewShell::~DrawViewShell()
void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
{
mpActualPage = 0;
- mbMousePosFreezed = sal_False;
+ mbMousePosFreezed = false;
mbReadOnly = GetDocSh()->IsReadOnly();
mpSlotArray = 0;
mpClipEvtLstnr = 0;
- mbPastePossible = sal_False;
+ mbPastePossible = false;
mbIsLayerModeActive = false;
mpFrameView->Connect();
@@ -265,13 +265,13 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
mpSlotArray[ 22 ] = SID_DRAWTBX_ARROWS;
mpSlotArray[ 23 ] = SID_LINE_ARROW_END;
- SetPool( &GetDoc()->GetPool() );
+ SetPool( &GetDoc()->GetItemPool() );
GetDoc()->CreateFirstPages();
mpDrawView = new DrawView(pDocSh, GetActiveWindow(), this);
mpView = mpDrawView; // Pointer der Basisklasse ViewShell
- mpDrawView->SetSwapAsynchron(sal_True); // Asynchrones Laden von Graphiken
+ mpDrawView->SetSwapAsynchron(true); // Asynchrones Laden von Graphiken
// We do not read the page kind from the frame view anymore so we have
// to set it in order to resync frame view and this view.
@@ -294,22 +294,24 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
break;
}
- Size aPageSize( GetDoc()->GetSdPage(0, mePageKind)->GetSize() );
- Point aPageOrg( aPageSize.Width(), aPageSize.Height() / 2);
- Size aSize(aPageSize.Width() * 3, aPageSize.Height() * 2);
- InitWindows(aPageOrg, aSize, Point(-1, -1));
+ const basegfx::B2DVector& rPageScale = GetDoc()->GetSdPage(0, mePageKind)->GetPageScale();
+ const basegfx::B2DPoint aPageOrg( rPageScale.getX(), rPageScale.getY() * 0.5);
+ const basegfx::B2DVector aViewSize(rPageScale.getX() * 3.0, rPageScale.getY() * 2.0);
- Point aVisAreaPos;
+ InitWindows(aPageOrg, aViewSize, basegfx::B2DPoint(-1.0, -1.0));
+ basegfx::B2DPoint aVisAreaPos(0.0, 0.0);
if ( pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
- aVisAreaPos = pDocSh->GetVisArea(ASPECT_CONTENT).TopLeft();
+ const Point aOld(pDocSh->GetVisArea(ASPECT_CONTENT).TopLeft());
+ aVisAreaPos = basegfx::B2DPoint(aOld.X(), aOld.Y());
}
- mpDrawView->SetWorkArea(Rectangle(Point() - aVisAreaPos - aPageOrg, aSize));
+ const basegfx::B2DPoint aWATopLeft(-aVisAreaPos - aPageOrg);
+ mpDrawView->SetWorkArea(basegfx::B2DRange(aWATopLeft, aWATopLeft + aViewSize));
// Objekte koennen max. so gross wie die ViewSize werden
- GetDoc()->SetMaxObjSize(aSize);
+ GetDoc()->SetMaxObjectScale(aViewSize);
// Split-Handler fuer TabControls
maTabControl.SetSplitHdl( LINK( this, DrawViewShell, TabSplitHdl ) );
@@ -365,18 +367,18 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
// Selektionsfunktion starten
SfxRequest aReq(SID_OBJECT_SELECT, 0, GetDoc()->GetItemPool());
FuPermanent(aReq);
- mpDrawView->SetFrameDragSingles(sal_True);
+ mpDrawView->SetFrameHandles(true);
if (pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)
{
- mbZoomOnPage = sal_False;
+ mbZoomOnPage = false;
}
else
{
- mbZoomOnPage = sal_True;
+ mbZoomOnPage = true;
}
- mbIsRulerDrag = sal_False;
+ mbIsRulerDrag = false;
String aName( RTL_CONSTASCII_USTRINGPARAM("DrawViewShell"));
SetName (aName);
@@ -453,7 +455,7 @@ css::uno::Reference<css::drawing::XDrawSubController> DrawViewShell::CreateSubCo
bool DrawViewShell::RelocateToParentWindow (::Window* pParentWindow)
{
// DrawViewShells can not be relocated to a new parent window at the
- // moment, so return <FALSE/> except when the given parent window is the
+ // moment, so return <false/> except when the given parent window is the
// parent window that is already in use.
return pParentWindow==GetParentWindow();
}
@@ -503,17 +505,18 @@ void DrawViewShell::CheckLineTo(SfxRequest& rReq)
|*
\************************************************************************/
-void DrawViewShell::SetupPage (Size &rSize,
- long nLeft,
- long nRight,
- long nUpper,
- long nLower,
- sal_Bool bSize,
- sal_Bool bMargin,
- sal_Bool bScaleAll)
+void DrawViewShell::SetupPage (
+ const basegfx::B2DVector& rSize,
+ double fLeft,
+ double fRight,
+ double fTop,
+ double fBottom,
+ bool bSize,
+ bool bMargin,
+ bool bScaleAll)
{
- sal_uInt16 nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
- sal_uInt16 i;
+ sal_uInt32 nPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
+ sal_uInt32 i;
for (i = 0; i < nPageCnt; i++)
{
@@ -526,17 +529,16 @@ void DrawViewShell::SetupPage (Size &rSize,
{
if( bSize )
{
- Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
- pPage->ScaleObjects(rSize, aBorderRect, bScaleAll);
- pPage->SetSize(rSize);
+ pPage->ScaleObjects(rSize, fLeft, fTop, fRight, fBottom, bScaleAll);
+ pPage->SetPageScale(rSize);
}
if( bMargin )
{
- pPage->SetLftBorder(nLeft);
- pPage->SetRgtBorder(nRight);
- pPage->SetUppBorder(nUpper);
- pPage->SetLwrBorder(nLower);
+ pPage->SetLeftPageBorder(fLeft);
+ pPage->SetRightPageBorder(fRight);
+ pPage->SetTopPageBorder(fTop);
+ pPage->SetBottomPageBorder(fBottom);
}
if ( mePageKind == PK_STANDARD )
@@ -561,16 +563,15 @@ void DrawViewShell::SetupPage (Size &rSize,
{
if( bSize )
{
- Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
- pPage->ScaleObjects(rSize, aBorderRect, bScaleAll);
- pPage->SetSize(rSize);
+ pPage->ScaleObjects(rSize, fLeft, fTop, fRight, fBottom, bScaleAll);
+ pPage->SetPageScale(rSize);
}
if( bMargin )
{
- pPage->SetLftBorder(nLeft);
- pPage->SetRgtBorder(nRight);
- pPage->SetUppBorder(nUpper);
- pPage->SetLwrBorder(nLower);
+ pPage->SetLeftPageBorder(fLeft);
+ pPage->SetRightPageBorder(fRight);
+ pPage->SetTopPageBorder(fTop);
+ pPage->SetBottomPageBorder(fBottom);
}
if ( mePageKind == PK_STANDARD )
@@ -586,30 +587,32 @@ void DrawViewShell::SetupPage (Size &rSize,
if ( mePageKind == PK_STANDARD )
{
SdPage* pHandoutPage = GetDoc()->GetSdPage(0, PK_HANDOUT);
- pHandoutPage->CreateTitleAndLayout(sal_True);
+ pHandoutPage->CreateTitleAndLayout(true);
}
- long nWidth = mpActualPage->GetSize().Width();
- long nHeight = mpActualPage->GetSize().Height();
+ const basegfx::B2DPoint aPageOrg(mpActualPage->GetPageScale().getX(), mpActualPage->GetPageScale().getY() * 0.5);
+ const basegfx::B2DVector aPageSize(mpActualPage->GetPageScale().getX() * 3.0, mpActualPage->GetPageScale().getY() * 2.0);
- Point aPageOrg(nWidth, nHeight / 2);
- Size aSize( nWidth * 3, nHeight * 2);
+ InitWindows(aPageOrg, aPageSize, basegfx::B2DPoint(-1.0, -1.0), true);
- InitWindows(aPageOrg, aSize, Point(-1, -1), sal_True);
-
- Point aVisAreaPos;
+ basegfx::B2DPoint aVisAreaPos(0.0, 0.0);
if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
- aVisAreaPos = GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft();
+ const Point aOld(GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft());
+ aVisAreaPos = basegfx::B2DPoint(aOld.X(), aOld.Y());
}
- GetView()->SetWorkArea(Rectangle(Point() - aVisAreaPos - aPageOrg, aSize));
+ const basegfx::B2DPoint aWATopLeft(-aVisAreaPos - aPageOrg);
+ GetView()->SetWorkArea(basegfx::B2DRange(aWATopLeft, aWATopLeft + aPageSize));
UpdateScrollBars();
- Point aNewOrigin(mpActualPage->GetLftBorder(), mpActualPage->GetUppBorder());
- GetView()->GetSdrPageView()->SetPageOrigin(aNewOrigin);
+ if(GetView()->GetSdrPageView())
+ {
+ const basegfx::B2DPoint aNewOrigin(mpActualPage->GetLeftPageBorder(), mpActualPage->GetTopPageBorder());
+ GetView()->GetSdrPageView()->SetPageOrigin(aNewOrigin);
+ }
GetViewFrame()->GetBindings().Invalidate(SID_RULER_NULL_OFFSET);
@@ -649,8 +652,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
sal_uInt16 nZoomValues = SVX_ZOOM_ENABLE_ALL;
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
- if( ( pPageView && pPageView->GetObjList()->GetObjCount() == 0 ) )
- // || ( mpDrawView->GetMarkedObjectList().GetMarkCount() == 0 ) )
+ if( ( pPageView && pPageView->GetCurrentObjectList()->GetObjCount() == 0 ) )
{
nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
}
@@ -675,74 +677,80 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
if( pPageView )
{
- Point aPagePos(0, 0);
- Size aPageSize = pPageView->GetPage()->GetSize();
+ basegfx::B2DPoint aPagePos(0.0, 0.0);
+ basegfx::B2DVector aPageScale(pPageView->getSdrPageFromSdrPageView().GetPageScale());
- aPagePos.X() += aPageSize.Width() / 2;
- aPageSize.Width() = (long) (aPageSize.Width() * 1.03);
+ aPagePos.setX(aPagePos.getX() + (aPageScale.getX() * 0.5));
+ aPageScale.setX(aPageScale.getX() * 1.03);
- aPagePos.Y() += aPageSize.Height() / 2;
- aPageSize.Height() = (long) (aPageSize.Height() * 1.03);
- aPagePos.Y() -= aPageSize.Height() / 2;
+ aPagePos.setY(aPagePos.getY() + (aPageScale.getY() * 0.5));
+ aPageScale.setY(aPageScale.getY() * 1.03);
+ aPagePos.setY(aPagePos.getY() - (aPageScale.getY() * 0.5));
- aPagePos.X() -= aPageSize.Width() / 2;
+ aPagePos.setX(aPagePos.getX() - (aPageScale.getX() * 0.5));
- Rectangle aFullPageZoomRect( aPagePos, aPageSize );
- aZoomItem.AddSnappingPoint( pActiveWindow->GetZoomForRect( aFullPageZoomRect ) );
+ const basegfx::B2DRange aFullPageZoomRange( aPagePos, aPagePos + aPageScale );
+ aZoomItem.AddSnappingPoint( pActiveWindow->GetZoomForRange( aFullPageZoomRange ) );
}
aZoomItem.AddSnappingPoint(100);
rSet.Put( aZoomItem );
}
}
- Point aPos = GetActiveWindow()->PixelToLogic(maMousePos);
- mpDrawView->GetSdrPageView()->LogicToPagePos(aPos);
- Fraction aUIScale(GetDoc()->GetUIScale());
- aPos.X() = Fraction(aPos.X()) / aUIScale;
- aPos.Y() = Fraction(aPos.Y()) / aUIScale;
+ basegfx::B2DPoint aPos(GetActiveWindow()->GetInverseViewTransformation() * maMousePos);
+ const double fUIScale(GetDoc()->GetUIScale());
+
+ if(mpDrawView->GetSdrPageView())
+ {
+ aPos -= mpDrawView->GetSdrPageView()->GetPageOrigin();
+ }
+
+ aPos /= fUIScale;
// Position- und Groesse-Items
if ( mpDrawView->IsAction() )
{
- Rectangle aRect;
- mpDrawView->TakeActionRect( aRect );
+ basegfx::B2DRange aRange(mpDrawView->TakeActionRange());
- if ( aRect.IsEmpty() )
- rSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
+ if(aRange.isEmpty())
+ {
+ rSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY()))));
+ }
else
{
- mpDrawView->GetSdrPageView()->LogicToPagePos(aRect);
- aPos = aRect.TopLeft();
- aPos.X() = Fraction(aPos.X()) / aUIScale;
- aPos.Y() = Fraction(aPos.Y()) / aUIScale;
- rSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos) );
- Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
- aSize.Height() = Fraction(aSize.Height()) / aUIScale;
- aSize.Width() = Fraction(aSize.Width()) / aUIScale;
- rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
+ if(mpDrawView->GetSdrPageView())
+ {
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpDrawView->GetSdrPageView()->GetPageOrigin()));
+ }
+
+ aPos = aRange.getMinimum() / fUIScale;
+ rSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY()))));
+
+ const basegfx::B2DVector aScale(aRange.getRange() / fUIScale);
+ rSet.Put(SvxSizeItem(SID_ATTR_SIZE, Size(basegfx::fround(aScale.getX()), basegfx::fround(aScale.getY()))));
}
}
else
{
- if ( mpDrawView->AreObjectsMarked() )
+ if ( mpDrawView->areSdrObjectsSelected() )
{
- Rectangle aRect = mpDrawView->GetAllMarkedRect();
- mpDrawView->GetSdrPageView()->LogicToPagePos(aRect);
+ basegfx::B2DRange aRange(mpDrawView->getMarkedObjectSnapRange());
+
+ if(mpDrawView->GetSdrPageView())
+ {
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpDrawView->GetSdrPageView()->GetPageOrigin()));
+ }
// Show the position of the selected shape(s)
- Point aShapePosition (aRect.TopLeft());
- aShapePosition.X() = Fraction(aShapePosition.X()) / aUIScale;
- aShapePosition.Y() = Fraction(aShapePosition.Y()) / aUIScale;
- rSet.Put (SfxPointItem(SID_ATTR_POSITION, aShapePosition));
-
- Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() );
- aSize.Height() = Fraction(aSize.Height()) / aUIScale;
- aSize.Width() = Fraction(aSize.Width()) / aUIScale;
- rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) );
+ const basegfx::B2DPoint aShapePosition(aRange.getMinimum() / fUIScale);
+ rSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aShapePosition.getX()), basegfx::fround(aShapePosition.getY()))));
+
+ const basegfx::B2DVector aScale(aRange.getRange() / fUIScale);
+ rSet.Put(SvxSizeItem(SID_ATTR_SIZE, Size(basegfx::fround(aScale.getX()), basegfx::fround(aScale.getY()))));
}
else
{
- rSet.Put( SfxPointItem(SID_ATTR_POSITION, aPos) );
+ rSet.Put(SfxPointItem(SID_ATTR_POSITION, Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY()))));
rSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
}
}
@@ -762,33 +770,28 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
// more than one layer, no layer name is shown.
if (IsLayerModeActive())
{
- SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = GetDoc()->GetModelLayerAdmin();
SdrLayerID nLayer = 0, nOldLayer = 0;
SdrLayer* pLayer = NULL;
- SdrObject* pObj = NULL;
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
- FASTBOOL bOneLayer = sal_True;
+ bool bOneLayer = true;
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
// Use the first ten selected shapes as a (hopefully
// representative) sample of all shapes of the current page.
// Detect whether they belong to the same layer.
- for( sal_uLong j = 0; j < nMarkCount && bOneLayer && j < 10; j++ )
+ for( sal_uInt32 j = 0; j < aSelection.size() && bOneLayer && j < 10; j++ )
{
- pObj = rMarkList.GetMark( j )->GetMarkedSdrObj();
- if( pObj )
- {
- nLayer = pObj->GetLayer();
+ SdrObject* pObj = aSelection[j];
+ nLayer = pObj->GetLayer();
- if( j != 0 && nLayer != nOldLayer )
- bOneLayer = sal_False;
+ if( j != 0 && nLayer != nOldLayer )
+ bOneLayer = false;
- nOldLayer = nLayer;
- }
+ nOldLayer = nLayer;
}
// Append the layer name to the current page number.
- if( bOneLayer && nMarkCount )
+ if( bOneLayer && mpDrawView->areSdrObjectsSelected() )
{
pLayer = rLayerAdmin.GetLayerPerID( nLayer );
if( pLayer )
@@ -826,7 +829,7 @@ void DrawViewShell::Notify (SfxBroadcaster&, const SfxHint& rHint)
}
// Turn on design mode when document is not read-only.
- if (GetDocSh()->IsReadOnly() != mbReadOnly )
+ if ((bool)GetDocSh()->IsReadOnly() != mbReadOnly )
{
mbReadOnly = GetDocSh()->IsReadOnly();
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index b72e5c1ed4c2..22672e20b516 100644
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -73,6 +73,7 @@
#include "SlideSorterViewShell.hxx"
#include "SlideSorter.hxx"
#include "controller/SlideSorterController.hxx"
+#include <svx/svdlegacy.hxx>
#define RET_DELETE 100
@@ -96,28 +97,27 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
mpDrawView->SdrEndTextEdit();
}
- SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = GetDoc()->GetModelLayerAdmin();
sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount();
sal_uInt16 nLayer = nLayerCnt - 2 + 1;
String aLayerName ( SdResId(STR_LAYER) ), aLayerTitle, aLayerDesc;
aLayerName += String::CreateFromInt32( (sal_Int32)nLayer );
- sal_Bool bIsVisible = sal_False;
- sal_Bool bIsLocked = sal_False;
- sal_Bool bIsPrintable = sal_False;
-
+ bool bIsVisible = false;
+ bool bIsLocked = false;
+ bool bIsPrintable = false;
const SfxItemSet* pArgs = rReq.GetArgs();
if (! pArgs)
{
- SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
+ SfxItemSet aNewAttr( GetDoc()->GetItemPool(), ATTR_LAYER_START, ATTR_LAYER_END );
- aNewAttr.Put( SdAttrLayerName( aLayerName ) );
- aNewAttr.Put( SdAttrLayerTitle() );
- aNewAttr.Put( SdAttrLayerDesc() );
- aNewAttr.Put( SdAttrLayerVisible() );
- aNewAttr.Put( SdAttrLayerPrintable() );
- aNewAttr.Put( SdAttrLayerLocked() );
- aNewAttr.Put( SdAttrLayerThisPage() );
+ aNewAttr.Put( SfxStringItem( ATTR_LAYER_NAME, aLayerName ) );
+ aNewAttr.Put( SfxStringItem( ATTR_LAYER_TITLE, XubString()) );
+ aNewAttr.Put( SfxStringItem( ATTR_LAYER_DESC, XubString()) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_VISIBLE, true) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_PRINTABLE, true) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_LOCKED, false) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_THISPAGE, false) );
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
AbstractSdInsertLayerDlg* pDlg = pFact ? pFact->CreateSdInsertLayerDlg(NULL, aNewAttr, true, String( SdResId( STR_INSERTLAYER ) ) ) : 0;
@@ -126,13 +126,13 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_INSERTLAYER )->GetCommand() );
// Ueberpruefung auf schon vorhandene Namen
- sal_Bool bLoop = sal_True;
+ bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
{
pDlg->GetAttr( aNewAttr );
- aLayerName = ((SdAttrLayerName &) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
+ aLayerName = ((SfxStringItem&) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
- if( rLayerAdmin.GetLayer( aLayerName, sal_False )
+ if( rLayerAdmin.GetLayer( aLayerName, false )
|| aLayerName.Len()==0 )
{
// Name ist schon vorhanden
@@ -143,7 +143,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
aWarningBox.Execute();
}
else
- bLoop = sal_False;
+ bLoop = false;
}
if( bLoop ) // wurde abgebrochen
{
@@ -156,36 +156,36 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
else
{
//pDlg->GetAttr( aNewAttr );
- //aLayerName = ((SdAttrLayerName &) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
- aLayerTitle = ((SdAttrLayerTitle &) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue ();
- aLayerDesc = ((SdAttrLayerDesc &) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue ();
- bIsVisible = ((SdAttrLayerVisible &) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
- bIsLocked = ((SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue () ;
- bIsPrintable = ((SdAttrLayerPrintable &) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue () ;
+ //aLayerName = ((SfxStringItem&) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
+ aLayerTitle = ((SfxStringItem&) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue ();
+ aLayerDesc = ((SfxStringItem&) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue ();
+ bIsVisible = ((SfxBoolItem&) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
+ bIsLocked = ((SfxBoolItem&) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue () ;
+ bIsPrintable = ((SfxBoolItem&) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue () ;
delete pDlg;
}
}
}
else if (pArgs->Count () != 4)
- {
- StarBASIC::FatalError (SbERR_WRONG_ARGS);
- Cancel();
- rReq.Ignore ();
- break;
- }
- else
- {
- SFX_REQUEST_ARG (rReq, pLayerName, SfxStringItem, ID_VAL_LAYERNAME, sal_False);
- SFX_REQUEST_ARG (rReq, pIsVisible, SfxBoolItem, ID_VAL_ISVISIBLE, sal_False);
- SFX_REQUEST_ARG (rReq, pIsLocked, SfxBoolItem, ID_VAL_ISLOCKED, sal_False);
- SFX_REQUEST_ARG (rReq, pIsPrintable, SfxBoolItem, ID_VAL_ISPRINTABLE, sal_False);
-
- aLayerName = pLayerName->GetValue ();
- bIsVisible = pIsVisible->GetValue ();
- bIsLocked = pIsLocked->GetValue ();
- bIsPrintable = pIsPrintable->GetValue ();
- }
+ {
+ StarBASIC::FatalError (SbERR_WRONG_ARGS);
+ Cancel();
+ rReq.Ignore ();
+ break;
+ }
+ else
+ {
+ SFX_REQUEST_ARG (rReq, pLayerName, SfxStringItem, ID_VAL_LAYERNAME );
+ SFX_REQUEST_ARG (rReq, pIsVisible, SfxBoolItem, ID_VAL_ISVISIBLE );
+ SFX_REQUEST_ARG (rReq, pIsLocked, SfxBoolItem, ID_VAL_ISLOCKED );
+ SFX_REQUEST_ARG (rReq, pIsPrintable, SfxBoolItem, ID_VAL_ISPRINTABLE );
+
+ aLayerName = pLayerName->GetValue ();
+ bIsVisible = pIsVisible->GetValue ();
+ bIsLocked = pIsLocked->GetValue ();
+ bIsPrintable = pIsPrintable->GetValue ();
+ }
String aPrevLayer = mpDrawView->GetActiveLayer();
String aName;
@@ -206,7 +206,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
}
mpDrawView->InsertNewLayer(aLayerName, nPrevLayer + 1);
- pLayer = rLayerAdmin.GetLayer(aLayerName, sal_False);
+ pLayer = rLayerAdmin.GetLayer(aLayerName, false);
if( pLayer )
{
pLayer->SetTitle( aLayerTitle );
@@ -221,7 +221,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
ResetActualLayer();
- GetDoc()->SetChanged(sal_True);
+ GetDoc()->SetChanged(true);
GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHLAYER,
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
@@ -238,10 +238,10 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
mpDrawView->SdrEndTextEdit();
}
- SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = GetDoc()->GetModelLayerAdmin();
sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId();
String aLayerName( GetLayerTabControl()->GetPageText(nCurPage) );
- SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, sal_False);
+ SdrLayer* pLayer = rLayerAdmin.GetLayer(aLayerName, false);
String aLayerTitle( pLayer->GetTitle() );
String aLayerDesc( pLayer->GetDescription() );
@@ -250,12 +250,10 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
String aOldLayerTitle( aLayerTitle );
String aOldLayerDesc( aLayerDesc );
- sal_Bool bIsVisible, bIsLocked, bIsPrintable;
- sal_Bool bOldIsVisible = bIsVisible = mpDrawView->IsLayerVisible(aLayerName);
- sal_Bool bOldIsLocked = bIsLocked = mpDrawView->IsLayerLocked(aLayerName);
- sal_Bool bOldIsPrintable = bIsPrintable = mpDrawView->IsLayerPrintable(aLayerName);
-
-
+ bool bIsVisible, bIsLocked, bIsPrintable;
+ bool bOldIsVisible = bIsVisible = mpDrawView->IsLayerVisible(aLayerName);
+ bool bOldIsLocked = bIsLocked = mpDrawView->IsLayerLocked(aLayerName);
+ bool bOldIsPrintable = bIsPrintable = mpDrawView->IsLayerPrintable(aLayerName);
const SfxItemSet* pArgs = rReq.GetArgs();
// darf der Layer geloescht werden ?
bool bDelete = true;
@@ -275,15 +273,15 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
if (! pArgs)
{
- SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
+ SfxItemSet aNewAttr( GetDoc()->GetItemPool(), ATTR_LAYER_START, ATTR_LAYER_END );
- aNewAttr.Put( SdAttrLayerName( aLayerName ) );
- aNewAttr.Put( SdAttrLayerTitle( aLayerTitle ) );
- aNewAttr.Put( SdAttrLayerDesc( aLayerDesc ) );
- aNewAttr.Put( SdAttrLayerVisible( bIsVisible ) );
- aNewAttr.Put( SdAttrLayerLocked( bIsLocked ) );
- aNewAttr.Put( SdAttrLayerPrintable( bIsPrintable ) );
- aNewAttr.Put( SdAttrLayerThisPage() );
+ aNewAttr.Put( SfxStringItem( ATTR_LAYER_NAME, aLayerName ) );
+ aNewAttr.Put( SfxStringItem( ATTR_LAYER_TITLE, aLayerTitle ) );
+ aNewAttr.Put( SfxStringItem( ATTR_LAYER_DESC, aLayerDesc ) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_VISIBLE, bIsVisible ) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_LOCKED, bIsLocked ) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_PRINTABLE, bIsPrintable ) );
+ aNewAttr.Put( SfxBoolItem( ATTR_LAYER_THISPAGE, false) );
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
AbstractSdInsertLayerDlg* pDlg = pFact ? pFact->CreateSdInsertLayerDlg(NULL, aNewAttr, bDelete, String( SdResId( STR_MODIFYLAYER ) ) ) : 0;
@@ -292,14 +290,14 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_MODIFYLAYER )->GetCommand() );
// Ueberpruefung auf schon vorhandene Namen
- sal_Bool bLoop = sal_True;
+ bool bLoop = true;
sal_uInt16 nRet = 0;
while( bLoop && ( (nRet = pDlg->Execute()) == RET_OK ) )
{
pDlg->GetAttr( aNewAttr );
- aLayerName = ((SdAttrLayerName &) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
+ aLayerName = ((SfxStringItem&) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue ();
- if( (rLayerAdmin.GetLayer( aLayerName, sal_False ) &&
+ if( (rLayerAdmin.GetLayer( aLayerName, false ) &&
aLayerName != aOldLayerName) || aLayerName.Len()==0 )
{
// Name ist schon vorhanden
@@ -310,16 +308,16 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
aWarningBox.Execute();
}
else
- bLoop = sal_False;
+ bLoop = false;
}
switch (nRet)
{
case RET_OK :
- aLayerTitle = ((SdAttrLayerTitle &) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue ();
- aLayerDesc = ((SdAttrLayerDesc &) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue ();
- bIsVisible = ((const SdAttrLayerVisible &) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
- bIsLocked = ((const SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue ();
- bIsPrintable = ((const SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue ();
+ aLayerTitle = ((SfxStringItem&) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue ();
+ aLayerDesc = ((SfxStringItem&) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue ();
+ bIsVisible = ((const SfxBoolItem&) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue ();
+ bIsLocked = ((const SfxBoolItem&) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue ();
+ bIsPrintable = ((const SfxBoolItem&) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue ();
delete pDlg;
break;
@@ -334,10 +332,10 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
}
else if (pArgs->Count () == 4)
{
- SFX_REQUEST_ARG (rReq, pLayerName, SfxStringItem, ID_VAL_LAYERNAME, sal_False);
- SFX_REQUEST_ARG (rReq, pIsVisible, SfxBoolItem, ID_VAL_ISVISIBLE, sal_False);
- SFX_REQUEST_ARG (rReq, pIsLocked, SfxBoolItem, ID_VAL_ISLOCKED, sal_False);
- SFX_REQUEST_ARG (rReq, pIsPrintable, SfxBoolItem, ID_VAL_ISPRINTABLE, sal_False);
+ SFX_REQUEST_ARG (rReq, pLayerName, SfxStringItem, ID_VAL_LAYERNAME );
+ SFX_REQUEST_ARG (rReq, pIsVisible, SfxBoolItem, ID_VAL_ISVISIBLE );
+ SFX_REQUEST_ARG (rReq, pIsLocked, SfxBoolItem, ID_VAL_ISLOCKED );
+ SFX_REQUEST_ARG (rReq, pIsPrintable, SfxBoolItem, ID_VAL_ISPRINTABLE );
aLayerName = pLayerName->GetValue ();
bIsVisible = pIsVisible->GetValue ();
@@ -413,10 +411,10 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
if ( pFieldItem )
{
const SvxFieldData* pField = pFieldItem->GetField();
- if( pField && pField->ISA( SvxURLField ) )
- {
- const SvxURLField* pURLField = static_cast< const SvxURLField* >( pField );
+ const SvxURLField* pURLField = dynamic_cast< const SvxURLField* >( pField );
+ if( pURLField )
+ {
SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() );
SfxStringItem aTarget( SID_TARGETNAME, pURLField->GetTargetFrame() );
@@ -429,8 +427,8 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
SfxFrameItem aFrm( SID_DOCFRAME, pFrame );
SfxStringItem aReferer( SID_REFERER, aReferName );
- SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, sal_False );
- SfxBoolItem aBrowsing( SID_BROWSE, sal_True );
+ SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
+ SfxBoolItem aBrowsing( SID_BROWSE, true );
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
@@ -459,13 +457,11 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
if (pHLItem->GetInsertMode() == HLINK_FIELD)
{
- InsertURLField(pHLItem->GetURL(), pHLItem->GetName(),
- pHLItem->GetTargetFrame(), NULL);
+ InsertURLField(pHLItem->GetURL(), pHLItem->GetName(), pHLItem->GetTargetFrame(), 0);
}
else if (pHLItem->GetInsertMode() == HLINK_BUTTON)
{
- InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(),
- pHLItem->GetTargetFrame(), NULL);
+ InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(), pHLItem->GetTargetFrame(), 0);
}
else if (pHLItem->GetInsertMode() == HLINK_DEFAULT)
{
@@ -473,13 +469,11 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
if (pOlView)
{
- InsertURLField(pHLItem->GetURL(), pHLItem->GetName(),
- pHLItem->GetTargetFrame(), NULL);
+ InsertURLField(pHLItem->GetURL(), pHLItem->GetName(), pHLItem->GetTargetFrame(), 0);
}
else
{
- InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(),
- pHLItem->GetTargetFrame(), NULL);
+ InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(), pHLItem->GetTargetFrame(), 0);
}
}
}
@@ -498,7 +492,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
case SID_INSERT_FLD_PAGES:
case SID_INSERT_FLD_FILE:
{
- sal_uInt16 nMul = 1;
+ double fMul(1.0);
SvxFieldItem* pFieldItem = 0;
switch( nSId )
@@ -533,14 +527,14 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
case SID_INSERT_FLD_PAGE:
{
pFieldItem = new SvxFieldItem( SvxPageField(), EE_FEATURE_FIELD );
- nMul = 3;
+ fMul = 3.0;
}
break;
case SID_INSERT_FLD_PAGES:
{
pFieldItem = new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD );
- nMul = 3;
+ fMul = 3.0;
}
break;
@@ -562,13 +556,14 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
{
const SvxFieldItem* pOldFldItem = pOLV->GetFieldAtSelection();
- if( pOldFldItem && ( pOldFldItem->GetField()->ISA( SvxURLField ) ||
- pOldFldItem->GetField()->ISA( SvxDateField ) ||
- pOldFldItem->GetField()->ISA( SvxTimeField ) ||
- pOldFldItem->GetField()->ISA( SvxExtTimeField ) ||
- pOldFldItem->GetField()->ISA( SvxExtFileField ) ||
- pOldFldItem->GetField()->ISA( SvxAuthorField ) ||
- pOldFldItem->GetField()->ISA( SvxPageField ) ) )
+ if( pOldFldItem && (
+ dynamic_cast< const SvxURLField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxDateField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxTimeField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxExtTimeField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxExtFileField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxAuthorField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxPageField* >(pOldFldItem->GetField()) ) )
{
// Feld selektieren, so dass es beim Insert geloescht wird
ESelection aSel = pOLV->GetSelection();
@@ -589,27 +584,28 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
pOutl->QuickInsertField( *pFieldItem, ESelection() );
OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
- SdrRectObj* pRectObj = new SdrRectObj( OBJ_TEXT );
- pRectObj->SetMergedItem(SdrTextAutoGrowWidthItem(sal_True));
pOutl->UpdateFields();
- pOutl->SetUpdateMode( sal_True );
- Size aSize( pOutl->CalcTextSize() );
- aSize.Width() *= nMul;
- pOutl->SetUpdateMode( sal_False );
-
- Point aPos;
- Rectangle aRect( aPos, GetActiveWindow()->GetOutputSizePixel() );
- aPos = aRect.Center();
- aPos = GetActiveWindow()->PixelToLogic(aPos);
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
-
- Rectangle aLogicRect(aPos, aSize);
- pRectObj->SetLogicRect(aLogicRect);
- pRectObj->SetOutlinerParaObject( pOutlParaObject );
- mpDrawView->InsertObjectAtView(pRectObj, *mpDrawView->GetSdrPageView());
- pOutl->Init( nOutlMode );
+ pOutl->SetUpdateMode( true );
+ const Size aSize(pOutl->CalcTextSize());
+ pOutl->SetUpdateMode( false );
+
+ const basegfx::B2DVector aScale(aSize.Width() * fMul, aSize.Height() * fMul);
+ const basegfx::B2DPoint aPos(GetActiveWindow()->GetLogicRange().getCenter());
+ const basegfx::B2DHomMatrix aObjTrans(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aPos - (aScale * 0.5)));
+ SdrRectObj* pRectObj = new SdrRectObj(
+ *GetDoc(),
+ aObjTrans,
+ OBJ_TEXT,
+ true);
+
+ pRectObj->SetMergedItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
+ pRectObj->SetOutlinerParaObject(pOutlParaObject);
+ mpDrawView->InsertObjectAtView(*pRectObj);
+ pOutl->Init(nOutlMode);
}
delete pFieldItem;
@@ -627,10 +623,11 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
{
const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection();
- if( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) ||
- pFldItem->GetField()->ISA( SvxAuthorField ) ||
- pFldItem->GetField()->ISA( SvxExtFileField ) ||
- pFldItem->GetField()->ISA( SvxExtTimeField ) ) )
+ if( pFldItem && (
+ dynamic_cast< const SvxDateField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxAuthorField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtFileField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtTimeField* >(pFldItem->GetField()) ) )
{
// Dialog...
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
@@ -723,9 +720,9 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq)
};
};
-bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const String & rName )
+bool DrawViewShell::RenameSlide( sal_uInt32 nPageId, const String & rName )
{
- sal_Bool bOutDummy;
+ bool bOutDummy;
if( GetDoc()->GetPageByName( rName, bOutDummy ) != SDRPAGE_NOTFOUND )
return false;
@@ -738,9 +735,9 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const String & rName )
// Undo
SdPage* pUndoPage = pPageToRename;
- SdrLayerAdmin & rLayerAdmin = GetDoc()->GetLayerAdmin();
- sal_uInt8 nBackground = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), sal_False );
- sal_uInt8 nBgObj = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), sal_False );
+ SdrLayerAdmin & rLayerAdmin = GetDoc()->GetModelLayerAdmin();
+ sal_uInt8 nBackground = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), false );
+ sal_uInt8 nBgObj = rLayerAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), false );
SetOfByte aVisibleLayers = mpActualPage->TRG_GetMasterPageVisibleLayers();
// (#67720#)
@@ -768,7 +765,7 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const String & rName )
GetDoc()->RenameLayoutTemplate( pPageToRename->GetLayoutName(), rName );
}
- bool bSuccess = ( sal_False != rName.Equals( pPageToRename->GetName()));
+ bool bSuccess = ( false != rName.Equals( pPageToRename->GetName()));
if( bSuccess )
{
@@ -776,10 +773,10 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const String & rName )
maTabControl.SetPageText( nPageId, rName );
// set document to modified state
- GetDoc()->SetChanged( sal_True );
+ GetDoc()->SetChanged( true );
// inform navigator about change
- SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True );
+ SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
GetViewFrame()->GetDispatcher()->Execute(
SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
@@ -847,7 +844,7 @@ void DrawViewShell::ModifyLayer (
mpDrawView->SetLayerLocked( rLayerName, bIsLocked);
mpDrawView->SetLayerPrintable(rLayerName, bIsPrintable);
- GetDoc()->SetChanged(sal_True);
+ GetDoc()->SetChanged(true);
GetLayerTabControl()->SetPageText(nCurPage, rLayerName);
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index e325dc721991..b250b03d526f 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -85,7 +85,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
{
case SID_GROUP: // BASIC
{
- if ( mpDrawView->IsPresObjSelected( sal_True, sal_True, sal_True ) )
+ if ( mpDrawView->IsPresObjSelected( true, true, true ) )
{
::sd::Window* pWindow = GetActiveWindow();
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
@@ -111,11 +111,11 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
{
// only allow for single object selection since the name of an object needs
// to be unique
- if(1L == mpDrawView->GetMarkedObjectCount())
+ SdrObject* pSelected = mpDrawView->getSelectedIfSingle();
+
+ if(pSelected)
{
// #i68101#
- SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L);
- OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
String aName(pSelected->GetName());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -135,7 +135,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
}
SfxBindings& rBindings = GetViewFrame()->GetBindings();
- rBindings.Invalidate( SID_NAVIGATOR_STATE, sal_True, sal_False );
+ rBindings.Invalidate( SID_NAVIGATOR_STATE, true, false );
rBindings.Invalidate( SID_CONTEXT );
Cancel();
@@ -146,10 +146,10 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
// #i68101#
case SID_OBJECT_TITLE_DESCRIPTION:
{
- if(1L == mpDrawView->GetMarkedObjectCount())
+ SdrObject* pSelected = mpDrawView->getSelectedIfSingle();
+
+ if(pSelected)
{
- SdrObject* pSelected = mpDrawView->GetMarkedObjectByIndex(0L);
- OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
String aTitle(pSelected->GetTitle());
String aDescription(pSelected->GetDescription());
@@ -170,7 +170,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
}
SfxBindings& rBindings = GetViewFrame()->GetBindings();
- rBindings.Invalidate( SID_NAVIGATOR_STATE, sal_True, sal_False );
+ rBindings.Invalidate( SID_NAVIGATOR_STATE, true, false );
rBindings.Invalidate( SID_CONTEXT );
Cancel();
@@ -304,10 +304,10 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
case SID_DISMANTLE: // BASIC
{
- if ( mpDrawView->IsDismantlePossible(sal_False) )
+ if ( mpDrawView->IsDismantlePossible(false) )
{
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->DismantleMarkedObjects(sal_False);
+ mpDrawView->DismantleMarkedObjects(false);
}
Cancel();
rReq.Done ();
@@ -343,26 +343,23 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
WaitObject aWait( (Window*)GetActiveWindow() );
mpDrawView->Break3DObj();
}
- else if ( mpDrawView->IsDismantlePossible(sal_True) )
+ else if ( mpDrawView->IsDismantlePossible(true) )
{
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->DismantleMarkedObjects(sal_True);
+ mpDrawView->DismantleMarkedObjects(true);
}
else if ( mpDrawView->IsImportMtfPossible() )
{
-
- WaitObject aWait( (Window*)GetActiveWindow() );
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nAnz=rMarkList.GetMarkCount();
-
// Summe der Metaobjekte aller sel. Metafiles erm.
+ WaitObject aWait( (Window*)GetActiveWindow() );
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
sal_uLong nCount = 0;
- for(sal_uLong nm=0; nm<nAnz; nm++)
+
+ for(sal_uInt32 nm = 0; nm < aSelection.size(); nm++)
{
- SdrMark* pM=rMarkList.GetMark(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrGrafObj* pGraf=PTR_CAST(SdrGrafObj,pObj);
- SdrOle2Obj* pOle2=PTR_CAST(SdrOle2Obj,pObj);
+ SdrObject* pObj = aSelection[nm];
+ SdrGrafObj* pGraf = dynamic_cast< SdrGrafObj* >(pObj);
+ SdrOle2Obj* pOle2 = dynamic_cast< SdrOle2Obj* >(pObj);
if(pGraf)
{
@@ -394,7 +391,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
if( pFact )
{
- VclAbstractDialog* pDlg = pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, nAnz );
+ VclAbstractDialog* pDlg = pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, aSelection.size());
if( pDlg )
{
pDlg->Execute();
@@ -426,7 +423,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
}
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->ConvertMarkedObjTo3D(sal_True);
+ mpDrawView->ConvertMarkedObjTo3D(true);
}
}
@@ -473,7 +470,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
case SID_HORIZONTAL: // BASIC
{
- mpDrawView->MirrorAllMarkedHorizontal();
+ mpDrawView->MirrorMarkedObjHorizontal();
Cancel();
rReq.Done ();
}
@@ -481,7 +478,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
case SID_VERTICAL: // BASIC
{
- mpDrawView->MirrorAllMarkedVertical();
+ mpDrawView->MirrorMarkedObjVertical();
Cancel();
rReq.Done ();
}
@@ -538,10 +535,10 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
case SID_SELECTALL: // BASIC
{
if( (dynamic_cast<FuSelection*>( GetOldFunction().get() ) != 0) &&
- !GetView()->IsFrameDragSingles() && GetView()->HasMarkablePoints())
+ !GetView()->IsFrameHandles() && GetView()->HasMarkablePoints())
{
if ( !mpDrawView->IsAction() )
- mpDrawView->MarkAllPoints();
+ mpDrawView->MarkPoints(0, false); // markall
}
else
mpDrawView->SelectAll();
@@ -581,7 +578,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
break;
}
- SfxAllItemSet aSet(GetDoc()->GetPool());
+ SfxAllItemSet aSet(GetDoc()->GetItemPool());
SfxStringItem aStyleNameItem( SID_STYLE_EDIT, pStyleSheet->GetName() );
aSet.Put(aStyleNameItem);
@@ -616,10 +613,12 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq)
if ( GetViewFrame()->HasChildWindow( nId )
&& ( ( pDlg = ViewShell::Implementation::GetImageMapDialog() ) != NULL ) )
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ SdrObject* pSelected = mpDrawView->getSelectedIfSingle();
- if ( rMarkList.GetMarkCount() == 1 )
- UpdateIMapDlg( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
+ if(pSelected)
+ {
+ UpdateIMapDlg( pSelected );
+ }
}
Cancel();
@@ -873,7 +872,7 @@ void DrawViewShell::MapSlot( sal_uInt16 nSId )
|*
\************************************************************************/
-void DrawViewShell::UpdateToolboxImages( SfxItemSet &rSet, sal_Bool bPermanent )
+void DrawViewShell::UpdateToolboxImages( SfxItemSet &rSet, bool bPermanent )
{
if( !bPermanent )
{
@@ -947,7 +946,10 @@ sal_uInt16 DrawViewShell::GetArrayId( sal_uInt16 nSId )
void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
{
- if( ( pObj->ISA( SdrGrafObj ) || pObj->ISA( SdrOle2Obj ) ) && !mpDrawView->IsTextEdit() &&
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( pObj );
+ SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( pObj );
+
+ if( ( pGrafObj || pOle2Obj ) && !mpDrawView->IsTextEdit() &&
GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
{
Graphic aGraphic;
@@ -956,7 +958,6 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
SdIMapInfo* pIMapInfo = GetDoc()->GetIMapInfo( pObj );
// get graphic from shape
- SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( pObj );
if( pGrafObj )
aGraphic = pGrafObj->GetGraphic();
diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx
index 3f629c6ba6f9..88f158dd654b 100644
--- a/sd/source/ui/view/drviewsd.cxx
+++ b/sd/source/ui/view/drviewsd.cxx
@@ -120,7 +120,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq )
case PAGE_NEXT:
{
// Sprung zu naechster Seite
- sal_uInt16 nSdPage = (mpActualPage->GetPageNum() - 1) / 2;
+ sal_uInt32 nSdPage = (mpActualPage->GetPageNumber() - 1) / 2;
if (nSdPage < GetDoc()->GetSdPageCount(mpActualPage->GetPageKind()) - 1)
{
@@ -132,7 +132,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq )
case PAGE_PREVIOUS:
{
// Sprung zu vorheriger Seite
- sal_uInt16 nSdPage = (mpActualPage->GetPageNum() - 1) / 2;
+ sal_uInt32 nSdPage = (mpActualPage->GetPageNumber() - 1) / 2;
if (nSdPage > 0)
{
@@ -157,7 +157,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq )
SfxStringItem aReferer(SID_REFERER, GetDocSh()->GetMedium()->GetName());
SfxViewFrame* pFrame = GetViewFrame();
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
- SfxBoolItem aBrowseItem(SID_BROWSE, sal_True);
+ SfxBoolItem aBrowseItem(SID_BROWSE, true);
pFrame->GetDispatcher()->
Execute(SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
&aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
@@ -183,10 +183,10 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq )
void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet )
{
sal_uInt32 nState = NAVSTATE_NONE;
- sal_uInt16 nCurrentPage = 0;
- sal_uInt16 nFirstPage = 0;
- sal_uInt16 nLastPage;
- sal_Bool bEndless = sal_False;
+ sal_uInt32 nCurrentPage = 0;
+ sal_uInt32 nFirstPage = 0;
+ sal_uInt32 nLastPage;
+ bool bEndless = false;
String aPageName;
rtl::Reference< SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
@@ -195,9 +195,9 @@ void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet )
// pen activated?
nState |= xSlideshow->isDrawingPossible() ? NAVBTN_PEN_CHECKED : NAVBTN_PEN_UNCHECKED;
- nCurrentPage = (sal_uInt16)xSlideshow->getCurrentPageNumber();
- nFirstPage = (sal_uInt16)xSlideshow->getFirstPageNumber();
- nLastPage = (sal_uInt16)xSlideshow->getLastPageNumber();
+ nCurrentPage = xSlideshow->getCurrentPageNumber();
+ nFirstPage = xSlideshow->getFirstPageNumber();
+ nLastPage = xSlideshow->getLastPageNumber();
bEndless = xSlideshow->isEndless();
// Get the page for the current page number.
@@ -214,7 +214,7 @@ void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet )
if (mpActualPage != NULL)
{
- nCurrentPage = ( mpActualPage->GetPageNum() - 1 ) / 2;
+ nCurrentPage = ( mpActualPage->GetPageNumber() - 1 ) / 2;
aPageName = mpActualPage->GetName();
}
nLastPage = GetDoc()->GetSdPageCount( mePageKind ) - 1;
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 075384674b57..fc0d6ce65add 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -100,6 +100,7 @@
#include "optsitem.hxx"
#include "Window.hxx"
#include "fuformatpaintbrush.hxx"
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -169,7 +170,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
if( pFuText )
{
- pFuText->SetPermanent(sal_True);
+ pFuText->SetPermanent(true);
xFunc->ReceiveRequest( rReq );
MapSlot( nSId );
@@ -189,7 +190,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
CheckLineTo (rReq);
sal_uInt16 nOldSId = 0;
- sal_Bool bPermanent = sal_False;
+ bool bPermanent = false;
if( !mpDrawView )
return;
@@ -227,7 +228,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
(nSId == SID_TEXTEDIT || nSId == SID_ATTR_CHAR || nSId == SID_TEXT_FITTOSIZE ||
nSId == SID_ATTR_CHAR_VERTICAL || nSId == SID_TEXT_FITTOSIZE_VERTICAL )))
{
- bPermanent = sal_True;
+ bPermanent = true;
}
GetCurrentFunction()->Deactivate();
@@ -278,33 +279,25 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
// #98721#
case SID_FM_CREATE_FIELDCONTROL:
{
- SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
+ SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR );
DBG_ASSERT( pDescriptorItem, "DrawViewShell::FuPermanent(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
if(pDescriptorItem)
{
// get the form view
- FmFormView* pFormView = PTR_CAST(FmFormView, mpDrawView);
- SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : NULL;
+ FmFormView* pFormView = dynamic_cast< FmFormView* >(mpDrawView);
+ ::svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue());
+ SdrObject* pNewDBField = pFormView->CreateFieldControl(aDescriptor);
- if(pPageView)
+ if(pNewDBField)
{
- ::svx::ODataAccessDescriptor aDescriptor(pDescriptorItem->GetValue());
- SdrObject* pNewDBField = pFormView->CreateFieldControl(aDescriptor);
+ const basegfx::B2DRange aVisArea(GetActiveWindow()->GetLogicRange());
+ const basegfx::B2DVector aObjSize(sdr::legacy::GetLogicRange(*pNewDBField).getRange());
+ const basegfx::B2DPoint aObjPos(aVisArea.getCenter() + (aObjSize * 0.5));
+ const basegfx::B2DRange aNewObjectRange(aObjPos, aObjPos + aObjSize);
- if(pNewDBField)
- {
- Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
- Point aObjPos(aVisArea.Center());
- Size aObjSize(pNewDBField->GetLogicRect().GetSize());
- aObjPos.X() -= aObjSize.Width() / 2;
- aObjPos.Y() -= aObjSize.Height() / 2;
- Rectangle aNewObjectRectangle(aObjPos, aObjSize);
-
- pNewDBField->SetLogicRect(aNewObjectRectangle);
-
- GetView()->InsertObjectAtView(pNewDBField, *pPageView);
- }
+ sdr::legacy::SetLogicRange(*pNewDBField, aNewObjectRange);
+ GetView()->InsertObjectAtView(*pNewDBField);
}
}
rReq.Done();
@@ -339,7 +332,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
nSlotId == SID_OBJECT_CROOK_SLANT ||
nSlotId == SID_OBJECT_CROOK_STRETCH)
{
- if ( mpDrawView->GetMarkedObjectList().GetMarkCount() > 0 &&
+ if ( mpDrawView->areSdrObjectsSelected() &&
!mpDrawView->IsCrookAllowed( mpDrawView->IsCrookNoContortion() ) )
{
if ( mpDrawView->IsPresObjSelected() )
@@ -353,31 +346,24 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
{
// Implizite Wandlung in Bezier
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->ConvertMarkedToPathObj(sal_False);
+ mpDrawView->ConvertMarkedToPathObj(false);
}
}
}
else if (nSlotId == SID_OBJECT_SHEAR)
{
- sal_uLong i = 0;
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nMarkCnt = rMarkList.GetMarkCount();
- sal_Bool b3DObjMarked = sal_False;
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+ bool b3DObjMarked = false;
- while (i < nMarkCnt && !b3DObjMarked)
+ for(sal_uInt32 a(0); !b3DObjMarked && a < aSelection.size(); a++)
{
- if (rMarkList.GetMark(i)->GetMarkedSdrObj()->ISA(E3dObject))
+ if (dynamic_cast< E3dObject* >(aSelection[a]))
{
- b3DObjMarked = sal_True;
- }
- else
- {
- i++;
+ b3DObjMarked = true;
}
}
- if ( nMarkCnt > 0 && !b3DObjMarked &&
- (!mpDrawView->IsShearAllowed() || !mpDrawView->IsDistortAllowed()) )
+ if( aSelection.size() && !b3DObjMarked && (!mpDrawView->IsShearAllowed() || !mpDrawView->IsDistortAllowed()) )
{
if ( mpDrawView->IsPresObjSelected() )
{
@@ -390,7 +376,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
{
// Implizite Wandlung in Bezier
WaitObject aWait( (Window*)GetActiveWindow() );
- mpDrawView->ConvertMarkedToPathObj(sal_False);
+ mpDrawView->ConvertMarkedToPathObj(false);
}
}
}
@@ -579,15 +565,17 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
// #97016# III CTRL-SID_OBJECT_SELECT -> select first draw object if none is selected yet
if(SID_OBJECT_SELECT == nSId && HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
{
- if(!GetView()->AreObjectsMarked())
+ if(!GetView()->areSdrObjectsSelected())
{
// select first object
GetView()->UnmarkAllObj();
- GetView()->MarkNextObj(sal_True);
+ GetView()->MarkNextObj(true);
// ...and make it visible
- if(GetView()->AreObjectsMarked())
- GetView()->MakeVisible(GetView()->GetAllMarkedRect(), *GetActiveWindow());
+ if(GetView()->areSdrObjectsSelected())
+ {
+ GetView()->MakeVisibleAtView(GetView()->getMarkedObjectSnapRange(), *GetActiveWindow());
+ }
}
}
@@ -596,43 +584,38 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
{
// get SdOptions
SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
- sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
- sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight());
+ const sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
+ const sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight());
// calc position and size
- Rectangle aVisArea = GetActiveWindow()->PixelToLogic(Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
- Point aPagePos = aVisArea.Center();
- aPagePos.X() -= nDefaultObjectSizeWidth / 2;
- aPagePos.Y() -= nDefaultObjectSizeHeight / 2;
- Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
- SdrPageView* pPageView = mpDrawView->GetSdrPageView();
-
- if(pPageView)
- {
+ const basegfx::B2DRange aVisArea(GetActiveWindow()->GetLogicRange());
+ const basegfx::B2DVector aObjSize(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight);
+ const basegfx::B2DPoint aObjPos(aVisArea.getCenter() - (aObjSize * 0.5));
+ const basegfx::B2DRange aNewObjectRange(aObjPos, aObjPos + aObjSize);
+
// create the default object
- SdrObject* pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRectangle);
+ SdrObject* pObj = GetCurrentFunction()->CreateDefaultObject(nSId, aNewObjectRange);
- if(pObj)
- {
- // insert into page
- GetView()->InsertObjectAtView(pObj, *pPageView);
+ if(pObj)
+ {
+ // insert into page
+ GetView()->InsertObjectAtView(*pObj);
- // Now that pFuActual has done what it was created for we
- // can switch on the edit mode for callout objects.
- switch (nSId)
+ // Now that pFuActual has done what it was created for we
+ // can switch on the edit mode for callout objects.
+ switch (nSId)
+ {
+ case SID_DRAW_CAPTION:
+ case SID_DRAW_CAPTION_VERTICAL:
{
- case SID_DRAW_CAPTION:
- case SID_DRAW_CAPTION_VERTICAL:
- {
- // Make FuText the current function.
- SfxUInt16Item aItem (SID_TEXTEDIT, 1);
- GetViewFrame()->GetDispatcher()->
- Execute(SID_TEXTEDIT, SFX_CALLMODE_SYNCHRON |
- SFX_CALLMODE_RECORD, &aItem, 0L);
- // Put text object into edit mode.
- GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObj), pPageView);
- break;
- }
+ // Make FuText the current function.
+ SfxUInt16Item aItem (SID_TEXTEDIT, 1);
+ GetViewFrame()->GetDispatcher()->
+ Execute(SID_TEXTEDIT, SFX_CALLMODE_SYNCHRON |
+ SFX_CALLMODE_RECORD, &aItem, 0L);
+ // Put text object into edit mode.
+ GetView()->SdrBeginTextEdit(static_cast<SdrTextObj*>(pObj));
+ break;
}
}
}
@@ -723,7 +706,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_BEZIER_EDIT:
{
- mpDrawView->SetFrameDragSingles(!mpDrawView->IsFrameDragSingles());
+ mpDrawView->SetFrameHandles(!mpDrawView->IsFrameHandles());
/******************************************************************
* ObjectBar einschalten
@@ -741,15 +724,15 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_OBJECT_CLOSE:
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- if ( rMarkList.GetMark(0) && !mpDrawView->IsAction() )
+ SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >(mpDrawView->getSelectedIfSingle());
+
+ if(pPathObj)
{
- SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj();
const bool bUndo = mpDrawView->IsUndoEnabled();
if( bUndo )
mpDrawView->BegUndo(String(SdResId(STR_UNDO_BEZCLOSE)));
- mpDrawView->UnmarkAllPoints();
+ mpDrawView->MarkPoints(0, true); // unmarkall
if( bUndo )
mpDrawView->AddUndo(new SdrUndoGeoObj(*pPathObj));
@@ -765,7 +748,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_CUT:
{
- if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
+ if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
@@ -787,7 +770,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_COPY:
{
- if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
+ if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
@@ -833,7 +816,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if( pReqArgs )
{
- SFX_REQUEST_ARG( rReq, pIsActive, SfxUInt32Item, SID_CLIPBOARD_FORMAT_ITEMS, sal_False );
+ SFX_REQUEST_ARG( rReq, pIsActive, SfxUInt32Item, SID_CLIPBOARD_FORMAT_ITEMS );
nFormat = pIsActive->GetValue();
}
@@ -841,10 +824,11 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if( nFormat && aDataHelper.GetTransferable().is() )
{
sal_Int8 nAction = DND_ACTION_COPY;
+ const basegfx::B2DPoint aPos(GetActiveWindow()->GetLogicRange().getCenter());
if( !mpDrawView->InsertData( aDataHelper,
- GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ),
- nAction, sal_False, nFormat ) )
+ aPos,
+ nAction, false, nFormat ) )
{
INetBookmark aINetBookmark( aEmptyStr, aEmptyStr );
@@ -855,7 +839,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
{
- InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
+ InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, 0);
}
}
}
@@ -875,7 +859,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
pOLV->PostKeyEvent(aKEvt);
}
}
- else if ( mpDrawView->IsPresObjSelected(sal_False, sal_True, sal_False, sal_True) )
+ else if ( mpDrawView->IsPresObjSelected(false, true, false, true) )
{
::sd::Window* pWindow = GetActiveWindow();
InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
@@ -926,7 +910,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if ( pReqArgs )
{
- SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_MASTERPAGE, sal_False);
+ SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_MASTERPAGE );
mbIsLayerModeActive = pIsActive->GetValue ();
}
@@ -943,9 +927,9 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
nSId == SID_SLIDE_MASTERPAGE)
{
// Gibt es eine Seite mit dem AutoLayout "Titel"?
- sal_Bool bFound = sal_False;
- sal_uInt16 i = 0;
- sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
+ bool bFound = false;
+ sal_uInt32 i = 0;
+ sal_uInt32 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
while (i < nCount && !bFound)
{
@@ -953,13 +937,13 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if (nSId == SID_TITLE_MASTERPAGE && pPage->GetAutoLayout() == AUTOLAYOUT_TITLE)
{
- bFound = sal_True;
- SwitchPage((pPage->GetPageNum() - 1) / 2);
+ bFound = true;
+ SwitchPage((pPage->GetPageNumber() - 1) / 2);
}
else if (nSId == SID_SLIDE_MASTERPAGE && pPage->GetAutoLayout() != AUTOLAYOUT_TITLE)
{
- bFound = sal_True;
- SwitchPage((pPage->GetPageNum() - 1) / 2);
+ bFound = true;
+ SwitchPage((pPage->GetPageNumber() - 1) / 2);
}
i++;
@@ -1047,17 +1031,17 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
const SfxItemSet* pReqArgs = rReq.GetArgs();
// #97516# Remember old ruler state
- sal_Bool bOldHasRuler(HasRuler());
+ bool bOldHasRuler(HasRuler());
if ( pReqArgs )
{
- SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_RULER, sal_False);
+ SFX_REQUEST_ARG (rReq, pIsActive, SfxBoolItem, SID_RULER );
SetRuler (pIsActive->GetValue ());
}
else SetRuler (!HasRuler());
// #97516# Did ruler state change? Tell that to SdOptions, too.
- sal_Bool bHasRuler(HasRuler());
+ bool bHasRuler(HasRuler());
if(bOldHasRuler != bHasRuler)
{
@@ -1084,32 +1068,33 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if ( pPageView )
{
- Point aPagePos(0, 0); // = pPageView->GetOffset();
- Size aPageSize = pPageView->GetPage()->GetSize();
+ basegfx::B2DPoint aPagePos(0.0, 0.0);
+ basegfx::B2DVector aPageSize(pPageView->getSdrPageFromSdrPageView().GetPageScale());
- aPagePos.X() += aPageSize.Width() / 2;
- aPageSize.Width() = (long) (aPageSize.Width() * 1.03);
+ aPagePos.setX(aPagePos.getX() + (aPageSize.getX() * 0.5));
+ aPageSize.setX(aPageSize.getX() * 1.03);
if( rReq.GetSlot() == SID_SIZE_PAGE )
{
- aPagePos.Y() += aPageSize.Height() / 2;
- aPageSize.Height() = (long) (aPageSize.Height() * 1.03);
- aPagePos.Y() -= aPageSize.Height() / 2;
+ aPagePos.setY(aPagePos.getY() + (aPageSize.getY() * 0.5));
+ aPageSize.setY(aPageSize.getY() * 1.03);
+ aPagePos.setY(aPagePos.getY() - (aPageSize.getY() * 0.5));
}
else
{
- Point aPt = GetActiveWindow()->PixelToLogic( Point( 0, GetActiveWindow()->GetSizePixel().Height() / 2 ) );
- aPagePos.Y() += aPt.Y();
- aPageSize.Height() = 2;
+ const basegfx::B2DPoint aPoint(GetActiveWindow()->GetInverseViewTransformation() *
+ basegfx::B2DPoint(0.0, GetActiveWindow()->GetSizePixel().Height() / 2));
+
+ aPagePos.setY(aPagePos.getY() + aPoint.getY());
+ aPageSize.setY(2.0);
}
- aPagePos.X() -= aPageSize.Width() / 2;
+ aPagePos.setX(aPagePos.getX() - (aPageSize.getX() * 0.5));
- SetZoomRect( Rectangle( aPagePos, aPageSize ) );
+ SetZoomRange( basegfx::B2DRange( aPagePos, aPagePos + aPageSize ) );
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
- GetActiveWindow()->GetOutputSizePixel()) );
- mpZoomList->InsertZoomRect(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(GetActiveWindow()->GetLogicRange());
+ mpZoomList->InsertZoomRange(aVisAreaWin);
}
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
@@ -1121,11 +1106,10 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_SIZE_REAL: // BASIC
{
- mbZoomOnPage = sal_False;
+ mbZoomOnPage = false;
SetZoom( 100 );
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
- GetActiveWindow()->GetOutputSizePixel()) );
- mpZoomList->InsertZoomRect(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(GetActiveWindow()->GetLogicRange());
+ mpZoomList->InsertZoomRange(aVisAreaWin);
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
@@ -1136,11 +1120,10 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_ZOOM_IN: // BASIC
{
- mbZoomOnPage = sal_False;
+ mbZoomOnPage = false;
SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) );
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
- GetActiveWindow()->GetOutputSizePixel()) );
- mpZoomList->InsertZoomRect(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(GetActiveWindow()->GetLogicRange());
+ mpZoomList->InsertZoomRange(aVisAreaWin);
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
@@ -1151,13 +1134,14 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_SIZE_VISAREA:
{
- Rectangle aVisArea = mpFrameView->GetVisArea();
- Size aVisAreaSize = aVisArea.GetSize();
+ const Rectangle aVisArea(mpFrameView->GetVisArea());
+ const Size aVisAreaSize(aVisArea.GetSize());
if (aVisAreaSize.Height()!=0 && aVisAreaSize.Width()!=0)
{
- mbZoomOnPage = sal_False;
- SetZoomRect(aVisArea);
+ mbZoomOnPage = false;
+ const basegfx::B2DRange aVisRange(aVisArea.Left(), aVisArea.Top(), aVisArea.Right(), aVisArea.Bottom());
+ SetZoomRange(aVisRange);
Invalidate( SID_ZOOM_IN );
Invalidate( SID_ZOOM_OUT );
Invalidate( SID_ZOOM_PANNING );
@@ -1171,22 +1155,21 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
// --> Wird als Objektzoom im Programm angeboten
case SID_SIZE_OPTIMAL: // BASIC
{
- mbZoomOnPage = sal_False;
- if ( mpDrawView->AreObjectsMarked() )
+ mbZoomOnPage = false;
+ if ( mpDrawView->areSdrObjectsSelected() )
{
- maMarkRect = mpDrawView->GetAllMarkedRect();
- long nW = (long) (maMarkRect.GetWidth() * 1.03);
- long nH = (long) (maMarkRect.GetHeight() * 1.03);
- Point aPos = maMarkRect.Center();
- aPos.X() -= nW / 2;
- aPos.Y() -= nH / 2;
- if ( nW && nH )
+ maMarkRange = mpDrawView->getMarkedObjectSnapRange();
+ const basegfx::B2DVector aNewScale(maMarkRange.getRange() * 1.03);
+ basegfx::B2DPoint aPos(maMarkRange.getCenter());
+
+ if(!aNewScale.equalZero())
{
- SetZoomRect(Rectangle(aPos, Size(nW, nH)));
+ aPos -= aNewScale * 0.5;
+
+ SetZoomRange(basegfx::B2DRange(aPos, aPos + aNewScale));
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
- GetActiveWindow()->GetOutputSizePixel()) );
- mpZoomList->InsertZoomRect(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(GetActiveWindow()->GetLogicRange());
+ mpZoomList->InsertZoomRange(aVisAreaWin);
}
}
Invalidate( SID_ZOOM_IN );
@@ -1201,25 +1184,22 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
// --> Wird als Optimal im Programm angeboten
case SID_SIZE_ALL: // BASIC
{
- mbZoomOnPage = sal_False;
+ mbZoomOnPage = false;
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
if( pPageView )
{
- Rectangle aBoundRect( pPageView->GetObjList()->GetAllObjBoundRect() );
-
- long nW = (long) (aBoundRect.GetWidth() * 1.03);
- long nH = (long) (aBoundRect.GetHeight() * 1.03);
- Point aPos = aBoundRect.Center();
- aPos.X() -= nW / 2;
- aPos.Y() -= nH / 2;
- if ( nW && nH )
+ const basegfx::B2DRange aBoundRange(sdr::legacy::GetAllObjBoundRange(pPageView->GetCurrentObjectList()->getSdrObjectVector()));
+ const basegfx::B2DVector aScale(aBoundRange.getRange() * 1.03);
+
+ if(!aScale.equalZero())
{
- SetZoomRect( Rectangle( aPos, Size( nW, nH ) ) );
+ const basegfx::B2DPoint aPos(aBoundRange.getCenter() - (aScale * 0.5));
+
+ SetZoomRange(basegfx::B2DRange(aPos, aPos + aScale));
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
- GetActiveWindow()->GetOutputSizePixel()) );
- mpZoomList->InsertZoomRect(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(GetActiveWindow()->GetLogicRange());
+ mpZoomList->InsertZoomRange(aVisAreaWin);
}
Invalidate( SID_ZOOM_IN );
@@ -1241,7 +1221,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if (mpZoomList->IsPreviousPossible())
{
// Vorheriges ZoomRect einstellen
- SetZoomRect(mpZoomList->GetPreviousZoomRect());
+ SetZoomRange(mpZoomList->GetPreviousZoomRange());
}
rReq.Done ();
Invalidate( SID_ZOOM_TOOLBOX );
@@ -1258,7 +1238,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if (mpZoomList->IsNextPossible())
{
// Naechstes ZoomRect einstellen
- SetZoomRect(mpZoomList->GetNextZoomRect());
+ SetZoomRange(mpZoomList->GetNextZoomRange());
}
rReq.Done ();
Invalidate( SID_ZOOM_TOOLBOX );
@@ -1300,7 +1280,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_AUTOSPELL_CHECK:
{
- sal_Bool bOnlineSpell = !GetDoc()->GetOnlineSpell();
+ bool bOnlineSpell = !GetDoc()->GetOnlineSpell();
GetDoc()->SetOnlineSpell(bOnlineSpell);
::Outliner* pOL = mpDrawView->GetTextEditOutliner();
@@ -1364,11 +1344,11 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
}
mpDrawView->BegUndo(String(SdResId(STR_UNDO_COLORRESOLUTION)));
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
- for (sal_uLong i=0; i<rMarkList.GetMarkCount(); i++)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[a];
if (pObj->GetObjInventor() == SdrInventor)
{
@@ -1378,7 +1358,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
if( rGraphic.GetType() == GRAPHIC_BITMAP )
{
- SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone();
+ SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->CloneSdrObject();
if( rGraphic.IsAnimated() )
{
@@ -1393,7 +1373,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
pNewObj->SetGraphic( aBmpEx );
}
- mpDrawView->ReplaceObjectAtView( pObj, *mpDrawView->GetSdrPageView(), pNewObj );
+ mpDrawView->ReplaceObjectAtView( *pObj, *pNewObj );
}
}
}
@@ -1462,13 +1442,13 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case SID_UNDO :
{
// #96090# moved implementation to BaseClass
- ImpSidUndo(sal_True, rReq);
+ ImpSidUndo(true, rReq);
}
break;
case SID_REDO :
{
// #96090# moved implementation to BaseClass
- ImpSidRedo(sal_True, rReq);
+ ImpSidRedo(true, rReq);
}
break;
@@ -1483,8 +1463,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
|*
\************************************************************************/
-void DrawViewShell::InsertURLField(const String& rURL, const String& rText,
- const String& rTarget, const Point* pPos)
+void DrawViewShell::InsertURLField(const String& rURL, const String& rText, const String& rTarget, const basegfx::B2DPoint* pPos)
{
OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
@@ -1511,32 +1490,27 @@ void DrawViewShell::InsertURLField(const String& rURL, const String& rText,
pOutl->QuickInsertField( aURLItem, ESelection() );
OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
- SdrRectObj* pRectObj = new SdrRectObj(OBJ_TEXT);
-
pOutl->UpdateFields();
- pOutl->SetUpdateMode( sal_True );
- Size aSize(pOutl->CalcTextSize());
- pOutl->SetUpdateMode( sal_False );
-
- Point aPos;
-
- if (pPos)
- {
- aPos = *pPos;
- }
- else
- {
- Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
- aPos = aRect.Center();
- aPos = GetActiveWindow()->PixelToLogic(aPos);
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- }
+ pOutl->SetUpdateMode( true );
+ const Size aOldSize(pOutl->CalcTextSize());
+ pOutl->SetUpdateMode( false );
+
+ // originally when pPos it was taken as TopLeft of new object, not
+ // as center; I guess this was an error, all other inserters use center
+ const basegfx::B2DPoint aPos(pPos ? *pPos : GetActiveWindow()->GetLogicRange().getCenter());
+ const basegfx::B2DVector aSize(aOldSize.Width(), aOldSize.Height());
+ const basegfx::B2DHomMatrix aObjTrans(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize,
+ aPos - (aSize * 0.5)));
+ SdrRectObj* pRectObj = new SdrRectObj(
+ *GetDoc(),
+ aObjTrans,
+ OBJ_TEXT,
+ true);
- Rectangle aLogicRect(aPos, aSize);
- pRectObj->SetLogicRect(aLogicRect);
pRectObj->SetOutlinerParaObject( pOutlParaObject );
- mpDrawView->InsertObjectAtView(pRectObj, *mpDrawView->GetSdrPageView());
+ mpDrawView->InsertObjectAtView(*pRectObj);
pOutl->Init( nOutlMode );
}
}
@@ -1547,61 +1521,58 @@ void DrawViewShell::InsertURLField(const String& rURL, const String& rText,
|*
\************************************************************************/
-void DrawViewShell::InsertURLButton(const String& rURL, const String& rText,
- const String& rTarget, const Point* pPos)
+void DrawViewShell::InsertURLButton(const String& rURL, const String& rText, const String& rTarget, const basegfx::B2DPoint* pPos)
{
- sal_Bool bNewObj = sal_True;
-
+ bool bNewObj = true;
const OUString sTargetURL( ::URIHelper::SmartRel2Abs( INetURLObject( GetDocSh()->GetMedium()->GetBaseURL() ), rURL, URIHelper::GetMaybeFileHdl(), true, false,
INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_UNAMBIGUOUS ) );
- if (mpDrawView->GetMarkedObjectList().GetMarkCount() > 0)
+
+ SdrObject* pMarkedObj = mpDrawView->getSelectedIfSingle();
+
+ if( pMarkedObj ) try
{
- SdrObject* pMarkedObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- if( pMarkedObj ) try
+ // change first marked object
+ if( (FmFormInventor == pMarkedObj->GetObjInventor() && pMarkedObj->GetObjIdentifier() == OBJ_FM_BUTTON) )
{
- // change first marked object
- if( (FmFormInventor == pMarkedObj->GetObjInventor() && pMarkedObj->GetObjIdentifier() == OBJ_FM_BUTTON) )
- {
- bNewObj = sal_False;
+ bNewObj = false;
+ SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pMarkedObj );
- SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pMarkedObj );
+ Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY_THROW );
- Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), UNO_QUERY_THROW );
- Reference< beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY_THROW );
+ xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), Any( OUString( rText ) ) );
+ xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), Any( sTargetURL ) );
- xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), Any( OUString( rText ) ) );
- xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" )), Any( sTargetURL ) );
+ if( rTarget.Len() )
+ xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), Any( OUString( rTarget ) ) );
- if( rTarget.Len() )
- xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" )), Any( OUString( rTarget ) ) );
-
- xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), Any( form::FormButtonType_URL ) );
- if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
- {
- // #105638# OJ
- xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) );
- }
- }
- else
+ xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" )), Any( form::FormButtonType_URL ) );
+ if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
{
- // add url as interaction for first selected shape
- bNewObj = sal_False;
-
- SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pMarkedObj, true);
- pInfo->meClickAction = presentation::ClickAction_DOCUMENT;
- pInfo->SetBookmark( sTargetURL );
+ // #105638# OJ
+ xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) );
}
}
- catch( uno::Exception& )
+ else
{
+ // add url as interaction for first selected shape
+ bNewObj = false;
+
+ SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pMarkedObj, true);
+ pInfo->meClickAction = presentation::ClickAction_DOCUMENT;
+ pInfo->SetBookmark( sTargetURL );
}
}
+ catch( uno::Exception& )
+ {
+ }
if (bNewObj) try
{
- SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( SdrObjFactory::MakeNewObject(FmFormInventor, OBJ_FM_BUTTON,
- mpDrawView->GetSdrPageView()->GetPage(), GetDoc()) );
+ SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >(SdrObjFactory::MakeNewObject(
+ *GetDoc(),
+ SdrObjectCreationInfo(OBJ_FM_BUTTON, FmFormInventor)));
Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_QUERY_THROW );
Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW );
@@ -1617,33 +1588,31 @@ void DrawViewShell::InsertURLButton(const String& rURL, const String& rText,
if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) );
- Point aPos;
+ const basegfx::B2DPoint aPos(pPos ? *pPos : GetActiveWindow()->GetLogicRange().getCenter());
+ const basegfx::B2DVector aSize(4000.0, 1000.0);
+ const basegfx::B2DHomMatrix aObjTrans(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize,
+ aPos - (aSize * 0.5)));
+ sal_uLong nOptions(SDRINSERT_SETDEFLAYER);
+
+ pUnoCtrl->setSdrObjectTransformation(aObjTrans);
- if (pPos)
+ if(GetViewShell())
{
- aPos = *pPos;
+ SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient();
+
+ if(pIpClient && pIpClient->IsObjectInPlaceActive())
+ {
+ nOptions |= SDRINSERT_DONTMARK;
+ }
}
else
{
- aPos = Rectangle(aPos, GetActiveWindow()->GetOutputSizePixel()).Center();
- aPos = GetActiveWindow()->PixelToLogic(aPos);
- }
-
- Size aSize(4000, 1000);
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- pUnoCtrl->SetLogicRect(Rectangle(aPos, aSize));
-
- sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
-
- OSL_ASSERT (GetViewShell()!=NULL);
- SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient();
- if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())
- {
- nOptions |= SDRINSERT_DONTMARK;
+ OSL_ENSURE(false, "No ViewShell ?");
}
- mpDrawView->InsertObjectAtView(pUnoCtrl, *mpDrawView->GetSdrPageView(), nOptions);
+ mpDrawView->InsertObjectAtView(*pUnoCtrl, nOptions);
}
catch( Exception& )
{
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 91909d60dc64..2e1cae51e994 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -108,11 +108,13 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet)
if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 )
{
const SvxFieldData* pField = pFieldItem->GetField();
- if (pField->ISA(SvxURLField))
+ const SvxURLField* pSvxURLField = dynamic_cast< const SvxURLField* >(pField);
+
+ if (pSvxURLField)
{
- aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
- aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
- aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
+ aHLinkItem.SetName(pSvxURLField->GetRepresentation());
+ aHLinkItem.SetURL(pSvxURLField->GetURL());
+ aHLinkItem.SetTargetFrame(pSvxURLField->GetTargetFrame());
bField = true;
}
}
@@ -128,11 +130,9 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet)
}
else
{
- if (mpDrawView->GetMarkedObjectList().GetMarkCount() > 0)
- {
+ SdrObject* pMarkedObj = mpDrawView->getSelectedIfSingle();
bool bFound = false;
- SdrObject* pMarkedObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
if( pMarkedObj && (FmFormInventor == pMarkedObj->GetObjInventor()) )
{
SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pMarkedObj );
@@ -191,7 +191,6 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet)
aHLinkItem.SetInsertMode(HLINK_BUTTON);
}
}
- }
rSet.Put(aHLinkItem);
}
@@ -203,16 +202,16 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet)
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_BLACKWHITE ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_CONTRAST ) )
{
- const sal_uLong nMode = (sal_Int32)GetActiveWindow()->GetDrawMode();
- rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_COLOR, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_COLOR == nMode) ) );
- rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_GRAYSCALE, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_GRAYSCALE == nMode) ) );
- rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_BLACKWHITE, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_BLACKWHITE == nMode) ) );
- rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_CONTRAST, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_CONTRAST == nMode) ) );
+ const sal_uLong nMode = GetActiveWindow()->GetDrawMode();
+ rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_COLOR, SD_OUTPUT_DRAWMODE_COLOR == nMode) );
+ rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_GRAYSCALE, SD_OUTPUT_DRAWMODE_GRAYSCALE == nMode) );
+ rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_BLACKWHITE, SD_OUTPUT_DRAWMODE_BLACKWHITE == nMode) );
+ rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_CONTRAST, SD_OUTPUT_DRAWMODE_CONTRAST == nMode) );
}
if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) )
{
- rSet.Put( SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, true ) );
}
if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_ATTR_YEAR2000) )
@@ -292,7 +291,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
- sal_Bool bAttr = sal_False;
+ bool bAttr = false;
SfxAllItemSet aAllSet( *rSet.GetPool() );
while ( nWhich )
@@ -314,17 +313,17 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
case SID_ATTR_LINE_COLOR:
case SID_ATTR_TEXT_FITTOSIZE:
{
- bAttr = sal_True;
+ bAttr = true;
}
break;
case SID_HYPHENATION:
{
- SfxItemSet aAttrs( GetDoc()->GetPool() );
+ SfxItemSet aAttrs( GetDoc()->GetItemPool() );
mpDrawView->GetAttributes( aAttrs );
if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SFX_ITEM_AVAILABLE )
{
- sal_Bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
+ bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
rSet.Put( SfxBoolItem( SID_HYPHENATION, bValue ) );
}
}
@@ -338,7 +337,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet();
if( pStyleSheet )
{
- if( nSlotId != SID_STYLE_APPLY && !mpDrawView->AreObjectsMarked() )
+ if( nSlotId != SID_STYLE_APPLY && !mpDrawView->areSdrObjectsSelected() )
{
SfxTemplateItem aTmpItem( nWhich, String() );
aAllSet.Put( aTmpItem, aTmpItem.Which() );
@@ -377,7 +376,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
case SID_SET_DEFAULT:
{
- if( !mpDrawView->GetMarkedObjectList().GetMarkCount() ||
+ if( !mpDrawView->areSdrObjectsSelected() ||
( !mpDrawView->IsTextEdit() && !mpDrawView->GetStyleSheet() )
)
rSet.DisableItem( nWhich );
@@ -388,7 +387,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
{
ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
- rSet.Put(SfxBoolItem(nWhich,sal_False));
+ rSet.Put(SfxBoolItem(nWhich,false));
else
{
SfxBoolItem aItem(nWhich, SD_MOD()->GetWaterCan());
@@ -426,7 +425,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
}
else if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_GRAPHICS)
{
- if (!mpDrawView->AreObjectsMarked())
+ if (!mpDrawView->areSdrObjectsSelected())
{
rSet.DisableItem(nWhich);
}
@@ -437,7 +436,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
// kann nicht beruecksichtigt werden
else
{
- if (!mpDrawView->AreObjectsMarked())
+ if (!mpDrawView->areSdrObjectsSelected())
{
rSet.DisableItem(nWhich);
}
@@ -448,7 +447,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
case SID_STYLE_UPDATE_BY_EXAMPLE:
{
- if (!mpDrawView->AreObjectsMarked())
+ if (!mpDrawView->areSdrObjectsSelected())
{
rSet.DisableItem(nWhich);
}
@@ -462,19 +461,19 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
if( bAttr )
{
- pSet = new SfxItemSet( GetDoc()->GetPool() );
+ pSet = new SfxItemSet( GetDoc()->GetItemPool() );
mpDrawView->GetAttributes( *pSet );
- rSet.Put( *pSet, sal_False );
+ rSet.Put( *pSet, false );
}
- rSet.Put( aAllSet, sal_False );
+ rSet.Put( aAllSet, false );
// Flaechen und/oder Linienattribute wurden geaendert
if( bAttr && pSet )
{
// Wenn die View selektierte Objekte besitzt, muessen entspr. Items
// von SFX_ITEM_DEFAULT (_ON) auf SFX_ITEM_DISABLED geaendert werden
- if( mpDrawView->AreObjectsMarked() )
+ if( mpDrawView->areSdrObjectsSelected() )
{
SfxWhichIter aNewIter( *pSet, XATTR_LINE_FIRST, XATTR_FILL_LAST );
nWhich = aNewIter.FirstWhich();
@@ -490,23 +489,6 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
}
delete pSet;
}
-
-// const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
-// sal_uLong nMarkCount = rMarkList.GetMarkCount();
-// sal_Bool bDisabled = sal_False;
-//
-// for (sal_uLong i = 0;
-// i < nMarkCount && !bDisabled && i < 50; i++)
-// {
-// SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
-//
-// if (pObj->GetObjInventor() == E3dInventor)
-// {
-// bDisabled = sal_True;
-// rSet.ClearItem(SDRATTR_SHADOW);
-// rSet.DisableItem(SDRATTR_SHADOW);
-// }
-// }
}
@@ -516,7 +498,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
|*
\************************************************************************/
-String DrawViewShell::GetSelectionText(sal_Bool bCompleteWords)
+String DrawViewShell::GetSelectionText(bool bCompleteWords)
{
String aStrSelection;
::Outliner* pOl = mpDrawView->GetTextEditOutliner();
@@ -548,9 +530,9 @@ String DrawViewShell::GetSelectionText(sal_Bool bCompleteWords)
|*
\************************************************************************/
-sal_Bool DrawViewShell::HasSelection(sal_Bool bText) const
+bool DrawViewShell::HasSelection(bool bText) const
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if (bText)
{
@@ -558,12 +540,12 @@ sal_Bool DrawViewShell::HasSelection(sal_Bool bText) const
if (pOlView && pOlView->GetSelected().Len() != 0)
{
- bReturn = sal_True;
+ bReturn = true;
}
}
- else if (mpDrawView->GetMarkedObjectList().GetMarkCount() != 0)
+ else if (mpDrawView->areSdrObjectsSelected())
{
- bReturn = sal_True;
+ bReturn = true;
}
return bReturn;
diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx
index 562bb81e4c34..9701e11c7a05 100644
--- a/sd/source/ui/view/drviewsg.cxx
+++ b/sd/source/ui/view/drviewsg.cxx
@@ -70,11 +70,10 @@ void DrawViewShell::ExecIMap( SfxRequest& rReq )
if ( rReq.GetSlot() == SID_IMAP_EXEC )
{
- SdrMark* pMark = mpDrawView->GetMarkedObjectList().GetMark(0);
+ SdrObject* pSdrObj = mpDrawView->getSelectedIfSingle();
- if ( pMark )
+ if(pSdrObj)
{
- SdrObject* pSdrObj = pMark->GetMarkedSdrObj();
SvxIMapDlg* pDlg = ViewShell::Implementation::GetImageMapDialog();
if ( pDlg->GetEditingObject() == (void*) pSdrObj )
@@ -102,24 +101,19 @@ void DrawViewShell::ExecIMap( SfxRequest& rReq )
void DrawViewShell::GetIMapState( SfxItemSet& rSet )
{
- sal_Bool bDisable = sal_True;
+ bool bDisable = true;
if( GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) )
{
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- const SdrObject* pObj = NULL;
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ const SdrGrafObj* pObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->getSelectedIfSingle());
- if ( nMarkCount == 1 )
+ if(pObj)
{
- pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-
SvxIMapDlg* pImageMapDialog = ViewShell::Implementation::GetImageMapDialog();
- if ( ( pObj->ISA( SdrGrafObj ) /*|| pObj->ISA( SdrOle2Obj )*/ )
- && pImageMapDialog!=NULL
- && ( pImageMapDialog->GetEditingObject() == (void*) pObj ) )
+
+ if ( pImageMapDialog && ( pImageMapDialog->GetEditingObject() == (void*) pObj ) )
{
- bDisable = sal_False;
+ bDisable = false;
}
}
}
@@ -139,9 +133,8 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
if(HasCurrentFunction(SID_PRESENTATION))
return;
- sal_Bool bDefault = sal_False;
+ bool bDefault = false;
sal_uInt16 nSlot = rReq.GetSlot();
-
SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
switch( nSlot )
@@ -176,7 +169,7 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
case SID_HELPLINES_USE:
{
- pOptions->SetSnapHelplines( !mpDrawView->IsHlplSnap() );
+ pOptions->SetSnapHelplines( !mpDrawView->IsHelplineSnap() );
}
break;
@@ -189,19 +182,19 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
case SID_SNAP_BORDER:
{
- pOptions->SetSnapBorder( !mpDrawView->IsBordSnap() );
+ pOptions->SetSnapBorder( !mpDrawView->IsBorderSnap() );
}
break;
case SID_SNAP_FRAME:
{
- pOptions->SetSnapFrame( !mpDrawView->IsOFrmSnap() );
+ pOptions->SetSnapFrame( !mpDrawView->IsOFrameSnap() );
}
break;
case SID_SNAP_POINTS:
{
- pOptions->SetSnapPoints( !mpDrawView->IsOPntSnap() );
+ pOptions->SetSnapPoints( !mpDrawView->IsOPointSnap() );
}
break;
@@ -215,7 +208,7 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
case SID_PICK_THROUGH:
{
pOptions->SetPickThrough(
- !mpDrawView->GetModel()->IsPickThroughTransparentTextFrames() );
+ !mpDrawView->getSdrModelFromSdrView().IsPickThroughTransparentTextFrames() );
}
break;
@@ -238,7 +231,7 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
break;
default:
- bDefault = sal_True;
+ bDefault = true;
break;
}
@@ -273,16 +266,16 @@ void DrawViewShell::GetOptionsBarState( SfxItemSet& rSet )
rSet.Put( SfxBoolItem( SID_GRID_VISIBLE, mpDrawView->IsGridVisible() ) );
rSet.Put( SfxBoolItem( SID_GRID_USE, mpDrawView->IsGridSnap() ) );
rSet.Put( SfxBoolItem( SID_HELPLINES_VISIBLE, mpDrawView->IsHlplVisible() ) );
- rSet.Put( SfxBoolItem( SID_HELPLINES_USE, mpDrawView->IsHlplSnap() ) );
+ rSet.Put( SfxBoolItem( SID_HELPLINES_USE, mpDrawView->IsHelplineSnap() ) );
rSet.Put( SfxBoolItem( SID_HELPLINES_MOVE, mpDrawView->IsDragStripes() ) );
- rSet.Put( SfxBoolItem( SID_SNAP_BORDER, mpDrawView->IsBordSnap() ) );
- rSet.Put( SfxBoolItem( SID_SNAP_FRAME, mpDrawView->IsOFrmSnap() ) );
- rSet.Put( SfxBoolItem( SID_SNAP_POINTS, mpDrawView->IsOPntSnap() ) );
+ rSet.Put( SfxBoolItem( SID_SNAP_BORDER, mpDrawView->IsBorderSnap() ) );
+ rSet.Put( SfxBoolItem( SID_SNAP_FRAME, mpDrawView->IsOFrameSnap() ) );
+ rSet.Put( SfxBoolItem( SID_SNAP_POINTS, mpDrawView->IsOPointSnap() ) );
rSet.Put( SfxBoolItem( SID_QUICKEDIT, mpDrawView->IsQuickTextEditMode() ) );
- rSet.Put( SfxBoolItem( SID_PICK_THROUGH, (sal_Bool)
- mpDrawView->GetModel()->IsPickThroughTransparentTextFrames() ) );
+ rSet.Put( SfxBoolItem( SID_PICK_THROUGH, (bool)
+ mpDrawView->getSdrModelFromSdrView().IsPickThroughTransparentTextFrames() ) );
rSet.Put( SfxBoolItem( SID_BIG_HANDLES, mpFrameView->IsBigHandles() ) );
rSet.Put( SfxBoolItem( SID_DOUBLECLICK_TEXTEDIT, mpFrameView->IsDoubleClickTextEdit() ) );
diff --git a/sd/source/ui/view/drviewsh.cxx b/sd/source/ui/view/drviewsh.cxx
index e7015243e95d..3dc6de9e083b 100644
--- a/sd/source/ui/view/drviewsh.cxx
+++ b/sd/source/ui/view/drviewsh.cxx
@@ -61,9 +61,9 @@ namespace sd {
|*
\************************************************************************/
-sal_Bool DrawViewShell::GotoBookmark(const String& rBookmark)
+bool DrawViewShell::GotoBookmark(const String& rBookmark)
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
::sd::DrawDocShell* pDocSh = GetDocSh();
if( pDocSh )
{
@@ -80,107 +80,101 @@ sal_Bool DrawViewShell::GotoBookmark(const String& rBookmark)
|*
\************************************************************************/
-void DrawViewShell::MakeVisible(const Rectangle& rRect, ::Window& rWin)
+void DrawViewShell::MakeVisibleAtView(const basegfx::B2DRange& rToMakeVisibleRange, ::Window& rWin)
{
- // #98568# In older versions, if in X or Y the size of the object was
- // smaller than the visible area, the user-defined zoom was
- // changed. This was decided to be a bug for 6.x, thus I developed a
- // version which instead handles X/Y bigger/smaller and visibility
- // questions seperately. The new behaviour is triggered with the
- // bZoomAllowed parameter which for old behaviour should be set to
- // sal_True. I looked at all uses of MakeVisible() in the application
- // and found no valid reason for really changing the zoom factor, thus I
- // decided to NOT expand (incompatible) this virtual method to get one
- // more parameter. If this is wanted in later versions, feel free to add
- // that bool to the parameter list.
- sal_Bool bZoomAllowed(sal_False);
- Size aLogicSize(rRect.GetSize());
-
- // Sichtbarer Bereich
- Size aVisSizePixel(rWin.GetOutputSizePixel());
- Rectangle aVisArea(rWin.PixelToLogic(Rectangle(Point(0,0), aVisSizePixel)));
- Size aVisAreaSize(aVisArea.GetSize());
-
- if(!aVisArea.IsInside(rRect) && !SlideShow::IsRunning( GetViewShellBase() ) )
+ if(!rToMakeVisibleRange.isEmpty() && !SlideShow::IsRunning(GetViewShellBase()))
{
- // Objekt liegt nicht komplett im sichtbaren Bereich
- sal_Int32 nFreeSpaceX(aVisAreaSize.Width() - aLogicSize.Width());
- sal_Int32 nFreeSpaceY(aVisAreaSize.Height() - aLogicSize.Height());
+ const basegfx::B2DRange aVisibleLogic(rWin.GetLogicRange());
- if(bZoomAllowed && (nFreeSpaceX < 0 || nFreeSpaceY < 0))
+ if(!aVisibleLogic.isInside(rToMakeVisibleRange))
{
- // Objekt passt nicht in sichtbaren Bereich -> auf Objektgroesse zoomen
- SetZoomRect(rRect);
- }
- else
- {
- // #98568# allow a mode for move-only visibility without zooming.
- const sal_Int32 nPercentBorder(30);
- const Rectangle aInnerRectangle(
- aVisArea.Left() + ((aVisAreaSize.Width() * nPercentBorder) / 200),
- aVisArea.Top() + ((aVisAreaSize.Height() * nPercentBorder) / 200),
- aVisArea.Right() - ((aVisAreaSize.Width() * nPercentBorder) / 200),
- aVisArea.Bottom() - ((aVisAreaSize.Height() * nPercentBorder) / 200)
- );
- Point aNewPos(aVisArea.TopLeft());
-
- if(nFreeSpaceX < 0)
+ // object is not completely inside. Calc target area with border
+ const double fPercentBorder(0.15); // 15%
+
+ // default new top-left is current top-left
+ basegfx::B2DPoint aNewPos(aVisibleLogic.getMinimum());
+
+ if(rToMakeVisibleRange.getWidth() > aVisibleLogic.getWidth())
{
- if(aInnerRectangle.Left() > rRect.Right())
+ // object is wider than target range
+ if(rToMakeVisibleRange.getMaxX() < aVisibleLogic.getMinX())
{
- // object moves out to the left
- aNewPos.X() -= aVisAreaSize.Width() / 2;
+ // object is outside left, move view to show right side of object
+ aNewPos.setX(rToMakeVisibleRange.getMaxX() - (aVisibleLogic.getWidth() * (1.0 - fPercentBorder)));
}
-
- if(aInnerRectangle.Right() < rRect.Left())
+ else if(rToMakeVisibleRange.getMinX() > aVisibleLogic.getMaxX())
+ {
+ // object is outside right
+ aNewPos.setX(rToMakeVisibleRange.getMinX() - (aVisibleLogic.getWidth() * fPercentBorder));
+ }
+ else
{
- // object moves out to the right
- aNewPos.X() += aVisAreaSize.Width() / 2;
+ // object is partially in visible range, nothing to do
}
}
else
{
- if(nFreeSpaceX > rRect.GetWidth())
- nFreeSpaceX = rRect.GetWidth();
-
- while(rRect.Right() > aNewPos.X() + aVisAreaSize.Width())
- aNewPos.X() += nFreeSpaceX;
-
- while(rRect.Left() < aNewPos.X())
- aNewPos.X() -= nFreeSpaceX;
+ // object is equal or taller than target range
+ if(rToMakeVisibleRange.getMinX() < aVisibleLogic.getMinX())
+ {
+ // left side of object not completely visible
+ aNewPos.setX(rToMakeVisibleRange.getMinX() - (aVisibleLogic.getWidth() * fPercentBorder));
+ }
+ else if(rToMakeVisibleRange.getMaxX() > aVisibleLogic.getMaxX())
+ {
+ // right side of object not completely visible
+ aNewPos.setX(rToMakeVisibleRange.getMaxX() - (aVisibleLogic.getWidth() * (1.0 - fPercentBorder)));
+ }
+ else
+ {
+ // both sides visible, should not happen since already checked by isInside
+ }
}
- if(nFreeSpaceY < 0)
+ if(rToMakeVisibleRange.getHeight() > aVisibleLogic.getHeight())
{
- if(aInnerRectangle.Top() > rRect.Bottom())
+ // object is higher than target range
+ if(rToMakeVisibleRange.getMaxY() < aVisibleLogic.getMinY())
{
- // object moves out to the top
- aNewPos.Y() -= aVisAreaSize.Height() / 2;
+ // object is above, move view to show lower side of object
+ aNewPos.setY(rToMakeVisibleRange.getMaxY() - (aVisibleLogic.getHeight() * (1.0 - fPercentBorder)));
}
-
- if(aInnerRectangle.Bottom() < rRect.Top())
+ else if(rToMakeVisibleRange.getMinY() > aVisibleLogic.getMaxY())
{
- // object moves out to the right
- aNewPos.Y() += aVisAreaSize.Height() / 2;
+ // object is below
+ aNewPos.setY(rToMakeVisibleRange.getMinY() - (aVisibleLogic.getHeight() * fPercentBorder));
+ }
+ else
+ {
+ // object is partially in visible range, nothing to do
}
}
else
{
- if(nFreeSpaceY > rRect.GetHeight())
- nFreeSpaceY = rRect.GetHeight();
-
- while(rRect.Bottom() > aNewPos.Y() + aVisAreaSize.Height())
- aNewPos.Y() += nFreeSpaceY;
-
- while(rRect.Top() < aNewPos.Y())
- aNewPos.Y() -= nFreeSpaceY;
+ // object is equal or taller than target range
+ if(rToMakeVisibleRange.getMinY() < aVisibleLogic.getMinY())
+ {
+ // upper side of object not completely visible
+ aNewPos.setY(rToMakeVisibleRange.getMinY() - (aVisibleLogic.getHeight() * fPercentBorder));
+ }
+ else if(rToMakeVisibleRange.getMaxY() > aVisibleLogic.getMaxY())
+ {
+ // bottom of object not completely visible
+ aNewPos.setY(rToMakeVisibleRange.getMaxY() - (aVisibleLogic.getHeight() * (1.0 - fPercentBorder)));
+ }
+ else
+ {
+ // both sides visible, should not happen since already checked by isInside
+ }
}
- // did position change? Does it need to be set?
- if(aNewPos != aVisArea.TopLeft())
+ if(!aNewPos.equal(aVisibleLogic.getMinimum()))
{
- aVisArea.SetPos(aNewPos);
- SetZoomRect(aVisArea);
+ // set new zoom if top-left has to be changed
+ SetZoomRange(
+ basegfx::B2DRange(
+ aNewPos,
+ aNewPos + aVisibleLogic.getRange()));
}
}
}
diff --git a/sd/source/ui/view/drviewsi.cxx b/sd/source/ui/view/drviewsi.cxx
index 01d50152da5e..39eb9dad937e 100644
--- a/sd/source/ui/view/drviewsi.cxx
+++ b/sd/source/ui/view/drviewsi.cxx
@@ -144,7 +144,7 @@ void DrawViewShell::AssignFrom3DWindow()
{
if(!GetView()->IsPresObjSelected())
{
- SfxItemSet aSet( GetDoc()->GetPool(),
+ SfxItemSet aSet( GetDoc()->GetItemPool(),
SDRATTR_START, SDRATTR_END,
0, 0);
p3DWin->GetAttr( aSet );
@@ -155,14 +155,14 @@ void DrawViewShell::AssignFrom3DWindow()
if(GetView()->IsConvertTo3DObjPossible())
{
// Nur TextAttribute zuweisen
- SfxItemSet aTextSet( GetDoc()->GetPool(),
+ SfxItemSet aTextSet( GetDoc()->GetItemPool(),
EE_ITEMS_START, EE_ITEMS_END, 0 );
- aTextSet.Put( aSet, sal_False );
+ aTextSet.Put( aSet, false );
GetView()->SetAttributes( aTextSet );
// Text in 3D umwandeln
sal_uInt16 nSId = SID_CONVERT_TO_3D;
- SfxBoolItem aItem( nSId, sal_True );
+ SfxBoolItem aItem( nSId, true );
GetViewFrame()->GetDispatcher()->Execute(
nSId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index 40366a4ee555..57eb26e9a1d6 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -27,16 +27,10 @@
#include "DrawViewShell.hxx"
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <svl/aeitem.hxx>
-#ifndef _SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
-#ifndef _GLOBL3D_HXX //autogen
#include <svx/globl3d.hxx>
-#endif
#include <editeng/eeitem.hxx>
-#ifndef _FLDITEM_HXX
#include <editeng/flditem.hxx>
-#endif
#include <svx/svdogrp.hxx>
#include <svx/svdograf.hxx>
#include <svx/svdoole2.hxx>
@@ -44,15 +38,11 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
#include <svx/svdopath.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/obj3d.hxx>
#include <sfx2/event.hxx>
#include <sfx2/docfile.hxx>
#include <rtl/ustrbuf.hxx>
-
-
#include "app.hrc"
-
#include "Outliner.hxx"
#include "sdpage.hxx"
#include "fupoor.hxx"
@@ -61,6 +51,7 @@
#include "DrawDocShell.hxx"
#include "drawview.hxx"
#include "optsitem.hxx"
+#include <svx/scene3d.hxx>
using namespace com::sun::star;
@@ -75,21 +66,16 @@ namespace sd {
void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
{
// Status der Menueintraege, bzw. Buttons
- // Einfachselektion
-
- const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
- sal_uLong nMarkCount = rMarkList.GetMarkCount();
+ const SdrObject* pSingleObject = mpDrawView->getSelectedIfSingle();
- if ( nMarkCount == 1 )
+ if(pSingleObject)
{
+ // Einfachselektion
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BEZIER_EDIT ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_UNGROUP ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ENTER_GROUP ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_NAME_GROUP ) ||
-
- // #i68101#
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_TITLE_DESCRIPTION ) ||
-
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_FILL_STYLE ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CHANGEBEZIER ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CHANGEPOLYGON ) ||
@@ -99,8 +85,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_MEASURE_DLG ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONNECTION_DLG ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONNECTION_NEW_ROUTING ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE_FAST ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_SHEAR ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_1BIT_THRESHOLD ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_1BIT_MATRIX ) ||
@@ -126,47 +110,51 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SAVEGRAPHIC ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_TEXTATTR_DLG ) )
{
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pObj);
- const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObj);
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nId = pObj->GetObjIdentifier();
+ const sal_uInt32 nInv = pSingleObject->GetObjInventor();
+ const sal_uInt16 nId = pSingleObject->GetObjIdentifier();
SdrObjTransformInfoRec aInfoRec;
- pObj->TakeObjInfo( aInfoRec );
+ pSingleObject->TakeObjInfo( aInfoRec );
// #91929#; don't show original size entry if not possible
- if(pSdrOle2Obj)
+ const SdrOle2Obj* pOleObj = dynamic_cast< const SdrOle2Obj* >(pSingleObject);
+
+ if ( pOleObj )
{
- if (pSdrOle2Obj->GetObjRef().is() &&
- ((pSdrOle2Obj->GetObjRef()->getStatus( pSdrOle2Obj->GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) ) )
+ if (pOleObj->GetObjRef().is() &&
+ ((pOleObj->GetObjRef()->getStatus( pOleObj->GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) ) )
+ {
rSet.DisableItem(SID_ORIGINAL_SIZE);
+ }
}
- if(!pSdrGrafObj)
+ const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pSingleObject);
+
+ if ( !pSdrGrafObj )
{
rSet.DisableItem(SID_SAVEGRAPHIC);
}
// Wenn es sich um kein Gruppenobjekt oder 3D-Objekt handelt
// wird "Gruppe betreten" disabled
- if( !( ( pObj->ISA( SdrObjGroup ) && nInv == SdrInventor ) ||
- (pObj->ISA (E3dPolyScene) || pObj->ISA (E3dScene) /*|| pObj->ISA (E3dCompoundObject) */) ) )
+ if( ! pSingleObject->getChildrenOfSdrObject() )
{
rSet.DisableItem( SID_ENTER_GROUP );
}
// Wenn es sich um kein Gruppenobjekt handelt
// wird "Gruppierung aufheben" disabled
- if (!(pObj->ISA(SdrObjGroup) && nInv == SdrInventor))
+ const SdrObjGroup* pSdrObjGroup = dynamic_cast< const SdrObjGroup* >(pSingleObject);
+
+ if (!(pSdrObjGroup && nInv == SdrInventor))
{
rSet.DisableItem(SID_UNGROUP);
}
-/*
- if (!pObj->ISA(SdrObjGroup) && !pObj->ISA(SdrGrafObj) && !pObj->ISA(SdrOle2Obj))
- {
- rSet.DisableItem( SID_NAME_GROUP );
- }
-*/
+
+// if (!pSdrObjGroup && !pSdrGrafObj && !pOleObj)
+// {
+// rSet.DisableItem( SID_NAME_GROUP );
+// }
+
if(!pSdrGrafObj ||
pSdrGrafObj->GetGraphicType() != GRAPHIC_BITMAP ||
pSdrGrafObj->IsLinkedGraphic() ||
@@ -181,25 +169,29 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
rSet.DisableItem(SID_CONVERT_TO_24BIT);
}
- if( nInv == SdrInventor &&
- (nId == OBJ_LINE ||
- nId == OBJ_PLIN ||
- nId == OBJ_PATHLINE ||
- nId == OBJ_FREELINE ))
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pSingleObject);
+
+ if(pSdrPathObj)
{
- //rSet.DisableItem( SID_ATTRIBUTES_AREA ); // wieder raus!
- rSet.DisableItem( SID_ATTR_FILL_STYLE );
+ if(!pSdrPathObj->isClosed())
+ {
+ rSet.DisableItem( SID_ATTR_FILL_STYLE );
+ }
}
- if( (!pObj->ISA( SdrPathObj ) && !aInfoRec.bCanConvToPath) || pObj->ISA( SdrObjGroup ) ) // Solange es JOE fehlerhaft behandelt!
- { // JOE: Ein Gruppenobjekt kann eben u.U. in ein PathObj gewandelt werden
+
+ if( (!pSdrPathObj && !aInfoRec.mbCanConvToPath) || pSdrObjGroup ) // Solange es JOE fehlerhaft behandelt!
+ {
+ // JOE: Ein Gruppenobjekt kann eben u.U. in ein PathObj gewandelt werden
rSet.DisableItem( SID_LINEEND_POLYGON );
}
- if(nInv == SdrInventor &&
- (nId == OBJ_PATHFILL || nId == OBJ_PATHLINE || !aInfoRec.bCanConvToPath))
+
+ if((pSdrPathObj && pSdrPathObj->isBezier()) || !aInfoRec.mbCanConvToPath)
+ {
rSet.DisableItem( SID_CHANGEBEZIER );
+ }
if( nInv == SdrInventor &&
- ( nId == OBJ_POLY || nId == OBJ_PLIN || !aInfoRec.bCanConvToPoly ) &&
+ ((pSdrPathObj && !pSdrPathObj->isBezier()) || !aInfoRec.mbCanConvToPoly ) &&
!GetView()->IsVectorizeAllowed() )
{
rSet.DisableItem( SID_CHANGEPOLYGON );
@@ -217,8 +209,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
rSet.DisableItem( SID_CONNECTION_DLG );
else
{
- sal_Bool bDisable = sal_True;
- SfxItemSet aAttrSet( GetDoc()->GetPool() );
+ bool bDisable = true;
+ SfxItemSet aAttrSet( GetDoc()->GetItemPool() );
GetView()->GetAttributes( aAttrSet );
if( aAttrSet.GetItemState( SDRATTR_EDGELINE1DELTA ) >= SFX_ITEM_AVAILABLE &&
@@ -230,7 +222,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
long nVal3 = ( ( const SdrEdgeLine3DeltaItem& ) aAttrSet.Get( SDRATTR_EDGELINE3DELTA ) ).GetValue();
{
if( nVal1 != 0 || nVal2 != 0 || nVal3 != 0 )
- bDisable = sal_False;
+ bDisable = false;
}
}
if( bDisable )
@@ -238,14 +230,14 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
}
if ( nInv == E3dInventor ||
- (!mpDrawView->IsConvertToPathObjPossible(sal_False) &&
+ (!mpDrawView->IsConvertToPathObjPossible(false) &&
!mpDrawView->IsShearAllowed() &&
!mpDrawView->IsDistortAllowed()) )
{
rSet.DisableItem( SID_OBJECT_SHEAR );
}
- if(pObj->ISA(E3dCompoundObject))
+ if(dynamic_cast< const E3dCompoundObject* >(pSingleObject))
{
rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
@@ -266,12 +258,12 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_DISMANTLE ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BREAK ) )
{
- if ( !mpDrawView->IsDismantlePossible(sal_False) )
+ if ( !mpDrawView->IsDismantlePossible(false) )
{
rSet.DisableItem( SID_DISMANTLE );
}
- if ( !mpDrawView->IsDismantlePossible(sal_True) &&
+ if ( !mpDrawView->IsDismantlePossible(true) &&
!mpDrawView->IsImportMtfPossible() &&
!mpDrawView->IsBreak3DObjPossible() )
{
@@ -286,10 +278,11 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
{
const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection();
- if( !( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) ||
- pFldItem->GetField()->ISA( SvxAuthorField ) ||
- pFldItem->GetField()->ISA( SvxExtFileField ) ||
- pFldItem->GetField()->ISA( SvxExtTimeField ) ) ) )
+ if( !( pFldItem && (
+ dynamic_cast< const SvxDateField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxAuthorField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtFileField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtTimeField* >(pFldItem->GetField()) ) ) )
{
rSet.DisableItem( SID_MODIFY_FIELD );
}
@@ -306,110 +299,84 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
rSet.DisableItem(SID_POLY_INTERSECT);
rSet.DisableItem( SID_CONNECT );
}
- // Mehrfachselektion
- else if( nMarkCount > 1 )
+ else
{
+ if(mpDrawView->areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(mpDrawView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ // Mehrfachselektion
// distribure dialog for 3+n objects
- if(nMarkCount <= 2)
+ if(aSelection.size() <= 2)
+ {
rSet.DisableItem(SID_DISTRIBUTE_DLG);
+ }
-// rSet.ClearItem( SID_BEZIER_EDIT );
-// rSet.DisableItem( SID_BEZIER_EDIT );
rSet.DisableItem( SID_LINEEND_POLYGON );
rSet.DisableItem( SID_ENTER_GROUP );
- // Jetzt (28.10.96) muessen Namen fuer Objekte eindeutig sein
rSet.DisableItem( SID_NAME_GROUP );
- // #i68101#
rSet.DisableItem( SID_OBJECT_TITLE_DESCRIPTION );
rSet.DisableItem( SID_MODIFY_FIELD );
- if( 1 )
-// if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_FILL_STYLE ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_UNGROUP ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_MEASURE_DLG ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONNECTION_DLG ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COMBINE ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_SHEAR ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_TEXTATTR_DLG ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE_FAST ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_LEFT ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_CENTER ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_RIGHT ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_UP ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_MIDDLE ) ||
-// SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_DOWN ) )
- {
- sal_Bool bText = sal_False;
- sal_Bool bLine = sal_False;
- sal_Bool bGroup = sal_False;
- sal_Bool bGraf = sal_False;
- sal_Bool bDrawObj = sal_False;
- sal_Bool b3dObj = sal_False;
- sal_Bool bTitOutText = sal_False;
+ bool bText = false;
+ bool bLine = false;
+ bool bGroup = false;
+ bool bGraf = false;
+ bool bDrawObj = false;
+ bool b3dObj = false;
+ bool bTitOutText = false;
bool bTable = false;
- sal_Bool bMeasureObj = sal_False;
- sal_Bool bEdgeObj = sal_False; // Connector
- sal_Bool bE3dCompoundObject = sal_False;
+ bool bMeasureObj = false;
+ bool bEdgeObj = false; // Connector
+ bool bE3dCompoundObject = false;
- for( sal_uLong i = 0;
- i < nMarkCount && !bText && i < 50;
- i++ )
+ for( sal_uLong i = 0; i < aSelection.size() && !bText && i < 50; i++ )
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nId = pObj->GetObjIdentifier();
+ SdrObject* pObj = aSelection[i];
+ const sal_uInt32 nInv = pObj->GetObjInventor();
+ const sal_uInt16 nId = pObj->GetObjIdentifier();
if (nInv == SdrInventor)
{
switch (nId)
{
- case OBJ_TEXT: bText = sal_True; break;
-
- case OBJ_LINE: bLine = sal_True; break;
-
- case OBJ_EDGE: bEdgeObj = sal_True; break;
-
- case OBJ_MEASURE: bMeasureObj = sal_True; break;
-
+ case OBJ_POLY:
+ {
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
+ {
+ bDrawObj = true;
+ bLine = pSdrPathObj->isLine();
+ }
+ else
+ {
+ OSL_ENSURE(false, "OOps, SdrObjKind and dynamic_cast do not fit (!)");
+ }
+ break;
+ }
+ case OBJ_TEXT: bText = true; break;
+ case OBJ_EDGE: bEdgeObj = true; break;
+ case OBJ_MEASURE: bMeasureObj = true; break;
case OBJ_RECT:
- case OBJ_CIRC:
- case OBJ_FREELINE:
- case OBJ_FREEFILL:
- case OBJ_PATHFILL:
- case OBJ_PATHLINE:
- case OBJ_SECT:
- case OBJ_CARC:
- case OBJ_CCUT: bDrawObj = sal_True; break;
-
- case OBJ_GRUP: bGroup = sal_True; break;
-
- case OBJ_GRAF: bGraf = sal_True; break;
-
+ case OBJ_CIRC: bDrawObj = true; break;
+ case OBJ_GRUP: bGroup = true; break;
+ case OBJ_GRAF: bGraf = true; break;
case OBJ_TITLETEXT:
- case OBJ_OUTLINETEXT: bTitOutText = sal_True; break;
+ case OBJ_OUTLINETEXT: bTitOutText = true; break;
case OBJ_TABLE: bTable = true; break;
}
}
else if (nInv == E3dInventor)
{
- if(pObj->ISA(E3dScene))
- b3dObj = sal_True;
- else if(pObj->ISA(E3dCompoundObject))
- bE3dCompoundObject = sal_True;
+ if(dynamic_cast< E3dScene* >(pObj))
+ b3dObj = true;
+ else if(dynamic_cast< E3dCompoundObject* >(pObj))
+ bE3dCompoundObject = true;
}
}
- /* Kann wohl raus, da jedes(?) Objekt Text enthalten kann
- if( !bText )
- {
- rSet.DisableItem( SID_CHAR_DLG );
- rSet.DisableItem( SID_PARA_DLG );
- rSet.DisableItem( SID_CHARMAP );
- }
- */
if( bLine && !bText && !bDrawObj &&!b3dObj)
{
- //rSet.DisableItem( SID_ATTRIBUTES_AREA );
rSet.DisableItem( SID_ATTR_FILL_STYLE );
}
if( !bEdgeObj )
@@ -424,7 +391,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
}
if (b3dObj ||
- (!mpDrawView->IsConvertToPathObjPossible(sal_False) &&
+ (!mpDrawView->IsConvertToPathObjPossible(false) &&
!mpDrawView->IsShearAllowed() &&
!mpDrawView->IsDistortAllowed()) )
{
@@ -468,90 +435,85 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
rSet.DisableItem( SID_BEHIND_OBJ );
rSet.DisableItem( SID_REVERSE_ORDER );
}
- }
- if ( !mpDrawView->IsDismantlePossible(sal_False) )
- {
- rSet.DisableItem( SID_DISMANTLE );
- }
- if ( !mpDrawView->IsDismantlePossible(sal_True) &&
+ if ( !mpDrawView->IsDismantlePossible(false) )
+ {
+ rSet.DisableItem( SID_DISMANTLE );
+ }
+ if ( !mpDrawView->IsDismantlePossible(true) &&
!mpDrawView->IsImportMtfPossible() &&
!mpDrawView->IsBreak3DObjPossible() )
- {
- rSet.DisableItem( SID_BREAK );
+ {
+ rSet.DisableItem( SID_BREAK );
+ }
+ if ( !mpDrawView->IsCombinePossible(false) )
+ {
+ rSet.DisableItem( SID_COMBINE );
+ rSet.DisableItem(SID_POLY_MERGE);
+ rSet.DisableItem(SID_POLY_SUBSTRACT);
+ rSet.DisableItem(SID_POLY_INTERSECT);
+ }
+ if ( !mpDrawView->IsCombinePossible(true) )
+ {
+ rSet.DisableItem( SID_CONNECT );
+ }
+ if ( !mpDrawView->IsGroupPossible() )
+ {
+ rSet.DisableItem( SID_GROUP );
+ }
+ if ( !mpDrawView->IsUnGroupPossible() )
+ {
+ rSet.DisableItem( SID_UNGROUP );
+ }
}
- if ( !mpDrawView->IsCombinePossible(sal_False) )
+ else
{
+ // kein Objekt selektiert
+ rSet.DisableItem( SID_ENTER_GROUP );
+ rSet.DisableItem( SID_CUT );
+ rSet.DisableItem( SID_COPY );
+ rSet.DisableItem( SID_DELETE );
+ rSet.DisableItem( SID_ATTR_TRANSFORM );
+
+ rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
+ rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
+ rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
+ rSet.DisableItem( SID_OBJECT_ALIGN_UP );
+ rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
+ rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
+
+ rSet.DisableItem( SID_FRAME_TO_TOP );
+ rSet.DisableItem( SID_MOREFRONT );
+ rSet.DisableItem( SID_MOREBACK );
+ rSet.DisableItem( SID_FRAME_TO_BOTTOM );
+ rSet.DisableItem( SID_BEFORE_OBJ );
+ rSet.DisableItem( SID_BEHIND_OBJ );
+ rSet.DisableItem( SID_CONVERT );
+
+ rSet.DisableItem( SID_SIZE_OPTIMAL );
+ rSet.DisableItem( SID_LINEEND_POLYGON );
+ rSet.DisableItem( SID_COPYOBJECTS );
+ rSet.DisableItem( SID_HORIZONTAL );
+ rSet.DisableItem( SID_VERTICAL );
+ rSet.DisableItem( SID_GROUP );
+ rSet.DisableItem( SID_UNGROUP );
+ rSet.DisableItem( SID_NAME_GROUP );
+
+ rSet.DisableItem( SID_OBJECT_TITLE_DESCRIPTION );
+
+ rSet.DisableItem( SID_DISMANTLE );
+ rSet.DisableItem( SID_BREAK );
rSet.DisableItem( SID_COMBINE );
+ rSet.DisableItem(SID_DISTRIBUTE_DLG);
rSet.DisableItem(SID_POLY_MERGE);
rSet.DisableItem(SID_POLY_SUBSTRACT);
rSet.DisableItem(SID_POLY_INTERSECT);
- }
- if ( !mpDrawView->IsCombinePossible(sal_True) )
- {
rSet.DisableItem( SID_CONNECT );
+ rSet.DisableItem( SID_ANIMATION_EFFECTS );
+ rSet.DisableItem( SID_MODIFY_FIELD );
+ rSet.DisableItem (SID_OBJECT_SHEAR);
}
- if ( !mpDrawView->IsGroupPossible() )
- {
- rSet.DisableItem( SID_GROUP );
- }
- if ( !mpDrawView->IsUnGroupPossible() )
- {
- rSet.DisableItem( SID_UNGROUP );
- }
- }
- // kein Objekt selektiert
- else
- {
-// rSet.ClearItem( SID_BEZIER_EDIT );
-
- rSet.DisableItem( SID_ENTER_GROUP );
- rSet.DisableItem( SID_CUT );
- rSet.DisableItem( SID_COPY );
- rSet.DisableItem( SID_DELETE );
- rSet.DisableItem( SID_ATTR_TRANSFORM );
-
- rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
- rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
- rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
- rSet.DisableItem( SID_OBJECT_ALIGN_UP );
- rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
- rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
-
- rSet.DisableItem( SID_FRAME_TO_TOP );
- rSet.DisableItem( SID_MOREFRONT );
- rSet.DisableItem( SID_MOREBACK );
- rSet.DisableItem( SID_FRAME_TO_BOTTOM );
- rSet.DisableItem( SID_BEFORE_OBJ );
- rSet.DisableItem( SID_BEHIND_OBJ );
- rSet.DisableItem( SID_CONVERT );
-
-// rSet.DisableItem( SID_BEZIER_EDIT );
- rSet.DisableItem( SID_SIZE_OPTIMAL );
- rSet.DisableItem( SID_LINEEND_POLYGON );
- rSet.DisableItem( SID_COPYOBJECTS );
- rSet.DisableItem( SID_HORIZONTAL );
- rSet.DisableItem( SID_VERTICAL );
- rSet.DisableItem( SID_GROUP );
- rSet.DisableItem( SID_UNGROUP );
- rSet.DisableItem( SID_NAME_GROUP );
-
- // #i68101#
- rSet.DisableItem( SID_OBJECT_TITLE_DESCRIPTION );
-
- rSet.DisableItem( SID_DISMANTLE );
- rSet.DisableItem( SID_BREAK );
- rSet.DisableItem( SID_COMBINE );
- rSet.DisableItem(SID_DISTRIBUTE_DLG);
- rSet.DisableItem(SID_POLY_MERGE);
- rSet.DisableItem(SID_POLY_SUBSTRACT);
- rSet.DisableItem(SID_POLY_INTERSECT);
- rSet.DisableItem( SID_CONNECT );
- rSet.DisableItem( SID_ANIMATION_EFFECTS );
- rSet.DisableItem( SID_MODIFY_FIELD );
- rSet.DisableItem (SID_OBJECT_SHEAR);
}
-
}
diff --git a/sd/source/ui/view/drvwshrg.cxx b/sd/source/ui/view/drvwshrg.cxx
index d6183f3fa066..1bf67a65c8f5 100644
--- a/sd/source/ui/view/drvwshrg.cxx
+++ b/sd/source/ui/view/drvwshrg.cxx
@@ -92,9 +92,6 @@ SFX_IMPL_INTERFACE(DrawViewShell, SfxShell, SdResId(STR_DRAWVIEWSHELL))
}
-TYPEINIT1( DrawViewShell, ViewShell );
-
-
// SdGraphicViewShell
@@ -117,7 +114,5 @@ SFX_IMPL_INTERFACE(GraphicViewShell, SfxShell, SdResId(STR_DRAWVIEWSHELL)) //SOH
SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
}
-TYPEINIT1( GraphicViewShell, DrawViewShell );
-
} // end of namespace sd
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index 0d11e4d5b4f1..87f7281f820f 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -65,28 +65,28 @@ namespace sd {
|*
\************************************************************************/
-FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK */)
- : SdrView(pDrawDoc, (OutputDevice*) NULL),
+FrameView::FrameView(SdDrawDocument& rDrawDoc, FrameView* pFrameView /* = NULK */)
+: SdrView(rDrawDoc, (OutputDevice*) NULL),
mnRefCount(0),
mnPresViewShellId(SID_VIEWSHELL0),
mnSlotId(SID_OBJECT_SELECT),
mbIsNavigatorShowingAllShapes(false)
{
- EndListening(*pDrawDoc);
+ EndListening(rDrawDoc);
- EnableExtendedKeyInputDispatcher(sal_False);
- EnableExtendedMouseEventDispatcher(sal_False);
- EnableExtendedCommandEventDispatcher(sal_False);
+ EnableExtendedKeyInputDispatcher(false);
+ EnableExtendedMouseEventDispatcher(false);
+ EnableExtendedCommandEventDispatcher(false);
- SetGridFront( sal_False );
- SetHlplFront( sal_False );
- SetOConSnap( sal_False );
- SetFrameDragSingles( sal_True );
+ SetGridFront( false );
+ SetHlplFront( false );
+ SetOConnectorSnap(false);
+ SetFrameHandles(true);
SetSlidesPerRow(4);
if( NULL == pFrameView )
{
- DrawDocShell* pDocShell = pDrawDoc->GetDocSh();
+ DrawDocShell* pDocShell = rDrawDoc.GetDocSh();
if ( pDocShell )
{
@@ -103,7 +103,7 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
// Count the FrameViews and remember the type of the main
// view shell.
pSfxViewSh = pSfxViewFrame->GetViewShell();
- pBase = PTR_CAST(ViewShellBase, pSfxViewSh );
+ pBase = dynamic_cast< ViewShellBase* >(pSfxViewSh );
if (pBase != NULL)
{
@@ -158,24 +158,24 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
SetGridFront( pFrameView->IsGridFront() );
SetSnapAngle( pFrameView->GetSnapAngle() );
SetGridSnap( pFrameView->IsGridSnap() );
- SetBordSnap( pFrameView->IsBordSnap() );
- SetHlplSnap( pFrameView->IsHlplSnap() );
- SetOFrmSnap( pFrameView->IsOFrmSnap() );
- SetOPntSnap( pFrameView->IsOPntSnap() );
- SetOConSnap( pFrameView->IsOConSnap() );
+ SetBorderSnap( pFrameView->IsBorderSnap() );
+ SetHelplineSnap( pFrameView->IsHelplineSnap() );
+ SetOFrameSnap( pFrameView->IsOFrameSnap() );
+ SetOPointSnap( pFrameView->IsOPointSnap() );
+ SetOConnectorSnap( pFrameView->IsOConnectorSnap() );
SetHlplVisible( pFrameView->IsHlplVisible() );
SetDragStripes( pFrameView->IsDragStripes() );
SetPlusHandlesAlwaysVisible( pFrameView->IsPlusHandlesAlwaysVisible() );
- SetFrameDragSingles( pFrameView->IsFrameDragSingles() );
- SetSnapMagneticPixel( pFrameView->GetSnapMagneticPixel() );
+ SetFrameHandles( pFrameView->IsFrameHandles() );
+ SetDiscreteMagneticSnap( pFrameView->GetDiscreteMagneticSnap() );
SetMarkedHitMovesAlways( pFrameView->IsMarkedHitMovesAlways() );
SetMoveOnlyDragging( pFrameView->IsMoveOnlyDragging() );
SetCrookNoContortion( pFrameView->IsCrookNoContortion() );
SetSlantButShear( pFrameView->IsSlantButShear() );
SetNoDragXorPolys( pFrameView->IsNoDragXorPolys() );
SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
- SetBigOrtho( pFrameView->IsBigOrtho() );
- SetOrtho( pFrameView->IsOrtho() );
+ SetBigOrthogonal( pFrameView->IsBigOrthogonal() );
+ SetOrthogonal( pFrameView->IsOrthogonal() );
SetEliminatePolyPointLimitAngle( pFrameView->GetEliminatePolyPointLimitAngle() );
SetEliminatePolyPoints( pFrameView->IsEliminatePolyPoints() );
// #110094#-7
@@ -228,10 +228,10 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
maVisibleLayers.SetAll();
maPrintableLayers.SetAll();
SetGridCoarse( Size( 1000, 1000 ) );
- SetSnapGridWidth(Fraction(1000, 1), Fraction(1000, 1));
+ SetSnapGridWidth(1000.0, 1000.0);
SetActiveLayer( String( SdResId(STR_LAYER_LAYOUT) ) );
- mbNoColors = sal_True;
- mbNoAttribs = sal_False;
+ mbNoColors = true;
+ mbNoAttribs = false;
maVisArea = Rectangle( Point(), Size(0, 0) );
mePageKind = PK_STANDARD;
mePageKindOnLoad = PK_STANDARD;
@@ -241,16 +241,16 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
meNotesEditMode = EM_PAGE;
meHandoutEditMode = EM_MASTERPAGE;
SetViewShEditModeOnLoad(EM_PAGE);
- mbLayerMode = sal_False;
- SetEliminatePolyPoints(sal_False);
- mbBigHandles = sal_False;
- mbDoubleClickTextEdit = sal_False;
- mbClickChangeRotation = sal_False;
+ mbLayerMode = false;
+ SetEliminatePolyPoints(false);
+ mbBigHandles = false;
+ mbDoubleClickTextEdit = false;
+ mbClickChangeRotation = false;
mnSlidesPerRow = 4;
{
bool bUseContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
- mnDrawMode = bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR;
+ mnDrawMode = bUseContrast ? SD_OUTPUT_DRAWMODE_CONTRAST : SD_OUTPUT_DRAWMODE_COLOR;
}
mnTabCtrlPercent = 0.0;
mbIsNavigatorShowingAllShapes = false;
@@ -258,18 +258,18 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK *
SetViewShellTypeOnLoad (ViewShell::ST_IMPRESS);
// get default for design mode
- sal_Bool bInitDesignMode = pDrawDoc->GetOpenInDesignMode();
- if( pDrawDoc->OpenInDesignModeIsDefaulted() )
+ sal_Bool bInitDesignMode = rDrawDoc.GetOpenInDesignMode();
+ if( rDrawDoc.OpenInDesignModeIsDefaulted() )
{
bInitDesignMode = sal_True;
}
- SfxObjectShell* pObjShell = pDrawDoc->GetObjectShell();
+ SfxObjectShell* pObjShell = rDrawDoc.GetObjectShell();
if( pObjShell && pObjShell->IsReadOnly() )
bInitDesignMode = sal_False;
SetDesignMode( bInitDesignMode );
- Update( SD_MOD()->GetSdOptions(pDrawDoc->GetDocumentType()) );
+ Update( SD_MOD()->GetSdOptions(rDrawDoc.GetDocumentType()) );
}
}
@@ -330,35 +330,35 @@ void FrameView::Update(SdOptions* pOptions)
SetGridVisible( pOptions->IsGridVisible() );
SetSnapAngle( pOptions->GetAngle() );
SetGridSnap( pOptions->IsUseGridSnap() );
- SetBordSnap( pOptions->IsSnapBorder() );
- SetHlplSnap( pOptions->IsSnapHelplines() );
- SetOFrmSnap( pOptions->IsSnapFrame() );
- SetOPntSnap( pOptions->IsSnapPoints() );
+ SetBorderSnap( pOptions->IsSnapBorder() );
+ SetHelplineSnap( pOptions->IsSnapHelplines() );
+ SetOFrameSnap( pOptions->IsSnapFrame() );
+ SetOPointSnap( pOptions->IsSnapPoints() );
SetHlplVisible( pOptions->IsHelplines() );
SetDragStripes( pOptions->IsDragStripes() );
SetPlusHandlesAlwaysVisible( pOptions->IsHandlesBezier() );
- SetSnapMagneticPixel( pOptions->GetSnapArea() );
+ SetDiscreteMagneticSnap( pOptions->GetSnapArea() );
SetMarkedHitMovesAlways( pOptions->IsMarkedHitMovesAlways() );
SetMoveOnlyDragging( pOptions->IsMoveOnlyDragging() );
SetSlantButShear( pOptions->IsMoveOnlyDragging() );
SetNoDragXorPolys ( !pOptions->IsMoveOutline() );
SetCrookNoContortion( pOptions->IsCrookNoContortion() );
SetAngleSnapEnabled( pOptions->IsRotate() );
- SetBigOrtho( pOptions->IsBigOrtho() );
- SetOrtho( pOptions->IsOrtho() );
+ SetBigOrthogonal( pOptions->IsBigOrtho() );
+ SetOrthogonal( pOptions->IsOrtho() );
SetEliminatePolyPointLimitAngle( pOptions->GetEliminatePolyPointLimitAngle() );
// #110094#-7
// SetMasterPagePaintCaching( pOptions->IsMasterPagePaintCaching() );
- GetModel()->SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() );
+ getSdrModelFromSdrView().SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() );
SetSolidMarkHdl( pOptions->IsSolidMarkHdl() );
SetSolidDragging( pOptions->IsSolidDragging() );
SetGridCoarse( Size( pOptions->GetFldDrawX(), pOptions->GetFldDrawY() ) );
SetGridFine( Size( pOptions->GetFldDivisionX(), pOptions->GetFldDivisionY() ) );
- Fraction aFractX(pOptions->GetFldDrawX(), pOptions->GetFldDrawX() / ( pOptions->GetFldDivisionX() ? pOptions->GetFldDivisionX() : 1 ));
- Fraction aFractY(pOptions->GetFldDrawY(), pOptions->GetFldDrawY() / ( pOptions->GetFldDivisionY() ? pOptions->GetFldDivisionY() : 1 ));
- SetSnapGridWidth(aFractX, aFractY);
+ const Fraction aFractX(pOptions->GetFldDrawX(), pOptions->GetFldDrawX() / ( pOptions->GetFldDivisionX() ? pOptions->GetFldDivisionX() : 1 ));
+ const Fraction aFractY(pOptions->GetFldDrawY(), pOptions->GetFldDrawY() / ( pOptions->GetFldDivisionY() ? pOptions->GetFldDivisionY() : 1 ));
+ SetSnapGridWidth(double(aFractX), double(aFractY));
SetQuickEdit(pOptions->IsQuickEdit());
// #i26631#
@@ -448,23 +448,23 @@ static OUString createHelpLinesString( const SdrHelpLineList& rHelpLines )
for( sal_uInt16 nHlpLine = 0; nHlpLine < nCount; nHlpLine++ )
{
const SdrHelpLine& rHelpLine = rHelpLines[nHlpLine];
- const Point& rPos = rHelpLine.GetPos();
+ const basegfx::B2DPoint& rPos = rHelpLine.GetPos();
switch( rHelpLine.GetKind() )
{
case SDRHELPLINE_POINT:
aLines.append( (sal_Unicode)'P' );
- aLines.append( (sal_Int32)rPos.X() );
+ aLines.append( (sal_Int32)rPos.getX() );
aLines.append( (sal_Unicode)',' );
- aLines.append( (sal_Int32)rPos.Y() );
+ aLines.append( (sal_Int32)rPos.getY() );
break;
case SDRHELPLINE_VERTICAL:
aLines.append( (sal_Unicode)'V' );
- aLines.append( (sal_Int32)rPos.X() );
+ aLines.append( (sal_Int32)rPos.getX() );
break;
case SDRHELPLINE_HORIZONTAL:
aLines.append( (sal_Unicode)'H' );
- aLines.append( (sal_Int32)rPos.Y() );
+ aLines.append( (sal_Int32)rPos.getY() );
break;
default:
DBG_ERROR( "Unsupported helpline Kind!" );
@@ -482,10 +482,10 @@ void FrameView::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com:
aUserData.addValue( sUNO_View_GridIsVisible, makeAny( (sal_Bool)IsGridVisible() ) );
aUserData.addValue( sUNO_View_GridIsFront, makeAny( (sal_Bool)IsGridFront() ) );
aUserData.addValue( sUNO_View_IsSnapToGrid, makeAny( (sal_Bool)IsGridSnap() ) );
- aUserData.addValue( sUNO_View_IsSnapToPageMargins, makeAny( (sal_Bool)IsBordSnap() ) );
- aUserData.addValue( sUNO_View_IsSnapToSnapLines, makeAny( (sal_Bool)IsHlplSnap() ) );
- aUserData.addValue( sUNO_View_IsSnapToObjectFrame, makeAny( (sal_Bool)IsOFrmSnap() ) );
- aUserData.addValue( sUNO_View_IsSnapToObjectPoints, makeAny( (sal_Bool)IsOPntSnap() ) );
+ aUserData.addValue( sUNO_View_IsSnapToPageMargins, makeAny( (sal_Bool)IsBorderSnap() ) );
+ aUserData.addValue( sUNO_View_IsSnapToSnapLines, makeAny( (sal_Bool)IsHelplineSnap() ) );
+ aUserData.addValue( sUNO_View_IsSnapToObjectFrame, makeAny( (sal_Bool)IsOFrameSnap() ) );
+ aUserData.addValue( sUNO_View_IsSnapToObjectPoints, makeAny( (sal_Bool)IsOPointSnap() ) );
// pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsSnapLinesVisible ) );
// pValue->Value <<= (sal_Bool)IsHlplVisible();
@@ -496,7 +496,7 @@ void FrameView::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com:
// pValue++;nIndex++;
aUserData.addValue( sUNO_View_IsPlusHandlesAlwaysVisible, makeAny( (sal_Bool)IsPlusHandlesAlwaysVisible() ) );
- aUserData.addValue( sUNO_View_IsFrameDragSingles, makeAny( (sal_Bool)IsFrameDragSingles() ) );
+ aUserData.addValue( sUNO_View_IsFrameDragSingles, makeAny( (sal_Bool)IsFrameHandles() ) );
// pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsMarkedHitMovesAlways ) );
// pValue->Value <<= (sal_Bool)IsMarkedHitMovesAlways();
@@ -582,10 +582,12 @@ void FrameView::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com:
aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( (sal_Int32)GetGridCoarse().Height() ) );
aUserData.addValue( sUNO_View_GridFineWidth, makeAny( (sal_Int32)GetGridFine().Width() ) );
aUserData.addValue( sUNO_View_GridFineHeight, makeAny( (sal_Int32)GetGridFine().Height() ) );
- aUserData.addValue( sUNO_View_GridSnapWidthXNumerator, makeAny( (sal_Int32)GetSnapGridWidthX().GetNumerator() ) );
- aUserData.addValue( sUNO_View_GridSnapWidthXDenominator, makeAny( (sal_Int32)GetSnapGridWidthX().GetDenominator() ) );
- aUserData.addValue( sUNO_View_GridSnapWidthYNumerator, makeAny( (sal_Int32)GetSnapGridWidthY().GetNumerator() ) );
- aUserData.addValue( sUNO_View_GridSnapWidthYDenominator, makeAny( (sal_Int32)GetSnapGridWidthY().GetDenominator() ) );
+ const Fraction aGridSnapWidthX(GetSnapGridWidthX());
+ aUserData.addValue( sUNO_View_GridSnapWidthXNumerator, makeAny( (sal_Int32)aGridSnapWidthX.GetNumerator() ) );
+ aUserData.addValue( sUNO_View_GridSnapWidthXDenominator, makeAny( (sal_Int32)aGridSnapWidthX.GetDenominator() ) );
+ const Fraction aGridSnapWidthY(GetSnapGridWidthY());
+ aUserData.addValue( sUNO_View_GridSnapWidthYNumerator, makeAny( (sal_Int32)aGridSnapWidthY.GetNumerator() ) );
+ aUserData.addValue( sUNO_View_GridSnapWidthYDenominator, makeAny( (sal_Int32)aGridSnapWidthY.GetDenominator() ) );
aUserData.addValue( sUNO_View_IsAngleSnapEnabled, makeAny( (sal_Bool)IsAngleSnapEnabled() ) );
aUserData.addValue( sUNO_View_SnapAngle, makeAny( (sal_Int32)GetSnapAngle() ) );
@@ -611,7 +613,7 @@ static void createHelpLinesFromString( const rtl::OUString& rLines, SdrHelpLineL
while( *pStr )
{
- Point aPoint;
+ basegfx::B2DPoint aPoint;
switch( *pStr )
{
@@ -636,15 +638,15 @@ static void createHelpLinesFromString( const rtl::OUString& rLines, SdrHelpLineL
sBuffer.append( *pStr++ );
}
- sal_Int32 nValue = sBuffer.makeStringAndClear().toInt32();
+ const sal_Int32 nValue = sBuffer.makeStringAndClear().toInt32();
if( aNewHelpLine.GetKind() == SDRHELPLINE_HORIZONTAL )
{
- aPoint.Y() = nValue;
+ aPoint.setY(nValue);
}
else
{
- aPoint.X() = nValue;
+ aPoint.setX(nValue);
if( aNewHelpLine.GetKind() == SDRHELPLINE_POINT )
{
@@ -656,7 +658,7 @@ static void createHelpLinesFromString( const rtl::OUString& rLines, SdrHelpLineL
sBuffer.append( *pStr++ );
}
- aPoint.Y() = sBuffer.makeStringAndClear().toInt32();
+ aPoint.setY(sBuffer.makeStringAndClear().toInt32());
}
}
@@ -671,18 +673,20 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
const sal_Int32 nLength = rSequence.getLength();
if (nLength)
{
- const bool bImpress = dynamic_cast< SdDrawDocument* >(GetModel())->GetDocumentType() == DOCUMENT_TYPE_IMPRESS;
+ const bool bImpress = dynamic_cast< SdDrawDocument& >(getSdrModelFromSdrView()).GetDocumentType() == DOCUMENT_TYPE_IMPRESS;
sal_Bool bBool = sal_False;
sal_Int32 nInt32 = 0;
sal_Int16 nInt16 = 0;
rtl::OUString aString;
- sal_Int32 aSnapGridWidthXNum = GetSnapGridWidthX().GetNumerator();
- sal_Int32 aSnapGridWidthXDom = GetSnapGridWidthX().GetDenominator();
+ const Fraction aGridSnapWidthX(GetSnapGridWidthX());
+ sal_Int32 aSnapGridWidthXNum = aGridSnapWidthX.GetNumerator();
+ sal_Int32 aSnapGridWidthXDom = aGridSnapWidthX.GetDenominator();
- sal_Int32 aSnapGridWidthYNum = GetSnapGridWidthY().GetNumerator();
- sal_Int32 aSnapGridWidthYDom = GetSnapGridWidthY().GetDenominator();
+ const Fraction aGridSnapWidthY(GetSnapGridWidthY());
+ sal_Int32 aSnapGridWidthYNum = aGridSnapWidthY.GetNumerator();
+ sal_Int32 aSnapGridWidthYDom = aGridSnapWidthY.GetDenominator();
EditMode eStandardEditMode;
EditMode eNotesEditMode;
@@ -732,8 +736,8 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
{
if( pValue->Value >>= nInt16 )
{
- SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
- if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+ SdDrawDocument& rDoc = dynamic_cast< SdDrawDocument& >( getSdrModelFromSdrView() );
+ if( rDoc.GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == rDoc.GetDocSh()->GetCreateMode() ) )
SetPageKind( (PageKind)nInt16 );
SetPageKindOnLoad( (PageKind)nInt16 );
@@ -743,11 +747,11 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
{
if( pValue->Value >>= nInt16 )
{
- SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
- if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
- SetSelectedPage( (sal_uInt16)nInt16 );
+ SdDrawDocument& rDoc = dynamic_cast< SdDrawDocument& >( getSdrModelFromSdrView() );
+ if( rDoc.GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == rDoc.GetDocSh()->GetCreateMode() ) )
+ SetSelectedPage( (sal_uInt32)nInt16 );
- SetSelectedPageOnLoad( (sal_uInt16)nInt16 );
+ SetSelectedPageOnLoad( (sal_uInt32)nInt16 );
}
}
else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsLayerMode ) ) )
@@ -826,8 +830,8 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
{
if( pValue->Value >>= nInt32 )
{
- SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
- if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+ SdDrawDocument& rDoc = dynamic_cast< SdDrawDocument& >( getSdrModelFromSdrView() );
+ if( rDoc.GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == rDoc.GetDocSh()->GetCreateMode() ) )
SetViewShEditMode( (EditMode)nInt32, PK_STANDARD );
eStandardEditMode = (EditMode)nInt32;
}
@@ -836,8 +840,8 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
{
if( pValue->Value >>= nInt32 )
{
- SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
- if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+ SdDrawDocument& rDoc = dynamic_cast< SdDrawDocument& >( getSdrModelFromSdrView() );
+ if( rDoc.GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == rDoc.GetDocSh()->GetCreateMode() ) )
SetViewShEditMode( (EditMode)nInt32, PK_NOTES );
eNotesEditMode = (EditMode)nInt32;
}
@@ -846,8 +850,8 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
{
if( pValue->Value >>= nInt32 )
{
- SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
- if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+ SdDrawDocument& rDoc = dynamic_cast< SdDrawDocument& >( getSdrModelFromSdrView() );
+ if( rDoc.GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == rDoc.GetDocSh()->GetCreateMode() ) )
SetViewShEditMode( (EditMode)nInt32, PK_HANDOUT );
eHandoutEditMode = (EditMode)nInt32;
}
@@ -921,28 +925,28 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
{
if( pValue->Value >>= bBool )
{
- SetBordSnap( bBool );
+ SetBorderSnap( bBool );
}
}
else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToSnapLines ) ) )
{
if( pValue->Value >>= bBool )
{
- SetHlplSnap( bBool );
+ SetHelplineSnap( bBool );
}
}
else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToObjectFrame ) ) )
{
if( pValue->Value >>= bBool )
{
- SetOFrmSnap( bBool );
+ SetOFrameSnap( bBool );
}
}
else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToObjectPoints ) ) )
{
if( pValue->Value >>= bBool )
{
- SetOPntSnap( bBool );
+ SetOPointSnap( bBool );
}
}
/* else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapLinesVisible ) ) )
@@ -970,7 +974,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
{
if( pValue->Value >>= bBool )
{
- SetFrameDragSingles( bBool );
+ SetFrameHandles( bBool );
}
}
/* else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsMarkedHitMovesAlways ) ) )
@@ -1138,7 +1142,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
const Fraction aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom );
const Fraction aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom );
- SetSnapGridWidth( aSnapGridWidthX, aSnapGridWidthY );
+ SetSnapGridWidth( double(aSnapGridWidthX), double(aSnapGridWidthY) );
}
}
@@ -1177,7 +1181,7 @@ ViewShell::ShellType FrameView::GetViewShellTypeOnLoad (void) const
-void FrameView::SetSelectedPage(sal_uInt16 nPage)
+void FrameView::SetSelectedPage(sal_uInt32 nPage)
{
mnSelectedPage = nPage;
}
@@ -1185,7 +1189,7 @@ void FrameView::SetSelectedPage(sal_uInt16 nPage)
-sal_uInt16 FrameView::GetSelectedPage (void) const
+sal_uInt32 FrameView::GetSelectedPage (void) const
{
return mnSelectedPage;
}
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 5c598a814aa8..d006ac8087f4 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -129,7 +129,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
if (pArgs && pArgs->Count () == 1 )
{
- SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER, sal_False);
+ SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER );
if (CHECK_RANGE (5, pScale->GetValue (), 3000))
{
SetZoom (pScale->GetValue ());
@@ -159,9 +159,8 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
case SID_SIZE_REAL:
{
SetZoom( 100 );
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
- GetActiveWindow()->GetOutputSizePixel()) );
- mpZoomList->InsertZoomRect(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(GetActiveWindow()->GetLogicRange());
+ mpZoomList->InsertZoomRange(aVisAreaWin);
Invalidate( SID_ATTR_ZOOM );
Invalidate( SID_ATTR_ZOOMSLIDER );
Cancel();
@@ -172,9 +171,8 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
case SID_ZOOM_IN:
{
SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) );
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0),
- GetActiveWindow()->GetOutputSizePixel()) );
- mpZoomList->InsertZoomRect(aVisAreaWin);
+ const basegfx::B2DRange aVisAreaWin(GetActiveWindow()->GetLogicRange());
+ mpZoomList->InsertZoomRange(aVisAreaWin);
Invalidate( SID_ATTR_ZOOM );
Invalidate( SID_ZOOM_OUT);
Invalidate( SID_ZOOM_IN );
@@ -428,7 +426,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
/*
ESelection aEsel= pOutlinerView->GetSelection();
Outliner* pOutl = pOutlinerView->GetOutliner();
- pOutl->SetUpdateMode(sal_False);
+ pOutl->SetUpdateMode(false);
List* pSelectedParas = pOutlinerView->CreateSelectionList();
Paragraph* pPara = (Paragraph*)pSelectedParas->First();
while (pPara)
@@ -442,10 +440,10 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
pPara = (Paragraph*)pSelectedParas->Next();
}
delete pSelectedParas;
- pOutl->SetUpdateMode(sal_True);
+ pOutl->SetUpdateMode(true);
pOutlinerView->SetSelection(aEsel);
*/
- pOutlinerView->RemoveAttribs(sal_True); // sal_True = auch Absatzattribute
+ pOutlinerView->RemoveAttribs(true); // true = auch Absatzattribute
Cancel();
rReq.Done();
}
@@ -536,14 +534,15 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
const SvxFieldItem* pOldFldItem = pOutlinerView->GetFieldAtSelection();
- if( pOldFldItem && ( pOldFldItem->GetField()->ISA( SvxURLField ) ||
- pOldFldItem->GetField()->ISA( SvxDateField ) ||
- pOldFldItem->GetField()->ISA( SvxTimeField ) ||
- pOldFldItem->GetField()->ISA( SvxExtTimeField ) ||
- pOldFldItem->GetField()->ISA( SvxExtFileField ) ||
- pOldFldItem->GetField()->ISA( SvxAuthorField ) ||
- pOldFldItem->GetField()->ISA( SvxPageField ) ||
- pOldFldItem->GetField()->ISA( SvxPagesField )) )
+ if( pOldFldItem && (
+ dynamic_cast< const SvxURLField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxDateField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxTimeField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxExtTimeField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxExtFileField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxAuthorField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxPageField* >(pOldFldItem->GetField()) ||
+ dynamic_cast< const SvxPagesField* >(pOldFldItem->GetField())) )
{
// Feld selektieren, so dass es beim Insert geloescht wird
ESelection aSel = pOutlinerView->GetSelection();
@@ -566,10 +565,11 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
{
const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection();
- if( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) ||
- pFldItem->GetField()->ISA( SvxAuthorField ) ||
- pFldItem->GetField()->ISA( SvxExtFileField ) ||
- pFldItem->GetField()->ISA( SvxExtTimeField ) ) )
+ if( pFldItem && (
+ dynamic_cast< const SvxDateField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxAuthorField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtFileField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtTimeField* >(pFldItem->GetField()) ) )
{
// Dialog...
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
@@ -583,10 +583,10 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
//pOLV->DeleteSelected(); <-- fehlt leider !
// Feld selektieren, so dass es beim Insert geloescht wird
ESelection aSel = pOutlinerView->GetSelection();
- sal_Bool bSel = sal_True;
+ bool bSel = true;
if( aSel.nStartPos == aSel.nEndPos )
{
- bSel = sal_False;
+ bSel = false;
aSel.nEndPos++;
}
pOutlinerView->SetSelection( aSel );
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index d856c94b0163..f4d68108868d 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -131,9 +131,6 @@ SFX_IMPL_INTERFACE(OutlineViewShell, SfxShell, SdResId(STR_OUTLINEVIEWSHELL))
}
-TYPEINIT1( OutlineViewShell, ViewShell );
-
-
/*************************************************************************
|*
|* gemeinsamer Initialiserungsanteil der beiden Konstruktoren
@@ -142,20 +139,20 @@ TYPEINIT1( OutlineViewShell, ViewShell );
void OutlineViewShell::Construct(DrawDocShell* )
{
- sal_Bool bModified = GetDoc()->IsChanged();
+ bool bModified = GetDoc()->IsChanged();
meShellType = ST_OUTLINE;
- Size aSize(29700, 21000);
- Point aWinPos (0, 0);
- Point aViewOrigin(0, 0);
- GetActiveWindow()->SetMinZoomAutoCalc(sal_False);
+ const basegfx::B2DVector aSize(29700.0, 21000.0);
+ const basegfx::B2DPoint aWinPos(0.0, 0.0);
+ const basegfx::B2DPoint aViewOrigin(0.0, 0.0);
+ GetActiveWindow()->SetMinZoomAutoCalc(false);
GetActiveWindow()->SetMinZoom( MIN_ZOOM );
GetActiveWindow()->SetMaxZoom( MAX_ZOOM );
InitWindows(aViewOrigin, aSize, aWinPos);
pOlView = new OutlineView(GetDocSh(), GetActiveWindow(), this);
mpView = pOlView; // Pointer der Basisklasse ViewShell
- SetPool( &GetDoc()->GetPool() );
+ SetPool( &GetDoc()->GetItemPool() );
SetZoom(69);
@@ -163,7 +160,7 @@ void OutlineViewShell::Construct(DrawDocShell* )
ReadFrameViewData(mpFrameView);
::Outliner* pOutl = pOlView->GetOutliner();
- pOutl->SetUpdateMode(sal_True);
+ pOutl->SetUpdateMode(true);
if (!bModified)
{
@@ -225,7 +222,7 @@ OutlineViewShell::OutlineViewShell (
if (pFrameViewArgument != NULL)
mpFrameView = pFrameViewArgument;
else
- mpFrameView = new FrameView(GetDoc());
+ mpFrameView = new FrameView(*GetDoc());
mpFrameView->Connect();
@@ -248,7 +245,7 @@ OutlineViewShell::~OutlineViewShell()
if ( pClipEvtLstnr )
{
- pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), sal_False );
+ pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), false );
pClipEvtLstnr->ClearCallbackLink(); // #103849# prevent callback if another thread is waiting
pClipEvtLstnr->release();
}
@@ -301,29 +298,24 @@ void OutlineViewShell::ArrangeGUIElements ()
::sd::Window* pWindow = mpContentWindow.get();
if (pWindow != NULL)
{
- pWindow->SetMinZoomAutoCalc(sal_False);
-
- // pWindow->SetPosSizePixel(rNewPos, Size(nSizeX, nSizeY));
+ pWindow->SetMinZoomAutoCalc(false);
// OutputArea der OutlinerView aendern
OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWindow);
-
Rectangle aWin(Point(0,0), pWindow->GetOutputSizePixel());
-// aWin.nLeft = pOlView->GetPageNumberWidthPixel();
aWin = pWindow->PixelToLogic(aWin);
pOutlinerView->SetOutputArea(aWin);
- Rectangle aVis = pOutlinerView->GetVisArea();
-
- Rectangle aText = Rectangle(Point(0,0),
- Size(pOlView->GetPaperWidth(),
- pOlView->GetOutliner()->GetTextHeight()));
- aText.Bottom() += aWin.GetHeight();
+ const Point aVisTopLeft(pOutlinerView->GetVisArea().TopLeft());
+ const Size aTextSize(pOlView->GetPaperWidth(), pOlView->GetOutliner()->GetTextHeight() + aWin.GetHeight());
if (!aWin.IsEmpty()) // nicht beim Oeffnen
{
- InitWindows(Point(0,0), aText.GetSize(), Point(aVis.TopLeft()));
+ InitWindows(
+ basegfx::B2DPoint(0.0, 0.0),
+ basegfx::B2DVector(aTextSize.Width(), aTextSize.Height()),
+ basegfx::B2DPoint(aVisTopLeft.X(), aVisTopLeft.Y()));
UpdateScrollBars();
}
}
@@ -441,11 +433,13 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet)
if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 )
{
const SvxFieldData* pField = pFieldItem->GetField();
- if ( pField->ISA(SvxURLField) )
+ const SvxURLField* pSvxURLField = dynamic_cast< const SvxURLField* >(pField);
+
+ if ( pSvxURLField )
{
- aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
- aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
- aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
+ aHLinkItem.SetName(pSvxURLField->GetRepresentation());
+ aHLinkItem.SetURL(pSvxURLField->GetURL());
+ aHLinkItem.SetTargetFrame(pSvxURLField->GetTargetFrame());
}
}
}
@@ -455,7 +449,7 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet)
rSet.Put( SfxBoolItem( SID_READONLY_MODE, GetDocSh()->IsReadOnly() ) );
if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) )
- rSet.Put( SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, sal_True ) );
+ rSet.Put( SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, true ) );
if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_TRANSLITERATE_HALFWIDTH) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_TRANSLITERATE_FULLWIDTH) ||
@@ -495,7 +489,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs())
GetDocSh()->SetStyleFamily(((SfxUInt16Item&)rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue());
- sal_Bool bPreviewState = sal_False;
+ bool bPreviewState = false;
sal_uLong nSlot = rReq.GetSlot();
std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
@@ -530,7 +524,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
pOlView->DoCut();
}
rReq.Done();
- bPreviewState = sal_True;
+ bPreviewState = true;
}
break;
@@ -545,7 +539,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
pOlView->DoCopy();
}
rReq.Done();
- bPreviewState = sal_True;
+ bPreviewState = true;
}
break;
@@ -562,7 +556,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
pOlView->DoPaste();
}
rReq.Done();
- bPreviewState = sal_True;
+ bPreviewState = true;
}
break;
@@ -586,7 +580,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
}
}
rReq.Done();
- bPreviewState = sal_True;
+ bPreviewState = true;
}
break;
@@ -612,7 +606,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
if (mpZoomList->IsPreviousPossible())
{
// Vorheriges ZoomRect einstellen
- SetZoomRect(mpZoomList->GetPreviousZoomRect());
+ SetZoomRange(mpZoomList->GetPreviousZoomRange());
}
rReq.Done ();
}
@@ -623,7 +617,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
if (mpZoomList->IsNextPossible())
{
// Naechstes ZoomRect einstellen
- SetZoomRect(mpZoomList->GetNextZoomRect());
+ SetZoomRange(mpZoomList->GetNextZoomRange());
}
rReq.Done ();
}
@@ -687,7 +681,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
}
rReq.Done();
- bPreviewState = sal_True;
+ bPreviewState = true;
}
break;
@@ -695,13 +689,13 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
case SID_UNDO :
{
OutlineViewPageChangesGuard aGuard2(pOlView);
- ImpSidUndo(sal_False, rReq);
+ ImpSidUndo(false, rReq);
}
break;
case SID_REDO :
{
OutlineViewPageChangesGuard aGuard2(pOlView);
- ImpSidRedo(sal_False, rReq);
+ ImpSidRedo(false, rReq);
}
break;
@@ -795,11 +789,11 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
// Vorlagenkatalog darf nicht aufgerufen werden
rSet.DisableItem( SID_STYLE_CATALOG );
- rSet.Put(SfxBoolItem(SID_DIAMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_DRAWINGMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_OUTLINEMODE, sal_True));
- rSet.Put(SfxBoolItem(SID_NOTESMODE, sal_False));
- rSet.Put(SfxBoolItem(SID_HANDOUTMODE, sal_False));
+ rSet.Put(SfxBoolItem(SID_DIAMODE, false));
+ rSet.Put(SfxBoolItem(SID_DRAWINGMODE, false));
+ rSet.Put(SfxBoolItem(SID_OUTLINEMODE, true));
+ rSet.Put(SfxBoolItem(SID_NOTESMODE, false));
+ rSet.Put(SfxBoolItem(SID_HANDOUTMODE, false));
if (!mpZoomList->IsNextPossible())
{
@@ -828,13 +822,13 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SELECTALL ) )
{
sal_uLong nParaCount = pOutl->GetParagraphCount();
- sal_Bool bDisable = nParaCount == 0;
+ bool bDisable = nParaCount == 0;
if (!bDisable && nParaCount == 1)
{
String aTest( pOutl->GetText( pOutl->GetParagraph( 0 ) ) );
if (aTest.Len() == 0)
{
- bDisable = sal_True;
+ bDisable = true;
}
}
if (bDisable)
@@ -853,18 +847,18 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
{
// Farbansicht ein/aus
sal_uLong nCntrl = pOutl->GetControlWord();
- sal_Bool bNoColor = sal_False;
+ bool bNoColor = false;
if (nCntrl & EE_CNTRL_NOCOLORS)
- bNoColor = sal_True;
+ bNoColor = true;
rSet.Put( SfxBoolItem( SID_COLORVIEW, bNoColor ) );
}
// Buttons der Werkzeugleiste
// zunaechst selektionsabhaengige: COLLAPSE, EXPAND
- sal_Bool bDisableCollapse = sal_True;
- sal_Bool bDisableExpand = sal_True;
- sal_Bool bUnique = sal_True;
+ bool bDisableCollapse = true;
+ bool bDisableExpand = true;
+ bool bUnique = true;
OutlinerView* pOutlinerView = pOlView->GetViewByWindow(GetActiveWindow());
List* pList = pOutlinerView->CreateSelectionList();
Paragraph* pPara = (Paragraph*)pList->First();
@@ -877,13 +871,13 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) );
if( nDepth != nTmpDepth )
- bUnique = sal_False;
+ bUnique = false;
if( bPage != pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
- bUnique = sal_False;
+ bUnique = false;
if (!pOutl->IsExpanded(pPara) && pOutl->HasChilds(pPara))
- bDisableExpand = sal_False;
+ bDisableExpand = false;
if (pOutl->IsExpanded(pPara) && pOutl->HasChilds(pPara))
- bDisableCollapse = sal_False;
+ bDisableCollapse = false;
pPara = (Paragraph*)pList->Next();
}
@@ -902,7 +896,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
String aTest(((SfxStringItem&)aSet.Get(SID_STATUS_LAYOUT)).GetValue());
if (aTest.Len() == 0)
{
- bUnique = sal_False;
+ bUnique = false;
rSet.DisableItem(SID_PRESENTATION_TEMPLATES);
}
@@ -910,14 +904,14 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem( SID_PRESENTATIONOBJECT );
// jetzt die selektionsunabhaengigen: COLLAPSE_ALL, EXPAND_ALL
- sal_Bool bDisableCollapseAll = sal_True;
- sal_Bool bDisableExpandAll = sal_True;
+ bool bDisableCollapseAll = true;
+ bool bDisableExpandAll = true;
// wenn schon die Selektion etwas kollabierbares/expandierbares enthaelt
if (!bDisableCollapse)
- bDisableCollapseAll = sal_False;
+ bDisableCollapseAll = false;
if (!bDisableExpand)
- bDisableExpandAll = sal_False;
+ bDisableExpandAll = false;
// schade, so billig kommen wir nicht davon; alle Absaetze durchsuchen
if (bDisableCollapseAll || bDisableExpandAll)
@@ -927,10 +921,10 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
while (pPara && (bDisableCollapseAll || bDisableExpandAll))
{
if (!pOutl->IsExpanded(pPara) && pOutl->HasChilds(pPara))
- bDisableExpandAll = sal_False;
+ bDisableExpandAll = false;
if (pOutl->IsExpanded(pPara) && pOutl->HasChilds(pPara))
- bDisableCollapseAll = sal_False;
+ bDisableCollapseAll = false;
pPara = pOutl->GetParagraph( ++nParaPos );
}
@@ -948,7 +942,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
// create listener
pClipEvtLstnr = new TransferableClipboardListener( LINK( this, OutlineViewShell, ClipboardChanged ) );
pClipEvtLstnr->acquire();
- pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), sal_True );
+ pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), true );
// get initial state
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );
@@ -972,7 +966,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
if (pOlView->GetOutliner()->IsModified())
{
- GetDoc()->SetChanged(sal_True);
+ GetDoc()->SetChanged(true);
}
// Da �berladen, muss hier der Status gesetzt werden
@@ -989,11 +983,11 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
{
if (GetDoc()->GetOnlineSpell())
{
- rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, sal_True));
+ rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, true));
}
else
{
- rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, sal_False));
+ rSet.Put(SfxBoolItem(SID_AUTOSPELL_CHECK, false));
}
}
@@ -1002,10 +996,11 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
{
const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection();
- if( !( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) ||
- pFldItem->GetField()->ISA( SvxAuthorField ) ||
- pFldItem->GetField()->ISA( SvxExtFileField ) ||
- pFldItem->GetField()->ISA( SvxExtTimeField ) ) ) )
+ if( !( pFldItem && (
+ dynamic_cast< const SvxDateField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxAuthorField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtFileField* >(pFldItem->GetField()) ||
+ dynamic_cast< const SvxExtTimeField* >(pFldItem->GetField()) ) ) )
{
rSet.DisableItem( SID_MODIFY_FIELD );
}
@@ -1013,9 +1008,9 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_EXPAND_PAGE))
{
- sal_Bool bDisable = sal_True;
- sal_uInt16 i = 0;
- sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
+ bool bDisable = true;
+ sal_uInt32 i = 0;
+ sal_uInt32 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
pOlView->SetSelectedPages();
while (i < nCount && bDisable)
@@ -1060,9 +1055,9 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_SUMMARY_PAGE))
{
- sal_Bool bDisable = sal_True;
- sal_uInt16 i = 0;
- sal_uInt16 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
+ bool bDisable = true;
+ sal_uInt32 i = 0;
+ sal_uInt32 nCount = GetDoc()->GetSdPageCount(PK_STANDARD);
pOlView->SetSelectedPages();
while (i < nCount && bDisable)
@@ -1075,7 +1070,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
if (pObj && !pObj->IsEmptyPresObj())
{
- bDisable = sal_False;
+ bDisable = false;
}
}
@@ -1110,15 +1105,15 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
// Starten der Praesentation moeglich?
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PRESENTATION ) )
{
- sal_Bool bDisable = sal_True;
- sal_uInt16 nCount = GetDoc()->GetSdPageCount( PK_STANDARD );
+ bool bDisable = true;
+ sal_uInt32 nCount = GetDoc()->GetSdPageCount( PK_STANDARD );
- for( sal_uInt16 i = 0; i < nCount && bDisable; i++ )
+ for( sal_uInt32 i = 0; i < nCount && bDisable; i++ )
{
SdPage* pPage = GetDoc()->GetSdPage(i, PK_STANDARD);
if( !pPage->IsExcluded() )
- bDisable = sal_False;
+ bDisable = false;
}
if( bDisable || GetDocSh()->IsPreview())
{
@@ -1157,7 +1152,7 @@ long OutlineViewShell::VirtHScrollHdl(ScrollBar* pHScroll)
pOutlinerView->HideCursor();
pOutlinerView->Scroll(-nDelta, 0);
- pOutlinerView->ShowCursor(sal_False);
+ pOutlinerView->ShowCursor(false);
pOlView->InvalidateSlideNumberArea();
return 0;
@@ -1187,7 +1182,7 @@ long OutlineViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
pOutlinerView->HideCursor();
pOutlinerView->Scroll(0, -nDelta);
- pOutlinerView->ShowCursor(sal_False);
+ pOutlinerView->ShowCursor(false);
pOlView->InvalidateSlideNumberArea();
@@ -1201,10 +1196,10 @@ long OutlineViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
|*
\************************************************************************/
-sal_uInt16 OutlineViewShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing )
+sal_uInt16 OutlineViewShell::PrepareClose( bool bUI, bool bForBrowsing )
{
- if( ViewShell::PrepareClose(bUI, bForBrowsing) != sal_True )
- return sal_False;
+ if( !ViewShell::PrepareClose(bUI, bForBrowsing) )
+ return false;
return pOlView == NULL || pOlView->PrepareClose(bUI);
}
@@ -1241,9 +1236,9 @@ void OutlineViewShell::SetZoom(long nZoom)
|*
\************************************************************************/
-void OutlineViewShell::SetZoomRect(const Rectangle& rZoomRect)
+void OutlineViewShell::SetZoomRange(const basegfx::B2DRange& rZoomRange)
{
- ViewShell::SetZoomRect(rZoomRect);
+ ViewShell::SetZoomRange(rZoomRange);
::sd::Window* pWindow = mpContentWindow.get();
if (pWindow)
@@ -1323,9 +1318,9 @@ void OutlineViewShell::ReadFrameViewData(FrameView* pView)
::Outliner* pOutl = pOlView->GetOutliner();
if ( pView->IsNoAttribs() )
- pOutl->SetFlatMode( sal_True ); // Attribut-Darstellung ausschalten
+ pOutl->SetFlatMode( true ); // Attribut-Darstellung ausschalten
else
- pOutl->SetFlatMode( sal_False ); // Attribut-Darstellung einschalten
+ pOutl->SetFlatMode( false ); // Attribut-Darstellung einschalten
sal_uLong nCntrl = pOutl->GetControlWord();
@@ -1334,7 +1329,7 @@ void OutlineViewShell::ReadFrameViewData(FrameView* pView)
else
pOutl->SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS); // Farbansicht einschalten
- sal_uInt16 nPage = mpFrameView->GetSelectedPage();
+ sal_uInt32 nPage = mpFrameView->GetSelectedPage();
pLastPage = GetDoc()->GetSdPage( nPage, PK_STANDARD );
pOlView->SetActualPage(pLastPage);
}
@@ -1352,15 +1347,15 @@ void OutlineViewShell::WriteFrameViewData()
::Outliner* pOutl = pOlView->GetOutliner();
sal_uLong nCntrl = pOutl->GetControlWord();
- sal_Bool bNoColor = sal_False;
+ bool bNoColor = false;
if (nCntrl & EE_CNTRL_NOCOLORS)
- bNoColor = sal_True;
+ bNoColor = true;
mpFrameView->SetNoColors(bNoColor);
mpFrameView->SetNoAttribs( pOutl->IsFlatMode() );
SdPage* pActualPage = pOlView->GetActualPage();
DBG_ASSERT(pActualPage, "No current page");
if( pActualPage )
- mpFrameView->SetSelectedPage((pActualPage->GetPageNum() - 1) / 2);
+ mpFrameView->SetSelectedPage((pActualPage->GetPageNumber() - 1) / 2);
}
@@ -1444,7 +1439,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
if( pFirstPara == pLastPara )
{
// wieviele Seiten sind vor der selektierten Seite?
- sal_uLong nPos = 0L;
+ sal_uInt32 nPos = 0;
while( pFirstPara )
{
pFirstPara = pOlView->GetPrevTitle( pFirstPara );
@@ -1455,7 +1450,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
if( nPos >= GetDoc()->GetSdPageCount( PK_STANDARD ) )
nPos = 0;
- SdrPage* pPage = GetDoc()->GetSdPage( (sal_uInt16) nPos, PK_STANDARD );
+ SdrPage* pPage = GetDoc()->GetSdPage( nPos, PK_STANDARD );
aPageStr = String(SdResId( STR_SD_PAGE ));
aPageStr += sal_Unicode(' ');
@@ -1515,9 +1510,9 @@ void OutlineViewShell::Command( const CommandEvent& rCEvt, ::sd::Window* pWin )
|*
\************************************************************************/
-sal_Bool OutlineViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
+bool OutlineViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
OutlineViewPageChangesGuard aGuard(pOlView);
if (pWin == NULL && HasCurrentFunction())
@@ -1590,7 +1585,7 @@ Size OutlineViewShell::GetOptimalSizePixel() const
|*
\************************************************************************/
-String OutlineViewShell::GetSelectionText(sal_Bool bCompleteWords)
+String OutlineViewShell::GetSelectionText(bool bCompleteWords)
{
String aStrSelection;
::Outliner* pOl = pOlView->GetOutliner();
@@ -1623,9 +1618,9 @@ String OutlineViewShell::GetSelectionText(sal_Bool bCompleteWords)
|*
\************************************************************************/
-sal_Bool OutlineViewShell::HasSelection(sal_Bool bText) const
+bool OutlineViewShell::HasSelection(bool bText) const
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if (bText)
{
@@ -1633,7 +1628,7 @@ sal_Bool OutlineViewShell::HasSelection(sal_Bool bText) const
if (pOutlinerView && pOutlinerView->GetSelected().Len() != 0)
{
- bReturn = sal_True;
+ bReturn = true;
}
}
@@ -1738,7 +1733,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet )
nWhich = aIter.NextWhich();
}
- rSet.Put( aAllSet, sal_False );
+ rSet.Put( aAllSet, false );
}
@@ -1788,7 +1783,7 @@ SdPage* OutlineViewShell::GetActualPage()
}
-void OutlineViewShell::UpdatePreview( SdPage* pPage, sal_Bool )
+void OutlineViewShell::UpdatePreview( SdPage* pPage, bool )
{
const bool bNewPage = pPage != pLastPage;
pLastPage = pPage;
@@ -1828,7 +1823,7 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
{
DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateTitleObject(), no undo for model change!?" );
pTO = pOlView->CreateTitleTextObject(pPage);
- bNewObject = sal_True;
+ bNewObject = true;
}
// if we have a title object and a text, set the text
@@ -1849,7 +1844,7 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
pTO->SetOutlinerParaObject( pOPO );
- pTO->SetEmptyPresObj( sal_False );
+ pTO->SetEmptyPresObj( false );
pTO->ActionChanged();
}
}
@@ -1869,7 +1864,7 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
if( pOlView->isRecordingUndo() )
pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
pPage->RestoreDefaultText( pTO );
- pTO->SetEmptyPresObj(sal_True);
+ pTO->SetEmptyPresObj(true);
pTO->ActionChanged();
}
}
@@ -1879,7 +1874,7 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
// outline object is not part of the layout, delete it
if( pOlView->isRecordingUndo() )
pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoRemoveObject(*pTO));
- pPage->RemoveObject(pTO->GetOrdNum());
+ pPage->RemoveObjectFromSdrObjList(pTO->GetNavigationPosition());
}
}
@@ -1904,7 +1899,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
OutlinerParaObject* pOPO = NULL;
SdrTextObj* pTO = NULL;
- sal_Bool bNewObject = sal_False;
+ bool bNewObject = false;
sal_uInt16 eOutlinerMode = OUTLINERMODE_TITLEOBJECT;
pTO = (SdrTextObj*)pPage->GetPresObj( PRESOBJ_TEXT );
@@ -1939,7 +1934,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
if( !pTO )
{
pTO = pOlView->CreateOutlineTextObject( pPage );
- bNewObject = sal_True;
+ bNewObject = true;
}
// Seitenobjekt, Gliederungstext im Outliner:
@@ -1959,7 +1954,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
pTO->SetOutlinerParaObject( pOPO );
- pTO->SetEmptyPresObj( sal_False );
+ pTO->SetEmptyPresObj( false );
pTO->ActionChanged();
}
}
@@ -1979,7 +1974,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
if( pOlView->isRecordingUndo() )
pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTO,0));
pPage->RestoreDefaultText( pTO );
- pTO->SetEmptyPresObj(sal_True);
+ pTO->SetEmptyPresObj(true);
pTO->ActionChanged();
}
}
@@ -1988,7 +1983,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
DBG_ASSERT( pOlView->isRecordingUndo(), "sd::OutlineViewShell::UpdateOutlineObject(), no undo for model change!?" );
if( pOlView->isRecordingUndo() )
pOlView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoRemoveObject(*pTO));
- pPage->RemoveObject(pTO->GetOrdNum());
+ pPage->RemoveObjectFromSdrObjList(pTO->GetNavigationPosition());
}
}
@@ -2009,50 +2004,50 @@ sal_uLong OutlineViewShell::Read(SvStream& rInput, const String& rBaseURL, sal_u
::Outliner* pOutl = pOlView->GetOutliner();
{
- OutlineViewPageChangesGuard aGuard( pOlView );
- OutlineViewModelChangeGuard aGuard2( *pOlView );
+ OutlineViewPageChangesGuard aGuard( pOlView );
+ OutlineViewModelChangeGuard aGuard2( *pOlView );
- bRet = pOutl->Read( rInput, rBaseURL, eFormat, GetDocSh()->GetHeaderAttributes() );
+ bRet = pOutl->Read( rInput, rBaseURL, eFormat, GetDocSh()->GetHeaderAttributes() );
- SdPage* pPage = GetDoc()->GetSdPage( GetDoc()->GetSdPageCount(PK_STANDARD) - 1, PK_STANDARD );;
- SfxStyleSheet* pTitleSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
- SfxStyleSheet* pOutlSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
+ SdPage* pPage = GetDoc()->GetSdPage( GetDoc()->GetSdPageCount(PK_STANDARD) - 1, PK_STANDARD );
+ SfxStyleSheet* pTitleSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
+ SfxStyleSheet* pOutlSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
- sal_uInt16 nParaCount = (sal_uInt16)pOutl->GetParagraphCount();
- if ( nParaCount > 0 )
- {
- for ( sal_uInt16 nPara = 0; nPara < nParaCount; nPara++ )
+ sal_uInt16 nParaCount = (sal_uInt16)pOutl->GetParagraphCount();
+ if ( nParaCount > 0 )
{
- pOlView->UpdateParagraph( nPara );
+ for ( sal_uInt16 nPara = 0; nPara < nParaCount; nPara++ )
+ {
+ pOlView->UpdateParagraph( nPara );
- sal_Int16 nDepth = pOutl->GetDepth( nPara );
+ sal_Int16 nDepth = pOutl->GetDepth( nPara );
- if( (nDepth == 0) || !nPara )
- {
- Paragraph* pPara = pOutl->GetParagraph( nPara );
- pOutl->SetDepth(pPara, -1);
- pOutl->SetParaFlag(pPara, PARAFLAG_ISPAGE);
+ if( (nDepth == 0) || !nPara )
+ {
+ Paragraph* pPara = pOutl->GetParagraph( nPara );
+ pOutl->SetDepth(pPara, -1);
+ pOutl->SetParaFlag(pPara, PARAFLAG_ISPAGE);
- pOutl->SetStyleSheet( nPara, pTitleSheet );
+ pOutl->SetStyleSheet( nPara, pTitleSheet );
- if( nPara ) // first slide already exists
- pOlView->InsertSlideForParagraph( pPara );
- }
- else
- {
- pOutl->SetDepth( pOutl->GetParagraph( nPara ), nDepth - 1 );
- String aStyleSheetName( pOutlSheet->GetName() );
- aStyleSheetName.Erase( aStyleSheetName.Len() - 1, 1 );
- aStyleSheetName += String::CreateFromInt32( nDepth );
- SfxStyleSheetBasePool* pStylePool = GetDoc()->GetStyleSheetPool();
- SfxStyleSheet* pStyle = (SfxStyleSheet*) pStylePool->Find( aStyleSheetName, pOutlSheet->GetFamily() );
- DBG_ASSERT( pStyle, "AutoStyleSheetName - Style not found!" );
- if ( pStyle )
- pOutl->SetStyleSheet( nPara, pStyle );
+ if( nPara ) // first slide already exists
+ pOlView->InsertSlideForParagraph( pPara );
+ }
+ else
+ {
+ pOutl->SetDepth( pOutl->GetParagraph( nPara ), nDepth - 1 );
+ String aStyleSheetName( pOutlSheet->GetName() );
+ aStyleSheetName.Erase( aStyleSheetName.Len() - 1, 1 );
+ aStyleSheetName += String::CreateFromInt32( nDepth );
+ SfxStyleSheetBasePool* pStylePool = GetDoc()->GetStyleSheetPool();
+ SfxStyleSheet* pStyle = (SfxStyleSheet*) pStylePool->Find( aStyleSheetName, pOutlSheet->GetFamily() );
+ DBG_ASSERT( pStyle, "AutoStyleSheetName - Style not found!" );
+ if ( pStyle )
+ pOutl->SetStyleSheet( nPara, pStyle );
+ }
}
}
}
- }
pOutl->GetUndoManager().Clear();
@@ -2144,11 +2139,11 @@ void OutlineViewShell::GetState (SfxItemSet& rSet)
void OutlineViewShell::SetCurrentPage (SdPage* pPage)
{
// Adapt the selection of the model.
- for (sal_uInt16 i=0; i<GetDoc()->GetSdPageCount(PK_STANDARD); i++)
+ for (sal_uInt32 i=0; i<GetDoc()->GetSdPageCount(PK_STANDARD); i++)
GetDoc()->SetSelected(
GetDoc()->GetSdPage(i, PK_STANDARD),
- sal_False);
- GetDoc()->SetSelected (pPage, sal_True);
+ false);
+ GetDoc()->SetSelected (pPage, true);
DrawController& rController(GetViewShellBase().GetDrawController());
rController.FireSelectionChangeListener();
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 0de39dce73d3..047b91bb7290 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -97,8 +97,6 @@ struct SdParaAndPos
sal_uInt16 nPos;
};
-TYPEINIT1( OutlineView, ::sd::View );
-
/*************************************************************************
|*
|* Konstruktor
@@ -106,26 +104,26 @@ TYPEINIT1( OutlineView, ::sd::View );
\************************************************************************/
OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewShell* pOutlineViewSh)
-: ::sd::View(pDocSh->GetDoc(), pWindow, pOutlineViewSh)
+: ::sd::View(*pDocSh->GetDoc(), pWindow, pOutlineViewSh)
, mpOutlineViewShell(pOutlineViewSh)
-, mpOutliner( mpDoc->GetOutliner(sal_True) )
+, mpOutliner( mpDoc->GetOutliner(true) )
, mpOldParaOrder(NULL)
, mpSelectedParas(NULL)
, mnPagesToProcess(0)
, mnPagesProcessed(0)
-, mbFirstPaint(sal_True)
+, mbFirstPaint(true)
, mpProgress(NULL)
, mbHighContrastMode( false )
, maDocColor( COL_WHITE )
, mnPageNumberWidthPixel( 0 )
, maLRSpaceItem( 0, 0, 2000, 0, EE_PARA_OUTLLRSPACE )
{
- sal_Bool bInitOutliner = sal_False;
+ bool bInitOutliner = false;
if (mpOutliner->GetViewCount() == 0)
{
// Outliner initialisieren: Referenz-Device setzen
- bInitOutliner = sal_True;
+ bInitOutliner = true;
mpOutliner->Init( OUTLINERMODE_OUTLINEVIEW );
/*
SfxStyleSheet* pTitleSheet = mpDoc->GetSdPage( 0, PK_STANDARD )->GetStyleSheetForPresObj( PRESOBJ_TITLE );
@@ -151,8 +149,8 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
aBulletFont.SetUnderline(UNDERLINE_NONE);
aBulletFont.SetStrikeout(STRIKEOUT_NONE);
aBulletFont.SetItalic(ITALIC_NONE);
- aBulletFont.SetOutline(sal_False);
- aBulletFont.SetShadow(sal_False);
+ aBulletFont.SetOutline(false);
+ aBulletFont.SetShadow(false);
aFormat.SetBulletFont( &aBulletFont );
aFormat.SetBulletChar( 0xE011 ); // StarBats: 0xF000 + 114
mpOutliner->OverwriteLevel0Bullet( aFormat );
@@ -172,7 +170,7 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
mpOutlinerView[0] = new OutlinerView(mpOutliner, pWindow);
Rectangle aNullRect;
mpOutlinerView[0]->SetOutputArea(aNullRect);
- mpOutliner->SetUpdateMode(sal_False);
+ mpOutliner->SetUpdateMode(false);
mpOutliner->InsertView(mpOutlinerView[0], LIST_APPEND);
onUpdateStyleSettings( true );
@@ -201,9 +199,8 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh
maBulletFont.SetUnderline(UNDERLINE_NONE);
maBulletFont.SetStrikeout(STRIKEOUT_NONE);
maBulletFont.SetItalic(ITALIC_NONE);
- maBulletFont.SetOutline(sal_False);
- maBulletFont.SetShadow(sal_False);
-
+ maBulletFont.SetOutline(false);
+ maBulletFont.SetShadow(false);
Reference<XFrame> xFrame (mpOutlineViewShell->GetViewShellBase().GetFrame()->GetTopFrame().GetFrameInterface(), UNO_QUERY);
@@ -250,7 +247,7 @@ OutlineView::~OutlineView()
// Outliner deinitialisieren: Farbdarstellung einschalten
ResetLinks();
sal_uLong nCntrl = mpOutliner->GetControlWord();
- mpOutliner->SetUpdateMode(sal_False); // sonst wird bei SetControlWord gezeichnet
+ mpOutliner->SetUpdateMode(false); // sonst wird bei SetControlWord gezeichnet
mpOutliner->SetControlWord(nCntrl & ~EE_CNTRL_NOCOLORS);
SvtAccessibilityOptions aOptions;
mpOutliner->ForceAutoColor( aOptions.GetIsAutomaticFontColor() );
@@ -338,7 +335,7 @@ void OutlineView::Paint(const Rectangle& rRect, ::sd::Window* pWin)
pWin->SetFont( aOldFont );
*/
- mbFirstPaint = sal_False;
+ mbFirstPaint = false;
}
}
@@ -380,8 +377,8 @@ void OutlineView::AdjustPosSizePixel(const Point &,const Size &,::sd::Window*)
void OutlineView::AddWindowToPaintView(OutputDevice* pWin)
{
- sal_Bool bAdded = sal_False;
- sal_Bool bValidArea = sal_False;
+ bool bAdded = false;
+ bool bValidArea = false;
Rectangle aOutputArea;
const Color aWhiteColor( COL_WHITE );
sal_uInt16 nView = 0;
@@ -393,7 +390,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin)
mpOutlinerView[nView] = new OutlinerView(mpOutliner, dynamic_cast< ::sd::Window* >(pWin));
mpOutlinerView[nView]->SetBackgroundColor( aWhiteColor );
mpOutliner->InsertView(mpOutlinerView[nView], LIST_APPEND);
- bAdded = sal_True;
+ bAdded = true;
if (bValidArea)
{
@@ -403,7 +400,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin)
else if (!bValidArea)
{
aOutputArea = mpOutlinerView[nView]->GetOutputArea();
- bValidArea = sal_True;
+ bValidArea = true;
}
nView++;
@@ -423,7 +420,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin)
void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin)
{
- sal_Bool bRemoved = sal_False;
+ bool bRemoved = false;
sal_uInt16 nView = 0;
::Window* pWindow;
@@ -438,7 +435,7 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin)
mpOutliner->RemoveView( mpOutlinerView[nView] );
delete mpOutlinerView[nView];
mpOutlinerView[nView] = NULL;
- bRemoved = sal_True;
+ bRemoved = true;
}
}
@@ -560,8 +557,8 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
mpOutliner->SetParaFlag( pPara, PARAFLAG_ISPAGE );
// wieviele Titel sind vor dem neuen Titelabsatz?
- sal_uLong nExample = 0L; // Position der "Vorbild"seite
- sal_uLong nTarget = 0L; // Einfuegeposition
+ sal_uInt32 nExample = 0; // Position der "Vorbild"seite
+ sal_uInt32 nTarget = 0; // Einfuegeposition
while(pPara)
{
pPara = GetPrevTitle(pPara);
@@ -602,13 +599,13 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
**********************************************************************/
// diese Seite hat Vorbildfunktion
- SdPage* pExample = (SdPage*)mpDoc->GetSdPage((sal_uInt16)nExample, PK_STANDARD);
- SdPage* pPage = (SdPage*)mpDoc->AllocPage(sal_False);
+ SdPage* pExample = (SdPage*)mpDoc->GetSdPage(nExample, PK_STANDARD);
+ SdPage* pPage = (SdPage*)mpDoc->AllocPage(false);
pPage->SetLayoutName(pExample->GetLayoutName());
// einfuegen (Seite)
- mpDoc->InsertPage(pPage, (sal_uInt16)(nTarget) * 2 + 1);
+ mpDoc->InsertPage(pPage, nTarget * 2 + 1);
if( isRecordingUndo() )
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewPage(*pPage));
@@ -616,11 +613,11 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
pPage->TRG_SetMasterPage(pExample->TRG_GetMasterPage());
// Seitengroesse setzen
- pPage->SetSize(pExample->GetSize());
- pPage->SetBorder( pExample->GetLftBorder(),
- pExample->GetUppBorder(),
- pExample->GetRgtBorder(),
- pExample->GetLwrBorder() );
+ pPage->SetPageScale(pExample->GetPageScale());
+ pPage->SetPageBorder( pExample->GetLeftPageBorder(),
+ pExample->GetTopPageBorder(),
+ pExample->GetRightPageBorder(),
+ pExample->GetBottomPageBorder() );
// neue Praesentationsobjekte anlegen (auf <Titel> oder
// <Titel mit Untertitel> folgt <Titel mit Gliederung>, ansonsten
@@ -629,25 +626,25 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
if (eAutoLayout == AUTOLAYOUT_TITLE ||
eAutoLayout == AUTOLAYOUT_ONLY_TITLE)
{
- pPage->SetAutoLayout(AUTOLAYOUT_ENUM, sal_True);
+ pPage->SetAutoLayout(AUTOLAYOUT_ENUM, true);
}
else
{
- pPage->SetAutoLayout(pExample->GetAutoLayout(), sal_True);
+ pPage->SetAutoLayout(pExample->GetAutoLayout(), true);
}
/**********************************************************************
|* jetzt die Notizseite
\*********************************************************************/
- pExample = (SdPage*)mpDoc->GetSdPage((sal_uInt16)nExample, PK_NOTES);
- SdPage* pNotesPage = (SdPage*)mpDoc->AllocPage(sal_False);
+ pExample = (SdPage*)mpDoc->GetSdPage(nExample, PK_NOTES);
+ SdPage* pNotesPage = (SdPage*)mpDoc->AllocPage(false);
pNotesPage->SetLayoutName(pExample->GetLayoutName());
pNotesPage->SetPageKind(PK_NOTES);
// einfuegen (Notizseite)
- mpDoc->InsertPage(pNotesPage, (sal_uInt16)(nTarget) * 2 + 2);
+ mpDoc->InsertPage(pNotesPage, nTarget * 2 + 2);
if( isRecordingUndo() )
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewPage(*pNotesPage));
@@ -655,14 +652,14 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara )
pNotesPage->TRG_SetMasterPage(pExample->TRG_GetMasterPage());
// Seitengroesse setzen, es muss bereits eine Seite vorhanden sein
- pNotesPage->SetSize(pExample->GetSize());
- pNotesPage->SetBorder( pExample->GetLftBorder(),
- pExample->GetUppBorder(),
- pExample->GetRgtBorder(),
- pExample->GetLwrBorder() );
+ pNotesPage->SetPageScale(pExample->GetPageScale());
+ pNotesPage->SetPageBorder( pExample->GetLeftPageBorder(),
+ pExample->GetTopPageBorder(),
+ pExample->GetRightPageBorder(),
+ pExample->GetBottomPageBorder() );
// neue Praesentationsobjekte anlegen
- pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), sal_True);
+ pNotesPage->SetAutoLayout(pExample->GetAutoLayout(), true);
mpOutliner->UpdateFields();
@@ -685,7 +682,7 @@ IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner )
if( pOutliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
{
// wieviele Titel sind vor dem fraglichen Titelabsatz?
- sal_uLong nPos = 0L;
+ sal_uInt32 nPos = 0;
while(pPara)
{
pPara = GetPrevTitle(pPara);
@@ -693,7 +690,7 @@ IMPL_LINK( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner )
}
// Seite und Notizseite loeschen
- sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1;
+ sal_uInt32 nAbsPos = nPos * 2 + 1;
SdrPage* pPage = mpDoc->GetPage(nAbsPos);
if( isRecordingUndo() )
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
@@ -783,7 +780,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
}
else
{
- mpDocSh->SetWaitCursor( sal_True );
+ mpDocSh->SetWaitCursor( true );
}
delete pList;
}
@@ -808,7 +805,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
mpProgress = NULL;
}
else
- mpDocSh->SetWaitCursor( sal_False );
+ mpDocSh->SetWaitCursor( false );
mnPagesToProcess = 0;
mnPagesProcessed = 0;
@@ -830,7 +827,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
}
// Seite und Notizseite loeschen
- sal_uInt16 nAbsPos = (sal_uInt16)nPos * 2 + 1;
+ sal_uInt32 nAbsPos = nPos * 2 + 1;
SdrPage* pPage = mpDoc->GetPage(nAbsPos);
if( isRecordingUndo() )
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeletePage(*pPage));
@@ -881,7 +878,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
if(nPos >= 0)
{
- SdPage*pPage = (SdPage*)mpDoc->GetSdPage( (sal_uInt16) nPos, PK_STANDARD);
+ SdPage*pPage = (SdPage*)mpDoc->GetSdPage( (sal_uInt32) nPos, PK_STANDARD);
if(pPage && pPage->GetPresObj(PRESOBJ_TEXT))
pOutliner->SetDepth( pPara, 0 );
@@ -901,7 +898,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
if( nPos >= 0 )
{
- SdPage* pPage = (SdPage*) mpDoc->GetSdPage( (sal_uInt16) nPos, PK_STANDARD );
+ SdPage* pPage = (SdPage*) mpDoc->GetSdPage( (sal_uInt32) nPos, PK_STANDARD );
if( pPage )
{
@@ -964,22 +961,16 @@ IMPL_LINK( OutlineView, StatusEventHdl, EditStatus *, EMPTYARG )
{
::sd::Window* pWin = mpOutlineViewShell->GetActiveWindow();
OutlinerView* pOutlinerView = GetViewByWindow(pWin);
- Rectangle aVis = pOutlinerView->GetVisArea();
-
-// sal_uLong nWidth = ((SdPage*)mpDoc->GetSdPage(0, PK_STANDARD))->GetSize().Width();
- sal_uLong nWidth = OUTLINE_PAPERWIDTH;
- Rectangle aText = Rectangle(Point(0,0),
- Size(nWidth,
- mpOutliner->GetTextHeight()));
- Rectangle aWin(Point(0,0), pWin->GetOutputSizePixel());
- aWin = pWin->PixelToLogic(aWin);
+ const Rectangle aVis(pOutlinerView->GetVisArea());
if (!aVis.IsEmpty()) // nicht beim Oeffnen
{
- aText.Bottom() += aWin.GetHeight();
+ const Size aTextSize(OUTLINE_PAPERWIDTH, mpOutliner->GetTextHeight() + pWin->GetLogicVector().getY());
- mpOutlineViewShell->InitWindows(Point(0,0), aText.GetSize(),
- Point(aVis.TopLeft()));
+ mpOutlineViewShell->InitWindows(
+ basegfx::B2DPoint(0.0, 0.0),
+ basegfx::B2DVector(aTextSize.Width(), aTextSize.Height()),
+ basegfx::B2DPoint(aVis.Left(), aVis.Top()));
mpOutlineViewShell->UpdateScrollBars();
}
@@ -1035,7 +1026,7 @@ IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner )
// Die zu den selektierten Absaetzen auf Ebene 0 gehoerenden Seiten
// selektieren
- sal_uInt16 nPos = 0;
+ sal_uInt32 nPos = 0;
sal_uLong nParaPos = 0;
pPara = pOutliner->GetParagraph( 0 );
@@ -1045,10 +1036,10 @@ IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner )
{
mpOldParaOrder->Insert(pPara, LIST_APPEND);
SdPage* pPage = mpDoc->GetSdPage(nPos, PK_STANDARD);
- pPage->SetSelected(sal_False);
+ pPage->SetSelected(false);
if (mpSelectedParas->Seek(pPara)) // selektiert?
{
- pPage->SetSelected(sal_True);
+ pPage->SetSelected(true);
}
nPos++;
}
@@ -1076,7 +1067,7 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner )
Paragraph* pSearchIt = (Paragraph*)mpSelectedParas->First();
// den ersten der selektierten Paragraphen in der neuen Ordnung suchen
- sal_uInt16 nPosNewOrder = 0;
+ sal_uInt32 nPosNewOrder = 0;
sal_uLong nParaPos = 0;
Paragraph* pPara = pOutliner->GetParagraph( 0 );
Paragraph* pPrev = NULL;
@@ -1090,26 +1081,26 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner )
pPara = pOutliner->GetParagraph( ++nParaPos );
}
- sal_uInt16 nPos = nPosNewOrder; // nPosNewOrder nicht veraendern
+ sal_uInt32 nPos = nPosNewOrder; // nPosNewOrder nicht veraendern
if (nPos == 0)
{
- nPos = (sal_uInt16)-1; // vor der ersten Seite einfuegen
+ nPos = (sal_uInt32)-1; // vor der ersten Seite einfuegen
}
else
{
// den Vorgaenger in der alten Ordnung suchen
- nPos = (sal_uInt16)mpOldParaOrder->GetPos(pPrev);
- DBG_ASSERT(nPos != 0xffff, "Absatz nicht gefunden");
+ nPos = (sal_uInt32)mpOldParaOrder->GetPos(pPrev);
+ DBG_ASSERT(nPos != 0xffffffff, "Absatz nicht gefunden");
}
mpDoc->MovePages(nPos);
// die Seiten wieder deselektieren
- sal_uInt16 nPageCount = (sal_uInt16)mpSelectedParas->Count();
+ sal_uInt32 nPageCount = mpSelectedParas->Count();
while (nPageCount)
{
SdPage* pPage = mpDoc->GetSdPage(nPosNewOrder, PK_STANDARD);
- pPage->SetSelected(sal_False);
+ pPage->SetSelected(false);
nPosNewOrder++;
nPageCount--;
}
@@ -1190,7 +1181,7 @@ SdrTextObj* OutlineView::CreateTitleTextObject(SdPage* pPage)
{
// we already have a layout with a title but the title
// object was deleted, create a new one
- pPage->InsertAutoLayoutShape( 0, PRESOBJ_TITLE, false, pPage->GetTitleRect(), true );
+ pPage->InsertAutoLayoutShape( 0, PRESOBJ_TITLE, false, pPage->GetTitleRange(), true );
}
return GetTitleTextObject(pPage);
@@ -1226,14 +1217,14 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage)
// object was deleted, create a new one
pPage->InsertAutoLayoutShape( 0,
(eNewLayout == AUTOLAYOUT_TITLE) ? PRESOBJ_TEXT : PRESOBJ_OUTLINE,
- false, pPage->GetLayoutRect(), true );
+ false, pPage->GetLayoutRange(), true );
}
return GetOutlineTextObject(pPage);
}
/** updates draw model with all changes from outliner model */
-sal_Bool OutlineView::PrepareClose(sal_Bool)
+bool OutlineView::PrepareClose(bool)
{
::sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager());
if (pDocUndoMgr != NULL)
@@ -1245,8 +1236,8 @@ sal_Bool OutlineView::PrepareClose(sal_Bool)
BegUndo(aUndoStr);
UpdateDocument();
EndUndo();
- mpDoc->SetSelected(GetActualPage(), sal_True);
- return sal_True;
+ mpDoc->SetSelected(GetActualPage(), true);
+ return true;
}
@@ -1256,16 +1247,16 @@ sal_Bool OutlineView::PrepareClose(sal_Bool)
|*
\************************************************************************/
-sal_Bool OutlineView::SetAttributes(const SfxItemSet& rSet, sal_Bool )
+bool OutlineView::SetAttributes(const SfxItemSet& rSet, bool )
{
- sal_Bool bOk = sal_False;
+ bool bOk = false;
OutlinerView* pOlView = GetViewByWindow(mpOutlineViewShell->GetActiveWindow());
if (pOlView)
{
pOlView->SetAttribs(rSet);
- bOk = sal_True;
+ bOk = true;
}
mpOutlineViewShell->Invalidate (SID_PREVIEW_STATE);
@@ -1279,29 +1270,29 @@ sal_Bool OutlineView::SetAttributes(const SfxItemSet& rSet, sal_Bool )
|*
\************************************************************************/
-sal_Bool OutlineView::GetAttributes( SfxItemSet& rTargetSet, sal_Bool ) const
+bool OutlineView::GetAttributes( SfxItemSet& rTargetSet, bool ) const
{
OutlinerView* pOlView = GetViewByWindow(
mpOutlineViewShell->GetActiveWindow());
DBG_ASSERT(pOlView, "keine OutlinerView gefunden");
- rTargetSet.Put( pOlView->GetAttribs(), sal_False );
- return sal_True;
+ rTargetSet.Put( pOlView->GetAttribs(), false );
+ return true;
}
/** creates outliner model from draw model */
void OutlineView::FillOutliner()
{
mpOutliner->GetUndoManager().Clear();
- mpOutliner->EnableUndo(sal_False);
+ mpOutliner->EnableUndo(false);
ResetLinks();
mpOutliner->SetUpdateMode(false);
Paragraph* pTitleToSelect = NULL;
- sal_uLong nPageCount = mpDoc->GetSdPageCount(PK_STANDARD);
+ sal_uInt32 nPageCount = mpDoc->GetSdPageCount(PK_STANDARD);
// fill outliner with paragraphs from slides title & (outlines|subtitles)
- for (sal_uInt16 nPage = 0; nPage < nPageCount; nPage++)
+ for (sal_uInt32 nPage = 0; nPage < nPageCount; nPage++)
{
SdPage* pPage = (SdPage*)mpDoc->GetSdPage(nPage, PK_STANDARD);
Paragraph * pPara = NULL;
@@ -1313,8 +1304,8 @@ void OutlineView::FillOutliner()
OutlinerParaObject* pOPO = pTO->GetOutlinerParaObject();
if (pOPO)
{
- sal_Bool bVertical = pOPO->IsVertical();
- pOPO->SetVertical( sal_False );
+ bool bVertical = pOPO->IsVertical();
+ pOPO->SetVertical( false );
mpOutliner->AddText(*pOPO);
pOPO->SetVertical( bVertical );
pPara = mpOutliner->GetParagraph( mpOutliner->GetParagraphCount()-1 );
@@ -1356,8 +1347,8 @@ void OutlineView::FillOutliner()
if (pOPO)
{
sal_uInt16 nParaCount1 = (sal_uInt16)mpOutliner->GetParagraphCount();
- sal_Bool bVertical = pOPO->IsVertical();
- pOPO->SetVertical( sal_False );
+ bool bVertical = pOPO->IsVertical();
+ pOPO->SetVertical( false );
mpOutliner->AddText(*pOPO);
pOPO->SetVertical( bVertical );
@@ -1379,17 +1370,16 @@ void OutlineView::FillOutliner()
// place cursor at the start
Paragraph* pFirstPara = mpOutliner->GetParagraph( 0 );
- mpOutlinerView[0]->Select( pFirstPara, sal_True, sal_False );
- mpOutlinerView[0]->Select( pFirstPara, sal_False, sal_False );
+ mpOutlinerView[0]->Select( pFirstPara, true, false );
+ mpOutlinerView[0]->Select( pFirstPara, false, false );
// select title of slide that was selected
if (pTitleToSelect)
- mpOutlinerView[0]->Select(pTitleToSelect, sal_True, sal_False);
+ mpOutlinerView[0]->Select(pTitleToSelect, true, false);
SetLinks();
- mpOutliner->EnableUndo(sal_True);
-
+ mpOutliner->EnableUndo(true);
mpOutliner->SetUpdateMode(true);
}
@@ -1470,7 +1460,7 @@ SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara )
}
if( nPageToSelect < (sal_uInt32)mpDoc->GetSdPageCount( PK_STANDARD ) )
- return static_cast< SdPage* >( mpDoc->GetSdPage( (sal_uInt16)nPageToSelect, PK_STANDARD) );
+ return static_cast< SdPage* >( mpDoc->GetSdPage( nPageToSelect, PK_STANDARD) );
else
return 0;
}
@@ -1479,7 +1469,7 @@ Paragraph* OutlineView::GetParagraphForPage( ::Outliner* pOutl, SdPage* pPage )
{
// get the number of paragraphs with ident 0 we need to skip before
// we finde the actual page
- sal_uInt32 nPagesToSkip = (pPage->GetPageNum() - 1) >> 1;
+ sal_uInt32 nPagesToSkip = (pPage->GetPageNumber() - 1) >> 1;
sal_uInt32 nParaPos = 0;
Paragraph* pPara = pOutl->GetParagraph( 0 );
@@ -1511,7 +1501,7 @@ void OutlineView::SetActualPage( SdPage* pActual )
// if we found a paragraph, select its text at the outliner view
Paragraph* pPara = GetParagraphForPage( mpOutliner, pActual );
if( pPara )
- mpOutlinerView[0]->Select( pPara, sal_True, sal_False );
+ mpOutlinerView[0]->Select( pPara, true, false );
}
}
@@ -1558,7 +1548,7 @@ void OutlineView::SetSelectedPages()
// Die zu den selektierten Absaetzen auf Ebene 0 gehoerenden Seiten
// selektieren
- sal_uInt16 nPos = 0;
+ sal_uInt32 nPos = 0;
sal_uLong nParaPos = 0;
pPara = mpOutliner->GetParagraph( 0 );
@@ -1571,10 +1561,10 @@ void OutlineView::SetSelectedPages()
"Trying to select non-existing page OutlineView::SetSelectedPages()");
if (pPage != NULL)
{
- pPage->SetSelected(sal_False);
+ pPage->SetSelected(false);
if (pSelParas->Seek(pPara)) // selektiert?
- pPage->SetSelected(sal_True);
+ pPage->SetSelected(true);
}
nPos++;
@@ -1640,7 +1630,7 @@ void OutlineView::ResetLinks() const
|*
\************************************************************************/
-sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, sal_uInt16)
+sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt32, SdrLayerID)
{
return DND_ACTION_NONE;
}
@@ -1651,7 +1641,7 @@ sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::s
|*
\************************************************************************/
-sal_Int8 OutlineView::ExecuteDrop( const ExecuteDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, sal_uInt16)
+sal_Int8 OutlineView::ExecuteDrop( const ExecuteDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt32, SdrLayerID)
{
return DND_ACTION_NONE;
}
@@ -1810,8 +1800,8 @@ void OutlineView::UpdateDocument()
sal_uInt32 nPage;
for (nPage = 0; nPage < nPageCount; nPage++)
{
- SdPage* pPage = mpDoc->GetSdPage( (sal_uInt16)nPage, PK_STANDARD);
- mpDoc->SetSelected(pPage, sal_False);
+ SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD);
+ mpDoc->SetSelected(pPage, false);
mpOutlineViewShell->UpdateTitleObject( pPage, pPara );
mpOutlineViewShell->UpdateOutlineObject( pPage, pPara );
@@ -1824,7 +1814,7 @@ void OutlineView::UpdateDocument()
while( pPara )
{
SdPage* pPage = InsertSlideForParagraph( pPara );
- mpDoc->SetSelected(pPage, sal_False);
+ mpDoc->SetSelected(pPage, false);
mpOutlineViewShell->UpdateTitleObject( pPage, pPara );
mpOutlineViewShell->UpdateOutlineObject( pPage, pPara );
diff --git a/sd/source/ui/view/presvish.cxx b/sd/source/ui/view/presvish.cxx
index b35f88c7d1fd..72c49813d4df 100644
--- a/sd/source/ui/view/presvish.cxx
+++ b/sd/source/ui/view/presvish.cxx
@@ -94,8 +94,6 @@ SFX_IMPL_INTERFACE( PresentationViewShell, DrawViewShell, SdResId( STR_PRESVIEWS
}
-TYPEINIT1( PresentationViewShell, DrawViewShell );
-
PresentationViewShell::PresentationViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, ::Window* pParentWindow, FrameView* pFrameView)
: DrawViewShell( pFrame, rViewShellBase, pParentWindow, PK_STANDARD, pFrameView)
{
@@ -130,7 +128,7 @@ void PresentationViewShell::FinishInitialization( FrameView* pFrameView )
}
-SvxRuler* PresentationViewShell::CreateHRuler(::sd::Window*, sal_Bool)
+SvxRuler* PresentationViewShell::CreateHRuler(::sd::Window*, bool)
{
return NULL;
}
@@ -141,14 +139,13 @@ SvxRuler* PresentationViewShell::CreateVRuler(::sd::Window*)
}
-void PresentationViewShell::Activate( sal_Bool bIsMDIActivate )
+void PresentationViewShell::Activate( bool bIsMDIActivate )
{
DrawViewShell::Activate( bIsMDIActivate );
if( bIsMDIActivate )
{
- //HMH::sd::View* pView = GetView();
- SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True );
+ SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
GetViewFrame()->GetDispatcher()->Execute( SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx
index b18cd1f97a97..ab0ea641963b 100644
--- a/sd/source/ui/view/sdruler.cxx
+++ b/sd/source/ui/view/sdruler.cxx
@@ -82,7 +82,7 @@ void RulerCtrlItem::StateChanged( sal_uInt16 nSId, SfxItemState, const SfxPoolIt
case SID_RULER_NULL_OFFSET:
{
const SfxPointItem* pItem = dynamic_cast< const SfxPointItem* >(pState);
- DBG_ASSERT(pState ? pItem != NULL : sal_True, "SfxPointItem erwartet");
+ DBG_ASSERT(pState ? pItem != NULL : true, "SfxPointItem erwartet");
if ( pItem )
rRuler.SetNullOffset(pItem->GetValue());
}
@@ -108,12 +108,12 @@ Ruler::Ruler( DrawViewShell& rViewSh, ::Window* pParent, ::sd::Window* pWin, sal
if ( nWinStyle & WB_HSCROLL )
{
- bHorz = sal_True;
+ bHorz = true;
SetHelpId( HID_SD_RULER_HORIZONTAL );
}
else
{
- bHorz = sal_False;
+ bHorz = false;
SetHelpId( HID_SD_RULER_VERTICAL );
}
}
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index cf096a396b27..04a32e69f58a 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -93,6 +93,7 @@
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <svx/unoapi.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdlegacy.hxx>
#include <numeric>
@@ -105,28 +106,26 @@ namespace sd {
SO2_DECL_REF(SvInPlaceObject)
#endif
-TYPEINIT1(View, FmFormView);
-
/*************************************************************************
|*
|* Ctor
|*
\************************************************************************/
-View::View(SdDrawDocument* pDrawDoc, OutputDevice* pOutDev,
+View::View(SdDrawDocument& rDrawDoc, OutputDevice* pOutDev,
ViewShell* pViewShell)
- : FmFormView(pDrawDoc, pOutDev),
- mpDoc(pDrawDoc),
- mpDocSh( pDrawDoc->GetDocSh() ),
+ : FmFormView(rDrawDoc, pOutDev),
+ mpDoc(&rDrawDoc),
+ mpDocSh( rDrawDoc.GetDocSh() ),
mpViewSh(pViewShell),
- mpDragSrcMarkList(NULL),
+ maDragSrcMarkList(),
mpDropMarkerObj(NULL),
mpDropMarker(NULL),
mnDragSrcPgNum(SDRPAGE_NOTFOUND),
mnAction(DND_ACTION_NONE),
mnLockRedrawSmph(0),
mpLockedRedraws(NULL),
- mbIsDropAllowed(sal_True),
+ mbIsDropAllowed(true),
maSmartTags(*this),
mpClipboard (new ViewClipboard (*this))
{
@@ -136,13 +135,9 @@ View::View(SdDrawDocument* pDrawDoc, OutputDevice* pOutDev,
// #i74769#, #i75172# Use default from the configuration
SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_DrawImpress());
- EnableExtendedKeyInputDispatcher(sal_False);
- EnableExtendedMouseEventDispatcher(sal_False);
- EnableExtendedCommandEventDispatcher(sal_False);
-
- SetUseIncompatiblePathCreateInterface(sal_False);
- SetMarkHdlWhenTextEdit(sal_True);
- EnableTextEditOnObjectsWithoutTextIfTextTool(sal_True);
+ EnableExtendedKeyInputDispatcher(false);
+ EnableExtendedMouseEventDispatcher(false);
+ EnableExtendedCommandEventDispatcher(false);
SetMinMoveDistancePixel(2);
SetHitTolerancePixel(2);
@@ -175,7 +170,7 @@ View::~View()
maSmartTags.Dispose();
// release content of selection clipboard, if we own the content
- UpdateSelectionClipboard( sal_True );
+ UpdateSelectionClipboard( true );
maDropErrorTimer.Stop();
maDropInsertFileTimer.Stop();
@@ -230,21 +225,21 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
SdrObject* pObject = rOriginal.GetViewContact().TryToGetSdrObject();
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- if(pObject && pObject->GetPage())
+ if(pObject && pObject->getSdrPageFromSdrObject())
{
- const bool bDoCreateGeometry(pObject->GetPage()->checkVisibility( rOriginal, rDisplayInfo, true ));
+ const bool bDoCreateGeometry(pObject->getSdrPageFromSdrObject()->checkVisibility( rOriginal, rDisplayInfo, true ));
if(!bDoCreateGeometry && !(( pObject->GetObjInventor() == SdrInventor ) && ( pObject->GetObjIdentifier() == OBJ_PAGE )) )
return xRetval;
PresObjKind eKind(PRESOBJ_NONE);
const bool bSubContentProcessing(rDisplayInfo.GetSubContentActive());
- const bool bIsMasterPageObject(pObject->GetPage()->IsMasterPage());
+ const bool bIsMasterPageObject(pObject->getSdrPageFromSdrObject()->IsMasterPage());
const bool bIsPrinting(rOriginal.GetObjectContact().isOutputToPrinter());
- const SdrPageView* pPageView = rOriginal.GetObjectContact().TryToGetSdrPageView();
const SdrPage* pVisualizedPage = GetSdrPageFromXDrawPage(rOriginal.GetObjectContact().getViewInformation2D().getVisualizedPage());
- const SdPage* pObjectsSdPage = dynamic_cast< SdPage* >(pObject->GetPage());
- const bool bIsInsidePageObj(pPageView && pPageView->GetPage() != pVisualizedPage);
+ const SdPage* pObjectsSdPage = dynamic_cast< SdPage* >(pObject->getSdrPageFromSdrObject());
+ const SdrView* pSdrView = rOriginal.GetObjectContact().TryToGetSdrView();
+ const bool bIsInsidePageObj(pSdrView && pSdrView->GetSdrPageView() && &pSdrView->GetSdrPageView()->getSdrPageFromSdrPageView() != pVisualizedPage);
// check if we need to draw a placeholder border. Never do it for
// objects inside a SdrPageObj and never when printing
@@ -252,7 +247,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
{
bool bCreateOutline(false);
- if( pObject->IsEmptyPresObj() && pObject->ISA(SdrTextObj) )
+ if( pObject->IsEmptyPresObj() && dynamic_cast< SdrTextObj* >(pObject) )
{
if( !bSubContentProcessing || !pObject->IsNotVisibleAsMaster() )
{
@@ -296,9 +291,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
{
// get basic object transformation
const basegfx::BColor aRGBColor(Color(aColor.nColor).getBColor());
- basegfx::B2DHomMatrix aObjectMatrix;
- basegfx::B2DPolyPolygon aObjectPolyPolygon;
- pObject->TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon);
+ const basegfx::B2DHomMatrix aObjectMatrix(pObject->getSdrObjectTransformation());
// create dashed border
{
@@ -395,8 +388,8 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
if( aObjectString.Len() )
{
// decompose object matrix to be able to place text correctly
- basegfx::B2DTuple aScale;
- basegfx::B2DTuple aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
aObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -508,30 +501,27 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contac
if (pPgView)
{
- SdPage* pPage = (SdPage*) pPgView->GetPage();
- if( pPage )
- {
- SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
- bool bScreenDisplay(true);
-
- if(bScreenDisplay && pOutDev && OUTDEV_PRINTER == pOutDev->GetOutDevType())
- {
- // #i75566# printing; suppress AutoColor BackgroundColor generation
- // for visibility reasons by giving GetPageBackgroundColor()
- // the needed hint
- bScreenDisplay = false;
- }
+ SdPage& rPage = (SdPage&) pPgView->getSdrPageFromSdrPageView();
+ SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
+ bool bScreenDisplay(true);
- if(bScreenDisplay && pOutDev && pOutDev->GetPDFWriter())
- {
- // #i75566# PDF export; suppress AutoColor BackgroundColor generation (see above)
- bScreenDisplay = false;
- }
+ if(bScreenDisplay && pOutDev && OUTDEV_PRINTER == pOutDev->GetOutDevType())
+ {
+ // #i75566# printing; suppress AutoColor BackgroundColor generation
+ // for visibility reasons by giving GetPageBackgroundColor()
+ // the needed hint
+ bScreenDisplay = false;
+ }
- // #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and
- // hint value if screen display. Only then the AutoColor mechanisms shall be applied
- rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pPgView, bScreenDisplay) );
+ if(bScreenDisplay && pOutDev && pOutDev->GetPDFWriter())
+ {
+ // #i75566# PDF export; suppress AutoColor BackgroundColor generation (see above)
+ bScreenDisplay = false;
}
+
+ // #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and
+ // hint value if screen display. Only then the AutoColor mechanisms shall be applied
+ rOutl.SetBackgroundColor( rPage.GetPageBackgroundColor(pPgView, bScreenDisplay) );
}
ViewRedirector aViewRedirector;
@@ -557,11 +547,13 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contac
|*
\************************************************************************/
-void View::MarkListHasChanged()
+void View::handleSelectionChange()
{
- FmFormView::MarkListHasChanged();
+ // call parent
+ FmFormView::handleSelectionChange();
- if( GetMarkedObjectCount() > 0 )
+ // local reactions
+ if( areSdrObjectsSelected() )
maSmartTags.deselect();
}
@@ -572,9 +564,9 @@ void View::MarkListHasChanged()
|*
\************************************************************************/
-sal_Bool View::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll)
+bool View::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
- sal_Bool bOk = FmFormView::SetAttributes(rSet, bReplaceAll);
+ bool bOk = FmFormView::SetAttributes(rSet, bReplaceAll);
return (bOk);
}
@@ -585,7 +577,7 @@ sal_Bool View::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll)
|*
\************************************************************************/
-sal_Bool View::GetAttributes( SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr ) const
+bool View::GetAttributes( SfxItemSet& rTargetSet, bool bOnlyHardAttr ) const
{
return( FmFormView::GetAttributes( rTargetSet, bOnlyHardAttr ) );
}
@@ -597,72 +589,65 @@ sal_Bool View::GetAttributes( SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr ) c
|*
\************************************************************************/
-sal_Bool View::IsPresObjSelected(sal_Bool bOnPage, sal_Bool bOnMasterPage, sal_Bool bCheckPresObjListOnly, sal_Bool bCheckLayoutOnly) const
+bool View::IsPresObjSelected(bool bOnPage, bool bOnMasterPage, bool bCheckPresObjListOnly, bool bCheckLayoutOnly) const
{
/**************************************************************************
* Ist ein Presentationsobjekt selektiert?
**************************************************************************/
- SdrMarkList* pMarkList;
+ SdrObjectVector aSelection;
- if (mnDragSrcPgNum != SDRPAGE_NOTFOUND &&
- mnDragSrcPgNum != GetSdrPageView()->GetPage()->GetPageNum())
+ if (mnDragSrcPgNum != SDRPAGE_NOTFOUND && GetSdrPageView() && mnDragSrcPgNum != GetSdrPageView()->getSdrPageFromSdrPageView().GetPageNumber())
{
// Es laeuft gerade Drag&Drop
// Source- und Destination-Page unterschiedlich:
// es wird die gemerkte MarkList verwendet
- pMarkList = mpDragSrcMarkList;
+ aSelection = maDragSrcMarkList;
}
else
{
// Es wird die aktuelle MarkList verwendet
- pMarkList = new SdrMarkList(GetMarkedObjectList());
+ aSelection = getSelectedSdrObjectVectorFromSdrMarkView();
}
- SdrMark* pMark;
SdPage* pPage;
SdrObject* pObj;
- sal_Bool bSelected = sal_False;
- sal_Bool bMasterPage = sal_False;
- long nMark;
- long nMarkMax = long(pMarkList->GetMarkCount()) - 1;
+ bool bSelected = false;
+ bool bMasterPage = false;
- for (nMark = nMarkMax; (nMark >= 0) && !bSelected; nMark--)
+ if(aSelection.size())
{
- // Rueckwaerts durch die Marklist
- pMark = pMarkList->GetMark(nMark);
- pObj = pMark->GetMarkedSdrObj();
-
- if ( pObj && ( bCheckPresObjListOnly || pObj->IsEmptyPresObj() || pObj->GetUserCall() ) )
+ for(sal_uInt32 nMark(aSelection.size()); nMark && !bSelected;)
{
- pPage = (SdPage*) pObj->GetPage();
- bMasterPage = pPage->IsMasterPage();
+ // Rueckwaerts durch die Marklist
+ pObj = aSelection[--nMark];
- if ( (bMasterPage && bOnMasterPage) || (!bMasterPage && bOnPage) )
+ if ( pObj && ( bCheckPresObjListOnly || pObj->IsEmptyPresObj() || findConnectionToSdrObject(pObj) ) )
{
- if ( pPage && pPage->IsPresObj(pObj) )
+ pPage = (SdPage*) pObj->getSdrPageFromSdrObject();
+ bMasterPage = pPage->IsMasterPage();
+
+ if ( (bMasterPage && bOnMasterPage) || (!bMasterPage && bOnPage) )
{
- if( bCheckLayoutOnly )
+ if ( pPage && pPage->IsPresObj(pObj) )
{
- PresObjKind eKind = pPage->GetPresObjKind(pObj);
+ if( bCheckLayoutOnly )
+ {
+ PresObjKind eKind = pPage->GetPresObjKind(pObj);
- if((eKind != PRESOBJ_FOOTER) && (eKind != PRESOBJ_HEADER) && (eKind != PRESOBJ_DATETIME) && (eKind != PRESOBJ_SLIDENUMBER) )
- bSelected = sal_True;
- }
- else
- {
- bSelected = sal_True;
+ if((eKind != PRESOBJ_FOOTER) && (eKind != PRESOBJ_HEADER) && (eKind != PRESOBJ_DATETIME) && (eKind != PRESOBJ_SLIDENUMBER) )
+ bSelected = true;
+ }
+ else
+ {
+ bSelected = true;
+ }
}
}
}
}
}
- if (pMarkList != mpDragSrcMarkList)
- {
- delete pMarkList;
- }
-
return (bSelected);
}
@@ -693,10 +678,10 @@ void View::SelectAll()
|*
\************************************************************************/
-void View::ModelHasChanged()
+void View::LazyReactOnObjectChanges()
{
- // Erst SdrView benachrichtigen
- FmFormView::ModelHasChanged();
+ // call parent
+ FmFormView::LazyReactOnObjectChanges();
}
/*************************************************************************
@@ -705,7 +690,7 @@ void View::ModelHasChanged()
|*
\************************************************************************/
-sal_Bool View::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+bool View::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
// weiter an SdrView
return FmFormView::SetStyleSheet(pStyleSheet, bDontRemoveHardAttr);
@@ -718,9 +703,9 @@ sal_Bool View::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHar
|*
\************************************************************************/
-static void SetSpellOptions( SdDrawDocument* pDoc, sal_uLong& rCntrl )
+static void SetSpellOptions( SdDrawDocument* pDoc, sal_uInt32& rCntrl )
{
- sal_Bool bOnlineSpell = pDoc->GetOnlineSpell();
+ bool bOnlineSpell = pDoc->GetOnlineSpell();
if( bOnlineSpell )
rCntrl |= EE_CNTRL_ONLINESPELLING;
@@ -728,24 +713,23 @@ static void SetSpellOptions( SdDrawDocument* pDoc, sal_uLong& rCntrl )
rCntrl &= ~EE_CNTRL_ONLINESPELLING;
}
-sal_Bool View::SdrBeginTextEdit(
- SdrObject* pObj, SdrPageView* pPV, ::Window* pWin,
- sal_Bool bIsNewObj,
- SdrOutliner* pOutl, OutlinerView* pGivenOutlinerView,
- sal_Bool bDontDeleteOutliner, sal_Bool bOnlyOneView, sal_Bool bGrabFocus )
+bool View::SdrBeginTextEdit(
+ SdrObject* pObj, ::Window* pWin,
+ bool bIsNewObj, SdrOutliner* pOutl, OutlinerView* pGivenOutlinerView,
+ bool bDontDeleteOutliner, bool bOnlyOneView, bool bGrabFocus )
{
GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent(
sd::tools::EventMultiplexerEvent::EID_BEGIN_TEXT_EDIT, (void*)pObj );
if( pOutl==NULL && pObj )
- pOutl = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, pObj->GetModel() );
+ pOutl = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, &pObj->getSdrModelFromSdrObject() );
// make draw&impress specific initialisations
if( pOutl )
{
pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool());
pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
- sal_uLong nCntrl = pOutl->GetControlWord();
+ sal_uInt32 nCntrl = pOutl->GetControlWord();
nCntrl |= EE_CNTRL_ALLOWBIGOBJS;
nCntrl |= EE_CNTRL_URLSFXEXECUTE;
nCntrl |= EE_CNTRL_MARKFIELDS;
@@ -771,7 +755,7 @@ sal_Bool View::SdrBeginTextEdit(
}
sal_Bool bReturn = FmFormView::SdrBeginTextEdit(
- pObj, pPV, pWin, bIsNewObj, pOutl,
+ pObj, pWin, bIsNewObj, pOutl,
pGivenOutlinerView, bDontDeleteOutliner,
bOnlyOneView, bGrabFocus);
@@ -779,7 +763,7 @@ sal_Bool View::SdrBeginTextEdit(
{
::Outliner* pOL = GetTextEditOutliner();
- if( pObj && pObj->GetPage() )
+ if( pObj && pObj->getSdrPageFromSdrObject() )
{
Color aBackground;
if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_TABLE )
@@ -788,7 +772,10 @@ sal_Bool View::SdrBeginTextEdit(
}
else
{
- aBackground = pObj->GetPage()->GetPageBackgroundColor(pPV);
+ if(GetSdrPageView())
+ {
+ aBackground = pObj->getSdrPageFromSdrObject()->GetPageBackgroundColor(GetSdrPageView());
+ }
}
pOL->SetBackgroundColor( aBackground );
}
@@ -801,11 +788,11 @@ sal_Bool View::SdrBeginTextEdit(
}
/** ends current text editing */
-SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally )
+SdrEndTextEditKind View::SdrEndTextEdit(bool bDontDeleteReally )
{
SdrObjectWeakRef xObj( GetTextEditObject() );
- sal_Bool bDefaultTextRestored = RestoreDefaultText( dynamic_cast< SdrTextObj* >( GetTextEditObject() ) );
+ bool bDefaultTextRestored = RestoreDefaultText( dynamic_cast< SdrTextObj* >( GetTextEditObject() ) );
SdrEndTextEditKind eKind = FmFormView::SdrEndTextEdit(bDontDeleteReally);
@@ -813,7 +800,7 @@ SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally )
{
if( xObj.is() && !xObj->IsEmptyPresObj() )
{
- xObj->SetEmptyPresObj( sal_True );
+ xObj->SetEmptyPresObj( true );
}
else
{
@@ -825,9 +812,9 @@ SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally )
SdrTextObj* pObj = dynamic_cast< SdrTextObj* >( xObj.get() );
if( pObj && pObj->HasText() )
{
- SdrPage* pPage = pObj->GetPage();
+ SdrPage* pPage = pObj->getSdrPageFromSdrObject();
if( !pPage || !pPage->IsMasterPage() )
- pObj->SetEmptyPresObj( sal_False );
+ pObj->SetEmptyPresObj( false );
}
}
@@ -835,7 +822,7 @@ SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally )
if( xObj.is() )
{
- SdPage* pPage = dynamic_cast< SdPage* >( xObj->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( xObj->getSdrPageFromSdrObject() );
if( pPage )
pPage->onEndTextEdit( xObj.get() );
}
@@ -855,7 +842,7 @@ bool View::RestoreDefaultText( SdrTextObj* pTextObj )
{
if( !pTextObj->HasText() )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pTextObj->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( pTextObj->getSdrPageFromSdrObject() );
if(pPage)
{
@@ -884,75 +871,96 @@ bool View::RestoreDefaultText( SdrTextObj* pTextObj )
void View::SetMarkedOriginalSize()
{
SdrUndoGroup* pUndoGroup = new SdrUndoGroup(*mpDoc);
- sal_uLong nCount = GetMarkedObjectCount();
- sal_Bool bOK = sal_False;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView() );
+ bool bOK(false);
- for( sal_uInt32 i = 0; i < nCount; i++ )
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrObject* pObj = GetMarkedObjectByIndex(i);
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(aSelection[i]);
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(aSelection[i]);
- if( pObj->GetObjInventor() == SdrInventor )
+ if(pSdrOle2Obj)
{
- if( pObj->GetObjIdentifier() == OBJ_OLE2 )
+ uno::Reference < embed::XEmbeddedObject > xObj = pSdrOle2Obj->GetObjRef();
+
+ if( xObj.is() )
{
- uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObj)->GetObjRef();
- if( xObj.is() )
- {
- // TODO/LEAN: working with VisualArea can switch object to running state
+ // TODO/LEAN: working with VisualArea can switch object to running state
+ sal_Int64 nAspect = pSdrOle2Obj->GetAspect();
+ basegfx::B2DVector aOleSize(0.0, 0.0);
- sal_Int64 nAspect = ((SdrOle2Obj*)pObj)->GetAspect();
- Size aOleSize;
+ if ( nAspect == embed::Aspects::MSOLE_ICON )
+ {
+ MapMode aMap100( MAP_100TH_MM );
+ const Size aSize(pSdrOle2Obj->GetOrigObjSize( &aMap100 ));
- if ( nAspect == embed::Aspects::MSOLE_ICON )
- {
- MapMode aMap100( MAP_100TH_MM );
- aOleSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize( &aMap100 );
- bOK = sal_True;
- }
- else
+ aOleSize.setX(aSize.Width());
+ aOleSize.setY(aSize.Height());
+ bOK = true;
+ }
+ else
+ {
+ MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
+ try
{
- MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- try
- {
- awt::Size aSz = xObj->getVisualAreaSize( nAspect );
- aOleSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MAP_100TH_MM );
- bOK = sal_True;
- }
- catch( embed::NoVisualAreaSizeException& )
- {}
+ const awt::Size aSz(xObj->getVisualAreaSize( nAspect ));
+ const double fFactor(OutputDevice::GetFactorLogicToLogic(aUnit, MAP_100TH_MM));
+ aOleSize = basegfx::B2DVector(aSz.Width, aSz.Height) * fFactor;
+ bOK = true;
}
+ catch( embed::NoVisualAreaSizeException& )
+ {}
+ }
- if ( bOK )
- {
- Rectangle aDrawRect( pObj->GetLogicRect() );
+ if ( bOK )
+ {
+ const basegfx::B2DVector& rScale = pSdrOle2Obj->getSdrObjectScale();
+ const basegfx::B2DPoint& rTopLeft = pSdrOle2Obj->getSdrObjectTranslate();
+ basegfx::B2DHomMatrix aTransform;
- pUndoGroup->AddAction( mpDoc->GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
- pObj->Resize( aDrawRect.TopLeft(), Fraction( aOleSize.Width(), aDrawRect.GetWidth() ),
- Fraction( aOleSize.Height(), aDrawRect.GetHeight() ) );
- }
+ pUndoGroup->AddAction( mpDoc->GetSdrUndoFactory().CreateUndoGeoObject( *pSdrOle2Obj ) );
+
+ aTransform.translate(-rTopLeft);
+ aTransform.scale(
+ aOleSize.getX() / (basegfx::fTools::equalZero(rScale.getX()) ? 1.0 : rScale.getX()),
+ aOleSize.getY() / (basegfx::fTools::equalZero(rScale.getY()) ? 1.0 : rScale.getY()));
+ aTransform.translate(rTopLeft);
+
+ sdr::legacy::transformSdrObject(*pSdrOle2Obj, aTransform);
}
}
- else if( pObj->GetObjIdentifier() == OBJ_GRAF )
+ }
+ else if( pSdrGrafObj )
+ {
+ double fFactor(1.0);
+
+ if ( MAP_PIXEL == pSdrGrafObj->GetGrafPrefMapMode().GetMapUnit() )
+ {
+ fFactor = OutputDevice::GetFactorLogicToLogic(MAP_PIXEL, MAP_100TH_MM);
+ }
+ else
{
- const MapMode aMap100( MAP_100TH_MM );
- Size aSize;
+ fFactor = OutputDevice::GetFactorLogicToLogic(pSdrGrafObj->GetGrafPrefMapMode().GetMapUnit(), MAP_100TH_MM);
+ }
- if ( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL )
- aSize = Application::GetDefaultDevice()->PixelToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(), aMap100 );
- else
- {
- aSize = OutputDevice::LogicToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(),
- static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode(),
- aMap100 );
- }
+ const basegfx::B2DVector aSize(
+ pSdrGrafObj->GetGrafPrefSize().Width() * fFactor,
+ pSdrGrafObj->GetGrafPrefSize().Height() * fFactor);
- pUndoGroup->AddAction( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj ) );
- Rectangle aRect( pObj->GetLogicRect() );
- aRect.SetSize( aSize );
- pObj->SetLogicRect( aRect );
+ pUndoGroup->AddAction( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pSdrGrafObj));
- bOK = sal_True;
- }
+ const basegfx::B2DVector& rScale = pSdrGrafObj->getSdrObjectScale();
+ const basegfx::B2DPoint& rTopLeft = pSdrGrafObj->getSdrObjectTranslate();
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-rTopLeft);
+ aTransform.scale(
+ aSize.getX() / (basegfx::fTools::equalZero(rScale.getX()) ? 1.0 : rScale.getX()),
+ aSize.getY() / (basegfx::fTools::equalZero(rScale.getY()) ? 1.0 : rScale.getY()));
+ aTransform.translate(rTopLeft);
+ sdr::legacy::transformSdrObject(*pSdrGrafObj, aTransform);
+
+ bOK = true;
}
}
@@ -962,7 +970,9 @@ void View::SetMarkedOriginalSize()
mpDocSh->GetUndoManager()->AddUndoAction(pUndoGroup);
}
else
+ {
delete pUndoGroup;
+ }
}
/*************************************************************************
@@ -983,13 +993,13 @@ void View::DoConnect(SdrOle2Obj* pObj)
if ( !pSdClient )
{
pSdClient = new Client(pObj, mpViewSh, pWindow);
- Rectangle aRect = pObj->GetLogicRect();
+ Rectangle aRect(sdr::legacy::GetLogicRect(*pObj));
{
// TODO/LEAN: working with visual area can switch object to running state
Size aDrawSize = aRect.GetSize();
awt::Size aSz;
- MapMode aMapMode( mpDoc->GetScaleUnit() );
+ MapMode aMapMode( mpDoc->GetExchangeObjectUnit() );
Size aObjAreaSize = pObj->GetOrigObjSize( &aMapMode );
Fraction aScaleWidth (aDrawSize.Width(), aObjAreaSize.Width() );
@@ -1014,46 +1024,47 @@ void View::DoConnect(SdrOle2Obj* pObj)
|*
\************************************************************************/
-sal_Bool View::IsMorphingAllowed() const
+bool View::IsMorphingAllowed() const
{
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- sal_Bool bRet = sal_False;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bRet(false);
- if ( rMarkList.GetMarkCount() == 2 )
+ if(2 == aSelection.size())
{
- const SdrObject* pObj1 = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- const SdrObject* pObj2 = rMarkList.GetMark( 1 )->GetMarkedSdrObj();
- const sal_uInt16 nKind1 = pObj1->GetObjIdentifier();
- const sal_uInt16 nKind2 = pObj2->GetObjIdentifier();
-
- if ( ( nKind1 != OBJ_TEXT && nKind2 != OBJ_TEXT ) &&
- ( nKind1 != OBJ_TITLETEXT && nKind2 != OBJ_TITLETEXT ) &&
- ( nKind1 != OBJ_OUTLINETEXT && nKind2 != OBJ_OUTLINETEXT ) &&
- ( nKind1 != OBJ_GRUP && nKind2 != OBJ_GRUP ) &&
- ( nKind1 != OBJ_LINE && nKind2 != OBJ_LINE ) &&
- ( nKind1 != OBJ_PLIN && nKind2 != OBJ_PLIN ) &&
- ( nKind1 != OBJ_PATHLINE && nKind2 != OBJ_PATHLINE ) &&
- ( nKind1 != OBJ_FREELINE && nKind2 != OBJ_FREELINE ) &&
- ( nKind1 != OBJ_PATHPLIN && nKind2 != OBJ_PATHPLIN ) &&
- ( nKind1 != OBJ_MEASURE && nKind2 != OBJ_MEASURE ) &&
- ( nKind1 != OBJ_EDGE && nKind2 != OBJ_EDGE ) &&
- ( nKind1 != OBJ_GRAF && nKind2 != OBJ_GRAF ) &&
- ( nKind1 != OBJ_OLE2 && nKind2 != OBJ_OLE2 ) &&
- ( nKind1 != OBJ_CAPTION && nKind2 != OBJ_CAPTION ) &&
- !pObj1->ISA( E3dObject) && !pObj2->ISA( E3dObject) )
- {
- SfxItemSet aSet1( mpDoc->GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
- SfxItemSet aSet2( mpDoc->GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
+ const SdrObject* pObj1 = aSelection[0];
+ const SdrObject* pObj2 = aSelection[1];
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pObj1);
- aSet1.Put(pObj1->GetMergedItemSet());
- aSet2.Put(pObj2->GetMergedItemSet());
+ if(!pSdrPathObj || pSdrPathObj->isClosed()) // not a path or closed (not OBJ_LINE, OBJ_PLIN, OBJ_PATHLINE, OBJ_FREELINE or OBJ_PATHPLIN)
+ {
+ pSdrPathObj = dynamic_cast< const SdrPathObj* >(pObj2);
- const XFillStyle eFillStyle1 = ( (const XFillStyleItem&) aSet1.Get( XATTR_FILLSTYLE ) ).GetValue();
- const XFillStyle eFillStyle2 = ( (const XFillStyleItem&) aSet2.Get( XATTR_FILLSTYLE ) ).GetValue();
+ if(!pSdrPathObj || pSdrPathObj->isClosed()) // not a path or closed (not OBJ_LINE, OBJ_PLIN, OBJ_PATHLINE, OBJ_FREELINE or OBJ_PATHPLIN)
+ {
+ const sal_uInt16 nKind1 = pObj1->GetObjIdentifier();
+ const sal_uInt16 nKind2 = pObj2->GetObjIdentifier();
+
+ if ( ( nKind1 != OBJ_TEXT && nKind2 != OBJ_TEXT ) &&
+ ( nKind1 != OBJ_TITLETEXT && nKind2 != OBJ_TITLETEXT ) &&
+ ( nKind1 != OBJ_OUTLINETEXT && nKind2 != OBJ_OUTLINETEXT ) &&
+ ( nKind1 != OBJ_GRUP && nKind2 != OBJ_GRUP ) &&
+ ( nKind1 != OBJ_MEASURE && nKind2 != OBJ_MEASURE ) &&
+ ( nKind1 != OBJ_EDGE && nKind2 != OBJ_EDGE ) &&
+ ( nKind1 != OBJ_GRAF && nKind2 != OBJ_GRAF ) &&
+ ( nKind1 != OBJ_OLE2 && nKind2 != OBJ_OLE2 ) &&
+ ( nKind1 != OBJ_CAPTION && nKind2 != OBJ_CAPTION ) &&
+ !dynamic_cast< const E3dObject* >(pObj1) && !dynamic_cast< const E3dObject* >(pObj2) )
+ {
+ const XFillStyle eFillStyle1(((const XFillStyleItem&)pObj1->GetMergedItem(XATTR_FILLSTYLE)).GetValue());
+ const XFillStyle eFillStyle2(((const XFillStyleItem&)pObj2->GetMergedItem(XATTR_FILLSTYLE)).GetValue());
- if( ( eFillStyle1 == XFILL_NONE || eFillStyle1 == XFILL_SOLID ) &&
- ( eFillStyle2 == XFILL_NONE || eFillStyle2 == XFILL_SOLID ) )
- bRet = sal_True;
+ if( ( eFillStyle1 == XFILL_NONE || eFillStyle1 == XFILL_SOLID ) &&
+ ( eFillStyle2 == XFILL_NONE || eFillStyle2 == XFILL_SOLID ) )
+ {
+ bRet = true;
+ }
+ }
+ }
}
}
@@ -1066,25 +1077,11 @@ sal_Bool View::IsMorphingAllowed() const
|*
\************************************************************************/
-sal_Bool View::IsVectorizeAllowed() const
+bool View::IsVectorizeAllowed() const
{
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- sal_Bool bRet = sal_False;
-
- if( rMarkList.GetMarkCount() == 1 )
- {
- const SdrGrafObj* pObj = dynamic_cast< const SdrGrafObj* >(rMarkList.GetMark( 0 )->GetMarkedSdrObj());
+ const SdrGrafObj* pObj = dynamic_cast< const SdrGrafObj* >(getSelectedIfSingle());
- if(pObj)
- {
- if(GRAPHIC_BITMAP == pObj->GetGraphicType() && !pObj->isEmbeddedSvg())
- {
- bRet = sal_True;
- }
- }
- }
-
- return bRet;
+ return (pObj && GRAPHIC_BITMAP == pObj->GetGraphicType() && !pObj->isEmbeddedSvg());
}
void View::onAccessibilityOptionsChanged()
@@ -1136,7 +1133,7 @@ IMPL_LINK( View, OnParagraphInsertedHdl, ::Outliner *, pOutliner )
if( pPara && pObj )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pObj->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
if( pPage )
pPage->onParagraphInserted( pOutliner, pPara, pObj );
}
@@ -1156,7 +1153,7 @@ IMPL_LINK( View, OnParagraphRemovingHdl, ::Outliner *, pOutliner )
if( pPara && pObj )
{
- SdPage* pPage = dynamic_cast< SdPage* >( pObj->GetPage() );
+ SdPage* pPage = dynamic_cast< SdPage* >( pObj->getSdrPageFromSdrObject() );
if( pPage )
pPage->onParagraphRemoving( pOutliner, pPara, pObj );
}
@@ -1178,12 +1175,7 @@ bool View::isRecordingUndo() const
void View::AddCustomHdl()
{
- maSmartTags.addCustomHandles( aHdl );
-}
-
-void View::updateHandles()
-{
- AdjustMarkHdl();
+ maSmartTags.addCustomHandles(maViewHandleList);
}
SdrViewContext View::GetContext() const
@@ -1195,22 +1187,26 @@ SdrViewContext View::GetContext() const
return FmFormView::GetContext();
}
-sal_Bool View::HasMarkablePoints() const
+bool View::HasMarkablePoints() const
{
if( maSmartTags.HasMarkablePoints() )
+ {
return true;
+ }
else
+ {
return FmFormView::HasMarkablePoints();
+ }
}
-sal_uLong View::GetMarkablePointCount() const
+sal_uInt32 View::GetMarkablePointCount() const
{
- sal_uLong nCount = FmFormView::GetMarkablePointCount();
+ sal_uInt32 nCount = FmFormView::GetMarkablePointCount();
nCount += maSmartTags.GetMarkablePointCount();
return nCount;
}
-sal_Bool View::HasMarkedPoints() const
+bool View::HasMarkedPoints() const
{
if( maSmartTags.HasMarkedPoints() )
return true;
@@ -1218,14 +1214,14 @@ sal_Bool View::HasMarkedPoints() const
return FmFormView::HasMarkedPoints();
}
-sal_uLong View::GetMarkedPointCount() const
+sal_uInt32 View::GetMarkedPointCount() const
{
- sal_uLong nCount = FmFormView::GetMarkedPointCount();
+ sal_uInt32 nCount = FmFormView::GetMarkedPointCount();
nCount += maSmartTags.GetMarkedPointCount();
return nCount;
}
-sal_Bool View::IsPointMarkable(const SdrHdl& rHdl) const
+bool View::IsPointMarkable(const SdrHdl& rHdl) const
{
if( maSmartTags.IsPointMarkable( rHdl ) )
return true;
@@ -1233,7 +1229,7 @@ sal_Bool View::IsPointMarkable(const SdrHdl& rHdl) const
return FmFormView::IsPointMarkable( rHdl );
}
-sal_Bool View::MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark )
+bool View::MarkPoint(SdrHdl& rHdl, bool bUnmark )
{
if( maSmartTags.MarkPoint( rHdl, bUnmark ) )
return true;
@@ -1241,12 +1237,12 @@ sal_Bool View::MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark )
return FmFormView::MarkPoint( rHdl, bUnmark );
}
-sal_Bool View::MarkPoints(const Rectangle* pRect, sal_Bool bUnmark)
+void View::MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark)
{
- if( maSmartTags.MarkPoints( pRect, bUnmark ) )
- return true;
- else
- return FmFormView::MarkPoints( pRect, bUnmark );
+ if( !maSmartTags.MarkPoints( pRange, bUnmark ) )
+ {
+ FmFormView::MarkPoints( pRange, bUnmark );
+ }
}
void View::CheckPossibilities()
@@ -1265,9 +1261,9 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
{
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( GetTextEditObject() );
SdrOutliner* pOutliner = GetTextEditOutliner();
- if( pOutliner && pTextObj && pTextObj->GetPage() )
+ if( pOutliner && pTextObj && pTextObj->getSdrPageFromSdrObject() )
{
- SdPage* pPage = static_cast< SdPage* >( pTextObj->GetPage() );
+ SdPage* pPage = static_cast< SdPage* >( pTextObj->getSdrPageFromSdrObject() );
SfxStyleSheet* pStyleSheet = 0;
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 520e5d48d674..4233b5424cda 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -76,6 +76,7 @@
#include "drawview.hxx"
#include "helpids.h"
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
#include "slideshow.hxx"
@@ -100,20 +101,20 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
{
DropTargetHelper& mrTargetHelper;
::sd::Window* mpTargetWindow;
- sal_uInt16 mnPage;
- sal_uInt16 mnLayer;
+ sal_uInt32 mnPage;
+ sal_uInt32 mnLayer;
SdNavigatorDropEvent (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer )
+ sal_uInt32 nPage,
+ SdrLayerID aLayer )
: ExecuteDropEvent( rEvt ),
mrTargetHelper( rTargetHelper ),
mpTargetWindow( pTargetWindow ),
mnPage( nPage ),
- mnLayer( nLayer )
+ mnLayer( aLayer )
{}
};
@@ -123,7 +124,7 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
{
// since SdTransferable::CopyToClipboard is called, this
// dynamically created object ist destroyed automatically
- SdTransferable* pTransferable = new SdTransferable( mpDoc, NULL, sal_False );
+ SdTransferable* pTransferable = new SdTransferable( mpDoc, NULL, false );
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
SD_MOD()->pTransferClip = pTransferable;
@@ -132,51 +133,50 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
pTransferable->SetWorkDocument( (SdDrawDocument*) GetAllMarkedModel() );
mpDoc->CreatingDataObj( NULL );
- // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get
- // fat lines correctly
- const Rectangle aMarkRect( GetAllMarkedBoundRect() );
TransferableObjectDescriptor aObjDesc;
String aDisplayName;
- SdrOle2Obj* pSdrOleObj = NULL;
SdrPageView* pPgView = GetSdrPageView();
- SdPage* pOldPage = pPgView ? ( (SdPage*) pPgView->GetPage() ) : NULL;
+ SdPage* pOldPage = pPgView ? ( (SdPage*) &pPgView->getSdrPageFromSdrPageView() ) : NULL;
SdPage* pNewPage = (SdPage*) pTransferable->GetWorkDocument()->GetPage( 0 );
if( pOldPage )
{
- pNewPage->SetSize( pOldPage->GetSize() );
+ pNewPage->SetPageScale( pOldPage->GetPageScale() );
pNewPage->SetLayoutName( pOldPage->GetLayoutName() );
}
- if( GetMarkedObjectCount() == 1 )
- {
- SdrObject* pObj = GetMarkedObjectByIndex(0);
+ SdrOle2Obj* pSdrOleObj = dynamic_cast< SdrOle2Obj* >(getSelectedIfSingle());
- if( pObj && pObj->ISA(SdrOle2Obj) && ((SdrOle2Obj*) pObj)->GetObjRef().is() )
+ if( pSdrOleObj && pSdrOleObj->GetObjRef().is() )
+ {
+ // If object has no persistence it must be copied as part of the document
+ try
{
- // If object has no persistence it must be copied as part of the document
- try
- {
- uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
- if ( xPersObj.is() && xPersObj->hasEntry() )
- pSdrOleObj = (SdrOle2Obj*) pObj;
- }
- catch( uno::Exception& )
- {}
+ uno::Reference< embed::XEmbedPersist > xPersObj( pSdrOleObj->GetObjRef(), uno::UNO_QUERY );
+
+ if ( !xPersObj.is() || !xPersObj->hasEntry() )
+ pSdrOleObj = 0;
}
+ catch( uno::Exception& )
+ {}
}
if( pSdrOleObj )
+ {
SvEmbedTransferHelper::FillTransferableObjectDescriptor( aObjDesc, pSdrOleObj->GetObjRef(), pSdrOleObj->GetGraphic(), pSdrOleObj->GetAspect() );
+ }
else
+ {
pTransferable->GetWorkDocument()->GetDocSh()->FillTransferableObjectDescriptor( aObjDesc );
+ }
if( mpDocSh )
aObjDesc.maDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass();
- aObjDesc.maSize = aMarkRect.GetSize();
+ const basegfx::B2DRange aAllRange(getMarkedObjectSnapRange());
+ aObjDesc.maSize = Size(basegfx::fround(aAllRange.getWidth()), basegfx::fround(aAllRange.getHeight()));
- pTransferable->SetStartPos( aMarkRect.TopLeft() );
+ pTransferable->SetStartPos(aAllRange.getMinimum());
pTransferable->SetObjectDescriptor( aObjDesc );
pTransferable->CopyToClipboard( mpViewSh->GetActiveWindow() );
@@ -187,47 +187,50 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateDragDataObject( View* pWorkView, ::Window& rWindow, const Point& rDragPos )
{
- SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, sal_False );
+ SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, false );
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
SD_MOD()->pTransferDrag = pTransferable;
TransferableObjectDescriptor aObjDesc;
String aDisplayName;
- SdrOle2Obj* pSdrOleObj = NULL;
+ SdrOle2Obj* pSdrOleObj = dynamic_cast< SdrOle2Obj* >(getSelectedIfSingle());
- if( GetMarkedObjectCount() == 1 )
+ if(pSdrOleObj && pSdrOleObj->GetObjRef().is())
{
- SdrObject* pObj = GetMarkedObjectByIndex( 0 );
-
- if( pObj && pObj->ISA( SdrOle2Obj ) && ( (SdrOle2Obj*) pObj )->GetObjRef().is() )
+ // If object has no persistence it must be copied as part of the document
+ try
{
- // If object has no persistence it must be copied as part of the document
- try
- {
- uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
- if ( xPersObj.is() && xPersObj->hasEntry() )
- pSdrOleObj = (SdrOle2Obj*) pObj;
- }
- catch( uno::Exception& )
- {}
+ uno::Reference< embed::XEmbedPersist > xPersObj( pSdrOleObj->GetObjRef(), uno::UNO_QUERY );
+
+ if ( !xPersObj.is() || !xPersObj->hasEntry() )
+ pSdrOleObj = 0;
}
+ catch( uno::Exception& )
+ {}
}
if( mpDocSh )
+ {
aDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass();
+ }
if( pSdrOleObj )
+ {
SvEmbedTransferHelper::FillTransferableObjectDescriptor( aObjDesc, pSdrOleObj->GetObjRef(), pSdrOleObj->GetGraphic(), pSdrOleObj->GetAspect() );
+ }
else
+ {
mpDocSh->FillTransferableObjectDescriptor( aObjDesc );
+ }
- aObjDesc.maSize = GetAllMarkedRect().GetSize();
+ const basegfx::B2DRange aAllRange(getMarkedObjectSnapRange());
+ aObjDesc.maSize = Size(basegfx::fround(aAllRange.getWidth()), basegfx::fround(aAllRange.getHeight()));
aObjDesc.maDragStartPos = rDragPos;
aObjDesc.maDisplayName = aDisplayName;
- aObjDesc.mbCanLink = sal_False;
+ aObjDesc.mbCanLink = false;
- pTransferable->SetStartPos( rDragPos );
+ pTransferable->SetStartPos( basegfx::B2DPoint(rDragPos.X(), rDragPos.Y()) );
pTransferable->SetObjectDescriptor( aObjDesc );
pTransferable->StartDrag( &rWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
@@ -238,10 +241,9 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateSelectionDataObject( View* pWorkView, ::Window& rWindow )
{
- SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, sal_True );
+ SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, true );
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
TransferableObjectDescriptor aObjDesc;
- const Rectangle aMarkRect( GetAllMarkedRect() );
String aDisplayName;
SD_MOD()->pTransferSelection = pTransferable;
@@ -252,9 +254,10 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
mpDocSh->FillTransferableObjectDescriptor( aObjDesc );
}
- aObjDesc.maSize = aMarkRect.GetSize();
+ const basegfx::B2DRange aAllRange(getMarkedObjectSnapRange());
+ aObjDesc.maSize = Size(basegfx::fround(aAllRange.getWidth()), basegfx::fround(aAllRange.getHeight()));
- pTransferable->SetStartPos( aMarkRect.TopLeft() );
+ pTransferable->SetStartPos(aAllRange.getMinimum());
pTransferable->SetObjectDescriptor( aObjDesc );
pTransferable->CopyToSelection( &rWindow );
@@ -263,11 +266,11 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent
// -----------------------------------------------------------------------------
-void View::UpdateSelectionClipboard( sal_Bool bForceDeselect )
+void View::UpdateSelectionClipboard( bool bForceDeselect )
{
if( mpViewSh && mpViewSh->GetActiveWindow() )
{
- if( !bForceDeselect && GetMarkedObjectList().GetMarkCount() )
+ if( !bForceDeselect && areSdrObjectsSelected() )
CreateSelectionDataObject( this, *mpViewSh->GetActiveWindow() );
else if( SD_MOD()->pTransferSelection && ( SD_MOD()->pTransferSelection->GetView() == this ) )
{
@@ -284,13 +287,16 @@ void View::DoCut(::Window* )
const OutlinerView* pOLV = GetTextEditOutlinerView();
if( pOLV )
+ {
( (OutlinerView*) pOLV)->Cut();
- else if( AreObjectsMarked() )
+ }
+ else if( areSdrObjectsSelected() )
{
String aStr( SdResId(STR_UNDO_CUT) );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
DoCopy();
- BegUndo( ( aStr += sal_Unicode(' ') ) += GetDescriptionOfMarkedObjects() );
+ BegUndo( ( aStr += sal_Unicode(' ') ) += getSelectionDescription(aSelection) );
DeleteMarked();
EndUndo();
}
@@ -304,7 +310,7 @@ void View::DoCopy (::Window* pWindow)
if( pOLV )
( (OutlinerView*) pOLV)->Copy();
- else if( AreObjectsMarked() )
+ else if( areSdrObjectsSelected() )
{
BrkAction();
CreateClipboardDataObject( this, *pWindow );
@@ -326,7 +332,7 @@ void View::DoPaste (::Window* pWindow)
const_cast< OutlinerView* >(pOLV)->PasteSpecial();
SdrObject* pObj = GetTextEditObject();
- SdPage* pPage = (SdPage*)( pObj ? pObj->GetPage() : NULL );
+ SdPage* pPage = (SdPage*)( pObj ? pObj->getSdrPageFromSdrObject() : NULL );
::Outliner* pOutliner = pOLV->GetOutliner();
if( pOutliner)
@@ -336,9 +342,9 @@ void View::DoPaste (::Window* pWindow)
// remove all hard linebreaks from the title
if( pOutliner && pOutliner->GetParagraphCount() > 1 )
{
- sal_Bool bOldUpdateMode = pOutliner->GetUpdateMode();
+ bool bOldUpdateMode = pOutliner->GetUpdateMode();
- pOutliner->SetUpdateMode( sal_False );
+ pOutliner->SetUpdateMode( false );
const EditEngine& rEdit = pOutliner->GetEditEngine();
const int nParaCount = rEdit.GetParagraphCount();
@@ -358,23 +364,25 @@ void View::DoPaste (::Window* pWindow)
if( !mpDoc->IsChanged() )
{
if( pOutliner && pOutliner->IsModified() )
- mpDoc->SetChanged( sal_True );
+ mpDoc->SetChanged( true );
}
}
}
else
{
- Point aPos;
- sal_Int8 nDnDAction = DND_ACTION_COPY;
+ DrawViewShell* pDrViewSh = dynamic_cast< DrawViewShell* >(mpDocSh->GetViewShell());
- if( pWindow )
- aPos = pWindow->PixelToLogic( Rectangle( aPos, pWindow->GetOutputSizePixel() ).Center() );
+ if(pDrViewSh)
+ {
+ basegfx::B2DPoint aPos(0.0, 0.0);
+ sal_Int8 nDnDAction(DND_ACTION_COPY);
- DrawViewShell* pDrViewSh = (DrawViewShell*) mpDocSh->GetViewShell();
+ if(pWindow)
+ {
+ aPos = pWindow->GetLogicRange().getCenter();
+ }
- if (pDrViewSh != NULL)
- {
- if( !InsertData( aDataHelper, aPos, nDnDAction, sal_False ) )
+ if(!InsertData(aDataHelper, aPos, nDnDAction, false))
{
INetBookmark aINetBookmark( aEmptyStr, aEmptyStr );
@@ -385,7 +393,7 @@ void View::DoPaste (::Window* pWindow)
( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
{
- pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
+ pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, 0);
}
}
}
@@ -396,7 +404,7 @@ void View::DoPaste (::Window* pWindow)
void View::StartDrag( const Point& rStartPos, ::Window* pWindow )
{
- if( AreObjectsMarked() && IsAction() && mpViewSh && pWindow && !mpDragSrcMarkList )
+ if( areSdrObjectsSelected() && IsAction() && mpViewSh && pWindow && !maDragSrcMarkList.size() && GetSdrPageView() )
{
BrkAction();
@@ -408,19 +416,20 @@ void View::StartDrag( const Point& rStartPos, ::Window* pWindow )
if( pDrawViewShell )
{
FunctionReference xFunction( pDrawViewShell->GetCurrentFunction() );
+ FuDraw* pFuDraw = dynamic_cast< FuDraw* >(xFunction.get());
- if( xFunction.is() && xFunction->ISA( FuDraw ) )
- static_cast<FuDraw*>(xFunction.get())->ForcePointer( NULL );
+ if( pFuDraw )
+ pFuDraw->ForcePointer( NULL );
}
- mpDragSrcMarkList = new SdrMarkList(GetMarkedObjectList());
- mnDragSrcPgNum = GetSdrPageView()->GetPage()->GetPageNum();
+ maDragSrcMarkList = getSelectedSdrObjectVectorFromSdrMarkView();
+ mnDragSrcPgNum = GetSdrPageView()->getSdrPageFromSdrPageView().GetPageNumber();
if( IsUndoEnabled() )
{
String aStr( SdResId(STR_UNDO_DRAGDROP) );
aStr += sal_Unicode(' ');
- aStr += mpDragSrcMarkList->GetMarkDescription();
+ aStr += getSelectionDescription(maDragSrcMarkList);
BegUndo(aStr);
}
CreateDragDataObject( this, *pWindow, rStartPos );
@@ -440,39 +449,34 @@ void View::DragFinished( sal_Int8 nDropAction )
if( ( nDropAction & DND_ACTION_MOVE ) &&
pDragTransferable && !pDragTransferable->IsInternalMove() &&
- mpDragSrcMarkList && mpDragSrcMarkList->GetMarkCount() &&
+ maDragSrcMarkList.size() &&
!IsPresObjSelected() )
{
- mpDragSrcMarkList->ForceSort();
-
if( bUndo )
BegUndo();
- sal_uLong nm, nAnz = mpDragSrcMarkList->GetMarkCount();
+ sal_uInt32 nm;
- for( nm = nAnz; nm>0; )
+ for( nm = maDragSrcMarkList.size(); nm > 0; )
{
nm--;
- SdrMark* pM=mpDragSrcMarkList->GetMark(nm);
if( bUndo )
- AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pM->GetMarkedSdrObj()));
+ {
+ AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*maDragSrcMarkList[nm]));
+ }
}
- mpDragSrcMarkList->GetMark(0)->GetMarkedSdrObj()->GetOrdNum();
-
- for (nm=nAnz; nm>0;)
+ for (nm = maDragSrcMarkList.size(); nm > 0; )
{
nm--;
- SdrMark* pM=mpDragSrcMarkList->GetMark(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- sal_uInt32 nOrdNum=pObj->GetOrdNumDirect();
+ SdrObject* pObj = maDragSrcMarkList[nm];
- if( pObj && pObj->GetPage() )
+ if( pObj && pObj->getParentOfSdrObject() )
{
#ifdef DBG_UTIL
SdrObject* pChkObj =
#endif
- pObj->GetPage()->RemoveObject(nOrdNum);
+ pObj->getParentOfSdrObject()->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
DBG_ASSERT(pChkObj==pObj,"pChkObj!=pObj beim RemoveObject()");
}
}
@@ -482,50 +486,49 @@ void View::DragFinished( sal_Int8 nDropAction )
}
if( pDragTransferable )
- pDragTransferable->SetInternalMove( sal_False );
+ pDragTransferable->SetInternalMove( false );
if( bUndo )
EndUndo();
+
mnDragSrcPgNum = SDRPAGE_NOTFOUND;
- delete mpDragSrcMarkList;
- mpDragSrcMarkList = NULL;
+ maDragSrcMarkList.clear();
}
// -----------------------------------------------------------------------------
sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
- ::sd::Window*, sal_uInt16, sal_uInt16 nLayer )
+ ::sd::Window*, sal_uInt32, SdrLayerID aLayer )
{
String aLayerName( GetActiveLayer() );
SdrPageView* pPV = GetSdrPageView();
sal_Int8 nDropAction = rEvt.mnAction;
sal_Int8 nRet = DND_ACTION_NONE;
- if( nLayer != SDRLAYER_NOTFOUND )
+ if( aLayer != SDRLAYER_NOTFOUND )
{
- SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
- aLayerName = rLayerAdmin.GetLayerPerID(nLayer)->GetName();
+ SdrLayerAdmin& rLayerAdmin = mpDoc->GetModelLayerAdmin();
+ aLayerName = rLayerAdmin.GetLayerPerID(aLayer)->GetName();
}
- if( mbIsDropAllowed && !pPV->IsLayerLocked( aLayerName ) && pPV->IsLayerVisible( aLayerName ) )
+ if( mbIsDropAllowed && pPV && !pPV->IsLayerLocked( aLayerName ) && pPV->IsLayerVisible( aLayerName ) )
{
const OutlinerView* pOLV = GetTextEditOutlinerView();
- sal_Bool bIsInsideOutlinerView = sal_False;
+ bool bIsInsideOutlinerView = false;
if( pOLV )
{
Rectangle aRect( pOLV->GetOutputArea() );
+ SdrObject* pSelected = getSelectedIfSingle();
- if (GetMarkedObjectCount() == 1)
+ if (pSelected)
{
- SdrMark* pMark = GetSdrMarkByIndex(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- aRect.Union( pObj->GetLogicRect() );
+ aRect.Union( sdr::legacy::GetLogicRect(*pSelected) );
}
if( aRect.IsInside( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) ) )
{
- bIsInsideOutlinerView = sal_True;
+ bIsInsideOutlinerView = true;
}
}
@@ -552,32 +555,32 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
}
else
{
- const sal_Bool bDrawing = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_DRAWING );
- const sal_Bool bGraphic = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVXB );
- const sal_Bool bMtf = rTargetHelper.IsDropFormatSupported( FORMAT_GDIMETAFILE );
- const sal_Bool bBitmap = rTargetHelper.IsDropFormatSupported( FORMAT_BITMAP );
- sal_Bool bBookmark = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
- sal_Bool bXFillExchange = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_XFA );
+ const bool bDrawing = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_DRAWING );
+ const bool bGraphic = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVXB );
+ const bool bMtf = rTargetHelper.IsDropFormatSupported( FORMAT_GDIMETAFILE );
+ const bool bBitmap = rTargetHelper.IsDropFormatSupported( FORMAT_BITMAP );
+ bool bBookmark = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
+ bool bXFillExchange = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_XFA );
// check handle insert
if( !nRet && ( (bXFillExchange && ( SDRDRAG_GRADIENT == GetDragMode() )) || ( SDRDRAG_TRANSPARENCE == GetDragMode() ) ) )
{
const SdrHdlList& rHdlList = GetHdlList();
- for( sal_uInt32 n = 0; n < rHdlList.GetHdlCount(); n++ )
+ for( sal_uInt32 n(0); n < rHdlList.GetHdlCount(); n++ )
{
- SdrHdl* pIAOHandle = rHdlList.GetHdl( n );
+ SdrHdlColor* pIAOHandle = dynamic_cast< SdrHdlColor* >(rHdlList.GetHdlByIndex( n ));
- if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) )
+ if( pIAOHandle && HDL_COLR == pIAOHandle->GetKind() )
{
if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel))
{
nRet = nDropAction;
- static_cast< SdrHdlColor* >( pIAOHandle )->SetSize( SDR_HANDLE_COLOR_SIZE_SELECTED );
+ pIAOHandle->SetSize( SDR_HANDLE_COLOR_SIZE_SELECTED );
}
else
{
- static_cast< SdrHdlColor* >( pIAOHandle )->SetSize( SDR_HANDLE_COLOR_SIZE_NORMAL );
+ pIAOHandle->SetSize( SDR_HANDLE_COLOR_SIZE_NORMAL );
}
}
}
@@ -587,22 +590,23 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
if( !nRet && ( bXFillExchange || ( ( bDrawing || bGraphic || bMtf || bBitmap || bBookmark ) && ( nDropAction & DND_ACTION_LINK ) ) ) )
{
SdrObject* pPickObj = NULL;
- SdrPageView* pPageView = NULL;
::sd::Window* pWindow = mpViewSh->GetActiveWindow();
- Point aPos( pWindow->PixelToLogic( rEvt.maPosPixel ) );
- const sal_Bool bHasPickObj = PickObj( aPos, getHitTolLog(), pPickObj, pPageView );
- sal_Bool bIsPresTarget = sal_False;
+ const basegfx::B2DPoint aPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rEvt.maPosPixel.X(), rEvt.maPosPixel.Y()));
+ const bool bHasPickObj = PickObj( aPos, getHitTolLog(), pPickObj );
+ bool bIsPresTarget = false;
- if( bHasPickObj && pPickObj && ( pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall() ) )
+ if( bHasPickObj && pPickObj && ( pPickObj->IsEmptyPresObj() || findConnectionToSdrObject(pPickObj) ) )
{
- SdPage* pPage = (SdPage*) pPickObj->GetPage();
+ SdPage* pPage = (SdPage*) pPickObj->getSdrPageFromSdrObject();
if( pPage && pPage->IsMasterPage() )
bIsPresTarget = pPage->IsPresObj( pPickObj );
}
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pPickObj);
+
if( bHasPickObj && !bIsPresTarget &&
- ( !pPickObj->ISA( SdrGrafObj ) || bGraphic || bMtf || bBitmap || ( bXFillExchange && !pPickObj->ISA( SdrGrafObj ) && !pPickObj->ISA( SdrOle2Obj ) ) ) )
+ ( !pSdrGrafObj || bGraphic || bMtf || bBitmap || ( bXFillExchange && !pSdrGrafObj && !dynamic_cast< SdrOle2Obj* >(pPickObj) ) ) )
{
if( mpDropMarkerObj != pPickObj )
{
@@ -618,18 +622,18 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
nRet = nDropAction;
}
else
- bXFillExchange = sal_False;
+ bXFillExchange = false;
}
// check normal insert
if( !nRet )
{
- const sal_Bool bSBAFormat = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH );
- const sal_Bool bEditEngine = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_EDITENGINE );
- const sal_Bool bString = rTargetHelper.IsDropFormatSupported( FORMAT_STRING );
- const sal_Bool bRTF = rTargetHelper.IsDropFormatSupported( FORMAT_RTF );
- const sal_Bool bFile = rTargetHelper.IsDropFormatSupported( FORMAT_FILE );
- const sal_Bool bFileList = rTargetHelper.IsDropFormatSupported( FORMAT_FILE_LIST );
+ const bool bSBAFormat = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH );
+ const bool bEditEngine = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_EDITENGINE );
+ const bool bString = rTargetHelper.IsDropFormatSupported( FORMAT_STRING );
+ const bool bRTF = rTargetHelper.IsDropFormatSupported( FORMAT_RTF );
+ const bool bFile = rTargetHelper.IsDropFormatSupported( FORMAT_FILE );
+ const bool bFileList = rTargetHelper.IsDropFormatSupported( FORMAT_FILE_LIST );
if( mpDropMarker )
{
@@ -638,7 +642,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
}
if( bBookmark && bFile && ( nDropAction & DND_ACTION_MOVE ) && mpViewSh && SlideShow::IsRunning(mpViewSh->GetViewShellBase()) )
- bBookmark = sal_False;
+ bBookmark = false;
if( bDrawing || bGraphic || bMtf || bBitmap || bBookmark || bFile || bFileList || bXFillExchange || bSBAFormat || bEditEngine || bString || bRTF )
nRet = nDropAction;
@@ -669,7 +673,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
// -----------------------------------------------------------------------------
sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
- ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer )
+ ::sd::Window* pTargetWindow, sal_uInt32 nPage, SdrLayerID aLayer )
{
SdrPageView* pPV = GetSdrPageView();
String aActiveLayer = GetActiveLayer();
@@ -683,37 +687,38 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
mpDropMarkerObj = NULL;
}
- if( !pPV->IsLayerLocked( aActiveLayer ) )
+ if( pPV && !pPV->IsLayerLocked( aActiveLayer ) )
{
const OutlinerView* pOLV = GetTextEditOutlinerView();
- sal_Bool bIsInsideOutlinerView = sal_False;
+ bool bIsInsideOutlinerView = false;
if( pOLV )
{
Rectangle aRect( pOLV->GetOutputArea() );
+ SdrObject* pSelected = getSelectedIfSingle();
- if( GetMarkedObjectCount() == 1 )
+ if( pSelected )
{
- SdrMark* pMark = GetSdrMarkByIndex(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- aRect.Union( pObj->GetLogicRect() );
+ aRect.Union( sdr::legacy::GetLogicRect(*pSelected) );
}
Point aPos( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) );
if( aRect.IsInside( aPos ) )
{
- bIsInsideOutlinerView = sal_True;
+ bIsInsideOutlinerView = true;
}
}
if( !bIsInsideOutlinerView )
{
- Point aPos;
+ basegfx::B2DPoint aPos;
TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
if( pTargetWindow )
- aPos = pTargetWindow->PixelToLogic( rEvt.maPosPixel );
+ {
+ aPos = pTargetWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rEvt.maPosPixel.X(), rEvt.maPosPixel.Y());
+ }
// handle insert?
if( (!nRet && ( SDRDRAG_GRADIENT == GetDragMode() )) || (( SDRDRAG_TRANSPARENCE == GetDragMode() ) && aDataHelper.HasFormat( SOT_FORMATSTR_ID_XFA )) )
@@ -722,7 +727,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
for( sal_uInt32 n = 0; !nRet && n < rHdlList.GetHdlCount(); n++ )
{
- SdrHdl* pIAOHandle = rHdlList.GetHdl( n );
+ SdrHdl* pIAOHandle = rHdlList.GetHdlByIndex( n );
if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) )
{
@@ -732,11 +737,11 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_XFA, xStm ) && xStm.Is() )
{
- XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetPool() ) );
+ XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetItemPool() ) );
*xStm >> aFillData;
const Color aColor( ( (XFillColorItem&) aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ) ).GetColorValue() );
- static_cast< SdrHdlColor* >( pIAOHandle )->SetColor( aColor, sal_True );
+ static_cast< SdrHdlColor* >( pIAOHandle )->SetColor( aColor, true );
nRet = nDropAction;
}
}
@@ -745,7 +750,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
}
// standard insert?
- if( !nRet && InsertData( aDataHelper, aPos, nDropAction, sal_True, 0, nPage, nLayer ) )
+ if( !nRet && InsertData( aDataHelper, aPos, nDropAction, true, 0, nPage, aLayer ) )
nRet = nDropAction;
// special insert?
@@ -767,20 +772,19 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
// insert bookmark from own navigator (handled async. due to possible message box )
Application::PostUserEvent( LINK( this, View, ExecuteNavigatorDrop ),
new SdNavigatorDropEvent( rEvt, rTargetHelper, pTargetWindow,
- nPage, nLayer ) );
+ nPage, aLayer ) );
nRet = nDropAction;
}
else
{
SdrObject* pPickObj = NULL;
- SdrPageView* pPageView = NULL;
- if( PickObj( aPos, getHitTolLog(), pPickObj, pPageView ) )
+ if( PickObj( aPos, getHitTolLog(), pPickObj ) )
{
// insert as clip action => jump
rtl::OUString aBookmark( aINetBookmark.GetURL() );
SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo( pPickObj );
- sal_Bool bCreated = sal_False;
+ bool bCreated = false;
if( aBookmark.getLength() )
{
@@ -802,7 +806,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
if( !pInfo )
{
pInfo = SdDrawDocument::GetShapeUserData( *pPickObj, true );
- bCreated = sal_True;
+ bCreated = true;
}
// Undo-Action mit alten und neuen Groessen erzeugen
@@ -820,7 +824,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
pAction->SetPathObj(pInfo->mpPathObj, pInfo->mpPathObj);
pAction->SetClickAction(pInfo->meClickAction, eClickAction);
pAction->SetBookmark(pInfo->GetBookmark(), aBookmark);
-// pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation, sal_True);
+// pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation, true);
pAction->SetVerb(pInfo->mnVerb, pInfo->mnVerb);
pAction->SetSecondEffect(pInfo->meSecondEffect, pInfo->meSecondEffect);
pAction->SetSecondSpeed(pInfo->meSecondSpeed, pInfo->meSecondSpeed);
@@ -837,11 +841,16 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar
nRet = nDropAction;
}
}
- else if( mpViewSh->ISA( DrawViewShell ) )
+ else
{
- // insert as normal URL button
- ( (DrawViewShell*) mpViewSh )->InsertURLButton( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), String(), &aPos );
- nRet = nDropAction;
+ DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewSh);
+
+ if( pDrawViewShell )
+ {
+ // insert as normal URL button
+ pDrawViewShell->InsertURLButton( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), String(), &aPos );
+ nRet = nDropAction;
+ }
}
}
}
@@ -860,16 +869,21 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLB::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() );
INetBookmark aINetBookmark;
- if( pPageObjsTransferable && aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) )
+ if( pPageObjsTransferable
+ && aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark )
+ && GetSdrPageView() )
{
- Point aPos;
+ basegfx::B2DPoint aPos;
List aBookmarkList;
String aBookmark;
- SdPage* pPage = (SdPage*) GetSdrPageView()->GetPage();
- sal_uInt16 nPgPos = 0xFFFF;
+ SdPage& rPage = (SdPage&) GetSdrPageView()->getSdrPageFromSdrPageView();
+ sal_uInt32 nPgPos = 0xffffffff;
if( pSdNavigatorDropEvent->mpTargetWindow )
- aPos = pSdNavigatorDropEvent->mpTargetWindow->PixelToLogic( pSdNavigatorDropEvent->maPosPixel );
+ {
+ aPos = basegfx::B2DPoint(pSdNavigatorDropEvent->maPosPixel.X(), pSdNavigatorDropEvent->maPosPixel.Y());
+ aPos = pSdNavigatorDropEvent->mpTargetWindow->GetInverseViewTransformation() * aPos;
+ }
const rtl::OUString aURL( aINetBookmark.GetURL() );
sal_Int32 nIndex = aURL.indexOf( (sal_Unicode)'#' );
@@ -877,21 +891,21 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
aBookmark = aURL.copy( nIndex+1 );
aBookmarkList.Insert( &aBookmark );
- if( !pPage->IsMasterPage() )
+ if( !rPage.IsMasterPage() )
{
- if( pPage->GetPageKind() == PK_STANDARD )
- nPgPos = pPage->GetPageNum() + 2;
- else if( pPage->GetPageKind() == PK_NOTES )
- nPgPos = pPage->GetPageNum() + 1;
+ if( rPage.GetPageKind() == PK_STANDARD )
+ nPgPos = rPage.GetPageNumber() + 2;
+ else if( rPage.GetPageKind() == PK_NOTES )
+ nPgPos = rPage.GetPageNumber() + 1;
}
// Um zu gewaehrleisten, dass alle Seitennamen eindeutig sind, werden
// die einzufuegenden geprueft und gegebenenfalls in einer Ersatzliste
- // aufgenommen (bNameOK == sal_False -> Benutzer hat abgebrochen)
+ // aufgenommen (bNameOK == false -> Benutzer hat abgebrochen)
List* pExchangeList = NULL;
- sal_Bool bLink = ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() ? sal_True : sal_False );
- sal_Bool bNameOK = GetExchangeList( pExchangeList, &aBookmarkList, 2 );
- sal_Bool bReplace = sal_False;
+ bool bLink = ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() ? true : false );
+ bool bNameOK = GetExchangeList( pExchangeList, &aBookmarkList, 2 );
+ bool bReplace = false;
// Da man hier nicht weiss, ob es sich um eine Seite oder ein Objekt handelt,
// wird eine Liste sowohl mit Seiten, als auch mit Objekten gefuellt.
@@ -899,9 +913,9 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
if( bNameOK )
{
mpDoc->InsertBookmark( &aBookmarkList, pExchangeList,
- bLink, bReplace, nPgPos, sal_False,
+ bLink, bReplace, nPgPos, false,
&pPageObjsTransferable->GetDocShell(),
- sal_True, &aPos );
+ true, &aPos );
}
// Loeschen der ExchangeList
@@ -923,19 +937,19 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
|*
|* Rueckgabeparameter:
|* pExchangeList == NULL -> Namen sind alle eindeutig
-|* bNameOK == sal_False -> Benutzer hat abgebrochen
+|* bNameOK == false -> Benutzer hat abgebrochen
|* nType == 0 -> Seiten
|* nType == 1 -> Objekte
|* nType == 2 -> Seiten + Objekte
|*
\************************************************************************/
-sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType )
+bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType )
{
DBG_ASSERT( !rpExchangeList, "ExchangeList muss NULL sein!");
- sal_Bool bListIdentical = sal_True; // BookmarkList und ExchangeList sind gleich
- sal_Bool bNameOK = sal_True; // Name ist eindeutig
+ bool bListIdentical = true; // BookmarkList und ExchangeList sind gleich
+ bool bNameOK = true; // Name ist eindeutig
rpExchangeList = new List();
@@ -963,7 +977,7 @@ sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_
{
pDlg->SetEditHelpId( HID_SD_NAMEDIALOG_OBJECT );
- bNameOK = sal_False;
+ bNameOK = false;
pDlg->SetText( aTitle );
while( !bNameOK && pDlg->Execute() == RET_OK )
@@ -971,7 +985,7 @@ sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_
pDlg->GetName( *pNewName );
if( !mpDoc->GetObj( *pNewName ) )
- bNameOK = sal_True;
+ bNameOK = true;
}
delete pDlg;
@@ -1003,20 +1017,14 @@ sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_
return( bNameOK );
}
-typedef std::vector< std::pair< sal_uInt32, sal_uInt32 > > PathSurrogateVector;
-typedef std::vector< SdrObject* > SdrObjectVector;
-
void ImplProcessObjectList(SdrObject* pObj, SdrObjectVector& rVector )
{
- sal_Bool bIsGroup(pObj->IsGroupObject());
- if(bIsGroup && pObj->ISA(E3dObject) && !pObj->ISA(E3dScene))
- bIsGroup = sal_False;
-
+ const bool bIsGroup(pObj->getChildrenOfSdrObject());
rVector.push_back( pObj );
if(bIsGroup)
{
- SdrObjList* pObjList = pObj->GetSubList();
+ SdrObjList* pObjList = pObj->getChildrenOfSdrObject();
sal_uInt32 a;
for( a = 0; a < pObjList->GetObjCount(); a++)
ImplProcessObjectList(pObjList->GetObj(a), rVector);
@@ -1025,12 +1033,12 @@ void ImplProcessObjectList(SdrObject* pObj, SdrObjectVector& rVector )
SdrModel* View::GetMarkedObjModel() const
{
- return FmFormView::GetMarkedObjModel();;
+ return FmFormView::GetMarkedObjModel();
}
-sal_Bool View::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */)
+bool View::Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */)
{
- return FmFormView::Paste( rMod, rPos, pLst,nOptions );;
+ return FmFormView::Paste( rMod, rPos, pLst,nOptions );
}
} // end of namespace sd
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index ff4acd656c61..213ca13dfb4a 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -82,6 +82,7 @@
#include <tools/stream.hxx>
#include <vcl/cvtgrf.hxx>
#include <svx/sdrhittesthelper.hxx>
+#include <svx/svdlegacy.hxx>
// --------------
// - Namespaces -
@@ -122,38 +123,38 @@ SdrObject* ImpGetClone(Container& aConnectorContainer, SdrObject* pConnObj)
}
// #90129# restrict movement to WorkArea
-void ImpCheckInsertPos(Point& rPos, const Size& rSize, const Rectangle& rWorkArea)
+void ImpCheckInsertPos(basegfx::B2DPoint& rPos, const basegfx::B2DVector& rSize, const basegfx::B2DRange& rWorkRange)
{
- if(!rWorkArea.IsEmpty())
+ if(!rWorkRange.isEmpty())
{
- Rectangle aMarkRect(Point(rPos.X() - (rSize.Width() / 2), rPos.Y() - (rSize.Height() / 2)), rSize);
+ const basegfx::B2DRange aMarkRange(rPos - (rSize * 0.5), rPos + rSize);
- if(!aMarkRect.IsInside(rWorkArea))
+ if(!aMarkRange.isInside(rWorkRange))
{
- if(aMarkRect.Left() < rWorkArea.Left())
+ if(aMarkRange.getMinX() < rWorkRange.getMinX())
{
- rPos.X() += rWorkArea.Left() - aMarkRect.Left();
+ rPos.setX(rPos.getX() + rWorkRange.getMinX() - aMarkRange.getMinX());
}
- if(aMarkRect.Right() > rWorkArea.Right())
+ if(aMarkRange.getMaxX() > rWorkRange.getMaxX())
{
- rPos.X() -= aMarkRect.Right() - rWorkArea.Right();
+ rPos.setX(rPos.getX() - aMarkRange.getMaxX() - rWorkRange.getMaxX());
}
- if(aMarkRect.Top() < rWorkArea.Top())
+ if(aMarkRange.getMinY() < rWorkRange.getMinY())
{
- rPos.Y() += rWorkArea.Top() - aMarkRect.Top();
+ rPos.setY(rPos.getY() + rWorkRange.getMinY() - aMarkRange.getMinY());
}
- if(aMarkRect.Bottom() > rWorkArea.Bottom())
+ if(aMarkRange.getMaxY() > rWorkRange.getMaxY())
{
- rPos.Y() -= aMarkRect.Bottom() - rWorkArea.Bottom();
+ rPos.setY(rPos.getY() - aMarkRange.getMaxY() - rWorkRange.getMaxY());
}
}
}
}
-bool View::InsertMetaFile( TransferableDataHelper& rDataHelper, const Point& rPos, ImageMap* pImageMap, bool bOptimize )
+bool View::InsertMetaFile( TransferableDataHelper& rDataHelper, const basegfx::B2DPoint& rPos, ImageMap* pImageMap, bool bOptimize )
{
GDIMetaFile aMtf;
@@ -271,9 +272,11 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() )
bVector = true;
// #90129# restrict movement to WorkArea
- Point aInsertPos( rPos );
- Size aImageSize;
- aImageSize = bVector ? aMtf.GetPrefSize() : aGraphic.GetSizePixel();
+ const basegfx::B2DVector aImageSize(bVector
+ ? basegfx::B2DVector(aMtf.GetPrefSize().Width(), aMtf.GetPrefSize().Height())
+ : basegfx::B2DVector(aGraphic.GetSizePixel().Width(), aGraphic.GetSizePixel().Height()));
+ basegfx::B2DPoint aInsertPos(rPos);
+
ImpCheckInsertPos(aInsertPos, aImageSize, GetWorkArea());
if( bVector )
@@ -286,36 +289,37 @@ if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() )
return true;
}
-sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
- const Point& rPos, sal_Int8& rDnDAction, sal_Bool bDrag,
- sal_uLong nFormat, sal_uInt16 nPage, sal_uInt16 nLayer )
+bool View::InsertData( const TransferableDataHelper& rDataHelper,
+ const basegfx::B2DPoint& rPos, sal_Int8& rDnDAction, bool bDrag,
+ sal_uInt32 nFormat, sal_uInt32 nPage, sal_uInt32 nLayer )
{
maDropPos = rPos;
mnAction = rDnDAction;
- mbIsDropAllowed = sal_False;
+ mbIsDropAllowed = false;
TransferableDataHelper aDataHelper( rDataHelper );
SdrObject* pPickObj = NULL;
SdPage* pPage = NULL;
ImageMap* pImageMap = NULL;
- sal_Bool bReturn = sal_False;
- sal_Bool bLink = ( ( mnAction & DND_ACTION_LINK ) != 0 );
- sal_Bool bCopy = ( ( ( mnAction & DND_ACTION_COPY ) != 0 ) || bLink );
- sal_uLong nPasteOptions = SDRINSERT_SETDEFLAYER;
+ bool bReturn = false;
+ bool bLink = ( ( mnAction & DND_ACTION_LINK ) != 0 );
+ bool bCopy = ( ( ( mnAction & DND_ACTION_COPY ) != 0 ) || bLink );
+ sal_uInt32 nPasteOptions = SDRINSERT_SETDEFLAYER;
if (mpViewSh != NULL)
{
OSL_ASSERT (mpViewSh->GetViewShell()!=NULL);
SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient();
- if( mpViewSh->ISA(::sd::slidesorter::SlideSorterViewShell)
- || (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()))
- nPasteOptions |= SDRINSERT_DONTMARK;
+
+ if( dynamic_cast< ::sd::slidesorter::SlideSorterViewShell* >(mpViewSh) || (pIpClient && pIpClient->IsObjectInPlaceActive()))
+ {
+ nPasteOptions |= SDRINSERT_DONTMARK;
+ }
}
if( bDrag )
{
- SdrPageView* pPV = NULL;
- PickObj( rPos, getHitTolLog(), pPickObj, pPV );
+ PickObj( rPos, getHitTolLog(), pPickObj );
}
if( nPage != SDRPAGE_NOTFOUND )
@@ -381,7 +385,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
const View* pSourceView = pOwnData->GetView();
- if( pOwnData->GetDocShell() && pOwnData->IsPageTransferable() && ISA( View ) )
+ if( pOwnData->GetDocShell() && pOwnData->IsPageTransferable() && dynamic_cast< View* >(this) )
{
mpClipboard->HandlePageDrop (*pOwnData);
}
@@ -393,47 +397,43 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( nLayer != SDRLAYER_NOTFOUND )
{
// drop on layer tab bar
- SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
+ SdrLayerAdmin& rLayerAdmin = mpDoc->GetModelLayerAdmin();
SdrLayer* pLayer = rLayerAdmin.GetLayerPerID( nLayer );
SdrPageView* pPV = GetSdrPageView();
String aLayer( pLayer->GetName() );
- if( !pPV->IsLayerLocked( aLayer ) )
+ if( pPV && !pPV->IsLayerLocked( aLayer ) )
{
- pOwnData->SetInternalMove( sal_True );
- SortMarkedObjects();
+ pOwnData->SetInternalMove( true );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for( sal_uLong nM = 0; nM < GetMarkedObjectCount(); nM++ )
+ for( sal_uInt32 nM(0); nM < aSelection.size(); nM++ )
{
- SdrMark* pM = GetSdrMarkByIndex( nM );
- SdrObject* pO = pM->GetMarkedSdrObj();
+ SdrObject* pO = aSelection[nM];
- if( pO )
- {
// #i11702#
if( IsUndoEnabled() )
{
BegUndo(String(SdResId(STR_MODIFYLAYER)));
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectLayerChange(*pO, pO->GetLayer(), (SdrLayerID)nLayer));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectLayerChange(*pO, pO->GetLayer(), (SdrLayerID)nLayer));
EndUndo();
}
pO->SetLayer( (SdrLayerID) nLayer );
}
- }
- bReturn = sal_True;
+ bReturn = true;
}
}
else
{
SdrPageView* pPV = GetSdrPageView();
- sal_Bool bDropOnTabBar = sal_True;
+ bool bDropOnTabBar = true;
- if( !pPage && pPV->GetPage()->GetPageNum() != mnDragSrcPgNum )
+ if( !pPage && pPV && pPV->getSdrPageFromSdrPageView().GetPageNumber() != mnDragSrcPgNum )
{
- pPage = (SdPage*) pPV->GetPage();
- bDropOnTabBar = sal_False;
+ pPage = (SdPage*) &pPV->getSdrPageFromSdrPageView();
+ bDropOnTabBar = false;
}
if( pPage )
@@ -441,76 +441,78 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
// drop on other page
String aActiveLayer( GetActiveLayer() );
- if( !pPV->IsLayerLocked( aActiveLayer ) )
+ if( pPV && !pPV->IsLayerLocked( aActiveLayer ) )
{
if( !IsPresObjSelected() )
{
- SdrMarkList* pMarkList;
+ SdrObjectVector aMarkList;
- if( (mnDragSrcPgNum != SDRPAGE_NOTFOUND) && (mnDragSrcPgNum != pPV->GetPage()->GetPageNum()) )
+ if( (mnDragSrcPgNum != SDRPAGE_NOTFOUND) && (mnDragSrcPgNum != pPV->getSdrPageFromSdrPageView().GetPageNumber()) )
{
- pMarkList = mpDragSrcMarkList;
+ aMarkList = maDragSrcMarkList;
}
else
{
// actual mark list is used
- pMarkList = new SdrMarkList( GetMarkedObjectList());
+ aMarkList = getSelectedSdrObjectVectorFromSdrMarkView();
}
- pMarkList->ForceSort();
// #83525# stuff to remember originals and clones
Container aConnectorContainer(0);
sal_uInt32 a, nConnectorCount(0L);
- Point aCurPos;
+ basegfx::B2DPoint aCurPos;
// calculate real position of current
// source objects, if necessary (#103207)
if( pOwnData == SD_MOD()->pTransferSelection )
{
- Rectangle aCurBoundRect;
+ const basegfx::B2DRange aCurBoundRange(sdr::legacy::GetAllObjBoundRange(aMarkList));
- if( pMarkList->TakeBoundRect( pPV, aCurBoundRect ) )
- aCurPos = aCurBoundRect.TopLeft();
+ if(!aCurBoundRange.isEmpty())
+ {
+ aCurPos = aCurBoundRange.getMinimum();
+ }
else
+ {
aCurPos = pOwnData->GetStartPos();
+ }
}
else
+ {
aCurPos = pOwnData->GetStartPos();
+ }
- const Size aVector( maDropPos.X() - aCurPos.X(), maDropPos.Y() - aCurPos.Y() );
+ const basegfx::B2DVector aVector(maDropPos - aCurPos);
+ const basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(aVector));
- for(a = 0; a < pMarkList->GetMarkCount(); a++)
+ for(a = 0; a < aMarkList.size(); a++)
{
- SdrMark* pM = pMarkList->GetMark(a);
- SdrObject* pObj = pM->GetMarkedSdrObj()->Clone();
+ SdrObject* pObj = aMarkList[a]->CloneSdrObject(&pPage->getSdrModelFromSdrPage());
- if(pObj)
+ if(!bDropOnTabBar)
{
- if(!bDropOnTabBar)
- {
- // #83525# do a NbcMove(...) instead of setting SnapRects here
- pObj->NbcMove(aVector);
- }
+ // #83525# do a NbcMove(...) instead of setting SnapRects here
+ sdr::legacy::transformSdrObject(*pObj, aTransform);
+ }
- pPage->InsertObject(pObj);
+ pPage->InsertObjectToSdrObjList(*pObj);
- if( IsUndoEnabled() )
- {
- BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
- EndUndo();
- }
+ if( IsUndoEnabled() )
+ {
+ BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pObj));
+ EndUndo();
+ }
- // #83525#
- ImpRememberOrigAndClone* pRem = new ImpRememberOrigAndClone;
- pRem->pOrig = pM->GetMarkedSdrObj();
- pRem->pClone = pObj;
- aConnectorContainer.Insert(pRem, CONTAINER_APPEND);
+ // #83525#
+ ImpRememberOrigAndClone* pRem = new ImpRememberOrigAndClone;
+ pRem->pOrig = aMarkList[a];
+ pRem->pClone = pObj;
+ aConnectorContainer.Insert(pRem, CONTAINER_APPEND);
- if(pObj->ISA(SdrEdgeObj))
- nConnectorCount++;
- }
+ if(pObj->IsSdrEdgeObj())
+ nConnectorCount++;
}
// #83525# try to re-establish connections at clones
@@ -519,14 +521,13 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
for(a = 0; a < aConnectorContainer.Count(); a++)
{
ImpRememberOrigAndClone* pRem = (ImpRememberOrigAndClone*)aConnectorContainer.GetObject(a);
+ SdrEdgeObj* pOrigEdge = dynamic_cast< SdrEdgeObj* >(pRem->pOrig);
+ SdrEdgeObj* pCloneEdge = dynamic_cast< SdrEdgeObj* >(pRem->pClone);
- if(pRem->pClone->ISA(SdrEdgeObj))
+ if(pOrigEdge && pCloneEdge)
{
- SdrEdgeObj* pOrigEdge = (SdrEdgeObj*)pRem->pOrig;
- SdrEdgeObj* pCloneEdge = (SdrEdgeObj*)pRem->pClone;
-
// test first connection
- SdrObjConnection& rConn0 = pOrigEdge->GetConnection(sal_False);
+ SdrObjConnection& rConn0 = pOrigEdge->GetConnection(false);
SdrObject* pConnObj = rConn0.GetObject();
if(pConnObj)
{
@@ -534,8 +535,8 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if(pConnClone)
{
// if dest obj was cloned, too, re-establish connection
- pCloneEdge->ConnectToNode(sal_False, pConnClone);
- pCloneEdge->GetConnection(sal_False).SetConnectorId(rConn0.GetConnectorId());
+ pCloneEdge->ConnectToNode(false, pConnClone);
+ pCloneEdge->GetConnection(false).SetConnectorId(rConn0.GetConnectorId());
}
else
{
@@ -543,22 +544,21 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
const SdrGluePointList* pGlueList = pConnObj->GetGluePointList();
if(pGlueList)
{
- sal_uInt16 nInd = pGlueList->FindGluePoint(rConn0.GetConnectorId());
+ sal_uInt32 nInd = pGlueList->FindGluePoint(rConn0.GetConnectorId());
if(SDRGLUEPOINT_NOTFOUND != nInd)
{
const SdrGluePoint& rGluePoint = (*pGlueList)[nInd];
- Point aPosition = rGluePoint.GetAbsolutePos(*pConnObj);
- aPosition.X() += aVector.A();
- aPosition.Y() += aVector.B();
- pCloneEdge->SetTailPoint(sal_False, aPosition);
+ basegfx::B2DPoint aPosition = rGluePoint.GetAbsolutePos(sdr::legacy::GetSnapRange(*pConnObj));
+ aPosition += aVector;
+ pCloneEdge->SetTailPoint(false, aPosition);
}
}
}
}
// test second connection
- SdrObjConnection& rConn1 = pOrigEdge->GetConnection(sal_True);
+ SdrObjConnection& rConn1 = pOrigEdge->GetConnection(true);
pConnObj = rConn1.GetObject();
if(pConnObj)
{
@@ -566,8 +566,8 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if(pConnClone)
{
// if dest obj was cloned, too, re-establish connection
- pCloneEdge->ConnectToNode(sal_True, pConnClone);
- pCloneEdge->GetConnection(sal_True).SetConnectorId(rConn1.GetConnectorId());
+ pCloneEdge->ConnectToNode(true, pConnClone);
+ pCloneEdge->GetConnection(true).SetConnectorId(rConn1.GetConnectorId());
}
else
{
@@ -575,15 +575,14 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
const SdrGluePointList* pGlueList = pConnObj->GetGluePointList();
if(pGlueList)
{
- sal_uInt16 nInd = pGlueList->FindGluePoint(rConn1.GetConnectorId());
+ sal_uInt32 nInd = pGlueList->FindGluePoint(rConn1.GetConnectorId());
if(SDRGLUEPOINT_NOTFOUND != nInd)
{
const SdrGluePoint& rGluePoint = (*pGlueList)[nInd];
- Point aPosition = rGluePoint.GetAbsolutePos(*pConnObj);
- aPosition.X() += aVector.A();
- aPosition.Y() += aVector.B();
- pCloneEdge->SetTailPoint(sal_True, aPosition);
+ basegfx::B2DPoint aPosition = rGluePoint.GetAbsolutePos(sdr::legacy::GetSnapRange(*pConnObj));
+ aPosition += aVector;
+ pCloneEdge->SetTailPoint(true, aPosition);
}
}
}
@@ -596,24 +595,20 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
for(a = 0; a < aConnectorContainer.Count(); a++)
delete (ImpRememberOrigAndClone*)aConnectorContainer.GetObject(a);
- if( pMarkList != mpDragSrcMarkList )
- delete pMarkList;
-
- bReturn = sal_True;
+ bReturn = true;
}
else
{
maDropErrorTimer.Start();
- bReturn = sal_False;
+ bReturn = false;
}
}
}
else
{
- pOwnData->SetInternalMove( sal_True );
- MoveAllMarked( Size( maDropPos.X() - pOwnData->GetStartPos().X(),
- maDropPos.Y() - pOwnData->GetStartPos().Y() ), bCopy );
- bReturn = sal_True;
+ pOwnData->SetInternalMove( true );
+ MoveMarkedObj(maDropPos - pOwnData->GetStartPos(), bCopy );
+ bReturn = true;
}
}
}
@@ -623,23 +618,26 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( !pSourceView->IsPresObjSelected() )
{
// model is owned by from AllocModel() created DocShell
- SdDrawDocument* pSourceDoc = (SdDrawDocument*) pSourceView->GetModel();
- pSourceDoc->CreatingDataObj( pOwnData );
+ SdDrawDocument& rSourceDoc = dynamic_cast< SdDrawDocument& >(pSourceView->getSdrModelFromSdrView());
+ rSourceDoc.CreatingDataObj( pOwnData );
SdDrawDocument* pModel = (SdDrawDocument*) pSourceView->GetAllMarkedModel();
bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
- if( !pPage )
- pPage = (SdPage*) GetSdrPageView()->GetPage();
+ if( !pPage && GetSdrPageView() )
+ pPage = (SdPage*) &GetSdrPageView()->getSdrPageFromSdrPageView();
- String aLayout( pPage->GetLayoutName() );
- aLayout.Erase( aLayout.SearchAscii( SD_LT_SEPARATOR ) );
- pPage->SetPresentationLayout( aLayout, sal_False, sal_False );
- pSourceDoc->CreatingDataObj( NULL );
+ if(pPage)
+ {
+ String aLayout( pPage->GetLayoutName() );
+ aLayout.Erase( aLayout.SearchAscii( SD_LT_SEPARATOR ) );
+ pPage->SetPresentationLayout( aLayout, false, false );
+ rSourceDoc.CreatingDataObj( NULL );
+ }
}
else
{
maDropErrorTimer.Start();
- bReturn = sal_False;
+ bReturn = false;
}
}
}
@@ -648,31 +646,30 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
SdDrawDocument* pWorkModel = (SdDrawDocument*) pOwnData->GetWorkDocument();
SdPage* pWorkPage = (SdPage*) pWorkModel->GetSdPage( 0, PK_STANDARD );
- pWorkPage->SetRectsDirty();
-
// #120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
-
- maDropPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 );
- maDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
+ const basegfx::B2DVector aOffset(sdr::legacy::GetAllObjBoundRange(pWorkPage->getSdrObjectVector()).getRange());
+ maDropPos = pOwnData->GetStartPos() + (aOffset * 0.5);
// delete pages, that are not of any interest for us
for( long i = ( pWorkModel->GetPageCount() - 1 ); i >= 0; i-- )
{
- SdPage* pP = static_cast< SdPage* >( pWorkModel->GetPage( (sal_uInt16) i ) );
+ SdPage* pP = static_cast< SdPage* >( pWorkModel->GetPage( (sal_uInt32) i ) );
if( pP->GetPageKind() != PK_STANDARD )
- pWorkModel->DeletePage( (sal_uInt16) i );
+ pWorkModel->DeletePage( i );
}
bReturn = Paste( *pWorkModel, maDropPos, pPage, nPasteOptions );
- if( !pPage )
- pPage = (SdPage*) GetSdrPageView()->GetPage();
+ if( !pPage && GetSdrPageView() )
+ pPage = (SdPage*) &GetSdrPageView()->getSdrPageFromSdrPageView();
- String aLayout(pPage->GetLayoutName());
- aLayout.Erase(aLayout.SearchAscii(SD_LT_SEPARATOR));
- pPage->SetPresentationLayout( aLayout, sal_False, sal_False );
+ if(pPage)
+ {
+ String aLayout(pPage->GetLayoutName());
+ aLayout.Erase(aLayout.SearchAscii(SD_LT_SEPARATOR));
+ pPage->SetPresentationLayout( aLayout, false, false );
+ }
}
}
else if( CHECK_FORMAT_TRANS( SOT_FORMATSTR_ID_DRAWING ) )
@@ -681,7 +678,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStm ) )
{
- sal_Bool bChanged = sal_False;
+ bool bChanged = false;
DrawDocShellRef xShell = new DrawDocShell(SFX_CREATE_MODE_INTERNAL);
xShell->DoInitNew(0);
@@ -703,44 +700,37 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
{
if( bReturn )
{
- if( pModel->GetSdPage( 0, PK_STANDARD )->GetObjCount() == 1 )
+ if(1 == pModel->GetSdPage( 0, PK_STANDARD )->GetObjCount())
{
// only one object
SdrObject* pObj = pModel->GetSdPage( 0, PK_STANDARD )->GetObj( 0 );
SdrObject* pPickObj2 = NULL;
- SdrPageView* pPV = NULL;
- PickObj( rPos, getHitTolLog(), pPickObj2, pPV );
+ PickObj( rPos, getHitTolLog(), pPickObj2 );
- if( ( mnAction & DND_ACTION_MOVE ) && pPickObj2 && pObj )
+ if( ( mnAction & DND_ACTION_MOVE ) && pPickObj2 && pObj && GetSdrPageView() )
{
// replace object
- SdrObject* pNewObj = pObj->Clone();
- Rectangle aPickObjRect( pPickObj2->GetCurrentBoundRect() );
- Size aPickObjSize( aPickObjRect.GetSize() );
- Point aVec( aPickObjRect.TopLeft() );
- Rectangle aObjRect( pNewObj->GetCurrentBoundRect() );
- Size aObjSize( aObjRect.GetSize() );
-
- Fraction aScaleWidth( aPickObjSize.Width(), aObjSize.Width() );
- Fraction aScaleHeight( aPickObjSize.Height(), aObjSize.Height() );
- pNewObj->NbcResize( aObjRect.TopLeft(), aScaleWidth, aScaleHeight );
+ SdrPage& rWorkPage = GetSdrPageView()->getSdrPageFromSdrPageView();
+ SdrObject* pNewObj = pObj->CloneSdrObject(&rWorkPage.getSdrModelFromSdrPage());
- aVec -= aObjRect.TopLeft();
- pNewObj->NbcMove( Size( aVec.X(), aVec.Y() ) );
+ // copy transformation and layer
+ pNewObj->setSdrObjectTransformation(pPickObj2->getSdrObjectTransformation());
+ pNewObj->SetLayer( pPickObj2->GetLayer() );
const bool bUndo = IsUndoEnabled();
if( bUndo )
BegUndo( String( SdResId(STR_UNDO_DRAGDROP ) ) );
- pNewObj->NbcSetLayer( pPickObj->GetLayer() );
- SdrPage* pWorkPage = GetSdrPageView()->GetPage();
- pWorkPage->InsertObject( pNewObj );
+
+ rWorkPage.InsertObjectToSdrObjList(*pNewObj);
+
if( bUndo )
{
AddUndo( mpDoc->GetSdrUndoFactory().CreateUndoNewObject( *pNewObj ) );
AddUndo( mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject( *pPickObj2 ) );
}
- pWorkPage->RemoveObject( pPickObj2->GetOrdNum() );
+
+ rWorkPage.RemoveObjectFromSdrObjList( pPickObj2->GetNavigationPosition() );
if( bUndo )
{
@@ -748,14 +738,17 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
}
else
{
- SdrObject::Free(pPickObj2 );
+ deleteSdrObjectSafeAndClearPointer(pPickObj2);
}
- bChanged = sal_True;
+
+ bChanged = true;
mnAction = DND_ACTION_COPY;
}
- else if( ( mnAction & DND_ACTION_LINK ) && pPickObj && pObj && !pPickObj->ISA( SdrGrafObj ) && !pPickObj->ISA( SdrOle2Obj ) )
+ else if( ( mnAction & DND_ACTION_LINK ) && pPickObj && pObj
+ && !dynamic_cast< SdrGrafObj* >(pPickObj)
+ && !dynamic_cast< SdrOle2Obj* >(pPickObj) )
{
- SfxItemSet aSet( mpDoc->GetPool() );
+ SfxItemSet aSet( mpDoc->GetItemPool() );
// set new attributes to object
const bool bUndo = IsUndoEnabled();
@@ -774,23 +767,23 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
pPickObj->SetMergedItemSetAndBroadcast( aSet );
- if( pPickObj->ISA( E3dObject ) && pObj->ISA( E3dObject ) )
+ if( dynamic_cast< E3dObject* >(pPickObj) && dynamic_cast< E3dObject* >(pObj) )
{
// Zusaetzlich 3D Attribute handeln
- SfxItemSet aNewSet( mpDoc->GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
- SfxItemSet aOldSet( mpDoc->GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
+ SfxItemSet aNewSet( pObj->GetObjectItemPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
+ SfxItemSet aOldSet( pPickObj->GetObjectItemPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
aOldSet.Put(pPickObj->GetMergedItemSet());
aNewSet.Put( pObj->GetMergedItemSet() );
if( bUndo )
- AddUndo( new E3dAttributesUndoAction( *mpDoc, this, (E3dObject*) pPickObj, aNewSet, aOldSet, sal_False ) );
+ AddUndo( new E3dAttributesUndoAction( *mpDoc, this, (E3dObject*) pPickObj, aNewSet, aOldSet, false ) );
pPickObj->SetMergedItemSetAndBroadcast( aNewSet );
}
if( bUndo )
EndUndo();
- bChanged = sal_True;
+ bChanged = true;
}
}
}
@@ -799,15 +792,11 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
{
SdrPage* pWorkPage = pModel->GetSdPage( 0, PK_STANDARD );
- pWorkPage->SetRectsDirty();
-
if( pOwnData )
{
// #120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
-
- maDropPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 );
- maDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
+ const basegfx::B2DVector aOffset(sdr::legacy::GetAllObjBoundRange(pWorkPage->getSdrObjectVector()).getRange());
+ maDropPos = pOwnData->GetStartPos() + (aOffset * 0.5);
}
bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
@@ -827,16 +816,19 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( pObj )
{
- Rectangle aRect( pObj->GetLogicRect() );
- Size aSize( aRect.GetSize() );
+ const basegfx::B2DVector& rScale = pObj->getSdrObjectScale();
+
+ maDropPos -= absolute(rScale) * 0.5;
- maDropPos.X() -= ( aSize.Width() >> 1 );
- maDropPos.Y() -= ( aSize.Height() >> 1 );
+ pObj->setSdrObjectTransformation(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ rScale,
+ pObj->getSdrObjectShearX(),
+ pObj->getSdrObjectRotate(),
+ maDropPos));
- aRect.SetPos( maDropPos );
- pObj->SetLogicRect( aRect );
- InsertObjectAtView( pObj, *GetSdrPageView(), SDRINSERT_SETDEFLAYER );
- bReturn = sal_True;
+ InsertObjectAtView( *pObj, SDRINSERT_SETDEFLAYER );
+ bReturn = true;
}
}
}
@@ -856,7 +848,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( mpDoc->GetDocSh() && ( mpDoc->GetDocSh()->GetClassName() == aObjDesc.maClassName ) )
{
uno::Reference < embed::XStorage > xStore( ::comphelper::OStorageHelper::GetStorageFromInputStream( xStm ) );
- ::sd::DrawDocShellRef xDocShRef( new ::sd::DrawDocShell( SFX_CREATE_MODE_EMBEDDED, sal_True, mpDoc->GetDocumentType() ) );
+ ::sd::DrawDocShellRef xDocShRef( new ::sd::DrawDocShell( SFX_CREATE_MODE_EMBEDDED, true, mpDoc->GetDocumentType() ) );
// mba: BaseURL doesn't make sense for clipboard functionality
SfxMedium *pMedium = new SfxMedium( xStore, String() );
@@ -865,34 +857,33 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
SdDrawDocument* pModel = (SdDrawDocument*) xDocShRef->GetDoc();
SdPage* pWorkPage = (SdPage*) pModel->GetSdPage( 0, PK_STANDARD );
- pWorkPage->SetRectsDirty();
-
if( pOwnData )
{
// #120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
-
- maDropPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 );
- maDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
+ const basegfx::B2DVector aOffset(sdr::legacy::GetAllObjBoundRange(pWorkPage->getSdrObjectVector()).getRange());
+ maDropPos = pOwnData->GetStartPos() + (aOffset * 0.5);
}
// delete pages, that are not of any interest for us
for( long i = ( pModel->GetPageCount() - 1 ); i >= 0; i-- )
{
- SdPage* pP = static_cast< SdPage* >( pModel->GetPage( (sal_uInt16) i ) );
+ SdPage* pP = static_cast< SdPage* >( pModel->GetPage( (sal_uInt32) i ) );
if( pP->GetPageKind() != PK_STANDARD )
- pModel->DeletePage( (sal_uInt16) i );
+ pModel->DeletePage( i );
}
bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
- if( !pPage )
- pPage = (SdPage*) GetSdrPageView()->GetPage();
+ if( !pPage && GetSdrPageView() )
+ pPage = (SdPage*) &GetSdrPageView()->getSdrPageFromSdrPageView();
- String aLayout(pPage->GetLayoutName());
- aLayout.Erase(aLayout.SearchAscii(SD_LT_SEPARATOR));
- pPage->SetPresentationLayout( aLayout, sal_False, sal_False );
+ if(pPage)
+ {
+ String aLayout(pPage->GetLayoutName());
+ aLayout.Erase(aLayout.SearchAscii(SD_LT_SEPARATOR));
+ pPage->SetPresentationLayout( aLayout, false, false );
+ }
}
xDocShRef->DoClose();
@@ -909,7 +900,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
// try to get the replacement image from the clipboard
Graphic aGraphic;
- sal_uLong nGrFormat = 0;
+ sal_uInt32 nGrFormat = 0;
// (wg. Selection Manager bei Trustet Solaris)
#ifndef SOLARIS
@@ -978,15 +969,18 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM );
}
- Size aMaxSize( mpDoc->GetMaxObjSize() );
+ const basegfx::B2DVector aObjectSize(aSize.Width(), aSize.Height());
+ maDropPos -= basegfx::minimum(aObjectSize, mpDoc->GetMaxObjectScale()) * 0.5;
+// maDropPos.setX(maDropPos.getX() - (Min( aSize.Width(), basegfx::fround(mpDoc->GetMaxObjectScale().getX()) ) >> 1));
+// maDropPos.setY(maDropPos.getY() - (Min( aSize.Height(), basegfx::fround(mpDoc->GetMaxObjectScale().getY()) ) >> 1));
- maDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1;
- maDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1;
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aObjectSize, maDropPos));
- Rectangle aRect( maDropPos, aSize );
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect );
- SdrPageView* pPV = GetSdrPageView();
- sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
+ sal_uInt32 nOptions = SDRINSERT_SETDEFLAYER;
if (mpViewSh!=NULL)
{
@@ -997,7 +991,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
nOptions |= SDRINSERT_DONTMARK;
}
- InsertObjectAtView( pObj, *pPV, nOptions );
+ InsertObjectAtView( *pObj, nOptions );
if( pImageMap )
pObj->InsertUserData( new SdIMapInfo( *pImageMap ) );
@@ -1023,7 +1017,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
}
}
- bReturn = sal_True;
+ bReturn = true;
}
}
}
@@ -1080,7 +1074,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
// try to get the replacement image from the clipboard
Graphic aGraphic;
- sal_uLong nGrFormat = 0;
+ sal_uInt32 nGrFormat = 0;
// (wg. Selection Manager bei Trustet Solaris)
#ifndef SOLARIS
@@ -1148,15 +1142,18 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MAP_100TH_MM );
}
- Size aMaxSize( mpDoc->GetMaxObjSize() );
+ const basegfx::B2DVector aObjectSize(aSize.Width(), aSize.Height());
+ maDropPos -= basegfx::minimum(aObjectSize, mpDoc->GetMaxObjectScale()) * 0.5;
+// maDropPos.setX(maDropPos.getX() - (Min( aSize.Width(), basegfx::fround(mpDoc->GetMaxObjectScale().getX()) ) >> 1));
+// maDropPos.setY(maDropPos.getY() - (Min( aSize.Height(), basegfx::fround(mpDoc->GetMaxObjectScale().getY()) ) >> 1));
- maDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1;
- maDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1;
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aObjectSize, maDropPos));
- Rectangle aRect( maDropPos, aSize );
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect );
- SdrPageView* pPV = GetSdrPageView();
- sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
+ sal_uInt32 nOptions = SDRINSERT_SETDEFLAYER;
if (mpViewSh!=NULL)
{
@@ -1167,14 +1164,14 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
nOptions |= SDRINSERT_DONTMARK;
}
- InsertObjectAtView( pObj, *pPV, nOptions );
+ InsertObjectAtView( *pObj, nOptions );
if( pImageMap )
pObj->InsertUserData( new SdIMapInfo( *pImageMap ) );
// let the object stay in loaded state after insertion
pObj->Unload();
- bReturn = sal_True;
+ bReturn = true;
}
}
}
@@ -1191,7 +1188,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_SVXB, xStm ) )
{
- Point aInsertPos( rPos );
+ basegfx::B2DPoint aInsertPos(rPos);
Graphic aGraphic;
*xStm >> aGraphic;
@@ -1203,28 +1200,25 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkModel->GetSdPage( 0, PK_STANDARD ) :
pWorkModel->GetPage( 0 ) );
- pWorkPage->SetRectsDirty();
-
// #120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ const basegfx::B2DVector aRange(sdr::legacy::GetAllObjBoundRange(pWorkPage->getSdrObjectVector()).getRange());
- aInsertPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 );
- aInsertPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
+ aInsertPos = pOwnData->GetStartPos() + (aRange * 0.5);
}
// #90129# restrict movement to WorkArea
- Size aImageMapSize = OutputDevice::LogicToLogic(aGraphic.GetPrefSize(),
- aGraphic.GetPrefMapMode(), MapMode(MAP_100TH_MM));
+ const Size aImageMapSize(OutputDevice::LogicToLogic(
+ aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), MapMode(MAP_100TH_MM)));
- ImpCheckInsertPos(aInsertPos, aImageMapSize, GetWorkArea());
+ ImpCheckInsertPos(aInsertPos, basegfx::B2DVector(aImageMapSize.Width(), aImageMapSize.Height()), GetWorkArea());
InsertGraphic( aGraphic, mnAction, aInsertPos, NULL, pImageMap );
- bReturn = sal_True;
+ bReturn = true;
}
}
else if( ( !bLink || pPickObj ) && CHECK_FORMAT_TRANS( FORMAT_GDIMETAFILE ) )
{
- Point aInsertPos( rPos );
+ basegfx::B2DPoint aInsertPos( rPos );
if( pOwnData && pOwnData->GetWorkDocument() )
@@ -1234,16 +1228,13 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkModel->GetSdPage( 0, PK_STANDARD ) :
pWorkModel->GetPage( 0 ) );
- pWorkPage->SetRectsDirty();
-
// #120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ const basegfx::B2DVector aRange(sdr::legacy::GetAllObjBoundRange(pWorkPage->getSdrObjectVector()).getRange());
- aInsertPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 );
- aInsertPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
+ aInsertPos = pOwnData->GetStartPos() + (aRange * 0.5);
}
- bReturn = InsertMetaFile( aDataHelper, aInsertPos, pImageMap, nFormat == 0 ? true : false ) ? sal_True : sal_False;
+ bReturn = InsertMetaFile( aDataHelper, aInsertPos, pImageMap, nFormat == 0 ? true : false ) ? true : false;
}
else if( ( !bLink || pPickObj ) && CHECK_FORMAT_TRANS( FORMAT_BITMAP ) )
{
@@ -1251,7 +1242,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( aDataHelper.GetBitmap( FORMAT_BITMAP, aBmp ) )
{
- Point aInsertPos( rPos );
+ basegfx::B2DPoint aInsertPos(rPos);
if( pOwnData && pOwnData->GetWorkDocument() )
{
@@ -1260,21 +1251,18 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkModel->GetSdPage( 0, PK_STANDARD ) :
pWorkModel->GetPage( 0 ) );
- pWorkPage->SetRectsDirty();
-
// #120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ const basegfx::B2DVector aSize(sdr::legacy::GetAllObjBoundRange(pWorkPage->getSdrObjectVector()).getRange());
- aInsertPos.X() = pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 );
- aInsertPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
+ aInsertPos = pOwnData->GetStartPos() + (aSize * 0.5);
}
// #90129# restrict movement to WorkArea
- Size aImageMapSize(aBmp.GetPrefSize());
+ const basegfx::B2DVector aImageMapSize(aBmp.GetPrefSize().Width(), aBmp.GetPrefSize().Height());
ImpCheckInsertPos(aInsertPos, aImageMapSize, GetWorkArea());
InsertGraphic( aBmp, mnAction, aInsertPos, NULL, pImageMap );
- bReturn = sal_True;
+ bReturn = true;
}
}
else if( pPickObj && CHECK_FORMAT_TRANS( SOT_FORMATSTR_ID_XFA ) )
@@ -1283,14 +1271,14 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_XFA, xStm ) )
{
- XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetPool() ) );
+ XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetItemPool() ) );
*xStm >> aFillData;
if( IsUndoEnabled() )
{
BegUndo( String( SdResId( STR_UNDO_DRAGDROP ) ) );
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pPickObj ) );
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject( *pPickObj ) );
EndUndo();
}
@@ -1303,28 +1291,22 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
const XFillColorItem& rColItem = (XFillColorItem&) rSet.Get( XATTR_FILLCOLOR );
Color aColor( rColItem.GetColorValue() );
String aName( rColItem.GetName() );
- SfxItemSet aSet( mpDoc->GetPool() );
- sal_Bool bClosed = pPickObj->IsClosedObj();
+ SfxItemSet aSet( mpDoc->GetItemPool() );
+ const bool bClosed(pPickObj->IsClosedObj());
::sd::Window* pWin = mpViewSh->GetActiveWindow();
- sal_uInt16 nHitLog = (sal_uInt16) pWin->PixelToLogic(
- Size(FuPoor::HITPIX, 0 ) ).Width();
- const long n2HitLog = nHitLog << 1;
- Point aHitPosR( rPos );
- Point aHitPosL( rPos );
- Point aHitPosT( rPos );
- Point aHitPosB( rPos );
- const SetOfByte* pVisiLayer = &GetSdrPageView()->GetVisibleLayers();
-
- aHitPosR.X() += n2HitLog;
- aHitPosL.X() -= n2HitLog;
- aHitPosT.Y() += n2HitLog;
- aHitPosB.Y() -= n2HitLog;
+ const double fHitLog(basegfx::B2DVector(pWin->GetInverseViewTransformation() * basegfx::B2DVector(FuPoor::HITPIX, 0.0)).getLength());
+ double f2HitLog(fHitLog * 2);
+
+ const basegfx::B2DPoint aHitPosR(rPos.getX() + f2HitLog, rPos.getY());
+ const basegfx::B2DPoint aHitPosL(rPos.getX() - f2HitLog, rPos.getY());
+ const basegfx::B2DPoint aHitPosT(rPos.getX(), rPos.getY() + f2HitLog);
+ const basegfx::B2DPoint aHitPosB(rPos.getX(), rPos.getY() - f2HitLog);
if( bClosed &&
- SdrObjectPrimitiveHit(*pPickObj, aHitPosR, nHitLog, *GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pPickObj, aHitPosL, nHitLog, *GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pPickObj, aHitPosT, nHitLog, *GetSdrPageView(), pVisiLayer, false) &&
- SdrObjectPrimitiveHit(*pPickObj, aHitPosB, nHitLog, *GetSdrPageView(), pVisiLayer, false) )
+ SdrObjectPrimitiveHit(*pPickObj, aHitPosR, fHitLog, *this, false, 0) &&
+ SdrObjectPrimitiveHit(*pPickObj, aHitPosL, fHitLog, *this, false, 0) &&
+ SdrObjectPrimitiveHit(*pPickObj, aHitPosT, fHitLog, *this, false, 0) &&
+ SdrObjectPrimitiveHit(*pPickObj, aHitPosB, fHitLog, *this, false, 0) )
{
// area fill
if(eFill == XFILL_SOLID )
@@ -1363,14 +1345,15 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( pOLV )
{
- Rectangle aRect( pOLV->GetOutputArea() );
- Point aPos( pOLV->GetWindow()->PixelToLogic( maDropPos ) );
+ const Rectangle aRect(pOLV->GetOutputArea());
+ const basegfx::B2DRange aOutputRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
+ const basegfx::B2DPoint aPos(pOLV->GetWindow()->GetInverseViewTransformation() * maDropPos);
- if( aRect.IsInside( aPos ) || ( !bDrag && IsTextEdit() ) )
+ if( aOutputRange.isInside( aPos ) || ( !bDrag && IsTextEdit() ) )
{
// mba: clipboard always must contain absolute URLs (could be from alien source)
- pOLV->Read( *xStm, String(), EE_FORMAT_BIN, sal_False, mpDocSh->GetHeaderAttributes() );
- bReturn = sal_True;
+ pOLV->Read( *xStm, String(), EE_FORMAT_BIN, false, mpDocSh->GetHeaderAttributes() );
+ bReturn = true;
}
}
@@ -1397,14 +1380,15 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( pOLV )
{
- Rectangle aRect( pOLV->GetOutputArea() );
- Point aPos( pOLV->GetWindow()->PixelToLogic( maDropPos ) );
+ const Rectangle aRect(pOLV->GetOutputArea());
+ const basegfx::B2DRange aOutputRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
+ const basegfx::B2DPoint aPos(pOLV->GetWindow()->GetInverseViewTransformation() * maDropPos);
- if( aRect.IsInside( aPos ) || ( !bDrag && IsTextEdit() ) )
+ if( aOutputRange.isInside( aPos ) || ( !bDrag && IsTextEdit() ) )
{
// mba: clipboard always must contain absolute URLs (could be from alien source)
- pOLV->Read( *xStm, String(), EE_FORMAT_RTF, sal_False, mpDocSh->GetHeaderAttributes() );
- bReturn = sal_True;
+ pOLV->Read( *xStm, String(), EE_FORMAT_RTF, false, mpDocSh->GetHeaderAttributes() );
+ bReturn = true;
}
}
@@ -1422,13 +1406,13 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
{
maDropFileVector.clear();
- for( sal_uLong i = 0, nCount = aDropFileList.Count(); i < nCount; i++ )
+ for( sal_uInt32 i = 0, nCount = aDropFileList.Count(); i < nCount; i++ )
maDropFileVector.push_back( aDropFileList.GetFile( i ) );
maDropInsertFileTimer.Start();
}
- bReturn = sal_True;
+ bReturn = true;
}
else if( CHECK_FORMAT_TRANS( FORMAT_FILE ) )
{
@@ -1441,7 +1425,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
maDropInsertFileTimer.Start();
}
- bReturn = sal_True;
+ bReturn = true;
}
else if( !bLink && CHECK_FORMAT_TRANS( FORMAT_STRING ) )
{
@@ -1459,7 +1443,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( pOLV )
{
pOLV->InsertText( aOUString );
- bReturn = sal_True;
+ bReturn = true;
}
if( !bReturn )
@@ -1468,17 +1452,16 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
}
}
- MarkListHasChanged();
- mbIsDropAllowed = sal_True;
+ mbIsDropAllowed = true;
rDnDAction = mnAction;
delete pImageMap;
return bReturn;
}
-extern void CreateTableFromRTF( SvStream& rStream, SdDrawDocument* pModel );
+extern void CreateTableFromRTF( SvStream& rStream, SdDrawDocument& rModel );
-bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nPasteOptions )
+bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uInt32 nPasteOptions )
{
SdDrawDocument* pModel = new SdDrawDocument( DOCUMENT_TYPE_IMPRESS, mpDocSh );
pModel->NewOrLoadCompleted(NEW_DOC);
@@ -1488,7 +1471,7 @@ bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nP
Reference< XComponent > xComponent( new SdXImpressDocument( pModel, sal_True ) );
pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
- CreateTableFromRTF( *xStm, pModel );
+ CreateTableFromRTF( *xStm, *pModel );
bool bRet = Paste( *pModel, maDropPos, pPage, nPasteOptions );
xComponent->dispose();
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 7e836d4036e9..1fbc6a9a8569 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -66,6 +66,7 @@
#include <svtools/soerr.hxx>
#include <sfx2/ipclient.hxx>
+#include <svx/svdlegacy.hxx>
#include "glob.hrc"
using namespace com::sun::star;
@@ -87,7 +88,7 @@ namespace sd {
\************************************************************************/
SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
- const Point& rPos, SdrObject* pObj, ImageMap* pImageMap )
+ const basegfx::B2DPoint& rPos, SdrObject* pObj, ImageMap* pImageMap )
{
SdrEndTextEdit();
mnAction = rAction;
@@ -96,66 +97,73 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
SdrGrafObj* pNewGrafObj = NULL;
SdrPageView* pPV = GetSdrPageView();
SdrObject* pPickObj = pObj;
- const bool bOnMaster = pPV && pPV->GetPage() && pPV->GetPage()->IsMasterPage();
+ const bool bOnMaster = pPV && pPV->getSdrPageFromSdrPageView().IsMasterPage();
- if(pPV && this->ISA(::sd::slidesorter::view::SlideSorterView))
+ if(pPV && dynamic_cast< ::sd::slidesorter::view::SlideSorterView* >(this))
{
- if(!pPV->GetPageRect().IsInside(rPos))
- pPV = 0L;
+ const basegfx::B2DRange aPageRange(pPV->GetPageRange());
+
+ if(!aPageRange.isInside(rPos))
+ {
+ pPV = 0;
+ }
}
if( !pPickObj && pPV )
{
- SdrPageView* pPageView = pPV;
- PickObj(rPos, getHitTolLog(), pPickObj, pPageView);
+ PickObj(rPos, getHitTolLog(), pPickObj );
}
if( mnAction == DND_ACTION_LINK && pPickObj && pPV )
{
- const bool bIsGraphic = pPickObj->ISA( SdrGrafObj );
- if( bIsGraphic || (pObj->IsEmptyPresObj() && !bOnMaster) )
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(pPickObj);
+
+ if( pSdrGrafObj || (pObj->IsEmptyPresObj() && !bOnMaster))
{
if( IsUndoEnabled() )
BegUndo(String(SdResId(STR_INSERTGRAPHIC)));
- SdPage* pPage = (SdPage*) pPickObj->GetPage();
+ SdPage* pPage = (SdPage*) pPickObj->getSdrPageFromSdrObject();
- if( bIsGraphic )
+ if( pSdrGrafObj )
{
// Das Objekt wird mit der Bitmap gefuellt
- pNewGrafObj = (SdrGrafObj*) pPickObj->Clone();
+ pNewGrafObj = static_cast< SdrGrafObj* >(pSdrGrafObj->CloneSdrObject());
pNewGrafObj->SetGraphic(rGraphic);
}
else
{
- pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetLogicRect() );
- pNewGrafObj->SetEmptyPresObj(sal_True);
+ pNewGrafObj = new SdrGrafObj(
+ getSdrModelFromSdrView(),
+ Graphic(),
+ pPickObj->getSdrObjectTransformation());
+ pNewGrafObj->SetEmptyPresObj(true);
}
if ( pNewGrafObj->IsEmptyPresObj() )
{
- Rectangle aRect( pNewGrafObj->GetLogicRect() );
- pNewGrafObj->AdjustToMaxRect( aRect, sal_False );
+ const basegfx::B2DRange aRange( sdr::legacy::GetLogicRange(*pNewGrafObj) );
+ pNewGrafObj->AdjustToMaxRange( aRange, false );
pNewGrafObj->SetOutlinerParaObject(NULL);
- pNewGrafObj->SetEmptyPresObj(sal_False);
+ pNewGrafObj->SetEmptyPresObj(false);
}
if (pPage && pPage->IsPresObj(pPickObj))
{
// Neues PresObj in die Liste eintragen
pPage->InsertPresObj( pNewGrafObj, PRESOBJ_GRAPHIC );
- pNewGrafObj->SetUserCall(pPickObj->GetUserCall());
+ establishConnectionToSdrObject(pNewGrafObj, findConnectionToSdrObject(pPickObj));
}
if (pImageMap)
pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap));
- ReplaceObjectAtView(pPickObj, *pPV, pNewGrafObj); // maybe ReplaceObjectAtView
+ ReplaceObjectAtView(*pPickObj, *pNewGrafObj); // maybe ReplaceObjectAtView
if( IsUndoEnabled() )
EndUndo();
}
- else if (pPickObj->IsClosedObj() && !pPickObj->ISA(SdrOle2Obj))
+ else if (pPickObj->IsClosedObj() && !dynamic_cast< SdrOle2Obj* >(pPickObj))
{
/******************************************************************
* Das Objekt wird mit der Graphik gefuellt
@@ -163,7 +171,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if( IsUndoEnabled() )
{
BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
EndUndo();
}
@@ -197,27 +205,33 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
MapMode( MAP_100TH_MM ) );
}
- pNewGrafObj = new SdrGrafObj( rGraphic, Rectangle( rPos, aSize ) );
- SdrPage* pPage = pPV->GetPage();
- Size aPageSize( pPage->GetSize() );
- aPageSize.Width() -= pPage->GetLftBorder() + pPage->GetRgtBorder();
- aPageSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder();
- pNewGrafObj->AdjustToMaxRect( Rectangle( Point(), aPageSize ), sal_True );
-// pNewGrafObj->AdjustToMaxRect( Rectangle( pPV->GetOffset(), aPageSize ), sal_True );
+ pNewGrafObj = new SdrGrafObj(
+ getSdrModelFromSdrView(),
+ rGraphic,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize.getWidth(), aSize.getHeight(),
+ rPos.getX(), rPos.getY()));
- sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
- sal_Bool bIsPresTarget = sal_False;
+ const SdrPage& rPage = pPV->getSdrPageFromSdrPageView();
+ const basegfx::B2DVector aPageSize(rPage.GetInnerPageScale());
+ const basegfx::B2DPoint aPageTopLeft(rPage.GetLeftPageBorder(), rPage.GetTopPageBorder());
+ const basegfx::B2DRange aPageRange(aPageTopLeft, aPageTopLeft + aPageSize);
+
+ pNewGrafObj->AdjustToMaxRange(aPageRange, true);
+
+ sal_uInt32 nOptions = SDRINSERT_SETDEFLAYER;
+ bool bIsPresTarget = false;
if ((mpViewSh
&& mpViewSh->GetViewShell()!=NULL
&& mpViewSh->GetViewShell()->GetIPClient()
&& mpViewSh->GetViewShell()->GetIPClient()->IsObjectInPlaceActive())
- || this->ISA(::sd::slidesorter::view::SlideSorterView))
+ || dynamic_cast< ::sd::slidesorter::view::SlideSorterView* >(this))
nOptions |= SDRINSERT_DONTMARK;
- if( ( mnAction & DND_ACTION_MOVE ) && pPickObj && (pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall()) )
+ if( ( mnAction & DND_ACTION_MOVE ) && pPickObj && (pPickObj->IsEmptyPresObj() || findConnectionToSdrObject(pPickObj)) )
{
- SdPage* pP = static_cast< SdPage* >( pPickObj->GetPage() );
+ SdPage* pP = static_cast< SdPage* >( pPickObj->getSdrPageFromSdrObject() );
if ( pP && pP->IsMasterPage() )
bIsPresTarget = pP->IsPresObj(pPickObj);
@@ -229,31 +243,25 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if (pImageMap)
pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap));
- Rectangle aPickObjRect(pPickObj->GetCurrentBoundRect());
- Size aPickObjSize(aPickObjRect.GetSize());
- Rectangle aObjRect(pNewGrafObj->GetCurrentBoundRect());
- Size aObjSize(aObjRect.GetSize());
-
- Fraction aScaleWidth(aPickObjSize.Width(), aObjSize.Width());
- Fraction aScaleHeight(aPickObjSize.Height(), aObjSize.Height());
- pNewGrafObj->NbcResize(aObjRect.TopLeft(), aScaleWidth, aScaleHeight);
-
- Point aVec = aPickObjRect.TopLeft() - aObjRect.TopLeft();
- pNewGrafObj->NbcMove(Size(aVec.X(), aVec.Y()));
+ // copy transformation and layer
+ pNewGrafObj->setSdrObjectTransformation(pPickObj->getSdrObjectTransformation());
+ pNewGrafObj->SetLayer(pPickObj->GetLayer());
const bool bUndo = IsUndoEnabled();
if( bUndo )
BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
- pNewGrafObj->NbcSetLayer(pPickObj->GetLayer());
- SdrPage* pP = pPV->GetPage();
- pP->InsertObject(pNewGrafObj);
+
+ SdrPage& rP = pPV->getSdrPageFromSdrPageView();
+ rP.InsertObjectToSdrObjList(*pNewGrafObj);
+
if( bUndo )
{
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewObject(*pNewGrafObj));
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pPickObj));
}
- pP->RemoveObject(pPickObj->GetOrdNum());
+
+ rP.RemoveObjectFromSdrObjList(pPickObj->GetNavigationPosition());
if( bUndo )
{
@@ -261,13 +269,14 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
}
else
{
- SdrObject::Free(pPickObj);
+ deleteSdrObjectSafeAndClearPointer(pPickObj);
}
+
mnAction = DND_ACTION_COPY;
}
else
{
- InsertObjectAtView(pNewGrafObj, *pPV, nOptions);
+ InsertObjectAtView(*pNewGrafObj, nOptions);
if( pImageMap )
pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap));
@@ -282,7 +291,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
// -----------------------------------------------------------------------------
SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAction,
- const Point& rPos, const Size& rSize )
+ const basegfx::B2DPoint& rPos, const basegfx::B2DVector& rSize )
{
SdrEndTextEdit();
mnAction = rAction;
@@ -291,40 +300,53 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
SdrPageView* pPV = GetSdrPageView();
SdrObject* pPickObj = GetEmptyPresentationObject( PRESOBJ_MEDIA );
- if(pPV && this->ISA(::sd::slidesorter::view::SlideSorterView ))
+ if(pPV && dynamic_cast< ::sd::slidesorter::view::SlideSorterView* >(this))
{
- if(!pPV->GetPageRect().IsInside(rPos))
- pPV = 0L;
+ const basegfx::B2DRange aPageRange(pPV->GetPageRange());
+
+ if(!aPageRange.isInside(rPos))
+ {
+ pPV = 0;
+ }
}
if( !pPickObj && pPV )
{
- SdrPageView* pPageView = pPV;
- PickObj(rPos, getHitTolLog(), pPickObj, pPageView);
+ PickObj(rPos, getHitTolLog(), pPickObj );
}
- if( mnAction == DND_ACTION_LINK && pPickObj && pPV && pPickObj->ISA( SdrMediaObj ) )
+ if( mnAction == DND_ACTION_LINK && pPickObj && pPV && dynamic_cast< SdrMediaObj* >(pPickObj) )
{
- pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->Clone() );
+ pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->CloneSdrObject() );
pNewMediaObj->setURL( rMediaURL );
BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
- ReplaceObjectAtView(pPickObj, *pPV, pNewMediaObj);
+ ReplaceObjectAtView(*pPickObj, *pNewMediaObj);
EndUndo();
}
else if( pPV )
{
- Rectangle aRect( rPos, rSize );
- if( pPickObj )
- aRect = pPickObj->GetLogicRect();
+ basegfx::B2DHomMatrix aObjTrans;
+ if(pPickObj)
+ {
+ aObjTrans = pPickObj->getSdrObjectTransformation();
+ }
+ else
+ {
+ aObjTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rSize,
+ rPos);
+ }
- pNewMediaObj = new SdrMediaObj( aRect );
+ pNewMediaObj = new SdrMediaObj(
+ getSdrModelFromSdrView(),
+ aObjTrans);
bool bIsPres = false;
if( pPickObj )
{
- SdPage* pPage = static_cast< SdPage* >(pPickObj->GetPage());
+ SdPage* pPage = static_cast< SdPage* >(pPickObj->getSdrPageFromSdrObject());
bIsPres = pPage && pPage->IsPresObj(pPickObj);
if( bIsPres )
{
@@ -333,17 +355,27 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
}
if( pPickObj )
- ReplaceObjectAtView(pPickObj, *pPV, pNewMediaObj);
+ {
+ ReplaceObjectAtView(*pPickObj, *pNewMediaObj);
+ }
else
- InsertObjectAtView( pNewMediaObj, *pPV, SDRINSERT_SETDEFLAYER );
+ {
+ InsertObjectAtView( *pNewMediaObj, SDRINSERT_SETDEFLAYER );
+ }
pNewMediaObj->setURL( rMediaURL );
if( pPickObj )
{
- pNewMediaObj->AdjustToMaxRect( pPickObj->GetLogicRect() );
+ pNewMediaObj->AdjustToMaxRange( sdr::legacy::GetLogicRange(*pPickObj) );
+
if( bIsPres )
- pNewMediaObj->SetUserCall(pPickObj->GetUserCall());
+ {
+ // replace formally used 'pNewMediaObj->SetUserCall(pPickObj->GetUserCall())' by
+ // new notify/listener mechanism
+ SdPage* pCurrentlyConnectedSdPage = findConnectionToSdrObject(pPickObj);
+ establishConnectionToSdrObject(pNewMediaObj, pCurrentlyConnectedSdPage);
+ }
}
}
@@ -373,7 +405,7 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
{
String aCurrentDropFile( *aIter );
INetURLObject aURL( aCurrentDropFile );
- sal_Bool bOK = sal_False;
+ bool bOK = false;
if( aURL.GetProtocol() == INET_PROT_NOT_VALID )
{
@@ -404,12 +436,12 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
if( aIter == maDropFileVector.begin() )
mnAction = nTempAction;
- bOK = sal_True;
+ bOK = true;
}
if( !bOK )
{
const SfxFilter* pFoundFilter = NULL;
- SfxMedium aSfxMedium( aCurrentDropFile, STREAM_READ | STREAM_SHARE_DENYNONE, sal_False );
+ SfxMedium aSfxMedium( aCurrentDropFile, STREAM_READ | STREAM_SHARE_DENYNONE, false );
ErrCode nErr = SFX_APP()->GetFilterMatcher().GuessFilter( aSfxMedium, &pFoundFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
if( pFoundFilter && !nErr )
@@ -440,7 +472,7 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
aReq.AppendItem( aItem1 );
aReq.AppendItem( aItem2 );
FuInsertFile::Create( mpViewSh, pWin, this, mpDoc, aReq );
- bOK = sal_True;
+ bOK = true;
}
}
}
@@ -465,7 +497,7 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
else
aPrefSize = Size( 5000, 5000 );
- InsertMediaURL( aCurrentDropFile, mnAction, maDropPos, aPrefSize ) ;
+ InsertMediaURL( aCurrentDropFile, mnAction, maDropPos, basegfx::B2DVector(aPrefSize.getWidth(), aPrefSize.getHeight()) ) ;
}
else if( mnAction & DND_ACTION_LINK )
static_cast< DrawViewShell* >( mpViewSh )->InsertURLButton( aCurrentDropFile, aCurrentDropFile, String(), &maDropPos );
@@ -503,7 +535,6 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
}
Size aSize( aSz.Width, aSz.Height );
- Rectangle aRect;
if (!aSize.Width() || !aSize.Height())
{
@@ -511,10 +542,17 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
aSize.Height() = 1000;
}
- aRect = Rectangle( maDropPos, aSize );
+ const basegfx::B2DHomMatrix aObjTrans(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize.getWidth(), aSize.getHeight(),
+ maDropPos.getX(), maDropPos.getY()));
- SdrOle2Obj* pOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect );
- sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
+ SdrOle2Obj* pOleObj = new SdrOle2Obj(
+ getSdrModelFromSdrView(),
+ svt::EmbeddedObjectRef( xObj, nAspect ),
+ aName,
+ aObjTrans);
+ sal_uInt32 nOptions = SDRINSERT_SETDEFLAYER;
if (mpViewSh != NULL)
{
@@ -525,10 +563,13 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
nOptions |= SDRINSERT_DONTMARK;
}
- InsertObjectAtView( pOleObj, *GetSdrPageView(), nOptions );
- pOleObj->SetLogicRect( aRect );
- aSz.Width = aRect.GetWidth();
- aSz.Height = aRect.GetHeight();
+ InsertObjectAtView( *pOleObj, nOptions );
+ pOleObj->setSdrObjectTransformation(aObjTrans);
+
+ const basegfx::B2DVector& rScale = pOleObj->getSdrObjectScale();
+
+ aSz.Width = basegfx::fround(fabs(rScale.getX()));
+ aSz.Height = basegfx::fround(fabs(rScale.getY()));
xObj->setVisualAreaSize( nAspect,aSz );
}
}
@@ -572,7 +613,7 @@ IMPL_LINK( View, DropErrorHdl, Timer*, EMPTYARG )
|*
\************************************************************************/
-void View::LockRedraw(sal_Bool bLock)
+void View::LockRedraw(bool bLock)
{
if (bLock)
{
diff --git a/sd/source/ui/view/sdview5.cxx b/sd/source/ui/view/sdview5.cxx
index 07956b95eecb..e7e593f2c580 100644
--- a/sd/source/ui/view/sdview5.cxx
+++ b/sd/source/ui/view/sdview5.cxx
@@ -55,25 +55,20 @@ SdrObject* View::GetEmptyPresentationObject( PresObjKind eKind )
SdrPageView* pPV = GetSdrPageView();
if( pPV )
{
- SdPage* pPage = static_cast< SdPage* >( pPV->GetPage() );
- if( pPage && !pPage->IsMasterPage() )
+ SdPage& rPage = static_cast< SdPage& >( pPV->getSdrPageFromSdrPageView() );
+ if( !rPage.IsMasterPage() )
{
// first try selected shape
- if ( AreObjectsMarked() )
- {
+ SdrObject* pSelectedObj = getSelectedIfSingle();
+
/**********************************************************
* Is an empty graphic object available?
**********************************************************/
- const SdrMarkList& rMarkList = GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
+ if( pSelectedObj
+ && pSelectedObj->IsEmptyPresObj()
+ && implIsMultiPresObj( rPage.GetPresObjKind(pSelectedObj) ) )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- if( pObj->IsEmptyPresObj() && implIsMultiPresObj( pPage->GetPresObjKind(pObj) ) )
- pEmptyObj = pObj;
- }
+ pEmptyObj = pSelectedObj;
}
// try to find empty pres obj of same type
@@ -82,7 +77,7 @@ SdrObject* View::GetEmptyPresentationObject( PresObjKind eKind )
int nIndex = 1;
do
{
- pEmptyObj = pPage->GetPresObj(eKind, nIndex++ );
+ pEmptyObj = rPage.GetPresObj(eKind, nIndex++ );
}
while( (pEmptyObj != 0) && (!pEmptyObj->IsEmptyPresObj()) );
}
@@ -90,13 +85,13 @@ SdrObject* View::GetEmptyPresentationObject( PresObjKind eKind )
// last try to find empty pres obj of multiple type
if( !pEmptyObj )
{
- const std::list< SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList();
+ const std::list< const SdrObject* >& rShapes = rPage.GetPresentationShapeList().getList();
- for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ )
+ for( std::list< const SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ )
{
- if( (*iter)->IsEmptyPresObj() && implIsMultiPresObj(pPage->GetPresObjKind(*iter)) )
+ if( (*iter)->IsEmptyPresObj() && implIsMultiPresObj(rPage.GetPresObjKind(*iter)) )
{
- pEmptyObj = (*iter);
+ pEmptyObj = const_cast< SdrObject* >(*iter);
break;
}
}
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 29feac1505e7..72511a8bccd8 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -51,8 +51,8 @@ namespace sd {
#define SCROLL_PAGE_FACT 0.5 // Faktor fuer Seitenscrolling
#define SCROLL_SENSITIVE 20 // Sensitiver Bereich (Pixel)
#define ZOOM_MULTIPLICATOR 10000 // Multiplikator um Rundungsfehler zu vermeiden
-#define MIN_ZOOM 5 // Minimaler Zoomfaktor
-#define MAX_ZOOM 3000 // Maximaler Zoomfaktor
+#define MIN_ZOOM 5.0 // Minimaler Zoomfaktor
+#define MAX_ZOOM 3000.0 // Maximaler Zoomfaktor
/*************************************************************************
@@ -65,11 +65,11 @@ Window::Window(::Window* pParent)
: ::Window(pParent, WinBits(WB_CLIPCHILDREN | WB_DIALOGCONTROL)),
DropTargetHelper( this ),
mpShareWin(NULL),
- maWinPos(0, 0), // vorsichtshalber; die Werte sollten aber
- maViewOrigin(0, 0), // vom Besitzer des Fensters neu gesetzt
- maViewSize(1000, 1000), // werden
- mnMinZoom(MIN_ZOOM),
- mnMaxZoom(MAX_ZOOM),
+ maWinPos(0.0, 0.0), // vorsichtshalber; die Werte sollten aber
+ maViewOrigin(0.0, 0.0), // vom Besitzer des Fensters neu gesetzt
+ maViewSize(1000.0, 1000.0), // werden
+ mfMinZoom(MIN_ZOOM),
+ mfMaxZoom(MAX_ZOOM),
mbMinZoomAutoCalc(false),
mbCalcMinZoomByMinSide(true),
mbCenterAllowed(true),
@@ -90,15 +90,15 @@ Window::Window(::Window* pParent)
// adjust contrast mode initially
bool bUseContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
SetDrawMode( bUseContrast
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR );
+ ? SD_OUTPUT_DRAWMODE_CONTRAST
+ : SD_OUTPUT_DRAWMODE_COLOR );
// Hilfe-ID setzen
// SetHelpId(HID_SD_WIN_DOCUMENT);
SetUniqueId(HID_SD_WIN_DOCUMENT);
// #i78183# Added after discussed with AF
- EnableRTL(sal_False);
+ EnableRTL(false);
}
/*************************************************************************
@@ -148,12 +148,12 @@ void Window::CalcMinZoom()
if ( mbMinZoomAutoCalc )
{
// Get current zoom factor.
- long nZoom = GetZoom();
+ const double fZoom(GetZoom());
if ( mpShareWin )
{
mpShareWin->CalcMinZoom();
- mnMinZoom = mpShareWin->mnMinZoom;
+ mfMinZoom = mpShareWin->mfMinZoom;
}
else
{
@@ -161,76 +161,75 @@ void Window::CalcMinZoom()
// and calculate the scaling factors that would lead to the view
// area (also called application area) to completely fill the
// window.
- Size aWinSize = PixelToLogic(GetOutputSizePixel());
- sal_uLong nX = (sal_uLong) ((double) aWinSize.Width()
- * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Width());
- sal_uLong nY = (sal_uLong) ((double) aWinSize.Height()
- * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Height());
+ const basegfx::B2DVector aWinSize(GetLogicVector());
+ const double fX(aWinSize.getX() / maViewSize.getX());
+ const double fY(aWinSize.getY() / maViewSize.getY());
// Decide whether to take the larger or the smaller factor.
- sal_uLong nFact;
+ double fFact;
+
if (mbCalcMinZoomByMinSide)
- nFact = Min(nX, nY);
+ fFact = std::min(fX, fY);
else
- nFact = Max(nX, nY);
+ fFact = std::max(fX, fY);
// The factor is tansfomed according to the current zoom factor.
- nFact = nFact * nZoom / ZOOM_MULTIPLICATOR;
- mnMinZoom = Max((sal_uInt16) MIN_ZOOM, (sal_uInt16) nFact);
+ fFact *= fZoom;
+ mfMinZoom = std::max(MIN_ZOOM, fFact);
}
// If the current zoom factor is smaller than the calculated minimal
// zoom factor then set the new minimal factor as the current zoom
// factor.
- if ( nZoom < (long) mnMinZoom )
- SetZoomFactor(mnMinZoom);
+ if ( fZoom < mfMinZoom )
+ SetZoomFactor(mfMinZoom);
}
}
-void Window::SetMinZoom (long int nMin)
+void Window::SetMinZoom (double fMin)
{
- mnMinZoom = (sal_uInt16) nMin;
+ mfMinZoom = fMin;
}
-long Window::GetMinZoom (void) const
+double Window::GetMinZoom (void) const
{
- return mnMinZoom;
+ return mfMinZoom;
}
-void Window::SetMaxZoom (long int nMax)
+void Window::SetMaxZoom (double fMax)
{
- mnMaxZoom = (sal_uInt16) nMax;
+ mfMaxZoom = fMax;
}
-long Window::GetMaxZoom (void) const
+double Window::GetMaxZoom (void) const
{
- return mnMaxZoom;
+ return mfMaxZoom;
}
-long Window::GetZoom (void) const
+double Window::GetZoom (void) const
{
if( GetMapMode().GetScaleX().GetDenominator() )
{
- return GetMapMode().GetScaleX().GetNumerator() * 100L
+ return GetMapMode().GetScaleX().GetNumerator() * 100.0
/ GetMapMode().GetScaleX().GetDenominator();
}
else
{
- return 0;
+ return 0.0;
}
}
@@ -349,7 +348,7 @@ void Window::Command(const CommandEvent& rCEvt)
long Window::Notify( NotifyEvent& rNEvt )
{
- long nResult = sal_False;
+ long nResult = false;
if ( mpViewShell )
{
nResult = mpViewShell->Notify(rNEvt, this);
@@ -381,7 +380,7 @@ void Window::RequestHelp(const HelpEvent& rEvt)
-Point Window::GetWinViewPos (void) const
+basegfx::B2DPoint Window::GetWinViewPos (void) const
{
return maWinPos;
}
@@ -389,7 +388,7 @@ Point Window::GetWinViewPos (void) const
-Point Window::GetViewOrigin (void) const
+basegfx::B2DPoint Window::GetViewOrigin (void) const
{
return maViewOrigin;
}
@@ -397,7 +396,7 @@ Point Window::GetViewOrigin (void) const
-Size Window::GetViewSize (void) const
+basegfx::B2DVector Window::GetViewSize (void) const
{
return maViewSize;
}
@@ -412,7 +411,7 @@ Size Window::GetViewSize (void) const
|*
\************************************************************************/
-void Window::SetWinViewPos(const Point& rPnt)
+void Window::SetWinViewPos(const basegfx::B2DPoint& rPnt)
{
maWinPos = rPnt;
}
@@ -423,7 +422,7 @@ void Window::SetWinViewPos(const Point& rPnt)
|*
\************************************************************************/
-void Window::SetViewOrigin(const Point& rPnt)
+void Window::SetViewOrigin(const basegfx::B2DPoint& rPnt)
{
maViewOrigin = rPnt;
}
@@ -435,7 +434,7 @@ void Window::SetViewOrigin(const Point& rPnt)
|*
\************************************************************************/
-void Window::SetViewSize(const Size& rSize)
+void Window::SetViewSize(const basegfx::B2DVector& rSize)
{
maViewSize = rSize;
CalcMinZoom();
@@ -452,194 +451,217 @@ void Window::SetCenterAllowed (bool bIsAllowed)
-long Window::SetZoomFactor(long nZoom)
+double Window::SetZoomFactor(double fZoom)
{
// Clip the zoom factor to the valid range marked by nMinZoom as
// calculated by CalcMinZoom() and the constant MAX_ZOOM.
- if ( nZoom > MAX_ZOOM )
- nZoom = MAX_ZOOM;
- if ( nZoom < (long) mnMinZoom )
- nZoom = mnMinZoom;
+ if ( fZoom > MAX_ZOOM )
+ {
+ fZoom = MAX_ZOOM;
+ }
+
+ if ( fZoom < mfMinZoom )
+ {
+ fZoom = mfMinZoom;
+ }
// Set the zoom factor at the window's map mode.
MapMode aMap(GetMapMode());
- aMap.SetScaleX(Fraction(nZoom, 100));
- aMap.SetScaleY(Fraction(nZoom, 100));
+ aMap.SetScaleX(Fraction(fZoom * 0.01));
+ aMap.SetScaleY(Fraction(fZoom * 0.01));
SetMapMode(aMap);
// Update the map mode's origin (to what effect?).
UpdateMapOrigin();
- // Update the view's snapping to the the new zoom factor.
- if ( mpViewShell && mpViewShell->ISA(DrawViewShell) )
- ((DrawViewShell*) mpViewShell)->GetView()->
- RecalcLogicSnapMagnetic(*this);
-
// Return the zoom factor just in case it has been changed above to lie
// inside the valid range.
- return nZoom;
+ return fZoom;
}
-void Window::SetZoomIntegral(long nZoom)
+void Window::SetZoomIntegral(double fZoom)
{
// Clip the zoom factor to the valid range marked by nMinZoom as
// previously calculated by <member>CalcMinZoom()</member> and the
// MAX_ZOOM constant.
- if ( nZoom > MAX_ZOOM )
- nZoom = MAX_ZOOM;
- if ( nZoom < (long) mnMinZoom )
- nZoom = mnMinZoom;
+ if ( fZoom > MAX_ZOOM )
+ {
+ fZoom = MAX_ZOOM;
+ }
+
+ if ( fZoom < mfMinZoom )
+ {
+ fZoom = mfMinZoom;
+ }
// Calculate the window's new origin.
- Size aSize = PixelToLogic(GetOutputSizePixel());
- long nW = aSize.Width() * GetZoom() / nZoom;
- long nH = aSize.Height() * GetZoom() / nZoom;
- maWinPos.X() += (aSize.Width() - nW) / 2;
- maWinPos.Y() += (aSize.Height() - nH) / 2;
- if ( maWinPos.X() < 0 ) maWinPos.X() = 0;
- if ( maWinPos.Y() < 0 ) maWinPos.Y() = 0;
+ const basegfx::B2DVector aWinSize(GetLogicVector());
+ const double fW(aWinSize.getX() * GetZoom() / fZoom);
+ const double fH(aWinSize.getY() * GetZoom() / fZoom);
+
+ maWinPos.setX(maWinPos.getX() + ((aWinSize.getX() - fW) * 0.5));
+ maWinPos.setY(maWinPos.getY() + ((aWinSize.getY() - fH) * 0.5));
+
+ if(maWinPos.getX() < 0.0)
+ {
+ maWinPos.setX(0.0);
+ }
+
+ if(maWinPos.getY() < 0.0)
+ {
+ maWinPos.setY(0.0);
+ }
// Finally update this window's map mode to the given zoom factor that
// has been clipped to the valid range.
- SetZoomFactor(nZoom);
+ SetZoomFactor(fZoom);
}
-long Window::GetZoomForRect( const Rectangle& rZoomRect )
+double Window::GetZoomForRange(const basegfx::B2DRange& rZoomRange)
{
- long nRetZoom = 100;
+ const basegfx::B2DVector aZoomScale(rZoomRange.getRange());
+ double fRetZoom(100.0);
- if( (rZoomRect.GetWidth() != 0) && (rZoomRect.GetHeight() != 0))
+ if(!aZoomScale.equalZero())
{
// Calculate the scale factors which will lead to the given
// rectangle being fully visible (when translated accordingly) as
// large as possible in the output area independently in both
// coordinate directions .
- sal_uLong nX(0L);
- sal_uLong nY(0L);
+ double fX(0.0);
+ double fY(0.0);
+ const basegfx::B2DVector aWinSize(GetLogicVector());
- const Size aWinSize( PixelToLogic(GetOutputSizePixel()) );
- if(rZoomRect.GetHeight())
+ if(!basegfx::fTools::equalZero(aZoomScale.getY()))
{
- nX = (sal_uLong) ((double) aWinSize.Height()
- * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetHeight());
+ fX = aWinSize.getY() / aZoomScale.getY();
}
- if(rZoomRect.GetWidth())
+ if(!basegfx::fTools::equalZero(aZoomScale.getX()))
{
- nY = (sal_uLong) ((double) aWinSize.Width()
- * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth());
+ fY = aWinSize.getX() / aZoomScale.getX();
}
// Use the smaller one of both so that the zoom rectangle will be
// fully visible with respect to both coordinate directions.
- sal_uLong nFact = Min(nX, nY);
+ double fFact(std::min(fX, fY));
// Transform the current zoom factor so that it leads to the desired
// scaling.
- nRetZoom = nFact * GetZoom() / ZOOM_MULTIPLICATOR;
+ fRetZoom = fFact * GetZoom();
// Calculate the new origin.
- if ( nFact == 0 )
+ if(basegfx::fTools::equalZero(fFact))
{
// Don't change anything if the scale factor is degenrate.
- nRetZoom = GetZoom();
+ fRetZoom = GetZoom();
}
else
{
// Clip the zoom factor to the valid range marked by nMinZoom as
// previously calculated by <member>CalcMinZoom()</member> and the
// MAX_ZOOM constant.
- if ( nRetZoom > MAX_ZOOM )
- nRetZoom = MAX_ZOOM;
- if ( nRetZoom < (long) mnMinZoom )
- nRetZoom = mnMinZoom;
+ if(fRetZoom > MAX_ZOOM)
+ {
+ fRetZoom = MAX_ZOOM;
+ }
+
+ if(fRetZoom < mfMinZoom)
+ {
+ fRetZoom = mfMinZoom;
+ }
}
}
- return nRetZoom;
+ return fRetZoom;
}
/** Recalculate the zoom factor and translation so that the given rectangle
is displayed centered and as large as possible while still being fully
visible in the window.
*/
-long Window::SetZoomRect (const Rectangle& rZoomRect)
+double Window::SetZoomRange(const basegfx::B2DRange& rZoomRange)
{
- long nNewZoom = 100;
+ const basegfx::B2DVector aZoomScale(rZoomRange.getRange());
+ double fNewZoom(100.0);
- if (rZoomRect.GetWidth() == 0 || rZoomRect.GetHeight() == 0)
+ if(aZoomScale.equalZero())
{
// The given rectangle is degenerate. Use the default zoom factor
// (above) of 100%.
- SetZoomIntegral(nNewZoom);
+ SetZoomIntegral(fNewZoom);
}
else
{
- Point aPos = rZoomRect.TopLeft();
+ const basegfx::B2DPoint aPos(rZoomRange.getMinimum());
// Transform the output area from pixel coordinates into logical
// coordinates.
- Size aWinSize = PixelToLogic(GetOutputSizePixel());
- // Paranoia! The degenerate case of zero width or height has been
- // taken care of above.
- DBG_ASSERT(rZoomRect.GetWidth(), "ZoomRect-Breite = 0!");
- DBG_ASSERT(rZoomRect.GetHeight(), "ZoomRect-Hoehe = 0!");
+ const basegfx::B2DVector aWinSize(GetLogicVector());
// Calculate the scale factors which will lead to the given
// rectangle being fully visible (when translated accordingly) as
// large as possible in the output area independently in both
// coordinate directions .
- sal_uLong nX(0L);
- sal_uLong nY(0L);
+ double fX(0.0);
+ double fY(0.0);
- if(rZoomRect.GetHeight())
+ if(!basegfx::fTools::equalZero(aZoomScale.getX()))
{
- nX = (sal_uLong) ((double) aWinSize.Height()
- * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetHeight());
+ fX = aWinSize.getX() / aZoomScale.getX();
}
- if(rZoomRect.GetWidth())
+ if(!basegfx::fTools::equalZero(aZoomScale.getY()))
{
- nY = (sal_uLong) ((double) aWinSize.Width()
- * (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth());
+ fY = aWinSize.getY() / aZoomScale.getY();
}
// Use the smaller one of both so that the zoom rectangle will be
// fully visible with respect to both coordinate directions.
- sal_uLong nFact = Min(nX, nY);
+ double fFact(std::min(fX, fY));
// Transform the current zoom factor so that it leads to the desired
// scaling.
- long nZoom = nFact * GetZoom() / ZOOM_MULTIPLICATOR;
+ const double fZoom(fFact * GetZoom());
// Calculate the new origin.
- if ( nFact == 0 )
+ if(basegfx::fTools::equalZero(fFact))
{
// Don't change anything if the scale factor is degenrate.
- nNewZoom = GetZoom();
+ fNewZoom = GetZoom();
}
else
{
// Calculate the new window position that centers the given
// rectangle on the screen.
- if ( nZoom > MAX_ZOOM )
- nFact = nFact * MAX_ZOOM / nZoom;
+ if ( fZoom > MAX_ZOOM )
+ {
+ fFact = fFact * MAX_ZOOM / fZoom;
+ }
maWinPos = maViewOrigin + aPos;
- aWinSize.Width() = (long) ((double) aWinSize.Width() * (double) ZOOM_MULTIPLICATOR / (double) nFact);
- maWinPos.X() += (rZoomRect.GetWidth() - aWinSize.Width()) / 2;
- aWinSize.Height() = (long) ((double) aWinSize.Height() * (double) ZOOM_MULTIPLICATOR / (double) nFact);
- maWinPos.Y() += (rZoomRect.GetHeight() - aWinSize.Height()) / 2;
+ const double fNewWinX(aWinSize.getX() / fFact);
+ const double fNewWinY(aWinSize.getY() / fFact);
+
+ maWinPos.setX(maWinPos.getX() + ((aZoomScale.getX() - fNewWinX) * 0.5));
+ maWinPos.setY(maWinPos.getY() + ((aZoomScale.getY() - fNewWinY) * 0.5));
- if ( maWinPos.X() < 0 ) maWinPos.X() = 0;
- if ( maWinPos.Y() < 0 ) maWinPos.Y() = 0;
+ if(maWinPos.getX() < 0.0)
+ {
+ maWinPos.setX(0.0);
+ }
+
+ if(maWinPos.getY() < 0.0)
+ {
+ maWinPos.setY(0.0);
+ }
// Adapt the window's map mode to the new zoom factor.
- nNewZoom = SetZoomFactor(nZoom);
+ fNewZoom = SetZoomFactor(fZoom);
}
}
- return(nNewZoom);
+ return(fNewZoom);
}
@@ -661,92 +683,62 @@ void Window::SetMinZoomAutoCalc (bool bAuto)
|*
\************************************************************************/
-void Window::UpdateMapOrigin(sal_Bool bInvalidate)
+void Window::UpdateMapOrigin(bool bInvalidate)
{
- sal_Bool bChanged = sal_False;
- Size aWinSize = PixelToLogic(GetOutputSizePixel());
+ bool bChanged(false);
if ( mbCenterAllowed )
{
- if ( maWinPos.X() > maViewSize.Width() - aWinSize.Width() )
+ const basegfx::B2DVector aWinSize(GetLogicVector());
+
+ if(basegfx::fTools::more(maWinPos.getX(), maViewSize.getX() - aWinSize.getX()))
{
- maWinPos.X() = maViewSize.Width() - aWinSize.Width();
- bChanged = sal_True;
+ maWinPos.setX(maViewSize.getX() - aWinSize.getX());
+ bChanged = true;
}
- if ( maWinPos.Y() > maViewSize.Height() - aWinSize.Height() )
+
+ if(basegfx::fTools::more(maWinPos.getY(), maViewSize.getY() - aWinSize.getY()))
{
- maWinPos.Y() = maViewSize.Height() - aWinSize.Height();
- bChanged = sal_True;
+ maWinPos.setY(maViewSize.getY() - aWinSize.getY());
+ bChanged = true;
}
- if ( aWinSize.Width() > maViewSize.Width() || maWinPos.X() < 0 )
+
+ if(basegfx::fTools::more(aWinSize.getX(), maViewSize.getX()) || (maWinPos.getX() < 0.0))
{
- maWinPos.X() = maViewSize.Width() / 2 - aWinSize.Width() / 2;
- bChanged = sal_True;
+ maWinPos.setX((maViewSize.getX() - aWinSize.getX()) * 0.5);
+ bChanged = true;
}
- if ( aWinSize.Height() > maViewSize.Height() || maWinPos.Y() < 0 )
+
+ if(basegfx::fTools::more(aWinSize.getY(), maViewSize.getY()) || (maWinPos.getY() < 0.0 ))
{
- maWinPos.Y() = maViewSize.Height() / 2 - aWinSize.Height() / 2;
- bChanged = sal_True;
+ maWinPos.setY((maViewSize.getY() - aWinSize.getY()) * 0.5);
+ bChanged = true;
}
}
- UpdateMapMode ();
+ UpdateMapMode();
- if (bChanged && bInvalidate)
+ if(bChanged && bInvalidate)
+ {
Invalidate();
+ }
}
-
-
-
-void Window::UpdateMapMode (void)
+void Window::UpdateMapMode(void)
{
- Size aWinSize = PixelToLogic(GetOutputSizePixel());
- maWinPos -= maViewOrigin;
- Size aPix(maWinPos.X(), maWinPos.Y());
- aPix = LogicToPixel(aPix);
- // Groesse muss vielfaches von BRUSH_SIZE sein, damit Muster
- // richtig dargestellt werden
- // #i2237#
- // removed old stuff here which still forced zoom to be
- // %BRUSH_SIZE which is outdated now
-
- if (mpViewShell && mpViewShell->ISA(DrawViewShell))
+ const Point aNewOffset(
+ basegfx::fround(maViewOrigin.getX() - maWinPos.getX()),
+ basegfx::fround(maViewOrigin.getY() - maWinPos.getY()));
+ MapMode aMap(GetMapMode());
+
+ if(aMap.GetOrigin() != aNewOffset)
{
- Size aViewSizePixel = LogicToPixel(maViewSize);
- Size aWinSizePixel = LogicToPixel(aWinSize);
+ aMap.SetOrigin(aNewOffset);
- // Seite soll nicht am Fensterrand "kleben"
- if (aPix.Width() == 0)
- {
- // #i2237#
- // Since BRUSH_SIZE alignment is outdated now, i use the
- // former constant here directly
- aPix.Width() -= 8;
- }
- if (aPix.Height() == 0)
- {
- // #i2237#
- // Since BRUSH_SIZE alignment is outdated now, i use the
- // former constant here directly
- aPix.Height() -= 8;
- }
+ SetMapMode(aMap);
}
-
- aPix = PixelToLogic(aPix);
- maWinPos.X() = aPix.Width();
- maWinPos.Y() = aPix.Height();
- Point aNewOrigin (-maWinPos.X(), -maWinPos.Y());
- maWinPos += maViewOrigin;
-
- MapMode aMap(GetMapMode());
- aMap.SetOrigin(aNewOrigin);
- SetMapMode(aMap);
}
-
-
-
/*************************************************************************
|*
|* X-Position des sichtbaren Bereichs als Bruchteil (< 1)
@@ -756,7 +748,7 @@ void Window::UpdateMapMode (void)
double Window::GetVisibleX()
{
- return ((double) maWinPos.X() / maViewSize.Width());
+ return maWinPos.getX() / maViewSize.getX();
}
/*************************************************************************
@@ -768,7 +760,7 @@ double Window::GetVisibleX()
double Window::GetVisibleY()
{
- return ((double) maWinPos.Y() / maViewSize.Height());
+ return maWinPos.getY() / maViewSize.getY();
}
/*************************************************************************
@@ -781,17 +773,23 @@ double Window::GetVisibleY()
void Window::SetVisibleXY(double fX, double fY)
{
- long nOldX = maWinPos.X();
- long nOldY = maWinPos.Y();
-
- if ( fX >= 0 )
- maWinPos.X() = (long) (fX * maViewSize.Width());
- if ( fY >= 0 )
- maWinPos.Y() = (long) (fY * maViewSize.Height());
- UpdateMapOrigin(sal_False);
- // Size sz(nOldX - aWinPos.X(), nOldY - aWinPos.Y());
- // sz = LogicToPixel(sz);
- Scroll(nOldX - maWinPos.X(), nOldY - maWinPos.Y(), SCROLL_CHILDREN);
+ const basegfx::B2DPoint aOldWinPos(maWinPos);
+
+ if(basegfx::fTools::moreOrEqual(fX, 0.0))
+ {
+ maWinPos.setX(fX * maViewSize.getX());
+ }
+
+ if(basegfx::fTools::moreOrEqual(fY, 0.0))
+ {
+ maWinPos.setY(fY * maViewSize.getY());
+ }
+
+ UpdateMapOrigin(false);
+ Scroll(
+ basegfx::fround(aOldWinPos.getX() - maWinPos.getX()),
+ basegfx::fround(aOldWinPos.getY() - maWinPos.getY()),
+ SCROLL_CHILDREN);
Update();
}
@@ -802,12 +800,16 @@ void Window::SetVisibleXY(double fX, double fY)
|*
\************************************************************************/
-double Window::GetVisibleWidth()
+double Window::GetVisibleWidthRelativeToView()
{
- Size aWinSize = PixelToLogic(GetOutputSizePixel());
- if ( aWinSize.Width() > maViewSize.Width() )
- aWinSize.Width() = maViewSize.Width();
- return ((double) aWinSize.Width() / maViewSize.Width());
+ basegfx::B2DVector aWinSize(GetLogicVector());
+
+ if(basegfx::fTools::more(aWinSize.getX(), maViewSize.getX()))
+ {
+ aWinSize.setX(maViewSize.getX());
+ }
+
+ return aWinSize.getX() / maViewSize.getX();
}
/*************************************************************************
@@ -817,12 +819,16 @@ double Window::GetVisibleWidth()
|*
\************************************************************************/
-double Window::GetVisibleHeight()
+double Window::GetVisibleHeightRelativeToView()
{
- Size aWinSize = PixelToLogic(GetOutputSizePixel());
- if ( aWinSize.Height() > maViewSize.Height() )
- aWinSize.Height() = maViewSize.Height();
- return ((double) aWinSize.Height() / maViewSize.Height());
+ basegfx::B2DVector aWinSize(GetLogicVector());
+
+ if(basegfx::fTools::more(aWinSize.getY(), maViewSize.getY()))
+ {
+ aWinSize.setY(maViewSize.getY());
+ }
+
+ return aWinSize.getY() / maViewSize.getY();
}
/*************************************************************************
@@ -834,7 +840,7 @@ double Window::GetVisibleHeight()
double Window::GetScrlLineWidth()
{
- return (GetVisibleWidth() * SCROLL_LINE_FACT);
+ return (GetVisibleWidthRelativeToView() * SCROLL_LINE_FACT);
}
/*************************************************************************
@@ -846,7 +852,7 @@ double Window::GetScrlLineWidth()
double Window::GetScrlLineHeight()
{
- return (GetVisibleHeight() * SCROLL_LINE_FACT);
+ return (GetVisibleHeightRelativeToView() * SCROLL_LINE_FACT);
}
/*************************************************************************
@@ -858,7 +864,7 @@ double Window::GetScrlLineHeight()
double Window::GetScrlPageWidth()
{
- return (GetVisibleWidth() * SCROLL_PAGE_FACT);
+ return (GetVisibleWidthRelativeToView() * SCROLL_PAGE_FACT);
}
/*************************************************************************
@@ -870,7 +876,7 @@ double Window::GetScrlPageWidth()
double Window::GetScrlPageHeight()
{
- return (GetVisibleHeight() * SCROLL_PAGE_FACT);
+ return (GetVisibleHeightRelativeToView() * SCROLL_PAGE_FACT);
}
/*************************************************************************
@@ -950,16 +956,16 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
sal_uInt16 nPreviewSlot;
if( rStyleSettings.GetHighContrastMode() )
- nOutputMode = ViewShell::OUTPUT_DRAWMODE_CONTRAST;
+ nOutputMode = SD_OUTPUT_DRAWMODE_CONTRAST;
else
- nOutputMode = ViewShell::OUTPUT_DRAWMODE_COLOR;
+ nOutputMode = SD_OUTPUT_DRAWMODE_COLOR;
if( rStyleSettings.GetHighContrastMode() && aAccOptions.GetIsForPagePreviews() )
nPreviewSlot = SID_PREVIEW_QUALITY_CONTRAST;
else
nPreviewSlot = SID_PREVIEW_QUALITY_COLOR;
- if( mpViewShell->ISA( DrawViewShell ) )
+ if( dynamic_cast< DrawViewShell* >(mpViewShell) )
{
SetDrawMode( nOutputMode );
mpViewShell->GetFrameView()->SetDrawMode( nOutputMode );
@@ -969,7 +975,7 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
}
// #103100# Overwrite window color for OutlineView
- if( mpViewShell->ISA(OutlineViewShell ) )
+ if( dynamic_cast< OutlineViewShell* >(mpViewShell) )
{
svtools::ColorConfig aColorConfig;
const Color aDocColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
@@ -982,9 +988,9 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
mpViewShell->ArrangeGUIElements();
// #101928# re-create handles to show new outfit
- if(mpViewShell->ISA(DrawViewShell))
+ if(dynamic_cast< DrawViewShell* >(mpViewShell))
{
- mpViewShell->GetView()->AdjustMarkHdl();
+ mpViewShell->GetView()->SetMarkHandles();
}
}
}
@@ -1025,7 +1031,7 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
{
DrawDocShell* pDocSh = mpViewShell->GetDocSh();
if( pDocSh )
- pDocSh->SetPrinter( pDocSh->GetPrinter( sal_True ) );
+ pDocSh->SetPrinter( pDocSh->GetPrinter( true ) );
}
}
@@ -1042,7 +1048,7 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
{
DrawDocShell* pDocSh = mpViewShell->GetDocSh();
if( pDocSh )
- pDocSh->SetPrinter( pDocSh->GetPrinter( sal_True ) );
+ pDocSh->SetPrinter( pDocSh->GetPrinter( true ) );
}
}
@@ -1069,8 +1075,10 @@ sal_Int8 Window::AcceptDrop( const AcceptDropEvent& rEvt )
if( mpViewShell )
nRet = mpViewShell->AcceptDrop( rEvt, *this, this, SDRPAGE_NOTFOUND, SDRLAYER_NOTFOUND );
- if (mbUseDropScroll && ! mpViewShell->ISA(OutlineViewShell))
- DropScroll( rEvt.maPosPixel );
+ if (mbUseDropScroll && !dynamic_cast< OutlineViewShell* >(mpViewShell))
+ {
+ DropScroll( basegfx::B2DPoint(rEvt.maPosPixel.X(), rEvt.maPosPixel.Y()) );
+ }
}
return nRet;
@@ -1111,45 +1119,47 @@ void Window::SetUseDropScroll (bool bUseDropScroll)
|*
\************************************************************************/
-void Window::DropScroll(const Point& rMousePos)
+void Window::DropScroll(const basegfx::B2DPoint& rMousePos)
{
- short nDx = 0;
- short nDy = 0;
-
- Size aSize = GetOutputSizePixel();
+ const basegfx::B2DVector aDiscretePixels(GetDiscreteVector());
+ basegfx::B2DVector fDelta(0.0, 0.0);
- if (aSize.Width() > SCROLL_SENSITIVE * 3)
+ if (aDiscretePixels.getX() > SCROLL_SENSITIVE * 3)
{
- if ( rMousePos.X() < SCROLL_SENSITIVE )
+ if ( rMousePos.getX() < SCROLL_SENSITIVE )
{
- nDx = -1;
+ fDelta.setX(-1.0);
}
- if ( rMousePos.X() >= aSize.Width() - SCROLL_SENSITIVE )
+ if ( rMousePos.getX() >= aDiscretePixels.getX() - SCROLL_SENSITIVE )
{
- nDx = 1;
+ fDelta.setX(1.0);
}
}
- if (aSize.Height() > SCROLL_SENSITIVE * 3)
+ if (aDiscretePixels.getY() > SCROLL_SENSITIVE * 3)
{
- if ( rMousePos.Y() < SCROLL_SENSITIVE )
+ if ( rMousePos.getY() < SCROLL_SENSITIVE )
{
- nDy = -1;
+ fDelta.setY(-1.0);
}
- if ( rMousePos.Y() >= aSize.Height() - SCROLL_SENSITIVE )
+ if ( rMousePos.getY() >= aDiscretePixels.getY() - SCROLL_SENSITIVE )
{
- nDy = 1;
+ fDelta.setY(1.0);
}
}
- if ( (nDx || nDy) && (rMousePos.X()!=0 || rMousePos.Y()!=0 ) )
+ if(!fDelta.equalZero() && !rMousePos.equalZero())
{
if (mnTicks > 20)
- mpViewShell->ScrollLines(nDx, nDy);
+ {
+ mpViewShell->ScrollLines(fDelta);
+ }
else
+ {
mnTicks ++;
+ }
}
}
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index b9ed399eedd8..b6d8f46e5563 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -93,7 +93,7 @@ TabControl::TabControl(DrawViewShell* pViewSh, Window* pParent) :
DragSourceHelper( this ),
DropTargetHelper( this ),
pDrViewSh(pViewSh),
- bInternalMove(sal_False)
+ bInternalMove(false)
{
EnableEditMode();
SetSizePixel(Size(0, 0));
@@ -194,7 +194,7 @@ void TabControl::DoubleClick()
void TabControl::StartDrag( sal_Int8, const Point& )
{
- bInternalMove = sal_True;
+ bInternalMove = true;
// object is delete by reference mechanismn
( new TabControl::TabControlTransferable( *this ) )->StartDrag( this, DND_ACTION_COPYMOVE );
@@ -208,7 +208,7 @@ void TabControl::StartDrag( sal_Int8, const Point& )
void TabControl::DragFinished( sal_Int8 )
{
- bInternalMove = sal_False;
+ bInternalMove = false;
}
/*************************************************************************
@@ -243,11 +243,11 @@ sal_Int8 TabControl::AcceptDrop( const AcceptDropEvent& rEvt )
{
HideDropPos();
- sal_Int32 nPageId = GetPageId( aPos ) - 1;
+ const sal_uInt32 nPageId(GetPageId( aPos ));
- if( ( nPageId >= 0 ) && pDoc->GetPage( (sal_uInt16)nPageId ) )
+ if( ( nPageId >= 1 ) && pDoc->GetPage( nPageId - 1 ) )
{
- nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND );
+ nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, nPageId - 1, SDRLAYER_NOTFOUND );
SwitchPage( aPos );
}
}
@@ -324,11 +324,11 @@ sal_Int8 TabControl::ExecuteDrop( const ExecuteDropEvent& rEvt )
}
else
{
- sal_Int32 nPageId = GetPageId( aPos ) - 1;
+ const sal_uInt32 nPageId(GetPageId( aPos ));
- if( ( nPageId >= 0 ) && pDoc->GetPage( (sal_uInt16)nPageId ) )
+ if( ( nPageId >= 1 ) && pDoc->GetPage( nPageId - 1 ) )
{
- nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND );
+ nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, nPageId - 1, SDRLAYER_NOTFOUND );
}
}
@@ -348,7 +348,7 @@ void TabControl::Command(const CommandEvent& rCEvt)
if ( nCmd == COMMAND_CONTEXTMENU )
{
- sal_Bool bGraphicShell = pDrViewSh->ISA(GraphicViewShell);
+ bool bGraphicShell = dynamic_cast< GraphicViewShell* >(pDrViewSh);
sal_uInt16 nResId = bGraphicShell ? RID_GRAPHIC_PAGETAB_POPUP :
RID_DRAW_PAGETAB_POPUP;
SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher();
@@ -362,11 +362,11 @@ void TabControl::Command(const CommandEvent& rCEvt)
long TabControl::StartRenaming()
{
- sal_Bool bOK = sal_False;
+ bool bOK = false;
if (pDrViewSh->GetPageKind() == PK_STANDARD)
{
- bOK = sal_True;
+ bOK = true;
::sd::View* pView = pDrViewSh->GetView();
@@ -383,7 +383,7 @@ long TabControl::StartRenaming()
long TabControl::AllowRenaming()
{
- sal_Bool bOK = sal_True;
+ bool bOK = true;
String aNewName( GetEditText() );
String aCompareName( GetPageText( GetEditPageId() ) );
@@ -398,7 +398,7 @@ long TabControl::AllowRenaming()
}
else
{
- bOK = sal_False;
+ bOK = false;
}
}
return( bOK );
diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx
index 1e3c64a70577..abb08de709bf 100644
--- a/sd/source/ui/view/unmodpg.cxx
+++ b/sd/source/ui/view/unmodpg.cxx
@@ -29,22 +29,16 @@
#endif
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
-
-
+#include <svx/svdview.hxx>
#include "strings.hrc"
#include "glob.hxx"
#include "glob.hrc" // STR_BCKGRND, STR_BCKGRNDOBJ
#include "app.hrc" // SID_SWITCHPAGE
-
#include "unmodpg.hxx"
#include "sdpage.hxx"
#include "sdresid.hxx"
#include "drawdoc.hxx"
-
-TYPEINIT1(ModifyPageUndoAction, SdUndoAction);
-
-
/*************************************************************************
|*
|* Konstruktor
@@ -56,8 +50,8 @@ ModifyPageUndoAction::ModifyPageUndoAction(
SdPage* pThePage,
String aTheNewName,
AutoLayout eTheNewAutoLayout,
- sal_Bool bTheNewBckgrndVisible,
- sal_Bool bTheNewBckgrndObjsVisible)
+ bool bTheNewBckgrndVisible,
+ bool bTheNewBckgrndObjsVisible)
: SdUndoAction(pTheDoc)
{
DBG_ASSERT(pThePage, "Undo ohne Seite ???");
@@ -73,9 +67,9 @@ ModifyPageUndoAction::ModifyPageUndoAction(
if (!mpPage->IsMasterPage())
{
maOldName = mpPage->GetName();
- SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = mpDoc->GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SetOfByte aVisibleLayers = mpPage->TRG_GetMasterPageVisibleLayers();
mbOldBckgrndVisible = aVisibleLayers.IsSet(aBckgrnd);
@@ -90,20 +84,17 @@ ModifyPageUndoAction::ModifyPageUndoAction(
|* Undo()
|*
\************************************************************************/
-#include <svx/svdviter.hxx>
-#include <svx/svdview.hxx>
+
void ModifyPageUndoAction::Undo()
{
// #94637# invalidate Selection, there could be objects deleted in tis UNDO
// which are no longer allowed to be selected then.
- SdrViewIter aIter(mpPage);
- SdrView* pView = aIter.FirstView();
+ const ::std::set< SdrView* > aAllSdrViews(mpPage->getSdrModelFromSdrPage().getSdrViews());
- while(pView)
+ for(::std::set< SdrView* >::const_iterator aLoopViews(aAllSdrViews.begin());
+ aLoopViews != aAllSdrViews.end(); aLoopViews++)
{
- if(pView->AreObjectsMarked())
- pView->UnmarkAll();
- pView = aIter.NextView();
+ (*aLoopViews)->UnmarkAll();
}
mpPage->SetAutoLayout( meOldAutoLayout );
@@ -116,14 +107,14 @@ void ModifyPageUndoAction::Undo()
if (mpPage->GetPageKind() == PK_STANDARD)
{
- SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNum() + 1);
+ SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNumber() + 1);
pNotesPage->SetName(maOldName);
}
}
- SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = mpDoc->GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SetOfByte aVisibleLayers;
aVisibleLayers.Set(aBckgrnd, mbOldBckgrndVisible);
aVisibleLayers.Set(aBckgrndObj, mbOldBckgrndObjsVisible);
@@ -145,14 +136,12 @@ void ModifyPageUndoAction::Redo()
{
// #94637# invalidate Selection, there could be objects deleted in tis UNDO
// which are no longer allowed to be selected then.
- SdrViewIter aIter(mpPage);
- SdrView* pView = aIter.FirstView();
+ const ::std::set< SdrView* > aAllSdrViews(mpPage->getSdrModelFromSdrPage().getSdrViews());
- while(pView)
+ for(::std::set< SdrView* >::const_iterator aLoopViews(aAllSdrViews.begin());
+ aLoopViews != aAllSdrViews.end(); aLoopViews++)
{
- if(pView->AreObjectsMarked())
- pView->UnmarkAll();
- pView = aIter.NextView();
+ (*aLoopViews)->UnmarkAll();
}
mpPage->meAutoLayout = meNewAutoLayout;
@@ -165,14 +154,14 @@ void ModifyPageUndoAction::Redo()
if (mpPage->GetPageKind() == PK_STANDARD)
{
- SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNum() + 1);
+ SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNumber() + 1);
pNotesPage->SetName(maNewName);
}
}
- SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = mpDoc->GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SetOfByte aVisibleLayers;
aVisibleLayers.Set(aBckgrnd, mbNewBckgrndVisible);
aVisibleLayers.Set(aBckgrndObj, mbNewBckgrndObjsVisible);
diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx
index dbdd979f34a6..3c188b7e116f 100644
--- a/sd/source/ui/view/viewoverlaymanager.cxx
+++ b/sd/source/ui/view/viewoverlaymanager.cxx
@@ -62,6 +62,7 @@
#include "sdpage.hxx"
#include "drawdoc.hxx"
#include "smarttag.hxx"
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star::uno;
@@ -145,10 +146,11 @@ private:
class ImageButtonHdl : public SmartHdl
{
public:
- ImageButtonHdl( const SmartTagReference& xTag, /* sal_uInt16 nSID, const Image& rImage, const Image& rImageMO, */ const Point& rPnt );
- virtual ~ImageButtonHdl();
- virtual void CreateB2dIAObject();
- virtual sal_Bool IsFocusHdl() const;
+ ImageButtonHdl(
+ SdrHdlList& rHdlList,
+ const SmartTagReference& xTag,
+ const basegfx::B2DPoint& rPnt );
+ virtual bool IsFocusHdl() const;
virtual Pointer GetPointer() const;
virtual bool isMarkable() const;
@@ -159,6 +161,10 @@ public:
void HideTip();
+protected:
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+ virtual ~ImageButtonHdl();
+
private:
rtl::Reference< ChangePlaceholderTag > mxTag;
@@ -169,8 +175,11 @@ private:
// --------------------------------------------------------------------
-ImageButtonHdl::ImageButtonHdl( const SmartTagReference& xTag /*, sal_uInt16 nSID, const Image& rImage, const Image& rImageMO*/, const Point& rPnt )
-: SmartHdl( xTag, rPnt )
+ImageButtonHdl::ImageButtonHdl(
+ SdrHdlList& rHdlList,
+ const SmartTagReference& xTag,
+ const basegfx::B2DPoint& rPnt )
+: SmartHdl( rHdlList, 0, xTag, HDL_SMARTTAG, rPnt )
, mxTag( dynamic_cast< ChangePlaceholderTag* >( xTag.get() ) )
, mnHighlightId( -1 )
, maImageSize( 42, 42 )
@@ -203,36 +212,30 @@ extern ::rtl::OUString ImplRetrieveLabelFromCommand( const Reference< XFrame >&
void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt)
{
int nHighlightId = 0;
+ OutputDevice* pDev = mrHdlList.GetViewFromSdrHdlList().GetFirstOutputDevice();
+ if( pDev == 0 )
+ pDev = Application::GetDefaultDevice();
- if( pHdlList && pHdlList->GetView())
- {
- OutputDevice* pDev = pHdlList->GetView()->GetFirstOutputDevice();
- if( pDev == 0 )
- pDev = Application::GetDefaultDevice();
+ Point aMDPos( rMEvt.GetPosPixel() );
+ const basegfx::B2DPoint aPosPixel(pDev->GetViewTransformation() * getPosition());
+ const Point aPointPixel(basegfx::fround(aPosPixel.getX()), basegfx::fround(aPosPixel.getY()));
+ aMDPos -= aPointPixel;
- Point aMDPos( rMEvt.GetPosPixel() );
- aMDPos -= pDev->LogicToPixel( GetPos() );
+ nHighlightId += aMDPos.X() > maImageSize.Width() ? 1 : 0;
+ nHighlightId += aMDPos.Y() > maImageSize.Height() ? 2 : 0;
- nHighlightId += aMDPos.X() > maImageSize.Width() ? 1 : 0;
- nHighlightId += aMDPos.Y() > maImageSize.Height() ? 2 : 0;
-
- if( mnHighlightId != nHighlightId )
- {
- HideTip();
-
- mnHighlightId = nHighlightId;
+ if( mnHighlightId != nHighlightId )
+ {
+ HideTip();
- if( pHdlList )
- {
- SdResId aResId( gButtonToolTips[mnHighlightId] );
- aResId.SetRT( RSC_STRING );
+ mnHighlightId = nHighlightId;
+ SdResId aResId( gButtonToolTips[mnHighlightId] );
+ aResId.SetRT( RSC_STRING );
- String aHelpText( aResId );
- Rectangle aScreenRect( pDev->LogicToPixel( GetPos() ), maImageSize );
- mnTip = Help::ShowTip( static_cast< ::Window* >( pHdlList->GetView()->GetFirstOutputDevice() ), aScreenRect, aHelpText, 0 ) ;
- }
- Touch();
- }
+ String aHelpText( aResId );
+ Rectangle aScreenRect( aPointPixel, maImageSize );
+ mnTip = Help::ShowTip( static_cast< ::Window* >( mrHdlList.GetViewFromSdrHdlList().GetFirstOutputDevice() ), aScreenRect, aHelpText, 0 ) ;
+ Touch();
}
}
@@ -247,51 +250,22 @@ void ImageButtonHdl::onMouseLeave()
// --------------------------------------------------------------------
-void ImageButtonHdl::CreateB2dIAObject()
+void ImageButtonHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
{
- // first throw away old one
- GetRidOfIAObject();
-
- const Point aTagPos( GetPos() );
- basegfx::B2DPoint aPosition( aTagPos.X(), aTagPos.Y() );
-
- BitmapEx aBitmapEx( mxTag->createOverlayImage( mnHighlightId ) ); // maImageMO.GetBitmapEx() : maImage.GetBitmapEx() );
+ BitmapEx aBitmapEx( mxTag->createOverlayImage( mnHighlightId ) );
maImageSize = aBitmapEx.GetSizePixel();
maImageSize.Width() >>= 1;
maImageSize.Height() >>= 1;
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b = 0; b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow();
- if(rPaintWindow.OutputToWindow() && rPageWindow.GetOverlayManager() )
- {
- ::sdr::overlay::OverlayObject* pOverlayObject = 0;
+ ::sdr::overlay::OverlayObject* pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( getPosition(), aBitmapEx, 0, 0 );
- pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 );
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ rOverlayManager.add(*pOverlayObject);
maOverlayGroup.append(*pOverlayObject);
- }
- }
- }
- }
- }
}
// --------------------------------------------------------------------
-sal_Bool ImageButtonHdl::IsFocusHdl() const
+bool ImageButtonHdl::IsFocusHdl() const
{
return false;
}
@@ -338,11 +312,12 @@ bool ChangePlaceholderTag::MouseButtonDown( const MouseEvent& /*rMEvt*/, SmartHd
if( mxPlaceholderObj.get() )
{
// mark placeholder if it is not currently marked (or if also others are marked)
- if( !mrView.IsObjMarked( mxPlaceholderObj.get() ) || (mrView.GetMarkedObjectList().GetMarkCount() != 1) )
+ const SdrObject* pSingleSelected = mrView.getSelectedIfSingle();
+
+ if( pSingleSelected != mxPlaceholderObj.get() )
{
- SdrPageView* pPV = mrView.GetSdrPageView();
- mrView.UnmarkAllObj(pPV );
- mrView.MarkObj(mxPlaceholderObj.get(), pPV, sal_False);
+ mrView.UnmarkAllObj();
+ mrView.MarkObj(*mxPlaceholderObj.get(), false);
}
}
@@ -377,18 +352,17 @@ bool ChangePlaceholderTag::KeyInput( const KeyEvent& rKEvt )
BitmapEx ChangePlaceholderTag::createOverlayImage( int nHighlight )
{
BitmapEx aRet;
+
if( mxPlaceholderObj.is() )
{
SdrObject* pPlaceholder = mxPlaceholderObj.get();
SmartTagReference xThis( this );
- const Rectangle& rSnapRect = pPlaceholder->GetSnapRect();
- const Point aPoint;
-
+ const Rectangle aSnapRect(sdr::legacy::GetSnapRect(*pPlaceholder));
OutputDevice* pDev = mrView.GetFirstOutputDevice();
if( pDev == 0 )
pDev = Application::GetDefaultDevice();
- Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize());
+ Size aShapeSizePix = pDev->LogicToPixel(aSnapRect.GetSize());
long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height());
bool bLarge = nShapeSizePix > 250;
@@ -416,21 +390,20 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList )
{
SdrObject* pPlaceholder = mxPlaceholderObj.get();
SmartTagReference xThis( this );
- const Rectangle& rSnapRect = pPlaceholder->GetSnapRect();
- const Point aPoint;
+ const Rectangle aSnapRect(sdr::legacy::GetSnapRect(*pPlaceholder));
OutputDevice* pDev = mrView.GetFirstOutputDevice();
if( pDev == 0 )
pDev = Application::GetDefaultDevice();
- Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize());
- long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height());
+ const Size aShapeSizePix(pDev->LogicToPixel(aSnapRect.GetSize()));
+ const long nShapeSizePix(std::min(aShapeSizePix.Width(),aShapeSizePix.Height()));
+
if( 50 > nShapeSizePix )
return;
- bool bLarge = nShapeSizePix > 250;
-
- Size aButtonSize( pDev->PixelToLogic( getButtonImage(0, bLarge )->GetSizePixel()) );
+ const bool bLarge(nShapeSizePix > 250);
+ const Size aButtonSize( pDev->PixelToLogic( getButtonImage(0, bLarge )->GetSizePixel()) );
const int nColumns = 2;
const int nRows = 2;
@@ -438,17 +411,12 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList )
long all_width = nColumns * aButtonSize.Width();
long all_height = nRows * aButtonSize.Height();
- Point aPos( rSnapRect.Center() );
+ Point aPos( aSnapRect.Center() );
aPos.X() -= all_width >> 1;
aPos.Y() -= all_height >> 1;
- ImageButtonHdl* pHdl = new ImageButtonHdl( xThis, aPoint );
+ ImageButtonHdl* pHdl = new ImageButtonHdl(rHandlerList, xThis, basegfx::B2DPoint(aPos.X(), aPos.Y()) );
pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
- pHdl->SetPageView( mrView.GetSdrPageView() );
-
- pHdl->SetPos( aPos );
-
- rHandlerList.AddHdl( pHdl );
}
}
@@ -542,7 +510,7 @@ IMPL_LINK(ViewOverlayManager,UpdateTagsHdl, void *, EMPTYARG)
bChanges |= CreateTags();
if( bChanges && mrBase.GetDrawView() )
- static_cast< ::sd::View* >( mrBase.GetDrawView() )->updateHandles();
+ static_cast< ::sd::View* >( mrBase.GetDrawView() )->SetMarkHandles();
return 0;
}
@@ -554,13 +522,15 @@ bool ViewOverlayManager::CreateTags()
if( pPage && !pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) )
{
- const std::list< SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList();
+ const std::list< const SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList();
- for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ )
+ for( std::list< const SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ )
{
if( (*iter)->IsEmptyPresObj() && ((*iter)->GetObjIdentifier() == OBJ_OUTLINETEXT) && (mrBase.GetDrawView()->GetTextEditObject() != (*iter)) )
{
- rtl::Reference< SmartTag > xTag( new ChangePlaceholderTag( *this, *mrBase.GetMainViewShell()->GetView(), *(*iter) ) );
+ rtl::Reference< SmartTag > xTag(
+ new ChangePlaceholderTag(
+ *this, *mrBase.GetMainViewShell()->GetView(), *const_cast< SdrObject* >(*iter) ) );
maTagVector.push_back(xTag);
bChanges = true;
}
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 85a3ffad1ced..42f07a081f92 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -83,7 +83,7 @@
#include <sfx2/viewfrm.hxx>
#include <svtools/soerr.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-#include <svx/charthelper.hxx>
+#include <svx/svdlegacy.hxx>
#ifdef _MSC_VER
#pragma optimize ( "", off )
@@ -105,7 +105,7 @@ void ViewShell::UpdateScrollBars()
{
if (mpHorizontalScrollBar.get() != NULL)
{
- long nW = (long)(mpContentWindow->GetVisibleWidth() * 32000);
+ long nW = (long)(mpContentWindow->GetVisibleWidthRelativeToView() * 32000);
long nX = (long)(mpContentWindow->GetVisibleX() * 32000);
mpHorizontalScrollBar->SetVisibleSize(nW);
mpHorizontalScrollBar->SetThumbPos(nX);
@@ -118,14 +118,14 @@ void ViewShell::UpdateScrollBars()
if (mpVerticalScrollBar.get() != NULL)
{
- long nH = (long)(mpContentWindow->GetVisibleHeight() * 32000);
+ long nH = (long)(mpContentWindow->GetVisibleHeightRelativeToView() * 32000);
long nY = (long)(mpContentWindow->GetVisibleY() * 32000);
if(IsPageFlipMode()) // ie in zoom mode where no panning
{
SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
- sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) / 2;
- sal_uInt16 nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind());
+ sal_uInt32 nCurPage = (pPage->GetPageNumber() - 1) / 2;
+ sal_uInt32 nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind());
mpVerticalScrollBar->SetRange(Range(0,256*nTotalPages));
mpVerticalScrollBar->SetVisibleSize(256);
mpVerticalScrollBar->SetThumbPos(256*nCurPage);
@@ -194,10 +194,7 @@ long ViewShell::VirtHScrollHdl(ScrollBar* pHScroll)
Point aVisAreaPos = GetActiveWindow()->PixelToLogic( Point(0,0) );
aVisArea.SetPos(aVisAreaPos);
GetDocSh()->SetVisArea(aVisArea);
-
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- VisAreaChanged(aVisAreaWin);
+ UpdateVisAreaChanged();
if (pView)
{
@@ -238,8 +235,8 @@ long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
if(IsPageFlipMode())
{
SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
- sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1;
- sal_uInt16 nNewPage = (sal_uInt16)pVScroll->GetThumbPos()/256;
+ sal_uInt32 nCurPage = (pPage->GetPageNumber() - 1) >> 1;
+ sal_uInt32 nNewPage = pVScroll->GetThumbPos()/256;
if( nCurPage != nNewPage )
static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage);
}
@@ -262,10 +259,7 @@ long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
Point aVisAreaPos = GetActiveWindow()->PixelToLogic( Point(0,0) );
aVisArea.SetPos(aVisAreaPos);
GetDocSh()->SetVisArea(aVisArea);
-
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- VisAreaChanged(aVisAreaWin);
+ UpdateVisAreaChanged();
if (pView)
{
@@ -283,7 +277,7 @@ long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
return 0;
}
-SvxRuler* ViewShell::CreateHRuler(::sd::Window* , sal_Bool )
+SvxRuler* ViewShell::CreateHRuler(::sd::Window* , bool )
{
return NULL;
}
@@ -313,18 +307,25 @@ long ViewShell::GetHCtrlWidth()
|*
\************************************************************************/
-void ViewShell::ScrollLines(long nLinesX, long nLinesY)
+void ViewShell::ScrollLines(const basegfx::B2DVector& rDelta)
{
- if ( nLinesX )
+ if(!rDelta.equalZero())
{
- nLinesX *= mpHorizontalScrollBar->GetLineSize();
- }
- if ( nLinesY )
- {
- nLinesY *= mpVerticalScrollBar->GetLineSize();
- }
+ sal_Int32 nLinesX(basegfx::fround(rDelta.getX()));
+ sal_Int32 nLinesY(basegfx::fround(rDelta.getY()));
+
+ if ( nLinesX )
+ {
+ nLinesX *= mpHorizontalScrollBar->GetLineSize();
+ }
+
+ if ( nLinesY )
+ {
+ nLinesY *= mpVerticalScrollBar->GetLineSize();
+ }
- Scroll(nLinesX, nLinesY);
+ Scroll(nLinesX, nLinesY);
+ }
}
/*************************************************************************
@@ -356,10 +357,7 @@ void ViewShell::Scroll(long nScrollX, long nScrollY)
Point aVisAreaPos = GetActiveWindow()->PixelToLogic( Point(0,0) );
aVisArea.SetPos(aVisAreaPos);
GetDocSh()->SetVisArea(aVisArea);
-
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- VisAreaChanged(aVisAreaWin);
+ UpdateVisAreaChanged();
::sd::View* pView = GetView();
if (pView)
@@ -402,9 +400,7 @@ void ViewShell::SetZoom(long nZoom)
mpContentWindow->Invalidate(INVALIDATE_CHILDREN);
}
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- VisAreaChanged(aVisAreaWin);
+ UpdateVisAreaChanged();
::sd::View* pView = GetView();
if (pView)
@@ -422,36 +418,34 @@ void ViewShell::SetZoom(long nZoom)
|*
\************************************************************************/
-void ViewShell::SetZoomRect(const Rectangle& rZoomRect)
+void ViewShell::SetZoomRange(const basegfx::B2DRange& rZoomRange)
{
- long nZoom = GetActiveWindow()->SetZoomRect(rZoomRect);
- Fraction aUIScale(nZoom, 100);
- aUIScale *= GetDoc()->GetUIScale();
+ double fZoom(GetActiveWindow()->SetZoomRange(rZoomRange));
- Point aPos = GetActiveWindow()->GetWinViewPos();
-
- if (mpHorizontalRuler.get() != NULL)
- mpHorizontalRuler->SetZoom(aUIScale);
+ if(mpHorizontalRuler.get())
+ {
+ mpHorizontalRuler->SetZoom(Fraction(fZoom * 0.01 * double(GetDoc()->GetUIScale())));
+ }
- if (mpVerticalRuler.get() != NULL)
- mpVerticalRuler->SetZoom(aUIScale);
+ if(mpVerticalRuler.get())
+ {
+ mpVerticalRuler->SetZoom(Fraction(fZoom * 0.01 * double(GetDoc()->GetUIScale())));
+ }
- if (mpContentWindow.get() != NULL)
+ if(mpContentWindow.get())
{
- Point aNewPos = mpContentWindow->GetWinViewPos();
- aNewPos.X() = aPos.X();
- aNewPos.Y() = aPos.Y();
- mpContentWindow->SetZoomIntegral(nZoom);
- mpContentWindow->SetWinViewPos(aNewPos);
+//TTTT // WinViewPos is rescued over the SetZoomIntegral call indirectly in the
+// // old code, doing the same here
+// const basegfx::B2DPoint aWinViewPos(mpContentWindow->GetWinViewPos());
+ mpContentWindow->SetZoomIntegral(fZoom);
+// mpContentWindow->SetWinViewPos(aWinViewPos);
mpContentWindow->UpdateMapOrigin();
// #i74769# see above
mpContentWindow->Invalidate(INVALIDATE_CHILDREN);
}
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- VisAreaChanged(aVisAreaWin);
+ UpdateVisAreaChanged();
::sd::View* pView = GetView();
if (pView)
@@ -468,8 +462,7 @@ void ViewShell::SetZoomRect(const Rectangle& rZoomRect)
|*
\************************************************************************/
-void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize,
- const Point& rWinPos, sal_Bool bUpdate)
+void ViewShell::InitWindows(const basegfx::B2DPoint& rViewOrigin, const basegfx::B2DVector& rViewSize, const basegfx::B2DPoint& rWinPos, bool bUpdate)
{
if (mpContentWindow.get() != NULL)
{
@@ -484,9 +477,7 @@ void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize,
}
}
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- VisAreaChanged(aVisAreaWin);
+ UpdateVisAreaChanged();
::sd::View* pView = GetView();
if (pView)
@@ -515,11 +506,15 @@ void ViewShell::InvalidateWindows()
|*
\************************************************************************/
-void ViewShell::DrawMarkRect(const Rectangle& rRect) const
+void ViewShell::DrawMarkRange(const basegfx::B2DRange& rRange) const
{
if (mpContentWindow.get() != NULL)
{
- mpContentWindow->InvertTracking(rRect, SHOWTRACK_OBJECT | SHOWTRACK_WINDOW);
+ const Rectangle aRectangle(
+ basegfx::fround(rRange.getMinX()), basegfx::fround(rRange.getMinY()),
+ basegfx::fround(rRange.getMaxX()), basegfx::fround(rRange.getMaxY()));
+
+ mpContentWindow->InvertTracking(aRectangle, SHOWTRACK_OBJECT | SHOWTRACK_WINDOW);
}
}
@@ -529,11 +524,12 @@ void ViewShell::DrawMarkRect(const Rectangle& rRect) const
|*
\************************************************************************/
-void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
- long nLeft, long nRight,
- long nUpper, long nLower, sal_Bool bScaleAll,
+void ViewShell::SetPageSizeAndBorder(
+ PageKind ePageKind, const basegfx::B2DVector& rNewSize,
+ double fLeft, double fRight,
+ double fTop, double fBottom, bool bScaleAll,
Orientation eOrientation, sal_uInt16 nPaperBin,
- sal_Bool bBackgroundFullSize)
+ bool bBackgroundFullSize)
{
SdPage* pPage = 0;
SdUndoGroup* pUndoGroup = NULL;
@@ -542,9 +538,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
pUndoGroup->SetComment(aString);
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=NULL);
-
- sal_uInt16 i, nPageCnt = GetDoc()->GetMasterSdPageCount(ePageKind);
-
+ sal_uInt32 i, nPageCnt = GetDoc()->GetMasterSdPageCount(ePageKind);
Broadcast (ViewShellHint(ViewShellHint::HINT_PAGE_RESIZE_START));
for (i = 0; i < nPageCnt; i++)
@@ -555,35 +549,37 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
pPage = GetDoc()->GetMasterSdPage(i, ePageKind);
SdUndoAction* pUndo = new SdPageFormatUndoAction(GetDoc(), pPage,
- pPage->GetSize(),
- pPage->GetLftBorder(), pPage->GetRgtBorder(),
- pPage->GetUppBorder(), pPage->GetLwrBorder(),
+ pPage->GetPageScale(),
+ pPage->GetLeftPageBorder(),
+ pPage->GetRightPageBorder(),
+ pPage->GetTopPageBorder(),
+ pPage->GetBottomPageBorder(),
pPage->IsScaleObjects(),
pPage->GetOrientation(),
pPage->GetPaperBin(),
pPage->IsBackgroundFullSize(),
rNewSize,
- nLeft, nRight,
- nUpper, nLower,
+ fLeft,
+ fRight,
+ fTop,
+ fBottom,
bScaleAll,
eOrientation,
nPaperBin,
bBackgroundFullSize);
pUndoGroup->AddAction(pUndo);
- if (rNewSize.Width() > 0 ||
- nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0)
+ if (rNewSize.getX() > 0.0 || fLeft >= 0.0 || fRight >= 0.0 || fTop >= 0.0 || fBottom >= 0.0)
{
- Rectangle aNewBorderRect(nLeft, nUpper, nRight, nLower);
- pPage->ScaleObjects(rNewSize, aNewBorderRect, bScaleAll);
+ pPage->ScaleObjects(rNewSize, fLeft, fTop, fRight, fBottom, bScaleAll);
- if (rNewSize.Width() > 0)
- pPage->SetSize(rNewSize);
+ if (rNewSize.getX() > 0.0)
+ pPage->SetPageScale(rNewSize);
}
- if( nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0 )
+ if( fLeft >= 0.0 || fRight >= 0.0 || fTop >= 0.0 || fBottom >= 0.0 )
{
- pPage->SetBorder(nLeft, nUpper, nRight, nLower);
+ pPage->SetPageBorder(fLeft, fTop, fRight, fBottom);
}
pPage->SetOrientation(eOrientation);
@@ -606,35 +602,37 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
pPage = GetDoc()->GetSdPage(i, ePageKind);
SdUndoAction* pUndo = new SdPageFormatUndoAction(GetDoc(), pPage,
- pPage->GetSize(),
- pPage->GetLftBorder(), pPage->GetRgtBorder(),
- pPage->GetUppBorder(), pPage->GetLwrBorder(),
+ pPage->GetPageScale(),
+ pPage->GetLeftPageBorder(),
+ pPage->GetRightPageBorder(),
+ pPage->GetTopPageBorder(),
+ pPage->GetBottomPageBorder(),
pPage->IsScaleObjects(),
pPage->GetOrientation(),
pPage->GetPaperBin(),
pPage->IsBackgroundFullSize(),
rNewSize,
- nLeft, nRight,
- nUpper, nLower,
+ fLeft,
+ fRight,
+ fTop,
+ fBottom,
bScaleAll,
eOrientation,
nPaperBin,
bBackgroundFullSize);
pUndoGroup->AddAction(pUndo);
- if (rNewSize.Width() > 0 ||
- nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0)
+ if (rNewSize.getX() > 0.0 || fLeft >= 0.0 || fRight >= 0.0 || fTop >= 0.0 || fBottom >= 0.0)
{
- Rectangle aNewBorderRect(nLeft, nUpper, nRight, nLower);
- pPage->ScaleObjects(rNewSize, aNewBorderRect, bScaleAll);
+ pPage->ScaleObjects(rNewSize, fLeft, fTop, fRight, fBottom, bScaleAll);
- if (rNewSize.Width() > 0)
- pPage->SetSize(rNewSize);
+ if (rNewSize.getX() > 0.0)
+ pPage->SetPageScale(rNewSize);
}
- if( nLeft >= 0 || nRight >= 0 || nUpper >= 0 || nLower >= 0 )
+ if( fLeft >= 0.0 || fRight >= 0.0 || fTop >= 0.0 || fBottom >= 0.0 )
{
- pPage->SetBorder(nLeft, nUpper, nRight, nLower);
+ pPage->SetPageBorder(fLeft, fTop, fRight, fBottom);
}
pPage->SetOrientation(eOrientation);
@@ -652,39 +650,40 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
// Handoutseite an neues Format der Standardseiten anpassen
if( (ePageKind == PK_STANDARD) || (ePageKind == PK_HANDOUT) )
- GetDoc()->GetSdPage(0, PK_HANDOUT)->CreateTitleAndLayout(sal_True);
+ GetDoc()->GetSdPage(0, PK_HANDOUT)->CreateTitleAndLayout(true);
// Undo Gruppe dem Undo Manager uebergeben
pViewShell->GetViewFrame()->GetObjectShell()
->GetUndoManager()->AddUndoAction(pUndoGroup);
- long nWidth = pPage->GetSize().Width();
- long nHeight = pPage->GetSize().Height();
-
- Point aPageOrg = Point(nWidth, nHeight / 2);
- Size aViewSize = Size(nWidth * 3, nHeight * 2);
+ const basegfx::B2DPoint aPageOrg(pPage->GetPageScale().getX(), pPage->GetPageScale().getY() * 0.5);
+ const basegfx::B2DVector aViewSize(pPage->GetPageScale().getX() * 3.0, pPage->GetPageScale().getY() * 2.0);
+ basegfx::B2DPoint aVisAreaPos(0.0, 0.0);
- InitWindows(aPageOrg, aViewSize, Point(-1, -1), sal_True);
-
- Point aVisAreaPos;
+ InitWindows(aPageOrg, aViewSize, basegfx::B2DPoint(-1.0, -1.0), true);
if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
- aVisAreaPos = GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft();
+ const Point aOldTopLeft(GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft());
+
+ aVisAreaPos = basegfx::B2DPoint(aOldTopLeft.X(), aOldTopLeft.Y());
}
::sd::View* pView = GetView();
+
if (pView)
{
- pView->SetWorkArea(Rectangle(Point() - aVisAreaPos - aPageOrg, aViewSize));
+ const basegfx::B2DPoint aTopLeft(-aVisAreaPos.getX() - aPageOrg.getX(), -aVisAreaPos.getY() - aPageOrg.getY());
+ const basegfx::B2DRange aRange(aTopLeft, aTopLeft + aViewSize);
+
+ pView->SetWorkArea(aRange);
}
UpdateScrollBars();
- Point aNewOrigin(pPage->GetLftBorder(), pPage->GetUppBorder());
-
- if (pView)
+ if (pView && pView->GetSdrPageView() )
{
+ const basegfx::B2DPoint aNewOrigin(pPage->GetLeftPageBorder(), pPage->GetTopPageBorder());
pView->GetSdrPageView()->SetPageOrigin(aNewOrigin);
}
@@ -742,7 +741,7 @@ void ViewShell::SetActiveWindow (::sd::Window* pWin)
::sd::View* pView = GetView();
if (pView)
{
- pView->SetActualWin(pWin);
+ pView->SetActualOutDev(pWin);
}
if(HasCurrentFunction())
{
@@ -758,9 +757,9 @@ void ViewShell::SetActiveWindow (::sd::Window* pWin)
|*
\************************************************************************/
-sal_Bool ViewShell::RequestHelp(const HelpEvent& rHEvt, ::sd::Window*)
+bool ViewShell::RequestHelp(const HelpEvent& rHEvt, ::sd::Window*)
{
- sal_Bool bReturn = sal_False;
+ bool bReturn = false;
if (rHEvt.GetMode())
{
@@ -824,13 +823,13 @@ void ViewShell::WriteFrameViewData()
|*
\************************************************************************/
-sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
+bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
{
ErrCode aErrCode = 0;
SfxErrorContext aEC(ERRCTX_SO_DOVERB, GetActiveWindow(), RID_SO_ERRCTX);
- sal_Bool bAbort = sal_False;
- GetDocSh()->SetWaitCursor( sal_True );
+ bool bAbort = false;
+ GetDocSh()->SetWaitCursor( true );
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=NULL);
bool bChangeDefaultsForChart = false;
@@ -872,16 +871,16 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
aName = String();
// Dialog "OLE-Objekt einfuegen" aufrufen
- GetDocSh()->SetWaitCursor( sal_False );
+ GetDocSh()->SetWaitCursor( false );
pViewShell->GetViewFrame()->GetDispatcher()->Execute(
SID_INSERT_OBJECT,
SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD);
xObj = pObj->GetObjRef();
- GetDocSh()->SetWaitCursor( sal_True );
+ GetDocSh()->SetWaitCursor( true );
if (!xObj.is())
{
- bAbort = sal_True;
+ bAbort = true;
}
}
@@ -890,7 +889,7 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
/******************************************************
* OLE-Objekt ist nicht mehr leer
******************************************************/
- pObj->SetEmptyPresObj(sal_False);
+ pObj->SetEmptyPresObj(false);
pObj->SetOutlinerParaObject(NULL);
pObj->SetGraphic(NULL);
@@ -909,7 +908,7 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
pObj->SetObjRef(xObj);
}
- Rectangle aRect = pObj->GetLogicRect();
+ const Rectangle aRect(sdr::legacy::GetLogicRect(*pObj));
if ( pObj->GetAspect() != embed::Aspects::MSOLE_ICON )
{
@@ -947,19 +946,21 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
pSdClient = new Client(pObj, this, GetActiveWindow());
}
- Rectangle aRect = pObj->GetLogicRect();
+ Rectangle aRect(sdr::legacy::GetLogicRect(*pObj));
{
// #i118485# center on BoundRect for activation,
// OLE may be sheared/rotated now
- const Rectangle& rBoundRect = pObj->GetCurrentBoundRect();
- const Point aDelta(rBoundRect.Center() - aRect.Center());
- aRect.Move(aDelta.X(), aDelta.Y());
+ const basegfx::B2DRange& rObjectRange = pObj->getObjectRange(GetView());
+
+ aRect.Move(
+ basegfx::fround(rObjectRange.getCenterX()) - aRect.Center().X(),
+ basegfx::fround(rObjectRange.getCenterY()) - aRect.Center().Y());
}
Size aDrawSize = aRect.GetSize();
- MapMode aMapMode( GetDoc()->GetScaleUnit() );
+ MapMode aMapMode( GetDoc()->GetExchangeObjectUnit() );
Size aObjAreaSize = pObj->GetOrigObjSize( &aMapMode );
if( pObj->IsChart() ) //charts never should be stretched see #i84323# for example
aObjAreaSize = aDrawSize;
@@ -977,15 +978,15 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
if( bChangeDefaultsForChart && xObj.is())
{
- ChartHelper::AdaptDefaultsForChart( xObj );
+ AdaptDefaultsForChart( xObj );
}
pSdClient->DoVerb(nVerb); // ErrCode wird ggf. vom Sfx ausgegeben
pViewShell->GetViewFrame()->GetBindings().Invalidate(
- SID_NAVIGATOR_STATE, sal_True, sal_False);
+ SID_NAVIGATOR_STATE, true, false);
}
- GetDocSh()->SetWaitCursor( sal_False );
+ GetDocSh()->SetWaitCursor( false );
if (aErrCode != 0 && !bAbort)
{
@@ -1039,7 +1040,7 @@ void ViewShell::WriteUserData(String&)
|*
\************************************************************************/
-void ViewShell::SetRuler(sal_Bool bRuler)
+void ViewShell::SetRuler(bool bRuler)
{
mbHasRulers = ( bRuler && !GetDocSh()->IsPreview() ); // no rulers on preview mode
@@ -1082,11 +1083,11 @@ sal_Int8 ViewShell::AcceptDrop (
const AcceptDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
::sd::View* pView = GetView();
- return( pView ? pView->AcceptDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer ) : DND_ACTION_NONE );
+ return( pView ? pView->AcceptDrop( rEvt, rTargetHelper, pTargetWindow, nPage, aLayer ) : DND_ACTION_NONE );
}
/*************************************************************************
@@ -1099,11 +1100,11 @@ sal_Int8 ViewShell::ExecuteDrop (
const ExecuteDropEvent& rEvt,
DropTargetHelper& rTargetHelper,
::sd::Window* pTargetWindow,
- sal_uInt16 nPage,
- sal_uInt16 nLayer)
+ sal_uInt32 nPage,
+ SdrLayerID aLayer)
{
::sd::View* pView = GetView();
- return( pView ? pView->ExecuteDrop( rEvt, rTargetHelper, pTargetWindow, nPage, nLayer ) : DND_ACTION_NONE );
+ return( pView ? pView->ExecuteDrop( rEvt, rTargetHelper, pTargetWindow, nPage, aLayer ) : DND_ACTION_NONE );
}
#ifdef _MSC_VER
@@ -1145,7 +1146,7 @@ void ViewShell::VisAreaChanged(const Rectangle& rRect)
GetViewShell()->VisAreaChanged(rRect);
}
-void ViewShell::SetWinViewPos(const Point& rWinPos, bool bUpdate)
+void ViewShell::SetWinViewPos(const basegfx::B2DPoint& rWinPos, bool bUpdate)
{
if (mpContentWindow.get() != NULL)
{
@@ -1165,10 +1166,7 @@ void ViewShell::SetWinViewPos(const Point& rWinPos, bool bUpdate)
}
UpdateScrollBars();
-
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
- VisAreaChanged(aVisAreaWin);
+ UpdateVisAreaChanged();
::sd::View* pView = GetView();
if (pView)
@@ -1177,14 +1175,50 @@ void ViewShell::SetWinViewPos(const Point& rWinPos, bool bUpdate)
}
}
-Point ViewShell::GetWinViewPos() const
+basegfx::B2DPoint ViewShell::GetWinViewPos() const
{
return mpContentWindow->GetWinViewPos();
}
-Point ViewShell::GetViewOrigin() const
+basegfx::B2DPoint ViewShell::GetViewOrigin() const
{
return mpContentWindow->GetViewOrigin();
}
+void ViewShell::AdaptDefaultsForChart(
+ const uno::Reference < embed::XEmbeddedObject > & xEmbObj )
+{
+ if( xEmbObj.is())
+ {
+ uno::Reference< chart2::XChartDocument > xChartDoc( xEmbObj->getComponent(), uno::UNO_QUERY );
+ OSL_ENSURE( xChartDoc.is(), "Trying to set chart property to non-chart OLE" );
+ if( !xChartDoc.is())
+ return;
+
+ try
+ {
+ // set background to transparent (none)
+ uno::Reference< beans::XPropertySet > xPageProp( xChartDoc->getPageBackground());
+ if( xPageProp.is())
+ xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FillStyle")),
+ uno::makeAny( drawing::FillStyle_NONE ));
+ // set no border
+ if( xPageProp.is())
+ xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LineStyle")),
+ uno::makeAny( drawing::LineStyle_NONE ));
+ }
+ catch( const uno::Exception & )
+ {
+ OSL_ENSURE( false, "Exception caught in AdaptDefaultsForChart" );
+ }
+ }
+}
+
+void ViewShell::UpdateVisAreaChanged()
+{
+ Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
+ Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
+ VisAreaChanged(aVisAreaWin);
+}
+
} // end of namespace sd
diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx
index 0ae714598096..491fd69b93fc 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -107,7 +107,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
SdrView* pDrView = GetDrawView();
- if( pDrView->AreObjectsMarked() )
+ if( pDrView->areSdrObjectsSelected() )
{
SfxStyleSheet* pStyleSheet = pDrView->GetStyleSheet();
if( pStyleSheet )
@@ -148,13 +148,13 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
if(SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_UNDO))
{
::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
- sal_Bool bActivate(sal_False);
+ bool bActivate(false);
if(pUndoManager)
{
if(pUndoManager->GetUndoActionCount() != 0)
{
- bActivate = sal_True;
+ bActivate = true;
}
}
@@ -176,13 +176,13 @@ void ViewShell::GetMenuState( SfxItemSet &rSet )
if(SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_REDO))
{
::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
- sal_Bool bActivate(sal_False);
+ bool bActivate(false);
if(pUndoManager)
{
if(pUndoManager->GetRedoActionCount() != 0)
{
- bActivate = sal_True;
+ bActivate = true;
}
}
@@ -217,9 +217,9 @@ SdPage* ViewShell::CreateOrDuplicatePage (
{
sal_uInt16 nSId = rRequest.GetSlot();
SdDrawDocument* pDocument = GetDoc();
- SdrLayerAdmin& rLayerAdmin = pDocument->GetLayerAdmin();
- sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
- sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), sal_False);
+ SdrLayerAdmin& rLayerAdmin = pDocument->GetModelLayerAdmin();
+ sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), false);
+ sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), false);
SetOfByte aVisibleLayers;
// Determine the page from which to copy some values, such as layers,
// size, master page, to the new page. This is usually the given page.
@@ -237,8 +237,8 @@ SdPage* ViewShell::CreateOrDuplicatePage (
String aNotesPageName;
AutoLayout eStandardLayout (AUTOLAYOUT_NONE);
AutoLayout eNotesLayout (AUTOLAYOUT_NOTES);
- sal_Bool bIsPageBack = aVisibleLayers.IsSet(aBckgrnd);
- sal_Bool bIsPageObj = aVisibleLayers.IsSet(aBckgrndObj);
+ bool bIsPageBack = aVisibleLayers.IsSet(aBckgrnd);
+ bool bIsPageObj = aVisibleLayers.IsSet(aBckgrndObj);
// 1. Process the arguments.
const SfxItemSet* pArgs = rRequest.GetArgs();
@@ -267,7 +267,7 @@ SdPage* ViewShell::CreateOrDuplicatePage (
if( eStandardLayout == AUTOLAYOUT_TITLE )
eStandardLayout = AUTOLAYOUT_ENUM;
- SdPage* pNotesTemplatePage = static_cast<SdPage*>(pDocument->GetPage(pTemplatePage->GetPageNum()+1));
+ SdPage* pNotesTemplatePage = static_cast<SdPage*>(pDocument->GetPage(pTemplatePage->GetPageNumber()+1));
if (pNotesTemplatePage != NULL)
eNotesLayout = pNotesTemplatePage->GetAutoLayout();
}
@@ -275,7 +275,7 @@ SdPage* ViewShell::CreateOrDuplicatePage (
else if (pArgs->Count() == 1)
{
pDocument->StopWorkStartupDelay();
- SFX_REQUEST_ARG (rRequest, pLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT, sal_False);
+ SFX_REQUEST_ARG (rRequest, pLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT );
if( pLayout )
{
if (ePageKind == PK_NOTES)
@@ -293,10 +293,10 @@ SdPage* ViewShell::CreateOrDuplicatePage (
// AutoLayouts muessen fertig sein
pDocument->StopWorkStartupDelay();
- SFX_REQUEST_ARG (rRequest, pPageName, SfxStringItem, ID_VAL_PAGENAME, sal_False);
- SFX_REQUEST_ARG (rRequest, pLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT, sal_False);
- SFX_REQUEST_ARG (rRequest, pIsPageBack, SfxBoolItem, ID_VAL_ISPAGEBACK, sal_False);
- SFX_REQUEST_ARG (rRequest, pIsPageObj, SfxBoolItem, ID_VAL_ISPAGEOBJ, sal_False);
+ SFX_REQUEST_ARG (rRequest, pPageName, SfxStringItem, ID_VAL_PAGENAME );
+ SFX_REQUEST_ARG (rRequest, pLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT );
+ SFX_REQUEST_ARG (rRequest, pIsPageBack, SfxBoolItem, ID_VAL_ISPAGEBACK );
+ SFX_REQUEST_ARG (rRequest, pIsPageObj, SfxBoolItem, ID_VAL_ISPAGEOBJ );
if (CHECK_RANGE (AUTOLAYOUT__START, (AutoLayout) pLayout->GetValue (), AUTOLAYOUT__END))
{
@@ -344,7 +344,7 @@ SdPage* ViewShell::CreateOrDuplicatePage (
if( bUndo )
pDrView->BegUndo( String( SdResId(STR_INSERTPAGE) ) );
- sal_uInt16 nNewPageIndex = 0xffff;
+ sal_uInt32 nNewPageIndex = 0xffffffff;
switch (nSId)
{
case SID_INSERTPAGE:
@@ -378,8 +378,8 @@ SdPage* ViewShell::CreateOrDuplicatePage (
bIsPageObj,
nInsertPosition);
// Select exactly the new page.
- sal_uInt16 nPageCount (pDocument->GetSdPageCount(ePageKind));
- for (sal_uInt16 i=0; i<nPageCount; i++)
+ sal_uInt32 nPageCount (pDocument->GetSdPageCount(ePageKind));
+ for (sal_uInt32 i=0; i<nPageCount; i++)
{
pDocument->GetSdPage(i, PK_STANDARD)->SetSelected(
i == nNewPageIndex);
@@ -423,7 +423,7 @@ SdPage* ViewShell::CreateOrDuplicatePage (
// Try to handle another slot id gracefully.
}
SdPage* pNewPage = 0;
- if(nNewPageIndex != 0xffff)
+ if(nNewPageIndex != 0xffffffff)
pNewPage = pDocument->GetSdPage(nNewPageIndex, PK_STANDARD);
if( bUndo )
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index b758d1bbe7bd..0af3edacfd7c 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -133,10 +133,10 @@ namespace sd {
static const int DELTA_ZOOM = 10;
-sal_Bool ViewShell::IsPageFlipMode(void) const
+bool ViewShell::IsPageFlipMode(void) const
{
- return this->ISA(DrawViewShell) && mpContentWindow.get() != NULL &&
- mpContentWindow->GetVisibleHeight() >= 1.0;
+ return dynamic_cast< const DrawViewShell* >(this) && mpContentWindow.get() != NULL &&
+ mpContentWindow->GetVisibleHeightRelativeToView() >= 1.0;
}
SfxViewFrame* ViewShell::GetViewFrame (void) const
@@ -159,8 +159,6 @@ SfxViewFrame* ViewShell::GetViewFrame (void) const
|* SFX-Slotmap und Standardinterface deklarieren
|*
\************************************************************************/
-TYPEINIT1(ViewShell, SfxShell);
-
ViewShell::ViewShell( SfxViewFrame*, ::Window* pParentWindow, ViewShellBase& rViewShellBase, bool bAllowCenter)
: SfxShell(&rViewShellBase)
@@ -199,7 +197,7 @@ void ViewShell::construct(void)
mpView = 0;
mpFrameView = 0;
mpZoomList = 0;
- mbStartShowWithDialog = sal_False;
+ mbStartShowWithDialog = false;
mnPrintedHandoutPageNum = 1;
mnPrintedHandoutPageCount = 0;
mpWindowUpdater.reset( new ::sd::WindowUpdater() );
@@ -232,7 +230,7 @@ void ViewShell::construct(void)
{
// Create scroll bars and the filler between the scroll bars.
mpHorizontalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_HSCROLL | WB_DRAG)));
- mpHorizontalScrollBar->EnableRTL (sal_False);
+ mpHorizontalScrollBar->EnableRTL (false);
mpHorizontalScrollBar->SetRange(Range(0, 32000));
mpHorizontalScrollBar->SetScrollHdl(LINK(this, ViewShell, HScrollHdl));
mpHorizontalScrollBar->Show();
@@ -252,7 +250,7 @@ void ViewShell::construct(void)
String aName( RTL_CONSTASCII_USTRINGPARAM( "ViewShell" ));
SetName (aName);
- GetDoc()->StartOnlineSpelling(sal_False);
+ GetDoc()->StartOnlineSpelling(false);
mpWindowUpdater->SetViewShell (*this);
mpWindowUpdater->SetDocument (GetDoc());
@@ -295,7 +293,7 @@ void ViewShell::Exit (void)
pView->UnmarkAll();
}
- Deactivate (sal_True);
+ Deactivate (true);
if (IsMainViewShell())
{
@@ -325,14 +323,14 @@ void ViewShell::Activate(sal_Bool bIsMDIActivate)
//GetViewFrame()->GetWindow().GrabFocus();
if (mpHorizontalRuler.get() != NULL)
- mpHorizontalRuler->SetActive(sal_True);
+ mpHorizontalRuler->SetActive(true);
if (mpVerticalRuler.get() != NULL)
- mpVerticalRuler->SetActive(sal_True);
+ mpVerticalRuler->SetActive(true);
if (bIsMDIActivate)
{
// Damit der Navigator auch einen aktuellen Status bekommt
- SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True );
+ SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
if (GetDispatcher() != NULL)
GetDispatcher()->Execute(
SID_NAVIGATOR_INIT,
@@ -343,7 +341,7 @@ void ViewShell::Activate(sal_Bool bIsMDIActivate)
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=NULL);
SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
- rBindings.Invalidate( SID_3D_STATE, sal_True, sal_False );
+ rBindings.Invalidate( SID_3D_STATE, true, false );
rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );
if(xSlideShow.is() && xSlideShow->isRunning() )
@@ -356,14 +354,7 @@ void ViewShell::Activate(sal_Bool bIsMDIActivate)
}
if(!GetDocSh()->IsUIActive())
- UpdatePreview( GetActualPage(), sal_True );
-
- //HMH::sd::View* pView = GetView();
-
- //HMHif (pView)
- //HMH{
- //HMH pView->ShowMarkHdl();
- //HMH}
+ UpdatePreview( GetActualPage(), true );
}
ReadFrameViewData( mpFrameView );
@@ -424,9 +415,9 @@ void ViewShell::Deactivate(sal_Bool bIsMDIActivate)
}
if (mpHorizontalRuler.get() != NULL)
- mpHorizontalRuler->SetActive(sal_False);
+ mpHorizontalRuler->SetActive(false);
if (mpVerticalRuler.get() != NULL)
- mpVerticalRuler->SetActive(sal_False);
+ mpVerticalRuler->SetActive(false);
SfxShell::Deactivate(bIsMDIActivate);
}
@@ -448,9 +439,9 @@ void ViewShell::Shutdown (void)
|*
\************************************************************************/
-sal_Bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
+bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
{
- sal_Bool bReturn(sal_False);
+ bool bReturn(false);
if(pWin)
{
@@ -463,7 +454,7 @@ sal_Bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
// give key input first to SfxViewShell to give CTRL+Key
// (e.g. CTRL+SHIFT+'+', to front) priority.
OSL_ASSERT (GetViewShell()!=NULL);
- bReturn = (sal_Bool)GetViewShell()->KeyInput(rKEvt);
+ bReturn = GetViewShell()->KeyInput(rKEvt);
}
if(!bReturn)
@@ -490,7 +481,7 @@ sal_Bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
}
else
{
- bReturn = sal_True;
+ bReturn = true;
}
}
}
@@ -504,7 +495,7 @@ sal_Bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin)
&& aKeyCode.GetCode() == KEY_R)
{
InvalidateWindows();
- bReturn = sal_True;
+ bReturn = true;
}
}
@@ -641,7 +632,7 @@ void ViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin)
void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
{
- sal_Bool bDone = HandleScrollCommand (rCEvt, pWin);
+ bool bDone = HandleScrollCommand (rCEvt, pWin);
if( !bDone )
{
@@ -670,7 +661,7 @@ void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
long ViewShell::Notify(NotifyEvent& rNEvt, ::sd::Window* pWin)
{
// handle scroll commands when they arrived at child windows
- long nRet = sal_False;
+ long nRet = false;
if( rNEvt.GetType() == EVENT_COMMAND )
{
// note: dynamic_cast is not possible as GetData() returns a void*
@@ -777,17 +768,17 @@ void ViewShell::SetupRulers (void)
if ( mpVerticalRuler.get() != NULL )
{
nHRulerOfs = mpVerticalRuler->GetSizePixel().Width();
- mpVerticalRuler->SetActive(sal_True);
+ mpVerticalRuler->SetActive(true);
mpVerticalRuler->Show();
}
}
if ( mpHorizontalRuler.get() == NULL )
{
- mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow(), sal_True));
+ mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow(), true));
if ( mpHorizontalRuler.get() != NULL )
{
mpHorizontalRuler->SetWinPos(nHRulerOfs);
- mpHorizontalRuler->SetActive(sal_True);
+ mpHorizontalRuler->SetActive(true);
mpHorizontalRuler->Show();
}
}
@@ -797,7 +788,7 @@ void ViewShell::SetupRulers (void)
-sal_Bool ViewShell::HasRuler (void)
+bool ViewShell::HasRuler (void)
{
return mbHasRulers;
}
@@ -818,26 +809,11 @@ void ViewShell::Resize (void)
return;
// Remember the new position and size.
- maViewPos = Point(0,0); //mpParentWindow->GetPosPixel();
+ maViewPos = Point(0,0);
maViewSize = aSize;
// Rearrange the UI elements to take care of the new position and size.
ArrangeGUIElements ();
- // end of included AdjustPosSizePixel.
-
- Size aS (GetParentWindow()->GetOutputSizePixel());
- Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
- Rectangle aVisArea = GetParentWindow()->PixelToLogic(
- Rectangle( Point(0,0), aVisSizePixel));
- Rectangle aCurrentVisArea (GetDocSh()->GetVisArea(ASPECT_CONTENT));
- Rectangle aWindowRect = GetActiveWindow()->LogicToPixel(aCurrentVisArea);
- if (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
- && IsMainViewShell())
- {
- // GetDocSh()->SetVisArea(aVisArea);
- }
-
- // VisAreaChanged(aVisArea);
::sd::View* pView = GetView();
@@ -1016,9 +992,9 @@ void ViewShell::SetDefTabHRuler( sal_uInt16 nDefTab )
/** Tell the FmFormShell that the view shell is closing. Give it the
oportunity to prevent that.
*/
-sal_uInt16 ViewShell::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
+sal_uInt16 ViewShell::PrepareClose (bool bUI, bool bForBrowsing)
{
- sal_uInt16 nResult = sal_True;
+ sal_uInt16 nResult = true;
FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
if (pFormShell != NULL)
@@ -1030,7 +1006,7 @@ sal_uInt16 ViewShell::PrepareClose (sal_Bool bUI, sal_Bool bForBrowsing)
-void ViewShell::UpdatePreview (SdPage*, sal_Bool )
+void ViewShell::UpdatePreview (SdPage*, bool )
{
// Do nothing. After the actual preview has been removed,
// OutlineViewShell::UpdatePreview() is the place where something
@@ -1146,7 +1122,7 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
// -----------------------------------------------------------------------------
-void ViewShell::ImpSidUndo(sal_Bool, SfxRequest& rReq)
+void ViewShell::ImpSidUndo(bool, SfxRequest& rReq)
{
::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
sal_uInt16 nNumber(1);
@@ -1195,7 +1171,7 @@ void ViewShell::ImpSidUndo(sal_Bool, SfxRequest& rReq)
// -----------------------------------------------------------------------------
-void ViewShell::ImpSidRedo(sal_Bool, SfxRequest& rReq)
+void ViewShell::ImpSidRedo(bool, SfxRequest& rReq)
{
::svl::IUndoManager* pUndoManager = ImpGetUndoManager();
sal_uInt16 nNumber(1);
@@ -1255,7 +1231,7 @@ void ViewShell::ExecReq( SfxRequest& rReq )
if( xFunc.is() )
{
xFunc->ScrollStart();
- ScrollLines( 0, -1 );
+ ScrollLines(basegfx::B2DVector(0.0, -1.0));
xFunc->ScrollEnd();
}
@@ -1268,14 +1244,14 @@ void ViewShell::ExecReq( SfxRequest& rReq )
case SID_OUTPUT_QUALITY_BLACKWHITE:
case SID_OUTPUT_QUALITY_CONTRAST:
{
- sal_uLong nMode = OUTPUT_DRAWMODE_COLOR;
+ sal_uLong nMode = SD_OUTPUT_DRAWMODE_COLOR;
switch( nSlot )
{
- case SID_OUTPUT_QUALITY_COLOR: nMode = OUTPUT_DRAWMODE_COLOR; break;
- case SID_OUTPUT_QUALITY_GRAYSCALE: nMode = OUTPUT_DRAWMODE_GRAYSCALE; break;
- case SID_OUTPUT_QUALITY_BLACKWHITE: nMode = OUTPUT_DRAWMODE_BLACKWHITE; break;
- case SID_OUTPUT_QUALITY_CONTRAST: nMode = OUTPUT_DRAWMODE_CONTRAST; break;
+ case SID_OUTPUT_QUALITY_COLOR: nMode = SD_OUTPUT_DRAWMODE_COLOR; break;
+ case SID_OUTPUT_QUALITY_GRAYSCALE: nMode = SD_OUTPUT_DRAWMODE_GRAYSCALE; break;
+ case SID_OUTPUT_QUALITY_BLACKWHITE: nMode = SD_OUTPUT_DRAWMODE_BLACKWHITE; break;
+ case SID_OUTPUT_QUALITY_CONTRAST: nMode = SD_OUTPUT_DRAWMODE_CONTRAST; break;
}
GetActiveWindow()->SetDrawMode( nMode );
@@ -1584,7 +1560,7 @@ SfxShell* ViewShellObjectBarFactory::CreateShell (
case RID_DRAW_TEXT_TOOLBOX:
pShell = new ::sd::TextObjectBar(
- &mrViewShell, mrViewShell.GetDoc()->GetPool(), pView);
+ &mrViewShell, mrViewShell.GetDoc()->GetItemPool(), pView);
break;
case RID_DRAW_GRAF_TOOLBOX:
diff --git a/sd/source/ui/view/zoomlist.cxx b/sd/source/ui/view/zoomlist.cxx
index 395a61448f25..d841dec39bda 100644
--- a/sd/source/ui/view/zoomlist.cxx
+++ b/sd/source/ui/view/zoomlist.cxx
@@ -71,7 +71,7 @@ ZoomList::~ZoomList()
#endif
{
// Ggf. ZoomRects loeschen
- delete ((Rectangle*) GetObject(nObject));
+ delete ((basegfx::B2DRange*) GetObject(nObject));
}
}
@@ -82,16 +82,16 @@ ZoomList::~ZoomList()
|*
\************************************************************************/
-void ZoomList::InsertZoomRect(const Rectangle& rRect)
+void ZoomList::InsertZoomRange(const basegfx::B2DRange& rRange)
{
- sal_uLong nRectCount = Count();
+ const sal_uInt32 nRangeCount(Count());
- if (nRectCount >= MAX_ENTRYS)
+ if (nRangeCount >= MAX_ENTRYS)
{
- delete ((Rectangle*) GetObject(0));
- Remove((sal_uLong) 0);
+ delete ((basegfx::B2DRange*) GetObject(0));
+ Remove((sal_uIntPtr) 0);
}
- else if (nRectCount == 0)
+ else if (nRangeCount == 0)
{
mnCurPos = 0;
}
@@ -100,8 +100,8 @@ void ZoomList::InsertZoomRect(const Rectangle& rRect)
mnCurPos++;
}
- Rectangle* pRect = new Rectangle(rRect);
- Insert(pRect, mnCurPos);
+ basegfx::B2DRange* pRange = new basegfx::B2DRange(rRange);
+ Insert(pRange, mnCurPos);
SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_ZOOM_NEXT );
@@ -114,22 +114,22 @@ void ZoomList::InsertZoomRect(const Rectangle& rRect)
|*
\************************************************************************/
-Rectangle ZoomList::GetNextZoomRect()
+basegfx::B2DRange ZoomList::GetNextZoomRange()
{
mnCurPos++;
- sal_uLong nRectCount = Count();
+ const sal_uInt32 nRangeCount(Count());
- if (nRectCount > 0 && mnCurPos > nRectCount - 1)
+ if (nRangeCount > 0 && mnCurPos > nRangeCount - 1)
{
- mnCurPos = nRectCount - 1;
+ mnCurPos = nRangeCount - 1;
}
SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_ZOOM_NEXT );
rBindings.Invalidate( SID_ZOOM_PREV );
- Rectangle aRect(*(Rectangle*) GetObject(mnCurPos));
- return (aRect);
+ basegfx::B2DRange aRange(*(basegfx::B2DRange*)GetObject(mnCurPos));
+ return aRange;
}
/*************************************************************************
@@ -138,7 +138,7 @@ Rectangle ZoomList::GetNextZoomRect()
|*
\************************************************************************/
-Rectangle ZoomList::GetPreviousZoomRect()
+basegfx::B2DRange ZoomList::GetPreviousZoomRange()
{
if (mnCurPos > 0)
{
@@ -149,8 +149,8 @@ Rectangle ZoomList::GetPreviousZoomRect()
rBindings.Invalidate( SID_ZOOM_NEXT );
rBindings.Invalidate( SID_ZOOM_PREV );
- Rectangle aRect(*(Rectangle*) GetObject(mnCurPos));
- return (aRect);
+ basegfx::B2DRange aRange(*(basegfx::B2DRange*) GetObject(mnCurPos));
+ return aRange;
}
/*************************************************************************
@@ -159,17 +159,17 @@ Rectangle ZoomList::GetPreviousZoomRect()
|*
\************************************************************************/
-sal_Bool ZoomList::IsNextPossible() const
+bool ZoomList::IsNextPossible() const
{
- sal_Bool bPossible = sal_False;
- sal_uLong nRectCount = Count();
+ bool bPossible = false;
+ const sal_uInt32 nRangeCount(Count());
- if (nRectCount > 0 && mnCurPos < nRectCount - 1)
+ if (nRangeCount > 0 && mnCurPos < nRangeCount - 1)
{
- bPossible = sal_True;
+ bPossible = true;
}
- return (bPossible);
+ return bPossible;
}
/*************************************************************************
@@ -178,13 +178,13 @@ sal_Bool ZoomList::IsNextPossible() const
|*
\************************************************************************/
-sal_Bool ZoomList::IsPreviousPossible() const
+bool ZoomList::IsPreviousPossible() const
{
- sal_Bool bPossible = sal_False;
+ bool bPossible = false;
if (mnCurPos > 0)
{
- bPossible = sal_True;
+ bPossible = true;
}
return (bPossible);
diff --git a/sd/util/makefile.mk b/sd/util/makefile.mk
index c625fef4b683..2c16518efe4f 100644
--- a/sd/util/makefile.mk
+++ b/sd/util/makefile.mk
@@ -246,6 +246,7 @@ DEF5NAME=$(SHL5TARGET)
SHL5STDLIBS = $(ISDLIB) \
$(EDITENGLIB) \
+ $(BASEGFXLIB) \
$(SVXCORELIB) \
$(MSFILTERLIB) \
$(SFX2LIB) \
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index bdeecc3d1244..8a8243459a3d 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -578,7 +578,7 @@ void PDFIProcessor::setupImage(ImageId nImage)
// try to create a Transformation that corrects for the wrong rotation
aTrans.identity();
- aTrans.scale( aScale.getX(), aScale.getY() );
+ aTrans.scale( aScale );
aTrans.rotate( -fRotate );
basegfx::B2DRange aRect( 0, 0, 1, 1 );
@@ -602,8 +602,7 @@ void PDFIProcessor::setupImage(ImageId nImage)
if( nQuadrant == 3 )
aTranslation.setX( aTranslation.getX() - aRect.getHeight() );
- aTrans.translate( aTranslation.getX(),
- aTranslation.getY() );
+ aTrans.translate( aTranslation );
}
bool bMirrorVertical = aScale.getY() > 0;
@@ -1008,40 +1007,40 @@ void PDFIProcessor::sortElements( Element* pEle, bool bDeep )
::basegfx::B2DRange& PDFIProcessor::calcTransformedRectBounds( ::basegfx::B2DRange& outRect,
const ::basegfx::B2DRange& inRect,
const ::basegfx::B2DHomMatrix& transformation )
- {
- outRect.reset();
+{
+ outRect.reset();
- if( inRect.isEmpty() )
- return outRect;
+ if( inRect.isEmpty() )
+ return outRect;
- // transform all four extremal points of the rectangle,
- // take bounding rect of those.
+ // transform all four extremal points of the rectangle,
+ // take bounding rect of those.
- // transform left-top point
- outRect.expand( transformation * inRect.getMinimum() );
+ // transform left-top point
+ outRect.expand( transformation * inRect.getMinimum() );
- // transform bottom-right point
- outRect.expand( transformation * inRect.getMaximum() );
+ // transform bottom-right point
+ outRect.expand( transformation * inRect.getMaximum() );
- ::basegfx::B2DPoint aPoint;
+ ::basegfx::B2DPoint aPoint;
- // transform top-right point
- aPoint.setX( inRect.getMaxX() );
- aPoint.setY( inRect.getMinY() );
+ // transform top-right point
+ aPoint.setX( inRect.getMaxX() );
+ aPoint.setY( inRect.getMinY() );
- aPoint *= transformation;
- outRect.expand( aPoint );
+ aPoint *= transformation;
+ outRect.expand( aPoint );
- // transform bottom-left point
- aPoint.setX( inRect.getMinX() );
- aPoint.setY( inRect.getMaxY() );
+ // transform bottom-left point
+ aPoint.setX( inRect.getMinX() );
+ aPoint.setY( inRect.getMaxY() );
- aPoint *= transformation;
- outRect.expand( aPoint );
+ aPoint *= transformation;
+ outRect.expand( aPoint );
- // over and out.
- return outRect;
- }
+ // over and out.
+ return outRect;
+}
// helper method: get a mirrored string
rtl::OUString PDFIProcessor::mirrorString( const rtl::OUString& i_rString )
diff --git a/sfx2/inc/msgnodei.hxx b/sfx2/inc/msgnodei.hxx
index 2df1af23f1b8..b459e28b73ca 100644
--- a/sfx2/inc/msgnodei.hxx
+++ b/sfx2/inc/msgnodei.hxx
@@ -98,8 +98,6 @@ class SfxMsgReceiverListItem : public SfxPoolItem
protected:
SfxMsgReceiverList_Impl* pImp;
public:
- TYPEINFO();
-
SfxMsgReceiverListItem();
SfxMsgReceiverListItem( sal_uInt16 nWhich );
SfxMsgReceiverListItem( sal_uInt16 nWhich, SvStream& rStream );
@@ -151,8 +149,6 @@ protected:
SfxMsgAttachFileList_Impl* pImp;
void Disconnect();
public:
- TYPEINFO();
-
SfxMsgAttachFileListItem();
SfxMsgAttachFileListItem( sal_uInt16 nWhich );
SfxMsgAttachFileListItem( sal_uInt16 nWhich, SvStream& rStream );
@@ -190,8 +186,6 @@ enum SfxMsgPriority
class SfxMsgPriorityItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
SfxMsgPriorityItem( sal_uInt16 nWhich, SfxMsgPriority = MSG_PRIORITY_NORMAL);
virtual SfxPoolItem* Clone( SfxItemPool* pPool=0 ) const;
diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx
index 9d2564c2af56..ffc5cfb39dae 100644
--- a/sfx2/inc/pch/precompiled_sfx2.hxx
+++ b/sfx2/inc/pch/precompiled_sfx2.hxx
@@ -599,7 +599,6 @@
#include "tools/ref.hxx"
#include "tools/resary.hxx"
#include "tools/resid.hxx"
-#include "tools/rtti.hxx"
#include "tools/shl.hxx"
#include "tools/simplerm.hxx"
#include "tools/solar.h"
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 3dc1e914050f..9f5dc20fe8f5 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -172,7 +172,6 @@ class SFX2_DLLPUBLIC SfxApplication: public SfxShell
void Deinitialize();
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXAPP)
SfxApplication();
diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index 4d6e41fbd608..de1b7e4bc25f 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -138,7 +138,7 @@ public:
~SfxBindings();
void HidePopups( bool bHide = true );
- SAL_DLLPRIVATE void HidePopupCtrls_Impl( int bHide = sal_True );
+ SAL_DLLPRIVATE void HidePopupCtrls_Impl( bool bHide = true );
void SetDispatcher(SfxDispatcher *pDisp);
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index 88dc957f3448..2591bcd408e2 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -79,7 +79,6 @@ private:
std::vector< CustomProperty* > m_aCustomProperties;
public:
- TYPEINFO();
SfxDocumentInfoItem();
SfxDocumentInfoItem( const String &rFileName,
const ::com::sun::star::uno::Reference<
diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx
index b9c312dfa37a..3cc9133831b4 100644
--- a/sfx2/inc/sfx2/docfac.hxx
+++ b/sfx2/inc/sfx2/docfac.hxx
@@ -27,7 +27,6 @@
#include "sfx2/dllapi.h"
#include <sal/types.h>
#include <tools/solar.h>
-#include <tools/rtti.hxx>
// SFX_IMPL_MODULE_LIB
#include <vos/module.hxx>
diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx
index 9ff14f8b8c2d..c76fc08680cb 100644
--- a/sfx2/inc/sfx2/event.hxx
+++ b/sfx2/inc/sfx2/event.hxx
@@ -45,7 +45,6 @@ class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
sal_uInt16 nEventId;
public:
- TYPEINFO();
SfxEventHint( sal_uInt16 nId, const ::rtl::OUString& aName, SfxObjectShell *pObj = 0 )
: pObjShell(pObj),
aEventName(aName),
@@ -69,8 +68,6 @@ class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > xViewController;
public:
- TYPEINFO();
-
SfxViewEventHint( sal_uInt16 nId, const ::rtl::OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
: SfxEventHint( nId, aName, pObj )
, xViewController( xController, ::com::sun::star::uno::UNO_QUERY )
@@ -94,8 +91,6 @@ class SfxNamedHint : public SfxHint
String _aArgs;
public:
- TYPEINFO();
-
SfxNamedHint( const String& rName,
const String& rArgs,
SfxObjectShell *pObj = 0 )
@@ -121,7 +116,6 @@ class SfxPrintingHint : public SfxHint
sal_Int32 nWhich;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aOpts;
public:
- TYPEINFO();
SfxPrintingHint( sal_Int32 nEvent, const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
: nWhich( nEvent )
, aOpts( rOpts )
@@ -132,7 +126,7 @@ public:
{}
sal_Int32 GetWhich() const { return nWhich; }
- const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& GetOptions() { return aOpts; }
+ const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& GetOptions() const { return aOpts; }
};
#endif
diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx
index 9ff11e2002a8..44b6a547aad2 100644
--- a/sfx2/inc/sfx2/evntconf.hxx
+++ b/sfx2/inc/sfx2/evntconf.hxx
@@ -26,7 +26,6 @@
#include "sal/config.h"
#include "sfx2/dllapi.h"
#include "sal/types.h"
-#include <tools/rtti.hxx>
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
@@ -77,8 +76,6 @@ class SFX2_DLLPUBLIC SfxEventNamesItem : public SfxPoolItem
SfxEventNamesList aEventsList;
public:
- TYPEINFO();
-
SfxEventNamesItem ( const sal_uInt16 nId ) : SfxPoolItem( nId ) {}
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx
index a756274f87ea..23a5231bcc15 100644
--- a/sfx2/inc/sfx2/frame.hxx
+++ b/sfx2/inc/sfx2/frame.hxx
@@ -129,8 +129,6 @@ protected:
SAL_DLLPRIVATE SfxFrame( Window& i_rContainerWindow, bool bHidden );
public:
- TYPEINFO();
-
static SfxFrame* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
CreateBlankFrame();
@@ -253,8 +251,7 @@ class SFX2_DLLPUBLIC SfxFrameItem: public SfxPoolItem
SAL_DLLPRIVATE void SetFramePtr_Impl( SfxFrame* /*pFrameP*/ ) { pFrame = wFrame; }
public:
- TYPEINFO();
-
+// POOLITEM_FACTORY()
SfxFrameItem( sal_uInt16 nWhich, SfxViewFrame *p );
SfxFrameItem( SfxFrame *p=0 );
SfxFrameItem( sal_uInt16 nWhich, SfxFrame *p );
@@ -276,7 +273,8 @@ class SFX2_DLLPUBLIC SfxUsrAnyItem : public SfxPoolItem
{
::com::sun::star::uno::Any aValue;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
+ SfxUsrAnyItem() : SfxPoolItem(0) {}
SfxUsrAnyItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Any& rAny );
::com::sun::star::uno::Any GetValue() const
{ return aValue; }
@@ -292,7 +290,7 @@ class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem
m_xFrame;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxUnoFrameItem();
SfxUnoFrameItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame );
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
diff --git a/sfx2/inc/sfx2/frmdescr.hxx b/sfx2/inc/sfx2/frmdescr.hxx
index 78de8bbc0d47..ed3f4cfbf3a5 100644
--- a/sfx2/inc/sfx2/frmdescr.hxx
+++ b/sfx2/inc/sfx2/frmdescr.hxx
@@ -248,8 +248,6 @@ class SfxFrameDescriptorItem : public SfxPoolItem
{
SfxFrameProperties aProperties;
public:
- TYPEINFO();
-
SfxFrameDescriptorItem ( const SfxFrameDescriptor *pD, const sal_uInt16 nId = SID_FRAMEDESCRIPTOR )
: SfxPoolItem( nId )
, aProperties( pD )
diff --git a/sfx2/inc/sfx2/linksrc.hxx b/sfx2/inc/sfx2/linksrc.hxx
index 575f8a7385f1..80fb87290bce 100644
--- a/sfx2/inc/sfx2/linksrc.hxx
+++ b/sfx2/inc/sfx2/linksrc.hxx
@@ -29,7 +29,6 @@
#ifndef _TOOLS_REF_HXX
#include <tools/ref.hxx>
#endif
-#include <tools/rtti.hxx>
#include <com/sun/star/io/XInputStream.hpp>
#ifndef _SAL_CONFIG_H
@@ -65,8 +64,6 @@ private:
SvLinkSource_Impl* pImpl; // compatible area
public:
- TYPEINFO();
-
SvLinkSource();
virtual ~SvLinkSource();
diff --git a/sfx2/inc/sfx2/lnkbase.hxx b/sfx2/inc/sfx2/lnkbase.hxx
index 39fec18b60c1..f8bde071ebc7 100644
--- a/sfx2/inc/sfx2/lnkbase.hxx
+++ b/sfx2/inc/sfx2/lnkbase.hxx
@@ -119,7 +119,6 @@ protected:
}
public:
- TYPEINFO();
// ask JP
virtual void Closed();
SvBaseLink( const String& rNm, sal_uInt16 nObjectType,
diff --git a/sfx2/inc/sfx2/minfitem.hxx b/sfx2/inc/sfx2/minfitem.hxx
index 8970a0510aa0..1c4ef66b9c3f 100644
--- a/sfx2/inc/sfx2/minfitem.hxx
+++ b/sfx2/inc/sfx2/minfitem.hxx
@@ -38,7 +38,9 @@ class SFX2_DLLPUBLIC SfxMacroInfoItem: public SfxPoolItem
String aCommentText;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
+
+ SfxMacroInfoItem() : SfxPoolItem( 0 ), pBasicManager(0) {}
SfxMacroInfoItem( sal_uInt16 nWhich,
const BasicManager* pMgr,
const String &rLibName,
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx
index 9f1dd706e74c..d0edb6ab27a9 100644
--- a/sfx2/inc/sfx2/mnuitem.hxx
+++ b/sfx2/inc/sfx2/mnuitem.hxx
@@ -36,6 +36,7 @@ class SfxUnoControllerItem;
struct SfxMenuCtrlFactory;
#include <tools/string.hxx>
#include <sfx2/ctrlitem.hxx>
+#include <typeinfo>
class SFX2_DLLPUBLIC SfxMenuControl: public SfxControllerItem
{
@@ -111,13 +112,13 @@ typedef SfxMenuControl* (*SfxMenuControlCtor)( sal_uInt16 nId, Menu &, SfxBindin
struct SfxMenuCtrlFactory
{
SfxMenuControlCtor pCtor;
- TypeId nTypeId;
+ const std::type_info& rTypeInfo;
sal_uInt16 nSlotId;
SfxMenuCtrlFactory( SfxMenuControlCtor pTheCtor,
- TypeId nTheTypeId, sal_uInt16 nTheSlotId ):
+ const std::type_info& rTheType, sal_uInt16 nTheSlotId ):
pCtor(pTheCtor),
- nTypeId(nTheTypeId),
+ rTypeInfo(rTheType),
nSlotId(nTheSlotId)
{}
};
@@ -147,7 +148,7 @@ inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const
{ return new Class(nId, rMenu, rBindings); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \
- Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+ Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
//#if 0 // _SOLAR__PRIVATE
diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx
index 32e58604ebee..8f7025b0d813 100644
--- a/sfx2/inc/sfx2/module.hxx
+++ b/sfx2/inc/sfx2/module.hxx
@@ -70,7 +70,6 @@ private:
//#endif
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXMODULE)
SfxModule( ResMgr* pMgrP, sal_Bool bDummy,
diff --git a/sfx2/inc/sfx2/msg.hxx b/sfx2/inc/sfx2/msg.hxx
index 1cb0d006efa1..57c3b1f10891 100644
--- a/sfx2/inc/sfx2/msg.hxx
+++ b/sfx2/inc/sfx2/msg.hxx
@@ -23,8 +23,8 @@
#ifndef _SFXMSG_HXX
#define _SFXMSG_HXX
-#include <tools/rtti.hxx>
#include <sfx2/shell.hxx>
+#include <typeinfo>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include <sfx2/dllapi.h>
@@ -111,32 +111,41 @@ struct SfxTypeAttrib
const char __FAR_DATA* pName;
};
+typedef bool (*ConvertToSlotType)( const SfxPoolItem* );
+typedef SfxPoolItem* (*CreatePoolItem)();
+
struct SfxType
{
- TypeId aTypeId;
+ CreatePoolItem aCreateFunc;
+ ConvertToSlotType aConvertFunc;
+ const std::type_info* pType;
sal_uInt16 nAttribs;
SfxTypeAttrib aAttrib[16];
- const TypeId& Type() const
- { return aTypeId; }
- SfxPoolItem* CreateItem() const
- { return (SfxPoolItem*) aTypeId(); }
+ const std::type_info& Type() const { return *pType; }
+ SfxPoolItem* CreateItem() const { return aCreateFunc(); }
+
+ bool IsSlotType(const SfxPoolItem* pItem) const { return aConvertFunc(pItem); }
};
struct SfxType0
{
- TypeId aTypeId;
+ CreatePoolItem aCreateFunc;
+ ConvertToSlotType aConvertFunc;
+ const std::type_info* pType;
sal_uInt16 nAttribs;
- const TypeId& Type() const
- { return aTypeId; }
- SfxPoolItem* CreateItem() const
- { return (SfxPoolItem*) aTypeId(); }
+ const std::type_info& Type() const { return *pType; }
+ SfxPoolItem* CreateItem() const { return aCreateFunc(); }
+
+ bool IsSlotType(const SfxPoolItem* pItem) const { return aConvertFunc(pItem); }
};
#define SFX_DECL_TYPE(n) struct SfxType##n \
{ \
- TypeId aTypeId; \
+ CreatePoolItem aCreate; \
+ ConvertToSlotType aConvert; \
+ const std::type_info* pType; \
sal_uInt16 nAttribs; \
SfxTypeAttrib aAttrib[n]; \
}
@@ -238,10 +247,7 @@ struct SfxFormalArgument
const char __FAR_DATA* pName; // Name des Parameters
sal_uInt16 nSlotId;// Slot-Id zur Identifikation des Parameters
- const TypeId& Type() const
- { return pType->aTypeId; }
- SfxPoolItem* CreateItem() const
- { return (SfxPoolItem*) pType->aTypeId(); }
+ SfxPoolItem* CreateItem() const { return pType->CreateItem(); }
};
//--------------------------------------------------------------------
diff --git a/sfx2/inc/sfx2/msgpool.hxx b/sfx2/inc/sfx2/msgpool.hxx
index 9d37c2746a1e..84ee5949a0c6 100644
--- a/sfx2/inc/sfx2/msgpool.hxx
+++ b/sfx2/inc/sfx2/msgpool.hxx
@@ -73,7 +73,8 @@ public:
const SfxSlot* GetSlot( sal_uInt16 nId );
const SfxSlot* GetUnoSlot( sal_uInt16 nId );
const SfxSlot* GetUnoSlot( const String& rUnoName );
- TypeId GetSlotType( sal_uInt16 nSlotId ) const;
+
+ const std::type_info& GetSlotType( sal_uInt16 nSlotId ) const;
};
//--------------------------------------------------------------------
diff --git a/sfx2/inc/sfx2/objitem.hxx b/sfx2/inc/sfx2/objitem.hxx
index ee5979ad4f17..39b2b069227b 100644
--- a/sfx2/inc/sfx2/objitem.hxx
+++ b/sfx2/inc/sfx2/objitem.hxx
@@ -36,7 +36,7 @@ class SFX2_DLLPUBLIC SfxObjectItem: public SfxPoolItem
SfxShell* _pSh;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxObjectItem( sal_uInt16 nWhich=0, SfxShell *pSh=0 );
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 33ecaf877ee7..cda7eb3ae561 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -188,6 +188,16 @@ in fremde Objekte integriert werden k"onnen.
class SfxToolBoxConfig;
struct TransferableObjectDescriptor;
+// -----------------------------------------------------------------------
+
+typedef bool (*ConvertToObjectShell)( const SfxObjectShell* );
+template<class T> bool _IsObjectShell(const SfxObjectShell* pShell)
+{
+ return 0 != dynamic_cast< const T* >(pShell);
+}
+
+// -----------------------------------------------------------------------
+
class SFX2_DLLPUBLIC SfxObjectShell :
public SfxShell, virtual public SotObject,
public ::comphelper::IEmbeddedHelper, public ::sfx2::IXmlIdRegistrySupplier
@@ -234,7 +244,6 @@ protected:
virtual void DoFlushDocInfo();
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXDOCSH)
static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
@@ -246,11 +255,8 @@ public:
using SotObject::GetInterface;
// Document-Shell Iterator
- static SfxObjectShell* GetFirst( const TypeId* pType = 0,
- sal_Bool bOnlyVisible = sal_True );
- static SfxObjectShell* GetNext( const SfxObjectShell& rPrev,
- const TypeId* pType = 0,
- sal_Bool bOnlyVisible = sal_True );
+ static SfxObjectShell* GetFirst( ConvertToObjectShell = 0, sal_Bool bOnlyVisible = sal_True );
+ static SfxObjectShell* GetNext( const SfxObjectShell& rPrev, ConvertToObjectShell = 0, sal_Bool bOnlyVisible = sal_True );
static SfxObjectShell* Current();
static sal_uInt16 Count();
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
@@ -825,7 +831,7 @@ class SFX2_DLLPUBLIC SfxObjectShellItem: public SfxPoolItem
SfxObjectShell* pObjSh;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxObjectShellItem() :
SfxPoolItem( 0 ),
pObjSh( 0 )
diff --git a/sfx2/inc/sfx2/prnmon.hxx b/sfx2/inc/sfx2/prnmon.hxx
index 9fd2c9495ea8..162f58a427a8 100644
--- a/sfx2/inc/sfx2/prnmon.hxx
+++ b/sfx2/inc/sfx2/prnmon.hxx
@@ -53,7 +53,7 @@ private:
//#endif
public:
SfxPrintProgress( SfxViewShell* pViewSh,
- FASTBOOL bShow = sal_True );
+ bool bShow = sal_True );
virtual ~SfxPrintProgress();
virtual void SetText( const String &rText );
diff --git a/sfx2/inc/sfx2/progress.hxx b/sfx2/inc/sfx2/progress.hxx
index a7e99d4b1165..55c28ef201b2 100644
--- a/sfx2/inc/sfx2/progress.hxx
+++ b/sfx2/inc/sfx2/progress.hxx
@@ -78,7 +78,7 @@ public:
//#if 0 // _SOLAR__PRIVATE
DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus* );
DECL_DLLPRIVATE_STATIC_LINK( SfxProgress, DefaultBindingProgress, SvProgressArg* );
- SAL_DLLPRIVATE FASTBOOL StatusBarManagerGone_Impl(SfxStatusBarManager*pStb);
+ SAL_DLLPRIVATE bool StatusBarManagerGone_Impl(SfxStatusBarManager*pStb);
SAL_DLLPRIVATE const String& GetStateText_Impl() const;
//#endif
};
diff --git a/sfx2/inc/sfx2/request.hxx b/sfx2/inc/sfx2/request.hxx
index becc23d75381..2d5a74320c51 100644
--- a/sfx2/inc/sfx2/request.hxx
+++ b/sfx2/inc/sfx2/request.hxx
@@ -89,10 +89,8 @@ public:
void AppendItem(const SfxPoolItem &);
void RemoveItem( sal_uInt16 nSlotId );
- static const SfxPoolItem* GetItem( const SfxItemSet*, sal_uInt16 nSlotId,
- bool bDeep = false,
- TypeId aType = 0 );
- const SfxPoolItem* GetArg( sal_uInt16 nSlotId, bool bDeep = false, TypeId aType = 0 ) const;
+ static const SfxPoolItem* GetItem( const SfxItemSet*, sal_uInt16 nSlotId );
+ const SfxPoolItem* GetArg( sal_uInt16 nSlotId ) const;
void ReleaseArgs();
void SetReturnValue(const SfxPoolItem &);
const SfxPoolItem* GetReturnValue() const;
@@ -125,11 +123,12 @@ private:
//------------------------------------------------------------------------
-#define SFX_REQUEST_ARG(rReq, pItem, ItemType, nSlotId, bDeep) \
- const ItemType *pItem = (const ItemType*) \
- rReq.GetArg( nSlotId, bDeep, TYPE(ItemType) )
-#define SFX_ITEMSET_ARG(pArgs, pItem, ItemType, nSlotId, bDeep) \
- const ItemType *pItem = (const ItemType*) \
- SfxRequest::GetItem( pArgs, nSlotId, bDeep, TYPE(ItemType) )
+#define SFX_REQUEST_ARG(rReq, pItem, ItemType, nSlotId) \
+ const ItemType *pItem = dynamic_cast<const ItemType*>( \
+ rReq.GetArg( nSlotId ))
+
+#define SFX_ITEMSET_ARG(pArgs, pItem, ItemType, nSlotId) \
+ const ItemType *pItem = dynamic_cast<const ItemType*>( \
+ SfxRequest::GetItem( pArgs, nSlotId ))
#endif
diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx
index 90f6db0d2e28..14333be0172b 100644
--- a/sfx2/inc/sfx2/shell.hxx
+++ b/sfx2/inc/sfx2/shell.hxx
@@ -28,13 +28,10 @@
#include "sal/types.h"
#include <com/sun/star/embed/VerbDescriptor.hpp>
#include <tools/debug.hxx>
-#include <tools/rtti.hxx>
#include <svl/brdcst.hxx>
-
#include <tools/ownlist.hxx>
#include <tools/unqid.hxx>
#include <tools/string.hxx>
-
#include <sfx2/sfxuno.hxx>
class ResMgr;
@@ -180,7 +177,6 @@ protected:
#endif
public:
- TYPEINFO();
virtual ~SfxShell();
SfxBroadcaster* GetBroadcaster();
diff --git a/sfx2/inc/sfx2/stbitem.hxx b/sfx2/inc/sfx2/stbitem.hxx
index 5907b87ee40f..a2592e9b33e6 100644
--- a/sfx2/inc/sfx2/stbitem.hxx
+++ b/sfx2/inc/sfx2/stbitem.hxx
@@ -27,6 +27,7 @@
#include "sfx2/dllapi.h"
#include <svl/poolitem.hxx>
#include <svtools/statusbarcontroller.hxx>
+#include <typeinfo>
//------------------------------------------------------------------
@@ -45,13 +46,13 @@ typedef SfxStatusBarControl* (*SfxStatusBarControlCtor)( sal_uInt16 nSlotId, sal
struct SfxStbCtrlFactory
{
SfxStatusBarControlCtor pCtor;
- TypeId nTypeId;
+ const std::type_info& rTypeInfo;
sal_uInt16 nSlotId;
SfxStbCtrlFactory( SfxStatusBarControlCtor pTheCtor,
- TypeId nTheTypeId, sal_uInt16 nTheSlotId ):
+ const std::type_info& rTheType, sal_uInt16 nTheSlotId ):
pCtor(pTheCtor),
- nTypeId(nTheTypeId),
+ rTypeInfo(rTheType),
nSlotId(nTheSlotId)
{}
};
@@ -133,12 +134,12 @@ public:
static SfxStatusBarControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ); \
static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL)
-#define SFX_IMPL_STATUSBAR_CONTROL(Class, nItemClass) \
+#define SFX_IMPL_STATUSBAR_CONTROL(Class, ItemClass) \
SfxStatusBarControl* __EXPORT Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \
{ return new Class( nSlotId, nId, rStb ); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxStatusBarControl::RegisterStatusBarControl( pMod, new SfxStbCtrlFactory( \
- Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+ Class::CreateImpl, typeid(ItemClass), nSlotId ) ); }
#endif
diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index eb19db22c497..1a737896c248 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -74,7 +74,6 @@ struct TabDlg_Impl;
class SFX2_DLLPUBLIC SfxTabDialogItem: public SfxSetItem
{
public:
- TYPEINFO();
SfxTabDialogItem( sal_uInt16 nId, const SfxItemSet& rItemSet );
SfxTabDialogItem(const SfxTabDialogItem& rAttr, SfxItemPool* pItemPool=NULL);
virtual SfxPoolItem* Clone(SfxItemPool* pToPool) const;
diff --git a/sfx2/inc/sfx2/tbxctrl.hxx b/sfx2/inc/sfx2/tbxctrl.hxx
index ebe83f5232f0..5ec21e6593bb 100644
--- a/sfx2/inc/sfx2/tbxctrl.hxx
+++ b/sfx2/inc/sfx2/tbxctrl.hxx
@@ -46,6 +46,7 @@
#include <com/sun/star/awt/XDockableWindowListener.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
#include <com/sun/star/frame/XSubToolbarController.hpp>
+#include <typeinfo>
//------------------------------------------------------------------
@@ -63,13 +64,13 @@ typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, sal_uIn
struct SfxTbxCtrlFactory
{
SfxToolBoxControlCtor pCtor;
- TypeId nTypeId;
+ const std::type_info& rTypeInfo;
sal_uInt16 nSlotId;
SfxTbxCtrlFactory( SfxToolBoxControlCtor pTheCtor,
- TypeId nTheTypeId, sal_uInt16 nTheSlotId ):
+ const std::type_info& rTheType, sal_uInt16 nTheSlotId ):
pCtor(pTheCtor),
- nTypeId(nTheTypeId),
+ rTypeInfo(rTheType),
nSlotId(nTheSlotId)
{}
};
@@ -302,19 +303,19 @@ public:
static void RegisterToolBoxControl( SfxModule*, SfxTbxCtrlFactory*);
};
-#define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \
+#define SFX_IMPL_TOOLBOX_CONTROL(Class, ItemClass) \
SfxToolBoxControl* __EXPORT Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx ); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
- Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+ Class::CreateImpl, typeid(ItemClass), nSlotId ) ); }
-#define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \
+#define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, ItemClass, Arg) \
SfxToolBoxControl* __EXPORT Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx, Arg); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
- Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+ Class::CreateImpl, typeid(ItemClass), nSlotId ) ); }
//=========================================================================
diff --git a/sfx2/inc/sfx2/tplpitem.hxx b/sfx2/inc/sfx2/tplpitem.hxx
index 90aa30993ecb..26d02187926a 100644
--- a/sfx2/inc/sfx2/tplpitem.hxx
+++ b/sfx2/inc/sfx2/tplpitem.hxx
@@ -26,14 +26,13 @@
#include "sal/config.h"
#include "sfx2/dllapi.h"
#include <tools/string.hxx>
-#include <tools/rtti.hxx>
#include <svl/flagitem.hxx>
class SFX2_DLLPUBLIC SfxTemplateItem: public SfxFlagItem
{
String aStyle;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxTemplateItem();
SfxTemplateItem( sal_uInt16 nWhich,
const String &rStyle,
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 944637d3e666..64bb42a2c446 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -68,6 +68,15 @@ SV_DECL_REF(SfxObjectShell)
#endif
//========================================================================
+
+//typedef bool (*ConvertToViewFrame)( const SfxViewFrame* );
+//template<class T> bool _IsSfxViewFrame(const SfxViewFrame* pShell)
+//{
+// return 0 != dynamic_cast< const T* >(pShell);
+//}
+
+//========================================================================
+
DBG_NAMEEX(SfxViewFrame)
class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
{
@@ -95,7 +104,6 @@ protected:
public:
SfxViewFrame( SfxFrame& rFrame, SfxObjectShell *pDoc = NULL );
- TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM)
static void SetViewFrame( SfxViewFrame* );
@@ -306,7 +314,6 @@ class SFX2_DLLPUBLIC SfxViewFrameItem: public SfxPoolItem
SfxViewFrame* pFrame;
public:
- TYPEINFO();
SfxViewFrameItem( SfxViewFrame *pViewFrame ):
SfxPoolItem( 0 ),
pFrame( pViewFrame)
@@ -329,7 +336,6 @@ class SfxVerbListItem : public SfxPoolItem
com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor > aVerbs;
public:
- TYPEINFO();
SfxVerbListItem( sal_uInt16 nWhichId = SID_OBJECT ) :
SfxPoolItem( nWhichId )
{}
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 2b119aab2871..a8975034d75a 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -140,6 +140,15 @@ class SfxInPlaceClient;
DECLARE_LIST( SfxInPlaceClientList, SfxInPlaceClient* )
// -----------------------------------------------------------------------
+
+typedef bool (*ConvertToViewShell)( const SfxViewShell* );
+template<class T> bool _IsSfxViewShell(const SfxViewShell* pShell)
+{
+ return 0 != dynamic_cast<const T*>(pShell);
+}
+
+// -----------------------------------------------------------------------
+
class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener
{
#ifdef _SFXVIEWSH_HXX
@@ -172,15 +181,13 @@ protected:
public:
// Iteration
- static SfxViewShell* GetFirst( const TypeId* pType = 0, sal_Bool bOnlyVisible = sal_True );
- static SfxViewShell* GetNext( const SfxViewShell& rPrev,
- const TypeId* pType = 0, sal_Bool bOnlyVisible = sal_True );
+ static SfxViewShell* GetFirst( ConvertToViewShell = 0, sal_Bool bOnlyVisible = sal_True );
+ static SfxViewShell* GetNext( const SfxViewShell& rPrev, ConvertToViewShell = 0, sal_Bool bOnlyVisible = sal_True );
static SfxViewShell* Current();
static SfxViewShell* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController );
// Ctoren/Dtoren Initialisierung
- TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWSH)
SfxViewShell( SfxViewFrame *pFrame, sal_uInt16 nFlags = 0 );
@@ -220,8 +227,8 @@ public:
// Focus, KeyInput, Cursor
void GotFocus() const;
inline void LostFocus() const;
- virtual void ShowCursor( FASTBOOL bOn = sal_True );
- virtual FASTBOOL KeyInput( const KeyEvent &rKeyEvent );
+ virtual void ShowCursor( bool bOn = true );
+ virtual bool KeyInput( const KeyEvent &rKeyEvent );
sal_Bool Escape();
// Viewing Interface
diff --git a/sfx2/inc/sorgitm.hxx b/sfx2/inc/sorgitm.hxx
index 93146669a721..a91555b747d9 100644
--- a/sfx2/inc/sorgitm.hxx
+++ b/sfx2/inc/sorgitm.hxx
@@ -33,7 +33,6 @@ private:
String aLanguage;
public:
- TYPEINFO();
SfxScriptOrganizerItem();
SfxScriptOrganizerItem( const String &rLanguage );
SfxScriptOrganizerItem( const SfxScriptOrganizerItem& );
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 01cd7f3f0c7c..fa6034449f06 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -171,7 +171,7 @@ SfxPropertyHandler* GetOrCreatePropertyHandler()
void SfxPropertyHandler::Property( ApplicationProperty& rProp )
{
- TTProperties* pTTProperties = PTR_CAST( TTProperties, &rProp );
+ TTProperties* pTTProperties = dynamic_cast< TTProperties* >( &rProp );
if ( pTTProperties )
{
pTTProperties->nPropertyVersion = TT_PROPERTIES_VERSION;
@@ -222,7 +222,7 @@ void SfxPropertyHandler::Property( ApplicationProperty& rProp )
String aFactory = String::CreateFromAscii("private:factory/");
if ( pArgs && *pArgs )
{
- SFX_ITEMSET_ARG( &aSet, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, sal_False );
+ SFX_ITEMSET_ARG( &aSet, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT );
if ( pFactoryName )
aFactory += pFactoryName->GetValue();
else
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 7a233eb59e71..0560c21bbc33 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -220,7 +220,7 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
{
case SID_CREATE_BASICOBJECT:
{
- SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, nSID, sal_False);
+ SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, nSID );
if ( pItem )
{
SbxObject* pObject = SbxBase::CreateObject( pItem->GetValue() );
@@ -233,7 +233,7 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
case SID_DELETE_BASICOBJECT:
{
- SFX_REQUEST_ARG(rReq, pItem, SfxObjectItem, nSID, sal_False);
+ SFX_REQUEST_ARG(rReq, pItem, SfxObjectItem, nSID );
if ( pItem )
{
//(mba) SbxObject* pObject = pItem->GetObject();
@@ -244,7 +244,7 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
case SID_ATTR_UNDO_COUNT:
{
- SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID, sal_False);
+ SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID );
SvtUndoOptions().SetUndoCount( pCountItem->GetValue() );
break;
}
@@ -256,7 +256,7 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
case SID_STATUSBARTEXT:
{
- SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False);
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID );
String aText = pStringItem->GetValue();
if ( aText.Len() )
GetpApp()->ShowStatusText( aText );
@@ -274,7 +274,7 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
case SID_OFFICE_CUSTOMERNUMBER:
{
- SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False);
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID );
if ( pStringItem )
SvtUserOptions().SetCustomerNumber( pStringItem->GetValue() );
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 71e04422d710..892dfbb7def6 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -113,7 +113,7 @@ public:
void SfxEventAsyncer_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() )
{
pTimer->Stop();
@@ -533,7 +533,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
SvtMiscOptions aMiscOptions;
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), sal_True, &pItem) )
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
sal_uInt16 nOutStyle =
( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT;
aMiscOptions.SetToolboxStyle( nOutStyle );
@@ -541,7 +541,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), sal_True, &pItem) )
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
sal_Bool bBigSize = ( (const SfxBoolItem*)pItem )->GetValue();
aMiscOptions.SetSymbolsSize(
sal::static_int_cast< sal_Int16 >(
@@ -559,112 +559,112 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
// Backup
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), sal_True, &pItem) )
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() );
}
// PrettyPrinting
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), sal_True, &pItem ) )
{
- DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
+ DBG_ASSERT( dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected" );
aSaveOptions.SetPrettyPrinting( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
}
// WarnAlienFormat
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), sal_True, &pItem ) )
{
- DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
+ DBG_ASSERT( dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected" );
aSaveOptions.SetWarnAlienFormat( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
}
// AutoSave
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() );
}
// AutoSave-Propt
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue());
}
// AutoSave-Time
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ DBG_ASSERT(dynamic_cast< const SfxUInt16Item* >(pItem), "UInt16Item expected");
aSaveOptions.SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue());
}
// DocInfo
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue());
}
// offende Dokumente merken
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
}
// Fenster-Einstellung speichern
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue());
}
// Metric
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ DBG_ASSERT(dynamic_cast< const SfxUInt16Item* >(pItem), "UInt16Item expected");
// pOptions->SetMetric((FieldUnit)((const SfxUInt16Item*)pItem)->GetValue());
}
// HelpBalloons
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aHelpOptions.SetExtendedHelp(((const SfxBoolItem *)pItem)->GetValue());
}
// HelpTips
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue());
}
// AutoHelpAgent
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aHelpOptions.SetHelpAgentAutoStartMode( ((const SfxBoolItem *)pItem)->GetValue() );
}
// help agent timeout
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), sal_True, &pItem ) )
{
- DBG_ASSERT(pItem->ISA(SfxInt32Item), "Int32Item expected");
+ DBG_ASSERT(dynamic_cast< const SfxInt32Item* >(pItem), "Int32Item expected");
aHelpOptions.SetHelpAgentTimeoutPeriod( ( (const SfxInt32Item*)pItem )->GetValue() );
}
// WelcomeScreen
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aHelpOptions.SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() );
}
// WelcomeScreen
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
sal_Bool bReset = ((const SfxBoolItem *)pItem)->GetValue();
if ( bReset )
{
@@ -673,28 +673,28 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxStringItem* >(pItem), "StringItem expected");
aHelpOptions.SetHelpStyleSheet( ((const SfxStringItem *)pItem)->GetValue() );
}
// SaveRelINet
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue());
}
// SaveRelFSys
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
aSaveOptions.SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue());
}
// Undo-Count
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ DBG_ASSERT(dynamic_cast< const SfxUInt16Item* >(pItem), "UInt16Item expected");
sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue();
aUndoOptions.SetUndoCount( nUndoCount );
@@ -723,28 +723,28 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
// Office autostart
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "BoolItem expected");
ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() != sal_False );
}
// StarBasic Enable
if ( SFX_ITEM_SET == rSet.GetItemState(SID_BASIC_ENABLED, sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected");
+ DBG_ASSERT(dynamic_cast< const SfxUInt16Item* >(pItem), "SfxInt16Item expected");
aSecurityOptions.SetBasicMode( (EBasicSecurityMode)( (const SfxUInt16Item*)pItem )->GetValue() );
}
// Execute PlugIns
if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "SfxBoolItem expected");
aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() );
bResetSession = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), sal_True, &pItem))
{
- DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
+ DBG_ASSERT( dynamic_cast< const SfxUInt16Item* >(pItem), "UInt16Item expected" );
aInetOptions.SetProxyType((SvtInetOptions::ProxyType)( (const SfxUInt16Item*)pItem )->GetValue());
bResetSession = sal_True;
bProxiesModified = sal_True;
@@ -752,35 +752,35 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), sal_True, &pItem ) )
{
- DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
+ DBG_ASSERT( dynamic_cast< const SfxStringItem* >(pItem), "StringItem expected" );
aInetOptions.SetProxyHttpName( ((const SfxStringItem *)pItem)->GetValue() );
bResetSession = sal_True;
bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), sal_True, &pItem ) )
{
- DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
+ DBG_ASSERT( dynamic_cast< const SfxInt32Item* >(pItem), "Int32Item expected" );
aInetOptions.SetProxyHttpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
bResetSession = sal_True;
bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), sal_True, &pItem ) )
{
- DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
+ DBG_ASSERT( dynamic_cast< const SfxStringItem* >(pItem), "StringItem expected" );
aInetOptions.SetProxyFtpName( ((const SfxStringItem *)pItem)->GetValue() );
bResetSession = sal_True;
bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), sal_True, &pItem ) )
{
- DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
+ DBG_ASSERT( dynamic_cast< const SfxInt32Item* >(pItem), "Int32Item expected" );
aInetOptions.SetProxyFtpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
bResetSession = sal_True;
bProxiesModified = sal_True;
}
if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxStringItem* >(pItem), "StringItem expected");
aInetOptions.SetProxyNoProxy(((const SfxStringItem *)pItem)->GetValue());
bResetSession = sal_True;
bProxiesModified = sal_True;
@@ -791,7 +791,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
{
DELETEZ(pAppData_Impl->pSecureURLs);
- DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxStringListItem* >(pItem), "StringListItem expected");
const List *pList = ((SfxStringListItem*)pItem)->GetList();
sal_uInt32 nCount = pList->Count();
::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs(nCount);
@@ -804,12 +804,12 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_WARNING, sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "SfxBoolItem expected");
aSecurityOptions.SetWarningEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
}
if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem), "SfxBoolItem expected");
aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
}
@@ -839,7 +839,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
// PathName
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), sal_True, &pItem))
{
- DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected");
+ DBG_ASSERT(dynamic_cast< const SfxAllEnumItem* >(pItem), "AllEnumItem expected");
const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem;
sal_uInt32 nCount = pEnumItem->GetValueCount();
String aNoChangeStr( ' ' );
@@ -961,7 +961,7 @@ sal_Bool SfxApplication::SaveAll_Impl(sal_Bool bPrompt, sal_Bool bAutoSave)
{
SfxRequest aReq( SID_SAVEDOC, 0, pDoc->GetPool() );
const SfxPoolItem *pPoolItem = pDoc->ExecuteSlot( aReq );
- if ( !pPoolItem || !pPoolItem->ISA(SfxBoolItem) ||
+ if ( !pPoolItem || !dynamic_cast< const SfxBoolItem* >(pPoolItem) ||
!( (const SfxBoolItem*) pPoolItem )->GetValue() )
bFunc = sal_False;
}
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 452ca0daa838..2a1dbee7f2fb 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -561,8 +561,7 @@ sal_Bool ImplDdeService::MakeTopic( const String& rNm )
sal_Bool bRet = sal_False;
String sNm( rNm );
sNm.ToLowerAscii();
- TypeId aType( TYPE(SfxObjectShell) );
- SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
+ SfxObjectShell* pShell = SfxObjectShell::GetFirst(_IsObjectShell< SfxObjectShell >);
while( pShell )
{
String sTmp( pShell->GetTitle(SFX_TITLE_FULLNAME) );
@@ -573,7 +572,7 @@ sal_Bool ImplDdeService::MakeTopic( const String& rNm )
bRet = sal_True;
break;
}
- pShell = SfxObjectShell::GetNext( *pShell, &aType );
+ pShell = SfxObjectShell::GetNext( *pShell, _IsObjectShell< SfxObjectShell > );
}
if( !bRet )
@@ -596,7 +595,7 @@ sal_Bool ImplDdeService::MakeTopic( const String& rNm )
&aName, &aNewView,
&aSilent, 0L );
- if( pRet && pRet->ISA( SfxViewFrameItem ) &&
+ if( pRet && dynamic_cast< const SfxViewFrameItem* >(pRet) &&
((SfxViewFrameItem*)pRet)->GetFrame() &&
0 != ( pShell = ((SfxViewFrameItem*)pRet)
->GetFrame()->GetObjectShell() ) )
@@ -615,8 +614,7 @@ String ImplDdeService::Topics()
if( GetSysTopic() )
sRet += GetSysTopic()->GetName();
- TypeId aType( TYPE(SfxObjectShell) );
- SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
+ SfxObjectShell* pShell = SfxObjectShell::GetFirst( _IsObjectShell< SfxObjectShell > );
while( pShell )
{
if( SfxViewFrame::GetFirst( pShell ) )
@@ -625,7 +623,7 @@ String ImplDdeService::Topics()
sRet += '\t';
sRet += pShell->GetTitle(SFX_TITLE_FULLNAME);
}
- pShell = SfxObjectShell::GetNext( *pShell, &aType );
+ pShell = SfxObjectShell::GetNext( *pShell, _IsObjectShell< SfxObjectShell > );
}
if( sRet.Len() )
sRet += DEFINE_CONST_UNICODE("\r\n");
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index d6373c2ad8ec..f6661e12f3af 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -89,9 +89,6 @@ static SfxItemInfo __READONLY_DATA aItemInfos[] =
//===================================================================
-TYPEINIT2(SfxApplication,SfxShell,SfxBroadcaster);
-
-//--------------------------------------------------------------------
void SfxApplication::Init
(
)
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 883e4f42b4ea..ff0aa35da653 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -352,12 +352,12 @@ sal_uInt32 CheckPasswd_Impl
{
// use the comphelper password helper to request a password
::rtl::OUString aPassword;
- SFX_ITEMSET_ARG( pSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( pSet, pPasswordItem, SfxStringItem, SID_PASSWORD );
if ( pPasswordItem )
aPassword = pPasswordItem->GetValue();
uno::Sequence< beans::NamedValue > aEncryptionData;
- SFX_ITEMSET_ARG( pSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ SFX_ITEMSET_ARG( pSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if ( pEncryptionDataItem )
pEncryptionDataItem->GetValue() >>= aEncryptionData;
@@ -443,12 +443,12 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String
SfxStringItem aFlags( SID_OPTIONS, String::CreateFromAscii("T") );
SfxBoolItem aHidden( SID_HIDDEN, sal_True );
const SfxPoolItem *pRet = GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aName, &aHidden, &aReferer, &aFlags, 0L );
- const SfxObjectItem *pObj = PTR_CAST( SfxObjectItem, pRet );
+ const SfxObjectItem *pObj = dynamic_cast< const SfxObjectItem* >( pRet );
if ( pObj )
- xDoc = PTR_CAST( SfxObjectShell, pObj->GetShell() );
+ xDoc = dynamic_cast< SfxObjectShell* >( pObj->GetShell() );
else
{
- const SfxViewFrameItem *pView = PTR_CAST( SfxViewFrameItem, pRet );
+ const SfxViewFrameItem *pView = dynamic_cast< const SfxViewFrameItem* >( pRet );
if ( pView )
{
SfxViewFrame *pFrame = pView->GetFrame();
@@ -537,7 +537,7 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
- SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, sal_False);
+ SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT);
String aFactName;
if ( pFactoryItem )
aFactName = pFactoryItem->GetValue();
@@ -553,15 +553,15 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_default" ) ) );
// TODO/LATER: Should the other arguments be transfered as well?
- SFX_REQUEST_ARG( rReq, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, sal_False);
+ SFX_REQUEST_ARG( rReq, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH);
if ( pDefaultPathItem )
aReq.AppendItem( *pDefaultPathItem );
- SFX_REQUEST_ARG( rReq, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME, sal_False);
+ SFX_REQUEST_ARG( rReq, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME);
if ( pDefaultNameItem )
aReq.AppendItem( *pDefaultNameItem );
SFX_APP()->ExecuteSlot( aReq );
- const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() );
+ const SfxViewFrameItem* pItem = dynamic_cast< const SfxViewFrameItem* >( aReq.GetReturnValue() );
if ( pItem )
rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) );
}
@@ -573,9 +573,9 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
DBG_MEMTEST();
// keine Parameter vom BASIC nur Factory angegeben?
- SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False);
- SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
- SFX_REQUEST_ARG(rReq, pTemplRegionNameItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, sal_False);
+ SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME);
+ SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME);
+ SFX_REQUEST_ARG(rReq, pTemplRegionNameItem, SfxStringItem, SID_TEMPLATE_REGIONNAME);
SfxObjectShellLock xDoc;
@@ -681,7 +681,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
DBG_MEMTEST();
sal_uInt16 nSID = rReq.GetSlot();
- SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME);
if ( pFileNameItem )
{
String aCommand( pFileNameItem->GetValue() );
@@ -709,7 +709,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
String aFilter;
SfxItemSet* pSet = NULL;
String aPath;
- SFX_REQUEST_ARG( rReq, pFolderNameItem, SfxStringItem, SID_PATH, sal_False );
+ SFX_REQUEST_ARG( rReq, pFolderNameItem, SfxStringItem, SID_PATH);
if ( pFolderNameItem )
aPath = pFolderNameItem->GetValue();
else if ( nSID == SID_OPENTEMPLATE )
@@ -723,19 +723,19 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG;
- SFX_REQUEST_ARG( rReq, pSystemDialogItem, SfxBoolItem, SID_FILE_DIALOG, sal_False );
+ SFX_REQUEST_ARG( rReq, pSystemDialogItem, SfxBoolItem, SID_FILE_DIALOG);
if ( pSystemDialogItem )
nDialog = pSystemDialogItem->GetValue() ? SFX2_IMPL_DIALOG_SYSTEM : SFX2_IMPL_DIALOG_OOO;
String sStandardDir;
- SFX_REQUEST_ARG( rReq, pStandardDirItem, SfxStringItem, SID_STANDARD_DIR, sal_False );
+ SFX_REQUEST_ARG( rReq, pStandardDirItem, SfxStringItem, SID_STANDARD_DIR);
if ( pStandardDirItem )
sStandardDir = pStandardDirItem->GetValue();
::com::sun::star::uno::Sequence< ::rtl::OUString > aBlackList;
- SFX_REQUEST_ARG( rReq, pBlackListItem, SfxStringListItem, SID_BLACK_LIST, sal_False );
+ SFX_REQUEST_ARG( rReq, pBlackListItem, SfxStringListItem, SID_BLACK_LIST);
if ( pBlackListItem )
pBlackListItem->GetStringList( aBlackList );
@@ -770,7 +770,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
css::uno::Reference< css::task::XInteractionHandler > xWrappedHandler;
// wrap existing handler or create new UUI handler
- SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False);
+ SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER);
if (pInteractionItem)
{
pInteractionItem->GetValue() >>= xWrappedHandler;
@@ -862,22 +862,22 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// no else here! It's optional ...
if (!bHyperlinkUsed)
{
- SFX_REQUEST_ARG(rReq, pHyperLinkUsedItem, SfxBoolItem, SID_BROWSE, sal_False);
+ SFX_REQUEST_ARG(rReq, pHyperLinkUsedItem, SfxBoolItem, SID_BROWSE);
if ( pHyperLinkUsedItem )
bHyperlinkUsed = pHyperLinkUsedItem->GetValue();
// no "official" item, so remove it from ItemSet before using UNO-API
rReq.RemoveItem( SID_BROWSE );
}
- SFX_REQUEST_ARG( rReq, pFileName, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pFileName, SfxStringItem, SID_FILE_NAME);
String aFileName = pFileName->GetValue();
String aReferer;
- SFX_REQUEST_ARG( rReq, pRefererItem, SfxStringItem, SID_REFERER, sal_False );
+ SFX_REQUEST_ARG( rReq, pRefererItem, SfxStringItem, SID_REFERER);
if ( pRefererItem )
aReferer = pRefererItem->GetValue();
- SFX_REQUEST_ARG( rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS, sal_False);
+ SFX_REQUEST_ARG( rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS);
if ( pFileFlagsItem )
{
String aFileFlags = pFileFlagsItem->GetValue();
@@ -1144,13 +1144,13 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
SfxFrame* pTargetFrame = NULL;
Reference< XFrame > xTargetFrame;
- SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME, sal_False);
+ SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME);
if ( pFrameItem )
pTargetFrame = pFrameItem->GetFrame();
if ( !pTargetFrame )
{
- SFX_REQUEST_ARG(rReq, pUnoFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False);
+ SFX_REQUEST_ARG(rReq, pUnoFrameItem, SfxUnoFrameItem, SID_FILLFRAME);
if ( pUnoFrameItem )
xTargetFrame = pUnoFrameItem->GetFrame();
}
@@ -1159,7 +1159,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
pTargetFrame = &SfxViewFrame::Current()->GetFrame();
// check if caller has set a callback
- SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK, sal_False );
+ SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK);
// remove from Itemset, because it confuses the parameter transformation
if ( pLinkItem )
@@ -1169,19 +1169,19 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// check if the view must be hidden
sal_Bool bHidden = sal_False;
- SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False);
+ SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN);
if ( pHidItem )
bHidden = pHidItem->GetValue();
// This request is a UI call. We have to set the right values inside the MediaDescriptor
// for: InteractionHandler, StatusIndicator, MacroExecutionMode and DocTemplate.
// But we have to look for already existing values or for real hidden requests.
- SFX_REQUEST_ARG(rReq, pPreviewItem, SfxBoolItem, SID_PREVIEW, sal_False);
+ SFX_REQUEST_ARG(rReq, pPreviewItem, SfxBoolItem, SID_PREVIEW);
if (!bHidden && ( !pPreviewItem || !pPreviewItem->GetValue() ) )
{
- SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False);
- SFX_REQUEST_ARG(rReq, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE , sal_False);
- SFX_REQUEST_ARG(rReq, pDocTemplateItem, SfxUInt16Item, SID_UPDATEDOCMODE , sal_False);
+ SFX_REQUEST_ARG(rReq, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER);
+ SFX_REQUEST_ARG(rReq, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE );
+ SFX_REQUEST_ARG(rReq, pDocTemplateItem, SfxUInt16Item, SID_UPDATEDOCMODE );
if (!pInteractionItem)
{
@@ -1197,12 +1197,12 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// extract target name
::rtl::OUString aTarget;
- SFX_REQUEST_ARG(rReq, pTargetItem, SfxStringItem, SID_TARGETNAME, sal_False);
+ SFX_REQUEST_ARG(rReq, pTargetItem, SfxStringItem, SID_TARGETNAME );
if ( pTargetItem )
aTarget = pTargetItem->GetValue();
else
{
- SFX_REQUEST_ARG( rReq, pNewViewItem, SfxBoolItem, SID_OPEN_NEW_VIEW, sal_False );
+ SFX_REQUEST_ARG( rReq, pNewViewItem, SfxBoolItem, SID_OPEN_NEW_VIEW );
if ( pNewViewItem && pNewViewItem->GetValue() )
aTarget = String::CreateFromAscii("_blank" );
}
@@ -1231,7 +1231,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
}
// make URL ready
- SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME );
aFileName = pURLItem->GetValue();
if( aFileName.Len() && aFileName.GetChar(0) == '#' ) // Mark without URL
{
@@ -1295,7 +1295,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
else
{
// synchron loading without a given frame or as blank frame
- SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME );
// Desktop service must exists! dont catch() or check for problems here ...
// But loading of documents can fail by other reasons. Handle it more gracefully.
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index 9c752f5ea891..d639d89c51ca 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -87,7 +87,7 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac
for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->Count(); n++ )
{
SfxTbxCtrlFactory *pF = (*pAppData_Impl->pTbxCtrlFac)[n];
- if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ if ( pF->rTypeInfo == pFact->rTypeInfo &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
@@ -112,7 +112,7 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF
for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->Count(); n++ )
{
SfxStbCtrlFactory *pF = (*pAppData_Impl->pStbCtrlFac)[n];
- if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ if ( pF->rTypeInfo == pFact->rTypeInfo &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
@@ -137,7 +137,7 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto
for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->Count(); n++ )
{
SfxMenuCtrlFactory *pF = (*pAppData_Impl->pMenuCtrlFac)[n];
- if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ if ( pF->rTypeInfo == pFact->rTypeInfo &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 25bf48be24cb..952201884945 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -234,8 +234,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
if ( pFact )
{
- SFX_REQUEST_ARG(rReq, pStringItem,
- SfxStringItem, SID_CONFIG, sal_False);
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, SID_CONFIG );
SfxItemSet aSet(
GetPool(), SID_CONFIG, SID_CONFIG );
@@ -248,7 +247,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
Reference< XFrame > xFrame;
const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl();
- SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False );
+ SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME );
if ( pFrameItem )
xFrame = pFrameItem->GetFrame();
@@ -316,7 +315,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
if ( pObjSh->IsModified() )
{
pObjSh->ExecuteSlot( aReq );
- SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, aReq.GetReturnValue() );
+ const SfxBoolItem *pItem = dynamic_cast< const SfxBoolItem* >( aReq.GetReturnValue() );
bTmpDone = aReq.IsDone();
if ( !pItem || !pItem->GetValue() )
bOK = sal_False;
@@ -361,7 +360,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_HELPTIPS:
{
// Parameter aus werten
- SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS, sal_False);
+ SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS );
bool bOn = pOnItem
? ((SfxBoolItem*)pOnItem)->GetValue()
: !Help::IsQuickHelpEnabled();
@@ -389,7 +388,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_HELPBALLOONS:
{
// Parameter auswerten
- SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS, sal_False);
+ SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS );
bool bOn = pOnItem
? ((SfxBoolItem*)pOnItem)->GetValue()
: !Help::IsBalloonHelpEnabled();
@@ -413,7 +412,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_HELP_PI:
{
SvtHelpOptions aHelpOpt;
- SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELP_PI, sal_False);
+ SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELP_PI );
sal_Bool bOn = pOnItem
? ((SfxBoolItem*)pOnItem)->GetValue()
: !aHelpOpt.IsHelpAgentAutoStartMode();
@@ -476,8 +475,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
if (pAppData_Impl->m_xImeStatusWindow->canToggle())
{
SfxBoolItem const * pItem = static_cast< SfxBoolItem const * >(
- rReq.GetArg(SID_SHOW_IME_STATUS_WINDOW, false,
- TYPE(SfxBoolItem)));
+ rReq.GetArg(SID_SHOW_IME_STATUS_WINDOW));
bool bShow = pItem == 0
? !pAppData_Impl->m_xImeStatusWindow->isShowing()
: ( pItem->GetValue() == sal_True );
@@ -492,7 +490,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_AVAILABLE_TOOLBARS:
{
SfxStringItem const * pToolbarName = static_cast< SfxStringItem const *>(
- rReq.GetArg(SID_AVAILABLE_TOOLBARS, false, TYPE(SfxStringItem)));
+ rReq.GetArg(SID_AVAILABLE_TOOLBARS));
if ( pToolbarName )
{
@@ -819,7 +817,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
case SID_OPTIONS_TREEDIALOG:
{
String sPageURL;
- SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_OPTIONS_PAGEURL, sal_False );
+ SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_OPTIONS_PAGEURL );
if ( pURLItem )
sPageURL = pURLItem->GetValue();
const SfxItemSet* pArgs = rReq.GetInternalArgs_Impl();
@@ -827,7 +825,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
Reference < XFrame > xFrame;
if ( pArgs && pArgs->GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
- OSL_ENSURE( pItem->ISA( SfxUnoFrameItem ), "SfxApplication::OfaExec_Impl: XFrames are to be transported via SfxUnoFrameItem by now!" );
+ OSL_ENSURE( dynamic_cast<const SfxUnoFrameItem* >(pItem), "SfxApplication::OfaExec_Impl: XFrames are to be transported via SfxUnoFrameItem by now!" );
xFrame = static_cast< const SfxUnoFrameItem*>( pItem )->GetFrame();
}
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
@@ -1000,7 +998,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
Reference< XFrame > xFrame;
const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl();
- SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False );
+ SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME );
if ( pFrameItem )
xFrame = pFrameItem->GetFrame();
@@ -1077,7 +1075,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
case SID_OFFICE_CHECK_PLZ:
{
sal_Bool bRet = sal_False;
- SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, rReq.GetSlot(), sal_False);
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, rReq.GetSlot() );
if ( pStringItem )
{
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index b35a83733294..ade10e85679f 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1302,7 +1302,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
// slot is a property
sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId);
sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP );
- SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False );
+ SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich );
if ( pItem ) //???
{
sal_uInt16 nSubCount = pType->nAttribs;
@@ -1353,7 +1353,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg );
sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId );
sal_Bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP );
- SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich, sal_False );
+ SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, nWhich );
if ( pItem ) //???
{
sal_uInt16 nSubCount = rArg.pType->nAttribs;
@@ -1463,12 +1463,12 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
if ( rSet.GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrame));
- if ( pItem->ISA( SfxUsrAnyItem ) )
+ if ( dynamic_cast< const SfxUsrAnyItem* >(pItem) )
{
OSL_ENSURE( false, "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
pValue[nActProp++].Value = static_cast< const SfxUsrAnyItem* >( pItem )->GetValue();
}
- else if ( pItem->ISA( SfxUnoFrameItem ) )
+ else if ( dynamic_cast< const SfxUnoFrameItem* >(pItem) )
pValue[nActProp++].Value <<= static_cast< const SfxUnoFrameItem* >( pItem )->GetFrame();
else
OSL_ENSURE( false, "TransformItems: invalid item type for SID_FILLFRAME!" );
@@ -1878,8 +1878,8 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::
else if ( pDoc && pDoc->GetMedium() )
{
pDoc->AdjustMacroMode( String() );
- SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
- SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False);
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pMacroExecModeItem, SfxUInt16Item, SID_MACROEXECMODE );
if ( pUpdateDocItem && pMacroExecModeItem
&& pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE
&& pMacroExecModeItem->GetValue() == document::MacroExecMode::NEVER_EXECUTE )
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 94cca74332c2..3fee3f563ac9 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -521,14 +521,12 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
String sNm( sTopic ), sTmp;
aCC.toLower( sNm );
- TypeId aType( TYPE(SfxObjectShell) );
-
sal_Bool bFirst = sal_True;
SfxObjectShell* pShell = pLink->GetLinkManager()->GetPersist();
if( pShell && pShell->GetMedium() )
{
sReferer = pShell->GetMedium()->GetBaseURL();
- SFX_ITEMSET_ARG( pShell->GetMedium()->GetItemSet(), pItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False );
+ SFX_ITEMSET_ARG( pShell->GetMedium()->GetItemSet(), pItem, SfxUInt16Item, SID_UPDATEDOCMODE );
if ( pItem )
nUpdateMode = pItem->GetValue();
}
@@ -539,7 +537,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
if ( !pShell )
{
bFirst = sal_False;
- pShell = SfxObjectShell::GetFirst( &aType, sal_False );
+ pShell = SfxObjectShell::GetFirst( _IsObjectShell< SfxObjectShell >, sal_False );
}
while( pShell )
@@ -561,10 +559,10 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
if( bFirst )
{
bFirst = sal_False;
- pShell = SfxObjectShell::GetFirst( &aType, sal_False );
+ pShell = SfxObjectShell::GetFirst( _IsObjectShell< SfxObjectShell >, sal_False );
}
else
- pShell = SfxObjectShell::GetNext( *pShell, &aType, sal_False );
+ pShell = SfxObjectShell::GetNext( *pShell, _IsObjectShell< SfxObjectShell >, sal_False );
sTmp.Erase();
}
diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx
index 85a1e011c655..b12fa6e8f81f 100644
--- a/sfx2/source/appl/linksrc.cxx
+++ b/sfx2/source/appl/linksrc.cxx
@@ -40,8 +40,6 @@ using namespace ::com::sun::star::uno;
namespace sfx2
{
-TYPEINIT0( SvLinkSource )
-
/************** class SvLinkSourceTimer *********************************/
class SvLinkSourceTimer : public Timer
{
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index b5bd099d18b7..db2c712cfdae 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -43,10 +43,7 @@ using namespace ::com::sun::star::uno;
namespace sfx2
{
-TYPEINIT0( SvBaseLink )
-
static DdeTopic* FindTopic( const String &, sal_uInt16* = 0 );
-
class ImplDdeItem;
struct BaseLink_Impl
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 6f7351bc3dbf..c1feab409519 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -111,8 +111,6 @@ ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, sal_Bool bBig, sal_Boo
return rpList; }
-TYPEINIT1(SfxModule, SfxShell);
-
//=========================================================================
SFX_IMPL_INTERFACE(SfxModule,SfxShell,SfxResId(0))
@@ -266,7 +264,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact )
for ( sal_uInt16 n=0; n<pImpl->pTbxCtrlFac->Count(); n++ )
{
SfxTbxCtrlFactory *pF = (*pImpl->pTbxCtrlFac)[n];
- if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ if ( pF->rTypeInfo == pFact->rTypeInfo &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
@@ -288,7 +286,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
for ( sal_uInt16 n=0; n<pImpl->pStbCtrlFac->Count(); n++ )
{
SfxStbCtrlFactory *pF = (*pImpl->pStbCtrlFac)[n];
- if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ if ( pF->rTypeInfo == pFact->rTypeInfo &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
@@ -310,7 +308,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
for ( sal_uInt16 n=0; n<pImpl->pMenuCtrlFac->Count(); n++ )
{
SfxMenuCtrlFactory *pF = (*pImpl->pMenuCtrlFac)[n];
- if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ if ( pF->rTypeInfo == pFact->rTypeInfo &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
{
DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 9db006cc7d15..e36dc5bf507c 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -341,7 +341,7 @@ String SfxPickList::GetMenuEntryTitle( sal_uInt32 nIndex )
void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA( TYPE( SfxStringHint )))
+ if ( dynamic_cast< const SfxStringHint* >(&rHint))
{
SfxStringHint* pStringHint = (SfxStringHint*) &rHint;
@@ -349,9 +349,9 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
INetURLHistory::GetOrCreate()->PutUrl( INetURLObject( pStringHint->GetObject() ));
}
- if ( rHint.IsA( TYPE( SfxEventHint )))
+ if ( dynamic_cast< const SfxEventHint* >(&rHint))
{
- SfxEventHint* pEventHint = PTR_CAST(SfxEventHint,&rHint);
+ const SfxEventHint* pEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
// nur ObjectShell-bezogene Events mit Medium interessieren
SfxObjectShell* pDocSh = pEventHint->GetObjShell();
if( !pDocSh )
@@ -434,7 +434,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
return;
// add no document that forbids this (for example Message-Body)
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pPicklistItem, SfxBoolItem, SID_PICKLIST, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pPicklistItem, SfxBoolItem, SID_PICKLIST );
if (
(pPicklistItem && !pPicklistItem->GetValue()) ||
(!(pDocSh->Get_Impl()->bWaitingForPicklist) )
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 61746aa11402..587a5408f4c9 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1410,7 +1410,7 @@ sal_Bool SfxWorkWindow::IsPluginMode( SfxObjectShell* pObjShell )
{
if ( pObjShell && pObjShell->GetMedium() )
{
- SFX_ITEMSET_ARG( pObjShell->GetMedium()->GetItemSet(), pViewOnlyItem, SfxBoolItem, SID_VIEWONLY, sal_False );
+ SFX_ITEMSET_ARG( pObjShell->GetMedium()->GetItemSet(), pViewOnlyItem, SfxBoolItem, SID_VIEWONLY );
if ( pViewOnlyItem && pViewOnlyItem->GetValue() )
return sal_True;
}
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 7251bebc547b..0f677b1e61c9 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -532,7 +532,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
pOldFilter = 0;
else
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if ( ( pOldFilter->GetFilterFlags() & SFX_FILTER_PACKED ) && pSalvageItem )
// Salvage is always done without packing
pOldFilter = 0;
@@ -542,7 +542,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
const SfxFilter* pFilter = pOldFilter;
sal_Bool bPreview = rMedium.IsPreview_Impl();
- SFX_ITEMSET_ARG(rMedium.GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False);
+ SFX_ITEMSET_ARG(rMedium.GetItemSet(), pReferer, SfxStringItem, SID_REFERER );
if ( bPreview && rMedium.IsRemote() && ( !pReferer || pReferer->GetValue().CompareToAscii("private:searchfolder:",21 ) != COMPARE_EQUAL ) )
return ERRCODE_ABORT;
@@ -578,7 +578,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
}
sal_Bool bHidden = bPreview;
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS );
if ( !bHidden && pFlags )
{
String aFlags( pFlags->GetValue() );
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 3fa3a8fa9602..39efca71ce6e 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -285,8 +285,8 @@ const String& SfxProgress::GetStateText_Impl() const
IMPL_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus*, pStatus )
{
INetRequest* pReq = 0;
- const INetHint *pHint = PTR_CAST( INetHint, pStatus->pHint );
- pReq = PTR_CAST( INetRequest, pStatus->pBC );
+ const INetHint *pHint = dynamic_cast< const INetHint* >( pStatus->pHint );
+ pReq = dynamic_cast< INetRequest* >( pStatus->pBC );
String aString;
if( pReq )
@@ -393,7 +393,7 @@ sal_Bool SfxProgress::SetState
{
// don't show status indicator for hidden documents (only valid while loading)
SfxMedium* pMedium = pObjSh->GetMedium();
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN );
if ( !pHiddenItem || !pHiddenItem->GetValue() )
{
// not in a view, perhaps it's just loading
@@ -405,7 +405,7 @@ sal_Bool SfxProgress::SetState
//}
//else
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL );
Reference< XStatusIndicator > xInd;
if ( pIndicatorItem && (pIndicatorItem->GetValue()>>=xInd) )
pImp->xStatusInd = xInd;
@@ -731,7 +731,7 @@ void SfxProgress::LeaveLock()
// -----------------------------------------------------------------------
-FASTBOOL SfxProgress::StatusBarManagerGone_Impl
+bool SfxProgress::StatusBarManagerGone_Impl
(
SfxStatusBarManager * // dieser <SfxStatusBarManager> wird zerst"ort
)
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index 67d582b3c7c6..0aa3f183ffaa 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -53,9 +53,6 @@
#include <com/sun/star/uno/Reference.hxx>
// -----------------------------------------------------------------------
-TYPEINIT1(SfxEventHint, SfxHint);
-TYPEINIT1(SfxEventNamesItem, SfxPoolItem);
-TYPEINIT1(SfxViewEventHint, SfxEventHint);
using namespace com::sun::star;
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 11c9e997dcb9..c35c81b7f264 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -368,7 +368,7 @@ void SfxBindings::HidePopups( bool bHide )
pImp->pWorkWin->HidePopups_Impl( bHide, sal_True );
}
-void SfxBindings::HidePopupCtrls_Impl( FASTBOOL bHide )
+void SfxBindings::HidePopupCtrls_Impl( bool bHide )
{
if ( bHide )
{
@@ -1223,7 +1223,7 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
}
if ( bGlobalOnly )
- if ( !pShell->ISA(SfxModule) && !pShell->ISA(SfxApplication) && !pShell->ISA(SfxViewFrame) )
+ if ( !dynamic_cast< SfxModule* >(pShell) && !dynamic_cast< SfxApplication* >(pShell) && !dynamic_cast< SfxViewFrame* >(pShell) )
return NULL;
SfxItemPool &rPool = pShell->GetPool();
@@ -1294,7 +1294,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
SfxItemPool::IsWhich(nWhich) &&
pOldItem ) )
{
- if ( pOldItem->ISA(SfxBoolItem) )
+ if ( dynamic_cast< const SfxBoolItem* >(pOldItem) )
{
// wir koennen Bools toggeln
sal_Bool bOldValue = ((const SfxBoolItem *)pOldItem)->GetValue();
@@ -1303,7 +1303,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
aReq.AppendItem( *pNewItem );
delete pNewItem;
}
- else if ( pOldItem->ISA(SfxEnumItemInterface) &&
+ else if ( dynamic_cast< const SfxEnumItemInterface* >(pOldItem) &&
((SfxEnumItemInterface *)pOldItem)->HasBoolValue())
{
// und Enums mit Bool-Interface
@@ -1324,13 +1324,13 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
DBG_ASSERT( pNewItem, "Toggle an Slot ohne ItemFactory" );
pNewItem->SetWhich( nWhich );
- if ( pNewItem->ISA(SfxBoolItem) )
+ if ( dynamic_cast< const SfxBoolItem* >(pNewItem) )
{
// wir koennen Bools toggeln
((SfxBoolItem*)pNewItem)->SetValue( sal_True );
aReq.AppendItem( *pNewItem );
}
- else if ( pNewItem->ISA(SfxEnumItemInterface) &&
+ else if ( dynamic_cast< const SfxEnumItemInterface* >(pNewItem) &&
((SfxEnumItemInterface *)pNewItem)->HasBoolValue())
{
// und Enums mit Bool-Interface
@@ -1601,14 +1601,13 @@ void SfxBindings::UpdateControllers_Impl
// (Enum-Werte) des Slots updaten
DBG_PROFSTART(SfxBindingsUpdateCtrl2);
DBG_ASSERT( !pSlot || 0 == pSlot->GetLinkedSlot() || !pItem ||
- pItem->ISA(SfxEnumItemInterface),
+ dynamic_cast< const SfxEnumItemInterface* >(pItem),
"master slot with non-enum-type found" );
const SfxSlot *pFirstSlave = pSlot ? pSlot->GetLinkedSlot() : 0;
if ( pIF && pFirstSlave)
{
// Items auf EnumItem casten
- const SfxEnumItemInterface *pEnumItem =
- PTR_CAST(SfxEnumItemInterface,pItem);
+ const SfxEnumItemInterface *pEnumItem = dynamic_cast< const SfxEnumItemInterface* >( pItem);
if ( eState == SFX_ITEM_AVAILABLE && !pEnumItem )
eState = SFX_ITEM_DONTCARE;
else
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index d7dff05cf6c9..728c67747946 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -409,7 +409,7 @@ SfxItemState SfxControllerItem::GetItemState
? SFX_ITEM_DISABLED
: IsInvalidItem(pState)
? SFX_ITEM_DONTCARE
- : pState->ISA(SfxVoidItem) && !pState->Which()
+ : dynamic_cast< const SfxVoidItem* >(pState) && !pState->Which()
? SFX_ITEM_UNKNOWN
: SFX_ITEM_AVAILABLE;
}
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index afba0852f6c8..b3ecb61e1a5d 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -792,7 +792,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ )
SfxBindings *pBind = GetBindings();
while ( pBind )
{
- pBind->HidePopupCtrls_Impl( sal_False );
+ pBind->HidePopupCtrls_Impl( false );
pBind = pBind->GetSubBindings_Impl();
}
@@ -897,7 +897,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
SfxBindings *pBind = GetBindings();
while ( pBind )
{
- pBind->HidePopupCtrls_Impl( sal_True );
+ pBind->HidePopupCtrls_Impl( true );
pBind = pBind->GetSubBindings_Impl();
}
@@ -1795,7 +1795,7 @@ void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bo
{
sal_Bool bViewerTbx = SFX_VISIBILITY_VIEWER == ( nPos & SFX_VISIBILITY_VIEWER );
SfxObjectShell* pSh = pImp->pFrame->GetObjectShell();
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY, sal_False );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY );
sal_Bool bIsViewer = pItem && pItem->GetValue();
if ( bIsViewer != bViewerTbx )
continue;
@@ -2279,7 +2279,7 @@ sal_Bool SfxDispatcher::_FindServer
SfxShell *pSh = GetShell(nShell);
if ( pSh == NULL )
return false;
- if ( pSh->ISA(SfxViewShell) )
+ if ( dynamic_cast< SfxViewShell* >(pSh) )
{
const SfxSlot* pSlot = pSh->GetVerbSlot_Impl(nSlot);
if ( pSlot )
@@ -2418,7 +2418,7 @@ sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot )
SfxShell *pSh = GetShell(nShell);
if ( pSh == NULL )
return false;
- if ( pSh->ISA(SfxViewShell) )
+ if ( dynamic_cast< SfxViewShell* >(pSh) )
return true;
}
}
@@ -2549,10 +2549,10 @@ sal_Bool SfxDispatcher::_FillState
for ( const SfxPoolItem *pItem = aIter.FirstItem();
pItem;
pItem = aIter.NextItem() )
- if ( !IsInvalidItem(pItem) && !pItem->ISA(SfxVoidItem) )
+ if ( !IsInvalidItem(pItem) && !dynamic_cast< const SfxVoidItem* >(pItem) )
{
sal_uInt16 nSlotId = rState.GetPool()->GetSlotId(pItem->Which());
- if ( !pItem->IsA(pIF->GetSlot(nSlotId)->GetType()->Type()) )
+ if ( !pIF->GetSlot(nSlotId)->GetType()->IsSlotType(pItem) )
{
ByteString aMsg( "item-type unequal to IDL (=> no BASIC)" );
aMsg += "\nwith SID: ";
@@ -2913,7 +2913,7 @@ SfxItemState SfxDispatcher::QueryState( sal_uInt16 nSID, ::com::sun::star::uno::
else
{
::com::sun::star::uno::Any aState;
- if ( !pItem->ISA(SfxVoidItem) )
+ if ( !dynamic_cast< const SfxVoidItem* >(pItem) )
{
sal_uInt16 nSubId( 0 );
SfxItemPool& rPool = pShell->GetPool();
@@ -2937,7 +2937,7 @@ sal_Bool SfxDispatcher::IsReadOnlyShell_Impl( sal_uInt16 nShell ) const
if ( nShell < nShellCount )
{
SfxShell* pShell = pImp->aStack.Top( nShell );
- if( pShell->ISA( SfxModule ) || pShell->ISA( SfxApplication ) || pShell->ISA( SfxViewFrame ) )
+ if( dynamic_cast< SfxModule* >(pShell) || dynamic_cast< SfxApplication* >(pShell) || dynamic_cast< SfxViewFrame* >(pShell) )
return sal_False;
else
return pImp->bReadOnly;
@@ -3103,7 +3103,7 @@ SfxModule* SfxDispatcher::GetModule() const
SfxShell *pSh = GetShell(nShell);
if ( pSh == NULL )
return 0;
- if ( pSh->ISA(SfxModule) )
+ if ( dynamic_cast< SfxModule* >(pSh) )
return (SfxModule*) pSh;
}
}
diff --git a/sfx2/source/control/macro.cxx b/sfx2/source/control/macro.cxx
index 7f31ac703a09..c6c3139ac274 100644
--- a/sfx2/source/control/macro.cxx
+++ b/sfx2/source/control/macro.cxx
@@ -122,10 +122,9 @@ SfxMacroStatement::SfxMacroStatement
return;
/*
// Objekt-Typ bestimmen
- bool bIsApp = rShell.ISA(SfxApplication);
- bool bIsDoc = rShell.ISA(SfxObjectShell);
- bool bIsWin = !bIsApp && !bIsDoc &&
- ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) );
+ bool bIsApp = dynamic_cast< SfxApplication* >(&rShell);
+ bool bIsDoc = dynamic_cast< SfxObjectShell* >(&rShell);
+ bool bIsWin = !bIsApp && !bIsDoc && ( dynamic_cast< SfxViewShell* >(&rShell) || dynamic_cast< SfxViewFrame* >(&rShell) );
bool bIsSel = !bIsApp && !bIsDoc && !bIsWin;
// Objekt nicht schon im Slot-Namen enthalten?
@@ -135,20 +134,20 @@ SfxMacroStatement::SfxMacroStatement
if ( rSlot.IsMode( SFX_SLOT_RECORDABSOLUTE ) )
{
// an der Applikation oder am Modul
- if ( rShell.ISA(SfxApplication) || rShell.ISA(SfxModule) )
+ if ( dynamic_cast< SfxApplication* >(&rShell) || dynamic_cast< SfxModule* >(&rShell) )
aStatement = rTarget;
// am Dokument?
// '[' = 5Bh
// ']' = 5Dh
- else if ( rShell.ISA(SfxObjectShell) )
+ else if ( dynamic_cast< SfxObjectShell* >(&rShell) )
{
aStatement = 0x005B;
aStatement += rTarget;
aStatement += 0x005D;
}
- else if ( rShell.ISA(SfxViewFrame) )
+ else if ( dynamic_cast< SfxViewFrame* >(&rShell) )
{
aStatement = 0x005B;
aStatement += String::CreateFromAscii("ViewFrame");//rShell.GetSbxObject()->GetName();
@@ -162,7 +161,7 @@ SfxMacroStatement::SfxMacroStatement
aStatement = 0x005B;
aStatement += String::CreateFromAscii("ViewShell");//pViewShell->GetViewFrame()->GetSbxObject()->GetName();
aStatement += 0x005D;
- if ( !rShell.ISA(SfxViewFrame) )
+ if ( !dynamic_cast< SfxViewFrame* >(&rShell) )
// an einer Sub-Shell zus"atlich ".Selection" anh"angen
aStatement += DEFINE_CONST_UNICODE(".Selection");
}
@@ -170,19 +169,19 @@ SfxMacroStatement::SfxMacroStatement
else // relatives Aufzeichnen
{
// an der Application?
- if ( rShell.ISA(SfxApplication) )
+ if ( dynamic_cast< SfxApplication* >(&rShell) )
aStatement = DEFINE_CONST_UNICODE("Application");
// am Modul?
- else if ( rShell.ISA(SfxModule) )
+ else if ( dynamic_cast< SfxModule* >(&rShell) )
aStatement = DEFINE_CONST_UNICODE("ActiveModule");
// am Dokument
- else if ( rShell.ISA(SfxObjectShell) )
+ else if ( dynamic_cast< SfxObjectShell* >(&rShell) )
aStatement = DEFINE_CONST_UNICODE("ActiveDocument");
// am Window
- else if ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) )
+ else if ( dynamic_cast< SfxViewShell* >(&rShell) || dynamic_cast< SfxViewFrame* >(&rShell) )
aStatement = DEFINE_CONST_UNICODE("ActiveWindow");
else
@@ -201,7 +200,7 @@ SfxMacroStatement::SfxMacroStatement
const SfxShellObject *pParentObj =
(const SfxShellObject*) pShObj->GetParent();
SfxShell *pParentSh = pParentObj->GetShell();
- DBG_ASSERT( pParentSh->ISA(SfxViewFrame),
+ DBG_ASSERT( dynamic_cast< SfxViewFrame* >(pParentSh),
"parent of SubShell must be a Frame" );
if ( rSlot.pName[0] == '.' )
{
diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx
index 370c66c8900f..206b567054ab 100644
--- a/sfx2/source/control/minfitem.cxx
+++ b/sfx2/source/control/minfitem.cxx
@@ -29,10 +29,7 @@
#include "sfx2/minfitem.hxx"
// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1(SfxMacroInfoItem, SfxPoolItem);
-
-// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SfxMacroInfoItem)
SfxMacroInfoItem::SfxMacroInfoItem(
sal_uInt16 nWhichId, // Slot-ID
diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx
index 19f424dc154b..1b4401b49c82 100644
--- a/sfx2/source/control/msg.cxx
+++ b/sfx2/source/control/msg.cxx
@@ -35,7 +35,7 @@ SfxSlotKind SfxSlot::GetKind() const
return (SfxSlotKind) SFX_KIND_STANDARD;
if ( nMasterSlotId && fnExec==0 && fnState==0 )
{
- if ( pType->Type() == TYPE(SfxBoolItem) )
+ if ( pType->Type() == typeid(SfxBoolItem) )
return (SfxSlotKind) SFX_KIND_ENUM;
else
{
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx
index 2a020e86a551..a301c7994915 100644
--- a/sfx2/source/control/msgpool.cxx
+++ b/sfx2/source/control/msgpool.cxx
@@ -54,10 +54,10 @@ struct SfxSIDRegistration_Impl
struct SfxSlotType_Impl
{
sal_uInt16 nId;
- TypeId nType;
+ const std::type_info& rType;
- SfxSlotType_Impl( sal_uInt16 nTheId, TypeId nTheType ):
- nId(nTheId), nType(nTheType)
+ SfxSlotType_Impl( sal_uInt16 nTheId, const std::type_info& rTheType ):
+ nId(nTheId), rType(rTheType)
{}
};
@@ -170,10 +170,10 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface )
//====================================================================
-TypeId SfxSlotPool::GetSlotType( sal_uInt16 nId ) const
+const std::type_info& SfxSlotPool::GetSlotType( sal_uInt16 nId ) const
{
const SfxSlot* pSlot = (const_cast <SfxSlotPool*> (this))->GetSlot( nId );
- return pSlot ? pSlot->GetType()->Type() : 0;
+ return pSlot ? pSlot->GetType()->Type() : typeid(void);
/*
for ( sal_uInt16 nPos = 0; nPos < _pTypes->Count(); ++nPos )
{
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 26ac4b7d1779..ebf16fab2e91 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -107,7 +107,7 @@ struct SfxRequest_Impl: public SfxListener
void SfxRequest_Impl::Notify( SfxBroadcaster&, const SfxHint &rHint )
{
- SfxSimpleHint *pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
+ const SfxSimpleHint *pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint);
if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
pAnti->Cancel();
}
@@ -466,12 +466,10 @@ void SfxRequest::RemoveItem( sal_uInt16 nID )
const SfxPoolItem* SfxRequest::GetArg
(
- sal_uInt16 nSlotId, // Slot-Id oder Which-Id des Parameters
- bool bDeep, // false: nicht in Parent-ItemSets suchen
- TypeId aType // != 0: RTTI Pruefung mit Assertion
+ sal_uInt16 nSlotId // Slot-Id oder Which-Id des Parameters
) const
{
- return GetItem( pArgs, nSlotId, bDeep, aType );
+ return GetItem( pArgs, nSlotId );
}
@@ -479,9 +477,7 @@ const SfxPoolItem* SfxRequest::GetArg
const SfxPoolItem* SfxRequest::GetItem
(
const SfxItemSet* pArgs,
- sal_uInt16 nSlotId, // Slot-Id oder Which-Id des Parameters
- bool bDeep, // false: nicht in Parent-ItemSets suchen
- TypeId aType // != 0: RTTI Pruefung mit Assertion
+ sal_uInt16 nSlotId // Slot-Id oder Which-Id des Parameters
)
/* [Beschreibung]
@@ -509,7 +505,7 @@ const SfxPoolItem* SfxRequest::GetItem
sal_uInt16 nPos = pPosItem ? pPosItem->GetValue() : 0;
// ein Beispiel mit Verwendung des Makros
- SFX_REQUEST_ARG(rReq, pSizeItem, SfxInt32Item, SID_SIZE, sal_False);
+ SFX_REQUEST_ARG(rReq, pSizeItem, SfxInt32Item, SID_SIZE );
sal_uInt16 nSize = pSizeItem ? pPosItem->GetValue() : 0;
...
@@ -521,27 +517,18 @@ const SfxPoolItem* SfxRequest::GetItem
*/
{
+ const SfxPoolItem *pItem = 0;
+
if ( pArgs )
{
// ggf. in Which-Id umrechnen
sal_uInt16 nWhich = pArgs->GetPool()->GetWhich(nSlotId);
- // ist das Item gesetzt oder bei bDeep==TRUE verf"ugbar?
- const SfxPoolItem *pItem = 0;
- if ( ( bDeep ? SFX_ITEM_AVAILABLE : SFX_ITEM_SET )
- <= pArgs->GetItemState( nWhich, bDeep, &pItem ) )
- {
- // stimmt der Typ "uberein?
- if ( !pItem || pItem->IsA(aType) )
- return pItem;
-
- // Item da aber falsch => Programmierfehler
- DBG_ERROR( "invalid argument type" );
- }
+ // ist das Item gesetzt ?
+ pArgs->GetItemState( nWhich, sal_False, &pItem );
}
- // keine Parameter, nicht gefunden oder falschen Typ gefunden
- return 0;
+ return pItem;
}
//--------------------------------------------------------------------
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index eaa1d96c3044..c1475f8f1798 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -58,9 +58,6 @@ DBG_NAME(SfxShell)
//====================================================================
-TYPEINIT0(SfxShell);
-
-//====================================================================
typedef SfxSlot* SfxSlotPtr;
SV_DECL_PTRARR_DEL( SfxVerbSlotArr_Impl, SfxSlotPtr, 4, 4)
SV_IMPL_PTRARR( SfxVerbSlotArr_Impl, SfxSlotPtr);
@@ -102,10 +99,10 @@ String SfxShellIdent_Impl( const SfxShell *pSh )
*/
{
- String aIdent( pSh->ISA(SfxApplication) ? DEFINE_CONST_UNICODE("SfxApplication") :
- pSh->ISA(SfxViewFrame) ? DEFINE_CONST_UNICODE("SfxViewFrame") :
- pSh->ISA(SfxViewShell) ? DEFINE_CONST_UNICODE("SfxViewShell") :
- pSh->ISA(SfxObjectShell) ? DEFINE_CONST_UNICODE("SfxObjectShell") : DEFINE_CONST_UNICODE("SfxShell") );
+ String aIdent( dynamic_cast< const SfxApplication* >(pSh) ? DEFINE_CONST_UNICODE("SfxApplication") :
+ dynamic_cast< const SfxViewFrame* >(pSh) ? DEFINE_CONST_UNICODE("SfxViewFrame") :
+ dynamic_cast< const SfxViewShell* >(pSh) ? DEFINE_CONST_UNICODE("SfxViewShell") :
+ dynamic_cast< const SfxObjectShell* >(pSh) ? DEFINE_CONST_UNICODE("SfxObjectShell") : DEFINE_CONST_UNICODE("SfxShell") );
aIdent += '[';
aIdent += pSh->GetName();
aIdent += ']';
@@ -401,7 +398,7 @@ void SfxShell::PutItem
*/
{
- DBG_ASSERT( !rItem.ISA(SfxSetItem), "SetItems aren't allowed here" );
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(&rItem), "SetItems aren't allowed here" );
DBG_ASSERT( SfxItemPool::IsSlot( rItem.Which() ),
"items with Which-Ids aren't allowed here" );
@@ -1074,7 +1071,7 @@ SFX_STATE_STUB(SfxShell, VerbState)
void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& aVerbs)
{
- SfxViewShell *pViewSh = PTR_CAST ( SfxViewShell, this);
+ SfxViewShell *pViewSh = dynamic_cast< SfxViewShell* >( this);
DBG_ASSERT(pViewSh, "SetVerbs nur an der ViewShell aufrufen!");
if ( !pViewSh )
diff --git a/sfx2/source/control/sorgitm.cxx b/sfx2/source/control/sorgitm.cxx
index 6c42b4743647..9a6a3392f06f 100644
--- a/sfx2/source/control/sorgitm.cxx
+++ b/sfx2/source/control/sorgitm.cxx
@@ -28,10 +28,6 @@
#include "sorgitm.hxx"
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SfxScriptOrganizerItem, SfxStringItem);
-
-//------------------------------------------------------------------------
-
SfxScriptOrganizerItem::SfxScriptOrganizerItem() :
SfxStringItem()
@@ -78,9 +74,11 @@ SfxPoolItem* SfxScriptOrganizerItem::Clone( SfxItemPool * ) const
int SfxScriptOrganizerItem::operator==( const SfxPoolItem& rItem) const
{
- return rItem.Type() == Type() &&
+ const SfxScriptOrganizerItem* pSfxScriptOrganizerItem = dynamic_cast< const SfxScriptOrganizerItem* >(&rItem);
+
+ return pSfxScriptOrganizerItem &&
SfxStringItem::operator==(rItem) &&
- aLanguage == ((const SfxScriptOrganizerItem &)rItem).aLanguage;
+ aLanguage == pSfxScriptOrganizerItem->aLanguage;
}
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index 21e1aef79228..91a8363699df 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -460,7 +460,7 @@ void SfxStateCache::SetState_Impl
!IsInvalidItem(pState) && !IsInvalidItem(pLastItem);
DBG_ASSERT( !bBothAvailable || pState != pLastItem, "setting state with own item" );
if ( bBothAvailable )
- bNotify = pState->Type() != pLastItem->Type() ||
+ bNotify = typeid(*pState) != typeid(*pLastItem) ||
*pState != *pLastItem;
else
bNotify = ( pState != pLastItem ) || ( eState != eLastState );
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 2b3053169478..6e05a661c28d 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -845,7 +845,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
// aEvent.State = com::sun::star::frame::DispatchResultState::DONTKNOW;
aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;
- if ( bSuccess && pItem && !pItem->ISA(SfxVoidItem) )
+ if ( bSuccess && pItem && !dynamic_cast< const SfxVoidItem* >(pItem) )
{
sal_uInt16 nSubId( 0 );
if ( eMapUnit == SFX_MAPUNIT_TWIP )
@@ -926,11 +926,11 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
sal_Bool bNotify = sal_True;
if ( pState && !IsInvalidItem( pState ) )
{
- if ( !pState->ISA( SfxVisibilityItem ) )
+ if ( !dynamic_cast< const SfxVisibilityItem* >(pState) )
{
sal_Bool bBothAvailable = pLastState && !IsInvalidItem(pLastState);
if ( bBothAvailable )
- bNotify = pState->Type() != pLastState->Type() || *pState != *pLastState;
+ bNotify = typeid(*pState) != typeid(*pLastState) || *pState != *pLastState;
if ( pLastState && !IsInvalidItem( pLastState ) )
delete pLastState;
pLastState = !IsInvalidItem(pState) ? pState->Clone() : pState;
@@ -950,7 +950,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
if ( bNotify && pContnr )
{
::com::sun::star::uno::Any aState;
- if ( ( eState >= SFX_ITEM_AVAILABLE ) && pState && !IsInvalidItem( pState ) && !pState->ISA(SfxVoidItem) )
+ if ( ( eState >= SFX_ITEM_AVAILABLE ) && pState && !IsInvalidItem( pState ) && !dynamic_cast< const SfxVoidItem* >(pState) )
{
// Retrieve metric from pool to have correct sub ID when calling QueryValue
sal_uInt16 nSubId( 0 );
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 6ec0758f7f62..3363705fbe2c 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -66,9 +66,11 @@ public:
void SfxModelessDialog_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSfxSimpleHint->GetId() )
{
case SFX_HINT_DYING:
pMgr->Destroy();
@@ -90,9 +92,11 @@ public:
void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSfxSimpleHint->GetId() )
{
case SFX_HINT_DYING:
pMgr->Destroy();
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 4c71213bcf89..ef1e0e7c8fe3 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -111,8 +111,6 @@ bool operator==(const util::DateTime &i_rLeft, const util::DateTime &i_rRight)
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SfxDocumentInfoItem, SfxStringItem);
-
const sal_uInt16 HI_NAME = 1;
const sal_uInt16 HI_TYPE = 2;
const sal_uInt16 HI_VALUE = 3;
@@ -340,32 +338,32 @@ SfxPoolItem* SfxDocumentInfoItem::Clone( SfxItemPool * ) const
int SfxDocumentInfoItem::operator==( const SfxPoolItem& rItem) const
{
- if (!(rItem.Type() == Type() && SfxStringItem::operator==(rItem))) {
+ const SfxDocumentInfoItem* pSfxDocumentInfoItem = dynamic_cast< const SfxDocumentInfoItem* >(&rItem);
+
+ if(!pSfxDocumentInfoItem || !SfxStringItem::operator==(rItem))
+ {
return false;
}
- const SfxDocumentInfoItem& rInfoItem(
- static_cast<const SfxDocumentInfoItem&>(rItem));
return
- m_AutoloadDelay == rInfoItem.m_AutoloadDelay &&
- m_AutoloadURL == rInfoItem.m_AutoloadURL &&
- m_isAutoloadEnabled == rInfoItem.m_isAutoloadEnabled &&
- m_DefaultTarget == rInfoItem.m_DefaultTarget &&
- m_Author == rInfoItem.m_Author &&
- m_CreationDate == rInfoItem.m_CreationDate &&
- m_ModifiedBy == rInfoItem.m_ModifiedBy &&
- m_ModificationDate == rInfoItem.m_ModificationDate &&
- m_PrintedBy == rInfoItem.m_PrintedBy &&
- m_PrintDate == rInfoItem.m_PrintDate &&
- m_EditingCycles == rInfoItem.m_EditingCycles &&
- m_EditingDuration == rInfoItem.m_EditingDuration &&
- m_Description == rInfoItem.m_Description &&
- m_Keywords == rInfoItem.m_Keywords &&
- m_Subject == rInfoItem.m_Subject &&
- m_Title == rInfoItem.m_Title &&
- m_aCustomProperties.size() == rInfoItem.m_aCustomProperties.size() &&
- std::equal(m_aCustomProperties.begin(), m_aCustomProperties.end(),
- rInfoItem.m_aCustomProperties.begin());
+ m_AutoloadDelay == pSfxDocumentInfoItem->m_AutoloadDelay &&
+ m_AutoloadURL == pSfxDocumentInfoItem->m_AutoloadURL &&
+ m_isAutoloadEnabled == pSfxDocumentInfoItem->m_isAutoloadEnabled &&
+ m_DefaultTarget == pSfxDocumentInfoItem->m_DefaultTarget &&
+ m_Author == pSfxDocumentInfoItem->m_Author &&
+ m_CreationDate == pSfxDocumentInfoItem->m_CreationDate &&
+ m_ModifiedBy == pSfxDocumentInfoItem->m_ModifiedBy &&
+ m_ModificationDate == pSfxDocumentInfoItem->m_ModificationDate &&
+ m_PrintedBy == pSfxDocumentInfoItem->m_PrintedBy &&
+ m_PrintDate == pSfxDocumentInfoItem->m_PrintDate &&
+ m_EditingCycles == pSfxDocumentInfoItem->m_EditingCycles &&
+ m_EditingDuration == pSfxDocumentInfoItem->m_EditingDuration &&
+ m_Description == pSfxDocumentInfoItem->m_Description &&
+ m_Keywords == pSfxDocumentInfoItem->m_Keywords &&
+ m_Subject == pSfxDocumentInfoItem->m_Subject &&
+ m_Title == pSfxDocumentInfoItem->m_Title &&
+ m_aCustomProperties.size() == pSfxDocumentInfoItem->m_aCustomProperties.size() &&
+ std::equal(m_aCustomProperties.begin(), m_aCustomProperties.end(), pSfxDocumentInfoItem->m_aCustomProperties.begin());
}
//------------------------------------------------------------------------
@@ -734,7 +732,7 @@ void SfxDocumentDescPage::Reset(const SfxItemSet &rSet)
aKeywordsEd.SetText( pInfoItem->getKeywords() );
aCommentEd.SetText( pInfoItem->getDescription() );
- SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY );
if ( pROItem && pROItem->GetValue() )
{
aTitleEd.SetReadOnly( sal_True );
@@ -1072,7 +1070,7 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
}
else
{
- DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ), "SfxDocumentPage:<SfxStringItem> erwartet" );
+ DBG_ASSERT( dynamic_cast< const SfxStringItem* >(pItem), "SfxDocumentPage:<SfxStringItem> erwartet" );
aName = ( ( SfxStringItem* ) pItem )->GetValue();
}
aNameED.SetText( aName );
@@ -1432,7 +1430,7 @@ SfxTabPage *SfxInternetPage::Create( Window* pParent, const SfxItemSet& rItemSet
void SfxInternetPage::Reset( const SfxItemSet& rSet )
{
pInfoItem = &( SfxDocumentInfoItem& ) rSet.Get( SID_DOCINFO );
- SFX_ITEMSET_ARG( &rSet, pURLItem, SfxStringItem, SID_BASEURL, sal_False );
+ SFX_ITEMSET_ARG( &rSet, pURLItem, SfxStringItem, SID_BASEURL );
DBG_ASSERT( pURLItem, "No BaseURL provided for InternetTabPage!" );
if ( pURLItem )
aBaseURL = pURLItem->GetValue();
@@ -1460,7 +1458,7 @@ void SfxInternetPage::Reset( const SfxItemSet& rSet )
ChangeState( eNewState );
// #102907# ------------------------
- SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY );
if ( pROItem && pROItem->GetValue() )
{
aRBNoAutoUpdate.Disable();
@@ -1511,7 +1509,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
&(const SfxDocumentInfoItem &)rItemSet.Get( SID_DOCINFO );
#ifdef DBG_UTIL
- SFX_ITEMSET_ARG( &rItemSet, pURLItem, SfxStringItem, SID_BASEURL, sal_False );
+ SFX_ITEMSET_ARG( &rItemSet, pURLItem, SfxStringItem, SID_BASEURL );
DBG_ASSERT( pURLItem, "No BaseURL provided for InternetTabPage!" );
#endif
@@ -1540,8 +1538,7 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
}
else
{
- DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ),
- "SfxDocumentInfoDialog:<SfxStringItem> erwartet" );
+ DBG_ASSERT( dynamic_cast< const SfxStringItem* >(pItem), "SfxDocumentInfoDialog:<SfxStringItem> erwartet" );
aTitle += ( ( SfxStringItem* ) pItem )->GetValue();
}
SetText( aTitle );
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 0a945ac8652d..8d194ac5bfb9 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1520,15 +1520,15 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
// check password checkbox if the document had password before
if( mbHasPassword )
{
- SFX_ITEMSET_ARG( rpSet, pPassItem, SfxBoolItem, SID_PASSWORDINTERACTION, sal_False );
+ SFX_ITEMSET_ARG( rpSet, pPassItem, SfxBoolItem, SID_PASSWORDINTERACTION );
mbPwdCheckBoxState = ( pPassItem != NULL && pPassItem->GetValue() );
// in case the document has password to modify, the dialog should be shown
- SFX_ITEMSET_ARG( rpSet, pPassToModifyItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO, sal_False );
+ SFX_ITEMSET_ARG( rpSet, pPassToModifyItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO);
mbPwdCheckBoxState |= ( pPassToModifyItem && pPassToModifyItem->GetValue().hasValue() );
}
- SFX_ITEMSET_ARG( rpSet, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False );
+ SFX_ITEMSET_ARG( rpSet, pSelectItem, SfxBoolItem, SID_SELECTION );
if ( pSelectItem )
mbSelection = pSelectItem->GetValue();
else
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index b37aa2314a06..87bb670c0362 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -60,8 +60,6 @@ using namespace ::rtl;
#define USERITEM_NAME OUString::createFromAscii( "UserItem" )
-TYPEINIT1(LAYOUT_NS_SFX_TABDIALOG SfxTabDialogItem,SfxSetItem);
-
struct TabPageImpl
{
sal_Bool mbStandard;
@@ -165,7 +163,7 @@ IMPL_LINK( SfxTabDialogController, Execute_Impl, void*, pVoid )
void SfxTabDialogController::StateChanged( sal_uInt16 /*nSID*/, SfxItemState /*eState*/, const SfxPoolItem* pState )
{
- const SfxSetItem* pSetItem = PTR_CAST( SfxSetItem, pState );
+ const SfxSetItem* pSetItem = dynamic_cast< const SfxSetItem* >( pState );
if ( pSetItem )
{
pSet = pDialog->pSet = pSetItem->GetItemSet().Clone();
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index d72311bc72a0..4b9fc267912c 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -100,10 +100,6 @@ static sal_uInt16 nLastItemId = USHRT_MAX;
//=========================================================================
-TYPEINIT0(SfxCommonTemplateDialog_Impl);
-TYPEINIT1(SfxTemplateDialog_Impl,SfxCommonTemplateDialog_Impl);
-TYPEINIT1(SfxTemplateCatalog_Impl,SfxCommonTemplateDialog_Impl);
-
SFX_IMPL_DOCKINGWINDOW(SfxTemplateDialogWrapper, SID_STYLE_DESIGNER)
//-------------------------------------------------------------------------
@@ -1568,9 +1564,14 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, TimeOut, Timer *, pTim )
void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
// Aktualisierung anstossen
- if(rHint.Type() == TYPE(SfxSimpleHint))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+ sal_uLong nId(0);
+
+ if(pSfxSimpleHint)
{
- switch(((SfxSimpleHint&) rHint ).GetId())
+ nId = pSfxSimpleHint->GetId();
+
+ switch(nId)
{
case SFX_HINT_UPDATEDONE:
{
@@ -1631,13 +1632,10 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
// Timer nicht aufsetzen, wenn der StyleSheetPool in die Kiste geht, denn
// es kann sein, da\s sich ein neuer erst anmeldet, nachdem der Timer
// abgelaufen ist - macht sich schlecht in UpdateStyles_Impl() !
-
- sal_uIntPtr nId = rHint.ISA(SfxSimpleHint) ? ( (SfxSimpleHint&)rHint ).GetId() : 0;
-
if(!bDontUpdate && nId != SFX_HINT_DYING &&
- (rHint.Type() == TYPE(SfxStyleSheetPoolHint)||
- rHint.Type() == TYPE(SfxStyleSheetHint) ||
- rHint.Type() == TYPE( SfxStyleSheetHintExtended )))
+ (dynamic_cast< const SfxStyleSheetPoolHint* >(&rHint)||
+ dynamic_cast< const SfxStyleSheetHint* >(&rHint) ||
+ dynamic_cast< const SfxStyleSheetHintExtended* >(&rHint)))
{
if(!pTimer)
{
@@ -1730,7 +1728,7 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl(
if ( nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId )
{
- SfxUInt16Item *pFilterItem = PTR_CAST(SfxUInt16Item, pItem);
+ const SfxUInt16Item *pFilterItem = dynamic_cast< const SfxUInt16Item* >( pItem);
DBG_ASSERT(pFilterItem, "SfxUINT16Item erwartet");
sal_uInt16 nFilterFlags = pFilterItem->GetValue() & ~SFXSTYLEBIT_USERDEF;
if(!nFilterFlags) // Benutzervorlage?
@@ -1991,7 +1989,7 @@ void SfxCommonTemplateDialog_Impl::NewHdl(void *)
{
Window* pTmp;
pTmp = Application::GetDefDialogParent();
- if ( ISA(SfxTemplateDialog_Impl) )
+ if ( dynamic_cast< SfxTemplateDialog_Impl* >(this) )
Application::SetDefDialogParent( pWindow->GetParent() );
else
Application::SetDefDialogParent( pWindow );
@@ -2058,7 +2056,7 @@ void SfxCommonTemplateDialog_Impl::EditHdl(void *)
//DefModalDialogParent setzen fuer
//Modalitaet der nachfolgenden Dialoge
pTmp = Application::GetDefDialogParent();
- if ( ISA(SfxTemplateDialog_Impl) )
+ if ( dynamic_cast< SfxTemplateDialog_Impl* >(this) )
Application::SetDefDialogParent( pWindow->GetParent() );
else
Application::SetDefDialogParent( pWindow );
@@ -2166,7 +2164,7 @@ void SfxCommonTemplateDialog_Impl::EnableDelete()
// setzen
void SfxCommonTemplateDialog_Impl::ResetFocus()
{
- if(ISA(SfxTemplateDialog_Impl))
+ if(dynamic_cast< SfxTemplateDialog_Impl* >(this))
{
SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
SfxViewShell *pVu = pViewFrame->GetViewShell();
@@ -2191,7 +2189,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, ApplyHdl, Control *, pControl )
GetSelectedEntry(), String(),
( sal_uInt16 )GetFamilyItem_Impl()->GetFamily(),
0, 0, &nModifier );
- if(ISA(SfxTemplateCatalog_Impl))
+ if(dynamic_cast< SfxTemplateCatalog_Impl* >(this))
((SfxTemplateCatalog_Impl*) this)->pReal->EndDialog(RET_OK);
}
ResetFocus();
diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx
index ec61e145c6ed..84a5d900c41d 100644
--- a/sfx2/source/dialog/tplcitem.cxx
+++ b/sfx2/source/dialog/tplcitem.cxx
@@ -79,8 +79,7 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta
if ( !bAvailable )
rTemplateDlg.SetFamilyState(GetId(), 0);
else {
- const SfxTemplateItem *pStateItem = PTR_CAST(
- SfxTemplateItem, pItem);
+ const SfxTemplateItem *pStateItem = dynamic_cast< const SfxTemplateItem* >( pItem);
DBG_ASSERT(pStateItem != 0, "SfxTemplateItem erwartet");
rTemplateDlg.SetFamilyState( GetId(), pStateItem );
}
@@ -110,7 +109,7 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta
nWaterCanState = 0xff;
else if( eState == SFX_ITEM_AVAILABLE )
{
- const SfxBoolItem *pStateItem = PTR_CAST(SfxBoolItem, pItem);
+ const SfxBoolItem *pStateItem = dynamic_cast< const SfxBoolItem* >( pItem);
DBG_ASSERT(pStateItem != 0, "BoolItem erwartet");
nWaterCanState = pStateItem->GetValue() ? 1 : 0;
}
@@ -152,7 +151,7 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta
}
case SID_STYLE_FAMILY :
{
- const SfxUInt16Item *pStateItem = PTR_CAST( SfxUInt16Item, pItem);
+ const SfxUInt16Item *pStateItem = dynamic_cast< const SfxUInt16Item* >( pItem);
if (pStateItem)
rTemplateDlg.SetFamily( pStateItem->GetValue() );
break;
diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx
index 7f69b1b11c58..2dff0f491aed 100644
--- a/sfx2/source/dialog/tplpitem.cxx
+++ b/sfx2/source/dialog/tplpitem.cxx
@@ -32,9 +32,7 @@
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SfxTemplateItem, SfxFlagItem);
-
-//=========================================================================
+IMPL_POOLITEM_FACTORY(SfxTemplateItem)
SfxTemplateItem::SfxTemplateItem() :
SfxFlagItem()
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 72b9ae0bcf0c..9df574f5901e 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -452,8 +452,8 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
aSet.Put( SfxStringItem( SID_FILE_NAME, pObjShell->GetMedium()->GetName() ) );
SfxItemSet* pSet = pObjShell->GetMedium()->GetItemSet();
- SFX_ITEMSET_ARG( pSet, pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False );
- SFX_ITEMSET_ARG( pSet, pFilterOptItem, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
+ SFX_ITEMSET_ARG( pSet, pFilterItem, SfxStringItem, SID_FILTER_NAME );
+ SFX_ITEMSET_ARG( pSet, pFilterOptItem, SfxStringItem, SID_FILE_FILTEROPTIONS );
if ( pFilterItem )
aSet.Put( *pFilterItem );
if ( pFilterOptItem )
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 2bca9f974e57..dc124dbc1d7e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -518,7 +518,7 @@ Reference < XContent > SfxMedium::GetContent() const
Reference < ::com::sun::star::ucb::XContent > xContent;
Reference < ::com::sun::star::ucb::XCommandEnvironment > xEnv;
- SFX_ITEMSET_ARG( pSet, pItem, SfxUnoAnyItem, SID_CONTENT, sal_False);
+ SFX_ITEMSET_ARG( pSet, pItem, SfxUnoAnyItem, SID_CONTENT );
if ( pItem )
pItem->GetValue() >>= xContent;
@@ -805,12 +805,12 @@ Link SfxMedium::GetDoneLink() const
sal_Bool SfxMedium::IsPreview_Impl()
{
sal_Bool bPreview = sal_False;
- SFX_ITEMSET_ARG( GetItemSet(), pPreview, SfxBoolItem, SID_PREVIEW, sal_False);
+ SFX_ITEMSET_ARG( GetItemSet(), pPreview, SfxBoolItem, SID_PREVIEW );
if ( pPreview )
bPreview = pPreview->GetValue();
else
{
- SFX_ITEMSET_ARG( GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
+ SFX_ITEMSET_ARG( GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS );
if ( pFlags )
{
String aFileFlags = pFlags->GetValue();
@@ -1032,7 +1032,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
if ( !bResult )
{
// no read-write access is necessary on loading if the document is explicitly opened as copy
- SFX_ITEMSET_ARG( GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
+ SFX_ITEMSET_ARG( GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE );
bResult = ( bLoading && pTemplateItem && pTemplateItem->GetValue() );
}
@@ -1221,7 +1221,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
// the error should be set in case it is storing process
// or the document has been opened for editing explicitly
- SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY );
if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) )
SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
else
@@ -1255,7 +1255,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf
if ( GetError() )
return pImp->xStorage;
- SFX_ITEMSET_ARG( GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False);
+ SFX_ITEMSET_ARG( GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE );
if ( pRepairItem && pRepairItem->GetValue() )
{
// the storage should be created for repairing mode
@@ -1265,7 +1265,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf
Reference< ::com::sun::star::ucb::XProgressHandler > xProgressHandler;
Reference< ::com::sun::star::task::XStatusIndicator > xStatusIndicator;
- SFX_ITEMSET_ARG( GetItemSet(), pxProgressItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL, sal_False );
+ SFX_ITEMSET_ARG( GetItemSet(), pxProgressItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL );
if( pxProgressItem && ( pxProgressItem->GetValue() >>= xStatusIndicator ) )
xProgressHandler = Reference< ::com::sun::star::ucb::XProgressHandler >(
new utl::ProgressHandlerWrap( xStatusIndicator ) );
@@ -1331,7 +1331,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf
GetVersionList();
}
- SFX_ITEMSET_ARG( pSet, pVersion, SfxInt16Item, SID_VERSION, sal_False);
+ SFX_ITEMSET_ARG( pSet, pVersion, SfxInt16Item, SID_VERSION );
sal_Bool bResetStorage = sal_False;
if ( pVersion && pVersion->GetValue() )
@@ -1639,8 +1639,8 @@ sal_Bool SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource,
if( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, aTempCont ) )
{
sal_Bool bTransactStarted = sal_False;
- SFX_ITEMSET_ARG( GetItemSet(), pOverWrite, SfxBoolItem, SID_OVERWRITE, sal_False );
- SFX_ITEMSET_ARG( GetItemSet(), pRename, SfxBoolItem, SID_RENAME, sal_False );
+ SFX_ITEMSET_ARG( GetItemSet(), pOverWrite, SfxBoolItem, SID_OVERWRITE );
+ SFX_ITEMSET_ARG( GetItemSet(), pRename, SfxBoolItem, SID_RENAME );
sal_Bool bRename = pRename ? pRename->GetValue() : sal_False;
sal_Bool bOverWrite = pOverWrite ? pOverWrite->GetValue() : !bRename;
@@ -1726,14 +1726,14 @@ sal_Bool SfxMedium::TryDirectTransfer( const ::rtl::OUString& aURL, SfxItemSet&
// if the document had no password it should be stored without password
// if the document had password it should be stored with the same password
// otherwise the stream copying can not be done
- SFX_ITEMSET_ARG( &aTargetSet, pNewPassItem, SfxStringItem, SID_PASSWORD, sal_False );
- SFX_ITEMSET_ARG( GetItemSet(), pOldPassItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( &aTargetSet, pNewPassItem, SfxStringItem, SID_PASSWORD );
+ SFX_ITEMSET_ARG( GetItemSet(), pOldPassItem, SfxStringItem, SID_PASSWORD );
if ( ( !pNewPassItem && !pOldPassItem )
|| ( pNewPassItem && pOldPassItem && pNewPassItem->GetValue().Equals( pOldPassItem->GetValue() ) ) )
{
// the filter must be the same
- SFX_ITEMSET_ARG( &aTargetSet, pNewFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False );
- SFX_ITEMSET_ARG( GetItemSet(), pOldFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( &aTargetSet, pNewFilterItem, SfxStringItem, SID_FILTER_NAME );
+ SFX_ITEMSET_ARG( GetItemSet(), pOldFilterItem, SfxStringItem, SID_FILTER_NAME );
if ( pNewFilterItem && pOldFilterItem && pNewFilterItem->GetValue().Equals( pOldFilterItem->GetValue() ) )
{
// get the input stream and copy it
@@ -1758,8 +1758,8 @@ sal_Bool SfxMedium::TryDirectTransfer( const ::rtl::OUString& aURL, SfxItemSet&
InsertCommandArgument aInsertArg;
aInsertArg.Data = xInStream;
- SFX_ITEMSET_ARG( &aTargetSet, pRename, SfxBoolItem, SID_RENAME, sal_False );
- SFX_ITEMSET_ARG( &aTargetSet, pOverWrite, SfxBoolItem, SID_OVERWRITE, sal_False );
+ SFX_ITEMSET_ARG( &aTargetSet, pRename, SfxBoolItem, SID_RENAME );
+ SFX_ITEMSET_ARG( &aTargetSet, pOverWrite, SfxBoolItem, SID_OVERWRITE );
if ( (pOverWrite && !pOverWrite->GetValue()) // argument says: never overwrite
|| (pRename && pRename->GetValue()) ) // argument says: rename file
aInsertArg.ReplaceExisting = sal_False;
@@ -1811,7 +1811,7 @@ void SfxMedium::Transfer_Impl()
if( aLogicName.CompareToAscii( "private:stream", 14 ) == COMPARE_EQUAL )
{
// TODO/LATER: support storing to SID_STREAM
- SFX_ITEMSET_ARG( pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM, sal_False);
+ SFX_ITEMSET_ARG( pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM );
if( pOutStreamItem && ( pOutStreamItem->GetValue() >>= rOutStream ) )
{
if ( pImp->xStorage.is() )
@@ -1875,7 +1875,7 @@ void SfxMedium::Transfer_Impl()
return;
}
- SFX_ITEMSET_ARG( GetItemSet(), pSegmentSize, SfxInt32Item, SID_SEGMENTSIZE, sal_False);
+ SFX_ITEMSET_ARG( GetItemSet(), pSegmentSize, SfxInt32Item, SID_SEGMENTSIZE );
if ( pSegmentSize )
{
// this file must be stored into a disk spanned package
@@ -1965,8 +1965,8 @@ void SfxMedium::Transfer_Impl()
::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, aSourceContent );
// check for external parameters that may customize the handling of NameClash situations
- SFX_ITEMSET_ARG( GetItemSet(), pRename, SfxBoolItem, SID_RENAME, sal_False );
- SFX_ITEMSET_ARG( GetItemSet(), pOverWrite, SfxBoolItem, SID_OVERWRITE, sal_False );
+ SFX_ITEMSET_ARG( GetItemSet(), pRename, SfxBoolItem, SID_RENAME );
+ SFX_ITEMSET_ARG( GetItemSet(), pOverWrite, SfxBoolItem, SID_OVERWRITE );
sal_Int32 nNameClash;
if ( pOverWrite && !pOverWrite->GetValue() )
// argument says: never overwrite
@@ -2185,7 +2185,7 @@ void SfxMedium::GetLockingStream_Impl()
if ( ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
&& !pImp->m_xLockingStream.is() )
{
- SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False);
+ SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM );
if ( pWriteStreamItem )
pWriteStreamItem->GetValue() >>= pImp->m_xLockingStream;
@@ -2227,8 +2227,8 @@ void SfxMedium::GetMedium_Impl()
Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler = GetInteractionHandler();
//TODO/MBA: need support for SID_STREAM
- SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False);
- SFX_ITEMSET_ARG( pSet, pInStreamItem, SfxUnoAnyItem, SID_INPUTSTREAM, sal_False);
+ SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM );
+ SFX_ITEMSET_ARG( pSet, pInStreamItem, SfxUnoAnyItem, SID_INPUTSTREAM );
if ( pWriteStreamItem )
{
pWriteStreamItem->GetValue() >>= pImp->xStream;
@@ -2411,7 +2411,7 @@ void SfxMedium::Init_Impl()
// TODO/LATER: handle lifetime of storages
pImp->bDisposeStorage = sal_False;
- SFX_ITEMSET_ARG( pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ SFX_ITEMSET_ARG( pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if ( pSalvageItem && !pSalvageItem->GetValue().Len() )
{
pSalvageItem = NULL;
@@ -2453,7 +2453,7 @@ void SfxMedium::Init_Impl()
// in case output stream is by mistake here
// clear the reference
- SFX_ITEMSET_ARG( pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM, sal_False);
+ SFX_ITEMSET_ARG( pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM );
if( pOutStreamItem
&& ( !( pOutStreamItem->GetValue() >>= rOutStream )
|| !aLogicName.CompareToAscii( "private:stream", 14 ) == COMPARE_EQUAL ) )
@@ -2465,7 +2465,7 @@ void SfxMedium::Init_Impl()
if ( aLogicName.Len() )
{
// if the logic name is set it should be set in MediaDescriptor as well
- SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME );
if ( !pFileNameItem )
{
// let the ItemSet be created if necessary
@@ -2529,7 +2529,7 @@ SfxMedium::GetInteractionHandler()
if ( pSet )
{
::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > xHandler;
- SFX_ITEMSET_ARG( pSet, pHandler, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False);
+ SFX_ITEMSET_ARG( pSet, pHandler, SfxUnoAnyItem, SID_INTERACTIONHANDLER );
if ( pHandler && (pHandler->GetValue() >>= xHandler) && xHandler.is() )
return xHandler;
}
@@ -2958,13 +2958,13 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
TransformParameters( SID_OPENDOC, aArgs, *pParams );
String aFilterName;
- SFX_ITEMSET_ARG( pSet, pFilterNameItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( pSet, pFilterNameItem, SfxStringItem, SID_FILTER_NAME );
if( pFilterNameItem )
aFilterName = pFilterNameItem->GetValue();
pFilter = SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aFilterName );
sal_Bool bSalvage = sal_False;
- SFX_ITEMSET_ARG( pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
+ SFX_ITEMSET_ARG( pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if( pSalvageItem )
{
// QUESTION: there is some treatment of Salvage in Init_Impl; align!
@@ -2974,7 +2974,7 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
// if an URL is provided in SalvageItem that means that the FileName refers to a temporary file
// that must be copied here
- SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME );
if (!pFileNameItem) throw uno::RuntimeException();
::rtl::OUString aNewTempFileURL = SfxMedium::CreateTempCopyWithExt( pFileNameItem->GetValue() );
if ( aNewTempFileURL.getLength() )
@@ -2992,11 +2992,11 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
}
sal_Bool bReadOnly = sal_False;
- SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY );
if ( pReadOnlyItem && pReadOnlyItem->GetValue() )
bReadOnly = sal_True;
- SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME );
if (!pFileNameItem) throw uno::RuntimeException();
aLogicName = pFileNameItem->GetValue();
nStorOpenMode = bReadOnly ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE;
@@ -3406,7 +3406,7 @@ sal_Bool SfxMedium::IsReadOnly()
// c) the API can force the readonly state!
if (!bReadOnly)
{
- SFX_ITEMSET_ARG( GetItemSet(), pItem, SfxBoolItem, SID_DOC_READONLY, sal_False);
+ SFX_ITEMSET_ARG( GetItemSet(), pItem, SfxBoolItem, SID_DOC_READONLY );
if (pItem)
bReadOnly = pItem->GetValue();
}
@@ -3848,7 +3848,7 @@ sal_Bool SfxMedium::CallApproveHandler( const uno::Reference< task::XInteraction
// remove the readonly state
sal_Bool bWasReadonly = sal_False;
nStorOpenMode = SFX_STREAM_READWRITE;
- SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY );
if ( pReadOnlyItem && pReadOnlyItem->GetValue() )
bWasReadonly = sal_True;
GetItemSet()->ClearItem( SID_DOC_READONLY );
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index 3166b95c7809..785faf096966 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -288,8 +288,6 @@ int SfxFrameProperties::operator ==( const SfxFrameProperties& rProp ) const
bResizable == rProp.bResizable && bSetResizable == rProp.bSetResizable;
}
-TYPEINIT1(SfxFrameDescriptorItem, SfxPoolItem);
-
SfxFrameDescriptorItem::~SfxFrameDescriptorItem()
{}
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index ab50c0d62840..8f4028122410 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -997,7 +997,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
// the following two arguments can not be converted in MediaDescriptor,
// so they should be removed from the ItemSet after retrieving
- SFX_ITEMSET_ARG( pDialogParams, pRecommendReadOnly, SfxBoolItem, SID_RECOMMENDREADONLY, sal_False );
+ SFX_ITEMSET_ARG( pDialogParams, pRecommendReadOnly, SfxBoolItem, SID_RECOMMENDREADONLY);
m_bRecommendReadOnly = ( pRecommendReadOnly && pRecommendReadOnly->GetValue() );
pDialogParams->ClearItem( SID_RECOMMENDREADONLY );
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 5529d3951d09..01e49b26c58e 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -968,7 +968,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
if ( !pFile->GetFilter() || !pFile->GetFilter()->IsOwnFormat() )
return;
- SFX_ITEMSET_ARG( pFile->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( pFile->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE );
sal_Int16 bCanUpdateFromTemplate = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
// created from template?
diff --git a/sfx2/source/doc/objitem.cxx b/sfx2/source/doc/objitem.cxx
index da156bf65fcf..20a06fa5725f 100644
--- a/sfx2/source/doc/objitem.cxx
+++ b/sfx2/source/doc/objitem.cxx
@@ -33,15 +33,11 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
//====================================================================
-
-TYPEINIT1_AUTOFACTORY(SfxObjectShellItem,SfxPoolItem)
-TYPEINIT1_AUTOFACTORY(SfxObjectItem,SfxPoolItem)
-
-//=========================================================================
+IMPL_POOLITEM_FACTORY(SfxObjectShellItem)
int SfxObjectShellItem::operator==( const SfxPoolItem &rItem ) const
{
- return PTR_CAST(SfxObjectShellItem, &rItem)->pObjSh == pObjSh;
+ return dynamic_cast< const SfxObjectShellItem* >( &rItem)->pObjSh == pObjSh;
}
//--------------------------------------------------------------------
@@ -110,6 +106,7 @@ sal_Bool SfxObjectShellItem::PutValue( const com::sun::star::uno::Any& rVal, sal
//=========================================================================
+IMPL_POOLITEM_FACTORY(SfxObjectItem)
SfxObjectItem::SfxObjectItem( sal_uInt16 nWhichId, SfxShell *pSh )
: SfxPoolItem( nWhichId ),
_pSh( pSh )
@@ -119,7 +116,7 @@ SfxObjectItem::SfxObjectItem( sal_uInt16 nWhichId, SfxShell *pSh )
int SfxObjectItem::operator==( const SfxPoolItem &rItem ) const
{
- SfxObjectItem *pOther = PTR_CAST(SfxObjectItem, &rItem);
+ const SfxObjectItem *pOther = dynamic_cast< const SfxObjectItem* >( &rItem);
return pOther->_pSh == _pSh;
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index dd0703fc5348..de775f37fb3b 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -580,7 +580,7 @@ sal_Bool SfxObjectShell::SwitchToShared( sal_Bool bShared, sal_Bool bSave )
{
// TODO/LATER: currently the application guards against the reentrance problem
const SfxPoolItem* pItem = pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : SID_SAVEASDOC );
- SfxBoolItem* pResult = PTR_CAST( SfxBoolItem, pItem );
+ const SfxBoolItem* pResult = dynamic_cast< const SfxBoolItem* >( pItem );
bResult = ( pResult && pResult->GetValue() );
if ( bResult )
aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
@@ -614,7 +614,7 @@ sal_Bool SfxObjectShell::SwitchToShared( sal_Bool bShared, sal_Bool bSave )
// TODO/LATER: currently the application guards against the reentrance problem
SetModified( sal_True ); // the modified flag has to be set to let the document be stored with the shared flag
const SfxPoolItem* pItem = pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : SID_SAVEASDOC );
- SfxBoolItem* pResult = PTR_CAST( SfxBoolItem, pItem );
+ const SfxBoolItem* pResult = dynamic_cast< const SfxBoolItem* >( pItem );
bResult = ( pResult && pResult->GetValue() );
}
}
@@ -951,7 +951,7 @@ String SfxObjectShell::GetTitle
if ( pMed )
{
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pNameItem, SfxStringItem, SID_DOCINFO_TITLE, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pNameItem, SfxStringItem, SID_DOCINFO_TITLE );
if ( pNameItem )
aTitle = pNameItem->GetValue();
}
@@ -979,7 +979,7 @@ String SfxObjectShell::GetTitle
// wichtig bei URLs, die INET_PROT_FILE verwenden, denn bei denen
// wird der gesetzte Titel nicht beachtet.
// (s.u., Auswertung von aTitleMap_Impl)
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pNameItem, SfxStringItem, SID_DOCINFO_TITLE, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pNameItem, SfxStringItem, SID_DOCINFO_TITLE );
if ( pNameItem )
return X( pNameItem->GetValue() );
}
@@ -1153,7 +1153,7 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame )
SfxApplication* pSfxApp = SFX_APP();
if ( !pSfxApp->IsDowning() && !IsLoading() && pFrame && !pFrame->GetFrame().IsClosing_Impl() )
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN );
if ( !pHiddenItem || !pHiddenItem->GetValue() )
{
sal_uInt16 nId = pImp->nEventId;
@@ -1341,7 +1341,7 @@ void SfxObjectShell::InitOwnModel_Impl()
{
if ( !pImp->bModelInitialized )
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if ( pSalvageItem )
{
pImp->aTempName = pMedium->GetPhysicalName();
@@ -1376,7 +1376,7 @@ void SfxObjectShell::InitOwnModel_Impl()
void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
{
sal_Bool bSetModifiedTRUE = sal_False;
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if( ( nFlags & SFX_LOADED_MAINDOCUMENT ) && !(pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT )
&& !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ))
{
@@ -1437,7 +1437,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
if ( (pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) && (pImp->nLoadedFlags & SFX_LOADED_IMAGES ) )
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE );
sal_Bool bTemplate = pTemplateItem && pTemplateItem->GetValue();
// closing the streams on loading should be under control of SFX!
@@ -1477,7 +1477,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
if ( pTmpMedium )
{
String aName( pTmpMedium->GetName() );
- SFX_ITEMSET_ARG( pTmpMedium->GetItemSet(), pTemplNamItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False);
+ SFX_ITEMSET_ARG( pTmpMedium->GetItemSet(), pTemplNamItem, SfxStringItem, SID_TEMPLATE_NAME );
String aTemplateName;
if ( pTemplNamItem )
aTemplateName = pTemplNamItem->GetValue();
@@ -1523,7 +1523,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
else
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
sal_Bool bSalvage = pSalvageItem ? sal_True : sal_False;
if ( !bSalvage )
@@ -1879,7 +1879,7 @@ sal_Bool SfxObjectShell::IsPreview() const
return sal_False;
sal_Bool bPreview = sal_False;
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS );
if ( pFlags )
{
// Werte auf einzelne Items verteilen
@@ -1891,7 +1891,7 @@ sal_Bool SfxObjectShell::IsPreview() const
if ( !bPreview )
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pItem, SfxBoolItem, SID_PREVIEW, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pItem, SfxBoolItem, SID_PREVIEW );
if ( pItem )
bPreview = pItem->GetValue();
}
@@ -1988,7 +1988,7 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium )
{
Window* pWindow = 0;
SfxItemSet* pSet = pLoadingMedium ? pLoadingMedium->GetItemSet() : GetMedium()->GetItemSet();
- SFX_ITEMSET_ARG( pSet, pUnoItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False );
+ SFX_ITEMSET_ARG( pSet, pUnoItem, SfxUnoFrameItem, SID_FILLFRAME );
if ( pUnoItem )
{
uno::Reference < frame::XFrame > xFrame( pUnoItem->GetFrame() );
@@ -1998,7 +1998,7 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium )
if ( !pWindow )
{
SfxFrame* pFrame = 0;
- SFX_ITEMSET_ARG( pSet, pFrameItem, SfxFrameItem, SID_DOCFRAME, sal_False );
+ SFX_ITEMSET_ARG( pSet, pFrameItem, SfxFrameItem, SID_DOCFRAME );
if( pFrameItem && pFrameItem->GetFrame() )
// get target frame from ItemSet
pFrame = pFrameItem->GetFrame();
@@ -2021,7 +2021,7 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium )
if ( pWindow )
{
// this frame may be invisible, show it if it is allowed
- SFX_ITEMSET_ARG( pSet, pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
+ SFX_ITEMSET_ARG( pSet, pHiddenItem, SfxBoolItem, SID_HIDDEN );
if ( !pHiddenItem || !pHiddenItem->GetValue() )
{
pWindow->Show();
@@ -2055,7 +2055,7 @@ String SfxObjectShell::UpdateTitle( SfxMedium* pMed, sal_uInt16 nDocViewNumber )
if ( pMed )
{
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE );
if ( pRepairedDocItem && pRepairedDocItem->GetValue() )
aTitle += String( SfxResId(STR_REPAIREDDOCUMENT) );
}
@@ -2166,7 +2166,7 @@ sal_Int16 SfxObjectShell_Impl::getCurrentMacroExecMode() const
OSL_PRECOND( pMedium, "SfxObjectShell_Impl::getCurrentMacroExecMode: no medium!" );
if ( pMedium )
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pMacroModeItem, SfxUInt16Item, SID_MACROEXECMODE, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pMacroModeItem, SfxUInt16Item, SID_MACROEXECMODE );
if ( pMacroModeItem )
nImposedExecMode = pMacroModeItem->GetValue();
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 2ecd8d5ffca3..bdbcaec50132 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -298,14 +298,14 @@ sal_Bool SfxObjectShell::APISaveAs_Impl
if ( GetMedium() )
{
String aFilterName;
- SFX_ITEMSET_ARG( aParams, pFilterNameItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( aParams, pFilterNameItem, SfxStringItem, SID_FILTER_NAME );
if( pFilterNameItem )
{
aFilterName = pFilterNameItem->GetValue();
}
else
{
- SFX_ITEMSET_ARG( aParams, pContentTypeItem, SfxStringItem, SID_CONTENTTYPE, sal_False );
+ SFX_ITEMSET_ARG( aParams, pContentTypeItem, SfxStringItem, SID_CONTENTTYPE );
if ( pContentTypeItem )
{
const SfxFilter* pFilter = SfxFilterMatcher( String::CreateFromAscii(GetFactory().GetShortName()) ).GetFilter4Mime( pContentTypeItem->GetValue(), SFX_FILTER_EXPORT );
@@ -331,7 +331,7 @@ sal_Bool SfxObjectShell::APISaveAs_Impl
SfxObjectShellRef xLock( this ); // ???
// use the title that is provided in the media descriptor
- SFX_ITEMSET_ARG( aParams, pDocTitleItem, SfxStringItem, SID_DOCINFO_TITLE, sal_False );
+ SFX_ITEMSET_ARG( aParams, pDocTitleItem, SfxStringItem, SID_DOCINFO_TITLE );
if ( pDocTitleItem )
getDocProperties()->setTitle( pDocTitleItem->GetValue() );
@@ -402,7 +402,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_DOCINFO:
{
- SFX_REQUEST_ARG(rReq, pDocInfItem, SfxDocumentInfoItem, SID_DOCINFO, sal_False);
+ SFX_REQUEST_ARG(rReq, pDocInfItem, SfxDocumentInfoItem, SID_DOCINFO );
if ( pDocInfItem )
{
// parameter, e.g. from replayed macro
@@ -413,7 +413,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
{
// no argument containing DocInfo; check optional arguments
sal_Bool bReadOnly = IsReadOnly();
- SFX_REQUEST_ARG(rReq, pROItem, SfxBoolItem, SID_DOC_READONLY, sal_False);
+ SFX_REQUEST_ARG(rReq, pROItem, SfxBoolItem, SID_DOC_READONLY );
if ( pROItem )
// override readonly attribute of document
// e.g. if a readonly document is saved elsewhere and user asks for editing DocInfo before
@@ -452,7 +452,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
SfxDocumentInfoDialog *pDlg = CreateDocumentInfoDialog(0, aSet);
if ( RET_OK == pDlg->Execute() )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pDocInfoItem, SfxDocumentInfoItem, SID_DOCINFO, sal_False);
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pDocInfoItem, SfxDocumentInfoItem, SID_DOCINFO );
if ( pDocInfoItem )
{
// user has done some changes to DocumentInfo
@@ -513,7 +513,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( nId == SID_SAVEASDOC )
{
// in case of plugin mode the SaveAs operation means SaveTo
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pViewOnlyItem, SfxBoolItem, SID_VIEWONLY, sal_False );
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pViewOnlyItem, SfxBoolItem, SID_VIEWONLY );
if ( pViewOnlyItem && pViewOnlyItem->GetValue() )
rReq.AppendItem( SfxBoolItem( SID_SAVETO, sal_True ) );
}
@@ -521,7 +521,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// TODO/LATER: do the following GUI related actions in standalown method
// ========================================================================================================
// Introduce a status indicator for GUI operation
- SFX_REQUEST_ARG( rReq, pStatusIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL, sal_False );
+ SFX_REQUEST_ARG( rReq, pStatusIndicatorItem, SfxUnoAnyItem, SID_PROGRESS_STATUSBAR_CONTROL );
if ( !pStatusIndicatorItem )
{
// get statusindicator
@@ -558,7 +558,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
// Introduce an interaction handler for GUI operation
- SFX_REQUEST_ARG( rReq, pInteractionHandlerItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False );
+ SFX_REQUEST_ARG( rReq, pInteractionHandlerItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER );
if ( !pInteractionHandlerItem )
{
uno::Reference< task::XInteractionHandler > xInteract;
@@ -593,8 +593,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// ========================================================================================================
sal_Bool bPreselectPassword = sal_False;
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pOldEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pOldPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pOldEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pOldPasswordItem, SfxStringItem, SID_PASSWORD );
if ( pOldEncryptionDataItem || pOldPasswordItem )
bPreselectPassword = sal_True;
@@ -637,7 +637,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
NULL );
rReq.SetArgs( aResultParams );
- SFX_REQUEST_ARG( rReq, pFilterNameItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pFilterNameItem, SfxStringItem, SID_FILTER_NAME );
::rtl::OUString aFilterName = pFilterNameItem ? ::rtl::OUString( pFilterNameItem->GetValue() )
: ::rtl::OUString();
const SfxFilter* pFilt = GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName );
@@ -681,7 +681,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( lErr && nErrorCode == ERRCODE_NONE )
{
- SFX_REQUEST_ARG( rReq, pWarnItem, SfxBoolItem, SID_FAIL_ON_WARNING, sal_False );
+ SFX_REQUEST_ARG( rReq, pWarnItem, SfxBoolItem, SID_FAIL_ON_WARNING );
if ( pWarnItem && pWarnItem->GetValue() )
nErrorCode = lErr;
}
@@ -755,8 +755,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
// Parameter auswerten
- SFX_REQUEST_ARG(rReq, pSaveItem, SfxBoolItem, SID_CLOSEDOC_SAVE, sal_False);
- SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, SID_CLOSEDOC_FILENAME, sal_False);
+ SFX_REQUEST_ARG(rReq, pSaveItem, SfxBoolItem, SID_CLOSEDOC_SAVE );
+ SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, SID_CLOSEDOC_FILENAME );
if ( pSaveItem )
{
if ( pSaveItem->GetValue() )
@@ -827,9 +827,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
}
- SFX_REQUEST_ARG(rReq, pRegionItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, sal_False);
- SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False);
- SFX_REQUEST_ARG(rReq, pRegionNrItem, SfxUInt16Item, SID_TEMPLATE_REGION, sal_False);
+ SFX_REQUEST_ARG(rReq, pRegionItem, SfxStringItem, SID_TEMPLATE_REGIONNAME );
+ SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, SID_TEMPLATE_NAME );
+ SFX_REQUEST_ARG(rReq, pRegionNrItem, SfxUInt16Item, SID_TEMPLATE_REGION );
if ( (!pRegionItem && !pRegionNrItem ) || !pNameItem )
{
DBG_ASSERT( rReq.IsAPI(), "non-API call without Arguments" );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 776061ade457..837f0c44f9ec 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -207,7 +207,7 @@ bool GetEncryptionData_Impl( const SfxItemSet* pSet, uno::Sequence< beans::Named
bool bResult = false;
if ( pSet )
{
- SFX_ITEMSET_ARG( pSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False);
+ SFX_ITEMSET_ARG( pSet, pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if ( pEncryptionDataItem )
{
pEncryptionDataItem->GetValue() >>= o_rEncryptionData;
@@ -215,7 +215,7 @@ bool GetEncryptionData_Impl( const SfxItemSet* pSet, uno::Sequence< beans::Named
}
else
{
- SFX_ITEMSET_ARG( pSet, pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( pSet, pPasswordItem, SfxStringItem, SID_PASSWORD );
if ( pPasswordItem )
{
::rtl::OUString aPassword = pPasswordItem->GetValue();
@@ -602,19 +602,16 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
SfxItemSet* pSet = pMedium->GetItemSet();
if( !pImp->nEventId )
{
- SFX_ITEMSET_ARG(
- pSet, pTemplateItem, SfxBoolItem,
- SID_TEMPLATE, sal_False);
+ SFX_ITEMSET_ARG( pSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE );
SetActivateEvent_Impl(
( pTemplateItem && pTemplateItem->GetValue() )
? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC );
}
- SFX_ITEMSET_ARG( pSet, pBaseItem, SfxStringItem,
- SID_BASEURL, sal_False);
+ SFX_ITEMSET_ARG( pSet, pBaseItem, SfxStringItem, SID_BASEURL );
String aBaseURL;
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if( pBaseItem )
aBaseURL = pBaseItem->GetValue();
else
@@ -658,7 +655,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
try
{
sal_Bool bWarnMediaTypeFallback = sal_False;
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairPackageItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairPackageItem, SfxBoolItem, SID_REPAIRPACKAGE );
// treat the package as broken if the mediatype was retrieved as a fallback
uno::Reference< beans::XPropertySet > xStorProps( xStorage, uno::UNO_QUERY_THROW );
@@ -693,7 +690,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( bOk )
{
// the document loaded from template has no name
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE );
if ( !pTemplateItem || !pTemplateItem->GetValue() )
bHasName = sal_True;
@@ -817,9 +814,9 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
{
GetpApp()->HideStatusText();
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pAsTempItem, SfxBoolItem, SID_TEMPLATE, sal_False);
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPreviewItem, SfxBoolItem, SID_PREVIEW, sal_False);
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pAsTempItem, SfxBoolItem, SID_TEMPLATE );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPreviewItem, SfxBoolItem, SID_PREVIEW );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN );
if( bOk && pMedium->GetOrigURL().Len()
&& !( pAsTempItem && pAsTempItem->GetValue() )
&& !( pPreviewItem && pPreviewItem->GetValue() )
@@ -901,8 +898,8 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo
{
sal_uInt32 nError = ERRCODE_NONE;
SfxItemSet* pSet = pMedium->GetItemSet();
- SFX_ITEMSET_ARG( pSet, pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
- SFX_ITEMSET_ARG( pSet, pData, SfxUnoAnyItem, SID_FILTER_DATA, sal_False );
+ SFX_ITEMSET_ARG( pSet, pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS );
+ SFX_ITEMSET_ARG( pSet, pData, SfxUnoAnyItem, SID_FILTER_DATA );
if ( !pData && !pOptions )
{
com::sun::star::uno::Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
@@ -959,19 +956,11 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo
aNewParams,
NULL );
- SFX_ITEMSET_ARG( &aNewParams,
- pFilterOptions,
- SfxStringItem,
- SID_FILE_FILTEROPTIONS,
- sal_False );
+ SFX_ITEMSET_ARG( &aNewParams, pFilterOptions, SfxStringItem, SID_FILE_FILTEROPTIONS );
if ( pFilterOptions )
pSet->Put( *pFilterOptions );
- SFX_ITEMSET_ARG( &aNewParams,
- pFilterData,
- SfxUnoAnyItem,
- SID_FILTER_DATA,
- sal_False );
+ SFX_ITEMSET_ARG( &aNewParams, pFilterData, SfxUnoAnyItem, SID_FILTER_DATA );
if ( pFilterData )
pSet->Put( *pFilterData );
}
@@ -1221,7 +1210,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
SfxItemSet *pMedSet = rMedium.GetItemSet();
if( pMedSet )
{
- SFX_ITEMSET_ARG( pMedSet, pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
+ SFX_ITEMSET_ARG( pMedSet, pSaveToItem, SfxBoolItem, SID_SAVETO );
bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
(pSaveToItem && pSaveToItem->GetValue());
}
@@ -1447,8 +1436,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
pFilter = rMedium.GetFilter();
- const SfxStringItem *pVersionItem = pSet ? (const SfxStringItem*)
- SfxRequest::GetItem( pSet, SID_DOCINFO_COMMENTS, sal_False, TYPE(SfxStringItem) ) : NULL;
+ const SfxStringItem *pVersionItem = pSet ? dynamic_cast<const SfxStringItem*>(
+ SfxRequest::GetItem( pSet, SID_DOCINFO_COMMENTS )) : NULL;
::rtl::OUString aTmpVersionURL;
if ( bOk )
@@ -1536,8 +1525,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( bOk && pVersionItem )
{
// store a version also
- const SfxStringItem *pAuthorItem = pSet ? (const SfxStringItem*)
- SfxRequest::GetItem( pSet, SID_DOCINFO_AUTHOR, sal_False, TYPE(SfxStringItem) ) : NULL;
+ const SfxStringItem *pAuthorItem = pSet ? dynamic_cast<const SfxStringItem*>(
+ SfxRequest::GetItem( pSet, SID_DOCINFO_AUTHOR )) : NULL;
// version comment
util::RevisionTag aInfo;
@@ -2675,7 +2664,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
// an interaction handler here can aquire only in case of GUI Saving
// and should be removed after the saving is done
com::sun::star::uno::Reference< XInteractionHandler > xInteract;
- SFX_ITEMSET_ARG( pArgs, pxInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False );
+ SFX_ITEMSET_ARG( pArgs, pxInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER );
if ( pxInteractionItem && ( pxInteractionItem->GetValue() >>= xInteract ) && xInteract.is() )
pMediumTmp->GetItemSet()->Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, makeAny( xInteract ) ) );
@@ -2731,10 +2720,10 @@ sal_Bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet )
pImp->bIsSaving = sal_True;
sal_Bool bSaved = sal_False;
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if ( pSalvageItem )
{
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME );
String aFilterName;
const SfxFilter *pFilter = NULL;
if ( pFilterItem )
@@ -2743,7 +2732,7 @@ sal_Bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet )
SfxMedium *pMed = new SfxMedium(
pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC, sal_False, pFilter );
- SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD );
if ( pPasswordItem )
pMed->GetItemSet()->Put( *pPasswordItem );
@@ -2799,7 +2788,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL!" );
DBG_ASSERT( aParams->Count() != 0, "fehlerhafte Parameter");
- SFX_ITEMSET_ARG( aParams, pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
+ SFX_ITEMSET_ARG( aParams, pSaveToItem, SfxBoolItem, SID_SAVETO );
sal_Bool bSaveTo = pSaveToItem ? pSaveToItem->GetValue() : sal_False;
const SfxFilter* pFilter = GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName );
@@ -2811,7 +2800,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
return sal_False;
}
- SFX_ITEMSET_ARG( aParams, pCopyStreamItem, SfxBoolItem, SID_COPY_STREAM_IF_POSSIBLE, sal_False );
+ SFX_ITEMSET_ARG( aParams, pCopyStreamItem, SfxBoolItem, SID_COPY_STREAM_IF_POSSIBLE );
if ( bSaveTo && pCopyStreamItem && pCopyStreamItem->GetValue() && !IsModified() )
{
if ( pMedium->TryDirectTransfer( aURL.GetMainURL( INetURLObject::NO_DECODE ), *aParams ) )
@@ -2973,7 +2962,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
}
// check if a "SaveTo" is wanted, no "SaveAs"
- SFX_ITEMSET_ARG( pParams, pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
+ SFX_ITEMSET_ARG( pParams, pSaveToItem, SfxBoolItem, SID_SAVETO );
sal_Bool bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED || (pSaveToItem && pSaveToItem->GetValue());
// distinguish between "Save" and "SaveAs"
@@ -3220,7 +3209,7 @@ sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
if ( xStorage.is() )
{
// Password
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD );
if ( pPasswdItem || ERRCODE_IO_ABORT != CheckPasswd_Impl( this, SFX_APP()->GetPool(), pMedium ) )
{
uno::Sequence< beans::NamedValue > aEncryptionData;
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 27aa35e00f54..01141e9bb42f 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -43,7 +43,6 @@
#include <vcl/wrkwin.hxx>
#include <vcl/svapp.hxx>
#include <svl/eitem.hxx>
-#include <tools/rtti.hxx>
#include <svl/lstner.hxx>
#include <sfx2/sfxhelp.hxx>
#include <basic/sbstar.hxx>
@@ -208,8 +207,6 @@ void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::Even
mpDoc->DoClose();
}
-TYPEINIT1(SfxObjectShell, SfxShell);
-
//--------------------------------------------------------------------
SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
:mpObjectContainer(0)
@@ -491,7 +488,7 @@ sal_Bool SfxObjectShell::Close()
SfxObjectShell* SfxObjectShell::GetFirst
(
- const TypeId* pType ,
+ ConvertToObjectShell aConvert,
sal_Bool bOnlyVisible
)
{
@@ -504,7 +501,7 @@ SfxObjectShell* SfxObjectShell::GetFirst
if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
continue;
- if ( ( !pType || pSh->IsA(*pType) ) &&
+ if ( ( !aConvert || aConvert(pSh) ) &&
( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True )))
return pSh;
}
@@ -518,7 +515,7 @@ SfxObjectShell* SfxObjectShell::GetFirst
SfxObjectShell* SfxObjectShell::GetNext
(
const SfxObjectShell& rPrev,
- const TypeId* pType,
+ ConvertToObjectShell aConvert,
sal_Bool bOnlyVisible
)
{
@@ -537,7 +534,7 @@ SfxObjectShell* SfxObjectShell::GetNext
if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
continue;
- if ( ( !pType || pSh->IsA(*pType) ) &&
+ if ( ( !aConvert || aConvert(pSh) ) &&
( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True )))
return pSh;
}
@@ -660,7 +657,7 @@ sal_uInt16 SfxObjectShell::PrepareClose
pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
}
- if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) )
+ if ( !pPoolItem || dynamic_cast< const SfxVoidItem* >(pPoolItem) || ( dynamic_cast< const SfxBoolItem* >(pPoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) )
return sal_False;
else
bClose = sal_True;
@@ -1084,8 +1081,8 @@ SfxObjectShell* SfxObjectShell::CreateAndLoadObject( const SfxItemSet& rSet, Sfx
{
uno::Sequence < beans::PropertyValue > aProps;
TransformItems( SID_OPENDOC, rSet, aProps );
- SFX_ITEMSET_ARG(&rSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False);
- SFX_ITEMSET_ARG(&rSet, pTargetItem, SfxStringItem, SID_TARGETNAME, sal_False);
+ SFX_ITEMSET_ARG(&rSet, pFileNameItem, SfxStringItem, SID_FILE_NAME );
+ SFX_ITEMSET_ARG(&rSet, pTargetItem, SfxStringItem, SID_TARGETNAME );
::rtl::OUString aURL;
::rtl::OUString aTarget = rtl::OUString::createFromAscii("_blank");
if ( pFileNameItem )
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index d21d330dbe74..8ad01af1a581 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -787,7 +787,7 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
{
if ( &rBC == m_pObjectShell )
{
- SfxPrintingHint* pPrintHint = PTR_CAST( SfxPrintingHint, &rHint );
+ const SfxPrintingHint* pPrintHint = dynamic_cast< const SfxPrintingHint* >( &rHint );
if ( pPrintHint )
{
if ( pPrintHint->GetWhich() == com::sun::star::view::PrintableState_JOB_STARTED )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 17a38d4633ed..79d648980604 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1009,12 +1009,12 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
aSet.ClearItem( SID_FILLFRAME );
pMedium->GetItemSet()->Put( aSet );
- SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME );
if ( pItem )
pMedium->SetFilter(
pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( pItem->GetValue() ) );
- SFX_ITEMSET_ARG( &aSet, pTitleItem, SfxStringItem, SID_DOCINFO_TITLE, sal_False );
+ SFX_ITEMSET_ARG( &aSet, pTitleItem, SfxStringItem, SID_DOCINFO_TITLE );
if ( pTitleItem )
{
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pObjectShell );
@@ -1709,7 +1709,7 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString&
attachResource( rURL, aSequence );
#if OSL_DEBUG_LEVEL > 0
- SFX_ITEMSET_ARG( m_pData->m_pObjectShell->GetMedium()->GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( m_pData->m_pObjectShell->GetMedium()->GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD );
OSL_ENSURE( !pPasswdItem, "There should be no Password property in the document MediaDescriptor!" );
#endif
}
@@ -1845,7 +1845,7 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
SfxMedium* pMedium = new SfxMedium( seqArguments );
String aFilterName;
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterNameItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterNameItem, SfxStringItem, SID_FILTER_NAME );
if( pFilterNameItem )
aFilterName = pFilterNameItem->GetValue();
if( !m_pData->m_pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName ) )
@@ -1856,17 +1856,17 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
}
// !TODO: currently not working
- //SFX_ITEMSET_ARG( pParams, pFrameItem, SfxFrameItem, SID_DOCFRAME, sal_False );
+ //SFX_ITEMSET_ARG( pParams, pFrameItem, SfxFrameItem, SID_DOCFRAME );
//if( pFrameItem && pFrameItem->GetFrame() )
//{
// SfxFrame* pFrame = pFrameItem->GetFrame();
// pMedium->SetLoadTargetFrame( pFrame );
//}
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
sal_Bool bSalvage = pSalvageItem ? sal_True : sal_False;
- // SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
+ // SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE );
// sal_Bool bTemplate = pTemplateItem && pTemplateItem->GetValue();
//
// does already happen in DoLoad call
@@ -1885,7 +1885,7 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
if ( nError == ERRCODE_IO_BROKENPACKAGE && xHandler.is() )
{
::rtl::OUString aDocName = pMedium->GetURLObject().getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE );
if ( !pRepairItem || !pRepairItem->GetValue() )
{
RequestPackageReparation aRequest( aDocName );
@@ -1922,7 +1922,7 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
if( bSalvage )
{
// file recovery: restore original filter
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME );
SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
const SfxFilter* pSetFilter = rMatcher.GetFilter4FilterName( pFilterItem->GetValue() );
pMedium->SetFilter( pSetFilter );
@@ -1932,7 +1932,7 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
// TODO/LATER: may be the mode should be retrieved from outside and the preused filter should not be set
if ( m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME );
if ( pFilterItem )
m_pData->m_aPreusedFilterName = pFilterItem->GetValue();
}
@@ -1945,7 +1945,7 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
if ( nError )
{
sal_Bool bSilent = sal_False;
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSilentItem, SfxBoolItem, SID_SILENT, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSilentItem, SfxBoolItem, SID_SILENT );
if( pSilentItem )
bSilent = pSilentItem->GetValue();
@@ -1976,12 +1976,12 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
}
sal_Bool bHidden = sal_False;
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN );
if ( pHidItem )
bHidden = pHidItem->GetValue();
#if OSL_DEBUG_LEVEL > 0
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPasswdItem, SfxStringItem, SID_PASSWORD );
OSL_ENSURE( !pPasswdItem, "There should be no Password property in the document MediaDescriptor!" );
#endif
// !TODO: will be done by Framework!
@@ -2557,11 +2557,11 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
if ( &rBC == m_pData->m_pObjectShell )
{
- SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DOCCHANGED )
changing();
- SfxEventHint* pNamedHint = PTR_CAST( SfxEventHint, &rHint );
+ const SfxEventHint* pNamedHint = dynamic_cast< const SfxEventHint* >( &rHint );
if ( pNamedHint )
{
@@ -2636,7 +2636,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
}
- SfxViewEventHint* pViewHint = PTR_CAST( SfxViewEventHint, &rHint );
+ const SfxViewEventHint* pViewHint = dynamic_cast< const SfxViewEventHint* >( &rHint );
postEvent_Impl( pNamedHint->GetEventName(), pViewHint ? pViewHint->GetController() : uno::Reference< frame::XController2 >() );
}
@@ -2855,7 +2855,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
TransformParameters( SID_SAVEASDOC, seqArguments, *aParams );
- SFX_ITEMSET_ARG( aParams, pCopyStreamItem, SfxBoolItem, SID_COPY_STREAM_IF_POSSIBLE, sal_False );
+ SFX_ITEMSET_ARG( aParams, pCopyStreamItem, SfxBoolItem, SID_COPY_STREAM_IF_POSSIBLE );
if ( pCopyStreamItem && pCopyStreamItem->GetValue() && !bSaveTo )
{
@@ -2869,7 +2869,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
sal_uInt32 nModifyPasswordHash = 0;
uno::Sequence< beans::PropertyValue > aModifyPasswordInfo;
- SFX_ITEMSET_ARG( aParams, pModifyPasswordInfoItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO, sal_False );
+ SFX_ITEMSET_ARG( aParams, pModifyPasswordInfoItem, SfxUnoAnyItem, SID_MODIFYPASSWORDINFO);
if ( pModifyPasswordInfoItem )
{
// it contains either a simple hash or a set of PropertyValues
@@ -2929,7 +2929,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
}
uno::Reference < task::XInteractionHandler > xHandler;
- SFX_ITEMSET_ARG( aParams, pItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False);
+ SFX_ITEMSET_ARG( aParams, pItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER );
if ( pItem )
pItem->GetValue() >>= xHandler;
@@ -3621,7 +3621,7 @@ void SAL_CALL SfxBaseModel::loadFromStorage( const uno::Reference< XSTORAGE >& x
// allow to use an interactionhandler (if there is one)
pMedium->UseInteractionHandler( sal_True );
- SFX_ITEMSET_ARG( &aSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
+ SFX_ITEMSET_ARG( &aSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE );
sal_Bool bTemplate = pTemplateItem && pTemplateItem->GetValue();
m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC );
m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = sal_False;
@@ -3653,7 +3653,7 @@ void SAL_CALL SfxBaseModel::storeToStorage( const uno::Reference< XSTORAGE >& xS
TransformParameters( SID_SAVEASDOC, aMediaDescriptor, aSet );
// TODO/LATER: may be a special URL "private:storage" should be used
- SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False );
+ SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME );
sal_Int32 nVersion = SOFFICE_FILEFORMAT_CURRENT;
if( pItem )
{
@@ -3847,7 +3847,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
if ( pMedium )
{
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE, sal_False );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pRepairedDocItem, SfxBoolItem, SID_REPAIRPACKAGE );
if ( pRepairedDocItem && pRepairedDocItem->GetValue() )
aResult += String( SfxResId(STR_REPAIREDDOCUMENT) );
}
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index b199c59f3351..f93d45ba5586 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -42,8 +42,6 @@ class SfxTemplateControllerItem;
#include <svl/svstdarr.hxx> // SvUShorts
#include <rsc/rscsfx.hxx>
-#include <tools/rtti.hxx>
-
#include <sfx2/childwin.hxx>
#include <sfx2/templdlg.hxx>
@@ -239,8 +237,6 @@ protected:
void SaveFactoryStyleFilter( SfxObjectShell* i_pObjSh, sal_Int32 i_nFilter );
public:
- TYPEINFO();
-
SfxCommonTemplateDialog_Impl( SfxBindings* pB, SfxDockingWindow* );
SfxCommonTemplateDialog_Impl( SfxBindings* pB, ModalDialog* );
~SfxCommonTemplateDialog_Impl();
@@ -328,8 +324,6 @@ protected:
public:
friend class SfxTemplateDialog;
- TYPEINFO();
-
SfxTemplateDialog_Impl( Window* pParent, SfxBindings*, SfxTemplateDialog* pWindow );
~SfxTemplateDialog_Impl();
};
@@ -376,7 +370,6 @@ protected:
DECL_LINK( OrgHdl, Button * );
public:
- TYPEINFO();
SfxTemplateCatalog_Impl( Window* pParent, SfxBindings*, SfxTemplateCatalog* pWindow );
~SfxTemplateCatalog_Impl();
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 89ca73149d85..12249b73c863 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -220,7 +220,7 @@ IMPL_LINK( SfxURLToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEve
{
if ( pAccExec &&
pEvent &&
- pEvent->ISA( VclWindowEvent ) &&
+ dynamic_cast< VclWindowEvent* >(pEvent) &&
( pEvent->GetId() == VCLEVENT_WINDOW_KEYINPUT ))
{
VclWindowEvent* pWinEvent = static_cast< VclWindowEvent* >( pEvent );
@@ -283,7 +283,7 @@ void SfxURLToolBoxControl_Impl::StateChanged
}
}
- const SfxStringItem *pURL = PTR_CAST(SfxStringItem,pState);
+ const SfxStringItem *pURL = dynamic_cast< const SfxStringItem* >( pState);
String aRep( pURL->GetValue() );
INetURLObject aURL( aRep );
INetProtocol eProt = aURL.GetProtocol();
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index d4edbdeb11b1..dfdb8defa83e 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -285,14 +285,14 @@ void SfxMenuControl::StateChanged
//! delete pOwnMenu->GetMenu().ChangePopupMenu( GetId(), 0 );
bool bCheck = false;
- if ( pState->ISA(SfxBoolItem) )
+ if ( dynamic_cast< const SfxBoolItem* >(pState) )
{
// BoolItem fuer checken
DBG_ASSERT( GetId() < SID_OBJECTMENU0 || GetId() > SID_OBJECTMENU_LAST,
"SfxBoolItem not allowed for SID_OBJECTMENUx" );
bCheck = ((const SfxBoolItem*)pState)->GetValue();
}
- else if ( pState->ISA(SfxEnumItemInterface) &&
+ else if ( dynamic_cast< const SfxEnumItemInterface* >(pState) &&
((SfxEnumItemInterface *)pState)->HasBoolValue() )
{
// EnumItem wie Bool behandeln
@@ -300,7 +300,7 @@ void SfxMenuControl::StateChanged
"SfxEnumItem not allowed for SID_OBJECTMENUx" );
bCheck = ((SfxEnumItemInterface *)pState)->GetBoolValue();
}
- else if ( ( b_ShowStrings || bIsObjMenu ) && pState->ISA(SfxStringItem) )
+ else if ( ( b_ShowStrings || bIsObjMenu ) && dynamic_cast< const SfxStringItem* >(pState) )
{
// MenuText aus SfxStringItem holen
String aStr( ((const SfxStringItem*)pState)->GetValue() );
@@ -346,7 +346,7 @@ SfxMenuControl* SfxMenuControl::CreateImpl( sal_uInt16 /*nId*/, Menu& /*rMenu*/,
void SfxMenuControl::RegisterControl( sal_uInt16 nSlotId, SfxModule *pMod )
{
RegisterMenuControl( pMod, new SfxMenuCtrlFactory(
- SfxMenuControl::CreateImpl, TYPE(SfxStringItem), nSlotId ) );
+ SfxMenuControl::CreateImpl, typeid(SfxStringItem), nSlotId ) );
}
//--------------------------------------------------------------------
@@ -357,8 +357,8 @@ void SfxMenuControl::RegisterMenuControl(SfxModule* pMod, SfxMenuCtrlFactory* pF
SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings )
{
- TypeId aSlotType = SFX_SLOTPOOL().GetSlotType(nId);
- if ( aSlotType )
+ const std::type_info& aSlotType = SFX_SLOTPOOL().GetSlotType(nId);
+ if ( aSlotType != typeid(void))
{
SfxApplication *pApp = SFX_APP();
SfxDispatcher *pDisp = rBindings.GetDispatcher_Impl();
@@ -370,7 +370,7 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB
{
SfxMenuCtrlFactArr_Impl &rFactories = *pFactories;
for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
- if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ if ( rFactories[nFactory]->rTypeInfo == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nId) ) )
return rFactories[nFactory]->pCtor( nId, rMenu, rBindings );
@@ -380,7 +380,7 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB
SfxMenuCtrlFactArr_Impl &rFactories = pApp->GetMenuCtrlFactories_Impl();
for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
- if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ if ( rFactories[nFactory]->rTypeInfo == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nId) ) )
return rFactories[nFactory]->pCtor( nId, rMenu, rBindings );
@@ -390,8 +390,8 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB
sal_Bool SfxMenuControl::IsSpecialControl( sal_uInt16 nId, SfxModule* pMod )
{
- TypeId aSlotType = SFX_SLOTPOOL().GetSlotType( nId );
- if ( aSlotType )
+ const std::type_info&aSlotType = SFX_SLOTPOOL().GetSlotType( nId );
+ if ( aSlotType != typeid(void))
{
if ( pMod )
{
@@ -400,7 +400,7 @@ sal_Bool SfxMenuControl::IsSpecialControl( sal_uInt16 nId, SfxModule* pMod )
{
SfxMenuCtrlFactArr_Impl &rFactories = *pFactories;
for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
- if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ if ( rFactories[nFactory]->rTypeInfo == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nId) ) )
return sal_True;
@@ -410,7 +410,7 @@ sal_Bool SfxMenuControl::IsSpecialControl( sal_uInt16 nId, SfxModule* pMod )
SfxMenuCtrlFactArr_Impl &rFactories = SFX_APP()->GetMenuCtrlFactories_Impl();
for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
- if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ if ( rFactories[nFactory]->rTypeInfo == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nId) ) )
return sal_True;
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 8564bb25bcca..ad94ad1a37fd 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -95,7 +95,7 @@ public:
void SfxMenuImageControl_Impl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState /*eState*/, const SfxPoolItem* pState )
{
- const SfxImageItem* pItem = PTR_CAST( SfxImageItem, pState );
+ const SfxImageItem* pItem = dynamic_cast< const SfxImageItem* >( pState );
if ( pItem )
{
lRotation = pItem->GetRotation();
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 193d5c519af7..b290b13a59d1 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -457,12 +457,12 @@ void SfxStatusBarControl::StateChanged
DBG_MEMTEST();
DBG_ASSERT( pBar != 0, "setting state to dangling StatusBar" );
- const SfxStringItem* pStr = PTR_CAST( SfxStringItem, pState );
+ const SfxStringItem* pStr = dynamic_cast< const SfxStringItem* >( pState );
if ( eState == SFX_ITEM_AVAILABLE && pStr )
pBar->SetItemText( nSID, pStr->GetValue() );
else
{
- DBG_ASSERT( eState != SFX_ITEM_AVAILABLE || pState->ISA(SfxVoidItem),
+ DBG_ASSERT( eState != SFX_ITEM_AVAILABLE || dynamic_cast< const SfxVoidItem* >(pState),
"wrong SfxPoolItem subclass in SfxStatusBarControl" );
pBar->SetItemText( nSID, String() );
}
@@ -652,8 +652,8 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl
else
pSlotPool = &SfxSlotPool::GetSlotPool();
- TypeId aSlotType = pSlotPool->GetSlotType(nSlotID);
- if ( aSlotType )
+ const std::type_info&aSlotType = pSlotPool->GetSlotType(nSlotID);
+ if ( aSlotType != typeid(void))
{
if ( pMod )
{
@@ -662,7 +662,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl
{
SfxStbCtrlFactArr_Impl &rFactories = *pFactories;
for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
- if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ if ( rFactories[nFactory]->rTypeInfo == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nSlotID) ) )
return rFactories[nFactory]->pCtor( nSlotID, nStbId, *pBar );
@@ -671,7 +671,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl
SfxStbCtrlFactArr_Impl &rFactories = pApp->GetStbCtrlFactories_Impl();
for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
- if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ if ( rFactories[nFactory]->rTypeInfo == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nSlotID) ) )
return rFactories[nFactory]->pCtor( nSlotID, nStbId, *pBar );
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 45f7903420a8..0df3862c3a57 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -217,7 +217,7 @@ struct SfxToolBoxControl_Impl
IMPL_LINK( SfxToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEvent )
{
if ( pEvent &&
- pEvent->ISA( VclWindowEvent ) &&
+ dynamic_cast< VclWindowEvent* >(pEvent) &&
(( pEvent->GetId() == VCLEVENT_WINDOW_MOVE ) ||
( pEvent->GetId() == VCLEVENT_WINDOW_ACTIVATE )))
{
@@ -335,8 +335,8 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn
pSlotPool = pMod->GetSlotPool();
else
pSlotPool = &SfxSlotPool::GetSlotPool();
- TypeId aSlotType = pSlotPool->GetSlotType( nSlotId );
- if ( aSlotType )
+ const std::type_info&aSlotType = pSlotPool->GetSlotType( nSlotId );
+ if ( aSlotType != typeid(void))
{
if ( pMod )
{
@@ -349,7 +349,8 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn
// search for a factory with the given slot id
for( nFactory = 0; nFactory < nCount; ++nFactory )
- if( (rFactories[nFactory]->nTypeId == aSlotType) && (rFactories[nFactory]->nSlotId == nSlotId) )
+ if ( rFactories[nFactory]->rTypeInfo == aSlotType &&
+ ( ( rFactories[nFactory]->nSlotId == 0 ) || ( rFactories[nFactory]->nSlotId == nSlotId) ) )
break;
if( nFactory == nCount )
@@ -357,7 +358,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn
// if no factory exists for the given slot id, see if we
// have a generic factory with the correct slot type and slot id == 0
for ( nFactory = 0; nFactory < nCount; ++nFactory )
- if( (rFactories[nFactory]->nTypeId == aSlotType) && (rFactories[nFactory]->nSlotId == 0) )
+ if( (rFactories[nFactory]->rTypeInfo == aSlotType) && (rFactories[nFactory]->nSlotId == 0) )
break;
}
@@ -375,7 +376,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn
const sal_uInt16 nCount = rFactories.Count();
for( nFactory = 0; nFactory < nCount; ++nFactory )
- if( (rFactories[nFactory]->nTypeId == aSlotType) && (rFactories[nFactory]->nSlotId == nSlotId) )
+ if( (rFactories[nFactory]->rTypeInfo == aSlotType) && (rFactories[nFactory]->nSlotId == nSlotId) )
break;
if( nFactory == nCount )
@@ -383,7 +384,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn
// if no factory exists for the given slot id, see if we
// have a generic factory with the correct slot type and slot id == 0
for( nFactory = 0; nFactory < nCount; ++nFactory )
- if( (rFactories[nFactory]->nTypeId == aSlotType) && (rFactories[nFactory]->nSlotId == 0) )
+ if( (rFactories[nFactory]->rTypeInfo == aSlotType) && (rFactories[nFactory]->nSlotId == 0) )
break;
}
@@ -434,7 +435,7 @@ SfxItemState SfxToolBoxControl::GetItemState(
? SFX_ITEM_DISABLED
: IsInvalidItem(pState)
? SFX_ITEM_DONTCARE
- : pState->ISA(SfxVoidItem) && !pState->Which()
+ : dynamic_cast< const SfxVoidItem* >(pState) && !pState->Which()
? SFX_ITEM_UNKNOWN
: SFX_ITEM_AVAILABLE;
}
@@ -978,14 +979,14 @@ void SfxToolBoxControl::StateChanged
{
case SFX_ITEM_AVAILABLE:
{
- if ( pState->ISA(SfxBoolItem) )
+ if ( dynamic_cast< const SfxBoolItem* >(pState) )
{
// BoolItem fuer checken
if ( ((const SfxBoolItem*)pState)->GetValue() )
eTri = STATE_CHECK;
nItemBits |= TIB_CHECKABLE;
}
- else if ( pState->ISA(SfxEnumItemInterface) &&
+ else if ( dynamic_cast< const SfxEnumItemInterface* >(pState) &&
((SfxEnumItemInterface *)pState)->HasBoolValue())
{
// EnumItem wie Bool behandeln
@@ -993,7 +994,7 @@ void SfxToolBoxControl::StateChanged
eTri = STATE_CHECK;
nItemBits |= TIB_CHECKABLE;
}
- else if ( pImpl->bShowString && pState->ISA(SfxStringItem) )
+ else if ( pImpl->bShowString && dynamic_cast< const SfxStringItem* >(pState) )
pImpl->pBox->SetItemText(nId, ((const SfxStringItem*)pState)->GetValue() );
break;
}
@@ -1670,7 +1671,7 @@ void SfxAppToolBoxControl_Impl::StateChanged
const SfxPoolItem* pState
)
{
- if ( pState && pState->ISA(SfxStringItem) )
+ if ( pState && dynamic_cast< const SfxStringItem* >(pState) )
{
// Important step for following SetImage() call!
// It needs the valid pMenu item to fullfill it's specification
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 2b5a3c1d45e9..1bfbb2004eac 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -93,11 +93,6 @@ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::container;
-TYPEINIT1(SfxFrame, SfxListener);
-TYPEINIT1_AUTOFACTORY(SfxFrameItem, SfxPoolItem);
-TYPEINIT1(SfxUsrAnyItem, SfxPoolItem);
-TYPEINIT1_AUTOFACTORY(SfxUnoFrameItem, SfxPoolItem);
-
SvCompatWeakHdl* SfxFrame::GetHdl()
{
return pImp->GetHdl();
@@ -421,7 +416,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc )
const SfxMedium *pMed = pDoc->GetMedium();
GetDescriptor()->SetActualURL( pMed->GetOrigURL() );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pItem, SfxBoolItem, SID_EDITDOC, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pItem, SfxBoolItem, SID_EDITDOC );
sal_Bool bEditable = ( !pItem || pItem->GetValue() );
GetDescriptor()->SetEditable( bEditable );
@@ -435,9 +430,9 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc )
if ( pFilter )
aFilter = pFilter->GetFilterName();
- SFX_ITEMSET_ARG( pItemSet, pRefererItem, SfxStringItem, SID_REFERER, sal_False);
- SFX_ITEMSET_ARG( pItemSet, pOptionsItem, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False);
- SFX_ITEMSET_ARG( pItemSet, pTitle1Item, SfxStringItem, SID_DOCINFO_TITLE, sal_False);
+ SFX_ITEMSET_ARG( pItemSet, pRefererItem, SfxStringItem, SID_REFERER );
+ SFX_ITEMSET_ARG( pItemSet, pOptionsItem, SfxStringItem, SID_FILE_FILTEROPTIONS );
+ SFX_ITEMSET_ARG( pItemSet, pTitle1Item, SfxStringItem, SID_DOCINFO_TITLE );
SfxItemSet *pSet = GetDescriptor()->GetArgs();
@@ -621,6 +616,7 @@ sal_Bool SfxFrameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8
return sal_False;
}
+IMPL_POOLITEM_FACTORY(SfxUsrAnyItem)
SfxUsrAnyItem::SfxUsrAnyItem( sal_uInt16 nWhichId, const ::com::sun::star::uno::Any& rAny )
: SfxPoolItem( nWhichId )
@@ -630,7 +626,7 @@ SfxUsrAnyItem::SfxUsrAnyItem( sal_uInt16 nWhichId, const ::com::sun::star::uno::
int SfxUsrAnyItem::operator==( const SfxPoolItem& /*rItem*/ ) const
{
-// return rItem.ISA( SfxUsrAnyItem ) && ((SfxUsrAnyItem&)rItem).aValue == aValue;
+// return dynamic_cast< const SfxUsrAnyItem* >(&rItem) && ((SfxUsrAnyItem&)rItem).aValue == aValue;
return sal_False;
}
@@ -651,6 +647,8 @@ sal_Bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt
return sal_True;
}
+IMPL_POOLITEM_FACTORY(SfxUnoFrameItem)
+
SfxUnoFrameItem::SfxUnoFrameItem()
: SfxPoolItem()
, m_xFrame()
@@ -665,7 +663,7 @@ SfxUnoFrameItem::SfxUnoFrameItem( sal_uInt16 nWhichId, const ::com::sun::star::u
int SfxUnoFrameItem::operator==( const SfxPoolItem& i_rItem ) const
{
- return i_rItem.ISA( SfxUnoFrameItem ) && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame;
+ return dynamic_cast< const SfxUnoFrameItem* >(&i_rItem) && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame;
}
SfxPoolItem* SfxUnoFrameItem::Clone( SfxItemPool* ) const
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 73a578efc2df..cbbb8113810a 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -239,7 +239,7 @@ namespace
// On the other side some special slots return a boolean state,
// which can be set to FALSE.
- SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, _pResult );
+ const SfxBoolItem *pItem = dynamic_cast< const SfxBoolItem* >( _pResult );
if ( pItem )
bSuccess = pItem->GetValue();
diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx
index ea29a8160aad..f4f75c3c2e05 100644
--- a/sfx2/source/view/impviewframe.hxx
+++ b/sfx2/source/view/impviewframe.hxx
@@ -37,7 +37,6 @@ struct SfxViewFrame_Impl
Size aMargin;
Size aSize;
String aFrameTitle;
- TypeId aLastType;
String aActualURL;
SfxFrame& rFrame;
svtools::AsynchronLink* pReloader;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 3f5bf596a817..f92853200575 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -163,11 +163,6 @@ SFX_IMPL_INTERFACE(SfxViewFrame,SfxShell,SfxResId(0))
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_STANDARD, SfxResId(RID_ENVTOOLBOX) );
}
-TYPEINIT2(SfxViewFrame,SfxShell,SfxListener);
-TYPEINIT1(SfxViewFrameItem, SfxPoolItem);
-
-//=========================================================================
-
//-------------------------------------------------------------------------
namespace
{
@@ -261,9 +256,11 @@ public:
//-------------------------------------------------------------------------
void SfxViewNotificatedFrameList_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSfxSimpleHint->GetId() )
{
case SFX_HINT_DYING:
SfxViewFrame* pFrame = (SfxViewFrame*) &rBC;
@@ -372,7 +369,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
SfxMedium* pMed = pSh->GetMedium();
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY, sal_False );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_VIEWONLY );
if ( pItem && pItem->GetValue() )
{
SfxApplication* pApp = SFX_APP();
@@ -380,17 +377,17 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetURLObject().GetMainURL(INetURLObject::NO_DECODE) ) );
aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
aSet.Put( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_blank") ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER );
if ( pReferer )
aSet.Put( *pReferer );
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pVersionItem, SfxInt16Item, SID_VERSION, sal_False );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pVersionItem, SfxInt16Item, SID_VERSION );
if ( pVersionItem )
aSet.Put( *pVersionItem );
if( pMed->GetFilter() )
{
aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName() ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS );
if ( pOptions )
aSet.Put( *pOptions );
}
@@ -451,7 +448,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( rReq.IsAPI() )
{
// per API steuern ob r/w oder r/o
- SFX_REQUEST_ARG(rReq, pEditItem, SfxBoolItem, SID_EDITDOC, sal_False);
+ SFX_REQUEST_ARG(rReq, pEditItem, SfxBoolItem, SID_EDITDOC );
if ( pEditItem )
nOpenMode = pEditItem->GetValue() ? SFX_STREAM_READWRITE : SFX_STREAM_READONLY;
}
@@ -461,8 +458,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
String aTemp;
utl::LocalFileHelper::ConvertPhysicalNameToURL( pMed->GetPhysicalName(), aTemp );
INetURLObject aPhysObj( aTemp );
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(),
- pVersionItem, SfxInt16Item, SID_VERSION, sal_False );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pVersionItem, SfxInt16Item, SID_VERSION );
INetURLObject aMedObj( pMed->GetName() );
@@ -526,7 +522,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
SfxApplication* pApp = SFX_APP();
SfxAllItemSet aSet( pApp->GetPool() );
aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetName() ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pReferer, SfxStringItem, SID_REFERER );
if ( pReferer )
aSet.Put( *pReferer );
aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
@@ -536,8 +532,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if( pMed->GetFilter() )
{
aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName() ) );
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions,
- SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pOptions, SfxStringItem, SID_FILE_FILTEROPTIONS );
if ( pOptions )
aSet.Put( *pOptions );
}
@@ -578,8 +573,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( !pSh || !pSh->CanReload_Impl() )
break;
SfxApplication* pApp = SFX_APP();
- SFX_REQUEST_ARG(rReq, pForceReloadItem, SfxBoolItem,
- SID_FORCERELOAD, sal_False);
+ SFX_REQUEST_ARG(rReq, pForceReloadItem, SfxBoolItem, SID_FORCERELOAD );
if( pForceReloadItem && !pForceReloadItem->GetValue() &&
!pSh->GetMedium()->IsExpired() )
return;
@@ -587,15 +581,14 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
return;
// AutoLoad ist ggf. verboten
- SFX_REQUEST_ARG(rReq, pAutoLoadItem, SfxBoolItem, SID_AUTOLOAD, sal_False);
+ SFX_REQUEST_ARG(rReq, pAutoLoadItem, SfxBoolItem, SID_AUTOLOAD );
if ( pAutoLoadItem && pAutoLoadItem->GetValue() &&
GetFrame().IsAutoLoadLocked_Impl() )
return;
SfxObjectShellLock xOldObj( pSh );
pImp->bReloading = sal_True;
- SFX_REQUEST_ARG(rReq, pURLItem, SfxStringItem,
- SID_FILE_NAME, sal_False);
+ SFX_REQUEST_ARG(rReq, pURLItem, SfxStringItem, SID_FILE_NAME );
// editierbar "offnen?
sal_Bool bForEdit = !pSh->IsReadOnly();
if ( rReq.GetSlot() == SID_EDITDOC )
@@ -603,7 +596,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// ggf. beim User nachfragen
sal_Bool bDo = ( GetViewShell()->PrepareClose() != sal_False );
- SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False);
+ SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT );
if ( bDo && GetFrame().DocIsModified_Impl() &&
!rReq.IsAPI() && ( !pSilentItem || !pSilentItem->GetValue() ) )
{
@@ -679,7 +672,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Falls eine salvagede Datei vorliegt, nicht nochmals die
// OrigURL mitschicken, denn die Tempdate ist nach Reload
// ungueltig
- SFX_ITEMSET_ARG( pNewSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ SFX_ITEMSET_ARG( pNewSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE );
if( pSalvageItem )
{
aURL = pSalvageItem->GetValue();
@@ -706,9 +699,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( pSilentItem && pSilentItem->GetValue() )
pNewSet->Put( SfxBoolItem( SID_SILENT, sal_True ) );
- SFX_ITEMSET_ARG(pNewSet, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False);
- SFX_ITEMSET_ARG(pNewSet, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE , sal_False);
- SFX_ITEMSET_ARG(pNewSet, pDocTemplateItem, SfxUInt16Item, SID_UPDATEDOCMODE , sal_False);
+ SFX_ITEMSET_ARG(pNewSet, pInteractionItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER );
+ SFX_ITEMSET_ARG(pNewSet, pMacroExecItem , SfxUInt16Item, SID_MACROEXECMODE );
+ SFX_ITEMSET_ARG(pNewSet, pDocTemplateItem, SfxUInt16Item, SID_UPDATEDOCMODE );
if (!pInteractionItem)
{
@@ -726,8 +719,8 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Altes Dok nicht cachen! Gilt nicht, wenn anderes
// Doc geladen wird.
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False);
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedReferer, SfxStringItem, SID_REFERER, sal_False);
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedOptions, SfxStringItem, SID_FILE_FILTEROPTIONS );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedReferer, SfxStringItem, SID_REFERER );
sal_Bool bHasStorage = pMedium->HasStorage_Impl();
if( bHandsOff )
@@ -899,7 +892,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
rSet.DisableItem( SID_EDITDOC );
else
{
- SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_EDITDOC, sal_False );
+ SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_EDITDOC );
if ( pItem && !pItem->GetValue() )
rSet.DisableItem( SID_EDITDOC );
else
@@ -1115,7 +1108,6 @@ void SfxViewFrame::ReleaseObjectShell_Impl()
if ( xObjSh.Is() )
{
- pImp->aLastType = xObjSh->Type();
pDispatcher->Pop( *xObjSh );
SfxModule* pModule = xObjSh->GetModule();
if( pModule )
@@ -1183,9 +1175,7 @@ void SfxViewFrame::DoActivate( sal_Bool bUI, SfxViewFrame* pOldFrame )
SfxMedium* pMed = GetObjectShell() ? GetObjectShell()->GetMedium() : NULL;
if( pMed )
{
- SFX_ITEMSET_ARG(
- pMed->GetItemSet(), pInterceptorItem, SfxSlotInterceptorItem,
- SID_INTERCEPTOR, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pInterceptorItem, SfxSlotInterceptorItem, SID_INTERCEPTOR );
if( pInterceptorItem )
{
SfxSlotInterceptor* pInter = pInterceptorItem->GetValue();
@@ -1222,9 +1212,7 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame )
SfxMedium* pMed = GetObjectShell() ? GetObjectShell()->GetMedium() : NULL;
if( pMed )
{
- SFX_ITEMSET_ARG(
- pMed->GetItemSet(), pInterceptorItem, SfxSlotInterceptorItem,
- SID_INTERCEPTOR, sal_False );
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pInterceptorItem, SfxSlotInterceptorItem, SID_INTERCEPTOR );
if( pInterceptorItem )
pInterceptorItem->GetValue()->Activate( sal_False );
}
@@ -1326,9 +1314,11 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
return;
// we know only SimpleHints
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSfxSimpleHint->GetId() )
{
case SFX_HINT_MODECHANGED:
{
@@ -1391,12 +1381,16 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
- else if ( rHint.IsA(TYPE(SfxEventHint)) )
+ else
+ {
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if ( pSfxEventHint )
{
// Wenn das Document asynchron geladen wurde, wurde der Dispatcher
// auf ReadOnly gesetzt, was zur"?ckgenommen werden mu\s, wenn
// das Document selbst nicht ReadOnly ist und das Laden fertig ist.
- switch ( ((SfxEventHint&)rHint).GetEventId() )
+ switch ( pSfxEventHint->GetEventId() )
{
case SFX_EVENT_MODIFYCHANGED:
{
@@ -1444,6 +1438,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
}
+}
//------------------------------------------------------------------------
void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
@@ -1754,7 +1749,7 @@ void SfxViewFrame::DoAdjustPosSizePixel //! teilen in Inner.../Outer...
int SfxViewFrameItem::operator==( const SfxPoolItem &rItem ) const
{
- return PTR_CAST(SfxViewFrameItem, &rItem)->pFrame== pFrame;
+ return dynamic_cast< const SfxViewFrameItem* >( &rItem)->pFrame== pFrame;
}
//--------------------------------------------------------------------
@@ -1872,7 +1867,7 @@ void SfxViewFrame::Enable( sal_Bool bEnable )
{
// hide cursor
if ( pViewSh )
- pViewSh->ShowCursor(sal_False);
+ pViewSh->ShowCursor(false);
}
/*
if ( !bEnable )
@@ -2054,8 +2049,7 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const
// Wenn es keinen aktiven ChildFrame gibt, irgendeinen nehmen
for ( sal_uInt16 n=0; n<GetChildFrameCount(); n++ )
{
- pViewFrame =
- PTR_CAST( SfxViewFrame, GetChildFrame(n)->GetChildFrame(0) );
+ pViewFrame = dynamic_cast< SfxViewFrame* >( GetChildFrame(n)->GetChildFrame(0) );
if ( pViewFrame )
break;
}
@@ -2200,8 +2194,8 @@ SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const
//--------------------------------------------------------------------
SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const sal_uInt16 i_nViewId )
{
- SFX_REQUEST_ARG( i_rCreateDocRequest, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False );
- SFX_REQUEST_ARG( i_rCreateDocRequest, pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
+ SFX_REQUEST_ARG( i_rCreateDocRequest, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME );
+ SFX_REQUEST_ARG( i_rCreateDocRequest, pHiddenItem, SfxBoolItem, SID_HIDDEN );
return LoadViewIntoFrame_Impl_NoThrow(
i_rDoc,
@@ -2492,12 +2486,12 @@ void SfxViewFrame::ExecView_Impl
pMed->GetItemSet()->ClearItem( SID_HIDDEN );
// the view ID (optional arg. TODO: this is currently not supported in the slot definition ...)
- SFX_REQUEST_ARG( rReq, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False );
+ SFX_REQUEST_ARG( rReq, pViewIdItem, SfxUInt16Item, SID_VIEW_ID );
const sal_uInt16 nViewId = pViewIdItem ? pViewIdItem->GetValue() : GetCurViewId();
Reference < XFrame > xFrame;
// the frame (optional arg. TODO: this is currently not supported in the slot definition ...)
- SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME );
if ( pFrameItem )
xFrame = pFrameItem->GetFrame();
@@ -2509,7 +2503,7 @@ void SfxViewFrame::ExecView_Impl
case SID_OBJECT:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, SID_OBJECT, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, SID_OBJECT );
SfxViewShell *pViewShell = GetViewShell();
if ( pViewShell && pItem )
@@ -3034,7 +3028,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
xRecorder = xSupplier->getDispatchRecorder();
sal_Bool bIsRecording = xRecorder.is();
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_RECORDMACRO, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_RECORDMACRO );
if ( pItem && pItem->GetValue() == bIsRecording )
return;
@@ -3044,7 +3038,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
aProp <<= com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorderSupplier >();
xSet->setPropertyValue(sProperty,aProp);
- SFX_REQUEST_ARG( rReq, pRecordItem, SfxBoolItem, FN_PARAM_1, sal_False);
+ SFX_REQUEST_ARG( rReq, pRecordItem, SfxBoolItem, FN_PARAM_1 );
if ( !pRecordItem || !pRecordItem->GetValue() )
// insert script into basic library container of application
AddDispatchMacroToBasic_Impl(xRecorder->getRecordedMacro());
@@ -3108,7 +3102,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
{
rtl::OUString aStatusbarResString( RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" ));
// Parameter auswerten
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, rReq.GetSlot(), sal_False);
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, rReq.GetSlot() );
sal_Bool bShow( sal_True );
if ( !pShowItem )
bShow = xLayoutManager->isElementVisible( aStatusbarResString );
@@ -3133,7 +3127,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_WIN_FULLSCREEN:
{
- SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot(), sal_False);
+ SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot() );
SfxViewFrame *pTop = GetTopViewFrame();
if ( pTop )
{
@@ -3329,7 +3323,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
// Parameter auswerten
sal_uInt16 nSID = rReq.GetSlot();
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSID, sal_False);
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSID );
if ( nSID == SID_VIEW_DATA_SOURCE_BROWSER )
{
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SDATABASE))
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index 9eedb06cb96e..c6a13241733e 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -159,9 +159,11 @@ String SfxViewFrame::UpdateTitle()
void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSfxSimpleHint->GetId() )
{
case SFX_HINT_TITLECHANGED:
for ( SfxViewFrame *pTop = SfxViewFrame::GetFirst( this );
@@ -274,9 +276,9 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
{
case SID_SHOWPOPUPS :
{
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS, sal_False);
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS );
sal_Bool bShow = pShowItem ? pShowItem->GetValue() : sal_True;
- SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID, sal_False);
+ SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID );
sal_uInt16 nId = pIdItem ? pIdItem->GetValue() : 0;
// ausfuehren
@@ -318,7 +320,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
case SID_NEWDOCDIRECT :
{
- SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, sal_False);
+ SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT );
String aFactName;
if ( pFactoryItem )
aFactName = pFactoryItem->GetValue();
@@ -337,7 +339,7 @@ void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, &GetFrame() ) );
aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_blank" ) ) );
SFX_APP()->ExecuteSlot( aReq );
- const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() );
+ const SfxViewFrameItem* pItem = dynamic_cast< const SfxViewFrameItem* >( aReq.GetReturnValue() );
if ( pItem )
rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) );
break;
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index c70abf82e271..7ff748b23c01 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -61,8 +61,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-TYPEINIT1(SfxPrintingHint, SfxHint);
-
// -----------------------------------------------------------------------
class SfxPrinterController : public vcl::PrinterController, public SfxListener
{
@@ -177,9 +175,11 @@ SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_
void SfxPrinterController::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
+ if ( SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
EndListening(*mpViewShell);
EndListening(*mpObjectShell);
@@ -675,7 +675,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
sal_Bool bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count();
if ( bIsAPI )
{
- SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False);
+ SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT );
bSilent = pSilentItem && pSilentItem->GetValue();
}
@@ -708,7 +708,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
break;
- SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False);
+ SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION );
sal_Bool bSelection = pSelectItem && pSelectItem->GetValue();
if( pSelectItem && rReq.GetArgs()->Count() == 1 )
bIsAPI = sal_False;
@@ -777,7 +777,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
SfxPrinter *pDocPrinter = GetPrinter(sal_True);
// look for printer in parameters
- SFX_REQUEST_ARG( rReq, pPrinterItem, SfxStringItem, SID_PRINTER_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pPrinterItem, SfxStringItem, SID_PRINTER_NAME );
if ( pPrinterItem )
{
// use PrinterName parameter to create a printer
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index f432eb39cbb7..e823e28bb8dd 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -319,8 +319,6 @@ SFX_IMPL_INTERFACE(SfxViewShell,SfxShell,SfxResId(0))
SFX_CHILDWINDOW_REGISTRATION( SID_MAIL_CHILDWIN );
}
-TYPEINIT2(SfxViewShell,SfxShell,SfxListener);
-
//--------------------------------------------------------------------
/** search for a filter name dependent on type and module
*/
@@ -435,32 +433,32 @@ enum ETypeFamily
void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
{
- const sal_uInt16 nId = rReq.GetSlot();
- switch( nId )
+ const sal_uInt16 nId = rReq.GetSlot();
+ switch( nId )
+ {
+ case SID_STYLE_FAMILY :
{
- case SID_STYLE_FAMILY :
- {
- SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nId, sal_False);
- if (pItem)
+ SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nId);
+ if (pItem)
{
pImp->m_nFamily = pItem->GetValue();
}
- break;
- }
+ break;
+ }
- case SID_STYLE_CATALOG:
- {
- SfxTemplateCatalog aCatalog(
- SFX_APP()->GetTopWindow(), &GetViewFrame()->GetBindings());
- aCatalog.Execute();
+ case SID_STYLE_CATALOG:
+ {
+ SfxTemplateCatalog aCatalog(
+ SFX_APP()->GetTopWindow(), &GetViewFrame()->GetBindings());
+ aCatalog.Execute();
rReq.Ignore();
- break;
- }
+ break;
+ }
case SID_ACTIVATE_STYLE_APPLY:
{
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame(
- GetViewFrame()->GetFrame().GetFrameInterface(),
- com::sun::star::uno::UNO_QUERY);
+ GetViewFrame()->GetFrame().GetFrameInterface(),
+ com::sun::star::uno::UNO_QUERY);
Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY );
Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
@@ -513,87 +511,87 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
}
}
rReq.Done();
+ break;
}
- break;
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_MAIL_SENDDOCASMS:
- case SID_MAIL_SENDDOCASOOO:
- case SID_MAIL_SENDDOCASPDF:
- case SID_MAIL_SENDDOC:
+ case SID_MAIL_SENDDOCASMS:
+ case SID_MAIL_SENDDOCASOOO:
+ case SID_MAIL_SENDDOCASPDF:
+ case SID_MAIL_SENDDOC:
case SID_MAIL_SENDDOCASFORMAT:
- {
- SfxObjectShell* pDoc = GetObjectShell();
- if ( pDoc && pDoc->QueryHiddenInformation(
- WhenSaving, &GetViewFrame()->GetWindow() ) != RET_YES )
- break;
+ {
+ SfxObjectShell* pDoc = GetObjectShell();
+ if ( pDoc && pDoc->QueryHiddenInformation(
+ WhenSaving, &GetViewFrame()->GetWindow() ) != RET_YES )
+ break;
- if ( SvtInternalOptions().MailUIEnabled() )
+ if ( SvtInternalOptions().MailUIEnabled() )
{
GetViewFrame()->SetChildWindow( SID_MAIL_CHILDWIN, sal_True );
}
else
{
- SfxMailModel aModel;
+ SfxMailModel aModel;
rtl::OUString aDocType;
- SFX_REQUEST_ARG(rReq, pMailSubject, SfxStringItem, SID_MAIL_SUBJECT, sal_False );
- if ( pMailSubject )
- aModel.SetSubject( pMailSubject->GetValue() );
+ SFX_REQUEST_ARG(rReq, pMailSubject, SfxStringItem, SID_MAIL_SUBJECT );
+ if ( pMailSubject )
+ aModel.SetSubject( pMailSubject->GetValue() );
- SFX_REQUEST_ARG(rReq, pMailRecipient, SfxStringItem, SID_MAIL_RECIPIENT, sal_False );
- if ( pMailRecipient )
- {
- String aRecipient( pMailRecipient->GetValue() );
- String aMailToStr( String::CreateFromAscii( "mailto:" ));
+ SFX_REQUEST_ARG(rReq, pMailRecipient, SfxStringItem, SID_MAIL_RECIPIENT );
+ if ( pMailRecipient )
+ {
+ String aRecipient( pMailRecipient->GetValue() );
+ String aMailToStr( String::CreateFromAscii( "mailto:" ));
- if ( aRecipient.Search( aMailToStr ) == 0 )
- aRecipient = aRecipient.Erase( 0, aMailToStr.Len() );
- aModel.AddAddress( aRecipient, SfxMailModel::ROLE_TO );
- }
- SFX_REQUEST_ARG(rReq, pMailDocType, SfxStringItem, SID_TYPE_NAME, sal_False );
+ if ( aRecipient.Search( aMailToStr ) == 0 )
+ aRecipient = aRecipient.Erase( 0, aMailToStr.Len() );
+ aModel.AddAddress( aRecipient, SfxMailModel::ROLE_TO );
+ }
+ SFX_REQUEST_ARG(rReq, pMailDocType, SfxStringItem, SID_TYPE_NAME );
if ( pMailDocType )
aDocType = pMailDocType->GetValue();
uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
- SfxMailModel::SendMailResult eResult = SfxMailModel::SEND_MAIL_ERROR;
+ SfxMailModel::SendMailResult eResult = SfxMailModel::SEND_MAIL_ERROR;
if ( nId == SID_MAIL_SENDDOC )
- eResult = aModel.SaveAndSend( xFrame, rtl::OUString() );
- else
- if ( nId == SID_MAIL_SENDDOCASPDF )
- eResult = aModel.SaveAndSend( xFrame, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf_Portable_Document_Format" )));
- else
- if ( nId == SID_MAIL_SENDDOCASMS )
- {
- aDocType = impl_searchFormatTypeForApp(xFrame, E_MS_DOC);
- if (aDocType.getLength() > 0)
- eResult = aModel.SaveAndSend( xFrame, aDocType );
- }
+ eResult = aModel.SaveAndSend( xFrame, rtl::OUString() );
else
- if ( nId == SID_MAIL_SENDDOCASOOO )
- {
- aDocType = impl_searchFormatTypeForApp(xFrame, E_OOO_DOC);
- if (aDocType.getLength() > 0)
- eResult = aModel.SaveAndSend( xFrame, aDocType );
- }
-
- if ( eResult == SfxMailModel::SEND_MAIL_ERROR )
- {
- InfoBox aBox( SFX_APP()->GetTopWindow(), SfxResId( MSG_ERROR_SEND_MAIL ));
- aBox.Execute();
- rReq.Ignore();
- }
- else
- rReq.Done();
+ if ( nId == SID_MAIL_SENDDOCASPDF )
+ eResult = aModel.SaveAndSend( xFrame, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf_Portable_Document_Format" )));
+ else
+ if ( nId == SID_MAIL_SENDDOCASMS )
+ {
+ aDocType = impl_searchFormatTypeForApp(xFrame, E_MS_DOC);
+ if (aDocType.getLength() > 0)
+ eResult = aModel.SaveAndSend( xFrame, aDocType );
}
+ else
+ if ( nId == SID_MAIL_SENDDOCASOOO )
+ {
+ aDocType = impl_searchFormatTypeForApp(xFrame, E_OOO_DOC);
+ if (aDocType.getLength() > 0)
+ eResult = aModel.SaveAndSend( xFrame, aDocType );
+ }
- break;
- }
+ if ( eResult == SfxMailModel::SEND_MAIL_ERROR )
+ {
+ InfoBox aBox( SFX_APP()->GetTopWindow(), SfxResId( MSG_ERROR_SEND_MAIL ));
+ aBox.Execute();
+ rReq.Ignore();
+ }
+ else
+ rReq.Done();
+ }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_WEBHTML:
- {
+ break;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_WEBHTML:
+ {
static const char HTML_DOCUMENT_TYPE[] = "writer_web_HTML";
static const char HTML_GRAPHIC_TYPE[] = "graphic_HTML";
const sal_Int32 FILTERFLAG_EXPORT = 0x00000002;
@@ -613,7 +611,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
rtl::OUString aModule;
try
{
- aModule = xModuleManager->identify( xFrame );
+ aModule = xModuleManager->identify( xFrame );
}
catch ( css::uno::RuntimeException& )
{
@@ -731,7 +729,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
}
rReq.Done(bRet);
- break;
+ break;
}
else
{
@@ -741,97 +739,97 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- case SID_PLUGINS_ACTIVE:
- {
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nId, sal_False);
+ case SID_PLUGINS_ACTIVE:
+ {
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nId);
bool const bActive = (pShowItem)
? pShowItem->GetValue()
: !pImp->m_bPlugInsActive;
- // ggf. recorden
- if ( !rReq.IsAPI() )
- rReq.AppendItem( SfxBoolItem( nId, bActive ) );
+ // ggf. recorden
+ if ( !rReq.IsAPI() )
+ rReq.AppendItem( SfxBoolItem( nId, bActive ) );
- // Jetzt schon DONE aufrufen, da die Argumente evtl. einen Pool
- // benutzen, der demn"achst weg ist
- rReq.Done(sal_True);
+ // Jetzt schon DONE aufrufen, da die Argumente evtl. einen Pool
+ // benutzen, der demn"achst weg ist
+ rReq.Done(sal_True);
- // ausfuehren
+ // ausfuehren
if (!pShowItem || (bActive != pImp->m_bPlugInsActive))
- {
- SfxFrame* pTopFrame = &GetFrame()->GetTopFrame();
- if ( pTopFrame != &GetFrame()->GetFrame() )
- {
- // FramesetDocument
- SfxViewShell *pShell = pTopFrame->GetCurrentViewFrame()->GetViewShell();
- if ( pShell->GetInterface()->GetSlot( nId ) )
- pShell->ExecuteSlot( rReq );
- break;
- }
+ {
+ SfxFrame* pTopFrame = &GetFrame()->GetTopFrame();
+ if ( pTopFrame != &GetFrame()->GetFrame() )
+ {
+ // FramesetDocument
+ SfxViewShell *pShell = pTopFrame->GetCurrentViewFrame()->GetViewShell();
+ if ( pShell->GetInterface()->GetSlot( nId ) )
+ pShell->ExecuteSlot( rReq );
+ break;
+ }
- SfxFrameIterator aIter( *pTopFrame );
- while ( pTopFrame )
- {
- if ( pTopFrame->GetCurrentViewFrame() )
- {
- SfxViewShell *pView = pTopFrame->GetCurrentViewFrame()->GetViewShell();
- if ( pView )
- {
+ SfxFrameIterator aIter( *pTopFrame );
+ while ( pTopFrame )
+ {
+ if ( pTopFrame->GetCurrentViewFrame() )
+ {
+ SfxViewShell *pView = pTopFrame->GetCurrentViewFrame()->GetViewShell();
+ if ( pView )
+ {
pView->pImp->m_bPlugInsActive = bActive;
Rectangle aVisArea = GetObjectShell()->GetVisArea();
VisAreaChanged(aVisArea);
- // the plugins might need change in their state
- SfxInPlaceClientList *pClients = pView->GetIPClientList_Impl(sal_False);
- if ( pClients )
- {
- for (sal_uInt16 n=0; n < pClients->Count(); n++)
- {
- SfxInPlaceClient* pIPClient = pClients->GetObject(n);
- if ( pIPClient )
- pView->CheckIPClient_Impl( pIPClient, aVisArea );
- }
- }
- }
- }
-
- if ( !pTopFrame->GetParentFrame() )
- pTopFrame = aIter.FirstFrame();
- else
- pTopFrame = aIter.NextFrame( *pTopFrame );
+ // the plugins might need change in their state
+ SfxInPlaceClientList *pClients = pView->GetIPClientList_Impl(sal_False);
+ if ( pClients )
+ {
+ for (sal_uInt16 n=0; n < pClients->Count(); n++)
+ {
+ SfxInPlaceClient* pIPClient = pClients->GetObject(n);
+ if ( pIPClient )
+ pView->CheckIPClient_Impl( pIPClient, aVisArea );
}
+ }
}
+ }
- break;
+ if ( !pTopFrame->GetParentFrame() )
+ pTopFrame = aIter.FirstFrame();
+ else
+ pTopFrame = aIter.NextFrame( *pTopFrame );
}
+ }
+
+ break;
}
+ }
}
//--------------------------------------------------------------------
void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
{
- DBG_CHKTHIS(SfxViewShell, 0);
+ DBG_CHKTHIS(SfxViewShell, 0);
- SfxWhichIter aIter( rSet );
- for ( sal_uInt16 nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
+ SfxWhichIter aIter( rSet );
+ for ( sal_uInt16 nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
+ {
+ switch ( nSID )
{
- switch ( nSID )
- {
- case SID_STYLE_CATALOG:
- {
+ case SID_STYLE_CATALOG:
+ {
if ( !GetViewFrame()->KnowsChildWindow( SID_STYLE_DESIGNER ) )
- rSet.DisableItem( nSID );
- break;
- }
+ rSet.DisableItem( nSID );
+ break;
+ }
- // Printer-Funktionen
- case SID_PRINTDOC:
- case SID_PRINTDOCDIRECT:
- case SID_SETUPPRINTER:
- case SID_PRINTER_NAME:
- {
+ // Printer-Funktionen
+ case SID_PRINTDOC:
+ case SID_PRINTDOCDIRECT:
+ case SID_SETUPPRINTER:
+ case SID_PRINTER_NAME:
+ {
bool bEnabled = pImp->m_bCanPrint && !pImp->m_nPrinterLocks;
- bEnabled = bEnabled && !Application::GetSettings().GetMiscSettings().GetDisablePrinting();
+ bEnabled = bEnabled && !Application::GetSettings().GetMiscSettings().GetDisablePrinting();
if ( bEnabled )
{
SfxPrinter *pPrinter = GetPrinter(sal_False);
@@ -860,68 +858,66 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
}
bEnabled = !pPrinter || !pPrinter->IsPrinting();
}
- if ( !bEnabled )
- {
- // will now be handled by requeing the request
- /* rSet.DisableItem( SID_PRINTDOC );
- rSet.DisableItem( SID_PRINTDOCDIRECT );
- rSet.DisableItem( SID_SETUPPRINTER ); */
- }
- break;
- }
+ if ( !bEnabled )
+ {
+ // will now be handled by requeing the request
+ /* rSet.DisableItem( SID_PRINTDOC );
+ rSet.DisableItem( SID_PRINTDOCDIRECT );
+ rSet.DisableItem( SID_SETUPPRINTER ); */
+ }
+ break;
+ }
- // Mail-Funktionen
- case SID_MAIL_SENDDOCASPDF:
- case SID_MAIL_SENDDOC:
+ // Mail-Funktionen
+ case SID_MAIL_SENDDOCASPDF:
+ case SID_MAIL_SENDDOC:
case SID_MAIL_SENDDOCASFORMAT:
- {
+ {
sal_Bool bEnable = !GetViewFrame()->HasChildWindow( SID_MAIL_CHILDWIN );
- if ( !bEnable )
- rSet.DisableItem( nSID );
- break;
- }
+ if ( !bEnable )
+ rSet.DisableItem( nSID );
+ break;
+ }
- // PlugIns running
- case SID_PLUGINS_ACTIVE:
- {
- rSet.Put( SfxBoolItem( SID_PLUGINS_ACTIVE,
- !pImp->m_bPlugInsActive) );
- break;
- }
+ // PlugIns running
+ case SID_PLUGINS_ACTIVE:
+ {
+ rSet.Put( SfxBoolItem( SID_PLUGINS_ACTIVE, !pImp->m_bPlugInsActive) );
+ break;
+ }
/*
- // SelectionText
- case SID_SELECTION_TEXT:
- {
- rSet.Put( SfxStringItem( SID_SELECTION_TEXT, GetSelectionText() ) );
- break;
- }
+ // SelectionText
+ case SID_SELECTION_TEXT:
+ {
+ rSet.Put( SfxStringItem( SID_SELECTION_TEXT, GetSelectionText() ) );
+ break;
+ }
- // SelectionTextExt
- case SID_SELECTION_TEXT_EXT:
- {
- rSet.Put( SfxStringItem( SID_SELECTION_TEXT_EXT, GetSelectionText(sal_True) ) );
- break;
- }
+ // SelectionTextExt
+ case SID_SELECTION_TEXT_EXT:
+ {
+ rSet.Put( SfxStringItem( SID_SELECTION_TEXT_EXT, GetSelectionText(sal_True) ) );
+ break;
+ }
*/
- case SID_STYLE_FAMILY :
- {
+ case SID_STYLE_FAMILY :
+ {
rSet.Put( SfxUInt16Item( SID_STYLE_FAMILY, pImp->m_nFamily ) );
- break;
- }
- }
+ break;
+ }
}
+ }
}
//--------------------------------------------------------------------
-void SfxViewShell::SetZoomFactor( const Fraction &rZoomX,
- const Fraction &rZoomY )
+void SfxViewShell::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY )
{
- DBG_ASSERT( GetWindow(), "no window" );
- MapMode aMap( GetWindow()->GetMapMode() );
- aMap.SetScaleX( rZoomX );
- aMap.SetScaleY( rZoomY );
- GetWindow()->SetMapMode( aMap );
+ DBG_ASSERT( GetWindow(), "no window" );
+ MapMode aMap( GetWindow()->GetMapMode() );
+ aMap.SetScaleX( rZoomX );
+ aMap.SetScaleY( rZoomY );
+ GetWindow()->SetMapMode( aMap );
}
//--------------------------------------------------------------------
@@ -936,30 +932,30 @@ ErrCode SfxViewShell::DoVerb(long /*nVerb*/)
*/
{
- return ERRCODE_SO_NOVERBS;
+ return ERRCODE_SO_NOVERBS;
}
//--------------------------------------------------------------------
void SfxViewShell::OutplaceActivated( sal_Bool bActive, SfxInPlaceClient* /*pClient*/ )
{
- if ( !bActive )
- GetFrame()->GetFrame().Appear();
+ if ( !bActive )
+ GetFrame()->GetFrame().Appear();
}
//--------------------------------------------------------------------
void SfxViewShell::InplaceActivating( SfxInPlaceClient* /*pClient*/ )
{
- // TODO/LATER: painting of the bitmap can be stopped, it is required if CLIPCHILDREN problem #i25788# is not solved,
- // but may be the bug will not affect the real office vcl windows, then it is not required
+ // TODO/LATER: painting of the bitmap can be stopped, it is required if CLIPCHILDREN problem #i25788# is not solved,
+ // but may be the bug will not affect the real office vcl windows, then it is not required
}
//--------------------------------------------------------------------
void SfxViewShell::InplaceDeactivated( SfxInPlaceClient* /*pClient*/ )
{
- // TODO/LATER: paint the replacement image in normal way if the painting was stopped
+ // TODO/LATER: paint the replacement image in normal way if the painting was stopped
}
//--------------------------------------------------------------------
@@ -999,26 +995,26 @@ SfxInPlaceClient* SfxViewShell::FindIPClient
) const
{
SfxInPlaceClientList *pClients = GetIPClientList_Impl(sal_False);
- if ( !pClients )
- return 0;
+ if ( !pClients )
+ return 0;
- if( !pObjParentWin )
- pObjParentWin = GetWindow();
- for (sal_uInt16 n=0; n < pClients->Count(); n++)
- {
- SfxInPlaceClient *pIPClient = (SfxInPlaceClient*) pClients->GetObject(n);
+ if( !pObjParentWin )
+ pObjParentWin = GetWindow();
+ for (sal_uInt16 n=0; n < pClients->Count(); n++)
+ {
+ SfxInPlaceClient *pIPClient = (SfxInPlaceClient*) pClients->GetObject(n);
if ( pIPClient->GetObject() == xObj && pIPClient->GetEditWin() == pObjParentWin )
- return pIPClient;
- }
+ return pIPClient;
+ }
- return 0;
+ return 0;
}
//--------------------------------------------------------------------
SfxInPlaceClient* SfxViewShell::GetIPClient() const
{
- return GetUIActiveClient();
+ return GetUIActiveClient();
}
//--------------------------------------------------------------------
@@ -1027,15 +1023,15 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const
{
// this method is needed as long as SFX still manages the border space for ChildWindows (see SfxFrame::Resize)
SfxInPlaceClientList *pClients = GetIPClientList_Impl(sal_False);
- if ( !pClients )
- return 0;
+ if ( !pClients )
+ return 0;
- for (sal_uInt16 n=0; n < pClients->Count(); n++)
- {
+ for (sal_uInt16 n=0; n < pClients->Count(); n++)
+ {
SfxInPlaceClient* pIPClient = pClients->GetObject(n);
if ( pIPClient->IsUIActive() )
return pIPClient;
- }
+ }
return NULL;
}
@@ -1043,15 +1039,15 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveIPClient_Impl() const
SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const
{
SfxInPlaceClientList *pClients = GetIPClientList_Impl(sal_False);
- if ( !pClients )
- return 0;
+ if ( !pClients )
+ return 0;
- for (sal_uInt16 n=0; n < pClients->Count(); n++)
- {
+ for (sal_uInt16 n=0; n < pClients->Count(); n++)
+ {
SfxInPlaceClient* pIPClient = pClients->GetObject(n);
if ( pIPClient->IsObjectUIActive() )
return pIPClient;
- }
+ }
return NULL;
}
@@ -1060,34 +1056,34 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const
void SfxViewShell::Activate( sal_Bool bMDI )
{
- DBG_CHKTHIS(SfxViewShell, 0);
- if ( bMDI )
- {
- SfxObjectShell *pSh = GetViewFrame()->GetObjectShell();
- if ( pSh->GetModel().is() )
- pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame().GetController() );
+ DBG_CHKTHIS(SfxViewShell, 0);
+ if ( bMDI )
+ {
+ SfxObjectShell *pSh = GetViewFrame()->GetObjectShell();
+ if ( pSh->GetModel().is() )
+ pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame().GetController() );
SetCurrentDocument();
- }
+ }
}
//--------------------------------------------------------------------
void SfxViewShell::Deactivate(sal_Bool /*bMDI*/)
{
- DBG_CHKTHIS(SfxViewShell, 0);
+ DBG_CHKTHIS(SfxViewShell, 0);
}
//--------------------------------------------------------------------
void SfxViewShell::AdjustPosSizePixel
(
- const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
- const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
+ const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
+ const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
)
{
- DBG_CHKTHIS(SfxViewShell, 0);
+ DBG_CHKTHIS(SfxViewShell, 0);
}
//--------------------------------------------------------------------
@@ -1117,8 +1113,8 @@ void SfxViewShell::Move()
void SfxViewShell::OuterResizePixel
(
- const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
- const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
+ const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
+ const Size& /*rSize*/ // gesamte zur Verf"ugung stehende Gr"o\se
)
/* [Beschreibung]
@@ -1164,16 +1160,16 @@ void SfxViewShell::OuterResizePixel
*/
{
- DBG_CHKTHIS(SfxViewShell, 0);
- SetBorderPixel( SvBorder() );
+ DBG_CHKTHIS(SfxViewShell, 0);
+ SetBorderPixel( SvBorder() );
}
//--------------------------------------------------------------------
void SfxViewShell::InnerResizePixel
(
- const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
- const Size& /*rSize*/ // dem Edit-Win zur Verf"ugung stehende Gr"o\se
+ const Point& /*rToolOffset*/,// linke obere Ecke der Tools im Frame-Window
+ const Size& /*rSize*/ // dem Edit-Win zur Verf"ugung stehende Gr"o\se
)
/* [Beschreibung]
@@ -1623,7 +1619,7 @@ void SfxViewShell::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::c
SfxViewShell* SfxViewShell::GetFirst
(
- const TypeId* pType,
+ ConvertToViewShell rConvert,
sal_Bool bOnlyVisible
)
{
@@ -1644,7 +1640,7 @@ SfxViewShell* SfxViewShell::GetFirst
if ( pFrame == pShell->GetViewFrame() )
{
// only ViewShells with a valid ViewFrame will be returned
- if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !pType || pShell->IsA(*pType) ) )
+ if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !rConvert || rConvert(pShell) ) )
return pShell;
break;
}
@@ -1661,7 +1657,7 @@ SfxViewShell* SfxViewShell::GetFirst
SfxViewShell* SfxViewShell::GetNext
(
const SfxViewShell& rPrev,
- const TypeId* pType,
+ ConvertToViewShell rConvert,
sal_Bool bOnlyVisible
)
{
@@ -1686,7 +1682,7 @@ SfxViewShell* SfxViewShell::GetNext
if ( pFrame == pShell->GetViewFrame() )
{
// only ViewShells with a valid ViewFrame will be returned
- if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !pType || pShell->IsA(*pType) ) )
+ if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !rConvert || rConvert(pShell) ) )
return pShell;
break;
}
@@ -1699,12 +1695,13 @@ SfxViewShell* SfxViewShell::GetNext
//--------------------------------------------------------------------
-void SfxViewShell::Notify( SfxBroadcaster& rBC,
- const SfxHint& rHint )
+void SfxViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxEventHint)) )
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if ( pSfxEventHint )
{
- switch ( ((SfxEventHint&)rHint).GetEventId() )
+ switch ( pSfxEventHint->GetEventId() )
{
case SFX_EVENT_LOADFINISHED:
{
@@ -1718,7 +1715,7 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC,
if ( frame == GetViewFrame() && &rBC == GetObjectShell() )
{
SfxItemSet* pSet = GetObjectShell()->GetMedium()->GetItemSet();
- SFX_ITEMSET_ARG( pSet, pItem, SfxUnoAnyItem, SID_VIEW_DATA, sal_False );
+ SFX_ITEMSET_ARG( pSet, pItem, SfxUnoAnyItem, SID_VIEW_DATA );
if ( pItem )
{
pImp->m_pController->restoreViewData(
@@ -1754,7 +1751,7 @@ sal_Bool SfxViewShell::ExecKey_Impl(const KeyEvent& aKey)
//--------------------------------------------------------------------
-FASTBOOL SfxViewShell::KeyInput( const KeyEvent &rKeyEvent )
+bool SfxViewShell::KeyInput( const KeyEvent &rKeyEvent )
/* [Beschreibung]
@@ -1765,7 +1762,7 @@ FASTBOOL SfxViewShell::KeyInput( const KeyEvent &rKeyEvent )
[R"uckgabewert]
- FASTBOOL sal_True
+ bool true
die Taste ist konfiguriert, der betreffende
Handler wurde gerufen
@@ -1788,7 +1785,7 @@ bool SfxViewShell::GlobalKeyInput_Impl( const KeyEvent &rKeyEvent )
//--------------------------------------------------------------------
-void SfxViewShell::ShowCursor( FASTBOOL /*bOn*/ )
+void SfxViewShell::ShowCursor( bool /*bOn*/ )
/* [Beschreibung]
diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx
index 46f0f2eaa18d..8ae3258fa161 100644
--- a/slideshow/source/engine/shapes/viewshape.cxx
+++ b/slideshow/source/engine/shapes/viewshape.cxx
@@ -341,8 +341,7 @@ namespace slideshow
aNonTranslationalShapeTransformation.scale( rOrigBounds.getWidth(),
rOrigBounds.getHeight() );
::basegfx::B2DHomMatrix aShapeTransformation( aNonTranslationalShapeTransformation );
- aShapeTransformation.translate( rOrigBounds.getMinX(),
- rOrigBounds.getMinY() );
+ aShapeTransformation.translate( rOrigBounds.getMinimum() );
const ::basegfx::B2DHomMatrix& rCanvasTransform(
rViewLayer->getSpriteTransformation() );
@@ -669,8 +668,7 @@ namespace slideshow
// of the shape's bound rect in device
// pixel into aLinearTransform below.
::basegfx::B2DHomMatrix aAdjustedCanvasTransform( aCanvasTransform );
- aAdjustedCanvasTransform.translate( -aTmpRect.getMinX(),
- -aTmpRect.getMinY() );
+ aAdjustedCanvasTransform.translate( -aTmpRect.getMinimum() );
pBitmapCanvas->setTransformation( aAdjustedCanvasTransform );
diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx
index 4aef3a37dee2..1667a9cafb50 100644
--- a/slideshow/source/engine/slide/userpaintoverlay.cxx
+++ b/slideshow/source/engine/slide/userpaintoverlay.cxx
@@ -143,37 +143,37 @@ namespace slideshow
void repaintWithoutPolygons()
{
- // must get access to the instance to erase all polygon
- for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end();
- aIter!=aEnd;
- ++aIter )
- {
- // fully clear view content to background color
- //(*aIter)->getCanvas()->clear();
+ // must get access to the instance to erase all polygon
+ for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end();
+ aIter!=aEnd;
+ ++aIter )
+ {
+ // fully clear view content to background color
+ //(*aIter)->getCanvas()->clear();
- //get via SlideImpl instance the bitmap of the slide unmodified to redraw it
- SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) );
- ::cppcanvas::CanvasSharedPtr pCanvas( (*aIter)->getCanvas() );
+ //get via SlideImpl instance the bitmap of the slide unmodified to redraw it
+ SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) );
+ ::cppcanvas::CanvasSharedPtr pCanvas( (*aIter)->getCanvas() );
- const ::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() );
- const ::basegfx::B2DPoint aOutPosPixel( aViewTransform * ::basegfx::B2DPoint() );
+ const ::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() );
+ const ::basegfx::B2DPoint aOutPosPixel( aViewTransform * ::basegfx::B2DPoint() );
- // setup a canvas with device coordinate space, the slide
- // bitmap already has the correct dimension.
- ::cppcanvas::CanvasSharedPtr pDevicePixelCanvas( pCanvas->clone() );
+ // setup a canvas with device coordinate space, the slide
+ // bitmap already has the correct dimension.
+ ::cppcanvas::CanvasSharedPtr pDevicePixelCanvas( pCanvas->clone() );
- pDevicePixelCanvas->setTransformation( ::basegfx::B2DHomMatrix() );
+ pDevicePixelCanvas->setTransformation( ::basegfx::B2DHomMatrix() );
- // render at given output position
- pBitmap->move( aOutPosPixel );
+ // render at given output position
+ pBitmap->move( aOutPosPixel );
- // clear clip (might have been changed, e.g. from comb
- // transition)
- pBitmap->clip( ::basegfx::B2DPolyPolygon() );
- pBitmap->draw( pDevicePixelCanvas );
+ // clear clip (might have been changed, e.g. from comb
+ // transition)
+ pBitmap->clip( ::basegfx::B2DPolyPolygon() );
+ pBitmap->draw( pDevicePixelCanvas );
- mrScreenUpdater.notifyUpdate(*aIter,true);
- }
+ mrScreenUpdater.notifyUpdate(*aIter,true);
+ }
}
bool eraseAllInkChanged( bool const& rEraseAllInk )
@@ -188,8 +188,8 @@ namespace slideshow
repaintWithoutPolygons();
maPolygons.clear();
}
- mbIsEraseAllModeActivated=false;
- return true;
+ mbIsEraseAllModeActivated=false;
+ return true;
}
bool eraseInkWidthChanged( sal_Int32 rEraseInkSize )
@@ -288,9 +288,7 @@ namespace slideshow
// handlers. This effectively permits effect
// advancements via clicks also when user paint is
// enabled.
- if( mbIsLastMouseDownPosValid &&
- ::basegfx::B2DPoint( e.X,
- e.Y ) == maLastMouseDownPos )
+ if( mbIsLastMouseDownPosValid && ::basegfx::B2DPoint( e.X, e.Y ) == maLastMouseDownPos )
{
mbIsLastMouseDownPosValid = false;
return false;
@@ -371,7 +369,7 @@ namespace slideshow
//The point is to redraw the LastPoint the way it was originally on the bitmap,
//of the slide
- for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end();
+ for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end();
aIter!=aEnd;
++aIter )
{
@@ -393,7 +391,7 @@ namespace slideshow
pBitmap->move( aOutPosPixel );
::basegfx::B2DPolyPolygon aPolyPoly=::basegfx::B2DPolyPolygon(aPoly);
- aViewTransform.translate(-aOutPosPixel.getX(), -aOutPosPixel.getY());
+ aViewTransform.translate(-aOutPosPixel);
aPolyPoly.transform(aViewTransform);
// set clip so that we just redraw a part of the canvas
pBitmap->clip(aPolyPoly);
@@ -402,7 +400,7 @@ namespace slideshow
mrScreenUpdater.notifyUpdate(*aIter,true);
}
- }
+ }
else
{
if( !mbIsLastPointValid )
diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx
index 43728ce1783a..c4879f784268 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -146,8 +146,7 @@ namespace slideshow
// center of the shape to the origin (the
// translate( -0.5, -0.5 ) above), translate to
// center of final shape position here.
- aTransform.translate( rShapeBounds.getCenterX(),
- rShapeBounds.getCenterY() );
+ aTransform.translate( rShapeBounds.getCenter() );
return aTransform;
}
diff --git a/slideshow/source/engine/transitions/clippingfunctor.cxx b/slideshow/source/engine/transitions/clippingfunctor.cxx
index 2960fb2a3e20..717c0e3e5232 100644
--- a/slideshow/source/engine/transitions/clippingfunctor.cxx
+++ b/slideshow/source/engine/transitions/clippingfunctor.cxx
@@ -220,8 +220,7 @@ namespace slideshow
}
else
{
- aMatrix.scale( rTargetSize.getX(),
- rTargetSize.getY() );
+ aMatrix.scale( rTargetSize );
}
// apply cumulative transformation to clip polygon
diff --git a/slideshow/source/engine/transitions/combtransition.cxx b/slideshow/source/engine/transitions/combtransition.cxx
index db0619369464..bf1376caeccd 100644
--- a/slideshow/source/engine/transitions/combtransition.cxx
+++ b/slideshow/source/engine/transitions/combtransition.cxx
@@ -67,8 +67,7 @@ basegfx::B2DPolyPolygon createClipPolygon(
basegfx::B2DHomMatrix aMatrix(basegfx::tools::createRotateAroundPoint(0.5, 0.5, aUpVec.angle( rDirection )));
// blow up clip polygon to slide size
- aMatrix.scale( rSlideSize.getX(),
- rSlideSize.getY() );
+ aMatrix.scale( rSlideSize );
aClipPoly.transform( aMatrix );
diff --git a/slideshow/source/engine/transitions/transitiontools.cxx b/slideshow/source/engine/transitions/transitiontools.cxx
index e05b7e453e80..b7e356a9f3ce 100644
--- a/slideshow/source/engine/transitions/transitiontools.cxx
+++ b/slideshow/source/engine/transitions/transitiontools.cxx
@@ -38,9 +38,7 @@ namespace internal {
// TODO(Q2): Move this to basegfx
::basegfx::B2DPolygon createUnitRect()
{
- return ::basegfx::tools::createPolygonFromRect(
- ::basegfx::B2DRectangle(0.0,0.0,
- 1.0,1.0 ) );
+ return ::basegfx::tools::createUnitPolygon();
}
::basegfx::B2DPolyPolygon flipOnYAxis(
diff --git a/soldep/source/soldep.cxx b/soldep/source/soldep.cxx
index 3f9a279840dc..e4bd782cc936 100644
--- a/soldep/source/soldep.cxx
+++ b/soldep/source/soldep.cxx
@@ -126,9 +126,11 @@ void SolDep::Init( ByteString &rVersion, GenericInformationList *pVersionList )
IMPL_LINK( SolDep, ChildWindowEventListener, VclSimpleEvent*, pEvent )
/*****************************************************************************/
{
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ VclWindowEvent* pVclWindowEvent = dynamic_cast< VclWindowEvent* >(pEvent);
+
+ if ( pVclWindowEvent )
{
- ProcessChildWindowEvent( *static_cast< VclWindowEvent* >( pEvent ) );
+ ProcessChildWindowEvent( *pVclWindowEvent );
}
return 0;
}
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index 8054495bd3e3..6fe30b62ab4a 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -33,19 +33,19 @@ gb_SrsPartMergeTarget_REPOS := $(gb_REPOS)
define gb_SrsPartMergeTarget__command
$(call gb_Output_announce,$(3),$(true),srs,1)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \
- -p $(firstword $(subst /, ,$(2))) \
- -i $(3) \
- -o $(1) \
- -m $(SDF) \
- -l all)
+ mkdir -p $(dir $(1)) && \
+ $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \
+ -p $(firstword $(subst /, ,$(2))) \
+ -i $(3) \
+ -o $(1) \
+ -m $(SDF) \
+ -l all)
endef
define gb_SrsPartMergeTarget__rules
$$(call gb_SrsPartMergeTarget_get_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY) | $$(gb_SrsPartMergeTarget_TRANSEXTARGET)
- $$(if $$(SDF),$$(call gb_SrsPartMergeTarget__command,$$@,$$*,$$<),mkdir -p $$(dir $$@) && cp $$< $$@)
+ $$(if $$(SDF),$$(call gb_SrsPartMergeTarget__command,$$@,$$*,$$<),mkdir -p $$(dir $$@) && cp $$< $$@)
endef
@@ -61,29 +61,29 @@ gb_SrsPartTarget_REPOS := $(gb_REPOS)
define gb_SrsPartTarget__command
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- RESPONSEFILE=`$(gb_MKTEMP)` && \
- echo "-s \
- $(INCLUDE) \
- -I$(dir $(3)) \
- $(DEFS) \
- -fp=$(1) \
- $(if $(MERGEDFILE),$(MERGEDFILE),$<)" > $${RESPONSEFILE} && \
- $(gb_SrsPartTarget_RSCCOMMAND) -presponse @$${RESPONSEFILE} && \
- rm -rf $${RESPONSEFILE})
+ mkdir -p $(dir $(1)) && \
+ RESPONSEFILE=`$(gb_MKTEMP)` && \
+ echo "-s \
+ $(INCLUDE) \
+ -I$(dir $(3)) \
+ $(DEFS) \
+ -fp=$(1) \
+ $(if $(MERGEDFILE),$(MERGEDFILE),$<)" > $${RESPONSEFILE} && \
+ $(gb_SrsPartTarget_RSCCOMMAND) -presponse @$${RESPONSEFILE} && \
+ rm -rf $${RESPONSEFILE})
endef
define gb_SrsPartTarget__rules
$$(call gb_SrsPartTarget_get_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY) | $$(gb_SrsPartTarget_RSCTARGET)
- $$(call gb_SrsPartTarget__command_dep,$$*,$$<)
- $$(call gb_SrsPartTarget__command,$$@,$$*,$$<)
+ $$(call gb_SrsPartTarget__command_dep,$$*,$$<)
+ $$(call gb_SrsPartTarget__command,$$@,$$*,$$<)
ifeq ($(gb_FULLDEPS),$(true))
$$(call gb_SrsPartTarget_get_dep_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY)
- $$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $$(dir $$@) && \
- echo '$$(call gb_SrsPartTarget_get_target,$$*) : $$(gb_Helper_PHONY)' > $$@)
+ $$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $$(dir $$@) && \
+ echo '$$(call gb_SrsPartTarget_get_target,$$*) : $$(gb_Helper_PHONY)' > $$@)
endif
endef
@@ -92,7 +92,7 @@ $(foreach repo,$(gb_SrsPartTarget_REPOS),$(eval $(call gb_SrsPartTarget__rules,$
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_SrsPartTarget_get_dep_target,%) :
- $(eval $(call gb_Output_error,Unable to find resource definition file $* in repositories: $(gb_SrsPartTarget_REPOS)))
+ $(eval $(call gb_Output_error,Unable to find resource definition file $* in repositories: $(gb_SrsPartTarget_REPOS)))
endif
@@ -115,33 +115,33 @@ gb_SrsTarget_DEFAULTDEFS := $(gb_GLOBALDEFS)
.PHONY : $(call gb_SrsTarget_get_clean_target,%)
$(call gb_SrsTarget_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),SRS,1)
- -$(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_SrsTarget_get_target,$*) \
- $(call gb_SrsTarget_get_dep_target,$*) \
- $(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_target,$(part))) \
- $(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part))) \
- $(foreach part,$(PARTS),$(call gb_SrsPartMergeTarget_get_target,$(part))))
+ $(call gb_Output_announce,$*,$(false),SRS,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_SrsTarget_get_target,$*) \
+ $(call gb_SrsTarget_get_dep_target,$*) \
+ $(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_target,$(part))) \
+ $(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part))) \
+ $(foreach part,$(PARTS),$(call gb_SrsPartMergeTarget_get_target,$(part))))
ifeq ($(gb_FULLDEPS),$(true))
define gb_SrsTarget__command_dep
$(call gb_Output_announce,SRS:$(2),$(true),DEP,1)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- cat $(3) > $(1))
+ mkdir -p $(dir $(1)) && \
+ cat $(3) > $(1))
endef
endif
$(call gb_SrsTarget_get_target,%) :
- $(call gb_SrsTarget__command_dep,$(call gb_SrsTarget_get_dep_target,$*),$*,$(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part))))
- $(call gb_Output_announce,$*,$(true),SRS,1)
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && \
- cat $^ > $@)
+ $(call gb_SrsTarget__command_dep,$(call gb_SrsTarget_get_dep_target,$*),$*,$(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part))))
+ $(call gb_Output_announce,$*,$(true),SRS,1)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ cat $^ > $@)
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_SrsTarget_get_dep_target,%) :
- $(call gb_SrsTarget__command_dep,$@,$*,$^)
+ $(call gb_SrsTarget__command_dep,$@,$*,$^)
endif
define gb_SrsTarget_SrsTarget
@@ -199,38 +199,38 @@ gb_ResTarget_RSCCOMMAND := $(gb_SrsPartTarget_RSCCOMMAND)
gb_ResTarget_DEFIMAGESLOCATION := $(SRCDIR)/default_images/
$(call gb_ResTarget_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),RES,2)
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_ResTarget_get_target,$*) $(call gb_ResTarget_get_imagelist_target,$*) $(call gb_ResTarget_get_outdir_target,$*) $(call gb_ResTarget_get_outdir_imagelist_target,$*))
+ $(call gb_Output_announce,$*,$(false),RES,2)
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_ResTarget_get_target,$*) $(call gb_ResTarget_get_imagelist_target,$*) $(call gb_ResTarget_get_outdir_target,$*) $(call gb_ResTarget_get_outdir_imagelist_target,$*))
$(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) | $(gb_ResTarget_RSCTARGET)
- $(call gb_Output_announce,$*,$(true),RES,2)
- $(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $@) $(OUTDIR)/bin \
- $(dir $(call gb_ResTarget_get_imagelist_target,$*)) && \
- RESPONSEFILE=`$(gb_MKTEMP)` && \
- echo "-r -p \
- -lg$(LANGUAGE) \
- -fs=$@ \
- -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/$(LIBRARY)) \
- -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE)) \
- -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst) \
- -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE)) \
- -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res) \
- -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)) \
- -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res/$(LANGUAGE) \
- -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res \
- -subMODULE=$(dir $(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION))) \
- -subGLOBALRES=$(gb_ResTarget_DEFIMAGESLOCATION)res \
- -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$*)) \
- $(filter-out $(gb_Helper_MISCDUMMY),$^)" > $${RESPONSEFILE} && \
- $(gb_ResTarget_RSCCOMMAND) @$${RESPONSEFILE} && \
- rm -f $${RESPONSEFILE})
+ $(call gb_Output_announce,$*,$(true),RES,2)
+ $(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $@) $(OUTDIR)/bin \
+ $(dir $(call gb_ResTarget_get_imagelist_target,$*)) && \
+ RESPONSEFILE=`$(gb_MKTEMP)` && \
+ echo "-r -p \
+ -lg$(LANGUAGE) \
+ -fs=$@ \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/$(LIBRARY)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)) \
+ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res/$(LANGUAGE) \
+ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res \
+ -subMODULE=$(dir $(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION))) \
+ -subGLOBALRES=$(gb_ResTarget_DEFIMAGESLOCATION)res \
+ -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$*)) \
+ $(filter-out $(gb_Helper_MISCDUMMY),$^)" > $${RESPONSEFILE} && \
+ $(gb_ResTarget_RSCCOMMAND) @$${RESPONSEFILE} && \
+ rm -f $${RESPONSEFILE})
$(call gb_ResTarget_get_outdir_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- $(call gb_Deliver_deliver,$<,$@) && \
- $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(ILSTTARGET)),$(ILSTTARGET)))
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) && \
+ $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(ILSTTARGET)),$(ILSTTARGET)))
define gb_ResTarget_ResTarget
$(call gb_ResTarget_get_target,$(1)) : LIBRARY = $(2)
@@ -260,13 +260,13 @@ endef
define gb_ResTarget_add_files
$(foreach file,$(2),\
- $(call gb_ResTarget_add_file,$(1),$(file)))
+ $(call gb_ResTarget_add_file,$(1),$(file)))
endef
define gb_ResTarget_add_srs
$(foreach srs,$(2),\
- $(call gb_ResTarget_add_one_srs,$(1),$(srs)))
+ $(call gb_ResTarget_add_one_srs,$(1),$(srs)))
endef
@@ -285,35 +285,35 @@ gb_AllLangResTarget_LANGS := $(1)
endef
$(call gb_AllLangResTarget_get_clean_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_AllLangResTarget_get_target,$*))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_AllLangResTarget_get_target,$*))
$(call gb_AllLangResTarget_get_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && touch $@)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && touch $@)
define gb_AllLangResTarget_AllLangResTarget
$(foreach lang,$(gb_AllLangResTarget_LANGS),\
- $(call gb_ResTarget_ResTarget,$(1)$(lang),$(1),$(lang)))
+ $(call gb_ResTarget_ResTarget,$(1)$(lang),$(1),$(lang)))
$$(eval $$(call gb_Module_register_target,$(call gb_AllLangResTarget_get_target,$(1)),$(call gb_AllLangResTarget_get_clean_target,$(1))))
endef
define gb_AllLangResTarget_add_one_srs
$(foreach lang,$(gb_AllLangResTarget_LANGS),\
- $(call gb_ResTarget_add_one_srs,$(1)$(lang),$(2)))
+ $(call gb_ResTarget_add_one_srs,$(1)$(lang),$(2)))
endef
define gb_AllLangResTarget_add_srs
$(foreach srs,$(2),\
- $(call gb_AllLangResTarget_add_one_srs,$(1),$(srs)))
+ $(call gb_AllLangResTarget_add_one_srs,$(1),$(srs)))
endef
define gb_AllLangResTarget_set_reslocation
$(foreach lang,$(gb_AllLangResTarget_LANGS),\
- $(call gb_ResTarget_set_reslocation,$(1)$(lang),$(2)))
+ $(call gb_ResTarget_set_reslocation,$(1)$(lang),$(2)))
endef
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index ee024955fbb5..ecb448222498 100644
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -29,30 +29,30 @@ gb_ComponentTarget_get_source = $(1)/$(2).component
define gb_ComponentTarget__command
$(call gb_Output_announce,$(3),$(true),CMP,1)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- $(gb_XSLTPROC) --nonet --stringparam uri \
- '$(subst \d,$$,$(COMPONENTPREFIX))$(LIBFILENAME)' -o $(1) \
- $(gb_ComponentTarget_XSLTCOMMANDFILE) $(2))
+ mkdir -p $(dir $(1)) && \
+ $(gb_XSLTPROC) --nonet --stringparam uri \
+ '$(subst \d,$$,$(COMPONENTPREFIX))$(LIBFILENAME)' -o $(1) \
+ $(gb_ComponentTarget_XSLTCOMMANDFILE) $(2))
endef
define gb_ComponentTarget__rules
$$(call gb_ComponentTarget_get_target,%) : $$(call gb_ComponentTarget_get_source,$(1),%) | $(gb_XSLTPROCTARGET)
- $$(call gb_ComponentTarget__command,$$@,$$<,$$*)
+ $$(call gb_ComponentTarget__command,$$@,$$<,$$*)
$$(call gb_ComponentTarget_get_clean_target,%) :
- $$(call gb_Output_announce,$$*,$(false),CMP,1)
- rm -f $$(call gb_ComponentTarget_get_outdir_target,$$*) $$(call gb_ComponentTarget_get_target,$$*)
+ $$(call gb_Output_announce,$$*,$(false),CMP,1)
+ rm -f $$(call gb_ComponentTarget_get_outdir_target,$$*) $$(call gb_ComponentTarget_get_target,$$*)
endef
$(foreach repo,$(gb_ComponentTarget_REPOS),$(eval $(call gb_ComponentTarget__rules,$(repo))))
$(call gb_ComponentTarget_get_target,%) :
- $(eval $(call gb_Outpt_error,Unable to find component file $(call gb_ComponentTarget_get_source,,$*) in the repositories: $(gb_ComponentTarget_REPOS) or xlstproc is missing.))
+ $(eval $(call gb_Outpt_error,Unable to find component file $(call gb_ComponentTarget_get_source,,$*) in the repositories: $(gb_ComponentTarget_REPOS) or xlstproc is missing.))
$(call gb_ComponentTarget_get_external_target,%) :
- $(call gb_Deliver_deliver,$<,$@)
+ $(call gb_Deliver_deliver,$<,$@)
define gb_ComponentTarget_ComponentTarget
$(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(3)
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 37cde859542b..b29cd212d36d 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -37,15 +37,15 @@ gb_CppunitTest__get_linktargetname = CppunitTest/$(call gb_CppunitTest_get_filen
.PHONY : $(call gb_CppunitTest_get_clean_target,%)
$(call gb_CppunitTest_get_clean_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_CppunitTest_get_target,$*) $(call gb_CppunitTest_get_target,$*).log)
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_CppunitTest_get_target,$*) $(call gb_CppunitTest_get_target,$*).log)
.PHONY : $(call gb_CppunitTest_get_target,%)
$(call gb_CppunitTest_get_target,%) : $(gb_CppunitTest_CPPTESTTARGET)
- $(call gb_Output_announce,$*,$(true),CUT,2)
- $(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $@) && \
- $(gb_CppunitTest_CPPTESTCOMMAND) $(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) > $@.log 2>&1 || (cat $@.log && false))
+ $(call gb_Output_announce,$*,$(true),CUT,2)
+ $(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $@) && \
+ $(gb_CppunitTest_CPPTESTCOMMAND) $(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) > $@.log 2>&1 || (cat $@.log && false))
define gb_CppunitTest_CppunitTest
$(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest__get_linktargetname,$(1)))
@@ -69,28 +69,28 @@ gb_CppunitTest_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_CppunitTest__get_lin
endef
$(eval $(foreach method,\
- add_cobject \
- add_cobjects \
- add_cxxobject \
- add_cxxobjects \
- add_objcxxobject \
- add_objcxxobjects \
- add_exception_objects \
- add_noexception_objects \
- set_cflags \
- set_cxxflags \
- set_objcxxflags \
- set_defs \
- set_include \
- set_ldflags \
- set_library_path_flags \
- add_linked_libs \
- add_linked_static_libs \
- add_package_headers \
- add_sdi_headers \
- add_precompiled_header \
+ add_cobject \
+ add_cobjects \
+ add_cxxobject \
+ add_cxxobjects \
+ add_objcxxobject \
+ add_objcxxobjects \
+ add_exception_objects \
+ add_noexception_objects \
+ set_cflags \
+ set_cxxflags \
+ set_objcxxflags \
+ set_defs \
+ set_include \
+ set_ldflags \
+ set_library_path_flags \
+ add_linked_libs \
+ add_linked_static_libs \
+ add_package_headers \
+ add_sdi_headers \
+ add_precompiled_header \
,\
- $(call gb_CppunitTest__forward_to_Linktarget,$(method))\
+ $(call gb_CppunitTest__forward_to_Linktarget,$(method))\
))
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/CustomTarget.mk b/solenv/gbuild/CustomTarget.mk
index a134932f78ca..43c3f50dee10 100644
--- a/solenv/gbuild/CustomTarget.mk
+++ b/solenv/gbuild/CustomTarget.mk
@@ -26,30 +26,30 @@ gb_CustomTarget_REPOSITORYNAMES := $(gb_Helper_REPOSITORYNAMES)
# N.B.: putting the "+" there at the start activates the GNU make job server
define gb_CustomTarget__command
+$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(call gb_CustomTarget_get_workdir,$(2)) && \
- $(MAKE) -C $(call gb_CustomTarget_get_workdir,$(2)) -f $< && \
- touch $(1))
+ mkdir -p $(call gb_CustomTarget_get_workdir,$(2)) && \
+ $(MAKE) -C $(call gb_CustomTarget_get_workdir,$(2)) -f $< && \
+ touch $(1))
endef
define gb_CustomTarget__rules
$$(call gb_CustomTarget_get_repo_target,$(1),%) :
- $$(call gb_Output_announce,$$*,$$(true),MAK,3)
- $$(call gb_CustomTarget__command,$$@,$$*)
+ $$(call gb_Output_announce,$$*,$$(true),MAK,3)
+ $$(call gb_CustomTarget__command,$$@,$$*)
$$(call gb_CustomTarget_get_target,%) : $$(call gb_CustomTarget_get_repo_target,$(1),%)
- $$(call gb_Helper_abbreviate_dirs,\
- touch $$@)
+ $$(call gb_Helper_abbreviate_dirs,\
+ touch $$@)
endef
.PHONY: $(call gb_CustomTarget_get_clean_target,%)
$(call gb_CustomTarget_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),MAK,3)
- $(call gb_Helper_abbreviate_dirs,\
- rm -rf $(call gb_CustomTarget_get_workdir,$*) && \
- rm -f $(call gb_CustomTarget_get_target,$*) \
- $(foreach reponame,$(gb_CustomTarget_REPOSITORYNAMES),$(call gb_CustomTarget_get_repo_target,$(reponame),$*)))
+ $(call gb_Output_announce,$*,$(false),MAK,3)
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -rf $(call gb_CustomTarget_get_workdir,$*) && \
+ rm -f $(call gb_CustomTarget_get_target,$*) \
+ $(foreach reponame,$(gb_CustomTarget_REPOSITORYNAMES),$(call gb_CustomTarget_get_repo_target,$(reponame),$*)))
$(foreach reponame,$(gb_CustomTarget_REPOSITORYNAMES),$(eval $(call gb_CustomTarget__rules,$(reponame))))
@@ -60,7 +60,7 @@ endef
define gb_CustomTarget_CustomTarget
$(foreach reponame,$(gb_CustomTarget_REPOSITORYNAMES),\
- $(eval $(call gb_CustomTarget_get_repo_target,$(reponame),$(1)) : $(call gb_CustomTarget__get_makefile,$($(reponame)),$(1))))
+ $(eval $(call gb_CustomTarget_get_repo_target,$(reponame),$(1)) : $(call gb_CustomTarget__get_makefile,$($(reponame)),$(1))))
$(call gb_CustomTarget_get_workdir,$(1))/% : $(call gb_CustomTarget_get_target,$(1))
@@ -69,7 +69,7 @@ endef
define gb_CustomTarget_add_dependency
$(foreach reponame,$(gb_CustomTarget_REPOSITORYNAMES),\
- $(eval $(call gb_CustomTarget_get_repo_target,$(reponame),$(1)) : $($(reponame))/$(2)))
+ $(eval $(call gb_CustomTarget_get_repo_target,$(reponame),$(1)) : $($(reponame))/$(2)))
endef
@@ -80,7 +80,7 @@ endef
define gb_CustomTarget_add_outdir_dependency
$(foreach reponame,$(gb_CustomTarget_REPOSITORYNAMES),\
- $(eval $(call gb_CustomTarget_get_repo_target,$(reponame),$(1)) : $(2)))
+ $(eval $(call gb_CustomTarget_get_repo_target,$(reponame),$(1)) : $(2)))
endef
diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk
index 14af2854b097..41257991f03b 100644
--- a/solenv/gbuild/Deliver.mk
+++ b/solenv/gbuild/Deliver.mk
@@ -74,8 +74,8 @@ endef
# deliver.log format is broken in that case anyway
.PHONY : deliverlog showdeliverables
deliverlog:
- $(eval $(call gb_Deliver_setdeliverlogcommand))
- $(call gb_Helper_abbreviate_dirs, $(COMMAND))
+ $(eval $(call gb_Deliver_setdeliverlogcommand))
+ $(call gb_Helper_abbreviate_dirs, $(COMMAND))
# all : deliverlog
@@ -84,8 +84,8 @@ $(info $(1) $(patsubst $(OUTDIR)/%,%,$(2)))
endef
showdeliverables :
- $(eval MAKEFLAGS := s)
- $(foreach deliverable,$(sort $(gb_Deliver_DELIVERABLES)),\
- $(call gb_Deliver_print_deliverable,$(REPODIR)/$(firstword $(subst :, ,$(deliverable))),$(REPODIR)/$(lastword $(subst :, ,$(deliverable)))))
- true
+ $(eval MAKEFLAGS := s)
+ $(foreach deliverable,$(sort $(gb_Deliver_DELIVERABLES)),\
+ $(call gb_Deliver_print_deliverable,$(REPODIR)/$(firstword $(subst :, ,$(deliverable))),$(REPODIR)/$(lastword $(subst :, ,$(deliverable)))))
+ true
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 62087a3caa2f..658b032e047c 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -28,14 +28,14 @@
.PHONY : $(call gb_Executable_get_clean_target,%)
$(call gb_Executable_get_clean_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_Executable_get_target,$*) \
- $(AUXTARGETS))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_Executable_get_target,$*) \
+ $(AUXTARGETS))
$(call gb_Executable_get_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- $(call gb_Deliver_deliver,$<,$@) \
- $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
define gb_Executable_Executable
$(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT))
@@ -59,29 +59,29 @@ gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),Executable/$$(1)$$(gb_Executable
endef
$(eval $(foreach method,\
- add_cobject \
- add_cobjects \
- add_cxxobject \
- add_cxxobjects \
- add_objcxxobject \
- add_objcxxobjects \
- add_exception_objects \
- add_noexception_objects \
- add_generated_exception_objects \
- set_cflags \
- set_cxxflags \
- set_objcxxflags \
- set_defs \
- set_include \
- set_ldflags \
- set_library_path_flags \
- add_linked_libs \
- add_linked_static_libs \
- add_package_headers \
- add_sdi_headers \
- add_precompiled_header \
+ add_cobject \
+ add_cobjects \
+ add_cxxobject \
+ add_cxxobjects \
+ add_objcxxobject \
+ add_objcxxobjects \
+ add_exception_objects \
+ add_noexception_objects \
+ add_generated_exception_objects \
+ set_cflags \
+ set_cxxflags \
+ set_objcxxflags \
+ set_defs \
+ set_include \
+ set_ldflags \
+ set_library_path_flags \
+ add_linked_libs \
+ add_linked_static_libs \
+ add_package_headers \
+ add_sdi_headers \
+ add_precompiled_header \
,\
- $(call gb_Executable_forward_to_Linktarget,$(method))\
+ $(call gb_Executable_forward_to_Linktarget,$(method))\
))
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index f1cb94253d8a..f745c810c202 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -43,7 +43,7 @@ gb_Helper_REPOSITORYNAMES :=
.PHONY : $(WORKDIR)/Misc/PHONY
$(gb_Helper_MISCDUMMY) :
- @mkdir -p $(dir $@) && touch $@
+ @mkdir -p $(dir $@) && touch $@
define gb_Helper_abbreviate_dirs
R=$(REPODIR) && \
@@ -69,19 +69,19 @@ endef
define gb_Helper_make_clean_targets
$(foreach targettype,$(1),\
- $(call gb_Helper_make_clean_target,$(targettype)))
+ $(call gb_Helper_make_clean_target,$(targettype)))
endef
define gb_Helper_make_outdir_clean_targets
$(foreach targettype,$(1),\
- $(call gb_Helper_make_outdir_clean_target,$(targettype)))
+ $(call gb_Helper_make_outdir_clean_target,$(targettype)))
endef
define gb_Helper_make_dep_targets
$(foreach targettype,$(1),\
- $(call gb_Helper_make_dep_target,$(targettype)))
+ $(call gb_Helper_make_dep_target,$(targettype)))
endef
diff --git a/solenv/gbuild/JavaClassSet.mk b/solenv/gbuild/JavaClassSet.mk
index b852220674e3..a103d298fd6a 100644
--- a/solenv/gbuild/JavaClassSet.mk
+++ b/solenv/gbuild/JavaClassSet.mk
@@ -26,27 +26,27 @@ gb_JavaClassSet_JAVACCOMMAND := $(JAVACOMPILER)
define gb_JavaClassSet__command
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- $(gb_JavaClassSet_JAVACCOMMAND) -cp "$(CLASSPATH)" -d $(call gb_JavaClassSet_get_classdir,$(2)) $(3) && \
- touch $(1))
+ mkdir -p $(dir $(1)) && \
+ $(gb_JavaClassSet_JAVACCOMMAND) -cp "$(CLASSPATH)" -d $(call gb_JavaClassSet_get_classdir,$(2)) $(3) && \
+ touch $(1))
endef
define gb_JavaClassSet__rules
$$(call gb_JavaClassSet_get_repo_target,$(1),%) :
- $$(call gb_JavaClassSet__command,$$@,$$*,$$?)
+ $$(call gb_JavaClassSet__command,$$@,$$*,$$?)
$$(call gb_JavaClassSet_get_target,%) : $$(call gb_JavaClassSet_get_repo_target,$(1),%)
- $$(call gb_Output_announce,$$*,$$(true),JCS,3)
- $$(call gb_Helper_abbreviate_dirs,\
- touch $$@)
+ $$(call gb_Output_announce,$$*,$$(true),JCS,3)
+ $$(call gb_Helper_abbreviate_dirs,\
+ touch $$@)
endef
$(call gb_JavaClassSet_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),JCS,3)
- $(call gb_Helper_abbreviate_dirs,\
- rm -rf $(dir $(call gb_JavaClassSet_get_target,$*)))
+ $(call gb_Output_announce,$*,$(false),JCS,3)
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -rf $(dir $(call gb_JavaClassSet_get_target,$*)))
$(foreach reponame,$(gb_JavaClassSet_REPOSITORYNAMES),$(eval $(call gb_JavaClassSet__rules,$(reponame))))
@@ -60,7 +60,7 @@ endef
define gb_JavaClassSet_add_sourcefile
$(foreach reponame,$(gb_JavaClassSet_REPOSITORYNAMES),\
- $(eval $(call gb_JavaClassSet_get_repo_target,$(reponame),$(1)) : $(call gb_JavaClassSet__get_sourcefile,$($(reponame)),$(2))))
+ $(eval $(call gb_JavaClassSet_get_repo_target,$(reponame),$(1)) : $(call gb_JavaClassSet__get_sourcefile,$($(reponame)),$(2))))
endef
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 8293777efce5..dc2435a5d429 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -32,18 +32,18 @@ export DBGSV_ERROR_OUT
.PHONY : $(call gb_JunitTest_get_clean_target,%)
$(call gb_JunitTest_get_clean_target,%) : $(call gb_JavaClassSet_get_clean_target,$(call gb_JunitTest_get_classsetname,%))
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $@ $@.log)
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $@ $@.log)
.PHONY : $(call gb_JunitTest_get_target,$(1))
$(call gb_JunitTest_get_target,%) :
- $(call gb_Output_announce,$*,$(true),JUT,2)
- $(call gb_Helper_abbreviate_dirs_native,\
+ $(call gb_Output_announce,$*,$(true),JUT,2)
+ $(call gb_Helper_abbreviate_dirs_native,\
rm -rf $(call gb_JunitTest_get_userdir,$*) && \
- mkdir -p $(call gb_JunitTest_get_userdir,$*) && \
- $(gb_JunitTest_JAVACOMMAND) -cp "$(CLASSPATH)" $(DEFS) org.junit.runner.JUnitCore $(CLASSES) 2>&1 > $@.log || (cat $@.log && false) && \
+ mkdir -p $(call gb_JunitTest_get_userdir,$*) && \
+ $(gb_JunitTest_JAVACOMMAND) -cp "$(CLASSPATH)" $(DEFS) org.junit.runner.JUnitCore $(CLASSES) 2>&1 > $@.log || (cat $@.log && false) && \
rm -rf $(call gb_JunitTest_get_userdir,$*))
- $(CLEAN_CMD)
+ $(CLEAN_CMD)
define gb_JunitTest_JunitTest
$(call gb_JunitTest_get_target,$(1)) : CLASSPATH := $(value XCLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 3c6fc5284e56..17f1a0c09a3b 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -40,15 +40,15 @@ gb_Library__get_linktargetname = Library/$(call gb_Library_get_filename,$(1))
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
.PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT)
$(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) :
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \
- $(AUXTARGETS))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \
+ $(AUXTARGETS))
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
$(gb_Library_OUTDIRLOCATION)/%$(gb_Library_PLAINEXT) :
- $(call gb_Helper_abbreviate_dirs,\
- $(call gb_Deliver_deliver,$<,$@) \
- $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
define gb_Library_Library
ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS)))
@@ -65,8 +65,8 @@ define gb_Library__Library_impl
$(call gb_LinkTarget_LinkTarget,$(2))
$(call gb_LinkTarget_set_targettype,$(2),Library)
$(call gb_LinkTarget_set_defs,$(2),\
- $$(DEFS) \
- $(gb_Library_DEFS) \
+ $$(DEFS) \
+ $(gb_Library_DEFS) \
)
$(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
$(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
@@ -102,30 +102,30 @@ gb_Library_get_runtime_filename = \
$(or $(call gb_Library_get_dllname,$(1)),$(call gb_Library_get_filename,$(1)))
$(eval $(foreach method,\
- add_cobject \
- add_cobjects \
- add_cxxobject \
- add_cxxobjects \
- add_objcxxobject \
- add_objcxxobjects \
- add_exception_objects \
- add_noexception_objects \
- add_generated_exception_objects \
- set_cflags \
- set_cxxflags \
- set_objcxxflags \
- set_defs \
- set_include \
- set_ldflags \
- set_library_path_flags \
- add_linked_libs \
- add_linked_static_libs \
- add_external_libs \
- add_package_headers \
- add_sdi_headers \
- add_precompiled_header \
+ add_cobject \
+ add_cobjects \
+ add_cxxobject \
+ add_cxxobjects \
+ add_objcxxobject \
+ add_objcxxobjects \
+ add_exception_objects \
+ add_noexception_objects \
+ add_generated_exception_objects \
+ set_cflags \
+ set_cxxflags \
+ set_objcxxflags \
+ set_defs \
+ set_include \
+ set_ldflags \
+ set_library_path_flags \
+ add_linked_libs \
+ add_linked_static_libs \
+ add_external_libs \
+ add_package_headers \
+ add_sdi_headers \
+ add_precompiled_header \
,\
- $(call gb_Library__forward_to_Linktarget,$(method))\
+ $(call gb_Library__forward_to_Linktarget,$(method))\
))
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 90c73a5ffec9..3dfd2df82ded 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -35,7 +35,7 @@ gb_CObject_get_source = $(1)/$(2).c
ifeq ($(gb_FULLDEPS),$(true))
define gb_CObject__command_dep
mkdir -p $(dir $(1)) && \
- echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
+ echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
endef
else
@@ -44,11 +44,11 @@ endif
define gb_CObject__rules
$$(call gb_CObject_get_target,%) : $$(call gb_CObject_get_source,$(1),%)
- $$(call gb_CObject__command,$$@,$$*,$$<,$$(DEFS),$$(CFLAGS),$$(INCLUDE))
+ $$(call gb_CObject__command,$$@,$$*,$$<,$$(DEFS),$$(CFLAGS),$$(INCLUDE))
ifeq ($(gb_FULLDEPS),$(true))
$$(call gb_CObject_get_dep_target,%) : $$(call gb_CObject_get_source,$(1),%)
- $$(call gb_CObject__command_dep,$$@,$$*,$$<,$$(DEFS),$$(CFLAGS),$$(INCLUDE))
+ $$(call gb_CObject__command_dep,$$@,$$*,$$<,$$(DEFS),$$(CFLAGS),$$(INCLUDE))
endif
endef
@@ -56,7 +56,7 @@ endef
$(foreach repo,$(gb_CObject_REPOS),$(eval $(call gb_CObject__rules,$(repo))))
$(call gb_CObject_get_dep_target,%) :
- $(eval $(call gb_Output_error,Unable to find plain C file $(call gb_CObject_get_source,,$*) in the repositories: $(gb_CObject_REPOS)))
+ $(eval $(call gb_Output_error,Unable to find plain C file $(call gb_CObject_get_source,,$*) in the repositories: $(gb_CObject_REPOS)))
gb_CObject_CObject =
@@ -75,7 +75,7 @@ gb_CxxObject_get_source = $(1)/$(2).cxx
ifeq ($(gb_FULLDEPS),$(true))
define gb_CxxObject__command_dep
mkdir -p $(dir $(1)) && \
- echo '$(call gb_CxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
+ echo '$(call gb_CxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
endef
else
@@ -112,13 +112,13 @@ endef
define gb_CxxObject__rules
$$(call gb_CxxObject_get_target,%) : $$(call gb_CxxObject_get_source,$(1),%)
- $$(eval $$(gb_CxxObject__set_pchflags))
- $$(call gb_CxxObject__command,$$@,$$*,$$<)
+ $$(eval $$(gb_CxxObject__set_pchflags))
+ $$(call gb_CxxObject__command,$$@,$$*,$$<)
ifeq ($(gb_FULLDEPS),$(true))
$$(call gb_CxxObject_get_dep_target,%) : $$(call gb_CxxObject_get_source,$(1),%)
- $$(eval $$(gb_CxxObject__set_pchflags))
- $$(call gb_CxxObject__command_dep,$$@,$$*,$$<)
+ $$(eval $$(gb_CxxObject__set_pchflags))
+ $$(call gb_CxxObject__command_dep,$$@,$$*,$$<)
endif
endef
@@ -127,7 +127,7 @@ $(foreach repo,$(gb_CxxObject_REPOS),$(eval $(call gb_CxxObject__rules,$(repo)))
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_CxxObject_get_dep_target,%) :
- $(eval $(call gb_Output_error,Unable to find C++ file $(call gb_CxxObject_get_source,,$*) in repositories: $(gb_CxxObject_REPOS)))
+ $(eval $(call gb_Output_error,Unable to find C++ file $(call gb_CxxObject_get_source,,$*) in repositories: $(gb_CxxObject_REPOS)))
endif
@@ -146,21 +146,21 @@ gb_GenCxxObject_get_source = $(WORKDIR)/$(1).cxx
ifeq ($(gb_FULLDEPS),$(true))
define gb_GenCxxObject__command_dep
mkdir -p $(dir $(1)) && \
- echo '$(call gb_GenCxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
+ echo '$(call gb_GenCxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
endef
else
gb_GenCxxObject__command_dep =
endif
$(call gb_GenCxxObject_get_target,%) : $(call gb_GenCxxObject_get_source,%)
- $(call gb_CxxObject__command,$@,$*,$<)
+ $(call gb_CxxObject__command,$@,$*,$<)
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_GenCxxObject_get_dep_target,%) : $(call gb_GenCxxObject_get_source,%)
- $(call gb_GenCxxObject__command_dep,$@,$*,$<)
+ $(call gb_GenCxxObject__command_dep,$@,$*,$<)
$(call gb_GenCxxObject_get_dep_target,%) :
- $(eval $(call gb_Output_error,Unable to find generated C++ file $(call gb_GenCxxObject_get_source,$*) in WORKDIR.))
+ $(eval $(call gb_Output_error,Unable to find generated C++ file $(call gb_GenCxxObject_get_source,$*) in WORKDIR.))
endif
gb_GenCxxObject_GenCxxObject =
@@ -179,7 +179,7 @@ gb_ObjCxxObject_get_source = $(1)/$(2).mm
ifeq ($(gb_FULLDEPS),$(true))
define gb_ObjCxxObject__command_dep
mkdir -p $(dir $(1)) && \
- echo '$(call gb_ObjCxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
+ echo '$(call gb_ObjCxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
endef
else
@@ -188,11 +188,11 @@ endif
define gb_ObjCxxObject__rules
$$(call gb_ObjCxxObject_get_target,%) : $$(call gb_ObjCxxObject_get_source,$(1),%)
- $$(call gb_ObjCxxObject__command,$$@,$$*,$$<,$$(DEFS),$$(OBJCXXFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
+ $$(call gb_ObjCxxObject__command,$$@,$$*,$$<,$$(DEFS),$$(OBJCXXFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
ifeq ($(gb_FULLDEPS),$(true))
$$(call gb_ObjCxxObject_get_dep_target,%) : $$(call gb_ObjCxxObject_get_source,$(1),%)
- $$(call gb_ObjCxxObject__command_dep,$$@,$$*,$$<,$$(DEFS),$$(OBJCXXFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
+ $$(call gb_ObjCxxObject__command_dep,$$@,$$*,$$<,$$(DEFS),$$(OBJCXXFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
endif
endef
@@ -201,7 +201,7 @@ $(foreach repo,$(gb_ObjCxxObject_REPOS),$(eval $(call gb_ObjCxxObject__rules,$(r
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_ObjCxxObject_get_dep_target,%) :
- $(eval $(call gb_Output_error,Unable to find Objective C++ file $(call gb_ObjCxxObject_get_source,,$*) in repositories: $(gb_ObjCxxObject_REPOS)))
+ $(eval $(call gb_Output_error,Unable to find Objective C++ file $(call gb_ObjCxxObject_get_source,,$*) in repositories: $(gb_ObjCxxObject_REPOS)))
endif
gb_ObjCxxObject_ObjCxxObject =
@@ -219,49 +219,49 @@ gb_LinkTarget_DEFAULTDEFS := $(gb_GLOBALDEFS)
.PHONY : $(call gb_LinkTarget_get_clean_target,%)
$(call gb_LinkTarget_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),LNK,4)
- RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_dep_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_dep_target,$(object))) \
- $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
- $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_dep_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_dep_target,$(object))) \
- $(call gb_LinkTarget_get_target,$*) \
- $(call gb_LinkTarget_get_dep_target,$*) \
- $(call gb_LinkTarget_get_headers_target,$*) \
- $(call gb_LinkTarget_get_external_headers_target,$*) \
- $(DLLTARGET) \
- $(AUXTARGETS)) && \
- cat $${RESPONSEFILE} /dev/null | xargs -n 200 rm -f && \
- rm -f $${RESPONSEFILE}
+ $(call gb_Output_announce,$*,$(false),LNK,4)
+ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_dep_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_dep_target,$(object))) \
+ $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
+ $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_dep_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_dep_target,$(object))) \
+ $(call gb_LinkTarget_get_target,$*) \
+ $(call gb_LinkTarget_get_dep_target,$*) \
+ $(call gb_LinkTarget_get_headers_target,$*) \
+ $(call gb_LinkTarget_get_external_headers_target,$*) \
+ $(DLLTARGET) \
+ $(AUXTARGETS)) && \
+ cat $${RESPONSEFILE} /dev/null | xargs -n 200 rm -f && \
+ rm -f $${RESPONSEFILE}
# cat the deps of all objects in one file, then we need only open that one file
define gb_LinkTarget__command_dep
$(call gb_Output_announce,LNK:$(2),$(true),DEP,1)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
- $(foreach object,$(3),$(call gb_CObject_get_dep_target,$(object))) \
- $(foreach object,$(4),$(call gb_CxxObject_get_dep_target,$(object))) \
- $(foreach object,$(5),$(call gb_ObjCxxObject_get_dep_target,$(object)))\
- $(foreach object,$(6),$(call gb_GenCxxObject_get_dep_target,$(object)))\
- ) && \
- cat $${RESPONSEFILE} /dev/null | xargs -n 200 cat > $(1)) && \
- rm -f $${RESPONSEFILE}
+ mkdir -p $(dir $(1)) && \
+ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
+ $(foreach object,$(3),$(call gb_CObject_get_dep_target,$(object))) \
+ $(foreach object,$(4),$(call gb_CxxObject_get_dep_target,$(object))) \
+ $(foreach object,$(5),$(call gb_ObjCxxObject_get_dep_target,$(object)))\
+ $(foreach object,$(6),$(call gb_GenCxxObject_get_dep_target,$(object)))\
+ ) && \
+ cat $${RESPONSEFILE} /dev/null | xargs -n 200 cat > $(1)) && \
+ rm -f $${RESPONSEFILE}
endef
$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY)
- $(call gb_LinkTarget__command,$@,$*)
+ $(call gb_LinkTarget__command,$@,$*)
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_dep_target,%)
$(call gb_LinkTarget_get_dep_target,%) : | $(call gb_LinkTarget_get_headers_target,%)
- $(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS),$(OBJCXXOBJECTS),$(GENCXXOBJECTS))
+ $(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS),$(OBJCXXOBJECTS),$(GENCXXOBJECTS))
endif
# Ok, this is some dark voodoo: When declaring a linktarget with
@@ -283,12 +283,12 @@ $$@ : COMMAND := $$(call gb_Helper_abbreviate_dirs, mkdir -p $$(dir $$@) && touc
endef
$(call gb_LinkTarget_get_external_headers_target,%) :
- $(eval $(gb_LinkTarget__get_external_headers_check))
- $(COMMAND)
+ $(eval $(gb_LinkTarget__get_external_headers_check))
+ $(COMMAND)
$(call gb_LinkTarget_get_headers_target,%) : $(call gb_LinkTarget_get_external_headers_target,%)
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && touch $@)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && touch $@)
# Explanation of some of the targets:
# - gb_LinkTarget_get_external_headers_target is the targets that guarantees all
@@ -655,8 +655,8 @@ $(call gb_LinkTarget_get_headers_target,$(1)) \
$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS = $$(DEFS)
ifeq ($(gb_FULLDEPS),$(true))
-include \
- $(call gb_PrecompiledHeader_get_dep_target,$(3)) \
- $(call gb_NoexPrecompiledHeader_get_dep_target,$(3))
+ $(call gb_PrecompiledHeader_get_dep_target,$(3)) \
+ $(call gb_NoexPrecompiledHeader_get_dep_target,$(3))
$(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $$(DEFS) -DPRECOMPILED_HEADERS
$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS = $$(DEFS)
endif
diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk
index 0ebe9194e063..a563fa46b047 100644
--- a/solenv/gbuild/Module.mk
+++ b/solenv/gbuild/Module.mk
@@ -33,31 +33,31 @@ gb_Module_CLEANTARGETSTACK :=
.PHONY : $(call gb_Module_get_clean_target,%)
$(call gb_Module_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),MOD,5)
- $(call gb_Output_announce_title,module $* cleared.)
- -$(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_Module_get_target,$*) $(call gb_Module_get_check_target,$*) $(call gb_Module_get_subsequentcheck_target,$*))
+ $(call gb_Output_announce,$*,$(false),MOD,5)
+ $(call gb_Output_announce_title,module $* cleared.)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_Module_get_target,$*) $(call gb_Module_get_check_target,$*) $(call gb_Module_get_subsequentcheck_target,$*))
$(call gb_Module_get_check_target,%) :
- $(call gb_Output_announce,$*,$(true),CHK,5)
- $(call gb_Output_announce_title,module $* checks done.)
- -$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && \
- touch $@)
+ $(call gb_Output_announce,$*,$(true),CHK,5)
+ $(call gb_Output_announce_title,module $* checks done.)
+ -$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ touch $@)
$(call gb_Module_get_subsequentcheck_target,%) :
- $(call gb_Output_announce,$*,$(true),SCK,5)
- $(call gb_Output_announce_title,module $* subsequentchecks done.)
- -$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && \
- touch $@)
+ $(call gb_Output_announce,$*,$(true),SCK,5)
+ $(call gb_Output_announce_title,module $* subsequentchecks done.)
+ -$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ touch $@)
$(call gb_Module_get_target,%) :
- $(call gb_Output_announce,$*,$(true),MOD,5)
- $(call gb_Output_announce_title,module $* done.)
- -$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && \
- touch $@)
+ $(call gb_Output_announce,$*,$(true),MOD,5)
+ $(call gb_Output_announce_title,module $* done.)
+ -$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ touch $@)
.PHONY : all allandcheck clean check subsequentcheck
.DEFAULT_GOAL := allandcheck
@@ -70,26 +70,26 @@ ifneq ($(strip $(OOO_SUBSEQUENT_TESTS)),)
endif
all :
- $(call gb_Output_announce,top level modules: $(foreach module,$(filter-out deliverlog,$^),$(notdir $(module))),$(true),ALL,6)
- $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),ALL,6)
- $(call gb_Output_announce_title,all done.)
- $(call gb_Output_announce_bell)
+ $(call gb_Output_announce,top level modules: $(foreach module,$(filter-out deliverlog,$^),$(notdir $(module))),$(true),ALL,6)
+ $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),ALL,6)
+ $(call gb_Output_announce_title,all done.)
+ $(call gb_Output_announce_bell)
check :
- $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),CHK,6)
- $(call gb_Output_announce_title,all tests checked.)
- $(call gb_Output_announce_bell)
+ $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),CHK,6)
+ $(call gb_Output_announce_title,all tests checked.)
+ $(call gb_Output_announce_bell)
subsequentcheck : all
- $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),SCK,6)
- $(call gb_Output_announce_title,all subsequent tests checked.)
- $(call gb_Output_announce_bell)
+ $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),SCK,6)
+ $(call gb_Output_announce_title,all subsequent tests checked.)
+ $(call gb_Output_announce_bell)
clean :
- $(call gb_Output_announce,top level modules: $(foreach module,$^,$(notdir $(module))),$(false),ALL,6)
- $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(false),ALL,6)
- $(call gb_Output_announce_title,all cleared.)
- $(call gb_Output_announce_bell)
+ $(call gb_Output_announce,top level modules: $(foreach module,$^,$(notdir $(module))),$(false),ALL,6)
+ $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(false),ALL,6)
+ $(call gb_Output_announce_title,all cleared.)
+ $(call gb_Output_announce_bell)
define gb_Module_Module
gb_Module_ALLMODULES += $(1)
diff --git a/solenv/gbuild/Output.mk b/solenv/gbuild/Output.mk
index a630e1d9ed28..7e63a44a6721 100644
--- a/solenv/gbuild/Output.mk
+++ b/solenv/gbuild/Output.mk
@@ -93,8 +93,8 @@ gb_Output_COLOR_ERROR := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;41m
define gb_Output__format_type
$(subst :, ,$(word 2,$(1) \
- $(gb_Output_COLOR_OUTBUILD_LEVEL$(3))[:$(gb_Output_COLOR_INBUILD_LEVEL$(3))build:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTBUILD_LEVEL$(3)):] \
- $(gb_Output_COLOR_OUTCLEAN_LEVEL$(3))[:$(gb_Output_COLOR_INCLEAN_LEVEL$(3))clean:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTCLEAN_LEVEL$(3)):]))$(gb_Output_COLOR_RESET)
+ $(gb_Output_COLOR_OUTBUILD_LEVEL$(3))[:$(gb_Output_COLOR_INBUILD_LEVEL$(3))build:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTBUILD_LEVEL$(3)):] \
+ $(gb_Output_COLOR_OUTCLEAN_LEVEL$(3))[:$(gb_Output_COLOR_INCLEAN_LEVEL$(3))clean:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTCLEAN_LEVEL$(3)):]))$(gb_Output_COLOR_RESET)
endef
define gb_Output_info
diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk
index f175833093b0..63c6dd688936 100644
--- a/solenv/gbuild/Package.mk
+++ b/solenv/gbuild/Package.mk
@@ -25,7 +25,7 @@
# PackagePart class
$(foreach destination,$(call gb_PackagePart_get_destinations), $(destination)/%) :
- $(call gb_Deliver_deliver,$<,$@)
+ $(call gb_Deliver_deliver,$<,$@)
define gb_PackagePart_PackagePart
$(OUTDIR)/$(1) : $(2)
@@ -39,16 +39,16 @@ endef
.PHONY : $(call gb_Package_get_clean_target,%)
$(call gb_Package_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),PKG,2)
- -$(call gb_Helper_abbreviate_dirs,\
- rm -f $(FILES))
+ $(call gb_Output_announce,$*,$(false),PKG,2)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(FILES))
$(call gb_Package_get_preparation_target,%) :
- mkdir -p $(dir $@) && touch $@
+ mkdir -p $(dir $@) && touch $@
$(call gb_Package_get_target,%) :
- $(call gb_Output_announce,$*,$(true),PKG,2)
- mkdir -p $(dir $@) && touch $@
+ $(call gb_Output_announce,$*,$(true),PKG,2)
+ mkdir -p $(dir $@) && touch $@
define gb_Package_Package
diff --git a/solenv/gbuild/PrecompiledHeaders.mk b/solenv/gbuild/PrecompiledHeaders.mk
index 4fbd22c4e664..cc4a0b5eadb3 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -36,38 +36,38 @@ gb_NoexPrecompiledHeader_DEBUGDIR := nodebug
endif
$(call gb_PrecompiledHeader_get_dep_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && \
- echo '$(call gb_PrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ echo '$(call gb_PrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
$(call gb_NoexPrecompiledHeader_get_dep_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@) && \
- echo '$(call gb_NoexPrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ echo '$(call gb_NoexPrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
$(call gb_PrecompiledHeader_get_target,%) :
- $(call gb_PrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_PrecompiledHeader_EXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
+ $(call gb_PrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_PrecompiledHeader_EXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
$(call gb_NoexPrecompiledHeader_get_target,%) :
- $(call gb_NoexPrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
+ $(call gb_NoexPrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
.PHONY : $(call gb_PrecompiledHeader_get_clean_target,%) $(call gb_NoExPrecompiledHeader_get_clean_target,%)
$(call gb_PrecompiledHeader_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),PCH,1)
- -$(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_PrecompiledHeader_get_target,$*) \
- $(call gb_PrecompiledHeader_get_target,$*).obj \
- $(call gb_PrecompiledHeader_get_target,$*).pdb \
- $(call gb_PrecompiledHeader_get_dep_target,$*))
+ $(call gb_Output_announce,$*,$(false),PCH,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_PrecompiledHeader_get_target,$*) \
+ $(call gb_PrecompiledHeader_get_target,$*).obj \
+ $(call gb_PrecompiledHeader_get_target,$*).pdb \
+ $(call gb_PrecompiledHeader_get_dep_target,$*))
$(call gb_NoexPrecompiledHeader_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),PCH,1)
- -$(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_NoexPrecompiledHeader_get_target,$*) \
- $(call gb_NoexPrecompiledHeader_get_target,$*).obj \
- $(call gb_NoexPrecompiledHeader_get_target,$*).pdb \
- $(call gb_NoexPrecompiledHeader_get_dep_target,$*))
+ $(call gb_Output_announce,$*,$(false),PCH,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_NoexPrecompiledHeader_get_target,$*) \
+ $(call gb_NoexPrecompiledHeader_get_target,$*).obj \
+ $(call gb_NoexPrecompiledHeader_get_target,$*).pdb \
+ $(call gb_NoexPrecompiledHeader_get_dep_target,$*))
endif
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/SdiTarget.mk b/solenv/gbuild/SdiTarget.mk
index c75de5b58c94..417d6ae7762b 100644
--- a/solenv/gbuild/SdiTarget.mk
+++ b/solenv/gbuild/SdiTarget.mk
@@ -31,28 +31,28 @@ gb_SdiTarget_SVIDLTARGET := $(call gb_Executable_get_target,svidl)
gb_SdiTarget_SVIDLCOMMAND := $(gb_SdiTarget_SVIDLPRECOMMAND) $(gb_SdiTarget_SVIDLTARGET)
$(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET)
- $(call gb_Output_announce,$*,$(true),SDI,1)
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@))
- $(call gb_Helper_abbreviate_dirs_native,\
- cd $(dir $<) && \
- $(gb_SdiTarget_SVIDLCOMMAND) -quiet \
- $(INCLUDE) \
- -fs$@.hxx \
- -fd$@.ilb \
- -fl$@.lst \
- -fz$@.sid \
- -fx$(EXPORTS) \
- -fm$@ \
- $<)
+ $(call gb_Output_announce,$*,$(true),SDI,1)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@))
+ $(call gb_Helper_abbreviate_dirs_native,\
+ cd $(dir $<) && \
+ $(gb_SdiTarget_SVIDLCOMMAND) -quiet \
+ $(INCLUDE) \
+ -fs$@.hxx \
+ -fd$@.ilb \
+ -fl$@.lst \
+ -fz$@.sid \
+ -fx$(EXPORTS) \
+ -fm$@ \
+ $<)
.PHONY : $(call gb_SdiTarget_get_clean_target,%)
$(call gb_SdiTarget_get_clean_target,%) :
- $(call gb_Output_announce,$*,$(false),SDI,1)
- -$(call gb_Helper_abbreviate_dirs,\
- rm -f $(foreach ext,.hxx .ilb .lst .sid,\
- $(call gb_SdiTarget_get_target,$*)$(ext)) \
- $(call gb_SdiTarget_get_target,$*))
+ $(call gb_Output_announce,$*,$(false),SDI,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(foreach ext,.hxx .ilb .lst .sid,\
+ $(call gb_SdiTarget_get_target,$*)$(ext)) \
+ $(call gb_SdiTarget_get_target,$*))
define gb_SdiTarget_SdiTarget
$(call gb_SdiTarget_get_target,$(1)) : INCLUDE := $$(subst -I. ,-I$$(dir $(SRCDIR)/$(1)) ,$$(SOLARINC))
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index 11390bd5df5d..7462d575fad5 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -36,15 +36,15 @@ gb_StaticLibrary__get_linktargetname = StaticLibrary/$(call gb_StaticLibrary_get
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
.PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT)
$(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) :
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $(OUTDIR)/lib/$*$(gb_StaticLibrary_PLAINEXT) \
- $(AUXTARGETS))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(OUTDIR)/lib/$*$(gb_StaticLibrary_PLAINEXT) \
+ $(AUXTARGETS))
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
$(gb_StaticLibrary_OUTDIRLOCATION)/%$(gb_StaticLibrary_PLAINEXT) :
- $(call gb_Helper_abbreviate_dirs,\
- $(call gb_Deliver_deliver,$<,$@) \
- $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
define gb_StaticLibrary_StaticLibrary
ifeq (,$$(findstring $(1),$$(gb_StaticLibrary_KNOWNLIBS)))
@@ -60,8 +60,8 @@ define gb_StaticLibrary__StaticLibrary_impl
$(call gb_LinkTarget_LinkTarget,$(2))
$(call gb_LinkTarget_set_targettype,$(2),StaticLibrary)
$(call gb_LinkTarget_set_defs,$(2),\
- $$(DEFS) \
- $(gb_StaticLibrary_DEFS) \
+ $$(DEFS) \
+ $(gb_StaticLibrary_DEFS) \
)
$(call gb_StaticLibrary_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
$(call gb_StaticLibrary_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
@@ -77,29 +77,29 @@ gb_StaticLibrary_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_StaticLibrary__get
endef
$(eval $(foreach method,\
- add_cobject \
- add_cobjects \
- add_cxxobject \
- add_cxxobjects \
- add_objcxxobject \
- add_objcxxobjects \
- add_exception_objects \
- add_noexception_objects \
- add_generated_exception_objects \
- set_cflags \
- set_cxxflags \
- set_objcxxflags \
- set_defs \
- set_include \
- set_ldflags \
- set_library_path_flags \
- add_linked_libs \
- add_linked_static_libs \
- add_package_headers \
- add_sdi_headers \
- add_precompiled_header \
+ add_cobject \
+ add_cobjects \
+ add_cxxobject \
+ add_cxxobjects \
+ add_objcxxobject \
+ add_objcxxobjects \
+ add_exception_objects \
+ add_noexception_objects \
+ add_generated_exception_objects \
+ set_cflags \
+ set_cxxflags \
+ set_objcxxflags \
+ set_defs \
+ set_include \
+ set_ldflags \
+ set_library_path_flags \
+ add_linked_libs \
+ add_linked_static_libs \
+ add_package_headers \
+ add_sdi_headers \
+ add_precompiled_header \
,\
- $(call gb_StaticLibrary_forward_to_Linktarget,$(method))\
+ $(call gb_StaticLibrary_forward_to_Linktarget,$(method))\
))
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index a5254a64aad7..36c81aeffdc3 100755..100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -96,37 +96,37 @@ $(patsubst $(1):%,$(WORKDIR)/Headers/StaticLibrary/%,$(filter $(1):%,$(gb_Static
endef
$(eval $(call gb_Helper_make_clean_targets,\
- AllLangResTarget \
- ComponentTarget \
- JavaClassSet \
- JunitTest \
- LinkTarget \
- Module \
- WinResTarget \
- NoexPrecompiledHeader \
- PackagePart \
- PrecompiledHeader \
- ResTarget \
- SdiTarget \
- SrsTarget \
- CppunitTest \
- CustomTarget \
+ AllLangResTarget \
+ ComponentTarget \
+ JavaClassSet \
+ JunitTest \
+ LinkTarget \
+ Module \
+ WinResTarget \
+ NoexPrecompiledHeader \
+ PackagePart \
+ PrecompiledHeader \
+ ResTarget \
+ SdiTarget \
+ SrsTarget \
+ CppunitTest \
+ CustomTarget \
))
$(eval $(call gb_Helper_make_outdir_clean_targets,\
- Executable \
- Library \
- Package \
- StaticLibrary \
+ Executable \
+ Library \
+ Package \
+ StaticLibrary \
))
$(eval $(call gb_Helper_make_dep_targets,\
- CObject \
- CxxObject \
- ObjCxxObject \
- LinkTarget \
- SrsPartTarget \
- SrsTarget \
+ CObject \
+ CxxObject \
+ ObjCxxObject \
+ LinkTarget \
+ SrsPartTarget \
+ SrsTarget \
))
# needs to use same dep target because we use gb_CxxObject__command
gb_GenCxxObject_get_dep_target = $(gb_CxxObject_get_dep_target)
diff --git a/solenv/gbuild/WinResTarget.mk b/solenv/gbuild/WinResTarget.mk
index 07479076d355..39f10f82d4e5 100644
--- a/solenv/gbuild/WinResTarget.mk
+++ b/solenv/gbuild/WinResTarget.mk
@@ -50,21 +50,21 @@ endef
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_WinResTarget_get_dep_target,%) : $(gb_Helper_MISCDUMMY)
- mkdir -p $(dir $@) && \
- echo '$(call gb_WinResTarget_get_target,$*) : $$(gb_Helper_PHONY)' > $@
+ mkdir -p $(dir $@) && \
+ echo '$(call gb_WinResTarget_get_target,$*) : $$(gb_Helper_PHONY)' > $@
endif
$(call gb_WinResTarget_get_target,%) :
- $(call gb_Output_announce,$*,$(true),RES,1)
- $(call gb_WinResTarget__command_dep,$*,$<)
- $(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@))
- $(call gb_WinResTarget__command,$@)
+ $(call gb_Output_announce,$*,$(true),RES,1)
+ $(call gb_WinResTarget__command_dep,$*,$<)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@))
+ $(call gb_WinResTarget__command,$@)
$(call gb_WinResTarget_get_clean_target,%) :
- $(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_WinResTarget_get_target,$*))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_WinResTarget_get_target,$*))
define gb_WinResTarget_set_defs
$(call gb_WinResTarget_get_target,$(1)) : DEFS := $(2)
diff --git a/solenv/gbuild/extensions/post_PackModule.mk b/solenv/gbuild/extensions/post_PackModule.mk
index 01923ae462ac..b964b384738e 100644
--- a/solenv/gbuild/extensions/post_PackModule.mk
+++ b/solenv/gbuild/extensions/post_PackModule.mk
@@ -38,8 +38,8 @@ endif
endef
packmodule : allandcheck deliverlog
- $(eval $(call gb_PackModule_setpackmodulecommand))
- $(COMMAND)
+ $(eval $(call gb_PackModule_setpackmodulecommand))
+ $(COMMAND)
define gb_PackModule_setcleanpackmodulecommand
ifeq ($$(words $(gb_Module_ALLMODULES)),1)
@@ -52,7 +52,7 @@ endif
endef
cleanpackmodule : clean
- $(eval $(call gb_PackModule_setcleanpackmodulecommand))
- $(COMMAND)
-
+ $(eval $(call gb_PackModule_setcleanpackmodulecommand))
+ $(COMMAND)
+
# vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/post_SetupLocal.mk b/solenv/gbuild/extensions/post_SetupLocal.mk
index c141ee7daab2..1a96a26c0075 100644
--- a/solenv/gbuild/extensions/post_SetupLocal.mk
+++ b/solenv/gbuild/extensions/post_SetupLocal.mk
@@ -25,39 +25,39 @@
ifneq ($(gb_LOCALBUILDDIR),)
ifneq ($(wildcard $(gb_LOCALBUILDDIR)/SetupLocal.mk),)
setuplocal :
- $(eval $(call gb_Output_error,$(gb_LOCALBUILDDIR) exists already.))
+ $(eval $(call gb_Output_error,$(gb_LOCALBUILDDIR) exists already.))
else
setuplocal :
- $(eval MODULE := $(firstword $(MODULE) $(lastword $(subst /, ,$(dir $(realpath $(firstword $(MAKEFILE_LIST))))))))
- $(eval modulerepo := $(patsubst %/$(MODULE),%,$(foreach repo,$(gb_REPOS),$(wildcard $(repo)/$(MODULE)))))
- $(eval $(call gb_Output_announce,setting up local build directory (module: $(MODULE)).,$(true),SYC,5))
- mkdir -p $(gb_LOCALBUILDDIR)/srcdir $(gb_LOCALBUILDDIR)/workdir $(gb_LOCALBUILDDIR)/outdir
- rsync --archive --exclude 'workdir/**' $(SOLARVERSION)/$(INPATH)/ $(gb_LOCALBUILDDIR)/outdir
- cp $(modulerepo)/Repository.mk $(gb_LOCALBUILDDIR)/srcdir/Repository.mk
- cp $(modulerepo)/RepositoryFixes.mk $(gb_LOCALBUILDDIR)/srcdir/RepositoryFixes.mk
- rsync --archive $(modulerepo)/$(MODULE)/ $(gb_LOCALBUILDDIR)/srcdir/$(MODULE)
- echo "gb_REPOS := $(gb_LOCALBUILDDIR)/srcdir $(filter-out $(patsubst %/$(MODULE),%,$(foreach repo,$(gb_REPOS),$(wildcard $(repo)/$(MODULE)))),$(gb_REPOS))" > $(gb_LOCALBUILDDIR)/SetupLocal.mk
- echo "#original gb_REPOS was $(gb_REPOS)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
- echo "OUTDIR := $(gb_LOCALBUILDDIR)/outdir" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
- echo "#original OUTDIR was $(OUTDIR)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
- echo "WORKDIR := $(gb_LOCALBUILDDIR)/workdir" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
- echo "#original WORKDIR was $(WORKDIR)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ $(eval MODULE := $(firstword $(MODULE) $(lastword $(subst /, ,$(dir $(realpath $(firstword $(MAKEFILE_LIST))))))))
+ $(eval modulerepo := $(patsubst %/$(MODULE),%,$(foreach repo,$(gb_REPOS),$(wildcard $(repo)/$(MODULE)))))
+ $(eval $(call gb_Output_announce,setting up local build directory (module: $(MODULE)).,$(true),SYC,5))
+ mkdir -p $(gb_LOCALBUILDDIR)/srcdir $(gb_LOCALBUILDDIR)/workdir $(gb_LOCALBUILDDIR)/outdir
+ rsync --archive --exclude 'workdir/**' $(SOLARVERSION)/$(INPATH)/ $(gb_LOCALBUILDDIR)/outdir
+ cp $(modulerepo)/Repository.mk $(gb_LOCALBUILDDIR)/srcdir/Repository.mk
+ cp $(modulerepo)/RepositoryFixes.mk $(gb_LOCALBUILDDIR)/srcdir/RepositoryFixes.mk
+ rsync --archive $(modulerepo)/$(MODULE)/ $(gb_LOCALBUILDDIR)/srcdir/$(MODULE)
+ echo "gb_REPOS := $(gb_LOCALBUILDDIR)/srcdir $(filter-out $(patsubst %/$(MODULE),%,$(foreach repo,$(gb_REPOS),$(wildcard $(repo)/$(MODULE)))),$(gb_REPOS))" > $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "#original gb_REPOS was $(gb_REPOS)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "OUTDIR := $(gb_LOCALBUILDDIR)/outdir" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "#original OUTDIR was $(OUTDIR)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "WORKDIR := $(gb_LOCALBUILDDIR)/workdir" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "#original WORKDIR was $(WORKDIR)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
endif
removelocal :
- $(eval $(call gb_Output_warn,removing directory $(gb_LOCALBUILDDIR).,SYC))
- sleep 10
- rm -rf $(gb_LOCALBUILDDIR)
+ $(eval $(call gb_Output_warn,removing directory $(gb_LOCALBUILDDIR).,SYC))
+ sleep 10
+ rm -rf $(gb_LOCALBUILDDIR)
else
setuplocal:
- $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
+ $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
removelocal:
- $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
+ $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
endif
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index e7b25541d35f..b2e72c636e87 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -151,40 +151,40 @@ include $(GBUILDDIR)/Tempfile.mk
$(eval $(call gb_Helper_collect_knownlibs))
gb_GLOBALDEFS := \
- -D_REENTRANT \
- -DCUI \
- -DENABLE_LAYOUT_EXPERIMENTAL=0 \
- -DENABLE_LAYOUT=0 \
- -DOSL_DEBUG_LEVEL=$(gb_DEBUGLEVEL) \
- -DSOLAR_JAVA \
- -DSTLPORT_VERSION=$(STLPORT_VER) \
- -DSUPD=$(UPD) \
- -DVCL \
- $(gb_OSDEFS) \
- $(gb_COMPILERDEFS) \
- $(gb_CPUDEFS) \
+ -D_REENTRANT \
+ -DCUI \
+ -DENABLE_LAYOUT_EXPERIMENTAL=0 \
+ -DENABLE_LAYOUT=0 \
+ -DOSL_DEBUG_LEVEL=$(gb_DEBUGLEVEL) \
+ -DSOLAR_JAVA \
+ -DSTLPORT_VERSION=$(STLPORT_VER) \
+ -DSUPD=$(UPD) \
+ -DVCL \
+ $(gb_OSDEFS) \
+ $(gb_COMPILERDEFS) \
+ $(gb_CPUDEFS) \
ifeq ($(gb_PRODUCT),$(true))
gb_GLOBALDEFS += \
- -DPRODUCT \
- -DPRODUCT_FULL \
+ -DPRODUCT \
+ -DPRODUCT_FULL \
else
gb_GLOBALDEFS += \
- -DDBG_UTIL \
- -D_STLP_DEBUG \
- -D_DEBUG \
+ -DDBG_UTIL \
+ -D_STLP_DEBUG \
+ -D_DEBUG \
endif
ifeq ($(gb_DEBUGLEVEL),2)
gb_GLOBALDEFS += \
- -DDEBUG \
+ -DDEBUG \
else
gb_GLOBALDEFS += \
- -DOPTIMIZE \
- -DNDEBUG \
+ -DOPTIMIZE \
+ -DNDEBUG \
endif
@@ -228,21 +228,21 @@ $(eval $(call gb_Deliver_init))
# is not available everywhere by default.
include $(foreach class, \
- ComponentTarget \
- AllLangResTarget \
- WinResTarget \
- LinkTarget \
- Library \
- StaticLibrary \
- Executable \
- SdiTarget \
- Package \
- CustomTarget \
- PrecompiledHeaders \
- CppunitTest \
- JavaClassSet \
- JunitTest \
- Module \
+ ComponentTarget \
+ AllLangResTarget \
+ WinResTarget \
+ LinkTarget \
+ Library \
+ StaticLibrary \
+ Executable \
+ SdiTarget \
+ Package \
+ CustomTarget \
+ PrecompiledHeaders \
+ CppunitTest \
+ JavaClassSet \
+ JunitTest \
+ Module \
,$(GBUILDDIR)/$(class).mk)
# optional extensions that should never be essential
diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index 26aaaacf64f1..ed74e12a5705 100644
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -48,21 +48,21 @@ gb_CXX := $(CXX)
endif
gb_OSDEFS := \
- -D$(OS) \
- -D_PTHREADS \
- -DUNIX \
- -DUNX \
- $(PTHREAD_CFLAGS) \
+ -D$(OS) \
+ -D_PTHREADS \
+ -DUNIX \
+ -DUNX \
+ $(PTHREAD_CFLAGS) \
ifeq ($(GXX_INCLUDE_PATH),)
GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion)
endif
gb_COMPILERDEFS := \
- -D$(COM) \
- -DHAVE_GCC_VISIBILITY_FEATURE \
- -DCPPU_ENV=gcc3 \
- -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
+ -D$(COM) \
+ -DHAVE_GCC_VISIBILITY_FEATURE \
+ -DCPPU_ENV=gcc3 \
+ -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
ifeq ($(CPUNAME),X86_64)
gb_CPUDEFS := -D$(CPUNAME)
@@ -71,32 +71,32 @@ gb_CPUDEFS := -DX86
endif
gb_CFLAGS := \
- -Wall \
- -Wendif-labels \
- -Wextra \
- -Wshadow \
- -fPIC \
- -fmessage-length=0 \
- -fno-common \
- -fno-strict-aliasing \
- -fvisibility=hidden \
- -pipe \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -Wshadow \
+ -fPIC \
+ -fmessage-length=0 \
+ -fno-common \
+ -fno-strict-aliasing \
+ -fvisibility=hidden \
+ -pipe \
gb_CXXFLAGS := \
- -Wall \
- -Wendif-labels \
- -Wextra \
- -Wno-ctor-dtor-privacy \
- -Wno-non-virtual-dtor \
- -Wshadow \
- -fPIC \
- -fmessage-length=0 \
- -fno-common \
- -fno-strict-aliasing \
- -fno-use-cxa-atexit \
- -fvisibility-inlines-hidden \
- -fvisibility=hidden \
- -pipe \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -Wno-ctor-dtor-privacy \
+ -Wno-non-virtual-dtor \
+ -Wshadow \
+ -fPIC \
+ -fmessage-length=0 \
+ -fno-common \
+ -fno-strict-aliasing \
+ -fno-use-cxa-atexit \
+ -fvisibility-inlines-hidden \
+ -fvisibility=hidden \
+ -pipe \
ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
gb_CFLAGS_WERROR := -Werror
@@ -109,31 +109,31 @@ gb_CFLAGS += --sysroot=$(SYSBASE)
gb_LinkTarget_LDFLAGS := -Wl,--sysroot=$(SYSBASE)
endif
gb_LinkTarget_EXCEPTIONFLAGS := \
- -DEXCEPTIONS_ON \
- -fexceptions \
- -fno-enforce-eh-specs \
+ -DEXCEPTIONS_ON \
+ -fexceptions \
+ -fno-enforce-eh-specs \
gb_LinkTarget_NOEXCEPTIONFLAGS := \
- -DEXCEPTIONS_OFF \
- -fno-exceptions \
+ -DEXCEPTIONS_OFF \
+ -fno-exceptions \
gb_LinkTarget_LDFLAGS += \
- -Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
- -Wl,-z,combreloc \
- -Wl,-z,defs \
- $(subst -L../lib , ,$(SOLARLIB)) \
+ -Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
+ -Wl,-z,combreloc \
+ -Wl,-z,defs \
+ $(subst -L../lib , ,$(SOLARLIB)) \
ifeq ($(HAVE_LD_HASH_STYLE),TRUE)
gb_LinkTarget_LDFLAGS += \
- -Wl,--hash-style=both \
+ -Wl,--hash-style=both \
endif
ifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),)
gb_LinkTarget_LDFLAGS += \
- -Wl,--dynamic-list-cpp-new \
- -Wl,--dynamic-list-cpp-typeinfo \
- -Wl,-Bsymbolic-functions \
+ -Wl,--dynamic-list-cpp-new \
+ -Wl,--dynamic-list-cpp-typeinfo \
+ -Wl,-Bsymbolic-functions \
endif
@@ -161,16 +161,16 @@ endef
define gb_CObject__command
$(call gb_Output_announce,$(2),$(true),C ,3)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
- $(gb_CC) \
- $(DEFS) $(CFLAGS) \
- -c $(3) \
- -o $(1) \
- -MMD -MT $(call gb_CObject_get_target,$(2)) \
- -MF $(call gb_CObject_get_dep_target,$(2)) \
- -I$(dir $(3)) \
- $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+ $(gb_CC) \
+ $(DEFS) $(CFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CObject_get_target,$(2)) \
+ -MF $(call gb_CObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(INCLUDE))
endef
@@ -179,16 +179,16 @@ endef
define gb_CxxObject__command
$(call gb_Output_announce,$(2),$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
- $(gb_CXX) \
- $(DEFS) $(CXXFLAGS) \
- -c $(3) \
- -o $(1) \
- -MMD -MT $(call gb_CxxObject_get_target,$(2)) \
- -MF $(call gb_CxxObject_get_dep_target,$(2)) \
- -I$(dir $(3)) \
- $(INCLUDE_STL) $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ $(DEFS) $(CXXFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CxxObject_get_target,$(2)) \
+ -MF $(call gb_CxxObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(INCLUDE_STL) $(INCLUDE))
endef
@@ -199,12 +199,12 @@ $(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
endef
gb_LinkTarget__RPATHS := \
- URELIB:\dORIGIN \
- UREBIN:\dORIGIN/../lib:\dORIGIN \
- OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
- BRAND:\dORIGIN:\dORIGIN/../basis-link/program:\dORIGIN/../basis-link/ure-link/lib \
- SDKBIN:\dORIGIN/../../ure-link/lib \
- NONEBIN:\dORIGIN/../lib:\dORIGIN \
+ URELIB:\dORIGIN \
+ UREBIN:\dORIGIN/../lib:\dORIGIN \
+ OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
+ BRAND:\dORIGIN:\dORIGIN/../basis-link/program:\dORIGIN/../basis-link/ure-link/lib \
+ SDKBIN:\dORIGIN/../../ure-link/lib \
+ NONEBIN:\dORIGIN/../lib:\dORIGIN \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
@@ -220,27 +220,27 @@ gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
define gb_LinkTarget__command_dynamiclink
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- $(gb_CXX) \
- $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
- $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
- $(patsubst %,-l%,$(EXTERNAL_LIBS)) \
- -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
- -o $(1))
+ mkdir -p $(dir $(1)) && \
+ $(gb_CXX) \
+ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
+ $(patsubst %,-l%,$(EXTERNAL_LIBS)) \
+ -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
+ -o $(1))
endef
define gb_LinkTarget__command_staticlink
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- $(gb_AR) -rsu $(1) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- 2> /dev/null)
+ mkdir -p $(dir $(1)) && \
+ $(gb_AR) -rsu $(1) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ 2> /dev/null)
endef
define gb_LinkTarget__command
@@ -273,41 +273,41 @@ gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
endif
gb_Library_PLAINLIBS_NONE += \
- dl \
- freetype \
- jpeg \
- m \
- pthread \
- X11 \
- Xext \
- SM \
- ICE \
- z \
- cppunit
+ dl \
+ freetype \
+ jpeg \
+ m \
+ pthread \
+ X11 \
+ Xext \
+ SM \
+ ICE \
+ z \
+ cppunit
gb_Library_FILENAMES := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
gb_Library_LAYER := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
define gb_Library_get_rpath
'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \
@@ -328,8 +328,8 @@ gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
gb_StaticLibrary_FILENAMES := \
- $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
- $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
gb_StaticLibrary_StaticLibrary_platform =
@@ -339,11 +339,11 @@ gb_StaticLibrary_StaticLibrary_platform =
gb_Executable_EXT :=
gb_Executable_LAYER := \
- $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
- $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
- $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
- $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
- $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
+ $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
+ $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
+ $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
+ $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
+ $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
define gb_Executable_get_rpath
@@ -374,7 +374,7 @@ endef
define gb_JunitTest_JunitTest_platform
$(call gb_JunitTest_get_target,$(1)) : DEFS := \
- -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/openoffice.org3/program/soffice}" \
+ -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/openoffice.org3/program/soffice}" \
-Dorg.openoffice.test.arg.env=LD_LIBRARY_PATH \
-Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \
@@ -395,12 +395,12 @@ gb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDI
define gb_SrsPartTarget__command_dep
$(call gb_Helper_abbreviate_dirs,\
- $(gb_GCCP) \
- -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
- $(INCLUDE) \
- $(DEFS) \
- -c -x c++-header $(2) \
- -o $(call gb_SrsPartTarget_get_dep_target,$(1)))
+ $(gb_GCCP) \
+ -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
+ $(INCLUDE) \
+ $(DEFS) \
+ -c -x c++-header $(2) \
+ -o $(call gb_SrsPartTarget_get_dep_target,$(1)))
endef
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 45b2c4f37c72..4cfeeb953d31 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -44,20 +44,20 @@ gb_CXX := $(CXX)
endif
gb_OSDEFS := \
- -D$(OS) \
- -D_PTHREADS \
- -DUNIX \
- -DUNX \
- -D_REENTRANT \
- -DNO_PTHREAD_PRIORITY \
- -DQUARTZ \
- $(EXTRA_CDEFS) \
+ -D$(OS) \
+ -D_PTHREADS \
+ -DUNIX \
+ -DUNX \
+ -D_REENTRANT \
+ -DNO_PTHREAD_PRIORITY \
+ -DQUARTZ \
+ $(EXTRA_CDEFS) \
gb_COMPILERDEFS := \
- -D$(COM) \
- -DHAVE_GCC_VISIBILITY_FEATURE \
- -DCPPU_ENV=gcc3 \
- -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
+ -D$(COM) \
+ -DHAVE_GCC_VISIBILITY_FEATURE \
+ -DCPPU_ENV=gcc3 \
+ -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
ifeq ($(CPUNAME),POWERPC)
gb_CPUDEFS := -DPOWERPC -DPPC
@@ -73,35 +73,35 @@ endif
gb_CFLAGS := \
- -isysroot $(gb_SDKDIR) \
- -Wall \
- -Wendif-labels \
- -Wextra \
- -Wshadow \
- -fPIC \
- -fmessage-length=0 \
- -fno-common \
- -fno-strict-aliasing \
- -pipe \
+ -isysroot $(gb_SDKDIR) \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -Wshadow \
+ -fPIC \
+ -fmessage-length=0 \
+ -fno-common \
+ -fno-strict-aliasing \
+ -pipe \
gb_CXXFLAGS := \
- -isysroot $(gb_SDKDIR) \
- -Wall \
- -Wendif-labels \
- -Wextra \
- -Wno-ctor-dtor-privacy \
- -Wno-long-double \
- -Wno-non-virtual-dtor \
- -fPIC \
- -fmessage-length=0 \
- -fno-common \
- -fno-strict-aliasing \
- -fsigned-char \
- -malign-natural \
- -pipe \
- #-Wshadow \ break in compiler headers already
- #-fsigned-char \ might be removed?
- #-malign-natural \ might be removed?
+ -isysroot $(gb_SDKDIR) \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -Wno-ctor-dtor-privacy \
+ -Wno-long-double \
+ -Wno-non-virtual-dtor \
+ -fPIC \
+ -fmessage-length=0 \
+ -fno-common \
+ -fno-strict-aliasing \
+ -fsigned-char \
+ -malign-natural \
+ -pipe \
+ #-Wshadow \ break in compiler headers already
+ #-fsigned-char \ might be removed?
+ #-malign-natural \ might be removed?
# these are to get g++ to switch to Objective-C++ mode
# (see toolkit module for a case where it is necessary to do it this way)
@@ -113,17 +113,17 @@ gb_CXXFLAGS_WERROR := -Werror
endif
gb_LinkTarget_EXCEPTIONFLAGS := \
- -DEXCEPTIONS_ON \
- -fexceptions \
- -fno-enforce-eh-specs \
+ -DEXCEPTIONS_ON \
+ -fexceptions \
+ -fno-enforce-eh-specs \
gb_LinkTarget_NOEXCEPTIONFLAGS := \
- -DEXCEPTIONS_OFF \
- -fno-exceptions \
+ -DEXCEPTIONS_OFF \
+ -fno-exceptions \
gb_LinkTarget_LDFLAGS := \
- -Wl,-syslibroot,$(gb_SDKDIR) \
- $(subst -L../lib , ,$(SOLARLIB)) \
+ -Wl,-syslibroot,$(gb_SDKDIR) \
+ $(subst -L../lib , ,$(SOLARLIB)) \
#man ld says: obsolete -Wl,-multiply_defined,suppress \
ifeq ($(gb_DEBUGLEVEL),2)
@@ -151,16 +151,16 @@ endef
define gb_CObject__command
$(call gb_Output_announce,$(2),$(true),C ,3)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
- $(gb_CC) \
- $(DEFS) $(CFLAGS) \
- -c $(3) \
- -o $(1) \
- -MMD -MT $(call gb_CObject_get_target,$(2)) \
- -MF $(call gb_CObject_get_dep_target,$(2)) \
- -I$(dir $(3)) \
- $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+ $(gb_CC) \
+ $(DEFS) $(CFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CObject_get_target,$(2)) \
+ -MF $(call gb_CObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(INCLUDE))
endef
@@ -170,16 +170,16 @@ endef
define gb_CxxObject__command
$(call gb_Output_announce,$(2),$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
- $(gb_CXX) \
- $(DEFS) $(CXXFLAGS) \
- -c $(3) \
- -o $(1) \
- -MMD -MT $(call gb_CxxObject_get_target,$(2)) \
- -MF $(call gb_CxxObject_get_dep_target,$(2)) \
- -I$(dir $(3)) \
- $(INCLUDE_STL) $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ $(DEFS) $(CXXFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CxxObject_get_target,$(2)) \
+ -MF $(call gb_CxxObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(INCLUDE_STL) $(INCLUDE))
endef
@@ -188,16 +188,16 @@ endef
define gb_ObjCxxObject__command
$(call gb_Output_announce,$(2),$(true),OCX,3)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- mkdir -p $(dir $(call gb_ObjCxxObject_get_dep_target,$(2))) && \
- $(gb_CXX) \
- $(DEFS) $(OBJCXXFLAGS) \
- -c $(3) \
- -o $(1) \
- -MMD -MT $(call gb_ObjCxxObject_get_target,$(2)) \
- -MF $(call gb_ObjCxxObject_get_dep_target,$(2)) \
- -I$(dir $(3)) \
- $(INCLUDE_STL) $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_ObjCxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ $(DEFS) $(OBJCXXFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_ObjCxxObject_get_target,$(2)) \
+ -MF $(call gb_ObjCxxObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(INCLUDE_STL) $(INCLUDE))
endef
@@ -208,12 +208,12 @@ $(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
endef
gb_LinkTarget__RPATHS := \
- URELIB:@__________________________________________________URELIB/ \
- UREBIN: \
- OOO:@__________________________________________________OOO/ \
- BRAND: \
- SDKBIN: \
- NONEBIN: \
+ URELIB:@__________________________________________________URELIB/ \
+ UREBIN: \
+ OOO:@__________________________________________________OOO/ \
+ BRAND: \
+ SDKBIN: \
+ NONEBIN: \
define gb_LinkTarget__get_installname
$(if $(2),-install_name '$(2)$(1)',)
@@ -240,51 +240,51 @@ endef
define gb_LinkTarget__get_layer
$(if $(filter Executable,$(1)),\
- $$(call gb_Executable_get_layer,$(2)),\
- $$(call gb_Library_get_layer,$(2)))
+ $$(call gb_Executable_get_layer,$(2)),\
+ $$(call gb_Library_get_layer,$(2)))
endef
# FIXME the DYLIB_FILE mess is only necessary because
# solver layout is different from installation layout
define gb_LinkTarget__command_dynamiclink
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- DYLIB_FILE=`$(gb_MKTEMP)` && \
- $(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
- $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
- $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
- $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
- $(patsubst lib%.dylib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
- $(patsubst %,-l%,$(EXTERNAL_LIBS)) \
- > $${DYLIB_FILE} && \
- $(gb_CXX) \
- $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
- $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
- $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
- $(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
- -o $(1) \
- `cat $${DYLIB_FILE}` && \
- $(if $(filter Library CppunitTest,$(TARGETTYPE)),\
- $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Library $(LAYER) $(1) && \
- ln -sf $(1) $(patsubst %.dylib,%.jnilib,$(1)) &&) \
- rm -f $${DYLIB_FILE})
+ mkdir -p $(dir $(1)) && \
+ DYLIB_FILE=`$(gb_MKTEMP)` && \
+ $(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
+ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
+ $(patsubst lib%.dylib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
+ $(patsubst %,-l%,$(EXTERNAL_LIBS)) \
+ > $${DYLIB_FILE} && \
+ $(gb_CXX) \
+ $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
+ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
+ $(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
+ -o $(1) \
+ `cat $${DYLIB_FILE}` && \
+ $(if $(filter Library CppunitTest,$(TARGETTYPE)),\
+ $(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl Library $(LAYER) $(1) && \
+ ln -sf $(1) $(patsubst %.dylib,%.jnilib,$(1)) &&) \
+ rm -f $${DYLIB_FILE})
endef
# parameters: 1-linktarget 2-cobjects 3-cxxobjects
define gb_LinkTarget__command_staticlink
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- $(gb_AR) -rsu $(1) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- 2> /dev/null)
+ mkdir -p $(dir $(1)) && \
+ $(gb_AR) -rsu $(1) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ 2> /dev/null)
endef
define gb_LinkTarget__command
@@ -317,40 +317,40 @@ gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
endif
gb_Library__FRAMEWORKS := \
- Cocoa \
+ Cocoa \
gb_Library_PLAINLIBS_NONE += \
- Cocoa \
- objc \
- jpeg \
- m \
- pthread \
- z \
- cppunit
+ Cocoa \
+ objc \
+ jpeg \
+ m \
+ pthread \
+ z \
+ cppunit
gb_Library_FILENAMES := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
gb_Library_LAYER := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
define gb_Library_get_rpath
$(call gb_LinkTarget__get_installname,$(call gb_Library_get_filename,$(1)),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1))))
@@ -371,8 +371,8 @@ gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
gb_StaticLibrary_FILENAMES := \
- $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
- $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
gb_StaticLibrary_StaticLibrary_platform =
@@ -383,11 +383,11 @@ gb_Executable_EXT :=
gb_Executable_TARGETTYPEFLAGS := -bind_at_load
gb_Executable_LAYER := \
- $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
- $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
- $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
- $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
- $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
+ $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
+ $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
+ $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
+ $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
+ $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
define gb_Executable_get_rpath
@@ -419,7 +419,7 @@ endef
define gb_JunitTest_JunitTest_platform
$(call gb_JunitTest_get_target,$(1)) : DEFS := \
- -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/OpenOffice.org.app/Contents/MacOS/soffice}" \
+ -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/OpenOffice.org.app/Contents/MacOS/soffice}" \
-Dorg.openoffice.test.arg.env=DYLD_LIBRARY_PATH \
-Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \
@@ -440,12 +440,12 @@ gb_SrsPartTarget_RSCCOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUT
define gb_SrsPartTarget__command_dep
$(call gb_Helper_abbreviate_dirs,\
- $(gb_GCCP) \
- -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
- $(INCLUDE) \
- $(DEFS) \
- -c -x c++-header $(2) \
- -o $(call gb_SrsPartTarget_get_dep_target,$(1)))
+ $(gb_GCCP) \
+ -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
+ $(INCLUDE) \
+ $(DEFS) \
+ -c -x c++-header $(2) \
+ -o $(call gb_SrsPartTarget_get_dep_target,$(1)))
endef
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 7de6d7dc7528..e293cb980a08 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -43,19 +43,19 @@ gb_CXX := $(CXX)
endif
gb_OSDEFS := \
- -D$(OS) \
- -D$(GUI) \
- -DSYSV \
- -DSUN \
- -DSUN4 \
- -D_REENTRANT \
- -D_POSIX_PTHREAD_SEMANTICS \
- -D_PTHREADS \
- -DUNIX \
+ -D$(OS) \
+ -D$(GUI) \
+ -DSYSV \
+ -DSUN \
+ -DSUN4 \
+ -D_REENTRANT \
+ -D_POSIX_PTHREAD_SEMANTICS \
+ -D_PTHREADS \
+ -DUNIX \
gb_COMPILERDEFS := \
- -D$(COM) \
- -DCPPU_ENV=sunpro5 \
+ -D$(COM) \
+ -DCPPU_ENV=sunpro5 \
gb_CPUDEFS := -D$(CPUNAME)
ifeq ($(CPUNAME),SPARC)
@@ -63,22 +63,22 @@ gb_CPUDEFS += -D__sparcv8plus
endif
gb_CFLAGS := \
- -temp=/tmp \
- -KPIC \
- -mt \
- -xldscope=hidden \
- -xCC \
- -xc99=none \
+ -temp=/tmp \
+ -KPIC \
+ -mt \
+ -xldscope=hidden \
+ -xCC \
+ -xc99=none \
gb_CXXFLAGS := \
- -temp=/tmp \
- -KPIC \
- -mt \
- -xldscope=hidden \
- -features=no%altspell \
- -library=no%Cstd \
- +w2 \
- -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype \
+ -temp=/tmp \
+ -KPIC \
+ -mt \
+ -xldscope=hidden \
+ -features=no%altspell \
+ -library=no%Cstd \
+ +w2 \
+ -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype \
ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
gb_CFLAGS_WERROR := -errwarn=%all
@@ -86,23 +86,23 @@ gb_CXXFLAGS_WERROR := -xwe
endif
gb_LinkTarget_EXCEPTIONFLAGS := \
- -DEXCEPTIONS_ON \
+ -DEXCEPTIONS_ON \
gb_LinkTarget_NOEXCEPTIONFLAGS := \
- -DEXCEPTIONS_OFF \
- -noex \
+ -DEXCEPTIONS_OFF \
+ -noex \
gb_LinkTarget_LDFLAGS := \
- $(subst -L../lib , ,$(SOLARLIB)) \
- -temp=/tmp \
- -w \
- -mt \
- -Bdirect \
- -z defs \
- -z combreloc \
- -norunpath \
- -PIC \
- -library=no%Cstd \
+ $(subst -L../lib , ,$(SOLARLIB)) \
+ -temp=/tmp \
+ -w \
+ -mt \
+ -Bdirect \
+ -z defs \
+ -z combreloc \
+ -norunpath \
+ -PIC \
+ -library=no%Cstd \
ifeq ($(gb_DEBUGLEVEL),2)
gb_COMPILEROPTFLAGS :=
@@ -137,17 +137,17 @@ endef
define gb_CObject__command
$(call gb_Output_announce,$(2),$(true),C ,3)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- rm -f $(call gb_CObject_get_dep_target,$(2)) && \
- mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
- $(gb_CC) \
- -c $(3) \
- -o $(1) \
- -xMMD \
- -xMF $(call gb_CObject_get_dep_target,$(2)) \
- $(DEFS) $(CFLAGS) \
- -I$(dir $(3)) \
- $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ rm -f $(call gb_CObject_get_dep_target,$(2)) && \
+ mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+ $(gb_CC) \
+ -c $(3) \
+ -o $(1) \
+ -xMMD \
+ -xMF $(call gb_CObject_get_dep_target,$(2)) \
+ $(DEFS) $(CFLAGS) \
+ -I$(dir $(3)) \
+ $(INCLUDE))
endef
@@ -156,16 +156,16 @@ endef
define gb_CxxObject__command
$(call gb_Output_announce,$(2),$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
- $(gb_CXX) \
- $(DEFS) $(CXXFLAGS) \
- -c $(3) \
- -o $(1) \
- -xMMD \
- -xMF $(call gb_CxxObject_get_dep_target,$(2)) \
- -I$(dir $(3)) \
- $(INCLUDE_STL) $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ $(DEFS) $(CXXFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -xMMD \
+ -xMF $(call gb_CxxObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(INCLUDE_STL) $(INCLUDE))
endef
@@ -176,12 +176,12 @@ $(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
endef
gb_LinkTarget__RPATHS := \
- URELIB:\dORIGIN \
- UREBIN:\dORIGIN/../lib:\dORIGIN \
- OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
- BRAND:\dORIGIN:\dORIGIN/../basis-link/program:\dORIGIN/../basis-link/ure-link/lib \
- SDKBIN:\dORIGIN/../../ure-link/lib \
- NONEBIN:\dORIGIN/../lib:\dORIGIN \
+ URELIB:\dORIGIN \
+ UREBIN:\dORIGIN/../lib:\dORIGIN \
+ OOO:\dORIGIN:\dORIGIN/../ure-link/lib \
+ BRAND:\dORIGIN:\dORIGIN/../basis-link/program:\dORIGIN/../basis-link/ure-link/lib \
+ SDKBIN:\dORIGIN/../../ure-link/lib \
+ NONEBIN:\dORIGIN/../lib:\dORIGIN \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
@@ -196,27 +196,27 @@ gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
define gb_LinkTarget__command_dynamiclink
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- $(gb_CXX) \
- $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
- $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
- $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
- $(patsubst %,-l%,$(EXTERNAL_LIBS)) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
- -o $(1))
+ mkdir -p $(dir $(1)) && \
+ $(gb_CXX) \
+ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(subst \d,$$,$(RPATH)) $(LDFLAGS) \
+ $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \
+ $(patsubst %,-l%,$(EXTERNAL_LIBS)) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \
+ -o $(1))
endef
define gb_LinkTarget__command_staticlink
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) && \
- $(gb_AR) -rsu $(1) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- 2> /dev/null)
+ mkdir -p $(dir $(1)) && \
+ $(gb_AR) -rsu $(1) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ 2> /dev/null)
endef
define gb_LinkTarget__command
@@ -248,46 +248,46 @@ gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
endif
gb_STDLIBS := \
- Crun \
- m \
- c \
+ Crun \
+ m \
+ c \
gb_Library_PLAINLIBS_NONE += \
- $(gb_STDLIBS) \
- dl \
+ $(gb_STDLIBS) \
+ dl \
freetype \
- jpeg \
- pthread \
- X11 \
+ jpeg \
+ pthread \
+ X11 \
Xext \
SM \
ICE \
- z \
- cppunit
+ z \
+ cppunit
gb_Library_FILENAMES := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
gb_Library_LAYER := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
define gb_Library_get_rpath
'-R$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))'
@@ -307,8 +307,8 @@ gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
gb_StaticLibrary_FILENAMES := \
- $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
- $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
gb_StaticLibrary_StaticLibrary_platform =
@@ -318,11 +318,11 @@ gb_StaticLibrary_StaticLibrary_platform =
gb_Executable_EXT :=
gb_Executable_LAYER := \
- $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
- $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
- $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
- $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
- $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
+ $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
+ $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
+ $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \
+ $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
+ $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
define gb_Executable_get_rpath
@@ -352,7 +352,7 @@ endef
define gb_JunitTest_JunitTest_platform
$(call gb_JunitTest_get_target,$(1)) : DEFS := \
- -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/openoffice.org3/program/soffice}" \
+ -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/openoffice.org3/program/soffice}" \
-Dorg.openoffice.test.arg.env=LD_LIBRARY_PATH \
-Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \
@@ -375,18 +375,18 @@ gb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDI
# do not have the right suffix, so use makedepend here...
define gb_SrsPartTarget__command_dep
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(INCLUDE) \
- $(DEFS) \
- $(2) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_SrsPartTarget_get_dep_target,$(1)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(INCLUDE) \
+ $(DEFS) \
+ $(2) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_SrsPartTarget_get_dep_target,$(1)))
endef
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index 9d5a9aa850cf..5e50c3d5738c 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -45,124 +45,124 @@ gb_CXX := $(CXX)
endif
gb_OSDEFS := \
- -DWINVER=0x0500 \
- -D_WIN32_IE=0x0500 \
- -DNT351 \
- -DWIN32 \
- -DWNT \
+ -DWINVER=0x0500 \
+ -D_WIN32_IE=0x0500 \
+ -DNT351 \
+ -DWIN32 \
+ -DWNT \
gb_COMPILERDEFS := \
- -DMSC \
- -D_CRT_NON_CONFORMING_SWPRINTFS \
- -D_CRT_NONSTDC_NO_DEPRECATE \
- -D_CRT_SECURE_NO_DEPRECATE \
- -D_MT \
- -DBOOST_MEM_FN_ENABLE_CDECL \
- -DCPPU_ENV=msci \
- -DFULL_DESK \
- -DM1500 \
+ -DMSC \
+ -D_CRT_NON_CONFORMING_SWPRINTFS \
+ -D_CRT_NONSTDC_NO_DEPRECATE \
+ -D_CRT_SECURE_NO_DEPRECATE \
+ -D_MT \
+ -DBOOST_MEM_FN_ENABLE_CDECL \
+ -DCPPU_ENV=msci \
+ -DFULL_DESK \
+ -DM1500 \
gb_CPUDEFS := -DINTEL -D_X86_=1
gb_RCDEFS := \
-DWINVER=0x0400 \
- -DWIN32 \
+ -DWIN32 \
gb_RCFLAGS := \
-V
gb_CFLAGS := \
- -Gd \
- -GR \
- -Gs \
- -GS \
- -Gy \
- -nologo \
- -Wall \
- -wd4005 \
- -wd4061 \
- -wd4127 \
- -wd4180 \
- -wd4189 \
- -wd4191 \
- -wd4217 \
- -wd4250 \
- -wd4251 \
- -wd4255 \
- -wd4275 \
- -wd4290 \
- -wd4294 \
- -wd4350 \
- -wd4355 \
- -wd4365 \
- -wd4503 \
- -wd4505 \
- -wd4511 \
- -wd4512 \
- -wd4514 \
- -wd4611 \
- -wd4619 \
- -wd4625 \
- -wd4626 \
- -wd4640 \
- -wd4668 \
- -wd4675 \
- -wd4692 \
- -wd4710 \
- -wd4711 \
- -wd4738 \
- -wd4786 \
- -wd4800 \
- -wd4820 \
- -wd4826 \
- -Zc:forScope,wchar_t- \
- -Zm500 \
+ -Gd \
+ -GR \
+ -Gs \
+ -GS \
+ -Gy \
+ -nologo \
+ -Wall \
+ -wd4005 \
+ -wd4061 \
+ -wd4127 \
+ -wd4180 \
+ -wd4189 \
+ -wd4191 \
+ -wd4217 \
+ -wd4250 \
+ -wd4251 \
+ -wd4255 \
+ -wd4275 \
+ -wd4290 \
+ -wd4294 \
+ -wd4350 \
+ -wd4355 \
+ -wd4365 \
+ -wd4503 \
+ -wd4505 \
+ -wd4511 \
+ -wd4512 \
+ -wd4514 \
+ -wd4611 \
+ -wd4619 \
+ -wd4625 \
+ -wd4626 \
+ -wd4640 \
+ -wd4668 \
+ -wd4675 \
+ -wd4692 \
+ -wd4710 \
+ -wd4711 \
+ -wd4738 \
+ -wd4786 \
+ -wd4800 \
+ -wd4820 \
+ -wd4826 \
+ -Zc:forScope,wchar_t- \
+ -Zm500 \
gb_CXXFLAGS := \
- -Gd \
- -GR \
- -Gs \
- -GS \
- -Gy \
- -nologo \
- -Wall \
- -wd4005 \
- -wd4061 \
- -wd4127 \
- -wd4180 \
- -wd4189 \
- -wd4191 \
- -wd4217 \
- -wd4250 \
- -wd4251 \
- -wd4275 \
- -wd4290 \
- -wd4294 \
- -wd4350 \
- -wd4355 \
- -wd4365 \
- -wd4503 \
- -wd4505 \
- -wd4511 \
- -wd4512 \
- -wd4514 \
- -wd4611 \
- -wd4619 \
- -wd4625 \
- -wd4626 \
- -wd4640 \
- -wd4668 \
- -wd4675 \
- -wd4692 \
- -wd4710 \
- -wd4711 \
- -wd4738 \
- -wd4786 \
- -wd4800 \
- -wd4820 \
- -wd4826 \
- -Zc:forScope,wchar_t- \
- -Zm500 \
+ -Gd \
+ -GR \
+ -Gs \
+ -GS \
+ -Gy \
+ -nologo \
+ -Wall \
+ -wd4005 \
+ -wd4061 \
+ -wd4127 \
+ -wd4180 \
+ -wd4189 \
+ -wd4191 \
+ -wd4217 \
+ -wd4250 \
+ -wd4251 \
+ -wd4275 \
+ -wd4290 \
+ -wd4294 \
+ -wd4350 \
+ -wd4355 \
+ -wd4365 \
+ -wd4503 \
+ -wd4505 \
+ -wd4511 \
+ -wd4512 \
+ -wd4514 \
+ -wd4611 \
+ -wd4619 \
+ -wd4625 \
+ -wd4626 \
+ -wd4640 \
+ -wd4668 \
+ -wd4675 \
+ -wd4692 \
+ -wd4710 \
+ -wd4711 \
+ -wd4738 \
+ -wd4786 \
+ -wd4800 \
+ -wd4820 \
+ -wd4826 \
+ -Zc:forScope,wchar_t- \
+ -Zm500 \
gb_STDLIBS := \
uwinapi \
@@ -176,26 +176,26 @@ gb_CXXFLAGS_WERROR := -WX
endif
gb_LinkTarget_EXCEPTIONFLAGS := \
- -DEXCEPTIONS_ON \
- -EHa \
+ -DEXCEPTIONS_ON \
+ -EHa \
gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
gb_LinkTarget_NOEXCEPTIONFLAGS := \
- -DEXCEPTIONS_OFF \
+ -DEXCEPTIONS_OFF \
gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
gb_LinkTarget_LDFLAGS := \
- -MACHINE:IX86 \
- -NODEFAULTLIB \
- -OPT:NOREF \
- -SUBSYSTEM:CONSOLE \
- -safeseh \
- -nxcompat \
- -dynamicbase \
- $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
+ -MACHINE:IX86 \
+ -NODEFAULTLIB \
+ -OPT:NOREF \
+ -SUBSYSTEM:CONSOLE \
+ -safeseh \
+ -nxcompat \
+ -dynamicbase \
+ $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
ifneq ($(ENABLE_CRASHDUMP),)
gb_LinkTarget_LDFLAGS += -DEBUG
@@ -243,19 +243,19 @@ endef
ifeq ($(gb_FULLDEPS),$(true))
define gb_CObject__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME)%,$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_CObject_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME)%,$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_CObject_get_dep_target,$(2)))
endef
else
CObject__command_deponcompile =
@@ -264,15 +264,15 @@ endif
define gb_CObject__command
$(call gb_Output_announce,$(2),$(true),C ,3)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- unset INCLUDE && \
- $(gb_CC) \
- $(DEFS) $(CFLAGS) -Fd$(PDBFILE) \
+ mkdir -p $(dir $(1)) && \
+ unset INCLUDE && \
+ $(gb_CC) \
+ $(DEFS) $(CFLAGS) -Fd$(PDBFILE) \
$(PCHFLAGS) \
- -I$(dir $(3)) \
- $(INCLUDE) \
- -c $(3) \
- -Fo$(1))
+ -I$(dir $(3)) \
+ $(INCLUDE) \
+ -c $(3) \
+ -Fo$(1))
$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
endef
@@ -282,19 +282,19 @@ endef
ifeq ($(gb_FULLDEPS),$(true))
define gb_CxxObject__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME)%,$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_CxxObject_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME)%,$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_CxxObject_get_dep_target,$(2)))
endef
else
gb_CxxObject__command_deponcompile =
@@ -303,15 +303,15 @@ endif
define gb_CxxObject__command
$(call gb_Output_announce,$(2),$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- unset INCLUDE && \
- $(gb_CXX) \
- $(DEFS) $(CXXFLAGS) -Fd$(PDBFILE)\
+ mkdir -p $(dir $(1)) && \
+ unset INCLUDE && \
+ $(gb_CXX) \
+ $(DEFS) $(CXXFLAGS) -Fd$(PDBFILE)\
$(PCHFLAGS) \
- -I$(dir $(3)) \
- $(INCLUDE_STL) $(INCLUDE) \
- -c $(3) \
- -Fo$(1))
+ -I$(dir $(3)) \
+ $(INCLUDE_STL) $(INCLUDE) \
+ -c $(3) \
+ -Fo$(1))
$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
endef
@@ -319,24 +319,24 @@ endef
# PrecompiledHeader class
gb_PrecompiledHeader_get_enableflags = -Yu$(1).hxx \
- -Fp$(call gb_PrecompiledHeader_get_target,$(1))
+ -Fp$(call gb_PrecompiledHeader_get_target,$(1))
ifeq ($(gb_FULLDEPS),$(true))
define gb_PrecompiledHeader__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_PrecompiledHeader_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_PrecompiledHeader_get_dep_target,$(2)))
endef
else
gb_PrecompiledHeader__command_deponcompile =
@@ -346,38 +346,38 @@ endif
define gb_PrecompiledHeader__command
$(call gb_Output_announce,$(2),$(true),PCH,1)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
- unset INCLUDE && \
- $(gb_CXX) \
- $(4) $(5) -Fd$(PDBFILE) \
- -I$(dir $(3)) \
- $(6) \
- -c $(3) \
- -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
+ mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
+ unset INCLUDE && \
+ $(gb_CXX) \
+ $(4) $(5) -Fd$(PDBFILE) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
endef
# NoexPrecompiledHeader class
gb_NoexPrecompiledHeader_get_enableflags = -Yu$(1).hxx \
- -Fp$(call gb_NoexPrecompiledHeader_get_target,$(1))
+ -Fp$(call gb_NoexPrecompiledHeader_get_target,$(1))
ifeq ($(gb_FULLDEPS),$(true))
define gb_NoexPrecompiledHeader__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% -I$(JAVA_HOME)%,$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
endef
else
gb_NoexPrecompiledHeader__command_deponcompile =
@@ -387,14 +387,14 @@ endif
define gb_NoexPrecompiledHeader__command
$(call gb_Output_announce,$(2),$(true),PCH,1)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
- unset INCLUDE && \
- $(gb_CXX) \
- $(4) $(5) -Fd$(PDBFILE) \
- -I$(dir $(3)) \
- $(6) \
- -c $(3) \
- -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
+ mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
+ unset INCLUDE && \
+ $(gb_CXX) \
+ $(4) $(5) -Fd$(PDBFILE) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
endef
@@ -404,8 +404,8 @@ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
gb_LinkTarget_INCLUDE :=\
- $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
- $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
+ $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
+ $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
@@ -414,24 +414,24 @@ gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb
define gb_LinkTarget__command
$(call gb_Output_announce,$(2),$(true),LNK,4)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- rm -f $(1) && \
- RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \
- $(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(PCHOBJS) $(NATIVERES))) && \
- $(gb_LINK) \
- $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
- $(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
- $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
- $(LDFLAGS) \
- @$${RESPONSEFILE} \
- $(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))) \
- $(patsubst %,%.lib,$(EXTERNAL_LIBS)) \
- $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \
- $(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \
- $(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) ; exit $$RC)
+ mkdir -p $(dir $(1)) && \
+ rm -f $(1) && \
+ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \
+ $(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(PCHOBJS) $(NATIVERES))) && \
+ $(gb_LINK) \
+ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
+ $(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
+ $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
+ $(LDFLAGS) \
+ @$${RESPONSEFILE} \
+ $(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))) \
+ $(patsubst %,%.lib,$(EXTERNAL_LIBS)) \
+ $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \
+ $(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \
+ $(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) ; exit $$RC)
endef
@@ -445,40 +445,40 @@ gb_Library_SYSPRE := i
gb_Library_PLAINEXT := .lib
gb_Library_PLAINLIBS_NONE += \
- advapi32 \
- gdi32 \
- gdiplus \
- gnu_getopt \
- imm32\
- kernel32 \
- msimg32 \
- msvcrt \
- mpr \
- oldnames \
- ole32 \
- oleaut32 \
- shell32 \
- user32 \
- uuid \
- uwinapi \
- winspool \
- z \
- cppunit
+ advapi32 \
+ gdi32 \
+ gdiplus \
+ gnu_getopt \
+ imm32\
+ kernel32 \
+ msimg32 \
+ msvcrt \
+ mpr \
+ oldnames \
+ ole32 \
+ oleaut32 \
+ shell32 \
+ user32 \
+ uuid \
+ uwinapi \
+ winspool \
+ z \
+ cppunit
gb_Library_LAYER := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
gb_Library_FILENAMES :=\
- $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
gb_Library_DLLEXT := .dll
gb_Library_MAJORVER := 3
@@ -494,26 +494,26 @@ gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
gb_Library_DLLFILENAMES :=\
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
define gb_Library_Library_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
$(call gb_LinkTarget_set_auxtargets,$(2),\
- $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
- $(3).manifest \
- $(call gb_LinkTarget_get_pdbfile,$(2)) \
- $(patsubst %.dll,%.pdb,$(3)) \
- $(patsubst %.dll,%.ilk,$(3)) \
+ $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
+ $(3).manifest \
+ $(call gb_LinkTarget_get_pdbfile,$(2)) \
+ $(patsubst %.dll,%.pdb,$(3)) \
+ $(patsubst %.dll,%.ilk,$(3)) \
)
$(call gb_Library_get_target,$(1)) \
@@ -522,8 +522,8 @@ $(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir
ifneq ($(ENABLE_CRASHDUMP),)
$(call gb_Library_get_target,$(1)) \
$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += \
- $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
- $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
+ $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
+ $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))),$(patsubst %.dll,%.pdb,$(3)))
$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))),$(patsubst %.dll,%.ilk,$(3)))
@@ -541,9 +541,9 @@ $(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
$(call gb_WinResTarget_set_defs,$(1)/$(2),\
$$(DEFS) \
- -DADDITIONAL_VERINFO1 \
- -DADDITIONAL_VERINFO2 \
- -DADDITIONAL_VERINFO3 \
+ -DADDITIONAL_VERINFO1 \
+ -DADDITIONAL_VERINFO2 \
+ -DADDITIONAL_VERINFO3 \
)
$(call gb_Library_add_nativeres,$(1),$(2))
$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
@@ -570,8 +570,8 @@ gb_StaticLibrary_PLAINEXT := .lib
gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
gb_StaticLibrary_FILENAMES := \
- $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
- $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
@@ -580,7 +580,7 @@ $(call gb_LinkTarget_get_target,$(2)) \
$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
$(call gb_LinkTarget_set_auxtargets,$(2),\
- $(call gb_LinkTarget_get_pdbfile,$(2)) \
+ $(call gb_LinkTarget_get_pdbfile,$(2)) \
)
endef
@@ -593,9 +593,9 @@ gb_Executable_get_rpath :=
define gb_Executable_Executable_platform
$(call gb_LinkTarget_set_auxtargets,$(2),\
- $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
- $(call gb_LinkTarget_get_pdbfile,$(2)) \
- $(call gb_LinkTarget_get_target,$(2)).manifest \
+ $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
+ $(call gb_LinkTarget_get_pdbfile,$(2)) \
+ $(call gb_LinkTarget_get_target,$(2)).manifest \
)
$(call gb_Executable_get_target,$(1)) \
@@ -619,11 +619,11 @@ define gb_CppunitTest_CppunitTest_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
$(call gb_LinkTarget_set_auxtargets,$(2),\
- $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
- $(3).manifest \
- $(patsubst %.dll,%.pdb,$(3)) \
- $(call gb_LinkTarget_get_pdbfile,$(2)) \
- $(patsubst %.dll,%.ilk,$(3)) \
+ $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
+ $(3).manifest \
+ $(patsubst %.dll,%.pdb,$(3)) \
+ $(call gb_LinkTarget_get_pdbfile,$(2)) \
+ $(patsubst %.dll,%.ilk,$(3)) \
)
$(call gb_LinkTarget_get_target,$(2)) \
@@ -654,11 +654,11 @@ $(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).inst
$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath)
$(call gb_JunitTest_get_target,$(1)).instpath :
- INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
- && unzip -d "$$$${INST_DIR}" $$(gb_smoketest_instset) \
- && mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
- && mkdir -p $$(dir $$@) \
- && echo "$$$${INST_DIR}" > $$@
+ INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \
+ && unzip -d "$$$${INST_DIR}" $$(gb_smoketest_instset) \
+ && mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\
+ && mkdir -p $$(dir $$@) \
+ && echo "$$$${INST_DIR}" > $$@
endef
else # OOO_TEST_SOFFICE
@@ -669,7 +669,7 @@ define gb_JunitTest_JunitTest_platform
$(call gb_JunitTest_JunitTest_platform_longpathname_hack,$(1))
$(call gb_JunitTest_get_target,$(1)) : DEFS := \
- -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
+ -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:`cat $(call gb_JunitTest_get_target,$(1)).instpath`/opt/OpenOffice.org 3/program/soffice.exe}" \
-Dorg.openoffice.test.arg.env=PATH \
-Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) \
@@ -692,18 +692,18 @@ gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCT
ifeq ($(gb_FULLDEPS),$(true))
define gb_SrsPartTarget__command_dep
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(INCLUDE) \
- $(DEFS) \
- $(2) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_SrsPartTarget_get_dep_target,$(1)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(INCLUDE) \
+ $(DEFS) \
+ $(2) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_SrsPartTarget_get_dep_target,$(1)))
endef
else
gb_SrsPartTarget__command_dep =
@@ -716,34 +716,34 @@ gb_WinResTarget_POSTFIX :=.res
define gb_WinResTarget__command
$(call gb_Output_announce,$(2),$(true),RES,3)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- $(gb_RC) \
- $(DEFS) $(FLAGS) \
- -I$(dir $(3)) \
- $(INCLUDE) \
- -Fo$(1) \
+ mkdir -p $(dir $(1)) && \
+ $(gb_RC) \
+ $(DEFS) $(FLAGS) \
+ -I$(dir $(3)) \
+ $(INCLUDE) \
+ -Fo$(1) \
$(RCFILE) )
endef
$(eval $(call gb_Helper_make_dep_targets,\
- WinResTarget \
+ WinResTarget \
))
ifeq ($(gb_FULLDEPS),$(true))
define gb_WinResTarget__command_dep
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(INCLUDE) \
- $(DEFS) \
- $(2) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_WinResTarget_get_dep_target,$(1)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(INCLUDE) \
+ $(DEFS) \
+ $(2) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_WinResTarget_get_dep_target,$(1)))
endef
else
gb_WinResTarget__command_dep =
diff --git a/solenv/gbuild/platform/winmingw.mk b/solenv/gbuild/platform/winmingw.mk
index 3fe1ebfb254f..b7df79733094 100644
--- a/solenv/gbuild/platform/winmingw.mk
+++ b/solenv/gbuild/platform/winmingw.mk
@@ -47,54 +47,54 @@ ifeq ($(MINGW_SHARED_GXXLIB),YES)
gb_MINGW_LIBSTDCPP := $(subst -l,,$(MINGW_SHARED_LIBSTDCPP))
else
gb_MINGW_LIBSTDCPP := \
- stdc++ \
- moldname
+ stdc++ \
+ moldname
endif
ifeq ($(MINGW_SHARED_GCCLIB),YES)
gb_MINGW_LIBGCC := \
- gcc_s \
- gcc
+ gcc_s \
+ gcc
else
ifeq ($(MINGW_GCCLIB_EH),YES)
gb_MINGW_LIBGCC := \
- gcc \
- gcc_eh
+ gcc \
+ gcc_eh
else
gb_MINGW_LIBGCC := gcc
endif
endif
gb_OSDEFS := \
- -DWINVER=0x0500 \
- -D_WIN32_IE=0x0500 \
- -D_WIN32_WINNT=0x0600 \
- -DNT351 \
- -DWIN32 \
- -DWNT \
+ -DWINVER=0x0500 \
+ -D_WIN32_IE=0x0500 \
+ -D_WIN32_WINNT=0x0600 \
+ -DNT351 \
+ -DWIN32 \
+ -DWNT \
ifeq ($(GXX_INCLUDE_PATH),)
GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion)
endif
gb_COMPILERDEFS := \
- -DGCC \
- -D$(CVER) \
- -DCVER=$(CVER) \
- -DGLIBC=2 \
- -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
- -DCPPU_ENV=gcc3 \
- -D_MT \
- -D_NATIVE_WCHAR_T_DEFINED \
- -D_MSC_EXTENSIONS \
- -D_FORCENAMELESSUNION \
+ -DGCC \
+ -D$(CVER) \
+ -DCVER=$(CVER) \
+ -DGLIBC=2 \
+ -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
+ -DCPPU_ENV=gcc3 \
+ -D_MT \
+ -D_NATIVE_WCHAR_T_DEFINED \
+ -D_MSC_EXTENSIONS \
+ -D_FORCENAMELESSUNION \
ifeq ($(USE_MINGW),cygwin-w64-mingw32)
gb_COMPILERDEFS +=-D_declspec=__declspec
endif
gb_CPUDEFS := \
- -DINTEL \
- -D_M_IX86 \
+ -DINTEL \
+ -D_M_IX86 \
gb_RCDEFS := \
-DWIN32 \
@@ -104,28 +104,28 @@ gb_RCFLAGS := \
-V
gb_CFLAGS := \
- -Wall \
- -Wendif-labels \
- -Wextra \
- -fmessage-length=0 \
- -fno-strict-aliasing \
- -pipe \
- -nostdinc \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -fmessage-length=0 \
+ -fno-strict-aliasing \
+ -pipe \
+ -nostdinc \
gb_CXXFLAGS := \
- -Wall \
- -Wendif-labels \
- -Wextra \
- -Wno-ctor-dtor-privacy \
- -Wno-non-virtual-dtor \
- -Wreturn-type \
- -Wshadow \
- -Wuninitialized \
- -fmessage-length=0 \
- -fno-strict-aliasing \
- -fno-use-cxa-atexit \
- -pipe \
- -nostdinc \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -Wno-ctor-dtor-privacy \
+ -Wno-non-virtual-dtor \
+ -Wreturn-type \
+ -Wshadow \
+ -Wuninitialized \
+ -fmessage-length=0 \
+ -fno-strict-aliasing \
+ -fno-use-cxa-atexit \
+ -pipe \
+ -nostdinc \
ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
gb_CFLAGS_WERROR := -Werror
@@ -137,28 +137,28 @@ gb_CXXFLAGS += --sysroot=$(SYSBASE)
gb_CFLAGS += --sysroot=$(SYSBASE)
endif
gb_LinkTarget_EXCEPTIONFLAGS := \
- -DEXCEPTIONS_ON \
- -fexceptions \
- -fno-enforce-eh-specs \
+ -DEXCEPTIONS_ON \
+ -fexceptions \
+ -fno-enforce-eh-specs \
gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
gb_LinkTarget_NOEXCEPTIONFLAGS := \
- -DEXCEPTIONS_OFF \
- -fno-exceptions \
+ -DEXCEPTIONS_OFF \
+ -fno-exceptions \
gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
gb_LinkTarget_LDFLAGS := \
- --export-all-symbols \
- --kill-at \
- --subsystem console \
- --exclude-libs ALL \
- --enable-stdcall-fixup \
- --enable-runtime-pseudo-reloc-v2 \
- -L$(gb_Library_DLLDIR) \
- $(patsubst %,-L%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
+ --export-all-symbols \
+ --kill-at \
+ --subsystem console \
+ --exclude-libs ALL \
+ --enable-stdcall-fixup \
+ --enable-runtime-pseudo-reloc-v2 \
+ -L$(gb_Library_DLLDIR) \
+ $(patsubst %,-L%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
ifeq ($(MINGW_GCCLIB_EH),YES)
gb_LinkTarget_LDFLAGS += -shared-libgcc
@@ -173,15 +173,15 @@ endif
gb_COMPILERNOOPTFLAGS := -O0
gb_STDLIBS := \
- mingwthrd \
- $(gb_MINGW_LIBSTDCPP) \
- mingw32 \
- $(gb_MINGW_LIBGCC) \
- uwinapi \
- moldname \
- mingwex \
+ mingwthrd \
+ $(gb_MINGW_LIBSTDCPP) \
+ mingw32 \
+ $(gb_MINGW_LIBGCC) \
+ uwinapi \
+ moldname \
+ mingwex \
kernel32 \
- msvcrt \
+ msvcrt \
# Helper class
@@ -212,19 +212,19 @@ endef
ifeq ($(gb_FULLDEPS),$(true))
define gb_CObject__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_CObject_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_CObject_get_dep_target,$(2)))
endef
else
CObject__command_deponcompile =
@@ -233,13 +233,13 @@ endif
define gb_CObject__command
$(call gb_Output_announce,$(2),$(true),C ,3)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- $(gb_CC) \
- $(DEFS) $(CFLAGS) \
- -c $(3) \
- -o $(1) \
- -I$(dir $(3)) \
- $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ $(gb_CC) \
+ $(DEFS) $(CFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -I$(dir $(3)) \
+ $(INCLUDE))
$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
endef
@@ -250,19 +250,19 @@ endef
ifeq ($(gb_FULLDEPS),$(true))
define gb_CxxObject__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_CxxObject_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_CxxObject_get_dep_target,$(2)))
endef
else
gb_CxxObject__command_deponcompile =
@@ -271,13 +271,13 @@ endif
define gb_CxxObject__command
$(call gb_Output_announce,$(2),$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- $(gb_CXX) \
- $(DEFS) $(CXXFLAGS) \
- -c $(3) \
- -o $(1) \
- -I$(dir $(3)) \
- $(INCLUDE_STL) $(INCLUDE))
+ mkdir -p $(dir $(1)) && \
+ $(gb_CXX) \
+ $(DEFS) $(CXXFLAGS) \
+ -c $(3) \
+ -o $(1) \
+ -I$(dir $(3)) \
+ $(INCLUDE_STL) $(INCLUDE))
$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CXXFLAGS),$(INCLUDE_STL) $(INCLUDE))
endef
@@ -287,25 +287,25 @@ endef
gb_PrecompiledHeader_EXT := .gch
gb_PrecompiledHeader_get_enableflags = -I$(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR) \
- -DPRECOMPILED_HEADERS \
- -Winvalid-pch \
+ -DPRECOMPILED_HEADERS \
+ -Winvalid-pch \
ifeq ($(gb_FULLDEPS),$(true))
define gb_PrecompiledHeader__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_PrecompiledHeader_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_PrecompiledHeader_get_dep_target,$(2)))
endef
else
gb_PrecompiledHeader__command_deponcompile =
@@ -314,14 +314,14 @@ endif
define gb_PrecompiledHeader__command
$(call gb_Output_announce,$(2),$(true),PCH,1)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
- $(gb_CXX) \
- -x c++-header \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(6) \
- -c $(3) \
- -o$(1))
+ mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ -x c++-header \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -o$(1))
$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
endef
@@ -331,24 +331,24 @@ endef
gb_NoexPrecompiledHeader_EXT := .gch
gb_NoexPrecompiledHeader_get_enableflags = -I$(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR) \
- -Winvalid-pch \
+ -Winvalid-pch \
ifeq ($(gb_FULLDEPS),$(true))
define gb_NoexPrecompiledHeader__command_deponcompile
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
endef
else
gb_NoexPrecompiledHeader__command_deponcompile =
@@ -357,14 +357,14 @@ endif
define gb_NoexPrecompiledHeader__command
$(call gb_Output_announce,$(2),$(true),PCH,1)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
- $(gb_CXX) \
- -x c++-header \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(6) \
- -c $(3) \
- -o$(1))
+ mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ -x c++-header \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -o$(1))
$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
endef
@@ -382,68 +382,68 @@ gb_LinkTarget_CFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
endif
gb_LinkTarget_INCLUDE :=\
- $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
- $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
+ $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
+ $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
define gb_LinkTarget__command_dynamiclinkexecutable
$(call gb_Output_announce,$(2),$(true),LNK,4)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- RESPONSEFILE=`$(gb_MKTEMP)` && \
- echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(NATIVERES) " > $${RESPONSEFILE} && \
- $(gb_LINK) \
- $(gb_Executable_TARGETTYPEFLAGS) \
- $(LDFLAGS) \
- $(gb_MINGWLIBDIR)/crt2.o \
- $(MINGW_CLIB_DIR)/crtbegin.o \
- @$${RESPONSEFILE} \
- --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
- --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
- --start-group $(patsubst %,-l%,$(EXTERNAL_LIBS)) --end-group \
- $(MINGW_CLIB_DIR)/crtend.o \
- -Map $(basename $(1)).map \
- -o $(1))
+ mkdir -p $(dir $(1)) && \
+ RESPONSEFILE=`$(gb_MKTEMP)` && \
+ echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(NATIVERES) " > $${RESPONSEFILE} && \
+ $(gb_LINK) \
+ $(gb_Executable_TARGETTYPEFLAGS) \
+ $(LDFLAGS) \
+ $(gb_MINGWLIBDIR)/crt2.o \
+ $(MINGW_CLIB_DIR)/crtbegin.o \
+ @$${RESPONSEFILE} \
+ --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
+ --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
+ --start-group $(patsubst %,-l%,$(EXTERNAL_LIBS)) --end-group \
+ $(MINGW_CLIB_DIR)/crtend.o \
+ -Map $(basename $(1)).map \
+ -o $(1))
endef
define gb_LinkTarget__command_dynamiclinklibrary
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- rm -f $(1) && \
- RESPONSEFILE=`$(gb_MKTEMP)` && \
- echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
- $(NATIVERES) " > $${RESPONSEFILE} && \
- $(gb_LINK) \
- $(gb_Library_TARGETTYPEFLAGS) \
- $(LDFLAGS) \
- --enable-auto-image-base \
- -e _DllMainCRTStartup@12 \
- $(gb_MINGWLIBDIR)/dllcrt2.o \
- $(MINGW_CLIB_DIR)/crtbegin.o \
- @$${RESPONSEFILE} \
- --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
- --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
- $(MINGW_CLIB_DIR)/crtend.o \
- -Map $(basename $(DLLTARGET)).map \
- -o $(DLLTARGET) && touch $(1))
+ mkdir -p $(dir $(1)) && \
+ rm -f $(1) && \
+ RESPONSEFILE=`$(gb_MKTEMP)` && \
+ echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(NATIVERES) " > $${RESPONSEFILE} && \
+ $(gb_LINK) \
+ $(gb_Library_TARGETTYPEFLAGS) \
+ $(LDFLAGS) \
+ --enable-auto-image-base \
+ -e _DllMainCRTStartup@12 \
+ $(gb_MINGWLIBDIR)/dllcrt2.o \
+ $(MINGW_CLIB_DIR)/crtbegin.o \
+ @$${RESPONSEFILE} \
+ --start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) --end-group \
+ --start-group $(patsubst %.dll,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_dllname,$(lib)))) --end-group \
+ $(MINGW_CLIB_DIR)/crtend.o \
+ -Map $(basename $(DLLTARGET)).map \
+ -o $(DLLTARGET) && touch $(1))
endef
define gb_LinkTarget__command_staticlinklibrary
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- RESPONSEFILE=`$(gb_MKTEMP)` && \
- echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
- $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
- $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
- $(gb_AR) -rsu\
- $(1) \
- @$${RESPONSEFILE})
+ mkdir -p $(dir $(1)) && \
+ RESPONSEFILE=`$(gb_MKTEMP)` && \
+ echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) " > $${RESPONSEFILE} && \
+ $(gb_AR) -rsu\
+ $(1) \
+ @$${RESPONSEFILE})
endef
define gb_LinkTarget__command
@@ -464,45 +464,45 @@ gb_Library_SYSPRE := i
gb_Library_PLAINEXT := .lib
gb_Library_PLAINLIBS_NONE += \
- mingwthrd \
- mingw32 \
- mingwex \
- $(gb_MINGW_LIBSTDCPP) \
- $(gb_MINGW_LIBGCC) \
- advapi32 \
- gdi32 \
- gdiplus \
- gnu_getopt \
- imm32\
- kernel32 \
- msimg32 \
- msvcrt \
- mpr \
- moldname \
- ole32 \
- oleaut32 \
- shell32 \
- user32 \
- uuid \
- uwinapi \
- winspool \
- z \
- cppunit
+ mingwthrd \
+ mingw32 \
+ mingwex \
+ $(gb_MINGW_LIBSTDCPP) \
+ $(gb_MINGW_LIBGCC) \
+ advapi32 \
+ gdi32 \
+ gdiplus \
+ gnu_getopt \
+ imm32\
+ kernel32 \
+ msimg32 \
+ msvcrt \
+ mpr \
+ moldname \
+ ole32 \
+ oleaut32 \
+ shell32 \
+ user32 \
+ uuid \
+ uwinapi \
+ winspool \
+ z \
+ cppunit
gb_Library_LAYER := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
gb_Library_FILENAMES :=\
- $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
gb_Library_DLLEXT := .dll
gb_Library_MAJORVER := 3
@@ -518,15 +518,15 @@ gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
gb_Library_DLLFILENAMES := \
- $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
- $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
- $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
- $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
- $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
gb_Library_IARCSYSPRE := lib
gb_Library_IARCEXT := .a
@@ -537,7 +537,7 @@ define gb_Library_Library_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
$(call gb_LinkTarget_set_auxtargets,$(2),\
- $(patsubst %.dll,%.map,$(3)) \
+ $(patsubst %.dll,%.map,$(3)) \
)
$(call gb_Library_get_target,$(1)) \
@@ -552,9 +552,9 @@ $(call gb_WinResTarget_WinResTarget_init,$(1)/$(2))
$(call gb_WinResTarget_add_file,$(1)/$(2),solenv/inc/shlinfo)
$(call gb_WinResTarget_set_defs,$(1)/$(2),\
$$(DEFS) \
- -DADDITIONAL_VERINFO1= \
- -DADDITIONAL_VERINFO2= \
- -DADDITIONAL_VERINFO3= \
+ -DADDITIONAL_VERINFO1= \
+ -DADDITIONAL_VERINFO2= \
+ -DADDITIONAL_VERINFO3= \
)
$(call gb_Library_add_nativeres,$(1),$(2))
$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/$(2))
@@ -580,8 +580,8 @@ gb_StaticLibrary_PLAINEXT := .a
gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
gb_StaticLibrary_FILENAMES := \
- $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
- $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
@@ -607,7 +607,7 @@ define gb_CppunitTest_CppunitTest_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
$(call gb_LinkTarget_set_auxtargets,$(2),\
- $(patsubst %.dll,%.map,$(3)) \
+ $(patsubst %.dll,%.map,$(3)) \
)
endef
@@ -628,18 +628,18 @@ gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCT
ifeq ($(gb_FULLDEPS),$(true))
define gb_SrsPartTarget__command_dep
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(INCLUDE) \
- $(DEFS) \
- $(2) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_SrsPartTarget_get_dep_target,$(1)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(INCLUDE) \
+ $(DEFS) \
+ $(2) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_SrsPartTarget_get_dep_target,$(1)))
endef
else
gb_SrsPartTarget__command_dep =
@@ -652,37 +652,37 @@ gb_WinResTarget_POSTFIX :=_res.o
define gb_WinResTarget__command
$(call gb_Output_announce,$(2),$(true),RES,3)
$(call gb_Helper_abbreviate_dirs_native,\
- mkdir -p $(dir $(1)) && \
- $(gb_RC) \
- $(DEFS) $(FLAGS) \
- -I$(dir $(3)) \
- $(INCLUDE) \
- -Fo$(patsubst %_res.o,%.res,$(1)) \
+ mkdir -p $(dir $(1)) && \
+ $(gb_RC) \
+ $(DEFS) $(FLAGS) \
+ -I$(dir $(3)) \
+ $(INCLUDE) \
+ -Fo$(patsubst %_res.o,%.res,$(1)) \
$(RCFILE) )
$(call gb_Helper_abbreviate_dirs_native,\
windres $(patsubst %_res.o,%.res,$(1)) $(1))
- rm $(patsubst %_res.o,%.res,$(1))
+ rm $(patsubst %_res.o,%.res,$(1))
endef
$(eval $(call gb_Helper_make_dep_targets,\
- WinResTarget \
+ WinResTarget \
))
ifeq ($(gb_FULLDEPS),$(true))
define gb_WinResTarget__command_dep
$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(INCLUDE) \
- $(DEFS) \
- $(2) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_WinResTarget_get_dep_target,$(1)))
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(INCLUDE) \
+ $(DEFS) \
+ $(2) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(call gb_WinResTarget_get_target,$(1)) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_WinResTarget_get_dep_target,$(1)))
endef
else
gb_WinResTarget__command_dep =
diff --git a/solenv/gbuild/templates/AllLangResTarget.mk b/solenv/gbuild/templates/AllLangResTarget.mk
index ab83cddd5b5b..ff58b2b55ea6 100644
--- a/solenv/gbuild/templates/AllLangResTarget.mk
+++ b/solenv/gbuild/templates/AllLangResTarget.mk
@@ -35,7 +35,7 @@ $(eval $(call gb_SrsTarget_SrsTarget,RES/res))
# add any additional include paths here
$(eval $(call gb_SrsTarget_set_include,RES/res,\
- $$(INCLUDE) \
+ $$(INCLUDE) \
))
# add src files here (complete path relative to repository root)
diff --git a/solenv/gbuild/templates/CppunitTest.mk b/solenv/gbuild/templates/CppunitTest.mk
index 8fdc1a2ca116..48500e796382 100644
--- a/solenv/gbuild/templates/CppunitTest.mk
+++ b/solenv/gbuild/templates/CppunitTest.mk
@@ -31,7 +31,7 @@ $(eval $(call gb_CppunitTest_add_linked_libs,MODULE_NAME, \
))
$(eval $(call gb_CppunitTest_set_include,MODULE_NAME,\
- $$(INCLUDE) \
+ $$(INCLUDE) \
))
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/templates/Executable.mk b/solenv/gbuild/templates/Executable.mk
index 74294e311a69..64e9356777e3 100644
--- a/solenv/gbuild/templates/Executable.mk
+++ b/solenv/gbuild/templates/Executable.mk
@@ -24,11 +24,11 @@
$(eval $(call gb_Executable_Executable,EXEC))
$(eval $(call gb_Executable_set_include,EXEC,\
- $$(INCLUDE) \
+ $$(INCLUDE) \
))
$(eval $(call gb_Executable_set_cxxflags,EXEC,\
- $$(CXXFLAGS) \
+ $$(CXXFLAGS) \
))
$(eval $(call gb_Executable_add_linked_libs,EXEC,\
diff --git a/solenv/gbuild/templates/JunitTest.mk b/solenv/gbuild/templates/JunitTest.mk
index 537f30d5a717..b5a07cf09d76 100644
--- a/solenv/gbuild/templates/JunitTest.mk
+++ b/solenv/gbuild/templates/JunitTest.mk
@@ -24,16 +24,16 @@
$(eval $(call gb_JunitTest_JunitTest,MODULE_TYPE))
$(eval $(call gb_JunitTest_set_defs,MODULE_TYPE,\
- $$(DEFS) \
- -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/MODULE/DOCUMENTPATH \
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/MODULE/DOCUMENTPATH \
))
$(eval $(call gb_JunitTest_add_jars,MODULE_TYPE,\
- $(OUTDIR)/bin/OOoRunner.jar \
- $(OUTDIR)/bin/ridl.jar \
- $(OUTDIR)/bin/test.jar \
- $(OUTDIR)/bin/unoil.jar \
- $(OUTDIR)/bin/jurt.jar \
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
))
$(eval $(call gb_JunitTest_add_sourcefiles,MODULE_TYPE,\
diff --git a/solenv/gbuild/templates/Library.mk b/solenv/gbuild/templates/Library.mk
index 5d33fce5b47f..ac7b63e48574 100644
--- a/solenv/gbuild/templates/Library.mk
+++ b/solenv/gbuild/templates/Library.mk
@@ -40,13 +40,13 @@ $(eval $(call gb_Library_set_componentfile,LIB,MODULE/COMPONENT_FILE))
# add any additional include paths for this library here
$(eval $(call gb_Library_set_include,LIB,\
- $$(INCLUDE) \
+ $$(INCLUDE) \
))
# add any additional definitions to be set for compilation here
# (e.g. -DLIB_DLLIMPLEMENTATION)
$(eval $(call gb_Library_set_defs,LIB,\
- $$(DEFS) \
+ $$(DEFS) \
))
# add libraries to be linked to LIB; again these names need to be given as
@@ -67,7 +67,7 @@ $(eval $(call gb_SdiTarget_SdiTarget,MODULE/sdi/ROOT_SDI_FILE,MODULE/sdi/LIB))
# add any additional include paths for sdi processing here
$(eval $(call gb_SdiTarget_set_include,MODULE/sdi/ROOT_SDI_FILE,\
- $$(INCLUDE) \
+ $$(INCLUDE) \
))
# this is an example how files can be added that require special compiler settings, e.g. building without optimizing
diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx
index 7e092174c1a4..98180df820b8 100644
--- a/sot/inc/sot/factory.hxx
+++ b/sot/inc/sot/factory.hxx
@@ -27,9 +27,6 @@
#ifndef _TOOLS_GLOBNAME_HXX
#include <tools/globname.hxx>
#endif
-#ifndef _TOOLS_RTTI_HXX
-#include <tools/rtti.hxx>
-#endif
#include "sot/sotdllapi.h"
/*************************************************************************
@@ -53,7 +50,6 @@ class SOT_DLLPUBLIC SotFactory : public SvGlobalName
protected:
virtual ~SotFactory();
public:
- TYPEINFO();
static void DeInit();
static void IncSvObjectCount( SotObject * = NULL );
static void DecSvObjectCount( SotObject * = NULL );
diff --git a/sot/inc/sot/filelist.hxx b/sot/inc/sot/filelist.hxx
index d63c4f8e1dad..81ecf9fd1fe3 100644
--- a/sot/inc/sot/filelist.hxx
+++ b/sot/inc/sot/filelist.hxx
@@ -45,7 +45,6 @@ protected:
public:
- TYPEINFO();
FileList();
~FileList();
diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx
index 11573079e4e6..5a130136abda 100644
--- a/sot/inc/sot/stg.hxx
+++ b/sot/inc/sot/stg.hxx
@@ -40,7 +40,6 @@
#endif
-#include <tools/rtti.hxx>
#ifndef _TOOLS_STREAM_HXX //autogen
#include <tools/stream.hxx>
#endif
@@ -75,7 +74,6 @@ protected:
StorageBase();
virtual ~StorageBase();
public:
- TYPEINFO();
virtual const SvStream* GetSvStream() const = 0;
virtual sal_Bool Validate( sal_Bool=sal_False ) const = 0;
virtual sal_Bool ValidateMode( StreamMode ) const = 0;
@@ -91,7 +89,6 @@ public:
class BaseStorageStream : public StorageBase
{
public:
- TYPEINFO();
virtual sal_uLong Read( void * pData, sal_uLong nSize ) = 0;
virtual sal_uLong Write( const void* pData, sal_uLong nSize ) = 0;
virtual sal_uLong Seek( sal_uLong nPos ) = 0;
@@ -108,7 +105,6 @@ class SvStorageInfoList;
class BaseStorage : public StorageBase
{
public:
- TYPEINFO();
virtual const String& GetName() const = 0;
virtual sal_Bool IsRoot() const = 0;
virtual void SetClassId( const ClsId& ) = 0;
@@ -172,7 +168,6 @@ class StorageStream : public BaseStorageStream, public OLEStorageBase
protected:
~StorageStream();
public:
- TYPEINFO();
StorageStream( StgIo*, StgDirEntry*, StreamMode );
virtual sal_uLong Read( void * pData, sal_uLong nSize );
virtual sal_uLong Write( const void* pData, sal_uLong nSize );
@@ -201,7 +196,6 @@ class SOT_DLLPUBLIC Storage : public BaseStorage, public OLEStorageBase
protected:
~Storage();
public:
- TYPEINFO();
Storage( const String &, StreamMode = STREAM_STD_READWRITE, sal_Bool bDirect = sal_True );
Storage( SvStream& rStrm, sal_Bool bDirect = sal_True );
Storage( UCBStorageStream& rStrm, sal_Bool bDirect = sal_True );
@@ -265,7 +259,6 @@ friend class UCBStorage;
protected:
~UCBStorageStream();
public:
- TYPEINFO();
UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey=0 );
UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress );
UCBStorageStream( UCBStorageStream_Impl* );
@@ -328,7 +321,6 @@ public:
UCBStorage( UCBStorage_Impl* );
UCBStorage( SvStream& rStrm, sal_Bool bDirect = sal_True );
- TYPEINFO();
virtual const String& GetName() const;
virtual sal_Bool IsRoot() const;
virtual void SetClassId( const ClsId& );
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index d810f1b5069c..845a2de003d3 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -35,6 +35,7 @@
#include <sot/clsids.hxx>
#include <rtl/instance.hxx>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
+#include <string.h>
/************** class SotData_Impl *********************************************/
/*************************************************************************
@@ -141,7 +142,6 @@ void SotFactory::DeInit()
|*
|* Beschreibung
*************************************************************************/
-TYPEINIT0(SotFactory);
SotFactory::SotFactory( const SvGlobalName & rName,
const String & rClassName,
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index 3f733fc79b26..51a9d573f921 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -27,13 +27,10 @@
#include<tools/list.hxx>
#include<tools/stream.hxx>
#include<tools/string.hxx>
-#include<tools/rtti.hxx>
#include<sot/exchange.hxx>
#include<sot/filelist.hxx>
#include <osl/thread.h>
-TYPEINIT1_AUTOFACTORY( FileList, SvDataCopyStream );
-
// String-Liste zum Speichern der Namen deklarieren
DECLARE_LIST( FileStringList, String* )
diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx
index 471833713211..a33df6ed48b8 100644
--- a/sot/source/base/object.cxx
+++ b/sot/source/base/object.cxx
@@ -35,15 +35,12 @@
class SotObjectFactory : public SotFactory
{
public:
- TYPEINFO();
SotObjectFactory( const SvGlobalName & rName,
const String & rClassName,
CreateInstanceType pCreateFuncP )
: SotFactory( rName, rClassName, pCreateFuncP )
{}
};
-TYPEINIT1(SotObjectFactory,SotFactory);
-
SO2_IMPL_BASIC_CLASS_DLL(SotObject,SotObjectFactory,
SvGlobalName( 0xf44b7830, 0xf83c, 0x11d0,
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 0af49093a479..d17de661910d 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -57,10 +57,6 @@ static long nTmpCount = 0;
///////////////////////// class StorageBase //////////////////////////////
-TYPEINIT0( StorageBase );
-TYPEINIT1( BaseStorageStream, StorageBase );
-TYPEINIT1( BaseStorage, StorageBase );
-
StorageBase::StorageBase()
: m_bAutoCommit( sal_False )
{
@@ -175,8 +171,6 @@ sal_Bool OLEStorageBase::ValidateMode_Impl( StreamMode m, StgDirEntry* p ) const
//////////////////////// class StorageStream /////////////////////////////
-TYPEINIT1( StorageStream, BaseStorageStream );
-
StorageStream::StorageStream( StgIo* p, StgDirEntry* q, StreamMode m )
: OLEStorageBase( p, q, m_nMode ), nPos( 0L )
{
@@ -205,7 +199,7 @@ StorageStream::~StorageStream()
sal_Bool StorageStream::Equals( const BaseStorageStream& rStream ) const
{
- const StorageStream* pOther = PTR_CAST( StorageStream, &rStream );
+ const StorageStream* pOther = dynamic_cast< const StorageStream* >( &rStream );
return pOther && ( pOther->pEntry == pEntry );
}
@@ -376,8 +370,6 @@ sal_Bool Storage::IsStorageFile( SvStream* pStream )
// Open the storage file. If writing is permitted and the file is not
// a storage file, initialize it.
-TYPEINIT1( Storage, BaseStorage );
-
Storage::Storage( const String& rFile, StreamMode m, sal_Bool bDirect )
: OLEStorageBase( new StgIo, NULL, m_nMode ), aName( rFile ), bIsRoot( sal_False )
{
@@ -863,7 +855,7 @@ sal_Bool Storage::MoveTo( const String& rElem, BaseStorage* pODest, const String
{
// Simplest case: both storages share the same file
sal_Bool bRes;
- Storage *pOther = PTR_CAST( Storage, pODest );
+ Storage *pOther = dynamic_cast< Storage* >( pODest );
if( pOther && pIo == pOther->pIo && rElem == rNew )
{
Storage *p = (Storage*) pODest;
@@ -1115,7 +1107,7 @@ sal_Bool Storage::ValidateMode( StreamMode nMode, StgDirEntry* p ) const
sal_Bool Storage::Equals( const BaseStorage& rStorage ) const
{
- const Storage* pOther = PTR_CAST( Storage, &rStorage );
+ const Storage* pOther = dynamic_cast< const Storage* >( &rStorage );
return pOther && ( pOther->pEntry == pEntry );
}
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 2e296770aecf..6705e4a1ca49 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -55,15 +55,12 @@ using namespace ::com::sun::star;
class SotStorageStreamFactory : public SotFactory
{
public:
- TYPEINFO();
SotStorageStreamFactory( const SvGlobalName & rName,
const String & rClassName,
CreateInstanceType pCreateFuncP )
: SotFactory( rName, rClassName, pCreateFuncP )
{}
};
-TYPEINIT1(SotStorageStreamFactory,SotFactory);
-
SO2_IMPL_BASIC_CLASS1_DLL(SotStorageStream,SotStorageStreamFactory,SotObject,
SvGlobalName( 0xd7deb420, 0xf902, 0x11d0,
@@ -381,7 +378,7 @@ sal_Bool SotStorageStream::Revert()
sal_Bool SotStorageStream::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
{
- UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm );
+ UCBStorageStream* pStg = dynamic_cast< UCBStorageStream* >( pOwnStm );
if ( pStg )
{
return pStg->SetProperty( rName, rValue );
@@ -395,7 +392,7 @@ sal_Bool SotStorageStream::SetProperty( const String& rName, const ::com::sun::s
sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
{
- UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm );
+ UCBStorageStream* pStg = dynamic_cast< UCBStorageStream* >( pOwnStm );
if ( pStg )
{
return pStg->GetProperty( rName, rValue );
@@ -409,7 +406,7 @@ sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::u
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SotStorageStream::GetXInputStream() const
{
- UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pOwnStm );
+ UCBStorageStream* pStg = dynamic_cast< UCBStorageStream* >( pOwnStm );
if ( pStg )
{
return pStg->GetXInputStream();
@@ -428,15 +425,12 @@ sal_Bool SotStorageStream::GetProperty( const String& rName, ::com::sun::star::u
class SotStorageFactory : public SotFactory
{
public:
- TYPEINFO();
SotStorageFactory( const SvGlobalName & rName,
const String & rClassName,
CreateInstanceType pCreateFuncP )
: SotFactory( rName, rClassName, pCreateFuncP )
{}
};
-TYPEINIT1(SotStorageFactory,SotFactory);
-
SO2_IMPL_BASIC_CLASS1_DLL(SotStorage,SotStorageFactory,SotObject,
SvGlobalName( 0x980ce7e0, 0xf905, 0x11d0,
@@ -731,7 +725,7 @@ SotStorage::~SotStorage()
*************************************************************************/
void SotStorage::RemoveUNOStorageHolder( UNOStorageHolder* pHolder )
{
- UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
+ UCBStorage* pStg = dynamic_cast< UCBStorage* >( m_pOwnStg );
if ( pStg )
{
pStg->GetUNOStorageHolderList()->remove( pHolder );
@@ -756,7 +750,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String&
uno::Reference< embed::XStorage > xResult;
- UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
+ UCBStorage* pStg = dynamic_cast< UCBStorage* >( m_pOwnStg );
if ( !pStg )
return xResult;
@@ -791,7 +785,7 @@ uno::Reference< embed::XStorage > SotStorage::GetUNOAPIDuplicate( const String&
{
if ( !bStorageReady )
{
- UCBStorage* pChildUCBStg = PTR_CAST( UCBStorage, pChildStorage->m_pOwnStg );
+ UCBStorage* pChildUCBStg = dynamic_cast< UCBStorage* >( pChildStorage->m_pOwnStg );
if ( pChildUCBStg )
{
UCBStorage* pTempStorage = new UCBStorage( pTempFile->GetURL(), STREAM_WRITE, sal_False, sal_True );
@@ -1385,7 +1379,7 @@ sal_Bool SotStorage::Validate()
sal_Bool SotStorage::SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue )
{
- UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
+ UCBStorage* pStg = dynamic_cast< UCBStorage* >( m_pOwnStg );
if ( pStg )
{
return pStg->SetProperty( rName, rValue );
@@ -1399,7 +1393,7 @@ sal_Bool SotStorage::SetProperty( const String& rName, const ::com::sun::star::u
sal_Bool SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue )
{
- UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
+ UCBStorage* pStg = dynamic_cast< UCBStorage* >( m_pOwnStg );
if ( pStg )
{
return pStg->GetProperty( rName, rValue );
@@ -1422,7 +1416,7 @@ sal_Bool SotStorage::GetProperty( const String& rName, ::com::sun::star::uno::An
sal_Bool SotStorage::GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue )
{
- UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
+ UCBStorage* pStg = dynamic_cast< UCBStorage* >( m_pOwnStg );
if ( pStg )
{
return pStg->GetProperty( rEleName, rName, rValue );
@@ -1436,7 +1430,7 @@ sal_Bool SotStorage::GetProperty( const String& rEleName, const String& rName, :
sal_Bool SotStorage::IsOLEStorage() const
{
- UCBStorage* pStg = PTR_CAST( UCBStorage, m_pOwnStg );
+ UCBStorage* pStg = dynamic_cast< UCBStorage* >( m_pOwnStg );
return !pStg;
}
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index d52e757d5f5e..6130b4cfbd1c 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -68,6 +68,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include "sot/clsids.hxx"
+#include <memory.h>
#include "unostorageholder.hxx"
@@ -319,9 +320,6 @@ void FileStreamWrapper_Impl::checkError()
throw NotConnectedException(::rtl::OUString(), const_cast<XWeak*>(static_cast<const XWeak*>(this)));
}
-TYPEINIT1( UCBStorageStream, BaseStorageStream );
-TYPEINIT1( UCBStorage, BaseStorage );
-
#define COMMIT_RESULT_FAILURE 0
#define COMMIT_RESULT_NOTHING_TO_DO 1
#define COMMIT_RESULT_SUCCESS 2
@@ -1549,7 +1547,7 @@ sal_Bool UCBStorageStream::CopyTo( BaseStorageStream* pDestStm )
if( !pImp->Init() )
return sal_False;
- UCBStorageStream* pStg = PTR_CAST( UCBStorageStream, pDestStm );
+ UCBStorageStream* pStg = dynamic_cast< UCBStorageStream* >( pDestStm );
if ( pStg )
pStg->pImp->m_aContentType = pImp->m_aContentType;
@@ -2789,8 +2787,8 @@ sal_Bool UCBStorage::CopyStorageElement_Impl( UCBStorageElement_Impl& rElement,
bDeleteStorage = sal_True;
}
- UCBStorage* pUCBDest = PTR_CAST( UCBStorage, pDest );
- UCBStorage* pUCBCopy = PTR_CAST( UCBStorage, pStorage );
+ UCBStorage* pUCBDest = dynamic_cast< UCBStorage* >( pDest );
+ UCBStorage* pUCBCopy = dynamic_cast< UCBStorage* >( pStorage );
sal_Bool bOpenUCBStorage = pUCBDest && pUCBCopy;
BaseStorage* pOtherStorage = bOpenUCBStorage ?
@@ -2845,7 +2843,7 @@ sal_Bool UCBStorage::CopyTo( BaseStorage* pDestStg ) const
// For UCB storages, the class id and the format id may differ,
// do passing the class id is not sufficient.
- if( pDestStg->ISA( UCBStorage ) )
+ if( dynamic_cast< UCBStorage* >(pDestStg) )
pDestStg->SetClass( pImp->m_aClassId, pImp->m_nFormat,
pImp->m_aUserTypeName );
else
@@ -3046,7 +3044,7 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
if ( !pElement->m_xStream.Is() )
{
BaseStorageStream* pStr = OpenStream( rEleName, nMode, bDirect );
- UCBStorageStream* pStream = PTR_CAST( UCBStorageStream, pStr );
+ UCBStorageStream* pStream = dynamic_cast< UCBStorageStream* >( pStr );
if ( !pStream )
{
SetError( ( nMode & STREAM_WRITE ) ? SVSTREAM_CANNOT_MAKE : SVSTREAM_FILE_NOT_FOUND );
@@ -3238,7 +3236,7 @@ sal_Bool UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const
else
{
/*
- if ( PTR_CAST( UCBStorage, pNewSt ) )
+ if ( dynamic_cast< UCBStorage* >( pNewSt ) )
{
// because the element is moved, not copied, a special optimization is possible :
// first copy the UCBStorageElement; flag old element as "Removed" and new as "Inserted",
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 835a9922da7a..fafcc369d25c 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -163,7 +163,6 @@ class SmDocShell : public SfxObjectShell, public SfxListener
virtual sal_Bool ConvertFrom(SfxMedium &rMedium);
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START+1)
using SotObject::GetInterface;
SFX_DECL_OBJECTFACTORY();
diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx
index 9f7c2d426a96..abe8e73fa23b 100644
--- a/starmath/inc/smmod.hxx
+++ b/starmath/inc/smmod.hxx
@@ -133,7 +133,6 @@ class SmModule : public SfxModule, utl::ConfigurationListener
void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START + 0)
SmModule(SfxObjectFactory* pObjFact);
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 9e6c9e42fc8c..85f360a1f7ce 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -260,8 +260,6 @@ protected:
virtual void SetZoomFactor( const Fraction &rX, const Fraction &rY );
public:
- TYPEINFO();
-
SmViewShell(SfxViewFrame *pFrame, SfxViewShell *pOldSh);
~SmViewShell();
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index bfd87686093c..679dcba71eee 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -113,8 +113,6 @@ static const char __FAR_DATA pStarMathDoc[] = "StarMathDocument";
////////////////////////////////////////////////////////////
-TYPEINIT1( SmDocShell, SfxObjectShell );
-
SFX_IMPL_INTERFACE(SmDocShell, SfxObjectShell, SmResId(0))
{
SFX_POPUPMENU_REGISTRATION(SmResId(RID_VIEWMENU));
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 5bca547813af..215e7d8b73c2 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -408,12 +408,14 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt)
if (rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE)
{
sal_Bool bCallBase = sal_True;
- SfxViewShell* pViewShell = GetView();
- if ( pViewShell && pViewShell->ISA(SmViewShell) )
+ SmViewShell* pViewShell = dynamic_cast< SmViewShell* >(GetView());
+
+ if ( pViewShell )
{
// Terminate possible InPlace mode
bCallBase = !pViewShell->Escape();
}
+
if ( bCallBase )
Window::KeyInput( rKEvt );
}
@@ -441,9 +443,9 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt)
{
//SFX hat evtl. Slot an der View gecallt und dabei (wg. Hack
//im SFX) den Focus auf die View gesetzt
- SfxViewShell* pVShell = GetView();
- if ( pVShell && pVShell->ISA(SmViewShell) &&
- ((SmViewShell*)pVShell)->GetGraphicWindow().HasFocus() )
+ SmViewShell* pVShell = dynamic_cast< SmViewShell* >(GetView());
+
+ if ( pVShell && pVShell->GetGraphicWindow().HasFocus() )
{
GrabFocus();
}
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index b094bce34e32..4b50fd66dfed 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -177,7 +177,7 @@ SmFilterDetect::~SmFilterDetect()
SfxApplication* pApp = SFX_APP();
SfxAllItemSet *pSet = new SfxAllItemSet( pApp->GetPool() );
TransformParameters( SID_OPENDOC, lDescriptor, *pSet );
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY );
bWasReadOnly = pItem && pItem->GetValue();
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index aa89d98f43e8..46de3970c7c8 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -41,7 +41,6 @@
#include <vcl/msgbox.hxx>
#include <vcl/virdev.hxx>
#include <unotools/syslocale.hxx>
-#include <tools/rtti.hxx>
#include "smmod.hxx"
#include "symbol.hxx"
#include "config.hxx"
@@ -52,8 +51,6 @@
#include "view.hxx"
#include "starmath.hrc"
-TYPEINIT1( SmModule, SfxModule );
-
#define SmModule
#include "smslots.hxx"
@@ -268,13 +265,14 @@ void SmModule::_CreateVirtualDev() const
void SmModule::ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg )
{
//invalidate all graphic and edit windows
- const TypeId aSmViewTypeId = TYPE(SmViewShell);
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+
while (pViewShell)
{
- if ((pViewShell->IsA(aSmViewTypeId)))
+ SmViewShell *pSmView = dynamic_cast< SmViewShell* >(pViewShell);
+
+ if(pSmView)
{
- SmViewShell *pSmView = (SmViewShell *) pViewShell;
pSmView->GetGraphicWindow().ApplyColorConfigValues( rColorCfg );
SmEditWindow *pEditWin = pSmView->GetEditWindow();
if (pEditWin)
diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx
index dd5fd81e5f5a..44fc2893ad91 100644
--- a/starmath/source/toolbox.cxx
+++ b/starmath/source/toolbox.cxx
@@ -180,7 +180,7 @@ SmToolBoxWindow::~SmToolBoxWindow()
SmViewShell * SmToolBoxWindow::GetView()
{
SfxViewShell *pView = GetBindings().GetDispatcher()->GetFrame()->GetViewShell();
- return PTR_CAST(SmViewShell, pView);
+ return dynamic_cast< SmViewShell* >( pView);
}
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index bff18549e61f..da2060a1e828 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -1097,11 +1097,10 @@ void SAL_CALL SmModel::render(
{
//!! when called via API we may not have an active view
//!! thus we go and look for a view that can be used.
- const TypeId aTypeId = TYPE( SmViewShell );
- SfxViewShell* pViewSh = SfxViewShell::GetFirst( &aTypeId, sal_False /* search non-visible views as well*/ );
+ SfxViewShell* pViewSh = SfxViewShell::GetFirst( _IsSfxViewShell< SmViewShell >, sal_False /* search non-visible views as well*/ );
while (pViewSh && pViewSh->GetObjectShell() != pDocSh)
- pViewSh = SfxViewShell::GetNext( *pViewSh, &aTypeId, sal_False /* search non-visible views as well*/ );
- SmViewShell *pView = PTR_CAST( SmViewShell, pViewSh );
+ pViewSh = SfxViewShell::GetNext( *pViewSh, _IsSfxViewShell< SmViewShell >, sal_False /* search non-visible views as well*/ );
+ SmViewShell *pView = dynamic_cast< SmViewShell* >( pViewSh );
DBG_ASSERT( pView, "SmModel::render : no SmViewShell found" );
if (pView)
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 04363dec423a..d173ee0343bd 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -50,7 +50,7 @@
SmViewShell * SmGetActiveView()
{
SfxViewShell *pView = SfxViewShell::Current();
- return PTR_CAST(SmViewShell, pView);
+ return dynamic_cast< SmViewShell* >( pView);
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 031cdc38d5c0..8caf0db57fd7 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -488,7 +488,7 @@ SmEditController::~SmEditController()
void SmEditController::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState)
{
- const SfxStringItem *pItem = PTR_CAST(SfxStringItem, pState);
+ const SfxStringItem *pItem = dynamic_cast< const SfxStringItem* >( pState);
if ((pItem != NULL) && (rEdit.GetText() != pItem->GetValue()))
rEdit.SetText(pItem->GetValue());
@@ -522,7 +522,7 @@ SmCmdBoxWindow::~SmCmdBoxWindow ()
SmViewShell * SmCmdBoxWindow::GetView()
{
SfxViewShell *pView = GetBindings().GetDispatcher()->GetFrame()->GetViewShell();
- return PTR_CAST(SmViewShell, pView);
+ return dynamic_cast< SmViewShell* >( pView);
}
void SmCmdBoxWindow::Resize()
@@ -774,8 +774,6 @@ struct SmViewShell_Impl
}
};
-TYPEINIT1( SmViewShell, SfxViewShell );
-
SFX_IMPL_INTERFACE(SmViewShell, SfxViewShell, SmResId(0))
{
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD |
@@ -1919,9 +1917,11 @@ IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
void SmViewShell::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ switch( pSfxSimpleHint->GetId() )
{
case SFX_HINT_MODECHANGED:
case SFX_HINT_DOCCHANGED:
diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx
index c5d67d0d76e2..37bb03836846 100644
--- a/svl/inc/svl/aeitem.hxx
+++ b/svl/inc/svl/aeitem.hxx
@@ -39,7 +39,7 @@ protected:
sal_uInt16 _GetPosByValue( sal_uInt16 nValue ) const;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxAllEnumItem();
SfxAllEnumItem( sal_uInt16 nWhich);
SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal );
diff --git a/svl/inc/svl/brdcst.hxx b/svl/inc/svl/brdcst.hxx
index cabf0ae649b1..86396c5dfa34 100644
--- a/svl/inc/svl/brdcst.hxx
+++ b/svl/inc/svl/brdcst.hxx
@@ -24,7 +24,6 @@
#define _SFXBRDCST_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
#include <svl/svarray.hxx>
class SfxListener;
@@ -52,8 +51,6 @@ protected:
virtual void ListenersGone();
public:
- TYPEINFO();
-
SfxBroadcaster();
SfxBroadcaster( const SfxBroadcaster &rBC );
virtual ~SfxBroadcaster();
diff --git a/svl/inc/svl/broadcast.hxx b/svl/inc/svl/broadcast.hxx
index 85f0cf732ed0..d91d04e53131 100644
--- a/svl/inc/svl/broadcast.hxx
+++ b/svl/inc/svl/broadcast.hxx
@@ -24,7 +24,6 @@
#define _SVT_BROADCAST_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
class SvtListener;
class SfxHint;
@@ -47,8 +46,6 @@ protected:
virtual void ListenersGone();
public:
- TYPEINFO();
-
SvtBroadcaster();
SvtBroadcaster( const SvtBroadcaster &rBC );
virtual ~SvtBroadcaster();
diff --git a/svl/inc/svl/cenumitm.hxx b/svl/inc/svl/cenumitm.hxx
index ba6b35b4ec1f..1d35bb70f362 100644
--- a/svl/inc/svl/cenumitm.hxx
+++ b/svl/inc/svl/cenumitm.hxx
@@ -40,8 +40,6 @@ protected:
SfxPoolItem(rItem) {}
public:
- TYPEINFO();
-
virtual int operator ==(const SfxPoolItem & rItem) const;
virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
@@ -102,8 +100,6 @@ protected:
SfxEnumItemInterface(rItem), m_nValue(rItem.m_nValue) {}
public:
- TYPEINFO();
-
virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
virtual sal_uInt16 GetEnumValue() const;
@@ -129,8 +125,6 @@ class SVL_DLLPUBLIC CntBoolItem: public SfxPoolItem
sal_Bool m_bValue;
public:
- TYPEINFO();
-
CntBoolItem(sal_uInt16 which = 0, sal_Bool bTheValue = sal_False):
SfxPoolItem(which), m_bValue(bTheValue) {}
diff --git a/svl/inc/svl/cintitem.hxx b/svl/inc/svl/cintitem.hxx
index e2f8163cffaf..22575f8304ec 100644
--- a/svl/inc/svl/cintitem.hxx
+++ b/svl/inc/svl/cintitem.hxx
@@ -36,8 +36,6 @@ class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem
sal_uInt8 m_nValue;
public:
- TYPEINFO();
-
CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntByteItem, 0); }
@@ -97,8 +95,6 @@ class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
sal_uInt16 m_nValue;
public:
- TYPEINFO();
-
CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(CntUInt16Item, 0); }
@@ -159,8 +155,6 @@ class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
sal_Int32 m_nValue;
public:
- TYPEINFO();
-
CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(CntInt32Item, 0); }
@@ -221,8 +215,6 @@ class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
sal_uInt32 m_nValue;
public:
- TYPEINFO();
-
CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(CntUInt32Item, 0); }
diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx
index b7055ff84f9e..01bee186b9be 100644
--- a/svl/inc/svl/cntwall.hxx
+++ b/svl/inc/svl/cntwall.hxx
@@ -28,7 +28,6 @@
#ifndef SHL_HXX
#include <tools/shl.hxx>
#endif
-#include <tools/rtti.hxx>
#include <tools/color.hxx>
#include <svl/poolitem.hxx>
@@ -42,8 +41,6 @@ private:
sal_uInt16 _nStyle;
public:
- TYPEINFO();
-
CntWallpaperItem( sal_uInt16 nWhich );
CntWallpaperItem( sal_uInt16 nWhich, SvStream& rStream, sal_uInt16 nVersion );
CntWallpaperItem( const CntWallpaperItem& rCpy );
diff --git a/svl/inc/svl/ctypeitm.hxx b/svl/inc/svl/ctypeitm.hxx
index 22d9774f2d72..45059f4d69de 100644
--- a/svl/inc/svl/ctypeitm.hxx
+++ b/svl/inc/svl/ctypeitm.hxx
@@ -35,8 +35,6 @@ private:
XubString _aPresentation;
public:
- TYPEINFO();
-
CntContentTypeItem();
CntContentTypeItem( sal_uInt16 nWhich, const XubString& rType );
CntContentTypeItem( sal_uInt16 nWhich, const INetContentType eType );
diff --git a/svl/inc/svl/custritm.hxx b/svl/inc/svl/custritm.hxx
index 268dba8de6e5..7f289d1be004 100644
--- a/svl/inc/svl/custritm.hxx
+++ b/svl/inc/svl/custritm.hxx
@@ -36,8 +36,6 @@ class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem
XubString m_aValue;
public:
- TYPEINFO();
-
CntUnencodedStringItem(sal_uInt16 which = 0): SfxPoolItem(which)
{ DBG_CTOR(CntUnencodedStringItem, 0); }
diff --git a/svl/inc/svl/dateitem.hxx b/svl/inc/svl/dateitem.hxx
index 5f98ff02971e..cb42c917d2d4 100644
--- a/svl/inc/svl/dateitem.hxx
+++ b/svl/inc/svl/dateitem.hxx
@@ -23,9 +23,7 @@
#ifndef _DATETIMEITEM_HXX
#define _DATETIMEITEM_HXX
-#include <tools/rtti.hxx>
#include <tools/datetime.hxx>
-
#include <svl/poolitem.hxx>
class SvStream;
@@ -40,8 +38,6 @@ private:
DateTime aDateTime;
public:
- TYPEINFO();
-
SfxDateTimeItem( sal_uInt16 nWhich );
SfxDateTimeItem( sal_uInt16 nWhich,
const DateTime& rDT );
@@ -79,8 +75,6 @@ public:
class SfxColumnDateTimeItem : public SfxDateTimeItem
{
public:
- TYPEINFO();
-
SfxColumnDateTimeItem( sal_uInt16 nWhich );
SfxColumnDateTimeItem( sal_uInt16 nWhich,
const DateTime& rDT );
diff --git a/svl/inc/svl/eitem.hxx b/svl/inc/svl/eitem.hxx
index d66b04564c8d..26e6e45ff1b4 100644
--- a/svl/inc/svl/eitem.hxx
+++ b/svl/inc/svl/eitem.hxx
@@ -38,16 +38,13 @@ protected:
CntEnumItem(which, rStream) {}
public:
- TYPEINFO();
-
};
//============================================================================
class SVL_DLLPUBLIC SfxBoolItem: public CntBoolItem
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxBoolItem(sal_uInt16 which = 0, sal_Bool bValue = sal_False):
CntBoolItem(which, bValue) {}
diff --git a/svl/inc/svl/filerec.hxx b/svl/inc/svl/filerec.hxx
index d888accbfbe3..6dc68e349616 100644
--- a/svl/inc/svl/filerec.hxx
+++ b/svl/inc/svl/filerec.hxx
@@ -35,7 +35,7 @@ SV_DECL_VARARR( SfxUINT32s, sal_uInt32, 8, 8 )
//------------------------------------------------------------------------
-#define SFX_BOOL_DONTCARE sal_Bool(2) // Don't-Care-Wert f"ur BOOLs
+#define SFX_BOOL_DONTCARE int(2) // Don't-Care-Wert
#define SFX_REC_PRETAG_EXT sal_uInt8(0x00) // Pre-Tag f"ur Extended-Records
#define SFX_REC_PRETAG_EOR sal_uInt8(0xFF) // Pre-Tag f"ur End-Of-Records
@@ -219,8 +219,8 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter
protected:
SvStream* _pStream; // <SvStream>, in dem der Record liegt
sal_uInt32 _nStartPos; // Start-Position des Gesamt-Records im Stream
- FASTBOOL _bHeaderOk; /* sal_True, wenn der Header schon geschrieben ist;
- bei DBG_UTIL wird SFX_BOOL_DONTCARE ver-
+ int _bHeaderOk; /* sal_True, wenn der Header schon geschrieben ist;
+ bei DBG_UTIL wird SFX_BOOL_DONTCARE (==2) ver-
wendet, um die Gr"o\se von Fix-Sized-Records
zu pr"ufen. */
sal_uInt8 _nPreTag; // in den Header zu schreibendes 'Pre-Tag'
@@ -237,7 +237,7 @@ public:
inline void Reset();
- sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True );
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
private:
// not implementend, not allowed
@@ -277,7 +277,7 @@ class SVL_DLLPUBLIC SfxMiniRecordReader
protected:
SvStream* _pStream; // <SvStream>, aus dem gelesen wird
sal_uInt32 _nEofRec; // Position direkt hinter dem Record
- FASTBOOL _bSkipped; // sal_True: der Record wurde explizit geskippt
+ bool _bSkipped; // sal_True: der Record wurde explizit geskippt
sal_uInt8 _nPreTag; // aus dem Header gelesenes Pre-Tag
// Drei-Phasen-Ctor f"ur Subklassen
@@ -285,10 +285,10 @@ protected:
void Construct_Impl( SvStream *pStream, sal_uInt8 nTag )
{
_pStream = pStream;
- _bSkipped = sal_False;
+ _bSkipped = false;
_nPreTag = nTag;
}
- inline FASTBOOL SetHeader_Impl( sal_uInt32 nHeader );
+ inline bool SetHeader_Impl( sal_uInt32 nHeader );
// als ung"ultig markieren und zur"uck-seeken
void SetInvalid_Impl( sal_uInt32 nRecordStartPos )
@@ -305,7 +305,7 @@ public:
inline ~SfxMiniRecordReader();
inline sal_uInt8 GetTag() const;
- inline FASTBOOL IsValid() const;
+ inline bool IsValid() const;
inline SvStream& operator*() const;
@@ -370,7 +370,7 @@ public:
inline void Reset();
- sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True );
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
};
//------------------------------------------------------------------------
@@ -416,8 +416,8 @@ protected:
SfxMiniRecordReader::Construct_Impl(
pStream, SFX_REC_PRETAG_EXT );
}
- FASTBOOL FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag );
- FASTBOOL ReadHeader_Impl( sal_uInt16 nTypes );
+ bool FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag );
+ bool ReadHeader_Impl( sal_uInt16 nTypes );
public:
SfxSingleRecordReader( SvStream *pStream );
@@ -426,7 +426,7 @@ public:
inline sal_uInt16 GetTag() const;
inline sal_uInt8 GetVersion() const;
- inline FASTBOOL HasVersion( sal_uInt16 nVersion ) const;
+ inline bool HasVersion( sal_uInt16 nVersion ) const;
};
//------------------------------------------------------------------------
@@ -501,7 +501,7 @@ public:
inline void Reset();
- sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True );
+ sal_uInt32 Close( bool bSeekToEndOfRec = true );
};
//------------------------------------------------------------------------
@@ -572,7 +572,7 @@ public:
void NewContent();
- virtual sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True );
+ virtual sal_uInt32 Close( bool bSeekToEndOfRec = true );
};
//------------------------------------------------------------------------
@@ -672,17 +672,17 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader
sal_uInt16 _nContentTag; // Art-Kennung des aktuellen Contents
sal_uInt8 _nContentVer; // Versions-Kennung des akt. Contents
- FASTBOOL ReadHeader_Impl();
+ bool ReadHeader_Impl();
public:
SfxMultiRecordReader( SvStream *pStream );
SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag );
~SfxMultiRecordReader();
- FASTBOOL GetContent();
+ bool GetContent();
inline sal_uInt16 GetContentTag();
inline sal_uInt8 GetContentVersion() const;
- inline FASTBOOL HasContentVersion( sal_uInt16 nVersion ) const;
+ inline bool HasContentVersion( sal_uInt16 nVersion ) const;
inline sal_uInt32 ContentCount() const;
};
@@ -704,7 +704,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter
: _pStream( pStream ),
_nStartPos( pStream->Tell() ),
- _bHeaderOk(sal_False),
+ _bHeaderOk(false),
_nPreTag( nTag )
{
DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" );
@@ -777,7 +777,7 @@ inline SvStream& SfxMiniRecordWriter::operator*() const
inline void SfxMiniRecordWriter::Reset()
{
_pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI );
- _bHeaderOk = sal_False;
+ _bHeaderOk = false;
}
//=========================================================================
@@ -809,7 +809,7 @@ inline void SfxMiniRecordReader::Skip()
{
_pStream->Seek(_nEofRec);
- _bSkipped = sal_True;
+ _bSkipped = true;
}
//-------------------------------------------------------------------------
@@ -831,7 +831,7 @@ inline sal_uInt8 SfxMiniRecordReader::GetTag() const
//-------------------------------------------------------------------------
-inline FASTBOOL SfxMiniRecordReader::IsValid() const
+inline bool SfxMiniRecordReader::IsValid() const
/* [Beschreibung]
@@ -861,9 +861,9 @@ inline SvStream& SfxMiniRecordReader::operator*() const
//=========================================================================
-inline sal_uInt32 SfxSingleRecordWriter::Close( FASTBOOL bSeekToEndOfRec )
+inline sal_uInt32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec )
-// siehe <SfxMiniRecordWriter::Close(FASTBOOL)>
+// siehe <SfxMiniRecordWriter::Close(bool)>
{
sal_uInt32 nRet = 0;
@@ -896,7 +896,7 @@ inline void SfxSingleRecordWriter::Reset()
{
_pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
SFX_REC_HEADERSIZE_SINGLE );
- _bHeaderOk = sal_False;
+ _bHeaderOk = false;
}
//=========================================================================
@@ -927,7 +927,7 @@ inline sal_uInt8 SfxSingleRecordReader::GetVersion() const
//-------------------------------------------------------------------------
-inline FASTBOOL SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const
+inline bool SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const
/* [Beschreibung]
@@ -1017,7 +1017,7 @@ inline void SfxMultiFixRecordWriter::Reset()
_pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
SFX_REC_HEADERSIZE_SINGLE +
SFX_REC_HEADERSIZE_MULTI );
- _bHeaderOk = sal_False;
+ _bHeaderOk = false;
}
//=========================================================================
@@ -1050,7 +1050,7 @@ inline sal_uInt8 SfxMultiRecordReader::GetContentVersion() const
//-------------------------------------------------------------------------
-inline FASTBOOL SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const
+inline bool SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const
/* [Beschreibung]
diff --git a/svl/inc/svl/flagitem.hxx b/svl/inc/svl/flagitem.hxx
index 00bc4458fe9a..588e16710d9f 100644
--- a/svl/inc/svl/flagitem.hxx
+++ b/svl/inc/svl/flagitem.hxx
@@ -25,7 +25,6 @@
#include "svl/svldllapi.h"
#include <tools/solar.h>
-#include <tools/rtti.hxx>
#include <svl/poolitem.hxx>
class SvStream;
@@ -41,8 +40,6 @@ class SVL_DLLPUBLIC SfxFlagItem: public SfxPoolItem
sal_uInt16 nVal;
public:
- TYPEINFO();
-
SfxFlagItem( sal_uInt16 nWhich = 0, sal_uInt16 nValue = 0 );
SfxFlagItem( sal_uInt16 nWhich, SvStream & );
SfxFlagItem( const SfxFlagItem& );
diff --git a/svl/inc/svl/globalnameitem.hxx b/svl/inc/svl/globalnameitem.hxx
index b027fe50c23d..ce9c347bbc43 100644
--- a/svl/inc/svl/globalnameitem.hxx
+++ b/svl/inc/svl/globalnameitem.hxx
@@ -25,7 +25,6 @@
#include "svl/svldllapi.h"
#include <tools/solar.h>
-#include <tools/rtti.hxx>
#include <tools/globname.hxx>
#include <svl/poolitem.hxx>
@@ -36,7 +35,7 @@ class SVL_DLLPUBLIC SfxGlobalNameItem: public SfxPoolItem
SvGlobalName m_aName;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxGlobalNameItem();
SfxGlobalNameItem( sal_uInt16 nWhich, const SvGlobalName& );
~SfxGlobalNameItem();
diff --git a/svl/inc/svl/hint.hxx b/svl/inc/svl/hint.hxx
index 5a959ad1fe29..5251bf31d9bd 100644
--- a/svl/inc/svl/hint.hxx
+++ b/svl/inc/svl/hint.hxx
@@ -24,13 +24,10 @@
#define _SFXHINT_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
class SVL_DLLPUBLIC SfxHint
{
public:
- TYPEINFO();
-
virtual ~SfxHint();
};
@@ -43,7 +40,6 @@ public:
sal_Bool bIsOwner; \
\
public: \
- TYPEINFO(); \
Name( Type* Object, sal_Bool bOwnedByHint = sal_False ); \
~Name(); \
\
@@ -52,13 +48,11 @@ public:
}
#define IMPL_PTRHINT_AUTODELETE(Name, Type) \
- TYPEINIT1(Name, SfxHint); \
Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \
{ pObj = pObject; bIsOwner = bOwnedByHint; } \
Name::~Name() { if ( bIsOwner ) delete pObj; }
#define IMPL_PTRHINT(Name, Type) \
- TYPEINIT1(Name, SfxHint); \
Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \
{ pObj = pObject; bIsOwner = bOwnedByHint; } \
Name::~Name() {}
diff --git a/svl/inc/svl/ilstitem.hxx b/svl/inc/svl/ilstitem.hxx
index 5f32eddbae34..9d4b1d76de10 100644
--- a/svl/inc/svl/ilstitem.hxx
+++ b/svl/inc/svl/ilstitem.hxx
@@ -35,8 +35,7 @@ class SVL_DLLPUBLIC SfxIntegerListItem : public SfxPoolItem
::com::sun::star::uno::Sequence < sal_Int32 > m_aList;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxIntegerListItem();
SfxIntegerListItem( sal_uInt16 nWhich, const SvULongs& rList );
SfxIntegerListItem( const SfxIntegerListItem& rItem );
diff --git a/svl/inc/svl/imageitm.hxx b/svl/inc/svl/imageitm.hxx
index 2546d086fc76..916da6a9674a 100644
--- a/svl/inc/svl/imageitm.hxx
+++ b/svl/inc/svl/imageitm.hxx
@@ -34,7 +34,6 @@ class SVL_DLLPUBLIC SfxImageItem : public SfxInt16Item
{
SfxImageItem_Impl* pImp;
public:
- TYPEINFO();
SfxImageItem( sal_uInt16 nWhich = 0, sal_uInt16 nImage = 0 );
SfxImageItem( sal_uInt16 nWhich, const String& rURL );
SfxImageItem( const SfxImageItem& );
diff --git a/svl/inc/svl/intitem.hxx b/svl/inc/svl/intitem.hxx
index 3a2182a2bbce..865f6e51ae12 100644
--- a/svl/inc/svl/intitem.hxx
+++ b/svl/inc/svl/intitem.hxx
@@ -31,8 +31,7 @@
class SVL_DLLPUBLIC SfxByteItem: public CntByteItem
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
CntByteItem(which, nValue) {}
@@ -53,8 +52,7 @@ class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem
sal_Int16 m_nValue;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
SfxPoolItem(which), m_nValue(nTheValue)
{ DBG_CTOR(SfxInt16Item, 0); }
@@ -111,8 +109,7 @@ inline void SfxInt16Item::SetValue(sal_Int16 nTheValue)
class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
CntUInt16Item(which, nValue) {}
@@ -130,8 +127,7 @@ public:
class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
CntInt32Item(which, nValue) {}
@@ -150,8 +146,7 @@ public:
class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
CntUInt32Item(which, nValue) {}
diff --git a/svl/inc/svl/isethint.hxx b/svl/inc/svl/isethint.hxx
index 1a7640a2837a..52c397bcf1b7 100644
--- a/svl/inc/svl/isethint.hxx
+++ b/svl/inc/svl/isethint.hxx
@@ -38,8 +38,6 @@ class SVL_DLLPUBLIC SfxItemSetHint: public SfxHint
SfxItemSet* _pItemSet;
public:
- TYPEINFO();
-
SfxItemSetHint( SfxItemSet *pItemSet );
SfxItemSetHint( const SfxItemSet &rItemSet );
virtual ~SfxItemSetHint();
diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx
index 15e57ea73f2e..69f95830d5bc 100644
--- a/svl/inc/svl/itempool.hxx
+++ b/svl/inc/svl/itempool.hxx
@@ -117,7 +117,7 @@ class SVL_DLLPUBLIC SfxItemPool
SfxItemPool* pSecondary;
SfxItemPool* pMaster;
sal_uInt16* _pPoolRanges;
- FASTBOOL bPersistentRefCounts;
+ bool bPersistentRefCounts;
private:
// ObjectUser section
@@ -136,15 +136,15 @@ private:
inline sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const;
inline sal_uInt16 GetSize_Impl() const { return nEnd - nStart + 1; }
- SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream );
- SVL_DLLPRIVATE FASTBOOL IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
+ SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream );
+ SVL_DLLPRIVATE bool IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
public:
// fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges
void FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const;
const sal_uInt16* GetFrozenIdRanges() const
{ return _pPoolRanges; }
- FASTBOOL IsVer2_Impl() const;
+ bool IsVer2_Impl() const;
#endif
//---------------------------------------------------------------------
@@ -166,7 +166,7 @@ public:
#ifndef TF_POOLABLE
sal_uInt16 *pSlotIds = 0,
#endif
- FASTBOOL bLoadRefCounts = sal_True );
+ bool bLoadRefCounts = true );
protected:
virtual ~SfxItemPool();
public:
@@ -198,11 +198,11 @@ public:
virtual const SfxPoolItem& GetDefaultItem( sal_uInt16 nWhich ) const;
const SfxPoolItem* LoadItem( SvStream &rStream,
- FASTBOOL bDirect = sal_False,
+ bool bDirect = false,
const SfxItemPool *pRefPool = 0 );
- FASTBOOL StoreItem( SvStream &rStream,
+ bool StoreItem( SvStream &rStream,
const SfxPoolItem &rItem,
- FASTBOOL bDirect = sal_False ) const;
+ bool bDirect = false) const;
sal_uInt32 GetSurrogate(const SfxPoolItem *) const;
const SfxPoolItem * GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const;
@@ -210,7 +210,7 @@ public:
const SfxPoolItem* LoadSurrogate(SvStream& rStream,
sal_uInt16 &rWhich, sal_uInt16 nSlotId,
const SfxItemPool* pRefPool = 0 );
- FASTBOOL StoreSurrogate(SvStream& rStream,
+ bool StoreSurrogate(SvStream& rStream,
const SfxPoolItem *pItem ) const;
virtual SvStream & Load(SvStream &);
@@ -221,11 +221,11 @@ public:
sal_uInt16 GetFirstWhich() const { return nStart; }
sal_uInt16 GetLastWhich() const { return nEnd; }
- FASTBOOL IsInRange( sal_uInt16 nWhich ) const {
+ bool IsInRange( sal_uInt16 nWhich ) const {
return nWhich >= nStart &&
nWhich <= nEnd; }
- FASTBOOL IsInVersionsRange( sal_uInt16 nWhich ) const;
- FASTBOOL IsInStoringRange( sal_uInt16 nWhich ) const;
+ bool IsInVersionsRange( sal_uInt16 nWhich ) const;
+ bool IsInStoringRange( sal_uInt16 nWhich ) const;
void SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo );
void SetSecondaryPool( SfxItemPool *pPool );
SfxItemPool* GetSecondaryPool() const {
@@ -238,8 +238,8 @@ public:
void Delete();
#ifdef TF_POOLABLE
- FASTBOOL IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
- FASTBOOL IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const
+ bool IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const;
+ bool IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const
{ return IsItemFlag( rItem.Which(), nFlag ); }
void SetItemInfos( const SfxItemInfo *pInfos )
{ pItemInfos = pInfos; }
@@ -262,7 +262,7 @@ public:
{ return _nFileFormatVersion; }
void SetFileFormatVersion( sal_uInt16 nFileFormatVersion );
sal_uInt16 GetLoadingVersion() const;
- FASTBOOL IsCurrentVersionLoading() const;
+ bool IsCurrentVersionLoading() const;
static int IsWhich(sal_uInt16 nId) {
return nId && nId <= SFX_WHICH_MAX; }
diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx
index 4da844eecaf9..540235d1ce83 100644
--- a/svl/inc/svl/itemset.hxx
+++ b/svl/inc/svl/itemset.hxx
@@ -31,7 +31,6 @@
#include <cstdarg> // std::va_list and friends
#endif
#include <svl/poolitem.hxx>
-#include <tools/rtti.hxx>
#include <tools/solar.h>
class SfxItemPool;
@@ -63,8 +62,7 @@ typedef SfxPoolItem const** SfxItemArray;
//========================================================================
#define SFX_ITEMSET_GET( rSet, pItem, ItemType, nSlotId, bDeep ) \
- const ItemType *pItem = (const ItemType*) \
- (rSet).GetItem( nSlotId, bDeep, TYPE(ItemType) )
+ const ItemType *pItem = dynamic_cast< const ItemType* >((rSet).GetItem( nSlotId, bDeep ))
//========================================================================
@@ -121,39 +119,38 @@ protected:
virtual void Changed( const SfxPoolItem& rOld, const SfxPoolItem& rNew );
// direkte Put-Methode
- int PutDirect(const SfxPoolItem &rItem);
+ bool PutDirect(const SfxPoolItem &rItem);
public:
SfxItemSet( const SfxItemSet& );
- SfxItemSet( SfxItemPool&, sal_Bool bTotalPoolRanges = sal_False );
+ SfxItemSet( SfxItemPool&, bool bTotalPoolRanges = false );
SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
SfxItemSet( SfxItemPool&, USHORT_ARG nWh1, USHORT_ARG nWh2, USHORT_ARG nNull, ... );
SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable );
virtual ~SfxItemSet();
- virtual SfxItemSet * Clone(sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0) const;
+ virtual SfxItemSet * Clone(bool bItems = true, SfxItemPool *pToPool = 0) const;
// Items erfragen
- sal_uInt16 Count() const { return _nCount; }
- sal_uInt16 TotalCount() const;
+ sal_uInt16 Count() const { return _nCount; }
+ sal_uInt16 TotalCount() const;
- virtual const SfxPoolItem& Get( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True ) const;
- const SfxPoolItem* GetItem( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True,
- TypeId aItemType = 0 ) const;
+ virtual const SfxPoolItem& Get( sal_uInt16 nWhich, bool bSrchInParent = true ) const;
+ const SfxPoolItem* GetItem( sal_uInt16 nWhich, bool bSrchInParent = true ) const;
// Which-Wert des Items an der Position nPos erfragen
sal_uInt16 GetWhichByPos(sal_uInt16 nPos) const;
// Item-Status erfragen
SfxItemState GetItemState( sal_uInt16 nWhich,
- sal_Bool bSrchInParent = sal_True,
+ bool bSrchInParent = true,
const SfxPoolItem **ppItem = 0 ) const;
virtual void DisableItem(sal_uInt16 nWhich);
virtual void InvalidateItem( sal_uInt16 nWhich );
- virtual sal_uInt16 ClearItem( sal_uInt16 nWhich = 0);
- virtual void ClearInvalidItems( sal_Bool bHardDefault = sal_False );
+ virtual sal_uInt16 ClearItem( sal_uInt16 nWhich = 0);
+ virtual void ClearInvalidItems( bool bHardDefault = false );
void InvalidateAllItems(); HACK(via nWhich = 0)
inline void SetParent( const SfxItemSet* pNew );
@@ -162,30 +159,30 @@ public:
virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
const SfxPoolItem* Put( const SfxPoolItem& rItem )
{ return Put(rItem, rItem.Which()); }
- virtual int Put( const SfxItemSet&,
- sal_Bool bInvalidAsDefault = sal_True );
+ virtual bool Put( const SfxItemSet&,
+ bool bInvalidAsDefault = sal_True );
void PutExtended( const SfxItemSet&,
SfxItemState eDontCareAs = SFX_ITEM_UNKNOWN,
SfxItemState eDefaultAs = SFX_ITEM_UNKNOWN );
- virtual int Set( const SfxItemSet&, sal_Bool bDeep = sal_True );
+ virtual bool Set( const SfxItemSet&, bool bDeep = true);
virtual void Intersect( const SfxItemSet& rSet );
- virtual void MergeValues( const SfxItemSet& rSet, sal_Bool bOverwriteDefaults = sal_False );
+ virtual void MergeValues( const SfxItemSet& rSet, bool bOverwriteDefaults = false );
virtual void Differentiate( const SfxItemSet& rSet );
- virtual void MergeValue( const SfxPoolItem& rItem, sal_Bool bOverwriteDefaults = sal_False );
+ virtual void MergeValue( const SfxPoolItem& rItem, bool bOverwriteDefaults = false );
SfxItemPool* GetPool() const { return _pPool; }
- const sal_uInt16* GetRanges() const { return _pWhichRanges; }
+ const sal_uInt16* GetRanges() const { return _pWhichRanges; }
void SetRanges( const sal_uInt16 *pRanges );
void MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo );
const SfxItemSet* GetParent() const { return _pParent; }
- virtual SvStream & Load( SvStream &, FASTBOOL bDirect = sal_False,
+ virtual SvStream & Load( SvStream &, bool bDirect = false,
const SfxItemPool *pRefPool = 0 );
- virtual SvStream & Store( SvStream &, FASTBOOL bDirect = sal_False ) const;
+ virtual SvStream & Store( SvStream &, bool bDirect = false) const;
- virtual int operator==(const SfxItemSet &) const;
+ virtual bool operator==(const SfxItemSet &) const;
//optimize a comparing operation from 'memcmp' to 'hash compare' to improve xls loading performance, i120575
//in some situation (e.g.. ScPatternAttr::operator== ),
@@ -214,19 +211,19 @@ class SVL_DLLPUBLIC SfxAllItemSet: public SfxItemSet
{
SfxVoidItem aDefault;
- sal_uInt16 nFree;
+ sal_uInt16 nFree;
public:
SfxAllItemSet( SfxItemPool &rPool );
SfxAllItemSet( const SfxItemSet & );
SfxAllItemSet( const SfxAllItemSet & );
- virtual SfxItemSet * Clone( sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0 ) const;
+ virtual SfxItemSet * Clone( bool bItems = true, SfxItemPool *pToPool = 0 ) const;
virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich );
const SfxPoolItem* Put( const SfxPoolItem& rItem )
{ return Put(rItem, rItem.Which()); }
- virtual int Put( const SfxItemSet&,
- sal_Bool bInvalidAsDefault = sal_True );
+ virtual bool Put( const SfxItemSet&,
+ bool bInvalidAsDefault = true );
};
#endif // #ifndef _SFXITEMSET_HXX
diff --git a/svl/inc/svl/lckbitem.hxx b/svl/inc/svl/lckbitem.hxx
index ad574679ea2e..7573812113ec 100644
--- a/svl/inc/svl/lckbitem.hxx
+++ b/svl/inc/svl/lckbitem.hxx
@@ -25,7 +25,6 @@
#include "svl/svldllapi.h"
#include <tools/solar.h>
-#include <tools/rtti.hxx>
#include <tools/stream.hxx>
#include <svl/poolitem.hxx>
@@ -36,7 +35,7 @@ class SVL_DLLPUBLIC SfxLockBytesItem : public SfxPoolItem
SvLockBytesRef _xVal;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxLockBytesItem();
SfxLockBytesItem( sal_uInt16 nWhich,
SvLockBytes *pLockBytes );
diff --git a/svl/inc/svl/listener.hxx b/svl/inc/svl/listener.hxx
index 9d2ec2d31006..d87faab10599 100644
--- a/svl/inc/svl/listener.hxx
+++ b/svl/inc/svl/listener.hxx
@@ -24,7 +24,6 @@
#define _SVT_LISTENER_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
class SvtBroadcaster;
class SfxHint;
@@ -40,8 +39,6 @@ class SVL_DLLPUBLIC SvtListener
const SvtListener& operator=(const SvtListener &); // n.i., ist verboten
public:
- TYPEINFO();
-
SvtListener();
SvtListener( const SvtListener &rCopy );
virtual ~SvtListener();
diff --git a/svl/inc/svl/listeneriter.hxx b/svl/inc/svl/listeneriter.hxx
index d1cf55e8bb24..8242979116b8 100644
--- a/svl/inc/svl/listeneriter.hxx
+++ b/svl/inc/svl/listeneriter.hxx
@@ -24,7 +24,7 @@
#define _SVT_LISTENERITER_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
+#include <typeinfo>
class SvtListener;
class SvtListenerBase;
@@ -32,6 +32,14 @@ class SvtBroadcaster;
//-------------------------------------------------------------------------
+typedef bool (*ConvertToSvtListener)( const SvtListener* );
+template<class T> bool _IsSvtListener(const SvtListener* pListener)
+{
+ return 0 != dynamic_cast<const T*>(pListener);
+}
+
+//-------------------------------------------------------------------------
+
class SVL_DLLPUBLIC SvtListenerIter
{
friend class SvtListenerBase;
@@ -43,7 +51,7 @@ class SVL_DLLPUBLIC SvtListenerIter
// at the same time.
static SvtListenerIter *pListenerIters;
SvtListenerIter *pNxtIter;
- TypeId aSrchId; // fuer First/Next - suche diesen Type
+ ConvertToSvtListener pSrchFunction; // fuer First/Next - suche diesen Type
SVL_DLLPRIVATE static void RemoveListener( SvtListenerBase& rDel,
SvtListenerBase* pNext );
@@ -66,7 +74,7 @@ public:
int IsChanged() const { return pDelNext != pAkt; }
- SvtListener* First( TypeId nType );
+ SvtListener* First( ConvertToSvtListener rConvert );
SvtListener* Next();
};
diff --git a/svl/inc/svl/lstner.hxx b/svl/inc/svl/lstner.hxx
index db122042c3d8..b578d1e10394 100644
--- a/svl/inc/svl/lstner.hxx
+++ b/svl/inc/svl/lstner.hxx
@@ -24,7 +24,6 @@
#define _SFXLSTNER_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
#include <svl/svarray.hxx>
class SfxBroadcaster;
@@ -47,8 +46,6 @@ private:
const SfxListener& operator=(const SfxListener &); // n.i., ist verboten
public:
- TYPEINFO();
-
SfxListener();
SfxListener( const SfxListener &rCopy );
virtual ~SfxListener();
diff --git a/svl/inc/svl/macitem.hxx b/svl/inc/svl/macitem.hxx
index d2935227a660..805c9f466fd8 100644
--- a/svl/inc/svl/macitem.hxx
+++ b/svl/inc/svl/macitem.hxx
@@ -27,7 +27,6 @@
#include "svl/svldllapi.h"
#include <svl/poolitem.hxx>
-#include <tools/rtti.hxx>
#include <tools/debug.hxx>
#include <tools/string.hxx>
@@ -148,8 +147,6 @@ Dieses Item beschreibt eine Makro-Tabelle.
class SVL_DLLPUBLIC SvxMacroItem: public SfxPoolItem
{
public:
- TYPEINFO();
-
inline SvxMacroItem ( const sal_uInt16 nId /*= ITEMID_MACRO*/ );
// "pure virtual Methoden" vom SfxPoolItem
diff --git a/svl/inc/svl/metitem.hxx b/svl/inc/svl/metitem.hxx
index ed34ab46c7f3..e1e3502a4d0d 100644
--- a/svl/inc/svl/metitem.hxx
+++ b/svl/inc/svl/metitem.hxx
@@ -33,15 +33,14 @@ DBG_NAMEEX_VISIBILITY(SfxMetricItem, SVL_DLLPUBLIC)
class SVL_DLLPUBLIC SfxMetricItem: public SfxInt32Item
{
public:
- TYPEINFO();
SfxMetricItem( sal_uInt16 nWhich = 0, sal_uInt32 nValue = 0 );
SfxMetricItem( sal_uInt16 nWhich, SvStream & );
SfxMetricItem( const SfxMetricItem& );
~SfxMetricItem() {
DBG_DTOR(SfxMetricItem, 0); }
- virtual int ScaleMetrics( long lMult, long lDiv );
- virtual int HasMetrics() const;
+ virtual void ScaleMetrics( long lMult, long lDiv );
+ virtual bool HasMetrics() const;
};
diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx
index 37accc0f5ef5..b1238151aa90 100644
--- a/svl/inc/svl/poolitem.hxx
+++ b/svl/inc/svl/poolitem.hxx
@@ -28,7 +28,6 @@
#define TF_POOLABLE
#include <sal/config.h>
-#include <tools/rtti.hxx>
#include <limits.h>
#include <tools/solar.h>
#include <tools/debug.hxx>
@@ -171,6 +170,18 @@ namespace rtl
// -----------------------------------------------------------------------
+class SfxPoolItem;
+typedef SfxPoolItem* (*CreatePoolItem)();
+
+#define POOLITEM_FACTORY() \
+ using SfxPoolItem::Create; \
+ static SfxPoolItem* Create();
+
+#define IMPL_POOLITEM_FACTORY(Type) \
+ SfxPoolItem* Type::Create() { return new Type; }
+
+// -----------------------------------------------------------------------
+
class SVL_DLLPUBLIC SfxPoolItem
{
friend class SfxItemPool;
@@ -203,7 +214,6 @@ protected:
SfxPoolItem( const SfxPoolItem& );
public:
- TYPEINFO();
virtual ~SfxPoolItem();
void SetWhich( sal_uInt16 nId ) {
@@ -224,12 +234,12 @@ public:
XubString &rText,
const IntlWrapper * pIntlWrapper = 0 ) const;
- virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
- virtual int ScaleMetrics( long lMult, long lDiv );
- virtual int HasMetrics() const;
+ virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const;
+ virtual void ScaleMetrics( long lMult, long lDiv );
+ virtual bool HasMetrics() const;
- virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
- virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+ virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const;
virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
@@ -355,7 +365,8 @@ class SVL_DLLPUBLIC SfxVoidItem: public SfxPoolItem
{
SfxVoidItem & operator=( const SfxVoidItem& ); // not implemented.
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
+ SfxVoidItem( );
SfxVoidItem( sal_uInt16 nWhich );
SfxVoidItem( sal_uInt16 nWhich, SvStream & );
SfxVoidItem( const SfxVoidItem& );
@@ -383,7 +394,6 @@ class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem
SfxSetItem & operator=( const SfxSetItem& ); // not implemented.
public:
- TYPEINFO();
SfxSetItem( sal_uInt16 nWhich, SfxItemSet *pSet );
SfxSetItem( sal_uInt16 nWhich, const SfxItemSet &rSet );
SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 );
@@ -418,7 +428,6 @@ friend class SfxItemSet;
const SfxPoolItem* pDefaultItem;
private:
- TYPEINFO();
SfxInvalidItem( sal_uInt16 nWhich, const SfxPoolItem &rDefault );
SfxInvalidItem( const SfxInvalidItem& );
virtual ~SfxInvalidItem();
@@ -469,7 +478,6 @@ class SfxItemChangedHint: public SfxHint
const SfxPoolItem& _rNew;
public:
- TYPEINFO(); \
SfxItemChangedHint( const SfxPoolItem &rOld,
const SfxPoolItem &rNew )
: _rOld( rOld ),
diff --git a/svl/inc/svl/ptitem.hxx b/svl/inc/svl/ptitem.hxx
index 648b426cde9d..79b67ca47b4e 100644
--- a/svl/inc/svl/ptitem.hxx
+++ b/svl/inc/svl/ptitem.hxx
@@ -38,7 +38,7 @@ class SVL_DLLPUBLIC SfxPointItem: public SfxPoolItem
Point aVal;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxPointItem();
SfxPointItem( sal_uInt16 nWhich, const Point& rVal );
SfxPointItem( sal_uInt16 nWhich, SvStream & );
diff --git a/svl/inc/svl/rectitem.hxx b/svl/inc/svl/rectitem.hxx
index 0806fea5da57..f2e31e222e68 100644
--- a/svl/inc/svl/rectitem.hxx
+++ b/svl/inc/svl/rectitem.hxx
@@ -39,7 +39,7 @@ class SVL_DLLPUBLIC SfxRectangleItem: public SfxPoolItem
Rectangle aVal;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SfxRectangleItem();
SfxRectangleItem( sal_uInt16 nWhich, const Rectangle& rVal );
SfxRectangleItem( sal_uInt16 nWhich, SvStream & );
diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx
index ba3a89430acc..c6c43a193da5 100644
--- a/svl/inc/svl/rngitem.hxx
+++ b/svl/inc/svl/rngitem.hxx
@@ -59,7 +59,6 @@ private:
NUMTYPE nFrom;
NUMTYPE nTo;
public:
- TYPEINFO();
SfxXRangeItem();
SfxXRangeItem( sal_uInt16 nWID, NUMTYPE nFrom, NUMTYPE nTo );
SfxXRangeItem( sal_uInt16 nWID, SvStream &rStream );
@@ -88,7 +87,6 @@ private:
NUMTYPE* _pRanges;
public:
- TYPEINFO();
SfxXRangesItem();
SfxXRangesItem( sal_uInt16 nWID, const NUMTYPE *pRanges );
SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream );
diff --git a/svl/inc/svl/sfontitm.hxx b/svl/inc/svl/sfontitm.hxx
index bcb12105d19b..21877efcbd12 100644
--- a/svl/inc/svl/sfontitm.hxx
+++ b/svl/inc/svl/sfontitm.hxx
@@ -56,8 +56,6 @@ class SfxFontItem: public SfxPoolItem
unsigned m_bHasFillColor: 1;
public:
- TYPEINFO();
-
inline SfxFontItem(sal_uInt16 nWhich);
virtual int operator ==(const SfxPoolItem & rItem) const;
diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx
index d930065846ea..0dbe857ceaa3 100644
--- a/svl/inc/svl/slstitm.hxx
+++ b/svl/inc/svl/slstitm.hxx
@@ -24,7 +24,6 @@
#define _SFXSLSTITM_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
#include <tools/list.hxx>
#include <svl/poolitem.hxx>
#include <com/sun/star/uno/Sequence.h>
@@ -37,8 +36,7 @@ protected:
SfxImpStringList* pImp;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxStringListItem();
SfxStringListItem( sal_uInt16 nWhich, const List* pList=NULL );
SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream );
diff --git a/svl/inc/svl/smplhint.hxx b/svl/inc/svl/smplhint.hxx
index da3d7125a5ac..bd64a92f6be6 100644
--- a/svl/inc/svl/smplhint.hxx
+++ b/svl/inc/svl/smplhint.hxx
@@ -25,7 +25,7 @@
#include "svl/svldllapi.h"
#include <svl/hint.hxx>
-#include <tools/rtti.hxx>
+#include <tools/solar.h>
#define SFX_HINT_DYING 0x00000001
#define SFX_HINT_NAMECHANGED 0x00000002
@@ -66,7 +66,6 @@ class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint
private:
sal_uLong nId;
public:
- TYPEINFO();
SfxSimpleHint( sal_uLong nId );
sal_uLong GetId() const { return nId; }
};
@@ -79,14 +78,12 @@ public:
Type aObj; \
\
public: \
- TYPEINFO(); \
Name( sal_uInt16 nId, const Type& rObject ); \
~Name(); \
const Type& GetObject() const { return aObj; } \
}
#define IMPL_OBJHINT(Name, Type) \
- TYPEINIT1(Name, SfxSimpleHint); \
Name::Name( sal_uInt16 nID, const Type& rObject ): \
SfxSimpleHint( nID ), aObj(rObject) \
{ } \
diff --git a/svl/inc/svl/solar.hrc b/svl/inc/svl/solar.hrc
index ef94394ec7b2..537c2d20220c 100644
--- a/svl/inc/svl/solar.hrc
+++ b/svl/inc/svl/solar.hrc
@@ -26,7 +26,7 @@
// defines ------------------------------------------------------------------
-#define OWN_ATTR_VALUE_START 3900
+#define OWN_ATTR_VALUE_START 3800
#define OWN_ATTR_VALUE_END 3988
#define CREATERESMGR_NAME( Name ) #Name
diff --git a/svl/inc/svl/srchitem.hxx b/svl/inc/svl/srchitem.hxx
index e29e3d381f2a..e647d331fa3f 100644
--- a/svl/inc/svl/srchitem.hxx
+++ b/svl/inc/svl/srchitem.hxx
@@ -79,9 +79,8 @@ class SVL_DLLPUBLIC SvxSearchItem :
sal_Bool bAsianOptions; // use asian options?
public:
- TYPEINFO();
-
- SvxSearchItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxSearchItem( const sal_uInt16 nId = 0);
SvxSearchItem( const SvxSearchItem& rItem );
virtual ~SvxSearchItem();
diff --git a/svl/inc/svl/stritem.hxx b/svl/inc/svl/stritem.hxx
index 166b7b049223..70e9b213dd2b 100644
--- a/svl/inc/svl/stritem.hxx
+++ b/svl/inc/svl/stritem.hxx
@@ -31,8 +31,7 @@
class SVL_DLLPUBLIC SfxStringItem: public CntUnencodedStringItem
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SfxStringItem() {}
SfxStringItem(sal_uInt16 which, const XubString & rValue):
diff --git a/svl/inc/svl/strmadpt.hxx b/svl/inc/svl/strmadpt.hxx
index f73652de067f..32220fdb3f16 100644
--- a/svl/inc/svl/strmadpt.hxx
+++ b/svl/inc/svl/strmadpt.hxx
@@ -39,8 +39,6 @@ class SVL_DLLPUBLIC SvOutputStreamOpenLockBytes: public SvOpenLockBytes
sal_uInt32 m_nPosition;
public:
- TYPEINFO();
-
SvOutputStreamOpenLockBytes(
const com::sun::star::uno::Reference<
com::sun::star::io::XOutputStream > &
diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx
index 5ca3d1bd9b84..2b1be912556b 100644
--- a/svl/inc/svl/style.hxx
+++ b/svl/inc/svl/style.hxx
@@ -104,8 +104,6 @@ protected:
virtual void Store( SvStream& );
public:
- TYPEINFO();
-
// returns the internal name of this style
virtual const UniString& GetName() const;
@@ -279,8 +277,6 @@ class SVL_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase,
public SfxListener, public SfxBroadcaster
{
public:
- TYPEINFO();
-
SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, sal_uInt16 );
SfxStyleSheet( const SfxStyleSheet& );
@@ -327,8 +323,6 @@ class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint
sal_uInt16 nHint;
public:
- TYPEINFO();
-
SfxStyleSheetPoolHint(sal_uInt16 nArgHint) : nHint(nArgHint){}
sal_uInt16 GetHint() const
{ return nHint; }
@@ -342,8 +336,6 @@ class SVL_DLLPUBLIC SfxStyleSheetHint: public SfxHint
sal_uInt16 nHint;
public:
- TYPEINFO();
-
SfxStyleSheetHint( sal_uInt16 );
SfxStyleSheetHint( sal_uInt16, SfxStyleSheetBase& );
SfxStyleSheetBase* GetStyleSheet() const
@@ -357,14 +349,12 @@ class SVL_DLLPUBLIC SfxStyleSheetHintExtended: public SfxStyleSheetHint
String aName;
public:
- TYPEINFO();
-
SfxStyleSheetHintExtended(
sal_uInt16, const String& rOld );
SfxStyleSheetHintExtended(
sal_uInt16, const String& rOld,
SfxStyleSheetBase& );
- const String& GetOldName() { return aName; }
+ const String& GetOldName() const { return aName; }
};
class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel >
diff --git a/svl/inc/svl/szitem.hxx b/svl/inc/svl/szitem.hxx
index 8f0b627e3a07..6a113164acb2 100644
--- a/svl/inc/svl/szitem.hxx
+++ b/svl/inc/svl/szitem.hxx
@@ -40,7 +40,6 @@ private:
Size aVal;
public:
- TYPEINFO();
SfxSizeItem();
SfxSizeItem( sal_uInt16 nWhich, const Size& rVal );
SfxSizeItem( sal_uInt16 nWhich, SvStream & );
diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx
index 68e0b729263a..1c4f769e6b24 100644
--- a/svl/inc/svl/undo.hxx
+++ b/svl/inc/svl/undo.hxx
@@ -24,7 +24,6 @@
#define _UNDO_HXX
#include "svl/svldllapi.h"
-#include <tools/rtti.hxx>
#include <tools/string.hxx>
#include <svl/svarray.hxx>
@@ -38,7 +37,6 @@
class SVL_DLLPUBLIC SfxRepeatTarget
{
public:
- TYPEINFO();
virtual ~SfxRepeatTarget() = 0;
};
@@ -56,7 +54,6 @@ class SVL_DLLPUBLIC SfxUndoAction
{
sal_Bool bLinked;
public:
- TYPEINFO();
SfxUndoAction();
virtual ~SfxUndoAction();
@@ -165,8 +162,6 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra
*/
{
public:
- TYPEINFO();
-
SfxListUndoAction( const UniString &rComment,
const UniString rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather);
virtual void Undo();
@@ -449,7 +444,6 @@ class SVL_DLLPUBLIC SfxLinkUndoAction : public SfxUndoAction
{
public:
- TYPEINFO();
SfxLinkUndoAction(::svl::IUndoManager *pManager);
~SfxLinkUndoAction();
diff --git a/svl/inc/svl/visitem.hxx b/svl/inc/svl/visitem.hxx
index 064465a09fb9..9e6acbb474e9 100644
--- a/svl/inc/svl/visitem.hxx
+++ b/svl/inc/svl/visitem.hxx
@@ -37,8 +37,6 @@ class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem
::com::sun::star::frame::status::Visibility m_nValue;
public:
- TYPEINFO();
-
SfxVisibilityItem(sal_uInt16 which = 0, sal_Bool bVisible = sal_True):
SfxPoolItem(which)
{
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index 45b30a566e2c..273ff62c649e 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -58,7 +58,7 @@ namespace com { namespace sun { namespace star {
}}}
-#define SV_COUNTRY_LANGUAGE_OFFSET 8000 // Max count of formats per country/language
+#define SV_COUNTRY_LANGUAGE_OFFSET 5000 // Max count of formats per country/language
#define SV_MAX_ANZ_STANDARD_FORMATE 100 // Max count of builtin default formats per CL
// Format types
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx
index 80d7ba48da22..d1f93344511b 100644
--- a/svl/source/filerec/filerec.cxx
+++ b/svl/source/filerec/filerec.cxx
@@ -70,11 +70,11 @@ SV_IMPL_VARARR( SfxUINT32s, sal_uInt32 );
sal_uInt32 SfxMiniRecordWriter::Close
(
- FASTBOOL bSeekToEndOfRec /* sal_True (default)
+ bool bSeekToEndOfRec /* true (default)
Der Stream wird an das Ende des Records
positioniert.
- sal_False
+ false
Der Stream wird an den Anfang des
Contents (also hinter den Header)
positioniert.
@@ -114,7 +114,7 @@ sal_uInt32 SfxMiniRecordWriter::Close
_pStream->Seek( nEndPos );
// Header wurde JETZT geschrieben
- _bHeaderOk = sal_True;
+ _bHeaderOk = true;
return nEndPos;
}
#ifdef DBG_UTIL
@@ -256,7 +256,7 @@ sal_uInt16 SfxMiniRecordReader::ScanRecordType
//-------------------------------------------------------------------------
-FASTBOOL SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader )
+bool SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader )
/* [Beschreibung]
@@ -268,7 +268,7 @@ FASTBOOL SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader )
*/
{
- FASTBOOL bRet = sal_True;
+ bool bRet = true;
// Record-Ende und Pre-Tag aus dem Header ermitteln
_nEofRec = _pStream->Tell() + SFX_REC_OFS(nHeader);
@@ -278,7 +278,7 @@ FASTBOOL SfxMiniRecordReader::SetHeader_Impl( sal_uInt32 nHeader )
if ( _nPreTag == SFX_REC_PRETAG_EOR )
{
_pStream->SetError( ERRCODE_IO_WRONGFORMAT );
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
@@ -305,7 +305,7 @@ SfxMiniRecordReader::SfxMiniRecordReader
*/
: _pStream( pStream ),
- _bSkipped( sal_False )
+ _bSkipped( false )
{
// Header einlesen
sal_uInt32 nStartPos = pStream->Tell(); // um im Fehlerfall zur"uck zu-seeken
@@ -483,7 +483,7 @@ SfxSingleRecordWriter::SfxSingleRecordWriter
//=========================================================================
-inline FASTBOOL SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes )
+inline bool SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes )
/* [Beschreibung]
@@ -494,13 +494,13 @@ inline FASTBOOL SfxSingleRecordReader::ReadHeader_Impl( sal_uInt16 nTypes )
*/
{
- FASTBOOL bRet;
+ bool bRet;
// Basisklassen-Header einlesen
sal_uInt32 nHeader=0;
*_pStream >> nHeader;
if ( !SetHeader_Impl( nHeader ) )
- bRet = sal_False;
+ bRet = false;
else
{
// eigenen Header einlesen
@@ -557,7 +557,7 @@ SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, sal_uInt16 nTag
//-------------------------------------------------------------------------
-FASTBOOL SfxSingleRecordReader::FindHeader_Impl
+bool SfxSingleRecordReader::FindHeader_Impl
(
sal_uInt16 nTypes, // arithm. Veroderung erlaubter Record-Typen
sal_uInt16 nTag // zu findende Record-Art-Kennung
@@ -603,7 +603,7 @@ FASTBOOL SfxSingleRecordReader::FindHeader_Impl
SFX_REC_TYP(nHeader));
if ( nTypes & _nRecordType )
// ==> gefunden
- return sal_True;
+ return true;
// error => Such-Schleife abbrechen
break;
@@ -618,7 +618,7 @@ FASTBOOL SfxSingleRecordReader::FindHeader_Impl
// Fehler setzen und zur"uck-seeken
_pStream->SetError( ERRCODE_IO_WRONGFORMAT );
_pStream->Seek( nStartPos );
- return sal_False;
+ return false;
}
//=========================================================================
@@ -670,7 +670,7 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
//------------------------------------------------------------------------
-sal_uInt32 SfxMultiFixRecordWriter::Close( FASTBOOL bSeekToEndOfRec )
+sal_uInt32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec )
// siehe <SfxMiniRecordWriter>
@@ -795,7 +795,7 @@ void SfxMultiVarRecordWriter::NewContent()
//-------------------------------------------------------------------------
-sal_uInt32 SfxMultiVarRecordWriter::Close( FASTBOOL bSeekToEndOfRec )
+sal_uInt32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec )
// siehe <SfxMiniRecordWriter>
@@ -868,7 +868,7 @@ void SfxMultiMixRecordWriter::NewContent
//=========================================================================
-FASTBOOL SfxMultiRecordReader::ReadHeader_Impl()
+bool SfxMultiRecordReader::ReadHeader_Impl()
/* [Beschreibung]
@@ -963,7 +963,7 @@ SfxMultiRecordReader::~SfxMultiRecordReader()
//-------------------------------------------------------------------------
-FASTBOOL SfxMultiRecordReader::GetContent()
+bool SfxMultiRecordReader::GetContent()
/* [Beschreibung]
@@ -1007,10 +1007,10 @@ FASTBOOL SfxMultiRecordReader::GetContent()
// ContentNo weiterz"ahlen
++_nContentNo;
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index e535f82e47ea..36bd24f3f099 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -78,8 +78,8 @@ struct SfxItemPool_Impl
sal_uInt16 nStoringStart, nStoringEnd; // zu speichernder Range
sal_uInt8 nMajorVer, nMinorVer; // Pool selbst
SfxMapUnit eDefMetric;
- FASTBOOL bInSetItem;
- FASTBOOL bStreaming; // in Load() bzw. Store()
+ int bInSetItem; // !CAUTION! This should be a bool, but is used as int in poolio.cxx(205)
+ bool bStreaming; // in Load() bzw. Store()
SfxItemPool_Impl( sal_uInt16 nStart, sal_uInt16 nEnd )
: ppPoolItems (new SfxPoolItemArray_Impl*[ nEnd - nStart + 1])
diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx
index 04f53ea8d20a..9bcf4ea4b7d8 100644
--- a/svl/source/items/aeitem.cxx
+++ b/svl/source/items/aeitem.cxx
@@ -36,8 +36,7 @@
// STATIC DATA -----------------------------------------------------------
DBG_NAME(SfxAllEnumItem)
-
-TYPEINIT1_AUTOFACTORY(SfxAllEnumItem, SfxEnumItem)
+IMPL_POOLITEM_FACTORY(SfxAllEnumItem)
// -----------------------------------------------------------------------
diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx
index ba9a7604fdbd..ddb51797165a 100644
--- a/svl/source/items/cenumitm.cxx
+++ b/svl/source/items/cenumitm.cxx
@@ -41,9 +41,6 @@
DBG_NAME(SfxEnumItemInterface)
//============================================================================
-TYPEINIT1(SfxEnumItemInterface, SfxPoolItem)
-
-//============================================================================
// virtual
int SfxEnumItemInterface::operator ==(const SfxPoolItem & rItem) const
{
@@ -155,9 +152,6 @@ CntEnumItem::CntEnumItem(sal_uInt16 which, SvStream & rStream):
}
//============================================================================
-TYPEINIT1(CntEnumItem, SfxEnumItemInterface)
-
-//============================================================================
// virtual
SvStream & CntEnumItem::Store(SvStream & rStream, sal_uInt16) const
{
@@ -188,9 +182,6 @@ void CntEnumItem::SetEnumValue(sal_uInt16 nTheValue)
DBG_NAME(CntBoolItem)
//============================================================================
-TYPEINIT1_AUTOFACTORY(CntBoolItem, SfxPoolItem)
-
-//============================================================================
CntBoolItem::CntBoolItem(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
@@ -202,8 +193,7 @@ CntBoolItem::CntBoolItem(sal_uInt16 which, SvStream & rStream):
// virtual
int CntBoolItem::operator ==(const SfxPoolItem & rItem) const
{
- DBG_ASSERT(rItem.ISA(CntBoolItem),
- "CntBoolItem::operator ==(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntBoolItem* >(&rItem), "CntBoolItem::operator ==(): Bad type");
return m_bValue == static_cast< CntBoolItem const * >(&rItem)->m_bValue;
}
@@ -211,7 +201,7 @@ int CntBoolItem::operator ==(const SfxPoolItem & rItem) const
// virtual
int CntBoolItem::Compare(const SfxPoolItem & rWith) const
{
- DBG_ASSERT(rWith.ISA(CntBoolItem), "CntBoolItem::Compare(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntBoolItem* >(&rWith), "CntBoolItem::Compare(): Bad type");
return m_bValue == static_cast< CntBoolItem const * >(&rWith)->m_bValue ?
0 : m_bValue ? -1 : 1;
}
diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx
index 665bf2674e09..2eeb59ec5bd7 100644
--- a/svl/source/items/cintitem.cxx
+++ b/svl/source/items/cintitem.cxx
@@ -36,9 +36,6 @@
DBG_NAME(CntByteItem)
//============================================================================
-TYPEINIT1_AUTOFACTORY(CntByteItem, SfxPoolItem);
-
-//============================================================================
CntByteItem::CntByteItem(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
@@ -51,8 +48,7 @@ CntByteItem::CntByteItem(sal_uInt16 which, SvStream & rStream):
int CntByteItem::operator ==(const SfxPoolItem & rItem) const
{
DBG_CHKTHIS(CntByteItem, 0);
- DBG_ASSERT(rItem.ISA(CntByteItem),
- "CntByteItem::operator ==(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntByteItem* >(&rItem), "CntByteItem::operator ==(): Bad type");
return m_nValue == SAL_STATIC_CAST(const CntByteItem *, &rItem)->m_nValue;
}
@@ -61,7 +57,7 @@ int CntByteItem::operator ==(const SfxPoolItem & rItem) const
int CntByteItem::Compare(const SfxPoolItem & rWith) const
{
DBG_CHKTHIS(CntByteItem, 0);
- DBG_ASSERT(rWith.ISA(CntByteItem), "CntByteItem::Compare(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntByteItem* >(&rWith), "CntByteItem::Compare(): Bad type");
return SAL_STATIC_CAST(const CntByteItem *, &rWith)->m_nValue < m_nValue ?
-1 :
SAL_STATIC_CAST(const CntByteItem *, &rWith)->m_nValue
@@ -165,9 +161,6 @@ SfxFieldUnit CntByteItem::GetUnit() const
DBG_NAME(CntUInt16Item);
//============================================================================
-TYPEINIT1_AUTOFACTORY(CntUInt16Item, SfxPoolItem);
-
-//============================================================================
CntUInt16Item::CntUInt16Item(sal_uInt16 which, SvStream & rStream) :
SfxPoolItem(which)
{
@@ -182,8 +175,7 @@ CntUInt16Item::CntUInt16Item(sal_uInt16 which, SvStream & rStream) :
int CntUInt16Item::operator ==(const SfxPoolItem & rItem) const
{
DBG_CHKTHIS(CntUInt16Item, 0);
- DBG_ASSERT(rItem.ISA(CntUInt16Item),
- "CntUInt16Item::operator ==(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntUInt16Item* >(&rItem), "CntUInt16Item::operator ==(): Bad type");
return m_nValue == SAL_STATIC_CAST(const CntUInt16Item *, &rItem)->
m_nValue;
}
@@ -193,8 +185,7 @@ int CntUInt16Item::operator ==(const SfxPoolItem & rItem) const
int CntUInt16Item::Compare(const SfxPoolItem & rWith) const
{
DBG_CHKTHIS(CntUInt16Item, 0);
- DBG_ASSERT(rWith.ISA(CntUInt16Item),
- "CntUInt16Item::Compare(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntUInt16Item* >(&rWith), "CntUInt16Item::Compare(): Bad type");
return SAL_STATIC_CAST(const CntUInt16Item *, &rWith)->m_nValue
< m_nValue ?
-1 :
@@ -299,9 +290,6 @@ SfxFieldUnit CntUInt16Item::GetUnit() const
DBG_NAME(CntInt32Item);
//============================================================================
-TYPEINIT1_AUTOFACTORY(CntInt32Item, SfxPoolItem);
-
-//============================================================================
CntInt32Item::CntInt32Item(sal_uInt16 which, SvStream & rStream) :
SfxPoolItem(which)
{
@@ -316,8 +304,7 @@ CntInt32Item::CntInt32Item(sal_uInt16 which, SvStream & rStream) :
int CntInt32Item::operator ==(const SfxPoolItem & rItem) const
{
DBG_CHKTHIS(CntInt32Item, 0);
- DBG_ASSERT(rItem.ISA(CntInt32Item),
- "CntInt32Item::operator ==(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntInt32Item* >(&rItem), "CntInt32Item::operator ==(): Bad type");
return m_nValue == SAL_STATIC_CAST(const CntInt32Item *, &rItem)->
m_nValue;
}
@@ -327,7 +314,7 @@ int CntInt32Item::operator ==(const SfxPoolItem & rItem) const
int CntInt32Item::Compare(const SfxPoolItem & rWith) const
{
DBG_CHKTHIS(CntInt32Item, 0);
- DBG_ASSERT(rWith.ISA(CntInt32Item), "CntInt32Item::Compare(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntInt32Item* >(&rWith), "CntInt32Item::Compare(): Bad type");
return SAL_STATIC_CAST(const CntInt32Item *, &rWith)->m_nValue
< m_nValue ?
-1 :
@@ -430,9 +417,6 @@ SfxFieldUnit CntInt32Item::GetUnit() const
DBG_NAME(CntUInt32Item);
//============================================================================
-TYPEINIT1_AUTOFACTORY(CntUInt32Item, SfxPoolItem);
-
-//============================================================================
CntUInt32Item::CntUInt32Item(sal_uInt16 which, SvStream & rStream) :
SfxPoolItem(which)
{
@@ -447,8 +431,7 @@ CntUInt32Item::CntUInt32Item(sal_uInt16 which, SvStream & rStream) :
int CntUInt32Item::operator ==(const SfxPoolItem & rItem) const
{
DBG_CHKTHIS(CntUInt32Item, 0);
- DBG_ASSERT(rItem.ISA(CntUInt32Item),
- "CntUInt32Item::operator ==(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntUInt32Item* >(&rItem), "CntUInt32Item::operator ==(): Bad type");
return m_nValue == SAL_STATIC_CAST(const CntUInt32Item *, &rItem)->
m_nValue;
}
@@ -458,8 +441,7 @@ int CntUInt32Item::operator ==(const SfxPoolItem & rItem) const
int CntUInt32Item::Compare(const SfxPoolItem & rWith) const
{
DBG_CHKTHIS(CntUInt32Item, 0);
- DBG_ASSERT(rWith.ISA(CntUInt32Item),
- "CntUInt32Item::operator ==(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntUInt32Item* >(&rWith), "CntUInt32Item::operator ==(): Bad type");
return SAL_STATIC_CAST(const CntUInt32Item *, &rWith)->m_nValue
< m_nValue ?
-1 :
diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx
index 8b3b804d063f..57cb743fc374 100644
--- a/svl/source/items/cntwall.cxx
+++ b/svl/source/items/cntwall.cxx
@@ -34,8 +34,6 @@
#define CNTWALLPAPERITEM_STREAM_MAGIC ( (sal_uInt32)0xfefefefe )
#define CNTWALLPAPERITEM_STREAM_SEEKREL (-( (long)( sizeof( sal_uInt32 ) ) ) )
-TYPEINIT1( CntWallpaperItem, SfxPoolItem );
-
// -----------------------------------------------------------------------
CntWallpaperItem::CntWallpaperItem( sal_uInt16 which )
: SfxPoolItem( which ), _nColor( COL_TRANSPARENT ), _nStyle( 0 )
diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx
index ec9a4b723567..af48972e92b6 100644
--- a/svl/source/items/ctypeitm.cxx
+++ b/svl/source/items/ctypeitm.cxx
@@ -40,8 +40,6 @@
//
//============================================================================
-TYPEINIT1_AUTOFACTORY( CntContentTypeItem, CntUnencodedStringItem );
-
#define CONTENT_TYPE_NOT_INIT ( (INetContentType)-1 )
//----------------------------------------------------------------------------
diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx
index 3ba62ad3d819..be45bdaa7477 100644
--- a/svl/source/items/custritm.cxx
+++ b/svl/source/items/custritm.cxx
@@ -38,15 +38,11 @@
DBG_NAME(CntUnencodedStringItem)
//============================================================================
-TYPEINIT1_AUTOFACTORY(CntUnencodedStringItem, SfxPoolItem)
-
-//============================================================================
// virtual
int CntUnencodedStringItem::operator ==(const SfxPoolItem & rItem) const
{
DBG_CHKTHIS(CntUnencodedStringItem, 0);
- DBG_ASSERT(rItem.ISA(CntUnencodedStringItem),
- "CntUnencodedStringItem::operator ==(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntUnencodedStringItem* >(&rItem), "CntUnencodedStringItem::operator ==(): Bad type");
return m_aValue
== SAL_STATIC_CAST(const CntUnencodedStringItem *, &rItem)->
m_aValue;
@@ -58,8 +54,7 @@ int CntUnencodedStringItem::Compare(SfxPoolItem const & rWith) const
{
DBG_ERROR("CntUnencodedStringItem::Compare(): No international");
DBG_CHKTHIS(CntUnencodedStringItem, 0);
- DBG_ASSERT(rWith.ISA(CntUnencodedStringItem),
- "CntUnencodedStringItem::Compare(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntUnencodedStringItem* >(&rWith), "CntUnencodedStringItem::Compare(): Bad type");
switch (m_aValue.CompareTo(static_cast< CntUnencodedStringItem const * >(
&rWith)->
m_aValue))
@@ -82,8 +77,7 @@ int CntUnencodedStringItem::Compare(SfxPoolItem const & rWith,
const
{
DBG_CHKTHIS(CntUnencodedStringItem, 0);
- DBG_ASSERT(rWith.ISA(CntUnencodedStringItem),
- "CntUnencodedStringItem::Compare(): Bad type");
+ DBG_ASSERT(dynamic_cast< const CntUnencodedStringItem* >(&rWith), "CntUnencodedStringItem::Compare(): Bad type");
return rIntlWrapper.getCollator()->compareString( m_aValue,
static_cast< CntUnencodedStringItem const * >(&rWith)->m_aValue );
}
diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx
index edb0779d47a1..e8c091b9d641 100644
--- a/svl/source/items/dateitem.cxx
+++ b/svl/source/items/dateitem.cxx
@@ -48,10 +48,6 @@ DBG_NAME(SfxDateTimeItem)
// -----------------------------------------------------------------------
-TYPEINIT1(SfxDateTimeItem, SfxPoolItem);
-
-// -----------------------------------------------------------------------
-
SfxDateTimeItem::SfxDateTimeItem( sal_uInt16 which ) :
SfxPoolItem( which )
{
@@ -209,11 +205,6 @@ sal_Bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal,
}
// -----------------------------------------------------------------------
-// -----------------------------------------------------------------------
-// -----------------------------------------------------------------------
-
-TYPEINIT1(SfxColumnDateTimeItem, SfxDateTimeItem);
-
SfxColumnDateTimeItem::SfxColumnDateTimeItem( sal_uInt16 which ) :
SfxDateTimeItem( which )
diff --git a/svl/source/items/eitem.cxx b/svl/source/items/eitem.cxx
index 75bbcafdcf18..0a947d03cd4b 100644
--- a/svl/source/items/eitem.cxx
+++ b/svl/source/items/eitem.cxx
@@ -30,14 +30,12 @@
//
//============================================================================
-TYPEINIT1(SfxEnumItem, CntEnumItem);
-
//============================================================================
//
// class SfxBoolItem
//
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxBoolItem, CntBoolItem);
-
+IMPL_POOLITEM_FACTORY(SfxBoolItem)
+// eof
diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx
index 5e5e680824c4..c1af8abc2f53 100644
--- a/svl/source/items/flagitem.cxx
+++ b/svl/source/items/flagitem.cxx
@@ -43,10 +43,6 @@ sal_uInt16 nSfxFlagVal[16] =
// -----------------------------------------------------------------------
-TYPEINIT1(SfxFlagItem, SfxPoolItem);
-
-// -----------------------------------------------------------------------
-
SfxFlagItem::SfxFlagItem( sal_uInt16 nW, sal_uInt16 nV ) :
SfxPoolItem( nW ),
nVal(nV)
diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx
index 4ceb1f658a2e..afcafc558182 100644
--- a/svl/source/items/globalnameitem.cxx
+++ b/svl/source/items/globalnameitem.cxx
@@ -35,10 +35,7 @@
// STATIC DATA -----------------------------------------------------------
-
-// -----------------------------------------------------------------------
-
-TYPEINIT1_AUTOFACTORY(SfxGlobalNameItem, SfxPoolItem);
+IMPL_POOLITEM_FACTORY(SfxGlobalNameItem)
// -----------------------------------------------------------------------
diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx
index c753df89bed5..9555360a063f 100644
--- a/svl/source/items/ilstitem.cxx
+++ b/svl/source/items/ilstitem.cxx
@@ -33,7 +33,7 @@
#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
-TYPEINIT1_AUTOFACTORY(SfxIntegerListItem, SfxPoolItem);
+IMPL_POOLITEM_FACTORY(SfxIntegerListItem)
SfxIntegerListItem::SfxIntegerListItem()
{
@@ -59,7 +59,7 @@ SfxIntegerListItem::~SfxIntegerListItem()
int SfxIntegerListItem::operator==( const SfxPoolItem& rPoolItem ) const
{
- if ( !rPoolItem.ISA( SfxIntegerListItem ) )
+ if ( !dynamic_cast< const SfxIntegerListItem* >(&rPoolItem) )
return sal_False;
const SfxIntegerListItem rItem = (const SfxIntegerListItem&) rPoolItem;
diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx
index 75afb55e3a9f..1a1ca595bbd3 100644
--- a/svl/source/items/imageitm.cxx
+++ b/svl/source/items/imageitm.cxx
@@ -27,8 +27,6 @@
#include <svl/imageitm.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-TYPEINIT1( SfxImageItem, SfxInt16Item );
-
struct SfxImageItem_Impl
{
String aURL;
diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx
index 5fce400d32b8..e8567f0e35b7 100644
--- a/svl/source/items/intitem.cxx
+++ b/svl/source/items/intitem.cxx
@@ -36,9 +36,8 @@
//
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxByteItem, CntByteItem);
+IMPL_POOLITEM_FACTORY(SfxByteItem)
-//============================================================================
// virtual
SfxPoolItem * SfxByteItem::Create(SvStream & rStream, sal_uInt16) const
{
@@ -53,12 +52,10 @@ SfxPoolItem * SfxByteItem::Create(SvStream & rStream, sal_uInt16) const
//
//============================================================================
+IMPL_POOLITEM_FACTORY(SfxInt16Item)
DBG_NAME(SfxInt16Item);
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxInt16Item, SfxPoolItem);
-
-//============================================================================
SfxInt16Item::SfxInt16Item(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
@@ -180,8 +177,7 @@ SfxFieldUnit SfxInt16Item::GetUnit() const
//
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxUInt16Item, CntUInt16Item);
-
+IMPL_POOLITEM_FACTORY(SfxUInt16Item)
//============================================================================
//
@@ -189,8 +185,7 @@ TYPEINIT1_AUTOFACTORY(SfxUInt16Item, CntUInt16Item);
//
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxInt32Item, CntInt32Item);
-
+IMPL_POOLITEM_FACTORY(SfxInt32Item)
//============================================================================
//
@@ -198,8 +193,7 @@ TYPEINIT1_AUTOFACTORY(SfxInt32Item, CntInt32Item);
//
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxUInt32Item, CntUInt32Item);
-
+IMPL_POOLITEM_FACTORY(SfxUInt32Item)
//============================================================================
//
@@ -210,9 +204,6 @@ TYPEINIT1_AUTOFACTORY(SfxUInt32Item, CntUInt32Item);
DBG_NAME(SfxMetricItem);
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxMetricItem, SfxInt32Item);
-
-//============================================================================
SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_uInt32 nValue):
SfxInt32Item(which, nValue)
{
@@ -235,20 +226,19 @@ SfxMetricItem::SfxMetricItem(const SfxMetricItem & rItem):
//============================================================================
// virtual
-int SfxMetricItem::ScaleMetrics(long nMult, long nDiv)
+void SfxMetricItem::ScaleMetrics(long nMult, long nDiv)
{
BigInt aTheValue(GetValue());
aTheValue *= nMult;
aTheValue += nDiv / 2;
aTheValue /= nDiv;
SetValue(aTheValue);
- return 1;
}
//============================================================================
// virtual
-int SfxMetricItem::HasMetrics() const
+bool SfxMetricItem::HasMetrics() const
{
- return 1;
+ return true;
}
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index cdd195076212..8e663d91ac20 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -34,6 +34,8 @@
#include <svl/brdcst.hxx>
#include <svl/smplhint.hxx>
#include "poolio.hxx"
+#include <algorithm>
+#include <typeinfo>
//========================================================================
@@ -70,7 +72,7 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const
// -----------------------------------------------------------------------
-inline FASTBOOL SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const
+inline bool SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const
{
sal_uInt16 nItemFlag = pItemInfos[nPos]._nFlags;
return nFlag == (nItemFlag & nFlag);
@@ -78,7 +80,7 @@ inline FASTBOOL SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag
// -----------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const
+bool SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const
{
for ( const SfxItemPool *pPool = this; pPool; pPool = pPool->pSecondary )
{
@@ -114,7 +116,7 @@ SfxItemPool::SfxItemPool
#ifndef TF_POOLABLE
sal_uInt16* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */
#endif
- FASTBOOL bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */
+ bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */
)
/* [Beschreibung]
@@ -175,7 +177,7 @@ SfxItemPool::SfxItemPool
pImp->nInitRefCount = 1;
pImp->nVerStart = nStart;
pImp->nVerEnd = nEnd;
- pImp->bInSetItem = sal_False;
+ pImp->bInSetItem = false;
pImp->nStoringStart = nStartWhich;
pImp->nStoringEnd = nEndWhich;
@@ -229,12 +231,12 @@ SfxItemPool::SfxItemPool
DBG_CTOR(SfxItemPool, 0);
pImp->eDefMetric = rPool.pImp->eDefMetric;
pImp->nVersion = rPool.pImp->nVersion;
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
pImp->nLoadingVersion = 0;
pImp->nInitRefCount = 1;
pImp->nVerStart = rPool.pImp->nVerStart;
pImp->nVerEnd = rPool.pImp->nVerEnd;
- pImp->bInSetItem = sal_False;
+ pImp->bInSetItem = false;
pImp->nStoringStart = nStart;
pImp->nStoringEnd = nEnd;
@@ -437,12 +439,12 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
if ( pImp->ppPoolItems && pSecondary->pImp->ppPoolItems )
{
// hat der master SetItems?
- sal_Bool bHasSetItems = sal_False;
+ bool bHasSetItems = false;
for ( sal_uInt16 i = 0; !bHasSetItems && i < nEnd-nStart; ++i )
- bHasSetItems = ppStaticDefaults[i]->ISA(SfxSetItem);
+ bHasSetItems = dynamic_cast< SfxSetItem* >(ppStaticDefaults[i]);
// abgehaengte Pools muessen leer sein
- sal_Bool bOK = bHasSetItems;
+ bool bOK = bHasSetItems;
for ( sal_uInt16 n = 0;
bOK && n <= pSecondary->nEnd - pSecondary->nStart;
++n )
@@ -456,7 +458,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
if ( !(*ppHtArr) )
{
DBG_ERROR( "old secondary pool must be empty" );
- bOK = sal_False;
+ bOK = false;
break;
}
}
@@ -574,7 +576,7 @@ void SfxItemPool::Delete()
// KSO (22.10.98): *ppStaticDefaultItem kann im dtor einer
// von SfxItemPool abgeleiteten Klasse bereits geloescht worden
// sein! -> CHAOS Itempool
- if ( *ppStaticDefaultItem && (*ppStaticDefaultItem)->ISA(SfxSetItem) )
+ if ( *ppStaticDefaultItem && dynamic_cast< SfxSetItem* >(*ppStaticDefaultItem) )
{
if ( *ppItemArr )
{
@@ -656,8 +658,8 @@ void SfxItemPool::Cleanup()
{
//Fuer jedes Item gibt es entweder ein Default oder ein static Default!
if ( *ppItemArr &&
- ((*ppDefaultItem && (*ppDefaultItem)->ISA(SfxSetItem)) ||
- (*ppStaticDefaultItem)->ISA(SfxSetItem)) )
+ ((*ppDefaultItem && dynamic_cast< SfxSetItem* >(*ppDefaultItem)) ||
+ dynamic_cast< SfxSetItem* >(*ppStaticDefaultItem)) )
{
SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin();
for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr )
@@ -740,7 +742,7 @@ void SfxItemPool::ResetPoolDefaultItem( sal_uInt16 nWhichId )
const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
{
- DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(&rItem) ||
0 != &((const SfxSetItem&)rItem).GetItemSet(),
"SetItem without ItemSet" );
@@ -771,8 +773,16 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
return *pPoolItem;
}
- SFX_ASSERT( rItem.IsA(GetDefaultItem(nWhich).Type()), nWhich,
- "SFxItemPool: wrong item type in Put" );
+#ifdef DBG_UTIL
+ const SfxPoolItem& rDefaultItem = GetDefaultItem(nWhich);
+ const std::type_info& aTypeA(typeid(rItem));
+ const std::type_info& aTypeB(typeid(rDefaultItem));
+
+ if(aTypeA != aTypeB)
+ {
+ SFX_ASSERT(false, nWhich, "SFxItemPool: wrong item type in Put");
+ }
+#endif
SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems + nIndex;
if( !*ppItemArr )
@@ -840,9 +850,16 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
SfxPoolItem* pNewItem = rItem.Clone(pMaster);
pNewItem->SetWhich(nWhich);
#ifdef DBG_UTIL
- SFX_ASSERT( rItem.Type() == pNewItem->Type(), nWhich, "unequal types in Put(): no Clone()?" )
+ const std::type_info& aTypeC(typeid(rItem));
+ const std::type_info& aTypeD(typeid(*pNewItem));
+
+ if(aTypeC != aTypeD)
+ {
+// SFX_ASSERT( typeid(&rItem) == typeid(pNewItem), nWhich, "unequal types in Put(): no Clone()?" )
+ SFX_ASSERT(false, nWhich, "unequal types in Put(): no Clone()?")
+ }
#ifdef TF_POOLABLE
- if ( !rItem.ISA(SfxSetItem) )
+ if ( !dynamic_cast< const SfxSetItem* >(&rItem) )
{
SFX_ASSERT( !IsItemFlag(nWhich, SFX_ITEM_POOLABLE) ||
rItem == *pNewItem,
@@ -871,7 +888,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem )
{
DBG_CHKTHIS(SfxItemPool, 0);
- DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(&rItem) ||
0 != &((const SfxSetItem&)rItem).GetItemSet(),
"SetItem without ItemSet" );
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 762464798da6..3b972febc02a 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -111,7 +111,7 @@ SfxItemSet::SfxItemSet
SfxItemPool& rPool, /* der Pool, in dem die SfxPoolItems,
welche in dieses SfxItemSet gelangen,
aufgenommen werden sollen */
- sal_Bool
+ bool
#ifdef DBG_UTIL
#ifdef SFX_ITEMSET_NO_DEFAULT_CTOR
@@ -466,7 +466,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich )
// -----------------------------------------------------------------------
-void SfxItemSet::ClearInvalidItems( sal_Bool bHardDefault )
+void SfxItemSet::ClearInvalidItems( bool bHardDefault )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
sal_uInt16* pPtr = _pWhichRanges;
@@ -508,7 +508,7 @@ void SfxItemSet::InvalidateAllItems()
// -----------------------------------------------------------------------
SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich,
- sal_Bool bSrchInParent,
+ bool bSrchInParent,
const SfxPoolItem **ppItem ) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
@@ -539,14 +539,14 @@ SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich,
// Unterschiedlich vorhanden
return SFX_ITEM_DONTCARE;
- if ( (*ppFnd)->Type() == TYPE(SfxVoidItem) )
+ if ( dynamic_cast< const SfxVoidItem* >(*ppFnd))
return SFX_ITEM_DISABLED;
if (ppItem)
{
#ifdef DBG_UTIL
const SfxPoolItem *pItem = *ppFnd;
- DBG_ASSERT( !pItem->ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(pItem) ||
0 != &((const SfxSetItem*)pItem)->GetItemSet(),
"SetItem without ItemSet" );
#endif
@@ -567,7 +567,7 @@ SfxItemState SfxItemSet::GetItemState( sal_uInt16 nWhich,
const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
- DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(&rItem) ||
0 != &((const SfxSetItem&)rItem).GetItemSet(),
"SetItem without ItemSet" );
if ( !nWhich )
@@ -634,7 +634,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
}
}
SFX_ASSERT( !_pPool->IsItemFlag(nWhich, SFX_ITEM_POOLABLE) ||
- rItem.ISA(SfxSetItem) || **ppFnd == rItem,
+ dynamic_cast< const SfxSetItem* >(&rItem) || **ppFnd == rItem,
nWhich, "putted Item unequal" );
InvalidateHashKey(); //i120575
@@ -649,10 +649,10 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
// -----------------------------------------------------------------------
-int SfxItemSet::Put( const SfxItemSet& rSet, sal_Bool bInvalidAsDefault )
+bool SfxItemSet::Put( const SfxItemSet& rSet, bool bInvalidAsDefault )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if( rSet.Count() )
{
SfxItemArray ppFnd = rSet._aItems;
@@ -778,7 +778,7 @@ void SfxItemSet::MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo )
{
// special case: exactly one sal_uInt16 which is already included?
- if ( nFrom == nTo && SFX_ITEM_AVAILABLE <= GetItemState(nFrom, sal_False) )
+ if ( nFrom == nTo && SFX_ITEM_AVAILABLE <= GetItemState(nFrom, false) )
return;
// merge new range
@@ -824,7 +824,7 @@ void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges )
for ( sal_uInt16 nWID = *pRange; nWID <= pRange[1]; ++nWID, ++n )
{
// direct move of pointer (not via pool)
- SfxItemState eState = GetItemState( nWID, sal_False, aNewItems+n );
+ SfxItemState eState = GetItemState( nWID, false, aNewItems+n );
if ( SFX_ITEM_SET == eState )
{
// increment new item count and possibly increment ref count
@@ -882,17 +882,17 @@ void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges )
// -----------------------------------------------------------------------
-int SfxItemSet::Set
+bool SfxItemSet::Set
(
const SfxItemSet& rSet, /* das SfxItemSet, dessen SfxPoolItems
"ubernommen werden sollen */
- sal_Bool bDeep /* sal_True (default)
+ bool bDeep /* true (default)
auch die SfxPoolItems aus den ggf. an
rSet vorhandenen Parents werden direkt
in das SfxItemSet "ubernommen
- sal_False
+ false
die SfxPoolItems aus den Parents von
rSet werden nicht ber"ucksichtigt */
)
@@ -911,10 +911,10 @@ int SfxItemSet::Set
[R"uckgabewert]
- int sal_True
+ bool true
es wurden SfxPoolItems "ubernommen
- sal_False
+ false
es wurden keine SfxPoolItems "ubernommen,
da z.B. die Which-Bereiche der SfxItemSets
keine Schnittmenge haben oder in der
@@ -925,7 +925,7 @@ int SfxItemSet::Set
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
- int bRet = sal_False;
+ bool bRet = false;
if ( _nCount )
ClearItem();
if ( bDeep )
@@ -935,13 +935,13 @@ int SfxItemSet::Set
while ( nWhich )
{
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == rSet.GetItemState( nWhich, sal_True, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( nWhich, true, &pItem ) )
bRet |= 0 != Put( *pItem, pItem->Which() );
nWhich = aIter.NextWhich();
}
}
else
- bRet = Put(rSet, sal_False);
+ bRet = Put(rSet, false);
return bRet;
}
@@ -951,8 +951,7 @@ int SfxItemSet::Set
const SfxPoolItem* SfxItemSet::GetItem
(
sal_uInt16 nId, // Slot-Id oder Which-Id des Items
- sal_Bool bSrchInParent, // sal_True: auch in Parent-ItemSets suchen
- TypeId aItemType // != 0 => RTTI Pruefung mit Assertion
+ bool bSrchInParent // true: auch in Parent-ItemSets suchen
) const
/* [Beschreibung]
@@ -976,25 +975,15 @@ const SfxPoolItem* SfxItemSet::GetItem
if ( bSrchInParent && SFX_ITEM_AVAILABLE == eState &&
nWhich <= SFX_WHICH_MAX )
pItem = &_pPool->GetDefaultItem(nWhich);
- if ( pItem )
- {
- // stimmt der Typ "uberein?
- if ( !aItemType || pItem->IsA(aItemType) )
- return pItem;
-
- // sonst Fehler melden
- DBG_ERROR( "invalid argument type" );
- }
- // kein Item gefunden oder falschen Typ gefunden
- return 0;
+ return pItem;
}
//------------------------------------------------------------------------
-const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, sal_Bool bSrchInParent) const
+const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, bool bSrchInParent) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
// suche den Bereich in dem das Which steht:
@@ -1022,10 +1011,10 @@ const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, sal_Bool bSrchInParent) c
}
#ifdef DBG_UTIL
const SfxPoolItem *pItem = *ppFnd;
- DBG_ASSERT( !pItem->ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(pItem) ||
0 != &((const SfxSetItem*)pItem)->GetItemSet(),
"SetItem without ItemSet" );
- if ( pItem->ISA(SfxVoidItem) || !pItem->Which() )
+ if ( dynamic_cast< const SfxVoidItem* >(pItem) || !pItem->Which() )
DBG_WARNING( "SFX_WARNING: Getting disabled Item" );
#endif
return **ppFnd;
@@ -1044,7 +1033,7 @@ const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, sal_Bool bSrchInParent) c
// dann das Default vom Pool holen und returnen
SFX_ASSERT(_pPool, nWhich, "kein Pool, aber Status uneindeutig");
const SfxPoolItem *pItem = &_pPool->GetDefaultItem( nWhich );
- DBG_ASSERT( !pItem->ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(pItem) ||
0 != &((const SfxSetItem*)pItem)->GetItemSet(),
"SetItem without ItemSet" );
return *pItem;
@@ -1144,7 +1133,7 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
sal_uInt16 nWhich = IsInvalidItem( pItem )
? GetWhichByPos( aIter.GetCurPos() )
: pItem->Which();
- if( 0 == rSet.GetItemState( nWhich, sal_False ) )
+ if( 0 == rSet.GetItemState( nWhich, false ) )
ClearItem( nWhich ); // loeschen
if( aIter.IsAtEnd() )
break;
@@ -1216,7 +1205,7 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet )
sal_uInt16 nWhich = IsInvalidItem( pItem )
? GetWhichByPos( aIter.GetCurPos() )
: pItem->Which();
- if( SFX_ITEM_SET == rSet.GetItemState( nWhich, sal_False ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( nWhich, false ) )
ClearItem( nWhich ); // loeschen
if( aIter.IsAtEnd() )
break;
@@ -1309,7 +1298,7 @@ unknown unknown != sal_True - - -
static void MergeItem_Impl( SfxItemPool *_pPool, sal_uInt16 &rCount,
const SfxPoolItem **ppFnd1, const SfxPoolItem *pFnd2,
- sal_Bool bIgnoreDefaults )
+ bool bIgnoreDefaults )
{
DBG_ASSERT( ppFnd1 != 0, "Merging to 0-Item" );
@@ -1374,7 +1363,7 @@ static void MergeItem_Impl( SfxItemPool *_pPool, sal_uInt16 &rCount,
// -----------------------------------------------------------------------
-void SfxItemSet::MergeValues( const SfxItemSet& rSet, sal_Bool bIgnoreDefaults )
+void SfxItemSet::MergeValues( const SfxItemSet& rSet, bool bIgnoreDefaults )
{
// Achtung!!! Bei Aenderungen/Bugfixes immer obenstehende Tabelle pflegen!
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
@@ -1414,7 +1403,7 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, sal_Bool bIgnoreDefaults )
while( 0 != ( nWhich = aIter.NextWhich() ) )
{
const SfxPoolItem* pItem = 0;
- rSet.GetItemState( nWhich, sal_True, &pItem );
+ rSet.GetItemState( nWhich, true , &pItem );
if( !pItem )
{
// nicht gesetzt, also default
@@ -1433,7 +1422,7 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, sal_Bool bIgnoreDefaults )
// -----------------------------------------------------------------------
-void SfxItemSet::MergeValue( const SfxPoolItem& rAttr, sal_Bool bIgnoreDefaults )
+void SfxItemSet::MergeValue( const SfxPoolItem& rAttr, bool bIgnoreDefaults )
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
SfxItemArray ppFnd = _aItems;
@@ -1512,14 +1501,14 @@ sal_uInt16 SfxItemSet::GetWhichByPos( sal_uInt16 nPos ) const
SvStream &SfxItemSet::Store
(
- SvStream& rStream, // Zielstream f"ur normale Items
- FASTBOOL bDirect // sal_True: Items direkt speicher, sal_False: Surrogate
+ SvStream& rStream, // Zielstream f"ur normale Items
+ bool bDirect // true: Items direkt speicher, sal_False: Surrogate
) const
/* [Beschreibung]
Speichert die <SfxItemSet>-Instanz in den angegebenen Stream. Dabei
- werden die Surrorage der gesetzten <SfxPoolItem>s bzw. ('bDirect==sal_True')
+ werden die Surrorage der gesetzten <SfxPoolItem>s bzw. ('bDirect==true')
die gesetzten Items selbst wie folgt im Stream abgelegt:
sal_uInt16 (Count) Anzahl der gesetzten Items
@@ -1580,11 +1569,11 @@ SvStream &SfxItemSet::Load
(
SvStream& rStream, // Stream, aus dem geladen werden soll
- FASTBOOL bDirect, /* sal_True
+ bool bDirect, /* true
Items werden direkt aus dem Stream
gelesen, nicht "uber Surrogate
- sal_False (default)
+ false (default)
Items werden "uber Surrogate gelesen */
const SfxItemPool* pRefPool /* Pool, der die Surrogate aufl"osen kann
@@ -1655,7 +1644,7 @@ SvStream &SfxItemSet::Load
// -----------------------------------------------------------------------
-int SfxItemSet::operator==(const SfxItemSet &rCmp) const
+bool SfxItemSet::operator==(const SfxItemSet &rCmp) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
DBG_CHKOBJ(&rCmp, SfxItemSet, DbgCheckItemSet);
@@ -1664,13 +1653,13 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const
if ( _pParent != rCmp._pParent ||
_pPool != rCmp._pPool ||
Count() != rCmp.Count() )
- return sal_False;
+ return false;
// Ranges durchzaehlen lassen dauert laenger, muss aber auch gleich sein
sal_uInt16 nCount1 = TotalCount();
sal_uInt16 nCount2 = rCmp.TotalCount();
if ( nCount1 != nCount2 )
- return sal_False;
+ return false;
// sind die Ranges selbst ungleich?
for ( sal_uInt16 nRange = 0; _pWhichRanges[nRange]; nRange += 2 )
@@ -1686,21 +1675,21 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const
// wenn die Pointer von poolable Items ungleich sind,
// muessen die Items gleich sein
const SfxPoolItem *pItem1 = 0, *pItem2 = 0;
- if ( GetItemState( nWh, sal_False, &pItem1 ) !=
- rCmp.GetItemState( nWh, sal_False, &pItem2 ) ||
+ if ( GetItemState( nWh, false , &pItem1 ) !=
+ rCmp.GetItemState( nWh, false , &pItem2 ) ||
( pItem1 != pItem2 &&
( !pItem1 || IsInvalidItem(pItem1) ||
( _pPool->IsItemFlag(*pItem1, SFX_ITEM_POOLABLE) &&
*pItem1 != *pItem2 ) ) ) )
- return sal_False;
+ return false;
}
- return sal_True;
+ return true;
}
// Pointer alle gleich?
if ( 0 == memcmp( _aItems, rCmp._aItems, nCount1 * sizeof(_aItems[0]) ) )
- return sal_True;
+ return true;
// dann werden wir wohl alle einzeln vergleichen muessen
const SfxPoolItem **ppItem1 = (const SfxPoolItem**) _aItems;
@@ -1714,18 +1703,18 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const
( IsInvalidItem(*ppItem1) || IsInvalidItem(*ppItem2) ) ||
( _pPool->IsItemFlag(**ppItem1, SFX_ITEM_POOLABLE) ) ||
**ppItem1 != **ppItem2 ) )
- return sal_False;
+ return false;
++ppItem1;
++ppItem2;
}
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
-SfxItemSet *SfxItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
+SfxItemSet *SfxItemSet::Clone(bool bItems, SfxItemPool *pToPool ) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
if ( pToPool && pToPool != _pPool )
@@ -1738,7 +1727,7 @@ SfxItemSet *SfxItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
while ( nWhich )
{
const SfxPoolItem* pItem;
- if ( SFX_ITEM_SET == GetItemState( nWhich, sal_False, &pItem ) )
+ if ( SFX_ITEM_SET == GetItemState( nWhich, false , &pItem ) )
pNewSet->Put( *pItem, pItem->Which() );
nWhich = aIter.NextWhich();
}
@@ -1753,7 +1742,7 @@ SfxItemSet *SfxItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
// -----------------------------------------------------------------------
-int SfxItemSet::PutDirect(const SfxPoolItem &rItem)
+bool SfxItemSet::PutDirect(const SfxPoolItem &rItem)
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
SfxItemArray ppFnd = _aItems;
@@ -1773,7 +1762,7 @@ int SfxItemSet::PutDirect(const SfxPoolItem &rItem)
if( pOld ) // schon einer vorhanden
{
if( rItem == **ppFnd )
- return sal_False; // schon vorhanden !
+ return false; // schon vorhanden !
_pPool->Remove( *pOld );
}
else
@@ -1790,12 +1779,12 @@ int SfxItemSet::PutDirect(const SfxPoolItem &rItem)
}
InvalidateHashKey(); //i120575
- return sal_True;
+ return true;
}
ppFnd += *(pPtr+1) - *pPtr + 1;
pPtr += 2;
}
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
@@ -2042,7 +2031,7 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhi
Put-Methoden dieser SubClass gehided wird.
*/
-int SfxAllItemSet::Put( const SfxItemSet& rSet, sal_Bool bInvalidAsDefault )
+bool SfxAllItemSet::Put( const SfxItemSet& rSet, bool bInvalidAsDefault )
{
//? pruefen, ob Which-Ranges erweitert werden
return SfxItemSet::Put( rSet, bInvalidAsDefault );
@@ -2126,7 +2115,7 @@ sal_Bool SfxAllItemSet::Remove(sal_uInt16 nWhich)
// -----------------------------------------------------------------------
-SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const
+SfxItemSet *SfxAllItemSet::Clone(bool bItems, SfxItemPool *pToPool ) const
{
DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet);
if ( pToPool && pToPool != _pPool )
diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx
index 448085f61a98..50aabe258ee7 100644
--- a/svl/source/items/lckbitem.cxx
+++ b/svl/source/items/lckbitem.cxx
@@ -33,10 +33,7 @@
// STATIC DATA -----------------------------------------------------------
-
-// -----------------------------------------------------------------------
-
-TYPEINIT1_AUTOFACTORY(SfxLockBytesItem, SfxPoolItem);
+IMPL_POOLITEM_FACTORY(SfxLockBytesItem)
// -----------------------------------------------------------------------
diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx
index 9a8ea599dbe4..c0df380375e6 100644
--- a/svl/source/items/macitem.cxx
+++ b/svl/source/items/macitem.cxx
@@ -36,11 +36,6 @@ DBG_NAME(SvxMacroItem);
// -----------------------------------------------------------------------
-TYPEINIT1_FACTORY(SvxMacroItem, SfxPoolItem, new SvxMacroItem(0));
-
-// -----------------------------------------------------------------------
-
-
SjJSbxObjectBase::~SjJSbxObjectBase()
{
}
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 96def5bcfd1b..1fc2c1956666 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -146,7 +146,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
pStoreMaster = pStoreMaster->pSecondary;
// Alter-Header (Version des Pools an sich und Inhalts-Version 0xffff)
- pImp->bStreaming = sal_True;
+ pImp->bStreaming = true;
if ( !pStoreMaster )
{
rStream << ( rStream.GetVersion() >= SOFFICE_FILEFORMAT_50
@@ -198,7 +198,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
SfxMultiMixRecordWriter aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS, 0 );
// erst Atomaren-Items und dann die Sets schreiben (wichtig beim Laden)
- for ( pImp->bInSetItem = sal_False; pImp->bInSetItem <= sal_True && !rStream.GetError(); ++pImp->bInSetItem )
+ for ( pImp->bInSetItem = false; pImp->bInSetItem <= (int)true && !rStream.GetError(); ++pImp->bInSetItem )
{
SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems;
SfxPoolItem **ppDefItem = ppStaticDefaults;
@@ -218,7 +218,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
#else
if ( *pArr && (*ppDefItem)->IsPoolable() &&
#endif
- pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) )
+ pImp->bInSetItem == (0 != dynamic_cast<const SfxSetItem*>(*ppDefItem)) )
{
// eigene Kennung, globale Which-Id und Item-Version
sal_uInt16 nSlotId = GetSlotId( (*ppDefItem)->Which(), sal_False );
@@ -253,7 +253,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
else
break;
#ifdef DBG_UTIL_MI
- if ( !pItem->ISA(SfxSetItem) )
+ if ( !dynamic_cast< SfxSetItem* >(pItem) )
{
sal_uLong nMark = rStream.Tell();
rStream.Seek( nItemStartPos + sizeof(sal_uInt16) );
@@ -270,7 +270,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
}
}
- pImp->bInSetItem = sal_False;
+ pImp->bInSetItem = false;
}
// die gesetzten Defaults speichern (Pool-Defaults)
@@ -307,7 +307,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
if ( !rStream.GetError() && pSecondary )
pSecondary->Store( rStream );
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -355,7 +355,7 @@ void SfxItemPool::LoadCompleted()
{
#ifdef DBG_UTIL
const SfxPoolItem &rItem = **ppHtArr;
- DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(&rItem) ||
0 != &((const SfxSetItem&)rItem).GetItemSet(),
"SetItem without ItemSet" );
#endif
@@ -503,7 +503,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
{
#ifdef DBG_UTIL
const SfxPoolItem &rItem = **ppHtArr;
- DBG_ASSERT( !rItem.ISA(SfxSetItem) ||
+ DBG_ASSERT( !dynamic_cast< const SfxSetItem* >(&rItem) ||
0 != &((const SfxSetItem&)rItem).GetItemSet(),
"SetItem without ItemSet" );
DBG_WARNING( "loading non-empty ItemPool" );
@@ -524,7 +524,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
pLoadMaster = pLoadMaster->pSecondary;
// Gesamt Header einlesen
- pImp->bStreaming = sal_True;
+ pImp->bStreaming = true;
if ( !pLoadMaster )
{
// Format-Version laden
@@ -545,7 +545,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( pImp->nMajorVer > SFX_ITEMPOOL_VER_MAJOR )
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -558,7 +558,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
SfxMiniRecordReader aPoolRec( &rStream, SFX_ITEMPOOL_REC );
if ( rStream.GetError() )
{
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -570,7 +570,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER );
if ( rStream.GetError() )
{
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -584,7 +584,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
aPoolRec.Skip();
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
}
@@ -594,7 +594,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
SfxMultiRecordReader aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP );
if ( rStream.GetError() )
{
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -622,7 +622,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
}
// Items laden
- FASTBOOL bSecondaryLoaded = sal_False;
+ bool bSecondaryLoaded = false;
long nSecondaryEnd = 0;
{
SfxMultiRecordReader aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS);
@@ -653,7 +653,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// SfxSetItems k"onnten Items aus Sekund"arpools beinhalten
SfxPoolItem *pDefItem = *(ppStaticDefaults + nIndex);
- pImp->bInSetItem = pDefItem->ISA(SfxSetItem);
+ pImp->bInSetItem = (0 != dynamic_cast< const SfxSetItem* >(pDefItem));
if ( !bSecondaryLoaded && pSecondary && pImp->bInSetItem )
{
// an das Ende des eigenen Pools seeken
@@ -662,7 +662,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// Sekund"arpool einlesen
pSecondary->Load( rStream );
- bSecondaryLoaded = sal_True;
+ bSecondaryLoaded = true;
nSecondaryEnd = rStream.Tell();
// zur"uck zu unseren eigenen Items
@@ -672,7 +672,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// Items an sich lesen
readTheItems(rStream, nCount, nVersion, pDefItem, ppArr);
- pImp->bInSetItem = sal_False;
+ pImp->bInSetItem = false;
}
}
@@ -721,7 +721,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( aExternName != aName )
aName.Erase();
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
};
@@ -743,13 +743,13 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
rStream >> pImp->nLoadingVersion;
SfxPoolItem::readByteString(rStream, aExternName);
bOwnPool = aExternName == aName;
- pImp->bStreaming = sal_True;
+ pImp->bStreaming = true;
//! solange wir keine fremden laden k"onnen
if ( !bOwnPool )
{
rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -758,7 +758,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
pImp->nVersion < pImp->nLoadingVersion )
{
rStream.SetError(ERRCODE_IO_WRONGVERSION);
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -816,7 +816,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
// Items laden
rStream.Seek( nStartPos );
CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_ITEMS );
- FASTBOOL bSecondaryLoaded = sal_False;
+ bool bSecondaryLoaded = false;
long nSecondaryEnd = 0;
sal_uInt16 nWhich(0), nSlot(0);
while ( rStream >> nWhich, nWhich )
@@ -856,7 +856,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
sal_uLong nLastPos = rStream.Tell();
// SfxSetItems k"onnten Items aus Sekund"arpools beinhalten
- if ( !bSecondaryLoaded && pSecondary && pDefItem->ISA(SfxSetItem) )
+ if ( !bSecondaryLoaded && pSecondary && dynamic_cast< SfxSetItem* >(pDefItem) )
{
// an das Ende des eigenen Pools seeken
rStream.Seek(nEndOfSizes);
@@ -865,7 +865,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
// Sekund"arpool einlesen
pSecondary->Load1_Impl( rStream );
- bSecondaryLoaded = sal_True;
+ bSecondaryLoaded = true;
nSecondaryEnd = rStream.Tell();
// zur"uck zu unseren eigenen Items
@@ -1018,7 +1018,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
if ( aExternName != aName )
aName.Erase();
- pImp->bStreaming = sal_False;
+ pImp->bStreaming = false;
return rStream;
}
@@ -1088,7 +1088,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
// auf jeden Fall aufgel"ost werden.
if ( !pRefPool )
pRefPool = this;
- FASTBOOL bResolvable = pRefPool->GetName().Len() > 0;
+ bool bResolvable = pRefPool->GetName().Len() > 0;
if ( !bResolvable )
{
// Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId
@@ -1098,7 +1098,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
{
// gemappte SlotId kann "ubernommen werden
rWhich = nMappedWhich;
- bResolvable = sal_True;
+ bResolvable = true;
}
}
@@ -1151,7 +1151,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
//-------------------------------------------------------------------------
-FASTBOOL SfxItemPool::StoreSurrogate
+bool SfxItemPool::StoreSurrogate
(
SvStream& rStream,
const SfxPoolItem* pItem
@@ -1164,13 +1164,13 @@ FASTBOOL SfxItemPool::StoreSurrogate
[R"uckgabewert]
- FASTBOOL sal_True
+ bool true
es wurde ein echtes Surrogat gespeichert, auch
SFX_ITEMS_NULL bei 'pItem==0',
SFX_ITEMS_STATICDEFAULT und SFX_ITEMS_POOLDEFAULT
gelten als 'echte' Surrogate
- sal_False
+ false
es wurde ein Dummy-Surrogat (SFX_ITEMS_DIRECT)
gespeichert, das eigentliche Item mu\s direkt
hinterher selbst gespeichert werden
@@ -1179,7 +1179,7 @@ FASTBOOL SfxItemPool::StoreSurrogate
{
if ( pItem )
{
- FASTBOOL bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE);
+ bool bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE);
rStream << ( bRealSurrogate
? GetSurrogate( pItem )
: SFX_ITEMS_DIRECT );
@@ -1187,7 +1187,7 @@ FASTBOOL SfxItemPool::StoreSurrogate
}
rStream << SFX_ITEMS_NULL;
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
@@ -1225,7 +1225,7 @@ sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const
// -----------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const
+bool SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const
{
return nWhich >= pImp->nStoringStart &&
nWhich <= pImp->nStoringEnd;
@@ -1442,14 +1442,14 @@ sal_uInt16 SfxItemPool::GetNewWhich
// -----------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const
+bool SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const
{
return nWhich >= pImp->nVerStart && nWhich <= pImp->nVerEnd;
}
// -----------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsCurrentVersionLoading() const
+bool SfxItemPool::IsCurrentVersionLoading() const
/* [Beschreibung]
@@ -1540,7 +1540,7 @@ sal_uInt16 SfxItemPool::GetLoadingVersion() const
//-------------------------------------------------------------------------
-FASTBOOL SfxItemPool::IsVer2_Impl() const
+bool SfxItemPool::IsVer2_Impl() const
{
return pMaster->pImp->nMajorVer >= 2;
}
@@ -1548,13 +1548,13 @@ FASTBOOL SfxItemPool::IsVer2_Impl() const
//-------------------------------------------------------------------------
-FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
- FASTBOOL bDirect ) const
+bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
+ bool bDirect ) const
/* [Beschreibung]
Speichert das <SfxPoolItem> 'rItem' in den <SvStream> 'rStream'
- entweder als Surrogat ('bDirect == sal_False') oder direkt mit 'rItem.Store()'.
+ entweder als Surrogat ('bDirect == false') oder direkt mit 'rItem.Store()'.
Nicht poolable Items werden immer direkt gespeichert. Items ohne Which-Id,
also SID-Items, werden nicht gespeichert, ebenso wenn Items, die in der
File-Format-Version noch nicht vorhanden waren (return sal_False).
@@ -1565,7 +1565,7 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
sal_uInt16 GetSlotId( rItem.Which() ) bzw. 0 falls nicht verf"urbar
sal_uInt16 GetSurrogate( &rItem ) bzw. SFX_ITEM_DIRECT bei '!SFX_ITEM_POOLBLE'
- optional (falls 'bDirect == sal_True' oder '!rItem.IsPoolable()':
+ optional (falls 'bDirect == true' oder '!rItem.IsPoolable()':
sal_uInt16 rItem.GetVersion()
sal_uLong Size
@@ -1574,7 +1574,7 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
[Querverweise]
- <SfxItemPool::LoadItem(SvStream&,FASTBOOL)const>
+ <SfxItemPool::LoadItem(SvStream&,bool)const>
*/
{
@@ -1587,7 +1587,7 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
if ( 0 == ( pPool = pPool->pSecondary ) )
return sal_False;
- DBG_ASSERT( !pImp->bInSetItem || !rItem.ISA(SfxSetItem),
+ DBG_ASSERT( !pImp->bInSetItem || !dynamic_cast< const SfxSetItem* >(&rItem),
"SetItem contains ItemSet with SetItem" );
sal_uInt16 nSlotId = pPool->GetSlotId( rItem.Which(), sal_True );
@@ -1614,7 +1614,7 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem,
//-------------------------------------------------------------------------
-const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
+const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect,
const SfxItemPool *pRefPool )
// pRefPool==-1 => nicht putten!
@@ -1648,13 +1648,13 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect,
}
// wird eine andere Version geladen?
- FASTBOOL bCurVersion = pRefPool->IsCurrentVersionLoading();
+ bool bCurVersion = pRefPool->IsCurrentVersionLoading();
if ( !bCurVersion )
// Which-Id auf neue Version mappen
nWhich = pRefPool->GetNewWhich( nWhich );
DBG_ASSERT( !nWhich || !pImp->bInSetItem ||
- !pRefPool->ppStaticDefaults[pRefPool->GetIndex_Impl(nWhich)]->ISA(SfxSetItem),
+ !dynamic_cast< SfxSetItem* >(pRefPool->ppStaticDefaults[pRefPool->GetIndex_Impl(nWhich)]),
"loading SetItem in ItemSet of SetItem" );
// soll "uber Surrogat geladen werden?
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index 657e478a4e96..fb26ee8f27ab 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -26,6 +26,7 @@
#include <svl/poolitem.hxx>
#include <tools/stream.hxx>
+#include <typeinfo>
// STATIC DATA -----------------------------------------------------------
@@ -57,14 +58,6 @@ sal_uLong nSfxFlag32Val[32] =
0x10000000L, 0x20000000L, 0x40000000L, 0x80000000L
};
-// RTTI ------------------------------------------------------------------
-
-TYPEINIT0(SfxPoolItem);
-TYPEINIT1(SfxVoidItem, SfxPoolItem);
-// @@@ TYPEINIT1(SfxInvalidItem, SfxPoolItem);
-TYPEINIT1(SfxSetItem, SfxPoolItem);
-// @@@ TYPEINIT1(SfxItemChangedHint, SfxHint);
-
// ------------------------------------------------------------------------
#if OSL_DEBUG_LEVEL > 1
static sal_uLong nItemCount = 0;
@@ -179,7 +172,14 @@ int SfxPoolItem::Compare( const SfxPoolItem& rWith, const IntlWrapper& ) const
int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
{
DBG_CHKTHIS(SfxPoolItem, 0);
- return rCmp.Type() == Type();
+#ifdef DBG_UTIL
+ const std::type_info& aTypeA(typeid(rCmp));
+ const std::type_info& aTypeB(typeid(*this));
+
+ return aTypeA == aTypeB;
+#else
+ return typeid(rCmp) == typeid(*this);
+#endif
}
// -----------------------------------------------------------------------
@@ -308,6 +308,14 @@ SfxItemPresentation SfxPoolItem::GetPresentation
}
// SfxVoidItem ------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SfxVoidItem)
+
+SfxVoidItem::SfxVoidItem( ):
+ SfxPoolItem(0)
+{
+ DBG_CTOR(SfxVoidItem, 0);
+}
+
SfxVoidItem::SfxVoidItem( sal_uInt16 which ):
SfxPoolItem(which)
{
@@ -329,7 +337,12 @@ rCmp
) const
{
DBG_CHKTHIS(SfxVoidItem, 0);
- DBG_ASSERT( SfxPoolItem::operator==( rCmp ), "unequal type" );
+#ifdef DBG_UTIL
+ if(!SfxPoolItem::operator==( rCmp ))
+ {
+ DBG_ASSERT( false, "unequal type" );
+ }
+#endif
return sal_True;
}
@@ -473,15 +486,14 @@ SfxItemHandle::~SfxItemHandle()
}
// ------------------------------------------------------------------------
-int SfxPoolItem::ScaleMetrics( long /*lMult*/, long /*lDiv*/ )
+void SfxPoolItem::ScaleMetrics( long /*lMult*/, long /*lDiv*/ )
{
- return 0;
}
// ------------------------------------------------------------------------
-int SfxPoolItem::HasMetrics() const
+bool SfxPoolItem::HasMetrics() const
{
- return 0;
+ return false;
}
// -----------------------------------------------------------------------
diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx
index c688212fe320..b3a2c03d2a12 100644
--- a/svl/source/items/ptitem.cxx
+++ b/svl/source/items/ptitem.cxx
@@ -35,6 +35,7 @@
using namespace ::com::sun::star;
// STATIC DATA -----------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SfxPointItem)
DBG_NAME(SfxPointItem)
#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
@@ -42,10 +43,6 @@ DBG_NAME(SfxPointItem)
// -----------------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SfxPointItem, SfxPoolItem);
-
-// -----------------------------------------------------------------------
-
SfxPointItem::SfxPointItem()
{
DBG_CTOR(SfxPointItem, 0);
diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx
index 30ed578219ee..e5520ee8342d 100644
--- a/svl/source/items/rectitem.cxx
+++ b/svl/source/items/rectitem.cxx
@@ -35,11 +35,7 @@
// STATIC DATA -----------------------------------------------------------
DBG_NAME(SfxRectangleItem)
-
-
-// -----------------------------------------------------------------------
-
-TYPEINIT1_AUTOFACTORY(SfxRectangleItem, SfxPoolItem);
+IMPL_POOLITEM_FACTORY(SfxRectangleItem)
// -----------------------------------------------------------------------
diff --git a/svl/source/items/rngitem_inc.cxx b/svl/source/items/rngitem_inc.cxx
index 9054be02bc00..cdbc7f24795a 100644
--- a/svl/source/items/rngitem_inc.cxx
+++ b/svl/source/items/rngitem_inc.cxx
@@ -33,9 +33,6 @@ static inline NUMTYPE Count_Impl(const NUMTYPE * pRanges)
// -----------------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SfxXRangeItem, SfxPoolItem);
-TYPEINIT1_AUTOFACTORY(SfxXRangesItem, SfxPoolItem);
-
NUMTYPE Count_Impl( const NUMTYPE *pRanges );
// -----------------------------------------------------------------------
diff --git a/svl/source/items/sfontitm.cxx b/svl/source/items/sfontitm.cxx
index 8ce99aa49cc8..9db645b66cdb 100644
--- a/svl/source/items/sfontitm.cxx
+++ b/svl/source/items/sfontitm.cxx
@@ -33,13 +33,10 @@
//
//============================================================================
-TYPEINIT1(SfxFontItem, SfxPoolItem);
-
-//============================================================================
// virtual
int SfxFontItem::operator ==(const SfxPoolItem & rItem) const
{
- const SfxFontItem * pFontItem = PTR_CAST(SfxFontItem, &rItem);
+ const SfxFontItem * pFontItem = dynamic_cast< const SfxFontItem* >( &rItem);
return pFontItem && m_bHasFont == pFontItem->m_bHasFont
&& m_bHasColor == pFontItem->m_bHasColor
&& m_bHasFillColor == pFontItem->m_bHasFillColor
diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx
index 567a52ac066a..a2e2e4c3ec56 100644
--- a/svl/source/items/slstitm.cxx
+++ b/svl/source/items/slstitm.cxx
@@ -36,8 +36,6 @@ DBG_NAME(SfxStringListItem)
// -----------------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SfxStringListItem, SfxPoolItem);
-
class SfxImpStringList
{
public:
@@ -112,6 +110,8 @@ void SfxImpStringList::Sort( sal_Bool bAscending, List* pParallelList )
// class SfxStringListItem -----------------------------------------------
+IMPL_POOLITEM_FACTORY(SfxStringListItem)
+
SfxStringListItem::SfxStringListItem() :
pImp(NULL)
{
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 21657c026584..238cf936da1f 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -62,10 +62,6 @@ using namespace com::sun::star::util;
// STATIC DATA -----------------------------------------------------------
-TYPEINIT1_FACTORY(SvxSearchItem, SfxPoolItem, new SvxSearchItem(0));
-
-// -----------------------------------------------------------------------
-
static Sequence< ::rtl::OUString > lcl_GetNotifyNames()
{
// names of transliteration relevant properties
@@ -102,6 +98,8 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames()
}
// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxSearchItem)
+
SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
SfxPoolItem( nId ),
diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx
index df62202af6de..e145377cba23 100644
--- a/svl/source/items/stritem.cxx
+++ b/svl/source/items/stritem.cxx
@@ -31,9 +31,8 @@
//
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxStringItem, CntUnencodedStringItem)
+IMPL_POOLITEM_FACTORY(SfxStringItem)
-//============================================================================
// virtual
SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream):
CntUnencodedStringItem(which)
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 48223b16380f..1b02026cf507 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -69,17 +69,8 @@ aDbgStyleSheetReferences;
#endif
-TYPEINIT0(SfxStyleSheetBase)
-
-TYPEINIT3(SfxStyleSheet, SfxStyleSheetBase, SfxListener, SfxBroadcaster)
-
-
//=========================================================================
-TYPEINIT1(SfxStyleSheetHint, SfxHint);
-TYPEINIT1(SfxStyleSheetHintExtended, SfxStyleSheetHint);
-TYPEINIT1(SfxStyleSheetPoolHint, SfxHint);
-
SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
(
sal_uInt16 nAction, // SFX_STYLESHEET_... (s.o.)
diff --git a/svl/source/items/szitem.cxx b/svl/source/items/szitem.cxx
index 50516c1100f2..e3558557ce29 100644
--- a/svl/source/items/szitem.cxx
+++ b/svl/source/items/szitem.cxx
@@ -39,10 +39,6 @@ DBG_NAME(SfxSizeItem)
// -----------------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SfxSizeItem, SfxPoolItem);
-
-// -----------------------------------------------------------------------
-
SfxSizeItem::SfxSizeItem()
{
DBG_CTOR(SfxSizeItem, 0);
diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx
index 4ec827d0281b..269af0057227 100644
--- a/svl/source/items/visitem.cxx
+++ b/svl/source/items/visitem.cxx
@@ -36,9 +36,6 @@
DBG_NAME(SfxVisibilityItem)
//============================================================================
-TYPEINIT1_AUTOFACTORY(SfxVisibilityItem, SfxPoolItem);
-
-//============================================================================
SfxVisibilityItem::SfxVisibilityItem(sal_uInt16 which, SvStream & rStream):
SfxPoolItem(which)
{
@@ -62,7 +59,7 @@ int SfxVisibilityItem::operator ==(const SfxPoolItem & rItem) const
// virtual
int SfxVisibilityItem::Compare(const SfxPoolItem & rWith) const
{
- DBG_ASSERT(rWith.ISA(SfxVisibilityItem), "SfxVisibilityItem::Compare(): Bad type");
+ DBG_ASSERT(dynamic_cast< const SfxVisibilityItem* >(&rWith), "SfxVisibilityItem::Compare(): Bad type");
return m_nValue.bVisible == static_cast< SfxVisibilityItem const * >(&rWith)->m_nValue.bVisible ?
0 : m_nValue.bVisible ? -1 : 1;
}
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index 4ad901f64846..5bb132252b67 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -144,9 +144,6 @@ inline sal_uInt32 SvDataPipe_Impl::getReadPosition() const
//
//============================================================================
-TYPEINIT1(SvOutputStreamOpenLockBytes, SvOpenLockBytes)
-
-//============================================================================
// virtual
ErrCode SvOutputStreamOpenLockBytes::ReadAt(sal_uLong, void *, sal_uLong, sal_uLong *)
const
diff --git a/svl/source/notify/brdcst.cxx b/svl/source/notify/brdcst.cxx
index 08fb0fa53767..6af4159b0037 100644
--- a/svl/source/notify/brdcst.cxx
+++ b/svl/source/notify/brdcst.cxx
@@ -39,9 +39,6 @@ SV_DECL_PTRARR( SfxListenerArr_Impl, SfxListener*, 0, 2 )
//====================================================================
DBG_NAME(SfxBroadcaster)
-TYPEINIT0(SfxBroadcaster);
-
-//====================================================================
//====================================================================
// broadcast immediately
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 9de15cc1a187..88eeec8f84c7 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -35,9 +35,6 @@
//====================================================================
-TYPEINIT0(SvtBroadcaster);
-
-//====================================================================
// simple ctor of class SvtBroadcaster
diff --git a/svl/source/notify/hint.cxx b/svl/source/notify/hint.cxx
index 9a58dba6d50a..bba952f989d0 100644
--- a/svl/source/notify/hint.cxx
+++ b/svl/source/notify/hint.cxx
@@ -29,10 +29,6 @@
#include <svl/hint.hxx>
//====================================================================
-
-TYPEINIT0(SfxHint);
-
-//====================================================================
// virtual dtor for the typical base-class Hint
SfxHint::~SfxHint()
diff --git a/svl/source/notify/isethint.cxx b/svl/source/notify/isethint.cxx
index a008210d6c02..8b040544286a 100644
--- a/svl/source/notify/isethint.cxx
+++ b/svl/source/notify/isethint.cxx
@@ -32,10 +32,6 @@
//====================================================================
-TYPEINIT1(SfxItemSetHint, SfxHint);
-
-//====================================================================
-
SfxItemSetHint::SfxItemSetHint( SfxItemSet *pItemSet )
/* [Beschreibung]
diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx
index 994674474e29..d088b7d05708 100644
--- a/svl/source/notify/listener.cxx
+++ b/svl/source/notify/listener.cxx
@@ -32,9 +32,6 @@
//====================================================================
-TYPEINIT0(SvtListener);
-
-//====================================================================
// simple ctor of class SvtListener
SvtListener::SvtListener()
diff --git a/svl/source/notify/listeneriter.cxx b/svl/source/notify/listeneriter.cxx
index 2e8efc38fb00..e439efa8804d 100644
--- a/svl/source/notify/listeneriter.cxx
+++ b/svl/source/notify/listeneriter.cxx
@@ -26,6 +26,7 @@
#include <tools/debug.hxx>
#include "listenerbase.hxx"
+#include <typeinfo>
#include <svl/listeneriter.hxx>
#include <svl/broadcast.hxx>
#include <svl/listener.hxx>
@@ -33,7 +34,8 @@
SvtListenerIter* SvtListenerIter::pListenerIters = 0;
SvtListenerIter::SvtListenerIter( SvtBroadcaster& rBrdcst )
- : rRoot( rBrdcst )
+: rRoot( rBrdcst ),
+ pSrchFunction( 0 )
{
// hinten einketten!
pNxtIter = 0;
@@ -132,13 +134,13 @@ SvtListener* SvtListenerIter::GoEnd() // zum End des Baums
-SvtListener* SvtListenerIter::First( TypeId nType )
+SvtListener* SvtListenerIter::First( ConvertToSvtListener rConvert )
{
- aSrchId = nType;
+ pSrchFunction = rConvert;
GoStart();
if( pAkt )
do {
- if( pAkt->GetListener()->IsA( aSrchId ) )
+ if( pSrchFunction(pAkt->GetListener() ))
break;
if( pDelNext == pAkt )
@@ -166,7 +168,7 @@ SvtListener* SvtListenerIter::Next()
else
pAkt = pDelNext;
- if( pAkt && pAkt->GetListener()->IsA( aSrchId ) )
+ if( pAkt && pSrchFunction && pSrchFunction(pAkt->GetListener()))
break;
} while( pAkt );
return pAkt ? pAkt->GetListener() : 0;
diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
index 2ece89bd8c47..5a05d3ecc8f8 100644
--- a/svl/source/notify/lstner.cxx
+++ b/svl/source/notify/lstner.cxx
@@ -40,9 +40,6 @@ SV_DECL_PTRARR( SfxBroadcasterArr_Impl, SfxBroadcaster*, 0, 2 )
//====================================================================
DBG_NAME(SfxListener)
-TYPEINIT0(SfxListener);
-
-//====================================================================
// simple ctor of class SfxListener
SfxListener::SfxListener()
diff --git a/svl/source/notify/smplhint.cxx b/svl/source/notify/smplhint.cxx
index 227174ef60d7..ffde8a6d1d19 100644
--- a/svl/source/notify/smplhint.cxx
+++ b/svl/source/notify/smplhint.cxx
@@ -30,9 +30,6 @@
//====================================================================
-TYPEINIT1(SfxSimpleHint, SfxHint);
-
-//====================================================================
// creates a SimpleHint with the type nId
SfxSimpleHint::SfxSimpleHint( sal_uLong nIdP )
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 889692645130..951419d034b8 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -44,13 +44,6 @@ DBG_NAME(SfxUndoAction)
//========================================================================
-TYPEINIT0(SfxUndoAction);
-TYPEINIT0(SfxListUndoAction);
-TYPEINIT0(SfxLinkUndoAction);
-TYPEINIT0(SfxRepeatTarget);
-
-//------------------------------------------------------------------------
-
SfxRepeatTarget::~SfxRepeatTarget()
{
}
diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx
index e1ec23ddbaa8..1d22765e8cb7 100644
--- a/svtools/bmpmaker/bmp.cxx
+++ b/svtools/bmpmaker/bmp.cxx
@@ -19,27 +19,21 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#ifndef INCLUDED_RTL_MATH_HXX
#include <rtl/math.hxx>
-#endif
-
#include <math.h>
#include <stdio.h>
#include <signal.h>
#include <vector>
using namespace std;
-
#include <vcl/svapp.hxx>
-
#include "svl/solar.hrc"
#include <svtools/filedlg.hxx>
#include "bmpcore.hxx"
#include "bmp.hrc"
+#include <memory.h>
// ----------
// - BmpApp -
diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx
index 99a4ecfae5c0..c36a0fe55a21 100644
--- a/svtools/inc/svtools/brwbox.hxx
+++ b/svtools/inc/svtools/brwbox.hxx
@@ -477,7 +477,7 @@ public:
// Window-Control (pass to DataWindow)
void SetUpdateMode( sal_Bool bUpdate );
- sal_Bool GetUpdateMode() const;
+ bool GetUpdateMode() const;
// map-mode and font control
void SetFont( const Font& rNewFont );
diff --git a/svtools/inc/svtools/editbrowsebox.hxx b/svtools/inc/svtools/editbrowsebox.hxx
index 280096646e7a..11904b985b28 100644
--- a/svtools/inc/svtools/editbrowsebox.hxx
+++ b/svtools/inc/svtools/editbrowsebox.hxx
@@ -27,7 +27,6 @@
#include "svtools/svtdllapi.h"
#include <tools/ref.hxx>
-#include <tools/rtti.hxx>
#include <vcl/window.hxx>
#include <vcl/combobox.hxx>
#include <vcl/lstbox.hxx>
@@ -98,8 +97,6 @@ namespace svt
sal_Bool bSuspended; // <sal_True> if the window is hidden and disabled
public:
- TYPEINFO();
-
CellController(Control* pW);
virtual ~CellController();
@@ -245,7 +242,6 @@ namespace svt
sal_Bool m_bOwnImplementation; // did we create m_pEditImplementation?
public:
- TYPEINFO();
EditCellController( Edit* _pEdit );
EditCellController( MultiLineTextCell* _pEdit );
EditCellController( IEditImplementation* _pImplementation );
@@ -269,7 +265,6 @@ namespace svt
class SVT_DLLPUBLIC SpinCellController : public CellController
{
public:
- TYPEINFO();
SpinCellController(SpinField* pSpinField);
SpinField& GetSpinWindow() const {return (SpinField &)GetWindow();}
@@ -321,8 +316,6 @@ namespace svt
class SVT_DLLPUBLIC CheckBoxCellController : public CellController
{
public:
- TYPEINFO();
-
CheckBoxCellController(CheckBoxControl* pWin):CellController(pWin){}
CheckBox& GetCheckBox() const;
@@ -354,8 +347,6 @@ namespace svt
class SVT_DLLPUBLIC ComboBoxCellController : public CellController
{
public:
- TYPEINFO();
-
ComboBoxCellController(ComboBoxControl* pParent);
ComboBoxControl& GetComboBox() const {return (ComboBoxControl &)GetWindow();}
@@ -387,8 +378,6 @@ namespace svt
class SVT_DLLPUBLIC ListBoxCellController : public CellController
{
public:
- TYPEINFO();
-
ListBoxCellController(ListBoxControl* pParent);
ListBoxControl& GetListBox() const {return (ListBoxControl &)GetWindow();}
@@ -406,7 +395,6 @@ namespace svt
class SVT_DLLPUBLIC FormattedFieldCellController : public EditCellController
{
public:
- TYPEINFO();
FormattedFieldCellController( FormattedField* _pFormatted );
virtual void CommitModifications();
diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx
index 1155820e85a8..ce3b7667fe67 100644
--- a/svtools/inc/svtools/grfmgr.hxx
+++ b/svtools/inc/svtools/grfmgr.hxx
@@ -313,8 +313,6 @@ protected:
public:
- TYPEINFO();
-
GraphicObject( const GraphicManager* pMgr = NULL );
GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL );
GraphicObject( const Graphic& rGraphic, const String& rLink, const GraphicManager* pMgr = NULL );
diff --git a/svtools/inc/svtools/imap.hxx b/svtools/inc/svtools/imap.hxx
index 51a3b60b52ff..2e9063dfd64c 100644
--- a/svtools/inc/svtools/imap.hxx
+++ b/svtools/inc/svtools/imap.hxx
@@ -70,8 +70,6 @@ protected:
public:
- TYPEINFO();
-
ImageMap() {};
ImageMap( const String& rName );
ImageMap( const ImageMap& rImageMap );
diff --git a/svtools/inc/svtools/parhtml.hxx b/svtools/inc/svtools/parhtml.hxx
index 8c789aa8fc84..b8feea465244 100644
--- a/svtools/inc/svtools/parhtml.hxx
+++ b/svtools/inc/svtools/parhtml.hxx
@@ -252,7 +252,7 @@ public:
// Mit Ausnahme des Falls, dass SwitchToUCS2==sal_False und
// SVPAR_CS_DONTKNOW uebergeben wird muss der String mit zwei(!)
// 0-Bytes an einer geraden(!) Position terminiert sein.
- static FASTBOOL IsHTMLFormat( const sal_Char* pHeader,
+ static bool IsHTMLFormat( const sal_Char* pHeader,
sal_Bool bSwitchToUCS2 = sal_False,
rtl_TextEncoding eEnc=RTL_TEXTENCODING_DONTKNOW );
diff --git a/svtools/inc/svtools/textdata.hxx b/svtools/inc/svtools/textdata.hxx
index 792c353a04ad..22f1284a478e 100644
--- a/svtools/inc/svtools/textdata.hxx
+++ b/svtools/inc/svtools/textdata.hxx
@@ -132,7 +132,6 @@ private:
sal_uLong mnValue;
public:
- TYPEINFO();
TextHint( sal_uLong nId );
TextHint( sal_uLong nId, sal_uLong nValue );
diff --git a/svtools/inc/svtools/ttprops.hxx b/svtools/inc/svtools/ttprops.hxx
index bbe099258511..1faa105185c3 100644
--- a/svtools/inc/svtools/ttprops.hxx
+++ b/svtools/inc/svtools/ttprops.hxx
@@ -25,7 +25,6 @@
#define _SVTOOLS_TTPROPS_HXX
#include "svtools/svtdllapi.h"
-#include <tools/rtti.hxx>
#include <vcl/apptypes.hxx>
#include <svtools/svtdata.hxx>
@@ -62,14 +61,13 @@ class SVT_DLLPUBLIC TTProperties : public ApplicationProperty
sal_Bool HasSlots(){ return nPropertyVersion == TT_PROPERTIES_VERSION; }
public:
- TYPEINFO();
-
TTProperties()
: nDonePRs( 0 )
, mppArgs( NULL )
, mpBmp( NULL )
, nPropertyVersion( 0 )
{}
+ virtual ~TTProperties();
sal_Bool GetSlots();
diff --git a/svtools/inc/svtools/xwindowitem.hxx b/svtools/inc/svtools/xwindowitem.hxx
index 5ceb7cdb5470..028461827a57 100644
--- a/svtools/inc/svtools/xwindowitem.hxx
+++ b/svtools/inc/svtools/xwindowitem.hxx
@@ -43,7 +43,6 @@ class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem
XWindowItem & operator = ( const XWindowItem & );
public:
- TYPEINFO();
XWindowItem();
explicit XWindowItem( sal_uInt16 nWhich, Window * pWin );
XWindowItem( sal_uInt16 nWhich, com::sun::star::uno::Reference< com::sun::star::awt::XWindow > & rxWin );
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index c5ee562bf4db..863dc4c03a83 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -697,7 +697,7 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
return;
// soll die Aenderung sofort dargestellt werden?
- sal_Bool bUpdate = GetUpdateMode() &&
+ bool bUpdate = GetUpdateMode() &&
( pCols->GetObject(nItemPos)->IsFrozen() || nItemPos >= nFirstCol );
if ( bUpdate )
@@ -2457,9 +2457,9 @@ void BrowseBox::SetMode( BrowserMode nMode )
DBG_ASSERT( !( getDataWindow()->bAutoVScroll && getDataWindow()->bNoVScroll ),
"BrowseBox::SetMode: AutoVScroll *and* NoVScroll?" );
if ( getDataWindow()->bAutoHScroll )
- getDataWindow()->bNoHScroll = sal_False;
+ getDataWindow()->bNoHScroll = false;
if ( getDataWindow()->bAutoVScroll )
- getDataWindow()->bNoVScroll = sal_False;
+ getDataWindow()->bNoVScroll = false;
if ( getDataWindow()->bNoHScroll )
aHScroll.Hide();
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 1b3a814cc8c0..9bbcfc6b8a2f 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -339,7 +339,7 @@ void BrowseBox::ToggleSelection( sal_Bool bForce )
// only highlight painted areas!
bNotToggleSel = sal_True;
- if ( sal_False && !getDataWindow()->bInPaint )
+ if ( false && !getDataWindow()->bInPaint )
pDataWin->Update();
// accumulate areas of rows to highlight
@@ -597,10 +597,10 @@ void BrowseBox::Resize()
BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
if ( !pCols->Count() )
{
- getDataWindow()->bResizeOnPaint = sal_True;
+ getDataWindow()->bResizeOnPaint = true;
return;
}
- getDataWindow()->bResizeOnPaint = sal_False;
+ getDataWindow()->bResizeOnPaint = false;
// calc the size of the scrollbars
// (we can't ask the scrollbars for their widths cause if we're zoomed they still have to be
@@ -1189,10 +1189,10 @@ void BrowseBox::UpdateScrollbars()
BrowserDataWin *pBDW = (BrowserDataWin*) pDataWin;
if ( pBDW->bInUpdateScrollbars )
{
- pBDW->bHadRecursion = sal_True;
+ pBDW->bHadRecursion = true;
return;
}
- pBDW->bInUpdateScrollbars = sal_True;
+ pBDW->bInUpdateScrollbars = true;
// the size of the corner window (and the width of the VSB/height of the HSB)
sal_uLong nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize();
@@ -1201,7 +1201,7 @@ void BrowseBox::UpdateScrollbars()
// needs VScroll?
long nMaxRows = (pDataWin->GetSizePixel().Height()) / GetDataRowHeight();
- sal_Bool bNeedsVScroll = getDataWindow()->bAutoVScroll
+ bool bNeedsVScroll = getDataWindow()->bAutoVScroll
? nTopRow || ( nRowCount > nMaxRows )
: !getDataWindow()->bNoVScroll;
Size aDataWinSize = pDataWin->GetSizePixel();
@@ -1226,7 +1226,7 @@ void BrowseBox::UpdateScrollbars()
sal_uLong nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 );
sal_uInt16 nFrozenCols = FrozenColCount();
- sal_Bool bNeedsHScroll = getDataWindow()->bAutoHScroll
+ bool bNeedsHScroll = getDataWindow()->bAutoHScroll
? ( nFirstCol > nFrozenCols ) || ( nLastCol <= pCols->Count() )
: !getDataWindow()->bNoHScroll;
if ( !bNeedsHScroll )
@@ -1346,10 +1346,10 @@ void BrowseBox::UpdateScrollbars()
getDataWindow()->pHeaderBar->SetOffset( nWidth );
}
- pBDW->bInUpdateScrollbars = sal_False;
+ pBDW->bInUpdateScrollbars = false;
if ( pBDW->bHadRecursion )
{
- pBDW->bHadRecursion = sal_False;
+ pBDW->bHadRecursion = false;
UpdateScrollbars();
}
}
@@ -1388,7 +1388,7 @@ void BrowseBox::SetUpdateMode( sal_Bool bUpdate )
//-------------------------------------------------------------------
-sal_Bool BrowseBox::GetUpdateMode() const
+bool BrowseBox::GetUpdateMode() const
{
DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index d891db87c09c..e44f33572c08 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -212,18 +212,18 @@ BrowserDataWin::BrowserDataWin( BrowseBox* pParent )
,pEventWin( pParent )
,pCornerWin( 0 )
,pDtorNotify( 0 )
- ,bInPaint( sal_False )
- ,bInCommand( sal_False )
- ,bNoScrollBack( sal_False )
- ,bNoHScroll( sal_False )
- ,bNoVScroll( sal_False )
- ,bUpdateMode( sal_True )
- ,bResizeOnPaint( sal_False )
- ,bUpdateOnUnlock( sal_False )
- ,bInUpdateScrollbars( sal_False )
- ,bHadRecursion( sal_False )
- ,bOwnDataChangedHdl( sal_False )
- ,bCallingDropCallback( sal_False )
+ ,bInPaint( false )
+ ,bInCommand( false )
+ ,bNoScrollBack( false )
+ ,bNoHScroll( false )
+ ,bNoVScroll( false )
+ ,bUpdateMode( true )
+ ,bResizeOnPaint( false )
+ ,bUpdateOnUnlock( false )
+ ,bInUpdateScrollbars( false )
+ ,bHadRecursion( false )
+ ,bOwnDataChangedHdl( false )
+ ,bCallingDropCallback( false )
,nUpdateLock( 0 )
,nCursorHidden( 0 )
,m_nDragRowDividerLimit( 0 )
@@ -249,7 +249,7 @@ void BrowserDataWin::LeaveUpdateLock()
if (bUpdateOnUnlock )
{
Control::Update();
- bUpdateOnUnlock = sal_False;
+ bUpdateOnUnlock = false;
}
}
}
@@ -292,7 +292,7 @@ void BrowserDataWin::Update()
if ( !nUpdateLock )
Control::Update();
else
- bUpdateOnUnlock = sal_True;
+ bUpdateOnUnlock = true;
}
//-------------------------------------------------------------------
@@ -324,9 +324,9 @@ void BrowserDataWin::Paint( const Rectangle& rRect )
aInvalidRegion.Insert( new Rectangle( rRect ) );
return;
}
- bInPaint = sal_True;
+ bInPaint = true;
( (BrowseBox*) GetParent() )->PaintData( *this, rRect );
- bInPaint = sal_False;
+ bInPaint = false;
DoOutstandingInvalidations();
}
else
@@ -380,20 +380,20 @@ BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel )
//-------------------------------------------------------------------
sal_Int8 BrowserDataWin::AcceptDrop( const AcceptDropEvent& _rEvt )
{
- bCallingDropCallback = sal_True;
+ bCallingDropCallback = true;
sal_Int8 nReturn = DND_ACTION_NONE;
nReturn = GetParent()->AcceptDrop( BrowserAcceptDropEvent( this, _rEvt ) );
- bCallingDropCallback = sal_False;
+ bCallingDropCallback = false;
return nReturn;
}
//-------------------------------------------------------------------
sal_Int8 BrowserDataWin::ExecuteDrop( const ExecuteDropEvent& _rEvt )
{
- bCallingDropCallback = sal_True;
+ bCallingDropCallback = true;
sal_Int8 nReturn = DND_ACTION_NONE;
nReturn = GetParent()->ExecuteDrop( BrowserExecuteDropEvent( this, _rEvt ) );
- bCallingDropCallback = sal_False;
+ bCallingDropCallback = false;
return nReturn;
}
@@ -427,7 +427,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
{
sal_Bool bDeleted = sal_False;
pDtorNotify = &bDeleted;
- bInCommand = sal_True;
+ bInCommand = true;
MouseButtonDown( aMouseEvt );
if( bDeleted )
return;
@@ -435,20 +435,20 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
if( bDeleted )
return;
pDtorNotify = 0;
- bInCommand = sal_False;
+ bInCommand = false;
}
aEventPos.Y() += GetParent()->GetTitleHeight();
CommandEvent aEvt( aEventPos, rEvt.GetCommand(),
rEvt.IsMouseEvent(), rEvt.GetData() );
- bInCommand = sal_True;
+ bInCommand = true;
sal_Bool bDeleted = sal_False;
pDtorNotify = &bDeleted;
GetParent()->Command( aEvt );
if( bDeleted )
return;
pDtorNotify = 0;
- bInCommand = sal_False;
+ bInCommand = false;
if ( COMMAND_STARTDRAG == rEvt.GetCommand() )
MouseButtonUp( aMouseEvt );
@@ -689,7 +689,7 @@ BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin *pWindow, const
//-------------------------------------------------------------------
-void BrowserDataWin::SetUpdateMode( sal_Bool bMode )
+void BrowserDataWin::SetUpdateMode( bool bMode )
{
DBG_ASSERT( !bUpdateMode || aInvalidRegion.Count() == 0,
"invalid region not empty" );
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index 7418e3077711..ec4edd78d9ab 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -129,21 +129,21 @@ public:
String aRealRowCount; // zur Anzeige im VScrollBar
RectangleList aInvalidRegion; // invalidated Rectangles during !UpdateMode
- FASTBOOL bInPaint; // sal_True while in Paint
- FASTBOOL bInCommand; // sal_True while in Command
- FASTBOOL bNoScrollBack; // nur vorwaerts scrollen
- FASTBOOL bNoHScroll; // kein horizontaler Scrollbar
- FASTBOOL bNoVScroll; // no vertical scrollbar
- FASTBOOL bAutoHScroll; // autohide horizontaler Scrollbar
- FASTBOOL bAutoVScroll; // autohide horizontaler Scrollbar
- FASTBOOL bUpdateMode; // nicht SV-UpdateMode wegen Invalidate()
- FASTBOOL bAutoSizeLastCol;// last column always fills up window
- FASTBOOL bResizeOnPaint; // outstanding resize-event
- FASTBOOL bUpdateOnUnlock; // Update() while locked
- FASTBOOL bInUpdateScrollbars; // Rekursionsschutz
- FASTBOOL bHadRecursion; // Rekursion war aufgetreten
- FASTBOOL bOwnDataChangedHdl; // dont change colors in DataChanged
- FASTBOOL bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop curently
+ bool bInPaint; // true while in Paint
+ bool bInCommand; // true while in Command
+ bool bNoScrollBack; // nur vorwaerts scrollen
+ bool bNoHScroll; // kein horizontaler Scrollbar
+ bool bNoVScroll; // no vertical scrollbar
+ bool bAutoHScroll; // autohide horizontaler Scrollbar
+ bool bAutoVScroll; // autohide horizontaler Scrollbar
+ bool bUpdateMode; // nicht SV-UpdateMode wegen Invalidate()
+ bool bAutoSizeLastCol;// last column always fills up window
+ bool bResizeOnPaint; // outstanding resize-event
+ bool bUpdateOnUnlock; // Update() while locked
+ bool bInUpdateScrollbars; // Rekursionsschutz
+ bool bHadRecursion; // Rekursion war aufgetreten
+ bool bOwnDataChangedHdl; // dont change colors in DataChanged
+ bool bCallingDropCallback; // we're in a callback to AcceptDrop or ExecuteDrop curently
sal_uInt16 nUpdateLock; // lock count, dont call Control::Update()!
short nCursorHidden; // new conuter for DoHide/ShowCursor
@@ -180,8 +180,8 @@ public:
{ return (BrowseBox*) Window::GetParent(); }
const String& GetRealRowCount() const { return aRealRowCount; }
- void SetUpdateMode( sal_Bool bMode );
- FASTBOOL GetUpdateMode() const { return bUpdateMode; }
+ void SetUpdateMode( bool bMode );
+ bool GetUpdateMode() const { return bUpdateMode; }
void EnterUpdateLock() { ++nUpdateLock; }
void LeaveUpdateLock();
void Update();
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index c516802e4f7c..712a3e8f3950 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -35,15 +35,6 @@ namespace svt
{
// .......................................................................
- TYPEINIT0(CellController);
- TYPEINIT1(EditCellController, CellController);
- TYPEINIT1(SpinCellController, CellController);
- TYPEINIT1(CheckBoxCellController, CellController);
- TYPEINIT1(ComboBoxCellController, CellController);
- TYPEINIT1(ListBoxCellController, CellController);
-
- TYPEINIT1( FormattedFieldCellController, EditCellController );
-
//==================================================================
//= ComboBoxControl
//==================================================================
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index b91b9d498513..58b26c3df341 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -533,7 +533,7 @@ SvtAccessibilityOptions::~SvtAccessibilityOptions()
void SvtAccessibilityOptions::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
NotifyListeners(0);
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ if ( dynamic_cast< const SfxSimpleHint* >(&rHint) )
{
if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_ACCESSIBILITY_CHANGED )
SetVCLSettings();
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index 72d458d1255e..fc08feb9e3b1 100644
--- a/svtools/source/control/toolbarmenuacc.cxx
+++ b/svtools/source/control/toolbarmenuacc.cxx
@@ -69,13 +69,13 @@ ToolbarMenuAcc::~ToolbarMenuAcc()
IMPL_LINK( ToolbarMenuAcc, WindowEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
+ DBG_ASSERT( pEvent && dynamic_cast< VclWindowEvent* >(pEvent), "Unknown WindowEvent!" );
/* Ignore VCLEVENT_WINDOW_ENDPOPUPMODE, because the UNO accessibility wrapper
* might have been destroyed by the previous VCLEventListener (if no AT tool
* is running), e.g. sub-toolbars in impress.
*/
- if ( mpParent && pEvent && pEvent->ISA( VclWindowEvent ) && (pEvent->GetId() != VCLEVENT_WINDOW_ENDPOPUPMODE) )
+ if ( mpParent && pEvent && dynamic_cast< VclWindowEvent* >(pEvent) && (pEvent->GetId() != VCLEVENT_WINDOW_ENDPOPUPMODE) )
{
DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "Window???" );
if( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx
index 02316324076f..e9837e17ed61 100644
--- a/svtools/source/edit/svmedit.cxx
+++ b/svtools/source/edit/svmedit.cxx
@@ -200,7 +200,7 @@ void ImpSvMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
sal_Bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
const sal_Bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
- const sal_Bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
+ const bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
if ( !bNeedVScroll && bAutoVScroll )
{
TextEngine& rEngine( *mpTextWindow->GetTextEngine() );
@@ -563,17 +563,18 @@ String ImpSvMEdit::GetTextLines( LineEnd aSeparator ) const
void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.ISA( TextHint ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
- const TextHint& rTextHint = (const TextHint&)rHint;
- if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
+ if( pTextHint->GetId() == TEXT_HINT_VIEWSCROLLED )
{
if ( mpHScrollBar )
ImpSetHScrollBarThumbPos();
if ( mpVScrollBar )
mpVScrollBar->SetThumbPos( mpTextWindow->GetTextView()->GetStartDocPos().Y() );
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
{
if ( mpTextWindow->GetTextView()->GetStartDocPos().Y() )
{
@@ -585,7 +586,7 @@ void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
ImpSetScrollBarRanges();
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTFORMATTED )
{
if ( mpHScrollBar )
{
@@ -598,7 +599,7 @@ void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
}
- else if( rTextHint.GetId() == TEXT_HINT_MODIFIED )
+ else if( pTextHint->GetId() == TEXT_HINT_MODIFIED )
{
pSvMultiLineEdit->Modify();
}
diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx
index 8b9f39c6aea3..e40644c64987 100644
--- a/svtools/source/edit/textdata.cxx
+++ b/svtools/source/edit/textdata.cxx
@@ -312,8 +312,6 @@ void IdleFormatter::ForceTimeout()
}
}
-TYPEINIT1( TextHint, SfxSimpleHint );
-
TextHint::TextHint( sal_uLong Id ) : SfxSimpleHint( Id )
{
mnValue = 0;
diff --git a/svtools/source/edit/textund2.hxx b/svtools/source/edit/textund2.hxx
index 5bf75fe70e36..ff1d43197620 100644
--- a/svtools/source/edit/textund2.hxx
+++ b/svtools/source/edit/textund2.hxx
@@ -34,7 +34,6 @@ private:
TextNode* mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt!
public:
- TYPEINFO();
TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara );
~TextUndoDelPara();
@@ -50,7 +49,6 @@ private:
sal_uInt16 mnSepPos;
public:
- TYPEINFO();
TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoConnectParas();
@@ -66,7 +64,6 @@ private:
sal_uInt16 mnSepPos;
public:
- TYPEINFO();
TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoSplitPara();
@@ -82,7 +79,6 @@ private:
String maText;
public:
- TYPEINFO();
TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
// const TextPaM& GetTextPaM() { return aTextPaM; }
@@ -102,7 +98,6 @@ private:
String maText;
public:
- TYPEINFO();
TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
// const TextPaM& GetTextPaM() { return aTextPaM; }
@@ -127,7 +122,6 @@ private:
public:
- TYPEINFO();
TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rESel );
~TextUndoSetAttribs();
diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx
index ea233c0dec1e..76df8e6e4339 100644
--- a/svtools/source/edit/textundo.cxx
+++ b/svtools/source/edit/textundo.cxx
@@ -32,15 +32,6 @@
#include <textdoc.hxx>
#include <textdat2.hxx>
-TYPEINIT1( TextUndo, SfxUndoAction );
-TYPEINIT1( TextUndoDelPara, TextUndo );
-TYPEINIT1( TextUndoConnectParas, TextUndo );
-TYPEINIT1( TextUndoSplitPara, TextUndo );
-TYPEINIT1( TextUndoInsertChars, TextUndo );
-TYPEINIT1( TextUndoRemoveChars, TextUndo );
-TYPEINIT1( TextUndoSetAttribs, TextUndo );
-
-
TextUndoManager::TextUndoManager( TextEngine* p )
{
mpTextEngine = p;
@@ -252,7 +243,7 @@ void __EXPORT TextUndoInsertChars::Redo()
sal_Bool __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
{
- if ( !pNextAction->ISA( TextUndoInsertChars ) )
+ if ( !dynamic_cast< TextUndoInsertChars* >(pNextAction) )
return sal_False;
TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction;
diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx
index 1f068d593acd..b10bc44576ea 100644
--- a/svtools/source/edit/textundo.hxx
+++ b/svtools/source/edit/textundo.hxx
@@ -63,7 +63,6 @@ protected:
TEParaPortions* GetTEParaPortions() const { return mpTextEngine->mpTEParaPortions; }
public:
- TYPEINFO();
TextUndo( TextEngine* pTextEngine );
virtual ~TextUndo();
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 795afab7c0b6..d830a76615f9 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -74,10 +74,6 @@ struct GrfSimpleCacheObj
// - GraphicObject -
// -----------------
-TYPEINIT1_AUTOFACTORY( GraphicObject, SvDataCopyStream );
-
-// -----------------------------------------------------------------------------
-
GraphicObject::GraphicObject( const GraphicManager* pMgr ) :
mpLink ( NULL ),
mpUserData ( NULL )
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 3576806c4b43..24c4b709b7ba 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -192,7 +192,7 @@ sal_Bool SfxErrorHandler::CreateString(
sal_uLong nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK;
if( nErrCode>=lEnd || nErrCode<=lStart )
return sal_False;
- MessageInfo *pMsgInfo=PTR_CAST(MessageInfo,pErr);
+ const MessageInfo* pMsgInfo = dynamic_cast< const MessageInfo* >( pErr);
if(pMsgInfo)
{
if(GetMessageString(nErrCode, rStr, nFlags))
@@ -210,7 +210,7 @@ sal_Bool SfxErrorHandler::CreateString(
}
else if(GetErrorString(nErrCode, rStr, nFlags))
{
- StringErrorInfo *pStringInfo=PTR_CAST(StringErrorInfo,pErr);
+ const StringErrorInfo* pStringInfo = dynamic_cast< const StringErrorInfo* >( pErr);
if(pStringInfo)
for (xub_StrLen i = 0; i < rStr.Len();)
{
@@ -222,8 +222,7 @@ sal_Bool SfxErrorHandler::CreateString(
}
else
{
- TwoStringErrorInfo * pTwoStringInfo = PTR_CAST(TwoStringErrorInfo,
- pErr);
+ const TwoStringErrorInfo* pTwoStringInfo = dynamic_cast< const TwoStringErrorInfo* >( pErr);
if (pTwoStringInfo)
for (sal_uInt16 i = 0; i < rStr.Len();)
{
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 1a29c194f248..3aaa563c647b 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -47,13 +47,6 @@
#define NOTEOL(c) ((c)!='\0')
-TYPEINIT0_AUTOFACTORY( ImageMap );
-
-
-/******************************************************************************/
-/******************************************************************************/
-
-
/******************************************************************************
|*
|*
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 40a65d06f4b0..9bf7eaac882e 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#ifdef WNT
@@ -53,7 +51,6 @@
#include <comphelper/processfactory.hxx>
#include <sot/filelist.hxx>
#include <cppuhelper/implbase1.hxx>
-
#include <comphelper/seqstream.hxx>
#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
@@ -68,6 +65,7 @@
#include <svtools/imap.hxx>
#include <svtools/transfer.hxx>
#include <cstdio>
+#include <memory.h>
// --------------
// - Namespaces -
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index 9ce1e178ccab..e33e7d46a882 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#include <vos/mutex.hxx>
@@ -40,6 +38,7 @@
#include <svtools/inetimg.hxx>
#include <svtools/imap.hxx>
#include <svtools/transfer.hxx>
+#include <memory.h>
// --------------
// - Namespaces -
diff --git a/svtools/source/misc/xwindowitem.cxx b/svtools/source/misc/xwindowitem.cxx
index e4390a0c6a38..86000e67957d 100644
--- a/svtools/source/misc/xwindowitem.cxx
+++ b/svtools/source/misc/xwindowitem.cxx
@@ -33,9 +33,6 @@ using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////
-TYPEINIT1_FACTORY( XWindowItem, SfxPoolItem, new XWindowItem );
-
-
XWindowItem::XWindowItem() :
SfxPoolItem()
{
diff --git a/svtools/source/plugapp/ttprops.cxx b/svtools/source/plugapp/ttprops.cxx
index c6fa490c9931..ce6e65c612e4 100644
--- a/svtools/source/plugapp/ttprops.cxx
+++ b/svtools/source/plugapp/ttprops.cxx
@@ -26,9 +26,10 @@
#include <svtools/ttprops.hxx>
#include <vcl/svapp.hxx>
#include <vcl/bitmap.hxx>
-#include <tools/rtti.hxx>
-TYPEINIT1( TTProperties, ApplicationProperty )
+TTProperties::~TTProperties()
+{
+}
sal_Bool TTProperties::RequestProperty( sal_uInt16 nRequest )
{
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 02460c9f8610..334f6651c542 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1905,7 +1905,7 @@ int HTMLParser::FilterListing( int nToken )
return nToken;
}
-FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
+bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
sal_Bool bSwitchToUCS2,
rtl_TextEncoding eEnc )
{
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index 4d47f2a41667..f5972cf988ae 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -246,7 +246,7 @@ namespace svt
//------------------------------------------------------------------------------------------------------------------
IMPL_LINK( DrawerDeckLayouter, OnWindowEvent, VclSimpleEvent*, i_pEvent )
{
- const VclWindowEvent* pWindowEvent = PTR_CAST( VclWindowEvent, i_pEvent );
+ const VclWindowEvent* pWindowEvent = dynamic_cast< const VclWindowEvent* >( i_pEvent );
ENSURE_OR_RETURN( pWindowEvent, "no WindowEvent", 0L );
bool bActivatePanel = false;
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 8e809db8ef39..1e9dff4b64e2 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -26,7 +26,6 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <rtl/ustrbuf.hxx>
-#include <tools/rtti.hxx>
#include <tools/solar.h>
#include <svtools/unoevent.hxx>
#include <svl/macitem.hxx>
diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk
index 8d2bee72e829..11bd8424b0eb 100644
--- a/svx/AllLangResTarget_svx.mk
+++ b/svx/AllLangResTarget_svx.mk
@@ -26,19 +26,19 @@ $(eval $(call gb_AllLangResTarget_AllLangResTarget,svx))
$(eval $(call gb_AllLangResTarget_set_reslocation,svx,svx))
$(eval $(call gb_AllLangResTarget_add_srs,svx,\
- svx/res \
+ svx/res \
))
$(eval $(call gb_SrsTarget_SrsTarget,svx/res))
$(eval $(call gb_SrsTarget_set_include,svx/res,\
- $$(INCLUDE) \
- -I$(OUTDIR)/inc \
- -I$(WORKDIR)/inc \
- -I$(WORKDIR)/inc/svx \
- -I$(SRCDIR)/svx/source/inc \
- -I$(SRCDIR)/svx/source/dialog \
- -I$(SRCDIR)/svx/inc/ \
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc \
+ -I$(WORKDIR)/inc \
+ -I$(WORKDIR)/inc/svx \
+ -I$(SRCDIR)/svx/source/inc \
+ -I$(SRCDIR)/svx/source/dialog \
+ -I$(SRCDIR)/svx/inc/ \
))
$(eval $(call gb_SrsTarget_add_files,svx/res,\
@@ -100,36 +100,36 @@ $(call gb_SrsPartTarget_get_target,svx/source/form/formshell.src) : $(WORKDIR)/i
$(call gb_SrsTarget_get_clean_target,svx/res) : $(WORKDIR)/inc/svx/globlmn.hrc_clean
$(OUTDIR)/inc/svx/globlmn.hrc : $(WORKDIR)/inc/svx/globlmn.hrc
- $(call gb_Deliver_deliver,$<,$@)
+ $(call gb_Deliver_deliver,$<,$@)
# hack !!!
# just a temporary - globlmn.hrc about to be removed!
ifeq ($(strip $(WITH_LANG)),)
$(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc
- echo copying $@
- -mkdir -p $(WORKDIR)/inc/svx
- cp $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(WORKDIR)/inc/svx/globlmn.hrc
- rm -f $(WORKDIR)/inc/svx/lastrun.mk
+ echo copying $@
+ -mkdir -p $(WORKDIR)/inc/svx
+ cp $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(WORKDIR)/inc/svx/globlmn.hrc
+ rm -f $(WORKDIR)/inc/svx/lastrun.mk
else
-include $(WORKDIR)/inc/svx/lastrun.mk
ifneq ($(gb_lastrun_globlmn),MERGED)
.PHONY : $(WORKDIR)/inc/svx/globlmn.hrc
endif
$(WORKDIR)/inc/svx/globlmn.hrc : $(SRCDIR)/svx/inc/globlmn_tmpl.hrc $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf
- echo merging $@
- -mkdir -p $(WORKDIR)/inc/svx
- rm -f $(WORKDIR)/inc/svx/lastrun.mk
- echo gb_lastrun_globlmn:=MERGED > $(WORKDIR)/inc/svx/lastrun.mk
- $(call gb_Helper_abbreviate_dirs_native, \
- $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \
- -p svx \
- -i $< -o $@ -m $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf -l all)
+ echo merging $@
+ -mkdir -p $(WORKDIR)/inc/svx
+ rm -f $(WORKDIR)/inc/svx/lastrun.mk
+ echo gb_lastrun_globlmn:=MERGED > $(WORKDIR)/inc/svx/lastrun.mk
+ $(call gb_Helper_abbreviate_dirs_native, \
+ $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \
+ -p svx \
+ -i $< -o $@ -m $(gb_SrsPartMergeTarget_SDFLOCATION)/svx/inc/localize.sdf -l all)
endif
.PHONY : $(WORKDIR)/inc/svx/globlmn.hrc_clean
$(WORKDIR)/inc/svx/globlmn.hrc_clean :
- rm -f $(WORKDIR)/inc/svx/lastrun.mk \
- $(WORKDIR)/inc/svx/globlmn.hrc
+ rm -f $(WORKDIR)/inc/svx/lastrun.mk \
+ $(WORKDIR)/inc/svx/globlmn.hrc
# vim: set noet sw=4 ts=4:
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 6319a7713350..76853e0db467 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -178,10 +178,8 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/stbctrls/zoomctrl \
svx/source/svdraw/ActionDescriptionProvider \
svx/source/smarttags/SmartTagMgr \
- svx/source/svdraw/impgrfll \
svx/source/table/accessiblecell \
svx/source/table/accessibletableshape \
- svx/source/table/celleditsource \
svx/source/table/tabledesign \
svx/source/table/tablertfexporter \
svx/source/table/tablertfimporter \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 61a6eeee6c2b..cd89c46d4204 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -108,7 +108,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/engine3d/obj3d \
svx/source/engine3d/objfac3d \
svx/source/engine3d/polygn3d \
- svx/source/engine3d/polysc3d \
svx/source/engine3d/scene3d \
svx/source/engine3d/sphere3d \
svx/source/engine3d/svx3ditems \
@@ -227,7 +226,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/sdr/contact/sdrmediawindow \
svx/source/sdr/contact/viewobjectcontactofsdrmediaobj \
svx/source/sdr/contact/viewcontactofsdrcaptionobj \
- svx/source/sdr/contact/viewcontactofvirtobj \
svx/source/sdr/contact/viewcontactofe3dsphere \
svx/source/sdr/contact/viewcontactofe3dpolygon \
svx/source/sdr/contact/viewcontactofsdredgeobj \
@@ -285,7 +283,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/sdr/properties/properties \
svx/source/sdr/properties/e3dlatheproperties \
svx/source/sdr/properties/graphicproperties \
- svx/source/sdr/properties/circleproperties \
svx/source/sdr/properties/emptyproperties \
svx/source/sdr/properties/e3dsphereproperties \
svx/source/sdr/properties/defaultproperties \
@@ -323,13 +320,13 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/svdraw/svdibrow \
svx/source/svdraw/svditer \
svx/source/svdraw/svdlayer \
- svx/source/svdraw/svdmark \
svx/source/svdraw/svdmodel \
svx/source/svdraw/svdmrkv \
svx/source/svdraw/svdmrkv1 \
svx/source/svdraw/svdoashp \
svx/source/svdraw/svdoattr \
svx/source/svdraw/svdobj \
+ svx/source/svdraw/sdrobjectfactory \
svx/source/svdraw/svdocapt \
svx/source/svdraw/svdocirc \
svx/source/svdraw/svdoedge \
@@ -342,6 +339,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/svdraw/svdopath \
svx/source/svdraw/svdorect \
svx/source/svdraw/svdotext \
+ svx/source/svdraw/sdrtexthelpers \
svx/source/svdraw/svdotextdecomposition \
svx/source/svdraw/svdotextpathdecomposition \
svx/source/svdraw/svdotxat \
@@ -353,7 +351,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/svdraw/svdouno \
svx/source/svdraw/svdoutl \
svx/source/svdraw/svdoutlinercache \
- svx/source/svdraw/svdovirt \
svx/source/svdraw/svdpage \
svx/source/svdraw/svdpagv \
svx/source/svdraw/svdpntv \
@@ -363,9 +360,14 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/svdraw/svdtrans \
svx/source/svdraw/svdundo \
svx/source/svdraw/svdview \
- svx/source/svdraw/svdviter \
svx/source/svdraw/svdxcgv \
+ svx/source/svdraw/svdlegacy \
+ svx/source/svdraw/globaldrawitempool \
+ svx/source/svdraw/gluepoint \
+ svx/source/svdraw/svdsob \
+ svx/source/svdraw/sdrselection \
svx/source/table/cell \
+ svx/source/table/celleditsource \
svx/source/table/cellcursor \
svx/source/table/cellrange \
svx/source/table/propertyset \
diff --git a/svx/Package_inc.mk b/svx/Package_inc.mk
index 440671280f8b..7a74628ccb67 100644
--- a/svx/Package_inc.mk
+++ b/svx/Package_inc.mk
@@ -24,9 +24,6 @@
$(eval $(call gb_Package_Package,svx_inc,$(SRCDIR)/svx/inc))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/charthelper.hxx,svx/charthelper.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxsoitm.hxx,svx/sxsoitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdshtitm.hxx,svx/sdshtitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/polysc3d.hxx,svx/polysc3d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dataaccessdescriptor.hxx,svx/dataaccessdescriptor.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdoashp.hxx,svx/svdoashp.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dbaobjectex.hxx,svx/dbaobjectex.hxx))
@@ -40,23 +37,17 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/xcolit.hxx,svx/xcolit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xftmrit.hxx,svx/xftmrit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svxcommands.h,svx/svxcommands.h))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdview.hxx,svx/svdview.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxraitm.hxx,svx/sxraitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxroaitm.hxx,svx/sxroaitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/AccessibleTableShape.hxx,svx/AccessibleTableShape.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xflbmsxy.hxx,svx/xflbmsxy.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dlgctl3d.hxx,svx/dlgctl3d.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtaiitm.hxx,svx/sdtaiitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xtextit.hxx,svx/xtextit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/EnhancedCustomShapeFunctionParser.hxx,svx/EnhancedCustomShapeFunctionParser.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ucsubset.hxx,svx/ucsubset.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sderitm.hxx,svx/sderitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/obj3d.hxx,svx/obj3d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dbcharsethelper.hxx,svx/dbcharsethelper.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdangitm.hxx,svx/sdangitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/grfcrop.hxx,svx/grfcrop.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxtraitm.hxx,svx/sxtraitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/orienthelper.hxx,svx/orienthelper.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxonitm.hxx,svx/sxonitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xflbmpit.hxx,svx/xflbmpit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlineit.hxx,svx/xlineit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/SmartTagItem.hxx,svx/SmartTagItem.hxx))
@@ -90,8 +81,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/e3ditem.hxx,svx/e3ditem.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xoutbmp.hxx,svx/xoutbmp.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdotable.hxx,svx/svdotable.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xftshcit.hxx,svx/xftshcit.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxlogitm.hxx,svx/sxlogitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxrooitm.hxx,svx/sxrooitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fontwork.hxx,svx/fontwork.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxcecitm.hxx,svx/sxcecitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdginitm.hxx,svx/sdginitm.hxx))
@@ -99,11 +88,9 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdpntv.hxx,svx/svdpntv.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fontlb.hxx,svx/fontlb.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xfillit0.hxx,svx/xfillit0.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xsflclit.hxx,svx/xsflclit.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrpageuser.hxx,svx/sdrpageuser.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xbtmpit.hxx,svx/xbtmpit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svxids.hrc,svx/svxids.hrc))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/galmisc.hxx,svx/galmisc.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmfsitm.hxx,svx/sxmfsitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/extrusioncolorcontrol.hxx,svx/extrusioncolorcontrol.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmsrccfg.hxx,svx/fmsrccfg.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/pageitem.hxx,svx/pageitem.hxx))
@@ -111,18 +98,15 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrpaintwindow.hxx,svx/sdrpain
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmkitm.hxx,svx/sxmkitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xfillit.hxx,svx/xfillit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xflftrit.hxx,svx/xflftrit.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxopitm.hxx,svx/sxopitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unofill.hxx,svx/unofill.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/drawitem.hxx,svx/drawitem.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xmlgrhlp.hxx,svx/xmlgrhlp.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmresids.hrc,svx/fmresids.hrc))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/zoomitem.hxx,svx/zoomitem.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtcfitm.hxx,svx/sdtcfitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdmetitm.hxx,svx/sdmetitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmtools.hxx,svx/fmtools.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fntszctl.hxx,svx/fntszctl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxsiitm.hxx,svx/sxsiitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxlayitm.hxx,svx/sxlayitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unomid.hxx,svx/unomid.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/frmsel.hxx,svx/frmsel.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/e3dsceneupdater.hxx,svx/e3dsceneupdater.hxx))
@@ -151,9 +135,7 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmdmod.hxx,svx/fmdmod.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/exthelpid.hrc,svx/exthelpid.hrc))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmsearch.hxx,svx/fmsearch.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/pfiledlg.hxx,svx/pfiledlg.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmovitm.hxx,svx/sxmovitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmsrcimp.hxx,svx/fmsrcimp.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxsalitm.hxx,svx/sxsalitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdoole2.hxx,svx/svdoole2.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdsnpv.hxx,svx/svdsnpv.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/gallery1.hxx,svx/gallery1.hxx))
@@ -165,7 +147,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/EnhancedCustomShapeGeometry.hx
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svxitems.hrc,svx/svxitems.hrc))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmpage.hxx,svx/fmpage.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/srchdlg.hxx,svx/srchdlg.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxcaitm.hxx,svx/sxcaitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/subtoolboxcontrol.hxx,svx/subtoolboxcontrol.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdasaitm.hxx,svx/sdasaitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dbexch.hrc,svx/dbexch.hrc))
@@ -173,7 +154,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/unomaster.hxx,svx/unomaster.hx
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdedtv.hxx,svx/svdedtv.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlinjoit.hxx,svx/xlinjoit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlncapit.hxx,svx/xlncapit.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmbritm.hxx,svx/sxmbritm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/AccessibleGraphicShape.hxx,svx/AccessibleGraphicShape.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlnstit.hxx,svx/xlnstit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/volume3d.hxx,svx/volume3d.hxx))
@@ -201,7 +181,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/event/eventhandler.hxx,svx
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/properties/itemsettools.hxx,svx/sdr/properties/itemsettools.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/properties/connectorproperties.hxx,svx/sdr/properties/connectorproperties.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/properties/e3dlatheproperties.hxx,svx/sdr/properties/e3dlatheproperties.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/properties/circleproperties.hxx,svx/sdr/properties/circleproperties.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/properties/e3dsphereproperties.hxx,svx/sdr/properties/e3dsphereproperties.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/properties/captionproperties.hxx,svx/sdr/properties/captionproperties.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/properties/customshapeproperties.hxx,svx/sdr/properties/customshapeproperties.hxx))
@@ -239,7 +218,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/primitive2d/sdrconnectorpr
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx,svx/sdr/primitive2d/sdrgrafprimitive2d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/primitive3d/sdrattributecreator3d.hxx,svx/sdr/primitive3d/sdrattributecreator3d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/contact/viewcontactofe3dextrude.hxx,svx/sdr/contact/viewcontactofe3dextrude.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/contact/viewcontactofvirtobj.hxx,svx/sdr/contact/viewcontactofvirtobj.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/contact/viewcontactofe3dscene.hxx,svx/sdr/contact/viewcontactofe3dscene.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/contact/objectcontacttools.hxx,svx/sdr/contact/objectcontacttools.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/contact/objectcontact.hxx,svx/sdr/contact/objectcontact.hxx))
@@ -290,10 +268,8 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/attribute/sdrlinefillshado
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/attribute/sdrshadowtextattribute.hxx,svx/sdr/attribute/sdrshadowtextattribute.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdr/attribute/sdrtextattribute.hxx,svx/sdr/attribute/sdrtextattribute.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dialcontrol.hxx,svx/dialcontrol.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmlhitm.hxx,svx/sxmlhitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/optgenrl.hxx,svx/optgenrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unoshcol.hxx,svx/unoshcol.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtagitm.hxx,svx/sdtagitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xftsfit.hxx,svx/xftsfit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdograf.hxx,svx/svdograf.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/cube3d.hxx,svx/cube3d.hxx))
@@ -301,7 +277,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlnwtit.hxx,svx/xlnwtit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/zoom_def.hxx,svx/zoom_def.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/charmap.hxx,svx/charmap.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/connctrl.hxx,svx/connctrl.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtacitm.hxx,svx/sdtacitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/hyperdlg.hxx,svx/hyperdlg.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/tbxctl.hxx,svx/tbxctl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/f3dchild.hxx,svx/f3dchild.hxx))
@@ -316,7 +291,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdmodel.hxx,svx/svdmodel.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdtext.hxx,svx/svdtext.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/AccessibleTextHelper.hxx,svx/AccessibleTextHelper.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtayitm.hxx,svx/sdtayitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtmfitm.hxx,svx/sdtmfitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/zoomsliderctrl.hxx,svx/zoomsliderctrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/polygn3d.hxx,svx/polygn3d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdglob.hxx,svx/svdglob.hxx))
@@ -337,7 +311,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/algitem.hxx,svx/algitem.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxfiitm.hxx,svx/sxfiitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/grfflt.hxx,svx/grfflt.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/databaselocationinput.hxx,svx/databaselocationinput.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmsuitm.hxx,svx/sxmsuitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dialmgr.hxx,svx/dialmgr.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xdash.hxx,svx/xdash.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/grafctrl.hxx,svx/grafctrl.hxx))
@@ -345,7 +318,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlineit0.hxx,svx/xlineit0.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xfltrit.hxx,svx/xfltrit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/viewpt3d.hxx,svx/viewpt3d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xflbmsli.hxx,svx/xflbmsli.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmoitm.hxx,svx/sxmoitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/htmlmode.hxx,svx/htmlmode.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xmlsecctrl.hxx,svx/xmlsecctrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svx3ditems.hxx,svx/svx3ditems.hxx))
@@ -354,7 +326,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/measctrl.hxx,svx/measctrl.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdooitm.hxx,svx/sdooitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdpage.hxx,svx/svdpage.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdsob.hxx,svx/svdsob.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdshcitm.hxx,svx/sdshcitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtaitm.hxx,svx/sdtaitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdtrans.hxx,svx/svdtrans.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdgtritm.hxx,svx/sdgtritm.hxx))
@@ -381,18 +352,15 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/txenctab.hxx,svx/txenctab.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdorect.hxx,svx/svdorect.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xftshit.hxx,svx/xftshit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/pagectrl.hxx,svx/pagectrl.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxreoitm.hxx,svx/sxreoitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdtypes.hxx,svx/svdtypes.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ucsubset.hrc,svx/ucsubset.hrc))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/pszctrl.hxx,svx/pszctrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdattrx.hxx,svx/svdattrx.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtditm.hxx,svx/sdtditm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/swframevalidation.hxx,svx/swframevalidation.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xgrad.hxx,svx/xgrad.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdpoev.hxx,svx/svdpoev.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xflbckit.hxx,svx/xflbckit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xtextit0.hxx,svx/xtextit0.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxreaitm.hxx,svx/sxreaitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/lboxctrl.hxx,svx/lboxctrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fontworkgallery.hxx,svx/fontworkgallery.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ShapeTypeHandler.hxx,svx/ShapeTypeHandler.hxx))
@@ -409,14 +377,12 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/e3dundo.hxx,svx/e3dundo.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ChildrenManager.hxx,svx/ChildrenManager.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmgridcl.hxx,svx/fmgridcl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdobj.hxx,svx/svdobj.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmtaitm.hxx,svx/sxmtaitm.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrobjectfactory.hxx,svx/sdrobjectfactory.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/clipboardctl.hxx,svx/clipboardctl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xtable.hxx,svx/xtable.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdgcoitm.hxx,svx/sdgcoitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdovirt.hxx,svx/svdovirt.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmshell.hxx,svx/fmshell.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/IAccessibleParent.hxx,svx/IAccessibleParent.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdmark.hxx,svx/svdmark.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/strarray.hxx,svx/strarray.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdgluitm.hxx,svx/sdgluitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtakitm.hxx,svx/sdtakitm.hxx))
@@ -433,11 +399,9 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdomeas.hxx,svx/svdomeas.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/insctrl.hxx,svx/insctrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdoedge.hxx,svx/svdoedge.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/bmpmask.hxx,svx/bmpmask.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdshitm.hxx,svx/sdshitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svddef.hxx,svx/svddef.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/tbcontrl.hxx,svx/tbcontrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dstribut_enum.hxx,svx/dstribut_enum.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxcllitm.hxx,svx/sxcllitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/rubydialog.hxx,svx/rubydialog.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ipolypolygoneditorcontroller.hxx,svx/ipolypolygoneditorcontroller.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/AccessibleOLEShape.hxx,svx/AccessibleOLEShape.hxx))
@@ -447,16 +411,13 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/paraprev.hxx,svx/paraprev.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xftshxy.hxx,svx/xftshxy.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/tbxcustomshapes.hxx,svx/tbxcustomshapes.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrhittesthelper.hxx,svx/sdrhittesthelper.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdviter.hxx,svx/svdviter.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ofaitem.hxx,svx/ofaitem.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/frmdirlbox.hxx,svx/frmdirlbox.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/EnhancedCustomShape2d.hxx,svx/EnhancedCustomShape2d.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxoneitm.hxx,svx/sxoneitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/msdffdef.hxx,svx/msdffdef.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/globl3d.hxx,svx/globl3d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xattr.hxx,svx/xattr.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmuitm.hxx,svx/sxmuitm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdsxyitm.hxx,svx/sdsxyitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/postattr.hxx,svx/postattr.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdoattr.hxx,svx/svdoattr.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/prtqry.hxx,svx/prtqry.hxx))
@@ -465,38 +426,31 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdomedia.hxx,svx/svdomedia.hx
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xflboxy.hxx,svx/xflboxy.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/swframeposstrings.hxx,svx/swframeposstrings.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svditer.hxx,svx/svditer.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmspitm.hxx,svx/sxmspitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmobjfac.hxx,svx/fmobjfac.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdocirc.hxx,svx/svdocirc.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svxdlg.hxx,svx/svxdlg.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxenditm.hxx,svx/sxenditm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/def3d.hxx,svx/def3d.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/UnoNamespaceMap.hxx,svx/UnoNamespaceMap.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxciaitm.hxx,svx/sxciaitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/polypolygoneditor.hxx,svx/polypolygoneditor.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdgmoitm.hxx,svx/sdgmoitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/linectrl.hxx,svx/linectrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlnedcit.hxx,svx/xlnedcit.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmsitm.hxx,svx/sxmsitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdtaditm.hxx,svx/sdtaditm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdotext.hxx,svx/svdotext.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrtexthelpers.hxx,svx/sdrtexthelpers.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/chrtitem.hxx,svx/chrtitem.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxallitm.hxx,svx/sxallitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dlgutil.hxx,svx/dlgutil.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unopage.hxx,svx/unopage.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svddrag.hxx,svx/svddrag.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/AccessibleShapeTreeInfo.hxx,svx/AccessibleShapeTreeInfo.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxcgitm.hxx,svx/sxcgitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlnedwit.hxx,svx/xlnedwit.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdouno.hxx,svx/svdouno.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrmasterpagedescriptor.hxx,svx/sdrmasterpagedescriptor.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxcikitm.hxx,svx/sxcikitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdoutl.hxx,svx/svdoutl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/shapepropertynotifier.hxx,svx/shapepropertynotifier.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxctitm.hxx,svx/sxctitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/dbaexchange.hxx,svx/dbaexchange.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmtritm.hxx,svx/sxmtritm.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrobjectuser.hxx,svx/sdrobjectuser.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/AccessibleShape.hxx,svx/AccessibleShape.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/hlnkitem.hxx,svx/hlnkitem.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xhatch.hxx,svx/xhatch.hxx))
@@ -518,7 +472,6 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/modctrl.hxx,svx/modctrl.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/unoapi.hxx,svx/unoapi.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/ruler.hxx,svx/ruler.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrobjectfilter.hxx,svx/sdrobjectfilter.hxx))
-$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmtfitm.hxx,svx/sxmtfitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdundo.hxx,svx/svdundo.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/hdft.hxx,svx/hdft.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xmlexchg.hxx,svx/xmlexchg.hxx))
@@ -555,4 +508,7 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/colrctrl.hxx,svx/colrctrl.hxx)
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/fmdpage.hxx,svx/fmdpage.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmtpitm.hxx,svx/sxmtpitm.hxx))
$(eval $(call gb_Package_add_file,svx_inc,inc/svx/globlmn.hrc,globlmn_tmpl.hrc))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdlegacy.hxx,svx/svdlegacy.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/globaldrawitempool.hxx,svx/globaldrawitempool.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrselection.hxx,svx/sdrselection.hxx))
diff --git a/svx/inc/dragmt3d.hxx b/svx/inc/dragmt3d.hxx
index e21091187906..79e126beeed2 100644
--- a/svx/inc/dragmt3d.hxx
+++ b/svx/inc/dragmt3d.hxx
@@ -72,26 +72,25 @@ class E3dDragMethod : public SdrDragMethod
protected:
::std::vector< E3dDragMethodUnit > maGrp;
E3dDragConstraint meConstraint;
- Point maLastPos;
- Rectangle maFullBound;
+ basegfx::B2DPoint maLastPos;
+ basegfx::B2DRange maFullBound;
bool mbMoveFull;
bool mbMovedAtAll;
public:
- TYPEINFO();
E3dDragMethod(
- SdrDragView &rView,
- const SdrMarkList& rMark,
+ SdrView &rView,
+ const SdrObjectVector& rSelection,
E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
sal_Bool bFull = sal_False);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual void CancelSdrDrag();
virtual bool EndSdrDrag(bool bCopy);
- E3dView& Get3DView() { return (E3dView&)getSdrDragView(); }
+ E3dView& Get3DView() { return (E3dView&)getSdrView(); }
// for migration from XOR to overlay
virtual void CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverlayManager);
@@ -109,14 +108,13 @@ class E3dDragRotate : public E3dDragMethod
basegfx::B3DPoint maGlobalCenter;
public:
- TYPEINFO();
E3dDragRotate(
- SdrDragView &rView,
- const SdrMarkList& rMark,
+ SdrView &rView,
+ const SdrObjectVector& rSelection,
E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
sal_Bool bFull = sal_False);
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual Pointer GetSdrDragPointer() const;
};
@@ -130,18 +128,17 @@ public:
class E3dDragMove : public E3dDragMethod
{
SdrHdlKind meWhatDragHdl;
- Point maScaleFixPos;
+ basegfx::B2DPoint maScaleFixPos;
public:
- TYPEINFO();
E3dDragMove(
- SdrDragView &rView,
- const SdrMarkList& rMark,
+ SdrView &rView,
+ const SdrObjectVector& rSelection,
SdrHdlKind eDrgHdl = HDL_MOVE,
E3dDragConstraint eConstr = E3DDRAG_CONSTR_XYZ,
sal_Bool bFull = sal_False);
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual Pointer GetSdrDragPointer() const;
};
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx
index 947ca08aaa9a..7329dea791e5 100644
--- a/svx/inc/pch/precompiled_svx.hxx
+++ b/svx/inc/pch/precompiled_svx.hxx
@@ -867,7 +867,6 @@
#include "tools/resary.hxx"
#include "tools/resid.hxx"
#include "tools/resmgr.hxx"
-#include "tools/rtti.hxx"
#include "tools/shl.hxx"
#include "tools/solar.h"
#include "tools/stack.hxx"
diff --git a/svx/inc/svdibrow.hxx b/svx/inc/svdibrow.hxx
index 899a8a91e9fc..9380d86a2998 100644
--- a/svx/inc/svdibrow.hxx
+++ b/svx/inc/svdibrow.hxx
@@ -46,11 +46,11 @@ friend class ImpItemEdit;
sal_uInt16 nLastWhich;
sal_uInt16 nLastWhichOben;
sal_uInt16 nLastWhichUnten;
- FASTBOOL bWhichesButNames;
- FASTBOOL bDontHideIneffectiveItems;
- FASTBOOL bDontSortItems;
- FASTBOOL bShowWhichIds;
- FASTBOOL bShowRealValues;
+ bool bWhichesButNames;
+ bool bDontHideIneffectiveItems;
+ bool bDontSortItems;
+ bool bShowWhichIds;
+ bool bShowRealValues;
private:
#if _SOLAR__PRIVATE
void ImpCtor();
@@ -76,8 +76,8 @@ public:
void SetAttributes(const SfxItemSet* pAttr, const SfxItemSet* p2ndSet=NULL);
sal_uIntPtr GetCurrentPos() const;
sal_uInt16 GetCurrentWhich() const;
- virtual FASTBOOL BegChangeEntry(sal_uIntPtr nPos);
- virtual FASTBOOL EndChangeEntry();
+ virtual bool BegChangeEntry(sal_uIntPtr nPos);
+ virtual bool EndChangeEntry();
virtual void BrkChangeEntry();
/** GetCellText returns the text at the given position
@@ -110,7 +110,7 @@ public:
virtual void GetFocus();
void Clear() { aBrowse.Clear(); }
void SetAttributes(const SfxItemSet* pAttr, const SfxItemSet* p2ndSet=NULL) { aBrowse.SetAttributes(pAttr,p2ndSet); }
- void SetFloatingMode(FASTBOOL /*bOn*/) {}
+ void SetFloatingMode(bool /*bOn*/) {}
const _SdrItemBrowserControl& GetBrowserControl() const { return aBrowse; }
_SdrItemBrowserControl& GetBrowserControl() { return aBrowse; }
};
@@ -120,7 +120,7 @@ class SdrView;
class SdrItemBrowser: public _SdrItemBrowserWindow {
Timer aIdleTimer;
SdrView* pView;
- FASTBOOL bDirty;
+ bool bDirty;
private:
static Window* ImpGetViewWin(SdrView& rView);
DECL_LINK(IdleHdl,Timer*);
diff --git a/svx/inc/svx/EnhancedCustomShape2d.hxx b/svx/inc/svx/EnhancedCustomShape2d.hxx
index 4cbc31165f71..7efd5010212e 100644
--- a/svx/inc/svx/EnhancedCustomShape2d.hxx
+++ b/svx/inc/svx/EnhancedCustomShape2d.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <svx/EnhancedCustomShapeFunctionParser.hxx>
+#include <basegfx/range/b2drange.hxx>
#include <boost/shared_ptr.hpp>
#include <vector>
@@ -76,14 +77,15 @@ class SdrPathObj;
class EnhancedCustomShape2d : public SfxItemSet
{
+private:
SdrObject* pCustomShapeObj;
- MSO_SPT eSpType;
+ MSO_SPT meSpType;
sal_Int32 nCoordLeft;
sal_Int32 nCoordTop;
sal_Int32 nCoordWidth;
sal_Int32 nCoordHeight;
- Rectangle aLogicRect;
+ basegfx::B2DVector maLogicScale;
double fXScale;
double fYScale;
@@ -113,9 +115,9 @@ class EnhancedCustomShape2d : public SfxItemSet
sal_Bool bFilled : 1;
sal_Bool bStroked : 1;
- sal_Bool bFlipH;
- sal_Bool bFlipV;
- sal_Int32 nRotateAngle;
+// sal_Bool bFlipH;
+// sal_Bool bFlipV;
+// sal_Int32 nRotateAngle;
sal_Bool SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex );
sal_Int32 GetLuminanceChange( sal_uInt32 nIndex ) const;
@@ -124,7 +126,8 @@ class EnhancedCustomShape2d : public SfxItemSet
sal_uInt32& nColorIndex, sal_uInt32 nColorCount);
sal_Bool GetParameter( double& rParameterReturnValue, const com::sun::star::drawing::EnhancedCustomShapeParameter&,
const sal_Bool bReplaceGeoWidth, const sal_Bool bReplaceGeoHeight ) const;
- Point GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair&,
+ basegfx::B2DPoint GetPoint(
+ const com::sun::star::drawing::EnhancedCustomShapeParameterPair&,
const sal_Bool bScale = sal_True, const sal_Bool bReplaceGeoSize = sal_False ) const;
void CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegmentInd, std::vector< SdrPathObj* >& rObjectList,
@@ -161,17 +164,17 @@ class EnhancedCustomShape2d : public SfxItemSet
nRefX( -1 ), nRefY( -1 ), nRefAngle( -1 ), nRefR( -1 ) {};
};
- sal_Bool IsFlipVert() { return bFlipV; };
- sal_Bool IsFlipHorz() { return bFlipH; };
- sal_Int32 GetRotateAngle() { return nRotateAngle; };
+// sal_Bool IsFlipVert() { return bFlipV; };
+// sal_Bool IsFlipHorz() { return bFlipH; };
+// sal_Int32 GetRotateAngle() { return nRotateAngle; };
SVX_DLLPUBLIC SdrObject* CreateLineGeometry();
SVX_DLLPUBLIC SdrObject* CreateObject( sal_Bool bLineGeometryNeededOnly );
SVX_DLLPUBLIC void ApplyGluePoints( SdrObject* pObj );
- SVX_DLLPUBLIC Rectangle GetTextRect() const;
+ SVX_DLLPUBLIC basegfx::B2DRange GetTextRange() const;
SVX_DLLPUBLIC sal_uInt32 GetHdlCount() const;
- SVX_DLLPUBLIC sal_Bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const;
+ SVX_DLLPUBLIC sal_Bool GetHandlePosition( const sal_uInt32 nIndex, basegfx::B2DPoint& rReturnPosition ) const;
SVX_DLLPUBLIC sal_Bool SetHandleControllerPosition( const sal_uInt32 nIndex, const com::sun::star::awt::Point& rPosition );
SVX_DLLPUBLIC EnhancedCustomShape2d( SdrObject* pSdrObjCustomShape );
diff --git a/svx/inc/svx/SmartTagItem.hxx b/svx/inc/svx/SmartTagItem.hxx
index 7b58bed0f143..cada29677a0e 100644
--- a/svx/inc/svx/SmartTagItem.hxx
+++ b/svx/inc/svx/SmartTagItem.hxx
@@ -57,8 +57,8 @@ class SVX_DLLPUBLIC SvxSmartTagItem : public SfxPoolItem
const rtl::OUString maRangeText;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
+ SvxSmartTagItem();
SvxSmartTagItem( const sal_uInt16 nId,
const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< sal_Int32 > >& rActionIndicesSequence,
diff --git a/svx/inc/svx/SvxShapeTypes.hxx b/svx/inc/svx/SvxShapeTypes.hxx
index 437d15264a99..7380e1a26cc5 100644
--- a/svx/inc/svx/SvxShapeTypes.hxx
+++ b/svx/inc/svx/SvxShapeTypes.hxx
@@ -50,8 +50,6 @@ enum SvxShapeTypes
DRAWING_POLY_LINE,
DRAWING_OPEN_BEZIER,
DRAWING_CLOSED_BEZIER,
- DRAWING_OPEN_FREEHAND,
- DRAWING_CLOSED_FREEHAND,
DRAWING_POLY_POLYGON_PATH,
DRAWING_POLY_LINE_PATH,
DRAWING_GRAPHIC_OBJECT,
diff --git a/svx/inc/svx/algitem.hxx b/svx/inc/svx/algitem.hxx
index a239f1bf725b..2c86f22b937f 100644
--- a/svx/inc/svx/algitem.hxx
+++ b/svx/inc/svx/algitem.hxx
@@ -40,9 +40,8 @@ class SvStream;
class SVX_DLLPUBLIC SvxHorJustifyItem: public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxHorJustifyItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxHorJustifyItem( const sal_uInt16 nId = 0);
SvxHorJustifyItem(
const SvxCellHorJustify eJustify /*= SVX_HOR_JUSTIFY_STANDARD*/,
@@ -75,9 +74,8 @@ public:
class SVX_DLLPUBLIC SvxVerJustifyItem: public SfxEnumItem
{
public:
- TYPEINFO();
-
- SvxVerJustifyItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxVerJustifyItem( const sal_uInt16 nId = 0 );
SvxVerJustifyItem(
const SvxCellVerJustify eJustify /*= SVX_VER_JUSTIFY_STANDARD*/,
@@ -109,8 +107,6 @@ public:
class SVX_DLLPUBLIC SvxOrientationItem: public SfxEnumItem
{
public:
- TYPEINFO();
-
SvxOrientationItem(
const SvxCellOrientation eOrientation /*= SVX_ORIENTATION_STANDARD*/,
const sal_uInt16 nId );
@@ -155,8 +151,8 @@ class SVX_DLLPUBLIC SvxMarginItem: public SfxPoolItem
sal_Int16 nRightMargin;
sal_Int16 nBottomMargin;
public:
- TYPEINFO();
- SvxMarginItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxMarginItem( const sal_uInt16 nId = 0 );
SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/,
sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/,
const sal_uInt16 nId );
diff --git a/svx/inc/svx/camera3d.hxx b/svx/inc/svx/camera3d.hxx
index fa611c2f9279..ab29929e211e 100644
--- a/svx/inc/svx/camera3d.hxx
+++ b/svx/inc/svx/camera3d.hxx
@@ -46,7 +46,7 @@ class SVX_DLLPUBLIC Camera3D : public Viewport3D
double fFocalLength;
double fBankAngle;
- FASTBOOL bAutoAdjustProjection;
+ bool bAutoAdjustProjection;
public:
Camera3D(const basegfx::B3DPoint& rPos, const basegfx::B3DPoint& rLookAt,
@@ -82,9 +82,9 @@ class SVX_DLLPUBLIC Camera3D : public Viewport3D
// Um den Blickpunkt drehen, Position wird dabei veraendert
void RotateAroundLookAt(double fHAngle, double fVAngle);
- void SetAutoAdjustProjection(FASTBOOL bAdjust = sal_True)
+ void SetAutoAdjustProjection(bool bAdjust = sal_True)
{ bAutoAdjustProjection = bAdjust; }
- FASTBOOL IsAutoAdjustProjection() const { return bAutoAdjustProjection; }
+ bool IsAutoAdjustProjection() const { return bAutoAdjustProjection; }
};
#endif // _CAMERA3D_HXX
diff --git a/svx/inc/svx/charthelper.hxx b/svx/inc/svx/charthelper.hxx
index 9cfcaac84d85..4a0ac0d5eb95 100644
--- a/svx/inc/svx/charthelper.hxx
+++ b/svx/inc/svx/charthelper.hxx
@@ -27,7 +27,6 @@
#include <basegfx/range/b2drange.hxx>
#include <svx/svxdllapi.h>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <com/sun/star/embed/XEmbeddedObject.hpp>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
@@ -49,17 +48,6 @@ public:
static drawinglayer::primitive2d::Primitive2DSequence tryToGetChartContentAsPrimitive2DSequence(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rXModel,
basegfx::B2DRange& rRange);
-
- // #121334# Allow to switch off line and fill style by setting these as attributes
- // at the OLE chart object. This is needed to allow fill styles of the covering objects
- // to make their own fill/line settings work. This should not be done by changing
- // the defaults at the chart (see StaticPageBackgroundDefaults_Initializer::lcl_AddDefaultsToMap)
- // since this would not be saved/loaded, thus the compatibility will be better when setting it at
- // newly created charts using this method
- static void AdaptDefaultsForChart(
- const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > & xEmbObj,
- bool bNoFillStyle = true,
- bool bNoLineStyle = true);
};
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/chrtitem.hxx b/svx/inc/svx/chrtitem.hxx
index b23cd7ff1b6f..5a4d4fa2afe8 100644
--- a/svx/inc/svx/chrtitem.hxx
+++ b/svx/inc/svx/chrtitem.hxx
@@ -171,7 +171,6 @@ enum SvxChartRegress
class SVX_DLLPUBLIC SvxChartStyleItem : public SfxEnumItem
{
public:
- TYPEINFO();
SvxChartStyleItem(SvxChartStyle eStyle /*= CHSTYLE_2D_LINE*/,
sal_uInt16 nId );
SvxChartStyleItem(SvStream& rIn, sal_uInt16 nId );
@@ -189,7 +188,6 @@ public:
class SVX_DLLPUBLIC SvxChartRegressItem : public SfxEnumItem
{
public:
- TYPEINFO();
SvxChartRegressItem(SvxChartRegress eRegress /*= CHREGRESS_LINEAR*/,
sal_uInt16 nId );
SvxChartRegressItem(SvStream& rIn, sal_uInt16 nId );
@@ -208,7 +206,6 @@ public:
class SVX_DLLPUBLIC SvxChartDataDescrItem : public SfxEnumItem
{
public:
- TYPEINFO();
SvxChartDataDescrItem(SvxChartDataDescr eDataDescr /*= CHDESCR_NONE*/,
sal_uInt16 nId );
SvxChartDataDescrItem(SvStream& rIn,
@@ -227,7 +224,6 @@ public:
class SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem
{
public:
- TYPEINFO();
SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= CHTXTORDER_SIDEBYSIDE*/,
sal_uInt16 nId );
SvxChartTextOrderItem(SvStream& rIn,
@@ -249,7 +245,6 @@ public:
class SVX_DLLPUBLIC SvxChartTextOrientItem : public SfxEnumItem
{
public:
- TYPEINFO();
SvxChartTextOrientItem(SvxChartTextOrient /*eOrient = CHTXTORIENT_STANDARD*/,
sal_uInt16 nId );
SvxChartTextOrientItem(SvStream& rIn,
@@ -268,7 +263,6 @@ public:
class SVX_DLLPUBLIC SvxChartKindErrorItem : public SfxEnumItem
{
public:
- TYPEINFO();
SvxChartKindErrorItem(SvxChartKindError /*eOrient = CHERROR_NONE*/,
sal_uInt16 nId );
SvxChartKindErrorItem(SvStream& rIn,
@@ -289,7 +283,6 @@ public:
class SVX_DLLPUBLIC SvxChartIndicateItem : public SfxEnumItem
{
public:
- TYPEINFO();
SvxChartIndicateItem(SvxChartIndicate eOrient /*= CHINDICATE_NONE*/,
sal_uInt16 nId );
SvxChartIndicateItem(SvStream& rIn,
@@ -312,8 +305,8 @@ class SVX_DLLPUBLIC SvxDoubleItem : public SfxPoolItem
double fVal;
public:
- TYPEINFO();
- SvxDoubleItem(double fValue /*= 0.0*/, sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxDoubleItem(double fValue = 0.0, sal_uInt16 nId = 0 );
SvxDoubleItem(SvStream& rIn, sal_uInt16 nId );
SvxDoubleItem(const SvxDoubleItem& rItem);
diff --git a/svx/inc/svx/clipfmtitem.hxx b/svx/inc/svx/clipfmtitem.hxx
index 2f73f976e58a..4193e7e308de 100644
--- a/svx/inc/svx/clipfmtitem.hxx
+++ b/svx/inc/svx/clipfmtitem.hxx
@@ -41,7 +41,7 @@ protected:
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxClipboardFmtItem( sal_uInt16 nId = 0 );
SvxClipboardFmtItem( const SvxClipboardFmtItem& );
virtual ~SvxClipboardFmtItem();
diff --git a/svx/inc/svx/connctrl.hxx b/svx/inc/svx/connctrl.hxx
index f014e3acf571..144814196d50 100644
--- a/svx/inc/svx/connctrl.hxx
+++ b/svx/inc/svx/connctrl.hxx
@@ -47,7 +47,7 @@ class SVX_DLLPUBLIC SvxXConnectionPreview : public Control
private:
const SfxItemSet& rAttrs;
SdrEdgeObj* pEdgeObj;
- SdrObjList* pObjList;
+ SdrObjectVector maSdrObjectVector;
const SdrView* pView;
SVX_DLLPRIVATE void SetStyles();
diff --git a/svx/inc/svx/contdlg.hxx b/svx/inc/svx/contdlg.hxx
index b2cb4407a7da..a6393047c256 100644
--- a/svx/inc/svx/contdlg.hxx
+++ b/svx/inc/svx/contdlg.hxx
@@ -70,7 +70,6 @@ protected:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
public:
-
SvxContourDlgItem( sal_uInt16 nId, SvxSuperContourDlg& rDlg, SfxBindings& rBindings );
};
diff --git a/svx/inc/svx/cube3d.hxx b/svx/inc/svx/cube3d.hxx
index c6751f921987..6e00038a4084 100644
--- a/svx/inc/svx/cube3d.hxx
+++ b/svx/inc/svx/cube3d.hxx
@@ -54,21 +54,29 @@ private:
sal_uInt16 nSideFlags;
// BOOLeans
- unsigned bPosIsCenter : 1;
+ bool bPosIsCenter : 1;
protected:
- void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual ~E3dCubeObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
- TYPEINFO();
- E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize);
- E3dCubeObj();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- virtual sal_uInt16 GetObjIdentifier() const;
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ E3dCubeObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint aPos = basegfx::B3DPoint(-0.5, -0.5, -0.5),
+ const basegfx::B3DVector a3DSize = basegfx::B3DVector(1.0, 1.0, 1.0));
- virtual void operator=(const SdrObject&);
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
// Lokale Parameter setzen mit Geometrieneuerzeugung
void SetCubePos(const basegfx::B3DPoint& rNew);
@@ -77,8 +85,8 @@ public:
void SetCubeSize(const basegfx::B3DVector& rNew);
const basegfx::B3DVector& GetCubeSize() { return aCubeSize; }
- void SetPosIsCenter(sal_Bool bNew);
- sal_Bool GetPosIsCenter() { return (sal_Bool)bPosIsCenter; }
+ void SetPosIsCenter(bool bNew);
+ bool GetPosIsCenter() { return bPosIsCenter; }
void SetSideFlags(sal_uInt16 nNew);
sal_uInt16 GetSideFlags() { return nSideFlags; }
diff --git a/svx/inc/svx/deflt3d.hxx b/svx/inc/svx/deflt3d.hxx
index 1e2d5dd9fdc3..12e7172b8194 100644
--- a/svx/inc/svx/deflt3d.hxx
+++ b/svx/inc/svx/deflt3d.hxx
@@ -77,7 +77,7 @@ public:
// Getter/Setter fuer Default-Werte aller 3D-Objekte
// Compound-Objekt
- const Color& GetDefaultAmbientColor() { return aDefaultAmbientColor; }
+ const Color& GetDefaultAmbientColor() const { return aDefaultAmbientColor; }
void SetDefaultAmbientColor(const Color& rNew) { aDefaultAmbientColor = rNew; }
sal_Bool GetDefaultCreateNormals() const { return bDefaultCreateNormals; }
@@ -86,9 +86,9 @@ public:
void SetDefaultCreateTexture(const sal_Bool bNew) { bDefaultCreateTexture = bNew; }
// Cube-Objekt
- const basegfx::B3DPoint& GetDefaultCubePos() { return aDefaultCubePos; }
+ const basegfx::B3DPoint& GetDefaultCubePos() const { return aDefaultCubePos; }
void SetDefaultCubePos(const basegfx::B3DPoint& rNew) { aDefaultCubePos = rNew; }
- const basegfx::B3DVector& GetDefaultCubeSize() { return aDefaultCubeSize; }
+ const basegfx::B3DVector& GetDefaultCubeSize() const { return aDefaultCubeSize; }
void SetDefaultCubeSize(const basegfx::B3DVector& rNew) { aDefaultCubeSize = rNew; }
sal_uInt16 GetDefaultCubeSideFlags() const { return nDefaultCubeSideFlags; }
void SetDefaultCubeSideFlags(const sal_uInt16 nNew) { nDefaultCubeSideFlags = nNew; }
@@ -96,9 +96,9 @@ public:
void SetDefaultCubePosIsCenter(const sal_Bool bNew) { bDefaultCubePosIsCenter = bNew; }
// Sphere-Objekt
- const basegfx::B3DPoint& GetDefaultSphereCenter() { return aDefaultSphereCenter; }
+ const basegfx::B3DPoint& GetDefaultSphereCenter() const { return aDefaultSphereCenter; }
void SetDefaultSphereCenter(const basegfx::B3DPoint& rNew) { aDefaultSphereCenter = rNew; }
- const basegfx::B3DVector& GetDefaultSphereSize() { return aDefaultSphereSize; }
+ const basegfx::B3DVector& GetDefaultSphereSize() const { return aDefaultSphereSize; }
void SetDefaultSphereSize(const basegfx::B3DPoint& rNew) { aDefaultSphereSize = rNew; }
// Lathe-Objekt
diff --git a/svx/inc/svx/dlgctl3d.hxx b/svx/inc/svx/dlgctl3d.hxx
index 826d3d69f9fc..9de5585ca480 100644
--- a/svx/inc/svx/dlgctl3d.hxx
+++ b/svx/inc/svx/dlgctl3d.hxx
@@ -36,7 +36,7 @@
class FmFormModel;
class FmFormPage;
class E3dView;
-class E3dPolyScene;
+class E3dScene;
class E3dObject;
//////////////////////////////////////////////////////////////////////////////
@@ -52,7 +52,7 @@ protected:
FmFormModel* mpModel;
FmFormPage* mpFmPage;
E3dView* mp3DView;
- E3dPolyScene* mpScene;
+ E3dScene* mpScene;
E3dObject* mp3DObj;
sal_uInt16 mnObjectType;
@@ -106,8 +106,8 @@ class SVX_DLLPUBLIC Svx3DLightControl : public Svx3DPreviewControl
double mfSaveActionStartRotZ;
// bitfield
- unsigned mbMouseMoved : 1;
- unsigned mbGeometrySelected : 1;
+ bool mbMouseMoved : 1;
+ bool mbGeometrySelected : 1;
void Construct2();
void ConstructLightObjects();
diff --git a/svx/inc/svx/drawitem.hxx b/svx/inc/svx/drawitem.hxx
index c0de777b2657..eb6823482d85 100644
--- a/svx/inc/svx/drawitem.hxx
+++ b/svx/inc/svx/drawitem.hxx
@@ -41,7 +41,7 @@ class SVX_DLLPUBLIC SvxColorTableItem: public SfxPoolItem
XColorTable* pColorTable;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxColorTableItem();
SvxColorTableItem( XColorTable* pTable,
sal_uInt16 nWhich );
@@ -75,7 +75,7 @@ class SVX_DLLPUBLIC SvxGradientListItem: public SfxPoolItem
XGradientList* pGradientList;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxGradientListItem();
SvxGradientListItem( XGradientList* pList,
sal_uInt16 nWhich );
@@ -110,7 +110,7 @@ class SVX_DLLPUBLIC SvxHatchListItem: public SfxPoolItem
XHatchList* pHatchList;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxHatchListItem();
SvxHatchListItem( XHatchList* pList,
sal_uInt16 nWhich );
@@ -145,7 +145,7 @@ class SVX_DLLPUBLIC SvxBitmapListItem: public SfxPoolItem
XBitmapList* pBitmapList;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxBitmapListItem();
SvxBitmapListItem( XBitmapList* pBL,
sal_uInt16 nWhich );
@@ -180,7 +180,7 @@ class SVX_DLLPUBLIC SvxDashListItem: public SfxPoolItem
XDashList* pDashList;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxDashListItem();
SvxDashListItem( XDashList* pList,
sal_uInt16 nWhich );
@@ -214,7 +214,7 @@ class SVX_DLLPUBLIC SvxLineEndListItem: public SfxPoolItem
XLineEndList* pLineEndList;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxLineEndListItem();
SvxLineEndListItem( XLineEndList* pList,
sal_uInt16 nWhich );
diff --git a/svx/inc/svx/e3ditem.hxx b/svx/inc/svx/e3ditem.hxx
index d4e447210930..1d5484a6aa89 100644
--- a/svx/inc/svx/e3ditem.hxx
+++ b/svx/inc/svx/e3ditem.hxx
@@ -38,7 +38,6 @@ class SVX_DLLPUBLIC SvxB3DVectorItem : public SfxPoolItem
basegfx::B3DVector aVal;
public:
- TYPEINFO();
SvxB3DVectorItem();
SvxB3DVectorItem( sal_uInt16 nWhich, const basegfx::B3DVector& rVal );
SvxB3DVectorItem( sal_uInt16 nWhich, SvStream & );
diff --git a/svx/inc/svx/e3dundo.hxx b/svx/inc/svx/e3dundo.hxx
index 86b7fe6ae507..ba8093c49394 100644
--- a/svx/inc/svx/e3dundo.hxx
+++ b/svx/inc/svx/e3dundo.hxx
@@ -43,7 +43,6 @@ class E3dUndoAction : public SdrUndoAction
E3dObject *pMy3DObj;
public:
- TYPEINFO();
E3dUndoAction (SdrModel *pModel,
E3dObject *p3DObj) :
SdrUndoAction (*pModel),
@@ -67,7 +66,6 @@ class E3dRotateUndoAction : public E3dUndoAction
basegfx::B3DHomMatrix aMyNewRotation;
public:
- TYPEINFO();
E3dRotateUndoAction (SdrModel *pModel,
E3dObject *p3DObj,
const basegfx::B3DHomMatrix &aOldRotation,
@@ -102,7 +100,6 @@ class SVX_DLLPUBLIC E3dAttributesUndoAction : public SdrUndoAction
const SfxItemSet aOldSet;
public:
- TYPEINFO();
E3dAttributesUndoAction( SdrModel &rModel, E3dView* pView,
E3dObject* pInObject,
const SfxItemSet& rNewSet,
diff --git a/svx/inc/svx/extrud3d.hxx b/svx/inc/svx/extrud3d.hxx
index 5c976cdf15e6..153812c27e60 100644
--- a/svx/inc/svx/extrud3d.hxx
+++ b/svx/inc/svx/extrud3d.hxx
@@ -45,25 +45,35 @@ private:
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
+
+ virtual ~E3dExtrudeObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth);
- E3dExtrudeObj();
+ E3dExtrudeObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B2DPolyPolygon aPP = basegfx::B2DPolyPolygon(),
+ double fDepth = 0.0);
+// E3dExtrudeObj();
// PercentDiagonal: 0..100, before 0.0..0.5
sal_uInt16 GetPercentDiagonal() const
- { return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
+ { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
// BackScale: 0..100, before 0.0..1.0
sal_uInt16 GetPercentBackScale() const
- { return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
+ { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
// BackScale: 0..100, before 0.0..1.0
sal_uInt32 GetExtrudeDepth() const
- { return ((const Svx3DDepthItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH)).GetValue(); }
+ { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DEPTH)).GetValue(); }
// #107245# GetSmoothNormals() for bExtrudeSmoothed
sal_Bool GetSmoothNormals() const
@@ -87,8 +97,6 @@ public:
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void operator=(const SdrObject&);
-
// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
diff --git a/svx/inc/svx/extrusionbar.hxx b/svx/inc/svx/extrusionbar.hxx
index 41128c047de7..2d5aae109291 100644
--- a/svx/inc/svx/extrusionbar.hxx
+++ b/svx/inc/svx/extrusionbar.hxx
@@ -42,7 +42,6 @@ SVX_DLLPUBLIC bool checkForSelectedCustomShapes( SdrView* pSdrView, bool bOnlyEx
class SVX_DLLPUBLIC ExtrusionBar : public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SVX_INTERFACE_EXTRUSION_BAR)
ExtrusionBar(SfxViewShell* pViewShell );
diff --git a/svx/inc/svx/float3d.hxx b/svx/inc/svx/float3d.hxx
index bc3a58ecaf7e..8a91e78478e2 100644
--- a/svx/inc/svx/float3d.hxx
+++ b/svx/inc/svx/float3d.hxx
@@ -58,7 +58,6 @@ class FmFormModel;
class FmFormPage;
class VirtualDevice;
class E3dView;
-class SdrPageView;
class Svx3DCtrlItem;
class SvxConvertTo3DItem;
diff --git a/svx/inc/svx/fmglob.hxx b/svx/inc/svx/fmglob.hxx
index b4888fe56e40..b318579e003f 100644
--- a/svx/inc/svx/fmglob.hxx
+++ b/svx/inc/svx/fmglob.hxx
@@ -28,6 +28,7 @@
#include <svx/svdobj.hxx>
#include <com/sun/star/form/FormComponentType.hpp>
+// TTTT: Needed at all? SdrObjKind == OBJ_UNO for all these anyways
const sal_uInt32 FmFormInventor = sal_uInt32('F')*0x00000001+
sal_uInt32('M')*0x00000100+
sal_uInt32('0')*0x00010000+
diff --git a/svx/inc/svx/fmmodel.hxx b/svx/inc/svx/fmmodel.hxx
index fb3e7e9cb019..c3e95dda970d 100644
--- a/svx/inc/svx/fmmodel.hxx
+++ b/svx/inc/svx/fmmodel.hxx
@@ -51,23 +51,15 @@ private:
SVX_DLLPRIVATE void operator=(const FmFormModel& rSrcModel); // never implemented
public:
- TYPEINFO();
-
- FmFormModel(SfxItemPool* pPool=NULL, SfxObjectShell* pPers=NULL );
- FmFormModel(const XubString& rPath, SfxItemPool* pPool=NULL,
- SfxObjectShell* pPers=NULL );
- FmFormModel(SfxItemPool* pPool, SfxObjectShell* pPers, FASTBOOL bUseExtColorTable);
- FmFormModel(const XubString& rPath, SfxItemPool* pPool, SfxObjectShell* pPers,
- FASTBOOL bUseExtColorTable);
-
+ FmFormModel(const XubString& rPath = XubString(), SfxItemPool* pPool = 0, SfxObjectShell* pPers = 0, bool bUseExtColorTable = 0);
virtual ~FmFormModel();
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
- virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
- virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
- virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
- virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
- virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
+ virtual SdrPage* AllocPage(bool bMasterPage);
+ virtual void InsertPage(SdrPage* pPage, sal_uInt32 nPos=0xffffffff);
+ virtual SdrPage* RemovePage(sal_uInt32 nPgNum);
+ virtual void MovePage(sal_uInt32 nPgNum, sal_uInt32 nNewPos);
+ virtual void InsertMasterPage(SdrPage* pPage, sal_uInt32 nPos=0xffffffff);
+ virtual SdrPage* RemoveMasterPage(sal_uInt32 nPgNum);
virtual SdrLayerID GetControlExportLayerId( const SdrObject& rObj ) const;
SfxObjectShell* GetObjectShell() const { return m_pObjShell; }
diff --git a/svx/inc/svx/fmpage.hxx b/svx/inc/svx/fmpage.hxx
index c12474ad9756..05de0c5cf237 100644
--- a/svx/inc/svx/fmpage.hxx
+++ b/svx/inc/svx/fmpage.hxx
@@ -40,27 +40,26 @@ class HelpEvent;
class SVX_DLLPUBLIC FmFormPage : public SdrPage
{
+private:
friend class FmFormObj;
+
FmFormPageImpl* m_pImpl;
String m_sPageName;
StarBASIC* m_pBasic;
+protected:
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrPage(const SdrPage& rSource);
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrPage* CloneSdrPage(SdrModel* pTargetModel = 0) const;
- FmFormPage(FmFormModel& rModel,StarBASIC*, FASTBOOL bMasterPage=sal_False);
- FmFormPage(const FmFormPage& rPage);
+ FmFormPage(FmFormModel& rModel, StarBASIC*, bool bMasterPage = false);
~FmFormPage();
- virtual void SetModel(SdrModel* pNewModel);
-
- virtual SdrPage* Clone() const;
- using SdrPage::Clone;
-
- virtual void InsertObject(SdrObject* pObj, sal_uLong nPos = CONTAINER_APPEND,
- const SdrInsertReason* pReason=NULL);
-
- virtual SdrObject* RemoveObject(sal_uLong nObjNum);
+ virtual void InsertObjectToSdrObjList(SdrObject& rObj, sal_uInt32 nPos = CONTAINER_APPEND);
+ virtual SdrObject* RemoveObjectFromSdrObjList(sal_uInt32 nObjNum);
// Zugriff auf alle Formulare
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& GetForms( bool _bForceCreate = true ) const;
@@ -69,7 +68,6 @@ public:
FmFormPageImpl& GetImpl() const { return *m_pImpl; }
#endif // SVX_LIGHT
-public:
const String& GetName() const { return m_sPageName; }
void SetName( const String& rName ) { m_sPageName = rName; }
StarBASIC* GetBasic() const { return m_pBasic; }
diff --git a/svx/inc/svx/fmshell.hxx b/svx/inc/svx/fmshell.hxx
index abf66a976a88..3ecd49b01a83 100644
--- a/svx/inc/svx/fmshell.hxx
+++ b/svx/inc/svx/fmshell.hxx
@@ -67,7 +67,6 @@ class SVX_DLLPUBLIC FmDesignModeChangedHint : public SfxHint
sal_Bool m_bDesignMode;
public:
- TYPEINFO();
FmDesignModeChangedHint( sal_Bool bDesMode );
virtual ~FmDesignModeChangedHint();
@@ -105,12 +104,10 @@ class SVX_DLLPUBLIC FmFormShell : public SfxShell
};
friend class FormShellWaitObject;
- const OutputDevice* GetCurrentViewDevice() const { return m_pFormView ? m_pFormView->GetActualOutDev() : NULL; }
+ const OutputDevice* GetCurrentViewDevice() const { return m_pFormView ? m_pFormView->GetCurrentViewDevice() : NULL; }
public:
SFX_DECL_INTERFACE(SVX_INTERFACE_FORM_SH)
- TYPEINFO();
-
FmFormShell(SfxViewShell* pParent, FmFormView* pView = NULL);
virtual ~FmFormShell();
diff --git a/svx/inc/svx/fmview.hxx b/svx/inc/svx/fmview.hxx
index d571b2ec76a5..fc3f5394fc65 100644
--- a/svx/inc/svx/fmview.hxx
+++ b/svx/inc/svx/fmview.hxx
@@ -60,11 +60,11 @@ class SVX_DLLPUBLIC FmFormView : public E3dView
void Init();
public:
- TYPEINFO();
-
- FmFormView(FmFormModel* pModel, OutputDevice* pOut = 0L);
+ FmFormView(FmFormModel& rModel, OutputDevice* pOut = 0);
virtual ~FmFormView();
+ const OutputDevice* GetCurrentViewDevice() const { return GetActualOutDev() ; }
+
/** create a control pair (label/bound control) for the database field description given.
@param rFieldDesc
description of the field. see clipboard format SBA-FIELDFORMAT
@@ -81,7 +81,7 @@ public:
*/
SdrObject* CreateXFormsControl( const ::svx::OXFormsDescriptor &_rDesc );
- virtual void MarkListHasChanged();
+ virtual void handleSelectionChange();
virtual void AddWindowToPaintView(OutputDevice* pNewWin);
virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
@@ -102,15 +102,15 @@ public:
SdrUnoObj*& _rpControl
);
- virtual SdrPageView* ShowSdrPage(SdrPage* pPage);
+ virtual void ShowSdrPage(SdrPage& rPage);
virtual void HideSdrPage();
// for copying complete form structures, not only control models
virtual SdrModel* GetMarkedObjModel() const;
using E3dView::Paste;
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ virtual bool Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
- virtual sal_Bool MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin );
+ virtual bool MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin );
/** grab the focus to the first form control on the view
@param _bForceSync
@@ -124,9 +124,9 @@ public:
GetFormController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm, const OutputDevice& _rDevice ) const;
// SdrView
- sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+ virtual bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
- /// shortcut to "GetSdrPageView() ? PTR_CAST( FmFormPage, GetSdrPageView() ) : NULL"
+ /// shortcut to "GetSdrPageView() ? dynamic_cast< FmFormPage* >( GetSdrPageView() ) : NULL"
FmFormPage* GetCurPage();
SVX_DLLPRIVATE void ActivateControls(SdrPageView*);
@@ -148,11 +148,9 @@ public:
virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut);
virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer);
- SVX_DLLPRIVATE const OutputDevice* GetActualOutDev() const {return pActualOutDev;}
SVX_DLLPRIVATE sal_Bool checkUnMarkAll(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xSource);
private:
- SVX_DLLPRIVATE void AdjustMarks(const SdrMarkList& rMarkList);
SVX_DLLPRIVATE FmFormObj* getMarkedGrid() const;
protected:
using E3dView::SetMoveOutside;
diff --git a/svx/inc/svx/fontwork.hxx b/svx/inc/svx/fontwork.hxx
index 63d060d22fc9..fda7dcdfc0b8 100644
--- a/svx/inc/svx/fontwork.hxx
+++ b/svx/inc/svx/fontwork.hxx
@@ -41,9 +41,7 @@
// forward ---------------------------------------------------------------
class SdrView;
-class SdrPageView;
class SdrObject;
-
class XFormTextAdjustItem;
class XFormTextDistanceItem;
class XFormTextStartItem;
@@ -184,7 +182,7 @@ class SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow
void SetColorTable(const XColorTable* pTable);
void SetActive(sal_Bool bActivate = sal_True);
- void CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
+ void CreateStdFormObj(SdrView& rView,
const SfxItemSet& rAttr, SdrObject& rOldObj,
XFormTextStdForm eForm);
};
diff --git a/svx/inc/svx/fontworkbar.hxx b/svx/inc/svx/fontworkbar.hxx
index d4c578f6cc5e..ae4b37168710 100644
--- a/svx/inc/svx/fontworkbar.hxx
+++ b/svx/inc/svx/fontworkbar.hxx
@@ -42,7 +42,6 @@ bool SVX_DLLPUBLIC checkForSelectedFontWork( SdrView* pSdrView, sal_uInt32& nChe
class SVX_DLLPUBLIC FontworkBar : public SfxShell
{
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SVX_INTERFACE_FONTWORK_BAR)
FontworkBar(SfxViewShell* pViewShell );
diff --git a/svx/inc/svx/fontworkgallery.hxx b/svx/inc/svx/fontworkgallery.hxx
index e2452c3078ea..3d8fb052d097 100644
--- a/svx/inc/svx/fontworkgallery.hxx
+++ b/svx/inc/svx/fontworkgallery.hxx
@@ -95,17 +95,16 @@ class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog
sal_uInt16 mnThemeId;
- SdrView* mpSdrView;
- FmFormModel* mpModel;
+ SdrView& mrSdrView;
+ FmFormModel& mrModel;
String maStrClickToAddText;
+ SdrObject** mppSdrObject;
DECL_LINK( DoubleClickFavoriteHdl, void * );
DECL_LINK( ClickOKHdl, void * );
DECL_LINK( ClickTextDirectionHdl, ImageButton * );
- SdrObject** mppSdrObject;
- SdrModel* mpDestModel;
void initfavorites(sal_uInt16 nThemeId, std::vector< Bitmap * >& rFavorites);
void insertSelectedFontwork();
@@ -115,11 +114,11 @@ class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog
std::vector< Bitmap * > maFavoritesHorizontal;
public:
- FontWorkGalleryDialog( SdrView* pView, Window* pParent, sal_uInt16 nSID );
+ // if ppSdrObject is given the object is not inserted to the current page of the given view, but
+ // set at that pointer for further usage (ownership change). The SDrObject is always created
+ // for the SdrModel of the given SDrView.
+ FontWorkGalleryDialog( SdrView& rView, Window* pParent, SdrObject** ppSdrObject = 0 );
~FontWorkGalleryDialog();
-
- // SJ: if the SdrObject** is set, the SdrObject is not inserted into the page when executing the dialog
- void SetSdrObjectRef( SdrObject**, SdrModel* pModel );
};
}
diff --git a/svx/inc/svx/galmisc.hxx b/svx/inc/svx/galmisc.hxx
index 58c98d2868fb..9f36cee0b625 100644
--- a/svx/inc/svx/galmisc.hxx
+++ b/svx/inc/svx/galmisc.hxx
@@ -35,6 +35,7 @@
#include "svx/svxdllapi.h"
#include <tools/date.hxx>
#include <tools/time.hxx>
+#include <svx/sdrobjectfactory.hxx>
// ------------
// - Forwards -
@@ -122,10 +123,10 @@ class SgaIMapInfo : public SdrObjUserData, public SfxListener
ImageMap aImageMap;
public:
- SgaIMapInfo() : SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO, 0 ) {};
+ SgaIMapInfo() : SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO ) {};
SgaIMapInfo( const ImageMap& rImageMap) :
- SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO, 0 ),
+ SdrObjUserData( IV_IMAPINFO, ID_IMAPINFO ),
aImageMap( rImageMap ) {};
virtual ~SgaIMapInfo() {};
diff --git a/svx/inc/svx/globaldrawitempool.hxx b/svx/inc/svx/globaldrawitempool.hxx
new file mode 100644
index 000000000000..c8689b04df55
--- /dev/null
+++ b/svx/inc/svx/globaldrawitempool.hxx
@@ -0,0 +1,42 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+#ifndef _GLOBALDRAWITEMPOOL_HXX
+#define _GLOBALDRAWITEMPOOL_HXX
+
+#include <svx/svdpool.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// global DRawItemPool vor various usages, mostly UNO API implementations
+// which need an ItemPool which lives independent from DrawModels and
+// DrawObjects
+
+SVX_DLLPUBLIC void FreeGlobalDrawObjectItemPool();
+SVX_DLLPUBLIC SdrItemPool& GetGlobalDrawObjectItemPool();
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_GLOBALDRAWITEMPOOL_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/globl3d.hxx b/svx/inc/svx/globl3d.hxx
index 39fde8d390c4..a58bd61a0e5d 100644
--- a/svx/inc/svx/globl3d.hxx
+++ b/svx/inc/svx/globl3d.hxx
@@ -37,13 +37,10 @@ const sal_uInt32 E3dInventor = sal_uInt32('E')*0x00000001+
sal_uInt32('1')*0x01000000;
const sal_uInt16 E3D_SCENE_ID = 1;
-const sal_uInt16 E3D_POLYSCENE_ID = 2;
-const sal_uInt16 E3D_OBJECT_ID = 3; // should not be used, it's only a helper class for E3DScene and E3DCompoundObject
-const sal_uInt16 E3D_CUBEOBJ_ID = 4;
-const sal_uInt16 E3D_SPHEREOBJ_ID = 5;
-const sal_uInt16 E3D_EXTRUDEOBJ_ID = 6;
-const sal_uInt16 E3D_LATHEOBJ_ID = 7;
-const sal_uInt16 E3D_COMPOUNDOBJ_ID = 8;
-const sal_uInt16 E3D_POLYGONOBJ_ID = 9;
+const sal_uInt16 E3D_CUBEOBJ_ID = 2;
+const sal_uInt16 E3D_SPHEREOBJ_ID = 3;
+const sal_uInt16 E3D_EXTRUDEOBJ_ID = 4;
+const sal_uInt16 E3D_LATHEOBJ_ID = 5;
+const sal_uInt16 E3D_POLYGONOBJ_ID = 6;
#endif // _E3D_GLOBL3D_HXX
diff --git a/svx/inc/svx/gluepoint.hxx b/svx/inc/svx/gluepoint.hxx
new file mode 100644
index 000000000000..e77e8d31a4ef
--- /dev/null
+++ b/svx/inc/svx/gluepoint.hxx
@@ -0,0 +1,136 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _GLUEPOINT_HXX
+#define _GLUEPOINT_HXX
+
+#include <sal/types.h>
+#include <basegfx/point/b2dpoint.hxx>
+#include <com/sun/star/drawing/Alignment.hpp>
+#include <com/sun/star/drawing/EscapeDirection.hpp>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace gluepoint
+ {
+ enum GluePointType
+ {
+ GLUEPOINTTYPE_AUTO,
+ GLUEPOINTTYPE_EDGE,
+ GLUEPOINTTYPE_USER
+ };
+
+ class GluePoint
+ {
+ private:
+ basegfx::B2DPoint maPosition;
+ sal_uInt32 mnIdentifier;
+ GluePointType meType;
+ com::sun::star::drawing::Alignment meAlignment;
+ com::sun::star::drawing::EscapeDirection meEscapeDirection;
+
+ public:
+ GluePoint()
+ : maPosition(0.0, 0.0),
+ mnIdentifier(0),
+ meType(GLUEPOINTTYPE_AUTO),
+ meAlignment(com::sun::star::drawing::Alignment_TOP_LEFT),
+ meEscapeDirection(com::sun::star::drawing::EscapeDirection_SMART)
+ {
+ }
+
+ GluePoint(
+ const basegfx::B2DPoint& rPosition,
+ sal_uInt32 nIdentifier,
+ GluePointType eType,
+ com::sun::star::drawing::Alignment eAlignment = com::sun::star::drawing::Alignment_CENTER,
+ com::sun::star::drawing::EscapeDirection eEscapeDirection = com::sun::star::drawing::EscapeDirection_SMART)
+ : maPosition(rPosition),
+ mnIdentifier(nIdentifier),
+ meType(eType),
+ meAlignment(eAlignment),
+ meEscapeDirection(eEscapeDirection)
+ {
+ }
+
+ const basegfx::B2DPoint& getPosition() const { return maPosition; }
+ sal_uInt32 getIdentifier() const { return mnIdentifier; }
+ GluePointType getType() const { return meType; }
+ com::sun::star::drawing::Alignment getAlignment() const { return meAlignment; }
+ com::sun::star::drawing::EscapeDirection getEscapeDirection() const { return meEscapeDirection; }
+ };
+ } // end of namespace gluepoint
+} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace gluepoint
+ {
+ class GluePointProvider
+ {
+ public:
+ // construction, destruction, copying
+ GluePointProvider();
+ virtual ~GluePointProvider();
+ GluePointProvider(const GluePointProvider& rCandidate);
+ virtual GluePointProvider& operator=(const GluePointProvider& rCandidate);
+
+ // Clone() operator calls the local copy constructor
+ virtual GluePointProvider& Clone() const;
+
+ // AutoGluePoint access
+ virtual sal_uInt32 getAutoGluePointCount() const;
+ virtual GluePoint getAutoGluePointByIndex(sal_uInt32 nIndex) const;
+
+ // EdgeGluePoint access
+ virtual sal_uInt32 getEdgeGluePointCount() const;
+ virtual GluePoint getEdgeGluePointByIndex(sal_uInt32 nIndex) const;
+
+ // UserGluePoint access
+ virtual sal_uInt32 getUserGluePointCount() const;
+ virtual GluePoint getUserGluePointByIndex(sal_uInt32 nIndex) const;
+
+ // bundled GluePoint access
+ sal_uInt32 getGluePointCount() const;
+ GluePoint getGluePointByIndex(sal_uInt32 nIndex) const;
+
+ // UserGluePoint manipulation
+ virtual bool areUserGluePointsAllowed() const;
+ virtual GluePoint addUserGluePoint(
+ const basegfx::B2DPoint& rPosition,
+ GluePointType eType,
+ com::sun::star::drawing::Alignment eAlignment,
+ com::sun::star::drawing::EscapeDirection eEscapeDirection);
+ virtual void removeUserGluePoint(const GluePoint& rCandidate);
+ virtual bool existsUserGluePoint(const GluePoint& rCandidate) const;
+ };
+ } // end of namespace gluepoint
+} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_GLUEPOINT_HXX
+
+// eof
diff --git a/svx/inc/svx/grafctrl.hxx b/svx/inc/svx/grafctrl.hxx
index 07cd864b0f49..8036cba3e987 100644
--- a/svx/inc/svx/grafctrl.hxx
+++ b/svx/inc/svx/grafctrl.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC TbxImageItem : public SfxUInt16Item
{
public:
- TYPEINFO();
TbxImageItem( sal_uInt16 nWhich = 0, sal_uInt16 nImage = 0 );
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/svx/inc/svx/graphctl.hxx b/svx/inc/svx/graphctl.hxx
index 5dea6d39556c..b51c01aaa523 100644
--- a/svx/inc/svx/graphctl.hxx
+++ b/svx/inc/svx/graphctl.hxx
@@ -44,7 +44,7 @@ class SvxGraphCtrlAccessibleContext;
#define WB_SDRMODE ((WinBits)0x0080)
#define WB_ANIMATION ((WinBits)0x0100)
-class SVX_DLLPUBLIC GraphCtrl : public Control
+class SVX_DLLPUBLIC GraphCtrl : public Control, public SfxListener
{
friend class GraphCtrlView;
friend class GraphCtrlUserCall;
@@ -58,9 +58,8 @@ class SVX_DLLPUBLIC GraphCtrl : public Control
MapMode aMap100;
Size aGraphSize;
Point aMousePos;
- GraphCtrlUserCall* pUserCall;
WinBits nWinStyle;
- SdrObjKind eObjKind;
+ SdrObjectCreationInfo maSdrObjectCreationInfo;
sal_uInt16 nPolyEdit;
sal_Bool bEditMode;
sal_Bool bSdrMode;
@@ -86,11 +85,16 @@ protected:
virtual void SdrObjCreated( const SdrObject& rObj );
virtual void SdrObjChanged( const SdrObject& rObj );
- virtual void MarkListHasChanged();
-
- SdrObjUserCall* GetSdrUserCall() { return (SdrObjUserCall*) pUserCall; }
+ virtual void selectionChange();
public:
+ // from SfxListener
+ using Control::Notify;
+ using SfxListener::Notify;
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ // establich connection to given SDrObject to get Notify-calls
+ void ConnectToSdrObject(SdrObject* pObject);
GraphCtrl( Window* pParent, const WinBits nWinBits = 0 );
GraphCtrl( Window* pParent, const ResId& rResId );
@@ -111,8 +115,8 @@ public:
void SetPolyEditMode( const sal_uInt16 nPolyEdit );
sal_uInt16 GetPolyEditMode() const { return nPolyEdit; }
- void SetObjKind( const SdrObjKind eObjKind );
- SdrObjKind GetObjKind() const { return eObjKind; }
+ void setSdrObjectCreationInfo( const SdrObjectCreationInfo& rSdrObjectCreationInfo );
+ const SdrObjectCreationInfo& getSdrObjectCreationInfo() const { return maSdrObjectCreationInfo; }
SdrModel* GetSdrModel() const { return pModel; }
SdrView* GetSdrView() const { return pView; }
@@ -144,40 +148,18 @@ public:
|*
\************************************************************************/
-class GraphCtrlUserCall : public SdrObjUserCall
-{
- GraphCtrl& rWin;
-
-public:
-
- GraphCtrlUserCall( GraphCtrl& rGraphWin ) : rWin( rGraphWin ) {};
- virtual ~GraphCtrlUserCall() {};
-
- virtual void Changed( const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect );
-};
-
-/*************************************************************************
-|*
-|*
-|*
-\************************************************************************/
-
class GraphCtrlView : public SdrView
{
GraphCtrl& rGraphCtrl;
protected:
- virtual void MarkListHasChanged()
- {
- SdrView::MarkListHasChanged();
- rGraphCtrl.MarkListHasChanged();
- }
+ virtual void handleSelectionChange();
public:
- GraphCtrlView( SdrModel* pModel, GraphCtrl* pWindow) :
- SdrView ( pModel, pWindow ),
+ GraphCtrlView( SdrModel& rModel, GraphCtrl* pWindow) :
+ SdrView ( rModel, pWindow ),
rGraphCtrl ( *pWindow ) {};
virtual ~GraphCtrlView() {};
diff --git a/svx/inc/svx/grfcrop.hxx b/svx/inc/svx/grfcrop.hxx
index 0919675be4c2..4fdb34070e8e 100644
--- a/svx/inc/svx/grfcrop.hxx
+++ b/svx/inc/svx/grfcrop.hxx
@@ -39,6 +39,7 @@ public:
sal_Int32 nTop, sal_Int32 nBottom,
sal_uInt16 );
virtual ~SvxGrfCrop();
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/svx/inc/svx/hdft.hxx b/svx/inc/svx/hdft.hxx
index 4208efb2abc0..f0018b3a6e55 100644
--- a/svx/inc/svx/hdft.hxx
+++ b/svx/inc/svx/hdft.hxx
@@ -86,7 +86,7 @@ protected:
SfxItemSet* pBBSet;
sal_Bool bDisableQueryBox;
sal_Bool bEnableBackgroundSelector;
- FASTBOOL bInReset;
+ bool bInReset;
void InitHandler();
DECL_LINK( TurnOnHdl, CheckBox*);
diff --git a/svx/inc/svx/hlnkitem.hxx b/svx/inc/svx/hlnkitem.hxx
index 7e8d60fbac0e..36ab0b525d21 100644
--- a/svx/inc/svx/hlnkitem.hxx
+++ b/svx/inc/svx/hlnkitem.hxx
@@ -54,8 +54,7 @@ class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem
sal_uInt16 nMacroEvents;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SvxHyperlinkItem( sal_uInt16 _nWhich = SID_HYPERLINK_GETLINK ):
SfxPoolItem(_nWhich), pMacroTable(NULL) { eType = HLINK_DEFAULT; nMacroEvents=0; };
SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem );
diff --git a/svx/inc/svx/imapdlg.hxx b/svx/inc/svx/imapdlg.hxx
index 8a5c0c009583..2a4db84392a0 100644
--- a/svx/inc/svx/imapdlg.hxx
+++ b/svx/inc/svx/imapdlg.hxx
@@ -102,7 +102,6 @@ protected:
public:
-
SvxIMapDlgItem( sal_uInt16 nId, SvxIMapDlg& rIMapDlg, SfxBindings& rBindings );
};
diff --git a/svx/inc/svx/ipolypolygoneditorcontroller.hxx b/svx/inc/svx/ipolypolygoneditorcontroller.hxx
index a4b6d85b7b76..9944c8aca4a8 100644
--- a/svx/inc/svx/ipolypolygoneditorcontroller.hxx
+++ b/svx/inc/svx/ipolypolygoneditorcontroller.hxx
@@ -27,9 +27,8 @@
#include "svx/svxdllapi.h"
#include <svx/svdedtv.hxx>
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Defines
-//************************************************************
enum SdrPathSmoothKind {SDRPATHSMOOTH_DONTCARE, // nur fuer Statusabfrage
SDRPATHSMOOTH_ANGULAR, // Eckig
@@ -46,27 +45,31 @@ enum SdrObjClosedKind {SDROBJCLOSED_DONTCARE, // nur fuer Statusabfrage
SDROBJCLOSED_CLOSED, // Objekte geschlossen (Polygon, ...)
SDROBJCLOSED_TOGGLE}; // nur fuer Set: Toggle (not implemented yet)
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
class IPolyPolygonEditorController
{
public:
virtual void DeleteMarkedPoints() = 0;
- virtual sal_Bool IsDeleteMarkedPointsPossible() const = 0;
+ virtual bool IsDeleteMarkedPointsPossible() const = 0;
virtual void RipUpAtMarkedPoints() = 0;
virtual bool IsRipUpAtMarkedPointsPossible() const = 0;
- virtual sal_Bool IsSetMarkedSegmentsKindPossible() const = 0;
+ virtual bool IsSetMarkedSegmentsKindPossible() const = 0;
virtual SdrPathSegmentKind GetMarkedSegmentsKind() const = 0;
virtual void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) = 0;
- virtual sal_Bool IsSetMarkedPointsSmoothPossible() const = 0;
+ virtual bool IsSetMarkedPointsSmoothPossible() const = 0;
virtual SdrPathSmoothKind GetMarkedPointsSmooth() const = 0;
virtual void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) = 0;
- virtual void CloseMarkedObjects(sal_Bool bToggle, sal_Bool bOpen ) = 0;
+ virtual void CloseMarkedObjects(bool bToggle, bool bOpen ) = 0;
virtual bool IsOpenCloseMarkedObjectsPossible() const = 0;
virtual SdrObjClosedKind GetMarkedObjectsClosedState() const = 0;
};
#endif //_SDR_IPOLYPOLYGONEDITORCONTROLLER_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/lathe3d.hxx b/svx/inc/svx/lathe3d.hxx
index b8ba08629948..2c87d7f41d91 100644
--- a/svx/inc/svx/lathe3d.hxx
+++ b/svx/inc/svx/lathe3d.hxx
@@ -47,32 +47,42 @@ private:
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
+
+ virtual ~E3dLatheObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
- E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon rPoly2D);
- E3dLatheObj();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ E3dLatheObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B2DPolyPolygon aPoly2D = basegfx::B2DPolyPolygon());
+// E3dLatheObj();
// HorizontalSegments:
sal_uInt32 GetHorizontalSegments() const
- { return ((const Svx3DHorizontalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
+ { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
// VerticalSegments:
sal_uInt32 GetVerticalSegments() const
- { return ((const Svx3DVerticalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
+ { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
// PercentDiagonal: 0..100, before 0.0..0.5
sal_uInt16 GetPercentDiagonal() const
- { return ((const Svx3DPercentDiagonalItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
+ { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue(); }
// BackScale: 0..100, before 0.0..1.0
sal_uInt16 GetBackScale() const
- { return ((const Svx3DBackscaleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
+ { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue(); }
// EndAngle: 0..10000
sal_uInt32 GetEndAngle() const
- { return ((const Svx3DEndAngleItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue(); }
+ { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue(); }
// #107245# GetSmoothNormals() for bLatheSmoothed
sal_Bool GetSmoothNormals() const
@@ -97,9 +107,7 @@ private:
virtual sal_uInt16 GetObjIdentifier() const;
void ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs);
- virtual void operator=(const SdrObject&);
-
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
virtual void TakeObjNameSingul(String& rName) const;
diff --git a/svx/inc/svx/layctrl.hxx b/svx/inc/svx/layctrl.hxx
index c4dc76d50c76..4eda6067de2f 100644
--- a/svx/inc/svx/layctrl.hxx
+++ b/svx/inc/svx/layctrl.hxx
@@ -34,7 +34,7 @@
class SVX_DLLPUBLIC SvxTableToolBoxControl : public SfxToolBoxControl
{
private:
- FASTBOOL bEnabled;
+ bool bEnabled;
public:
virtual SfxPopupWindowType GetPopupWindowType() const;
@@ -54,7 +54,7 @@ public:
class SVX_DLLPUBLIC SvxColumnsToolBoxControl : public SfxToolBoxControl
{
- FASTBOOL bEnabled;
+ bool bEnabled;
public:
virtual SfxPopupWindowType GetPopupWindowType() const;
virtual SfxPopupWindow* CreatePopupWindow();
diff --git a/svx/inc/svx/numinf.hxx b/svx/inc/svx/numinf.hxx
index 5e0db77f1e28..ed382f072db3 100644
--- a/svx/inc/svx/numinf.hxx
+++ b/svx/inc/svx/numinf.hxx
@@ -41,8 +41,6 @@ Dieses Item dient als Transport-Medium fuer einen Number-Formatter.
class SVX_DLLPUBLIC SvxNumberInfoItem : public SfxPoolItem
{
public:
- TYPEINFO();
-
SvxNumberInfoItem( const sal_uInt16 nId );
SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
const sal_uInt16 nId );
diff --git a/svx/inc/svx/obj3d.hxx b/svx/inc/svx/obj3d.hxx
index 7e5bd642c0cb..04fc44f05680 100644
--- a/svx/inc/svx/obj3d.hxx
+++ b/svx/inc/svx/obj3d.hxx
@@ -47,7 +47,7 @@
class SfxPoolItem;
class Viewport3D;
class E3dScene;
-class E3dPolyScene;
+class E3dScene;
namespace basegfx { class B3DPolyPolygon; }
namespace sdr { namespace properties {
@@ -76,26 +76,6 @@ public:
/*************************************************************************
|*
-|* Liste fuer 3D-Objekte
-|*
-\************************************************************************/
-
-class E3dObjList : public SdrObjList
-{
-public:
- TYPEINFO();
- E3dObjList(SdrModel* pNewModel = 0, SdrPage* pNewPage = 0, E3dObjList* pNewUpList = 0);
- SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList);
- SVX_DLLPUBLIC virtual ~E3dObjList();
-
- virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
- virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND, const SdrInsertReason* pReason=NULL);
- virtual SdrObject* NbcRemoveObject(sal_uIntPtr nObjNum);
- virtual SdrObject* RemoveObject(sal_uIntPtr nObjNum);
-};
-
-/*************************************************************************
-|*
|* Basisklasse fuer 3D-Objekte
|*
\************************************************************************/
@@ -103,85 +83,57 @@ public:
class SVX_DLLPUBLIC E3dObject : public SdrAttrObj
{
private:
- // to allow sdr::properties::E3dProperties access to StructureChanged()
- friend class sdr::properties::E3dProperties;
-
- // Aus der E3dObjList und E3dDragMethod alles erlauben
- friend class E3dObjList;
- friend class E3dDragMethod;
-
- protected:
+protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- E3dObjList maSubList; // Subliste (Childobjekte)
-
basegfx::B3DRange maLocalBoundVol; // umschliessendes Volumen des Objekts (aus geometrieerzeugung)
basegfx::B3DHomMatrix maTransformation; // lokale Transformation
basegfx::B3DHomMatrix maFullTransform; // globale Transformation (inkl. Parents)
// Flags
- unsigned mbTfHasChanged : 1;
- unsigned mbIsSelected : 1;
+ bool mbTfHasChanged : 1;
+ bool mbIsSelected : 1;
- public:
- void SetBoundVolInvalid();
-
- protected:
- void SetTransformChanged();
- virtual void NewObjectInserted(const E3dObject* p3DObj);
- virtual void StructureChanged();
- basegfx::B3DRange RecalcBoundVolume() const;
+ virtual void NewObjectInserted(const E3dObject& r3DObj);
+ virtual basegfx::B3DRange RecalcBoundVolume() const;
-protected:
// E3dObject is only a helper class (for E3DScene and E3DCompoundObject)
// and no instances should be created from anyone, so i move the constructors
// to protected area
- E3dObject();
- E3dObject(sal_Bool bIsFromChart);
+ E3dObject(SdrModel& rSdrModel);
+ virtual ~E3dObject();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
- virtual void RecalcSnapRect();
- virtual void SetRectsDirty(sal_Bool bNotMyself = sal_False);
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- virtual ~E3dObject();
+ virtual bool IsClosedObj() const;
+ virtual bool IsE3dObject() const;
+ virtual void SetBoundVolInvalid();
+ virtual void SetTransformChanged();
+ virtual void StructureChanged();
virtual sal_uInt32 GetObjInventor() const;
virtual sal_uInt16 GetObjIdentifier() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
- virtual void NbcSetLayer(SdrLayerID nLayer);
-
- virtual void SetObjList(SdrObjList* pNewObjList);
- virtual void SetPage(SdrPage* pNewPage);
- virtual void SetModel(SdrModel* pNewModel);
- virtual void NbcMove(const Size& rSize);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual SdrObjList* GetSubList() const;
-
- // 3D-Objekt in die Gruppe einfuegen; Eigentumsuebergang!
- virtual void Insert3DObj(E3dObject* p3DObj);
- void Remove3DObj(E3dObject* p3DObj);
-
E3dObject* GetParentObj() const;
virtual E3dScene* GetScene() const;
const basegfx::B3DRange& GetBoundVolume() const;
- void InvalidateBoundVolume();
+ virtual void InvalidateBoundVolume();
// komplette Transformation inklusive aller Parents berechnen
const basegfx::B3DHomMatrix& GetFullTransform() const;
// Transformationsmatrix abfragen bzw. (zurueck)setzen
- const basegfx::B3DHomMatrix& GetTransform() const;
- virtual void NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix);
- virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix);
-
- // [FG] 2D-Rotationen, werden hier als Rotationen um die Z-Achse, die in den Bildschirm zeigt,
- // implementiert plus eine Verschiebung der Scene. Dies bedeutet auch die Scene (E3dScene)
- // muss diese Routine in der Klasse als virtual definieren.
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
+ const basegfx::B3DHomMatrix& GetB3DTransform() const;
+ virtual void SetB3DTransform(const basegfx::B3DHomMatrix& rMatrix);
+ // virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix);
// get wireframe polygon for local object. No transform is applied.
basegfx::B3DPolyPolygon CreateWireframe() const;
@@ -190,7 +142,6 @@ public:
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
sal_uInt16 GetLogicalGroup() { return 0; }
- virtual void operator=(const SdrObject&);
virtual SdrObjGeoData *NewGeoData() const;
virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
@@ -198,7 +149,7 @@ public:
// Selektion Setzen/Lesen
bool GetSelected() const { return mbIsSelected; }
- void SetSelected(bool bNew);
+ virtual void SetSelected(bool bNew);
// Aufbrechen
virtual sal_Bool IsBreakObjPossible();
@@ -208,7 +159,7 @@ public:
/*************************************************************************
|*
|* Klasse fuer alle zusammengesetzen Objekte (Cube, Lathe, Scene, Extrude)
-|* Diese Klasse erspart ein paar ISA-Abfragen und sie beschleunigt das
+|* Diese Klasse erspart ein paar RTTI-Abfragen und sie beschleunigt das
|* Verhalten ungemein, da alle Attribute usw. fuer die untergeordneten
|* Polygone hierueber gehalten werden. Die Polygone duerfen nur Attribute
|* halten, wenn sie direkt einer Szene untergeordnet sind.
@@ -218,12 +169,6 @@ public:
class SVX_DLLPUBLIC E3dCompoundObject : public E3dObject
{
private:
- // to allow sdr::properties::E3dCompoundProperties access to SetGeometryValid()
- friend class sdr::properties::E3dCompoundProperties;
- friend class sdr::properties::E3dExtrudeProperties;
- friend class sdr::properties::E3dLatheProperties;
- friend class sdr::properties::E3dSphereProperties;
-
protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
@@ -231,37 +176,48 @@ protected:
Color aMaterialAmbientColor;
// Attribute zur Geometrieerzeugung
- unsigned bCreateNormals : 1;
- unsigned bCreateTexture : 1;
+ bool bCreateNormals : 1;
+ bool bCreateTexture : 1;
protected:
- void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
// convert given basegfx::B3DPolyPolygon to screen coor
basegfx::B2DPolyPolygon TransformToScreenCoor(const basegfx::B3DPolyPolygon& rCandidate);
+ // protected constructor due to being only a helper class
+ E3dCompoundObject(SdrModel& rSdrModel, const E3dDefaultAttributes& rDefault);
+ virtual ~E3dCompoundObject();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public :
- TYPEINFO();
+ // overloaded to reset maSdrObjectTransformation to identity to flag
+ // that the 2D transformation of this 3D object has changed and needs recalculation
+ virtual void InvalidateBoundVolume();
- E3dCompoundObject();
- E3dCompoundObject(E3dDefaultAttributes& rDefault);
- virtual ~E3dCompoundObject();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual sal_uInt32 GetHdlCount() const;
virtual void AddToHdlList(SdrHdlList& rHdlList) const;
- // DoubleSided: sal_True/FALSE
- sal_Bool GetDoubleSided() const
- { return ((const Svx3DDoubleSidedItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue(); }
+ // get/setSdrObjectTransformation
+ virtual const basegfx::B2DHomMatrix& getSdrObjectTransformation() const;
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+
+ // DoubleSided: TRUE/FALSE
+ bool GetDoubleSided() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue(); }
// NormalsKind: 0 == sal_False/sal_False, 1 == sal_True/sal_False, else == sal_True/TRUE
sal_uInt16 GetNormalsKind() const
{ return ((const Svx3DNormalsKindItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_NORMALS_KIND)).GetValue(); }
- // NormalsInvert: sal_True/FALSE
- sal_Bool GetNormalsInvert() const
- { return ((const Svx3DNormalsInvertItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue(); }
+ // NormalsInvert: TRUE/FALSE
+ bool GetNormalsInvert() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue(); }
// TextureProjX: 0 == sal_False/sal_False, 1 == sal_True/sal_False, else == sal_True/TRUE
sal_uInt16 GetTextureProjectionX() const
@@ -271,29 +227,29 @@ public :
sal_uInt16 GetTextureProjectionY() const
{ return ((const Svx3DTextureProjectionYItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_TEXTURE_PROJ_Y)).GetValue(); }
- // Shadow3D: sal_True/FALSE
- sal_Bool GetShadow3D() const
- { return ((const Svx3DShadow3DItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue(); }
+ // Shadow3D: TRUE/FALSE
+ bool GetShadow3D() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue(); }
// MaterialColor: Color
Color GetMaterialColor() const
- { return ((const Svx3DMaterialColorItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_COLOR)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_COLOR)).GetValue(); }
// MaterialEmission: Color
Color GetMaterialEmission() const
- { return ((const Svx3DMaterialEmissionItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue(); }
// MaterialSpecular: Color
Color GetMaterialSpecular() const
- { return ((const Svx3DMaterialSpecularItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue(); }
// MaterialSpecularIntensity:
sal_uInt16 GetMaterialSpecularIntensity() const
- { return ((const Svx3DMaterialSpecularIntensityItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue(); }
+ { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue(); }
- // TextureFilter: sal_True/FALSE
- sal_Bool GetTextureFilter() const
- { return ((const Svx3DTextureFilterItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue(); }
+ // TextureFilter: TRUE/FALSE
+ bool GetTextureFilter() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue(); }
// #i28528#
// Added extra Item (Bool) for chart2 to be able to show reduced line geometry
@@ -301,17 +257,13 @@ public :
{ return ((const Svx3DReducedLineGeometryItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY)).GetValue(); }
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void RecalcSnapRect();
// Parameter Geometrieerzeugung setzen/lesen
- sal_Bool GetCreateNormals() const { return bCreateNormals; }
- void SetCreateNormals(sal_Bool bNew);
-
- sal_Bool GetCreateTexture() const { return bCreateTexture; }
- void SetCreateTexture(sal_Bool bNew);
+ bool GetCreateNormals() const { return bCreateNormals; }
+ void SetCreateNormals(bool bNew);
- // Copy-Operator
- virtual void operator=(const SdrObject&);
+ bool GetCreateTexture() const { return bCreateTexture; }
+ void SetCreateTexture(bool bNew);
// Material des Objektes
const Color& GetMaterialAmbientColor() const { return aMaterialAmbientColor; }
diff --git a/svx/inc/svx/optgrid.hxx b/svx/inc/svx/optgrid.hxx
index 82cc0e27e3c0..d952107c95ab 100644
--- a/svx/inc/svx/optgrid.hxx
+++ b/svx/inc/svx/optgrid.hxx
@@ -39,42 +39,45 @@ class SvxGridTabPage;
class SVX_DLLPUBLIC SvxOptionsGrid
{
protected:
- sal_uInt32 nFldDrawX;
- sal_uInt32 nFldDivisionX;
- sal_uInt32 nFldDrawY;
- sal_uInt32 nFldDivisionY;
- sal_uInt32 nFldSnapX;
- sal_uInt32 nFldSnapY;
- sal_Bool bUseGridsnap:1;
- sal_Bool bSynchronize:1;
- sal_Bool bGridVisible:1;
- sal_Bool bEqualGrid: 1;
+ sal_uInt32 mnFldDrawX;
+ sal_uInt32 mnFldDivisionX;
+ sal_uInt32 mnFldDrawY;
+ sal_uInt32 mnFldDivisionY;
+ sal_uInt32 mnFldSnapX;
+ sal_uInt32 mnFldSnapY;
+
+ bool mbUseGridsnap : 1;
+ bool mbSynchronize : 1;
+ bool mbGridVisible : 1;
+ bool mbEqualGrid : 1;
public:
SvxOptionsGrid();
~SvxOptionsGrid();
- void SetFldDrawX( sal_uInt32 nSet){nFldDrawX = nSet;}
- void SetFldDivisionX(sal_uInt32 nSet){nFldDivisionX = nSet;}
- void SetFldDrawY ( sal_uInt32 nSet){nFldDrawY = nSet;}
- void SetFldDivisionY(sal_uInt32 nSet){nFldDivisionY = nSet;}
- void SetFldSnapX( sal_uInt32 nSet){nFldSnapX = nSet;}
- void SetFldSnapY ( sal_uInt32 nSet){nFldSnapY = nSet;}
- void SetUseGridSnap( sal_Bool bSet ) {bUseGridsnap = bSet;}
- void SetSynchronize( sal_Bool bSet ) {bSynchronize = bSet;}
- void SetGridVisible( sal_Bool bSet ) {bGridVisible = bSet;}
- void SetEqualGrid( sal_Bool bSet ) {bEqualGrid = bSet;}
-
- sal_uInt32 GetFldDrawX( ) const { return nFldDrawX; }
- sal_uInt32 GetFldDivisionX() const { return nFldDivisionX;}
- sal_uInt32 GetFldDrawY ( ) const { return nFldDrawY; }
- sal_uInt32 GetFldDivisionY() const { return nFldDivisionY;}
- sal_uInt32 GetFldSnapX( ) const { return nFldSnapX; }
- sal_uInt32 GetFldSnapY ( ) const { return nFldSnapY; }
- sal_Bool GetUseGridSnap( ) const { return bUseGridsnap; }
- sal_Bool GetSynchronize( ) const { return bSynchronize; }
- sal_Bool GetGridVisible( ) const { return bGridVisible; }
- sal_Bool GetEqualGrid() const { return bEqualGrid; }
+ void SetFldDrawX(sal_uInt32 nSet) { mnFldDrawX = nSet; }
+ void SetFldDivisionX(sal_uInt32 nSet) { mnFldDivisionX = nSet; }
+ void SetFldDrawY(sal_uInt32 nSet) { mnFldDrawY = nSet; }
+ void SetFldDivisionY(sal_uInt32 nSet) { mnFldDivisionY = nSet; }
+ void SetFldSnapX(sal_uInt32 nSet) { mnFldSnapX = nSet; }
+ void SetFldSnapY(sal_uInt32 nSet) { mnFldSnapY = nSet; }
+
+ void SetUseGridSnap(bool bSet) { mbUseGridsnap = bSet; }
+ void SetSynchronize(bool bSet) { mbSynchronize = bSet; }
+ void SetGridVisible(bool bSet) { mbGridVisible = bSet; }
+ void SetEqualGrid(bool bSet) { mbEqualGrid = bSet; }
+
+ sal_uInt32 GetFldDrawX() const { return mnFldDrawX; }
+ sal_uInt32 GetFldDivisionX() const { return mnFldDivisionX; }
+ sal_uInt32 GetFldDrawY() const { return mnFldDrawY; }
+ sal_uInt32 GetFldDivisionY() const { return mnFldDivisionY; }
+ sal_uInt32 GetFldSnapX() const { return mnFldSnapX; }
+ sal_uInt32 GetFldSnapY() const { return mnFldSnapY; }
+
+ bool GetUseGridSnap() const { return mbUseGridsnap; }
+ bool GetSynchronize() const { return mbSynchronize; }
+ bool GetGridVisible() const { return mbGridVisible; }
+ bool GetEqualGrid() const { return mbEqualGrid; }
};
// class SvxGridItem -----------------------------------------------------
@@ -159,8 +162,7 @@ protected:
MetricField aMtrFldBezAngle;
private:
- sal_Bool bAttrModified;
-// sal_Bool bEqualGrid; // Neu
+ bool mbAttrModified;
#ifdef _SVX_OPTGRID_CXX
DECL_LINK( ClickRotateHdl_Impl, void * );
diff --git a/svx/inc/svx/pageitem.hxx b/svx/inc/svx/pageitem.hxx
index 20e79b653d7c..bd6674c980e9 100644
--- a/svx/inc/svx/pageitem.hxx
+++ b/svx/inc/svx/pageitem.hxx
@@ -81,9 +81,9 @@ private:
sal_uInt16 eUse; // Layout
public:
-
- TYPEINFO();
- SvxPageItem( const sal_uInt16 nId );
+ POOLITEM_FACTORY()
+ SvxPageItem();
+ SvxPageItem( sal_uInt16 nId );
SvxPageItem( const SvxPageItem& rItem );
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/svx/inc/svx/polygn3d.hxx b/svx/inc/svx/polygn3d.hxx
index 7ff83e5f4e37..50b3f30c31f9 100644
--- a/svx/inc/svx/polygn3d.hxx
+++ b/svx/inc/svx/polygn3d.hxx
@@ -41,41 +41,35 @@ private:
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual ~E3dPolygonObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
void SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
void SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyPoly2D);
- TYPEINFO();
-
- E3dPolygonObj(
- E3dDefaultAttributes& rDefault,
- const basegfx::B3DPolyPolygon& rPolyPoly3D,
- sal_Bool bLinOnly=sal_False);
- E3dPolygonObj(
- E3dDefaultAttributes& rDefault,
- const basegfx::B3DPolyPolygon& rPolyPoly3D,
- const basegfx::B3DPolyPolygon& rPolyNormals3D,
- sal_Bool bLinOnly=sal_False);
E3dPolygonObj(
- E3dDefaultAttributes& rDefault,
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
const basegfx::B3DPolyPolygon& rPolyPoly3D,
- const basegfx::B3DPolyPolygon& rPolyNormals3D,
- const basegfx::B2DPolyPolygon& rPolyTexture2D,
- sal_Bool bLinOnly=sal_False);
+ const basegfx::B3DPolyPolygon* pPolyNormals3D = 0,
+ const basegfx::B2DPolyPolygon* pPolyTexture2D = 0,
+ bool bLinOnly = false);
E3dPolygonObj();
- virtual ~E3dPolygonObj();
const basegfx::B3DPolyPolygon& GetPolyPolygon3D() const { return aPolyPoly3D; }
const basegfx::B3DPolyPolygon& GetPolyNormals3D() const { return aPolyNormals3D; }
const basegfx::B2DPolyPolygon& GetPolyTexture2D() const { return aPolyTexture2D; }
virtual sal_uInt16 GetObjIdentifier() const;
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
-
- virtual void operator=(const SdrObject&);
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
// LineOnly?
sal_Bool GetLineOnly() { return bLineOnly; }
diff --git a/svx/inc/svx/polypolygoneditor.hxx b/svx/inc/svx/polypolygoneditor.hxx
index 13c25bcbb592..f6624187c809 100644
--- a/svx/inc/svx/polypolygoneditor.hxx
+++ b/svx/inc/svx/polypolygoneditor.hxx
@@ -25,48 +25,40 @@
#define _SDR_POLYPOLYGONEDITOR_HXX_
#include "svx/svxdllapi.h"
-
#include "svx/ipolypolygoneditorcontroller.hxx"
-
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <set>
-class SdrUShortCont;
+////////////////////////////////////////////////////////////////////////////////////////////////////
namespace sdr
{
-
-/** this class implements some helper functions to edit a B2DPolyPolygon */
-class SVX_DLLPUBLIC PolyPolygonEditor
+ /** this namespace implements some helper functions to edit a B2DPolyPolygon */
+ namespace PolyPolygonEditor
{
-public:
- PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed );
-
- const basegfx::B2DPolyPolygon& GetPolyPolygon() const { return maPolyPolygon; }
-
/** returns true if the B2DPolyPolygon was changed.
Warning: B2DPolyPolygon can be empty after this operation!
*/
- bool DeletePoints( const std::set< sal_uInt16 >& rAbsPoints );
+ SVX_DLLPUBLIC bool DeletePoints(basegfx::B2DPolyPolygon& o_rCandidate, const sdr::selection::Indices& rAbsPoints);
/** returns true if the B2DPolyPolygon was changed.
*/
- bool SetSegmentsKind(SdrPathSegmentKind eKind, const std::set< sal_uInt16 >& rAbsPoints);
+ SVX_DLLPUBLIC bool SetSegmentsKind(basegfx::B2DPolyPolygon& o_rCandidate, SdrPathSegmentKind eKind, const sdr::selection::Indices& rAbsPoints);
/** returns true if the B2DPolyPolygon was changed.
*/
- bool SetPointsSmooth( basegfx::B2VectorContinuity eFlags, const std::set< sal_uInt16 >& rAbsPoints);
+ SVX_DLLPUBLIC bool SetPointsSmooth(basegfx::B2DPolyPolygon& o_rCandidate, basegfx::B2VectorContinuity eFlags, const sdr::selection::Indices& rAbsPoints);
/** Outputs the realative position ( polygon number and point number in that polygon ) from the absolut point number.
False is returned if the given absolute point is greater not inside this B2DPolyPolygon
*/
- static bool GetRelativePolyPoint( const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum );
-
-private:
- basegfx::B2DPolyPolygon maPolyPolygon;
- bool mbIsClosed;
-};
+ SVX_DLLPUBLIC bool GetRelativePolyPoint(const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum);
+ } // end of namespace PolyPolygonEditor
+} // end of namespace sdr
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/postattr.hxx b/svx/inc/svx/postattr.hxx
index 7e32b4fd8a8b..03db542e0fa3 100644
--- a/svx/inc/svx/postattr.hxx
+++ b/svx/inc/svx/postattr.hxx
@@ -40,8 +40,6 @@ Dieses Item beschreibt das Autoren-Kuerzel eines Notizzettels.
class SVX_DLLPUBLIC SvxPostItAuthorItem: public SfxStringItem
{
public:
- TYPEINFO();
-
SvxPostItAuthorItem( sal_uInt16 nWhich );
SvxPostItAuthorItem( const String& rAuthor, sal_uInt16 nWhich );
@@ -72,8 +70,6 @@ Dieses Item beschreibt das Datum eines Notizzettels.
class SVX_DLLPUBLIC SvxPostItDateItem: public SfxStringItem
{
public:
- TYPEINFO();
-
SvxPostItDateItem( sal_uInt16 nWhich );
SvxPostItDateItem( const String& rDate, sal_uInt16 nWhich );
@@ -103,8 +99,6 @@ Dieses Item beschreibt den Text eines Notizzettels.
class SVX_DLLPUBLIC SvxPostItTextItem: public SfxStringItem
{
public:
- TYPEINFO();
-
SvxPostItTextItem( sal_uInt16 nWhich );
SvxPostItTextItem( const String& rText, sal_uInt16 nWhich );
diff --git a/svx/inc/svx/rotmodit.hxx b/svx/inc/svx/rotmodit.hxx
index 415142dea5d7..f155f09681c3 100644
--- a/svx/inc/svx/rotmodit.hxx
+++ b/svx/inc/svx/rotmodit.hxx
@@ -41,8 +41,7 @@ enum SvxRotateMode
class SVX_DLLPUBLIC SvxRotateModeItem: public SfxEnumItem
{
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SvxRotateModeItem( SvxRotateMode eMode=SVX_ROTATE_MODE_STANDARD, sal_uInt16 nWhich=0);
SvxRotateModeItem( const SvxRotateModeItem& rItem );
~SvxRotateModeItem();
diff --git a/svx/inc/svx/rulritem.hxx b/svx/inc/svx/rulritem.hxx
index ddeee2846cae..f7463544fc1d 100644
--- a/svx/inc/svx/rulritem.hxx
+++ b/svx/inc/svx/rulritem.hxx
@@ -55,7 +55,7 @@ private:
SVX_DLLPRIVATE const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &); // n.i.
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
SvxLongLRSpaceItem();
@@ -91,7 +91,7 @@ private:
SVX_DLLPRIVATE const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &); // n.i.
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
SvxLongULSpaceItem(const SvxLongULSpaceItem &);
SvxLongULSpaceItem();
@@ -125,7 +125,7 @@ protected:
private:
SVX_DLLPRIVATE const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &); // n.i.
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
SvxPagePosSizeItem(const SvxPagePosSizeItem &);
SvxPagePosSizeItem();
@@ -209,7 +209,7 @@ protected:
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
// rechter Rand des umgebenden Rahmens
// nLeft, nRight jeweils der Abstand zum umgebenden Rahmen
SvxColumnItem(sal_uInt16 nAct = 0); // Spalten
@@ -275,9 +275,9 @@ protected:
private:
SVX_DLLPRIVATE const SvxObjectItem &operator=(const SvxObjectItem &); // n.i.
public:
- TYPEINFO();
- SvxObjectItem(long nStartX, long nEndX,
- long nStartY, long nEndY,
+ POOLITEM_FACTORY()
+ SvxObjectItem(long nStartX = 0, long nEndX = 0,
+ long nStartY = 0, long nEndY = 0,
sal_Bool bLimits = sal_False);
SvxObjectItem(const SvxObjectItem &);
diff --git a/svx/inc/svx/scene3d.hxx b/svx/inc/svx/scene3d.hxx
index 4935ffcd693a..8295cece6385 100644
--- a/svx/inc/svx/scene3d.hxx
+++ b/svx/inc/svx/scene3d.hxx
@@ -62,12 +62,11 @@ class Imp3DDepthRemapper;
|*
\************************************************************************/
-class SVX_DLLPUBLIC E3dScene : public E3dObject
+class SVX_DLLPUBLIC E3dScene
+: public E3dObject,
+ public SdrObjList
{
private:
- // to allow sdr::properties::E3dSceneProperties access to StructureChanged()
- friend class sdr::properties::E3dSceneProperties;
-
protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
@@ -80,31 +79,52 @@ protected:
Imp3DDepthRemapper* mp3DDepthRemapper;
// Flag to determine if only selected objects should be drawn
- unsigned bDrawOnlySelected : 1;
+ bool bDrawOnlySelected : 1;
- virtual void NewObjectInserted(const E3dObject* p3DObj);
- virtual void StructureChanged();
+ virtual void NewObjectInserted(const E3dObject& r3DObj);
void RebuildLists();
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint);
-protected:
- void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
-
- // #110988#
+ void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
void ImpCleanup3DDepthMapper();
+ virtual basegfx::B3DRange RecalcBoundVolume() const;
-public:
- TYPEINFO();
- E3dScene();
- E3dScene(E3dDefaultAttributes& rDefault);
virtual ~E3dScene();
- virtual void SetBoundRectDirty();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ E3dScene(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault);
+
+ // derived from SdrObjList
+ virtual SdrPage* getSdrPageFromSdrObjList() const;
+ virtual SdrObject* getSdrObjectFromSdrObjList() const;
+ virtual SdrModel& getSdrModelFromSdrObjList() const;
+ virtual void handleContentChange(const SfxHint& rHint);
- // access to cleanup of depth mapper
- void Cleanup3DDepthMapper() { ImpCleanup3DDepthMapper(); }
+ // derived from SdrObject
+ virtual SdrObjList* getChildrenOfSdrObject() const;
+
+ // react on model change
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
+
+ virtual void StructureChanged();
+ virtual void SetBoundVolInvalid();
+
+ virtual void SetLayer(SdrLayerID nLayer);
+ virtual void SetTransformChanged();
+
+ // 3D-Objekt in die Gruppe einfuegen; Eigentumsuebergang!
+ virtual void Insert3DObj(E3dObject& r3DObj);
+ void Remove3DObj(E3dObject& r3DObj);
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
@@ -117,77 +137,77 @@ public:
// Distance:
double GetDistance() const
- { return (double)((const Svx3DDistanceItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_DISTANCE)).GetValue(); }
+ { return (double)((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_DISTANCE)).GetValue(); }
// Focal length: before cm, now 1/10th mm (*100)
double GetFocalLength() const
- { return ((const Svx3DFocalLengthItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue(); }
+ { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue(); }
// Two sided lighting:
- sal_Bool GetTwoSidedLighting() const
- { return ((const Svx3DTwoSidedLightingItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue(); }
+ bool GetTwoSidedLighting() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue(); }
// Lightcolor:
Color GetLightColor1() const
- { return ((const Svx3DLightcolor1Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue(); }
Color GetLightColor2() const
- { return ((const Svx3DLightcolor2Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue(); }
Color GetLightColor3() const
- { return ((const Svx3DLightcolor3Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue(); }
Color GetLightColor4() const
- { return ((const Svx3DLightcolor4Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue(); }
Color GetLightColor5() const
- { return ((const Svx3DLightcolor5Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue(); }
Color GetLightColor6() const
- { return ((const Svx3DLightcolor6Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue(); }
Color GetLightColor7() const
- { return ((const Svx3DLightcolor7Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue(); }
Color GetLightColor8() const
- { return ((const Svx3DLightcolor8Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue(); }
// Ambient color:
Color GetGlobalAmbientColor() const
- { return ((const Svx3DAmbientcolorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue(); }
+ { return ((const SvxColorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue(); }
// Light on/off:
- sal_Bool GetLightOnOff1() const
- { return ((const Svx3DLightOnOff1Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue(); }
- sal_Bool GetLightOnOff2() const
- { return ((const Svx3DLightOnOff2Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue(); }
- sal_Bool GetLightOnOff3() const
- { return ((const Svx3DLightOnOff3Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue(); }
- sal_Bool GetLightOnOff4() const
- { return ((const Svx3DLightOnOff4Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue(); }
- sal_Bool GetLightOnOff5() const
- { return ((const Svx3DLightOnOff5Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue(); }
- sal_Bool GetLightOnOff6() const
- { return ((const Svx3DLightOnOff6Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue(); }
- sal_Bool GetLightOnOff7() const
- { return ((const Svx3DLightOnOff7Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue(); }
- sal_Bool GetLightOnOff8() const
- { return ((const Svx3DLightOnOff8Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue(); }
+ bool GetLightOnOff1() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue(); }
+ bool GetLightOnOff2() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue(); }
+ bool GetLightOnOff3() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue(); }
+ bool GetLightOnOff4() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue(); }
+ bool GetLightOnOff5() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue(); }
+ bool GetLightOnOff6() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue(); }
+ bool GetLightOnOff7() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue(); }
+ bool GetLightOnOff8() const
+ { return ((const SfxBoolItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue(); }
// Light direction:
basegfx::B3DVector GetLightDirection1() const
- { return ((const Svx3DLightDirection1Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue(); }
basegfx::B3DVector GetLightDirection2() const
- { return ((const Svx3DLightDirection2Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue(); }
basegfx::B3DVector GetLightDirection3() const
- { return ((const Svx3DLightDirection3Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue(); }
basegfx::B3DVector GetLightDirection4() const
- { return ((const Svx3DLightDirection4Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue(); }
basegfx::B3DVector GetLightDirection5() const
- { return ((const Svx3DLightDirection5Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue(); }
basegfx::B3DVector GetLightDirection6() const
- { return ((const Svx3DLightDirection6Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue(); }
basegfx::B3DVector GetLightDirection7() const
- { return ((const Svx3DLightDirection7Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue(); }
basegfx::B3DVector GetLightDirection8() const
- { return ((const Svx3DLightDirection8Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue(); }
+ { return ((const SvxB3DVectorItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue(); }
// ShadowSlant:
sal_uInt16 GetShadowSlant() const
- { return ((const Svx3DShadowSlantItem&)GetObjectItemSet().Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue(); }
+ { return ((const SfxUInt16Item&)GetObjectItemSet().Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue(); }
// ShadeMode: 0 == FLAT, 1 == PHONG, 2 == SMOOTH, 3 == ForceDraft
sal_uInt16 GetShadeMode() const
@@ -198,27 +218,18 @@ public:
bool GetDrawOnlySelected() const { return bDrawOnlySelected; }
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcMove(const Size& rSize);
- virtual void NbcResize(const Point& rRef, const Fraction& rXFact,
- const Fraction& rYFact);
- virtual void RecalcSnapRect();
-
virtual E3dScene* GetScene() const;
void SetCamera(const Camera3D& rNewCamera);
const Camera3D& GetCamera() const { return aCamera; }
void removeAllNonSelectedObjects();
- virtual void operator=(const SdrObject&);
-
virtual SdrObjGeoData *NewGeoData() const;
virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
virtual void RestGeoData(const SdrObjGeoData& rGeo);
- virtual void NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix);
- virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix);
+ virtual void SetB3DTransform(const basegfx::B3DHomMatrix& rMatrix);
+ // virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
void RotateScene(const Point& rRef, long nWink, double sn, double cs);
// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
@@ -238,11 +249,17 @@ public:
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
// create moves
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat); // sal_True=Xor muss repainted werden
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
+
+ // Selektion Setzen/Lesen
+ virtual void SetSelected(bool bNew);
+
+ // get/setSdrObjectTransformation
+ virtual const basegfx::B2DHomMatrix& getSdrObjectTransformation() const;
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
};
#endif // _E3D_SCENE3D_HXX
diff --git a/svx/inc/svx/sdangitm.hxx b/svx/inc/svx/sdangitm.hxx
index 986243db6a69..cce0603c1cc5 100644
--- a/svx/inc/svx/sdangitm.hxx
+++ b/svx/inc/svx/sdangitm.hxx
@@ -32,7 +32,6 @@
//------------------------------------------------------------
class SVX_DLLPUBLIC SdrAngleItem: public SfxInt32Item {
public:
- TYPEINFO();
SdrAngleItem(): SfxInt32Item() {}
SdrAngleItem(sal_uInt16 nId, sal_Int32 nAngle=0): SfxInt32Item(nId,nAngle) {}
SdrAngleItem(sal_uInt16 nId, SvStream& rIn): SfxInt32Item(nId,rIn) {}
diff --git a/svx/inc/svx/sdasaitm.hxx b/svx/inc/svx/sdasaitm.hxx
index 890c83909d35..bee6f8a656da 100644
--- a/svx/inc/svx/sdasaitm.hxx
+++ b/svx/inc/svx/sdasaitm.hxx
@@ -46,7 +46,6 @@ class SdrCustomShapeAdjustmentItem : public SfxPoolItem
public :
- TYPEINFO();
SVX_DLLPUBLIC SdrCustomShapeAdjustmentItem();
SdrCustomShapeAdjustmentItem( SvStream& rIn, sal_uInt16 nVersion );
SVX_DLLPUBLIC ~SdrCustomShapeAdjustmentItem();
diff --git a/svx/inc/svx/sdasitm.hxx b/svx/inc/svx/sdasitm.hxx
index e84b1881f6e6..bcc38be8a195 100644
--- a/svx/inc/svx/sdasitm.hxx
+++ b/svx/inc/svx/sdasitm.hxx
@@ -35,20 +35,6 @@
#include <map>
#include "svx/svxdllapi.h"
-class SdrCustomShapeEngineItem : public SfxStringItem
-{
- public :
- SdrCustomShapeEngineItem();
- SdrCustomShapeEngineItem( const String& rCustomShapeEngine );
-};
-
-class SdrCustomShapeDataItem : public SfxStringItem
-{
- public :
- SdrCustomShapeDataItem();
- SdrCustomShapeDataItem( const String& rCustomShapeData );
-};
-
class SVX_DLLPUBLIC SdrCustomShapeGeometryItem : public SfxPoolItem
{
public:
@@ -77,8 +63,6 @@ private:
public :
- TYPEINFO();
-
SdrCustomShapeGeometryItem();
SdrCustomShapeGeometryItem( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
SdrCustomShapeGeometryItem( SvStream& rIn, sal_uInt16 nVersion );
@@ -113,30 +97,5 @@ private:
void ClearPropertyValue( const rtl::OUString& rSequenceName, const rtl::OUString& rPropertyName );
};
-class SdrCustomShapeReplacementURLItem : public SfxStringItem
-{
- public :
- SdrCustomShapeReplacementURLItem();
- SdrCustomShapeReplacementURLItem( const String& rCustomShapeReplacementURL );
-};
-
-//---------------------------
-// class SdrTextWordWrapItem
-//---------------------------
-class SdrTextWordWrapItem : public SdrOnOffItem {
-public:
- SdrTextWordWrapItem( sal_Bool bAuto = sal_False ): SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, bAuto ) {}
- SdrTextWordWrapItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, rIn ) {}
-};
-
-//-------------------------------
-// class SdrTextAutoGrowSizeItem
-//-------------------------------
-class SdrTextAutoGrowSizeItem : public SdrOnOffItem {
-public:
- SdrTextAutoGrowSizeItem( sal_Bool bAuto = sal_False ): SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, bAuto ) {}
- SdrTextAutoGrowSizeItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, rIn ) {}
-};
-
#endif
diff --git a/svx/inc/svx/sdgcoitm.hxx b/svx/inc/svx/sdgcoitm.hxx
index 87f8d0be6d40..6edad41e09a5 100644
--- a/svx/inc/svx/sdgcoitm.hxx
+++ b/svx/inc/svx/sdgcoitm.hxx
@@ -36,8 +36,6 @@ class SVX_DLLPUBLIC SdrGrafRedItem : public SdrSignedPercentItem
{
public:
- TYPEINFO();
-
SdrGrafRedItem( short nRedPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFRED, nRedPercent ) {}
SdrGrafRedItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFRED, rIn ) {}
@@ -53,8 +51,6 @@ class SVX_DLLPUBLIC SdrGrafGreenItem : public SdrSignedPercentItem
{
public:
- TYPEINFO();
-
SdrGrafGreenItem( short nGreenPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFGREEN, nGreenPercent ) {}
SdrGrafGreenItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFGREEN, rIn ) {}
@@ -70,8 +66,6 @@ class SVX_DLLPUBLIC SdrGrafBlueItem : public SdrSignedPercentItem
{
public:
- TYPEINFO();
-
SdrGrafBlueItem( short nBluePercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFBLUE, nBluePercent ) {}
SdrGrafBlueItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFBLUE, rIn ) {}
diff --git a/svx/inc/svx/sdgcpitm.hxx b/svx/inc/svx/sdgcpitm.hxx
index 5228b07362f7..60e0ea67c6be 100644
--- a/svx/inc/svx/sdgcpitm.hxx
+++ b/svx/inc/svx/sdgcpitm.hxx
@@ -35,8 +35,6 @@ class SVX_DLLPUBLIC SdrGrafCropItem : public SvxGrfCrop
{
public:
- TYPEINFO();
-
SdrGrafCropItem( sal_Int32 nLeftCrop = 0, sal_Int32 nTopCrop = 0,
sal_Int32 nRightCrop = 0, sal_Int32 nBottomCrop = 0,
sal_uInt16 nWhichId = SDRATTR_GRAFCROP ) :
diff --git a/svx/inc/svx/sdggaitm.hxx b/svx/inc/svx/sdggaitm.hxx
index 06c9344a3bae..c00571573cbc 100644
--- a/svx/inc/svx/sdggaitm.hxx
+++ b/svx/inc/svx/sdggaitm.hxx
@@ -36,8 +36,6 @@ class SVX_DLLPUBLIC SdrGrafGamma100Item : public SfxUInt32Item
{
public:
- TYPEINFO();
-
SdrGrafGamma100Item( sal_uIntPtr nGamma100 = 100 ) : SfxUInt32Item( SDRATTR_GRAFGAMMA, nGamma100 ) {}
SdrGrafGamma100Item( SvStream& rIn ) : SfxUInt32Item( SDRATTR_GRAFGAMMA, rIn ) {}
diff --git a/svx/inc/svx/sdginitm.hxx b/svx/inc/svx/sdginitm.hxx
index 3ca1f8f2dc58..a130a922ecfa 100644
--- a/svx/inc/svx/sdginitm.hxx
+++ b/svx/inc/svx/sdginitm.hxx
@@ -36,8 +36,6 @@ class SVX_DLLPUBLIC SdrGrafInvertItem : public SdrOnOffItem
{
public:
- TYPEINFO();
-
SdrGrafInvertItem( sal_Bool bInvert = sal_False ) : SdrOnOffItem( SDRATTR_GRAFINVERT, bInvert ) {}
SdrGrafInvertItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_GRAFINVERT, rIn ) {}
diff --git a/svx/inc/svx/sdgluitm.hxx b/svx/inc/svx/sdgluitm.hxx
index 40fe99fb0dfa..deb2610d3fe8 100644
--- a/svx/inc/svx/sdgluitm.hxx
+++ b/svx/inc/svx/sdgluitm.hxx
@@ -36,8 +36,6 @@ class SVX_DLLPUBLIC SdrGrafLuminanceItem : public SdrSignedPercentItem
{
public:
- TYPEINFO();
-
SdrGrafLuminanceItem( short nLuminancePercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFLUMINANCE, nLuminancePercent ) {}
SdrGrafLuminanceItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFLUMINANCE, rIn ) {}
@@ -53,8 +51,6 @@ class SVX_DLLPUBLIC SdrGrafContrastItem : public SdrSignedPercentItem
{
public:
- TYPEINFO();
-
SdrGrafContrastItem( short nContrastPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFCONTRAST, nContrastPercent ) {}
SdrGrafContrastItem( SvStream& rIn ) : SdrSignedPercentItem( SDRATTR_GRAFCONTRAST, rIn ) {}
diff --git a/svx/inc/svx/sdgmoitm.hxx b/svx/inc/svx/sdgmoitm.hxx
index 3867b03da733..3d7b6c4906e9 100644
--- a/svx/inc/svx/sdgmoitm.hxx
+++ b/svx/inc/svx/sdgmoitm.hxx
@@ -37,8 +37,6 @@ class SVX_DLLPUBLIC SdrGrafModeItem : public SfxEnumItem
{
public:
- TYPEINFO();
-
SdrGrafModeItem( GraphicDrawMode eMode = GRAPHICDRAWMODE_STANDARD ) : SfxEnumItem( SDRATTR_GRAFMODE, (sal_uInt16)eMode ) {}
SdrGrafModeItem( SvStream& rIn ) : SfxEnumItem( SDRATTR_GRAFMODE, rIn ) {}
diff --git a/svx/inc/svx/sdgtritm.hxx b/svx/inc/svx/sdgtritm.hxx
index 1665fb1a0bf7..49222fe28c4b 100644
--- a/svx/inc/svx/sdgtritm.hxx
+++ b/svx/inc/svx/sdgtritm.hxx
@@ -36,7 +36,6 @@ class SVX_DLLPUBLIC SdrGrafTransparenceItem : public SdrPercentItem
{
public:
- TYPEINFO();
SdrGrafTransparenceItem( sal_uInt16 nTransparencePercent = 0 ) : SdrPercentItem( SDRATTR_GRAFTRANSPARENCE, nTransparencePercent ) {}
SdrGrafTransparenceItem( SvStream& rIn ) : SdrPercentItem( SDRATTR_GRAFTRANSPARENCE, rIn ) {}
diff --git a/svx/inc/svx/sdmetitm.hxx b/svx/inc/svx/sdmetitm.hxx
index 677c7ff01cab..401c788e15f7 100644
--- a/svx/inc/svx/sdmetitm.hxx
+++ b/svx/inc/svx/sdmetitm.hxx
@@ -34,14 +34,13 @@
//------------------------------------------------------------
class SVX_DLLPUBLIC SdrMetricItem: public SfxInt32Item {
public:
- TYPEINFO();
SdrMetricItem(): SfxInt32Item() {}
SdrMetricItem(sal_uInt16 nId, sal_Int32 nVal=0): SfxInt32Item(nId,nVal) {}
SdrMetricItem(sal_uInt16 nId, SvStream& rIn): SfxInt32Item(nId,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
- virtual FASTBOOL HasMetrics() const;
- virtual FASTBOOL ScaleMetrics(long nMul, long nDiv);
+ virtual bool HasMetrics() const;
+ virtual void ScaleMetrics(long nMul, long nDiv);
virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
diff --git a/svx/inc/svx/sdooitm.hxx b/svx/inc/svx/sdooitm.hxx
index 36c45f667ee8..ba9d8e1df2f9 100644
--- a/svx/inc/svx/sdooitm.hxx
+++ b/svx/inc/svx/sdooitm.hxx
@@ -34,7 +34,7 @@
//------------------------------------------------------------
class SVX_DLLPUBLIC SdrOnOffItem: public SfxBoolItem {
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SdrOnOffItem(): SfxBoolItem() {}
SdrOnOffItem(sal_uInt16 nId, sal_Bool bOn=sal_False): SfxBoolItem(nId,bOn) {}
SdrOnOffItem(sal_uInt16 nId, SvStream& rIn): SfxBoolItem(nId,rIn) {}
diff --git a/svx/inc/svx/sdprcitm.hxx b/svx/inc/svx/sdprcitm.hxx
index 9e5bb4b637f7..c918059c410f 100644
--- a/svx/inc/svx/sdprcitm.hxx
+++ b/svx/inc/svx/sdprcitm.hxx
@@ -35,7 +35,6 @@
class SVX_DLLPUBLIC SdrPercentItem : public SfxUInt16Item
{
public:
- TYPEINFO();
SdrPercentItem(): SfxUInt16Item() {}
SdrPercentItem(sal_uInt16 nId, sal_uInt16 nVal=0): SfxUInt16Item(nId,nVal) {}
SdrPercentItem(sal_uInt16 nId, SvStream& rIn): SfxUInt16Item(nId,rIn) {}
@@ -57,7 +56,6 @@ public:
class SVX_DLLPUBLIC SdrSignedPercentItem : public SfxInt16Item
{
public:
- TYPEINFO();
SdrSignedPercentItem(): SfxInt16Item() {}
SdrSignedPercentItem( sal_uInt16 nId, sal_Int16 nVal = 0 ) : SfxInt16Item( nId,nVal ) {}
SdrSignedPercentItem( sal_uInt16 nId, SvStream& rIn ) : SfxInt16Item( nId,rIn ) {}
diff --git a/svx/inc/svx/sdr/contact/displayinfo.hxx b/svx/inc/svx/sdr/contact/displayinfo.hxx
index f96a0ce49686..abc599a922b3 100644
--- a/svx/inc/svx/sdr/contact/displayinfo.hxx
+++ b/svx/inc/svx/sdr/contact/displayinfo.hxx
@@ -63,25 +63,25 @@ namespace sdr
// the rasters will be suppressed as if mbPageProcessingActive is set (see there).
// This flag is set internally from the processing mechanism to avoid double page
// painting when the control layer needs to be painted as last layer
- unsigned mbControlLayerProcessingActive : 1;
+ bool mbControlLayerProcessingActive : 1;
// Internal flag to decide if page stuff (background, border, MasterPage, grid, etc...)
// will be processed at all. This flag is user-defined and will not be changed from the
// processing mechanism. Default is true, thus set to false if PagePainting should be suppressed.
// For more granular switching page stuff painting on and off, use the according flags at the
// view (->Is*Visible())
- unsigned mbPageProcessingActive : 1;
+ bool mbPageProcessingActive : 1;
// Internal flag to remember if EnteredGroupDrawMode is active. Default is true
// since this mode starts activated and gets switched off when reacing
// the current group level. Should only be changed by instances which do
// primitive processing
- unsigned mbGhostedDrawModeActive : 1;
+ bool mbGhostedDrawModeActive : 1;
// Internal flag to know if a MasterPage is processed as SubContent of another
// page. Initialized to false, this should only be changed from the instance which
// is processing the MasterPage asSubContent and knows what it does
- unsigned mbSubContentActive : 1;
+ bool mbSubContentActive : 1;
public:
// basic constructor.
diff --git a/svx/inc/svx/sdr/contact/objectcontact.hxx b/svx/inc/svx/sdr/contact/objectcontact.hxx
index 0311e6a28bb3..061005314788 100644
--- a/svx/inc/svx/sdr/contact/objectcontact.hxx
+++ b/svx/inc/svx/sdr/contact/objectcontact.hxx
@@ -27,13 +27,14 @@
#include <svx/sdr/animation/objectanimator.hxx>
#include "svx/svxdllapi.h"
#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <set>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
class SetOfByte;
class Rectangle;
-class SdrPageView;
+class SdrView;
class OutputDevice;
namespace sdr { namespace contact {
@@ -57,6 +58,15 @@ namespace sdr
{
namespace contact
{
+ // sort by ViewObjectContact memory address
+ struct VOCComparator
+ {
+ bool operator()(ViewObjectContact* pA, ViewObjectContact* pB) const;
+ };
+
+ // define std::set type for VOCs
+ typedef ::std::set< ViewObjectContact*, VOCComparator > ViewObjectContactSet;
+
class SVX_DLLPUBLIC ObjectContact
{
private:
@@ -67,7 +77,7 @@ namespace sdr
// All VOCs which are created using this OC, thus remembering this OC
// as a reference. All those VOCs need to be deleted when the OC goes down.
// Registering and de-registering is done in the VOC constructors/destructors.
- std::vector< ViewObjectContact* > maViewObjectContactVector;
+ ViewObjectContactSet maViewObjectContacts;
// A new ViewObjectContact was created and shall be remembered.
void AddViewObjectContact(ViewObjectContact& rVOContact);
@@ -91,15 +101,14 @@ namespace sdr
// bitfield
// flag for preview renderer
- unsigned mbIsPreviewRenderer : 1;
+ bool mbIsPreviewRenderer : 1;
// method to create a EventHandler. Needs to give a result.
sdr::event::TimerEventHandler* CreateEventHandler();
protected:
// Interface to allow derivates to travel over the registered VOC's
- sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); }
- ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; }
+ ViewObjectContactSet& getViewObjectContacts() { return maViewObjectContacts; }
// interface to allow derivates to set PreviewRenderer flag
void setPreviewRenderer(bool bNew) { mbIsPreviewRenderer = bNew; }
@@ -201,8 +210,8 @@ namespace sdr
// get Primitive2DParameters for this view
const drawinglayer::geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; }
- // access to SdrPageView. May return 0L like the default implementations do. Needs to be overloaded as needed.
- virtual SdrPageView* TryToGetSdrPageView() const;
+ // access to SdrView. May return 0L like the default implementations do. Needs to be overloaded as needed.
+ virtual SdrView* TryToGetSdrView() const;
// access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
virtual OutputDevice* TryToGetOutputDevice() const;
diff --git a/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx b/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx
index 6d60f7d33add..929989a08941 100644
--- a/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx
+++ b/svx/inc/svx/sdr/contact/objectcontactofobjlistpainter.hxx
@@ -57,13 +57,13 @@ namespace sdr
//////////////////////////////////////////////////////////////////////////////
+// typedef for transferring SdrObject
+typedef SdrObjectVector SdrObjectVector;
+
namespace sdr
{
namespace contact
{
- // typedef for transferring SdrObject
- typedef ::std::vector< SdrObject* > SdrObjectVector;
-
class SVX_DLLPUBLIC ObjectContactOfObjListPainter : public ObjectContactPainter
{
protected:
diff --git a/svx/inc/svx/sdr/contact/objectcontactofpageview.hxx b/svx/inc/svx/sdr/contact/objectcontactofpageview.hxx
index 67e5a729954b..342860f4af74 100644
--- a/svx/inc/svx/sdr/contact/objectcontactofpageview.hxx
+++ b/svx/inc/svx/sdr/contact/objectcontactofpageview.hxx
@@ -54,7 +54,7 @@ namespace sdr
SdrPageWindow& GetPageWindow() const { return mrPageWindow; }
// access to SdrPage of PageView
- SdrPage* GetSdrPage() const;
+ SdrPage& GetSdrPage() const;
// basic constructor, used from SdrPageView.
ObjectContactOfPageView(SdrPageWindow& rPageWindow);
@@ -128,8 +128,8 @@ namespace sdr
// high contrast display mode
virtual bool isDrawModeHighContrast() const;
- // overloaded access to SdrPageView
- virtual SdrPageView* TryToGetSdrPageView() const;
+ // overloaded access to SdrView
+ virtual SdrView* TryToGetSdrView() const;
// access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
virtual OutputDevice* TryToGetOutputDevice() const;
@@ -137,7 +137,7 @@ namespace sdr
/** sets all UNO controls which are associated with this ObjectContact to
design or alive mode.
*/
- void SetUNOControlsDesignMode( bool _bDesignMode ) const;
+ void SetUNOControlsDesignMode( bool _bDesignMode );
};
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/contact/viewcontact.hxx b/svx/inc/svx/sdr/contact/viewcontact.hxx
index 5de4a775562d..e377b509c632 100644
--- a/svx/inc/svx/sdr/contact/viewcontact.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontact.hxx
@@ -69,6 +69,12 @@ namespace sdr
// can be visualized.
drawinglayer::primitive2d::Primitive2DSequence mxViewIndependentPrimitive2DSequence;
+ // This range defines the view independent bounding rectangle
+ basegfx::B2DRange maViewIndependentRange;
+
+ // This range defines the minimal geometry bounding rectangle (base for old SnapRect)
+ basegfx::B2DRange maSnapRange;
+
// A new ViewObjectContact was created and shall be remembered.
void AddViewObjectContact(ViewObjectContact& rVOContact);
@@ -126,6 +132,16 @@ namespace sdr
// generated a PrimitiveAnimation in it's VOC
bool isAnimatedInAnyViewObjectContact() const;
+ // get the view independent bound rectangle. Default implementation uses
+ // the range of getViewIndependentPrimitive2DSequence and buffers the result
+ // in maViewIndependentRange
+ virtual const basegfx::B2DRange& getViewIndependentRange() const;
+
+ // get the minimal geometry bounding rectangle. Default uses
+ // getViewIndependentPrimitive2DSequence and the HairlineGeometryExtractor2D
+ // processor. Result is buffered in maSnapRange
+ virtual const basegfx::B2DRange& getSnapRange() const;
+
// Access to possible sub-hierarchy and parent. GetObjectCount() default is 0L
// and GetViewContact default pops up an assert since it's an error if
// GetObjectCount has a result != 0 and it's not overloaded.
diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3d.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3d.hxx
index 6324797664b2..fe34c982fc59 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofe3d.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofe3d.hxx
@@ -96,6 +96,9 @@ namespace sdr
drawinglayer::attribute::SdrLineAttribute* impCreateFallbackLineAttribute(const basegfx::BColor& rBColor) const;
public:
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
// access to the local primitive without the object's local 3D transform. This is e.g. needed
// to get the not-yet transformed BoundVolume for e.g. interactions
drawinglayer::primitive3d::Primitive3DSequence getVIP3DSWithoutObjectTransform() const;
diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx
index 892882f5d64c..5e255c1dc968 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofsdrobj.hxx
@@ -33,7 +33,6 @@
// predeclarations
class SdrObject;
-class GeoStat;
class Bitmap;
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx
index 3f870b1c762a..89c9717f4546 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofsdrobjcustomshape.hxx
@@ -47,7 +47,10 @@ namespace sdr
}
// #i101684# internal tooling
- basegfx::B2DRange getCorrectedTextBoundRect() const;
+ basegfx::B2DRange getCorrectedTextBoundRect(
+ const basegfx::B2DRange& rObjectRange,
+ double fRotate,
+ double fShearX) const;
public:
// basic constructor, used from SdrObject.
diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
index c6e56507cebe..010308a1e8d2 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofsdrole2obj.hxx
@@ -53,9 +53,6 @@ namespace sdr
return (SdrOle2Obj&)GetSdrObject();
}
- /// helper to create transformation from SdrObject
- basegfx::B2DHomMatrix createObjectTransform() const;
-
// basic constructor, used from SdrObject.
ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj);
virtual ~ViewContactOfSdrOle2Obj();
diff --git a/svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx b/svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx
index 95cdae3c115c..126991876c27 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofsdrpage.hxx
@@ -202,7 +202,7 @@ namespace sdr
{
protected:
// bitfield
- unsigned mbFront : 1;
+ bool mbFront : 1;
virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
@@ -226,7 +226,7 @@ namespace sdr
{
protected:
// bitfield
- unsigned mbFront : 1;
+ bool mbFront : 1;
virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact);
virtual drawinglayer::primitive2d::Primitive2DSequence createViewIndependentPrimitive2DSequence() const;
diff --git a/svx/inc/svx/sdr/contact/viewobjectcontact.hxx b/svx/inc/svx/sdr/contact/viewobjectcontact.hxx
index 7052e61ca180..f7c782b55d7a 100644
--- a/svx/inc/svx/sdr/contact/viewobjectcontact.hxx
+++ b/svx/inc/svx/sdr/contact/viewobjectcontact.hxx
@@ -61,8 +61,8 @@ namespace sdr
ObjectContact& mrObjectContact;
ViewContact& mrViewContact;
- // This range defines the object's BoundRect
- basegfx::B2DRange maObjectRange;
+ // This range defines the view dependent bounding rectangle
+ basegfx::B2DRange maViewDependentRange;
// PrimitiveSequence of the ViewContact. This contains all necessary information
// for the graphical visualisation and needs to be supported by all VCs which
@@ -75,7 +75,7 @@ namespace sdr
// bitfield
// This bool gets set when the object gets invalidated by ActionChanged() and
// can be used from the OC to late-invalidates
- unsigned mbLazyInvalidate : 1;
+ bool mbLazyInvalidate : 1;
protected:
// make redirector a protected friend, it needs to call createPrimitives as default action
@@ -106,8 +106,9 @@ namespace sdr
// access to ViewContact
ViewContact& GetViewContact() const { return mrViewContact; }
- // get the oebject's size range
- const basegfx::B2DRange& getObjectRange() const;
+ // get the view dependent bound rectangle. Default implementation uses
+ // the range of getPrimitive2DSequence and buffers the result in maViewDependentRange
+ virtual const basegfx::B2DRange& getViewDependentRange() const;
// A ViewObjectContact was deleted and shall be forgotten.
void RemoveViewObjectContact(ViewObjectContact& rVOContact);
diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx
index 4b03119f8df4..6d125ef925ae 100644
--- a/svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx
+++ b/svx/inc/svx/sdr/contact/viewobjectcontactofe3d.hxx
@@ -63,6 +63,9 @@ namespace sdr
ViewObjectContactOfE3d(ObjectContact& rObjectContact, ViewContact& rViewContact);
virtual ~ViewObjectContactOfE3d();
+ // React on changes of the object of this ViewContact
+ virtual void ActionChanged();
+
// access to the local primitive sequence. This will ensure that the list is
// current in comparing the local list content with a fresh created incarnation
// This method will not handle included hierarchies or visibility.
diff --git a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
index 6e4aeeb646be..706a8481be56 100644
--- a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx
@@ -51,7 +51,7 @@ namespace sdr
// bitfield
// Flag to remember which state to draw. Inited with sal_False (0)
- unsigned mbOverlayState : 1;
+ bool mbOverlayState : 1;
// geometry creation for OverlayObject
virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
diff --git a/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx
index 9bcd496f634d..e452d5397e06 100644
--- a/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx
@@ -25,8 +25,8 @@
#define _SDR_OVERLAY_OVERLAYHATCHRECT_HXX
#include <svx/sdr/overlay/overlayobject.hxx>
-#include <vcl/hatch.hxx>
#include <tools/gen.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -36,36 +36,30 @@ namespace sdr
{
namespace overlay
{
- class OverlayHatchRect : public OverlayObjectWithBasePosition
+ class OverlayHatchRect : public OverlayObject
{
// geometric definitions
- basegfx::B2DPoint maSecondPosition;
+ const basegfx::B2DHomMatrix maTransformation;
const double mfDiscreteGrow;
const double mfDiscreteShrink;
const double mfHatchRotation;
- const double mfRotation;
// geometry creation for OverlayObject
virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
public:
OverlayHatchRect(
- const basegfx::B2DPoint& rBasePosition,
- const basegfx::B2DPoint& rSecondPosition,
+ const basegfx::B2DHomMatrix& rTransformation,
const Color& rHatchColor,
double fDiscreteGrow,
double fDiscreteShrink,
- double fHatchRotation,
- double fRotation);
-
- const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
- void setSecondPosition(const basegfx::B2DPoint&);
+ double fHatchRotation);
// data read access
+ const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
double getDiscreteGrow() const { return mfDiscreteGrow; }
double getDiscreteShrink() const { return mfDiscreteShrink; }
double getHatchRotation() const { return mfHatchRotation; }
- double getRotation() const { return mfRotation; }
};
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
index dafab92b7a64..1478be1e1dda 100644
--- a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx
@@ -59,7 +59,7 @@ namespace sdr
// bitfield
// Flag to decide if PreRendering shall be used for overlay refreshes.
// Default is false.
- unsigned mbRefreshWithPreRendering : 1;
+ bool mbRefreshWithPreRendering : 1;
// link for timer
DECL_LINK(ImpBufferTimerHandler, AutoTimer*);
diff --git a/svx/inc/svx/sdr/overlay/overlayobject.hxx b/svx/inc/svx/sdr/overlay/overlayobject.hxx
index a07f389c499b..bedfe3334aaf 100644
--- a/svx/inc/svx/sdr/overlay/overlayobject.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayobject.hxx
@@ -93,20 +93,20 @@ namespace sdr
// bitfield
// Flag for visibility
- unsigned mbIsVisible : 1;
+ bool mbIsVisible : 1;
// Flag to control hittability
- unsigned mbIsHittable : 1;
+ bool mbIsHittable : 1;
// Flag to hold info if this objects supports animation. Default is
// false. If true, the Trigger() method should be overloaded
// to implement the animation effect and to re-initiate the event.
- unsigned mbAllowsAnimation : 1;
+ bool mbAllowsAnimation : 1;
// Flag tocontrol if this OverlayObject allows AntiAliased visualisation.
// Default is true, but e.g. for selection visualisation in SC and SW,
// it is switched to false
- unsigned mbAllowsAntiAliase : 1;
+ bool mbAllowsAntiAliase : 1;
// set changed flag. Call after change, since the old range is invalidated
// and then the new one is calculated and invalidated, too. This will only
diff --git a/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx
index 5db4487ca9b6..aec612149361 100644
--- a/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx
@@ -40,10 +40,10 @@ namespace sdr
// bitfield
// Flag to switch on/off long lines to the OutputDevice bounds
- unsigned mbExtendedLines : 1;
+ bool mbExtendedLines : 1;
// Flag to switch on/off the bounds itself
- unsigned mbShowBounds : 1;
+ bool mbShowBounds : 1;
// geometry creation for OverlayObject
virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
diff --git a/svx/inc/svx/sdr/overlay/overlayselection.hxx b/svx/inc/svx/sdr/overlay/overlayselection.hxx
index 284f5f388296..7dc0c78722ea 100644
--- a/svx/inc/svx/sdr/overlay/overlayselection.hxx
+++ b/svx/inc/svx/sdr/overlay/overlayselection.hxx
@@ -57,7 +57,7 @@ namespace sdr
sal_uInt16 mnLastTransparence;
// bitfield
- unsigned mbBorder : 1;
+ bool mbBorder : 1;
// geometry creation for OverlayObject, can use local *Last* values
virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
diff --git a/svx/inc/svx/sdr/overlay/overlaytools.hxx b/svx/inc/svx/sdr/overlay/overlaytools.hxx
index b558eabc24e5..9ce664758c2e 100644
--- a/svx/inc/svx/sdr/overlay/overlaytools.hxx
+++ b/svx/inc/svx/sdr/overlay/overlaytools.hxx
@@ -66,9 +66,6 @@ namespace drawinglayer
sal_uInt16 getCenterX() const { return mnCenterX; }
sal_uInt16 getCenterY() const { return mnCenterY; }
- // compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -107,9 +104,6 @@ namespace drawinglayer
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -122,11 +116,11 @@ namespace drawinglayer
{
namespace primitive2d
{
- class OverlayHatchRectanglePrimitive : public DiscreteMetricDependentPrimitive2D
+ class OverlayHatchPrimitive : public DiscreteMetricDependentPrimitive2D
{
private:
- // the logic rectangle definition
- basegfx::B2DRange maObjectRange;
+ // the logic geometric definition
+ const basegfx::B2DHomMatrix maTransformation;
// the hatch definition
double mfDiscreteHatchDistance;
@@ -137,33 +131,25 @@ namespace drawinglayer
double mfDiscreteGrow;
double mfDiscreteShrink;
- // the rotation of the primitive itself
- double mfRotation;
-
protected:
virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
public:
- OverlayHatchRectanglePrimitive(
- const basegfx::B2DRange& rObjectRange,
+ OverlayHatchPrimitive(
+ const basegfx::B2DHomMatrix& rTransformation,
double fDiscreteHatchDistance,
double fHatchRotation,
const basegfx::BColor& rHatchColor,
double fDiscreteGrow,
- double fDiscreteShrink,
- double fRotation);
+ double fDiscreteShrink);
// data access
- const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
+ const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
double getDiscreteHatchDistance() const { return mfDiscreteHatchDistance; }
double getHatchRotation() const { return mfHatchRotation; }
const basegfx::BColor& getHatchColor() const { return maHatchColor; }
double getDiscreteGrow() const { return mfDiscreteGrow; }
double getDiscreteShrink() const { return mfDiscreteShrink; }
- double getRotation() const { return mfRotation; }
-
- // compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
DeclPrimitrive2DIDBlock()
};
@@ -216,9 +202,6 @@ namespace drawinglayer
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
@@ -259,9 +242,6 @@ namespace drawinglayer
const basegfx::BColor& getRGBColorB() const { return maRGBColorB; }
double getDiscreteDashLength() const { return mfDiscreteDashLength; }
- // compare operator
- virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
-
DeclPrimitrive2DIDBlock()
};
} // end of namespace primitive2d
diff --git a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
index ab2ddd93801c..721833ef70a6 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
@@ -124,7 +124,8 @@ namespace drawinglayer
// helpers
void calculateRelativeCornerRadius(
sal_Int32 nRadius,
- const ::basegfx::B2DRange& rObjectRange,
+ const double& rfWidth,
+ const double& rfHeight,
double& rfCornerRadiusX,
double& rfCornerRadiusY);
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
index 82ccf477ff63..96a8db02bc3f 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
@@ -59,9 +59,6 @@ namespace drawinglayer
double fCornerRadiusX = 0.0,
double fCornerRadiusY = 0.0);
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// data access
const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
diff --git a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx
index 94577ab1bc76..0f972577619b 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx
@@ -56,9 +56,6 @@ namespace drawinglayer
const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; }
const ::basegfx::B2DPolygon& getUnitPolygon() const { return maUnitPolygon; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
index 3ca1607d506a..efb5668d63da 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
@@ -45,16 +45,16 @@ namespace drawinglayer
basegfx::B2DHomMatrix maTextBox;
// bitfield
- // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
+ // defines if TextWordWrap was set at SdrObjCustomShape which means
// that the text needs to be block formatted
- unsigned mbWordWrap : 1;
+ bool mbWordWrap : 1;
// defines that the object contains/is a 3D AutoShape. Needed for
// making exceptions with shadow generation
- unsigned mb3DShape : 1;
+ bool mb3DShape : 1;
// #SJ# Allow text clipping against TextBox in special cases (used for SC)
- unsigned mbForceTextClipToTextRange : 1;
+ bool mbForceTextClipToTextRange : 1;
protected:
// local decomposition.
@@ -77,9 +77,6 @@ namespace drawinglayer
bool get3DShape() const { return mb3DShape; }
bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx
index 5cc3c99dd797..7bff1f65bbd3 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx
@@ -56,9 +56,6 @@ namespace drawinglayer
const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
@@ -78,8 +75,8 @@ namespace drawinglayer
double mfEndAngle;
// bitfield
- unsigned mbCloseSegment : 1;
- unsigned mbCloseUsingCenter : 1;
+ bool mbCloseSegment : 1;
+ bool mbCloseUsingCenter : 1;
protected:
// local decomposition.
@@ -100,9 +97,6 @@ namespace drawinglayer
bool getCloseSegment() const { return mbCloseSegment; }
bool getCloseUsingCenter() const { return mbCloseUsingCenter; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx
index 86f4d9ab5776..a9fc5dbd40fc 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx
@@ -64,9 +64,6 @@ namespace drawinglayer
const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
bool isTransparent() const;
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
index 3db6c7dc0ac8..9a160388a219 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
@@ -65,9 +65,9 @@ namespace drawinglayer
double mfRightDelta;
// bitfield
- unsigned mbBelow : 1;
- unsigned mbTextRotation : 1;
- unsigned mbTextAutoAngle : 1;
+ bool mbBelow : 1;
+ bool mbTextRotation : 1;
+ bool mbTextAutoAngle : 1;
// internal decomposition helper
Primitive2DReference impCreatePart(
@@ -113,9 +113,6 @@ namespace drawinglayer
bool getTextRotation() const { return mbTextRotation; }
bool getTextAutoAngle() const { return mbTextAutoAngle; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx
index 8539f83d90e7..d03ffe1f35e8 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx
@@ -55,9 +55,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// local decomposition.
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
diff --git a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
index 42b18eb18338..e8c434f820cc 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrolecontentprimitive2d.hxx
@@ -51,7 +51,7 @@ namespace drawinglayer
sal_uInt32 mnGraphicVersion;
// bitfield
- unsigned mbHighContrast : 1;
+ bool mbHighContrast : 1;
protected:
// local decomposition.
@@ -64,9 +64,6 @@ namespace drawinglayer
sal_uInt32 nGraphicVersion,
bool bHighContrast);
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// The default implementation will use getDecomposition results to create the range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
diff --git a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
index 07da35b4b304..b8a27de7802c 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
@@ -60,9 +60,6 @@ namespace drawinglayer
const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
index ede4a7ffcec3..bfa6ce1b68a5 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
@@ -70,9 +70,6 @@ namespace drawinglayer
bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
bool getForceFillForHitTest() const { return mbForceFillForHitTest; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
index 4b92f60d56bf..dbf763a8f5e1 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -76,9 +76,9 @@ namespace drawinglayer
// bitfield
// is there a PageNumber, Header, Footer or DateTimeField used? Evaluated at construction
- unsigned mbContainsPageField : 1;
- unsigned mbContainsPageCountField : 1;
- unsigned mbContainsOtherFields : 1;
+ bool mbContainsPageField : 1;
+ bool mbContainsPageCountField : 1;
+ bool mbContainsOtherFields : 1;
protected:
// support for XTEXT_PAINTSHAPE_BEGIN/XTEXT_PAINTSHAPE_END Metafile comments
@@ -93,9 +93,6 @@ namespace drawinglayer
const SdrText* getSdrText() const { return mrSdrText.get(); }
const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// own get2DDecomposition to take aspect of decomposition with or without spell checker
// into account
virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
@@ -136,9 +133,6 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& getUnitPolyPolygon() const { return maUnitPolyPolygon; }
const basegfx::B2DHomMatrix& getObjectTransform() const { return maObjectTransform; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// transformed clone operator
virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
@@ -178,9 +172,6 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& getPathPolyPolygon() const { return maPathPolyPolygon; }
const attribute::SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// transformed clone operator
virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
@@ -207,11 +198,11 @@ namespace drawinglayer
SdrTextVertAdjust maSdrTextVertAdjust;
// bitfield
- unsigned mbFixedCellHeight : 1;
- unsigned mbUnlimitedPage : 1; // force layout with no text break
- unsigned mbCellText : 1; // this is a cell text as block text
- unsigned mbWordWrap : 1; // for CustomShapes text layout
- unsigned mbClipOnBounds : 1; // for CustomShapes text layout
+ bool mbFixedCellHeight : 1;
+ bool mbUnlimitedPage : 1; // force layout with no text break
+ bool mbCellText : 1; // this is a cell text as block text
+ bool mbWordWrap : 1; // for CustomShapes text layout
+ bool mbClipOnBounds : 1; // for CustomShapes text layout
protected:
// local decomposition.
@@ -240,9 +231,6 @@ namespace drawinglayer
bool getWordWrap() const { return mbWordWrap; }
bool getClipOnBounds() const { return mbClipOnBounds; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// transformed clone operator
virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
@@ -265,7 +253,7 @@ namespace drawinglayer
basegfx::B2DHomMatrix maTextRangeTransform;
// bitfield
- unsigned mbFixedCellHeight : 1;
+ bool mbFixedCellHeight : 1;
protected:
// local decomposition.
@@ -282,9 +270,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
bool isFixedCellHeight() const { return mbFixedCellHeight; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// transformed clone operator
virtual SdrTextPrimitive2D* createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const;
diff --git a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
index 8b34ba7457c1..98d7084f3f26 100644
--- a/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
@@ -46,7 +46,7 @@
#define PRIMITIVE2D_ID_SDRBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 15)
#define PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 16)
#define PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 17)
-#define PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 18)
+#define PRIMITIVE2D_ID_OVERLAYHATCHPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 18)
#define PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 19)
#define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20)
#define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21)
diff --git a/svx/inc/svx/sdr/properties/attributeproperties.hxx b/svx/inc/svx/sdr/properties/attributeproperties.hxx
index dc5601fcbbf1..22f2b273b20c 100644
--- a/svx/inc/svx/sdr/properties/attributeproperties.hxx
+++ b/svx/inc/svx/sdr/properties/attributeproperties.hxx
@@ -36,16 +36,23 @@ namespace sdr
{
class SVX_DLLPUBLIC AttributeProperties : public DefaultProperties, public SfxListener
{
+ private:
+ // core to set parent at SfxItemSet and to execute the hard attribute computations
+ void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr);
+
// add style sheet, do all the necessary handling
- void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ void ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// remove StyleSheet, do all the necessary handling
void ImpRemoveStyleSheet();
- protected:
+ // do needed changes when cloning to a new model
+ void ImpModelChange(SdrModel& rSourceModel, SdrModel& rTargetModel);
+
// the SytleSheet of this object
SfxStyleSheet* mpStyleSheet;
+ protected:
// create a new itemset
virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool);
@@ -62,24 +69,22 @@ namespace sdr
// constructor for copying, but using new object
AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj);
+ // destructor
+ virtual ~AttributeProperties();
+
// Clone() operator, normally just calls the local copy constructor
virtual BaseProperties& Clone(SdrObject& rObj) const;
- // destructor
- virtual ~AttributeProperties();
+ // Get the local ItemSet. This directly returns the local ItemSet of the object. No
+ // merging of ItemSets is done for e.g. Group objects.
+ virtual const SfxItemSet& GetObjectItemSet() const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// get the installed StyleSheet
virtual SfxStyleSheet* GetStyleSheet() const;
- // Move properties to a new ItemPool.
- virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
-
- // Set new model.
- virtual void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
-
// force all attributes which come from styles to hard attributes
// to be able to live without the style.
virtual void ForceStyleToHardAttributes();
diff --git a/svx/inc/svx/sdr/properties/captionproperties.hxx b/svx/inc/svx/sdr/properties/captionproperties.hxx
index c1716e12f58d..cc7bf75eadd9 100644
--- a/svx/inc/svx/sdr/properties/captionproperties.hxx
+++ b/svx/inc/svx/sdr/properties/captionproperties.hxx
@@ -55,7 +55,7 @@ namespace sdr
virtual BaseProperties& Clone(SdrObject& rObj) const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// force default attributes for a specific object type, called from
// DefaultProperties::GetObjectItemSet() if a new ItemSet is created
diff --git a/svx/inc/svx/sdr/properties/connectorproperties.hxx b/svx/inc/svx/sdr/properties/connectorproperties.hxx
index 76d12c27f4f9..9b4b48a0bca6 100644
--- a/svx/inc/svx/sdr/properties/connectorproperties.hxx
+++ b/svx/inc/svx/sdr/properties/connectorproperties.hxx
@@ -55,7 +55,7 @@ namespace sdr
virtual BaseProperties& Clone(SdrObject& rObj) const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/properties/customshapeproperties.hxx b/svx/inc/svx/sdr/properties/customshapeproperties.hxx
index 6786e1f213ee..9b4db89316f2 100644
--- a/svx/inc/svx/sdr/properties/customshapeproperties.hxx
+++ b/svx/inc/svx/sdr/properties/customshapeproperties.hxx
@@ -41,7 +41,7 @@ namespace sdr
virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
// test changeability for a single item
- virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+ virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
// react on ItemSet changes
virtual void ItemSetChanged(const SfxItemSet& rSet);
@@ -59,7 +59,7 @@ namespace sdr
public:
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// force default attributes for a specific object type, called from
// DefaultProperties::GetObjectItemSet() if a new ItemSet is created
diff --git a/svx/inc/svx/sdr/properties/defaultproperties.hxx b/svx/inc/svx/sdr/properties/defaultproperties.hxx
index c1a3fba17f62..8dba79bb9071 100644
--- a/svx/inc/svx/sdr/properties/defaultproperties.hxx
+++ b/svx/inc/svx/sdr/properties/defaultproperties.hxx
@@ -35,6 +35,7 @@ namespace sdr
{
class SVX_DLLPUBLIC DefaultProperties : public BaseProperties
{
+ private:
protected:
// the to be used ItemSet
SfxItemSet* mpItemSet;
@@ -43,7 +44,7 @@ namespace sdr
virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
// test changeability for a single item
- virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+ virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
// Do the ItemChange, may do special handling
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
@@ -87,7 +88,7 @@ namespace sdr
virtual void SetObjectItemSet(const SfxItemSet& rSet);
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// get the installed StyleSheet
virtual SfxStyleSheet* GetStyleSheet() const;
diff --git a/svx/inc/svx/sdr/properties/e3dcompoundproperties.hxx b/svx/inc/svx/sdr/properties/e3dcompoundproperties.hxx
index 49e892efef55..e252365c19f8 100644
--- a/svx/inc/svx/sdr/properties/e3dcompoundproperties.hxx
+++ b/svx/inc/svx/sdr/properties/e3dcompoundproperties.hxx
@@ -63,7 +63,7 @@ namespace sdr
virtual const SfxItemSet& GetMergedItemSet() const;
// Set merged ItemSet. Normally, this maps to SetObjectItemSet().
- virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false);
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/properties/e3dproperties.hxx b/svx/inc/svx/sdr/properties/e3dproperties.hxx
index 73f4ccfba395..05f9f2f730ee 100644
--- a/svx/inc/svx/sdr/properties/e3dproperties.hxx
+++ b/svx/inc/svx/sdr/properties/e3dproperties.hxx
@@ -56,7 +56,7 @@ namespace sdr
virtual BaseProperties& Clone(SdrObject& rObj) const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/properties/e3dsceneproperties.hxx b/svx/inc/svx/sdr/properties/e3dsceneproperties.hxx
index f6273a47b144..2753d712052e 100644
--- a/svx/inc/svx/sdr/properties/e3dsceneproperties.hxx
+++ b/svx/inc/svx/sdr/properties/e3dsceneproperties.hxx
@@ -62,7 +62,7 @@ namespace sdr
virtual const SfxItemSet& GetMergedItemSet() const;
// Set merged ItemSet. Normally, this maps to SetObjectItemSet().
- virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false);
// Set a single item, iterate over hierarchies if necessary.
virtual void SetMergedItem(const SfxPoolItem& rItem);
@@ -71,14 +71,11 @@ namespace sdr
virtual void ClearMergedItem(const sal_uInt16 nWhich = 0);
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// get the installed StyleSheet
virtual SfxStyleSheet* GetStyleSheet() const;
- // Move properties to a new ItemPool. Default implementation does nothing.
- virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
-
// Special for scene:
void SetSceneItemsFromCamera();
};
diff --git a/svx/inc/svx/sdr/properties/emptyproperties.hxx b/svx/inc/svx/sdr/properties/emptyproperties.hxx
index bb9cf79cb522..a07f35aab931 100644
--- a/svx/inc/svx/sdr/properties/emptyproperties.hxx
+++ b/svx/inc/svx/sdr/properties/emptyproperties.hxx
@@ -43,7 +43,7 @@ namespace sdr
virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
// test changeability for a single item
- virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+ virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
// Do the ItemChange, may do special handling
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
@@ -87,7 +87,7 @@ namespace sdr
virtual void SetObjectItemSet(const SfxItemSet& rSet);
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// get the installed StyleSheet
virtual SfxStyleSheet* GetStyleSheet() const;
diff --git a/svx/inc/svx/sdr/properties/graphicproperties.hxx b/svx/inc/svx/sdr/properties/graphicproperties.hxx
index ce888438fa69..d652a0249dce 100644
--- a/svx/inc/svx/sdr/properties/graphicproperties.hxx
+++ b/svx/inc/svx/sdr/properties/graphicproperties.hxx
@@ -55,7 +55,7 @@ namespace sdr
virtual BaseProperties& Clone(SdrObject& rObj) const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// force default attributes for a specific object type, called from
// DefaultProperties::GetObjectItemSet() if a new ItemSet is created
diff --git a/svx/inc/svx/sdr/properties/groupproperties.hxx b/svx/inc/svx/sdr/properties/groupproperties.hxx
index a328812b07b2..9d420ef860d6 100644
--- a/svx/inc/svx/sdr/properties/groupproperties.hxx
+++ b/svx/inc/svx/sdr/properties/groupproperties.hxx
@@ -39,7 +39,7 @@ namespace sdr
virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& rPool);
// test changeability for a single item
- virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
+ virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const;
// Do the ItemChange, may do special handling
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
@@ -74,7 +74,7 @@ namespace sdr
virtual const SfxItemSet& GetMergedItemSet() const;
// Set merged ItemSet. Normally, this maps to SetObjectItemSet().
- virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false);
// set single item
virtual void SetObjectItem(const SfxPoolItem& rItem);
@@ -99,7 +99,7 @@ namespace sdr
virtual void SetObjectItemSet(const SfxItemSet& rSet);
// set a new StyleSheet
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// get the local StyleSheet
virtual SfxStyleSheet* GetStyleSheet() const;
@@ -108,9 +108,6 @@ namespace sdr
// DefaultProperties::GetObjectItemSet() if a new ItemSet is created
virtual void ForceDefaultAttributes();
- // Move properties to a new ItemPool.
- virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
-
// force all attributes which come from styles to hard attributes
// to be able to live without the style.
virtual void ForceStyleToHardAttributes();
diff --git a/svx/inc/svx/sdr/properties/itemsettools.hxx b/svx/inc/svx/sdr/properties/itemsettools.hxx
index 402378b98233..10381ae0b21c 100644
--- a/svx/inc/svx/sdr/properties/itemsettools.hxx
+++ b/svx/inc/svx/sdr/properties/itemsettools.hxx
@@ -25,6 +25,7 @@
#define _SDR_PROPERTIES_ITEMSETTOOLS_HXX
#include <sal/types.h>
+#include <vector>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
@@ -33,24 +34,25 @@ class SdrObject;
class SfxItemSet;
class Rectangle;
class Fraction;
+class SdrObjectChangeBroadcaster;
//////////////////////////////////////////////////////////////////////////////
-// class to remember broadcast start positions
+// class to remember complete broadcast for ItemChange in evtl. hierarchies
+
namespace sdr
{
namespace properties
{
+ typedef ::std::vector< SdrObjectChangeBroadcaster* > BroadcastVector;
+
class ItemChangeBroadcaster
{
- sal_uInt32 mnCount;
- void* mpData;
+ private:
+ BroadcastVector maBroadcastVector;
public:
ItemChangeBroadcaster(const SdrObject& rObj);
~ItemChangeBroadcaster();
-
- sal_uInt32 GetRectangleCount() const;
- const Rectangle& GetRectangle(sal_uInt32 nIndex) const;
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/properties/measureproperties.hxx b/svx/inc/svx/sdr/properties/measureproperties.hxx
index 21d4aa96e2ac..3df6ebb48545 100644
--- a/svx/inc/svx/sdr/properties/measureproperties.hxx
+++ b/svx/inc/svx/sdr/properties/measureproperties.hxx
@@ -55,7 +55,7 @@ namespace sdr
virtual BaseProperties& Clone(SdrObject& rObj) const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// force default attributes for a specific object type, called from
// DefaultProperties::GetObjectItemSet() if a new ItemSet is created
diff --git a/svx/inc/svx/sdr/properties/properties.hxx b/svx/inc/svx/sdr/properties/properties.hxx
index 0d99a9f67034..5ecce07f89f5 100644
--- a/svx/inc/svx/sdr/properties/properties.hxx
+++ b/svx/inc/svx/sdr/properties/properties.hxx
@@ -26,6 +26,7 @@
#include <sal/types.h>
#include "svx/svxdllapi.h"
+#include <boost/utility.hpp>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
@@ -53,12 +54,14 @@ namespace sdr
namespace properties
{
class SVX_DLLPUBLIC BaseProperties
+ : private boost::noncopyable
{
- protected:
+ private:
// the owner of this Properties. Set from constructor and not
// to be changed in any way.
SdrObject& mrObject;
+ protected:
// create a new object specific itemset with object specific ranges.
virtual SfxItemSet& CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0;
@@ -70,7 +73,7 @@ namespace sdr
// Test changeability for a single item. If a implementation wants to prevent
// changing an item this method may be overloaded.
- virtual sal_Bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const = 0;
+ virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0) const = 0;
// Do the internal ItemChange. If only nWhich is given, the item needs to be cleared.
// Also needs to handle if nWhich and pNewItem is 0, which means to clear all items.
@@ -114,7 +117,7 @@ namespace sdr
virtual void SetObjectItemSet(const SfxItemSet& rSet) = 0;
// Set merged ItemSet. Normally, this maps to SetObjectItemSet().
- virtual void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false);
// Set single item at the local ItemSet. Uses AllowItemChange(),
// ItemChange(), PostItemChange() and ItemSetChanged() calls.
@@ -143,7 +146,7 @@ namespace sdr
// Set a new StyleSheet. Registers as listener at the StyleSheet to get knowledge
// of StyleSheet changes.
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr) = 0;
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) = 0;
// Get the installed StyleSheet.
virtual SfxStyleSheet* GetStyleSheet() const = 0;
@@ -152,13 +155,6 @@ namespace sdr
// overloaded to do it for hierarchical objects like e.g. groups.
virtual void Scale(const Fraction& rScale);
- // Move local items to a new ItemPool. This needs to be
- // overloaded to do it for hierarchical objects like e.g. groups.
- virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
-
- // Set new model.
- virtual void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
-
// force all attributes which come from styles to hard attributes
// to be able to live without the style.
virtual void ForceStyleToHardAttributes();
@@ -168,16 +164,11 @@ namespace sdr
// will be changed these broadcasts will no longer be needed.
//void SetItemAndBroadcast(const SfxPoolItem& rItem);
//void ClearItemAndBroadcast(const sal_uInt16 nWhich = 0);
- void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems = false);
// Just a convenient shortcut for GetObjectItemSet().Get(nWhich).
const SfxPoolItem& GetItem(const sal_uInt16 nWhich) const;
- // support for convenient broadcasting. Used from SetMergedItemAndBroadcast(),
- // ClearItemAndBroadcast() and SetItemSetAndBroadcast(), see above.
- // But also from inside SdrObjects.
- void BroadcastItemChange(const ItemChangeBroadcaster& rChange);
-
// #i101556# add versioning mechanism; used from e.g. text attribute set to
// allow detection of e.g. style sheet or single text attribute changes. The
// default implementation returns 0 (zero)
diff --git a/svx/inc/svx/sdr/properties/rectangleproperties.hxx b/svx/inc/svx/sdr/properties/rectangleproperties.hxx
index 70c86a7e51da..ef3f1da9464d 100644
--- a/svx/inc/svx/sdr/properties/rectangleproperties.hxx
+++ b/svx/inc/svx/sdr/properties/rectangleproperties.hxx
@@ -53,7 +53,7 @@ namespace sdr
virtual BaseProperties& Clone(SdrObject& rObj) const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/sdr/properties/textproperties.hxx b/svx/inc/svx/sdr/properties/textproperties.hxx
index 8a9791c8e884..f59e6bfe0d03 100644
--- a/svx/inc/svx/sdr/properties/textproperties.hxx
+++ b/svx/inc/svx/sdr/properties/textproperties.hxx
@@ -63,7 +63,7 @@ namespace sdr
virtual BaseProperties& Clone(SdrObject& rObj) const;
// set a new StyleSheet and broadcast
- virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
// force default attributes for a specific object type, called from
// DefaultProperties::GetObjectItemSet() if a new ItemSet is created
diff --git a/svx/inc/svx/sdrhittesthelper.hxx b/svx/inc/svx/sdrhittesthelper.hxx
index 6926fa2720cb..8ac59bc951e6 100644
--- a/svx/inc/svx/sdrhittesthelper.hxx
+++ b/svx/inc/svx/sdrhittesthelper.hxx
@@ -27,12 +27,13 @@
#include "svx/svxdllapi.h"
#include <tools/string.hxx>
#include <tools/gen.hxx>
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
/////////////////////////////////////////////////////////////////////
// #i101872# new Object HitTest as View-tooling
class SdrObject;
-class SdrPageView;
+class SdrView;
class SetOfByte;
class SdrObjList;
namespace sdr { namespace contact { class ViewObjectContact; }}
@@ -43,19 +44,19 @@ namespace basegfx { class B2DPoint; }
SVX_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit(
const SdrObject& rObject,
- const Point& rPnt,
- sal_uInt16 nTol,
- const SdrPageView& rSdrPageView,
- const SetOfByte* pVisiLayer,
- bool bTextOnly);
+ const basegfx::B2DPoint& rPnt,
+ double fTol,
+ const SdrView& rSdrView,
+ bool bTextOnly,
+ drawinglayer::primitive2d::Primitive2DSequence* pRecordFields);
SVX_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit(
const SdrObjList& rList,
- const Point& rPnt,
- sal_uInt16 nTol,
- const SdrPageView& rSdrPageView,
- const SetOfByte* pVisiLayer,
- bool bTextOnly);
+ const basegfx::B2DPoint& rPnt,
+ double fTol,
+ const SdrView& rSdrView,
+ bool bTextOnly,
+ drawinglayer::primitive2d::Primitive2DSequence* pRecordFields);
/////////////////////////////////////////////////////////////////////
// the pure HitTest based on a VOC
@@ -64,7 +65,8 @@ SVX_DLLPUBLIC bool ViewObjectContactPrimitiveHit(
const sdr::contact::ViewObjectContact& rVOC,
const basegfx::B2DPoint& rHitPosition,
double fLogicHitTolerance,
- bool bTextOnly);
+ bool bTextOnly,
+ drawinglayer::primitive2d::Primitive2DSequence* pRecordFields);
/////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx
index 9783ce3df69d..e516da4234c5 100644
--- a/svx/inc/svx/sdrmasterpagedescriptor.hxx
+++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx
@@ -24,28 +24,21 @@
#ifndef _SDR_MASTERPAGEDESCRIPTOR_HXX
#define _SDR_MASTERPAGEDESCRIPTOR_HXX
-#include <svx/sdrpageuser.hxx>
#include <svx/svdsob.hxx>
+#include <svl/lstner.hxx>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
-class SdrObject;
-class SfxItemSet;
-class SdrPageProperties;
-namespace sdr
-{
- namespace contact
- {
- class ViewContact;
- } // end of namespace contact
-} // end of namespace sdr
+class SdrPage;
+namespace sdr { namespace contact { class ViewContact; }}
+class SdrPageProperties;
//////////////////////////////////////////////////////////////////////////////
namespace sdr
{
- class MasterPageDescriptor : public sdr::PageUser
+ class MasterPageDescriptor : public SfxListener
{
private:
SdrPage& maOwnerPage;
@@ -71,7 +64,7 @@ namespace sdr
// this method is called form the destructor of the referenced page.
// do all necessary action to forget the page. It is not necessary to call
// RemovePageUser(), that is done form the destructor.
- virtual void PageInDestruction(const SdrPage& rPage);
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
// member access to UsedPage
SdrPage& GetUsedPage() const { return maUsedPage; }
@@ -84,8 +77,8 @@ namespace sdr
void SetVisibleLayers(const SetOfByte& rNew);
// operators
- sal_Bool operator==(const MasterPageDescriptor& rCandidate) const;
- sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const;
+ bool operator==(const MasterPageDescriptor& rCandidate) const;
+ bool operator!=(const MasterPageDescriptor& rCandidate) const;
const SdrPageProperties* getCorrectSdrPageProperties() const;
};
diff --git a/svx/inc/svx/sdrobjectfactory.hxx b/svx/inc/svx/sdrobjectfactory.hxx
new file mode 100755
index 000000000000..f68226dc8ae9
--- /dev/null
+++ b/svx/inc/svx/sdrobjectfactory.hxx
@@ -0,0 +1,116 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+#ifndef _SVDOBJFACTORY_HXX
+#define _SVDOBJFACTORY_HXX
+
+#include <svx/svdmodel.hxx>
+#include <svx/svdocirc.hxx>
+#include <svx/svdopath.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrObjectCreationInfo
+{
+private:
+ sal_uInt16 mnIdent; // object identifier (SdrObjKind)
+ sal_uInt32 mnInvent; // object inventor
+ SdrPathObjType maSdrPathObjType; // if OBJ_POLY defines target object type
+ SdrCircleObjType maSdrCircleObjType; // if OBJ_CIRC defines target object type
+
+ /// bitfield
+ bool mbFreehandMode : 1; // if OBJ_POLY, allow freehand creation
+
+public:
+ SdrObjectCreationInfo(
+ sal_uInt16 nIdent = OBJ_NONE,
+ sal_uInt32 nInvent = SdrInventor,
+ SdrPathObjType aSdrPathObjType = PathType_Line,
+ SdrCircleObjType aSdrCircleObjType = CircleType_Circle,
+ bool bFreehandMode = false)
+ : mnIdent(nIdent),
+ mnInvent(nInvent),
+ maSdrPathObjType(aSdrPathObjType),
+ maSdrCircleObjType(aSdrCircleObjType),
+ mbFreehandMode(bFreehandMode)
+ {
+ }
+
+ sal_uInt16 getIdent() const { return mnIdent; }
+ void setIdent(const sal_uInt16 nNew) { mnIdent = nNew; }
+
+ sal_uInt32 getInvent() const { return mnInvent; }
+ void setInvent(const sal_uInt32 nNew) { mnInvent = nNew; }
+
+ const SdrPathObjType& getSdrPathObjType() const { return maSdrPathObjType; }
+ void setSdrPathObjType(const SdrPathObjType& rNew) { maSdrPathObjType = rNew; }
+
+ const SdrCircleObjType& getSdrCircleObjType() const { return maSdrCircleObjType; }
+ void setSdrCircleObjType(const SdrCircleObjType& rNew) { maSdrCircleObjType = rNew; }
+
+ bool getFreehandMode() const { return mbFreehandMode; }
+ void setFreehandMode(const bool bNew) { mbFreehandMode = bNew; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrObjFactory
+{
+private:
+ SdrModel& mrTargetModel;
+ SdrObjectCreationInfo maSdrObjectCreationInfo;
+
+ // fuer MakeNewObj():
+ SdrObject* mpNewObj;
+
+ // fuer MakeNewObjUserData():
+ SdrObject* mpObj;
+ SdrObjUserData* mpNewData;
+
+ SVX_DLLPRIVATE SdrObjFactory(SdrModel& rTargetModel, const SdrObjectCreationInfo& rSdrObjectCreationInfo);
+ SVX_DLLPRIVATE SdrObjFactory(const SdrObjectCreationInfo& rSdrObjectCreationInfo, SdrObject& rObj1);
+
+public:
+ static SdrObject* MakeNewObject(SdrModel& rTargetModel, const SdrObjectCreationInfo& rSdrObjectCreationInfo);
+ static void InsertMakeObjectHdl(const Link& rLink);
+ static void RemoveMakeObjectHdl(const Link& rLink);
+
+ static SdrObjUserData* MakeNewObjUserData(const SdrObjectCreationInfo& rSdrObjectCreationInfo, SdrObject& rObj);
+ static void InsertMakeUserDataHdl(const Link& rLink);
+ static void RemoveMakeUserDataHdl(const Link& rLink);
+
+ SdrModel& getTargetModel() const { return mrTargetModel; }
+ const SdrObjectCreationInfo& getSdrObjectCreationInfo() const { return maSdrObjectCreationInfo; }
+ SdrObject* getSdrObjUserDataTargetSdrObject() const { return mpObj; }
+ SdrObjUserData* getNewSdrObjUserData() const { return mpNewData; }
+
+ void setNewSdrObject(SdrObject* pNew) { mpNewObj = pNew; }
+ void setNewSdrObjUserData(SdrObjUserData* pNew) { mpNewData = pNew; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SVDOBJFACTORY_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/sdrpagewindow.hxx b/svx/inc/svx/sdrpagewindow.hxx
index d4c7b59c6b58..2c1729c9f116 100644
--- a/svx/inc/svx/sdrpagewindow.hxx
+++ b/svx/inc/svx/sdrpagewindow.hxx
@@ -128,7 +128,7 @@ public:
/** sets all elements in the view which support a design and a alive mode into the given mode
*/
- void SetDesignMode( bool _bDesignMode ) const;
+ void SetDesignMode( bool _bDesignMode );
};
// typedefs for a list of SdrPageWindow
diff --git a/svx/inc/svx/sdrpaintwindow.hxx b/svx/inc/svx/sdrpaintwindow.hxx
index aff2cb7482ca..d28c7880ee6c 100644
--- a/svx/inc/svx/sdrpaintwindow.hxx
+++ b/svx/inc/svx/sdrpaintwindow.hxx
@@ -85,13 +85,7 @@ private:
// bitfield
// #i72889# flag if this is only a temporary target for repaint, default is false
- unsigned mbTemporaryTarget : 1;
-
- /** Remember whether the mpOverlayManager supports buffering. Using
- this flags expensive dynamic_casts on mpOverlayManager in order to
- detect this.
- */
- bool mbUseBuffer;
+ bool mbTemporaryTarget : 1;
// helpers
void impCreateOverlayManager();
@@ -106,7 +100,6 @@ public:
// OVERLAYMANAGER
::sdr::overlay::OverlayManager* GetOverlayManager() const;
- // #i73602# add flag if buffer shall be used
void DrawOverlay(const Region& rRegion);
void HideOverlay(const Region& rRegion);
diff --git a/svx/inc/svx/sdrselection.hxx b/svx/inc/svx/sdrselection.hxx
new file mode 100644
index 000000000000..8fc5c5e04124
--- /dev/null
+++ b/svx/inc/svx/sdrselection.hxx
@@ -0,0 +1,141 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _SDRSELECTION_HXX
+#define _SDRSELECTION_HXX
+
+#include <sal/types.h>
+#include "svx/svxdllapi.h"
+#include <svx/svdobj.hxx>
+#include <boost/utility.hpp>
+#include <svl/lstner.hxx>
+#include <tools/string.hxx>
+#include <vcl/timer.hxx>
+#include <set>
+#include <map>
+#include <vector>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Predefines
+
+class SdrView;
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////
+// selection definitions
+
+namespace sdr
+{
+ namespace selection
+ {
+ // sort by NavigationPosition
+ struct SelectionComparator
+ {
+ bool operator()(SdrObject* pA, SdrObject* pB) const;
+ };
+
+ // sort by SdrObject memory address
+ struct IndicesComparator
+ {
+ bool operator()(SdrObject* pA, SdrObject* pB) const;
+ };
+
+ // typedefs for point indices, 2way associative object-index-map and SelectionSet
+ typedef ::std::set< sal_uInt32 > Indices;
+ typedef ::std::map< SdrObject*, Indices, IndicesComparator > IndicesMap;
+ typedef ::std::set< SdrObject*, SelectionComparator > SelectionSet;
+
+ // basic selection calss with minimal interface
+ class SVX_DLLPUBLIC Selection : private boost::noncopyable, public SfxListener, public Timer
+ {
+ private:
+ // view this incarnation belongs to exclusively
+ SdrView& mrSdrView;
+
+ // the selection itself as std::set
+ SelectionSet maSet;
+
+ // evtl. selected points and/or gluepoints
+ IndicesMap maPointIndices;
+ IndicesMap maGlueIndices;
+
+ // buffered: selection in vector form
+ SdrObjectVector maVector;
+
+ // buffered: descriptions
+ String maPointDescription;
+ String maGlueDescription;
+
+ // buffered: range of selection
+ basegfx::B2DRange maSnapRange;
+
+ // local tooling
+ void delayedSelectionChanged();
+ void createIndexDescription(bool bPoints);
+ void checkPointIndexCorrection();
+ void checkGlueIndexCorrection();
+ void resetBufferedSelectionInformation() { maVector.clear(); maSnapRange.reset(); }
+ void resetBufferedPointInformation() { maPointDescription.Erase(); }
+ void resetBufferedGlueInformation() { maGlueDescription.Erase(); }
+
+ // derived from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ // derived from Timer
+ virtual void Timeout();
+
+ public:
+ /// constructor
+ Selection(SdrView& rSdrView);
+
+ /// test if selection change is pending
+ bool isSelectionChangePending() const;
+
+ /// force evtl. delayed SelectionChange to be broadcasted
+ void forceSelectionChange();
+
+ /// const accesses
+ const SdrObjectVector& getVector() const;
+ SdrObject* getSingle() const;
+ bool empty() const;
+ sal_uInt32 size() const;
+ bool isSdrObject(const SdrObject& rObject) const;
+ Indices getIndicesForSdrObject(const SdrObject& rObject, bool bPoints) const;
+ const String& getIndexDescription(bool bPoints) const;
+ bool hasIndices(bool bPoints) const;
+ const basegfx::B2DRange& getSnapRange() const;
+
+ // accesses which change the selection
+ void removeSdrObject(const SdrObject& rObject);
+ void addSdrObject(const SdrObject& rObject);
+ void clear();
+ void setSdrObjects(const SdrObjectVector& rSdrObjectVector);
+ void setIndicesForSdrObject(const SdrObject& rObject, const Indices& rNew, bool bPoints);
+ void clearIndicesForSdrObject(const SdrObject& rObject, bool bPoints);
+ };
+ } // end of namespace selection
+} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDRSELECTION_HXX
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/sdrtexthelpers.hxx b/svx/inc/svx/sdrtexthelpers.hxx
new file mode 100644
index 000000000000..7f046f397e52
--- /dev/null
+++ b/svx/inc/svx/sdrtexthelpers.hxx
@@ -0,0 +1,41 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+#ifndef _SDRTEXTHELPERS_HXX
+#define _SDRTEXTHELPERS_HXX
+
+#include <svx/svdotext.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// helpers
+
+basegfx::B2DRange getScaledCenteredTextRange(const SdrTextObj& rText);
+basegfx::B2DPolyPolygon getTextContourPolyPolygon(const SdrTextObj& rText);
+basegfx::B2DPolyPolygon getAlignedTextContourPolyPolygon(const SdrTextObj& rText);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDRTEXTHELPERS_HXX
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/sdtaaitm.hxx b/svx/inc/svx/sdtaaitm.hxx
index df69a2294e7c..df13b6683a95 100644
--- a/svx/inc/svx/sdtaaitm.hxx
+++ b/svx/inc/svx/sdtaaitm.hxx
@@ -29,13 +29,12 @@
class SVX_DLLPUBLIC SdrTextAniAmountItem: public SfxInt16Item {
public:
- TYPEINFO();
SdrTextAniAmountItem(sal_Int16 nVal=0): SfxInt16Item(SDRATTR_TEXT_ANIAMOUNT,nVal) {}
SdrTextAniAmountItem(SvStream& rIn): SfxInt16Item(SDRATTR_TEXT_ANIAMOUNT,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const;
- virtual FASTBOOL HasMetrics() const;
- virtual FASTBOOL ScaleMetrics(long nMul, long nDiv);
+ virtual bool HasMetrics() const;
+ virtual void ScaleMetrics(long nMul, long nDiv);
virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String& rText, const IntlWrapper * = 0) const;
};
diff --git a/svx/inc/svx/sdtaditm.hxx b/svx/inc/svx/sdtaditm.hxx
index 3de9f92c47d8..ccff7cd56e3c 100644
--- a/svx/inc/svx/sdtaditm.hxx
+++ b/svx/inc/svx/sdtaditm.hxx
@@ -38,7 +38,6 @@ enum SdrTextAniDirection {SDRTEXTANI_LEFT,
class SVX_DLLPUBLIC SdrTextAniDirectionItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrTextAniDirectionItem(SdrTextAniDirection eDir=SDRTEXTANI_LEFT): SfxEnumItem(SDRATTR_TEXT_ANIDIRECTION,(sal_uInt16)eDir) {}
SdrTextAniDirectionItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_ANIDIRECTION,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sdtaitm.hxx b/svx/inc/svx/sdtaitm.hxx
index d2065d0470e0..0681836bebd3 100644
--- a/svx/inc/svx/sdtaitm.hxx
+++ b/svx/inc/svx/sdtaitm.hxx
@@ -40,7 +40,6 @@ enum SdrTextVertAdjust {SDRTEXTVERTADJUST_TOP, // Kopfbuendig (so wie man e
class SVX_DLLPUBLIC SdrTextVertAdjustItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrTextVertAdjustItem(SdrTextVertAdjust eAdj=SDRTEXTVERTADJUST_TOP): SfxEnumItem(SDRATTR_TEXT_VERTADJUST,(sal_uInt16)eAdj) {}
SdrTextVertAdjustItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_VERTADJUST,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
@@ -67,7 +66,6 @@ enum SdrTextHorzAdjust {SDRTEXTHORZADJUST_LEFT, // Linksbuendig verankert
class SVX_DLLPUBLIC SdrTextHorzAdjustItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrTextHorzAdjustItem(SdrTextHorzAdjust eAdj=SDRTEXTHORZADJUST_BLOCK): SfxEnumItem(SDRATTR_TEXT_HORZADJUST,(sal_uInt16)eAdj) {}
SdrTextHorzAdjustItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_HORZADJUST,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sdtakitm.hxx b/svx/inc/svx/sdtakitm.hxx
index 710a1dd618a2..051a2403d47c 100644
--- a/svx/inc/svx/sdtakitm.hxx
+++ b/svx/inc/svx/sdtakitm.hxx
@@ -83,7 +83,6 @@ enum SdrTextAniKind {SDRTEXTANI_NONE,
class SVX_DLLPUBLIC SdrTextAniKindItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrTextAniKindItem(SdrTextAniKind eKind=SDRTEXTANI_NONE): SfxEnumItem(SDRATTR_TEXT_ANIKIND,(sal_uInt16)eKind) {}
SdrTextAniKindItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_ANIKIND,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sdtayitm.hxx b/svx/inc/svx/sdtayitm.hxx
index 269df7de2bd2..c33152afac33 100644
--- a/svx/inc/svx/sdtayitm.hxx
+++ b/svx/inc/svx/sdtayitm.hxx
@@ -29,7 +29,6 @@
class SVX_DLLPUBLIC SdrTextAniDelayItem: public SfxUInt16Item {
public:
- TYPEINFO();
SdrTextAniDelayItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANIDELAY,nVal) {}
SdrTextAniDelayItem(SvStream& rIn): SfxUInt16Item(SDRATTR_TEXT_ANIDELAY,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sdtfchim.hxx b/svx/inc/svx/sdtfchim.hxx
index 96b97f77f344..344b02ac8e72 100644
--- a/svx/inc/svx/sdtfchim.hxx
+++ b/svx/inc/svx/sdtfchim.hxx
@@ -29,7 +29,6 @@ class SVX_DLLPUBLIC SdrTextFixedCellHeightItem : public SfxBoolItem
{
public:
- TYPEINFO();
SdrTextFixedCellHeightItem( sal_Bool bUseFixedCellHeight = sal_False );
SVX_DLLPRIVATE SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion );
diff --git a/svx/inc/svx/sdtfsitm.hxx b/svx/inc/svx/sdtfsitm.hxx
index d98fa5066b1c..238a178382fb 100644
--- a/svx/inc/svx/sdtfsitm.hxx
+++ b/svx/inc/svx/sdtfsitm.hxx
@@ -46,7 +46,7 @@ enum SdrFitToSizeType {SDRTEXTFIT_NONE, // - kein FitToSize
//--------------------------------
class SVX_DLLPUBLIC SdrTextFitToSizeTypeItem: public SfxEnumItem {
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
SdrTextFitToSizeTypeItem(SdrFitToSizeType eFit=SDRTEXTFIT_NONE): SfxEnumItem(SDRATTR_TEXT_FITTOSIZE,(sal_uInt16)eFit) {}
SdrTextFitToSizeTypeItem(SvStream& rIn) : SfxEnumItem(SDRATTR_TEXT_FITTOSIZE,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sdynitm.hxx b/svx/inc/svx/sdynitm.hxx
index 6c72768254a3..628646edb919 100644
--- a/svx/inc/svx/sdynitm.hxx
+++ b/svx/inc/svx/sdynitm.hxx
@@ -34,7 +34,6 @@
//------------------------------------------------------------
class SVX_DLLPUBLIC SdrYesNoItem: public SfxBoolItem {
public:
- TYPEINFO();
SdrYesNoItem(): SfxBoolItem() {}
SdrYesNoItem(sal_uInt16 nId, sal_Bool bOn=sal_False): SfxBoolItem(nId,bOn) {}
SdrYesNoItem(sal_uInt16 nId, SvStream& rIn): SfxBoolItem(nId,rIn) {}
diff --git a/svx/inc/svx/sphere3d.hxx b/svx/inc/svx/sphere3d.hxx
index 140a60f1b8cd..f4ecbd95a4b6 100644
--- a/svx/inc/svx/sphere3d.hxx
+++ b/svx/inc/svx/sphere3d.hxx
@@ -43,30 +43,39 @@ private:
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
+
+ virtual ~E3dSphereObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
- E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize);
- E3dSphereObj();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ E3dSphereObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint aCenter = basegfx::B3DPoint(0.0, 0.0, 0.0),
+ const basegfx::B3DVector a3DSize = basegfx::B3DVector(1.0, 1.0, 1.0));
+// E3dSphereObj();
// FG: Dieser Konstruktor wird nur von MakeObject aus der 3d-Objectfactory beim
// Laden von Dokumenten mit Kugeln aufgerufen. Dieser Konstruktor ruft kein
// CreateSphere auf, er erzeugt also keine Kugel.
- E3dSphereObj(int dummy);
+// E3dSphereObj(int dummy);
// HorizontalSegments:
sal_uInt32 GetHorizontalSegments() const
- { return ((const Svx3DHorizontalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
+ { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue(); }
// VerticalSegments:
sal_uInt32 GetVerticalSegments() const
- { return ((const Svx3DVerticalSegmentsItem&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
+ { return ((const SfxUInt32Item&)GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue(); }
virtual sal_uInt16 GetObjIdentifier() const;
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
-
- virtual void operator=(const SdrObject&);
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
void ReSegment(sal_uInt32 nHorzSegments, sal_uInt32 nVertSegments);
const basegfx::B3DPoint& Center() const { return aCenter; }
diff --git a/svx/inc/svx/srchdlg.hxx b/svx/inc/svx/srchdlg.hxx
index 781c865316ea..c9fea638ebe3 100644
--- a/svx/inc/svx/srchdlg.hxx
+++ b/svx/inc/svx/srchdlg.hxx
@@ -214,9 +214,9 @@ private:
sal_Bool bSearch;
sal_Bool bFormat;
sal_uInt16 nOptions;
- FASTBOOL bSet;
- FASTBOOL bReadOnly;
- FASTBOOL bConstruct;
+ bool bSet;
+ bool bReadOnly;
+ bool bConstruct;
sal_uIntPtr nModifyFlag;
String aStylesStr;
String aLayoutStr;
diff --git a/svx/inc/svx/svdattr.hxx b/svx/inc/svx/svdattr.hxx
index fc55a400e64a..1906012004ba 100644
--- a/svx/inc/svx/svdattr.hxx
+++ b/svx/inc/svx/svdattr.hxx
@@ -29,36 +29,15 @@
#endif
#include <tools/solar.h>
#include <svx/sdangitm.hxx>
-#include <svx/sderitm.hxx>
#include <svx/sdmetitm.hxx>
#include <svx/sdooitm.hxx>
#include <svx/sdprcitm.hxx>
-#include <svx/sdshcitm.hxx>
-#include <svx/sdshitm.hxx>
-#include <svx/sdshtitm.hxx>
-#include <svx/sdsxyitm.hxx>
#include <svx/sdtaaitm.hxx>
-#ifndef _SDTACITM_HXX
-#include <svx/sdtacitm.hxx>
-#endif
-#ifndef _SDTACITM_HXX
#include <svx/sdtaditm.hxx>
-#endif
-#include <svx/sdtagitm.hxx>
-#include <svx/sdtaiitm.hxx>
#include <svx/sdtaitm.hxx>
-#ifndef _SDTAKITM_HXX
#include <svx/sdtakitm.hxx>
-#endif
#include <svx/sdtayitm.hxx>
-#ifndef SDTCFITM_HXX
-#include <svx/sdtcfitm.hxx>
-#endif
-#ifndef _SDTDITM_HXX
-#include <svx/sdtditm.hxx>
-#endif
#include <svx/sdtfsitm.hxx>
-#include <svx/sdtmfitm.hxx>
#include <svx/sdynitm.hxx>
#include <svx/sdgluitm.hxx>
#include <svx/sdginitm.hxx>
diff --git a/svx/inc/svx/svdattrx.hxx b/svx/inc/svx/svdattrx.hxx
index cd78f79bef83..8ee05c221342 100644
--- a/svx/inc/svx/svdattrx.hxx
+++ b/svx/inc/svx/svdattrx.hxx
@@ -24,58 +24,15 @@
#ifndef _SVDATTRX_HXX
#define _SVDATTRX_HXX
-#include <svx/sxmlhitm.hxx>
-#include <svx/sxallitm.hxx>
-#include <svx/sxcaitm.hxx>
#include <svx/sxcecitm.hxx>
-
-#ifndef _SXCGIITM_HXX
-#include <svx/sxcgitm.hxx>
-#endif
-#include <svx/sxciaitm.hxx>
-#include <svx/sxcikitm.hxx>
-#include <svx/sxcllitm.hxx>
#include <svx/sxctitm.hxx>
#include <svx/sxekitm.hxx>
#include <svx/sxelditm.hxx>
#include <svx/sxenditm.hxx>
-
-#ifndef _SXFIITM_HXX
#include <svx/sxfiitm.hxx>
-#endif
-
-#ifndef _SXLAYITM_HXX
-#include <svx/sxlayitm.hxx>
-#endif
-#include <svx/sxlogitm.hxx>
-#include <svx/sxmbritm.hxx>
-#include <svx/sxmfsitm.hxx>
#include <svx/sxmkitm.hxx>
-#include <svx/sxmoitm.hxx>
-#include <svx/sxmovitm.hxx>
-
-#ifndef _SXMSIITM_HXX
-#include <svx/sxmsitm.hxx>
-#endif
-#include <svx/sxmspitm.hxx>
-#include <svx/sxmsuitm.hxx>
-#include <svx/sxmtaitm.hxx>
-#include <svx/sxmtfitm.hxx>
#include <svx/sxmtpitm.hxx>
-#include <svx/sxmtritm.hxx>
#include <svx/sxmuitm.hxx>
-#include <svx/sxoneitm.hxx>
-#include <svx/sxonitm.hxx>
-#include <svx/sxopitm.hxx>
-#include <svx/sxraitm.hxx>
-#include <svx/sxreaitm.hxx>
-#include <svx/sxreoitm.hxx>
-#include <svx/sxroaitm.hxx>
-#include <svx/sxrooitm.hxx>
-#include <svx/sxsaitm.hxx>
-#include <svx/sxsalitm.hxx>
#include <svx/sxsiitm.hxx>
-#include <svx/sxsoitm.hxx>
-#include <svx/sxtraitm.hxx>
#endif //_SVDATTRX_HXX
diff --git a/svx/inc/svx/svdcrtv.hxx b/svx/inc/svx/svdcrtv.hxx
index 820060522e43..826770cb5c08 100644
--- a/svx/inc/svx/svdcrtv.hxx
+++ b/svx/inc/svx/svdcrtv.hxx
@@ -26,180 +26,147 @@
#include <svx/svddrgv.hxx>
#include "svx/svxdllapi.h"
+#include <svx/sdrobjectfactory.hxx>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
-class XLineAttrSetItem;
-class XFillAttrSetItem;
-class SdrEdgeObj;
class SdrObjConnection;
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@ @@@@ @@@@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@ @@@@@ @@@@ @@@@@@ @@ @@@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@ @@ @@ @@@@@ @@ @@ @@ @@@@@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
class ImplConnectMarkerOverlay;
class ImpSdrCreateViewExtraData;
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
class SVX_DLLPUBLIC SdrCreateView: public SdrDragView
{
- friend class SdrPageView;
-
+private:
protected:
- SdrObject* pAktCreate; // Aktuell in Erzeugung befindliches Objekt
- SdrPageView* pCreatePV; // Hier wurde die Erzeugung gestartet
+ SdrObject* mpAktCreate; // Aktuell in Erzeugung befindliches Objekt
ImplConnectMarkerOverlay* mpCoMaOverlay;
// for migrating stuff from XOR, use ImpSdrCreateViewExtraData ATM to not need to
// compile the apps all the time
ImpSdrCreateViewExtraData* mpCreateViewExtraData;
- Pointer aAktCreatePointer;
+ // necessary data for new object creation
+ SdrObjectCreationInfo maSdrObjectCreationInfo;
+ Pointer maCreatePointer;
- sal_Int32 nAutoCloseDistPix;
- sal_Int32 nFreeHandMinDistPix;
- sal_uInt32 nAktInvent; // Aktuell eingestelltes
- sal_uInt16 nAktIdent; // Obj fuer Neuerzeugung
+ sal_uInt16 mnAutoCloseDistPix;
+ sal_uInt16 mnFreeHandMinDistPix;
- unsigned bAutoTextEdit : 1; // Textedit nach dem erzeugen eines Textrahmens starten
- unsigned b1stPointAsCenter : 1;
- unsigned bUseIncompatiblePathCreateInterface : 1;
- unsigned bAutoClosePolys : 1;
+ /// bitfield
+ bool mbAutoTextEdit : 1; // Textedit nach dem erzeugen eines Textrahmens starten
+ bool mb1stPointAsCenter : 1;
+ bool mbAutoClosePolys : 1;
void ImpClearConnectMarker();
-private:
- SVX_DLLPRIVATE void ImpClearVars();
- SVX_DLLPRIVATE void ImpMakeCreateAttr();
- SVX_DLLPRIVATE void ImpDelCreateAttr();
-
-protected:
- sal_Bool ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut,
- sal_Int16 nMinMov, SdrPageView* pPV, const Rectangle& rLogRect, SdrObject* pPreparedFactoryObject);
+ bool ImpBegCreateObj(
+ const SdrObjectCreationInfo& rSdrObjectCreationInfo,
+ const basegfx::B2DPoint& rPnt,
+ double fMinMovLogic,
+ const basegfx::B2DRange& rLogRange,
+ SdrObject* pPreparedFactoryObject);
- void ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/);
- void HideCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/);
- sal_Bool CheckEdgeMode();
+ void ShowCreateObj();
+ void HideCreateObj();
+ bool CheckEdgeMode();
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrCreateView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrCreateView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrCreateView();
public:
- virtual sal_Bool IsAction() const;
- virtual void MovAction(const Point& rPnt);
+ const SdrObjectCreationInfo& getSdrObjectCreationInfo() const { return maSdrObjectCreationInfo; }
+ void setSdrObjectCreationInfo(const SdrObjectCreationInfo& rSdrObjectCreationInfo);
+
+ const Pointer& getCreatePointer() const { return maCreatePointer; }
+ void setCreatePointer(const Pointer& rNew) { maCreatePointer = rNew; }
+
+ virtual bool IsAction() const;
+ virtual void MovAction(const basegfx::B2DPoint& rPnt);
virtual void EndAction();
virtual void BckAction();
virtual void BrkAction();
- virtual void TakeActionRect(Rectangle& rRect) const;
-
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+ virtual basegfx::B2DRange TakeActionRange() const;
- void SetActiveLayer(const String& rName) { aAktLayer=rName; }
- const String& GetActiveLayer() const { return aAktLayer; }
- void SetMeasureLayer(const String& rName) { aMeasureLayer=rName; }
- const String& GetMeasureLayer() const { return aMeasureLayer; }
+ virtual bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+ void SetMeasureLayer(const String& rName) { maMeasureLayer = rName; }
+ const String& GetMeasureLayer() const { return maMeasureLayer; }
// Ist der MeasureLayer nicht gesetzt (Leerstring), so
// wird der ActiveLayer auch fuer Bemassung verwendet.
- void SetEditMode(SdrViewEditMode eMode) { SdrDragView::SetEditMode(eMode); CheckEdgeMode(); }
- void SetEditMode(sal_Bool bOn=sal_True) { SdrDragView::SetEditMode(bOn); CheckEdgeMode(); }
- void SetCreateMode(sal_Bool bOn=sal_True) { SdrDragView::SetCreateMode(bOn); CheckEdgeMode(); }
- void SetGluePointEditMode(sal_Bool bOn=sal_True) { SdrDragView::SetGluePointEditMode(bOn); CheckEdgeMode(); }
+ virtual void SetViewEditMode(SdrViewEditMode eMode) { SdrDragView::SetViewEditMode(eMode); CheckEdgeMode(); }
// Feststellen, ob Textwerkzeug aktiviert
- sal_Bool IsTextTool() const;
+ bool IsTextTool() const;
// Feststellen, ob Objektverbinderwerkzeug aktiviert
- sal_Bool IsEdgeTool() const;
+ bool IsEdgeTool() const;
// Feststellen, ob Bemassungswerkzeug aktiviert
- sal_Bool IsMeasureTool() const;
-
- void SetCurrentObj(sal_uInt16 nIdent, sal_uInt32 nInvent=SdrInventor);
- void TakeCurrentObj(sal_uInt16& nIdent, sal_uInt32& nInvent) const { nInvent=nAktInvent; nIdent=nAktIdent; }
- sal_uInt32 GetCurrentObjInventor() const { return nAktInvent; }
- sal_uInt16 GetCurrentObjIdentifier() const { return nAktIdent; }
+ bool IsMeasureTool() const;
// Starten des normalen Create
- sal_Bool BegCreateObj(const Point& rPnt, OutputDevice* pOut=NULL, short nMinMov=-3, SdrPageView* pPV=NULL);
- sal_Bool BegCreatePreparedObject(const Point& rPnt, sal_Int16 nMinMov, SdrObject* pPreparedFactoryObject);
- void MovCreateObj(const Point& rPnt);
- sal_Bool EndCreateObj(SdrCreateCmd eCmd);
+ bool BegCreateObj(const basegfx::B2DPoint& rPnt, double fMinMovLogic = 3.0);
+ bool BegCreatePreparedObject(const basegfx::B2DPoint& rPnt, double fMinMovLogic, SdrObject* pPreparedFactoryObject);
+ void MovCreateObj(const basegfx::B2DPoint& rPnt);
+ bool EndCreateObj(SdrCreateCmd eCmd);
void BckCreateObj(); // z.B. wieder 1 Polygonpunkt zurueck.
void BrkCreateObj();
- sal_Bool IsCreateObj() const { return pAktCreate!=NULL; }
- SdrObject* GetCreateObj() const { return pAktCreate; }
+ SdrObject* GetCreateObj() const { return mpAktCreate; }
// BegCreateCaptionObj() erzeugt ein SdrCaptionObj (Legendenobjekt).
// rObjSiz ist die anfaengliche Groesse des Legenden-Textrahmens.
// gedraggd wird lediglich die Laenge des Zipfel.
- sal_Bool BegCreateCaptionObj(const Point& rPnt, const Size& rObjSiz, OutputDevice* pOut=NULL, short nMinMov=-3, SdrPageView* pPV=NULL);
+ bool BegCreateCaptionObj(const basegfx::B2DPoint& rPnt, const basegfx::B2DVector& rObjSiz, double fMinMovLogic = 3.0);
// Wenn TextEditAfterCreate auf sal_True steht (das ist der Default),
// dann wird nach dem erzeugen eines Textrahmenobjekts (OBJ_TEXT,
- // OBJ_TEXTEXT, OBJ_OUTLINERTEXT, OBJ_TITLETEXT, OBJ_CAPTION)
+ // OBJ_OUTLINERTEXT, OBJ_TITLETEXT, OBJ_CAPTION)
// automatisch ein TextEdit (SdrObjEditView::SdrBeginTextEdit) gestartet.
- sal_Bool IsTextEditAfterCreate() const { return bAutoTextEdit; }
- void SetTextEditAfterCreate(sal_Bool bOn) { bAutoTextEdit = bOn; }
+ bool IsTextEditAfterCreate() const { return mbAutoTextEdit; }
+ void SetTextEditAfterCreate(bool bOn) { if(mbAutoTextEdit != bOn) mbAutoTextEdit = bOn; }
// Erzeugen eines Kreises/Rechtecks/Textrahmens wobei der 1. Punkt
// nicht die linke obere Ecke, sondern das Zentrum des Objekts vorgibt.
- // Persistentes Flag. Default=FALSE.
- sal_Bool IsCreate1stPointAsCenter() const { return b1stPointAsCenter; }
- void SetCreate1stPointAsCenter(sal_Bool bOn) { b1stPointAsCenter = bOn; }
+ // Persistentes Flag. Default=false.
+ bool IsCreate1stPointAsCenter() const { return mb1stPointAsCenter; }
+ void SetCreate1stPointAsCenter(bool bOn) { if(mb1stPointAsCenter != bOn) mb1stPointAsCenter = bOn; }
// Fuer Polylines (OBJ_PLIN) und Freihandlinien (OBJ_FREELINE). Ist dieses
// Flag sal_True, werden diese beiden Objekttypen implizit geschlossen und in
// Polygon (OBJ_POLY) bzw. Freihandflaeche (OBJ_FREEFILL) gewandelt falls
// zum Ende des Create die Distanz zwischen Startpunkt und Endpunkt des
// Objekts <=n Pixel ist, wobei SetAutoCloseDistPix vorgegeben wird.
- // Default=TRUE.
- sal_Bool IsAutoClosePolys() const { return bAutoClosePolys; }
- void SetAutoClosePolys(sal_Bool bOn) { bAutoClosePolys=bOn; }
+ // Default=true.
+ bool IsAutoClosePolys() const { return mbAutoClosePolys; }
+ void SetAutoClosePolys(bool bOn) { if(mbAutoClosePolys != bOn) mbAutoClosePolys = bOn; }
// Default=5 Pixel.
- sal_uInt16 GetAutoCloseDistPix() const { return sal_uInt16(nAutoCloseDistPix); }
- void SetAutoCloseDistPix(sal_uInt16 nVal) { nAutoCloseDistPix=nVal; }
+ sal_uInt16 GetAutoCloseDistPix() const { return mnAutoCloseDistPix; }
+ void SetAutoCloseDistPix(sal_uInt16 nVal) { if(mnAutoCloseDistPix != nVal) mnAutoCloseDistPix = nVal; }
// Vorgabe des minimalen Pixelabstands zwischen 2 Bezierpunkten bei der
// Erzeugung einer Freihandlinie.
// Default=10 Pixel.
- sal_uInt16 GetFreeHandMinDistPix() const { return sal_uInt16(nFreeHandMinDistPix); }
- void SetFreeHandMinDistPix(sal_uInt16 nVal) { nFreeHandMinDistPix=nVal; }
-
- // Wer das (zur restlichen Create-Funktionalitaet von SvDraw) inkompatible
- // Create-Interface am PathObj beibehalten moechte muss das nachfolgende
- // Flag setzen. Dieses wirkt sich aus bei den Objekttypen:
- // OBJ_POLY, OBJ_PLIN, OBJ_PATHLINE, OBJ_PATHFILL
- // Dieses Flag hat nur voruebergehenden Character. Die betroffenen
- // Applikationen sollten alsbald umgestellt werden.
- // Default=sal_False;
- sal_Bool IsUseIncompatiblePathCreateInterface() const { return bUseIncompatiblePathCreateInterface; }
- void SetUseIncompatiblePathCreateInterface(sal_Bool bOn) { bUseIncompatiblePathCreateInterface = bOn; }
- void SetConnectMarker(const SdrObjConnection& rCon, const SdrPageView& rPV);
+ sal_uInt16 GetFreeHandMinDistPix() const { return mnFreeHandMinDistPix; }
+ void SetFreeHandMinDistPix(sal_uInt16 nVal) { if(mnFreeHandMinDistPix != nVal) mnFreeHandMinDistPix = nVal; }
+
+ void SetConnectMarker(const SdrObjConnection& rCon);
void HideConnectMarker();
// Attribute des ggf. gerade in der Erzeugung befindlichen Objekts
/* new interface src537 */
- sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+ bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr=false) const;
- sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
- SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
- sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+ bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const;
+ bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
};
#endif //_SVDCRTV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svddef.hxx b/svx/inc/svx/svddef.hxx
index 89ec03ad40ce..40669338f271 100644
--- a/svx/inc/svx/svddef.hxx
+++ b/svx/inc/svx/svddef.hxx
@@ -156,14 +156,8 @@
#define SDRATTR_MEASUREDECIMALPLACES (SDRATTR_MEASURE_FIRST+20) /* 1167 */ /* Pool V4 */
#define SDRATTR_MEASURE_LAST (SDRATTR_MEASUREDECIMALPLACES) /* 1170 */ /* Pool V4 */
-#define SDRATTR_CIRC_FIRST (SDRATTR_MEASURE_LAST+ 1) /* 1172 */ /* Pool V4+ */
-#define SDRATTR_CIRCKIND (SDRATTR_CIRC_FIRST+ 0) /* 1172 */ /* Pool V4+ */
-#define SDRATTR_CIRCSTARTANGLE (SDRATTR_CIRC_FIRST+ 1) /* 1173 */ /* Pool V4+ */
-#define SDRATTR_CIRCENDANGLE (SDRATTR_CIRC_FIRST+ 2) /* 1174 */ /* Pool V4+ */
-#define SDRATTR_CIRC_LAST (SDRATTR_CIRCENDANGLE) /* 1178 */ /* Pool V4+ */
-
// Nur fuer Interfaceing, not implemented yet. /* V4+ */
-#define SDRATTR_NOTPERSIST_FIRST (SDRATTR_CIRC_LAST + 1) /* 1180 */ /* 1172 */ /* 1127 */ /* 1110 */ /* Pool V1: 1058 */
+#define SDRATTR_NOTPERSIST_FIRST (SDRATTR_MEASURE_LAST + 1) /* 1180 */ /* 1172 */ /* 1127 */ /* 1110 */ /* Pool V1: 1058 */
#define SDRATTR_OBJMOVEPROTECT (SDRATTR_NOTPERSIST_FIRST+ 0) /* 1180 sal_Bool, def=sal_False */
#define SDRATTR_OBJSIZEPROTECT (SDRATTR_NOTPERSIST_FIRST+ 1) /* 1181 sal_Bool, def=sal_False */
#define SDRATTR_OBJPRINTABLE (SDRATTR_NOTPERSIST_FIRST+ 2) /* 1182 sal_Bool, def=sal_True */
diff --git a/svx/inc/svx/svddrag.hxx b/svx/inc/svx/svddrag.hxx
index ca4b8160ea3c..b4258d549fee 100644
--- a/svx/inc/svx/svddrag.hxx
+++ b/svx/inc/svx/svddrag.hxx
@@ -24,165 +24,165 @@
#ifndef _SVDDRAG_HXX
#define _SVDDRAG_HXX
-
-#include <tools/contnr.hxx>
-#include <tools/gen.hxx>
-#include <tools/fract.hxx>
+#include <sal/types.h>
#include "svx/svxdllapi.h"
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <boost/utility.hpp>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
-// Statushalter fuer objektspeziefisches Draggen. Damit das Model
-// Statusfrei bleibt werden die Statusdaten an der View gehalten
-// und dem Objekt zu gegebener Zeit als Parameter uebergeben.
-// Ausserdem auch Statushalter fuer den Vorgang der Interaktiven
-// Objekterzeugung. pHdl ist in diesem Fall NULL.
class SdrHdl;
class SdrView;
-class SdrPageView;
+//class SdrPaintView;
+//class SdrPageView;
class SdrDragMethod;
-struct SVX_DLLPUBLIC SdrDragStatUserData
-{
-};
+////////////////////////////////////////////////////////////////////////////////////////////////////
-class SVX_DLLPUBLIC SdrDragStat {
-protected:
- SdrHdl* pHdl; // Der Handle an dem der User zottelt
- SdrView* pView;
- SdrPageView* pPageView;
- Container aPnts; // Alle bisherigen Punkte: [0]=Start, [Count()-2]=Prev
- Point aRef1; // Referenzpunkt: Resize-Fixpunkt, (Drehachse,
- Point aRef2; // Spiegelachse, ...)
- Point aPos0; // Position beim letzten Event
- Point aRealPos0; // Position beim letzten Event
- Point aRealNow; // Aktuelle Dragposition ohne Snap, Ortho und Limit
- Point aRealLast; // RealPos des letzten Punkts (fuer MinMoved)
- Rectangle aActionRect;
-
- // Reserve fuer kompatible Erweiterungen, die sonst inkompatibel wuerden.
- Point aReservePoint1;
- Point aReservePoint2;
- Point aReservePoint3;
- Point aReservePoint4;
- Rectangle aReserveRect1;
- Rectangle aReserveRect2;
- FASTBOOL bEndDragChangesAttributes;
- FASTBOOL bEndDragChangesGeoAndAttributes;
- FASTBOOL bMouseIsUp;
- FASTBOOL aReserveBool3;
- FASTBOOL aReserveBool4;
- long aReserveLong1;
- long aReserveLong2;
- long aReserveLong3;
- long aReserveLong4;
- void* aReservePtr1;
- void* aReservePtr2;
- void* aReservePtr3;
- void* aReservePtr4;
-
- FASTBOOL bShown; // Xor sichrbar?
- sal_uInt16 nMinMov; // Soviel muss erstmal minimal bewegt werden
- FASTBOOL bMinMoved; // MinMove durchbrochen?
-
- FASTBOOL bHorFixed; // nur Vertikal draggen
- FASTBOOL bVerFixed; // nur Horizontal draggen
- FASTBOOL bWantNoSnap; // sal_True=Fuer die Entscheidung ob fuer pObj->MovCreate() NoSnapPos verwendet
+struct SVX_DLLPUBLIC SdrDragStatUserData {};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrDragStat : private boost::noncopyable
+{
+private:
+ typedef ::std::vector< basegfx::B2DPoint > B2DPointVector;
+
+ SdrHdl* mpHdl; // Der Handle an dem der User zottelt
+ SdrView& mrSdrView;
+// SdrPageView* mpPageView;
+ SdrDragMethod* mpDragMethod;
+ SdrDragStatUserData* mpUser; // Userdata
+
+ B2DPointVector maPnts; // Alle bisherigen Punkte: [0]=Start, [Count()-2]=Prev
+ basegfx::B2DPoint maRef1; // Referenzpunkt: Resize-Fixpunkt, (Drehachse,
+ basegfx::B2DPoint maRef2; // Spiegelachse, ...)
+ basegfx::B2DPoint maPos0; // Position beim letzten Event
+ basegfx::B2DPoint maRealPos0; // Position beim letzten Event
+ basegfx::B2DPoint maRealNow; // Aktuelle Dragposition ohne Snap, Ortho und Limit
+ basegfx::B2DRange maActionRange;
+ double mfMinMov; // Soviel muss erstmal minimal bewegt werden
+
+ /// bitfield
+ bool mbEndDragChangesAttributes : 1;
+ bool mbEndDragChangesGeoAndAttributes : 1;
+ bool mbMouseIsUp : 1;
+ bool mbShown : 1; // Xor sichrbar?
+ bool mbMinMoved : 1; // MinMove durchbrochen?
+ bool mbHorFixed : 1; // nur Vertikal draggen
+ bool mbVerFixed : 1; // nur Horizontal draggen
+
+ // true=Fuer die Entscheidung ob fuer pObj->MovCreate() NoSnapPos verwendet
// werden soll. Entsprechend wird auch NoSnapPos in den Buffer geschrieben.
- FASTBOOL bOrtho4;
- FASTBOOL bOrtho8;
+ bool mbWantNoSnap : 1;
- SdrDragMethod* pDragMethod;
+ bool mbOrtho4 : 1;
+ bool mbOrtho8 : 1;
-protected:
- void Clear(FASTBOOL bLeaveOne);
- Point& Pnt(sal_uIntPtr nNum) { return *((Point*)aPnts.GetObject(nNum)); }
-//public:
- SdrDragStatUserData* pUser; // Userdata
public:
- SdrDragStat(): aPnts(1024,16,16) { pUser=NULL; Reset(); }
- ~SdrDragStat() { Clear(sal_False); }
+ SdrDragStat(SdrView& rSdrView);
+ ~SdrDragStat();
+
void Reset();
- SdrView* GetView() const { return pView; }
- void SetView(SdrView* pV) { pView=pV; }
- SdrPageView* GetPageView() const { return pPageView; }
- void SetPageView(SdrPageView* pPV) { pPageView=pPV; }
- const Point& GetPoint(sal_uIntPtr nNum) const { return *((Point*)aPnts.GetObject(nNum)); }
- sal_uIntPtr GetPointAnz() const { return aPnts.Count(); }
- const Point& GetStart() const { return GetPoint(0); }
- Point& Start() { return Pnt(0); }
- const Point& GetPrev() const { return GetPoint(GetPointAnz()-(GetPointAnz()>=2 ? 2:1)); }
- Point& Prev() { return Pnt(GetPointAnz()-(GetPointAnz()>=2 ? 2:1)); }
- const Point& GetPos0() const { return aPos0; }
- Point& Pos0() { return aPos0; }
- const Point& GetNow() const { return GetPoint(GetPointAnz()-1); }
- Point& Now() { return Pnt(GetPointAnz()-1); }
- const Point& GetRealNow() const { return aRealNow; }
- Point& RealNow() { return aRealNow; }
- const Point& GetRef1() const { return aRef1; }
- Point& Ref1() { return aRef1; }
- const Point& GetRef2() const { return aRef2; }
- Point& Ref2() { return aRef2; }
- const SdrHdl* GetHdl() const { return pHdl; }
- void SetHdl(SdrHdl* pH) { pHdl=pH; }
- SdrDragStatUserData* GetUser() const { return pUser; }
- void SetUser(SdrDragStatUserData* pU) { pUser=pU; }
- FASTBOOL IsShown() const { return bShown; }
- void SetShown(FASTBOOL bOn) { bShown=bOn; }
-
- FASTBOOL IsMinMoved() const { return bMinMoved; }
- void SetMinMoved() { bMinMoved=sal_True; }
- void ResetMinMoved() { bMinMoved=sal_False; }
- void SetMinMove(sal_uInt16 nDist) { nMinMov=nDist; if (nMinMov<1) nMinMov=1; }
- sal_uInt16 GetMinMove() const { return nMinMov; }
-
- FASTBOOL IsHorFixed() const { return bHorFixed; }
- void SetHorFixed(FASTBOOL bOn) { bHorFixed=bOn; }
- FASTBOOL IsVerFixed() const { return bVerFixed; }
- void SetVerFixed(FASTBOOL bOn) { bVerFixed=bOn; }
+ void Reset(const basegfx::B2DPoint& rPnt);
+
+ SdrView& GetSdrViewFromSdrDragStat() const { return mrSdrView; }
+
+// SdrPageView* GetPageView() const { return mpPageView; }
+// void SetPageView(SdrPageView* pPV) { if(mpPageView != pPV) mpPageView = pPV; }
+
+ sal_uInt32 GetPointAnz() const { return maPnts.size(); }
+ const basegfx::B2DPoint& GetPoint(sal_uInt32 nNum) const;
+
+ const basegfx::B2DPoint& GetStart() const;
+ void SetStart(const basegfx::B2DPoint& rNew);
+
+ const basegfx::B2DPoint& GetPrev() const;
+ void SetPrev(const basegfx::B2DPoint& rNew);
+
+ const basegfx::B2DPoint& GetPos0() const { return maPos0; }
+ void SetPos0(const basegfx::B2DPoint& rNew) { if(maPos0 != rNew) maPos0 = rNew; }
+
+ const basegfx::B2DPoint& GetNow() const;
+ void SetNow(const basegfx::B2DPoint& rNew);
+
+ const basegfx::B2DPoint& GetRealNow() const { return maRealNow; }
+ void SetRealNow(const basegfx::B2DPoint& rNew) { if(maRealNow != rNew) maRealNow = rNew; }
+
+ const basegfx::B2DPoint& GetRef1() const { return maRef1; }
+ void SetRef1(const basegfx::B2DPoint& rNew) { if(maRef1 != rNew) maRef1 = rNew; }
+
+ const basegfx::B2DPoint& GetRef2() const { return maRef2; }
+ void SetRef2(const basegfx::B2DPoint& rNew) { if(maRef2 != rNew) maRef2 = rNew; }
+
+ const SdrHdl* GetActiveHdl() const { return mpHdl; }
+ void SetActiveHdl(SdrHdl* pH) { if(mpHdl != pH) mpHdl = pH; }
+
+ SdrDragStatUserData* GetUser() const { return mpUser; }
+ void SetUser(SdrDragStatUserData* pU) { if(mpUser != pU) mpUser = pU; }
+
+ bool IsShown() const { return mbShown; }
+ void SetShown(bool bOn) { if(mbShown != bOn) mbShown = bOn; }
+
+ bool IsMinMoved() const { return mbMinMoved; }
+ void SetMinMoved() { mbMinMoved = true; }
+ void ResetMinMoved() { mbMinMoved = false; }
+ void SetMinMove(double fDist) { mfMinMov = std::min(fDist, 1.0); }
+ double GetMinMove() const { return mfMinMov; }
+
+ bool IsHorFixed() const { return mbHorFixed; }
+ void SetHorFixed(bool bOn) { if(mbHorFixed != bOn) mbHorFixed = bOn; }
+ bool IsVerFixed() const { return mbVerFixed; }
+ void SetVerFixed(bool bOn) { if(mbVerFixed != bOn) mbVerFixed = bOn; }
// Hier kann das Obj sagen: "Ich will keinen Koordinatenfang!"
// z.B. fuer den Winkel des Kreisbogen...
- FASTBOOL IsNoSnap() const { return bWantNoSnap; }
- void SetNoSnap(FASTBOOL bOn=sal_True) { bWantNoSnap=bOn; }
+ bool IsNoSnap() const { return mbWantNoSnap; }
+ void SetNoSnap(bool bOn = true) { if(mbWantNoSnap != bOn) mbWantNoSnap = bOn; }
- // Und hier kann das Obj sagen welches Ortho (wenn ueberhaupt eins)
- // sinnvoll auf ihm angewendet werden kann.
// Ortho4 bedeutet Ortho in 4 Richtungen (fuer Rect und Cirt)
- FASTBOOL IsOrtho4Possible() const { return bOrtho4; }
- void SetOrtho4Possible(FASTBOOL bOn=sal_True) { bOrtho4=bOn; }
+ bool IsOrtho4Possible() const { return mbOrtho4; }
+ void SetOrtho4Possible(bool bOn = true) { if(mbOrtho4 != bOn) mbOrtho4 = bOn; }
+
// Ortho8 bedeutet Ortho in 8 Richtungen (fuer Linien)
- FASTBOOL IsOrtho8Possible() const { return bOrtho8; }
- void SetOrtho8Possible(FASTBOOL bOn=sal_True) { bOrtho8=bOn; }
+ bool IsOrtho8Possible() const { return mbOrtho8; }
+ void SetOrtho8Possible(bool bOn = true) { if(mbOrtho8 != bOn) mbOrtho8 = bOn; }
// Wird vom gedraggten Objekt gesetzt
- FASTBOOL IsEndDragChangesAttributes() const { return bEndDragChangesAttributes; }
- void SetEndDragChangesAttributes(FASTBOOL bOn) { bEndDragChangesAttributes=bOn; }
- FASTBOOL IsEndDragChangesGeoAndAttributes() const { return bEndDragChangesGeoAndAttributes; }
- void SetEndDragChangesGeoAndAttributes(FASTBOOL bOn) { bEndDragChangesGeoAndAttributes=bOn; }
+ bool IsEndDragChangesAttributes() const { return mbEndDragChangesAttributes; }
+ void SetEndDragChangesAttributes(bool bOn) { if(mbEndDragChangesAttributes != bOn) mbEndDragChangesAttributes = bOn; }
+ bool IsEndDragChangesGeoAndAttributes() const { return mbEndDragChangesGeoAndAttributes; }
+ void SetEndDragChangesGeoAndAttributes(bool bOn) { if(mbEndDragChangesGeoAndAttributes != bOn) mbEndDragChangesGeoAndAttributes = bOn; }
// Wird von der View gesetzt und kann vom Obj ausgewertet werden
- FASTBOOL IsMouseDown() const { return !bMouseIsUp; }
- void SetMouseDown(FASTBOOL bDown) { bMouseIsUp=!bDown; }
+ bool IsMouseDown() const { return !mbMouseIsUp; }
+ void SetMouseDown(bool bDown) { if(mbMouseIsUp == bDown) mbMouseIsUp = !bDown; }
- Point KorregPos(const Point& rNow, const Point& rPrev) const;
- void Reset(const Point& rPnt);
- void NextMove(const Point& rPnt);
- void NextPoint(FASTBOOL bSaveReal=sal_False);
+ basegfx::B2DPoint KorregPos(const basegfx::B2DPoint & rNow, const basegfx::B2DPoint & rPrev) const;
+ void NextMove(const basegfx::B2DPoint& rPnt);
+ void NextPoint(bool bSaveReal = false);
void PrevPoint();
- FASTBOOL CheckMinMoved(const Point& rPnt);
- long GetDX() const { return GetNow().X()-GetPrev().X(); }
- long GetDY() const { return GetNow().Y()-GetPrev().Y(); }
- Fraction GetXFact() const;
- Fraction GetYFact() const;
+ bool CheckMinMoved(const basegfx::B2DPoint& rPnt);
+ double GetDX() const { return GetNow().getX() - GetPrev().getX(); }
+ double GetDY() const { return GetNow().getY() - GetPrev().getY(); }
+ double GetXFact() const;
+ double GetYFact() const;
- SdrDragMethod* GetDragMethod() const { return pDragMethod; }
- void SetDragMethod(SdrDragMethod* pMth) { pDragMethod=pMth; }
+ SdrDragMethod* GetDragMethod() const { return mpDragMethod; }
+ void SetDragMethod(SdrDragMethod* pMth) { if(mpDragMethod != pMth) mpDragMethod = pMth; }
- const Rectangle& GetActionRect() const { return aActionRect; }
- void SetActionRect(const Rectangle& rR) { aActionRect=rR; }
+ const basegfx::B2DRange& GetActionRange() const { return maActionRange; }
+ void SetActionRange(const basegfx::B2DRange& rR) { if(maActionRange != rR) maActionRange = rR; }
// Unter Beruecksichtigung von 1stPointAsCenter
- void TakeCreateRect(Rectangle& rRect) const;
+ basegfx::B2DRange TakeCreateRange() const;
};
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#endif //_SVDDRAG_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svddrgmt.hxx b/svx/inc/svx/svddrgmt.hxx
index b2beca0f4b0b..e1c4b959c37c 100644
--- a/svx/inc/svx/svddrgmt.hxx
+++ b/svx/inc/svx/svddrgmt.hxx
@@ -24,25 +24,13 @@
#ifndef _SVDDRGMT_HXX
#define _SVDDRGMT_HXX
-#include <svx/svddrgv.hxx>
+#include <svx/svdview.hxx>
#include "svx/svxdllapi.h"
#include <svx/sdr/contact/objectcontact.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@@ @@@@ @@@@ @@ @@ @@@@@ @@@@@@ @@ @@ @@@@ @@@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@@@@@ @@ @@@ @@@@@@@ @@@@ @@ @@@@@@ @@ @@ @@ @@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@ @@ @@ @@ @@@@@ @@ @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
-class SdrDragView;
class SdrDragStat;
//////////////////////////////////////////////////////////////////////////////
@@ -51,7 +39,7 @@ class SdrDragEntry
{
private:
// bitfield
- unsigned mbAddToTransparent : 1;
+ bool mbAddToTransparent : 1;
protected:
// access for derived classes
@@ -142,11 +130,11 @@ class SVX_DLLPUBLIC SdrDragMethod
private:
std::vector< SdrDragEntry* > maSdrDragEntries;
sdr::overlay::OverlayObjectList maOverlayObjectList;
- SdrDragView& mrSdrDragView;
+ SdrView& mrSdrView;
// bitfield
- unsigned mbMoveOnly : 1;
- unsigned mbSolidDraggingActive : 1;
+ bool mbMoveOnly : 1;
+ bool mbSolidDraggingActive : 1;
protected:
// access for derivated classes to maSdrDragEntries
@@ -160,9 +148,9 @@ protected:
void addToOverlayObjectList(sdr::overlay::OverlayObject& rNew) { maOverlayObjectList.append(rNew); }
basegfx::B2DRange getB2DRangeFromOverlayObjectList() const { return maOverlayObjectList.getBaseRange(); }
- // access for derivated classes to mrSdrDragView
- SdrDragView& getSdrDragView() { return mrSdrDragView; }
- const SdrDragView& getSdrDragView() const { return mrSdrDragView; }
+ // access for derivated classes to mrSdrView
+ SdrView& getSdrView() { return mrSdrView; }
+ const SdrView& getSdrView() const { return mrSdrView; }
// access for derivated classes for bools
void setMoveOnly(bool bNew) { mbMoveOnly = bNew; }
@@ -174,39 +162,36 @@ protected:
void createSdrDragEntries_PointDrag();
void createSdrDragEntries_GlueDrag();
- // old call forwarders to the SdrDragView
- void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0) const;
- SdrHdl* GetDragHdl() const { return getSdrDragView().pDragHdl; }
- SdrHdlKind GetDragHdlKind() const { return getSdrDragView().eDragHdl; }
- SdrDragStat& DragStat() { return getSdrDragView().aDragStat; }
- const SdrDragStat& DragStat() const { return getSdrDragView().aDragStat; }
- Point& Ref1() const { return mrSdrDragView.aRef1; }
- Point& Ref2() const { return mrSdrDragView.aRef2; }
- const SdrHdlList& GetHdlList() const { return getSdrDragView().aHdl; }
- void AddUndo(SdrUndoAction* pUndo) { getSdrDragView().AddUndo(pUndo); }
- bool IsDragLimit() { return getSdrDragView().bDragLimit; }
- const Rectangle& GetDragLimitRect() { return getSdrDragView().aDragLimit; }
- const SdrMarkList& GetMarkedObjectList() { return getSdrDragView().GetMarkedObjectList(); }
- Point GetSnapPos(const Point& rPt) const { return getSdrDragView().GetSnapPos(rPt,getSdrDragView().pMarkedPV); }
- sal_uInt16 SnapPos(Point& rPt) const { return getSdrDragView().SnapPos(rPt,getSdrDragView().pMarkedPV); }
- inline const Rectangle& GetMarkedRect() const;
- SdrPageView* GetDragPV() const;
+ void TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0) const;
+ SdrHdl* GetDragHdl() const { return getSdrView().GetDragHdl(); }
+ SdrHdlKind GetDragHdlKind() const { return getSdrView().GetDragHdlKind(); }
+
+ SdrDragStat& DragStat() { return getSdrView().GetDragStat(); }
+ const SdrDragStat& DragStat() const { return getSdrView().GetDragStat(); }
+
+ const basegfx::B2DPoint& GetRef1() const { return getSdrView().GetRef1(); }
+ void SetRef1(const basegfx::B2DPoint& rNew) { getSdrView().SetRef1(rNew); }
+ const basegfx::B2DPoint& GetRef2() const { return getSdrView().GetRef2(); }
+ void SetRef2(const basegfx::B2DPoint& rNew) { getSdrView().SetRef2(rNew); }
+
+ const SdrHdlList& GetHdlList() const { return getSdrView().GetHdlList(); }
+ void AddUndo(SdrUndoAction* pUndo) { getSdrView().AddUndo(pUndo); }
+ bool IsDragLimit() { return getSdrView().IsDragLimit(); }
+ const basegfx::B2DRange& GetMarkedRange() const;
+
SdrObject* GetDragObj() const;
- OutputDevice* GetDragWin() const { return getSdrDragView().pDragWin; }
- bool IsDraggingPoints() const { return getSdrDragView().IsDraggingPoints(); }
- bool IsDraggingGluePoints() const { return getSdrDragView().IsDraggingGluePoints(); }
+ bool IsDraggingPoints() const { return getSdrView().IsDraggingPoints(); }
+ bool IsDraggingGluePoints() const { return getSdrView().IsDraggingGluePoints(); }
bool DoAddConnectorOverlays();
drawinglayer::primitive2d::Primitive2DSequence AddConnectorOverlays();
public:
- TYPEINFO();
-
void resetSdrDragEntries();
basegfx::B2DRange getCurrentRange() const;
// #i58950# also moved constructor implementation to cxx
- SdrDragMethod(SdrDragView& rNewView);
+ SdrDragMethod(SdrView& rNewView);
// #i58950# virtual destructor was missing
virtual ~SdrDragMethod();
@@ -215,7 +200,7 @@ public:
void Hide();
virtual void TakeSdrDragComment(String& rStr) const=0;
virtual bool BeginSdrDrag()=0;
- virtual void MoveSdrDrag(const Point& rPnt)=0;
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt)=0;
virtual bool EndSdrDrag(bool bCopy)=0;
virtual void CancelSdrDrag();
virtual Pointer GetSdrDragPointer() const=0;
@@ -232,41 +217,34 @@ public:
bool getSolidDraggingActive() const { return mbSolidDraggingActive; }
};
-inline const Rectangle& SdrDragMethod::GetMarkedRect() const
-{
- return getSdrDragView().eDragHdl==HDL_POLY ? getSdrDragView().GetMarkedPointsRect() :
- getSdrDragView().eDragHdl==HDL_GLUE ? getSdrDragView().GetMarkedGluePointsRect() :
- getSdrDragView().GetMarkedObjRect();
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// SdrDragMove
class SVX_DLLPUBLIC SdrDragMove : public SdrDragMethod
{
private:
- long nBestXSnap;
- long nBestYSnap;
- bool bXSnapped;
- bool bYSnapped;
+ // own local snap to allow single Top-Left snap
+ basegfx::B2DVector maBestSnap;
+
+ /// bitfield
+ bool mbXSnapped : 1;
+ bool mbYSnapped : 1;
- void ImpCheckSnap(const Point& rPt);
+ void ImpCheckSnap(const basegfx::B2DPoint& rPt);
protected:
virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr::contact::ObjectContact& rObjectContact, bool bModify);
public:
- TYPEINFO();
- SdrDragMove(SdrDragView& rNewView);
+ SdrDragMove(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
virtual basegfx::B2DHomMatrix getCurrentTransformation();
- virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -275,21 +253,20 @@ public:
class SVX_DLLPUBLIC SdrDragResize : public SdrDragMethod
{
protected:
+ basegfx::B2DVector maScale;
Fraction aXFact;
Fraction aYFact;
public:
- TYPEINFO();
- SdrDragResize(SdrDragView& rNewView);
+ SdrDragResize(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
virtual basegfx::B2DHomMatrix getCurrentTransformation();
- virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -308,18 +285,16 @@ protected:
virtual void createSdrDragEntries();
public:
- TYPEINFO();
- SdrDragObjOwn(SdrDragView& rNewView);
+ SdrDragObjOwn(SdrView& rNewView);
virtual ~SdrDragObjOwn();
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
};
-
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDDRGMT_HXX
diff --git a/svx/inc/svx/svddrgv.hxx b/svx/inc/svx/svddrgv.hxx
index 1d38b4ce1f50..bd82542fea72 100644
--- a/svx/inc/svx/svddrgv.hxx
+++ b/svx/inc/svx/svddrgv.hxx
@@ -27,91 +27,59 @@
#include "svx/svxdllapi.h"
#include <svx/svdxcgv.hxx>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
class SdrUndoGeoObj;
+class ImpSdrDragViewExtraData;
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@@ @@@@ @@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@ @@ @@@@@ @@@@@@ @@ @@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@ @@ @@ @@ @@@@@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class ImpSdrDragViewExtraData;
class SVX_DLLPUBLIC SdrDragView: public SdrExchangeView
{
- friend class SdrPageView;
- friend class SdrDragMethod;
-
-protected:
- SdrHdl* pDragHdl;
- SdrDragMethod* mpCurrentSdrDragMethod;
- SdrUndoGeoObj* pInsPointUndo;
- Rectangle aDragLimit;
- XubString aInsPointUndoStr;
- SdrMarkList aFollowingEdges; // Wenn Knoten gedraggd werden, sollen alle Kanten als Xor folgen
- SdrHdlKind eDragHdl;
-
- sal_uIntPtr nDragXorPolyLimit;
- sal_uIntPtr nDragXorPointLimit;
- sal_uInt16 nRubberEdgeDraggingLimit;
- sal_uInt16 nDetailedEdgeDraggingLimit;
-
- unsigned bFramDrag : 1; // z.Zt. FrameDrag
- unsigned bDragSpecial : 1; // z.Zt. Special Obj-Dragging
- unsigned bMarkedHitMovesAlways : 1; // Persistent
- unsigned bDragLimit : 1; // Limit auf SnapRect statt BoundRect
- unsigned bDragHdl : 1; // TRUE: RefPt wird verschoben
- unsigned bDragStripes : 1; // Persistent
- unsigned bMirrRefDragObj : 1; // Persistent - Waehrend des Draggens der Spiegelachse die gespiegelten Objekte als Xor zeigen
- unsigned mbSolidDragging : 1; // allow solid create/drag of objects
- unsigned bMouseHideWhileDraggingPoints : 1;
- unsigned bResizeAtCenter : 1;
- unsigned bCrookAtCenter : 1;
- unsigned bDragWithCopy : 1;
- unsigned bInsGluePoint : 1;
- unsigned bInsObjPointMode : 1;
- unsigned bInsGluePointMode : 1;
- unsigned bNoDragXorPolys : 1;
- unsigned bAutoVertexCon : 1; // Automatische Konnektorgenerierung an den Scheitelpunkten
- unsigned bAutoCornerCon : 1; // Automatische Konnektorgenerierung an den Eckpunkten
- unsigned bRubberEdgeDragging : 1;
- unsigned bDetailedEdgeDragging : 1;
-
private:
- SVX_DLLPRIVATE void ImpClearVars();
- SVX_DLLPRIVATE void ImpMakeDragAttr();
- SVX_DLLPRIVATE void ImpDelDragAttr();
-
protected:
- virtual void SetMarkHandles();
- void ShowDragObj();
- void HideDragObj();
- sal_Bool ImpBegInsObjPoint(sal_Bool bIdxZwang, sal_uInt32 nIdx, const Point& rPnt, sal_Bool bNewObj, OutputDevice* pOut);
+ SdrHdl* mpDragHdl;
+ SdrDragMethod* mpCurrentSdrDragMethod;
+ SdrUndoGeoObj* mpInsPointUndo;
+ basegfx::B2DRange maDragLimit;
+ XubString maInsPointUndoStr;
+ SdrHdlKind meDragHdl;
+
+ /// bitfield
+ bool mbFrameDrag : 1; // z.Zt. FrameDrag
+ bool mbDragSpecial : 1; // z.Zt. Special Obj-Dragging
+ bool mbMarkedHitMovesAlways : 1; // Persistent
+ bool mbDragLimit : 1;
+ bool mbDragHdl : 1; // true: RefPt wird verschoben
+ bool mbDragStripes : 1; // Persistent
+ bool mbSolidDragging : 1; // allow solid create/drag of objects
+ bool mbResizeAtCenter : 1;
+ bool mbCrookAtCenter : 1;
+ bool mbDragWithCopy : 1;
+ bool mbInsGluePoint : 1;
+ bool mbInsObjPointMode : 1;
+ bool mbInsGluePointMode : 1;
+ bool mbNoDragXorPolys : 1;
+
+ bool ImpBegInsObjPoint(bool bIdxZwang, sal_uInt32 nIdx, const basegfx::B2DPoint& rPnt, bool bNewObj);
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrDragView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrDragView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrDragView();
public:
- virtual sal_Bool IsAction() const;
- virtual void MovAction(const Point& rPnt);
+ virtual void SetMarkHandles();
+
+ virtual bool IsAction() const;
+ virtual void MovAction(const basegfx::B2DPoint& rPnt);
virtual void EndAction();
virtual void BckAction();
virtual void BrkAction();
- virtual void TakeActionRect(Rectangle& rRect) const;
+ virtual basegfx::B2DRange TakeActionRange() const;
+
+ void ShowDragObj();
+ void HideDragObj();
// Spezialimplementation fuer den Writer:
// TakeDragObjAnchorPos() liefert die Position an der ein Objekt
@@ -120,72 +88,66 @@ public:
// In der Regel ist das die linke obere Ecke des zu erwartenden neuen
// SnapRects. Ausnahme: CaptionObj. Dort ist es die Position des
// "Schwanzendes".
- // Bei Returncode sal_False konnte ich die Position nicht bestimmen
+ // Bei Returncode false konnte ich die Position nicht bestimmen
// (z.B. Punktverschiebung, Mehrfachselektion, Schieben der
// Spiegelschse, ...)
- sal_Bool TakeDragObjAnchorPos(Point& rPos, sal_Bool bTopRight = sal_False ) const;
+ bool TakeDragObjAnchorPos(basegfx::B2DPoint& rPos, bool bTopRight = false ) const;
+
+ void SetInsertGluePoint(bool bOn) { if(mbInsGluePoint != bOn) mbInsGluePoint = bOn; }
+ bool IsInsertGluePoint() const { return mbInsGluePoint; }
// Wird pForcedMeth uebergeben, so wird pHdl, ... nicht ausgewerten, sondern diese
// Drag-Methode verwendet. Die Instanz geht dabei ins Eigentum der View ueber und
// wird zum Ende des Draggings destruiert.
- virtual sal_Bool BegDragObj(const Point& rPnt, OutputDevice* pOut=NULL, SdrHdl* pHdl=NULL, short nMinMov=-3, SdrDragMethod* pForcedMeth=NULL);
- void MovDragObj(const Point& rPnt);
- sal_Bool EndDragObj(sal_Bool bCopy=sal_False);
+ virtual bool BegDragObj(const basegfx::B2DPoint& rPnt, const SdrHdl* pHdl = 0, double fMinMovLogic = 3.0,
+ SdrDragMethod* pForcedMeth = 0);
+ void MovDragObj(const basegfx::B2DPoint& rPnt);
+ bool EndDragObj(bool bCopy = false);
void BrkDragObj();
- sal_Bool IsDragObj() const { return mpCurrentSdrDragMethod && !bInsPolyPoint && !bInsGluePoint; }
- SdrHdl* GetDragHdl() const { return pDragHdl; }
+ bool IsDragObj() const { return mpCurrentSdrDragMethod && !mbInsPolyPoint && !IsInsertGluePoint(); }
+ SdrHdl* GetDragHdl() const { return mpDragHdl; }
SdrDragMethod* GetDragMethod() const { return mpCurrentSdrDragMethod; }
- sal_Bool IsDraggingPoints() const { return eDragHdl==HDL_POLY; }
- sal_Bool IsDraggingGluePoints() const { return eDragHdl==HDL_GLUE; }
+ bool IsDraggingPoints() const { return HDL_POLY == meDragHdl; }
+ bool IsDraggingGluePoints() const { return HDL_GLUE == meDragHdl; }
+
+ SdrHdlKind GetDragHdlKind() const { return meDragHdl; }
+ bool IsDragLimit() const { return mbDragLimit; }
+ const basegfx::B2DRange& GetDragLimit() const { return maDragLimit; }
// Wer das beim BegDrag oder mittendrin schon festlegen will.
- // (Wird bei jedem BegDrag auf sal_False zurueckgesetzt, also nach
+ // (Wird bei jedem BegDrag auf false zurueckgesetzt, also nach
// BegDrag setzen.)
- void SetDragWithCopy(sal_Bool bOn) { bDragWithCopy = bOn; }
- sal_Bool IsDragWithCopy() const { return bDragWithCopy; }
-
- void SetInsertGluePoint(sal_Bool bOn) { bInsGluePoint = bOn; }
- sal_Bool IsInsertGluePoint() const { return bInsGluePoint; }
+ void SetDragWithCopy(bool bOn) { if(mbDragWithCopy != bOn) mbDragWithCopy = bOn; }
+ bool IsDragWithCopy() const { return mbDragWithCopy; }
// Interaktives einfuegen eines neuen Punktes. nIdx=0 => vor dem ersten Punkt.
- sal_Bool IsInsObjPointPossible() const;
- sal_Bool IsInsPointPossible() const { return IsInsObjPointPossible(); }
- sal_Bool BegInsObjPoint(const Point& rPnt, sal_Bool bNewObj) { return ImpBegInsObjPoint(sal_False, 0L, rPnt, bNewObj, 0L); }
- void MovInsObjPoint(const Point& rPnt) { MovDragObj(rPnt); }
- sal_Bool EndInsObjPoint(SdrCreateCmd eCmd);
+ bool IsInsObjPointPossible() const;
+ bool IsInsPointPossible() const { return IsInsObjPointPossible(); }
+ bool BegInsObjPoint(const basegfx::B2DPoint& rPnt, bool bNewObj) { return ImpBegInsObjPoint(false, 0, rPnt, bNewObj); }
+ void MovInsObjPoint(const basegfx::B2DPoint& rPnt) { MovDragObj(rPnt); }
+ bool EndInsObjPoint(SdrCreateCmd eCmd);
void BrkInsObjPoint() { BrkDragObj(); }
- sal_Bool IsInsObjPoint() const { return mpCurrentSdrDragMethod && bInsPolyPoint; }
+ bool IsInsObjPoint() const { return mpCurrentSdrDragMethod && mbInsPolyPoint; }
// Fuer die App zum Verwalten des Status. GetPreferedPointer() wird
// spaeter vielleicht einen passenden Pointer dafuer liefern
- void SetInsObjPointMode(sal_Bool bOn) { bInsObjPointMode = bOn; }
- sal_Bool IsInsObjPointMode() const { return bInsObjPointMode; }
+ void SetInsObjPointMode(bool bOn) { if(mbInsObjPointMode != bOn) mbInsObjPointMode = bOn; }
+ bool IsInsObjPointMode() const { return mbInsObjPointMode; }
- sal_Bool IsInsGluePointPossible() const;
- sal_Bool BegInsGluePoint(const Point& rPnt);
- void MovInsGluePoint(const Point& rPnt) { MovDragObj(rPnt); }
- sal_Bool EndInsGluePoint() { return EndDragObj(); }
+ bool IsInsGluePointPossible() const;
+ bool BegInsGluePoint(const basegfx::B2DPoint& rPnt);
+ void MovInsGluePoint(const basegfx::B2DPoint& rPnt) { MovDragObj(rPnt); }
+ bool EndInsGluePoint() { return EndDragObj(); }
void BrkInsGluePoint() { BrkDragObj(); }
- sal_Bool IsInsGluePoint() const { return mpCurrentSdrDragMethod && bInsGluePoint; }
// Fuer die App zum Verwalten des Status. GetPreferedPointer() wird
// spaeter vielleicht einen passenden Pointer dafuer liefern
- void SetInsGluePointMode(sal_Bool bOn) { bInsGluePointMode = bOn; }
- sal_Bool IsInsGluePointMode() const { return bInsGluePointMode; }
+ void SetInsGluePointMode(bool bOn) { if(mbInsGluePointMode != bOn) mbInsGluePointMode = bOn; }
+ bool IsInsGluePointMode() const { return mbInsGluePointMode; }
// Begrenzungslinien ueber's gesamte Win waehrend des Draggens
- // Persistent. Default=FALSE.
- void SetDragStripes(sal_Bool bOn);
- sal_Bool IsDragStripes() const { return bDragStripes; }
-
- // Handles waehrend des Draggens verstecken
- //HMHvoid SetDragHdlHide(sal_Bool bOn);
- //HMHBOOL IsDragHdlHide() const { return bNoDragHdl; }
-
- // Beim Draggen von Polygonpunkten und Klebepunkten
- // die Maus verstecken. Default=FALSE
- void SetMouseHideWhileDraggingPoints(sal_Bool bOn) { bMouseHideWhileDraggingPoints = bOn; }
- sal_Bool IsMouseHideWhileDraggingPoints() const { return bMouseHideWhileDraggingPoints; }
+ void SetDragStripes(bool bOn);
+ bool IsDragStripes() const { return mbDragStripes; }
// Beim Draggen werden i.d.R. die Konturen der markierten Objekte
// als Xor-Polygone dargestellt. Wird dieses Flag hier gesetzt,
@@ -194,114 +156,36 @@ public:
// hat diese Einstellung keine Auswirkung.
// Auch waerend des Draggens umschaltbar.
// Default=Off
- void SetNoDragXorPolys(sal_Bool bOn);
- sal_Bool IsNoDragXorPolys() const { return bNoDragXorPolys; }
-
- // Uebersteigt die Anzahl der markierten Objekte den hier eingestellten
- // Wert, wird implizit (temporaer) auf NoDragPolys geschaltet.
- // PolyPolygone etc werden entsprechend als mehrere Objekte gewertet.
- // Default=100
- void SetDragXorPolyLimit(sal_uIntPtr nObjAnz) { nDragXorPolyLimit=nObjAnz; }
- sal_uIntPtr GetDragXorPolyLimit() const { return nDragXorPolyLimit; }
-
- // Wie DragXorPolyLimit, jedoch bezogen auf die Gesamtpunktanzahl
- // aller Polygone. Default=500.
- // Auf NoDragPolys wird (temporaer) geschaltet, wenn eins der Limits
- // ueberstiegen wird.
- void SetDragXorPointLimit(sal_uIntPtr nPntAnz) { nDragXorPointLimit=nPntAnz; }
- sal_uIntPtr GetDragXorPointLimit() const { return nDragXorPointLimit; }
-
- void SetSolidDragging(bool bOn);
- bool IsSolidDragging() const;
+ void SetNoDragXorPolys(bool bOn);
+ bool IsNoDragXorPolys() const { return mbNoDragXorPolys; }
- // Dragging/Creating von Verbindern:
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Verbinder an Objektscheitelpunkte ankleben
- // Default=sal_True=Ja
- void SetAutoVertexConnectors(sal_Bool bOn) { bAutoVertexCon = bOn; }
- sal_Bool IsAutoVertexConnectors() const { return bAutoVertexCon; }
-
- // Verbinder an Objektecken ankleben
- // Default=sal_False=Nein
- void SetAutoCornerConnectors(sal_Bool bOn) { bAutoCornerCon = bOn; }
- sal_Bool IsAutoCornerConnectors() const { return bAutoCornerCon; }
-
- // Dragging von verbundenen Objekten (Nodes):
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // DetailedEdgeDraggingLimit: Wie RubberEdgeDraggingLimit, jedoch bezieht
- // sich dieses Limit auf die detalierte Darstellung, d.h. nicht nur
- // Gummibaender sondern komplette Neuberechnunen sind beim Draggen sichtbar.
- // Diese detalierte Darstellung ist eh nur beim MoveDrag moeglich.
- // Defaultwert ist 10
- void SetDetailedEdgeDragging(sal_Bool bOn); // Default an
- sal_Bool IsDetailedEdgeDragging() const { return bDetailedEdgeDragging; }
-
- void SetDetailedEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz);
- sal_uInt16 GetDetailedEdgeDraggingLimit() const { return nDetailedEdgeDraggingLimit; }
-
- // EdgeDraggingLimit: Sind mehr als nEdgeObjAnz Kanten betroffen, werden
- // diese beim interaktiven Draggen nicht mit angezeigt.
- // Gemeint sind hier die "Gummibaender", die weniger Rechenzeit benoetigen
- // als die kompletten Neuberechnungen beim DetailedEdgeDragging.
- // Defaultwert ist 100
- void SetRubberEdgeDragging(sal_Bool bOn); // Default an
- sal_Bool IsRubberEdgeDragging() const { return bRubberEdgeDragging; }
-
- void SetRubberEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz);
- sal_uInt16 GetRubberEdgeDraggingLimit() const { return nRubberEdgeDraggingLimit; }
-
- // Verbinderhandling also zu deutsch wie folgt (bei Defaulteinstellungen):
- // - Sind bis max 10 Verbinder betroffen werden diese bei jedem
- // MouseMove neu berechnet
- // - Sind zwischen 11 und 100 Verbinder betroffen werden die
- // Verbindungen beim Draggen als gerade Linien dargestellt.
- // - Bei mehr als 100 betroffenen Verbindern wird beim Draggen nichts
- // mehr gezeichnet was auf Verbinder hinweist.
+ void SetSolidDragging(bool bOn) { if(mbSolidDragging != bOn) mbSolidDragging = bOn; }
+ bool IsSolidDragging() const;
// Ist ein spezieller Dragmode eingeschaltet, wie Rotate, Mirror oder Crook,
// dann leitet ein Hit auf das markierte Objekt genau dieses Dragging ein.
- // Setzt man MarkedHitMovesAlways auf sal_True, so leitet ein Hit auf das
+ // Setzt man MarkedHitMovesAlways auf true, so leitet ein Hit auf das
// markierte Objekt immer ein Moven ein, unabhaengig vom gesetzten DragMode.
// Dieses Flag ist persistent und sollte von der App fuer den Anwender
// konfigurierbar sein!
- void SetMarkedHitMovesAlways(sal_Bool bOn) { bMarkedHitMovesAlways = bOn; }
- sal_Bool IsMarkedHitMovesAlways() const { return bMarkedHitMovesAlways; }
-
- // Beim Draggen der Spiegelachse das Spiegelbild der markierten Objekte
- // als Xor darstellen? Persistent. Noch nicht implementiert. Default TRUE.
- void SetMirrRefDragObj(sal_Bool bOn) { bMirrRefDragObj = bOn; }
- sal_Bool IsMirrRefDragObj() const { return bMirrRefDragObj; }
+ void SetMarkedHitMovesAlways(bool bOn) { if(mbMarkedHitMovesAlways != bOn) mbMarkedHitMovesAlways = bOn; }
+ bool IsMarkedHitMovesAlways() const { return mbMarkedHitMovesAlways; }
- sal_Bool IsOrthoDesired() const;
+ bool IsOrthoDesired() const;
// Beim Resize die Mitte als Referenz
- // Default=FALSE.
- sal_Bool IsResizeAtCenter() const { return bResizeAtCenter; }
- void SetResizeAtCenter(sal_Bool bOn) { bResizeAtCenter = bOn; }
+ // Default=false.
+ bool IsResizeAtCenter() const { return mbResizeAtCenter; }
+ void SetResizeAtCenter(bool bOn) { if(mbResizeAtCenter != bOn) mbResizeAtCenter = bOn; }
// Symmetrisches Crook
- // Default=FALSE.
- sal_Bool IsCrookAtCenter() const { return bCrookAtCenter; }
- void SetCrookAtCenter(sal_Bool bOn) { bCrookAtCenter = bOn; }
-
- // Begrenzung des Arbeitsbereichs. Die Begrenzung bezieht sich auf die
- // View, nicht auf die einzelnen PageViews. Von der View wird diese
- // Begrenzung nur bei Interaktionen wie Dragging und Create ausgewertet.
- // Bei von der App algorithmisch oder UI-gesteuerte Aktionen (SetGeoAttr,
- // MoveMarkedObj, ...) muss die App dieses Limit selbst beruecksichtigen.
- // Ferner ist dieses Limit als Grob-Limit zu sehen. U.U. koennen Objekte
- // (z.B. beim Drehen) nicht exakt bis an dieses Limit herangedraggt werden,
- // koennen Objekte durch Rundungsfehler doch etwas ueberstehen, ... .
- // Default=EmptyRect=keine Begrenzung.
- // erst z.T. impl.
- // (besser in die DragView?)
- void SetWorkArea(const Rectangle& rRect) { aMaxWorkArea=rRect; }
- const Rectangle& GetWorkArea() const { return aMaxWorkArea; }
-
+ // Default=false.
+ bool IsCrookAtCenter() const { return mbCrookAtCenter; }
+ void SetCrookAtCenter(bool bOn) { if(mbCrookAtCenter != bOn) mbCrookAtCenter = bOn; }
// Das DragLimit ist bezogen auf die Page des Objekts.
// (Oder auf die View??? Muss ich mal^^^^recherchieren. Joe.)
- // sal_False=Kein Limit.
+ // false=Kein Limit.
// Das Rueckgabe-Rect muss absolute Koordinaten enthalten. Der Maximale
// Dragbereich wird von der View dann so gewaehlt, dass das SnapRect des
// Objekts bis Maximal auf die Kante des LimitRects gemoved bzw. gesized
@@ -310,8 +194,10 @@ public:
// Rundungsfehler auftreten koennen, wodurch das LimitRect minnimal
// ueberschritten werden koennte...
// Implementiert fuer Move und Resize.
- virtual sal_Bool TakeDragLimit(SdrDragMode eMode, Rectangle& rRect) const;
+ virtual bool TakeDragLimit(SdrDragMode eMode, basegfx::B2DRange& rRange) const;
};
#endif //_SVDDRGV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdedtv.hxx b/svx/inc/svx/svdedtv.hxx
index 5ba95fcb25c9..67a69b960e51 100644
--- a/svx/inc/svx/svdedtv.hxx
+++ b/svx/inc/svx/svdedtv.hxx
@@ -29,29 +29,28 @@
#include <svx/svdmodel.hxx>
#include "svx/svxdllapi.h"
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
-class SfxUndoAction;
class SdrUndoAction;
class SdrUndoGroup;
class SfxStyleSheet;
class SdrLayer;
class SvdProgressInfo;
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Defines
-//************************************************************
-enum SdrHorAlign {
+enum SdrHorAlign
+{
SDRHALIGN_NONE,
SDRHALIGN_LEFT,
SDRHALIGN_RIGHT,
SDRHALIGN_CENTER
};
-enum SdrVertAlign {
+enum SdrVertAlign
+{
SDRVALIGN_NONE,
SDRVALIGN_TOP,
SDRVALIGN_BOTTOM,
@@ -64,138 +63,118 @@ enum SdrMergeMode {
SDR_MERGE_INTERSECT
};
-// Optionen fuer InsertObject()
+// Optionen fuer InsertObjectToSdrObjList()
#define SDRINSERT_DONTMARK 0x0001 /* Obj wird nicht markiert (aktuelle Markierung bleibt bestehen) */
#define SDRINSERT_ADDMARK 0x0002 /* Das Obj wird zu einer ggf. bereits bestehenden Selektion hinzumarkiert */
#define SDRINSERT_SETDEFATTR 0x0004 /* Die aktuellen Attribute (+StyleSheet) werden dem Obj zugewiesen */
#define SDRINSERT_SETDEFLAYER 0x0008 /* Der aktuelle Layer wird dem Obj zugewiesen */
-#define SDRINSERT_NOBROADCAST 0x0010 /* Einfuegen mit NbcInsertObject() fuer SolidDragging */
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrEditView: public SdrMarkView
{
- friend class SdrPageView;
- friend class SdrDragDistort;
- friend class SdrDragCrook;
+private:
+ SVX_DLLPRIVATE void ImpResetPossibilityFlags();
protected:
// Die Transformationsnachfragen, etc. etwas cachen
- unsigned bPossibilitiesDirty : 1;
- unsigned bReadOnly : 1;
- unsigned bGroupPossible : 1;
- unsigned bUnGroupPossible : 1;
- unsigned bGrpEnterPossible : 1;
- unsigned bDeletePossible : 1;
- unsigned bToTopPossible : 1;
- unsigned bToBtmPossible : 1;
- unsigned bReverseOrderPossible : 1;
- unsigned bImportMtfPossible : 1;
- unsigned bCombinePossible : 1;
- unsigned bDismantlePossible : 1;
- unsigned bCombineNoPolyPolyPossible : 1;
- unsigned bDismantleMakeLinesPossible : 1;
- unsigned bOrthoDesiredOnMarked : 1;
- unsigned bMoreThanOneNotMovable : 1; // Es ist mehr als ein Objekt nicht verschiebbar
- unsigned bOneOrMoreMovable : 1; // Wenigstens 1 Obj verschiebbar
- unsigned bMoreThanOneNoMovRot : 1; // Es ist mehr als ein Objekt nicht verschieb- und drehbar (Crook)
- unsigned bContortionPossible : 1; // Alles Polygone (ggf. gruppiert)
- unsigned bAllPolys : 1; // Alles Polygone (nicht gruppiert)
- unsigned bOneOrMorePolys : 1; // Mindestens 1 Polygon (nicht gruppiert)
- unsigned bMoveAllowed : 1;
- unsigned bResizeFreeAllowed : 1;
- unsigned bResizePropAllowed : 1;
- unsigned bRotateFreeAllowed : 1;
- unsigned bRotate90Allowed : 1;
- unsigned bMirrorFreeAllowed : 1;
- unsigned bMirror45Allowed : 1;
- unsigned bMirror90Allowed : 1;
- unsigned bShearAllowed : 1;
- unsigned bEdgeRadiusAllowed : 1;
- unsigned bTransparenceAllowed : 1;
- unsigned bGradientAllowed : 1;
- unsigned bCanConvToPath : 1;
- unsigned bCanConvToPoly : 1;
- unsigned bCanConvToContour : 1;
- unsigned bCanConvToPathLineToArea : 1;
- unsigned bCanConvToPolyLineToArea : 1;
- unsigned bMoveProtect : 1;
- unsigned bResizeProtect : 1;
- // Z-Order von virtuellen Objekten zusammenhalten (Writer)
- unsigned bBundleVirtObj : 1;
+ bool mbPossibilitiesDirty : 1;
+
+ bool mbSelectionIsReadOnly : 1;
+ bool mbGroupPossible : 1;
+ bool mbUnGroupPossible : 1;
+ bool mbGrpEnterPossible : 1;
+ bool mbDeletePossible : 1;
+ bool mbToTopPossible : 1;
+ bool mbToBtmPossible : 1;
+ bool mbReverseOrderPossible : 1;
+ bool mbImportMtfPossible : 1;
+ bool mbCombinePossible : 1;
+ bool mbDismantlePossible : 1;
+ bool mbCombineNoPolyPolyPossible : 1;
+ bool mbDismantleMakeLinesPossible : 1;
+ bool mbOrthoDesiredOnMarked : 1;
+ bool mbMoreThanOneNotMovable : 1; // Es ist mehr als ein Objekt nicht verschiebbar
+ bool mbOneOrMoreMovable : 1; // Wenigstens 1 Obj verschiebbar
+ bool mbMoreThanOneNoMovRot : 1; // Es ist mehr als ein Objekt nicht verschieb- und drehbar (Crook)
+ bool mbContortionPossible : 1; // Alles Polygone (ggf. gruppiert)
+ bool mbMoveAllowedOnSelection : 1;
+ bool mbResizeFreeAllowed : 1;
+ bool mbResizePropAllowed : 1;
+ bool mbRotateFreeAllowed : 1;
+ bool mbRotate90Allowed : 1;
+ bool mbMirrorFreeAllowed : 1;
+ bool mbMirror45Allowed : 1;
+ bool mbMirror90Allowed : 1;
+ bool mbShearAllowed : 1;
+ bool mbEdgeRadiusAllowed : 1;
+ bool mbTransparenceAllowed : 1;
+ bool mbGradientAllowed : 1;
+ bool mbCanConvToPath : 1;
+ bool mbCanConvToPoly : 1;
+ bool mbCanConvToContour : 1;
+ bool mbCanConvToPathLineToArea : 1;
+ bool mbCanConvToPolyLineToArea : 1;
+ bool mbMoveProtect : 1;
+ bool mbResizeProtect : 1;
-private:
- SVX_DLLPRIVATE void ImpClearVars();
- SVX_DLLPRIVATE void ImpResetPossibilityFlags();
+ // Z-Order von virtuellen Objekten zusammenhalten (Writer)
+ bool mbBundleVirtObj : 1;
-protected:
void ImpBroadcastEdgesOfMarkedNodes();
// Konvertierung der markierten Objekte in Poly bzw. Bezier.
- void ImpConvertTo(sal_Bool bPath, sal_Bool bLineToArea);
+ void ImpConvertTo(bool bPath, bool bLineToArea);
// Konvertiert ein Obj, wirft bei Erfolg das alte as seiner Liste und
// fuegt das neue an dessen Position ein. Inkl Undo. Es wird weder ein
// MarkEntry noch ein ModelChgBroadcast generiert.
- SdrObject* ImpConvertOneObj(SdrObject* pObj, sal_Bool bPath, sal_Bool bLineToArea);
+ SdrObject* ImpConvertOneObj(SdrObject* pObj, bool bPath, bool bLineToArea);
- // Setzen der beiden Flags bToTopPossible und bToBtmPossible.
+ // Setzen der beiden Flags mbToTopPossible und mbToBtmPossible.
// bToTopPossibleDirty und bToBtmPossibleDirty werden dabei gleichzeitig
// zurueckgesetzt.
void ImpCheckToTopBtmPossible();
- // fuer den Writer werden virtuelle Objekte buendig zusammengehalten (Z-Order)
- void ImpBundleVirtObjOfMarkList();
-
// fuer CombineMarkedObjects und DismantleMarkedObjects
void ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) const;
// fuer CombineMarkedObjects
- sal_Bool ImpCanConvertForCombine1(const SdrObject* pObj) const;
- sal_Bool ImpCanConvertForCombine(const SdrObject* pObj) const;
- basegfx::B2DPolyPolygon ImpGetPolyPolygon1(const SdrObject* pObj, sal_Bool bCombine) const;
- basegfx::B2DPolyPolygon ImpGetPolyPolygon(const SdrObject* pObj, sal_Bool bCombine) const;
+ bool ImpCanConvertForCombine1(const SdrObject* pObj) const;
+ bool ImpCanConvertForCombine(const SdrObject* pObj) const;
+ basegfx::B2DPolyPolygon ImpGetPolyPolygon1(const SdrObject* pObj, bool bCombine) const;
+ basegfx::B2DPolyPolygon ImpGetPolyPolygon(const SdrObject* pObj, bool bCombine) const;
basegfx::B2DPolygon ImpCombineToSinglePolygon(const basegfx::B2DPolyPolygon& rPolyPolygon) const;
// fuer DismantleMarkedObjects
- sal_Bool ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPpolygon, sal_Bool bMakeLines) const;
- sal_Bool ImpCanDismantle(const SdrObject* pObj, sal_Bool bMakeLines) const;
- void ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, sal_uIntPtr& rPos, SdrPageView* pPV, sal_Bool bMakeLines);
- void ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRad, SdrCrookMode eMode,
- sal_Bool bVertical, sal_Bool bNoContortion, sal_Bool bRotate, const Rectangle& rMarkRect);
- void ImpDistortObj(SdrObject* pO, const Rectangle& rRef, const XPolygon& rDistortedRect, sal_Bool bNoContortion);
- sal_Bool ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const;
+ bool ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPpolygon, bool bMakeLines) const;
+ bool ImpCanDismantle(const SdrObject* pObj, bool bMakeLines) const;
+ void ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, sal_uInt32& rPos, bool bMakeLines);
+ bool ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const;
void ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID);
// Entfernt alle Obj der MarkList aus ihren ObjLists inkl Undo.
// Die Eintraege in rMark bleiben erhalten.
- void DeleteMarkedList(const SdrMarkList& rMark); // DeleteMarked -> DeleteMarkedList
+ void deleteSdrObjectsWithUndo(const SdrObjectVector& rSdrObjectVector);
// Die Transformationsnachfragen etwas cachen
//void ImpCheckMarkTransform() const; veraltet
// Checken, was man so mit den markierten Objekten alles machen kann
virtual void CheckPossibilities();
- void ForcePossibilities() const { if (bPossibilitiesDirty || bSomeObjChgdFlag) ((SdrEditView*)this)->CheckPossibilities(); }
+ void ForcePossibilities() const;
+
+ virtual void ImpCheckPolyPossibilities();
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrEditView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrEditView();
public:
+ void ImpCrookObj(SdrObject& rO, const basegfx::B2DPoint& rRefPoint, const basegfx::B2DPoint& rRad, SdrCrookMode eMode,
+ bool bVertical, bool bNoContortion, bool bRotate, const basegfx::B2DRange& rMarkRange);
+ void ImpDistortObj(SdrObject& rO, const basegfx::B2DRange& rRefRange, const basegfx::B2DPolygon& rDistortedRect, bool bNoContortion);
+
// Jeder Aufruf einer undofaehigen Methode an der View generiert eine
// UndoAction. Moechte man mehrere
// Methodenaufrufe zu einer UndoAction zusammenfassen, so kann man diese
@@ -204,16 +183,16 @@ public:
// verwendet. NotifyNewUndoAction() wird in diesem Fall erst beim letzten
// EndUndo() gerufen. NotifyNewUndoAction() wird nicht gerufen bei einer
// leeren Klammerung.
- void BegUndo() { pMod->BegUndo(); } // Undo-Klammerung auf
- void BegUndo(const String& rComment) { pMod->BegUndo(rComment); } // Undo-Klammerung auf
- void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { pMod->BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf
- void BegUndo(SdrUndoGroup* pUndoGrp) { pMod->BegUndo(pUndoGrp); } // Undo-Klammerung auf
+ void BegUndo() { getSdrModelFromSdrView().BegUndo(); } // Undo-Klammerung auf
+ void BegUndo(const String& rComment) { getSdrModelFromSdrView().BegUndo(rComment); } // Undo-Klammerung auf
+ void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { getSdrModelFromSdrView().BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf
+ void BegUndo(SdrUndoGroup* pUndoGrp) { getSdrModelFromSdrView().BegUndo(pUndoGrp); } // Undo-Klammerung auf
void EndUndo(); // Undo-Klammerung zu (inkl BroadcastEdges)
- void AddUndo(SdrUndoAction* pUndo) { pMod->AddUndo(pUndo); } // Action hinzufuegen
+ void AddUndo(SdrUndoAction* pUndo) { getSdrModelFromSdrView().AddUndo(pUndo); } // Action hinzufuegen
// nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
- void SetUndoComment(const String& rComment) { pMod->SetUndoComment(rComment); }
- void SetUndoComment(const String& rComment, const String& rObjDescr) { pMod->SetUndoComment(rComment,rObjDescr); }
- bool IsUndoEnabled() const;
+ void SetUndoComment(const String& rComment) { getSdrModelFromSdrView().SetUndoComment(rComment); }
+ void SetUndoComment(const String& rComment, const String& rObjDescr) { getSdrModelFromSdrView().SetUndoComment(rComment,rObjDescr); }
+ bool IsUndoEnabled() const { return getSdrModelFromSdrView().IsUndoEnabled(); }
std::vector< SdrUndoAction* > CreateConnectorUndo( SdrObject& rO );
void AddUndoActions( std::vector< SdrUndoAction* >& );
@@ -222,61 +201,46 @@ public:
SdrLayer* InsertNewLayer(const String& rName, sal_uInt16 nPos=0xFFFF);
// Loeschen eines Layer inkl. aller darauf befindlichen Objekte
void DeleteLayer(const String& rName);
- // Verschieben eines Layer (Layerreihenfolge aendern)
- void MoveLayer(const String& rName, sal_uInt16 nNewPos);
// Markierte Objekte die ausserhalb ihrer Page liegen
// werden ggf. einer anderen Page zugewiesen
// z.Zt. noch ohne Undo!!!
- void ForceMarkedObjToAnotherPage();
- void ForceMarkedToAnotherPage() { ForceMarkedObjToAnotherPage(); }
+// void ForceMarkedObjToAnotherPage();
- sal_Bool IsReadOnly() const { ForcePossibilities(); return bReadOnly; }
+ bool IsReadOnly() const { ForcePossibilities(); return mbSelectionIsReadOnly; }
// Loeschen aller markierten Objekte
void DeleteMarkedObj();
- sal_Bool IsDeleteMarkedObjPossible() const { ForcePossibilities(); return bDeletePossible; }
+ bool IsDeleteMarkedObjPossible() const { ForcePossibilities(); return mbDeletePossible; }
// Logisch- umschliessendes Rect aller markierten Objekte setzen.
// Das das wirklich geschieht ist nicht garantiert, denn eine
// waagerechte Linie hat z.B. immer eine Hoehe von 0.
- void SetMarkedObjRect(const Rectangle& rRect, sal_Bool bCopy=sal_False);
- void MoveMarkedObj(const Size& rSiz, bool bCopy=false);
- void ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
- long GetMarkedObjRotate() const;
- void RotateMarkedObj(const Point& rRef, long nWink, bool bCopy=false);
- void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false);
- void MirrorMarkedObjHorizontal(sal_Bool bCopy=sal_False);
- void MirrorMarkedObjVertical(sal_Bool bCopy=sal_False);
- long GetMarkedObjShear() const;
- void ShearMarkedObj(const Point& rRef, long nWink, bool bVShear=false, bool bCopy=false);
- void CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookMode eMode, bool bVertical=false, bool bNoContortion=false, bool bCopy=false);
- void DistortMarkedObj(const Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion=false, bool bCopy=false);
+ void SetMarkedObjSnapRange(const basegfx::B2DRange& rRange, bool bCopy = false);
+ void MoveMarkedObj(const basegfx::B2DVector& rOffset, bool bCopy = false);
+ void ResizeMarkedObj(const basegfx::B2DPoint& rRefPoint, const basegfx::B2DTuple& rScale, bool bCopy = false);
+ double GetMarkedObjRotate() const;
+ void RotateMarkedObj(const basegfx::B2DPoint& rRefPoint, double fAngle, bool bCopy = false);
+ void MirrorMarkedObj(const basegfx::B2DPoint& rRefPoint1, const basegfx::B2DPoint& rRefPoint2, bool bCopy = false);
+ void MirrorMarkedObjHorizontal(bool bCopy = false);
+ void MirrorMarkedObjVertical(bool bCopy = false);
+ double GetMarkedObjShearX() const;
+ void ShearMarkedObj(const basegfx::B2DPoint& rRefPoint, double fAngle, bool bVShear = false, bool bCopy = false);
+ void CrookMarkedObj(const basegfx::B2DPoint& rRefPoint, const basegfx::B2DPoint& rRad, SdrCrookMode eMode, bool bVertical = false, bool bNoContortion = false, bool bCopy = false);
+ void DistortMarkedObj(const basegfx::B2DRange& rRefRange, const basegfx::B2DPolygon& rDistortedRect, bool bNoContortion = false, bool bCopy = false);
// Markierte Objekte kopieren und anstelle der alten markieren
void CopyMarkedObj();
- void SetAllMarkedRect(const Rectangle& rRect, sal_Bool bCopy=sal_False) { SetMarkedObjRect(rRect,bCopy); }
- void MoveAllMarked(const Size& rSiz, sal_Bool bCopy=sal_False) { MoveMarkedObj (rSiz,bCopy); }
- void ResizeAllMarked(const Point& rRef, const Fraction& xFact, const Fraction& yFact, sal_Bool bCopy=sal_False) { ResizeMarkedObj (rRef,xFact,yFact,bCopy); }
- long GetAllMarkedRotate() const { return GetMarkedObjRotate(); }
- void RotateAllMarked(const Point& rRef, long nWink, sal_Bool bCopy=sal_False) { RotateMarkedObj(rRef,nWink,bCopy); }
- void MirrorAllMarked(const Point& rRef1, const Point& rRef2, sal_Bool bCopy=sal_False) { MirrorMarkedObj(rRef1,rRef2,bCopy); }
- void MirrorAllMarkedHorizontal(sal_Bool bCopy=sal_False) { MirrorMarkedObjHorizontal(bCopy); }
- void MirrorAllMarkedVertical(sal_Bool bCopy=sal_False) { MirrorMarkedObjVertical(bCopy); }
- long GetAllMarkedShear() const { return GetMarkedObjShear(); }
- void ShearAllMarked(const Point& rRef, long nWink, sal_Bool bVShear=sal_False, sal_Bool bCopy=sal_False) { ShearMarkedObj(rRef,nWink,bVShear,bCopy); }
- void CrookAllMarked(const Point& rRef, const Point& rRad, SdrCrookMode eMode, sal_Bool bVertical=sal_False, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False) { CrookMarkedObj(rRef,rRad,eMode,bVertical,bNoContortion,bCopy); }
- void CopyMarked() { CopyMarkedObj(); }
- sal_Bool IsMoveAllowed() const { ForcePossibilities(); return bMoveAllowed && !bMoveProtect; }
- sal_Bool IsResizeAllowed(sal_Bool bProp=sal_False) const;
- sal_Bool IsRotateAllowed(sal_Bool b90Deg=sal_False) const;
- sal_Bool IsMirrorAllowed(sal_Bool b45Deg=sal_False, sal_Bool b90Deg=sal_False) const;
- sal_Bool IsTransparenceAllowed() const;
- sal_Bool IsGradientAllowed() const;
- sal_Bool IsShearAllowed() const;
- sal_Bool IsEdgeRadiusAllowed() const;
- sal_Bool IsCrookAllowed(sal_Bool bNoContortion=sal_False) const;
- sal_Bool IsDistortAllowed(sal_Bool bNoContortion=sal_False) const;
+ bool IsMoveAllowed() const { ForcePossibilities(); return mbMoveAllowedOnSelection && !mbMoveProtect; }
+ bool IsResizeAllowed(bool bProp=false) const;
+ bool IsRotateAllowed(bool b90Deg=false) const;
+ bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const;
+ bool IsTransparenceAllowed() const;
+ bool IsGradientAllowed() const;
+ bool IsShearAllowed() const;
+ bool IsEdgeRadiusAllowed() const;
+ bool IsCrookAllowed(bool bNoContortion=false) const;
+ bool IsDistortAllowed(bool bNoContortion=false) const;
// Vereinigen mehrerer Objekte zu einem PolyPolygon:
// - Rechtecke/Kreise/Text... werden implizit gewandelt.
@@ -287,8 +251,8 @@ public:
// Gruppe wandelbar sind. Beinhaltet eine Gruppe also beispielsweise
// eine Bitmap oder ein OLE-Objekt, wird die gesamte Gruppe nicht
// beruecksichtigt.
- // bNoPolyPoly=TRUE: Alles wird zu einem einzigen Polygon zusammengefasst
- void CombineMarkedObjects(sal_Bool bNoPolyPoly = sal_True);
+ // bNoPolyPoly=true: Alles wird zu einem einzigen Polygon zusammengefasst
+ void CombineMarkedObjects(bool bNoPolyPoly = true);
// for combining multiple polygons, with direct support of the modes
// SID_POLY_MERGE, SID_POLY_SUBSTRACT, SID_POLY_INTERSECT
@@ -300,20 +264,20 @@ public:
// Markierte Polypolygonobjekte in Polygone zerlegen
// Gruppenobjekte werden durchsucht und zerlegt, wenn es sich bei allen
// Memberobjekten um PathObjs handelt.
- // bMakeLines=TRUE: alle Polygone werden in einzelne Linien bzw.
+ // bMakeLines=true: alle Polygone werden in einzelne Linien bzw.
// Beziersegmente zerlegt
- void DismantleMarkedObjects(sal_Bool bMakeLines=sal_False);
- sal_Bool IsCombinePossible(sal_Bool bNoPolyPoly=sal_False) const;
- sal_Bool IsDismantlePossible(sal_Bool bMakeLines=sal_False) const;
+ void DismantleMarkedObjects(bool bMakeLines=false);
+ bool IsCombinePossible(bool bNoPolyPoly=false) const;
+ bool IsDismantlePossible(bool bMakeLines=false) const;
// Ein neues bereits fertig konstruiertes Obj einfuegen. Das Obj gehoert
// anschliessend dem Model. Nach dem Einfuegen wird das neue Objekt
// markiert (wenn dies nicht via nOptions unterbunden wird).
// U.U. wird das Obj jedoch nicht eingefuegt, sondern deleted, naemlich
// wenn der Ziel-Layer gesperrt oder nicht sichtbar ist. In diesem Fall
- // returniert die Methode mit FALSE.
+ // returniert die Methode mit false.
// Die Methode generiert u.a. auch eine Undo-Action.
- sal_Bool InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uIntPtr nOptions=0);
+ bool InsertObjectAtView(SdrObject& rObj, sal_uInt32 nOptions = 0);
// Ein Zeichenobjekt durch ein neues ersetzen. *pNewObj gehoert
// anschliessend mir, *pOldObj wandert ins Undo.
@@ -323,13 +287,13 @@ public:
// ReplaceObject(...);
// ...
// EndUndo();
- void ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, sal_Bool bMark=sal_True);
+ void ReplaceObjectAtView(SdrObject& rOldObj, SdrObject& rNewObj, bool bMark = true);
- void SetNotPersistAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
- void MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
- void MergeAttrFromMarked(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
- SfxItemSet GetAttrFromMarked(sal_Bool bOnlyHardAttr) const;
- void SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
+ void SetNotPersistAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll);
+ void MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const;
+ void MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) const;
+ SfxItemSet GetAttrFromMarked(bool bOnlyHardAttr) const;
+ void SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll);
// Geometrische Attribute (Position, Groesse, Drehwinkel)
// Bei der Position wird ein evtl. gesetzter PageOrigin beruecksichtigt.
@@ -344,14 +308,14 @@ public:
SfxStyleSheet* GetStyleSheetFromMarked() const;
// z.Zt. noch ohne Undo :(
- void SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+ void SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
/* new interface src537 */
- sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const;
+ bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const;
- sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
- SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
- sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+ bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const;
+ bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
// Alle markierten Objekte zu einer Gruppe zusammenfassen.
// Anschliessend wird die neue Gruppe markiert. Bei einer
@@ -369,25 +333,25 @@ public:
// zusaetzlich markiert.
void UnGroupMarked();
- sal_Bool IsGroupPossible() const { ForcePossibilities(); return bGroupPossible; }
- sal_Bool IsUnGroupPossible() const { ForcePossibilities(); return bUnGroupPossible; }
- sal_Bool IsGroupEnterPossible() const { ForcePossibilities(); return bGrpEnterPossible; }
+ bool IsGroupPossible() const { ForcePossibilities(); return mbGroupPossible; }
+ bool IsUnGroupPossible() const { ForcePossibilities(); return mbUnGroupPossible; }
+ bool IsGroupEnterPossible() const { ForcePossibilities(); return mbGrpEnterPossible; }
- // Markierte Objekte in Polygone/Bezierkurven verwandeln. Die sal_Bool-
- // Funktionen returnen sal_True, wenn wenigstens eins der markierten
+ // Markierte Objekte in Polygone/Bezierkurven verwandeln. Die bool-
+ // Funktionen returnen true, wenn wenigstens eins der markierten
// Objekte gewandelt werden kann. Memberobjekte von Gruppenobjekten
// werden ebenfalls gewandelt. Naehere Beschreibung siehe SdrObj.HXX.
- sal_Bool IsConvertToPathObjPossible(sal_Bool bLineToArea) const { ForcePossibilities(); return sal_Bool(bLineToArea ? bCanConvToPathLineToArea : bCanConvToPath); }
- sal_Bool IsConvertToPolyObjPossible(sal_Bool bLineToArea) const { ForcePossibilities(); return sal_Bool(bLineToArea ? bCanConvToPolyLineToArea : bCanConvToPoly); }
- sal_Bool IsConvertToContourPossible() const { ForcePossibilities(); return bCanConvToContour; }
- void ConvertMarkedToPathObj(sal_Bool bLineToArea);
- void ConvertMarkedToPolyObj(sal_Bool bLineToArea);
+ bool IsConvertToPathObjPossible(bool bLineToArea) const { ForcePossibilities(); return bool(bLineToArea ? mbCanConvToPathLineToArea : mbCanConvToPath); }
+ bool IsConvertToPolyObjPossible(bool bLineToArea) const { ForcePossibilities(); return bool(bLineToArea ? mbCanConvToPolyLineToArea : mbCanConvToPoly); }
+ bool IsConvertToContourPossible() const { ForcePossibilities(); return mbCanConvToContour; }
+ void ConvertMarkedToPathObj(bool bLineToArea);
+ void ConvertMarkedToPolyObj(bool bLineToArea);
// Alle markierten Objekte untereinander ausrichten. Normalerweise werden
- // das SnapRect der Obj verwendet. Ist bBoundRects=sal_True, werden stattdessen
+ // das SnapRect der Obj verwendet. Ist bBoundRects=true, werden stattdessen
// die BoundRects ausgerichtet.
- void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, sal_Bool bBoundRects=sal_False);
- sal_Bool IsAlignPossible() const;
+ void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, bool bBoundRects=false);
+ bool IsAlignPossible() const;
// Markierte Objekte etwas nach "oben" holen
void MovMarkedToTop();
@@ -415,12 +379,12 @@ public:
// Feststellen, ob nach vorn/hinten stellen moeglich ist
// GetMaxToTop/BtmObj() wird von diesen Methoden nur begrenzt
// beruecksichtigt, d.h. es kann vorkommen dass IsToTopPossible()
- // sal_True liefert, MovMarkedToTop() jedoch nichts aendert (z.B. bei
+ // true liefert, MovMarkedToTop() jedoch nichts aendert (z.B. bei
// Mehrfachselektion), weil eine von der abgeleiteten View ueber
// GetMaxToTopObj() auferlegte Restriktion dies verhindert.
- sal_Bool IsToTopPossible() const { ForcePossibilities(); return bToTopPossible; }
- sal_Bool IsToBtmPossible() const { ForcePossibilities(); return bToBtmPossible; }
- sal_Bool IsReverseOrderPossible() const { ForcePossibilities(); return bReverseOrderPossible; }
+ bool IsToTopPossible() const { ForcePossibilities(); return mbToTopPossible; }
+ bool IsToBtmPossible() const { ForcePossibilities(); return mbToBtmPossible; }
+ bool IsReverseOrderPossible() const { ForcePossibilities(); return mbReverseOrderPossible; }
// Ueber diese Methoden stellt die View fest, wie weit ein Objekt
// nach vorn bzw. nach hinten gestellt werden darf (Z-Order). Das
@@ -431,27 +395,28 @@ public:
// Folgende Methode wird gerufen, wenn z.B. durch ToTop, ToBtm, ... die
// Reihenfolgen der Objekte geaendert wurde. Der Aufruf erfolgt dann nach
- // jedem SdrObjList::SetObjectOrdNum(nOldPos,nNewPos);
- virtual void ObjOrderChanged(SdrObject* pObj, sal_uIntPtr nOldPos, sal_uIntPtr nNewPos);
+ // jedem SdrObjList::SetNavigationPosition(nOldPos,nNewPos);
+ virtual void ObjOrderChanged(SdrObject* pObj, sal_uInt32 nOldPos, sal_uInt32 nNewPos);
// Falls ein oder mehrere Objekte des Types SdrGrafObj oder SdrOle2Obj
// markiert sind und diese in der Lage sind ein StarView-Metafile zu
// liefern, konvertiert diese Methode das Metafile in Drawingobjekte.
// Die SdrGrafObjs/SdrOle2Objs werden dann durch die neue Objekte ersetzt.
void DoImportMarkedMtf(SvdProgressInfo *pProgrInfo=NULL);
- sal_Bool IsImportMtfPossible() const { ForcePossibilities(); return bImportMtfPossible; }
+ bool IsImportMtfPossible() const { ForcePossibilities(); return mbImportMtfPossible; }
// Wird der Modus VirtualObjectBundling eingeschaltet, werden beim
// ToTop/ToBtm virtuelle Objekte die dasselbe Objekt referenzieren
// in ihrer Z-Order buendig zusammengehalten (Writer).
- // Defaulteinstellung ist sal_False=ausgeschaltet.
- void SetVirtualObjectBundling(sal_Bool bOn) { bBundleVirtObj=bOn; }
- sal_Bool IsVirtualObjectBundling() const { return bBundleVirtObj; }
+ // Defaulteinstellung ist false=ausgeschaltet.
+ void SetVirtualObjectBundling(bool bOn) { if(mbBundleVirtObj != bOn) mbBundleVirtObj = bOn; }
+ bool IsVirtualObjectBundling() const { return mbBundleVirtObj; }
// von der SdrMarkView ueberladen fuer den internen gebrauch
- virtual void MarkListHasChanged();
- virtual void ModelHasChanged();
+ virtual void handleSelectionChange();
};
#endif //_SVDEDTV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdedxv.hxx b/svx/inc/svx/svdedxv.hxx
index 6d8203b0d325..281cba288cc7 100644
--- a/svx/inc/svx/svdedxv.hxx
+++ b/svx/inc/svx/svdedxv.hxx
@@ -27,15 +27,12 @@
#include <rtl/ref.hxx>
#include "svx/svxdllapi.h"
#include <svx/svdglev.hxx>
-
#include <svx/selectioncontroller.hxx>
-
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
-
#include <boost/shared_ptr.hpp>
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
+
class SdrOutliner;
class OutlinerView;
class EditStatus;
@@ -44,17 +41,11 @@ class ImpSdrEditPara;
struct PasteOrDropInfos;
class SdrUndoManager;
-namespace com { namespace sun { namespace star { namespace uno {
- class Any;
-} } } }
-
-namespace sdr {
- class SelectionController;
-}
+namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
+namespace sdr { class SelectionController; }
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Defines
-//************************************************************
enum SdrEndTextEditKind {SDRENDTEXTEDIT_UNCHANGED, // Textobjekt unveraendert
SDRENDTEXTEDIT_CHANGED, // Textobjekt wurde geaendert
@@ -62,54 +53,35 @@ enum SdrEndTextEditKind {SDRENDTEXTEDIT_UNCHANGED, // Textobjekt unveraendert
SDRENDTEXTEDIT_SHOULDBEDELETED}; // Fuer Writer: Textobjekt sollte geloescht werden
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@@ @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@ @@ @@@@@ @@ @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@ @@@@@ @@@@ @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
-//
-// - Allgemeines Edit fuer objektspeziefische Eigenschaften
-// - Textedit fuer alle vom SdrTextObj abgeleiteten Zeichenobjekte
-// - Macromodus
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrObjEditView: public SdrGlueEditView
{
- friend class SdrPageView;
- friend class ImpSdrEditPara;
-
protected:
// TextEdit
SdrObjectWeakRef mxTextEditObj; // Aktuell im TextEdit befindliches Obj
- SdrPageView* pTextEditPV;
- SdrOutliner* pTextEditOutliner; // Na eben der Outliner fuers TextEdit
- OutlinerView* pTextEditOutlinerView; // die aktuelle View des Outliners
- Window* pTextEditWin; // passendes Win zu pTextEditOutlinerView
- Cursor* pTextEditCursorMerker; // Zum Restaurieren des Cursors am jeweiligen Win
- ImpSdrEditPara* pEditPara; // Da hau' ich erstmal alles rein um kompatibel zu bleiben...
- SdrObject* pMacroObj;
- SdrPageView* pMacroPV;
- Window* pMacroWin;
-
- Rectangle aTextEditArea;
- Rectangle aMinTextEditArea;
- Link aOldCalcFieldValueLink; // Zum rufen des alten Handlers
- Point aMacroDownPos;
+
+ SdrOutliner* mpTextEditOutliner; // Na eben der Outliner fuers TextEdit
+ OutlinerView* mpTextEditOutlinerView; // die aktuelle View des Outliners
+ Window* mpTextEditWin; // passendes Win zu mpTextEditOutlinerView
+ Cursor* mpTextEditCursorMerker; // Zum Restaurieren des Cursors am jeweiligen Win
+
+ SdrObject* mpMacroObj;
+ Window* mpMacroWin;
+
+ basegfx::B2DRange maTextEditArea;
+ basegfx::B2DRange maMinTextEditArea;
+ Link maOldCalcFieldValueLink; // Zum rufen des alten Handlers
+ basegfx::B2DPoint maMacroDownPos;
+ sal_uInt16 mnMacroTol;
sal_uInt16 nMacroTol;
- unsigned bTextEditDontDelete : 1; // Outliner und View bei SdrEndTextEdit nicht deleten (f. Rechtschreibpruefung)
- unsigned bTextEditOnlyOneView : 1; // Nur eine OutlinerView (f. Rechtschreibpruefung)
- unsigned bTextEditNewObj : 1; // Aktuell editiertes Objekt wurde gerade neu erzeugt
- unsigned bQuickTextEditMode : 1; // persistent(->CrtV). Default=TRUE
- unsigned bMacroMode : 1; // persistent(->CrtV). Default=TRUE
- unsigned bMacroDown : 1;
+ /// bitfield
+ bool mbTextEditDontDelete : 1; // Outliner und View bei SdrEndTextEdit nicht deleten (f. Rechtschreibpruefung)
+ bool mbTextEditOnlyOneView : 1; // Nur eine OutlinerView (f. Rechtschreibpruefung)
+ bool mbTextEditNewObj : 1; // Aktuell editiertes Objekt wurde gerade neu erzeugt
+ bool mbQuickTextEditMode : 1; // persistent(->CrtV). Default=true
+ bool mbMacroDown : 1;
rtl::Reference< sdr::SelectionController > mxSelectionController;
rtl::Reference< sdr::SelectionController > mxLastSelectionController;
@@ -129,34 +101,35 @@ protected:
OutlinerView* ImpFindOutlinerView(Window* pWin) const;
// Eine neue OutlinerView auf dem Heap anlegen und alle erforderlichen Parameter setzen.
- // pTextEditObj, pTextEditPV und pTextEditOutliner muessen initiallisiert sein.
- OutlinerView* ImpMakeOutlinerView(Window* pWin, sal_Bool bNoPaint, OutlinerView* pGivenView) const;
- void ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectangle& rRect, OutputDevice& rTargetDevice) const;
+ // pTextEditObj und mpTextEditOutliner muessen initiallisiert sein.
+ OutlinerView* ImpMakeOutlinerView(Window* pWin, bool bNoPaint, OutlinerView* pGivenView) const;
+ void ImpPaintOutlinerView(OutlinerView& rOutlView, const basegfx::B2DRange& rRange, OutputDevice& rTargetDevice) const;
void ImpInvalidateOutlinerView(OutlinerView& rOutlView) const;
- // Feststellen, ob der gesamte Text markiert ist. Liefert auch sal_True wenn
+ // Feststellen, ob der gesamte Text markiert ist. Liefert auch true wenn
// kein Text vorhanden ist.
- sal_Bool ImpIsTextEditAllSelected() const;
+ bool ImpIsTextEditAllSelected() const;
void ImpMakeTextCursorAreaVisible();
// Handler fuer AutoGrowing Text bei aktivem Outliner
DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*);
DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*);
+ void ImpMacroUp(const basegfx::B2DPoint& rUpPos);
+ void ImpMacroDown(const basegfx::B2DPoint& rDownPos);
+
// link for EndTextEditHdl
DECL_LINK(EndTextEditHdl, SdrUndoManager*);
-
- void ImpMacroUp(const Point& rUpPos);
- void ImpMacroDown(const Point& rDownPos);
-
DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos* );
DECL_LINK( EndPasteOrDropHdl, PasteOrDropInfos* );
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrObjEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrObjEditView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrObjEditView();
+ virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos );
+ virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos );
+
public:
////////////////////////////////////////////////////////////////////////////////////////////////////
// used to call the old ImpPaintOutlinerView. Will be replaced when the
@@ -164,23 +137,23 @@ public:
void TextEditDrawing(SdrPaintWindow& rPaintWindow) const;
// Actionhandling fuer Macromodus
- virtual sal_Bool IsAction() const;
- virtual void MovAction(const Point& rPnt);
+ virtual bool IsAction() const;
+ virtual void MovAction(const basegfx::B2DPoint& rPnt);
virtual void EndAction();
virtual void BrkAction();
virtual void BckAction();
- virtual void TakeActionRect(Rectangle& rRect) const;
+ virtual basegfx::B2DRange TakeActionRange() const;
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- virtual void ModelHasChanged();
+ virtual void LazyReactOnObjectChanges();
//************************************************************************
// TextEdit ueber einen Outliner
//************************************************************************
// QuickTextEditMode bedeutet, dass Objekte mit Text sofort beim Anklicken
- // editiert werden sollen. Default=TRUE. Persistent.
- void SetQuickTextEditMode(sal_Bool bOn) { bQuickTextEditMode=bOn; }
- sal_Bool IsQuickTextEditMode() const { return bQuickTextEditMode; }
+ // editiert werden sollen. Default=true. Persistent.
+ void SetQuickTextEditMode(bool bOn) { if(mbQuickTextEditMode != bOn) mbQuickTextEditMode = bOn; }
+ bool IsQuickTextEditMode() const { return mbQuickTextEditMode; }
// Starten des TextEditMode. Ist pWin==NULL, wird das erste an der View
// angemeldete Win verwendet.
@@ -191,39 +164,39 @@ public:
// Ueber den Parameter pEditOutliner kann die Applikation einen eigenen
// Outliner vorgeben, der zum Editieren verwendet wird. Dieser gehoert
// nach Aufruf von SdrBeginTextEdit der SdrObjEditView und wird von dieser
- // spaeter via delete zerstoert (falls bDontDeleteOutliner=sal_False). Die
+ // spaeter via delete zerstoert (falls bDontDeleteOutliner=false). Die
// SdrObjEditView setzt dann das Modusflag (EditEngine/Outliner) an
// dieser Instanz und ausserdem auch den StatusEventHdl.
// Ebenso kann eine spezifische OutlinerView vorgegeben werden.
- virtual sal_Bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = 0L, ::Window* pWin = 0L, sal_Bool bIsNewObj = sal_False,
- SdrOutliner* pGivenOutliner = 0L, OutlinerView* pGivenOutlinerView = 0L,
- sal_Bool bDontDeleteOutliner = sal_False, sal_Bool bOnlyOneView = sal_False, sal_Bool bGrabFocus = sal_True);
+ virtual bool SdrBeginTextEdit(SdrObject* pObj, ::Window* pWin = 0, bool bIsNewObj = false,
+ SdrOutliner* pGivenOutliner = 0, OutlinerView* pGivenOutlinerView = 0,
+ bool bDontDeleteOutliner = false, bool bOnlyOneView = false, bool bGrabFocus = true);
// bDontDeleteReally ist ein Spezialparameter fuer den Writer.
// Ist dieses Flag gesetzt, dann wird ein evtl. leeres Textobjekt
// nicht geloescht. Stattdessen gibt es dann einen Returncode
// SDRENDTEXTEDIT_SHOULDBEDELETED (anstelle von SDRENDTEXTEDIT_BEDELETED)
// der besagt, dass das Objekt geloescht werden sollte.
- virtual SdrEndTextEditKind SdrEndTextEdit(sal_Bool bDontDeleteReally = sal_False);
+ virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally = false);
virtual bool IsTextEdit() const;
- // sal_True=Es wird ein Textrahmen (OBJ_TEXT,OBJ_OUTLINETEXT,...) editiert
+ // true=Es wird ein Textrahmen (OBJ_TEXT,OBJ_OUTLINETEXT,...) editiert
// ansonsten handelt es sich um ein beschriftetes Zeichenobjekt, an dem
// der Text ja bekanntlich hor. und vert. zentriert wird.
- sal_Bool IsTextEditFrame() const;
+ bool IsTextEditFrame() const;
- // Diese Methode liefert sal_True, wenn der Punkt rHit innerhalb der
+ // Diese Methode liefert true, wenn der Punkt rHit innerhalb der
// des Objektbereichs oder der OutlinerView liegt.
- sal_Bool IsTextEditHit(const Point& rHit, short nTol) const;
+ bool IsTextEditHit(const basegfx::B2DPoint& rHit, double fTol) const;
- // Diese Methode liefert sal_True, wenn der Punkt rHit innerhalb des
+ // Diese Methode liefert true, wenn der Punkt rHit innerhalb des
// Handle-dicken Rahmens liegt, der die OutlinerView bei TextFrames
// umschliesst.
- sal_Bool IsTextEditFrameHit(const Point& rHit) const;
+ bool IsTextEditFrameHit(const basegfx::B2DPoint& rHit) const;
// Bei aktiver Selektion, also zwischen MouseButtonDown und
- // MouseButtonUp liefert diese Methode immer TRUE.
- sal_Bool IsTextEditInSelectionMode() const;
+ // MouseButtonUp liefert diese Methode immer true.
+ bool IsTextEditInSelectionMode() const;
// Folgende Methode addiert einen passenden Offset zum MouseEvent
// um diesen an den Outliner weiterzureichen.
@@ -232,39 +205,36 @@ public:
// Wer das z.Zt. im TextEdit befindliche Objekt braucht:
SdrObject* GetTextEditObject() const { return mxTextEditObj.get(); }
- // info about TextEditPageView. Default is 0L.
- virtual SdrPageView* GetTextEditPageView() const;
-
// Das aktuelle Win des Outliners
- Window* GetTextEditWin() const { return pTextEditWin; }
+ Window* GetTextEditWin() const { return mpTextEditWin; }
void SetTextEditWin(Window* pWin);
// An den hier abgeholten Outliner kann man schliesslich
// Events versenden, Attribute setzen, Cut/Copy/Paste rufen,
// Undo/Redo rufen, etc.
- const SdrOutliner* GetTextEditOutliner() const { return pTextEditOutliner; }
- SdrOutliner* GetTextEditOutliner() { return pTextEditOutliner; }
- const OutlinerView* GetTextEditOutlinerView() const { return pTextEditOutlinerView; }
- OutlinerView* GetTextEditOutlinerView() { return pTextEditOutlinerView; }
-
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
- virtual sal_Bool Command(const CommandEvent& rCEvt, Window* pWin);
- sal_Bool Cut(sal_uIntPtr nFormat=SDR_ANYFORMAT);
- sal_Bool Yank(sal_uIntPtr nFormat=SDR_ANYFORMAT);
- sal_Bool Paste(Window* pWin=NULL, sal_uIntPtr nFormat=SDR_ANYFORMAT);
+ const SdrOutliner* GetTextEditOutliner() const { return mpTextEditOutliner; }
+ SdrOutliner* GetTextEditOutliner() { return mpTextEditOutliner; }
+ const OutlinerView* GetTextEditOutlinerView() const { return mpTextEditOutlinerView; }
+ OutlinerView* GetTextEditOutlinerView() { return mpTextEditOutlinerView; }
+
+ virtual bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool Command(const CommandEvent& rCEvt, Window* pWin);
+ bool Cut(sal_uInt32 nFormat=SDR_ANYFORMAT);
+ bool Yank(sal_uInt32 nFormat=SDR_ANYFORMAT);
+ bool Paste(Window* pWin=NULL, sal_uInt32 nFormat=SDR_ANYFORMAT);
// #97766# make virtual to change implementation e.g. for SdOutlineView
virtual sal_uInt16 GetScriptType() const;
/* new interface src537 */
- sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+ bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr=false) const;
- sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
- SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
- sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+ bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const;
+ bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
// Intern: Beim Splitteraufziehen neue OutlinerView...
virtual void AddWindowToPaintView(OutputDevice* pNewWin);
@@ -273,29 +243,26 @@ public:
//************************************************************************
// Object-MacroModus (z.B. Rect als Button oder sowas):
//************************************************************************
- // Persistent. Default TRUE. SvDraw wertet das Flag u.a. bei
+ // Persistent. Default true. SvDraw wertet das Flag u.a. bei
// SdrView::GetPreferedPointer() aus. Hat nur Wirkung, wenn das Dokument
- // Draw-Objekte mit Macrofunktionalitaet hat (SdrObject::HasMacro()==sal_True).
- void SetMacroMode(sal_Bool bOn) { bMacroMode=bOn; }
- sal_Bool IsMacroMode() const { return bMacroMode; }
- sal_Bool BegMacroObj(const Point& rPnt, short nTol, SdrObject* pObj, SdrPageView* pPV, Window* pWin);
- sal_Bool BegMacroObj(const Point& rPnt, SdrObject* pObj, SdrPageView* pPV, Window* pWin) { return BegMacroObj(rPnt,-2,pObj,pPV,pWin); }
- void MovMacroObj(const Point& rPnt);
+ // Draw-Objekte mit Macrofunktionalitaet hat (SdrObject::HasMacro()==true).
+ bool BegMacroObj(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, Window* pWin);
+ void MovMacroObj(const basegfx::B2DPoint& rPnt);
void BrkMacroObj();
- sal_Bool EndMacroObj();
- sal_Bool IsMacroObj() const { return pMacroObj!=NULL; }
- sal_Bool IsMacroObjDown() const { return bMacroDown; }
+ bool EndMacroObj();
+ bool IsMacroObj() const { return (0 != mpMacroObj); }
+ bool IsMacroObjDown() const { return mbMacroDown; }
/** fills the given any with a XTextCursor for the current text selection.
Leaves the any untouched if there currently is no text selected */
void getTextSelection( ::com::sun::star::uno::Any& rSelection );
- virtual void MarkListHasChanged();
+ virtual void handleSelectionChange();
rtl::Reference< sdr::SelectionController > getSelectionController() const { return mxSelectionController; }
- /** returns true if the shape identified by its inventor and identifier supports format paint brush operation */
- virtual bool SupportsFormatPaintbrush( sal_uInt32 nObjectInventor, sal_uInt16 nObjectIdentifier ) const;
+ /** returns true if the shape supports format paint brush operation */
+ virtual bool SupportsFormatPaintbrush(const SdrObject& rSdrObject) const;
/** returns a format paint brush set from the current selection */
virtual bool TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFormatSet );
@@ -308,12 +275,9 @@ public:
/** helper function for selections with multiple SdrText for one SdrTextObj (f.e. tables ) */
void ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTextObj& rTextObj, SdrText* pText, bool bNoCharacterFormats, bool bNoParagraphFormats );
-
-protected:
- virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos );
- virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfos );
-
};
#endif //_SVDEDXV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdetc.hxx b/svx/inc/svx/svdetc.hxx
index 8e58a639377e..4e3d23877ad9 100644
--- a/svx/inc/svx/svdetc.hxx
+++ b/svx/inc/svx/svdetc.hxx
@@ -121,7 +121,7 @@ public:
class SfxItemSet;
// Liefert eine Ersatzdarstellung fuer einen XFillStyle
// Bei XFILL_NONE gibt's sal_False und rCol bleibt unveraendert.
-SVX_DLLPUBLIC FASTBOOL GetDraftFillColor(const SfxItemSet& rSet, Color& rCol);
+SVX_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol);
// Ein Container fuer USHORTs (im Prinzip ein dynamisches Array)
class UShortCont {
@@ -159,7 +159,7 @@ private: // damit keiner vergessen wird
virtual
void
Is1stLessThan2nd(const void* pElem1, const void* pElem2) const;
-// virtual FASTBOOL Is1stLessThan2nd(const void* pElem1, const void* pElem2) const=NULL;
+// virtual bool Is1stLessThan2nd(const void* pElem1, const void* pElem2) const=NULL;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -182,10 +182,10 @@ class ImpSdrHdcMerk
Color* pLineColorMerk;
sal_uInt16 nMode;
public:
- ImpSdrHdcMerk(const OutputDevice& rOut, sal_uInt16 nNewMode=SDRHDC_SAVEALL, FASTBOOL bAutoMerk=sal_True);
+ ImpSdrHdcMerk(const OutputDevice& rOut, sal_uInt16 nNewMode=SDRHDC_SAVEALL, bool bAutoMerk=sal_True);
~ImpSdrHdcMerk();
void Save(const OutputDevice& rOut);
- FASTBOOL IsSaved() const { return pFarbMerk!=NULL || pClipMerk!=NULL || pLineColorMerk!=NULL; }
+ bool IsSaved() const { return pFarbMerk!=NULL || pClipMerk!=NULL || pLineColorMerk!=NULL; }
void Restore(OutputDevice& rOut, sal_uInt16 nMask=SDRHDC_SAVEALL) const;
};
//#endif // __PRIVATE
@@ -193,8 +193,8 @@ public:
////////////////////////////////////////////////////////////////////////////////////////////////////
// Ein ItemSet auf Outliner- bzw. EditEngine-Items durchsuchen
-// Liefert sal_True, wenn der Set solchen Items enthaelt.
-sal_Bool SearchOutlinerItems(const SfxItemSet& rSet, sal_Bool bInklDefaults, sal_Bool* pbOnlyEE=NULL);
+// Liefert TRUE, wenn der Set solchen Items enthaelt.
+bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE = 0);
// zurueck erhaelt man einen neuen WhichTable den
// man dann irgendwann mit delete platthauen muss.
@@ -271,7 +271,7 @@ public:
const Link& GetLink(unsigned nNum) const { return *((Link*)(aList.GetObject(nNum))); }
void InsertLink(const Link& rLink, unsigned nPos=0xFFFF);
void RemoveLink(const Link& rLink);
- FASTBOOL HasLink(const Link& rLink) const { return FindEntry(rLink)!=0xFFFF; }
+ bool HasLink(const Link& rLink) const { return FindEntry(rLink)!=0xFFFF; }
};
// Fuer die Factory in SvdObj.CXX
diff --git a/svx/inc/svx/svdglev.hxx b/svx/inc/svx/svdglev.hxx
index 35022fc60016..1abdd95bb737 100644
--- a/svx/inc/svx/svdglev.hxx
+++ b/svx/inc/svx/svdglev.hxx
@@ -27,42 +27,26 @@
#include "svx/svxdllapi.h"
#include <svx/svdpoev.hxx>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
class SdrGluePoint;
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@ @@ @@ @@@@@ @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@ @@@ @@ @@ @@ @@@@ @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
-//
-// Editieren von Klebepunkten an den Objekten (Klebepunkte fuer Verbinder)
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrGlueEditView: public SdrPolyEditView
{
- void ImpClearVars();
-
+private:
// Markierte Klebepunkte kopieren und anstelle der alten markieren
void ImpCopyMarkedGluePoints();
typedef void (*PGlueDoFunc)(SdrGluePoint&, const SdrObject* pObj, const void*, const void*, const void*, const void*, const void*);
- typedef void (*PGlueTrFunc)(Point&, const void*, const void*, const void*, const void*, const void*);
- void ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, sal_Bool bConst, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
- void ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
+ typedef void (*PGlueTrFunc)(basegfx::B2DPoint&, const void*, const void*, const void*, const void*, const void*);
+ void ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, const void* p1 = 0, const void* p2 = 0, const void* p3 = 0, const void* p4 = 0, const void* p5 = 0);
+ void ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1 = 0, const void* p2 = 0, const void* p3 = 0, const void* p4 = 0, const void* p5 = 0);
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrGlueEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrGlueEditView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrGlueEditView();
public:
@@ -71,45 +55,38 @@ public:
// Moegliche Werte fuer nThisEsc sind z.Zt.
// SDRESC_LEFT, SDRESC_RIGHT, SDRESC_TOP und SDRESC_BOTTOM
TRISTATE IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const;
- void SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, sal_Bool bOn);
- sal_Bool IsSetMarkedGluePointsEscDirPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
+ void SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, bool bOn);
+ bool IsSetMarkedGluePointsEscDirPossible() const { return !IsReadOnly() && areGluesSelected(); }
// Checken/setzen, ob die Klebepunktpositionen relativ zur
- // Objektgroesse sind (Percent=sal_True) oder nicht (Percent=sal_False)
+ // Objektgroesse sind (Percent=true) oder nicht (Percent=false)
TRISTATE IsMarkedGluePointsPercent() const;
- void SetMarkedGluePointsPercent(sal_Bool bOn);
- sal_Bool IsSetMarkedGluePointsPercentPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
+ void SetMarkedGluePointsPercent(bool bOn);
+ bool IsSetMarkedGluePointsPercentPossible() const { return !IsReadOnly() && areGluesSelected(); }
- // bVert=FALSE: Horizontales Alignment checken/setzen
+ // bVert=false: Horizontales Alignment checken/setzen
// SDRHORZALIGN_CENTER
// SDRHORZALIGN_LEFT
// SDRHORZALIGN_RIGHT
// SDRHORZALIGN_DONTCARE (nur bei Get())
- // bVert=TRUE: Vertikales Alignment checken/setzen
+ // bVert=true: Vertikales Alignment checken/setzen
// SDRVERTALIGN_CENTER
// SDRVERTALIGN_TOP
// SDRVERTALIGN_BOTTOM
// SDRVERTALIGN_DONTCARE (nur bei Get())
- sal_uInt16 GetMarkedGluePointsAlign(sal_Bool bVert) const;
- void SetMarkedGluePointsAlign(sal_Bool bVert, sal_uInt16 nAlign);
- sal_Bool IsSetMarkedGluePointsAlignPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
+ sal_uInt16 GetMarkedGluePointsAlign(bool bVert) const;
+ void SetMarkedGluePointsAlign(bool bVert, sal_uInt16 nAlign);
+ bool IsSetMarkedGluePointsAlignPossible() const { return !IsReadOnly() && areGluesSelected(); }
// Alle merkierten Klebepunkte entfernen
void DeleteMarkedGluePoints();
- sal_Bool IsDeleteMarkedGluePointsPossible() const;
-
- void MoveMarkedGluePoints (const Size& rSiz, bool bCopy=false);
- void ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
- void RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy=false);
- void MirrorMarkedGluePoints(const Point& rRef1, const Point& rRef2, sal_Bool bCopy=sal_False);
- void MirrorMarkedGluePointsHorizontal(sal_Bool bCopy=sal_False);
- void MirrorMarkedGluePointsVertical(sal_Bool bCopy=sal_False);
- void ShearMarkedGluePoints(const Point& rRef, long nWink, sal_Bool bVShear=sal_False, sal_Bool bCopy=sal_False);
- void CrookMarkedGluePoints(const Point& rRef, const Point& rRad, SdrCrookMode eMode, sal_Bool bVertical=sal_False, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False);
- void DistortMarkedGluePoints(const Rectangle& rRef, const XPolygon& rDistortedRect, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False);
-
- void AlignMarkedGluePoints(SdrHorAlign eHor, SdrVertAlign eVert);
+
+ void MoveMarkedGluePoints(const basegfx::B2DVector& rDelta, bool bCopy = false);
+ void ResizeMarkedGluePoints(const basegfx::B2DPoint& rRef, const basegfx::B2DVector& rScale, bool bCopy = false);
+ void RotateMarkedGluePoints(const basegfx::B2DPoint& rRef, double fAngle, bool bCopy = false);
};
#endif //_SVDGLEV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdglue.hxx b/svx/inc/svx/svdglue.hxx
index 6936cb5c281e..1d70f56c6e8e 100644
--- a/svx/inc/svx/svdglue.hxx
+++ b/svx/inc/svx/svdglue.hxx
@@ -24,14 +24,11 @@
#ifndef _SVDGLUE_HXX
#define _SVDGLUE_HXX
-class Window;
-class OutputDevice;
-class SvStream;
-class SdrObject;
-
#include <tools/contnr.hxx>
#include <tools/gen.hxx>
#include "svx/svxdllapi.h"
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -57,91 +54,117 @@ class SdrObject;
#define SDRVERTALIGN_BOTTOM 0x0200
#define SDRVERTALIGN_DONTCARE 0x1000
-class SVX_DLLPUBLIC SdrGluePoint {
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define SDRGLUEPOINT_NOTFOUND 0xffffffff
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrGluePoint
+{
+private:
// Bezugspunkt ist SdrObject::GetSnapRect().Center()
- // bNoPercent=FALSE: Position ist -5000..5000 (1/100)% bzw. 0..10000 (je nach Align)
- // bNoPercent=sal_True : Position ist in log Einh, rel zum Bezugspunkt
- Point aPos;
- sal_uInt16 nEscDir;
- sal_uInt16 nId;
- sal_uInt16 nAlign;
- FASTBOOL bNoPercent:1;
- FASTBOOL bReallyAbsolute:1; // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
- FASTBOOL bUserDefined:1; // #i38892#
+ // bNoPercent=false: Position ist -5000..5000 (1/100)% bzw. 0..10000 (je nach Align)
+ // bNoPercent=true : Position ist in log Einh, rel zum Bezugspunkt
+ basegfx::B2DPoint maPos;
+ sal_uInt16 mnEscDir;
+ sal_uInt32 mnId;
+ sal_uInt16 mnAlign;
+
+ /// bitfield
+ bool mbNoPercent : 1;
+ bool mbReallyAbsolute : 1; // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
+ bool mbUserDefined : 1; // #i38892#
+
public:
- SdrGluePoint(): nEscDir(SDRESC_SMART),nId(0),nAlign(0) { bNoPercent=sal_False; bReallyAbsolute=sal_False; bUserDefined=sal_True; }
- SdrGluePoint(const Point& rNewPos, FASTBOOL bNewPercent=sal_True, sal_uInt16 nNewAlign=0): aPos(rNewPos),nEscDir(SDRESC_SMART),nId(0),nAlign(nNewAlign) { bNoPercent=!bNewPercent; bReallyAbsolute=sal_False; bUserDefined=sal_True; }
- bool operator==(const SdrGluePoint& rCmpGP) const { return aPos==rCmpGP.aPos && nEscDir==rCmpGP.nEscDir && nId==rCmpGP.nId && nAlign==rCmpGP.nAlign && bNoPercent==rCmpGP.bNoPercent && bReallyAbsolute==rCmpGP.bReallyAbsolute && bUserDefined==rCmpGP.bUserDefined; }
+ SdrGluePoint();
+ SdrGluePoint(const basegfx::B2DPoint& rNewPos, bool bNewPercent = true, sal_uInt16 nNewAlign = 0);
+
+ bool operator==(const SdrGluePoint& rCmpGP) const;
bool operator!=(const SdrGluePoint& rCmpGP) const { return !operator==(rCmpGP); }
- const Point& GetPos() const { return aPos; }
- void SetPos(const Point& rNewPos) { aPos=rNewPos; }
- sal_uInt16 GetEscDir() const { return nEscDir; }
- void SetEscDir(sal_uInt16 nNewEsc) { nEscDir=nNewEsc; }
- sal_uInt16 GetId() const { return nId; }
- void SetId(sal_uInt16 nNewId) { nId=nNewId; }
- bool IsPercent() const { return !bNoPercent; }
- void SetPercent(FASTBOOL bOn) { bNoPercent=!bOn; }
+
+ const basegfx::B2DPoint& GetPos() const { return maPos; }
+ void SetPos(const basegfx::B2DPoint& rNewPos) { if(maPos != rNewPos) maPos = rNewPos; }
+
+ sal_uInt16 GetEscDir() const { return mnEscDir; }
+ void SetEscDir(sal_uInt16 nNewEsc) { if(mnEscDir != nNewEsc) mnEscDir = nNewEsc; }
+
+ sal_uInt32 GetId() const { return mnId; }
+ void SetId(sal_uInt32 nNewId) { if(mnId != nNewId) mnId = nNewId; }
+
+ bool IsPercent() const { return !mbNoPercent; }
+ void SetPercent(bool bOn) { if(mbNoPercent == bOn) mbNoPercent = !bOn; }
+
// Temporaer zu setzen fuer Transformationen am Bezugsobjekt
- FASTBOOL IsReallyAbsolute() const { return bReallyAbsolute; }
- void SetReallyAbsolute(FASTBOOL bOn, const SdrObject& rObj);
+ bool IsReallyAbsolute() const { return mbReallyAbsolute; }
// #i38892#
- FASTBOOL IsUserDefined() const { return bUserDefined; }
- void SetUserDefined(FASTBOOL bNew) { bUserDefined = bNew; }
-
- sal_uInt16 GetAlign() const { return nAlign; }
- void SetAlign(sal_uInt16 nAlg) { nAlign=nAlg; }
- sal_uInt16 GetHorzAlign() const { return nAlign&0x00FF; }
- void SetHorzAlign(sal_uInt16 nAlg) { nAlign=(nAlign&0xFF00)|(nAlg&0x00FF); }
- sal_uInt16 GetVertAlign() const { return nAlign&0xFF00; }
- void SetVertAlign(sal_uInt16 nAlg) { nAlign=(nAlign&0x00FF)|(nAlg&0xFF00); }
- void Draw(OutputDevice& rOut, const SdrObject* pObj) const;
- FASTBOOL IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const;
- void Invalidate(Window& rWin, const SdrObject* pObj) const;
- Point GetAbsolutePos(const SdrObject& rObj) const;
- void SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj);
- long GetAlignAngle() const;
- void SetAlignAngle(long nWink);
- long EscDirToAngle(sal_uInt16 nEsc) const;
- sal_uInt16 EscAngleToDir(long nWink) const;
- void Rotate(const Point& rRef, long nWink, double sn, double cs, const SdrObject* pObj);
- void Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj);
- void Mirror(const Point& rRef1, const Point& rRef2, long nWink, const SdrObject* pObj);
- void Shear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear, const SdrObject* pObj);
+ bool IsUserDefined() const { return mbUserDefined; }
+ void SetUserDefined(bool bNew) { if(mbUserDefined != bNew) mbUserDefined = bNew; }
+
+ sal_uInt16 GetAlign() const { return mnAlign; }
+ void SetAlign(sal_uInt16 nAlg) { if(mnAlign != nAlg) mnAlign = nAlg; }
+
+ sal_uInt16 GetHorzAlign() const { return mnAlign & 0x00FF; }
+ void SetHorzAlign(sal_uInt16 nAlg) { if((mnAlign & 0x00FF) != nAlg) mnAlign = (mnAlign & 0xFF00)|(nAlg & 0x00FF); }
+
+ sal_uInt16 GetVertAlign() const { return mnAlign & 0xFF00; }
+ void SetVertAlign(sal_uInt16 nAlg) { if((mnAlign & 0xFF00) != nAlg) mnAlign = (mnAlign & 0x00FF)|(nAlg & 0xFF00); }
+
+ bool IsHit(const basegfx::B2DPoint& rPnt, double fTolLog, const basegfx::B2DRange& rObjectRange) const;
+
+ basegfx::B2DPoint GetAbsolutePos(const basegfx::B2DRange& rObjectRange) const;
+ void SetAbsolutePos(const basegfx::B2DPoint& rNewPos, const basegfx::B2DRange& rObjectRange);
+
+ sal_Int32 GetAlignAngle() const;
+ void SetAlignAngle(sal_Int32 nWink);
+
+ sal_Int32 EscDirToAngle(sal_uInt16 nEsc) const;
+ sal_uInt16 EscAngleToDir(sal_Int32 nWink) const;
+
+ void Transform(const basegfx::B2DHomMatrix& rTransformation, const basegfx::B2DRange& rObjectRange);
};
-#define SDRGLUEPOINT_NOTFOUND 0xFFFF
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrGluePointList
+{
+private:
+ typedef ::std::vector< SdrGluePoint* > SdrGluePointContainerType;
+ SdrGluePointContainerType maList;
-class SVX_DLLPUBLIC SdrGluePointList {
- Container aList;
protected:
- SdrGluePoint* GetObject(sal_uInt16 i) const { return (SdrGluePoint*)(aList.GetObject(i)); }
+ SdrGluePoint* GetObject(sal_uInt32 i) const;
+
public:
- SdrGluePointList(): aList(1024,4,4) {}
- SdrGluePointList(const SdrGluePointList& rSrcList): aList(1024,4,4) { *this=rSrcList; }
- ~SdrGluePointList() { Clear(); }
+ SdrGluePointList();
+ SdrGluePointList(const SdrGluePointList& rSrcList);
+ ~SdrGluePointList();
+
void Clear();
void operator=(const SdrGluePointList& rSrcList);
- sal_uInt16 GetCount() const { return sal_uInt16(aList.Count()); }
+
+ sal_uInt32 GetCount() const { return maList.size(); }
+
// Beim Insert wird dem Objekt (also dem GluePoint) automatisch eine Id zugewiesen.
// ReturnCode ist der Index des neuen GluePoints in der Liste
- sal_uInt16 Insert(const SdrGluePoint& rGP);
- void Delete(sal_uInt16 nPos) { delete (SdrGluePoint*)aList.Remove(nPos); }
- SdrGluePoint& operator[](sal_uInt16 nPos) { return *GetObject(nPos); }
- const SdrGluePoint& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); }
- sal_uInt16 FindGluePoint(sal_uInt16 nId) const;
- sal_uInt16 HitTest(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj, FASTBOOL bBack=sal_False, FASTBOOL bNext=sal_False, sal_uInt16 nId0=0) const;
- void Invalidate(Window& rWin, const SdrObject* pObj) const;
+ sal_uInt32 Insert(const SdrGluePoint& rGP);
+ void Delete(sal_uInt32 nPos);
+
+ SdrGluePoint& operator[](sal_uInt32 nPos) { return *GetObject(nPos); }
+ const SdrGluePoint& operator[](sal_uInt32 nPos) const { return *GetObject(nPos); }
+
+ sal_uInt32 FindGluePoint(sal_uInt32 nId) const;
+ sal_uInt32 GPLHitTest(const basegfx::B2DPoint& rPnt, double fTolLog, const basegfx::B2DRange& rObjectRange,
+ bool bBack = false, sal_uInt32 nId0 = 0) const;
+
// Temporaer zu setzen fuer Transformationen am Bezugsobjekt
- void SetReallyAbsolute(FASTBOOL bOn, const SdrObject& rObj);
- void Rotate(const Point& rRef, long nWink, double sn, double cs, const SdrObject* pObj);
- void Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj);
- void Mirror(const Point& rRef1, const Point& rRef2, long nWink, const SdrObject* pObj);
- void Shear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear, const SdrObject* pObj);
+ void TransformGluePoints(const basegfx::B2DHomMatrix& rTransformation, const basegfx::B2DRange& rObjectRange);
};
-
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDGLUE_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx
index 43fd6dacbe84..e2399d38aa85 100644
--- a/svx/inc/svx/svdhdl.hxx
+++ b/svx/inc/svx/svdhdl.hxx
@@ -25,36 +25,26 @@
#define _SVDHDL_HXX
#include <tools/gen.hxx>
-
-#ifndef _POINTR_HXX //autogen
#include <vcl/pointr.hxx>
-#endif
#include <tools/contnr.hxx>
-
-#ifndef _SOLAR_HRC
#include <svl/solar.hrc>
-#endif
-
#include <svx/xpoly.hxx>
#include <svx/svdoedge.hxx>
#include <svx/sdr/overlay/overlayobjectlist.hxx>
#include "svx/svxdllapi.h"
-
#include <svx/xpoly.hxx>
#include <svx/svdoedge.hxx>
-class VirtualDevice;
-class OutputDevice;
-class Region;
-class Window;
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
+
class SdrHdlList;
class SdrMarkView;
class SdrObject;
-class SdrPageView;
+//class SdrPageView;
class MouseEvent;
////////////////////////////////////////////////////////////////////////////////////////////////////
-
// Jedes Objekt muss in der Lage seine Handles zu erzeugen. Diese werden dann
// bei einer Selektion abgeholt, bei der View angemeldet und sichtbar gemacht.
// Wird ein Handle von der Maus beruehrt (IsHit()), so wird von der View der
@@ -142,103 +132,124 @@ enum BitmapMarkerKind
};
////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class SVX_DLLPUBLIC SdrHdl
+//
+// SdrHdl
+// SmartHdl
+// SdPathHdl
+// AnnotationHdl
+// ImageButtonHdl
+// SdrHdlColor
+// SdrHdlGradient
+// SdrHdlLine
+// SdrHdlBezWgt
+// E3dVolumeMarker
+// ImpEdgeHdl
+// ImpMeasureHdl
+// ImpTextframeHdl
+// SdrCropHdl
+// TableEdgeHdl
+// TableBorderHdl
+// SwSdrHdl
+//
+
+class SVX_DLLPUBLIC SdrHdl : private boost::noncopyable
{
- friend class SdrMarkView; // fuer den Zugriff auf nObjHdlNum
- friend class SdrHdlList;
-
+private:
// #101928#
- BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, sal_Bool bFine, sal_Bool bIsHighContrast);
+ BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, bool bFine, bool bIsHighContrast);
protected:
- SdrObject* pObj; // Gehoert das Handle zu einem Objekt?
- SdrPageView* pPV; // Gehoert das Handle zu einem Objekt in einer bestimmten PageView?
- SdrHdlList* pHdlList; // Zum Feststelen der Handlegroesse
+ SdrHdlList& mrHdlList;
+ const SdrObject* mpSdrHdlObject;
+ SdrHdlKind meKind;
+ basegfx::B2DPoint maPosition;
// OVERLAYMANAGER
::sdr::overlay::OverlayObjectList maOverlayGroup;
- Point aPos;
+ sal_uInt32 mnObjHdlNum; // incremental count without XPOLY_CONTROL based on old XPolygon
+ sal_uInt32 mnPolyNum; // polygon index based old XPolygon
+ sal_uInt32 mnPPntNum; // point index for !XPOLY_CONTROL based old XPolygon
+ sal_uInt32 mnSourceHdlNum; // incremental count including XPOLY_CONTROL based on old XPolygon
- SdrHdlKind eKind;
+ bool mbSelect : 1; // selected polygon/control point
+ bool mb1PixMore : 1; // bigger polygon start handles
+ bool mbPlusHdl : 1; // XPOLY_CONTROL
- long nDrehWink; // Handles bzw. Mauszeiger drehen
- sal_uInt32 nObjHdlNum; // wird von der MarkView benoetigt
- sal_uInt32 nPolyNum; // Polygonpunktes
- sal_uInt32 nPPntNum; // Punktnummer des Polygons
- sal_uInt32 nSourceHdlNum; // ist noch vollstaendig zu implementieren
+ // Means green handle. This was implicitely decided in old version by late setting the mnObjHdlNum
+ bool mbIsFrameHandle : 1;
- unsigned bSelect : 1; // Ein selektierter Polygonpunkt?
- unsigned b1PixMore : 1; // True=Handle wird 1 Pixel groesser dargestellt
- unsigned bPlusHdl : 1; // u.a. fuer Hld-Paint Optimierung bei MarkPoint/UnmarkPoint, ...
+ bool mbMoveOutside : 1; // forces this handle to be moved outside of the selection rectangle
+ bool mbMouseOver : 1; // is true if the mouse is over this handle
- bool mbMoveOutside; // forces this handle to be moved outside of the selection rectangle
+ // create all markers for all SdrPageWindows
+ void CreateB2dIAObject();
- // create marker for this kind
- virtual void CreateB2dIAObject();
+ // create single marker of this kind
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
// cleanup marker if one exists
void GetRidOfIAObject();
-private:
- bool mbMouseOver; // is true if the mouse is over this handle
-
-protected:
::sdr::overlay::OverlayObject* CreateOverlayObject(
const basegfx::B2DPoint& rPos,
- BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, Point aMoveOutsideOffset = Point());
+ BitmapColorIndex eColIndex,
+ BitmapMarkerKind eKindOfMarker,
+ sal_Int16 nMoveOutsideX,
+ sal_Int16 nMoveOutsideY);
BitmapMarkerKind GetNextBigger(BitmapMarkerKind eKnd) const;
public:
- SdrHdl();
- SdrHdl(const Point& rPnt, SdrHdlKind eNewKind=HDL_MOVE);
+ SdrHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject = 0,
+ SdrHdlKind eNewKind = HDL_MOVE,
+ const basegfx::B2DPoint& rPosition = basegfx::B2DPoint(),
+ bool bIsFrameHandle = false);
+
+protected:
+ friend class SdrHdlList;
virtual ~SdrHdl();
+public:
const ::sdr::overlay::OverlayObjectList& getOverlayObjectList() const { return maOverlayGroup; }
- void SetHdlList(SdrHdlList* pList);
- SdrHdlKind GetKind() const { return eKind; }
+ SdrHdlKind GetKind() const { return meKind; }
void Touch();
- const Point& GetPos() const { return aPos; }
- void SetPos(const Point& rPnt);
-
- SdrPageView* GetPageView() const { return pPV; }
- void SetPageView(SdrPageView* pNewPV) { pPV=pNewPV; }
+ virtual const basegfx::B2DPoint& getPosition() const;
+ virtual void setPosition(const basegfx::B2DPoint& rNew);
- SdrObject* GetObj() const { return pObj; }
- void SetObj(SdrObject* pNewObj);
+ const SdrObject* GetObj() const { return mpSdrHdlObject; }
- sal_Bool IsSelected() const { return bSelect; }
- void SetSelected(sal_Bool bJa=sal_True);
+ bool IsSelected() const { return mbSelect; }
+ void SetSelected(bool bJa = true);
- void Set1PixMore(sal_Bool bJa=sal_True);
- void SetDrehWink(long n);
+ void Set1PixMore(bool bJa = true);
- sal_Bool IsCornerHdl() const { return eKind==HDL_UPLFT || eKind==HDL_UPRGT || eKind==HDL_LWLFT || eKind==HDL_LWRGT; }
- sal_Bool IsVertexHdl() const { return eKind==HDL_UPPER || eKind==HDL_LOWER || eKind==HDL_LEFT || eKind==HDL_RIGHT; }
+ bool IsCornerHdl() const { return meKind==HDL_UPLFT || meKind==HDL_UPRGT || meKind==HDL_LWLFT || meKind==HDL_LWRGT; }
+ bool IsVertexHdl() const { return meKind==HDL_UPPER || meKind==HDL_LOWER || meKind==HDL_LEFT || meKind==HDL_RIGHT; }
- void SetObjHdlNum(sal_uInt32 nNum) { nObjHdlNum=nNum; }
- sal_uInt32 GetObjHdlNum() const { return nObjHdlNum; }
+ void SetObjHdlNum(sal_uInt32 nNum) { mnObjHdlNum=nNum; }
+ sal_uInt32 GetObjHdlNum() const { return mnObjHdlNum; }
- void SetPolyNum(sal_uInt32 nNum) { nPolyNum=nNum; }
- sal_uInt32 GetPolyNum() const { return nPolyNum; }
+ void SetPolyNum(sal_uInt32 nNum) { mnPolyNum=nNum; }
+ sal_uInt32 GetPolyNum() const { return mnPolyNum; }
- void SetPointNum(sal_uInt32 nNum) { nPPntNum=nNum; }
- sal_uInt32 GetPointNum() const { return nPPntNum; }
+ void SetPointNum(sal_uInt32 nNum) { mnPPntNum=nNum; }
+ sal_uInt32 GetPointNum() const { return mnPPntNum; }
- void SetPlusHdl(sal_Bool bOn) { bPlusHdl=bOn; }
- sal_Bool IsPlusHdl() const { return bPlusHdl; }
+ bool IsPlusHdl() const { return mbPlusHdl; }
+ bool IsFrameHandle() const { return mbIsFrameHandle; }
- void SetSourceHdlNum(sal_uInt32 nNum) { nSourceHdlNum=nNum; }
- sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; }
+ void SetSourceHdlNum(sal_uInt32 nNum) { mnSourceHdlNum=nNum; }
+ sal_uInt32 GetSourceHdlNum() const { return mnSourceHdlNum; }
virtual Pointer GetPointer() const;
- bool IsHdlHit(const Point& rPnt) const;
+ bool IsHdlHit(const basegfx::B2DPoint& rPosition) const;
// #97016# II
- virtual sal_Bool IsFocusHdl() const;
+ virtual bool IsFocusHdl() const;
void SetMoveOutside( bool bMoveOutside );
@@ -251,6 +262,80 @@ public:
virtual void onMouseLeave();
bool isMouseOver() const;
+ void setMouseOver(bool bNew);
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrHdlList : private boost::noncopyable, public Timer
+{
+private:
+ typedef ::std::vector< SdrHdl* > SdrHdlContainerType;
+ friend class SdrHdl;
+
+ SVX_DLLPRIVATE bool operator==(const SdrHdlList&);
+ SVX_DLLPRIVATE bool operator!=(const SdrHdlList&);
+
+ // derived from Timer; starts timer to call a delayed Timeout
+ // which then calls CreateB2dIAObject for each handle. Only to be called
+ // from SdrHdl itself
+ virtual void Timeout();
+ void SdrHdlVisualisationChanged();
+
+protected:
+ sal_uInt32 mnFocusIndex;
+ SdrMarkView& mrView;
+ SdrHdlContainerType maList;
+ sal_uInt16 mnHdlSize;
+
+ /// bitfield
+ bool mbRotateShear : 1;
+ bool mbDistortShear : 1;
+ bool mbMoveOutside : 1; // Handles nach aussen ruecken (fuer TextEdit)
+ bool mbFineHandles : 1;
+
+public:
+ SdrHdlList(SdrMarkView& rV);
+ ~SdrHdlList();
+
+ void Clear();
+
+ // #97016# II
+ void TravelFocusHdl(bool bForward);
+ SdrHdl* GetFocusHdl() const;
+ void SetFocusHdl(SdrHdl* pNew);
+ void ResetFocusHdl();
+
+ // Access to View
+ SdrMarkView& GetViewFromSdrHdlList() const { return mrView; }
+
+ // Sortierung: 1.Level Erst Refpunkt-Handles, dann normale Handles, dann Glue, dann User, dann Plushandles
+ // 2.Level PageView (Pointer)
+ // 3.Level Position (x+y)
+ void Sort();
+ sal_uInt32 GetHdlCount() const { return maList.size(); }
+ SdrHdl* GetHdlByIndex(sal_uInt32 nNum) const;
+ sal_uInt32 GetHdlNum(const SdrHdl* pHdl) const;
+
+ void SetHdlSize(sal_uInt16 nSiz);
+ sal_uInt16 GetHdlSize() const { return mnHdlSize; }
+
+ void SetMoveOutside(bool bOn);
+ bool IsMoveOutside() const { return mbMoveOutside; }
+
+ void SetRotateShear(bool bOn) { mbRotateShear = bOn; }
+ bool IsRotateShear() const { return mbRotateShear; }
+
+ void SetDistortShear(bool bOn) { mbDistortShear = bOn; }
+ bool IsDistortShear() const { return mbDistortShear; }
+
+ void SetFineHdl(bool bOn);
+ bool IsFineHdl() const { return mbFineHandles; }
+
+ // Zuletzt eingefuegte Handles werden am ehesten getroffen
+ // (wenn Handles uebereinander liegen).
+ SdrHdl* IsHdlListHit(const basegfx::B2DPoint& rPosition, SdrHdl* pHdl0 = 0) const;
+ SdrHdl* GetHdlByKind(SdrHdlKind eKind1) const;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -271,24 +356,32 @@ private:
Link aColorChangeHdl;
// use luminance values only
- unsigned bUseLuminance : 1;
-
- // create marker for this kind
- SVX_DLLPRIVATE virtual void CreateB2dIAObject();
+ bool bUseLuminance : 1;
// help functions
SVX_DLLPRIVATE Bitmap CreateColorDropper(Color aCol);
SVX_DLLPRIVATE Color GetLuminance(const Color& rCol);
SVX_DLLPRIVATE void CallColorChangeLink();
-public:
- SdrHdlColor(const Point& rRef, Color aCol = Color(COL_BLACK), const Size& rSize = Size(11, 11), sal_Bool bLum = sal_False);
+protected:
+ // create marker for this kind
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+
virtual ~SdrHdlColor();
- sal_Bool IsUseLuminance() const { return bUseLuminance; }
+public:
+ SdrHdlColor(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DPoint& rRef,
+ Color aCol = Color(COL_BLACK),
+ const Size& rSize = Size(11, 11),
+ bool bLum = false);
+
+ bool IsUseLuminance() const { return bUseLuminance; }
Color GetColor() const { return aMarkerColor; }
- void SetColor(Color aNew, sal_Bool bCallLink = sal_False);
+ void SetColor(Color aNew, bool bCallLink = false);
const Size& GetSize() const { return aMarkerSize; }
void SetSize(const Size& rNew);
@@ -303,47 +396,52 @@ class SdrHdlGradient : public SdrHdl
{
private:
// pointer to used color handles
- SdrHdlColor* pColHdl1;
- SdrHdlColor* pColHdl2;
-
- // 2nd position
- Point a2ndPos;
+ SdrHdlColor& mrColHdl1;
+ SdrHdlColor& mrColHdl2;
// is this a gradient or a transparence
- unsigned bGradient : 1;
+ bool bGradient : 1;
// select which handle to move
- unsigned bMoveSingleHandle : 1;
- unsigned bMoveFirstHandle : 1;
+ bool bMoveSingleHandle : 1;
+ bool bMoveFirstHandle : 1;
+protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
-public:
- SdrHdlGradient(const Point& rRef1, const Point& rRef2, sal_Bool bGrad = sal_True);
virtual ~SdrHdlGradient();
- sal_Bool IsGradient() const { return bGradient; }
+public:
+ SdrHdlGradient(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ SdrHdlColor& rSdrHdlColor1,
+ SdrHdlColor& rSdrHdlColor2,
+ bool bGrad = false);
+
+ bool IsGradient() const { return bGradient; }
- // set the associated color handles
- void SetColorHandles(SdrHdlColor* pL1, SdrHdlColor* pL2) { pColHdl1 = pL1; pColHdl2 = pL2; }
- SdrHdlColor* GetColorHdl1() const { return pColHdl1; }
- SdrHdlColor* GetColorHdl2() const { return pColHdl2; }
+ virtual const basegfx::B2DPoint& getPosition() const;
+ virtual void setPosition(const basegfx::B2DPoint& rNew);
- const Point& Get2ndPos() const { return a2ndPos; }
- void Set2ndPos(const Point& rPnt);
+ virtual const basegfx::B2DPoint& get2ndPosition() const;
+ virtual void set2ndPosition(const basegfx::B2DPoint& rNew);
+
+ SdrHdlColor& getColHdl1() { return mrColHdl1; }
+ SdrHdlColor& getColHdl2() { return mrColHdl2; }
// the link called by the color handles
DECL_LINK(ColorChangeHdl, SdrHdl*);
// transformation call, create gradient from this handle
- void FromIAOToItem(SdrObject* pObj, sal_Bool bSetItemOnObject, sal_Bool bUndo);
+ void FromIAOToItem(bool bSetItemOnObject, bool bUndo);
// selection flags for interaction
- sal_Bool IsMoveSingleHandle() const { return bMoveSingleHandle; }
- void SetMoveSingleHandle(sal_Bool bNew) { bMoveSingleHandle = bNew; }
- sal_Bool IsMoveFirstHandle() const { return bMoveFirstHandle; }
- void SetMoveFirstHandle(sal_Bool bNew) { bMoveFirstHandle = bNew; }
+ bool IsMoveSingleHandle() const { return bMoveSingleHandle; }
+ void SetMoveSingleHandle(bool bNew) { bMoveSingleHandle = bNew; }
+ bool IsMoveFirstHandle() const { return bMoveFirstHandle; }
+ void SetMoveFirstHandle(bool bNew) { bMoveFirstHandle = bNew; }
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -351,18 +449,28 @@ public:
// Spiegelachse
class SdrHdlLine: public SdrHdl
{
+private:
+protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+
+ virtual ~SdrHdlLine();
-protected:
SdrHdl* pHdl1;
SdrHdl* pHdl2;
public:
- SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind=HDL_MIRX) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; }
- virtual ~SdrHdlLine();
+ SdrHdlLine(
+ SdrHdlList& rHdlList,
+ SdrHdlKind eNewKind = HDL_MIRX)
+ : SdrHdl(rHdlList, 0, eNewKind),
+ pHdl1(0),
+ pHdl2(0)
+ {
+ }
virtual Pointer GetPointer() const;
+ void SetHandles(SdrHdl* p1, SdrHdl* p2) { pHdl1 = p1; pHdl2 = p2; }
};
// Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode
@@ -370,47 +478,76 @@ public:
// BasisHandles.
class SdrHdlBezWgt: public SdrHdl
{
+private:
+protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+
+ virtual ~SdrHdlBezWgt();
-protected:
const SdrHdl* pHdl1;
public:
// das ist kein Copy-Ctor!!!
- SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=HDL_BWGT) { eKind=eNewKind; pHdl1=pRefHdl1; }
- virtual ~SdrHdlBezWgt();
+ SdrHdlBezWgt(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const SdrHdl& rRefHdl1,
+ SdrHdlKind eNewKind = HDL_BWGT)
+ : SdrHdl(rHdlList, &rSdrHdlObject, eNewKind),
+ pHdl1(&rRefHdl1)
+ {
+ mbPlusHdl = true;
+ }
};
////////////////////////////////////////////////////////////////////////////////////////////////////
class E3dVolumeMarker : public SdrHdl
{
+private:
basegfx::B2DPolyPolygon aWireframePoly;
+protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+
+ virtual ~E3dVolumeMarker();
public:
- E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly);
+ E3dVolumeMarker(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject,
+ const basegfx::B2DPolyPolygon& rWireframePoly);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
class ImpEdgeHdl: public SdrHdl
{
+private:
SdrEdgeLineCode eLineCode;
+protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
-public:
- ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind),eLineCode(MIDDLELINE) {}
virtual ~ImpEdgeHdl();
+public:
+ ImpEdgeHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ SdrHdlKind eNewKind,
+ const basegfx::B2DPoint& rPnt)
+ : SdrHdl(rHdlList, &rSdrHdlObject, eNewKind, rPnt),
+ eLineCode(MIDDLELINE)
+ {
+ }
+
void SetLineCode(SdrEdgeLineCode eCode);
SdrEdgeLineCode GetLineCode() const { return eLineCode; }
- sal_Bool IsHorzDrag() const;
+ bool IsHorzDrag() const;
virtual Pointer GetPointer() const;
};
@@ -418,13 +555,23 @@ public:
class ImpMeasureHdl: public SdrHdl
{
+private:
+protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
-public:
- ImpMeasureHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind) {}
virtual ~ImpMeasureHdl();
+public:
+ ImpMeasureHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ SdrHdlKind eNewKind,
+ const basegfx::B2DPoint& rPnt)
+ : SdrHdl(rHdlList, &rSdrHdlObject, eNewKind, rPnt)
+ {
+ }
+
virtual Pointer GetPointer() const;
};
@@ -432,82 +579,20 @@ public:
class ImpTextframeHdl: public SdrHdl
{
- const Rectangle maRect;
-
- // create marker for this kind
- virtual void CreateB2dIAObject();
-
-public:
- explicit ImpTextframeHdl(const Rectangle& rRect);
-};
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-// #97016# II
-class ImplHdlListData;
+private:
+ const basegfx::B2DHomMatrix maTransformation;
-class SVX_DLLPUBLIC SdrHdlList
-{
protected:
- sal_uIntPtr mnFocusIndex;
- SdrMarkView* pView;
- Container aList;
- sal_uInt16 nHdlSize;
-
- unsigned bRotateShear : 1;
- unsigned bDistortShear : 1;
- unsigned bMoveOutside : 1; // Handles nach aussen ruecken (fuer TextEdit)
- unsigned bFineHandles : 1;
+ // create marker for this kind
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
-private:
- SVX_DLLPRIVATE SdrHdlList(const SdrHdlList&): aList(1024,64,64) {}
- SVX_DLLPRIVATE void operator=(const SdrHdlList&) {}
- SVX_DLLPRIVATE sal_Bool operator==(const SdrHdlList&) const { return sal_False; }
- SVX_DLLPRIVATE sal_Bool operator!=(const SdrHdlList&) const { return sal_False; }
+ virtual ~ImpTextframeHdl();
public:
- SdrHdlList(SdrMarkView* pV);
- ~SdrHdlList();
- void Clear();
-
- // #97016# II
- void TravelFocusHdl(sal_Bool bForward);
- SdrHdl* GetFocusHdl() const;
- void SetFocusHdl(SdrHdl* pNew);
- void ResetFocusHdl();
-
- // Access to View
- SdrMarkView* GetView() const;
-
- // Sortierung: 1.Level Erst Refpunkt-Handles, dann normale Handles, dann Glue, dann User, dann Plushandles
- // 2.Level PageView (Pointer)
- // 3.Level Position (x+y)
- void Sort();
- sal_uIntPtr GetHdlCount() const { return aList.Count(); }
- SdrHdl* GetHdl(sal_uIntPtr nNum) const { return (SdrHdl*)(aList.GetObject(nNum)); }
- sal_uIntPtr GetHdlNum(const SdrHdl* pHdl) const;
- void SetHdlSize(sal_uInt16 nSiz);
- sal_uInt16 GetHdlSize() const { return nHdlSize; }
- void SetMoveOutside(sal_Bool bOn);
- sal_Bool IsMoveOutside() const { return bMoveOutside; }
- void SetRotateShear(sal_Bool bOn);
- sal_Bool IsRotateShear() const { return bRotateShear; }
- void SetDistortShear(sal_Bool bOn);
- sal_Bool IsDistortShear() const { return bDistortShear; }
- void SetFineHdl(sal_Bool bOn);
- sal_Bool IsFineHdl() const { return bFineHandles; }
-
- // AddHdl uebernimmt das Handle in sein Eigentum. Es muss
- // also auf dem Heap stehen, da Clear() ein delete macht.
- void AddHdl(SdrHdl* pHdl, sal_Bool bAtBegin=sal_False);
- SdrHdl* RemoveHdl(sal_uIntPtr nNum);
-
- // Zuletzt eingefuegte Handles werden am ehesten getroffen
- // (wenn Handles uebereinander liegen).
- SdrHdl* IsHdlListHit(const Point& rPnt, sal_Bool bBack=sal_False, sal_Bool bNext=sal_False, SdrHdl* pHdl0=NULL) const;
- SdrHdl* GetHdl(SdrHdlKind eKind1) const;
+ explicit ImpTextframeHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DHomMatrix& rTransformation);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -515,16 +600,26 @@ public:
class SVX_DLLPUBLIC SdrCropHdl : public SdrHdl
{
public:
- SdrCropHdl(const Point& rPnt, SdrHdlKind eNewKind);
+ SdrCropHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ SdrHdlKind eNewKind,
+ const basegfx::B2DPoint& rPnt);
protected:
+ virtual ~SdrCropHdl();
+
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
- BitmapEx GetBitmapForHandle( const BitmapEx& rBitmap, int nSize );
+ BitmapEx GetBitmapForHandle( const BitmapEx& rBitmap, sal_uInt16 nSize );
static BitmapEx GetHandlesBitmap( bool bIsFineHdl, bool bIsHighContrast );
};
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#endif //_SVDHDL_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//eof
diff --git a/svx/inc/svx/svdhlpln.hxx b/svx/inc/svx/svdhlpln.hxx
index 6c96c174622e..6d73dbbe3809 100644
--- a/svx/inc/svx/svdhlpln.hxx
+++ b/svx/inc/svx/svdhlpln.hxx
@@ -27,77 +27,83 @@
#include <sal/types.h>
#include <tools/color.hxx>
#include <tools/gen.hxx>
-
-#ifndef _POINTR_HXX //autogen
#include <vcl/pointr.hxx>
-#endif
#include <tools/contnr.hxx>
#include "svx/svxdllapi.h"
+#include <basegfx/point/b2dpoint.hxx>
-class OutputDevice;
////////////////////////////////////////////////////////////////////////////////////////////////////
+// defines
-enum SdrHelpLineKind {SDRHELPLINE_POINT,SDRHELPLINE_VERTICAL,SDRHELPLINE_HORIZONTAL};
-#define SDRHELPLINE_MIN SDRHELPLINE_POINT
-#define SDRHELPLINE_MAX SDRHELPLINE_HORIZONTAL
+enum SdrHelpLineKind
+{
+ SDRHELPLINE_POINT,
+ SDRHELPLINE_VERTICAL,
+ SDRHELPLINE_HORIZONTAL
+};
-#define SDRHELPLINE_POINT_PIXELSIZE 15 /* Tatsaechliche Groesse= PIXELSIZE*2+1 */
+#define SDRHELPLINE_NOTFOUND 0xffffffff
-class SdrHelpLine {
- Point aPos; // je nach Wert von eKind ist X oder Y evtl. belanglos
- SdrHelpLineKind eKind;
+////////////////////////////////////////////////////////////////////////////////////////////////////
- // #i27493#
- // Helper method to draw a hor or ver two-colored dashed line
- void ImpDrawDashedTwoColorLine(OutputDevice& rOut, sal_Int32 nStart, sal_Int32 nEnd, sal_Int32 nFixPos,
- sal_Int32 nStepWidth, Color aColA, Color aColB, sal_Bool bHorizontal) const;
+class SVX_DLLPUBLIC SdrHelpLine
+{
+private:
+ basegfx::B2DPoint maPos; // je nach Wert von eKind ist X oder Y evtl. belanglos
+ SdrHelpLineKind meKind;
public:
- SdrHelpLine(SdrHelpLineKind eNewKind=SDRHELPLINE_POINT): eKind(eNewKind) {}
- SdrHelpLine(SdrHelpLineKind eNewKind, const Point& rNewPos): aPos(rNewPos), eKind(eNewKind) {}
- bool operator==(const SdrHelpLine& rCmp) const { return aPos==rCmp.aPos && eKind==rCmp.eKind; }
+ SdrHelpLine(SdrHelpLineKind eNewKind = SDRHELPLINE_POINT);
+ SdrHelpLine(SdrHelpLineKind eNewKind, const basegfx::B2DPoint& rNewPos);
+
+ bool operator==(const SdrHelpLine& rCmp) const;
bool operator!=(const SdrHelpLine& rCmp) const { return !operator==(rCmp); }
- void SetKind(SdrHelpLineKind eNewKind) { eKind=eNewKind; }
- SdrHelpLineKind GetKind() const { return eKind; }
- void SetPos(const Point& rPnt) { aPos=rPnt; }
- const Point& GetPos() const { return aPos; }
+ void SetKind(SdrHelpLineKind eNewKind) { if(meKind != eNewKind) meKind = eNewKind; }
+ SdrHelpLineKind GetKind() const { return meKind; }
+
+ void SetPos(const basegfx::B2DPoint& rPnt) { if(maPos != rPnt) maPos = rPnt; }
+ const basegfx::B2DPoint& GetPos() const { return maPos; }
Pointer GetPointer() const;
- FASTBOOL IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const;
- // OutputDevice wird benoetigt, da Fangpunkte eine feste Pixelgroesse haben
- Rectangle GetBoundRect(const OutputDevice& rOut) const;
-
- /* returns true if this and the given help line would be rendered at the same pixel position
- of the given OutputDevice. This can be used to avoid drawing multiple help lines with xor
- on same position which could render them invisible */
- bool IsVisibleEqual( const SdrHelpLine& rHelpLine, const OutputDevice& rOut ) const;
+ bool IsHit(const basegfx::B2DPoint& rPnt, double fTolLog) const;
};
-#define SDRHELPLINE_NOTFOUND 0xFFFF
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrHelpLineList
+{
+private:
+ typedef ::std::vector< SdrHelpLine* > SdrHelpLineContainerType;
+ SdrHelpLineContainerType maList;
-class SVX_DLLPUBLIC SdrHelpLineList {
- Container aList;
protected:
- SdrHelpLine* GetObject(sal_uInt16 i) const { return (SdrHelpLine*)(aList.GetObject(i)); }
+ SdrHelpLine* GetObject(sal_uInt32 i) const;
+
public:
- SdrHelpLineList(): aList(1024,4,4) {}
- SdrHelpLineList(const SdrHelpLineList& rSrcList): aList(1024,4,4) { *this=rSrcList; }
- ~SdrHelpLineList() { Clear(); }
+ SdrHelpLineList();
+ SdrHelpLineList(const SdrHelpLineList& rSrcList);
+ ~SdrHelpLineList();
+
void Clear();
void operator=(const SdrHelpLineList& rSrcList);
bool operator==(const SdrHelpLineList& rCmp) const;
bool operator!=(const SdrHelpLineList& rCmp) const { return !operator==(rCmp); }
- sal_uInt16 GetCount() const { return sal_uInt16(aList.Count()); }
- void Insert(const SdrHelpLine& rHL, sal_uInt16 nPos=0xFFFF) { aList.Insert(new SdrHelpLine(rHL),nPos); }
- void Delete(sal_uInt16 nPos) { delete (SdrHelpLine*)aList.Remove(nPos); } // #i24900#
- void Move(sal_uInt16 nPos, sal_uInt16 nNewPos) { aList.Insert(aList.Remove(nPos),nNewPos); }
- SdrHelpLine& operator[](sal_uInt16 nPos) { return *GetObject(nPos); }
- const SdrHelpLine& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); }
- sal_uInt16 HitTest(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const;
+
+ sal_uInt32 GetCount() const { return maList.size(); }
+
+ void Insert(const SdrHelpLine& rHL, sal_uInt32 nPos = 0xffffffff);
+ void Delete(sal_uInt32 nPos);
+
+ SdrHelpLine& operator[](sal_uInt32 nPos) { return *GetObject(nPos); }
+ const SdrHelpLine& operator[](sal_uInt32 nPos) const { return *GetObject(nPos); }
+
+ sal_uInt32 HLHitTest(const basegfx::B2DPoint& rPnt, double fTolLog) const;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDHLPLN_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svditer.hxx b/svx/inc/svx/svditer.hxx
index 5ce1f4b3de72..66f1acfc3050 100644
--- a/svx/inc/svx/svditer.hxx
+++ b/svx/inc/svx/svditer.hxx
@@ -27,51 +27,64 @@
#include <sal/types.h>
#include <tools/list.hxx>
#include "svx/svxdllapi.h"
+#include <vector>
+#include <svx/svdobj.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
class SdrObjList;
-class SdrObject;
-class SdrMarkList;
-// SdrObjListIter methods:
-// IM_FLAT : Flach ueber die Liste
-// IM_DEEPWITHGROUPS : Mit rekursivem Abstieg, Next() liefert auch Gruppenobjekte
-// IM_DEEPNOGROUPS : Mit rekursivem Abstieg, Next() liefert keine Gruppenobjekte
-enum SdrIterMode { IM_FLAT, IM_DEEPWITHGROUPS, IM_DEEPNOGROUPS};
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// defines
+
+enum SdrIterMode
+{
+ IM_FLAT, // : Flach ueber die Liste
+ IM_DEEPWITHGROUPS, // : Mit rekursivem Abstieg, Next() liefert auch Gruppenobjekte
+ IM_DEEPNOGROUPS // : Mit rekursivem Abstieg, Next() liefert keine Gruppenobjekte
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrObjListIter
{
- List maObjList;
+private:
+ SdrObjectVector maObjList;
sal_uInt32 mnIndex;
- sal_Bool mbReverse;
- void ImpProcessObjectList(const SdrObjList& rObjList, SdrIterMode eMode, sal_Bool bUseZOrder);
- void ImpProcessMarkList(const SdrMarkList& rMarkList, SdrIterMode eMode);
- void ImpProcessObj(SdrObject* pObj, SdrIterMode eMode, sal_Bool bUseZOrder);
+ /// bitfield
+ bool mbReverse : 1;
+
+ void ImpProcessObjectList(const SdrObjList& rObjList, SdrIterMode eMode); // , bool bUseZOrder);
+ void ImpProcessObj(const SdrObject& rObj, SdrIterMode eMode); // , bool bUseZOrder);
public:
- SdrObjListIter(const SdrObjList& rObjList, SdrIterMode eMode = IM_DEEPNOGROUPS, sal_Bool bReverse = sal_False);
+ SdrObjListIter(const SdrObjList& rObjList, SdrIterMode eMode = IM_DEEPNOGROUPS, bool bReverse = false);
+
/** This variant lets the user choose the order in which to travel over
the objects.
@param bUseZOrder
- When <TRUE/> then the z-order defines the order of iteration.
+ When <true/> then the z-order defines the order of iteration.
Otherwise the navigation position as returned by
SdrObject::GetNavigationPosition() is used.
*/
- SdrObjListIter(const SdrObjList& rObjList, sal_Bool bUseZOrder, SdrIterMode eMode = IM_DEEPNOGROUPS, sal_Bool bReverse = sal_False);
+// SdrObjListIter(const SdrObjList& rObjList, bool bUseZOrder, SdrIterMode eMode = IM_DEEPNOGROUPS, bool bReverse = false);
/* SJ: the following function can now be used with every
SdrObject and is no longer limited to group objects */
- SdrObjListIter(const SdrObject& rObj, SdrIterMode eMode = IM_DEEPNOGROUPS, sal_Bool bReverse = sal_False);
-
- /** Iterates over a list of marked objects received from the SdrMarkView. */
- SdrObjListIter(const SdrMarkList& rMarkList, SdrIterMode eMode = IM_DEEPNOGROUPS, sal_Bool bReverse = sal_False);
+ SdrObjListIter(const SdrObject& rObj, SdrIterMode eMode = IM_DEEPNOGROUPS, bool bReverse = false);
- void Reset() { mnIndex = (mbReverse ? maObjList.Count() : 0L); }
- sal_Bool IsMore() const { return (mbReverse ? mnIndex != 0 : ( mnIndex < maObjList.Count())); }
- SdrObject* Next() { return (SdrObject*)maObjList.GetObject(mbReverse ? --mnIndex : mnIndex++); }
-
- sal_uInt32 Count() { return maObjList.Count(); }
+ void Reset() { mnIndex = (mbReverse ? maObjList.size() : 0); }
+ bool IsMore() const { return (mbReverse ? (mnIndex != 0) : (mnIndex < maObjList.size())); }
+ SdrObject* Next() { return (mbReverse ? (mnIndex != 0 ? maObjList[--mnIndex] : 0) : (mnIndex < maObjList.size() ? maObjList[mnIndex++] : 0)); }
+ sal_uInt32 Count() { return maObjList.size(); }
+ bool Contains(const SdrObject& rObject) { for(SdrObjectVector::const_iterator aCandidate(maObjList.begin()); aCandidate != maObjList.end(); aCandidate++) if(*aCandidate == &rObject) return true; return false; }
};
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#endif //_SVDITER_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdlayer.hxx b/svx/inc/svx/svdlayer.hxx
index 61531c7081e6..33cf38f44d3f 100644
--- a/svx/inc/svx/svdlayer.hxx
+++ b/svx/inc/svx/svdlayer.hxx
@@ -24,65 +24,89 @@
#ifndef _SVDLAYER_HXX
#define _SVDLAYER_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#include <tools/string.hxx>
#include <tools/stream.hxx>
#include <svx/svdsob.hxx>
#include <svx/svdtypes.hxx> // fuer typedef SdrLayerID
#include "svx/svxdllapi.h"
+#include <vector>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
class SdrModel;
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
class SVX_DLLPUBLIC SdrLayer
{
-friend class SdrLayerAdmin;
+private:
protected:
- String aName;
+ String maName;
+
+ // title and description set and get in SD over UNO API
String maTitle;
String maDescription;
- SdrModel* pModel; // zum Broadcasten
- sal_uInt16 nType; // 0=Userdefined,1=Standardlayer
- SdrLayerID nID;
+
+ SdrModel& mrModel; // zum Broadcasten
+ SdrLayerID mnID;
+
+ /// bitfield
+ bool mbStandardlayer : 1; // Userdefined or Standardlayer // 0=Userdefined,1=Standardlayer
+
protected:
- SdrLayer(SdrLayerID nNewID, const String& rNewName) { nID=nNewID; aName=rNewName; nType=0; pModel=NULL; }
- void SetID(SdrLayerID nNewID) { nID=nNewID; }
+ void SetID(SdrLayerID nNewID) { if(mnID != nNewID) mnID = nNewID; }
+
public:
- SdrLayer(): pModel(NULL),nType(0),nID(0) {}
+ SdrLayer(SdrLayerID nNewID, const String& rNewName, SdrModel& rSdrModel);
+
bool operator==(const SdrLayer& rCmpLayer) const;
bool operator!=(const SdrLayer& rCmpLayer) const { return !operator==(rCmpLayer); }
void SetName(const String& rNewName);
- const String& GetName() const { return aName; }
+ const String& GetName() const { return maName; }
void SetTitle(const String& rTitle) { maTitle = rTitle; }
const String& GetTitle() const { return maTitle; }
-
void SetDescription(const String& rDesc) { maDescription = rDesc; }
const String& GetDescription() const { return maDescription; }
- SdrLayerID GetID() const { return nID; }
- void SetModel(SdrModel* pNewModel) { pModel=pNewModel; }
- SdrModel* GetModel() const { return pModel; }
+ SdrLayerID GetID() const { return mnID; }
+ SdrModel& GetSdrModel() const { return mrModel; }
+
// Einem SdrLayer kann man sagen dass er ein (der) Standardlayer sein soll.
// Es wird dann laenderspeziefisch der passende Name gesetzt. SetName()
// setzt das Flag "StandardLayer" ggf. zurueck auf "Userdefined".
- void SetStandardLayer(FASTBOOL bStd=sal_True);
- FASTBOOL IsStandardLayer() const { return nType==1; }
+ void SetStandardLayer(bool bStd = true);
+ bool IsStandardLayer() const { return mbStandardlayer; }
};
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Beim Aendern von Layerdaten muss man derzeit
// noch selbst das Modify-Flag am Model setzen.
+
#define SDRLAYER_MAXCOUNT 255
-class SVX_DLLPUBLIC SdrLayerAdmin {
-friend class SdrView;
-friend class SdrModel;
-friend class SdrPage;
+
+class SVX_DLLPUBLIC SdrLayerAdmin
+{
+private:
+ // allow SdrUndoNewLayer/SdrUndoDelLayer to call
+ // InsertLayerFromUndoRedo to execute it's undo/redo
+ friend class SdrUndoNewLayer;
+ friend class SdrUndoDelLayer;
+
+ void InsertLayerFromUndoRedo(SdrLayer* pLayer, sal_uInt32 nPos = 0xffffffff);
protected:
- Container aLayer;
- Container aLSets;
- SdrLayerAdmin* pParent; // Der Admin der Seite kennt den Admin des Docs
- SdrModel* pModel; // zum Broadcasten
- String aControlLayerName;
+ typedef ::std::vector< SdrLayer* > SdrLayerContainerType;
+
+ SdrLayerContainerType maLayer;
+ SdrLayerAdmin* mpParent; // Der Admin der Seite kennt den Admin des Docs
+ SdrModel& mrModel; // zum Broadcasten
+ String maControlLayerName;
+
protected:
// Eine noch nicht verwendete LayerID raussuchen. Sind bereits alle
// verbraucht, so gibt's 'ne 0. Wer sicher gehen will, muss vorher
@@ -90,44 +114,41 @@ protected:
// vergeben.
SdrLayerID GetUniqueLayerID() const;
void Broadcast() const;
+
public:
- SdrLayerAdmin(SdrLayerAdmin* pNewParent=NULL);
- SdrLayerAdmin(const SdrLayerAdmin& rSrcLayerAdmin);
+ SdrLayerAdmin(SdrModel& rSdrModel, SdrLayerAdmin* pNewParent = 0);
~SdrLayerAdmin();
- const SdrLayerAdmin& operator=(const SdrLayerAdmin& rSrcLayerAdmin);
+
bool operator==(const SdrLayerAdmin& rCmpLayerAdmin) const;
bool operator!=(const SdrLayerAdmin& rCmpLayerAdmin) const { return !operator==(rCmpLayerAdmin); }
- SdrLayerAdmin* GetParent() const { return pParent; }
- void SetParent(SdrLayerAdmin* pNewParent) { pParent=pNewParent; }
- void SetModel(SdrModel* pNewModel);
- SdrModel* GetModel() const { return pModel; }
- void InsertLayer(SdrLayer* pLayer, sal_uInt16 nPos=0xFFFF) { aLayer.Insert(pLayer,nPos); pLayer->SetModel(pModel); Broadcast(); }
- SdrLayer* RemoveLayer(sal_uInt16 nPos);
+
+ SdrLayerAdmin* GetParent() const { return mpParent; }
+ void SetParent(SdrLayerAdmin* pNewParent) { if(mpParent != pNewParent) mpParent = pNewParent; }
+
+ SdrModel& GetSdrModel() const { return mrModel; }
+ SdrLayer* RemoveLayer(sal_uInt32 nPos);
+
// Alle Layer loeschen
void ClearLayer();
+
// Neuer Layer wird angelegt und eingefuegt
- SdrLayer* NewLayer(const String& rName, sal_uInt16 nPos=0xFFFF);
- void DeleteLayer(SdrLayer* pLayer) { aLayer.Remove(pLayer); delete pLayer; Broadcast(); }
- void MoveLayer(SdrLayer* pLayer, sal_uInt16 nNewPos=0xFFFF);
- SdrLayer* MoveLayer(sal_uInt16 nPos, sal_uInt16 nNewPos);
+ SdrLayer* NewLayer(const String& rName, sal_uInt32 nPos = 0xffffffff);
+ void DeleteLayer(SdrLayer* pLayer);
+
// Neuer Layer, Name wird aus der Resource geholt
- SdrLayer* NewStandardLayer(sal_uInt16 nPos=0xFFFF);
+ SdrLayer* NewStandardLayer(sal_uInt32 nPos = 0xffffffff);
// Iterieren ueber alle Layer
- sal_uInt16 GetLayerCount() const { return sal_uInt16(aLayer.Count()); }
- SdrLayer* GetLayer(sal_uInt16 i) { return (SdrLayer*)(aLayer.GetObject(i)); }
- const SdrLayer* GetLayer(sal_uInt16 i) const { return (SdrLayer*)(aLayer.GetObject(i)); }
-
- sal_uInt16 GetLayerPos(SdrLayer* pLayer) const;
+ sal_uInt32 GetLayerCount() const { return maLayer.size(); }
+ SdrLayer* GetLayer(sal_uInt32 i) const;
- SdrLayer* GetLayer(const String& rName, FASTBOOL bInherited) { return (SdrLayer*)(((const SdrLayerAdmin*)this)->GetLayer(rName,bInherited)); }
- const SdrLayer* GetLayer(const String& rName, FASTBOOL bInherited) const;
- SdrLayerID GetLayerID(const String& rName, FASTBOOL bInherited) const;
- SdrLayer* GetLayerPerID(sal_uInt16 nID) { return (SdrLayer*)(((const SdrLayerAdmin*)this)->GetLayerPerID(nID)); }
- const SdrLayer* GetLayerPerID(sal_uInt16 nID) const;
+ sal_uInt32 GetLayerPos(SdrLayer* pLayer) const;
+ SdrLayer* GetLayer(const String& rName, bool bInherited) const;
+ SdrLayerID GetLayerID(const String& rName, bool bInherited) const;
+ SdrLayer* GetLayerPerID(SdrLayerID nID) const;
- void SetControlLayerName(const String& rNewName) { aControlLayerName=rNewName; }
- const String& GetControlLayerName() const { return aControlLayerName; }
+ void SetControlLayerName(const String& rNewName) { maControlLayerName = rNewName; }
+ const String& GetControlLayerName() const;
};
/*
@@ -152,5 +173,9 @@ bInherited:
Model. Das Model selbst hat keinen Parent.
*/
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#endif //_SVDLAYER_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdlegacy.hxx b/svx/inc/svx/svdlegacy.hxx
new file mode 100644
index 000000000000..a8f35bc9b7e6
--- /dev/null
+++ b/svx/inc/svx/svdlegacy.hxx
@@ -0,0 +1,84 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _SVDLEGACY_HXX
+#define _SVDLEGACY_HXX
+
+#include <svx/svdobj.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// helpers for old access styles
+
+namespace sdr
+{
+ namespace legacy
+ {
+ // old Rectangle-based access to BoundRectangle
+ SVX_DLLPUBLIC Rectangle GetBoundRect(const SdrObject& rObject, const SdrView* pSdrView = 0); // TTTT: need to remove default and search for usages
+
+ // old access to vector of SdrObjects BoundRect, various DataTypes
+ SVX_DLLPUBLIC basegfx::B2DRange GetAllObjBoundRange(const SdrObjectVector& rObjVec, const SdrView* pSdrView = 0); // TTTT: need to remove default and search for usages
+ SVX_DLLPUBLIC Rectangle GetAllObjBoundRect(const SdrObjectVector& rObjVec, const SdrView* pSdrView = 0); // TTTT: need to remove default and search for usages
+
+ // old access to SnapRect, various DataTypes
+ // SnapRect is the range of the hairline geometry, including all transforms
+ SVX_DLLPUBLIC basegfx::B2DRange GetSnapRange(const SdrObject& rObject);
+ SVX_DLLPUBLIC Rectangle GetSnapRect(const SdrObject& rObject);
+ SVX_DLLPUBLIC void SetSnapRange(SdrObject& rObject, const basegfx::B2DRange& rRange);
+ SVX_DLLPUBLIC void SetSnapRect(SdrObject& rObject, const Rectangle& rRectangle);
+
+ // old access to vector of SdrObjects SnapRect, various DataTypes
+ SVX_DLLPUBLIC basegfx::B2DRange GetAllObjSnapRange(const SdrObjectVector& rObjVec);
+ SVX_DLLPUBLIC Rectangle GetAllObjSnapRect(const SdrObjectVector& rObjVec);
+
+ // old access to LogicRect
+ // LogicRect is the object geometry without rotation and shear
+ SVX_DLLPUBLIC basegfx::B2DRange GetLogicRange(const SdrObject& rObject);
+ SVX_DLLPUBLIC Rectangle GetLogicRect(const SdrObject& rObject);
+ SVX_DLLPUBLIC void SetLogicRange(SdrObject& rObject, const basegfx::B2DRange& rRange);
+ SVX_DLLPUBLIC void SetLogicRect(SdrObject& rObject, const Rectangle& rRectangle);
+
+ // old access to anchor as point
+ SVX_DLLPUBLIC Point GetAnchorPos(const SdrObject& rObject);
+
+ // old access to rotate and shear (including wrong orientation and
+ // integer nature). bool bVertical removed and method renamed,
+ // was not supported anyways
+ SVX_DLLPUBLIC long GetRotateAngle(const SdrObject& rObject);
+ SVX_DLLPUBLIC long GetShearAngleX(const SdrObject& rObject);
+
+ // helper for object transform in one step
+ SVX_DLLPUBLIC void transformSdrObject(SdrObject& rObject, const basegfx::B2DHomMatrix& rTransform);
+
+ // old transformation accessors
+ SVX_DLLPUBLIC void MoveSdrObject(SdrObject& rObject, const Size& rSiz); // Move
+ SVX_DLLPUBLIC void ResizeSdrObject(SdrObject& rObject, const Point& rRef, const Fraction& xFact, const Fraction& yFact); // Resize
+ SVX_DLLPUBLIC void RotateSdrObject(SdrObject& rObject, const Point& rRef, long nWink); // Rotate
+ SVX_DLLPUBLIC void MirrorSdrObject(SdrObject& rObject, const Point& rRef1, const Point& rRef2); // Mirror
+ SVX_DLLPUBLIC void ShearSdrObject(SdrObject& rObject, const Point& rRef, long nWink, bool bVShear); // Shear
+
+ } // end of namespace legacy
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SVDLEGACY_HXX
+
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index 51f7335eebaa..9ccec6951536 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -35,19 +35,18 @@
#include <tools/string.hxx>
#include <tools/datetime.hxx>
#include <svl/hint.hxx>
-
#include <svl/style.hxx>
#include <svx/pageitem.hxx>
#include <vcl/field.hxx>
-
#include <boost/shared_ptr.hpp>
-
-class OutputDevice;
#include <svx/svdtypes.hxx> // fuer enum RepeatFuncts
#include <vcl/field.hxx>
#include "svx/svxdllapi.h"
-
#include <vos/ref.hxx>
+#include <set>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
#if defined(UNX) || defined(WNT)
#define DEGREE_CHAR ((sal_Unicode)176) /* 0xB0 = Ansi */
@@ -61,45 +60,34 @@ class OutputDevice;
#error unbekannte Plattrorm
#endif
+class OutputDevice;
class SdrOutliner;
class SdrLayerAdmin;
-class SdrObjList;
class SdrObject;
class SdrPage;
-class SdrPageView;
class SdrTextObj;
class SdrUndoAction;
class SdrUndoGroup;
-class AutoTimer;
class SfxItemPool;
class SfxItemSet;
class SfxRepeatTarget;
-class SfxStyleSheet;
class SfxUndoAction;
class SfxUndoManager;
class XBitmapList;
-class XBitmapTable;
class XColorTable;
class XDashList;
-class XDashTable;
class XGradientList;
-class XGradientTable;
class XHatchList;
-class XHatchTable;
class XLineEndList;
-class XLineEndTable;
class SvxForbiddenCharactersTable;
class SvNumberFormatter;
-class SotStorage;
class SdrOutlinerCache;
-class SotStorageRef;
class SdrUndoFactory;
-namespace comphelper{
- class IEmbeddedHelper;
-}
-namespace sfx2{
- class LinkManager;
-}
+class SfxStyleSheet;
+namespace comphelper { class IEmbeddedHelper; }
+namespace sfx2 { class LinkManager; }
+class SdrView;
+
////////////////////////////////////////////////////////////////////////////////////////////////////
#define SDR_SWAPGRAPHICSMODE_NONE 0x00000000
@@ -112,223 +100,164 @@ namespace sfx2{
enum SdrHintKind
{
- HINT_UNKNOWN, // Unbekannt
- HINT_LAYERCHG, // Layerdefinition geaendert
- HINT_LAYERORDERCHG, // Layerreihenfolge geaendert (Insert/Remove/ChangePos)
- HINT_PAGEORDERCHG, // Reihenfolge der Seiten (Zeichenseiten oder Masterpages) geaendert (Insert/Remove/ChangePos)
- HINT_OBJCHG, // Objekt geaendert
- HINT_OBJINSERTED, // Neues Zeichenobjekt eingefuegt
- HINT_OBJREMOVED, // Zeichenobjekt aus Liste entfernt
- HINT_MODELCLEARED, // gesamtes Model geloescht (keine Pages mehr da). not impl.
- HINT_REFDEVICECHG, // RefDevice geaendert
- HINT_DEFAULTTABCHG, // Default Tabulatorweite geaendert
- HINT_DEFFONTHGTCHG, // Default FontHeight geaendert
- HINT_MODELSAVED, // Dokument wurde gesichert
- HINT_SWITCHTOPAGE, // #94278# UNDO/REDO at an object evtl. on another page
- HINT_BEGEDIT, // Is called after the object has entered text edit mode
- HINT_ENDEDIT // Is called after the object has left text edit mode
+ HINT_LAYERCHG, // layer definition changed
+ HINT_LAYERORDERCHG, // layer order changed
+ HINT_PAGEORDERCHG, // order of pages changed (master and/or normal)
+ HINT_OBJCHG_MOVE, // drawobject changed (translated)
+ HINT_OBJCHG_RESIZE, // drawobject changed (scaled)
+ HINT_OBJCHG_ATTR, // drawobject changed (attributes)
+ HINT_OBJINSERTED, // drawobject inserted
+ HINT_OBJREMOVED, // drawobject removed
+ HINT_MODELCLEARED, // complete model cleared
+ HINT_REFDEVICECHG, // RefDevice changed
+ HINT_DEFAULTTABCHG, // Default Tab changed
+ HINT_DEFFONTHGTCHG, // Default FontHeight changed
+ HINT_SWITCHTOPAGE, // UNDO/REDO at an object evtl. on another page
+
+ HINT_BEGEDIT, // Is called after the object has entered text edit mode
+ HINT_ENDEDIT, // Is called after the object has left text edit mode
+
+ HINT_SDROBJECTDYING, // SdrObject is destructed
+ HINT_SDRPAGEDYING // SdrPage is destructed
};
-class SVX_DLLPUBLIC SdrHint: public SfxHint
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class SVX_DLLPUBLIC SdrBaseHint : public SfxHint
{
-public:
- Rectangle maRectangle;
- const SdrPage* mpPage;
- const SdrObject* mpObj;
- const SdrObjList* mpObjList;
- SdrHintKind meHint;
+private:
+ SdrHintKind meSdrHint;
+ const SdrPage* mpSdrPage;
+ const SdrObject* mpSdrObject;
public:
- TYPEINFO();
-
- SdrHint();
- SdrHint(SdrHintKind eNewHint);
- SdrHint(const SdrObject& rNewObj);
- SdrHint(const SdrObject& rNewObj, const Rectangle& rRect);
-
- void SetPage(const SdrPage* pNewPage);
- void SetObjList(const SdrObjList* pNewOL);
- void SetObject(const SdrObject* pNewObj);
- void SetKind(SdrHintKind eNewKind);
- void SetRect(const Rectangle& rNewRect);
-
- const SdrPage* GetPage() const;
- const SdrObjList* GetObjList() const;
- const SdrObject* GetObject() const;
- SdrHintKind GetKind() const;
- const Rectangle& GetRect() const;
+ // constructor
+ SdrBaseHint(
+ SdrHintKind eSdrHintKind);
+ SdrBaseHint(
+ const SdrPage& rSdrPage,
+ SdrHintKind eSdrHintKind = HINT_PAGEORDERCHG);
+ SdrBaseHint(
+ const SdrObject& rSdrObject,
+ SdrHintKind eSdrHintKind = HINT_OBJCHG_RESIZE);
+
+ // data read access
+ SdrHintKind GetSdrHintKind() const { return meSdrHint; }
+ const SdrPage* GetSdrHintPage() const { return mpSdrPage; }
+ const SdrObject* GetSdrHintObject() const { return mpSdrObject; }
};
////////////////////////////////////////////////////////////////////////////////////////////////////
-// Flag um nach dem Laden des Pools Aufzuraeumen (d.h. die RefCounts
-// neu zu bestimmen und unbenutztes wegzuwerfen). sal_False == aktiv
-#define LOADREFCOUNTS (sal_False)
-
struct SdrDocumentStreamInfo
{
- FASTBOOL mbDeleteAfterUse;
+public:
String maUserData;
com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxStorageRef;
- sal_Bool mbDummy1 : 1;
+
+ /// bitfield
+ bool mbDeleteAfterUse : 1;
+ bool mbDummy1 : 1;
};
-struct SdrModelImpl;
+////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >
{
-protected:
- DateTime aReadDate; // Datum des Einstreamens
- Container maMaPag; // StammSeiten (Masterpages)
- Container maPages;
- Link aUndoLink; // Link fuer einen NotifyUndo-Handler
- Link aIOProgressLink;
- String aTablePath;
- Size aMaxObjSize; // z.B. fuer Autogrowing Text
- Fraction aObjUnit; // Beschreibung der Koordinateneinheiten fuer ClipBoard, Drag&Drop, ...
- MapUnit eObjUnit; // see above
- FieldUnit eUIUnit; // Masseinheit, Masstab (z.B. 1/1000) fuer die UI (Statuszeile) wird von ImpSetUIUnit() gesetzt
- Fraction aUIScale; // see above
- String aUIUnitStr; // see above
- Fraction aUIUnitFact; // see above
- int nUIUnitKomma; // see above
- FASTBOOL bUIOnlyKomma; // see above
-
- SdrLayerAdmin* pLayerAdmin;
- SfxItemPool* pItemPool;
- FASTBOOL bMyPool; // zum Aufraeumen von pMyPool ab 303a
- comphelper::IEmbeddedHelper*
- m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell
- SdrOutliner* pDrawOutliner; // ein Outliner zur Textausgabe
- SdrOutliner* pHitTestOutliner;// ein Outliner fuer den HitTest
- sal_uIntPtr nDefTextHgt; // Default Texthoehe in logischen Einheiten
- OutputDevice* pRefOutDev; // ReferenzDevice fuer die EditEngine
- sal_uIntPtr nProgressAkt; // fuer den
- sal_uIntPtr nProgressMax; // ProgressBar-
- sal_uIntPtr nProgressOfs; // -Handler
- rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool;
- SfxStyleSheet* pDefaultStyleSheet;
- SfxStyleSheet* mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; // #119287#
- sfx2::LinkManager* pLinkManager; // LinkManager
- Container* pUndoStack;
- Container* pRedoStack;
- SdrUndoGroup* pAktUndoGroup; // Fuer mehrstufige
- sal_uInt16 nUndoLevel; // Undo-Klammerung
- bool mbUndoEnabled; // If false no undo is recorded or we are during the execution of an undo action
- sal_uInt16 nProgressPercent; // fuer den ProgressBar-Handler
- sal_uInt16 nLoadVersion; // Versionsnummer der geladenen Datei
- FASTBOOL bExtColorTable; // Keinen eigenen ColorTable
- sal_Bool mbChanged;
- FASTBOOL bInfoChanged;
- FASTBOOL bPagNumsDirty;
- FASTBOOL bMPgNumsDirty;
- FASTBOOL bPageNotValid; // sal_True=Doc ist nur ObjektTraeger. Page ist nicht gueltig.
- FASTBOOL bSavePortable; // Metafiles portabel speichern
- FASTBOOL bNoBitmapCaching; // Bitmaps fuer Screenoutput cachen
- FASTBOOL bReadOnly;
- FASTBOOL bTransparentTextFrames;
- FASTBOOL bSaveCompressed;
- FASTBOOL bSwapGraphics;
- FASTBOOL bPasteResize; // Objekte werden gerade resized wegen Paste mit anderem MapMode
- FASTBOOL bSaveOLEPreview; // save preview metafile of OLE objects
- sal_uInt16 nStreamCompressMode; // Komprimiert schreiben?
- sal_uInt16 nStreamNumberFormat;
- sal_uInt16 nDefaultTabulator;
- sal_uInt32 nMaxUndoCount;
- FASTBOOL bSaveNative;
- sal_Bool bStarDrawPreviewMode;
-
-
-//////////////////////////////////////////////////////////////////////////////
-// sdr::Comment interface
private:
- // the next unique comment ID, used for counting added comments. Initialized
- // to 0. UI shows one more due to the fact that 0 is a no-no for users.
- sal_uInt32 mnUniqueCommentID;
-
-public:
- // create a new, unique comment ID
- sal_uInt32 GetNextUniqueCommentID();
-
- // get the author name
- ::rtl::OUString GetDocumentAuthorName() const;
-
- // for export
- sal_uInt32 GetUniqueCommentID() const { return mnUniqueCommentID; }
-
- // for import
- void SetUniqueCommentID(sal_uInt32 nNewID) { if(nNewID != mnUniqueCommentID) { mnUniqueCommentID = nNewID; } }
- /** cl: added this for OJ to complete his reporting engine, does not work
- correctly so only enable it for his model */
- bool IsAllowShapePropertyChangeListener() const;
- void SetAllowShapePropertyChangeListener( bool bAllow );
-
- sal_uInt16 nStarDrawPreviewMasterPageNum;
- // Reserven fuer kompatible Erweiterungen
-//-/ SfxItemPool* pUndoItemPool;
- SotStorage* pModelStorage;
- SvxForbiddenCharactersTable* mpForbiddenCharactersTable;
- sal_uIntPtr nSwapGraphicsMode;
-
- SdrOutlinerCache* mpOutlinerCache;
- SdrModelImpl* mpImpl;
- sal_uInt16 mnCharCompressType;
- sal_uInt16 mnHandoutPageCount;
- sal_uInt16 nReserveUInt6;
- sal_uInt16 nReserveUInt7;
- FASTBOOL mbModelLocked;
- FASTBOOL mbKernAsianPunctuation;
- FASTBOOL mbAddExtLeading;
- FASTBOOL mbInDestruction;
-
- // Zeiger auf Paletten, Listen und Tabellen
- XColorTable* pColorTable;
- XDashList* pDashList;
- XLineEndList* pLineEndList;
- XHatchList* pHatchList;
- XGradientList* pGradientList;
- XBitmapList* pBitmapList;
-
- // New src638: NumberFormatter for drawing layer and
- // method for getting it. It is constructed on demand
- // and destroyed when destroying the SdrModel.
- SvNumberFormatter* mpNumberFormatter;
-public:
- const SvNumberFormatter& GetNumberFormatter() const;
-
- sal_uInt16 getHandoutPageCount() const { return mnHandoutPageCount; }
- void setHandoutPageCount( sal_uInt16 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; }
-
-protected:
-
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
+ // this is a weak reference to a possible living api wrapper for this model
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoModel;
-private:
- // Nicht implementiert:
SVX_DLLPRIVATE SdrModel(const SdrModel& rSrcModel);
SVX_DLLPRIVATE void operator=(const SdrModel& rSrcModel);
- SVX_DLLPRIVATE FASTBOOL operator==(const SdrModel& rCmpModel) const;
-//#if 0 // _SOLAR__PRIVATE
+ SVX_DLLPRIVATE bool operator==(const SdrModel& rCmpModel) const;
SVX_DLLPRIVATE void ImpPostUndoAction(SdrUndoAction* pUndo);
SVX_DLLPRIVATE void ImpSetUIUnit();
- SVX_DLLPRIVATE void ImpSetOutlinerDefaults( SdrOutliner* pOutliner, sal_Bool bInit = sal_False );
- SVX_DLLPRIVATE void ImpReformatAllTextObjects();
+ SVX_DLLPRIVATE void ImpSetOutlinerDefaults( SdrOutliner* pOutliner, bool bInit = false );
SVX_DLLPRIVATE void ImpReformatAllEdgeObjects(); // #103122#
- SVX_DLLPRIVATE void ImpCreateTables();
- SVX_DLLPRIVATE void ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable,
- bool bLoadRefCounts = true);
-//#endif // __PRIVATE
+ void EnsureValidPageNumbers(bool bMaster);
- // this is a weak reference to a possible living api wrapper for this model
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoModel;
+protected:
+ // types for page and undo vectors
+ typedef ::std::vector< SdrPage* > SdrPageContainerType;
+ typedef ::std::vector< SfxUndoAction* > SfxUndoActionContainerType;
+
+ // page lists
+ SdrPageContainerType maMasterPageVector;
+ SdrPageContainerType maPageVector;
+
+ // Layers and ItemPool
+ SdrLayerAdmin* mpModelLayerAdmin;
+ SfxItemPool* mpItemPool;
+
+ // undo
+ Link maUndoLink; // Link fuer einen NotifyUndo-Handler
+ SfxUndoActionContainerType* mpUndoStack;
+ SfxUndoActionContainerType* mpRedoStack;
+ SdrUndoGroup* mpCurrentUndoGroup; // Fuer mehrstufige
+ sal_uInt32 mnUndoLevel; // Undo-Klammerung
+ sal_uInt32 mnMaxUndoCount;
+ SfxUndoManager* mpUndoManager;
+ SdrUndoFactory* mpUndoFactory;
+
+ // object scales and UI units
+ basegfx::B2DVector maMaxObjectScale; // z.B. fuer Autogrowing Text
+ Fraction maExchangeObjectScale; // Beschreibung der Koordinateneinheiten fuer ClipBoard, Drag&Drop, ...
+ MapUnit meExchangeObjectUnit; // see above
+ FieldUnit meUIUnit; // Masseinheit, Masstab (z.B. 1/1000) fuer die UI (Statuszeile) wird von ImpSetUIUnit() gesetzt
+ Fraction maUIScale; // see above
+
+ // values derived from meUIUnit and maUIScale, buffered
+ String maUIUnitString; // see above
+ Fraction maUIUnitScale; // see above
+ sal_Int32 mnUIUnitKomma; // see above
+
+ // outliner
+ SdrOutliner* mpDrawOutliner; // ein Outliner zur Textausgabe
+ SdrOutlinerCache* mpOutlinerCache;
+
+ // diverse data and helpers
+ rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool;
+ SfxStyleSheet* mpDefaultStyleSheet;
+ SfxStyleSheet* mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; // #119287#
+ comphelper::IEmbeddedHelper* m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell
+ OutputDevice* mpReferenceOutputDevice; // ReferenzDevice fuer die EditEngine
+ sfx2::LinkManager* mpLinkManager; // LinkManager
+ SvxForbiddenCharactersTable* mpForbiddenCharactersTable;
+ SvNumberFormatter* mpNumberFormatter;
+ sal_uInt32 mnDefaultFontHeight; // Default Texthoehe in logischen Einheiten
+ sal_uInt32 mnSwapGraphicsMode;
+ sal_uInt16 mnDefaultTabulator;
+ sal_uInt16 mnCharCompressType;
+
+ // tables for fill/line/... styles
+ String maTablePath;
+ XColorTable* mpColorTable;
+ XDashList* mpDashList;
+ XLineEndList* mpLineEndList;
+ XHatchList* mpHatchList;
+ XGradientList* mpGradientList;
+ XBitmapList* mpBitmapList;
+ sal_uInt16 mnHandoutPageCount;
+
+ /// bitfield
+ bool mbDeletePool : 1; // zum Aufraeumen von pMyPool ab 303a
+ bool mbUndoEnabled : 1; // If false no undo is recorded or we are during the execution of an undo action
+ bool mbChanged : 1;
+ bool mbExternalColorTable : 1; // Keinen eigenen ColorTable (SW)
+ bool mbReadOnly : 1;
+ bool mbPickThroughTransparentTextFrames : 1;
+ bool mbSwapGraphics : 1;
+ bool mbStarDrawPreviewMode : 1;
+ bool mbModelLocked : 1;
+ bool mbKernAsianPunctuation : 1;
+ bool mbAddExtLeading : 1;
+ bool mbInDestruction : 1;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
public:
-//#if 0 // _SOLAR__PRIVATE
- FASTBOOL IsPasteResize() const { return bPasteResize; }
- void SetPasteResize(FASTBOOL bOn) { bPasteResize=bOn; }
-//#endif // __PRIVATE
- TYPEINFO();
// Steckt man hier seinen eigenen Pool rein, so wird die Klasse auch
// Aktionen an ihm vornehmen (Put(),Remove()). Bei Zerstoerung von
// SdrModel wird dieser Pool ver delete geloescht!
@@ -340,77 +269,69 @@ public:
// Zeichenobjekte verwenden moechte. Setzt man degegen nur vom abstrakten
// Basisobjekt SdrObject abgeleitete Objekte ein, so ist man frei in der
// Wahl des Pools.
- SdrModel(SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
- SdrModel(const String& rPath, SfxItemPool* pPool=NULL, ::comphelper::IEmbeddedHelper* pPers=NULL, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
- SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, FASTBOOL bUseExtColorTable, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
- SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, FASTBOOL bUseExtColorTable, sal_Bool bLoadRefCounts = LOADREFCOUNTS);
+ SdrModel(const String& rPath = String(), SfxItemPool* pPool = 0, ::comphelper::IEmbeddedHelper* pPers = 0, bool bUseExtColorTable = false);
virtual ~SdrModel();
- void ClearModel(sal_Bool bCalledFromDestructor);
+ void ClearModel(bool bCalledFromDestructor);
+
+ sal_uInt16 getHandoutPageCount() const { return mnHandoutPageCount; }
+ void setHandoutPageCount( sal_uInt16 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; }
+
+ const SvNumberFormatter& GetNumberFormatter() const;
- // Hier kann man erfragen, ob das Model gerade eingrstreamt wird
- FASTBOOL IsLoading() const { return sal_False /*BFS01 bLoading */; }
// Muss z.B. ueberladen werden, um das Swappen/LoadOnDemand von Grafiken
- // zu ermoeglichen. Wird rbDeleteAfterUse auf sal_True gesetzt, so wird
+ // zu ermoeglichen. Wird rbDeleteAfterUse auf true gesetzt, so wird
// die SvStream-Instanz vom Aufrufer nach Gebrauch destruiert.
// Wenn diese Methode NULL liefert, wird zum Swappen eine temporaere
// Datei angelegt.
// Geliefert werden muss der Stream, aus dem das Model geladen wurde
// bzw. in den es zuletzt gespeichert wurde.
virtual SvStream* GetDocumentStream( SdrDocumentStreamInfo& rStreamInfo ) const;
+
// Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln.
void BurnInStyleSheetAttributes();
+
// Wer sich von SdrPage ableitet muss sich auch von SdrModel ableiten
// und diese beiden VM AllocPage() und AllocModel() ueberladen...
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual SdrPage* AllocPage(bool bMasterPage);
virtual SdrModel* AllocModel() const;
// Aenderungen an den Layern setzen das Modified-Flag und broadcasten am Model!
- const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
- SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
+ const SdrLayerAdmin& GetModelLayerAdmin() const { return *mpModelLayerAdmin; }
+ SdrLayerAdmin& GetModelLayerAdmin() { return *mpModelLayerAdmin; }
- const SfxItemPool& GetItemPool() const { return *pItemPool; }
- SfxItemPool& GetItemPool() { return *pItemPool; }
+ const SfxItemPool& GetItemPool() const { return *mpItemPool; }
+ SfxItemPool& GetItemPool() { return *mpItemPool; }
- SdrOutliner& GetDrawOutliner(const SdrTextObj* pObj=NULL) const;
+ SdrOutliner& GetDrawOutliner(const SdrTextObj* pObj = 0) const;
/** returns a new created and non shared outliner.
The outliner will not get updated when the SdrModel is changed.
*/
- boost::shared_ptr< SdrOutliner > CreateDrawOutliner(const SdrTextObj* pObj=NULL);
+ boost::shared_ptr< SdrOutliner > CreateDrawOutliner(const SdrTextObj* pObj = 0);
+
+ const SdrTextObj* GetFormattingTextObj() const;
- SdrOutliner& GetHitTestOutliner() const { return *pHitTestOutliner; }
- const SdrTextObj* GetFormattingTextObj() const;
// Die TextDefaults (Font,Hoehe,Farbe) in ein Set putten
- void SetTextDefaults() const;
- static void SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt );
+ static void SetTextDefaults(SfxItemPool* pItemPool, sal_uInt32 nDefaultFontHeight);
// ReferenzDevice fuer die EditEngine
- void SetRefDevice(OutputDevice* pDev);
- OutputDevice* GetRefDevice() const { return pRefOutDev; }
- // Wenn ein neuer MapMode am RefDevice gesetzt wird o.ae.
- void RefDeviceChanged(); // noch nicht implementiert
- // Default-Schrifthoehe in logischen Einheiten
- void SetDefaultFontHeight(sal_uIntPtr nVal);
- sal_uIntPtr GetDefaultFontHeight() const { return nDefTextHgt; }
- // Default-Tabulatorweite fuer die EditEngine
- void SetDefaultTabulator(sal_uInt16 nVal);
- sal_uInt16 GetDefaultTabulator() const { return nDefaultTabulator; }
+ void SetReferenceDevice(OutputDevice* pDev);
+ OutputDevice* GetReferenceDevice() const { return mpReferenceOutputDevice; }
- // Der DefaultStyleSheet wird jedem Zeichenobjekt verbraten das in diesem
- // Model eingefuegt wird und kein StyleSheet gesetzt hat.
- SfxStyleSheet* GetDefaultStyleSheet() const { return pDefaultStyleSheet; }
- void SetDefaultStyleSheet(SfxStyleSheet* pDefSS) { pDefaultStyleSheet = pDefSS; }
+ // Default-Schrifthoehe in logischen Einheiten
+ void SetDefaultFontHeight(sal_uInt32 nVal);
+ sal_uInt32 GetDefaultFontHeight() const { return mnDefaultFontHeight; }
- // #119287# default StyleSheet for SdrGrafObj and SdrOle2Obj
- SfxStyleSheet* GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj() const { return mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; }
- void SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(SfxStyleSheet* pDefSS) { mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj = pDefSS; }
+ // Default-Tabulatorweite fuer die EditEngine
+ void SetDefaultTabulator(sal_uInt16 nVal);
+ sal_uInt16 GetDefaultTabulator() const { return mnDefaultTabulator; }
- sfx2::LinkManager* GetLinkManager() { return pLinkManager; }
- void SetLinkManager( sfx2::LinkManager* pLinkMgr ) { pLinkManager = pLinkMgr; }
+ sfx2::LinkManager* GetLinkManager() { return mpLinkManager; }
+ void SetLinkManager(sfx2::LinkManager* pLinkMgr) { if(mpLinkManager != pLinkMgr) mpLinkManager = pLinkMgr; }
- ::comphelper::IEmbeddedHelper* GetPersist() const { return m_pEmbeddedHelper; }
- void ClearPersist() { m_pEmbeddedHelper = 0; }
- void SetPersist( ::comphelper::IEmbeddedHelper *p ) { m_pEmbeddedHelper = p; }
+ ::comphelper::IEmbeddedHelper* GetPersist() const { return m_pEmbeddedHelper; }
+ void ClearPersist() { m_pEmbeddedHelper = 0; }
+ void SetPersist( ::comphelper::IEmbeddedHelper *p ) { m_pEmbeddedHelper = p; }
// Masseinheit fuer die Zeichenkoordinaten.
// Default ist 1 logische Einheit = 1/100mm (Unit=MAP_100TH_MM, Fract=(1,1)).
@@ -426,98 +347,52 @@ public:
// (PS: Lichtjahre sind somit also nicht darstellbar).
// Die Skalierungseinheit wird benoetigt, damit die Engine das Clipboard
// mit den richtigen Groessen beliefern kann.
- MapUnit GetScaleUnit() const { return eObjUnit; }
- void SetScaleUnit(MapUnit eMap);
- const Fraction& GetScaleFraction() const { return aObjUnit; }
- void SetScaleFraction(const Fraction& rFrac);
- // Beides gleichzeitig setzen ist etwas performanter
- void SetScaleUnit(MapUnit eMap, const Fraction& rFrac);
+ MapUnit GetExchangeObjectUnit() const { return meExchangeObjectUnit; }
+ void SetExchangeObjectUnit(MapUnit eMap);
+ const Fraction& GetExchangeObjectScale() const { return maExchangeObjectScale; }
+ void SetExchangeObjectScale(const Fraction& rFrac);
// Maximale Groesse z.B. fuer Autogrowing-Texte
- const Size& GetMaxObjSize() const { return aMaxObjSize; }
- void SetMaxObjSize(const Size& rSiz) { aMaxObjSize=rSiz; }
+ const basegfx::B2DVector& GetMaxObjectScale() const { return maMaxObjectScale; }
+ void SetMaxObjectScale(const basegfx::B2DVector& rSiz) { if(!maMaxObjectScale.equal(rSiz)) maMaxObjectScale = rSiz; }
// Damit die View! in der Statuszeile vernuenftige Zahlen anzeigen kann:
// Default ist mm.
- void SetUIUnit(FieldUnit eUnit);
- FieldUnit GetUIUnit() const { return eUIUnit; }
+ void SetUIUnit(FieldUnit eUnit);
+ FieldUnit GetUIUnit() const { return meUIUnit; }
+
// Der Masstab der Zeichnung. Default 1/1.
- void SetUIScale(const Fraction& rScale);
- const Fraction& GetUIScale() const { return aUIScale; }
- // Beides gleichzeitig setzen ist etwas performanter
- void SetUIUnit(FieldUnit eUnit, const Fraction& rScale);
-
- const Fraction& GetUIUnitFact() const { return aUIUnitFact; }
- const String& GetUIUnitStr() const { return aUIUnitStr; }
- int GetUIUnitKomma() const { return nUIUnitKomma; }
- FASTBOOL IsUIOnlyKomma() const { return bUIOnlyKomma; }
-
- static void TakeUnitStr(FieldUnit eUnit, String& rStr);
- void TakeMetricStr(long nVal, String& rStr, FASTBOOL bNoUnitChars=sal_False, sal_Int32 nNumDigits = -1) const;
- void TakeWinkStr(long nWink, String& rStr, FASTBOOL bNoDegChar=sal_False) const;
- void TakePercentStr(const Fraction& rVal, String& rStr, FASTBOOL bNoPercentChar=sal_False) const;
-
- // RecalcPageNums wird idR. nur von der Page gerufen.
- FASTBOOL IsPagNumsDirty() const { return bPagNumsDirty; };
- FASTBOOL IsMPgNumsDirty() const { return bMPgNumsDirty; };
- void RecalcPageNums(FASTBOOL bMaster);
+ void SetUIScale(const Fraction& rScale);
+ const Fraction& GetUIScale() const { return maUIScale; }
+
+ static void TakeUnitStr(FieldUnit eUnit, String& rStr);
+ void TakeMetricStr(long nVal, String& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
+ void TakeWinkStr(long nWink, String& rStr, bool bNoDegChar = false) const;
+ void TakePercentStr(const Fraction& rVal, String& rStr, bool bNoPercentChar = false) const;
+
// Nach dem Insert gehoert die Page dem SdrModel.
- virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
- virtual void DeletePage(sal_uInt16 nPgNum);
- // Remove bedeutet Eigentumsuebereignung an den Aufrufer (Gegenteil von Insert)
- virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
- virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
- const SdrPage* GetPage(sal_uInt16 nPgNum) const;
- SdrPage* GetPage(sal_uInt16 nPgNum);
- sal_uInt16 GetPageCount() const;
- // #109538#
- virtual void PageListChanged();
+ virtual void InsertPage(SdrPage* pPage, sal_uInt32 nPos = 0xffffffff);
+ virtual void DeletePage(sal_uInt32 nPgNum);
+ virtual SdrPage* RemovePage(sal_uInt32 nPgNum);
+ virtual void MovePage(sal_uInt32 nPgNum, sal_uInt32 nNewPos);
+ SdrPage* GetPage(sal_uInt32 nPgNum) const;
+ sal_uInt32 GetPageCount() const { return maPageVector.size(); }
// Masterpages
- virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
- virtual void DeleteMasterPage(sal_uInt16 nPgNum);
- // Remove bedeutet Eigentumsuebereignung an den Aufrufer (Gegenteil von Insert)
- virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
- virtual void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
- const SdrPage* GetMasterPage(sal_uInt16 nPgNum) const;
- SdrPage* GetMasterPage(sal_uInt16 nPgNum);
- sal_uInt16 GetMasterPageCount() const;
- // #109538#
- virtual void MasterPageListChanged();
+ virtual void InsertMasterPage(SdrPage* pPage, sal_uInt32 nPos = 0xffffffff);
+ virtual void DeleteMasterPage(sal_uInt32 nPgNum);
+ virtual SdrPage* RemoveMasterPage(sal_uInt32 nPgNum);
+ virtual void MoveMasterPage(sal_uInt32 nPgNum, sal_uInt32 nNewPos);
+ SdrPage* GetMasterPage(sal_uInt32 nPgNum) const;
+ sal_uInt32 GetMasterPageCount() const { return maMasterPageVector.size(); }
// Modified-Flag. Wird automatisch gesetzt, wenn an den Pages oder
// Zeichenobjekten was geaendert wird. Zuruecksetzen muss man es
// jedoch selbst (z.B. bei Save() ...).
- sal_Bool IsChanged() const { return mbChanged; }
- virtual void SetChanged(sal_Bool bFlg = sal_True);
-
- // PageNotValid bedeutet, dass das Model lediglich Objekte traegt die zwar
- // auf einer Page verankert sind, die Page aber nicht gueltig ist. Diese
- // Kennzeichnung wird fuers Clipboard/Drag&Drop benoetigt.
- FASTBOOL IsPageNotValid() const { return bPageNotValid; }
- void SetPageNotValid(FASTBOOL bJa=sal_True) { bPageNotValid=bJa; }
-
- // Schaltet man dieses Flag auf sal_True, so werden Grafikobjekte
- // portabel gespeichert. Es findet dann beim Speichern ggf.
- // eine implizite Wandlung von Metafiles statt.
- // Default=FALSE. Flag ist nicht persistent.
- FASTBOOL IsSavePortable() const { return bSavePortable; }
- void SetSavePortable(FASTBOOL bJa=sal_True) { bSavePortable=bJa; }
-
- // Schaltet man dieses Flag auf sal_True, so werden
- // Pixelobjekte (stark) komprimiert gespeichert.
- // Default=FALSE. Flag ist nicht persistent.
- FASTBOOL IsSaveCompressed() const { return bSaveCompressed; }
- void SetSaveCompressed(FASTBOOL bJa=sal_True) { bSaveCompressed=bJa; }
-
- // Schaltet man dieses Flag auf sal_True, so werden
- // Grafikobjekte mit gesetztem Native-Link
- // native gespeichert.
- // Default=FALSE. Flag ist nicht persistent.
- FASTBOOL IsSaveNative() const { return bSaveNative; }
- void SetSaveNative(FASTBOOL bJa=sal_True) { bSaveNative=bJa; }
-
- // Schaltet man dieses Flag auf sal_True, so werden die Grafiken
+ bool IsChanged() const { return mbChanged; }
+ virtual void SetChanged(bool bFlg = true);
+
+ // Schaltet man dieses Flag auf true, so werden die Grafiken
// von Grafikobjekten:
// - beim Laden eines Dokuments nicht sofort mitgeladen,
// sondern erst wenn sie gebraucht (z.B. angezeigt) werden.
@@ -525,65 +400,49 @@ public:
// nicht benoetigt werden.
// Damit das funktioniert, muss die virtuelle Methode
// GetDocumentStream() ueberladen werden.
- // Default=FALSE. Flag ist nicht persistent.
- FASTBOOL IsSwapGraphics() const { return bSwapGraphics; }
- void SetSwapGraphics(FASTBOOL bJa=sal_True);
- void SetSwapGraphicsMode(sal_uIntPtr nMode) { nSwapGraphicsMode = nMode; }
- sal_uIntPtr GetSwapGraphicsMode() const { return nSwapGraphicsMode; }
-
- FASTBOOL IsSaveOLEPreview() const { return bSaveOLEPreview; }
- void SetSaveOLEPreview( FASTBOOL bSet) { bSaveOLEPreview = bSet; }
-
- // Damit die Bildschirmausgabe von Bitmaps (insbesondere bei gedrehten)
- // etwas schneller wird, werden sie gecachet. Diesen Cache kann man mit
- // diesem Flag ein-/ausschalten. Beim naechsten Paint wird an den Objekten
- // dann ggf. ein Image gemerkt bzw. freigegeben. Wandert ein Bitmapobjekt
- // in's Undo, so wird der Cache fuer dieses Objekt sofort ausgeschaltet
- // (Speicher sparen).
- // Default=Cache eingeschaltet. Flag ist nicht persistent.
- FASTBOOL IsBitmapCaching() const { return !bNoBitmapCaching; }
- void SetBitmapCaching(FASTBOOL bJa=sal_True) { bNoBitmapCaching=!bJa; }
-
- // Defaultmaessig (sal_False) kann man Textrahmen ohne Fuellung durch
+ // Default=false. Flag ist nicht persistent.
+ bool IsSwapGraphics() const { return mbSwapGraphics; }
+ void SetSwapGraphics(bool bSwap = true) { if(mbSwapGraphics != bSwap) mbSwapGraphics = bSwap; }
+ void SetSwapGraphicsMode(sal_uInt32 nMode) { if(mnSwapGraphicsMode != nMode) mnSwapGraphicsMode = nMode; }
+ sal_uInt32 GetSwapGraphicsMode() const { return mnSwapGraphicsMode; }
+
+ // Defaultmaessig (false) kann man Textrahmen ohne Fuellung durch
// Mausklick selektieren. Nach Aktivierung dieses Flags trifft man sie
// nur noch in dem Bereich, wo sich auch tatsaechlich Text befindet.
- FASTBOOL IsPickThroughTransparentTextFrames() const { return bTransparentTextFrames; }
- void SetPickThroughTransparentTextFrames(FASTBOOL bOn) { bTransparentTextFrames=bOn; }
-
- // Darf denn das Model ueberhaupt veraendert werden?
- // Wird nur von den Possibility-Methoden der View ausgewerdet.
- // Direkte Manipulationen am Model, ... berueksichtigen dieses Flag nicht.
- // Sollte ueberladen werden und entsprechend des ReadOnly-Status des Files
- // sal_True oder sal_False liefern (Methode wird oeffters gerufen, also ein Flag
- // verwenden!).
- virtual FASTBOOL IsReadOnly() const;
- virtual void SetReadOnly(FASTBOOL bYes);
+ bool IsPickThroughTransparentTextFrames() const { return mbPickThroughTransparentTextFrames; }
+ void SetPickThroughTransparentTextFrames(bool bOn) { if(mbPickThroughTransparentTextFrames != bOn) mbPickThroughTransparentTextFrames = bOn; }
+
+ // is the model changeable at all?
+ virtual bool IsReadOnly() const;
+ virtual void SetReadOnly(bool bYes);
// Vermischen zweier SdrModel. Zu beachten sei, dass rSourceModel nicht
// const ist. Die Pages werden beim einfuegen nicht kopiert, sondern gemoved.
// rSourceModel ist anschliessend u.U. weitgehend leer.
// nFirstPageNum,nLastPageNum: Die aus rSourceModel zu uebernehmenden Seiten
// nDestPos..................: Einfuegeposition
- // bMergeMasterPages.........: sal_True =benoetigte MasterPages werden aus
+ // bMergeMasterPages.........: true =benoetigte MasterPages werden aus
// rSourceModel ebenfalls uebernommen
- // sal_False=Die MasterPageDescriptoren der Seiten
+ // false=Die MasterPageDescriptoren der Seiten
// aus rSourceModel werden auf die
// vorhandenen MasterPages gemappt.
// bUndo.....................: Fuer das Merging wird eine UndoAction generiert.
// Undo ist nur fuer das ZielModel, nicht fuer
// rSourceModel.
- // bTreadSourceAsConst.......: sal_True=Das SourceModel wird nicht veraendert,.
+ // bTreadSourceAsConst.......: true=Das SourceModel wird nicht veraendert,.
// d.h die Seiten werden kopiert.
- virtual void Merge(SdrModel& rSourceModel,
- sal_uInt16 nFirstPageNum=0, sal_uInt16 nLastPageNum=0xFFFF,
- sal_uInt16 nDestPos=0xFFFF,
- FASTBOOL bMergeMasterPages=sal_False, FASTBOOL bAllMasterPages=sal_False,
- FASTBOOL bUndo=sal_True, FASTBOOL bTreadSourceAsConst=sal_False);
-
- // Ist wie Merge(SourceModel=DestModel,nFirst,nLast,nDest,sal_False,sal_False,bUndo,!bMoveNoCopy);
- void CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
- sal_uInt16 nDestPos,
- FASTBOOL bUndo=sal_True, FASTBOOL bMoveNoCopy=sal_False);
+ virtual void Merge(
+ SdrModel& rSourceModel,
+ sal_uInt32 nFirstPageNum = 0, sal_uInt32 nLastPageNum = 0xffffffff,
+ sal_uInt32 nDestPos = 0xffffffff,
+ bool bMergeMasterPages = false, bool bAllMasterPages = false,
+ bool bUndo = true, bool bTreadSourceAsConst = false);
+
+ // Ist wie Merge(SourceModel=DestModel,nFirst,nLast,nDest,false,false,bUndo,!bMoveNoCopy);
+ void CopyPages(
+ sal_uInt32 nFirstPageNum, sal_uInt32 nLastPageNum,
+ sal_uInt32 nDestPos,
+ bool bUndo = true, bool bMoveNoCopy = false);
// Mit BegUndo() / EndUndo() ist es moeglich beliebig viele UndoActions
// beliebig tief zu klammern. Als Kommentar der
@@ -593,14 +452,14 @@ public:
// generiert.
// Alle direkten Aktionen am SdrModel erzeugen keine UndoActions, die
// Aktionen an der SdrView dagegen generieren solche.
- void BegUndo(); // Undo-Klammerung auf
+ void BegUndo(); // Undo-Klammerung auf
void BegUndo(const String& rComment); // Undo-Klammerung auf
- void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE); // Undo-Klammerung auf
+ void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc = SDRREPFUNC_OBJ_NONE); // Undo-Klammerung auf
void BegUndo(SdrUndoGroup* pUndoGrp); // Undo-Klammerung auf
- void EndUndo(); // Undo-Klammerung zu
+ void EndUndo(); // Undo-Klammerung zu
void AddUndo(SdrUndoAction* pUndo);
- sal_uInt16 GetUndoBracketLevel() const { return nUndoLevel; }
- const SdrUndoGroup* GetAktUndoGroup() const { return pAktUndoGroup; }
+ bool IsLastEndUndo() const { return (1 == mnUndoLevel); }
+
// nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
void SetUndoComment(const String& rComment);
void SetUndoComment(const String& rComment, const String& rObjDescr);
@@ -608,27 +467,29 @@ public:
// Das Undo-Managment findet nur statt, wenn kein NotifyUndoAction-Handler
// gesetzt ist.
// Default ist 16. Minimaler MaxUndoActionCount ist 1!
- void SetMaxUndoActionCount(sal_uIntPtr nAnz);
- sal_uIntPtr GetMaxUndoActionCount() const { return nMaxUndoCount; }
+ void SetMaxUndoActionCount(sal_uInt32 nAnz);
+ sal_uInt32 GetMaxUndoActionCount() const { return mnMaxUndoCount; }
void ClearUndoBuffer();
+
// UndoAction(0) ist die aktuelle (also die zuletzt eingegangene)
- sal_uIntPtr GetUndoActionCount() const { return pUndoStack!=NULL ? pUndoStack->Count() : 0; }
- const SfxUndoAction* GetUndoAction(sal_uIntPtr nNum) const { return (SfxUndoAction*)(pUndoStack!=NULL ? pUndoStack->GetObject(nNum) : NULL); }
+ sal_uInt32 GetUndoActionCount() const { return mpUndoStack ? mpUndoStack->size() : 0; }
+ const SfxUndoAction* GetUndoAction(sal_uInt32 nNum) const;
+
// RedoAction(0) ist die aktuelle (also die des letzten Undo)
- sal_uIntPtr GetRedoActionCount() const { return pRedoStack!=NULL ? pRedoStack->Count() : 0; }
- const SfxUndoAction* GetRedoAction(sal_uIntPtr nNum) const { return (SfxUndoAction*)(pRedoStack!=NULL ? pRedoStack->GetObject(nNum) : NULL); }
+ sal_uInt32 GetRedoActionCount() const { return mpRedoStack ? mpRedoStack->size() : 0; }
+ const SfxUndoAction* GetRedoAction(sal_uInt32 nNum) const;
- FASTBOOL Undo();
- FASTBOOL Redo();
- FASTBOOL Repeat(SfxRepeatTarget&);
+ bool Undo();
+ bool Redo();
+ bool Repeat(SfxRepeatTarget&);
// Hier kann die Applikation einen Handler setzen, der die auflaufenden
// UndoActions einsammelt. Der Handler hat folgendes Aussehen:
// void __EXPORT NotifyUndoActionHdl(SfxUndoAction* pUndoAction);
// Beim Aufruf des Handlers findet eine Eigentumsuebereignung statt; die
// UndoAction gehoert somit dem Handler, nicht mehr dem SdrModel.
- void SetNotifyUndoActionHdl(const Link& rLink) { aUndoLink=rLink; }
- const Link& GetNotifyUndoActionHdl() const { return aUndoLink; }
+ void SetNotifyUndoActionHdl(const Link& rLink) { maUndoLink = rLink; }
+ const Link& GetNotifyUndoActionHdl() const { return maUndoLink; }
/** application can set it's own undo manager, BegUndo, EndUndo and AddUndoAction
calls are routet to this interface if given */
@@ -644,92 +505,66 @@ public:
undo actions for this model. */
SdrUndoFactory& GetSdrUndoFactory() const;
- // Hier kann man einen Handler setzen der beim Streamen mehrfach gerufen
- // wird und ungefaehre Auskunft ueber den Fortschreitungszustand der
- // Funktion gibt. Der Handler muss folgendes Aussehen haben:
- // void __EXPORT class::IOProgressHdl(const sal_uInt16& nPercent);
- // Der erste Aufruf des Handlers erfolgt grundsaetzlich mit 0, der letzte
- // mit 100. Dazwischen erfolgen maximal 99 Aufrufe mit Werten 1...99.
- // Man kann also durchaus bei 0 den Progressbar Initiallisieren und bei
- // 100 wieder schliessen. Zu beachten sei, dass der Handler auch gerufen
- // wird, wenn die App Draw-Daten im officeweiten Draw-Exchange-Format
- // bereitstellt, denn dies geschieht durch streamen in einen MemoryStream.
- void SetIOProgressHdl(const Link& rLink) { aIOProgressLink=rLink; }
- const Link& GetIOProgressHdl() const { return aIOProgressLink; }
-
// Zugriffsmethoden fuer Paletten, Listen und Tabellen
void SetColorTable(XColorTable* pTable) ;
- XColorTable* GetColorTable() const { return pColorTable; }
+ XColorTable* GetColorTable() const { return mpColorTable; }
void SetDashList(XDashList* pList) ;
- XDashList* GetDashList() const { return pDashList; }
+ XDashList* GetDashList() const { return mpDashList; }
void SetLineEndList(XLineEndList* pList) ;
- XLineEndList* GetLineEndList() const { return pLineEndList; }
+ XLineEndList* GetLineEndList() const { return mpLineEndList; }
void SetHatchList(XHatchList* pList) ;
- XHatchList* GetHatchList() const { return pHatchList; }
+ XHatchList* GetHatchList() const { return mpHatchList; }
void SetGradientList(XGradientList* pList) ;
- XGradientList* GetGradientList() const { return pGradientList; }
+ XGradientList* GetGradientList() const { return mpGradientList; }
void SetBitmapList(XBitmapList* pList) ;
- XBitmapList* GetBitmapList() const { return pBitmapList; }
+ XBitmapList* GetBitmapList() const { return mpBitmapList; }
// Der StyleSheetPool wird der DrawingEngine nur bekanntgemacht.
// Zu loeschen hat ihn schliesslich der, der ihn auch konstruiert hat.
- SfxStyleSheetBasePool* GetStyleSheetPool() const { return mxStyleSheetPool.get(); }
- void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { mxStyleSheetPool=pPool; }
+ SfxStyleSheetBasePool* GetStyleSheetPool() const { return mxStyleSheetPool.get(); }
+ void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { if(mxStyleSheetPool != pPool) mxStyleSheetPool = pPool; }
- // Diese Methode fuert einen Konsistenzcheck auf die Struktur des Models
- // durch. Geprueft wird insbesondere die Verkettung von Verschachtelten
- // Gruppenobjekten, aber auch Stati wie bInserted sowie Model* und Page*
- // der Objects, SubLists und Pages. Bei korrekter Struktur liefert die
- // Methode sal_True, andernfalls FALSE.
- // Dieser Check steht nur zur Verfuegung, wenn die Engine mit DBG_UTIL
- // uebersetzt wurde. Andernfalls liefert die Methode immer TRUE. (ni)
- FASTBOOL CheckConsistence() const;
+ // Der DefaultStyleSheet wird jedem Zeichenobjekt verbraten das in diesem
+ // Model eingefuegt wird und kein StyleSheet gesetzt hat.
+ SfxStyleSheet* GetDefaultStyleSheet() const { return mpDefaultStyleSheet; }
+ void SetDefaultStyleSheet(SfxStyleSheet* pDefSS) { if(mpDefaultStyleSheet != pDefSS) mpDefaultStyleSheet = pDefSS; }
- void SetStarDrawPreviewMode(sal_Bool bPreview);
- sal_Bool IsStarDrawPreviewMode() { return bStarDrawPreviewMode; }
+ // #119287# default StyleSheet for SdrGrafObj and SdrOle2Obj
+ SfxStyleSheet* GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj() const { return mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; }
+ void SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(SfxStyleSheet* pDefSS) { mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj = pDefSS; }
- SotStorage* GetModelStorage() const { return pModelStorage; }
- void SetModelStorage( SotStorage* pStor ) { pModelStorage = pStor; }
+ void SetStarDrawPreviewMode(bool bPreview);
+ bool IsStarDrawPreviewMode() { return mbStarDrawPreviewMode; }
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoModel();
void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel );
// these functions are used by the api to disable repaints during a
// set of api calls.
- sal_Bool isLocked() const { return (sal_Bool)mbModelLocked; }
- void setLock( sal_Bool bLock );
+ bool isLocked() const { return mbModelLocked; }
+ void setLock(bool bLock);
- void SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars );
+ void SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars );
vos::ORef<SvxForbiddenCharactersTable> GetForbiddenCharsTable() const;
void SetCharCompressType( sal_uInt16 nType );
sal_uInt16 GetCharCompressType() const { return mnCharCompressType; }
- void SetKernAsianPunctuation( sal_Bool bEnabled );
- sal_Bool IsKernAsianPunctuation() const { return (sal_Bool)mbKernAsianPunctuation; }
+ void SetKernAsianPunctuation(bool bEnabled);
+ bool IsKernAsianPunctuation() const { return mbKernAsianPunctuation; }
- void SetAddExtLeading( sal_Bool bEnabled );
- sal_Bool IsAddExtLeading() const { return (sal_Bool)mbAddExtLeading; }
+ void SetAddExtLeading(bool bEnabled);
+ bool IsAddExtLeading() const { return mbAddExtLeading; }
void ReformatAllTextObjects();
- FASTBOOL HasTransparentObjects( sal_Bool bCheckForAlphaChannel = sal_False ) const;
-
SdrOutliner* createOutliner( sal_uInt16 nOutlinerMode );
void disposeOutliner( SdrOutliner* pOutliner );
- sal_Bool IsWriter() const { return !bMyPool; }
-
/** returns the numbering type that is used to format page fields in drawing shapes */
virtual SvxNumType GetPageNumType() const;
- /** copies the items from the source set to the destination set. Both sets must have
- same ranges but can have different pools. If pNewModel is optional. If it is null,
- this model is used. */
-
- void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel );
-
- bool IsInDestruction() const;
+ bool IsInDestruction() const { return mbInDestruction; }
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId();
@@ -743,32 +578,22 @@ public:
also during the runtime of the Undo() and Redo() methods. */
bool IsUndoEnabled() const;
+ // init some pool defaults for DrawingLayer
void SetDrawingLayerPoolDefaults();
-};
-typedef tools::WeakReference< SdrModel > SdrModelWeakRef;
+ // old hack, not easily to remove. Formally used mbMyPool, changed to virtual bool,
+ // overloaded in SwDrawDocument
+ virtual bool IsWriter() const;
+
+ /// get all SdrViews registered at this SdrModel. Used for update purposes which
+ /// could/should not be needed but be automated. For the moment, offer this to
+ /// allow removal of SdrViewIter
+ ::std::set< SdrView* > getSdrViews() const;
+};
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDMODEL_HXX
-/* /////////////////////////////////////////////////////////////////////////////////////////////////
- +-----------+
- | SdrModel |
- +--+------+-+
- | +-----------+
- +----+-----+ |
- | ... | |
- +----+---+ +----+---+ +-----+--------+
- |SdrPage | |SdrPage | |SdrLayerAdmin |
- +---+----+ +-+--+--++ +---+-------+--+
- | | | | | +-------------------+
- +----+----+ +-----+-----+ +-------+-------+
- | ... | | ... | | ... |
-+---+---+ +---+---+ +----+----+ +----+----+ +-----+------+ +------+-----+
-|SdrObj | |SdrObj | |SdrLayer | |SdrLayer | |SdrLayerSet | |SdrLayerSet |
-+-------+ +-------+ +---------+ +---------+ +------------+ +------------+
-Die Klasse SdrModel ist der Kopf des Datenmodells der StarView Drawing-Engine.
-
-///////////////////////////////////////////////////////////////////////////////////////////////// */
-
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdmrkv.hxx b/svx/inc/svx/svdmrkv.hxx
index ce94026c23e9..46e3d7850512 100644
--- a/svx/inc/svx/svdmrkv.hxx
+++ b/svx/inc/svx/svdmrkv.hxx
@@ -24,15 +24,19 @@
#ifndef _SVDMRKV_HXX
#define _SVDMRKV_HXX
-#include <svx/svdmark.hxx>
#include <svx/svdhdl.hxx>
#include <svx/svdsnpv.hxx>
#include <svx/svdtypes.hxx>
+#include <svx/sdrselection.hxx>
#include "svx/svxdllapi.h"
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Predefines
+
+class ImplMarkingOverlay;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Defines
-//************************************************************
// folgendes ist noch nicht bzw. erst zum Teil implementiert:
#define SDRSEARCH_DEEP 0x0001 /* rekursiv in Gruppenobjekte hinein */
@@ -41,10 +45,9 @@
#define SDRSEARCH_TESTMARKABLE 0x0008 /* nur markierbare Objekte/Punkte/Handles/... */
#define SDRSEARCH_TESTMACRO 0x0010 /* Nur Objekte mit Macro */
#define SDRSEARCH_TESTTEXTEDIT 0x0020 /* Nur TextEdit-faehige Objekte */
-#define SDRSEARCH_WITHTEXT 0x0040 /* Nur Objekte mit Text */
-#define SDRSEARCH_TESTTEXTAREA 0x0080 /* Den Textbereich von Objekten mit Text (TextEditHit) */
-#define SDRSEARCH_BACKWARD 0x0100 /* Rueckwaertssuche */
-#define SDRSEARCH_NEXT 0x0200 /* Suche startet hinter dem uebergebenen Objekt/Punkt/... */
+//#define SDRSEARCH_WITHTEXT 0x0040 /* Nur Objekte mit Text */
+//#define SDRSEARCH_TESTTEXTAREA 0x0080 /* Den Textbereich von Objekten mit Text (TextEditHit) */
+//#define SDRSEARCH_BACKWARD 0x0100 /* Rueckwaertssuche */
#define SDRSEARCH_MARKED 0x0400 /* Nur markierte Objekte/Punkte/... */
#define SDRSEARCH_PASS2BOUND 0x0800 /* Wenn nix gefunden, dann neuer 2. Versuch mit BoundRectHit */
#define SDRSEARCH_PASS3NEAREST 0x1000 /* Wenn nix gefunden, dann neuer 3. Versuch mit NearestBoundRectHit */
@@ -57,284 +60,239 @@
#define SDRSEARCHPASS_DIRECT 0x0000 /* Objekt durch direkten Hit getroffen */
#define SDRSEARCHPASS_INACTIVELIST 0x0001 /* Obj auf der Page, nicht jedoch in der AktGroup (bei WHOLEPAGE) */
#define SDRSEARCHPASS_MASTERPAGE 0x0002 /* Objekt auf der MasterPage gefunden */
-#define SDRSEARCHPASS_BOUND 0x0010 /* Objekt erst beim Bound-Check gefunden */
-#define SDRSEARCHPASS_NEAREST 0x0020 /* Objekt erst beim Nearest-Check gefunden */
-
-enum SdrHitKind {SDRHIT_NONE, // Nicht getroffen, Schnaps gesoffen
- SDRHIT_OBJECT, // Treffer versenkt
- SDRHIT_BOUNDRECT, // Treffer am BoundRect
- SDRHIT_BOUNDTL, // Treffer am BoundRect TopLeft
- SDRHIT_BOUNDTC, // Treffer am BoundRect TopCenter
- SDRHIT_BOUNDTR, // Treffer am BoundRect TopRight
- SDRHIT_BOUNDCL, // Treffer am BoundRect CenterLeft
- SDRHIT_BOUNDCR, // Treffer am BoundRect CenterRight
- SDRHIT_BOUNDBL, // Treffer am BoundRect BottomLeft
- SDRHIT_BOUNDBC, // Treffer am BoundRect BottomCenter
- SDRHIT_BOUNDBR,/*,*/ // Treffer am BoundRect BottomRight
- /*SDRHIT_REFPOINT*/ // Referenzpunkt (Rotationsachse,Spiegelachse) getroffen
- // ab hier neu am 01-07-1996:
- SDRHIT_HANDLE, // Markierungshandle
- SDRHIT_HELPLINE, // Hilfslinie
- SDRHIT_GLUEPOINT, // Klebepunkt
- SDRHIT_TEXTEDIT, // Offene OutlinerView getroffen
- SDRHIT_TEXTEDITOBJ, // Objekt fuer SdrBeginTextEdit (Textbereich)
- SDRHIT_URLFIELD, // Feld im TextObj getroffen (wird gerade nicht editiert)
- SDRHIT_MACRO, // Objekt fuer BegMacroObj
- SDRHIT_MARKEDOBJECT, // Markiertes Objekt (z.B. zum Draggen)
- SDRHIT_UNMARKEDOBJECT, // nichtmarkiertes Objekt (z.B. zum markieren)
- SDRHIT_CELL}; // hit on a cell inside a table shape (outside of the cells text area)
-
-enum SdrViewEditMode {SDREDITMODE_EDIT, // Auch bekannt aus Pfeil- oder Zeigermodus
- SDREDITMODE_CREATE, // Objekterzeugungswerkzeug
- SDREDITMODE_GLUEPOINTEDIT}; // Klebepunkteditiermodus
-
-#define IMPSDR_MARKOBJDESCRIPTION 0x0000
+
+enum SdrHitKind // usage checked
+{
+ SDRHIT_NONE, // Nicht getroffen, Schnaps gesoffen
+ SDRHIT_OBJECT, // Treffer versenkt
+ SDRHIT_HANDLE, // Markierungshandle
+ SDRHIT_HELPLINE, // Hilfslinie
+ SDRHIT_GLUEPOINT, // Klebepunkt
+ SDRHIT_TEXTEDIT, // Offene OutlinerView getroffen
+ SDRHIT_TEXTEDITOBJ, // Objekt fuer SdrBeginTextEdit (Textbereich)
+ SDRHIT_URLFIELD, // Feld im TextObj getroffen (wird gerade nicht editiert)
+ SDRHIT_MACRO, // Objekt fuer BegMacroObj
+ SDRHIT_MARKEDOBJECT, // Markiertes Objekt (z.B. zum Draggen)
+ SDRHIT_UNMARKEDOBJECT, // nichtmarkiertes Objekt (z.B. zum markieren)
+ SDRHIT_CELL // hit on a cell inside a table shape (outside of the cells text area)
+};
+
+enum SdrViewEditMode // usage checked
+{
+ SDREDITMODE_EDIT, // Auch bekannt aus Pfeil- oder Zeigermodus
+ SDREDITMODE_CREATE, // Objekterzeugungswerkzeug
+ SDREDITMODE_GLUEPOINTEDIT // Klebepunkteditiermodus
+};
+
+// usage checked
#define IMPSDR_POINTSDESCRIPTION 0x0001
#define IMPSDR_GLUEPOINTSDESCRIPTION 0x0002
+#define FRAME_HANDLES_LIMIT (250)
////////////////////////////////////////////////////////////////////////////////////////////////////
+// new helpers for selection roundabouts
+
+SVX_DLLPUBLIC const String getSelectionDescription(const SdrObjectVector& rSdrObjectVector);
+void sortSdrObjectSelection(SdrObjectVector& rSdrObjectVector);
+::std::set< SdrEdgeObj*, sdr::selection::SelectionComparator > getAllConnectedEdges(const SdrObjectVector& rSdrObjectVector);
+::std::vector< SdrEdgeObj* > getAllSdrEdgeObjConnectedToSdrObjectVector(const SdrObjectVector& rSdrObjects, bool bContained);
+
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@ @@@@ @@@@@ @@ @@ @@ @@ @@ @@@@@ @@ @@
-// @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@@@@ @@@@@@ @@@@@ @@@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-class ImplMarkingOverlay;
class SVX_DLLPUBLIC SdrMarkView : public SdrSnapView
{
- friend class SdrPageView;
-
- // #114409#-3 Migrate selections
+private:
ImplMarkingOverlay* mpMarkObjOverlay;
ImplMarkingOverlay* mpMarkPointsOverlay;
ImplMarkingOverlay* mpMarkGluePointsOverlay;
+ SVX_DLLPRIVATE void impCreatePointRanges() const;
+
protected:
- SdrObject* pMarkedObj; // Wenn nur ein Objekt markiert ist.
- SdrPageView* pMarkedPV; // Wenn alle markierten Objekt auf derselben PageView liegen.
-
- Point aRef1; // Persistent - Drehmittelpunkt/Spiegelachse
- Point aRef2; // Persistent
- Point aLastCrookCenter; // Persistent
- SdrHdlList aHdl;
- sdr::ViewSelection* mpSdrViewSelection;
-
- Rectangle aMarkedObjRect;
- Rectangle aMarkedPointsRect;
- Rectangle aMarkedGluePointsRect;
-
- sal_uInt16 nFrameHandlesLimit;
- sal_uIntPtr mnInsPointNum; // Nummer des InsPoint
- sal_uIntPtr nMarkableObjCount;
-
- SdrDragMode eDragMode; // Persistent
- SdrViewEditMode eEditMode; // Persistent
- SdrViewEditMode eEditMode0; // Persistent
-
- //HMHunsigned bHdlShown : 1;
- unsigned bRefHdlShownOnly : 1; // Spiegelachse waerend Dragging (ni)
- unsigned bDesignMode : 1; // DesignMode fuer SdrUnoObj
- unsigned bForceFrameHandles : 1; // Persistent - FrameDrag auch bei Einzelobjekten
- unsigned bPlusHdlAlways : 1; // Persistent
- unsigned bMarkHdlWhenTextEdit : 1; // Persistent, default=FALSE
- unsigned bInsPolyPoint : 1; // z.Zt InsPolyPointDragging
- unsigned bMarkedObjRectDirty : 1;
- unsigned bMrkPntDirty : 1;
- unsigned bMarkedPointsRectsDirty : 1;
- unsigned bMarkableObjCountDirty : 1;
-
- // flag to completely disable handles at the view
- unsigned mbMarkHandlesHidden : 1;
+ basegfx::B2DPoint maRef1; // Persistent - Drehmittelpunkt/Spiegelachse
+ basegfx::B2DPoint maRef2; // Persistent
+ basegfx::B2DPoint maLastCrookCenter; // Persistent
+
+ SdrHdlList maViewHandleList;
private:
- SVX_DLLPRIVATE void ImpClearVars();
- SVX_DLLPRIVATE void ImpSetPointsRects() const;
- void UndirtyMrkPnt() const;
+ // new selection abstraction. Private to guarantee isolation
+ sdr::selection::Selection maSelection;
protected:
- virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- virtual void ModelHasChanged(); // Wird von der PaintView gerufen
- virtual void SetMarkHandles(); // aHdl (Liste der Handles) fuellen
- virtual void SetMarkRects(); // Rects an den PageViews
- virtual void CheckMarked(); // MarkList nach Del und Lock Layer durchsuchen...
+ basegfx::B2DRange maMarkedPointRange;
+ basegfx::B2DRange maMarkedGluePointRange;
+
+ sal_uInt32 mnInsPointNum; // Nummer des InsPoint
+
+ SdrDragMode meViewDragMode; // Persistent
+ SdrViewEditMode meViewEditMode; // Persistent
+
+ bool mbDesignMode : 1; // DesignMode fuer SdrUnoObj
+ bool mbForceFrameHandles : 1; // Persistent - FrameDrag auch bei Einzelobjekten
+ bool mbPlusHdlAlways : 1; // Persistent
+ bool mbInsPolyPoint : 1; // z.Zt InsPolyPointDragging
+
virtual void AddDragModeHdl(SdrDragMode eMode);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
// add custom handles (used by other apps, e.g. AnchorPos)
virtual void AddCustomHdl();
-
void ForceRefToMarked();
- void ForceUndirtyMrkPnt() const { if (bMrkPntDirty) UndirtyMrkPnt(); }
- //HMHvoid ImpShowMarkHdl(bool bNoRefHdl);
- virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay) const;
- virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const;
- sal_Bool ImpIsFrameHandles() const;
- void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0, sal_uInt16 nOpt=0) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, sal_uInt32 nOptions, const SetOfByte* pMVisLay) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObjList* pOL, sal_uInt32 nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const;
+ bool ImpIsFrameHandles() const;
// Macht aus einer Winkelangabe in 1/100deg einen String inkl. Grad-Zeichen
- sal_Bool ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, sal_Bool bUnmark);
- virtual sal_Bool MarkPoints(const Rectangle* pRect, sal_Bool bUnmark);
- sal_Bool MarkGluePoints(const Rectangle* pRect, sal_Bool bUnmark);
+ bool ImpMarkPoint(SdrHdl* pHdl, bool bUnmark);
- void SetMoveOutside(sal_Bool bOn);
- sal_Bool IsMoveOutside() const;
+ void SetMoveOutside(bool bOn);
+ bool IsMoveOutside() const;
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrMarkView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrMarkView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrMarkView();
public:
- virtual sal_Bool IsAction() const;
- virtual void MovAction(const Point& rPnt);
+ void SetMarkHandles();
+
+ void MarkGluePoints(const basegfx::B2DRange* pRange, bool bUnmark);
+ virtual void MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark);
+ void TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal = 0, sal_uInt16 nOpt = 0) const;
+
+ virtual bool IsAction() const;
+ virtual void MovAction(const basegfx::B2DPoint& rPnt);
virtual void EndAction();
virtual void BckAction();
virtual void BrkAction();
- virtual void TakeActionRect(Rectangle& rRect) const;
+ virtual basegfx::B2DRange TakeActionRange() const;
- virtual void ClearPageView();
virtual void HideSdrPage();
- virtual sal_Bool IsObjMarkable(SdrObject* pObj, SdrPageView* pPV) const;
+ virtual bool IsObjMarkable(const SdrObject& rObj) const;
- // Liefert sal_True wenn Objekte, Punkte oder Klebepunkte durch Rahmenaufziehen
+ // Liefert true wenn Objekte, Punkte oder Klebepunkte durch Rahmenaufziehen
// selektiert werden (solange wie der Rahmen aufgezogen wird).
- sal_Bool IsMarking() const { return IsMarkObj() || IsMarkPoints() || IsMarkGluePoints(); }
+ bool IsMarking() const { return IsMarkObj() || IsMarkPoints() || IsMarkGluePoints(); }
// Objekte durch Aufziehen eines Selektionsrahmens markieren
- sal_Bool BegMarkObj(const Point& rPnt, sal_Bool bUnmark = sal_False);
- void MovMarkObj(const Point& rPnt);
- sal_Bool EndMarkObj();
+ bool BegMarkObj(const basegfx::B2DPoint& rPnt, bool bUnmark = false);
+ void MovMarkObj(const basegfx::B2DPoint& rPnt);
+ bool EndMarkObj();
void BrkMarkObj();
- sal_Bool IsMarkObj() const { return (0L != mpMarkObjOverlay); }
+ bool IsMarkObj() const { return (0 != mpMarkObjOverlay); }
// DragModes: SDRDRAG_CREATE,SDRDRAG_MOVE,SDRDRAG_RESIZE,SDRDRAG_ROTATE,SDRDRAG_MIRROR,SDRDRAG_SHEAR,SDRDRAG_CROOK
// Move==Resize
// Das Interface wird hier evtl noch geaendert wg. Ortho-Drag
void SetDragMode(SdrDragMode eMode);
- SdrDragMode GetDragMode() const { return eDragMode; }
- sal_Bool ChkDragMode(SdrDragMode eMode) const;
- void SetFrameHandles(sal_Bool bOn);
- sal_Bool IsFrameHandles() const { return bForceFrameHandles; }
-
- // Limit, ab wann implizit auf FrameHandles umgeschaltet wird. default=50.
- void SetFrameHandlesLimit(sal_uInt16 nAnz) { nFrameHandlesLimit=nAnz; }
- sal_uInt16 GetFrameHandlesLimit() const { return nFrameHandlesLimit; }
+ SdrDragMode GetDragMode() const { return meViewDragMode; }
+ bool ChkDragMode(SdrDragMode eMode) const;
+ void SetFrameHandles(bool bOn);
+ bool IsFrameHandles() const { return mbForceFrameHandles; }
- void SetEditMode(SdrViewEditMode eMode);
- SdrViewEditMode GetEditMode() const { return eEditMode; }
+ virtual void SetViewEditMode(SdrViewEditMode eMode);
+ SdrViewEditMode GetViewEditMode() const { return meViewEditMode; }
+ bool IsEditMode() const { return SDREDITMODE_EDIT == GetViewEditMode(); }
+ bool IsCreateMode() const { return SDREDITMODE_CREATE == GetViewEditMode(); }
+ bool IsGluePointEditMode() const { return SDREDITMODE_GLUEPOINTEDIT == GetViewEditMode(); }
- void SetEditMode(sal_Bool bOn=sal_True) { SetEditMode(bOn?SDREDITMODE_EDIT:SDREDITMODE_CREATE); }
- sal_Bool IsEditMode() const { return eEditMode==SDREDITMODE_EDIT; }
- void SetCreateMode(sal_Bool bOn=sal_True) { SetEditMode(bOn?SDREDITMODE_CREATE:SDREDITMODE_EDIT); }
- sal_Bool IsCreateMode() const { return eEditMode==SDREDITMODE_CREATE; }
- void SetGluePointEditMode(sal_Bool bOn=sal_True) { SetEditMode(bOn?SDREDITMODE_GLUEPOINTEDIT:eEditMode0); }
- sal_Bool IsGluePointEditMode() const { return eEditMode==SDREDITMODE_GLUEPOINTEDIT;; }
-
- void SetDesignMode(sal_Bool bOn=sal_True);
- sal_Bool IsDesignMode() const { return bDesignMode; }
-
- void SetFrameDragSingles(sal_Bool bOn=sal_True) { SetFrameHandles(bOn); }
- sal_Bool IsFrameDragSingles() const { return IsFrameHandles(); }
+ void SetDesignMode(bool bOn = true);
+ bool IsDesignMode() const { return mbDesignMode; }
// Feststellen, ob und wo ein Objekt bzw. ob ein Referenzpunkt
// (Rotationsmittelpunkt,Spiegelachse) getroffen wird (SW special).
- SdrHitKind PickSomething(const Point& rPnt, short nTol=-2) const;
- sal_Bool HasMarkableObj() const;
- sal_uIntPtr GetMarkableObjCount() const;
- //HMHvoid ShowMarkHdl(bool bNoRefHdl = false);
- //HMHvoid HideMarkHdl(bool bNoRefHdl = false);
- //HMHBOOL IsMarkHdlShown() const { return bHdlShown; }
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// migrate selections
-
-protected:
- // all available changing methods
- SdrMarkList& GetMarkedObjectListWriteAccess() { return mpSdrViewSelection->GetMarkedObjectListWriteAccess(); }
- void SetEdgesOfMarkedNodesDirty() { mpSdrViewSelection->SetEdgesOfMarkedNodesDirty(); }
-
-public:
- // all available const methods for read access to selection
- const SdrMarkList& GetMarkedObjectList() const { return mpSdrViewSelection->GetMarkedObjectList(); }
- sal_uIntPtr TryToFindMarkedObject(const SdrObject* pObj) const { return GetMarkedObjectList().FindObject(pObj); }
- SdrPageView* GetSdrPageViewOfMarkedByIndex(sal_uIntPtr nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetPageView(); }
- SdrMark* GetSdrMarkByIndex(sal_uIntPtr nNum) const { return GetMarkedObjectList().GetMark(nNum); }
- SdrObject* GetMarkedObjectByIndex(sal_uIntPtr nNum) const { return (GetMarkedObjectList().GetMark(nNum))->GetMarkedSdrObj(); }
- sal_uIntPtr GetMarkedObjectCount() const { return GetMarkedObjectList().GetMarkCount(); }
- void SortMarkedObjects() const { GetMarkedObjectList().ForceSort(); }
- sal_Bool AreObjectsMarked() const { return (0L != GetMarkedObjectList().GetMarkCount()); }
- String GetDescriptionOfMarkedObjects() const { return GetMarkedObjectList().GetMarkDescription(); }
- String GetDescriptionOfMarkedPoints() const { return GetMarkedObjectList().GetPointMarkDescription(); }
- String GetDescriptionOfMarkedGluePoints() const { return GetMarkedObjectList().GetGluePointMarkDescription(); }
- sal_Bool GetBoundRectFromMarkedObjects(SdrPageView* pPageView, Rectangle& rRect) const { return GetMarkedObjectList().TakeBoundRect(pPageView, rRect); }
- sal_Bool GetSnapRectFromMarkedObjects(SdrPageView* pPageView, Rectangle& rRect) const { return GetMarkedObjectList().TakeSnapRect(pPageView, rRect); }
-
- // Eine Liste aller an markierten Knoten gebundenen Kanten holen,
- // die selbst jedoch nicht markiert sind.
- const SdrMarkList& GetEdgesOfMarkedNodes() const { return mpSdrViewSelection->GetEdgesOfMarkedNodes(); }
- const SdrMarkList& GetMarkedEdgesOfMarkedNodes() const { return mpSdrViewSelection->GetMarkedEdgesOfMarkedNodes(); }
- const List& GetTransitiveHullOfMarkedObjects() const { return mpSdrViewSelection->GetAllMarkedObjects(); }
+ SdrHitKind PickSomething(const basegfx::B2DPoint& rPnt, double fTol = 2.0) const;
+ bool HasMarkableObj() const;
+ sal_uInt32 GetMarkableObjCount() const;
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+ // new interface to selection, a direct wrapper to sdr::selection::Selection
+
+ // selection const accesses
+ SdrObjectVector getSelectedSdrObjectVectorFromSdrMarkView() const { return maSelection.getVector(); }
+ SdrObject* getSelectedIfSingle() const { return maSelection.getSingle(); }
+ bool areSdrObjectsSelected() const { return !maSelection.empty(); }
+ sal_uInt32 getSelectedSdrObjectCount() const { return maSelection.size(); }
+ bool isSdrObjectSelected(const SdrObject& rObject) const { return maSelection.isSdrObject(rObject); }
+
+ // selection const accesses: possibility to ask for pending SelectionChange and to force it
+ bool isSelectionChangePending() const { return maSelection.isSelectionChangePending(); }
+ void forceSelectionChange() { maSelection.forceSelectionChange(); }
+
+ // selection const accesses: point selection
+ sdr::selection::Indices getSelectedPointsForSelectedSdrObject(const SdrObject& rObject) const { return maSelection.getIndicesForSdrObject(rObject, true); }
+ String getSelectedPointsDescription() const { return maSelection.getIndexDescription(true); }
+ bool arePointsSelected() const { return maSelection.hasIndices(true); }
+
+ // selection const accesses: gluepoint selection
+ sdr::selection::Indices getSelectedGluesForSelectedSdrObject(const SdrObject& rObject) const { return maSelection.getIndicesForSdrObject(rObject, false); }
+ String getSelectedGluesDescription() const { return maSelection.getIndexDescription(false); }
+ bool areGluesSelected() const { return maSelection.hasIndices(false); }
+
+ // selection changers. These will trigger a delayedSelectionChanged() which will
+ // on forceSelectionChange() or timer event trigger handleSelectionChange(). This will
+ // recreate e.g. the SdrHdl. This means that ALL code which works with SdrHdl and selection
+ // has to take care of working woith valid SdrHdl when changing the selection (!)
+ void removeSdrObjectFromSelection(const SdrObject& rObject) { maSelection.removeSdrObject(rObject); }
+ void addSdrObjectToSelection(const SdrObject& rObject) { maSelection.addSdrObject(rObject); }
+ void setSdrObjectSelection(const SdrObjectVector& rSdrObjectVector) { maSelection.setSdrObjects(rSdrObjectVector); }
+ void clearSdrObjectSelection() { maSelection.clear(); }
+
+ // selection changers for points
+ void setSelectedPointsForSelectedSdrObject(const SdrObject& rObject, const sdr::selection::Indices& rNew) { maSelection.setIndicesForSdrObject(rObject, rNew, true); }
+ void clearSelectedPointsForSelectedSdrObject(const SdrObject& rObject) { maSelection.clearIndicesForSdrObject(rObject, true); }
+
+ // selection changers for glues
+ void setSelectedGluesForSelectedSdrObject(const SdrObject& rObject, const sdr::selection::Indices& rNew) { maSelection.setIndicesForSdrObject(rObject, rNew, false); }
+ void clearSelectedGluesForSelectedSdrObject(const SdrObject& rObject) { maSelection.clearIndicesForSdrObject(rObject, false); }
+
+ // react on selection changes
+ virtual void handleSelectionChange();
////////////////////////////////////////////////////////////////////////////////////////////////////
-
// mechanism to complete disable handles at the view. Handles will be hidden and deleted
// when set, no new ones created, no interaction allowed. Handles will be recreated and shown
// when reset. Default is false.
- void hideMarkHandles();
- void showMarkHandles();
- bool areMarkHandlesHidden() const { return mbMarkHandlesHidden; }
-
- sal_Bool IsMarkedHit(const Point& rPnt, short nTol=-2) const { return IsMarkedObjHit(rPnt,nTol); }
- sal_Bool IsMarkedObjHit(const Point& rPnt, short nTol=-2) const;
+ bool IsMarkedObjHit(const basegfx::B2DPoint& rPnt, double fTol = 2.0) const;
// Pick: Unterstuetzte Optionen fuer nOptions sind SEARCH_NEXT, SEARCH_BACKWARD (ni)
- SdrHdl* PickHandle(const Point& rPnt, sal_uIntPtr nOptions=0, SdrHdl* pHdl0=NULL) const;
+ SdrHdl* PickHandle(const basegfx::B2DPoint& rPnt, sal_uInt32 nOptions = 0, SdrHdl* pHdl0 = 0) const;
// Pick: Unterstuetzte Optionen fuer nOptions sind:
// SDRSEARCH_DEEP SDRSEARCH_ALSOONMASTER SDRSEARCH_TESTMARKABLE SDRSEARCH_TESTTEXTEDIT
// SDRSEARCH_WITHTEXT SDRSEARCH_TESTTEXTAREA SDRSEARCH_BACKWARD SDRSEARCH_MARKED
// SDRSEARCH_WHOLEPAGE
- virtual sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions, SdrObject** ppRootObj, sal_uIntPtr* pnMarkNum=NULL, sal_uInt16* pnPassNum=NULL) const;
- virtual sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const;
- // sal_Bool PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
- sal_Bool MarkObj(const Point& rPnt, short nTol=-2, sal_Bool bToggle=sal_False, sal_Bool bDeep=sal_False);
+ virtual bool PickObj(const basegfx::B2DPoint& rPnt, double fTol, SdrObject*& rpObj, sal_uInt32 nOptions, SdrObject** ppRootObj, sal_uInt32* pnMarkNum = 0, sal_uInt16* pnPassNum = 0) const;
+ virtual bool PickObj(const basegfx::B2DPoint& rPnt, double fTol, SdrObject*& rpObj, sal_uInt32 nOptions = 0) const;
+ bool MarkObj(const basegfx::B2DPoint& rPnt, double fTol = 2.0, bool bToggle = false, bool bDeep = false);
// Pick: Unterstuetzte Optionen fuer nOptions sind SDRSEARCH_PASS2BOUND und SDRSEARCH_PASS3NEAREST
- sal_Bool PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr* pnMarkNum=NULL, sal_uIntPtr nOptions=0) const;
+ bool PickMarkedObj(const basegfx::B2DPoint& rPnt, SdrObject*& rpObj, sal_uInt32* pnMarkNum = 0, sal_uInt32 nOptions = 0) const;
// Sucht sich das Oberste der markierten Objekte (O1) und sucht von dort
// aus in Richtung nach Unten dann das erste nichtmarkierte Objekt (O2).
- // Bei Erfolg wird die Markierung von O1 entfernt, an O2 gesetzt und TRUE
- // returniert. Mit dem Parameter bPrev=sal_True geht die Suche genau in die
+ // Bei Erfolg wird die Markierung von O1 entfernt, an O2 gesetzt und true
+ // returniert. Mit dem Parameter bPrev=true geht die Suche genau in die
// andere Richtung.
- sal_Bool MarkNextObj(sal_Bool bPrev=sal_False);
+ bool MarkNextObj(bool bPrev = false);
// Sucht sich das Oberste der markierten Objekte (O1) das von rPnt/nTol
// getroffen wird und sucht von dort aus in Richtung nach Unten dann das
// erste nichtmarkierte Objekt (O2). Bei Erfolg wird die Markierung von
- // O1 entfernt, an O2 gesetzt und sal_True returniert.
- // Mit dem Parameter bPrev=sal_True geht die Suche genau in die andere Richtung.
- sal_Bool MarkNextObj(const Point& rPnt, short nTol=-2, sal_Bool bPrev=sal_False);
+ // O1 entfernt, an O2 gesetzt und true returniert.
+ // Mit dem Parameter bPrev=true geht die Suche genau in die andere Richtung.
+ bool MarkNextObj(const basegfx::B2DPoint& rPnt, double fTol = 2.0, bool bPrev = false);
// Alle Objekte innerhalb eines rechteckigen Bereichs markieren
// Markiert werden nur Objekte, die vollstaendig eingeschlossen sind.
- sal_Bool MarkObj(const Rectangle& rRect, sal_Bool bUnmark=sal_False);
- void MarkObj(SdrObject* pObj, SdrPageView* pPV, sal_Bool bUnmark=sal_False, sal_Bool bImpNoSetMarkHdl=sal_False);
- void MarkAllObj(SdrPageView* pPV=NULL); // pPage=NULL => alle angezeigten Seiten
- void UnmarkAllObj(SdrPageView* pPV=NULL); // pPage=NULL => alle angezeigten Seiten
+ bool MarkObj(const basegfx::B2DRange& rRange, bool bUnmark = false);
+ void MarkObj(SdrObject& rObj, bool bUnmark = false);
+ void MarkAllObj();
+ void UnmarkAllObj();
// Diese Funktion kostet etwas Zeit, da die MarkList durchsucht werden muss.
- sal_Bool IsObjMarked(SdrObject* pObj) const;
- // void MarkAll(SdrPageView* pPV=NULL) { MarkAllObj(pPV); } -> replace with inline
- void UnMarkAll(SdrPageView* pPV=NULL) { UnmarkAllObj(pPV); }
+ bool IsObjMarked(const SdrObject& rObj) const;
// Groesse der Markierungs-Handles abfragen/setzen. Angabe in Pixel.
// Der Wert ist als Kantenlaenge zu betrachten. Gerade Werte werden
@@ -349,72 +307,60 @@ public:
// Dazu muessen die Handles ggf. verkleinert dargestellt werden. Mit der
// MinMarkHdlSize kann man hierfuer eine Mindestgroesse angeben.
// Defaultwert ist 3, Mindestwert 3 Pixel.
- sal_Bool IsSolidMarkHdl() const { return aHdl.IsFineHdl(); }
- void SetSolidMarkHdl(sal_Bool bOn);
+ bool IsSolidMarkHdl() const { return maViewHandleList.IsFineHdl(); }
+ void SetSolidMarkHdl(bool bOn);
- virtual sal_Bool HasMarkablePoints() const;
- virtual sal_uIntPtr GetMarkablePointCount() const;
- virtual sal_Bool HasMarkedPoints() const;
- virtual sal_uIntPtr GetMarkedPointCount() const;
+ virtual bool HasMarkablePoints() const;
+ virtual sal_uInt32 GetMarkablePointCount() const;
+ virtual bool HasMarkedPoints() const;
+ virtual sal_uInt32 GetMarkedPointCount() const;
// Nicht alle Punkte lassen sich markieren:
- virtual sal_Bool IsPointMarkable(const SdrHdl& rHdl) const;
- virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
+ virtual bool IsPointMarkable(const SdrHdl& rHdl) const;
+ virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark = false);
/** should only be used from outside svx for special ui elements */
- sal_Bool MarkPointHelper(SdrHdl* pHdl, SdrMark* pMark, sal_Bool bUnmark);
+ bool MarkPointHelper(SdrHdl* pHdl, bool bUnmark);
// alle Punkte innerhalb dieses Rechtecks markieren (Viewkoordinaten)
- sal_Bool MarkPoints(const Rectangle& rRect, sal_Bool bUnmark=sal_False) { return MarkPoints(&rRect,bUnmark); }
- sal_Bool UnmarkPoint(SdrHdl& rHdl) { return MarkPoint(rHdl,sal_True); }
- sal_Bool UnMarkPoint(SdrHdl& rHdl) { return MarkPoint(rHdl,sal_True); }
- sal_Bool IsPointMarked(const SdrHdl& rHdl) const { ForceUndirtyMrkPnt(); return &rHdl!=NULL && rHdl.IsSelected(); }
- sal_Bool MarkAllPoints() { return MarkPoints(NULL,sal_False); }
- sal_Bool UnmarkAllPoints() { return MarkPoints(NULL,sal_True); }
- sal_Bool UnMarkAllPoints() { return MarkPoints(NULL,sal_True); }
+ bool IsPointMarked(const SdrHdl& rHdl) const { return &rHdl && rHdl.IsSelected(); }
// Sucht sich den ersten markierten Punkt (P1) und sucht von dort
// aus in den ersten nichtmarkierte Punkt (P2).
- // Bei Erfolg wird die Markierung von P1 entfernt, an P2 gesetzt und TRUE
- // returniert. Mit dem Parameter bPrev=sal_True geht die Suche genau in die
+ // Bei Erfolg wird die Markierung von P1 entfernt, an P2 gesetzt und true
+ // returniert. Mit dem Parameter bPrev=true geht die Suche genau in die
// andere Richtung.
- sal_Bool MarkNextPoint(sal_Bool bPrev=sal_False);
+// bool MarkNextPoint(bool bPrev = false);
// Sucht sich den ersten markierten Punkt (P1) das von rPnt
// getroffen wird und sucht von dort aus den
// ersten nichtmarkierten Punkt (P2). Bei Erfolg wird die Markierung von
- // P1 entfernt, an P2 gesetzt und sal_True returniert.
- // Mit dem Parameter bPrev=sal_True geht die Suche genau in die andere Richtung.
- sal_Bool MarkNextPoint(const Point& rPnt, sal_Bool bPrev=sal_False);
+ // P1 entfernt, an P2 gesetzt und true returniert.
+ // Mit dem Parameter bPrev=true geht die Suche genau in die andere Richtung.
+// bool MarkNextPoint(const basegfx::B2DPoint& rPnt, bool bPrev = false);
// Die Nummer des passenden Handles raussuchen. Nicht gefunden
// liefert CONTAINER_ENTRY_NOTFOUND.
- sal_uIntPtr GetHdlNum(SdrHdl* pHdl) const { return aHdl.GetHdlNum(pHdl); }
- SdrHdl* GetHdl(sal_uIntPtr nHdlNum) const { return aHdl.GetHdl(nHdlNum); }
- const SdrHdlList& GetHdlList() const { return aHdl; }
+ sal_uInt32 GetHdlNum(SdrHdl* pHdl) const { return maViewHandleList.GetHdlNum(pHdl); }
+ SdrHdl* GetHdlByIndex(sal_uInt32 nHdlNum) const { if(nHdlNum < maViewHandleList.GetHdlCount()) return maViewHandleList.GetHdlByIndex(nHdlNum); return 0; }
+ const SdrHdlList& GetHdlList() const { return maViewHandleList; }
// Selektionsrahmen fuer Punktmarkierung aufziehen.
- // Wird nur gestartet, wenn HasMarkablePoints() sal_True liefert.
- // sal_Bool BegMarkPoints(const Point& rPnt, OutputDevice* pOut);
- sal_Bool BegMarkPoints(const Point& rPnt, sal_Bool bUnmark = sal_False);
- void MovMarkPoints(const Point& rPnt);
- sal_Bool EndMarkPoints();
+ // Wird nur gestartet, wenn HasMarkablePoints() true liefert.
+ // bool BegMarkPoints(const Point& rPnt, OutputDevice* pOut);
+ bool BegMarkPoints(const basegfx::B2DPoint& rPnt, bool bUnmark = false);
+ void MovMarkPoints(const basegfx::B2DPoint& rPnt);
+ bool EndMarkPoints();
void BrkMarkPoints();
- sal_Bool IsMarkPoints() const { return (0L != mpMarkPointsOverlay); }
+ bool IsMarkPoints() const { return (0 != mpMarkPointsOverlay); }
// Zusatzhandles dauerhaft sichtbar schalten
- void SetPlusHandlesAlwaysVisible(sal_Bool bOn);
- sal_Bool IsPlusHandlesAlwaysVisible() const { return bPlusHdlAlways; }
-
- // Handles sichrbar waerend TextEdit (in doppelter Groesse)?
- // Persistent, default=FALSE
- void SetMarkHdlWhenTextEdit(sal_Bool bOn) { bMarkHdlWhenTextEdit=bOn; }
- sal_Bool IsMarkHdlWhenTextEdit() const { return bMarkHdlWhenTextEdit; }
+ void SetPlusHandlesAlwaysVisible(bool bOn);
+ bool IsPlusHandlesAlwaysVisible() const { return mbPlusHdlAlways; }
- sal_Bool HasMarkableGluePoints() const;
- sal_uIntPtr GetMarkableGluePointCount() const;
- sal_Bool HasMarkedGluePoints() const;
- sal_uIntPtr GetMarkedGluePointCount() const;
+ bool HasMarkableGluePoints() const;
+ sal_uInt32 GetMarkableGluePointCount() const;
+ sal_uInt32 GetMarkedGluePointCount() const;
// Ein Klebepunkt wird eindeutig identifiziert durch das SdrObject
// (dem er zugehoert) sowie einem sal_uInt16 nId (da jedes SdrObject je
@@ -428,108 +374,70 @@ public:
// Handleliste erneut berechnet. Alle vorher gemerkten SdrHdl* sind
// damit ungueltig, ebenso die Punkt-Id's!
// Pick: Unterstuetzte Optionen fuer nOptions sind SEARCH_NEXT, SEARCH_BACKWARD
- sal_Bool PickGluePoint(const Point& rPnt, SdrObject*& rpObj, sal_uInt16& rnId, SdrPageView*& rpPV, sal_uIntPtr nOptions=0) const;
- sal_Bool MarkGluePoint(const SdrObject* pObj, sal_uInt16 nId, const SdrPageView* pPV, sal_Bool bUnmark=sal_False);
- sal_Bool UnmarkGluePoint(const SdrObject* pObj, sal_uInt16 nId, const SdrPageView* pPV) { return MarkGluePoint(pObj,nId,pPV,sal_True); }
- sal_Bool IsGluePointMarked(const SdrObject* pObj, sal_uInt16 nId) const;
- sal_Bool UnmarkGluePoint(const SdrHdl& rHdl);
+ bool PickGluePoint(const basegfx::B2DPoint& rPnt, SdrObject*& rpObj, sal_uInt32& rnId, sal_uInt32 nOptions = 0) const;
+ bool MarkGluePoint(const SdrObject* pObj, sal_uInt32 nId, bool bUnmark = false);
+ bool IsGluePointMarked(const SdrObject& rObj, sal_uInt32 nId) const;
+ bool UnmarkGluePoint(const SdrHdl& rHdl);
// Hdl eines markierten GluePoints holen. Nicht markierte
// GluePoints haben keine Handles
- SdrHdl* GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) const;
- sal_Bool IsGluePoint(const SdrHdl& rHdl) const { return &rHdl!=NULL && rHdl.GetKind()==HDL_GLUE; }
-
- // alle Punkte innerhalb dieses Rechtecks markieren (Viewkoordinaten)
- sal_Bool MarkGluePoints(const Rectangle& rRect) { return MarkGluePoints(&rRect,sal_False); }
- sal_Bool UnmarkGluePoints(const Rectangle& rRect) { return MarkGluePoints(&rRect,sal_True); }
- sal_Bool MarkAllGluePoints() { return MarkGluePoints(NULL,sal_False); }
- sal_Bool UnmarkAllGluePoints() { return MarkGluePoints(NULL,sal_True); }
+ SdrHdl* GetGluePointHdl(const SdrObject* pObj, sal_uInt32 nId) const;
+ bool IsGluePoint(const SdrHdl& rHdl) const { return &rHdl && HDL_GLUE == rHdl.GetKind(); }
// Sucht sich den ersten markierten Klebepunkt (P1) und sucht von dort
// aus in den ersten nichtmarkierte Klebepunkt (P2).
- // Bei Erfolg wird die Markierung von P1 entfernt, an P2 gesetzt und TRUE
- // returniert. Mit dem Parameter bPrev=sal_True geht die Suche genau in die
+ // Bei Erfolg wird die Markierung von P1 entfernt, an P2 gesetzt und true
+ // returniert. Mit dem Parameter bPrev=true geht die Suche genau in die
// andere Richtung.
- sal_Bool MarkNextGluePoint(sal_Bool bPrev=sal_False);
+// bool MarkNextGluePoint(bool bPrev = false);
// Sucht sich den ersten markierten Klebepunkt (P1) das von rPnt
// getroffen wird und sucht von dort aus den
// ersten nichtmarkierten Klebepunkt (P2). Bei Erfolg wird die Markierung
- // von P1 entfernt, an P2 gesetzt und sal_True returniert.
- // Mit dem Parameter bPrev=sal_True geht die Suche genau in die andere Richtung.
- sal_Bool MarkNextGluePoint(const Point& rPnt, sal_Bool bPrev=sal_False);
+ // von P1 entfernt, an P2 gesetzt und true returniert.
+ // Mit dem Parameter bPrev=true geht die Suche genau in die andere Richtung.
+// bool MarkNextGluePoint(const basegfx::B2DPoint& rPnt, bool bPrev = false);
// Selektionsrahmen fuer Klebepunktmarkierung aufziehen.
- // Wird nur gestartet, wenn HasMarkableGluePoints() sal_True liefert.
- // Der GlueEditMode sal_True wird nicht abgefragt.
- // sal_Bool BegMarkGluePoints(const Point& rPnt, OutputDevice* pOut);
- sal_Bool BegMarkGluePoints(const Point& rPnt, sal_Bool bUnmark = sal_False);
- void MovMarkGluePoints(const Point& rPnt);
- sal_Bool EndMarkGluePoints();
+ // Wird nur gestartet, wenn HasMarkableGluePoints() true liefert.
+ // Der GlueEditMode true wird nicht abgefragt.
+ // bool BegMarkGluePoints(const Point& rPnt, OutputDevice* pOut);
+ bool BegMarkGluePoints(const basegfx::B2DPoint& rPnt, bool bUnmark = false);
+ void MovMarkGluePoints(const basegfx::B2DPoint& rPnt);
+ bool EndMarkGluePoints();
void BrkMarkGluePoints();
- sal_Bool IsMarkGluePoints() const { return (0L != mpMarkGluePointsOverlay); }
-
- // bRestraintPaint=sal_False bewirkt, dass die Handles nicht sofort wieder gemalt werden.
- // AdjustMarkHdl wird eh' nur gerufen, wenn was geaendert wurde; was idR ein Invalidate
- // zur Folge hat. Am Ende von des Redraw werden die Handles automatisch gezeichnet.
- // Der Zweck ist, unnoetiges Flackern zu vermeiden. -> Funkt noch nich, deshalb sal_True!
- void AdjustMarkHdl(); //HMHBOOL bRestraintPaint=sal_True);
-
- const Rectangle& GetMarkedObjRect() const; // SnapRects der Objekte, ohne Strichstaerke
- Rectangle GetMarkedObjBoundRect() const; // inkl. Strichstaerke, ueberstehende Fetzen, ...
- const Rectangle& GetMarkedPointsRect() const; // Umschliessendes Rechteck aller markierten Punkte
- const Rectangle& GetMarkedGluePointsRect() const; // Umschliessendes Rechteck aller markierten Klebepunkte
- const Rectangle& GetAllMarkedRect() const { return GetMarkedObjRect(); }
- Rectangle GetAllMarkedBoundRect() const { return GetMarkedObjBoundRect(); }
- const Rectangle& GetAllMarkedPointsRect() const { return GetMarkedPointsRect(); }
-
- // Wird immer dann gerufen, wenn sich die Liste der markierten Objekte
- // moeglicherweise geaendert hat. Wer ueberlaed muss unbedingt auch die
- // Methode der Basisklasse rufen!
- virtual void MarkListHasChanged();
+ bool IsMarkGluePoints() const { return (0L != mpMarkGluePointsOverlay); }
+
+ const basegfx::B2DRange& getMarkedObjectSnapRange() const;
+ const basegfx::B2DRange& getMarkedPointRange() const;
+ const basegfx::B2DRange& getMarkedGluePointRange() const;
// Betreten (Editieren) einer evtl markierten Objektgruppe. Sind mehrere
// Objektgruppen markiert, so wird die Oberste genommen. Anschliessend
// liegen alle Memberobjekte der Gruppe im direkten Zugriff. Alle anderen
// Objekte koennen waerendessen nicht bearbeitet werden (bis zum naechsten
// LeaveGroup()). Bei einer seitenuebergreifenden Markierung wird jede Page
- // separat abgearbeitet. Die Methode liefert sal_True, wenn wenigstens eine
+ // separat abgearbeitet. Die Methode liefert true, wenn wenigstens eine
// Gruppe betreten wurde.
- sal_Bool EnterMarkedGroup();
+ bool EnterMarkedGroup();
// Den Mittelpunkt des letzten Crook-Dragging abholen. Den kann man
// bei einem anschliessenden Rotate sinnvoll als Drehmittelpunkt setzen.
- const Point& GetLastCrookCenter() const { return aLastCrookCenter; }
+ const basegfx::B2DPoint& GetLastCrookCenter() const { return maLastCrookCenter; }
// Wird automatisch von der DragView beim beenden eines Crook-Drag gesetzt.
- void SetLastCrookCenter(const Point& rPt) { aLastCrookCenter=rPt; }
+ void SetLastCrookCenter(const basegfx::B2DPoint& rPt) { maLastCrookCenter = rPt; }
// Rotationsmittelpunkt bzw. Startpunkt der Spiegelachse
- const Point& GetRef1() const { return aRef1; }
- void SetRef1(const Point& rPt);
+ const basegfx::B2DPoint& GetRef1() const { return maRef1; }
+ void SetRef1(const basegfx::B2DPoint& rPt);
// Endpunkt der Spiegelachse
- const Point& GetRef2() const { return aRef1; }
- void SetRef2(const Point& rPt);
+ const basegfx::B2DPoint& GetRef2() const { return maRef2; }
+ void SetRef2(const basegfx::B2DPoint& rPt);
};
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// - Hit-Toleranzen:
-// Die muessen natuerlich immer in logischen Koordinaten angegeben werden. Also
-// immer brav den gewuenschten Pixelwert mit PixelToLogic in Logischen umrechnen.
-// Angenommen ein Wert 100 (logisch)
-// - Bei einer waagerechten Haarlinie (Objekt mit Hoehe 0) waere dann +/-100,
-// also ein vertikaler Bereich von 200 logischen Einheiten sensitiv.
-// - Bei Polygonen wird ein Rect mit der Groesse (200,200) generiert und ein
-// Touch-Test zwischen Poly und diesem Rect durchgefuehrt.
-// - Eine Sonderbehandlung erfahren Objekte, die bei SdrObject::HasEdit()==TRUE
-// liefern (z.B. Textrahmen). Hierbei wird ein weiterer sensitiver Bereich mit
-// einer Breite von 2*Tol (in diesem Beispiel also 200 Einheiten) um das Objekt
-// herumgelegt. Waerend ein Hit direkt ins Objekt die Edit-Methode ruft,
-// ermoeglicht ein Hit in den umliegenden sensitiven Bereich ein Dragging.
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
#endif //_SVDMRKV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index 13422b4834e6..bf113034e1f4 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -49,13 +49,16 @@ namespace sdr
} // end of namespace properties
} // end of namespace sdr
-class SdrAShapeObjGeoData : public SdrTextObjGeoData
+class SdrAShapeObjGeoData : public SdrObjGeoData
{
public:
- sal_Bool bMirroredX;
- sal_Bool bMirroredY;
- double fObjectRotation;
+ // TTTT: MirrorX/Y removed, is part of object transformation now
+// bool bMirroredX;
+// bool bMirroredY;
+
+ // TTTT: Should be obsolete
+ // double fObjectRotation; // TTTT: Is this needed? Check, may remove some extra handling
com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue >
aAdjustmentSeq;
@@ -83,7 +86,8 @@ class SVX_DLLPUBLIC SdrObjCustomShape : public SdrTextObj
{
private:
// fObjectRotation is containing the object rotation in degrees.
- double fObjectRotation;
+ // TTTT: SHould be obsolete
+ // double fObjectRotation;
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
@@ -101,17 +105,9 @@ public:
static com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape );
-// SVX_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > >
-// SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const;
-// #i47293#
-// SVX_DLLPRIVATE std::vector< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > > GetFixedInteractionHandle() const;
-
SVX_DLLPRIVATE std::vector< SdrCustomShapeInteraction > GetInteractionHandles( const SdrObjCustomShape* pCustomShape ) const;
-
SVX_DLLPRIVATE void DragCreateObject( SdrDragStat& rDrag );
-
- SVX_DLLPRIVATE void DragResizeCustomShape( const Rectangle& rNewRect, SdrObjCustomShape* pObj ) const;
- SVX_DLLPRIVATE void DragMoveCustomShapeHdl( const Point aDestination, const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj ) const;
+ SVX_DLLPRIVATE void DragMoveCustomShapeHdl( const basegfx::B2DPoint& rDestination, const sal_uInt32 nCustomShapeHdlNum, SdrObjCustomShape* pObj ) const;
// #i37011# centralize throw-away of render geometry
void InvalidateRenderGeometry();
@@ -119,35 +115,45 @@ public:
// #i38892#
void ImpCheckCustomGluePointsAreAdded();
- // returns the new text rect that corresponds to the current logic rect, the return value can be empty if nothing changed.
- Rectangle ImpCalculateTextFrame( const FASTBOOL bHgt, const FASTBOOL bWdt );
+ // returns the new text range that corresponds to the current logic range. The return value can be empty if nothing changed.
+ basegfx::B2DRange ImpCalculateTextFrame(const bool bHgt, const bool bWdt);
public:
// #i37011#
const SdrObject* GetSdrObjectFromCustomShape() const;
const SdrObject* GetSdrObjectShadowFromCustomShape() const;
- sal_Bool GetTextBounds( Rectangle& rTextBound ) const;
- sal_Bool IsTextPath() const;
- static basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed );
+ basegfx::B2DRange getRawUnifiedTextRange() const;
+ bool IsTextPath() const;
+ static basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const bool bBezierAllowed );
protected:
String aName;
+ virtual ~SdrObjCustomShape();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
- sal_Bool UseNoFillStyle() const;
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ // react on model/page change
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
+
+ bool UseNoFillStyle() const;
- sal_Bool IsMirroredX() const;
- sal_Bool IsMirroredY() const;
- void SetMirroredX( const sal_Bool bMirroredX );
- void SetMirroredY( const sal_Bool bMirroredY );
+ // TTTT: MirroredX/Y removed
+ //bool IsMirroredX() const;
+ //bool IsMirroredY() const;
+ //void SetMirroredX( const bool bMirroredX );
+ //void SetMirroredY( const bool bMirroredY );
- double GetObjectRotation() const;
+ //double GetObjectRotation() const;
double GetExtraTextRotation() const;
- TYPEINFO();
- SdrObjCustomShape();
- virtual ~SdrObjCustomShape();
+ SdrObjCustomShape(SdrModel& rSdrModel);
/* is merging default attributes from type-shype into the SdrCustomShapeGeometryItem. If pType
is NULL then the type is being taken from the "Type" property of the SdrCustomShapeGeometryItem.
@@ -167,59 +173,31 @@ public:
DEFAULT_HANDLES,
DEFAULT_TEXTFRAMES
};
- sal_Bool IsDefaultGeometry( const DefaultType eDefaultType ) const;
+ bool IsDefaultGeometry( const DefaultType eDefaultType ) const;
virtual sal_uInt16 GetObjIdentifier() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
-
- virtual void SetModel(SdrModel* pNewModel);
-
- virtual void RecalcSnapRect();
-
- virtual const Rectangle& GetSnapRect() const;
- virtual const Rectangle& GetCurrentBoundRect() const;
- virtual const Rectangle& GetLogicRect() const;
-
- virtual void Move(const Size& rSiz);
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual void SetSnapRect(const Rectangle& rRect);
- virtual void SetLogicRect(const Rectangle& rRect);
-
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
-
- virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
-
- virtual void NbcSetStyleSheet( SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr );
+ virtual void SetStyleSheet( SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr );
// special drag methods
virtual bool hasSpecialDrag() const;
virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
virtual bool applySpecialDrag(SdrDragStat& rDrag);
- virtual FASTBOOL BegCreate( SdrDragStat& rStat );
- virtual FASTBOOL MovCreate(SdrDragStat& rStat); // #i37448#
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
-
- virtual FASTBOOL AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True) const;
- virtual FASTBOOL NbcAdjustTextFrameWidthAndHeight(FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True);
- virtual FASTBOOL AdjustTextFrameWidthAndHeight(FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True);
- virtual FASTBOOL IsAutoGrowHeight() const;
- virtual FASTBOOL IsAutoGrowWidth() const;
- virtual void SetVerticalWriting( sal_Bool bVertical );
- virtual sal_Bool BegTextEdit( SdrOutliner& rOutl );
- virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual bool MovCreate(SdrDragStat& rStat); // #i37448#
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+
+ virtual basegfx::B2DRange AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt = true, bool bWdt = true) const;
+ virtual bool AdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
+ virtual bool IsAutoGrowHeight() const;
+ virtual bool IsAutoGrowWidth() const;
+ virtual void SetVerticalWriting( bool bVertical );
+ virtual bool BegTextEdit( SdrOutliner& rOutl );
+ virtual void TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const;
virtual void EndTextEdit( SdrOutliner& rOutl );
- virtual void TakeTextAnchorRect( Rectangle& rAnchorRect ) const;
- virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=sal_False,
- Rectangle* pAnchorRect=NULL, sal_Bool bLineWidth=sal_True ) const;
- virtual void operator=(const SdrObject& rObj);
+ virtual basegfx::B2DRange getUnifiedTextRange() const;
+ virtual void TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const;
+ virtual void SetChanged();
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
@@ -227,33 +205,21 @@ public:
virtual basegfx::B2DPolyPolygon TakeCreatePoly( const SdrDragStat& rDrag) const;
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual basegfx::B2DPolyPolygon TakeContour() const;
-
- virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
-
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
-
- virtual void SetPage( SdrPage* pNewPage );
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
virtual SdrObjGeoData *NewGeoData() const;
virtual void SaveGeoData(SdrObjGeoData &rGeo) const;
virtual void RestGeoData(const SdrObjGeoData &rGeo);
- // need to take fObjectRotation instead of aGeo.nWink, replace it temporary
- virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
-
virtual const SdrGluePointList* GetGluePointList() const;
- //virtual SdrGluePointList* GetGluePointList();
virtual SdrGluePointList* ForceGluePointList();
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl( sal_uInt32 nHdlNum ) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// #i33136#
static bool doConstructOrthogonal(const ::rtl::OUString& rName);
- using SdrTextObj::NbcSetOutlinerParaObject;
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
};
#endif //_SVDOASHP_HXX
diff --git a/svx/inc/svx/svdoattr.hxx b/svx/inc/svx/svdoattr.hxx
index cd976cc61dbb..f612e71db28c 100644
--- a/svx/inc/svx/svdoattr.hxx
+++ b/svx/inc/svx/svdoattr.hxx
@@ -30,11 +30,10 @@
#include <svx/xlnasit.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdattr.hxx>
-#include "svx/svxdllapi.h"
+#include <svx/svxdllapi.h>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// predefines
class SfxPoolItem;
class SfxSetItem;
@@ -42,45 +41,36 @@ class SdrOutliner;
class SfxItemSet;
class SfxItemPool;
-//************************************************************
-// SdrAttrObj
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrAttrObj : public SdrObject
{
private:
- friend class SdrOutliner;
-
protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- Rectangle maSnapRect;
-
-protected:
// Strichstaerke ermitteln. Keine Linie -> 0.
sal_Int32 ImpGetLineWdt() const;
// Zuhoeren, ob sich ein StyleSheet aendert
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- SdrAttrObj();
+ // protected constructor; this is only a helper class which should never be directly
+ // incarnated
+ SdrAttrObj(SdrModel& rSdrModel, const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix());
virtual ~SdrAttrObj();
public:
- TYPEINFO();
-
// Feststellen, ob bFilledObj && Fuellung!=FillNone
- sal_Bool HasFill() const;
+ bool HasFill() const;
// Feststellen, ob Linie!=LineNone
- sal_Bool HasLine() const;
-
- virtual const Rectangle& GetSnapRect() const;
-
- virtual void SetModel(SdrModel* pNewModel);
+ bool HasLine() const;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDOATTR_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index dd18589bc9d9..88ec0ba1f8fa 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -37,13 +37,16 @@
#include <svx/xpoly.hxx>
#include <svx/xenum.hxx>
#include <vcl/bitmapex.hxx>
-#include <svx/sdrobjectuser.hxx>
#include "svx/svxdllapi.h"
#include "svx/shapeproperty.hxx"
+#include <svx/svdmodel.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdpool.hxx>
+#include <boost/utility.hpp>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// predefines
class SfxBroadcaster;
class Pointer;
@@ -53,12 +56,11 @@ class SdrOutliner;
class SdrDragStat;
class SdrHdl;
class SdrHdlList;
-class SdrItemPool;
+class SfxItemPool;
class SdrModel;
class SdrObjList;
class SdrObject;
class SdrPage;
-class SdrPageView;
class SdrView;
class SfxItemSet;
class SfxSetItem;
@@ -69,469 +71,359 @@ class XLineAttrSetItem;
class SfxItemPool;
class PolyPolygon;
class SfxPoolItem;
-class SdrVirtObj;
class SdrDragView;
+namespace sdr { namespace properties { class BaseProperties; }}
+namespace sdr { namespace contact { class ViewContact; }}
+namespace svx { class PropertyChangeNotifier; }
+class SvxShape;
+class SdrObject;
+namespace sdr { namespace gluepoint { class GluePointProvider; }}
+class SdrEdgeObj;
-namespace sdr
-{
- namespace properties
- {
- class BaseProperties;
- } // end of namespace properties
-} // end of namespace sdr
+//////////////////////////////////////////////////////////////////////////////
+// defines
-// #110094#
-namespace sdr
+enum SdrObjKind
{
- namespace contact
- {
- class ViewContact;
- } // end of namespace contact
-} // end of namespace sdr
+ OBJ_NONE = 0 , // Abstraktes Objekt (SdrObject)
+ OBJ_GRUP , // Objektgruppe
+// OBJ_LINE , // OBJ_POLY Strecke
+ OBJ_RECT , // Rechteck ww. mit runden Ecken
+ OBJ_CIRC , // Kreis, Ellipse
+// OBJ_SECT , // OBJ_CIRC Kreissektor
+// OBJ_CARC , // OBJ_CIRC Kreisbogen
+// OBJ_CCUT , // OBJ_CIRC Kreisabschnitt
+ OBJ_POLY , // Polygon, PolyPolygon
+// OBJ_PLIN , // OBJ_POLY PolyLine
+// OBJ_PATHLINE , // OBJ_POLY Offene Bezierkurve
+// OBJ_PATHFILL , // OBJ_POLY Geschlossene Bezierkurve
+// OBJ_FREELINE , // OBJ_POLY Offene Freihandlinie
+// OBJ_FREEFILL , // OBJ_POLY Geschlossene Freihandlinie
+ OBJ_TEXT , // Textobjekt
+ OBJ_TITLETEXT , // Titeltext. Spezial-Textobjekt fuer StarDraw
+ OBJ_OUTLINETEXT, // OutlineText. Spezial-Textobjekt fuer StarDraw
+ OBJ_GRAF , // Fremdgrafik - (StarView Graphic)
+ OBJ_OLE2 , // OLE-Objekt
+ OBJ_EDGE , // Verbindungsobjekt fuer Konnektoren
+ OBJ_CAPTION , // Legendenobjekt
+// OBJ_PATHPOLY , // Needed? Polygon/PolyPolygon dargestellt durch SdrPathObj
+// OBJ_PATHPLIN , // Needed? Polyline dargestellt durch SdrPathObj
+ OBJ_PAGE , // Objekt, das eine SdrPage darstellt
+ OBJ_MEASURE , // Bemassungsobjekt
+ OBJ_FRAME , // staendig aktives OLE (PlugIn-Frame oder sowas)
+ OBJ_UNO , // Universal Network Object im SvDraw-Obj eingepackt
+ OBJ_CUSTOMSHAPE, // CustomShape
+ OBJ_MEDIA , // Media shape
+ OBJ_TABLE , // Table
+ OBJ_MAXI
+};
-namespace svx
-{
- class PropertyChangeNotifier;
-}
-
-//************************************************************
-// Defines
-//************************************************************
-
-enum SdrObjKind {OBJ_NONE = 0, // Abstraktes Objekt (SdrObject)
- OBJ_GRUP = 1, // Objektgruppe
- OBJ_LINE = 2, // Strecke
- OBJ_RECT = 3, // Rechteck ww. mit runden Ecken
- OBJ_CIRC = 4, // Kreis, Ellipse
- OBJ_SECT = 5, // Kreissektor
- OBJ_CARC = 6, // Kreisbogen
- OBJ_CCUT = 7, // Kreisabschnitt
- OBJ_POLY = 8, // Polygon, PolyPolygon
- OBJ_PLIN = 9, // PolyLine
- OBJ_PATHLINE =10, // Offene Bezierkurve
- OBJ_PATHFILL =11, // Geschlossene Bezierkurve
- OBJ_FREELINE =12, // Offene Freihandlinie
- OBJ_FREEFILL =13, // Geschlossene Freihandlinie
- OBJ_SPLNLINE =14, // Natuerlicher kubischer Spline (ni)
- OBJ_SPLNFILL =15, // Periodischer kubischer Spline (ni)
- OBJ_TEXT =16, // Textobjekt
- OBJ_TEXTEXT =17, // Texterweiterungsrahmen (ni)
- OBJ_wegFITTEXT, // FitToSize-Text (alle Zeilen gleich)
- OBJ_wegFITALLTEXT, // FitToSize-Text (Zeilenweise) (ni)
- OBJ_TITLETEXT =20, // Titeltext. Spezial-Textobjekt fuer StarDraw
- OBJ_OUTLINETEXT=21, // OutlineText. Spezial-Textobjekt fuer StarDraw
- OBJ_GRAF =22, // Fremdgrafik - (StarView Graphic)
- OBJ_OLE2 =23, // OLE-Objekt
- OBJ_EDGE =24, // Verbindungsobjekt fuer Konnektoren
- OBJ_CAPTION =25, // Legendenobjekt
- OBJ_PATHPOLY =26, // Polygon/PolyPolygon dargestellt durch SdrPathObj
- OBJ_PATHPLIN =27, // Polyline dargestellt durch SdrPathObj
- OBJ_PAGE =28, // Objekt, das eine SdrPage darstellt
- OBJ_MEASURE =29, // Bemassungsobjekt
- OBJ_DUMMY =30, // Dummyobjekt zum speichern von Luecken (zur anschliessenden Wiederherstellung der Surrogate)
- OBJ_FRAME =31, // staendig aktives OLE (PlugIn-Frame oder sowas)
- OBJ_UNO =32, // Universal Network Object im SvDraw-Obj eingepackt
- OBJ_CUSTOMSHAPE=33, // CustomShape
- OBJ_MEDIA =34, // Media shape
- OBJ_TABLE =35, // Table
- OBJ_MAXI};
-
-enum SdrUserCallType {SDRUSERCALL_MOVEONLY, // Nur verschoben, Groesse unveraendert
- SDRUSERCALL_RESIZE, // Groesse und evtl. auch Pos veraendert
- SDRUSERCALL_CHGATTR, // Attribute veraendert. Moeglicherweise neue Groesse wg. Linienbreite
- SDRUSERCALL_DELETE, // Obj gibt es gleich nicht mehr. Schon keine Attr mehr.
- SDRUSERCALL_COPY, // Zuweisungsoperator gerufen. Kann alles geaendert sein
- SDRUSERCALL_INSERTED, // In eine Objektliste (z.B. Page) eingefuegt
- SDRUSERCALL_REMOVED, // Aus der Objektliste entfernt
- SDRUSERCALL_CHILD_MOVEONLY, // Ein Child einer Gruppe hat sich veraendert
- SDRUSERCALL_CHILD_RESIZE, // Ein Child einer Gruppe hat sich veraendert
- SDRUSERCALL_CHILD_CHGATTR, // Ein Child einer Gruppe hat sich veraendert
- SDRUSERCALL_CHILD_DELETE, // Ein Child einer Gruppe hat sich veraendert
- SDRUSERCALL_CHILD_COPY, // Ein Child einer Gruppe hat sich veraendert
- SDRUSERCALL_CHILD_INSERTED, // Ein Child einer Gruppe hat sich veraendert
- SDRUSERCALL_CHILD_REMOVED}; // Ein Child einer Gruppe hat sich veraendert
-
-/* nur voruebergehend, weil sonst MUSS-Aenderung */
-// #define nLayerID nLayerId
-
-//************************************************************
-// Hilfsklasse SdrObjUserCall
-//************************************************************
-
-class SVX_DLLPUBLIC SdrObjUserCall
+//////////////////////////////////////////////////////////////////////////////
+// broadcas helper class
+
+class SVX_DLLPUBLIC SdrObjectChangeBroadcaster : public SdrBaseHint
{
public:
- TYPEINFO();
- virtual ~SdrObjUserCall();
- virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
+ SdrObjectChangeBroadcaster(
+ const SdrObject& rSdrObject,
+ SdrHintKind eSdrHintKind = HINT_OBJCHG_RESIZE);
+ ~SdrObjectChangeBroadcaster();
};
-//************************************************************
-// Hilfsklasse SdrObjMacroHitRec
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrObjMacroHitRec
{
public:
- Point aPos;
- Point aDownPos;
- OutputDevice* pOut;
- const SetOfByte* pVisiLayer;
- const SdrPageView* pPageView;
- sal_uInt16 nTol;
- FASTBOOL bDown;
+ basegfx::B2DPoint maPos;
+ basegfx::B2DPoint maDownPos;
+ OutputDevice* mpOut;
+ const SdrView* mpSdrView;
+ double mfTol;
+
+ /// bitfield
+ bool mbDown;
public:
SdrObjMacroHitRec()
- : pOut(NULL),
- pVisiLayer(NULL),
- pPageView(NULL),
- nTol(0),
- bDown(sal_False)
- {}
+ : mpOut(0),
+ mpSdrView(0),
+ mfTol(0.0),
+ mbDown(false)
+ {
+ }
};
-//************************************************************
-// Hilfsklasse SdrObjUserData
-//
-// Anwenderdaten an einem Zeichenobjekt, z.B. applikationsspezifische Daten.
-// Jedes Zeichenobjekt kann beliebig viele dieser Records haben (SV-Liste).
-// Wer hier Daten halten will, muss sich ableiten und auch an der Factory
-// einen entsprechenden Link setzen.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrObjUserData
{
protected:
- sal_uInt32 nInventor;
- sal_uInt16 nIdentifier;
- sal_uInt16 nVersion;
+ sal_uInt32 mnInventor;
+ sal_uInt16 mnIdentifier;
private:
SVX_DLLPRIVATE void operator=(const SdrObjUserData& rData); // nicht implementiert
- SVX_DLLPRIVATE sal_Bool operator==(const SdrObjUserData& rData) const; // nicht implementiert
- SVX_DLLPRIVATE sal_Bool operator!=(const SdrObjUserData& rData) const; // nicht implementiert
+ SVX_DLLPRIVATE bool operator==(const SdrObjUserData& rData) const; // nicht implementiert
+ SVX_DLLPRIVATE bool operator!=(const SdrObjUserData& rData) const; // nicht implementiert
public:
- TYPEINFO();
-
- SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId, sal_uInt16 nVer)
- : nInventor(nInv),
- nIdentifier(nId),
- nVersion(nVer)
- {}
- SdrObjUserData(const SdrObjUserData& rData)
- : nInventor(rData.nInventor),
- nIdentifier(rData.nIdentifier),
- nVersion(rData.nVersion)
- {}
+ SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId);
+ SdrObjUserData(const SdrObjUserData& rData);
virtual ~SdrObjUserData();
virtual SdrObjUserData* Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0
- sal_uInt32 GetInventor() const { return nInventor; }
- sal_uInt16 GetId() const { return nIdentifier; }
+ sal_uInt32 GetInventor() const { return mnInventor; }
+ sal_uInt16 GetId() const { return mnIdentifier; }
- virtual FASTBOOL HasMacro (const SdrObject* pObj) const;
+ virtual bool HasMacro(const SdrObject* pObj) const;
virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
- virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
- virtual FASTBOOL DoMacro (const SdrObjMacroHitRec& rRec, SdrObject* pObj);
+ virtual void PaintMacro(OutputDevice& rOut, const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
+ virtual bool DoMacro(const SdrObjMacroHitRec& rRec, SdrObject* pObj);
virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const;
};
-//************************************************************
-// Hilfsklasse SdrObjUserDataList
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrObjUserDataList
{
- Container aList;
+private:
+ typedef ::std::vector< SdrObjUserData* > SdrObjUserDataContainerType;
+ SdrObjUserDataContainerType maList;
public:
- SdrObjUserDataList()
- : aList(1024,4,4)
- {}
- ~SdrObjUserDataList() { Clear(); }
+ SdrObjUserDataList();
+ ~SdrObjUserDataList();
void Clear();
- sal_uInt16 GetUserDataCount() const { return sal_uInt16(aList.Count()); }
- SdrObjUserData* GetUserData(sal_uInt16 nNum) const { return (SdrObjUserData*)aList.GetObject(nNum); }
- void InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos=0xFFFF) { aList.Insert(pData,nPos); }
- SdrObjUserData* RemoveUserData(sal_uInt16 nNum) { return (SdrObjUserData*)aList.Remove(nNum);}
- void DeleteUserData(sal_uInt16 nNum) { delete RemoveUserData(nNum); }
+ sal_uInt32 GetUserDataCount() const { return maList.size(); }
+ SdrObjUserData* GetUserData(sal_uInt32 nNum) const;
+ void InsertUserData(SdrObjUserData* pData, sal_uInt32 nPos = 0xffffffff);
+ SdrObjUserData* RemoveUserData(sal_uInt32 nNum);
+ void DeleteUserData(sal_uInt32 nNum) { delete RemoveUserData(nNum); }
};
-//************************************************************
-// Hilfsklasse SdrObjGeoData
-//
-// Alle geometrischen Daten eines beliebigen Objektes zur Übergabe an's Undo/Redo
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrObjGeoData
{
public:
- Rectangle aBoundRect;
- Point aAnchor;
- SdrGluePointList* pGPL;
- sal_Bool bMovProt;
- sal_Bool bSizProt;
- sal_Bool bNoPrint;
- sal_Bool bClosedObj;
- bool mbVisible;
- SdrLayerID mnLayerID;
+ basegfx::B2DHomMatrix maSdrObjectTransformation;
+ basegfx::B2DPoint maObjectAnchor;
+ SdrGluePointList* mpGPL;
+ SdrLayerID mnLayerID;
+
+ /// bitfield
+ bool mbMoveProtect : 1;
+ bool mbSizeProtect : 1;
+ bool mbNoPrint : 1;
+ bool mbVisible : 1;
public:
SdrObjGeoData();
virtual ~SdrObjGeoData();
};
-//************************************************************
-// Hilfsklasse SdrObjPlusData
-//
-// Bitsack fuer DrawObjekte
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrObjPlusData
{
- friend class SdrObject;
-
public:
- SfxBroadcaster* pBroadcast; // Broadcaster, falls dieses Obj referenziert wird (bVirtObj=sal_True). Auch fuer Konnektoren etc.
- SdrObjUserDataList* pUserDataList; // applikationsspeziefische Daten
- SdrGluePointList* pGluePoints; // Klebepunkte zum Ankleben von Objektverbindern
- AutoTimer* pAutoTimer;
+ SdrObjUserDataList* mpUserDataList; // applikationsspeziefische Daten
+ SdrGluePointList* mpGluePoints; // Klebepunkte zum Ankleben von Objektverbindern
- // #i68101#
// object name, title and description
- String aObjName;
- String aObjTitle;
- String aObjDescription;
+ String maObjName;
+ String maObjTitle;
+ String maObjDescription;
// Name to be used by applications
- XubString aHTMLName;
+ XubString maHTMLName;
+
+ // on import of OLE object from MS documents the BLIP size might be retrieved,
+ // in this case the following member is initialized as nonempty rectangle
+ basegfx::B2DRange maBLIPSizeRange;
+
+ // anchor (only used for SW as extra-translation)
+ basegfx::B2DPoint maObjectAnchor;
public:
- TYPEINFO();
SdrObjPlusData();
virtual ~SdrObjPlusData();
virtual SdrObjPlusData* Clone(SdrObject* pObj1) const;
};
-//************************************************************
-// Hilfsklasse SdrObjTransformInfoRec
-//
-// gibt Auskunft ueber verschiedene Eigenschaften eines ZObjects
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
-class SdrObjTransformInfoRec
+class SVX_DLLPUBLIC SdrObjTransformInfoRec
{
public:
- unsigned bSelectAllowed : 1; // sal_False=Obj kann nicht selektiert werden
- unsigned bMoveAllowed : 1; // sal_False=Obj kann nicht verschoben werden
- unsigned bResizeFreeAllowed : 1; // sal_False=Obj kann nicht frei resized werden
- unsigned bResizePropAllowed : 1; // sal_False=Obj kann nichtmal proportional resized werden
- unsigned bRotateFreeAllowed : 1; // sal_False=Obj kann nicht frei gedreht werden
- unsigned bRotate90Allowed : 1; // sal_False=Obj kann nichtmal im 90deg Raster gedreht werden
- unsigned bMirrorFreeAllowed : 1; // sal_False=Obj kann nicht frei gespiegelt werden
- unsigned bMirror45Allowed : 1; // sal_False=Obj kann nichtmal ueber Achse im 45deg Raster gespiegelt werden
- unsigned bMirror90Allowed : 1; // sal_False=Obj kann ebenfalls nicht ueber Achse im 90deg Raster gespiegelt werden
- unsigned bTransparenceAllowed : 1; // sal_False=Obj does not have an interactive transparence control
- unsigned bGradientAllowed : 1; // sal_False=Obj dooes not have an interactive gradient control
- unsigned bShearAllowed : 1; // sal_False=Obj kann nicht verzerrt werden
- unsigned bEdgeRadiusAllowed : 1;
- unsigned bNoOrthoDesired : 1; // sal_True bei Rect; ... sal_False bei BMP,MTF;
- unsigned bNoContortion : 1; // sal_False=Kein verzerren (bei Crook) moeglich (nur sal_True bei PathObj und Gruppierten PathObjs)
- unsigned bCanConvToPath : 1; // sal_False=Keine Konvertierung in PathObj moeglich
- unsigned bCanConvToPoly : 1; // sal_False=Keine Konvertierung in PolyObj moeglich
- unsigned bCanConvToContour : 1; // sal_False=no conversion down to whole contour possible
- unsigned bCanConvToPathLineToArea : 1; // sal_False=Keine Konvertierung in PathObj moeglich mit Wandlung von LineToArea
- unsigned bCanConvToPolyLineToArea : 1; // sal_False=Keine Konvertierung in PolyObj moeglich mit Wandlung von LineToArea
+ bool mbSelectAllowed : 1; // false=Obj kann nicht selektiert werden
+ bool mbMoveAllowed : 1; // false=Obj kann nicht verschoben werden
+ bool mbResizeFreeAllowed : 1; // false=Obj kann nicht frei resized werden
+ bool mbResizePropAllowed : 1; // false=Obj kann nichtmal proportional resized werden
+ bool mbRotateFreeAllowed : 1; // false=Obj kann nicht frei gedreht werden
+ bool mbRotate90Allowed : 1; // false=Obj kann nichtmal im 90deg Raster gedreht werden
+ bool mbMirrorFreeAllowed : 1; // false=Obj kann nicht frei gespiegelt werden
+ bool mbMirror45Allowed : 1; // false=Obj kann nichtmal ueber Achse im 45deg Raster gespiegelt werden
+ bool mbMirror90Allowed : 1; // false=Obj kann ebenfalls nicht ueber Achse im 90deg Raster gespiegelt werden
+ bool mbTransparenceAllowed : 1; // false=Obj does not have an interactive transparence control
+ bool mbGradientAllowed : 1; // false=Obj dooes not have an interactive gradient control
+ bool mbShearAllowed : 1; // false=Obj kann nicht verzerrt werden
+ bool mbEdgeRadiusAllowed : 1;
+ bool mbNoOrthoDesired : 1; // true bei Rect; ... false bei BMP,MTF;
+ bool mbNoContortion : 1; // false=Kein verzerren (bei Crook) moeglich (nur true bei PathObj und Gruppierten PathObjs)
+ bool mbCanConvToPath : 1; // false=Keine Konvertierung in PathObj moeglich
+ bool mbCanConvToPoly : 1; // false=Keine Konvertierung in PolyObj moeglich
+ bool mbCanConvToContour : 1; // false=no conversion down to whole contour possible
+ bool mbCanConvToPathLineToArea : 1; // false=Keine Konvertierung in PathObj moeglich mit Wandlung von LineToArea
+ bool mbCanConvToPolyLineToArea : 1; // false=Keine Konvertierung in PolyObj moeglich mit Wandlung von LineToArea
public:
- SdrObjTransformInfoRec()
- : bSelectAllowed(sal_True),
- bMoveAllowed(sal_True),
- bResizeFreeAllowed(sal_True),
- bResizePropAllowed(sal_True),
- bRotateFreeAllowed(sal_True),
- bRotate90Allowed(sal_True),
- bMirrorFreeAllowed(sal_True),
- bMirror45Allowed(sal_True),
- bMirror90Allowed(sal_True),
- bTransparenceAllowed(sal_True),
- bGradientAllowed(sal_True),
- bShearAllowed(sal_True),
- bEdgeRadiusAllowed(sal_True),
- bNoOrthoDesired(sal_True),
- bNoContortion(sal_True),
- bCanConvToPath(sal_True),
- bCanConvToPoly(sal_True),
- bCanConvToContour(sal_False),
- bCanConvToPathLineToArea(sal_True),
- bCanConvToPolyLineToArea(sal_True)
- {}
+ SdrObjTransformInfoRec();
};
////////////////////////////////////////////////////////////////////////////////////////////////////
-// To make things more safe, allow users of the object to register at it. The users need to be derived
-// from SdrObjectUser to get a call. The users do not need to call RemoveObjectUser() at the object
-// when they get called from PageInDestruction().
-class SdrObject;
-
-class SdrObjectUser
-{
-public:
- virtual void ObjectInDestruction(const SdrObject& rObject) = 0;
-};
+//
+// SdrObject
+// SdrObjGroup
+// SdrAttrObj
+// E3dObject
+// E3dCompoundObject
+// E3dCubeObj
+// E3dExtrudeObj
+// E3dLatheObj
+// E3dPolygonObj
+// E3dSphereObj
+// E3dScene
+// SdrTextObj (eTextKind from here) bTextFrame=false (default)
+// SdrObjCustomShape bTextFrame = true, set in constructor
+// OCustomShape OK, derived
+// SdrEdgeObj bTextFrame=false, derived
+// SdrMeasureObj bTextFrame=false, derived
+// SdrPathObj (meKind from here) bTextFrame=false, derived
+// SdrRectObj
+// SdrCaptionObj
+// SdrCircObj (meCircleKind from here)
+// SdrGrafObj
+// SdrMediaObj
+// SdrOle2Obj
+// OOle2Obj
+// SdrUnoObj
+// DlgEdObj
+// DlgEdForm
+// OUnoObject
+// FmFormObj
+// SdrTableObj bTextFrame=false, derived
+// SdrPageObj
+// sd::slidesorter::view::PageObject
+// SwDrawVirtObj
+// SwFlyDrawObj
+// SwVirtFlyDrawObj
+//
-// typedef for GetParentContacts()
-typedef ::std::vector< SdrObjectUser* > ObjectUserVector;
+typedef ::std::vector< SdrObject* > SdrObjectVector;
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
//
-// @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@@@@ @@@@ @@@@@ @@@@ @@
+// checked usages of SfxListener. Used by:
+// - SdrEdgeObj to react on changes of the objects selected to
+// - SdrPageObj to react on changes of the visualized SdrPage
+// - SdrTextObj to listen to changes of Text StyleSheets used in the
+// OutlinerParaObject
+// - OBJ_OUTLINETEXT SdrTextObjs and PRESOBJ_OUTLINE to react on changes to all 10 layes
+// of stylesheets
//
-// Abstraktes DrawObject
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class SvxShape;
-class SVX_DLLPUBLIC SdrObject: public SfxListener, public tools::WeakBase< SdrObject >
+// These usages could me moved to the involved SdrObject types. The specials for SdrTextObj
+// should be moved to SdrText
+
+class SVX_DLLPUBLIC SdrObject
+: private boost::noncopyable,
+ public SfxListener,
+ public SfxBroadcaster,
+ public tools::WeakBase< SdrObject >
{
private:
- // ObjectUser section
- sdr::ObjectUserVector maObjectUsers;
+ // the SdrModel this objects was created with, unchanged during SdrObject lifetime
+ SdrModel& mrSdrModelFromSdrObject;
-public:
- void AddObjectUser(sdr::ObjectUser& rNewUser);
- void RemoveObjectUser(sdr::ObjectUser& rOldUser);
+ // on-demand members
+ sdr::properties::BaseProperties* mpProperties;
+ sdr::contact::ViewContact* mpViewContact;
+ sdr::gluepoint::GluePointProvider* mpGluePointProvider;
- // BaseProperties section
-private:
- sdr::properties::BaseProperties* mpProperties;
-protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-public:
- virtual sdr::properties::BaseProperties& GetProperties() const;
-
- ///////////////////////////////////////////////////////////////////////////////
- // #110094# DrawContact section
-private:
- sdr::contact::ViewContact* mpViewContact;
-protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-public:
- sdr::contact::ViewContact& GetViewContact() const;
+ virtual sdr::gluepoint::GluePointProvider* CreateObjectSpecificGluePointProvider();
- // DrawContact support: Methods for handling Object changes
- void ActionChanged() const;
+ /** only for internal use! */
+ SvxShape* getSvxShape() const;
-private:
- friend class SdrObjListIter;
- friend class SdrVirtObj;
- friend class SdrRectObj;
+ /** do not use directly, always use getSvxShape() if you have to! */
+ SvxShape* mpSvxShape;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface > maWeakUnoShape;
+
+ // only allow SetOrdNumAtSdrObjectFromSdrObjList to call SetOrdNum
+ friend void SetOrdNumAtSdrObjectFromSdrObjList(SdrObject& rSdrObject, sal_uInt32 nOrdNum);
+ SVX_DLLPRIVATE void SetOrdNum(sal_uInt32 nOrdNum);
+
+ // only allow SetParentAtSdrObjectFromSdrObjList to call setParentOfSdrObject
+ friend void SetParentAtSdrObjectFromSdrObjList(SdrObject& rSdrObject, SdrObjList* pNew);
+ SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList* pNew);
+
+ // only allow SetUnoShapeAtSdrObjectFromSvxShape to call impl_setUnoShape from outside SdrObject
+ // SVX_DLLPUBLIC needed for SetUnoShapeAtSdrObjectFromSvxShape since it's used in reportdesigner
+ friend void SVX_DLLPUBLIC SetUnoShapeAtSdrObjectFromSvxShape(SdrObject& rSdrObject, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape);
+ SVX_DLLPRIVATE void impl_setUnoShape(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape);
protected:
- Rectangle aOutRect; // umschliessendes Rechteck fuer Paint (inkl. LineWdt, ...)
- Point aAnchor; // Ankerposition (Writer)
- SdrObjList* pObjList; // Liste, in dem das Obj eingefuegt ist.
- SdrPage* pPage;
- SdrModel* pModel;
- SdrObjUserCall* pUserCall;
- SdrObjPlusData* pPlusData; // Broadcaster, UserData, Konnektoren, ... (Das ist der Bitsack)
+ // object transformation including scale, shearX, rotate and translate
+ basegfx::tools::B2DHomMatrixBufferedOnDemandDecompose maSdrObjectTransformation;
- sal_uInt32 nOrdNum; // Rangnummer des Obj in der Liste
+ // parent list this object is added to
+ SdrObjList* mpParentOfSdrObject;
+ SdrObjPlusData* mpPlusData; // Broadcaster, UserData, Konnektoren, ... (Das ist der Bitsack)
- /** Position in the navigation order. SAL_MAX_UINT32 when not used.
- */
- sal_uInt32 mnNavigationPosition;
+ sal_uInt32 mnOrdNum; // Rangnummer des Obj in der Liste
SdrLayerID mnLayerID;
- // Objekt zeigt nur auf ein Anderes
- unsigned bVirtObj : 1;
- unsigned bSnapRectDirty : 1;
- unsigned bNetLock : 1; // ni
- unsigned bInserted : 1; // nur wenn sal_True gibt's RepaintBroadcast & SetModify
- unsigned bGrouped : 1; // Member eines GroupObjektes?
-
- // Die folgende Flags werden gestreamt
- unsigned bMovProt : 1; // If true, the position is protected
- unsigned bSizProt : 1; // If true, the size is protected
- unsigned bNoPrint : 1; // If true, the object is not printed.
- unsigned mbVisible : 1; // If false, the object is not visible on screen (but maybe on printer, depending on bNoprint
- // Wenn bEmptyPresObj sal_True ist, handelt es sich um ein
+ // bitfield
+ bool mbMoveProtect : 1; // If true, the position is protected
+ bool mbSizeProtect : 1; // If true, the size is protected
+ bool mbNoPrint : 1; // If true, the object is not printed
+ bool mbMarkProtect : 1; // If true, object cannot be marked
+ bool mbVisible : 1; // If false, the object is not visible on screen (but maybe on printer, depending on bNoprint
+
+ // Wenn bEmptyPresObj true ist, handelt es sich um ein
// Praesentationsobjekt, dem noch kein Inhalt zugewiesen
- // wurde. Default ist das Flag auf FALSE. Die Verwaltung
+ // wurde. Default ist das Flag auf false. Die Verwaltung
// uebernimmt die Applikation. Im Zuweisungsoperator sowie
// beim Clone wird das Flag nicht mitkopiert!
// Das Flag ist persistent.
- unsigned bEmptyPresObj : 1; // Leeres Praesentationsobjekt (Draw)
-
- // sal_True=Objekt ist als Objekt der MasterPage nicht sichtbar
- unsigned bNotVisibleAsMaster : 1;
-
- // sal_True=Es handelt sich hierbei um ein geschlossenes Objekt, also nicht Linie oder Kreisbogen ...
- unsigned bClosedObj : 1;
-
- unsigned bIsEdge : 1;
- unsigned bIs3DObj : 1;
- unsigned bMarkProt : 1; // Markieren verboten. Persistent
- unsigned bIsUnoObj : 1;
- unsigned bNotMasterCachable : 1;
-
- // #i25616#
- unsigned mbLineIsOutsideGeometry : 1;
+ bool mbEmptyPresObj : 1; // Leeres Praesentationsobjekt (Draw)
- // #i25616#
- unsigned mbSupportTextIndentingOnLineWidthChange : 1;
+ // true=Objekt ist als Objekt der MasterPage nicht sichtbar
+ bool mbNotVisibleAsMaster : 1;
- // on import of OLE object from MS documents the BLIP size might be retrieved,
- // in this case the following member is initialized as nonempty rectangle
- Rectangle maBLIPSizeRectangle;
+ // #i108739# extra bool flag(s) for applications
+ bool mbUniversalApplicationFlag01 : 1;
- // global static ItemPool for not-yet-insetred items
-private:
- static SdrItemPool* mpGlobalItemPool;
-public:
- static SdrItemPool& GetGlobalDrawObjectItemPool();
-private:
- SVX_DLLPRIVATE static void FreeGlobalDrawObjectItemPool();
+ // Objekte werden gerade resized wegen Paste mit anderem MapMode
+ bool mbPasteResize : 1;
-protected:
void ImpDeleteUserData();
SdrObjUserData* ImpGetMacroUserData() const;
- Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
// Fuer GetDragComment
- void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal=0) const;
-
- void ImpForcePlusData() { if (pPlusData==NULL) pPlusData=NewPlusData(); }
-
- String GetWinkStr(long nWink, FASTBOOL bNoDegChar=sal_False) const;
- String GetMetrStr(long nVal, MapUnit eWantMap=MAP_MM, FASTBOOL bNoUnitChars=sal_False) const;
-
- // bNotMyself=sal_True bedeutet: Nur die ObjList auf Dirty setzen, nicht mich.
- // Wird z.B. benoetigt fuer NbcMove, denn da movt man SnapRect und aOutRect
- // i.d.R. gleich mit um die Neuberechnung zu sparen.
-public:
- virtual void SetRectsDirty(sal_Bool bNotMyself = sal_False);
-protected:
+ void TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 nVal = 0) const;
+ void ImpForcePlusData() { if (!mpPlusData) mpPlusData = NewPlusData(); }
+ String GetWinkStr(sal_Int32 nWink, bool bNoDegChar = false) const;
+ String GetMetrStr(sal_Int32 nVal, MapUnit eWantMap = MAP_MM, bool bNoUnitChars = false) const;
// ueberladen, wenn man sich von SdrObjPlusData abgeleitet hat:
virtual SdrObjPlusData* NewPlusData() const;
-protected:
// Diese 3 Methoden muss ein abgeleitetes Objekt ueberladen, wenn es eigene
// geometrische Daten besitzt, die fuer den Undo-Fall gesichert werden
// sollen. NewGeoData() erzeugt lediglich eine leere Instanz auf eine von
@@ -540,62 +432,69 @@ protected:
virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
virtual void RestGeoData(const SdrObjGeoData& rGeo);
-protected:
+ // internal versions for ItemSet accesses; these are without merge for group objects
+ const SfxItemSet& GetObjectItemSet() const;
+ void SetObjectItem(const SfxPoolItem& rItem);
+ void ClearObjectItem(const sal_uInt16 nWhich = 0);
+ void SetObjectItemSet(const SfxItemSet& rSet);
+ const SfxPoolItem& GetObjectItem(const sal_uInt16 nWhich) const;
+
+ // destructor is protected by purpose, use deleteSdrObjectSafeAndClearPointer(..)
+ // or deleteSafe to delete SdrObjects
virtual ~SdrObject();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
- TYPEINFO();
- SdrObject();
+ bool IsPasteResize() const { return mbPasteResize; }
+ void SetPasteResize(bool bOn) { if(mbPasteResize != bOn) mbPasteResize = bOn; }
- /** fres the SdrObject pointed to by the argument
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ // SdrModel/SdrPage access on SdrObject level
+ virtual SdrPage* getSdrPageFromSdrObject() const;
+ SdrModel& getSdrModelFromSdrObject() const;
+ SdrObjList* getParentOfSdrObject() const { return mpParentOfSdrObject; }
+ virtual SdrObjList* getChildrenOfSdrObject() const;
+
+ // shortcut for getting the parent as SdrObj directly e.g. SdrObjGroup
+ SdrObject* GetParentSdrObject() const;
+
+ // react on model/page change
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
+ // check if SdrObject may be filled
+ virtual bool IsClosedObj() const;
+
+ SdrObject(SdrModel& rSdrModel, const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix());
+
+ /** fres the SdrObject pointed to by the argument
In case the object has an SvxShape, which has the ownership of the object, it
is actually *not* deleted.
*/
- static void Free( SdrObject*& _rpObject );
-
- // This method is only for access from Property objects
- virtual void SetBoundRectDirty();
-
- virtual void SetObjList(SdrObjList* pNewObjList);
- SdrObjList* GetObjList() const { return pObjList; }
+ static void deleteSafe(SdrObject* pObject);
- virtual void SetPage(SdrPage* pNewPage);
- SdrPage* GetPage() const { return pPage; }
+ // acces to on-demand members
+ virtual sdr::properties::BaseProperties& GetProperties() const;
+ sdr::contact::ViewContact& GetViewContact() const;
+ sdr::gluepoint::GluePointProvider& GetGluePointProvider() const;
- virtual void SetModel(SdrModel* pNewModel);
- SdrModel* GetModel() const { return pModel; }
- SdrItemPool* GetObjectItemPool() const;
+ // DrawContact support: Methods for handling Object changes
+ void ActionChanged() const;
- void AddListener(SfxListener& rListener);
- void RemoveListener(SfxListener& rListener);
- const SfxBroadcaster* GetBroadcaster() const { return pPlusData!=NULL ? pPlusData->pBroadcast : NULL; }
+ SfxItemPool& GetObjectItemPool() const;
- virtual void AddReference(SdrVirtObj& rVrtObj);
- virtual void DelReference(SdrVirtObj& rVrtObj);
virtual sal_uInt32 GetObjInventor() const;
virtual sal_uInt16 GetObjIdentifier() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
// Layer interface
virtual SdrLayerID GetLayer() const;
- virtual void NbcSetLayer(SdrLayerID nLayer);
virtual void SetLayer(SdrLayerID nLayer);
- // renaming GetLayerSet -> getMergedHierarchyLayerSet to make clear what happens here. rSet needs to be empty.
virtual void getMergedHierarchyLayerSet(SetOfByte& rSet) const;
- // UserCall interface
- void SetUserCall(SdrObjUserCall* pUser) { pUserCall=pUser; }
- SdrObjUserCall* GetUserCall() const { return pUserCall; }
- void SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect) const;
-
- // Ein solcher Referenzpunkt ist z.B. der Punkt eines Symbols, der
- // der beim Einfuegen des Symbols auf das Raster gefangen werden soll
- // oder der Fixpunkt eines Bildes innerhalb eines Animationsobjektes.
- virtual FASTBOOL HasRefPoint() const;
- virtual Point GetRefPoint() const;
- virtual void SetRefPoint(const Point& rPnt);
-
// #i68101#
// An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, SdrObjGroup
// or SdrOle2Obj.
@@ -611,79 +510,28 @@ public:
void SetHTMLName(const String& rStr);
String GetHTMLName() const;
- // Fuer Gruppenobjekte
- sal_Bool IsGroupObject() const { return GetSubList()!=NULL; }
- virtual SdrObjList* GetSubList() const;
- SdrObject* GetUpGroup() const;
-
- // Ueber die Objekt-Ordnungsnummer kann man feststellen, ob ein Objekt vor
- // oder hinter einem anderen liegt. Objekte mit kleinen Ordnungsnummern werden
- // zuerst gezeichnet, Objekte mit grossen Ordnungsnummern zuletzt.
- // Wird die Reihenfolge der Objekte in der Liste veraendert, so wird ein
- // Dirty-Flag gesetzt (an der Page). Beim naechsten SdrObject::GetOrdNum()
- // werden die Ordnungsnummer aller Objekte der Liste neu bestimmt.
- sal_uInt32 GetOrdNum() const;
-
- // Diese Methode sollte nur verwendet werden, wenn man ganz genau weiss,
- // was man macht:
- sal_uInt32 GetOrdNumDirect() const { return nOrdNum; }
-
- // Das Setzen der Ordnungsnummer sollte nur vom Model bzw. von der Page
- // geschehen.
- void SetOrdNum(sal_uInt32 nNum) { nOrdNum=nNum; }
-
- /** Return the position in the navigation order for the called object.
- Note that this method may update the navigation position of the
- called and of other SdrObjects. Therefore this method can not be
- const.
- @return
- If no navigation position has been explicitly defined then the
- result of GetOrdNum() is returned.
- */
- sal_uInt32 GetNavigationPosition (void);
-
- /** Set the position in the navigation position to the given value.
- This method is typically used only by the model after a change to
- the navigation order.
- This method does not change the navigation position of other
- objects.
- Use SdrObjList::SetObjectNavigationPosition() instead.
- */
- void SetNavigationPosition (const sal_uInt32 nPosition);
-
- const AutoTimer* GetAutoTimer() const { return pPlusData!=NULL ? pPlusData->pAutoTimer : NULL; }
- AutoTimer* GetAutoTimer() { return pPlusData!=NULL ? pPlusData->pAutoTimer : NULL; }
- AutoTimer* ForceAutoTimer();
-
- // #111111#
- // To make clearer that this method may trigger RecalcBoundRect and thus may be
- // expensive and somtimes problematic (inside a bigger object change You will get
- // non-useful BoundRects sometimes) i rename that method from GetBoundRect() to
- // GetCurrentBoundRect().
- virtual const Rectangle& GetCurrentBoundRect() const;
+ // get objects current position in the object list which it belongs to.
+ // If not member of an object list, null is returned.
+ sal_uInt32 GetNavigationPosition() const;
- // #111111#
- // To have a possibility to get the last calculated BoundRect e.g for producing
- // the first rectangle for repaints (old and new need to be used) without forcing
- // a RecalcBoundRect (which may be problematical and expensive sometimes) i add here
- // a new method for accessing the last BoundRect.
- virtual const Rectangle& GetLastBoundRect() const;
+ // access to bounding range of the object. If SdrView is given, the
+ // view-dependent bound is returned, else the logical bounds. Take into
+ // account that these may be different, e.g. with hairlines the
+ // view-dependent bounds are evtl. bigger since the discrete view pixels cover
+ // more space than the logical definition
+ const basegfx::B2DRange& getObjectRange(const SdrView* pSdrView) const;
- virtual void RecalcBoundRect();
-
- void BroadcastObjectChange() const;
+ // access to minimal geometry bounding rectangle (Snap range). This includes all
+ // geometry as hairlines. Invisible parts are included, text is ignored
+ const basegfx::B2DRange& getSnapRange() const;
// Modified-Flag am Model setzen
virtual void SetChanged();
- // Tooling for painting a single object to a OutputDevice. This will be needed as long
+ // Tooling for painting a single object to a OutputDevice. This will be needed as sal_Int32
// as not all painting is changed to use DrawContact objects.
- sal_Bool SingleObjectPainter(OutputDevice& rOut) const;
- sal_Bool LineGeometryUsageIsNecessary() const;
-
- // Clone() soll eine komplette Kopie des Objektes erzeugen.
- virtual SdrObject* Clone() const;
- virtual void operator=(const SdrObject& rObj);
+ bool SingleObjectPainter(OutputDevice& rOut) const;
+ bool LineGeometryUsageIsNecessary() const;
// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
virtual void TakeObjNameSingul(String& rName) const;
@@ -694,9 +542,6 @@ public:
// Moechte man ein geschlossenes Polygon, so muss man es explizit schliessen.
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- // Die Kontur fuer TextToContour
- virtual basegfx::B2DPolyPolygon TakeContour() const;
-
// Ueber GetHdlCount gibt ein Objekt die Anzahl seiner Handles preis.
// Im Normalfall werden dies 8 sein, bei einer Strecke 2. Bei Polygonobjekten
// (Polygon,Spline,Bezier) kann die Handleanzahl wesentlich groesser werden.
@@ -706,12 +551,10 @@ public:
// Polygon wird das wohl ein einfacher Selektionshandle sein, bei einer
// Bezierkurve dagegen koennen das schon bis zu 3 Handles werden (inkl Gewichte).
// GetHdl() und GetPlusHdl() muessen Handleinstanzen mit new erzeugen!
- // Ein Objekt, das bei HasSpacialDrag() sal_True liefert muss diese Methoden
+ // Ein Objekt, das bei HasSpacialDrag() true liefert muss diese Methoden
// zur Verfuegung stellen (inkl. FillHdlList).
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
- virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
+ virtual void GetPlusHdl(SdrHdlList& rHdlList, const SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// Die Standardtransformationen (Move,Resize,Rotate,Mirror,Shear) werden von der
@@ -720,8 +563,8 @@ public:
// Stuetzstellen bei Splines, Gewichte bei Bezierkurven und Pointer von
// Labelobjekten muss vom Objekt selbst gehandled werden. Um das Model
// Statusfrei zu halten werden die Statusdaten an der View gehalten und dem
- // Objekt dann uebergeben. EndDrag liefrt im Normalfall sal_True fuer Erfolg.
- // sal_False kann zurueckgegeben werden, wenn das Dragging das Objekt nicht
+ // Objekt dann uebergeben. EndDrag liefrt im Normalfall true fuer Erfolg.
+ // false kann zurueckgegeben werden, wenn das Dragging das Objekt nicht
// veraendert hat, wobei dir evtl. Tatsache das die Maus nicht bewegt wurde
// bereits von der View abgefangen wird.
virtual bool hasSpecialDrag() const;
@@ -745,67 +588,52 @@ public:
// BegCreate()-Methode gerufen. Bei jedem MausMode wird dann MovCreate
// gerufen. BrkCreate() bedeutet, dass der User die interaktive Objekt-
// erzeugung abgebrochen hat. EndCreate() wird gerufen beim MouseUp-Event.
- // Liefert EndCreate() ein sal_True, so ist die Objekterzeugung abgeschlossen;
+ // Liefert EndCreate() ein true, so ist die Objekterzeugung abgeschlossen;
// das Objekt wird in die entsprechende Liste eingefuegt. Andernfalls
- // (EndCreate()==sal_False) gehe ich davon aus, dass weitere Punkte zur
+ // (EndCreate()==false) gehe ich davon aus, dass weitere Punkte zur
// Objekterzeugung notwendig sind (Polygon,...). Der Parameter eCmd
// enthaelt die Anzahl der Mausklicks (so die App diese durchreicht).
// BckCreate() -> Letztes EndCreate() rueckgaengig machen (z.B. letzten
// Polygonpunkt wieder loeschen).
- // RetrunCode: sal_True=Weiter gehts, sal_False=Create dadurch abgebrochen.
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat); // sal_True=Xor muss repainted werden
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
+ // RetrunCode: true=Weiter gehts, false=Create dadurch abgebrochen.
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat); // true=Xor muss repainted werden
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
// damit holt man sich den Pointer, der das Createn dieses Objekts symbolisiert
- virtual Pointer GetCreatePointer() const;
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
// Polygon das waehrend des Erzeugens aufgezogen wird
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- // Die Methoden Move, Resize, Rotate, Mirror, Shear, SetSnapRect und
- // SetLogicRect rufen jeweils die entsprechenden Nbc-Methoden, versenden einen
- // Repaint-Broadcast und setzen den Modified-Status am Model. Abgeleitete
- // Objekte sollten i.d.R. nur die Nbc-Methoden ueberladen.
- // Nbc bedeutet: 'NoBroadcast'.
- virtual void NbcMove (const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
-
- virtual void Move (const Size& rSiz);
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void Mirror(const Point& rRef1, const Point& rRef2);
- virtual void Shear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
-
- // Die relative Position eines Zeichenobjektes ist die Entfernung der
- // linken oberen Eche des logisch umschliessenden Rechtecks (SnapRect)
- // zum Anker.
- virtual void NbcSetRelativePos(const Point& rPnt);
- virtual void SetRelativePos(const Point& rPnt);
- virtual Point GetRelativePos() const;
- void ImpSetAnchorPos(const Point& rPnt) { aAnchor=rPnt; }
- virtual void NbcSetAnchorPos(const Point& rPnt);
- virtual void SetAnchorPos(const Point& rPnt);
- virtual const Point& GetAnchorPos() const;
-
- // Snap wird nicht auf dem BoundRect ausgefuehrt, sondern nach Moeglichkeit auf
- // logischen Koordinaten (also ohne Beruecksichtigung von Strichstaerke, ... ).
- // SetSnapRect() versucht das Objekt so hinzusizen, dass es in das uebergebene
- // Rect passt (ohne Strichstaerke, ...)
- virtual void RecalcSnapRect();
- virtual const Rectangle& GetSnapRect() const;
- virtual void SetSnapRect(const Rectangle& rRect);
- virtual void NbcSetSnapRect(const Rectangle& rRect);
-
- // Logic Rect: Beim Rect z.B. ohne Beruecksichtigung des Drehwinkels, Shear, ...
- virtual const Rectangle& GetLogicRect() const;
- virtual void SetLogicRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
+ // get/setSdrObjectTransformation
+ virtual const basegfx::B2DHomMatrix& getSdrObjectTransformation() const;
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+
+ // convenience functions for access to atomic decomposed object transformation parts
+ const basegfx::B2DVector& getSdrObjectScale() const { return maSdrObjectTransformation.getScale(); }
+ const basegfx::B2DPoint& getSdrObjectTranslate() const { return maSdrObjectTransformation.getTranslate(); }
+ double getSdrObjectRotate() const { return maSdrObjectTransformation.getRotate(); }
+ double getSdrObjectShearX() const { return maSdrObjectTransformation.getShearX(); }
+ bool isRotated() const { return maSdrObjectTransformation.isRotated(); }
+ bool isSheared() const { return maSdrObjectTransformation.isSheared(); }
+ bool isMirroredX() const { return maSdrObjectTransformation.isMirroredX(); }
+ bool isMirroredY() const { return maSdrObjectTransformation.isMirroredY(); }
+ bool isTranslatedX() const { return maSdrObjectTransformation.isTranslatedX(); }
+ bool isTranslatedY() const { return maSdrObjectTransformation.isTranslatedY(); }
+ bool isRotatedOrSheared() const { return maSdrObjectTransformation.isRotatedOrSheared(); }
+ bool isMirrored() const { return maSdrObjectTransformation.isMirrored(); }
+ bool isTranslated() const { return maSdrObjectTransformation.isTranslated(); }
+
+ // #i108739# Anchor read/write access
+ virtual void SetAnchorPos(const basegfx::B2DPoint& rPnt);
+ basegfx::B2DPoint GetAnchorPos() const;
+
+ // #i108739# extra bool flag for SC to get rid of the old Anchor-Hack
+ bool getUniversalApplicationFlag01() const { return mbUniversalApplicationFlag01; }
+ void setUniversalApplicationFlag01(bool bNew) { if(bNew != (bool)mbUniversalApplicationFlag01) mbUniversalApplicationFlag01 = bNew; }
/** the defaul is to set the logic rect to the given rectangle rMaxRect. If the shape
has an intrinsic aspect ratio it may set the logic rect so the aspect
@@ -813,16 +641,12 @@ public:
If bShrinkOnly is set to true, the size of the current logic rect will not
be changed if it is smaller than the given rectangle rMaxRect. */
- virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
-
- // Drehwinkel und Shear
- virtual long GetRotateAngle() const;
- virtual long GetShearAngle(FASTBOOL bVertical=sal_False) const;
+ virtual void AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool bShrinkOnly = false );
// Zum Fangen von/auf ausgezeichneten Punkten eines Obj (Polygonpunkte,
// Kreismittelpunkt, ...)
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
// Fuer Objekte, bei denen jeder einzelne Punkt verschoben werden kann,
// z.B. Polygone, Polylines, Linien, ... . Bei diesen Objekten werden
@@ -830,11 +654,10 @@ public:
// als Mehrfachselektion verschoben und gedreht, ...
// Nur solche Objekte koennen PlusHandles haben (z.B. die Gewichte an den
// Bezierkurven.
- virtual sal_Bool IsPolyObj() const;
- virtual sal_uInt32 GetPointCount() const;
- virtual Point GetPoint(sal_uInt32 i) const;
- void SetPoint(const Point& rPnt, sal_uInt32 i);
- virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
+ virtual bool IsPolygonObject() const;
+ virtual sal_uInt32 GetObjectPointCount() const;
+ virtual basegfx::B2DPoint GetObjectPoint(sal_uInt32 i) const;
+ virtual void SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i);
// Alle geometrischen Daten holen fuer's Undo/Redo
virtual SdrObjGeoData* GetGeoData() const;
@@ -844,57 +667,43 @@ public:
const SfxItemSet& GetMergedItemSet() const;
void SetMergedItem(const SfxPoolItem& rItem);
void ClearMergedItem(const sal_uInt16 nWhich = 0);
- void SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false);
const SfxPoolItem& GetMergedItem(const sal_uInt16 nWhich) const;
- // internal versions
-protected:
- const SfxItemSet& GetObjectItemSet() const;
- void SetObjectItem(const SfxPoolItem& rItem);
- void ClearObjectItem(const sal_uInt16 nWhich = 0);
- void SetObjectItemSet(const SfxItemSet& rSet);
- const SfxPoolItem& GetObjectItem(const sal_uInt16 nWhich) const;
-
-public:
// syntactical sugar for ItemSet accesses
- void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems = sal_False);
+ void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems = false);
// NotPersistAttr fuer Layer, ObjName, geometrische Transformationen, ...
- void TakeNotPersistAttr(SfxItemSet& rAttr, FASTBOOL bMerge) const;
+ void TakeNotPersistAttr(SfxItemSet& rAttr, bool bMerge) const;
void ApplyNotPersistAttr(const SfxItemSet& rAttr);
- void NbcApplyNotPersistAttr(const SfxItemSet& rAttr);
- // bDontRemoveHardAttr=FALSE: alle in der Vorlage gesetzten Attribute werden am
- // Zeichenobjekt auf Default gesetzt; TRUE: alle harten Attribute bleiben erhalten.
- void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
- virtual void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr);
+ // bDontRemoveHardAttr=false: alle in der Vorlage gesetzten Attribute werden am
+ // Zeichenobjekt auf Default gesetzt; true: alle harten Attribute bleiben erhalten.
+ virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr);
SfxStyleSheet* GetStyleSheet() const;
// TextEdit
- virtual FASTBOOL HasTextEdit() const;
+ virtual bool HasTextEdit() const;
- // Return==TRUE: TextEditMode gestartet
- virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
+ // Return==true: TextEditMode gestartet
+ virtual bool BegTextEdit(SdrOutliner& rOutl);
virtual void EndTextEdit(SdrOutliner& rOutl);
// Text wird im Format des Outliners gehalten
// SetOutlinerParaObject: Eigentumsuebereignung von *pTextObject!
virtual void SetOutlinerParaObject(OutlinerParaObject* pTextObject);
- virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
virtual OutlinerParaObject* GetOutlinerParaObject() const;
- virtual void NbcReformatText();
virtual void ReformatText();
-
void BurnInStyleSheetAttributes();
// Macrofaehigkeit, z.B. ein Rechteck als PushButton.
- virtual FASTBOOL HasMacro() const;
+ virtual bool HasMacro() const;
virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
- virtual void PaintMacro (OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const;
- virtual FASTBOOL DoMacro (const SdrObjMacroHitRec& rRec);
+ virtual void PaintMacro (OutputDevice& rOut, const SdrObjMacroHitRec& rRec) const;
+ virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
- sal_Bool IsMacroHit(const SdrObjMacroHitRec& rRec) const { return CheckMacroHit(rRec)!=NULL; }
+ bool IsMacroHit(const SdrObjMacroHitRec& rRec) const { return CheckMacroHit(rRec)!=NULL; }
// Konnektoren. (siehe auch Dokumentation in SvdoEdge.HXX, SdrEdgeObj
// sowie SvdGlue.HXX und SvdGlEV.HXX)
@@ -912,39 +721,18 @@ public:
// Kanten. Ebenso bei SetGluePoint()... am Knoten.
// Beim Verschieben/Resizen der Kante wird dagegen die Verbindung
// geloesst.
- // Objekt ist ein Knoten?
- virtual FASTBOOL IsNode() const;
// Automatische Klebepunkte:
// je 4 Scheitelpunkt- und Eckpositionen muss ein Knotenobjekt liefern
// i.d.R. 0=oben, 1=rechts, 2=unten, 3=links
- virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
-
- // i.d.R. 0=linksoben, 1=rechtsoben, 2=rechtsunten, 3=linksunten
- virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
+ virtual SdrGluePoint GetVertexGluePoint(sal_uInt32 nNum) const;
// Liste aller Klebepunkte. Kann NULL sein.
virtual const SdrGluePointList* GetGluePointList() const;
- //virtual SdrGluePointList* GetGluePointList();
// Nach veraendern der GluePointList muss man am Obj SendRepaintBroadcast rufen!
virtual SdrGluePointList* ForceGluePointList();
- // Temporaer zu setzen fuer Transformationen am Bezugsobjekt
- void SetGlueReallyAbsolute(FASTBOOL bOn);
- void NbcRotateGluePoints(const Point& rRef, long nWink, double sn, double cs);
- void NbcMirrorGluePoints(const Point& rRef1, const Point& rRef2);
- void NbcShearGluePoints (const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
-
- // Objekt ist eine Kante?
- virtual FASTBOOL IsEdge() const;
-
- // bTail1=TRUE: Linienanfang, sonst LinienEnde
- // pObj=NULL: Disconnect
- virtual void ConnectToNode(FASTBOOL bTail1, SdrObject* pObj);
- virtual void DisconnectFromNode(FASTBOOL bTail1);
- virtual SdrObject* GetConnectedNode(FASTBOOL bTail1) const;
-
/** sets the writing mode of the object's context
Objects which itself do not support different writing modes will ignore this call.
@@ -966,9 +754,9 @@ public:
// Bezierkurve (oder beides) zu verwandeln, dann sollten die folgenden
// Methoden ueberladen werden.
// Z.B. Ein RectObj mit Strichstaerke 10, SOLID_PEN in Polygon wandeln:
- // Im Modus bLineToArea=sal_False soll ein PolyObj mit 4 Stuetzstellen,
+ // Im Modus bLineToArea=false soll ein PolyObj mit 4 Stuetzstellen,
// Strichstaerke 10 und SOLiD_PEN erzeugt werden.
- // Im Modus bLineToArea=sal_True dagegen soll das generierte Obj immer ein
+ // Im Modus bLineToArea=true dagegen soll das generierte Obj immer ein
// LinienAttribut NULL_PEN haben, und die Linie (auch Linienmuster) selbst
// durch Polygonflaechen emuliert werden, die dadurch anschliessend vom
// Anwender manipuliert werden koennen. Das RectObj kann sich somit also
@@ -980,70 +768,60 @@ public:
// Der Returnwert ist jeweils ein SdrObject*, da als Rueckgabe zur Not
// auch Gruppenobjekte erlaubt sind (z.B. fuer SdrTextObj).
// Bei der Konvertierung von TextObj nach PathObj wird es wohl so sein,
- // dass beide Modi (bLineToArea=sal_True/sal_False) identisch sind.
- // Defaulted sind diese Methoden auf "Ich kann das nicht" (FALSE/NULL).
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
- SdrObject* ConvertToPolyObj(sal_Bool bBezier, sal_Bool bLineToArea) const;
+ // dass beide Modi (bLineToArea=true/false) identisch sind.
+ // Defaulted sind diese Methoden auf "Ich kann das nicht" (false/NULL).
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
+ SdrObject* ConvertToPolyObj(bool bBezier, bool bLineToArea) const;
// convert this path object to contour object; bForceLineDash converts even
// when there is no filled new polygon created from line-to-polygon conversion,
// specially used for XLINE_DASH and 3D conversion
- SdrObject* ConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDash = sal_False) const;
- SdrObject* ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDash = sal_False) const;
+ SdrObject* ConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
+ SdrObject* ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
- // TRUE: Referenz auf ein Obj
- sal_Bool IsVirtualObj() const { return bVirtObj; }
-
- // sal_True=Obj kann warsch. gefuellt werden; sal_False=Obj kann warsch. Linienenden haben.
+ // true=Obj kann warsch. gefuellt werden; false=Obj kann warsch. Linienenden haben.
// ungueltig, wenn es sich um ein GroupObj handelt.
- sal_Bool IsClosedObj() const { return bClosedObj; }
-
- sal_Bool IsEdgeObj() const { return bIsEdge; }
- sal_Bool Is3DObj() const { return bIs3DObj; }
- sal_Bool IsUnoObj() const { return bIsUnoObj; }
- sal_Bool IsMasterCachable() const { return !bNotMasterCachable; }
- sal_Bool ShareLock() { sal_Bool r=!bNetLock; bNetLock=sal_True; return r; }
- void ShareUnlock() { bNetLock=sal_False; }
- sal_Bool IsShareLock() const { return bNetLock; }
- void SetMarkProtect(sal_Bool bProt) { bMarkProt=bProt; }
- sal_Bool IsMarkProtect() const { return bMarkProt; }
- void SetInserted(sal_Bool bIns);
- sal_Bool IsInserted() const { return bInserted; }
- void SetGrouped(sal_Bool bGrp) { bGrouped=bGrp; }
- sal_Bool IsGrouped() const { return bGrouped; }
- void SetMoveProtect(sal_Bool bProt);
- sal_Bool IsMoveProtect() const { return bMovProt; }
- void SetResizeProtect(sal_Bool bProt);
- sal_Bool IsResizeProtect() const { return bSizProt; }
- void SetPrintable(sal_Bool bPrn);
- sal_Bool IsPrintable() const { return !bNoPrint; }
- void SetVisible(sal_Bool bVisible);
- sal_Bool IsVisible() const { return mbVisible; }
- void SetEmptyPresObj(sal_Bool bEpt) { bEmptyPresObj=bEpt; }
- sal_Bool IsEmptyPresObj() const { return bEmptyPresObj; }
- void SetNotVisibleAsMaster(sal_Bool bFlg) { bNotVisibleAsMaster=bFlg; }
- sal_Bool IsNotVisibleAsMaster() const { return bNotVisibleAsMaster; }
-
- // #i25616#
- sal_Bool LineIsOutsideGeometry() const { return mbLineIsOutsideGeometry; }
-
- // #i25616#
- sal_Bool DoesSupportTextIndentingOnLineWidthChange() const { return mbSupportTextIndentingOnLineWidthChange; }
+ virtual bool IsSdrEdgeObj() const;
+ virtual bool IsE3dObject() const;
+ virtual bool IsSdrUnoObj() const;
+ virtual bool IsSdrGrafObj() const;
+ virtual bool DoesSupportTextIndentingOnLineWidthChange() const;
+
+ // void SetObjectInserted(bool bNew);
+ bool IsObjectInserted() const { return 0 != getParentOfSdrObject(); }
+
+ void SetMoveProtect(bool bNew);
+ bool IsMoveProtect() const { return mbMoveProtect; }
+
+ void SetVisible(bool bNew);
+ bool IsVisible() const { return mbVisible; }
+
+ void SetResizeProtect(bool bNew);
+ bool IsResizeProtect() const { return mbSizeProtect; }
+
+ void SetPrintable(bool bNew);
+ bool IsPrintable() const { return !mbNoPrint; }
+
+ void SetMarkProtect(bool bNew) { if(mbMarkProtect != bNew) mbMarkProtect = bNew; }
+ bool IsMarkProtect() const { return mbMarkProtect; }
+
+ void SetEmptyPresObj(bool bNew) { if(mbEmptyPresObj != bNew) mbEmptyPresObj = bNew; }
+ bool IsEmptyPresObj() const { return mbEmptyPresObj; }
+
+ void SetNotVisibleAsMaster(bool bNew) { if(mbNotVisibleAsMaster != bNew) mbNotVisibleAsMaster = bNew; }
+ bool IsNotVisibleAsMaster() const { return mbNotVisibleAsMaster; }
// applikationsspeziefische Daten
- sal_uInt16 GetUserDataCount() const;
- SdrObjUserData* GetUserData(sal_uInt16 nNum) const;
+ sal_uInt32 GetUserDataCount() const;
+ SdrObjUserData* GetUserData(sal_uInt32 nNum) const;
// Insert uebernimmt den auf dem Heap angelegten Record in den Besitz
// des Zeichenobjekts
- void InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos=0xFFFF);
+ void InsertUserData(SdrObjUserData* pData, sal_uInt32 nPos=0xffffffff);
// Delete entfernt den Record aus der Liste und ruft
// ein delete (FreeMem+Dtor).
- void DeleteUserData(sal_uInt16 nNum);
-
- // ItemPool fuer dieses Objekt wechseln
- void MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel = 0L);
+ void DeleteUserData(sal_uInt32 nNum);
////////////////////////////////////////////////////////////////////////////////////////////////////
// access to the UNO representation of the shape
@@ -1052,23 +830,6 @@ public:
static SdrObject* getSdrObjectFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xInt );
- // helper struct for granting access exclusive to SvxShape
- struct GrantXShapeAccess
- {
- friend class SvxShape;
- private:
- GrantXShapeAccess() { }
- };
-
- // setting the UNO representation is allowed for the UNO representation itself only!
- void setUnoShape(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape,
- GrantXShapeAccess /*aGrant*/
- )
- {
- impl_setUnoShape( _rxUnoShape );
- }
-
/** retrieves the instance responsible for notifying changes in the properties of the shape associated with
the SdrObject
@@ -1077,8 +838,7 @@ public:
@throws ::com::sun::star::uno::RuntimeException
if there does nt yet exists an SvxShape instance associated with the SdrObject.
*/
- ::svx::PropertyChangeNotifier&
- getShapePropertyChangeNotifier();
+ ::svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
/** notifies a change in the given property, to all applicable listeners registered at the associated SvxShape
@@ -1086,29 +846,7 @@ public:
exception that it is allowed to be called when there does not yet exist an associated SvxShape - in which
case the method will silently return without doing anything.
*/
- void notifyShapePropertyChange( const ::svx::ShapeProperty _eProperty ) const;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // transformation interface for StarOfficeAPI. This implements support for
- // homogen 3x3 matrices containing the transformation of the SdrObject. At the
- // moment it contains a shearX, rotation and translation, but for setting all linear
- // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
- //
- // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
- // with the base geometry and returns TRUE. Otherwise it returns FALSE.
- virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
-
- // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
- // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
- // to use (0,0) as upper left and will be scaled to the given size in the matrix.
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
-
- sal_Bool IsTransparent( sal_Bool bCheckForAlphaChannel = sal_False ) const;
-
- // #116168#
- // Give info if object is in destruction
- sal_Bool IsInDestruction() const;
+ void notifyShapePropertyChange( const ::svx::ShapeProperty _eProperty ) const;
// return if fill is != XFILL_NONE
bool HasFillStyle() const;
@@ -1118,65 +856,20 @@ public:
// the following methods are used to control it;
// usually this data makes no sence after the import is finished, since the object
// might be resized
- Rectangle GetBLIPSizeRectangle() const;
- void SetBLIPSizeRectangle( const Rectangle& aRect );
+ const basegfx::B2DRange GetBLIPSizeRange() const;
+ void SetBLIPSizeRange( const basegfx::B2DRange& aRect );
-protected:
- void impl_setUnoShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape );
-
-private:
- /** only for internal use!
- */
- SvxShape* getSvxShape();
-
- /** do not use directly, always use getSvxShape() if you have to! */
- SvxShape* mpSvxShape;
- ::com::sun::star::uno::WeakReference< ::com::sun::star::uno::XInterface >
- maWeakUnoShape;
-};
-
-//************************************************************
-// SdrDummyObj
-//
-// Wer sich eigene Objekte schafft muss einen Link in der Klasse
-// SdrObjFactory setzen. Der Handler hat folgendes aussehen:
-// void Hdl(SdrObjFactory*)
-// Er muss sich aus der uebergebenen Instanz die Werte nInventor und
-// nIdentifier ansehen und entsprechend mit new eine Zeichenobjektinstanz
-// erzeugen. Einen Zeiger auf diese Instanz hat er in der Membervariablen
-// pNewObj zu hinterlassen.
-//
-//************************************************************
-
-class SVX_DLLPUBLIC SdrObjFactory
-{
-public:
- sal_uInt32 nInventor;
- sal_uInt16 nIdentifier;
-
- // fuer MakeNewObj():
- SdrPage* pPage;
- SdrModel* pModel;
- SdrObject* pNewObj;
-
- // fuer MakeNewObjUserData():
- SdrObject* pObj;
- SdrObjUserData* pNewData;
-
-private:
- SVX_DLLPRIVATE SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNewPage, SdrModel* pNewModel);
- SVX_DLLPRIVATE SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrObject* pObj1);
-
-public:
- static SdrObject* MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel=NULL);
- static void InsertMakeObjectHdl(const Link& rLink);
- static void RemoveMakeObjectHdl(const Link& rLink);
- static SdrObjUserData* MakeNewObjUserData(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrObject* pObj);
- static void InsertMakeUserDataHdl(const Link& rLink);
- static void RemoveMakeUserDataHdl(const Link& rLink);
+ // get all SdrEdgeObjs connected to this object
+ ::std::vector< SdrEdgeObj* > getAllConnectedSdrEdgeObj() const;
};
typedef tools::WeakReference< SdrObject > SdrObjectWeakRef;
+#define deleteSdrObjectSafeAndClearPointer(Obj) { SdrObject::deleteSafe(Obj); Obj = 0; }
+#define deleteSdrObjectSafe(Obj) { SdrObject::deleteSafe(Obj); }
+
+//////////////////////////////////////////////////////////////////////////////
#endif //_SVDOBJ_HXX
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdocapt.hxx b/svx/inc/svx/svdocapt.hxx
index 99963edbc6ba..0436b273e450 100644
--- a/svx/inc/svx/svdocapt.hxx
+++ b/svx/inc/svx/svdocapt.hxx
@@ -44,7 +44,7 @@ namespace sdr { namespace properties {
//************************************************************
// #109872#
-class SdrCaptObjGeoData : public SdrTextObjGeoData
+class SdrCaptObjGeoData : public SdrObjGeoData
{
public:
Polygon aTailPoly;
@@ -61,17 +61,11 @@ private:
friend class sdr::properties::CaptionProperties;
friend class SdrTextObj; // fuer ImpRecalcTail() bei AutoGrow
-protected:
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
-private:
Polygon aTailPoly; // das ganze Polygon des Schwanzes
sal_Bool mbSpecialTextBoxShadow; // for calc special shadow, default FALSE
sal_Bool mbFixedTail; // for calc note box fixed tail, default FALSE
- Point maFixedTailPos; // for calc note box fixed tail position.
+ basegfx::B2DPoint maFixedTailPos; // for calc note box fixed tail position.
-private:
SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams& rPara) const;
SVX_DLLPRIVATE void ImpCalcTail1(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
SVX_DLLPRIVATE void ImpCalcTail2(const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
@@ -80,16 +74,25 @@ private:
SVX_DLLPRIVATE void ImpCalcTail (const ImpCaptParams& rPara, Polygon& rPoly, Rectangle& rRect) const;
SVX_DLLPRIVATE void ImpRecalcTail();
-public:
- TYPEINFO();
- SdrCaptionObj();
- SdrCaptionObj(const Rectangle& rRect);
- SdrCaptionObj(const Rectangle& rRect, const Point& rTail);
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
virtual ~SdrCaptionObj();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+ SdrCaptionObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix(),
+ const basegfx::B2DPoint* pTail = 0);
+
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void operator=(const SdrObject& rObj);
// for calc: special shadow only for text box
void SetSpecialTextBoxShadow() { mbSpecialTextBoxShadow = sal_True; }
@@ -102,11 +105,9 @@ public:
virtual void TakeObjNamePlural(String& rName) const;
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual void SetModel(SdrModel* pNewModel);
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// special drag methods
virtual bool hasSpecialDrag() const;
@@ -114,30 +115,16 @@ public:
virtual bool applySpecialDrag(SdrDragStat& rDrag);
virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- virtual Pointer GetCreatePointer() const;
-
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
-
- virtual void NbcSetRelativePos(const Point& rPnt);
- virtual Point GetRelativePos() const;
- virtual void NbcSetAnchorPos(const Point& rPnt);
- virtual const Point& GetAnchorPos() const;
-
- virtual void RecalcSnapRect();
- virtual const Rectangle& GetSnapRect() const;
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual const Rectangle& GetLogicRect() const;
- virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
protected:
virtual SdrObjGeoData* NewGeoData() const;
@@ -145,20 +132,16 @@ protected:
virtual void RestGeoData(const SdrObjGeoData& rGeo);
public:
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
-
- const Point& GetTailPos() const;
- void SetTailPos(const Point& rPos);
- void NbcSetTailPos(const Point& rPos);
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
- // #i32599#
- // Add own implementation for TRSetBaseGeometry to handle TailPos over changes
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
-
- inline const Point& GetFixedTailPos() const {return maFixedTailPos;}
+ const basegfx::B2DPoint GetTailPos() const;
+ void SetTailPos(const basegfx::B2DPoint& rPos);
+ inline const basegfx::B2DPoint& GetFixedTailPos() const {return maFixedTailPos;}
// geometry access
::basegfx::B2DPolygon getTailPolygon() const;
+
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/svdocirc.hxx b/svx/inc/svx/svdocirc.hxx
index c835464b5ba6..292dee633bcf 100644
--- a/svx/inc/svx/svdocirc.hxx
+++ b/svx/inc/svx/svdocirc.hxx
@@ -27,94 +27,71 @@
#include <svx/svdorect.hxx>
#include "svx/svxdllapi.h"
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// defines for circle type
-namespace sdr { namespace properties {
- class CircleProperties;
-}}
-
-//************************************************************
-// Hilfsklasse SdrCircObjGeoData
-//************************************************************
-
-// #109872#
-class SdrCircObjGeoData : public SdrTextObjGeoData
+enum SdrCircleObjType
{
-public:
- long nStartWink;
- long nEndWink;
+ /// basic types the circle may have
+ CircleType_Circle = 0, // old OBJ_CIRC
+ CircleType_Sector, // old OBJ_SECT
+ CircleType_Arc, // old OBJ_CARC
+ CircleType_Segment, // old OBJ_CCUT
};
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
// SdrCircObj
-//************************************************************
class SVX_DLLPUBLIC SdrCircObj : public SdrRectObj
{
-private:
- // to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo()
- friend class sdr::properties::CircleProperties;
-
- // only for SdrCircleAttributes
- SdrObjKind GetCircleKind() const { return meCircleKind; }
-
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- SdrObjKind meCircleKind;
- long nStartWink;
- long nEndWink;
+ // type of object
+ SdrCircleObjType meSdrCircleObjType;
- // bitfield
- unsigned mbPolygonIsLine : 1;
+ // [0.0 .. F_2PI], default is 0.0 for start and F_2PI for end
+ double mfStartAngle;
+ double mfEndAngle;
-private:
- SVX_DLLPRIVATE basegfx::B2DPolygon ImpCalcXPolyCirc(const SdrObjKind eKind, const Rectangle& rRect1, long nStart, long nEnd) const;
- SVX_DLLPRIVATE void ImpSetCreateParams(SdrDragStat& rStat) const;
- SVX_DLLPRIVATE void ImpSetAttrToCircInfo(); // Werte vom Pool kopieren
- SVX_DLLPRIVATE void ImpSetCircInfoToAttr(); // Werte in den Pool kopieren
-
- // Liefert sal_True, wenn das Painten ein XPolygon erfordert.
- SVX_DLLPRIVATE FASTBOOL PaintNeedsXPolyCirc() const; // PaintNeedsXPoly-> PaintNeedsXPolyCirc
- SVX_DLLPRIVATE virtual void RecalcXPoly();
+ virtual ~SdrCircObj();
-protected:
- virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
- SdrCircObj(SdrObjKind eNewKind); // Circ, CArc, Sect oder CCut
- SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect);
-
- // 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h
- // Der Verlauf des Kreises von StartWink nach EndWink ist immer entgegen
- // dem Uhrzeigersinn.
- // Wenn nNewStartWink==nNewEndWink hat der Kreisbogen einen Verlaufswinkel
- // von 0 Grad. Bei nNewStartWink+36000==nNewEndWink ist der Verlaufswinkel
- // 360.00 Grad.
- SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewStartWink, long nNewEndWink);
- virtual ~SdrCircObj();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrCircleObjType eSdrCircleObjType = CircleType_Circle,
+ const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix(),
+ double fNewStartWink = 0.0,
+ double fNewEndWink = F_2PI);
+
+ virtual bool IsClosedObj() const;
+ double GetStartAngle() const;
+ double GetEndAngle() const;
+
+ SdrCircleObjType GetSdrCircleObjType() const;
+ void SetSdrCircleObjType(SdrCircleObjType eNew);
+
+ void SetStartAngle(double fNew);
+ void SetEndAngle(double fNew);
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
- virtual void operator=(const SdrObject& rObj);
- virtual void RecalcSnapRect();
- virtual void NbcSetSnapRect(const Rectangle& rRect);
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// special drag methods
virtual bool hasSpecialDrag() const;
@@ -122,28 +99,23 @@ public:
virtual bool applySpecialDrag(SdrDragStat& rDrag);
virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
- virtual void BrkCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- virtual Pointer GetCreatePointer() const;
- virtual void NbcMove(const Size& aSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
protected:
virtual SdrObjGeoData* NewGeoData() const;
virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
virtual void RestGeoData(const SdrObjGeoData& rGeo);
-public:
- long GetStartWink() const { return nStartWink; }
- long GetEndWink() const { return nEndWink; }
-
};
+//////////////////////////////////////////////////////////////////////////////
+
#endif //_SVDOCIRC_HXX
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdoedge.hxx b/svx/inc/svx/svdoedge.hxx
index 45d1c9f25e8f..c70aedb75577 100644
--- a/svx/inc/svx/svdoedge.hxx
+++ b/svx/inc/svx/svdoedge.hxx
@@ -26,18 +26,16 @@
#include <svx/svdotext.hxx>
#include <svx/svdglue.hxx>
-#include "svx/svxdllapi.h"
+#include <svx/svxdllapi.h>
+#include <basegfx/polygon/b2dpolygon.hxx>
//************************************************************
// Vorausdeklarationen
//************************************************************
class SdrDragMethod;
-class SdrPageView;
-
-namespace sdr { namespace properties {
- class ConnectorProperties;
-}}
+class SdrView;
+namespace sdr { namespace properties { class ConnectorProperties; }}
//************************************************************
// Hilfsklasse SdrObjConnection
@@ -45,42 +43,38 @@ namespace sdr { namespace properties {
class SdrObjConnection
{
+private:
friend class SdrEdgeObj;
friend class ImpEdgeHdl;
friend class SdrCreateView;
protected:
- Point aObjOfs; // Wird beim Draggen eines Knotens gesetzt
- SdrObject* pObj; // Referenziertes Objekt
- long nXDist; // Hor. Objektabstand wenn bXDistOvr=TRUE
- long nYDist; // Vert. Objektabstand wenn bYDistOvr=TRUE
- sal_uInt16 nConId; // Konnektornummer
+ basegfx::B2DPoint maObjOfs; // Wird beim Draggen eines Knotens gesetzt
+ SdrObject* mpConnectedSdrObject; // Referenziertes Objekt
+ sal_uInt16 mnConnectorId; // Konnektornummer
// bitfield
- unsigned bBestConn : 1; // sal_True= es wird der guenstigste Konnektor gesucht
- unsigned bBestVertex : 1; // sal_True= es wird der guenstigste Scheitelpunkt zum konnekten gesucht
- unsigned bXDistOvr : 1; // sal_True= Hor. Objektabstand wurde gedragt (Overwrite)
- unsigned bYDistOvr : 1; // sal_True= Vert. Objektabstand wurde gedragt (Overwrite)
- unsigned bAutoVertex : 1; // AutoConnector am Scheitelpunkt nCon
- unsigned bAutoCorner : 1; // AutoConnector am Eckpunkt nCon
+ bool mbBestConnection : 1; // true= es wird der guenstigste Konnektor gesucht
+ bool mbBestVertex : 1; // true= es wird der guenstigste Scheitelpunkt zum konnekten gesucht
+ bool mbAutoVertex : 1; // AutoConnector am Scheitelpunkt nCon
public:
- SdrObjConnection() { ResetVars(); }
SVX_DLLPUBLIC ~SdrObjConnection();
+ SdrObjConnection() { ResetVars(); }
void ResetVars();
- FASTBOOL TakeGluePoint(SdrGluePoint& rGP, FASTBOOL bSetAbsolutePos) const;
-
- inline void SetBestConnection( sal_Bool rB ) { bBestConn = rB; };
- inline void SetBestVertex( sal_Bool rB ) { bBestVertex = rB; };
- inline void SetAutoVertex( sal_Bool rB ) { bAutoVertex = rB; };
- inline void SetConnectorId( sal_uInt16 nId ) { nConId = nId; };
-
- inline sal_Bool IsBestConnection() const { return bBestConn; };
- inline sal_Bool IsBestVertex() const { return bBestVertex; };
- inline sal_Bool IsAutoVertex() const { return bAutoVertex; };
- inline sal_uInt16 GetConnectorId() const { return nConId; };
- inline SdrObject* GetObject() const { return pObj; }
+ bool TakeGluePoint(SdrGluePoint& rGP, bool bSetAbsolutePos) const;
+
+ inline void SetBestConnection( bool rB ) { mbBestConnection = rB; };
+ inline void SetBestVertex( bool rB ) { mbBestVertex = rB; };
+ inline void SetAutoVertex( bool rB ) { mbAutoVertex = rB; };
+ inline void SetConnectorId( sal_uInt16 nId ) { mnConnectorId = nId; };
+
+ inline bool IsBestConnection() const { return mbBestConnection; };
+ inline bool IsBestVertex() const { return mbBestVertex; };
+ inline bool IsAutoVertex() const { return mbAutoVertex; };
+ inline sal_uInt16 GetConnectorId() const { return mnConnectorId; };
+ inline SdrObject* GetObject() const { return mpConnectedSdrObject; }
};
//************************************************************
@@ -95,21 +89,20 @@ public:
// Die 5 Distanzen werden beim draggen bzw. per SetAttr gesetzt und von
// ImpCalcEdgeTrack ausgewertet. Per Get/SetAttr/Get/SetStyleSh werden
// jedoch nur 0-3 longs transportiert.
- Point aObj1Line2;
- Point aObj1Line3;
- Point aObj2Line2;
- Point aObj2Line3;
- Point aMiddleLine;
+ basegfx::B2DPoint aObj1Line2;
+ basegfx::B2DPoint aObj1Line3;
+ basegfx::B2DPoint aObj2Line2;
+ basegfx::B2DPoint aObj2Line3;
+ basegfx::B2DPoint aMiddleLine;
// Nachfolgende Werte werden von ImpCalcEdgeTrack gesetzt
long nAngle1; // Austrittswinkel am Obj1
long nAngle2; // Austrittswinkel am Obj2
- sal_uInt16 nObj1Lines; // 1..3
- sal_uInt16 nObj2Lines; // 1..3
- sal_uInt16 nMiddleLine; // 0xFFFF=keine, sonst Punktnummer des Linienbeginns
+ sal_uInt16 nObj1Lines; // 1..3
+ sal_uInt16 nObj2Lines; // 1..3
+ sal_uInt16 nMiddleLine; // 0xFFFF=keine, sonst Punktnummer des Linienbeginns
char cOrthoForm; // Form des Ortho-Verbindes, z.B. 'Z','U',I','L','S',...
-public:
SdrEdgeInfoRec()
: nAngle1(0),
nAngle2(0),
@@ -119,29 +112,28 @@ public:
cOrthoForm(0)
{}
- Point& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode);
- const Point& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode) const { return ((SdrEdgeInfoRec*)this)->ImpGetLineVersatzPoint(eLineCode); }
- sal_uInt16 ImpGetPolyIdx(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const;
- FASTBOOL ImpIsHorzLine(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const;
- void ImpSetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP, long nVal);
- long ImpGetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const;
+ basegfx::B2DPoint& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode);
+ const basegfx::B2DPoint& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode) const { return const_cast< SdrEdgeInfoRec* >(this)->ImpGetLineVersatzPoint(eLineCode); }
+ sal_uInt16 ImpGetPolyIdx(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount) const;
+ bool ImpIsHorzLine(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount) const;
+ void ImpSetLineVersatz(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount, long nVal);
+ long ImpGetLineVersatz(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount) const;
};
//************************************************************
// Hilfsklasse SdrEdgeObjGeoData
//************************************************************
-class SdrEdgeObjGeoData : public SdrTextObjGeoData
+class SdrEdgeObjGeoData : public SdrObjGeoData
{
public:
- SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs
- SdrObjConnection aCon2; // Verbindungszustand des Linienendes
- XPolygon* pEdgeTrack;
- sal_Bool bEdgeTrackDirty;// sal_True=Verbindungsverlauf muss neu berechnet werden.
- sal_Bool bEdgeTrackUserDefined;
- SdrEdgeInfoRec aEdgeInfo;
+ SdrObjConnection maCon1; // Verbindungszustand des Linienanfangs
+ SdrObjConnection maCon2; // Verbindungszustand des Linienendes
+ basegfx::B2DPolygon maEdgeTrack;
+ bool mbEdgeTrackDirty;// true=Verbindungsverlauf muss neu berechnet werden.
+ bool mbEdgeTrackUserDefined;
+ SdrEdgeInfoRec maEdgeInfo;
-public:
SdrEdgeObjGeoData();
virtual ~SdrEdgeObjGeoData();
};
@@ -163,95 +155,86 @@ protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs
- SdrObjConnection aCon2; // Verbindungszustand des Linienendes
+ SdrObjConnection maCon1; // Verbindungszustand des Linienanfangs
+ SdrObjConnection maCon2; // Verbindungszustand des Linienendes
- XPolygon* pEdgeTrack;
- sal_uInt16 nNotifyingCount; // Verrieglung
- SdrEdgeInfoRec aEdgeInfo;
+ basegfx::B2DPolygon maEdgeTrack;
+ SdrEdgeInfoRec maEdgeInfo;
// bitfield
- unsigned bEdgeTrackDirty : 1; // sal_True=Verbindungsverlauf muss neu berechnet werden.
- unsigned bEdgeTrackUserDefined : 1;
+ bool mbEdgeTrackDirty : 1; // true=Verbindungsverlauf muss neu berechnet werden.
+ bool mbEdgeTrackUserDefined : 1;
// #109007#
// Bool to allow supporession of default connects at object
- // inside test (HitTest) and object center test (see ImpFindConnector())
- unsigned mbSuppressDefaultConnect : 1;
-
- // #110649#
- // Flag value for avoiding death loops when calculating BoundRects
- // from circularly connected connectors. A coloring algorythm is used
- // here. When the GetCurrentBoundRect() calculation of a SdrEdgeObj
- // is running, the flag is set, else it is always sal_False.
- unsigned mbBoundRectCalculationRunning : 1;
+ // inside test (HitTest) and object center test (see FindConnector())
+ bool mbSuppressDefaultConnect : 1;
-public:
- // #109007#
- // Interface to default connect suppression
- void SetSuppressDefaultConnect(sal_Bool bNew) { mbSuppressDefaultConnect = bNew; }
- sal_Bool GetSuppressDefaultConnect() const { return mbSuppressDefaultConnect; }
-
- // #110649#
- sal_Bool IsBoundRectCalculationRunning() const { return mbBoundRectCalculationRunning; }
-
-protected:
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- XPolygon ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const Rectangle& rRect, const Point& rCenter) const;
void ImpRecalcEdgeTrack(); // Neuberechnung des Verbindungsverlaufs
- XPolygon ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& rCon1, SdrObjConnection& rCon2, SdrEdgeInfoRec* pInfo) const;
- XPolygon ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rectangle& rBoundRect1, const Rectangle& rBewareRect1,
- const Point& rPt2, long nAngle2, const Rectangle& rBoundRect2, const Rectangle& rBewareRect2,
- sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const;
- static FASTBOOL ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=NULL);
- sal_uInt16 ImpCalcEscAngle(SdrObject* pObj, const Point& aPt2) const;
- FASTBOOL ImpStripPolyPoints(XPolygon& rXP) const; // entfernen ueberfluessiger Punkte
- void ImpSetTailPoint(FASTBOOL bTail1, const Point& rPt);
+ basegfx::B2DPolygon ImpCalcEdgeTrack(
+ SdrObjConnection& rCon1,
+ SdrObjConnection& rCon2,
+ SdrEdgeInfoRec* pInfo) const;
+ static void FindConnector(
+ const basegfx::B2DPoint& rPt,
+ const SdrView& rSdrView,
+ SdrObjConnection& rCon,
+ const SdrEdgeObj* pThis,
+ OutputDevice* pOut = 0);
+ sal_uInt16 ImpCalcEscAngle(SdrObject* pObj, const basegfx::B2DPoint& aPt2) const;
+ void ImpSetTailPoint(bool bTail1, const basegfx::B2DPoint& rPt);
void ImpUndirtyEdgeTrack(); // eventuelle Neuberechnung des Verbindungsverlaufs
void ImpDirtyEdgeTrack(); // invalidate connector path, so it will be recalculated next time
void ImpSetAttrToEdgeInfo(); // Werte vom Pool nach aEdgeInfo kopieren
void ImpSetEdgeInfoToAttr(); // Werte vom aEdgeInfo in den Pool kopieren
+ virtual ~SdrEdgeObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- SdrEdgeObj();
- virtual ~SdrEdgeObj();
+ // #109007#
+ // Interface to default connect suppression
+ void SetSuppressDefaultConnect(bool bNew) { mbSuppressDefaultConnect = bNew; }
+ bool GetSuppressDefaultConnect() const { return mbSuppressDefaultConnect; }
+
+ virtual bool IsSdrEdgeObj() const;
+ virtual bool IsClosedObj() const;
- SdrObjConnection& GetConnection(FASTBOOL bTail1) { return *(bTail1 ? &aCon1 : &aCon2); }
+ SdrEdgeObj(SdrModel& rSdrModel);
+
+ SdrObjConnection& GetConnection(bool bTail1) { return *(bTail1 ? &maCon1 : &maCon2); }
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual const Rectangle& GetCurrentBoundRect() const;
- virtual const Rectangle& GetSnapRect() const;
- virtual FASTBOOL IsNode() const;
- virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
- virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
+ virtual SdrGluePoint GetVertexGluePoint(sal_uInt32 nNum) const;
virtual const SdrGluePointList* GetGluePointList() const;
virtual SdrGluePointList* ForceGluePointList();
- virtual FASTBOOL IsEdge() const;
- // bTail1=TRUE: Linienanfang, sonst LinienEnde
+ // bTail1=true: Linienanfang, sonst LinienEnde
// pObj=NULL: Disconnect
- void SetEdgeTrackDirty() { bEdgeTrackDirty=sal_True; }
- void ConnectToNode(FASTBOOL bTail1, SdrObject* pObj);
- void DisconnectFromNode(FASTBOOL bTail1);
- SdrObject* GetConnectedNode(FASTBOOL bTail1) const;
- const SdrObjConnection& GetConnection(FASTBOOL bTail1) const { return *(bTail1 ? &aCon1 : &aCon2); }
- FASTBOOL CheckNodeConnection(FASTBOOL bTail1) const;
-
- virtual void RecalcSnapRect();
- virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual void operator=(const SdrObject& rObj);
+ void SetEdgeTrackDirty() { mbEdgeTrackDirty = true; }
+ void ConnectToNode(bool bTail1, SdrObject* pObj);
+ void DisconnectFromNode(bool bTail1);
+ SdrObject* GetConnectedNode(bool bTail1) const;
+ const SdrObjConnection& GetConnection(bool bTail1) const { return *(bTail1 ? &maCon1 : &maCon2); }
+ bool CheckNodeConnection(bool bTail1) const;
+
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
- void SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly );
- basegfx::B2DPolyPolygon GetEdgeTrackPath() const;
+ void SetEdgeTrackPath( const basegfx::B2DPolygon& rPoly );
+ basegfx::B2DPolygon GetEdgeTrackPath() const;
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ sal_uInt32 impOldGetHdlCount() const;
+ SdrHdl* impOldGetHdl(SdrHdlList& rHdlList, sal_uInt32 nHdlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// special drag methods
virtual bool hasSpecialDrag() const;
@@ -262,33 +245,22 @@ public:
// FullDrag support
virtual SdrObject* getFullDragClone() const;
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcMove(const Size& aSize);
- virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact);
-
- // #54102# added rotate, mirrorn and shear support
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
- // #102344# Added missing implementation
- virtual void NbcSetAnchorPos(const Point& rPnt);
-
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- virtual Pointer GetCreatePointer() const;
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
- virtual sal_Bool IsPolyObj() const;
- virtual sal_uInt32 GetPointCount() const;
- virtual Point GetPoint(sal_uInt32 i) const;
- virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
+ virtual bool IsPolygonObject() const;
+ virtual sal_uInt32 GetObjectPointCount() const;
+ virtual basegfx::B2DPoint GetObjectPoint(sal_uInt32 i) const;
+ virtual void SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i);
virtual SdrObjGeoData* NewGeoData() const;
virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
@@ -298,23 +270,24 @@ public:
as if the connected objects send a repaint broadcast
#103122#
*/
- void Reformat();
+ void ReformatEdge();
// helper methods for the StarOffice api
- Point GetTailPoint( sal_Bool bTail ) const;
- void SetTailPoint( sal_Bool bTail, const Point& rPt );
- void setGluePointIndex( sal_Bool bTail, sal_Int32 nId = -1 );
- sal_Int32 getGluePointIndex( sal_Bool bTail );
-
- virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
+ basegfx::B2DPoint GetTailPoint( bool bTail ) const;
+ void SetTailPoint( bool bTail, const basegfx::B2DPoint& rPt );
+ void setGluePointIndex( bool bTail, sal_Int32 nId = -1 );
+ sal_Int32 getGluePointIndex( bool bTail );
// for geometry access
- ::basegfx::B2DPolygon getEdgeTrack() const;
+// ::basegfx::B2DPolygon getEdgeTrack() const;
// helper method for SdrDragMethod::AddConnectorOverlays. Adds a overlay polygon for
// this connector to rResult.
basegfx::B2DPolygon ImplAddConnectorOverlay(SdrDragMethod& rDragMethod, bool bTail1, bool bTail2, bool bDetail) const;
+
+ // get/setSdrObjectTransformation
+ virtual const basegfx::B2DHomMatrix& getSdrObjectTransformation() const;
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -329,16 +302,16 @@ public:
// Objektaustrittswinkel.
// Der Winkel, in dem die Verbindungslinie aus dem Objekt austreten darf.
//
-// sal_Bool EdgeEscAsRay Default FALSE
-// sal_True= die Verbindungslinie tritt aus dem Obj Strahlenfoermig aus.
+// bool EdgeEscAsRay Default false
+// true= die Verbindungslinie tritt aus dem Obj Strahlenfoermig aus.
// Also Winkelvorgabe durch die Strecke ObjMitte/Konnektor.
//
-// sal_Bool EdgeEscUseObjAngle Default FALSE
+// bool EdgeEscUseObjAngle Default false
// Objektdrehwinkelberuecksichtigung.
-// sal_True= Bei der Bestimmung des Objektaustrittswinkels wird der
+// true= Bei der Bestimmung des Objektaustrittswinkels wird der
// Drehwinkel des Objekts als Offset beruecksichtigt.
//
-// sal_uIntPtr EdgeFlowDefDist Default 0, min 0, max ?
+// sal_uInt32 EdgeFlowDefDist Default 0, min 0, max ?
// Das ist der Default-Mindestabstand der bei der Berechnung der
// Verbindungslinie zu den angedockten Objekten in logischen Einheiten.
// Dieser Abstand wird innerhalb des Objektes "ueberschrieben", sobald
diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx
index a9751edf807f..9d3ffb7a71f2 100644
--- a/svx/inc/svx/svdograf.hxx
+++ b/svx/inc/svx/svdograf.hxx
@@ -55,22 +55,6 @@ namespace sdr
#define SDRGRAFOBJ_TRANSFORMATTR_ROTATE 0x00000004UL
#define SDRGRAFOBJ_TRANSFORMATTR_ALL 0xffffffffUL
-// ---------------------
-// - SdrGrafObjGeoData -
-// ---------------------
-
-// #109872#
-class SdrGrafObjGeoData : public SdrTextObjGeoData
-{
-public:
- sal_Bool bMirrored;
-
- SdrGrafObjGeoData()
- : bMirrored(sal_False)
- {
- }
-};
-
// --------------
// - SdrGrafObj -
// --------------
@@ -107,35 +91,44 @@ protected:
// #111096#
// Flag for allowing text animation. Default is sal_true.
- unsigned mbGrafAnimationAllowed : 1;
+ bool mbGrafAnimationAllowed : 1;
// #i25616#
- unsigned mbInsidePaint : 1;
- unsigned mbIsPreview : 1;
-
-protected:
+ bool mbInsidePaint : 1;
+ bool mbIsPreview : 1;
void ImpLinkAnmeldung();
void ImpLinkAbmeldung();
- sal_Bool ImpUpdateGraphicLink( sal_Bool bAsynchron = sal_True ) const;
+ bool ImpUpdateGraphicLink( bool bAsynchron = true ) const;
void ImpSetLinkedGraphic( const Graphic& rGraphic );
DECL_LINK( ImpSwapHdl, GraphicObject* );
void onGraphicChanged();
+ virtual ~SdrGrafObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- TYPEINFO();
+ // react on model/page change
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
- SdrGrafObj();
- SdrGrafObj(const Graphic& rGrf);
- SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect);
- virtual ~SdrGrafObj();
+ SdrGrafObj(
+ SdrModel& rSdrModel,
+ const Graphic& rGrf,
+ const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix());
+
+ virtual bool IsSdrGrafObj() const;
+ virtual bool DoesSupportTextIndentingOnLineWidthChange() const;
void SetGraphicObject( const GraphicObject& rGrfObj );
const GraphicObject& GetGraphicObject( bool bForceSwapIn = false) const;
const GraphicObject* GetReplacementGraphicObject() const;
- void NbcSetGraphic(const Graphic& rGrf);
+ //void NbcSetGraphic(const Graphic& rGrf);
void SetGraphic(const Graphic& rGrf);
const Graphic& GetGraphic() const;
@@ -145,9 +138,9 @@ public:
// #111096#
// Keep ATM for SD.
- sal_Bool IsAnimated() const;
- sal_Bool IsEPS() const;
- sal_Bool IsSwappedOut() const;
+ bool IsAnimated() const;
+ bool IsEPS() const;
+ bool IsSwappedOut() const;
const MapMode& GetGrafPrefMapMode() const;
const Size& GetGrafPrefSize() const;
@@ -160,16 +153,13 @@ public:
void SetGraphicLink(const String& rFileName, const String& rFilterName);
void ReleaseGraphicLink();
- sal_Bool IsLinkedGraphic() const { return (sal_Bool)aFileName.Len(); }
+ bool IsLinkedGraphic() const { return (bool)aFileName.Len(); }
void SetFileName(const String& rFileName);
const String& GetFileName() const { return aFileName; }
void SetFilterName(const String& rFilterName);
const String& GetFilterName() const { return aFilterName; }
- void StartAnimation(OutputDevice* pOutDev, const Point& rPoint, const Size& rSize, long nExtraData=0L);
- void StopAnimation(OutputDevice* pOutDev=NULL, long nExtraData=0L);
-
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
@@ -179,34 +169,17 @@ public:
// #i25616#
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual void operator=(const SdrObject& rObj);
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
-
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear (const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
- virtual SdrObjGeoData* NewGeoData() const;
- virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
- virtual void RestGeoData(const SdrObjGeoData& rGeo);
-
- FASTBOOL HasGDIMetaFile() const;
+ bool HasGDIMetaFile() const;
const GDIMetaFile* GetGDIMetaFile() const;
- virtual void SetPage(SdrPage* pNewPage);
- virtual void SetModel(SdrModel* pNewModel);
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
+ virtual void AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool bShrinkOnly = false );
bool isEmbeddedSvg() const;
GDIMetaFile getMetafileFromEmbeddedSvg() const;
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
-
- virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
-
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
bool IsMirrored() { return bMirrored; }
@@ -214,16 +187,18 @@ public:
// #111096#
// Access to GrafAnimationAllowed flag
- sal_Bool IsGrafAnimationAllowed() const;
- void SetGrafAnimationAllowed(sal_Bool bNew);
+ bool IsGrafAnimationAllowed() const;
+ void SetGrafAnimationAllowed(bool bNew);
// #i25616#
- sal_Bool IsObjectTransparent() const;
+ bool IsObjectTransparent() const;
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getInputStream();
// #i103116# FullDrag support
virtual SdrObject* getFullDragClone() const;
+
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
};
#endif //_SVDOGRAF_HXX
diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx
index b32c44096ef9..ad3112c4fb2f 100644
--- a/svx/inc/svx/svdogrp.hxx
+++ b/svx/inc/svx/svdogrp.hxx
@@ -27,95 +27,68 @@
#include <tools/datetime.hxx>
#include <svx/svdobj.hxx>
#include "svx/svxdllapi.h"
+#include <svx/svdpage.hxx>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// predefines
-class SdrObjList;
class SdrObjListIter;
class SfxItemSet;
-//************************************************************
-// SdrObjGroup
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
-class SVX_DLLPUBLIC SdrObjGroup : public SdrObject
+class SVX_DLLPUBLIC SdrObjGroup
+: public SdrObject,
+ public SdrObjList
{
private:
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- SdrObjList* pSub; // Subliste (Kinder)
- long nDrehWink;
- long nShearWink;
+ virtual ~SdrObjGroup();
- Point aRefPoint; // Referenzpunkt innerhalb der Objektgruppe
- FASTBOOL bRefPoint; // Ist ein RefPoint gesetzt?
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
- SdrObjGroup();
- virtual ~SdrObjGroup();
+ SdrObjGroup(SdrModel& rSdrModel);
- virtual void SetBoundRectDirty();
- virtual sal_uInt16 GetObjIdentifier() const;
- virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
- virtual SdrLayerID GetLayer() const;
- virtual void NbcSetLayer(SdrLayerID nLayer);
- virtual void SetObjList(SdrObjList* pNewObjList);
- virtual void SetPage(SdrPage* pNewPage);
- virtual void SetModel(SdrModel* pNewModel);
- virtual FASTBOOL HasRefPoint() const;
- virtual Point GetRefPoint() const;
- virtual void SetRefPoint(const Point& rPnt);
- virtual SdrObjList* GetSubList() const;
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ // derived from SdrObjList
+ virtual SdrPage* getSdrPageFromSdrObjList() const;
+ virtual SdrObject* getSdrObjectFromSdrObjList() const;
+ virtual SdrModel& getSdrModelFromSdrObjList() const;
+ virtual void handleContentChange(const SfxHint& rHint);
- virtual const Rectangle& GetCurrentBoundRect() const;
- virtual const Rectangle& GetSnapRect() const;
+ // derived from SdrObject
+ virtual SdrObjList* getChildrenOfSdrObject() const;
- virtual void operator=(const SdrObject& rObj);
+ // react on model change
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual SdrLayerID GetLayer() const;
+ virtual void SetLayer(SdrLayerID nLayer);
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
-
- virtual void RecalcSnapRect();
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
-
- // special drag methods
virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
-
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
-
- virtual long GetRotateAngle() const;
- virtual long GetShearAngle(FASTBOOL bVertical=sal_False) const;
-
- virtual void Move(const Size& rSiz);
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void Mirror(const Point& rRef1, const Point& rRef2);
- virtual void Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual void SetAnchorPos(const Point& rPnt);
- virtual void SetRelativePos(const Point& rPnt);
- virtual void SetSnapRect(const Rectangle& rRect);
- virtual void SetLogicRect(const Rectangle& rRect);
-
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual void NbcSetAnchorPos(const Point& rPnt);
- virtual void NbcSetRelativePos(const Point& rPnt);
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
-
- virtual void NbcReformatText();
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual const basegfx::B2DHomMatrix& getSdrObjectTransformation() const;
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
+ virtual void SetAnchorPos(const basegfx::B2DPoint& rPnt);
virtual void ReformatText();
-
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
+ virtual void getMergedHierarchyLayerSet(SetOfByte& rSet) const;
};
+//////////////////////////////////////////////////////////////////////////////
+
#endif //_SVDOGRP_HXX
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdomeas.hxx b/svx/inc/svx/svdomeas.hxx
index 6f3f4b1bbc3f..32346fb8c043 100644
--- a/svx/inc/svx/svdomeas.hxx
+++ b/svx/inc/svx/svdomeas.hxx
@@ -44,7 +44,7 @@ namespace sdr { namespace properties {
// Hilfsklasse SdrMeasureObjGeoData
//************************************************************
-class SdrMeasureObjGeoData : public SdrTextObjGeoData
+class SdrMeasureObjGeoData : public SdrObjGeoData
{
public:
Point aPt1;
@@ -59,21 +59,33 @@ public:
// SdrMeasureObj
//************************************************************
+/*************************************************************************/
+/* Measure */
+/*************************************************************************/
+// ___
+// | 100,00km | 2mm = MeasureHelplineOverhang
+// |<--------------------->|---
+// | | 8mm = MeasureLineDist
+// | |
+// #=============# |---
+// # # | MeasureHelpline1/2Len
+// # #=========#---
+// # Zu bemassendes Objekt #
+// #=======================#
+
class SVX_DLLPUBLIC SdrMeasureObj : public SdrTextObj
{
private:
// to allow sdr::properties::MeasureProperties access to SetTextDirty()
friend class sdr::properties::MeasureProperties;
-
friend class SdrMeasureField;
-protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- Point aPt1;
+ Point aPt1; // TTTT convert to B2DPoint
Point aPt2;
- FASTBOOL bTextDirty;
+ bool bTextDirty;
protected:
void ImpTakeAttr(ImpMeasureRec& rRec) const;
@@ -81,30 +93,37 @@ protected:
void ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol) const;
basegfx::B2DPolyPolygon ImpCalcXPoly(const ImpMeasurePoly& rPol) const;
void ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const;
- void SetTextDirty() { bTextDirty=sal_True; SetTextSizeDirty(); if (!aOutRect.IsEmpty()) { SetBoundRectDirty(); SetRectsDirty(sal_True); } }
+ void SetTextDirty();
void UndirtyText() const;
virtual SdrObjGeoData* NewGeoData() const;
virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
virtual void RestGeoData(const SdrObjGeoData& rGeo);
-public:
- TYPEINFO();
- SdrMeasureObj();
- SdrMeasureObj(const Point& rPt1, const Point& rPt2);
virtual ~SdrMeasureObj();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ SdrMeasureObj(
+ SdrModel& rSdrModel,
+ const Point& rPt1 = Point(),
+ const Point& rPt2 = Point());
+
+ virtual bool DoesSupportTextIndentingOnLineWidthChange() const;
+
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// special drag methods
virtual bool hasSpecialDrag() const;
@@ -112,48 +131,35 @@ public:
virtual bool applySpecialDrag(SdrDragStat& rDrag);
virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- virtual Pointer GetCreatePointer() const;
-
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual long GetRotateAngle() const;
- virtual void RecalcSnapRect();
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
- virtual sal_Bool IsPolyObj() const;
- virtual sal_uInt32 GetPointCount() const;
- virtual Point GetPoint(sal_uInt32 i) const;
- virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
+ virtual bool IsPolygonObject() const;
+ virtual sal_uInt32 GetObjectPointCount() const;
+ virtual basegfx::B2DPoint GetObjectPoint(sal_uInt32 i) const;
+ virtual void SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i);
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
- virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
+ virtual bool BegTextEdit(SdrOutliner& rOutl);
virtual const Size& GetTextSize() const;
- virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=sal_False,
- Rectangle* pAnchorRect=NULL, sal_Bool bLineWidth=sal_True ) const;
- virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
- virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual void TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const;
+ virtual basegfx::B2DRange getUnifiedTextRange() const;
+ virtual void TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const;
virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
- virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
+ virtual void SetOutlinerParaObject(OutlinerParaObject* pTextObject);
virtual OutlinerParaObject* GetOutlinerParaObject() const;
- virtual FASTBOOL CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
- FASTBOOL bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
-
- // #i97878#
- virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
+ virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
};
/////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/svdomedia.hxx b/svx/inc/svx/svdomedia.hxx
index 00cb41f83792..9d3d9b51839a 100644
--- a/svx/inc/svx/svdomedia.hxx
+++ b/svx/inc/svx/svdomedia.hxx
@@ -38,30 +38,29 @@ namespace sdr { namespace contact { class ViewContactOfSdrMediaObj; } }
class SVX_DLLPUBLIC SdrMediaObj : public SdrRectObj
{
+private:
friend class ::sdr::contact::ViewContactOfSdrMediaObj;
-public:
-
- TYPEINFO();
+protected:
+ virtual ~SdrMediaObj();
- SdrMediaObj();
- SdrMediaObj( const Rectangle& rRect );
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
- virtual ~SdrMediaObj();
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- virtual FASTBOOL HasTextEdit() const;
+ SdrMediaObj(SdrModel& rSdrModel, const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix());
+ virtual bool HasTextEdit() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
- virtual void operator=(const SdrObject& rObj);
-
- virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
-
-public:
+ virtual void AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool bShrinkOnly = false );
void setURL( const ::rtl::OUString& rURL );
const ::rtl::OUString& getURL() const;
@@ -76,12 +75,10 @@ public:
void setGraphic( const Graphic* pGraphic = NULL );
protected:
-
virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact();
private:
-
::avmedia::MediaItem maMediaProperties;
::std::auto_ptr< Graphic > mapGraphic;
};
diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx
index 3a72956f5d11..c627df640bd3 100644
--- a/svx/inc/svx/svdoole2.hxx
+++ b/svx/inc/svx/svdoole2.hxx
@@ -45,7 +45,6 @@ class SdrOle2ObjImpl;
class SVX_DLLPUBLIC SdrOle2Obj : public SdrRectObj
{
private:
-
SVX_DLLPRIVATE void Connect_Impl();
SVX_DLLPRIVATE void Disconnect_Impl();
SVX_DLLPRIVATE void Reconnect_Impl();
@@ -67,10 +66,12 @@ protected:
String aProgName;
// wg. Kompatibilitaet erstmal am SdrTextObj
- sal_Bool bFrame : 1;
- sal_Bool bInDestruction : 1;
+ bool bFrame : 1;
+ bool bInDestruction : 1;
+
// #i118524#
bool mbSuppressSetVisAreaSize : 1;
+
mutable bool m_bTypeAsked;
mutable bool m_bChart;
@@ -78,19 +79,27 @@ protected:
SvxUnoShapeModifyListener* pModifyListener;
-protected:
-
void ImpSetVisAreaSize();
void Init();
+ virtual ~SdrOle2Obj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- SdrOle2Obj(FASTBOOL bFrame_=sal_False);
- SdrOle2Obj(const svt::EmbeddedObjectRef& rNewObjRef, FASTBOOL bFrame_=sal_False);
- SdrOle2Obj(const svt::EmbeddedObjectRef& rNewObjRef, const String& rNewObjName, FASTBOOL bFrame_=sal_False);
- SdrOle2Obj(const svt::EmbeddedObjectRef& rNewObjRef, const String& rNewObjName, const Rectangle& rNewRect, FASTBOOL bFrame_=sal_False);
- virtual ~SdrOle2Obj();
+ // react on model/page change
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
+ virtual bool IsClosedObj() const;
+
+ SdrOle2Obj(
+ SdrModel& rSdrModel,
+ const svt::EmbeddedObjectRef& rNewObjRef = svt::EmbeddedObjectRef(),
+ const String aNewObjName = String(),
+ const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix(),
+ bool bFrame_ = false);
// access to svt::EmbeddedObjectRef
const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const { return xObjRef; }
@@ -123,7 +132,7 @@ public:
// spaeter wieder abfragen kann (SD braucht das fuer Praesentationsobjekte).
void SetProgName(const String& rNam) { aProgName=rNam; }
const String& GetProgName() const { return aProgName; }
- FASTBOOL IsEmpty() const;
+ bool IsEmpty() const;
void SetObjRef(const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& rNewObjRef);
com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObjRef() const;
@@ -132,16 +141,6 @@ public:
void AbandonObject();
- virtual void SetPage(SdrPage* pNewPage);
- virtual void SetModel(SdrModel* pModel);
-
- /** Change the IsClosedObj attribute
-
- @param bIsClosed
- Whether the OLE object is closed, i.e. has opaque background
- */
- void SetClosedObj( bool bIsClosed );
-
// FullDrag support
virtual SdrObject* getFullDragClone() const;
@@ -150,18 +149,12 @@ public:
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
- virtual void operator=(const SdrObject& rObj);
-
- virtual void NbcMove(const Size& rSize);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
virtual void SetGeoData(const SdrObjGeoData& rGeo);
- static sal_Bool CanUnloadRunningObj( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
+ static bool CanUnloadRunningObj( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
sal_Int64 nAspect );
- static sal_Bool Unload( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
- sal_Bool Unload();
+ static bool Unload( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
+ bool Unload();
void Connect();
void Disconnect();
void ObjectLoaded();
@@ -169,10 +162,10 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getXModel() const;
// #109985#
- sal_Bool IsChart() const;
- sal_Bool IsCalc() const;
+ bool IsChart() const;
+ bool IsCalc() const;
- sal_Bool UpdateLinkURL_Impl();
+ bool UpdateLinkURL_Impl();
void BreakFileLink_Impl();
void DisconnectFileLink_Impl();
void CheckFileLink_Impl();
@@ -183,16 +176,17 @@ public:
const ::rtl::OUString& aMediaType );
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetParentXModel() const;
- sal_Bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
- sal_Bool AddOwnLightClient();
+ bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
+ bool AddOwnLightClient();
// handy to get the empty replacement bitmap without accessing all the old stuff
static Bitmap GetEmtyOLEReplacementBitmap();
void SetWindow(const com::sun::star::uno::Reference < com::sun::star::awt::XWindow >& _xWindow);
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
// #i118485# missing converter added
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
};
#endif //_SVDOOLE2_HXX
diff --git a/svx/inc/svx/svdopage.hxx b/svx/inc/svx/svdopage.hxx
index 89437e077c30..a0586dba4bb9 100644
--- a/svx/inc/svx/svdopage.hxx
+++ b/svx/inc/svx/svdopage.hxx
@@ -25,17 +25,10 @@
#define _SVDOPAGE_HXX
#include <svx/svdobj.hxx>
-#include <svx/sdrpageuser.hxx>
#include "svx/svxdllapi.h"
-class SVX_DLLPUBLIC SdrPageObj : public SdrObject, public sdr::PageUser
+class SVX_DLLPUBLIC SdrPageObj : public SdrObject
{
-public:
- // this method is called form the destructor of the referenced page.
- // do all necessary action to forget the page. It is not necessary to call
- // RemovePageUser(), that is done form the destructor.
- virtual void PageInDestruction(const SdrPage& rPage);
-
private:
// #111111#
// To make things more safe, remember the page, not a number
@@ -45,22 +38,26 @@ protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-public:
- TYPEINFO();
- SdrPageObj(SdrPage* pNewPage = 0L);
- SdrPageObj(const Rectangle& rRect, SdrPage* pNewPage = 0L);
~SdrPageObj();
+ // method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+public:
+ SdrPageObj(SdrModel& rSdrModel, const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix(), SdrPage* pNewPage = 0);
+
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ // derived from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
// #111111#
SdrPage* GetReferencedPage() const;
void SetReferencedPage(SdrPage* pNewPage);
- // #i96598#
- virtual void SetBoundRectDirty();
-
virtual sal_uInt16 GetObjIdentifier() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
- virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
diff --git a/svx/inc/svx/svdopath.hxx b/svx/inc/svx/svdopath.hxx
index 78eb6194207f..2d069b4d988e 100644
--- a/svx/inc/svx/svdopath.hxx
+++ b/svx/inc/svx/svdopath.hxx
@@ -29,32 +29,38 @@
#include "svx/svxdllapi.h"
#include <basegfx/vector/b2enums.hxx>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// predefines
class ImpPathForDragAndCreate;
-//************************************************************
-// Hilfsklasse SdrPathObjGeoData
-//
-// fuer Undo/Redo
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// helper classes
-class SdrPathObjGeoData : public SdrTextObjGeoData
+class SdrPathObjGeoData : public SdrObjGeoData
{
public:
basegfx::B2DPolyPolygon maPathPolygon;
- SdrObjKind meKind;
SdrPathObjGeoData();
virtual ~SdrPathObjGeoData();
};
-//************************************************************
-// SdrPathObj
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// defines for path type
+
+enum SdrPathObjType
+{
+ /// basic types the path may have, derived from it's defining
+ /// polygon
+ PathType_Line = 0, // old OBJ_LINE
+ PathType_OpenPolygon, // old OBJ_PLIN
+ PathType_ClosedPolygon, // old OBJ_POLY
+ PathType_OpenBezier, // old OBJ_PATHLINE
+ PathType_ClosedBezier, // old OBJ_PATHFILL
+};
+
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrPathObj : public SdrTextObj
{
@@ -64,44 +70,56 @@ private:
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
- basegfx::B2DPolyPolygon maPathPolygon;
- SdrObjKind meKind;
+ // the geometry data in object coordinates. This means that it is not
+ // in normalized form. To get it in normalized form You need to transform
+ // with the inverse of the object matrix
+ basegfx::B2DPolyPolygon maPathPolygon;
// for isolation of old Drag/Create code
ImpPathForDragAndCreate* mpDAC;
-protected:
- // Hilfsfunktion fuer GET/SET/INS/etc. PNT
- void ImpSetClosed(sal_Bool bClose);
- void ImpForceKind();
+ // helpers for GET/SET/INS/etc. PNT
+ void ImpSetClosed(bool bClose);
void ImpForceLineWink();
- ImpPathForDragAndCreate& impGetDAC() const;
+ ImpPathForDragAndCreate& impGetDAC(const SdrView& rView) const;
void impDeleteDAC() const;
-public:
- static sal_Bool ImpFindPolyPnt(const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum);
- virtual void SetRectsDirty(sal_Bool bNotMyself = sal_False);
+ // helper for adapting the object transformation when the geometry
+ // (maPathPolygon) in world coordinates has changed
+ void impAdaptTransformation();
-public:
- TYPEINFO();
- SdrPathObj(SdrObjKind eNewKind);
- SdrPathObj(SdrObjKind eNewKind, const basegfx::B2DPolyPolygon& rPathPoly);
virtual ~SdrPathObj();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+ /// GeoData support
+ virtual SdrObjGeoData* NewGeoData() const;
+ virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
+ virtual void RestGeoData(const SdrObjGeoData& rGeo);
+
+public:
+ // possible path types, derived from set polygon, thus readonly and useful
+ // for various behaviours. Default is PathType_Line when not enough info in polygon
+ SdrPathObjType getSdrPathObjType() const;
+
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ static sal_Bool ImpFindPolyPnt(const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum);
+ SdrPathObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DPolyPolygon& rPathPoly = basegfx::B2DPolyPolygon());
+ virtual bool IsClosedObj() const;
+
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
- virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual void RecalcSnapRect();
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
- virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
+ virtual void GetPlusHdl(SdrHdlList& rHdlList, const SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// special drag methods
@@ -111,78 +129,50 @@ public:
virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- Pointer GetCreatePointer() const;
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
// during drag or create, allow accessing the so-far created/modified polyPolygon
basegfx::B2DPolyPolygon getObjectPolyPolygon(const SdrDragStat& rDrag) const;
basegfx::B2DPolyPolygon getDragPolyPolygon(const SdrDragStat& rDrag) const;
- virtual void NbcMove(const Size& aSize);
- virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact);
- virtual void NbcRotate(const Point& rRefPnt, long nAngle, double fSin, double fCos);
- virtual void NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2);
- virtual void NbcShear(const Point& rRefPnt, long nAngle, double fTan, FASTBOOL bVShear);
-
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
- virtual sal_Bool IsPolyObj() const;
- virtual sal_uInt32 GetPointCount() const;
- virtual Point GetPoint(sal_uInt32 nHdlNum) const;
- virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum);
+ virtual bool IsPolygonObject() const;
+ virtual sal_uInt32 GetObjectPointCount() const;
+ virtual basegfx::B2DPoint GetObjectPoint(sal_uInt32 nHdlNum) const;
+ virtual void SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 nHdlNum);
- // Punkt einfuegen
- sal_uInt32 NbcInsPointOld(const Point& rPos, sal_Bool bNewObj, sal_Bool bHideHim);
- sal_uInt32 NbcInsPoint(sal_uInt32 i, const Point& rPos, sal_Bool bNewObj, sal_Bool bHideHim);
+ // insert point
+ sal_uInt32 InsPointOld(const Point& rPos, sal_Bool bNewObj);
+ sal_uInt32 InsPoint(const Point& rPos, sal_Bool bNewObj);
- // An diesem Punkt auftrennen
+ // split at tis point
SdrObject* RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index);
-protected:
- virtual SdrObjGeoData* NewGeoData() const;
- virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
- virtual void RestGeoData(const SdrObjGeoData& rGeo);
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
-public:
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
-
- // Bezierpolygon holen/setzen
- const basegfx::B2DPolyPolygon& GetPathPoly() const { return maPathPolygon; }
- void SetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly);
- void NbcSetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly);
-
- // Spezialfunktionen fuer Bezierpolygon-Bearbeitung
- sal_Bool IsClosed() const { return meKind==OBJ_POLY || meKind==OBJ_PATHPOLY || meKind==OBJ_PATHFILL || meKind==OBJ_FREEFILL || meKind==OBJ_SPLNFILL; }
- sal_Bool IsLine() const { return meKind==OBJ_PLIN || meKind==OBJ_PATHPLIN || meKind==OBJ_PATHLINE || meKind==OBJ_FREELINE || meKind==OBJ_SPLNLINE || meKind==OBJ_LINE; }
- sal_Bool IsFreeHand() const { return meKind==OBJ_FREELINE || meKind==OBJ_FREEFILL; }
- sal_Bool IsBezier() const { return meKind==OBJ_PATHLINE || meKind==OBJ_PATHFILL; }
- sal_Bool IsSpline() const { return meKind==OBJ_SPLNLINE || meKind==OBJ_SPLNFILL; }
-
- // Pfad schliessen bzw. oeffnen; im letzteren Fall den Endpunkt um
- // "nOpenDistance" verschieben
- void ToggleClosed(); // long nOpenDistance);
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // transformation interface for StarOfficeAPI. This implements support for
- // homogen 3x3 matrices containing the transformation of the SdrObject. At the
- // moment it contains a shearX, rotation and translation, but for setting all linear
- // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
- // with the base geometry and returns TRUE. Otherwise it returns FALSE.
- virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
- // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
- // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
- // to use (0,0) as upper left and will be scaled to the given size in the matrix.
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
+ // get/set polygon data in object coordiates
+ basegfx::B2DPolyPolygon getB2DPolyPolygonInObjectCoordinates() const;
+ void setB2DPolyPolygonInObjectCoordinates(const basegfx::B2DPolyPolygon& rPathPoly);
+
+ // get/set polygon data in normalized coordiates
+ basegfx::B2DPolyPolygon getB2DPolyPolygonInNormalizedCoordinates() const;
+ void setB2DPolyPolygonInNormalizedCoordinates(const basegfx::B2DPolyPolygon& rPathPoly);
+
+ // helpers for states
+ bool isClosed() const;
+ bool isLine() const;
+ bool isBezier() const;
+
+ void ToggleClosed();
};
////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx
index f8c8e248f682..8c9df88475bd 100644
--- a/svx/inc/svx/svdorect.hxx
+++ b/svx/inc/svx/svdorect.hxx
@@ -31,8 +31,6 @@
// Vorausdeklarationen
//************************************************************
-class XPolygon;
-
namespace sdr { namespace properties {
class RectangleProperties;
}}
@@ -47,61 +45,38 @@ namespace sdr { namespace properties {
class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj
{
private:
- // to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
- friend class sdr::properties::RectangleProperties;
- friend class SdrTextObj; // wg SetXPolyDirty bei GrowAdjust
+ // wg SetXPolyDirty bei GrowAdjust
+ friend class SdrTextObj;
protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
- XPolygon* mpXPoly;
-
-protected:
- // Liefert sal_True, wenn das Painten ein Polygon erfordert.
- FASTBOOL PaintNeedsXPoly(long nEckRad) const;
-
-protected:
- XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const;
- void SetXPolyDirty();
+ virtual ~SdrRectObj();
- // RecalcXPoly sollte ueberladen werden. Dabei muss dann eine XPolygon
- // Instanz generiert (new) und an mpXPoly zugewiesen werden.
- virtual void RecalcXPoly();
- const XPolygon& GetXPoly() const;
- virtual void RestGeoData(const SdrObjGeoData& rGeo);
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
public:
- TYPEINFO();
- // Der Eckenradius-Parameter fliegt irgendwann raus. Der Eckenradius
- // ist dann (spaeter) ueber SfxItems einzustellen (SetAttributes()).
- // Konstruktion eines Rechteck-Zeichenobjekts
-
- SdrRectObj();
- SdrRectObj(const Rectangle& rRect);
-
- // Konstruktion eines Textrahmens
- SdrRectObj(SdrObjKind eNewTextKind);
- SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect);
- // der sal_uInt16 eFormat nimmt Werte des enum EETextFormat entgegen
- SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
- virtual ~SdrRectObj();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ SdrRectObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix(),
+ SdrObjKind eNewTextKind = OBJ_TEXT,
+ bool bIsTextFrame = false);
+ virtual bool IsClosedObj() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
- virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
- virtual void operator=(const SdrObject& rObj);
- virtual void RecalcSnapRect();
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// special drag methods
virtual bool hasSpecialDrag() const;
@@ -110,23 +85,12 @@ public:
virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- virtual Pointer GetCreatePointer() const;
-
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
- virtual FASTBOOL DoMacro(const SdrObjMacroHitRec& rRec);
+ virtual bool DoMacro(const SdrObjMacroHitRec& rRec);
virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
- virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const;
- virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const;
-
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
-
- virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
};
#endif //_SVDORECT_HXX
diff --git a/svx/inc/svx/svdotable.hxx b/svx/inc/svx/svdotable.hxx
index 239acf129af9..c9172eeab3cb 100644
--- a/svx/inc/svx/svdotable.hxx
+++ b/svx/inc/svx/svdotable.hxx
@@ -105,19 +105,29 @@ class SdrTableObjImpl;
class SVX_DLLPUBLIC SdrTableObj : public ::SdrTextObj
{
+private:
friend class Cell;
friend class SdrTableObjImpl;
friend class SdrTableModifyGuard;
-public:
- SdrTableObj(SdrModel* _pModel);
- SdrTableObj(SdrModel* _pModel, const ::Rectangle& rNewRect, sal_Int32 nColumns, sal_Int32 nRows);
+protected:
virtual ~SdrTableObj();
- TYPEINFO();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
- // table stuff
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ SdrTableObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix(),
+ sal_Int32 nColumns = 1,
+ sal_Int32 nRows = 1);
+ virtual bool IsClosedObj() const;
+ // table stuff
SdrTableObj* CloneRange( const CellPos& rStartPos, const CellPos& rEndPos );
void DistributeColumns( sal_Int32 nFirstColumn, sal_Int32 nLastColumn );
void DistributeRows( sal_Int32 nFirstRow, sal_Int32 nLastRow );
@@ -141,7 +151,7 @@ public:
const ::sdr::table::TableStyleSettings& getTableStyleSettings() const;
void setTableStyleSettings( const ::sdr::table::TableStyleSettings& rStyle );
- TableHitKind CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_Int32& rnY, int nTol ) const;
+ TableHitKind CheckTableHit( const basegfx::B2DPoint& rPos, sal_Int32& rnX, sal_Int32& rnY, int nTol ) const;
void uno_lock();
void uno_unlock();
@@ -182,10 +192,10 @@ public:
virtual void setActiveText( sal_Int32 nIndex );
/** returns the index of the text that contains the given point or -1 */
- virtual sal_Int32 CheckTextHit(const Point& rPnt) const;
+ virtual sal_Int32 CheckTextHit(const basegfx::B2DPoint& rPnt) const;
virtual bool HasText() const;
- sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); }
+ bool IsTextEditActive() const { return (pEdtOutl != 0L); }
bool IsTextEditActive( const sdr::table::CellPos& rPos );
/** returns true only if we are in edit mode and the user actually changed anything */
@@ -197,46 +207,34 @@ public:
// Gleichzeitig wird der Text in den Outliner gesetzt (ggf.
// der des EditOutliners) und die PaperSize gesetzt.
- virtual void TakeTextRect( const sdr::table::CellPos& rPos, SdrOutliner& rOutliner, ::Rectangle& rTextRect, FASTBOOL bNoEditText=sal_False, ::Rectangle* pAnchorRect=NULL, sal_Bool bLineWidth=sal_True ) const;
- virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=sal_False, Rectangle* pAnchorRect=NULL, sal_Bool bLineWidth=sal_True ) const;
- virtual void TakeTextAnchorRect(const sdr::table::CellPos& rPos, ::Rectangle& rAnchorRect ) const;
- virtual void TakeTextAnchorRect(::Rectangle& rAnchorRect) const;
+ void TakeTextRange(const sdr::table::CellPos& rPos, SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const;
+ virtual void TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const;
+ virtual void TakeTextAnchorRangeFromCell(const sdr::table::CellPos& rPos, basegfx::B2DRange& rAnchorRange ) const;
+ virtual basegfx::B2DRange getUnifiedTextRange() const;
- virtual FASTBOOL IsAutoGrowHeight() const;
+ virtual bool IsAutoGrowHeight() const;
long GetMinTextFrameHeight() const;
long GetMaxTextFrameHeight() const;
- virtual FASTBOOL IsAutoGrowWidth() const;
+ virtual bool IsAutoGrowWidth() const;
long GetMinTextFrameWidth() const;
long GetMaxTextFrameWidth() const;
- virtual FASTBOOL IsFontwork() const;
+ virtual bool IsFontwork() const;
- virtual void SetPage(SdrPage* pNewPage);
- virtual void SetModel(SdrModel* pNewModel);
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
virtual void SetChanged();
- virtual FASTBOOL AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True) const;
- virtual FASTBOOL AdjustTextFrameWidthAndHeight(FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True);
+ virtual basegfx::B2DRange AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt = true, bool bWdt = true) const;
+ virtual bool AdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
- virtual void operator=(const SdrObject& rObj);
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual basegfx::B2DPolyPolygon TakeContour() const;
- virtual void RecalcSnapRect();
- virtual const Rectangle& GetSnapRect() const;
- virtual void NbcSetSnapRect(const Rectangle& rRect);
-
- virtual const Rectangle& GetLogicRect() const;
- virtual void NbcSetLogicRect(const Rectangle& rRect);
- virtual void AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly = false );
+ virtual void AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool bShrinkOnly = false );
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
virtual void AddToHdlList(SdrHdlList& rHdlList) const;
// special drag methods
@@ -246,88 +244,52 @@ public:
virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
+ virtual bool BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
- virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- virtual Pointer GetCreatePointer() const;
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
-
- virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
+ virtual bool BegTextEdit(SdrOutliner& rOutl);
virtual void EndTextEdit(SdrOutliner& rOutl);
- virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
- virtual void TakeTextEditArea(const sdr::table::CellPos& rPos, Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual void TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const;
+ void TakeTextEditArea(const sdr::table::CellPos& rPos, basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const;
virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
- virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
+ virtual void SetOutlinerParaObject(OutlinerParaObject* pTextObject);
virtual OutlinerParaObject* GetOutlinerParaObject() const;
virtual OutlinerParaObject* GetEditOutlinerParaObject() const;
- virtual void NbcReformatText();
+ // virtual void NbcReformatText();
virtual void ReformatText();
void SetTextEditOutliner(SdrOutliner* pOutl) { pEdtOutl=pOutl; }
- virtual sal_Bool IsVerticalWriting() const;
- virtual void SetVerticalWriting(sal_Bool bVertical);
+ virtual bool IsVerticalWriting() const;
+ virtual void SetVerticalWriting(bool bVertical);
com::sun::star::text::WritingMode GetWritingMode() const;
virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // transformation interface for StarOfficeAPI. This implements support for
- // homogen 3x3 matrices containing the transformation of the SdrObject. At the
- // moment it contains a shearX, rotation and translation, but for setting all linear
- // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
- // with the base geometry and returns TRUE. Otherwise it returns FALSE.
- virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
-
- // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
- // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
- // to use (0,0) as upper left and will be scaled to the given size in the matrix.
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
-
- // #103836# iterates over the paragraphs of a given SdrObject and removes all
- // hard set character attributes with the which ids contained in the
- // given vector
-// virtual void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
-
/** hack for clipboard with calc and writer, export and import table content as rtf table */
static void ExportAsRTF( SvStream& rStrm, SdrTableObj& rObj );
static void ImportAsRTF( SvStream& rStrm, SdrTableObj& rObj );
-private:
- void init( sal_Int32 nColumns, sal_Int32 nRows );
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
- virtual SdrObjGeoData* NewGeoData() const;
- virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
- virtual void RestGeoData(const SdrObjGeoData& rGeo);
-
private:
+ void init( sal_Int32 nColumns, sal_Int32 nRows );
SdrOutliner* GetCellTextEditOutliner( const ::sdr::table::Cell& rCell ) const;
-private:
// for the ViewContactOfTableObj to build the primitive representation, it is necessary to access the
// TableLayouter for position and attribute informations
friend class sdr::contact::ViewContactOfTableObj;
const TableLayouter& getTableLayouter() const;
- Rectangle maLogicRect;
-private:
SdrTableObjImpl* mpImpl;
};
diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx
index dc5e8583f24f..acd2dd6fbf75 100644
--- a/svx/inc/svx/svdotext.hxx
+++ b/svx/inc/svx/svdotext.hxx
@@ -26,7 +26,6 @@
#include <vcl/field.hxx>
#include <svx/svdoattr.hxx>
-#include <svx/svdtrans.hxx> // GeoStat
#include <tools/datetime.hxx>
#include <svx/xtextit0.hxx>
#include "svdtext.hxx"
@@ -79,17 +78,6 @@ namespace sdr { namespace table {
#define SDRUSERDATA_OBJTEXTLINK (1)
//************************************************************
-// Hilfsklasse SdrTextObjGeoData
-//************************************************************
-
-class SdrTextObjGeoData : public SdrObjGeoData
-{
-public:
- Rectangle aRect;
- GeoStat aGeo;
-};
-
-//************************************************************
// Hilfsklasse ImpSdrObjTextLinkUserData
//************************************************************
@@ -106,7 +94,6 @@ class ImpSdrObjTextLinkUserData : public SdrObjUserData
rtl_TextEncoding eCharSet;
public:
- TYPEINFO();
ImpSdrObjTextLinkUserData(SdrTextObj* pObj1);
virtual ~ImpSdrObjTextLinkUserData();
@@ -122,15 +109,42 @@ namespace sdr
} // end of namespace properties
} // end of namespace sdr
-//************************************************************
-// SdrTextObj
-//************************************************************
+///////////////////////////////////////////////////////
+// bTextFrame settings:
+//
+// SdrTextObj bTextFrame=false (default)
+// SdrObjCustomShape bTextFrame = true, set in constructor, evtl. changed internally
+// OCustomShape OK
+// SdrEdgeObj bTextFrame=false, derived
+// SdrMeasureObj bTextFrame=false, derived
+// SdrPathObj bTextFrame=false, derived
+// SdrRectObj
+// old constructors:
+// no textkind->bTextFrame=false
+// with textkind->bTextFrame=true
+// SdrCaptionObj bTextFrame=true, done in constructor
+// SdrCircObj bTextFrame=false, done in constructor
+// SdrGrafObj bTextFrame=false, done in constructor
+// SdrMediaObj bTextFrame=false, done in constructor
+// SdrOle2Obj bTextFrame=false, done in constructor
+// OOle2Obj OK
+// SdrUnoObj bTextFrame=false, done in constructor
+// DlgEdObj OK
+// DlgEdForm OK
+// OUnoObject OK
+// FmFormObj OK
+// SdrTableObj bTextFrame=false, derived
+//
+// SdrTextObj used as tooling class (cannot be directly incarnated).
+// Derivations from SdrRectObj all have a fixed setting. Thus,
+// only the SdrRectObj constructor calls may be a TextFrame object
+// with choice. Controlled and compared all calls with current main
+// trunk.
class SVX_DLLPUBLIC SdrTextObj : public SdrAttrObj
{
private:
// Cell needs access to ImpGetDrawOutliner();
-
friend class sdr::table::Cell;
friend class sdr::table::SdrTableRtfExporter;
friend class sdr::table::SdrTableRTFParser;
@@ -150,7 +164,7 @@ private:
}
// This method is only allowed for sdr::properties::TextProperties
- SVX_DLLPRIVATE void SetPortionInfoChecked(sal_Bool bNew)
+ SVX_DLLPRIVATE void SetPortionInfoChecked(bool bNew)
{
bPortionInfoChecked = bNew;
}
@@ -173,14 +187,6 @@ private:
friend class SdrText; // fuer ImpGetDrawOutliner
protected:
- // Das aRect ist gleichzeig auch das Rect vom RectObj und CircObj.
- // Bei bTextFrame=sal_True wird der Text in dieses Rect hineinformatiert.
- // Bei bTextFrame=sal_False wird der Text am Mittelpunkt des Rect zentriert.
- Rectangle aRect;
-
- // Der GeoStat enthaelt den Drehwinkel und einen Shearwinkel
- GeoStat aGeo;
-
// this is the active text
SdrText* mpText;
@@ -193,16 +199,11 @@ protected:
// werden kann
SdrOutliner* pEdtOutl;
- // Bei Fontwork muss soviel auf's BoundRect draufgerechnet werden
- // damit es ausreichend gross ist.
- Rectangle* pFormTextBoundRect;
-
// Moegliche Werte fuer eTextKind sind:
// OBJ_TEXT normaler Textrahmen
- // OBJ_TEXTEXT Textfortsetzungsrahmen
// OBJ_TITLETEXT TitleText fuer StarDraw-Praesentation
// OBJ_OUTLINETEXT OutlineText fuer StarDraw-Praesentation
- // eTextKind hat nur Bedeutung, wenn bTextFrame=sal_True, da es sich sonst
+ // eTextKind hat nur Bedeutung, wenn bTextFrame=true, da es sich sonst
// um ein beschriftetes Grafikobjekt handelt.
SdrObjKind eTextKind;
@@ -211,108 +212,99 @@ protected:
// able to set an offset for the text edit to allow text editing at the
// position of the virtual object. This offset is used when setting up
// and maintaining the OutlinerView.
- Point maTextEditOffset;
+ basegfx::B2DPoint maTextEditOffset;
+
public:
- const Point& GetTextEditOffset() const { return maTextEditOffset; }
- void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; }
+ // exclusively for SW to force a offset for the activated TextEdit when
+ // not the real but the virtual object is edited. May be removed when SW
+ // will be changed to use a better concept that the SdrVirtObjs
+ const basegfx::B2DPoint& GetTextEditOffset() const { return maTextEditOffset; }
+ void SetTextEditOffset(const basegfx::B2DPoint& rNew) { maTextEditOffset = rNew; }
protected:
- // Fuer beschriftete Zeichenobjekte ist bTextFrame=FALSE. Der Textblock
+ // Fuer beschriftete Zeichenobjekte ist bTextFrame=false. Der Textblock
// wird dann hoizontal und vertikal an aRect zentriert. Bei bTextFrame=
- // sal_True wird der Text in aRect hineinformatiert. Der eigentliche Textrahmen
- // ist durch ein SdrRectObj mit bTextFrame=sal_True realisiert.
- sal_Bool bTextFrame : 1;
- sal_Bool bPortionInfoChecked : 1; // Fuer Optimierung von Textobjekten
- sal_Bool bNoShear : 1; // Obj darf nicht gesheart werden (->Graf+Ole+TextFrame)
- sal_Bool bNoRotate : 1; // Obj darf nicht gedreht werden (->Ole)
- sal_Bool bNoMirror : 1; // Obj darf nicht gespiegelt werden (->Ole,TextFrame)
- sal_Bool bTextSizeDirty : 1;
+ // true wird der Text in aRect hineinformatiert. Der eigentliche Textrahmen
+ // ist durch ein SdrRectObj mit bTextFrame=true realisiert.
+ bool bTextFrame : 1;
+ bool bPortionInfoChecked : 1; // Fuer Optimierung von Textobjekten
+ // TTTT: These maybe obsolete
+ bool bNoShear : 1; // Obj darf nicht gesheart werden (->Graf+Ole+TextFrame)
+ bool bNoRotate : 1; // Obj darf nicht gedreht werden (->Ole)
+ bool bNoMirror : 1; // Obj darf nicht gespiegelt werden (->Ole,TextFrame)
+ bool bTextSizeDirty : 1;
// #101684#
- sal_Bool mbInEditMode : 1; // Is this text obejct in edit mode?
+ bool mbInEditMode : 1; // Is this text obejct in edit mode?
// Fuer Objekt mit freier Groesse im Draw (Mengentext). Das Flag wird vom
// der App beim Create gesetzt.
// Wenn das Objekt dann spaeter in der Breite resized wird, wird
- // AutoGrowWidth abgeschaltet (Hart auf sal_False attributiert). Das Flag wird
- // dann ebenfalls auf sal_False gesetzt, sodass sich das Objekt anschliessend
+ // AutoGrowWidth abgeschaltet (Hart auf false attributiert). Das Flag wird
+ // dann ebenfalls auf false gesetzt, sodass sich das Objekt anschliessend
// wie ein normales Textobjekt verhaelt.
// Resize in der Breite kann sein:
// - Interaktives Resize in Einfach- oder Mehrfachselektion
// - Positions+Groesse Dialog
- sal_Bool bDisableAutoWidthOnDragging : 1;
-
- // #111096#
- // Allow text suppression
- sal_Bool mbTextHidden : 1;
+ bool bDisableAutoWidthOnDragging : 1;
// #111096#
// Flag for allowing text animation. Default is sal_true.
- sal_Bool mbTextAnimationAllowed : 1;
+ bool mbTextAnimationAllowed : 1;
SdrOutliner& ImpGetDrawOutliner() const;
private:
- SVX_DLLPRIVATE void ImpCheckMasterCachable();
// #101029#: Extracted from ImpGetDrawOutliner()
SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const;
// #101029#: Extracted from Paint()
- SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( FASTBOOL bContourFrame,
+ SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint(
+ bool bContourFrame,
SdrOutliner& rOutliner,
- Rectangle& rTextRect,
- Rectangle& rAnchorRect,
- Rectangle& rPaintRect,
- Fraction& aFitXKorreg ) const;
+ basegfx::B2DRange& rTextRange,
+ basegfx::B2DRange& rAnchorRange,
+ basegfx::B2DRange& rPaintRange) const;
SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
SVX_DLLPRIVATE void ImpLinkAnmeldung();
SVX_DLLPRIVATE void ImpLinkAbmeldung();
SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
-// void ImpCheckItemSetChanges(const SfxItemSet& rAttr);
protected:
bool ImpCanConvTextToCurve() const;
- SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr = sal_False) const;
- SdrObject* ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) const;
+ SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr = sal_False) const;
+ SdrObject* ImpConvertAddText(SdrObject* pObj, bool bBezier) const;
void ImpSetTextStyleSheetListeners();
- void ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& rTextRect, const Rectangle& rAnchorRect, Fraction& rFitXKorreg) const;
- void ImpJustifyRect(Rectangle& rRect) const;
- void ImpCheckShear();
- Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
+ void ImpSetCharStretching(SdrOutliner& rOutliner, const basegfx::B2DRange& rTextRange, const basegfx::B2DRange& rAnchorRange) const;
void ImpSetTextEditParams() const;
- void SetTextSizeDirty() { bTextSizeDirty=sal_True; }
-
- // rAnchorRect ist InOut-Parameter!
- void ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAnchorRect, sal_Bool bLineWidth ) const;
-
- virtual SdrObjGeoData* NewGeoData() const;
- virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
- virtual void RestGeoData(const SdrObjGeoData& rGeo);
- FASTBOOL NbcSetEckenradius(long nRad);
- FASTBOOL NbcSetAutoGrowHeight(bool bAuto);
- FASTBOOL NbcSetMinTextFrameHeight(long nHgt);
- FASTBOOL NbcSetMaxTextFrameHeight(long nHgt);
- FASTBOOL NbcSetAutoGrowWidth(bool bAuto);
- FASTBOOL NbcSetMinTextFrameWidth(long nWdt);
- FASTBOOL NbcSetMaxTextFrameWidth(long nWdt);
- FASTBOOL NbcSetFitToSize(SdrFitToSizeType eFit);
-
- // Konstruktoren fuer beschriftete Zeichenobjekte
- SdrTextObj();
- SdrTextObj(const Rectangle& rNewRect);
-
- // Konstruktoren fuer Textrahmen
- SdrTextObj(SdrObjKind eNewTextKind);
- SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect);
-
- // der sal_uInt16 eFormat nimmt Werte des enum EETextFormat entgegen
- SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
+ void SetTextSizeDirty() { bTextSizeDirty=true; }
+
+ void SetEdgeRadius(sal_Int32 nRad);
+ bool SetMinTextFrameHeight(sal_Int32 nHgt);
+ bool SetMinTextFrameWidth(sal_Int32 nWdt);
+
+ // protected consructor: only a tooling class, do not incarnate
+ SdrTextObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform = basegfx::B2DHomMatrix(),
+ SdrObjKind eNewTextKind = OBJ_TEXT,
+ bool bIsTextFrame = false);
virtual ~SdrTextObj();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+ // helper for AdjustTextFrameWidthAndHeight which contains the common parts to avoid useless code copying
+ basegfx::B2DRange ImpAdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt, bool bWdt, bool bCheckAnimation) const;
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
+ virtual bool DoesSupportTextIndentingOnLineWidthChange() const;
// #101684#
- sal_Bool IsInEditMode() const { return mbInEditMode; }
+ bool IsInEditMode() const { return mbInEditMode; }
// via eCharSet kann der CharSet der vorliegenden Datei uebergeben werden.
// Bei RTL_TEXTENCODING_DONTKNOW wird der CharSet der aktuellen Plattform verwendet.
@@ -326,21 +318,20 @@ public:
// Eine Attributierung kann nur am Textrahmen vollzogen werden.
void SetTextLink(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet);
void ReleaseTextLink();
- FASTBOOL IsLinkedText() const { return pPlusData!=NULL && GetLinkUserData()!=NULL; }
- FASTBOOL ReloadLinkedText(FASTBOOL bForceLoad=sal_False);
- FASTBOOL LoadText(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet);
-
- virtual FASTBOOL AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True) const;
- virtual FASTBOOL NbcAdjustTextFrameWidthAndHeight(FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True);
- virtual FASTBOOL AdjustTextFrameWidthAndHeight(FASTBOOL bHgt=sal_True, FASTBOOL bWdt=sal_True);
- void NbcResizeTextAttributes(const Fraction& xFact, const Fraction& yFact);
- FASTBOOL IsTextFrame() const { return bTextFrame; }
- FASTBOOL IsOutlText() const { return bTextFrame && (eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT); }
+ bool IsLinkedText() const { return (mpPlusData && GetLinkUserData()); }
+ bool ReloadLinkedText(bool bForceLoad=false);
+ bool LoadText(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet);
+
+ virtual basegfx::B2DRange AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt = true, bool bWdt = true) const;
+ virtual bool AdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
+ void ResizeTextAttributes(const Fraction& xFact, const Fraction& yFact);
+ bool IsTextFrame() const { return bTextFrame; }
+ bool IsOutlText() const { return bTextFrame && (eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT); }
SdrObjKind GetTextKind() const { return eTextKind; }
virtual bool HasText() const;
- FASTBOOL HasEditText() const;
- sal_Bool IsTextEditActive() const { return (pEdtOutl != 0L); }
+ bool HasEditText() const;
+ bool IsTextEditActive() const { return (pEdtOutl != 0); }
/** returns the currently active text. */
virtual SdrText* getActiveText() const;
@@ -358,13 +349,11 @@ public:
virtual void setActiveText( sal_Int32 nIndex );
/** returns the index of the text that contains the given point or -1 */
- virtual sal_Int32 CheckTextHit(const Point& rPnt) const;
+ virtual sal_Int32 CheckTextHit(const basegfx::B2DPoint& rPnt) const;
- void SetDisableAutoWidthOnDragging(FASTBOOL bOn) { bDisableAutoWidthOnDragging=bOn; }
- FASTBOOL IsDisableAutoWidthOnDragging() { return bDisableAutoWidthOnDragging; }
- void NbcSetText(const String& rStr);
+ void SetDisableAutoWidthOnDragging(bool bOn) { bDisableAutoWidthOnDragging=bOn; }
+ bool IsDisableAutoWidthOnDragging() { return bDisableAutoWidthOnDragging; }
void SetText(const String& rStr);
- void NbcSetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
void SetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat);
// FitToSize und Fontwork wird bei GetTextSize() nicht berueksichtigt!
@@ -373,30 +362,29 @@ public:
// Gleichzeitig wird der Text in den Outliner gesetzt (ggf.
// der des EditOutliners) und die PaperSize gesetzt.
- virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText=sal_False,
- Rectangle* pAnchorRect=NULL, sal_Bool bLineWidth=sal_True ) const;
- virtual void TakeTextAnchorRect(::Rectangle& rAnchorRect) const;
- const GeoStat& GetGeoStat() const { return aGeo; }
-
- long GetEckenradius() const;
- virtual FASTBOOL IsAutoGrowHeight() const;
- long GetMinTextFrameHeight() const;
- long GetMaxTextFrameHeight() const;
- virtual FASTBOOL IsAutoGrowWidth() const;
- long GetMinTextFrameWidth() const;
- long GetMaxTextFrameWidth() const;
-
+ virtual void TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const;
+
+ // get the text range in unified coordinates (relative to
+ // the unit range (0,0,1,1))
+ virtual basegfx::B2DRange getUnifiedTextRange() const;
+
+ sal_Int32 GetEdgeRadius() const;
+ virtual bool IsAutoGrowHeight() const;
+ sal_Int32 GetMinTextFrameHeight() const;
+ sal_Int32 GetMaxTextFrameHeight() const;
+ virtual bool IsAutoGrowWidth() const;
+ sal_Int32 GetMinTextFrameWidth() const;
+ sal_Int32 GetMaxTextFrameWidth() const;
SdrFitToSizeType GetFitToSize() const;
- const Rectangle &GetGeoRect() const { return aRect; }
// Feststellen, ob TextFontwork
- virtual FASTBOOL IsFontwork() const;
+ virtual bool IsFontwork() const;
// Soll die Fontwork-Kontour versteckt werden?
- FASTBOOL IsHideContour() const;
+ bool IsHideContour() const;
// Textfluss innerhalb Kontur
- FASTBOOL IsContourTextFrame() const;
+ bool IsContourTextFrame() const;
// Horizontale Textausrichtung
SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const;
@@ -407,79 +395,51 @@ public:
SdrTextVertAdjust GetTextVerticalAdjust() const;
// Textrahmenabstaende
- long GetTextLeftDistance() const;
- long GetTextRightDistance() const;
- long GetTextUpperDistance() const;
- long GetTextLowerDistance() const;
+ sal_Int32 GetTextLeftDistance() const;
+ sal_Int32 GetTextRightDistance() const;
+ sal_Int32 GetTextUpperDistance() const;
+ sal_Int32 GetTextLowerDistance() const;
SdrTextAniKind GetTextAniKind() const;
SdrTextAniDirection GetTextAniDirection() const;
- virtual void SetPage(SdrPage* pNewPage);
- virtual void SetModel(SdrModel* pNewModel);
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
// Wird zur Bestimmung des Textankerbereichs benoetigt
- virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
virtual void TakeObjNameSingul(String& rName) const;
virtual void TakeObjNamePlural(String& rName) const;
- virtual void operator=(const SdrObject& rObj);
virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual basegfx::B2DPolyPolygon TakeContour() const;
- virtual void RecalcSnapRect();
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
- virtual const Rectangle& GetLogicRect() const;
- virtual long GetRotateAngle() const;
- virtual long GetShearAngle(FASTBOOL bVertical=sal_False) const;
-
virtual sal_uInt32 GetSnapPointCount() const;
- virtual Point GetSnapPoint(sal_uInt32 i) const;
-
- virtual sal_uInt32 GetHdlCount() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
// special drag methods
virtual bool hasSpecialDrag() const;
- virtual bool applySpecialDrag(SdrDragStat& rDrag);
virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
- virtual FASTBOOL BegCreate(SdrDragStat& rStat);
- virtual FASTBOOL MovCreate(SdrDragStat& rStat);
- virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- virtual FASTBOOL BckCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
virtual void BrkCreate(SdrDragStat& rStat);
- virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
- virtual Pointer GetCreatePointer() const;
-
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
-
- virtual FASTBOOL HasTextEdit() const;
- virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
- virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
+ virtual Pointer GetCreatePointer(const SdrView& rSdrView) const;
+
+ virtual bool HasTextEdit() const;
+ virtual bool BegTextEdit(SdrOutliner& rOutl);
+ virtual void TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const;
virtual void EndTextEdit(SdrOutliner& rOutl);
virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
- void StartTextAnimation(OutputDevice* pOutDev, const Point& rOffset, long nExtraData=0L);
- void StopTextAnimation(OutputDevice* pOutDev=NULL, long nExtraData=0L);
-
- virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
- void NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, SdrText* pText );
+ virtual void SetOutlinerParaObject(OutlinerParaObject* pTextObject);
+ void SetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, SdrText* pText );
virtual OutlinerParaObject* GetOutlinerParaObject() const;
virtual OutlinerParaObject* GetEditOutlinerParaObject() const;
virtual bool HasOutlinerParaObject() const;
- virtual void NbcReformatText();
+ // virtual void NbcReformatText();
virtual void ReformatText();
- virtual FASTBOOL CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
- FASTBOOL bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
+ virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
- virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
+ virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const;
void SetTextEditOutliner(SdrOutliner* pOutl) { pEdtOutl=pOutl; }
@@ -495,11 +455,11 @@ public:
@param rOutl
The Outliner to setup.
- @param rPaintRect
+ @param rPaintRange
The region to paint the outliner content into. This is useful
to e.g. determine the top, left position of text in shapes.
*/
- void SetupOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const;
+ void SetupOutlinerFormatting( SdrOutliner& rOutl, basegfx::B2DRange& rPaintRange ) const;
/** Update given Outliner equivalently to SdrTextObj::Paint()
@@ -509,61 +469,38 @@ public:
@param rOutl
The Outliner to update.
- @param rPaintRect
+ @param rPaintRange
The region to paint the outliner content into. This is useful
to e.g. determine the top, left position of text in shapes.
*/
- void UpdateOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const;
+ void UpdateOutlinerFormatting( SdrOutliner& rOutl, basegfx::B2DRange& rPaintRange ) const;
void ForceOutlinerParaObject();
- virtual sal_Bool IsVerticalWriting() const;
- virtual void SetVerticalWriting(sal_Bool bVertical);
+ virtual bool IsVerticalWriting() const;
+ virtual void SetVerticalWriting(bool bVertical);
/** called from the SdrObjEditView during text edit when the status of the edit outliner changes */
virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // transformation interface for StarOfficeAPI. This implements support for
- // homogen 3x3 matrices containing the transformation of the SdrObject. At the
- // moment it contains a shearX, rotation and translation, but for setting all linear
- // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
- // with the base geometry and returns TRUE. Otherwise it returns FALSE.
- virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
-
- // sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
- // If it's an SdrPathObj it will use the provided geometry information. The Polygon has
- // to use (0,0) as upper left and will be scaled to the given size in the matrix.
- virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
-
// #103836# iterates over the paragraphs of a given SdrObject and removes all
// hard set character attributes with the which ids contained in the
// given vector
virtual void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
// #111096#
- // Access to thext hidden flag
- sal_Bool GetTextHidden() const;
- void NbcSetTextHidden(sal_Bool bNew);
-
- // #111096#
// Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
// painting rectangle. Rotation is taken from the object.
- GDIMetaFile* GetTextScrollMetaFileAndRectangle(Rectangle& rScrollRectangle, Rectangle& rPaintRectangle);
+ GDIMetaFile* GetTextScrollMetaFileAndRange(basegfx::B2DRange& rScrollRange, basegfx::B2DRange& rPaintRange) const;
// #111096#
// Access to TextAnimationAllowed flag
bool IsTextAnimationAllowed() const;
- void SetTextAnimationAllowed(sal_Bool bNew);
+ void SetTextAnimationAllowed(bool bNew);
// #i8824#
// Set single item at the local ItemSet. *Does not use* AllowItemChange(),
// ItemChange(), PostItemChange() and ItemSetChanged() calls.
void SetObjectItemNoBroadcast(const SfxPoolItem& rItem);
-public:
//////////////////////////////////////////////////////////////////////////////
// text primitive decomposition helpers
void impDecomposeContourTextPrimitive(
@@ -588,19 +525,23 @@ public:
void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
- /** returns false if the given pointer is NULL
+ /** returns false if the given pointer is 0
or if the given SdrOutliner contains no text.
Also checks for one empty paragraph.
*/
- static bool HasTextImpl( SdrOutliner* pOutliner );
+ static bool HasTextImpl( const SdrOutliner* pOutliner );
/** returns a new created and non shared outliner.
The outliner will not get updated when the SdrModel is changed.
*/
boost::shared_ptr< SdrOutliner > CreateDrawOutliner();
+
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDOTEXT_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdouno.hxx b/svx/inc/svx/svdouno.hxx
index 5020ed56f953..c8afed82fd2b 100644
--- a/svx/inc/svx/svdouno.hxx
+++ b/svx/inc/svx/svdouno.hxx
@@ -52,6 +52,7 @@ namespace sdr { namespace contact {
struct SdrUnoObjDataHolder;
class SVX_DLLPUBLIC SdrUnoObj : public SdrRectObj
{
+private:
friend class SdrPageView;
friend class SdrControlEventListenerImpl;
@@ -61,32 +62,36 @@ class SVX_DLLPUBLIC SdrUnoObj : public SdrRectObj
String aUnoControlTypeName;
sal_Bool bOwnUnoControlModel;
-protected:
- ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > xUnoControlModel; // kann auch von aussen gesetzt werden
-
-private:
SVX_DLLPRIVATE void CreateUnoControlModel(const String& rModelName);
SVX_DLLPRIVATE void CreateUnoControlModel(const String& rModelName,
const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac );
-public:
- TYPEINFO();
+protected:
+ ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > xUnoControlModel; // kann auch von aussen gesetzt werden
- SdrUnoObj(const String& rModelName, sal_Bool bOwnsModel = sal_True);
- SdrUnoObj(const String& rModelName,
- const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac,
- sal_Bool bOwnsModel = sal_True);
virtual ~SdrUnoObj();
- virtual void SetPage(SdrPage* pNewPage);
- virtual void SetModel(SdrModel* pModel);
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+public:
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ SdrUnoObj(
+ SdrModel& rSdrModel,
+ const String& rModelName,
+ bool bOwnsModel = true);
+ SdrUnoObj(
+ SdrModel& rSdrModel,
+ const String& rModelName,
+ const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac,
+ bool bOwnsModel = true);
+ virtual bool IsSdrUnoObj() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual sal_uInt16 GetObjIdentifier() const;
-
- virtual void operator = (const SdrObject& rObj);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcSetLayer(SdrLayerID nLayer);
+ virtual void SetLayer(SdrLayerID nLayer);
// SpecialDrag support
virtual bool hasSpecialDrag() const;
diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx
index dd30c089566a..90ad0f30d87e 100644
--- a/svx/inc/svx/svdpage.hxx
+++ b/svx/inc/svx/svdpage.hxx
@@ -33,13 +33,13 @@
#include <svx/svdlayer.hxx>
#include <svx/sdrcomment.hxx>
#include <vector>
-#include <svx/sdrpageuser.hxx>
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
#include <svx/sdrmasterpagedescriptor.hxx>
#include "svx/svxdllapi.h"
#include <com/sun/star/container/XIndexAccess.hpp>
#include <svx/svdobj.hxx>
#include <boost/scoped_ptr.hpp>
+#include <svl/brdcst.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -47,136 +47,96 @@
namespace sdr { namespace contact { class ViewContact; }}
class SdrPage;
class SdrModel;
-class SfxItemPool;
class SdrPageView;
class SdrLayerAdmin;
class SetOfByte;
class Color;
class SfxStyleSheet;
-class SvxUnoDrawPagesAccess;
-
-enum SdrInsertReasonKind {SDRREASON_UNKNOWN, // unbekannt
- SDRREASON_STREAMING, // einlesen eines Doks
- SDRREASON_UNDO, // kommt aus dem Undo
- SDRREASON_COPY, // irgendjemand kopiert...
- SDRREASON_VIEWCREATE, // vom Anwender interaktiv erzeugt
- SDRREASON_VIEWCALL}; // Durch SdrView::Group(), ...
-
-class SdrInsertReason {
- const SdrObject* pRefObj;
- SdrInsertReasonKind eReason;
-public:
- SdrInsertReason(): pRefObj(NULL),eReason(SDRREASON_UNKNOWN) {}
- SdrInsertReason(SdrInsertReasonKind eR,const SdrObject* pO=NULL): pRefObj(pO),eReason(eR) {}
- void SetReferenceObject(const SdrObject* pO) { pRefObj=pO; }
- const SdrObject* GetReferenceObject() const { return pRefObj; }
- void SetReason(SdrInsertReasonKind eR) { eReason=eR; }
- SdrInsertReasonKind GetReason() const { return eReason; }
-};
//////////////////////////////////////////////////////////////////////////////
-// class SdrObjList
+// defines
+
+#define SDRPAGE_NOTFOUND 0xffffffff
+
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrObjList
+: private boost::noncopyable
{
private:
- typedef ::std::vector<SdrObject*> SdrObjectContainerType;
- SdrObjectContainerType maList;
+ /// the regular SdrObjList
+ SdrObjectVector maList;
+
+ /// the SdrObjList used when UserNavigationOrder is activated. Empty when
+ /// unused
+ SdrObjectVector maUserNavigationOrder;
+
+ /** Insert an SdrObject into maList
+
+ @param rObject
+ The object to insert into the object list.
+
+ @param nInsertPosition
+ The given object is inserted before the object at this
+ position
+ */
+ void InsertObjectIntoContainer(SdrObject& rObject, const sal_uInt32 nInsertPosition);
+
+ /** Remove an object from the object list.
+
+ @param nObjectPosition
+ The object at this position is removed from the object list.
+ Valid values include 0 and are smaller than the number of
+ objects in the list.
+ */
+ void RemoveObjectFromContainer(const sal_uInt32 nObjectPosition);
+
+ // recalculate OrdNums
+ void EnsureValidNavigationPositions(sal_uInt32 nFrom = 0);
protected:
-friend class SdrObjListIter;
-friend class SdrEditView;
- SdrObjList* pUpList; // Vaterliste
- SdrModel* pModel; // Diese Liste gehoert zu diesem Model (Layer,ItemPool,Storage).
- SdrPage* pPage; // Page, in die Liste haengt. Kann auch this sein.
- SdrObject* pOwnerObj; // OwnerObject, falls Liste eines GruppenObjekts.
- Rectangle aOutRect;
- Rectangle aSnapRect;
- SdrObjListKind eListKind;
- FASTBOOL bObjOrdNumsDirty;
- FASTBOOL bRectsDirty;
-protected:
- virtual void RecalcRects();
+ // protected constructor to make clear that this class should only
+ // be used as base for derivations, not naked. See getSdrModelFromSdrObjList
+ // which is pure virtual to force this, too
+ SdrObjList();
+
+ /// method to copy all data from given source. This includes
+ /// cloning all SdrObjects
+ void copyDataFromSdrObjList(const SdrObjList& rSource);
-private:
- /// simple ActionChildInserted forwarder to have it on a central place
- void impChildInserted(SdrObject& rChild) const;
public:
- TYPEINFO();
- SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage, SdrObjList* pNewUpList=NULL);
- SdrObjList(const SdrObjList& rSrcList);
virtual ~SdrObjList();
- // !!! Diese Methode nur fuer Leute, die ganz genau wissen was sie tun !!!
-
- // #110094# This should not be needed (!)
- void SetObjOrdNumsDirty() { bObjOrdNumsDirty=sal_True; }
- // pModel, pPage, pUpList und pOwnerObj werden Zuweisungeoperator nicht veraendert!
- void operator=(const SdrObjList& rSrcList);
- void CopyObjects(const SdrObjList& rSrcList);
- // alles Aufraeumen (ohne Undo)
- void Clear();
- SdrObjListKind GetListKind() const { return eListKind; }
- void SetListKind(SdrObjListKind eNewKind) { eListKind=eNewKind; }
- SdrObjList* GetUpList() const { return pUpList; }
- void SetUpList(SdrObjList* pNewUpList) { pUpList=pNewUpList; }
- SdrObject* GetOwnerObj() const { return pOwnerObj; }
- void SetOwnerObj(SdrObject* pNewOwner) { pOwnerObj=pNewOwner; }
- virtual SdrPage* GetPage() const;
- virtual void SetPage(SdrPage* pNewPage);
- virtual SdrModel* GetModel() const;
- virtual void SetModel(SdrModel* pNewModel);
- // Neuberechnung der Objekt-Ordnungsnummern
- void RecalcObjOrdNums();
- FASTBOOL IsObjOrdNumsDirty() const { return bObjOrdNumsDirty; }
- virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND
- , const SdrInsertReason* pReason=NULL
- );
- virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND
- , const SdrInsertReason* pReason=NULL
- );
- // aus Liste entfernen ohne delete
- virtual SdrObject* NbcRemoveObject(sal_uIntPtr nObjNum);
- virtual SdrObject* RemoveObject(sal_uIntPtr nObjNum);
- // Vorhandenes Objekt durch ein anderes ersetzen.
- // Wie Remove&Insert jedoch performanter, da die Ordnungsnummern
- // nicht Dirty gesetzt werden muessen.
- virtual SdrObject* NbcReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum);
- virtual SdrObject* ReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum);
- // Die Z-Order eines Objekts veraendern
- virtual SdrObject* NbcSetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum);
- virtual SdrObject* SetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum);
-
- virtual void SetRectsDirty();
-
- const Rectangle& GetAllObjSnapRect() const;
- const Rectangle& GetAllObjBoundRect() const;
-
- // Alle Textobjekte neu formatieren, z.B. bei Druckerwechsel
- void NbcReformatAllTextObjects();
- void ReformatAllTextObjects();
-
- /** #103122# reformats all edge objects that are connected to other objects */
- void ReformatAllEdgeObjects();
-
- // Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln.
- void BurnInStyleSheetAttributes();
-
- sal_uIntPtr GetObjCount() const;
- SdrObject* GetObj(sal_uIntPtr nNum) const;
-
- // Gelinkte Seite oder gelinktes Gruppenobjekt
- virtual FASTBOOL IsReadOnly() const;
-
- // Zaehlt alle Objekte inkl. Objekte in Objektgruppen, ...
- sal_uIntPtr CountAllObjects() const;
-
- // Alle aufgelagerten Teile (z.B. Grafiken) der Liste in den
- // Speicher laden.
- void ForceSwapInObjects() const;
- void ForceSwapOutObjects() const;
-
- void SwapInAll() const { ForceSwapInObjects(); }
- void SwapOutAll() const { ForceSwapOutObjects(); }
+
+ /// delete content and reset. This will destroy all SdrObjects
+ void ClearSdrObjList();
+
+ /// helper for unified access e.g. for std::legacy methods. This will
+ /// return maUserNavigationOrder if used
+ SdrObjectVector getSdrObjectVector() const;
+
+ // SdrModel/SdrPage access on SdrObjList level
+ virtual SdrPage* getSdrPageFromSdrObjList() const;
+ virtual SdrObject* getSdrObjectFromSdrObjList() const;
+ virtual SdrModel& getSdrModelFromSdrObjList() const = 0;
+
+ // react on content change
+ virtual void handleContentChange(const SfxHint& rHint);
+
+ // insert SdrObject
+ virtual void InsertObjectToSdrObjList(SdrObject& rObj, sal_uInt32 nPos = CONTAINER_APPEND);
+
+ // remove SdrObject (without delete)
+ virtual SdrObject* RemoveObjectFromSdrObjList(sal_uInt32 nObjNum);
+
+ // replace SdrObject with another one
+ virtual SdrObject* ReplaceObjectInSdrObjList(SdrObject& rNewObj, sal_uInt32 nObjNum);
+
+ // change OrdNum (exchange two objects)
+ virtual SdrObject* SetNavigationPosition(sal_uInt32 nOldObjNum, sal_uInt32 nNewObjNum);
+
+ /// access methods, will use maUserNavigationOrder if used
+ sal_uInt32 GetObjCount() const { return maList.size(); }
+ SdrObject* GetObj(sal_uInt32 nNum) const;
/** Makes the object list flat, i.e. the object list content are
then tree leaves
@@ -186,6 +146,7 @@ public:
removes the group object afterwards.
*/
virtual void FlattenGroups();
+
/** Ungroup the object at the given index
This method ungroups the content of the group object at the
@@ -195,164 +156,90 @@ public:
operation is performed recursively, such that the content of
the given object contains no groups afterwards.
*/
- virtual void UnGroupObj( sal_uIntPtr nObjNum );
+ virtual void UnGroupObj( sal_uInt32 nObjNum );
/** Return whether there is an explicit, user defined, object navigation
- order. When there is one this method returns <TRUE/> and the
+ order. When there is one this method returns <true/> and the
GetObjectForNavigationPosition() and
SdrObject::GetNavigationPosition() methods will return values
different from those returne by SdrObject::GetOrdNum() and
GetObj().
*/
- bool HasObjectNavigationOrder (void) const;
+ bool HasUserNavigationOrder(void) const;
/** Set the navigation position of the given object to the specified
value. Note that this changes the navigation position for all
objects on or following the old or new position.
+ This call creates a new UserNavigationOrder if not yet active
+ and changes the position only there. The original positions keep
+ unchanged and will be restored when the UserNavigationOrder
+ is removed again
*/
- void SetObjectNavigationPosition (
- SdrObject& rObject,
- const sal_uInt32 nNewNavigationPosition);
-
- /** Return the object for the given navigation position. When there is
- a user defined navigation order, i.e. mpNavigationOrder is not NULL,
- then that is used to look up the object. Otherwise the z-order is
- used by looking up the object in maList.
- @param nNavigationPosition
- Valid values include 0 and are smaller than the number of
- objects as returned by GetObjCount().
- @return
- The returned pointer is NULL for invalid positions.
- */
- SdrObject* GetObjectForNavigationPosition (const sal_uInt32 nNavigationPosition) const;
+ void SetUserNavigationPosition(SdrObject& rObject, const sal_uInt32 nNewNavigationPosition);
/** Restore the navigation order to that defined by the z-order.
*/
- void ClearObjectNavigationOrder (void);
-
- /** Set the navigation position of all SdrObjects to their position in
- the mpNavigationOrder list. This method returns immediately when no
- update is necessary.
- @return
- This method returns <TRUE/> when the navigation positions stored
- in SdrObjects are up to date.
- It returns <FALSE/> when teh navigation positions are not valid,
- for example because no explicit navigation order has been
- defined, i.e. HasObjectNavigationOrder() would return <FALSE/>.
- */
- bool RecalcNavigationPositions (void);
+ void ClearUserNavigationOrder(void);
/** Set the navigation order to the one defined by the given list of
XShape objects.
@param rxOrder
When this is an empty reference then the navigation order is
reset to the z-order. The preferred way to do this, however, is
- to call ClearObjectNavigationOrder().
+ to call ClearUserNavigationOrder().
Otherwise this list is expected to contain all the shapes in the
called SdrObjList.
*/
- void SetNavigationOrder (const ::com::sun::star::uno::Reference<
+ void SetUserNavigationOrder(const ::com::sun::star::uno::Reference<
::com::sun::star::container::XIndexAccess>& rxOrder);
+};
-private:
- class WeakSdrObjectContainerType;
- /// This list, if it exists, defines the navigation order. It it does
- /// not exist then maList defines the navigation order.
- ::boost::scoped_ptr<WeakSdrObjectContainerType> mpNavigationOrder;
+//////////////////////////////////////////////////////////////////////////////
- /// This flag is <TRUE/> when the mpNavigation list has been changed but
- /// the indices of the referenced SdrObjects still have their old values.
- bool mbIsNavigationOrderDirty;
+class SVX_DLLPUBLIC SdrPageGridFrame
+{
+private:
+ basegfx::B2DRange maPaper;
+ basegfx::B2DRange maUserArea;
- /** Insert an SdrObject into maList. Do not modify the maList member
- directly.
- @param rObject
- The object to insert into the object list.
- @param nInsertPosition
- The given object is inserted before the object at this
- position. Valid values include 0 (the object is inserted at the
- head of the list) and the number of objects in the list as
- returned by GetObjCount() (the object is inserted at the end of
- the list.)
- */
- void InsertObjectIntoContainer (
- SdrObject& rObject,
- const sal_uInt32 nInsertPosition);
+public:
+ SdrPageGridFrame(const basegfx::B2DRange& rPaper);
+ SdrPageGridFrame(const basegfx::B2DRange& rPaper, const basegfx::B2DRange& rUser);
- /** Replace an object in the object list.
- @param rObject
- The new object that replaces the one in the list at the
- specified position.
- @param nObjectPosition
- The object at this position in the object list is replaced by
- the given object. Valid values include 0 and are smaller than
- the number of objects in the list.
- */
- void ReplaceObjectInContainer (
- SdrObject& rObject,
- const sal_uInt32 nObjectPosition);
+ void SetPaperRect(const basegfx::B2DRange& rPaper) { if(maPaper != rPaper) maPaper = rPaper; }
+ void SetUserArea(const basegfx::B2DRange& rUser) { if(maUserArea != rUser) maUserArea = rUser; }
- /** Remove an object from the object list.
- The object list has to contain at least one element.
- @param nObjectPosition
- The object at this position is removed from the object list.
- Valid values include 0 and are smaller than the number of
- objects in the list.
- */
- void RemoveObjectFromContainer (
- const sal_uInt32 nObjectPosition);
+ const basegfx::B2DRange& GetPaperRect() const { return maPaper; }
+ const basegfx::B2DRange& GetUserArea() const { return maUserArea; }
};
-/*
-Eine Sdraw-Seite enthaelt genau eine Objektliste sowie eine Beschreibung
-der physikalischen Seitendimensionen (Groesse/Raender). Letzteres wird
-lediglich zum Fangen von Objekten beim Draggen benoetigt.
-An der Seite lassen sich (ueber SdrObjList) Objekte einfuegen und loeschen,
-nach vorn und nach hinten stellen. Ausserdem kann die Ordnungszahl eines
-Objektes abgefragt sowie direkt gesetzt werden.
-*/
+class SVX_DLLPUBLIC SdrPageGridFrameList
+{
+private:
+ typedef ::std::vector< SdrPageGridFrame* > SdrPageGridFrameContainerType;
+ SdrPageGridFrameContainerType maList;
-// Used for all methods which return a page number
-#define SDRPAGE_NOTFOUND 0xFFFF
+ SVX_DLLPRIVATE SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList);
+ SVX_DLLPRIVATE void operator=(const SdrPageGridFrameList& rSrcList);
-//////////////////////////////////////////////////////////////////////////////
-// class SdrPageGridFrame
+protected:
+ SdrPageGridFrame* GetObject(sal_uInt32 i) const;
-// Fuer das Fangraster/Punkgitter im Writer
-class SdrPageGridFrame
-{
- Rectangle aPaper;
- Rectangle aUserArea;
public:
- SdrPageGridFrame(const Rectangle& rPaper): aPaper(rPaper), aUserArea(rPaper) {}
- SdrPageGridFrame(const Rectangle& rPaper, const Rectangle& rUser): aPaper(rPaper), aUserArea(rUser) {}
- void SetPaperRect(const Rectangle& rPaper) { aPaper=rPaper; }
- void SetUserArea(const Rectangle& rUser) { aUserArea=rUser; }
- const Rectangle& GetPaperRect() const { return aPaper; }
- const Rectangle& GetUserArea() const { return aUserArea; }
-};
+ SdrPageGridFrameList();
+ ~SdrPageGridFrameList();
-class SVX_DLLPUBLIC SdrPageGridFrameList {
- Container aList;
-private:
- SVX_DLLPRIVATE SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList); // never implemented
- SVX_DLLPRIVATE void operator=(const SdrPageGridFrameList& rSrcList); // never implemented
-protected:
- SdrPageGridFrame* GetObject(sal_uInt16 i) const { return (SdrPageGridFrame*)(aList.GetObject(i)); }
-public:
- SdrPageGridFrameList(): aList(1024,4,4) {}
- ~SdrPageGridFrameList() { Clear(); }
void Clear();
- sal_uInt16 GetCount() const { return sal_uInt16(aList.Count()); }
- void Insert(const SdrPageGridFrame& rGF, sal_uInt16 nPos=0xFFFF) { aList.Insert(new SdrPageGridFrame(rGF),nPos); }
- void Delete(sal_uInt16 nPos) { delete (SdrPageGridFrame*)aList.Remove(nPos); }
- void Move(sal_uInt16 nPos, sal_uInt16 nNewPos) { aList.Insert(aList.Remove(nPos),nNewPos); }
- SdrPageGridFrame& operator[](sal_uInt16 nPos) { return *GetObject(nPos); }
- const SdrPageGridFrame& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); }
+ sal_uInt32 GetCount() const { return maList.size(); }
+
+ void Insert(const SdrPageGridFrame& rGF, sal_uInt32 nPos = 0xffffffff);
+ void Delete(sal_uInt32 nPos);
+
+ SdrPageGridFrame& operator[](sal_uInt32 nPos) { return *GetObject(nPos); }
+ const SdrPageGridFrame& operator[](sal_uInt32 nPos) const { return *GetObject(nPos); }
};
////////////////////////////////////////////////////////////////////////////////////////////////////
-// class SdrPageProperties
class SVX_DLLPUBLIC SdrPageProperties : public SfxListener
{
@@ -389,181 +276,155 @@ public:
};
////////////////////////////////////////////////////////////////////////////////////////////////////
-// class SdrPage
-
-class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage >
+//
+// SdrPage
+// DlgEdPage
+// OReportPage
+// FmFormPage
+// ScDrawPage
+// SdPage
+// SwDPage
+//
+
+class SVX_DLLPUBLIC SdrPage
+: public SdrObjList,
+ public SfxBroadcaster,
+ public tools::WeakBase< SdrPage >
{
- ///////////////////////////////////////////////////////////////////////////////
- // start PageUser section
private:
- // #111111# PageUser section
- sdr::PageUserVector maPageUsers;
-
-public:
- void AddPageUser(sdr::PageUser& rNewUser);
- void RemovePageUser(sdr::PageUser& rOldUser);
+ SdrModel& mrSdrModelFromSdrPage;
- ///////////////////////////////////////////////////////////////////////////////
- // end PageUser section
-
- ///////////////////////////////////////////////////////////////////////////////
- // #110094# DrawContact section
-private:
sdr::contact::ViewContact* mpViewContact;
-protected:
+ SdrPageProperties* mpSdrPageProperties;
+ sdr::CommentVector maComments;
+
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-public:
- sdr::contact::ViewContact& GetViewContact() const;
- // #110094# DrawContact support: Methods for handling Page changes
- void ActionChanged() const;
+ // only allow SetPageNumberAtSdrPageFromSdrModel to call SetPageNumber
+ friend void SetPageNumberAtSdrPageFromSdrModel(SdrPage& rPage, sal_uInt32 nPageNum);
+ SVX_DLLPRIVATE void SetPageNumber(sal_uInt32 nNew);
- // #i9076#
- friend class SdrModel;
- friend class SvxUnoDrawPagesAccess;
+ // only allow SetInsertedAtSdrPageFromSdrModel to call SetInserted
+ friend void SetInsertedAtSdrPageFromSdrModel(SdrPage& rPage, bool bInserted);
+ void SetInserted(bool bInserted);
-// this class uses its own UNO wrapper
-// and thus has to set mxUnoPage
-friend class ChXChartDocument;
+ // current PageNumber, trhe index in the List in the model the page is added
+ sal_uInt32 mnPageNum;
- sal_Int32 nWdt; // Seitengroesse
- sal_Int32 nHgt; // Seitengroesse
- sal_Int32 nBordLft; // Seitenrand links
- sal_Int32 nBordUpp; // Seitenrand oben
- sal_Int32 nBordRgt; // Seitenrand rechts
- sal_Int32 nBordLwr; // Seitenrand unten
+protected:
+ SdrLayerAdmin* mpPageLayerAdmin;
+ ::sdr::MasterPageDescriptor* mpMasterPageDescriptor;
// this is a weak reference to a possible living api wrapper for this page
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
-protected:
- SdrLayerAdmin* pLayerAdmin;
-private:
- SdrPageProperties* mpSdrPageProperties;
-
-public:
- SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
- const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
- const SdrPageProperties* getCorrectSdrPageProperties() const;
-
-protected:
- // new MasterPageDescriptorVector
- ::sdr::MasterPageDescriptor* mpMasterPageDescriptor;
-
- SetOfByte aPrefVisiLayers;
- sal_uInt16 nPageNum;
+ basegfx::B2DVector maPageScale; // page width and height
+ double mfLeftPageBorder; // Seitenrand links
+ double mfTopPageBorder; // Seitenrand oben
+ double mfRightPageBorder; // Seitenrand rechts
+ double mfBottomPageBorder; // Seitenrand unten
// bitfield
- unsigned mbMaster : 1; // flag if this is a MasterPage
- unsigned mbInserted : 1;
- unsigned mbObjectsNotPersistent : 1;
- unsigned mbSwappingLocked : 1;
+ bool mbMaster : 1; // flag if this is a MasterPage
+
+ // inserted state of the SdrPage
+ bool mbInserted : 1;
// #i93597#
- unsigned mbPageBorderOnlyLeftRight : 1;
+ bool mbPageBorderOnlyLeftRight : 1;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrPage(const SdrPage& rSource);
+
public:
- TYPEINFO();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrPage* CloneSdrPage(SdrModel* pTargetModel = 0) const;
+
+ // access to model of this page
+ SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; }
+ virtual SdrModel& getSdrModelFromSdrObjList() const;
+
SdrPage(SdrModel& rNewModel, bool bMasterPage=false);
- // Copy-Ctor und Zuweisungeoperator sind nicht getestet!
- SdrPage(const SdrPage& rSrcPage);
virtual ~SdrPage();
- // pModel, pPage, pUpList, pOwnerObj und mbInserted werden Zuweisungeoperator nicht veraendert!
- virtual void operator=(const SdrPage& rSrcPage);
- virtual SdrPage* Clone() const;
- virtual SdrPage* Clone(SdrModel* pNewModel) const;
+
+ sdr::contact::ViewContact& GetViewContact() const;
+
+ void AddListener(SfxListener& rListener);
+ void RemoveListener(SfxListener& rListener);
+ void ActionChanged() const;
+
+ // derived from SdrObjList, returns this
+ virtual SdrPage* getSdrPageFromSdrObjList() const;
+
+ SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
+ const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
+ const SdrPageProperties* getCorrectSdrPageProperties() const;
+
bool IsMasterPage() const { return mbMaster; }
- void SetInserted(bool bNew = true);
- FASTBOOL IsInserted() const { return mbInserted; }
+ bool IsInserted() const { return mbInserted; }
virtual void SetChanged();
// #i68775# React on PageNum changes (from Model in most cases)
- void SetPageNum(sal_uInt16 nNew);
- sal_uInt16 GetPageNum() const;
+ sal_uInt32 GetPageNumber() const;
// #i93597# Allow page border definition to not be the full rectangle but to
// use only the left and right vertical edges (reportdesigner)
void setPageBorderOnlyLeftRight(bool bNew) { mbPageBorderOnlyLeftRight = bNew; }
bool getPageBorderOnlyLeftRight() const { return mbPageBorderOnlyLeftRight; }
- virtual void SetSize(const Size& aSiz);
- virtual Size GetSize() const;
+ // helpers for page size definitions
+ basegfx::B2DRange GetInnerPageRange() const;
+ basegfx::B2DVector GetInnerPageScale() const;
+
+ // page scale read/write access
+ const basegfx::B2DVector& GetPageScale() const { return maPageScale; }
+ virtual void SetPageScale(const basegfx::B2DVector& aNewScale);
+
+ // overloaded in SD since an own orientation is used there
virtual void SetOrientation(Orientation eOri);
virtual Orientation GetOrientation() const;
- virtual sal_Int32 GetWdt() const;
- virtual sal_Int32 GetHgt() const;
- virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr);
- virtual void SetLftBorder(sal_Int32 nBorder);
- virtual void SetUppBorder(sal_Int32 nBorder);
- virtual void SetRgtBorder(sal_Int32 nBorder);
- virtual void SetLwrBorder(sal_Int32 nBorder);
- virtual sal_Int32 GetLftBorder() const;
- virtual sal_Int32 GetUppBorder() const;
- virtual sal_Int32 GetRgtBorder() const;
- virtual sal_Int32 GetLwrBorder() const;
-
- virtual void SetModel(SdrModel* pNewModel);
+
+ void SetPageBorder(double fLeft, double fTop, double fRight, double fBottom);
+ void SetLeftPageBorder(double fBorder);
+ void SetTopPageBorder(double fBorder);
+ void SetRightPageBorder(double fBorder);
+ void SetBottomPageBorder(double fBorder);
+
+ double GetLeftPageBorder() const;
+ double GetTopPageBorder() const;
+ double GetRightPageBorder() const;
+ double GetBottomPageBorder() const;
// New MasterPage interface
- sal_Bool TRG_HasMasterPage() const { return (0L != mpMasterPageDescriptor); }
+ bool TRG_HasMasterPage() const { return (0L != mpMasterPageDescriptor); }
void TRG_SetMasterPage(SdrPage& rNew);
void TRG_ClearMasterPage();
SdrPage& TRG_GetMasterPage() const;
const SetOfByte& TRG_GetMasterPageVisibleLayers() const;
void TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew);
sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const;
-
-//#if 0 // _SOLAR__PRIVATE
-protected:
- void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage);
-//#endif // __PRIVATE
-public:
+ void TRG_MasterPageRemoved(const SdrPage& rRemovedPage);
// Aenderungen an den Layern setzen nicht das Modified-Flag !
- const SdrLayerAdmin& GetLayerAdmin() const { return *pLayerAdmin; }
- SdrLayerAdmin& GetLayerAdmin() { return *pLayerAdmin; }
-
- // GetBitmap und GetMetafile sind noch nicht implementiert.
- // Bitmap in Bildschirmaufloesung und -farbtiefe aus den Objekten der
- // Page erzeugen.
- Bitmap GetBitmap(FASTBOOL bTrimBorders=sal_True) const { return GetBitmap(aPrefVisiLayers,bTrimBorders); }
- Bitmap GetBitmap(const SetOfByte& rVisibleLayers, FASTBOOL bTrimBorders=sal_True) const;
- // Metafile aus den Objekten der Page erzeugen
- GDIMetaFile GetMetaFile(FASTBOOL bTrimBorders=sal_True) { return GetMetaFile(aPrefVisiLayers,bTrimBorders); }
- GDIMetaFile GetMetaFile(const SetOfByte& rVisibleLayers, FASTBOOL bTrimBorders=sal_True);
+ const SdrLayerAdmin& GetPageLayerAdmin() const { return *mpPageLayerAdmin; }
+ SdrLayerAdmin& GetPageLayerAdmin() { return *mpPageLayerAdmin; }
virtual String GetLayoutName() const;
// fuer's Raster im Writer, auch fuer AlignObjects wenn 1 Objekt markiert ist
- // wenn pRect!=NULL, dann die Seiten, die von diesem Rect intersected werden
+ // wenn pRect!=0, dann die Seiten, die von diesem Rect intersected werden
// ansonsten die sichtbaren Seiten.
- virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV, const Rectangle* pRect) const;
- bool IsObjectsNotPersistent() const { return mbObjectsNotPersistent; }
- void SetObjectsNotPersistent(bool b) { mbObjectsNotPersistent = b; }
- // Durch Setzen dieses Flags, kann das Auslagern (Swappen) von
- // Teilen der Page (z.B. Grafiken) unterbunden werden.
- // Es werden hierdurch jedoch nicht automatisch alle ausgelagerten
- // Teile nachgeladen, dies geschieht erst bei konkretem Bedarf oder
- // durch Aufruf von SwapInAll().
- // Fuer die MasterPage(s) der Page muss dies ggf. separat gemacht werden.
- bool IsSwappingLocked() const { return mbSwappingLocked; }
- void SetSwappingLocked(bool bLock) { mbSwappingLocked = bLock; }
+ virtual const SdrPageGridFrameList* GetGridFrameList(const SdrView& rSdrView, const Rectangle* pRect) const;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoPage();
virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const;
- FASTBOOL HasTransparentObjects( sal_Bool bCheckForAlphaChannel = sal_False ) const;
-
- /** *deprecated* returns an averaged background color of this page */
- // #i75566# GetBackgroundColor -> GetPageBackgroundColor
- Color GetPageBackgroundColor() const;
-
/** *deprecated* returns an averaged background color of this page */
// #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value
- Color GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay = true) const;
+ Color GetPageBackgroundColor(SdrPageView* pView = 0, bool bScreenDisplay = true) const;
/** this method returns true if the object from the ViewObjectContact should
be visible on this page while rendering.
@@ -578,12 +439,7 @@ public:
/** Check if page is the HandoutMasterPage (in SVX, no PK_HANDOUT available) */
bool isHandoutMasterPage() const;
- //////////////////////////////////////////////////////////////////////////////
- // sdr::Comment interface
-private:
- sdr::CommentVector maComments;
-
-public:
+ // Comment API
sal_uInt32 GetCommentCount() const { return maComments.size(); }
const sdr::Comment& GetCommentByIndex(sal_uInt32 nIndex);
void AddComment(const sdr::Comment& rNew);
@@ -593,7 +449,6 @@ public:
typedef tools::WeakReference< SdrPage > SdrPageWeakRef;
//////////////////////////////////////////////////////////////////////////////
-// use new redirector instead of pPaintProc
class SVX_DLLPUBLIC StandardCheckVisisbilityRedirector : public ::sdr::contact::ViewObjectContactRedirector
{
@@ -612,3 +467,5 @@ public:
#endif //_SVDPAGE_HXX
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdpagv.hxx b/svx/inc/svx/svdpagv.hxx
index 044213abab35..6c9ed3e72b39 100644
--- a/svx/inc/svx/svdpagv.hxx
+++ b/svx/inc/svx/svdpagv.hxx
@@ -31,61 +31,43 @@
#include <svx/svdsob.hxx>
#include <svx/svdtypes.hxx>
#include "svx/svxdllapi.h"
-
#include <cppuhelper/implbase3.hxx>
#include <vector>
#include <basegfx/polygon/b2dpolypolygon.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
class Region;
class SdrObjList;
class SdrObject;
class SdrPage;
-class SdrUnoObj;
class SdrPaintWindow;
class SdrView;
-class SdrPageObj;
-class B2dIAOManager;
-class SdrPageView;
-
-// #110094#
-namespace sdr
-{
- namespace contact
- {
- class ViewObjectContactRedirector;
- class DisplayInfo;
- class ViewObjectContactRedirector;
- } // end of namespace contact
-} // end of namespace sdr
-
-// typedefs for a list of SdrPageWindow
class SdrPageWindow;
-typedef ::std::vector< SdrPageWindow* > SdrPageWindowVector;
+class OutputDevice;
+namespace sdr { namespace contact { class ViewObjectContactRedirector; }}
////////////////////////////////////////////////////////////////////////////////////////////////////
-class SVX_DLLPUBLIC SdrPageView : public SfxListener
+class SVX_DLLPUBLIC SdrPageView
{
+private:
+ SVX_DLLPRIVATE SdrPageWindow& CreateNewPageWindowEntry(SdrPaintWindow& rPaintWindow);
+
protected:
SdrView& mrView;
- SdrPage* mpPage;
- Point aPgOrg; // Nullpunkt der Page
+ SdrPage& mrSdrPageOfSdrPageView;
+ basegfx::B2DPoint maPageOrigin; // Nullpunkt der Page
- Rectangle aMarkBound; // wird
- Rectangle aMarkSnap; // von
- sal_Bool mbHasMarked;
- sal_Bool mbVisible;
+ SetOfByte maVisibleLayerSet; // Menge der sichtbaren Layer
+ SetOfByte maLockedLayerSet; // Menge der nicht editierbaren Layer
+ SetOfByte maPrintableLayerSet; // Menge der druckbaren Layer
- SetOfByte aLayerVisi; // Menge der sichtbaren Layer
- SetOfByte aLayerLock; // Menge der nicht editierbaren Layer
- SetOfByte aLayerPrn; // Menge der druckbaren Layer
+ SdrObjList* mpCurrentList; // Aktuelle Liste, in der Regel die Page.
+ SdrObject* mpCurrentGroup; // Aktuelle Gruppe. NULL=Keine.
- SdrObjList* pAktList; // Aktuelle Liste, in der Regel die Page.
- SdrObject* pAktGroup; // Aktuelle Gruppe. NULL=Keine.
-
- SdrHelpLineList aHelpLines; // Hilfslinien und -punkte
+ SdrHelpLineList maHelpLines; // Hilfslinien und -punkte
// #103911# Use one reserved slot (bReserveBool2) for the document color
Color maDocumentColor;
@@ -93,19 +75,36 @@ protected:
// #103834# Use one reserved slot (bReserveBool1) for the background color
Color maBackgroundColor;
+ typedef ::std::vector< SdrPageWindow* > SdrPageWindowVector;
SdrPageWindowVector maPageWindows;
// #i72752# member to remember with which SdrPageWindow the BeginDrawLayer
// was done
SdrPageWindow* mpPreparedPageWindow;
+ /// bitfield
+ bool mbVisible : 1;
+
// interface to SdrPageWindow
-protected:
void ClearPageWindows();
void AppendPageWindow(SdrPageWindow& rNew);
SdrPageWindow* RemovePageWindow(sal_uInt32 nPos);
SdrPageWindow* RemovePageWindow(SdrPageWindow& rOld);
+
+ void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const;
+
+ void SetLayer(const String& rName, SetOfByte& rBS, bool bJa);
+ bool IsLayer(const String& rName, const SetOfByte& rBS) const;
+ void SetAllLayers(SetOfByte& rB, bool bJa);
+
+ // Nachsehen, ob AktGroup noch Inserted ist.
+ void CheckAktGroup();
+ void AdjHdl();
+
public:
+ SdrPageView(SdrPage& rSdrPageOfSdrPageView, SdrView& rNewView);
+ ~SdrPageView();
+
sal_uInt32 PageWindowCount() const { return maPageWindows.size(); }
SdrPageWindow* FindPageWindow( SdrPaintWindow& rPaintWindow ) const;
SdrPageWindow* FindPageWindow( const OutputDevice& rOutDev ) const;
@@ -119,31 +118,8 @@ public:
*/
const SdrPageWindow* FindPatchedPageWindow( const OutputDevice& rOutDev ) const;
-private:
- SVX_DLLPRIVATE SdrPageWindow& CreateNewPageWindowEntry(SdrPaintWindow& rPaintWindow);
-
-protected:
- void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const;
-
-protected:
- void SetLayer(const String& rName, SetOfByte& rBS, sal_Bool bJa);
- sal_Bool IsLayer(const String& rName, const SetOfByte& rBS) const;
- void SetAllLayers(SetOfByte& rB, sal_Bool bJa);
-
- virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
-
- // Nachsehen, ob AktGroup noch Inserted ist.
- void CheckAktGroup();
-
- void AdjHdl();
-
-public:
- TYPEINFO();
- SdrPageView(SdrPage* pPage1, SdrView& rNewView);
- ~SdrPageView();
-
// Wird von der PaintView gerufen, wenn Modelaenderungen abgeschlossen sind
- void ModelHasChanged();
+ void LazyReactOnObjectChanges();
void Show();
void Hide();
@@ -166,15 +142,15 @@ public:
/** sets all elements in the view which support a design and a alive mode into the given mode
*/
- void SetDesignMode( bool _bDesignMode ) const;
+ void SetDesignMode( bool _bDesignMode );
- sal_Bool IsVisible() const { return mbVisible; }
+ bool IsVisible() const { return mbVisible; }
// Invalidiert den gesamten Bereich der Page
void InvalidateAllWin();
// rRect bezieht sich auf die Page
- void InvalidateAllWin(const Rectangle& rRect, sal_Bool bPlus1Pix=sal_False);
+ void InvalidateAllWin(const basegfx::B2DRange& rRange, bool bPlus1Pix = false);
// PrePaint call forwarded from app windows
void PrePaint();
@@ -183,83 +159,65 @@ public:
void PostPaint();
// rReg bezieht sich auf's OutDev, nicht auf die Page
- void CompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const;
+ void CompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0) const;
// write access to mpPreparedPageWindow
void setPreparedPageWindow(SdrPageWindow* pKnownTarget);
- void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget = 0, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const;
- void DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, Color aColor = Color( COL_BLACK ) );
-
- Rectangle GetPageRect() const;
- SdrPage* GetPage() const { return mpPage; }
-
- // Betretene Liste rausreichen
- SdrObjList* GetObjList() const { return pAktList; }
-
- // Betretene Gruppe rausreichen
- SdrObject* GetAktGroup() const { return pAktGroup; }
+ void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget = 0, sdr::contact::ViewObjectContactRedirector* pRedirector = 0) const;
+ void DrawPageViewGrid(OutputDevice& rOut, const basegfx::B2DRange& rRect, Color aColor = Color( COL_BLACK ) );
- // Betretene Gruppe und Liste setzen
- void SetAktGroupAndList(SdrObject* pNewGroup, SdrObjList* pNewList);
+ basegfx::B2DRange GetPageRange() const;
+ SdrPage& getSdrPageFromSdrPageView() const { return mrSdrPageOfSdrPageView; }
- sal_Bool HasMarkedObjPageView() const { return mbHasMarked; }
- void SetHasMarkedObj(sal_Bool bOn) { mbHasMarked = bOn; }
+ // get/set entered List/Group
+ SdrObjList* GetCurrentObjectList() const { return mpCurrentList; }
+ SdrObject* GetCurrentGroup() const { return mpCurrentGroup; }
+ void SetCurrentGroupAndObjectList(SdrObject* pNewGroup, SdrObjList* pNewList);
- const Rectangle& MarkBound() const { return aMarkBound; }
- const Rectangle& MarkSnap() const { return aMarkSnap; }
- Rectangle& MarkBound() { return aMarkBound; }
- Rectangle& MarkSnap() { return aMarkSnap; }
+ void SetLayerVisible(const String& rName, bool bShow = true) { SetLayer(rName, maVisibleLayerSet, bShow); if(!bShow) AdjHdl(); InvalidateAllWin(); }
+ bool IsLayerVisible(const String& rName) const { return IsLayer(rName, maVisibleLayerSet); }
+ void SetAllLayersVisible(bool bShow = true) { SetAllLayers(maVisibleLayerSet, bShow); if(!bShow) AdjHdl(); InvalidateAllWin(); }
- void SetLayerVisible(const String& rName, sal_Bool bShow = sal_True) { SetLayer(rName, aLayerVisi, bShow); if(!bShow) AdjHdl(); InvalidateAllWin(); }
- sal_Bool IsLayerVisible(const String& rName) const { return IsLayer(rName, aLayerVisi); }
- void SetAllLayersVisible(sal_Bool bShow = sal_True) { SetAllLayers(aLayerVisi, bShow); if(!bShow) AdjHdl(); InvalidateAllWin(); }
+ void SetLayerLocked(const String& rName, bool bLock = true) { SetLayer(rName, maLockedLayerSet, bLock); if(bLock) AdjHdl(); }
+ bool IsLayerLocked(const String& rName) const { return IsLayer(rName,maLockedLayerSet); }
+ void SetAllLayersLocked(bool bLock = true) { SetAllLayers(maLockedLayerSet, bLock); if(bLock) AdjHdl(); }
- void SetLayerLocked(const String& rName, sal_Bool bLock = sal_True) { SetLayer(rName, aLayerLock, bLock); if(bLock) AdjHdl(); }
- sal_Bool IsLayerLocked(const String& rName) const { return IsLayer(rName,aLayerLock); }
- void SetAllLayersLocked(sal_Bool bLock = sal_True) { SetAllLayers(aLayerLock, bLock); if(bLock) AdjHdl(); }
-
- void SetLayerPrintable(const String& rName, sal_Bool bPrn = sal_True) { SetLayer(rName, aLayerPrn, bPrn); }
- sal_Bool IsLayerPrintable(const String& rName) const { return IsLayer(rName, aLayerPrn); }
- void SetAllLayersPrintable(sal_Bool bPrn = sal_True) { SetAllLayers(aLayerPrn, bPrn); }
+ void SetLayerPrintable(const String& rName, bool bPrn = true) { SetLayer(rName, maPrintableLayerSet, bPrn); }
+ bool IsLayerPrintable(const String& rName) const { return IsLayer(rName, maPrintableLayerSet); }
+ void SetAllLayersPrintable(bool bPrn = true) { SetAllLayers(maPrintableLayerSet, bPrn); }
// PV stellt eine RefPage oder eine SubList eines RefObj dar oder Model ist ReadOnly
- sal_Bool IsReadOnly() const;
+ bool IsReadOnly() const;
// der Origin bezieht sich immer auf die obere linke Ecke der Page
- const Point& GetPageOrigin() const { return aPgOrg; }
- void SetPageOrigin(const Point& rOrg);
-
- void LogicToPagePos(Point& rPnt) const { rPnt-=aPgOrg; }
- void LogicToPagePos(Rectangle& rRect) const { rRect.Move(-aPgOrg.X(),-aPgOrg.Y()); }
- void PagePosToLogic(Point& rPnt) const { rPnt+=aPgOrg; }
- void PagePosToLogic(Rectangle& rRect) const { rRect.Move(aPgOrg.X(),aPgOrg.Y()); }
-
- void SetVisibleLayers(const SetOfByte& rSet) { aLayerVisi=rSet; InvalidateAllWin(); }
- const SetOfByte& GetVisibleLayers() const { return aLayerVisi; }
- void SetPrintableLayers(const SetOfByte& rSet) { aLayerPrn=rSet; }
- const SetOfByte& GetPrintableLayers() const { return aLayerPrn; }
- void SetLockedLayers(const SetOfByte& rSet) { aLayerLock=rSet; }
- const SetOfByte& GetLockedLayers() const { return aLayerLock; }
-
- const SdrHelpLineList& GetHelpLines() const { return aHelpLines; }
+ const basegfx::B2DPoint& GetPageOrigin() const { return maPageOrigin; }
+ void SetPageOrigin(const basegfx::B2DPoint& rOrg);
+
+ void SetVisibleLayers(const SetOfByte& rSet) { maVisibleLayerSet = rSet; InvalidateAllWin(); }
+ const SetOfByte& GetVisibleLayers() const { return maVisibleLayerSet; }
+ void SetPrintableLayers(const SetOfByte& rSet) { maPrintableLayerSet = rSet; }
+ const SetOfByte& GetPrintableLayers() const { return maPrintableLayerSet; }
+ void SetLockedLayers(const SetOfByte& rSet) { maLockedLayerSet = rSet; }
+ const SetOfByte& GetLockedLayers() const { return maLockedLayerSet; }
+
+ const SdrHelpLineList& GetHelpLines() const { return maHelpLines; }
void SetHelpLines(const SdrHelpLineList& rHLL);
//void SetHelpLinePos(sal_uInt16 nNum, const Point& rNewPos);
- void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine& rNewHelpLine);
- void DeleteHelpLine(sal_uInt16 nNum);
- void InsertHelpLine(const SdrHelpLine& rHL, sal_uInt16 nNum=0xFFFF);
- void MoveHelpLine(sal_uInt16 nNum, sal_uInt16 nNewNum) { aHelpLines.Move(nNum,nNewNum); }
+ void SetHelpLine(sal_uInt32 nNum, const SdrHelpLine& rNewHelpLine);
+ void DeleteHelpLine(sal_uInt32 nNum);
+ void InsertHelpLine(const SdrHelpLine& rHL);
// Liefert sal_True, wenn Layer des Obj sichtbar und nicht gesperrt.
// Beim Gruppenobjekt muss wenigstens ein Member sichtbar sein,
// gesperrt sein darf keiner.
- sal_Bool IsObjMarkable(SdrObject* pObj) const;
+ bool IsObjMarkable(const SdrObject& rObj) const;
// Betreten (Editieren) einer Objektgruppe. Anschliessend liegen alle
// Memberobjekte der Gruppe im direkten Zugriff. Alle anderen Objekte
// koennen waerendessen nicht bearbeitet werden (bis zum naechsten
// LeaveGroup()). (wie MsDos chdir bla).
- sal_Bool EnterGroup(SdrObject* pObj);
+ bool EnterGroup(SdrObject* pObj);
// Verlassen einer betretenen Objektgruppe. (wie MsDos chdir ..)
void LeaveOneGroup();
@@ -268,7 +226,7 @@ public:
void LeaveAllGroup();
// Feststellen, wie weit hinabgestiegen wurde (0=Root(Page))
- sal_uInt16 GetEnteredLevel() const;
+ sal_uInt32 GetEnteredLevel() const;
// Name der aktuellen Objektgruppe
String GetActualGroupName() const;
@@ -290,3 +248,6 @@ public:
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_SVDPAGV_HXX
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx
index 2ca59e1bd3d9..1ebe89f24890 100644
--- a/svx/inc/svx/svdpntv.hxx
+++ b/svx/inc/svx/svdpntv.hxx
@@ -32,44 +32,33 @@
#include <svx/svdlayer.hxx> // fuer SetOfByte
#include <vcl/window.hxx>
#include <svtools/colorcfg.hxx>
-#include <com/sun/star/awt/XControlContainer.hpp>
#include <svl/itemset.hxx>
#include <vcl/timer.hxx>
#include "svx/svxdllapi.h"
#include <svtools/optionsdrawinglayer.hxx>
#include <unotools/options.hxx>
+#include <svx/svdopath.hxx>
+#include <svx/svdocirc.hxx>
-//************************************************************
-// Pre-Defines
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
class SdrPageWindow;
-
-namespace com { namespace sun { namespace star { namespace awt {
- class XControlContainer;
-}}}}
-
class SdrPage;
-class SdrView;
class SfxItemSet;
class SfxStyleSheet;
class SdrOle2Obj;
class SdrModel;
-class SdrObject;
-class SdrViewUserMarker;
-class B2dIAOManager;
+namespace sdr { namespace contact { class ViewObjectContactRedirector; }}
+class SdrPageView;
+class SdrView;
#ifdef DBG_UTIL
class SdrItemBrowser;
#endif
-namespace sdr { namespace contact {
- class ViewObjectContactRedirector;
-}}
-
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Defines for AnimationMode
-//************************************************************
enum SdrAnimationMode
{
@@ -78,36 +67,24 @@ enum SdrAnimationMode
SDR_ANIMATION_DISABLE
};
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Typedef's und defines
-//************************************************************
typedef unsigned char TRISTATE;
#define FUZZY (2)
#define SDR_ANYFORMAT (0xFFFFFFFF)
#define SDR_ANYITEM (0xFFFF)
-#define SDRVIEWWIN_NOTFOUND (0xFFFF)
-
////////////////////////////////////////////////////////////////////////////////////////////////////
-class SdrPaintView;
-
-namespace sdr
-{
- namespace contact
- {
- class ViewObjectContactRedirector;
- } // end of namespace contact
-} // end of namespace sdr
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
class SVX_DLLPUBLIC SvxViewHint : public SfxHint
{
public:
- enum HintType { SVX_HINT_VIEWCHANGED };
- TYPEINFO();
+ enum HintType
+ {
+ SVX_HINT_VIEWCHANGED
+ };
+
SvxViewHint (HintType eType);
HintType GetHintType (void) const;
@@ -115,9 +92,12 @@ private:
HintType meHintType;
};
+////////////////////////////////////////////////////////////////////////////////////////////////////
// typedefs for a list of SdrPaintWindows
+
class SdrPaintWindow;
typedef ::std::vector< SdrPaintWindow* > SdrPaintWindowVector;
+class LazyObjectChangeReactor;
//////////////////////////////////////////////////////////////////////////////
// helper to convert any GDIMetaFile to a good quality BitmapEx,
@@ -129,212 +109,189 @@ BitmapEx SVX_DLLPUBLIC convertMetafileToBitmapEx(
const sal_uInt32 nMaximumQuadraticPixels = 500000);
////////////////////////////////////////////////////////////////////////////////////////////////////
+// tooling
+
+SVX_DLLPUBLIC basegfx::B2DPoint OrthoDistance8(const basegfx::B2DPoint& rReference, const basegfx::B2DPoint& rCandidate, bool bBigOrtho);
+SVX_DLLPUBLIC basegfx::B2DPoint OrthoDistance4(const basegfx::B2DPoint& rReference, const basegfx::B2DPoint& rCandidate, bool bBigOrtho);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, public SfxBroadcaster, public ::utl::ConfigurationListener
{
- friend class SdrPageView;
- friend class FrameAnimator;
- friend class SdrGrafObj;
+private:
+ // allow LazyObjectChangeReactor to callback into LazyReactOnObjectChanges()
+ friend class LazyObjectChangeReactor;
+ LazyObjectChangeReactor* mpLazyObjectChangeReactor;
protected:
- // #114409#-2 Migrate Encirclement
- class ImplEncirclementOverlay* mpEncirclementOverlay;
-
- SdrModel* pMod;
+ SdrModel& mrModelFromSdrView;
#ifdef DBG_UTIL
- SdrItemBrowser* pItemBrowser;
+ SdrItemBrowser* mpItemBrowser;
#endif
- const OutputDevice* pActualOutDev; // Nur zum vergleichen
- OutputDevice* pDragWin;
- SfxStyleSheet* pDefaultStyleSheet;
-
- String aAktLayer; // Aktueller Zeichenlayer
- String aMeasureLayer; // Aktueller Layer fuer Bemassung
+ const OutputDevice* mpActualOutDev; // Nur zum vergleichen
+ SfxStyleSheet* mpDefaultStyleSheet;
-// Container aPagV; // Liste von SdrPageViews
+ String maAktLayer; // Aktueller Zeichenlayer
+ String maMeasureLayer; // Aktueller Layer fuer Bemassung
SdrPageView* mpPageView;
// All windows this view is displayed on
SdrPaintWindowVector maPaintWindows;
- MapMode aActualMapMode;
- Size aGridBig; // muss dann mal raus
- Size aGridFin; // muss dann mal raus
- SdrDragStat aDragStat;
- Rectangle aMaxWorkArea;
- SfxItemSet aDefaultAttr;
- Timer aComeBackTimer;
+ Size maGridBig; // muss dann mal raus
+ Size maGridFin; // muss dann mal raus
- SdrAnimationMode eAnimationMode;
+ SdrDragStat maDragStat;
+ basegfx::B2DRange maMaxWorkArea;
+ SfxItemSet maDefaultAttr;
- sal_uInt16 nHitTolPix;
- sal_uInt16 nMinMovPix;
- sal_uInt16 nHitTolLog;
- sal_uInt16 nMinMovLog;
- sal_uIntPtr nMasterCacheMode;
- sal_uIntPtr nGraphicManagerDrawMode;
+ SdrAnimationMode meAnimationMode;
+
+ double mfHitTolPix;
+ double mfMinMovPix;
// hold an incarnation of Drawinglayer configuration options
SvtOptionsDrawinglayer maDrawinglayerOpt;
- unsigned bPageVisible : 1;
- unsigned bPageBorderVisible : 1;
- unsigned bBordVisible : 1;
- unsigned bGridVisible : 1;
- unsigned bGridFront : 1;
- unsigned bHlplVisible : 1;
- unsigned bHlplFront : 1;
- unsigned bGlueVisible : 1; // Persistent. Klebepunkte anzeigen
- unsigned bGlueVisible2 : 1; // Klebepunkte auch bei GluePointEdit anzeigen
- unsigned bGlueVisible3 : 1; // Klebepunkte auch bei EdgeTool anzeigen
- unsigned bGlueVisible4 : 1; // Klebepunkte anzeigen, wenn 1 Edge markiert
- unsigned bRestoreColors : 1; // Pens und Brushes werden zurueckgesetzt.
- unsigned bSomeObjChgdFlag : 1;
- unsigned bSwapAsynchron : 1;
- unsigned bPrintPreview : 1;
-
- // sal_Bool fuer die Verwaltung des anzuzeigenden Status
- // Gruppe Betreten/Verlassen. Default ist sal_True, wird aber
- // beispielsweise beim Chart auf sal_False gesetzt, da dort
+ bool mbPageVisible : 1;
+ bool mbPageBorderVisible : 1;
+ bool mbBordVisible : 1;
+ bool mbGridVisible : 1;
+ bool mbGridFront : 1;
+ bool mbHlplVisible : 1;
+ bool mbHlplFront : 1;
+ bool mbGlueVisible : 1; // Persistent. Klebepunkte anzeigen
+ bool mbGlueVisible2 : 1; // Klebepunkte auch bei GluePointEdit anzeigen
+ bool mbGlueVisible3 : 1; // Klebepunkte auch bei EdgeTool anzeigen
+ bool mbGlueVisible4 : 1; // Klebepunkte anzeigen, wenn 1 Edge markiert
+ bool mbSwapAsynchron : 1;
+ bool mbPrintPreview : 1;
+
+ // bool fuer die Verwaltung des anzuzeigenden Status
+ // Gruppe Betreten/Verlassen. Default ist true, wird aber
+ // beispielsweise beim Chart auf false gesetzt, da dort
// die Ghosted-Effekte zur Darstellug unerwuenscht sind.
- unsigned bVisualizeEnteredGroup : 1;
- unsigned bAnimationPause : 1;
+ bool mbVisualizeEnteredGroup : 1;
+ bool mbAnimationPause : 1;
// #114898#
// Flag which decides if buffered output for this view is allowed. When
- // set, PreRendering for PageView rendering will be used. Default is sal_False
- unsigned mbBufferedOutputAllowed : 1;
+ // set, PreRendering for PageView rendering will be used. Default is false
+ bool mbBufferedOutputAllowed : 1;
// #114898#
// Flag which decides if buffered overlay for this view is allowed. When
// set, the output will be buffered in an overlay vdev. When not, overlay is
- // directly painted to OutDev. Default is sal_False.
- unsigned mbBufferedOverlayAllowed : 1;
+ // directly painted to OutDev. Default is false.
+ bool mbBufferedOverlayAllowed : 1;
// allow page painting at all?
- unsigned mbPagePaintingAllowed : 1;
+ bool mbPagePaintingAllowed : 1;
// is this a preview renderer?
- unsigned mbPreviewRenderer : 1;
+ bool mbPreviewRenderer : 1;
// flags for calc and sw for suppressing OLE, CHART or DRAW objects
- unsigned mbHideOle : 1;
- unsigned mbHideChart : 1;
- unsigned mbHideDraw : 1; // hide draw objects other than form controls
- unsigned mbHideFormControl : 1; // hide form controls only
-
-public:
- // #114898#
- // interface for PagePaintingAllowed flag
- bool IsBufferedOutputAllowed() const;
- void SetBufferedOutputAllowed(bool bNew);
+ bool mbHideOle : 1;
+ bool mbHideChart : 1;
+ bool mbHideDraw : 1; // hide draw objects other than form controls
+ bool mbHideFormControl : 1; // hide form controls only
- // interface for BufferedOverlayAllowed flag
- bool IsBufferedOverlayAllowed() const;
- void SetBufferedOverlayAllowed(bool bNew);
-
- // allow page painting at all?
- sal_Bool IsPagePaintingAllowed() const;
- void SetPagePaintingAllowed(bool bNew);
-
-protected:
svtools::ColorConfig maColorConfig;
Color maGridColor;
// interface to SdrPaintWindow
-protected:
void AppendPaintWindow(SdrPaintWindow& rNew);
SdrPaintWindow* RemovePaintWindow(SdrPaintWindow& rOld);
void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 );
-public:
- sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); }
- SdrPaintWindow* FindPaintWindow(const OutputDevice& rOut) const;
- SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const;
- // replacement for GetWin(0), may return 0L (!)
- OutputDevice* GetFirstOutputDevice() const;
-
-private:
- SVX_DLLPRIVATE void ImpClearVars();
- DECL_LINK(ImpComeBackHdl,Timer*);
-
-protected:
- sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice* pOut) const;
- sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice* pOut) const;
-
// Wenn man den IdleStatus des Systems nicht abwarten will (auf const geschummelt):
- void FlushComeBackTimer() const;
- void TheresNewMapMode();
- void ImpSetGlueVisible2(bool bOn) { if (bGlueVisible2!=(unsigned)bOn) { bGlueVisible2=bOn; if (!bGlueVisible && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } }
- void ImpSetGlueVisible3(bool bOn) { if (bGlueVisible3!=(unsigned)bOn) { bGlueVisible3=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible4) GlueInvalidate(); } }
- void ImpSetGlueVisible4(bool bOn) { if (bGlueVisible4!=(unsigned)bOn) { bGlueVisible4=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible3) GlueInvalidate(); } }
- sal_Bool ImpIsGlueVisible2() const { return bGlueVisible2; }
- sal_Bool ImpIsGlueVisible3() const { return bGlueVisible3; }
- sal_Bool ImpIsGlueVisible4() const { return bGlueVisible4; }
-
-public:
- sal_Bool ImpIsGlueVisible() { return bGlueVisible || bGlueVisible2 || bGlueVisible3 || bGlueVisible4; }
-protected:
+ void ForceLazyReactOnObjectChanges() const;
+ void ImpSetGlueVisible2(bool bOn) { if(mbGlueVisible2 != bOn) { mbGlueVisible2 = bOn; if (!IsGlueVisible() && !ImpIsGlueVisible3() && !ImpIsGlueVisible4()) GlueInvalidate(); } }
+ void ImpSetGlueVisible3(bool bOn) { if(mbGlueVisible3 != bOn) { mbGlueVisible3 = bOn; if (!IsGlueVisible() && !ImpIsGlueVisible2() && !ImpIsGlueVisible4()) GlueInvalidate(); } }
+ void ImpSetGlueVisible4(bool bOn) { if(mbGlueVisible4 != bOn) { mbGlueVisible4 = bOn; if (!IsGlueVisible() && !ImpIsGlueVisible2() && !ImpIsGlueVisible3()) GlueInvalidate(); } }
+ bool ImpIsGlueVisible2() const { return mbGlueVisible2; }
+ bool ImpIsGlueVisible3() const { return mbGlueVisible3; }
+ bool ImpIsGlueVisible4() const { return mbGlueVisible4; }
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- void GlueInvalidate() const;
void ShowEncirclement(OutputDevice* pOut);
void HideEncirclement(OutputDevice* pOut);
void DrawEncirclement(OutputDevice* pOut) const;
- // ModelHasChanged wird gerufen, sobald nach beliebig vielen HINT_OBJCHG
+ // LazyReactOnObjectChanges wird gerufen, sobald nach beliebig vielen HINT_OBJCHG_*
// das System wieder idle ist (StarView-Timer). Wer diese Methode ueberlaed,
- // muss unbedingt ModelHasChanged() der Basisklasse rufen.
- virtual void ModelHasChanged();
+ // muss unbedingt LazyReactOnObjectChanges() der Basisklasse rufen.
+ virtual void LazyReactOnObjectChanges();
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrPaintView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrPaintView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrPaintView();
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+ // used to paint the form layer after the PreRender device is flushed (painted) to the window.
+ void ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const;
+
+ SVX_DLLPRIVATE const OutputDevice* GetActualOutDev() const { return mpActualOutDev; }
+
public:
- TYPEINFO();
+ void GlueInvalidate() const;
- virtual void ClearPageView();
-// virtual void ClearAll();
-// virtual void Clear(); // PageViews loeschen, Markierungen weg, ...
- SdrModel* GetModel() const { return pMod; }
+ /// helper as long as the SdrView hierarchy is in different classes. Return
+ /// this as SdrView to have access to upper functionalities
+ SdrView* getAsSdrView() const { return (SdrView*)this; }
- virtual sal_Bool IsAction() const;
- virtual void MovAction(const Point& rPnt);
- virtual void EndAction();
- virtual void BckAction();
- virtual void BrkAction(); // Alle Actions z.B. Draggen abbrechen.
- virtual void TakeActionRect(Rectangle& rRect) const;
+ // interface for PagePaintingAllowed flag
+ bool IsBufferedOutputAllowed() const;
+ void SetBufferedOutputAllowed(bool bNew);
- // info about TextEdit. Default is sal_False.
- virtual bool IsTextEdit() const;
+ // interface for BufferedOverlayAllowed flag
+ bool IsBufferedOverlayAllowed() const;
+ void SetBufferedOverlayAllowed(bool bNew);
- // info about TextEditPageView. Default is 0L.
- virtual SdrPageView* GetTextEditPageView() const;
+ // allow page painting at all?
+ bool IsPagePaintingAllowed() const;
+ void SetPagePaintingAllowed(bool bNew);
+
+ sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); }
+ SdrPaintWindow* FindPaintWindow(const OutputDevice& rOut) const;
+ SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const;
+ // replacement for GetWin(0), may return 0L (!)
+ OutputDevice* GetFirstOutputDevice() const;
+
+ bool ImpIsGlueVisible() { return IsGlueVisible() || ImpIsGlueVisible2() || ImpIsGlueVisible3() || ImpIsGlueVisible4(); }
+
+ virtual void HideSdrPage();
+ SdrModel& getSdrModelFromSdrView() const { return mrModelFromSdrView; }
+
+ virtual bool IsTextEdit() const;
// Muss dann bei jedem Fensterwechsel (wenn die SdrView in mehreren
// Fenstern gleichzeitig dargestellt wird (->z.B. Splitter)) und bei
// jedem MapMode(Scaling)-wechsel gerufen werden, damit ich aus meinen
// Pixelwerten logische Werte berechnen kann.
- void SetActualWin(const OutputDevice* pWin);
- void SetMinMoveDistancePixel(sal_uInt16 nVal) { nMinMovPix=nVal; TheresNewMapMode(); }
- sal_uInt16 GetMinMoveDistancePixel() const { return (sal_uInt16)nMinMovPix; }
- void SetHitTolerancePixel(sal_uInt16 nVal) { nHitTolPix=nVal; TheresNewMapMode(); }
- sal_uInt16 GetHitTolerancePixel() const { return (sal_uInt16)nHitTolPix; }
+ void SetActualOutDev(const OutputDevice* pWin) { mpActualOutDev = pWin; }
+
+ void SetMinMoveDistancePixel(double fVal) { if(mfMinMovPix != fVal) mfMinMovPix = fVal; }
+ double GetMinMoveDistancePixel() const { return mfMinMovPix; }
- // data read access on logic HitTolerance and MinMoveTolerance
- sal_uInt16 getHitTolLog() const { return nHitTolLog; }
- sal_uInt16 getMinMovLog() const { return nMinMovLog; }
+ void SetHitTolerancePixel(double fVal) { if(mfHitTolPix != fVal) mfHitTolPix = fVal; }
+ double GetHitTolerancePixel() const { return mfHitTolPix; }
+
+ // access on logic HitTolerance and MinMoveTolerance, derived from mpActualOutDev
+ // and mfMinMovPix/mfHitTolPix
+ double getHitTolLog() const;
+ double getMinMovLog() const;
// Flag zur Visualisierung von Gruppen abfragen/testen
- sal_Bool DoVisualizeEnteredGroup() const { return bVisualizeEnteredGroup; }
- void SetVisualizeEnteredGroup(sal_Bool bNew) { bVisualizeEnteredGroup = bNew; }
+ bool DoVisualizeEnteredGroup() const { return mbVisualizeEnteredGroup; }
+ void SetVisualizeEnteredGroup(bool bNew) { if(mbVisualizeEnteredGroup != bNew) { mbVisualizeEnteredGroup = bNew; }}
// Am DragStatus laesst sich beispielsweise erfragen, welche
// entfernung bereits gedraggd wurde, etc.
- const SdrDragStat& GetDragStat() const { return aDragStat; }
+ SdrDragStat& GetDragStat() { return maDragStat; }
+ const SdrDragStat& GetDragStat() const { return maDragStat; }
// Anmelden/Abmelden einer PageView an der View.
// Dieselbe // Seite kann nicht mehrfach angemeldet werden.
@@ -342,40 +299,24 @@ public:
// eine Seitennummer (0...). Methoden mit dem Suffix PvNum erwarten
// degagen als numerischen Parameter die Nummer der PageView an der
// SdrView (Iterieren ueber alle angemeldeten Pages).
- virtual SdrPageView* ShowSdrPage(SdrPage* pPage);
- virtual void HideSdrPage();
-
- // Iterieren ueber alle angemeldeten PageViews
-// sal_uInt16 GetPageViewCount() const { return sal_uInt16(aPagV.Count()); }
-// SdrPageView* GetPageViewByIndex(sal_uInt16 nPvNum) const { return ((SdrPageView*)aPagV.GetObject(nPvNum)); }
+ virtual void ShowSdrPage(SdrPage& rPage);
SdrPageView* GetSdrPageView() const { return mpPageView; }
- // Pageview einer bestimmten Seite ermitteln
-// SdrPageView* GetPageViewByPage(const SdrPage* pPage) const;
-// sal_uInt16 GetIndexByPageView(const SdrPageView* pPV) const;
-
- // Test, ob eine Seite getroffen
-// SdrPageView* HitPage(const Point& rPnt) const;
-
- // Die Seite, die dem Punkt am naechsten ist. Liefert nur NULL,
- // wenn absolut keine Seite angemeldet ist.
-// SdrPageView* GetPageViewByPosition(const Point& rPnt) const;
-
// Eine SdrView kann auf mehreren Fenstern gleichzeitig abgebiltet sein:
virtual void AddWindowToPaintView(OutputDevice* pNewWin);
virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
- void SetLayerVisible(const String& rName, sal_Bool bShow=sal_True);
+ void SetLayerVisible(const String& rName, bool bShow=true);
bool IsLayerVisible(const String& rName) const;
- void SetAllLayersVisible(sal_Bool bShow=sal_True);
+ void SetAllLayersVisible(bool bShow=true);
- void SetLayerLocked(const String& rName, sal_Bool bLock=sal_True);
+ void SetLayerLocked(const String& rName, bool bLock=true);
bool IsLayerLocked(const String& rName) const;
- void SetAllLayersLocked(sal_Bool bLock=sal_True);
+ void SetAllLayersLocked(bool bLock=true);
- void SetLayerPrintable(const String& rName, sal_Bool bPrn=sal_True);
+ void SetLayerPrintable(const String& rName, bool bPrn=true);
bool IsLayerPrintable(const String& rName) const;
- void SetAllLayersPrintable(sal_Bool bPrn=sal_True);
+ void SetAllLayersPrintable(bool bPrn=true);
// PrePaint call forwarded from app windows
void PrePaint();
@@ -406,60 +347,56 @@ public:
SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false);
void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer);
-protected:
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- // used to paint the form layer after the PreRender device is flushed (painted) to the window.
- void ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const;
+ bool IsPageVisible() const { return mbPageVisible; } // Seite (weisse Flaeche) malen oder nicht
+ bool IsPageBorderVisible() const { return mbPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht
+ bool IsBordVisible() const { return mbBordVisible; } // Seitenrandlinie malen oder nicht
+ bool IsGridVisible() const { return mbGridVisible; } // Rastergitter malen oder nicht
+ bool IsGridFront() const { return mbGridFront; } // Rastergitter ueber die Objekte druebermalen oder dahinter
+ bool IsHlplVisible() const { return mbHlplVisible; } // Hilfslinien der Seiten malen oder nicht
+ bool IsHlplFront() const { return mbHlplFront; } // Hilfslinie ueber die Objekte druebermalen oder dahinter
+ bool IsGlueVisible() const { return mbGlueVisible; } // Konnektoren der objekte sichtbar oder nicht
-public:
- sal_Bool IsPageVisible() const { return bPageVisible; } // Seite (weisse Flaeche) malen oder nicht
- sal_Bool IsPageBorderVisible() const { return bPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht
- sal_Bool IsBordVisible() const { return bBordVisible; } // Seitenrandlinie malen oder nicht
- sal_Bool IsGridVisible() const { return bGridVisible; } // Rastergitter malen oder nicht
- sal_Bool IsGridFront() const { return bGridFront ; } // Rastergitter ueber die Objekte druebermalen oder dahinter
- sal_Bool IsHlplVisible() const { return bHlplVisible; } // Hilfslinien der Seiten malen oder nicht
- sal_Bool IsHlplFront() const { return bHlplFront ; } // Hilfslinie ueber die Objekte druebermalen oder dahinter
- sal_Bool IsGlueVisible() const { return bGlueVisible; } // Konnektoren der objekte sichtbar oder nicht
Color GetGridColor() const;
- void SetPageVisible(bool bOn = true) { bPageVisible=bOn; InvalidateAllWin(); }
- void SetPageBorderVisible(bool bOn = true) { bPageBorderVisible=bOn; InvalidateAllWin(); }
- void SetBordVisible(bool bOn = true) { bBordVisible=bOn; InvalidateAllWin(); }
- void SetGridVisible(bool bOn = true) { bGridVisible=bOn; InvalidateAllWin(); }
- void SetGridFront(bool bOn = true) { bGridFront =bOn; InvalidateAllWin(); }
- void SetHlplVisible(bool bOn = true) { bHlplVisible=bOn; InvalidateAllWin(); }
- void SetHlplFront(bool bOn = true) { bHlplFront =bOn; InvalidateAllWin(); }
- void SetGlueVisible(bool bOn = true) { if (bGlueVisible!=(unsigned)bOn) { bGlueVisible=bOn; if (!bGlueVisible2 && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } }
+
+ void SetPageVisible(bool bOn = true) { if(mbPageVisible != bOn) { mbPageVisible = bOn; InvalidateAllWin(); }}
+ void SetPageBorderVisible(bool bOn = true) { if(mbPageBorderVisible != bOn) { mbPageBorderVisible = bOn; InvalidateAllWin(); }}
+ void SetBordVisible(bool bOn = true) { if(mbBordVisible != bOn) { mbBordVisible = bOn; InvalidateAllWin(); }}
+ void SetGridVisible(bool bOn = true) { if(mbGridVisible != bOn) { mbGridVisible = bOn; InvalidateAllWin(); }}
+ void SetGridFront(bool bOn = true) { if(mbGridFront != bOn) { mbGridFront =bOn; InvalidateAllWin(); }}
+ void SetHlplVisible(bool bOn = true) { if(mbHlplVisible != bOn) { mbHlplVisible = bOn; InvalidateAllWin(); }}
+ void SetHlplFront(bool bOn = true) { if(mbHlplFront != bOn) { mbHlplFront = bOn; InvalidateAllWin(); }}
+ void SetGlueVisible(bool bOn = true) { if(mbGlueVisible != bOn) { mbGlueVisible = bOn; if (!ImpIsGlueVisible2() && !ImpIsGlueVisible3() && !ImpIsGlueVisible4()) GlueInvalidate(); } }
void SetGridColor( Color aColor );
- sal_Bool IsPreviewRenderer() const { return (sal_Bool )mbPreviewRenderer; }
- void SetPreviewRenderer(bool bOn) { if((unsigned)bOn != mbPreviewRenderer) { mbPreviewRenderer=bOn; }}
+ bool IsPreviewRenderer() const { return mbPreviewRenderer; }
+ void SetPreviewRenderer(bool bOn) { if(bOn != mbPreviewRenderer) mbPreviewRenderer = bOn; }
// access methods for calc and sw hide object modes
bool getHideOle() const { return mbHideOle; }
bool getHideChart() const { return mbHideChart; }
bool getHideDraw() const { return mbHideDraw; }
bool getHideFormControl() const { return mbHideFormControl; }
- void setHideOle(bool bNew) { if(bNew != (bool)mbHideOle) mbHideOle = bNew; }
- void setHideChart(bool bNew) { if(bNew != (bool)mbHideChart) mbHideChart = bNew; }
- void setHideDraw(bool bNew) { if(bNew != (bool)mbHideDraw) mbHideDraw = bNew; }
- void setHideFormControl(bool bNew) { if(bNew != (bool)mbHideFormControl) mbHideFormControl = bNew; }
+ void setHideOle(bool bNew) { if(bNew != mbHideOle) mbHideOle = bNew; }
+ void setHideChart(bool bNew) { if(bNew != mbHideChart) mbHideChart = bNew; }
+ void setHideDraw(bool bNew) { if(bNew != mbHideDraw) mbHideDraw = bNew; }
+ void setHideFormControl(bool bNew) { if(bNew != mbHideFormControl) mbHideFormControl = bNew; }
- void SetGridCoarse(const Size& rSiz) { aGridBig=rSiz; }
- void SetGridFine(const Size& rSiz) { aGridFin=rSiz; if (aGridFin.Height()==0) aGridFin.Height()=aGridFin.Width(); if (bGridVisible) InvalidateAllWin(); } // #40479#
- const Size& GetGridCoarse() const { return aGridBig; }
- const Size& GetGridFine() const { return aGridFin; }
+ void SetGridCoarse(const Size& rSiz) { maGridBig = rSiz; }
+ void SetGridFine(const Size& rSiz) { maGridFin = rSiz; if (!maGridFin.Height()) maGridFin.Height() = maGridFin.Width(); if (IsGridVisible()) InvalidateAllWin(); } // #40479#
+ const Size& GetGridCoarse() const { return maGridBig; }
+ const Size& GetGridFine() const { return maGridFin; }
- void InvalidateAllWin();
- void InvalidateAllWin(const Rectangle& rRect, sal_Bool bPlus1Pix=sal_False);
+ void InvalidateAllWin() const;
+ void InvalidateAllWin(const basegfx::B2DRange& rRange, bool bPlus1Pix = false) const;
// Wenn die View kein Invalidate() an den Fenstern durchfuehren soll, muss
// man diese beiden folgenden Methoden ueberladen und entsprechend anders
// reagieren.
- virtual void InvalidateOneWin(Window& rWin);
- virtual void InvalidateOneWin(Window& rWin, const Rectangle& rRect);
+ virtual void InvalidateOneWin(Window& rWin) const;
+ virtual void InvalidateOneWin(Window& rWin, const basegfx::B2DRange& rRange) const;
- void SetActiveLayer(const String& rName) { aAktLayer=rName; }
- const String& GetActiveLayer() const { return aAktLayer; }
+ void SetActiveLayer(const String& rName) { maAktLayer = rName; }
+ const String& GetActiveLayer() const { return maAktLayer; }
// Verlassen einer betretenen Objektgruppe aller sichtbaren Seiten.
// (wie MsDos chdir ..)
@@ -474,54 +411,39 @@ public:
// DefaultAttribute an der View: Neu erzeugte Objekte bekommen diese
// Attribute direkt nach dem Erzeugen erstmal zugewiesen.
- void SetDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
- const SfxItemSet& GetDefaultAttr() const { return aDefaultAttr; }
- void SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
- SfxStyleSheet* GetDefaultStyleSheet() const { return pDefaultStyleSheet; }
-
- void SetNotPersistDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
- void MergeNotPersistDefaultAttr(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
-
- // Aufziehen eines animierten Rechtecks fuer Applikationsspeziefische
- // Verwendung. Alle Positionsangaben in logischen View-Koordinaten.
- // pOut bezeichnet das OutputDevice, in das animierte Rechteck dargestellt
- // werden soll. Wird NULL uebergeben, wird es in allen an der View
- // angemeldeten OutputDevices gleichzeitig dargestellt.
- void BegEncirclement(const Point& rPnt);
- void MovEncirclement(const Point& rPnt);
- Rectangle EndEncirclement(sal_Bool bNoJustify = sal_False);
- void BrkEncirclement();
- sal_Bool IsEncirclement() const { return (0L != mpEncirclementOverlay); }
-
- // use this mode as mode to draw all internal GraphicManager objects with
- sal_uIntPtr GetGraphicManagerDrawMode() const { return nGraphicManagerDrawMode; }
- void SetGraphicManagerDrawMode( sal_uIntPtr nMode ) { nGraphicManagerDrawMode = nMode; }
+ void SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll);
+ const SfxItemSet& GetDefaultAttr() const { return maDefaultAttr; }
+ void SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
+ SfxStyleSheet* GetDefaultStyleSheet() const { return mpDefaultStyleSheet; }
+
+ void SetNotPersistDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll);
+ void MergeNotPersistDefaultAttr(SfxItemSet& rAttr, bool bOnlyHardAttr) const;
// SwapIn (z.B. von Grafiken) asynchron durchfuehren. Also nicht
// beim Paint sofort nachladen, sondern dort das Nachladen anstossen.
// Nach Abschluss des Nachladens wird das Objekt dann angezeigt.
// Hat nur z.Zt. Wirkung, wenn SwapGraphics am Model eingeschaltet ist.
- // Default=FALSE. Flag ist nicht persistent.
- sal_Bool IsSwapAsynchron() const { return bSwapAsynchron; }
- void SetSwapAsynchron(sal_Bool bJa=sal_True) { bSwapAsynchron=bJa; }
- virtual sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
-
- virtual sal_Bool MouseButtonDown(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
- virtual sal_Bool MouseButtonUp(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
- virtual sal_Bool MouseMove(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
- virtual sal_Bool Command(const CommandEvent& /*rCEvt*/, Window* /*pWin*/) { return sal_False; }
- sal_Bool Cut(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
- sal_Bool Yank(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
- sal_Bool Paste(Window* /*pWin*/=NULL, sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
+ // Default=false. Flag ist nicht persistent.
+ bool IsSwapAsynchron() const { return mbSwapAsynchron; }
+ void SetSwapAsynchron(bool bJa = true) { if(mbSwapAsynchron != bJa) { mbSwapAsynchron = bJa; }}
+ virtual bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+
+ virtual bool MouseButtonDown(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return false; }
+ virtual bool MouseButtonUp(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return false; }
+ virtual bool MouseMove(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return false; }
+ virtual bool Command(const CommandEvent& /*rCEvt*/, Window* /*pWin*/) { return false; }
+ bool Cut(sal_uInt32 /*nFormat*/=SDR_ANYFORMAT) { return false; }
+ bool Yank(sal_uInt32 /*nFormat*/=SDR_ANYFORMAT) { return false; }
+ bool Paste(Window* /*pWin*/=NULL, sal_uInt32 /*nFormat*/=SDR_ANYFORMAT) { return false; }
/* new interface src537 */
- sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+ bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr = false) const;
- sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
- SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
- sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
+ bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
+ SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const;
+ bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
- virtual void MakeVisible(const Rectangle& rRect, Window& rWin);
+ virtual void MakeVisibleAtView(const basegfx::B2DRange& rRange, Window& rWin);
// Fuer PlugIn. Wird vom Paint des OLE-Obj gerufen.
virtual void DoConnect(SdrOle2Obj* pOleObj);
@@ -529,11 +451,11 @@ public:
// Animation aktivieren/deaktivieren fuer ::Paint
// wird z.Zt. ausgewertet von SdrGrafObj, wenn in dem eine Animation steckt
// Das Unterbinden der automatischen Animation wird z.B. fuer die Dia-Show benoetigt
- sal_Bool IsAnimationEnabled() const { return ( SDR_ANIMATION_ANIMATE == eAnimationMode ); }
- void SetAnimationEnabled( sal_Bool bEnable=sal_True );
+ bool IsAnimationEnabled() const { return ( SDR_ANIMATION_ANIMATE == meAnimationMode ); }
+ void SetAnimationEnabled( bool bEnable=true );
// set/unset pause state for animations
- bool IsAnimationPause() const { return bAnimationPause; }
+ bool IsAnimationPause() const { return mbAnimationPause; }
void SetAnimationPause( bool bSet );
// Verhalten beim Starten von Animation im Paint-Handler:
@@ -541,22 +463,21 @@ public:
// 2. Nur die Ersatzdarstellung der Animation zeichnen ( SDR_ANIMATION_DONT_ANIMATE )
// 3. Nicht starten und nichts ersatzweise ausgeben ( SDR_ANIMATION_DISABLE )
void SetAnimationMode( const SdrAnimationMode eMode );
- SdrAnimationMode GetAnimationMode() const { return eAnimationMode; }
+ SdrAnimationMode GetAnimationMode() const { return meAnimationMode; }
- // bei bShow=sal_False wird der Browser destruiert
+ // bei bShow=false wird der Browser destruiert
#ifdef DBG_UTIL
- void ShowItemBrowser(sal_Bool bShow=sal_True);
- sal_Bool IsItemBrowserVisible() const { return pItemBrowser!=NULL && ((Window*)pItemBrowser)->IsVisible(); }
- Window* GetItemBrowser() const { return (Window*)pItemBrowser; }
+ void ShowItemBrowser(bool bShow = true);
+ Window* GetItemBrowser() const { return (Window*)mpItemBrowser; }
+ bool IsItemBrowserVisible() const { return GetItemBrowser() && GetItemBrowser()->IsVisible(); }
#endif
// Muss von App beim Scrollen usw. gerufen werden, damit ein u.U.
// aktives FormularControl mitverschoben werden kann
- void VisAreaChanged(const OutputDevice* pOut=NULL);
- void VisAreaChanged(const SdrPageWindow& rWindow);
+ void VisAreaChanged(const OutputDevice* pOut = 0);
- sal_Bool IsPrintPreview() const { return bPrintPreview; }
- void SetPrintPreview(bool bOn = true) { bPrintPreview=bOn; }
+ bool IsPrintPreview() const { return mbPrintPreview; }
+ void SetPrintPreview(bool bOn = true) { if(mbPrintPreview != bOn) { mbPrintPreview = bOn; }}
const svtools::ColorConfig& getColorConfig() const;
@@ -574,7 +495,31 @@ public:
// access to Drawinglayer configuration options
const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
+
+ // Begrenzung des Arbeitsbereichs. Die Begrenzung bezieht sich auf die
+ // View, nicht auf die einzelnen PageViews. Von der View wird diese
+ // Begrenzung nur bei Interaktionen wie Dragging und Create ausgewertet.
+ // Bei von der App algorithmisch oder UI-gesteuerte Aktionen (SetGeoAttr,
+ // MoveMarkedObj, ...) muss die App dieses Limit selbst beruecksichtigen.
+ // Ferner ist dieses Limit als Grob-Limit zu sehen. U.U. koennen Objekte
+ // (z.B. beim Drehen) nicht exakt bis an dieses Limit herangedraggt werden,
+ // koennen Objekte durch Rundungsfehler doch etwas ueberstehen, ... .
+ // Default=EmptyRect=keine Begrenzung.
+ // erst z.T. impl.
+ // (besser in die DragView?)
+ void SetWorkArea(const basegfx::B2DRange& rRange) { maMaxWorkArea = rRange; }
+ const basegfx::B2DRange& GetWorkArea() const { return maMaxWorkArea; }
+
+ // react on selection changes. Called on every selection change, triggered from
+ // sdr::selection::Selection::selectionChanged(), thus indirectly by calling
+ // one of the above non-const methods of the selection interface. Also called
+ // with timer delay when a selected SdrObject triggers HINT_OBJCHG_MOVE,
+ // HINT_OBJCHG_RESIZE, HINT_OBJCHG_ATTR, HINT_OBJINSERTED or HINT_OBJREMOVED
+ // which also represent a selection change.
+ virtual void handleSelectionChange();
};
#endif //_SVDPNTV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdpoev.hxx b/svx/inc/svx/svdpoev.hxx
index 2ffe53cc705b..9325aa842642 100644
--- a/svx/inc/svx/svdpoev.hxx
+++ b/svx/inc/svx/svdpoev.hxx
@@ -26,67 +26,48 @@
#include "svx/svxdllapi.h"
#include <svx/svdedtv.hxx>
-
#include "svx/ipolypolygoneditorcontroller.hxx"
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@ @@ @@ @@ @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@@ @@ @@ @@ @@@@ @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@ @@@@ @@@@@ @@ @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrPolyEditView: public SdrEditView, public IPolyPolygonEditorController
{
- friend class SdrEditView;
-
protected:
- sal_Bool bSetMarkedPointsSmoothPossible : 1;
- sal_Bool bSetMarkedSegmentsKindPossible : 1;
+ /// bitfield
+ bool mbSetMarkedPointsSmoothPossible : 1;
+ bool mbSetMarkedSegmentsKindPossible : 1;
- SdrPathSmoothKind eMarkedPointsSmooth;
- SdrPathSegmentKind eMarkedSegmentsKind;
+ SdrPathSmoothKind meMarkedPointsSmooth;
+ SdrPathSegmentKind meMarkedSegmentsKind;
-private:
- SVX_DLLPRIVATE void ImpClearVars();
- SVX_DLLPRIVATE void ImpResetPolyPossibilityFlags();
- SVX_DLLPRIVATE void ImpCheckPolyPossibilities();
+ virtual void ImpCheckPolyPossibilities();
- // Markierte Punkte kopieren und anstelle der alten markieren
- // ist noch nicht implementiert!
- SVX_DLLPRIVATE void ImpCopyMarkedPoints();
- typedef void (*PPolyTrFunc)(Point&, Point*, Point*, const void*, const void*, const void*, const void*, const void*);
- SVX_DLLPRIVATE void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
-
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrPolyEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrPolyEditView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrPolyEditView();
public:
- sal_Bool IsSetMarkedPointsSmoothPossible() const;
+ void CheckPolyPossibilitiesHelper(
+ const SdrPathObj& rMarkedObject,
+ const sdr::selection::Indices& rMarkedPoints,
+ bool& b1stSmooth, bool& b1stSegm, bool& bCurve, bool& bSmoothFuz,
+ bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth);
+
+ bool IsSetMarkedPointsSmoothPossible() const;
SdrPathSmoothKind GetMarkedPointsSmooth() const;
void SetMarkedPointsSmooth(SdrPathSmoothKind eKind);
// Ein PolySegment kann eine Strecke oder eine Bezierkurve sein.
- sal_Bool IsSetMarkedSegmentsKindPossible() const;
+ bool IsSetMarkedSegmentsKindPossible() const;
SdrPathSegmentKind GetMarkedSegmentsKind() const;
void SetMarkedSegmentsKind(SdrPathSegmentKind eKind);
// Moeglicherweise ist das Obj hinterher geloescht:
void DeleteMarkedPoints();
- sal_Bool IsDeleteMarkedPointsPossible() const;
+ bool IsDeleteMarkedPointsPossible() const;
- void MoveMarkedPoints(const Size& rSiz, bool bCopy=false);
- void ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
- void RotateMarkedPoints(const Point& rRef, long nWink, bool bCopy=false);
+ // central selected points manipulator
+ void TransformMarkedPoints(const basegfx::B2DHomMatrix& rTransformation, const SdrRepeatFunc aRepFunc, bool bCopy = false);
// Hierbei entstehen eventuell beliebig viele neue Objekte:
void RipUpAtMarkedPoints();
@@ -94,13 +75,12 @@ public:
// Alle markierten Polylines werden zu Polygonen, alle offenen
// Bezierkurven zu geschlossenen.
- void ShutMarkedObjects();
- void CloseMarkedObjects(sal_Bool bToggle=sal_False, sal_Bool bOpen=sal_False); // , long nOpenDistance=0);
+ void CloseMarkedObjects(bool bToggle = false, bool bOpen = false);
bool IsOpenCloseMarkedObjectsPossible() const;
SdrObjClosedKind GetMarkedObjectsClosedState() const;
-
- void CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmooth, bool& b1stSegm, bool& bCurve, bool& bSmoothFuz, bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth );
};
#endif //_SVDPOEV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdsnpv.hxx b/svx/inc/svx/svdsnpv.hxx
index 6c14c9dffa64..96fa3b8ad2c8 100644
--- a/svx/inc/svx/svdsnpv.hxx
+++ b/svx/inc/svx/svdsnpv.hxx
@@ -28,41 +28,31 @@
#include <svx/svdhlpln.hxx>
#include "svx/svxdllapi.h"
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class ImplPageOriginOverlay;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Defines
-//************************************************************
#define SDRSNAP_NOTSNAPPED 0x0000
#define SDRSNAP_XSNAPPED 0x0001
#define SDRSNAP_YSNAPPED 0x0002
-#define SDRSNAP_XYSNAPPED 0x0003
// SDRCROOK_STRETCH ist noch nicht implementiert!
-enum SdrCrookMode {
+enum SdrCrookMode
+{
SDRCROOK_ROTATE,
SDRCROOK_SLANT,
SDRCROOK_STRETCH
};
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@ @@@@@@ @@@@@@ @@@@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-// #114409#-1 Migrate PageOrigin
-class ImplPageOriginOverlay;
class SVX_DLLPUBLIC SdrSnapView: public SdrPaintView
{
+private:
protected:
// #114409#-1 Migrate PageOrigin
class ImplPageOriginOverlay* mpPageOriginOverlay;
@@ -70,141 +60,118 @@ protected:
// #114409#-2 Migrate HelpLine
class ImplHelpLineOverlay* mpHelpLineOverlay;
- Size aMagnSiz;
- Fraction aSnapWdtX;
- Fraction aSnapWdtY;
-
- sal_uInt16 nMagnSizPix;
- long nSnapAngle;
- long nEliminatePolyPointLimitAngle;
-
- SdrCrookMode eCrookMode;
-
- unsigned bSnapEnab : 1;
- unsigned bGridSnap : 1;
- unsigned bSnapTo1Pix : 1; // Wenn GridSnap aus, auf ein Pixel fangen um Werte wie 10.01 zu vermeiden
- unsigned bBordSnap : 1;
- unsigned bHlplSnap : 1;
- unsigned bOFrmSnap : 1;
- unsigned bOPntSnap : 1;
- unsigned bOConSnap : 1;
- unsigned bMoveMFrmSnap : 1;
- unsigned bMoveOFrmSnap : 1;
- unsigned bMoveOPntSnap : 1;
- unsigned bMoveOConSnap : 1;
- unsigned bMoveSnapOnlyTopLeft : 1; // Speacial fuer den Dialogeditor
- unsigned bOrtho : 1;
- unsigned bBigOrtho : 1;
- unsigned bAngleSnapEnab : 1;
- unsigned bMoveOnlyDragging : 1; // Objekte nur verschieben bei Resize/Rotate/...
- unsigned bSlantButShear : 1; // Slant anstelle von Shear anwenden
- unsigned bCrookNoContortion : 1; // Objekte bei Crook nicht verzerren
- unsigned bHlplFixed : 1; // sal_True=Hilfslinien fixiert, also nicht verschiebbar
- unsigned bEliminatePolyPoints : 1;
-
-private:
- SVX_DLLPRIVATE void ClearVars();
+ // logic grid snap values (grid snap)
+ double mfSnapWdtX;
+ double mfSnapWdtY;
+
+ // discrete magnetic snap (helplines, border, frame, point snaps). Logic
+ // magnetic snap is calculated on demand using GetFirstOutputDevice()
+ sal_uInt16 mnDiscreteMagneticSnap;
+
+ // angle snap
+ sal_Int32 mnSnapAngle;
+
+ // the angle for interactive point-in-line reduction
+ sal_Int32 mnEliminatePolyPointLimitAngle;
+
+ // crook mode selected at view; not used in the snap implementations
+ SdrCrookMode meCrookMode;
+
+ bool mbSnapEnabled : 1;
+ bool mbGridSnap : 1;
+ bool mbBorderSnap : 1;
+ bool mbHelplineSnap : 1;
+ bool mbOFrameSnap : 1;
+ bool mbOPointSnap : 1;
+ bool mbOConnectorSnap : 1;
+ bool mbMoveSnapOnlyTopLeft : 1; // dialog editor & report designer
+ bool mbOrthogonal : 1;
+ bool mbBigOrthogonal : 1;
+ bool mbAngleSnap : 1;
+ bool mbMoveOnlyDragging : 1; // Objekte nur verschieben bei Resize/Rotate/...
+ bool mbSlantButShear : 1; // Slant anstelle von Shear anwenden
+ bool mbCrookNoContortion : 1; // Objekte bei Crook nicht verzerren
+ bool mbHelplinesFixed : 1; // true=Hilfslinien fixiert, also nicht verschiebbar
+ bool mbEliminatePolyPoints : 1;
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrSnapView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrSnapView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrSnapView();
public:
- virtual sal_Bool IsAction() const;
- virtual void MovAction(const Point& rPnt);
+ virtual bool IsAction() const;
+ virtual void MovAction(const basegfx::B2DPoint& rPnt);
virtual void EndAction();
virtual void BckAction();
virtual void BrkAction(); // f.abg.Klassen Actions z,B, Draggen abbrechen.
- virtual void TakeActionRect(Rectangle& rRect) const;
-
- void SetSnapGridWidth(const Fraction& rX, const Fraction& rY) { aSnapWdtX=rX; aSnapWdtY=rY; }
- const Fraction& GetSnapGridWidthX() const { return aSnapWdtX; }
- const Fraction& GetSnapGridWidthY() const { return aSnapWdtY; }
+ virtual basegfx::B2DRange TakeActionRange() const;
- void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=aMagnSiz) { aMagnSiz=rSiz; } }
- const Size& GetSnapMagnetic() const { return aMagnSiz; }
- void SetSnapMagneticPixel(sal_uInt16 nPix) { nMagnSizPix=nPix; }
- sal_uInt16 GetSnapMagneticPixel() const { return nMagnSizPix; }
+ void SetSnapGridWidth(double fX, double fY) { mfSnapWdtX = fX; mfSnapWdtY = fY; }
+ double GetSnapGridWidthX() const { return mfSnapWdtX; }
+ double GetSnapGridWidthY() const { return mfSnapWdtY; }
- // RecalcLogicSnapMagnetic muss bei jedem Wechsel des OutputDevices
- // sowie bei jedem Wechsel des MapModes gerufen werden!
- void RecalcLogicSnapMagnetic(const OutputDevice& rOut) { SetSnapMagnetic(rOut.PixelToLogic(Size(nMagnSizPix,nMagnSizPix))); }
- void SetActualWin(const OutputDevice* pWin) { SdrPaintView::SetActualWin(pWin); if (pWin!=NULL) RecalcLogicSnapMagnetic(*pWin); }
+ void SetDiscreteMagneticSnap(sal_uInt16 nPix) { mnDiscreteMagneticSnap = nPix; }
+ sal_uInt16 GetDiscreteMagneticSnap() const { return mnDiscreteMagneticSnap; }
// Auf die View bezogene Koordinaten!
// Rueckgabewerte sind SDRSNAP_NOTSNAPPED,SDRSNAP_XSNAPPED,
// SDRSNAP_YSNAPPED oder SDRSNAP_XYSNAPPED
- sal_uInt16 SnapPos(Point& rPnt, const SdrPageView* pPV) const;
- Point GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const;
- sal_uInt16 SnapRect(const Rectangle& rRect, const SdrPageView* pPV, long& rDX, long& rDY) const;
- void CheckSnap(const Point& rPt, const SdrPageView* pPV, long& nBestXSnap, long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const;
+ basegfx::B2DPoint GetSnapPos(const basegfx::B2DPoint& rPnt, sal_uInt16* pSnapFlags = 0) const;
// Alle Fangeinstellungen sind Persistent.
- sal_Bool IsSnapEnabled() const { return bSnapEnab; }
- sal_Bool IsGridSnap() const { return bGridSnap; } // Fang auf Rastergitter
- sal_Bool IsBordSnap() const { return bBordSnap; } // Fang auf Seitenraender
- sal_Bool IsHlplSnap() const { return bHlplSnap; } // Fang auf Hilfslinien
- sal_Bool IsOFrmSnap() const { return bOFrmSnap; } // Fang auf LogFram von umgebenden Zeichenobjekten
- sal_Bool IsOPntSnap() const { return bOPntSnap; } // Fang auf ausgepraegte Punkte von umgebenden Zeichenobjekten
- sal_Bool IsOConSnap() const { return bOConSnap; } // Fang auf Konnektoren der Zeichenobjekte
- void SetSnapEnabled(sal_Bool bOn) { bSnapEnab=bOn; }
- void SetGridSnap(sal_Bool bOn) { bGridSnap=bOn; }
- void SetBordSnap(sal_Bool bOn) { bBordSnap=bOn; }
- void SetHlplSnap(sal_Bool bOn) { bHlplSnap=bOn; }
- void SetOFrmSnap(sal_Bool bOn) { bOFrmSnap=bOn; }
- void SetOPntSnap(sal_Bool bOn) { bOPntSnap=bOn; }
- void SetOConSnap(sal_Bool bOn) { bOConSnap=bOn; }
+ bool IsSnapEnabled() const { return mbSnapEnabled; }
+ bool IsGridSnap() const { return mbGridSnap; } // Fang auf Rastergitter
+ bool IsBorderSnap() const { return mbBorderSnap; } // Fang auf Seitenraender
+ bool IsHelplineSnap() const { return mbHelplineSnap; } // Fang auf Hilfslinien
+ bool IsOFrameSnap() const { return mbOFrameSnap; } // Fang auf LogFram von umgebenden Zeichenobjekten
+ bool IsOPointSnap() const { return mbOPointSnap; } // Fang auf ausgepraegte Punkte von umgebenden Zeichenobjekten
+ bool IsOConnectorSnap() const { return mbOConnectorSnap; } // Fang auf Konnektoren der Zeichenobjekte
+ void SetSnapEnabled(bool bOn) { if(mbSnapEnabled != bOn) mbSnapEnabled = bOn; }
+ void SetGridSnap(bool bOn) { if(mbGridSnap != bOn) mbGridSnap = bOn; }
+ void SetBorderSnap(bool bOn) { mbBorderSnap = bOn; }
+ void SetHelplineSnap(bool bOn) { if(mbHelplineSnap != bOn) mbHelplineSnap = bOn; }
+ void SetOFrameSnap(bool bOn) { if(mbOFrameSnap != bOn) mbOFrameSnap = bOn; }
+ void SetOPointSnap(bool bOn) { if(mbOPointSnap != bOn) mbOPointSnap = bOn; }
+ void SetOConnectorSnap(bool bOn) { if(mbOConnectorSnap != bOn) mbOConnectorSnap = bOn; }
// Normalerweise werden beim Move-Dragging von Zeichenobjekten alle
// 4 Ecken des Object-SnapRects gefangen. Folgende Einstellmoeglichkeit,
// wenn man nur auf die linke obere Ecke fangen will (z.B. DialogEditor):
- // Persistent, Default=FALSE.
- void SetMoveSnapOnlyTopLeft(sal_Bool bOn) { bMoveSnapOnlyTopLeft=bOn; }
- sal_Bool IsMoveSnapOnlyTopLeft() const { return bMoveSnapOnlyTopLeft; }
+ // Persistent, Default=false.
+ void SetMoveSnapOnlyTopLeft(bool bOn) { if(mbMoveSnapOnlyTopLeft != bOn) mbMoveSnapOnlyTopLeft = bOn; }
+ bool IsMoveSnapOnlyTopLeft() const { return mbMoveSnapOnlyTopLeft; }
// Hilfslinien fixiert (nicht verschiebbar)
- // Persistent, Default=FALSE.
- sal_Bool IsHlplFixed() const { return bHlplFixed; }
- void SetHlplFixed(sal_Bool bOn) { bHlplFixed=bOn; }
-
- sal_Bool IsMoveMFrmSnap() const { return bMoveMFrmSnap; } // Fang des LogFram aller markierten Objekte
- sal_Bool IsMoveOFrmSnap() const { return bMoveOFrmSnap; } // Fang aller LogFram der markierten Objekte
- sal_Bool IsMoveOPntSnap() const { return bMoveOPntSnap; } // Fang ausgepraegter Punkte der markierten Objekte
- sal_Bool IsMoveOConSnap() const { return bMoveOConSnap; } // Fang der Konnektoren der markierten Objekte
-
- void SetMoveMFrmSnap(sal_Bool bOn) { bMoveMFrmSnap=bOn; }
- void SetMoveOFrmSnap(sal_Bool bOn) { bMoveOFrmSnap=bOn; }
- void SetMoveOPntSnap(sal_Bool bOn) { bMoveOPntSnap=bOn; }
- void SetMoveOConSnap(sal_Bool bOn) { bMoveOConSnap=bOn; }
+ // Persistent, Default=false.
+ bool AreHelplinesFixed() const { return mbHelplinesFixed; }
+ void SetHelplinesFixed(bool bOn) { if(mbHelplinesFixed != bOn) mbHelplinesFixed = bOn; }
// #114409#-1 Migrate PageOrigin
- sal_Bool BegSetPageOrg(const Point& rPnt);
- void MovSetPageOrg(const Point& rPnt);
- sal_Bool EndSetPageOrg();
+ bool BegSetPageOrg(const basegfx::B2DPoint& rPnt);
+ void MovSetPageOrg(const basegfx::B2DPoint& rPnt);
+ bool EndSetPageOrg();
void BrkSetPageOrg();
- sal_Bool IsSetPageOrg() const { return (0L != mpPageOriginOverlay); }
+ bool IsSetPageOrg() const { return (0L != mpPageOriginOverlay); }
- // HitTest. Bei sal_True steht in rnHelpLineNum die Nummer der Hilfslinie und in rpPV
- // die zugehoerige PageView.
- sal_Bool PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const;
+ // HitTest. Bei true steht in rnHelpLineNum die Nummer der Hilfslinie
+ bool PickHelpLine(const basegfx::B2DPoint& rPnt, double fTol, sal_uInt32& rnHelpLineNum) const;
- // Verschieben einer vorhandenen Hilfslinie. nHelpLineNum und pPV von PickHelpLine verwenden.
- sal_Bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV);
+ // Verschieben einer vorhandenen Hilfslinie. nHelpLineNum von PickHelpLine verwenden.
+ bool BegDragHelpLine(sal_uInt16 nHelpLineNum);
// Interaktives einfuegen einer neuen Hilfslinie
- sal_Bool BegDragHelpLine(const Point& rPnt, SdrHelpLineKind eNewKind);
+ bool BegDragHelpLine(const basegfx::B2DPoint& rPnt, SdrHelpLineKind eNewKind);
Pointer GetDraggedHelpLinePointer() const;
// Aendern des Hilfslinientyps waerend des draggens
// void SetDraggedHelpLineKind(SdrHelpLineKind eNewKind);
- void MovDragHelpLine(const Point& rPnt);
- sal_Bool EndDragHelpLine();
+ void MovDragHelpLine(const basegfx::B2DPoint& rPnt);
+ bool EndDragHelpLine();
void BrkDragHelpLine();
- sal_Bool IsDragHelpLine() const { return (0L != mpHelpLineOverlay); }
+ bool IsDragHelpLine() const { return (0 != mpHelpLineOverlay); }
// SnapAngle ist fuer Winkel im Kreis, RotateDragging, ...
// Der Winkelfang wird unterdrueckt, wenn er mit
- // durch SetAngleSnapEnabled(sal_False) ausgeschaltet ist.
+ // durch SetAngleSnapEnabled(false) ausgeschaltet ist.
// Der Winkelfang ist unabhaengig vom Koordinatenfang
// und somit von der Einstellung IsSnapEnabled()
// Es sollten nur Werte angegeben werden fuer die gilt:
@@ -214,10 +181,10 @@ public:
// - Shear (Dragging)
// - Kreisbogen/-sektor/-abschnitt Winkel (Create und Dragging)
// Persistent.
- void SetAngleSnapEnabled(sal_Bool bOn) { bAngleSnapEnab=bOn; }
- sal_Bool IsAngleSnapEnabled() const { return bAngleSnapEnab; }
- void SetSnapAngle(long nWink) { nSnapAngle=nWink; }
- long GetSnapAngle() const { return nSnapAngle; }
+ void SetAngleSnapEnabled(bool bOn) { if(mbAngleSnap != bOn) mbAngleSnap = bOn; }
+ bool IsAngleSnapEnabled() const { return mbAngleSnap; }
+ void SetSnapAngle(sal_Int32 nWink) { if(mnSnapAngle != nWink) mnSnapAngle = nWink; }
+ sal_Int32 GetSnapAngle() const { return mnSnapAngle; }
// Ortho hat je nach Kontext verschiedene Effekte:
// - Create
@@ -239,8 +206,8 @@ public:
// - Linie behaelt beim Draggen ihren Winkel bei und wird nur (ni)
// verlaengert bzw. verkuerzt.
// Defaultmaessig ist Ortho ausgeschaltet. Persistent.
- void SetOrtho(sal_Bool bOn) { bOrtho=bOn; } // unvollstaendig
- sal_Bool IsOrtho() const { return bOrtho; }
+ void SetOrthogonal(bool bOn) { if(mbOrthogonal != bOn) mbOrthogonal = bOn; } // unvollstaendig
+ bool IsOrthogonal() const { return mbOrthogonal; }
// BigOrtho hat nur Relevanz wenn Ortho eingeschaltet ist.
// Beispiel: Ein Rechteck wird mit eingeschaltetem Ortho (also ein Quadrat)
@@ -252,35 +219,35 @@ public:
// tetem BigOrtho bekaeme man dagegen ein Quadrat der Kantenlaenge 80.
// Gleiches gilt auch fuer Resize.
// Defaultmaessig ist BigOrtho eingeschaltet. Persistent.
- void SetBigOrtho(sal_Bool bOn) { bBigOrtho=bOn; }
- sal_Bool IsBigOrtho() const { return bBigOrtho; }
+ void SetBigOrthogonal(bool bOn) { if(mbBigOrthogonal != bOn) mbBigOrthogonal = bOn; }
+ bool IsBigOrthogonal() const { return mbBigOrthogonal; }
- // bei MoveOnlyDragging=sal_True wird bei Resize/Rotate/Shear/Mirror/Crook
+ // bei MoveOnlyDragging=true wird bei Resize/Rotate/Shear/Mirror/Crook
// nur das Zentrum der markierten Objekte transformiert. Groesse, Form
// und Drehwinkel der Objekte bleiben erhalten, nur ihre Positionen
- // aendern sich. Persistent. Default=FALSE. (ni)
- void SetMoveOnlyDragging(sal_Bool bOn) { bMoveOnlyDragging=bOn; }
- sal_Bool IsMoveOnlyDragging() const { return bMoveOnlyDragging; }
+ // aendern sich. Persistent. Default=false. (ni)
+ void SetMoveOnlyDragging(bool bOn) { if(mbMoveOnlyDragging != bOn) mbMoveOnlyDragging = bOn; }
+ bool IsMoveOnlyDragging() const { return mbMoveOnlyDragging; }
- // Slant anstelle von Shear anwenden. Persistent. Default=FALSE.
- void SetSlantButShear(sal_Bool bOn) { bSlantButShear=bOn; }
- sal_Bool IsSlantButShear() const { return bSlantButShear; }
+ // Slant anstelle von Shear anwenden. Persistent. Default=false.
+ void SetSlantButShear(bool bOn) { if(mbSlantButShear != bOn) mbSlantButShear = bOn; }
+ bool IsSlantButShear() const { return mbSlantButShear; }
- // Objekte bei Crook nicht verzerren. Persistent. Default=FALSE. (ni)
- void SetCrookNoContortion(sal_Bool bOn) { bCrookNoContortion=bOn; }
- sal_Bool IsCrookNoContortion() const { return bCrookNoContortion; }
+ // Objekte bei Crook nicht verzerren. Persistent. Default=false. (ni)
+ void SetCrookNoContortion(bool bOn) { if(mbCrookNoContortion != bOn) mbCrookNoContortion = bOn; }
+ bool IsCrookNoContortion() const { return mbCrookNoContortion; }
// Crook-Modus. Persistent. Default=SDRCROOK_ROTATE. (ni)
- void SetCrookMode(SdrCrookMode eMode) { eCrookMode=eMode; }
- SdrCrookMode GetCrookMode() const { return eCrookMode; }
+ void SetCrookMode(SdrCrookMode eMode) { if(meCrookMode != eMode) meCrookMode = eMode; }
+ SdrCrookMode GetCrookMode() const { return meCrookMode; }
// Special fuer IBM: Beim Draggen eines Polygonpunkts wird dieser
// geloescht, wenn seine beiden angrenzenden Linien eh' fast eine
// durchgehende Linie sind.
- void SetEliminatePolyPoints(sal_Bool bOn) { bEliminatePolyPoints=bOn; }
- sal_Bool IsEliminatePolyPoints() const { return bEliminatePolyPoints; }
- void SetEliminatePolyPointLimitAngle(long nAngle) { nEliminatePolyPointLimitAngle=nAngle; }
- long GetEliminatePolyPointLimitAngle() const { return nEliminatePolyPointLimitAngle; }
+ void SetEliminatePolyPoints(bool bOn) { if(mbEliminatePolyPoints != bOn) mbEliminatePolyPoints = bOn; }
+ bool IsEliminatePolyPoints() const { return mbEliminatePolyPoints; }
+ void SetEliminatePolyPointLimitAngle(sal_Int32 nAngle) { mnEliminatePolyPointLimitAngle=nAngle; }
+ sal_Int32 GetEliminatePolyPointLimitAngle() const { return mnEliminatePolyPointLimitAngle; }
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -332,3 +299,5 @@ public:
#endif //_SVDSNPV_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdsob.hxx b/svx/inc/svx/svdsob.hxx
index 5dde95bbf119..7c854c55c7a6 100644
--- a/svx/inc/svx/svdsob.hxx
+++ b/svx/inc/svx/svdsob.hxx
@@ -26,12 +26,9 @@
#include <com/sun/star/uno/Any.hxx>
#include <tools/stream.hxx>
-
-#ifndef _STRING_H
#include <tools/string.hxx> //wg. memset
-#define _STRING_H
-#endif
#include "svx/svxdllapi.h"
+#include <string.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
/*
@@ -45,17 +42,17 @@ protected:
sal_uInt8 aData[32];
public:
- SetOfByte(sal_Bool bInitVal = sal_False)
+ SetOfByte(bool bInitVal = false)
{
memset(aData, bInitVal ? 0xFF : 0x00, sizeof(aData));
}
- sal_Bool operator==(const SetOfByte& rCmpSet) const
+ bool operator==(const SetOfByte& rCmpSet) const
{
return (memcmp(aData, rCmpSet.aData, sizeof(aData)) == 0);
}
- sal_Bool operator!=(const SetOfByte& rCmpSet) const
+ bool operator!=(const SetOfByte& rCmpSet) const
{
return (memcmp(aData, rCmpSet.aData, sizeof(aData))!=0);
}
@@ -70,15 +67,19 @@ public:
aData[a/8] &= ~(1<<a%8);
}
- void Set(sal_uInt8 a, sal_Bool b)
+ void Set(sal_uInt8 a, bool b)
{
if(b)
+ {
Set(a);
+ }
else
+ {
Clear(a);
}
+ }
- sal_Bool IsSet(sal_uInt8 a) const
+ bool IsSet(sal_uInt8 a) const
{
return (aData[a/8] & 1<<a%8) != 0;
}
@@ -93,8 +94,8 @@ public:
memset(aData, 0x00, sizeof(aData));
}
- sal_Bool IsEmpty() const;
- sal_Bool IsFull() const;
+ bool IsEmpty() const;
+ bool IsFull() const;
sal_uInt16 GetSetCount() const;
sal_uInt8 GetSetBit(sal_uInt16 nNum) const;
@@ -125,5 +126,9 @@ inline SvStream& operator>>(SvStream& rIn, SetOfByte& rSet)
return rIn;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#endif // _SVDSOB_HXX
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdstr.hrc b/svx/inc/svx/svdstr.hrc
index 1c9a34901a33..dd48f21fc0c5 100644
--- a/svx/inc/svx/svdstr.hrc
+++ b/svx/inc/svx/svdstr.hrc
@@ -85,17 +85,10 @@
#define STR_ObjNameSingulPATHFILL (STR_ObjNameBegin + 53)
#define STR_ObjNamePluralPATHFILL (STR_ObjNameBegin + 54)
#define STR_ObjNameSingulFREELINE (STR_ObjNameBegin + 55)
-#define STR_ObjNamePluralFREELINE (STR_ObjNameBegin + 56)
-#define STR_ObjNameSingulFREEFILL (STR_ObjNameBegin + 57)
-#define STR_ObjNamePluralFREEFILL (STR_ObjNameBegin + 58)
#define STR_ObjNameSingulCOMBLINE (STR_ObjNameBegin + 59)
#define STR_ObjNamePluralCOMBLINE (STR_ObjNameBegin + 60)
#define STR_ObjNameSingulCOMBFILL (STR_ObjNameBegin + 61)
#define STR_ObjNamePluralCOMBFILL (STR_ObjNameBegin + 62)
-#define STR_ObjNameSingulNATSPLN (STR_ObjNameBegin + 63)
-#define STR_ObjNamePluralNATSPLN (STR_ObjNameBegin + 64)
-#define STR_ObjNameSingulPERSPLN (STR_ObjNameBegin + 65)
-#define STR_ObjNamePluralPERSPLN (STR_ObjNameBegin + 66)
#define STR_ObjNameSingulTEXT (STR_ObjNameBegin + 67)
#define STR_ObjNamePluralTEXT (STR_ObjNameBegin + 68)
#define STR_ObjNameSingulTEXTLNK (STR_ObjNameBegin + 69)
@@ -325,7 +318,7 @@
#define STR_UndoNewLayer (STR_UndoBegin +13)
#define STR_UndoDelLayer (STR_UndoBegin +14)
-#define STR_UndoMovLayer (STR_UndoBegin +15)
+//#define STR_UndoMovLayer (STR_UndoBegin +15)
// --> OD 2009-07-09 #i73249#
#define STR_UndoObjName (STR_UndoBegin +16)
diff --git a/svx/inc/svx/svdtext.hxx b/svx/inc/svx/svdtext.hxx
index fc3a8039dce4..7bf3c0aa8315 100644
--- a/svx/inc/svx/svdtext.hxx
+++ b/svx/inc/svx/svdtext.hxx
@@ -49,9 +49,7 @@ public:
SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject = 0 );
virtual ~SdrText();
- virtual void SetModel(SdrModel* pNewModel);
virtual void ForceOutlinerParaObject( sal_uInt16 nOutlMode );
-
virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject );
virtual OutlinerParaObject* GetOutlinerParaObject() const;
@@ -61,13 +59,14 @@ public:
// default uses GetObjectItemSet, but may be overloaded to
// return a text-specific ItemSet
virtual const SfxItemSet& GetItemSet() const;
-
- SdrModel* GetModel() const { return mpModel; }
- SdrTextObj& GetObject() const { return mrObject; }
+ SdrTextObj& getSdrTextObj() const { return mrObject; }
/** returns the current OutlinerParaObject and removes it from this instance */
OutlinerParaObject* RemoveOutlinerParaObject();
+ // support model change, e.g. when text object is cloned to a new SdrModel
+ void ImpModelChange(SdrModel& rSourceModel, SdrModel& rTargetModel);
+
protected:
virtual const SfxItemSet& GetObjectItemSet();
virtual void SetObjectItem(const SfxPoolItem& rItem);
@@ -76,8 +75,9 @@ protected:
private:
OutlinerParaObject* mpOutlinerParaObject;
SdrTextObj& mrObject;
- SdrModel* mpModel;
- bool mbPortionInfoChecked;
+
+ /// bitfield
+ bool mbPortionInfoChecked : 1;
};
#endif //_SVDTEXT_HXX
diff --git a/svx/inc/svx/svdtrans.hxx b/svx/inc/svx/svdtrans.hxx
index 5b7ab13c43b8..1239011b2202 100644
--- a/svx/inc/svx/svdtrans.hxx
+++ b/svx/inc/svx/svdtrans.hxx
@@ -49,86 +49,37 @@
const double nPi=3.14159265358979323846;
const double nPi180=0.000174532925199432957692222; // Bei zuweing Stellen ist tan(4500*nPi180)!=1.0
-// Der maximale Shearwinkel
-#define SDRMAXSHEAR 8900
-
-class XPolygon;
-class XPolyPolygon;
-
inline long Round(double a) { return a>0.0 ? (long)(a+0.5) : -(long)((-a)+0.5); }
-inline void MoveRect(Rectangle& rRect, const Size& S) { rRect.Move(S.Width(),S.Height()); }
-inline void MovePoint(Point& rPnt, const Size& S) { rPnt.X()+=S.Width(); rPnt.Y()+=S.Height(); }
-inline void MovePoly(Polygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); }
-inline void MovePoly(PolyPolygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); }
-void MoveXPoly(XPolygon& rPoly, const Size& S);
-void MoveXPoly(XPolyPolygon& rPoly, const Size& S);
-
-SVX_DLLPUBLIC void ResizeRect(Rectangle& rRect, const Point& rRef, const Fraction& xFact, const Fraction& yFact, FASTBOOL bNoJustify=sal_False);
-inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact);
-void ResizePoly(Polygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
-void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
-void ResizePoly(PolyPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
-void ResizeXPoly(XPolyPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
-
-inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs);
+inline void RotatePoint(basegfx::B2DPoint& rPnt, const basegfx::B2DPoint& rRef, double sn, double cs);
SVX_DLLPUBLIC void RotatePoly(Polygon& rPoly, const Point& rRef, double sn, double cs);
-void RotateXPoly(XPolygon& rPoly, const Point& rRef, double sn, double cs);
void RotatePoly(PolyPolygon& rPoly, const Point& rRef, double sn, double cs);
-void RotateXPoly(XPolyPolygon& rPoly, const Point& rRef, double sn, double cs);
-
-// MirrorRect macht nur Sinn bei Spiegelachsen
-// mit einem durch 45 Degree teilbaren Winkel!
-void MirrorRect(Rectangle& rRect, const Point& rRef1, const Point& rRef2, FASTBOOL bNoJustify); // ni.
void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2);
-void MirrorPoly(Polygon& rPoly, const Point& rRef1, const Point& rRef2);
-void MirrorXPoly(XPolygon& rPoly, const Point& rRef1, const Point& rRef2);
-void MirrorPoly(PolyPolygon& rPoly, const Point& rRef1, const Point& rRef2);
-void MirrorXPoly(XPolyPolygon& rPoly, const Point& rRef1, const Point& rRef2);
-
-inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, FASTBOOL bVShear=sal_False);
-SVX_DLLPUBLIC void ShearPoly(Polygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear=sal_False);
-void ShearXPoly(XPolygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear=sal_False);
-void ShearPoly(PolyPolygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear=sal_False);
-void ShearXPoly(XPolyPolygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear=sal_False);
-
-// rPnt.X bzw rPnt.Y wird auf rCenter.X bzw. rCenter.Y gesetzt!
-// anschliessend muss rPnt nur noch um rCenter gedreht werden.
-// Der Rueckgabewinkel ist ausnahmsweise in Rad.
-inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad, FASTBOOL bVertical);
+inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, bool bVShear = false);
+SVX_DLLPUBLIC void ShearPoly(Polygon& rPoly, const Point& rRef, double tn, bool bVShear = false);
+void ShearPoly(PolyPolygon& rPoly, const Point& rRef, double tn, bool bVShear = false);
+
// Die folgenden Methoden behandeln einen Punkt eines XPolygons, wobei die
// benachbarten Kontrollpunkte des eigentlichen Punktes ggf. in pC1/pC2
// uebergeben werden. Ueber rSin/rCos wird gleichzeitig sin(nWink) und cos(nWink)
// zurueckgegeben.
// Der Rueckgabewinkel ist hier ebenfalls in Rad.
-double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter,
- const Point& rRad, double& rSin, double& rCos, FASTBOOL bVert);
-double CrookSlantXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter,
- const Point& rRad, double& rSin, double& rCos, FASTBOOL bVert);
-double CrookStretchXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter,
- const Point& rRad, double& rSin, double& rCos, FASTBOOL bVert,
- const Rectangle rRefRect);
-
-void CrookRotatePoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert);
-void CrookSlantPoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert);
-void CrookStretchPoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert, const Rectangle rRefRect);
-
-void CrookRotatePoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert);
-void CrookSlantPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert);
-void CrookStretchPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert, const Rectangle rRefRect);
+double CrookRotateXPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, double& rSin, double& rCos, bool bVert);
+double CrookSlantXPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, double& rSin, double& rCos, bool bVert);
+double CrookStretchXPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, double& rSin, double& rCos, bool bVert, const basegfx::B2DRange& rRefRect);
+
+void CrookRotatePoly(basegfx::B2DPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert);
+void CrookSlantPoly(basegfx::B2DPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert);
+void CrookStretchPoly(basegfx::B2DPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert, const basegfx::B2DRange& rRefRange);
+
+void CrookRotatePoly(basegfx::B2DPolyPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert);
+void CrookSlantPoly(basegfx::B2DPolyPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert);
+void CrookStretchPoly(basegfx::B2DPolyPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert, const basegfx::B2DRange& rRefRange);
/**************************************************************************************************/
/* Inline */
/**************************************************************************************************/
-inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact)
-{
- if (xFact.GetDenominator()==0) xFact=Fraction(xFact.GetNumerator(),1); // DivZero abfangen
- if (yFact.GetDenominator()==0) yFact=Fraction(yFact.GetNumerator(),1); // DivZero abfangen
- rPnt.X()=rRef.X()+ Round(((double)(rPnt.X()-rRef.X())*xFact.GetNumerator())/xFact.GetDenominator());
- rPnt.Y()=rRef.Y()+ Round(((double)(rPnt.Y()-rRef.Y())*yFact.GetNumerator())/yFact.GetDenominator());
-}
-
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs)
{
long dx=rPnt.X()-rRef.X();
@@ -137,7 +88,14 @@ inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs)
rPnt.Y()=Round(rRef.Y()+dy*cs-dx*sn);
}
-inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, FASTBOOL bVShear)
+inline void RotateB2DPointAroundRef(basegfx::B2DPoint& rPnt, const basegfx::B2DPoint& rRef, double sn, double cs)
+{
+ const basegfx::B2DTuple aDelta(rPnt - rRef);
+ rPnt.setX(rRef.getX() + aDelta.getX() * cs + aDelta.getY() * sn);
+ rPnt.setY(rRef.getY() + aDelta.getY() * cs - aDelta.getX() * sn);
+}
+
+inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, bool bVShear)
{
if (!bVShear) { // Horizontal
if (rPnt.Y()!=rRef.Y()) { // sonst nicht noetig
@@ -150,19 +108,26 @@ inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, FASTBOOL bVShe
}
}
-inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad, FASTBOOL bVertical)
+inline double GetCrookAngle(basegfx::B2DPoint& rPnt, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVertical)
{
- double nWink;
- if (bVertical) {
- long dy=rPnt.Y()-rCenter.Y();
- nWink=(double)dy/(double)rRad.Y();
- rPnt.Y()=rCenter.Y();
- } else {
- long dx=rCenter.X()-rPnt.X();
- nWink=(double)dx/(double)rRad.X();
- rPnt.X()=rCenter.X();
+ double fAngle(0.0);
+
+ if(bVertical)
+ {
+ const double dy(rPnt.getY() - rCenter.getY());
+
+ fAngle = dy/rRad.getY();
+ rPnt.setY(rCenter.getY());
+ }
+ else
+ {
+ const double dx(rCenter.getX() - rPnt.getX());
+
+ fAngle = dx / rRad.getX();
+ rPnt.setX(rCenter.getX());
}
- return nWink;
+
+ return fAngle;
}
/**************************************************************************************************/
@@ -181,61 +146,6 @@ sal_uInt16 GetAngleSector(long nWink); // Sektor im kartesischen Koordinatensyst
// Zur Vermeidung von Ueberlaeufen werden ggf. einige Stellen ignoriert.
long GetLen(const Point& rPnt);
-/*
- Transformation eines Rechtecks in ein Polygon unter ------------
- Anwendung der Winkelparameter aus GeoStat. /1 2/
- Referenzpunkt ist stets der Punkt 0, also die linke / /
- obere Ecke des Ausgangsrects. / /
- Bei der Berechnung des Polygons ist die Reihenfolge / /
- (erst Shear, dann Rotation vorgegeben). / / \
- / / |
- A) Ausgangsrechteck aRect B) Nach Anwendung von Shear /0 3/ Rot|
- +------------------+ -------------------- ------------ ------
- |0 1| \0 1\ C) Nach Anwendung
- | | \ \ von Rotate
- | | | \ \
- |3 2| | \3 2\
- +------------------+ | --------------------
- |Shr |
- Bei Rueckkonvertierung des Polygons in ein Rect ist die Reihenfolge
- zwangslaeufig umgekehrt:
- - Berechnung des Drehwinkels: Winkel der Strecke 0-1 aus Abb. C) zum Horizont
- - Rueckdrehung des geshearten Rects (man erhaelt Abb B))
- - Bestimmung der Breite des Rects=Laenge der Strecke 0-1 aus Abb. B)
- - Bestimmung der Hoehe des Rects=vertikaler Abstand zwischen den Punkten
- 0 und 3 aus Abb. B)
- - Bestimmung des Shear-Winkels aus der Strecke 0-3 zur Senkrechten.
- Es ist darauf zu achten, dass das Polygon bei einer zwischenzeitlichen
- Transformation evtl. gespiegelt wurde (Mirror oder Resize mit neg. Faktor).
- In diesem Fall muss zunaecht eine Normalisierung durch Vertauschung der
- Punkte (z.B. 0 mit 3 und 1 mit 2) durchgefuehrt werden, damit der
- Richtungssinn im Polygon wieder stimmig ist.
- Hinweis: Positiver Shear-Winkel bedeutet Shear mit auf dem Bildschirm
- sichtbarer positiver Kursivierung. Mathematisch waere dass eine negative
- Kursivierung, da die Y-Achse auf dem Bildschirm von oben nach unten verlaeuft.
- Drehwinkel: Positiv bedeutet auf dem Bildschirm sichtbare Linksdrehung.
-*/
-
-class GeoStat { // Geometrischer Status fuer ein Rect
-public:
- long nDrehWink;
- long nShearWink;
- double nTan; // tan(nShearWink)
- double nSin; // sin(nDrehWink)
- double nCos; // cos(nDrehWink)
- bool bMirrored; // Horizontal gespiegelt? (ni)
-public:
- GeoStat(): nDrehWink(0),nShearWink(0),nTan(0.0),nSin(0.0),nCos(1.0),bMirrored(false) {}
- void RecalcSinCos();
- void RecalcTan();
-};
-
-Polygon Rect2Poly(const Rectangle& rRect, const GeoStat& rGeo);
-void Poly2Rect(const Polygon& rPol, Rectangle& rRect, GeoStat& rGeo);
-
-SVX_DLLPUBLIC void OrthoDistance8(const Point& rPt0, Point& rPt, FASTBOOL bBigOrtho);
-SVX_DLLPUBLIC void OrthoDistance4(const Point& rPt0, Point& rPt, FASTBOOL bBigOrtho);
-
// Multiplikation und anschliessende Division.
// Rechnung und Zwischenergebnis sind BigInt.
SVX_DLLPUBLIC long BigMulDiv(long nVal, long nMul, long nDiv);
@@ -267,20 +177,20 @@ FrPair GetMapFactor(MapUnit eS, FieldUnit eD);
FrPair GetMapFactor(FieldUnit eS, MapUnit eD);
FrPair GetMapFactor(FieldUnit eS, FieldUnit eD);
-inline FASTBOOL IsMetric(MapUnit eU) {
+inline bool IsMetric(MapUnit eU) {
return (eU==MAP_100TH_MM || eU==MAP_10TH_MM || eU==MAP_MM || eU==MAP_CM);
}
-inline FASTBOOL IsInch(MapUnit eU) {
+inline bool IsInch(MapUnit eU) {
return (eU==MAP_1000TH_INCH || eU==MAP_100TH_INCH || eU==MAP_10TH_INCH || eU==MAP_INCH ||
eU==MAP_POINT || eU==MAP_TWIP);
}
-inline FASTBOOL IsMetric(FieldUnit eU) {
+inline bool IsMetric(FieldUnit eU) {
return (eU==FUNIT_MM || eU==FUNIT_CM || eU==FUNIT_M || eU==FUNIT_KM || eU==FUNIT_100TH_MM);
}
-inline FASTBOOL IsInch(FieldUnit eU) {
+inline bool IsInch(FieldUnit eU) {
return (eU==FUNIT_TWIP || eU==FUNIT_POINT || eU==FUNIT_PICA ||
eU==FUNIT_INCH || eU==FUNIT_FOOT || eU==FUNIT_MILE);
}
@@ -290,9 +200,9 @@ class SVX_DLLPUBLIC SdrFormatter {
long nMul_;
long nDiv_;
short nKomma_;
- FASTBOOL bSrcFU;
- FASTBOOL bDstFU;
- FASTBOOL bDirty;
+ bool bSrcFU;
+ bool bDstFU;
+ bool bDirty;
MapUnit eSrcMU;
MapUnit eDstMU;
FieldUnit eSrcFU;
diff --git a/svx/inc/svx/svdtypes.hxx b/svx/inc/svx/svdtypes.hxx
index f5e57d58c316..087234cc1af6 100644
--- a/svx/inc/svx/svdtypes.hxx
+++ b/svx/inc/svx/svdtypes.hxx
@@ -27,14 +27,6 @@
#include <tools/solar.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
-// @@@@ @@@@@ @@@@@ @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@ @@ @@@@@ @@ @@ @@@@@ @@ @@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@@@@ @@ @@ @@@@ @@@@@ @@@@ @@@@@ @@@@ @@
-////////////////////////////////////////////////////////////////////////////////////////////////////
const sal_uInt32 SdrInventor=sal_uInt32('S')*0x00000001+
sal_uInt32('V')*0x00000100+
@@ -71,60 +63,18 @@ enum SdrConvertType {SDRCONVERT_POLY, // reines Polygon erzeugen
SDRCONVERT_MIXED}; // Gemischtes Objekt (optimal)
////////////////////////////////////////////////////////////////////////////////////////////////////
-// @@ @@@@ @@ @@ @@@@@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@@ @@@@ @@@@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@ @@ @@ @@@@@ @@ @@
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
// Bei der Identifikation eines Layer kann es vorkommen, das dieser nicht
// vorhanden ist. SdrLayerAdmin::GetLayerID(const String&) liefert
// dann diesen Wert:
-#define SDRLAYER_NOTFOUND 0xFF
+#define SDRLAYER_NOTFOUND 0x000000ff
+
// Man kann diesen Wert jodoch ohne Bedenken den Methoden des SdrLayerSet
// zuwerfen, bekommt dann jedoch immer sal_False, bzw. tut die Methode nix.
////////////////////////////////////////////////////////////////////////////////////////////////////
// Typdeklaration fuer Layer-IDs
typedef sal_uInt8 SdrLayerID;
-////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
-// @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@@ @@ @@ @@@@ @@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@@@@@ @@ @@@ @@@@ @@@@ @@ @@ @@@@@ @@ @@ @@ @@@@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@@@@ @@@@@ @@@@ @@@@@ @@@@ @@@@@ @@ @@@@ @@
-////////////////////////////////////////////////////////////////////////////////////////////////////
-enum SdrObjListKind {SDROBJLIST_UNKNOWN =0x00, // Unbekannt
- // reine Objektlisten:
- SDROBJLIST_GROUPOBJ =0x01, // Objektliste eines Gruppenobjekts
- SDROBJLIST_VIRTOBJECTS=0x02, // Liste ist die Liste der virtuellen Objekte
- SDROBJLIST_SYMBOLTABLE=0x03, // Liste ist die Symboltabelle
- // Hier haben zur Not noch 12 weitere Listentypen Platz
- // Pages:
- SDROBJLIST_DRAWPAGE =0x10, // Liste ist eine Zeichenseite
- SDROBJLIST_MASTERPAGE =0x11 // Liste ist eine Masterpage
- // Hier haben zur Not noch 8 weitere Pagetypen Platz
-}; // fuer die Surrogate reserviert
-
-inline FASTBOOL SdrIsPageKind(SdrObjListKind eK) { return eK>=SDROBJLIST_DRAWPAGE && eK<=0x1A; }
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// @@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@@@ @@@@@ @@@@ @@@@@@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@@@@ @@ @@ @@
-////////////////////////////////////////////////////////////////////////////////////////////////////
enum SdrRepeatFunc {SDRREPFUNC_OBJ_NONE,
// Mit Parameter
diff --git a/svx/inc/svx/svdundo.hxx b/svx/inc/svx/svdundo.hxx
index 2fe06d55c095..e9ce8d73748b 100644
--- a/svx/inc/svx/svdundo.hxx
+++ b/svx/inc/svx/svdundo.hxx
@@ -33,16 +33,16 @@
#include <svx/svdtypes.hxx> // fuer enum RepeatFuncts
#include <svx/svdsob.hxx>
#include "svx/svxdllapi.h"
+#include <basegfx/point/b2dpoint.hxx>
+#include <vector>
#include <svl/style.hxx>
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
+// predefines
class SfxItemSet;
class SfxStyleSheet;
class SdrView;
-class SdrPageView;
class SdrModel;
class SdrObject;
class SdrPage;
@@ -52,25 +52,19 @@ class SdrLayerAdmin;
class SdrObjGeoData;
class OutlinerParaObject;
-//************************************************************
-// SdrUndoAction
-//
-// Abstrakte Basisklasse fuer alle UndoActions der DrawingEngine
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoAction : public SfxUndoAction
{
protected:
- SdrModel& rMod;
+ SdrModel& mrModel;
-protected:
SdrUndoAction(SdrModel& rNewMod)
- : rMod(rNewMod)
- {}
+ : mrModel(rNewMod)
+ {
+ }
public:
- TYPEINFO();
virtual sal_Bool CanRepeat(SfxRepeatTarget& rView) const;
virtual void Repeat(SfxRepeatTarget& rView);
@@ -81,26 +75,17 @@ public:
virtual void SdrRepeat(SdrView& rView);
};
-//************************************************************
-// SdrUndoGroup
-//
-// Zusammenfassung beliebig vieler einzelner UndoActions zu einer einzigen
-// UndoAction. Beim Undo() werden die Einzelactions rueckwaets aufgerufen
-// (die zuletzt angehaengte zuerst...), beim Redo() dagegen entspricht die
-// Aufrufreihenfolge der Einfuegereihenfolge.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoGroup : public SdrUndoAction
{
protected:
- Container aBuf;
-
- // Beschreibung der Action, nicht expandiert (beinhaltet %O)
- String aComment;
- String aObjDescription;
+ typedef ::std::vector< SdrUndoAction* > SdrUndoActionContainerType;
+ SdrUndoActionContainerType maList;
- SdrRepeatFunc eFunction;
+ String maComment;
+ String maObjDescription;
+ SdrRepeatFunc meFunction;
public:
SdrUndoGroup(SdrModel& rNewMod);
@@ -108,13 +93,13 @@ public:
virtual ~SdrUndoGroup();
void Clear();
- sal_uIntPtr GetActionCount() const { return aBuf.Count(); }
- SdrUndoAction* GetAction(sal_uIntPtr nNum) const { return (SdrUndoAction*)(aBuf.GetObject(nNum)); }
+ sal_uInt32 GetActionCount() const { return maList.size(); }
+ SdrUndoAction* GetAction(sal_uInt32 nNum) const;
void AddAction(SdrUndoAction* pAct);
void push_front( SdrUndoAction* pAct );
- void SetComment(const String& rStr) { aComment=rStr; }
- void SetObjDescription(const String& rStr) { aObjDescription=rStr; }
+ void SetComment(const String& rStr) { maComment = rStr; }
+ void SetObjDescription(const String& rStr) { maObjDescription = rStr; }
virtual String GetComment() const;
virtual String GetSdrRepeatComment(SdrView& rView) const;
@@ -123,69 +108,57 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
virtual void SdrRepeat(SdrView& rView);
- void SetRepeatFunction(SdrRepeatFunc eFunc) { eFunction=eFunc; }
- SdrRepeatFunc GetRepeatFunction() const { return eFunction; }
+ void SetRepeatFunction(SdrRepeatFunc eFunc) { meFunction = eFunc; }
+ SdrRepeatFunc GetRepeatFunction() const { return meFunction; }
};
-//************************************************************
-// SdrUndoObj
-//
-// Abstrakte Basisklasse fuer alle UndoActions die mit Objekten zu tun haben.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoObj : public SdrUndoAction
{
protected:
- SdrObject* pObj;
+ SdrObject& mrSdrObject;
protected:
SdrUndoObj(SdrObject& rNewObj);
- void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, FASTBOOL bRepeat=sal_False) const;
+ void TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, String& rStr, bool bRepeat = false) const;
- static void GetDescriptionStringForObject( const SdrObject& _rForObject, sal_uInt16 nStrCacheID, String& rStr, FASTBOOL bRepeat = sal_False );
+ static void GetDescriptionStringForObject(const SdrObject& _rForObject, sal_uInt16 nStrCacheID, String& rStr, bool bRepeat = false);
- // #94278# new method for evtl. PageChange at UNDO/REDO
void ImpShowPageOfThisObject();
};
-//************************************************************
-// SdrUndoAttrObj
-//
-// Aenderung der Objektattribute.
-// Action direkt vor dem Setzen der neuen Attribute konstruieren.
-// Auch fuer StyleSheets
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj
{
protected:
- SfxItemSet* pUndoSet;
- SfxItemSet* pRedoSet;
- SfxItemSet* pRepeatSet;
+ SfxItemSet* mpUndoItemSet;
+ SfxItemSet* mpRedoItemSet;
+ SfxItemSet* mpRepeatItemSet;
- // oder besser den StyleSheetNamen merken?
rtl::Reference< SfxStyleSheetBase > mxUndoStyleSheet;
rtl::Reference< SfxStyleSheetBase > mxRedoStyleSheet;
- FASTBOOL bStyleSheet;
- FASTBOOL bHaveToTakeRedoSet;
// Bei Zuweisung von TextItems auf ein Zeichenobjekt mit Text:
- OutlinerParaObject* pTextUndo;
- // #i8508#
+ OutlinerParaObject* mpTextUndoOPO;
+
// The text rescue mechanism needs also to be implemented for redo actions.
- OutlinerParaObject* pTextRedo;
+ OutlinerParaObject* mpTextRedoOPO;
// Wenn sich um ein Gruppenobjekt handelt:
- SdrUndoGroup* pUndoGroup;
+ SdrUndoGroup* mpUndoGroup;
+
+ /// bitfield
+ bool mbStyleSheet : 1;
+ bool mbHaveToTakeRedoSet : 1;
// helper to ensure StyleSheet is in pool (provided by SdrModel from SdrObject)
void ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rStyleSheetPool, SfxStyleSheet& rSheet);
public:
- SdrUndoAttrObj(SdrObject& rNewObj, FASTBOOL bStyleSheet1=sal_False, FASTBOOL bSaveText=sal_False);
+ SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1 = false, bool bSaveText = false);
virtual ~SdrUndoAttrObj();
void SetRepeatAttr(const SfxItemSet& rSet);
virtual void Undo();
@@ -198,51 +171,14 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
};
-//************************************************************
-// SdrUndoMoveObj
-//
-// Blosses verschieben eines Objektes.
-// Action direkt vor dem Verschieben konstruieren.
-//
-//************************************************************
-
-class SVX_DLLPUBLIC SdrUndoMoveObj : public SdrUndoObj
-{
-protected:
- Size aDistance; // Entfernung, um die verschoben wird
-
-public:
- SdrUndoMoveObj(SdrObject& rNewObj): SdrUndoObj(rNewObj) {}
- SdrUndoMoveObj(SdrObject& rNewObj, const Size& rDist): SdrUndoObj(rNewObj),aDistance(rDist) {}
-
- void SetDistance(const Size& rDist) { aDistance=rDist; }
- const Size& GetDistance() const { return aDistance; }
-
- virtual void Undo();
- virtual void Redo();
-
- virtual String GetComment() const;
- virtual String GetSdrRepeatComment(SdrView& rView) const;
-
- virtual void SdrRepeat(SdrView& rView);
- virtual bool CanSdrRepeat(SdrView& rView) const;
-};
-
-//************************************************************
-// SdrUndoGeoObj
-//
-// Aenderung der Geometrie eines Objektes.
-// Action direkt vor der geometrischen Transformation konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoGeoObj : public SdrUndoObj
{
protected:
- SdrObjGeoData* pUndoGeo;
- SdrObjGeoData* pRedoGeo;
- // Wenn sich um ein Gruppenobjekt handelt:
- SdrUndoGroup* pUndoGroup;
+ SdrObjGeoData* mpUndoSdrObjGeoData;
+ SdrObjGeoData* mpRedoSdrObjGeoData;
+ SdrUndoGroup* mpUndoGroup;
public:
SdrUndoGeoObj(SdrObject& rNewObj);
@@ -254,85 +190,62 @@ public:
virtual String GetComment() const;
};
-//************************************************************
-// SdrUndoObjList
-//
-// Manipulationen an einer ObjList: Neues Obj, DeleteObj, SetObjZLevel, Grouping, ...
-// Abstrakte Basisklasse.
-//
-//************************************************************
-
-class SVX_DLLPUBLIC SdrUndoObjList : public SdrUndoObj {
- bool bOwner;
+//////////////////////////////////////////////////////////////////////////////
+class SVX_DLLPUBLIC SdrUndoObjList : public SdrUndoObj
+{
protected:
- SdrObjList* pObjList;
- SdrView* pView; // um bei ObjDel, Undo die
- SdrPageView* pPageView; // Selektion widerherstellen zu koennen
- sal_uInt32 nOrdNum;
- // Bei einem Undo/Redo findet moeglicherweise Uebereignung des Objektes
- // statt. Im Dtor wird das Obj deleted, wenn bOwner==TRUE
+ SdrObjList* mpObjList;
+ sal_uInt32 mnOrdNum;
-protected:
- SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect = false);
+ /// bitfield
+ bool mbOwner : 1;
+
+ SdrUndoObjList(SdrObject& rNewObj);
virtual ~SdrUndoObjList();
- void SetView(SdrView* pView1, SdrPageView* pPageView1) { pView=pView1; pPageView=pPageView1; }
- bool IsOwner() { return bOwner; }
+ bool IsOwner() { return mbOwner; }
void SetOwner(bool bNew);
};
-//************************************************************
-// SdrUndoRemoveObj
-//
-// Entfernen Objekts aus einer Objektliste. Innerhalb einer UndoGroup
-// mit korrospondierenden Inserts zu verwenden.
-// Action vor dem entfernen aus der ObjList konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoRemoveObj : public SdrUndoObjList
{
public:
- SdrUndoRemoveObj(SdrObject& rNewObj, FASTBOOL bOrdNumDirect=sal_False)
- : SdrUndoObjList(rNewObj,bOrdNumDirect) {}
+ SdrUndoRemoveObj(SdrObject& rNewObj)
+ : SdrUndoObjList(rNewObj)
+ {
+ }
virtual void Undo();
virtual void Redo();
};
-//************************************************************
-// SdrUndoInsertObj
-//
-// Einfuegen Objekts in eine Objektliste. Innerhalb einer UndoGroup
-// mit korrospondierenden Removes zu verwenden.
-// Action vor dem entfernen aus der ObjList konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoInsertObj : public SdrUndoObjList
{
public:
- SdrUndoInsertObj(SdrObject& rNewObj, FASTBOOL bOrdNumDirect=sal_False)
- : SdrUndoObjList(rNewObj,bOrdNumDirect) {}
+ SdrUndoInsertObj(SdrObject& rNewObj)
+ : SdrUndoObjList(rNewObj)
+ {
+ }
virtual void Undo();
virtual void Redo();
};
-//************************************************************
-// SdrUndoDelObj
-//
-// Loeschen eines Objekts.
-// Action vor dem entfernen aus der ObjList konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoDelObj : public SdrUndoRemoveObj
{
public:
- SdrUndoDelObj(SdrObject& rNewObj, FASTBOOL bOrdNumDirect=sal_False)
- : SdrUndoRemoveObj(rNewObj,bOrdNumDirect) { SetOwner(sal_True); }
+ SdrUndoDelObj(SdrObject& rNewObj)
+ : SdrUndoRemoveObj(rNewObj)
+ {
+ SetOwner(true);
+ }
virtual void Undo();
virtual void Redo();
@@ -344,86 +257,70 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
};
-//************************************************************
-// SdrUndoNewObj
-//
-// Einfuegen eines neuen Objektes.
-// Action nach dem einfuegen in die ObjList konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoNewObj : public SdrUndoInsertObj
{
public:
- SdrUndoNewObj(SdrObject& rNewObj, FASTBOOL bOrdNumDirect=sal_False)
- : SdrUndoInsertObj(rNewObj,bOrdNumDirect) {}
+ SdrUndoNewObj(SdrObject& rNewObj)
+ : SdrUndoInsertObj(rNewObj)
+ {
+ }
virtual void Undo();
virtual void Redo();
virtual String GetComment() const;
-
static String GetComment( const SdrObject& _rForObject );
};
-//************************************************************
-// SdrUndoReplaceObj
-//
-// Austausch eines Objektes.
-// Action vor dem Replace an der ObjList konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoReplaceObj : public SdrUndoObj
{
- bool bOldOwner;
- bool bNewOwner;
-
protected:
- SdrObjList* pObjList;
- sal_uInt32 nOrdNum;
- SdrObject* pNewObj;
+ SdrObjList* mpObjList;
+ sal_uInt32 mnOrdNum;
+ SdrObject& mrNewSdrObject;
+
+ /// bitfield
+ bool mbOldOwner : 1;
+ bool mbNewOwner : 1;
public:
- SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1, bool bOrdNumDirect = false);
+ SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1);
virtual ~SdrUndoReplaceObj();
virtual void Undo();
virtual void Redo();
- bool IsNewOwner() { return bNewOwner; }
+ bool IsNewOwner() { return mbNewOwner; }
void SetNewOwner(bool bNew);
- bool IsOldOwner() { return bOldOwner; }
+ bool IsOldOwner() { return mbOldOwner; }
void SetOldOwner(bool bNew);
};
-//************************************************************
-// SdrUndoCopyObj
-//
-// Kopieren eines Objekts
-// Action nach dem einfuegen in die ObjList konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoCopyObj : public SdrUndoNewObj
{
public:
- SdrUndoCopyObj(SdrObject& rNewObj, FASTBOOL bOrdNumDirect=sal_False)
- : SdrUndoNewObj(rNewObj,bOrdNumDirect) {}
+ SdrUndoCopyObj(SdrObject& rNewObj)
+ : SdrUndoNewObj(rNewObj)
+ {
+ }
virtual String GetComment() const;
};
-//************************************************************
-// SdrUndoObjOrdNum
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoObjOrdNum : public SdrUndoObj
{
protected:
- sal_uInt32 nOldOrdNum;
- sal_uInt32 nNewOrdNum;
+ sal_uInt32 mnOldOrdNum;
+ sal_uInt32 mnNewOrdNum;
public:
SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1);
@@ -435,7 +332,6 @@ public:
};
//////////////////////////////////////////////////////////////////////////////
-// #i11702#
class SVX_DLLPUBLIC SdrUndoObjectLayerChange : public SdrUndoObj
{
@@ -450,24 +346,24 @@ public:
virtual void Redo();
};
-//************************************************************
-// SdrUndoObjSetText
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoObjSetText : public SdrUndoObj
{
protected:
- OutlinerParaObject* pOldText;
- OutlinerParaObject* pNewText;
- FASTBOOL bNewTextAvailable;
- sal_Bool bEmptyPresObj;
+ OutlinerParaObject* mpOldText;
+ OutlinerParaObject* mpNewText;
sal_Int32 mnText;
+ /// bitfield
+ bool mbNewTextAvailable : 1;
+ bool mbEmptyPresObj : 1;
+
public:
SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText );
virtual ~SdrUndoObjSetText();
- FASTBOOL IsDifferent() const { return pOldText!=pNewText; }
+ bool IsDifferent() const { return mpOldText != mpNewText; }
void AfterSetText();
virtual void Undo();
@@ -480,7 +376,8 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
};
-// --> OD 2009-07-09 #i73249#
+//////////////////////////////////////////////////////////////////////////////
+
class SdrUndoObjStrAttr : public SdrUndoObj
{
public:
@@ -497,62 +394,39 @@ protected:
const String msNewStr;
public:
- SdrUndoObjStrAttr( SdrObject& rNewObj,
- const ObjStrAttrType eObjStrAttr,
- const String& sOldStr,
- const String& sNewStr);
+ SdrUndoObjStrAttr( SdrObject& rNewObj, const ObjStrAttrType eObjStrAttr, const String& sOldStr, const String& sNewStr);
virtual void Undo();
virtual void Redo();
virtual String GetComment() const;
};
-// <--
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@@@ @@ @@ @@@@@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@@ @@@@ @@@@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@ @@ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//************************************************************
-// SdrUndoLayer
-//
-// Abstrakte Basisklasse fuer alle UndoActions die mit SdrLayer zu tun haben.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoLayer : public SdrUndoAction
{
protected:
- SdrLayer* pLayer;
- SdrLayerAdmin* pLayerAdmin;
- sal_uInt16 nNum;
- FASTBOOL bItsMine;
+ SdrLayer* mpLayer;
+ SdrLayerAdmin& mrLayerAdmin;
+ sal_uInt16 mnLayerNum;
+
+ /// bitfield
+ bool mbItsMine : 1;
-protected:
SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
virtual ~SdrUndoLayer();
};
-//************************************************************
-// SdrUndoNewLayer
-//
-// Einfuegen eines neuen Layer. Action nach dem Einfuegen konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoNewLayer : public SdrUndoLayer
{
public:
SdrUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
- : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel) {}
+ : SdrUndoLayer(nLayerNum, rNewLayerAdmin, rNewModel)
+ {
+ }
virtual void Undo();
virtual void Redo();
@@ -560,39 +434,16 @@ public:
virtual String GetComment() const;
};
-//************************************************************
-// SdrUndoDelLayer
-//
-// Loeschen eines Layer. Action vor dem Remove konstruieren
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoDelLayer : public SdrUndoLayer
{
public:
SdrUndoDelLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
- : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel) { bItsMine=sal_True; }
-
- virtual void Undo();
- virtual void Redo();
-
- virtual String GetComment() const;
-};
-
-//************************************************************
-// SdrUndoMoveLayer
-//
-// Verschieben eines Layer. Action vor dem Verschieben konstruieren.
-//
-//************************************************************
-
-class SdrUndoMoveLayer : public SdrUndoLayer
+ : SdrUndoLayer(nLayerNum, rNewLayerAdmin, rNewModel)
{
- sal_uInt16 nNeuPos;
-
-public:
- SdrUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
- : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel), nNeuPos(nNeuPos1) {}
+ mbItsMine = true;
+ }
virtual void Undo();
virtual void Redo();
@@ -600,76 +451,64 @@ public:
virtual String GetComment() const;
};
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@ @@@@ @@@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@@@@@ @@ @@@ @@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@@@@ @@@@@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
-//************************************************************
-// SdrUndoPage
+//class SdrUndoMoveLayer : public SdrUndoLayer
+//{
+//private:
+// sal_uInt16 mnNewLayerPos;
+//
+//public:
+// SdrUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
+// : SdrUndoLayer(nLayerNum, rNewLayerAdmin, rNewModel),
+// mnNewLayerPos(nNeuPos1)
+// {
+// }
//
-// Abstrakte Basisklasse fuer alle UndoActions die mit SdrPages zu tun haben.
+// virtual void Undo();
+// virtual void Redo();
//
-//************************************************************
+// virtual String GetComment() const;
+//};
+
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoPage : public SdrUndoAction
{
protected:
SdrPage& mrPage;
-protected:
- void ImpInsertPage(sal_uInt16 nNum);
- void ImpRemovePage(sal_uInt16 nNum);
- void ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum);
+ void ImpInsertPage(sal_uInt32 nNum);
+ void ImpRemovePage(sal_uInt32 nNum);
+ void ImpMovePage(sal_uInt32 nOldNum, sal_uInt32 nNewNum);
protected:
SdrUndoPage(SdrPage& rNewPg);
- void ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 n=0, FASTBOOL bRepeat=sal_False) const;
+ void TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, String& rStr, sal_uInt16 n = 0, bool bRepeat = false) const;
};
-//************************************************************
-// SdrUndoPageList
-//
-// Manipulationen an einer PageList: Neue Page, DeletePage, MovePage(ChangePageNum)
-// Abstrakte Basisklasse.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoPageList : public SdrUndoPage
{
protected:
- sal_uInt16 nPageNum;
+ sal_uInt32 mnPageNum;
- // Bei einem Undo/Redo findet moeglicherweise Uebereignung der Page
- // statt. Im Dtor wird die Page deleted, wenn bItsMine==TRUE
- FASTBOOL bItsMine;
+ /// bitfield
+ bool mbItsMine : 1;
protected:
SdrUndoPageList(SdrPage& rNewPg);
virtual ~SdrUndoPageList();
};
-//************************************************************
-// SdrUndoDelPage
-//
-// Loeschen einer Page.
-// Action vor dem entfernen aus der List konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoDelPage : public SdrUndoPageList
{
- // Beim loeschen einer MasterPage merke ich mir in dieser UndoGroup
- // alle Beziehungen der Zeichenseiten zu der geloeschten MasterPage
- SdrUndoGroup* pUndoGroup;
+private:
+ SdrUndoGroup* mpUndoGroup;
public:
SdrUndoDelPage(SdrPage& rNewPg);
@@ -685,18 +524,15 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
};
-//************************************************************
-// SdrUndoNewPage
-//
-// Einfuegen einer neuen Page.
-// Action nach dem einfuegen in die Liste konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoNewPage : public SdrUndoPageList
{
public:
- SdrUndoNewPage(SdrPage& rNewPg): SdrUndoPageList(rNewPg) {}
+ SdrUndoNewPage(SdrPage& rNewPg)
+ : SdrUndoPageList(rNewPg)
+ {
+ }
virtual void Undo();
virtual void Redo();
@@ -704,18 +540,15 @@ public:
virtual String GetComment() const;
};
-//************************************************************
-// SdrUndoCopyPage
-//
-// Kopieren einer Page
-// Action nach dem einfuegen in die Liste konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoCopyPage : public SdrUndoNewPage
{
public:
- SdrUndoCopyPage(SdrPage& rNewPg): SdrUndoNewPage(rNewPg) {}
+ SdrUndoCopyPage(SdrPage& rNewPg)
+ : SdrUndoNewPage(rNewPg)
+ {
+ }
virtual String GetComment() const;
virtual String GetSdrRepeatComment(SdrView& rView) const;
@@ -724,23 +557,21 @@ public:
virtual bool CanSdrRepeat(SdrView& rView) const;
};
-//************************************************************
-// SdrUndoSetPageNum
-//
-// Verschieben der Page innerhalb der Liste
-// Action vor dem Verschieben der Page konstruieren.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoSetPageNum : public SdrUndoPage
{
protected:
- sal_uInt16 nOldPageNum;
- sal_uInt16 nNewPageNum;
+ sal_uInt32 mnOldPageNum;
+ sal_uInt32 mnNewPageNum;
public:
- SdrUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
- : SdrUndoPage(rNewPg),nOldPageNum(nOldPageNum1),nNewPageNum(nNewPageNum1) {}
+ SdrUndoSetPageNum(SdrPage& rNewPg, sal_uInt32 nOldPageNum1, sal_uInt32 nNewPageNum1)
+ : SdrUndoPage(rNewPg),
+ mnOldPageNum(nOldPageNum1),
+ mnNewPageNum(nNewPageNum1)
+ {
+ }
virtual void Undo();
virtual void Redo();
@@ -748,47 +579,24 @@ public:
virtual String GetComment() const;
};
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@ @@@@ @@@@ @@@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@
-// @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@@@ @@@@@@ @@@@ @@ @@@@ @@@@@ @@@@@ @@@@@@ @@ @@@ @@@@ @@@@
-// @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@@@ @@ @@@@@ @@ @@ @@ @@ @@ @@@@@ @@@@@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-//************************************************************
-// SdrUndoPageMasterPage
-//
-// Abstrakte Basisklasse fuer alle UndoActions die mit
-// MasterPage-Beziehungen zu tun haben.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoPageMasterPage : public SdrUndoPage
{
protected:
- sal_Bool mbOldHadMasterPage;
SetOfByte maOldSet;
- sal_uInt16 maOldMasterPageNumber;
+ sal_uInt32 maOldMasterPageNumber;
+
+ /// bitfield
+ bool mbOldHadMasterPage : 1;
-protected:
SdrUndoPageMasterPage(SdrPage& rChangedPage);
public:
SVX_DLLPUBLIC virtual ~SdrUndoPageMasterPage();
};
-//************************************************************
-// SdrUndoPageRemoveMasterPage
-//
-// Entfernen einer MasterPage von einer Zeichenseite.
-// Action vor dem Entfernen des MasterPageDescriptors erzeugen.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SdrUndoPageRemoveMasterPage : public SdrUndoPageMasterPage
{
@@ -801,21 +609,17 @@ public:
virtual String GetComment() const;
};
-//************************************************************
-// SdrUndoPageChangeMasterPage
-//
-// Aenderung des MasterPageDescriptors (z.B. Aendern der VisibleLayer).
-// Action vor der Aenderung am MasterPageDescriptor erzeugen.
-//
-//************************************************************
+//////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrUndoPageChangeMasterPage : public SdrUndoPageMasterPage
{
protected:
- sal_Bool mbNewHadMasterPage;
SetOfByte maNewSet;
sal_uInt16 maNewMasterPageNumber;
+ /// bitfield
+ bool mbNewHadMasterPage : 1;
+
public:
SdrUndoPageChangeMasterPage(SdrPage& rChangedPage);
@@ -831,38 +635,32 @@ public:
It is used by the drawing layer implementations to create undo actions.
It can be used by applications to create application specific undo actions.
*/
+
class SVX_DLLPUBLIC SdrUndoFactory
{
public:
// shapes
virtual ~SdrUndoFactory();
- virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject );
- virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject, const Size& rDist );
virtual SdrUndoAction* CreateUndoGeoObject( SdrObject& rObject );
virtual SdrUndoAction* CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false );
- virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect = false);
- virtual SdrUndoAction* CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject);
+ virtual SdrUndoAction* CreateUndoInsertObject( SdrObject& rObject);
+ virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject);
+ virtual SdrUndoAction* CreateUndoNewObject( SdrObject& rObject);
+ virtual SdrUndoAction* CreateUndoCopyObject( SdrObject& rObject);
virtual SdrUndoAction* CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1);
- virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect = false );
+ virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject );
virtual SdrUndoAction* CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer );
virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
- // --> OD 2009-07-09 #i73249#
- virtual SdrUndoAction* CreateUndoObjectStrAttr( SdrObject& rObject,
- SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
- String sOldStr,
- String sNewStr );
- // <--
+ virtual SdrUndoAction* CreateUndoObjectStrAttr( SdrObject& rObject, SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, String sOldStr, String sNewStr );
// layer
virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
- virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1);
+// virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1);
// page
virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage);
@@ -879,3 +677,5 @@ public:
#endif //_SVDUNDO_HXX
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svdview.hxx b/svx/inc/svx/svdview.hxx
index b93fd2b54822..b9811dd384b9 100644
--- a/svx/inc/svx/svdview.hxx
+++ b/svx/inc/svx/svdview.hxx
@@ -24,8 +24,6 @@
#ifndef _SVDVIEW_HXX
#define _SVDVIEW_HXX
-// HACK to avoid too deep includes and to have some
-// levels free in svdmark itself (MS compiler include depth limit)
#include <svx/svdhdl.hxx>
#include <tools/weakbase.hxx>
#include <svtools/accessibilityoptions.hxx>
@@ -34,45 +32,26 @@
#include <unotools/options.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// Klassenhierarchie der View:
-// SfxListener
-// SdrPaintView PntV Action ModChg Attr Notify
-// SdrSnapView SnpV Action
-//
-// SdrMarkView MrkV Action MrkChg ModChg Notify
-//
-// SdrEditView EdtV MrkChg ModChg Attr
-// SdrPolyEditView PoEV
-// SdrGlueEditView GlEV
-// SdrObjEditView EdxV Action ModChg Attr Notify
-//
-// SdrExchangeView XcgV
-// SdrDragView DrgV Action
-//
-// SdrCreateView CrtV Action
-// SdrView View
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-//************************************************************
-// Vorausdeklarationen
-//************************************************************
+// predefines
class SvxURLField;
-//************************************************************
-// Defines
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// defines
-enum SdrViewContext {SDRCONTEXT_STANDARD,
+enum SdrViewContext
+{
+ SDRCONTEXT_STANDARD,
SDRCONTEXT_POINTEDIT,
SDRCONTEXT_GLUEPOINTEDIT,
SDRCONTEXT_GRAPHIC,
SDRCONTEXT_MEDIA,
- SDRCONTEXT_TABLE};
+ SDRCONTEXT_TABLE
+};
-enum SdrEventKind {SDREVENT_NONE,
+enum SdrEventKind
+{
+ SDREVENT_NONE,
SDREVENT_TEXTEDIT,
SDREVENT_MOVACTION,
SDREVENT_ENDACTION,
@@ -94,52 +73,52 @@ enum SdrEventKind {SDREVENT_NONE,
SDREVENT_BEGTEXTEDIT,
SDREVENT_ENDMARK,
SDREVENT_BRKMARK,
- SDREVENT_EXECUTEURL};
+ SDREVENT_EXECUTEURL
+};
#define SDRMOUSEBUTTONDOWN 1
#define SDRMOUSEMOVE 2
#define SDRMOUSEBUTTONUP 3
-//************************************************************
-// Hilfsklasse SdrViewEvent
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SdrViewEvent
struct SVX_DLLPUBLIC SdrViewEvent
{
- SdrHdl* pHdl;
- SdrObject* pObj;
- SdrObject* pRootObj; // Dieses Markieren bei SdrBeginTextEdit
- SdrPageView* pPV;
- const SvxURLField* pURLField;
-
- Point aLogicPos;
- SdrHitKind eHit;
- SdrEventKind eEvent;
- SdrHdlKind eHdlKind;
- SdrCreateCmd eEndCreateCmd; // auch fuer EndInsPoint
-
- sal_uInt16 nMouseClicks;
- sal_uInt16 nMouseMode;
- sal_uInt16 nMouseCode;
- sal_uInt16 nHlplIdx;
- sal_uInt16 nGlueId;
-
- unsigned bMouseDown : 1;
- unsigned bMouseUp : 1;
- unsigned bDoubleHdlSize : 1; // Doppelte Handlegroesse wg. TextEdit
- unsigned bIsAction : 1; // Action ist aktiv
- unsigned bIsTextEdit : 1; // TextEdit laeuft zur Zeit
- unsigned bTextEditHit : 1; // offene OutlinerView getroffen
- unsigned bAddMark : 1;
- unsigned bUnmark : 1;
- unsigned bPrevNextMark : 1;
- unsigned bMarkPrev : 1;
- unsigned bInsPointNewObj : 1;
- unsigned bDragWithCopy : 1;
- unsigned bCaptureMouse : 1;
- unsigned bReleaseMouse : 1;
-
public:
+ const SdrHdl* mpHdl;
+ SdrObject* mpObj;
+ SdrObject* mpRootObj; // Dieses Markieren bei SdrBeginTextEdit
+// SdrPageView* mpPV;
+
+ String maURLField;
+ String maTargetFrame;
+
+ basegfx::B2DPoint maLogicPos;
+ SdrHitKind meHit;
+ SdrEventKind meEvent;
+ SdrCreateCmd meEndCreateCmd; // auch fuer EndInsPoint
+
+ sal_uInt16 mnMouseClicks;
+ sal_uInt16 mnMouseMode;
+ sal_uInt16 mnMouseCode;
+ sal_uInt32 mnHlplIdx;
+ sal_uInt32 mnGlueId;
+
+ bool mbMouseDown : 1;
+ bool mbMouseUp : 1;
+ bool mbIsAction : 1; // Action ist aktiv
+ bool mbIsTextEdit : 1; // TextEdit laeuft zur Zeit
+ bool mbTextEditHit : 1; // offene OutlinerView getroffen
+ bool mbAddMark : 1;
+ bool mbUnmark : 1;
+ bool mbPrevNextMark : 1;
+ bool mbMarkPrev : 1;
+ bool mbInsPointNewObj : 1;
+ bool mbDragWithCopy : 1;
+ bool mbCaptureMouse : 1;
+ bool mbReleaseMouse : 1;
+
SdrViewEvent();
~SdrViewEvent();
@@ -152,6 +131,7 @@ public:
class SVX_DLLPUBLIC SdrDropMarkerOverlay
{
+private:
// The OverlayObjects
::sdr::overlay::OverlayObjectList maObjects;
@@ -165,35 +145,57 @@ public:
};
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
//
-// @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @ @@
-// @@@@@ @@ @@@@ @@@@@@@
-// @@@ @@ @@ @@@@@@@
-// @@@ @@ @@ @@@ @@@
-// @ @@ @@@@@ @@ @@
+// old view hierarchy, but in principle a single class since the lowest incarnated class
+// has to be SdrView anyways
+//
+// SdrPaintView
+// SdrSnapView
+// SdrMarkView
+// SdrEditView, IPolyPolygonEditorController
+// SdrPolyEditView
+// SdrGlueEditView
+// SdrObjEditView
+// SdrExchangeView
+// SdrDragView
+// SdrCreateView
+// SdrView
//
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// All current derivations from SdrView
+//
+// HideSdrPage() implemented
+// in destructor and overloaded
+//
+// SdrView * SdrarkView, SdrPaintView
+// DlgEdView
+// OSectionView
+// FrameView
+// GraphCtrlView
+// E3dView
+// DrawViewWrapper
+// FmFormView * *
+// ScDrawView
+// sd::View
+// sd::DrawView * *
+// SwDrawView
+//
class SVX_DLLPUBLIC SdrView: public SdrCreateView, public tools::WeakBase< SdrView >
{
- friend class SdrPageView;
-
- unsigned bNoExtendedMouseDispatcher : 1;
- unsigned bNoExtendedKeyDispatcher : 1;
- unsigned bNoExtendedCommandDispatcher : 1;
- unsigned bTextEditOnObjectsWithoutTextIfTextTool : 1;
- unsigned mbMasterPagePaintCaching : 1;
+private:
+ /// bitfield
+ bool mbNoExtendedMouseDispatcher : 1;
+ bool mbNoExtendedKeyDispatcher : 1;
+ bool mbNoExtendedCommandDispatcher : 1;
+ bool mbMasterPagePaintCaching : 1;
protected:
SvtAccessibilityOptions maAccessibilityOptions;
public:
- TYPEINFO();
- SdrView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrView(SdrModel& rModel1, OutputDevice* pOut = 0);
virtual ~SdrView();
// Default sind alle Dispatcher aktiviert. Will die App z.B. fuer
@@ -206,44 +208,39 @@ public:
// pSdrView->DoMouseEvent(aVEvt);
// SetPointer(GetPreferedPointer(...))
// CaptureMouse(...)
- void EnableExtendedMouseEventDispatcher(sal_Bool bOn) { bNoExtendedMouseDispatcher = !bOn; }
- sal_Bool IsExtendedMouseEventDispatcherEnabled() const { return bNoExtendedMouseDispatcher; }
-
- void EnableExtendedKeyInputDispatcher(sal_Bool bOn) { bNoExtendedKeyDispatcher=!bOn; }
- sal_Bool IsExtendedKeyInputDispatcherEnabled() const { return bNoExtendedKeyDispatcher; }
+ void EnableExtendedMouseEventDispatcher(bool bOn) { mbNoExtendedMouseDispatcher = !bOn; }
+ bool IsExtendedMouseEventDispatcherEnabled() const { return mbNoExtendedMouseDispatcher; }
- void EnableExtendedCommandEventDispatcher(sal_Bool bOn) { bNoExtendedCommandDispatcher=!bOn; }
- sal_Bool IsExtendedCommandEventDispatcherEnabled() const { return bNoExtendedCommandDispatcher; }
+ void EnableExtendedKeyInputDispatcher(bool bOn) { mbNoExtendedKeyDispatcher=!bOn; }
+ bool IsExtendedKeyInputDispatcherEnabled() const { return mbNoExtendedKeyDispatcher; }
- void EnableTextEditOnObjectsWithoutTextIfTextTool(sal_Bool bOn) { bTextEditOnObjectsWithoutTextIfTextTool=bOn; }
- sal_Bool IsEnableTextEditOnObjectsWithoutTextIfTextToolEnabled() const { return bTextEditOnObjectsWithoutTextIfTextTool; }
+ void EnableExtendedCommandEventDispatcher(bool bOn) { mbNoExtendedCommandDispatcher=!bOn; }
+ bool IsExtendedCommandEventDispatcherEnabled() const { return mbNoExtendedCommandDispatcher; }
- void SetMasterPagePaintCaching(sal_Bool bOn);
- sal_Bool IsMasterPagePaintCaching() const { return mbMasterPagePaintCaching; }
+ void SetMasterPagePaintCaching(bool bOn);
+ bool IsMasterPagePaintCaching() const { return mbMasterPagePaintCaching; }
- sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
- virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
- virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
- virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
- virtual sal_Bool Command(const CommandEvent& rCEvt, Window* pWin);
+ virtual bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
+ virtual bool Command(const CommandEvent& rCEvt, Window* pWin);
virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
- sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll=sal_False) { return SdrCreateView::SetAttributes(rSet,bReplaceAll); }
- sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr=sal_False) { return SdrCreateView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr); }
-
- /* new interface src537 */
- sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
+ bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll=false) { return SdrCreateView::SetAttributes(rSet,bReplaceAll); }
+ bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr=false) { return SdrCreateView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr); }
+ bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr=false) const;
SfxStyleSheet* GetStyleSheet() const;
// unvollstaendige Implementation:
// Das OutputDevice ist notwendig, damit ich die HandleSize ermitteln kann.
// Bei NULL wird das 1. angemeldete Win verwendet.
- Pointer GetPreferedPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier=0, sal_Bool bLeftDown=sal_False) const;
+ Pointer GetPreferedPointer(const basegfx::B2DPoint& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier = 0, bool bLeftDown = false) const;
SdrHitKind PickAnything(const MouseEvent& rMEvt, sal_uInt16 nMouseDownOrMoveOrUp, SdrViewEvent& rVEvt) const;
- SdrHitKind PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const;
- sal_Bool DoMouseEvent(const SdrViewEvent& rVEvt);
+ SdrHitKind PickAnything(const basegfx::B2DPoint& rLogicPos, SdrViewEvent& rVEvt) const;
+ bool DoMouseEvent(const SdrViewEvent& rVEvt);
virtual SdrViewContext GetContext() const;
// Die Methoden beruecksichtigen den jeweiligen Kontex:
@@ -252,27 +249,24 @@ public:
// - Klebepunkt-Editmode
// - TextEdit
// - ... to be continued
- sal_Bool IsMarkPossible() const;
+ bool IsMarkPossible() const;
void MarkAll();
void UnmarkAll();
- sal_Bool IsAllMarked() const;
- sal_Bool IsAllMarkPrevNextPossible() const; // das geht naemlich nicht bei TextEdit!
- sal_Bool MarkNext(sal_Bool bPrev=sal_False);
- sal_Bool MarkNext(const Point& rPnt, sal_Bool bPrev=sal_False);
-
- const Rectangle& GetMarkedRect() const;
- void SetMarkedRect(const Rectangle& rRect);
+ bool IsAllMarked() const;
+ bool IsAllMarkPrevNextPossible() const; // das geht naemlich nicht bei TextEdit!
+ bool MarkNext(bool bPrev = false);
+ bool MarkNext(const basegfx::B2DPoint& rPnt, bool bPrev = false);
virtual void DeleteMarked();
- sal_Bool IsDeleteMarkedPossible() const;
- sal_Bool IsDeletePossible() const { return IsDeleteMarkedPossible(); }
+ bool IsDeleteMarkedPossible() const;
+ bool IsDeletePossible() const { return IsDeleteMarkedPossible(); }
// Markieren von Objekten, Polygonpunkten oder Klebepunkten (je nach View-
// Kontext) durch Aufziehen eines Selektionsrahmens.
- // bAddMark=TRUE: zur bestehenden Selektion hinzumarkieren (->Shift)
- // bUnmark=TRUE: Bereits selektierte Objekte/Punkte/Klebepunkte die innerhalb
+ // bAddMark=true: zur bestehenden Selektion hinzumarkieren (->Shift)
+ // bUnmark=true: Bereits selektierte Objekte/Punkte/Klebepunkte die innerhalb
// des aufgezogenen Rahmens liegen werden deselektiert.
- sal_Bool BegMark(const Point& rPnt, sal_Bool bAddMark=sal_False, sal_Bool bUnmark=sal_False);
+ bool BegMark(const basegfx::B2DPoint& rPnt, bool bAddMark = false, bool bUnmark = false);
// Folgende Actions sind moeglich:
// - ObjectCreating
@@ -287,49 +281,9 @@ public:
virtual void onAccessibilityOptionsChanged();
};
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#endif //_SVDVIEW_HXX
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// Die App macht sich zunaechst ein SdrModel.
-// Anschliessend oeffnet sie ein Win und erzeugt dann eine SdrView.
-// An der SdrView meldet sie dann mit der Methode ShowSdrPage() eine Seite an.
-// Eine SdrView kann in beliebig vielen Fenstern gleichzeitig angezeigt werden.
-// Intern:
-// Eine SdrView kann beliebig viele Seiten gleichzeitig anzeigen. Seiten
-// werden an- und abgemeldet mit ShowSdrPage()/HideSdrPage(). Fuer jede angemeldete
-// Seite wird eine SdrPageView-Instanz im Container aPages angelegt. Bei
-// gleichzeitiger Anzeige mehrerer Seiten ist darauf zu achten, dass der Offset-
-// Parameter von ShowSdrPage() der Seitengroesse angepasst ist, da sich sonst die
-// Seiten ueberlappen koennten.
-//
-// Elementare Methoden:
-// ~~~~~~~~~~~~~~~~~~~~
-// Einfache Events:
-// ~~~~~~~~~~~~~~~~
-// sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
-// sal_Bool MouseButtonDown(const MouseEvent& rMEvt, Window* pWin);
-// sal_Bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin);
-// sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin);
-// sal_Bool Command(const CommandEvent& rCEvt, Window* pWin);
-//
-// Exchange (Clipboard derzeit noch ohne SdrPrivateData):
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// sal_Bool Cut(sal_uIntPtr nFormat=SDR_ANYFORMAT);
-// sal_Bool Yank(sal_uIntPtr nFormat=SDR_ANYFORMAT);
-// sal_Bool Paste(Window* pWin=NULL, sal_uIntPtr nFormat=SDR_ANYFORMAT);
-//
-// SfxItems:
-// ~~~~~~~~~
-// sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
-// sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
-// SfxStyleSheet* GetStyleSheet() const;
-// sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
-//
-// Sonstiges:
-// ~~~~~~~~~~
-// Pointer GetPreferedPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nTol=0) const;
-// String GetStatusText();
-//
-///////////////////////////////////////////////////////////////////////////////////////////////// */
-
+// eof
diff --git a/svx/inc/svx/svdxcgv.hxx b/svx/inc/svx/svdxcgv.hxx
index 6d86d853d6cf..ffac5227a31d 100644
--- a/svx/inc/svx/svdxcgv.hxx
+++ b/svx/inc/svx/svdxcgv.hxx
@@ -25,43 +25,37 @@
#define _SVDXCGV_HXX
#include <svx/svdedxv.hxx>
-
-#ifndef _GDIMTF_HXX //autogen
#include <vcl/gdimtf.hxx>
-#endif
#include "svx/svxdllapi.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@ @@ @@@@ @@ @@ @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@ @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@ @@@ @@ @@@@@@ @@@@@@ @@@@@@ @@ @@@ @@@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@@@@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@ @@ @@@@ @@ @@ @@ @@ @@ @@ @@@@@ @@@@@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/** Generate a Graphic for the given draw object in the given model
+
+ @param pObj
+ The object (can also be a group object) to retrieve a Graphic
+ for. Must not be NULL.
+
+ @return a graphical representation of the given object, as it
+ appears on screen (e.g. with rotation, if any, applied).
+ */
+// TTTT: Candidate for tooling and replacement ?!?
+Graphic SVX_DLLPUBLIC GetObjGraphic(const SdrObject& rObj);
+
////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC SdrExchangeView: public SdrObjEditView
{
- friend class SdrPageView;
-
protected:
-
- void ImpGetPasteObjList(Point& rPos, SdrObjList*& rpLst);
- void ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, sal_uInt32 nOptions);
- sal_Bool ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const;
- Point GetPastePos(SdrObjList* pLst, OutputDevice* pOut=NULL);
+ void ImpGetPasteObjList(SdrObjList*& rpLst);
+ void ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const basegfx::B2DPoint& rCenter, const basegfx::B2DVector& rSiz, const MapMode& rMap, sal_uInt32 nOptions);
+ bool ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const;
// liefert True, wenn rPt geaendert wurde
- sal_Bool ImpLimitToWorkArea(Point& rPt) const;
+ basegfx::B2DPoint ImpLimitToWorkArea(const basegfx::B2DPoint& rPt) const;
-protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrExchangeView(SdrModel* pModel1, OutputDevice* pOut = 0L);
+ SdrExchangeView(SdrModel& rModel1, OutputDevice* pOut = 0);
public:
// Alle markierten Objekte auf dem angegebenen OutputDevice ausgeben.
@@ -69,8 +63,7 @@ public:
// Z.B. fuer's Clipboard, Drag&Drop, ...
// Alle markierten Objekte in ein Metafile stecken. Z.Zt. noch etwas
- // buggee (Offset..., Fremdgrafikobjekte (SdrGrafObj), Virtuelle
- // Objektkopien (SdrVirtObj) mit Ankerpos<>(0,0)).
+ // buggee (Offset..., Fremdgrafikobjekte (SdrGrafObj)
GDIMetaFile GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked = false) const;
// Alle markierten Objekte auf eine Bitmap malen. Diese hat die Farbtiefe
@@ -92,26 +85,11 @@ public:
Graphic GetAllMarkedGraphic() const;
SdrModel* GetAllMarkedModel() const { return GetMarkedObjModel(); }
- /** Generate a Graphic for the given draw object in the given model
-
- @param pModel
- Must not be NULL. Denotes the draw model the object is a part
- of.
-
- @param pObj
- The object (can also be a group object) to retrieve a Graphic
- for. Must not be NULL.
-
- @return a graphical representation of the given object, as it
- appears on screen (e.g. with rotation, if any, applied).
- */
- static Graphic GetObjGraphic( const SdrModel* pModel, const SdrObject* pObj );
-
// Bestimmung des View-Mittelpunktes, z.B. zum Pasten
- Point GetViewCenter(const OutputDevice* pOut=NULL) const;
+ basegfx::B2DPoint GetViewCenter(const OutputDevice* pOut = 0) const;
// Bei allen Paste-Methoden werden die neuen Draw-Objekte markiert.
- // Wird der Parameter bAddMark auf sal_True gesetzt, so werden die neuen
+ // Wird der Parameter bAddMark auf true gesetzt, so werden die neuen
// DrawObjekte zu einer bereits bestehenden Selektion "hinzumarkiert".
// Dieser Fall ist fuer Drag&Drop mit mehreren Items gedacht.
// Die Methoden mit Point-Parameter fuegen neue Objekte zentriert an
@@ -120,37 +98,39 @@ public:
// eingefuegt. Die Positionierung (rPos bzw. Zentrierung) bezieht sich
// dann nichtmehr auf die View sondern auf die Page.
// Hinweis: SdrObjList ist Basisklasse von SdrPage.
- // Die Methoden liefern sal_True, wenn die Objekte erfolgreich erzeugt und
- // eingefuegt wurden. Bei pLst=sal_False und kein TextEdit aktiv kann man
+ // Die Methoden liefern true, wenn die Objekte erfolgreich erzeugt und
+ // eingefuegt wurden. Bei pLst=false und kein TextEdit aktiv kann man
// sich dann auch darauf verlassen, dass diese an der View markiert sind.
// Andernfalls erfolgt die Markierung nur, wenn pLst z.Zt. auch an der
// View angezeigt wird.
// Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und
// SDRINSERT_ADDMARK (siehe svdedtv.hxx).
- sal_Bool Paste(const GDIMetaFile& rMtf, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rMtf,GetPastePos(pLst,pOut),pLst,nOptions); }
- sal_Bool Paste(const GDIMetaFile& rMtf, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
- sal_Bool Paste(const Bitmap& rBmp, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rBmp,GetPastePos(pLst,pOut),pLst,nOptions); }
- sal_Bool Paste(const Bitmap& rBmp, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
- sal_Bool Paste(const SdrModel& rMod, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rMod,GetPastePos(pLst,pOut),pLst,nOptions); }
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
- sal_Bool Paste(const String& rStr, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rStr,GetPastePos(pLst,pOut),pLst,nOptions); }
- sal_Bool Paste(const String& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+
+ basegfx::B2DPoint GetPastePos(SdrObjList* pLst, OutputDevice* pOut = 0) const;
+
+ bool Paste(const GDIMetaFile& rMtf, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
+ bool Paste(const Bitmap& rBmp, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
+ virtual bool Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
+ bool Paste(const String& rStr, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
+
// der sal_uInt16 eFormat nimmt Werte des enum EETextFormat entgegen
- sal_Bool Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rInput,rBaseURL,eFormat,GetPastePos(pLst,pOut),pLst,nOptions); }
- sal_Bool Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ bool Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
// Feststellen, ob ein bestimmtes Format ueber Drag&Drop bzw. ueber's
// Clipboard angenommen werden kann.
- sal_Bool IsExchangeFormatSupported(sal_uIntPtr nFormat) const;
+ bool IsExchangeFormatSupported(sal_uInt32 nFormat) const;
- sal_Bool Cut( sal_uIntPtr nFormat = SDR_ANYFORMAT );
- void CutMarked( sal_uIntPtr nFormat=SDR_ANYFORMAT );
+ bool Cut( sal_uInt32 nFormat = SDR_ANYFORMAT );
+ void CutMarked( sal_uInt32 nFormat=SDR_ANYFORMAT );
- sal_Bool Yank( sal_uIntPtr nFormat = SDR_ANYFORMAT );
- void YankMarked( sal_uIntPtr nFormat=SDR_ANYFORMAT );
+ bool Yank( sal_uInt32 nFormat = SDR_ANYFORMAT );
+ void YankMarked( sal_uInt32 nFormat=SDR_ANYFORMAT );
- sal_Bool Paste( Window* pWin = NULL, sal_uIntPtr nFormat = SDR_ANYFORMAT );
- sal_Bool PasteClipboard( OutputDevice* pOut = NULL, sal_uIntPtr nFormat = SDR_ANYFORMAT, sal_uInt32 nOptions = 0 );
+ bool Paste( Window* pWin = NULL, sal_uInt32 nFormat = SDR_ANYFORMAT );
+ bool PasteClipboard( OutputDevice* pOut = NULL, sal_uInt32 nFormat = SDR_ANYFORMAT, sal_uInt32 nOptions = 0 );
};
#endif //_SVDXCGV_HXX
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/svx3ditems.hxx b/svx/inc/svx/svx3ditems.hxx
index c2c00f2db74f..43eef8c516cf 100644
--- a/svx/inc/svx/svx3ditems.hxx
+++ b/svx/inc/svx/svx3ditems.hxx
@@ -25,8 +25,6 @@
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
-
-
#include <editeng/colritem.hxx>
#include <svx/e3ditem.hxx>
#include <svx/viewpt3d.hxx>
@@ -34,48 +32,13 @@
#include "svx/svxdllapi.h"
// Svx3D _3DOBJ_ Items
-class SVX_DLLPUBLIC Svx3DPercentDiagonalItem : public SfxUInt16Item {
-public:
- Svx3DPercentDiagonalItem(sal_uInt16 nVal = 10);
-};
-
-class Svx3DBackscaleItem : public SfxUInt16Item {
-public:
- SVX_DLLPUBLIC Svx3DBackscaleItem(sal_uInt16 nVal = 100);
-};
-
-class Svx3DDepthItem : public SfxUInt32Item {
-public:
- SVX_DLLPUBLIC Svx3DDepthItem(sal_uInt32 nVal = 1000);
-};
-
-class SVX_DLLPUBLIC Svx3DHorizontalSegmentsItem : public SfxUInt32Item {
-public:
- Svx3DHorizontalSegmentsItem(sal_uInt32 nVal = 24);
-};
-
-class Svx3DVerticalSegmentsItem : public SfxUInt32Item {
-public:
- SVX_DLLPUBLIC Svx3DVerticalSegmentsItem(sal_uInt32 nVal = 24);
-};
-
-class Svx3DEndAngleItem : public SfxUInt32Item {
-public:
- SVX_DLLPUBLIC Svx3DEndAngleItem(sal_uInt32 nVal = 3600);
-};
-
-class SVX_DLLPUBLIC Svx3DDoubleSidedItem : public SfxBoolItem {
-public:
- Svx3DDoubleSidedItem(sal_Bool bVal = 0);
-};
-
-// #i28528#
// Added extra Item (Bool) for chart2 to be able to show reduced line geometry
class Svx3DReducedLineGeometryItem : public SfxBoolItem {
public:
Svx3DReducedLineGeometryItem(sal_Bool bVal = 0);
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ virtual SfxPoolItem* Clone(SfxItemPool * = 0) const;
};
class SVX_DLLPUBLIC Svx3DNormalsKindItem : public SfxUInt16Item {
@@ -88,11 +51,6 @@ public:
SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
-class Svx3DNormalsInvertItem : public SfxBoolItem {
-public:
- SVX_DLLPUBLIC Svx3DNormalsInvertItem(sal_Bool bVal = 0);
-};
-
class SVX_DLLPUBLIC Svx3DTextureProjectionXItem : public SfxUInt16Item {
public:
Svx3DTextureProjectionXItem(sal_uInt16 nVal = 0);
@@ -113,31 +71,6 @@ public:
virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
-class Svx3DShadow3DItem : public SfxBoolItem {
-public:
- SVX_DLLPUBLIC Svx3DShadow3DItem(sal_Bool bVal = 0);
-};
-
-class Svx3DMaterialColorItem : public SvxColorItem {
-public:
- Svx3DMaterialColorItem(const Color& rCol = Color(0x0000b8ff));
-};
-
-class Svx3DMaterialEmissionItem : public SvxColorItem {
-public:
- SVX_DLLPUBLIC Svx3DMaterialEmissionItem(const Color& rCol = Color(0x00000000));
-};
-
-class Svx3DMaterialSpecularItem : public SvxColorItem {
-public:
- SVX_DLLPUBLIC Svx3DMaterialSpecularItem(const Color& rCol = Color(0x00ffffff));
-};
-
-class Svx3DMaterialSpecularIntensityItem : public SfxUInt16Item {
-public:
- SVX_DLLPUBLIC Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal = 15);
-};
-
class SVX_DLLPUBLIC Svx3DTextureKindItem : public SfxUInt16Item {
public:
Svx3DTextureKindItem(sal_uInt16 nVal = 3);
@@ -158,11 +91,6 @@ public:
SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
-class Svx3DTextureFilterItem : public SfxBoolItem {
-public:
- SVX_DLLPUBLIC Svx3DTextureFilterItem(sal_Bool bVal = 0);
-};
-
// Svx3D _3DSCENE_ Items
class SVX_DLLPUBLIC Svx3DPerspectiveItem : public SfxUInt16Item {
public:
@@ -174,151 +102,6 @@ public:
SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
};
-class Svx3DDistanceItem : public SfxUInt32Item {
-public:
- SVX_DLLPUBLIC Svx3DDistanceItem(sal_uInt32 nVal = 100);
-};
-
-class Svx3DFocalLengthItem : public SfxUInt32Item {
-public:
- SVX_DLLPUBLIC Svx3DFocalLengthItem(sal_uInt32 nVal = 100);
-};
-
-class Svx3DTwoSidedLightingItem : public SfxBoolItem {
-public:
- SVX_DLLPUBLIC Svx3DTwoSidedLightingItem(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor1Item : public SvxColorItem {
-public:
- Svx3DLightcolor1Item(const Color& rCol = Color(0xffcccccc));
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor2Item : public SvxColorItem {
-public:
- Svx3DLightcolor2Item(const Color& rCol = Color(0x00000000));
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor3Item : public SvxColorItem {
-public:
- Svx3DLightcolor3Item(const Color& rCol = Color(0x00000000));
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor4Item : public SvxColorItem {
-public:
- Svx3DLightcolor4Item(const Color& rCol = Color(0x00000000));
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor5Item : public SvxColorItem {
-public:
- Svx3DLightcolor5Item(const Color& rCol = Color(0x00000000));
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor6Item : public SvxColorItem {
-public:
- Svx3DLightcolor6Item(const Color& rCol = Color(0x00000000));
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor7Item : public SvxColorItem {
-public:
- Svx3DLightcolor7Item(const Color& rCol = Color(0x00000000));
-};
-
-class SVX_DLLPUBLIC Svx3DLightcolor8Item : public SvxColorItem {
-public:
- Svx3DLightcolor8Item(const Color& rCol = Color(0x00000000));
-};
-
-class SVX_DLLPUBLIC Svx3DAmbientcolorItem : public SvxColorItem {
-public:
- Svx3DAmbientcolorItem(const Color& rCol = Color(0x00666666));
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff1Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff1Item(sal_Bool bVal = 1);
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff2Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff2Item(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff3Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff3Item(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff4Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff4Item(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff5Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff5Item(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff6Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff6Item(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff7Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff7Item(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightOnOff8Item : public SfxBoolItem {
-public:
- Svx3DLightOnOff8Item(sal_Bool bVal = 0);
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection1Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection1Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.57735026918963, 0.57735026918963, 0.57735026918963));
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection2Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection2Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection3Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection3Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection4Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection4Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection5Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection5Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection6Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection6Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection7Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection7Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
-};
-
-class SVX_DLLPUBLIC Svx3DLightDirection8Item : public SvxB3DVectorItem {
-public:
- Svx3DLightDirection8Item(const basegfx::B3DVector& rVec = basegfx::B3DVector(0.0,0.0,1.0));
-};
-
-class Svx3DShadowSlantItem : public SfxUInt16Item {
-public:
- SVX_DLLPUBLIC Svx3DShadowSlantItem(sal_uInt16 nVal = 0);
-};
-
class SVX_DLLPUBLIC Svx3DShadeModeItem : public SfxUInt16Item {
public:
Svx3DShadeModeItem(sal_uInt16 nVal = 2);
@@ -336,6 +119,7 @@ public:
Svx3DSmoothNormalsItem(sal_Bool bVal = 1);
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ virtual SfxPoolItem* Clone(SfxItemPool * = 0) const;
};
// #107245# Item to replace bExtrudeSmoothFrontBack and bLatheSmoothFrontBack
@@ -344,6 +128,7 @@ public:
Svx3DSmoothLidsItem(sal_Bool bVal = 0);
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ virtual SfxPoolItem* Clone(SfxItemPool * = 0) const;
};
// #107245# Item to replace bExtrudeCharacterMode and bLatheCharacterMode
@@ -352,6 +137,7 @@ public:
Svx3DCharacterModeItem(sal_Bool bVal = 0);
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ virtual SfxPoolItem* Clone(SfxItemPool * = 0) const;
};
// #107245# Item to replace bExtrudeCloseFront and bLatheCloseFront
@@ -360,6 +146,7 @@ public:
Svx3DCloseFrontItem(sal_Bool bVal = 1);
SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool * = 0) const;
};
// #107245# Item to replace bExtrudeCloseBack and bLatheCloseBack
@@ -368,6 +155,7 @@ public:
Svx3DCloseBackItem(sal_Bool bVal = 1);
SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const;
SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const;
+ SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool * = 0) const;
};
#endif // _SVX3DITEMS_HXX
diff --git a/svx/inc/svx/svxgrahicitem.hxx b/svx/inc/svx/svxgrahicitem.hxx
index 5935a7d4a10a..94af9be60c70 100644
--- a/svx/inc/svx/svxgrahicitem.hxx
+++ b/svx/inc/svx/svxgrahicitem.hxx
@@ -34,7 +34,6 @@ class SVX_DLLPUBLIC SvxGraphicItem: public SfxPoolItem
Graphic aGraphic;
public:
- TYPEINFO();
SvxGraphicItem();
SvxGraphicItem( sal_uInt16 nWhich ,const Graphic& rGraphic);
SvxGraphicItem( const SvxGraphicItem& );
diff --git a/svx/inc/svx/sxcecitm.hxx b/svx/inc/svx/sxcecitm.hxx
index d057f357f8e4..77513391dcdc 100644
--- a/svx/inc/svx/sxcecitm.hxx
+++ b/svx/inc/svx/sxcecitm.hxx
@@ -36,7 +36,6 @@ enum SdrCaptionEscDir {SDRCAPT_ESCHORIZONTAL,SDRCAPT_ESCVERTICAL,SDRCAPT_ESCBEST
//------------------------------
class SVX_DLLPUBLIC SdrCaptionEscDirItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SDRCAPT_ESCHORIZONTAL): SfxEnumItem(SDRATTR_CAPTIONESCDIR,sal::static_int_cast< sal_uInt16 >(eDir)) {}
SdrCaptionEscDirItem(SvStream& rIn) : SfxEnumItem(SDRATTR_CAPTIONESCDIR,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
@@ -49,41 +48,4 @@ public:
virtual SfxItemPresentation GetPresentation(SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String& rText, const IntlWrapper * = 0) const;
};
-//------------------------------------
-// class SdrCaptionEscIsRelItem
-// sal_True=Linienaustrittsposition relativ
-// sal_False=Linienaustrittsposition absolut
-//------------------------------------
-class SdrCaptionEscIsRelItem: public SdrYesNoItem {
-public:
- SdrCaptionEscIsRelItem(sal_Bool bRel=sal_True): SdrYesNoItem(SDRATTR_CAPTIONESCISREL,bRel) {}
- SdrCaptionEscIsRelItem(SvStream& rIn) : SdrYesNoItem(SDRATTR_CAPTIONESCISREL,rIn) {}
-};
-
-//------------------------------------
-// class SdrCaptionEscRelItem
-// Relativer Linienaustritt
-// 0 = 0.00% = oben bzw. links,
-// 10000 = 100.00% = rechts bzw. unten
-// nur wenn SdrCaptionEscIsRelItem=TRUE
-//------------------------------------
-class SdrCaptionEscRelItem: public SfxInt32Item {
-public:
- SdrCaptionEscRelItem(long nEscRel=5000): SfxInt32Item(SDRATTR_CAPTIONESCREL,nEscRel) {}
- SdrCaptionEscRelItem(SvStream& rIn) : SfxInt32Item(SDRATTR_CAPTIONESCREL,rIn) {}
-};
-
-//------------------------------------
-// class SdrCaptionEscAbsItem
-// Absoluter Linienaustritt
-// 0 = oben bzw. links,
-// >0 = in Richtung rechts bzw. unten
-// nur wenn SdrCaptionEscIsRelItem=FALSE
-//------------------------------------
-class SdrCaptionEscAbsItem: public SdrMetricItem {
-public:
- SdrCaptionEscAbsItem(long nEscAbs=0): SdrMetricItem(SDRATTR_CAPTIONESCABS,nEscAbs) {}
- SdrCaptionEscAbsItem(SvStream& rIn) : SdrMetricItem(SDRATTR_CAPTIONESCABS,rIn) {}
-};
-
#endif
diff --git a/svx/inc/svx/sxctitm.hxx b/svx/inc/svx/sxctitm.hxx
index 1617efff38a0..dc36a5a3e936 100644
--- a/svx/inc/svx/sxctitm.hxx
+++ b/svx/inc/svx/sxctitm.hxx
@@ -34,7 +34,6 @@ enum SdrCaptionType {SDRCAPT_TYPE1,SDRCAPT_TYPE2,SDRCAPT_TYPE3,SDRCAPT_TYPE4};
//------------------------------
class SVX_DLLPUBLIC SdrCaptionTypeItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrCaptionTypeItem(SdrCaptionType eStyle=SDRCAPT_TYPE3): SfxEnumItem(SDRATTR_CAPTIONTYPE,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
SdrCaptionTypeItem(SvStream& rIn) : SfxEnumItem(SDRATTR_CAPTIONTYPE,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sxekitm.hxx b/svx/inc/svx/sxekitm.hxx
index 68be4c026e5a..a393fc43fe6d 100644
--- a/svx/inc/svx/sxekitm.hxx
+++ b/svx/inc/svx/sxekitm.hxx
@@ -38,7 +38,6 @@ enum SdrEdgeKind {SDREDGE_ORTHOLINES,
//------------------------------
class SVX_DLLPUBLIC SdrEdgeKindItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrEdgeKindItem(SdrEdgeKind eStyle=SDREDGE_ORTHOLINES): SfxEnumItem(SDRATTR_EDGEKIND,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
SdrEdgeKindItem(SvStream& rIn) : SfxEnumItem(SDRATTR_EDGEKIND,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sxelditm.hxx b/svx/inc/svx/sxelditm.hxx
index ab6064ad8935..50a630f84d71 100644
--- a/svx/inc/svx/sxelditm.hxx
+++ b/svx/inc/svx/sxelditm.hxx
@@ -27,18 +27,13 @@
#include <svx/sdmetitm.hxx>
#include "svx/svxdllapi.h"
-class SdrEdgeLineDeltaAnzItem: public SfxUInt16Item {
-public:
- SdrEdgeLineDeltaAnzItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_EDGELINEDELTAANZ,nVal) {}
- SdrEdgeLineDeltaAnzItem(SvStream& rIn): SfxUInt16Item(SDRATTR_EDGELINEDELTAANZ,rIn) {}
-};
-
class SVX_DLLPUBLIC SdrEdgeLine1DeltaItem: public SdrMetricItem {
public:
SdrEdgeLine1DeltaItem(long nVal=0): SdrMetricItem(SDRATTR_EDGELINE1DELTA,nVal) {}
SdrEdgeLine1DeltaItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGELINE1DELTA,rIn) {}
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
};
class SVX_DLLPUBLIC SdrEdgeLine2DeltaItem: public SdrMetricItem {
@@ -47,6 +42,7 @@ public:
SdrEdgeLine2DeltaItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGELINE2DELTA,rIn) {}
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
};
class SVX_DLLPUBLIC SdrEdgeLine3DeltaItem: public SdrMetricItem {
@@ -55,6 +51,7 @@ public:
SdrEdgeLine3DeltaItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGELINE3DELTA,rIn) {}
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
};
#endif
diff --git a/svx/inc/svx/sxenditm.hxx b/svx/inc/svx/sxenditm.hxx
index b77cc59e8b35..807ab9e178ad 100644
--- a/svx/inc/svx/sxenditm.hxx
+++ b/svx/inc/svx/sxenditm.hxx
@@ -33,6 +33,7 @@ public:
SdrEdgeNode1HorzDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE1HORZDIST,rIn) {}
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
};
class SVX_DLLPUBLIC SdrEdgeNode1VertDistItem: public SdrMetricItem {
@@ -41,6 +42,7 @@ public:
SdrEdgeNode1VertDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE1VERTDIST,rIn) {}
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
};
class SVX_DLLPUBLIC SdrEdgeNode2HorzDistItem: public SdrMetricItem {
@@ -49,6 +51,7 @@ public:
SdrEdgeNode2HorzDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE2HORZDIST,rIn) {}
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
};
class SVX_DLLPUBLIC SdrEdgeNode2VertDistItem: public SdrMetricItem {
@@ -57,18 +60,7 @@ public:
SdrEdgeNode2VertDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE2VERTDIST,rIn) {}
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
-};
-
-class SdrEdgeNode1GlueDistItem: public SdrMetricItem {
-public:
- SdrEdgeNode1GlueDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST,nVal) {}
- SdrEdgeNode1GlueDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST,rIn) {}
-};
-
-class SdrEdgeNode2GlueDistItem: public SdrMetricItem {
-public:
- SdrEdgeNode2GlueDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST,nVal) {}
- SdrEdgeNode2GlueDistItem(SvStream& rIn): SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST,rIn) {}
+ virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
};
#endif
diff --git a/svx/inc/svx/sxfiitm.hxx b/svx/inc/svx/sxfiitm.hxx
index 6548811328eb..3b1cf1b06e35 100644
--- a/svx/inc/svx/sxfiitm.hxx
+++ b/svx/inc/svx/sxfiitm.hxx
@@ -33,7 +33,6 @@
class SdrFractionItem: public SfxPoolItem {
Fraction nValue;
public:
- TYPEINFO_VISIBILITY( SVX_DLLPUBLIC );
SdrFractionItem(sal_uInt16 nId=0): SfxPoolItem(nId) {}
SdrFractionItem(sal_uInt16 nId, const Fraction& rVal): SfxPoolItem(nId), nValue(rVal) {}
SdrFractionItem(sal_uInt16 nId, SvStream& rIn);
diff --git a/svx/inc/svx/sxmkitm.hxx b/svx/inc/svx/sxmkitm.hxx
index 7e81c3ef8004..ea12f97693fc 100644
--- a/svx/inc/svx/sxmkitm.hxx
+++ b/svx/inc/svx/sxmkitm.hxx
@@ -33,7 +33,6 @@ enum SdrMeasureKind {SDRMEASURE_STD,SDRMEASURE_RADIUS}; // n.i.
//------------------------------
class SdrMeasureKindItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrMeasureKindItem(SdrMeasureKind eKind=SDRMEASURE_STD): SfxEnumItem(SDRATTR_MEASUREKIND,sal::static_int_cast< sal_uInt16 >(eKind)) {}
SdrMeasureKindItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASUREKIND,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sxmtpitm.hxx b/svx/inc/svx/sxmtpitm.hxx
index ded70ca67769..1a81aa294f4d 100644
--- a/svx/inc/svx/sxmtpitm.hxx
+++ b/svx/inc/svx/sxmtpitm.hxx
@@ -35,7 +35,6 @@ enum SdrMeasureTextVPos {SDRMEASURE_TEXTVAUTO,SDRMEASURE_ABOVE,SDRMEASURETEXT_BR
//------------------------------
class SVX_DLLPUBLIC SdrMeasureTextHPosItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrMeasureTextHPosItem(SdrMeasureTextHPos ePos=SDRMEASURE_TEXTHAUTO): SfxEnumItem(SDRATTR_MEASURETEXTHPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
SdrMeasureTextHPosItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASURETEXTHPOS,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
@@ -55,7 +54,6 @@ public:
//------------------------------
class SVX_DLLPUBLIC SdrMeasureTextVPosItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrMeasureTextVPosItem(SdrMeasureTextVPos ePos=SDRMEASURE_TEXTVAUTO): SfxEnumItem(SDRATTR_MEASURETEXTVPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
SdrMeasureTextVPosItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASURETEXTVPOS,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sxmuitm.hxx b/svx/inc/svx/sxmuitm.hxx
index 30400b2be4b1..0e5da50ae2c1 100644
--- a/svx/inc/svx/sxmuitm.hxx
+++ b/svx/inc/svx/sxmuitm.hxx
@@ -32,7 +32,6 @@
// (ausgehend von der MapUnit des Models). Diese Einheit wird dann ggf. auch angezeigt.
class SVX_DLLPUBLIC SdrMeasureUnitItem: public SfxEnumItem {
public:
- TYPEINFO();
SdrMeasureUnitItem(FieldUnit eUnit=FUNIT_NONE): SfxEnumItem(SDRATTR_MEASUREUNIT,sal::static_int_cast< sal_uInt16 >(eUnit)) {}
SdrMeasureUnitItem(SvStream& rIn) : SfxEnumItem(SDRATTR_MEASUREUNIT,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const;
diff --git a/svx/inc/svx/sxsaitm.hxx b/svx/inc/svx/sxsaitm.hxx
index 06a853ca49f9..7a3d0bd96e32 100644
--- a/svx/inc/svx/sxsaitm.hxx
+++ b/svx/inc/svx/sxsaitm.hxx
@@ -29,10 +29,10 @@
//------------------------------
// class SdrShearAngleItem
//------------------------------
-class SdrShearAngleItem: public SdrAngleItem {
-public:
- SdrShearAngleItem(long nAngle=0): SdrAngleItem(SDRATTR_SHEARANGLE,nAngle) {}
- SdrShearAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_SHEARANGLE,rIn) {}
-};
+//class SdrShearAngleItem: public SdrAngleItem {
+//public:
+// SdrShearAngleItem(long nAngle=0): SdrAngleItem(SDRATTR_SHEARANGLE,nAngle) {}
+// SdrShearAngleItem(SvStream& rIn): SdrAngleItem(SDRATTR_SHEARANGLE,rIn) {}
+//};
#endif
diff --git a/svx/inc/svx/sxsiitm.hxx b/svx/inc/svx/sxsiitm.hxx
index d1b5e16b31f8..ca78820f53d6 100644
--- a/svx/inc/svx/sxsiitm.hxx
+++ b/svx/inc/svx/sxsiitm.hxx
@@ -29,7 +29,6 @@
class SdrScaleItem: public SdrFractionItem {
public:
- TYPEINFO();
SdrScaleItem(sal_uInt16 nId=0): SdrFractionItem(nId,Fraction(1,1)) {}
SdrScaleItem(sal_uInt16 nId, const Fraction& rVal): SdrFractionItem(nId,rVal) {}
SdrScaleItem(sal_uInt16 nId, SvStream& rIn): SdrFractionItem(nId,rIn) {}
diff --git a/svx/inc/svx/unoapi.hxx b/svx/inc/svx/unoapi.hxx
index 1428e07edc0f..26297326461f 100644
--- a/svx/inc/svx/unoapi.hxx
+++ b/svx/inc/svx/unoapi.hxx
@@ -39,11 +39,6 @@ class SvxNumBulletItem;
class SfxItemPool;
class String;
-/** creates a StarOffice API wrapper with the given type and inventor
- Deprecated: This will be replaced with a function returning XShape.
-*/
-SVX_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor ) throw();
-
/** returns a StarOffice API wrapper for the given SdrObject */
SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw ();
diff --git a/svx/inc/svx/unomod.hxx b/svx/inc/svx/unomod.hxx
index 2396090b9d7a..b39579425e32 100644
--- a/svx/inc/svx/unomod.hxx
+++ b/svx/inc/svx/unomod.hxx
@@ -29,7 +29,7 @@
#include <com/sun/star/container/XIndexReplace.hpp>
#include "svx/svxdllapi.h"
-class SdrHint;
+class SdrBaseHint;
class SdrModel;
class SdrModel;
@@ -37,6 +37,10 @@ SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::container::XIn
class SVX_DLLPUBLIC SvxUnoDrawMSFactory : public ::com::sun::star::lang::XMultiServiceFactory
{
+protected:
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModel() const = 0;
+
public:
SvxUnoDrawMSFactory() throw() {};
@@ -50,12 +54,12 @@ public:
concatServiceNames( ::com::sun::star::uno::Sequence< ::rtl::OUString >& rServices1,
::com::sun::star::uno::Sequence< ::rtl::OUString >& rServices2 ) throw();
- /** fills the given EventObject from the given SdrHint.
+ /** fills the given EventObject from the given SdrBaseHint.
@returns
- true if the SdrHint could be translated to an EventObject<br>
+ true if the SdrBaseHint could be translated to an EventObject<br>
false if not
*/
- static sal_Bool createEvent( const SdrModel* pDoc, const SdrHint* pSdrHint, ::com::sun::star::document::EventObject& aEvent );
+ static sal_Bool createEvent( const SdrModel* pDoc, const SdrBaseHint* pSdrHint, ::com::sun::star::document::EventObject& aEvent );
};
#endif
diff --git a/svx/inc/svx/unomodel.hxx b/svx/inc/svx/unomodel.hxx
index d8a6c409f45c..010a6fd7fc94 100644
--- a/svx/inc/svx/unomodel.hxx
+++ b/svx/inc/svx/unomodel.hxx
@@ -59,6 +59,10 @@ private:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
+protected:
+ // SvxUnoDrawMSFactory
+ virtual SdrModel* getSdrModel() const;
+
public:
SvxUnoDrawingModel( SdrModel* pDoc ) throw();
virtual ~SvxUnoDrawingModel() throw();
diff --git a/svx/inc/svx/unopage.hxx b/svx/inc/svx/unopage.hxx
index 98d1d09d1c4e..d46c4c35ce5e 100644
--- a/svx/inc/svx/unopage.hxx
+++ b/svx/inc/svx/unopage.hxx
@@ -45,11 +45,11 @@
#include <comphelper/servicehelper.hxx>
#include <svx/unoprov.hxx>
+#include <svx/unoshape.hxx>
class SdrPage;
class SdrModel;
class SdrView;
-class SdrPageView;
class SdrObject;
class List;
class SvxShapeDescriptor;
@@ -58,6 +58,7 @@ class SvxShapeGroup;
class SvxShapeConnector;
class SvxShapeList;
class SvxDrawPageList;
+class SdrObjectCreationInfo;
/***********************************************************************
* Macros fuer Umrechnung Twips<->100tel mm *
@@ -83,8 +84,8 @@ class SVX_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper5< ::com::sun:
SdrModel* mpModel;
SdrView* mpView;
- void _SelectObjectsInView( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& aShapes, SdrPageView* pPageView ) throw ();
- void _SelectObjectInView( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, SdrPageView* pPageView ) throw();
+ void _SelectObjectsInView( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& aShapes ) throw ();
+ void _SelectObjectInView( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw();
virtual void disposing() throw();
@@ -95,20 +96,22 @@ class SVX_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper5< ::com::sun:
// Internals
SdrPage* GetSdrPage() const { return mpPage; }
- void ChangeModel( SdrModel* pNewModel );
// Erzeugen eines SdrObjects und Einfugen in die SdrPage
SdrObject *CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw();
// Typ und Inventor bestimmen
- void GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor, const ::rtl::OUString& aName ) const throw();
+ SvxShapeKind getSvxShapeKind( const ::rtl::OUString& aName ) const throw();
// Erzeugen eines SdrObjects anhand einer Description. Kann von
// abgeleiteten Klassen dazu benutzt werden, eigene Shapes zu
// unterstuetzen (z.B. Controls)
virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw();
- static SvxShape* CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor, SdrObject *pObj = NULL, SvxDrawPage *pPage = NULL ) throw();
+ static SvxShape* CreateShapeBySvxShapeKind(
+ SvxShapeKind aSvxShapeKind,
+ SdrObject *pObj = 0,
+ SvxDrawPage *pPage = 0) throw();
// Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt
// werden soll. abgeleitete Klassen koennen hier eine Ableitung oder
diff --git a/svx/inc/svx/unoprov.hxx b/svx/inc/svx/unoprov.hxx
index 9f5208ce843c..2d1c250917e0 100644
--- a/svx/inc/svx/unoprov.hxx
+++ b/svx/inc/svx/unoprov.hxx
@@ -27,43 +27,14 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <svl/itemprop.hxx>
#include <tools/list.hxx>
-#include "svx/svxdllapi.h"
+#include <svx/svxdllapi.h>
+#include <editeng/unoipset.hxx>
class SvxItemPropertySet;
class SfxItemPool;
-/***********************************************************************
-* class UHashMap *
-***********************************************************************/
-
-struct UHashMapEntry
-{
- ::rtl::OUString aIdentifier;
- sal_uInt32 nId;
-
- UHashMapEntry(const sal_Char * value, sal_Int32 length, sal_uInt32 _nId) : aIdentifier(value,length,RTL_TEXTENCODING_ASCII_US), nId(_nId) { }
-};
-
-DECLARE_LIST( UHashMapEntryList, UHashMapEntry* )
-
-#define HASHARRAYSIZE 0x10
-#define UHASHMAP_NOTFOUND sal::static_int_cast< sal_uInt32 >(~0)
-
-class UHashMap
-{
-private:
- UHashMapEntryList m_aHashList[HASHARRAYSIZE];
-
-public:
- UHashMap( UHashMapEntry* pMap );
- ~UHashMap() {};
-
- sal_uInt32 getId( const ::rtl::OUString& rCompareString );
-};
-
-/***********************************************************************
-* Soriterer *
-***********************************************************************/
+//////////////////////////////////////////////////////////////////////////////
+// Soriterer
#define SVXMAP_SHAPE 0
#define SVXMAP_CONNECTOR 1
@@ -92,9 +63,11 @@ public:
#define SVXMAP_TABLE 24
#define SVXMAP_PAGE 25
#define SVXMAP_END 26 // last+1 !
+
/***********************************************************************
* SvxUnoPropertyMapProvider *
***********************************************************************/
+
class SVX_DLLPUBLIC SvxUnoPropertyMapProvider
{
SfxItemPropertyMapEntry* aMapArr[SVXMAP_END];
@@ -111,16 +84,15 @@ public:
* Globals *
***********************************************************************/
-const sal_Int16 OBJ_OLE2_APPLET = 100;
-const sal_Int16 OBJ_OLE2_PLUGIN = 101;
-
extern SvxUnoPropertyMapProvider aSvxMapProvider;
-extern UHashMapEntry pSdrShapeIdentifierMap[];
-extern UHashMap aSdrShapeIdentifierMap;
-
-#define E3D_INVENTOR_FLAG (0x80000000)
+//#define E3D_INVENTOR_FLAG (0x80000000)
-#include <editeng/unoipset.hxx>
+// object creation info creator
+//class rtl::OUString;
+//enum SvxShapeKind;
+//SvxShapeKind getSvxShapeKindFromTypeName(const rtl::OUString&);
+//std::vector< rtl::OUString > getAllSvxShapeTypeNames();
+//bool getNameForSvxShapeType(rtl::OUString&, SvxShapeKind);
/***********************************************************************
* class SvxPropertySetInfoPool *
@@ -143,3 +115,5 @@ private:
#endif
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/unoshape.hxx b/svx/inc/svx/unoshape.hxx
index 46aa1485495d..6ac9f9eea507 100644
--- a/svx/inc/svx/unoshape.hxx
+++ b/svx/inc/svx/unoshape.hxx
@@ -51,26 +51,25 @@
#include "svx/svxdllapi.h"
#include <rtl/ref.hxx>
#include <com/sun/star/uno/Any.hxx>
-
#include <svx/svdouno.hxx>
-
#include <comphelper/servicehelper.hxx>
-
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase12.hxx>
-
#include <svx/unoprov.hxx>
+#include <editeng/unotext.hxx>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XShapeGroup.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/drawing/XConnectorShape.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
class SfxItemSet;
class SdrModel;
class SvxDrawPage;
class SvGlobalName;
-// --> OD 2009-01-16 #i59051#
-namespace basegfx
- {
- class B2DPolyPolygon;
- } // end of namespace basegfx
-// <--
+namespace basegfx { class B2DPolyPolygon; }
+namespace basegfx { class B2DHomMatrix; }
class SvxShapeMutex
{
@@ -106,6 +105,47 @@ typedef ::cppu::WeakAggImplHelper12<
::com::sun::star::document::XActionLockable,
::com::sun::star::beans::XMultiPropertyStates> SvxShape_UnoImplHelper;
+enum SvxShapeKind
+{
+ // values with direct mapping to SdrObjKind
+ SvxShapeKind_None, // OBJ_NONE
+ SvxShapeKind_Group, // OBJ_GRUP
+ SvxShapeKind_Rectangle, // OBJ_RECT
+ SvxShapeKind_Circle, // OBJ_CIRC
+ SvxShapeKind_Path, // OBJ_POLY and removed old ones (OBJ_LINE, OBJ_PLIN, OBJ_PATHLINE, OBJ_PATHFILL, OBJ_FREELINE, OBJ_FREEFILL, OBJ_PATHPOLY, OBJ_PATHPLIN)
+ SvxShapeKind_Text, // OBJ_TEXT, OBJ_TITLETEXT, OBJ_OUTLINETEXT
+ SvxShapeKind_Graphic, // OBJ_GRAF
+ SvxShapeKind_OLE2, // OBJ_OLE2
+ SvxShapeKind_Connector, // OBJ_EDGE
+ SvxShapeKind_Caption, // OBJ_CAPTION
+ SvxShapeKind_Page, // OBJ_PAGE
+ SvxShapeKind_Measure, // OBJ_MEASURE
+ SvxShapeKind_Frame, // OBJ_FRAME
+ SvxShapeKind_Control, // OBJ_UNO
+ SvxShapeKind_Customshape, // OBJ_CUSTOMSHAPE
+ SvxShapeKind_Media, // OBJ_MEDIA
+ SvxShapeKind_Table, // OBJ_TABLE
+
+ // values special handling
+ SvxShapeKind_Applet, // OBJ_OLE2_APPLET but special SvxAppletShape
+ SvxShapeKind_Plugin, // OBJ_OLE2_PLUGIN but special SvxPluginShape
+
+ // 3D shapes, mappings to E3D_*_ID
+ SvxShapeKind_3DScene, // E3D_SCENE_ID
+ SvxShapeKind_3DCube, // E3D_CUBEOBJ_ID
+ SvxShapeKind_3DSphere, // E3D_SPHEREOBJ_ID
+ SvxShapeKind_3DExtrude, // E3D_EXTRUDEOBJ_ID
+ SvxShapeKind_3DLathe, // E3D_LATHEOBJ_ID
+ SvxShapeKind_3DPolygon, // E3D_POLYGONOBJ_ID
+};
+
+// converter
+SvxShapeKind SVX_DLLPUBLIC SdrObjectCreatorInventorToSvxShapeKind(sal_uInt16 nIdent, sal_uInt32 nInvent);
+void SvxShapeKindToSdrObjectCreatorInventor(SvxShapeKind aSvxShapeKind, sal_uInt16& nIdent, sal_uInt32& nInvent);
+SvxShapeKind getSvxShapeKindFromTypeName(const rtl::OUString&);
+std::vector< rtl::OUString > getAllSvxShapeTypeNames();
+bool getNameForSvxShapeType(rtl::OUString&, SvxShapeKind);
+
class SVX_DLLPUBLIC SvxShape : public SvxShape_UnoImplHelper,
public SfxListener,
public SvxShapeMutex
@@ -132,13 +172,17 @@ protected:
::tools::WeakReference< SdrObject > mpObj;
SdrModel* mpModel;
+
// Umrechnungen fuer den Writer, der in TWIPS arbeitet
- void ForceMetricToItemPoolMetric(Pair& rPoint) const throw();
- void ForceMetricTo100th_mm(Pair& rPoint) const throw();
- // --> OD 2009-01-16 #i59051#
+ void ForceMetricToItemPoolMetric(basegfx::B2DPoint& rPoint) const throw();
+ void ForceMetricTo100th_mm(basegfx::B2DPoint& rPoint) const throw();
void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
- // <--
+ void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rMatrix) const throw();
+ void ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rMatrix) const throw();
+
+ // check if model is a WriterModel and if anchor is used
+ bool isWriterAnchorUsed() const;
::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap ) const;
@@ -155,9 +199,8 @@ protected:
/** used from the XActionLockable interface */
sal_uInt16 mnLockCount;
- const SfxItemPropertyMapEntry* getPropertyMapEntries() const { return maPropMapEntries; }
+ virtual const SfxItemPropertyMapEntry* getPropertyMapEntries() const;
- void updateShapeKind();
void endSetPropertyValues();
// overide these for special property handling in subcasses. Return true if property is handled
@@ -183,8 +226,6 @@ public:
void TakeSdrObjectOwnership();
bool HasSdrObjectOwnership() const;
- void ChangeModel( SdrModel* pNewModel );
-
void InvalidateSdrObject() { mpObj.reset( NULL ); };
const SvxItemPropertySet& GetPropertySet() { return *mpPropSet; }
SdrObject* GetSdrObject() const {return mpObj.get();}
@@ -194,8 +235,8 @@ public:
::svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
- void setShapeKind( sal_uInt32 nKind );
- sal_uInt32 getShapeKind() const;
+ void setSvxShapeKind(SvxShapeKind eKind);
+ SvxShapeKind getSvxShapeKind() const;
// styles need this
static sal_Bool SAL_CALL SetFillAttribute( sal_Int32 nWID, const ::rtl::OUString& rName, SfxItemSet& rSet, SdrModel* pModel );
@@ -231,12 +272,6 @@ public:
// SfxListener
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw ();
-
- /** @obsolete
- not used anymore
- */
- virtual void onUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect);
-
// XAggregation
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
@@ -327,8 +362,6 @@ private:
SVX_DLLPRIVATE void impl_construct();
};
-#include <editeng/unotext.hxx>
-
class SVX_DLLPUBLIC SvxShapeText : public SvxShape, public SvxUnoTextBase
{
protected:
@@ -393,9 +426,6 @@ public:
// XServiceInfo
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
};
-#include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/drawing/XShapeGroup.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
/***********************************************************************
* *
@@ -451,7 +481,6 @@ public:
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
};
-#include <com/sun/star/drawing/XConnectorShape.hpp>
/***********************************************************************
* *
@@ -491,7 +520,6 @@ public:
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
};
-#include <com/sun/star/drawing/XControlShape.hpp>
/***********************************************************************
* *
@@ -575,6 +603,7 @@ public:
// #i118485# changed parent to SvxShapeText to allow Text handling over UNO API
class SVX_DLLPUBLIC SvxOle2Shape : public SvxShapeText
{
+private:
protected:
// overide these for special property handling in subcasses. Return true if property is handled
virtual bool setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
@@ -596,27 +625,28 @@ public:
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
};
-
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-
/***********************************************************************
* *
***********************************************************************/
class SvxShapePolyPolygon : public SvxShapeText
{
private:
- ::com::sun::star::drawing::PolygonKind mePolygonKind;
+ // quick test if this is a bezier based polygon
+ bool isBezierBased() const;
protected:
using SvxUnoTextRangeBase::setPropertyValue;
using SvxUnoTextRangeBase::getPropertyValue;
+ // depends on polygon type, need to solve this dynamically
+ virtual const SfxItemPropertyMapEntry* getPropertyMapEntries() const;
+
// overide these for special property handling in subcasses. Return true if property is handled
virtual bool setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual bool getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
public:
- SvxShapePolyPolygon( SdrObject* pObj , ::com::sun::star::drawing::PolygonKind eNew = com::sun::star::drawing::PolygonKind_LINE ) throw(com::sun::star::lang::IllegalArgumentException, com::sun::star::beans::PropertyVetoException);
+ SvxShapePolyPolygon( SdrObject* pObj ) throw(com::sun::star::lang::IllegalArgumentException, com::sun::star::beans::PropertyVetoException);
virtual ~SvxShapePolyPolygon() throw();
// Local support functions
@@ -631,36 +661,6 @@ public:
/***********************************************************************
* *
***********************************************************************/
-
-class SvxShapePolyPolygonBezier : public SvxShapeText
-{
-private:
- ::com::sun::star::drawing::PolygonKind mePolygonKind;
-
-protected:
- using SvxUnoTextRangeBase::setPropertyValue;
- using SvxUnoTextRangeBase::getPropertyValue;
-
-public:
- // overide these for special property handling in subcasses. Return true if property is handled
- virtual bool setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual bool getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- SvxShapePolyPolygonBezier( SdrObject* pObj , ::com::sun::star::drawing::PolygonKind eNew = com::sun::star::drawing::PolygonKind_PATHLINE) throw();
- virtual ~SvxShapePolyPolygonBezier() throw();
-
- // Local support functions
- ::com::sun::star::drawing::PolygonKind GetPolygonKind() const throw();
- void SetPolygon(const basegfx::B2DPolyPolygon & rNew) throw();
- basegfx::B2DPolyPolygon GetPolygon() const throw();
-
- // XServiceInfo
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
-};
-
-/***********************************************************************
-* *
-***********************************************************************/
class SvxGraphicObject : public SvxShapeText
{
protected:
@@ -834,7 +834,9 @@ public:
SvxCustomShape( SdrObject* pObj ) throw ();
// overide these for special property handling in subcasses. Return true if property is handled
//virtual bool setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertyMapEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual bool getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // TTTT: Should be obsolete, was only used for rotation angle
+ // virtual bool getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual ~SvxCustomShape() throw ();
diff --git a/svx/inc/svx/unoshprp.hxx b/svx/inc/svx/unoshprp.hxx
index 5c31a0aaa8f4..ec5f6affaaa2 100644
--- a/svx/inc/svx/unoshprp.hxx
+++ b/svx/inc/svx/unoshprp.hxx
@@ -86,7 +86,9 @@
#endif
#endif
-#define OWN_ATTR_VALUE_START_TEXT (OWN_ATTR_VALUE_START+0) // the next 10 entries are reserved for text
+#define OWN_ATTR_VALUE_START_TEXT (OWN_ATTR_VALUE_START+0)
+// the next 10 entries are reserved for text, see editeng\inc\editeng\unotext.hxx
+// where text items are made members of this range
#define OWN_ATTR_VALUE_POLYGONKIND (OWN_ATTR_VALUE_START+10)
#define OWN_ATTR_VALUE_POLYPOLYGON (OWN_ATTR_VALUE_START+11)
#define OWN_ATTR_VALUE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+12)
@@ -186,7 +188,13 @@
#define OWN_ATTR_STYLE (OWN_ATTR_VALUE_START+87)
-#define OWN_ATTR_EDGE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+88) // maximum is OWN_ATTR_VALUE_START+88, see svl/inc/svl/solar.hrc
+#define OWN_ATTR_EDGE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+88)
+
+#define OWN_ATTR_CIRCENDANGLE (OWN_ATTR_VALUE_START+89)
+#define OWN_ATTR_CIRCKIND (OWN_ATTR_VALUE_START+90)
+#define OWN_ATTR_CIRCSTARTANGLE (OWN_ATTR_VALUE_START+91)
+
+// maximum is OWN_ATTR_VALUE_START+188, see svl/inc/svl/solar.hrc
// #FontWork#
#define FONTWORK_PROPERTIES \
@@ -394,9 +402,9 @@
{ MAP_CHAR_LEN("EndPosition"), OWN_ATTR_MEASURE_END_POS, &::getCppuType((const ::com::sun::star::awt::Point*)0), 0, 0},
#define SPECIAL_CIRCLE_PROPERTIES \
- { MAP_CHAR_LEN(UNO_NAME_CIRCENDANGLE), SDRATTR_CIRCENDANGLE, &::getCppuType((const sal_Int32*)0), 0, 0}, \
- { MAP_CHAR_LEN(UNO_NAME_CIRCKIND), SDRATTR_CIRCKIND, &::getCppuType((const ::com::sun::star::drawing::CircleKind*)0), 0, 0}, \
- { MAP_CHAR_LEN(UNO_NAME_CIRCSTARTANGLE),SDRATTR_CIRCSTARTANGLE, &::getCppuType((const sal_Int32*)0), 0, 0},
+ { MAP_CHAR_LEN(UNO_NAME_CIRCENDANGLE), OWN_ATTR_CIRCENDANGLE, &::getCppuType((const sal_Int32*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_CIRCKIND), OWN_ATTR_CIRCKIND, &::getCppuType((const ::com::sun::star::drawing::CircleKind*)0), 0, 0}, \
+ { MAP_CHAR_LEN(UNO_NAME_CIRCSTARTANGLE),OWN_ATTR_CIRCSTARTANGLE, &::getCppuType((const sal_Int32*)0), 0, 0},
#define SPECIAL_POLYGON_PROPERTIES \
{ MAP_CHAR_LEN(UNO_NAME_POLYGONKIND), OWN_ATTR_VALUE_POLYGONKIND, &::getCppuType((const ::com::sun::star::drawing::PolygonKind*)0), ::com::sun::star::beans::PropertyAttribute::READONLY, 0},
diff --git a/svx/inc/svx/unoshtxt.hxx b/svx/inc/svx/unoshtxt.hxx
index d99dd595f2f4..48d3b467a54b 100644
--- a/svx/inc/svx/unoshtxt.hxx
+++ b/svx/inc/svx/unoshtxt.hxx
@@ -84,8 +84,6 @@ public:
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
virtual Point PixelToLogic( const Point&, const MapMode& ) const;
- void ChangeModel( SdrModel* pNewModel );
-
void UpdateOutliner();
private:
diff --git a/svx/inc/svx/view3d.hxx b/svx/inc/svx/view3d.hxx
index a90ed615d784..e2419ca1cb34 100644
--- a/svx/inc/svx/view3d.hxx
+++ b/svx/inc/svx/view3d.hxx
@@ -30,23 +30,19 @@
#include <basegfx/point/b2dpoint.hxx>
#include "svx/svxdllapi.h"
-//************************************************************
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Vorausdeklarationen
-//************************************************************
class E3dObject;
class E3dScene;
class SceneList;
class Impl3DMirrorConstructOverlay;
-/*************************************************************************
-|*
-|* Ableitung von SdrView zur Bearbeitung von 3D-Objekten
-|*
-\************************************************************************/
+////////////////////////////////////////////////////////////////////////////////////////////////////
class SVX_DLLPUBLIC E3dView : public SdrView
{
+private:
protected:
E3dDefaultAttributes a3DDefaultAttr;
MouseEvent aMouseEvent; // Die Parameter der letzten Events (Mouse, Keyboard)
@@ -62,38 +58,39 @@ protected:
double fDefaultExtrusionDeepth; // Extrusionstiefe
double fDefaultLightIntensity; // Intensitaeten der beiden (notwendigen) Licht-
double fDefaultAmbientIntensity; // quellen
- long nHDefaultSegments; // wieviele HSegmente braucht mein Lathe-Ojekt
- long nVDefaultSegments; // wieviele VSegmente braucht mein Lathe-Ojekt
+ sal_Int32 nHDefaultSegments; // wieviele HSegmente braucht mein Lathe-Ojekt
+ sal_Int32 nVDefaultSegments; // wieviele VSegmente braucht mein Lathe-Ojekt
E3dDragConstraint eDragConstraint;
// Migrate selections
Impl3DMirrorConstructOverlay* mpMirrorOverlay;
- sal_Bool bDoubleSided;
+ /// bitfield
+ bool bDoubleSided : 1;
void InitView();
- void ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
- void ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal_Bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
+ void ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
+ void ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat);
void ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj);
void ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj);
void InitScene(E3dScene* pScene, double fW, double fH, double fCamZ);
- void ImpIsConvertTo3DPossible(SdrObject* pObj, sal_Bool& rAny3D, sal_Bool& rGroupSelected) const;
+ void ImpIsConvertTo3DPossible(SdrObject* pObj, bool& rAny3D, bool& rGroupSelected) const;
void BreakSingle3DObj(E3dObject* pObj);
public:
- TYPEINFO();
- E3dView(SdrModel* pModel, OutputDevice* pOut = 0L);
+ E3dView(SdrModel& rModel, OutputDevice* pOut = 0);
virtual ~E3dView();
// Alle markierten Objekte auf dem angegebenen OutputDevice ausgeben.
virtual void DrawMarkedObj(OutputDevice& rOut) const;
// Zugriff auf die Default-Attribute
- E3dDefaultAttributes& Get3DDefaultAttributes() { return a3DDefaultAttr; }
- virtual sal_Bool BegDragObj(const Point& rPnt, OutputDevice* pOut = NULL, SdrHdl* pHdl = NULL, short nMinMov = -3, SdrDragMethod* pForcedMeth = NULL);
+ const E3dDefaultAttributes& Get3DDefaultAttributes() const { return a3DDefaultAttr; }
+ virtual bool BegDragObj(const basegfx::B2DPoint& rPnt, const SdrHdl* pHdl = 0, double fMinMovLogic = 3.0,
+ SdrDragMethod* pForcedMeth = 0);
virtual void CheckPossibilities();
// Event setzen/rausruecken
@@ -107,29 +104,29 @@ public:
// Bei Paste muss - falls in eine Scene eingefuegt wird - die
// Objekte der Szene eingefuegt werden, die Szene selbst aber nicht
using SdrView::Paste;
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ virtual bool Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pLst = 0, sal_uInt32 nOptions = 0);
// #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
- sal_Bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
+ bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene);
- sal_Bool HasMarkedScene();
+ bool HasMarkedScene();
E3dScene* GetMarkedScene();
- sal_Bool IsConvertTo3DObjPossible() const;
- void ConvertMarkedObjTo3D(sal_Bool bExtrude=sal_True, basegfx::B2DPoint aPnt1 = basegfx::B2DPoint(0.0, 0.0), basegfx::B2DPoint aPnt2 = basegfx::B2DPoint(0.0, 1.0));
+ bool IsConvertTo3DObjPossible() const;
+ void ConvertMarkedObjTo3D(bool bExtrude=true, basegfx::B2DPoint aPnt1 = basegfx::B2DPoint(0.0, 0.0), basegfx::B2DPoint aPnt2 = basegfx::B2DPoint(0.0, 1.0));
// Nachtraeglichhe Korrekturmoeglichkeit um alle Extrudes in einer
// bestimmten Tiefensortierung anzulegen
void DoDepthArrange(E3dScene* pScene, double fDepth);
- void ConvertMarkedToPolyObj(sal_Bool bLineToArea);
+ void ConvertMarkedToPolyObj(bool bLineToArea);
E3dScene* SetCurrent3DObj(E3dObject* p3DObj);
void Start3DCreation();
// migration of overlay
sal_Bool Is3DRotationCreationActive() const { return (0L != mpMirrorOverlay); }
- virtual void MovAction(const Point& rPnt);
- void End3DCreation(sal_Bool bUseDefaultValuesForMirrorAxes=sal_False);
+ virtual void MovAction(const basegfx::B2DPoint& rPnt);
+ void End3DCreation(bool bUseDefaultValuesForMirrorAxes=false);
void ResetCreationActive();
double GetDefaultCamPosZ();
@@ -246,28 +243,25 @@ public:
return aDefaultAmbientColor;
}
- long GetHDefaultSegments() const { return nHDefaultSegments; }
- void SetHDefaultSegments(long nSegs) { nHDefaultSegments = nSegs; }
+ sal_Int32 GetHDefaultSegments() const { return nHDefaultSegments; }
+ void SetHDefaultSegments(sal_Int32 nSegs) { nHDefaultSegments = nSegs; }
- long GetVDefaultSegments() const { return nVDefaultSegments; }
- void SetVDefaultSegments(long nSegs) { nVDefaultSegments = nSegs; }
+ sal_Int32 GetVDefaultSegments() const { return nVDefaultSegments; }
+ void SetVDefaultSegments(sal_Int32 nSegs) { nVDefaultSegments = nSegs; }
- sal_Bool IsBreak3DObjPossible() const;
+ bool IsBreak3DObjPossible() const;
void Break3DObj();
- sal_Bool DoubleSided () const
+ bool DoubleSided () const
{
return bDoubleSided;
}
- sal_Bool &DoubleSided ()
- {
- return bDoubleSided;
- }
-
- void MergeScenes();
- SfxItemSet Get3DAttributes(E3dScene* pInScene = NULL, sal_Bool bOnly3DAttr=sal_False) const;
- void Set3DAttributes(const SfxItemSet& rAttr, E3dScene* pInScene = NULL, sal_Bool bOnly3DAttr=sal_False);
+ SfxItemSet Get3DAttributes(E3dScene* pInScene = NULL) const;
+ void Set3DAttributes(const SfxItemSet& rAttr, E3dScene* pInScene = NULL, bool bOnly3DAttr=false);
};
#endif // _E3D_VIEW3D_HXX
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/inc/svx/viewlayoutitem.hxx b/svx/inc/svx/viewlayoutitem.hxx
index 4dad67f4374c..12b226bb7a79 100644
--- a/svx/inc/svx/viewlayoutitem.hxx
+++ b/svx/inc/svx/viewlayoutitem.hxx
@@ -36,8 +36,7 @@ class SVX_DLLPUBLIC SvxViewLayoutItem: public SfxUInt16Item
bool mbBookMode;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SvxViewLayoutItem( sal_uInt16 nColumns = 0, bool bBookMode = false, sal_uInt16 nWhich = SID_ATTR_VIEWLAYOUT );
SvxViewLayoutItem( const SvxViewLayoutItem& );
~SvxViewLayoutItem();
diff --git a/svx/inc/svx/xbtmpit.hxx b/svx/inc/svx/xbtmpit.hxx
index 4f0c661e7e72..75e253399d97 100644
--- a/svx/inc/svx/xbtmpit.hxx
+++ b/svx/inc/svx/xbtmpit.hxx
@@ -44,7 +44,7 @@ private:
GraphicObject maGraphicObject;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFillBitmapItem() : NameOrIndex(XATTR_FILLBITMAP, -1 ) {}
XFillBitmapItem(long nIndex, const GraphicObject& rGraphicObject);
XFillBitmapItem(const String& rName, const GraphicObject& rGraphicObject);
diff --git a/svx/inc/svx/xcolit.hxx b/svx/inc/svx/xcolit.hxx
index 0c6f4b843e2e..3e392359399a 100644
--- a/svx/inc/svx/xcolit.hxx
+++ b/svx/inc/svx/xcolit.hxx
@@ -39,7 +39,6 @@ class SVX_DLLPUBLIC XColorItem : public NameOrIndex
Color aColor;
public:
- TYPEINFO();
XColorItem() {}
XColorItem(sal_uInt16 nWhich, sal_Int32 nIndex, const Color& rTheColor);
diff --git a/svx/inc/svx/xexch.hxx b/svx/inc/svx/xexch.hxx
index ec973ffddadd..cd06c9bec162 100644
--- a/svx/inc/svx/xexch.hxx
+++ b/svx/inc/svx/xexch.hxx
@@ -44,8 +44,6 @@ private:
SfxItemPool* pPool;
public:
- TYPEINFO();
-
XFillExchangeData();
XFillExchangeData(const XFillAttrSetItem rXFillAttrSetItem);
virtual ~XFillExchangeData();
diff --git a/svx/inc/svx/xfillit0.hxx b/svx/inc/svx/xfillit0.hxx
index c2db2dc4919b..4348ae599a97 100644
--- a/svx/inc/svx/xfillit0.hxx
+++ b/svx/inc/svx/xfillit0.hxx
@@ -37,7 +37,7 @@
class SVX_DLLPUBLIC XFillStyleItem : public SfxEnumItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFillStyleItem(XFillStyle = XFILL_SOLID);
XFillStyleItem(SvStream& rIn);
diff --git a/svx/inc/svx/xflasit.hxx b/svx/inc/svx/xflasit.hxx
index d7165f3b756a..7429b876287c 100644
--- a/svx/inc/svx/xflasit.hxx
+++ b/svx/inc/svx/xflasit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillAttrSetItem : public SfxSetItem
{
public:
- TYPEINFO();
XFillAttrSetItem(SfxItemSet* pItemSet );
XFillAttrSetItem(SfxItemPool* pItemPool);
XFillAttrSetItem(const XFillAttrSetItem& rAttr);
diff --git a/svx/inc/svx/xflbckit.hxx b/svx/inc/svx/xflbckit.hxx
index 1be4a540566b..4020d8ddd149 100644
--- a/svx/inc/svx/xflbckit.hxx
+++ b/svx/inc/svx/xflbckit.hxx
@@ -36,8 +36,6 @@
class SVX_DLLPUBLIC XFillBackgroundItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
XFillBackgroundItem( sal_Bool bFill = sal_False );
SVX_DLLPRIVATE XFillBackgroundItem( SvStream& rIn );
diff --git a/svx/inc/svx/xflbmpit.hxx b/svx/inc/svx/xflbmpit.hxx
index 299285d29224..88394fe201f8 100644
--- a/svx/inc/svx/xflbmpit.hxx
+++ b/svx/inc/svx/xflbmpit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillBmpPosItem : public SfxEnumItem
{
public:
- TYPEINFO();
XFillBmpPosItem( RECT_POINT eRP = RP_MM );
SVX_DLLPRIVATE XFillBmpPosItem( SvStream& rIn );
diff --git a/svx/inc/svx/xflbmsli.hxx b/svx/inc/svx/xflbmsli.hxx
index 11ccf63dec8e..54d76271b73e 100644
--- a/svx/inc/svx/xflbmsli.hxx
+++ b/svx/inc/svx/xflbmsli.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillBmpSizeLogItem : public SfxBoolItem
{
public:
- TYPEINFO();
XFillBmpSizeLogItem( sal_Bool bLog = sal_True );
SVX_DLLPRIVATE XFillBmpSizeLogItem( SvStream& rIn );
diff --git a/svx/inc/svx/xflbmsxy.hxx b/svx/inc/svx/xflbmsxy.hxx
index 4ec6214f59ce..61716fae94f2 100644
--- a/svx/inc/svx/xflbmsxy.hxx
+++ b/svx/inc/svx/xflbmsxy.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillBmpSizeXItem : public SfxMetricItem
{
public:
- TYPEINFO();
XFillBmpSizeXItem( long nSizeX = 0 );
SVX_DLLPRIVATE XFillBmpSizeXItem( SvStream& rIn );
@@ -51,7 +50,7 @@ public:
// Dieses Item nimmt sowohl metrische als auch
// Prozentwerte ( sind negativ ) auf; das muessen
// wir hier beruecksichtigen
- SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const;
+ SVX_DLLPRIVATE virtual bool HasMetrics() const;
};
/*************************************************************************
@@ -63,7 +62,6 @@ public:
class SVX_DLLPUBLIC XFillBmpSizeYItem : public SfxMetricItem
{
public:
- TYPEINFO();
XFillBmpSizeYItem( long nSizeY = 0 );
SVX_DLLPRIVATE XFillBmpSizeYItem( SvStream& rIn );
@@ -78,7 +76,7 @@ public:
// Dieses Item nimmt sowohl metrische als auch
// Prozentwerte ( sind negativ ) auf; das muessen
// wir hier beruecksichtigen
- SVX_DLLPRIVATE virtual FASTBOOL HasMetrics() const;
+ SVX_DLLPRIVATE virtual bool HasMetrics() const;
};
#endif
diff --git a/svx/inc/svx/xflbmtit.hxx b/svx/inc/svx/xflbmtit.hxx
index a39fd672ea4f..7c6cbf5854d0 100644
--- a/svx/inc/svx/xflbmtit.hxx
+++ b/svx/inc/svx/xflbmtit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillBmpTileItem : public SfxBoolItem
{
public:
- TYPEINFO();
XFillBmpTileItem( sal_Bool bTile = sal_True );
XFillBmpTileItem( SvStream& rIn );
diff --git a/svx/inc/svx/xflboxy.hxx b/svx/inc/svx/xflboxy.hxx
index 3c6b3e6ad6b4..51734a50554e 100644
--- a/svx/inc/svx/xflboxy.hxx
+++ b/svx/inc/svx/xflboxy.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillBmpPosOffsetXItem : public SfxUInt16Item
{
public:
- TYPEINFO();
XFillBmpPosOffsetXItem( sal_uInt16 nOffPosX = 0 );
SVX_DLLPRIVATE XFillBmpPosOffsetXItem( SvStream& rIn );
@@ -59,7 +58,6 @@ public:
class SVX_DLLPUBLIC XFillBmpPosOffsetYItem : public SfxUInt16Item
{
public:
- TYPEINFO();
XFillBmpPosOffsetYItem( sal_uInt16 nOffPosY = 0 );
SVX_DLLPRIVATE XFillBmpPosOffsetYItem( SvStream& rIn );
diff --git a/svx/inc/svx/xflbstit.hxx b/svx/inc/svx/xflbstit.hxx
index 189702eb377e..d193f60a5c20 100644
--- a/svx/inc/svx/xflbstit.hxx
+++ b/svx/inc/svx/xflbstit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillBmpStretchItem : public SfxBoolItem
{
public:
- TYPEINFO();
XFillBmpStretchItem( sal_Bool bStretch = sal_True );
XFillBmpStretchItem( SvStream& rIn );
diff --git a/svx/inc/svx/xflbtoxy.hxx b/svx/inc/svx/xflbtoxy.hxx
index adf1d1daead2..31de758abb8e 100644
--- a/svx/inc/svx/xflbtoxy.hxx
+++ b/svx/inc/svx/xflbtoxy.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillBmpTileOffsetXItem : public SfxUInt16Item
{
public:
- TYPEINFO();
XFillBmpTileOffsetXItem( sal_uInt16 nOffX = 0 );
SVX_DLLPRIVATE XFillBmpTileOffsetXItem( SvStream& rIn );
@@ -59,7 +58,6 @@ public:
class SVX_DLLPUBLIC XFillBmpTileOffsetYItem : public SfxUInt16Item
{
public:
- TYPEINFO();
XFillBmpTileOffsetYItem( sal_uInt16 nOffX = 0 );
SVX_DLLPRIVATE XFillBmpTileOffsetYItem( SvStream& rIn );
diff --git a/svx/inc/svx/xflclit.hxx b/svx/inc/svx/xflclit.hxx
index 62b95757a362..52ba5929d70b 100644
--- a/svx/inc/svx/xflclit.hxx
+++ b/svx/inc/svx/xflclit.hxx
@@ -37,7 +37,7 @@
class SVX_DLLPUBLIC XFillColorItem : public XColorItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFillColorItem() {}
XFillColorItem(sal_Int32 nIndex, const Color& rTheColor);
XFillColorItem(const String& rName, const Color& rTheColor);
diff --git a/svx/inc/svx/xflftrit.hxx b/svx/inc/svx/xflftrit.hxx
index 2be4cd63ba46..6e3b064e602c 100644
--- a/svx/inc/svx/xflftrit.hxx
+++ b/svx/inc/svx/xflftrit.hxx
@@ -40,8 +40,6 @@ private:
sal_Bool bEnabled;
public:
- TYPEINFO();
-
XFillFloatTransparenceItem();
XFillFloatTransparenceItem( sal_Int32 nIndex, const XGradient& rGradient, sal_Bool bEnable = sal_True );
XFillFloatTransparenceItem(const String& rName, const XGradient& rGradient, sal_Bool bEnable = sal_True );
diff --git a/svx/inc/svx/xflgrit.hxx b/svx/inc/svx/xflgrit.hxx
index a55862f94389..3c52c47535e3 100644
--- a/svx/inc/svx/xflgrit.hxx
+++ b/svx/inc/svx/xflgrit.hxx
@@ -38,7 +38,7 @@ class SVX_DLLPUBLIC XFillGradientItem : public NameOrIndex
XGradient aGradient;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {}
XFillGradientItem(sal_Int32 nIndex, const XGradient& rTheGradient);
XFillGradientItem(const UniString& rName, const XGradient& rTheGradient);
diff --git a/svx/inc/svx/xflhtit.hxx b/svx/inc/svx/xflhtit.hxx
index ddf367059949..53638c536a5c 100644
--- a/svx/inc/svx/xflhtit.hxx
+++ b/svx/inc/svx/xflhtit.hxx
@@ -38,7 +38,7 @@ class SVX_DLLPUBLIC XFillHatchItem : public NameOrIndex
XHatch aHatch;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFillHatchItem() : NameOrIndex(XATTR_FILLHATCH, -1) {}
XFillHatchItem(sal_Int32 nIndex, const XHatch& rTheHatch);
XFillHatchItem(const String& rName, const XHatch& rTheHatch);
@@ -58,11 +58,11 @@ public:
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- virtual FASTBOOL HasMetrics() const;
- virtual FASTBOOL ScaleMetrics(long nMul, long nDiv);
+ virtual bool HasMetrics() const;
+ virtual void ScaleMetrics(long nMul, long nDiv);
- const XHatch& GetHatchValue(const XHatchTable* pTable = 0) const; // GetValue -> GetHatchValue
- void SetHatchValue(const XHatch& rNew) { aHatch = rNew; Detach(); } // SetValue -> SetHatchValue
+ const XHatch& GetHatchValue(const XHatchTable* pTable = 0) const; // GetValue -> GetHatchValue
+ void SetHatchValue(const XHatch& rNew) { aHatch = rNew; Detach(); } // SetValue -> SetHatchValue
static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
XFillHatchItem* checkForUniqueItem( SdrModel* pModel ) const;
diff --git a/svx/inc/svx/xfltrit.hxx b/svx/inc/svx/xfltrit.hxx
index 122771befac3..0b41921ff389 100644
--- a/svx/inc/svx/xfltrit.hxx
+++ b/svx/inc/svx/xfltrit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XFillTransparenceItem: public SfxUInt16Item
{
public:
- TYPEINFO();
XFillTransparenceItem(sal_uInt16 nFillTransparence = 0);
XFillTransparenceItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
diff --git a/svx/inc/svx/xftadit.hxx b/svx/inc/svx/xftadit.hxx
index 6c781eb375c2..7a26da8a65ba 100644
--- a/svx/inc/svx/xftadit.hxx
+++ b/svx/inc/svx/xftadit.hxx
@@ -36,7 +36,7 @@
class SVX_DLLPUBLIC XFormTextAdjustItem : public SfxEnumItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextAdjustItem(XFormTextAdjust = XFT_CENTER);
XFormTextAdjustItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xftdiit.hxx b/svx/inc/svx/xftdiit.hxx
index 37046f31f0ab..ade40a26760f 100644
--- a/svx/inc/svx/xftdiit.hxx
+++ b/svx/inc/svx/xftdiit.hxx
@@ -36,7 +36,7 @@
class SVX_DLLPUBLIC XFormTextDistanceItem : public SfxMetricItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextDistanceItem(long nDist = 0);
XFormTextDistanceItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xftmrit.hxx b/svx/inc/svx/xftmrit.hxx
index bd8525679ec0..68b311166dcd 100644
--- a/svx/inc/svx/xftmrit.hxx
+++ b/svx/inc/svx/xftmrit.hxx
@@ -36,7 +36,7 @@
class SVX_DLLPUBLIC XFormTextMirrorItem : public SfxBoolItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextMirrorItem(sal_Bool bMirror = sal_False);
XFormTextMirrorItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xftouit.hxx b/svx/inc/svx/xftouit.hxx
index e502f86571d8..53e2b7c04228 100644
--- a/svx/inc/svx/xftouit.hxx
+++ b/svx/inc/svx/xftouit.hxx
@@ -35,7 +35,7 @@
class SVX_DLLPUBLIC XFormTextOutlineItem : public SfxBoolItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextOutlineItem(sal_Bool bOutline = sal_False);
XFormTextOutlineItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xftsfit.hxx b/svx/inc/svx/xftsfit.hxx
index 1b747e5cdfcd..e73c9564118f 100644
--- a/svx/inc/svx/xftsfit.hxx
+++ b/svx/inc/svx/xftsfit.hxx
@@ -35,7 +35,7 @@
class SVX_DLLPUBLIC XFormTextStdFormItem : public SfxEnumItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextStdFormItem(XFormTextStdForm = XFTFORM_NONE);
XFormTextStdFormItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xftshcit.hxx b/svx/inc/svx/xftshcit.hxx
index fee4adc27af1..cc1363c11b96 100644
--- a/svx/inc/svx/xftshcit.hxx
+++ b/svx/inc/svx/xftshcit.hxx
@@ -36,7 +36,7 @@
class SVX_DLLPUBLIC XFormTextShadowColorItem : public XColorItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextShadowColorItem() {}
XFormTextShadowColorItem(sal_Int32 nIndex, const Color& rTheColor);
XFormTextShadowColorItem(const String& rName, const Color& rTheColor);
diff --git a/svx/inc/svx/xftshit.hxx b/svx/inc/svx/xftshit.hxx
index 3da05a09bafc..5a3d5217e076 100644
--- a/svx/inc/svx/xftshit.hxx
+++ b/svx/inc/svx/xftshit.hxx
@@ -36,7 +36,7 @@
class SVX_DLLPUBLIC XFormTextShadowItem : public SfxEnumItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextShadowItem(XFormTextShadow = XFTSHADOW_NONE);
XFormTextShadowItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xftshtit.hxx b/svx/inc/svx/xftshtit.hxx
index fe516d65ec4b..c085fc87ed3a 100644
--- a/svx/inc/svx/xftshtit.hxx
+++ b/svx/inc/svx/xftshtit.hxx
@@ -35,7 +35,6 @@
class XFormTextShadowTranspItem: public SfxUInt16Item
{
public:
- TYPEINFO();
XFormTextShadowTranspItem(sal_uInt16 nShdwTransparence = 0);
XFormTextShadowTranspItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
diff --git a/svx/inc/svx/xftshxy.hxx b/svx/inc/svx/xftshxy.hxx
index cf48214c85a8..3124abc4f113 100644
--- a/svx/inc/svx/xftshxy.hxx
+++ b/svx/inc/svx/xftshxy.hxx
@@ -36,7 +36,7 @@
class SVX_DLLPUBLIC XFormTextShadowXValItem : public SfxMetricItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextShadowXValItem(long nVal = 0);
XFormTextShadowXValItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
@@ -52,7 +52,7 @@ public:
class SVX_DLLPUBLIC XFormTextShadowYValItem : public SfxMetricItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextShadowYValItem(long nVal = 0);
XFormTextShadowYValItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xftstit.hxx b/svx/inc/svx/xftstit.hxx
index 1bc8f30409fa..202c321e0f30 100644
--- a/svx/inc/svx/xftstit.hxx
+++ b/svx/inc/svx/xftstit.hxx
@@ -36,7 +36,7 @@
class SVX_DLLPUBLIC XFormTextStartItem : public SfxMetricItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextStartItem(long nStart = 0);
XFormTextStartItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xgrscit.hxx b/svx/inc/svx/xgrscit.hxx
index 7fda457a955e..e29148ad13ac 100644
--- a/svx/inc/svx/xgrscit.hxx
+++ b/svx/inc/svx/xgrscit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XGradientStepCountItem: public SfxUInt16Item
{
public:
- TYPEINFO();
XGradientStepCountItem( sal_uInt16 nStepCount = 0 );
XGradientStepCountItem( SvStream& rIn );
virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
diff --git a/svx/inc/svx/xit.hxx b/svx/inc/svx/xit.hxx
index 67580505f21a..5c1874ea8b78 100644
--- a/svx/inc/svx/xit.hxx
+++ b/svx/inc/svx/xit.hxx
@@ -53,7 +53,6 @@ protected:
void Detach() { nPalIndex = -1; }
public:
- TYPEINFO();
NameOrIndex() { nPalIndex = -1; }
NameOrIndex(sal_uInt16 nWhich, sal_Int32 nIndex);
NameOrIndex(sal_uInt16 nWhich,
diff --git a/svx/inc/svx/xlineit0.hxx b/svx/inc/svx/xlineit0.hxx
index 67c09abba246..52f6459d30e3 100644
--- a/svx/inc/svx/xlineit0.hxx
+++ b/svx/inc/svx/xlineit0.hxx
@@ -34,7 +34,7 @@
class SVX_DLLPUBLIC XLineStyleItem : public SfxEnumItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XLineStyleItem(XLineStyle = XLINE_SOLID);
XLineStyleItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xlinjoit.hxx b/svx/inc/svx/xlinjoit.hxx
index 7b45dbd0fd74..9df59fb0d3b6 100644
--- a/svx/inc/svx/xlinjoit.hxx
+++ b/svx/inc/svx/xlinjoit.hxx
@@ -35,7 +35,6 @@
class SVX_DLLPUBLIC XLineJointItem : public SfxEnumItem
{
public:
- TYPEINFO();
XLineJointItem( XLineJoint eLineJoint = XLINEJOINT_ROUND );
XLineJointItem( SvStream& rIn );
diff --git a/svx/inc/svx/xlnasit.hxx b/svx/inc/svx/xlnasit.hxx
index be315f2d7df4..76392a2eae12 100644
--- a/svx/inc/svx/xlnasit.hxx
+++ b/svx/inc/svx/xlnasit.hxx
@@ -37,7 +37,6 @@
class SVX_DLLPUBLIC XLineAttrSetItem : public SfxSetItem
{
public:
- TYPEINFO();
XLineAttrSetItem(SfxItemSet* pItemSet );
XLineAttrSetItem(SfxItemPool* pItemPool);
XLineAttrSetItem(const XLineAttrSetItem& rAttr);
diff --git a/svx/inc/svx/xlncapit.hxx b/svx/inc/svx/xlncapit.hxx
index 1949e9fda419..df159e93fc1e 100644
--- a/svx/inc/svx/xlncapit.hxx
+++ b/svx/inc/svx/xlncapit.hxx
@@ -28,13 +28,12 @@
#include <com/sun/star/drawing/LineCap.hpp>
//---------------------
-// class LineStyleItem
+// class LineCapItem
//---------------------
class SVX_DLLPUBLIC XLineCapItem : public SfxEnumItem
{
public:
- TYPEINFO();
XLineCapItem(com::sun::star::drawing::LineCap eLineCap = com::sun::star::drawing::LineCap_BUTT);
XLineCapItem(SvStream& rIn);
diff --git a/svx/inc/svx/xlnclit.hxx b/svx/inc/svx/xlnclit.hxx
index e3a54fe75955..e02dac9899ae 100644
--- a/svx/inc/svx/xlnclit.hxx
+++ b/svx/inc/svx/xlnclit.hxx
@@ -33,7 +33,7 @@
class SVX_DLLPUBLIC XLineColorItem : public XColorItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XLineColorItem() {}
XLineColorItem(sal_Int32 nIndex, const Color& rTheColor);
XLineColorItem(const String& rName, const Color& rTheColor);
diff --git a/svx/inc/svx/xlndsit.hxx b/svx/inc/svx/xlndsit.hxx
index c7d83fed2396..26a7ff2fb7a5 100644
--- a/svx/inc/svx/xlndsit.hxx
+++ b/svx/inc/svx/xlndsit.hxx
@@ -41,7 +41,7 @@ class SVX_DLLPUBLIC XLineDashItem : public NameOrIndex
XDash aDash;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XLineDashItem() : NameOrIndex(XATTR_LINEDASH, -1) {}
XLineDashItem(sal_Int32 nIndex, const XDash& rTheDash);
XLineDashItem(const String& rName, const XDash& rTheDash);
@@ -62,8 +62,8 @@ public:
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
String &rText, const IntlWrapper * = 0 ) const;
- virtual FASTBOOL HasMetrics() const;
- virtual FASTBOOL ScaleMetrics(long nMul, long nDiv);
+ virtual bool HasMetrics() const;
+ virtual void ScaleMetrics(long nMul, long nDiv);
const XDash& GetDashValue(const XDashTable* pTable = 0) const; // GetValue -> GetDashValue
void SetDashValue(const XDash& rNew) { aDash = rNew; Detach(); } // SetValue -> SetDashValue
diff --git a/svx/inc/svx/xlnedcit.hxx b/svx/inc/svx/xlnedcit.hxx
index e336642fad15..ee1473225411 100644
--- a/svx/inc/svx/xlnedcit.hxx
+++ b/svx/inc/svx/xlnedcit.hxx
@@ -33,7 +33,6 @@
class SVX_DLLPUBLIC XLineEndCenterItem : public SfxBoolItem
{
public:
- TYPEINFO();
XLineEndCenterItem(sal_Bool bEndCenter = sal_False);
XLineEndCenterItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xlnedit.hxx b/svx/inc/svx/xlnedit.hxx
index 7b50ce8446d7..3f65f7bfd3b2 100644
--- a/svx/inc/svx/xlnedit.hxx
+++ b/svx/inc/svx/xlnedit.hxx
@@ -38,7 +38,7 @@ class SVX_DLLPUBLIC XLineEndItem : public NameOrIndex
basegfx::B2DPolyPolygon maPolyPolygon;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XLineEndItem(sal_Int32 nIndex = -1);
XLineEndItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
XLineEndItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
diff --git a/svx/inc/svx/xlnedwit.hxx b/svx/inc/svx/xlnedwit.hxx
index e2bfeb3725f9..e2536f5464a9 100644
--- a/svx/inc/svx/xlnedwit.hxx
+++ b/svx/inc/svx/xlnedwit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XLineEndWidthItem : public SfxMetricItem
{
public:
- TYPEINFO();
XLineEndWidthItem(long nWidth = LINE_END_WIDTH_DEFAULT);
XLineEndWidthItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xlnstcit.hxx b/svx/inc/svx/xlnstcit.hxx
index dd29776b765d..75b054f82213 100644
--- a/svx/inc/svx/xlnstcit.hxx
+++ b/svx/inc/svx/xlnstcit.hxx
@@ -33,7 +33,6 @@
class SVX_DLLPUBLIC XLineStartCenterItem : public SfxBoolItem
{
public:
- TYPEINFO();
XLineStartCenterItem(sal_Bool bStartCenter = sal_False);
XLineStartCenterItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xlnstit.hxx b/svx/inc/svx/xlnstit.hxx
index 270b0a509c44..8afe421ec427 100644
--- a/svx/inc/svx/xlnstit.hxx
+++ b/svx/inc/svx/xlnstit.hxx
@@ -38,7 +38,7 @@ class SVX_DLLPUBLIC XLineStartItem : public NameOrIndex
basegfx::B2DPolyPolygon maPolyPolygon;
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XLineStartItem(sal_Int32 nIndex = -1);
XLineStartItem(const String& rName, const basegfx::B2DPolyPolygon& rPolyPolygon);
XLineStartItem(SfxItemPool* pPool, const basegfx::B2DPolyPolygon& rPolyPolygon);
diff --git a/svx/inc/svx/xlnstwit.hxx b/svx/inc/svx/xlnstwit.hxx
index 7661536c5f8e..e749ee24af30 100644
--- a/svx/inc/svx/xlnstwit.hxx
+++ b/svx/inc/svx/xlnstwit.hxx
@@ -35,7 +35,6 @@
class SVX_DLLPUBLIC XLineStartWidthItem : public SfxMetricItem
{
public:
- TYPEINFO();
XLineStartWidthItem(long nWidth = LINE_START_WIDTH_DEFAULT);
XLineStartWidthItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xlntrit.hxx b/svx/inc/svx/xlntrit.hxx
index 21a16e4be449..3c5db8d2db8e 100644
--- a/svx/inc/svx/xlntrit.hxx
+++ b/svx/inc/svx/xlntrit.hxx
@@ -36,7 +36,6 @@
class SVX_DLLPUBLIC XLineTransparenceItem: public SfxUInt16Item
{
public:
- TYPEINFO();
XLineTransparenceItem(sal_uInt16 nLineTransparence = 0);
XLineTransparenceItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const;
diff --git a/svx/inc/svx/xlnwtit.hxx b/svx/inc/svx/xlnwtit.hxx
index 788adc39c0fd..b8e24ce8c7c7 100644
--- a/svx/inc/svx/xlnwtit.hxx
+++ b/svx/inc/svx/xlnwtit.hxx
@@ -33,7 +33,7 @@
class SVX_DLLPUBLIC XLineWidthItem : public SfxMetricItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XLineWidthItem(long nWidth = 0);
XLineWidthItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/xsflclit.hxx b/svx/inc/svx/xsflclit.hxx
index f482bc9bdb2a..24300a810617 100644
--- a/svx/inc/svx/xsflclit.hxx
+++ b/svx/inc/svx/xsflclit.hxx
@@ -32,7 +32,6 @@
class SVX_DLLPUBLIC XSecondaryFillColorItem : public XColorItem
{
public:
- TYPEINFO();
SVX_DLLPRIVATE XSecondaryFillColorItem() {}
SVX_DLLPRIVATE XSecondaryFillColorItem(sal_Int32 nIndex, const Color& rTheColor);
XSecondaryFillColorItem(const String& rName, const Color& rTheColor);
diff --git a/svx/inc/svx/xtextit0.hxx b/svx/inc/svx/xtextit0.hxx
index 969a09ea0594..f245fb1ad535 100644
--- a/svx/inc/svx/xtextit0.hxx
+++ b/svx/inc/svx/xtextit0.hxx
@@ -37,7 +37,7 @@
class SVX_DLLPUBLIC XFormTextStyleItem : public SfxEnumItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextStyleItem(XFormTextStyle = XFT_NONE);
XFormTextStyleItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
@@ -58,7 +58,7 @@ public:
class SVX_DLLPUBLIC XFormTextHideFormItem : public SfxBoolItem
{
public:
- TYPEINFO();
+ POOLITEM_FACTORY()
XFormTextHideFormItem(sal_Bool bHide = sal_False);
XFormTextHideFormItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const;
diff --git a/svx/inc/svx/zoomitem.hxx b/svx/inc/svx/zoomitem.hxx
index 53d71d31a78c..21841b8361f0 100644
--- a/svx/inc/svx/zoomitem.hxx
+++ b/svx/inc/svx/zoomitem.hxx
@@ -48,8 +48,7 @@ class SVX_DLLPUBLIC SvxZoomItem: public SfxUInt16Item
SvxZoomType eType;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SvxZoomItem( SvxZoomType eZoomType = SVX_ZOOM_PERCENT,
sal_uInt16 nVal = 0, sal_uInt16 nWhich = SID_ATTR_ZOOM );
SvxZoomItem( const SvxZoomItem& );
@@ -57,7 +56,7 @@ public:
void SetValueSet( sal_uInt16 nValues ) { nValueSet = nValues; }
sal_uInt16 GetValueSet() const { return nValueSet; }
- FASTBOOL IsValueAllowed( sal_uInt16 nValue ) const
+ bool IsValueAllowed( sal_uInt16 nValue ) const
{ return nValue == ( nValue & nValueSet ); }
SvxZoomType GetType() const { return eType; }
diff --git a/svx/inc/svx/zoomslideritem.hxx b/svx/inc/svx/zoomslideritem.hxx
index 7b9b355632cc..f04b3190ab0f 100644
--- a/svx/inc/svx/zoomslideritem.hxx
+++ b/svx/inc/svx/zoomslideritem.hxx
@@ -39,8 +39,7 @@ class SVX_DLLPUBLIC SvxZoomSliderItem: public SfxUInt16Item
sal_uInt16 mnMaxZoom;
public:
- TYPEINFO();
-
+ POOLITEM_FACTORY()
SvxZoomSliderItem( sal_uInt16 nCurrentZoom = 100, sal_uInt16 nMinZoom = 20, sal_uInt16 nMaxZoom = 600, sal_uInt16 nWhich = SID_ATTR_ZOOMSLIDER );
SvxZoomSliderItem( const SvxZoomSliderItem& );
~SvxZoomSliderItem();
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 0847c6dd3067..ee3e4fc21596 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -9793,7 +9793,7 @@ SvxShadowItem BorderShadow SID_ATTR_BORDER_SHADOW
]
//--------------------------------------------------------------------------
-SdrShadowItem FillShadow SID_ATTR_FILL_SHADOW
+SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
[
/* flags: */
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index e09880bf11bf..9519e2ed22f0 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -394,7 +394,7 @@ item BOOL SvxWordLineModeItem;
item SvxCellHorJustifyEnum SvxHorJustifyItem;
item SvxCellVerJustifyEnum SvxVerJustifyItem;
item SvxCellOrientationEnum SvxOrientationItem;
-item BOOL SdrShadowItem;
+item BOOL SdrOnOffItem;
item INT16 SdrTextFitToSizeTypeItem; // enum
item String SfxStringListItem; // serialized into one concatenated string
item double SvxDoubleItem;
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx
index 34344b33c202..9e7dbf622657 100644
--- a/svx/source/accessibility/AccessibleControlShape.cxx
+++ b/svx/source/accessibility/AccessibleControlShape.cxx
@@ -209,7 +209,7 @@ void AccessibleControlShape::Init()
// get the control which belongs to our model (relative to our view)
const Window* pViewWindow = maShapeTreeInfo.GetWindow();
- SdrUnoObj* pUnoObjectImpl = PTR_CAST( SdrUnoObj, getSdrObject() );
+ SdrUnoObj* pUnoObjectImpl = dynamic_cast< SdrUnoObj* >( getSdrObject() );
SdrView* pView = maShapeTreeInfo.GetSdrView();
OSL_ENSURE( pView && pViewWindow && pUnoObjectImpl, "AccessibleControlShape::Init: no view, or no view window, no SdrUnoObj!" );
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index be4ca3d31e7e..d83d490e1d36 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -44,6 +44,7 @@
#include "AccessibleEmptyEditSource.hxx"
#include <svx/unoshtxt.hxx>
+#include <svx/globaldrawitempool.hxx>
namespace accessibility
{
@@ -109,7 +110,7 @@ namespace accessibility
// AW: Very dangerous: The former implementation used a SfxItemPool created on the
// fly which of course was deleted again ASAP. Thus, the returned SfxItemSet was using
// a deleted Pool by design.
- return SfxItemSet(SdrObject::GetGlobalDrawObjectItemPool());
+ return SfxItemSet(GetGlobalDrawObjectItemPool());
}
SfxItemSet GetParaAttribs( sal_uInt16 /*nPara*/ ) const { return GetAttribs(ESelection()); }
void SetParaAttribs( sal_uInt16 /*nPara*/, const SfxItemSet& /*rSet*/ ) {}
@@ -238,8 +239,7 @@ namespace accessibility
mrViewWindow(rViewWindow),
mbEditSourceEmpty( true )
{
- if( mrObj.GetModel() )
- StartListening( *mrObj.GetModel() );
+ StartListening( mrObj.getSdrModelFromSdrObject() );
}
AccessibleEmptyEditSource::~AccessibleEmptyEditSource()
@@ -252,8 +252,7 @@ namespace accessibility
}
else
{
- if( mrObj.GetModel() )
- EndListening( *mrObj.GetModel() );
+ EndListening( mrObj.getSdrModelFromSdrObject() );
}
}
@@ -276,8 +275,7 @@ namespace accessibility
void AccessibleEmptyEditSource::Switch2ProxyEditSource()
{
// deregister EmptyEditSource model listener
- if( mrObj.GetModel() )
- EndListening( *mrObj.GetModel() );
+ EndListening( mrObj.getSdrModelFromSdrObject() );
::std::auto_ptr< SvxEditSource > pProxySource( new AccessibleProxyEditSource_Impl(mrObj, mrView, mrViewWindow) );
::std::auto_ptr< SvxEditSource > tmp = mpEditSource;
@@ -324,10 +322,10 @@ namespace accessibility
void AccessibleEmptyEditSource::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
- if( pSdrHint && pSdrHint->GetKind() == HINT_BEGEDIT &&
- &mrObj == pSdrHint->GetObject() && mpEditSource.get() )
+ if( pSdrHint && pSdrHint->GetSdrHintKind() == HINT_BEGEDIT &&
+ &mrObj == pSdrHint->GetSdrHintObject() && mpEditSource.get() )
{
// switch edit source, if not yet done. This is necessary
// to become a full-fledged EditSource the first time a
@@ -335,11 +333,11 @@ namespace accessibility
if( mbEditSourceEmpty )
Switch2ProxyEditSource();
}
- else if (pSdrHint && pSdrHint->GetObject()!=NULL)
+ else if (pSdrHint && pSdrHint->GetSdrHintObject()!=NULL)
{
// When the SdrObject just got a para outliner object then
// switch the edit source.
- if (pSdrHint->GetObject()->GetOutlinerParaObject() != NULL)
+ if (pSdrHint->GetSdrHintObject()->GetOutlinerParaObject() != NULL)
Switch2ProxyEditSource();
}
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index c103a5f70f9f..33d7e440a1de 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -171,7 +171,7 @@ void AccessibleShape::Init (void)
SdrObject* pSdrObject = GetSdrObjectFromXShape(mxShape);
if( pSdrObject )
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, pSdrObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pSdrObject );
OutlinerParaObject* pOutlinerParaObject = NULL;
if( pTextObj )
@@ -250,7 +250,7 @@ void AccessibleShape::UpdateStates (void)
// XXX fix_me this has to be done with an extra interface later on
if ( m_pShape && maShapeTreeInfo.GetSdrView() )
{
- bShapeIsSelected = maShapeTreeInfo.GetSdrView()->IsObjMarked(m_pShape) == sal_True;
+ bShapeIsSelected = maShapeTreeInfo.GetSdrView()->IsObjMarked(*m_pShape) == sal_True;
}
if (bShapeIsSelected)
@@ -1085,7 +1085,6 @@ void AccessibleShape::ViewForwarderChanged (ChangeType aChangeType,
case DRAWING_CAPTION:
case DRAWING_CLOSED_BEZIER:
- case DRAWING_CLOSED_FREEHAND:
case DRAWING_ELLIPSE:
case DRAWING_POLY_POLYGON:
case DRAWING_POLY_POLYGON_PATH:
@@ -1098,7 +1097,6 @@ void AccessibleShape::ViewForwarderChanged (ChangeType aChangeType,
case DRAWING_LINE:
case DRAWING_MEASURE:
case DRAWING_OPEN_BEZIER:
- case DRAWING_OPEN_FREEHAND:
case DRAWING_POLY_LINE:
case DRAWING_POLY_LINE_PATH:
aDG.AddLineProperties ();
diff --git a/svx/source/accessibility/AccessibleTextEventQueue.cxx b/svx/source/accessibility/AccessibleTextEventQueue.cxx
index cc38f269255b..8b3bca882d6c 100644
--- a/svx/source/accessibility/AccessibleTextEventQueue.cxx
+++ b/svx/source/accessibility/AccessibleTextEventQueue.cxx
@@ -58,9 +58,9 @@ namespace accessibility
maEventQueue.push_back( new SfxHint( rHint ) );
}
- void AccessibleTextEventQueue::Append( const SdrHint& rHint )
+ void AccessibleTextEventQueue::Append( const SdrBaseHint& rHint )
{
- maEventQueue.push_back( new SdrHint( rHint ) );
+ maEventQueue.push_back( new SdrBaseHint( rHint ) );
}
void AccessibleTextEventQueue::Append( const SfxSimpleHint& rHint )
diff --git a/svx/source/accessibility/AccessibleTextEventQueue.hxx b/svx/source/accessibility/AccessibleTextEventQueue.hxx
index c5488ab020fc..eea94dd13aa7 100644
--- a/svx/source/accessibility/AccessibleTextEventQueue.hxx
+++ b/svx/source/accessibility/AccessibleTextEventQueue.hxx
@@ -28,10 +28,9 @@
#include <list>
#include <algorithm>
#include <tools/solar.h>
-#include <tools/rtti.hxx>
class SfxHint;
-class SdrHint;
+class SdrBaseHint;
class SfxSimpleHint;
class TextHint;
class SvxViewHint;
@@ -56,7 +55,7 @@ namespace accessibility
/// Append event to end of queue
void Append( const SfxHint& rHint );
/// Append event to end of queue
- void Append( const SdrHint& rHint );
+ void Append( const SdrBaseHint& rHint );
/// Append event to end of queue
void Append( const SfxSimpleHint& rHint );
/// Append event to end of queue
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index 18d24e83758c..71ba898f0690 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -84,8 +84,6 @@ namespace accessibility
//
//------------------------------------------------------------------------
- DBG_NAME( AccessibleTextHelper_Impl )
-
template < typename first_type, typename second_type >
::std::pair< first_type, second_type > makeSortedPair( first_type first,
second_type second )
@@ -122,19 +120,16 @@ namespace accessibility
void SetEventSource( const uno::Reference< XAccessible >& rInterface )
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
mxFrontEnd = rInterface;
}
uno::Reference< XAccessible > GetEventSource() const
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
return mxFrontEnd;
}
void SetOffset( const Point& );
Point GetOffset() const
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
::osl::MutexGuard aGuard( maMutex ); Point aPoint( maOffset );
return aPoint;
}
@@ -142,7 +137,6 @@ namespace accessibility
void SetStartIndex( sal_Int32 nOffset );
sal_Int32 GetStartIndex() const
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
// Strictly correct only with locked solar mutex, // but
// here we rely on the fact that sal_Int32 access is
// atomic
@@ -278,8 +272,6 @@ namespace accessibility
// normally should employ RAII here...
mnNotifierClientId(::comphelper::AccessibleEventNotifier::registerClient())
{
- DBG_CTOR( AccessibleTextHelper_Impl, NULL );
-
#ifdef DBG_UTIL
OSL_TRACE( "AccessibleTextHelper_Impl received ID: %d", mnNotifierClientId );
#endif
@@ -287,8 +279,6 @@ namespace accessibility
AccessibleTextHelper_Impl::~AccessibleTextHelper_Impl()
{
- DBG_DTOR( AccessibleTextHelper_Impl, NULL );
-
::vos::OGuard aGuard( Application::GetSolarMutex() );
try
@@ -302,8 +292,6 @@ namespace accessibility
SvxTextForwarder& AccessibleTextHelper_Impl::GetTextForwarder() const SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( !maEditSource.IsValid() )
throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
@@ -320,8 +308,6 @@ namespace accessibility
SvxViewForwarder& AccessibleTextHelper_Impl::GetViewForwarder() const SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( !maEditSource.IsValid() )
throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
@@ -338,8 +324,6 @@ namespace accessibility
SvxEditViewForwarder& AccessibleTextHelper_Impl::GetEditViewForwarder( sal_Bool bCreate ) const SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( !maEditSource.IsValid() )
throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
@@ -366,8 +350,6 @@ namespace accessibility
SvxEditSourceAdapter& AccessibleTextHelper_Impl::GetEditSource() const SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( maEditSource.IsValid() )
return maEditSource;
else
@@ -376,8 +358,6 @@ namespace accessibility
sal_Bool AccessibleTextHelper_Impl::IsSelected() const
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
sal_Bool bRet = sal_False;
try
@@ -406,8 +386,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::SetStartIndex( sal_Int32 nOffset )
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
sal_Int32 nOldOffset( mnStartIndex );
mnStartIndex = nOffset;
@@ -434,8 +412,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::SetChildFocus( sal_Int32 nChild, sal_Bool bHaveFocus ) SAL_THROW((::com::sun::star::uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( bHaveFocus )
{
if( mbThisHasFocus )
@@ -461,8 +437,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::ChangeChildFocus( sal_Int32 nNewChild ) SAL_THROW((::com::sun::star::uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( mbThisHasFocus )
SetShapeFocus( sal_False );
@@ -474,8 +448,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::SetShapeFocus( sal_Bool bHaveFocus ) SAL_THROW((::com::sun::star::uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
sal_Bool bOldFocus( mbThisHasFocus );
mbThisHasFocus = bHaveFocus;
@@ -497,8 +469,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::SetFocus( sal_Bool bHaveFocus ) SAL_THROW((::com::sun::star::uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
sal_Bool bOldFocus( mbGroupHasFocus );
mbGroupHasFocus = bHaveFocus;
@@ -524,8 +494,6 @@ namespace accessibility
sal_Bool AccessibleTextHelper_Impl::HaveFocus() SAL_THROW((::com::sun::star::uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// No locking of solar mutex here, since we rely on the fact
// that sal_Bool access is atomic
return mbThisHasFocus;
@@ -533,8 +501,6 @@ namespace accessibility
sal_Bool AccessibleTextHelper_Impl::IsActive() const SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
try
{
SvxEditSource& rEditSource = GetEditSource();
@@ -556,8 +522,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::UpdateSelection()
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
try
{
ESelection aSelection;
@@ -757,8 +721,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::ShutdownEditSource() SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// This should only be called with solar mutex locked, i.e. from the main office thread
// This here is somewhat clumsy: As soon as our children have
@@ -784,8 +746,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// This should only be called with solar mutex locked, i.e. from the main office thread
// shutdown old edit source
@@ -808,8 +768,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::SetOffset( const Point& rPoint )
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// guard against non-atomic access to maOffset data structure
{
::osl::MutexGuard aGuard( maMutex );
@@ -825,8 +783,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::UpdateVisibleChildren( bool bBroadcastEvents )
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
try
{
SvxTextForwarder& rCacheTF = GetTextForwarder();
@@ -954,8 +910,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::UpdateBoundRect()
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// send BOUNDRECT_CHANGED to affected children
AccessibleTextHelper_UpdateChildBounds aFunctor( *this );
::std::transform( maParaManager.begin(), maParaManager.end(), maParaManager.begin(), aFunctor );
@@ -992,8 +946,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::ParagraphsMoved( sal_Int32 nFirst, sal_Int32 nMiddle, sal_Int32 nLast )
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
/* rotate paragraphs
@@ -1098,8 +1050,8 @@ namespace accessibility
mnParasChanged != -1 )
{
// determine hint type
- const TextHint* pTextHint = PTR_CAST( TextHint, pEvent );
- const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, pEvent );
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >( pEvent );
+ const SvxEditSourceHint* pEditSourceHint = dynamic_cast< const SvxEditSourceHint* >( pEvent );
if( !pEditSourceHint && pTextHint &&
(pTextHint->GetId() == TEXT_HINT_PARAINSERTED ||
@@ -1150,8 +1102,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::ProcessQueue()
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// inspect queue for paragraph insert/remove events. If there
// is exactly _one_ of those in the queue, and the number of
// paragraphs has changed by exactly one, use that event to
@@ -1267,11 +1217,11 @@ namespace accessibility
const SfxHint& rHint = *(pHint.get());
// determine hint type
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
- const TextHint* pTextHint = PTR_CAST( TextHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
- const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >( &rHint );
+ const SvxViewHint* pViewHint = dynamic_cast< const SvxViewHint* >(&rHint );
+ const SvxEditSourceHint* pEditSourceHint = dynamic_cast< const SvxEditSourceHint* >( &rHint );
try
{
@@ -1372,7 +1322,7 @@ namespace accessibility
}
else if( pSdrHint )
{
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
case HINT_BEGEDIT:
{
@@ -1433,8 +1383,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// precondition: solar mutex locked
DBG_TESTSOLARMUTEX();
@@ -1445,11 +1393,11 @@ namespace accessibility
mbInNotify = sal_True;
// determine hint type
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
- const TextHint* pTextHint = PTR_CAST( TextHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
- const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >( &rHint );
+ const SvxViewHint* pViewHint = dynamic_cast< const SvxViewHint* >(&rHint);
+ const SvxEditSourceHint* pEditSourceHint = dynamic_cast< const SvxEditSourceHint* >( &rHint );
try
{
@@ -1567,8 +1515,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::Dispose()
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( getNotifierClientId() != -1 )
{
try
@@ -1602,8 +1548,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::FireEvent( const sal_Int16 nEventId, const uno::Any& rNewValue, const uno::Any& rOldValue ) const
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// -- object locked --
::osl::ClearableMutexGuard aGuard( maMutex );
@@ -1628,8 +1572,6 @@ namespace accessibility
void AccessibleTextHelper_Impl::FireEvent( const AccessibleEventObject& rEvent ) const
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// #102261# Call global queue for focus events
if( rEvent.EventId == AccessibleStateType::FOCUSED )
vcl::unohelper::NotifyAccessibleStateEventGlobally( rEvent );
@@ -1642,15 +1584,11 @@ namespace accessibility
// XAccessibleContext
sal_Int32 SAL_CALL AccessibleTextHelper_Impl::getAccessibleChildCount() SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
return mnLastVisibleChild - mnFirstVisibleChild + 1;
}
uno::Reference< XAccessible > SAL_CALL AccessibleTextHelper_Impl::getAccessibleChild( sal_Int32 i ) SAL_THROW((lang::IndexOutOfBoundsException, uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
i -= GetStartIndex();
if( 0 > i || i >= getAccessibleChildCount() ||
@@ -1669,24 +1607,18 @@ namespace accessibility
void SAL_CALL AccessibleTextHelper_Impl::addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( getNotifierClientId() != -1 )
::comphelper::AccessibleEventNotifier::addEventListener( getNotifierClientId(), xListener );
}
void SAL_CALL AccessibleTextHelper_Impl::removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
if( getNotifierClientId() != -1 )
::comphelper::AccessibleEventNotifier::removeEventListener( getNotifierClientId(), xListener );
}
uno::Reference< XAccessible > SAL_CALL AccessibleTextHelper_Impl::getAccessibleAtPoint( const awt::Point& _aPoint ) SAL_THROW((uno::RuntimeException))
{
- DBG_CHKTHIS( AccessibleTextHelper_Impl, NULL );
-
// make given position relative
if( !mxFrontEnd.is() )
throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleTextHelper_Impl::getAccessibleAt: frontend invalid")), mxFrontEnd );
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index ae8e23c0d3bb..a222a5b87d43 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -218,14 +218,12 @@ Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getAccessibleAt
if( mpControl )
{
- Point aPnt( rPoint.X, rPoint.Y );
- mpControl->PixelToLogic( aPnt );
-
+ const basegfx::B2DPoint aPnt(mpControl->GetInverseViewTransformation() * basegfx::B2DPoint(rPoint.X, rPoint.Y));
SdrObject* pObj = 0;
if(mpView && mpView->GetSdrPageView())
{
- pObj = SdrObjListPrimitiveHit(*mpPage, aPnt, 1, *mpView->GetSdrPageView(), 0, false);
+ pObj = SdrObjListPrimitiveHit(*mpPage, aPnt, 1.0, *mpView, false, 0);
}
if( pObj )
@@ -635,7 +633,7 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::selectAccessibleChild( sal_Int32 nI
SdrObject* pObj = getSdrObject( nIndex );
if( pObj )
- mpView->MarkObj( pObj, mpView->GetSdrPageView());
+ mpView->MarkObj( *pObj );
}
//-----------------------------------------------------------------------------
@@ -647,7 +645,7 @@ sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::isAccessibleChildSelected( sal_
if( NULL == mpView )
throw DisposedException();
- return mpView->IsObjMarked( getSdrObject( nIndex ) );
+ return mpView->IsObjMarked( *getSdrObject( nIndex ) );
}
//-----------------------------------------------------------------------------
@@ -683,8 +681,7 @@ sal_Int32 SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAccessibleChildCoun
if( NULL == mpView )
throw DisposedException();
- const SdrMarkList& rList = mpView->GetMarkedObjectList();
- return rList.GetMarkCount();
+ return mpView->getSelectedSdrObjectCount();
}
//-----------------------------------------------------------------------------
@@ -698,8 +695,8 @@ Reference< XAccessible > SAL_CALL SvxGraphCtrlAccessibleContext::getSelectedAcce
Reference< XAccessible > xAccessible;
- const SdrMarkList& rList = mpView->GetMarkedObjectList();
- SdrObject* pObj = rList.GetMark(nIndex)->GetMarkedSdrObj();
+ const SdrObjectVector aSelection(mpView->getSelectedSdrObjectVectorFromSdrMarkView());
+ SdrObject* pObj = aSelection[nIndex];
if( pObj )
xAccessible = getAccessible( pObj );
@@ -716,23 +713,10 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::deselectAccessibleChild( sal_Int32
if( mpView )
{
- const SdrMarkList& rList = mpView->GetMarkedObjectList();
-
SdrObject* pObj = getSdrObject( nIndex );
if( pObj )
{
- SdrMarkList aRefList( rList );
-
- SdrPageView* pPV = mpView->GetSdrPageView();
- mpView->UnmarkAllObj( pPV );
-
- sal_uInt32 nCount = aRefList.GetMarkCount();
- sal_uInt32 nMark;
- for( nMark = 0; nMark < nCount; nMark++ )
- {
- if( aRefList.GetMark(nMark)->GetMarkedSdrObj() != pObj )
- mpView->MarkObj( aRefList.GetMark(nMark)->GetMarkedSdrObj(), pPV );
- }
+ mpView->removeSdrObjectFromSelection(*pObj);
}
}
}
@@ -909,15 +893,17 @@ Sequence< sal_Int8 > SvxGraphCtrlAccessibleContext::getUniqueId( void )
void SvxGraphCtrlAccessibleContext::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
if( pSdrHint )
{
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
- case HINT_OBJCHG:
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
+ case HINT_OBJCHG_ATTR:
{
- ShapesMapType::iterator iter = mxShapes.find( pSdrHint->GetObject() );
+ ShapesMapType::iterator iter = mxShapes.find( pSdrHint->GetSdrHintObject() );
if( iter != mxShapes.end() )
{
@@ -931,10 +917,10 @@ void SvxGraphCtrlAccessibleContext::Notify( SfxBroadcaster& /*rBC*/, const SfxHi
break;
case HINT_OBJINSERTED:
- CommitChange( AccessibleEventId::CHILD, makeAny( getAccessible( pSdrHint->GetObject() ) ) , uno::Any());
+ CommitChange( AccessibleEventId::CHILD, makeAny( getAccessible( pSdrHint->GetSdrHintObject() ) ) , uno::Any());
break;
case HINT_OBJREMOVED:
- CommitChange( AccessibleEventId::CHILD, uno::Any(), makeAny( getAccessible( pSdrHint->GetObject() ) ) );
+ CommitChange( AccessibleEventId::CHILD, uno::Any(), makeAny( getAccessible( pSdrHint->GetSdrHintObject() ) ) );
break;
case HINT_MODELCLEARED:
dispose();
@@ -945,7 +931,7 @@ void SvxGraphCtrlAccessibleContext::Notify( SfxBroadcaster& /*rBC*/, const SfxHi
}
else
{
- const SfxSimpleHint* pSfxHint = PTR_CAST(SfxSimpleHint, &rHint );
+ const SfxSimpleHint* pSfxHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
// ist unser SdDrawDocument gerade gestorben?
if(pSfxHint && pSfxHint->GetId() == SFX_HINT_DYING)
diff --git a/svx/source/accessibility/ShapeTypeHandler.cxx b/svx/source/accessibility/ShapeTypeHandler.cxx
index e5ade1648f7c..ad6a633215c5 100644
--- a/svx/source/accessibility/ShapeTypeHandler.cxx
+++ b/svx/source/accessibility/ShapeTypeHandler.cxx
@@ -264,9 +264,6 @@ long ShapeTypeHandler::GetSlotId (const uno::Reference<drawing::XShape>& rxShape
case DRAWING_CLOSED_BEZIER:
nResourceId = STR_ObjNameSingulPATHFILL;
break;
- case DRAWING_CLOSED_FREEHAND:
- nResourceId = STR_ObjNameSingulFREEFILL;
- break;
case DRAWING_CONNECTOR:
nResourceId = STR_ObjNameSingulEDGE;
break;
@@ -288,9 +285,6 @@ long ShapeTypeHandler::GetSlotId (const uno::Reference<drawing::XShape>& rxShape
case DRAWING_OPEN_BEZIER:
nResourceId = STR_ObjNameSingulPATHLINE;
break;
- case DRAWING_OPEN_FREEHAND:
- nResourceId = STR_ObjNameSingulFREELINE;
- break;
case DRAWING_PAGE:
nResourceId = STR_ObjNameSingulPAGE;
break;
diff --git a/svx/source/accessibility/SvxShapeTypes.cxx b/svx/source/accessibility/SvxShapeTypes.cxx
index fe378a3d278a..c4d52d3d33e1 100644
--- a/svx/source/accessibility/SvxShapeTypes.cxx
+++ b/svx/source/accessibility/SvxShapeTypes.cxx
@@ -47,14 +47,12 @@ AccessibleShape* CreateSvxAccessibleShape (
case DRAWING_3D_SPHERE:
case DRAWING_CAPTION:
case DRAWING_CLOSED_BEZIER:
- case DRAWING_CLOSED_FREEHAND:
case DRAWING_CONNECTOR:
case DRAWING_ELLIPSE:
case DRAWING_GROUP:
case DRAWING_LINE:
case DRAWING_MEASURE:
case DRAWING_OPEN_BEZIER:
- case DRAWING_OPEN_FREEHAND:
case DRAWING_PAGE:
case DRAWING_POLY_POLYGON:
case DRAWING_POLY_LINE:
@@ -128,12 +126,6 @@ ShapeTypeDescriptor aSvxShapeTypeList[] = {
ShapeTypeDescriptor ( DRAWING_CLOSED_BEZIER,
::rtl::OUString::createFromAscii ("com.sun.star.drawing.ClosedBezierShape"),
CreateSvxAccessibleShape ),
- ShapeTypeDescriptor ( DRAWING_OPEN_FREEHAND,
- ::rtl::OUString::createFromAscii ("com.sun.star.drawing.OpenFreeHandShape"),
- CreateSvxAccessibleShape ),
- ShapeTypeDescriptor ( DRAWING_CLOSED_FREEHAND,
- ::rtl::OUString::createFromAscii ("com.sun.star.drawing.ClosedFreeHandShape"),
- CreateSvxAccessibleShape ),
ShapeTypeDescriptor ( DRAWING_POLY_POLYGON_PATH,
::rtl::OUString::createFromAscii ("com.sun.star.drawing.PolyPolygonPathShape"),
CreateSvxAccessibleShape ),
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index 587fcec8e30c..1f6722a59794 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -59,9 +59,6 @@ using namespace ::com::sun::star::accessibility;
#define NOCHILDSELECTED -1
-DBG_NAME( SvxRectCtlAccessibleContext )
-
-
//===== internal ============================================================
namespace
@@ -156,8 +153,6 @@ SvxRectCtlAccessibleContext::SvxRectCtlAccessibleContext(
mnSelectedChild( NOCHILDSELECTED ),
mbAngleMode( rRepr.GetNumOfChilds() == 8 )
{
- DBG_CTOR( SvxRectCtlAccessibleContext, NULL );
-
if( pName )
msName = *pName;
else
@@ -184,8 +179,6 @@ SvxRectCtlAccessibleContext::SvxRectCtlAccessibleContext(
SvxRectCtlAccessibleContext::~SvxRectCtlAccessibleContext()
{
- DBG_DTOR( SvxRectCtlAccessibleContext, NULL );
-
if( IsAlive() )
{
osl_incrementInterlockedCount( &m_refCount );
@@ -793,9 +786,6 @@ void SvxRectCtlAccessibleContext::ThrowExceptionIfNotAlive( void ) throw( lang::
// -------------------------------------------------------------------------------------------------
-DBG_NAME( SvxRectCtlChildAccessibleContext )
-
-
SvxRectCtlChildAccessibleContext::SvxRectCtlChildAccessibleContext(
const Reference<XAccessible>& rxParent,
const Window& rParentWindow,
@@ -814,14 +804,11 @@ SvxRectCtlChildAccessibleContext::SvxRectCtlChildAccessibleContext(
mnIndexInParent( nIndexInParent ),
mbIsChecked( sal_False )
{
- DBG_CTOR( SvxRectCtlChildAccessibleContext, NULL );
}
SvxRectCtlChildAccessibleContext::~SvxRectCtlChildAccessibleContext()
{
- DBG_DTOR( SvxRectCtlChildAccessibleContext, NULL );
-
if( IsAlive() )
{
osl_incrementInterlockedCount( &m_refCount );
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 7ed8c31a5510..81c5bcf192fa 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -63,16 +63,31 @@
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/color/bcolortools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-
-// #i76201#
#include <basegfx/polygon/b2dpolygontools.hxx>
-
+#include <svx/svdlegacy.hxx>
#include <math.h>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::drawing::EnhancedCustomShapeSegmentCommand;
+//void old_ShearPoint(basegfx::B2DPoint& rPnt, const basegfx::B2DPoint& rRef, double tn)
+//{
+// if (!basegfx::fTools::equal(rPnt.getY(), rRef.getY()))
+// {
+// rPnt.setX(rPnt.getX() - ((rPnt.getY() - rRef.getY()) * tn));
+// }
+//}
+
+//void old_RotatePoint(basegfx::B2DPoint& rPnt, const basegfx::B2DPoint& rRef, double sn, double cs)
+//{
+// const double fx(rPnt.getX() - rRef.getX());
+// const double fy(rPnt.getY() - rRef.getY());
+//
+// rPnt.setX(rRef.getX() + fx * cs + fy * sn);
+// rPnt.setY(rRef.getY() + fy * cs - fx * sn);
+//}
+
void EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( EnhancedCustomShapeParameter& rParameter, const sal_Int32 nValue )
{
sal_uInt32 nDat = (sal_uInt32)nValue;
@@ -583,7 +598,7 @@ sal_Bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
const sal_Int32* EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryItem& rGeometryItem )
{
const sal_Int32* pDefData = NULL;
- const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eSpType );
+ const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( meSpType );
if ( pDefCustomShape )
pDefData = pDefCustomShape->pDefData;
@@ -692,7 +707,7 @@ EnhancedCustomShape2d::~EnhancedCustomShape2d()
EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
SfxItemSet ( pAObj->GetMergedItemSet() ),
pCustomShapeObj ( pAObj ),
- eSpType ( mso_sptNil ),
+ meSpType ( mso_sptNil ),
nCoordLeft ( 0 ),
nCoordTop ( 0 ),
nCoordWidth ( 21600 ),
@@ -703,9 +718,9 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
nColorData ( 0 ),
bTextFlow ( sal_False ),
bFilled ( ((const XFillStyleItem&)pAObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue() != XFILL_NONE ),
- bStroked ( ((const XLineStyleItem&)pAObj->GetMergedItem( XATTR_LINESTYLE )).GetValue() != XLINE_NONE ),
- bFlipH ( sal_False ),
- bFlipV ( sal_False )
+ bStroked ( ((const XLineStyleItem&)pAObj->GetMergedItem( XATTR_LINESTYLE )).GetValue() != XLINE_NONE )//,
+// bFlipH ( sal_False ),
+// bFlipV ( sal_False )
{
// bTextFlow needs to be set before clearing the TextDirection Item
@@ -723,37 +738,39 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
// 2D helper shape.
ClearItem(SDRATTR_SHADOW);
- Point aP( pCustomShapeObj->GetSnapRect().Center() );
- Size aS( pCustomShapeObj->GetLogicRect().GetSize() );
- aP.X() -= aS.Width() / 2;
- aP.Y() -= aS.Height() / 2;
- aLogicRect = Rectangle( aP, aS );
+ // Do not use GetSnapRect here as in the original since we are inside
+ // the geometry creation (createViewIndependentPrimitive2DSequence)
+ maLogicScale = basegfx::absolute(pCustomShapeObj->getSdrObjectScale());
const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
+ // TTTT: MirroredX/Y removed
+// const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+// const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
rtl::OUString sShapeType;
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
if ( pAny )
*pAny >>= sShapeType;
- eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
-
- pAny = rGeometryItem.GetPropertyValueByName( sMirroredX );
- if ( pAny )
- *pAny >>= bFlipH;
- pAny = rGeometryItem.GetPropertyValueByName( sMirroredY );
- if ( pAny )
- *pAny >>= bFlipV;
-
- if ( pCustomShapeObj->ISA( SdrObjCustomShape ) ) // should always be a SdrObjCustomShape, but you don't know
- nRotateAngle = (sal_Int32)(((SdrObjCustomShape*)pCustomShapeObj)->GetObjectRotation() * 100.0);
- else
- nRotateAngle = pCustomShapeObj->GetRotateAngle();
+ meSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
+
+// TTTT:
+// pAny = rGeometryItem.GetPropertyValueByName( sMirroredX );
+// if ( pAny )
+// *pAny >>= bFlipH;
+// pAny = rGeometryItem.GetPropertyValueByName( sMirroredY );
+// if ( pAny )
+// *pAny >>= bFlipV;
+
+// SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(pCustomShapeObj);
+//
+// if ( pSdrObjCustomShape ) // should always be a SdrObjCustomShape, but you don't know
+// nRotateAngle = basegfx::fround(pSdrObjCustomShape->GetObjectRotation() * 100.0);
+// else
+// nRotateAngle = sdr::legacy::GetRotateAngle(*pCustomShapeObj);
/*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem );
- switch( eSpType )
+ switch( meSpType )
{
case mso_sptCan : nColorData = 0x20400000; break;
case mso_sptCube : nColorData = 0x302e0000; break;
@@ -796,11 +813,11 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
default:
break;
}
- fXScale = nCoordWidth == 0 ? 0.0 : (double)aLogicRect.GetWidth() / (double)nCoordWidth;
- fYScale = nCoordHeight == 0 ? 0.0 : (double)aLogicRect.GetHeight() / (double)nCoordHeight;
- if ( (sal_uInt32)nXRef != 0x80000000 && aLogicRect.GetHeight() )
+ fXScale = nCoordWidth == 0 ? 0.0 : maLogicScale.getX() / (double)nCoordWidth;
+ fYScale = nCoordHeight == 0 ? 0.0 : maLogicScale.getY() / (double)nCoordHeight;
+ if ( (sal_uInt32)nXRef != 0x80000000 && !basegfx::fTools::equalZero(maLogicScale.getY()) )
{
- fXRatio = (double)aLogicRect.GetWidth() / (double)aLogicRect.GetHeight();
+ fXRatio = maLogicScale.getX() / maLogicScale.getY();
if ( fXRatio > 1 )
fXScale /= fXRatio;
else
@@ -808,9 +825,9 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
}
else
fXRatio = 1.0;
- if ( (sal_uInt32)nYRef != 0x80000000 && aLogicRect.GetWidth() )
+ if ( (sal_uInt32)nYRef != 0x80000000 && !basegfx::fTools::equalZero(maLogicScale.getX()) )
{
- fYRatio = (double)aLogicRect.GetHeight() / (double)aLogicRect.GetWidth();
+ fYRatio = maLogicScale.getY() / maLogicScale.getX();
if ( fYRatio > 1 )
fYScale /= fYRatio;
else
@@ -853,8 +870,8 @@ double EnhancedCustomShape2d::GetEnumFunc( const EnumFunc eFunc ) const
case ENUM_FUNC_HASFILL : fRet = bFilled ? 1.0 : 0.0; break;
case ENUM_FUNC_WIDTH : fRet = nCoordWidth; break;
case ENUM_FUNC_HEIGHT : fRet = nCoordHeight; break;
- case ENUM_FUNC_LOGWIDTH : fRet = aLogicRect.GetWidth(); break;
- case ENUM_FUNC_LOGHEIGHT : fRet = aLogicRect.GetHeight(); break;
+ case ENUM_FUNC_LOGWIDTH : fRet = maLogicScale.getX(); break;
+ case ENUM_FUNC_LOGHEIGHT : fRet = maLogicScale.getY(); break;
}
return fRet;
}
@@ -922,10 +939,11 @@ sal_Bool EnhancedCustomShape2d::SetAdjustValueAsDouble( const double& rValue, co
return bRetValue;
}
-Point EnhancedCustomShape2d::GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair& rPair,
+basegfx::B2DPoint EnhancedCustomShape2d::GetPoint(
+ const com::sun::star::drawing::EnhancedCustomShapeParameterPair& rPair,
const sal_Bool bScale, const sal_Bool bReplaceGeoSize ) const
{
- Point aRetValue;
+ basegfx::B2DPoint aRetValue;
sal_Bool bExchange = ( nFlags & DFF_CUSTOMSHAPE_EXCH ) != 0; // x <-> y
sal_uInt32 nPass = 0;
do
@@ -946,9 +964,9 @@ Point EnhancedCustomShape2d::GetPoint( const com::sun::star::drawing::EnhancedCu
fVal *= fYScale;
if ( nFlags & DFF_CUSTOMSHAPE_FLIP_V )
- fVal = aLogicRect.GetHeight() - fVal;
+ fVal = maLogicScale.getY() - fVal;
}
- aRetValue.Y() = (sal_Int32)fVal;
+ aRetValue.setY(fVal);
}
else // width
{
@@ -959,9 +977,9 @@ Point EnhancedCustomShape2d::GetPoint( const com::sun::star::drawing::EnhancedCu
fVal *= fXScale;
if ( nFlags & DFF_CUSTOMSHAPE_FLIP_H )
- fVal = aLogicRect.GetWidth() - fVal;
+ fVal = maLogicScale.getX() - fVal;
}
- aRetValue.X() = (sal_Int32)fVal;
+ aRetValue.setX(fVal);
}
}
while ( ++nPass < 2 );
@@ -1097,30 +1115,43 @@ Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 n
(sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getBlue(),0.0,1.0) * 255.0 + 0.5 ) );
}
-Rectangle EnhancedCustomShape2d::GetTextRect() const
+basegfx::B2DRange EnhancedCustomShape2d::GetTextRange() const
{
sal_Int32 nIndex, nSize = seqTextFrames.getLength();
- if ( !nSize )
- return aLogicRect;
- nIndex = 0;
- if ( bTextFlow && ( nSize > 1 ) )
- nIndex++;
- Point aTopLeft( GetPoint( seqTextFrames[ nIndex ].TopLeft, sal_True, sal_True ) );
- Point aBottomRight( GetPoint( seqTextFrames[ nIndex ].BottomRight, sal_True, sal_True ) );
- if ( bFlipH )
- {
- aTopLeft.X() = aLogicRect.GetWidth() - aTopLeft.X();
- aBottomRight.X() = aLogicRect.GetWidth() - aBottomRight.X();
- }
- if ( bFlipV )
+ basegfx::B2DRange aRetval(basegfx::B2DRange::getUnitB2DRange());
+ basegfx::B2DHomMatrix aTransform;
+
+ if ( nSize )
{
- aTopLeft.Y() = aLogicRect.GetHeight() - aTopLeft.Y();
- aBottomRight.Y() = aLogicRect.GetHeight() - aBottomRight.Y();
+ nIndex = 0;
+ if ( bTextFlow && ( nSize > 1 ) )
+ nIndex++;
+ basegfx::B2DPoint aTopLeft( GetPoint( seqTextFrames[ nIndex ].TopLeft, sal_True, sal_True ) );
+ basegfx::B2DPoint aBottomRight( GetPoint( seqTextFrames[ nIndex ].BottomRight, sal_True, sal_True ) );
+// if ( bFlipH )
+// {
+// aTopLeft.setX(maLogicRange.getWidth() - aTopLeft.getX());
+// aBottomRight.setX(maLogicRange.getWidth() - aBottomRight.getX());
+// }
+// if ( bFlipV )
+// {
+// aTopLeft.setY(maLogicRange.getHeight() - aTopLeft.getY());
+// aBottomRight.setY(maLogicRange.getHeight() - aBottomRight.getY());
+// }
+ aRetval = basegfx::B2DRange(aTopLeft, aBottomRight);
+ aTransform.scale(
+ basegfx::fTools::equalZero(maLogicScale.getX()) ? 1.0 : 1.0 / maLogicScale.getX(),
+ basegfx::fTools::equalZero(maLogicScale.getY()) ? 1.0 : 1.0 / maLogicScale.getY());
}
- Rectangle aRect( aTopLeft, aBottomRight );
- aRect.Move( aLogicRect.Left(), aLogicRect.Top() );
- aRect.Justify();
- return aRect;
+
+ // To keep tight to the original, ignore rotate and shear. If this
+ // is not wanted, just use getSdrObjectTransformation() instead
+ aTransform.scale(basegfx::absolute(pCustomShapeObj->getSdrObjectScale()));
+ aTransform.translate(pCustomShapeObj->getSdrObjectTranslate());
+
+ aRetval *= aTransform;
+
+ return aRetval;
}
sal_uInt32 EnhancedCustomShape2d::GetHdlCount() const
@@ -1128,7 +1159,7 @@ sal_uInt32 EnhancedCustomShape2d::GetHdlCount() const
return seqHandles.getLength();
}
-sal_Bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const
+sal_Bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, basegfx::B2DPoint& rReturnPosition ) const
{
sal_Bool bRetValue = sal_False;
if ( nIndex < GetHdlCount() )
@@ -1138,7 +1169,7 @@ sal_Bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, Poin
{
if ( aHandle.nFlags & HANDLE_FLAGS_POLAR )
{
- Point aReferencePoint( GetPoint( aHandle.aPolar, sal_True, sal_False ) );
+ basegfx::B2DPoint aReferencePoint( GetPoint( aHandle.aPolar, sal_True, sal_False ) );
double fAngle;
double fRadius;
@@ -1150,16 +1181,17 @@ sal_Bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, Poin
double fX = dx * cos( a );
double fY =-dx * sin( a );
rReturnPosition =
- Point(
- Round( fX + aReferencePoint.X() ),
- basegfx::fTools::equalZero(fXScale) ? aReferencePoint.Y() :
- Round( ( fY * fYScale ) / fXScale + aReferencePoint.Y() ) );
+ basegfx::B2DPoint(
+ fX + aReferencePoint.getX(),
+ basegfx::fTools::equalZero(fXScale)
+ ? aReferencePoint.getY()
+ : ( fY * fYScale ) / fXScale + aReferencePoint.getY() );
}
else
{
if ( aHandle.nFlags & HANDLE_FLAGS_SWITCHED )
{
- if ( aLogicRect.GetHeight() > aLogicRect.GetWidth() )
+ if ( maLogicScale.getY() > maLogicScale.getX() )
{
com::sun::star::drawing::EnhancedCustomShapeParameter aFirst = aHandle.aPosition.First;
com::sun::star::drawing::EnhancedCustomShapeParameter aSecond = aHandle.aPosition.Second;
@@ -1169,24 +1201,34 @@ sal_Bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, Poin
}
rReturnPosition = GetPoint( aHandle.aPosition, sal_True, sal_False );
}
- const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() );
- if ( aGeoStat.nShearWink )
- {
- double nTan = aGeoStat.nTan;
- if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
- nTan = -nTan;
- ShearPoint( rReturnPosition, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan );
- }
- if ( nRotateAngle )
- {
- double a = nRotateAngle * F_PI18000;
- RotatePoint( rReturnPosition, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) );
- }
- if ( bFlipH )
- rReturnPosition.X() = aLogicRect.GetWidth() - rReturnPosition.X();
- if ( bFlipV )
- rReturnPosition.Y() = aLogicRect.GetHeight() - rReturnPosition.Y();
- rReturnPosition.Move( aLogicRect.Left(), aLogicRect.Top() );
+
+ // transform to logic coordinates using object's transformation. rReturnPosition
+ // is already scaled
+ rReturnPosition /= basegfx::absolute(pCustomShapeObj->getSdrObjectScale());
+ rReturnPosition *= pCustomShapeObj->getSdrObjectTransformation();
+
+// const long aOldShear(sdr::legacy::GetShearAngleX(*pCustomShapeObj));
+// if ( aOldShear )
+// {
+// double nTan = tan(aOldShear*nPi180);
+//// if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+//// nTan = -nTan;
+// old_ShearPoint( rReturnPosition, maLogicRange.getRange() * 0.5, nTan );
+// }
+//
+// if ( nRotateAngle )
+// {
+// double a = nRotateAngle * F_PI18000;
+// old_RotatePoint( rReturnPosition, maLogicRange.getRange() * 0.5, sin( a ), cos( a ) );
+// }
+//
+//// if ( bFlipH )
+//// rReturnPosition.setX(maLogicRange.getWidth() - rReturnPosition.getX());
+////
+//// if ( bFlipV )
+//// rReturnPosition.setY(maLogicRange.getHeight() - rReturnPosition.getY());
+//
+// rReturnPosition += maLogicRange.getMinimum();
bRetValue = sal_True;
}
}
@@ -1201,36 +1243,44 @@ sal_Bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nI
Handle aHandle;
if ( ConvertSequenceToEnhancedCustomShape2dHandle( seqHandles[ nIndex ], aHandle ) )
{
- Point aP( rPosition.X, rPosition.Y );
- // apply the negative object rotation to the controller position
-
- aP.Move( -aLogicRect.Left(), -aLogicRect.Top() );
- if ( bFlipH )
- aP.X() = aLogicRect.GetWidth() - aP.X();
- if ( bFlipV )
- aP.Y() = aLogicRect.GetHeight() - aP.Y();
- if ( nRotateAngle )
- {
- double a = -nRotateAngle * F_PI18000;
- RotatePoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) );
- }
- const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() );
- if ( aGeoStat.nShearWink )
- {
- double nTan = -aGeoStat.nTan;
- if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
- nTan = -nTan;
- ShearPoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), nTan );
- }
-
- double fPos1 = aP.X(); //( bFlipH ) ? aLogicRect.GetWidth() - aP.X() : aP.X();
- double fPos2 = aP.Y(); //( bFlipV ) ? aLogicRect.GetHeight() -aP.Y() : aP.Y();
+ basegfx::B2DPoint aP( rPosition.X, rPosition.Y );
+
+ // transform back to just scaled
+ basegfx::B2DHomMatrix aInvSdrObj(pCustomShapeObj->getSdrObjectTransformation());
+ aInvSdrObj.invert();
+ aP *= aInvSdrObj;
+ aP *= basegfx::absolute(pCustomShapeObj->getSdrObjectScale());
+
+// // apply the negative object rotation to the controller position
+//
+// aP -= maLogicRange.getMinimum();
+//// if ( bFlipH )
+//// aP.setX(maLogicRange.getWidth() - aP.getX());
+//// if ( bFlipV )
+//// aP.setY(maLogicRange.getHeight() - aP.getY());
+// if ( nRotateAngle )
+// {
+// double a = -nRotateAngle * F_PI18000;
+// old_RotatePoint( aP, maLogicRange.getRange() * 0.5, sin( a ), cos( a ) );
+// }
+//
+// const long aOldShear(sdr::legacy::GetShearAngleX(*pCustomShapeObj));
+// if ( aOldShear )
+// {
+// double nTan = -tan(aOldShear*nPi180);
+//// if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+//// nTan = -nTan;
+// old_ShearPoint( aP, maLogicRange.getRange() * 0.5, nTan );
+// }
+
+ double fPos1 = aP.getX();
+ double fPos2 = aP.getY();
fPos1 /= fXScale;
fPos2 /= fYScale;
if ( aHandle.nFlags & HANDLE_FLAGS_SWITCHED )
{
- if ( aLogicRect.GetHeight() > aLogicRect.GetWidth() )
+ if ( maLogicScale.getY() > maLogicScale.getX() )
{
double fX = fPos1;
double fY = fPos2;
@@ -1361,45 +1411,28 @@ void EnhancedCustomShape2d::SwapStartAndEndArrow( SdrObject* pObj ) //#108274
pObj->SetMergedItem( aLineEndCenter );
}
-basegfx::B2DPolygon CreateArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, const sal_Bool bClockwise )
+basegfx::B2DPolygon CreateArc(
+ const basegfx::B2DRange& rRange,
+ const basegfx::B2DPoint& rStart,
+ const basegfx::B2DPoint& rEnd,
+ const sal_Bool bClockwise )
{
- Rectangle aRect( rRect );
- Point aStart( rStart );
- Point aEnd( rEnd );
-
- sal_Int32 bSwapStartEndAngle = 0;
-
- if ( aRect.Left() > aRect.Right() )
- bSwapStartEndAngle ^= 0x01;
- if ( aRect.Top() > aRect.Bottom() )
- bSwapStartEndAngle ^= 0x11;
- if ( bSwapStartEndAngle )
- {
- aRect.Justify();
- if ( bSwapStartEndAngle & 1 )
- {
- Point aTmp( aStart );
- aStart = aEnd;
- aEnd = aTmp;
- }
- }
-
- Polygon aTempPoly( aRect, aStart, aEnd, POLY_ARC );
- basegfx::B2DPolygon aRetval;
-
- if ( bClockwise )
- {
- for ( sal_uInt16 j = aTempPoly.GetSize(); j--; )
- {
- aRetval.append(basegfx::B2DPoint(aTempPoly[ j ].X(), aTempPoly[ j ].Y()));
- }
- }
- else
- {
- for ( sal_uInt16 j = 0; j < aTempPoly.GetSize(); j++ )
- {
- aRetval.append(basegfx::B2DPoint(aTempPoly[ j ].X(), aTempPoly[ j ].Y()));
- }
+ const basegfx::B2DPoint aCenter(rRange.getCenter());
+ const basegfx::B2DVector aHalfRange(rRange.getRange() * 0.5);
+ double fStart(basegfx::snapToZeroRange(atan2(rStart.getY() - aCenter.getY(), rStart.getX() - aCenter.getX()), F_2PI));
+ double fEnd(basegfx::snapToZeroRange(atan2(rEnd.getY() - aCenter.getY(), rEnd.getX() - aCenter.getX()), F_2PI));
+
+ basegfx::B2DPolygon aRetval(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ aCenter,
+ aHalfRange.getX(),
+ aHalfRange.getY(),
+ fEnd,
+ fStart));
+
+ if(!bClockwise)
+ {
+ aRetval.flip();
}
return aRetval;
@@ -1423,8 +1456,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
for ( sal_Int32 nPtNum(0L); nPtNum < nCoordSize; nPtNum++ )
{
- const Point aTempPoint(GetPoint( *pTmp++, sal_True, sal_True ));
- aNewB2DPolygon.append(basegfx::B2DPoint(aTempPoint.X(), aTempPoint.Y()));
+ aNewB2DPolygon.append(GetPoint( *pTmp++, sal_True, sal_True ));
}
aNewB2DPolygon.setClosed(true);
@@ -1457,8 +1489,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if ( rSrcPt < nCoordSize )
{
- const Point aTempPoint(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
- aNewB2DPolygon.append(basegfx::B2DPoint(aTempPoint.X(), aTempPoint.Y()));
+ aNewB2DPolygon.append(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
}
}
break;
@@ -1482,15 +1513,12 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
{
for ( sal_uInt16 i = 0; ( i < nPntCount ) && ( ( rSrcPt + 2 ) < nCoordSize ); i++ )
{
- const Point aControlA(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
- const Point aControlB(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
- const Point aEnd(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
+ const basegfx::B2DPoint aControlA(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
+ const basegfx::B2DPoint aControlB(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
+ const basegfx::B2DPoint aEnd(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
DBG_ASSERT(aNewB2DPolygon.count(), "EnhancedCustomShape2d::CreateSubPath: Error in adding control point (!)");
- aNewB2DPolygon.appendBezierSegment(
- basegfx::B2DPoint(aControlA.X(), aControlA.Y()),
- basegfx::B2DPoint(aControlB.X(), aControlB.Y()),
- basegfx::B2DPoint(aEnd.X(), aEnd.Y()));
+ aNewB2DPolygon.appendBezierSegment(aControlA, aControlB, aEnd);
}
}
break;
@@ -1513,7 +1541,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
for ( sal_uInt16 i = 0; ( i < nPntCount ) && ( ( rSrcPt + 2 ) < nCoordSize ); i++ )
{
// create a circle
- Point _aCenter;
+ basegfx::B2DPoint _aCenter( GetPoint( seqCoordinates[ rSrcPt ], sal_True, sal_True ) );
double fWidth, fHeight;
MSO_SPT eSpType = mso_sptEllipse;
const mso_CustomShape* pDefCustomShape = GetCustomShapeContent( eSpType );
@@ -1523,35 +1551,48 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if( ( nCoordWidth == pDefCustomShape->nCoordWidth )
&& ( nCoordHeight == pDefCustomShape->nCoordHeight ) )
+ {
bIsDefaultViewBox = sal_True;
+ }
+
sal_Int32 j, nCount = pDefCustomShape->nVertices;//==3
com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair> seqCoordinates1, seqCoordinates2;
seqCoordinates1.realloc( nCount );
+
for ( j = 0; j < nCount; j++ )
{
seqCoordinates1[j] = seqCoordinates[ rSrcPt + j];
}
seqCoordinates2.realloc( nCount );
+
for ( j = 0; j < nCount; j++ )
{
EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( seqCoordinates2[ j ].First, pDefCustomShape->pVertices[ j ].nValA );
EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( seqCoordinates2[ j ].Second, pDefCustomShape->pVertices[ j ].nValB );
}
+
if(seqCoordinates1 == seqCoordinates2)
+ {
bIsDefaultPath = sal_True;
+ }
const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
rtl::OUString sShpType;
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
+
if ( pAny )
+ {
*pAny >>= sShpType;
- if( sShpType.getLength() > 3 &&
- sShpType.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso" ))){
+ }
+
+ if( sShpType.getLength() > 3 && sShpType.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso" )))
+ {
bIsMSEllipse = sal_True;
}
+
if( (! bIsDefaultPath && ! bIsDefaultViewBox) || (bIsDefaultViewBox && bIsMSEllipse) /*&& (nGeneratorVersion == SfxObjectShell::Sym_L2)*/ )
{
_aCenter = GetPoint( seqCoordinates[ rSrcPt ], sal_True, sal_True );
@@ -1559,10 +1600,11 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
GetParameter( fHeight, seqCoordinates[ rSrcPt + 1 ].Second, sal_False, sal_True );
fWidth /= 2;
fHeight /= 2;
- }else if( bIsDefaultPath && !bIsDefaultViewBox /*&& (nGeneratorVersion == SfxObjectShell::Sym_L2)*/ )
+ }
+ else if( bIsDefaultPath && !bIsDefaultViewBox /*&& (nGeneratorVersion == SfxObjectShell::Sym_L2)*/ )
{
- _aCenter.X() = nCoordWidth/2 * fXScale;
- _aCenter.Y() = nCoordHeight/2 * fYScale;
+ _aCenter.setX(nCoordWidth/2 * fXScale);
+ _aCenter.setY(nCoordHeight/2 * fYScale);
fWidth = nCoordWidth/2;
fHeight = nCoordHeight/2;
@@ -1579,7 +1621,9 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
aPropVal.Value <<= aViewBox;
rGeometryItem.SetPropertyValue( aPropVal );
pCustomShapeObj->SetMergedItem( rGeometryItem );
- }else{
+ }
+ else
+ {
_aCenter = GetPoint( seqCoordinates[ rSrcPt ], sal_True, sal_True );
GetParameter( fWidth, seqCoordinates[ rSrcPt + 1 ].First, sal_True, sal_False );
GetParameter( fHeight, seqCoordinates[ rSrcPt + 1 ].Second, sal_False, sal_True );
@@ -1587,10 +1631,11 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
fWidth *= fXScale;
fHeight*= fYScale;
- Point aP( (sal_Int32)( _aCenter.X() - fWidth ), (sal_Int32)( _aCenter.Y() - fHeight ) );
- Size aS( (sal_Int32)( fWidth * 2.0 ), (sal_Int32)( fHeight * 2.0 ) );
- Rectangle aRect( aP, aS );
- if ( aRect.GetWidth() && aRect.GetHeight() )
+ basegfx::B2DRange aRange(
+ _aCenter.getX() - fWidth, _aCenter.getY() - fHeight,
+ _aCenter.getX() + fWidth, _aCenter.getY() + fHeight);
+
+ if ( !basegfx::fTools::equalZero(aRange.getWidth()) && !basegfx::fTools::equalZero(aRange.getHeight()) )
{
double fStartAngle, fEndAngle;
GetParameter( fStartAngle, seqCoordinates[ rSrcPt + 2 ].First, sal_False, sal_False );
@@ -1611,13 +1656,24 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
fEndAngle = fTemp;
}
}
- double fCenterX = aRect.Center().X();
- double fCenterY = aRect.Center().Y();
+ double fCenterX = aRange.getCenterX();
+ double fCenterY = aRange.getCenterY();
double fx1 = ( cos( fStartAngle * F_PI180 ) * 65536.0 * fXScale ) + fCenterX;
double fy1 = ( -sin( fStartAngle * F_PI180 ) * 65536.0 * fYScale ) + fCenterY;
double fx2 = ( cos( fEndAngle * F_PI180 ) * 65536.0 * fXScale ) + fCenterX;
double fy2 = ( -sin( fEndAngle * F_PI180 ) * 65536.0 * fYScale ) + fCenterY;
- aNewB2DPolygon.append(CreateArc( aRect, Point( (sal_Int32)fx1, (sal_Int32)fy1 ), Point( (sal_Int32)fx2, (sal_Int32)fy2 ), sal_False));
+
+ const bool bMirrorX(fWidth < 0.0);
+ const bool bMirrorY(fHeight < 0.0);
+ const bool bSwap((bMirrorX || bMirrorY) && (bMirrorX != bMirrorY));
+ const basegfx::B2DPoint aTopLeft(fx1, fy1);
+ const basegfx::B2DPoint aBottomRight(fx2, fy2);
+ aNewB2DPolygon.append(
+ CreateArc( // TTTT: check CreateArc, completely changed from old tools polygon (!)
+ aRange,
+ bSwap ? aBottomRight : aTopLeft,
+ bSwap ? aTopLeft : aBottomRight,
+ sal_False));
}
else
{ /* SJ: TODO: this block should be replaced sometimes, because the current point
@@ -1625,33 +1681,33 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
point if ANGLEELLIPSETO was used, but the method CreateArc
is at the moment not able to draw full circles (if startangle is 0
and endangle 360 nothing is painted :-( */
- sal_Int32 nXControl = (sal_Int32)((double)aRect.GetWidth() * 0.2835 );
- sal_Int32 nYControl = (sal_Int32)((double)aRect.GetHeight() * 0.2835 );
- Point aCenter( aRect.Center() );
+ double fXControl(aRange.getWidth() * 0.2835);
+ double fYControl(aRange.getHeight() * 0.2835);
+ basegfx::B2DPoint aCenter( aRange.getCenter() );
// append start point
- aNewB2DPolygon.append(basegfx::B2DPoint(aCenter.X(), aRect.Top()));
+ aNewB2DPolygon.append(basegfx::B2DPoint(aCenter.getX(), aRange.getMinY()));
// append four bezier segments
aNewB2DPolygon.appendBezierSegment(
- basegfx::B2DPoint(aCenter.X() + nXControl, aRect.Top()),
- basegfx::B2DPoint(aRect.Right(), aCenter.Y() - nYControl),
- basegfx::B2DPoint(aRect.Right(), aCenter.Y()));
+ basegfx::B2DPoint(aCenter.getX() + fXControl, aRange.getMinY()),
+ basegfx::B2DPoint(aRange.getMaxX(), aCenter.getY() - fYControl),
+ basegfx::B2DPoint(aRange.getMaxX(), aCenter.getY()));
aNewB2DPolygon.appendBezierSegment(
- basegfx::B2DPoint(aRect.Right(), aCenter.Y() + nYControl),
- basegfx::B2DPoint(aCenter.X() + nXControl, aRect.Bottom()),
- basegfx::B2DPoint(aCenter.X(), aRect.Bottom()));
+ basegfx::B2DPoint(aRange.getMaxX(), aCenter.getY() + fYControl),
+ basegfx::B2DPoint(aCenter.getX() + fXControl, aRange.getMaxY()),
+ basegfx::B2DPoint(aCenter.getX(), aRange.getMaxY()));
aNewB2DPolygon.appendBezierSegment(
- basegfx::B2DPoint(aCenter.X() - nXControl, aRect.Bottom()),
- basegfx::B2DPoint(aRect.Left(), aCenter.Y() + nYControl),
- basegfx::B2DPoint(aRect.Left(), aCenter.Y()));
+ basegfx::B2DPoint(aCenter.getX() - fXControl, aRange.getMaxY()),
+ basegfx::B2DPoint(aRange.getMinX(), aCenter.getY() + fYControl),
+ basegfx::B2DPoint(aRange.getMinX(), aCenter.getY()));
aNewB2DPolygon.appendBezierSegment(
- basegfx::B2DPoint(aRect.Left(), aCenter.Y() - nYControl),
- basegfx::B2DPoint(aCenter.X() - nXControl, aRect.Top()),
- basegfx::B2DPoint(aCenter.X(), aRect.Top()));
+ basegfx::B2DPoint(aRange.getMinX(), aCenter.getY() - fYControl),
+ basegfx::B2DPoint(aCenter.getX() - fXControl, aRange.getMinY()),
+ basegfx::B2DPoint(aCenter.getX(), aRange.getMinY()));
// close, rescue last controlpoint, remove double last point
basegfx::tools::closeWithGeometryChange(aNewB2DPolygon);
@@ -1666,8 +1722,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
{
for ( sal_Int32 i(0L); ( i < nPntCount ) && ( rSrcPt < nCoordSize ); i++ )
{
- const Point aTempPoint(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
- aNewB2DPolygon.append(basegfx::B2DPoint(aTempPoint.X(), aTempPoint.Y()));
+ aNewB2DPolygon.append(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
}
}
break;
@@ -1691,18 +1746,29 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
sal_uInt32 nXor = bClockwise ? 3 : 2;
for ( sal_uInt16 i = 0; ( i < nPntCount ) && ( ( rSrcPt + 3 ) < nCoordSize ); i++ )
{
- Rectangle aRect( GetPoint( seqCoordinates[ rSrcPt ], sal_True, sal_True ), GetPoint( seqCoordinates[ rSrcPt + 1 ], sal_True, sal_True ) );
- if ( aRect.GetWidth() && aRect.GetHeight() )
+ const basegfx::B2DPoint aPointTL(GetPoint( seqCoordinates[ rSrcPt ], sal_True, sal_True ));
+ const basegfx::B2DPoint aPointBR(GetPoint( seqCoordinates[ rSrcPt + 1 ], sal_True, sal_True ));
+ basegfx::B2DRange aRange( aPointTL, aPointBR );
+
+ if ( !basegfx::fTools::equalZero(aRange.getWidth()) && !basegfx::fTools::equalZero(aRange.getHeight()) )
{
- Point aCenter( aRect.Center() );
- Point aStart( GetPoint( seqCoordinates[ (sal_uInt16)( rSrcPt + nXor ) ], sal_True, sal_True ) );
- Point aEnd( GetPoint( seqCoordinates[ (sal_uInt16)( rSrcPt + ( nXor ^ 1 ) ) ], sal_True, sal_True ) );
- double fRatio = (double)aRect.GetHeight() / (double)aRect.GetWidth();
- aStart.X() = (sal_Int32)( ( (double)( aStart.X() - aCenter.X() ) ) * fRatio ) + aCenter.X();
- aStart.Y() = (sal_Int32)( ( (double)( aStart.Y() - aCenter.Y() ) ) ) + aCenter.Y();
- aEnd.X() = (sal_Int32)( ( (double)( aEnd.X() - aCenter.X() ) ) * fRatio ) + aCenter.X();
- aEnd.Y() = (sal_Int32)( ( (double)( aEnd.Y() - aCenter.Y() ) ) ) + aCenter.Y();
- aNewB2DPolygon.append(CreateArc( aRect, aStart, aEnd, bClockwise));
+ basegfx::B2DPoint aCenter( aRange.getCenter() );
+ basegfx::B2DPoint aStart( GetPoint( seqCoordinates[ (sal_uInt16)( rSrcPt + nXor ) ], sal_True, sal_True ) );
+ basegfx::B2DPoint aEnd( GetPoint( seqCoordinates[ (sal_uInt16)( rSrcPt + ( nXor ^ 1 ) ) ], sal_True, sal_True ) );
+ double fRatio = aRange.getHeight() / aRange.getWidth();
+ aStart.setX((((aStart.getX() - aCenter.getX())) * fRatio) + aCenter.getX());
+ aStart.setY((((aStart.getY() - aCenter.getY()))) + aCenter.getY());
+ aEnd.setX((((aEnd.getX() - aCenter.getX())) * fRatio) + aCenter.getX());
+ aEnd.setY((((aEnd.getY() - aCenter.getY()))) + aCenter.getY());
+ const bool bMirrorX(aPointTL.getX() > aPointBR.getX());
+ const bool bMirrorY(aPointTL.getY() > aPointBR.getY());
+ const bool bSwap((bMirrorX || bMirrorY) && (bMirrorX != bMirrorY));
+ aNewB2DPolygon.append(
+ CreateArc( // TTTT: check CreateArc, completely changed from old tools polygon (!)
+ aRange,
+ bSwap ? aEnd : aStart,
+ bSwap ? aStart : aEnd,
+ bClockwise));
}
rSrcPt += 4;
}
@@ -1713,21 +1779,19 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
case ELLIPTICALQUADRANTY :
{
bool bFirstDirection(true);
- basegfx::B2DPoint aControlPointA;
- basegfx::B2DPoint aControlPointB;
for ( sal_uInt16 i = 0; ( i < nPntCount ) && ( rSrcPt < nCoordSize ); i++ )
{
sal_uInt32 nModT = ( nCommand == ELLIPTICALQUADRANTX ) ? 1 : 0;
- Point aCurrent( GetPoint( seqCoordinates[ rSrcPt ], sal_True, sal_True ) );
+ basegfx::B2DPoint aCurrent( GetPoint( seqCoordinates[ rSrcPt ], sal_True, sal_True ) );
if ( rSrcPt ) // we need a previous point
{
- Point aPrev( GetPoint( seqCoordinates[ rSrcPt - 1 ], sal_True, sal_True ) );
- sal_Int32 nX, nY;
- nX = aCurrent.X() - aPrev.X();
- nY = aCurrent.Y() - aPrev.Y();
- if ( ( nY ^ nX ) & 0x80000000 )
+ basegfx::B2DPoint aPrev( GetPoint( seqCoordinates[ rSrcPt - 1 ], sal_True, sal_True ) );
+ double fX(aCurrent.getX() - aPrev.getX());
+ double fY(aCurrent.getY() - aPrev.getY());
+
+ if((fX < 0.0 && fY > 0.0) || (fX > 0.0 && fY < 0.0))
{
if ( !i )
bFirstDirection = true;
@@ -1741,36 +1805,34 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
else if ( bFirstDirection )
nModT ^= 1;
}
+
if ( nModT ) // get the right corner
{
- nX = aCurrent.X();
- nY = aPrev.Y();
+ fX = aCurrent.getX();
+ fY = aPrev.getY();
}
else
{
- nX = aPrev.X();
- nY = aCurrent.Y();
+ fX = aPrev.getX();
+ fY = aCurrent.getY();
}
- sal_Int32 nXVec = ( nX - aPrev.X() ) >> 1;
- sal_Int32 nYVec = ( nY - aPrev.Y() ) >> 1;
- Point aControl1( aPrev.X() + nXVec, aPrev.Y() + nYVec );
-
- aControlPointA = basegfx::B2DPoint(aControl1.X(), aControl1.Y());
- nXVec = ( nX - aCurrent.X() ) >> 1;
- nYVec = ( nY - aCurrent.Y() ) >> 1;
- Point aControl2( aCurrent.X() + nXVec, aCurrent.Y() + nYVec );
+ const basegfx::B2DPoint aControlPointA(
+ aPrev.getX() + ((fX - aPrev.getX()) * 0.5),
+ aPrev.getY() + ((fY - aPrev.getY()) * 0.5));
- aControlPointB = basegfx::B2DPoint(aControl2.X(), aControl2.Y());
+ const basegfx::B2DPoint aControlPointB(
+ aCurrent.getX() + ((fX - aCurrent.getX()) * 0.5),
+ aCurrent.getY() + ((fY - aCurrent.getY()) * 0.5));
aNewB2DPolygon.appendBezierSegment(
aControlPointA,
aControlPointB,
- basegfx::B2DPoint(aCurrent.X(), aCurrent.Y()));
+ aCurrent);
}
else
{
- aNewB2DPolygon.append(basegfx::B2DPoint(aCurrent.X(), aCurrent.Y()));
+ aNewB2DPolygon.append(aCurrent);
}
rSrcPt++;
@@ -1826,9 +1888,11 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
{
basegfx::B2DPolyPolygon aClosedPolyPolygon(aNewB2DPolyPolygon);
aClosedPolyPolygon.setClosed(true);
- SdrPathObj* pFill = new SdrPathObj(OBJ_POLY, aClosedPolyPolygon);
+ SdrPathObj* pFill = new SdrPathObj(
+ pCustomShapeObj->getSdrModelFromSdrObject(),
+ aClosedPolyPolygon);
SfxItemSet aTempSet(*this);
- aTempSet.Put(SdrShadowItem(sal_False));
+ aTempSet.Put(SdrOnOffItem(SDRATTR_SHADOW, sal_False));
aTempSet.Put(XLineStyleItem(XLINE_NONE));
pFill->SetMergedItemSet(aTempSet);
rObjectList.push_back(pFill);
@@ -1841,10 +1905,10 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
// to correct the polygon (here: open it) using the type, the last edge may get lost.
// Thus, use a type that fits the polygon
SdrPathObj* pStroke = new SdrPathObj(
- aNewB2DPolyPolygon.isClosed() ? OBJ_POLY : OBJ_PLIN,
+ pCustomShapeObj->getSdrModelFromSdrObject(),
aNewB2DPolyPolygon);
SfxItemSet aTempSet(*this);
- aTempSet.Put(SdrShadowItem(sal_False));
+ aTempSet.Put(SdrOnOffItem(SDRATTR_SHADOW, sal_False));
aTempSet.Put(XFillStyleItem(XFILL_NONE));
pStroke->SetMergedItemSet(aTempSet);
rObjectList.push_back(pStroke);
@@ -1854,20 +1918,22 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
{
SdrPathObj* pObj = 0;
SfxItemSet aTempSet(*this);
- aTempSet.Put(SdrShadowItem(sal_False));
+ aTempSet.Put(SdrOnOffItem(SDRATTR_SHADOW, sal_False));
if(bNoFill)
{
// see comment above about OBJ_PLIN
pObj = new SdrPathObj(
- aNewB2DPolyPolygon.isClosed() ? OBJ_POLY : OBJ_PLIN,
+ pCustomShapeObj->getSdrModelFromSdrObject(),
aNewB2DPolyPolygon);
aTempSet.Put(XFillStyleItem(XFILL_NONE));
}
else
{
aNewB2DPolyPolygon.setClosed(true);
- pObj = new SdrPathObj(OBJ_POLY, aNewB2DPolyPolygon);
+ pObj = new SdrPathObj(
+ pCustomShapeObj->getSdrModelFromSdrObject(),
+ aNewB2DPolyPolygon);
}
if(bNoStroke)
@@ -1905,7 +1971,7 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve
for ( i = 0; i < vObjectList.size(); i++ )
{
SdrPathObj* pObj( vObjectList[ i ] );
- if(pObj->IsLine())
+ if(pObj->isLine())
{
nLine++;
if ( nLine == nLineObjectCount )
@@ -1929,7 +1995,7 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve
for ( i = 0; i < vObjectList.size(); i++ )
{
SdrPathObj* pObj( vObjectList[ i ] );
- if(pObj->IsLine())
+ if(pObj->isLine())
{
nLine++;
if ( nLine == 1 )
@@ -1956,7 +2022,7 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve
for ( i = 0; i < vObjectList.size(); i++ )
{
SdrPathObj* pObj( vObjectList[ i ] );
- if(pObj->IsLine())
+ if(pObj->isLine())
{
if ( nLine )
{
@@ -1977,7 +2043,7 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve
void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet,
sal_uInt32& nColorIndex, sal_uInt32 nColorCount)
{
- if ( !rObj.IsLine() )
+ if ( !rObj.isLine() )
{
const XFillStyle eFillStyle = ((const XFillStyleItem&)rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue();
switch( eFillStyle )
@@ -2059,7 +2125,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
sal_uInt16 nSegmentInd = 0;
std::vector< SdrPathObj* > vObjectList;
- sal_Bool bSortFilledObjectsToBack = SortFilledObjectsToBackByDefault( eSpType );
+ sal_Bool bSortFilledObjectsToBack = SortFilledObjectsToBackByDefault( meSpType );
while( nSegmentInd <= seqSegments.getLength() )
{
@@ -2089,9 +2155,13 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
//SJ: #i40600# if bLineGeometryNeededOnly is set linystyle does not matter
if( !bLineGeometryNeededOnly && ( XLINE_NONE == eLineStyle ) && ( XFILL_NONE == eFillStyle ) )
- delete pObj;
+ {
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
else
+ {
vTempList.push_back(pObj);
+ }
}
vObjectList = vTempList;
@@ -2112,7 +2182,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
{
SdrPathObj* pObj( vObjectList[ i ] );
- if(pObj->IsLine())
+ if(pObj->isLine())
{
nLineObjectCount++;
}
@@ -2125,7 +2195,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
// #i88870# correct line arrows for callouts
if ( nLineObjectCount )
- CorrectCalloutArrows( eSpType, nLineObjectCount, vObjectList );
+ CorrectCalloutArrows( meSpType, nLineObjectCount, vObjectList );
// sort objects so that filled ones are in front. Necessary
// for some strange objects
@@ -2137,7 +2207,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
{
SdrPathObj* pObj( vObjectList[ i ] );
- if ( !pObj->IsLine() )
+ if ( !pObj->isLine() )
{
vTempList.push_back(pObj);
}
@@ -2147,7 +2217,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
{
SdrPathObj* pObj( vObjectList[ i ] );
- if ( pObj->IsLine() )
+ if ( pObj->isLine() )
{
vTempList.push_back(pObj);
}
@@ -2164,26 +2234,19 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
// copy remaining objects to pRet
if(vObjectList.size() > 1L)
{
- pRet = new SdrObjGroup;
+ SdrObjGroup* pNewGroup = new SdrObjGroup(pCustomShapeObj->getSdrModelFromSdrObject());
+ pRet = pNewGroup;
for (i = 0L; i < vObjectList.size(); i++)
{
SdrObject* pObj(vObjectList[i]);
- pRet->GetSubList()->NbcInsertObject(pObj);
+ pNewGroup->InsertObjectToSdrObjList(*pObj);
}
}
else if(1L == vObjectList.size())
{
pRet = vObjectList[0L];
}
-
- if(pRet)
- {
- // move to target position
- Rectangle aCurRect(pRet->GetSnapRect());
- aCurRect.Move(aLogicRect.Left(), aLogicRect.Top());
- pRet->NbcSetSnapRect(aCurRect);
- }
}
return pRet;
@@ -2193,11 +2256,11 @@ SdrObject* EnhancedCustomShape2d::CreateObject( sal_Bool bLineGeometryNeededOnly
{
SdrObject* pRet = NULL;
- if ( eSpType == mso_sptRectangle )
+ if ( meSpType == mso_sptRectangle )
{
- pRet = new SdrRectObj( aLogicRect );
-// SJ: not setting model, so we save a lot of broadcasting and the model is not modified any longer
-// pRet->SetModel( pCustomShapeObj->GetModel() );
+ pRet = new SdrRectObj(
+ pCustomShapeObj->getSdrModelFromSdrObject(),
+ pCustomShapeObj->getSdrObjectTransformation());
pRet->SetMergedItemSet( *this );
}
if ( !pRet )
@@ -2218,13 +2281,6 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj )
aGluePoint.SetPos( GetPoint( seqGluePoints[ i ], sal_True, sal_True ) );
aGluePoint.SetPercent( sal_False );
-// const Point& rPoint = GetPoint( seqGluePoints[ i ], sal_True, sal_True );
-// double fXRel = rPoint.X();
-// double fYRel = rPoint.Y();
-// fXRel = aLogicRect.GetWidth() == 0 ? 0.0 : fXRel / aLogicRect.GetWidth() * 10000;
-// fYRel = aLogicRect.GetHeight() == 0 ? 0.0 : fYRel / aLogicRect.GetHeight() * 10000;
-// aGluePoint.SetPos( Point( (sal_Int32)fXRel, (sal_Int32)fYRel ) );
-// aGluePoint.SetPercent( sal_True );
aGluePoint.SetAlign( SDRVERTALIGN_TOP | SDRHORZALIGN_LEFT );
aGluePoint.SetEscDir( SDRESC_SMART );
SdrGluePointList* pList = pObj->ForceGluePointList();
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index a9cefa434939..43e695a480e2 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include "EnhancedCustomShape3d.hxx"
@@ -40,7 +38,6 @@
#include <svx/svdopath.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdpage.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/svddef.hxx>
#include <svx/svx3ditems.hxx>
#include <svx/extrud3d.hxx>
@@ -56,6 +53,10 @@
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
+#include <svx/scene3d.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <drawinglayer/attribute/sdrlineattribute.hxx>
#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
@@ -108,7 +109,7 @@ void GetSkew( SdrCustomShapeGeometryItem& rItem, double& rSkewAmount, double& rS
rSkewAngle *= F_PI180;
}
-void GetExtrusionDepth( SdrCustomShapeGeometryItem& rItem, const double* pMap, double& rBackwardDepth, double& rForwardDepth )
+void GetExtrusionDepth( SdrCustomShapeGeometryItem& rItem, const double fMap, double& rBackwardDepth, double& rForwardDepth )
{
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepthParaPair;
double fDepth = 0, fFraction = 0;
@@ -124,22 +125,20 @@ void GetExtrusionDepth( SdrCustomShapeGeometryItem& rItem, const double* pMap, d
rBackwardDepth = 1270;
rForwardDepth = 0;
}
- if ( pMap )
- {
- double fMap = *pMap;
- rBackwardDepth *= fMap;
- rForwardDepth *= fMap;
- }
+
+ rBackwardDepth *= fMap;
+ rForwardDepth *= fMap;
}
-double GetDouble( SdrCustomShapeGeometryItem& rItem, const rtl::OUString& rPropertyName, double fDefault, const double* pMap )
+double GetDouble( SdrCustomShapeGeometryItem& rItem, const rtl::OUString& rPropertyName, double fDefault, const double fMap )
{
double fRetValue = fDefault;
Any* pAny = rItem.GetPropertyValueByName( sExtrusion, rPropertyName );
if ( pAny )
*pAny >>= fRetValue;
- if ( pMap )
- fRetValue *= *pMap;
+
+ fRetValue *= fMap;
+
return fRetValue;
}
@@ -181,18 +180,17 @@ awt::Point GetPoint( SdrCustomShapeGeometryItem& rItem, const rtl::OUString& rPr
}
drawing::Position3D GetPosition3D( SdrCustomShapeGeometryItem& rItem, const rtl::OUString& rPropertyName,
- const drawing::Position3D& rDefault, const double* pMap )
+ const drawing::Position3D& rDefault, const double fMap )
{
drawing::Position3D aRetValue( rDefault );
const Any* pAny = rItem.GetPropertyValueByName( sExtrusion, rPropertyName );
if ( pAny )
*pAny >>= aRetValue;
- if ( pMap )
- {
- aRetValue.PositionX *= *pMap;
- aRetValue.PositionY *= *pMap;
- aRetValue.PositionZ *= *pMap;
- }
+
+ aRetValue.PositionX *= fMap;
+ aRetValue.PositionY *= fMap;
+ aRetValue.PositionZ *= fMap;
+
return aRetValue;
}
@@ -205,208 +203,216 @@ drawing::Direction3D GetDirection3D( SdrCustomShapeGeometryItem& rItem, const rt
return aRetValue;
}
-EnhancedCustomShape3d::Transformation2D::Transformation2D( const SdrObject* pCustomShape, const Rectangle& /*rBoundRect*/, const double *pM )
-: aCenter( pCustomShape->GetSnapRect().Center() )
-, eProjectionMode( drawing::ProjectionMode_PARALLEL )
-, pMap( pM )
+EnhancedCustomShape3d::Transformation2D::Transformation2D(const SdrObjCustomShape& rCustomShape, const double fM)
+: maCenter()
+, meProjectionMode(drawing::ProjectionMode_PARALLEL)
+, mfMap(fM)
{
- SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
- Any* pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, sProjectionMode );
- if ( pAny )
- *pAny >>= eProjectionMode;
+ SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)rCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY);
+ const rtl::OUString sProjectionMode(RTL_CONSTASCII_USTRINGPARAM("ProjectionMode"));
+ Any* pAny = rGeometryItem.GetPropertyValueByName(sExtrusion, sProjectionMode);
+ maCenter = rCustomShape.getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5);
- if ( eProjectionMode == drawing::ProjectionMode_PARALLEL )
- GetSkew( rGeometryItem, fSkew, fSkewAngle );
+ if(pAny)
+ {
+ *pAny >>= meProjectionMode;
+ }
+
+ if(drawing::ProjectionMode_PARALLEL == meProjectionMode)
+ {
+ GetSkew(rGeometryItem, mfSkew, mfSkewAngle);
+ }
else
{
- fZScreen = 0.0;
- GetOrigin( rGeometryItem, fOriginX, fOriginY );
- fOriginX = fOriginX * pCustomShape->GetLogicRect().GetWidth();
- fOriginY = fOriginY * pCustomShape->GetLogicRect().GetHeight();
-
- const rtl::OUString sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
- drawing::Position3D aViewPointDefault( 3472, -3472, 25000 );
- drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, sViewPoint, aViewPointDefault, pMap ) );
- fViewPoint.setX(aViewPoint.PositionX);
- fViewPoint.setY(aViewPoint.PositionY);
- fViewPoint.setZ(-aViewPoint.PositionZ);
+ const basegfx::B2DVector& rScale = rCustomShape.getSdrObjectScale();
+ const rtl::OUString sViewPoint(RTL_CONSTASCII_USTRINGPARAM("ViewPoint"));
+
+ mfZScreen = 0.0;
+ GetOrigin(rGeometryItem, mfOriginX, mfOriginY);
+ mfOriginX *= fabs(rScale.getX());
+ mfOriginY *= fabs(rScale.getY());
+ drawing::Position3D aViewPointDefault(3472, -3472, 25000);
+ drawing::Position3D aViewPoint(GetPosition3D(rGeometryItem, sViewPoint, aViewPointDefault, mfMap));
+ mfViewPoint.setX(aViewPoint.PositionX);
+ mfViewPoint.setY(aViewPoint.PositionY);
+ mfViewPoint.setZ(-aViewPoint.PositionZ);
}
}
-basegfx::B3DPolygon EnhancedCustomShape3d::Transformation2D::ApplySkewSettings( const basegfx::B3DPolygon& rPoly3D ) const
+basegfx::B3DPolygon EnhancedCustomShape3d::Transformation2D::ApplySkewSettings(const basegfx::B3DPolygon& rPoly3D) const
{
basegfx::B3DPolygon aRetval;
-
sal_uInt32 j;
- for ( j = 0L; j < rPoly3D.count(); j++ )
+
+ for(j = 0; j < rPoly3D.count(); j++)
{
const basegfx::B3DPoint aPoint(rPoly3D.getB3DPoint(j));
- double fDepth(-( aPoint.getZ() * fSkew ) / 100.0);
- aRetval.append(basegfx::B3DPoint(
- aPoint.getX() + (fDepth * cos( fSkewAngle )),
- aPoint.getY() - (fDepth * sin( fSkewAngle )),
- aPoint.getZ()));
+ double fDepth(-(aPoint.getZ() * mfSkew) / 100.0);
+
+ aRetval.append(
+ basegfx::B3DPoint(
+ aPoint.getX() + (fDepth * cos(mfSkewAngle)),
+ aPoint.getY() - (fDepth * sin(mfSkewAngle)),
+ aPoint.getZ()));
}
return aRetval;
}
-Point EnhancedCustomShape3d::Transformation2D::Transform2D( const basegfx::B3DPoint& rPoint3D ) const
+basegfx::B2DPoint EnhancedCustomShape3d::Transformation2D::Transform2D(const basegfx::B3DPoint& rPoint3D) const
{
- Point aPoint2D;
- if ( eProjectionMode == drawing::ProjectionMode_PARALLEL )
+ basegfx::B2DPoint aPoint2D;
+
+ if(drawing::ProjectionMode_PARALLEL == meProjectionMode)
{
- aPoint2D.X() = (sal_Int32)rPoint3D.getX();
- aPoint2D.Y() = (sal_Int32)rPoint3D.getY();
+ aPoint2D.setX(rPoint3D.getX());
+ aPoint2D.setY(rPoint3D.getY());
}
else
{
- double fX = rPoint3D.getX() - fOriginX;
- double fY = rPoint3D.getY() - fOriginY;
- double f = ( fZScreen - fViewPoint.getZ() ) / ( rPoint3D.getZ() - fViewPoint.getZ() );
- aPoint2D.X() = (sal_Int32)(( fX - fViewPoint.getX() ) * f + fViewPoint.getX() + fOriginX );
- aPoint2D.Y() = (sal_Int32)(( fY - fViewPoint.getY() ) * f + fViewPoint.getY() + fOriginY );
+ const double fX(rPoint3D.getX() - mfOriginX);
+ const double fY(rPoint3D.getY() - mfOriginY);
+ const double f((mfZScreen - mfViewPoint.getZ()) / (rPoint3D.getZ() - mfViewPoint.getZ()));
+
+ aPoint2D.setX((fX - mfViewPoint.getX()) * f + mfViewPoint.getX() + mfOriginX);
+ aPoint2D.setY((fY - mfViewPoint.getY()) * f + mfViewPoint.getY() + mfOriginY);
}
- aPoint2D.Move( aCenter.X(), aCenter.Y() );
+
+ aPoint2D += maCenter;
+
return aPoint2D;
}
-sal_Bool EnhancedCustomShape3d::Transformation2D::IsParallel() const
+bool EnhancedCustomShape3d::Transformation2D::IsParallel() const
{
- return eProjectionMode == com::sun::star::drawing::ProjectionMode_PARALLEL;
+ return meProjectionMode == com::sun::star::drawing::ProjectionMode_PARALLEL;
}
-SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, const SdrObject* pCustomShape )
+SdrObject* EnhancedCustomShape3d::Create3DObject(const SdrObject& rShape2d, const SdrObjCustomShape& rCustomShape)
{
- SdrObject* pRet = NULL;
- SdrModel* pModel = pCustomShape->GetModel();
- SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
+ SdrObject* pRet = 0;
+ SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)rCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY);
+ double fMap(1.0);
+ const double fFraction(rCustomShape.getSdrModelFromSdrObject().GetExchangeObjectScale());
- double fMap, *pMap = NULL;
- if ( pModel )
+ if(!basegfx::fTools::equal(fFraction, 1.0))
{
- fMap = 1.0;
- Fraction aFraction( pModel->GetScaleFraction() );
- if ( ( aFraction.GetNumerator() ) != 1 || ( aFraction.GetDenominator() != 1 ) )
- {
- fMap *= aFraction.GetNumerator();
- fMap /= aFraction.GetDenominator();
- pMap = &fMap;
- }
- if ( pModel->GetScaleUnit() != MAP_100TH_MM )
- {
- DBG_ASSERT( pModel->GetScaleUnit() == MAP_TWIP, "EnhancedCustomShape3d::Current MapMode is Unsupported" );
- fMap *= 1440.0 / 2540.0;
- pMap = &fMap;
- }
+ fMap *= fFraction;
}
- if ( GetBool( rGeometryItem, sExtrusion, sal_False ) )
+
+ if(MAP_100TH_MM != rCustomShape.getSdrModelFromSdrObject().GetExchangeObjectUnit())
{
- sal_Bool bIsMirroredX = ((SdrObjCustomShape*)pCustomShape)->IsMirroredX();
- sal_Bool bIsMirroredY = ((SdrObjCustomShape*)pCustomShape)->IsMirroredY();
- Rectangle aSnapRect( pCustomShape->GetLogicRect() );
- long nObjectRotation = pCustomShape->GetRotateAngle();
- if ( nObjectRotation )
- {
- double a = ( 36000 - nObjectRotation ) * nPi180;
- long dx = aSnapRect.Right() - aSnapRect.Left();
- long dy = aSnapRect.Bottom()- aSnapRect.Top();
- Point aP( aSnapRect.TopLeft() );
- RotatePoint( aP, pCustomShape->GetSnapRect().Center(), sin( a ), cos( a ) );
- aSnapRect.Left() = aP.X();
- aSnapRect.Top() = aP.Y();
- aSnapRect.Right() = aSnapRect.Left() + dx;
- aSnapRect.Bottom() = aSnapRect.Top() + dy;
- }
- Point aCenter( aSnapRect.Center() );
+ DBG_ASSERT(MAP_TWIP == rCustomShape.getSdrModelFromSdrObject().GetExchangeObjectUnit(),
+ "EnhancedCustomShape3d::Current MapMode is Unsupported");
+ fMap *= 1440.0 / 2540.0;
+ }
- SfxItemSet aSet( pCustomShape->GetMergedItemSet() );
+ if(GetBool(rGeometryItem, sExtrusion, false))
+ {
+ const bool bIsMirroredX(rShape2d.isMirroredX()); // TTTT: rCustomShape.IsMirroredX()); Check if rShape2d is correct here
+ const bool bIsMirroredY(rShape2d.isMirroredY()); // TTTT: rCustomShape.IsMirroredY()); And if needed at all...
+ basegfx::B2DRange aSnapRange(basegfx::B2DRange::getUnitB2DRange());
+ SfxItemSet aSet(rCustomShape.GetMergedItemSet());
+ std::vector< E3dCompoundObject* > aPlaceholderObjectList;
+ double fExtrusionBackward(0.0), fExtrusionForward(0.0);
+
+ // take transformation into account, including rotation and shear
+ aSnapRange.transform(rCustomShape.getSdrObjectTransformation());
//SJ: vertical writing is not required, by removing this item no outliner is created
- aSet.ClearItem( SDRATTR_TEXTDIRECTION );
+ 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.
+ // do NOT remove it from the ItemSet here.
// aSet.ClearItem(SDRATTR_SHADOW);
- std::vector< E3dCompoundObject* > aPlaceholderObjectList;
+ GetExtrusionDepth(rGeometryItem, fMap, fExtrusionBackward, fExtrusionForward);
+ double fDepth(fExtrusionBackward - fExtrusionForward);
- double fExtrusionBackward, fExtrusionForward;
- GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward );
- double fDepth = fExtrusionBackward - fExtrusionForward;
- if ( fDepth < 1.0 )
+ if(fDepth < 1.0)
+ {
fDepth = 1.0;
+ }
+
+ drawing::ProjectionMode eProjectionMode(drawing::ProjectionMode_PARALLEL);
+ const rtl::OUString sProjectionMode(RTL_CONSTASCII_USTRINGPARAM("ProjectionMode"));
+ Any* pAny = rGeometryItem.GetPropertyValueByName(sExtrusion, sProjectionMode);
- drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PARALLEL );
- const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
- Any* pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, sProjectionMode );
- if ( pAny )
+ if(pAny)
+ {
*pAny >>= eProjectionMode;
- ProjectionType eProjectionType( eProjectionMode == drawing::ProjectionMode_PARALLEL ? PR_PARALLEL : PR_PERSPECTIVE );
+ }
- // pShape2d Umwandeln in Szene mit 3D Objekt
+ ProjectionType eProjectionType(drawing::ProjectionMode_PARALLEL == eProjectionMode ? PR_PARALLEL : PR_PERSPECTIVE);
+
+ // rShape2d Umwandeln in Szene mit 3D Objekt
E3dDefaultAttributes a3DDefaultAttr;
- a3DDefaultAttr.SetDefaultLatheCharacterMode( sal_True );
- a3DDefaultAttr.SetDefaultExtrudeCharacterMode( sal_True );
- E3dScene* pScene = new E3dPolyScene( a3DDefaultAttr );
+ a3DDefaultAttr.SetDefaultLatheCharacterMode(true);
+ a3DDefaultAttr.SetDefaultExtrudeCharacterMode(true);
- sal_Bool bSceneHasObjects ( sal_False );
- sal_Bool bUseTwoFillStyles( sal_False );
+ E3dScene* pScene = new E3dScene(rCustomShape.getSdrModelFromSdrObject(), a3DDefaultAttr);
- drawing::ShadeMode eShadeMode( GetShadeMode( rGeometryItem, drawing::ShadeMode_FLAT ) );
- const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
- sal_Bool bUseExtrusionColor = GetBool( rGeometryItem, sExtrusionColor, sal_False );
+ bool bSceneHasObjects(false);
+ bool bUseTwoFillStyles(false);
+ const drawing::ShadeMode eShadeMode(GetShadeMode(rGeometryItem, drawing::ShadeMode_FLAT));
+ const rtl::OUString sExtrusionColor(RTL_CONSTASCII_USTRINGPARAM("Color"));
+ const bool bUseExtrusionColor(GetBool(rGeometryItem, sExtrusionColor, false));
+ const XFillStyle eFillStyle(ITEMVALUE(aSet, XATTR_FILLSTYLE, XFillStyleItem));
- XFillStyle eFillStyle( ITEMVALUE( aSet, XATTR_FILLSTYLE, XFillStyleItem ) );
- pScene->GetProperties().SetObjectItem( Svx3DShadeModeItem( 0 ) );
- aSet.Put( Svx3DPercentDiagonalItem( 0 ) );
- aSet.Put( Svx3DTextureModeItem( 1 ) );
- aSet.Put( Svx3DNormalsKindItem( 1 ) );
+ pScene->GetProperties().SetObjectItem(Svx3DShadeModeItem(0));
+ aSet.Put(SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, 0));
+ aSet.Put(Svx3DTextureModeItem(1));
+ aSet.Put(Svx3DNormalsKindItem(1));
- if ( eShadeMode == drawing::ShadeMode_DRAFT )
+ if(drawing::ShadeMode_DRAFT == eShadeMode)
{
- aSet.Put( XLineStyleItem( XLINE_SOLID ) );
- aSet.Put( XFillStyleItem ( XFILL_NONE ) );
- aSet.Put( Svx3DDoubleSidedItem( sal_True ) );
+ aSet.Put(XLineStyleItem(XLINE_SOLID));
+ aSet.Put(XFillStyleItem(XFILL_NONE));
+ aSet.Put(SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, true));
}
else
{
- aSet.Put( XLineStyleItem( XLINE_NONE ) );
- if ( eFillStyle == XFILL_NONE )
- aSet.Put( XFillStyleItem( XFILL_SOLID ) );
- else if ( ( eFillStyle == XFILL_BITMAP ) || ( eFillStyle == XFILL_GRADIENT ) || bUseExtrusionColor )
- bUseTwoFillStyles = sal_True;
+ aSet.Put(XLineStyleItem(XLINE_NONE));
+
+ if(XFILL_NONE == eFillStyle)
+ {
+ aSet.Put(XFillStyleItem(XFILL_SOLID));
+ }
+ else if(XFILL_BITMAP == eFillStyle || XFILL_GRADIENT == eFillStyle || bUseExtrusionColor)
+ {
+ bUseTwoFillStyles = true;
+ }
// #116336#
// If shapes are mirrored once (mirroring two times correct geometry again)
// double-sided at the object and two-sided-lighting at the scene need to be set.
if((bIsMirroredX && !bIsMirroredY) || (!bIsMirroredX && bIsMirroredY))
{
- aSet.Put( Svx3DDoubleSidedItem( sal_True ) );
- pScene->GetProperties().SetObjectItem( Svx3DTwoSidedLightingItem( sal_True ) );
+ aSet.Put(SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, true));
+
+ pScene->GetProperties().SetObjectItem(SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, true));
}
}
- Rectangle aBoundRect2d;
- SdrObjListIter aIter( *pShape2d, IM_DEEPNOGROUPS );
+ basegfx::B2DRange aAllPolyPolygonRange;
+ SdrObjListIter aIter(rShape2d, IM_DEEPWITHGROUPS);
const bool bMultipleSubObjects(aIter.Count() > 1);
- while( aIter.IsMore() )
+ while(aIter.IsMore())
{
const SdrObject* pNext = aIter.Next();
- sal_Bool bIsPlaceholderObject = (((XFillStyleItem&)pNext->GetMergedItem( XATTR_FILLSTYLE )).GetValue() == XFILL_NONE )
- && (((XLineStyleItem&)pNext->GetMergedItem( XATTR_LINESTYLE )).GetValue() == XLINE_NONE );
basegfx::B2DPolyPolygon aPolyPoly;
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pNext);
SfxItemSet aLocalSet(aSet);
XFillStyle aLocalFillStyle(eFillStyle);
- if ( pNext->ISA( SdrPathObj ) )
+ if(pSdrPathObj)
{
+ aPolyPoly = pSdrPathObj->getB2DPolyPolygonInObjectCoordinates();
const SfxItemSet& rSet = pNext->GetMergedItemSet();
bool bNeedToConvertToContour(false);
@@ -446,7 +452,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
if(pNewPathObj)
{
- aPolyPoly = pNewPathObj->GetPathPoly();
+ aPolyPoly = pNewPathObj->getB2DPolyPolygonInObjectCoordinates();
if(aPolyPoly.isClosed())
{
@@ -477,20 +483,20 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
}
}
- SdrObject::Free(pNewObj);
- }
- else
- {
- aPolyPoly = ((SdrPathObj*)pNext)->GetPathPoly();
+ deleteSdrObjectSafeAndClearPointer(pNewObj);
}
}
else
{
- SdrObject* pNewObj = pNext->ConvertToPolyObj( sal_False, sal_False );
- SdrPathObj* pPath = PTR_CAST( SdrPathObj, pNewObj );
- if ( pPath )
- aPolyPoly = pPath->GetPathPoly();
- SdrObject::Free( pNewObj );
+ SdrObject* pNewObj = pNext->ConvertToPolyObj(false, false);
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(pNewObj);
+
+ if(pPath)
+ {
+ aPolyPoly = pPath->getB2DPolyPolygonInObjectCoordinates();
+ }
+
+ deleteSdrObjectSafeAndClearPointer(pNewObj);
}
if( aPolyPoly.count() )
@@ -500,90 +506,133 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
aPolyPoly = basegfx::tools::adaptiveSubdivideByAngle(aPolyPoly);
}
- const basegfx::B2DRange aTempRange(basegfx::tools::getRange(aPolyPoly));
- const Rectangle aBoundRect(basegfx::fround(aTempRange.getMinX()), basegfx::fround(aTempRange.getMinY()), basegfx::fround(aTempRange.getMaxX()), basegfx::fround(aTempRange.getMaxY()));
- aBoundRect2d.Union( aBoundRect );
+ const basegfx::B2DRange aPolyPolygonRange(aPolyPoly.getB2DRange());
+
+ aAllPolyPolygonRange.expand(aPolyPolygonRange);
+
+ E3dCompoundObject* p3DObj = new E3dExtrudeObj(
+ rCustomShape.getSdrModelFromSdrObject(),
+ a3DDefaultAttr,
+ aPolyPoly,
+ bUseTwoFillStyles ? 10 : fDepth);
+
+ p3DObj->SetLayer(rShape2d.GetLayer());
+ p3DObj->SetMergedItemSet(aLocalSet);
- E3dCompoundObject* p3DObj = new E3dExtrudeObj( a3DDefaultAttr, aPolyPoly, bUseTwoFillStyles ? 10 : fDepth );
- p3DObj->NbcSetLayer( pShape2d->GetLayer() );
- p3DObj->SetMergedItemSet( aLocalSet );
- if ( bIsPlaceholderObject )
- aPlaceholderObjectList.push_back( p3DObj );
- else if ( bUseTwoFillStyles )
+ const bool bIsPlaceholderObject(
+ XFILL_NONE == ((XFillStyleItem&)pNext->GetMergedItem( XATTR_FILLSTYLE )).GetValue()
+ && XLINE_NONE == ((XLineStyleItem&)pNext->GetMergedItem( XATTR_LINESTYLE )).GetValue());
+
+ if(bIsPlaceholderObject)
+ {
+ aPlaceholderObjectList.push_back(p3DObj);
+ }
+ else if(bUseTwoFillStyles)
{
BitmapEx aFillBmp;
- sal_Bool bFillBmpTile = ((XFillBmpTileItem&)p3DObj->GetMergedItem( XATTR_FILLBMP_TILE )).GetValue();
- if ( bFillBmpTile )
+ const bool bFillBmpTile(((XFillBmpTileItem&)p3DObj->GetMergedItem( XATTR_FILLBMP_TILE )).GetValue());
+
+ if(bFillBmpTile)
{
const XFillBitmapItem& rBmpItm = (XFillBitmapItem&)p3DObj->GetMergedItem(XATTR_FILLBITMAP);
+
aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx();
- Size aLogicalSize = aFillBmp.GetPrefSize();
- if ( aFillBmp.GetPrefMapMode() == MAP_PIXEL )
- aLogicalSize = Application::GetDefaultDevice()->PixelToLogic( aLogicalSize, MAP_100TH_MM );
+
+ Size aLogicalSize(aFillBmp.GetPrefSize());
+
+ if(MapMode(MAP_PIXEL) == aFillBmp.GetPrefMapMode())
+ {
+ aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, MAP_100TH_MM);
+ }
else
- aLogicalSize = OutputDevice::LogicToLogic( aLogicalSize, aFillBmp.GetPrefMapMode(), MAP_100TH_MM );
- aLogicalSize.Width() *= 5; ;// :-( nice scaling, look at engine3d/obj3d.cxx
+ {
+ aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, aFillBmp.GetPrefMapMode(), MAP_100TH_MM);
+ }
+
+ aLogicalSize.Width() *= 5; // :-( nice scaling, look at engine3d/obj3d.cxx
aLogicalSize.Height() *= 5;
- aFillBmp.SetPrefSize( aLogicalSize );
- aFillBmp.SetPrefMapMode( MAP_100TH_MM );
+ aFillBmp.SetPrefSize(aLogicalSize);
+ aFillBmp.SetPrefMapMode(MAP_100TH_MM);
p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp)));
}
else
{
- if ( aSnapRect != aBoundRect )
+ if(!aSnapRange.equal(aPolyPolygonRange))
{
const XFillBitmapItem& rBmpItm = (XFillBitmapItem&)p3DObj->GetMergedItem(XATTR_FILLBITMAP);
+
aFillBmp = rBmpItm.GetGraphicObject().GetGraphic().GetBitmapEx();
- Size aBmpSize( aFillBmp.GetSizePixel() );
- double fXScale = (double)aBoundRect.GetWidth() / (double)aSnapRect.GetWidth();
- double fYScale = (double)aBoundRect.GetHeight() / (double)aSnapRect.GetHeight();
-
- Point aPt( (sal_Int32)( (double)( aBoundRect.Left() - aSnapRect.Left() )* (double)aBmpSize.Width() / (double)aSnapRect.GetWidth() ),
- (sal_Int32)( (double)( aBoundRect.Top() - aSnapRect.Top() ) * (double)aBmpSize.Height() / (double)aSnapRect.GetHeight() ) );
- Size aSize( (sal_Int32)( aBmpSize.Width() * fXScale ),
- (sal_Int32)( aBmpSize.Height() * fYScale ) );
- Rectangle aCropRect( aPt, aSize );
- aFillBmp.Crop( aCropRect );
+
+ const Size aBmpSize(aFillBmp.GetSizePixel());
+ const double fXScale(aPolyPolygonRange.getWidth() / aSnapRange.getWidth());
+ const double fYScale(aPolyPolygonRange.getHeight() / aSnapRange.getHeight());
+
+ const Point aPt(
+ basegfx::fround((aPolyPolygonRange.getMinX() - aSnapRange.getMinX()) * (double)aBmpSize.Width() / aSnapRange.getWidth()),
+ basegfx::fround((aPolyPolygonRange.getMinY() - aSnapRange.getMinY()) * (double)aBmpSize.Height() / aSnapRange.getHeight()));
+ const Size aSize(
+ basegfx::fround((double)aBmpSize.Width() * fXScale),
+ basegfx::fround((double)aBmpSize.Height() * fYScale));
+ const Rectangle aCropRect(aPt, aSize);
+
+ aFillBmp.Crop(aCropRect);
p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp)));
}
}
- pScene->Insert3DObj( p3DObj );
- p3DObj = new E3dExtrudeObj( a3DDefaultAttr, aPolyPoly, fDepth );
- p3DObj->NbcSetLayer( pShape2d->GetLayer() );
- p3DObj->SetMergedItemSet( aLocalSet );
- if ( bUseExtrusionColor )
- p3DObj->SetMergedItem( XFillColorItem( String(), ((XSecondaryFillColorItem&)pCustomShape->GetMergedItem( XATTR_SECONDARYFILLCOLOR )).GetColorValue() ) );
- p3DObj->SetMergedItem( XFillStyleItem( XFILL_SOLID ) );
- p3DObj->SetMergedItem( Svx3DCloseFrontItem( sal_False ) );
- p3DObj->SetMergedItem( Svx3DCloseBackItem( sal_False ) );
- pScene->Insert3DObj( p3DObj );
- p3DObj = new E3dExtrudeObj( a3DDefaultAttr, aPolyPoly, 10 );
- p3DObj->NbcSetLayer( pShape2d->GetLayer() );
- p3DObj->SetMergedItemSet( aLocalSet );
-
- basegfx::B3DHomMatrix aFrontTransform( p3DObj->GetTransform() );
- aFrontTransform.translate( 0.0, 0.0, fDepth );
- p3DObj->NbcSetTransform( aFrontTransform );
-
- if ( ( aLocalFillStyle == XFILL_BITMAP ) && !aFillBmp.IsEmpty() )
+
+ pScene->Insert3DObj(*p3DObj);
+ p3DObj = new E3dExtrudeObj(
+ rCustomShape.getSdrModelFromSdrObject(),
+ a3DDefaultAttr,
+ aPolyPoly,
+ fDepth);
+ p3DObj->SetLayer(rShape2d.GetLayer());
+ p3DObj->SetMergedItemSet(aLocalSet);
+
+ if(bUseExtrusionColor)
+ {
+ p3DObj->SetMergedItem(XFillColorItem(String(), ((XSecondaryFillColorItem&)rCustomShape.GetMergedItem(XATTR_SECONDARYFILLCOLOR)).GetColorValue()));
+ }
+
+ p3DObj->SetMergedItem(XFillStyleItem(XFILL_SOLID));
+ p3DObj->SetMergedItem(Svx3DCloseFrontItem(false));
+ p3DObj->SetMergedItem(Svx3DCloseBackItem(false));
+ pScene->Insert3DObj(*p3DObj);
+
+ p3DObj = new E3dExtrudeObj(
+ rCustomShape.getSdrModelFromSdrObject(),
+ a3DDefaultAttr,
+ aPolyPoly,
+ 10);
+ p3DObj->SetLayer(rShape2d.GetLayer());
+ p3DObj->SetMergedItemSet(aLocalSet);
+
+ basegfx::B3DHomMatrix aFrontTransform(p3DObj->GetB3DTransform());
+
+ aFrontTransform.translate(0.0, 0.0, fDepth);
+ p3DObj->SetB3DTransform(aFrontTransform);
+
+ if(XFILL_BITMAP == aLocalFillStyle && !aFillBmp.IsEmpty())
{
p3DObj->SetMergedItem(XFillBitmapItem(String(), Graphic(aFillBmp)));
}
}
- else if ( aLocalFillStyle == XFILL_NONE )
+ else if(XFILL_NONE == eFillStyle)
{
- XLineColorItem& rLineColor = (XLineColorItem&)p3DObj->GetMergedItem( XATTR_LINECOLOR );
- p3DObj->SetMergedItem( XFillColorItem( String(), rLineColor.GetColorValue() ) );
- p3DObj->SetMergedItem( Svx3DDoubleSidedItem( sal_True ) );
- p3DObj->SetMergedItem( Svx3DCloseFrontItem( sal_False ) );
- p3DObj->SetMergedItem( Svx3DCloseBackItem( sal_False ) );
+ const XLineColorItem& rLineColor = (XLineColorItem&)p3DObj->GetMergedItem(XATTR_LINECOLOR);
+
+ p3DObj->SetMergedItem(XFillColorItem(String(), rLineColor.GetColorValue()));
+ p3DObj->SetMergedItem(SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, true));
+ p3DObj->SetMergedItem(Svx3DCloseFrontItem(false));
+ p3DObj->SetMergedItem(Svx3DCloseBackItem(false));
}
- pScene->Insert3DObj( p3DObj );
- bSceneHasObjects = sal_True;
+
+ pScene->Insert3DObj(*p3DObj);
+ bSceneHasObjects = true;
}
}
- if ( bSceneHasObjects ) // is the SdrObject properly converted
+ if(bSceneHasObjects) // is the SdrObject properly converted
{
// then we can change the return value
pRet = pScene;
@@ -591,51 +640,75 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
// Kameraeinstellungen, Perspektive ...
Camera3D& rCamera = (Camera3D&)pScene->GetCamera();
const basegfx::B3DRange& rVolume = pScene->GetBoundVolume();
- pScene->NbcSetSnapRect( aSnapRect );
+ sdr::legacy::SetSnapRange(*pScene, aSnapRange);
// InitScene replacement
- double fW = rVolume.getWidth();
- double fH = rVolume.getHeight();
-
- rCamera.SetAutoAdjustProjection( sal_False );
- rCamera.SetViewWindow( -fW / 2, - fH / 2, fW, fH);
- basegfx::B3DPoint aLookAt( 0.0, 0.0, 0.0 );
- basegfx::B3DPoint aCamPos( 0.0, 0.0, 100.0 );
- rCamera.SetDefaults( basegfx::B3DPoint( 0.0, 0.0, 100.0 ), aLookAt, 100.0 );
- rCamera.SetPosAndLookAt( aCamPos, aLookAt );
- rCamera.SetFocalLength( 1.0 );
- rCamera.SetProjection( eProjectionType );
- pScene->SetCamera( rCamera );
- pScene->SetRectsDirty();
+ const double fW(rVolume.getWidth());
+ const double fH(rVolume.getHeight());
+
+ rCamera.SetAutoAdjustProjection(false);
+ rCamera.SetViewWindow(-fW / 2, - fH / 2, fW, fH);
+ basegfx::B3DPoint aLookAt(0.0, 0.0, 0.0);
+ basegfx::B3DPoint aCamPos(0.0, 0.0, 100.0);
+ rCamera.SetDefaults(basegfx::B3DPoint(0.0, 0.0, 100.0), aLookAt, 100.0);
+ rCamera.SetPosAndLookAt(aCamPos, aLookAt);
+ rCamera.SetFocalLength(1.0);
+ rCamera.SetProjection(eProjectionType);
+ pScene->SetCamera(rCamera);
+ pScene->ActionChanged();
double fOriginX, fOriginY;
- GetOrigin( rGeometryItem, fOriginX, fOriginY );
- fOriginX = fOriginX * aSnapRect.GetWidth();
- fOriginY = fOriginY * aSnapRect.GetHeight();
- basegfx::B3DHomMatrix aNewTransform( pScene->GetTransform() );
- aNewTransform.translate( -aCenter.X(), aCenter.Y(), -pScene->GetBoundVolume().getDepth() );
+ GetOrigin(rGeometryItem, fOriginX, fOriginY);
+ fOriginX = fOriginX * aSnapRange.getWidth();
+ fOriginY = fOriginY * aSnapRange.getHeight();
+
+ basegfx::B3DHomMatrix aNewTransform(pScene->GetB3DTransform());
+
+ aNewTransform.translate(-aSnapRange.getCenterX(), aSnapRange.getCenterY(), -pScene->GetBoundVolume().getDepth());
double fXRotate, fYRotate;
- GetRotateAngle( rGeometryItem, fXRotate, fYRotate );
- double fZRotate = ((SdrObjCustomShape*)pCustomShape)->GetObjectRotation() * F_PI180;
- if ( fZRotate != 0.0 )
- aNewTransform.rotate( 0.0, 0.0, fZRotate );
- if ( bIsMirroredX )
- aNewTransform.scale( -1.0, 1, 1 );
- if ( bIsMirroredY )
- aNewTransform.scale( 1, -1.0, 1 );
- if( fYRotate != 0.0 )
- aNewTransform.rotate( 0.0, -fYRotate, 0.0 );
- if( fXRotate != 0.0 )
- aNewTransform.rotate( -fXRotate, 0.0, 0.0 );
- if ( eProjectionType == PR_PARALLEL )
+
+ GetRotateAngle(rGeometryItem, fXRotate, fYRotate);
+
+ // TTTT: const double fZRotate(rCustomShape.GetObjectRotation() * F_PI180);
+ const double fZRotate(rCustomShape.getSdrObjectRotate());
+
+ if(0.0 != fZRotate)
+ {
+ aNewTransform.rotate(0.0, 0.0, fZRotate);
+ }
+
+ if(bIsMirroredX)
+ {
+ aNewTransform.scale(-1.0, 1.0, 1.0);
+ }
+
+ if(bIsMirroredY)
+ {
+ aNewTransform.scale(1.0, -1.0, 1.0);
+ }
+
+ if(0.0 != fYRotate)
+ {
+ aNewTransform.rotate(0.0, -fYRotate, 0.0);
+ }
+
+ if(0.0 != fXRotate)
+ {
+ aNewTransform.rotate(-fXRotate, 0.0, 0.0 );
+ }
+
+ if(PR_PARALLEL == eProjectionType)
{
double fSkew, fAlpha;
- GetSkew( rGeometryItem, fSkew, fAlpha );
- if ( fSkew != 0.0 )
+
+ GetSkew(rGeometryItem, fSkew, fAlpha);
+
+ if(0.0 != fSkew)
{
- double fInvTanBeta( fSkew / 100.0 );
+ const double fInvTanBeta(fSkew / 100.0);
+
if(fInvTanBeta)
{
aNewTransform.shearXY(
@@ -643,191 +716,223 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
fInvTanBeta * sin(fAlpha));
}
}
- basegfx::B3DPoint _aLookAt( 0.0, 0.0, 0.0 );
- basegfx::B3DPoint _aNewCamPos( 0.0, 0.0, 25000.0 );
- rCamera.SetPosAndLookAt( _aNewCamPos, _aLookAt );
- pScene->SetCamera( rCamera );
+
+ const basegfx::B3DPoint _aLookAt(0.0, 0.0, 0.0);
+ const basegfx::B3DPoint _aNewCamPos(0.0, 0.0, 25000.0);
+
+ rCamera.SetPosAndLookAt(_aNewCamPos, _aLookAt);
+ pScene->SetCamera(rCamera);
}
else
{
- aNewTransform.translate( -fOriginX, fOriginY, 0.0 );
+ aNewTransform.translate(-fOriginX, fOriginY, 0.0);
+
// now set correct camera position
- const rtl::OUString sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
- drawing::Position3D aViewPointDefault( 3472, -3472, 25000 );
- drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, sViewPoint, aViewPointDefault, pMap ) );
- double fViewPointX = aViewPoint.PositionX;
- double fViewPointY = aViewPoint.PositionY;
- double fViewPointZ = aViewPoint.PositionZ;
- basegfx::B3DPoint _aLookAt( fViewPointX, -fViewPointY, 0.0 );
- basegfx::B3DPoint aNewCamPos( fViewPointX, -fViewPointY, fViewPointZ );
- rCamera.SetPosAndLookAt( aNewCamPos, _aLookAt );
- pScene->SetCamera( rCamera );
+ const rtl::OUString sViewPoint(RTL_CONSTASCII_USTRINGPARAM("ViewPoint"));
+ const drawing::Position3D aViewPointDefault(3472, -3472, 25000);
+ const drawing::Position3D aViewPoint(GetPosition3D(rGeometryItem, sViewPoint, aViewPointDefault, fMap));
+ const double fViewPointX(aViewPoint.PositionX);
+ const double fViewPointY(aViewPoint.PositionY);
+ const double fViewPointZ(aViewPoint.PositionZ);
+ const basegfx::B3DPoint _aLookAt(fViewPointX, -fViewPointY, 0.0);
+ const basegfx::B3DPoint aNewCamPos(fViewPointX, -fViewPointY, fViewPointZ);
+
+ rCamera.SetPosAndLookAt(aNewCamPos, _aLookAt);
+ pScene->SetCamera(rCamera);
}
- pScene->NbcSetTransform( aNewTransform );
+ pScene->SetB3DTransform(aNewTransform);
///////////
// light //
///////////
- const rtl::OUString sBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
- double fAmbientIntensity = GetDouble( rGeometryItem, sBrightness, 22178.0 / 655.36, NULL ) / 100.0;
-
+ const rtl::OUString sBrightness(RTL_CONSTASCII_USTRINGPARAM("Brightness"));
+ const double fAmbientIntensity(GetDouble(rGeometryItem, sBrightness, 22178.0 / 655.36, NULL) / 100.0);
+ const rtl::OUString sFirstLightDirection(RTL_CONSTASCII_USTRINGPARAM("FirstLightDirection"));
+ const drawing::Direction3D aFirstLightDirectionDefault(50000, 0, 10000);
+ drawing::Direction3D aFirstLightDirection(GetDirection3D(rGeometryItem, sFirstLightDirection, aFirstLightDirectionDefault));
- const rtl::OUString sFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
- drawing::Direction3D aFirstLightDirectionDefault( 50000, 0, 10000 );
- drawing::Direction3D aFirstLightDirection( GetDirection3D( rGeometryItem, sFirstLightDirection, aFirstLightDirectionDefault ) );
- if ( aFirstLightDirection.DirectionZ == 0.0 )
+ if(0.0 == aFirstLightDirection.DirectionZ)
+ {
aFirstLightDirection.DirectionZ = 1.0;
+ }
- const rtl::OUString sFirstLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightLevel" ) );
- double fLightIntensity = GetDouble( rGeometryItem, sFirstLightLevel, 43712.0 / 655.36, NULL ) / 100.0;
-
- const rtl::OUString sFirstLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightHarsh" ) );
- /* sal_Bool bFirstLightHarsh = */ GetBool( rGeometryItem, sFirstLightHarsh, sal_False );
+ const rtl::OUString sFirstLightLevel(RTL_CONSTASCII_USTRINGPARAM("FirstLightLevel"));
+ const double fLightIntensity(GetDouble(rGeometryItem, sFirstLightLevel, 43712.0 / 655.36, NULL) / 100.0);
+ const rtl::OUString sFirstLightHarsh(RTL_CONSTASCII_USTRINGPARAM("FirstLightHarsh"));
+ /// const bool bFirstLightHarsh(GetBool(rGeometryItem, sFirstLightHarsh, false));
+ const rtl::OUString sSecondLightDirection(RTL_CONSTASCII_USTRINGPARAM("SecondLightDirection"));
+ const drawing::Direction3D aSecondLightDirectionDefault(-50000, 0, 10000);
+ drawing::Direction3D aSecondLightDirection(GetDirection3D(rGeometryItem, sSecondLightDirection, aSecondLightDirectionDefault));
- const rtl::OUString sSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
- drawing::Direction3D aSecondLightDirectionDefault( -50000, 0, 10000 );
- drawing::Direction3D aSecondLightDirection( GetDirection3D( rGeometryItem, sSecondLightDirection, aSecondLightDirectionDefault ) );
- if ( aSecondLightDirection.DirectionZ == 0.0 )
+ if(0.0 == aSecondLightDirection.DirectionZ)
+ {
aSecondLightDirection.DirectionZ = -1;
+ }
- const rtl::OUString sSecondLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightLevel" ) );
- double fLight2Intensity = GetDouble( rGeometryItem, sSecondLightLevel, 43712.0 / 655.36, NULL ) / 100.0;
+ const rtl::OUString sSecondLightLevel(RTL_CONSTASCII_USTRINGPARAM("SecondLightLevel"));
+ const double fLight2Intensity(GetDouble(rGeometryItem, sSecondLightLevel, 43712.0 / 655.36, NULL) / 100.0);
+ const rtl::OUString sSecondLightHarsh(RTL_CONSTASCII_USTRINGPARAM("SecondLightHarsh"));
+ const rtl::OUString sLightFace(RTL_CONSTASCII_USTRINGPARAM("LightFace"));
+ // const bool bLight2Harsh(GetBool(rGeometryItem, sSecondLightHarsh, false));
+ // const bool bLightFace(GetBool(rGeometryItem, sLightFace, false));
+ const sal_uInt16 nAmbientColor(basegfx::fround(std::min(fAmbientIntensity * 255.0, 255.0)));
+ const Color aGlobalAmbientColor((sal_uInt8)nAmbientColor, (sal_uInt8)nAmbientColor, (sal_uInt8)nAmbientColor);
- const rtl::OUString sSecondLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightHarsh" ) );
- const rtl::OUString sLightFace( RTL_CONSTASCII_USTRINGPARAM ( "LightFace" ) );
- /* sal_Bool bLight2Harsh = */ GetBool( rGeometryItem, sSecondLightHarsh, sal_False );
- /* sal_Bool bLightFace = */ GetBool( rGeometryItem, sLightFace, sal_False );
+ pScene->GetProperties().SetObjectItem(SvxColorItem(aGlobalAmbientColor, SDRATTR_3DSCENE_AMBIENTCOLOR));
- sal_uInt16 nAmbientColor = (sal_uInt16)( fAmbientIntensity * 255.0 );
- if ( nAmbientColor > 255 )
- nAmbientColor = 255;
- Color aGlobalAmbientColor( (sal_uInt8)nAmbientColor, (sal_uInt8)nAmbientColor, (sal_uInt8)nAmbientColor );
- pScene->GetProperties().SetObjectItem( Svx3DAmbientcolorItem( aGlobalAmbientColor ) );
+ const sal_uInt8 nSpotLight1((sal_uInt8)(fLightIntensity * 255.0));
+ basegfx::B3DVector aSpotLight1(aFirstLightDirection.DirectionX, -aFirstLightDirection.DirectionY, -aFirstLightDirection.DirectionZ);
- sal_uInt8 nSpotLight1 = (sal_uInt8)( fLightIntensity * 255.0 );
- basegfx::B3DVector aSpotLight1( aFirstLightDirection.DirectionX, - ( aFirstLightDirection.DirectionY ), -( aFirstLightDirection.DirectionZ ) );
aSpotLight1.normalize();
- pScene->GetProperties().SetObjectItem( Svx3DLightOnOff1Item( sal_True ) );
- Color aAmbientSpot1Color( nSpotLight1, nSpotLight1, nSpotLight1 );
- pScene->GetProperties().SetObjectItem( Svx3DLightcolor1Item( aAmbientSpot1Color ) );
- pScene->GetProperties().SetObjectItem( Svx3DLightDirection1Item( aSpotLight1 ) );
- sal_uInt8 nSpotLight2 = (sal_uInt8)( fLight2Intensity * 255.0 );
- basegfx::B3DVector aSpotLight2( aSecondLightDirection.DirectionX, -aSecondLightDirection.DirectionY, -aSecondLightDirection.DirectionZ );
+ pScene->GetProperties().SetObjectItem(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, true));
+
+ const Color aAmbientSpot1Color(nSpotLight1, nSpotLight1, nSpotLight1);
+
+ pScene->GetProperties().SetObjectItem(SvxColorItem(aAmbientSpot1Color, SDRATTR_3DSCENE_LIGHTCOLOR_1));
+ pScene->GetProperties().SetObjectItem(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, aSpotLight1));
+
+ const sal_uInt8 nSpotLight2((sal_uInt8)(fLight2Intensity * 255.0));
+ basegfx::B3DVector aSpotLight2(aSecondLightDirection.DirectionX, -aSecondLightDirection.DirectionY, -aSecondLightDirection.DirectionZ);
aSpotLight2.normalize();
- pScene->GetProperties().SetObjectItem( Svx3DLightOnOff2Item( sal_True ) );
- Color aAmbientSpot2Color( nSpotLight2, nSpotLight2, nSpotLight2 );
- pScene->GetProperties().SetObjectItem( Svx3DLightcolor2Item( aAmbientSpot2Color ) );
- pScene->GetProperties().SetObjectItem( Svx3DLightDirection2Item( aSpotLight2 ) );
-
- sal_uInt8 nSpotLight3 = 70;
- basegfx::B3DVector aSpotLight3( 0.0, 0.0, 1.0 );
- pScene->GetProperties().SetObjectItem( Svx3DLightOnOff3Item( sal_True ) );
- Color aAmbientSpot3Color( nSpotLight3, nSpotLight3, nSpotLight3 );
- pScene->GetProperties().SetObjectItem( Svx3DLightcolor3Item( aAmbientSpot3Color ) );
- pScene->GetProperties().SetObjectItem( Svx3DLightDirection3Item( aSpotLight3 ) );
-
- const rtl::OUString sSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
- const rtl::OUString sDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
- const rtl::OUString sShininess( RTL_CONSTASCII_USTRINGPARAM ( "Shininess" ) );
- const rtl::OUString sMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
- double fSpecular = GetDouble( rGeometryItem, sSpecularity, 0, NULL ) / 100;
- sal_Bool bMetal = GetBool( rGeometryItem, sMetal, sal_False );
-
- Color aSpecularCol( 225,225,225 );
- if ( bMetal )
+
+ pScene->GetProperties().SetObjectItem(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, true));
+
+ const Color aAmbientSpot2Color(nSpotLight2, nSpotLight2, nSpotLight2);
+
+ pScene->GetProperties().SetObjectItem(SvxColorItem(aAmbientSpot2Color, SDRATTR_3DSCENE_LIGHTCOLOR_2));
+ pScene->GetProperties().SetObjectItem(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, aSpotLight2));
+
+ const sal_uInt8 nSpotLight3(70);
+ const basegfx::B3DVector aSpotLight3(0.0, 0.0, 1.0);
+
+ pScene->GetProperties().SetObjectItem(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, true));
+
+ const Color aAmbientSpot3Color(nSpotLight3, nSpotLight3, nSpotLight3);
+
+ pScene->GetProperties().SetObjectItem(SvxColorItem(aAmbientSpot3Color, SDRATTR_3DSCENE_LIGHTCOLOR_3));
+ pScene->GetProperties().SetObjectItem(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, aSpotLight3));
+
+ const rtl::OUString sSpecularity(RTL_CONSTASCII_USTRINGPARAM("Specularity"));
+ const rtl::OUString sDiffusion(RTL_CONSTASCII_USTRINGPARAM("Diffusion"));
+ const rtl::OUString sShininess(RTL_CONSTASCII_USTRINGPARAM("Shininess"));
+ const rtl::OUString sMetal(RTL_CONSTASCII_USTRINGPARAM("Metal"));
+ double fSpecular(GetDouble(rGeometryItem, sSpecularity, 0, NULL) / 100);
+ const bool bMetal(GetBool(rGeometryItem, sMetal, false));
+ Color aSpecularCol(225, 225, 225);
+
+ if(bMetal)
{
- aSpecularCol = Color( 200, 200, 200 );
+ aSpecularCol = Color(200, 200, 200);
fSpecular += 0.15;
}
- sal_Int32 nIntensity = (sal_Int32)fSpecular * 100;
- if ( nIntensity > 100 )
- nIntensity = 100;
- else if ( nIntensity < 0 )
- nIntensity = 0;
- nIntensity = 100 - nIntensity;
- pScene->GetProperties().SetObjectItem( Svx3DMaterialSpecularItem( aSpecularCol ) );
- pScene->GetProperties().SetObjectItem( Svx3DMaterialSpecularIntensityItem( (sal_uInt16)nIntensity ) );
- pScene->SetLogicRect( CalculateNewSnapRect( pCustomShape, aSnapRect, aBoundRect2d, pMap ) );
+ const sal_Int32 nIntensity(basegfx::fround(100.0 - std::min(std::max(0.0, fSpecular * 100.0), 100.0)));
+
+ pScene->GetProperties().SetObjectItem(SvxColorItem(aSpecularCol, SDRATTR_3DOBJ_MAT_SPECULAR));
+ pScene->GetProperties().SetObjectItem(SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, (sal_uInt16)nIntensity));
+
+ // set 2D transformation for scene
+ sdr::legacy::SetLogicRange(*pScene, CalculateNewSnapRect(rCustomShape, aSnapRange, aAllPolyPolygonRange, fMap));
// removing placeholder objects
- std::vector< E3dCompoundObject* >::iterator aObjectListIter( aPlaceholderObjectList.begin() );
- while ( aObjectListIter != aPlaceholderObjectList.end() )
+ std::vector< E3dCompoundObject* >::iterator aObjectListIter(aPlaceholderObjectList.begin());
+
+ while( aObjectListIter != aPlaceholderObjectList.end())
{
- pScene->Remove3DObj( *aObjectListIter );
- delete *aObjectListIter++;
+ pScene->Remove3DObj(**aObjectListIter);
+ deleteSdrObjectSafeAndClearPointer(*aObjectListIter++);
}
}
else
- delete pScene;
+ {
+ deleteSdrObjectSafeAndClearPointer(pScene);
+ }
}
+
return pRet;
}
-Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rSnapRect, const Rectangle& rBoundRect, const double* pMap )
+basegfx::B2DRange EnhancedCustomShape3d::CalculateNewSnapRect(
+ const SdrObjCustomShape& rCustomShape,
+ const basegfx::B2DRange& rSnapRect,
+ const basegfx::B2DRange& rBoundRect,
+ const double fMap)
{
- SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- const Point aCenter( rSnapRect.Center() );
- double fExtrusionBackward, fExtrusionForward;
- GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward );
+ SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)rCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY);
+ double fExtrusionBackward(0.0), fExtrusionForward(0.0);
sal_uInt32 i;
- // creating initial bound volume ( without rotation. skewing.and camera )
+ GetExtrusionDepth(rGeometryItem, fMap, fExtrusionBackward, fExtrusionForward);
+
+ // creating initial bound volume (without rotation, skewing and camera)
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rBoundRect));
basegfx::B3DPolygon aBoundVolume;
- const Polygon aPolygon( rBoundRect );
- for ( i = 0L; i < 4L; i++ )
+ aPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-rSnapRect.getCenterX(), -rSnapRect.getCenterY()));
+ aBoundVolume.append(basegfx::tools::createB3DPolygonFromB2DPolygon(aPolygon, fExtrusionForward));
+ aBoundVolume.append(basegfx::tools::createB3DPolygonFromB2DPolygon(aPolygon, fExtrusionBackward));
+
+ const rtl::OUString sRotationCenter(RTL_CONSTASCII_USTRINGPARAM("RotationCenter"));
+ const drawing::Direction3D aRotationCenterDefault(0.0, 0.0, 0.0); // default seems to be wrong, a fractional size of shape has to be used!!
+ const drawing::Direction3D aRotationCenter(GetDirection3D(rGeometryItem, sRotationCenter, aRotationCenterDefault));
+ double fXRotate(0.0), fYRotate(0.0);
+
+ GetRotateAngle(rGeometryItem, fXRotate, fYRotate);
+
+ // TTTT: double fZRotate(-rCustomShape.GetObjectRotation() * F_PI180);
+ double fZRotate(-rCustomShape.getSdrObjectRotate());
+
+ // rotating bound volume
+ basegfx::B3DHomMatrix aMatrix;
+
+ aMatrix.translate(-aRotationCenter.DirectionX, -aRotationCenter.DirectionY, -aRotationCenter.DirectionZ);
+
+ if(0.0 != fZRotate)
{
- aBoundVolume.append(basegfx::B3DPoint(aPolygon[ (sal_uInt16)i ].X() - aCenter.X(), aPolygon[ (sal_uInt16)i ].Y() - aCenter.Y(), fExtrusionForward));
+ aMatrix.rotate(0.0, 0.0, fZRotate);
}
- for ( i = 0L; i < 4L; i++ )
+ if(rCustomShape.isMirroredX()) // TTTT: rCustomShape.IsMirroredX()) check if rCustomShape is correct
{
- aBoundVolume.append(basegfx::B3DPoint(aPolygon[ (sal_uInt16)i ].X() - aCenter.X(), aPolygon[ (sal_uInt16)i ].Y() - aCenter.Y(), fExtrusionBackward));
+ aMatrix.scale(-1.0, 1.0, 1.0);
}
- const rtl::OUString sRotationCenter( RTL_CONSTASCII_USTRINGPARAM ( "RotationCenter" ) );
- drawing::Direction3D aRotationCenterDefault( 0, 0, 0 ); // default seems to be wrong, a fractional size of shape has to be used!!
- drawing::Direction3D aRotationCenter( GetDirection3D( rGeometryItem, sRotationCenter, aRotationCenterDefault ) );
-
- // double XCenterInGUnits = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationCenterX, 0 );
- // double YCenterInGUnits = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationCenterY, 0 );
-
- // sal_Int32 nRotationXAxisInProz = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAxisX, 100 );
- // sal_Int32 nRotationYAxisInProz = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAxisY, 0 );
- // sal_Int32 nRotationZAxisInProz = rPropSet.GetPropertyValue( DFF_Prop_c3DRotationAxisZ, 0 );
+ if(rCustomShape.isMirroredY()) // TTTT: rCustomShape.IsMirroredY()) and if needed at all
+ {
+ aMatrix.scale(1.0, -1.0, 1.0);
+ }
+ if(0.0 != fYRotate)
+ {
+ aMatrix.rotate(0.0, fYRotate, 0.0);
+ }
- double fXRotate, fYRotate;
- GetRotateAngle( rGeometryItem, fXRotate, fYRotate );
- double fZRotate = - ((SdrObjCustomShape*)pCustomShape)->GetObjectRotation() * F_PI180;
+ if(0.0 != fXRotate)
+ {
+ aMatrix.rotate(-fXRotate, 0.0, 0.0);
+ }
- // rotating bound volume
- basegfx::B3DHomMatrix aMatrix;
- aMatrix.translate(-aRotationCenter.DirectionX, -aRotationCenter.DirectionY, -aRotationCenter.DirectionZ);
- if ( fZRotate != 0.0 )
- aMatrix.rotate( 0.0, 0.0, fZRotate );
- if ( ((SdrObjCustomShape*)pCustomShape)->IsMirroredX() )
- aMatrix.scale( -1.0, 1, 1 );
- if ( ((SdrObjCustomShape*)pCustomShape)->IsMirroredY() )
- aMatrix.scale( 1, -1.0, 1 );
- if( fYRotate != 0.0 )
- aMatrix.rotate( 0.0, fYRotate, 0.0 );
- if( fXRotate != 0.0 )
- aMatrix.rotate( -fXRotate, 0.0, 0.0 );
aMatrix.translate(aRotationCenter.DirectionX, aRotationCenter.DirectionY, aRotationCenter.DirectionZ);
aBoundVolume.transform(aMatrix);
- Transformation2D aTransformation2D( pCustomShape, rSnapRect, pMap );
- if ( aTransformation2D.IsParallel() )
- aBoundVolume = aTransformation2D.ApplySkewSettings( aBoundVolume );
+ Transformation2D aTransformation2D(rCustomShape, fMap);
+
+ if(aTransformation2D.IsParallel())
+ {
+ aBoundVolume = aTransformation2D.ApplySkewSettings(aBoundVolume);
+ }
+
+ basegfx::B2DRange aRetval;
- Polygon aTransformed( 8 );
- for ( i = 0L; i < 8L; i++ )
- aTransformed[ (sal_uInt16)i ] = aTransformation2D.Transform2D( aBoundVolume.getB3DPoint( i ) );
+ for(i = 0; i < aBoundVolume.count(); i++)
+ {
+ aRetval.expand(aTransformation2D.Transform2D(aBoundVolume.getB3DPoint(i)));
+ }
- return aTransformed.GetBoundRect();
+ return aRetval;
}
+
+// eof
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.hxx b/svx/source/customshapes/EnhancedCustomShape3d.hxx
index 3022ec1feccb..1f5a38e77b41 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.hxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#ifndef _ENHANCEDCUSTOMSHAPE3D_HXX
#define _ENHANCEDCUSTOMSHAPE3D_HXX
@@ -28,46 +26,54 @@
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <basegfx/point/b3dpoint.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
-
-#include <tools/gen.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
class SdrObject;
+class SdrObjCustomShape;
class EnhancedCustomShape3d
{
+private:
class Transformation2D
{
- Point aCenter;
- com::sun::star::drawing::ProjectionMode eProjectionMode;
+ private:
+ basegfx::B2DPoint maCenter;
+ com::sun::star::drawing::ProjectionMode meProjectionMode;
// parallel projection
- double fSkewAngle;
- double fSkew; // in percent
+ double mfSkewAngle;
+ double mfSkew; // in percent
// perspective projection
- double fZScreen;
- basegfx::B3DPoint fViewPoint;
- double fOriginX;
- double fOriginY;
-
- const double* pMap;
+ double mfZScreen;
+ basegfx::B3DPoint mfViewPoint;
+ double mfOriginX;
+ double mfOriginY;
- public :
+ const double mfMap;
- Transformation2D( const SdrObject* pCustomShape, const Rectangle& rBoundRect, const double* pMap );
+ public :
+ Transformation2D(const SdrObjCustomShape& rCustomShape, const double fMap);
- basegfx::B3DPolygon ApplySkewSettings( const basegfx::B3DPolygon& rPolygon3D ) const;
- Point Transform2D( const basegfx::B3DPoint& rPoint ) const;
- sal_Bool IsParallel() const;
+ basegfx::B3DPolygon ApplySkewSettings(const basegfx::B3DPolygon& rPolygon3D) const;
+ basegfx::B2DPoint Transform2D(const basegfx::B3DPoint& rPoint) const;
+ bool IsParallel() const;
};
friend class Transformation2D;
- protected :
- static Rectangle CalculateNewSnapRect( const SdrObject* pCustomShape, const Rectangle& rSnapRect, const Rectangle& rBoundRect, const double* pMap );
-
- public :
- static SdrObject* Create3DObject( const SdrObject* pShape2d, const SdrObject* pCustomShape );
+protected :
+ static basegfx::B2DRange CalculateNewSnapRect(
+ const SdrObjCustomShape& rCustomShape,
+ const basegfx::B2DRange& rSnapRect,
+ const basegfx::B2DRange& rBoundRect,
+ const double fMap);
+
+public :
+ static SdrObject* Create3DObject(
+ const SdrObject& rShape2d,
+ const SdrObjCustomShape& rCustomShape);
};
#endif
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index f52a473d55b4..6a5256f48a56 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -30,10 +30,8 @@
#include "EnhancedCustomShapeHandle.hxx"
#include "svx/EnhancedCustomShapeGeometry.hxx"
#include <svx/unoshape.hxx>
-#ifndef _SVX_UNOPAGE_HXX
-#include "svx/unopage.hxx"
-#endif
-#include "svx/unoapi.hxx"
+#include <svx/unopage.hxx>
+#include <svx/unoapi.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdoashp.hxx>
#include <svx/svdogrp.hxx>
@@ -45,11 +43,13 @@
#include <svx/svdopath.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdmodel.hxx>
-#include "svx/svditer.hxx"
-#include "unopolyhelper.hxx"
+#include <svx/svditer.hxx>
+#include <unopolyhelper.hxx>
#include <uno/mapping.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <com/sun/star/document/XActionLockable.hpp>
+#include <svx/svdlegacy.hxx>
+#include <svx/sdrobjectfactory.hxx>
// ---------------------------
// - EnhancedCustomShapeEngine -
@@ -149,16 +149,21 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText( const SdrObjCustom
{
if ( pRenderedShape )
{
- if ( !pRenderedShape->ISA( SdrObjGroup ) )
+ SdrObjGroup* pSdrObjGroup = dynamic_cast< SdrObjGroup* >(pRenderedShape);
+
+ if ( !pSdrObjGroup )
{
- SdrObject* pTmp = pRenderedShape;
- pRenderedShape = new SdrObjGroup();
- ((SdrObjGroup*)pRenderedShape)->GetSubList()->NbcInsertObject( pTmp );
+ pSdrObjGroup = new SdrObjGroup(pCustoObj->getSdrModelFromSdrObject());
+ pSdrObjGroup->InsertObjectToSdrObjList(*pRenderedShape);
+ pRenderedShape = pSdrObjGroup;
}
- ((SdrObjGroup*)pRenderedShape)->GetSubList()->NbcInsertObject( pShadowGeometry->Clone(), 0 );
+
+ pSdrObjGroup->InsertObjectToSdrObjList(*pShadowGeometry->CloneSdrObject(), 0);
}
else
- pRenderedShape = pShadowGeometry->Clone();
+ {
+ pRenderedShape = pShadowGeometry->CloneSdrObject();
+ }
}
// apply text
@@ -166,12 +171,13 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText( const SdrObjCustom
{
// #i37011# also create a text object and add at rPos + 1
SdrTextObj* pTextObj = (SdrTextObj*)SdrObjFactory::MakeNewObject(
- pCustoObj->GetObjInventor(), OBJ_TEXT, 0L, pCustoObj->GetModel());
+ pCustoObj->getSdrModelFromSdrObject(),
+ SdrObjectCreationInfo(OBJ_TEXT, pCustoObj->GetObjInventor()));
// Copy text content
OutlinerParaObject* pParaObj = pCustoObj->GetOutlinerParaObject();
if( pParaObj )
- pTextObj->NbcSetOutlinerParaObject( new OutlinerParaObject(*pParaObj) );
+ pTextObj->SetOutlinerParaObject( new OutlinerParaObject(*pParaObj) );
// copy all attributes
SfxItemSet aTargetItemSet( pCustoObj->GetMergedItemSet() );
@@ -181,22 +187,22 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText( const SdrObjCustom
aTargetItemSet.Put(XFillStyleItem(XFILL_NONE));
// get the text bounds and set at text object
- Rectangle aTextBounds = pCustoObj->GetSnapRect();
+ basegfx::B2DRange aTextBounds(sdr::legacy::GetLogicRange(*pCustoObj));
SdrObject* pSdrObjCustomShape( GetSdrObjectFromXShape( mxShape ) );
if ( pSdrObjCustomShape )
{
EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
- aTextBounds = aCustomShape2d.GetTextRect();
+ aTextBounds = aCustomShape2d.GetTextRange();
}
- pTextObj->SetSnapRect( aTextBounds );
+ sdr::legacy::SetLogicRange(*pTextObj, aTextBounds );
- // if rotated, copy GeoStat, too.
- const GeoStat& rSourceGeo = pCustoObj->GetGeoStat();
- if ( rSourceGeo.nDrehWink )
+ // if rotated, copy rotation, too.
+ const long aOldRotation(sdr::legacy::GetRotateAngle(*pCustoObj));
+ if ( aOldRotation )
{
- pTextObj->NbcRotate(
- pCustoObj->GetSnapRect().Center(), rSourceGeo.nDrehWink,
- rSourceGeo.nSin, rSourceGeo.nCos);
+ sdr::legacy::RotateSdrObject(*pTextObj,
+ sdr::legacy::GetSnapRect(*pCustoObj).Center(),
+ aOldRotation);
}
// set modified ItemSet at text object
@@ -204,29 +210,37 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText( const SdrObjCustom
if ( pRenderedShape )
{
- if ( !pRenderedShape->ISA( SdrObjGroup ) )
+ SdrObjGroup* pSdrObjGroup = dynamic_cast< SdrObjGroup* >(pRenderedShape);
+
+ if ( !pSdrObjGroup )
{
- SdrObject* pTmp = pRenderedShape;
- pRenderedShape = new SdrObjGroup();
- ((SdrObjGroup*)pRenderedShape)->GetSubList()->NbcInsertObject( pTmp );
+ pSdrObjGroup = new SdrObjGroup(pCustoObj->getSdrModelFromSdrObject());
+ pSdrObjGroup->InsertObjectToSdrObjList(*pRenderedShape);
+ pRenderedShape = pSdrObjGroup;
}
- ((SdrObjGroup*)pRenderedShape)->GetSubList()->NbcInsertObject( pTextObj, LIST_APPEND );
+
+ pSdrObjGroup->InsertObjectToSdrObjList(*pTextObj);
}
else
+ {
pRenderedShape = pTextObj;
}
+ }
// force group
if ( pRenderedShape )
{
- if ( !pRenderedShape->ISA( SdrObjGroup ) )
+ SdrObjGroup* pSdrObjGroup = dynamic_cast< SdrObjGroup* >(pRenderedShape);
+
+ if ( !pSdrObjGroup )
{
- SdrObject* pTmp = pRenderedShape;
- pRenderedShape = new SdrObjGroup();
- ((SdrObjGroup*)pRenderedShape)->GetSubList()->NbcInsertObject( pTmp );
+ pSdrObjGroup = new SdrObjGroup(pCustoObj->getSdrModelFromSdrObject());
+ pSdrObjGroup->InsertObjectToSdrObjList(*pRenderedShape);
+ pRenderedShape = pSdrObjGroup;
}
- pRenderedShape->SetPage( pCustoObj->GetPage() );
- pRenderedShape->SetModel( pCustoObj->GetModel() );
+
+ //pRenderedShape->SetPage( pCustoObj->GetPage() );
+ //pRenderedShape->SetModel( pCustoObj->GetModel() );
}
}
return pRenderedShape;
@@ -261,7 +275,8 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
throw ( NMSP_UNO::RuntimeException )
{
REF( com::sun::star::drawing::XShape ) xShape;
- SdrObject* pSdrObjCustomShape( GetSdrObjectFromXShape( mxShape ) );
+ SdrObjCustomShape* pSdrObjCustomShape(dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxShape)));
+
if ( pSdrObjCustomShape )
{
// retrieving the TextPath property to check if feature is enabled
@@ -274,10 +289,10 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
*pAny >>= bTextPathOn;
EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
- sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
+// sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
- sal_Bool bFlipV = aCustomShape2d.IsFlipVert();
- sal_Bool bFlipH = aCustomShape2d.IsFlipHorz();
+// sal_Bool bFlipV = aCustomShape2d.IsFlipVert();
+// sal_Bool bFlipH = aCustomShape2d.IsFlipHorz();
sal_Bool bLineGeometryNeededOnly = bTextPathOn;
SdrObject* pRenderedShape = aCustomShape2d.CreateObject( bLineGeometryNeededOnly );
@@ -288,51 +303,55 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
SdrObject* pRenderedFontWork = EnhancedCustomShapeFontWork::CreateFontWork( pRenderedShape, pSdrObjCustomShape );
if ( pRenderedFontWork )
{
- SdrObject::Free( pRenderedShape );
+ deleteSdrObjectSafeAndClearPointer( pRenderedShape );
pRenderedShape = pRenderedFontWork;
}
}
- SdrObject* pRenderedShape3d = EnhancedCustomShape3d::Create3DObject( pRenderedShape, pSdrObjCustomShape );
+ SdrObject* pRenderedShape3d = EnhancedCustomShape3d::Create3DObject(*pRenderedShape, *pSdrObjCustomShape);
if ( pRenderedShape3d )
{
- bFlipV = bFlipH = sal_False;
- nRotateAngle = 0;
- SdrObject::Free( pRenderedShape );
+// bFlipV = bFlipH = sal_False;
+// nRotateAngle = 0;
+ deleteSdrObjectSafeAndClearPointer( pRenderedShape );
pRenderedShape = pRenderedShape3d;
}
- Rectangle aRect( pSdrObjCustomShape->GetSnapRect() );
- const GeoStat& rGeoStat = ((SdrObjCustomShape*)pSdrObjCustomShape)->GetGeoStat();
- if ( rGeoStat.nShearWink )
- {
- long nShearWink = rGeoStat.nShearWink;
- double nTan = rGeoStat.nTan;
- if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
- {
- nShearWink = -nShearWink;
- nTan = -nTan;
- }
- pRenderedShape->Shear( pSdrObjCustomShape->GetSnapRect().Center(), nShearWink, nTan, sal_False);
- }
- if( nRotateAngle )
- {
- double a = nRotateAngle * F_PI18000;
- pRenderedShape->NbcRotate( pSdrObjCustomShape->GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ) );
- }
- if ( bFlipV )
- {
- Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pRenderedShape->NbcMirror( aLeft, aRight );
- }
- if ( bFlipH )
- {
- Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pRenderedShape->NbcMirror( aTop, aBottom );
- }
- pRenderedShape->NbcSetStyleSheet( pSdrObjCustomShape->GetStyleSheet(), sal_True );
- pRenderedShape->RecalcSnapRect();
+ // copy original transformation
+ pRenderedShape->setSdrObjectTransformation(pSdrObjCustomShape->getSdrObjectTransformation());
+
+// const Rectangle aRect( sdr::legacy::GetSnapRect(*pSdrObjCustomShape) );
+// long aOldShear(sdr::legacy::GetShearAngleX(*pSdrObjCustomShape));
+//
+// if ( aOldShear )
+// {
+// if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+// {
+// aOldShear = -aOldShear;
+// }
+//
+// sdr::legacy::ShearSdrObject(*pRenderedShape, aRect.Center(), aOldShear, false);
+// }
+//
+// if( nRotateAngle )
+// {
+// sdr::legacy::RotateSdrObject(*pRenderedShape, aRect.Center(), nRotateAngle);
+// }
+//
+// if ( bFlipV )
+// {
+// Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
+// Point aRight( aLeft.X() + 1000, aLeft.Y() );
+// sdr::legacy::MirrorSdrObject(*pRenderedShape, aLeft, aRight );
+// }
+//
+// if ( bFlipH )
+// {
+// Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
+// Point aBottom( aTop.X(), aTop.Y() + 1000 );
+// sdr::legacy::MirrorSdrObject(*pRenderedShape, aTop, aBottom );
+// }
+
+ pRenderedShape->SetStyleSheet(pSdrObjCustomShape->GetStyleSheet(), true);
}
if ( mbForceGroupWithText )
@@ -341,8 +360,10 @@ REF( com::sun::star::drawing::XShape ) SAL_CALL EnhancedCustomShapeEngine::rende
if ( pRenderedShape )
{
aCustomShape2d.ApplyGluePoints( pRenderedShape );
- xShape = SvxDrawPage::CreateShapeByTypeAndInventor( pRenderedShape->GetObjIdentifier(),
- pRenderedShape->GetObjInventor(), pRenderedShape, NULL );
+ xShape = SvxDrawPage::CreateShapeBySvxShapeKind(
+ SdrObjectCreatorInventorToSvxShapeKind(pRenderedShape->GetObjIdentifier(), pRenderedShape->GetObjInventor()),
+ pRenderedShape,
+ 0);
}
SetTemporary( xShape );
}
@@ -355,16 +376,16 @@ com::sun::star::awt::Rectangle SAL_CALL EnhancedCustomShapeEngine::getTextBounds
com::sun::star::awt::Rectangle aTextRect;
SdrObject* pSdrObjCustomShape( GetSdrObjectFromXShape( mxShape ) );
::com::sun::star::uno::Reference< ::com::sun::star::document::XActionLockable > xLockable( mxShape, ::com::sun::star::uno::UNO_QUERY );
- if ( pSdrObjCustomShape && pSdrObjCustomShape->GetModel() && xLockable.is() && !xLockable->isActionLocked() )
+ if ( pSdrObjCustomShape && xLockable.is() && !xLockable->isActionLocked() )
{
if ( pSdrObjCustomShape )
{
EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
- Rectangle aRect( aCustomShape2d.GetTextRect() );
- aTextRect.X = aRect.Left();
- aTextRect.Y = aRect.Top();
- aTextRect.Width = aRect.GetWidth();
- aTextRect.Height = aRect.GetHeight();
+ const basegfx::B2DRange aRange( aCustomShape2d.GetTextRange() );
+ aTextRect.X = basegfx::fround(aRange.getMinX());
+ aTextRect.Y = basegfx::fround(aRange.getMinY());
+ aTextRect.Width = basegfx::fround(aRange.getWidth());
+ aTextRect.Height = basegfx::fround(aRange.getHeight());
}
}
return aTextRect;
@@ -381,40 +402,40 @@ com::sun::star::drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEng
SdrObject* pObj = aCustomShape2d.CreateLineGeometry();
if ( pObj )
{
- Rectangle aRect( pSdrObjCustomShape->GetSnapRect() );
- sal_Bool bFlipV = aCustomShape2d.IsFlipVert();
- sal_Bool bFlipH = aCustomShape2d.IsFlipHorz();
-
- const GeoStat& rGeoStat = ((SdrObjCustomShape*)pSdrObjCustomShape)->GetGeoStat();
- if ( rGeoStat.nShearWink )
- {
- long nShearWink = rGeoStat.nShearWink;
- double nTan = rGeoStat.nTan;
- if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
- {
- nShearWink = -nShearWink;
- nTan = -nTan;
- }
- pObj->Shear( aRect.Center(), nShearWink, nTan, sal_False);
- }
- sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
- if( nRotateAngle )
- {
- double a = nRotateAngle * F_PI18000;
- pObj->NbcRotate( aRect.Center(), nRotateAngle, sin( a ), cos( a ) );
- }
- if ( bFlipH )
- {
- Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pObj->NbcMirror( aTop, aBottom );
- }
- if ( bFlipV )
- {
- Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pObj->NbcMirror( aLeft, aRight );
- }
+// const Rectangle aRect( sdr::legacy::GetSnapRect(*pSdrObjCustomShape) );
+// const sal_Bool bFlipV = aCustomShape2d.IsFlipVert();
+// const sal_Bool bFlipH = aCustomShape2d.IsFlipHorz();
+
+ // copy original transformation
+ pObj->setSdrObjectTransformation(pSdrObjCustomShape->getSdrObjectTransformation());
+
+// long aOldShear(sdr::legacy::GetShearAngleX(*pSdrObjCustomShape));
+// if ( aOldShear )
+// {
+// if ((bFlipV&&!bFlipH )||(bFlipH&&!bFlipV))
+// {
+// aOldShear = -aOldShear;
+// }
+//
+// sdr::legacy::ShearSdrObject(*pObj, aRect.Center(), aOldShear, false);
+// }
+// sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
+// if( nRotateAngle )
+// {
+// sdr::legacy::RotateSdrObject(*pObj, aRect.Center(), nRotateAngle );
+// }
+// if ( bFlipH )
+// {
+// Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
+// Point aBottom( aTop.X(), aTop.Y() + 1000 );
+// sdr::legacy::MirrorSdrObject(*pObj, aTop, aBottom );
+// }
+// if ( bFlipV )
+// {
+// Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
+// Point aRight( aLeft.X() + 1000, aLeft.Y() );
+// sdr::legacy::MirrorSdrObject(*pObj, aLeft, aRight );
+// }
basegfx::B2DPolyPolygon aPolyPolygon;
SdrObjListIter aIter( *pObj, IM_DEEPWITHGROUPS );
@@ -424,26 +445,27 @@ com::sun::star::drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEng
SdrObject* pNewObj = NULL;
basegfx::B2DPolyPolygon aPP;
const SdrObject* pNext = aIter.Next();
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pNext);
- if ( pNext->ISA( SdrPathObj ) )
+ if ( pSdrPathObj )
{
- aPP = ((SdrPathObj*)pNext)->GetPathPoly();
+ aPP = pSdrPathObj->getB2DPolyPolygonInObjectCoordinates();
}
else
{
- pNewObj = pNext->ConvertToPolyObj( sal_False, sal_False );
- SdrPathObj* pPath = PTR_CAST( SdrPathObj, pNewObj );
+ pNewObj = pNext->ConvertToPolyObj( false, false);
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(pNewObj);
if ( pPath )
- aPP = pPath->GetPathPoly();
+ aPP = pPath->getB2DPolyPolygonInObjectCoordinates();
}
if ( aPP.count() )
aPolyPolygon.append(aPP);
- SdrObject::Free( pNewObj );
+ deleteSdrObjectSafeAndClearPointer( pNewObj );
}
- SdrObject::Free( pObj );
- SvxConvertB2DPolyPolygonToPolyPolygonBezier( aPolyPolygon, aPolyPolygonBezierCoords );
+ deleteSdrObjectSafeAndClearPointer( pObj );
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(aPolyPolygon, aPolyPolygonBezierCoords);
}
}
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 0d78a6e92fe2..01c0e25695ea 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -63,6 +63,7 @@
#include <com/sun/star/i18n/CharacterIteratorMode.hdl>
#endif
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/svdlegacy.hxx>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -169,7 +170,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape,
Font aFont;
SvxFontItem& rFontItem = (SvxFontItem&)pCustomShape->GetMergedItem( EE_CHAR_FONTINFO );
- aFont.SetHeight( pCustomShape->GetLogicRect().GetHeight() / rFWData.nMaxParagraphsPerTextArea );
+ aFont.SetHeight( sdr::legacy::GetLogicRect(*pCustomShape).GetHeight() / rFWData.nMaxParagraphsPerTextArea );
aFont.SetAlign( ALIGN_TOP );
aFont.SetName( rFontItem.GetFamilyName() );
aFont.SetFamily( rFontItem.GetFamily() );
@@ -454,7 +455,7 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape )
std::vector< FWTextArea >::iterator aTextAreaIter = rFWData.vTextAreas.begin();
std::vector< FWTextArea >::iterator aTextAreaIEnd = rFWData.vTextAreas.end();
- rFWData.nSingleLineHeight = (sal_Int32)( ( (double)pCustomShape->GetLogicRect().GetHeight()
+ rFWData.nSingleLineHeight = (sal_Int32)( ( (double)sdr::legacy::GetLogicRect(*pCustomShape).GetHeight()
/ rFWData.nMaxParagraphsPerTextArea ) * rFWData.fHorizontalTextScaling );
sal_Bool bSameLetterHeights = sal_False;
@@ -548,10 +549,10 @@ basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d )
SdrObjListIter aObjListIter( *pShape2d, IM_DEEPWITHGROUPS );
while( aObjListIter.IsMore() )
{
- SdrObject* pPartObj = aObjListIter.Next();
- if ( pPartObj->ISA( SdrPathObj ) )
+ SdrPathObj* pPartObj = dynamic_cast< SdrPathObj* >(aObjListIter.Next());
+ if ( pPartObj )
{
- basegfx::B2DPolyPolygon aCandidate(((SdrPathObj*)pPartObj)->GetPathPoly());
+ basegfx::B2DPolyPolygon aCandidate(pPartObj->getB2DPolyPolygonInObjectCoordinates());
if(aCandidate.areControlPointsUsed())
{
aCandidate = basegfx::tools::adaptiveSubdivideByAngle(aCandidate);
@@ -681,7 +682,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW
std::vector< double > vDistances;
vDistances.reserve( nPointCount );
CalcDistances( rOutlinePoly, vDistances );
- if ( !vDistances.empty() )
+ if ( vDistances.size() )
{
std::vector< FWParagraphData >::iterator aParagraphIter( aTextAreaIter->vParagraphs.begin() );
std::vector< FWParagraphData >::iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() );
@@ -811,12 +812,11 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW
SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const SdrObject* pCustomShape )
{
- SdrObject* pRet = NULL;
- if ( !rFWData.vTextAreas.empty() )
+ SdrObjGroup* pRet = 0;
+
+ if ( rFWData.vTextAreas.size() )
{
- pRet = new SdrObjGroup();
-// SJ: not setting model, so we save a lot of broadcasting and the model is not modified any longer
-// pRet->SetModel( pCustomShape->GetModel() );
+ pRet = new SdrObjGroup(pCustomShape->getSdrModelFromSdrObject());
std::vector< FWTextArea >::const_iterator aTextAreaIter = rFWData.vTextAreas.begin();
std::vector< FWTextArea >::const_iterator aTextAreaIEnd = rFWData.vTextAreas.end();
while ( aTextAreaIter != aTextAreaIEnd )
@@ -833,10 +833,10 @@ SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const Sd
std::vector< PolyPolygon >::const_iterator aOutlineIEnd = aCharacterIter->vOutlines.end();
while( aOutlineIter != aOutlineIEnd )
{
- SdrObject* pPathObj = new SdrPathObj( OBJ_POLY, aOutlineIter->getB2DPolyPolygon() );
- // SJ: not setting model, so we save a lot of broadcasting and the model is not modified any longer
- // pPathObj->SetModel( pCustomShape->GetModel() );
- ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pPathObj );
+ SdrObject* pPathObj = new SdrPathObj(
+ pCustomShape->getSdrModelFromSdrObject(),
+ aOutlineIter->getB2DPolyPolygon() );
+ pRet->InsertObjectToSdrObjList(*pPathObj);
aOutlineIter++;
}
aCharacterIter++;
@@ -846,15 +846,9 @@ SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const Sd
aTextAreaIter++;
}
- Point aP( pCustomShape->GetSnapRect().Center() );
- Size aS( pCustomShape->GetLogicRect().GetSize() );
- aP.X() -= aS.Width() / 2;
- aP.Y() -= aS.Height() / 2;
- Rectangle aLogicRect( aP, aS );
-
SfxItemSet aSet( pCustomShape->GetMergedItemSet() );
aSet.ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created
- aSet.Put(SdrShadowItem(sal_False)); // #i37011# NO shadow for FontWork geometry
+ aSet.Put(SdrOnOffItem(SDRATTR_SHADOW, sal_False)); // #i37011# NO shadow for FontWork geometry
pRet->SetMergedItemSet( aSet ); // * otherwise we would crash, because the outliner tries to create a Paraobject, but there is no model
}
return pRet;
@@ -881,7 +875,7 @@ SdrObject* EnhancedCustomShapeFontWork::CreateFontWork( const SdrObject* pShape2
{
SdrObject* pRet = NULL;
- Rectangle aLogicRect( pCustomShape->GetLogicRect() );
+ Rectangle aLogicRect( sdr::legacy::GetLogicRect(*pCustomShape) );
PolyPolygon aOutlines2d( GetOutlinesFromShape2d( pShape2d ) );
sal_uInt16 nOutlinesCount2d = aOutlines2d.Count();
if ( nOutlinesCount2d )
diff --git a/svx/source/customshapes/EnhancedCustomShapeHandle.cxx b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx
index 0915427b03e8..344015d9e550 100644
--- a/svx/source/customshapes/EnhancedCustomShapeHandle.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeHandle.cxx
@@ -63,11 +63,11 @@ com::sun::star::awt::Point SAL_CALL EnhancedCustomShapeHandle::getPosition()
if ( !pSdrObjCustomShape )
throw com::sun::star::uno::RuntimeException();
- Point aPosition;
+ basegfx::B2DPoint aPosition;
EnhancedCustomShape2d aCustomShape2d( pSdrObjCustomShape );
if ( !aCustomShape2d.GetHandlePosition( mnIndex, aPosition ) )
throw com::sun::star::uno::RuntimeException();
- return com::sun::star::awt::Point( aPosition.X(), aPosition.Y() );
+ return com::sun::star::awt::Point( basegfx::fround(aPosition.getX()), basegfx::fround(aPosition.getY()) );
}
void SAL_CALL EnhancedCustomShapeHandle::setControllerPosition( const com::sun::star::awt::Point& aPnt )
diff --git a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
index 5b8b3da067b4..72896166a84e 100644
--- a/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeTypeNames.cxx
@@ -26,6 +26,7 @@
#include "svx/EnhancedCustomShapeTypeNames.hxx"
#include <osl/mutex.hxx>
#include <hash_map>
+#include <string.h>
struct TCheck
{
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 73484ed512d6..506253a1a931 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -40,6 +40,7 @@
#include <svx/svxids.hrc>
//-------------------------------------------------------------------------
+// TTTT: needed?
#define BMP_RESID(nId) ResId(nId, DIALOG_MGR())
#define TRANSP_STRING "Transparent"
@@ -377,7 +378,7 @@ void SvxBmpMaskSelectItem::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*
{
if ( ( nSID == SID_BMPMASK_EXEC ) && pItem )
{
- const SfxBoolItem* pStateItem = PTR_CAST( SfxBoolItem, pItem );
+ const SfxBoolItem* pStateItem = dynamic_cast< const SfxBoolItem* >( pItem );
DBG_ASSERT( pStateItem || pItem == 0, "SfxBoolItem erwartet");
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 959d4f9617df..e82d66901e24 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -98,7 +98,6 @@ SvxContourDlgItem::SvxContourDlgItem( sal_uInt16 _nId, SvxSuperContourDlg& rCont
{
}
-
/*************************************************************************
|*
|*
@@ -109,7 +108,7 @@ void SvxContourDlgItem::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/,
{
if ( pItem && ( SID_CONTOUR_EXEC == nSID ) )
{
- const SfxBoolItem* pStateItem = PTR_CAST( SfxBoolItem, pItem );
+ const SfxBoolItem* pStateItem = dynamic_cast< const SfxBoolItem* >( pItem );
DBG_ASSERT( pStateItem || pItem == 0, "SfxBoolItem erwartet");
@@ -763,14 +762,14 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx )
case( TBI_RECT ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- aContourWnd.SetObjKind( OBJ_RECT );
+ aContourWnd.setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_RECT));
}
break;
case( TBI_CIRCLE ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- aContourWnd.SetObjKind( OBJ_CIRC );
+ aContourWnd.setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_CIRC));
}
break;
@@ -778,14 +777,20 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx )
case( TBI_POLY ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- aContourWnd.SetObjKind( OBJ_POLY );
+ aContourWnd.setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_POLY));
}
break;
case( TBI_FREEPOLY ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- aContourWnd.SetObjKind( OBJ_FREEFILL );
+
+ SdrObjectCreationInfo aSdrObjectCreationInfo(OBJ_POLY);
+
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_ClosedBezier);
+ aSdrObjectCreationInfo.setFreehandMode(true);
+
+ aContourWnd.setSdrObjectCreationInfo(aSdrObjectCreationInfo);
}
break;
@@ -969,12 +974,12 @@ IMPL_LINK( SvxSuperContourDlg, StateHdl, ContourWindow*, pWnd )
{
const SdrObject* pObj = pWnd->GetSelectedSdrObject();
const SdrView* pView = pWnd->GetSdrView();
- const sal_Bool bPolyEdit = ( pObj != NULL ) && pObj->ISA( SdrPathObj );
- const sal_Bool bDrawEnabled = !( bPolyEdit && aTbx1.IsItemChecked( TBI_POLYEDIT ) );
- const sal_Bool bPipette = aTbx1.IsItemChecked( TBI_PIPETTE );
- const sal_Bool bWorkplace = aTbx1.IsItemChecked( TBI_WORKPLACE );
- const sal_Bool bDontHide = !( bPipette || bWorkplace );
- const sal_Bool bBitmap = pWnd->GetGraphic().GetType() == GRAPHIC_BITMAP;
+ const bool bPolyEdit = pObj && dynamic_cast< const SdrPathObj* >(pObj);
+ const bool bDrawEnabled = !( bPolyEdit && aTbx1.IsItemChecked( TBI_POLYEDIT ) );
+ const bool bPipette = aTbx1.IsItemChecked( TBI_PIPETTE );
+ const bool bWorkplace = aTbx1.IsItemChecked( TBI_WORKPLACE );
+ const bool bDontHide = !( bPipette || bWorkplace );
+ const bool bBitmap = pWnd->GetGraphic().GetType() == GRAPHIC_BITMAP;
aTbx1.EnableItem( TBI_APPLY, bDontHide && bExecState && pWnd->IsChanged() );
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index 6cd4b318ddea..05138e8076f2 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -24,25 +24,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-// include ---------------------------------------------------------------
-
#include <svx/svdoedge.hxx>
#include <svx/svdattrx.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdview.hxx>
-
#include <svx/svdpage.hxx> // SdrObjList
-
-#include "svx/connctrl.hxx"
+#include <svx/connctrl.hxx>
#include <svx/dialmgr.hxx>
-#include "svx/dlgutil.hxx"
+#include <svx/dlgutil.hxx>
-// #110094#
#include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
-
-// #110094#
#include <svx/sdr/contact/displayinfo.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
/*************************************************************************
|*
@@ -55,7 +48,7 @@ SvxXConnectionPreview::SvxXConnectionPreview( Window* pParent, const ResId& rRes
Control ( pParent, rResId ),
rAttrs ( rInAttrs ),
pEdgeObj( NULL ),
- pObjList( NULL ),
+ maSdrObjectVector(),
pView ( NULL )
{
SetMapMode( MAP_100TH_MM );
@@ -70,7 +63,10 @@ SvxXConnectionPreview::SvxXConnectionPreview( Window* pParent, const ResId& rRes
SvxXConnectionPreview::~SvxXConnectionPreview()
{
- delete pObjList;
+ for(sal_uInt32 a(0); a < maSdrObjectVector.size(); a++)
+ {
+ SdrObject::deleteSafe(const_cast< SdrObject* >(maSdrObjectVector[a]));
+ }
}
/*************************************************************************
@@ -83,68 +79,60 @@ void SvxXConnectionPreview::Construct()
{
DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uIntPtr nMarkCount = rMarkList.GetMarkCount();
-
- if( nMarkCount >= 1 )
+ if(pView->areSdrObjectsSelected())
{
- sal_Bool bFound = sal_False;
- const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
+ bool bFound = false;
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
- for( sal_uInt16 i = 0; i < nMarkCount && !bFound; i++ )
+ for(sal_uInt32 i(0); i < aSelection.size() && !bFound; i++)
{
- pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- sal_uInt32 nInv = pObj->GetObjInventor();
- sal_uInt16 nId = pObj->GetObjIdentifier();
- if( nInv == SdrInventor && nId == OBJ_EDGE )
- {
- bFound = sal_True;
- SdrEdgeObj* pTmpEdgeObj = (SdrEdgeObj*) pObj;
- pEdgeObj = (SdrEdgeObj*) pTmpEdgeObj->Clone();
+ const SdrEdgeObj* pTmpEdgeObj = dynamic_cast< const SdrEdgeObj* >(aSelection[i]);
- SdrObjConnection& rConn1 = (SdrObjConnection&)pEdgeObj->GetConnection( sal_True );
- SdrObjConnection& rConn2 = (SdrObjConnection&)pEdgeObj->GetConnection( sal_False );
+ if(pTmpEdgeObj)
+ {
+ bFound = true;
+ pEdgeObj = (SdrEdgeObj*) pTmpEdgeObj->CloneSdrObject();
- rConn1 = pTmpEdgeObj->GetConnection( sal_True );
- rConn2 = pTmpEdgeObj->GetConnection( sal_False );
+ SdrObjConnection& rConn1 = (SdrObjConnection&)pEdgeObj->GetConnection(true);
+ SdrObjConnection& rConn2 = (SdrObjConnection&)pEdgeObj->GetConnection(false);
- SdrObject* pTmpObj1 = pTmpEdgeObj->GetConnectedNode( sal_True );
- SdrObject* pTmpObj2 = pTmpEdgeObj->GetConnectedNode( sal_False );
+ rConn1 = pTmpEdgeObj->GetConnection(true);
+ rConn2 = pTmpEdgeObj->GetConnection(false);
- // #110094#
- // potential memory leak here (!). Create SdrObjList only when there is
- // not yet one.
- if(!pObjList)
- {
- pObjList = new SdrObjList( pView->GetModel(), NULL );
- }
+ SdrObject* pTmpObj1 = pTmpEdgeObj->GetConnectedNode(true);
+ SdrObject* pTmpObj2 = pTmpEdgeObj->GetConnectedNode(false);
if( pTmpObj1 )
{
- SdrObject* pObj1 = pTmpObj1->Clone();
- pObjList->InsertObject( pObj1 );
- pEdgeObj->ConnectToNode( sal_True, pObj1 );
+ SdrObject* pObj1 = pTmpObj1->CloneSdrObject();
+
+ maSdrObjectVector.push_back(pObj1);
+ pEdgeObj->ConnectToNode(true, pObj1);
}
+
if( pTmpObj2 )
{
- SdrObject* pObj2 = pTmpObj2->Clone();
- pObjList->InsertObject( pObj2 );
- pEdgeObj->ConnectToNode( sal_False, pObj2 );
+ SdrObject* pObj2 = pTmpObj2->CloneSdrObject();
+
+ maSdrObjectVector.push_back(pObj2);
+ pEdgeObj->ConnectToNode(false, pObj2);
}
- pObjList->InsertObject( pEdgeObj );
+
+ maSdrObjectVector.push_back(pEdgeObj);
}
}
}
if( !pEdgeObj )
- pEdgeObj = new SdrEdgeObj();
+ {
+ pEdgeObj = new SdrEdgeObj(pView->getSdrModelFromSdrView());
+ }
// Groesse anpassen
- if( pObjList )
+ if( maSdrObjectVector.size() )
{
OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 );
- Rectangle aRect = pObjList->GetAllObjBoundRect();
+ Rectangle aRect(sdr::legacy::GetAllObjBoundRect(maSdrObjectVector));
MapMode aMapMode = GetMapMode();
aMapMode.SetMapUnit( pOD->GetMapMode().GetMapUnit() );
@@ -196,44 +184,6 @@ void SvxXConnectionPreview::Construct()
Point aPos;
MouseEvent aMEvt( aPos, 1, 0, MOUSE_RIGHT );
MouseButtonDown( aMEvt );
- /*
- Point aPt( -aRect.TopLeft().X(), -aRect.TopLeft().Y() );
- aMapMode.SetOrigin( aPt );
-
- // Skalierung
- Size aSize = GetOutputSize();
- Fraction aFrac1( aSize.Width(), aRect.GetWidth() );
- Fraction aFrac2( aSize.Height(), aRect.GetHeight() );
- Fraction aMaxFrac( aFrac1 > aFrac2 ? aFrac1 : aFrac2 );
- Fraction aMinFrac( aFrac1 <= aFrac2 ? aFrac1 : aFrac2 );
- sal_Bool bChange = (sal_Bool) ( (double)aMinFrac > 1.0 );
- aMapMode.SetScaleX( aMinFrac );
- aMapMode.SetScaleY( aMinFrac );
-
- // zentrieren
- long nXXL = aSize.Width() > aRect.GetWidth() ? aSize.Width() : aRect.GetWidth();
- long nXS = aSize.Width() <= aRect.GetWidth() ? aSize.Width() : aRect.GetWidth();
- if( bChange )
- {
- long nTmp = nXXL; nXXL = nXS; nXS = nTmp;
- }
- long nX = (long) ( (double)aMinFrac * (double)nXXL );
- nX = (long) ( (double)labs( nXS - nX ) / (double)aMinFrac / 2.0 );
-
- long nYXL = aSize.Height() > aRect.GetHeight() ? aSize.Height() : aRect.GetHeight();
- long nYS = aSize.Height() <= aRect.GetHeight() ? aSize.Height() : aRect.GetHeight();
- if( bChange )
- {
- long nTmp = nXXL; nXXL = nXS; nXS = nTmp;
- }
- long nY = (long) ( (double)aMinFrac * (double)nYXL );
- nY = (long) ( (double)labs( nYS - nY ) / (double)aMinFrac / 2.0 );
-
- aPt += Point( nX, nY );
- aMapMode.SetOrigin( aPt );
-
- SetMapMode( aMapMode );
- */
}
}
@@ -245,7 +195,7 @@ void SvxXConnectionPreview::Construct()
void SvxXConnectionPreview::Paint( const Rectangle& )
{
- if( pObjList )
+ if( maSdrObjectVector.size() )
{
// #110094#
// This will not work anymore. To not start at Adam and Eve, i will
@@ -255,17 +205,7 @@ void SvxXConnectionPreview::Paint( const Rectangle& )
// mechanism.
// New stuff: Use a ObjectContactOfObjListPainter.
- sdr::contact::SdrObjectVector aObjectVector;
-
- for(sal_uInt32 a(0L); a < pObjList->GetObjCount(); a++)
- {
- SdrObject* pObject = pObjList->GetObj(a);
- DBG_ASSERT(pObject,
- "SvxXConnectionPreview::Paint: Corrupt ObjectList (!)");
- aObjectVector.push_back(pObject);
- }
-
- sdr::contact::ObjectContactOfObjListPainter aPainter(*this, aObjectVector, 0);
+ sdr::contact::ObjectContactOfObjListPainter aPainter(*this, maSdrObjectVector, 0);
sdr::contact::DisplayInfo aDisplayInfo;
// do processing
@@ -299,7 +239,7 @@ sal_uInt16 SvxXConnectionPreview::GetLineDeltaAnz()
sal_uInt16 nCount(0);
if(SFX_ITEM_DONTCARE != rSet.GetItemState(SDRATTR_EDGELINEDELTAANZ))
- nCount = ((const SdrEdgeLineDeltaAnzItem&)rSet.Get(SDRATTR_EDGELINEDELTAANZ)).GetValue();
+ nCount = ((const SfxUInt16Item&)rSet.Get(SDRATTR_EDGELINEDELTAANZ)).GetValue();
return nCount;
}
diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx
index 92313f5b4aeb..e9bc1bf6ed17 100644
--- a/svx/source/dialog/contwnd.cxx
+++ b/svx/source/dialog/contwnd.cxx
@@ -87,26 +87,27 @@ void ContourWindow::SetPolyPolygon( const PolyPolygon& rPolyPoly )
// them first (!)
pView->UnmarkAllObj();
- pPage->Clear();
+ if(pPage->GetObjCount())
+ {
+ pPage->ClearSdrObjList();
+ pPage->getSdrModelFromSdrObjList().SetChanged();
+ }
for ( sal_uInt16 i = 0; i < nPolyCount; i++ )
{
basegfx::B2DPolyPolygon aPolyPolygon;
aPolyPolygon.append(aPolyPoly[ i ].getB2DPolygon());
- SdrPathObj* pPathObj = new SdrPathObj( OBJ_PATHFILL, aPolyPolygon );
+ SdrPathObj* pPathObj = new SdrPathObj( *pModel, aPolyPolygon );
if ( pPathObj )
{
- SfxItemSet aSet( pModel->GetItemPool() );
+ SfxItemSet aSet( pPathObj->GetObjectItemPool() );
aSet.Put( XFillStyleItem( XFILL_SOLID ) );
aSet.Put( XFillColorItem( String(), TRANSCOL ) );
aSet.Put( XFillTransparenceItem( 50 ) );
-
- //pPathObj->SetItemSetAndBroadcast(aSet);
pPathObj->SetMergedItemSetAndBroadcast(aSet);
-
- pPage->InsertObject( pPathObj );
+ pPage->InsertObjectToSdrObjList(*pPathObj);
}
}
@@ -139,7 +140,7 @@ const PolyPolygon& ContourWindow::GetPolyPolygon()
SdrPathObj* pPathObj = (SdrPathObj*)pPage->GetObj(0L);
// Not sure if subdivision is needed for ContourWindow, but maybe it cannot handle
// curves at all. Keeping subdivision here for security
- const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::adaptiveSubdivideByAngle(pPathObj->GetPathPoly()));
+ const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::adaptiveSubdivideByAngle(pPathObj->getB2DPolyPolygonInObjectCoordinates()));
aPolyPoly = PolyPolygon(aB2DPolyPolygon);
}
@@ -165,7 +166,7 @@ void ContourWindow::InitSdrModel()
aSet.Put( XFillColorItem( String(), TRANSCOL ) );
aSet.Put( XFillTransparenceItem( 50 ) );
pView->SetAttributes( aSet );
- pView->SetFrameDragSingles( sal_True );
+ pView->SetFrameHandles(true);
}
@@ -194,7 +195,7 @@ sal_Bool ContourWindow::IsContourChanged() const
sal_Bool bRet = sal_False;
if ( pPage && pPage->GetObjCount() )
- bRet = ( (SdrPathObj*) pPage->GetObj( 0 ) )->GetPathPoly().count() && pModel->IsChanged();
+ bRet = ( (SdrPathObj*) pPage->GetObj( 0 ) )->getB2DPolyPolygonInObjectCoordinates().count() && pModel->IsChanged();
return bRet;
}
@@ -288,10 +289,10 @@ void ContourWindow::MouseButtonUp(const MouseEvent& rMEvt)
_aPolyPoly.Clip( aWorkRect );
SetPolyPolygon( _aPolyPoly );
- pView->SetWorkArea( aWorkRect );
+ pView->SetWorkArea( basegfx::B2DRange( aWorkRect.Left(), aWorkRect.Top(), aWorkRect.Right(), aWorkRect.Bottom() ) );
}
else
- pView->SetWorkArea( aGraphRect );
+ pView->SetWorkArea( basegfx::B2DRange( aGraphRect.Left(), aGraphRect.Top(), aGraphRect.Right(), aGraphRect.Bottom() ) );
Invalidate( aGraphRect );
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index c0cb3b9081c1..72ad029e6521 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -92,8 +92,6 @@ SvxRedlinEntry::~SvxRedlinEntry()
#* Funktionen der in den SvxRedlinTable eingefuegten Items
#************************************************************************/
-DBG_NAME(SvLBoxColorString);
-
/*************************************************************************
#* Member: SvLBoxColorString Datum:23.10.97
#*------------------------------------------------------------------------
@@ -113,7 +111,6 @@ SvLBoxColorString::SvLBoxColorString( SvLBoxEntry*pEntry,sal_uInt16 nFlags,const
: SvLBoxString( pEntry, nFlags, rStr )
{
- DBG_CTOR(SvLBoxColorString,0);
aPrivColor=rCol;
SetText( pEntry, rStr );
}
@@ -135,7 +132,6 @@ SvLBoxColorString::SvLBoxColorString( SvLBoxEntry*pEntry,sal_uInt16 nFlags,const
SvLBoxColorString::SvLBoxColorString()
: SvLBoxString()
{
- DBG_CTOR(SvLBoxColorString,0);
}
/*************************************************************************
@@ -154,7 +150,6 @@ SvLBoxColorString::SvLBoxColorString()
SvLBoxColorString::~SvLBoxColorString()
{
- DBG_DTOR(SvLBoxColorString,0);
}
@@ -174,7 +169,6 @@ SvLBoxColorString::~SvLBoxColorString()
SvLBoxItem* SvLBoxColorString::Create() const
{
- DBG_CHKTHIS(SvLBoxColorString,0);
return new SvLBoxColorString;
}
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index ad7d1f5b908f..aeb61e0f5367 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -30,7 +30,6 @@
#include <svx/fmmodel.hxx>
#include <svl/itempool.hxx>
#include <svx/fmpage.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/sphere3d.hxx>
#include <svx/cube3d.hxx>
#include <vcl/svapp.hxx>
@@ -41,6 +40,8 @@
#include <svx/xlnwtit.hxx>
#include "helpid.hrc"
#include <algorithm>
+#include <svx/svdlegacy.hxx>
+#include <svx/scene3d.hxx>
#include <svx/dialmgr.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -99,12 +100,12 @@ void Svx3DPreviewControl::Construct()
mpModel->InsertPage( mpFmPage, 0 );
// 3D View
- mp3DView = new E3dView( mpModel, this );
+ mp3DView = new E3dView( *mpModel, this );
mp3DView->SetBufferedOutputAllowed(true);
mp3DView->SetBufferedOverlayAllowed(true);
// 3D Scene
- mpScene = new E3dPolyScene(mp3DView->Get3DDefaultAttributes());
+ mpScene = new E3dScene(*mpModel, mp3DView->Get3DDefaultAttributes());
// initially create object
SetObjectType(PREVIEW_OBJECTTYPE_SPHERE);
@@ -127,17 +128,17 @@ void Svx3DPreviewControl::Construct()
rCamera.SetDefaults(basegfx::B3DPoint(0.0, 0.0, fDefaultCamPosZ), aLookAt, fDefaultCamFocal);
mpScene->SetCamera( rCamera );
- mpFmPage->InsertObject( mpScene );
+ mpFmPage->InsertObjectToSdrObjList(*mpScene);
basegfx::B3DHomMatrix aRotation;
aRotation.rotate(DEG2RAD( 25 ), 0.0, 0.0);
aRotation.rotate(0.0, DEG2RAD( 40 ), 0.0);
- mpScene->SetTransform(aRotation * mpScene->GetTransform());
+ mpScene->SetB3DTransform(aRotation * mpScene->GetB3DTransform());
// invalidate SnapRects of objects
- mpScene->SetRectsDirty();
+ mpScene->ActionChanged();
- SfxItemSet aSet( mpModel->GetItemPool(),
+ SfxItemSet aSet( mpScene->GetObjectItemPool(),
XATTR_LINESTYLE, XATTR_LINESTYLE,
XATTR_FILL_FIRST, XATTR_FILLBITMAP,
0, 0 );
@@ -148,26 +149,20 @@ void Svx3DPreviewControl::Construct()
mpScene->SetMergedItemSet(aSet);
// PageView
- SdrPageView* pPageView = mp3DView->ShowSdrPage( mpFmPage );
- mp3DView->hideMarkHandles();
-
- // mark scene
- mp3DView->MarkObj( mpScene, pPageView );
+ mp3DView->ShowSdrPage( *mpFmPage );
}
void Svx3DPreviewControl::Resize()
{
// size of page
- Size aSize( GetSizePixel() );
- aSize = PixelToLogic( aSize );
- mpFmPage->SetSize( aSize );
+ const basegfx::B2DVector aSize(GetInverseViewTransformation() * basegfx::B2DVector(GetSizePixel().Width(), GetSizePixel().Height()));
+ mpFmPage->SetPageScale( aSize );
// set size
- Size aObjSize( aSize.Width()*5/6, aSize.Height()*5/6 );
- Point aObjPoint( (aSize.Width() - aObjSize.Width()) / 2,
- (aSize.Height() - aObjSize.Height()) / 2);
- Rectangle aRect( aObjPoint, aObjSize);
- mpScene->SetSnapRect( aRect );
+ const basegfx::B2DVector aNewScale(aSize * (5.0 / 6.0));
+ const basegfx::B2DPoint aNewPos((aSize - aNewScale) * 0.5);
+
+ sdr::legacy::SetSnapRange(*mpScene, basegfx::B2DRange(aNewPos, aNewPos + aNewScale));
}
void Svx3DPreviewControl::Paint(const Rectangle& rRect)
@@ -202,9 +197,8 @@ void Svx3DPreviewControl::SetObjectType(sal_uInt16 nType)
if( mp3DObj )
{
aSet.Put(mp3DObj->GetMergedItemSet());
- mpScene->Remove3DObj( mp3DObj );
- delete mp3DObj;
- mp3DObj = NULL;
+ mpScene->Remove3DObj(*mp3DObj);
+ deleteSdrObjectSafeAndClearPointer(mp3DObj);
}
switch( nType )
@@ -212,6 +206,7 @@ void Svx3DPreviewControl::SetObjectType(sal_uInt16 nType)
case PREVIEW_OBJECTTYPE_SPHERE:
{
mp3DObj = new E3dSphereObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint( 0, 0, 0 ),
basegfx::B3DVector( 5000, 5000, 5000 ));
@@ -221,6 +216,7 @@ void Svx3DPreviewControl::SetObjectType(sal_uInt16 nType)
case PREVIEW_OBJECTTYPE_CUBE:
{
mp3DObj = new E3dCubeObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint( -2500, -2500, -2500 ),
basegfx::B3DVector( 5000, 5000, 5000 ));
@@ -228,7 +224,7 @@ void Svx3DPreviewControl::SetObjectType(sal_uInt16 nType)
break;
}
- mpScene->Insert3DObj( mp3DObj );
+ mpScene->Insert3DObj(*mp3DObj);
mp3DObj->SetMergedItemSet(aSet);
Resize();
@@ -324,11 +320,12 @@ void Svx3DLightControl::Construct2()
// create invisible expansion object
const double fMaxExpansion(RADIUS_LAMP_BIG + RADIUS_LAMP_PREVIEW_SIZE);
mpExpansionObject = new E3dCubeObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint(-fMaxExpansion, -fMaxExpansion, -fMaxExpansion),
basegfx::B3DVector(2.0 * fMaxExpansion, 2.0 * fMaxExpansion, 2.0 * fMaxExpansion));
- mpScene->Insert3DObj( mpExpansionObject );
- SfxItemSet aSet(mpModel->GetItemPool());
+ mpScene->Insert3DObj(*mpExpansionObject);
+ SfxItemSet aSet(mpExpansionObject->GetObjectItemPool());
aSet.Put( XLineStyleItem( XLINE_NONE ) );
aSet.Put( XFillStyleItem( XFILL_NONE ) );
mpExpansionObject->SetMergedItemSet(aSet);
@@ -347,10 +344,13 @@ void Svx3DLightControl::Construct2()
// create object for it
mpLampBottomObject = new E3dPolygonObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPolyPolygon(a3DCircle),
+ 0,
+ 0,
true);
- mpScene->Insert3DObj( mpLampBottomObject );
+ mpScene->Insert3DObj(*mpLampBottomObject);
// half circle with stand
basegfx::B2DPolygon a2DHalfCircle;
@@ -362,13 +362,16 @@ void Svx3DLightControl::Construct2()
// create object for it
mpLampShaftObject = new E3dPolygonObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPolyPolygon(a3DHalfCircle),
+ 0,
+ 0,
true);
- mpScene->Insert3DObj( mpLampShaftObject );
+ mpScene->Insert3DObj(*mpLampShaftObject);
// initially invisible
- SfxItemSet aSet(mpModel->GetItemPool());
+ SfxItemSet aSet(mpLampBottomObject->GetObjectItemPool());
aSet.Put( XLineStyleItem( XLINE_NONE ) );
aSet.Put( XFillStyleItem( XFILL_NONE ) );
@@ -397,11 +400,11 @@ void Svx3DLightControl::Construct2()
mpScene->SetCamera( rCamera );
basegfx::B3DHomMatrix aNeutral;
- mpScene->SetTransform(aNeutral);
+ mpScene->SetB3DTransform(aNeutral);
}
// invalidate SnapRects of objects
- mpScene->SetRectsDirty();
+ mpScene->ActionChanged();
}
void Svx3DLightControl::ConstructLightObjects()
@@ -411,8 +414,8 @@ void Svx3DLightControl::ConstructLightObjects()
// get rid of evtl. existing light object
if(maLightObjects[a])
{
- mpScene->Remove3DObj(maLightObjects[a]);
- delete maLightObjects[a];
+ mpScene->Remove3DObj(*maLightObjects[a]);
+ deleteSdrObjectSafeAndClearPointer(maLightObjects[a]);
maLightObjects[a] = 0;
}
@@ -425,16 +428,17 @@ void Svx3DLightControl::ConstructLightObjects()
const double fLampSize(bIsSelectedLight ? RADIUS_LAMP_BIG : RADIUS_LAMP_SMALL);
E3dObject* pNewLight = new E3dSphereObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint( 0, 0, 0 ),
basegfx::B3DVector( fLampSize, fLampSize, fLampSize));
- mpScene->Insert3DObj(pNewLight);
+ mpScene->Insert3DObj(*pNewLight);
basegfx::B3DHomMatrix aTransform;
- aTransform.translate(aDirection.getX(), aDirection.getY(), aDirection.getZ());
- pNewLight->SetTransform(aTransform);
+ aTransform.translate(aDirection);
+ pNewLight->SetB3DTransform(aTransform);
- SfxItemSet aSet(mpModel->GetItemPool());
+ SfxItemSet aSet(pNewLight->GetObjectItemPool());
aSet.Put( XLineStyleItem( XLINE_NONE ) );
aSet.Put( XFillStyleItem( XFILL_SOLID ) );
aSet.Put( XFillColorItem(String(), GetLightColor(a)));
@@ -450,7 +454,7 @@ void Svx3DLightControl::AdaptToSelectedLight()
if(NO_LIGHT_SELECTED == maSelectedLight)
{
// make mpLampBottomObject/mpLampShaftObject invisible
- SfxItemSet aSet(mpModel->GetItemPool());
+ SfxItemSet aSet(mpLampBottomObject->GetObjectItemPool());
aSet.Put( XLineStyleItem( XLINE_NONE ) );
aSet.Put( XFillStyleItem( XFILL_NONE ) );
mpLampBottomObject->SetMergedItemSet(aSet);
@@ -462,7 +466,7 @@ void Svx3DLightControl::AdaptToSelectedLight()
aDirection.normalize();
// make mpLampBottomObject/mpLampShaftObject visible (yellow hairline)
- SfxItemSet aSet(mpModel->GetItemPool());
+ SfxItemSet aSet(mpLampBottomObject->GetObjectItemPool());
aSet.Put( XLineStyleItem( XLINE_SOLID ) );
aSet.Put( XLineColorItem(String(), COL_YELLOW));
aSet.Put( XLineWidthItem(0));
@@ -480,7 +484,7 @@ void Svx3DLightControl::AdaptToSelectedLight()
}
aTransform.rotate(0.0, fRotateY, 0.0);
- mpLampShaftObject->SetTransform(aTransform);
+ mpLampShaftObject->SetB3DTransform(aTransform);
// adapt transformation of selected light
E3dObject* pSelectedLight = maLightObjects[sal_Int32(maSelectedLight)];
@@ -492,7 +496,7 @@ void Svx3DLightControl::AdaptToSelectedLight()
aDirection.getX() * RADIUS_LAMP_PREVIEW_SIZE,
aDirection.getY() * RADIUS_LAMP_PREVIEW_SIZE,
aDirection.getZ() * RADIUS_LAMP_PREVIEW_SIZE);
- pSelectedLight->SetTransform(aTransform);
+ pSelectedLight->SetB3DTransform(aTransform);
}
}
}
@@ -739,11 +743,11 @@ void Svx3DLightControl::Tracking( const TrackingEvent& rTEvt )
void Svx3DLightControl::Resize()
{
// set size of page
- const Size aSize(PixelToLogic(GetSizePixel()));
- mpFmPage->SetSize(aSize);
+ const basegfx::B2DVector aSize(GetInverseViewTransformation() * basegfx::B2DVector(GetSizePixel().Width(), GetSizePixel().Height()));
+ mpFmPage->SetPageScale(aSize);
// set position and size of scene
- mpScene->SetSnapRect(Rectangle(Point(0, 0), aSize));
+ sdr::legacy::SetSnapRange(*mpScene, basegfx::B2DRange(basegfx::B2DPoint(0.0, 0.0), aSize));
}
void Svx3DLightControl::SetObjectType(sal_uInt16 nType)
@@ -756,7 +760,7 @@ void Svx3DLightControl::SetObjectType(sal_uInt16 nType)
{
basegfx::B3DHomMatrix aObjectRotation;
aObjectRotation.rotate(mfRotateX, mfRotateY, mfRotateZ);
- mp3DObj->SetTransform(aObjectRotation);
+ mp3DObj->SetB3DTransform(aObjectRotation);
}
}
@@ -801,19 +805,19 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer)
if(!aDirection.equal(GetLightDirection(maSelectedLight)))
{
// set changed light direction at SdrScene
- SfxItemSet aSet(mpModel->GetItemPool());
+ SfxItemSet aSet(mpScene->GetObjectItemPool());
switch(maSelectedLight)
{
- case 0: aSet.Put(Svx3DLightDirection1Item(aDirection)); break;
- case 1: aSet.Put(Svx3DLightDirection2Item(aDirection)); break;
- case 2: aSet.Put(Svx3DLightDirection3Item(aDirection)); break;
- case 3: aSet.Put(Svx3DLightDirection4Item(aDirection)); break;
- case 4: aSet.Put(Svx3DLightDirection5Item(aDirection)); break;
- case 5: aSet.Put(Svx3DLightDirection6Item(aDirection)); break;
- case 6: aSet.Put(Svx3DLightDirection7Item(aDirection)); break;
+ case 0: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, aDirection)); break;
+ case 1: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, aDirection)); break;
+ case 2: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, aDirection)); break;
+ case 3: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, aDirection)); break;
+ case 4: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, aDirection)); break;
+ case 5: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, aDirection)); break;
+ case 6: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, aDirection)); break;
default:
- case 7: aSet.Put(Svx3DLightDirection8Item(aDirection)); break;
+ case 7: aSet.Put(SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, aDirection)); break;
}
mpScene->SetMergedItemSet(aSet);
@@ -834,7 +838,7 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer)
{
basegfx::B3DHomMatrix aObjectRotation;
aObjectRotation.rotate(mfRotateX, mfRotateY, mfRotateZ);
- mp3DObj->SetTransform(aObjectRotation);
+ mp3DObj->SetB3DTransform(aObjectRotation);
Invalidate();
}
@@ -856,7 +860,7 @@ void Svx3DLightControl::SetRotation(double fRotX, double fRotY, double fRotZ)
{
basegfx::B3DHomMatrix aObjectRotation;
aObjectRotation.rotate(mfRotateX, mfRotateY, mfRotateZ);
- mp3DObj->SetTransform(aObjectRotation);
+ mp3DObj->SetB3DTransform(aObjectRotation);
Invalidate();
}
@@ -921,14 +925,14 @@ bool Svx3DLightControl::GetLightOnOff(sal_uInt32 nNum) const
switch(nNum)
{
- case 0 : return ((const Svx3DLightOnOff1Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue();
- case 1 : return ((const Svx3DLightOnOff2Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue();
- case 2 : return ((const Svx3DLightOnOff3Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue();
- case 3 : return ((const Svx3DLightOnOff4Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue();
- case 4 : return ((const Svx3DLightOnOff5Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue();
- case 5 : return ((const Svx3DLightOnOff6Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue();
- case 6 : return ((const Svx3DLightOnOff7Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue();
- case 7 : return ((const Svx3DLightOnOff8Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue();
+ case 0 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue();
+ case 1 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue();
+ case 2 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue();
+ case 3 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue();
+ case 4 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue();
+ case 5 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue();
+ case 6 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue();
+ case 7 : return ((const SfxBoolItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue();
}
}
@@ -943,14 +947,14 @@ Color Svx3DLightControl::GetLightColor(sal_uInt32 nNum) const
switch(nNum)
{
- case 0 : return ((const Svx3DLightcolor1Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue();
- case 1 : return ((const Svx3DLightcolor2Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue();
- case 2 : return ((const Svx3DLightcolor3Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue();
- case 3 : return ((const Svx3DLightcolor4Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue();
- case 4 : return ((const Svx3DLightcolor5Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue();
- case 5 : return ((const Svx3DLightcolor6Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue();
- case 6 : return ((const Svx3DLightcolor7Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue();
- case 7 : return ((const Svx3DLightcolor8Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue();
+ case 0 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue();
+ case 1 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue();
+ case 2 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue();
+ case 3 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue();
+ case 4 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue();
+ case 5 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue();
+ case 6 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue();
+ case 7 : return ((const SvxColorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue();
}
}
@@ -965,14 +969,14 @@ basegfx::B3DVector Svx3DLightControl::GetLightDirection(sal_uInt32 nNum) const
switch(nNum)
{
- case 0 : return ((const Svx3DLightDirection1Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue();
- case 1 : return ((const Svx3DLightDirection2Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue();
- case 2 : return ((const Svx3DLightDirection3Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue();
- case 3 : return ((const Svx3DLightDirection4Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue();
- case 4 : return ((const Svx3DLightDirection5Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue();
- case 5 : return ((const Svx3DLightDirection6Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue();
- case 6 : return ((const Svx3DLightDirection7Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue();
- case 7 : return ((const Svx3DLightDirection8Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue();
+ case 0 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue();
+ case 1 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue();
+ case 2 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue();
+ case 3 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue();
+ case 4 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue();
+ case 5 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue();
+ case 6 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue();
+ case 7 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue();
}
}
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index efa5f3f85b4b..b5d6ab91b300 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -50,6 +50,7 @@
#include <linectrl.hrc>
#include <vcl/bmpacc.hxx>
#include <svx/xbtmpit.hxx>
+#include <svx/svdlegacy.hxx>
#define OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT)
#define OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT)
@@ -2076,8 +2077,7 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
basegfx::B2DPolygon aPolygonA;
aPolygonA.append(aPointA1);
aPolygonA.append(aPointA2);
- mpLineObjA = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPolygonA));
- mpLineObjA->SetModel(&getModel());
+ mpLineObjA = new SdrPathObj(getModel(), basegfx::B2DPolyPolygon(aPolygonA));
// create DrawObectB
const sal_Int32 aYPosB1((aOutputSize.Height() * 3) / 4);
@@ -2089,8 +2089,7 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
aPolygonB.append(aPointB1);
aPolygonB.append(aPointB2);
aPolygonB.append(aPointB3);
- mpLineObjB = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aPolygonB));
- mpLineObjB->SetModel(&getModel());
+ mpLineObjB = new SdrPathObj(getModel(), basegfx::B2DPolyPolygon(aPolygonB));
// create DrawObectC
const basegfx::B2DPoint aPointC1( aPointB3.getX() + nDistance, aYPosB1);
@@ -2100,15 +2099,14 @@ SvxXLinePreview::SvxXLinePreview( Window* pParent, const ResId& rResId )
aPolygonC.append(aPointC1);
aPolygonC.append(aPointC2);
aPolygonC.append(aPointC3);
- mpLineObjC = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aPolygonC));
- mpLineObjC->SetModel(&getModel());
+ mpLineObjC = new SdrPathObj(getModel(), basegfx::B2DPolyPolygon(aPolygonC));
}
SvxXLinePreview::~SvxXLinePreview()
{
- SdrObject::Free( mpLineObjA );
- SdrObject::Free( mpLineObjB );
- SdrObject::Free( mpLineObjC );
+ deleteSdrObjectSafeAndClearPointer( mpLineObjA );
+ deleteSdrObjectSafeAndClearPointer( mpLineObjB );
+ deleteSdrObjectSafeAndClearPointer( mpLineObjC );
}
// -----------------------------------------------------------------------
@@ -2153,7 +2151,7 @@ void SvxXLinePreview::Paint( const Rectangle& )
LocalPrePaint();
// paint objects to buffer device
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(mpLineObjA);
aObjectVector.push_back(mpLineObjB);
aObjectVector.push_back(mpLineObjC);
@@ -2189,14 +2187,16 @@ SvxXRectPreview::SvxXRectPreview( Window* pParent, const ResId& rResId )
InitSettings(true, true);
// create RectangleObject
- const Rectangle aObjectSize(Point(), GetOutputSize());
- mpRectangleObject = new SdrRectObj(aObjectSize);
- mpRectangleObject->SetModel(&getModel());
+ mpRectangleObject = new SdrRectObj(
+ getModel(),
+ basegfx::tools::createScaleB2DHomMatrix(
+ GetOutputSize().getWidth(), GetOutputSize().getHeight()));
+ //mpRectangleObject->SetModel(&getModel());
}
SvxXRectPreview::~SvxXRectPreview()
{
- SdrObject::Free(mpRectangleObject);
+ deleteSdrObjectSafeAndClearPointer(mpRectangleObject);
}
void SvxXRectPreview::SetAttributes(const SfxItemSet& rItemSet)
@@ -2209,7 +2209,7 @@ void SvxXRectPreview::Paint( const Rectangle& )
{
LocalPrePaint();
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(mpRectangleObject);
@@ -2240,20 +2240,24 @@ SvxXShadowPreview::SvxXShadowPreview( Window* pParent, const ResId& rResId )
aSize.Height() = aSize.Height() / 3;
// create RectangleObject
- const Rectangle aObjectSize( Point( aSize.Width(), aSize.Height() ), aSize );
- mpRectangleObject = new SdrRectObj(aObjectSize);
- mpRectangleObject->SetModel(&getModel());
+ mpRectangleObject = new SdrRectObj(
+ getModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize.getWidth(), aSize.getHeight(),
+ aSize.getWidth(), aSize.getHeight()));
+ //mpRectangleObject->SetModel(&getModel());
// create ShadowObject
- const Rectangle aShadowSize( Point( aSize.Width(), aSize.Height() ), aSize );
- mpRectangleShadow = new SdrRectObj(aShadowSize);
- mpRectangleShadow->SetModel(&getModel());
+ mpRectangleShadow = new SdrRectObj(
+ getModel(),
+ mpRectangleObject->getSdrObjectTransformation());
+ //mpRectangleShadow->SetModel(&getModel());
}
SvxXShadowPreview::~SvxXShadowPreview()
{
- SdrObject::Free(mpRectangleObject);
- SdrObject::Free(mpRectangleShadow);
+ deleteSdrObjectSafeAndClearPointer(mpRectangleObject);
+ deleteSdrObjectSafeAndClearPointer(mpRectangleShadow);
}
void SvxXShadowPreview::SetRectangleAttributes(const SfxItemSet& rItemSet)
@@ -2270,16 +2274,14 @@ void SvxXShadowPreview::SetShadowAttributes(const SfxItemSet& rItemSet)
void SvxXShadowPreview::SetShadowPosition(const Point& rPos)
{
- Rectangle aObjectPosition(mpRectangleObject->GetSnapRect());
- aObjectPosition.Move(rPos.X(), rPos.Y());
- mpRectangleShadow->SetSnapRect(aObjectPosition);
+ sdr::legacy::transformSdrObject(*mpRectangleShadow, basegfx::tools::createTranslateB2DHomMatrix(rPos.X(), rPos.Y()));
}
void SvxXShadowPreview::Paint( const Rectangle& )
{
LocalPrePaint();
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(mpRectangleShadow);
aObjectVector.push_back(mpRectangleObject);
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index b7bb6140dd2d..ce9ed9fa11de 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -28,12 +28,9 @@
// ============================================================================
-DBG_NAME( SvLBoxFontString );
-
SvLBoxFontString::SvLBoxFontString() :
SvLBoxString()
{
- DBG_CTOR( SvLBoxFontString, 0 );
}
SvLBoxFontString::SvLBoxFontString(
@@ -43,7 +40,6 @@ SvLBoxFontString::SvLBoxFontString(
maFont( rFont ),
mbUseColor( pColor != NULL )
{
- DBG_CTOR( SvLBoxFontString, 0 );
SetText( pEntry, rString );
if( pColor )
maFont.SetColor( *pColor );
@@ -51,19 +47,16 @@ SvLBoxFontString::SvLBoxFontString(
SvLBoxFontString::~SvLBoxFontString()
{
- DBG_DTOR( SvLBoxFontString, 0 );
}
SvLBoxItem* SvLBoxFontString::Create() const
{
- DBG_CHKTHIS( SvLBoxFontString, 0 );
return new SvLBoxFontString;
}
void SvLBoxFontString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry )
{
- DBG_CHKTHIS( SvLBoxFontString, 0 );
Font aOldFont( rDev.GetFont() );
Font aNewFont( maFont );
bool bSel = (nFlags & SVLISTENTRYFLAG_SELECTED) != 0;
@@ -81,7 +74,6 @@ void SvLBoxFontString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags
void SvLBoxFontString::InitViewData( SvLBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
{
- DBG_CHKTHIS( SvLBoxFontString, 0 );
Font aOldFont( pView->GetFont() );
pView->SetFont( maFont );
SvLBoxString::InitViewData( pView, pEntry, pViewData);
diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx
index 029902e50201..346dbcfeeac2 100644
--- a/svx/source/dialog/fontwork.cxx
+++ b/svx/source/dialog/fontwork.cxx
@@ -28,23 +28,23 @@
#include <sfx2/module.hxx>
#include <sfx2/dispatch.hxx>
#include <tools/shl.hxx>
-
#define _SVX_FONTWORK_CXX
#include <svx/svdobj.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdview.hxx>
#include <svx/svdocirc.hxx>
#include <svx/xtextit.hxx>
-
#include <svx/dialmgr.hxx>
-#include "svx/dlgutil.hxx"
+#include <svx/dlgutil.hxx>
#include <svx/dialogs.hrc>
-#include "fontwork.hrc"
+#include <fontwork.hrc>
#include <svx/fontwork.hxx>
#include <editeng/outlobj.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/point/b2dpoint.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
SFX_IMPL_DOCKINGWINDOW( SvxFontWorkChildWindow, SID_FONTWORK );
@@ -80,96 +80,84 @@ void SvxFontWorkControllerItem::StateChanged( sal_uInt16 /*nSID*/, SfxItemState
{
case SID_FORMTEXT_STYLE:
{
- const XFormTextStyleItem* pStateItem =
- PTR_CAST(XFormTextStyleItem, pItem);
+ const XFormTextStyleItem* pStateItem = dynamic_cast< const XFormTextStyleItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextStyleItem erwartet");
rFontWorkDlg.SetStyle_Impl(pStateItem);
break;
}
case SID_FORMTEXT_ADJUST:
{
- const XFormTextAdjustItem* pStateItem =
- PTR_CAST(XFormTextAdjustItem, pItem);
+ const XFormTextAdjustItem* pStateItem = dynamic_cast< const XFormTextAdjustItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextAdjustItem erwartet");
rFontWorkDlg.SetAdjust_Impl(pStateItem);
break;
}
case SID_FORMTEXT_DISTANCE:
{
- const XFormTextDistanceItem* pStateItem =
- PTR_CAST(XFormTextDistanceItem, pItem);
+ const XFormTextDistanceItem* pStateItem = dynamic_cast< const XFormTextDistanceItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextDistanceItem erwartet");
rFontWorkDlg.SetDistance_Impl(pStateItem);
break;
}
case SID_FORMTEXT_START:
{
- const XFormTextStartItem* pStateItem =
- PTR_CAST(XFormTextStartItem, pItem);
+ const XFormTextStartItem* pStateItem = dynamic_cast< const XFormTextStartItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextStartItem erwartet");
rFontWorkDlg.SetStart_Impl(pStateItem);
break;
}
case SID_FORMTEXT_MIRROR:
{
- const XFormTextMirrorItem* pStateItem =
- PTR_CAST(XFormTextMirrorItem, pItem);
+ const XFormTextMirrorItem* pStateItem = dynamic_cast< const XFormTextMirrorItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextMirrorItem erwartet");
rFontWorkDlg.SetMirror_Impl(pStateItem);
break;
}
case SID_FORMTEXT_STDFORM:
{
- const XFormTextStdFormItem* pStateItem =
- PTR_CAST(XFormTextStdFormItem, pItem);
+ const XFormTextStdFormItem* pStateItem = dynamic_cast< const XFormTextStdFormItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextStdFormItem erwartet");
rFontWorkDlg.SetStdForm_Impl(pStateItem);
break;
}
case SID_FORMTEXT_HIDEFORM:
{
- const XFormTextHideFormItem* pStateItem =
- PTR_CAST(XFormTextHideFormItem, pItem);
+ const XFormTextHideFormItem* pStateItem = dynamic_cast< const XFormTextHideFormItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextHideFormItem erwartet");
rFontWorkDlg.SetShowForm_Impl(pStateItem);
break;
}
case SID_FORMTEXT_OUTLINE:
{
- const XFormTextOutlineItem* pStateItem =
- PTR_CAST(XFormTextOutlineItem, pItem);
+ const XFormTextOutlineItem* pStateItem = dynamic_cast< const XFormTextOutlineItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextOutlineItem erwartet");
rFontWorkDlg.SetOutline_Impl(pStateItem);
break;
}
case SID_FORMTEXT_SHADOW:
{
- const XFormTextShadowItem* pStateItem =
- PTR_CAST(XFormTextShadowItem, pItem);
+ const XFormTextShadowItem* pStateItem = dynamic_cast< const XFormTextShadowItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowItem erwartet");
rFontWorkDlg.SetShadow_Impl(pStateItem);
break;
}
case SID_FORMTEXT_SHDWCOLOR:
{
- const XFormTextShadowColorItem* pStateItem =
- PTR_CAST(XFormTextShadowColorItem, pItem);
+ const XFormTextShadowColorItem* pStateItem = dynamic_cast< const XFormTextShadowColorItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowColorItem erwartet");
rFontWorkDlg.SetShadowColor_Impl(pStateItem);
break;
}
case SID_FORMTEXT_SHDWXVAL:
{
- const XFormTextShadowXValItem* pStateItem =
- PTR_CAST(XFormTextShadowXValItem, pItem);
+ const XFormTextShadowXValItem* pStateItem = dynamic_cast< const XFormTextShadowXValItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowXValItem erwartet");
rFontWorkDlg.SetShadowXVal_Impl(pStateItem);
break;
}
case SID_FORMTEXT_SHDWYVAL:
{
- const XFormTextShadowYValItem* pStateItem =
- PTR_CAST(XFormTextShadowYValItem, pItem);
+ const XFormTextShadowYValItem* pStateItem = dynamic_cast< const XFormTextShadowYValItem* >( pItem);
DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowYValItem erwartet");
rFontWorkDlg.SetShadowYVal_Impl(pStateItem);
break;
@@ -990,7 +978,7 @@ void SvxFontWorkDialog::SetActive(sal_Bool /*bActivate*/)
|*
\************************************************************************/
-void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
+void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView,
const SfxItemSet& rAttr,
SdrObject& rOldObj,
XFormTextStdForm eForm)
@@ -998,7 +986,6 @@ void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
SfxItemSet aAttr(*rAttr.GetPool(), XATTR_FORMTXTSTYLE,
XATTR_FORMTXTHIDEFORM);
SdrObject* pNewObj = NULL;
- Rectangle aRect;
XFormTextAdjust eAdjust = XFT_AUTOSIZE;
//-/ rOldObj.TakeAttributes(aAttr, sal_True, sal_False);
@@ -1007,25 +994,34 @@ void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
const XFormTextStdFormItem& rOldForm = (const XFormTextStdFormItem&)
aAttr.Get(XATTR_FORMTXTSTDFORM);
- aRect = rOldObj.GetSnapRect();
+ basegfx::B2DRange aRange(sdr::legacy::GetSnapRange(rOldObj));
+
+ if ( !dynamic_cast< SdrPathObj* >(&rOldObj) )
+ {
+ const basegfx::B2DPoint aTopLeft(aRange.getMinimum());
+
+ aRange = sdr::legacy::GetLogicRange(rOldObj);
- if ( !rOldObj.ISA(SdrPathObj) )
+ if(!aRange.getMinimum().equal(aTopLeft))
{
- Point aPos = aRect.TopLeft();
- aRect = rOldObj.GetLogicRect();
- aRect.SetPos(aPos);
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aTopLeft - aRange.getMinimum()));
+ }
}
aAttr.Put(rAttr);
if ( rOldForm.GetValue() == XFTFORM_NONE )
{
- long nW = aRect.GetWidth();
- aRect.SetSize(Size(nW, nW));
+ const double fWidth(aRange.getWidth());
+
+ aRange = basegfx::B2DRange(
+ aRange.getMinX(), aRange.getMinY(),
+ aRange.getMinX() + fWidth, aRange.getMinY() + fWidth);
+
aAttr.Put(XFormTextStyleItem(XFT_ROTATE));
}
- Point aCenter = aRect.Center();
+ const basegfx::B2DPoint aCenter(aRange.getCenter());
switch ( eForm )
{
@@ -1038,68 +1034,92 @@ void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
case XFTFORM_LFTARC:
case XFTFORM_RGTARC:
{
- long nBeg, nEnd;
+ double fBeg, fEnd;
switch ( eForm )
{
default: ; //prevent warning
case XFTFORM_TOPCIRC:
- nBeg = 0;
- nEnd = 18000;
+ fBeg = 0.0;
+ fEnd = F_PI;
break;
case XFTFORM_BOTCIRC:
- nBeg = 18000;
- nEnd = 36000;
+ fBeg = F_PI;
+ fEnd = F_2PI;
break;
case XFTFORM_LFTCIRC:
- nBeg = 9000;
- nEnd = 27000;
+ fBeg = F_PI2 * 3.0;
+ fEnd = F_PI2;
break;
case XFTFORM_RGTCIRC:
- nBeg = 27000;
- nEnd = 9000;
+ fBeg = F_PI2;
+ fEnd = F_PI2 * 3.0;
break;
case XFTFORM_TOPARC:
- nBeg = 4500;
- nEnd = 13500;
+ fBeg = F_PI4 * 7.0;
+ fEnd = F_PI4 * 5.0;
break;
case XFTFORM_BOTARC:
- nBeg = 22500;
- nEnd = 31500;
+ fBeg = F_PI4 * 3.0;
+ fEnd = F_PI4;
break;
case XFTFORM_LFTARC:
- nBeg = 13500;
- nEnd = 22500;
+ fBeg = F_PI4 * 5.0;
+ fEnd = F_PI4 * 3.0;
break;
case XFTFORM_RGTARC:
- nBeg = 31500;
- nEnd = 4500;
+ fBeg = F_PI4;
+ fEnd = F_PI4 * 7.0;
break;
}
- pNewObj = new SdrCircObj(OBJ_CARC, aRect, nBeg, nEnd);
+
+ pNewObj = new SdrCircObj(
+ rOldObj.getSdrModelFromSdrObject(),
+ CircleType_Arc,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRange.getRange(),
+ aRange.getMinimum()),
+ fBeg,
+ fEnd);
break;
}
case XFTFORM_BUTTON1:
{
basegfx::B2DPolyPolygon aPolyPolygon;
basegfx::B2DPolygon aLine;
- long nR = aRect.GetWidth() / 2;
- basegfx::B2DPolygon aTopArc(XPolygon(aCenter, -nR, nR, 50, 1750, sal_False).getB2DPolygon());
- basegfx::B2DPolygon aBottomArc(XPolygon(aCenter, -nR, nR, 1850, 3550, sal_False).getB2DPolygon());
+ const double fR(aRange.getWidth() * 0.5);
+
+ basegfx::B2DPolygon aTopArc(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ aCenter,
+ -fR,
+ fR,
+ ((3600.0 - 1750.0) * F_PI) / 1800.0,
+ ((3600.0 - 50.0) * F_PI) / 1800.0));
+ aTopArc.flip();
+
+ basegfx::B2DPolygon aBottomArc(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ aCenter,
+ -fR,
+ fR,
+ ((3600.0 - 3550.0) * F_PI) / 1800.0,
+ ((3600.0 - 1850.0) * F_PI) / 1800.0));
+ aBottomArc.flip();
// Polygone schliessen
aTopArc.setClosed(true);
aBottomArc.setClosed(true);
aPolyPolygon.append(aTopArc);
- aLine.append(aBottomArc.getB2DPoint(aBottomArc.count() - 1L));
- aLine.append(aBottomArc.getB2DPoint(0L));
+ aLine.append(aBottomArc.getB2DPoint(aBottomArc.count() - 1));
+ aLine.append(aBottomArc.getB2DPoint(0));
aLine.setClosed(true);
aPolyPolygon.append(aLine);
aPolyPolygon.append(aBottomArc);
- pNewObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
+ pNewObj = new SdrPathObj(rOldObj.getSdrModelFromSdrObject(), aPolyPolygon);
eAdjust = XFT_CENTER;
break;
}
@@ -1109,49 +1129,85 @@ void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
{
basegfx::B2DPolyPolygon aPolyPolygon;
basegfx::B2DPolygon aLine;
- long nR = aRect.GetWidth() / 2;
- long nWDiff = nR / 5;
- long nHDiff;
+ const double fR(aRange.getWidth() * 0.5);
+ const double fWDiff(fR / 5.0);
+ double fHDiff(0.0);
if ( eForm == XFTFORM_BUTTON4 )
{
- basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 950, 2650, sal_False).getB2DPolygon());
+ basegfx::B2DPolygon aNewArc(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ aCenter,
+ -fR,
+ fR,
+ ((3600.0 - 2650.0) * F_PI) / 1800.0,
+ ((3600.0 - 950.0) * F_PI) / 1800.0));
+
+ aNewArc.flip();
aNewArc.setClosed(true);
aPolyPolygon.append(aNewArc);
eAdjust = XFT_CENTER;
}
else
{
- basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 2700, 2700).getB2DPolygon());
+ basegfx::B2DPolygon aNewArc(basegfx::tools::createPolygonFromUnitCircle(1));
+ const basegfx::B2DHomMatrix aArcMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ -fR,
+ fR,
+ aCenter.getX(),
+ aCenter.getY()));
+
+ aNewArc.removeDoublePoints();
+ aNewArc.flip();
+ aNewArc.transform(aArcMatrix);
+
+ /// This emulates the closed flag from the old call, but I think this
+ /// always has been not wanted. Thus I list it here, but deactivate it
+ //aNewArc.append(aCenter);
+
+ aNewArc.setClosed(true);
aPolyPolygon.append(aNewArc);
}
if ( eForm == XFTFORM_BUTTON3 )
- nHDiff = -aRect.GetHeight() / 10;
+ {
+ fHDiff = -aRange.getHeight() / 10.0;
+ }
else
- nHDiff = aRect.GetHeight() / 20;
+ {
+ fHDiff = aRange.getHeight() / 20.0;
+ }
- aLine.append(basegfx::B2DPoint(aRect.Left() + nWDiff, aRect.Center().Y() + nHDiff));
- aLine.append(basegfx::B2DPoint(aRect.Right() - nWDiff, aRect.Center().Y() + nHDiff));
+ aLine.append(basegfx::B2DPoint(aRange.getMinX() + fWDiff, aRange.getCenter().getY() + fHDiff));
+ aLine.append(basegfx::B2DPoint(aRange.getMaxX() - fWDiff, aRange.getCenter().getY() + fHDiff));
aLine.setClosed(true);
aPolyPolygon.append(aLine);
if ( eForm == XFTFORM_BUTTON4 )
{
- basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 2750, 850, sal_False).getB2DPolygon());
+ basegfx::B2DPolygon aNewArc(
+ basegfx::tools::createPolygonFromEllipseSegment(
+ aCenter,
+ -fR,
+ fR,
+ ((3600.0 - 850.0) * F_PI) / 1800.0,
+ ((3600.0 - 2750.0) * F_PI) / 1800.0));
+
+ aNewArc.flip();
aNewArc.setClosed(true);
aPolyPolygon.append(aNewArc);
}
if ( eForm == XFTFORM_BUTTON3 )
{
- nHDiff += nHDiff;
- aLine.setB2DPoint(0L, basegfx::B2DPoint(aLine.getB2DPoint(0L).getX(), aLine.getB2DPoint(0L).getY() - nHDiff));
- aLine.setB2DPoint(1L, basegfx::B2DPoint(aLine.getB2DPoint(1L).getX(), aLine.getB2DPoint(1L).getY() - nHDiff));
+ fHDiff += fHDiff;
+ aLine.setB2DPoint(0L, basegfx::B2DPoint(aLine.getB2DPoint(0L).getX(), aLine.getB2DPoint(0L).getY() - fHDiff));
+ aLine.setB2DPoint(1L, basegfx::B2DPoint(aLine.getB2DPoint(1L).getX(), aLine.getB2DPoint(1L).getY() - fHDiff));
aPolyPolygon.append(aLine);
}
- pNewObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
+ pNewObj = new SdrPathObj(rOldObj.getSdrModelFromSdrObject(), aPolyPolygon);
break;
}
default: ; //prevent warning
@@ -1161,14 +1217,12 @@ void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
// #78478# due to DLs changes in Outliner the object needs
// a model to get an outliner for later calls to
// pNewObj->SetOutlinerParaObject(pPara) (see below).
- pNewObj->SetModel(rOldObj.GetModel());
-
- Size aSize;
- Rectangle aSnap = pNewObj->GetSnapRect();
+ const basegfx::B2DRange aSnap(sdr::legacy::GetSnapRange(*pNewObj));
- aSize.Width() = aRect.Left() - aSnap.Left();
- aSize.Height() = aRect.Top() - aSnap.Top();
- pNewObj->NbcMove(aSize);
+ sdr::legacy::transformSdrObject(
+ *pNewObj,
+ basegfx::tools::createTranslateB2DHomMatrix(
+ aRange.getMinimum() - aSnap.getMinimum()));
rView.BegUndo( SVX_RESSTR( RID_SVXSTR_FONTWORK_UNDOCREATE ) );
OutlinerParaObject* pPara = rOldObj.GetOutlinerParaObject();
@@ -1182,7 +1236,7 @@ void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
else
bHide = sal_False;
- rView.ReplaceObjectAtView(&rOldObj, rPV, pNewObj, sal_True);
+ rView.ReplaceObjectAtView(rOldObj, *pNewObj, true);
pNewObj->SetLayer(rOldObj.GetLayer());
aAttr.Put(XFormTextHideFormItem(bHide));
aAttr.Put(XFormTextAdjustItem(eAdjust));
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index cfaa6e1d441f..75bd124767f1 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -50,24 +50,35 @@
|*
\************************************************************************/
-void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, const Rectangle& /*rOldBoundRect*/ )
+void GraphCtrl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- switch( eType )
+ const SdrBaseHint* pSdrBaseHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrBaseHint)
+ {
+ const SdrObject* pObj = pSdrBaseHint->GetSdrHintObject();
+
+ if(pObj)
+ {
+ const SdrHintKind eHint(pSdrBaseHint->GetSdrHintKind());
+
+ switch(eHint)
{
- case( SDRUSERCALL_MOVEONLY ):
- case( SDRUSERCALL_RESIZE ):
- rWin.SdrObjChanged( rObj );
+ case(HINT_OBJCHG_MOVE):
+ case(HINT_OBJCHG_RESIZE):
+ SdrObjChanged( *pObj );
break;
- case( SDRUSERCALL_INSERTED ):
- rWin.SdrObjCreated( rObj );
+ case(HINT_OBJINSERTED):
+ SdrObjCreated( *pObj );
break;
default:
break;
}
}
-
+ }
+}
/*************************************************************************
|*
@@ -77,8 +88,9 @@ void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, c
GraphCtrl::GraphCtrl( Window* pParent, const WinBits nWinBits ) :
Control ( pParent, nWinBits ),
+ SfxListener ( ),
aMap100 ( MAP_100TH_MM ),
- eObjKind ( OBJ_NONE ),
+ maSdrObjectCreationInfo(OBJ_NONE),
nPolyEdit ( 0 ),
bEditMode ( sal_False ),
bSdrMode ( sal_False ),
@@ -86,7 +98,6 @@ GraphCtrl::GraphCtrl( Window* pParent, const WinBits nWinBits ) :
pModel ( NULL ),
pView ( NULL )
{
- pUserCall = new GraphCtrlUserCall( *this );
aUpdateTimer.SetTimeout( 200 );
aUpdateTimer.SetTimeoutHdl( LINK( this, GraphCtrl, UpdateHdl ) );
aUpdateTimer.Start();
@@ -105,9 +116,10 @@ GraphCtrl::GraphCtrl( Window* pParent, const WinBits nWinBits ) :
GraphCtrl::GraphCtrl( Window* pParent, const ResId& rResId ) :
Control ( pParent, rResId ),
+ SfxListener ( ),
aMap100 ( MAP_100TH_MM ),
nWinStyle ( 0 ),
- eObjKind ( OBJ_NONE ),
+ maSdrObjectCreationInfo(OBJ_NONE),
nPolyEdit ( 0 ),
bEditMode ( sal_False ),
bSdrMode ( sal_False ),
@@ -116,7 +128,6 @@ GraphCtrl::GraphCtrl( Window* pParent, const ResId& rResId ) :
pModel ( NULL ),
pView ( NULL )
{
- pUserCall = new GraphCtrlUserCall( *this );
aUpdateTimer.SetTimeout( 500 );
aUpdateTimer.SetTimeoutHdl( LINK( this, GraphCtrl, UpdateHdl ) );
aUpdateTimer.Start();
@@ -139,7 +150,6 @@ GraphCtrl::~GraphCtrl()
}
delete pView;
delete pModel;
- delete pUserCall;
}
@@ -189,26 +199,25 @@ void GraphCtrl::InitSdrModel()
// Model anlegen
pModel = new SdrModel;
pModel->GetItemPool().FreezeIdRanges();
- pModel->SetScaleUnit( aMap100.GetMapUnit() );
- pModel->SetScaleFraction( Fraction( 1, 1 ) );
+ pModel->SetExchangeObjectUnit( aMap100.GetMapUnit() );
+ pModel->SetExchangeObjectScale( Fraction( 1, 1 ) );
pModel->SetDefaultFontHeight( 500 );
pPage = new SdrPage( *pModel );
- pPage->SetSize( aGraphSize );
- pPage->SetBorder( 0, 0, 0, 0 );
+ pPage->SetPageScale( basegfx::B2DVector(aGraphSize.Width(), aGraphSize.Height()) );
+ pPage->SetPageBorder( 0, 0, 0, 0 );
pModel->InsertPage( pPage );
pModel->SetChanged( sal_False );
// View anlegen
- pView = new GraphCtrlView( pModel, this );
- pView->SetWorkArea( Rectangle( Point(), aGraphSize ) );
- pView->EnableExtendedMouseEventDispatcher( sal_True );
- pView->ShowSdrPage(pView->GetModel()->GetPage(0));
-// pView->ShowSdrPage(pView->GetModel()->GetPage(0));
- pView->SetFrameDragSingles( sal_True );
+ pView = new GraphCtrlView( *pModel, this );
+ pView->SetWorkArea( basegfx::B2DRange( 0.0, 0.0, aGraphSize.Width(), aGraphSize.Height() ) );
+ pView->EnableExtendedMouseEventDispatcher(true);
+ pView->ShowSdrPage(*pView->getSdrModelFromSdrView().GetPage(0));
+ pView->SetFrameHandles(true);
pView->SetMarkedPointsSmooth( SDRPATHSMOOTH_SYMMETRIC );
- pView->SetEditMode( sal_True );
+ pView->SetViewEditMode(SDREDITMODE_EDIT);
// #i72889# set neeeded flags
pView->SetPagePaintingAllowed(false);
@@ -382,7 +391,7 @@ void GraphCtrl::SdrObjCreated( const SdrObject& )
|*
\************************************************************************/
-void GraphCtrl::MarkListHasChanged()
+void GraphCtrl::selectionChange()
{
if ( aMarkObjLink.IsSet() )
aMarkObjLink.Call( this );
@@ -409,7 +418,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
{
pView->DeleteMarked();
bProc = sal_True;
- if( !pView->AreObjectsMarked() )
+ if( !pView->areSdrObjectsSelected() )
((Dialog*)GetParent())->GrabFocusToFirstControl();
}
}
@@ -423,7 +432,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
{
pView->BrkAction();
}
- else if ( pView->AreObjectsMarked() )
+ else if ( pView->areSdrObjectsSelected() )
{
const SdrHdlList& rHdlList = pView->GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
@@ -485,7 +494,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
{
// #97016# mark last object
pView->UnmarkAllObj();
- pView->MarkNextObj(sal_False);
+ pView->MarkNextObj(false);
bProc = true;
}
@@ -497,7 +506,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
if ( aCode.IsMod1() )
{
pView->UnmarkAllObj();
- pView->MarkNextObj(sal_True);
+ pView->MarkNextObj(true);
bProc = true;
}
@@ -509,48 +518,40 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
case KEY_LEFT:
case KEY_RIGHT:
{
- long nX = 0;
- long nY = 0;
+ basegfx::B2DVector aMove(0.0, 0.0);
if (aCode.GetCode() == KEY_UP)
{
// Scroll nach oben
- nX = 0;
- nY =-1;
+ aMove = basegfx::B2DPoint(0.0, -1.0);
}
else if (aCode.GetCode() == KEY_DOWN)
{
// Scroll nach unten
- nX = 0;
- nY = 1;
+ aMove = basegfx::B2DPoint(0.0, 1.0);
}
else if (aCode.GetCode() == KEY_LEFT)
{
// Scroll nach links
- nX =-1;
- nY = 0;
+ aMove = basegfx::B2DPoint(-1.0, 0.0);
}
else if (aCode.GetCode() == KEY_RIGHT)
{
// Scroll nach rechts
- nX = 1;
- nY = 0;
+ aMove = basegfx::B2DPoint(1.0, 0.0);
}
- if (pView->AreObjectsMarked() && !aCode.IsMod1() )
+ if (pView->areSdrObjectsSelected() && !aCode.IsMod1() )
{
if(aCode.IsMod2())
{
// #97016# move in 1 pixel distance
- Size aLogicSizeOnePixel = PixelToLogic(Size(1,1));
- nX *= aLogicSizeOnePixel.Width();
- nY *= aLogicSizeOnePixel.Height();
+ aMove = GetInverseViewTransformation() * aMove;
}
else
{
// old, fixed move distance
- nX *= 100;
- nY *= 100;
+ aMove *= 100.0;
}
// #97016# II
@@ -560,66 +561,66 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
if(0L == pHdl)
{
// #90129# restrict movement to WorkArea
- const Rectangle& rWorkArea = pView->GetWorkArea();
+ const basegfx::B2DRange& rWorkRange = pView->GetWorkArea();
- if(!rWorkArea.IsEmpty())
+ if(!rWorkRange.isEmpty())
{
- Rectangle aMarkRect(pView->GetMarkedObjRect());
- aMarkRect.Move(nX, nY);
+ basegfx::B2DRange aMarkRange(pView->getMarkedObjectSnapRange());
+ aMarkRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aMove));
- if(!aMarkRect.IsInside(rWorkArea))
+ if(!aMarkRange.isInside(rWorkRange))
{
- if(aMarkRect.Left() < rWorkArea.Left())
+ if(aMarkRange.getMinX() < rWorkRange.getMinX())
{
- nX += rWorkArea.Left() - aMarkRect.Left();
+ aMove.setX(aMove.getX() + rWorkRange.getMinX() - aMarkRange.getMinX());
}
- if(aMarkRect.Right() > rWorkArea.Right())
+ if(aMarkRange.getMaxX() > rWorkRange.getMaxX())
{
- nX -= aMarkRect.Right() - rWorkArea.Right();
+ aMove.setX(aMove.getX() - aMarkRange.getMaxX() - rWorkRange.getMaxX());
}
- if(aMarkRect.Top() < rWorkArea.Top())
+ if(aMarkRange.getMinY() < rWorkRange.getMinY())
{
- nY += rWorkArea.Top() - aMarkRect.Top();
+ aMove.setY(aMove.getY() + rWorkRange.getMinY() - aMarkRange.getMinY());
}
- if(aMarkRect.Bottom() > rWorkArea.Bottom())
+ if(aMarkRange.getMaxY() > rWorkRange.getMaxY())
{
- nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
+ aMove.setY(aMove.getY() - aMarkRange.getMaxY() - rWorkRange.getMaxY());
}
}
}
// no handle selected
- if(0 != nX || 0 != nY)
+ if(!aMove.equalZero())
{
- pView->MoveAllMarked(Size(nX, nY));
+ pView->MoveMarkedObj(aMove);
}
}
else
{
// move handle with index nHandleIndex
- if(pHdl && (nX || nY))
+ if(pHdl && !aMove.equalZero())
{
- // now move the Handle (nX, nY)
- Point aStartPoint(pHdl->GetPos());
- Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
+ // now move the Handle
+ const basegfx::B2DPoint aStartPoint(pHdl->getPosition());
+ const basegfx::B2DPoint aEndPoint(aStartPoint + aMove);
const SdrDragStat& rDragStat = pView->GetDragStat();
// start dragging
- pView->BegDragObj(aStartPoint, 0, pHdl, 0);
+ pView->BegDragObj(aStartPoint, pHdl, 0.0);
if(pView->IsDragObj())
{
- FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
- sal_Bool bWasSnapEnabled = pView->IsSnapEnabled();
+ const bool bWasNoSnap(rDragStat.IsNoSnap());
+ const bool bWasSnapEnabled(pView->IsSnapEnabled());
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap(sal_True);
+ ((SdrDragStat&)rDragStat).SetNoSnap(true);
if(bWasSnapEnabled)
- pView->SetSnapEnabled(sal_False);
+ pView->SetSnapEnabled(false);
pView->MovAction(aEndPoint);
pView->EndDragObj();
@@ -655,14 +656,14 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
{
if(rKEvt.GetKeyCode().IsShift())
{
- pView->UnmarkPoint(*pHdl);
+ pView->MarkPoint(*pHdl, true); // unmark
}
}
else
{
if(!rKEvt.GetKeyCode().IsShift())
{
- pView->UnmarkAllPoints();
+ pView->MarkPoints(0, true); // unmarkall
}
pView->MarkPoint(*pHdl);
@@ -675,7 +676,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
for(sal_uInt32 a(0); !pNewOne && a < rHdlList.GetHdlCount(); a++)
{
- SdrHdl* pAct = rHdlList.GetHdl(a);
+ SdrHdl* pAct = rHdlList.GetHdlByIndex(a);
if(pAct
&& pAct->GetKind() == HDL_POLY
@@ -719,9 +720,10 @@ void GraphCtrl::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( bSdrMode && ( rMEvt.GetClicks() < 2 ) )
{
- const Point aLogPt( PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogPt(GetInverseViewTransformation() * aPixelPos);
- if ( !Rectangle( Point(), aGraphSize ).IsInside( aLogPt ) && !pView->IsEditMode() )
+ if ( !basegfx::B2DRange( 0.0, 0.0, aGraphSize.Width(), aGraphSize.Height() ).isInside( aLogPt ) && !pView->IsEditMode() )
Control::MouseButtonDown( rMEvt );
else
{
@@ -745,8 +747,7 @@ void GraphCtrl::MouseButtonDown( const MouseEvent& rMEvt )
SdrObject* pCreateObj = pView->GetCreateObj();
// Wir wollen das Inserten mitbekommen
- if ( pCreateObj && !pCreateObj->GetUserCall() )
- pCreateObj->SetUserCall( pUserCall );
+ ConnectToSdrObject(pCreateObj);
SetPointer( pView->GetPreferedPointer( aLogPt, this ) );
}
@@ -754,6 +755,38 @@ void GraphCtrl::MouseButtonDown( const MouseEvent& rMEvt )
Control::MouseButtonDown( rMEvt );
}
+void GraphCtrl::ConnectToSdrObject(SdrObject* pObject)
+{
+ if(pObject)
+ {
+ GraphCtrl* pAlreadyConnected = 0;
+
+ if(pObject->HasListeners())
+ {
+ const sal_uInt16 nListenerCount(pObject->GetListenerCount());
+
+ for(sal_uInt16 a(0); !pAlreadyConnected && a < nListenerCount; a++)
+ {
+ SfxListener* pCandidate = pObject->GetListener(a);
+
+ if(pCandidate) // not all slots in a broadcaster have to be used
+ {
+ GraphCtrl* pCurrent = dynamic_cast< GraphCtrl* >(pCandidate);
+
+ if(pCurrent && pCurrent == this)
+ {
+ pAlreadyConnected = pCurrent;
+ }
+ }
+ }
+ }
+
+ if(!pAlreadyConnected)
+ {
+ StartListening(*pObject);
+ }
+ }
+}
/*************************************************************************
|*
@@ -763,7 +796,8 @@ void GraphCtrl::MouseButtonDown( const MouseEvent& rMEvt )
void GraphCtrl::MouseMove(const MouseEvent& rMEvt)
{
- const Point aLogPos( PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogPos(GetInverseViewTransformation() * aPixelPos);
if ( bSdrMode )
{
@@ -783,8 +817,8 @@ void GraphCtrl::MouseMove(const MouseEvent& rMEvt)
if ( aMousePosLink.IsSet() )
{
- if ( Rectangle( Point(), aGraphSize ).IsInside( aLogPos ) )
- aMousePos = aLogPos;
+ if ( basegfx::B2DRange( 0.0, 0.0, aGraphSize.Width(), aGraphSize.Height() ).isInside( aLogPos ) )
+ aMousePos = Point(basegfx::fround(aLogPos.getX()), basegfx::fround(aLogPos.getY()));
else
aMousePos = Point();
@@ -809,7 +843,10 @@ void GraphCtrl::MouseButtonUp(const MouseEvent& rMEvt)
pView->MouseButtonUp( rMEvt, this );
ReleaseMouse();
- SetPointer( pView->GetPreferedPointer( PixelToLogic( rMEvt.GetPosPixel() ), this ) );
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aLogPos(GetInverseViewTransformation() * aPixelPos);
+
+ SetPointer( pView->GetPreferedPointer(aLogPos, this ) );
}
else
Control::MouseButtonUp( rMEvt );
@@ -828,10 +865,7 @@ SdrObject* GraphCtrl::GetSelectedSdrObject() const
if ( bSdrMode )
{
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
-
- if ( rMarkList.GetMarkCount() == 1 )
- pSdrObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ pSdrObj = pView->getSelectedIfSingle();
}
return pSdrObj;
@@ -849,9 +883,9 @@ void GraphCtrl::SetEditMode( const sal_Bool _bEditMode )
if ( bSdrMode )
{
bEditMode = _bEditMode;
- pView->SetEditMode( bEditMode );
- eObjKind = OBJ_NONE;
- pView->SetCurrentObj( sal::static_int_cast< sal_uInt16 >( eObjKind ) );
+ pView->SetViewEditMode(bEditMode ? SDREDITMODE_EDIT : SDREDITMODE_CREATE);
+ maSdrObjectCreationInfo.setIdent(OBJ_NONE);
+ pView->setSdrObjectCreationInfo(maSdrObjectCreationInfo);
}
else
bEditMode = sal_False;
@@ -869,7 +903,7 @@ void GraphCtrl::SetPolyEditMode( const sal_uInt16 _nPolyEdit )
if ( bSdrMode && ( _nPolyEdit != nPolyEdit ) )
{
nPolyEdit = _nPolyEdit;
- pView->SetFrameDragSingles( nPolyEdit == 0 );
+ pView->SetFrameHandles( nPolyEdit == 0 );
}
else
nPolyEdit = 0;
@@ -882,17 +916,19 @@ void GraphCtrl::SetPolyEditMode( const sal_uInt16 _nPolyEdit )
|*
\************************************************************************/
-void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind )
+void GraphCtrl::setSdrObjectCreationInfo( const SdrObjectCreationInfo& rSdrObjectCreationInfo )
{
if ( bSdrMode )
{
- bEditMode = sal_False;
- pView->SetEditMode( bEditMode );
- eObjKind = _eObjKind;
- pView->SetCurrentObj( sal::static_int_cast< sal_uInt16 >( eObjKind ) );
+ bEditMode = false;
+ pView->SetViewEditMode(SDREDITMODE_CREATE);
+ maSdrObjectCreationInfo = rSdrObjectCreationInfo;
+ pView->setSdrObjectCreationInfo(maSdrObjectCreationInfo);
}
else
- eObjKind = OBJ_NONE;
+ {
+ maSdrObjectCreationInfo.setIdent(OBJ_NONE);
+ }
}
@@ -913,7 +949,7 @@ String GraphCtrl::GetStringFromDouble( const double& rDouble )
/*************************************************************************
-www|*
+|*
|*
|*
\************************************************************************/
@@ -954,3 +990,12 @@ IMPL_LINK( GraphCtrl, UpdateHdl, Timer*, pTimer )
return mpAccContext;
}
+
+void GraphCtrlView::handleSelectionChange()
+{
+ // call parent
+ SdrView::handleSelectionChange();
+
+ // local reactions
+ rGraphCtrl.selectionChange();
+}
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index 7427461b24f5..3df76dd9170f 100644
--- a/svx/source/dialog/grfflt.cxx
+++ b/svx/source/dialog/grfflt.cxx
@@ -346,444 +346,5 @@ void SvxGraphicFilter::DisableGraphicFilterSlots( SfxItemSet& rSet )
if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_SOLARIZE ) )
rSet.DisableItem( SID_GRFFILTER_SOLARIZE );
};
-/* CHINA001 move to cuigrfflt.cxx
-// --------------------------------------
-// - GraphicFilterDialog::PreviewWindow -
-// --------------------------------------
-GraphicFilterDialog::PreviewWindow::PreviewWindow( Window* pParent, const ResId& rResId ) :
- Control( pParent, rResId )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterDialog::PreviewWindow::~PreviewWindow()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
-{
- Control::Paint( rRect );
-
- const Size aGrfSize( LogicToPixel( maGraphic.GetPrefSize(), maGraphic.GetPrefMapMode() ) );
- const Size aOutSize( GetOutputSizePixel() );
- const Point aGrfPos( ( aOutSize.Width() - aGrfSize.Width() ) >> 1,
- ( aOutSize.Height() - aGrfSize.Height() ) >> 1 );
-
- if( maGraphic.IsAnimated() )
- maGraphic.StartAnimation( this , aGrfPos, aGrfSize );
- else
- maGraphic.Draw( this, aGrfPos, aGrfSize );
-}
-
-// -----------------------------------------------------------------------------
-
-void GraphicFilterDialog::PreviewWindow::SetGraphic( const Graphic& rGraphic )
-{
- maGraphic = rGraphic;
-
- if( maGraphic.IsAnimated() || maGraphic.IsTransparent() )
- Invalidate();
- else
- Paint( Rectangle( Point(), GetOutputSizePixel() ) );
-}
-
-// -----------------------
-// - GraphicFilterDialog -
-// -----------------------
-
-GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic ) :
- ModalDialog ( pParent, rResId ),
- mfScaleX ( 0.0 ),
- mfScaleY ( 0.0 ),
- maSizePixel ( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ),
- maModifyHdl ( LINK( this, GraphicFilterDialog, ImplModifyHdl ) ),
- maPreview ( this, SVX_RES( CTL_PREVIEW ) ),
- maFlParameter ( this, SVX_RES( FL_PARAMETER ) ),
- maBtnOK ( this, SVX_RES( BTN_OK ) ),
- maBtnCancel ( this, SVX_RES( BTN_CANCEL ) ),
- maBtnHelp ( this, SVX_RES( BTN_HELP ) )
-{
- const Size aPreviewSize( maPreview.GetOutputSizePixel() );
- Size aGrfSize( maSizePixel );
-
- if( rGraphic.GetType() == GRAPHIC_BITMAP &&
- aPreviewSize.Width() && aPreviewSize.Height() &&
- aGrfSize.Width() && aGrfSize.Height() )
- {
- const double fGrfWH = (double) aGrfSize.Width() / aGrfSize.Height();
- const double fPreWH = (double) aPreviewSize.Width() / aPreviewSize.Height();
-
- if( fGrfWH < fPreWH )
- {
- aGrfSize.Width() = (long) ( aPreviewSize.Height() * fGrfWH );
- aGrfSize.Height()= aPreviewSize.Height();
- }
- else
- {
- aGrfSize.Width() = aPreviewSize.Width();
- aGrfSize.Height()= (long) ( aPreviewSize.Width() / fGrfWH);
- }
-
- mfScaleX = (double) aGrfSize.Width() / maSizePixel.Width();
- mfScaleY = (double) aGrfSize.Height() / maSizePixel.Height();
-
- if( !rGraphic.IsAnimated() )
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Scale( aGrfSize, BMP_SCALE_INTERPOLATE ) )
- maGraphic = aBmpEx;
- }
- }
-
- maTimer.SetTimeoutHdl( LINK( this, GraphicFilterDialog, ImplPreviewTimeoutHdl ) );
- maTimer.SetTimeout( 100 );
- ImplModifyHdl( NULL );
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterDialog::~GraphicFilterDialog()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( GraphicFilterDialog, ImplPreviewTimeoutHdl, Timer*, pTimer )
-{
- maTimer.Stop();
- maPreview.SetGraphic( GetFilteredGraphic( maGraphic, mfScaleX, mfScaleY ) );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( GraphicFilterDialog, ImplModifyHdl, void*, p )
-{
- if( maGraphic.GetType() == GRAPHIC_BITMAP )
- {
- maTimer.Stop();
- maTimer.Start();
- }
-
- return 0;
-}
-
-// ----------------
-// - FilterMosaic -
-// ----------------
-
-GraphicFilterMosaic::GraphicFilterMosaic( Window* pParent, const Graphic& rGraphic,
- sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges ) :
- GraphicFilterDialog( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_MOSAIC ), rGraphic ),
- maFtWidth ( this, SVX_RES( DLG_FILTERMOSAIC_FT_WIDTH ) ),
- maMtrWidth ( this, SVX_RES( DLG_FILTERMOSAIC_MTR_WIDTH ) ),
- maFtHeight ( this, SVX_RES( DLG_FILTERMOSAIC_FT_HEIGHT ) ),
- maMtrHeight ( this, SVX_RES( DLG_FILTERMOSAIC_MTR_HEIGHT ) ),
- maCbxEdges ( this, SVX_RES( DLG_FILTERMOSAIC_CBX_EDGES ) )
-{
- FreeResource();
-
- maMtrWidth.SetValue( nTileWidth );
- maMtrWidth.SetLast( GetGraphicSizePixel().Width() );
- maMtrWidth.SetModifyHdl( GetModifyHdl() );
-
- maMtrHeight.SetValue( nTileHeight );
- maMtrHeight.SetLast( GetGraphicSizePixel().Height() );
- maMtrHeight.SetModifyHdl( GetModifyHdl() );
-
- maCbxEdges.Check( bEnhanceEdges );
- maCbxEdges.SetToggleHdl( GetModifyHdl() );
-
- maMtrWidth.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterMosaic::~GraphicFilterMosaic()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
- double fScaleX, double fScaleY )
-{
- Graphic aRet;
- const Size aSize( Max( FRound( GetTileWidth() * fScaleX ), 1L ),
- Max( FRound( GetTileHeight() * fScaleY ), 1L ) );
- BmpFilterParam aParam( aSize );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_MOSAIC, &aParam ) )
- {
- if( IsEnhanceEdges() )
- aAnim.Filter( BMP_FILTER_SHARPEN );
-
- aRet = aAnim;
- }
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_MOSAIC, &aParam ) )
- {
- if( IsEnhanceEdges() )
- aBmpEx.Filter( BMP_FILTER_SHARPEN );
-
- aRet = aBmpEx;
- }
- }
-
- return aRet;
-}
-
-// ------------------
-// - GraphicFilterSolarize -
-// ------------------
-
-GraphicFilterSolarize::GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
- sal_uInt8 cGreyThreshold, sal_Bool bInvert ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_SOLARIZE ), rGraphic ),
- maFtThreshold ( this, SVX_RES( DLG_FILTERSOLARIZE_FT_THRESHOLD ) ),
- maMtrThreshold ( this, SVX_RES( DLG_FILTERSOLARIZE_MTR_THRESHOLD ) ),
- maCbxInvert ( this, SVX_RES( DLG_FILTERSOLARIZE_CBX_INVERT ) )
-{
- FreeResource();
-
- maMtrThreshold.SetValue( FRound( cGreyThreshold / 2.55 ) );
- maMtrThreshold.SetModifyHdl( GetModifyHdl() );
-
- maCbxInvert.Check( bInvert );
- maCbxInvert.SetToggleHdl( GetModifyHdl() );
-
- maMtrThreshold.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterSolarize::~GraphicFilterSolarize()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic,
- double fScaleX, double fScaleY )
-{
- Graphic aRet;
- BmpFilterParam aParam( GetGreyThreshold() );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
- {
- if( IsInvert() )
- aAnim.Invert();
-
- aRet = aAnim;
- }
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
- {
- if( IsInvert() )
- aBmpEx.Invert();
-
- aRet = aBmpEx;
- }
- }
-
- return aRet;
-}
-
-// ----------------------
-// - GraphicFilterSepia -
-// ----------------------
-
-GraphicFilterSepia::GraphicFilterSepia( Window* pParent, const Graphic& rGraphic,
- sal_uInt16 nSepiaPercent ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_SEPIA ), rGraphic ),
- maFtSepia ( this, SVX_RES( DLG_FILTERSEPIA_FT_SEPIA ) ),
- maMtrSepia ( this, SVX_RES( DLG_FILTERSEPIA_MTR_SEPIA ) )
-{
- FreeResource();
-
- maMtrSepia.SetValue( nSepiaPercent );
- maMtrSepia.SetModifyHdl( GetModifyHdl() );
-
- maMtrSepia.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterSepia::~GraphicFilterSepia()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic,
- double fScaleX, double fScaleY )
-{
- Graphic aRet;
- BmpFilterParam aParam( GetSepiaPercent() );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_SEPIA, &aParam ) )
- aRet = aAnim;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_SEPIA, &aParam ) )
- aRet = aBmpEx;
- }
-
- return aRet;
-}
-
-// -----------------------
-// - GraphicFilterPoster -
-// -----------------------
-
-GraphicFilterPoster::GraphicFilterPoster( Window* pParent, const Graphic& rGraphic,
- sal_uInt16 nPosterCount ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_POSTER ), rGraphic ),
- maFtPoster ( this, SVX_RES( DLG_FILTERPOSTER_FT_POSTER ) ),
- maNumPoster ( this, SVX_RES( DLG_FILTERPOSTER_NUM_POSTER ) )
-{
- FreeResource();
-
- maNumPoster.SetFirst( 2 );
- maNumPoster.SetLast( rGraphic.GetBitmapEx().GetBitCount() );
- maNumPoster.SetValue( nPosterCount );
- maNumPoster.SetModifyHdl( GetModifyHdl() );
- maNumPoster.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterPoster::~GraphicFilterPoster()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic,
- double fScaleX, double fScaleY )
-{
- Graphic aRet;
- const sal_uInt16 nPosterCount = GetPosterColorCount();
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.ReduceColors( nPosterCount, BMP_REDUCE_POPULAR ) )
- aRet = aAnim;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.ReduceColors( nPosterCount, BMP_REDUCE_POPULAR ) )
- aRet = aBmpEx;
- }
-
- return aRet;
-}
-
-// -----------------------
-// - GraphicFilterEmboss -
-// -----------------------
-
-void GraphicFilterEmboss::EmbossControl::MouseButtonDown( const MouseEvent& rEvt )
-{
- const RECT_POINT eOldRP = GetActualRP();
-
- SvxRectCtl::MouseButtonDown( rEvt );
-
- if( GetActualRP() != eOldRP )
- maModifyHdl.Call( this );
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterEmboss::GraphicFilterEmboss( Window* pParent, const Graphic& rGraphic,
- RECT_POINT eLightSource ) :
- GraphicFilterDialog ( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_EMBOSS ), rGraphic ),
- maFtLight ( this, SVX_RES( DLG_FILTEREMBOSS_FT_LIGHT ) ),
- maCtlLight ( this, SVX_RES( DLG_FILTEREMBOSS_CTL_LIGHT ), eLightSource )
-{
- FreeResource();
-
- maCtlLight.SetModifyHdl( GetModifyHdl() );
- maCtlLight.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterEmboss::~GraphicFilterEmboss()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic,
- double fScaleX, double fScaleY )
-{
- Graphic aRet;
- sal_uInt16 nAzim, nElev;
-
- switch( maCtlLight.GetActualRP() )
- {
- case( RP_LT ): nAzim = 4500, nElev = 4500; break;
- case( RP_MT ): nAzim = 9000, nElev = 4500; break;
- case( RP_RT ): nAzim = 13500, nElev = 4500; break;
- case( RP_LM ): nAzim = 0, nElev = 4500; break;
- case( RP_MM ): nAzim = 0, nElev = 9000; break;
- case( RP_RM ): nAzim = 18000, nElev = 4500; break;
- case( RP_LB ): nAzim = 31500, nElev = 4500; break;
- case( RP_MB ): nAzim = 27000, nElev = 4500; break;
- case( RP_RB ): nAzim = 22500, nElev = 4500; break;
- }
-
- BmpFilterParam aParam( nAzim, nElev );
-
- if( rGraphic.IsAnimated() )
- {
- Animation aAnim( rGraphic.GetAnimation() );
-
- if( aAnim.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
- aRet = aAnim;
- }
- else
- {
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
- if( aBmpEx.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
- aRet = aBmpEx;
- }
-
- return aRet;
-}
-*/
+// eof
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 4c9a188a8259..94964fbb16ac 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -373,7 +373,7 @@ void SvxHFPage::Reset( const SfxItemSet& rSet )
const SfxPoolItem* pExt1 = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
const SfxPoolItem* pExt2 = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
- if ( pExt1 && pExt1->ISA(SfxBoolItem) && pExt2 && pExt2->ISA(SfxBoolItem) )
+ if ( pExt1 && dynamic_cast< const SfxBoolItem* >(pExt1) && pExt2 && dynamic_cast< const SfxBoolItem* >(pExt2) )
nDefaultDist = DEF_DIST_CALC;
SetMetricValue( aDistEdit, nDefaultDist, SFX_MAPUNIT_100TH_MM );
@@ -860,7 +860,7 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
- if ( pItem && pItem->ISA(SfxBoolItem) )
+ if ( pItem && dynamic_cast< const SfxBoolItem* >(pItem) )
{
aBspWin.SetTable( sal_True );
aBspWin.SetHorz( ( (SfxBoolItem*)pItem )->GetValue() );
@@ -868,7 +868,7 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet )
pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
- if ( pItem && pItem->ISA(SfxBoolItem) )
+ if ( pItem && dynamic_cast< const SfxBoolItem* >(pItem) )
{
aBspWin.SetTable( sal_True );
aBspWin.SetVert( ( (SfxBoolItem*)pItem )->GetValue() );
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index fb2de2cf881f..eafa9aa37a13 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -133,7 +133,7 @@ void SvxIMapDlgItem::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/,
{
if ( ( nSID == SID_IMAP_EXEC ) && pItem )
{
- const SfxBoolItem* pStateItem = PTR_CAST( SfxBoolItem, pItem );
+ const SfxBoolItem* pStateItem = dynamic_cast< const SfxBoolItem* >( pItem );
DBG_ASSERT( pStateItem || pItem == 0, "SfxBoolItem erwartet");
@@ -514,7 +514,7 @@ IMPL_LINK( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx )
case( TBI_RECT ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- pIMapWnd->SetObjKind( OBJ_RECT );
+ pIMapWnd->setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_RECT));
if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
{
pIMapWnd->CreateDefaultObject();
@@ -526,7 +526,7 @@ IMPL_LINK( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx )
case( TBI_CIRCLE ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- pIMapWnd->SetObjKind( OBJ_CIRC );
+ pIMapWnd->setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_CIRC));
if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
{
pIMapWnd->CreateDefaultObject();
@@ -538,7 +538,7 @@ IMPL_LINK( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx )
case( TBI_POLY ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- pIMapWnd->SetObjKind( OBJ_POLY );
+ pIMapWnd->setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_POLY));
if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
{
pIMapWnd->CreateDefaultObject();
@@ -550,7 +550,14 @@ IMPL_LINK( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx )
case( TBI_FREEPOLY ):
{
pTbx->CheckItem( nNewItemId, sal_True );
- pIMapWnd->SetObjKind( OBJ_FREEFILL );
+
+ SdrObjectCreationInfo aSdrObjectCreationInfo(OBJ_POLY);
+
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_ClosedBezier);
+ aSdrObjectCreationInfo.setFreehandMode(true);
+
+ pIMapWnd->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
+
if( pTbx->IsKeyEvent() && ((pTbx->GetKeyModifier() & KEY_MOD1) != 0) )
{
pIMapWnd->CreateDefaultObject();
@@ -972,8 +979,8 @@ IMPL_LINK( SvxIMapDlg, StateHdl, IMapWindow*, pWnd )
const SdrObject* pObj = pWnd->GetSelectedSdrObject();
const SdrModel* pModel = pWnd->GetSdrModel();
const SdrView* pView = pWnd->GetSdrView();
- const sal_Bool bPolyEdit = ( pObj != NULL ) && pObj->ISA( SdrPathObj );
- const sal_Bool bDrawEnabled = !( bPolyEdit && aTbxIMapDlg1.IsItemChecked( TBI_POLYEDIT ) );
+ const bool bPolyEdit = pObj && dynamic_cast< const SdrPathObj* >(pObj);
+ const bool bDrawEnabled = !( bPolyEdit && aTbxIMapDlg1.IsItemChecked( TBI_POLYEDIT ) );
aTbxIMapDlg1.EnableItem( TBI_APPLY, pOwnData->bExecState && pWnd->IsChanged() );
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 68f9e40324a2..07440663dd53 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -32,7 +32,6 @@
#include <svtools/imapcirc.hxx>
#include <svtools/imappoly.hxx>
#include <svl/urlbmk.hxx>
-
#include <svx/xoutbmp.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
@@ -49,13 +48,13 @@
#include <svx/xfillit.hxx>
#include <svx/xlineit.hxx>
#include <sfx2/evntconf.hxx>
-
#include <sot/formats.hxx>
-
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
using ::com::sun::star::frame::XFrame;
using ::com::sun::star::uno::Reference;
@@ -126,10 +125,11 @@ void IMapWindow::ReplaceImageMap( const ImageMap& rImageMap, sal_Bool /*bScaleTo
pPage = GetSdrModel()->GetPage(0L);
}
- if(pPage)
+ if(pPage && pPage->GetObjCount())
{
// clear all draw objects
- pPage->Clear();
+ pPage->ClearSdrObjList();
+ pPage->getSdrModelFromSdrObjList().SetChanged();
}
if(GetSdrView())
@@ -147,7 +147,7 @@ void IMapWindow::ReplaceImageMap( const ImageMap& rImageMap, sal_Bool /*bScaleTo
if ( pNewObj )
{
- pPage->InsertObject( pNewObj );
+ pPage->InsertObjectToSdrObjList(*pNewObj);
}
}
}
@@ -241,6 +241,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
Rectangle aClipRect( aPoint, GetGraphicSize() );
SdrObject* pSdrObj = NULL;
IMapObjectPtr pCloneIMapObj;
+ OSL_ENSURE(GetSdrModel(), "IMapWindow without SdrModel (!)");
switch( pIMapObj->GetType() )
{
@@ -252,7 +253,11 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// auf Zeichenflaeche clippen
aDrawRect.Intersection( aClipRect );
- pSdrObj = (SdrObject*) new SdrRectObj( aDrawRect );
+ pSdrObj = new SdrRectObj(
+ *GetSdrModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aDrawRect.getWidth(), aDrawRect.getHeight(),
+ aDrawRect.Left(), aDrawRect.Top()));
pCloneIMapObj.reset((IMapObject*) new IMapRectangleObject( *pIMapRectObj ));
}
break;
@@ -268,7 +273,10 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// auf Zeichenflaeche begrenzen
aCircle.Intersection( aClipRect );
- pSdrObj = (SdrObject*) new SdrCircObj( OBJ_CIRC, aCircle, 0, 36000 );
+ pSdrObj = new SdrCircObj(
+ *GetSdrModel(),
+ CircleType_Circle,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aCircle.getWidth(), aCircle.getHeight(), aCircle.Left(), aCircle.Top()));
pCloneIMapObj.reset((IMapObject*) new IMapCircleObject( *pIMapCircleObj ));
}
break;
@@ -286,7 +294,10 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// auf Zeichenflaeche clippen
aDrawRect.Intersection( aClipRect );
- pSdrObj = (SdrObject*) new SdrCircObj( OBJ_CIRC, aDrawRect, 0, 36000 );
+ pSdrObj = new SdrCircObj(
+ *GetSdrModel(),
+ CircleType_Circle,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(aDrawRect.getWidth(), aDrawRect.getHeight(), aDrawRect.Left(), aDrawRect.Top()));
}
else
{
@@ -298,7 +309,9 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
basegfx::B2DPolygon aPolygon;
aPolygon.append(aDrawPoly.getB2DPolygon());
- pSdrObj = (SdrObject*)new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aPolygon));
+ pSdrObj = new SdrPathObj(
+ *GetSdrModel(),
+ basegfx::B2DPolyPolygon(aPolygon));
}
pCloneIMapObj.reset((IMapObject*) new IMapPolygonObject( *pIMapPolyObj ));
@@ -311,7 +324,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
if ( pSdrObj )
{
- SfxItemSet aSet( pModel->GetItemPool() );
+ SfxItemSet aSet( pSdrObj->GetObjectItemPool() );
aSet.Put( XFillStyleItem( XFILL_SOLID ) );
aSet.Put( XFillColorItem( String(), TRANSCOL ) );
@@ -331,7 +344,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
pSdrObj->SetMergedItemSetAndBroadcast(aSet);
pSdrObj->InsertUserData( new IMapUserData( pCloneIMapObj ) );
- pSdrObj->SetUserCall( GetSdrUserCall() );
+ ConnectToSdrObject(pSdrObj);
}
return pSdrObj;
@@ -352,7 +365,7 @@ void IMapWindow::InitSdrModel()
aSet.Put( XFillColorItem( String(), TRANSCOL ) );
aSet.Put( XFillTransparenceItem( 50 ) );
pView->SetAttributes( aSet );
- pView->SetFrameDragSingles( sal_True );
+ pView->SetFrameHandles(true);
}
/*************************************************************************
@@ -368,8 +381,8 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj )
case( OBJ_RECT ):
{
SdrRectObj* pRectObj = (SdrRectObj*) &rObj;
- IMapRectangleObject* pObj = new IMapRectangleObject( pRectObj->GetLogicRect(),
- String(), String(), String(), String(), String(), sal_True, sal_False );
+ IMapRectangleObject* pObj = new IMapRectangleObject( sdr::legacy::GetLogicRect(*pRectObj),
+ String(), String(), String(), String(), String(), true, false);
pRectObj->InsertUserData( new IMapUserData( IMapObjectPtr(pObj) ) );
}
@@ -378,9 +391,9 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj )
case( OBJ_CIRC ):
{
SdrCircObj* pCircObj = (SdrCircObj*) &rObj;
- SdrPathObj* pPathObj = (SdrPathObj*) pCircObj->ConvertToPolyObj( sal_False, sal_False );
- Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L));
- delete pPathObj;
+ SdrPathObj* pPathObj = (SdrPathObj*) pCircObj->ConvertToPolyObj(false, false);
+ Polygon aPoly(pPathObj->getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(0L));
+ deleteSdrObjectSafeAndClearPointer(pPathObj);
IMapPolygonObject* pObj = new IMapPolygonObject( Polygon(aPoly), String(), String(), String(), String(), String(), sal_True, sal_False );
pObj->SetExtraEllipse( aPoly.GetBoundRect() );
@@ -389,16 +402,13 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj )
break;
case( OBJ_POLY ):
- case( OBJ_FREEFILL ):
- case( OBJ_PATHPOLY ):
- case( OBJ_PATHFILL ):
{
SdrPathObj* pPathObj = (SdrPathObj*) &rObj;
- const basegfx::B2DPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
+ const basegfx::B2DPolyPolygon aXPolyPoly = pPathObj->getB2DPolyPolygonInObjectCoordinates();
- if ( rXPolyPoly.count() )
+ if ( aXPolyPoly.count() )
{
- Polygon aPoly(rXPolyPoly.getB2DPolygon(0L));
+ Polygon aPoly(aXPolyPoly.getB2DPolygon(0L));
IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, String(), String(), String(), String(), String(), sal_True, sal_False );
pPathObj->InsertUserData( new IMapUserData( IMapObjectPtr(pObj) ) );
}
@@ -442,38 +452,35 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj )
{
case( OBJ_RECT ):
{
- pUserData->ReplaceObject( IMapObjectPtr(new IMapRectangleObject( ( (const SdrRectObj&) rObj ).GetLogicRect(),
- aURL, aAltText, aDesc, aTarget, String(), bActive, sal_False ) ) );
+ pUserData->ReplaceObject( IMapObjectPtr(new IMapRectangleObject( sdr::legacy::GetLogicRect( (const SdrRectObj&) rObj ),
+ aURL, aAltText, aDesc, aTarget, String(), bActive, false) ) );
}
break;
case( OBJ_CIRC ):
{
const SdrCircObj& rCircObj = (const SdrCircObj&) rObj;
- SdrPathObj* pPathObj = (SdrPathObj*) rCircObj.ConvertToPolyObj( sal_False, sal_False );
- Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0L));
+ SdrPathObj* pPathObj = (SdrPathObj*) rCircObj.ConvertToPolyObj(false, false);
+ Polygon aPoly(pPathObj->getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(0L));
- IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, String(), bActive, sal_False );
+ IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, String(), bActive, false);
pObj->SetExtraEllipse( aPoly.GetBoundRect() );
// wurde von uns nur temporaer angelegt
- delete pPathObj;
+ deleteSdrObjectSafeAndClearPointer(pPathObj);
pUserData->ReplaceObject( IMapObjectPtr(pObj) );
}
break;
case( OBJ_POLY ):
- case( OBJ_FREEFILL ):
- case( OBJ_PATHPOLY ):
- case( OBJ_PATHFILL ):
{
const SdrPathObj& rPathObj = (const SdrPathObj&) rObj;
- const basegfx::B2DPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly();
+ const basegfx::B2DPolyPolygon aXPolyPoly = rPathObj.getB2DPolyPolygonInObjectCoordinates();
- if ( rXPolyPoly.count() )
+ if ( aXPolyPoly.count() )
{
- Polygon aPoly(rPathObj.GetPathPoly().getB2DPolygon(0L));
- IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, String(), bActive, sal_False );
+ Polygon aPoly(aXPolyPoly.getB2DPolygon(0L));
+ IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, aAltText, aDesc, aTarget, String(), bActive, false);
pUserData->ReplaceObject( IMapObjectPtr(pObj) );
}
}
@@ -503,9 +510,12 @@ void IMapWindow::MouseButtonUp(const MouseEvent& rMEvt)
|*
\************************************************************************/
-void IMapWindow::MarkListHasChanged()
+void IMapWindow::selectionChange()
{
- GraphCtrl::MarkListHasChanged();
+ // call parent
+ GraphCtrl::selectionChange();
+
+ // local reactions
UpdateInfo( sal_False );
}
@@ -607,15 +617,13 @@ void IMapWindow::Command(const CommandEvent& rCEvt)
if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
{
PopupMenu aMenu( SVX_RES( RID_SVXMN_IMAP ) );
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- sal_uIntPtr nMarked = rMarkList.GetMarkCount();
aMenu.EnableItem( MN_URL, sal_False );
aMenu.EnableItem( MN_ACTIVATE, sal_False );
aMenu.EnableItem( MN_MACRO, sal_False );
- aMenu.EnableItem( MN_MARK_ALL, pModel->GetPage( 0 )->GetObjCount() != pView->GetMarkedObjectCount() );
+ aMenu.EnableItem( MN_MARK_ALL, pModel->GetPage( 0 )->GetObjCount() != pView->getSelectedSdrObjectCount() );
- if ( !nMarked )
+ if ( !pView->areSdrObjectsSelected() )
{
aMenu.EnableItem( MN_POSITION, sal_False );
aMenu.EnableItem( MN_FRAME_TO_TOP, sal_False );
@@ -626,7 +634,9 @@ void IMapWindow::Command(const CommandEvent& rCEvt)
}
else
{
- if ( nMarked == 1 )
+ const SdrObject* pSingleSelected = pView->getSelectedIfSingle();
+
+ if(pSingleSelected)
{
SdrObject* pSdrObj = GetSelectedSdrObject();
@@ -686,7 +696,7 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
pIMapObj->SetAltText( aBookMark.GetDescription() );
pModel->SetChanged( sal_True );
pView->UnmarkAll();
- pView->MarkObj( pSdrObj, pView->GetSdrPageView() );
+ pView->MarkObj( *pSdrObj );
UpdateInfo( sal_True );
nRet = rEvt.mnAction;
}
@@ -704,12 +714,13 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
void IMapWindow::RequestHelp( const HelpEvent& rHEvt )
{
SdrObject* pSdrObj = NULL;
- SdrPageView* pPageView = NULL;
- Point aPos = PixelToLogic( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() )
{
- if ( pView->PickObj( aPos, pView->getHitTolLog(), pSdrObj, pPageView ) )
+ const Point aOutputPixel(ScreenToOutputPixel(rHEvt.GetMousePosPixel()));
+ const basegfx::B2DPoint aPos(GetInverseViewTransformation() * basegfx::B2DPoint(aOutputPixel.X(), aOutputPixel.Y()));
+
+ if ( pView->PickObj( aPos, pView->getHitTolLog(), pSdrObj ) )
{
const IMapObject* pIMapObj = GetIMapObj( pSdrObj );
String aStr;
@@ -947,54 +958,61 @@ IMPL_LINK( IMapWindow, MenuSelectHdl, Menu*, pMenu )
void IMapWindow::CreateDefaultObject()
{
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
+ if(pView->GetSdrPageView())
{
// calc position and size
- Point aPagePos(0, 0); // = pPageView->GetOffset();
- Size aPageSize = pPageView->GetPage()->GetSize();
- sal_uInt32 nDefaultObjectSizeWidth = aPageSize.Width() / 4;
- sal_uInt32 nDefaultObjectSizeHeight = aPageSize.Height() / 4;
- aPagePos.X() += (aPageSize.Width() / 2) - (nDefaultObjectSizeWidth / 2);
- aPagePos.Y() += (aPageSize.Height() / 2) - (nDefaultObjectSizeHeight / 2);
- Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
-
- SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), 0L, pModel);
- pObj->SetLogicRect(aNewObjectRectangle);
-
- switch( pObj->GetObjIdentifier() )
+ const basegfx::B2DVector& rPageScale = pView->GetSdrPageView()->getSdrPageFromSdrPageView().GetPageScale();
+ const basegfx::B2DVector aDefaultObjectScale(rPageScale * 0.25);
+ const basegfx::B2DPoint aPagePos((rPageScale - aDefaultObjectScale) * 0.5);
+ const basegfx::B2DRange aNewObjectRange(aPagePos, aPagePos + aDefaultObjectScale);
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ pView->getSdrModelFromSdrView(),
+ pView->getSdrObjectCreationInfo());
+
+ sdr::legacy::SetLogicRange(*pObj, aNewObjectRange);
+
+ if(OBJ_POLY == pView->getSdrObjectCreationInfo().getIdent())
{
- case OBJ_POLY:
- case OBJ_PATHPOLY:
- {
- basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomLeft().X(), aNewObjectRectangle.BottomLeft().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopLeft().X(), aNewObjectRectangle.TopLeft().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.TopCenter().X(), aNewObjectRectangle.TopCenter().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.Center().X(), aNewObjectRectangle.Center().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.RightCenter().X(), aNewObjectRectangle.RightCenter().Y()));
- aInnerPoly.append(basegfx::B2DPoint(aNewObjectRectangle.BottomRight().X(), aNewObjectRectangle.BottomRight().Y()));
- aInnerPoly.setClosed(true);
- ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
- break;
- }
- case OBJ_FREEFILL:
- case OBJ_PATHFILL:
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
{
- sal_Int32 nWdt(aNewObjectRectangle.GetWidth() / 2);
- sal_Int32 nHgt(aNewObjectRectangle.GetHeight() / 2);
- basegfx::B2DPolygon aInnerPoly(XPolygon(aNewObjectRectangle.Center(), nWdt, nHgt).getB2DPolygon());
- ((SdrPathObj*)pObj)->SetPathPoly(basegfx::B2DPolyPolygon(aInnerPoly));
- break;
+ switch(pSdrPathObj->getSdrPathObjType())
+ {
+ case PathType_ClosedPolygon:
+ {
+ basegfx::B2DPolygon aInnerPoly;
+
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRange.getMinX(), aNewObjectRange.getMaxY()));
+ aInnerPoly.append(aNewObjectRange.getMinimum());
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRange.getCenterX(), aNewObjectRange.getMinY()));
+ aInnerPoly.append(aNewObjectRange.getCenter());
+ aInnerPoly.append(basegfx::B2DPoint(aNewObjectRange.getMaxX(), aNewObjectRange.getCenterY()));
+ aInnerPoly.append(aNewObjectRange.getMaximum());
+ aInnerPoly.setClosed(true);
+
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aInnerPoly));
+ break;
+ }
+ case PathType_ClosedBezier:
+ {
+ const basegfx::B2DPolygon aInnerPoly(
+ basegfx::tools::createPolygonFromEllipse(
+ aNewObjectRange.getCenter(),
+ aNewObjectRange.getWidth() * 0.5,
+ aNewObjectRange.getHeight() * 0.5));
+
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aInnerPoly));
+ break;
+ }
+ }
}
-
}
- pView->InsertObjectAtView(pObj, *pPageView);
+ pView->InsertObjectAtView(*pObj);
SdrObjCreated( *pObj );
SetCurrentObjState( true );
- pView->MarkObj( pObj, pPageView );
+ pView->MarkObj( *pObj );
}
}
@@ -1012,7 +1030,7 @@ void IMapWindow::KeyInput( const KeyEvent& rKEvt )
pView->BrkAction();
return;
}
- else if ( pView->AreObjectsMarked() )
+ else if ( pView->areSdrObjectsSelected() )
{
const SdrHdlList& rHdlList = pView->GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
@@ -1044,7 +1062,7 @@ void IMapWindow::SelectFirstObject()
{
GrabFocus();
pView->UnmarkAllObj();
- pView->MarkNextObj(sal_True);
+ pView->MarkNextObj(true);
}
}
@@ -1052,8 +1070,8 @@ void IMapWindow::StartPolyEdit()
{
GrabFocus();
- if( !pView->AreObjectsMarked() )
- pView->MarkNextObj(sal_True);
+ if( !pView->areSdrObjectsSelected() )
+ pView->MarkNextObj(true);
const SdrHdlList& rHdlList = pView->GetHdlList();
SdrHdl* pHdl = rHdlList.GetFocusHdl();
diff --git a/svx/source/dialog/imapwnd.hxx b/svx/source/dialog/imapwnd.hxx
index 28bd1dd34df3..55b704651b18 100644
--- a/svx/source/dialog/imapwnd.hxx
+++ b/svx/source/dialog/imapwnd.hxx
@@ -86,15 +86,15 @@ class IMapUserData : public SdrObjUserData
public:
IMapUserData() :
- SdrObjUserData ( IMapInventor, SVD_IMAP_USERDATA, 0 ),
+ SdrObjUserData ( IMapInventor, SVD_IMAP_USERDATA ),
mpObj ( ) {}
IMapUserData( const IMapObjectPtr& rIMapObj ) :
- SdrObjUserData ( IMapInventor, SVD_IMAP_USERDATA, 0 ),
+ SdrObjUserData ( IMapInventor, SVD_IMAP_USERDATA ),
mpObj ( rIMapObj ) {}
IMapUserData( const IMapUserData& rIMapUserData ) :
- SdrObjUserData ( IMapInventor, SVD_IMAP_USERDATA, 0 ),
+ SdrObjUserData ( IMapInventor, SVD_IMAP_USERDATA ),
mpObj ( rIMapUserData.mpObj ) {}
~IMapUserData() { }
@@ -169,7 +169,7 @@ protected:
virtual void RequestHelp( const HelpEvent& rHEvt );
virtual void SdrObjCreated( const SdrObject& rObj );
virtual void SdrObjChanged( const SdrObject& rObj );
- virtual void MarkListHasChanged();
+ virtual void selectionChange();
virtual void InitSdrModel();
// DropTargetHelper
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx
index 004f608961d4..0e3bbcb2d71f 100644
--- a/svx/source/dialog/measctrl.cxx
+++ b/svx/source/dialog/measctrl.cxx
@@ -65,9 +65,9 @@ SvxXMeasurePreview::SvxXMeasurePreview
Point aPt1 = Point( aSize.Width() / 5, (long) ( aSize.Height() / 2 ) );
Point aPt2 = Point( aSize.Width() * 4 / 5, (long) ( aSize.Height() / 2 ) );
- pMeasureObj = new SdrMeasureObj( aPt1, aPt2 );
pModel = new SdrModel();
- pMeasureObj->SetModel( pModel );
+ pMeasureObj = new SdrMeasureObj( *pModel, aPt1, aPt2 );
+ // pMeasureObj->SetModel( pModel );
//pMeasureObj->SetItemSetAndBroadcast(rInAttrs);
pMeasureObj->SetMergedItemSetAndBroadcast(rInAttrs);
@@ -91,7 +91,7 @@ SvxXMeasurePreview::~SvxXMeasurePreview()
// a StyleSheet of the model which was set. Thus, if You want to keep the obnject,
// set the modfel to 0L, if object is not needed (seems to be the case here),
// delete it.
- delete pMeasureObj;
+ deleteSdrObjectSafeAndClearPointer(pMeasureObj);
delete pModel;
}
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 15bbcdaa36d9..ffc4ab080d46 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -34,10 +34,10 @@
#include <svx/svxids.hrc>
#include <svx/dialmgr.hxx>
-#include "svx/optgrid.hxx"
+#include <svx/optgrid.hxx>
#include <svx/dialogs.hrc>
-#include "optgrid.hrc"
-#include "svx/dlgutil.hxx"
+#include <optgrid.hrc>
+#include <svx/dlgutil.hxx>
/* -----------------18.08.98 17:41-------------------
* local functions
@@ -63,16 +63,16 @@ void lcl_SetMinMax(MetricField& rField, long nFirst, long nLast, long nMin, l
--------------------------------------------------------------------*/
SvxOptionsGrid::SvxOptionsGrid() :
- nFldDrawX ( 100 ),
- nFldDivisionX ( 0 ),
- nFldDrawY ( 100 ),
- nFldDivisionY ( 0 ),
- nFldSnapX ( 100 ),
- nFldSnapY ( 100 ),
- bUseGridsnap ( 0 ),
- bSynchronize ( 1 ),
- bGridVisible ( 0 ),
- bEqualGrid ( 1 )
+ mnFldDrawX ( 100 ),
+ mnFldDivisionX ( 0 ),
+ mnFldDrawY ( 100 ),
+ mnFldDivisionY ( 0 ),
+ mnFldSnapX ( 100 ),
+ mnFldSnapY ( 100 ),
+ mbUseGridsnap ( 0 ),
+ mbSynchronize ( 1 ),
+ mbGridVisible ( 0 ),
+ mbEqualGrid ( 1 )
{
}
@@ -92,16 +92,16 @@ SvxGridItem::SvxGridItem( const SvxGridItem& rItem )
: SvxOptionsGrid()
, SfxPoolItem(rItem)
{
- bUseGridsnap = rItem.bUseGridsnap ;
- bSynchronize = rItem.bSynchronize ;
- bGridVisible = rItem.bGridVisible ;
- bEqualGrid = rItem.bEqualGrid ;
- nFldDrawX = rItem.nFldDrawX ;
- nFldDivisionX= rItem.nFldDivisionX;
- nFldDrawY = rItem.nFldDrawY ;
- nFldDivisionY= rItem.nFldDivisionY;
- nFldSnapX = rItem.nFldSnapX ;
- nFldSnapY = rItem.nFldSnapY ;
+ mbUseGridsnap = rItem.mbUseGridsnap ;
+ mbSynchronize = rItem.mbSynchronize ;
+ mbGridVisible = rItem.mbGridVisible ;
+ mbEqualGrid = rItem.mbEqualGrid ;
+ mnFldDrawX = rItem.mnFldDrawX ;
+ mnFldDivisionX= rItem.mnFldDivisionX;
+ mnFldDrawY = rItem.mnFldDrawY ;
+ mnFldDivisionY= rItem.mnFldDivisionY;
+ mnFldSnapX = rItem.mnFldSnapX ;
+ mnFldSnapY = rItem.mnFldSnapY ;
};
@@ -124,16 +124,16 @@ int SvxGridItem::operator==( const SfxPoolItem& rAttr ) const
const SvxGridItem& rItem = (const SvxGridItem&) rAttr;
- return ( bUseGridsnap == rItem.bUseGridsnap &&
- bSynchronize == rItem.bSynchronize &&
- bGridVisible == rItem.bGridVisible &&
- bEqualGrid == rItem.bEqualGrid &&
- nFldDrawX == rItem.nFldDrawX &&
- nFldDivisionX== rItem.nFldDivisionX&&
- nFldDrawY == rItem.nFldDrawY &&
- nFldDivisionY== rItem.nFldDivisionY&&
- nFldSnapX == rItem.nFldSnapX &&
- nFldSnapY == rItem.nFldSnapY );
+ return ( mbUseGridsnap == rItem.mbUseGridsnap &&
+ mbSynchronize == rItem.mbSynchronize &&
+ mbGridVisible == rItem.mbGridVisible &&
+ mbEqualGrid == rItem.mbEqualGrid &&
+ mnFldDrawX == rItem.mnFldDrawX &&
+ mnFldDivisionX== rItem.mnFldDivisionX&&
+ mnFldDrawY == rItem.mnFldDrawY &&
+ mnFldDivisionY== rItem.mnFldDivisionY&&
+ mnFldSnapX == rItem.mnFldSnapX &&
+ mnFldSnapY == rItem.mnFldSnapY );
}
/*--------------------------------------------------------------------
@@ -210,7 +210,7 @@ SvxGridTabPage::SvxGridTabPage( Window* pParent, const SfxItemSet& rCoreSet) :
aFtBezAngle ( this, SVX_RES( FT_BEZ_ANGLE ) ),
aMtrFldBezAngle ( this, SVX_RES( MTR_FLD_BEZ_ANGLE ) ),
- bAttrModified( sal_False )
+ mbAttrModified( false )
{
// diese Page braucht ExchangeSupport
SetExchangeSupport();
@@ -268,27 +268,27 @@ SfxTabPage* SvxGridTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet
sal_Bool SvxGridTabPage::FillItemSet( SfxItemSet& rCoreSet )
{
- if ( bAttrModified )
+ if ( mbAttrModified )
{
SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS );
- aGridItem.bUseGridsnap = aCbxUseGridsnap.IsChecked();
- aGridItem.bSynchronize = aCbxSynchronize.IsChecked();
- aGridItem.bGridVisible = aCbxGridVisible.IsChecked();
+ aGridItem.mbUseGridsnap = aCbxUseGridsnap.IsChecked();
+ aGridItem.mbSynchronize = aCbxSynchronize.IsChecked();
+ aGridItem.mbGridVisible = aCbxGridVisible.IsChecked();
SfxMapUnit eUnit =
rCoreSet.GetPool()->GetMetric( GetWhich( SID_ATTR_GRID_OPTIONS ) );
long nX =GetCoreValue( aMtrFldDrawX, eUnit );
long nY = GetCoreValue( aMtrFldDrawY, eUnit );
- aGridItem.nFldDrawX = (sal_uInt32) nX;
- aGridItem.nFldDrawY = (sal_uInt32) nY;
- aGridItem.nFldDivisionX = static_cast<long>(aNumFldDivisionX.GetValue()-1);
- aGridItem.nFldDivisionY = static_cast<long>(aNumFldDivisionY.GetValue()-1);
+ aGridItem.mnFldDrawX = (sal_uInt32) nX;
+ aGridItem.mnFldDrawY = (sal_uInt32) nY;
+ aGridItem.mnFldDivisionX = static_cast<long>(aNumFldDivisionX.GetValue() - 1);
+ aGridItem.mnFldDivisionY = static_cast<long>(aNumFldDivisionY.GetValue() - 1);
rCoreSet.Put( aGridItem );
}
- return bAttrModified;
+ return mbAttrModified;
}
//------------------------------------------------------------------------
@@ -301,21 +301,21 @@ void SvxGridTabPage::Reset( const SfxItemSet& rSet )
(const SfxPoolItem**)&pAttr ))
{
const SvxGridItem* pGridAttr = (SvxGridItem*)pAttr;
- aCbxUseGridsnap.Check( pGridAttr->bUseGridsnap == 1 );
- aCbxSynchronize.Check( pGridAttr->bSynchronize == 1 );
- aCbxGridVisible.Check( pGridAttr->bGridVisible == 1 );
+ aCbxUseGridsnap.Check( pGridAttr->mbUseGridsnap == 1 );
+ aCbxSynchronize.Check( pGridAttr->mbSynchronize == 1 );
+ aCbxGridVisible.Check( pGridAttr->mbGridVisible == 1 );
SfxMapUnit eUnit =
rSet.GetPool()->GetMetric( GetWhich( SID_ATTR_GRID_OPTIONS ) );
- SetMetricValue( aMtrFldDrawX , pGridAttr->nFldDrawX, eUnit );
- SetMetricValue( aMtrFldDrawY , pGridAttr->nFldDrawY, eUnit );
+ SetMetricValue( aMtrFldDrawX , pGridAttr->mnFldDrawX, eUnit );
+ SetMetricValue( aMtrFldDrawY , pGridAttr->mnFldDrawY, eUnit );
- aNumFldDivisionX.SetValue( pGridAttr->nFldDivisionX+1 );
- aNumFldDivisionY.SetValue( pGridAttr->nFldDivisionY+1 );
+ aNumFldDivisionX.SetValue( pGridAttr->mnFldDivisionX + 1);
+ aNumFldDivisionY.SetValue( pGridAttr->mnFldDivisionY + 1);
}
ChangeGridsnapHdl_Impl( &aCbxUseGridsnap );
- bAttrModified = sal_False;
+ mbAttrModified = false;
}
// -----------------------------------------------------------------------
@@ -327,7 +327,7 @@ void SvxGridTabPage::ActivatePage( const SfxItemSet& rSet )
(const SfxPoolItem**)&pAttr ))
{
const SvxGridItem* pGridAttr = (SvxGridItem*) pAttr;
- aCbxUseGridsnap.Check( pGridAttr->bUseGridsnap == 1 );
+ aCbxUseGridsnap.Check( pGridAttr->mbUseGridsnap == 1 );
ChangeGridsnapHdl_Impl( &aCbxUseGridsnap );
}
@@ -375,7 +375,7 @@ int SvxGridTabPage::DeactivatePage( SfxItemSet* _pSet )
//------------------------------------------------------------------------
IMPL_LINK( SvxGridTabPage, ChangeDrawHdl_Impl, MetricField *, pField )
{
- bAttrModified = sal_True;
+ mbAttrModified = true;
if( aCbxSynchronize.IsChecked() )
{
if(pField == &aMtrFldDrawX)
@@ -401,7 +401,7 @@ IMPL_LINK( SvxGridTabPage, ClickRotateHdl_Impl, void *, EMPTYARG )
IMPL_LINK( SvxGridTabPage, ChangeDivisionHdl_Impl, NumericField *, pField )
{
- bAttrModified = sal_True;
+ mbAttrModified = true;
if( aCbxSynchronize.IsChecked() )
{
if(&aNumFldDivisionX == pField)
@@ -415,7 +415,7 @@ IMPL_LINK( SvxGridTabPage, ChangeDivisionHdl_Impl, NumericField *, pField )
IMPL_LINK( SvxGridTabPage, ChangeGridsnapHdl_Impl, void *, EMPTYARG )
{
- bAttrModified = sal_True;
+ mbAttrModified = true;
return 0;
}
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index 0917aa02adf3..9a6be7a907a9 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -41,7 +41,7 @@ struct PageWindow_Impl
{
SvxBoxItem* pBorder;
Bitmap aBitmap;
- FASTBOOL bBitmap;
+ bool bBitmap;
sal_Bool bResetBackground;
sal_Bool bFrameDirection;
sal_Int32 nFrameDirection;
diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx
index 49a9fc02390b..b624074eb869 100644
--- a/svx/source/dialog/rlrcitem.cxx
+++ b/svx/source/dialog/rlrcitem.cxx
@@ -56,7 +56,7 @@ SvxRulerItem::SvxRulerItem(sal_uInt16 _nId, SvxRuler &rRul, SfxBindings &rBindin
void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState)
{
- // SFX_ITEM_DONTCARE => pState == -1 => PTR_CAST buff
+ // SFX_ITEM_DONTCARE => pState == -1 => RTTI buff
if ( eState != SFX_ITEM_AVAILABLE )
pState = 0;
@@ -65,37 +65,37 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState,
// Linker / rechter Seitenrand
case SID_RULER_LR_MIN_MAX:
{
- const SfxRectangleItem *pItem = PTR_CAST(SfxRectangleItem, pState);
+ const SfxRectangleItem *pItem = dynamic_cast< const SfxRectangleItem* >( pState);
rRuler.UpdateFrameMinMax(pItem);
break;
}
case SID_ATTR_LONG_LRSPACE:
{
- const SvxLongLRSpaceItem *pItem = PTR_CAST(SvxLongLRSpaceItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxLRSpaceItem erwartet");
+ const SvxLongLRSpaceItem *pItem = dynamic_cast< const SvxLongLRSpaceItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxLRSpaceItem erwartet");
rRuler.UpdateFrame(pItem);
break;
}
case SID_ATTR_LONG_ULSPACE:
{
- const SvxLongULSpaceItem *pItem = PTR_CAST(SvxLongULSpaceItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxULSpaceItem erwartet");
+ const SvxLongULSpaceItem *pItem = dynamic_cast< const SvxLongULSpaceItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxULSpaceItem erwartet");
rRuler.UpdateFrame(pItem);
break;
}
case SID_ATTR_TABSTOP_VERTICAL:
case SID_ATTR_TABSTOP:
{
- const SvxTabStopItem *pItem = PTR_CAST(SvxTabStopItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxTabStopItem erwartet");
+ const SvxTabStopItem *pItem = dynamic_cast< const SvxTabStopItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxTabStopItem erwartet");
rRuler.Update(pItem);
break;
}
case SID_ATTR_PARA_LRSPACE_VERTICAL:
case SID_ATTR_PARA_LRSPACE:
{
- const SvxLRSpaceItem *pItem = PTR_CAST(SvxLRSpaceItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxLRSpaceItem erwartet");
+ const SvxLRSpaceItem *pItem = dynamic_cast< const SvxLRSpaceItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxLRSpaceItem erwartet");
rRuler.UpdatePara(pItem);
break;
}
@@ -104,8 +104,8 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState,
case SID_RULER_ROWS:
case SID_RULER_ROWS_VERTICAL:
{
- const SvxColumnItem *pItem = PTR_CAST(SvxColumnItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxColumnItem erwartet");
+ const SvxColumnItem *pItem = dynamic_cast< const SvxColumnItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxColumnItem erwartet");
#ifdef DBG_UTIL
if(pItem)
{
@@ -123,36 +123,36 @@ void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState,
}
case SID_RULER_PAGE_POS:
{ // Position Seite, Seitenbreite
- const SvxPagePosSizeItem *pItem = PTR_CAST(SvxPagePosSizeItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxPagePosSizeItem erwartet");
+ const SvxPagePosSizeItem *pItem = dynamic_cast< const SvxPagePosSizeItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxPagePosSizeItem erwartet");
rRuler.Update(pItem);
break;
}
case SID_RULER_OBJECT:
{ // Object-Selektion
- const SvxObjectItem *pItem = PTR_CAST(SvxObjectItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxObjectItem erwartet");
+ const SvxObjectItem *pItem = dynamic_cast< const SvxObjectItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxObjectItem erwartet");
rRuler.Update(pItem);
break;
}
case SID_RULER_PROTECT:
{
- const SvxProtectItem *pItem = PTR_CAST(SvxProtectItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxProtectItem erwartet");
+ const SvxProtectItem *pItem = dynamic_cast< const SvxProtectItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxProtectItem erwartet");
rRuler.Update(pItem);
break;
}
case SID_RULER_BORDER_DISTANCE:
{
- const SvxLRSpaceItem *pItem = PTR_CAST(SvxLRSpaceItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SvxLRSpaceItem erwartet");
+ const SvxLRSpaceItem *pItem = dynamic_cast< const SvxLRSpaceItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SvxLRSpaceItem erwartet");
rRuler.UpdateParaBorder(pItem);
}
break;
case SID_RULER_TEXT_RIGHT_TO_LEFT :
{
- const SfxBoolItem *pItem = PTR_CAST(SfxBoolItem, pState);
- DBG_ASSERT(pState? 0 != pItem: sal_True, "SfxBoolItem erwartet");
+ const SfxBoolItem *pItem = dynamic_cast< const SfxBoolItem* >( pState);
+ OSL_ENSURE(pState ? 0 != pItem : true, "SfxBoolItem erwartet");
rRuler.UpdateTextRTL(pItem);
}
break;
diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx
index 7abf303f376b..db5d2bd131be 100644
--- a/svx/source/dialog/rulritem.cxx
+++ b/svx/source/dialog/rulritem.cxx
@@ -33,13 +33,7 @@
//------------------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SvxPagePosSizeItem, SfxPoolItem);
-TYPEINIT1_AUTOFACTORY(SvxLongLRSpaceItem, SfxPoolItem);
-TYPEINIT1_AUTOFACTORY(SvxLongULSpaceItem, SfxPoolItem);
-TYPEINIT1(SvxColumnItem, SfxPoolItem);
-TYPEINIT1(SvxObjectItem, SfxPoolItem);
-
-//------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxLongLRSpaceItem)
int SvxLongLRSpaceItem::operator==( const SfxPoolItem& rCmp) const
{
@@ -170,6 +164,8 @@ SvxLongLRSpaceItem::SvxLongLRSpaceItem(const SvxLongLRSpaceItem &rCpy)
//------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxLongULSpaceItem)
+
int SvxLongULSpaceItem::operator==( const SfxPoolItem& rCmp) const
{
return SfxPoolItem::operator==(rCmp) &&
@@ -295,6 +291,8 @@ SvxLongULSpaceItem::SvxLongULSpaceItem() :
//------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxPagePosSizeItem)
+
int SvxPagePosSizeItem::operator==( const SfxPoolItem& rCmp) const
{
return SfxPoolItem::operator==(rCmp) &&
@@ -425,6 +423,7 @@ SvxPagePosSizeItem::SvxPagePosSizeItem()
{}
//------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxColumnItem)
void SvxColumnItem::DeleteAndDestroyColumns()
{
@@ -673,6 +672,8 @@ SfxPoolItem* SvxObjectItem::Clone(SfxItemPool *) const
//------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxObjectItem)
+
SvxObjectItem::SvxObjectItem( long nSX, long nEX,
long nSY, long nEY, sal_Bool limits ) :
diff --git a/svx/source/dialog/srchctrl.cxx b/svx/source/dialog/srchctrl.cxx
index 0f0ccbed7e5f..9a451ff9b200 100644
--- a/svx/source/dialog/srchctrl.cxx
+++ b/svx/source/dialog/srchctrl.cxx
@@ -69,14 +69,16 @@ void SvxSearchController::StateChanged( sal_uInt16 nSID, SfxItemState eState,
}
else if ( SID_SEARCH_OPTIONS == nSID )
{
- DBG_ASSERT( pState->ISA(SfxUInt16Item), "wrong item type" );
- sal_uInt16 nFlags = (sal_uInt16)( (SfxUInt16Item*)pState )->GetValue();
+ const SfxUInt16Item* pSfxUInt16Item = dynamic_cast< const SfxUInt16Item* >(pState);
+ DBG_ASSERT( pSfxUInt16Item, "wrong item type" );
+ sal_uInt16 nFlags = (sal_uInt16 )pSfxUInt16Item->GetValue();
rSrchDlg.EnableControls_Impl( nFlags );
}
else if ( SID_SEARCH_ITEM == nSID )
{
- DBG_ASSERT( pState->ISA(SvxSearchItem), "wrong item type" );
- rSrchDlg.SetItem_Impl( (const SvxSearchItem*)pState );
+ const SvxSearchItem* pSvxSearchItem = dynamic_cast< const SvxSearchItem* >(pState);
+ DBG_ASSERT( pSvxSearchItem, "wrong item type" );
+ rSrchDlg.SetItem_Impl( pSvxSearchItem );
}
}
else if ( SID_SEARCH_OPTIONS == nSID || SID_SEARCH_ITEM == nSID )
diff --git a/svx/source/dialog/svxgrahicitem.cxx b/svx/source/dialog/svxgrahicitem.cxx
index 0e7293c48714..614bbd47607b 100644
--- a/svx/source/dialog/svxgrahicitem.cxx
+++ b/svx/source/dialog/svxgrahicitem.cxx
@@ -23,8 +23,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "svx/svxgrahicitem.hxx"
-TYPEINIT1(SvxGraphicItem,SfxPoolItem);
+
+#include <svx/svxgrahicitem.hxx>
+
SvxGraphicItem::SvxGraphicItem( sal_uInt16 _nWhich, const Graphic& rGraphic )
: SfxPoolItem( _nWhich ), aGraphic( rGraphic )
{
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 21eff5979488..9afd236bb54c 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -3676,13 +3676,17 @@ void __EXPORT SvxRuler::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
// Aktualisierung anstossen
- if(bActive &&
- rHint.Type() == TYPE(SfxSimpleHint) &&
- ((SfxSimpleHint&) rHint ).GetId() == SFX_HINT_UPDATEDONE ) {
+ if(bActive)
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_UPDATEDONE == pSfxSimpleHint->GetId())
+ {
Update();
EndListening(*pBindings);
- bValid = sal_True;
- bListening = sal_False;
+ bValid = true;
+ bListening = false;
+ }
}
}
diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx
index ef9f5c5cd43f..a24fd3d89f3d 100644
--- a/svx/source/dialog/swframeexample.cxx
+++ b/svx/source/dialog/swframeexample.cxx
@@ -94,11 +94,8 @@ void SvxSwFrameExample::DataChanged( const DataChangedEvent& rDCEvt )
void SvxSwFrameExample::InitAllRects_Impl()
{
-// const Size aSz(GetOutputSizePixel());
-
// Seite
-// aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3));
- aPage.SetSize( GetOutputSizePixel() );
+ aPage.SetSize( Size( GetOutputSizePixel().Width() - 3, GetOutputSizePixel().Height() - 3 ) );
sal_uIntPtr nOutWPix = aPage.GetWidth();
sal_uIntPtr nOutHPix = aPage.GetHeight();
diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx
index 432a91f2f0a0..5fe6661c77ba 100644
--- a/svx/source/engine3d/cube3d.cxx
+++ b/svx/source/engine3d/cube3d.cxx
@@ -40,8 +40,6 @@ sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfE3dCube(*this);
}
-TYPEINIT1(E3dCubeObj, E3dCompoundObject);
-
/*************************************************************************
|*
|* Konstruktor: |
@@ -50,26 +48,69 @@ TYPEINIT1(E3dCubeObj, E3dCompoundObject);
|*
\************************************************************************/
-E3dCubeObj::E3dCubeObj(E3dDefaultAttributes& rDefault, basegfx::B3DPoint aPos, const basegfx::B3DVector& r3DSize)
-: E3dCompoundObject(rDefault)
+E3dCubeObj::E3dCubeObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint aPos,
+ const basegfx::B3DVector a3DSize)
+: E3dCompoundObject(rSdrModel, rDefault)
{
// Defaults setzen
SetDefaultAttributes(rDefault);
// uebergebene drueberbuegeln
aCubePos = aPos;
- aCubeSize = r3DSize;
+ aCubeSize = a3DSize;
}
-E3dCubeObj::E3dCubeObj()
-: E3dCompoundObject()
+//E3dCubeObj::E3dCubeObj()
+//: E3dCompoundObject()
+//{
+// // Defaults setzen
+// E3dDefaultAttributes aDefault;
+// SetDefaultAttributes(aDefault);
+//}
+
+E3dCubeObj::~E3dCubeObj()
{
- // Defaults setzen
- E3dDefaultAttributes aDefault;
- SetDefaultAttributes(aDefault);
}
-void E3dCubeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dCubeObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const E3dCubeObj* pSource = dynamic_cast< const E3dCubeObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ E3dCompoundObject::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ aCubePos = pSource->aCubePos;
+ aCubeSize = pSource->aCubeSize;
+ bPosIsCenter = pSource->bPosIsCenter;
+ nSideFlags = pSource->nSideFlags;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* E3dCubeObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ E3dCubeObj* pClone = new E3dCubeObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ E3dDefaultAttributes());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+void E3dCubeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
aCubePos = rDefault.GetDefaultCubePos();
aCubeSize = rDefault.GetDefaultCubeSize();
@@ -94,29 +135,9 @@ sal_uInt16 E3dCubeObj::GetObjIdentifier() const
|*
\************************************************************************/
-SdrObject *E3dCubeObj::DoConvertToPolyObj(sal_Bool /*bBezier*/, bool /*bAddText*/) const
+SdrObject* E3dCubeObj::DoConvertToPolygonObject(bool /*bBezier*/, bool /*bAddText*/) const
{
- return NULL;
-}
-
-/*************************************************************************
-|*
-|* Zuweisungsoperator
-|*
-\************************************************************************/
-
-void E3dCubeObj::operator=(const SdrObject& rObj)
-{
- // erstmal alle Childs kopieren
- E3dCompoundObject::operator=(rObj);
-
- // weitere Parameter kopieren
- const E3dCubeObj& r3DObj = (const E3dCubeObj&)rObj;
-
- aCubePos = r3DObj.aCubePos;
- aCubeSize = r3DObj.aCubeSize;
- bPosIsCenter = r3DObj.bPosIsCenter;
- nSideFlags = r3DObj.nSideFlags;
+ return 0;
}
/*************************************************************************
@@ -143,7 +164,7 @@ void E3dCubeObj::SetCubeSize(const basegfx::B3DVector& rNew)
}
}
-void E3dCubeObj::SetPosIsCenter(sal_Bool bNew)
+void E3dCubeObj::SetPosIsCenter(bool bNew)
{
if(bPosIsCenter != bNew)
{
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index 6b703cdb4196..7fe65a788032 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -31,7 +31,6 @@
#include <svx/svddrgmt.hxx>
#include <svx/svdtrans.hxx>
#include <svx/obj3d.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/e3dundo.hxx>
#include <svx/dialogs.hrc>
#include <svx/sdr/overlay/overlaypolypolygon.hxx>
@@ -40,8 +39,7 @@
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <svx/e3dsceneupdater.hxx>
-
-TYPEINIT1(E3dDragMethod, SdrDragMethod);
+#include <svx/svdlegacy.hxx>
/*************************************************************************
|*
@@ -50,8 +48,8 @@ TYPEINIT1(E3dDragMethod, SdrDragMethod);
\************************************************************************/
E3dDragMethod::E3dDragMethod (
- SdrDragView &_rView,
- const SdrMarkList& rMark,
+ SdrView &_rView,
+ const SdrObjectVector& rSelection,
E3dDragConstraint eConstr,
sal_Bool bFull)
: SdrDragMethod(_rView),
@@ -61,7 +59,6 @@ E3dDragMethod::E3dDragMethod (
{
// Fuer alle in der selektion befindlichen 3D-Objekte
// eine Unit anlegen
- const long nCnt(rMark.GetMarkCount());
static bool bDoInvalidate(false);
long nObjs(0);
@@ -70,9 +67,9 @@ E3dDragMethod::E3dDragMethod (
// for non-visible 3D objects fallback to wireframe interaction
bool bInvisibleObjects(false);
- for(nObjs = 0;!bInvisibleObjects && nObjs < nCnt;nObjs++)
+ for(nObjs = 0; !bInvisibleObjects && nObjs < rSelection.size(); nObjs++)
{
- E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
+ E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rSelection[nObjs]);
if(pE3dObj)
{
@@ -89,9 +86,9 @@ E3dDragMethod::E3dDragMethod (
}
}
- for(nObjs = 0;nObjs < nCnt;nObjs++)
+ for(nObjs = 0; nObjs < rSelection.size(); nObjs++)
{
- E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
+ E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rSelection[nObjs]);
if(pE3dObj)
{
@@ -100,7 +97,7 @@ E3dDragMethod::E3dDragMethod (
aNewUnit.mp3DObj = pE3dObj;
// get transformations
- aNewUnit.maInitTransform = aNewUnit.maTransform = pE3dObj->GetTransform();
+ aNewUnit.maInitTransform = aNewUnit.maTransform = pE3dObj->GetB3DTransform();
if(pE3dObj->GetParentObj())
{
@@ -113,7 +110,7 @@ E3dDragMethod::E3dDragMethod (
// Neuberechnung beim Setzen der Marker zu erzwingen
if(bDoInvalidate)
{
- pE3dObj->SetRectsDirty();
+ pE3dObj->ActionChanged();
}
if(!mbMoveFull)
@@ -125,7 +122,7 @@ E3dDragMethod::E3dDragMethod (
}
// FullBound ermitteln
- maFullBound.Union(pE3dObj->GetSnapRect());
+ maFullBound.expand(sdr::legacy::GetSnapRange(*pE3dObj));
// Unit einfuegen
maGrp.push_back(aNewUnit);
@@ -152,12 +149,13 @@ bool E3dDragMethod::BeginSdrDrag()
if(E3DDRAG_CONSTR_Z == meConstraint)
{
const sal_uInt32 nCnt(maGrp.size());
- DragStat().Ref1() = maFullBound.Center();
+ DragStat().SetRef1(maFullBound.getCenter());
for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
{
E3dDragMethodUnit& rCandidate = maGrp[nOb];
- rCandidate.mnStartAngle = GetAngle(DragStat().GetStart() - DragStat().GetRef1());
+ const Point aDelta(basegfx::fround(DragStat().GetStart().getX() - DragStat().GetRef1().getX()), basegfx::fround(DragStat().GetStart().getY() - DragStat().GetRef1().getY()));
+ rCandidate.mnStartAngle = GetAngle(aDelta);
rCandidate.mnLastAngle = 0;
}
}
@@ -193,25 +191,26 @@ bool E3dDragMethod::EndSdrDrag(bool /*bCopy*/)
// Alle Transformationen anwenden und UnDo's anlegen
if(mbMovedAtAll)
{
- const bool bUndo = getSdrDragView().IsUndoEnabled();
+ const bool bUndo = getSdrView().IsUndoEnabled();
if( bUndo )
- getSdrDragView().BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_ROTATE));
+ getSdrView().BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_ROTATE));
sal_uInt32 nOb(0);
for(nOb=0;nOb<nCnt;nOb++)
{
E3dDragMethodUnit& rCandidate = maGrp[nOb];
E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
- rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
+ rCandidate.mp3DObj->SetB3DTransform(rCandidate.maTransform);
if( bUndo )
{
- getSdrDragView().AddUndo(new E3dRotateUndoAction(rCandidate.mp3DObj->GetModel(),
+ getSdrView().AddUndo(new E3dRotateUndoAction(
+ &rCandidate.mp3DObj->getSdrModelFromSdrObject(),
rCandidate.mp3DObj, rCandidate.maInitTransform,
rCandidate.maTransform));
}
}
if( bUndo )
- getSdrDragView().EndUndo();
+ getSdrView().EndUndo();
}
return sal_True;
@@ -236,7 +235,7 @@ void E3dDragMethod::CancelSdrDrag()
// Transformation restaurieren
E3dDragMethodUnit& rCandidate = maGrp[nOb];
E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
- rCandidate.mp3DObj->SetTransform(rCandidate.maInitTransform);
+ rCandidate.mp3DObj->SetB3DTransform(rCandidate.maInitTransform);
}
}
}
@@ -253,7 +252,7 @@ void E3dDragMethod::CancelSdrDrag()
|*
\************************************************************************/
-void E3dDragMethod::MoveSdrDrag(const Point& /*rPnt*/)
+void E3dDragMethod::MoveSdrDrag(const basegfx::B2DPoint& /*rPnt*/)
{
mbMovedAtAll = true;
}
@@ -273,10 +272,6 @@ void E3dDragMethod::CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverl
for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
{
E3dDragMethodUnit& rCandidate = maGrp[nOb];
- SdrPageView* pPV = getSdrDragView().GetSdrPageView();
-
- if(pPV && pPV->HasMarkedObjPageView())
- {
const basegfx::B3DPolyPolygon aCandidate(rCandidate.maWireframePoly);
const sal_uInt32 nPlyCnt(aCandidate.count());
@@ -296,7 +291,6 @@ void E3dDragMethod::CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverl
aResult.append(aPolyPolygon);
}
}
- }
if(aResult.count())
{
@@ -312,13 +306,12 @@ void E3dDragMethod::CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverl
*************************************************************************/
-TYPEINIT1(E3dDragRotate, E3dDragMethod);
-
-E3dDragRotate::E3dDragRotate(SdrDragView &_rView,
- const SdrMarkList& rMark,
+E3dDragRotate::E3dDragRotate(
+ SdrView &_rView,
+ const SdrObjectVector& rSelection,
E3dDragConstraint eConstr,
sal_Bool bFull)
-: E3dDragMethod(_rView, rMark, eConstr, bFull)
+: E3dDragMethod(_rView, rSelection, eConstr, bFull)
{
// Zentrum aller selektierten Objekte in Augkoordinaten holen
const sal_uInt32 nCnt(maGrp.size());
@@ -349,7 +342,7 @@ E3dDragRotate::E3dDragRotate(SdrDragView &_rView,
}
// get rotate center and transform to 3D eye coordinates
- basegfx::B2DPoint aRotCenter2D(Ref1().X(), Ref1().Y());
+ basegfx::B2DPoint aRotCenter2D(GetRef1());
// from world to relative scene using inverse getObjectTransformation()
basegfx::B2DHomMatrix aInverseObjectTransform(rVCScene.getObjectTransformation());
@@ -362,8 +355,8 @@ E3dDragRotate::E3dDragRotate(SdrDragView &_rView,
aInverseViewToEye.invert();
aRotCenter3D = aInverseViewToEye * aRotCenter3D;
- // X,Y des RotCenter und Tiefe der gemeinsamen Objektmitte aus
- // Rotationspunkt im Raum benutzen
+ // X,Y des RotCenter und Tiefe der gemeinsamen Objektmitte aus
+ // Rotationspunkt im Raum benutzen
maGlobalCenter.setX(aRotCenter3D.getX());
maGlobalCenter.setY(aRotCenter3D.getY());
}
@@ -376,7 +369,7 @@ E3dDragRotate::E3dDragRotate(SdrDragView &_rView,
|*
\************************************************************************/
-void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
+void E3dDragRotate::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
// call parent
E3dDragMethod::MoveSdrDrag(rPnt);
@@ -385,9 +378,11 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
{
// Modifier holen
sal_uInt16 nModifier = 0;
- if(getSdrDragView().ISA(E3dView))
+ E3dView* pE3dView = dynamic_cast< E3dView* >(&getSdrView());
+
+ if(pE3dView)
{
- const MouseEvent& rLastMouse = ((E3dView&)getSdrDragView()).GetMouseEvent();
+ const MouseEvent& rLastMouse = pE3dView->GetMouseEvent();
nModifier = rLastMouse.GetModifier();
}
@@ -402,22 +397,20 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
if(E3DDRAG_CONSTR_Z == meConstraint)
{
- fWAngle = NormAngle360(GetAngle(rPnt - DragStat().GetRef1()) -
- rCandidate.mnStartAngle) - rCandidate.mnLastAngle;
+ const Point aDelta(basegfx::fround(rPnt.getX() - DragStat().GetRef1().getX()), basegfx::fround(rPnt.getY() - DragStat().GetRef1().getY()));
+ fWAngle = NormAngle360(GetAngle(aDelta) - rCandidate.mnStartAngle) - rCandidate.mnLastAngle;
rCandidate.mnLastAngle = (long)fWAngle + rCandidate.mnLastAngle;
fWAngle /= 100.0;
fHAngle = 0.0;
}
else
{
- fWAngle = 90.0 * (double)(rPnt.X() - maLastPos.X())
- / (double)maFullBound.GetWidth();
- fHAngle = 90.0 * (double)(rPnt.Y() - maLastPos.Y())
- / (double)maFullBound.GetHeight();
+ fWAngle = 90.0 * (rPnt.getX() - maLastPos.getX()) / maFullBound.getWidth();
+ fHAngle = 90.0 * (rPnt.getY() - maLastPos.getY()) / maFullBound.getHeight();
}
long nSnap = 0;
- if(!getSdrDragView().IsRotateAllowed(sal_False))
+ if(!getSdrView().IsRotateAllowed(false))
nSnap = 90;
if(nSnap != 0)
@@ -460,9 +453,9 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
basegfx::B3DHomMatrix aTransMat(rCandidate.maDisplayTransform);
aTransMat *= aViewInfo3D.getOrientation();
- aTransMat.translate(-maGlobalCenter.getX(), -maGlobalCenter.getY(), -maGlobalCenter.getZ());
+ aTransMat.translate(-maGlobalCenter);
aTransMat *= aRotMat;
- aTransMat.translate(maGlobalCenter.getX(), maGlobalCenter.getY(), maGlobalCenter.getZ());
+ aTransMat.translate(maGlobalCenter);
aTransMat *= aInverseOrientation;
aTransMat *= rCandidate.maInvDisplayTransform;
@@ -472,7 +465,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
if(mbMoveFull)
{
E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
- rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
+ rCandidate.mp3DObj->SetB3DTransform(rCandidate.maTransform);
}
else
{
@@ -481,6 +474,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt)
Show();
}
}
+
maLastPos = rPnt;
DragStat().NextMove(rPnt);
}
@@ -504,41 +498,40 @@ Pointer E3dDragRotate::GetSdrDragPointer() const
|*
\************************************************************************/
-TYPEINIT1(E3dDragMove, E3dDragMethod);
-
-E3dDragMove::E3dDragMove(SdrDragView &_rView,
- const SdrMarkList& rMark,
+E3dDragMove::E3dDragMove(
+ SdrView &_rView,
+ const SdrObjectVector& rSelection,
SdrHdlKind eDrgHdl,
E3dDragConstraint eConstr,
sal_Bool bFull)
-: E3dDragMethod(_rView, rMark, eConstr, bFull),
+: E3dDragMethod(_rView, rSelection, eConstr, bFull),
meWhatDragHdl(eDrgHdl)
{
switch(meWhatDragHdl)
{
case HDL_LEFT:
- maScaleFixPos = maFullBound.RightCenter();
+ maScaleFixPos = basegfx::B2DPoint(maFullBound.getMaxX(), maFullBound.getCenterY());
break;
case HDL_RIGHT:
- maScaleFixPos = maFullBound.LeftCenter();
+ maScaleFixPos = basegfx::B2DPoint(maFullBound.getMinX(), maFullBound.getCenterY());
break;
case HDL_UPPER:
- maScaleFixPos = maFullBound.BottomCenter();
+ maScaleFixPos = basegfx::B2DPoint(maFullBound.getCenterX(), maFullBound.getMaxY());
break;
case HDL_LOWER:
- maScaleFixPos = maFullBound.TopCenter();
+ maScaleFixPos = basegfx::B2DPoint(maFullBound.getCenterX(), maFullBound.getMinY());
break;
case HDL_UPLFT:
- maScaleFixPos = maFullBound.BottomRight();
+ maScaleFixPos = maFullBound.getMaximum();
break;
case HDL_UPRGT:
- maScaleFixPos = maFullBound.BottomLeft();
+ maScaleFixPos = basegfx::B2DPoint(maFullBound.getMinX(), maFullBound.getMaxY());
break;
case HDL_LWLFT:
- maScaleFixPos = maFullBound.TopRight();
+ maScaleFixPos = basegfx::B2DPoint(maFullBound.getMaxX(), maFullBound.getMinY());
break;
case HDL_LWRGT:
- maScaleFixPos = maFullBound.TopLeft();
+ maScaleFixPos = maFullBound.getMinimum();
break;
default:
// Bewegen des Objektes, HDL_MOVE
@@ -546,10 +539,10 @@ E3dDragMove::E3dDragMove(SdrDragView &_rView,
}
// Override wenn IsResizeAtCenter()
- if(getSdrDragView().IsResizeAtCenter())
+ if(getSdrView().IsResizeAtCenter())
{
meWhatDragHdl = HDL_USER;
- maScaleFixPos = maFullBound.Center();
+ maScaleFixPos = maFullBound.getCenter();
}
}
@@ -559,7 +552,7 @@ E3dDragMove::E3dDragMove(SdrDragView &_rView,
|*
\************************************************************************/
-void E3dDragMove::MoveSdrDrag(const Point& rPnt)
+void E3dDragMove::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
// call parent
E3dDragMethod::MoveSdrDrag(rPnt);
@@ -570,16 +563,17 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
{
// Translation
// Bewegungsvektor bestimmen
- basegfx::B3DPoint aGlobalMoveHead((double)(rPnt.X() - maLastPos.X()), (double)(rPnt.Y() - maLastPos.Y()), 32768.0);
+ basegfx::B3DPoint aGlobalMoveHead(rPnt.getX() - maLastPos.getX(), rPnt.getY() - maLastPos.getY(), 32768.0);
basegfx::B3DPoint aGlobalMoveTail(0.0, 0.0, 32768.0);
const sal_uInt32 nCnt(maGrp.size());
// Modifier holen
sal_uInt16 nModifier(0);
+ E3dView* pE3dView = dynamic_cast< E3dView* >(&getSdrView());
- if(getSdrDragView().ISA(E3dView))
+ if(pE3dView)
{
- const MouseEvent& rLastMouse = ((E3dView&)getSdrDragView()).GetMouseEvent();
+ const MouseEvent& rLastMouse = pE3dView->GetMouseEvent();
nModifier = rLastMouse.GetModifier();
}
@@ -590,7 +584,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
// move coor from 2d world to 3d Eye
- basegfx::B2DPoint aGlobalMoveHead2D((double)(rPnt.X() - maLastPos.X()), (double)(rPnt.Y() - maLastPos.Y()));
+ basegfx::B2DPoint aGlobalMoveHead2D(rPnt - maLastPos);
basegfx::B2DPoint aGlobalMoveTail2D(0.0, 0.0);
basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
@@ -629,7 +623,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
// build transformation
basegfx::B3DHomMatrix aTransMat;
basegfx::B3DPoint aTranslate(aMoveHead3D - aMoveTail3D);
- aTransMat.translate(aTranslate.getX(), aTranslate.getY(), aTranslate.getZ());
+ aTransMat.translate(aTranslate);
// ...and apply
rCandidate.maTransform *= aTransMat;
@@ -637,7 +631,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
if(mbMoveFull)
{
E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
- rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
+ rCandidate.mp3DObj->SetB3DTransform(rCandidate.maTransform);
}
else
{
@@ -651,7 +645,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
{
// Skalierung
// Skalierungsvektor bestimmen
- Point aStartPos = DragStat().GetStart();
+ basegfx::B2DPoint aStartPos(DragStat().GetStart());
const sal_uInt32 nCnt(maGrp.size());
for(sal_uInt32 nOb(0); nOb < nCnt; nOb++)
@@ -663,9 +657,9 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(rCandidate.mp3DObj->GetScene()->GetViewContact());
const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
- basegfx::B2DPoint aGlobalScaleStart2D((double)(aStartPos.X()), (double)(aStartPos.Y()));
- basegfx::B2DPoint aGlobalScaleNext2D((double)(rPnt.X()), (double)(rPnt.Y()));
- basegfx::B2DPoint aGlobalScaleFixPos2D((double)(maScaleFixPos.X()), (double)(maScaleFixPos.Y()));
+ basegfx::B2DPoint aGlobalScaleStart2D(aStartPos);
+ basegfx::B2DPoint aGlobalScaleNext2D(rPnt);
+ basegfx::B2DPoint aGlobalScaleFixPos2D(maScaleFixPos);
basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
aInverseSceneTransform.invert();
@@ -723,7 +717,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
}
// SHIFT-key used?
- if(getSdrDragView().IsOrtho())
+ if(getSdrView().IsOrthogonal())
{
if(fabs(aScaleVec.getX()) > fabs(aScaleVec.getY()))
{
@@ -744,9 +738,9 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
basegfx::B3DHomMatrix aNewTrans = rCandidate.maInitTransform;
aNewTrans *= rCandidate.maDisplayTransform;
aNewTrans *= aViewInfo3D.getOrientation();
- aNewTrans.translate(-aScFixPos.getX(), -aScFixPos.getY(), -aScFixPos.getZ());
- aNewTrans.scale(aScaleVec.getX(), aScaleVec.getY(), aScaleVec.getZ());
- aNewTrans.translate(aScFixPos.getX(), aScFixPos.getY(), aScFixPos.getZ());
+ aNewTrans.translate(-aScFixPos);
+ aNewTrans.scale(aScaleVec);
+ aNewTrans.translate(aScFixPos);
aNewTrans *= aInverseOrientation;
aNewTrans *= rCandidate.maInvDisplayTransform;
@@ -756,7 +750,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt)
if(mbMoveFull)
{
E3DModifySceneSnapRectUpdater aUpdater(rCandidate.mp3DObj);
- rCandidate.mp3DObj->SetTransform(rCandidate.maTransform);
+ rCandidate.mp3DObj->SetB3DTransform(rCandidate.maTransform);
}
else
{
diff --git a/svx/source/engine3d/e3dsceneupdater.cxx b/svx/source/engine3d/e3dsceneupdater.cxx
index 8b0205456155..f1da204bf1d4 100644
--- a/svx/source/engine3d/e3dsceneupdater.cxx
+++ b/svx/source/engine3d/e3dsceneupdater.cxx
@@ -28,6 +28,7 @@
#include <svx/obj3d.hxx>
#include <svx/scene3d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -79,12 +80,12 @@ E3DModifySceneSnapRectUpdater::~E3DModifySceneSnapRectUpdater()
if(!aAllContentRange.isEmpty())
{
// check if object transform of scene has changed
- if(mpViewInformation3D->getObjectTransformation() != mpScene->GetTransform())
+ if(mpViewInformation3D->getObjectTransformation() != mpScene->GetB3DTransform())
{
// If Yes, it needs to be updated since it's - for historical reasons -
// part of the basic 3d transformation stack of the scene
drawinglayer::geometry::ViewInformation3D* pNew = new drawinglayer::geometry::ViewInformation3D(
- mpScene->GetTransform(), // replace object transformation with new local transform
+ mpScene->GetB3DTransform(), // replace object transformation with new local transform
mpViewInformation3D->getOrientation(),
mpViewInformation3D->getProjection(),
mpViewInformation3D->getDeviceToView(),
@@ -111,9 +112,9 @@ E3DModifySceneSnapRectUpdater::~E3DModifySceneSnapRectUpdater()
sal_Int32(ceil(aSnapRange.getMaxX())), sal_Int32(ceil(aSnapRange.getMaxY())));
// set as new SnapRect and invalidate bound volume
- if(mpScene->GetSnapRect() != aNewSnapRect)
+ if(sdr::legacy::GetSnapRect(*mpScene) != aNewSnapRect)
{
- mpScene->SetSnapRect(aNewSnapRect);
+ sdr::legacy::SetSnapRect(*mpScene, aNewSnapRect);
mpScene->InvalidateBoundVolume();
}
}
diff --git a/svx/source/engine3d/e3dundo.cxx b/svx/source/engine3d/e3dundo.cxx
index 8ac3b38937b8..12fcf0532c62 100644
--- a/svx/source/engine3d/e3dundo.cxx
+++ b/svx/source/engine3d/e3dundo.cxx
@@ -32,8 +32,6 @@
/************************************************************************/
-TYPEINIT1(E3dUndoAction, SfxUndoAction);
-
/************************************************************************\
|*
|* Destruktor der Basisklasse
@@ -55,8 +53,6 @@ sal_Bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const
/************************************************************************/
-TYPEINIT1(E3dRotateUndoAction, E3dUndoAction);
-
/************************************************************************
E3dRotateUndoAction
@@ -80,7 +76,7 @@ E3dRotateUndoAction::~E3dRotateUndoAction ()
void E3dRotateUndoAction::Undo ()
{
E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
- pMy3DObj->SetTransform(aMyOldRotation);
+ pMy3DObj->SetB3DTransform(aMyOldRotation);
}
/************************************************************************\
@@ -91,7 +87,7 @@ void E3dRotateUndoAction::Undo ()
void E3dRotateUndoAction::Redo ()
{
E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
- pMy3DObj->SetTransform(aMyNewRotation);
+ pMy3DObj->SetB3DTransform(aMyNewRotation);
}
/*************************************************************************
@@ -100,8 +96,6 @@ void E3dRotateUndoAction::Redo ()
|*
\************************************************************************/
-TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction);
-
/*************************************************************************
|*
|* Konstruktor
diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx
index 3a5ddb6707a6..9db4cd5d484e 100644
--- a/svx/source/engine3d/extrud3d.cxx
+++ b/svx/source/engine3d/extrud3d.cxx
@@ -60,8 +60,6 @@ sdr::properties::BaseProperties* E3dExtrudeObj::CreateObjectSpecificProperties()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(E3dExtrudeObj, E3dCompoundObject);
-
/*************************************************************************
|*
|* Konstruktor, erzeugt zwei Deckelflaechen-PolyPolygone und (PointCount-1)
@@ -69,9 +67,13 @@ TYPEINIT1(E3dExtrudeObj, E3dCompoundObject);
|*
\************************************************************************/
-E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth)
-: E3dCompoundObject(rDefault),
- maExtrudePolygon(rPP)
+E3dExtrudeObj::E3dExtrudeObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B2DPolyPolygon aPP,
+ double fDepth)
+: E3dCompoundObject(rSdrModel, rDefault),
+ maExtrudePolygon(aPP)
{
// since the old class PolyPolygon3D did mirror the given PolyPolygons in Y, do the same here
basegfx::B2DHomMatrix aMirrorY;
@@ -82,18 +84,46 @@ E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DP
SetDefaultAttributes(rDefault);
// set extrude depth
- GetProperties().SetObjectItemDirect(Svx3DDepthItem((sal_uInt32)(fDepth + 0.5)));
+ GetProperties().SetObjectItemDirect(SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, (sal_uInt32)(fDepth + 0.5)));
}
-E3dExtrudeObj::E3dExtrudeObj()
-: E3dCompoundObject()
+E3dExtrudeObj::~E3dExtrudeObj()
{
- // Defaults setzen
- E3dDefaultAttributes aDefault;
- SetDefaultAttributes(aDefault);
}
-void E3dExtrudeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dExtrudeObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const E3dExtrudeObj* pSource = dynamic_cast< const E3dExtrudeObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ E3dCompoundObject::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ maExtrudePolygon = pSource->maExtrudePolygon;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* E3dExtrudeObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ E3dExtrudeObj* pClone = new E3dExtrudeObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ E3dDefaultAttributes());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+void E3dExtrudeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(rDefault.GetDefaultExtrudeSmoothed()));
GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(rDefault.GetDefaultExtrudeSmoothFrontBack()));
@@ -119,23 +149,6 @@ sal_uInt16 E3dExtrudeObj::GetObjIdentifier() const
/*************************************************************************
|*
-|* Zuweisungsoperator
-|*
-\************************************************************************/
-
-void E3dExtrudeObj::operator=(const SdrObject& rObj)
-{
- // erstmal alle Childs kopieren
- E3dCompoundObject::operator=(rObj);
-
- // weitere Parameter kopieren
- const E3dExtrudeObj& r3DObj = (const E3dExtrudeObj&)rObj;
-
- maExtrudePolygon = r3DObj.maExtrudePolygon;
-}
-
-/*************************************************************************
-|*
|* Lokale Parameter setzen mit Geometrieneuerzeugung
|*
\************************************************************************/
@@ -226,9 +239,9 @@ SdrAttrObj* E3dExtrudeObj::GetBreakObj()
const basegfx::B3DRange aPolyPolyRange(basegfx::tools::getRange(aBackSide));
const basegfx::B3DPoint aCenter(aPolyPolyRange.getCenter());
- aTransform.translate(-aCenter.getX(), -aCenter.getY(), -aCenter.getZ());
+ aTransform.translate(-aCenter);
aTransform.scale(fScaleFactor, fScaleFactor, fScaleFactor);
- aTransform.translate(aCenter.getX(), aCenter.getY(), aCenter.getZ());
+ aTransform.translate(aCenter);
}
// translate by extrude depth
@@ -242,7 +255,9 @@ SdrAttrObj* E3dExtrudeObj::GetBreakObj()
{
// create PathObj
basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide);
- SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aPoly);
+ SdrPathObj* pPathObj = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ aPoly);
if(pPathObj)
{
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index e83c9606c9f0..fdba5d787485 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -41,7 +41,6 @@
#include <svx/camera3d.hxx>
#include <svx/fmmodel.hxx>
#include <svx/fmpage.hxx>
-#include <svx/polysc3d.hxx>
#include <editeng/eeitem.hxx>
#include <svl/style.hxx>
#include <svx/dlgutil.hxx>
@@ -707,7 +706,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_HORZ_SEGS);
if(eState != SFX_ITEM_DONTCARE)
{
- sal_uInt32 nValue = ((const Svx3DHorizontalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue();
if(nValue != (sal_uInt32 )aNumHorizontal.GetValue())
{
aNumHorizontal.SetValue( nValue );
@@ -734,7 +733,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_VERT_SEGS);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DVerticalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue();
if( nValue != (sal_uInt32) aNumVertical.GetValue() )
{
aNumVertical.SetValue( nValue );
@@ -761,7 +760,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DEPTH);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DDepthItem&)rAttrs.Get(SDRATTR_3DOBJ_DEPTH)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_DEPTH)).GetValue();
sal_uInt32 nValue2 = GetCoreValue( aMtrDepth, ePoolUnit );
if( nValue != nValue2 )
{
@@ -788,8 +787,8 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DOUBLE_SIDED);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_Bool bValue = ((const Svx3DDoubleSidedItem&)rAttrs.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue();
- if( bValue != aBtnDoubleSided.IsChecked() )
+ bool bValue = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue();
+ if( bValue != (bool)aBtnDoubleSided.IsChecked() )
{
aBtnDoubleSided.Check( bValue );
bUpdate = sal_True;
@@ -812,7 +811,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_PERCENT_DIAGONAL);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt16 nValue = ((const Svx3DPercentDiagonalItem&)rAttrs.Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue();
+ sal_uInt16 nValue = ((const SfxUInt16Item&)rAttrs.Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL)).GetValue();
if( nValue != aMtrPercentDiagonal.GetValue() )
{
aMtrPercentDiagonal.SetValue( nValue );
@@ -837,7 +836,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_BACKSCALE);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt16 nValue = ((const Svx3DBackscaleItem&)rAttrs.Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue();
+ sal_uInt16 nValue = ((const SfxUInt16Item&)rAttrs.Get(SDRATTR_3DOBJ_BACKSCALE)).GetValue();
if( nValue != aMtrBackscale.GetValue() )
{
aMtrBackscale.SetValue( nValue );
@@ -862,7 +861,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_END_ANGLE);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_Int32 nValue = ((const Svx3DEndAngleItem&)rAttrs.Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue();
+ sal_Int32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue();
if( nValue != aMtrEndAngle.GetValue() )
{
aMtrEndAngle.SetValue( nValue );
@@ -912,8 +911,8 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_NORMALS_INVERT);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_Bool bValue = ((const Svx3DNormalsInvertItem&)rAttrs.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue();
- if( bValue != aBtnNormalsInvert.IsChecked() )
+ bool bValue = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue();
+ if( bValue != (bool)aBtnNormalsInvert.IsChecked() )
{
aBtnNormalsInvert.Check( bValue );
bUpdate = sal_True;
@@ -934,8 +933,8 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_Bool bValue = ((const Svx3DTwoSidedLightingItem&)rAttrs.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue();
- if( bValue != aBtnTwoSidedLighting.IsChecked() )
+ bool bValue = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue();
+ if( bValue != (bool)aBtnTwoSidedLighting.IsChecked() )
{
aBtnTwoSidedLighting.Check( bValue );
bUpdate = sal_True;
@@ -977,8 +976,8 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_SHADOW_3D);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_Bool bValue = ((const Svx3DShadow3DItem&)rAttrs.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue();
- if( bValue != aBtnShadow3d.IsChecked() )
+ bool bValue = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue();
+ if( bValue != (bool)aBtnShadow3d.IsChecked() )
{
aBtnShadow3d.Check( bValue );
aFtSlant.Enable( bValue );
@@ -1001,7 +1000,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_SHADOW_SLANT);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt16 nValue = ((const Svx3DShadowSlantItem&)rAttrs.Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue();
+ sal_uInt16 nValue = ((const SfxUInt16Item&)rAttrs.Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue();
if( nValue != aMtrSlant.GetValue() )
{
aMtrSlant.SetValue( nValue );
@@ -1021,7 +1020,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_DISTANCE);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DDistanceItem&)rAttrs.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
if( nValue != nValue2 )
{
@@ -1045,7 +1044,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_FOCAL_LENGTH);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DFocalLengthItem&)rAttrs.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
if( nValue != nValue2 )
{
@@ -1072,7 +1071,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_1);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue();
ColorLB* pLb = &aLbLight1;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1092,7 +1091,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_1);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight1 )) ||
( !bOn && GetUILightState( aBtnLight1 )) )
{
@@ -1121,7 +1120,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_2);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue();
ColorLB* pLb = &aLbLight2;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1141,7 +1140,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_2);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight2 )) ||
( !bOn && GetUILightState( aBtnLight2 )) )
{
@@ -1170,7 +1169,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_3);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue();
ColorLB* pLb = &aLbLight3;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1190,7 +1189,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_3);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight3)) ||
( !bOn && GetUILightState( aBtnLight3)) )
{
@@ -1219,7 +1218,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_4);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue();
ColorLB* pLb = &aLbLight4;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1239,7 +1238,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_4);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight4 )) ||
( !bOn && GetUILightState( aBtnLight4 )) )
{
@@ -1268,7 +1267,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_5);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue();
ColorLB* pLb = &aLbLight5;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1288,7 +1287,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_5);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight5 )) ||
( !bOn && GetUILightState( aBtnLight5 )) )
{
@@ -1317,7 +1316,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_6);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue();
ColorLB* pLb = &aLbLight6;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1337,7 +1336,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_6);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight6 )) ||
( !bOn && GetUILightState( aBtnLight6 )) )
{
@@ -1366,7 +1365,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_7);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue();
ColorLB* pLb = &aLbLight7;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1386,7 +1385,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_7);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight7 )) ||
( !bOn && GetUILightState( aBtnLight7 )) )
{
@@ -1415,7 +1414,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTCOLOR_8);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DLightcolor8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue();
ColorLB* pLb = &aLbLight8;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1435,7 +1434,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_8);
if( eState != SFX_ITEM_DONTCARE )
{
- bool bOn = ((const Svx3DLightOnOff8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue() != 0;
+ bool bOn = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue() != 0;
if( ( bOn && !GetUILightState( aBtnLight8 )) ||
( !bOn && GetUILightState( aBtnLight8 )) )
{
@@ -1464,7 +1463,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_AMBIENTCOLOR);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DAmbientcolorItem&)rAttrs.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue();
ColorLB* pLb = &aLbAmbientlight;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1599,8 +1598,8 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_TEXTURE_FILTER);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_Bool bValue = ((const Svx3DTextureFilterItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue();
- if( bValue != aBtnTexFilter.IsChecked() )
+ bool bValue = ((const SfxBoolItem&)rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue();
+ if( bValue != (bool)aBtnTexFilter.IsChecked() )
{
aBtnTexFilter.Check( bValue );
bUpdate = sal_True;
@@ -1647,7 +1646,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_EMISSION);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DMaterialEmissionItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue();
ColorLB* pLb = &aLbMatEmission;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1668,7 +1667,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR);
if( eState != SFX_ITEM_DONTCARE )
{
- aColor = ((const Svx3DMaterialSpecularItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue();
+ aColor = ((const SvxColorItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue();
ColorLB* pLb = &aLbMatSpecular;
if( aColor != pLb->GetSelectEntryColor() )
{
@@ -1689,7 +1688,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt16 nValue = ((const Svx3DMaterialSpecularIntensityItem&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue();
+ sal_uInt16 nValue = ((const SfxUInt16Item&)rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue();
if( nValue != aMtrMatSpecularIntensity.GetValue() )
{
aMtrMatSpecularIntensity.SetValue( nValue );
@@ -1839,7 +1838,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aNumHorizontal.IsEmptyFieldValue() )
{
sal_uInt32 nValue = static_cast<sal_uInt32>(aNumHorizontal.GetValue());
- rAttrs.Put(Svx3DHorizontalSegmentsItem(nValue));
+ rAttrs.Put(SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_HORZ_SEGS);
@@ -1848,7 +1847,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aNumVertical.IsEmptyFieldValue() )
{
sal_uInt32 nValue = static_cast<sal_uInt32>(aNumVertical.GetValue());
- rAttrs.Put(Svx3DVerticalSegmentsItem(nValue));
+ rAttrs.Put(SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_VERT_SEGS);
@@ -1857,7 +1856,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aMtrDepth.IsEmptyFieldValue() )
{
sal_uInt32 nValue = GetCoreValue( aMtrDepth, ePoolUnit );
- rAttrs.Put(Svx3DDepthItem(nValue));
+ rAttrs.Put(SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_DEPTH);
@@ -1866,8 +1865,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
TriState eState = aBtnDoubleSided.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = STATE_CHECK == eState;
- rAttrs.Put(Svx3DDoubleSidedItem(bValue));
+ bool bValue = STATE_CHECK == eState;
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, bValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_DOUBLE_SIDED);
@@ -1875,8 +1874,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
// Kantenrundung
if( !aMtrPercentDiagonal.IsEmptyFieldValue() )
{
- sal_uInt16 nValue = (sal_uInt16) aMtrPercentDiagonal.GetValue();
- rAttrs.Put(Svx3DPercentDiagonalItem(nValue));
+ sal_uInt16 nValue = aMtrPercentDiagonal.GetValue();
+ rAttrs.Put(SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_PERCENT_DIAGONAL);
@@ -1884,8 +1883,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
// Tiefenskalierung
if( !aMtrBackscale.IsEmptyFieldValue() )
{
- sal_uInt16 nValue = (sal_uInt16)aMtrBackscale.GetValue();
- rAttrs.Put(Svx3DBackscaleItem(nValue));
+ sal_uInt16 nValue = aMtrBackscale.GetValue();
+ rAttrs.Put(SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_BACKSCALE);
@@ -1893,8 +1892,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
// Endwinkel
if( !aMtrEndAngle.IsEmptyFieldValue() )
{
- sal_uInt16 nValue = (sal_uInt16)aMtrEndAngle.GetValue();
- rAttrs.Put(Svx3DEndAngleItem(nValue));
+ sal_uInt16 nValue = aMtrEndAngle.GetValue();
+ rAttrs.Put(SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_END_ANGLE);
@@ -1917,8 +1916,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnNormalsInvert.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = STATE_CHECK == eState;
- rAttrs.Put(Svx3DNormalsInvertItem(bValue));
+ bool bValue = STATE_CHECK == eState;
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT, bValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_NORMALS_INVERT);
@@ -1927,8 +1926,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnTwoSidedLighting.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = STATE_CHECK == eState;
- rAttrs.Put(Svx3DTwoSidedLightingItem(bValue));
+ bool bValue = STATE_CHECK == eState;
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, bValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING);
@@ -1947,9 +1946,9 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnShadow3d.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = STATE_CHECK == eState;
- rAttrs.Put(Svx3DShadow3DItem(bValue));
- rAttrs.Put(SdrShadowItem(bValue));
+ bool bValue = STATE_CHECK == eState;
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D, bValue));
+ rAttrs.Put(SdrOnOffItem(SDRATTR_SHADOW, bValue));
}
else
{
@@ -1960,8 +1959,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
// Neigung (Schatten)
if( !aMtrSlant.IsEmptyFieldValue() )
{
- sal_uInt16 nValue2 = (sal_uInt16) aMtrSlant.GetValue();
- rAttrs.Put(Svx3DShadowSlantItem(nValue2));
+ sal_uInt16 nValue2 = aMtrSlant.GetValue();
+ rAttrs.Put(SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, nValue2));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_SHADOW_SLANT);
@@ -1970,7 +1969,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aMtrDistance.IsEmptyFieldValue() )
{
sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
- rAttrs.Put(Svx3DDistanceItem(nValue2));
+ rAttrs.Put(SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, nValue2));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_DISTANCE);
@@ -1979,7 +1978,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aMtrFocalLength.IsEmptyFieldValue() )
{
sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
- rAttrs.Put(Svx3DFocalLengthItem(nValue2));
+ rAttrs.Put(SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, nValue2));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_FOCAL_LENGTH);
@@ -1994,7 +1993,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight1.GetSelectEntryCount() )
{
aColor = aLbLight1.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor1Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_1));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_1);
@@ -2002,8 +2001,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight1.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight1 );
- rAttrs.Put(Svx3DLightOnOff1Item(bValue));
+ bool bValue = GetUILightState( aBtnLight1 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, bValue));
// Licht 1 (Richtung)
if( bValue )
@@ -2019,7 +2018,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight2.GetSelectEntryCount() )
{
aColor = aLbLight2.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor2Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_2));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_2);
@@ -2027,8 +2026,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight2.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight2 );
- rAttrs.Put(Svx3DLightOnOff2Item(bValue));
+ bool bValue = GetUILightState( aBtnLight2 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, bValue));
// Licht 2 (Richtung)
if( bValue )
@@ -2043,7 +2042,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight3.GetSelectEntryCount() )
{
aColor = aLbLight3.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor3Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_3));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_3);
@@ -2051,8 +2050,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight3.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight3 );
- rAttrs.Put(Svx3DLightOnOff3Item(bValue));
+ bool bValue = GetUILightState( aBtnLight3 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, bValue));
// Licht 3 (Richtung)
if( bValue )
@@ -2067,7 +2066,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight4.GetSelectEntryCount() )
{
aColor = aLbLight4.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor4Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_4));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_4);
@@ -2075,8 +2074,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight4.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight4 );
- rAttrs.Put(Svx3DLightOnOff4Item(bValue));
+ bool bValue = GetUILightState( aBtnLight4 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, bValue));
// Licht 4 (Richtung)
if( bValue )
@@ -2091,7 +2090,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight5.GetSelectEntryCount() )
{
aColor = aLbLight5.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor5Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_5));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_5);
@@ -2099,8 +2098,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight5.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight5 );
- rAttrs.Put(Svx3DLightOnOff5Item(bValue));
+ bool bValue = GetUILightState( aBtnLight5 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, bValue));
// Licht 5 (Richtung)
if( bValue )
@@ -2115,7 +2114,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight6.GetSelectEntryCount() )
{
aColor = aLbLight6.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor6Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_6));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_6);
@@ -2123,8 +2122,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight6.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight6 );
- rAttrs.Put(Svx3DLightOnOff6Item(bValue));
+ bool bValue = GetUILightState( aBtnLight6 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, bValue));
// Licht 6 (Richtung)
if( bValue )
@@ -2139,7 +2138,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight7.GetSelectEntryCount() )
{
aColor = aLbLight7.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor7Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_7));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_7);
@@ -2147,8 +2146,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight7.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight7 );
- rAttrs.Put(Svx3DLightOnOff7Item(bValue));
+ bool bValue = GetUILightState( aBtnLight7 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, bValue));
// Licht 7 (Richtung)
if( bValue )
@@ -2163,7 +2162,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbLight8.GetSelectEntryCount() )
{
aColor = aLbLight8.GetSelectEntryColor();
- rAttrs.Put(Svx3DLightcolor8Item(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_8));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTCOLOR_8);
@@ -2171,8 +2170,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnLight8.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = GetUILightState( aBtnLight8 );
- rAttrs.Put(Svx3DLightOnOff8Item(bValue));
+ bool bValue = GetUILightState( aBtnLight8 );
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, bValue));
// Licht 8 (Richtung)
if( bValue )
@@ -2187,7 +2186,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbAmbientlight.GetSelectEntryCount() )
{
aColor = aLbAmbientlight.GetSelectEntryColor();
- rAttrs.Put(Svx3DAmbientcolorItem(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_AMBIENTCOLOR));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_AMBIENTCOLOR);
@@ -2253,8 +2252,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
eState = aBtnTexFilter.GetState();
if( eState != STATE_DONTKNOW )
{
- sal_Bool bValue = STATE_CHECK == eState;
- rAttrs.Put(Svx3DTextureFilterItem(bValue));
+ bool bValue = STATE_CHECK == eState;
+ rAttrs.Put(SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER, bValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_TEXTURE_FILTER);
@@ -2276,7 +2275,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbMatEmission.GetSelectEntryCount() )
{
aColor = aLbMatEmission.GetSelectEntryColor();
- rAttrs.Put(Svx3DMaterialEmissionItem(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DOBJ_MAT_EMISSION));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_EMISSION);
@@ -2285,7 +2284,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( aLbMatSpecular.GetSelectEntryCount() )
{
aColor = aLbMatSpecular.GetSelectEntryColor();
- rAttrs.Put(Svx3DMaterialSpecularItem(aColor));
+ rAttrs.Put(SvxColorItem(aColor, SDRATTR_3DOBJ_MAT_SPECULAR));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_SPECULAR);
@@ -2293,8 +2292,8 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
// Glanzpunkt Intensitaet
if( !aMtrMatSpecularIntensity.IsEmptyFieldValue() )
{
- sal_uInt16 nValue2 = (sal_uInt16) aMtrMatSpecularIntensity.GetValue();
- rAttrs.Put(Svx3DMaterialSpecularIntensityItem(nValue2));
+ sal_uInt16 nValue2 = aMtrMatSpecularIntensity.GetValue();
+ rAttrs.Put(SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, nValue2));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY);
@@ -3040,15 +3039,15 @@ IMPL_LINK( Svx3DWin, ClickLightHdl, PushButton*, pBtn )
switch(nLightSource)
{
- case 0: aLightItemSet.Put(Svx3DLightcolor1Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff1Item(bOnOff)); break;
- case 1: aLightItemSet.Put(Svx3DLightcolor2Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff2Item(bOnOff)); break;
- case 2: aLightItemSet.Put(Svx3DLightcolor3Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff3Item(bOnOff)); break;
- case 3: aLightItemSet.Put(Svx3DLightcolor4Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff4Item(bOnOff)); break;
- case 4: aLightItemSet.Put(Svx3DLightcolor5Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff5Item(bOnOff)); break;
- case 5: aLightItemSet.Put(Svx3DLightcolor6Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff6Item(bOnOff)); break;
- case 6: aLightItemSet.Put(Svx3DLightcolor7Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff7Item(bOnOff)); break;
+ case 0: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_1)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, bOnOff)); break;
+ case 1: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_2)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, bOnOff)); break;
+ case 2: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_3)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, bOnOff)); break;
+ case 3: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_4)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, bOnOff)); break;
+ case 4: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_5)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, bOnOff)); break;
+ case 5: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_6)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, bOnOff)); break;
+ case 6: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_7)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, bOnOff)); break;
default:
- case 7: aLightItemSet.Put(Svx3DLightcolor8Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff8Item(bOnOff)); break;
+ case 7: aLightItemSet.Put(SvxColorItem(aColor, SDRATTR_3DSCENE_LIGHTCOLOR_8)); aLightItemSet.Put(SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, bOnOff)); break;
}
aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes(aLightItemSet);
diff --git a/svx/source/engine3d/helperhittest3d.cxx b/svx/source/engine3d/helperhittest3d.cxx
index a49e8ddbde37..590b0b7cff9a 100644
--- a/svx/source/engine3d/helperhittest3d.cxx
+++ b/svx/source/engine3d/helperhittest3d.cxx
@@ -122,7 +122,7 @@ E3dScene* fillViewInformation3DForCompoundObject(drawinglayer::geometry::ViewInf
if(pParentParentScene)
{
// pParentScene is a in-between scene
- aInBetweenSceneMatrix = pParentScene->GetTransform() * aInBetweenSceneMatrix;
+ aInBetweenSceneMatrix = pParentScene->GetB3DTransform() * aInBetweenSceneMatrix;
}
else
{
@@ -172,7 +172,7 @@ SVX_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack(
::std::vector< const E3dCompoundObject* >& o_rResult)
{
o_rResult.clear();
- SdrObjList* pList = rScene.GetSubList();
+ SdrObjList* pList = rScene.getChildrenOfSdrObject();
if(pList && pList->GetObjCount())
{
diff --git a/svx/source/engine3d/helperminimaldepth3d.cxx b/svx/source/engine3d/helperminimaldepth3d.cxx
index d23997a35f1f..fa53e514f3d6 100644
--- a/svx/source/engine3d/helperminimaldepth3d.cxx
+++ b/svx/source/engine3d/helperminimaldepth3d.cxx
@@ -181,7 +181,7 @@ double getMinimalDepthInViewCoordinates(const E3dCompoundObject& rObject)
while(pParentScene && pParentScene != pScene)
{
- aInBetweenSceneMatrix = pParentScene->GetTransform() * aInBetweenSceneMatrix;
+ aInBetweenSceneMatrix = pParentScene->GetB3DTransform() * aInBetweenSceneMatrix;
pParentScene = dynamic_cast< E3dScene* >(pParentScene->GetParentObj());
}
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx
index 17dae8092a1c..301ed55cdf41 100644
--- a/svx/source/engine3d/lathe3d.cxx
+++ b/svx/source/engine3d/lathe3d.cxx
@@ -58,8 +58,6 @@ sdr::properties::BaseProperties* E3dLatheObj::CreateObjectSpecificProperties()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(E3dLatheObj, E3dCompoundObject);
-
/*************************************************************************
|*
|* Konstruktor aus 3D-Polygon, Scale gibt den Umrechnungsfaktor fuer
@@ -67,9 +65,12 @@ TYPEINIT1(E3dLatheObj, E3dCompoundObject);
|*
\************************************************************************/
-E3dLatheObj::E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyPolygon rPoly2D)
-: E3dCompoundObject(rDefault),
- maPolyPoly2D(rPoly2D)
+E3dLatheObj::E3dLatheObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B2DPolyPolygon aPoly2D)
+: E3dCompoundObject(rSdrModel, rDefault),
+ maPolyPoly2D(aPoly2D)
{
// since the old class PolyPolygon3D did mirror the given PolyPolygons in Y, do the same here
basegfx::B2DHomMatrix aMirrorY;
@@ -93,25 +94,47 @@ E3dLatheObj::E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyP
nSegCnt -= 1;
}
- GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nSegCnt));
+ GetProperties().SetObjectItemDirect(SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nSegCnt));
}
}
-/*************************************************************************
-|*
-|* Leer-Konstruktor
-|*
-\************************************************************************/
+E3dLatheObj::~E3dLatheObj()
+{
+}
-E3dLatheObj::E3dLatheObj()
-: E3dCompoundObject()
+void E3dLatheObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- // Defaults setzen
- E3dDefaultAttributes aDefault;
- SetDefaultAttributes(aDefault);
+ if(this != &rSource)
+ {
+ const E3dLatheObj* pSource = dynamic_cast< const E3dLatheObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ E3dCompoundObject::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ maPolyPoly2D = pSource->maPolyPoly2D;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* E3dLatheObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ E3dLatheObj* pClone = new E3dLatheObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ E3dDefaultAttributes());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
-void E3dLatheObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dLatheObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(rDefault.GetDefaultLatheSmoothed()));
GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(rDefault.GetDefaultLatheSmoothFrontBack()));
@@ -133,30 +156,13 @@ sal_uInt16 E3dLatheObj::GetObjIdentifier() const
/*************************************************************************
|*
-|* Zuweisungsoperator
-|*
-\************************************************************************/
-
-void E3dLatheObj::operator=(const SdrObject& rObj)
-{
- // erstmal alle Childs kopieren
- E3dCompoundObject::operator=(rObj);
-
- // weitere Parameter kopieren
- const E3dLatheObj& r3DObj = (const E3dLatheObj&)rObj;
-
- maPolyPoly2D = r3DObj.maPolyPoly2D;
-}
-
-/*************************************************************************
-|*
|* Wandle das Objekt in ein Gruppenobjekt bestehend aus n Polygonen
|*
\************************************************************************/
-SdrObject *E3dLatheObj::DoConvertToPolyObj(sal_Bool /*bBezier*/, bool /*bAddText*/) const
+SdrObject* E3dLatheObj::DoConvertToPolygonObject(bool /*bBezier*/, bool /*bAddText*/) const
{
- return NULL;
+ return 0;
}
/*************************************************************************
@@ -170,8 +176,8 @@ void E3dLatheObj::ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs)
if ((nHSegs != GetHorizontalSegments() || nVSegs != GetVerticalSegments()) &&
(nHSegs != 0 || nVSegs != 0))
{
- GetProperties().SetObjectItemDirect(Svx3DHorizontalSegmentsItem(nHSegs));
- GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nVSegs));
+ GetProperties().SetObjectItemDirect(SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nHSegs));
+ GetProperties().SetObjectItemDirect(SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nVSegs));
ActionChanged();
}
@@ -200,7 +206,7 @@ void E3dLatheObj::SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew)
nSegCnt -= 1;
}
- GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nSegCnt));
+ GetProperties().SetObjectItemDirect(SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nSegCnt));
}
ActionChanged();
@@ -254,7 +260,9 @@ SdrAttrObj* E3dLatheObj::GetBreakObj()
// create PathObj
basegfx::B3DPolyPolygon aLathePoly3D(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(maPolyPoly2D));
basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D));
- SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aTransPoly);
+ SdrPathObj* pPathObj = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ aTransPoly);
if(pPathObj)
{
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index aca469f84e55..5b8b1c78b92a 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -30,11 +30,10 @@
#include <svx/svdattr.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdmodel.hxx>
-#include "svx/svditer.hxx"
-#include "svx/globl3d.hxx"
+#include <svx/svditer.hxx>
+#include <svx/globl3d.hxx>
#include <svx/camera3d.hxx>
#include <svx/scene3d.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/cube3d.hxx>
#include <svx/lathe3d.hxx>
#include <svx/sphere3d.hxx>
@@ -65,7 +64,6 @@
#include <svtools/colorcfg.hxx>
#include <editeng/eeitem.hxx>
#include <svx/xgrscit.hxx>
-#include "svdoimp.hxx"
#include <svx/sdr/properties/e3dproperties.hxx>
#include <svx/sdr/properties/e3dcompoundproperties.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
@@ -84,6 +82,7 @@
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#include <svx/e3dsceneupdater.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
@@ -91,159 +90,96 @@
using namespace com::sun::star;
-/*************************************************************************
-|*
-|* Liste fuer 3D-Objekte
-|*
-\************************************************************************/
-
-TYPEINIT1(E3dObjList, SdrObjList);
+//////////////////////////////////////////////////////////////////////////////
-E3dObjList::E3dObjList(SdrModel* pNewModel, SdrPage* pNewPage, E3dObjList* pNewUpList)
-: SdrObjList(pNewModel, pNewPage, pNewUpList)
+sdr::properties::BaseProperties* E3dObject::CreateObjectSpecificProperties()
{
+ return new sdr::properties::E3dProperties(*this);
}
-E3dObjList::E3dObjList(const E3dObjList& rSrcList)
-: SdrObjList(rSrcList)
-{
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
-E3dObjList::~E3dObjList()
+E3dObject::E3dObject(SdrModel& rSdrModel)
+: SdrAttrObj(rSdrModel),
+ maLocalBoundVol(),
+ maTransformation(),
+ maFullTransform(),
+ mbTfHasChanged(true),
+ mbIsSelected(false)
{
}
-void E3dObjList::NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos, const SdrInsertReason* pReason)
+bool E3dObject::IsClosedObj() const
{
- // Owner holen
- DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "AW: Einfuegen 3DObject in Parent != 3DObject");
-
- // Ist es ueberhaupt ein 3D-Objekt?
- if(pObj && pObj->ISA(E3dObject))
- {
- // Normales 3D Objekt, einfuegen mittels
- // call parent
- SdrObjList::NbcInsertObject(pObj, nPos, pReason);
- }
- else
- {
- // Kein 3D Objekt, fuege in Seite statt in Szene ein...
- GetOwnerObj()->GetPage()->InsertObject(pObj, nPos);
- }
+ return true;
}
-void E3dObjList::InsertObject(SdrObject* pObj, sal_uIntPtr nPos, const SdrInsertReason* pReason)
-{
- OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "Insert 3DObject in non-3D Parent");
- //E3DModifySceneSnapRectUpdater aUpdater(GetOwnerObj());
-
- // call parent
- SdrObjList::InsertObject(pObj, nPos, pReason);
+/*************************************************************************
+|*
+|* Destruktor
+|*
+\************************************************************************/
- E3dScene* pScene = ((E3dObject*)GetOwnerObj())->GetScene();
- if(pScene)
- {
- pScene->Cleanup3DDepthMapper();
- }
+E3dObject::~E3dObject()
+{
}
-SdrObject* E3dObjList::NbcRemoveObject(sal_uIntPtr nObjNum)
+void E3dObject::copyDataFromSdrObject(const SdrObject& rSource)
{
- DBG_ASSERT(GetOwnerObj()->ISA(E3dObject), "AW: Entfernen 3DObject aus Parent != 3DObject");
- //E3DModifySceneSnapRectUpdater aUpdater(GetOwnerObj());
-
- // call parent
- SdrObject* pRetval = SdrObjList::NbcRemoveObject(nObjNum);
-
- E3dScene* pScene = ((E3dObject*)GetOwnerObj())->GetScene();
- if(pScene)
+ if(this != &rSource)
{
- pScene->Cleanup3DDepthMapper();
- }
+ const E3dObject* pSource = dynamic_cast< const E3dObject* >(&rSource);
- return pRetval;
-}
+ if(pSource)
+ {
+ // call parent
+ SdrAttrObj::copyDataFromSdrObject(rSource);
-SdrObject* E3dObjList::RemoveObject(sal_uIntPtr nObjNum)
-{
- OSL_ENSURE(GetOwnerObj()->ISA(E3dObject), "3DObject is removed from non-3D Parent");
- //E3DModifySceneSnapRectUpdater aUpdater(GetOwnerObj());
+ // BoundVol can b
+ maLocalBoundVol = pSource->maLocalBoundVol;
+ maTransformation = pSource->maTransformation;
- // call parent
- SdrObject* pRetval = SdrObjList::RemoveObject(nObjNum);
+ // Da sich der Parent geaendert haben kann, Gesamttransformation beim
+ // naechsten Mal auf jeden Fall neu bestimmen
+ SetTransformChanged();
- E3dScene* pScene = ((E3dObject*)GetOwnerObj())->GetScene();
- if(pScene)
- {
- pScene->Cleanup3DDepthMapper();
+ // Selektionsstatus kopieren
+ mbIsSelected = pSource->mbIsSelected;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
}
-
- return pRetval;
}
-/*************************************************************************
-|*
-|* Konstruktor
-|*
-\************************************************************************/
-
-//////////////////////////////////////////////////////////////////////////////
-
-sdr::properties::BaseProperties* E3dObject::CreateObjectSpecificProperties()
+SdrObject* E3dObject::CloneSdrObject(SdrModel* pTargetModel) const
{
- return new sdr::properties::E3dProperties(*this);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ E3dObject* pClone = new E3dObject(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
-TYPEINIT1(E3dObject, SdrAttrObj);
-
-E3dObject::E3dObject()
-: maSubList(),
- maLocalBoundVol(),
- maTransformation(),
- maFullTransform(),
- mbTfHasChanged(true),
- mbIsSelected(false)
-{
- bIs3DObj = true;
- maSubList.SetOwnerObj(this);
- maSubList.SetListKind(SDROBJLIST_GROUPOBJ);
- bClosedObj = true;
+ return pClone;
}
/*************************************************************************
|*
-|* Destruktor
+|* Selektions-Flag setzen
|*
\************************************************************************/
-E3dObject::~E3dObject()
+bool E3dObject::IsE3dObject() const
{
+ return true;
}
-/*************************************************************************
-|*
-|* Selektions-Flag setzen
-|*
-\************************************************************************/
-
void E3dObject::SetSelected(bool bNew)
{
if((bool)mbIsSelected != bNew)
{
mbIsSelected = bNew;
}
-
- for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
- {
- E3dObject* pCandidate = dynamic_cast< E3dObject* >(maSubList.GetObj(a));
-
- if(pCandidate)
- {
- pCandidate->SetSelected(bNew);
- }
- }
}
/*************************************************************************
@@ -264,28 +200,6 @@ SdrAttrObj* E3dObject::GetBreakObj()
/*************************************************************************
|*
-|* SetRectsDirty muss ueber die lokale SdrSubList gehen
-|*
-\************************************************************************/
-
-void E3dObject::SetRectsDirty(sal_Bool bNotMyself)
-{
- // call parent
- SdrAttrObj::SetRectsDirty(bNotMyself);
-
- for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
- {
- E3dObject* pCandidate = dynamic_cast< E3dObject* >(maSubList.GetObj(a));
-
- if(pCandidate)
- {
- pCandidate->SetRectsDirty(bNotMyself);
- }
- }
-}
-
-/*************************************************************************
-|*
|* Inventor zurueckgeben
|*
\************************************************************************/
@@ -303,7 +217,8 @@ sal_uInt32 E3dObject::GetObjInventor() const
sal_uInt16 E3dObject::GetObjIdentifier() const
{
- return E3D_OBJECT_ID;
+ OSL_ENSURE(false, "E3dObject is a helper class, it should never be incarnated (!)");
+ return SdrAttrObj::GetObjIdentifier();
}
/*************************************************************************
@@ -314,24 +229,24 @@ sal_uInt16 E3dObject::GetObjIdentifier() const
void E3dObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bResizeFreeAllowed = sal_True;
- rInfo.bResizePropAllowed = sal_True;
- rInfo.bRotateFreeAllowed = sal_True;
- rInfo.bRotate90Allowed = sal_True;
- rInfo.bMirrorFreeAllowed = sal_False;
- rInfo.bMirror45Allowed = sal_False;
- rInfo.bMirror90Allowed = sal_False;
- rInfo.bShearAllowed = sal_False;
- rInfo.bEdgeRadiusAllowed = sal_False;
- rInfo.bCanConvToPath = sal_False;
+ rInfo.mbResizeFreeAllowed = true;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = true;
+ rInfo.mbRotate90Allowed = true;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbMirror45Allowed = false;
+ rInfo.mbMirror90Allowed = false;
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbCanConvToPath = false;
// no transparence for 3d objects
- rInfo.bTransparenceAllowed = sal_False;
+ rInfo.mbTransparenceAllowed = false;
// gradient depends on fillstyle
// BM *** check if SetItem is NULL ***
XFillStyle eFillStyle = ((XFillStyleItem&)(GetMergedItem(XATTR_FILLSTYLE))).GetValue();
- rInfo.bGradientAllowed = (eFillStyle == XFILL_GRADIENT);
+ rInfo.mbGradientAllowed = (eFillStyle == XFILL_GRADIENT);
// Umwandeln von 3D-Koerpern in Gruppe von Polygonen:
//
@@ -340,207 +255,10 @@ void E3dObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
// also bei Durchdringugnen auch gegeneinander geschnitten werden
// muessten. Auch die Texturkoorinaten waeren ein ungeloestes
// Problem.
- rInfo.bCanConvToPoly = sal_False;
- rInfo.bCanConvToContour = sal_False;
- rInfo.bCanConvToPathLineToArea = sal_False;
- rInfo.bCanConvToPolyLineToArea = sal_False;
-}
-
-/*************************************************************************
-|*
-|* Layer setzen
-|*
-\************************************************************************/
-
-void E3dObject::NbcSetLayer(SdrLayerID nLayer)
-{
- SdrAttrObj::NbcSetLayer(nLayer);
-
- for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
- {
- E3dObject* pCandidate = dynamic_cast< E3dObject* >(maSubList.GetObj(a));
-
- if(pCandidate)
- {
- pCandidate->NbcSetLayer(nLayer);
- }
- }
-}
-
-/*************************************************************************
-|*
-|* ObjList auch an SubList setzen
-|*
-\************************************************************************/
-
-void E3dObject::SetObjList(SdrObjList* pNewObjList)
-{
- SdrObject::SetObjList(pNewObjList);
- maSubList.SetUpList(pNewObjList);
-}
-
-/*************************************************************************
-|*
-|* Layer setzen
-|*
-\************************************************************************/
-
-void E3dObject::SetPage(SdrPage* pNewPage)
-{
- SdrAttrObj::SetPage(pNewPage);
- maSubList.SetPage(pNewPage);
-}
-
-/*************************************************************************
-|*
-|* Layer setzen
-|*
-\************************************************************************/
-
-void E3dObject::SetModel(SdrModel* pNewModel)
-{
- SdrAttrObj::SetModel(pNewModel);
- maSubList.SetModel(pNewModel);
-}
-
-/*************************************************************************
-|*
-|* resize object, used from old 2d interfaces, e.g. in Move/Scale dialog
-|* (F4)
-|*
-\************************************************************************/
-void E3dObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- // Bewegung in X,Y im Augkoordinatensystem
- E3dScene* pScene = GetScene();
-
- if(pScene)
- {
- // transform pos from 2D world to 3D eye
- const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
- basegfx::B2DPoint aScaleCenter2D((double)rRef.X(), (double)rRef.Y());
- basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
-
- aInverseSceneTransform.invert();
- aScaleCenter2D = aInverseSceneTransform * aScaleCenter2D;
-
- basegfx::B3DPoint aScaleCenter3D(aScaleCenter2D.getX(), aScaleCenter2D.getY(), 0.5);
- basegfx::B3DHomMatrix aInverseViewToEye(aViewInfo3D.getDeviceToView() * aViewInfo3D.getProjection());
-
- aInverseViewToEye.invert();
- aScaleCenter3D = aInverseViewToEye * aScaleCenter3D;
-
- // scale-faktoren holen
- double fScaleX(xFact);
- double fScaleY(yFact);
-
- // build transform
- basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
- aInverseOrientation.invert();
- basegfx::B3DHomMatrix mFullTransform(GetFullTransform());
- basegfx::B3DHomMatrix mTrans(mFullTransform);
-
- mTrans *= aViewInfo3D.getOrientation();
- mTrans.translate(-aScaleCenter3D.getX(), -aScaleCenter3D.getY(), -aScaleCenter3D.getZ());
- mTrans.scale(fScaleX, fScaleY, 1.0);
- mTrans.translate(aScaleCenter3D.getX(), aScaleCenter3D.getY(), aScaleCenter3D.getZ());
- mTrans *= aInverseOrientation;
- mFullTransform.invert();
- mTrans *= mFullTransform;
-
- // anwenden
- basegfx::B3DHomMatrix mObjTrans(GetTransform());
- mObjTrans *= mTrans;
-
- E3DModifySceneSnapRectUpdater aUpdater(this);
- SetTransform(mObjTrans);
- }
-}
-
-/*************************************************************************
-|*
-|* Objekt verschieben in 2D, wird bei Cursortasten benoetigt
-|*
-\************************************************************************/
-void E3dObject::NbcMove(const Size& rSize)
-{
- // Bewegung in X,Y im Augkoordinatensystem
- E3dScene* pScene = GetScene();
-
- if(pScene)
- {
- // Abmessungen der Szene in 3D und 2D als Vergleich
- Rectangle aRect = pScene->GetSnapRect();
-
- // Transformation Weltkoordinaten bis eine VOR Objektkoordinaten holen
- basegfx::B3DHomMatrix mInvDispTransform;
- if(GetParentObj())
- {
- mInvDispTransform = GetParentObj()->GetFullTransform();
- mInvDispTransform.invert();
- }
-
- // BoundVolume from 3d world to 3d eye
- const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
- const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
- basegfx::B3DRange aEyeVol(pScene->GetBoundVolume());
- aEyeVol.transform(aViewInfo3D.getOrientation());
-
- // build relative movement vector in eye coordinates
- basegfx::B3DPoint aMove(
- (double)rSize.Width() * aEyeVol.getWidth() / (double)aRect.GetWidth(),
- (double)-rSize.Height() * aEyeVol.getHeight() / (double)aRect.GetHeight(),
- 0.0);
- basegfx::B3DPoint aPos(0.0, 0.0, 0.0);
-
- // movement vektor to local coordinates of objects' parent
- basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
- aInverseOrientation.invert();
- basegfx::B3DHomMatrix aCompleteTrans(mInvDispTransform * aInverseOrientation);
-
- aMove = aCompleteTrans * aMove;
- aPos = aCompleteTrans * aPos;
-
- // build transformation and apply
- basegfx::B3DHomMatrix aTranslate;
- aTranslate.translate(aMove.getX() - aPos.getX(), aMove.getY() - aPos.getY(), aMove.getZ() - aPos.getZ());
-
- E3DModifySceneSnapRectUpdater aUpdater(pScene);
- SetTransform(aTranslate * GetTransform());
- }
-}
-
-/*************************************************************************
-|*
-|* liefere die Sublist, aber nur dann, wenn darin Objekte enthalten sind !
-|*
-\************************************************************************/
-
-SdrObjList* E3dObject::GetSubList() const
-{
- return &(const_cast< E3dObjList& >(maSubList));
-}
-
-/*************************************************************************
-|*
-|* SnapRect berechnen
-|*
-\************************************************************************/
-
-void E3dObject::RecalcSnapRect()
-{
- maSnapRect = Rectangle();
-
- for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
- {
- E3dObject* pCandidate = dynamic_cast< E3dObject* >(maSubList.GetObj(a));
-
- if(pCandidate)
- {
- maSnapRect.Union(pCandidate->GetSnapRect());
- }
- }
+ rInfo.mbCanConvToPoly = false;
+ rInfo.mbCanConvToContour = false;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
}
/*************************************************************************
@@ -551,10 +269,10 @@ void E3dObject::RecalcSnapRect()
|*
\************************************************************************/
-void E3dObject::NewObjectInserted(const E3dObject* p3DObj)
+void E3dObject::NewObjectInserted(const E3dObject& r3DObj)
{
if(GetParentObj())
- GetParentObj()->NewObjectInserted(p3DObj);
+ GetParentObj()->NewObjectInserted(r3DObj);
}
/*************************************************************************
@@ -576,38 +294,6 @@ void E3dObject::StructureChanged()
/*************************************************************************
|*
-|* 3D-Objekt einfuegen
-|*
-\************************************************************************/
-
-void E3dObject::Insert3DObj(E3dObject* p3DObj)
-{
- DBG_ASSERT(p3DObj, "Insert3DObj mit NULL-Zeiger!");
- SdrPage* pPg = pPage;
- maSubList.InsertObject(p3DObj);
- pPage = pPg;
- InvalidateBoundVolume();
- NewObjectInserted(p3DObj);
- StructureChanged();
-}
-
-void E3dObject::Remove3DObj(E3dObject* p3DObj)
-{
- DBG_ASSERT(p3DObj, "Remove3DObj mit NULL-Zeiger!");
-
- if(p3DObj->GetParentObj() == this)
- {
- SdrPage* pPg = pPage;
- maSubList.RemoveObject(p3DObj->GetOrdNum());
- pPage = pPg;
-
- InvalidateBoundVolume();
- StructureChanged();
- }
-}
-
-/*************************************************************************
-|*
|* Parent holen
|*
\************************************************************************/
@@ -616,10 +302,11 @@ E3dObject* E3dObject::GetParentObj() const
{
E3dObject* pRetval = NULL;
- if(GetObjList()
- && GetObjList()->GetOwnerObj()
- && GetObjList()->GetOwnerObj()->ISA(E3dObject))
- pRetval = ((E3dObject*)GetObjList()->GetOwnerObj());
+ if(getParentOfSdrObject())
+ {
+ pRetval = dynamic_cast< E3dObject* >(getParentOfSdrObject()->getSdrObjectFromSdrObjList());
+ }
+
return pRetval;
}
@@ -631,8 +318,13 @@ E3dObject* E3dObject::GetParentObj() const
E3dScene* E3dObject::GetScene() const
{
- if(GetParentObj())
- return GetParentObj()->GetScene();
+ E3dObject* pParent = GetParentObj();
+
+ if(pParent)
+ {
+ return pParent->GetScene();
+ }
+
return NULL;
}
@@ -645,40 +337,20 @@ E3dScene* E3dObject::GetScene() const
basegfx::B3DRange E3dObject::RecalcBoundVolume() const
{
basegfx::B3DRange aRetval;
- const sal_uInt32 nObjCnt(maSubList.GetObjCount());
-
- if(nObjCnt)
- {
- for(sal_uInt32 a(0); a < nObjCnt; a++)
- {
- const E3dObject* p3DObject = dynamic_cast< const E3dObject* >(maSubList.GetObj(a));
+ const sdr::contact::ViewContactOfE3d* pVCOfE3D = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&GetViewContact());
- if(p3DObject)
- {
- basegfx::B3DRange aLocalRange(p3DObject->GetBoundVolume());
- aLocalRange.transform(p3DObject->GetTransform());
- aRetval.expand(aLocalRange);
- }
- }
- }
- else
+ if(pVCOfE3D)
{
- // single 3D object
- const sdr::contact::ViewContactOfE3d* pVCOfE3D = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&GetViewContact());
+ // BoundVolume is without 3D object transformation, use correct sequence
+ const drawinglayer::primitive3d::Primitive3DSequence xLocalSequence(pVCOfE3D->getVIP3DSWithoutObjectTransform());
- if(pVCOfE3D)
+ if(xLocalSequence.hasElements())
{
- // BoundVolume is without 3D object transformation, use correct sequence
- const drawinglayer::primitive3d::Primitive3DSequence xLocalSequence(pVCOfE3D->getVIP3DSWithoutObjectTransform());
+ const uno::Sequence< beans::PropertyValue > aEmptyParameters;
+ const drawinglayer::geometry::ViewInformation3D aLocalViewInformation3D(aEmptyParameters);
- if(xLocalSequence.hasElements())
- {
- const uno::Sequence< beans::PropertyValue > aEmptyParameters;
- const drawinglayer::geometry::ViewInformation3D aLocalViewInformation3D(aEmptyParameters);
-
- aRetval = drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(
- xLocalSequence, aLocalViewInformation3D);
- }
+ aRetval = drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(
+ xLocalSequence, aLocalViewInformation3D);
}
}
@@ -715,16 +387,6 @@ void E3dObject::InvalidateBoundVolume()
void E3dObject::SetBoundVolInvalid()
{
InvalidateBoundVolume();
-
- for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
- {
- E3dObject* pCandidate = dynamic_cast< E3dObject* >(maSubList.GetObj(a));
-
- if(pCandidate)
- {
- pCandidate->SetBoundVolInvalid();
- }
- }
}
/*************************************************************************
@@ -737,16 +399,6 @@ void E3dObject::SetTransformChanged()
{
InvalidateBoundVolume();
mbTfHasChanged = true;
-
- for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
- {
- E3dObject* pCandidate = dynamic_cast< E3dObject* >(maSubList.GetObj(a));
-
- if(pCandidate)
- {
- pCandidate->SetTransformChanged();
- }
- }
}
/*************************************************************************
@@ -780,7 +432,7 @@ const basegfx::B3DHomMatrix& E3dObject::GetFullTransform() const
|*
\************************************************************************/
-const basegfx::B3DHomMatrix& E3dObject::GetTransform() const
+const basegfx::B3DHomMatrix& E3dObject::GetB3DTransform() const
{
return maTransformation;
}
@@ -791,31 +443,16 @@ const basegfx::B3DHomMatrix& E3dObject::GetTransform() const
|*
\************************************************************************/
-void E3dObject::NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix)
+void E3dObject::SetB3DTransform(const basegfx::B3DHomMatrix& rMatrix)
{
if(maTransformation != rMatrix)
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
maTransformation = rMatrix;
SetTransformChanged();
StructureChanged();
- }
-}
-
-/*************************************************************************
-|*
-|* Transformationsmatrix setzen mit Repaint-Broadcast
-|*
-\************************************************************************/
-
-void E3dObject::SetTransform(const basegfx::B3DHomMatrix& rMatrix)
-{
- if(rMatrix != maTransformation)
- {
- // #110094#-14 SendRepaintBroadcast();
- NbcSetTransform(rMatrix);
SetChanged();
- BroadcastObjectChange();
- if (pUserCall != NULL) pUserCall->Changed(*this, SDRUSERCALL_RESIZE, Rectangle());
}
}
@@ -865,34 +502,6 @@ void E3dObject::TakeObjNamePlural(XubString& rName) const
/*************************************************************************
|*
-|* Zuweisungsoperator
-|*
-\************************************************************************/
-
-void E3dObject::operator=(const SdrObject& rObj)
-{
- SdrObject::operator=(rObj);
-
- const E3dObject& r3DObj = (const E3dObject&) rObj;
- if (r3DObj.GetSubList())
- {
- maSubList.CopyObjects(*r3DObj.GetSubList());
- }
-
- // BoundVol kann uebernommen werden, da die Childs auch kopiert werden
- maLocalBoundVol = r3DObj.maLocalBoundVol;
- maTransformation = r3DObj.maTransformation;
-
- // Da sich der Parent geaendert haben kann, Gesamttransformation beim
- // naechsten Mal auf jeden Fall neu bestimmen
- SetTransformChanged();
-
- // Selektionsstatus kopieren
- mbIsSelected = r3DObj.mbIsSelected;
-}
-
-/*************************************************************************
-|*
|* erstelle neues GeoData-Objekt
|*
\************************************************************************/
@@ -928,42 +537,10 @@ void E3dObject::RestGeoData(const SdrObjGeoData& rGeo)
{
maLocalBoundVol = ((E3DObjGeoData &) rGeo).maLocalBoundVol;
E3DModifySceneSnapRectUpdater aUpdater(this);
- NbcSetTransform(((E3DObjGeoData &) rGeo).maTransformation);
+ SetB3DTransform(((E3DObjGeoData &) rGeo).maTransformation);
SdrAttrObj::RestGeoData (rGeo);
}
-/*************************************************************************
-|*
-|* Rotation eines 3d-Koerpers
-|*
-\************************************************************************/
-// 2D-rotation eines 3D-Koerpers, normalerweise macht das die Szene selbst
-// Ist aber eine korrekte Implementierung, denn alles was passiert ist eine
-// Rotation um die Achse die senkrecht auf dem Bildschirm steht und zwar
-// unabhaengig davon, wie die Szene bisher gedreht worden ist.
-
-void E3dObject::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
-{
- // Also derzeit sind die Klebepunkte relativ zum aOutRect der Szene definiert. Vor dem Drehen
- // werden die Klebepunkte relativ zur Seite definiert. Sie nehmen an der Drehung der Szene noch nicht Teil
- // dafuer gibt es den
- SetGlueReallyAbsolute(sal_True);
-
- // SendRepaintBroadcast();
- double fWinkelInRad = nWink/100 * F_PI180;
-
- basegfx::B3DHomMatrix aRotateZ;
- aRotateZ.rotate(0.0, 0.0, fWinkelInRad);
- NbcSetTransform(aRotateZ * GetTransform());
-
- SetRectsDirty(); // Veranlasst eine Neuberechnung aller BoundRects
- NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotiert die Klebepunkte (die haben noch Koordinaten relativ
- // zum Urpsung des Blattes
- SetGlueReallyAbsolute(sal_False); // ab jetzt sind sie wieder relativ zum BoundRect (also dem aOutRect definiert)
-}
-
-/*************************************************************************/
-
//////////////////////////////////////////////////////////////////////////////
sdr::properties::BaseProperties* E3dCompoundObject::CreateObjectSpecificProperties()
@@ -973,27 +550,8 @@ sdr::properties::BaseProperties* E3dCompoundObject::CreateObjectSpecificProperti
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(E3dCompoundObject, E3dObject);
-
-/*************************************************************************
-|*
-|* Konstruktor
-|*
-\************************************************************************/
-
-E3dCompoundObject::E3dCompoundObject()
-: E3dObject(),
- aMaterialAmbientColor(),
- bCreateNormals(false),
- bCreateTexture(false)
-{
- // Defaults setzen
- E3dDefaultAttributes aDefault;
- SetDefaultAttributes(aDefault);
-}
-
-E3dCompoundObject::E3dCompoundObject(E3dDefaultAttributes& rDefault)
-: E3dObject(),
+E3dCompoundObject::E3dCompoundObject(SdrModel& rSdrModel, const E3dDefaultAttributes& rDefault)
+: E3dObject(rSdrModel),
aMaterialAmbientColor(),
bCreateNormals(false),
bCreateTexture(false)
@@ -1002,7 +560,7 @@ E3dCompoundObject::E3dCompoundObject(E3dDefaultAttributes& rDefault)
SetDefaultAttributes(rDefault);
}
-void E3dCompoundObject::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dCompoundObject::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
// Defaults setzen
aMaterialAmbientColor = rDefault.GetDefaultAmbientColor();
@@ -1021,6 +579,49 @@ E3dCompoundObject::~E3dCompoundObject ()
{
}
+void E3dCompoundObject::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const E3dCompoundObject* pSource = dynamic_cast< const E3dCompoundObject* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ E3dObject::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ bCreateNormals = pSource->bCreateNormals;
+ bCreateTexture = pSource->bCreateTexture;
+ aMaterialAmbientColor = pSource->aMaterialAmbientColor;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+void E3dCompoundObject::InvalidateBoundVolume()
+{
+ // call parent
+ E3dObject::InvalidateBoundVolume();
+
+ // reset 2D object transformation to flag that it has changed
+ maSdrObjectTransformation.setB2DHomMatrix(basegfx::B2DHomMatrix());
+}
+
+SdrObject* E3dCompoundObject::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ E3dCompoundObject* pClone = new E3dCompoundObject(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ E3dDefaultAttributes());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
/*************************************************************************
|*
|* Drag-Polygon zurueckgeben
@@ -1039,7 +640,7 @@ basegfx::B2DPolyPolygon E3dCompoundObject::TakeXorPoly() const
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
const basegfx::B3DPolyPolygon aCubePolyPolygon(CreateWireframe());
aRetval = basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aCubePolyPolygon,
- aViewInfo3D.getObjectToView() * GetTransform());
+ aViewInfo3D.getObjectToView() * GetB3DTransform());
aRetval.transform(rVCScene.getObjectTransformation());
}
@@ -1048,18 +649,6 @@ basegfx::B2DPolyPolygon E3dCompoundObject::TakeXorPoly() const
/*************************************************************************
|*
-|* Anzahl der Handles zurueckgeben
-|*
-\************************************************************************/
-
-sal_uInt32 E3dCompoundObject::GetHdlCount() const
-{
- // 8 Eckpunkte + 1 E3dVolumeMarker (= Wireframe-Darstellung)
- return 9L;
-}
-
-/*************************************************************************
-|*
|* Handle-Liste fuellen
|*
\************************************************************************/
@@ -1095,7 +684,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const
}
// to 3d view coor
- aPos3D *= aViewInfo3D.getObjectToView() * GetTransform();
+ aPos3D *= aViewInfo3D.getObjectToView() * GetB3DTransform();
// create 2d relative scene
basegfx::B2DPoint aPos2D(aPos3D.getX(), aPos3D.getY());
@@ -1103,7 +692,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const
// to 2d world coor
aPos2D *= rVCScene.getObjectTransformation();
- rHdlList.AddHdl(new SdrHdl(Point(basegfx::fround(aPos2D.getX()), basegfx::fround(aPos2D.getY())), HDL_BWGT));
+ new SdrHdl(rHdlList, pRootScene, HDL_BWGT, aPos2D);
}
}
}
@@ -1112,8 +701,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const
if(aPolyPolygon.count())
{
- E3dVolumeMarker* pVolMarker = new E3dVolumeMarker(aPolyPolygon);
- rHdlList.AddHdl(pVolMarker);
+ new E3dVolumeMarker(rHdlList, pRootScene, aPolyPolygon);
}
}
@@ -1125,7 +713,8 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const
sal_uInt16 E3dCompoundObject::GetObjIdentifier() const
{
- return E3D_COMPOUNDOBJ_ID;
+ OSL_ENSURE(false, "E3dCompoundObject is a helper class, it should never be incarnated (!)");
+ return SdrAttrObj::GetObjIdentifier();
}
/*************************************************************************
@@ -1134,67 +723,139 @@ sal_uInt16 E3dCompoundObject::GetObjIdentifier() const
|*
\************************************************************************/
-void E3dCompoundObject::RecalcSnapRect()
+const basegfx::B2DHomMatrix& E3dCompoundObject::getSdrObjectTransformation() const
{
- const uno::Sequence< beans::PropertyValue > aEmptyParameters;
- drawinglayer::geometry::ViewInformation3D aViewInfo3D(aEmptyParameters);
- E3dScene* pRootScene = fillViewInformation3DForCompoundObject(aViewInfo3D, *this);
- maSnapRect = Rectangle();
-
- if(pRootScene)
+ // Transformation is size (scale) and position (translation) of content
+ // of all sub-objects combined. To not always create this, use isIdentity() as
+ // hint for recalculation
+ // TTTT: look for correct place to set to identity
+ // TTTT: Added InvalidateBoundVolume to E3dCompoundObject to do the job, check
+ if(maSdrObjectTransformation.getB2DHomMatrix().isIdentity())
{
- // get VC of 3D candidate
- const sdr::contact::ViewContactOfE3d* pVCOfE3D = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&GetViewContact());
+ const uno::Sequence< beans::PropertyValue > aEmptyParameters;
+ drawinglayer::geometry::ViewInformation3D aViewInfo3D(aEmptyParameters);
+ E3dScene* pRootScene = fillViewInformation3DForCompoundObject(aViewInfo3D, *this);
- if(pVCOfE3D)
+ if(pRootScene)
{
- // get 3D primitive sequence
- const drawinglayer::primitive3d::Primitive3DSequence xLocalSequence(pVCOfE3D->getViewIndependentPrimitive3DSequence());
+ // get VC of 3D candidate
+ const sdr::contact::ViewContactOfE3d* pVCOfE3D = dynamic_cast< const sdr::contact::ViewContactOfE3d* >(&GetViewContact());
- if(xLocalSequence.hasElements())
+ if(pVCOfE3D)
{
- // get BoundVolume
- basegfx::B3DRange aBoundVolume(drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(
- xLocalSequence, aViewInfo3D));
-
- // transform bound volume to relative scene coordinates
- aBoundVolume.transform(aViewInfo3D.getObjectToView());
-
- // build 2d relative scene range
- basegfx::B2DRange aSnapRange(
- aBoundVolume.getMinX(), aBoundVolume.getMinY(),
- aBoundVolume.getMaxX(), aBoundVolume.getMaxY());
-
- // transform to 2D world coordiantes
- const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
- aSnapRange.transform(rVCScene.getObjectTransformation());
-
- // snap to integer
- maSnapRect = Rectangle(
- sal_Int32(floor(aSnapRange.getMinX())), sal_Int32(floor(aSnapRange.getMinY())),
- sal_Int32(ceil(aSnapRange.getMaxX())), sal_Int32(ceil(aSnapRange.getMaxY())));
+ // get 3D primitive sequence
+ const drawinglayer::primitive3d::Primitive3DSequence xLocalSequence(pVCOfE3D->getViewIndependentPrimitive3DSequence());
+
+ if(xLocalSequence.hasElements())
+ {
+ // get BoundVolume
+ basegfx::B3DRange aBoundVolume(drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(
+ xLocalSequence, aViewInfo3D));
+
+ // transform bound volume to relative scene coordinates
+ aBoundVolume.transform(aViewInfo3D.getObjectToView());
+
+ // build 2D relative scene range
+ basegfx::B2DRange aSnapRange(
+ aBoundVolume.getMinX(), aBoundVolume.getMinY(),
+ aBoundVolume.getMaxX(), aBoundVolume.getMaxY());
+
+ // transform to 2D world coordiantes
+ const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
+ aSnapRange.transform(rVCScene.getObjectTransformation());
+
+ // compose local transformation
+ const_cast< E3dCompoundObject* >(this)->maSdrObjectTransformation.setB2DHomMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSnapRange.getRange(),
+ aSnapRange.getMinimum()));
+ }
}
}
}
-}
-/*************************************************************************
-|*
-|* Copy-Operator
-|*
-\************************************************************************/
+ // call parent
+ return E3dObject::getSdrObjectTransformation();
+}
-void E3dCompoundObject::operator=(const SdrObject& rObj)
+void E3dCompoundObject::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- // erstmal alle Childs kopieren
- E3dObject::operator=(rObj);
+ // create a transformation to the 3D EyeCoordinateSystem and apply the 2D transformation there
+ const E3dScene* pScene = GetScene();
+
+ if(pScene && !rTransformation.isIdentity())
+ {
+ // create relative transformation from current state
+ basegfx::B2DHomMatrix a2DSubTrans(getSdrObjectTransformation());
+ a2DSubTrans.invert();
+ a2DSubTrans = rTransformation * a2DSubTrans;
+
+ // transform from 2D world to to 2D scene-local coordinates
+ const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pScene->GetViewContact());
+ basegfx::B2DHomMatrix aInverseSceneTransform(rVCScene.getObjectTransformation());
+ aInverseSceneTransform.invert();
+ a2DSubTrans = aInverseSceneTransform * a2DSubTrans;
- // weitere Parameter kopieren
- const E3dCompoundObject& r3DObj = (const E3dCompoundObject&) rObj;
+ // extract 2D transform components and apply to 3D matrix for further transformation
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
+ double fRotate, fShearX;
+ basegfx::B3DHomMatrix a3DSubTrans;
+ a2DSubTrans.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ if(!aScale.equal(basegfx::B2DTuple(1.0, 1.0)))
+ {
+ a3DSubTrans.scale(aScale.getX(), aScale.getY(), 1.0);
+ }
+
+ if(!basegfx::fTools::equalZero(fShearX))
+ {
+ a3DSubTrans.shearXZ(fShearX, 0.0);
+ }
+
+ if(!basegfx::fTools::equalZero(fRotate))
+ {
+ a3DSubTrans.rotate(0.0, 0.0, fRotate);
+ }
+
+ if(!aTranslate.equal(basegfx::B2DTuple(0.0, 0.0)))
+ {
+ a3DSubTrans.translate(aTranslate.getX(), aTranslate.getY(), 0.0);
+ }
- bCreateNormals = r3DObj.bCreateNormals;
- bCreateTexture = r3DObj.bCreateTexture;
- aMaterialAmbientColor = r3DObj.aMaterialAmbientColor;
+ // transform from 2D scene-local to 3D eye coordinates
+ const drawinglayer::geometry::ViewInformation3D aViewInfo3D(rVCScene.getViewInformation3D());
+ basegfx::B3DHomMatrix aInverseViewToEye(aViewInfo3D.getDeviceToView() * aViewInfo3D.getProjection());
+ aInverseViewToEye.invert();
+ a3DSubTrans = aInverseViewToEye * a3DSubTrans;
+
+ // build transform between object-local 3D and 3D eye coordinates
+ basegfx::B3DHomMatrix aInverseOrientation(aViewInfo3D.getOrientation());
+ aInverseOrientation.invert();
+ basegfx::B3DHomMatrix mFullTransform(GetFullTransform());
+ basegfx::B3DHomMatrix mTrans(mFullTransform);
+
+ // build combined transformation
+ mTrans *= aViewInfo3D.getOrientation();
+
+ // apply adapted object-transformation
+ mTrans = a3DSubTrans * mTrans;
+
+ // transform to object.local coordinates
+ mTrans *= aInverseOrientation;
+ mFullTransform.invert();
+ mTrans *= mFullTransform;
+
+ // apply to 3D object
+ basegfx::B3DHomMatrix mObjTrans(GetB3DTransform());
+ mObjTrans *= mTrans;
+
+ E3DModifySceneSnapRectUpdater aUpdater(this);
+ SetB3DTransform(mObjTrans);
+ }
+
+ // reset local transformation
+ maSdrObjectTransformation.setB2DHomMatrix(basegfx::B2DHomMatrix());
}
/*************************************************************************
@@ -1203,7 +864,7 @@ void E3dCompoundObject::operator=(const SdrObject& rObj)
|*
\************************************************************************/
-void E3dCompoundObject::SetCreateNormals(sal_Bool bNew)
+void E3dCompoundObject::SetCreateNormals(bool bNew)
{
if(bCreateNormals != bNew)
{
@@ -1212,7 +873,7 @@ void E3dCompoundObject::SetCreateNormals(sal_Bool bNew)
}
}
-void E3dCompoundObject::SetCreateTexture(sal_Bool bNew)
+void E3dCompoundObject::SetCreateTexture(bool bNew)
{
if(bCreateTexture != bNew)
{
@@ -1251,7 +912,7 @@ basegfx::B2DPolyPolygon E3dCompoundObject::TransformToScreenCoor(const basegfx::
if(pRootScene)
{
aRetval = basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(rCandidate,
- aViewInfo3D.getObjectToView() * GetTransform());
+ aViewInfo3D.getObjectToView() * GetB3DTransform());
const sdr::contact::ViewContactOfE3dScene& rVCScene = static_cast< sdr::contact::ViewContactOfE3dScene& >(pRootScene->GetViewContact());
aRetval.transform(rVCScene.getObjectTransformation());
}
@@ -1261,12 +922,14 @@ basegfx::B2DPolyPolygon E3dCompoundObject::TransformToScreenCoor(const basegfx::
sal_Bool E3dCompoundObject::IsAOrdNumRemapCandidate(E3dScene*& prScene) const
{
- if(GetObjList()
- && GetObjList()->GetOwnerObj()
- && GetObjList()->GetOwnerObj()->ISA(E3dScene))
+ if(getParentOfSdrObject())
{
- prScene = (E3dScene*)GetObjList()->GetOwnerObj();
- return sal_True;
+ prScene = dynamic_cast< E3dScene* >(getParentOfSdrObject()->getSdrObjectFromSdrObjList());
+
+ if(prScene)
+ {
+ return sal_True;
+ }
}
return sal_False;
diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx
index d6f97691bf2a..fbe6d3e44caf 100644
--- a/svx/source/engine3d/objfac3d.cxx
+++ b/svx/source/engine3d/objfac3d.cxx
@@ -19,13 +19,10 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/svdpage.hxx>
-#include "svx/globl3d.hxx"
-#include <svx/polysc3d.hxx>
+#include <svx/globl3d.hxx>
#include <svx/cube3d.hxx>
#include <svx/sphere3d.hxx>
#include <svx/extrud3d.hxx>
@@ -33,74 +30,87 @@
#include <svx/polygn3d.hxx>
#include "svx/objfac3d.hxx"
#include <svx/svdobj.hxx>
+#include <svx/sdrobjectfactory.hxx>
-/*************************************************************************
-|*
-|* Konstruktor
-|*
-\************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
-static sal_Bool bInit = sal_False;
+static bool bInit = false;
+
+//////////////////////////////////////////////////////////////////////////////
E3dObjFactory::E3dObjFactory()
{
if ( !bInit )
{
SdrObjFactory::InsertMakeObjectHdl(LINK(this, E3dObjFactory, MakeObject));
- bInit = sal_True;
+ bInit = true;
}
}
-/*************************************************************************
-|*
-|* Destruktor
-|*
-\************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
E3dObjFactory::~E3dObjFactory()
{
}
-/*************************************************************************
-|*
-|* Chart-interne Objekte erzeugen
-|*
-\************************************************************************/
+//////////////////////////////////////////////////////////////////////////////
IMPL_LINK( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
{
- if ( pObjFactory->nInventor == E3dInventor )
+ if ( E3dInventor == pObjFactory->getSdrObjectCreationInfo().getInvent() )
{
- switch ( pObjFactory->nIdentifier )
+ switch ( pObjFactory->getSdrObjectCreationInfo().getIdent() )
{
- case E3D_POLYSCENE_ID:
- pObjFactory->pNewObj = new E3dPolyScene();
- break;
case E3D_POLYGONOBJ_ID :
- pObjFactory->pNewObj = new E3dPolygonObj();
+ {
+ pObjFactory->setNewSdrObject(
+ new E3dPolygonObj(
+ pObjFactory->getTargetModel(),
+ E3dDefaultAttributes(),
+ basegfx::B3DPolyPolygon()));
break;
+ }
case E3D_CUBEOBJ_ID :
- pObjFactory->pNewObj = new E3dCubeObj();
+ {
+ pObjFactory->setNewSdrObject(
+ new E3dCubeObj(
+ pObjFactory->getTargetModel(),
+ E3dDefaultAttributes()));
break;
+ }
case E3D_SPHEREOBJ_ID:
- // FG: ruft den dummy constructor, da dieser Aufruf nur beim Laden von Dokumenten erfolgt.
- // die wirkliche Anzahkl Segmente wird aber erst nach dem Laden der Member festgelegt.
- // dies hat zur Folge das die erste Kugel gleich wieder zerstoert wird, obwohl sie nie
- // gebraucht worden ist.
- pObjFactory->pNewObj = new E3dSphereObj(123);
+ {
+ // FG: ruft den dummy constructor, da dieser Aufruf nur beim Laden von Dokumenten erfolgt.
+ // die wirkliche Anzahkl Segmente wird aber erst nach dem Laden der Member festgelegt.
+ // dies hat zur Folge das die erste Kugel gleich wieder zerstoert wird, obwohl sie nie
+ // gebraucht worden ist.
+ pObjFactory->setNewSdrObject(
+ new E3dSphereObj(
+ pObjFactory->getTargetModel(),
+ E3dDefaultAttributes()));
break;
+ }
case E3D_EXTRUDEOBJ_ID:
- pObjFactory->pNewObj = new E3dExtrudeObj();
+ {
+ pObjFactory->setNewSdrObject(
+ new E3dExtrudeObj(
+ pObjFactory->getTargetModel(),
+ E3dDefaultAttributes()));
break;
+ }
case E3D_LATHEOBJ_ID:
- pObjFactory->pNewObj = new E3dLatheObj();
- break;
- case E3D_COMPOUNDOBJ_ID:
- pObjFactory->pNewObj = new E3dCompoundObject();
+ {
+ pObjFactory->setNewSdrObject(
+ new E3dLatheObj(
+ pObjFactory->getTargetModel(),
+ E3dDefaultAttributes()));
break;
+ }
}
}
+
return 0;
}
-
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx
index c51c75f7269c..45cf92da5d6d 100644
--- a/svx/source/engine3d/polygn3d.cxx
+++ b/svx/source/engine3d/polygn3d.cxx
@@ -31,8 +31,6 @@
#include <basegfx/polygon/b3dpolygon.hxx>
#include <basegfx/polygon/b3dpolygontools.hxx>
-TYPEINIT1(E3dPolygonObj, E3dCompoundObject);
-
//////////////////////////////////////////////////////////////////////////////
// #110094# DrawContact section
@@ -41,82 +39,27 @@ sdr::contact::ViewContact* E3dPolygonObj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfE3dPolygon(*this);
}
-/*************************************************************************
-|*
-|* Konstruktor
-|*
-\************************************************************************/
-
-E3dPolygonObj::E3dPolygonObj(
- E3dDefaultAttributes& rDefault,
- const basegfx::B3DPolyPolygon& rPolyPoly3D,
- sal_Bool bLinOnly)
-: E3dCompoundObject(rDefault),
- bLineOnly(bLinOnly)
-{
- // Geometrie setzen
- SetPolyPolygon3D(rPolyPoly3D);
-
- // Default-Normals erzeugen
- CreateDefaultNormals();
-
- // Default-Texturkoordinaten erzeugen
- CreateDefaultTexture();
-}
-
-/*************************************************************************
-|*
-|* Konstruktor
-|*
-\************************************************************************/
-
-E3dPolygonObj::E3dPolygonObj(
- E3dDefaultAttributes& rDefault,
- const basegfx::B3DPolyPolygon& rPolyPoly3D,
- const basegfx::B3DPolyPolygon& rPolyNormals3D,
- sal_Bool bLinOnly)
-: E3dCompoundObject(rDefault),
- bLineOnly(bLinOnly)
-{
- // Geometrie und Normalen setzen
- SetPolyPolygon3D(rPolyPoly3D);
- SetPolyNormals3D(rPolyNormals3D);
-
- // Default-Texturkoordinaten erzeugen
- CreateDefaultTexture();
-}
-
-/*************************************************************************
-|*
-|* Konstruktor
-|*
-\************************************************************************/
-
E3dPolygonObj::E3dPolygonObj(
- E3dDefaultAttributes& rDefault,
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
const basegfx::B3DPolyPolygon& rPolyPoly3D,
- const basegfx::B3DPolyPolygon& rPolyNormals3D,
- const basegfx::B2DPolyPolygon& rPolyTexture2D,
- sal_Bool bLinOnly)
-: E3dCompoundObject(rDefault),
+ const basegfx::B3DPolyPolygon* pPolyNormals3D,
+ const basegfx::B2DPolyPolygon* pPolyTexture2D,
+ bool bLinOnly)
+: E3dCompoundObject(rSdrModel, rDefault),
bLineOnly(bLinOnly)
{
SetPolyPolygon3D(rPolyPoly3D);
- SetPolyNormals3D(rPolyNormals3D);
- SetPolyTexture2D(rPolyTexture2D);
-}
-/*************************************************************************
-|*
-|* Leer-Konstruktor
-|*
-\************************************************************************/
+ if(pPolyNormals3D)
+ {
+ SetPolyNormals3D(*pPolyNormals3D);
+ }
-E3dPolygonObj::E3dPolygonObj()
-: E3dCompoundObject(),
- bLineOnly(false) // added missing initialisation
-{
- // Keine Geometrie erzeugen
+ if(pPolyTexture2D)
+ {
+ SetPolyTexture2D(*pPolyTexture2D);
+ }
}
/*************************************************************************
@@ -255,6 +198,42 @@ E3dPolygonObj::~E3dPolygonObj()
{
}
+void E3dPolygonObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const E3dPolygonObj* pSource = dynamic_cast< const E3dPolygonObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ E3dCompoundObject::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ aPolyPoly3D = pSource->aPolyPoly3D;
+ aPolyNormals3D = pSource->aPolyNormals3D;
+ aPolyTexture2D = pSource->aPolyTexture2D;
+ bLineOnly = pSource->bLineOnly;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* E3dPolygonObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ E3dPolygonObj* pClone = new E3dPolygonObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ E3dDefaultAttributes(),
+ basegfx::B3DPolyPolygon());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
/*************************************************************************
|*
|* Identifier zurueckgeben
@@ -314,29 +293,9 @@ void E3dPolygonObj::SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyText
|*
\************************************************************************/
-SdrObject *E3dPolygonObj::DoConvertToPolyObj(sal_Bool /*bBezier*/, bool /*bAddText*/) const
-{
- return NULL;
-}
-
-/*************************************************************************
-|*
-|* Zuweisungsoperator
-|*
-\************************************************************************/
-
-void E3dPolygonObj::operator=(const SdrObject& rObj)
+SdrObject* E3dPolygonObj::DoConvertToPolygonObject(bool /*bBezier*/, bool /*bAddText*/) const
{
- // erstmal alle Childs kopieren
- E3dCompoundObject::operator=(rObj);
-
- // weitere Parameter kopieren
- const E3dPolygonObj& r3DObj = (const E3dPolygonObj&)rObj;
-
- aPolyPoly3D = r3DObj.aPolyPoly3D;
- aPolyNormals3D = r3DObj.aPolyNormals3D;
- aPolyTexture2D = r3DObj.aPolyTexture2D;
- bLineOnly = r3DObj.bLineOnly;
+ return 0;
}
/*************************************************************************
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 446b407e8a2e..872c024aa326 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -24,14 +24,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "svx/svdstr.hrc"
-#include "svx/svdglob.hxx"
-#include "svx/svditer.hxx"
-
+#include <svx/svdstr.hrc>
+#include <svx/svdglob.hxx>
+#include <svx/svditer.hxx>
#if defined( UNX ) || defined( ICC )
#include <stdlib.h>
#endif
-#include "svx/globl3d.hxx"
+#include <svx/globl3d.hxx>
#include <svx/svdpage.hxx>
#include <svl/style.hxx>
#include <svx/scene3d.hxx>
@@ -53,6 +52,8 @@
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/e3dsceneupdater.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
@@ -65,7 +66,7 @@ class ImpRemap3DDepth
double mfMinimalDepth;
// bitfield
- unsigned mbIsScene : 1;
+ bool mbIsScene : 1;
public:
ImpRemap3DDepth(sal_uInt32 nOrdNum, double fMinimalDepth);
@@ -135,34 +136,40 @@ public:
Imp3DDepthRemapper::Imp3DDepthRemapper(E3dScene& rScene)
{
// only called when rScene.GetSubList() and nObjCount > 1L
- SdrObjList* pList = rScene.GetSubList();
- const sal_uInt32 nObjCount(pList->GetObjCount());
+ SdrObjList* pList = rScene.getChildrenOfSdrObject();
- for(sal_uInt32 a(0L); a < nObjCount; a++)
+ if(pList)
{
- SdrObject* pCandidate = pList->GetObj(a);
+ const sal_uInt32 nObjCount(pList->GetObjCount());
- if(pCandidate)
+ for(sal_uInt32 a(0L); a < nObjCount; a++)
{
- if(pCandidate->ISA(E3dCompoundObject))
- {
- // single 3d object, calc depth
- const double fMinimalDepth(getMinimalDepthInViewCoordinates(static_cast< const E3dCompoundObject& >(*pCandidate)));
- ImpRemap3DDepth aEntry(a, fMinimalDepth);
- maVector.push_back(aEntry);
- }
- else
+ SdrObject* pCandidate = pList->GetObj(a);
+
+ if(pCandidate)
{
- // scene, use standard entry for scene
- ImpRemap3DDepth aEntry(a);
- maVector.push_back(aEntry);
+ E3dCompoundObject* pE3dCompoundObject = dynamic_cast< E3dCompoundObject* >(pCandidate);
+
+ if(pE3dCompoundObject)
+ {
+ // single 3d object, calc depth
+ const double fMinimalDepth(getMinimalDepthInViewCoordinates(*pE3dCompoundObject));
+ ImpRemap3DDepth aEntry(a, fMinimalDepth);
+ maVector.push_back(aEntry);
+ }
+ else
+ {
+ // scene, use standard entry for scene
+ ImpRemap3DDepth aEntry(a);
+ maVector.push_back(aEntry);
+ }
}
}
- }
- // now, we need to sort the maVector by it's members minimal depth. The
- // smaller, the nearer to the viewer.
- ::std::sort(maVector.begin(), maVector.end());
+ // now, we need to sort the maVector by it's members minimal depth. The
+ // smaller, the nearer to the viewer.
+ ::std::sort(maVector.begin(), maVector.end());
+ }
}
Imp3DDepthRemapper::~Imp3DDepthRemapper()
@@ -197,27 +204,11 @@ sdr::contact::ViewContact* E3dScene::CreateObjectSpecificViewContact()
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(E3dScene, E3dObject);
-
-/*************************************************************************
-|*
-|* E3dScene-Konstruktor
-|*
-\************************************************************************/
-
-E3dScene::E3dScene()
-: E3dObject(),
- aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
- mp3DDepthRemapper(0L),
- bDrawOnlySelected(false)
-{
- // Defaults setzen
- E3dDefaultAttributes aDefault;
- SetDefaultAttributes(aDefault);
-}
-
-E3dScene::E3dScene(E3dDefaultAttributes& rDefault)
-: E3dObject(),
+E3dScene::E3dScene(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault)
+: E3dObject(rSdrModel),
+ SdrObjList(),
aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
mp3DDepthRemapper(0L),
bDrawOnlySelected(false)
@@ -226,7 +217,7 @@ E3dScene::E3dScene(E3dDefaultAttributes& rDefault)
SetDefaultAttributes(rDefault);
}
-void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/)
+void E3dScene::SetDefaultAttributes(const E3dDefaultAttributes& /*rDefault*/)
{
// Fuer OS/2 die FP-Exceptions abschalten
#if defined(OS2)
@@ -246,8 +237,7 @@ void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/)
aCamera.SetViewWindow(-2, -2, 4, 4);
aCameraSet.SetDeviceRectangle(-2, 2, -2, 2);
aCamera.SetDeviceWindow(Rectangle(0, 0, 10, 10));
- Rectangle aRect(0, 0, 10, 10);
- aCameraSet.SetViewportRectangle(aRect);
+ aCameraSet.SetViewportRectangle(Rectangle(0, 0, 10, 10));
// set defaults for Camera from ItemPool
aCamera.SetProjection(GetPerspective());
@@ -263,16 +253,98 @@ void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/)
aCamera.SetFocalLength(fNew);
}
-/*************************************************************************
-|*
-|* Destruktor
-|*
-\************************************************************************/
-
E3dScene::~E3dScene()
{
// #110988#
ImpCleanup3DDepthMapper();
+
+ if(GetObjCount())
+ {
+ // cannot be called in SdrObjList::ClearSdrObjList() where it originally was
+ // since there it would be a pure virtual function call. Needs to be called
+ // in all destructors of classes derived from SdrObjList
+ getSdrModelFromSdrObjList().SetChanged();
+ }
+}
+
+void E3dScene::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const E3dScene* pSource = dynamic_cast< const E3dScene* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ E3dObject::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ copyDataFromSdrObjList(*pSource->getChildrenOfSdrObject());
+
+ aCamera = pSource->aCamera;
+ aCameraSet = pSource->aCameraSet;
+ ((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera();
+ InvalidateBoundVolume();
+ RebuildLists();
+ ImpCleanup3DDepthMapper();
+ GetViewContact().ActionChanged();
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* E3dScene::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ E3dScene* pClone = new E3dScene(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ E3dDefaultAttributes());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+SdrPage* E3dScene::getSdrPageFromSdrObjList() const
+{
+ return getSdrPageFromSdrObject();
+}
+
+SdrObject* E3dScene::getSdrObjectFromSdrObjList() const
+{
+ return const_cast< E3dScene* >(this);
+}
+
+SdrModel& E3dScene::getSdrModelFromSdrObjList() const
+{
+ return getSdrModelFromSdrObject();
+}
+
+void E3dScene::handleContentChange(const SfxHint& rHint)
+{
+ // call parent
+ SdrObjList::handleContentChange(rHint);
+
+ // react self if outmost scene
+ E3dScene* pScene = GetScene();
+
+ if(pScene == this)
+ {
+ // depth mapper needs to change
+ ImpCleanup3DDepthMapper();
+ }
+ else
+ {
+ // reset local transformation to allow on-demand recalculation
+ maSdrObjectTransformation.setB2DHomMatrix(basegfx::B2DHomMatrix());
+ }
+}
+
+SdrObjList* E3dScene::getChildrenOfSdrObject() const
+{
+ return const_cast< E3dScene* >(this);
}
basegfx::B2DPolyPolygon E3dScene::TakeXorPoly() const
@@ -303,7 +375,7 @@ sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const
{
if(!mp3DDepthRemapper)
{
- const sal_uInt32 nObjCount(GetSubList() ? GetSubList()->GetObjCount() : 0L);
+ const sal_uInt32 nObjCount(GetObjCount());
if(nObjCount > 1L)
{
@@ -330,66 +402,6 @@ sal_uInt16 E3dScene::GetObjIdentifier() const
return E3D_SCENE_ID;
}
-void E3dScene::SetBoundRectDirty()
-{
- E3dScene* pScene = GetScene();
-
- if(pScene == this)
- {
- // avoid resetting aOutRect which in case of a 3D scene used as 2d object
- // is model data,not re-creatable view data
- }
- else
- {
- // if not the outmost scene it is used as group in 3d, call parent
- E3dObject::SetBoundRectDirty();
- }
-}
-
-/*************************************************************************
-|*
-|* SetSnapRect
-|*
-\************************************************************************/
-
-void E3dScene::NbcSetSnapRect(const Rectangle& rRect)
-{
- SetRectsDirty();
- E3dObject::NbcSetSnapRect(rRect);
- aCamera.SetDeviceWindow(rRect);
- aCameraSet.SetViewportRectangle((Rectangle&)rRect);
-
- // #110988#
- ImpCleanup3DDepthMapper();
-}
-
-/*************************************************************************
-|*
-|* Objekt verschieben
-|*
-\************************************************************************/
-
-void E3dScene::NbcMove(const Size& rSize)
-{
- Rectangle aNewSnapRect = GetSnapRect();
- MoveRect(aNewSnapRect, rSize);
- NbcSetSnapRect(aNewSnapRect);
-}
-
-/*************************************************************************
-|*
-|* Objekt Resizen
-|*
-\************************************************************************/
-
-void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact,
- const Fraction& rYFact)
-{
- Rectangle aNewSnapRect = GetSnapRect();
- ResizeRect(aNewSnapRect, rRef, rXFact, rYFact);
- NbcSetSnapRect(aNewSnapRect);
-}
-
/*************************************************************************
|*
|* Neue Kamera setzen, und dabei die Szene und ggf. das BoundVolume
@@ -403,7 +415,7 @@ void E3dScene::SetCamera(const Camera3D& rNewCamera)
aCamera = rNewCamera;
((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera();
- SetRectsDirty();
+ ActionChanged();
// Neue Kamera aus alter fuellen
Camera3D& rCam = (Camera3D&)GetCamera();
@@ -423,7 +435,7 @@ void E3dScene::SetCamera(const Camera3D& rNewCamera)
// Perspektive setzen
GetCameraSet().SetPerspective(rCam.GetProjection() == PR_PERSPECTIVE);
- GetCameraSet().SetViewportRectangle((Rectangle&)rCam.GetDeviceWindow());
+ GetCameraSet().SetViewportRectangle(rCam.GetDeviceWindow());
// #110988#
ImpCleanup3DDepthMapper();
@@ -435,11 +447,11 @@ void E3dScene::SetCamera(const Camera3D& rNewCamera)
|*
\************************************************************************/
-void E3dScene::NewObjectInserted(const E3dObject* p3DObj)
+void E3dScene::NewObjectInserted(const E3dObject& r3DObj)
{
- E3dObject::NewObjectInserted(p3DObj);
+ E3dObject::NewObjectInserted(r3DObj);
- if ( p3DObj == this )
+ if(&r3DObj == this)
return;
// #110988#
@@ -455,7 +467,7 @@ void E3dScene::NewObjectInserted(const E3dObject* p3DObj)
void E3dScene::StructureChanged()
{
E3dObject::StructureChanged();
- SetRectsDirty();
+ ActionChanged();
// #110988#
ImpCleanup3DDepthMapper();
@@ -479,23 +491,23 @@ void E3dScene::removeAllNonSelectedObjects()
{
E3DModifySceneSnapRectUpdater aUpdater(this);
- for(sal_uInt32 a(0); a < maSubList.GetObjCount(); a++)
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
{
- SdrObject* pObj = maSubList.GetObj(a);
+ SdrObject* pObj = GetObj(a);
if(pObj)
{
bool bRemoveObject(false);
+ E3dScene* pScene = dynamic_cast< E3dScene* >(pObj);
+ E3dCompoundObject* pCompound = dynamic_cast< E3dCompoundObject* >(pObj);
- if(pObj->ISA(E3dScene))
+ if(pScene)
{
- E3dScene* pScene = (E3dScene*)pObj;
-
// iterate over this sub-scene
pScene->removeAllNonSelectedObjects();
// check object count. Empty scenes can be deleted
- const sal_uInt32 nObjCount(pScene->GetSubList() ? pScene->GetSubList()->GetObjCount() : 0);
+ const sal_uInt32 nObjCount(pScene->GetObjCount());
if(!nObjCount)
{
@@ -503,10 +515,8 @@ void E3dScene::removeAllNonSelectedObjects()
bRemoveObject = true;
}
}
- else if(pObj->ISA(E3dCompoundObject))
+ else if(pCompound)
{
- E3dCompoundObject* pCompound = (E3dCompoundObject*)pObj;
-
if(!pCompound->GetSelected())
{
bRemoveObject = true;
@@ -515,9 +525,9 @@ void E3dScene::removeAllNonSelectedObjects()
if(bRemoveObject)
{
- maSubList.NbcRemoveObject(pObj->GetOrdNum());
+ RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
a--;
- SdrObject::Free(pObj);
+ deleteSdrObjectSafeAndClearPointer(pObj);
}
}
}
@@ -525,45 +535,6 @@ void E3dScene::removeAllNonSelectedObjects()
/*************************************************************************
|*
-|* Zuweisungsoperator
-|*
-\************************************************************************/
-
-void E3dScene::operator=(const SdrObject& rObj)
-{
- E3dObject::operator=(rObj);
-
- const E3dScene& r3DObj = (const E3dScene&) rObj;
- aCamera = r3DObj.aCamera;
-
- // neu ab 377:
- aCameraSet = r3DObj.aCameraSet;
- ((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera();
-
- // SetSnapRect(r3DObj.GetSnapRect());
- InvalidateBoundVolume();
- RebuildLists();
- SetRectsDirty();
-
- // #110988#
- ImpCleanup3DDepthMapper();
-
- // #i101941#
- // After a Scene as model object is cloned, the used
- // ViewContactOfE3dScene is created and partially used
- // to calculate Bound/SnapRects, but - since quite some
- // values are buffered at the VC - not really well
- // initialized. It would be possible to always watch for
- // preconditions of buffered data, but this would be expensive
- // and would create a lot of short living data structures.
- // It is currently better to flush that data, e.g. by using
- // ActionChanged at the VC which will for this class
- // flush that cached data and initalize it's valid reconstruction
- GetViewContact().ActionChanged();
-}
-
-/*************************************************************************
-|*
|* Licht- und Labelobjektlisten neu aufbauen (nach Laden, Zuweisung)
|*
\************************************************************************/
@@ -571,16 +542,21 @@ void E3dScene::operator=(const SdrObject& rObj)
void E3dScene::RebuildLists()
{
// zuerst loeschen
- SdrLayerID nCurrLayerID = GetLayer();
+ const SdrLayerID nCurrLayerID(GetLayer());
- SdrObjListIter a3DIterator(maSubList, IM_FLAT);
-
- // dann alle Objekte in der Szene pruefen
- while ( a3DIterator.IsMore() )
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
{
- E3dObject* p3DObj = (E3dObject*) a3DIterator.Next();
- p3DObj->NbcSetLayer(nCurrLayerID);
- NewObjectInserted(p3DObj);
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
+
+ if(pCandidate)
+ {
+ pCandidate->SetLayer(nCurrLayerID);
+ NewObjectInserted(*pCandidate);
+ }
+ else
+ {
+ OSL_ENSURE(false, "E3dScene::RebuildLists error in 3D SdrObjList (!)");
+ }
}
}
@@ -630,7 +606,7 @@ void E3dScene::RestGeoData(const SdrObjGeoData& rGeo)
void E3dScene::Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
{
- SetRectsDirty();
+ ActionChanged();
E3dObject::Notify(rBC, rHint);
}
@@ -641,24 +617,26 @@ void E3dScene::Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double cs)
{
Point UpperLeft, LowerRight, Center, NewCenter;
+ const Rectangle aSnapRect(sdr::legacy::GetSnapRect(*this));
- UpperLeft = aOutRect.TopLeft();
- LowerRight = aOutRect.BottomRight();
+ UpperLeft = aSnapRect.TopLeft();
+ LowerRight = aSnapRect.BottomRight();
long dxOutRectHalf = labs(UpperLeft.X() - LowerRight.X());
dxOutRectHalf /= 2;
long dyOutRectHalf = labs(UpperLeft.Y() - LowerRight.Y());
dyOutRectHalf /= 2;
- Rectangle RectQuelle(aOutRect), RectZiel(aOutRect);
+ Rectangle RectQuelle(aSnapRect), RectZiel(aSnapRect);
- // Nur der Mittelpunkt wird bewegt. Die Ecken werden von NbcMove bewegt.
- // Fuer das Drehen wird von mir ein kartesisches Koordinatensystem verwendet in dem der Drehpunkt
- // der Nullpunkt ist und die Y- Achse nach oben ansteigt, die X-Achse nach rechts.
- // Dies muss bei den Y-Werten beachtet werden. (Auf dem Blatt zeigt die Y-Achse nach unten
+ // Nur der Mittelpunkt wird bewegt. Die Ecken werden von NbcMove bewegt.
+ // Fuer das Drehen wird von mir ein kartesisches Koordinatensystem verwendet in dem der Drehpunkt
+ // der Nullpunkt ist und die Y- Achse nach oben ansteigt, die X-Achse nach rechts.
+ // Dies muss bei den Y-Werten beachtet werden. (Auf dem Blatt zeigt die Y-Achse nach unten
Center.X() = (UpperLeft.X() + dxOutRectHalf) - rRef.X();
Center.Y() = -((UpperLeft.Y() + dyOutRectHalf) - rRef.Y());
- // Ein paar Spezialfaelle zuerst abhandeln (n*90 Grad n ganzzahlig)
+
+ // Ein paar Spezialfaelle zuerst abhandeln (n*90 Grad n ganzzahlig)
if (sn==1.0 && cs==0.0) { // 90deg
NewCenter.X() = -Center.Y();
NewCenter.Y() = -Center.X();
@@ -669,11 +647,13 @@ void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double
NewCenter.X() = Center.Y();
NewCenter.Y() = -Center.X();
}
- else // Hier wird um einen beliebigen Winkel in mathematisch positiver Richtung gedreht!
- { // xneu = x * cos(alpha) - y * sin(alpha)
- // yneu = x * sin(alpha) + y * cos(alpha)
- // Unten Rechts wird nicht gedreht: die Seiten von RectQuelle muessen parallel
- // zu den Koordinatenachsen bleiben.
+ else
+ {
+ // Hier wird um einen beliebigen Winkel in mathematisch positiver Richtung gedreht!
+ // xneu = x * cos(alpha) - y * sin(alpha)
+ // yneu = x * sin(alpha) + y * cos(alpha)
+ // Unten Rechts wird nicht gedreht: die Seiten von RectQuelle muessen parallel
+ // zu den Koordinatenachsen bleiben.
NewCenter.X() = (long) (Center.X() * cs - Center.Y() * sn);
NewCenter.Y() = (long) (Center.X() * sn + Center.Y() * cs);
}
@@ -682,7 +662,8 @@ void E3dScene::RotateScene (const Point& rRef, long /*nWink*/, double sn, double
Point DiffPoint = (NewCenter - Center);
Differenz.Width() = DiffPoint.X();
Differenz.Height() = -DiffPoint.Y(); // Man beachte dass die Y-Achse nach unten positiv gezaehlt wird.
- NbcMove (Differenz); // fuehrt die eigentliche Koordinatentransformation durch.
+
+ sdr::legacy::MoveSdrObject(*this, Differenz); // fuehrt die eigentliche Koordinatentransformation durch.
}
/*************************************************************************
@@ -724,157 +705,336 @@ void E3dScene::TakeObjNamePlural(XubString& rName) const
|*
\************************************************************************/
-void E3dScene::NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix)
+void E3dScene::SetB3DTransform(const basegfx::B3DHomMatrix& rMatrix)
{
if(maTransformation != rMatrix)
{
// call parent
- E3dObject::NbcSetTransform(rMatrix);
+ E3dObject::SetB3DTransform(rMatrix);
}
}
-void E3dScene::SetTransform(const basegfx::B3DHomMatrix& rMatrix)
+/*************************************************************************
+|*
+|* Aufbrechen
+|*
+\************************************************************************/
+
+sal_Bool E3dScene::IsBreakObjPossible()
{
- if(rMatrix != maTransformation)
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
{
- // call parent
- E3dObject::SetTransform(rMatrix);
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
+
+ if(pCandidate)
+ {
+ if(!pCandidate->IsBreakObjPossible())
+ {
+ return false;
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "E3dScene::IsBreakObjPossible error in 3D SdrObjList (!)");
+ }
}
+
+ return true;
+}
+
+basegfx::B3DVector E3dScene::GetShadowPlaneDirection() const
+{
+ double fWink = (double)GetShadowSlant() * F_PI180;
+ basegfx::B3DVector aShadowPlaneDir(0.0, sin(fWink), cos(fWink));
+ aShadowPlaneDir.normalize();
+ return aShadowPlaneDir;
+}
+
+void E3dScene::SetShadowPlaneDirection(const basegfx::B3DVector& rVec)
+{
+ sal_uInt16 nSceneShadowSlant = (sal_uInt16)((atan2(rVec.getY(), rVec.getZ()) / F_PI180) + 0.5);
+ GetProperties().SetObjectItemDirect(SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, nSceneShadowSlant));
+}
+
+basegfx::B2DPolyPolygon E3dScene::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
+{
+ return TakeXorPoly();
+}
+
+bool E3dScene::MovCreate(SdrDragStat& rStat)
+{
+ const basegfx::B2DRange aRange(rStat.TakeCreateRange());
+ rStat.SetActionRange(aRange);
+ sdr::legacy::SetSnapRange(*this, aRange);
+
+ return true;
}
-void E3dScene::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
+bool E3dScene::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- // Also derzeit sind die Klebepunkte relativ zum aOutRect der Szene definiert. Vor dem Drehen
- // werden die Klebepunkte relativ zur Seite definiert. Sie nehmen an der Drehung der Szene noch nicht Teil
- // dafuer gibt es den
- SetGlueReallyAbsolute(sal_True);
+ const basegfx::B2DRange aRange(rStat.TakeCreateRange());
+ sdr::legacy::SetSnapRange(*this, aRange);
- // So dass war die Szene, ab jetzt kommen die Objekte in der Szene
- // 3D-Objekte gibt es nur ein einziges das kann zwar mehrere Flaechen haben aber die Flaechen
- // muessen ja nicht zusammenhaengend sein
- // es ermoeglicht den Zugriff auf Kindobjekte
- // Ich gehe also die gesamte Liste durch und rotiere um die Z-Achse die durch den
- // Mittelpunkt von aOutRect geht (Satz von Steiner), also RotateZ
+ return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
+}
+
+bool E3dScene::BckCreate(SdrDragStat& /*rStat*/)
+{
+ return false;
+}
+
+void E3dScene::BrkCreate(SdrDragStat& /*rStat*/)
+{
+}
- RotateScene (rRef, nWink, sn, cs); // Rotiert die Szene
- double fWinkelInRad = nWink/100 * F_PI180;
+void E3dScene::SetSelected(bool bNew)
+{
+ // call parent
+ E3dObject::SetSelected(bNew);
- basegfx::B3DHomMatrix aRotation;
- aRotation.rotate(0.0, 0.0, fWinkelInRad);
- NbcSetTransform(aRotation * GetTransform());
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
- SetRectsDirty(); // Veranlasst eine Neuberechnung aller BoundRects
- NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotiert die Klebepunkte (die haben noch Koordinaten relativ
- // zum Urpsung des Blattes
- SetGlueReallyAbsolute(sal_False); // ab jetzt sind sie wieder relativ zum BoundRect (also dem aOutRect definiert)
- SetRectsDirty();
+ if(pCandidate)
+ {
+ pCandidate->SetSelected(bNew);
+ }
+ }
}
/*************************************************************************
|*
-|* SnapRect berechnen
+|* Layer setzen
|*
\************************************************************************/
-void E3dScene::RecalcSnapRect()
+void E3dScene::SetLayer(SdrLayerID nLayer)
{
- E3dScene* pScene = GetScene();
+ // call parent
+ E3dObject::SetLayer(nLayer);
- if(pScene == this)
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
{
- // Szene wird als 2D-Objekt benutzt, nimm SnapRect aus der
- // 2D Bildschrimdarstellung
- Camera3D& rCam = (Camera3D&)pScene->GetCamera();
- maSnapRect = rCam.GetDeviceWindow();
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
+
+ if(pCandidate)
+ {
+ pCandidate->SetLayer(nLayer);
+ }
+ }
+}
+
+void E3dScene::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
+{
+ if(pOldPage != pNewPage)
+ {
+ // call parent
+ E3dObject::handlePageChange(pOldPage, pNewPage);
+
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
+
+ if(pCandidate)
+ {
+ pCandidate->handlePageChange(pOldPage, pNewPage);
}
else
{
- // Szene ist selbst Mitglied einer anderen Szene, hole das
- // SnapRect als zusammengesetztes Objekt
- E3dObject::RecalcSnapRect();
+ OSL_ENSURE(false, "E3dScene::handlePageChange invalid object list (!)");
+ }
+ }
}
}
/*************************************************************************
|*
-|* Aufbrechen
+|* SnapRect berechnen
|*
\************************************************************************/
-sal_Bool E3dScene::IsBreakObjPossible()
+const basegfx::B2DHomMatrix& E3dScene::getSdrObjectTransformation() const
{
- // Szene ist aufzubrechen, wenn alle Mitglieder aufzubrechen sind
- SdrObjListIter a3DIterator(maSubList, IM_DEEPWITHGROUPS);
+ const E3dScene* pScene = GetScene();
- while ( a3DIterator.IsMore() )
+ if(pScene == this)
{
- E3dObject* pObj = (E3dObject*) a3DIterator.Next();
- DBG_ASSERT(pObj->ISA(E3dObject), "AW: In Szenen sind nur 3D-Objekte erlaubt!");
- if(!pObj->IsBreakObjPossible())
- return sal_False;
+ // scene is the outmost one and thus a 2D object. Nothing to do,
+ // 2D transformation is where it belongs
}
+ else
+ {
+ // scene is member of another 3D scene and used as 3D grouping object.
+ // Transformation of the group is it's size (scale) and position (translation)
+ // of all sub-objects combined. To not always create this, use isIdentity() as
+ // hint for recalculation
+ // TTTT: look for correct place to set to identity
+ // TTTT: should be done by E3dScene::handleContentChange, needs check
+ if(maSdrObjectTransformation.getB2DHomMatrix().isIdentity())
+ {
+ basegfx::B2DRange aRange;
- return sal_True;
-}
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
-basegfx::B3DVector E3dScene::GetShadowPlaneDirection() const
-{
- double fWink = (double)GetShadowSlant() * F_PI180;
- basegfx::B3DVector aShadowPlaneDir(0.0, sin(fWink), cos(fWink));
- aShadowPlaneDir.normalize();
- return aShadowPlaneDir;
+ if(pCandidate)
+ {
+ aRange.expand(sdr::legacy::GetLogicRange(*pCandidate));
+ }
+ }
+
+ const_cast< E3dScene* >(this)->maSdrObjectTransformation.setB2DHomMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRange.getRange(),
+ aRange.getMinimum()));
+ }
+ }
+
+ // call parent
+ return E3dObject::getSdrObjectTransformation();
}
-void E3dScene::SetShadowPlaneDirection(const basegfx::B3DVector& rVec)
+void E3dScene::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- sal_uInt16 nSceneShadowSlant = (sal_uInt16)((atan2(rVec.getY(), rVec.getZ()) / F_PI180) + 0.5);
- GetProperties().SetObjectItemDirect(Svx3DShadowSlantItem(nSceneShadowSlant));
+ // TTTT: SetGlueReallyAbsolute(TRUE);
+ // NbcRotateGluePoints(rRef,nWink,sn,cs); // Rotiert die Klebepunkte (die haben noch Koordinaten relativ
+ // SetGlueReallyAbsolute(FALSE); // ab jetzt sind sie wieder relativ zum SnapRect definiert
+ const E3dScene* pScene = GetScene();
+
+ if(pScene == this)
+ {
+ // scene is the outmost one and thus also a 2D object
+ E3dObject::setSdrObjectTransformation(rTransformation);
+
+ // also set data at camera as needed
+ const basegfx::B2DVector aAbsScale(basegfx::absolute(getSdrObjectScale()));
+ const basegfx::B2DPoint& rTranslate(getSdrObjectTranslate());
+ const Rectangle aCameraRectangle(
+ basegfx::fround(rTranslate.getX()),
+ basegfx::fround(rTranslate.getY()),
+ basegfx::fround(rTranslate.getX() + aAbsScale.getX()),
+ basegfx::fround(rTranslate.getY() + aAbsScale.getY()));
+
+ aCamera.SetDeviceWindow(aCameraRectangle);
+ aCameraSet.SetViewportRectangle(aCameraRectangle);
+ ImpCleanup3DDepthMapper();
+ }
+ else
+ {
+ // scene is member of another 3D scene and used as 3D grouping
+ // object. Apply to all sub-objects
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
+
+ if(pCandidate)
+ {
+ pCandidate->setSdrObjectTransformation(rTransformation);
+ }
+ }
+
+ // reset local transformation
+ maSdrObjectTransformation.setB2DHomMatrix(basegfx::B2DHomMatrix());
+ }
}
-basegfx::B2DPolyPolygon E3dScene::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
+/*************************************************************************
+|*
+|* 3D-Objekt einfuegen
+|*
+\************************************************************************/
+
+void E3dScene::Insert3DObj(E3dObject& r3DObj)
{
- return TakeXorPoly();
+ InsertObjectToSdrObjList(r3DObj);
+ InvalidateBoundVolume();
+ NewObjectInserted(r3DObj);
+ StructureChanged();
}
-FASTBOOL E3dScene::BegCreate(SdrDragStat& rStat)
+void E3dScene::Remove3DObj(E3dObject& r3DObj)
{
- rStat.SetOrtho4Possible();
- Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
- aRect1.Justify();
- rStat.SetActionRect(aRect1);
- NbcSetSnapRect(aRect1);
- return sal_True;
+ if(r3DObj.GetParentObj() == this)
+ {
+ RemoveObjectFromSdrObjList(r3DObj.GetNavigationPosition());
+ InvalidateBoundVolume();
+ StructureChanged();
+ }
}
-FASTBOOL E3dScene::MovCreate(SdrDragStat& rStat)
+/*************************************************************************
+|*
+|* umschliessendes Volumen inklusive aller Kindobjekte berechnen
+|*
+\************************************************************************/
+
+basegfx::B3DRange E3dScene::RecalcBoundVolume() const
{
- Rectangle aRect1;
- rStat.TakeCreateRect(aRect1);
- aRect1.Justify();
- rStat.SetActionRect(aRect1);
- NbcSetSnapRect(aRect1);
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- return sal_True;
+ basegfx::B3DRange aRetval;
+ const sal_uInt32 nObjCnt(GetObjCount());
+
+ if(nObjCnt)
+ {
+ for(sal_uInt32 a(0); a < nObjCnt; a++)
+ {
+ const E3dObject* p3DObject = dynamic_cast< const E3dObject* >(GetObj(a));
+
+ if(p3DObject)
+ {
+ basegfx::B3DRange aLocalRange(p3DObject->GetBoundVolume());
+ aLocalRange.transform(p3DObject->GetB3DTransform());
+ aRetval.expand(aLocalRange);
+ }
+ }
+ }
+
+ return aRetval;
}
-FASTBOOL E3dScene::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+/*************************************************************************
+|*
+|* Aederung des BoundVolumes an alle Kindobjekte weitergeben
+|*
+\************************************************************************/
+
+void E3dScene::SetBoundVolInvalid()
{
- Rectangle aRect1;
- rStat.TakeCreateRect(aRect1);
- aRect1.Justify();
- NbcSetSnapRect(aRect1);
- SetRectsDirty();
- return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
+ // call parent
+ E3dObject::SetBoundVolInvalid();
+
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
+
+ if(pCandidate)
+ {
+ pCandidate->SetBoundVolInvalid();
+ }
+ }
}
-FASTBOOL E3dScene::BckCreate(SdrDragStat& /*rStat*/)
+/*************************************************************************
+|*
+|* Aederung der Transformation an alle Kindobjekte weitergeben
+|*
+\************************************************************************/
+
+void E3dScene::SetTransformChanged()
{
- return sal_False;
-}
+ // call parent
+ E3dObject::SetTransformChanged();
-void E3dScene::BrkCreate(SdrDragStat& /*rStat*/)
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
{
+ E3dObject* pCandidate = dynamic_cast< E3dObject* >(GetObj(a));
+
+ if(pCandidate)
+ {
+ pCandidate->SetTransformChanged();
+ }
+ }
}
// eof
diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx
index ffee55b67af2..79ac10bdfa11 100644
--- a/svx/source/engine3d/sphere3d.cxx
+++ b/svx/source/engine3d/sphere3d.cxx
@@ -56,51 +56,65 @@ sdr::properties::BaseProperties* E3dSphereObj::CreateObjectSpecificProperties()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(E3dSphereObj, E3dCompoundObject);
-
/*************************************************************************
|*
|* Kugel aus Polygonfacetten nach Laengen und Breitengrad aufbauen
|*
\************************************************************************/
-E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize)
-: E3dCompoundObject(rDefault)
+E3dSphereObj::E3dSphereObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint _aCenter,
+ const basegfx::B3DVector a3DSize)
+: E3dCompoundObject(rSdrModel, rDefault)
{
// Defaults setzen
SetDefaultAttributes(rDefault);
// Uebergebene drueberbuegeln
- aCenter = rCenter;
- aSize = r3DSize;
+ aCenter = _aCenter;
+ aSize = a3DSize;
}
-E3dSphereObj::E3dSphereObj()
-: E3dCompoundObject()
+E3dSphereObj::~E3dSphereObj()
{
- // Defaults setzen
- E3dDefaultAttributes aDefault;
- SetDefaultAttributes(aDefault);
}
-/*************************************************************************
-|*
-|* Kugel erzeugen ohne die Polygone darin zu erzeugen
-|*
-\************************************************************************/
+void E3dSphereObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const E3dSphereObj* pSource = dynamic_cast< const E3dSphereObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ E3dCompoundObject::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ aCenter = pSource->aCenter;
+ aSize = pSource->aSize;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
-// FG: Dieser Aufruf erfolgt von der 3D-Object Factory (objfac3d.cxx) und zwar ausschliesslich beim
-// laden von Dokumenten. Hier braucht man keinen CreateSphere-Aufruf, denn die wirkliche
-// Anzahl Segmente ist ja noch nicht bekannt. Dies war bis zum 10.2.97 ein (kleines)
-// Speicherleck.
-E3dSphereObj::E3dSphereObj(int /*dummy*/) // den Parameter braucht es um unterscheiden zu koennen, welcher
-{ // der beiden Konstruktoren gemeint ist. Der obige halt per Default
- // Defaults setzen
- E3dDefaultAttributes aDefault;
- SetDefaultAttributes(aDefault);
+SdrObject* E3dSphereObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ E3dSphereObj* pClone = new E3dSphereObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ E3dDefaultAttributes());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
-void E3dSphereObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dSphereObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
// Defaults setzen
aCenter = rDefault.GetDefaultSphereCenter();
@@ -124,7 +138,7 @@ sal_uInt16 E3dSphereObj::GetObjIdentifier() const
|*
\************************************************************************/
-SdrObject *E3dSphereObj::DoConvertToPolyObj(sal_Bool /*bBezier*/, bool /*bAddText*/) const
+SdrObject *E3dSphereObj::DoConvertToPolygonObject(bool /*bBezier*/, bool /*bAddText*/) const
{
return NULL;
}
@@ -139,8 +153,8 @@ void E3dSphereObj::ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs)
{
if((nHSegs != GetHorizontalSegments() || nVSegs != GetVerticalSegments()) && (nHSegs != 0 || nVSegs != 0))
{
- GetProperties().SetObjectItemDirect(Svx3DHorizontalSegmentsItem(nHSegs));
- GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nVSegs));
+ GetProperties().SetObjectItemDirect(SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nHSegs));
+ GetProperties().SetObjectItemDirect(SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nVSegs));
ActionChanged();
}
@@ -148,24 +162,6 @@ void E3dSphereObj::ReSegment(sal_uInt32 nHSegs, sal_uInt32 nVSegs)
/*************************************************************************
|*
-|* Zuweisungsoperator
-|*
-\************************************************************************/
-
-void E3dSphereObj::operator=(const SdrObject& rObj)
-{
- // erstmal alle Childs kopieren
- E3dCompoundObject::operator=(rObj);
-
- // weitere Parameter kopieren
- const E3dSphereObj& r3DObj = (const E3dSphereObj&) rObj;
-
- aCenter = r3DObj.aCenter;
- aSize = r3DObj.aSize;
-}
-
-/*************************************************************************
-|*
|* Lokale Parameter setzen mit Geometrieneuerzeugung
|*
\************************************************************************/
diff --git a/svx/source/engine3d/svx3ditems.cxx b/svx/source/engine3d/svx3ditems.cxx
index e1bd6561c2aa..9b564d5fb590 100644
--- a/svx/source/engine3d/svx3ditems.cxx
+++ b/svx/source/engine3d/svx3ditems.cxx
@@ -38,35 +38,6 @@ using namespace ::rtl;
using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////////////
-Svx3DPercentDiagonalItem::Svx3DPercentDiagonalItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, nVal)
-{}
-
-Svx3DBackscaleItem::Svx3DBackscaleItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, nVal)
-{}
-
-Svx3DDepthItem::Svx3DDepthItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, nVal)
-{}
-
-Svx3DHorizontalSegmentsItem::Svx3DHorizontalSegmentsItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nVal)
-{}
-
-Svx3DVerticalSegmentsItem::Svx3DVerticalSegmentsItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nVal)
-{}
-
-Svx3DEndAngleItem::Svx3DEndAngleItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, nVal)
-{}
-
-Svx3DDoubleSidedItem::Svx3DDoubleSidedItem(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, bVal)
-{}
-
-//////////////////////////////////////////////////////////////////////////////
// #i28528#
// Added extra Item (Bool) for chart2 to be able to show reduced line geometry
@@ -92,182 +63,12 @@ SfxPoolItem* Svx3DReducedLineGeometryItem::Create(SvStream& rIn, sal_uInt16 nIte
return pRetval;
}
-//////////////////////////////////////////////////////////////////////////////
-
-Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND, nVal)
-{}
-
-Svx3DNormalsInvertItem::Svx3DNormalsInvertItem(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT, bVal)
-{}
-
-Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X, nVal)
-{}
-
-Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y, nVal)
-{}
-
-Svx3DShadow3DItem::Svx3DShadow3DItem(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D, bVal)
-{}
-
-Svx3DMaterialColorItem::Svx3DMaterialColorItem(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DOBJ_MAT_COLOR)
-{}
-
-Svx3DMaterialEmissionItem::Svx3DMaterialEmissionItem(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DOBJ_MAT_EMISSION)
-{}
-
-Svx3DMaterialSpecularItem::Svx3DMaterialSpecularItem(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DOBJ_MAT_SPECULAR)
-{}
-
-Svx3DMaterialSpecularIntensityItem::Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, nVal)
-{}
-
-Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND, nVal)
-{}
-
-Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE, nVal)
-{}
-
-Svx3DTextureFilterItem::Svx3DTextureFilterItem(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER, bVal)
-{}
-
-Svx3DPerspectiveItem::Svx3DPerspectiveItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, nVal)
-{}
-
-Svx3DDistanceItem::Svx3DDistanceItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, nVal)
-{}
-
-Svx3DFocalLengthItem::Svx3DFocalLengthItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, nVal)
-{}
-
-Svx3DTwoSidedLightingItem::Svx3DTwoSidedLightingItem(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, bVal)
-{}
-
-Svx3DLightcolor1Item::Svx3DLightcolor1Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_1)
-{}
-
-Svx3DLightcolor2Item::Svx3DLightcolor2Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_2)
-{}
-
-Svx3DLightcolor3Item::Svx3DLightcolor3Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_3)
-{}
-
-Svx3DLightcolor4Item::Svx3DLightcolor4Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_4)
-{}
-
-Svx3DLightcolor5Item::Svx3DLightcolor5Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_5)
-{}
-
-Svx3DLightcolor6Item::Svx3DLightcolor6Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_6)
-{}
-
-Svx3DLightcolor7Item::Svx3DLightcolor7Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_7)
-{}
-
-Svx3DLightcolor8Item::Svx3DLightcolor8Item(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_8)
-{}
-
-Svx3DAmbientcolorItem::Svx3DAmbientcolorItem(const Color& rCol)
-: SvxColorItem(rCol, SDRATTR_3DSCENE_AMBIENTCOLOR)
-{}
-
-Svx3DLightOnOff1Item::Svx3DLightOnOff1Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, bVal)
-{}
-
-Svx3DLightOnOff2Item::Svx3DLightOnOff2Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, bVal)
-{}
-
-Svx3DLightOnOff3Item::Svx3DLightOnOff3Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, bVal)
-{}
-
-Svx3DLightOnOff4Item::Svx3DLightOnOff4Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, bVal)
-{}
-
-Svx3DLightOnOff5Item::Svx3DLightOnOff5Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, bVal)
-{}
-
-Svx3DLightOnOff6Item::Svx3DLightOnOff6Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, bVal)
-{}
-
-Svx3DLightOnOff7Item::Svx3DLightOnOff7Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, bVal)
-{}
-
-Svx3DLightOnOff8Item::Svx3DLightOnOff8Item(sal_Bool bVal)
-: SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, bVal)
-{}
-
-Svx3DLightDirection1Item::Svx3DLightDirection1Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, rVec)
-{}
-
-Svx3DLightDirection2Item::Svx3DLightDirection2Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, rVec)
-{}
-
-Svx3DLightDirection3Item::Svx3DLightDirection3Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, rVec)
-{}
-
-Svx3DLightDirection4Item::Svx3DLightDirection4Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, rVec)
-{}
-
-Svx3DLightDirection5Item::Svx3DLightDirection5Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, rVec)
-{}
-
-Svx3DLightDirection6Item::Svx3DLightDirection6Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, rVec)
-{}
-
-Svx3DLightDirection7Item::Svx3DLightDirection7Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, rVec)
-{}
-
-Svx3DLightDirection8Item::Svx3DLightDirection8Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, rVec)
-{}
-
-Svx3DShadowSlantItem::Svx3DShadowSlantItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, nVal)
-{}
-
-Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal)
-: SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE, nVal)
-{}
+SfxPoolItem* Svx3DReducedLineGeometryItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new Svx3DReducedLineGeometryItem(*this);
+}
//////////////////////////////////////////////////////////////////////////////
-// #107245#
Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(sal_Bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS, bVal)
@@ -291,6 +92,11 @@ SfxPoolItem* Svx3DSmoothNormalsItem::Create(SvStream& rIn, sal_uInt16 nItemVersi
return pRetval;
}
+SfxPoolItem* Svx3DSmoothNormalsItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new Svx3DSmoothNormalsItem(*this);
+}
+
//////////////////////////////////////////////////////////////////////////////
// #107245#
@@ -316,6 +122,11 @@ SfxPoolItem* Svx3DSmoothLidsItem::Create(SvStream& rIn, sal_uInt16 nItemVersion)
return pRetval;
}
+SfxPoolItem* Svx3DSmoothLidsItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new Svx3DSmoothLidsItem(*this);
+}
+
//////////////////////////////////////////////////////////////////////////////
// #107245#
@@ -341,6 +152,11 @@ SfxPoolItem* Svx3DCharacterModeItem::Create(SvStream& rIn, sal_uInt16 nItemVersi
return pRetval;
}
+SfxPoolItem* Svx3DCharacterModeItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new Svx3DCharacterModeItem(*this);
+}
+
//////////////////////////////////////////////////////////////////////////////
// #107245#
@@ -366,6 +182,11 @@ SfxPoolItem* Svx3DCloseFrontItem::Create(SvStream& rIn, sal_uInt16 nItemVersion)
return pRetval;
}
+SfxPoolItem* Svx3DCloseFrontItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new Svx3DCloseFrontItem(*this);
+}
+
//////////////////////////////////////////////////////////////////////////////
// #107245#
@@ -391,8 +212,17 @@ SfxPoolItem* Svx3DCloseBackItem::Create(SvStream& rIn, sal_uInt16 nItemVersion)
return pRetval;
}
+SfxPoolItem* Svx3DCloseBackItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new Svx3DCloseBackItem(*this);
+}
+
//////////////////////////////////////////////////////////////////////////////
+Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal)
+: SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND, nVal)
+{}
+
// Svx3DNormalsKindItem: use drawing::NormalsKind
sal_Bool Svx3DNormalsKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -414,6 +244,12 @@ SfxPoolItem* Svx3DNormalsKindItem::Clone(SfxItemPool* /*pPool*/) const
return new Svx3DNormalsKindItem(*this);
}
+//////////////////////////////////////////////////////////////////////////////
+
+Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal)
+: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X, nVal)
+{}
+
// Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode
sal_Bool Svx3DTextureProjectionXItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -435,6 +271,12 @@ SfxPoolItem* Svx3DTextureProjectionXItem::Clone(SfxItemPool* /*pPool*/) const
return new Svx3DTextureProjectionXItem(*this);
}
+//////////////////////////////////////////////////////////////////////////////
+
+Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal)
+: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y, nVal)
+{}
+
// Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode
sal_Bool Svx3DTextureProjectionYItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -456,6 +298,12 @@ SfxPoolItem* Svx3DTextureProjectionYItem::Clone(SfxItemPool* /*pPool*/) const
return new Svx3DTextureProjectionYItem(*this);
}
+//////////////////////////////////////////////////////////////////////////////
+
+Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal)
+: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND, nVal)
+{}
+
// Svx3DTextureKindItem: use drawing::TextureKind
sal_Bool Svx3DTextureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -477,6 +325,12 @@ SfxPoolItem* Svx3DTextureKindItem::Clone(SfxItemPool* /*pPool*/) const
return new Svx3DTextureKindItem(*this);
}
+//////////////////////////////////////////////////////////////////////////////
+
+Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal)
+: SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE, nVal)
+{}
+
// Svx3DTextureModeItem: use drawing:TextureMode
sal_Bool Svx3DTextureModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -498,6 +352,12 @@ SfxPoolItem* Svx3DTextureModeItem::Clone(SfxItemPool* /*pPool*/) const
return new Svx3DTextureModeItem(*this);
}
+//////////////////////////////////////////////////////////////////////////////
+
+Svx3DPerspectiveItem::Svx3DPerspectiveItem(sal_uInt16 nVal)
+: SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, nVal)
+{}
+
// Svx3DPerspectiveItem: use drawing::ProjectionMode
sal_Bool Svx3DPerspectiveItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -519,6 +379,12 @@ SfxPoolItem* Svx3DPerspectiveItem::Clone(SfxItemPool* /*pPool*/) const
return new Svx3DPerspectiveItem(*this);
}
+//////////////////////////////////////////////////////////////////////////////
+
+Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal)
+: SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE, nVal)
+{}
+
// Svx3DShadeModeItem: use drawing::ShadeMode
sal_Bool Svx3DShadeModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -540,4 +406,5 @@ SfxPoolItem* Svx3DShadeModeItem::Clone(SfxItemPool* /*pPool*/) const
return new Svx3DShadeModeItem(*this);
}
+//////////////////////////////////////////////////////////////////////////////
// EOF
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 6f864680c067..08ad4a965f1c 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -28,7 +28,7 @@
#include <svx/svdogrp.hxx>
#include <svx/svdopath.hxx>
#include <tools/shl.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdpool.hxx>
#include <svx/svdorect.hxx>
#include <svx/svdmodel.hxx>
@@ -45,7 +45,6 @@
#include <svx/sphere3d.hxx>
#include <svx/extrud3d.hxx>
#include <svx/cube3d.hxx>
-#include <svx/polysc3d.hxx>
#include "dragmt3d.hxx"
#include <svx/view3d.hxx>
#include <svx/svdundo.hxx>
@@ -72,11 +71,12 @@
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <svx/svdlegacy.hxx>
+#include <editeng/eeitem.hxx>
+#include <svx/scene3d.hxx>
#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
-TYPEINIT1(E3dView, SdrView);
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Migrate Marking
@@ -88,8 +88,8 @@ class Impl3DMirrorConstructOverlay
// the view
const E3dView& mrView;
- // the object count
- sal_uInt32 mnCount;
+ // the selected objects
+ SdrObjectVector maSelection;
// the unmirrored polygons
basegfx::B2DPolyPolygon* mpPolygons;
@@ -101,54 +101,45 @@ public:
Impl3DMirrorConstructOverlay(const E3dView& rView);
~Impl3DMirrorConstructOverlay();
- void SetMirrorAxis(Point aMirrorAxisA, Point aMirrorAxisB);
+ void SetMirrorAxis(const basegfx::B2DPoint& rMirrorAxisA, const basegfx::B2DPoint& rMirrorAxisB);
};
Impl3DMirrorConstructOverlay::Impl3DMirrorConstructOverlay(const E3dView& rView)
: maObjects(),
mrView(rView),
- mnCount(rView.GetMarkedObjectCount()),
+ maSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView()),
mpPolygons(0),
maFullOverlay()
{
- if(mnCount)
+ if(mrView.IsSolidDragging())
{
- if(mrView.IsSolidDragging())
+ if(rView.GetSdrPageView() && rView.GetSdrPageView()->PageWindowCount())
{
- SdrPageView* pPV = rView.GetSdrPageView();
-
- if(pPV && pPV->PageWindowCount())
- {
- sdr::contact::ObjectContact& rOC = pPV->GetPageWindow(0)->GetObjectContact();
- sdr::contact::DisplayInfo aDisplayInfo;
-
- // Do not use the last ViewPort set at the OC at the last ProcessDisplay()
- rOC.resetViewPort();
+ sdr::contact::ObjectContact& rOC = rView.GetSdrPageView()->GetPageWindow(0)->GetObjectContact();
+ sdr::contact::DisplayInfo aDisplayInfo;
- for(sal_uInt32 a(0);a < mnCount;a++)
- {
- SdrObject* pObject = mrView.GetMarkedObjectByIndex(a);
+ // Do not use the last ViewPort set at the OC at the last ProcessDisplay()
+ rOC.resetViewPort();
- if(pObject)
- {
- sdr::contact::ViewContact& rVC = pObject->GetViewContact();
- sdr::contact::ViewObjectContact& rVOC = rVC.GetViewObjectContact(rOC);
+ for(sal_uInt32 a(0); a < maSelection.size(); a++)
+ {
+ SdrObject* pObject = maSelection[a];
+ sdr::contact::ViewContact& rVC = pObject->GetViewContact();
+ sdr::contact::ViewObjectContact& rVOC = rVC.GetViewObjectContact(rOC);
- const drawinglayer::primitive2d::Primitive2DSequence aNewSequence(rVOC.getPrimitive2DSequenceHierarchy(aDisplayInfo));
- drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(maFullOverlay, aNewSequence);
- }
- }
+ const drawinglayer::primitive2d::Primitive2DSequence aNewSequence(rVOC.getPrimitive2DSequenceHierarchy(aDisplayInfo));
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(maFullOverlay, aNewSequence);
}
}
- else
- {
- mpPolygons = new basegfx::B2DPolyPolygon[mnCount];
+ }
+ else
+ {
+ mpPolygons = new basegfx::B2DPolyPolygon[maSelection.size()];
- for(sal_uInt32 a(0); a < mnCount; a++)
- {
- SdrObject* pObject = mrView.GetMarkedObjectByIndex(a);
- mpPolygons[mnCount - (a + 1)] = pObject->TakeXorPoly();
- }
+ for(sal_uInt32 a(0); a < maSelection.size(); a++)
+ {
+ SdrObject* pObject = maSelection[a];
+ mpPolygons[maSelection.size() - (a + 1)] = pObject->TakeXorPoly();
}
}
}
@@ -164,7 +155,7 @@ Impl3DMirrorConstructOverlay::~Impl3DMirrorConstructOverlay()
}
}
-void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirrorAxisB)
+void Impl3DMirrorConstructOverlay::SetMirrorAxis(const basegfx::B2DPoint& rMirrorAxisA, const basegfx::B2DPoint& rMirrorAxisB)
{
// get rid of old overlay objects
maObjects.clear();
@@ -179,13 +170,12 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
{
// buld transfoprmation: translate and rotate so that given edge is
// on x axis, them mirror in y and translate back
- const basegfx::B2DVector aEdge(aMirrorAxisB.X() - aMirrorAxisA.X(), aMirrorAxisB.Y() - aMirrorAxisA.Y());
- basegfx::B2DHomMatrix aMatrixTransform(basegfx::tools::createTranslateB2DHomMatrix(
- -aMirrorAxisA.X(), -aMirrorAxisA.Y()));
+ const basegfx::B2DVector aEdge(rMirrorAxisB - rMirrorAxisA);
+ basegfx::B2DHomMatrix aMatrixTransform(basegfx::tools::createTranslateB2DHomMatrix(-rMirrorAxisA));
aMatrixTransform.rotate(-atan2(aEdge.getY(), aEdge.getX()));
aMatrixTransform.scale(1.0, -1.0);
aMatrixTransform.rotate(atan2(aEdge.getY(), aEdge.getX()));
- aMatrixTransform.translate(aMirrorAxisA.X(), aMirrorAxisA.Y());
+ aMatrixTransform.translate(rMirrorAxisA.getX(), rMirrorAxisA.getY());
if(mrView.IsSolidDragging())
{
@@ -213,7 +203,7 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
}
else
{
- for(sal_uInt32 b(0); b < mnCount; b++)
+ for(sal_uInt32 b(0); b < maSelection.size(); b++)
{
// apply to polygon
basegfx::B2DPolyPolygon aPolyPolygon(mpPolygons[b]);
@@ -234,8 +224,8 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
|*
\************************************************************************/
-E3dView::E3dView(SdrModel* pModel, OutputDevice* pOut) :
- SdrView(pModel, pOut)
+E3dView::E3dView(SdrModel& rModel, OutputDevice* pOut)
+: SdrView(rModel, pOut)
{
InitView ();
}
@@ -250,26 +240,37 @@ E3dView::E3dView(SdrModel* pModel, OutputDevice* pOut) :
void E3dView::DrawMarkedObj(OutputDevice& rOut) const
{
// Existieren 3D-Objekte, deren Szenen nicht selektiert sind?
- sal_Bool bSpecialHandling = sal_False;
+ bool bSpecialHandling = false;
E3dScene *pScene = NULL;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_Int32 nObjs(0);
- long nCnt = GetMarkedObjectCount();
- for(long nObjs = 0;nObjs < nCnt;nObjs++)
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
- if(pObj && pObj->ISA(E3dCompoundObject))
+ SdrObject *pObj = aSelection[nObjs];
+ E3dCompoundObject* pE3dCompoundObject = dynamic_cast< E3dCompoundObject* >(pObj);
+ E3dObject* pE3dObject = dynamic_cast< E3dObject* >(pObj);
+
+ if(pE3dCompoundObject)
{
// zugehoerige Szene
- pScene = ((E3dCompoundObject*)pObj)->GetScene();
- if(pScene && !IsObjMarked(pScene))
- bSpecialHandling = sal_True;
+ pScene = pE3dCompoundObject->GetScene();
+
+ if(pScene && !IsObjMarked(*pScene))
+ {
+ bSpecialHandling = true;
+ }
}
+
// Alle SelectionFlags zuruecksetzen
- if(pObj && pObj->ISA(E3dObject))
+ if(pE3dObject)
{
- pScene = ((E3dObject*)pObj)->GetScene();
+ pScene = pE3dObject->GetScene();
+
if(pScene)
- pScene->SetSelected(sal_False);
+ {
+ pScene->SetSelected(false);
+ }
}
}
@@ -277,55 +278,53 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const
{
// SelectionFlag bei allen zu 3D Objekten gehoerigen
// Szenen und deren Objekten auf nicht selektiert setzen
- long nObjs;
- for(nObjs = 0;nObjs < nCnt;nObjs++)
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
- if(pObj && pObj->ISA(E3dCompoundObject))
+ E3dCompoundObject* pE3dCompoundObject = dynamic_cast< E3dCompoundObject* >(aSelection[nObjs]);
+
+ if(pE3dCompoundObject)
{
// zugehoerige Szene
- pScene = ((E3dCompoundObject*)pObj)->GetScene();
+ pScene = pE3dCompoundObject->GetScene();
if(pScene)
- pScene->SetSelected(sal_False);
+ pScene->SetSelected(false);
}
}
// bei allen direkt selektierten Objekten auf selektiert setzen
- SdrMark* pM = NULL;
-
- for(nObjs = 0;nObjs < nCnt;nObjs++)
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
- if(pObj && pObj->ISA(E3dObject))
+ E3dObject* pE3dObject = dynamic_cast< E3dObject* >(aSelection[nObjs]);
+
+ if(pE3dObject)
{
// Objekt markieren
- E3dObject* p3DObj = (E3dObject*)pObj;
- p3DObj->SetSelected(sal_True);
- pScene = p3DObj->GetScene();
- pM = GetSdrMarkByIndex(nObjs);
+ pE3dObject->SetSelected(true);
+ pScene = pE3dObject->GetScene();
}
}
if(pScene)
{
- // code from parent
- SortMarkedObjects();
-
- pScene->SetDrawOnlySelected(sal_True);
+ pScene->SetDrawOnlySelected(true);
pScene->SingleObjectPainter(rOut); // #110094#-17
- pScene->SetDrawOnlySelected(sal_False);
+ pScene->SetDrawOnlySelected(false);
}
// SelectionFlag zuruecksetzen
- for(nObjs = 0;nObjs < nCnt;nObjs++)
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
- if(pObj && pObj->ISA(E3dCompoundObject))
+ E3dCompoundObject* pE3dCompoundObject = dynamic_cast< E3dCompoundObject* >(aSelection[nObjs]);
+
+ if(pE3dCompoundObject)
{
// zugehoerige Szene
- pScene = ((E3dCompoundObject*)pObj)->GetScene();
+ pScene = pE3dCompoundObject->GetScene();
+
if(pScene)
- pScene->SetSelected(sal_False);
+ {
+ pScene->SetSelected(false);
+ }
}
}
}
@@ -347,30 +346,32 @@ SdrModel* E3dView::GetMarkedObjModel() const
{
// Existieren 3D-Objekte, deren Szenen nicht selektiert sind?
bool bSpecialHandling(false);
- const sal_uInt32 nCount(GetMarkedObjectCount());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
sal_uInt32 nObjs(0);
E3dScene *pScene = 0;
- for(nObjs = 0; nObjs < nCount; nObjs++)
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
{
- const SdrObject* pObj = GetMarkedObjectByIndex(nObjs);
+ const SdrObject* pObj = aSelection[nObjs];
+ const E3dCompoundObject* pE3dCompoundObject = dynamic_cast< const E3dCompoundObject* >(pObj);
+ const E3dObject* pE3dObject = dynamic_cast< const E3dObject* >(pObj);
- if(!bSpecialHandling && pObj && pObj->ISA(E3dCompoundObject))
+ if(!bSpecialHandling && pE3dCompoundObject)
{
// if the object is selected, but it's scene not,
// we need special handling
- pScene = ((E3dCompoundObject*)pObj)->GetScene();
+ pScene = pE3dCompoundObject->GetScene();
- if(pScene && !IsObjMarked(pScene))
+ if(pScene && !IsObjMarked(*pScene))
{
bSpecialHandling = true;
}
}
- if(pObj && pObj->ISA(E3dObject))
+ if(pE3dObject)
{
// reset all selection flags at 3D objects
- pScene = ((E3dObject*)pObj)->GetScene();
+ pScene = pE3dObject->GetScene();
if(pScene)
{
@@ -386,41 +387,38 @@ SdrModel* E3dView::GetMarkedObjModel() const
}
SdrModel* pNewModel = 0;
- Rectangle aSelectedSnapRect;
+ basegfx::B2DRange aSelectedSnapRange;
// set 3d selection flags at all directly selected objects
// and collect SnapRect of selected objects
- for(nObjs = 0; nObjs < nCount; nObjs++)
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
+ E3dCompoundObject* pE3dCompoundObject = dynamic_cast< E3dCompoundObject* >(aSelection[nObjs]);
- if(pObj && pObj->ISA(E3dCompoundObject))
+ if(pE3dCompoundObject)
{
// mark object, but not scenes
- E3dCompoundObject* p3DObj = (E3dCompoundObject*)pObj;
- p3DObj->SetSelected(true);
- aSelectedSnapRect.Union(p3DObj->GetSnapRect());
+ pE3dCompoundObject->SetSelected(true);
+
+ aSelectedSnapRange.expand(sdr::legacy::GetSnapRange(*pE3dCompoundObject));
}
}
// create new mark list which contains all indirectly selected3d
// scenes as selected objects
- SdrMarkList aOldML(GetMarkedObjectList());
- SdrMarkList aNewML;
- SdrMarkList& rCurrentMarkList = ((E3dView*)this)->GetMarkedObjectListWriteAccess();
- rCurrentMarkList = aNewML;
+ const_cast< E3dView* >(this)->UnmarkAllObj();
- for(nObjs = 0; nObjs < nCount; nObjs++)
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
{
- SdrObject *pObj = aOldML.GetMark(nObjs)->GetMarkedSdrObj();
+ const E3dObject* pE3dObject = dynamic_cast< const E3dObject* >(aSelection[nObjs]);
- if(pObj && pObj->ISA(E3dObject))
+ if(pE3dObject)
{
- pScene = ((E3dObject*)pObj)->GetScene();
+ pScene = pE3dObject->GetScene();
- if(pScene && !IsObjMarked(pScene) && GetSdrPageView())
+ if(pScene && !IsObjMarked(*pScene) && GetSdrPageView())
{
- ((E3dView*)this)->MarkObj(pScene, GetSdrPageView(), sal_False, sal_True);
+ const_cast< E3dView* >(this)->MarkObj(*pScene, false);
}
}
}
@@ -431,32 +429,35 @@ SdrModel* E3dView::GetMarkedObjModel() const
if(pNewModel)
{
- for(sal_uInt16 nPg(0); nPg < pNewModel->GetPageCount(); nPg++)
+ for(sal_uInt32 nPg(0); nPg < pNewModel->GetPageCount(); nPg++)
{
const SdrPage* pSrcPg=pNewModel->GetPage(nPg);
const sal_uInt32 nObAnz(pSrcPg->GetObjCount());
for(sal_uInt32 nOb(0); nOb < nObAnz; nOb++)
{
- const SdrObject* pSrcOb=pSrcPg->GetObj(nOb);
+ E3dScene* pE3dScene = dynamic_cast< E3dScene* >(pSrcPg->GetObj(nOb));
- if(pSrcOb->ISA(E3dScene))
+ if(pE3dScene)
{
- pScene = (E3dScene*)pSrcOb;
-
// delete all not intentionally cloned 3d objects
- pScene->removeAllNonSelectedObjects();
+ pE3dScene->removeAllNonSelectedObjects();
// reset select flags and set SnapRect of all selected objects
- pScene->SetSelected(false);
- pScene->SetSnapRect(aSelectedSnapRect);
+ pE3dScene->SetSelected(false);
+ sdr::legacy::SetSnapRange(*pE3dScene, aSelectedSnapRange);
}
}
}
}
// restore old selection
- rCurrentMarkList = aOldML;
+ const_cast< E3dView* >(this)->UnmarkAllObj();
+
+ for(nObjs = 0; nObjs < aSelection.size(); nObjs++)
+ {
+ const_cast< E3dView* >(this)->MarkObj(const_cast< SdrObject& >(*aSelection[nObjs]), false);
+ }
// model zurueckgeben
return pNewModel;
@@ -469,43 +470,38 @@ SdrModel* E3dView::GetMarkedObjModel() const
|*
\************************************************************************/
-sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool E3dView::Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
{
- sal_Bool bRetval = sal_False;
+ bool bRetval = false;
// Liste holen
- Point aPos(rPos);
SdrObjList* pDstList = pLst;
- ImpGetPasteObjList(aPos, pDstList);
+ ImpGetPasteObjList(pDstList);
if(!pDstList)
- return sal_False;
+ return false;
// Owner der Liste holen
- SdrObject* pOwner = pDstList->GetOwnerObj();
- if(pOwner && pOwner->ISA(E3dScene))
+ E3dScene* pDstScene = dynamic_cast< E3dScene* >(pDstList->getSdrObjectFromSdrObjList());
+
+ if(pDstScene)
{
- E3dScene* pDstScene = (E3dScene*)pOwner;
BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXCHANGE_PASTE));
// Alle Objekte aus E3dScenes kopieren und direkt einfuegen
- for(sal_uInt16 nPg(0); nPg < rMod.GetPageCount(); nPg++)
+ for(sal_uInt32 nPg(0); nPg < rMod.GetPageCount(); nPg++)
{
const SdrPage* pSrcPg=rMod.GetPage(nPg);
sal_uInt32 nObAnz(pSrcPg->GetObjCount());
- // calculate offset for paste
- Rectangle aR = pSrcPg->GetAllObjBoundRect();
- Point aDist(aPos - aR.Center());
-
// Unterobjekte von Szenen einfuegen
for(sal_uInt32 nOb(0); nOb < nObAnz; nOb++)
{
- const SdrObject* pSrcOb = pSrcPg->GetObj(nOb);
- if(pSrcOb->ISA(E3dScene))
+ E3dScene* pSrcScene = dynamic_cast< E3dScene* >(pSrcPg->GetObj(nOb));
+
+ if(pSrcScene)
{
- E3dScene* pSrcScene = (E3dScene*)pSrcOb;
- ImpCloneAll3DObjectsToDestScene(pSrcScene, pDstScene, aDist);
+ ImpCloneAll3DObjectsToDestScene(pSrcScene, pDstScene);
}
}
}
@@ -522,9 +518,9 @@ sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLs
}
// #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
-sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point /*aOffset*/)
+bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene)
{
- sal_Bool bRetval(sal_False);
+ bool bRetval(false);
if(pSrcScene && pDstScene)
{
@@ -533,14 +529,14 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene*
const sdr::contact::ViewContactOfE3dScene& rVCSceneSrc = static_cast< sdr::contact::ViewContactOfE3dScene& >(pSrcScene->GetViewContact());
const drawinglayer::geometry::ViewInformation3D aViewInfo3DSrc(rVCSceneSrc.getViewInformation3D());
- for(sal_uInt32 i(0); i < pSrcScene->GetSubList()->GetObjCount(); i++)
+ for(sal_uInt32 i(0); i < pSrcScene->GetObjCount(); i++)
{
- E3dCompoundObject* pCompoundObj = dynamic_cast< E3dCompoundObject* >(pSrcScene->GetSubList()->GetObj(i));
+ E3dCompoundObject* pCompoundObj = dynamic_cast< E3dCompoundObject* >(pSrcScene->GetObj(i));
if(pCompoundObj)
{
// #116235#
- E3dCompoundObject* pNewCompoundObj = dynamic_cast< E3dCompoundObject* >(pCompoundObj->Clone());
+ E3dCompoundObject* pNewCompoundObj = dynamic_cast< E3dCompoundObject* >(pCompoundObj->CloneSdrObject());
if(pNewCompoundObj)
{
@@ -550,7 +546,7 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene*
aSceneRange.transform(aSceneToWorldTrans);
// get new object's implied object transformation
- const basegfx::B3DHomMatrix aNewObjectTrans(pNewCompoundObj->GetTransform());
+ const basegfx::B3DHomMatrix aNewObjectTrans(pNewCompoundObj->GetB3DTransform());
// get new object's range in 3D world coordinates in dest scene
// as if it were already added
@@ -597,13 +593,13 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene*
basegfx::B3DHomMatrix aModifyingTransform(aObjectToWorldTrans);
// translate to absolute center in 3d world coor
- aModifyingTransform.translate(-aObjectCenter.getX(), -aObjectCenter.getY(), -aObjectCenter.getZ());
+ aModifyingTransform.translate(-aObjectCenter);
// scale to dest size in 3d world coor
aModifyingTransform.scale(fScale, fScale, fScale);
// translate to dest scene center in 3d world coor
- aModifyingTransform.translate(aSceneCenter.getX(), aSceneCenter.getY(), aSceneCenter.getZ());
+ aModifyingTransform.translate(aSceneCenter);
// transform from 3d world to dest object coordinates
basegfx::B3DHomMatrix aWorldToObject(aObjectToWorldTrans);
@@ -611,19 +607,19 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene*
aModifyingTransform = aWorldToObject * aModifyingTransform;
// correct implied object transform by applying changing one in object coor
- pNewCompoundObj->SetTransform(aModifyingTransform * aNewObjectTrans);
+ pNewCompoundObj->SetB3DTransform(aModifyingTransform * aNewObjectTrans);
// fill and insert new object
- pNewCompoundObj->SetModel(pDstScene->GetModel());
- pNewCompoundObj->SetPage(pDstScene->GetPage());
- pNewCompoundObj->NbcSetLayer(pCompoundObj->GetLayer());
- pNewCompoundObj->NbcSetStyleSheet(pCompoundObj->GetStyleSheet(), sal_True);
- pDstScene->Insert3DObj(pNewCompoundObj);
- bRetval = sal_True;
+ pNewCompoundObj->SetLayer(pCompoundObj->GetLayer());
+ pNewCompoundObj->SetStyleSheet(pCompoundObj->GetStyleSheet(), true);
+ pDstScene->Insert3DObj(*pNewCompoundObj);
+ bRetval = true;
// Undo anlegen
- if( GetModel()->IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNewCompoundObj));
+ if( getSdrModelFromSdrView().IsUndoEnabled() )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pNewCompoundObj));
+ }
}
}
}
@@ -638,49 +634,48 @@ sal_Bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene*
|*
\************************************************************************/
-sal_Bool E3dView::IsConvertTo3DObjPossible() const
+bool E3dView::IsConvertTo3DObjPossible() const
{
- sal_Bool bAny3D(sal_False);
- sal_Bool bGroupSelected(sal_False);
- sal_Bool bRetval(sal_True);
+ bool bAny3D(false);
+ bool bGroupSelected(false);
+ bool bRetval(true);
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for(sal_uInt32 a=0;!bAny3D && a<GetMarkedObjectCount();a++)
+ for(sal_uInt32 a(0); !bAny3D && a < aSelection.size(); a++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(a);
- if(pObj)
- {
+ SdrObject *pObj = aSelection[a];
ImpIsConvertTo3DPossible(pObj, bAny3D, bGroupSelected);
- }
}
bRetval = !bAny3D
&& (
- IsConvertToPolyObjPossible(sal_False)
- || IsConvertToPathObjPossible(sal_False)
+ IsConvertToPolyObjPossible(false)
+ || IsConvertToPathObjPossible(false)
|| IsImportMtfPossible());
+
return bRetval;
}
-void E3dView::ImpIsConvertTo3DPossible(SdrObject* pObj, sal_Bool& rAny3D,
- sal_Bool& rGroupSelected) const
+void E3dView::ImpIsConvertTo3DPossible(SdrObject* pObj, bool& rAny3D,
+ bool& rGroupSelected) const
{
if(pObj)
{
- if(pObj->ISA(E3dObject))
+ if(dynamic_cast< E3dObject* >(pObj))
{
- rAny3D = sal_True;
+ rAny3D = true;
}
else
{
- if(pObj->IsGroupObject())
+ if(pObj->getChildrenOfSdrObject())
{
- SdrObjListIter aIter(*pObj, IM_DEEPNOGROUPS);
+ SdrObjListIter aIter(*pObj->getChildrenOfSdrObject(), IM_DEEPNOGROUPS);
while(aIter.IsMore())
{
SdrObject* pNewObj = aIter.Next();
ImpIsConvertTo3DPossible(pNewObj, rAny3D, rGroupSelected);
}
- rGroupSelected = sal_True;
+ rGroupSelected = true;
}
}
}
@@ -691,67 +686,75 @@ void E3dView::ImpIsConvertTo3DPossible(SdrObject* pObj, sal_Bool& rAny3D,
|* 3D-Konvertierung zu Extrude ausfuehren
|*
\************************************************************************/
-#include <editeng/eeitem.hxx>
void E3dView::ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj)
{
- if(pObj->ISA(SdrTextObj))
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pObj);
+
+ if(pSdrTextObj)
{
- const SfxItemSet& rSet = pObj->GetMergedItemSet();
+ const SfxItemSet& rSet = pSdrTextObj->GetMergedItemSet();
const SvxColorItem& rTextColorItem = (const SvxColorItem&)rSet.Get(EE_CHAR_COLOR);
if(rTextColorItem.GetValue() == RGB_Color(COL_BLACK))
{
// Bei schwarzen Textobjekten wird die Farbe auf grau gesetzt
- if(pObj->GetPage())
+ if(pSdrTextObj->getSdrPageFromSdrObject())
{
// #84864# if black is only default attribute from
// pattern set it hard so that it is used in undo.
- pObj->SetMergedItem(SvxColorItem(RGB_Color(COL_BLACK), EE_CHAR_COLOR));
+ pSdrTextObj->SetMergedItem(SvxColorItem(RGB_Color(COL_BLACK), EE_CHAR_COLOR));
// add undo now
- if( GetModel()->IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj, false, false));
+ if( getSdrModelFromSdrView().IsUndoEnabled() )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pSdrTextObj, false, false));
+ }
}
- pObj->SetMergedItem(SvxColorItem(RGB_Color(COL_GRAY), EE_CHAR_COLOR));
+ pSdrTextObj->SetMergedItem(SvxColorItem(RGB_Color(COL_GRAY), EE_CHAR_COLOR));
}
}
}
void E3dView::ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj)
{
- if(pObj->ISA(SdrPathObj))
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+
+ if(pSdrPathObj)
{
- const SfxItemSet& rSet = pObj->GetMergedItemSet();
+ const SfxItemSet& rSet = pSdrPathObj->GetMergedItemSet();
sal_Int32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
XLineStyle eLineStyle = (XLineStyle)((const XLineStyleItem&)rSet.Get(XATTR_LINESTYLE)).GetValue();
XFillStyle eFillStyle = ITEMVALUE(rSet, XATTR_FILLSTYLE, XFillStyleItem);
- if(((SdrPathObj*)pObj)->IsClosed()
+ if(pSdrPathObj->isClosed()
&& eLineStyle == XLINE_SOLID
&& !nLineWidth
&& eFillStyle != XFILL_NONE)
{
- if(pObj->GetPage() && GetModel()->IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj, false, false));
- pObj->SetMergedItem(XLineStyleItem(XLINE_NONE));
- pObj->SetMergedItem(XLineWidthItem(0L));
+ if(pSdrPathObj->getSdrPageFromSdrObject() && getSdrModelFromSdrView().IsUndoEnabled() )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pSdrPathObj, false, false));
+ }
+
+ pSdrPathObj->SetMergedItem(XLineStyleItem(XLINE_NONE));
+ pSdrPathObj->SetMergedItem(XLineWidthItem(0L));
}
}
}
-void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal_Bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat)
+void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat)
{
// Einzelnes PathObject, dieses umwanden
- SdrPathObj* pPath = PTR_CAST(SdrPathObj, pObj);
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(pObj);
if(pPath)
{
E3dDefaultAttributes aDefault = Get3DDefaultAttributes();
if(bExtrude)
- aDefault.SetDefaultExtrudeCharacterMode(sal_True);
+ aDefault.SetDefaultExtrudeCharacterMode(true);
else
- aDefault.SetDefaultLatheCharacterMode(sal_True);
+ aDefault.SetDefaultLatheCharacterMode(true);
// ItemSet des Ursprungsobjektes holen
SfxItemSet aSet(pObj->GetMergedItemSet());
@@ -762,15 +765,15 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal
aSet.Put(XLineStyleItem(XLINE_NONE));
// Feststellen, ob ein FILL_Attribut gesetzt ist.
- if(!pPath->IsClosed() || eFillStyle == XFILL_NONE)
+ if(!pPath->isClosed() || eFillStyle == XFILL_NONE)
{
// Das SdrPathObj ist nicht gefuellt, lasse die
// vordere und hintere Flaeche weg. Ausserdem ist
// eine beidseitige Darstellung notwendig.
- aDefault.SetDefaultExtrudeCloseFront(sal_False);
- aDefault.SetDefaultExtrudeCloseBack(sal_False);
+ aDefault.SetDefaultExtrudeCloseFront(false);
+ aDefault.SetDefaultExtrudeCloseBack(false);
- aSet.Put(Svx3DDoubleSidedItem(sal_True));
+ aSet.Put(SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, true));
// Fuellattribut setzen
aSet.Put(XFillStyleItem(XFILL_SOLID));
@@ -783,40 +786,46 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, sal
// Neues Extrude-Objekt erzeugen
E3dObject* p3DObj = NULL;
+
if(bExtrude)
{
- p3DObj = new E3dExtrudeObj(aDefault, pPath->GetPathPoly(), fDepth);
+ p3DObj = new E3dExtrudeObj(
+ getSdrModelFromSdrView(),
+ aDefault,
+ pPath->getB2DPolyPolygonInObjectCoordinates(),
+ fDepth);
}
else
{
- basegfx::B2DPolyPolygon aPolyPoly2D(pPath->GetPathPoly());
+ basegfx::B2DPolyPolygon aPolyPoly2D(pPath->getB2DPolyPolygonInObjectCoordinates());
aPolyPoly2D.transform(rLatheMat);
- p3DObj = new E3dLatheObj(aDefault, aPolyPoly2D);
+ p3DObj = new E3dLatheObj(
+ getSdrModelFromSdrView(),
+ aDefault,
+ aPolyPoly2D);
}
// Attribute setzen
if(p3DObj)
{
- p3DObj->NbcSetLayer(pObj->GetLayer());
-
+ p3DObj->SetLayer(pObj->GetLayer());
p3DObj->SetMergedItemSet(aSet);
-
- p3DObj->NbcSetStyleSheet(pObj->GetStyleSheet(), sal_True);
+ p3DObj->SetStyleSheet(pObj->GetStyleSheet(), true);
// Neues 3D-Objekt einfuegen
- pScene->Insert3DObj(p3DObj);
+ pScene->Insert3DObj(*p3DObj);
}
}
}
-void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat)
+void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix& rLatheMat)
{
if(pObj)
{
// change text color attribute for not so dark colors
- if(pObj->IsGroupObject())
+ if(pObj->getChildrenOfSdrObject())
{
- SdrObjListIter aIter(*pObj, IM_DEEPWITHGROUPS);
+ SdrObjListIter aIter(*pObj->getChildrenOfSdrObject(), IM_DEEPWITHGROUPS);
while(aIter.IsMore())
{
SdrObject* pGroupMember = aIter.Next();
@@ -827,14 +836,14 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExt
ImpChangeSomeAttributesFor3DConversion(pObj);
// convert completely to path objects
- SdrObject* pNewObj1 = pObj->ConvertToPolyObj(sal_False, sal_False);
+ SdrObject* pNewObj1 = pObj->ConvertToPolyObj(false, false);
if(pNewObj1)
{
// change text color attribute for not so dark colors
- if(pNewObj1->IsGroupObject())
+ if(pNewObj1->getChildrenOfSdrObject())
{
- SdrObjListIter aIter(*pNewObj1, IM_DEEPWITHGROUPS);
+ SdrObjListIter aIter(*pNewObj1->getChildrenOfSdrObject(), IM_DEEPWITHGROUPS);
while(aIter.IsMore())
{
SdrObject* pGroupMember = aIter.Next();
@@ -845,14 +854,14 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExt
ImpChangeSomeAttributesFor3DConversion2(pNewObj1);
// convert completely to path objects
- SdrObject* pNewObj2 = pObj->ConvertToContourObj(pNewObj1, sal_True);
+ SdrObject* pNewObj2 = pObj->ConvertToContourObj(pNewObj1, true);
if(pNewObj2)
{
// add all to flat scene
- if(pNewObj2->IsGroupObject())
+ if(pNewObj2->getChildrenOfSdrObject())
{
- SdrObjListIter aIter(*pNewObj2, IM_DEEPWITHGROUPS);
+ SdrObjListIter aIter(*pNewObj2->getChildrenOfSdrObject(), IM_DEEPWITHGROUPS);
while(aIter.IsMore())
{
SdrObject* pGroupMember = aIter.Next();
@@ -864,12 +873,16 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExt
// delete zwi object
if(pNewObj2 != pObj && pNewObj2 != pNewObj1 && pNewObj2)
- SdrObject::Free( pNewObj2 );
+ {
+ deleteSdrObjectSafeAndClearPointer( pNewObj2 );
+ }
}
// delete zwi object
if(pNewObj1 != pObj && pNewObj1)
- SdrObject::Free( pNewObj1 );
+ {
+ deleteSdrObjectSafeAndClearPointer( pNewObj1 );
+ }
}
}
}
@@ -880,9 +893,9 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, sal_Bool bExt
|*
\************************************************************************/
-void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, basegfx::B2DPoint aPnt2)
+void E3dView::ConvertMarkedObjTo3D(bool bExtrude, basegfx::B2DPoint aPnt1, basegfx::B2DPoint aPnt2)
{
- if(AreObjectsMarked())
+ if(areSdrObjectsSelected())
{
// Undo anlegen
if(bExtrude)
@@ -891,26 +904,35 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b
BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_LATHE));
// Neue Szene fuer zu erzeugende 3D-Objekte anlegen
- E3dScene* pScene = new E3dPolyScene(Get3DDefaultAttributes());
+ E3dScene* pScene = new E3dScene(
+ getSdrModelFromSdrView(),
+ Get3DDefaultAttributes());
// Rechteck bestimmen und evtl. korrigieren
- Rectangle aRect = GetAllMarkedRect();
- if(aRect.GetWidth() <= 1)
- aRect.SetSize(Size(500, aRect.GetHeight()));
- if(aRect.GetHeight() <= 1)
- aRect.SetSize(Size(aRect.GetWidth(), 500));
+ basegfx::B2DRange aRange(getMarkedObjectSnapRange());
+
+ if(aRange.getWidth() < 500.0 || aRange.getHeight() < 500.0)
+ {
+ basegfx::B2DRange aCentered(aRange.getCenter());
+
+ aCentered.grow(500.0);
+ aRange.expand(aCentered);
+ }
// Tiefe relativ zur Groesse der Selektion bestimmen
- double fDepth = 0.0;
- double fRot3D = 0.0;
+ double fDepth(0.0);
+ double fRot3D(0.0);
basegfx::B2DHomMatrix aLatheMat;
if(bExtrude)
{
- double fW = (double)aRect.GetWidth();
- double fH = (double)aRect.GetHeight();
+ double fW = aRange.getWidth();
+ double fH = aRange.getHeight();
fDepth = sqrt(fW*fW + fH*fH) / 6.0;
}
+
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
if(!bExtrude)
{
// Transformation fuer Polygone Rotationskoerper erstellen
@@ -922,12 +944,13 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b
fRot3D = atan2(aDiff.getY(), aDiff.getX()) - F_PI2;
if(basegfx::fTools::equalZero(fabs(fRot3D)))
+ {
fRot3D = 0.0;
+ }
if(fRot3D != 0.0)
{
- aLatheMat = basegfx::tools::createRotateAroundPoint(aPnt2, -fRot3D)
- * aLatheMat;
+ aLatheMat = basegfx::tools::createRotateAroundPoint(aPnt2, -fRot3D) * aLatheMat;
}
}
@@ -938,7 +961,7 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b
}
else
{
- aLatheMat.translate((double)-aRect.Left(), 0.0);
+ aLatheMat.translate(-aRange.getMinX(), 0.0);
}
// Inverse Matrix bilden, um die Zielausdehnung zu bestimmen
@@ -947,55 +970,47 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b
// SnapRect Ausdehnung mittels Spiegelung an der Rotationsachse
// erweitern
- for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrMark* pMark = GetSdrMarkByIndex(a);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- Rectangle aTurnRect = pObj->GetSnapRect();
+ const SdrObject* pObj = aSelection[a];
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(*pObj));
basegfx::B2DPoint aRot;
Point aRotPnt;
- aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Top());
+ aRot = basegfx::B2DPoint(aSnapRange.getMinX(), -aSnapRange.getMinY());
aRot *= aLatheMat;
aRot.setX(-aRot.getX());
aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(Rectangle(aRotPnt, aRotPnt));
+ aRange.expand(aRot);
- aRot = basegfx::B2DPoint(aTurnRect.Left(), -aTurnRect.Bottom());
+ aRot = basegfx::B2DPoint(aSnapRange.getMinX(), -aSnapRange.getMaxY());
aRot *= aLatheMat;
aRot.setX(-aRot.getX());
aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(Rectangle(aRotPnt, aRotPnt));
+ aRange.expand(aRot);
- aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Top());
+ aRot = basegfx::B2DPoint(aSnapRange.getMaxX(), -aSnapRange.getMinY());
aRot *= aLatheMat;
aRot.setX(-aRot.getX());
aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(Rectangle(aRotPnt, aRotPnt));
+ aRange.expand(aRot);
- aRot = basegfx::B2DPoint(aTurnRect.Right(), -aTurnRect.Bottom());
+ aRot = basegfx::B2DPoint(aSnapRange.getMaxX(), -aSnapRange.getMaxY());
aRot *= aLatheMat;
aRot.setX(-aRot.getX());
aRot *= aInvLatheMat;
- aRotPnt = Point((long)(aRot.getX() + 0.5), (long)(-aRot.getY() - 0.5));
- aRect.Union(Rectangle(aRotPnt, aRotPnt));
+ aRange.expand(aRot);
}
}
// Ueber die Selektion gehen und in 3D wandeln, komplett mit
// Umwandeln in SdrPathObject, auch Schriften
- for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrMark* pMark = GetSdrMarkByIndex(a);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- ImpCreate3DObject(pScene, pObj, bExtrude, fDepth, aLatheMat);
+ ImpCreate3DObject(pScene, aSelection[a], bExtrude, fDepth, aLatheMat);
}
- if(pScene->GetSubList() && pScene->GetSubList()->GetObjCount() != 0)
+ if(pScene->GetObjCount())
{
// Alle angelegten Objekte Tiefenarrangieren
if(bExtrude)
@@ -1005,22 +1020,21 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b
basegfx::B3DPoint aCenter(pScene->GetBoundVolume().getCenter());
basegfx::B3DHomMatrix aMatrix;
- aMatrix.translate(-aCenter.getX(), -aCenter.getY(), -aCenter.getZ());
- pScene->SetTransform(aMatrix * pScene->GetTransform()); // #112587#
+ aMatrix.translate(-aCenter);
+ pScene->SetB3DTransform(aMatrix * pScene->GetB3DTransform()); // #112587#
// Szene initialisieren
- pScene->NbcSetSnapRect(aRect);
- basegfx::B3DRange aBoundVol = pScene->GetBoundVolume();
- InitScene(pScene, (double)aRect.GetWidth(), (double)aRect.GetHeight(), aBoundVol.getDepth());
+ sdr::legacy::SetSnapRange(*pScene, aRange);
+ const basegfx::B3DRange aBoundVol(pScene->GetBoundVolume());
+ InitScene(pScene, aRange.getWidth(), aRange.getHeight(), aBoundVol.getDepth());
// Szene anstelle des ersten selektierten Objektes einfuegen
// und alle alten Objekte weghauen
- SdrObject* pRepObj = GetMarkedObjectByIndex(0);
- SdrPageView* pPV = GetSdrPageViewOfMarkedByIndex(0);
- MarkObj(pRepObj, pPV, sal_True);
- ReplaceObjectAtView(pRepObj, *pPV, pScene, sal_False);
+ SdrObject* pRepObj = aSelection[0];
+ MarkObj(*pRepObj, true);
+ ReplaceObjectAtView(*pRepObj, *pScene, false);
DeleteMarked();
- MarkObj(pScene, pPV);
+ MarkObj(*pScene);
// Rotationskoerper um Rotationsachse drehen
basegfx::B3DHomMatrix aRotate;
@@ -1038,16 +1052,16 @@ void E3dView::ConvertMarkedObjTo3D(sal_Bool bExtrude, basegfx::B2DPoint aPnt1, b
if(!aRotate.isIdentity())
{
- pScene->SetTransform(aRotate * pScene->GetTransform());
+ pScene->SetB3DTransform(aRotate * pScene->GetB3DTransform());
}
// SnapRects der Objekte ungueltig
- pScene->SetSnapRect(aRect);
+ sdr::legacy::SetSnapRange(*pScene, aRange);
}
else
{
// Es wurden keine 3D Objekte erzeugt, schmeiss alles weg
- delete pScene;
+ deleteSdrObjectSafeAndClearPointer(pScene);
}
// Undo abschliessen
@@ -1099,9 +1113,9 @@ struct E3dDepthLayer
void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth)
{
- if(pScene && pScene->GetSubList() && pScene->GetSubList()->GetObjCount() > 1)
+ if(pScene && pScene->GetObjCount() > 1)
{
- SdrObjList* pSubList = pScene->GetSubList();
+ SdrObjList* pSubList = pScene->getChildrenOfSdrObject();
SdrObjListIter aIter(*pSubList, IM_FLAT);
E3dDepthLayer* pBaseLayer = NULL;
E3dDepthLayer* pLayer = NULL;
@@ -1152,12 +1166,12 @@ void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth)
if(aCompareColor == aLocalColor)
{
- bOverlap = sal_False;
+ bOverlap = false;
}
}
else if(eLocalFillStyle == XFILL_NONE)
{
- bOverlap = sal_False;
+ bOverlap = false;
}
}
}
@@ -1242,57 +1256,59 @@ void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth)
|*
\************************************************************************/
-sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
- SdrHdl* pHdl, short nMinMov,
- SdrDragMethod* pForcedMeth)
+bool E3dView::BegDragObj(const basegfx::B2DPoint& rPnt, const SdrHdl* pHdl, double fMinMovLogic, SdrDragMethod* pForcedMeth)
{
- if(Is3DRotationCreationActive() && GetMarkedObjectCount())
+ if(Is3DRotationCreationActive() && areSdrObjectsSelected())
{
// bestimme alle selektierten Polygone und gebe die gespiegelte Hilfsfigur aus
- mpMirrorOverlay->SetMirrorAxis(aRef1, aRef2);
+ mpMirrorOverlay->SetMirrorAxis(GetRef1(), GetRef2());
}
else
{
- sal_Bool bOwnActionNecessary;
+ bool bOwnActionNecessary;
if (pHdl == NULL)
{
- bOwnActionNecessary = sal_True;
+ bOwnActionNecessary = true;
}
else if (pHdl->IsVertexHdl() || pHdl->IsCornerHdl())
{
- bOwnActionNecessary = sal_True;
+ bOwnActionNecessary = true;
}
else
{
- bOwnActionNecessary = sal_False;
+ bOwnActionNecessary = false;
}
- if(bOwnActionNecessary && GetMarkedObjectCount() >= 1)
+ if(bOwnActionNecessary && areSdrObjectsSelected())
{
E3dDragConstraint eConstraint = E3DDRAG_CONSTR_XYZ;
- sal_Bool bThereAreRootScenes = sal_False;
- sal_Bool bThereAre3DObjects = sal_False;
- long nCnt = GetMarkedObjectCount();
- for(long nObjs = 0;nObjs < nCnt;nObjs++)
+ bool bThereAreRootScenes = false;
+ bool bThereAre3DObjects = false;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_Int32 nObjs(0); nObjs < aSelection.size(); nObjs++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
- if(pObj)
- {
- if(pObj->ISA(E3dScene) && ((E3dScene*)pObj)->GetScene() == pObj)
- bThereAreRootScenes = sal_True;
- if(pObj->ISA(E3dObject))
- bThereAre3DObjects = sal_True;
- }
+ SdrObject *pObj = aSelection[nObjs];
+ E3dScene* pE3dScene = dynamic_cast< E3dScene* >(pObj);
+ E3dObject* pE3dObject = dynamic_cast< E3dObject* >(pObj);
+
+ if(pE3dScene && pE3dScene->GetScene() == pE3dScene)
+ bThereAreRootScenes = true;
+
+ if(pE3dObject)
+ bThereAre3DObjects = true;
}
+
if( bThereAre3DObjects )
{
- eDragHdl = ( pHdl == NULL ? HDL_MOVE : pHdl->GetKind() );
- switch ( eDragMode )
+ meDragHdl = (!pHdl ? HDL_MOVE : pHdl->GetKind());
+
+ switch ( GetDragMode() )
{
case SDRDRAG_ROTATE:
case SDRDRAG_SHEAR:
{
- switch ( eDragHdl )
+ switch (GetDragHdlKind())
{
case HDL_LEFT:
case HDL_RIGHT:
@@ -1321,7 +1337,7 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
// die nicht erlaubten Rotationen ausmaskieren
eConstraint = E3dDragConstraint(eConstraint& eDragConstraint);
- pForcedMeth = new E3dDragRotate(*this, GetMarkedObjectList(), eConstraint, IsSolidDragging());
+ pForcedMeth = new E3dDragRotate(*this, aSelection, eConstraint, IsSolidDragging());
}
break;
@@ -1329,7 +1345,7 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
{
if(!bThereAreRootScenes)
{
- pForcedMeth = new E3dDragMove(*this, GetMarkedObjectList(), eDragHdl, eConstraint, IsSolidDragging());
+ pForcedMeth = new E3dDragMove(*this, aSelection, GetDragHdlKind(), eConstraint, IsSolidDragging());
}
}
break;
@@ -1348,7 +1364,8 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
}
}
}
- return SdrView::BegDragObj(rPnt, pOut, pHdl, nMinMov, pForcedMeth);
+
+ return SdrView::BegDragObj(rPnt, pHdl, fMinMovLogic, pForcedMeth);
}
/*************************************************************************
@@ -1357,7 +1374,7 @@ sal_Bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
|*
\************************************************************************/
-sal_Bool E3dView::HasMarkedScene()
+bool E3dView::HasMarkedScene()
{
return (GetMarkedScene() != NULL);
}
@@ -1370,13 +1387,19 @@ sal_Bool E3dView::HasMarkedScene()
E3dScene* E3dView::GetMarkedScene()
{
- sal_uIntPtr nCnt = GetMarkedObjectCount();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); i++ )
+ {
+ E3dScene* pE3dScene = dynamic_cast< E3dScene* >(aSelection[i]);
- for ( sal_uIntPtr i = 0; i < nCnt; i++ )
- if ( GetMarkedObjectByIndex(i)->ISA(E3dScene) )
- return (E3dScene*) GetMarkedObjectByIndex(i);
+ if (pE3dScene)
+ {
+ return pE3dScene;
+ }
+ }
- return NULL;
+ return 0;
}
/*************************************************************************
@@ -1388,22 +1411,20 @@ E3dScene* E3dView::GetMarkedScene()
E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj)
{
DBG_ASSERT(p3DObj != NULL, "Nana, wer steckt denn hier 'nen NULL-Zeiger rein?");
- E3dScene* pScene = NULL;
// get transformed BoundVolume of the object
basegfx::B3DRange aVolume(p3DObj->GetBoundVolume());
- aVolume.transform(p3DObj->GetTransform());
+ aVolume.transform(p3DObj->GetB3DTransform());
double fW(aVolume.getWidth());
double fH(aVolume.getHeight());
- Rectangle aRect(0,0, (long) fW, (long) fH);
-
- pScene = new E3dPolyScene(Get3DDefaultAttributes());
+ E3dScene* pScene = new E3dScene(
+ getSdrModelFromSdrView(),
+ Get3DDefaultAttributes());
InitScene(pScene, fW, fH, aVolume.getMaxZ() + ((fW + fH) / 4.0));
-
- pScene->Insert3DObj(p3DObj);
- pScene->NbcSetSnapRect(aRect);
+ pScene->Insert3DObj(*p3DObj);
+ sdr::legacy::SetSnapRange(*pScene, basegfx::B2DRange(0.0, 0.0, fW, fH));
return pScene;
}
@@ -1418,7 +1439,7 @@ void E3dView::InitScene(E3dScene* pScene, double fW, double fH, double fCamZ)
{
Camera3D aCam(pScene->GetCamera());
- aCam.SetAutoAdjustProjection(sal_False);
+ aCam.SetAutoAdjustProjection(false);
aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
basegfx::B3DPoint aLookAt;
@@ -1439,21 +1460,16 @@ void E3dView::InitScene(E3dScene* pScene, double fW, double fH, double fCamZ)
void E3dView::Start3DCreation()
{
- if (GetMarkedObjectCount())
+ if (areSdrObjectsSelected())
{
- // irgendwelche Markierungen ermitteln und ausschalten
- //HMHBOOL bVis = IsMarkHdlShown();
-
- //HMHif (bVis) HideMarkHdl();
-
// bestimme die koordinaten fuer JOEs Mirrorachse
// entgegen der normalen Achse wird diese an die linke Seite des Objektes
// positioniert
- long nOutMin = 0;
- long nOutMax = 0;
- long nMinLen = 0;
- long nObjDst = 0;
- long nOutHgt = 0;
+ sal_Int32 nOutMin = 0;
+ sal_Int32 nOutMax = 0;
+ sal_Int32 nMinLen = 0;
+ sal_Int32 nObjDst = 0;
+ sal_Int32 nOutHgt = 0;
OutputDevice* pOut = GetFirstOutputDevice(); //GetWin(0);
// erstmal Darstellungsgrenzen bestimmen
@@ -1462,7 +1478,7 @@ void E3dView::Start3DCreation()
nMinLen = pOut->PixelToLogic(Size(0,50)).Height();
nObjDst = pOut->PixelToLogic(Size(0,20)).Height();
- long nDst = pOut->PixelToLogic(Size(0,10)).Height();
+ sal_Int32 nDst = pOut->PixelToLogic(Size(0,10)).Height();
nOutMin = -pOut->GetMapMode().GetOrigin().Y();
nOutMax = pOut->GetOutputSize().Height() - 1 + nOutMin;
@@ -1479,27 +1495,29 @@ void E3dView::Start3DCreation()
nOutHgt = nOutMax - nOutMin;
- long nTemp = nOutHgt / 4;
+ sal_Int32 nTemp = nOutHgt / 4;
if (nTemp > nMinLen) nMinLen = nTemp;
}
// und dann die Markierungen oben und unten an das Objekt heften
basegfx::B2DRange aR;
- for(sal_uInt32 nMark(0L); nMark < GetMarkedObjectCount(); nMark++)
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nMark(0); nMark < aSelection.size(); nMark++)
{
- SdrObject* pMark = GetMarkedObjectByIndex(nMark);
+ SdrObject* pMark = aSelection[nMark];
basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly());
aR.expand(basegfx::tools::getRange(aXPP));
}
basegfx::B2DPoint aCenter(aR.getCenter());
- long nMarkHgt = basegfx::fround(aR.getHeight()) - 1;
- long nHgt = nMarkHgt + nObjDst * 2;
+ sal_Int32 nMarkHgt = basegfx::fround(aR.getHeight()) - 1;
+ sal_Int32 nHgt = nMarkHgt + nObjDst * 2;
if (nHgt < nMinLen) nHgt = nMinLen;
- long nY1 = basegfx::fround(aCenter.getY()) - (nHgt + 1) / 2;
- long nY2 = nY1 + nHgt;
+ sal_Int32 nY1 = basegfx::fround(aCenter.getY()) - (nHgt + 1) / 2;
+ sal_Int32 nY2 = nY1 + nHgt;
if (pOut && (nMinLen > nOutHgt)) nMinLen = nOutHgt;
if (pOut)
@@ -1516,24 +1534,17 @@ void E3dView::Start3DCreation()
}
}
- aRef1.X() = basegfx::fround(aR.getMinX()); // Initial Achse um 2/100mm nach links
- aRef1.Y() = nY1;
- aRef2.X() = aRef1.X();
- aRef2.Y() = nY2;
+ SetRef1(basegfx::B2DPoint(aR.getMinX(), nY1)); // Initial Achse um 2/100mm nach links
+ SetRef2(basegfx::B2DPoint(GetRef1().getX(), nY2));
- // Markierungen einschalten
+ // force re-creation of SdrHdls TTTT needed?
SetMarkHandles();
- //HMHif (bVis) ShowMarkHdl();
- if (AreObjectsMarked()) MarkListHasChanged();
-
// SpiegelPolygone SOFORT zeigen
const SdrHdlList &aHdlList = GetHdlList();
+
mpMirrorOverlay = new Impl3DMirrorConstructOverlay(*this);
- mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(HDL_REF1)->GetPos(), aHdlList.GetHdl(HDL_REF2)->GetPos());
- //CreateMirrorPolygons ();
- //ShowMirrorPolygons (aHdlList.GetHdl (HDL_REF1)->GetPos (),
- // aHdlList.GetHdl (HDL_REF2)->GetPos ());
+ mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdlByKind(HDL_REF1)->getPosition(), aHdlList.GetHdlByKind(HDL_REF2)->getPosition());
}
}
@@ -1543,7 +1554,7 @@ void E3dView::Start3DCreation()
|*
\************************************************************************/
-void E3dView::MovAction(const Point& rPnt)
+void E3dView::MovAction(const basegfx::B2DPoint& rPnt)
{
if(Is3DRotationCreationActive())
{
@@ -1564,8 +1575,8 @@ void E3dView::MovAction(const Point& rPnt)
//ShowMirrored ();
SdrView::MovAction (rPnt);
mpMirrorOverlay->SetMirrorAxis(
- aHdlList.GetHdl (HDL_REF1)->GetPos(),
- aHdlList.GetHdl (HDL_REF2)->GetPos());
+ aHdlList.GetHdlByKind(HDL_REF1)->getPosition(),
+ aHdlList.GetHdlByKind(HDL_REF2)->getPosition());
}
}
else
@@ -1582,44 +1593,47 @@ void E3dView::MovAction(const Point& rPnt)
/*************************************************************************
|*
|* Schluss. Objekt und evtl. Unterobjekte ueber ImpCreate3DLathe erstellen
-|* [FG] Mit dem Parameterwert sal_True (SDefault: sal_False) wird einfach ein
+|* [FG] Mit dem Parameterwert true (SDefault: false) wird einfach ein
|* Rotationskoerper erzeugt, ohne den Benutzer die Lage der
|* Achse fetlegen zu lassen. Es reicht dieser Aufruf, falls
|* ein Objekt selektiert ist. (keine Initialisierung noetig)
|*
\************************************************************************/
-void E3dView::End3DCreation(sal_Bool bUseDefaultValuesForMirrorAxes)
+void E3dView::End3DCreation(bool bUseDefaultValuesForMirrorAxes)
{
ResetCreationActive();
- if(AreObjectsMarked())
+ if(areSdrObjectsSelected())
{
if(bUseDefaultValuesForMirrorAxes)
{
- Rectangle aRect = GetAllMarkedRect();
- if(aRect.GetWidth() <= 1)
- aRect.SetSize(Size(500, aRect.GetHeight()));
- if(aRect.GetHeight() <= 1)
- aRect.SetSize(Size(aRect.GetWidth(), 500));
+ basegfx::B2DRange aRange(getMarkedObjectSnapRange());
+
+ if(aRange.getWidth() < 500.0 || aRange.getHeight() < 500.0)
+ {
+ basegfx::B2DRange aCentered(aRange.getCenter());
+
+ aCentered.grow(500.0);
+ aRange.expand(aCentered);
+ }
- basegfx::B2DPoint aPnt1(aRect.Left(), -aRect.Top());
- basegfx::B2DPoint aPnt2(aRect.Left(), -aRect.Bottom());
+ const basegfx::B2DPoint aPnt1(aRange.getMinX(), -aRange.getMinY());
+ const basegfx::B2DPoint aPnt2(aRange.getMinX(), -aRange.getMaxY());
- ConvertMarkedObjTo3D(sal_False, aPnt1, aPnt2);
+ ConvertMarkedObjTo3D(false, aPnt1, aPnt2);
}
else
{
// Hilfsfigur ausschalten
// bestimme aus den Handlepositionen und den Versatz der Punkte
const SdrHdlList &aHdlList = GetHdlList();
- Point aMirrorRef1 = aHdlList.GetHdl(HDL_REF1)->GetPos();
- Point aMirrorRef2 = aHdlList.GetHdl(HDL_REF2)->GetPos();
+ const basegfx::B2DPoint aMirrorRef1 = aHdlList.GetHdlByKind(HDL_REF1)->getPosition();
+ const basegfx::B2DPoint aMirrorRef2 = aHdlList.GetHdlByKind(HDL_REF2)->getPosition();
+ const basegfx::B2DPoint aPnt1(aMirrorRef1.getX(), -aMirrorRef1.getY());
+ const basegfx::B2DPoint aPnt2(aMirrorRef2.getX(), -aMirrorRef2.getY());
- basegfx::B2DPoint aPnt1(aMirrorRef1.X(), -aMirrorRef1.Y());
- basegfx::B2DPoint aPnt2(aMirrorRef2.X(), -aMirrorRef2.Y());
-
- ConvertMarkedObjTo3D(sal_False, aPnt1, aPnt2);
+ ConvertMarkedObjTo3D(false, aPnt1, aPnt2);
}
}
}
@@ -1671,7 +1685,7 @@ void E3dView::InitView ()
nVDefaultSegments = 12;
aDefaultLightColor = RGB_Color(COL_WHITE);
aDefaultAmbientColor = RGB_Color(COL_BLACK);
- bDoubleSided = sal_False;
+ bDoubleSided = false;
mpMirrorOverlay = 0L;
}
@@ -1681,37 +1695,33 @@ void E3dView::InitView ()
|*
\************************************************************************/
-sal_Bool E3dView::IsBreak3DObjPossible() const
+bool E3dView::IsBreak3DObjPossible() const
{
- sal_uIntPtr nCount = GetMarkedObjectCount();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- if (nCount > 0)
+ if(!aSelection.size())
{
- sal_uIntPtr i = 0;
+ return false;
+ }
- while (i < nCount)
- {
- SdrObject* pObj = GetMarkedObjectByIndex(i);
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
+ {
+ E3dObject* pObj = dynamic_cast< E3dObject* >(aSelection[i]);
- if (pObj && pObj->ISA(E3dObject))
- {
- if(!(((E3dObject*)pObj)->IsBreakObjPossible()))
- return sal_False;
- }
- else
+ if (pObj )
+ {
+ if(!pObj->IsBreakObjPossible())
{
- return sal_False;
+ return false;
}
-
- i++;
}
- }
- else
- {
- return sal_False;
+ else
+ {
+ return false;
+ }
}
- return sal_True;
+ return true;
}
/*************************************************************************
@@ -1725,14 +1735,15 @@ void E3dView::Break3DObj()
if(IsBreak3DObjPossible())
{
// ALLE selektierten Objekte werden gewandelt
- sal_uInt32 nCount = GetMarkedObjectCount();
-
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
BegUndo(String(SVX_RESSTR(RID_SVX_3D_UNDO_BREAK_LATHE)));
- for(sal_uInt32 a=0;a<nCount;a++)
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- E3dObject* pObj = (E3dObject*)GetMarkedObjectByIndex(a);
+ E3dObject* pObj = dynamic_cast< E3dObject* >(aSelection[a]);
BreakSingle3DObj(pObj);
}
+
DeleteMarked();
EndUndo();
}
@@ -1740,144 +1751,33 @@ void E3dView::Break3DObj()
void E3dView::BreakSingle3DObj(E3dObject* pObj)
{
- if(pObj->ISA(E3dScene))
+ E3dScene* pE3dScene = dynamic_cast< E3dScene* >(pObj);
+
+ if(pE3dScene)
{
- SdrObjList* pSubList = pObj->GetSubList();
+ SdrObjList* pSubList = pE3dScene->getChildrenOfSdrObject();
SdrObjListIter aIter(*pSubList, IM_FLAT);
while(aIter.IsMore())
{
- E3dObject* pSubObj = (E3dObject*)aIter.Next();
+ E3dObject* pSubObj = dynamic_cast< E3dObject* >(aIter.Next());
+
+ if(pSubObj)
+ {
BreakSingle3DObj(pSubObj);
+ }
}
}
else
{
SdrAttrObj* pNewObj = pObj->GetBreakObj();
+
if(pNewObj)
{
- InsertObjectAtView(pNewObj, *GetSdrPageView(), SDRINSERT_DONTMARK);
+ InsertObjectAtView(*pNewObj, SDRINSERT_DONTMARK);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pNewObj);
pNewObj->SetChanged();
- pNewObj->BroadcastObjectChange();
- }
- }
-}
-
-/*************************************************************************
-|*
-|* Szenen mischen
-|*
-\************************************************************************/
-
-void E3dView::MergeScenes ()
-{
- sal_uIntPtr nCount = GetMarkedObjectCount();
-
- if (nCount > 0)
- {
- sal_uIntPtr nObj = 0;
- SdrObject *pObj = GetMarkedObjectByIndex(nObj);
- E3dScene *pScene = new E3dPolyScene(Get3DDefaultAttributes());
- basegfx::B3DRange aBoundVol;
- Rectangle aAllBoundRect (GetMarkedObjBoundRect ());
- Point aCenter (aAllBoundRect.Center());
-
- while (pObj)
- {
- if (pObj->ISA(E3dScene))
- {
- /**********************************************************
- * Es ist eine 3D-Scene oder 3D-PolyScene
- **********************************************************/
- SdrObjList* pSubList = ((E3dObject*) pObj)->GetSubList();
-
- SdrObjListIter aIter(*pSubList, IM_FLAT);
-
- while (aIter.IsMore())
- {
- /******************************************************
- * LatheObjekte suchen
- ******************************************************/
- SdrObject* pSubObj = aIter.Next();
-
- E3dObject *pNewObj = 0;
-
- switch (pSubObj->GetObjIdentifier())
- {
- case E3D_CUBEOBJ_ID :
- pNewObj = new E3dCubeObj;
- *(E3dCubeObj*)pNewObj = *(E3dCubeObj*)pSubObj;
- break;
-
- case E3D_SPHEREOBJ_ID:
- pNewObj = new E3dSphereObj;
- *(E3dSphereObj*)pNewObj = *(E3dSphereObj*)pSubObj;
- break;
-
- case E3D_EXTRUDEOBJ_ID:
- pNewObj = new E3dExtrudeObj;
- *(E3dExtrudeObj*)pNewObj = *(E3dExtrudeObj*)pSubObj;
- break;
-
- case E3D_LATHEOBJ_ID:
- pNewObj = new E3dLatheObj;
- *(E3dLatheObj*)pNewObj = *(E3dLatheObj*)pSubObj;
- break;
-
- case E3D_COMPOUNDOBJ_ID:
- pNewObj = new E3dCompoundObject;
- *(E3dCompoundObject*)pNewObj = *(E3dCompoundObject*)pSubObj;
- break;
- }
-
- Rectangle aBoundRect = pSubObj->GetCurrentBoundRect();
-
- basegfx::B3DHomMatrix aMatrix;
- aMatrix.translate(aBoundRect.Left() - aCenter.getX(), aCenter.getY(), 0.0);
- pNewObj->SetTransform(aMatrix * pNewObj->GetTransform()); // #112587#
-
- if (pNewObj) aBoundVol.expand(pNewObj->GetBoundVolume());
- pScene->Insert3DObj (pNewObj);
- }
- }
-
- nObj++;
-
- if (nObj < nCount)
- {
- pObj = GetMarkedObjectByIndex(nObj);
- }
- else
- {
- pObj = NULL;
- }
}
-
- double fW = aAllBoundRect.GetWidth();
- double fH = aAllBoundRect.GetHeight();
- Rectangle aRect(0,0, (long) fW, (long) fH);
-
- InitScene(pScene, fW, fH, aBoundVol.getMaxZ() + + ((fW + fH) / 4.0));
- pScene->NbcSetSnapRect(aRect);
-
- Camera3D &aCamera = (Camera3D&) pScene->GetCamera ();
- basegfx::B3DPoint aMinVec(aBoundVol.getMinimum());
- basegfx::B3DPoint aMaxVec(aBoundVol.getMaximum());
- double fDeepth(fabs(aMaxVec.getZ() - aMinVec.getZ()));
-
- aCamera.SetPRP(basegfx::B3DPoint(0.0, 0.0, 1000.0));
- double fDefaultCamPosZ(GetDefaultCamPosZ());
- aCamera.SetPosition(basegfx::B3DPoint(0.0, 0.0, fDefaultCamPosZ + fDeepth / 2.0));
- aCamera.SetFocalLength(GetDefaultCamFocal());
- pScene->SetCamera (aCamera);
-
- // SnapRects der Objekte ungueltig
- pScene->SetRectsDirty();
-
- InsertObjectAtView(pScene, *(GetSdrPageViewOfMarkedByIndex(0)));
-
- // SnapRects der Objekte ungueltig
- pScene->SetRectsDirty();
}
}
@@ -1892,32 +1792,41 @@ void E3dView::CheckPossibilities()
SdrView::CheckPossibilities();
// Weitere Flags bewerten
- if(bGroupPossible || bUnGroupPossible || bGrpEnterPossible)
+ if(mbGroupPossible || mbUnGroupPossible || mbGrpEnterPossible)
{
- sal_Int32 nMarkCnt = GetMarkedObjectCount();
- sal_Bool bCoumpound = sal_False;
- sal_Bool b3DObject = sal_False;
- for(sal_Int32 nObjs = 0L; (nObjs < nMarkCnt) && !bCoumpound; nObjs++)
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bCoumpound = false;
+ bool b3DObject = false;
+
+ for(sal_Int32 nObjs(0); (nObjs < aSelection.size()) && !bCoumpound; nObjs++)
{
- SdrObject *pObj = GetMarkedObjectByIndex(nObjs);
- if(pObj && pObj->ISA(E3dCompoundObject))
- bCoumpound = sal_True;
- if(pObj && pObj->ISA(E3dObject))
- b3DObject = sal_True;
+ SdrObject *pObj = aSelection[nObjs];
+
+ if(dynamic_cast< E3dCompoundObject* >(pObj))
+ bCoumpound = true;
+ if(dynamic_cast< E3dObject* >(pObj))
+ b3DObject = true;
}
// Bisher: Es sind ZWEI oder mehr beliebiger Objekte selektiert.
// Nachsehen, ob CompoundObjects beteiligt sind. Falls ja,
// das Gruppieren verbieten.
- if(bGroupPossible && bCoumpound)
- bGroupPossible = sal_False;
+ if(mbGroupPossible && bCoumpound)
+ {
+ mbGroupPossible = false;
+ }
- if(bUnGroupPossible && b3DObject)
- bUnGroupPossible = sal_False;
+ if(mbUnGroupPossible && b3DObject)
+ {
+ mbUnGroupPossible = false;
+ }
- if(bGrpEnterPossible && bCoumpound)
- bGrpEnterPossible = sal_False;
+ if(mbGrpEnterPossible && bCoumpound)
+ {
+ mbGrpEnterPossible = false;
+ }
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx
index f30a3b23ab0d..038ea2aa0c69 100644
--- a/svx/source/engine3d/view3d1.cxx
+++ b/svx/source/engine3d/view3d1.cxx
@@ -25,7 +25,7 @@
#include "precompiled_svx.hxx"
#include <tools/shl.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdpool.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svxids.hrc>
@@ -35,7 +35,6 @@
#include <svx/dialmgr.hxx>
#include "svx/globl3d.hxx"
#include <svx/obj3d.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/e3ditem.hxx>
#include <editeng/colritem.hxx>
#include <svx/lathe3d.hxx>
@@ -54,25 +53,21 @@
|*
\************************************************************************/
-void E3dView::ConvertMarkedToPolyObj(sal_Bool bLineToArea)
+void E3dView::ConvertMarkedToPolyObj(bool bLineToArea)
{
SdrObject* pNewObj = NULL;
+ E3dScene* pObj = dynamic_cast< E3dScene* >(getSelectedIfSingle());
- if (GetMarkedObjectCount() == 1)
+ if (pObj)
{
- SdrObject* pObj = GetMarkedObjectByIndex(0);
+ bool bBezier(false);
+ pNewObj = pObj->ConvertToPolyObj(bBezier, bLineToArea);
- if (pObj && pObj->ISA(E3dPolyScene))
+ if (pNewObj)
{
- sal_Bool bBezier = sal_False;
- pNewObj = ((E3dPolyScene*) pObj)->ConvertToPolyObj(bBezier, bLineToArea);
-
- if (pNewObj)
- {
- BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXTRUDE));
- ReplaceObjectAtView(pObj, *GetSdrPageView(), pNewObj);
- EndUndo();
- }
+ BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXTRUDE));
+ ReplaceObjectAtView(*pObj, *pNewObj);
+ EndUndo();
}
}
@@ -90,35 +85,38 @@ void E3dView::ConvertMarkedToPolyObj(sal_Bool bLineToArea)
void Imp_E3dView_InorderRun3DObjects(const SdrObject* pObj, sal_uInt32& rMask)
{
- if(pObj->ISA(E3dLatheObj))
+ if(dynamic_cast< const E3dLatheObj* >(pObj))
{
rMask |= 0x0001;
}
- else if(pObj->ISA(E3dExtrudeObj))
+ else if(dynamic_cast< const E3dExtrudeObj* >(pObj))
{
rMask |= 0x0002;
}
- else if(pObj->ISA(E3dSphereObj))
+ else if(dynamic_cast< const E3dSphereObj* >(pObj))
{
rMask |= 0x0004;
}
- else if(pObj->ISA(E3dCubeObj))
+ else if(dynamic_cast< const E3dCubeObj* >(pObj))
{
rMask |= 0x0008;
}
- else if(pObj->IsGroupObject())
+ else if(pObj->getChildrenOfSdrObject())
{
- SdrObjList* pList = pObj->GetSubList();
+ SdrObjList* pList = pObj->getChildrenOfSdrObject();
+
for(sal_uInt32 a(0); a < pList->GetObjCount(); a++)
+ {
Imp_E3dView_InorderRun3DObjects(pList->GetObj(a), rMask);
}
}
+}
-SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, sal_Bool /*bOnly3DAttr*/) const
+SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene) const
{
// ItemSet mit entspr. Bereich anlegen
SfxItemSet aSet(
- pMod->GetItemPool(),
+ getSdrModelFromSdrView().GetItemPool(),
SDRATTR_START, SDRATTR_END,
SID_ATTR_3D_INTERN, SID_ATTR_3D_INTERN,
0, 0);
@@ -130,19 +128,17 @@ SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, sal_Bool /*bOnly3DAttr*/
// special scene
aSet.Put(pInScene->GetMergedItemSet());
}
- else
+ else if(areSdrObjectsSelected())
{
// get attributes from all selected objects
MergeAttrFromMarked(aSet, sal_False);
// calc flags for SID_ATTR_3D_INTERN
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- sal_uInt32 nMarkCnt(rMarkList.GetMarkCount());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for(sal_uInt32 a(0); a < nMarkCnt; a++)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrObject* pObj = GetMarkedObjectByIndex(a);
- Imp_E3dView_InorderRun3DObjects(pObj, nSelectedItems);
+ Imp_E3dView_InorderRun3DObjects(aSelection[a], nSelectedItems);
}
}
@@ -153,7 +149,7 @@ SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, sal_Bool /*bOnly3DAttr*/
if(!nSelectedItems && !pInScene)
{
// Defaults holen und hinzufuegen
- SfxItemSet aDefaultSet(pMod->GetItemPool(), SDRATTR_3D_FIRST, SDRATTR_3D_LAST);
+ SfxItemSet aDefaultSet(getSdrModelFromSdrView().GetItemPool(), SDRATTR_3D_FIRST, SDRATTR_3D_LAST);
GetAttributes(aDefaultSet);
aSet.Put(aDefaultSet);
@@ -161,8 +157,8 @@ SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, sal_Bool /*bOnly3DAttr*/
aSet.Put(XLineStyleItem (XLINE_NONE));
// #84061# new defaults for distance and focal length
- aSet.Put(Svx3DDistanceItem(100));
- aSet.Put(Svx3DFocalLengthItem(10000));
+ aSet.Put(SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, 100));
+ aSet.Put(SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, 10000));
}
// ItemSet zurueckgeben
@@ -175,16 +171,16 @@ SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, sal_Bool /*bOnly3DAttr*/
|*
\************************************************************************/
-void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, sal_Bool bReplaceAll)
+void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, bool bReplaceAll)
{
- sal_uInt32 nSelectedItems(0L);
+ sal_uInt32 nSelectedItems(0);
if(pInScene)
{
//pInScene->SetItemSetAndBroadcast(rAttr, bReplaceAll);
pInScene->SetMergedItemSetAndBroadcast(rAttr, bReplaceAll);
}
- else
+ else if(areSdrObjectsSelected())
{
// #i94832# removed usage of E3DModifySceneSnapRectUpdater here.
// They are not needed here, they are already handled in SetAttrToMarked
@@ -193,13 +189,11 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, sal_
SetAttrToMarked(rAttr, bReplaceAll);
// old run
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- const sal_uInt32 nMarkCnt(rMarkList.GetMarkCount());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for(sal_uInt32 a(0); a < nMarkCnt; a++)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrObject* pObj = GetMarkedObjectByIndex(a);
- Imp_E3dView_InorderRun3DObjects(pObj, nSelectedItems);
+ Imp_E3dView_InorderRun3DObjects(aSelection[a], nSelectedItems);
}
}
@@ -207,20 +201,19 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, sal_
if(!nSelectedItems && !pInScene)
{
// Defaults setzen
- SfxItemSet aDefaultSet(pMod->GetItemPool(), SDRATTR_3D_FIRST, SDRATTR_3D_LAST);
+ SfxItemSet aDefaultSet(getSdrModelFromSdrView().GetItemPool(), SDRATTR_3D_FIRST, SDRATTR_3D_LAST);
aDefaultSet.Put(rAttr);
SetAttributes(aDefaultSet);
-
}
}
double E3dView::GetDefaultCamPosZ()
{
- return (double)((const SfxUInt32Item&)pMod->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_DISTANCE)).GetValue();
+ return (double)((const SfxUInt32Item&)getSdrModelFromSdrView().GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_DISTANCE)).GetValue();
}
double E3dView::GetDefaultCamFocal()
{
- return (double)((const SfxUInt32Item&)pMod->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
+ return (double)((const SfxUInt32Item&)getSdrModelFromSdrView().GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
}
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index d2c49b4db320..e3e4430749b8 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -789,7 +789,8 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe
if (eState >= SFX_ITEM_AVAILABLE && pItem )
{
- bChecked = pItem->ISA(SfxBoolItem) && ((SfxBoolItem*)pItem)->GetValue();
+ SfxBoolItem* pSfxBoolItem = dynamic_cast< SfxBoolItem* >(pItem);
+ bChecked = pSfxBoolItem && pSfxBoolItem->GetValue();
rMenu.CheckItem(SID_FM_SHOW_PROPERTY_BROWSER,bChecked);
}
delete pItem;
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index b91e17d8de25..2943fdbeea51 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -358,7 +358,6 @@ Reference< XInterface > SAL_CALL FmXGridControl_NewInstance_Impl(const Reference
{
return *(new FmXGridControl(_rxFactory));
}
-DBG_NAME(FmXGridControl )
//------------------------------------------------------------------------------
FmXGridControl::FmXGridControl(const Reference< XMultiServiceFactory >& _rxFactory)
:UnoControl( _rxFactory)
@@ -371,13 +370,11 @@ FmXGridControl::FmXGridControl(const Reference< XMultiServiceFactory >& _rxFacto
,m_bInDraw(sal_False)
,m_xServiceFactory(_rxFactory)
{
- DBG_CTOR(FmXGridControl ,NULL);
}
//------------------------------------------------------------------------------
FmXGridControl::~FmXGridControl()
{
- DBG_DTOR(FmXGridControl ,NULL);
}
//------------------------------------------------------------------
@@ -1466,9 +1463,9 @@ void FmXGridPeer::CellModified()
void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeException )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // want to do a lot of VCL stuff here ...
- // this should not be (deadlock) critical, as by definition, every component should release
- // any own mutexes before notifying
+ // want to do a lot of VCL stuff here ...
+ // this should not be (deadlock) critical, as by definition, every component should release
+ // any own mutexes before notifying
FmGridControl* pGrid = (FmGridControl*) GetWindow();
if (!pGrid)
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 11e730dace95..7cf40ebb3727 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -265,11 +265,20 @@ void DbGridColumn::impl_toggleScriptManager_nothrow( bool _bAttach )
//------------------------------------------------------------------------------
void DbGridColumn::UpdateFromField(const DbGridRow* pRow, const Reference< XNumberFormatter >& xFormatter)
{
- if (m_pCell && m_pCell->ISA(FmXFilterCell))
- PTR_CAST(FmXFilterCell, m_pCell)->Update();
+ FmXFilterCell* pFmXFilterCell = dynamic_cast< FmXFilterCell* >(m_pCell);
+
+ if (pFmXFilterCell)
+ {
+ pFmXFilterCell->Update();
+ }
else if (pRow && pRow->IsValid() && m_nFieldPos >= 0 && m_pCell && pRow->HasField(m_nFieldPos))
{
- PTR_CAST(FmXDataCell, m_pCell)->UpdateFromField( pRow->GetField( m_nFieldPos ).getColumn(), xFormatter );
+ FmXDataCell* pFmXDataCell = dynamic_cast< FmXDataCell* >(m_pCell);
+
+ if(pFmXDataCell)
+ {
+ pFmXDataCell->UpdateFromField( pRow->GetField( m_nFieldPos ).getColumn(), xFormatter );
+ }
}
}
@@ -283,7 +292,7 @@ sal_Bool DbGridColumn::Commit()
bResult = m_pCell->Commit();
// store the data into the model
- FmXDataCell* pDataCell = PTR_CAST(FmXDataCell, m_pCell);
+ FmXDataCell* pDataCell = dynamic_cast< FmXDataCell* >(m_pCell);
if (bResult && pDataCell)
{
Reference< ::com::sun::star::form::XBoundComponent > xComp(m_xModel, UNO_QUERY);
@@ -415,7 +424,8 @@ void DbGridColumn::setLock(sal_Bool _bLock)
String DbGridColumn::GetCellText(const DbGridRow* pRow, const Reference< XNumberFormatter >& xFormatter) const
{
String aText;
- if (m_pCell && m_pCell->ISA(FmXFilterCell))
+
+ if (dynamic_cast< FmXFilterCell* >(m_pCell))
return aText;
if (!pRow || !pRow->IsValid())
@@ -433,7 +443,7 @@ String DbGridColumn::GetCellText(const Reference< ::com::sun::star::sdb::XColumn
String aText;
if (xField.is())
{
- FmXTextCell* pTextCell = PTR_CAST(FmXTextCell, m_pCell);
+ FmXTextCell* pTextCell = dynamic_cast< FmXTextCell* >(m_pCell);
if (pTextCell)
aText = pTextCell->GetText(xField, xFormatter);
else if (m_bObject)
@@ -463,7 +473,7 @@ void DbGridColumn::Paint(OutputDevice& rDev,
bool bEnabled = ( rDev.GetOutDevType() != OUTDEV_WINDOW )
|| ( static_cast< Window& >( rDev ).IsEnabled() );
- FmXDataCell* pDataCell = PTR_CAST(FmXDataCell, m_pCell);
+ FmXDataCell* pDataCell = dynamic_cast< FmXDataCell* >(m_pCell);
if (pDataCell)
{
if (!pRow || !pRow->IsValid())
@@ -518,7 +528,7 @@ void DbGridColumn::Paint(OutputDevice& rDev,
rDev.DrawText(rRect, OBJECTTEXT, nStyle);
}
}
- else if ( m_pCell->ISA( FmXFilterCell ) )
+ else if ( dynamic_cast< FmXFilterCell* >(m_pCell) )
static_cast< FmXFilterCell* >( m_pCell )->PaintCell( rDev, rRect );
}
@@ -532,20 +542,6 @@ void DbGridColumn::ImplInitWindow( Window& rParent, const InitWindowFacet _eInit
//==============================================================================
//= cell controls
//==============================================================================
-TYPEINIT0( DbCellControl )
-TYPEINIT1( DbLimitedLengthField, DbCellControl )
-TYPEINIT1( DbTextField, DbLimitedLengthField )
-TYPEINIT1( DbFormattedField, DbLimitedLengthField )
-TYPEINIT1( DbCheckBox, DbCellControl )
-TYPEINIT1( DbComboBox, DbCellControl )
-TYPEINIT1( DbListBox, DbCellControl )
-TYPEINIT1( DbPatternField, DbCellControl )
-TYPEINIT1( DbSpinField, DbCellControl )
-TYPEINIT1( DbDateField, DbSpinField )
-TYPEINIT1( DbTimeField, DbSpinField )
-TYPEINIT1( DbCurrencyField, DbSpinField )
-TYPEINIT1( DbNumericField, DbSpinField )
-TYPEINIT1( DbFilterField, DbCellControl )
//------------------------------------------------------------------------------
DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ )
@@ -1256,14 +1252,11 @@ void DbTextField::implSetEffectiveMaxTextLen( sal_Int16 _nMaxLen )
//==============================================================================
//= DbFormattedField
//==============================================================================
-DBG_NAME(DbFormattedField);
//------------------------------------------------------------------------------
DbFormattedField::DbFormattedField(DbGridColumn& _rColumn)
:DbLimitedLengthField(_rColumn)
,m_nKeyType(::com::sun::star::util::NumberFormat::UNDEFINED)
{
- DBG_CTOR(DbFormattedField,NULL);
-
// if our model's format key changes we want to propagate the new value to our windows
doPropertyListening( FM_PROP_FORMATKEY );
}
@@ -1271,7 +1264,6 @@ DbFormattedField::DbFormattedField(DbGridColumn& _rColumn)
//------------------------------------------------------------------------------
DbFormattedField::~DbFormattedField()
{
- DBG_DTOR(DbFormattedField,NULL);
}
//------------------------------------------------------------------------------
@@ -2743,7 +2735,6 @@ sal_Bool DbListBox::commitControl()
}
-DBG_NAME(DbFilterField);
/*************************************************************************/
DbFilterField::DbFilterField(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,DbGridColumn& _rColumn)
:DbCellControl(_rColumn)
@@ -2753,8 +2744,6 @@ DbFilterField::DbFilterField(const Reference< ::com::sun::star::lang::XMultiServ
,m_bFilterListFilled(sal_False)
,m_bBound(sal_False)
{
- DBG_CTOR(DbFilterField,NULL);
-
setAlignedController( sal_False );
}
@@ -2763,8 +2752,6 @@ DbFilterField::~DbFilterField()
{
if (m_nControlClass == ::com::sun::star::form::FormComponentType::CHECKBOX)
((CheckBoxControl*)m_pWindow)->SetClickHdl( Link() );
-
- DBG_DTOR(DbFilterField,NULL);
}
//------------------------------------------------------------------------------
@@ -3216,10 +3203,7 @@ IMPL_LINK( DbFilterField, OnClick, void*, EMPTYARG )
}
/*************************************************************************/
-TYPEINIT0(FmXGridCell);
-
-DBG_NAME(FmXGridCell);
//-----------------------------------------------------------------------------
FmXGridCell::FmXGridCell( DbGridColumn* pColumn, DbCellControl* _pControl )
:OComponentHelper(m_aMutex)
@@ -3231,7 +3215,6 @@ FmXGridCell::FmXGridCell( DbGridColumn* pColumn, DbCellControl* _pControl )
,m_aMouseListeners( m_aMutex )
,m_aMouseMotionListeners( m_aMutex )
{
- DBG_CTOR(FmXGridCell,NULL);
}
//-----------------------------------------------------------------------------
@@ -3258,8 +3241,6 @@ FmXGridCell::~FmXGridCell()
acquire();
dispose();
}
-
- DBG_DTOR(FmXGridCell,NULL);
}
//------------------------------------------------------------------
@@ -3583,7 +3564,6 @@ void FmXGridCell::onWindowEvent( const sal_uIntPtr _nEventId, const Window& _rWi
}
/*************************************************************************/
-TYPEINIT1(FmXDataCell, FmXGridCell);
//------------------------------------------------------------------------------
void FmXDataCell::PaintFieldToCell(OutputDevice& rDev, const Rectangle& rRect,
const Reference< ::com::sun::star::sdb::XColumn >& _rxField,
@@ -3601,7 +3581,6 @@ void FmXDataCell::UpdateFromColumn()
}
/*************************************************************************/
-TYPEINIT1(FmXTextCell, FmXDataCell);
FmXTextCell::FmXTextCell( DbGridColumn* pColumn, DbCellControl& _rControl )
:FmXDataCell( pColumn, _rControl )
@@ -3653,7 +3632,6 @@ void FmXTextCell::PaintFieldToCell(OutputDevice& rDev,
/*************************************************************************/
-DBG_NAME(FmXEditCell);
//------------------------------------------------------------------------------
FmXEditCell::FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl )
:FmXTextCell( pColumn, _rControl )
@@ -3662,9 +3640,7 @@ FmXEditCell::FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl )
,m_pEditImplementation( NULL )
,m_bOwnEditImplementation( false )
{
- DBG_CTOR(FmXEditCell,NULL);
-
- DbTextField* pTextField = PTR_CAST( DbTextField, &_rControl );
+ DbTextField* pTextField = dynamic_cast< DbTextField* >(&_rControl );
if ( pTextField )
{
@@ -3687,9 +3663,6 @@ FmXEditCell::~FmXEditCell()
acquire();
dispose();
}
-
-
- DBG_DTOR(FmXEditCell,NULL);
}
// OComponentHelper
@@ -3920,7 +3893,6 @@ void FmXEditCell::onWindowEvent( const sal_uIntPtr _nEventId, const Window& _rWi
}
/*************************************************************************/
-DBG_NAME(FmXCheckBoxCell);
//------------------------------------------------------------------------------
FmXCheckBoxCell::FmXCheckBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl )
:FmXDataCell( pColumn, _rControl )
@@ -3928,7 +3900,6 @@ FmXCheckBoxCell::FmXCheckBoxCell( DbGridColumn* pColumn, DbCellControl& _rContro
,m_aActionListeners( m_aMutex )
,m_pBox( & static_cast< CheckBoxControl& >( _rControl.GetWindow() ).GetBox() )
{
- DBG_CTOR(FmXCheckBoxCell,NULL);
}
//------------------------------------------------------------------
@@ -3939,8 +3910,6 @@ FmXCheckBoxCell::~FmXCheckBoxCell()
acquire();
dispose();
}
-
- DBG_DTOR(FmXCheckBoxCell,NULL);
}
// OComponentHelper
@@ -4100,7 +4069,6 @@ void FmXCheckBoxCell::onWindowEvent( const sal_uIntPtr _nEventId, const Window&
/*************************************************************************/
-DBG_NAME(FmXListBoxCell);
//------------------------------------------------------------------------------
FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, DbCellControl& _rControl)
:FmXTextCell( pColumn, _rControl )
@@ -4108,8 +4076,6 @@ FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, DbCellControl& _rControl)
,m_aActionListeners(m_aMutex)
,m_pBox( &static_cast< ListBox& >( _rControl.GetWindow() ) )
{
- DBG_CTOR(FmXListBoxCell,NULL);
-
m_pBox->SetDoubleClickHdl( LINK( this, FmXListBoxCell, OnDoubleClick ) );
}
@@ -4121,8 +4087,6 @@ FmXListBoxCell::~FmXListBoxCell()
acquire();
dispose();
}
-
- DBG_DTOR(FmXListBoxCell,NULL);
}
// OComponentHelper
@@ -4443,8 +4407,6 @@ IMPL_LINK( FmXListBoxCell, OnDoubleClick, void*, EMPTYARG )
/*************************************************************************/
-DBG_NAME( FmXComboBoxCell );
-
//------------------------------------------------------------------------------
FmXComboBoxCell::FmXComboBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl )
:FmXTextCell( pColumn, _rControl )
@@ -4452,7 +4414,6 @@ FmXComboBoxCell::FmXComboBoxCell( DbGridColumn* pColumn, DbCellControl& _rContro
,m_aActionListeners( m_aMutex )
,m_pComboBox( &static_cast< ComboBox& >( _rControl.GetWindow() ) )
{
- DBG_CTOR( FmXComboBoxCell, NULL );
}
//------------------------------------------------------------------------------
@@ -4463,8 +4424,6 @@ FmXComboBoxCell::~FmXComboBoxCell()
acquire();
dispose();
}
-
- DBG_DTOR( FmXComboBoxCell, NULL );
}
//-----------------------------------------------------------------------------
@@ -4639,7 +4598,6 @@ void FmXComboBoxCell::onWindowEvent( const sal_uIntPtr _nEventId, const Window&
}
/*************************************************************************/
-TYPEINIT1(FmXFilterCell, FmXGridCell);
//------------------------------------------------------------------------------
Reference< XInterface > FmXFilterCell_CreateInstance(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& /*_rxFactory*/)
@@ -4647,16 +4605,14 @@ Reference< XInterface > FmXFilterCell_CreateInstance(const Reference< ::com::su
return *new FmXFilterCell();
}
-DBG_NAME(FmXFilterCell);
//------------------------------------------------------------------------------
FmXFilterCell::FmXFilterCell(DbGridColumn* pColumn, DbCellControl* pControl )
:FmXGridCell( pColumn, pControl )
,m_aTextListeners(m_aMutex)
{
- DBG_CTOR(FmXFilterCell,NULL);
-
- DBG_ASSERT( m_pCellControl->ISA( DbFilterField ), "FmXFilterCell::FmXFilterCell: invalid cell control!" );
- static_cast< DbFilterField* >( m_pCellControl )->SetCommitHdl( LINK( this, FmXFilterCell, OnCommit ) );
+ DbFilterField* pDbFilterField = dynamic_cast< DbFilterField* >(m_pCellControl);
+ DBG_ASSERT( pDbFilterField, "FmXFilterCell::FmXFilterCell: invalid cell control!" );
+ pDbFilterField->SetCommitHdl( LINK( this, FmXFilterCell, OnCommit ) );
}
//------------------------------------------------------------------
@@ -4667,8 +4623,6 @@ FmXFilterCell::~FmXFilterCell()
acquire();
dispose();
}
-
- DBG_DTOR(FmXFilterCell,NULL);
}
// XUnoTunnel
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 39c9b6a5b771..0a07f987496d 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -140,7 +140,6 @@ DECLARE_STL_MAP(sal_uInt16, GridFieldValueListener*, ::std::less<sal_uInt16>, Co
//==============================================================================
-DBG_NAME(GridFieldValueListener)
class GridFieldValueListener : protected ::comphelper::OPropertyChangeListener
{
osl::Mutex m_aMutex;
@@ -170,7 +169,6 @@ GridFieldValueListener::GridFieldValueListener(DbGridControl& _rParent, const Re
,m_nSuspended(0)
,m_bDisposed(sal_False)
{
- DBG_CTOR(GridFieldValueListener, NULL);
if (_rField.is())
{
m_pRealListener = new ::comphelper::OPropertyChangeMultiplexer(this, _rField);
@@ -182,7 +180,6 @@ GridFieldValueListener::GridFieldValueListener(DbGridControl& _rParent, const Re
//------------------------------------------------------------------------------
GridFieldValueListener::~GridFieldValueListener()
{
- DBG_DTOR(GridFieldValueListener, NULL);
dispose();
}
@@ -232,15 +229,12 @@ public:
//==============================================================================
-DBG_NAME(DisposeListenerGridBridge)
//------------------------------------------------------------------------------
DisposeListenerGridBridge::DisposeListenerGridBridge(DbGridControl& _rParent, const Reference< XComponent >& _rxObject, sal_Int16 _rId)
:FmXDisposeListener(m_aMutex)
,m_rParent(_rParent)
,m_pRealListener(NULL)
{
- DBG_CTOR(DisposeListenerGridBridge,NULL);
-
if (_rxObject.is())
{
m_pRealListener = new FmXDisposeMultiplexer(this, _rxObject, _rId);
@@ -257,8 +251,6 @@ DisposeListenerGridBridge::~DisposeListenerGridBridge()
m_pRealListener->release();
m_pRealListener = NULL;
}
-
- DBG_DTOR(DisposeListenerGridBridge,NULL);
}
//==============================================================================
@@ -916,7 +908,6 @@ void DbGridRow::SetState(CursorWrapper* pCur, sal_Bool bPaintCursor)
}
}
-DBG_NAME(DbGridControl);
//------------------------------------------------------------------------------
DbGridControl::DbGridControl(
Reference< XMultiServiceFactory > _rxFactory,
@@ -957,8 +948,6 @@ DbGridControl::DbGridControl(
,m_bHideScrollbars( sal_False )
,m_bUpdating(sal_False)
{
- DBG_CTOR(DbGridControl,NULL);
-
String sName(SVX_RES(RID_STR_NAVIGATIONBAR));
m_aBar.SetAccessibleName(sName);
m_aBar.Show();
@@ -1022,8 +1011,6 @@ DbGridControl::~DbGridControl()
delete m_pDataCursor;
delete m_pSeekCursor;
-
- DBG_DTOR(DbGridControl,NULL);
}
//------------------------------------------------------------------------------
@@ -1862,7 +1849,6 @@ void DbGridControl::VisibleRowsChanged( long nNewTopRow, sal_uInt16 nLinesOnScre
//------------------------------------------------------------------------------
void DbGridControl::RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, sal_Bool bUpdateCursor)
{
- DBG_CHKTHIS( DbGridControl, NULL );
// Wenn kein Cursor -> keine Rows im Browser.
if (!m_pSeekCursor)
{
@@ -2077,8 +2063,6 @@ void DbGridControl::PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uI
//------------------------------------------------------------------------------
sal_Bool DbGridControl::CursorMoving(long nNewRow, sal_uInt16 nNewCol)
{
- DBG_CHKTHIS( DbGridControl, NULL );
-
DeactivateCell( sal_False );
if ( m_pDataCursor
@@ -2185,8 +2169,6 @@ sal_Bool DbGridControl::SetCurrent(long nNewRow)
//------------------------------------------------------------------------------
void DbGridControl::CursorMoved()
{
- DBG_CHKTHIS( DbGridControl, NULL );
-
// CursorBewegung durch loeschen oder einfuegen von Zeilen
if (m_pDataCursor && m_nCurrentPos != GetCurRow())
{
@@ -2264,7 +2246,7 @@ void DbGridControl::forceROController(sal_Bool bForce)
continue;
// nur wenn es eine Edit-Zeile ist, kann ich ihr das forced read-only mitgeben
- if (!pReturn->ISA(EditCellController) && !pReturn->ISA(SpinCellController))
+ if (!dynamic_cast< EditCellController* >(pReturn) && !dynamic_cast< SpinCellController* >(pReturn))
continue;
Edit& rEdit = (Edit&)pReturn->GetWindow();
@@ -2359,7 +2341,6 @@ void DbGridControl::AdjustDataSource(sal_Bool bFull)
//------------------------------------------------------------------------------
sal_Int32 DbGridControl::AlignSeekCursor()
{
- DBG_CHKTHIS( DbGridControl, NULL );
// Positioniert den SeekCursor auf den DatenCursor, Daten werden nicht uebertragen
if (!m_pSeekCursor)
@@ -2411,7 +2392,6 @@ sal_Int32 DbGridControl::AlignSeekCursor()
//------------------------------------------------------------------------------
sal_Bool DbGridControl::SeekCursor(long nRow, sal_Bool bAbsolute)
{
- DBG_CHKTHIS( DbGridControl, NULL );
// Positioniert den SeekCursor, Daten werden nicht uebertragen
// additions for the filtermode
@@ -2977,7 +2957,6 @@ void DbGridControl::Command(const CommandEvent& rEvt)
//------------------------------------------------------------------------------
IMPL_LINK(DbGridControl, OnDelete, void*, /*EMPTYTAG*/ )
{
- DBG_CHKTHIS(DbGridControl, NULL );
m_nDeleteEvent = 0;
DeleteSelectedRows();
return 0;
@@ -3076,7 +3055,7 @@ CellController* DbGridControl::GetController(long /*nRow*/, sal_uInt16 nColumnId
if (pReturn)
{
// wenn es eine Edit-Zeile ist, kann ich ihr das forced read-only mitgeben
- if (!pReturn->ISA(EditCellController) && !pReturn->ISA(SpinCellController))
+ if (!dynamic_cast< EditCellController* >(pReturn) && !dynamic_cast< SpinCellController* >(pReturn))
// ich konnte den Controller in forceROController nicht auf ReadOnly setzen
if (!bInsert && !bUpdate)
// ich bin nur hier, da m_bForceROController gesetzt war
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index 871a5b338e03..43793677adc1 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -40,11 +40,9 @@ using namespace ::connectivity;
//==========================================================================
//= OSystemParseContext
//==========================================================================
-DBG_NAME(OSystemParseContext)
//-----------------------------------------------------------------------------
OSystemParseContext::OSystemParseContext() : IParseContext()
{
- DBG_CTOR(OSystemParseContext,NULL);
vos::OGuard aGuard( Application::GetSolarMutex() );
::svx::StringListResource aKeywords( SVX_RES( RID_RSC_SQL_INTERNATIONAL ) );
@@ -54,7 +52,6 @@ OSystemParseContext::OSystemParseContext() : IParseContext()
//-----------------------------------------------------------------------------
OSystemParseContext::~OSystemParseContext()
{
- DBG_DTOR(OSystemParseContext,NULL);
}
//-----------------------------------------------------------------------------
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 07e5ccea8a55..89df47648f2b 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -2371,7 +2371,6 @@ namespace svxform
//========================================================================
// class DataNavigator
//========================================================================
- DBG_NAME(DataNavigator)
//------------------------------------------------------------------------
DataNavigator::DataNavigator( SfxBindings* _pBindings, SfxChildWindow* _pMgr, Window* _pParent ) :
@@ -2382,8 +2381,6 @@ namespace svxform
m_aDataWin( this, _pBindings )
{
- DBG_CTOR(DataNavigator,NULL);
-
SetHelpId( HID_DATA_NAVIGATOR_WIN );
SetText( SVX_RES( RID_STR_DATANAVIGATOR ) );
@@ -2397,7 +2394,6 @@ namespace svxform
//------------------------------------------------------------------------
DataNavigator::~DataNavigator()
{
- DBG_DTOR(DataNavigator,NULL);
}
//-----------------------------------------------------------------------
@@ -2412,7 +2408,7 @@ namespace svxform
if ( eState >= SFX_ITEM_AVAILABLE )
{
- FmFormShell* pShell = PTR_CAST( FmFormShell,((SfxObjectItem*)pState)->GetShell() );
+ FmFormShell* pShell = dynamic_cast< FmFormShell* >( ((SfxObjectItem*)pState)->GetShell() );
Update( pShell );
}
else
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 839af8133ea2..0b9d2ab6eecc 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -140,14 +140,12 @@ OLocalExchange* OFilterExchangeHelper::createExchange() const
}
//========================================================================
-TYPEINIT0(FmFilterData);
Image FmFilterData::GetImage( BmpColorMode /*_eMode*/ ) const
{
return Image();
}
//========================================================================
-TYPEINIT1(FmParentData, FmFilterData);
//------------------------------------------------------------------------
FmParentData::~FmParentData()
{
@@ -157,7 +155,6 @@ FmParentData::~FmParentData()
}
//========================================================================
-TYPEINIT1(FmFormItem, FmParentData);
//------------------------------------------------------------------------
Image FmFormItem::GetImage( BmpColorMode _eMode ) const
{
@@ -176,7 +173,6 @@ Image FmFormItem::GetImage( BmpColorMode _eMode ) const
}
//========================================================================
-TYPEINIT1(FmFilterItems, FmParentData);
//------------------------------------------------------------------------
FmFilterItem* FmFilterItems::Find( const ::sal_Int32 _nFilterComponentIndex ) const
{
@@ -185,7 +181,7 @@ FmFilterItem* FmFilterItems::Find( const ::sal_Int32 _nFilterComponentIndex ) co
++i
)
{
- FmFilterItem* pCondition = PTR_CAST( FmFilterItem, *i );
+ FmFilterItem* pCondition = dynamic_cast< FmFilterItem* >( *i );
DBG_ASSERT( pCondition, "FmFilterItems::Find: Wrong element in container!" );
if ( _nFilterComponentIndex == pCondition->GetComponentIndex() )
return pCondition;
@@ -211,7 +207,6 @@ Image FmFilterItems::GetImage( BmpColorMode _eMode ) const
}
//========================================================================
-TYPEINIT1(FmFilterItem, FmFilterData);
//------------------------------------------------------------------------
FmFilterItem::FmFilterItem( const Reference< XMultiServiceFactory >& _rxFactory,
FmFilterItems* pParent,
@@ -249,11 +244,9 @@ class FmFilterHint : public SfxHint
FmFilterData* m_pData;
public:
- TYPEINFO();
FmFilterHint(FmFilterData* pData):m_pData(pData){}
FmFilterData* GetData() const { return m_pData; }
};
-TYPEINIT1( FmFilterHint, SfxHint );
//========================================================================
class FmFilterInsertedHint : public FmFilterHint
@@ -261,54 +254,44 @@ class FmFilterInsertedHint : public FmFilterHint
sal_Int32 m_nPos; // Position relative to the parent of the data
public:
- TYPEINFO();
FmFilterInsertedHint(FmFilterData* pData, sal_Int32 nRelPos)
:FmFilterHint(pData)
,m_nPos(nRelPos){}
sal_Int32 GetPos() const { return m_nPos; }
};
-TYPEINIT1( FmFilterInsertedHint, FmFilterHint );
//========================================================================
class FmFilterRemovedHint : public FmFilterHint
{
public:
- TYPEINFO();
FmFilterRemovedHint(FmFilterData* pData)
:FmFilterHint(pData){}
};
-TYPEINIT1( FmFilterRemovedHint, FmFilterHint );
//========================================================================
class FmFilterTextChangedHint : public FmFilterHint
{
public:
- TYPEINFO();
FmFilterTextChangedHint(FmFilterData* pData)
:FmFilterHint(pData){}
};
-TYPEINIT1( FmFilterTextChangedHint, FmFilterHint );
//========================================================================
class FilterClearingHint : public SfxHint
{
public:
- TYPEINFO();
FilterClearingHint(){}
};
-TYPEINIT1( FilterClearingHint, SfxHint );
//========================================================================
class FmFilterCurrentChangedHint : public SfxHint
{
public:
- TYPEINFO();
FmFilterCurrentChangedHint(){}
};
-TYPEINIT1( FmFilterCurrentChangedHint, SfxHint );
//========================================================================
// class FmFilterAdapter, Listener an den FilterControls
@@ -381,7 +364,7 @@ void FmFilterAdapter::setText(sal_Int32 nRowPos,
const FmFilterItem* pFilterItem,
const ::rtl::OUString& rText)
{
- FmFormItem* pFormItem = PTR_CAST( FmFormItem, pFilterItem->GetParent()->GetParent() );
+ FmFormItem* pFormItem = dynamic_cast< FmFormItem* >( pFilterItem->GetParent()->GetParent() );
try
{
@@ -458,7 +441,7 @@ void FmFilterAdapter::predicateExpressionChanged( const FilterEvent& _Event ) th
const sal_Int32 nActiveTerm( xFilterController->getActiveTerm() );
- FmFilterItems* pFilter = PTR_CAST( FmFilterItems, pFormItem->GetChildren()[ nActiveTerm ] );
+ FmFilterItems* pFilter = dynamic_cast< FmFilterItems* >( pFormItem->GetChildren()[ nActiveTerm ] );
FmFilterItem* pFilterItem = pFilter->Find( _Event.FilterComponent );
if ( pFilterItem )
{
@@ -554,7 +537,6 @@ void SAL_CALL FmFilterAdapter::disjunctiveTermAdded( const FilterEvent& _Event )
//========================================================================
// class FmFilterModel
//========================================================================
-TYPEINIT1(FmFilterModel, FmParentData);
//------------------------------------------------------------------------
FmFilterModel::FmFilterModel(const Reference< XMultiServiceFactory >& _rxFactory)
:FmParentData(_rxFactory,NULL, ::rtl::OUString())
@@ -705,7 +687,7 @@ FmFormItem* FmFilterModel::Find(const ::std::vector<FmFilterData*>& rItems, cons
for (::std::vector<FmFilterData*>::const_iterator i = rItems.begin();
i != rItems.end(); i++)
{
- FmFormItem* pForm = PTR_CAST(FmFormItem,*i);
+ FmFormItem* pForm = dynamic_cast< FmFormItem* >(*i);
if (pForm)
{
if ( xController == pForm->GetController() )
@@ -727,7 +709,7 @@ FmFormItem* FmFilterModel::Find(const ::std::vector<FmFilterData*>& rItems, cons
for (::std::vector<FmFilterData*>::const_iterator i = rItems.begin();
i != rItems.end(); i++)
{
- FmFormItem* pForm = PTR_CAST(FmFormItem,*i);
+ FmFormItem* pForm = dynamic_cast< FmFormItem* >(*i);
if (pForm)
{
if (xForm == pForm->GetController()->getModel())
@@ -780,7 +762,7 @@ void FmFilterModel::AppendFilterItems( FmFormItem& _rFormItem )
++iter
)
{
- if ((*iter)->ISA(FmFilterItems))
+ if (dynamic_cast<FmFilterItems* >(*iter))
break;
}
@@ -821,7 +803,7 @@ void FmFilterModel::Remove(FmFilterData* pData)
DBG_ASSERT(i != rItems.end(), "FmFilterModel::Remove(): unknown Item");
// position within the parent
sal_Int32 nPos = i - rItems.begin();
- if (pData->ISA(FmFilterItems))
+ if (dynamic_cast< FmFilterItems* >(pData))
{
FmFormItem* pFormItem = (FmFormItem*)pParent;
@@ -837,7 +819,7 @@ void FmFilterModel::Remove(FmFilterData* pData)
while ( !rChildren.empty() )
{
::std::vector< FmFilterData* >::iterator removePos = rChildren.end() - 1;
- FmFilterItem* pFilterItem = PTR_CAST( FmFilterItem, *removePos );
+ FmFilterItem* pFilterItem = dynamic_cast< FmFilterItem* >(*removePos );
m_pAdapter->setText( nPos, pFilterItem, ::rtl::OUString() );
Remove( removePos );
}
@@ -854,7 +836,7 @@ void FmFilterModel::Remove(FmFilterData* pData)
}
else // FormItems can not be deleted
{
- FmFilterItem* pFilterItem = PTR_CAST(FmFilterItem, pData);
+ FmFilterItem* pFilterItem = dynamic_cast< FmFilterItem* >(pData);
// if its the last condition remove the parent
if (rItems.size() == 1)
@@ -891,7 +873,7 @@ void FmFilterModel::Remove( const ::std::vector<FmFilterData*>::iterator& rPos )
//------------------------------------------------------------------------
sal_Bool FmFilterModel::ValidateText(FmFilterItem* pItem, UniString& rText, UniString& rErrorMsg) const
{
- FmFormItem* pFormItem = PTR_CAST( FmFormItem, pItem->GetParent()->GetParent() );
+ FmFormItem* pFormItem = dynamic_cast< FmFormItem* >( pItem->GetParent()->GetParent() );
try
{
Reference< XFormController > xFormController( pFormItem->GetController() );
@@ -1009,21 +991,21 @@ void FmFilterModel::EnsureEmptyFilterRows( FmParentData& _rItem )
{
// checks whether for each form there's one free level for input
::std::vector< FmFilterData* >& rChildren = _rItem.GetChildren();
- sal_Bool bAppendLevel = _rItem.ISA( FmFormItem );
+ sal_Bool bAppendLevel(0 != dynamic_cast< FmFormItem* >(&_rItem));
for ( ::std::vector<FmFilterData*>::iterator i = rChildren.begin();
i != rChildren.end();
++i
)
{
- FmFilterItems* pItems = PTR_CAST(FmFilterItems, *i);
+ FmFilterItems* pItems = dynamic_cast< FmFilterItems* >(*i);
if ( pItems && pItems->GetChildren().empty() )
{
bAppendLevel = sal_False;
break;
}
- FmFormItem* pFormItem = PTR_CAST(FmFormItem, *i);
+ FmFormItem* pFormItem = dynamic_cast< FmFormItem* >(*i);
if (pFormItem)
{
EnsureEmptyFilterRows( *pFormItem );
@@ -1033,7 +1015,7 @@ void FmFilterModel::EnsureEmptyFilterRows( FmParentData& _rItem )
if ( bAppendLevel )
{
- FmFormItem* pFormItem = PTR_CAST( FmFormItem, &_rItem );
+ FmFormItem* pFormItem = dynamic_cast< FmFormItem* >( &_rItem );
OSL_ENSURE( pFormItem, "FmFilterModel::EnsureEmptyFilterRows: no FmFormItem, but a FmFilterItems child?" );
if ( pFormItem )
AppendFilterItems( *pFormItem );
@@ -1243,7 +1225,7 @@ sal_Bool FmFilterNavigator::EditingEntry( SvLBoxEntry* pEntry, Selection& rSelec
if (!SvTreeListBox::EditingEntry( pEntry, rSelection ))
return sal_False;
- return pEntry && ((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem);
+ return pEntry && (0 != dynamic_cast< FmFilterItem* >((FmFilterData*)pEntry->GetUserData()));
}
//------------------------------------------------------------------------
@@ -1255,7 +1237,7 @@ sal_Bool FmFilterNavigator::EditedEntry( SvLBoxEntry* pEntry, const XubString& r
if (EditingCanceled())
return sal_True;
- DBG_ASSERT(((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem),
+ DBG_ASSERT(dynamic_cast< FmFilterItem* >((FmFilterData*)pEntry->GetUserData()),
"FmFilterNavigator::EditedEntry() wrong entry");
UniString aText(rNewText);
@@ -1412,15 +1394,15 @@ sal_Int8 FmFilterNavigator::AcceptDrop( const AcceptDropEvent& rEvt )
FmFilterData* pData = (FmFilterData*)pDropTarget->GetUserData();
FmFormItem* pForm = NULL;
- if (pData->ISA(FmFilterItem))
+ if(dynamic_cast< FmFilterItem* >(pData))
{
- pForm = PTR_CAST(FmFormItem,pData->GetParent()->GetParent());
+ pForm = dynamic_cast< FmFormItem* >(pData->GetParent()->GetParent());
if (pForm != m_aControlExchange->getFormItem())
return DND_ACTION_NONE;
}
- else if (pData->ISA(FmFilterItems))
+ else if (dynamic_cast< FmFilterItems* >(pData))
{
- pForm = PTR_CAST(FmFormItem,pData->GetParent());
+ pForm = dynamic_cast< FmFormItem* >(pData->GetParent());
if (pForm != m_aControlExchange->getFormItem())
return DND_ACTION_NONE;
}
@@ -1435,12 +1417,16 @@ namespace
FmFilterItems* getTargetItems(SvLBoxEntry* _pTarget)
{
FmFilterData* pData = static_cast<FmFilterData*>(_pTarget->GetUserData());
- FmFilterItems* pTargetItems = pData->ISA(FmFilterItems)
- ?
- PTR_CAST(FmFilterItems,pData)
- :
- PTR_CAST(FmFilterItems,pData->GetParent());
- return pTargetItems;
+ FmFilterItems* pTargetItems = dynamic_cast< FmFilterItems* >(pData);
+
+ if(pTargetItems)
+ {
+ return pTargetItems;
+ }
+ else
+ {
+ return dynamic_cast< FmFilterItems* >(pData->GetParent());
+ }
}
}
//------------------------------------------------------------------------
@@ -1481,10 +1467,11 @@ void FmFilterNavigator::InitEntry(SvLBoxEntry* pEntry,
{
SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind );
SvLBoxString* pString = NULL;
+ FmFilterItem* pFmFilterItem = dynamic_cast< FmFilterItem* >((FmFilterData*)pEntry->GetUserData());
- if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem))
- pString = new FmFilterString(pEntry, 0, rStr, ((FmFilterItem*)pEntry->GetUserData())->GetFieldName());
- else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItems))
+ if (pFmFilterItem)
+ pString = new FmFilterString(pEntry, 0, rStr, pFmFilterItem->GetFieldName());
+ else if (dynamic_cast< FmFilterItems* >((FmFilterData*)pEntry->GetUserData()))
pString = new FmFilterItemsString(pEntry, 0, rStr );
if (pString)
@@ -1501,22 +1488,23 @@ sal_Bool FmFilterNavigator::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
{
if (bSelect)
{
- FmFormItem* pFormItem = NULL;
- if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem))
+ FmFormItem* pFormItem = 0;
+
+ if (dynamic_cast< FmFilterItem* >((FmFilterData*)pEntry->GetUserData()))
pFormItem = (FmFormItem*)((FmFilterItem*)pEntry->GetUserData())->GetParent()->GetParent();
- else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItems))
+ else if (dynamic_cast< FmFilterItems* >((FmFilterData*)pEntry->GetUserData()))
pFormItem = (FmFormItem*)((FmFilterItem*)pEntry->GetUserData())->GetParent()->GetParent();
- else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFormItem))
+ else if (dynamic_cast< FmFormItem* >((FmFilterData*)pEntry->GetUserData()))
pFormItem = (FmFormItem*)pEntry->GetUserData();
if (pFormItem)
{
// will the controller be exchanged?
- if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItem))
+ if (dynamic_cast< FmFilterItem* >((FmFilterData*)pEntry->GetUserData()))
m_pModel->SetCurrentItems((FmFilterItems*)((FmFilterItem*)pEntry->GetUserData())->GetParent());
- else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFilterItems))
+ else if (dynamic_cast< FmFilterItems* >((FmFilterData*)pEntry->GetUserData()))
m_pModel->SetCurrentItems((FmFilterItems*)pEntry->GetUserData());
- else if (((FmFilterData*)pEntry->GetUserData())->ISA(FmFormItem))
+ else if (dynamic_cast< FmFormItem* >((FmFilterData*)pEntry->GetUserData()))
m_pModel->SetCurrentController(((FmFormItem*)pEntry->GetUserData())->GetController());
}
}
@@ -1529,33 +1517,52 @@ sal_Bool FmFilterNavigator::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
//------------------------------------------------------------------------
void FmFilterNavigator::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if (rHint.ISA(FmFilterInsertedHint))
- {
- FmFilterInsertedHint* pHint = (FmFilterInsertedHint*)&rHint;
- Insert(pHint->GetData(), pHint->GetPos());
- }
- else if( rHint.ISA(FilterClearingHint) )
- {
- SvTreeListBox::Clear();
- }
- else if( rHint.ISA(FmFilterRemovedHint) )
- {
- FmFilterRemovedHint* pHint = (FmFilterRemovedHint*)&rHint;
- Remove(pHint->GetData());
- }
- else if( rHint.ISA(FmFilterTextChangedHint) )
+ const FmFilterInsertedHint* pFmFilterInsertedHint = dynamic_cast< const FmFilterInsertedHint* >(&rHint);
+
+ if (pFmFilterInsertedHint)
{
- FmFilterTextChangedHint* pHint = (FmFilterTextChangedHint*)&rHint;
- SvLBoxEntry* pEntry = FindEntry(pHint->GetData());
- if (pEntry)
- SetEntryText( pEntry, pHint->GetData()->GetText());
+ Insert(pFmFilterInsertedHint->GetData(), pFmFilterInsertedHint->GetPos());
}
- else if( rHint.ISA(FmFilterCurrentChangedHint) )
+ else
{
- // invalidate the entries
- for (SvLBoxEntry* pEntry = First(); pEntry != NULL;
- pEntry = Next(pEntry))
- GetModel()->InvalidateEntry( pEntry );
+ const FilterClearingHint* pFilterClearingHint = dynamic_cast< const FilterClearingHint* >(&rHint);
+
+ if( pFilterClearingHint )
+ {
+ SvTreeListBox::Clear();
+ }
+ else
+ {
+ const FmFilterRemovedHint* pFmFilterRemovedHint = dynamic_cast< const FmFilterRemovedHint* >(&rHint);
+
+ if( pFmFilterRemovedHint )
+ {
+ Remove(pFmFilterRemovedHint->GetData());
+ }
+ else
+ {
+ const FmFilterTextChangedHint* pFmFilterTextChangedHint = dynamic_cast< const FmFilterTextChangedHint* >(&rHint);
+
+ if( pFmFilterTextChangedHint )
+ {
+ SvLBoxEntry* pEntry = FindEntry(pFmFilterTextChangedHint->GetData());
+ if (pEntry)
+ SetEntryText( pEntry, pFmFilterTextChangedHint->GetData()->GetText());
+ }
+ else
+ {
+ const FmFilterCurrentChangedHint* pFmFilterCurrentChangedHint = dynamic_cast< const FmFilterCurrentChangedHint* >(&rHint);
+
+ if( pFmFilterCurrentChangedHint )
+ {
+ // invalidate the entries
+ for (SvLBoxEntry* pEntry = First(); pEntry != NULL;
+ pEntry = Next(pEntry))
+ GetModel()->InvalidateEntry( pEntry );
+ }
+ }
+ }
+ }
}
}
@@ -1617,10 +1624,10 @@ FmFormItem* FmFilterNavigator::getSelectedFilterItems(::std::vector<FmFilterItem
bHandled && pEntry != NULL;
pEntry = NextSelected(pEntry))
{
- FmFilterItem* pFilter = PTR_CAST(FmFilterItem, (FmFilterData*)pEntry->GetUserData());
+ FmFilterItem* pFilter = dynamic_cast< FmFilterItem* >((FmFilterData*)pEntry->GetUserData());
if (pFilter)
{
- FmFormItem* pForm = PTR_CAST(FmFormItem,pFilter->GetParent()->GetParent());
+ FmFormItem* pForm = dynamic_cast< FmFormItem* >(pFilter->GetParent()->GetParent());
if (!pForm)
bHandled = sal_False;
else if (!pFirstItem)
@@ -1726,14 +1733,14 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt )
pEntry = NextSelected(pEntry))
{
// don't delete forms
- FmFormItem* pForm = PTR_CAST(FmFormItem, (FmFilterData*)pEntry->GetUserData());
+ FmFormItem* pForm = dynamic_cast< FmFormItem* >((FmFilterData*)pEntry->GetUserData());
if (!pForm)
aSelectList.push_back((FmFilterData*)pEntry->GetUserData());
}
if (aSelectList.size() == 1)
{
// don't delete the only empty row of a form
- FmFilterItems* pFilterItems = PTR_CAST(FmFilterItems, aSelectList[0]);
+ FmFilterItems* pFilterItems = dynamic_cast< FmFilterItems* >(aSelectList[0]);
if (pFilterItems && pFilterItems->GetChildren().empty()
&& pFilterItems->GetParent()->GetChildren().size() == 1)
aSelectList.clear();
@@ -1745,7 +1752,7 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt )
aContextMenu.EnableItem( SID_FM_DELETE, !aSelectList.empty() );
//
- sal_Bool bEdit = PTR_CAST(FmFilterItem, (FmFilterData*)pClicked->GetUserData()) != NULL &&
+ sal_Bool bEdit = dynamic_cast< FmFilterItem* >((FmFilterData*)pClicked->GetUserData()) != NULL &&
IsSelected(pClicked) && GetSelectionCount() == 1;
aContextMenu.EnableItem( SID_FM_FILTER_EDIT,
@@ -1908,11 +1915,11 @@ void FmFilterNavigator::DeleteSelection()
pEntry != NULL;
pEntry = NextSelected(pEntry))
{
- FmFilterItem* pFilterItem = PTR_CAST(FmFilterItem, (FmFilterData*)pEntry->GetUserData());
+ FmFilterItem* pFilterItem = dynamic_cast< FmFilterItem* >((FmFilterData*)pEntry->GetUserData());
if (pFilterItem && IsSelected(GetParent(pEntry)))
continue;
- FmFormItem* pForm = PTR_CAST(FmFormItem, (FmFilterData*)pEntry->GetUserData());
+ FmFormItem* pForm = dynamic_cast< FmFormItem* >((FmFilterData*)pEntry->GetUserData());
if (!pForm)
aEntryList.push_back(pEntry);
}
@@ -1983,7 +1990,7 @@ void FmFilterNavigatorWin::StateChanged( sal_uInt16 nSID, SfxItemState eState, c
if( eState >= SFX_ITEM_AVAILABLE )
{
- FmFormShell* pShell = PTR_CAST( FmFormShell,((SfxObjectItem*)pState)->GetShell() );
+ FmFormShell* pShell = dynamic_cast< FmFormShell* >(((SfxObjectItem*)pState)->GetShell() );
UpdateContent( pShell );
}
else
diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx
index c0260edb1731..5eb81acff6a1 100644
--- a/svx/source/form/fmPropBrw.cxx
+++ b/svx/source/form/fmPropBrw.cxx
@@ -204,7 +204,6 @@ using namespace ::svxform;
//========================================================================
// class FmPropBrw
//========================================================================
-DBG_NAME(FmPropBrw);
//------------------------------------------------------------------------
FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBindings* _pBindings,
SfxChildWindow* _pMgr, Window* _pParent, const SfxChildWinInfo* _pInfo )
@@ -214,8 +213,6 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding
,m_bInStateChange( false )
,m_xORB(_xORB)
{
- DBG_CTOR(FmPropBrw,NULL);
-
::Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y);
SetMinOutputSizePixel(::Size(STD_MIN_SIZE_X,STD_MIN_SIZE_Y));
SetOutputSizePixel(aPropWinSize);
@@ -310,7 +307,6 @@ FmPropBrw::~FmPropBrw()
{
DBG_UNHANDLED_EXCEPTION();
}
- DBG_DTOR(FmPropBrw,NULL);
}
//-----------------------------------------------------------------------
@@ -670,7 +666,7 @@ void FmPropBrw::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPool
{
if (eState >= SFX_ITEM_AVAILABLE)
{
- FmFormShell* pShell = PTR_CAST(FmFormShell,((SfxObjectItem*)pState)->GetShell());
+ FmFormShell* pShell = dynamic_cast< FmFormShell* >( ((SfxObjectItem*)pState)->GetShell());
InterfaceBag aSelection;
if ( pShell )
pShell->GetImpl()->getCurrentSelection( aSelection );
diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx
index f7ec783f83e4..8d1c5c0ebe4d 100644
--- a/svx/source/form/fmdmod.cxx
+++ b/svx/source/form/fmdmod.cxx
@@ -42,7 +42,9 @@ using namespace ::svxform;
}
else if ( ServiceSpecifier == ::rtl::OUString( ::rtl::OUString::createFromAscii("com.sun.star.drawing.ControlShape") ) )
{
- SdrObject* pObj = new FmFormObj(OBJ_FM_CONTROL);
+ SdrModel* pTargetModel = getSdrModel();
+ OSL_ENSURE(pTargetModel, "Got no SdrModel for SdrShape construction (!)");
+ SdrObject* pObj = new FmFormObj(*pTargetModel, ::rtl::OUString(), OBJ_FM_CONTROL);
xRet = *new SvxShapeControl(pObj);
}
if (!xRet.is())
diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx
index 104abf4318ee..5336574876c8 100644
--- a/svx/source/form/fmdpage.cxx
+++ b/svx/source/form/fmdpage.cxx
@@ -35,16 +35,13 @@ using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::form::XFormsSupplier2;
-DBG_NAME(SvxFmDrawPage)
SvxFmDrawPage::SvxFmDrawPage( SdrPage* pInPage ) :
SvxDrawPage( pInPage )
{
- DBG_CTOR(SvxFmDrawPage,NULL);
}
SvxFmDrawPage::~SvxFmDrawPage() throw ()
{
- DBG_DTOR(SvxFmDrawPage,NULL);
}
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL SvxFmDrawPage::getImplementationId() throw(::com::sun::star::uno::RuntimeException)
@@ -91,10 +88,13 @@ SdrObject *SvxFmDrawPage::_CreateSdrObject( const ::com::sun::star::uno::Referen
{
::rtl::OUString aShapeType( xDescr->getShapeType() );
- if ( aShapeType.equalsAscii( "com.sun.star.drawing.ShapeControl" ) // compatibility
+ if (GetSdrPage()
+ && ( aShapeType.equalsAscii( "com.sun.star.drawing.ShapeControl" ) // compatibility
|| aShapeType.equalsAscii( "com.sun.star.drawing.ControlShape" )
- )
- return new FmFormObj( OBJ_FM_CONTROL );
+ ))
+ {
+ return new FmFormObj( GetSdrPage()->getSdrModelFromSdrPage(), ::rtl::OUString(), OBJ_FM_CONTROL );
+ }
else
return SvxDrawPage::_CreateSdrObject( xDescr );
@@ -116,7 +116,7 @@ SdrObject *SvxFmDrawPage::_CreateSdrObject( const ::com::sun::star::uno::Referen
{
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xForms;
- FmFormPage *pFmPage = PTR_CAST( FmFormPage, GetSdrPage() );
+ FmFormPage *pFmPage = dynamic_cast< FmFormPage* >( GetSdrPage() );
if( pFmPage )
xForms = pFmPage->GetForms();
@@ -127,7 +127,7 @@ SdrObject *SvxFmDrawPage::_CreateSdrObject( const ::com::sun::star::uno::Referen
sal_Bool SAL_CALL SvxFmDrawPage::hasForms(void) throw( ::com::sun::star::uno::RuntimeException )
{
sal_Bool bHas = sal_False;
- FmFormPage* pFormPage = PTR_CAST( FmFormPage, GetSdrPage() );
+ FmFormPage* pFormPage = dynamic_cast< FmFormPage* >( GetSdrPage() );
if ( pFormPage )
bHas = pFormPage->GetForms( false ).is();
return bHas;
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index 738e91d5f8dc..70d458033330 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -50,7 +50,7 @@
#include "fmprop.hrc"
#endif
#include <svx/dialmgr.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdouno.hxx>
#include <fmundo.hxx>
#include <svx/svdobj.hxx>
@@ -100,135 +100,107 @@ SV_IMPL_PTRARR_SORT( SvLBoxEntrySortedArray, SvLBoxEntryPtr )
//========================================================================
// class FmNavInsertedHint
//========================================================================
-TYPEINIT1( FmNavInsertedHint, SfxHint );
-DBG_NAME(FmNavInsertedHint);
//------------------------------------------------------------------------
FmNavInsertedHint::FmNavInsertedHint( FmEntryData* pInsertedEntryData, sal_uInt32 nRelPos )
:pEntryData( pInsertedEntryData )
,nPos( nRelPos )
{
- DBG_CTOR(FmNavInsertedHint,NULL);
}
//------------------------------------------------------------------------
FmNavInsertedHint::~FmNavInsertedHint()
{
- DBG_DTOR(FmNavInsertedHint,NULL);
}
//========================================================================
// class FmNavInsertedHint
//========================================================================
-TYPEINIT1( FmNavModelReplacedHint, SfxHint );
-DBG_NAME(FmNavModelReplacedHint);
//------------------------------------------------------------------------
FmNavModelReplacedHint::FmNavModelReplacedHint( FmEntryData* pAffectedEntryData )
:pEntryData( pAffectedEntryData )
{
- DBG_CTOR(FmNavModelReplacedHint,NULL);
}
//------------------------------------------------------------------------
FmNavModelReplacedHint::~FmNavModelReplacedHint()
{
- DBG_DTOR(FmNavModelReplacedHint,NULL);
}
//========================================================================
// class FmNavRemovedHint
//========================================================================
-TYPEINIT1( FmNavRemovedHint, SfxHint );
-DBG_NAME(FmNavRemovedHint);
//------------------------------------------------------------------------
FmNavRemovedHint::FmNavRemovedHint( FmEntryData* pRemovedEntryData )
:pEntryData( pRemovedEntryData )
{
- DBG_CTOR(FmNavRemovedHint,NULL);
}
//------------------------------------------------------------------------
FmNavRemovedHint::~FmNavRemovedHint()
{
- DBG_DTOR(FmNavRemovedHint,NULL);
}
//========================================================================
// class FmNavNameChangedHint
//========================================================================
-TYPEINIT1( FmNavNameChangedHint, SfxHint );
-DBG_NAME(FmNavNameChangedHint);
//------------------------------------------------------------------------
FmNavNameChangedHint::FmNavNameChangedHint( FmEntryData* pData, const ::rtl::OUString& rNewName )
:pEntryData( pData )
,aNewName( rNewName )
{
- DBG_CTOR(FmNavNameChangedHint,NULL);
}
//------------------------------------------------------------------------
FmNavNameChangedHint::~FmNavNameChangedHint()
{
- DBG_DTOR(FmNavNameChangedHint,NULL);
}
//========================================================================
// class FmNavClearedHint
//========================================================================
-TYPEINIT1( FmNavClearedHint, SfxHint );
-DBG_NAME(FmNavClearedHint);
//------------------------------------------------------------------------
FmNavClearedHint::FmNavClearedHint()
{
- DBG_CTOR(FmNavClearedHint,NULL);
}
//------------------------------------------------------------------------
FmNavClearedHint::~FmNavClearedHint()
{
- DBG_DTOR(FmNavClearedHint,NULL);
}
//========================================================================
// class FmNavRequestSelectHint
//========================================================================
-TYPEINIT1(FmNavRequestSelectHint, SfxHint);
//========================================================================
// class FmNavViewMarksChanged
//========================================================================
-TYPEINIT1(FmNavViewMarksChanged, SfxHint);
//========================================================================
// class FmEntryDataList
//========================================================================
-DBG_NAME(FmEntryDataList);
//------------------------------------------------------------------------
FmEntryDataList::FmEntryDataList()
{
- DBG_CTOR(FmEntryDataList,NULL);
}
//------------------------------------------------------------------------
FmEntryDataList::~FmEntryDataList()
{
- DBG_DTOR(FmEntryDataList,NULL);
}
//========================================================================
// class FmEntryData
//========================================================================
-TYPEINIT0( FmEntryData );
-DBG_NAME(FmEntryData);
//------------------------------------------------------------------------
FmEntryData::FmEntryData( FmEntryData* pParentData, const Reference< XInterface >& _rxIFace )
:pParent( pParentData )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmEntryData::FmEntryData" );
- DBG_CTOR(FmEntryData,NULL);
pChildList = new FmEntryDataList();
newObject( _rxIFace );
@@ -239,7 +211,6 @@ FmEntryData::~FmEntryData()
{
Clear();
delete pChildList;
- DBG_DTOR(FmEntryData,NULL);
}
//------------------------------------------------------------------------
@@ -321,14 +292,11 @@ sal_Bool FmEntryData::IsEqualWithoutChilds( FmEntryData* pEntryData )
//========================================================================
// class FmFormData
//========================================================================
-TYPEINIT1( FmFormData, FmEntryData );
-DBG_NAME(FmFormData);
//------------------------------------------------------------------------
FmFormData::FmFormData( const Reference< XForm >& _rxForm, const ImageList& _rNormalImages, const ImageList& _rHCImages, FmFormData* _pParent )
:FmEntryData( _pParent, _rxForm )
,m_xForm( _rxForm )
{
- DBG_CTOR(FmEntryData,NULL);
//////////////////////////////////////////////////////////////////////
// Images setzen
@@ -353,14 +321,12 @@ FmFormData::FmFormData( const Reference< XForm >& _rxForm, const ImageList& _rNo
//------------------------------------------------------------------------
FmFormData::~FmFormData()
{
- DBG_DTOR(FmEntryData,NULL);
}
//------------------------------------------------------------------------
FmFormData::FmFormData( const FmFormData& rFormData )
:FmEntryData( rFormData )
{
- DBG_CTOR(FmEntryData,NULL);
m_xForm = rFormData.GetFormIface();
}
@@ -375,9 +341,12 @@ sal_Bool FmFormData::IsEqualWithoutChilds( FmEntryData* pEntryData )
{
if(this == pEntryData)
return sal_True;
- if( !pEntryData->ISA(FmFormData) )
+
+ FmFormData* pFormData = dynamic_cast< FmFormData* >(pEntryData);
+
+ if( !pFormData )
return sal_False;
- FmFormData* pFormData = (FmFormData*)pEntryData;
+
if( (XForm*)m_xForm.get() != (XForm*)pFormData->GetFormIface().get() )
return sal_False;
@@ -388,15 +357,12 @@ sal_Bool FmFormData::IsEqualWithoutChilds( FmEntryData* pEntryData )
//========================================================================
// class FmControlData
//========================================================================
-TYPEINIT1( FmControlData, FmEntryData );
-DBG_NAME(FmControlData);
//------------------------------------------------------------------------
FmControlData::FmControlData( const Reference< XFormComponent >& _rxComponent, const ImageList& _rNormalImages, const ImageList& _rHCImages, FmFormData* _pParent )
:FmEntryData( _pParent, _rxComponent )
,m_xFormComponent( _rxComponent )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmControlData::FmControlData" );
- DBG_CTOR(FmControlData,NULL);
//////////////////////////////////////////////////////////////////////
// Images setzen
m_aNormalImage = GetImage( _rNormalImages );
@@ -417,14 +383,12 @@ FmControlData::FmControlData( const Reference< XFormComponent >& _rxComponent, c
//------------------------------------------------------------------------
FmControlData::~FmControlData()
{
- DBG_DTOR(FmControlData,NULL);
}
//------------------------------------------------------------------------
FmControlData::FmControlData( const FmControlData& rControlData )
:FmEntryData( rControlData )
{
- DBG_CTOR(FmControlData,NULL);
m_xFormComponent = rControlData.GetFormComponent();
}
@@ -550,9 +514,10 @@ sal_Bool FmControlData::IsEqualWithoutChilds( FmEntryData* pEntryData )
if(this == pEntryData)
return sal_True;
- if( !pEntryData->ISA(FmControlData) )
+ FmControlData* pControlData = dynamic_cast< FmControlData* >(pEntryData);
+
+ if( !pControlData )
return sal_False;
- FmControlData* pControlData = (FmControlData*)pEntryData;
if( (XFormComponent*)m_xFormComponent.get() != (XFormComponent*)pControlData->GetFormComponent().get() )
return sal_False;
@@ -580,14 +545,12 @@ namespace svxform
//========================================================================
// class NavigatorFrame
//========================================================================
- DBG_NAME(NavigatorFrame)
//------------------------------------------------------------------------
NavigatorFrame::NavigatorFrame( SfxBindings* _pBindings, SfxChildWindow* _pMgr,
Window* _pParent )
:SfxDockingWindow( _pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_ROLLABLE|WB_3DLOOK|WB_DOCKABLE) )
,SfxControllerItem( SID_FM_FMEXPLORER_CONTROL, *_pBindings )
{
- DBG_CTOR(NavigatorFrame,NULL);
SetHelpId( HID_FORM_NAVIGATOR_WIN );
m_pNavigatorTree = new NavigatorTree(comphelper::getProcessServiceFactory(), this );
@@ -600,7 +563,6 @@ namespace svxform
NavigatorFrame::~NavigatorFrame()
{
delete m_pNavigatorTree;
- DBG_DTOR(NavigatorFrame,NULL);
}
//-----------------------------------------------------------------------
@@ -617,7 +579,7 @@ namespace svxform
if( eState >= SFX_ITEM_AVAILABLE )
{
- FmFormShell* pShell = PTR_CAST( FmFormShell,((SfxObjectItem*)pState)->GetShell() );
+ FmFormShell* pShell = dynamic_cast< FmFormShell* >( ((SfxObjectItem*)pState)->GetShell() );
UpdateContent( pShell );
}
else
diff --git a/svx/source/form/fmitems.cxx b/svx/source/form/fmitems.cxx
index a6b07610b344..b0e2dc4a4734 100644
--- a/svx/source/form/fmitems.cxx
+++ b/svx/source/form/fmitems.cxx
@@ -31,7 +31,6 @@
//========================================================================
// class FmInterfaceItem
//========================================================================
-TYPEINIT1(FmInterfaceItem, SfxPoolItem);
//------------------------------------------------------------------------------
int FmInterfaceItem::operator==( const SfxPoolItem& rAttr ) const
diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx
index b3bcc9688977..01f1e2b87b21 100644
--- a/svx/source/form/fmmodel.cxx
+++ b/svx/source/form/fmmodel.cxx
@@ -45,8 +45,6 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::container::XNameContainer;
using namespace svxform;
-TYPEINIT1(FmFormModel, SdrModel);
-
struct FmFormModelImplData
{
FmXUndoEnvironment* pUndoEnv;
@@ -69,68 +67,8 @@ struct FmFormModelImplData
|* Ctor
|*
\************************************************************************/
-FmFormModel::FmFormModel(SfxItemPool* pPool, SfxObjectShell* pPers)
- :SdrModel(pPool, pPers, LOADREFCOUNTS)
- ,m_pImpl(NULL)
- ,m_pObjShell(0)
- ,m_bOpenInDesignMode(sal_False)
- ,m_bAutoControlFocus(sal_False)
-{
-#ifndef SVX_LIGHT
- m_pImpl = new FmFormModelImplData;
- m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
- m_pImpl->pUndoEnv->acquire();
-#endif
-}
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-FmFormModel::FmFormModel(const XubString& rPath, SfxItemPool* pPool, SfxObjectShell* pPers)
- :SdrModel(rPath, pPool, pPers)
- ,m_pImpl(NULL)
- ,m_pObjShell(0)
- ,m_bOpenInDesignMode(sal_False)
- ,m_bAutoControlFocus(sal_False)
-{
-#ifndef SVX_LIGHT
- m_pImpl = new FmFormModelImplData;
- m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
- m_pImpl->pUndoEnv->acquire();
-#endif
-}
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-FmFormModel::FmFormModel(SfxItemPool* pPool, SfxObjectShell* pPers,
- FASTBOOL bUseExtColorTable
- )
- :SdrModel(pPool, pPers, bUseExtColorTable, LOADREFCOUNTS)
- ,m_pImpl(NULL)
- ,m_pObjShell(0)
- ,m_bOpenInDesignMode(sal_False)
- ,m_bAutoControlFocus(sal_False)
-{
-#ifndef SVX_LIGHT
- m_pImpl = new FmFormModelImplData;
- m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
- m_pImpl->pUndoEnv->acquire();
-#endif
-}
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-FmFormModel::FmFormModel(const XubString& rPath, SfxItemPool* pPool, SfxObjectShell* pPers,
- FASTBOOL bUseExtColorTable)
- :SdrModel(rPath, pPool, pPers, bUseExtColorTable, LOADREFCOUNTS)
+FmFormModel::FmFormModel(const XubString& rPath, SfxItemPool* pPool, SfxObjectShell* pPers, bool bUseExtColorTable)
+: SdrModel(rPath, pPool, pPers, bUseExtColorTable)
,m_pImpl( NULL )
,m_pObjShell(0)
,m_bOpenInDesignMode(sal_False)
@@ -169,7 +107,7 @@ FmFormModel::~FmFormModel()
|* Erzeugt eine neue Seite
|*
\************************************************************************/
-SdrPage* FmFormModel::AllocPage(FASTBOOL bMasterPage)
+SdrPage* FmFormModel::AllocPage(bool bMasterPage)
{
return new FmFormPage(*this, NULL, bMasterPage);
}
@@ -179,7 +117,7 @@ SdrPage* FmFormModel::AllocPage(FASTBOOL bMasterPage)
|* InsertPage
|*
\************************************************************************/
-void FmFormModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
+void FmFormModel::InsertPage(SdrPage* pPage, sal_uInt32 nPos)
{
#ifndef SVX_LIGHT
// hack solange Methode intern
@@ -195,7 +133,7 @@ void FmFormModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
|* MovePage
|*
\************************************************************************/
-void FmFormModel::MovePage( sal_uInt16 nPgNum, sal_uInt16 nNewPos )
+void FmFormModel::MovePage( sal_uInt32 nPgNum, sal_uInt32 nNewPos )
{
#ifndef SVX_LIGHT
m_pImpl->bMovingPage = sal_True;
@@ -214,7 +152,7 @@ void FmFormModel::MovePage( sal_uInt16 nPgNum, sal_uInt16 nNewPos )
|* RemovePage
|*
\************************************************************************/
-SdrPage* FmFormModel::RemovePage(sal_uInt16 nPgNum)
+SdrPage* FmFormModel::RemovePage(sal_uInt32 nPgNum)
{
FmFormPage* pToBeRemovedPage = dynamic_cast< FmFormPage* >( GetPage( nPgNum ) );
OSL_ENSURE( pToBeRemovedPage, "FmFormModel::RemovePage: *which page*?" );
@@ -238,7 +176,7 @@ SdrPage* FmFormModel::RemovePage(sal_uInt16 nPgNum)
|* InsertMasterPage
|*
\************************************************************************/
-void FmFormModel::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos)
+void FmFormModel::InsertMasterPage(SdrPage* pPage, sal_uInt32 nPos)
{
#ifndef SVX_LIGHT
// hack solange Methode intern
@@ -254,7 +192,7 @@ void FmFormModel::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos)
|* RemoveMasterPage
|*
\************************************************************************/
-SdrPage* FmFormModel::RemoveMasterPage(sal_uInt16 nPgNum)
+SdrPage* FmFormModel::RemoveMasterPage(sal_uInt32 nPgNum)
{
FmFormPage* pPage = (FmFormPage*)SdrModel::RemoveMasterPage(nPgNum);
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index b1860ead380a..c87abc14c0ba 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -32,7 +32,6 @@
#include "svx/fmglob.hxx"
#include "svx/fmpage.hxx"
#include "editeng/editeng.hxx"
-#include "svx/svdovirt.hxx"
#include "svx/fmmodel.hxx"
#include "svx/dialmgr.hxx"
@@ -64,37 +63,30 @@ using namespace ::com::sun::star::script;
using namespace ::com::sun::star::container;
using namespace ::svxform;
-TYPEINIT1(FmFormObj, SdrUnoObj);
-DBG_NAME(FmFormObj);
//------------------------------------------------------------------
-FmFormObj::FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType)
- :SdrUnoObj ( rModelName )
+FmFormObj::FmFormObj(SdrModel& rSdrModel, const ::rtl::OUString& rModelName,sal_Int32 _nType)
+: SdrUnoObj(rSdrModel, rModelName)
,m_nPos ( -1 )
,m_nType ( _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 );
}
//------------------------------------------------------------------
-FmFormObj::FmFormObj( sal_Int32 _nType )
- :SdrUnoObj ( String() )
- ,m_nPos ( -1 )
- ,m_nType ( _nType )
- ,m_pLastKnownRefDevice ( NULL )
-{
- DBG_CTOR(FmFormObj, NULL);
-}
+//FmFormObj::FmFormObj( sal_Int32 _nType )
+// :SdrUnoObj ( String() )
+// ,m_nPos ( -1 )
+// ,m_nType ( _nType )
+// ,m_pLastKnownRefDevice ( NULL )
+//{
+//}
//------------------------------------------------------------------
FmFormObj::~FmFormObj()
{
- DBG_DTOR(FmFormObj, NULL);
-
Reference< XComponent> xHistory(m_xEnvironmentHistory, UNO_QUERY);
if (xHistory.is())
xHistory->dispose();
@@ -103,6 +95,60 @@ FmFormObj::~FmFormObj()
m_aEventsHistory.realloc(0);
}
+void FmFormObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const FmFormObj* pSource = dynamic_cast< const FmFormObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrUnoObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ clonedFrom(pSource);
+
+ // liegt das UnoControlModel in einer Eventumgebung,
+ // dann koennen noch Events zugeordnet sein
+ Reference< XFormComponent > xContent(pSource->xUnoControlModel, UNO_QUERY);
+
+ if (xContent.is())
+ {
+ Reference< XEventAttacherManager > xManager(xContent->getParent(), UNO_QUERY);
+ Reference< XIndexAccess > xManagerAsIndex(xManager, UNO_QUERY);
+
+ if (xManagerAsIndex.is())
+ {
+ sal_Int32 nPos = getElementPos( xManagerAsIndex, xContent );
+ if ( nPos >= 0 )
+ aEvts = xManager->getScriptEvents( nPos );
+ }
+ }
+ else
+ {
+ aEvts = pSource->aEvts;
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* FmFormObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ FmFormObj* pClone = new FmFormObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ String(),
+ getType());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
//------------------------------------------------------------------
void FmFormObj::SetObjEnv(const Reference< XIndexContainer > & xForm, const sal_Int32 nIdx,
const Sequence< ScriptEventDescriptor >& rEvts)
@@ -123,11 +169,11 @@ void FmFormObj::ClearObjEnv()
//------------------------------------------------------------------
void FmFormObj::impl_checkRefDevice_nothrow( bool _force )
{
- const FmFormModel* pFormModel = PTR_CAST( FmFormModel, GetModel() );
+ const FmFormModel* pFormModel = dynamic_cast< FmFormModel* >( &getSdrModelFromSdrObject() );
if ( !pFormModel || !pFormModel->ControlsUseRefDevice() )
return;
- OutputDevice* pCurrentRefDevice = pFormModel ? pFormModel->GetRefDevice() : NULL;
+ OutputDevice* pCurrentRefDevice = pFormModel ? pFormModel->GetReferenceDevice() : 0;
if ( ( m_pLastKnownRefDevice == pCurrentRefDevice ) && !_force )
return;
@@ -182,99 +228,141 @@ void FmFormObj::impl_isolateControlModel_nothrow()
}
//------------------------------------------------------------------
-void FmFormObj::SetPage(SdrPage* _pNewPage)
+void FmFormObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
{
- if ( GetPage() == _pNewPage )
+ if(pOldPage != pNewPage)
{
- SdrUnoObj::SetPage(_pNewPage);
- return;
- }
+ FmFormPage* pOldFormPage = dynamic_cast< FmFormPage* >( pOldPage );
+ if ( pOldFormPage )
+ pOldFormPage->GetImpl().formObjectRemoved( *this );
- FmFormPage* pOldFormPage = PTR_CAST( FmFormPage, GetPage() );
- if ( pOldFormPage )
- pOldFormPage->GetImpl().formObjectRemoved( *this );
-
- FmFormPage* pNewFormPage = PTR_CAST( FmFormPage, _pNewPage );
- if ( !pNewFormPage )
- { // Maybe it makes sense to create an environment history here : if somebody set's our page to NULL, and we have a valid page before,
- // me may want to remember our place within the old page. For this we could create a new m_xEnvironmentHistory to store it.
- // So the next SetPage with a valid new page would restore that environment within the new page.
- // But for the original Bug (#57300#) we don't need that, so I omit it here. Maybe this will be implemented later.
- impl_isolateControlModel_nothrow();
- SdrUnoObj::SetPage(_pNewPage);
- return;
- }
+ FmFormPage* pNewFormPage = dynamic_cast< FmFormPage* >( pNewPage );
+ if ( !pNewFormPage )
+ { // Maybe it makes sense to create an environment history here : if somebody set's our page to NULL, and we have a valid page before,
+ // me may want to remember our place within the old page. For this we could create a new m_xEnvironmentHistory to store it.
+ // So the next SetPage with a valid new page would restore that environment within the new page.
+ // But for the original Bug (#57300#) we don't need that, so I omit it here. Maybe this will be implemented later.
+ impl_isolateControlModel_nothrow();
- Reference< XIndexContainer > xNewPageForms( pNewFormPage->GetForms( true ), UNO_QUERY );
- Reference< XIndexContainer > xNewParent;
- Sequence< ScriptEventDescriptor> aNewEvents;
+ // call parent
+ SdrUnoObj::handlePageChange(pOldPage, pNewPage);
- // calc the new parent for my model (within the new page's forms hierarchy)
- // do we have a history ? (from :Clone)
- if ( m_xEnvironmentHistory.is() )
- {
- // the element in m_xEnvironmentHistory which is equivalent to my new parent (which (perhaps) has to be created within _pNewPage->GetForms)
- // is the right-most element in the tree.
- Reference< XIndexContainer > xRightMostLeaf = m_xEnvironmentHistory;
- try
+ return;
+ }
+
+ Reference< XIndexContainer > xNewPageForms( pNewFormPage->GetForms( true ), UNO_QUERY );
+ Reference< XIndexContainer > xNewParent;
+ Sequence< ScriptEventDescriptor> aNewEvents;
+
+ // calc the new parent for my model (within the new page's forms hierarchy)
+ // do we have a history ? (from :Clone)
+ if ( m_xEnvironmentHistory.is() )
{
- while ( xRightMostLeaf->getCount() )
+ // the element in m_xEnvironmentHistory which is equivalent to my new parent (which (perhaps) has to be created within pNewPage->GetForms)
+ // is the right-most element in the tree.
+ Reference< XIndexContainer > xRightMostLeaf = m_xEnvironmentHistory;
+ try
{
- xRightMostLeaf.set(
- xRightMostLeaf->getByIndex( xRightMostLeaf->getCount() - 1 ),
- UNO_QUERY_THROW
- );
- }
+ while ( xRightMostLeaf->getCount() )
+ {
+ xRightMostLeaf.set(
+ xRightMostLeaf->getByIndex( xRightMostLeaf->getCount() - 1 ),
+ UNO_QUERY_THROW
+ );
+ }
- xNewParent.set( ensureModelEnv( xRightMostLeaf, xNewPageForms ), UNO_QUERY_THROW );
+ xNewParent.set( ensureModelEnv( xRightMostLeaf, xNewPageForms ), UNO_QUERY_THROW );
- // we successfully cloned the environment in m_xEnvironmentHistory, so we can use m_aEventsHistory
- // (which describes the events of our model at the moment m_xEnvironmentHistory was created)
- aNewEvents = m_aEventsHistory;
+ // we successfully cloned the environment in m_xEnvironmentHistory, so we can use m_aEventsHistory
+ // (which describes the events of our model at the moment m_xEnvironmentHistory was created)
+ aNewEvents = m_aEventsHistory;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
- catch( const Exception& )
+
+ if ( !xNewParent.is() )
{
- DBG_UNHANDLED_EXCEPTION();
+ // are we a valid part of our current page forms ?
+ Reference< XIndexContainer > xOldForms;
+ if ( pOldFormPage )
+ xOldForms.set( pOldFormPage->GetForms(), UNO_QUERY_THROW );
+
+ if ( xOldForms.is() )
+ {
+ // search (upward from our model) for xOldForms
+ Reference< XChild > xSearch( GetUnoControlModel(), UNO_QUERY );
+ while (xSearch.is())
+ {
+ if ( xSearch == xOldForms )
+ break;
+ xSearch = Reference< XChild >( xSearch->getParent(), UNO_QUERY );
+ }
+ if ( xSearch.is() ) // implies xSearch == xOldForms, which means we're a valid part of our current page forms hierarchy
+ {
+ Reference< XChild > xMeAsChild( GetUnoControlModel(), UNO_QUERY );
+ xNewParent.set( ensureModelEnv( xMeAsChild->getParent(), xNewPageForms ), UNO_QUERY );
+
+ if ( xNewParent.is() )
+ {
+ try
+ {
+ // transfer the events from our (model's) parent to the new (model's) parent, too
+ Reference< XEventAttacherManager > xEventManager(xMeAsChild->getParent(), UNO_QUERY);
+ Reference< XIndexAccess > xManagerAsIndex(xEventManager, UNO_QUERY);
+ if (xManagerAsIndex.is())
+ {
+ sal_Int32 nPos = getElementPos(xManagerAsIndex, xMeAsChild);
+ if (nPos >= 0)
+ aNewEvents = xEventManager->getScriptEvents(nPos);
+ }
+ else
+ aNewEvents = aEvts;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+ }
}
- }
- if ( !xNewParent.is() )
- {
- // are we a valid part of our current page forms ?
- Reference< XIndexContainer > xOldForms;
- if ( pOldFormPage )
- xOldForms.set( pOldFormPage->GetForms(), UNO_QUERY_THROW );
+ // call parent
+ SdrUnoObj::handlePageChange(pOldPage, pNewPage);
- if ( xOldForms.is() )
+ // place my model within the new parent container
+ if (xNewParent.is())
{
- // search (upward from our model) for xOldForms
- Reference< XChild > xSearch( GetUnoControlModel(), UNO_QUERY );
- while (xSearch.is())
- {
- if ( xSearch == xOldForms )
- break;
- xSearch = Reference< XChild >( xSearch->getParent(), UNO_QUERY );
- }
- if ( xSearch.is() ) // implies xSearch == xOldForms, which means we're a valid part of our current page forms hierarchy
+ Reference< XFormComponent > xMeAsFormComp(GetUnoControlModel(), UNO_QUERY);
+ if (xMeAsFormComp.is())
{
- Reference< XChild > xMeAsChild( GetUnoControlModel(), UNO_QUERY );
- xNewParent.set( ensureModelEnv( xMeAsChild->getParent(), xNewPageForms ), UNO_QUERY );
+ // check if I have another parent (and remove me, if neccessary)
+ Reference< XIndexContainer > xOldParent(xMeAsFormComp->getParent(), UNO_QUERY);
+ if (xOldParent.is())
+ {
+ sal_Int32 nPos = getElementPos(Reference< XIndexAccess > (xOldParent, UNO_QUERY), xMeAsFormComp);
+ if (nPos > -1)
+ xOldParent->removeByIndex(nPos);
+ }
+ // and insert into the new container
+ xNewParent->insertByIndex(xNewParent->getCount(), makeAny(xMeAsFormComp));
- if ( xNewParent.is() )
+ // transfer the events
+ if (aNewEvents.getLength())
{
try
{
- // transfer the events from our (model's) parent to the new (model's) parent, too
- Reference< XEventAttacherManager > xEventManager(xMeAsChild->getParent(), UNO_QUERY);
+ Reference< XEventAttacherManager > xEventManager(xNewParent, UNO_QUERY);
Reference< XIndexAccess > xManagerAsIndex(xEventManager, UNO_QUERY);
if (xManagerAsIndex.is())
{
- sal_Int32 nPos = getElementPos(xManagerAsIndex, xMeAsChild);
- if (nPos >= 0)
- aNewEvents = xEventManager->getScriptEvents(nPos);
+ sal_Int32 nPos = getElementPos(xManagerAsIndex, xMeAsFormComp);
+ DBG_ASSERT(nPos >= 0, "FmFormObj::SetPage : inserted but not present ?");
+ xEventManager->registerScriptEvents(nPos, aNewEvents);
}
- else
- aNewEvents = aEvts;
}
catch( const Exception& )
{
@@ -283,61 +371,18 @@ void FmFormObj::SetPage(SdrPage* _pNewPage)
}
}
}
- }
- // now set the page
- SdrUnoObj::SetPage(_pNewPage);
-
- // place my model within the new parent container
- if (xNewParent.is())
- {
- Reference< XFormComponent > xMeAsFormComp(GetUnoControlModel(), UNO_QUERY);
- if (xMeAsFormComp.is())
- {
- // check if I have another parent (and remove me, if neccessary)
- Reference< XIndexContainer > xOldParent(xMeAsFormComp->getParent(), UNO_QUERY);
- if (xOldParent.is())
- {
- sal_Int32 nPos = getElementPos(Reference< XIndexAccess > (xOldParent, UNO_QUERY), xMeAsFormComp);
- if (nPos > -1)
- xOldParent->removeByIndex(nPos);
- }
- // and insert into the new container
- xNewParent->insertByIndex(xNewParent->getCount(), makeAny(xMeAsFormComp));
+ // delete my history
+ Reference< XComponent> xHistory(m_xEnvironmentHistory, UNO_QUERY);
+ if (xHistory.is())
+ xHistory->dispose();
- // transfer the events
- if (aNewEvents.getLength())
- {
- try
- {
- Reference< XEventAttacherManager > xEventManager(xNewParent, UNO_QUERY);
- Reference< XIndexAccess > xManagerAsIndex(xEventManager, UNO_QUERY);
- if (xManagerAsIndex.is())
- {
- sal_Int32 nPos = getElementPos(xManagerAsIndex, xMeAsFormComp);
- DBG_ASSERT(nPos >= 0, "FmFormObj::SetPage : inserted but not present ?");
- xEventManager->registerScriptEvents(nPos, aNewEvents);
- }
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ m_xEnvironmentHistory = NULL;
+ m_aEventsHistory.realloc(0);
- }
- }
+ if ( pNewFormPage )
+ pNewFormPage->GetImpl().formObjectInserted( *this );
}
-
- // delete my history
- Reference< XComponent> xHistory(m_xEnvironmentHistory, UNO_QUERY);
- if (xHistory.is())
- xHistory->dispose();
-
- m_xEnvironmentHistory = NULL;
- m_aEventsHistory.realloc(0);
-
- if ( pNewFormPage )
- pNewFormPage->GetImpl().formObjectInserted( *this );
}
//------------------------------------------------------------------
@@ -383,50 +428,11 @@ void FmFormObj::clonedFrom(const FmFormObj* _pSource)
}
//------------------------------------------------------------------
-SdrObject* FmFormObj::Clone() const
-{
- SdrObject* pReturn = SdrUnoObj::Clone();
-
- FmFormObj* pFormObject = PTR_CAST(FmFormObj, pReturn);
- DBG_ASSERT(pFormObject != NULL, "FmFormObj::Clone : invalid clone !");
- if (pFormObject)
- pFormObject->clonedFrom(this);
-
- return pReturn;
-}
-
-//------------------------------------------------------------------
-void FmFormObj::NbcReformatText()
+void FmFormObj::ReformatText()
{
impl_checkRefDevice_nothrow( false );
- SdrUnoObj::NbcReformatText();
-}
-//------------------------------------------------------------------
-void FmFormObj::operator= (const SdrObject& rObj)
-{
- SdrUnoObj::operator= (rObj);
-
- FmFormObj* pFormObj = PTR_CAST(FmFormObj, &rObj);
- if (pFormObj)
- {
- // liegt das UnoControlModel in einer Eventumgebung,
- // dann koennen noch Events zugeordnet sein
- Reference< XFormComponent > xContent(pFormObj->xUnoControlModel, UNO_QUERY);
- if (xContent.is())
- {
- Reference< XEventAttacherManager > xManager(xContent->getParent(), UNO_QUERY);
- Reference< XIndexAccess > xManagerAsIndex(xManager, UNO_QUERY);
- if (xManagerAsIndex.is())
- {
- sal_Int32 nPos = getElementPos( xManagerAsIndex, xContent );
- if ( nPos >= 0 )
- aEvts = xManager->getScriptEvents( nPos );
- }
- }
- else
- aEvts = pFormObj->aEvts;
- }
+ SdrUnoObj::ReformatText();
}
//------------------------------------------------------------------
@@ -609,22 +615,21 @@ 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 );
- if ( !pFormObject )
- {
- SdrVirtObj* pVirtualObject = dynamic_cast< SdrVirtObj* >( _pSdrObject );
- if ( pVirtualObject )
- pFormObject = dynamic_cast< FmFormObj* >( &pVirtualObject->ReferencedObj() );
- }
+ // Needed to take out the following lines; discussed with FS. It is no longer
+ // possible to take care of SdrVirtObj's since these are removed from SVX
+ // any are deprecated in SW usage, too. I suggested a kind of virtual
+ // 'getReferencedSdrObject' at SdrObject itself when this is needed, but it is
+ // currently not and FS suggests to not offer it then.
+ // It should not be needed in the future since goal is to move SW to a clean,
+ // SdrVirtObj-free implementation and usage of DrawingLayer in the future
+ //
+ // if ( !pFormObject && _pSdrObject)
+ // {
+ // pFormObject = dynamic_cast< FmFormObj* >( const_cast< SdrObject* >(_pSdrObject->getReferencedSdrObject()) );
+ // }
return pFormObject;
}
@@ -632,12 +637,12 @@ FmFormObj* FmFormObj::GetFormObject( SdrObject* _pSdrObject )
const FmFormObj* FmFormObj::GetFormObject( const SdrObject* _pSdrObject )
{
const FmFormObj* pFormObject = dynamic_cast< const FmFormObj* >( _pSdrObject );
- if ( !pFormObject )
- {
- const SdrVirtObj* pVirtualObject = dynamic_cast< const SdrVirtObj* >( _pSdrObject );
- if ( pVirtualObject )
- pFormObject = dynamic_cast< const FmFormObj* >( &pVirtualObject->GetReferencedObj() );
- }
+ // comment see above
+ //
+ // if ( !pFormObject && _pSdrObject)
+ // {
+ // pFormObject = dynamic_cast< const FmFormObj* >( _pSdrObject->getReferencedSdrObject() );
+ // }
return pFormObject;
}
@@ -646,7 +651,7 @@ void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XContr
{
SdrUnoObj::SetUnoControlModel( _rxModel );
- FmFormPage* pFormPage = PTR_CAST( FmFormPage, GetPage() );
+ FmFormPage* pFormPage = dynamic_cast< FmFormPage* >(getSdrPageFromSdrObject());
if ( pFormPage )
pFormPage->GetImpl().formModelAssigned( *this );
@@ -654,14 +659,16 @@ void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XContr
}
//------------------------------------------------------------------
-FASTBOOL FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
+bool FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
{
bool bResult = SdrUnoObj::EndCreate(rStat, eCmd);
- if ( bResult && SDRCREATE_FORCEEND == eCmd && rStat.GetView() )
+ if ( bResult && SDRCREATE_FORCEEND == eCmd )
{
- if ( pPage )
+ SdrPage* pOwningPage = getSdrPageFromSdrObject();
+
+ if ( pOwningPage )
{
- FmFormPage& rPage = dynamic_cast< FmFormPage& >( *pPage );
+ FmFormPage& rPage = dynamic_cast< FmFormPage& >( *pOwningPage );
try
{
@@ -687,7 +694,7 @@ FASTBOOL FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
}
}
- FmFormView* pView( dynamic_cast< FmFormView* >( rStat.GetView() ) );
+ FmFormView* pView( dynamic_cast< FmFormView* >( &rStat.GetSdrViewFromSdrDragStat() ) );
FmXFormView* pViewImpl = pView ? pView->GetImpl() : NULL;
OSL_ENSURE( pViewImpl, "FmFormObj::EndCreate: no view!?" );
if ( pViewImpl )
@@ -724,11 +731,11 @@ SdrLayerID FmFormObj::GetLayer() const
return SdrUnoObj::GetLayer();
}
-void FmFormObj::NbcSetLayer(SdrLayerID nLayer)
+void FmFormObj::SetLayer(SdrLayerID nLayer)
{
// #i72535#
// See above. To fix, use parent functionality
- return SdrUnoObj::NbcSetLayer(nLayer);
+ return SdrUnoObj::SetLayer(nLayer);
}
// eof
diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx
index ba7428979e01..5675fcf248ca 100644
--- a/svx/source/form/fmobjfac.cxx
+++ b/svx/source/form/fmobjfac.cxx
@@ -146,14 +146,14 @@ namespace
IMPL_LINK(FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
{
- if (pObjFactory->nInventor == FmFormInventor)
+ if(FmFormInventor == pObjFactory->getSdrObjectCreationInfo().getInvent())
{
::rtl::OUString sServiceSpecifier;
typedef ::std::vector< ::std::pair< ::rtl::OUString, Any > > PropertyValueArray;
PropertyValueArray aInitialProperties;
- switch ( pObjFactory->nIdentifier )
+ switch(pObjFactory->getSdrObjectCreationInfo().getIdent())
{
case OBJ_FM_EDIT:
sServiceSpecifier = FM_COMPONENT_EDIT;
@@ -248,10 +248,12 @@ IMPL_LINK(FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
}
// create the actual object
- if ( sServiceSpecifier.getLength() )
- pObjFactory->pNewObj = new FmFormObj( sServiceSpecifier, pObjFactory->nIdentifier );
- else
- pObjFactory->pNewObj = new FmFormObj( pObjFactory->nIdentifier );
+ FmFormObj* pFmFormObj = new FmFormObj(
+ pObjFactory->getTargetModel(),
+ sServiceSpecifier,
+ pObjFactory->getSdrObjectCreationInfo().getIdent());
+
+ pObjFactory->setNewSdrObject(pFmFormObj);
// initialize some properties which we want to differ from the defaults
for ( PropertyValueArray::const_iterator aInitProp = aInitialProperties.begin();
@@ -260,7 +262,7 @@ IMPL_LINK(FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory)
)
{
lcl_initProperty(
- static_cast< FmFormObj* >( pObjFactory->pNewObj ),
+ pFmFormObj,
aInitProp->first,
aInitProp->second
);
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index c81be592443e..78c1ff3c5321 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -26,6 +26,7 @@
#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <svx/fmpage.hxx>
+#include <svx/svdlegacy.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -57,7 +58,7 @@
#include <sfx2/objsh.hxx>
#endif
#endif
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdview.hxx>
#include <tools/urlobj.hxx>
#include <vcl/help.hxx>
@@ -82,10 +83,8 @@ using com::sun::star::uno::UNO_QUERY;
using com::sun::star::container::XChild;
using com::sun::star::container::XNameContainer;
-TYPEINIT1(FmFormPage, SdrPage);
-
//------------------------------------------------------------------
-FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, FASTBOOL bMasterPage)
+FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, bool bMasterPage)
:SdrPage(rModel, bMasterPage)
#ifndef SVX_LIGHT
,m_pImpl( new FmFormPageImpl( *this ) )
@@ -98,23 +97,6 @@ FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, FASTBOOL bMaster
}
//------------------------------------------------------------------
-FmFormPage::FmFormPage(const FmFormPage& rPage)
- :SdrPage(rPage)
-#ifndef SVX_LIGHT
- ,m_pImpl(new FmFormPageImpl( *this ) )
-#else
- ,m_pImpl(NULL)
-#endif
- ,m_pBasic(0)
-{
-#ifndef SVX_LIGHT
- m_pImpl->initFrom( rPage.GetImpl() );
-#endif
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::FmFormPage" );
- m_sPageName = rPage.m_sPageName;
-}
-
-//------------------------------------------------------------------
FmFormPage::~FmFormPage()
{
#ifndef SVX_LIGHT
@@ -122,62 +104,49 @@ FmFormPage::~FmFormPage()
#endif
}
-//------------------------------------------------------------------
-void FmFormPage::SetModel(SdrModel* pNewModel)
+void FmFormPage::copyDataFromSdrPage(const SdrPage& rSource)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::SetModel" );
- /* #35055# */
- // we want to call the super's "SetModel" method even if the model is the
- // same, in case code somewhere in the system depends on it. But our code
- // doesn't, so get the old model to do a check.
- SdrModel *pOldModel = GetModel();
-
- SdrPage::SetModel( pNewModel );
-
- /* #35055# */
- if ( ( pOldModel != pNewModel ) && m_pImpl )
+ if(this != &rSource)
{
- try
+ const FmFormPage* pSource = dynamic_cast< const FmFormPage* >(&rSource);
+
+ if(pSource)
{
- Reference< XNameContainer > xForms( m_pImpl->getForms( false ) );
- if ( xForms.is() )
- {
- // we want to keep the current collection, just reset the model
- // with which it's associated.
- Reference< XChild > xAsChild( xForms, UNO_QUERY );
- if ( xAsChild.is() )
- {
- FmFormModel* pDrawModel = (FmFormModel*) GetModel();
- SfxObjectShell* pObjShell = pDrawModel->GetObjectShell();
- if ( pObjShell )
- xAsChild->setParent( pObjShell->GetModel() );
- }
- }
+ // call parent
+ SdrPage::copyDataFromSdrPage(rSource);
+
+ // no local data to copy
}
- catch( ::com::sun::star::uno::Exception ex )
+ else
{
- OSL_ENSURE( sal_False, "UNO Exception caught resetting model for m_pImpl (FmFormPageImpl) in FmFormPage::SetModel" );
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
}
}
}
-//------------------------------------------------------------------
-SdrPage* FmFormPage::Clone() const
+SdrPage* FmFormPage::CloneSdrPage(SdrModel* pTargetModel) const
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::Clone" );
- return new FmFormPage(*this);
- // hier fehlt noch ein kopieren der Objekte
+ FmFormModel* pFmFormModel = static_cast< FmFormModel* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
+ OSL_ENSURE(dynamic_cast< FmFormModel* >(pFmFormModel), "FmFormPage::CloneSdrPage with wrong SdrModel type (!)");
+ FmFormPage* pClone = new FmFormPage(
+ *pFmFormModel,
+ GetBasic(),
+ IsMasterPage());
+ OSL_ENSURE(pClone, "CloneSdrPage error (!)");
+ pClone->copyDataFromSdrPage(*this);
+
+ return pClone;
}
//------------------------------------------------------------------
-void FmFormPage::InsertObject(SdrObject* pObj, sal_uLong nPos,
- const SdrInsertReason* pReason)
+void FmFormPage::InsertObjectToSdrObjList(SdrObject& rObj, sal_uInt32 nPos)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::InsertObject" );
- SdrPage::InsertObject( pObj, nPos, pReason );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::InsertObjectToSdrObjList" );
+ SdrPage::InsertObjectToSdrObjList( rObj, nPos );
#ifndef SVX_LIGHT
- if (GetModel() && (!pReason || pReason->GetReason() != SDRREASON_STREAMING))
- ((FmFormModel*)GetModel())->GetUndoEnv().Inserted(pObj);
+ FmFormModel* pFmFormModel = dynamic_cast< FmFormModel* >(&getSdrModelFromSdrPage());
+ if(pFmFormModel)
+ pFmFormModel->GetUndoEnv().Inserted(&rObj);
#endif
}
@@ -208,13 +177,11 @@ sal_Bool FmFormPage::RequestHelp( Window* pWindow, SdrView* pView,
if( pView->IsAction() )
return sal_False;
- Point aPos = rEvt.GetMousePosPixel();
- aPos = pWindow->ScreenToOutputPixel( aPos );
- aPos = pWindow->PixelToLogic( aPos );
+ const Point aOutputPixel(pWindow->ScreenToOutputPixel(rEvt.GetMousePosPixel()));
+ const basegfx::B2DPoint aPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(aOutputPixel.X(), aOutputPixel.Y()));
SdrObject* pObj = NULL;
- SdrPageView* pPV = NULL;
- if ( !pView->PickObj( aPos, 0, pObj, pPV, SDRSEARCH_DEEP ) )
+ if ( !pView->PickObj( aPos, 0.0, pObj, SDRSEARCH_DEEP ) )
return sal_False;
FmFormObj* pFormObject = FmFormObj::GetFormObject( pObj );
@@ -251,31 +218,38 @@ sal_Bool FmFormPage::RequestHelp( Window* pWindow, SdrView* pView,
if ( aHelpText.Len() != 0 )
{
// Hilfe anzeigen
- Rectangle aItemRect = pObj->GetCurrentBoundRect();
- aItemRect = pWindow->LogicToPixel( aItemRect );
- Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
- aItemRect.Left() = aPt.X();
- aItemRect.Top() = aPt.Y();
- aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
- aItemRect.Right() = aPt.X();
- aItemRect.Bottom() = aPt.Y();
- if( rEvt.GetMode() == HELPMODE_BALLOON )
- Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText);
+ const basegfx::B2DRange aDiscreteRange(pWindow->GetInverseViewTransformation() * pObj->getObjectRange(pView));
+ const Point aTopLeft(basegfx::fround(aDiscreteRange.getMinX()), aDiscreteRange.getMinY());
+ const Point aBottomRight(basegfx::fround(aDiscreteRange.getMaxX()), aDiscreteRange.getMaxY());
+ const Rectangle aItemRectangle(
+ pWindow->OutputToScreenPixel(aTopLeft),
+ pWindow->OutputToScreenPixel(aBottomRight));
+
+ if(HELPMODE_BALLOON == rEvt.GetMode())
+ {
+ Help::ShowBalloon(pWindow, aItemRectangle.Center(), aItemRectangle, aHelpText);
+ }
else
- Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
+ {
+ Help::ShowQuickHelp(pWindow, aItemRectangle, aHelpText);
+ }
}
#endif
return sal_True;
}
//------------------------------------------------------------------
-SdrObject* FmFormPage::RemoveObject(sal_uLong nObjNum)
+SdrObject* FmFormPage::RemoveObjectFromSdrObjList(sal_uInt32 nObjNum)
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::RemoveObject" );
- SdrObject* pObj = SdrPage::RemoveObject(nObjNum);
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::RemoveObjectFromSdrObjList" );
+ SdrObject* pObj = SdrPage::RemoveObjectFromSdrObjList(nObjNum);
#ifndef SVX_LIGHT
- if (pObj && GetModel())
- ((FmFormModel*)GetModel())->GetUndoEnv().Removed(pObj);
+ if(pObj)
+ {
+ FmFormModel* pFmFormModel = dynamic_cast< FmFormModel* >(&getSdrModelFromSdrPage());
+ if(pFmFormModel)
+ pFmFormModel->GetUndoEnv().Removed(pObj);
+ }
#endif
return pObj;
}
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index b4dc30a2135f..831f8668e1fb 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -32,8 +32,8 @@
#include "fmservs.hxx"
#include "fmobj.hxx"
#include "formcontrolfactory.hxx"
-#include "svx/svditer.hxx"
-#include "svx/fmresids.hrc"
+#include <svx/svditer.hxx>
+#include <svx/fmresids.hrc>
#include "svx/dbtoolsclient.hxx"
#include "treevisitor.hxx"
@@ -72,7 +72,6 @@ using ::com::sun::star::container::EnumerableMap;
using ::com::sun::star::drawing::XControlShape;
using namespace ::svxform;
-DBG_NAME(FmFormPageImpl)
//------------------------------------------------------------------------------
FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage )
:m_rPage( _rPage )
@@ -81,7 +80,6 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage )
,m_bInFind( false )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPageImpl::FmFormPageImpl" );
- DBG_CTOR(FmFormPageImpl,NULL);
}
//------------------------------------------------------------------------------
@@ -336,7 +334,7 @@ const Reference< XNameContainer >& FmFormPageImpl::getForms( bool _bForceCreate
m_aFormsCreationHdl.Call( this );
}
- FmFormModel* pFormsModel = PTR_CAST( FmFormModel, m_rPage.GetModel() );
+ FmFormModel* pFormsModel = dynamic_cast< FmFormModel* >( &m_rPage.getSdrModelFromSdrPage() );
// give the newly created collection a place in the universe
Reference< XChild > xAsChild( m_xForms, UNO_QUERY );
@@ -360,7 +358,6 @@ FmFormPageImpl::~FmFormPageImpl()
xCurrentForm = NULL;
::comphelper::disposeComponent( m_xForms );
- DBG_DTOR(FmFormPageImpl,NULL);
}
//------------------------------------------------------------------------------
@@ -426,14 +423,14 @@ Reference< XForm > FmFormPageImpl::getDefaultForm()
// did not find an existing suitable form -> create a new one
if ( !xForm.is() )
{
- SdrModel* pModel = m_rPage.GetModel();
+ SdrModel& rModel = m_rPage.getSdrModelFromSdrPage();
- if( pModel->IsUndoEnabled() )
+ if( rModel.IsUndoEnabled() )
{
XubString aStr(SVX_RES(RID_STR_FORM));
XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT));
aUndoStr.SearchAndReplace('#', aStr);
- pModel->BegUndo(aUndoStr);
+ rModel.BegUndo(aUndoStr);
}
try
@@ -449,9 +446,9 @@ Reference< XForm > FmFormPageImpl::getDefaultForm()
xFormProps->setPropertyValue( FM_PROP_NAME, makeAny( sName ) );
Reference< XIndexContainer > xContainer( xForms, UNO_QUERY );
- if( pModel->IsUndoEnabled() )
+ if( rModel.IsUndoEnabled() )
{
- pModel->AddUndo(new FmUndoContainerAction(*(FmFormModel*)pModel,
+ rModel.AddUndo(new FmUndoContainerAction(static_cast< FmFormModel& >(rModel),
FmUndoContainerAction::Inserted,
xContainer,
xForm,
@@ -466,8 +463,8 @@ Reference< XForm > FmFormPageImpl::getDefaultForm()
xForm.clear();
}
- if( pModel->IsUndoEnabled() )
- pModel->EndUndo();
+ if( rModel.IsUndoEnabled() )
+ rModel.EndUndo();
}
return xForm;
@@ -508,16 +505,16 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo
// wenn keine ::com::sun::star::form gefunden, dann eine neue erzeugen
if (!xForm.is())
{
- SdrModel* pModel = m_rPage.GetModel();
+ SdrModel& rModel = m_rPage.getSdrModelFromSdrPage();
- const bool bUndo = pModel->IsUndoEnabled();
+ const bool bUndo = rModel.IsUndoEnabled();
if( bUndo )
{
XubString aStr(SVX_RES(RID_STR_FORM));
XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT));
aUndoStr.SearchAndReplace('#', aStr);
- pModel->BegUndo(aUndoStr);
+ rModel.BegUndo(aUndoStr);
}
xForm = Reference< ::com::sun::star::form::XForm >(::comphelper::getProcessServiceFactory()->createInstance(FM_SUN_COMPONENT_FORM), UNO_QUERY);
@@ -549,7 +546,7 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo
if( bUndo )
{
Reference< ::com::sun::star::container::XIndexContainer > xContainer( getForms(), UNO_QUERY );
- pModel->AddUndo(new FmUndoContainerAction(*(FmFormModel*)pModel,
+ rModel.AddUndo(new FmUndoContainerAction(static_cast< FmFormModel& >(rModel),
FmUndoContainerAction::Inserted,
xContainer,
xForm,
@@ -559,7 +556,7 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo
getForms()->insertByName( sName, makeAny( xForm ) );
if( bUndo )
- pModel->EndUndo();
+ rModel.EndUndo();
}
xCurrentForm = xForm;
}
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index c884d8b8ba60..5451101ebdd2 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -60,7 +60,7 @@
#include <sfx2/objsh.hxx>
#include <svx/svdobj.hxx>
#include <svx/fmpage.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include "fmobj.hxx"
#ifndef _SVX_SVXIDS_HRC
@@ -100,17 +100,17 @@
#define HANDLE_SQL_ERRORS( action, successflag, context, message ) \
try \
{ \
- successflag = sal_False; \
+ successflag = sal_False; \
action; \
- successflag = sal_True; \
+ successflag = sal_True; \
} \
- catch(::com::sun::star::sdbc::SQLException& e) \
+ catch(::com::sun::star::sdbc::SQLException& e) \
{ \
- ::com::sun::star::sdb::SQLContext eExtendedInfo = \
+ ::com::sun::star::sdb::SQLContext eExtendedInfo = \
GetImpl()->prependContextInfo(e, Reference< XInterface > (), context, ::rtl::OUString()); \
displayException(eExtendedInfo); \
} \
- catch(Exception&) \
+ catch(Exception&) \
{ \
DBG_ERROR(message); \
} \
@@ -185,8 +185,6 @@ using namespace ::svxform;
//========================================================================
// class FmDesignModeChangedHint
//========================================================================
-TYPEINIT1( FmDesignModeChangedHint, SfxHint );
-
//------------------------------------------------------------------------
FmDesignModeChangedHint::FmDesignModeChangedHint( sal_Bool bDesMode )
:m_bDesignMode( bDesMode )
@@ -245,8 +243,6 @@ SFX_IMPL_INTERFACE(FmFormShell, SfxShell, SVX_RES(RID_STR_FORMSHELL))
}
//========================================================================
-TYPEINIT1(FmFormShell,SfxShell)
-
//------------------------------------------------------------------------
FmFormShell::FmFormShell( SfxViewShell* _pParent, FmFormView* pView )
:SfxShell(_pParent)
@@ -294,13 +290,13 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool /*bForBrowsing*/)
sal_Bool bResult = sal_True;
// Save the data records, not in DesignMode and FilterMode
if (!m_bDesignMode && !GetImpl()->isInFilterMode() &&
- m_pFormView && m_pFormView->GetActualOutDev() &&
- m_pFormView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW)
+ m_pFormView && m_pFormView->GetCurrentViewDevice() &&
+ m_pFormView->GetCurrentViewDevice()->GetOutDevType() == OUTDEV_WINDOW)
{
SdrPageView* pCurPageView = m_pFormView->GetSdrPageView();
- // sal_uInt16 nPos = pCurPageView ? pCurPageView->GetWinList().Find((OutputDevice*)m_pFormView->GetActualOutDev()) : SDRPAGEVIEWWIN_NOTFOUND;
- SdrPageWindow* pWindow = pCurPageView ? pCurPageView->FindPageWindow(*((OutputDevice*)m_pFormView->GetActualOutDev())) : 0L;
+ // sal_uInt16 nPos = pCurPageView ? pCurPageView->GetWinList().Find((OutputDevice*)m_pFormView->GetCurrentViewDevice()) : SDRPAGEVIEWWIN_NOTFOUND;
+ SdrPageWindow* pWindow = pCurPageView ? pCurPageView->FindPageWindow(*((OutputDevice*)m_pFormView->GetCurrentViewDevice())) : 0L;
if(pWindow)
{
@@ -330,8 +326,8 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool /*bForBrowsing*/)
return RET_NEWTASK;
}
- if ( bModified )
- bResult = rController->commitCurrentRecord( );
+ if ( bModified )
+ bResult = rController->commitCurrentRecord( );
}
}
}
@@ -539,7 +535,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_SCROLLBAR:
case SID_FM_SPINBUTTON:
{
- SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_TOGGLECONTROLFOCUS, sal_False );
+ SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_TOGGLECONTROLFOCUS );
if ( pGrabFocusItem && pGrabFocusItem->GetValue() )
{ // see below
SfxViewShell* pShell = GetViewShell();
@@ -640,7 +636,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
GetImpl()->executeControlConversionSlot( nSlot );
// nach dem Konvertieren die Selektion neu bestimmern, da sich ja das selektierte Objekt
// geaendert hat
- GetImpl()->SetSelection(GetFormView()->GetMarkedObjectList());
+ GetImpl()->SetSelection(GetFormView()->getSelectedSdrObjectVectorFromSdrMarkView());
break;
case SID_FM_LEAVE_CREATE:
m_nLastSlot = 0;
@@ -649,7 +645,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
break;
case SID_FM_SHOW_PROPERTY_BROWSER:
{
- SFX_REQUEST_ARG( rReq, pShowItem, SfxBoolItem, SID_FM_SHOW_PROPERTIES, sal_False );
+ SFX_REQUEST_ARG( rReq, pShowItem, SfxBoolItem, SID_FM_SHOW_PROPERTIES );
sal_Bool bShow = sal_True;
if ( pShowItem )
bShow = pShowItem->GetValue();
@@ -661,7 +657,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_PROPERTIES:
{
// PropertyBrowser anzeigen
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot, sal_False);
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot );
sal_Bool bShow = pShowItem ? pShowItem->GetValue() : sal_True;
InterfaceBag aOnlyTheForm;
@@ -675,7 +671,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_CTL_PROPERTIES:
{
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot, sal_False);
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot );
sal_Bool bShow = pShowItem ? pShowItem->GetValue() : sal_True;
OSL_ENSURE( GetImpl()->onlyControlsAreMarked(), "FmFormShell::Execute: ControlProperties should be disabled!" );
@@ -712,7 +708,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_DESIGN_MODE:
{
- SFX_REQUEST_ARG(rReq, pDesignItem, SfxBoolItem, nSlot, sal_False);
+ SFX_REQUEST_ARG(rReq, pDesignItem, SfxBoolItem, nSlot );
sal_Bool bDesignMode = pDesignItem ? pDesignItem->GetValue() : !m_bDesignMode;
SetDesignMode( bDesignMode );
if ( m_bDesignMode == bDesignMode )
@@ -789,7 +785,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
const SfxPoolItem* pItem;
if ( ( pArgs->GetItemState( FN_PARAM_1, sal_True, &pItem ) ) == SFX_ITEM_SET )
{
- const SfxInt32Item* pTypedItem = PTR_CAST( SfxInt32Item, pItem );
+ const SfxInt32Item* pTypedItem = dynamic_cast< const SfxInt32Item* >( pItem );
if ( pTypedItem )
nRecord = Max( pTypedItem->GetValue(), sal_Int32(0) );
}
@@ -1232,7 +1228,7 @@ FmFormPage* FmFormShell::GetCurPage() const
{
FmFormPage* pP = NULL;
if (m_pFormView && m_pFormView->GetSdrPageView())
- pP = PTR_CAST(FmFormPage,m_pFormView->GetSdrPageView()->GetPage());
+ pP = dynamic_cast< FmFormPage* >(&m_pFormView->GetSdrPageView()->getSdrPageFromSdrPageView());
return pP;
}
@@ -1254,7 +1250,7 @@ void FmFormShell::SetView( FmFormView* _pView )
m_pFormView = _pView;
m_pFormView->SetFormShell( this, FmFormView::FormShellAccess() );
- m_pFormModel = (FmFormModel*)m_pFormView->GetModel();
+ m_pFormModel = (FmFormModel*)&m_pFormView->getSdrModelFromSdrView();
impl_setDesignMode( m_pFormView->IsDesignMode() );
@@ -1348,7 +1344,7 @@ namespace
while ( aIter.IsMore() )
{
SdrObject* pObject = aIter.Next();
- SdrUnoObj* pUnoObject = pObject ? PTR_CAST( SdrUnoObj, pObject ) : NULL;
+ SdrUnoObj* pUnoObject = pObject ? dynamic_cast< SdrUnoObj* >( pObject ) : NULL;
if ( !pUnoObject )
continue;
@@ -1443,7 +1439,7 @@ SdrUnoObj* FmFormShell::GetFormControl( const Reference< XControlModel >& _rxMod
// we can only retrieve controls for SdrObjects which belong to page which is actually displayed in the given view
SdrPageView* pPageView = _rView.GetSdrPageView();
- SdrPage* pPage = pPageView ? pPageView->GetPage() : NULL;
+ SdrPage* pPage = pPageView ? &pPageView->getSdrPageFromSdrPageView() : NULL;
OSL_ENSURE( pPage, "FmFormShell::GetFormControl: no page displayed in the given view!" );
if ( !pPage )
return NULL;
@@ -1510,3 +1506,15 @@ void FmFormShell::SetDesignMode( sal_Bool _bDesignMode )
if ( pModel )
pModel->GetUndoEnv().UnLock();
}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace svx
+{
+ ISdrObjectFilter::~ISdrObjectFilter()
+ {
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 11c7ebb1b3d6..f72806ba27e5 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -38,7 +38,7 @@
#include "fmvwimp.hxx"
#include "formtoolbars.hxx"
#include "gridcols.hxx"
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include "svx/dialmgr.hxx"
#include "svx/dialogs.hrc"
#include "svx/fmglob.hxx"
@@ -285,19 +285,18 @@ using namespace ::svx;
namespace
{
//..........................................................................
- void collectInterfacesFromMarkList( const SdrMarkList& _rMarkList, InterfaceBag& /* [out] */ _rInterfaces )
+ void collectInterfacesFromSdrObjectVector( const SdrObjectVector& _rSelection, InterfaceBag& /* [out] */ _rInterfaces )
{
_rInterfaces.clear();
- sal_uInt32 nMarkCount = _rMarkList.GetMarkCount();
- for ( sal_uInt32 i = 0; i < nMarkCount; ++i)
+ for ( sal_uInt32 i = 0; i < _rSelection.size(); ++i)
{
- SdrObject* pCurrent = _rMarkList.GetMark( i )->GetMarkedSdrObj();
+ SdrObject* pCurrent = _rSelection[i];
SdrObjListIter* pGroupIterator = NULL;
- if ( pCurrent->IsGroupObject() )
+ if ( pCurrent->getChildrenOfSdrObject() )
{
- pGroupIterator = new SdrObjListIter( *pCurrent->GetSubList() );
+ pGroupIterator = new SdrObjListIter( *pCurrent->getChildrenOfSdrObject() );
pCurrent = pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL;
}
@@ -566,43 +565,30 @@ sal_Bool FmXBoundFormFieldIterator::ShouldHandleElement(const Reference< XInterf
}
//------------------------------------------------------------------------------
-sal_Bool isControlList(const SdrMarkList& rMarkList)
+sal_Bool isControlList(const SdrObjectVector& _rSelection)
{
// enthaelt die liste nur Controls und mindestens ein control
- sal_uInt32 nMarkCount = rMarkList.GetMarkCount();
- sal_Bool bControlList = nMarkCount != 0;
-
+ sal_Bool bControlList(0 != _rSelection.size());
sal_Bool bHadAnyLeafs = sal_False;
- for (sal_uInt32 i = 0; i < nMarkCount && bControlList; i++)
+ for (sal_uInt32 i = 0; i < _rSelection.size() && bControlList; i++)
{
- SdrObject *pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- E3dObject* pAs3DObject = PTR_CAST(E3dObject, pObj);
- // E3dObject's do not contain any 2D-objects (by definition)
- // we need this extra check here : an E3dObject->IsGroupObject says "YES", but an SdrObjListIter working
- // with an E3dObject doesn't give me any Nodes (E3dObject has a sub list, but no members in that list,
- // cause there implementation differs from the one of "normal" SdrObject's. Unfortunally SdrObject::IsGroupObject
- // doesn't check the element count of the sub list, which is simply a bug in IsGroupObject we can't fix at the moment).
- // So at the end of this function bControlList would have the same value it was initialized with above : sal_True
- // And this would be wrong :)
- // 03.02.00 - 72529 - FS
- if (!pAs3DObject)
+ SdrObject *pObj = _rSelection[i];
+
+ if (pObj->getChildrenOfSdrObject())
{
- if (pObj->IsGroupObject())
- {
- SdrObjListIter aIter(*pObj->GetSubList());
- while (aIter.IsMore() && bControlList)
- {
- bControlList = FmFormInventor == aIter.Next()->GetObjInventor();
- bHadAnyLeafs = sal_True;
- }
- }
- else
+ SdrObjListIter aIter(*pObj->getChildrenOfSdrObject());
+ while (aIter.IsMore() && bControlList)
{
+ bControlList = FmFormInventor == aIter.Next()->GetObjInventor();
bHadAnyLeafs = sal_True;
- bControlList = FmFormInventor == pObj->GetObjInventor();
}
}
+ else
+ {
+ bHadAnyLeafs = sal_True;
+ bControlList = FmFormInventor == pObj->GetObjInventor();
+ }
}
return bControlList && bHadAnyLeafs;
@@ -644,7 +630,6 @@ void SAL_CALL FmXFormShell_Base_Disambiguation::disposing()
//========================================================================
// class FmXFormShell
//========================================================================
-DBG_NAME(FmXFormShell);
//------------------------------------------------------------------------
FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
:FmXFormShell_BASE(m_aMutex)
@@ -669,7 +654,6 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
,m_bPreparedClose( sal_False )
,m_bFirstActivation( sal_True )
{
- DBG_CTOR(FmXFormShell,NULL);
m_aMarkTimer.SetTimeout(100);
m_aMarkTimer.SetTimeoutHdl(LINK(this,FmXFormShell,OnTimeOut));
@@ -694,7 +678,6 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
FmXFormShell::~FmXFormShell()
{
delete m_pTextShell;
- DBG_DTOR(FmXFormShell,NULL);
}
//------------------------------------------------------------------
@@ -1096,7 +1079,7 @@ void FmXFormShell::ForceUpdateSelection(sal_Bool bAllowInvalidation)
if (!bAllowInvalidation)
LockSlotInvalidation(sal_True);
- SetSelection(m_pShell->GetFormView()->GetMarkedObjectList());
+ SetSelection(m_pShell->GetFormView()->getSelectedSdrObjectVectorFromSdrMarkView());
if (!bAllowInvalidation)
LockSlotInvalidation(sal_False);
@@ -1669,7 +1652,7 @@ void FmXFormShell::ExecuteSearch()
// GridControls wieder restaurieren
LoopGrids(GA_ENABLE_SYNC | GA_DISABLE_ROCTRLR);
- m_pShell->GetFormView()->UnMarkAll(m_pShell->GetFormView()->GetSdrPageView());
+ m_pShell->GetFormView()->UnmarkAllObj();
// da ich in OnFoundData (fals ich dort war) Controls markiert habe
}
@@ -2028,12 +2011,14 @@ void FmXFormShell::getCurrentSelection( InterfaceBag& /* [out] */ _rSelection )
}
//------------------------------------------------------------------------------
-bool FmXFormShell::setCurrentSelectionFromMark( const SdrMarkList& _rMarkList )
+bool FmXFormShell::setCurrentSelectionFromSdrObjectVector( const SdrObjectVector& _rSelection )
{
m_aLastKnownMarkedControls.clear();
- if ( ( _rMarkList.GetMarkCount() > 0 ) && isControlList( _rMarkList ) )
- collectInterfacesFromMarkList( _rMarkList, m_aLastKnownMarkedControls );
+ if ( ( _rSelection.size() > 0 ) && isControlList( _rSelection ) )
+ {
+ collectInterfacesFromSdrObjectVector( _rSelection, m_aLastKnownMarkedControls );
+ }
return setCurrentSelection( m_aLastKnownMarkedControls );
}
@@ -2316,8 +2301,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
SdrObject* pObject = m_arrSearchedControls.GetObject(pfriWhere->nFieldPos);
DBG_ASSERT(pObject != NULL, "FmXFormShell::OnFoundData : unerwartet : ungueltiges VclControl-Interface");
- m_pShell->GetFormView()->UnMarkAll(m_pShell->GetFormView()->GetSdrPageView());
- m_pShell->GetFormView()->MarkObj(pObject, m_pShell->GetFormView()->GetSdrPageView());
+ m_pShell->GetFormView()->UnmarkAllObj();
+ m_pShell->GetFormView()->MarkObj(*pObject);
FmFormObj* pFormObject = FmFormObj::GetFormObject( pObject );
Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() );
@@ -2393,7 +2378,7 @@ IMPL_LINK(FmXFormShell, OnCanceledNotFound, FmFoundRecordInformation*, pfriWhere
}
- m_pShell->GetFormView()->UnMarkAll(m_pShell->GetFormView()->GetSdrPageView());
+ m_pShell->GetFormView()->UnmarkAllObj();
return 0L;
}
@@ -2762,7 +2747,7 @@ IMPL_LINK(FmXFormShell, OnTimeOut, void*, /*EMPTYTAG*/)
return 0;
if (m_pShell->IsDesignMode() && m_pShell->GetFormView())
- SetSelection(m_pShell->GetFormView()->GetMarkedObjectList());
+ SetSelection(m_pShell->GetFormView()->getSelectedSdrObjectVectorFromSdrMarkView());
return 0;
}
@@ -2778,19 +2763,19 @@ void FmXFormShell::SetSelectionDelayed()
}
//------------------------------------------------------------------------
-void FmXFormShell::SetSelection(const SdrMarkList& rMarkList)
+void FmXFormShell::SetSelection(const SdrObjectVector& _rSelection)
{
if ( impl_checkDisposed() )
return;
- DetermineSelection(rMarkList);
+ DetermineSelection(_rSelection);
m_pShell->NotifyMarkListChanged(m_pShell->GetFormView());
}
//------------------------------------------------------------------------
-void FmXFormShell::DetermineSelection(const SdrMarkList& rMarkList)
+void FmXFormShell::DetermineSelection(const SdrObjectVector& _rSelection)
{
- if ( setCurrentSelectionFromMark( rMarkList ) && IsPropBrwOpen() )
+ if ( setCurrentSelectionFromSdrObjectVector( _rSelection ) && IsPropBrwOpen() )
ShowSelectionProperties( sal_True );
}
@@ -2883,7 +2868,7 @@ void FmXFormShell::SetDesignMode(sal_Bool bDesign)
if (bDesign)
{
- SdrMarkList aList;
+ SdrObjectVector aList;
{
// during changing the mark list, don't track the selected objects in the property browser
SuspendPropertyTracking aSuspend( *this );
@@ -2892,7 +2877,7 @@ void FmXFormShell::SetDesignMode(sal_Bool bDesign)
}
// synchronize with the restored mark list
- if ( aList.GetMarkCount() )
+ if ( aList.size() )
SetSelection( aList );
}
else
@@ -3811,7 +3796,7 @@ void FmXFormShell::viewActivated( FmFormView& _rCurrentView, sal_Bool _bSyncActi
// first-time initializations for the views
if ( !_rCurrentView.GetImpl()->hasEverBeenActivated( ) )
{
- _rCurrentView.GetImpl()->onFirstViewActivation( PTR_CAST( FmFormModel, _rCurrentView.GetModel() ) );
+ _rCurrentView.GetImpl()->onFirstViewActivation( dynamic_cast< FmFormModel* >( &_rCurrentView.getSdrModelFromSdrView() ) );
_rCurrentView.GetImpl()->setHasBeenActivated( );
}
@@ -3996,7 +3981,7 @@ void FmXFormShell::loadForms( FmFormPage* _pPage, const sal_uInt16 _nBehaviour /
{
// lock the undo env so the forms can change non-transient properties while loading
// (without this my doc's modified flag would be set)
- FmFormModel* pModel = PTR_CAST( FmFormModel, _pPage->GetModel() );
+ FmFormModel* pModel = dynamic_cast< FmFormModel* >( &_pPage->getSdrModelFromSdrPage() );
DBG_ASSERT( pModel, "FmXFormShell::loadForms: invalid model!" );
if ( pModel )
pModel->GetUndoEnv().Lock();
@@ -4092,9 +4077,9 @@ void FmXFormShell::handleShowPropertiesRequest()
void FmXFormShell::handleMouseButtonDown( const SdrViewEvent& _rViewEvent )
{
// catch simple double clicks
- if ( ( _rViewEvent.nMouseClicks == 2 ) && ( _rViewEvent.nMouseCode == MOUSE_LEFT ) )
+ if ( ( 2 == _rViewEvent.mnMouseClicks ) && ( MOUSE_LEFT == _rViewEvent.mnMouseCode ) )
{
- if ( _rViewEvent.eHit == SDRHIT_MARKEDOBJECT )
+ if ( SDRHIT_MARKEDOBJECT == _rViewEvent.meHit )
{
if ( onlyControlsAreMarked() )
ShowSelectionProperties( sal_True );
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 4a67588d6d3c..30c32051ff92 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -100,12 +100,9 @@ void FmSearchThread::onTerminated()
// SMART_UNO_IMPLEMENTATION(FmRecordCountListener, UsrObject);
-DBG_NAME(FmRecordCountListener);
//------------------------------------------------------------------------
FmRecordCountListener::FmRecordCountListener(const Reference< ::com::sun::star::sdbc::XResultSet > & dbcCursor)
{
- DBG_CTOR(FmRecordCountListener,NULL);
-
m_xListening = Reference< ::com::sun::star::beans::XPropertySet > (dbcCursor, UNO_QUERY);
if (!m_xListening.is())
return;
@@ -135,8 +132,6 @@ Link FmRecordCountListener::SetPropChangeHandler(const Link& lnk)
//------------------------------------------------------------------------
FmRecordCountListener::~FmRecordCountListener()
{
-
- DBG_DTOR(FmRecordCountListener,NULL);
}
//------------------------------------------------------------------------
@@ -677,7 +672,6 @@ FmSearchEngine::SEARCH_RESULT FmSearchEngine::SearchRegularApprox(const ::rtl::O
}
-DBG_NAME(FmSearchEngine);
//------------------------------------------------------------------------
FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
const Reference< XResultSet > & xCursor, const ::rtl::OUString& sVisibleFields,
@@ -706,8 +700,6 @@ FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
,m_nPosition(MATCHING_ANYWHERE)
,m_nTransliterationFlags(0)
{
- DBG_CTOR(FmSearchEngine,NULL);
-
m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter > (::comphelper::getProcessServiceFactory()
->createInstance(FM_NUMBER_FORMATTER), UNO_QUERY);
if (m_xFormatter.is())
@@ -745,8 +737,6 @@ FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
,m_nPosition(MATCHING_ANYWHERE)
,m_nTransliterationFlags(0)
{
- DBG_CTOR(FmSearchEngine,NULL);
-
fillControlTexts(arrFields);
Init(sVisibleFields);
}
@@ -755,8 +745,6 @@ FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
FmSearchEngine::~FmSearchEngine()
{
clearControlTexts();
-
- DBG_DTOR(FmSearchEngine,NULL);
}
//------------------------------------------------------------------------
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 4b7b1c9fffed..ece3807f209c 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -195,14 +195,11 @@ namespace svx
};
//--------------------------------------------------------------------
- DBG_NAME( FmFocusListenerAdapter )
//--------------------------------------------------------------------
FmFocusListenerAdapter::FmFocusListenerAdapter( const Reference< XControl >& _rxControl, IFocusObserver* _pObserver )
:m_pObserver( _pObserver )
,m_xWindow( _rxControl, UNO_QUERY )
{
- DBG_CTOR( FmFocusListenerAdapter, NULL );
-
DBG_ASSERT( m_xWindow.is(), "FmFocusListenerAdapter::FmFocusListenerAdapter: invalid control!" );
osl_incrementInterlockedCount( &m_refCount );
{
@@ -224,8 +221,6 @@ namespace svx
{
acquire();
dispose();
-
- DBG_DTOR( FmFocusListenerAdapter, NULL );
}
//--------------------------------------------------------------------
@@ -292,14 +287,11 @@ namespace svx
//= FmMouseListenerAdapter
//====================================================================
//--------------------------------------------------------------------
- DBG_NAME( FmMouseListenerAdapter )
//--------------------------------------------------------------------
FmMouseListenerAdapter::FmMouseListenerAdapter( const Reference< XControl >& _rxControl, IContextRequestObserver* _pObserver )
:m_pObserver( _pObserver )
,m_xWindow( _rxControl, UNO_QUERY )
{
- DBG_CTOR( FmMouseListenerAdapter, NULL );
-
DBG_ASSERT( m_xWindow.is(), "FmMouseListenerAdapter::FmMouseListenerAdapter: invalid control!" );
osl_incrementInterlockedCount( &m_refCount );
{
@@ -321,8 +313,6 @@ namespace svx
{
acquire();
dispose();
-
- DBG_DTOR( FmMouseListenerAdapter, NULL );
}
//--------------------------------------------------------------------
@@ -663,7 +653,7 @@ namespace svx
//------------------------------------------------------------------------
void FmTextControlShell::executeAttributeDialog( AttributeSet _eSet, SfxRequest& _rReq )
{
- const SvxFontListItem* pFontList = PTR_CAST( SvxFontListItem, m_pViewFrame->GetObjectShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
+ const SvxFontListItem* pFontList = dynamic_cast< const SvxFontListItem* >( m_pViewFrame->GetObjectShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
DBG_ASSERT( pFontList, "FmTextControlShell::executeAttributeDialog: no font list item!" );
if ( !pFontList )
return;
@@ -734,7 +724,7 @@ namespace svx
// handle them
DBG_ASSERT( aArgs.getLength() == 0, "FmTextControlShell::executeAttributeDialog: these are no UNO slots - are they?" );
- const SfxBoolItem* pBoolItem = PTR_CAST( SfxBoolItem, pModifiedItem );
+ const SfxBoolItem* pBoolItem = dynamic_cast< const SfxBoolItem* >( pModifiedItem );
DBG_ASSERT( pBoolItem, "FmTextControlShell::executeAttributeDialog: no bool item?!" );
if ( pBoolItem )
{
@@ -886,7 +876,7 @@ namespace svx
const SfxPoolItem* pItem = aToggled.GetItem( nWhich );
if ( ( SID_ATTR_CHAR_UNDERLINE == nSlot ) || ( SID_ATTR_CHAR_OVERLINE == nSlot ) )
{
- const SvxOverlineItem* pTextLine = PTR_CAST( SvxOverlineItem, pItem );
+ const SvxOverlineItem* pTextLine = dynamic_cast< const SvxOverlineItem* >( pItem );
DBG_ASSERT( pTextLine, "FmTextControlShell::ExecuteTextAttribute: ooops - no underline/overline item!" );
if ( pTextLine )
{
@@ -900,7 +890,7 @@ namespace svx
}
else
{
- const SvxCrossedOutItem* pCrossedOut = PTR_CAST( SvxCrossedOutItem, pItem );
+ const SvxCrossedOutItem* pCrossedOut = dynamic_cast< const SvxCrossedOutItem* >( pItem );
DBG_ASSERT( pCrossedOut, "FmTextControlShell::ExecuteTextAttribute: ooops - no CrossedOut item!" );
if ( pCrossedOut )
{
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index 92a9c00eb444..6d843a49f14a 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -330,14 +330,12 @@ void FmXDisposeListener::setAdapter(FmXDisposeMultiplexer* pAdapter)
}
//==============================================================================
-DBG_NAME(FmXDisposeMultiplexer);
//------------------------------------------------------------------------------
FmXDisposeMultiplexer::FmXDisposeMultiplexer(FmXDisposeListener* _pListener, const Reference< ::com::sun::star::lang::XComponent>& _rxObject, sal_Int16 _nId)
:m_xObject(_rxObject)
,m_pListener(_pListener)
,m_nId(_nId)
{
- DBG_CTOR(FmXDisposeMultiplexer, NULL);
m_pListener->setAdapter(this);
if (m_xObject.is())
@@ -347,7 +345,6 @@ FmXDisposeMultiplexer::FmXDisposeMultiplexer(FmXDisposeListener* _pListener, con
//------------------------------------------------------------------------------
FmXDisposeMultiplexer::~FmXDisposeMultiplexer()
{
- DBG_DTOR(FmXDisposeMultiplexer, NULL);
}
// ::com::sun::star::lang::XEventListener
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index 9833a7e869f6..b0b7cd6b7db9 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -27,7 +27,7 @@
#include "fmundo.hxx"
#include "fmpgeimp.hxx"
#include "svx/dbtoolsclient.hxx"
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include "fmobj.hxx"
#include "fmprop.hrc"
#include "svx/fmresids.hrc"
@@ -176,7 +176,6 @@ DECLARE_STL_STDKEY_MAP(Reference< XPropertySet >, PropertySetInfo, PropertySetIn
String static_STR_UNDO_PROPERTY;
//------------------------------------------------------------------------------
-DBG_NAME(FmXUndoEnvironment)
//------------------------------------------------------------------------------
FmXUndoEnvironment::FmXUndoEnvironment(FmFormModel& _rModel)
:rModel( _rModel )
@@ -187,7 +186,6 @@ FmXUndoEnvironment::FmXUndoEnvironment(FmFormModel& _rModel)
,m_bDisposed( false )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::FmXUndoEnvironment" );
- DBG_CTOR(FmXUndoEnvironment,NULL);
try
{
m_vbaListener = new ScriptEventListenerWrapper( _rModel );
@@ -200,7 +198,6 @@ FmXUndoEnvironment::FmXUndoEnvironment(FmFormModel& _rModel)
//------------------------------------------------------------------------------
FmXUndoEnvironment::~FmXUndoEnvironment()
{
- DBG_DTOR(FmXUndoEnvironment,NULL);
if ( !m_bDisposed ) // i120746, call FormScriptingEnvironment::dispose to avoid memory leak
m_pScriptingEnv->dispose();
@@ -222,7 +219,7 @@ void FmXUndoEnvironment::dispose()
sal_uInt16 i;
for (i = 0; i < nCount; i++)
{
- FmFormPage* pPage = PTR_CAST( FmFormPage, rModel.GetPage(i) );
+ FmFormPage* pPage = dynamic_cast< FmFormPage* >( rModel.GetPage(i) );
if ( pPage )
{
Reference< XInterface > xForms = pPage->GetForms( false ).get();
@@ -234,7 +231,7 @@ void FmXUndoEnvironment::dispose()
nCount = rModel.GetMasterPageCount();
for (i = 0; i < nCount; i++)
{
- FmFormPage* pPage = PTR_CAST( FmFormPage, rModel.GetMasterPage(i) );
+ FmFormPage* pPage = dynamic_cast< FmFormPage* >( rModel.GetMasterPage(i) );
if ( pPage )
{
Reference< XInterface > xForms = pPage->GetForms( false ).get();
@@ -273,7 +270,7 @@ void FmXUndoEnvironment::ModeChanged()
sal_uInt16 i;
for (i = 0; i < nCount; i++)
{
- FmFormPage* pPage = PTR_CAST( FmFormPage, rModel.GetPage(i) );
+ FmFormPage* pPage = dynamic_cast< FmFormPage* >( rModel.GetPage(i) );
if ( pPage )
{
Reference< XInterface > xForms = pPage->GetForms( false ).get();
@@ -285,7 +282,7 @@ void FmXUndoEnvironment::ModeChanged()
nCount = rModel.GetMasterPageCount();
for (i = 0; i < nCount; i++)
{
- FmFormPage* pPage = PTR_CAST( FmFormPage, rModel.GetMasterPage(i) );
+ FmFormPage* pPage = dynamic_cast< FmFormPage* >( rModel.GetMasterPage(i) );
if ( pPage )
{
Reference< XInterface > xForms = pPage->GetForms( false ).get();
@@ -305,19 +302,20 @@ void FmXUndoEnvironment::ModeChanged()
void FmXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::Notify" );
- if (rHint.ISA(SdrHint))
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if (pSdrHint)
{
- SdrHint* pSdrHint = (SdrHint*)&rHint;
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
case HINT_OBJINSERTED:
{
- SdrObject* pSdrObj = (SdrObject*)pSdrHint->GetObject();
+ SdrObject* pSdrObj = (SdrObject*)pSdrHint->GetSdrHintObject();
Inserted( pSdrObj );
} break;
case HINT_OBJREMOVED:
{
- SdrObject* pSdrObj = (SdrObject*)pSdrHint->GetObject();
+ SdrObject* pSdrObj = (SdrObject*)pSdrHint->GetSdrHintObject();
Removed( pSdrObj );
}
break;
@@ -325,44 +323,53 @@ void FmXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
break;
}
}
- else if (rHint.ISA(SfxSimpleHint))
+ else
{
- switch ( ((SfxSimpleHint&)rHint).GetId() )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if (pSfxSimpleHint)
{
- case SFX_HINT_DYING:
- dispose();
- rModel.SetObjectShell( NULL );
- break;
- case SFX_HINT_MODECHANGED:
- ModeChanged();
- break;
+ switch ( pSfxSimpleHint->GetId() )
+ {
+ case SFX_HINT_DYING:
+ dispose();
+ rModel.SetObjectShell( NULL );
+ break;
+ case SFX_HINT_MODECHANGED:
+ ModeChanged();
+ break;
+ }
}
- }
- else if (rHint.ISA(SfxEventHint))
- {
- switch (((SfxEventHint&)rHint).GetEventId())
+ else
{
- case SFX_EVENT_CREATEDOC:
- case SFX_EVENT_OPENDOC:
- ModeChanged();
- break;
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if (pSfxEventHint)
+ {
+ switch (pSfxEventHint->GetEventId())
+ {
+ case SFX_EVENT_CREATEDOC:
+ case SFX_EVENT_OPENDOC:
+ ModeChanged();
+ break;
+ }
+ }
}
}
-
}
//------------------------------------------------------------------
void FmXUndoEnvironment::Inserted(SdrObject* pObj)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::Inserted" );
- if (pObj->GetObjInventor() == FmFormInventor)
+ if (FmFormInventor == pObj->GetObjInventor())
{
- FmFormObj* pFormObj = PTR_CAST(FmFormObj, pObj);
+ FmFormObj* pFormObj = dynamic_cast< FmFormObj* >( pObj);
Inserted( pFormObj );
}
- else if (pObj->IsGroupObject())
+ else if (pObj->getChildrenOfSdrObject())
{
- SdrObjListIter aIter(*pObj->GetSubList());
+ SdrObjListIter aIter(*pObj->getChildrenOfSdrObject());
while ( aIter.IsMore() )
Inserted( aIter.Next() );
}
@@ -415,50 +422,55 @@ void FmXUndoEnvironment::Inserted(FmFormObj* pObj)
// ist das Control noch einer Form zugeordnet
Reference< XInterface > xModel(pObj->GetUnoControlModel(), UNO_QUERY);
Reference< XFormComponent > xContent(xModel, UNO_QUERY);
- if (xContent.is() && pObj->GetPage())
+ if (xContent.is())
{
- // if the component doesn't belong to a form, yet, find one to insert into
- if (!xContent->getParent().is())
+ SdrPage* pOwningPage = pObj->getSdrPageFromSdrObject();
+
+ if(pOwningPage)
{
- try
+ // if the component doesn't belong to a form, yet, find one to insert into
+ if (!xContent->getParent().is())
{
- Reference< XIndexContainer > xObjectParent = pObj->GetOriginalParent();
+ try
+ {
+ Reference< XIndexContainer > xObjectParent = pObj->GetOriginalParent();
- FmFormPage& rPage = dynamic_cast< FmFormPage& >( *pObj->GetPage() );
- Reference< XIndexAccess > xForms( rPage.GetForms(), UNO_QUERY_THROW );
+ FmFormPage& rPage = dynamic_cast< FmFormPage& >( *pOwningPage );
+ Reference< XIndexAccess > xForms( rPage.GetForms(), UNO_QUERY_THROW );
- Reference< XIndexContainer > xNewParent;
- Reference< XForm > xForm;
- sal_Int32 nPos = -1;
- if ( lcl_searchElement( xForms, xObjectParent ) )
- {
- // the form which was the parent of the object when it was removed is still
- // part of the form component hierachy of the current page
- xNewParent = xObjectParent;
- xForm.set( xNewParent, UNO_QUERY_THROW );
- nPos = ::std::min( pObj->GetOriginalIndex(), xNewParent->getCount() );
+ Reference< XIndexContainer > xNewParent;
+ Reference< XForm > xForm;
+ sal_Int32 nPos = -1;
+ if ( lcl_searchElement( xForms, xObjectParent ) )
+ {
+ // the form which was the parent of the object when it was removed is still
+ // part of the form component hierachy of the current page
+ xNewParent = xObjectParent;
+ xForm.set( xNewParent, UNO_QUERY_THROW );
+ nPos = ::std::min( pObj->GetOriginalIndex(), xNewParent->getCount() );
+ }
+ else
+ {
+ xForm.set( rPage.GetImpl().findPlaceInFormComponentHierarchy( xContent ), UNO_SET_THROW );
+ xNewParent.set( xForm, UNO_QUERY_THROW );
+ nPos = xNewParent->getCount();
+ }
+
+ rPage.GetImpl().setUniqueName( xContent, xForm );
+ xNewParent->insertByIndex( nPos, makeAny( xContent ) );
+
+ Reference< XEventAttacherManager > xManager( xNewParent, UNO_QUERY_THROW );
+ xManager->registerScriptEvents( nPos, pObj->GetOriginalEvents() );
}
- else
+ catch( const Exception& )
{
- xForm.set( rPage.GetImpl().findPlaceInFormComponentHierarchy( xContent ), UNO_SET_THROW );
- xNewParent.set( xForm, UNO_QUERY_THROW );
- nPos = xNewParent->getCount();
+ DBG_UNHANDLED_EXCEPTION();
}
-
- rPage.GetImpl().setUniqueName( xContent, xForm );
- xNewParent->insertByIndex( nPos, makeAny( xContent ) );
-
- Reference< XEventAttacherManager > xManager( xNewParent, UNO_QUERY_THROW );
- xManager->registerScriptEvents( nPos, pObj->GetOriginalEvents() );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
}
- }
- // FormObject zuruecksetzen
- pObj->ClearObjEnv();
+ // FormObject zuruecksetzen
+ pObj->ClearObjEnv();
+ }
}
}
@@ -466,19 +478,15 @@ void FmXUndoEnvironment::Inserted(FmFormObj* pObj)
void FmXUndoEnvironment::Removed(SdrObject* pObj)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXUndoEnvironment::Removed" );
- if ( pObj->IsVirtualObj() )
- // for virtual objects, we've already been notified of the removal of the master
- // object, which is sufficient here
- return;
if (pObj->GetObjInventor() == FmFormInventor)
{
- FmFormObj* pFormObj = PTR_CAST(FmFormObj, pObj);
+ FmFormObj* pFormObj = dynamic_cast< FmFormObj* >( pObj);
Removed(pFormObj);
}
- else if (pObj->IsGroupObject())
+ else if (pObj->getChildrenOfSdrObject())
{
- SdrObjListIter aIter(*pObj->GetSubList());
+ SdrObjListIter aIter(*pObj->getChildrenOfSdrObject());
while ( aIter.IsMore() )
Removed( aIter.Next() );
}
@@ -524,7 +532,6 @@ void FmXUndoEnvironment::Removed(FmFormObj* pObj)
{
DBG_UNHANDLED_EXCEPTION();
}
-
}
}
}
@@ -1016,7 +1023,7 @@ FmUndoPropertyAction::FmUndoPropertyAction(FmFormModel& rNewMod, const PropertyC
void FmUndoPropertyAction::Undo()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmUndoPropertyAction::Undo" );
- FmXUndoEnvironment& rEnv = ((FmFormModel&)rMod).GetUndoEnv();
+ FmXUndoEnvironment& rEnv = static_cast< FmFormModel& >(mrModel).GetUndoEnv();
if (xObj.is() && !rEnv.IsLocked())
{
@@ -1037,7 +1044,7 @@ void FmUndoPropertyAction::Undo()
void FmUndoPropertyAction::Redo()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmUndoPropertyAction::Redo" );
- FmXUndoEnvironment& rEnv = ((FmFormModel&)rMod).GetUndoEnv();
+ FmXUndoEnvironment& rEnv = static_cast< FmFormModel& >(mrModel).GetUndoEnv();
if (xObj.is() && !rEnv.IsLocked())
{
@@ -1065,7 +1072,6 @@ String FmUndoPropertyAction::GetComment() const
}
-DBG_NAME(FmUndoContainerAction);
//------------------------------------------------------------------------------
FmUndoContainerAction::FmUndoContainerAction(FmFormModel& _rMod,
Action _eAction,
@@ -1082,7 +1088,6 @@ FmUndoContainerAction::FmUndoContainerAction(FmFormModel& _rMod,
// some old code suggested this could be a valid argument. However, this code was
// buggy, and it *seemed* that nobody used it - so it was removed.
- DBG_CTOR(FmUndoContainerAction,NULL);
if ( xCont.is() && xElem.is() )
{
// normalize
@@ -1109,7 +1114,6 @@ FmUndoContainerAction::~FmUndoContainerAction()
{
// if we own the object ....
DisposeElement( m_xOwnElement );
- DBG_DTOR(FmUndoContainerAction,NULL);
}
//------------------------------------------------------------------------------
@@ -1190,7 +1194,7 @@ void FmUndoContainerAction::implReRemove( ) SAL_THROW( ( Exception ) )
void FmUndoContainerAction::Undo()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmUndoContainerAction::Undo" );
- FmXUndoEnvironment& rEnv = static_cast< FmFormModel& >( rMod ).GetUndoEnv();
+ FmXUndoEnvironment& rEnv = static_cast< FmFormModel& >( mrModel ).GetUndoEnv();
if ( m_xContainer.is() && !rEnv.IsLocked() && m_xElement.is() )
{
@@ -1220,7 +1224,7 @@ void FmUndoContainerAction::Undo()
void FmUndoContainerAction::Redo()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmUndoContainerAction::Redo" );
- FmXUndoEnvironment& rEnv = static_cast< FmFormModel& >( rMod ).GetUndoEnv();
+ FmXUndoEnvironment& rEnv = static_cast< FmFormModel& >( mrModel ).GetUndoEnv();
if ( m_xContainer.is() && !rEnv.IsLocked() && m_xElement.is() )
{
rEnv.Lock();
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index a37edd6131fe..145ac2f741ff 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -45,7 +45,7 @@
#include <basic/sbx.hxx>
#include "fmitems.hxx"
#include "fmobj.hxx"
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdogrp.hxx>
#include <svx/fmview.hxx>
@@ -87,11 +87,9 @@ using namespace ::svx;
//========================================================================
//------------------------------------------------------------------------
-TYPEINIT1(FmFormView, E3dView);
-
//------------------------------------------------------------------------
-FmFormView::FmFormView( FmFormModel* pModel, OutputDevice* pOut )
- :E3dView(pModel,pOut)
+FmFormView::FmFormView( FmFormModel& rModel, OutputDevice* pOut )
+ :E3dView(rModel,pOut)
{
Init();
}
@@ -105,16 +103,12 @@ void FmFormView::Init()
//////////////////////////////////////////////////////////////////////
// Model setzen
- SdrModel* pModel = GetModel();
-
- DBG_ASSERT( pModel->ISA(FmFormModel), "Falsches Model" );
- if( !pModel->ISA(FmFormModel) ) return;
- FmFormModel* pFormModel = (FmFormModel*)pModel;
+ FmFormModel& rFormModel = dynamic_cast< FmFormModel& >(getSdrModelFromSdrView());
//////////////////////////////////////////////////////////////////////
// DesignMode vom Model holen
- sal_Bool bInitDesignMode = pFormModel->GetOpenInDesignMode();
- if ( pFormModel->OpenInDesignModeIsDefaulted( ) )
+ sal_Bool bInitDesignMode = rFormModel.GetOpenInDesignMode();
+ if ( rFormModel.OpenInDesignModeIsDefaulted( ) )
{ // this means that nobody ever explicitly set this on the model, and the model has never
// been loaded from a stream.
// This means this is a newly created document. This means, we want to have it in design
@@ -128,7 +122,7 @@ void FmFormView::Init()
bInitDesignMode = sal_True;
}
- SfxObjectShell* pObjShell = pFormModel->GetObjectShell();
+ SfxObjectShell* pObjShell = rFormModel.GetObjectShell();
if ( pObjShell && pObjShell->GetMedium() )
{
const SfxPoolItem *pItem=0;
@@ -150,6 +144,12 @@ void FmFormView::Init()
//------------------------------------------------------------------------
FmFormView::~FmFormView()
{
+ // call here when still set due to it's virtual nature
+ if(GetSdrPageView())
+ {
+ HideSdrPage();
+ }
+
if( pFormShell )
pFormShell->SetView( NULL );
@@ -162,15 +162,17 @@ FmFormView::~FmFormView()
FmFormPage* FmFormView::GetCurPage()
{
SdrPageView* pPageView = GetSdrPageView();
- FmFormPage* pCurPage = pPageView ? PTR_CAST( FmFormPage, pPageView->GetPage() ) : NULL;
+ FmFormPage* pCurPage = pPageView ? dynamic_cast< FmFormPage* >( &pPageView->getSdrPageFromSdrPageView() ) : NULL;
return pCurPage;
}
//------------------------------------------------------------------------
-void FmFormView::MarkListHasChanged()
+void FmFormView::handleSelectionChange()
{
- E3dView::MarkListHasChanged();
+ // call parent
+ E3dView::handleSelectionChange();
+ // local reactions
if ( pFormShell && IsDesignMode() )
{
FmFormObj* pObj = getMarkedGrid();
@@ -182,8 +184,7 @@ void FmFormView::MarkListHasChanged()
pImpl->m_xWindow->removeFocusListener(pImpl);
pImpl->m_xWindow = NULL;
}
- SetMoveOutside(sal_False);
- //OLMRefreshAllIAOManagers();
+ SetMoveOutside(false);
}
pFormShell->GetImpl()->SetSelectionDelayed();
@@ -238,17 +239,15 @@ void FmFormView::DeleteWindowFromPaintView(OutputDevice* pNewWin)
//------------------------------------------------------------------------
void FmFormView::ChangeDesignMode(sal_Bool bDesign)
{
- if (bDesign == IsDesignMode())
+ if (bDesign == (sal_Bool)IsDesignMode())
return;
- FmFormModel* pModel = PTR_CAST(FmFormModel, GetModel());
- if (pModel)
- { // fuer die Zeit des Uebergangs das Undo-Environment ausschalten, das sichert, dass man dort auch nicht-transiente
+ FmFormModel& rModel = dynamic_cast< FmFormModel& >(getSdrModelFromSdrView());
+ // fuer die Zeit des Uebergangs das Undo-Environment ausschalten, das sichert, dass man dort auch nicht-transiente
// Properties mal eben aendern kann (sollte allerdings mit Vorsicht genossen und beim Rueckschalten des Modes
// auch immer wieder rueckgaegig gemacht werden. Ein Beispiel ist das Setzen der maximalen Text-Laenge durch das
// FmXEditModel an seinem Control.)
- pModel->GetUndoEnv().Lock();
- }
+ rModel.GetUndoEnv().Lock();
// --- 1. deactivate all controls if we are switching to design mode
if ( bDesign )
@@ -299,10 +298,9 @@ void FmFormView::ChangeDesignMode(sal_Bool bDesign)
while( aIter.IsMore() )
{
SdrObject* pObj = aIter.Next();
- if (pObj && pObj->IsUnoObj())
+ if (pObj && pObj->IsSdrUnoObj())
{
// For redraw just use ActionChanged()
- // pObj->BroadcastObjectChange();
pObj->ActionChanged();
}
}
@@ -311,15 +309,13 @@ void FmFormView::ChangeDesignMode(sal_Bool bDesign)
else
{
// set the auto focus to the first control (if indicated by the model to do so)
- sal_Bool bForceControlFocus = pModel ? pModel->GetAutoControlFocus() : sal_False;
- if (bForceControlFocus)
+ if (rModel.GetAutoControlFocus())
pImpl->AutoFocus();
}
}
// und mein Undo-Environment wieder an
- if (pModel)
- pModel->GetUndoEnv().UnLock();
+ rModel.GetUndoEnv().UnLock();
}
//------------------------------------------------------------------------
@@ -330,16 +326,15 @@ void FmFormView::GrabFirstControlFocus( sal_Bool _bForceSync )
}
//------------------------------------------------------------------------
-SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
+void FmFormView::ShowSdrPage(SdrPage& rPage)
{
- SdrPageView* pPV = E3dView::ShowSdrPage(pPage);
+ // call parent
+ E3dView::ShowSdrPage(rPage);
- if (pPage)
- {
if (!IsDesignMode())
{
// creating the controllers
- ActivateControls(pPV);
+ ActivateControls(GetSdrPageView());
// Alles deselektieren
UnmarkAll();
@@ -352,8 +347,7 @@ SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
// damit der Formular-Navigator auf den Seitenwechsel reagieren kann
pFormShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_FMEXPLORER_CONTROL , sal_True, sal_False);
- pFormShellImpl->SetSelection(GetMarkedObjectList());
- }
+ pFormShellImpl->SetSelection(getSelectedSdrObjectVectorFromSdrMarkView());
}
// notify our shell that we have been activated
@@ -361,8 +355,6 @@ SdrPageView* FmFormView::ShowSdrPage(SdrPage* pPage)
pFormShell->GetImpl()->viewActivated( *this );
else
pImpl->Activate();
-
- return pPV;
}
//------------------------------------------------------------------------
@@ -389,7 +381,7 @@ SdrModel* FmFormView::GetMarkedObjModel() const
}
//------------------------------------------------------------------------
-sal_Bool FmFormView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool FmFormView::Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
{
return E3dView::Paste(rMod, rPos, pLst, nOptions);
}
@@ -499,7 +491,7 @@ void FmFormView::EndCompleteRedraw( SdrPaintWindow& rPaintWindow, bool bPaintFor
}
// -----------------------------------------------------------------------------
-sal_Bool FmFormView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
+bool FmFormView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
{
sal_Bool bDone = sal_False;
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
@@ -524,8 +516,7 @@ sal_Bool FmFormView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
pImpl->m_xWindow = xWindow;
// add as listener to get notified when ESC will be pressed inside the grid
pImpl->m_xWindow->addFocusListener(pImpl);
- SetMoveOutside(sal_True);
- //OLMRefreshAllIAOManagers();
+ SetMoveOutside(true);
xWindow->setFocus();
bDone = sal_True;
}
@@ -560,7 +551,7 @@ sal_Bool FmFormView::checkUnMarkAll(const Reference< XInterface >& _xSource)
}
// -----------------------------------------------------------------------------
-sal_Bool FmFormView::MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin )
+bool FmFormView::MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin )
{
sal_Bool bReturn = E3dView::MouseButtonDown( _rMEvt, _pWin );
@@ -577,22 +568,20 @@ sal_Bool FmFormView::MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin )
// -----------------------------------------------------------------------------
FmFormObj* FmFormView::getMarkedGrid() const
{
+ SdrObject* pSingleSelected = getSelectedIfSingle();
FmFormObj* pFormObject = NULL;
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- if ( 1 == rMarkList.GetMarkCount() )
+
+ if ( pSingleSelected )
{
- SdrMark* pMark = rMarkList.GetMark(0);
- if ( pMark )
+ pFormObject = FmFormObj::GetFormObject( pSingleSelected );
+ if ( pFormObject )
{
- pFormObject = FmFormObj::GetFormObject( pMark->GetMarkedSdrObj() );
- if ( pFormObject )
- {
- Reference< XServiceInfo > xServInfo( pFormObject->GetUnoControlModel(), UNO_QUERY );
- if ( !xServInfo.is() || !xServInfo->supportsService( FM_SUN_COMPONENT_GRIDCONTROL ) )
- pFormObject = NULL;
- }
+ Reference< XServiceInfo > xServInfo( pFormObject->GetUnoControlModel(), UNO_QUERY );
+ if ( !xServInfo.is() || !xServInfo->supportsService( FM_SUN_COMPONENT_GRIDCONTROL ) )
+ pFormObject = NULL;
}
}
+
return pFormObject;
}
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 0078c7669408..4e72db0fa021 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -35,8 +35,8 @@
#include "fmundo.hxx"
#include "fmvwimp.hxx"
#include "formcontrolfactory.hxx"
-#include "svx/sdrpaintwindow.hxx"
-#include "svx/svditer.hxx"
+#include <svx/sdrpaintwindow.hxx>
+#include <svx/svditer.hxx>
#include "svx/dataaccessdescriptor.hxx"
#include "svx/dialmgr.hxx"
#include "svx/fmglob.hxx"
@@ -91,7 +91,7 @@
#include <vcl/stdtext.hxx>
#include <vos/mutex.hxx>
#include <rtl/logfile.hxx>
-
+#include <svx/svdlegacy.hxx>
#include <algorithm>
using namespace ::comphelper;
@@ -169,18 +169,21 @@ public:
};
//========================================================================
+
DBG_NAME(FormViewPageWindowAdapter)
+
//------------------------------------------------------------------------
+
FormViewPageWindowAdapter::FormViewPageWindowAdapter( const ::comphelper::ComponentContext& _rContext, const SdrPageWindow& _rWindow, FmXFormView* _pViewImpl )
: m_xControlContainer( _rWindow.GetControlContainer() ),
m_aContext( _rContext ),
m_pViewImpl( _pViewImpl ),
m_pWindow( dynamic_cast< Window* >( &_rWindow.GetPaintWindow().GetOutputDevice() ) )
{
- DBG_CTOR(FormViewPageWindowAdapter,NULL);
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXPageViewWinRec::FmXPageViewWinRec" );
// create an XFormController for every form
- FmFormPage* pFormPage = dynamic_cast< FmFormPage* >( _rWindow.GetPageView().GetPage() );
+ FmFormPage* pFormPage = dynamic_cast< FmFormPage* >( &_rWindow.GetPageView().getSdrPageFromSdrPageView() );
DBG_ASSERT( pFormPage, "FormViewPageWindowAdapter::FormViewPageWindowAdapter: no FmFormPage found!" );
if ( pFormPage )
{
@@ -204,7 +207,6 @@ FormViewPageWindowAdapter::FormViewPageWindowAdapter( const ::comphelper::Compon
// -----------------------------------------------------------------------------
FormViewPageWindowAdapter::~FormViewPageWindowAdapter()
{
- DBG_DTOR(FormViewPageWindowAdapter,NULL);
}
//------------------------------------------------------------------
@@ -288,10 +290,11 @@ void SAL_CALL FormViewPageWindowAdapter::makeVisible( const Reference< XControl
Reference< XWindow > xWindow( _Control, UNO_QUERY );
if ( xWindow.is() && m_pViewImpl->getView() && m_pWindow )
{
- awt::Rectangle aRect = xWindow->getPosSize();
- ::Rectangle aNewRect( aRect.X, aRect.Y, aRect.X + aRect.Width, aRect.Y + aRect.Height );
- aNewRect = m_pWindow->PixelToLogic( aNewRect );
- m_pViewImpl->getView()->MakeVisible( aNewRect, *m_pWindow );
+ const awt::Rectangle aRect = xWindow->getPosSize();
+ const basegfx::B2DRange aRange(m_pWindow->GetInverseViewTransformation() *
+ basegfx::B2DRange(aRect.X, aRect.Y, aRect.X + aRect.Width, aRect.Y + aRect.Height));
+
+ m_pViewImpl->getView()->MakeVisibleAtView( aRange, *m_pWindow );
}
}
@@ -583,7 +586,8 @@ PFormViewPageWindowAdapter FmXFormView::findWindow( const Reference< XControlCon
//------------------------------------------------------------------------------
void FmXFormView::addWindow(const SdrPageWindow& rWindow)
{
- FmFormPage* pFormPage = PTR_CAST( FmFormPage, rWindow.GetPageView().GetPage() );
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::addWindow" );
+ FmFormPage* pFormPage = dynamic_cast< FmFormPage* >( &rWindow.GetPageView().getSdrPageFromSdrPageView() );
if ( !pFormPage )
return;
@@ -700,10 +704,10 @@ IMPL_LINK(FmXFormView, OnActivate, void*, /*EMPTYTAG*/)
}
// setting the controller to activate
- if (m_pView->GetFormShell() && m_pView->GetActualOutDev() && m_pView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW)
+ if (m_pView->GetFormShell() && m_pView->GetCurrentViewDevice() && m_pView->GetCurrentViewDevice()->GetOutDevType() == OUTDEV_WINDOW)
{
- Window* pWindow = const_cast<Window*>(static_cast<const Window*>(m_pView->GetActualOutDev()));
- PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? NULL : m_aPageWindowAdapters[0];
+ Window* pWindow = const_cast<Window*>(static_cast<const Window*>(m_pView->GetCurrentViewDevice()));
+ PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? 0 : m_aPageWindowAdapters[0];
for ( PageWindowAdapterList::const_iterator i = m_aPageWindowAdapters.begin();
i != m_aPageWindowAdapters.end();
++i
@@ -927,64 +931,66 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
do
{
+ // get the forms collection of the page we belong to
+ FmFormPage* pPage = (m_pView && m_pView->GetSdrPageView())
+ ? dynamic_cast< FmFormPage* >( &m_pView->GetSdrPageView()->getSdrPageFromSdrPageView() )
+ : NULL;
+ Reference< XIndexAccess > xForms( pPage ? Reference< XIndexAccess >( pPage->GetForms(), UNO_QUERY ) : Reference< XIndexAccess >() );
- // get the forms collection of the page we belong to
- FmFormPage* pPage = m_pView ? PTR_CAST( FmFormPage, m_pView->GetSdrPageView()->GetPage() ) : NULL;
- Reference< XIndexAccess > xForms( pPage ? Reference< XIndexAccess >( pPage->GetForms(), UNO_QUERY ) : Reference< XIndexAccess >() );
+ const PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? NULL : m_aPageWindowAdapters[0];
+ const Window* pWindow = pAdapter.get() ? pAdapter->getWindow() : NULL;
- const PFormViewPageWindowAdapter pAdapter = m_aPageWindowAdapters.empty() ? NULL : m_aPageWindowAdapters[0];
- const Window* pWindow = pAdapter.get() ? pAdapter->getWindow() : NULL;
-
- ENSURE_OR_RETURN( xForms.is() && pWindow, "FmXFormView::OnAutoFocus: could not collect all essentials!", 0L );
-
- try
- {
- // go for the tab controller of the first form
- if ( !xForms->getCount() )
- break;
- Reference< XForm > xForm( xForms->getByIndex( 0 ), UNO_QUERY_THROW );
- Reference< XTabController > xTabController( pAdapter->getController( xForm ), UNO_QUERY_THROW );
+ ENSURE_OR_RETURN( xForms.is() && pWindow, "FmXFormView::OnAutoFocus: could not collect all essentials!", 0L );
- // go for the first control of the controller
- Sequence< Reference< XControl > > aControls( xTabController->getControls() );
- if ( aControls.getLength() == 0 )
+ try
{
- Reference< XElementAccess > xFormElementAccess( xForm, UNO_QUERY_THROW );
- if ( xFormElementAccess->hasElements() )
+ // go for the tab controller of the first form
+ if ( !xForms->getCount() )
+ break;
+ Reference< XForm > xForm( xForms->getByIndex( 0 ), UNO_QUERY_THROW );
+ Reference< XTabController > xTabController( pAdapter->getController( xForm ), UNO_QUERY_THROW );
+
+ // go for the first control of the controller
+ Sequence< Reference< XControl > > aControls( xTabController->getControls() );
+ if ( aControls.getLength() == 0 )
{
- // there are control models in the form, but no controls, yet.
- // Well, since some time controls are created on demand only. In particular,
- // they're normally created when they're first painted.
- // Unfortunately, the FormController does not have any way to
- // trigger the creation itself, so we must hack this ...
- lcl_ensureControlsOfFormExist_nothrow( *pPage, *m_pView, *pWindow, xForm );
- aControls = xTabController->getControls();
- OSL_ENSURE( aControls.getLength(), "FmXFormView::OnAutoFocus: no controls at all!" );
+ Reference< XElementAccess > xFormElementAccess( xForm, UNO_QUERY_THROW );
+ if ( xFormElementAccess->hasElements() )
+ {
+ // there are control models in the form, but no controls, yet.
+ // Well, since some time controls are created on demand only. In particular,
+ // they're normally created when they're first painted.
+ // Unfortunately, the FormController does not have any way to
+ // trigger the creation itself, so we must hack this ...
+ lcl_ensureControlsOfFormExist_nothrow( *pPage, *m_pView, *pWindow, xForm );
+ aControls = xTabController->getControls();
+ OSL_ENSURE( aControls.getLength(), "FmXFormView::OnAutoFocus: no controls at all!" );
+ }
}
- }
- // set the focus to this first control
- Reference< XWindow > xControlWindow( lcl_firstFocussableControl( aControls ), UNO_QUERY );
- if ( !xControlWindow.is() )
- break;
+ // set the focus to this first control
+ Reference< XWindow > xControlWindow( lcl_firstFocussableControl( aControls ), UNO_QUERY );
+ if ( !xControlWindow.is() )
+ break;
- xControlWindow->setFocus();
+ xControlWindow->setFocus();
- // ensure that the control is visible
- // 80210 - 12/07/00 - FS
- const Window* pCurrentWindow = dynamic_cast< const Window* >( m_pView->GetActualOutDev() );
- if ( pCurrentWindow )
+ // ensure that the control is visible
+ // 80210 - 12/07/00 - FS
+ const Window* pCurrentWindow = dynamic_cast< const Window* >( m_pView->GetCurrentViewDevice() );
+ if ( pCurrentWindow )
+ {
+ const awt::Rectangle aRect = xControlWindow->getPosSize();
+ const basegfx::B2DRange aRange(pCurrentWindow->GetInverseViewTransformation() *
+ basegfx::B2DRange(aRect.X, aRect.Y, aRect.X + aRect.Width, aRect.Y + aRect.Height));
+
+ m_pView->MakeVisibleAtView( aRange, *const_cast< Window* >( pCurrentWindow ) );
+ }
+ }
+ catch( const Exception& )
{
- awt::Rectangle aRect = xControlWindow->getPosSize();
- ::Rectangle aNonUnoRect( aRect.X, aRect.Y, aRect.X + aRect.Width, aRect.Y + aRect.Height );
- m_pView->MakeVisible( pCurrentWindow->PixelToLogic( aNonUnoRect ), *const_cast< Window* >( pCurrentWindow ) );
+ DBG_UNHANDLED_EXCEPTION();
}
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
-
} // do
while ( false );
@@ -1107,19 +1113,24 @@ namespace
const Reference< XDataSource >& _rxDataSource = NULL, const ::rtl::OUString& _rDataSourceName = ::rtl::OUString(),
const ::rtl::OUString& _rCommand = ::rtl::OUString(), const sal_Int32 _nCommandType = -1 )
{
- FmFormPage& rPage = static_cast< FmFormPage& >( *_rView.GetSdrPageView()->GetPage() );
+ FmFormPage* pPage = _rView.GetSdrPageView()
+ ? static_cast< FmFormPage* >( &_rView.GetSdrPageView()->getSdrPageFromSdrPageView() )
+ : NULL;
+ if(pPage)
+ {
Reference< XFormComponent > xFormComponent( _rSdrObj.GetUnoControlModel(), UNO_QUERY_THROW );
Reference< XForm > xTargetForm(
- rPage.GetImpl().findPlaceInFormComponentHierarchy( xFormComponent, _rxDataSource, _rDataSourceName, _rCommand, _nCommandType ),
+ pPage->GetImpl().findPlaceInFormComponentHierarchy( xFormComponent, _rxDataSource, _rDataSourceName, _rCommand, _nCommandType ),
UNO_SET_THROW );
- rPage.GetImpl().setUniqueName( xFormComponent, xTargetForm );
+ pPage->GetImpl().setUniqueName( xFormComponent, xTargetForm );
Reference< XIndexContainer > xFormAsContainer( xTargetForm, UNO_QUERY_THROW );
xFormAsContainer->insertByIndex( xFormAsContainer->getCount(), makeAny( xFormComponent ) );
}
}
+}
// -----------------------------------------------------------------------------
SdrObject* FmXFormView::implCreateFieldControl( const ::svx::ODataAccessDescriptor& _rColumnDescriptor )
@@ -1218,8 +1229,8 @@ SdrObject* FmXFormView::implCreateFieldControl( const ::svx::ODataAccessDescript
////////////////////////////////////////////////////////////////
// nur fuer Textgroesse
OutputDevice* pOutDev = NULL;
- if (m_pView->GetActualOutDev() && m_pView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW)
- pOutDev = const_cast<OutputDevice*>(m_pView->GetActualOutDev());
+ if (m_pView->GetCurrentViewDevice() && m_pView->GetCurrentViewDevice()->GetOutDevType() == OUTDEV_WINDOW)
+ pOutDev = const_cast<OutputDevice*>(m_pView->GetCurrentViewDevice());
else
{// OutDev suchen
SdrPageView* pPageView = m_pView->GetSdrPageView();
@@ -1323,10 +1334,9 @@ SdrObject* FmXFormView::implCreateFieldControl( const ::svx::ODataAccessDescript
if ( bCheckbox )
return pControl;
- SdrObjGroup* pGroup = new SdrObjGroup();
- SdrObjList* pObjList = pGroup->GetSubList();
- pObjList->InsertObject( pLabel );
- pObjList->InsertObject( pControl );
+ SdrObjGroup* pGroup = new SdrObjGroup(getView()->getSdrModelFromSdrView());
+ pGroup->InsertObjectToSdrObjList(*pLabel);
+ pGroup->InsertObjectToSdrObjList(*pControl);
if ( bDateNTimeField )
{ // so far we created a date field only, but we also need a time field
@@ -1336,8 +1346,8 @@ SdrObject* FmXFormView::implCreateFieldControl( const ::svx::ODataAccessDescript
xDataSource, sDataSource, sCommand, nCommandType )
)
{
- pObjList->InsertObject( pLabel );
- pObjList->InsertObject( pControl );
+ pGroup->InsertObjectToSdrObjList(*pLabel);
+ pGroup->InsertObjectToSdrObjList(*pControl);
}
}
@@ -1371,8 +1381,8 @@ SdrObject* FmXFormView::implCreateXFormsControl( const ::svx::OXFormsDescriptor
////////////////////////////////////////////////////////////////
// nur fuer Textgroesse
OutputDevice* pOutDev = NULL;
- if (m_pView->GetActualOutDev() && m_pView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW)
- pOutDev = const_cast<OutputDevice*>(m_pView->GetActualOutDev());
+ if (m_pView->GetCurrentViewDevice() && m_pView->GetCurrentViewDevice()->GetOutDevType() == OUTDEV_WINDOW)
+ pOutDev = const_cast<OutputDevice*>(m_pView->GetCurrentViewDevice());
else
{// OutDev suchen
SdrPageView* pPageView = m_pView->GetSdrPageView();
@@ -1438,10 +1448,9 @@ SdrObject* FmXFormView::implCreateXFormsControl( const ::svx::OXFormsDescriptor
//////////////////////////////////////////////////////////////////////
// group objects
- SdrObjGroup* pGroup = new SdrObjGroup();
- SdrObjList* pObjList = pGroup->GetSubList();
- pObjList->InsertObject(pLabel);
- pObjList->InsertObject(pControl);
+ SdrObjGroup* pGroup = new SdrObjGroup(getView()->getSdrModelFromSdrView());
+ pGroup->InsertObjectToSdrObjList(*pLabel);
+ pGroup->InsertObjectToSdrObjList(*pControl);
return pGroup;
}
@@ -1452,12 +1461,14 @@ SdrObject* FmXFormView::implCreateXFormsControl( const ::svx::OXFormsDescriptor
const MapMode eSourceMode(MAP_100TH_MM);
const sal_uInt16 nObjID = OBJ_FM_BUTTON;
::Size controlSize(4000, 500);
- FmFormObj *pControl = static_cast<FmFormObj*>(SdrObjFactory::MakeNewObject( FmFormInventor, nObjID, NULL, NULL ));
+ FmFormObj* pControl = static_cast< FmFormObj* >(SdrObjFactory::MakeNewObject(
+ getView()->getSdrModelFromSdrView(),
+ SdrObjectCreationInfo(nObjID, FmFormInventor)));
controlSize.Width() = Fraction(controlSize.Width(), 1) * eTargetMode.GetScaleX();
controlSize.Height() = Fraction(controlSize.Height(), 1) * eTargetMode.GetScaleY();
::Point controlPos( pOutDev->LogicToLogic( ::Point( controlSize.Width(), 0 ), eSourceMode, eTargetMode ) );
::Rectangle controlRect( controlPos, pOutDev->LogicToLogic( controlSize, eSourceMode, eTargetMode ) );
- pControl->SetLogicRect(controlRect);
+ sdr::legacy::SetLogicRect(*pControl, controlRect);
// set the button label
Reference< XPropertySet > xControlSet(pControl->GetUnoControlModel(), UNO_QUERY);
@@ -1492,7 +1503,7 @@ bool FmXFormView::createControlLabelPair( OutputDevice& _rOutDev, sal_Int32 _nXO
{
if ( !createControlLabelPair( m_aContext, _rOutDev, _nXOffsetMM, _nYOffsetMM,
_rxField, _rxNumberFormats, _nControlObjectID, _rFieldPostfix, FmFormInventor, OBJ_FM_FIXEDTEXT,
- NULL, NULL, NULL, _rpLabel, _rpControl )
+ NULL, NULL, &m_pView->getSdrModelFromSdrView(), _rpLabel, _rpControl )
)
return false;
@@ -1515,7 +1526,7 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
OutputDevice& _rOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM, const Reference< XPropertySet >& _rxField,
const Reference< XNumberFormats >& _rxNumberFormats, sal_uInt16 _nControlObjectID,
const ::rtl::OUString& _rFieldPostfix, sal_uInt32 _nInventor, sal_uInt16 _nLabelObjectID,
- SdrPage* _pLabelPage, SdrPage* _pControlPage, SdrModel* _pModel, SdrUnoObj*& _rpLabel, SdrUnoObj*& _rpControl)
+ SdrPage* /*_pLabelPage*/, SdrPage* /*_pControlPage*/, SdrModel* _pModel, SdrUnoObj*& _rpLabel, SdrUnoObj*& _rpControl)
{
sal_Int32 nDataType = 0;
::rtl::OUString sFieldName;
@@ -1551,14 +1562,15 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
bool bNeedLabel = ( _nControlObjectID != OBJ_FM_CHECKBOX );
// the label
- ::std::auto_ptr< SdrUnoObj > pLabel;
+ SdrUnoObj* pLabel = 0;
Reference< XPropertySet > xLabelModel;
if ( bNeedLabel )
{
- pLabel.reset( dynamic_cast< SdrUnoObj* >(
- SdrObjFactory::MakeNewObject( _nInventor, _nLabelObjectID, _pLabelPage, _pModel ) ) );
- OSL_ENSURE( pLabel.get(), "FmXFormView::createControlLabelPair: could not create the label!" );
- if ( !pLabel.get() )
+ pLabel = dynamic_cast< SdrUnoObj* >(SdrObjFactory::MakeNewObject(
+ *_pModel,
+ SdrObjectCreationInfo(_nLabelObjectID, _nInventor)));
+ OSL_ENSURE( pLabel, "FmXFormView::createControlLabelPair: could not create the label!" );
+ if ( !pLabel )
return false;
xLabelModel.set( pLabel->GetUnoControlModel(), UNO_QUERY );
@@ -1576,17 +1588,18 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
xLabelModel->setPropertyValue( FM_PROP_NAME, makeAny( ::rtl::OUString( sObjectLabel ) ) );
}
- pLabel->SetLogicRect( ::Rectangle(
+ sdr::legacy::SetLogicRect(*pLabel, ::Rectangle(
_rOutDev.LogicToLogic( ::Point( _nXOffsetMM, _nYOffsetMM ), eSourceMode, eTargetMode ),
_rOutDev.LogicToLogic( aRealSize, eSourceMode, eTargetMode )
) );
}
// the control
- ::std::auto_ptr< SdrUnoObj > pControl( dynamic_cast< SdrUnoObj* >(
- SdrObjFactory::MakeNewObject( _nInventor, _nControlObjectID, _pControlPage, _pModel ) ) );
- OSL_ENSURE( pControl.get(), "FmXFormView::createControlLabelPair: could not create the control!" );
- if ( !pControl.get() )
+ SdrUnoObj* pControl = dynamic_cast< SdrUnoObj* >(SdrObjFactory::MakeNewObject(
+ *_pModel,
+ SdrObjectCreationInfo(_nControlObjectID, _nInventor)));
+ OSL_ENSURE( pControl, "FmXFormView::createControlLabelPair: could not create the control!" );
+ if ( !pControl )
return false;
Reference< XPropertySet > xControlSet( pControl->GetUnoControlModel(), UNO_QUERY );
@@ -1615,7 +1628,7 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
aControlSize.Width() = long(Fraction(aControlSize.Width(), 1) * eTargetMode.GetScaleX());
aControlSize.Height() = long(Fraction(aControlSize.Height(), 1) * eTargetMode.GetScaleY());
- pControl->SetLogicRect( ::Rectangle(
+ sdr::legacy::SetLogicRect(*pControl, ::Rectangle(
_rOutDev.LogicToLogic( ::Point( aRealSize.Width() + _nXOffsetMM, _nYOffsetMM ), eSourceMode, eTargetMode ),
_rOutDev.LogicToLogic( aControlSize, eSourceMode, eTargetMode )
) );
@@ -1661,8 +1674,8 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
aControlFactory.initializeFieldDependentProperties( _rxField, xControlSet, _rxNumberFormats );
}
- _rpLabel = pLabel.release();
- _rpControl = pControl.release();
+ _rpLabel = pLabel;
+ _rpControl = pControl;
return true;
}
@@ -1675,8 +1688,12 @@ FmXFormView::ObjectRemoveListener::ObjectRemoveListener( FmXFormView* pParent )
//------------------------------------------------------------------------------
void FmXFormView::ObjectRemoveListener::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if (rHint.ISA(SdrHint) && (((SdrHint&)rHint).GetKind() == HINT_OBJREMOVED))
- m_pParent->ObjectRemovedInAliveMode(((SdrHint&)rHint).GetObject());
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if (pSdrHint && pSdrHint->GetSdrHintKind() == HINT_OBJREMOVED)
+ {
+ m_pParent->ObjectRemovedInAliveMode(pSdrHint->GetSdrHintObject());
+ }
}
//------------------------------------------------------------------------------
@@ -1686,14 +1703,12 @@ void FmXFormView::ObjectRemovedInAliveMode( const SdrObject* pObject )
// muss ich es jetzt da rausnehmen, da ich sonst beim Zurueckschalten versuche, die Markierung wieder zu setzen
// (interesanterweise geht das nur bei gruppierten Objekten schief (beim Zugriff auf deren ObjList GPF), nicht bei einzelnen)
- sal_uIntPtr nCount = m_aMark.GetMarkCount();
- for (sal_uIntPtr i = 0; i < nCount; ++i)
+ for (sal_uInt32 i(0); i < m_aMark.size(); ++i)
{
- SdrMark* pMark = m_aMark.GetMark(i);
- SdrObject* pCurrent = pMark->GetMarkedSdrObj();
+ SdrObject* pCurrent = m_aMark[i];
if (pObject == pCurrent)
{
- m_aMark.DeleteMark(i);
+ m_aMark.erase(m_aMark.begin() + i);
return;
}
// ich brauche nicht in GroupObjects absteigen : wenn dort unten ein Objekt geloescht wird, dann bleibt der
@@ -1733,20 +1748,19 @@ void FmXFormView::saveMarkList( sal_Bool _bSmartUnmark )
{
if ( m_pView )
{
- m_aMark = m_pView->GetMarkedObjectList();
+ m_aMark = m_pView->getSelectedSdrObjectVectorFromSdrMarkView();
+
if ( _bSmartUnmark )
{
- sal_uIntPtr nCount = m_aMark.GetMarkCount( );
- for ( sal_uIntPtr i = 0; i < nCount; ++i )
+ for ( sal_uIntPtr i = 0; i < m_aMark.size(); ++i )
{
- SdrMark* pMark = m_aMark.GetMark(i);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
+ SdrObject* pObj = m_aMark[i];
- if ( m_pView->IsObjMarked( pObj ) )
+ if ( m_pView->IsObjMarked( *pObj ) )
{
- if ( pObj->IsGroupObject() )
+ if ( pObj->getChildrenOfSdrObject() )
{
- SdrObjListIter aIter( *pObj->GetSubList() );
+ SdrObjListIter aIter( *pObj->getChildrenOfSdrObject() );
sal_Bool bMixed = sal_False;
while ( aIter.IsMore() && !bMixed )
bMixed = ( aIter.Next()->GetObjInventor() != FmFormInventor );
@@ -1754,14 +1768,14 @@ void FmXFormView::saveMarkList( sal_Bool _bSmartUnmark )
if ( !bMixed )
{
// all objects in the group are form objects
- m_pView->MarkObj( pMark->GetMarkedSdrObj(), pMark->GetPageView(), sal_True /* unmark! */ );
+ m_pView->MarkObj( *pObj, true /* unmark! */ );
}
}
else
{
if ( pObj->GetObjInventor() == FmFormInventor )
{ // this is a form layer object
- m_pView->MarkObj( pMark->GetMarkedSdrObj(), pMark->GetPageView(), sal_True /* unmark! */ );
+ m_pView->MarkObj( *pObj, true /* unmark! */ );
}
}
}
@@ -1771,7 +1785,7 @@ void FmXFormView::saveMarkList( sal_Bool _bSmartUnmark )
else
{
DBG_ERROR( "FmXFormView::saveMarkList: invalid view!" );
- m_aMark = SdrMarkList();
+ m_aMark.clear();
}
}
@@ -1787,33 +1801,33 @@ static sal_Bool lcl_hasObject( SdrObjListIter& rIter, SdrObject* pObj )
}
//------------------------------------------------------------------------------
-void FmXFormView::restoreMarkList( SdrMarkList& _rRestoredMarkList )
+void FmXFormView::restoreMarkList( SdrObjectVector& _rRestoredSelection )
{
if ( !m_pView )
return;
- _rRestoredMarkList.Clear();
+ _rRestoredSelection.clear();
- const SdrMarkList& rCurrentList = m_pView->GetMarkedObjectList();
FmFormPage* pPage = GetFormShell() ? GetFormShell()->GetCurPage() : NULL;
- if (pPage)
+ if (pPage && m_pView->areSdrObjectsSelected())
{
- if (rCurrentList.GetMarkCount())
+ const SdrObjectVector aSelection(m_pView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if (aSelection.size())
{ // there is a current mark ... hmm. Is it a subset of the mark we remembered in saveMarkList?
sal_Bool bMisMatch = sal_False;
// loop through all current marks
- sal_uIntPtr nCurrentCount = rCurrentList.GetMarkCount();
- for ( sal_uIntPtr i=0; i<nCurrentCount&& !bMisMatch; ++i )
+ for ( sal_uInt32 i(0); i < aSelection.size() && !bMisMatch; ++i )
{
- const SdrObject* pCurrentMarked = rCurrentList.GetMark( i )->GetMarkedSdrObj();
+ const SdrObject* pCurrentMarked = aSelection[i];
// loop through all saved marks, check for equality
sal_Bool bFound = sal_False;
- sal_uIntPtr nSavedCount = m_aMark.GetMarkCount();
- for ( sal_uIntPtr j=0; j<nSavedCount && !bFound; ++j )
+
+ for ( sal_uInt32 j(0); j < m_aMark.size() && !bFound; ++j )
{
- if ( m_aMark.GetMark( j )->GetMarkedSdrObj() == pCurrentMarked )
+ if ( m_aMark[j] == pCurrentMarked )
bFound = sal_True;
}
@@ -1824,53 +1838,50 @@ void FmXFormView::restoreMarkList( SdrMarkList& _rRestoredMarkList )
if ( bMisMatch )
{
- m_aMark.Clear();
- _rRestoredMarkList = rCurrentList;
+ m_aMark.clear();
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
+ {
+ _rRestoredSelection.push_back(aSelection[a]);
+ }
return;
}
}
// wichtig ist das auf die Objecte der markliste nicht zugegriffen wird
// da diese bereits zerstoert sein koennen
- SdrPageView* pCurPageView = m_pView->GetSdrPageView();
SdrObjListIter aPageIter( *pPage );
sal_Bool bFound = sal_True;
// gibt es noch alle Objecte
- sal_uIntPtr nCount = m_aMark.GetMarkCount();
- for (sal_uIntPtr i = 0; i < nCount && bFound; i++)
+ for (sal_uIntPtr i = 0; i < m_aMark.size() && bFound; i++)
{
- SdrMark* pMark = m_aMark.GetMark(i);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
- if (pObj->IsGroupObject())
+ SdrObject* pObj = m_aMark[i];
+ if (pObj->getChildrenOfSdrObject())
{
- SdrObjListIter aIter(*pObj->GetSubList());
+ SdrObjListIter aIter(*pObj->getChildrenOfSdrObject());
while (aIter.IsMore() && bFound)
bFound = lcl_hasObject(aPageIter, aIter.Next());
}
else
bFound = lcl_hasObject(aPageIter, pObj);
-
- bFound = bFound && pCurPageView == pMark->GetPageView();
}
if (bFound)
{
// Das LastObject auswerten
- if (nCount) // Objecte jetzt Markieren
+ if (m_aMark.size()) // Objecte jetzt Markieren
{
- for (sal_uIntPtr i = 0; i < nCount; i++)
+ for (sal_uIntPtr i = 0; i < m_aMark.size(); i++)
{
- SdrMark* pMark = m_aMark.GetMark(i);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
+ SdrObject* pObj = m_aMark[i];
if ( pObj->GetObjInventor() == FmFormInventor )
- if ( !m_pView->IsObjMarked( pObj ) )
- m_pView->MarkObj( pObj, pMark->GetPageView() );
+ if ( !m_pView->IsObjMarked( *pObj ) )
+ m_pView->MarkObj( *pObj );
}
- _rRestoredMarkList = m_aMark;
+ _rRestoredSelection.insert(_rRestoredSelection.end(), m_aMark.begin(), m_aMark.end());
}
}
- m_aMark.Clear();
+ m_aMark.clear();
}
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx
index c3ff3f561365..d5719dd32006 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -54,6 +54,7 @@
#include <unotools/syslocale.hxx>
#include <tools/gen.hxx>
#include <tools/diagnose_ex.h>
+#include <svx/svdlegacy.hxx>
#include <set>
@@ -135,7 +136,7 @@ namespace svxform
return initializeControlModel(
_eDocType,
Reference< XPropertySet >( _rObject.GetUnoControlModel(), UNO_QUERY ),
- _rObject.GetCurrentBoundRect()
+ _rObject.getObjectRange(0)
);
}
@@ -143,7 +144,7 @@ namespace svxform
sal_Int16 FormControlFactory::initializeControlModel( const DocumentType _eDocType, const Reference< XPropertySet >& _rxControlModel )
{
return initializeControlModel(
- _eDocType, _rxControlModel, Rectangle()
+ _eDocType, _rxControlModel, basegfx::B2DRange()
);
}
@@ -396,7 +397,7 @@ namespace svxform
//--------------------------------------------------------------------
sal_Int16 FormControlFactory::initializeControlModel( const DocumentType _eDocType, const Reference< XPropertySet >& _rxControlModel,
- const Rectangle& _rControlBoundRect )
+ const basegfx::B2DRange& _rControlBoundRange )
{
sal_Int16 nClassId = FormComponentType::CONTROL;
@@ -418,7 +419,7 @@ namespace svxform
case FormComponentType::SPINBUTTON:
{
sal_Int32 eOrientation = ScrollBarOrientation::HORIZONTAL;
- if ( !_rControlBoundRect.IsEmpty() && ( _rControlBoundRect.GetWidth() < _rControlBoundRect.GetHeight() ) )
+ if ( !_rControlBoundRange.isEmpty() && ( _rControlBoundRange.getWidth() < _rControlBoundRange.getHeight() ) )
eOrientation = ScrollBarOrientation::VERTICAL;
_rxControlModel->setPropertyValue( FM_PROP_ORIENTATION, makeAny( eOrientation ) );
}
@@ -427,7 +428,7 @@ namespace svxform
case FormComponentType::LISTBOX:
case FormComponentType::COMBOBOX:
{
- sal_Bool bDropDown = !_rControlBoundRect.IsEmpty() && ( _rControlBoundRect.GetWidth() >= 3 * _rControlBoundRect.GetHeight() );
+ sal_Bool bDropDown = !_rControlBoundRange.isEmpty() && ( _rControlBoundRange.getWidth() >= 3.0 * _rControlBoundRange.getHeight() );
if ( xPSI->hasPropertyByName( FM_PROP_DROPDOWN ) )
_rxControlModel->setPropertyValue( FM_PROP_DROPDOWN, makeAny( (sal_Bool)bDropDown ) );
_rxControlModel->setPropertyValue( FM_PROP_LINECOUNT, makeAny( sal_Int16( 20 ) ) );
@@ -439,8 +440,8 @@ namespace svxform
initializeTextFieldLineEnds( _rxControlModel );
lcl_initializeCharacterAttributes( _rxControlModel );
- if ( !_rControlBoundRect.IsEmpty()
- && !( _rControlBoundRect.GetWidth() > 4 * _rControlBoundRect.GetHeight() )
+ if ( !_rControlBoundRange.isEmpty()
+ && !( _rControlBoundRange.getWidth() > 4.0 * _rControlBoundRange.getHeight() )
)
{
if ( xPSI->hasPropertyByName( FM_PROP_MULTILINE ) )
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index ce7ec6ca9178..3a688a41ed68 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -549,7 +549,6 @@ IMPL_LINK( FormController, OnInvalidateFeatures, void*, /*_pNotInterestedInThisP
/*************************************************************************/
-DBG_NAME( FormController )
//------------------------------------------------------------------
FormController::FormController(const Reference< XMultiServiceFactory > & _rxORB )
:FormController_BASE( m_aMutex )
@@ -587,8 +586,6 @@ FormController::FormController(const Reference< XMultiServiceFactory > & _rxORB
,m_bAttemptedHandlerCreation( false )
,m_bSuspendFilterTextListening( false )
{
- DBG_CTOR( FormController, NULL );
-
::comphelper::increment(m_refCount);
{
{
@@ -644,8 +641,6 @@ FormController::~FormController()
}
DELETEZ( m_pControlBorderManager );
-
- DBG_DTOR( FormController, NULL );
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/form/formdispatchinterceptor.cxx b/svx/source/form/formdispatchinterceptor.cxx
index c35544a6d2fe..38be635b3c53 100644
--- a/svx/source/form/formdispatchinterceptor.cxx
+++ b/svx/source/form/formdispatchinterceptor.cxx
@@ -62,7 +62,6 @@ namespace svxform
//= DispatchInterceptionMultiplexer
//========================================================================
- DBG_NAME(DispatchInterceptionMultiplexer)
//------------------------------------------------------------------------
DispatchInterceptionMultiplexer::DispatchInterceptionMultiplexer(
const Reference< XDispatchProviderInterception >& _rxToIntercept, DispatchInterceptor* _pMaster )
@@ -73,8 +72,6 @@ namespace svxform
,m_bListening(sal_False)
,m_pMaster(_pMaster)
{
- DBG_CTOR(DispatchInterceptionMultiplexer,NULL);
-
::osl::MutexGuard aGuard( *m_pMutex );
::comphelper::increment(m_refCount);
if (_rxToIntercept.is())
@@ -97,8 +94,6 @@ namespace svxform
{
if (!rBHelper.bDisposed)
dispose();
-
- DBG_DTOR(DispatchInterceptionMultiplexer,NULL);
}
//------------------------------------------------------------------------------
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 357eeaefd83f..720bbfe4207f 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -28,7 +28,7 @@
#include <svx/fmmodel.hxx>
#include <svx/fmpage.hxx>
#include <svx/svdpagv.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include "fmhelp.hrc"
#include "fmexpl.hrc"
@@ -135,21 +135,24 @@ namespace svxform
MapModelToShape::const_iterator aPos = _rModelMap.find( _pEntry->GetElement() );
if ( _rModelMap.end() != aPos )
{ // there is a shape for this model ....
- bIsMarked = _pView->IsObjMarked( aPos->second );
- if ( !bIsMarked )
+ bIsMarked = _pView->IsObjMarked( *aPos->second );
+ if ( !bIsMarked && _pView->areSdrObjectsSelected())
{
// IsObjMarked does not step down grouped objects, so the sal_False we
// have is not really reliable (while a sal_True would have been)
// Okay, travel the mark list, and see if there is a group marked, and our shape
// is a part of this group
- sal_uInt32 nMarked = _pView->GetMarkedObjectList().GetMarkCount();
- for ( sal_uInt32 i = 0; (i<nMarked ) && !bIsMarked; ++i )
+ const SdrObjectVector aSelection(_pView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); (i < aSelection.size()) && !bIsMarked; ++i )
{
- SdrMark* pMark = _pView->GetMarkedObjectList().GetMark( i );
- SdrObject* pObj = pMark ? pMark->GetMarkedSdrObj() : NULL;
- if ( pObj && pObj->IsGroupObject() )
- { // the i-th marked shape is a group shape
+ SdrObject* pObj = aSelection[i];
+
+ if ( pObj->getChildrenOfSdrObject() )
+ {
+ // the i-th marked shape is a group shape
SdrObjListIter aIter( *pObj );
+
while ( aIter.IsMore() )
{
if ( aIter.Next() == aPos->second )
@@ -642,71 +645,91 @@ namespace svxform
void NavigatorTree::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTree::Notify" );
- if( rHint.ISA(FmNavRemovedHint) )
+ const FmNavRemovedHint* pFmNavRemovedHint = dynamic_cast< const FmNavRemovedHint* >(&rHint);
+
+ if( pFmNavRemovedHint )
{
- FmNavRemovedHint* pRemovedHint = (FmNavRemovedHint*)&rHint;
- FmEntryData* pEntryData = pRemovedHint->GetEntryData();
+ FmEntryData* pEntryData = pFmNavRemovedHint->GetEntryData();
Remove( pEntryData );
}
-
- else if( rHint.ISA(FmNavInsertedHint) )
+ else
{
- FmNavInsertedHint* pInsertedHint = (FmNavInsertedHint*)&rHint;
- FmEntryData* pEntryData = pInsertedHint->GetEntryData();
- sal_uInt32 nRelPos = pInsertedHint->GetRelPos();
- Insert( pEntryData, nRelPos );
- }
+ const FmNavInsertedHint* pFmNavInsertedHint = dynamic_cast< const FmNavInsertedHint* >(&rHint);
- else if( rHint.ISA(FmNavModelReplacedHint) )
- {
- FmEntryData* pData = ((FmNavModelReplacedHint*)&rHint)->GetEntryData();
- SvLBoxEntry* pEntry = FindEntry( pData );
- if (pEntry)
- { // das Image neu setzen
- SetCollapsedEntryBmp( pEntry, pData->GetNormalImage(), BMP_COLOR_NORMAL );
- SetExpandedEntryBmp( pEntry, pData->GetNormalImage(), BMP_COLOR_NORMAL );
-
- SetCollapsedEntryBmp( pEntry, pData->GetHCImage(), BMP_COLOR_HIGHCONTRAST );
- SetExpandedEntryBmp( pEntry, pData->GetHCImage(), BMP_COLOR_HIGHCONTRAST );
+ if( pFmNavInsertedHint )
+ {
+ FmEntryData* pEntryData = pFmNavInsertedHint->GetEntryData();
+ sal_uInt32 nRelPos = pFmNavInsertedHint->GetRelPos();
+ Insert( pEntryData, nRelPos );
}
- }
+ else
+ {
+ const FmNavModelReplacedHint* pFmNavModelReplacedHint = dynamic_cast< const FmNavModelReplacedHint* >(&rHint);
- else if( rHint.ISA(FmNavNameChangedHint) )
- {
- FmNavNameChangedHint* pNameChangedHint = (FmNavNameChangedHint*)&rHint;
- SvLBoxEntry* pEntry = FindEntry( pNameChangedHint->GetEntryData() );
- SetEntryText( pEntry, pNameChangedHint->GetNewName() );
- }
+ if( pFmNavModelReplacedHint )
+ {
+ FmEntryData* pData = pFmNavModelReplacedHint->GetEntryData();
+ SvLBoxEntry* pEntry = FindEntry( pData );
- else if( rHint.ISA(FmNavClearedHint) )
- {
- SvTreeListBox::Clear();
+ if (pEntry)
+ { // das Image neu setzen
+ SetCollapsedEntryBmp( pEntry, pData->GetNormalImage(), BMP_COLOR_NORMAL );
+ SetExpandedEntryBmp( pEntry, pData->GetNormalImage(), BMP_COLOR_NORMAL );
- //////////////////////////////////////////////////////////////////////
- // Default-Eintrag "Formulare"
- Image aRootImage( m_aNavigatorImages.GetImage( RID_SVXIMG_FORMS ) );
- m_pRootEntry = InsertEntry( SVX_RES(RID_STR_FORMS), aRootImage, aRootImage,
- NULL, sal_False, 0, NULL );
+ SetCollapsedEntryBmp( pEntry, pData->GetHCImage(), BMP_COLOR_HIGHCONTRAST );
+ SetExpandedEntryBmp( pEntry, pData->GetHCImage(), BMP_COLOR_HIGHCONTRAST );
+ }
+ }
+ else
+ {
+ const FmNavNameChangedHint* pFmNavNameChangedHint = dynamic_cast< const FmNavNameChangedHint* >(&rHint);
- if ( m_pRootEntry )
- {
- Image aHCRootImage( m_aNavigatorImagesHC.GetImage( RID_SVXIMG_FORMS ) );
- SetExpandedEntryBmp( m_pRootEntry, aHCRootImage, BMP_COLOR_HIGHCONTRAST );
- SetCollapsedEntryBmp( m_pRootEntry, aHCRootImage, BMP_COLOR_HIGHCONTRAST );
+ if( pFmNavNameChangedHint )
+ {
+ SvLBoxEntry* pEntry = FindEntry( pFmNavNameChangedHint->GetEntryData() );
+ SetEntryText( pEntry, pFmNavNameChangedHint->GetNewName() );
+ }
+ else
+ {
+ const FmNavClearedHint* pFmNavClearedHint = dynamic_cast< const FmNavClearedHint* >(&rHint);
+
+ if( pFmNavClearedHint )
+ {
+ SvTreeListBox::Clear();
+
+ //////////////////////////////////////////////////////////////////////
+ // Default-Eintrag "Formulare"
+ Image aRootImage( m_aNavigatorImages.GetImage( RID_SVXIMG_FORMS ) );
+ m_pRootEntry = InsertEntry( SVX_RES(RID_STR_FORMS), aRootImage, aRootImage,
+ NULL, sal_False, 0, NULL );
+
+ if ( m_pRootEntry )
+ {
+ Image aHCRootImage( m_aNavigatorImagesHC.GetImage( RID_SVXIMG_FORMS ) );
+ SetExpandedEntryBmp( m_pRootEntry, aHCRootImage, BMP_COLOR_HIGHCONTRAST );
+ SetCollapsedEntryBmp( m_pRootEntry, aHCRootImage, BMP_COLOR_HIGHCONTRAST );
+ }
+ }
+ else if (!m_bMarkingObjects )
+ {
+ FmNavRequestSelectHint* pFmNavRequestSelectHint = dynamic_cast< FmNavRequestSelectHint* >(& const_cast< SfxHint& >(rHint));
+
+ if( pFmNavRequestSelectHint )
+ { // wenn m_bMarkingObjects sal_True ist, markiere ich gerade selber Objekte, und da der ganze Mechanismus dahinter synchron ist,
+ // ist das genau der Hint, der durch mein Markieren ausgeloest wird, also kann ich ihn ignorieren
+ FmEntryDataArray& arredToSelect = pFmNavRequestSelectHint->GetItems();
+ SynchronizeSelection(arredToSelect);
+
+ if (pFmNavRequestSelectHint->IsMixedSelection())
+ // in diesem Fall habe ich alles deselektiert, obwohl die View u.U. eine gemischte Markierung hatte
+ // ich muss also im naechsten Select den Navigator an die View anpassen
+ m_bPrevSelectionMixed = sal_True;
+ }
+ }
+ }
+ }
}
}
- else if (!m_bMarkingObjects && rHint.ISA(FmNavRequestSelectHint))
- { // wenn m_bMarkingObjects sal_True ist, markiere ich gerade selber Objekte, und da der ganze Mechanismus dahinter synchron ist,
- // ist das genau der Hint, der durch mein Markieren ausgeloest wird, also kann ich ihn ignorieren
- FmNavRequestSelectHint* pershHint = (FmNavRequestSelectHint*)&rHint;
- FmEntryDataArray& arredToSelect = pershHint->GetItems();
- SynchronizeSelection(arredToSelect);
-
- if (pershHint->IsMixedSelection())
- // in diesem Fall habe ich alles deselektiert, obwohl die View u.U. eine gemischte Markierung hatte
- // ich muss also im naechsten Select den Navigator an die View anpassen
- m_bPrevSelectionMixed = sal_True;
- }
}
//------------------------------------------------------------------------
@@ -795,7 +818,7 @@ namespace svxform
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTree::IsFormEntry" );
FmEntryData* pEntryData = (FmEntryData*)pEntry->GetUserData();
- return !pEntryData || pEntryData->ISA(FmFormData);
+ return !pEntryData || dynamic_cast< FmFormData* >(pEntryData);
}
//------------------------------------------------------------------------
@@ -803,7 +826,7 @@ namespace svxform
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTree::IsFormComponentEntry" );
FmEntryData* pEntryData = (FmEntryData*)pEntry->GetUserData();
- return pEntryData && pEntryData->ISA(FmControlData);
+ return pEntryData && dynamic_cast< FmControlData* >(pEntryData);
}
//------------------------------------------------------------------------
@@ -1185,7 +1208,8 @@ namespace svxform
Reference< XIndexContainer > xContainer(xCurrentChild->getParent(), UNO_QUERY);
FmFormData* pCurrentParentUserData = (FmFormData*)pCurrentUserData->GetParent();
- DBG_ASSERT(pCurrentParentUserData == NULL || pCurrentParentUserData->ISA(FmFormData), "NavigatorTree::implExecuteDataTransfer: ungueltiges Parent");
+ DBG_ASSERT(!pCurrentParentUserData || dynamic_cast< FmFormData* >(pCurrentParentUserData),
+ "NavigatorTree::implExecuteDataTransfer: ungueltiges Parent");
// beim Vater austragen
if (pCurrentParentUserData)
@@ -1288,7 +1312,7 @@ namespace svxform
// in addition, with the move of controls such things as "the current form" may have changed - force the shell
// to update itself accordingly
if( pFormShell && pFormShell->GetImpl() && pFormShell->GetFormView() )
- pFormShell->GetImpl()->DetermineSelection( pFormShell->GetFormView()->GetMarkedObjectList() );
+ pFormShell->GetImpl()->DetermineSelection( pFormShell->GetFormView()->getSelectedSdrObjectVectorFromSdrMarkView() );
if ( m_aControlExchange.isClipboardOwner() && ( DND_ACTION_MOVE == _nAction ) )
m_aControlExchange->clear();
@@ -1530,24 +1554,27 @@ namespace svxform
// Namen setzen
FmFormView* pFormView = GetNavModel()->GetFormShell()->GetFormView();
SdrPageView* pPageView = pFormView->GetSdrPageView();
- FmFormPage* pPage = (FmFormPage*)pPageView->GetPage();
- ::rtl::OUString sName = pPage->GetImpl().setUniqueName( xNewComponent, xParentForm );
+ if(pPageView)
+ {
+ FmFormPage* pPage = dynamic_cast< FmFormPage* >(&pPageView->getSdrPageFromSdrPageView());
+ ::rtl::OUString sName = pPage->GetImpl().setUniqueName( xNewComponent, xParentForm );
- pNewFormControlData->SetText( sName );
+ pNewFormControlData->SetText( sName );
- //////////////////////////////////////////////////////////////////////
- // FormComponent einfuegen
- GetNavModel()->Insert( pNewFormControlData, LIST_APPEND, sal_True );
- GetNavModel()->SetModified();
-
- if (bEditName)
- {
//////////////////////////////////////////////////////////////////////
- // In EditMode schalten
- SvLBoxEntry* pNewEntry = FindEntry( pNewFormControlData );
- Select( pNewEntry, sal_True );
- EditEntry( pNewEntry );
+ // FormComponent einfuegen
+ GetNavModel()->Insert( pNewFormControlData, LIST_APPEND, sal_True );
+ GetNavModel()->SetModified();
+
+ if (bEditName)
+ {
+ //////////////////////////////////////////////////////////////////////
+ // In EditMode schalten
+ SvLBoxEntry* pNewEntry = FindEntry( pNewFormControlData );
+ Select( pNewEntry, sal_True );
+ EditEntry( pNewEntry );
+ }
}
return pNewFormControlData;
@@ -1563,10 +1590,10 @@ namespace svxform
//////////////////////////////////////////////////////////////////////
// BasisNamen erzeugen
UniString aBaseName;
- if( pEntryData->ISA(FmFormData) )
+ if( dynamic_cast< FmFormData* >(pEntryData) )
aBaseName = SVX_RES( RID_STR_STDFORMNAME );
- else if( pEntryData->ISA(FmControlData) )
+ else if( dynamic_cast< FmControlData* >(pEntryData) )
aBaseName = SVX_RES( RID_STR_CONTROL );
//////////////////////////////////////////////////////////////////////
@@ -1781,7 +1808,7 @@ namespace svxform
// und dann meine Form und mein SelObject
if ( bSetSelectionAsMarkList )
- pFormShell->GetImpl()->setCurrentSelectionFromMark( pFormShell->GetFormView()->GetMarkedObjectList() );
+ pFormShell->GetImpl()->setCurrentSelectionFromSdrObjectVector( pFormShell->GetFormView()->getSelectedSdrObjectVectorFromSdrMarkView() );
else
pFormShell->GetImpl()->setCurrentSelection( aSelection );
@@ -1824,7 +1851,7 @@ namespace svxform
// see below for why we need this mapping from models to shapes
FmFormView* pFormView = pFormShell->GetFormView();
SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : NULL;
- SdrPage* pPage = pPageView ? pPageView->GetPage() : NULL;
+ SdrPage* pPage = pPageView ? &pPageView->getSdrPageFromSdrPageView() : NULL;
DBG_ASSERT( pPage, "NavigatorTree::DeleteSelection: invalid form page!" );
MapModelToShape aModelShapes;
@@ -1845,7 +1872,7 @@ namespace svxform
FmEntryData* pCurrent = (FmEntryData*)(m_arrCurrentSelection.GetObject(i - 1)->GetUserData());
// eine Form ?
- sal_Bool bIsForm = pCurrent->ISA(FmFormData);
+ sal_Bool bIsForm = 0 != dynamic_cast< FmFormData* >(pCurrent);
// da ich das Loeschen im folgenden der View ueberlasse und dabei auf deren MarkList aufbaue, im Normalfall aber bei
// einem makierten Formular nur die direkt, nicht die indirekt abhaengigen Controls markiert werden, muss ich das hier
@@ -1918,9 +1945,11 @@ namespace svxform
// noch ein kleines Problem, bevor ich das ganz loesche : wenn es eine Form ist und die Shell diese als CurrentObject
// kennt, dann muss ich ihr das natuerlich ausreden
- if (pCurrent->ISA(FmFormData))
+ FmFormData* pFmFormData = dynamic_cast< FmFormData* >(pCurrent);
+
+ if (pFmFormData)
{
- Reference< XForm > xCurrentForm( static_cast< FmFormData* >( pCurrent )->GetFormIface() );
+ Reference< XForm > xCurrentForm( pFmFormData->GetFormIface() );
if ( pFormShell->GetImpl()->getCurrentForm() == xCurrentForm ) // die Shell kennt die zu loeschende Form ?
pFormShell->GetImpl()->forgetCurrentForm(); // -> wegnehmen ...
}
@@ -2027,7 +2056,8 @@ namespace svxform
{ // der Entry ist schon selektiert, steht aber auch in der SelectList -> er kann aus letzterer
// raus
arredToSelect.Remove(nPosition, 1);
- } else
+ }
+ else
{ // der Entry ist selektiert, aber steht nicht in der SelectList -> Selektion rausnehmen
Select(pSelection, sal_False);
// und sichtbar machen (kann ja sein, dass das die einzige Modifikation ist, die ich hier in dem
@@ -2079,7 +2109,7 @@ namespace svxform
FmFormView* pFormView = pFormShell->GetFormView();
if (!pFormView) return;
- GetNavModel()->BroadcastMarkedObjects(pFormView->GetMarkedObjectList());
+ GetNavModel()->BroadcastMarkedObjects(pFormView->getSelectedSdrObjectVectorFromSdrMarkView());
}
//------------------------------------------------------------------------
@@ -2140,7 +2170,7 @@ namespace svxform
// aber der Mechanismus greift zum Beispiel nicht, wenn die Form leer ist)
if ((m_arrCurrentSelection.Count() == 1) && (m_nFormsSelected == 1))
{
- FmFormData* pSingleSelectionData = PTR_CAST( FmFormData, static_cast< FmEntryData* >( FirstSelected()->GetUserData() ) );
+ FmFormData* pSingleSelectionData = dynamic_cast< FmFormData* >( static_cast< FmEntryData* >( FirstSelected()->GetUserData() ) );
DBG_ASSERT( pSingleSelectionData, "NavigatorTree::SynchronizeMarkList: invalid selected form!" );
if ( pSingleSelectionData )
{
@@ -2184,7 +2214,7 @@ namespace svxform
if( !pFormShell )
return;
FmFormView* pFormView = pFormShell->GetFormView();
- pFormView->UnMarkAll();
+ pFormView->UnmarkAllObj();
}
//------------------------------------------------------------------------
void NavigatorTree::MarkViewObj(FmFormData* pFormData, sal_Bool bMark, sal_Bool bDeep )
@@ -2202,10 +2232,12 @@ namespace svxform
// In der Page das entsprechende SdrObj finden und selektieren
FmFormView* pFormView = pFormShell->GetFormView();
SdrPageView* pPageView = pFormView->GetSdrPageView();
- SdrPage* pPage = pPageView->GetPage();
- //FmFormPage* pFormPage = dynamic_cast< FmFormPage* >( pPage );
+ if(pPageView)
+ {
+ SdrPage* pPage = &pPageView->getSdrPageFromSdrPageView();
SdrObjListIter aIter( *pPage );
+
while ( aIter.IsMore() )
{
SdrObject* pSdrObject = aIter.Next();
@@ -2214,44 +2246,54 @@ namespace svxform
continue;
Reference< XFormComponent > xControlModel( pFormObject->GetUnoControlModel(),UNO_QUERY );
- if ( xControlModel.is() && aObjects.find(xControlModel) != aObjects.end() && bMark != pFormView->IsObjMarked( pSdrObject ) )
+ if ( xControlModel.is() && aObjects.find(xControlModel) != aObjects.end() && bMark != (sal_Bool)pFormView->IsObjMarked( *pSdrObject ) )
{
// unfortunately, the writer doesn't like marking an already-marked object, again, so reset the mark first
- pFormView->MarkObj( pSdrObject, pPageView, !bMark, sal_False );
+ pFormView->MarkObj( *pSdrObject, !bMark );
}
} // while ( aIter.IsMore() )
if ( bMark )
{
// make the mark visible
- ::Rectangle aMarkRect( pFormView->GetAllMarkedRect());
+ const basegfx::B2DRange aMarkRange( pFormView->getMarkedObjectSnapRange());
+
for ( sal_uInt32 i = 0; i < pFormView->PaintWindowCount(); ++i )
{
SdrPaintWindow* pPaintWindow = pFormView->GetPaintWindow( i );
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
- if ( ( OUTDEV_WINDOW == rOutDev.GetOutDevType() ) && !aMarkRect.IsEmpty() )
+
+ if ( ( OUTDEV_WINDOW == rOutDev.GetOutDevType() ) && !aMarkRange.isEmpty() )
{
- pFormView->MakeVisible( aMarkRect, (Window&)rOutDev );
+ pFormView->MakeVisibleAtView( aMarkRange, (Window&)rOutDev );
}
} // for ( sal_uInt32 i = 0; i < pFormView->PaintWindowCount(); ++i )
}
}
+ }
//------------------------------------------------------------------------
void NavigatorTree::CollectObjects(FmFormData* pFormData, sal_Bool bDeep, ::std::set< Reference< XFormComponent > >& _rObjects)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTree::MarkViewObjects" );
FmEntryDataList* pChildList = pFormData->GetChildList();
- FmEntryData* pEntryData;
- FmControlData* pControlData;
+
for( sal_uInt32 i=0; i < pChildList->Count(); ++i )
{
- pEntryData = pChildList->GetObject(i);
- if( pEntryData->ISA(FmControlData) )
+ FmEntryData* pEntryData = pChildList->GetObject(i);
+ FmControlData* pControlData = dynamic_cast< FmControlData* >(pEntryData);
+
+ if( pControlData )
{
- pControlData = (FmControlData*)pEntryData;
_rObjects.insert(pControlData->GetFormComponent());
- } // if( pEntryData->ISA(FmControlData) )
- else if (bDeep && (pEntryData->ISA(FmFormData)))
- CollectObjects((FmFormData*)pEntryData,bDeep,_rObjects);
+ } // if( dynamic_cast< FmControlData* >(pEntryData) )
+ else if (bDeep)
+ {
+ FmFormData* pFmFormData = dynamic_cast< FmFormData* >(pEntryData);
+
+ if (pFmFormData)
+ {
+ CollectObjects(pFmFormData,bDeep,_rObjects);
+ }
+ }
} // for( sal_uInt32 i=0; i<pChildList->Count(); i++ )
}
//------------------------------------------------------------------------
@@ -2269,45 +2311,49 @@ namespace svxform
FmFormView* pFormView = pFormShell->GetFormView();
Reference< XFormComponent > xFormComponent( pControlData->GetFormComponent());
SdrPageView* pPageView = pFormView->GetSdrPageView();
- SdrPage* pPage = pPageView->GetPage();
- bool bPaint = false;
- SdrObjListIter aIter( *pPage );
- while ( aIter.IsMore() )
+ if(pPageView)
{
- SdrObject* pSdrObject = aIter.Next();
- FmFormObj* pFormObject = FmFormObj::GetFormObject( pSdrObject );
- if ( !pFormObject )
- continue;
+ SdrPage* pPage = &pPageView->getSdrPageFromSdrPageView();
+ bool bPaint = false;
+ SdrObjListIter aIter( *pPage );
+ while ( aIter.IsMore() )
+ {
+ SdrObject* pSdrObject = aIter.Next();
+ FmFormObj* pFormObject = FmFormObj::GetFormObject( pSdrObject );
+ if ( !pFormObject )
+ continue;
- Reference< XInterface > xControlModel( pFormObject->GetUnoControlModel() );
- if ( xControlModel != xFormComponent )
- continue;
+ Reference< XInterface > xControlModel( pFormObject->GetUnoControlModel() );
+ if ( xControlModel != xFormComponent )
+ continue;
- // mark the object
- if ( bMark != pFormView->IsObjMarked( pSdrObject ) )
- // unfortunately, the writer doesn't like marking an already-marked object, again, so reset the mark first
- pFormView->MarkObj( pSdrObject, pPageView, !bMark, sal_False );
+ // mark the object
+ if ( bMark != (sal_Bool)pFormView->IsObjMarked( *pSdrObject ) )
+ // unfortunately, the writer doesn't like marking an already-marked object, again, so reset the mark first
+ pFormView->MarkObj( *pSdrObject, !bMark );
- if ( !bMarkHandles || !bMark )
- continue;
+ if ( !bMarkHandles || !bMark )
+ continue;
- bPaint = true;
+ bPaint = true;
- } // while ( aIter.IsMore() )
- if ( bPaint )
- {
- // make the mark visible
- ::Rectangle aMarkRect( pFormView->GetAllMarkedRect());
- for ( sal_uInt32 i = 0; i < pFormView->PaintWindowCount(); ++i )
+ } // while ( aIter.IsMore() )
+ if ( bPaint )
{
- SdrPaintWindow* pPaintWindow = pFormView->GetPaintWindow( i );
- OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
- if ( OUTDEV_WINDOW == rOutDev.GetOutDevType() )
+ // make the mark visible
+ const basegfx::B2DRange aMarkRange( pFormView->getMarkedObjectSnapRange());
+
+ for ( sal_uInt32 i = 0; i < pFormView->PaintWindowCount(); ++i )
{
- pFormView->MakeVisible( aMarkRect, (Window&)rOutDev );
- }
- } // for ( sal_uInt32 i = 0; i < pFormView->PaintWindowCount(); ++i )
+ SdrPaintWindow* pPaintWindow = pFormView->GetPaintWindow( i );
+ OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
+ if ( OUTDEV_WINDOW == rOutDev.GetOutDevType() )
+ {
+ pFormView->MakeVisibleAtView( aMarkRange, (Window&)rOutDev );
+ }
+ } // for ( sal_uInt32 i = 0; i < pFormView->PaintWindowCount(); ++i )
+ }
}
}
diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx
index 47f7a009b773..c154f00e92f8 100644
--- a/svx/source/form/navigatortreemodel.cxx
+++ b/svx/source/form/navigatortreemodel.cxx
@@ -28,7 +28,7 @@
#include <svx/fmmodel.hxx>
#include <svx/fmpage.hxx>
#include <svx/fmglob.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdpagv.hxx>
@@ -162,7 +162,7 @@ namespace svxform
FmEntryData* pEntryData = m_pNavModel->FindData(xReplaced, m_pNavModel->GetRootList(), sal_True);
if (pEntryData)
{
- if (pEntryData->ISA(FmControlData))
+ if (dynamic_cast< FmControlData* >(pEntryData))
{
Reference< XFormComponent > xComp;
evt.Element >>= xComp;
@@ -170,7 +170,7 @@ namespace svxform
// an einer FmControlData sollte eine XFormComponent haengen
m_pNavModel->ReplaceFormComponent(xReplaced, xComp);
}
- else if (pEntryData->ISA(FmFormData))
+ else if (dynamic_cast< FmFormData* >(pEntryData))
{
DBG_ERROR("replacing forms not implemented yet !");
}
@@ -306,7 +306,7 @@ namespace svxform
if (bAlterModel)
{
XubString aStr;
- if (pEntry->ISA(FmFormData))
+ if (dynamic_cast< FmFormData* >(pEntry))
aStr = SVX_RES(RID_STR_FORM);
else
aStr = SVX_RES(RID_STR_CONTROL);
@@ -371,7 +371,7 @@ namespace svxform
//////////////////////////////////////////////////////////////////////
// Daten aus Model entfernen
- if (pEntry->ISA(FmFormData))
+ if (dynamic_cast< FmFormData* >(pEntry))
{
Reference< XContainer > xContainer(xElement, UNO_QUERY);
if (xContainer.is())
@@ -413,7 +413,7 @@ namespace svxform
if (bAlterModel)
{
XubString aStr;
- if (pEntry->ISA(FmFormData))
+ if (dynamic_cast< FmFormData* >(pEntry))
aStr = SVX_RES(RID_STR_FORM);
else
aStr = SVX_RES(RID_STR_CONTROL);
@@ -427,11 +427,21 @@ namespace svxform
}
// jetzt die eigentliche Entfernung der Daten aus dem Model
- if (pEntry->ISA(FmFormData))
- RemoveForm((FmFormData*)pEntry);
+ FmFormData* pFmFormData = dynamic_cast< FmFormData* >(pEntry);
+
+ if (pFmFormData)
+ {
+ RemoveForm( pFmFormData );
+ }
else
- RemoveFormComponent((FmControlData*)pEntry);
+ {
+ FmControlData* pFmControlData = dynamic_cast< FmControlData* >(pEntry);
+ if(pFmControlData)
+ {
+ RemoveFormComponent( pFmControlData );
+ }
+ }
if (bAlterModel)
{
@@ -501,10 +511,21 @@ namespace svxform
//////////////////////////////////////////////////////////////////////
// Child ist Form -> rekursiver Aufruf
- if( pEntryData->ISA(FmFormData) )
- RemoveForm( (FmFormData*)pEntryData);
- else if( pEntryData->ISA(FmControlData) )
- RemoveFormComponent((FmControlData*) pEntryData);
+ FmFormData* pFmFormData = dynamic_cast< FmFormData* >(pEntryData);
+
+ if( pFmFormData )
+ {
+ RemoveForm( pFmFormData );
+ }
+ else
+ {
+ FmControlData* pFmControlData = dynamic_cast< FmControlData* >(pEntryData);
+
+ if( pFmControlData )
+ {
+ RemoveFormComponent( pFmControlData );
+ }
+ }
}
//////////////////////////////////////////////////////////////////////
@@ -546,8 +567,10 @@ namespace svxform
for( sal_uInt32 i=pChildList->Count(); i>0; i-- )
{
pChildData = pChildList->GetObject(i-1);
- if( pChildData->ISA(FmFormData) )
- ClearBranch( (FmFormData*)pChildData );
+ FmFormData* pFmFormData = dynamic_cast< FmFormData* >(pChildData);
+
+ if( pFmFormData )
+ ClearBranch( pFmFormData );
pChildList->Remove( pChildData );
}
@@ -674,7 +697,7 @@ namespace svxform
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTreeModel::ReplaceFormComponent" );
FmEntryData* pData = FindData(xOld, GetRootList(), sal_True);
- DBG_ASSERT(pData && pData->ISA(FmControlData), "NavigatorTreeModel::ReplaceFormComponent : invalid argument !");
+ DBG_ASSERT(pData && dynamic_cast< FmControlData* >(pData), "NavigatorTreeModel::ReplaceFormComponent : invalid argument !");
((FmControlData*)pData)->ModelReplaced( xNew, m_aNormalImages, m_aHCImages );
FmNavModelReplacedHint aReplacedHint( pData );
@@ -725,9 +748,11 @@ namespace svxform
if (rText == aEntryText)
return pEntryData;
- if( bRecurs && pEntryData->ISA(FmFormData) )
+ FmFormData* pFmFormData = dynamic_cast< FmFormData* >(pEntryData);
+
+ if( bRecurs && pFmFormData )
{
- pChildData = FindData( rText, (FmFormData*)pEntryData );
+ pChildData = FindData( rText, pFmFormData );
if( pChildData )
return pChildData;
}
@@ -740,30 +765,33 @@ namespace svxform
void NavigatorTreeModel::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTreeModel::Notify" );
- if( rHint.ISA(SdrHint) )
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+ const FmNavViewMarksChanged* pFmNavViewMarksChanged = dynamic_cast< const FmNavViewMarksChanged* >(&rHint);
+
+ if(pSdrHint)
{
- SdrHint* pSdrHint = (SdrHint*)&rHint;
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
case HINT_OBJINSERTED:
- InsertSdrObj(pSdrHint->GetObject());
+ InsertSdrObj(pSdrHint->GetSdrHintObject());
break;
case HINT_OBJREMOVED:
- RemoveSdrObj(pSdrHint->GetObject());
+ RemoveSdrObj(pSdrHint->GetSdrHintObject());
break;
default:
break;
}
}
// hat sich die shell verabschiedet?
- else if ( rHint.ISA(SfxSimpleHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
+ else if ( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
+ {
UpdateContent((FmFormShell*)NULL);
-
+ }
// hat sich die Markierung der Controls veraendert ?
- else if (rHint.ISA(FmNavViewMarksChanged))
+ else if (pFmNavViewMarksChanged)
{
- FmNavViewMarksChanged* pvmcHint = (FmNavViewMarksChanged*)&rHint;
- BroadcastMarkedObjects( pvmcHint->GetAffectedView()->GetMarkedObjectList() );
+ BroadcastMarkedObjects( pFmNavViewMarksChanged->GetAffectedView()->getSelectedSdrObjectVectorFromSdrMarkView() );
}
}
@@ -787,9 +815,9 @@ namespace svxform
DBG_UNHANDLED_EXCEPTION();
}
}
- else if ( pObj->IsGroupObject() )
+ else if ( pObj->getChildrenOfSdrObject() )
{
- SdrObjListIter aIter( *pObj->GetSubList() );
+ SdrObjListIter aIter( *pObj->getChildrenOfSdrObject() );
while ( aIter.IsMore() )
InsertSdrObj( aIter.Next() );
}
@@ -814,9 +842,9 @@ namespace svxform
DBG_UNHANDLED_EXCEPTION();
}
}
- else if ( pObj->IsGroupObject() )
+ else if ( pObj->getChildrenOfSdrObject() )
{
- SdrObjListIter aIter( *pObj->GetSubList() );
+ SdrObjListIter aIter( *pObj->getChildrenOfSdrObject() );
while ( aIter.IsMore() )
RemoveSdrObj( aIter.Next() );
}
@@ -825,9 +853,11 @@ namespace svxform
sal_Bool NavigatorTreeModel::InsertFormComponent(FmNavRequestSelectHint& rHint, SdrObject* pObject)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTreeModel::InsertFormComponent" );
- if ( pObject->ISA(SdrObjGroup) )
+ SdrObjGroup* pSdrObjGroup = dynamic_cast< SdrObjGroup* >(pObject);
+
+ if ( pSdrObjGroup )
{ // rekursiv absteigen
- const SdrObjList *pChilds = ((SdrObjGroup*)pObject)->GetSubList();
+ const SdrObjList *pChilds = pSdrObjGroup->getChildrenOfSdrObject();
for ( sal_uInt16 i=0; i<pChilds->GetObjCount(); ++i )
{
SdrObject* pCurrent = pChilds->GetObj(i);
@@ -861,16 +891,16 @@ namespace svxform
return sal_True;
}
- void NavigatorTreeModel::BroadcastMarkedObjects(const SdrMarkList& mlMarked)
+ void NavigatorTreeModel::BroadcastMarkedObjects(const SdrObjectVector& mlMarked)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTreeModel::BroadcastMarkedObjects" );
// gehen wir durch alle markierten Objekte und suchen wir die raus, mit denen ich was anfangen kann
FmNavRequestSelectHint rshRequestSelection;
sal_Bool bIsMixedSelection = sal_False;
- for (sal_uLong i=0; (i<mlMarked.GetMarkCount()) && !bIsMixedSelection; i++)
+ for (sal_uInt32 i(0); (i < mlMarked.size()) && !bIsMixedSelection; i++)
{
- SdrObject* pobjCurrent = mlMarked.GetMark(i)->GetMarkedSdrObj();
+ SdrObject* pobjCurrent = mlMarked[i];
bIsMixedSelection |= !InsertFormComponent(rshRequestSelection, pobjCurrent);
// bei einem Nicht-Form-Control liefert InsertFormComponent sal_False !
}
@@ -904,7 +934,7 @@ namespace svxform
FmFormView* pFormView = m_pFormShell->GetFormView();
DBG_ASSERT(pFormView != NULL, "NavigatorTreeModel::UpdateContent : keine FormView");
- BroadcastMarkedObjects(pFormView->GetMarkedObjectList());
+ BroadcastMarkedObjects(pFormView->getSelectedSdrObjectVectorFromSdrMarkView());
}
}
@@ -968,7 +998,8 @@ namespace svxform
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTreeModel::CheckEntry" );
//////////////////////////////////////////////////////////////////////
// Nur Forms duerfen auf Doppeldeutigkeit untersucht werden
- if( !pEntryData->ISA(FmFormData) ) return sal_True;
+ if( !dynamic_cast< FmFormData* >(pEntryData) )
+ return sal_True;
//////////////////////////////////////////////////////////////////////
// ChildListe des Parents holen
@@ -1020,17 +1051,18 @@ namespace svxform
//////////////////////////////////////////////////////////////////////
// PropertySet besorgen
Reference< XFormComponent > xFormComponent;
+ FmFormData* pFormData = dynamic_cast< FmFormData* >(pEntryData);
- if( pEntryData->ISA(FmFormData) )
+ if( pFormData )
{
- FmFormData* pFormData = (FmFormData*)pEntryData;
Reference< XForm > xForm( pFormData->GetFormIface());
xFormComponent = Reference< XFormComponent > (xForm, UNO_QUERY);
}
- if( pEntryData->ISA(FmControlData) )
+ FmControlData* pControlData = dynamic_cast< FmControlData* >(pEntryData);
+
+ if( pControlData )
{
- FmControlData* pControlData = (FmControlData*)pEntryData;
xFormComponent = pControlData->GetFormComponent();
}
@@ -1084,12 +1116,17 @@ namespace svxform
FmFormView* pFormView = m_pFormShell->GetFormView();
SdrPageView* pPageView = pFormView->GetSdrPageView();
- SdrPage* pPage = pPageView->GetPage();
- SdrObjListIter aIter( *pPage );
+ if(pPageView)
+ {
+ SdrPage& rPage = pPageView->getSdrPageFromSdrPageView();
+ SdrObjListIter aIter( rPage );
return Search(aIter, xFormComponent);
}
+ return 0;
+ }
+
//------------------------------------------------------------------
SdrObject* NavigatorTreeModel::Search(SdrObjListIter& rIter, const Reference< XFormComponent > & xComp)
{
@@ -1104,9 +1141,9 @@ namespace svxform
if ( xFormViewControl == xComp )
return pObj;
}
- else if ( pObj->IsGroupObject() )
+ else if ( pObj->getChildrenOfSdrObject() )
{
- SdrObjListIter aIter( *pObj->GetSubList() );
+ SdrObjListIter aIter( *pObj->getChildrenOfSdrObject() );
pObj = Search( aIter, xComp );
if ( pObj )
return pObj;
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index f24f85f43d9c..c3c33e75ab02 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -130,13 +130,11 @@ void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::X
//==================================================================
// class FmFieldWinListBox
//==================================================================
-DBG_NAME(FmFieldWinListBox)
//------------------------------------------------------------------------------
FmFieldWinListBox::FmFieldWinListBox( FmFieldWin* pParent )
:SvTreeListBox( pParent, WB_HASBUTTONS|WB_BORDER )
,pTabWin( pParent )
{
- DBG_CTOR(FmFieldWinListBox,NULL);
SetHelpId( HID_FIELD_SEL );
SetHighlightRange( );
@@ -145,7 +143,6 @@ FmFieldWinListBox::FmFieldWinListBox( FmFieldWin* pParent )
//------------------------------------------------------------------------------
FmFieldWinListBox::~FmFieldWinListBox()
{
- DBG_DTOR(FmFieldWinListBox,NULL);
}
//------------------------------------------------------------------------------
@@ -199,23 +196,19 @@ void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPi
//========================================================================
// class FmFieldWinData
//========================================================================
-DBG_NAME(FmFieldWinData);
//-----------------------------------------------------------------------
FmFieldWinData::FmFieldWinData()
{
- DBG_CTOR(FmFieldWinData,NULL);
}
//-----------------------------------------------------------------------
FmFieldWinData::~FmFieldWinData()
{
- DBG_DTOR(FmFieldWinData,NULL);
}
//========================================================================
// class FmFieldWin
//========================================================================
-DBG_NAME(FmFieldWin);
//-----------------------------------------------------------------------
FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, Window* _pParent)
:SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE))
@@ -225,7 +218,6 @@ FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, Window* _
,m_nObjectType(0)
,m_pChangeListener(NULL)
{
- DBG_CTOR(FmFieldWin,NULL);
SetHelpId( HID_FIELD_SEL_WIN );
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
@@ -246,7 +238,6 @@ FmFieldWin::~FmFieldWin()
}
delete pListBox;
delete pData;
- DBG_DTOR(FmFieldWin,NULL);
}
//-----------------------------------------------------------------------
@@ -326,7 +317,7 @@ void FmFieldWin::StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoo
if (eState >= SFX_ITEM_AVAILABLE)
{
- FmFormShell* pShell = PTR_CAST(FmFormShell,((SfxObjectItem*)pState)->GetShell());
+ FmFormShell* pShell = dynamic_cast< FmFormShell* >( ((SfxObjectItem*)pState)->GetShell());
UpdateContent(pShell);
}
else
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 60659e2adf9f..f535dce69799 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -270,18 +270,15 @@ void SvxFmTbxCtlConfig::Select( sal_uInt16 /*nModifier*/ )
//========================================================================
SFX_IMPL_TOOLBOX_CONTROL( SvxFmTbxCtlAbsRec, SfxInt32Item );
-DBG_NAME(SvxFmTbxCtlAbsRec);
//-----------------------------------------------------------------------
SvxFmTbxCtlAbsRec::SvxFmTbxCtlAbsRec( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
:SfxToolBoxControl( nSlotId, nId, rTbx )
{
- DBG_CTOR(SvxFmTbxCtlAbsRec,NULL);
}
//-----------------------------------------------------------------------
SvxFmTbxCtlAbsRec::~SvxFmTbxCtlAbsRec()
{
- DBG_DTOR(SvxFmTbxCtlAbsRec,NULL);
}
//-----------------------------------------------------------------------
@@ -295,7 +292,7 @@ void SvxFmTbxCtlAbsRec::StateChanged( sal_uInt16 nSID, SfxItemState eState, cons
if (pState)
{
- const SfxInt32Item* pItem = PTR_CAST( SfxInt32Item, pState );
+ const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >( pState );
DBG_ASSERT( pItem, "SvxFmTbxCtlAbsRec::StateChanged: invalid item!" );
pWin->SetValue( pItem ? pItem->GetValue() : -1 );
}
@@ -324,18 +321,15 @@ Window* SvxFmTbxCtlAbsRec::CreateItemWindow( Window* pParent )
//========================================================================
SFX_IMPL_TOOLBOX_CONTROL( SvxFmTbxCtlRecText, SfxBoolItem );
-DBG_NAME(SvxFmTbxCtlRecText);
//-----------------------------------------------------------------------
SvxFmTbxCtlRecText::SvxFmTbxCtlRecText( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
:SfxToolBoxControl( nSlotId, nId, rTbx )
{
- DBG_CTOR(SvxFmTbxCtlRecText,NULL);
}
//-----------------------------------------------------------------------
SvxFmTbxCtlRecText::~SvxFmTbxCtlRecText()
{
- DBG_DTOR(SvxFmTbxCtlRecText,NULL);
}
//-----------------------------------------------------------------------
@@ -358,18 +352,15 @@ Window* SvxFmTbxCtlRecText::CreateItemWindow( Window* pParent )
//========================================================================
SFX_IMPL_TOOLBOX_CONTROL( SvxFmTbxCtlRecFromText, SfxBoolItem );
-DBG_NAME(SvxFmTbxCtlRecFromText);
//-----------------------------------------------------------------------
SvxFmTbxCtlRecFromText::SvxFmTbxCtlRecFromText( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
:SfxToolBoxControl( nSlotId, nId, rTbx )
{
- DBG_CTOR(SvxFmTbxCtlRecFromText,NULL);
}
//-----------------------------------------------------------------------
SvxFmTbxCtlRecFromText::~SvxFmTbxCtlRecFromText()
{
- DBG_DTOR(SvxFmTbxCtlRecFromText,NULL);
}
//-----------------------------------------------------------------------
@@ -389,7 +380,6 @@ Window* SvxFmTbxCtlRecFromText::CreateItemWindow( Window* pParent )
//========================================================================
// SvxFmTbxCtlRecTotal
//========================================================================
-DBG_NAME(SvxFmTbxCtlRecTotal);
SFX_IMPL_TOOLBOX_CONTROL( SvxFmTbxCtlRecTotal, SfxStringItem );
//-----------------------------------------------------------------------
@@ -397,13 +387,11 @@ SvxFmTbxCtlRecTotal::SvxFmTbxCtlRecTotal( sal_uInt16 nSlotId, sal_uInt16 nId, To
:SfxToolBoxControl( nSlotId, nId, rTbx )
,pFixedText( NULL )
{
- DBG_CTOR(SvxFmTbxCtlRecTotal,NULL);
}
//-----------------------------------------------------------------------
SvxFmTbxCtlRecTotal::~SvxFmTbxCtlRecTotal()
{
- DBG_DTOR(SvxFmTbxCtlRecTotal,NULL);
}
//-----------------------------------------------------------------------
diff --git a/svx/source/gallery2/codec.cxx b/svx/source/gallery2/codec.cxx
index 32ebea317159..aa3d98c588c6 100644
--- a/svx/source/gallery2/codec.cxx
+++ b/svx/source/gallery2/codec.cxx
@@ -28,6 +28,7 @@
#include <tools/zcodec.hxx>
#include "codec.hxx"
#include <tools/debug.hxx>
+#include "memory.h"
// ----------------
// - GalleryCodec -
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index f1fd738b2501..4d885de98373 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -115,20 +115,20 @@ void GalleryBackgroundPopup::StateChanged( sal_uInt16 nSID, SfxItemState eState,
{
if ( ( nSID == SID_GALLERY_BG_BRUSH ) && pItem && ( eState != SFX_ITEM_DISABLED ) )
{
- SfxStringListItem* pStrLstItem;
- SfxStringItem* pStrItem;
+ const SfxStringListItem* pStrLstItem;
+ const SfxStringItem* pStrItem;
PopupMenu::Clear();
- if( ( pStrLstItem = PTR_CAST( SfxStringListItem, pItem ) ) != NULL )
+ if( ( pStrLstItem = dynamic_cast< const SfxStringListItem* >( pItem ) ) != NULL )
{
- List* pList = pStrLstItem->GetList();
+ const List* pList = pStrLstItem->GetList();
if( pList )
for ( sal_uIntPtr i = 0, nCount = pList->Count(); i < nCount; i++ )
InsertItem( (sal_uInt16) i + 1, *(String*) pList->GetObject( i ) );
}
- else if( ( pStrItem = PTR_CAST( SfxStringItem, pItem ) ) != NULL )
+ else if( ( pStrItem = dynamic_cast< const SfxStringItem* >( pItem ) ) != NULL )
InsertItem( 1, pStrItem->GetValue() );
else
{
@@ -273,7 +273,7 @@ void GalleryThemePopup::StateChanged( sal_uInt16 nSID, SfxItemState eState, cons
{
if( ( nSID == SID_GALLERY_ENABLE_ADDCOPY ) && pItem && ( eState != SFX_ITEM_DISABLED ) )
{
- SfxBoolItem* pBoolItem = PTR_CAST( SfxBoolItem, pItem );
+ const SfxBoolItem* pBoolItem = dynamic_cast< const SfxBoolItem* >( pItem );
const SgaObjKind eObjKind = mpTheme->GetObjectKind( mnObjectPos );
DBG_ASSERT( pBoolItem || pBoolItem == 0, "SfxBoolItem erwartet!");
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 8365cc7b567b..50688bd29e0f 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -99,8 +99,11 @@ BitmapEx GalleryResGetBitmapEx( sal_uInt32 nId )
IMPL_LINK( SgaUserDataFactory, MakeUserData, SdrObjFactory*, pObjFactory )
{
- if ( pObjFactory->nInventor == IV_IMAPINFO && pObjFactory->nIdentifier == ID_IMAPINFO )
- pObjFactory->pNewData = new SgaIMapInfo;
+ if ( IV_IMAPINFO == pObjFactory->getSdrObjectCreationInfo().getInvent()
+ && ID_IMAPINFO == pObjFactory->getSdrObjectCreationInfo().getIdent() )
+ {
+ pObjFactory->setNewSdrObjUserData(new SgaIMapInfo);
+ }
return 0L;
}
@@ -197,26 +200,30 @@ sal_Bool CreateIMapGraphic( const FmFormModel& rModel, Graphic& rGraphic, ImageM
if ( rModel.GetPageCount() )
{
const SdrPage* pPage = rModel.GetPage( 0 );
- const SdrObject* pObj = pPage->GetObj( 0 );
- if ( pPage->GetObjCount() == 1 && pObj->ISA( SdrGrafObj ) )
+ if ( pPage->GetObjCount() == 1 )
{
- const sal_uInt16 nCount = pObj->GetUserDataCount();
+ const SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >(pPage->GetObj( 0 ));
+
+ if ( pObj )
+ {
+ const sal_uInt32 nCount(pObj->GetUserDataCount());
// gibt es in den User-Daten eine IMap-Information?
- for ( sal_uInt16 i = 0; i < nCount; i++ )
+ for ( sal_uInt32 i = 0; i < nCount; i++ )
{
const SdrObjUserData* pUserData = pObj->GetUserData( i );
if ( ( pUserData->GetInventor() == IV_IMAPINFO ) && ( pUserData->GetId() == ID_IMAPINFO ) )
{
- rGraphic = ( (SdrGrafObj*) pObj )->GetGraphic();
+ rGraphic = pObj->GetGraphic();
rImageMap = ( (SgaIMapInfo*) pUserData )->GetImageMap();
bRet = sal_True;
break;
}
}
}
+ }
}
return bRet;
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index ac8af38304f7..6976c4abc366 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -29,10 +29,8 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <sfx2/objsh.hxx>
#include <sfx2/docfac.hxx>
-
#include <comphelper/classids.hxx>
#include <unotools/pathoptions.hxx>
-
#include <tools/rcid.h>
#include <tools/vcompat.hxx>
#include <vcl/virdev.hxx>
@@ -45,8 +43,8 @@
#include "galobj.hxx"
#include <vcl/salbtype.hxx> // FRound
#include <vcl/svapp.hxx>
-
#include "gallerydrawmodel.hxx"
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -552,13 +550,13 @@ sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& r
if( pOut && pPage )
{
- const Rectangle aObjRect( pPage->GetAllObjBoundRect() );
+ const Rectangle aObjRect(sdr::legacy::GetAllObjBoundRect(pPage->getSdrObjectVector()));
const Size aOutSizePix( pOut->GetOutputSizePixel() );
if( aObjRect.GetWidth() && aObjRect.GetHeight() && aOutSizePix.Width() > 2 && aOutSizePix.Height() > 2 )
{
- FmFormView aView( const_cast< FmFormModel* >( &rModel ), pOut );
- MapMode aMap( rModel.GetScaleUnit() );
+ FmFormView aView( const_cast< FmFormModel& >( rModel ), pOut );
+ MapMode aMap( rModel.GetExchangeObjectUnit() );
Rectangle aDrawRectPix( Point( 1, 1 ), Size( aOutSizePix.Width() - 2, aOutSizePix.Height() - 2 ) );
const double fFactor = (double) aObjRect.GetWidth() / aObjRect.GetHeight();
Fraction aFrac( FRound( fFactor < 1. ? aDrawRectPix.GetWidth() * fFactor : aDrawRectPix.GetWidth() ),
@@ -582,7 +580,7 @@ sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& r
pOut->Push();
pOut->SetMapMode( aMap );
- aView.ShowSdrPage( const_cast< FmFormPage* >( pPage ));
+ aView.ShowSdrPage( *const_cast< FmFormPage* >( pPage ));
aView.CompleteRedraw( pOut, Rectangle( pOut->PixelToLogic( Point() ), pOut->GetOutputSize() ) );
pOut->Pop();
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index b1801e4b0be7..65dbf85da2e3 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -843,10 +843,9 @@ sal_Bool GalleryTheme::GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, sal_Bool
{
VirtualDevice aVDev;
aVDev.SetMapMode( MapMode( MAP_100TH_MM ) );
- FmFormView aView( aModel.GetModel(), &aVDev );
+ FmFormView aView( *aModel.GetModel(), &aVDev );
- aView.hideMarkHandles();
- aView.ShowSdrPage(aView.GetModel()->GetPage(0));
+ aView.ShowSdrPage(*aView.getSdrModelFromSdrView().GetPage(0));
aView.MarkAll();
rGraphic = aView.GetAllMarkedGraphic();
bRet = sal_True;
@@ -1307,10 +1306,12 @@ sal_Bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::X
SgaUserDataFactory aFactory;
SdrPage* pPage = aModel.GetModel()->GetPage(0);
- SdrGrafObj* pGrafObj = new SdrGrafObj( *pGraphic );
+ SdrGrafObj* pGrafObj = new SdrGrafObj(
+ *aModel.GetModel(),
+ *pGraphic );
pGrafObj->InsertUserData( new SgaIMapInfo( aImageMap ) );
- pPage->InsertObject( pGrafObj );
+ pPage->InsertObjectToSdrObjList(*pGrafObj);
bRet = InsertModel( *aModel.GetModel(), nInsertPos );
}
}
@@ -1573,7 +1574,9 @@ SvStream& operator>>( SvStream& rIn, GalleryTheme& rTheme )
}
void GalleryTheme::ImplSetModified( sal_Bool bModified )
-{ pThm->SetModified( bModified ); }
+{
+ pThm->SetModified( bModified );
+}
const String& GalleryTheme::GetRealName() const { return pThm->GetThemeName(); }
const INetURLObject& GalleryTheme::GetThmURL() const { return pThm->GetThmURL(); }
diff --git a/svx/source/inc/clonelist.hxx b/svx/source/inc/clonelist.hxx
index 355c884397ea..4fb245ca95f3 100644
--- a/svx/source/inc/clonelist.hxx
+++ b/svx/source/inc/clonelist.hxx
@@ -25,29 +25,26 @@
#include <sal/types.h>
#include <tools/list.hxx>
+#include <vector>
+#include <svx/svdobj.hxx>
-// predeclarations
-class SdrObject;
-
-// #i13033#
+////////////////////////////////////////////////////////////////////////////////////////////////////
// New mechanism to hold a ist of all original and cloned objects for later
// re-creating the connections for contained connectors
+
class CloneList
{
- List maOriginalList;
- List maCloneList;
+ SdrObjectVector maOriginalList;
+ SdrObjectVector maCloneList;
public:
CloneList();
~CloneList();
void AddPair(const SdrObject* pOriginal, SdrObject* pClone);
- sal_uInt32 Count() const;
-
- const SdrObject* GetOriginal(sal_uInt32 nIndex) const;
- SdrObject* GetClone(sal_uInt32 nIndex) const;
-
void CopyConnections() const;
};
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
#endif // _CLONELIST_HXX_
diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx
index e1876430011a..9295c4a6d640 100644
--- a/svx/source/inc/filtnav.hxx
+++ b/svx/source/inc/filtnav.hxx
@@ -69,7 +69,6 @@ class FmFilterData
::rtl::OUString m_aText;
public:
- TYPEINFO();
FmFilterData(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmParentData* pParent = NULL, const ::rtl::OUString& rText = ::rtl::OUString())
:m_xORB( _rxFactory )
,m_pParent( pParent )
@@ -91,7 +90,6 @@ protected:
::std::vector< FmFilterData* > m_aChildren;
public:
- TYPEINFO();
FmParentData(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmParentData* pParent, const ::rtl::OUString& rText)
: FmFilterData(_rxFactory,pParent, rText)
{}
@@ -108,8 +106,6 @@ class FmFormItem : public FmParentData
::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFilterController > m_xFilterController;
public:
- TYPEINFO();
-
FmFormItem( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmParentData* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & _xController,
const ::rtl::OUString& _rText)
@@ -132,7 +128,6 @@ public:
class FmFilterItems : public FmParentData
{
public:
- TYPEINFO();
FmFilterItems(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory):FmParentData(_rxFactory,NULL, ::rtl::OUString()){}
FmFilterItems(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmFormItem* pParent, const ::rtl::OUString& rText ):FmParentData(_rxFactory,pParent, rText){}
@@ -147,7 +142,6 @@ class FmFilterItem : public FmFilterData
const sal_Int32 m_nComponentIndex;
public:
- TYPEINFO();
FmFilterItem(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
FmFilterItems* pParent,
@@ -176,7 +170,6 @@ class FmFilterModel : public FmParentData
FmFilterItems* m_pCurrentItems;
public:
- TYPEINFO();
FmFilterModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
virtual ~FmFilterModel();
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index a5d684885b23..f0887d19106b 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -61,7 +61,6 @@ class FmFormShell;
class SdrObject;
class FmFormModel;
class FmFormView;
-class SdrMarkList;
//========================================================================
class FmEntryData;
@@ -71,7 +70,6 @@ class FmNavInsertedHint : public SfxHint
sal_uInt32 nPos;
public:
- TYPEINFO();
FmNavInsertedHint( FmEntryData* pInsertedEntryData, sal_uInt32 nRelPos );
virtual ~FmNavInsertedHint();
@@ -85,7 +83,6 @@ class FmNavModelReplacedHint : public SfxHint
FmEntryData* pEntryData; // die Daten des Eintrages, der ein neues Model bekommen hat
public:
- TYPEINFO();
FmNavModelReplacedHint( FmEntryData* pAffectedEntryData );
virtual ~FmNavModelReplacedHint();
@@ -98,7 +95,6 @@ class FmNavRemovedHint : public SfxHint
FmEntryData* pEntryData;
public:
- TYPEINFO();
FmNavRemovedHint( FmEntryData* pInsertedEntryData );
virtual ~FmNavRemovedHint();
@@ -112,7 +108,6 @@ class FmNavNameChangedHint : public SfxHint
::rtl::OUString aNewName;
public:
- TYPEINFO();
FmNavNameChangedHint( FmEntryData* pData, const ::rtl::OUString& rNewName );
virtual ~FmNavNameChangedHint();
@@ -124,7 +119,6 @@ public:
class FmNavClearedHint : public SfxHint
{
public:
- TYPEINFO();
FmNavClearedHint();
virtual ~FmNavClearedHint();
};
@@ -134,11 +128,10 @@ class FmNavViewMarksChanged : public SfxHint
{
FmFormView* pView;
public:
- TYPEINFO();
FmNavViewMarksChanged(FmFormView* pWhichView) { pView = pWhichView; }
virtual ~FmNavViewMarksChanged() {}
- FmFormView* GetAffectedView() { return pView; }
+ const FmFormView* GetAffectedView() const { return pView; }
};
//========================================================================
@@ -162,8 +155,6 @@ protected:
void newObject( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace );
public:
- TYPEINFO();
-
FmEntryData( FmEntryData* pParentData, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rIFace );
FmEntryData( const FmEntryData& rEntryData );
virtual ~FmEntryData();
@@ -221,7 +212,6 @@ class FmNavRequestSelectHint : public SfxHint
FmEntryDataArray m_arredToSelect;
sal_Bool m_bMixedSelection;
public:
- TYPEINFO();
FmNavRequestSelectHint() { }
virtual ~FmNavRequestSelectHint() {}
@@ -239,8 +229,6 @@ class FmFormData : public FmEntryData
::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer > m_xContainer;
public:
- TYPEINFO();
-
FmFormData(
const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
const ImageList& _rNormalImages,
@@ -274,8 +262,6 @@ class FmControlData : public FmEntryData
Image GetImage(const ImageList& ilNavigatorImages) const;
public:
- TYPEINFO();
-
FmControlData(
const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& _rxComponent,
const ImageList& _rNormalImages,
@@ -372,7 +358,7 @@ namespace svxform
void ReplaceFormComponent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xOld, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >& xNew);
- void BroadcastMarkedObjects(const SdrMarkList& mlMarked);
+ void BroadcastMarkedObjects(const SdrObjectVector& mlMarked);
// einen RequestSelectHint mit den aktuell markierten Objekten broadcasten
sal_Bool InsertFormComponent(FmNavRequestSelectHint& rHint, SdrObject* pObject);
// ist ein Helper fuer vorherige, managet das Abteigen in SdrObjGroups
diff --git a/svx/source/inc/fmitems.hxx b/svx/source/inc/fmitems.hxx
index 61c46a615c95..f89bd746a20a 100644
--- a/svx/source/inc/fmitems.hxx
+++ b/svx/source/inc/fmitems.hxx
@@ -36,8 +36,6 @@ class FmInterfaceItem : public SfxPoolItem
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInterface;
public:
- TYPEINFO();
-
FmInterfaceItem( const sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxInterface )
:SfxPoolItem( nId )
,xInterface( rxInterface )
diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx
index 191f91be00b5..c8bcaeb17dd6 100644
--- a/svx/source/inc/fmobj.hxx
+++ b/svx/source/inc/fmobj.hxx
@@ -35,6 +35,7 @@ class FmFormView;
class FmXForms;
class FmFormObj: public SdrUnoObj
{
+private:
::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor > aEvts; // events des Objects
::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor> m_aEventsHistory;
// valid if and only if m_pEnvironmentHistory != NULL, this are the events which we're set when
@@ -54,11 +55,19 @@ class FmFormObj: public SdrUnoObj
// the last ref device we know, as set at the model
// only to be used for comparison with the current ref device!
+protected:
+ virtual ~FmFormObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
- SVX_DLLPUBLIC FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType);
- SVX_DLLPUBLIC FmFormObj(sal_Int32 _nType);
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+ virtual void clonedFrom(const FmFormObj* _pSource);
- TYPEINFO();
+ SVX_DLLPUBLIC FmFormObj(SdrModel& rSdrModel, const ::rtl::OUString& rModelName, sal_Int32 _nType);
+// SVX_DLLPUBLIC FmFormObj(sal_Int32 _nType);
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>&
GetOriginalParent() const { return m_xParent; }
@@ -73,21 +82,12 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& rEvts );
void ClearObjEnv();
-public:
- virtual ~FmFormObj();
- virtual void SetPage(SdrPage* pNewPage);
+ // react on page change
+ virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage);
virtual sal_uInt32 GetObjInventor() const;
virtual sal_uInt16 GetObjIdentifier() const;
- 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);
+ virtual void ReformatText();
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);
@@ -107,12 +107,12 @@ public:
virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& _rxModel );
protected:
- virtual FASTBOOL EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd );
+ virtual bool EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd );
virtual void BrkCreate( SdrDragStat& rStat );
// #i70852# overload Layer interface to force to FormColtrol layer
virtual SdrLayerID GetLayer() const;
- virtual void NbcSetLayer(SdrLayerID nLayer);
+ virtual void SetLayer(SdrLayerID nLayer);
private:
/** isolates the control model from its form component hierarchy, i.e. removes it from
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index 3eb45cf863fb..9f2d487d9852 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -45,7 +45,7 @@
#include <com/sun/star/form/runtime/FeatureState.hpp>
#include <vcl/timer.hxx>
#include <sfx2/app.hxx>
-#include <svx/svdmark.hxx>
+#include <svx/svdobj.hxx>
#include <svx/fmsearch.hxx>
#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
@@ -395,7 +395,7 @@ public:
@return
<TRUE/> if and only if the to-bet-set selection was different from the previous selection
*/
- bool setCurrentSelectionFromMark(const SdrMarkList& rMarkList);
+ bool setCurrentSelectionFromSdrObjectVector(const SdrObjectVector& _rSelection);
/// returns the currently selected form, or the form which all currently selected controls belong to, or <NULL/>
::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
@@ -421,8 +421,8 @@ public:
void ShowSelectionProperties( sal_Bool bShow );
sal_Bool IsPropBrwOpen() const;
- void DetermineSelection(const SdrMarkList& rMarkList);
- void SetSelection(const SdrMarkList& rMarkList);
+ void DetermineSelection(const SdrObjectVector& _rSelection);
+ void SetSelection(const SdrObjectVector& _rSelection);
void SetSelectionDelayed();
void SetDesignMode(sal_Bool bDesign);
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index b5b7ce260128..77bc15624558 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -23,7 +23,6 @@
#ifndef _SVX_FMVWIMP_HXX
#define _SVX_FMVWIMP_HXX
-#include "svx/svdmark.hxx"
#include "fmdocumentclassification.hxx"
/** === begin UNO includes === **/
@@ -48,12 +47,9 @@
#include <comphelper/uno3.hxx>
#include <comphelper/componentcontext.hxx>
#include <rtl/ref.hxx>
+#include <svx/svdobj.hxx>
-//class SdrPageViewWinRec;
class SdrPageWindow;
-
-class SdrPageView;
-class SdrObject;
class FmFormObj;
class FmFormModel;
class FmFormView;
@@ -98,7 +94,6 @@ protected:
public:
FormViewPageWindowAdapter( const ::comphelper::ComponentContext& _rContext,
const SdrPageWindow&, FmXFormView* pView);
- //const SdrPageViewWinRec*, FmXFormView* pView);
// XElementAccess
virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException);
@@ -172,7 +167,7 @@ class FmXFormView : public ::cppu::WeakImplHelper3<
m_aNeedTabOrderUpdate;
// Liste der markierten Object, dient zur Restauration beim Umschalten von Alive in DesignMode
- SdrMarkList m_aMark;
+ SdrObjectVector m_aMark;
ObjectRemoveListener* m_pWatchStoredList;
bool m_bFirstActivation;
@@ -187,7 +182,7 @@ protected:
~FmXFormView();
void saveMarkList( sal_Bool _bSmartUnmark = sal_True );
- void restoreMarkList( SdrMarkList& _rRestoredMarkList );
+ void restoreMarkList( SdrObjectVector& _rRestoredSelection );
void stopMarkListWatching();
void startMarkListWatching();
@@ -244,7 +239,6 @@ public:
);
private:
- //void addWindow(const SdrPageViewWinRec*);
void addWindow(const SdrPageWindow&);
void removeWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC );
void Activate(sal_Bool bSync = sal_False);
diff --git a/svx/source/inc/formcontrolfactory.hxx b/svx/source/inc/formcontrolfactory.hxx
index 58dd36f4e388..1bf5b853b6ba 100644
--- a/svx/source/inc/formcontrolfactory.hxx
+++ b/svx/source/inc/formcontrolfactory.hxx
@@ -44,6 +44,8 @@ namespace comphelper {
class ComponentContext;
}
+namespace basegfx { class B2DRange; }
+
//........................................................................
namespace svxform
{
@@ -74,7 +76,7 @@ namespace svxform
sal_Int16 initializeControlModel(
const DocumentType _eDocType,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const Rectangle& _rControlBoundRect
+ const basegfx::B2DRange& _rControlBoundRange
);
sal_Int16 initializeControlModel( const DocumentType _eDocType, const SdrUnoObj& _rObject );
diff --git a/svx/source/inc/frmselimpl.hxx b/svx/source/inc/frmselimpl.hxx
index afb058cc52d3..939e5eb67c1a 100644
--- a/svx/source/inc/frmselimpl.hxx
+++ b/svx/source/inc/frmselimpl.hxx
@@ -107,7 +107,6 @@ struct FrameSelectorImpl : public Resource
Color maMarkCol; /// Selection marker color.
Color maHCLineCol; /// High contrast line color.
Point maVirDevPos; /// Position of virtual device in the control.
- Point maMousePos; /// Last mouse pointer position.
FrameBorder maLeft; /// All data of left frame border.
FrameBorder maRight; /// All data of right frame border.
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 5fda2a466d5a..0d5429ec7663 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -52,7 +52,6 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase2.hxx>
#include <tools/diagnose_ex.h>
-#include <tools/rtti.hxx>
class DbCellControl;
class Edit;
@@ -275,7 +274,6 @@ protected:
public:
- TYPEINFO();
DbCellControl(DbGridColumn& _rColumn, sal_Bool _bText = sal_True);
virtual ~DbCellControl();
@@ -378,8 +376,6 @@ inline void DbCellControl::unlockValueProperty()
class DbLimitedLengthField : public DbCellControl
{
public:
- TYPEINFO();
-
protected:
DbLimitedLengthField( DbGridColumn& _rColumn );
@@ -407,7 +403,6 @@ protected:
~DbTextField( );
public:
- TYPEINFO();
DbTextField(DbGridColumn& _rColumn);
::svt::IEditImplementation* GetEditImplementation() { return m_pEdit; }
@@ -438,7 +433,6 @@ protected:
public:
- TYPEINFO();
DbFormattedField(DbGridColumn& _rColumn);
virtual ~DbFormattedField();
@@ -461,7 +455,6 @@ protected:
class DbCheckBox : public DbCellControl
{
public:
- TYPEINFO();
DbCheckBox(DbGridColumn& _rColumn);
virtual void Init( Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
@@ -484,7 +477,6 @@ class DbComboBox : public DbCellControl
sal_Int16 m_nKeyType;
public:
- TYPEINFO();
DbComboBox(DbGridColumn& _rColumn);
virtual void Init( Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
@@ -512,7 +504,6 @@ class DbListBox :public DbCellControl
::com::sun::star::uno::Sequence< ::rtl::OUString > m_aValueList;
public:
- TYPEINFO();
DbListBox(DbGridColumn& _rColumn);
virtual void Init( Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
@@ -537,7 +528,6 @@ protected:
class DbPatternField : public DbCellControl
{
public:
- TYPEINFO();
DbPatternField( DbGridColumn& _rColumn, const ::comphelper::ComponentContext& _rContext );
virtual void Init( Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
virtual XubString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL);
@@ -567,8 +557,6 @@ private:
sal_Int16 m_nStandardAlign;
public:
- TYPEINFO();
-
protected:
DbSpinField( DbGridColumn& _rColumn, sal_Int16 _nStandardAlign = com::sun::star::awt::TextAlign::RIGHT );
@@ -588,7 +576,6 @@ protected:
class DbDateField : public DbSpinField
{
public:
- TYPEINFO();
DbDateField(DbGridColumn& _rColumn);
virtual XubString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL);
virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
@@ -613,7 +600,6 @@ protected:
class DbTimeField : public DbSpinField
{
public:
- TYPEINFO();
DbTimeField(DbGridColumn& _rColumn);
virtual XubString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL);
virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
@@ -640,7 +626,6 @@ class DbCurrencyField : public DbSpinField
sal_Int16 m_nScale;
public:
- TYPEINFO();
DbCurrencyField(DbGridColumn& _rColumn);
virtual XubString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL);
virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
@@ -667,7 +652,6 @@ protected:
class DbNumericField : public DbSpinField
{
public:
- TYPEINFO();
DbNumericField(DbGridColumn& _rColumn);
virtual XubString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL);
virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
@@ -702,7 +686,6 @@ class DbFilterField
sal_Bool m_bBound : 1;
public:
- TYPEINFO();
DbFilterField(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,DbGridColumn& _rColumn);
virtual ~DbFilterField();
@@ -759,7 +742,6 @@ protected:
virtual ~FmXGridCell();
public:
- TYPEINFO();
FmXGridCell( DbGridColumn* pColumn, DbCellControl* pControl );
void init();
@@ -841,7 +823,6 @@ private:
class FmXDataCell : public FmXGridCell
{
public:
- TYPEINFO();
FmXDataCell( DbGridColumn* pColumn, DbCellControl& _rControl )
:FmXGridCell( pColumn, &_rControl )
{
@@ -880,7 +861,6 @@ protected:
sal_Bool m_bFastPaint;
public:
- TYPEINFO();
FmXTextCell( DbGridColumn* pColumn, DbCellControl& _rControl );
virtual void PaintFieldToCell(OutputDevice& rDev,
@@ -1106,7 +1086,6 @@ class FmXFilterCell :public FmXGridCell
protected:
virtual ~FmXFilterCell();
public:
- TYPEINFO();
FmXFilterCell(DbGridColumn* pColumn = NULL, DbCellControl* pControl = NULL);
diff --git a/svx/source/inc/unopolyhelper.hxx b/svx/source/inc/unopolyhelper.hxx
index 65cd5f885ddf..1e473999f5ed 100644
--- a/svx/source/inc/unopolyhelper.hxx
+++ b/svx/source/inc/unopolyhelper.hxx
@@ -36,16 +36,6 @@ namespace basegfx {
class B2DPolyPolygon;
}
-/** convert a drawing::PolyPolygonBezierCoords to a B2DPolyPolygon
-*/
-basegfx::B2DPolyPolygon SvxConvertPolyPolygonBezierToB2DPolyPolygon( const com::sun::star::drawing::PolyPolygonBezierCoords* pSourcePolyPolygon)
- throw( com::sun::star::lang::IllegalArgumentException );
-
-/** convert a B2DPolyPolygon to a drawing::PolyPolygonBezierCoords
-*/
-SVX_DLLPUBLIC void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, com::sun::star::drawing::PolyPolygonBezierCoords& rRetval );
-
-
#endif
diff --git a/svx/source/items/SmartTagItem.cxx b/svx/source/items/SmartTagItem.cxx
index efddeb1418f1..09118ba9a7f7 100644
--- a/svx/source/items/SmartTagItem.cxx
+++ b/svx/source/items/SmartTagItem.cxx
@@ -39,9 +39,23 @@
using namespace ::com::sun::star;
-TYPEINIT1(SvxSmartTagItem, SfxPoolItem);
-
// class SvxFontItem -----------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxSmartTagItem)
+
+SvxSmartTagItem::SvxSmartTagItem() :
+ SfxPoolItem( 0 ),
+ maActionComponentsSequence( ),
+ maActionIndicesSequence( ),
+ maStringKeyMaps( ),
+ mxRange( ),
+ mxController( ),
+ maLocale( ),
+ maApplicationName( ),
+ maRangeText( )
+{
+}
+
+// -----------------------------------------------------------------------
SvxSmartTagItem::SvxSmartTagItem( const sal_uInt16 nId,
const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
@@ -66,8 +80,6 @@ SvxSmartTagItem::SvxSmartTagItem( const sal_uInt16 nId,
// -----------------------------------------------------------------------
-// -----------------------------------------------------------------------
-
sal_Bool SvxSmartTagItem::QueryValue( uno::Any& /* rVal */, sal_uInt8 /* nMemberId */ ) const
{
return sal_False;
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index 167d488473c0..b85770f91cd8 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -56,16 +56,8 @@ using namespace ::com::sun::star;
#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
#define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
-// STATIC DATA -----------------------------------------------------------
-
-//TYPEINIT1_AUTOFACTORY( SvxHorJustifyItem, SfxEnumItem );
-TYPEINIT1_FACTORY( SvxHorJustifyItem, SfxEnumItem, new SvxHorJustifyItem(SVX_HOR_JUSTIFY_STANDARD, 0))
-TYPEINIT1_FACTORY( SvxVerJustifyItem, SfxEnumItem, new SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, 0) );
-TYPEINIT1_FACTORY( SvxOrientationItem, SfxEnumItem, new SvxOrientationItem(SVX_ORIENTATION_STANDARD, 0) );
-TYPEINIT1_FACTORY( SvxMarginItem, SfxPoolItem, new SvxMarginItem(0) );
-
// class SvxHorJustifyItem -----------------------------------------------
-
+IMPL_POOLITEM_FACTORY(SvxHorJustifyItem)
SvxHorJustifyItem::SvxHorJustifyItem( const sal_uInt16 nId ) :
SfxEnumItem( nId, (sal_uInt16)SVX_HOR_JUSTIFY_STANDARD )
@@ -231,6 +223,7 @@ sal_uInt16 SvxHorJustifyItem::GetValueCount() const
}
// class SvxVerJustifyItem -----------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxVerJustifyItem)
SvxVerJustifyItem::SvxVerJustifyItem( const sal_uInt16 nId ) :
SfxEnumItem( nId, (sal_uInt16)SVX_VER_JUSTIFY_STANDARD )
@@ -528,6 +521,7 @@ void SvxOrientationItem::SetFromRotation( sal_Int32 nRotation, sal_Bool bStacked
}
// class SvxMarginItem ---------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxMarginItem)
SvxMarginItem::SvxMarginItem( const sal_uInt16 nId ) :
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx
index 950e35179c39..9140fe2cdd0d 100644
--- a/svx/source/items/chrtitem.cxx
+++ b/svx/source/items/chrtitem.cxx
@@ -44,16 +44,6 @@
using namespace ::rtl;
using namespace ::com::sun::star;
-// -----------------------------------------------------------------------
-
-TYPEINIT1_FACTORY(SvxChartStyleItem, SfxEnumItem, new SvxChartStyleItem(CHSTYLE_2D_LINE, 0));
-TYPEINIT1(SvxChartDataDescrItem, SfxEnumItem);
-TYPEINIT1(SvxChartTextOrderItem, SfxEnumItem);
-TYPEINIT1(SvxChartTextOrientItem, SfxEnumItem);
-TYPEINIT1(SvxChartIndicateItem, SfxEnumItem);
-TYPEINIT1(SvxChartKindErrorItem, SfxEnumItem);
-TYPEINIT1(SvxChartRegressItem, SfxEnumItem);
-TYPEINIT1_FACTORY(SvxDoubleItem, SfxPoolItem, new SvxDoubleItem(0.0, 0));
/*************************************************************************
|*
@@ -253,6 +243,8 @@ SfxPoolItem* SvxChartTextOrientItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/)
|*
*************************************************************************/
+IMPL_POOLITEM_FACTORY(SvxDoubleItem)
+
SvxDoubleItem::SvxDoubleItem(double fValue, sal_uInt16 nId) :
SfxPoolItem(nId),
fVal(fValue)
diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx
index 2049e9f19273..cf0fbb519205 100644
--- a/svx/source/items/clipfmtitem.cxx
+++ b/svx/source/items/clipfmtitem.cxx
@@ -43,8 +43,6 @@ struct SvxClipboardFmtItem_Impl
String SvxClipboardFmtItem_Impl::sEmptyStr;
-TYPEINIT1_FACTORY( SvxClipboardFmtItem, SfxPoolItem , new SvxClipboardFmtItem(0));
-
SvxClipboardFmtItem_Impl::SvxClipboardFmtItem_Impl(
const SvxClipboardFmtItem_Impl& rCpy )
{
@@ -58,6 +56,7 @@ SvxClipboardFmtItem_Impl::SvxClipboardFmtItem_Impl(
}
}
+IMPL_POOLITEM_FACTORY(SvxClipboardFmtItem)
SvxClipboardFmtItem::SvxClipboardFmtItem( sal_uInt16 nId )
: SfxPoolItem( nId ), pImpl( new SvxClipboardFmtItem_Impl )
{
diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx
index 436f8688baf2..3ed6edf39136 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -29,20 +29,6 @@
using namespace ::std;
using namespace com::sun::star;
-SdrCustomShapeEngineItem::SdrCustomShapeEngineItem()
-: SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, String() )
-{}
-SdrCustomShapeEngineItem::SdrCustomShapeEngineItem( const String& rVal )
-: SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, rVal )
-{}
-
-SdrCustomShapeDataItem::SdrCustomShapeDataItem()
-: SfxStringItem( SDRATTR_CUSTOMSHAPE_DATA, String() )
-{}
-SdrCustomShapeDataItem::SdrCustomShapeDataItem( const String& rVal )
-: SfxStringItem( SDRATTR_CUSTOMSHAPE_DATA, rVal )
-{}
-
bool SdrCustomShapeGeometryItem::PropertyEq::operator()( const rtl::OUString& r1, const rtl::OUString& r2 ) const
{
return r1.equals( r2 );
@@ -56,7 +42,6 @@ size_t SdrCustomShapeGeometryItem::PropertyPairHash::operator()( const SdrCustom
return (size_t)r1.first.hashCode() + r1.second.hashCode();
};
-TYPEINIT1_FACTORY( SdrCustomShapeGeometryItem, SfxPoolItem , new SdrCustomShapeGeometryItem);
SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem()
: SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
{}
@@ -367,16 +352,5 @@ const uno::Sequence< beans::PropertyValue >& SdrCustomShapeGeometryItem::GetGeom
{
return aPropSeq;
}
-/*
-const uno::Any* GetValueByName( const rtl::OUString& rProperty ) const
-{
-
-}
-*/
-SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem()
-: SfxStringItem( SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL, String() )
-{}
-SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem( const String& rVal )
-: SfxStringItem( SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL, rVal )
-{}
+// eof
diff --git a/svx/source/items/drawitem.cxx b/svx/source/items/drawitem.cxx
index 3378c697a058..1b657b49dc98 100644
--- a/svx/source/items/drawitem.cxx
+++ b/svx/source/items/drawitem.cxx
@@ -35,20 +35,14 @@
using namespace ::com::sun::star;
// -----------------------------------------------------------------------
-
-TYPEINIT1_FACTORY( SvxColorTableItem, SfxPoolItem , new SvxColorTableItem);
-TYPEINIT1_FACTORY( SvxGradientListItem, SfxPoolItem , new SvxGradientListItem);
-TYPEINIT1_FACTORY( SvxHatchListItem, SfxPoolItem , new SvxHatchListItem);
-TYPEINIT1_FACTORY( SvxBitmapListItem, SfxPoolItem , new SvxBitmapListItem);
-TYPEINIT1_FACTORY( SvxDashListItem, SfxPoolItem , new SvxDashListItem);
-TYPEINIT1_FACTORY( SvxLineEndListItem, SfxPoolItem , new SvxLineEndListItem);
-
//==================================================================
//
// SvxColorTableItem
//
//==================================================================
+IMPL_POOLITEM_FACTORY(SvxColorTableItem)
+
SvxColorTableItem::SvxColorTableItem()
{
}
@@ -133,6 +127,8 @@ sal_Bool SvxColorTableItem::PutValue( const com::sun::star::uno::Any& rVal, sal_
//
//==================================================================
+IMPL_POOLITEM_FACTORY(SvxGradientListItem)
+
SvxGradientListItem::SvxGradientListItem()
{
}
@@ -217,6 +213,8 @@ sal_Bool SvxGradientListItem::PutValue( const com::sun::star::uno::Any& rVal, sa
//
//==================================================================
+IMPL_POOLITEM_FACTORY(SvxHatchListItem)
+
SvxHatchListItem::SvxHatchListItem()
{
}
@@ -301,6 +299,8 @@ sal_Bool SvxHatchListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_u
//
//==================================================================
+IMPL_POOLITEM_FACTORY(SvxBitmapListItem)
+
SvxBitmapListItem::SvxBitmapListItem()
{
}
@@ -386,6 +386,8 @@ sal_Bool SvxBitmapListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_
//
//==================================================================
+IMPL_POOLITEM_FACTORY(SvxDashListItem)
+
SvxDashListItem::SvxDashListItem() :
pDashList( 0 )
{
@@ -476,6 +478,8 @@ void SvxDashListItem::SetDashList( XDashList* pList )
//
//==================================================================
+IMPL_POOLITEM_FACTORY(SvxLineEndListItem)
+
SvxLineEndListItem::SvxLineEndListItem()
{
}
diff --git a/svx/source/items/e3ditem.cxx b/svx/source/items/e3ditem.cxx
index 2ad1103fa679..10f1725e3f0b 100644
--- a/svx/source/items/e3ditem.cxx
+++ b/svx/source/items/e3ditem.cxx
@@ -33,23 +33,12 @@ using namespace ::com::sun::star;
// STATIC DATA -----------------------------------------------------------
-DBG_NAMEEX(SvxB3DVectorItem)
-DBG_NAME(SvxB3DVectorItem)
-
-// -----------------------------------------------------------------------
-
-TYPEINIT1_FACTORY(SvxB3DVectorItem, SfxPoolItem, new SvxB3DVectorItem);
-
-// -----------------------------------------------------------------------
-
SvxB3DVectorItem::SvxB3DVectorItem()
{
- DBG_CTOR(SvxB3DVectorItem, 0);
}
SvxB3DVectorItem::~SvxB3DVectorItem()
{
- DBG_DTOR(SvxB3DVectorItem, 0);
}
// -----------------------------------------------------------------------
@@ -58,7 +47,6 @@ SvxB3DVectorItem::SvxB3DVectorItem( sal_uInt16 _nWhich, const basegfx::B3DVector
SfxPoolItem( _nWhich ),
aVal( rVal )
{
- DBG_CTOR(SvxB3DVectorItem, 0);
}
// -----------------------------------------------------------------------
@@ -66,7 +54,6 @@ SvxB3DVectorItem::SvxB3DVectorItem( sal_uInt16 _nWhich, const basegfx::B3DVector
SvxB3DVectorItem::SvxB3DVectorItem( sal_uInt16 _nWhich, SvStream& rStream ) :
SfxPoolItem( _nWhich )
{
- DBG_CTOR(SvxB3DVectorItem, 0);
double fValue;
rStream >> fValue; aVal.setX(fValue);
rStream >> fValue; aVal.setY(fValue);
@@ -79,14 +66,12 @@ SvxB3DVectorItem::SvxB3DVectorItem( const SvxB3DVectorItem& rItem ) :
SfxPoolItem( rItem ),
aVal( rItem.aVal )
{
- DBG_CTOR(SvxB3DVectorItem, 0);
}
// -----------------------------------------------------------------------
int SvxB3DVectorItem::operator==( const SfxPoolItem &rItem ) const
{
- DBG_CHKTHIS(SvxB3DVectorItem, 0);
DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
return ((SvxB3DVectorItem&)rItem).aVal == aVal;
}
@@ -95,7 +80,6 @@ int SvxB3DVectorItem::operator==( const SfxPoolItem &rItem ) const
SfxPoolItem* SvxB3DVectorItem::Clone( SfxItemPool* /*pPool*/ ) const
{
- DBG_CHKTHIS(SvxB3DVectorItem, 0);
return new SvxB3DVectorItem( *this );
}
@@ -103,7 +87,6 @@ SfxPoolItem* SvxB3DVectorItem::Clone( SfxItemPool* /*pPool*/ ) const
SfxPoolItem* SvxB3DVectorItem::Create(SvStream &rStream, sal_uInt16 /*nVersion*/) const
{
- DBG_CHKTHIS(SvxB3DVectorItem, 0);
basegfx::B3DVector aStr;
double fValue;
rStream >> fValue; aStr.setX(fValue);
@@ -116,8 +99,6 @@ SfxPoolItem* SvxB3DVectorItem::Create(SvStream &rStream, sal_uInt16 /*nVersion*/
SvStream& SvxB3DVectorItem::Store(SvStream &rStream, sal_uInt16 /*nItemVersion*/) const
{
- DBG_CHKTHIS(SvxB3DVectorItem, 0);
-
// ## if (nItemVersion)
double fValue;
fValue = aVal.getX(); rStream << fValue;
diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx
index 9e3558bdee08..8e12f383b83d 100644
--- a/svx/source/items/grfitem.cxx
+++ b/svx/source/items/grfitem.cxx
@@ -34,7 +34,6 @@ using namespace ::com::sun::star;
#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
#define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
-//TYPEINIT1_FACTORY( SvxGrfCrop, SfxPoolItem , new SvxGrfCrop(0))
/******************************************************************************
* Implementierung class SwCropGrf
@@ -55,6 +54,11 @@ SvxGrfCrop::~SvxGrfCrop()
{
}
+SfxPoolItem* SvxGrfCrop::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SvxGrfCrop(nLeft, nRight, nTop, nBottom, Which());
+}
+
int SvxGrfCrop::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==( rAttr ), "not equal attributes" );
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx
index ab8597daaace..8018ec2cbb8f 100644
--- a/svx/source/items/hlnkitem.cxx
+++ b/svx/source/items/hlnkitem.cxx
@@ -42,12 +42,10 @@
#include "svx/hlnkitem.hxx"
-// -----------------------------------------------------------------------
-
-TYPEINIT1_FACTORY(SvxHyperlinkItem, SfxPoolItem, new SvxHyperlinkItem(0));
-
// class SvxHyperlinkItem ------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxHyperlinkItem)
+
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
diff --git a/svx/source/items/numinf.cxx b/svx/source/items/numinf.cxx
index f366043ac255..b25ba56758de 100644
--- a/svx/source/items/numinf.cxx
+++ b/svx/source/items/numinf.cxx
@@ -28,10 +28,6 @@
#include <svx/numinf.hxx>
-// -----------------------------------------------------------------------
-
-TYPEINIT1(SvxNumberInfoItem, SfxPoolItem);
-
// class SvxNumberInfoItem -----------------------------------------------
#define INIT(pNum,eVal,nDouble,rStr) \
diff --git a/svx/source/items/ofaitem.cxx b/svx/source/items/ofaitem.cxx
index 363448e182d7..25df1398277a 100644
--- a/svx/source/items/ofaitem.cxx
+++ b/svx/source/items/ofaitem.cxx
@@ -46,42 +46,4 @@ SfxPoolItem* OfaPtrItem::Clone( SfxItemPool * ) const
return new OfaPtrItem( *this );
}
-//---------------------------------------------------------------------------
-/*
-TYPEINIT1_FACTORY(DashListPtrItem, SvxDashListPtrItem, new DashListPtrItem(0));
-
-DashListPtrItem::DashListPtrItem( sal_uInt16 nWhich, SvxDashListItem* pPtr )
- : OfaPtrItem( nWhich ), pPtr( pPtr )
-{
-}
-
-DashListPtrItem::DashListPtrItem( const DashListPtrItem& )
- : OfaPtrItem( rItem.Which() ), pPtr( rItem.pPtr )
-{
-}
-
-int DashListPtrItem::operator==( const SfxPoolItem& rItem ) const
-{
- return ((DashListPtrItem&)rItem).GetValue() == GetValue();
-}
-
-SfxPoolItem* DashListPtrItem::Clone( SfxItemPool *pPool ) const
-{
- return new DashListPtrItem( *this );
-}
-
-sal_Bool DashListPtrItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const
-{
-}
-
-sal_Bool DashListPtrItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 )
-{
- sal_Int64 nHyper;
- if ( rVal >>= nHyper )
- {
- SetValue( (SvxDash
- }
-
- return sal_False;
-}
-*/
+// eof
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index fc03fece8869..5e8a74f089a9 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -40,15 +40,20 @@
using namespace ::rtl;
using namespace ::com::sun::star;
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1_FACTORY( SvxPageItem, SfxPoolItem , new SvxPageItem(0));
-
/*--------------------------------------------------------------------
Beschreibung: Konstruktor
--------------------------------------------------------------------*/
+IMPL_POOLITEM_FACTORY(SvxPageItem)
+
+SvxPageItem::SvxPageItem() : SfxPoolItem( 0 ),
+
+ eNumType ( SVX_ARABIC ),
+ bLandscape ( sal_False ),
+ eUse ( SVX_PAGE_ALL )
+{
+}
-SvxPageItem::SvxPageItem( const sal_uInt16 nId ) : SfxPoolItem( nId ),
+SvxPageItem::SvxPageItem( sal_uInt16 nId ) : SfxPoolItem( nId ),
eNumType ( SVX_ARABIC ),
bLandscape ( sal_False ),
diff --git a/svx/source/items/postattr.cxx b/svx/source/items/postattr.cxx
index 6677165566fb..e05b9405e6f1 100644
--- a/svx/source/items/postattr.cxx
+++ b/svx/source/items/postattr.cxx
@@ -32,12 +32,6 @@
#include <svx/svxitems.hrc>
#include <svx/dialmgr.hxx>
-// -----------------------------------------------------------------------
-
-TYPEINIT1_FACTORY(SvxPostItAuthorItem, SfxStringItem, new SvxPostItAuthorItem(0));
-TYPEINIT1_FACTORY(SvxPostItDateItem, SfxStringItem, new SvxPostItDateItem(0));
-TYPEINIT1_FACTORY(SvxPostItTextItem, SfxStringItem, new SvxPostItTextItem(0));
-
// class SvxPostItAuthorItem ---------------------------------------------
SvxPostItAuthorItem::SvxPostItAuthorItem( sal_uInt16 _nWhich )
diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx
index 9938f43db4c7..52f9c13c5cf0 100644
--- a/svx/source/items/rotmodit.cxx
+++ b/svx/source/items/rotmodit.cxx
@@ -43,14 +43,10 @@
using namespace ::rtl;
using namespace ::com::sun::star;
-// STATIC DATA -----------------------------------------------------------
-
-TYPEINIT1_FACTORY(SvxRotateModeItem, SfxEnumItem, new SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD, 0));
-
-
//-----------------------------------------------------------------------
// SvxRotateModeItem - Ausrichtung bei gedrehtem Text
//-----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxRotateModeItem)
SvxRotateModeItem::SvxRotateModeItem( SvxRotateMode eMode, sal_uInt16 _nWhich )
: SfxEnumItem( _nWhich, (sal_uInt16)eMode )
diff --git a/svx/source/items/viewlayoutitem.cxx b/svx/source/items/viewlayoutitem.cxx
index a5b6d6934e77..8009cebaf325 100644
--- a/svx/source/items/viewlayoutitem.cxx
+++ b/svx/source/items/viewlayoutitem.cxx
@@ -31,13 +31,12 @@
// -----------------------------------------------------------------------
-TYPEINIT1_FACTORY(SvxViewLayoutItem,SfxUInt16Item, new SvxViewLayoutItem);
-
#define VIEWLAYOUT_PARAM_COLUMNS "Columns"
#define VIEWLAYOUT_PARAM_BOOKMODE "BookMode"
#define VIEWLAYOUT_PARAMS 2
// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxViewLayoutItem)
SvxViewLayoutItem::SvxViewLayoutItem
(
diff --git a/svx/source/items/zoomitem.cxx b/svx/source/items/zoomitem.cxx
index c44cb546fbb3..138e43b9d1ec 100644
--- a/svx/source/items/zoomitem.cxx
+++ b/svx/source/items/zoomitem.cxx
@@ -34,8 +34,6 @@
// -----------------------------------------------------------------------
-TYPEINIT1_FACTORY(SvxZoomItem,SfxUInt16Item, new SvxZoomItem);
-
#define ZOOM_PARAM_VALUE "Value"
#define ZOOM_PARAM_VALUESET "ValueSet"
#define ZOOM_PARAM_TYPE "Type"
@@ -43,6 +41,8 @@ TYPEINIT1_FACTORY(SvxZoomItem,SfxUInt16Item, new SvxZoomItem);
// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxZoomItem)
+
SvxZoomItem::SvxZoomItem
(
SvxZoomType eZoomType,
diff --git a/svx/source/items/zoomslideritem.cxx b/svx/source/items/zoomslideritem.cxx
index 4297c9f8010b..3789276ae340 100644
--- a/svx/source/items/zoomslideritem.cxx
+++ b/svx/source/items/zoomslideritem.cxx
@@ -30,8 +30,6 @@
// -----------------------------------------------------------------------
-TYPEINIT1_FACTORY(SvxZoomSliderItem,SfxUInt16Item, new SvxZoomSliderItem);
-
#define ZOOMSLIDER_PARAM_CURRENTZOOM "Columns"
#define ZOOMSLIDER_PARAM_SNAPPINGPOINTS "SnappingPoints"
#define ZOOMSLIDER_PARAM_MINZOOM "MinValue"
@@ -40,6 +38,8 @@ TYPEINIT1_FACTORY(SvxZoomSliderItem,SfxUInt16Item, new SvxZoomSliderItem);
// -----------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SvxZoomSliderItem)
+
SvxZoomSliderItem::SvxZoomSliderItem( sal_uInt16 nCurrentZoom, sal_uInt16 nMinZoom, sal_uInt16 nMaxZoom, sal_uInt16 _nWhich )
: SfxUInt16Item( _nWhich, nCurrentZoom ), mnMinZoom( nMinZoom ), mnMaxZoom( nMaxZoom )
{
diff --git a/svx/source/mnuctrls/SmartTagCtl.cxx b/svx/source/mnuctrls/SmartTagCtl.cxx
index ccb1bd866e89..847c0c19b88b 100644
--- a/svx/source/mnuctrls/SmartTagCtl.cxx
+++ b/svx/source/mnuctrls/SmartTagCtl.cxx
@@ -156,7 +156,7 @@ void SvxSmartTagsControl::StateChanged( sal_uInt16, SfxItemState eState, const S
if ( SFX_ITEM_AVAILABLE == eState )
{
- const SvxSmartTagItem* pSmartTagItem = PTR_CAST( SvxSmartTagItem, pState );
+ const SvxSmartTagItem* pSmartTagItem = dynamic_cast< const SvxSmartTagItem* >( pState );
if ( 0 != pSmartTagItem )
{
delete mpSmartTagItem;
diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx
index 85b0effba78c..49ff9a54afee 100644
--- a/svx/source/mnuctrls/clipboardctl.cxx
+++ b/svx/source/mnuctrls/clipboardctl.cxx
@@ -71,7 +71,7 @@ SvxClipBoardControl::~SvxClipBoardControl()
SfxPopupWindow* SvxClipBoardControl::CreatePopupWindow()
{
- const SvxClipboardFmtItem* pFmtItem = PTR_CAST( SvxClipboardFmtItem, pClipboardFmtItem );
+ const SvxClipboardFmtItem* pFmtItem = dynamic_cast< const SvxClipboardFmtItem* >( pClipboardFmtItem );
if ( pFmtItem )
{
if (pPopup)
diff --git a/svx/source/mnuctrls/fntctl.cxx b/svx/source/mnuctrls/fntctl.cxx
index dfbc44eaa7f4..270d5ef23e6c 100644
--- a/svx/source/mnuctrls/fntctl.cxx
+++ b/svx/source/mnuctrls/fntctl.cxx
@@ -107,7 +107,7 @@ void SvxFontMenuControl::StateChanged(
{
if ( !pMenu->GetItemCount() )
FillMenu();
- const SvxFontItem* pFontItem = PTR_CAST( SvxFontItem, pState );
+ const SvxFontItem* pFontItem = dynamic_cast< const SvxFontItem* >( pState );
String aFont;
if ( pFontItem )
@@ -127,8 +127,9 @@ void SvxFontMenuControl::StateChanged(
void SvxFontMenuControl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- if ( rHint.Type() != TYPE(SfxSimpleHint) &&
- ( (SfxSimpleHint&)rHint ).GetId() == SFX_HINT_DOCCHANGED )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DOCCHANGED == pSfxSimpleHint->GetId())
FillMenu();
}
diff --git a/svx/source/mnuctrls/fntszctl.cxx b/svx/source/mnuctrls/fntszctl.cxx
index 7e317614e608..a9137e09e1a5 100644
--- a/svx/source/mnuctrls/fntszctl.cxx
+++ b/svx/source/mnuctrls/fntszctl.cxx
@@ -90,10 +90,9 @@ void SvxFontSizeMenuControl::StateChanged(
if ( SFX_ITEM_AVAILABLE == eState )
{
- if ( pState->ISA(SvxFontHeightItem) )
+ if ( dynamic_cast< const SvxFontHeightItem* >(pState) )
{
- const SvxFontHeightItem* pItem =
- PTR_CAST( SvxFontHeightItem, pState );
+ const SvxFontHeightItem* pItem = dynamic_cast< const SvxFontHeightItem* >( pState );
long nVal = 0;
if ( pItem )
@@ -113,9 +112,9 @@ void SvxFontSizeMenuControl::StateChanged(
}
pMenu->SetCurHeight( nVal );
}
- else if ( pState->ISA(SvxFontItem) )
+ else if ( dynamic_cast< const SvxFontItem* >(pState) )
{
- const SvxFontItem* pItem = PTR_CAST( SvxFontItem, pState );
+ const SvxFontItem* pItem = dynamic_cast< const SvxFontItem* >( pState );
if ( pItem )
{
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index 1608b9524391..54ba4a1b6a6b 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -36,9 +36,7 @@
#include <svx/xftshcit.hxx>
#include <svx/xftmrit.hxx>
#include <svx/xftouit.hxx>
-#include <svx/sdshtitm.hxx>
#include <svx/xlntrit.hxx>
-#include <svx/sdshcitm.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnwtit.hxx>
#include <svx/xlinjoit.hxx>
@@ -49,6 +47,8 @@
#include <drawinglayer/attribute/lineattribute.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
+#include <svx/sdprcitm.hxx>
+#include <svx/svddef.hxx>
#include <com/sun/star/drawing/LineCap.hpp>
//////////////////////////////////////////////////////////////////////////////
@@ -89,7 +89,7 @@ namespace
if(bShadow)
{
- nRetval = (sal_uInt8)((((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100);
+ nRetval = (sal_uInt8)((((SdrPercentItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue() * 255) / 100);
}
else
{
@@ -105,7 +105,7 @@ namespace
if(bShadow)
{
- const Color aShadowColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
+ const Color aShadowColor(((XColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
aColorAttribute = aShadowColor.getBColor();
}
else
@@ -175,8 +175,8 @@ namespace drawinglayer
SdrFormTextOutlineAttribute maShadowOutline;
// bitfield
- unsigned mbFormTextMirror : 1; // change orientation
- unsigned mbFormTextOutline : 1; // show contour of objects
+ bool mbFormTextMirror : 1; // change orientation
+ bool mbFormTextOutline : 1; // show contour of objects
ImpSdrFormTextAttribute(const SfxItemSet& rSet)
: mnRefCount(0),
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index d9f608755b65..0ed6ea037a16 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -65,14 +65,14 @@ namespace drawinglayer
SdrTextVertAdjust maSdrTextVertAdjust;
// bitfield
- unsigned mbContour : 1;
- unsigned mbFitToSize : 1;
- unsigned mbHideContour : 1;
- unsigned mbBlink : 1;
- unsigned mbScroll : 1;
- unsigned mbInEditMode : 1;
- unsigned mbFixedCellHeight : 1;
- unsigned mbWrongSpell : 1;
+ bool mbContour : 1;
+ bool mbFitToSize : 1;
+ bool mbHideContour : 1;
+ bool mbBlink : 1;
+ bool mbScroll : 1;
+ bool mbInEditMode : 1;
+ bool mbFixedCellHeight : 1;
+ bool mbWrongSpell : 1;
public:
ImpSdrTextAttribute(
@@ -125,7 +125,7 @@ namespace drawinglayer
// #i101556# init with version number to detect changes of single text
// attribute and/or style sheets in primitive data without having to
// copy that data locally (which would be better from principle)
- maPropertiesVersion = pSdrText->GetObject().GetProperties().getVersion();
+ maPropertiesVersion = pSdrText->getSdrTextObj().GetProperties().getVersion();
}
}
@@ -439,7 +439,7 @@ namespace drawinglayer
{
if(isBlink())
{
- getSdrText().GetObject().impGetBlinkTextTiming(rAnimList);
+ getSdrText().getSdrTextObj().impGetBlinkTextTiming(rAnimList);
}
}
@@ -447,7 +447,7 @@ namespace drawinglayer
{
if(isScroll())
{
- getSdrText().GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
+ getSdrText().getSdrTextObj().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
}
}
} // end of namespace attribute
diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx
index 0e52abfb0bfe..163fe2b82f5d 100644
--- a/svx/source/sdr/contact/objectcontact.cxx
+++ b/svx/source/sdr/contact/objectcontact.cxx
@@ -43,8 +43,14 @@ namespace sdr
{
namespace contact
{
+ // sort by ViewObjectContact memory address
+ bool VOCComparator::operator()(ViewObjectContact* pA, ViewObjectContact* pB) const
+ {
+ return pA < pB;
+ }
+
ObjectContact::ObjectContact()
- : maViewObjectContactVector(),
+ : maViewObjectContacts(),
maPrimitiveAnimator(),
mpEventHandler(0),
mpViewObjectContactRedirector(0),
@@ -59,8 +65,8 @@ namespace sdr
// #i84257# To avoid that each 'delete pCandidate' again uses
// the local RemoveViewObjectContact with a search and removal in the
// vector, simply copy and clear local vector.
- std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector);
- maViewObjectContactVector.clear();
+ std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContacts.begin(), maViewObjectContacts.end());
+ maViewObjectContacts.clear();
while(!aLocalVOCList.empty())
{
@@ -75,7 +81,7 @@ namespace sdr
}
// assert when there were new entries added during deletion
- DBG_ASSERT(maViewObjectContactVector.empty(), "Corrupted ViewObjectContactList (!)");
+ DBG_ASSERT(maViewObjectContacts.empty(), "Corrupted ViewObjectContactList (!)");
// delete the EventHandler. This will destroy all still contained events.
DeleteEventHandler();
@@ -96,17 +102,29 @@ namespace sdr
// A new ViewObjectContact was created and shall be remembered.
void ObjectContact::AddViewObjectContact(ViewObjectContact& rVOContact)
{
- maViewObjectContactVector.push_back(&rVOContact);
+#ifdef DBG_UTIL
+ std::pair< ViewObjectContactSet::iterator, bool> aRetval = maViewObjectContacts.insert(&rVOContact);
+ OSL_ENSURE(aRetval.second, "OC: someone tried to add the same VOC a 2nd time (!)");
+#else
+ maViewObjectContacts.insert(&rVOContact);
+#endif
}
// A ViewObjectContact was deleted and shall be forgotten.
void ObjectContact::RemoveViewObjectContact(ViewObjectContact& rVOContact)
{
- std::vector< ViewObjectContact* >::iterator aFindResult = std::find(maViewObjectContactVector.begin(), maViewObjectContactVector.end(), &rVOContact);
-
- if(aFindResult != maViewObjectContactVector.end())
+ if(!maViewObjectContacts.empty())
{
- maViewObjectContactVector.erase(aFindResult);
+ ViewObjectContactSet::iterator aFindResult = maViewObjectContacts.find(&rVOContact);
+
+ if(aFindResult == maViewObjectContacts.end())
+ {
+ OSL_ENSURE(false, "OC: someone tried to remove a VOC which is not registered (!)");
+ }
+ else
+ {
+ maViewObjectContacts.erase(aFindResult);
+ }
}
}
@@ -279,8 +297,8 @@ namespace sdr
return false;
}
- // access to SdrPageView. Default implementation returns NULL
- SdrPageView* ObjectContact::TryToGetSdrPageView() const
+ // access to SdrView. Default implementation returns NULL
+ SdrView* ObjectContact::TryToGetSdrView() const
{
return 0;
}
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index 16742724ca65..7a28ed545fe2 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -104,10 +104,8 @@ namespace sdr
// create ViewRange
if(!bOutputToRecordingMetaFile)
{
- // use visible pixels, but transform to world coordinates
- const Size aOutputSizePixel(pTargetDevice->GetOutputSizePixel());
- aViewRange = ::basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
- aViewRange.transform(pTargetDevice->GetInverseViewTransformation());
+ // use logic visible range
+ aViewRange = pTargetDevice->GetLogicRange();
}
// upate local ViewInformation2D
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 30c160a74419..4ffe3676fee5 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -52,10 +52,10 @@ namespace sdr
{
namespace contact
{
- // internal access to SdrPage of SdrPageView
- SdrPage* ObjectContactOfPageView::GetSdrPage() const
+ // internal access to SdrPage of SdrView
+ SdrPage& ObjectContactOfPageView::GetSdrPage() const
{
- return GetPageWindow().GetPageView().GetPage();
+ return GetPageWindow().GetPageView().getSdrPageFromSdrPageView();
}
ObjectContactOfPageView::ObjectContactOfPageView(SdrPageWindow& rPageWindow)
@@ -106,23 +106,26 @@ namespace sdr
Stop();
// invalidate all LazyInvalidate VOCs new situations
- const sal_uInt32 nVOCCount(getViewObjectContactCount());
-
- for(sal_uInt32 a(0); a < nVOCCount; a++)
+ if(!getViewObjectContacts().empty())
{
- ViewObjectContact* pCandidate = getViewObjectContact(a);
- pCandidate->triggerLazyInvalidate();
+ const ViewObjectContactSet::const_iterator aEnd(getViewObjectContacts().end());
+ ViewObjectContactSet::iterator aCurrent(getViewObjectContacts().begin());
+
+ for(;aCurrent != aEnd; aCurrent++)
+ {
+ (*aCurrent)->triggerLazyInvalidate();
+ }
}
}
// Process the whole displaying
void ObjectContactOfPageView::ProcessDisplay(DisplayInfo& rDisplayInfo)
{
- const SdrPage* pStartPage = GetSdrPage();
+ const SdrPage& rStartPage = GetSdrPage();
- if(pStartPage && !rDisplayInfo.GetProcessLayers().IsEmpty())
+ if(!rDisplayInfo.GetProcessLayers().IsEmpty())
{
- const ViewContact& rDrawPageVC = pStartPage->GetViewContact();
+ const ViewContact& rDrawPageVC = rStartPage.GetViewContact();
if(rDrawPageVC.GetObjectCount())
{
@@ -150,7 +153,7 @@ namespace sdr
{
// visualize entered group when that feature is switched on and it's not
// a print output. #i29129# No ghosted display for printing.
- sal_Bool bVisualizeEnteredGroup(DoVisualizeEnteredGroup() && !isOutputToPrinter());
+ const bool bVisualizeEnteredGroup(DoVisualizeEnteredGroup() && !isOutputToPrinter());
// Visualize entered groups: Set to ghosted as default
// start. Do this only for the DrawPage, not for MasterPages
@@ -173,7 +176,7 @@ namespace sdr
}
// Get start node and process DrawPage contents
- const ViewObjectContact& rDrawPageVOContact = GetSdrPage()->GetViewContact().GetViewObjectContact(*this);
+ const ViewObjectContact& rDrawPageVOContact = GetSdrPage().GetViewContact().GetViewObjectContact(*this);
// update current ViewInformation2D at the ObjectContact
const double fCurrentTime(getPrimitiveAnimator().GetTime());
@@ -199,8 +202,7 @@ namespace sdr
else
{
// use visible pixels, but transform to world coordinates
- const Size aOutputSizePixel(rTargetOutDev.GetOutputSizePixel());
- aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+ aViewRange = rTargetOutDev.GetDiscreteRange();
// if a clip region is set, use it
if(!rDisplayInfo.GetRedrawArea().IsEmpty())
@@ -210,8 +212,7 @@ namespace sdr
basegfx::B2DRange aLogicClipRange(
aLogicClipRectangle.Left(), aLogicClipRectangle.Top(),
aLogicClipRectangle.Right(), aLogicClipRectangle.Bottom());
- basegfx::B2DRange aDiscreteClipRange(aLogicClipRange);
- aDiscreteClipRange.transform(rTargetOutDev.GetViewTransformation());
+ basegfx::B2DRange aDiscreteClipRange(rTargetOutDev.GetViewTransformation() * aLogicClipRange);
// align the discrete one to discrete boundaries (pixel bounds). Also
// expand X and Y max by one due to Rectangle definition source
@@ -235,7 +236,7 @@ namespace sdr
basegfx::B2DHomMatrix(),
rTargetOutDev.GetViewTransformation(),
aViewRange,
- GetXDrawPageForSdrPage(GetSdrPage()),
+ GetXDrawPageForSdrPage(&GetSdrPage()),
fCurrentTime,
uno::Sequence<beans::PropertyValue>());
updateViewInformation2D(aNewViewInformation2D);
@@ -289,25 +290,27 @@ namespace sdr
// get active group's (the entered group) ViewContact
const ViewContact* ObjectContactOfPageView::getActiveViewContact() const
{
- SdrObjList* pActiveGroupList = GetPageWindow().GetPageView().GetObjList();
+ SdrObjList* pActiveGroupList = GetPageWindow().GetPageView().GetCurrentObjectList();
if(pActiveGroupList)
{
- if(pActiveGroupList->ISA(SdrPage))
+ SdrPage* pSdrPage = dynamic_cast< SdrPage* >(pActiveGroupList);
+
+ if(pSdrPage)
{
// It's a Page itself
- return &(((SdrPage*)pActiveGroupList)->GetViewContact());
+ return &(pSdrPage->GetViewContact());
}
- else if(pActiveGroupList->GetOwnerObj())
+ else if(pActiveGroupList->getSdrObjectFromSdrObjList())
{
// Group object
- return &(pActiveGroupList->GetOwnerObj()->GetViewContact());
+ return &(pActiveGroupList->getSdrObjectFromSdrObjList()->GetViewContact());
}
}
- else if(GetSdrPage())
+ else
{
- // use page of associated SdrPageView
- return &(GetSdrPage()->GetViewContact());
+ // use page of associated SdrView
+ return &(GetSdrPage().GetViewContact());
}
return 0;
@@ -333,10 +336,7 @@ namespace sdr
else
{
const OutputDevice& rTargetOutDev = GetPageWindow().GetPaintWindow().GetTargetOutputDevice();
- const Size aOutputSizePixel(rTargetOutDev.GetOutputSizePixel());
- basegfx::B2DRange aLogicViewRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
-
- aLogicViewRange.transform(rTargetOutDev.GetInverseViewTransformation());
+ const basegfx::B2DRange aLogicViewRange(rTargetOutDev.GetLogicRange());
if(!aLogicViewRange.isEmpty() && !aLogicViewRange.overlaps(rRange))
{
@@ -436,10 +436,10 @@ namespace sdr
return (nDrawMode == (DRAWMODE_SETTINGSLINE|DRAWMODE_SETTINGSFILL|DRAWMODE_SETTINGSTEXT|DRAWMODE_SETTINGSGRADIENT));
}
- // access to SdrPageView
- SdrPageView* ObjectContactOfPageView::TryToGetSdrPageView() const
+ // access to SdrView
+ SdrView* ObjectContactOfPageView::TryToGetSdrView() const
{
- return &(mrPageWindow.GetPageView());
+ return &(mrPageWindow.GetPageView().GetView());
}
@@ -459,18 +459,21 @@ namespace sdr
}
// set all UNO controls displayed in the view to design/alive mode
- void ObjectContactOfPageView::SetUNOControlsDesignMode( bool _bDesignMode ) const
+ void ObjectContactOfPageView::SetUNOControlsDesignMode( bool _bDesignMode )
{
- const sal_uInt32 nCount(getViewObjectContactCount());
-
- for(sal_uInt32 a(0); a < nCount; a++)
+ if(!getViewObjectContacts().empty())
{
- const ViewObjectContact* pVOC = getViewObjectContact(a);
- const ViewObjectContactOfUnoControl* pUnoObjectVOC = dynamic_cast< const ViewObjectContactOfUnoControl* >(pVOC);
+ const ViewObjectContactSet::const_iterator aEnd(getViewObjectContacts().end());
+ ViewObjectContactSet::iterator aCurrent(getViewObjectContacts().begin());
- if(pUnoObjectVOC)
+ for(;aCurrent != aEnd; aCurrent++)
{
- pUnoObjectVOC->setControlDesignMode(_bDesignMode);
+ const ViewObjectContactOfUnoControl* pUnoObjectVOC = dynamic_cast< const ViewObjectContactOfUnoControl* >(*aCurrent);
+
+ if(pUnoObjectVOC)
+ {
+ pUnoObjectVOC->setControlDesignMode(_bDesignMode);
+ }
}
}
}
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index cdd90e44bc4f..a5d11173407a 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -32,6 +32,7 @@
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/contact/objectcontactofpageview.hxx>
+#include <drawinglayer/processor2d/hairlineextractor2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,7 +50,9 @@ namespace sdr
ViewContact::ViewContact()
: maViewObjectContactVector(),
- mxViewIndependentPrimitive2DSequence()
+ mxViewIndependentPrimitive2DSequence(),
+ maViewIndependentRange(),
+ maSnapRange()
{
}
@@ -193,6 +196,62 @@ namespace sdr
return false;
}
+ // get the view independent bound rectangle
+ const basegfx::B2DRange& ViewContact::getViewIndependentRange() const
+ {
+ if(maViewIndependentRange.isEmpty())
+ {
+ const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(getViewIndependentPrimitive2DSequence());
+
+ if(xPrimitives.hasElements())
+ {
+ // use neutral ViewInformation and get the range of the primitives. This means that
+ // the ObjectRange on Model-Level is seen as only logical coordinates (no ViewTransformation
+ // in ViewInformation2D). With a identity view transformation the logical coordinates
+ // are used as view coordinates. Also, time point 0.0 is taken which means non-animated
+ // resp. start of animation is used.
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+
+ const_cast< ViewContact* >(this)->maViewIndependentRange =
+ drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D);
+ }
+ }
+
+ return maViewIndependentRange;
+ }
+
+ const basegfx::B2DRange& ViewContact::getSnapRange() const
+ {
+ if(maSnapRange.isEmpty())
+ {
+ const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(getViewIndependentPrimitive2DSequence());
+
+ if(xPrimitives.hasElements())
+ {
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+ drawinglayer::processor2d::HairlineGeometryExtractor2D aHairlineGeometryExtractor2D(aViewInformation2D);
+
+ aHairlineGeometryExtractor2D.process(xPrimitives);
+
+ const std::vector< basegfx::B2DPolyPolygon >& rPolygons = aHairlineGeometryExtractor2D.getExtractedHairlines();
+
+ if(!rPolygons.empty())
+ {
+ basegfx::B2DRange aNewRange;
+
+ for(sal_uInt32 a(0); a < rPolygons.size(); a++)
+ {
+ aNewRange.expand(rPolygons[a].getB2DRange());
+ }
+
+ const_cast< ViewContact* >(this)->maSnapRange = aNewRange;
+ }
+ }
+ }
+
+ return maSnapRange;
+ }
+
// Access to possible sub-hierarchy and parent. GetObjectCount() default is 0L
// and GetViewContact default pops up an assert since it's an error if
// GetObjectCount has a result != 0 and it's not overloaded.
@@ -246,6 +305,16 @@ namespace sdr
pCandidate->ActionChanged();
}
+
+ // reset local buffered primitive sequence (always)
+ if(mxViewIndependentPrimitive2DSequence.hasElements())
+ {
+ mxViewIndependentPrimitive2DSequence.realloc(0);
+ }
+
+ // reset view independent range, it needs to be recalculated
+ maViewIndependentRange.reset();
+ maSnapRange.reset();
}
// access to SdrObject and/or SdrPage. May return 0L like the default
@@ -281,18 +350,17 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContact::getViewIndependentPrimitive2DSequence() const
{
- // local up-to-date checks. Create new list and compare.
- drawinglayer::primitive2d::Primitive2DSequence xNew(createViewIndependentPrimitive2DSequence());
-
- if(xNew.hasElements())
+ if(!mxViewIndependentPrimitive2DSequence.hasElements())
{
- // allow evtl. embedding in object-specific infos, e.g. Name, Title, Description
- xNew = embedToObjectSpecificInformation(xNew);
- }
+ // create primitive list on demand
+ drawinglayer::primitive2d::Primitive2DSequence xNew(createViewIndependentPrimitive2DSequence());
+
+ if(xNew.hasElements())
+ {
+ // allow evtl. embedding in object-specific infos, e.g. Name, Title, Description
+ xNew = embedToObjectSpecificInformation(xNew);
+ }
- if(!drawinglayer::primitive2d::arePrimitive2DSequencesEqual(mxViewIndependentPrimitive2DSequence, xNew))
- {
- // has changed, copy content
const_cast< ViewContact* >(this)->mxViewIndependentPrimitive2DSequence = xNew;
}
@@ -330,6 +398,7 @@ namespace sdr
// delete local VOCs
deleteAllVOCs();
}
+
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx
index d195c87e9774..2d80889985aa 100644
--- a/svx/source/sdr/contact/viewcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3d.cxx
@@ -57,7 +57,7 @@ namespace
{
// the parent scene of rCandidate is a in-between scene, call recursively and collect
// the in-between scene's object transformation part in o_rInBetweenObjectTransform
- const basegfx::B3DHomMatrix& rSceneParentTransform = pSceneParent->GetE3dScene().GetTransform();
+ const basegfx::B3DHomMatrix& rSceneParentTransform = pSceneParent->GetE3dScene().GetB3DTransform();
o_rInBetweenObjectTransform = rSceneParentTransform * o_rInBetweenObjectTransform;
return tryToFindVCOfE3DScene(*pSceneParent, o_rInBetweenObjectTransform);
}
@@ -149,19 +149,29 @@ namespace sdr
drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3d::getVIP3DSWithoutObjectTransform() const
{
- // local up-to-date checks. Create new list and compare.
- drawinglayer::primitive3d::Primitive3DSequence xNew(createViewIndependentPrimitive3DSequence());
-
- if(!drawinglayer::primitive3d::arePrimitive3DSequencesEqual(mxViewIndependentPrimitive3DSequence, xNew))
+ if(!mxViewIndependentPrimitive3DSequence.hasElements())
{
- // has changed, copy content
- const_cast< ViewContactOfE3d* >(this)->mxViewIndependentPrimitive3DSequence = xNew;
+ // create primitive list on demand
+ const_cast< ViewContactOfE3d* >(this)->mxViewIndependentPrimitive3DSequence = createViewIndependentPrimitive3DSequence();
}
// return current Primitive2DSequence
return mxViewIndependentPrimitive3DSequence;
}
+ // React on changes of the object of this ViewContact
+ void ViewContactOfE3d::ActionChanged()
+ {
+ // call parent
+ ViewContactOfSdrObj::ActionChanged();
+
+ // reset local buffered primitive sequence (always)
+ if(mxViewIndependentPrimitive3DSequence.hasElements())
+ {
+ mxViewIndependentPrimitive3DSequence.realloc(0);
+ }
+ }
+
drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3d::getViewIndependentPrimitive3DSequence() const
{
// get sequence without object transform
@@ -170,7 +180,7 @@ namespace sdr
if(xRetval.hasElements())
{
// add object transform if it's used
- const basegfx::B3DHomMatrix& rObjectTransform(GetE3dObject().GetTransform());
+ const basegfx::B3DHomMatrix& rObjectTransform(GetE3dObject().GetB3DTransform());
if(!rObjectTransform.isIdentity())
{
diff --git a/svx/source/sdr/contact/viewcontactofe3dcube.cxx b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
index 2dcb8bfc813c..894a472346e4 100644
--- a/svx/source/sdr/contact/viewcontactofe3dcube.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
@@ -73,8 +73,8 @@ namespace sdr
// add scale and translate to world transformation
const basegfx::B3DVector abjectRange(aCubeRange.getRange());
- aWorldTransform.scale(abjectRange.getX(), abjectRange.getY(), abjectRange.getZ());
- aWorldTransform.translate(aCubeRange.getMinX(), aCubeRange.getMinY(), aCubeRange.getMinZ());
+ aWorldTransform.scale(abjectRange);
+ aWorldTransform.translate(aCubeRange.getMinimum());
// get 3D Object Attributes
drawinglayer::attribute::Sdr3DObjectAttribute* pSdr3DObjectAttribute = drawinglayer::primitive2d::createNewSdr3DObjectAttribute(rItemSet);
diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
index 7902137c8bdc..5cb8c9175b06 100644
--- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
@@ -24,7 +24,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <svx/polysc3d.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -39,6 +38,7 @@
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <svx/scene3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -81,7 +81,7 @@ namespace
// create transform primitive for the created content combining content and transformtion
const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::TransformPrimitive3D(
- pViewContactOfE3dScene->GetE3dScene().GetTransform(),
+ pViewContactOfE3dScene->GetE3dScene().GetB3DTransform(),
aNewAllTarget));
// add created content to all target
@@ -180,7 +180,7 @@ namespace sdr
// without that transformation and makes it necessary to NOT add the first scene to the
// Primitive3DSequence of contained objects.
{
- aTransformation = GetE3dScene().GetTransform();
+ aTransformation = GetE3dScene().GetB3DTransform();
}
// create orientation (world to camera coordinate system)
@@ -257,13 +257,8 @@ namespace sdr
void ViewContactOfE3dScene::createObjectTransformation()
{
- // create 2d Object Transformation from relative point in 2d scene to world
- const Rectangle& rRectangle = GetE3dScene().GetSnapRect();
-
- maObjectTransformation.set(0, 0, rRectangle.getWidth());
- maObjectTransformation.set(1, 1, rRectangle.getHeight());
- maObjectTransformation.set(0, 2, rRectangle.Left());
- maObjectTransformation.set(1, 2, rRectangle.Top());
+ // get Object Transformation
+ maObjectTransformation = GetE3dScene().getSdrObjectTransformation();
}
void ViewContactOfE3dScene::createSdrSceneAttribute()
@@ -361,6 +356,28 @@ namespace sdr
// call parent
ViewContactOfSdrObj::ActionChanged();
+ // Iterate over children and propagate ActionChanged there.
+ // This is needed for 3D objects. In comparison, changes on a
+ // 2d group object are done by changing all sub-objects individually,
+ // so not necessary there
+ const sal_uInt32 nChildrenCount(GetObjectCount());
+
+ for(sal_uInt32 a(0); a < nChildrenCount; a++)
+ {
+ ViewContactOfE3d* pViewContactOfE3d = dynamic_cast< ViewContactOfE3d* >(&GetViewContact(a));
+
+ if(pViewContactOfE3d)
+ {
+ // only reset 2D buffered part (the bound range which is
+ // global to the page)
+ pViewContactOfE3d->ViewContactOfSdrObj::ActionChanged();
+ }
+ else
+ {
+ OSL_ENSURE(false, "3D scene with a non-3D child object (!)");
+ }
+ }
+
// mark locally cached values as invalid
maViewInformation3D = drawinglayer::geometry::ViewInformation3D();
maObjectTransformation.identity();
diff --git a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
index 695a858de64d..0ff2a748b27d 100644
--- a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
@@ -59,8 +59,8 @@ namespace sdr
basegfx::B3DHomMatrix aWorldTransform;
aWorldTransform.translate(-0.5, -0.5, -0.5);
- aWorldTransform.scale(aSphereSize.getX(), aSphereSize.getY(), aSphereSize.getZ());
- aWorldTransform.translate(aSpherePosition.getX(), aSpherePosition.getY(), aSpherePosition.getZ());
+ aWorldTransform.scale(aSphereSize);
+ aWorldTransform.translate(aSpherePosition);
// get 3D Object Attributes
drawinglayer::attribute::Sdr3DObjectAttribute* pSdr3DObjectAttribute = drawinglayer::primitive2d::createNewSdr3DObjectAttribute(rItemSet);
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 543e8262579e..e877e139dd74 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -127,7 +127,8 @@ namespace sdr
}
// decompose object matrix to get single values
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -138,9 +139,13 @@ namespace sdr
{
// create the EmptyPresObj fallback visualisation. The fallback graphic
// is already provided in rGraphicObject in this case, use it
- aSmallerMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aPrefSize.getWidth(), aPrefSize.getHeight(), fOffsetX, fOffsetY);
- aSmallerMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate)
- * aSmallerMatrix;
+ aSmallerMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aPrefSize.getWidth(), aPrefSize.getHeight(),
+ fOffsetX, fOffsetY);
+ aSmallerMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX,
+ fRotate,
+ aTranslate) * aSmallerMatrix;
const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
@@ -187,7 +192,8 @@ namespace sdr
}
// decompose object matrix to get single values
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -227,7 +233,10 @@ namespace sdr
&& basegfx::fTools::lessOrEqual(fHeight, aScale.getY()))
{
const basegfx::B2DHomMatrix aBitmapMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- fWidth, fHeight, fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ fWidth, fHeight,
+ fShearX,
+ fRotate,
+ aTranslate.getX(), aTranslate.getY()));
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
drawinglayer::primitive2d::Primitive2DReference(
@@ -250,7 +259,7 @@ namespace sdr
aDraftText.AppendAscii(" ...");
}
- if(aDraftText.Len() && GetGrafObject().GetModel())
+ if(aDraftText.Len()) // && GetGrafObject().GetModel())
{
// #i103255# Goal is to produce TextPrimitives which hold the given text as
// BlockText in the available space. It would be very tricky to do
@@ -262,20 +271,26 @@ namespace sdr
// needed and can be deleted.
// create temp RectObj as TextObj and set needed attributes
- SdrRectObj aRectObj(OBJ_TEXT);
- aRectObj.SetModel(GetGrafObject().GetModel());
- aRectObj.NbcSetText(aDraftText);
- aRectObj.SetMergedItem(SvxColorItem(Color(COL_LIGHTRED), EE_CHAR_COLOR));
+ SdrRectObj* pRectObj = new SdrRectObj(
+ GetGrafObject().getSdrModelFromSdrObject(),
+ basegfx::B2DHomMatrix(),
+ OBJ_TEXT,
+ true);
+ pRectObj->SetText(aDraftText);
+ pRectObj->SetMergedItem(SvxColorItem(Color(COL_LIGHTRED), EE_CHAR_COLOR));
// get SdrText and OPO
- SdrText* pSdrText = aRectObj.getText(0);
- OutlinerParaObject* pOPO = aRectObj.GetOutlinerParaObject();
+ SdrText* pSdrText = pRectObj->getText(0);
+ OutlinerParaObject* pOPO = pRectObj->GetOutlinerParaObject();
if(pSdrText && pOPO)
{
// directly use the remaining space as TextRangeTransform
const basegfx::B2DHomMatrix aTextRangeTransform(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aScale, fShearX, fRotate, aTranslate));
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate));
// directly create temp SdrBlockTextPrimitive2D
drawinglayer::primitive2d::SdrBlockTextPrimitive2D aBlockTextPrimitive(
@@ -298,6 +313,8 @@ namespace sdr
xRetval,
aBlockTextPrimitive.get2DDecomposition(aViewInformation2D));
}
+
+ deleteSdrObjectSafeAndClearPointer(pRectObj);
}
return xRetval;
@@ -331,55 +348,14 @@ namespace sdr
GetGrafObject().getText(0),
bHasContent));
- // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect()
- // which will use the primitive data we just create in the near future
- const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
-
- // look for mirroring
- const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
- const sal_Int32 nDrehWink(rGeoStat.nDrehWink);
- const bool bRota180(18000 == nDrehWink);
- const bool bMirrored(GetGrafObject().IsMirrored());
- const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
- bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase));
- bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase));
-
- // set mirror flags at LocalGrafInfo. Take into account that the geometry in
- // aObjectRange is already changed and rotated when bRota180 is used. To rebuild
- // that old behaviour (as long as part of the model data), correct the H/V flags
- // accordingly. The created bitmapPrimitive WILL use the rotation, too.
- if(bRota180)
- {
- // if bRota180 which is used for vertical mirroring, the graphic will already be rotated
- // by 180 degrees. To correct, switch off VMirror and invert HMirroring.
- bHMirr = !bHMirr;
- bVMirr = false;
- }
-
- if(bHMirr || bVMirr)
- {
- aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
- }
-
- // fill object matrix
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // get the current, unchenged graphic obect from SdrGrafObj
- const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+ // get object transformation
+ const basegfx::B2DHomMatrix& rObjectMatrix(GetGrafObject().getSdrObjectTransformation());
if(visualisationUsesPresObj())
{
// it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
// with the content which is the placeholder graphic
- xRetval = createVIP2DSForPresObj(aObjectMatrix, aAttribute, aLocalGrafInfo);
+ xRetval = createVIP2DSForPresObj(rObjectMatrix, aAttribute, aLocalGrafInfo);
}
else if(visualisationUsesDraft())
{
@@ -388,15 +364,18 @@ namespace sdr
// visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
// and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
// (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
- xRetval = createVIP2DSForDraft(aObjectMatrix, aAttribute);
+ xRetval = createVIP2DSForDraft(rObjectMatrix, aAttribute);
}
else
{
+ // get the current, unchanged graphic obect from SdrGrafObj
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+
// create primitive. Info: Calling the copy-constructor of GraphicObject in this
// SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aObjectMatrix,
+ rObjectMatrix,
aAttribute,
rGraphicObject,
aLocalGrafInfo));
@@ -407,7 +386,8 @@ namespace sdr
// always append an invisible outline for the cases where no visible content exists
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
- false, aObjectMatrix));
+ false,
+ rObjectMatrix));
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofgroup.cxx b/svx/source/sdr/contact/viewcontactofgroup.cxx
index 1af3fb2fd8a9..54841120ba08 100644
--- a/svx/source/sdr/contact/viewcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewcontactofgroup.cxx
@@ -33,6 +33,7 @@
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -78,14 +79,10 @@ namespace sdr
else
{
// append an invisible outline for the cases where no visible content exists
- const Rectangle aCurrentBoundRect(GetSdrObjGroup().GetLastBoundRect());
- const basegfx::B2DRange aCurrentRange(
- aCurrentBoundRect.Left(), aCurrentBoundRect.Top(),
- aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom());
-
const drawinglayer::primitive2d::Primitive2DReference xReference(
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
- false, aCurrentRange));
+ false,
+ GetSdrObjGroup().getSdrObjectTransformation()));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
index f5502e7b06e2..dc5def7c3466 100644
--- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
@@ -70,10 +70,7 @@ namespace sdr
{
// direct model data is the page size, get and use it
const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
- const basegfx::B2DRange aInnerRange(
- rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
- rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(),
- rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
+ const basegfx::B2DRange aInnerRange(rOwnerPage.GetInnerPageRange());
const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
const basegfx::B2DHomMatrix aEmptyTransform;
const drawinglayer::primitive2d::Primitive2DReference xReference(
diff --git a/svx/source/sdr/contact/viewcontactofpageobj.cxx b/svx/source/sdr/contact/viewcontactofpageobj.cxx
index 57b035d93f8e..c9e581513420 100644
--- a/svx/source/sdr/contact/viewcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofpageobj.cxx
@@ -34,6 +34,7 @@
#include <svx/sdr/contact/viewobjectcontactofpageobj.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -85,11 +86,13 @@ namespace sdr
// ceate graphical visualisation data. Since this is the view-independent version which should not be used,
// create a replacement graphic visualisation here. Use GetLastBoundRect to access the model data directly
// which is aOutRect for SdrPageObj.
- const Rectangle aModelRectangle(GetPageObj().GetLastBoundRect());
- const basegfx::B2DRange aModelRange(aModelRectangle.Left(), aModelRectangle.Top(), aModelRectangle.Right(), aModelRectangle.Bottom());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aModelRange));
+ const basegfx::B2DPolygon aOutline(
+ GetPageObj().getSdrObjectTransformation() * basegfx::tools::createUnitPolygon());
const basegfx::BColor aYellow(1.0, 1.0, 0.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aOutline,
+ aYellow));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 9b88e1803f7e..523aba4e63af 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -68,25 +68,25 @@ namespace sdr
rCaptionObj.getText(0),
false));
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = rCaptionObj.GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(rCaptionObj.GetGeoStat());
-
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // get object transformation
+ basegfx::B2DHomMatrix aObjectMatrix(rCaptionObj.getSdrObjectTransformation());
// calculate corner radius
- double fCornerRadiusX;
- double fCornerRadiusY;
+ double fCornerRadiusX(0.0);
+ double fCornerRadiusY(0.0);
+
+ if(rCaptionObj.GetEdgeRadius())
+ {
+ // get absolute object size
+ const basegfx::B2DVector aObjectScale(basegfx::absolute(rCaptionObj.getSdrObjectScale()));
+
drawinglayer::primitive2d::calculateRelativeCornerRadius(
- rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY);
+ rCaptionObj.GetEdgeRadius(),
+ aObjectScale.getX(),
+ aObjectScale.getY(),
+ fCornerRadiusX,
+ fCornerRadiusY);
+ }
// create primitive. Always create one (even if invisible) to let the decomposition
// of SdrCaptionPrimitive2D create needed invisible elements for HitTest and BoundRect
@@ -104,10 +104,9 @@ namespace sdr
{
// for SC, the caption object may have a specialized shadow. The usual object shadow is off
// and a specialized shadow gets created here (see old paint)
- const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
- const sal_uInt16 nShadowTransparence(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ const XColorItem& rShadColItem = (XColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
const Color aShadowColor(rShadColItem.GetColorValue());
- const XFillStyle eShadowStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
+ const XFillStyle eShadowStyle(((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue());
// Create own ItemSet and modify as needed
// Always hide lines for special calc shadow
@@ -129,7 +128,8 @@ namespace sdr
aSet.Put(XFillStyleItem(XFILL_SOLID));
}
- aSet.Put(XFillColorItem(String(),aShadowColor));
+ const sal_uInt16 nShadowTransparence(((SdrPercentItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ aSet.Put(XFillColorItem(String(), aShadowColor));
aSet.Put(XFillTransparenceItem(nShadowTransparence));
}
@@ -141,8 +141,8 @@ namespace sdr
if(!aFill.isDefault() && 1.0 != aFill.getTransparence())
{
// add shadow offset to object matrix
- const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
- const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
+ const sal_uInt32 nXDist(((SdrMetricItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
+ const sal_uInt32 nYDist(((SdrMetricItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
if(nXDist || nYDist)
{
diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
index b9afe48258a8..45629029ca67 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
@@ -29,7 +29,6 @@
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/primitive2d/sdrellipseprimitive2d.hxx>
#include <svl/itemset.hxx>
-#include <svx/sxciaitm.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -49,6 +48,7 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrCircObj::createViewIndependentPrimitive2DSequence() const
{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetCircObj().GetMergedItemSet();
const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
@@ -56,56 +56,46 @@ namespace sdr
GetCircObj().getText(0),
false));
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetCircObj().GetGeoRect();
- const basegfx::B2DRange aObjectRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetCircObj().GetGeoStat());
-
- // fill object matrix
- const basegfx::B2DHomMatrix aObjectMatrix(
- basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // get object transformation
+ const basegfx::B2DHomMatrix& rObjectMatrix(GetCircObj().getSdrObjectTransformation());
// create primitive data
- const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
+ const SdrCircleObjType aSdrCircleObjType(GetCircObj().GetSdrCircleObjType());
// always create primitives to allow the decomposition of SdrEllipsePrimitive2D
// or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest
// and/or BoundRect
- if(OBJ_CIRC == nIdentifier)
+ if(CircleType_Circle == aSdrCircleObjType)
{
+ // full circle
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::SdrEllipsePrimitive2D(
- aObjectMatrix,
+ rObjectMatrix,
aAttribute));
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
else
{
- const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue());
- const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue());
- const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000);
- const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000);
- const bool bCloseSegment(OBJ_CARC != nIdentifier);
- const bool bCloseUsingCenter(OBJ_SECT == nIdentifier);
+ // circle segment
+ const double fStart(GetCircObj().GetStartAngle());
+ const double fEnd(GetCircObj().GetEndAngle());
+ const bool bCloseSegment(CircleType_Arc != aSdrCircleObjType);
+ const bool bCloseUsingCenter(CircleType_Sector == aSdrCircleObjType);
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(
- aObjectMatrix,
+ rObjectMatrix,
aAttribute,
fStart,
fEnd,
bCloseSegment,
bCloseUsingCenter));
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
index 27530e9711a3..4757b63993f4 100644
--- a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
@@ -46,7 +46,7 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrEdgeObj::createViewIndependentPrimitive2DSequence() const
{
- const basegfx::B2DPolygon& rEdgeTrack = GetEdgeObj().getEdgeTrack();
+ const basegfx::B2DPolygon& rEdgeTrack = GetEdgeObj().GetEdgeTrackPath();
// what to do when no EdgeTrack is provided (HitTest and selectability) ?
OSL_ENSURE(0 != rEdgeTrack.count(), "Connectors with no geometry are not allowed (!)");
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index 29d302f6193a..03b9de5f1671 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
@@ -28,10 +28,6 @@
#include <svx/svdomeas.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svl/itemset.hxx>
-#include <svx/sxmbritm.hxx>
-#include <svx/sxmlhitm.hxx>
-#include <svx/sxmtritm.hxx>
-#include <svx/sxmtaitm.hxx>
#include <svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx>
#include <svx/sxmtpitm.hxx>
@@ -59,16 +55,16 @@ namespace sdr
GetMeasureObj().getText(0)));
// take properties which are the model data.
- const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y());
- const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y());
- const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
- const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
- const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
- const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
- const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
- const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
- const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
- const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
+ const ::basegfx::B2DPoint aStart(GetMeasureObj().GetObjectPoint(0));
+ const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetObjectPoint(1));
+ const double fDistance(((SdrMetricItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
+ const double fUpperDistance(((SdrMetricItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
+ const double fLowerDistance(((SdrMetricItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
+ const double fLeftDelta(((SdrMetricItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
+ const double fRightDelta(((SdrMetricItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
+ const bool bBelow(((SdrYesNoItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
+ const bool bTextRotation(((SdrYesNoItem&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
+ const bool bTextAutoAngle(((SdrYesNoItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
diff --git a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
index 32650e18efaf..aff2747ab212 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
@@ -147,19 +147,10 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrMediaObj::createViewIndependentPrimitive2DSequence() const
{
- // create range using the model data directly. This is in SdrTextObj::aRect which i will access using
- // GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM.
- const Rectangle& rRectangle(GetSdrMediaObj().GetGeoRect());
- const basegfx::B2DRange aRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aTransform;
- aTransform.set(0, 0, aRange.getWidth());
- aTransform.set(1, 1, aRange.getHeight());
- aTransform.set(0, 2, aRange.getMinX());
- aTransform.set(1, 2, aRange.getMinY());
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+
+ // get object transformation
+ const basegfx::B2DHomMatrix& rObjectMatrix(GetSdrMediaObj().getSdrObjectTransformation());
// create media primitive. Always create primitives to allow the
// decomposition of MediaPrimitive2D to create needed invisible elements for HitTest
@@ -167,11 +158,16 @@ namespace sdr
const basegfx::BColor aBackgroundColor(67.0 / 255.0, 67.0 / 255.0, 67.0 / 255.0);
const rtl::OUString& rURL(GetSdrMediaObj().getURL());
const sal_uInt32 nPixelBorder(4L);
- const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::MediaPrimitive2D(
- aTransform, rURL, aBackgroundColor, nPixelBorder));
+ rObjectMatrix,
+ rURL,
+ aBackgroundColor,
+ nPixelBorder));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index ef6d6e644001..dbd8ca15d7a8 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -38,6 +38,7 @@
#include <svx/sdrpagewindow.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
+#include <svx/svdlegacy.hxx>
#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -62,10 +63,11 @@ namespace sdr
meRememberedAnimationKind(SDRTEXTANI_NONE)
{
// init AnimationKind
- if(GetSdrObject().ISA(SdrTextObj))
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(&GetSdrObject());
+
+ if(pTextObj)
{
- SdrTextObj& rTextObj = (SdrTextObj&)GetSdrObject();
- meRememberedAnimationKind = rTextObj.GetTextAniKind();
+ meRememberedAnimationKind = pTextObj->GetTextAniKind();
}
}
@@ -76,9 +78,9 @@ namespace sdr
// Access to possible sub-hierarchy
sal_uInt32 ViewContactOfSdrObj::GetObjectCount() const
{
- if(GetSdrObject().GetSubList())
+ if(GetSdrObject().getChildrenOfSdrObject())
{
- return GetSdrObject().GetSubList()->GetObjCount();
+ return GetSdrObject().getChildrenOfSdrObject()->GetObjCount();
}
return 0L;
@@ -86,9 +88,9 @@ namespace sdr
ViewContact& ViewContactOfSdrObj::GetViewContact(sal_uInt32 nIndex) const
{
- DBG_ASSERT(GetSdrObject().GetSubList(),
+ DBG_ASSERT(GetSdrObject().getChildrenOfSdrObject(),
"ViewContactOfSdrObj::GetViewContact: Access to non-existent Sub-List (!)");
- SdrObject* pObj = GetSdrObject().GetSubList()->GetObj(nIndex);
+ SdrObject* pObj = GetSdrObject().getChildrenOfSdrObject()->GetObj(nIndex);
DBG_ASSERT(pObj, "ViewContactOfSdrObj::GetViewContact: Corrupt SdrObjList (!)");
return pObj->GetViewContact();
}
@@ -96,21 +98,23 @@ namespace sdr
ViewContact* ViewContactOfSdrObj::GetParentContact() const
{
ViewContact* pRetval = 0L;
- SdrObjList* pObjList = GetSdrObject().GetObjList();
+ SdrObjList* pObjList = GetSdrObject().getParentOfSdrObject();
if(pObjList)
{
- if(pObjList->ISA(SdrPage))
+ SdrPage* pSdrPage = dynamic_cast< SdrPage* >(pObjList);
+
+ if(pSdrPage)
{
// Is a page
- pRetval = &(((SdrPage*)pObjList)->GetViewContact());
+ pRetval = &(pSdrPage->GetViewContact());
}
else
{
// Is a group?
- if(pObjList->GetOwnerObj())
+ if(pObjList->getSdrObjectFromSdrObjList())
{
- pRetval = &(pObjList->GetOwnerObj()->GetViewContact());
+ pRetval = &(pObjList->getSdrObjectFromSdrObjList()->GetViewContact());
}
}
}
@@ -122,14 +126,14 @@ namespace sdr
void ViewContactOfSdrObj::ActionChanged()
{
// look for own changes
- if(GetSdrObject().ISA(SdrTextObj))
- {
- SdrTextObj& rTextObj = (SdrTextObj&)GetSdrObject();
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(&GetSdrObject());
- if(rTextObj.GetTextAniKind() != meRememberedAnimationKind)
+ if(pTextObj)
+ {
+ if(pTextObj->GetTextAniKind() != meRememberedAnimationKind)
{
// #i38135# now remember new type
- meRememberedAnimationKind = rTextObj.GetTextAniKind();
+ meRememberedAnimationKind = pTextObj->GetTextAniKind();
}
}
@@ -165,9 +169,9 @@ namespace sdr
for(sal_uInt32 a(0L); a < nCount; a++)
{
const SdrGluePoint& rCandidate = (*pGluePointList)[(sal_uInt16)a];
- const Point aPosition(rCandidate.GetAbsolutePos(GetSdrObject()));
+ const basegfx::B2DPoint aPosition(rCandidate.GetAbsolutePos(sdr::legacy::GetSnapRange(GetSdrObject())));
- aGluepointVector.push_back(basegfx::B2DPoint(aPosition.X(), aPosition.Y()));
+ aGluepointVector.push_back(aPosition);
}
if(!aGluepointVector.empty())
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index bdf17795566d..ca07f0df0c25 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -50,54 +50,52 @@ namespace sdr
{
}
- basegfx::B2DRange ViewContactOfSdrObjCustomShape::getCorrectedTextBoundRect() const
+ basegfx::B2DRange ViewContactOfSdrObjCustomShape::getCorrectedTextBoundRect(
+ const basegfx::B2DRange& rObjectRange,
+ double fRotate,
+ double fShearX) const
{
- const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
- Rectangle aTextBound(aObjectBound);
- GetCustomShapeObj().GetTextBounds(aTextBound);
- basegfx::B2DRange aTextRange(aTextBound.Left(), aTextBound.Top(), aTextBound.Right(), aTextBound.Bottom());
- const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
+ // get text range in object coordinates
+ basegfx::B2DRange aTextRange(GetCustomShapeObj().getRawUnifiedTextRange());
+ aTextRange.transform(GetCustomShapeObj().getSdrObjectTransformation());
// no need to correct if no extra text range
- if(aTextRange != aObjectRange)
+ if(aTextRange != rObjectRange)
{
- const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
-
// only correct when rotation and/or shear is used
- if(rGeoStat.nShearWink || rGeoStat.nDrehWink )
+ if(!basegfx::fTools::equalZero(fRotate)
+ || !basegfx::fTools::equalZero(fShearX))
{
// text range needs to be corrected by
- // aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's
+ // rObjectRange.getCenter() - aRotObjectRange.getCenter() since it's
// defined differenly by using rotation around object center. Start
// with positive part
- basegfx::B2DVector aTranslation(aObjectRange.getCenter());
+ basegfx::B2DPoint aTranslation(rObjectRange.getCenter());
// get rotated and sheared object's range
- basegfx::B2DRange aRotObjectRange(aObjectRange);
+ basegfx::B2DRange aRotObjectRange(rObjectRange);
basegfx::B2DHomMatrix aRotMatrix;
- aRotMatrix.translate(-aObjectRange.getMinimum().getX(), -aObjectRange.getMinimum().getY());
+ aRotMatrix.translate(-rObjectRange.getMinimum());
- if(rGeoStat.nShearWink)
+ if(!basegfx::fTools::equalZero(fShearX))
{
- aRotMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
+ aRotMatrix.shearX(fShearX);
}
- if(rGeoStat.nDrehWink)
+ if(!basegfx::fTools::equalZero(fRotate))
{
- aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
+ aRotMatrix.rotate(fRotate);
}
- aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ aRotMatrix.translate(rObjectRange.getMinimum());
aRotObjectRange.transform(aRotMatrix);
// add negative translation part
aTranslation -= aRotObjectRange.getCenter();
// create new range
- aTextRange = basegfx::B2DRange(
- aTextRange.getMinX() + aTranslation.getX(), aTextRange.getMinY() + aTranslation.getY(),
- aTextRange.getMaxX() + aTranslation.getX(), aTextRange.getMaxY() + aTranslation.getY());
+ aTextRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aTranslation));
}
}
@@ -141,6 +139,11 @@ namespace sdr
}
}
+ // build unrotated object range
+ const basegfx::B2DRange aObjectRange(
+ GetCustomShapeObj().getSdrObjectTranslate(),
+ GetCustomShapeObj().getSdrObjectTranslate() + basegfx::absolute(GetCustomShapeObj().getSdrObjectScale()));
+
if(bHasText || xGroup.hasElements())
{
// prepare text box geometry
@@ -149,61 +152,59 @@ namespace sdr
if(bHasText)
{
- // take unrotated snap rect as default, then get the
- // unrotated text box. Rotation needs to be done centered
- const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
- const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
-
// #i101684# get the text range unrotated and absolute to the object range
- const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
+ const basegfx::B2DRange aTextRange(
+ getCorrectedTextBoundRect(
+ aObjectRange,
+ GetCustomShapeObj().getSdrObjectRotate(),
+ GetCustomShapeObj().getSdrObjectShearX()));
// give text object a size
aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
// check if we have a rotation/shear at all to take care of
const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
- const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
- if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
+ if(GetCustomShapeObj().isSheared()
+ || GetCustomShapeObj().isRotated()
+ || !basegfx::fTools::equalZero(fExtraTextRotation))
{
if(aObjectRange != aTextRange)
{
// move relative to unrotated object range
- aTextBoxMatrix.translate(
- aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
- aTextRange.getMinY() - aObjectRange.getMinimum().getY());
+ aTextBoxMatrix.translate(aTextRange.getMinimum() - aObjectRange.getMinimum());
}
if(!basegfx::fTools::equalZero(fExtraTextRotation))
{
- basegfx::B2DVector aTranslation(
+ basegfx::B2DPoint aTranslation(
( aTextRange.getWidth() / 2 ) + ( aTextRange.getMinX() - aObjectRange.getMinimum().getX() ),
( aTextRange.getHeight() / 2 ) + ( aTextRange.getMinY() - aObjectRange.getMinimum().getY() ) );
- aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() );
+ aTextBoxMatrix.translate( -aTranslation );
aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
- aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() );
+ aTextBoxMatrix.translate( aTranslation );
}
- if(rGeoStat.nShearWink)
+ if(GetCustomShapeObj().isSheared())
{
- aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
+ aTextBoxMatrix.shearX(GetCustomShapeObj().getSdrObjectShearX());
}
- if(rGeoStat.nDrehWink)
+ if(GetCustomShapeObj().isRotated())
{
- aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
+ aTextBoxMatrix.rotate(GetCustomShapeObj().getSdrObjectRotate());
}
// give text it's target position
- aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ aTextBoxMatrix.translate(aObjectRange.getMinimum());
}
else
{
- aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
+ aTextBoxMatrix.translate(aTextRange.getMinimum());
}
- // check if SdrTextWordWrapItem is set
- bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
+ // check if TextWordWrap is set
+ bWordWrap = ((SdrOnOffItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
}
// create primitive
@@ -221,23 +222,13 @@ namespace sdr
// #119863# always append an invisible outline for the cases where no visible content exists
if(true)
{
- const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
- const basegfx::B2DRange aObjectRange(
- aObjectBound.Left(), aObjectBound.Top(),
- aObjectBound.Right(), aObjectBound.Bottom());
-
- // create object matrix
- const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // get object transformation
+ const basegfx::B2DHomMatrix& rObjectMatrix(GetCustomShapeObj().getSdrObjectTransformation());
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
false,
- aObjectMatrix));
+ rObjectMatrix));
}
return xRetval;
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index 202f24106705..b6377f5243ad 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -66,29 +66,11 @@ namespace sdr
{
}
- basegfx::B2DHomMatrix ViewContactOfSdrOle2Obj::createObjectTransform() const
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
- const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // create object matrix
- const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
-
- return basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- fShearX,
- fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY());
- }
-
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
bool bHighContrast) const
{
// get object transformation
- const basegfx::B2DHomMatrix aObjectMatrix(createObjectTransform());
+ const basegfx::B2DHomMatrix& rObjectMatrix(GetOle2Obj().getSdrObjectTransformation());
// Prepare attribute settings, will be used soon anyways
const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
@@ -124,7 +106,7 @@ namespace sdr
-aChartContentRange.getMinY()));
aEmbed.scale(1.0 / fWidth, 1.0 / fHeight);
- aEmbed = aObjectMatrix * aEmbed;
+ aEmbed = rObjectMatrix * aEmbed;
xContent = new drawinglayer::primitive2d::TransformPrimitive2D(
aEmbed,
aChartSequence);
@@ -139,7 +121,7 @@ namespace sdr
// It will also take care of HighContrast and ScaleContent
xContent = new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
GetOle2Obj(),
- aObjectMatrix,
+ rObjectMatrix,
// #i104867# add GraphicVersion number to be able to check for
// content change in the primitive later
@@ -154,7 +136,7 @@ namespace sdr
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::SdrOle2Primitive2D(
drawinglayer::primitive2d::Primitive2DSequence(&xContent, 1),
- aObjectMatrix,
+ rObjectMatrix,
aAttribute));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index 7a0eacd29243..d12ae321b1a9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -131,11 +131,9 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const
{
- static bool bUseOldPageShadow(false);
const SdrPage& rPage = getPage();
- basegfx::B2DHomMatrix aPageMatrix;
- aPageMatrix.set(0, 0, (double)rPage.GetWdt());
- aPageMatrix.set(1, 1, (double)rPage.GetHgt());
+ const basegfx::B2DHomMatrix aPageMatrix(basegfx::tools::createScaleB2DHomMatrix(rPage.GetPageScale()));
+ static bool bUseOldPageShadow(false);
if(bUseOldPageShadow)
{
@@ -218,7 +216,7 @@ namespace sdr
if(rPage.IsMasterPage())
{
- if(0 == rPage.GetPageNum())
+ if(0 == rPage.GetPageNumber())
{
// #i98063#
// filter MasterPage 0 since it's the HandoutPage. Thus, it's a
@@ -242,9 +240,7 @@ namespace sdr
if(!aFill.isDefault())
{
// direct model data is the page size, get and use it
- const basegfx::B2DRange aInnerRange(
- rPage.GetLftBorder(), rPage.GetUppBorder(),
- rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
+ const basegfx::B2DRange aInnerRange(rPage.GetInnerPageRange());
const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
const basegfx::B2DHomMatrix aEmptyTransform;
const drawinglayer::primitive2d::Primitive2DReference xReference(
@@ -290,7 +286,7 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageFill::createViewIndependentPrimitive2DSequence() const
{
const SdrPage& rPage = getPage();
- const basegfx::B2DRange aPageFillRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt());
+ const basegfx::B2DRange aPageFillRange(basegfx::B2DPoint(0.0, 0.0), rPage.GetPageScale());
const basegfx::B2DPolygon aPageFillPolygon(basegfx::tools::createPolygonFromRect(aPageFillRange));
// We have only the page information, not the view information. Use the
@@ -334,7 +330,7 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SdrPage& rPage = getPage();
- const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt());
+ const basegfx::B2DRange aPageBorderRange(basegfx::B2DPoint(0.0, 0.0), rPage.GetPageScale());
// Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used.
// Added old case as fallback for HighContrast.
@@ -402,9 +398,7 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfInnerPageBorder::createViewIndependentPrimitive2DSequence() const
{
const SdrPage& rPage = getPage();
- const basegfx::B2DRange aPageBorderRange(
- (double)rPage.GetLftBorder(), (double)rPage.GetUppBorder(),
- (double)(rPage.GetWdt() - rPage.GetRgtBorder()), (double)(rPage.GetHgt() - rPage.GetLwrBorder()));
+ const basegfx::B2DRange aPageBorderRange(rPage.GetInnerPageRange());
const basegfx::B2DPolygon aPageBorderPolygon(basegfx::tools::createPolygonFromRect(aPageBorderRange));
// We have only the page information, not the view information. Use the
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 0b3b7557536d..fb91f94eb497 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -48,13 +48,14 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrPathObj::createViewIndependentPrimitive2DSequence() const
{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetPathObj().GetMergedItemSet();
const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
rItemSet,
GetPathObj().getText(0),
false));
- basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
+ basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().getB2DPolyPolygonInObjectCoordinates());
sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
sal_uInt32 nPointCount(0);
@@ -96,33 +97,16 @@ namespace sdr
aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
// #i102548# fill objectMatrix with rotation and offset (no shear for lines)
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectMatrix = basegfx::tools::createScaleRotateTranslateB2DHomMatrix(
aLine.getLength(), 1.0,
- 0.0,
atan2(aLine.getY(), aLine.getX()),
aStart.getX(), aStart.getY());
}
else
{
- // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
- // (unit polygon) by creating the object matrix and back-transforming the polygon
- const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
- const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
- const double fWidth(aObjectRange.getWidth());
- const double fHeight(aObjectRange.getHeight());
- const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth);
- const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
-
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- fScaleX, fScaleY,
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY());
-
- // ceate unit polygon from object's absolute path
- basegfx::B2DHomMatrix aInverse(aObjectMatrix);
- aInverse.invert();
- aUnitPolyPolygon.transform(aInverse);
+ // get transformation and unit polygon
+ aUnitPolyPolygon = GetPathObj().getB2DPolyPolygonInNormalizedCoordinates();
+ aObjectMatrix = GetPathObj().getSdrObjectTransformation();
}
// create primitive. Always create primitives to allow the decomposition of
@@ -133,7 +117,9 @@ namespace sdr
aAttribute,
aUnitPolyPolygon));
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index 56841ef2d3de..7ed4b57655eb 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -50,6 +50,9 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrRectObj::createViewIndependentPrimitive2DSequence() const
{
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+
+ // Prepare attribute settings
const SfxItemSet& rItemSet = GetRectObj().GetMergedItemSet();
const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
@@ -57,42 +60,41 @@ namespace sdr
GetRectObj().getText(0),
false));
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetRectObj().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
+ // calculate corner radius
+ const sal_uInt32 nCornerRadius(((SdrMetricItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
+ double fCornerRadiusX(0.0);
+ double fCornerRadiusY(0.0);
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ if(nCornerRadius)
+ {
+ // get absolute object size
+ const basegfx::B2DVector aAbsScale(basegfx::absolute(GetRectObj().getSdrObjectScale()));
- // calculate corner radius
- sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(
+ nCornerRadius,
+ aAbsScale.getX(),
+ aAbsScale.getY(),
+ fCornerRadiusX,
+ fCornerRadiusY);
+ }
// #i105856# use knowledge about pickthrough from the model
- const bool bPickThroughTransparentTextFrames(
- GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
+ const bool bPickThroughTransparentTextFrames(GetRectObj().getSdrModelFromSdrObject().IsPickThroughTransparentTextFrames());
// create primitive. Always create primitives to allow the decomposition of
// SdrRectanglePrimitive2D to create needed invisible elements for HitTest and/or BoundRect
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
- aObjectMatrix,
+ GetRectObj().getSdrObjectTransformation(),
aAttribute,
fCornerRadiusX,
fCornerRadiusY,
// #i105856# use fill for HitTest when TextFrame and not PickThrough
GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index d14fa59d9110..ab31991b8e54 100644
--- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
@@ -86,19 +86,16 @@ namespace sdr { namespace contact {
//====================================================================
//= ViewContactOfUnoControl
//====================================================================
- DBG_NAME( ViewContactOfUnoControl )
//--------------------------------------------------------------------
ViewContactOfUnoControl::ViewContactOfUnoControl( SdrUnoObj& _rUnoObject )
:ViewContactOfSdrObj( _rUnoObject )
,m_pImpl( new ViewContactOfUnoControl_Impl )
{
- DBG_CTOR( ViewContactOfUnoControl, NULL );
}
//--------------------------------------------------------------------
ViewContactOfUnoControl::~ViewContactOfUnoControl()
{
- DBG_DTOR( ViewContactOfUnoControl, NULL );
}
//--------------------------------------------------------------------
@@ -132,44 +129,34 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfUnoControl::createViewIndependentPrimitive2DSequence() const
{
- // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use
- // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj)
- // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything
- const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect());
- const basegfx::B2DRange aRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aTransform;
-
- aTransform.set(0, 0, aRange.getWidth());
- aTransform.set(1, 1, aRange.getHeight());
- aTransform.set(0, 2, aRange.getMinX());
- aTransform.set(1, 2, aRange.getMinY());
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ // get object transformation and control model
+ const basegfx::B2DHomMatrix& rObjectMatrix(GetSdrUnoObj().getSdrObjectTransformation());
Reference< XControlModel > xControlModel = GetSdrUnoObj().GetUnoControlModel();
if(xControlModel.is())
{
// create control primitive WITHOUT possibly existing XControl; this would be done in
// the VOC in createPrimitive2DSequence()
- const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::ControlPrimitive2D(
- aTransform,
+ rObjectMatrix,
xControlModel));
- return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
else
{
// always append an invisible outline for the cases where no visible content exists
- const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
- false, aTransform));
+ false, rObjectMatrix));
- return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+
+ return xRetval;
}
//........................................................................
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index 255cd49de8a2..583519604cb3 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -40,6 +40,11 @@
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
+#ifdef DBG_UTIL
+#include <svx/svdobj.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#endif
+
//////////////////////////////////////////////////////////////////////////////
using namespace com::sun::star;
@@ -65,14 +70,16 @@ namespace
// bitfield
// text animation allowed?
- unsigned mbTextAnimationAllowed : 1;
+ bool mbTextAnimationAllowed : 1;
// graphic animation allowed?
- unsigned mbGraphicAnimationAllowed : 1;
+ bool mbGraphicAnimationAllowed : 1;
// as tooling, the process() implementation takes over API handling and calls this
// virtual render method when the primitive implementation is BasePrimitive2D-based.
- virtual void processBasePrimitive2D(const drawinglayer::primitive2d::BasePrimitive2D& rCandidate);
+ virtual void processBasePrimitive2D(
+ const drawinglayer::primitive2d::BasePrimitive2D& rCandidate,
+ const drawinglayer::primitive2d::Primitive2DReference& rUnoCandidate);
public:
AnimatedExtractingProcessor2D(
@@ -102,7 +109,9 @@ namespace
{
}
- void AnimatedExtractingProcessor2D::processBasePrimitive2D(const drawinglayer::primitive2d::BasePrimitive2D& rCandidate)
+ void AnimatedExtractingProcessor2D::processBasePrimitive2D(
+ const drawinglayer::primitive2d::BasePrimitive2D& rCandidate,
+ const drawinglayer::primitive2d::Primitive2DReference& /*rUnoCandidate*/)
{
// known implementation, access directly
switch(rCandidate.getPrimitive2DID())
@@ -171,7 +180,7 @@ namespace sdr
ViewObjectContact::ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact)
: mrObjectContact(rObjectContact),
mrViewContact(rViewContact),
- maObjectRange(),
+ maViewDependentRange(),
mxPrimitive2DSequence(),
mpPrimitiveAnimation(0),
mbLazyInvalidate(false)
@@ -186,9 +195,9 @@ namespace sdr
ViewObjectContact::~ViewObjectContact()
{
// invalidate in view
- if(!maObjectRange.isEmpty())
+ if(!maViewDependentRange.isEmpty())
{
- GetObjectContact().InvalidatePartOfView(maObjectRange);
+ GetObjectContact().InvalidatePartOfView(maViewDependentRange);
}
// delete PrimitiveAnimation
@@ -210,9 +219,9 @@ namespace sdr
GetViewContact().RemoveViewObjectContact(*this);
}
- const basegfx::B2DRange& ViewObjectContact::getObjectRange() const
+ const basegfx::B2DRange& ViewObjectContact::getViewDependentRange() const
{
- if(maObjectRange.isEmpty())
+ if(maViewDependentRange.isEmpty())
{
// if range is not computed (new or LazyInvalidate objects), force it
const DisplayInfo aDisplayInfo;
@@ -221,12 +230,12 @@ namespace sdr
if(xSequence.hasElements())
{
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
- const_cast< ViewObjectContact* >(this)->maObjectRange =
+ const_cast< ViewObjectContact* >(this)->maViewDependentRange =
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xSequence, rViewInformation2D);
}
}
- return maObjectRange;
+ return maViewDependentRange;
}
void ViewObjectContact::ActionChanged()
@@ -237,20 +246,28 @@ namespace sdr
mbLazyInvalidate = true;
// force ObjectRange
- getObjectRange();
+ getViewDependentRange();
- if(!maObjectRange.isEmpty())
+ if(!maViewDependentRange.isEmpty())
{
// invalidate current valid range
- GetObjectContact().InvalidatePartOfView(maObjectRange);
-
- // reset ObjectRange, it needs to be recalculated
- maObjectRange.reset();
+ GetObjectContact().InvalidatePartOfView(maViewDependentRange);
}
// register at OC for lazy invalidate
GetObjectContact().setLazyInvalidate(*this);
}
+
+ // reset local buffered primitive sequence. Do this always, there are
+ // cases where in-between ActionChanged calls someone requests the
+ // primitives again. Leaving them would mean to miss evtl. valid changes
+ if(mxPrimitive2DSequence.hasElements())
+ {
+ mxPrimitive2DSequence.realloc(0);
+ }
+
+ // reset ObjectRange (always, see above)
+ maViewDependentRange.reset();
}
void ViewObjectContact::triggerLazyInvalidate()
@@ -261,12 +278,12 @@ namespace sdr
mbLazyInvalidate = false;
// force ObjectRange
- getObjectRange();
+ getViewDependentRange();
- if(!maObjectRange.isEmpty())
+ if(!maViewDependentRange.isEmpty())
{
// invalidate current valid range
- GetObjectContact().InvalidatePartOfView(maObjectRange);
+ GetObjectContact().InvalidatePartOfView(maViewDependentRange);
}
}
}
@@ -277,10 +294,6 @@ namespace sdr
// force creation of the new VOC and trigger it's refresh, so it
// will take part in LazyInvalidate immediately
rChild.GetViewObjectContact(GetObjectContact()).ActionChanged();
-
- // forward action to ObjectContact
- // const ViewObjectContact& rChildVOC = rChild.GetViewObjectContact(GetObjectContact());
- // GetObjectContact().InvalidatePartOfView(rChildVOC.getObjectRange());
}
void ViewObjectContact::checkForPrimitive2DAnimations()
@@ -318,6 +331,10 @@ namespace sdr
// get the view-independent Primitive from the viewContact
drawinglayer::primitive2d::Primitive2DSequence xRetval(GetViewContact().getViewIndependentPrimitive2DSequence());
+#ifdef DBG_UTIL
+ static bool bShowCoordinateSystem(true);
+#endif
+
if(xRetval.hasElements())
{
// handle GluePoint
@@ -331,6 +348,41 @@ namespace sdr
}
}
+#ifdef DBG_UTIL
+ // for transformation test purposes, add a debug possibility to optically
+ // show the coordiante system axes x in red and y in green
+ if(bShowCoordinateSystem && !GetObjectContact().isOutputToPrinter())
+ {
+ SdrObject* pObj = GetViewContact().TryToGetSdrObject();
+
+ if(pObj)
+ {
+ const basegfx::B2DHomMatrix& rMatrix = pObj->getSdrObjectTransformation();
+ const basegfx::B2DPoint aTopLeft(rMatrix * basegfx::B2DPoint(0.0, 0.0));
+ const basegfx::B2DPoint aTopRight(rMatrix * basegfx::B2DPoint(1.0, 0.0));
+ const basegfx::B2DPoint aBottomLeft(rMatrix * basegfx::B2DPoint(0.0, 1.0));
+ basegfx::B2DPolygon aXAxis, aYAxis;
+
+ aXAxis.append(aTopLeft);
+ aXAxis.append(aTopRight);
+
+ aYAxis.append(aTopLeft);
+ aYAxis.append(aBottomLeft);
+
+ drawinglayer::primitive2d::Primitive2DSequence aCoordinate(2);
+
+ aCoordinate[0] = new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aXAxis,
+ basegfx::BColor(1.0, 0.0, 0.0));
+ aCoordinate[1] = new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aYAxis,
+ basegfx::BColor(0.0, 1.0, 0.0));
+
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, aCoordinate);
+ }
+ }
+#endif
+
// handle ghosted
if(isPrimitiveGhosted(rDisplayInfo))
{
@@ -346,32 +398,27 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
{
- drawinglayer::primitive2d::Primitive2DSequence xNewPrimitiveSequence;
-
- // take care of redirectors and create new list
- ViewObjectContactRedirector* pRedirector = GetObjectContact().GetViewObjectContactRedirector();
-
- if(pRedirector)
+ if(!mxPrimitive2DSequence.hasElements())
{
- xNewPrimitiveSequence = pRedirector->createRedirectedPrimitive2DSequence(*this, rDisplayInfo);
- }
- else
- {
- xNewPrimitiveSequence = createPrimitive2DSequence(rDisplayInfo);
- }
+ // take care of redirectors and create new list
+ ViewObjectContactRedirector* pRedirector = GetObjectContact().GetViewObjectContactRedirector();
- // local up-to-date checks. New list different from local one?
- if(!drawinglayer::primitive2d::arePrimitive2DSequencesEqual(mxPrimitive2DSequence, xNewPrimitiveSequence))
- {
- // has changed, copy content
- const_cast< ViewObjectContact* >(this)->mxPrimitive2DSequence = xNewPrimitiveSequence;
+ // create primitive list on demand
+ if(pRedirector)
+ {
+ const_cast< ViewObjectContact* >(this)->mxPrimitive2DSequence = pRedirector->createRedirectedPrimitive2DSequence(*this, rDisplayInfo);
+ }
+ else
+ {
+ const_cast< ViewObjectContact* >(this)->mxPrimitive2DSequence = createPrimitive2DSequence(rDisplayInfo);
+ }
// check for animated stuff
const_cast< ViewObjectContact* >(this)->checkForPrimitive2DAnimations();
// always update object range when PrimitiveSequence changes
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
- const_cast< ViewObjectContact* >(this)->maObjectRange =
+ const_cast< ViewObjectContact* >(this)->maViewDependentRange =
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(mxPrimitive2DSequence, rViewInformation2D);
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
index bf56f55d5f3e..f6a597d75193 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
@@ -76,15 +76,26 @@ namespace sdr
return rViewContact.impCreateWithGivenPrimitive3DSequence(getPrimitive3DSequence(rDisplayInfo));
}
- drawinglayer::primitive3d::Primitive3DSequence ViewObjectContactOfE3d::getPrimitive3DSequence(const DisplayInfo& rDisplayInfo) const
+ void ViewObjectContactOfE3d::ActionChanged()
{
- drawinglayer::primitive3d::Primitive3DSequence xNewPrimitive3DSeq(createPrimitive3DSequence(rDisplayInfo));
+ // call parent
+ ViewObjectContactOfSdrObj::ActionChanged();
- // local up-to-date checks. New list different from local one?
- if(!drawinglayer::primitive3d::arePrimitive3DSequencesEqual(mxPrimitive3DSequence, xNewPrimitive3DSeq))
+ // reset local buffered primitive sequence. Do this always, there are
+ // cases where in-between ActionChanged calls someone requests the
+ // primitives again. Leaving them would mean to miss evtl. valid changes
+ if(mxPrimitive3DSequence.hasElements())
+ {
+ mxPrimitive3DSequence.realloc(0);
+ }
+ }
+
+ drawinglayer::primitive3d::Primitive3DSequence ViewObjectContactOfE3d::getPrimitive3DSequence(const DisplayInfo& rDisplayInfo) const
+ {
+ if(!mxPrimitive3DSequence.hasElements())
{
- // has changed, copy content
- const_cast< ViewObjectContactOfE3d* >(this)->mxPrimitive3DSequence = xNewPrimitive3DSeq;
+ // create primitive list on demand
+ const_cast< ViewObjectContactOfE3d* >(this)->mxPrimitive3DSequence = createPrimitive3DSequence(rDisplayInfo);
}
// return current Primitive2DSequence
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index a4a091fec3e6..e20a594bea43 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -192,7 +192,7 @@ namespace sdr
rGrafObj.mbInsidePaint = sal_True;
rGrafObj.ForceSwapIn();
rGrafObj.mbInsidePaint = sal_False;
- }
+ }
bRetval = true;
}
@@ -247,7 +247,7 @@ namespace sdr
{
// prepare primitive generation with evtl. loading the graphic when it's swapped out
SdrGrafObj& rGrafObj = const_cast< ViewObjectContactOfGraphic* >(this)->getSdrGrafObj();
- bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics());
+ bool bDoAsynchronGraphicLoading(rGrafObj.getSdrModelFromSdrObject().IsSwapGraphics());
bool bSwapInDone(false);
bool bSwapInExclusive(false);
@@ -255,7 +255,7 @@ namespace sdr
{
// sometimes it is needed that each graphic is completely available and swapped in
// for these cases a ForceSwapIn is called later at the graphic object
- if ( rGrafObj.GetPage() && rGrafObj.GetPage()->IsMasterPage() )
+ if ( rGrafObj.getSdrPageFromSdrObject() && rGrafObj.getSdrPageFromSdrObject()->IsMasterPage() )
{
// #i102380# force Swap-In for GraphicObjects on MasterPage to have a nicer visualisation
bDoAsynchronGraphicLoading = false;
diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
index 5d4b281330c9..341180c2973d 100644
--- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
@@ -78,9 +78,7 @@ namespace sdr
// used range (retval) is fixed here, it's the MasterPage fill range
const SdrPage& rOwnerPage = rDescriptor.GetOwnerPage();
- const basegfx::B2DRange aPageFillRange(
- rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
- rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
+ const basegfx::B2DRange aPageFillRange(rOwnerPage.GetInnerPageRange());
// Modify DisplayInfo for MasterPageContent collection; remember original layers and
// set combined LayerSet; set MasterPagePaint flag
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index a334b6d3c537..2705fa80c8f4 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -37,6 +37,7 @@
#include <svx/unoapi.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -82,7 +83,7 @@ namespace sdr
virtual bool isDrawModeGray() const;
virtual bool isDrawModeBlackWhite() const;
virtual bool isDrawModeHighContrast() const;
- virtual SdrPageView* TryToGetSdrPageView() const;
+ virtual SdrView* TryToGetSdrView() const;
virtual OutputDevice* TryToGetOutputDevice() const;
};
@@ -119,12 +120,15 @@ namespace sdr
Stop();
// invalidate all LazyInvalidate VOCs new situations
- const sal_uInt32 nVOCCount(getViewObjectContactCount());
+ if(!getViewObjectContacts().empty())
+ {
+ const ViewObjectContactSet::const_iterator aEnd(getViewObjectContacts().end());
+ ViewObjectContactSet::iterator aCurrent(getViewObjectContacts().begin());
- for(sal_uInt32 a(0); a < nVOCCount; a++)
+ for(;aCurrent != aEnd; aCurrent++)
{
- ViewObjectContact* pCandidate = getViewObjectContact(a);
- pCandidate->triggerLazyInvalidate();
+ (*aCurrent)->triggerLazyInvalidate();
+ }
}
}
@@ -175,7 +179,7 @@ namespace sdr
if(pStartPage && !rRange.isEmpty())
{
- const basegfx::B2DRange aPageRange(0.0, 0.0, (double)pStartPage->GetWdt(), (double)pStartPage->GetHgt());
+ const basegfx::B2DRange aPageRange(basegfx::B2DPoint(0.0, 0.0), pStartPage->GetPageScale());
if(rRange.overlaps(aPageRange))
{
@@ -195,7 +199,7 @@ namespace sdr
bool PagePrimitiveExtractor::isDrawModeGray() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeGray(); }
bool PagePrimitiveExtractor::isDrawModeBlackWhite() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeBlackWhite(); }
bool PagePrimitiveExtractor::isDrawModeHighContrast() const { return mrViewObjectContactOfPageObj.GetObjectContact().isDrawModeHighContrast(); }
- SdrPageView* PagePrimitiveExtractor::TryToGetSdrPageView() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetSdrPageView(); }
+ SdrView* PagePrimitiveExtractor::TryToGetSdrView() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetSdrView(); }
OutputDevice* PagePrimitiveExtractor::TryToGetOutputDevice() const { return mrViewObjectContactOfPageObj.GetObjectContact().TryToGetOutputDevice(); }
} // end of namespace contact
} // end of namespace sdr
@@ -216,10 +220,7 @@ namespace sdr
// get PageObject's geometry
basegfx::B2DHomMatrix aPageObjectTransform;
{
- const Rectangle aPageObjectModelData(rPageObject.GetLastBoundRect());
- const basegfx::B2DRange aPageObjectBound(
- aPageObjectModelData.Left(), aPageObjectModelData.Top(),
- aPageObjectModelData.Right(), aPageObjectModelData.Bottom());
+ const basegfx::B2DRange aPageObjectBound(sdr::legacy::GetSnapRange(rPageObject));
aPageObjectTransform.set(0, 0, aPageObjectBound.getWidth());
aPageObjectTransform.set(1, 1, aPageObjectBound.getHeight());
@@ -235,9 +236,7 @@ namespace sdr
{
// get displayed page's geometry
drawinglayer::primitive2d::Primitive2DSequence xPageContent;
- const Size aPageSize(pPage->GetSize());
- const double fPageWidth(aPageSize.getWidth());
- const double fPageHeight(aPageSize.getHeight());
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
// The case that a PageObject contains another PageObject which visualizes the
// same page again would lead to a recursion. Limit that recursion depth to one
@@ -250,7 +249,7 @@ namespace sdr
xPageContent.realloc(2);
const Color aDocColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
const Color aBorderColor(aColorConfig.GetColorValue(svtools::DOCBOUNDARIES).nColor);
- const basegfx::B2DRange aPageBound(0.0, 0.0, fPageWidth, fPageHeight);
+ const basegfx::B2DRange aPageBound(basegfx::B2DPoint(0.0, 0.0), rPageScale);
const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aPageBound));
// add replacement fill
@@ -287,8 +286,15 @@ namespace sdr
if(xPageContent.hasElements())
{
const uno::Reference< drawing::XDrawPage > xDrawPage(GetXDrawPageForSdrPage(const_cast< SdrPage*>(pPage)));
- const drawinglayer::primitive2d::Primitive2DReference xPagePreview(new drawinglayer::primitive2d::PagePreviewPrimitive2D(
- xDrawPage, aPageObjectTransform, fPageWidth, fPageHeight, xPageContent, true));
+ const drawinglayer::primitive2d::Primitive2DReference xPagePreview(
+ new drawinglayer::primitive2d::PagePreviewPrimitive2D(
+ xDrawPage,
+ aPageObjectTransform,
+ rPageScale.getX(),
+ rPageScale.getY(),
+ xPageContent,
+ true));
+
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xPagePreview, 1);
}
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
index 60e4f63cce36..0afe1cb311ae 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
@@ -135,7 +135,7 @@ void ViewObjectContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rIte
}
else
{
- basegfx::B2DRange aViewRange(getObjectRange());
+ basegfx::B2DRange aViewRange(getViewDependentRange());
aViewRange.transform(GetObjectContact().getViewInformation2D().getViewTransformation());
const Rectangle aViewRectangle(
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
index 6f96f74acd33..19b8d56dc4e8 100755
--- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
@@ -84,15 +84,14 @@ namespace sdr
}
// Test for Calc object hiding (for OLE and Graphic it's extra, see there)
- const SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ const SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(pSdrPageView)
+ if(pSdrView)
{
- const SdrView& rSdrView = pSdrPageView->GetView();
- const bool bHideOle(rSdrView.getHideOle());
- const bool bHideChart(rSdrView.getHideChart());
- const bool bHideDraw(rSdrView.getHideDraw());
- const bool bHideFormControl(rSdrView.getHideFormControl());
+ const bool bHideOle(pSdrView->getHideOle());
+ const bool bHideChart(pSdrView->getHideChart());
+ const bool bHideDraw(pSdrView->getHideDraw());
+ const bool bHideFormControl(pSdrView->getHideFormControl());
if(bHideOle || bHideChart || bHideDraw || bHideFormControl)
{
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index fe164cd230d0..7c3a4d43be71 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -103,11 +103,12 @@ namespace sdr
const_cast< SdrOle2Obj* >(&rSdrOle2)->SetResizeProtect(true);
}
- SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
- if(pPageView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
+ SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
+
+ if(pSdrView && (nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE))
{
// connect plugin object
- pPageView->GetView().DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
+ pSdrView->DoConnect(const_cast< SdrOle2Obj* >(&rSdrOle2));
}
}
}//end old stuff to rework
@@ -121,12 +122,9 @@ namespace sdr
// do not shade when printing or PDF exporting
if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
{
- // get object transformation
- const basegfx::B2DHomMatrix aObjectMatrix(static_cast< ViewContactOfSdrOle2Obj& >(GetViewContact()).createObjectTransform());
-
// shade the representation if the object is activated outplace
basegfx::B2DPolygon aObjectOutline(basegfx::tools::createUnitPolygon());
- aObjectOutline.transform(aObjectMatrix);
+ aObjectOutline.transform(rSdrOle2.getSdrObjectTransformation());
// Use a FillHatchPrimitive2D with necessary attributes
const drawinglayer::attribute::FillHatchAttribute aFillHatch(
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index c8c5e271d2cd..28e9494ef33d 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -84,7 +84,7 @@ namespace sdr
return false;
}
- if(!GetObjectContact().TryToGetSdrPageView())
+ if(!GetObjectContact().TryToGetSdrView())
{
return false;
}
@@ -136,21 +136,20 @@ namespace sdr
// Initialize background. Dependent of IsPageVisible, use ApplicationBackgroundColor or ApplicationDocumentColor. Most
// old renderers for export (html, pdf, gallery, ...) set the page to not visible (SetPageVisible(false)). They expect the
// given OutputDevice to be initialized with the ApplicationDocumentColor then.
- const SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+ const SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- if(pPageView)
+ if(pSdrView && pSdrView->GetSdrPageView())
{
- const SdrView& rView = pPageView->GetView();
Color aInitColor;
- if(rView.IsPageVisible())
+ if(pSdrView->IsPageVisible())
{
- aInitColor = pPageView->GetApplicationBackgroundColor();
+ aInitColor = pSdrView->GetSdrPageView()->GetApplicationBackgroundColor();
}
else
{
- aInitColor = pPageView->GetApplicationDocumentColor();
+ aInitColor = pSdrView->GetSdrPageView()->GetApplicationDocumentColor();
if(Color(COL_AUTO) == aInitColor)
{
@@ -227,14 +226,14 @@ namespace sdr
return false;
}
- SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(!pSdrPageView)
+ if(!pSdrView || !pSdrView->GetSdrPageView())
{
return false;
}
- if(!pSdrPageView->GetView().IsPageVisible())
+ if(!pSdrView->IsPageVisible())
{
return false;
}
@@ -244,20 +243,19 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfPageFill::createPrimitive2DSequence(const DisplayInfo& /*rDisplayInfo*/) const
{
- const SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+ const SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- if(pPageView)
+ if(pSdrView && pSdrView->GetSdrPageView())
{
const SdrPage& rPage = getPage();
-
- const basegfx::B2DRange aPageFillRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt());
+ const basegfx::B2DRange aPageFillRange(basegfx::B2DPoint(0.0, 0.0), rPage.GetPageScale());
const basegfx::B2DPolygon aPageFillPolygon(basegfx::tools::createPolygonFromRect(aPageFillRange));
Color aPageFillColor;
- if(pPageView->GetApplicationDocumentColor() != COL_AUTO)
+ if(pSdrView->GetSdrPageView()->GetApplicationDocumentColor() != COL_AUTO)
{
- aPageFillColor = pPageView->GetApplicationDocumentColor();
+ aPageFillColor = pSdrView->GetSdrPageView()->GetApplicationDocumentColor();
}
else
{
@@ -298,14 +296,14 @@ namespace sdr
return false;
}
- SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(!pSdrPageView)
+ if(!pSdrView)
{
return false;
}
- if(!pSdrPageView->GetView().IsPageVisible())
+ if(!pSdrView->IsPageVisible())
{
return false;
}
@@ -349,16 +347,19 @@ namespace sdr
return false;
}
- SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(!pSdrPageView)
+ if(!pSdrView)
{
return false;
}
- const SdrView& rView = pSdrPageView->GetView();
+ if(!pSdrView->IsPageVisible() && pSdrView->IsPageBorderVisible())
+ {
+ return false;
+ }
- if(!rView.IsPageVisible() && rView.IsPageBorderVisible())
+ if(!pSdrView->GetSdrPageView())
{
return false;
}
@@ -390,21 +391,21 @@ namespace sdr
return false;
}
- SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(!pSdrPageView)
+ if(!pSdrView)
{
return false;
}
- if(!pSdrPageView->GetView().IsBordVisible())
+ if(!pSdrView->IsBordVisible())
{
return false;
}
const SdrPage& rPage = getPage();
- if(!rPage.GetLftBorder() && !rPage.GetUppBorder() && !rPage.GetRgtBorder() && !rPage.GetLwrBorder())
+ if(!rPage.GetLeftPageBorder() && !rPage.GetTopPageBorder() && !rPage.GetRightPageBorder() && !rPage.GetBottomPageBorder())
{
return false;
}
@@ -489,16 +490,14 @@ namespace sdr
return false;
}
- SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(!pSdrPageView)
+ if(!pSdrView)
{
return false;
}
- const SdrView& rView = pSdrPageView->GetView();
-
- if(!rView.IsGridVisible())
+ if(!pSdrView->IsGridVisible())
{
return false;
}
@@ -509,7 +508,7 @@ namespace sdr
return false;
}
- if(static_cast< ViewContactOfGrid& >(GetViewContact()).getFront() != (bool)rView.IsGridFront())
+ if(static_cast< ViewContactOfGrid& >(GetViewContact()).getFront() != pSdrView->IsGridFront())
{
return false;
}
@@ -519,24 +518,25 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfPageGrid::createPrimitive2DSequence(const DisplayInfo& /*rDisplayInfo*/) const
{
- const SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+ const SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- if(pPageView)
+ if(pSdrView)
{
- const SdrView& rView = pPageView->GetView();
const SdrPage& rPage = getPage();
- const Color aGridColor(rView.GetGridColor());
+ const Color aGridColor(pSdrView->GetGridColor());
const basegfx::BColor aRGBGridColor(aGridColor.getBColor());
+ const basegfx::B2DRange aInnerRange(rPage.GetInnerPageRange());
basegfx::B2DHomMatrix aGridMatrix;
- aGridMatrix.set(0, 0, (double)(rPage.GetWdt() - (rPage.GetRgtBorder() + rPage.GetLftBorder())));
- aGridMatrix.set(1, 1, (double)(rPage.GetHgt() - (rPage.GetLwrBorder() + rPage.GetUppBorder())));
- aGridMatrix.set(0, 2, (double)rPage.GetLftBorder());
- aGridMatrix.set(1, 2, (double)rPage.GetUppBorder());
- const Size aRaw(rView.GetGridCoarse());
- const Size aFine(rView.GetGridFine());
+ aGridMatrix.set(0, 0, aInnerRange.getWidth());
+ aGridMatrix.set(1, 1, aInnerRange.getHeight());
+ aGridMatrix.set(0, 2, aInnerRange.getMinX());
+ aGridMatrix.set(1, 2, aInnerRange.getMinY());
+
+ const Size aRaw(pSdrView->GetGridCoarse());
+ const Size aFine(pSdrView->GetGridFine());
const double fWidthX(aRaw.getWidth());
const double fWidthY(aRaw.getHeight());
const sal_uInt32 nSubdivisionsX(aFine.getWidth() ? aRaw.getWidth() / aFine.getWidth() : 0L);
@@ -575,16 +575,14 @@ namespace sdr
return false;
}
- SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(!pSdrPageView)
+ if(!pSdrView || !pSdrView->GetSdrPageView())
{
return false;
}
- const SdrView& rView = pSdrPageView->GetView();
-
- if(!rView.IsHlplVisible())
+ if(!pSdrView->IsHlplVisible())
{
return false;
}
@@ -595,7 +593,7 @@ namespace sdr
return false;
}
- if(static_cast< ViewContactOfHelplines& >(GetViewContact()).getFront() != (bool)rView.IsHlplFront())
+ if(static_cast< ViewContactOfHelplines& >(GetViewContact()).getFront() != pSdrView->IsHlplFront())
{
return false;
}
@@ -606,11 +604,11 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfPageHelplines::createPrimitive2DSequence(const DisplayInfo& /*rDisplayInfo*/) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrPageView* pPageView = GetObjectContact().TryToGetSdrPageView();
+ const SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(pPageView)
+ if(pSdrView && pSdrView->GetSdrPageView())
{
- const SdrHelpLineList& rHelpLineList = pPageView->GetHelpLines();
+ const SdrHelpLineList& rHelpLineList = pSdrView->GetSdrPageView()->GetHelpLines();
const sal_uInt32 nCount(rHelpLineList.GetCount());
if(nCount)
@@ -622,30 +620,44 @@ namespace sdr
for(sal_uInt32 a(0L); a < nCount; a++)
{
const SdrHelpLine& rHelpLine = rHelpLineList[(sal_uInt16)a];
- const basegfx::B2DPoint aPosition((double)rHelpLine.GetPos().X(), (double)rHelpLine.GetPos().Y());
const double fDiscreteDashLength(4.0);
switch(rHelpLine.GetKind())
{
default : // SDRHELPLINE_POINT
{
- xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::HelplinePrimitive2D(
- aPosition, basegfx::B2DVector(1.0, 0.0), drawinglayer::primitive2d::HELPLINESTYLE2D_POINT,
- aRGBColorA, aRGBColorB, fDiscreteDashLength));
+ xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::HelplinePrimitive2D(
+ rHelpLine.GetPos(),
+ basegfx::B2DVector(1.0, 0.0),
+ drawinglayer::primitive2d::HELPLINESTYLE2D_POINT,
+ aRGBColorA,
+ aRGBColorB,
+ fDiscreteDashLength));
break;
}
case SDRHELPLINE_VERTICAL :
{
- xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::HelplinePrimitive2D(
- aPosition, basegfx::B2DVector(0.0, 1.0), drawinglayer::primitive2d::HELPLINESTYLE2D_LINE,
- aRGBColorA, aRGBColorB, fDiscreteDashLength));
+ xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::HelplinePrimitive2D(
+ rHelpLine.GetPos(),
+ basegfx::B2DVector(0.0, 1.0),
+ drawinglayer::primitive2d::HELPLINESTYLE2D_LINE,
+ aRGBColorA,
+ aRGBColorB,
+ fDiscreteDashLength));
break;
}
case SDRHELPLINE_HORIZONTAL :
{
- xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::HelplinePrimitive2D(
- aPosition, basegfx::B2DVector(1.0, 0.0), drawinglayer::primitive2d::HELPLINESTYLE2D_LINE,
- aRGBColorA, aRGBColorB, fDiscreteDashLength));
+ xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::HelplinePrimitive2D(
+ rHelpLine.GetPos(),
+ basegfx::B2DVector(1.0, 0.0),
+ drawinglayer::primitive2d::HELPLINESTYLE2D_LINE,
+ aRGBColorA,
+ aRGBColorB,
+ fDiscreteDashLength));
break;
}
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index bf7edfb4a202..a17d4e8674a9 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -34,7 +34,8 @@
#include <svx/svdpagv.hxx>
#include <svx/svdview.hxx>
#include <svx/sdrpagewindow.hxx>
-#include "svx/sdrpaintwindow.hxx"
+#include <svx/sdrpaintwindow.hxx>
+#include <svx/svdlegacy.hxx>
/** === begin UNO includes === **/
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -377,7 +378,8 @@ namespace sdr { namespace contact {
// determine the scale from the current view transformation, and the normalization matrix
::basegfx::B2DHomMatrix aObtainResolutionDependentScale( _rViewTransformation * _rZoomLevelNormalization );
- ::basegfx::B2DVector aScale, aTranslate;
+ ::basegfx::B2DVector aScale;
+ ::basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
aObtainResolutionDependentScale.decompose( aScale, aTranslate, fRotate, fShearX );
_rControl.setZoom( aScale );
@@ -922,8 +924,6 @@ namespace sdr { namespace contact {
getTransformation( m_pVOCImpl->getViewContact(), m_aTransformation );
}
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// declare unique ID for this primitive class
DeclPrimitrive2DIDBlock()
@@ -948,7 +948,6 @@ namespace sdr { namespace contact {
//====================================================================
//= ViewObjectContactOfUnoControl_Impl
//====================================================================
- DBG_NAME( ViewObjectContactOfUnoControl_Impl )
//--------------------------------------------------------------------
ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl( ViewObjectContactOfUnoControl* _pAntiImpl )
:m_pAntiImpl( _pAntiImpl )
@@ -959,14 +958,14 @@ namespace sdr { namespace contact {
,m_eControlDesignMode( eUnknown )
,m_aZoomLevelNormalization()
{
- DBG_CTOR( ViewObjectContactOfUnoControl_Impl, NULL );
DBG_ASSERT( m_pAntiImpl, "ViewObjectContactOfUnoControl_Impl::ViewObjectContactOfUnoControl_Impl: invalid AntiImpl!" );
const OutputDevice& rPageViewDevice( impl_getOutputDevice_throw() );
m_aZoomLevelNormalization = rPageViewDevice.GetInverseViewTransformation();
#if OSL_DEBUG_LEVEL > 1
- ::basegfx::B2DVector aScale, aTranslate;
+ ::basegfx::B2DVector aScale;
+ ::basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
m_aZoomLevelNormalization.decompose( aScale, aTranslate, fRotate, fShearX );
#endif
@@ -990,8 +989,6 @@ namespace sdr { namespace contact {
acquire();
dispose();
}
-
- DBG_DTOR( ViewObjectContactOfUnoControl_Impl, NULL );
}
//--------------------------------------------------------------------
@@ -1052,7 +1049,7 @@ namespace sdr { namespace contact {
SdrUnoObj* pUnoObject( NULL );
if ( getUnoObject( pUnoObject ) )
{
- UnoControlContactHelper::adjustControlGeometry_throw( m_aControl, pUnoObject->GetLogicRect(), _rViewTransformation, m_aZoomLevelNormalization );
+ UnoControlContactHelper::adjustControlGeometry_throw( m_aControl, sdr::legacy::GetLogicRect(*pUnoObject), _rViewTransformation, m_aZoomLevelNormalization );
}
else
OSL_ENSURE( false, "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no SdrUnoObj!" );
@@ -1234,7 +1231,7 @@ namespace sdr { namespace contact {
// proper geometry
UnoControlContactHelper::adjustControlGeometry_throw(
_out_rControl,
- _rUnoObject.GetLogicRect(),
+ sdr::legacy::GetLogicRect(_rUnoObject),
_rInitialViewTransformation,
_rInitialZoomNormalization
);
@@ -1611,58 +1608,23 @@ namespace sdr { namespace contact {
//= LazyControlCreationPrimitive2D
//====================================================================
//--------------------------------------------------------------------
- bool LazyControlCreationPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if ( !BufferedDecompositionPrimitive2D::operator==( rPrimitive ) )
- return false;
-
- const LazyControlCreationPrimitive2D* pRHS = dynamic_cast< const LazyControlCreationPrimitive2D* >( &rPrimitive );
- if ( !pRHS )
- return false;
-
- if ( m_pVOCImpl != pRHS->m_pVOCImpl )
- return false;
-
- if ( m_aTransformation != pRHS->m_aTransformation )
- return false;
-
- return true;
- }
-
- //--------------------------------------------------------------------
void LazyControlCreationPrimitive2D::getTransformation( const ViewContactOfUnoControl& _rVOC, ::basegfx::B2DHomMatrix& _out_Transformation )
{
- // Do use model data directly to create the correct geometry. Do NOT
- // use getBoundRect()/getSnapRect() here; tese will use the sequence of
- // primitives themselves in the long run.
- const Rectangle aSdrGeoData( _rVOC.GetSdrUnoObj().GetGeoRect() );
- const basegfx::B2DRange aRange(
- aSdrGeoData.Left(),
- aSdrGeoData.Top(),
- aSdrGeoData.Right(),
- aSdrGeoData.Bottom()
- );
-
- _out_Transformation.identity();
- _out_Transformation.set( 0, 0, aRange.getWidth() );
- _out_Transformation.set( 1, 1, aRange.getHeight() );
- _out_Transformation.set( 0, 2, aRange.getMinX() );
- _out_Transformation.set( 1, 2, aRange.getMinY() );
+ _out_Transformation = _rVOC.GetSdrUnoObj().getSdrObjectTransformation();
}
//--------------------------------------------------------------------
::basegfx::B2DRange LazyControlCreationPrimitive2D::getB2DRange( const ::drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/ ) const
{
- ::basegfx::B2DRange aRange( 0.0, 0.0, 1.0, 1.0 );
- aRange.transform( m_aTransformation );
- return aRange;
+ return m_aTransformation * basegfx::B2DRange::getUnitB2DRange();
}
//--------------------------------------------------------------------
::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::get2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
{
#if OSL_DEBUG_LEVEL > 1
- ::basegfx::B2DVector aScale, aTranslate;
+ ::basegfx::B2DVector aScale;
+ ::basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
_rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX );
#endif
@@ -1675,7 +1637,8 @@ namespace sdr { namespace contact {
::drawinglayer::primitive2d::Primitive2DSequence LazyControlCreationPrimitive2D::create2DDecomposition( const ::drawinglayer::geometry::ViewInformation2D& _rViewInformation ) const
{
#if OSL_DEBUG_LEVEL > 1
- ::basegfx::B2DVector aScale, aTranslate;
+ ::basegfx::B2DVector aScale;
+ ::basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
_rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX );
#endif
@@ -1718,13 +1681,11 @@ namespace sdr { namespace contact {
//====================================================================
//= ViewObjectContactOfUnoControl
//====================================================================
- DBG_NAME( ViewObjectContactOfUnoControl )
//--------------------------------------------------------------------
ViewObjectContactOfUnoControl::ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact )
:ViewObjectContactOfSdrObj( _rObjectContact, _rViewContact )
,m_pImpl( new ViewObjectContactOfUnoControl_Impl( this ) )
{
- DBG_CTOR( ViewObjectContactOfUnoControl, NULL );
}
//--------------------------------------------------------------------
@@ -1732,8 +1693,6 @@ namespace sdr { namespace contact {
{
m_pImpl->dispose();
m_pImpl = NULL;
-
- DBG_DTOR( ViewObjectContactOfUnoControl, NULL );
}
//--------------------------------------------------------------------
@@ -1842,7 +1801,8 @@ namespace sdr { namespace contact {
{
const ::drawinglayer::geometry::ViewInformation2D& rViewInformation( GetObjectContact().getViewInformation2D() );
#if OSL_DEBUG_LEVEL > 1
- ::basegfx::B2DVector aScale, aTranslate;
+ ::basegfx::B2DVector aScale;
+ ::basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX );
#endif
@@ -1871,12 +1831,12 @@ namespace sdr { namespace contact {
{
// #i93180# if layer visibility has changed and control is in live mode, it is necessary
// to correct visibility to make those control vanish on SdrObject LayerID changes
- const SdrPageView* pSdrPageView = GetObjectContact().TryToGetSdrPageView();
+ const SdrView* pSdrView = GetObjectContact().TryToGetSdrView();
- if(pSdrPageView)
+ if(pSdrView && pSdrView->GetSdrPageView())
{
const SdrObject& rObject = getSdrObject();
- const bool bIsLayerVisible( rObject.IsVisible() && pSdrPageView->GetVisibleLayers().IsSet(rObject.GetLayer()));
+ const bool bIsLayerVisible( rObject.IsVisible() && pSdrView->GetSdrPageView()->GetVisibleLayers().IsSet(rObject.GetLayer()));
if(rControl.isVisible() != bIsLayerVisible)
{
@@ -1894,26 +1854,22 @@ namespace sdr { namespace contact {
// #i93318# flush Primitive2DSequence to force recreation with updated XControlModel
// since e.g. background color has changed and existing decompositions are possibly no
- // longer valid. Unfortunately this is not detected from ControlPrimitive2D::operator==
- // since it only has a uno reference to the XControlModel
+ // longer valid
flushPrimitive2DSequence();
}
//====================================================================
//= UnoControlPrintOrPreviewContact
//====================================================================
- DBG_NAME( UnoControlPrintOrPreviewContact )
//--------------------------------------------------------------------
UnoControlPrintOrPreviewContact::UnoControlPrintOrPreviewContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact )
:ViewObjectContactOfUnoControl( _rObjectContact, _rViewContact )
{
- DBG_CTOR( UnoControlPrintOrPreviewContact, NULL );
}
//--------------------------------------------------------------------
UnoControlPrintOrPreviewContact::~UnoControlPrintOrPreviewContact()
{
- DBG_DTOR( UnoControlPrintOrPreviewContact, NULL );
}
//--------------------------------------------------------------------
diff --git a/svx/source/sdr/overlay/overlayhatchrect.cxx b/svx/source/sdr/overlay/overlayhatchrect.cxx
index b99d3c7ccb18..0ecc18938b5e 100644
--- a/svx/source/sdr/overlay/overlayhatchrect.cxx
+++ b/svx/source/sdr/overlay/overlayhatchrect.cxx
@@ -41,48 +41,32 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence OverlayHatchRect::createOverlayObjectPrimitive2DSequence()
{
- const basegfx::B2DRange aHatchRange(getBasePosition(), getSecondPosition());
const drawinglayer::primitive2d::Primitive2DReference aReference(
- new drawinglayer::primitive2d::OverlayHatchRectanglePrimitive(
- aHatchRange,
+ new drawinglayer::primitive2d::OverlayHatchPrimitive(
+ getTransformation(),
3.0,
getHatchRotation(),
getBaseColor().getBColor(),
getDiscreteGrow(),
- getDiscreteShrink(),
- getRotation()));
+ getDiscreteShrink()));
return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
}
OverlayHatchRect::OverlayHatchRect(
- const basegfx::B2DPoint& rBasePosition,
- const basegfx::B2DPoint& rSecondPosition,
+ const basegfx::B2DHomMatrix& rTransformation,
const Color& rHatchColor,
double fDiscreteGrow,
double fDiscreteShrink,
- double fHatchRotation,
- double fRotation)
- : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
- maSecondPosition(rSecondPosition),
+ double fHatchRotation)
+ : OverlayObject(rHatchColor),
+ maTransformation(rTransformation),
mfDiscreteGrow(fDiscreteGrow),
mfDiscreteShrink(fDiscreteShrink),
- mfHatchRotation(fHatchRotation),
- mfRotation(fRotation)
+ mfHatchRotation(fHatchRotation)
{
}
- void OverlayHatchRect::setSecondPosition(const basegfx::B2DPoint& rNew)
- {
- if(rNew != maSecondPosition)
- {
- // remember new value
- maSecondPosition = rNew;
-
- // register change (after change)
- objectChange();
- }
- }
} // end of namespace overlay
} // end of namespace sdr
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 670fe7630353..22c9b22862b1 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -156,9 +156,7 @@ namespace sdr
if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType())
{
- const Size aOutputSizePixel(getOutputDevice().GetOutputSizePixel());
- aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
- aViewRange.transform(getOutputDevice().GetInverseViewTransformation());
+ aViewRange = getOutputDevice().GetLogicRange();
}
OverlayManager* pThis = const_cast< OverlayManager* >(this);
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 7c2879628b1e..230905531e4b 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -310,10 +310,8 @@ namespace sdr
if(!maBufferRememberedRangePixel.isEmpty())
{
// logic size for impDrawMember call
- basegfx::B2DRange aBufferRememberedRangeLogic(
- maBufferRememberedRangePixel.getMinX(), maBufferRememberedRangePixel.getMinY(),
- maBufferRememberedRangePixel.getMaxX(), maBufferRememberedRangePixel.getMaxY());
- aBufferRememberedRangeLogic.transform(getOutputDevice().GetInverseViewTransformation());
+ const basegfx::B2DRange aBufferRememberedRangeLogic(
+ getOutputDevice().GetInverseViewTransformation() * basegfx::B2DRange(maBufferRememberedRangePixel));
// prepare cursor handling
const bool bTargetIsWindow(OUTDEV_WINDOW == rmOutputDevice.GetOutDevType());
@@ -557,8 +555,7 @@ namespace sdr
// since it just transforms the top left and bottom right points equally without taking
// discrete pixel coverage into account. An empty B2DRange and thus empty logic Rectangle translated
// to an also empty discrete pixel rectangle - what is wrong.
- basegfx::B2DRange aDiscreteRange(rRange);
- aDiscreteRange.transform(getOutputDevice().GetViewTransformation());
+ const basegfx::B2DRange aDiscreteRange(getOutputDevice().GetViewTransformation() * rRange);
if(maDrawinglayerOpt.IsAntiAliasing())
{
diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx
index 69aef2874c21..1f8dcca670f2 100644
--- a/svx/source/sdr/overlay/overlayobjectlist.cxx
+++ b/svx/source/sdr/overlay/overlayobjectlist.cxx
@@ -100,7 +100,8 @@ namespace sdr
aViewInformation2D,
rLogicPosition,
fLogicTolerance,
- false);
+ false,
+ 0);
for(; aStart != maVector.end(); aStart++)
{
diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx
index 5aa0ce8fb56d..9b0de9a7f207 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -85,21 +85,6 @@ namespace drawinglayer
return aRetval;
}
- bool OverlayBitmapExPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const OverlayBitmapExPrimitive& rCompare = static_cast< const OverlayBitmapExPrimitive& >(rPrimitive);
-
- return (getBitmapEx() == rCompare.getBitmapEx()
- && getBasePosition() == rCompare.getBasePosition()
- && getCenterX() == rCompare.getCenterX()
- && getCenterY() == rCompare.getCenterY());
- }
-
- return false;
- }
-
ImplPrimitrive2DIDBlock(OverlayBitmapExPrimitive, PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE)
} // end of namespace primitive2d
@@ -158,21 +143,6 @@ namespace drawinglayer
return aRetval;
}
- bool OverlayCrosshairPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(ViewportDependentPrimitive2D::operator==(rPrimitive))
- {
- const OverlayCrosshairPrimitive& rCompare = static_cast< const OverlayCrosshairPrimitive& >(rPrimitive);
-
- return (getBasePosition() == rCompare.getBasePosition()
- && getRGBColorA() == rCompare.getRGBColorA()
- && getRGBColorB() == rCompare.getRGBColorB()
- && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
- }
-
- return false;
- }
-
ImplPrimitrive2DIDBlock(OverlayCrosshairPrimitive, PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE)
} // end of namespace primitive2d
@@ -184,37 +154,44 @@ namespace drawinglayer
{
namespace primitive2d
{
- OverlayHatchRectanglePrimitive::OverlayHatchRectanglePrimitive(
- const basegfx::B2DRange& rObjectRange,
+ OverlayHatchPrimitive::OverlayHatchPrimitive(
+ const basegfx::B2DHomMatrix& rTransformation,
double fDiscreteHatchDistance,
double fHatchRotation,
const basegfx::BColor& rHatchColor,
double fDiscreteGrow,
- double fDiscreteShrink,
- double fRotation)
+ double fDiscreteShrink)
: DiscreteMetricDependentPrimitive2D(),
- maObjectRange(rObjectRange),
+ maTransformation(rTransformation),
mfDiscreteHatchDistance(fDiscreteHatchDistance),
mfHatchRotation(fHatchRotation),
maHatchColor(rHatchColor),
mfDiscreteGrow(fDiscreteGrow),
- mfDiscreteShrink(fDiscreteShrink),
- mfRotation(fRotation)
+ mfDiscreteShrink(fDiscreteShrink)
{}
- Primitive2DSequence OverlayHatchRectanglePrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ Primitive2DSequence OverlayHatchPrimitive::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
Primitive2DSequence aRetval;
if(basegfx::fTools::more(getDiscreteUnit(), 0.0))
{
- basegfx::B2DRange aInnerRange(getObjectRange());
- basegfx::B2DRange aOuterRange(getObjectRange());
+ // decompose transformation to get single values
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
+ double fRotate, fShearX;
+ getTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // build ranges with only scale
+ basegfx::B2DRange aInnerRange(0.0, 0.0, aScale.getX(), aScale.getY());
+ basegfx::B2DRange aOuterRange(aInnerRange);
basegfx::B2DPolyPolygon aHatchPolyPolygon;
+ // grow ranges with discrete sizes
aOuterRange.grow(getDiscreteUnit() * getDiscreteGrow());
aInnerRange.grow(getDiscreteUnit() * -getDiscreteShrink());
+ // create polygon data from it
aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aOuterRange));
if(!aInnerRange.isEmpty())
@@ -222,22 +199,22 @@ namespace drawinglayer
aHatchPolyPolygon.append(basegfx::tools::createPolygonFromRect(aInnerRange));
}
- if(!basegfx::fTools::equalZero(getRotation()))
- {
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createRotateAroundPoint(
- getObjectRange().getMinX(), getObjectRange().getMinY(), getRotation()));
-
- aHatchPolyPolygon.transform(aTransform);
- }
+ // transform polygon data except already applied scale
+ aHatchPolyPolygon.transform(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX, fRotate, aTranslate));
+ // create fill parameters
const basegfx::BColor aEmptyColor(0.0, 0.0, 0.0);
const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
drawinglayer::attribute::HATCHSTYLE_SINGLE,
getDiscreteHatchDistance() * getDiscreteUnit(),
- getHatchRotation() - getRotation(),
+ getHatchRotation() - fRotate,
getHatchColor(),
3, // same default as VCL, a minimum of three discrete units (pixels) offset
false);
+
+ // create primitive
const Primitive2DReference aPrimitive(
new PolyPolygonHatchPrimitive2D(
aHatchPolyPolygon,
@@ -250,25 +227,7 @@ namespace drawinglayer
return aRetval;
}
- bool OverlayHatchRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const OverlayHatchRectanglePrimitive& rCompare = static_cast< const OverlayHatchRectanglePrimitive& >(rPrimitive);
-
- return (getObjectRange() == rCompare.getObjectRange()
- && getDiscreteHatchDistance() == rCompare.getDiscreteHatchDistance()
- && getHatchRotation() == rCompare.getHatchRotation()
- && getHatchColor() == rCompare.getHatchColor()
- && getDiscreteGrow() == rCompare.getDiscreteGrow()
- && getDiscreteShrink() == rCompare.getDiscreteShrink()
- && getRotation() == rCompare.getRotation());
- }
-
- return false;
- }
-
- ImplPrimitrive2DIDBlock(OverlayHatchRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYHATCHRECTANGLEPRIMITIVE)
+ ImplPrimitrive2DIDBlock(OverlayHatchPrimitive, PRIMITIVE2D_ID_OVERLAYHATCHPRIMITIVE)
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -338,7 +297,8 @@ namespace drawinglayer
default: // case HELPLINESTYLE_POINT :
{
- const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength());
+ const double fViewFixValue(15.0);
+ const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(fViewFixValue, 0.0)).getLength());
aRetval.realloc(2);
basegfx::B2DPolygon aLineA, aLineB;
@@ -370,22 +330,6 @@ namespace drawinglayer
return aRetval;
}
- bool OverlayHelplineStripedPrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(ViewportDependentPrimitive2D::operator==(rPrimitive))
- {
- const OverlayHelplineStripedPrimitive& rCompare = static_cast< const OverlayHelplineStripedPrimitive& >(rPrimitive);
-
- return (getBasePosition() == rCompare.getBasePosition()
- && getStyle() == rCompare.getStyle()
- && getRGBColorA() == rCompare.getRGBColorA()
- && getRGBColorB() == rCompare.getRGBColorB()
- && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
- }
-
- return false;
- }
-
ImplPrimitrive2DIDBlock(OverlayHelplineStripedPrimitive, PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE)
} // end of namespace primitive2d
@@ -466,21 +410,6 @@ namespace drawinglayer
return aRetval;
}
- bool OverlayRollingRectanglePrimitive::operator==( const BasePrimitive2D& rPrimitive ) const
- {
- if(ViewportDependentPrimitive2D::operator==(rPrimitive))
- {
- const OverlayRollingRectanglePrimitive& rCompare = static_cast< const OverlayRollingRectanglePrimitive& >(rPrimitive);
-
- return (getRollingRectangle() == rCompare.getRollingRectangle()
- && getRGBColorA() == rCompare.getRGBColorA()
- && getRGBColorB() == rCompare.getRGBColorB()
- && getDiscreteDashLength() == rCompare.getDiscreteDashLength());
- }
-
- return false;
- }
-
ImplPrimitrive2DIDBlock(OverlayRollingRectanglePrimitive, PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE)
} // end of namespace primitive2d
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 20cb325ec062..8907cc653c63 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -47,10 +47,6 @@
#include <svx/xgrscit.hxx>
#include <svx/xflhtit.hxx>
#include <svx/xflbckit.hxx>
-#include <svx/sdshitm.hxx>
-#include <svx/sdsxyitm.hxx>
-#include <svx/sdshcitm.hxx>
-#include <svx/sdshtitm.hxx>
#include <drawinglayer/attribute/sdrfillgraphicattribute.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <svx/svdotext.hxx>
@@ -340,11 +336,11 @@ namespace drawinglayer
attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet& rSet)
{
- const bool bShadow(((SdrShadowItem&)rSet.Get(SDRATTR_SHADOW)).GetValue());
+ const bool bShadow(((SdrOnOffItem&)rSet.Get(SDRATTR_SHADOW)).GetValue());
if(bShadow)
{
- sal_uInt16 nTransparence(((SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ sal_uInt16 nTransparence(((SdrPercentItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
if(nTransparence > 100)
{
@@ -373,9 +369,9 @@ namespace drawinglayer
if(100 != nTransparence)
{
const basegfx::B2DVector aOffset(
- (double)((SdrShadowXDistItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue(),
- (double)((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
- const Color aColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
+ (double)((SdrMetricItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue(),
+ (double)((SdrMetricItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
+ const Color aColor(((XColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
}
@@ -491,16 +487,16 @@ namespace drawinglayer
const sal_Int32* pRight,
const sal_Int32* pLower)
{
- const SdrTextObj& rTextObj = rText.GetObject();
+ const SdrTextObj& rTextObj = rText.getSdrTextObj();
- if(rText.GetOutlinerParaObject() && rText.GetModel())
+ if(rText.GetOutlinerParaObject())
{
// added TextEdit text suppression
bool bInEditMode(false);
- if(rText.GetObject().getTextCount() > 1)
+ if(rTextObj.getTextCount() > 1)
{
- bInEditMode = rTextObj.IsInEditMode() && rText.GetObject().getActiveText() == &rText;
+ bInEditMode = rTextObj.IsInEditMode() && rTextObj.getActiveText() == &rText;
}
else
{
@@ -531,7 +527,7 @@ namespace drawinglayer
const SdrTextAniKind eAniKind(rTextObj.GetTextAniKind());
// #i107346#
- const SdrOutliner& rDrawTextOutliner = rText.GetModel()->GetDrawOutliner(&rTextObj);
+ const SdrOutliner& rDrawTextOutliner = rTextObj.getSdrModelFromSdrObject().GetDrawOutliner(&rTextObj);
const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EE_CNTRL_ONLINESPELLING);
return attribute::SdrTextAttribute(
@@ -544,7 +540,7 @@ namespace drawinglayer
pLower ? *pLower : rTextObj.GetTextLowerDistance(),
rTextObj.GetTextHorizontalAdjust(rSet),
rTextObj.GetTextVerticalAdjust(rSet),
- ((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(),
+ ((const SdrOnOffItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(),
(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit),
((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(),
SDRTEXTANI_BLINK == eAniKind,
@@ -848,10 +844,10 @@ namespace drawinglayer
}
// get distance
- const double fDistance(((const Svx3DDistanceItem&)rSet.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue());
+ const double fDistance(((const SfxUInt32Item&)rSet.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue());
// get shadow slant
- const double fShadowSlant(F_PI180 * ((const Svx3DShadowSlantItem&)rSet.Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue());
+ const double fShadowSlant(F_PI180 * ((const SfxUInt16Item&)rSet.Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue());
// get shade mode
::com::sun::star::drawing::ShadeMode aShadeMode(::com::sun::star::drawing::ShadeMode_FLAT);
@@ -871,7 +867,7 @@ namespace drawinglayer
}
// get two sided lighting
- const bool bTwoSidedLighting(((const Svx3DTwoSidedLightingItem&)rSet.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue());
+ const bool bTwoSidedLighting(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue());
return attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting);
}
@@ -881,76 +877,81 @@ namespace drawinglayer
// extract lights from given SfxItemSet (from scene)
::std::vector< attribute::Sdr3DLightAttribute > aLightVector;
- if(((const Svx3DLightOnOff1Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor1Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection1Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, true));
}
- if(((const Svx3DLightOnOff2Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor2Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection2Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
- if(((const Svx3DLightOnOff3Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor3Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection3Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
- if(((const Svx3DLightOnOff4Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor4Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection4Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
- if(((const Svx3DLightOnOff5Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor5Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection5Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
- if(((const Svx3DLightOnOff6Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor6Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection6Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
- if(((const Svx3DLightOnOff7Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor7Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection7Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
- if(((const Svx3DLightOnOff8Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue())
+ if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue())
{
- const basegfx::BColor aColor(((const Svx3DLightcolor8Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection8Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue());
+ const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue().getBColor());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
// get ambient color
- const Color aAmbientValue(((const Svx3DAmbientcolorItem&)rSet.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue());
+ const Color aAmbientValue(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue());
const basegfx::BColor aAmbientLight(aAmbientValue.getBColor());
return attribute::SdrLightingAttribute(aAmbientLight, aLightVector);
}
- void calculateRelativeCornerRadius(sal_Int32 nRadius, const basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY)
+ void calculateRelativeCornerRadius(
+ sal_Int32 nRadius,
+ const double& rfWidth,
+ const double& rfHeight,
+ double& rfCornerRadiusX,
+ double& rfCornerRadiusY)
{
rfCornerRadiusX = rfCornerRadiusY = (double)nRadius;
if(0.0 != rfCornerRadiusX)
{
- const double fHalfObjectWidth(rObjectRange.getWidth() * 0.5);
+ const double fHalfObjectWidth(rfWidth * 0.5);
if(0.0 != fHalfObjectWidth)
{
@@ -974,7 +975,7 @@ namespace drawinglayer
if(0.0 != rfCornerRadiusY)
{
- const double fHalfObjectHeight(rObjectRange.getHeight() * 0.5);
+ const double fHalfObjectHeight(rfHeight * 0.5);
if(0.0 != fHalfObjectHeight)
{
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index 421229bbb1af..5ed043485012 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -45,7 +45,7 @@ namespace drawinglayer
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
- basegfx::B2DRange(0.0, 0.0, 1.0, 1.0),
+ basegfx::B2DRange::getUnitB2DRange(),
getCornerRadiusX(),
getCornerRadiusY()));
@@ -147,22 +147,6 @@ namespace drawinglayer
}
}
- bool SdrCaptionPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrCaptionPrimitive2D& rCompare = (SdrCaptionPrimitive2D&)rPrimitive;
-
- return (getCornerRadiusX() == rCompare.getCornerRadiusX()
- && getCornerRadiusY() == rCompare.getCornerRadiusY()
- && getTail() == rCompare.getTail()
- && getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrCaptionPrimitive2D, PRIMITIVE2D_ID_SDRCAPTIONPRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index d7ceaa98e706..15b804909eaf 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -97,19 +97,6 @@ namespace drawinglayer
{
}
- bool SdrConnectorPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrConnectorPrimitive2D& rCompare = (SdrConnectorPrimitive2D&)rPrimitive;
-
- return (getUnitPolygon() == rCompare.getUnitPolygon()
- && getSdrLSTAttribute() == rCompare.getSdrLSTAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrConnectorPrimitive2D, PRIMITIVE2D_ID_SDRCONNECTORPRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 38a21012b73f..c0aa7c3ff643 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -99,23 +99,6 @@ namespace drawinglayer
{
}
- bool SdrCustomShapePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrCustomShapePrimitive2D& rCompare = (SdrCustomShapePrimitive2D&)rPrimitive;
-
- return (getSdrSTAttribute() == rCompare.getSdrSTAttribute()
- && getSubPrimitives() == rCompare.getSubPrimitives()
- && getTextBox() == rCompare.getTextBox()
- && getWordWrap() == rCompare.getWordWrap()
- && get3DShape() == rCompare.get3DShape()
- && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrCustomShapePrimitive2D, PRIMITIVE2D_ID_SDRCUSTOMSHAPEPRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 2a029f112280..28e55ddac448 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -180,7 +180,8 @@ namespace drawinglayer
{
// take line width into account and shrink contour polygon accordingly
// decompose to get scale
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -195,8 +196,8 @@ namespace drawinglayer
// scale back to unit polygon
aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(
- 0.0 != aScale.getX() ? 1.0 / aScale.getX() : 1.0,
- 0.0 != aScale.getY() ? 1.0 / aScale.getY() : 1.0));
+ 0.0 != aScale.getX() ? 1.0 / fabs(aScale.getX()) : 1.0,
+ 0.0 != aScale.getY() ? 1.0 / fabs(aScale.getY()) : 1.0));
// create with unit polygon
pNew = new SdrContourTextPrimitive2D(
@@ -230,7 +231,8 @@ namespace drawinglayer
{
// rObjectTransform is the whole SdrObject transformation from unit rectangle
// to it's size and position. Decompose to allow working with single values.
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
@@ -265,8 +267,10 @@ namespace drawinglayer
aAnchorTransform.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0);
// apply object's other transforms
- aAnchorTransform = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate)
- * aAnchorTransform;
+ aAnchorTransform = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX,
+ fRotate,
+ aTranslate) * aAnchorTransform;
if(rText.isFitToSize())
{
@@ -324,17 +328,21 @@ namespace drawinglayer
if(rText.getSdrFormTextAttribute().isDefault())
{
// get scroll direction
- const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection());
+ const SdrTextAniDirection eDirection(rText.getSdrText().getSdrTextObj().GetTextAniDirection());
const bool bHorizontal(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection);
// decompose to get separated values for the scroll box
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
aAnchorTransform.decompose(aScale, aTranslate, fRotate, fShearX);
// build transform from scaled only to full AnchorTransform and inverse
- const basegfx::B2DHomMatrix aSRT(basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
- fShearX, fRotate, aTranslate));
+ const basegfx::B2DHomMatrix aSRT(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX,
+ fRotate,
+ aTranslate));
basegfx::B2DHomMatrix aISRT(aSRT);
aISRT.invert();
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index a3e560dd0add..f6fbacab5067 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -124,19 +124,6 @@ namespace drawinglayer
{
}
- bool SdrEllipsePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrEllipsePrimitive2D& rCompare = (SdrEllipsePrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrEllipsePrimitive2D, PRIMITIVE2D_ID_SDRELLIPSEPRIMITIVE2D)
@@ -154,7 +141,10 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
+ // Exchange start and end since the historical definitions spawns
+ // the visible part of the circle segment in mathematically negative
+ // direction
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitEllipseSegment(mfEndAngle, mfStartAngle));
if(mbCloseSegment)
{
@@ -246,24 +236,6 @@ namespace drawinglayer
{
}
- bool SdrEllipseSegmentPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(SdrEllipsePrimitive2D::operator==(rPrimitive))
- {
- const SdrEllipseSegmentPrimitive2D& rCompare = (SdrEllipseSegmentPrimitive2D&)rPrimitive;
-
- if( mfStartAngle == rCompare.mfStartAngle
- && mfEndAngle == rCompare.mfEndAngle
- && mbCloseSegment == rCompare.mbCloseSegment
- && mbCloseUsingCenter == rCompare.mbCloseUsingCenter)
- {
- return true;
- }
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrEllipseSegmentPrimitive2D, PRIMITIVE2D_ID_SDRELLIPSESEGMENTPRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index 671160f81acd..01f4e7efc481 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -76,7 +76,8 @@ namespace drawinglayer
if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -141,22 +142,8 @@ namespace drawinglayer
maGraphicAttr(rGraphicAttr)
{
// reset some values from GraphicAttr which are part of transformation already
- maGraphicAttr.SetRotation(0L);
- }
-
- bool SdrGrafPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrGrafPrimitive2D& rCompare = (SdrGrafPrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()
- && getGraphicObject() == rCompare.getGraphicObject()
- && getGraphicAttr() == rCompare.getGraphicAttr());
- }
-
- return false;
+ maGraphicAttr.SetRotation(0);
+ maGraphicAttr.SetMirrorFlags(0);
}
bool SdrGrafPrimitive2D::isTransparent() const
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 214515915750..f314f9b6203b 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -99,7 +99,7 @@ namespace drawinglayer
bool bAutoUpsideDown(false);
const attribute::SdrTextAttribute rTextAttribute = getSdrLSTAttribute().getText();
const basegfx::B2DHomMatrix aObjectMatrix(
- basegfx::tools::createShearXRotateTranslateB2DHomMatrix(0.0, fAngle, getStart()));
+ basegfx::tools::createRotateTranslateB2DHomMatrix(fAngle, getStart()));
// preapare text, but do not add yet; it needs to be aligned to
// the line geometry
@@ -472,30 +472,6 @@ namespace drawinglayer
{
}
- bool SdrMeasurePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrMeasurePrimitive2D& rCompare = (SdrMeasurePrimitive2D&)rPrimitive;
-
- return (getStart() == rCompare.getStart()
- && getEnd() == rCompare.getEnd()
- && getHorizontal() == rCompare.getHorizontal()
- && getVertical() == rCompare.getVertical()
- && getDistance() == rCompare.getDistance()
- && getUpper() == rCompare.getUpper()
- && getLower() == rCompare.getLower()
- && getLeftDelta() == rCompare.getLeftDelta()
- && getRightDelta() == rCompare.getRightDelta()
- && getBelow() == rCompare.getBelow()
- && getTextRotation() == rCompare.getTextRotation()
- && getTextAutoAngle() == rCompare.getTextAutoAngle()
- && getSdrLSTAttribute() == rCompare.getSdrLSTAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrMeasurePrimitive2D, PRIMITIVE2D_ID_SDRMEASUREPRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index 4f364f52f839..b1f14fc99754 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -50,29 +50,6 @@ namespace drawinglayer
{
}
- bool SdrOle2Primitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BasePrimitive2D::operator==(rPrimitive))
- {
- const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive;
-
- // #i108636# The standard operator== on two UNO sequences did not work as i
- // would have expected; it just checks the .is() states and the data type
- // of the sequence. What i need here is detection of equality of the whole
- // sequence content, thus i need to use the arePrimitive2DSequencesEqual helper
- // here instead of the operator== which lead to always returning false and thus
- // always re-decompositions of the subcontent.
- if(arePrimitive2DSequencesEqual(getOLEContent(), rCompare.getOLEContent())
- && getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute())
- {
- return true;
- }
- }
-
- return false;
- }
-
Primitive2DSequence SdrOle2Primitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
// to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::create2DDecomposition
@@ -108,7 +85,8 @@ namespace drawinglayer
if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index 2a6592ef30d9..38c670007f29 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -76,7 +76,8 @@ namespace drawinglayer
if(bScaleContent)
{
// get transformation atoms
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
getObjectTransform().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -99,9 +100,12 @@ namespace drawinglayer
{
// if content fits into frame, create it
basegfx::B2DHomMatrix aInnerObjectMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(
- aPrefSize.getWidth(), aPrefSize.getHeight(), fOffsetX, fOffsetY));
- aInnerObjectMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate)
- * aInnerObjectMatrix;
+ aPrefSize.getWidth(), aPrefSize.getHeight(),
+ fOffsetX, fOffsetY));
+ aInnerObjectMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ fShearX,
+ fRotate,
+ aTranslate) * aInnerObjectMatrix;
const drawinglayer::primitive2d::Primitive2DReference aGraphicPrimitive(
new drawinglayer::primitive2d::GraphicPrimitive2D(
@@ -157,34 +161,9 @@ namespace drawinglayer
{
}
- bool SdrOleContentPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrOleContentPrimitive2D& rCompare = (SdrOleContentPrimitive2D&)rPrimitive;
- const bool bBothNot(!mpSdrOle2Obj.is() && !rCompare.mpSdrOle2Obj.is());
- const bool bBothAndEqual(mpSdrOle2Obj.is() && rCompare.mpSdrOle2Obj.is()
- && mpSdrOle2Obj.get() == rCompare.mpSdrOle2Obj.get());
-
- return ((bBothNot || bBothAndEqual)
- && getObjectTransform() == rCompare.getObjectTransform()
-
- // #i104867# to find out if the Graphic content of the
- // OLE has changed, use GraphicVersion number
- && getGraphicVersion() == rCompare.getGraphicVersion()
-
- && getHighContrast() == rCompare.getHighContrast());
- }
-
- return false;
- }
-
basegfx::B2DRange SdrOleContentPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- basegfx::B2DRange aRange(0.0, 0.0, 1.0, 1.0);
- aRange.transform(getObjectTransform());
-
- return aRange;
+ return getObjectTransform() * basegfx::B2DRange::getUnitB2DRange();
}
// provide unique ID
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index 2786360d864a..b82ca6dedd6d 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -119,20 +119,6 @@ namespace drawinglayer
{
}
- bool SdrPathPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrPathPrimitive2D& rCompare = (SdrPathPrimitive2D&)rPrimitive;
-
- return (getUnitPolyPolygon() == rCompare.getUnitPolyPolygon()
- && getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrPathPrimitive2D, PRIMITIVE2D_ID_SDRPATHPRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 96ee3513e569..10a244ef0ec1 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -46,7 +46,7 @@ namespace drawinglayer
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
- basegfx::B2DRange(0.0, 0.0, 1.0, 1.0),
+ basegfx::B2DRange::getUnitB2DRange(),
getCornerRadiusX(),
getCornerRadiusY()));
@@ -132,22 +132,6 @@ namespace drawinglayer
{
}
- bool SdrRectanglePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrRectanglePrimitive2D& rCompare = (SdrRectanglePrimitive2D&)rPrimitive;
-
- return (getCornerRadiusX() == rCompare.getCornerRadiusX()
- && getCornerRadiusY() == rCompare.getCornerRadiusY()
- && getTransform() == rCompare.getTransform()
- && getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute()
- && getForceFillForHitTest() == rCompare.getForceFillForHitTest());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrRectanglePrimitive2D, PRIMITIVE2D_ID_SDRRECTANGLEPRIMITIVE2D)
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index d6bc619b7680..1f4c3f2a21c5 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -71,16 +71,16 @@ namespace
sal_Int16 nRetval(0);
SdrPage* pPage = GetSdrPageFromXDrawPage(rxDrawPage);
- if(pPage && pPage->GetModel())
+ if(pPage)
{
- if( (pPage->GetPageNum() == 0) && !pPage->IsMasterPage() )
+ if( (pPage->GetPageNumber() == 0) && !pPage->IsMasterPage() )
{
// handout page!
- return pPage->GetModel()->getHandoutPageCount();
+ return pPage->getSdrModelFromSdrPage().getHandoutPageCount();
}
else
{
- const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount());
+ const sal_uInt32 nPageCount(pPage->getSdrModelFromSdrPage().GetPageCount());
nRetval = ((sal_Int16)nPageCount - 1) / 2;
}
}
@@ -122,30 +122,12 @@ namespace drawinglayer
{
const EditTextObject& rETO = maOutlinerParaObject.GetTextObject();
- mbContainsPageField = rETO.HasField(SvxPageField::StaticType());
- mbContainsPageCountField = rETO.HasField(SvxPagesField::StaticType());
- mbContainsOtherFields = rETO.HasField(SvxHeaderField::StaticType())
- || rETO.HasField(SvxFooterField::StaticType())
- || rETO.HasField(SvxDateTimeField::StaticType())
- || rETO.HasField(SvxAuthorField::StaticType());
- }
-
- bool SdrTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrTextPrimitive2D& rCompare = (SdrTextPrimitive2D&)rPrimitive;
-
- return (
-
- // compare OPO and content, but not WrongList
- getOutlinerParaObject() == rCompare.getOutlinerParaObject()
-
- // also compare WrongList (not-persistent data, but visualized)
- && getOutlinerParaObject().isWrongListEqual(rCompare.getOutlinerParaObject()));
- }
-
- return false;
+ mbContainsPageField = rETO.HasField(&typeid(SvxPageField));
+ mbContainsPageCountField = rETO.HasField(&typeid(SvxPagesField));
+ mbContainsOtherFields = rETO.HasField(&typeid(SvxHeaderField))
+ || rETO.HasField(&typeid(SvxFooterField))
+ || rETO.HasField(&typeid(SvxDateTimeField))
+ || rETO.HasField(&typeid(SvxAuthorField));
}
Primitive2DSequence SdrTextPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
@@ -197,9 +179,9 @@ namespace drawinglayer
}
// #i101443# check change of TextBackgroundolor
- if(!bDoDelete && getSdrText() && getSdrText()->GetModel())
+ if(!bDoDelete && getSdrText())
{
- SdrOutliner& rDrawOutliner = getSdrText()->GetModel()->GetDrawOutliner(0);
+ SdrOutliner& rDrawOutliner = getSdrText()->getSdrTextObj().getSdrModelFromSdrObject().GetDrawOutliner(0);
aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor();
bNewTextBackgroundColorIsSet = true;
@@ -232,9 +214,9 @@ namespace drawinglayer
nCurrentlyValidPageCount = getPageCount(xCurrentlyVisualizingPage);
}
- if(!bNewTextBackgroundColorIsSet && getSdrText() && getSdrText()->GetModel())
+ if(!bNewTextBackgroundColorIsSet && getSdrText())
{
- SdrOutliner& rDrawOutliner = getSdrText()->GetModel()->GetDrawOutliner(0);
+ SdrOutliner& rDrawOutliner = getSdrText()->getSdrTextObj().getSdrModelFromSdrObject().GetDrawOutliner(0);
aNewTextBackgroundColor = rDrawOutliner.GetBackgroundColor();
}
@@ -259,7 +241,7 @@ namespace drawinglayer
Primitive2DSequence SdrContourTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- getSdrText()->GetObject().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation);
+ getSdrText()->getSdrTextObj().impDecomposeContourTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -275,19 +257,6 @@ namespace drawinglayer
{
}
- bool SdrContourTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(SdrTextPrimitive2D::operator==(rPrimitive))
- {
- const SdrContourTextPrimitive2D& rCompare = (SdrContourTextPrimitive2D&)rPrimitive;
-
- return (getUnitPolyPolygon() == rCompare.getUnitPolyPolygon()
- && getObjectTransform() == rCompare.getObjectTransform());
- }
-
- return false;
- }
-
SdrTextPrimitive2D* SdrContourTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
return new SdrContourTextPrimitive2D(
@@ -312,7 +281,7 @@ namespace drawinglayer
Primitive2DSequence SdrPathTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation);
+ getSdrText()->getSdrTextObj().impDecomposePathTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -328,19 +297,6 @@ namespace drawinglayer
{
}
- bool SdrPathTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(SdrTextPrimitive2D::operator==(rPrimitive))
- {
- const SdrPathTextPrimitive2D& rCompare = (SdrPathTextPrimitive2D&)rPrimitive;
-
- return (getPathPolyPolygon() == rCompare.getPathPolyPolygon()
- && getSdrFormTextAttribute() == rCompare.getSdrFormTextAttribute());
- }
-
- return false;
- }
-
SdrTextPrimitive2D* SdrPathTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
basegfx::B2DPolyPolygon aNewPolyPolygon(getPathPolyPolygon());
@@ -368,7 +324,7 @@ namespace drawinglayer
Primitive2DSequence SdrBlockTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation);
+ getSdrText()->getSdrTextObj().impDecomposeBlockTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -396,25 +352,6 @@ namespace drawinglayer
{
}
- bool SdrBlockTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(SdrTextPrimitive2D::operator==(rPrimitive))
- {
- const SdrBlockTextPrimitive2D& rCompare = (SdrBlockTextPrimitive2D&)rPrimitive;
-
- return (getTextRangeTransform() == rCompare.getTextRangeTransform()
- && getSdrTextHorzAdjust() == rCompare.getSdrTextHorzAdjust()
- && getSdrTextVertAdjust() == rCompare.getSdrTextVertAdjust()
- && isFixedCellHeight() == rCompare.isFixedCellHeight()
- && getUnlimitedPage() == rCompare.getUnlimitedPage()
- && getCellText() == rCompare.getCellText()
- && getWordWrap() == rCompare.getWordWrap()
- && getClipOnBounds() == rCompare.getClipOnBounds());
- }
-
- return false;
- }
-
SdrTextPrimitive2D* SdrBlockTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
return new SdrBlockTextPrimitive2D(
@@ -445,7 +382,7 @@ namespace drawinglayer
Primitive2DSequence SdrStretchTextPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation);
+ getSdrText()->getSdrTextObj().impDecomposeStretchTextPrimitive(aRetval, *this, aViewInformation);
return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
}
@@ -461,19 +398,6 @@ namespace drawinglayer
{
}
- bool SdrStretchTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(SdrTextPrimitive2D::operator==(rPrimitive))
- {
- const SdrStretchTextPrimitive2D& rCompare = (SdrStretchTextPrimitive2D&)rPrimitive;
-
- return (getTextRangeTransform() == rCompare.getTextRangeTransform()
- && isFixedCellHeight() == rCompare.isFixedCellHeight());
- }
-
- return false;
- }
-
SdrTextPrimitive2D* SdrStretchTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
{
return new SdrStretchTextPrimitive2D(
diff --git a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
index aedb6cbdfdf5..364590370b53 100644
--- a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
+++ b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
@@ -54,7 +54,7 @@ namespace drawinglayer
}
// get NoermalsInvert flag
- const bool bInvertNormals(((const Svx3DNormalsInvertItem&)rSet.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue());
+ const bool bInvertNormals(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue());
// get TextureProjectionX
::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX(::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC);
@@ -83,13 +83,13 @@ namespace drawinglayer
}
// get DoubleSided flag
- const bool bDoubleSided(((const Svx3DDoubleSidedItem&)rSet.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue());
+ const bool bDoubleSided(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue());
// get Shadow3D flag
- const bool bShadow3D(((const Svx3DShadow3DItem&)rSet.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue());
+ const bool bShadow3D(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue());
// get TextureFilter flag
- const bool bTextureFilter(((const Svx3DTextureFilterItem&)rSet.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue());
+ const bool bTextureFilter(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue());
// get texture kind
// TextureKind: 1 == Base3DTextureLuminance, 2 == Base3DTextureIntensity, 3 == Base3DTextureColor
@@ -123,13 +123,13 @@ namespace drawinglayer
const ::basegfx::BColor aObjectColor(((const XFillColorItem&)rSet.Get(XATTR_FILLCOLOR)).GetColorValue().getBColor());
// get specular color
- const ::basegfx::BColor aSpecular(((const Svx3DMaterialSpecularItem&)rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue().getBColor());
+ const ::basegfx::BColor aSpecular(((const SvxColorItem&)rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue().getBColor());
// get emissive color
- const ::basegfx::BColor aEmission(((const Svx3DMaterialEmissionItem&)rSet.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue().getBColor());
+ const ::basegfx::BColor aEmission(((const SvxColorItem&)rSet.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue().getBColor());
// get specular intensity
- sal_uInt16 nSpecularIntensity(((const Svx3DMaterialSpecularIntensityItem&)rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue());
+ sal_uInt16 nSpecularIntensity(((const SfxUInt16Item&)rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue());
if(nSpecularIntensity > 128)
{
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index 3c7ee0671e30..be75e4f0db4f 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -45,9 +45,9 @@
#include <svx/svdmodel.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdpage.hxx>
-
-// #114265#
#include <svl/smplhint.hxx>
+#include <svx/svdograf.hxx>
+#include <svx/svdoole2.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -55,27 +55,14 @@ namespace sdr
{
namespace properties
{
- void AttributeProperties::ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void AttributeProperties::ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr)
{
- // test if old StyleSheet is cleared, else it would be lost
- // after this method -> memory leak (!)
- DBG_ASSERT(!mpStyleSheet, "Old style sheet not deleted before setting new one (!)");
-
- if(pNewStyleSheet)
+ if(mpItemSet && mpStyleSheet)
{
- mpStyleSheet = pNewStyleSheet;
-
- // local ItemSet is needed here, force it
- GetObjectItemSet();
-
- // register as listener
- StartListening(pNewStyleSheet->GetPool());
- StartListening(*pNewStyleSheet);
-
// Delete hard attributes where items are set in the style sheet
if(!bDontRemoveHardAttr)
{
- const SfxItemSet& rStyle = pNewStyleSheet->GetItemSet();
+ const SfxItemSet& rStyle = mpStyleSheet->GetItemSet();
SfxWhichIter aIter(rStyle);
sal_uInt16 nWhich = aIter.FirstWhich();
@@ -91,30 +78,213 @@ namespace sdr
}
// set new stylesheet as parent
- mpItemSet->SetParent(&pNewStyleSheet->GetItemSet());
+ mpItemSet->SetParent(&mpStyleSheet->GetItemSet());
+ }
+ else
+ {
+ OSL_ENSURE(false, "ImpSetParentAtSfxItemSet called without SfxItemSet/SfxStyleSheet (!)");
+ }
+ }
+
+ void AttributeProperties::ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
+ {
+ // test if old StyleSheet is cleared
+ if(GetStyleSheet())
+ {
+ OSL_ENSURE(false, "Old style sheet not deleted before setting new one (!)");
+ ImpRemoveStyleSheet();
+ }
+
+ if(pNewStyleSheet)
+ {
+ // remember StyleSheet
+ mpStyleSheet = pNewStyleSheet;
+
+ // register as listener
+ StartListening(pNewStyleSheet->GetPool());
+ StartListening(*pNewStyleSheet);
+
+ // only apply the following when we have an SfxItemSet already, else
+ if(mpItemSet && GetStyleSheet())
+ {
+ ImpSetParentAtSfxItemSet(bDontRemoveHardAttr);
+ }
}
}
void AttributeProperties::ImpRemoveStyleSheet()
{
- // Check type since it is destroyed when the type is deleted
- if(GetStyleSheet() && HAS_BASE(SfxStyleSheet, mpStyleSheet))
+ if(GetStyleSheet())
{
+ // deregister as listener
EndListening(*mpStyleSheet);
EndListening(mpStyleSheet->GetPool());
// reset parent of ItemSet
if(mpItemSet)
{
- mpItemSet->SetParent(0L);
+ mpItemSet->SetParent(0);
}
- SdrObject& rObj = GetSdrObject();
- rObj.SetBoundRectDirty();
- rObj.SetRectsDirty(sal_True);
+ // trigger change at owning SdrObject
+ GetSdrObject().ActionChanged();
+ }
+
+ mpStyleSheet = 0;
+ }
+
+ void AttributeProperties::ImpModelChange(SdrModel& rSourceModel, SdrModel& rTargetModel)
+ {
+ // If metric has changed, scale items.
+ const MapUnit aOldUnit(rSourceModel.GetExchangeObjectUnit());
+ const MapUnit aNewUnit(rTargetModel.GetExchangeObjectUnit());
+ const bool bScaleUnitChanged(aNewUnit != aOldUnit);
+ Fraction aMetricFactor;
+
+ if(bScaleUnitChanged)
+ {
+ aMetricFactor = GetMapFactor(aOldUnit, aNewUnit).X();
+ Scale(aMetricFactor);
}
- mpStyleSheet = 0L;
+ // Move all styles which are used by the object to the new
+ // StyleSheet pool
+ SfxStyleSheet* pOldStyleSheet = GetStyleSheet();
+
+ if(pOldStyleSheet)
+ {
+ SfxStyleSheetBase* pSheet = pOldStyleSheet;
+ SfxStyleSheetBasePool* pOldPool = rSourceModel.GetStyleSheetPool();
+ SfxStyleSheetBasePool* pNewPool = rTargetModel.GetStyleSheetPool();
+
+ if(pOldPool && pNewPool)
+ {
+ // build a list of to-be-copied Styles
+ std::vector< SfxStyleSheetBase* > aStyleSheetStack;
+ SfxStyleSheetBase* pAnchor = 0;
+
+ while(pSheet)
+ {
+ pAnchor = pNewPool->Find(pSheet->GetName(), pSheet->GetFamily());
+
+ if(!pAnchor)
+ {
+ aStyleSheetStack.push_back(pSheet);
+ pSheet = pOldPool->Find(pSheet->GetParent(), pSheet->GetFamily());
+ }
+ else
+ {
+ // the style does exist
+ pSheet = 0L;
+ }
+ }
+
+ // copy and set the parents
+ SfxStyleSheetBase* pNewSheet = 0;
+ SfxStyleSheetBase* pLastSheet = 0;
+ SfxStyleSheetBase* pForThisObject = 0;
+
+ for(sal_uInt32 a(0); a < aStyleSheetStack.size(); a++)
+ {
+ pSheet = aStyleSheetStack[a];
+ pNewSheet = &pNewPool->Make(pSheet->GetName(), pSheet->GetFamily(), pSheet->GetMask());
+ pNewSheet->GetItemSet().Put(pSheet->GetItemSet(), sal_False);
+
+ if(bScaleUnitChanged)
+ {
+ sdr::properties::ScaleItemSet(pNewSheet->GetItemSet(), aMetricFactor);
+ }
+
+ if(pLastSheet)
+ {
+ pLastSheet->SetParent(pNewSheet->GetName());
+ }
+
+ if(!pForThisObject)
+ {
+ pForThisObject = pNewSheet;
+ }
+
+ pLastSheet = pNewSheet;
+ }
+
+ // Set link to the Style found in the Pool
+ if(pAnchor && pLastSheet)
+ {
+ pLastSheet->SetParent(pAnchor->GetName());
+ }
+
+ // if list was empty (all Styles exist in destination pool)
+ // pForThisObject is not yet set
+ if(!pForThisObject && pAnchor)
+ {
+ pForThisObject = pAnchor;
+ }
+
+ // De-register at old and register at new Style
+ if(GetStyleSheet() != pForThisObject)
+ {
+ ImpRemoveStyleSheet();
+ ImpAddStyleSheet((SfxStyleSheet*)pForThisObject, true);
+ }
+ }
+ else
+ {
+ // there is no StyleSheetPool in the new model, thus set
+ // all items as hard items in the object
+ std::vector< const SfxItemSet* > aItemSetStack;
+ const SfxItemSet* pItemSet = &pOldStyleSheet->GetItemSet();
+
+ while(pItemSet)
+ {
+ aItemSetStack.push_back(pItemSet);
+ pItemSet = pItemSet->GetParent();
+ }
+
+ SfxItemSet* pNewSet = &CreateObjectSpecificItemSet(rTargetModel.GetItemPool());
+
+ for(sal_uInt32 a(0); a < aItemSetStack.size(); a++)
+ {
+ pItemSet = aItemSetStack[aItemSetStack.size() - 1 - a];
+ pNewSet->Put(*pItemSet);
+ }
+
+ // Items which were hard attributes before need to stay
+ if(mpItemSet)
+ {
+ SfxWhichIter aIter(*mpItemSet);
+ sal_uInt16 nWhich = aIter.FirstWhich();
+
+ while(nWhich)
+ {
+ if(mpItemSet->GetItemState(nWhich, false) == SFX_ITEM_SET)
+ {
+ pNewSet->Put(mpItemSet->Get(nWhich));
+ }
+
+ nWhich = aIter.NextWhich();
+ }
+ }
+
+ if(bScaleUnitChanged)
+ {
+ ScaleItemSet(*pNewSet, aMetricFactor);
+ }
+
+ if(mpItemSet)
+ {
+ if(GetStyleSheet())
+ {
+ ImpRemoveStyleSheet();
+ }
+
+ delete mpItemSet;
+ mpItemSet = 0;
+ }
+
+ mpItemSet = pNewSet;
+ }
+ }
}
// create a new itemset
@@ -133,17 +303,65 @@ namespace sdr
AttributeProperties::AttributeProperties(SdrObject& rObj)
: DefaultProperties(rObj),
- mpStyleSheet(0L)
+ mpStyleSheet(0)
{
+ // use correct default stylesheet #119287#
+ SfxStyleSheet* pTargetStyleSheet = 0;
+ const SdrGrafObj* pIsSdrGrafObj = dynamic_cast< const SdrGrafObj* >(&GetSdrObject());
+ const SdrOle2Obj* pIsSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&GetSdrObject());
+
+ if(pIsSdrGrafObj || pIsSdrOle2Obj)
+ {
+ pTargetStyleSheet = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj();
+ }
+ else
+ {
+ pTargetStyleSheet = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet();
+ }
+
+ if(pTargetStyleSheet)
+ {
+ ImpAddStyleSheet(pTargetStyleSheet, true);
+ }
}
AttributeProperties::AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj)
: DefaultProperties(rProps, rObj),
- mpStyleSheet(0L)
+ mpStyleSheet(0)
{
- if(rProps.GetStyleSheet())
+ SfxStyleSheet* pTargetStyleSheet = rProps.GetStyleSheet();
+
+ if(pTargetStyleSheet)
+ {
+ if(&rObj.getSdrModelFromSdrObject() != &GetSdrObject().getSdrModelFromSdrObject())
+ {
+ // It is a clone to another model
+ ImpModelChange(rObj.getSdrModelFromSdrObject(), GetSdrObject().getSdrModelFromSdrObject());
+ }
+ }
+
+ if(!pTargetStyleSheet)
+ {
+ // use correct default stylesheet #119287#
+ // this should not happen, all SDrObjects should have a default StyleSheet, so cloning
+ // one without is an error. Still add one, but assert user
+ OSL_ENSURE(false, "Cloning SdrObject without SfxStyleSheet, all should have a default StyleSheet (!)");
+ const SdrGrafObj* pIsSdrGrafObj = dynamic_cast< const SdrGrafObj* >(&GetSdrObject());
+ const SdrOle2Obj* pIsSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&GetSdrObject());
+
+ if(pIsSdrGrafObj || pIsSdrOle2Obj)
+ {
+ pTargetStyleSheet = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj();
+ }
+ else
+ {
+ pTargetStyleSheet = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet();
+ }
+ }
+
+ if(pTargetStyleSheet)
{
- ImpAddStyleSheet(rProps.GetStyleSheet(), sal_True);
+ ImpAddStyleSheet(pTargetStyleSheet, true);
}
}
@@ -157,13 +375,25 @@ namespace sdr
return *(new AttributeProperties(*this, rObj));
}
+ const SfxItemSet& AttributeProperties::GetObjectItemSet() const
+ {
+ // call parent
+ DefaultProperties::GetObjectItemSet();
+
+ // Late-Init of setting parent to SfxStyleSheet after it's creation, same as in constructor
+ if(GetStyleSheet() && !mpItemSet->GetParent())
+ {
+ const_cast< AttributeProperties* >(this)->ImpSetParentAtSfxItemSet(true);
+ }
+
+ return *mpItemSet;
+ }
+
void AttributeProperties::ItemSetChanged(const SfxItemSet& /*rSet*/)
{
// own modifications
SdrObject& rObj = GetSdrObject();
- rObj.SetBoundRectDirty();
- rObj.SetRectsDirty(sal_True);
rObj.SetChanged();
}
@@ -172,44 +402,43 @@ namespace sdr
if(pNewItem)
{
const SfxPoolItem* pItem = pNewItem;
- SdrModel* pModel = GetSdrObject().GetModel();
switch( nWhich )
{
case XATTR_FILLBITMAP:
{
- pItem = ((XFillBitmapItem*)pItem)->checkForUniqueItem( pModel );
+ pItem = ((XFillBitmapItem*)pItem)->checkForUniqueItem( &GetSdrObject().getSdrModelFromSdrObject() );
break;
}
case XATTR_LINEDASH:
{
- pItem = ((XLineDashItem*)pItem)->checkForUniqueItem( pModel );
+ pItem = ((XLineDashItem*)pItem)->checkForUniqueItem( &GetSdrObject().getSdrModelFromSdrObject() );
break;
}
case XATTR_LINESTART:
{
- pItem = ((XLineStartItem*)pItem)->checkForUniqueItem( pModel );
+ pItem = ((XLineStartItem*)pItem)->checkForUniqueItem( &GetSdrObject().getSdrModelFromSdrObject() );
break;
}
case XATTR_LINEEND:
{
- pItem = ((XLineEndItem*)pItem)->checkForUniqueItem( pModel );
+ pItem = ((XLineEndItem*)pItem)->checkForUniqueItem( &GetSdrObject().getSdrModelFromSdrObject() );
break;
}
case XATTR_FILLGRADIENT:
{
- pItem = ((XFillGradientItem*)pItem)->checkForUniqueItem( pModel );
+ pItem = ((XFillGradientItem*)pItem)->checkForUniqueItem( &GetSdrObject().getSdrModelFromSdrObject() );
break;
}
case XATTR_FILLFLOATTRANSPARENCE:
{
// #85953# allow all kinds of XFillFloatTransparenceItem to be set
- pItem = ((XFillFloatTransparenceItem*)pItem)->checkForUniqueItem( pModel );
+ pItem = ((XFillFloatTransparenceItem*)pItem)->checkForUniqueItem( &GetSdrObject().getSdrModelFromSdrObject() );
break;
}
case XATTR_FILLHATCH:
{
- pItem = ((XFillHatchItem*)pItem)->checkForUniqueItem( pModel );
+ pItem = ((XFillHatchItem*)pItem)->checkForUniqueItem( &GetSdrObject().getSdrModelFromSdrObject() );
break;
}
}
@@ -238,14 +467,13 @@ namespace sdr
}
}
- void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
ImpRemoveStyleSheet();
ImpAddStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
SdrObject& rObj = GetSdrObject();
- rObj.SetBoundRectDirty();
- rObj.SetRectsDirty(sal_True);
+ rObj.ActionChanged();
}
SfxStyleSheet* AttributeProperties::GetStyleSheet() const
@@ -253,242 +481,9 @@ namespace sdr
return mpStyleSheet;
}
- void AttributeProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel)
- {
- OSL_ASSERT(pNewModel!=NULL);
-
- if(pSrcPool && pDestPool && (pSrcPool != pDestPool))
- {
- if(mpItemSet)
- {
- // migrate ItemSet to new pool. Scaling is NOT necessary
- // because this functionality is used by UNDO only. Thus
- // objects and ItemSets would be moved back to their original
- // pool before usage.
- SfxItemSet* pOldSet = mpItemSet;
- SfxStyleSheet* pStySheet = GetStyleSheet();
-
- if(pStySheet)
- {
- ImpRemoveStyleSheet();
- }
-
- mpItemSet = mpItemSet->Clone(sal_False, pDestPool);
- GetSdrObject().GetModel()->MigrateItemSet(pOldSet, mpItemSet, pNewModel);
-
- // set stylesheet (if used)
- if(pStySheet)
- {
- // #i109515#
- SfxItemPool* pStyleSheetPool = &pStySheet->GetPool().GetPool();
-
- if(pStyleSheetPool == pDestPool)
- {
- // just re-set stylesheet
- ImpAddStyleSheet(pStySheet, sal_True);
- }
- else
- {
- // StyleSheet is NOT from the correct pool.
- // Look one up in the right pool with the same
- // name or use the default.
-
- // Look up the style in the new document.
- OSL_ASSERT(pNewModel->GetStyleSheetPool() != NULL);
- SfxStyleSheet* pNewStyleSheet = dynamic_cast<SfxStyleSheet*>(
- pNewModel->GetStyleSheetPool()->Find(
- pStySheet->GetName(),
- SFX_STYLE_FAMILY_ALL));
- if (pNewStyleSheet == NULL
- || &pNewStyleSheet->GetPool().GetPool() != pDestPool)
- {
- // There is no copy of the style in the new
- // document. Use the default as a fallback.
- pNewStyleSheet = pNewModel->GetDefaultStyleSheet();
- }
- ImpAddStyleSheet(pNewStyleSheet, sal_True);
- }
- }
-
- delete pOldSet;
- }
- }
- }
-
- void AttributeProperties::SetModel(SdrModel* pOldModel, SdrModel* pNewModel)
- {
- if(pOldModel != pNewModel && pNewModel && !pNewModel->IsLoading())
- {
- // For a living model move the items from one pool to the other
- if(pOldModel)
- {
- // If metric has changed, scale items.
- MapUnit aOldUnit(pOldModel->GetScaleUnit());
- MapUnit aNewUnit(pNewModel->GetScaleUnit());
- sal_Bool bScaleUnitChanged(aNewUnit != aOldUnit);
- Fraction aMetricFactor;
-
- if(bScaleUnitChanged)
- {
- aMetricFactor = GetMapFactor(aOldUnit, aNewUnit).X();
- Scale(aMetricFactor);
- }
-
- // Move all styles which are used by the object to the new
- // StyleSheet pool
- SfxStyleSheet* pOldStyleSheet = GetStyleSheet();
-
- if(pOldStyleSheet)
- {
- SfxStyleSheetBase* pSheet = pOldStyleSheet;
- SfxStyleSheetBasePool* pOldPool = pOldModel->GetStyleSheetPool();
- SfxStyleSheetBasePool* pNewPool = pNewModel->GetStyleSheetPool();
- DBG_ASSERT(pOldPool, "Properties::SetModel(): Object has StyleSheet but no StyleSheetPool (!)");
-
- if(pOldPool && pNewPool)
- {
- // build a list of to-be-copied Styles
- List aList;
- SfxStyleSheetBase* pAnchor = 0L;
-
- while(pSheet)
- {
- pAnchor = pNewPool->Find(pSheet->GetName(), pSheet->GetFamily());
-
- if(!pAnchor)
- {
- aList.Insert(pSheet, LIST_APPEND);
- pSheet = pOldPool->Find(pSheet->GetParent(), pSheet->GetFamily());
- }
- else
- {
- // the style does exist
- pSheet = 0L;
- }
- }
-
- // copy and set the parents
- pSheet = (SfxStyleSheetBase*)aList.First();
- SfxStyleSheetBase* pNewSheet = 0L;
- SfxStyleSheetBase* pLastSheet = 0L;
- SfxStyleSheetBase* pForThisObject = 0L;
-
- while(pSheet)
- {
- pNewSheet = &pNewPool->Make(pSheet->GetName(), pSheet->GetFamily(), pSheet->GetMask());
- pNewSheet->GetItemSet().Put(pSheet->GetItemSet(), sal_False);
-
- if(bScaleUnitChanged)
- {
- sdr::properties::ScaleItemSet(pNewSheet->GetItemSet(), aMetricFactor);
- }
-
- if(pLastSheet)
- {
- pLastSheet->SetParent(pNewSheet->GetName());
- }
-
- if(!pForThisObject)
- {
- pForThisObject = pNewSheet;
- }
-
- pLastSheet = pNewSheet;
- pSheet = (SfxStyleSheetBase*)aList.Next();
- }
-
- // Set link to the Style found in the Pool
- if(pAnchor && pLastSheet)
- {
- pLastSheet->SetParent(pAnchor->GetName());
- }
-
- // if list was empty (all Styles exist in destination pool)
- // pForThisObject is not yet set
- if(!pForThisObject && pAnchor)
- {
- pForThisObject = pAnchor;
- }
-
- // De-register at old and register at new Style
- if(GetStyleSheet() != pForThisObject)
- {
- ImpRemoveStyleSheet();
- ImpAddStyleSheet((SfxStyleSheet*)pForThisObject, sal_True);
- }
- }
- else
- {
- // there is no StyleSheetPool in the new model, thus set
- // all items as hard items in the object
- List aList;
- const SfxItemSet* pItemSet = &pOldStyleSheet->GetItemSet();
-
- while(pItemSet)
- {
- aList.Insert((void*)pItemSet, CONTAINER_APPEND);
- pItemSet = pItemSet->GetParent();
- }
-
- SfxItemSet* pNewSet = &CreateObjectSpecificItemSet(pNewModel->GetItemPool());
- pItemSet = (SfxItemSet*)aList.Last();
-
- while(pItemSet)
- {
- pNewSet->Put(*pItemSet);
- pItemSet = (SfxItemSet*)aList.Prev();
- }
-
- // Items which were hard attributes before need to stay
- if(mpItemSet)
- {
- SfxWhichIter aIter(*mpItemSet);
- sal_uInt16 nWhich = aIter.FirstWhich();
-
- while(nWhich)
- {
- if(mpItemSet->GetItemState(nWhich, sal_False) == SFX_ITEM_SET)
- {
- pNewSet->Put(mpItemSet->Get(nWhich));
- }
-
- nWhich = aIter.NextWhich();
- }
- }
-
- if(bScaleUnitChanged)
- {
- ScaleItemSet(*pNewSet, aMetricFactor);
- }
-
- if(mpItemSet)
- {
- if(GetStyleSheet())
- {
- ImpRemoveStyleSheet();
- }
-
- delete mpItemSet;
- mpItemSet = 0L;
- }
-
- mpItemSet = pNewSet;
- }
- }
- }
-
- // each object gets the default Style if there is none set yet.
- if(!GetStyleSheet() && pNewModel && !pNewModel->IsLoading())
- {
- GetObjectItemSet(); // #118414# force ItemSet to allow style to be set
- SetStyleSheet(pNewModel->GetDefaultStyleSheet(), sal_True);
- }
- }
- }
-
void AttributeProperties::ForceStyleToHardAttributes()
{
- if(GetStyleSheet() && HAS_BASE(SfxStyleSheet, mpStyleSheet))
+ if(GetStyleSheet() && dynamic_cast< SfxStyleSheet* >(mpStyleSheet))
{
// prepare copied, new itemset, but WITHOUT parent
GetObjectItemSet();
@@ -523,8 +518,7 @@ namespace sdr
mpItemSet = pDestItemSet;
// set necessary changes like in RemoveStyleSheet()
- GetSdrObject().SetBoundRectDirty();
- GetSdrObject().SetRectsDirty(sal_True);
+ GetSdrObject().ActionChanged();
mpStyleSheet = NULL;
}
@@ -532,14 +526,14 @@ namespace sdr
void AttributeProperties::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- sal_Bool bHintUsed(sal_False);
+ bool bHintUsed(sal_False);
- SfxStyleSheetHint *pStyleHint = PTR_CAST(SfxStyleSheetHint, &rHint);
+ const SfxStyleSheetHint *pStyleHint = dynamic_cast< const SfxStyleSheetHint* >( &rHint);
if(pStyleHint && pStyleHint->GetStyleSheet() == GetStyleSheet())
{
SdrObject& rObj = GetSdrObject();
- //SdrPage* pPage = rObj.GetPage();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(rObj, HINT_OBJCHG_ATTR);
switch(pStyleHint->GetHint())
{
@@ -559,23 +553,22 @@ namespace sdr
{
// Style needs to be exchanged
SfxStyleSheet* pNewStSh = 0L;
- SdrModel* pModel = rObj.GetModel();
// #111111#
// Do nothing if object is in destruction, else a StyleSheet may be found from
// a StyleSheetPool which is just being deleted itself. and thus it would be fatal
// to register as listener to that new StyleSheet.
- if(pModel && !rObj.IsInDestruction())
+ if(!rObj.getSdrModelFromSdrObject().IsInDestruction())
{
- if(HAS_BASE(SfxStyleSheet, GetStyleSheet()))
+ if(dynamic_cast< SfxStyleSheet* >(GetStyleSheet()))
{
- pNewStSh = (SfxStyleSheet*)pModel->GetStyleSheetPool()->Find(
+ pNewStSh = (SfxStyleSheet*)rObj.getSdrModelFromSdrObject().GetStyleSheetPool()->Find(
GetStyleSheet()->GetParent(), GetStyleSheet()->GetFamily());
}
if(!pNewStSh)
{
- pNewStSh = pModel->GetDefaultStyleSheet();
+ pNewStSh = rObj.getSdrModelFromSdrObject().GetDefaultStyleSheet();
}
}
@@ -584,7 +577,7 @@ namespace sdr
if(pNewStSh)
{
- ImpAddStyleSheet(pNewStSh, sal_True);
+ ImpAddStyleSheet(pNewStSh, true);
}
break;
@@ -593,20 +586,7 @@ namespace sdr
// Get old BoundRect. Do this after the style change is handled
// in the ItemSet parts because GetBoundRect() may calculate a new
- Rectangle aBoundRect = rObj.GetLastBoundRect();
-
- rObj.SetRectsDirty(sal_True);
-
- // tell the object about the change
rObj.SetChanged();
- rObj.BroadcastObjectChange();
-
- //if(pPage && pPage->IsInserted())
- //{
- // rObj.BroadcastObjectChange();
- //}
-
- rObj.SendUserCall(SDRUSERCALL_CHGATTR, aBoundRect);
bHintUsed = sal_True;
}
diff --git a/svx/source/sdr/properties/captionproperties.cxx b/svx/source/sdr/properties/captionproperties.cxx
index 378c6eb852b5..468d7eff1bbe 100644
--- a/svx/source/sdr/properties/captionproperties.cxx
+++ b/svx/source/sdr/properties/captionproperties.cxx
@@ -86,7 +86,7 @@ namespace sdr
RectangleProperties::ItemSetChanged(rSet);
}
- void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject();
diff --git a/svx/source/sdr/properties/connectorproperties.cxx b/svx/source/sdr/properties/connectorproperties.cxx
index c76a743342e3..4955d8d749be 100644
--- a/svx/source/sdr/properties/connectorproperties.cxx
+++ b/svx/source/sdr/properties/connectorproperties.cxx
@@ -86,7 +86,7 @@ namespace sdr
rObj.ImpSetAttrToEdgeInfo();
}
- void ConnectorProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void ConnectorProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrEdgeObj& rObj = (SdrEdgeObj&)GetSdrObject();
diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx
index 4eb6dc0de4a4..cfc1389cf254 100644
--- a/svx/source/sdr/properties/customshapeproperties.cxx
+++ b/svx/source/sdr/properties/customshapeproperties.cxx
@@ -28,7 +28,6 @@
#include <svl/style.hxx>
#include <svx/svdoashp.hxx>
#include <editeng/eeitem.hxx>
-#include <svx/sdtagitm.hxx>
#include <svl/whiter.hxx>
#include <svl/itemset.hxx>
#include <svl/smplhint.hxx>
@@ -42,12 +41,12 @@ namespace sdr
void CustomShapeProperties::UpdateTextFrameStatus()
{
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
- SdrTextAutoGrowHeightItem& rAutoGrowHeightItem =
- (SdrTextAutoGrowHeightItem&)rObj.GetMergedItem( SDRATTR_TEXT_AUTOGROWHEIGHT );
+ SdrOnOffItem& rAutoGrowHeightItem =
+ (SdrOnOffItem&)rObj.GetMergedItem( SDRATTR_TEXT_AUTOGROWHEIGHT );
rObj.bTextFrame = rAutoGrowHeightItem.GetValue() != 0;
if ( rObj.bTextFrame )
- rObj.NbcAdjustTextFrameWidthAndHeight();
+ rObj.AdjustTextFrameWidthAndHeight();
}
SfxItemSet& CustomShapeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
@@ -74,7 +73,8 @@ namespace sdr
// end
0, 0));
}
- sal_Bool CustomShapeProperties::AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem ) const
+
+ bool CustomShapeProperties::AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem ) const
{
sal_Bool bAllowItemChange = sal_True;
if ( !pNewItem )
@@ -86,6 +86,7 @@ namespace sdr
bAllowItemChange = TextProperties::AllowItemChange( nWhich, pNewItem );
return bAllowItemChange;
}
+
void CustomShapeProperties::ClearObjectItem(const sal_uInt16 nWhich)
{
if ( !nWhich )
@@ -97,12 +98,13 @@ namespace sdr
TextProperties::ClearObjectItemDirect( nWhich2 );
nWhich2 = aIter.NextWhich();
}
- SfxItemSet aSet((SfxItemPool&)(*GetSdrObject().GetObjectItemPool()));
+ SfxItemSet aSet((SfxItemPool&)(GetSdrObject().GetObjectItemPool()));
ItemSetChanged(aSet);
}
else
TextProperties::ClearObjectItem( nWhich );
}
+
void CustomShapeProperties::ClearObjectItemDirect(const sal_uInt16 nWhich)
{
if ( !nWhich )
@@ -118,13 +120,14 @@ namespace sdr
else
TextProperties::ClearObjectItemDirect( nWhich );
}
+
void CustomShapeProperties::ItemSetChanged(const SfxItemSet& rSet)
{
SdrObjCustomShape& rObj = (SdrObjCustomShape&)GetSdrObject();
if( SFX_ITEM_SET == rSet.GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) )
{
- rObj.bTextFrame = ((SdrTextAutoGrowHeightItem&)rSet.Get( SDRATTR_TEXT_AUTOGROWHEIGHT )).GetValue() != 0;
+ rObj.bTextFrame = ((SdrOnOffItem&)rSet.Get( SDRATTR_TEXT_AUTOGROWHEIGHT )).GetValue() != 0;
}
// call parent
@@ -133,6 +136,7 @@ namespace sdr
// local changes, removing cached objects
rObj.InvalidateRenderGeometry();
}
+
void CustomShapeProperties::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem)
{
SdrObjCustomShape& rObj = (SdrObjCustomShape&)GetSdrObject();
@@ -140,18 +144,20 @@ namespace sdr
if( pNewItem && ( SDRATTR_TEXT_AUTOGROWHEIGHT == nWhich ) )
{
- rObj.bTextFrame = ((SdrTextAutoGrowHeightItem*)pNewItem)->GetValue() != 0;
+ rObj.bTextFrame = ((SdrOnOffItem*)pNewItem)->GetValue() != 0;
}
// call parent
TextProperties::ItemChange( nWhich, pNewItem );
rObj.InvalidateRenderGeometry();
}
- void CustomShapeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+
+ void CustomShapeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
TextProperties::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
UpdateTextFrameStatus();
}
+
void CustomShapeProperties::ForceDefaultAttributes()
{
UpdateTextFrameStatus();
@@ -178,6 +184,7 @@ namespace sdr
}
*/
}
+
CustomShapeProperties::CustomShapeProperties(SdrObject& rObj)
: TextProperties(rObj)
{
@@ -196,14 +203,16 @@ namespace sdr
{
return *(new CustomShapeProperties(*this, rObj));
}
+
void CustomShapeProperties::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
TextProperties::Notify( rBC, rHint );
sal_Bool bRemoveRenderGeometry = sal_False;
- const SfxStyleSheetHint *pStyleHint = PTR_CAST( SfxStyleSheetHint, &rHint );
- const SfxSimpleHint *pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxStyleSheetHint *pStyleHint = dynamic_cast< const SfxStyleSheetHint* >( &rHint );
+ const SfxSimpleHint *pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
+
if ( pStyleHint && pStyleHint->GetStyleSheet() == GetStyleSheet() )
{
switch( pStyleHint->GetHint() )
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index 18bb38fdd37a..9e4c1e4d4dea 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -48,23 +48,24 @@ namespace sdr
DefaultProperties::DefaultProperties(SdrObject& rObj)
: BaseProperties(rObj),
- mpItemSet(0L)
+ mpItemSet(0)
{
}
DefaultProperties::DefaultProperties(const DefaultProperties& rProps, SdrObject& rObj)
: BaseProperties(rObj),
- mpItemSet(0L)
+ mpItemSet(0)
{
if(rProps.mpItemSet)
{
- mpItemSet = rProps.mpItemSet->Clone(sal_True);
+ // Clone may be to another model and thus another ItemPool
+ mpItemSet = rProps.mpItemSet->Clone(true, &rObj.getSdrModelFromSdrObject().GetItemPool());
- // do not keep parent info, this may be changed by later construrtors.
+ // do not keep parent info, this may be changed by later constructors.
// This class just copies the ItemSet, ignore parent.
if(mpItemSet && mpItemSet->GetParent())
{
- mpItemSet->SetParent(0L);
+ mpItemSet->SetParent(0);
}
}
}
@@ -79,7 +80,7 @@ namespace sdr
if(mpItemSet)
{
delete mpItemSet;
- mpItemSet = 0L;
+ mpItemSet = 0;
}
}
@@ -87,7 +88,8 @@ namespace sdr
{
if(!mpItemSet)
{
- ((DefaultProperties*)this)->mpItemSet = &(((DefaultProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool()));
+ ((DefaultProperties*)this)->mpItemSet = &(((DefaultProperties*)this)->CreateObjectSpecificItemSet(
+ GetSdrObject().GetObjectItemPool()));
((DefaultProperties*)this)->ForceDefaultAttributes();
}
@@ -105,7 +107,7 @@ namespace sdr
ItemChange(nWhichID, &rItem);
PostItemChange(nWhichID);
- SfxItemSet aSet(*GetSdrObject().GetObjectItemPool(), nWhichID, nWhichID);
+ SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhichID, nWhichID);
aSet.Put(rItem);
ItemSetChanged(aSet);
}
@@ -130,7 +132,7 @@ namespace sdr
if(nWhich)
{
- SfxItemSet aSet(*GetSdrObject().GetObjectItemPool(), nWhich, nWhich, 0, 0);
+ SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhich, nWhich, 0, 0);
ItemSetChanged(aSet);
}
}
@@ -151,7 +153,7 @@ namespace sdr
const SfxPoolItem *pPoolItem;
std::vector< sal_uInt16 > aPostItemChangeList;
sal_Bool bDidChange(sal_False);
- SfxItemSet aSet(*GetSdrObject().GetObjectItemPool(), SDRATTR_START, EE_ITEMS_END, 0, 0);
+ SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), SDRATTR_START, EE_ITEMS_END, 0, 0);
// give a hint to STL_Vector
aPostItemChangeList.reserve(rSet.Count());
@@ -191,7 +193,7 @@ namespace sdr
{
}
- sal_Bool DefaultProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
+ bool DefaultProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
{
return sal_True;
}
@@ -206,7 +208,7 @@ namespace sdr
CleanupFillProperties(*mpItemSet);
}
- void DefaultProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
+ void DefaultProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/)
{
// no StyleSheet in DefaultProperties
}
diff --git a/svx/source/sdr/properties/e3dcompoundproperties.cxx b/svx/source/sdr/properties/e3dcompoundproperties.cxx
index 1bea3b8aed8d..8bb958cb731d 100644
--- a/svx/source/sdr/properties/e3dcompoundproperties.cxx
+++ b/svx/source/sdr/properties/e3dcompoundproperties.cxx
@@ -80,7 +80,7 @@ namespace sdr
return E3dProperties::GetMergedItemSet();
}
- void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+ void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
{
// Set scene specific items at scene
E3dCompoundObject& rObj = (E3dCompoundObject&)GetSdrObject();
diff --git a/svx/source/sdr/properties/e3dproperties.cxx b/svx/source/sdr/properties/e3dproperties.cxx
index 83b005bca4c4..a7b3d0297ea6 100644
--- a/svx/source/sdr/properties/e3dproperties.cxx
+++ b/svx/source/sdr/properties/e3dproperties.cxx
@@ -81,18 +81,22 @@ namespace sdr
rObj.StructureChanged();
}
- void E3dProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void E3dProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
// call parent
AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
// propagate call to contained objects
- const SdrObjList* pSub = ((const E3dObject&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
- for(sal_uInt32 a(0L); a < nCount; a++)
+ if(pSub)
{
- pSub->GetObj(a)->GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
+ const sal_uInt32 nCount(pSub->GetObjCount());
+
+ for(sal_uInt32 a(0L); a < nCount; a++)
+ {
+ pSub->GetObj(a)->GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
+ }
}
}
} // end of namespace properties
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx
index 91ea9d33415c..02dd171d2bd3 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -79,14 +79,14 @@ namespace sdr
}
// collect all ItemSets of contained 3d objects
- const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
- SdrObject* pObj = pSub->GetObj(a);
+ E3dCompoundObject* pObj = dynamic_cast< E3dCompoundObject* >(pSub->GetObj(a));
- if(pObj && pObj->ISA(E3dCompoundObject))
+ if(pObj)
{
const SfxItemSet& rSet = pObj->GetMergedItemSet();
SfxWhichIter aIter(rSet);
@@ -117,11 +117,11 @@ namespace sdr
return E3dProperties::GetMergedItemSet();
}
- void E3dSceneProperties::SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+ void E3dSceneProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
{
// Set SDRATTR_3DOBJ_ range at contained objects.
- const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
if(nCount)
{
@@ -139,9 +139,9 @@ namespace sdr
{
for(sal_uInt32 a(0L); a < nCount; a++)
{
- SdrObject* pObj = pSub->GetObj(a);
+ E3dCompoundObject* pObj = dynamic_cast< E3dCompoundObject* >(pSub->GetObj(a));
- if(pObj && pObj->ISA(E3dCompoundObject))
+ if(pObj)
{
// set merged ItemSet at contained 3d object.
pObj->SetMergedItemSet(*pNewSet, bClearAllItems);
@@ -158,8 +158,8 @@ namespace sdr
void E3dSceneProperties::SetMergedItem(const SfxPoolItem& rItem)
{
- const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -172,8 +172,8 @@ namespace sdr
void E3dSceneProperties::ClearMergedItem(const sal_uInt16 nWhich)
{
- const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -242,10 +242,10 @@ namespace sdr
}
}
- void E3dSceneProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void E3dSceneProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
- const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -257,8 +257,8 @@ namespace sdr
{
SfxStyleSheet* pRetval = 0L;
- const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -281,31 +281,6 @@ namespace sdr
return pRetval;
}
- void E3dSceneProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel)
- {
- if(pSrcPool && pDestPool && (pSrcPool != pDestPool))
- {
- // call parent
- E3dProperties::MoveToItemPool(pSrcPool, pDestPool, pNewModel);
-
- // own reaction, but only with outmost scene
- E3dScene& rObj = (E3dScene&)GetSdrObject();
- const SdrObjList* pSubList = rObj.GetSubList();
-
- if(pSubList && rObj.GetScene() == &rObj)
- {
- SdrObjListIter a3DIterator(*pSubList, IM_DEEPWITHGROUPS);
-
- while(a3DIterator.IsMore())
- {
- E3dObject* pObj = (E3dObject*)a3DIterator.Next();
- DBG_ASSERT(pObj->ISA(E3dObject), "In scenes there are only 3D objects allowed (!)");
- pObj->GetProperties().MoveToItemPool(pSrcPool, pDestPool, pNewModel);
- }
- }
- }
- }
-
void E3dSceneProperties::SetSceneItemsFromCamera()
{
// force ItemSet
@@ -318,10 +293,10 @@ namespace sdr
mpItemSet->Put(Svx3DPerspectiveItem((sal_uInt16)aSceneCam.GetProjection()));
// CamPos
- mpItemSet->Put(Svx3DDistanceItem((sal_uInt32)(aSceneCam.GetPosition().getZ() + 0.5)));
+ mpItemSet->Put(SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, (sal_uInt32)(aSceneCam.GetPosition().getZ() + 0.5)));
// FocalLength
- mpItemSet->Put(Svx3DFocalLengthItem((sal_uInt32)((aSceneCam.GetFocalLength() * 100.0) + 0.5)));
+ mpItemSet->Put(SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, (sal_uInt32)((aSceneCam.GetFocalLength() * 100.0) + 0.5)));
}
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/sdr/properties/emptyproperties.cxx b/svx/source/sdr/properties/emptyproperties.cxx
index 03d7da2f0ed6..ec84c2ed4f01 100644
--- a/svx/source/sdr/properties/emptyproperties.cxx
+++ b/svx/source/sdr/properties/emptyproperties.cxx
@@ -77,7 +77,8 @@ namespace sdr
{
if(!mpEmptyItemSet)
{
- ((EmptyProperties*)this)->mpEmptyItemSet = &(((EmptyProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool()));
+ ((EmptyProperties*)this)->mpEmptyItemSet = &(((EmptyProperties*)this)->CreateObjectSpecificItemSet(
+ GetSdrObject().GetObjectItemPool()));
}
DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
@@ -116,7 +117,7 @@ namespace sdr
DBG_ASSERT(sal_False, "EmptyProperties::ItemSetChanged() should never be called (!)");
}
- sal_Bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
+ bool EmptyProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
{
DBG_ASSERT(sal_False, "EmptyProperties::AllowItemChange() should never be called (!)");
return sal_True;
@@ -132,7 +133,7 @@ namespace sdr
DBG_ASSERT(sal_False, "EmptyProperties::PostItemChange() should never be called (!)");
}
- void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
+ void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/)
{
DBG_ASSERT(sal_False, "EmptyProperties::SetStyleSheet() should never be called (!)");
}
diff --git a/svx/source/sdr/properties/graphicproperties.cxx b/svx/source/sdr/properties/graphicproperties.cxx
index 701cfad9761e..f41d7e1c8ca9 100644
--- a/svx/source/sdr/properties/graphicproperties.cxx
+++ b/svx/source/sdr/properties/graphicproperties.cxx
@@ -80,9 +80,6 @@ namespace sdr
{
SdrGrafObj& rObj = (SdrGrafObj&)GetSdrObject();
- // local changes
- rObj.SetXPolyDirty();
-
// #i29367# Update GraphicAttr, too. This was formerly
// triggered by SdrGrafObj::Notify, which is no longer
// called nowadays. BTW: strictly speaking, the whole
@@ -95,13 +92,10 @@ namespace sdr
RectangleProperties::ItemSetChanged(rSet);
}
- void GraphicProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void GraphicProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrGrafObj& rObj = (SdrGrafObj&)GetSdrObject();
- // local changes
- rObj.SetXPolyDirty();
-
// call parent
RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx
index 1e929dc77117..b97bc5cf7aa3 100644
--- a/svx/source/sdr/properties/groupproperties.cxx
+++ b/svx/source/sdr/properties/groupproperties.cxx
@@ -87,8 +87,8 @@ namespace sdr
}
// collect all ItemSets in mpItemSet
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -116,11 +116,11 @@ namespace sdr
return *mpItemSet;
}
- void GroupProperties::SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+ void GroupProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
{
// iterate over contained SdrObjects
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -160,8 +160,8 @@ namespace sdr
void GroupProperties::SetMergedItem(const SfxPoolItem& rItem)
{
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -171,8 +171,8 @@ namespace sdr
void GroupProperties::ClearMergedItem(const sal_uInt16 nWhich)
{
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -190,7 +190,7 @@ namespace sdr
DBG_ASSERT(sal_False, "GroupProperties::ItemSetChanged() should never be called (!)");
}
- sal_Bool GroupProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
+ bool GroupProperties::AllowItemChange(const sal_uInt16 /*nWhich*/, const SfxPoolItem* /*pNewItem*/) const
{
DBG_ASSERT(sal_False, "GroupProperties::AllowItemChange() should never be called (!)");
return sal_False;
@@ -210,8 +210,8 @@ namespace sdr
{
SfxStyleSheet* pRetval = 0L;
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -234,10 +234,10 @@ namespace sdr
return pRetval;
}
- void GroupProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void GroupProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
@@ -250,37 +250,10 @@ namespace sdr
// nothing to do here, groups have no items and thus no default items, too.
}
- void GroupProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel)
- {
- if(pSrcPool && pDestPool && (pSrcPool != pDestPool))
- {
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
-
- for(sal_uInt32 a(0L); a < nCount; a++)
- {
- pSub->GetObj(a)->GetProperties().MoveToItemPool(pSrcPool, pDestPool, pNewModel);
- }
-
- // also clear local ItemSet, it's only temporary for group objects anyways.
- if(mpItemSet)
- {
- // #121905#
- // copy/paste is still using clone operators and MoveToItemPool functionality.
- // Since SfxItemSet contains a pool pointer, ClearItem is not enough here.
- // The ItemSet for merge is constructed on demand, so it's enough here to
- // just delete it and set to 0L.
- // mpItemSet->ClearItem();
- delete mpItemSet;
- mpItemSet = 0L;
- }
- }
- }
-
void GroupProperties::ForceStyleToHardAttributes()
{
- const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList();
- const sal_uInt32 nCount(pSub->GetObjCount());
+ const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
+ const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
for(sal_uInt32 a(0L); a < nCount; a++)
{
diff --git a/svx/source/sdr/properties/itemsettools.cxx b/svx/source/sdr/properties/itemsettools.cxx
index bb3057fe1e86..a90f5e6f7c75 100644
--- a/svx/source/sdr/properties/itemsettools.cxx
+++ b/svx/source/sdr/properties/itemsettools.cxx
@@ -40,12 +40,12 @@ namespace sdr
{
ItemChangeBroadcaster::ItemChangeBroadcaster(const SdrObject& rObj)
{
- if(rObj.ISA(SdrObjGroup))
+ const SdrObjGroup* pSdrObjGroup = dynamic_cast< const SdrObjGroup* >(&rObj);
+
+ if(pSdrObjGroup)
{
- SdrObjListIter aIter((const SdrObjGroup&)rObj, IM_DEEPNOGROUPS);
- mpData = new RectangleVector;
- DBG_ASSERT(mpData, "ItemChangeBroadcaster: No memory (!)");
- ((RectangleVector*)mpData)->reserve(aIter.Count());
+ SdrObjListIter aIter(*pSdrObjGroup->getChildrenOfSdrObject(), IM_DEEPNOGROUPS);
+ maBroadcastVector.reserve(aIter.Count());
while(aIter.IsMore())
{
@@ -53,45 +53,21 @@ namespace sdr
if(pObj)
{
- ((RectangleVector*)mpData)->push_back(pObj->GetLastBoundRect());
+ maBroadcastVector.push_back(new SdrObjectChangeBroadcaster(*pObj, HINT_OBJCHG_ATTR));
}
}
-
- mnCount = ((RectangleVector*)mpData)->size();
}
else
{
- mpData = new Rectangle(rObj.GetLastBoundRect());
- mnCount = 1L;
+ maBroadcastVector.push_back(new SdrObjectChangeBroadcaster(rObj, HINT_OBJCHG_ATTR));
}
}
ItemChangeBroadcaster::~ItemChangeBroadcaster()
{
- if(mnCount > 1)
- {
- delete ((RectangleVector*)mpData);
- }
- else
- {
- delete ((Rectangle*)mpData);
- }
- }
-
- sal_uInt32 ItemChangeBroadcaster::GetRectangleCount() const
- {
- return mnCount;
- }
-
- const Rectangle& ItemChangeBroadcaster::GetRectangle(sal_uInt32 nIndex) const
- {
- if(mnCount > 1)
- {
- return (*((RectangleVector*)mpData))[nIndex];
- }
- else
+ for(sal_uInt32 a(0); a < maBroadcastVector.size(); a++)
{
- return *((Rectangle*)mpData);
+ delete maBroadcastVector[a];
}
}
} // end of namespace properties
diff --git a/svx/source/sdr/properties/measureproperties.cxx b/svx/source/sdr/properties/measureproperties.cxx
index 75f8c9f13160..1b6be171a14f 100644
--- a/svx/source/sdr/properties/measureproperties.cxx
+++ b/svx/source/sdr/properties/measureproperties.cxx
@@ -29,7 +29,6 @@
#include <svx/svddef.hxx>
#include <editeng/eeitem.hxx>
#include <svx/svdomeas.hxx>
-#include <svx/sxmsuitm.hxx>
#include <svx/xlnstit.hxx>
#include <svx/xlnstwit.hxx>
#include <svx/xlnedit.hxx>
@@ -93,7 +92,7 @@ namespace sdr
rObj.SetTextDirty();
}
- void MeasureProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void MeasureProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrMeasureObj& rObj = (SdrMeasureObj&)GetSdrObject();
@@ -115,7 +114,7 @@ namespace sdr
//#71958# by default, the show units Bool-Item is set as hard
// attribute to sal_True to aviod confusion when copying SdrMeasureObj's
// from one application to another
- mpItemSet->Put(SdrMeasureShowUnitItem(sal_True));
+ mpItemSet->Put(SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, true));
basegfx::B2DPolygon aNewPolygon;
aNewPolygon.append(basegfx::B2DPoint(100.0, 0.0));
diff --git a/svx/source/sdr/properties/oleproperties.cxx b/svx/source/sdr/properties/oleproperties.cxx
index 478fdfb84360..6f340cff9d56 100644
--- a/svx/source/sdr/properties/oleproperties.cxx
+++ b/svx/source/sdr/properties/oleproperties.cxx
@@ -28,6 +28,7 @@
#include <svl/itemset.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xlineit0.hxx>
+#include <svx/svdobj.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/pageproperties.cxx b/svx/source/sdr/properties/pageproperties.cxx
index 89b17e167125..80a6c4cf481e 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -66,7 +66,8 @@ namespace sdr
{
if(!mpEmptyItemSet)
{
- ((PageProperties*)this)->mpEmptyItemSet = &(((PageProperties*)this)->CreateObjectSpecificItemSet(*GetSdrObject().GetObjectItemPool()));
+ ((PageProperties*)this)->mpEmptyItemSet = &(((PageProperties*)this)->CreateObjectSpecificItemSet(
+ GetSdrObject().GetObjectItemPool()));
}
DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx
index a1f8fb85a1b3..8c0a4732db18 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -37,12 +37,14 @@ namespace sdr
namespace properties
{
BaseProperties::BaseProperties(SdrObject& rObj)
- : mrObject(rObj)
+ : boost::noncopyable(),
+ mrObject(rObj)
{
}
BaseProperties::BaseProperties(const BaseProperties& /*rProps*/, SdrObject& rObj)
- : mrObject(rObj)
+ : boost::noncopyable(),
+ mrObject(rObj)
{
}
@@ -56,7 +58,7 @@ namespace sdr
return GetObjectItemSet();
}
- void BaseProperties::SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+ void BaseProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
{
// clear items if requested
if(bClearAllItems)
@@ -86,18 +88,6 @@ namespace sdr
// an ItemSet is implemented.
}
- void BaseProperties::MoveToItemPool(SfxItemPool* /*pSrcPool*/, SfxItemPool* /*pDestPool*/, SdrModel* /*pNewModel*/)
- {
- // Move properties to a new ItemPool. Default implementation does nothing.
- // Overload where an ItemSet is implemented.
- }
-
- void BaseProperties::SetModel(SdrModel* /*pOldModel*/, SdrModel* /*pNewModel*/)
- {
- // Set new model. Default implementation does nothing.
- // Overload where an ItemSet is implemented.
- }
-
void BaseProperties::ForceStyleToHardAttributes()
{
// force all attributes which come from styles to hard attributes
@@ -105,21 +95,7 @@ namespace sdr
// Overload where an ItemSet is implemented.
}
- //void BaseProperties::SetItemAndBroadcast(const SfxPoolItem& rItem)
- //{
- // ItemChangeBroadcaster aC(GetSdrObject());
- // SetObjectItem(rItem);
- // BroadcastItemChange(aC);
- //}
-
- //void BaseProperties::ClearItemAndBroadcast(const sal_uInt16 nWhich)
- //{
- // ItemChangeBroadcaster aC(GetSdrObject());
- // ClearObjectItem(nWhich);
- // BroadcastItemChange(aC);
- //}
-
- void BaseProperties::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+ void BaseProperties::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems)
{
ItemChangeBroadcaster aC(GetSdrObject());
@@ -129,7 +105,6 @@ namespace sdr
}
SetMergedItemSet(rSet);
- BroadcastItemChange(aC);
}
const SfxPoolItem& BaseProperties::GetItem(const sal_uInt16 nWhich) const
@@ -137,44 +112,6 @@ namespace sdr
return GetObjectItemSet().Get(nWhich);
}
- void BaseProperties::BroadcastItemChange(const ItemChangeBroadcaster& rChange)
- {
- const sal_uInt32 nCount(rChange.GetRectangleCount());
-
- // #110094#-14 Reduce to do only second change
- //// invalidate all remembered rectangles
- //for(sal_uInt32 a(0); a < nCount; a++)
- //{
- // GetSdrObject().BroadcastObjectChange(rChange.GetRectangle(a));
- //}
-
- // invalidate all new rectangles
- if(GetSdrObject().ISA(SdrObjGroup))
- {
- SdrObjListIter aIter((SdrObjGroup&)GetSdrObject(), IM_DEEPNOGROUPS);
-
- while(aIter.IsMore())
- {
- SdrObject* pObj = aIter.Next();
- // This is done with ItemSetChanged
- // pObj->SetChanged();
- pObj->BroadcastObjectChange();
- }
- }
- else
- {
- // This is done with ItemSetChanged
- // GetSdrObject().SetChanged();
- GetSdrObject().BroadcastObjectChange();
- }
-
- // also send the user calls
- for(sal_uInt32 a(0L); a < nCount; a++)
- {
- GetSdrObject().SendUserCall(SDRUSERCALL_CHGATTR, rChange.GetRectangle(a));
- }
- }
-
sal_uInt32 BaseProperties::getVersion() const
{
return 0;
diff --git a/svx/source/sdr/properties/rectangleproperties.cxx b/svx/source/sdr/properties/rectangleproperties.cxx
index f022cebe4f1f..2cbadbf9d5e8 100644
--- a/svx/source/sdr/properties/rectangleproperties.cxx
+++ b/svx/source/sdr/properties/rectangleproperties.cxx
@@ -53,25 +53,15 @@ namespace sdr
void RectangleProperties::ItemSetChanged(const SfxItemSet& rSet)
{
- SdrRectObj& rObj = (SdrRectObj&)GetSdrObject();
-
// call parent
TextProperties::ItemSetChanged(rSet);
-
- // local changes
- rObj.SetXPolyDirty();
}
// set a new StyleSheet and broadcast
- void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
- SdrRectObj& rObj = (SdrRectObj&)GetSdrObject();
-
// call parent
TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
-
- // local changes
- rObj.SetXPolyDirty();
}
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index 6dfdc8c8ad66..7edc6a2c0edd 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -136,7 +136,7 @@ namespace sdr
OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
pOutliner->Clear();
- rObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
+ rObj.SetOutlinerParaObjectForText(pTemp,pText);
}
}
}
@@ -146,7 +146,6 @@ namespace sdr
{
// Here only repaint wanted
rObj.ActionChanged();
- //rObj.BroadcastObjectChange();
}
// call parent
@@ -194,7 +193,7 @@ namespace sdr
OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
rOutliner.Clear();
- rObj.NbcSetOutlinerParaObjectForText( pTemp, pText );
+ rObj.SetOutlinerParaObjectForText( pTemp, pText );
}
}
}
@@ -215,21 +214,21 @@ namespace sdr
if(bLineVisible)
{
- const sal_Int32 nLeftDist(((const SdrTextLeftDistItem&)GetItem(SDRATTR_TEXT_LEFTDIST)).GetValue());
- const sal_Int32 nRightDist(((const SdrTextRightDistItem&)GetItem(SDRATTR_TEXT_RIGHTDIST)).GetValue());
- const sal_Int32 nUpperDist(((const SdrTextUpperDistItem&)GetItem(SDRATTR_TEXT_UPPERDIST)).GetValue());
- const sal_Int32 nLowerDist(((const SdrTextLowerDistItem&)GetItem(SDRATTR_TEXT_LOWERDIST)).GetValue());
-
- SetObjectItemDirect(SdrTextLeftDistItem(nLeftDist + nDifference));
- SetObjectItemDirect(SdrTextRightDistItem(nRightDist + nDifference));
- SetObjectItemDirect(SdrTextUpperDistItem(nUpperDist + nDifference));
- SetObjectItemDirect(SdrTextLowerDistItem(nLowerDist + nDifference));
+ const sal_Int32 nLeftDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_LEFTDIST)).GetValue());
+ const sal_Int32 nRightDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_RIGHTDIST)).GetValue());
+ const sal_Int32 nUpperDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_UPPERDIST)).GetValue());
+ const sal_Int32 nLowerDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_LOWERDIST)).GetValue());
+
+ SetObjectItemDirect(SdrMetricItem(SDRATTR_TEXT_LEFTDIST, nLeftDist + nDifference));
+ SetObjectItemDirect(SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, nRightDist + nDifference));
+ SetObjectItemDirect(SdrMetricItem(SDRATTR_TEXT_UPPERDIST, nUpperDist + nDifference));
+ SetObjectItemDirect(SdrMetricItem(SDRATTR_TEXT_LOWERDIST, nLowerDist + nDifference));
}
}
}
}
- void TextProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void TextProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
@@ -239,7 +238,7 @@ namespace sdr
// #i101556# StyleSheet has changed -> new version
maVersion++;
- if( rObj.GetModel() /*&& !rObj.IsTextEditActive()*/ && !rObj.IsLinkedText() )
+ if( !rObj.IsLinkedText() )
{
SdrOutliner& rOutliner = rObj.ImpGetDrawOutliner();
@@ -279,8 +278,7 @@ namespace sdr
sal_Int16 nDepth = rOutliner.GetDepth((sal_uInt16)nPara);
aNewStyleSheetName += String::CreateFromInt32( nDepth <= 0 ? 1 : nDepth + 1);
- SdrModel* pModel = rObj.GetModel();
- SfxStyleSheetBasePool* pStylePool = (pModel != NULL) ? pModel->GetStyleSheetPool() : 0L;
+ SfxStyleSheetBasePool* pStylePool = rObj.getSdrModelFromSdrObject().GetStyleSheetPool();
SfxStyleSheet* pNewStyle = (SfxStyleSheet*)pStylePool->Find(aNewStyleSheetName, GetStyleSheet()->GetFamily());
DBG_ASSERT( pNewStyle, "AutoStyleSheetName - Style not found!" );
@@ -342,14 +340,14 @@ namespace sdr
OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
rOutliner.Clear();
- rObj.NbcSetOutlinerParaObjectForText(pTemp, pText);
+ rObj.SetOutlinerParaObjectForText(pTemp, pText);
}
}
}
if(rObj.IsTextFrame())
{
- rObj.NbcAdjustTextFrameWidthAndHeight();
+ rObj.AdjustTextFrameWidthAndHeight();
}
}
@@ -397,11 +395,9 @@ namespace sdr
// now the standard TextProperties stuff
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
- if(rObj.GetModel()
- && !rObj.IsTextEditActive()
- && !rObj.IsLinkedText())
+ if(!rObj.IsTextEditActive() && !rObj.IsLinkedText())
{
- Outliner* pOutliner = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, rObj.GetModel());
+ Outliner* pOutliner = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, &rObj.getSdrModelFromSdrObject());
sal_Int32 nText = rObj.getTextCount();
while( --nText >= 0 )
@@ -469,9 +465,9 @@ namespace sdr
if(pFieldItem)
{
- const SvxFieldData* pData = pFieldItem->GetField();
+ const SvxURLField* pData = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
- if(pData && pData->ISA(SvxURLField))
+ if(pData)
{
bHasURL = sal_True;
break;
@@ -530,7 +526,7 @@ namespace sdr
if(bBurnIn)
{
OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
- rObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
+ rObj.SetOutlinerParaObjectForText(pTemp,pText);
}
}
@@ -555,9 +551,9 @@ namespace sdr
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
if(rObj.HasText())
{
- if(HAS_BASE(SfxStyleSheet, &rBC))
+ if(dynamic_cast< SfxStyleSheet* >(&rBC))
{
- SfxSimpleHint* pSimple = PTR_CAST(SfxSimpleHint, &rHint);
+ const SfxSimpleHint* pSimple = dynamic_cast< const SfxSimpleHint* >( &rHint);
sal_uInt32 nId(pSimple ? pSimple->GetId() : 0L);
if(SFX_HINT_DATACHANGED == nId)
@@ -573,11 +569,10 @@ namespace sdr
}
rObj.SetTextSizeDirty();
- if(rObj.IsTextFrame() && rObj.NbcAdjustTextFrameWidthAndHeight())
+ if(rObj.IsTextFrame() && rObj.AdjustTextFrameWidthAndHeight())
{
// here only repaint wanted
rObj.ActionChanged();
- //rObj.BroadcastObjectChange();
}
// #i101556# content of StyleSheet has changed -> new version
@@ -596,9 +591,9 @@ namespace sdr
}
}
}
- else if(HAS_BASE(SfxStyleSheetBasePool, &rBC))
+ else if(dynamic_cast< SfxStyleSheetBasePool* >(&rBC))
{
- SfxStyleSheetHintExtended* pExtendedHint = PTR_CAST(SfxStyleSheetHintExtended, &rHint);
+ const SfxStyleSheetHintExtended* pExtendedHint = dynamic_cast< const SfxStyleSheetHintExtended* >( &rHint);
if(pExtendedHint
&& SFX_STYLESHEET_MODIFIED == pExtendedHint->GetHint())
diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx
index c99e13118fdf..f608e2d41eb3 100644
--- a/svx/source/stbctrls/insctrl.cxx
+++ b/svx/source/stbctrls/insctrl.cxx
@@ -70,7 +70,7 @@ void SvxInsertStatusBarControl::StateChanged( sal_uInt16 , SfxItemState eState,
GetStatusBar().SetItemText( GetId(), String() );
else
{
- DBG_ASSERT( pState->ISA( SfxBoolItem ), "invalid item type" );
+ DBG_ASSERT( dynamic_cast< const SfxBoolItem* >(pState), "invalid item type" );
SfxBoolItem* pItem = (SfxBoolItem*)pState;
bInsert = pItem->GetValue();
DrawItemText_Impl();
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index f60fc24ef02a..61badc55e367 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -61,7 +61,7 @@ void SvxModifyControl::StateChanged( sal_uInt16, SfxItemState eState,
GetStatusBar().SetItemText( GetId(), String() );
else
{
- DBG_ASSERT( pState->ISA( SfxBoolItem ), "invalid item type" );
+ DBG_ASSERT( dynamic_cast< const SfxBoolItem* >(pState), "invalid item type" );
SfxBoolItem* pItem = (SfxBoolItem*)pState;
bState = pItem->GetValue();
DrawItemText_Impl();
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index 494fcd3e1d6d..6892e37e48ab 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -246,9 +246,11 @@ void SvxPosSizeStatusBarControl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
{
if ( eState == SFX_ITEM_AVAILABLE )
{
- pImp->bHasMenu = sal_True;
- if ( pState && pState->ISA(SfxUInt16Item) )
+ pImp->bHasMenu = true;
+ if ( pState && dynamic_cast< const SfxUInt16Item* >(pState) )
+ {
pImp->nFunction = ((const SfxUInt16Item*)pState)->GetValue();
+ }
}
else
pImp->bHasMenu = sal_False;
@@ -269,21 +271,21 @@ void SvxPosSizeStatusBarControl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
DBG_ERRORFILE("unknown slot id");
}
}
- else if ( pState->ISA( SfxPointItem ) )
+ else if ( dynamic_cast< const SfxPointItem* >(pState) )
{
// Position anzeigen
pImp->aPos = ( (SfxPointItem*)pState )->GetValue();
pImp->bPos = sal_True;
pImp->bTable = sal_False;
}
- else if ( pState->ISA( SvxSizeItem ) )
+ else if ( dynamic_cast< const SvxSizeItem* >(pState) )
{
// Groesse anzeigen
pImp->aSize = ( (SvxSizeItem*)pState )->GetSize();
pImp->bSize = sal_True;
pImp->bTable = sal_False;
}
- else if ( pState->ISA( SfxStringItem ) )
+ else if ( dynamic_cast< const SfxStringItem* >(pState) )
{
// String anzeigen (Tabellen-Zelle oder anderes)
pImp->aStr = ( (SfxStringItem*)pState )->GetValue();
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index 53abf0b4c49a..2ef44589a922 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -63,7 +63,7 @@ void SvxSelectionModeControl::StateChanged( sal_uInt16, SfxItemState eState,
GetStatusBar().SetItemText( GetId(), String() );
else
{
- DBG_ASSERT( pState->ISA( SfxUInt16Item ), "invalid item type" );
+ DBG_ASSERT( dynamic_cast< const SfxUInt16Item* >(pState), "invalid item type" );
SfxUInt16Item* pItem = (SfxUInt16Item*)pState;
nState = pItem->GetValue();
DrawItemText_Impl();
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx
index 445d929fad3d..eb3a2817a6a2 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -33,20 +33,14 @@
#include <vcl/menu.hxx>
#endif
#include <vcl/image.hxx>
-//#ifndef _SFXITEMPOOL_HXX
-//#include <svl/itempool.hxx>
-//#endif
#include <sfx2/signaturestate.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxsids.hrc>
-
#include <svl/intitem.hxx>
-
#include <svl/eitem.hxx>
-
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
#include "svx/xmlsecctrl.hxx"
@@ -54,22 +48,6 @@
#define PAINT_OFFSET 5
-//#include <editeng/sizeitem.hxx>
-//#include <svx/dialmgr.hxx>
-//#include "svx/dlgutil.hxx"
-//#include "stbctrls.h"
-
-//#include <svx/dialogs.hrc>
-
-/*#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
-#include <unotools/localedatawrapper.hxx>
-#endif
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif*/
-
-
-
SFX_IMPL_STATUSBAR_CONTROL( XmlSecStatusBarControl, SfxUInt16Item );
struct XmlSecStatusBarControl::XmlSecStatusBarControl_Impl
@@ -109,7 +87,7 @@ void XmlSecStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState, cons
{
mpImpl->mnState = (sal_uInt16)SIGNATURESTATE_UNKNOWN;
}
- else if( pState->ISA( SfxUInt16Item ) )
+ else if( dynamic_cast< const SfxUInt16Item* >(pState) )
{
// mpImpl->mbSigned = ( ( SfxUInt16Item* ) pState )->GetValue() == 1 /* SIGNED*/ ;
mpImpl->mnState = ( ( SfxUInt16Item* ) pState )->GetValue();
diff --git a/svx/source/stbctrls/zoomctrl.cxx b/svx/source/stbctrls/zoomctrl.cxx
index 214fa76ae1a1..bc1a21f225e1 100644
--- a/svx/source/stbctrls/zoomctrl.cxx
+++ b/svx/source/stbctrls/zoomctrl.cxx
@@ -127,7 +127,7 @@ void SvxZoomStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState,
GetStatusBar().SetItemText( GetId(), String() );
nValueSet = 0;
}
- else if ( pState->ISA( SfxUInt16Item) )
+ else if ( dynamic_cast< const SfxUInt16Item* >(pState) )
{
const SfxUInt16Item* pItem = (const SfxUInt16Item*)pState;
nZoom = pItem->GetValue();
@@ -135,7 +135,7 @@ void SvxZoomStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState,
aStr += '%';
GetStatusBar().SetItemText( GetId(), aStr );
- if ( pState->ISA(SvxZoomItem) )
+ if ( dynamic_cast< const SvxZoomItem* >(pState) )
{
nValueSet = ((const SvxZoomItem*)pState)->GetValueSet();
/*!!!
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index 59ee0a116151..f5d0c9480a23 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -198,14 +198,14 @@ SvxZoomSliderControl::~SvxZoomSliderControl()
void SvxZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
- if ( (SFX_ITEM_AVAILABLE != eState) || pState->ISA( SfxVoidItem ) )
+ if ( (SFX_ITEM_AVAILABLE != eState) || dynamic_cast< const SfxVoidItem* >(pState) )
{
GetStatusBar().SetItemText( GetId(), String() );
mpImpl->mbValuesSet = false;
}
else
{
- OSL_ENSURE( pState->ISA( SvxZoomSliderItem ), "invalid item type: should be a SvxZoomSliderItem" );
+ OSL_ENSURE( dynamic_cast< const SvxZoomSliderItem* >(pState), "invalid item type: should be a SvxZoomSliderItem" );
mpImpl->mnCurrentZoom = static_cast<const SvxZoomSliderItem*>( pState )->GetValue();
mpImpl->mnMinZoom = static_cast<const SvxZoomSliderItem*>( pState )->GetMinZoom();
mpImpl->mnMaxZoom = static_cast<const SvxZoomSliderItem*>( pState )->GetMaxZoom();
diff --git a/svx/source/svdraw/charthelper.cxx b/svx/source/svdraw/charthelper.cxx
index a5942b73158b..550960659ecf 100644
--- a/svx/source/svdraw/charthelper.cxx
+++ b/svx/source/svdraw/charthelper.cxx
@@ -33,9 +33,14 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
#include <drawinglayer/geometry/viewinformation2d.hxx>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
+
+//// header for function rtl_createUuid
+//#include <rtl/uuid.h>
+//#include <vcl/pdfextoutdevdata.hxx>
+//
+//#include <com/sun/star/lang/XUnoTunnel.hpp>
+//#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+//#include <svtools/embedhlp.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -134,36 +139,5 @@ drawinglayer::primitive2d::Primitive2DSequence ChartHelper::tryToGetChartContent
return aRetval;
}
-void ChartHelper::AdaptDefaultsForChart(
- const uno::Reference < embed::XEmbeddedObject > & xEmbObj,
- bool /* bNoFillStyle */,
- bool /* bNoLineStyle */)
-{
- if( xEmbObj.is())
- {
- uno::Reference< chart2::XChartDocument > xChartDoc( xEmbObj->getComponent(), uno::UNO_QUERY );
- OSL_ENSURE( xChartDoc.is(), "Trying to set chart property to non-chart OLE" );
- if( !xChartDoc.is())
- return;
-
- try
- {
- // set background to transparent (none)
- uno::Reference< beans::XPropertySet > xPageProp( xChartDoc->getPageBackground());
- if( xPageProp.is())
- xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FillStyle")),
- uno::makeAny( drawing::FillStyle_NONE ));
- // set no border
- if( xPageProp.is())
- xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LineStyle")),
- uno::makeAny( drawing::LineStyle_NONE ));
- }
- catch( const uno::Exception & )
- {
- OSL_ENSURE( false, "Exception caught in AdaptDefaultsForChart" );
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/clonelist.cxx b/svx/source/svdraw/clonelist.cxx
index 18e298df414a..02b65316e56c 100644
--- a/svx/source/svdraw/clonelist.cxx
+++ b/svx/source/svdraw/clonelist.cxx
@@ -24,14 +24,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-// #i13033#
-// New mechanism to hold a ist of all original and cloned objects for later
-// re-creating the connections for contained connectors
#include <clonelist.hxx>
#include <svx/svdoedge.hxx>
#include <svx/scene3d.hxx>
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
CloneList::CloneList()
+: maOriginalList(),
+ maCloneList()
{
}
@@ -41,26 +42,19 @@ CloneList::~CloneList()
void CloneList::AddPair(const SdrObject* pOriginal, SdrObject* pClone)
{
- maOriginalList.Insert((SdrObject*)pOriginal, LIST_APPEND);
- maCloneList.Insert(pClone, LIST_APPEND);
+ maOriginalList.push_back(const_cast< SdrObject* >(pOriginal));
+ maCloneList.push_back(pClone);
// look for subobjects, too.
- sal_Bool bOriginalIsGroup(pOriginal->IsGroupObject());
- sal_Bool bCloneIsGroup(pClone->IsGroupObject());
-
- if(bOriginalIsGroup && pOriginal->ISA(E3dObject) && !pOriginal->ISA(E3dScene))
- bOriginalIsGroup = sal_False;
-
- if(bCloneIsGroup && pClone->ISA(E3dObject) && !pClone->ISA(E3dScene))
- bCloneIsGroup = sal_False;
+ const bool bOriginalIsGroup(pOriginal->getChildrenOfSdrObject());
+ const bool bCloneIsGroup(pClone->getChildrenOfSdrObject());
if(bOriginalIsGroup && bCloneIsGroup)
{
- const SdrObjList* pOriginalList = pOriginal->GetSubList();
- SdrObjList* pCloneList = pClone->GetSubList();
+ const SdrObjList* pOriginalList = pOriginal->getChildrenOfSdrObject();
+ SdrObjList* pCloneList = pClone->getChildrenOfSdrObject();
- if(pOriginalList && pCloneList
- && pOriginalList->GetObjCount() == pCloneList->GetObjCount())
+ if(pOriginalList && pCloneList && pOriginalList->GetObjCount() == pCloneList->GetObjCount())
{
for(sal_uInt32 a(0); a < pOriginalList->GetObjCount(); a++)
{
@@ -71,55 +65,48 @@ void CloneList::AddPair(const SdrObject* pOriginal, SdrObject* pClone)
}
}
-sal_uInt32 CloneList::Count() const
-{
- return maOriginalList.Count();
-}
-
-const SdrObject* CloneList::GetOriginal(sal_uInt32 nIndex) const
-{
- return (SdrObject*)maOriginalList.GetObject(nIndex);
-}
-
-SdrObject* CloneList::GetClone(sal_uInt32 nIndex) const
-{
- return (SdrObject*)maCloneList.GetObject(nIndex);
-}
-
void CloneList::CopyConnections() const
{
- for(sal_uInt32 a(0); a < maOriginalList.Count(); a++)
+ SdrObjectVector::const_iterator aOuterOriginal(maOriginalList.begin());
+ SdrObjectVector::const_iterator aOuterClone(maCloneList.begin());
+
+ for(; aOuterOriginal != maOriginalList.begin(); aOuterOriginal++, aOuterClone++)
{
- const SdrEdgeObj* pOriginalEdge = PTR_CAST(SdrEdgeObj, GetOriginal(a));
- SdrEdgeObj* pCloneEdge = PTR_CAST(SdrEdgeObj, GetClone(a));
+ const SdrEdgeObj* pOriginalEdge = dynamic_cast< const SdrEdgeObj* >(*aOuterOriginal);
+ SdrEdgeObj* pCloneEdge = dynamic_cast< SdrEdgeObj* >(*aOuterClone);
if(pOriginalEdge && pCloneEdge)
{
- SdrObject* pOriginalNode1 = pOriginalEdge->GetConnectedNode(sal_True);
- SdrObject* pOriginalNode2 = pOriginalEdge->GetConnectedNode(sal_False);
+ SdrObject* pOriginalNode1 = pOriginalEdge->GetConnectedNode(true);
if(pOriginalNode1)
{
- sal_uLong nPos(maOriginalList.GetPos(pOriginalNode1));
+ SdrObjectVector::const_iterator aOriginal(maOriginalList.begin());
+ SdrObjectVector::const_iterator aClone(maCloneList.begin());
- if(LIST_ENTRY_NOTFOUND != nPos)
+ for(;aOriginal != maOriginalList.end(); aOriginal++, aClone++)
{
- if(pOriginalEdge->GetConnectedNode(sal_True) != GetClone(nPos))
+ if(*aOriginal == pOriginalNode1)
{
- pCloneEdge->ConnectToNode(sal_True, GetClone(nPos));
+ pCloneEdge->ConnectToNode(true, *aClone);
+ break;
}
}
}
+ SdrObject* pOriginalNode2 = pOriginalEdge->GetConnectedNode(false);
+
if(pOriginalNode2)
{
- sal_uLong nPos(maOriginalList.GetPos(pOriginalNode2));
+ SdrObjectVector::const_iterator aOriginal(maOriginalList.begin());
+ SdrObjectVector::const_iterator aClone(maCloneList.begin());
- if(LIST_ENTRY_NOTFOUND != nPos)
+ for(;aOriginal != maOriginalList.end(); aOriginal++, aClone++)
{
- if(pOriginalEdge->GetConnectedNode(sal_False) != GetClone(nPos))
+ if(*aOriginal == pOriginalNode2)
{
- pCloneEdge->ConnectToNode(sal_False, GetClone(nPos));
+ pCloneEdge->ConnectToNode(false, *aClone);
+ break;
}
}
}
@@ -127,4 +114,5 @@ void CloneList::CopyConnections() const
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/globaldrawitempool.cxx b/svx/source/svdraw/globaldrawitempool.cxx
new file mode 100644
index 000000000000..c998e366d14a
--- /dev/null
+++ b/svx/source/svdraw/globaldrawitempool.cxx
@@ -0,0 +1,62 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include <svx/globaldrawitempool.hxx>
+#include <editeng/editeng.hxx>
+#include <svx/svdetc.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+static SdrItemPool* mpGlobalItemPool = 0;
+
+SdrItemPool& GetGlobalDrawObjectItemPool()
+{
+ if(!mpGlobalItemPool)
+ {
+ mpGlobalItemPool = new SdrItemPool();
+ SfxItemPool* pGlobalOutlPool = EditEngine::CreatePool();
+ mpGlobalItemPool->SetSecondaryPool(pGlobalOutlPool);
+ mpGlobalItemPool->SetDefaultMetric((SfxMapUnit)SdrEngineDefaults::GetMapUnit());
+ mpGlobalItemPool->FreezeIdRanges();
+ }
+
+ return *mpGlobalItemPool;
+}
+
+void FreeGlobalDrawObjectItemPool()
+{
+ if(mpGlobalItemPool)
+ {
+ SfxItemPool* pGlobalOutlPool = mpGlobalItemPool->GetSecondaryPool();
+ SfxItemPool::Free(mpGlobalItemPool);
+ SfxItemPool::Free(pGlobalOutlPool);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/gluepoint.cxx b/svx/source/svdraw/gluepoint.cxx
new file mode 100644
index 000000000000..60bd01d9171f
--- /dev/null
+++ b/svx/source/svdraw/gluepoint.cxx
@@ -0,0 +1,175 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+#include <svx/gluepoint.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace gluepoint
+ {
+ GluePointProvider::GluePointProvider()
+ {
+ }
+
+ GluePointProvider::~GluePointProvider()
+ {
+ }
+
+ GluePointProvider::GluePointProvider(const GluePointProvider& /*rCandidate*/)
+ {
+ }
+
+ GluePointProvider& GluePointProvider::operator=(const GluePointProvider& /*rCandidate*/)
+ {
+ return *this;
+ }
+
+ GluePointProvider& GluePointProvider::Clone() const
+ {
+ return *(new GluePointProvider(*this));
+ }
+
+ sal_uInt32 GluePointProvider::getAutoGluePointCount() const
+ {
+ return 4;
+ }
+
+ GluePoint GluePointProvider::getAutoGluePointByIndex(sal_uInt32 nIndex) const
+ {
+ switch(nIndex)
+ {
+ case 0:
+ {
+ return GluePoint(
+ basegfx::B2DPoint(0.5, 0.0),
+ nIndex,
+ GLUEPOINTTYPE_AUTO);
+ }
+ case 1:
+ {
+ return GluePoint(
+ basegfx::B2DPoint(1.0, 0.5),
+ nIndex,
+ GLUEPOINTTYPE_AUTO);
+ }
+ case 2:
+ {
+ return GluePoint(
+ basegfx::B2DPoint(0.5, 1.0),
+ nIndex,
+ GLUEPOINTTYPE_AUTO);
+ }
+ default:
+ {
+ return GluePoint(
+ basegfx::B2DPoint(0.0, 0.5),
+ nIndex,
+ GLUEPOINTTYPE_AUTO);
+ }
+ }
+ }
+
+ sal_uInt32 GluePointProvider::getEdgeGluePointCount() const
+ {
+ return 0;
+ }
+
+ GluePoint GluePointProvider::getEdgeGluePointByIndex(sal_uInt32 /*nIndex*/) const
+ {
+ OSL_ENSURE(false, "access out of range (!)");
+ return GluePoint();
+ }
+
+ sal_uInt32 GluePointProvider::getUserGluePointCount() const
+ {
+ return 0;
+ }
+
+ GluePoint GluePointProvider::getUserGluePointByIndex(sal_uInt32 /*nIndex*/) const
+ {
+ OSL_ENSURE(false, "access out of range (!)");
+ return GluePoint();
+ }
+
+ sal_uInt32 GluePointProvider::getGluePointCount() const
+ {
+ return getAutoGluePointCount() + getEdgeGluePointCount() + getUserGluePointCount();
+ }
+
+ GluePoint GluePointProvider::getGluePointByIndex(sal_uInt32 nIndex) const
+ {
+ if(nIndex < getAutoGluePointCount())
+ {
+ return getAutoGluePointByIndex(nIndex);
+ }
+
+ nIndex -= getAutoGluePointCount();
+
+ if(nIndex < getEdgeGluePointCount())
+ {
+ return getEdgeGluePointByIndex(nIndex);
+ }
+
+ nIndex -= getEdgeGluePointCount();
+
+ if(nIndex < getUserGluePointCount())
+ {
+ return getUserGluePointByIndex(nIndex);
+ }
+
+ OSL_ENSURE(false, "access out of range (!)");
+ return GluePoint();
+ }
+
+ bool GluePointProvider::areUserGluePointsAllowed() const
+ {
+ return false;
+ }
+
+ GluePoint GluePointProvider::addUserGluePoint(
+ const basegfx::B2DPoint& /*rPosition*/,
+ GluePointType /*eType*/,
+ com::sun::star::drawing::Alignment /*eAlignment*/,
+ com::sun::star::drawing::EscapeDirection /*eEscapeDirection*/)
+ {
+ OSL_ENSURE(false, "No UserGluePoints allowed at this object (!)");
+ return GluePoint();
+ }
+
+ void GluePointProvider::removeUserGluePoint(const GluePoint& /*rCandidate*/)
+ {
+ OSL_ENSURE(false, "No UserGluePoints allowed at this object (!)");
+ }
+
+ bool GluePointProvider::existsUserGluePoint(const GluePoint& /*rCandidate*/) const
+ {
+ return false;
+ }
+
+ } // end of namespace gluepoint
+} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/gradtrns.cxx b/svx/source/svdraw/gradtrns.cxx
index b464c8e5be8c..3c4aa4b416a6 100644
--- a/svx/source/svdraw/gradtrns.cxx
+++ b/svx/source/svdraw/gradtrns.cxx
@@ -30,13 +30,18 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <vcl/salbtype.hxx> // FRound
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
-void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, const SdrObject* pObj)
+void GradTransformer::GradToVec(
+ GradTransGradient& rG,
+ GradTransVector& rV,
+ const SdrObject* pObj)
{
// handle start color
rV.aCol1 = rG.aGradient.GetStartColor();
+
if(100 != rG.aGradient.GetStartIntens())
{
const double fFact((double)rG.aGradient.GetStartIntens() / 100.0);
@@ -45,6 +50,7 @@ void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, cons
// handle end color
rV.aCol2 = rG.aGradient.GetEndColor();
+
if(100 != rG.aGradient.GetEndIntens())
{
const double fFact((double)rG.aGradient.GetEndIntens() / 100.0);
@@ -52,8 +58,7 @@ void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, cons
}
// calc the basic positions
- const Rectangle aObjectSnapRectangle(pObj->GetSnapRect());
- const basegfx::B2DRange aRange(aObjectSnapRectangle.Left(), aObjectSnapRectangle.Top(), aObjectSnapRectangle.Right(), aObjectSnapRectangle.Bottom());
+ const basegfx::B2DRange aRange(sdr::legacy::GetSnapRange(*pObj));
const basegfx::B2DPoint aCenter(aRange.getCenter());
basegfx::B2DPoint aStartPos, aEndPos;
@@ -184,8 +189,13 @@ void GradTransformer::GradToVec(GradTransGradient& rG, GradTransVector& rV, cons
//////////////////////////////////////////////////////////////////////////////
-void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, GradTransGradient& rGOld, const SdrObject* pObj,
- sal_Bool bMoveSingle, sal_Bool bMoveFirst)
+void GradTransformer::VecToGrad(
+ GradTransVector& rV,
+ GradTransGradient& rG,
+ GradTransGradient& rGOld,
+ const SdrObject* pObj,
+ bool bMoveSingle,
+ bool bMoveFirst)
{
// fill old gradient to new gradient to have a base
rG = rGOld;
@@ -196,6 +206,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad
rG.aGradient.SetStartColor(rV.aCol1);
rG.aGradient.SetStartIntens(100);
}
+
if(rV.aCol2 != rGOld.aGradient.GetEndColor())
{
rG.aGradient.SetEndColor(rV.aCol2);
@@ -203,8 +214,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad
}
// calc the basic positions
- const Rectangle aObjectSnapRectangle(pObj->GetSnapRect());
- const basegfx::B2DRange aRange(aObjectSnapRectangle.Left(), aObjectSnapRectangle.Top(), aObjectSnapRectangle.Right(), aObjectSnapRectangle.Bottom());
+ const basegfx::B2DRange aRange(sdr::legacy::GetSnapRange(*pObj));
const basegfx::B2DPoint aCenter(aRange.getCenter());
basegfx::B2DPoint aStartPos(rV.maPositionA);
basegfx::B2DPoint aEndPos(rV.maPositionB);
diff --git a/svx/source/svdraw/gradtrns.hxx b/svx/source/svdraw/gradtrns.hxx
index bae5b08ff843..fc177fc871aa 100644
--- a/svx/source/svdraw/gradtrns.hxx
+++ b/svx/source/svdraw/gradtrns.hxx
@@ -50,10 +50,18 @@ class GradTransformer
public:
GradTransformer() {}
- void GradToVec(GradTransGradient& rG, GradTransVector& rV,
+ void GradToVec(
+ GradTransGradient& rG,
+ GradTransVector& rV,
const SdrObject* pObj);
- void VecToGrad(GradTransVector& rV, GradTransGradient& rG,
- GradTransGradient& rGOld, const SdrObject* pObj, sal_Bool bMoveSingle, sal_Bool bMoveFirst);
+
+ void VecToGrad(
+ GradTransVector& rV,
+ GradTransGradient& rG,
+ GradTransGradient& rGOld,
+ const SdrObject* pObj,
+ bool bMoveSingle,
+ bool bMoveFirst);
};
#endif // _GRADTRANS_HXX
diff --git a/svx/source/svdraw/polypolygoneditor.cxx b/svx/source/svdraw/polypolygoneditor.cxx
index 53b7758e5028..cdeb865108af 100644
--- a/svx/source/svdraw/polypolygoneditor.cxx
+++ b/svx/source/svdraw/polypolygoneditor.cxx
@@ -26,161 +26,160 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-
#include "svx/polypolygoneditor.hxx"
-namespace sdr {
-
-PolyPolygonEditor::PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed )
-: maPolyPolygon( rPolyPolygon )
-, mbIsClosed( bClosed )
-{
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
-bool PolyPolygonEditor::DeletePoints( const std::set< sal_uInt16 >& rAbsPoints )
+namespace sdr
{
- bool bPolyPolyChanged = false;
-
- std::set< sal_uInt16 >::const_reverse_iterator aIter;( rAbsPoints.rbegin() );
- for( aIter = rAbsPoints.rbegin(); aIter != rAbsPoints.rend(); aIter++ )
+ namespace PolyPolygonEditor
{
- sal_uInt32 nPoly, nPnt;
- if( GetRelativePolyPoint(maPolyPolygon,(*aIter), nPoly, nPnt) )
+ bool DeletePoints(basegfx::B2DPolyPolygon& o_rCandidate, const sdr::selection::Indices& rAbsPoints)
{
- // remove point
- basegfx::B2DPolygon aCandidate(maPolyPolygon.getB2DPolygon(nPoly));
+ bool bPolyPolyChanged(false);
- aCandidate.remove(nPnt);
-
- if( ( mbIsClosed && aCandidate.count() < 3L) || (aCandidate.count() < 2L) )
- {
- maPolyPolygon.remove(nPoly);
- }
- else
+ for(sdr::selection::Indices::const_reverse_iterator aIter(rAbsPoints.rbegin()); aIter != rAbsPoints.rend(); aIter++)
{
- maPolyPolygon.setB2DPolygon(nPoly, aCandidate);
- }
+ sal_uInt32 nPoly, nPnt;
- bPolyPolyChanged = true;
- }
- }
+ if(GetRelativePolyPoint(o_rCandidate, (*aIter), nPoly, nPnt))
+ {
+ // remove point
+ basegfx::B2DPolygon aCandidate(o_rCandidate.getB2DPolygon(nPoly));
- return bPolyPolyChanged;
-}
+ aCandidate.remove(nPnt);
-bool PolyPolygonEditor::SetSegmentsKind(SdrPathSegmentKind eKind, const std::set< sal_uInt16 >& rAbsPoints )
-{
- bool bPolyPolyChanged = false;
+ if((aCandidate.isClosed() && aCandidate.count() < 3) || (aCandidate.count() < 2))
+ {
+ o_rCandidate.remove(nPoly);
+ }
+ else
+ {
+ o_rCandidate.setB2DPolygon(nPoly, aCandidate);
+ }
- std::set< sal_uInt16 >::const_reverse_iterator aIter;( rAbsPoints.rbegin() );
- for( aIter = rAbsPoints.rbegin(); aIter != rAbsPoints.rend(); aIter++ )
- {
- sal_uInt32 nPolyNum, nPntNum;
+ bPolyPolyChanged = true;
+ }
+ }
+
+ return bPolyPolyChanged;
+ }
- if(PolyPolygonEditor::GetRelativePolyPoint(maPolyPolygon, (*aIter), nPolyNum, nPntNum))
+ bool SetSegmentsKind(basegfx::B2DPolyPolygon& o_rCandidate, SdrPathSegmentKind eKind, const sdr::selection::Indices& rAbsPoints)
{
- // do change at aNewPolyPolygon. Take a look at edge.
- basegfx::B2DPolygon aCandidate(maPolyPolygon.getB2DPolygon(nPolyNum));
- bool bCandidateChanged(false);
- const sal_uInt32 nCount(aCandidate.count());
+ bool bPolyPolyChanged(false);
- if(nCount && (nPntNum + 1 < nCount || aCandidate.isClosed()))
+ for(sdr::selection::Indices::const_reverse_iterator aIter(rAbsPoints.rbegin()); aIter != rAbsPoints.rend(); aIter++)
{
- // it's a valid edge, check control point usage
- const sal_uInt32 nNextIndex((nPntNum + 1) % nCount);
- const bool bContolUsed(aCandidate.areControlPointsUsed()
- && (aCandidate.isNextControlPointUsed(nPntNum) || aCandidate.isPrevControlPointUsed(nNextIndex)));
+ sal_uInt32 nPolyNum, nPntNum;
- if(bContolUsed)
+ if(GetRelativePolyPoint(o_rCandidate, (*aIter), nPolyNum, nPntNum))
{
- if(SDRPATHSEGMENT_TOGGLE == eKind || SDRPATHSEGMENT_LINE == eKind)
- {
- // remove control
- aCandidate.resetNextControlPoint(nPntNum);
- aCandidate.resetPrevControlPoint(nNextIndex);
- bCandidateChanged = true;
- }
- }
- else
- {
- if(SDRPATHSEGMENT_TOGGLE == eKind || SDRPATHSEGMENT_CURVE == eKind)
- {
- // add control
- const basegfx::B2DPoint aStart(aCandidate.getB2DPoint(nPntNum));
- const basegfx::B2DPoint aEnd(aCandidate.getB2DPoint(nNextIndex));
+ // do change at aNewPolyPolygon. Take a look at edge.
+ basegfx::B2DPolygon aCandidate(o_rCandidate.getB2DPolygon(nPolyNum));
+ bool bCandidateChanged(false);
+ const sal_uInt32 nCount(aCandidate.count());
- aCandidate.setNextControlPoint(nPntNum, interpolate(aStart, aEnd, (1.0 / 3.0)));
- aCandidate.setPrevControlPoint(nNextIndex, interpolate(aStart, aEnd, (2.0 / 3.0)));
- bCandidateChanged = true;
+ if(nCount && (nPntNum + 1 < nCount || aCandidate.isClosed()))
+ {
+ // it's a valid edge, check control point usage
+ const sal_uInt32 nNextIndex((nPntNum + 1) % nCount);
+ const bool bContolUsed(aCandidate.areControlPointsUsed()
+ && (aCandidate.isNextControlPointUsed(nPntNum) || aCandidate.isPrevControlPointUsed(nNextIndex)));
+
+ if(bContolUsed)
+ {
+ if(SDRPATHSEGMENT_TOGGLE == eKind || SDRPATHSEGMENT_LINE == eKind)
+ {
+ // remove control
+ aCandidate.resetNextControlPoint(nPntNum);
+ aCandidate.resetPrevControlPoint(nNextIndex);
+ bCandidateChanged = true;
+ }
+ }
+ else
+ {
+ if(SDRPATHSEGMENT_TOGGLE == eKind || SDRPATHSEGMENT_CURVE == eKind)
+ {
+ // add control
+ const basegfx::B2DPoint aStart(aCandidate.getB2DPoint(nPntNum));
+ const basegfx::B2DPoint aEnd(aCandidate.getB2DPoint(nNextIndex));
+
+ aCandidate.setNextControlPoint(nPntNum, interpolate(aStart, aEnd, (1.0 / 3.0)));
+ aCandidate.setPrevControlPoint(nNextIndex, interpolate(aStart, aEnd, (2.0 / 3.0)));
+ bCandidateChanged = true;
+ }
+ }
+
+ if(bCandidateChanged)
+ {
+ o_rCandidate.setB2DPolygon(nPolyNum, aCandidate);
+ bPolyPolyChanged = true;
+ }
}
}
-
- if(bCandidateChanged)
- {
- maPolyPolygon.setB2DPolygon(nPolyNum, aCandidate);
- bPolyPolyChanged = true;
- }
}
- }
- }
- return bPolyPolyChanged;
-}
+ return bPolyPolyChanged;
+ }
-bool PolyPolygonEditor::SetPointsSmooth( basegfx::B2VectorContinuity eFlags, const std::set< sal_uInt16 >& rAbsPoints)
-{
- bool bPolyPolygonChanged(false);
+ bool SetPointsSmooth(basegfx::B2DPolyPolygon& o_rCandidate, basegfx::B2VectorContinuity eFlags, const sdr::selection::Indices& rAbsPoints)
+ {
+ bool bPolyPolygonChanged(false);
+ sdr::selection::Indices::const_reverse_iterator aIter;
- std::set< sal_uInt16 >::const_reverse_iterator aIter;( rAbsPoints.rbegin() );
- for( aIter = rAbsPoints.rbegin(); aIter != rAbsPoints.rend(); aIter++ )
- {
- sal_uInt32 nPolyNum, nPntNum;
+ for( aIter = rAbsPoints.rbegin(); aIter != rAbsPoints.rend(); aIter++ )
+ {
+ sal_uInt32 nPolyNum, nPntNum;
- if(PolyPolygonEditor::GetRelativePolyPoint(maPolyPolygon, (*aIter), nPolyNum, nPntNum))
- {
- // do change at aNewPolyPolygon...
- basegfx::B2DPolygon aCandidate(maPolyPolygon.getB2DPolygon(nPolyNum));
+ if(GetRelativePolyPoint(o_rCandidate, (*aIter), nPolyNum, nPntNum))
+ {
+ // do change at aNewPolyPolygon...
+ basegfx::B2DPolygon aCandidate(o_rCandidate.getB2DPolygon(nPolyNum));
- // set continuity in point, make sure there is a curve
- bool bPolygonChanged(false);
- bPolygonChanged = basegfx::tools::expandToCurveInPoint(aCandidate, nPntNum);
- bPolygonChanged |= basegfx::tools::setContinuityInPoint(aCandidate, nPntNum, eFlags);
+ // set continuity in point, make sure there is a curve
+ bool bPolygonChanged(false);
+ bPolygonChanged = basegfx::tools::expandToCurveInPoint(aCandidate, nPntNum);
+ bPolygonChanged |= basegfx::tools::setContinuityInPoint(aCandidate, nPntNum, eFlags);
- if(bPolygonChanged)
- {
- maPolyPolygon.setB2DPolygon(nPolyNum, aCandidate);
- bPolyPolygonChanged = true;
+ if(bPolygonChanged)
+ {
+ o_rCandidate.setB2DPolygon(nPolyNum, aCandidate);
+ bPolyPolygonChanged = true;
+ }
+ }
}
+
+ return bPolyPolygonChanged;
}
- }
- return bPolyPolygonChanged;
-}
+ bool GetRelativePolyPoint(const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum)
+ {
+ const sal_uInt32 nPolyCount(rPoly.count());
+ sal_uInt32 nPolyNum(0);
-bool PolyPolygonEditor::GetRelativePolyPoint( const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum )
-{
- const sal_uInt32 nPolyCount(rPoly.count());
- sal_uInt32 nPolyNum(0L);
+ while(nPolyNum < nPolyCount)
+ {
+ const sal_uInt32 nPointCount(rPoly.getB2DPolygon(nPolyNum).count());
- while(nPolyNum < nPolyCount)
- {
- const sal_uInt32 nPointCount(rPoly.getB2DPolygon(nPolyNum).count());
+ if(nAbsPnt < nPointCount)
+ {
+ rPolyNum = nPolyNum;
+ rPointNum = nAbsPnt;
- if(nAbsPnt < nPointCount)
- {
- rPolyNum = nPolyNum;
- rPointNum = nAbsPnt;
+ return true;
+ }
+ else
+ {
+ nPolyNum++;
+ nAbsPnt -= nPointCount;
+ }
+ }
- return true;
- }
- else
- {
- nPolyNum++;
- nAbsPnt -= nPointCount;
+ return false;
}
- }
-
- return false;
-}
-
+ } // end of namespace PolyPolygonEditor
} // end of namespace sdr
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx
index 5b61e48e4efe..5c22a33ce466 100644
--- a/svx/source/svdraw/sdrhittesthelper.cxx
+++ b/svx/source/svdraw/sdrhittesthelper.cxx
@@ -34,29 +34,33 @@
#include <drawinglayer/processor2d/hittestprocessor2d.hxx>
#include <svx/svdpagv.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/svdview.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
// #i101872# new Object HitTest as View-tooling
SdrObject* SdrObjectPrimitiveHit(
const SdrObject& rObject,
- const Point& rPnt,
- sal_uInt16 nTol,
- const SdrPageView& rSdrPageView,
- const SetOfByte* pVisiLayer,
- bool bTextOnly)
+ const basegfx::B2DPoint& rPnt,
+ double fTol,
+ const SdrView& rSdrView,
+ bool bTextOnly,
+ drawinglayer::primitive2d::Primitive2DSequence* pRecordFields)
{
SdrObject* pResult = 0;
- if(rObject.GetSubList() && rObject.GetSubList()->GetObjCount())
+ if(rObject.getChildrenOfSdrObject() && rObject.getChildrenOfSdrObject()->GetObjCount())
{
// group or scene with content. Single 3D objects also have a
// true == rObject.GetSubList(), but no content
- pResult = SdrObjListPrimitiveHit(*rObject.GetSubList(), rPnt, nTol, rSdrPageView, pVisiLayer, bTextOnly);
+ pResult = SdrObjListPrimitiveHit(*rObject.getChildrenOfSdrObject(), rPnt, fTol, rSdrView, bTextOnly, pRecordFields);
}
else
{
- if( rObject.IsVisible() && (!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer())))
+ const SdrPageView* pSdrPageView = rSdrView.GetSdrPageView();
+ const SetOfByte* pVisiLayer = pSdrPageView ? &pSdrPageView->GetVisibleLayers() : 0;
+
+ if( pSdrPageView && rObject.IsVisible() && (!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer())))
{
// single object, 3d object, empty scene or empty group. Check if
// it's a single 3D object
@@ -64,9 +68,7 @@ SdrObject* SdrObjectPrimitiveHit(
if(pE3dCompoundObject)
{
- const basegfx::B2DPoint aHitPosition(rPnt.X(), rPnt.Y());
-
- if(checkHitSingle3DObject(aHitPosition, *pE3dCompoundObject))
+ if(checkHitSingle3DObject(rPnt, *pE3dCompoundObject))
{
pResult = const_cast< E3dCompoundObject* >(pE3dCompoundObject);
}
@@ -75,14 +77,13 @@ SdrObject* SdrObjectPrimitiveHit(
{
// not a single 3D object; Check in first PageWindow using prmitives (only SC
// with split views uses multiple PageWindows nowadays)
- if(rSdrPageView.PageWindowCount())
+ if(rSdrView.GetSdrPageView() && rSdrView.GetSdrPageView()->PageWindowCount())
{
- const double fLogicTolerance(nTol);
- const basegfx::B2DPoint aHitPosition(rPnt.X(), rPnt.Y());
const sdr::contact::ViewObjectContact& rVOC = rObject.GetViewContact().GetViewObjectContact(
- rSdrPageView.GetPageWindow(0)->GetObjectContact());
+ rSdrView.GetSdrPageView()->GetPageWindow(0)->GetObjectContact());
- if(ViewObjectContactPrimitiveHit(rVOC, aHitPosition, fLogicTolerance, bTextOnly))
+ if(ViewObjectContactPrimitiveHit(
+ rVOC, rPnt, fTol, bTextOnly, pRecordFields))
{
pResult = const_cast< SdrObject* >(&rObject);
}
@@ -98,11 +99,11 @@ SdrObject* SdrObjectPrimitiveHit(
SdrObject* SdrObjListPrimitiveHit(
const SdrObjList& rList,
- const Point& rPnt,
- sal_uInt16 nTol,
- const SdrPageView& rSdrPageView,
- const SetOfByte* pVisiLayer,
- bool bTextOnly)
+ const basegfx::B2DPoint& rPnt,
+ double fTol,
+ const SdrView& rSdrView,
+ bool bTextOnly,
+ drawinglayer::primitive2d::Primitive2DSequence* pRecordFields)
{
sal_uInt32 nObjNum(rList.GetObjCount());
SdrObject* pRetval = 0;
@@ -111,8 +112,7 @@ SdrObject* SdrObjListPrimitiveHit(
{
nObjNum--;
SdrObject* pObj = rList.GetObj(nObjNum);
-
- pRetval = SdrObjectPrimitiveHit(*pObj, rPnt, nTol, rSdrPageView, pVisiLayer, bTextOnly);
+ pRetval = SdrObjectPrimitiveHit(*pObj, rPnt, fTol, rSdrView, bTextOnly, pRecordFields);
}
return pRetval;
@@ -124,9 +124,10 @@ bool ViewObjectContactPrimitiveHit(
const sdr::contact::ViewObjectContact& rVOC,
const basegfx::B2DPoint& rHitPosition,
double fLogicHitTolerance,
- bool bTextOnly)
+ bool bTextOnly,
+ drawinglayer::primitive2d::Primitive2DSequence* pRecordFields)
{
- basegfx::B2DRange aObjectRange(rVOC.getObjectRange());
+ basegfx::B2DRange aObjectRange(rVOC.getViewDependentRange());
if(!aObjectRange.isEmpty())
{
@@ -151,7 +152,8 @@ bool ViewObjectContactPrimitiveHit(
rViewInformation2D,
rHitPosition,
fLogicHitTolerance,
- bTextOnly);
+ bTextOnly,
+ pRecordFields);
// feed it with the primitives
aHitTestProcessor2D.process(rSequence);
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
index 4cf7a148eb29..201d90ebeb52 100644
--- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx
+++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
@@ -23,12 +23,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
#include <svx/sdrmasterpagedescriptor.hxx>
#include <svx/sdr/contact/viewcontactofmasterpagedescriptor.hxx>
#include <svx/svdpage.hxx>
-
-// #i42075#
#include <svx/svdobj.hxx>
+#include <svx/svdmodel.hxx>
#include <svx/xfillit0.hxx>
#include <svl/itemset.hxx>
@@ -43,7 +43,8 @@ namespace sdr
}
MasterPageDescriptor::MasterPageDescriptor(SdrPage& aOwnerPage, SdrPage& aUsedPage)
- : maOwnerPage(aOwnerPage),
+ : SfxListener(),
+ maOwnerPage(aOwnerPage),
maUsedPage(aUsedPage),
mpViewContact(0L)
{
@@ -51,13 +52,13 @@ namespace sdr
maVisibleLayers.SetAll();
// register at used page
- maUsedPage.AddPageUser(*this);
+ maUsedPage.AddListener(*this);
}
MasterPageDescriptor::~MasterPageDescriptor()
{
// de-register at used page
- maUsedPage.RemovePageUser(*this);
+ maUsedPage.RemoveListener(*this);
if(mpViewContact)
{
@@ -81,9 +82,17 @@ namespace sdr
// this method is called form the destructor of the referenced page.
// do all necessary action to forget the page. It is not necessary to call
// RemovePageUser(), that is done form the destructor.
- void MasterPageDescriptor::PageInDestruction(const SdrPage& /*rPage*/)
+ void MasterPageDescriptor::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- maOwnerPage.TRG_ClearMasterPage();
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrHint && HINT_SDRPAGEDYING == pSdrHint->GetSdrHintKind() && pSdrHint->GetSdrHintPage())
+ {
+ if(&maUsedPage == pSdrHint->GetSdrHintPage())
+ {
+ maOwnerPage.TRG_ClearMasterPage();
+ }
+ }
}
void MasterPageDescriptor::SetVisibleLayers(const SetOfByte& rNew)
@@ -96,14 +105,14 @@ namespace sdr
}
// operators
- sal_Bool MasterPageDescriptor::operator==(const MasterPageDescriptor& rCandidate) const
+ bool MasterPageDescriptor::operator==(const MasterPageDescriptor& rCandidate) const
{
return (&maOwnerPage == &rCandidate.maOwnerPage
&& &maUsedPage == &rCandidate.maUsedPage
&& maVisibleLayers == rCandidate.maVisibleLayers);
}
- sal_Bool MasterPageDescriptor::operator!=(const MasterPageDescriptor& rCandidate) const
+ bool MasterPageDescriptor::operator!=(const MasterPageDescriptor& rCandidate) const
{
return (&maOwnerPage != &rCandidate.maOwnerPage
|| &maUsedPage != &rCandidate.maUsedPage
diff --git a/svx/source/svdraw/sdrobjectfactory.cxx b/svx/source/svdraw/sdrobjectfactory.cxx
new file mode 100755
index 000000000000..e1f88fa007d7
--- /dev/null
+++ b/svx/source/svdraw/sdrobjectfactory.cxx
@@ -0,0 +1,244 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdrobjectfactory.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/svdoedge.hxx>
+#include <svx/svdomeas.hxx>
+#include <svx/svdograf.hxx>
+#include <svx/svdoole2.hxx>
+#include <svx/svdocapt.hxx>
+#include <svx/svdopage.hxx>
+#include <svx/svdouno.hxx>
+#include <svx/svdoashp.hxx>
+#include <svx/svdomedia.hxx>
+#include <svx/svdotable.hxx>
+#include <svx/svdetc.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrObjFactory::SdrObjFactory(SdrModel& rTargetModel, const SdrObjectCreationInfo& rSdrObjectCreationInfo)
+: mrTargetModel(rTargetModel),
+ maSdrObjectCreationInfo(rSdrObjectCreationInfo),
+ mpNewObj(0),
+ mpObj(0),
+ mpNewData(0)
+{
+}
+
+SdrObjFactory::SdrObjFactory(const SdrObjectCreationInfo& rSdrObjectCreationInfo, SdrObject& rObj1)
+: mrTargetModel(rObj1.getSdrModelFromSdrObject()),
+ maSdrObjectCreationInfo(rSdrObjectCreationInfo),
+ mpNewObj(0),
+ mpObj(&rObj1),
+ mpNewData(0)
+{
+}
+
+SdrObject* SdrObjFactory::MakeNewObject(SdrModel& rTargetModel, const SdrObjectCreationInfo& rSdrObjectCreationInfo)
+{
+ SdrObject* pObj = 0;
+
+ if(SdrInventor == rSdrObjectCreationInfo.getInvent())
+ {
+ switch(rSdrObjectCreationInfo.getIdent())
+ {
+ case sal_uInt16(OBJ_NONE):
+ {
+ pObj = new SdrObject(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_GRUP):
+ {
+ pObj = new SdrObjGroup(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_POLY):
+ {
+ pObj = new SdrPathObj(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_EDGE):
+ {
+ pObj = new SdrEdgeObj(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_RECT):
+ {
+ pObj = new SdrRectObj(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_CIRC):
+ {
+ pObj = new SdrCircObj(rTargetModel, rSdrObjectCreationInfo.getSdrCircleObjType());
+ break;
+ }
+ case sal_uInt16(OBJ_TEXT):
+ {
+ pObj = new SdrRectObj(rTargetModel, basegfx::B2DHomMatrix(), OBJ_TEXT, true);
+ break;
+ }
+ case sal_uInt16(OBJ_TITLETEXT):
+ {
+ pObj = new SdrRectObj(rTargetModel, basegfx::B2DHomMatrix(), OBJ_TITLETEXT, true);
+ break;
+ }
+ case sal_uInt16(OBJ_OUTLINETEXT):
+ {
+ pObj = new SdrRectObj(rTargetModel, basegfx::B2DHomMatrix(), OBJ_OUTLINETEXT, true);
+ break;
+ }
+ case sal_uInt16(OBJ_MEASURE):
+ {
+ pObj = new SdrMeasureObj(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_GRAF):
+ {
+ pObj = new SdrGrafObj(rTargetModel, Graphic());
+ break;
+ }
+ case sal_uInt16(OBJ_OLE2):
+ {
+ pObj = new SdrOle2Obj(rTargetModel, svt::EmbeddedObjectRef(), String(), basegfx::B2DHomMatrix(), true);
+ break;
+ }
+ case sal_uInt16(OBJ_FRAME):
+ {
+ pObj = new SdrOle2Obj(rTargetModel, svt::EmbeddedObjectRef(), String(), basegfx::B2DHomMatrix(), true);
+ break;
+ }
+ case sal_uInt16(OBJ_CAPTION):
+ {
+ pObj = new SdrCaptionObj(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_PAGE):
+ {
+ pObj = new SdrPageObj(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_UNO):
+ {
+ pObj = new SdrUnoObj(rTargetModel, String());
+ break;
+ }
+ case sal_uInt16(OBJ_CUSTOMSHAPE):
+ {
+ pObj = new SdrObjCustomShape(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_MEDIA):
+ {
+ pObj = new SdrMediaObj(rTargetModel);
+ break;
+ }
+ case sal_uInt16(OBJ_TABLE):
+ {
+ pObj = new ::sdr::table::SdrTableObj(rTargetModel);
+ break;
+ }
+ }
+ }
+
+ if(!pObj)
+ {
+ SdrObjFactory* pFact = new SdrObjFactory(rTargetModel, rSdrObjectCreationInfo);
+ SdrLinkList& rLL = ImpGetUserMakeObjHdl();
+ unsigned nAnz(rLL.GetLinkCount());
+ unsigned i(0);
+
+ while(i < nAnz && !pObj)
+ {
+ rLL.GetLink(i).Call((void*)pFact);
+ pObj = pFact->mpNewObj;
+ i++;
+ }
+
+ delete pFact;
+ }
+
+ return pObj;
+}
+
+SdrObjUserData* SdrObjFactory::MakeNewObjUserData(const SdrObjectCreationInfo& rSdrObjectCreationInfo, SdrObject& rObj1)
+{
+ SdrObjUserData* pData = 0;
+
+ if(rSdrObjectCreationInfo.getInvent() == SdrInventor)
+ {
+ switch(rSdrObjectCreationInfo.getIdent())
+ {
+ case sal_uInt16(SDRUSERDATA_OBJTEXTLINK) :
+ {
+ pData = new ImpSdrObjTextLinkUserData(dynamic_cast< SdrTextObj* >(&rObj1));
+ break;
+ }
+ }
+ }
+
+ if(!pData)
+ {
+ SdrObjFactory aFact(rSdrObjectCreationInfo, rObj1);
+ SdrLinkList& rLL = ImpGetUserMakeObjUserDataHdl();
+ unsigned nAnz(rLL.GetLinkCount());
+ unsigned i(0);
+
+ while(i < nAnz && !pData)
+ {
+ rLL.GetLink(i).Call((void*)&aFact);
+ pData = aFact.mpNewData;
+ i++;
+ }
+ }
+
+ return pData;
+}
+
+void SdrObjFactory::InsertMakeObjectHdl(const Link& rLink)
+{
+ SdrLinkList& rLL = ImpGetUserMakeObjHdl();
+ rLL.InsertLink(rLink);
+}
+
+void SdrObjFactory::RemoveMakeObjectHdl(const Link& rLink)
+{
+ SdrLinkList& rLL = ImpGetUserMakeObjHdl();
+ rLL.RemoveLink(rLink);
+}
+
+void SdrObjFactory::InsertMakeUserDataHdl(const Link& rLink)
+{
+ SdrLinkList& rLL = ImpGetUserMakeObjUserDataHdl();
+ rLL.InsertLink(rLink);
+}
+
+void SdrObjFactory::RemoveMakeUserDataHdl(const Link& rLink)
+{
+ SdrLinkList& rLL = ImpGetUserMakeObjUserDataHdl();
+ rLL.RemoveLink(rLink);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 02047387d8c3..8ffcbad77ac4 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -42,6 +42,20 @@
#include <svx/fmview.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+//////////////////////////////////////////////////////////////////////////////
+// clip test
+
+#ifdef CLIPPER_TEST
+#include <svx/svdopath.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <vcl/salbtype.hxx> // FRound
+#include <basegfx/polygon/b2dpolygoncutandtouch.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#include <algorithm>
+#endif // CLIPPER_TEST
+
////////////////////////////////////////////////////////////////////////////////////////////////////
using namespace ::rtl;
@@ -207,18 +221,8 @@ void SdrPageWindow::PrepareRedraw(const Region& rReg)
//////////////////////////////////////////////////////////////////////////////
// clip test
-#ifdef CLIPPER_TEST
-#include <svx/svdopath.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <vcl/salbtype.hxx> // FRound
-#include <basegfx/polygon/b2dpolygoncutandtouch.hxx>
-#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/polygon/b2dpolygonclipper.hxx>
-
-// for ::std::sort
-#include <algorithm>
+#ifdef CLIPPER_TEST
namespace
{
void impPaintStrokePolygon(const basegfx::B2DPolygon& rCandidate, OutputDevice& rOutDev, Color aColor)
@@ -249,25 +253,25 @@ namespace
void impTryTest(const SdrPageView& rPageView, OutputDevice& rOutDev)
{
- if(rPageView.GetPage() && rPageView.GetPage()->GetObjCount() >= 2L)
+ if(rPageView.GetPage() && rPageView.GetPage()->GetObjCount() >= 2)
{
SdrPage* pPage = rPageView.GetPage();
- SdrObject* pObjA = pPage->GetObj(0L);
+ SdrPathObj* pObjA = dynamic_cast< SdrPathObj* >(pPage->GetObj(0));
- if(pObjA && pObjA->ISA(SdrPathObj))
+ if(pObjA)
{
- basegfx::B2DPolyPolygon aPolyA(((SdrPathObj*)pObjA)->GetPathPoly());
+ basegfx::B2DPolyPolygon aPolyA(pObjA->getB2DPolyPolygonInObjectCoordinates());
aPolyA = basegfx::tools::correctOrientations(aPolyA);
basegfx::B2DPolyPolygon aPolyB;
for(sal_uInt32 a(1L); a < rPageView.GetPage()->GetObjCount(); a++)
{
- SdrObject* pObjB = pPage->GetObj(a);
+ SdrPathObj* pObjB = dynamic_cast< SdrPathObj* >(pPage->GetObj(a));
- if(pObjB && pObjB->ISA(SdrPathObj))
+ if(pObjB)
{
- basegfx::B2DPolyPolygon aCandidate(((SdrPathObj*)pObjB)->GetPathPoly());
+ basegfx::B2DPolyPolygon aCandidate(pObjB->getB2DPolyPolygonInObjectCoordinates());
aCandidate = basegfx::tools::correctOrientations(aCandidate);
aPolyB.append(aCandidate);
}
@@ -302,7 +306,6 @@ void SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedire
// set PaintingPageView
const SdrView& rView = mrPageView.GetView();
- SdrModel& rModel = *((SdrModel*)rView.GetModel());
// get to be processed layers
const sal_Bool bPrinter(GetPaintWindow().OutputToPrinter());
@@ -316,7 +319,7 @@ void SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedire
// Draw all layers. do NOT draw form layer from CompleteRedraw, this is done separate
// as a single layer paint
- const SdrLayerAdmin& rLayerAdmin = rModel.GetLayerAdmin();
+ const SdrLayerAdmin& rLayerAdmin = rView.getSdrModelFromSdrView().GetModelLayerAdmin();
const SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID(rLayerAdmin.GetControlLayerName(), sal_False);
aProcessLayers.Clear(nControlLayerId);
@@ -354,7 +357,6 @@ void SdrPageWindow::RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectC
// set PaintingPageView
const SdrView& rView = mrPageView.GetView();
- SdrModel& rModel = *((SdrModel*)rView.GetModel());
// get the layers to process
const sal_Bool bPrinter(GetPaintWindow().OutputToPrinter());
@@ -364,7 +366,7 @@ void SdrPageWindow::RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectC
if(aProcessLayers.IsSet(*pId))
{
// find out if we are painting the ControlLayer
- const SdrLayerAdmin& rLayerAdmin = rModel.GetLayerAdmin();
+ const SdrLayerAdmin& rLayerAdmin = rView.getSdrModelFromSdrView().GetModelLayerAdmin();
const SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID(rLayerAdmin.GetControlLayerName(), sal_False);
const sal_Bool bControlLayerProcessingActive(pId && nControlLayerId == *pId);
@@ -405,8 +407,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
{
const SvtOptionsDrawinglayer aDrawinglayerOpt;
Window& rWindow(static_cast< Window& >(GetPaintWindow().GetOutputDevice()));
- basegfx::B2DRange aDiscreteRange(rRange);
- aDiscreteRange.transform(rWindow.GetViewTransformation());
+ basegfx::B2DRange aDiscreteRange(rWindow.GetViewTransformation() * rRange);
if(aDrawinglayerOpt.IsAntiAliasing())
{
@@ -452,9 +453,9 @@ void SdrPageWindow::ResetObjectContact()
}
}
-void SdrPageWindow::SetDesignMode( bool _bDesignMode ) const
+void SdrPageWindow::SetDesignMode( bool _bDesignMode )
{
- const ::sdr::contact::ObjectContactOfPageView* pOC = dynamic_cast< const ::sdr::contact::ObjectContactOfPageView* >( &GetObjectContact() );
+ ::sdr::contact::ObjectContactOfPageView* pOC = dynamic_cast< ::sdr::contact::ObjectContactOfPageView* >( &GetObjectContact() );
DBG_ASSERT( pOC, "SdrPageWindow::SetDesignMode: invalid object contact!" );
if ( pOC )
pOC->SetUNOControlsDesignMode( _bDesignMode );
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 42f84ca7156b..054b9f5f90a3 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -142,7 +142,7 @@ void SdrPaintWindow::impCreateOverlayManager()
if(OUTDEV_WINDOW == GetOutputDevice().GetOutDevType())
{
// decide which OverlayManager to use
- if(GetPaintView().IsBufferedOverlayAllowed() && mbUseBuffer)
+ if(GetPaintView().IsBufferedOverlayAllowed())
{
// buffered OverlayManager, buffers it's background and refreshes from there
// for pure overlay changes (no system redraw). The 3rd parameter specifies
@@ -188,10 +188,9 @@ void SdrPaintWindow::impCreateOverlayManager()
SdrPaintWindow::SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut)
: mrOutputDevice(rOut),
mrPaintView(rNewPaintView),
- mpOverlayManager(0L),
- mpPreRenderDevice(0L),
- mbTemporaryTarget(false), // #i72889#
- mbUseBuffer(true)
+ mpOverlayManager(0),
+ mpPreRenderDevice(0),
+ mbTemporaryTarget(false)
{
}
@@ -275,7 +274,7 @@ void SdrPaintWindow::OutputPreRenderDevice(const Region& rExpandedRegion)
// #i73602# add flag if buffer shall be used
void SdrPaintWindow::DrawOverlay(const Region& rRegion)
{
- // ## force creation of OverlayManager since the first repaint needs to
+ // force creation of OverlayManager since the first repaint needs to
// save the background to get a controlled start into overlay mechanism
impCreateOverlayManager();
diff --git a/svx/source/svdraw/sdrselection.cxx b/svx/source/svdraw/sdrselection.cxx
new file mode 100644
index 000000000000..66c20af8d340
--- /dev/null
+++ b/svx/source/svdraw/sdrselection.cxx
@@ -0,0 +1,657 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdrselection.hxx>
+#include <svx/svdview.hxx>
+#include <svx/svdstr.hrc>
+#include <svx/svdglob.hxx>
+#include <svx/svdlegacy.hxx>
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// selection implementations
+
+namespace sdr
+{
+ namespace selection
+ {
+ bool SelectionComparator::operator()(SdrObject* pA, SdrObject* pB) const
+ {
+ // sort by NavigationPosition
+ return pA->GetNavigationPosition() < pB->GetNavigationPosition();
+ }
+
+ bool IndicesComparator::operator()(SdrObject* pA, SdrObject* pB) const
+ {
+ // sort associative point index map by SdrObject's address
+ return pA < pB;
+ }
+
+ void Selection::checkPointIndexCorrection()
+ {
+ for(IndicesMap::iterator aIndices(maPointIndices.begin()); aIndices != maPointIndices.end();)
+ {
+ SdrObject* pCandidate = aIndices->first;
+ OSL_ENSURE(pCandidate, "Missing SdrObject pointer in point selection(!)");
+ Indices aCurrent = aIndices->second;
+ bool bErase(false);
+ IndicesMap::iterator aNext(aIndices);
+
+ aNext++;
+
+ // for each SdrObject check if it's a polygon object at all
+ if(pCandidate->IsPolygonObject())
+ {
+ const sal_uInt32 nMax(pCandidate->GetObjectPointCount());
+
+ if(nMax)
+ {
+ // take all points out of the selection which are beyond the maximum point index
+ Indices::iterator aUpperBound(aCurrent.upper_bound(nMax - 1));
+
+ if(aUpperBound != aCurrent.end())
+ {
+ aCurrent.erase(aUpperBound, aCurrent.end());
+ bErase = aCurrent.empty();
+
+ if(!bErase)
+ {
+ // copy back if still points are selected
+ aIndices->second = aCurrent;
+ }
+ }
+ }
+ else
+ {
+ // maximum is 0, all points have to be removed
+ bErase = true;
+ }
+ }
+ else
+ {
+ // not a PolygonObject
+ bErase = true;
+ }
+
+ if(bErase)
+ {
+ maPointIndices.erase(aIndices);
+ }
+
+ aIndices = aNext;
+ }
+ }
+
+ void Selection::checkGlueIndexCorrection()
+ {
+ for(IndicesMap::iterator aIndices(maGlueIndices.begin()); aIndices != maGlueIndices.end();)
+ {
+ SdrObject* pCandidate = aIndices->first;
+ OSL_ENSURE(pCandidate, "Missing SdrObject pointer in glue selection(!)");
+ bool bErase(false);
+ IndicesMap::iterator aNext(aIndices);
+ const SdrGluePointList* pGPL = pCandidate->GetGluePointList();
+
+ aNext++;
+
+ // for each SdrObject check if it has GluePoints at all
+ if(pGPL)
+ {
+ Indices aCurrent = aIndices->second;
+ Indices aNewList;
+
+ // check for each selected GluePoint if it exists at the SdrObject. If yes, take
+ // it over to a new list. Thus, all no longer existing GluePoints will be erased
+ for(Indices::const_iterator aIter(aCurrent.begin()); aIter != aCurrent.end(); aIter++)
+ {
+ if(SDRGLUEPOINT_NOTFOUND != pGPL->FindGluePoint(*aIter))
+ {
+ aNewList.insert(aNewList.end(), *aIter);
+ }
+ }
+
+ if(aNewList.empty())
+ {
+ // no glues left
+ bErase = true;
+ }
+ else
+ {
+ // copy back new list
+ aIndices->second = aNewList;
+ }
+ }
+ else
+ {
+ // no glues at all
+ bErase = true;
+ }
+
+ if(bErase)
+ {
+ maGlueIndices.erase(aIndices);
+ }
+
+ aIndices = aNext;
+ }
+ }
+
+ void Selection::delayedSelectionChanged()
+ {
+ // trigger a delayed selection change
+ SetTimeout(1);
+ Start();
+ }
+
+ bool Selection::isSelectionChangePending() const
+ {
+ return IsActive();
+ }
+
+ void Selection::forceSelectionChange()
+ {
+ if(IsActive())
+ {
+ Stop();
+ Timeout();
+ }
+ }
+
+ void Selection::Timeout()
+ {
+ // check if marked points need to be corrected
+ if(!maPointIndices.empty())
+ {
+ checkPointIndexCorrection();
+ }
+
+ // check if marked glues need to be corrected
+ if(!maGlueIndices.empty())
+ {
+ checkGlueIndexCorrection();
+ }
+
+ // trigger selection change at SdrView
+ mrSdrView.handleSelectionChange();
+ }
+
+ void Selection::createIndexDescription(bool bPoints)
+ {
+ if(!maSet.empty())
+ {
+ IndicesMap& rIndices = bPoints ? maPointIndices : maGlueIndices;
+
+ if(!rIndices.empty())
+ {
+ SelectionSet::const_iterator aIter(maSet.begin());
+ sal_uInt32 nIndicesCount(0);
+ SdrObjectVector aObjectsWithIndices;
+
+ for(;aIter != maSet.end(); aIter++)
+ {
+ IndicesMap::const_iterator aIndices(rIndices.find(*aIter));
+
+ if(aIndices != rIndices.end())
+ {
+ nIndicesCount += aIndices->second.size();
+ aObjectsWithIndices.push_back(*aIter);
+ }
+ }
+
+ if(aObjectsWithIndices.size())
+ {
+ String aObjectName;
+ String aGlueText;
+
+ if(1 == aObjectsWithIndices.size())
+ {
+ aObjectsWithIndices[0]->TakeObjNameSingul(aObjectName);
+ aGlueText = (ImpGetResStr(bPoints ? STR_ViewMarkedPoint : STR_ViewMarkedGluePoint));
+ }
+ else
+ {
+ aObjectsWithIndices[0]->TakeObjNamePlural(aObjectName);
+ String aCompare;
+ bool bEqual(true);
+
+ for(sal_uInt32 a(1); bEqual && a < aObjectsWithIndices.size(); a++)
+ {
+ aObjectsWithIndices[a]->TakeObjNamePlural(aCompare);
+ bEqual = aObjectName.Equals(aCompare);
+ }
+
+ if(!bEqual)
+ {
+ aObjectName = ImpGetResStr(STR_ObjNamePlural);
+ }
+
+ aObjectName.Insert(sal_Unicode(' '), 0);
+ aObjectName.Insert(UniString::CreateFromInt32(aObjectsWithIndices.size()), 0);
+
+ aGlueText = (ImpGetResStr(bPoints ? STR_ViewMarkedPoints : STR_ViewMarkedGluePoints));
+ aGlueText.SearchAndReplaceAscii("%2", UniString::CreateFromInt32(nIndicesCount));
+ }
+
+ aGlueText.SearchAndReplaceAscii("%1", aObjectName);
+
+ if(bPoints)
+ {
+ maPointDescription = aGlueText;
+ }
+ else
+ {
+ maGlueDescription = aGlueText;
+ }
+ }
+ }
+ }
+ }
+
+ Selection::Selection(SdrView& rSdrView)
+ : boost::noncopyable(),
+ SfxListener(),
+ Timer(),
+ mrSdrView(rSdrView),
+ maSet(),
+ maPointIndices(),
+ maGlueIndices(),
+ maVector(),
+ maPointDescription(),
+ maGlueDescription(),
+ maSnapRange()
+ {
+ }
+
+ void Selection::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+ {
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrHint)
+ {
+ OSL_ENSURE(pSdrHint->GetSdrHintObject(),
+ "OOps, no SdrObject in Selection::Notify hint (!)");
+ OSL_ENSURE(pSdrHint->GetSdrHintObject() && isSdrObject(*pSdrHint->GetSdrHintObject()),
+ "OOps, SdrObject in Selection::Notify is NOT part of the selection (!)");
+
+ switch(pSdrHint->GetSdrHintKind())
+ {
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
+ case HINT_OBJCHG_ATTR:
+ {
+ // the BoundRange/SnapRange of a selected SdrObject
+ // may have changed. Since this may happen often and
+ // mainly based on the selection, do not trigger a
+ // selection change immediately, but start a timer
+ // to do so later
+ delayedSelectionChanged();
+
+ // reset buffered SnapRange
+ resetBufferedSelectionInformation();
+ break;
+ }
+ case HINT_OBJINSERTED:
+ {
+ // this should not happen since this would mean that an already
+ // selected SdrObject (only these are listened to) was inserted
+ // to a SdrObjList
+ OSL_ENSURE(false, "Caution: already selected SdrObject was added to the SdrModel tree (!)");
+ break;
+ }
+ case HINT_OBJREMOVED:
+ {
+ // a selected SdrObject was removed from SdrObjList, thus is no
+ // longer active in the SdrModel. Remove from selection, too.
+ // This also triggers a delayedSelectionChanged()
+ if(pSdrHint->GetSdrHintObject())
+ {
+ removeSdrObject(*pSdrHint->GetSdrHintObject());
+ }
+ break;
+ }
+ case HINT_SDROBJECTDYING:
+ {
+ if(pSdrHint->GetSdrHintObject())
+ {
+ // If selected object is deleted, trigger an assertion since this potentially leads to problems.
+ // In the next step with RefCounted Sdrobjects this problem will be solved (in the middle run
+ // anyways) so this may be removed again later.
+ if(isSdrObject(*pSdrHint->GetSdrHintObject()))
+ {
+ OSL_ENSURE(false, "Caution: SdrObject which is active part of a selection is deleted. \
+ This should be avoided by managing the selection before calling changing methods (!)");
+
+ // remove the deleted SdrObject from the selection. This will trigger
+ // a delayedSelectionChanged to react. All selection
+ // users have to forget the deleted SdrObject ASAP
+ removeSdrObject(*pSdrHint->GetSdrHintObject());
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ const SdrObjectVector& Selection::getVector() const
+ {
+ if(maVector.empty() && !maSet.empty())
+ {
+ const_cast< Selection* >(this)->maVector = SdrObjectVector(maSet.begin(), maSet.end());
+ }
+
+ return maVector;
+ }
+
+ SdrObject* Selection::getSingle() const
+ {
+ if(maSet.empty())
+ {
+ return 0;
+ }
+ else if(maSet.size() > 1)
+ {
+ return 0;
+ }
+ else
+ {
+ return *maSet.begin();
+ }
+ }
+
+ bool Selection::empty() const
+ {
+ return maSet.empty();
+ }
+
+ sal_uInt32 Selection::size() const
+ {
+ if(maSet.empty())
+ {
+ return 0;
+ }
+ else
+ {
+ return maSet.size();
+ }
+ }
+
+ bool Selection::isSdrObject(const SdrObject& rObject) const
+ {
+ if(maSet.empty())
+ {
+ return false;
+ }
+ else
+ {
+ return 0 != maSet.count(const_cast< SdrObject* >(&rObject));
+ }
+ }
+
+ void Selection::removeSdrObject(const SdrObject& rObject)
+ {
+ if(!maSet.empty())
+ {
+ SelectionSet::iterator aFound(maSet.find(const_cast< SdrObject* >(&rObject)));
+
+ if(aFound != maSet.end())
+ {
+ EndListening(const_cast< SdrObject& >(rObject));
+ maSet.erase(aFound);
+
+ if(!maPointIndices.empty())
+ {
+ IndicesMap::iterator aPointIndex(maPointIndices.find(const_cast< SdrObject* >(&rObject)));
+
+ if(aPointIndex != maPointIndices.end())
+ {
+ maPointIndices.erase(aPointIndex);
+ resetBufferedPointInformation();
+ }
+ }
+
+ if(!maGlueIndices.empty())
+ {
+ IndicesMap::iterator aPointIndex(maGlueIndices.find(const_cast< SdrObject* >(&rObject)));
+
+ if(aPointIndex != maGlueIndices.end())
+ {
+ maGlueIndices.erase(aPointIndex);
+ resetBufferedGlueInformation();
+ }
+ }
+
+ resetBufferedSelectionInformation();
+ delayedSelectionChanged();
+ }
+ }
+ }
+
+ void Selection::addSdrObject(const SdrObject& rObject)
+ {
+ SelectionSet::iterator aFound(maSet.find(const_cast< SdrObject* >(&rObject)));
+
+ if(aFound == maSet.end())
+ {
+ StartListening(const_cast< SdrObject& >(rObject));
+ maSet.insert(const_cast< SdrObject* >(&rObject));
+ maPointIndices.clear();
+ maGlueIndices.clear();
+ resetBufferedSelectionInformation();
+ resetBufferedPointInformation();
+ resetBufferedGlueInformation();
+ delayedSelectionChanged();
+ }
+ }
+
+ void Selection::clear()
+ {
+ if(!maSet.empty())
+ {
+ for(SelectionSet::const_iterator aIter(maSet.begin()); aIter != maSet.end(); aIter++)
+ {
+ EndListening(const_cast< SdrObject& >(**aIter));
+ }
+
+ maSet.clear();
+ maPointIndices.clear();
+ maGlueIndices.clear();
+ resetBufferedSelectionInformation();
+ resetBufferedPointInformation();
+ resetBufferedGlueInformation();
+ delayedSelectionChanged();
+ }
+ }
+
+ void Selection::setSdrObjects(const SdrObjectVector& rSdrObjectVector)
+ {
+ if(rSdrObjectVector.empty())
+ {
+ clear();
+ }
+ else
+ {
+ const SelectionSet aNewSet(rSdrObjectVector.begin(), rSdrObjectVector.end());
+
+ if(aNewSet != maSet)
+ {
+ SelectionSet::const_iterator aIter;
+
+ for(aIter = maSet.begin(); aIter != maSet.end(); aIter++)
+ {
+ EndListening(const_cast< SdrObject& >(**aIter));
+ }
+
+ maSet = aNewSet;
+ maPointIndices.clear();
+ maGlueIndices.clear();
+ resetBufferedSelectionInformation();
+ resetBufferedPointInformation();
+ resetBufferedGlueInformation();
+
+ for(aIter = maSet.begin(); aIter != maSet.end(); aIter++)
+ {
+ StartListening(const_cast< SdrObject& >(**aIter));
+ }
+
+ delayedSelectionChanged();
+ }
+ }
+ }
+
+ sdr::selection::Indices Selection::getIndicesForSdrObject(const SdrObject& rObject, bool bPoints) const
+ {
+ const IndicesMap& rIndices = bPoints ? maPointIndices : maGlueIndices;
+
+ if(!rIndices.empty())
+ {
+ const IndicesMap::const_iterator aPointIndex(rIndices.find(const_cast< SdrObject* >(&rObject)));
+
+ if(aPointIndex != rIndices.end())
+ {
+ return aPointIndex->second;
+ }
+ }
+
+ return sdr::selection::Indices();
+ }
+
+ void Selection::setIndicesForSdrObject(const SdrObject& rObject, const sdr::selection::Indices& rNew, bool bPoints)
+ {
+ if(rNew.empty())
+ {
+ clearIndicesForSdrObject(rObject, bPoints);
+ }
+ else
+ {
+ if(!maSet.empty() && 0 != maSet.count(const_cast< SdrObject* >(&rObject)))
+ {
+ IndicesMap& rIndices = bPoints ? maPointIndices : maGlueIndices;
+ const IndicesMap::iterator aFound(rIndices.find(const_cast< SdrObject* >(&rObject)));
+ bool bChanged(true);
+
+ if(aFound != rIndices.end())
+ {
+ bChanged = (aFound->second != rNew);
+ aFound->second = rNew;
+ }
+ else
+ {
+ rIndices.insert(::std::pair< SdrObject*, Indices >(const_cast< SdrObject* >(&rObject), rNew));
+ }
+
+ if(bChanged)
+ {
+ if(bPoints)
+ {
+ resetBufferedPointInformation();
+ }
+ else
+ {
+ resetBufferedGlueInformation();
+ }
+
+ delayedSelectionChanged();
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "Tried to set indices for non-selected SrObject (!)");
+ }
+ }
+ }
+
+ void Selection::clearIndicesForSdrObject(const SdrObject& rObject, bool bPoints)
+ {
+ if(!maSet.empty() && 0 != maSet.count(const_cast< SdrObject* >(&rObject)))
+ {
+ // clear if entry exists
+ IndicesMap& rIndices = bPoints ? maPointIndices : maGlueIndices;
+
+ if(!rIndices.empty())
+ {
+ const IndicesMap::iterator aFound(rIndices.find(const_cast< SdrObject* >(&rObject)));
+
+ if(aFound != rIndices.end())
+ {
+ const bool bWasUsed(0 != aFound->second.size());
+ rIndices.erase(aFound);
+
+ if(bWasUsed)
+ {
+ if(bPoints)
+ {
+ resetBufferedPointInformation();
+ }
+ else
+ {
+ resetBufferedGlueInformation();
+ }
+
+ delayedSelectionChanged();
+ }
+ }
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "Tried to clear indices for non-selected SrObject (!)");
+ }
+ }
+
+ const String& Selection::getIndexDescription(bool bPoints) const
+ {
+ if(0 == (bPoints ? maPointDescription.Len() : maGlueDescription.Len()))
+ {
+ const_cast< Selection* >(this)->createIndexDescription(bPoints);
+ }
+
+ return bPoints ? maPointDescription : maGlueDescription;
+ }
+
+ bool Selection::hasIndices(bool bPoints) const
+ {
+ const IndicesMap& rIndices = bPoints ? maPointIndices : maGlueIndices;
+
+ return !rIndices.empty();
+ }
+
+ const basegfx::B2DRange& Selection::getSnapRange() const
+ {
+ if(maSnapRange.isEmpty())
+ {
+ const SdrObjectVector& rVector = getVector();
+
+ if(!rVector.empty())
+ {
+ const_cast< Selection* >(this)->maSnapRange = sdr::legacy::GetAllObjSnapRange(rVector);
+ }
+ }
+
+ return maSnapRange;
+ }
+ } // end of namespace selection
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/sdrtexthelpers.cxx b/svx/source/svdraw/sdrtexthelpers.cxx
new file mode 100644
index 000000000000..41b0da4c9350
--- /dev/null
+++ b/svx/source/svdraw/sdrtexthelpers.cxx
@@ -0,0 +1,249 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdrtexthelpers.hxx>
+
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+
+#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// helper to explicitely extract text contours from SdrContourTextPrimitive2D
+
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ class TextContourExtractor2D : public BaseProcessor2D
+ {
+ private:
+ /// the extracted contour
+ std::vector< basegfx::B2DPolyPolygon > maExtractedContour;
+
+ /// tooling methods
+ void processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& rUnoCandidate);
+
+ public:
+ TextContourExtractor2D(const geometry::ViewInformation2D& rViewInformation)
+ : BaseProcessor2D(rViewInformation),
+ maExtractedContour()
+ {
+ }
+
+ virtual ~TextContourExtractor2D()
+ {
+ }
+
+ const std::vector< basegfx::B2DPolyPolygon >& getContour() const
+ {
+ return maExtractedContour;
+ }
+ };
+
+ void TextContourExtractor2D::processBasePrimitive2D(
+ const primitive2d::BasePrimitive2D& rCandidate,
+ const primitive2d::Primitive2DReference& /*rUnoCandidate*/)
+ {
+ switch(rCandidate.getPrimitive2DID())
+ {
+ case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D :
+ {
+ // remember current ViewInformation2D
+ const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
+ const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+
+ // create new local ViewInformation2D
+ const geometry::ViewInformation2D aViewInformation2D(
+ getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(),
+ getViewInformation2D().getViewTransformation(),
+ getViewInformation2D().getViewport(),
+ getViewInformation2D().getVisualizedPage(),
+ getViewInformation2D().getViewTime(),
+ getViewInformation2D().getExtendedInformationSequence());
+ updateViewInformation(aViewInformation2D);
+
+ // proccess content
+ process(rTransformCandidate.getChildren());
+
+ // restore transformations
+ updateViewInformation(aLastViewInformation2D);
+
+ break;
+ }
+ case PRIMITIVE2D_ID_SDRCONTOURTEXTPRIMITIVE2D :
+ {
+ // extract contour
+ const primitive2d::SdrContourTextPrimitive2D& rCandidate(static_cast< const primitive2d::SdrContourTextPrimitive2D& >(rCandidate));
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rCandidate.getUnitPolyPolygon());
+
+ aLocalPolyPolygon.transform(rCandidate.getObjectTransform());
+ aLocalPolyPolygon.transform(getViewInformation2D().getObjectTransformation());
+
+ maExtractedContour.push_back(aLocalPolyPolygon);
+ break;
+ }
+ case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D :
+ case PRIMITIVE2D_ID_MARKERARRAYPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
+ case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
+ case PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_CONTROLPRIMITIVE2D :
+ case PRIMITIVE2D_ID_GRAPHICPRIMITIVE2D :
+ case PRIMITIVE2D_ID_MEDIAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYGONMARKERPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYGONWAVEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYGONSTROKEARROWPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONSTROKEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONSTROKEARROWPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONHATCHPRIMITIVE2D :
+ case PRIMITIVE2D_ID_POLYPOLYGONGRAPHICPRIMITIVE2D:
+ case PRIMITIVE2D_ID_SHADOWPRIMITIVE2D :
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
+ case PRIMITIVE2D_ID_SCENEPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
+ {
+ // ignorable primitives
+ break;
+ }
+ default :
+ {
+ // process recursively
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ }
+ }
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// helpers
+
+basegfx::B2DRange getScaledCenteredTextRange(const SdrTextObj& rText)
+{
+ // get unified text range (no mirroring)
+ const basegfx::B2DRange aUnifiedTextRange(rText.getUnifiedTextRange());
+
+ // scale to object size. absolute is not needed, will be centered anyways
+ basegfx::B2DRange aRetval(basegfx::tools::createScaleB2DHomMatrix(rText.getSdrObjectScale()) * aUnifiedTextRange);
+
+ // to align centered, just translate to the current object center. This
+ // will also correct evtl. mirrorings
+ const basegfx::B2DPoint aCurrentCenter(aRetval.getCenter());
+ const basegfx::B2DPoint aFullTransformedCenter(
+ rText.getSdrObjectTransformation() * aUnifiedTextRange.getCenter());
+
+ aRetval.transform(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ aFullTransformedCenter - aCurrentCenter));
+
+ return aRetval;
+}
+
+basegfx::B2DPolyPolygon getTextContourPolyPolygon(const SdrTextObj& rText)
+{
+ basegfx::B2DPolyPolygon aRetval;
+
+ if(rText.IsContourTextFrame() && rText.HasText())
+ {
+ // get primitive sequence
+ const sdr::contact::ViewContact& rVC(rText.GetViewContact());
+ const drawinglayer::primitive2d::Primitive2DSequence xSequence(rVC.getViewIndependentPrimitive2DSequence());
+
+ if(xSequence.hasElements())
+ {
+ // use neutral ViewInformation
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+
+ // extract contour PolyPolygons from SdrContourTextPrimitive2D
+ drawinglayer::processor2d::TextContourExtractor2D aExtractor(aViewInformation2D);
+ aExtractor.process(xSequence);
+
+ // get result
+ const std::vector< basegfx::B2DPolyPolygon >& rResult(aExtractor.getContour());
+
+ if(rResult.size())
+ {
+ // currently there can be only one contour PolyPolygon per object,
+ // so just use the first one. This may change later.
+ aRetval = rResult[0];
+ }
+ }
+ }
+
+ return aRetval;
+}
+
+basegfx::B2DPolyPolygon getAlignedTextContourPolyPolygon(const SdrTextObj& rText)
+{
+ basegfx::B2DPolyPolygon aRetval;
+
+ if(rText.IsContourTextFrame() && rText.HasText())
+ {
+ // get the contour polygon in logic coordinates (fully transformed)
+ aRetval = getTextContourPolyPolygon(rText);
+
+ if(aRetval.count())
+ {
+ // for editing the polygon needs to be free from mirror, shear and rotation
+ basegfx::B2DHomMatrix aMatrix(rText.getSdrObjectTransformation());
+
+ // remove full object transform
+ aMatrix.invert();
+
+ // move to object center
+ aMatrix.translate(-0.5, -0.5);
+
+ // apply absolute object scale
+ aMatrix.scale(basegfx::absolute(rText.getSdrObjectScale()));
+
+ // move to current object center
+ aMatrix.translate(rText.getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5));
+
+ // apply
+ aRetval.transform(aMatrix);
+ }
+ }
+
+ return aRetval;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/selectioncontroller.cxx b/svx/source/svdraw/selectioncontroller.cxx
index 3b4eb4c4f833..d46954e6ddb9 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -29,7 +29,6 @@
namespace sdr
{
-
bool SelectionController::onKeyInput(const KeyEvent& /*rKEvt*/, Window* /*pWin*/)
{
return false;
@@ -106,5 +105,4 @@ bool SelectionController::ApplyFormatPaintBrush( SfxItemSet& /*rFormatSet*/, boo
{
return false;
}
-
}
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index cd6ca5244932..d50179901df8 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -24,7 +24,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-
#include <com/sun/star/drawing/TextFitToSizeType.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
@@ -37,20 +36,18 @@
#include <com/sun/star/drawing/MeasureTextVertPos.hpp>
#include <com/sun/star/drawing/CircleKind.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-
#include <unotools/intlwrapper.hxx>
#include <comphelper/processfactory.hxx>
#include <vcl/svapp.hxx>
#include <svx/svdattr.hxx>
#include <svx/svdattrx.hxx>
#include <svx/svdpool.hxx>
-
#include <svl/solar.hrc>
#include "editeng/xmlcnitm.hxx"
-
#include <svx/svxids.hrc>
#include <svx/xtable.hxx> // fuer RGB_Color()
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdmodel.hxx> // fuer DEGREE_CHAR
#include <svx/svdtrans.hxx>
#include "svx/svdglob.hxx" // Stringcache
@@ -103,120 +100,117 @@ SdrItemPool::SdrItemPool(
}
// init own PoolDefaults
- mppLocalPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrShadowItem;
- mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new SdrShadowColorItem(aEmptyStr,aNullCol);
- mppLocalPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrShadowXDistItem;
- mppLocalPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrShadowYDistItem;
- mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrShadowTransparenceItem;
+ mppLocalPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrOnOffItem(SDRATTR_SHADOW);
+ mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new XColorItem(SDRATTR_SHADOWCOLOR, aEmptyStr, aNullCol);
+ mppLocalPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWXDIST);
+ mppLocalPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWYDIST);
+ mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, 0);
mppLocalPoolDefaults[SDRATTR_SHADOW3D -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D );
mppLocalPoolDefaults[SDRATTR_SHADOWPERSP -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
mppLocalPoolDefaults[SDRATTR_CAPTIONTYPE -SDRATTR_START]=new SdrCaptionTypeItem ;
- mppLocalPoolDefaults[SDRATTR_CAPTIONFIXEDANGLE-SDRATTR_START]=new SdrCaptionFixedAngleItem;
- mppLocalPoolDefaults[SDRATTR_CAPTIONANGLE -SDRATTR_START]=new SdrCaptionAngleItem ;
- mppLocalPoolDefaults[SDRATTR_CAPTIONGAP -SDRATTR_START]=new SdrCaptionGapItem ;
+ mppLocalPoolDefaults[SDRATTR_CAPTIONFIXEDANGLE-SDRATTR_START]=new SdrOnOffItem(SDRATTR_CAPTIONFIXEDANGLE, true);
+ mppLocalPoolDefaults[SDRATTR_CAPTIONANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_CAPTIONANGLE, 0);
+ mppLocalPoolDefaults[SDRATTR_CAPTIONGAP -SDRATTR_START]=new SdrMetricItem(SDRATTR_CAPTIONGAP, 0);
mppLocalPoolDefaults[SDRATTR_CAPTIONESCDIR -SDRATTR_START]=new SdrCaptionEscDirItem ;
- mppLocalPoolDefaults[SDRATTR_CAPTIONESCISREL -SDRATTR_START]=new SdrCaptionEscIsRelItem ;
- mppLocalPoolDefaults[SDRATTR_CAPTIONESCREL -SDRATTR_START]=new SdrCaptionEscRelItem ;
- mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrCaptionEscAbsItem ;
- mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrCaptionLineLenItem ;
- mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrCaptionFitLineLenItem;
- mppLocalPoolDefaults[SDRATTR_ECKENRADIUS -SDRATTR_START]=new SdrEckenradiusItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT -SDRATTR_START]=new SdrTextMinFrameHeightItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT -SDRATTR_START]=new SdrTextAutoGrowHeightItem;
+ mppLocalPoolDefaults[SDRATTR_CAPTIONESCISREL -SDRATTR_START]=new SdrYesNoItem(SDRATTR_CAPTIONESCISREL, true);
+ mppLocalPoolDefaults[SDRATTR_CAPTIONESCREL -SDRATTR_START]=new SfxInt32Item(SDRATTR_CAPTIONESCREL, 5000);
+ mppLocalPoolDefaults[SDRATTR_CAPTIONESCABS -SDRATTR_START]=new SdrMetricItem(SDRATTR_CAPTIONESCABS, 0);
+ mppLocalPoolDefaults[SDRATTR_CAPTIONLINELEN -SDRATTR_START]=new SdrMetricItem(SDRATTR_CAPTIONLINELEN, 0);
+ mppLocalPoolDefaults[SDRATTR_CAPTIONFITLINELEN-SDRATTR_START]=new SdrYesNoItem(SDRATTR_CAPTIONFITLINELEN, true);
+ mppLocalPoolDefaults[SDRATTR_ECKENRADIUS -SDRATTR_START]=new SdrMetricItem(SDRATTR_ECKENRADIUS, 0);
+ mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT);
+ mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWHEIGHT -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true);
mppLocalPoolDefaults[SDRATTR_TEXT_FITTOSIZE -SDRATTR_START]=new SdrTextFitToSizeTypeItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_LEFTDIST -SDRATTR_START]=new SdrTextLeftDistItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_RIGHTDIST -SDRATTR_START]=new SdrTextRightDistItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_UPPERDIST -SDRATTR_START]=new SdrTextUpperDistItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_LOWERDIST -SDRATTR_START]=new SdrTextLowerDistItem;
+ mppLocalPoolDefaults[SDRATTR_TEXT_LEFTDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_LEFTDIST);
+ mppLocalPoolDefaults[SDRATTR_TEXT_RIGHTDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_RIGHTDIST);
+ mppLocalPoolDefaults[SDRATTR_TEXT_UPPERDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_UPPERDIST);
+ mppLocalPoolDefaults[SDRATTR_TEXT_LOWERDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_LOWERDIST);
mppLocalPoolDefaults[SDRATTR_TEXT_VERTADJUST -SDRATTR_START]=new SdrTextVertAdjustItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEHEIGHT -SDRATTR_START]=new SdrTextMaxFrameHeightItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEWIDTH -SDRATTR_START]=new SdrTextMinFrameWidthItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEWIDTH -SDRATTR_START]=new SdrTextMaxFrameWidthItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWWIDTH -SDRATTR_START]=new SdrTextAutoGrowWidthItem;
+ mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT);
+ mppLocalPoolDefaults[SDRATTR_TEXT_MINFRAMEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH);
+ mppLocalPoolDefaults[SDRATTR_TEXT_MAXFRAMEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH);
+ mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWWIDTH -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false);
mppLocalPoolDefaults[SDRATTR_TEXT_HORZADJUST -SDRATTR_START]=new SdrTextHorzAdjustItem;
mppLocalPoolDefaults[SDRATTR_TEXT_ANIKIND -SDRATTR_START]=new SdrTextAniKindItem;
mppLocalPoolDefaults[SDRATTR_TEXT_ANIDIRECTION -SDRATTR_START]=new SdrTextAniDirectionItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_ANISTARTINSIDE -SDRATTR_START]=new SdrTextAniStartInsideItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_ANISTOPINSIDE -SDRATTR_START]=new SdrTextAniStopInsideItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_ANICOUNT -SDRATTR_START]=new SdrTextAniCountItem;
+ mppLocalPoolDefaults[SDRATTR_TEXT_ANISTARTINSIDE -SDRATTR_START]=new SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE, false);
+ mppLocalPoolDefaults[SDRATTR_TEXT_ANISTOPINSIDE -SDRATTR_START]=new SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE, false);
+ mppLocalPoolDefaults[SDRATTR_TEXT_ANICOUNT -SDRATTR_START]=new SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, 0);
mppLocalPoolDefaults[SDRATTR_TEXT_ANIDELAY -SDRATTR_START]=new SdrTextAniDelayItem;
mppLocalPoolDefaults[SDRATTR_TEXT_ANIAMOUNT -SDRATTR_START]=new SdrTextAniAmountItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_CONTOURFRAME -SDRATTR_START]=new SdrTextContourFrameItem;
+ mppLocalPoolDefaults[SDRATTR_TEXT_CONTOURFRAME -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, false);
mppLocalPoolDefaults[SDRATTR_CUSTOMSHAPE_ADJUSTMENT -SDRATTR_START]=new SdrCustomShapeAdjustmentItem;
mppLocalPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
mppLocalPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new SdrTextFixedCellHeightItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new SdrTextWordWrapItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE -SDRATTR_START]=new SdrTextAutoGrowSizeItem;
+ mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, false);
+ mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE -SDRATTR_START]=new SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, false);
mppLocalPoolDefaults[SDRATTR_EDGEKIND -SDRATTR_START]=new SdrEdgeKindItem;
mppLocalPoolDefaults[SDRATTR_EDGENODE1HORZDIST-SDRATTR_START]=new SdrEdgeNode1HorzDistItem(nDefEdgeDist);
mppLocalPoolDefaults[SDRATTR_EDGENODE1VERTDIST-SDRATTR_START]=new SdrEdgeNode1VertDistItem(nDefEdgeDist);
mppLocalPoolDefaults[SDRATTR_EDGENODE2HORZDIST-SDRATTR_START]=new SdrEdgeNode2HorzDistItem(nDefEdgeDist);
mppLocalPoolDefaults[SDRATTR_EDGENODE2VERTDIST-SDRATTR_START]=new SdrEdgeNode2VertDistItem(nDefEdgeDist);
- mppLocalPoolDefaults[SDRATTR_EDGENODE1GLUEDIST-SDRATTR_START]=new SdrEdgeNode1GlueDistItem;
- mppLocalPoolDefaults[SDRATTR_EDGENODE2GLUEDIST-SDRATTR_START]=new SdrEdgeNode2GlueDistItem;
- mppLocalPoolDefaults[SDRATTR_EDGELINEDELTAANZ -SDRATTR_START]=new SdrEdgeLineDeltaAnzItem;
+ mppLocalPoolDefaults[SDRATTR_EDGENODE1GLUEDIST-SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST, 0);
+ mppLocalPoolDefaults[SDRATTR_EDGENODE2GLUEDIST-SDRATTR_START]=new SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST, 0);
+ mppLocalPoolDefaults[SDRATTR_EDGELINEDELTAANZ -SDRATTR_START]=new SfxUInt16Item(SDRATTR_EDGELINEDELTAANZ, 0);
mppLocalPoolDefaults[SDRATTR_EDGELINE1DELTA -SDRATTR_START]=new SdrEdgeLine1DeltaItem;
mppLocalPoolDefaults[SDRATTR_EDGELINE2DELTA -SDRATTR_START]=new SdrEdgeLine2DeltaItem;
mppLocalPoolDefaults[SDRATTR_EDGELINE3DELTA -SDRATTR_START]=new SdrEdgeLine3DeltaItem;
mppLocalPoolDefaults[SDRATTR_MEASUREKIND -SDRATTR_START]=new SdrMeasureKindItem;
mppLocalPoolDefaults[SDRATTR_MEASURETEXTHPOS -SDRATTR_START]=new SdrMeasureTextHPosItem;
mppLocalPoolDefaults[SDRATTR_MEASURETEXTVPOS -SDRATTR_START]=new SdrMeasureTextVPosItem;
- mppLocalPoolDefaults[SDRATTR_MEASURELINEDIST -SDRATTR_START]=new SdrMeasureLineDistItem(800);
- mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEOVERHANG -SDRATTR_START]=new SdrMeasureHelplineOverhangItem(200);
- mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEDIST -SDRATTR_START]=new SdrMeasureHelplineDistItem(100);
- mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE1LEN -SDRATTR_START]=new SdrMeasureHelpline1LenItem;
- mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE2LEN -SDRATTR_START]=new SdrMeasureHelpline2LenItem;
- mppLocalPoolDefaults[SDRATTR_MEASUREBELOWREFEDGE -SDRATTR_START]=new SdrMeasureBelowRefEdgeItem;
- mppLocalPoolDefaults[SDRATTR_MEASURETEXTROTA90 -SDRATTR_START]=new SdrMeasureTextRota90Item;
- mppLocalPoolDefaults[SDRATTR_MEASURETEXTUPSIDEDOWN -SDRATTR_START]=new SdrMeasureTextUpsideDownItem;
- mppLocalPoolDefaults[SDRATTR_MEASUREOVERHANG -SDRATTR_START]=new SdrMeasureOverhangItem(600);
+ mppLocalPoolDefaults[SDRATTR_MEASURELINEDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASURELINEDIST, 800);
+ mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEOVERHANG -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG, 200);
+ mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINEDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST, 100);
+ mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE1LEN -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN, 0);
+ mppLocalPoolDefaults[SDRATTR_MEASUREHELPLINE2LEN -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN, 0);
+ mppLocalPoolDefaults[SDRATTR_MEASUREBELOWREFEDGE -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE, false);
+ mppLocalPoolDefaults[SDRATTR_MEASURETEXTROTA90 -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASURETEXTROTA90, false);
+ mppLocalPoolDefaults[SDRATTR_MEASURETEXTUPSIDEDOWN -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASURETEXTUPSIDEDOWN, false);
+ mppLocalPoolDefaults[SDRATTR_MEASUREOVERHANG -SDRATTR_START]=new SdrMetricItem(SDRATTR_MEASUREOVERHANG, 600);
mppLocalPoolDefaults[SDRATTR_MEASUREUNIT -SDRATTR_START]=new SdrMeasureUnitItem;
- mppLocalPoolDefaults[SDRATTR_MEASURESCALE -SDRATTR_START]=new SdrMeasureScaleItem;
- mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT -SDRATTR_START]=new SdrMeasureShowUnitItem;
- mppLocalPoolDefaults[SDRATTR_MEASUREFORMATSTRING -SDRATTR_START]=new SdrMeasureFormatStringItem();
- mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE -SDRATTR_START]=new SdrMeasureTextAutoAngleItem();
- mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new SdrMeasureTextAutoAngleViewItem();
- mppLocalPoolDefaults[SDRATTR_MEASURETEXTISFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextIsFixedAngleItem();
- mppLocalPoolDefaults[SDRATTR_MEASURETEXTFIXEDANGLE -SDRATTR_START]=new SdrMeasureTextFixedAngleItem();
- mppLocalPoolDefaults[SDRATTR_MEASUREDECIMALPLACES -SDRATTR_START]=new SdrMeasureDecimalPlacesItem();
- mppLocalPoolDefaults[SDRATTR_CIRCKIND -SDRATTR_START]=new SdrCircKindItem;
- mppLocalPoolDefaults[SDRATTR_CIRCSTARTANGLE-SDRATTR_START]=new SdrCircStartAngleItem;
- mppLocalPoolDefaults[SDRATTR_CIRCENDANGLE -SDRATTR_START]=new SdrCircEndAngleItem;
- mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrObjMoveProtectItem;
- mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrObjSizeProtectItem;
- mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrObjPrintableItem;
- mppLocalPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrObjVisibleItem;
- mppLocalPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SdrLayerIdItem;
- mppLocalPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SdrLayerNameItem;
- mppLocalPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SdrObjectNameItem;
- mppLocalPoolDefaults[SDRATTR_ALLPOSITIONX -SDRATTR_START]=new SdrAllPositionXItem;
- mppLocalPoolDefaults[SDRATTR_ALLPOSITIONY -SDRATTR_START]=new SdrAllPositionYItem;
- mppLocalPoolDefaults[SDRATTR_ALLSIZEWIDTH -SDRATTR_START]=new SdrAllSizeWidthItem;
- mppLocalPoolDefaults[SDRATTR_ALLSIZEHEIGHT -SDRATTR_START]=new SdrAllSizeHeightItem;
- mppLocalPoolDefaults[SDRATTR_ONEPOSITIONX -SDRATTR_START]=new SdrOnePositionXItem;
- mppLocalPoolDefaults[SDRATTR_ONEPOSITIONY -SDRATTR_START]=new SdrOnePositionYItem;
- mppLocalPoolDefaults[SDRATTR_ONESIZEWIDTH -SDRATTR_START]=new SdrOneSizeWidthItem;
- mppLocalPoolDefaults[SDRATTR_ONESIZEHEIGHT -SDRATTR_START]=new SdrOneSizeHeightItem;
- mppLocalPoolDefaults[SDRATTR_LOGICSIZEWIDTH -SDRATTR_START]=new SdrLogicSizeWidthItem;
- mppLocalPoolDefaults[SDRATTR_LOGICSIZEHEIGHT-SDRATTR_START]=new SdrLogicSizeHeightItem;
- mppLocalPoolDefaults[SDRATTR_ROTATEANGLE -SDRATTR_START]=new SdrRotateAngleItem;
- mppLocalPoolDefaults[SDRATTR_SHEARANGLE -SDRATTR_START]=new SdrShearAngleItem;
- mppLocalPoolDefaults[SDRATTR_MOVEX -SDRATTR_START]=new SdrMoveXItem;
- mppLocalPoolDefaults[SDRATTR_MOVEY -SDRATTR_START]=new SdrMoveYItem;
- mppLocalPoolDefaults[SDRATTR_RESIZEXONE -SDRATTR_START]=new SdrResizeXOneItem;
- mppLocalPoolDefaults[SDRATTR_RESIZEYONE -SDRATTR_START]=new SdrResizeYOneItem;
- mppLocalPoolDefaults[SDRATTR_ROTATEONE -SDRATTR_START]=new SdrRotateOneItem;
- mppLocalPoolDefaults[SDRATTR_HORZSHEARONE -SDRATTR_START]=new SdrHorzShearOneItem;
- mppLocalPoolDefaults[SDRATTR_VERTSHEARONE -SDRATTR_START]=new SdrVertShearOneItem;
- mppLocalPoolDefaults[SDRATTR_RESIZEXALL -SDRATTR_START]=new SdrResizeXAllItem;
- mppLocalPoolDefaults[SDRATTR_RESIZEYALL -SDRATTR_START]=new SdrResizeYAllItem;
- mppLocalPoolDefaults[SDRATTR_ROTATEALL -SDRATTR_START]=new SdrRotateAllItem;
- mppLocalPoolDefaults[SDRATTR_HORZSHEARALL -SDRATTR_START]=new SdrHorzShearAllItem;
- mppLocalPoolDefaults[SDRATTR_VERTSHEARALL -SDRATTR_START]=new SdrVertShearAllItem;
- mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1X -SDRATTR_START]=new SdrTransformRef1XItem;
- mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1Y -SDRATTR_START]=new SdrTransformRef1YItem;
- mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2X -SDRATTR_START]=new SdrTransformRef2XItem;
- mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2Y -SDRATTR_START]=new SdrTransformRef2YItem;
+ mppLocalPoolDefaults[SDRATTR_MEASURESCALE -SDRATTR_START]=new SdrScaleItem(SDRATTR_MEASURESCALE, Fraction(1,1));
+ mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASURESHOWUNIT);
+ mppLocalPoolDefaults[SDRATTR_MEASUREFORMATSTRING -SDRATTR_START]=new SfxStringItem(SDRATTR_MEASUREFORMATSTRING, aEmptyStr);
+ mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASURETEXTAUTOANGLE, true);
+ mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new SdrAngleItem(SDRATTR_MEASURETEXTAUTOANGLEVIEW, 31500);
+ mppLocalPoolDefaults[SDRATTR_MEASURETEXTISFIXEDANGLE -SDRATTR_START]=new SdrYesNoItem(SDRATTR_MEASURETEXTISFIXEDANGLE, false);
+ mppLocalPoolDefaults[SDRATTR_MEASURETEXTFIXEDANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_MEASURETEXTFIXEDANGLE, 0);
+ mppLocalPoolDefaults[SDRATTR_MEASUREDECIMALPLACES -SDRATTR_START]=new SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES, 2);
+ mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJMOVEPROTECT, false);
+ mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJSIZEPROTECT, false);
+ mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJPRINTABLE, false);
+ mppLocalPoolDefaults[SDRATTR_OBJVISIBLE -SDRATTR_START]=new SdrYesNoItem(SDRATTR_OBJVISIBLE, true);
+ mppLocalPoolDefaults[SDRATTR_LAYERID -SDRATTR_START]=new SfxUInt16Item(SDRATTR_LAYERID);
+ mppLocalPoolDefaults[SDRATTR_LAYERNAME -SDRATTR_START]=new SfxStringItem(SDRATTR_LAYERNAME, aEmptyStr);
+ mppLocalPoolDefaults[SDRATTR_OBJECTNAME -SDRATTR_START]=new SfxStringItem(SDRATTR_OBJECTNAME, aEmptyStr);
+ mppLocalPoolDefaults[SDRATTR_ALLPOSITIONX -SDRATTR_START]=new SdrMetricItem(SDRATTR_ALLPOSITIONX, 0);
+ mppLocalPoolDefaults[SDRATTR_ALLPOSITIONY -SDRATTR_START]=new SdrMetricItem(SDRATTR_ALLPOSITIONY, 0);
+ mppLocalPoolDefaults[SDRATTR_ALLSIZEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_ALLSIZEWIDTH, 0);
+ mppLocalPoolDefaults[SDRATTR_ALLSIZEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_ALLSIZEHEIGHT, 0);
+ mppLocalPoolDefaults[SDRATTR_ONEPOSITIONX -SDRATTR_START]=new SdrMetricItem(SDRATTR_ONEPOSITIONX, 0);
+ mppLocalPoolDefaults[SDRATTR_ONEPOSITIONY -SDRATTR_START]=new SdrMetricItem(SDRATTR_ONEPOSITIONY, 0);
+ mppLocalPoolDefaults[SDRATTR_ONESIZEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_ONESIZEWIDTH, 0);
+ mppLocalPoolDefaults[SDRATTR_ONESIZEHEIGHT -SDRATTR_START]=new SdrMetricItem(SDRATTR_ONESIZEHEIGHT, 0);
+ mppLocalPoolDefaults[SDRATTR_LOGICSIZEWIDTH -SDRATTR_START]=new SdrMetricItem(SDRATTR_LOGICSIZEWIDTH, 0);
+ mppLocalPoolDefaults[SDRATTR_LOGICSIZEHEIGHT-SDRATTR_START]=new SdrMetricItem(SDRATTR_LOGICSIZEHEIGHT, 0);
+ mppLocalPoolDefaults[SDRATTR_ROTATEANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_ROTATEANGLE, 0);
+ mppLocalPoolDefaults[SDRATTR_SHEARANGLE -SDRATTR_START]=new SdrAngleItem(SDRATTR_SHEARANGLE, 0);
+ mppLocalPoolDefaults[SDRATTR_MOVEX -SDRATTR_START]=new SdrMetricItem(SDRATTR_MOVEX, 0);
+ mppLocalPoolDefaults[SDRATTR_MOVEY -SDRATTR_START]=new SdrMetricItem(SDRATTR_MOVEY, 0);
+ mppLocalPoolDefaults[SDRATTR_RESIZEXONE -SDRATTR_START]=new SdrFractionItem(SDRATTR_RESIZEXONE, Fraction(1,1));
+ mppLocalPoolDefaults[SDRATTR_RESIZEYONE -SDRATTR_START]=new SdrFractionItem(SDRATTR_RESIZEYONE, Fraction(1,1));
+ mppLocalPoolDefaults[SDRATTR_ROTATEONE -SDRATTR_START]=new SdrAngleItem(SDRATTR_ROTATEONE, 0);
+ mppLocalPoolDefaults[SDRATTR_HORZSHEARONE -SDRATTR_START]=new SdrAngleItem(SDRATTR_HORZSHEARONE, 0);
+ mppLocalPoolDefaults[SDRATTR_VERTSHEARONE -SDRATTR_START]=new SdrAngleItem(SDRATTR_VERTSHEARONE, 0);
+ mppLocalPoolDefaults[SDRATTR_RESIZEXALL -SDRATTR_START]=new SdrFractionItem(SDRATTR_RESIZEXALL, Fraction(1,1));
+ mppLocalPoolDefaults[SDRATTR_RESIZEYALL -SDRATTR_START]=new SdrFractionItem(SDRATTR_RESIZEYALL, Fraction(1,1));
+ mppLocalPoolDefaults[SDRATTR_ROTATEALL -SDRATTR_START]=new SdrAngleItem(SDRATTR_ROTATEALL, 0);
+ mppLocalPoolDefaults[SDRATTR_HORZSHEARALL -SDRATTR_START]=new SdrAngleItem(SDRATTR_HORZSHEARALL, 0);
+ mppLocalPoolDefaults[SDRATTR_VERTSHEARALL -SDRATTR_START]=new SdrAngleItem(SDRATTR_VERTSHEARALL, 0);
+ mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1X -SDRATTR_START]=new SdrMetricItem(SDRATTR_TRANSFORMREF1X, 0);
+ mppLocalPoolDefaults[SDRATTR_TRANSFORMREF1Y -SDRATTR_START]=new SdrMetricItem(SDRATTR_TRANSFORMREF1Y, 0);
+ mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2X -SDRATTR_START]=new SdrMetricItem(SDRATTR_TRANSFORMREF2X, 0);
+ mppLocalPoolDefaults[SDRATTR_TRANSFORMREF2Y -SDRATTR_START]=new SdrMetricItem(SDRATTR_TRANSFORMREF2Y, 0);
mppLocalPoolDefaults[SDRATTR_TEXTDIRECTION -SDRATTR_START]=new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION);
mppLocalPoolDefaults[ SDRATTR_GRAFRED - SDRATTR_START] = new SdrGrafRedItem;
mppLocalPoolDefaults[ SDRATTR_GRAFGREEN - SDRATTR_START] = new SdrGrafGreenItem;
@@ -228,25 +222,25 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[ SDRATTR_GRAFINVERT - SDRATTR_START] = new SdrGrafInvertItem;
mppLocalPoolDefaults[ SDRATTR_GRAFMODE - SDRATTR_START] = new SdrGrafModeItem;
mppLocalPoolDefaults[ SDRATTR_GRAFCROP - SDRATTR_START] = new SdrGrafCropItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new Svx3DPercentDiagonalItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new Svx3DBackscaleItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new Svx3DDepthItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new Svx3DHorizontalSegmentsItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new Svx3DVerticalSegmentsItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new Svx3DEndAngleItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new Svx3DDoubleSidedItem;
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, 10);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, 100);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, 1000);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, 24);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, 24);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, 3600);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, false);
mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_KIND - SDRATTR_START ] = new Svx3DNormalsKindItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new Svx3DNormalsInvertItem;
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT, false);
mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_X - SDRATTR_START ] = new Svx3DTextureProjectionXItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_PROJ_Y - SDRATTR_START ] = new Svx3DTextureProjectionYItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_SHADOW_3D - SDRATTR_START ] = new Svx3DShadow3DItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_COLOR - SDRATTR_START ] = new Svx3DMaterialColorItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_EMISSION - SDRATTR_START ] = new Svx3DMaterialEmissionItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR - SDRATTR_START ] = new Svx3DMaterialSpecularItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY - SDRATTR_START ] = new Svx3DMaterialSpecularIntensityItem;
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_SHADOW_3D - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D, false);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_COLOR - SDRATTR_START ] = new SvxColorItem(Color(0x0000b8ff), SDRATTR_3DOBJ_MAT_COLOR);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_EMISSION - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DOBJ_MAT_EMISSION);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR - SDRATTR_START ] = new SvxColorItem(Color(0x00ffffff), SDRATTR_3DOBJ_MAT_SPECULAR);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, 15);
mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_KIND - SDRATTR_START ] = new Svx3DTextureKindItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_MODE - SDRATTR_START ] = new Svx3DTextureModeItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_FILTER - SDRATTR_START ] = new Svx3DTextureFilterItem;
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_TEXTURE_FILTER - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER, false);
mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_NORMALS - SDRATTR_START ] = new Svx3DSmoothNormalsItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_SMOOTH_LIDS - SDRATTR_START ] = new Svx3DSmoothLidsItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_CHARACTER_MODE - SDRATTR_START ] = new Svx3DCharacterModeItem;
@@ -254,40 +248,40 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_BACK - SDRATTR_START ] = new Svx3DCloseBackItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY - SDRATTR_START ] = new Svx3DReducedLineGeometryItem;
mppLocalPoolDefaults[ SDRATTR_3DSCENE_PERSPECTIVE - SDRATTR_START ] = new Svx3DPerspectiveItem;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new Svx3DDistanceItem;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new Svx3DFocalLengthItem;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new Svx3DTwoSidedLightingItem;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new Svx3DLightcolor1Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new Svx3DLightcolor2Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_3 - SDRATTR_START ] = new Svx3DLightcolor3Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_4 - SDRATTR_START ] = new Svx3DLightcolor4Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_5 - SDRATTR_START ] = new Svx3DLightcolor5Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_6 - SDRATTR_START ] = new Svx3DLightcolor6Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_7 - SDRATTR_START ] = new Svx3DLightcolor7Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_8 - SDRATTR_START ] = new Svx3DLightcolor8Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_AMBIENTCOLOR - SDRATTR_START ] = new Svx3DAmbientcolorItem;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_1 - SDRATTR_START ] = new Svx3DLightOnOff1Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_2 - SDRATTR_START ] = new Svx3DLightOnOff2Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_3 - SDRATTR_START ] = new Svx3DLightOnOff3Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_4 - SDRATTR_START ] = new Svx3DLightOnOff4Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_5 - SDRATTR_START ] = new Svx3DLightOnOff5Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new Svx3DLightOnOff6Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new Svx3DLightOnOff7Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new Svx3DLightOnOff8Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new Svx3DLightDirection1Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new Svx3DLightDirection2Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new Svx3DLightDirection3Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new Svx3DLightDirection4Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new Svx3DLightDirection5Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new Svx3DLightDirection6Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new Svx3DLightDirection7Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new Svx3DLightDirection8Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new Svx3DShadowSlantItem;
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, 100);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, 100);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new SvxColorItem(Color(0xffcccccc), SDRATTR_3DSCENE_LIGHTCOLOR_1);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_2);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_3 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_3);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_4 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_4);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_5 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_5);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_6 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_6);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_7 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_7);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_8 - SDRATTR_START ] = new SvxColorItem(Color(0x00000000), SDRATTR_3DSCENE_LIGHTCOLOR_8);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_AMBIENTCOLOR - SDRATTR_START ] = new SvxColorItem(Color(0x00666666), SDRATTR_3DSCENE_AMBIENTCOLOR);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_1 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, true);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_2 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_3 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_4 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_5 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, false);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, basegfx::B3DVector(0.57735026918963, 0.57735026918963, 0.57735026918963));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, 0);
mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADE_MODE - SDRATTR_START ] = new Svx3DShadeModeItem;
- mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SdrCustomShapeEngineItem;
- mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_DATA - SDRATTR_START ] = new SdrCustomShapeDataItem;
+ mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SfxStringItem( SDRATTR_CUSTOMSHAPE_ENGINE, aEmptyStr );
+ mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_DATA - SDRATTR_START ] = new SfxStringItem( SDRATTR_CUSTOMSHAPE_DATA, aEmptyStr );
mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_GEOMETRY - SDRATTR_START ] = new SdrCustomShapeGeometryItem;
- mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL - SDRATTR_START ] = new SdrCustomShapeReplacementURLItem;
+ mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL - SDRATTR_START ] = new SfxStringItem( SDRATTR_CUSTOMSHAPE_REPLACEMENT_URL, aEmptyStr );
SvxBoxItem* pboxItem = new SvxBoxItem( SDRATTR_TABLE_BORDER );
pboxItem->SetDistance( 100 );
@@ -375,13 +369,15 @@ SdrItemPool::~SdrItemPool()
}
SfxItemPresentation __EXPORT SdrItemPool::GetPresentation(
- const SfxPoolItem& rItem, SfxItemPresentation ePresentation,
- SfxMapUnit ePresentationMetric, XubString& rText,
- const IntlWrapper * pIntlWrapper) const
+ const SfxPoolItem& rItem, SfxItemPresentation ePresentation,
+ SfxMapUnit ePresentationMetric, XubString& rText,
+ const IntlWrapper * pIntlWrapper) const
{
- if (!IsInvalidItem(&rItem)) {
+ if (!IsInvalidItem(&rItem))
+ {
sal_uInt16 nWhich=rItem.Which();
- if (nWhich>=SDRATTR_SHADOW_FIRST && nWhich<=SDRATTR_END) {
+ if (nWhich>=SDRATTR_SHADOW_FIRST && nWhich<=SDRATTR_END)
+ {
rItem.GetPresentation(SFX_ITEM_PRESENTATION_NAMELESS,
GetMetric(nWhich),ePresentationMetric,rText,
pIntlWrapper);
@@ -394,6 +390,7 @@ SfxItemPresentation __EXPORT SdrItemPool::GetPresentation(
return ePresentation;
}
}
+
return XOutdevItemPool::GetPresentation(rItem,ePresentation,ePresentationMetric,rText,pIntlWrapper);
}
@@ -536,10 +533,6 @@ void SdrItemPool::TakeItemName(sal_uInt16 nWhich, String& rItemName)
case SDRATTR_MEASURETEXTFIXEDANGLE : nResId = SIP_SA_MEASURETEXTFIXEDANGLE;break;
case SDRATTR_MEASUREDECIMALPLACES : nResId = SIP_SA_MEASUREDECIMALPLACES;break;
- case SDRATTR_CIRCKIND : nResId = SIP_SA_CIRCKIND;break;
- case SDRATTR_CIRCSTARTANGLE: nResId = SIP_SA_CIRCSTARTANGLE;break;
- case SDRATTR_CIRCENDANGLE : nResId = SIP_SA_CIRCENDANGLE;break;
-
case SDRATTR_OBJMOVEPROTECT : nResId = SIP_SA_OBJMOVEPROTECT;break;
case SDRATTR_OBJSIZEPROTECT : nResId = SIP_SA_OBJSIZEPROTECT;break;
case SDRATTR_OBJPRINTABLE : nResId = SIP_SA_OBJPRINTABLE;break;
@@ -626,8 +619,6 @@ void SdrItemPool::TakeItemName(sal_uInt16 nWhich, String& rItemName)
// FractionItem
////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1_AUTOFACTORY(SdrFractionItem,SfxPoolItem);
-
SdrFractionItem::SdrFractionItem(sal_uInt16 nId, SvStream& rIn):
SfxPoolItem(nId)
{
@@ -640,7 +631,7 @@ SdrFractionItem::SdrFractionItem(sal_uInt16 nId, SvStream& rIn):
int __EXPORT SdrFractionItem::operator==(const SfxPoolItem& rCmp) const
{
return SfxPoolItem::operator==(rCmp) &&
- ((SdrFractionItem&)rCmp).GetValue()==nValue;
+ ((SdrFractionItem&)rCmp).GetValue()==nValue;
}
SfxItemPresentation __EXPORT SdrFractionItem::GetPresentation(
@@ -705,8 +696,6 @@ int __EXPORT SdrFractionItem::IsPoolable() const
// ScaleItem
////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1_AUTOFACTORY(SdrScaleItem,SdrFractionItem);
-
SfxItemPresentation __EXPORT SdrScaleItem::GetPresentation(
SfxItemPresentation ePresentation, SfxMapUnit /*eCoreMetric*/,
SfxMapUnit /*ePresentationMetric*/, XubString &rText, const IntlWrapper *) const
@@ -751,7 +740,7 @@ SfxPoolItem* __EXPORT SdrScaleItem::Clone(SfxItemPool * /*pPool*/) const
// OnOffItem
////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1_AUTOFACTORY(SdrOnOffItem,SfxBoolItem);
+IMPL_POOLITEM_FACTORY(SdrOnOffItem)
SfxPoolItem* __EXPORT SdrOnOffItem::Clone(SfxItemPool* /*pPool*/) const
{
@@ -791,8 +780,6 @@ int __EXPORT SdrOnOffItem::IsPoolable() const
}
#endif
-TYPEINIT1_AUTOFACTORY(SdrYesNoItem,SfxBoolItem);
-
SfxPoolItem* __EXPORT SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const
{
return new SdrYesNoItem(Which(),GetValue());
@@ -813,7 +800,8 @@ SfxItemPresentation __EXPORT SdrYesNoItem::GetPresentation(SfxItemPresentation e
SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByVal(GetValue());
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
@@ -835,8 +823,6 @@ int __EXPORT SdrYesNoItem::IsPoolable() const
// class SdrPercentItem
//------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SdrPercentItem,SfxUInt16Item);
-
SfxPoolItem* __EXPORT SdrPercentItem::Clone(SfxItemPool* /*pPool*/) const
{
return new SdrPercentItem(Which(),GetValue());
@@ -878,8 +864,6 @@ int __EXPORT SdrPercentItem::IsPoolable() const
// class SdrAngleItem
//------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SdrAngleItem,SfxInt32Item);
-
SfxPoolItem* __EXPORT SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const
{
return new SdrAngleItem(Which(),GetValue());
@@ -975,8 +959,6 @@ int __EXPORT SdrAngleItem::IsPoolable() const
// class SdrMetricItem
//------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY(SdrMetricItem,SfxInt32Item);
-
SfxPoolItem* __EXPORT SdrMetricItem::Clone(SfxItemPool* /*pPool*/) const
{
return new SdrMetricItem(Which(),GetValue());
@@ -987,21 +969,21 @@ SfxPoolItem* __EXPORT SdrMetricItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/)
return new SdrMetricItem(Which(),rIn);
}
-FASTBOOL __EXPORT SdrMetricItem::HasMetrics() const
+bool __EXPORT SdrMetricItem::HasMetrics() const
{
- return sal_True;
+ return true;
}
-FASTBOOL __EXPORT SdrMetricItem::ScaleMetrics(long nMul, long nDiv)
+void __EXPORT SdrMetricItem::ScaleMetrics(long nMul, long nDiv)
{
- if (GetValue()!=0) {
+ if (GetValue()!=0)
+ {
BigInt aVal(GetValue());
aVal*=nMul;
aVal+=nDiv/2; // fuer korrektes Runden
aVal/=nDiv;
SetValue(long(aVal));
}
- return sal_True;
}
SfxItemPresentation __EXPORT SdrMetricItem::GetPresentation(SfxItemPresentation ePres,
@@ -1013,7 +995,9 @@ SfxItemPresentation __EXPORT SdrMetricItem::GetPresentation(SfxItemPresentation
String aStr;
aFmt.TakeUnitStr((MapUnit)ePresMetric,aStr);
rText+=aStr;
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr2;
SdrItemPool::TakeItemName(Which(), aStr2);
@@ -1035,13 +1019,20 @@ int __EXPORT SdrMetricItem::IsPoolable() const
// Items des Legendenobjekts
////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1_AUTOFACTORY(SdrCaptionTypeItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrCaptionTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionTypeItem(*this); }
+SfxPoolItem* __EXPORT SdrCaptionTypeItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrCaptionTypeItem(*this);
+}
-SfxPoolItem* __EXPORT SdrCaptionTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCaptionTypeItem(rIn); }
+SfxPoolItem* __EXPORT SdrCaptionTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrCaptionTypeItem(rIn);
+}
-sal_uInt16 __EXPORT SdrCaptionTypeItem::GetValueCount() const { return 4; }
+sal_uInt16 __EXPORT SdrCaptionTypeItem::GetValueCount() const
+{
+ return 4;
+}
XubString __EXPORT SdrCaptionTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1049,10 +1040,12 @@ XubString __EXPORT SdrCaptionTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
}
SfxItemPresentation __EXPORT SdrCaptionTypeItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
@@ -1062,13 +1055,20 @@ SfxItemPresentation __EXPORT SdrCaptionTypeItem::GetPresentation(SfxItemPresenta
return ePres;
}
-TYPEINIT1_AUTOFACTORY(SdrCaptionEscDirItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCaptionEscDirItem(*this); }
+SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrCaptionEscDirItem(*this);
+}
-SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCaptionEscDirItem(rIn); }
+SfxPoolItem* __EXPORT SdrCaptionEscDirItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrCaptionEscDirItem(rIn);
+}
-sal_uInt16 __EXPORT SdrCaptionEscDirItem::GetValueCount() const { return 3; }
+sal_uInt16 __EXPORT SdrCaptionEscDirItem::GetValueCount() const
+{
+ return 3;
+}
XubString __EXPORT SdrCaptionEscDirItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1076,7 +1076,7 @@ XubString __EXPORT SdrCaptionEscDirItem::GetValueTextByPos(sal_uInt16 nPos) cons
}
SfxItemPresentation __EXPORT SdrCaptionEscDirItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
@@ -1094,13 +1094,22 @@ SfxItemPresentation __EXPORT SdrCaptionEscDirItem::GetPresentation(SfxItemPresen
////////////////////////////////////////////////////////////////////////////////
// FitToSize
-TYPEINIT1_AUTOFACTORY(SdrTextFitToSizeTypeItem,SfxEnumItem);
+IMPL_POOLITEM_FACTORY(SdrTextFitToSizeTypeItem)
-SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextFitToSizeTypeItem(*this); }
+SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrTextFitToSizeTypeItem(*this);
+}
-SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextFitToSizeTypeItem(rIn); }
+SfxPoolItem* __EXPORT SdrTextFitToSizeTypeItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrTextFitToSizeTypeItem(rIn);
+}
-sal_uInt16 __EXPORT SdrTextFitToSizeTypeItem::GetValueCount() const { return 4; }
+sal_uInt16 __EXPORT SdrTextFitToSizeTypeItem::GetValueCount() const
+{
+ return 4;
+}
XubString __EXPORT SdrTextFitToSizeTypeItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1108,10 +1117,12 @@ XubString __EXPORT SdrTextFitToSizeTypeItem::GetValueTextByPos(sal_uInt16 nPos)
}
SfxItemPresentation __EXPORT SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
@@ -1121,11 +1132,20 @@ SfxItemPresentation __EXPORT SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPr
return ePres;
}
-int __EXPORT SdrTextFitToSizeTypeItem::HasBoolValue() const { return sal_True; }
+int __EXPORT SdrTextFitToSizeTypeItem::HasBoolValue() const
+{
+ return sal_True;
+}
-sal_Bool __EXPORT SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue()!=SDRTEXTFIT_NONE; }
+sal_Bool __EXPORT SdrTextFitToSizeTypeItem::GetBoolValue() const
+{
+ return GetValue()!=SDRTEXTFIT_NONE;
+}
-void __EXPORT SdrTextFitToSizeTypeItem::SetBoolValue(sal_Bool bVal) { SetValue(sal::static_int_cast< sal_uInt16 >(bVal ? SDRTEXTFIT_PROPORTIONAL : SDRTEXTFIT_NONE)); }
+void __EXPORT SdrTextFitToSizeTypeItem::SetBoolValue(sal_Bool bVal)
+{
+ SetValue(sal::static_int_cast< sal_uInt16 >(bVal ? SDRTEXTFIT_PROPORTIONAL : SDRTEXTFIT_NONE));
+}
sal_Bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
@@ -1138,6 +1158,7 @@ sal_Bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemb
sal_Bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::TextFitToSizeType eFS;
+
if(!(rVal >>= eFS))
{
sal_Int32 nEnum = 0;
@@ -1152,13 +1173,20 @@ sal_Bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*n
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrTextVertAdjustItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextVertAdjustItem(*this); }
+SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrTextVertAdjustItem(*this);
+}
-SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextVertAdjustItem(rIn); }
+SfxPoolItem* __EXPORT SdrTextVertAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrTextVertAdjustItem(rIn);
+}
-sal_uInt16 __EXPORT SdrTextVertAdjustItem::GetValueCount() const { return 5; }
+sal_uInt16 __EXPORT SdrTextVertAdjustItem::GetValueCount() const
+{
+ return 5;
+}
XubString __EXPORT SdrTextVertAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1166,16 +1194,19 @@ XubString __EXPORT SdrTextVertAdjustItem::GetValueTextByPos(sal_uInt16 nPos) con
}
SfxItemPresentation __EXPORT SdrTextVertAdjustItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -1188,6 +1219,7 @@ sal_Bool SdrTextVertAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberI
sal_Bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::TextVerticalAdjust eAdj;
+
if(!(rVal >>= eAdj))
{
sal_Int32 nEnum = 0;
@@ -1202,13 +1234,20 @@ sal_Bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMem
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrTextHorzAdjustItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextHorzAdjustItem(*this); }
+SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrTextHorzAdjustItem(*this);
+}
-SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextHorzAdjustItem(rIn); }
+SfxPoolItem* __EXPORT SdrTextHorzAdjustItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrTextHorzAdjustItem(rIn);
+}
-sal_uInt16 __EXPORT SdrTextHorzAdjustItem::GetValueCount() const { return 5; }
+sal_uInt16 __EXPORT SdrTextHorzAdjustItem::GetValueCount() const
+{
+ return 5;
+}
XubString __EXPORT SdrTextHorzAdjustItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1216,16 +1255,19 @@ XubString __EXPORT SdrTextHorzAdjustItem::GetValueTextByPos(sal_uInt16 nPos) con
}
SfxItemPresentation __EXPORT SdrTextHorzAdjustItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -1238,6 +1280,7 @@ sal_Bool SdrTextHorzAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberI
sal_Bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::TextHorizontalAdjust eAdj;
+
if(!(rVal >>= eAdj))
{
sal_Int32 nEnum = 0;
@@ -1252,13 +1295,20 @@ sal_Bool SdrTextHorzAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMem
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrTextAniKindItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrTextAniKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniKindItem(*this); }
+SfxPoolItem* __EXPORT SdrTextAniKindItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrTextAniKindItem(*this);
+}
-SfxPoolItem* __EXPORT SdrTextAniKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniKindItem(rIn); }
+SfxPoolItem* __EXPORT SdrTextAniKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrTextAniKindItem(rIn);
+}
-sal_uInt16 __EXPORT SdrTextAniKindItem::GetValueCount() const { return 5; }
+sal_uInt16 __EXPORT SdrTextAniKindItem::GetValueCount() const
+{
+ return 5;
+}
XubString __EXPORT SdrTextAniKindItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1266,16 +1316,19 @@ XubString __EXPORT SdrTextAniKindItem::GetValueTextByPos(sal_uInt16 nPos) const
}
SfxItemPresentation __EXPORT SdrTextAniKindItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -1288,6 +1341,7 @@ sal_Bool SdrTextAniKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/
sal_Bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::TextAnimationKind eKind;
+
if(!(rVal >>= eKind))
{
sal_Int32 nEnum = 0;
@@ -1301,13 +1355,20 @@ sal_Bool SdrTextAniKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrTextAniDirectionItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDirectionItem(*this); }
+SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrTextAniDirectionItem(*this);
+}
-SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniDirectionItem(rIn); }
+SfxPoolItem* __EXPORT SdrTextAniDirectionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrTextAniDirectionItem(rIn);
+}
-sal_uInt16 __EXPORT SdrTextAniDirectionItem::GetValueCount() const { return 4; }
+sal_uInt16 __EXPORT SdrTextAniDirectionItem::GetValueCount() const
+{
+ return 4;
+}
XubString __EXPORT SdrTextAniDirectionItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1315,16 +1376,19 @@ XubString __EXPORT SdrTextAniDirectionItem::GetValueTextByPos(sal_uInt16 nPos) c
}
SfxItemPresentation __EXPORT SdrTextAniDirectionItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -1337,6 +1401,7 @@ sal_Bool SdrTextAniDirectionItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMembe
sal_Bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::TextAnimationDirection eDir;
+
if(!(rVal >>= eDir))
{
sal_Int32 nEnum = 0;
@@ -1351,11 +1416,15 @@ sal_Bool SdrTextAniDirectionItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nM
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrTextAniDelayItem,SfxUInt16Item);
-
-SfxPoolItem* __EXPORT SdrTextAniDelayItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniDelayItem(*this); }
+SfxPoolItem* __EXPORT SdrTextAniDelayItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrTextAniDelayItem(*this);
+}
-SfxPoolItem* __EXPORT SdrTextAniDelayItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniDelayItem(rIn); }
+SfxPoolItem* __EXPORT SdrTextAniDelayItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrTextAniDelayItem(rIn);
+}
SfxItemPresentation __EXPORT SdrTextAniDelayItem::GetPresentation(
SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
@@ -1377,27 +1446,31 @@ SfxItemPresentation __EXPORT SdrTextAniDelayItem::GetPresentation(
return ePres;
}
-TYPEINIT1_AUTOFACTORY(SdrTextAniAmountItem,SfxInt16Item);
-
-SfxPoolItem* __EXPORT SdrTextAniAmountItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextAniAmountItem(*this); }
+SfxPoolItem* __EXPORT SdrTextAniAmountItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrTextAniAmountItem(*this);
+}
-SfxPoolItem* __EXPORT SdrTextAniAmountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrTextAniAmountItem(rIn); }
+SfxPoolItem* __EXPORT SdrTextAniAmountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrTextAniAmountItem(rIn);
+}
-FASTBOOL __EXPORT SdrTextAniAmountItem::HasMetrics() const
+bool __EXPORT SdrTextAniAmountItem::HasMetrics() const
{
return GetValue()>0;
}
-FASTBOOL __EXPORT SdrTextAniAmountItem::ScaleMetrics(long nMul, long nDiv)
+void __EXPORT SdrTextAniAmountItem::ScaleMetrics(long nMul, long nDiv)
{
- if (GetValue()>0) {
+ if (GetValue()>0)
+ {
BigInt aVal(GetValue());
aVal*=nMul;
aVal+=nDiv/2; // fuer korrektes Runden
aVal/=nDiv;
SetValue(short(aVal));
- return sal_True;
- } else return sal_False;
+ }
}
SfxItemPresentation __EXPORT SdrTextAniAmountItem::GetPresentation(
@@ -1438,11 +1511,11 @@ SfxItemPresentation __EXPORT SdrTextAniAmountItem::GetPresentation(
return ePres;
}
-TYPEINIT1_AUTOFACTORY( SdrTextFixedCellHeightItem, SfxBoolItem );
SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( sal_Bool bUseFixedCellHeight )
: SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight )
{
}
+
SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( SvStream & rStream, sal_uInt16 nVersion )
: SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, sal_False )
{
@@ -1453,11 +1526,13 @@ SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( SvStream & rStream, sal_
SetValue( bValue );
}
}
+
SfxItemPresentation __EXPORT SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresentationMetric*/,
- String &rText, const IntlWrapper * ) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresentationMetric*/,
+ String &rText, const IntlWrapper * ) const
{
rText = GetValueTextByVal( GetValue() );
+
if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
{
String aStr;
@@ -1467,10 +1542,12 @@ SfxItemPresentation __EXPORT SdrTextFixedCellHeightItem::GetPresentation( SfxIte
}
return ePres;
}
+
SfxPoolItem* __EXPORT SdrTextFixedCellHeightItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
{
return new SdrTextFixedCellHeightItem( rIn, nItemVersion );
}
+
SvStream& __EXPORT SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
{
if ( nItemVersion )
@@ -1480,20 +1557,24 @@ SvStream& __EXPORT SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16
}
return rOut;
}
+
SfxPoolItem* __EXPORT SdrTextFixedCellHeightItem::Clone( SfxItemPool * /*pPool*/) const
{
return new SdrTextFixedCellHeightItem( GetValue() );
}
+
sal_uInt16 SdrTextFixedCellHeightItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
{
return 1;
}
+
sal_Bool SdrTextFixedCellHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
sal_Bool bValue = (sal_Bool)GetValue();
rVal <<= bValue;
return sal_True;
}
+
sal_Bool SdrTextFixedCellHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Bool bValue = sal_Bool();
@@ -1502,6 +1583,7 @@ sal_Bool SdrTextFixedCellHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 /
SetValue( bValue );
return sal_True;
}
+
#ifdef SDR_ISPOOLABLE
int __EXPORT SdrTextFixedCellHeightItem::IsPoolable() const
{
@@ -1510,8 +1592,6 @@ int __EXPORT SdrTextFixedCellHeightItem::IsPoolable() const
}
#endif
-TYPEINIT1_AUTOFACTORY( SdrCustomShapeAdjustmentItem, SfxPoolItem );
-
SdrCustomShapeAdjustmentItem::SdrCustomShapeAdjustmentItem() : SfxPoolItem( SDRATTR_CUSTOMSHAPE_ADJUSTMENT )
{
}
@@ -1542,6 +1622,7 @@ SdrCustomShapeAdjustmentItem::~SdrCustomShapeAdjustmentItem()
int __EXPORT SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp ) const
{
int bRet = SfxPoolItem::operator==( rCmp );
+
if ( bRet )
{
bRet = ((SdrCustomShapeAdjustmentItem&)rCmp).GetCount() == GetCount();
@@ -1558,6 +1639,7 @@ int __EXPORT SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp )
}
}
}
+
return bRet;
}
@@ -1567,11 +1649,13 @@ SfxItemPresentation __EXPORT SdrCustomShapeAdjustmentItem::GetPresentation(
{
sal_uInt32 i, nCount = GetCount();
rText.Append( UniString::CreateFromInt32( nCount ) );
+
for ( i = 0; i < nCount; i++ )
{
rText += sal_Unicode( ' ' );
rText.Append( UniString::CreateFromInt32( GetValue( i ).nValue ) );
}
+
if ( ePresentation == SFX_ITEM_PRESENTATION_COMPLETE )
{
XubString aStr;
@@ -1580,6 +1664,7 @@ SfxItemPresentation __EXPORT SdrCustomShapeAdjustmentItem::GetPresentation(
aStr += sal_Unicode( ' ' );
rText.Insert( aStr, 0 );
}
+
return ePresentation;
}
@@ -1594,9 +1679,11 @@ SvStream& __EXPORT SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt
{
sal_uInt32 i, nCount = GetCount();
rOut << nCount;
+
for ( i = 0; i < nCount; i++ )
rOut << GetValue( i ).nValue;
}
+
return rOut;
}
@@ -1604,11 +1691,13 @@ SfxPoolItem* __EXPORT SdrCustomShapeAdjustmentItem::Clone( SfxItemPool * /*pPool
{
sal_uInt32 i;
SdrCustomShapeAdjustmentItem* pItem = new SdrCustomShapeAdjustmentItem;
+
for ( i = 0; i < GetCount(); i++ )
{
const SdrCustomShapeAdjustmentValue& rVal = GetValue( i );
pItem->SetValue( i, rVal );
}
+
return pItem;
}
@@ -1632,11 +1721,13 @@ const SdrCustomShapeAdjustmentValue& SdrCustomShapeAdjustmentItem::GetValue( sal
void SdrCustomShapeAdjustmentItem::SetValue( sal_uInt32 nIndex, const SdrCustomShapeAdjustmentValue& rVal )
{
sal_uInt32 i;
+
for ( i = GetCount(); i <= nIndex; i++ )
{
SdrCustomShapeAdjustmentValue* pItem = new SdrCustomShapeAdjustmentValue;
aAdjustmentValueList.Insert( pItem, LIST_APPEND );
}
+
SdrCustomShapeAdjustmentValue& rValue = *(SdrCustomShapeAdjustmentValue*)aAdjustmentValueList.GetObject( nIndex );
rValue.nValue = rVal.nValue;
}
@@ -1650,12 +1741,14 @@ sal_Bool SdrCustomShapeAdjustmentItem::QueryValue( uno::Any& rVal, sal_uInt8 /*n
{
sal_uInt32 i, nCount = GetCount();
uno::Sequence< sal_Int32 > aSequence( nCount );
+
if ( nCount )
{
sal_Int32* pPtr = aSequence.getArray();
for ( i = 0; i < nCount; i++ )
*pPtr++ = GetValue( i ).nValue;
}
+
rVal <<= aSequence;
return sal_True;
}
@@ -1663,14 +1756,17 @@ sal_Bool SdrCustomShapeAdjustmentItem::QueryValue( uno::Any& rVal, sal_uInt8 /*n
sal_Bool SdrCustomShapeAdjustmentItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
uno::Sequence< sal_Int32 > aSequence;
+
if( !( rVal >>= aSequence ) )
return sal_False;
void* pPtr;
+
for ( pPtr = aAdjustmentValueList.First(); pPtr; pPtr = aAdjustmentValueList.Next() )
delete (SdrCustomShapeAdjustmentValue*)pPtr;
sal_uInt32 i, nCount = aSequence.getLength();
+
if ( nCount )
{
const sal_Int32* pPtr2 = aSequence.getConstArray();
@@ -1681,6 +1777,7 @@ sal_Bool SdrCustomShapeAdjustmentItem::PutValue( const uno::Any& rVal, sal_uInt8
aAdjustmentValueList.Insert( pItem, LIST_APPEND );
}
}
+
return sal_True;
}
@@ -1690,13 +1787,20 @@ sal_Bool SdrCustomShapeAdjustmentItem::PutValue( const uno::Any& rVal, sal_uInt8
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// EdgeKind
-TYPEINIT1_AUTOFACTORY(SdrEdgeKindItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrEdgeKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrEdgeKindItem(*this); }
+SfxPoolItem* __EXPORT SdrEdgeKindItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeKindItem(*this);
+}
-SfxPoolItem* __EXPORT SdrEdgeKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrEdgeKindItem(rIn); }
+SfxPoolItem* __EXPORT SdrEdgeKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrEdgeKindItem(rIn);
+}
-sal_uInt16 __EXPORT SdrEdgeKindItem::GetValueCount() const { return 4; }
+sal_uInt16 __EXPORT SdrEdgeKindItem::GetValueCount() const
+{
+ return 4;
+}
XubString __EXPORT SdrEdgeKindItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1704,16 +1808,19 @@ XubString __EXPORT SdrEdgeKindItem::GetValueTextByPos(sal_uInt16 nPos) const
}
SfxItemPresentation __EXPORT SdrEdgeKindItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -1740,6 +1847,7 @@ sal_Bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) c
sal_Bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::ConnectorType eCT;
+
if(!(rVal >>= eCT))
{
sal_Int32 nEnum = 0;
@@ -1750,6 +1858,7 @@ sal_Bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*
}
SdrEdgeKind eEK = SDREDGE_ORTHOLINES;
+
switch( eCT )
{
case drawing::ConnectorType_STANDARD : eEK = SDREDGE_ORTHOLINES; break;
@@ -1759,6 +1868,7 @@ sal_Bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*
default:
DBG_ERROR( "SdrEdgeKindItem::PuValue : unknown enum" );
}
+
SetValue( sal::static_int_cast< sal_uInt16 >( eEK ) );
return sal_True;
@@ -1780,6 +1890,11 @@ sal_Bool SdrEdgeNode1HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*n
return sal_True;
}
+SfxPoolItem* SdrEdgeNode1HorzDistItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeNode1HorzDistItem(GetValue());
+}
+
sal_Bool SdrEdgeNode1VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
rVal <<= (sal_Int32)GetValue();
@@ -1789,6 +1904,7 @@ sal_Bool SdrEdgeNode1VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemb
sal_Bool SdrEdgeNode1VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Int32 nValue = 0;
+
if(!(rVal >>= nValue))
return sal_False;
@@ -1796,6 +1912,11 @@ sal_Bool SdrEdgeNode1VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*n
return sal_True;
}
+SfxPoolItem* SdrEdgeNode1VertDistItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeNode1VertDistItem(GetValue());
+}
+
sal_Bool SdrEdgeNode2HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
rVal <<= (sal_Int32)GetValue();
@@ -1805,6 +1926,7 @@ sal_Bool SdrEdgeNode2HorzDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemb
sal_Bool SdrEdgeNode2HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Int32 nValue = 0;
+
if(!(rVal >>= nValue))
return sal_False;
@@ -1812,6 +1934,11 @@ sal_Bool SdrEdgeNode2HorzDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*n
return sal_True;
}
+SfxPoolItem* SdrEdgeNode2HorzDistItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeNode2HorzDistItem(GetValue());
+}
+
sal_Bool SdrEdgeNode2VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
rVal <<= (sal_Int32)GetValue();
@@ -1821,6 +1948,7 @@ sal_Bool SdrEdgeNode2VertDistItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemb
sal_Bool SdrEdgeNode2VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Int32 nValue = 0;
+
if(!(rVal >>= nValue))
return sal_False;
@@ -1828,6 +1956,11 @@ sal_Bool SdrEdgeNode2VertDistItem::PutValue( const uno::Any& rVal, sal_uInt8 /*n
return sal_True;
}
+SfxPoolItem* SdrEdgeNode2VertDistItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeNode2VertDistItem(GetValue());
+}
+
sal_Bool SdrEdgeLine1DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
rVal <<= (sal_Int32)GetValue();
@@ -1837,6 +1970,7 @@ sal_Bool SdrEdgeLine1DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberI
sal_Bool SdrEdgeLine1DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Int32 nValue = 0;
+
if(!(rVal >>= nValue))
return sal_False;
@@ -1844,6 +1978,11 @@ sal_Bool SdrEdgeLine1DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMem
return sal_True;
}
+SfxPoolItem* SdrEdgeLine1DeltaItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeLine1DeltaItem(GetValue());
+}
+
sal_Bool SdrEdgeLine2DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
rVal <<= (sal_Int32)GetValue();
@@ -1853,6 +1992,7 @@ sal_Bool SdrEdgeLine2DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberI
sal_Bool SdrEdgeLine2DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Int32 nValue = 0;
+
if(!(rVal >>= nValue))
return sal_False;
@@ -1860,6 +2000,11 @@ sal_Bool SdrEdgeLine2DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMem
return sal_True;
}
+SfxPoolItem* SdrEdgeLine2DeltaItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeLine2DeltaItem(GetValue());
+}
+
sal_Bool SdrEdgeLine3DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
{
rVal <<= (sal_Int32)GetValue();
@@ -1869,6 +2014,7 @@ sal_Bool SdrEdgeLine3DeltaItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberI
sal_Bool SdrEdgeLine3DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Int32 nValue = 0;
+
if(!(rVal >>= nValue))
return sal_False;
@@ -1876,18 +2022,30 @@ sal_Bool SdrEdgeLine3DeltaItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMem
return sal_True;
}
+SfxPoolItem* SdrEdgeLine3DeltaItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrEdgeLine3DeltaItem(GetValue());
+}
+
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Measure
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// MeasureKind
-TYPEINIT1_AUTOFACTORY(SdrMeasureKindItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrMeasureKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureKindItem(*this); }
+SfxPoolItem* __EXPORT SdrMeasureKindItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrMeasureKindItem(*this);
+}
-SfxPoolItem* __EXPORT SdrMeasureKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureKindItem(rIn); }
+SfxPoolItem* __EXPORT SdrMeasureKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrMeasureKindItem(rIn);
+}
-sal_uInt16 __EXPORT SdrMeasureKindItem::GetValueCount() const { return 2; }
+sal_uInt16 __EXPORT SdrMeasureKindItem::GetValueCount() const
+{
+ return 2;
+}
XubString __EXPORT SdrMeasureKindItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1895,16 +2053,19 @@ XubString __EXPORT SdrMeasureKindItem::GetValueTextByPos(sal_uInt16 nPos) const
}
SfxItemPresentation __EXPORT SdrMeasureKindItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -1917,6 +2078,7 @@ sal_Bool SdrMeasureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/
sal_Bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::MeasureKind eKind;
+
if(!(rVal >>= eKind))
{
sal_Int32 nEnum = 0;
@@ -1930,13 +2092,20 @@ sal_Bool SdrMeasureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrMeasureTextHPosItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextHPosItem(*this); }
+SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrMeasureTextHPosItem(*this);
+}
-SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureTextHPosItem(rIn); }
+SfxPoolItem* __EXPORT SdrMeasureTextHPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrMeasureTextHPosItem(rIn);
+}
-sal_uInt16 __EXPORT SdrMeasureTextHPosItem::GetValueCount() const { return 4; }
+sal_uInt16 __EXPORT SdrMeasureTextHPosItem::GetValueCount() const
+{
+ return 4;
+}
XubString __EXPORT SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1944,16 +2113,19 @@ XubString __EXPORT SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos) co
}
SfxItemPresentation __EXPORT SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -1966,6 +2138,7 @@ sal_Bool SdrMeasureTextHPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMember
sal_Bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::MeasureTextHorzPos ePos;
+
if(!(rVal >>= ePos))
{
sal_Int32 nEnum = 0;
@@ -1979,13 +2152,20 @@ sal_Bool SdrMeasureTextHPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMe
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrMeasureTextVPosItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureTextVPosItem(*this); }
+SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrMeasureTextVPosItem(*this);
+}
-SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureTextVPosItem(rIn); }
+SfxPoolItem* __EXPORT SdrMeasureTextVPosItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrMeasureTextVPosItem(rIn);
+}
-sal_uInt16 __EXPORT SdrMeasureTextVPosItem::GetValueCount() const { return 5; }
+sal_uInt16 __EXPORT SdrMeasureTextVPosItem::GetValueCount() const
+{
+ return 5;
+}
XubString __EXPORT SdrMeasureTextVPosItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -1993,16 +2173,19 @@ XubString __EXPORT SdrMeasureTextVPosItem::GetValueTextByPos(sal_uInt16 nPos) co
}
SfxItemPresentation __EXPORT SdrMeasureTextVPosItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -2015,9 +2198,11 @@ sal_Bool SdrMeasureTextVPosItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMember
sal_Bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
drawing::MeasureTextVertPos ePos;
+
if(!(rVal >>= ePos))
{
sal_Int32 nEnum = 0;
+
if(!(rVal >>= nEnum))
return sal_False;
@@ -2028,13 +2213,20 @@ sal_Bool SdrMeasureTextVPosItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMe
return sal_True;
}
-TYPEINIT1_AUTOFACTORY(SdrMeasureUnitItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrMeasureUnitItem(*this); }
+SfxPoolItem* __EXPORT SdrMeasureUnitItem::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SdrMeasureUnitItem(*this);
+}
-SfxPoolItem* __EXPORT SdrMeasureUnitItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrMeasureUnitItem(rIn); }
+SfxPoolItem* __EXPORT SdrMeasureUnitItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
+{
+ return new SdrMeasureUnitItem(rIn);
+}
-sal_uInt16 __EXPORT SdrMeasureUnitItem::GetValueCount() const { return 14; }
+sal_uInt16 __EXPORT SdrMeasureUnitItem::GetValueCount() const
+{
+ return 14;
+}
XubString __EXPORT SdrMeasureUnitItem::GetValueTextByPos(sal_uInt16 nPos) const
{
@@ -2057,13 +2249,16 @@ SfxItemPresentation __EXPORT SdrMeasureUnitItem::GetPresentation(SfxItemPresenta
SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
{
rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
+
+ if (ePres==SFX_ITEM_PRESENTATION_COMPLETE)
+ {
String aStr;
SdrItemPool::TakeItemName(Which(), aStr);
aStr += sal_Unicode(' ');
rText.Insert(aStr, 0);
}
+
return ePres;
}
@@ -2076,6 +2271,7 @@ sal_Bool SdrMeasureUnitItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/
sal_Bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
sal_Int32 nMeasure = 0;
+
if(!(rVal >>= nMeasure))
return sal_False;
@@ -2083,67 +2279,10 @@ sal_Bool SdrMeasureUnitItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember
return sal_True;
}
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-// Circ
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-// CircKind
-TYPEINIT1_AUTOFACTORY(SdrCircKindItem,SfxEnumItem);
-
-SfxPoolItem* __EXPORT SdrCircKindItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrCircKindItem(*this); }
-
-SfxPoolItem* __EXPORT SdrCircKindItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const { return new SdrCircKindItem(rIn); }
-
-sal_uInt16 __EXPORT SdrCircKindItem::GetValueCount() const { return 4; }
-
-XubString __EXPORT SdrCircKindItem::GetValueTextByPos(sal_uInt16 nPos) const
-{
- return ImpGetResStr(STR_ItemValCIRC_FULL+nPos);
-}
-
-SfxItemPresentation __EXPORT SdrCircKindItem::GetPresentation(SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, XubString& rText, const IntlWrapper *) const
-{
- rText=GetValueTextByPos(sal::static_int_cast< sal_uInt16 >(GetValue()));
- if (ePres==SFX_ITEM_PRESENTATION_COMPLETE) {
- String aStr;
-
- SdrItemPool::TakeItemName(Which(), aStr);
- aStr += sal_Unicode(' ');
- rText.Insert(aStr, 0);
- }
- return ePres;
-}
-
-sal_Bool SdrCircKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
-{
- rVal <<= (drawing::CircleKind)GetValue();
- return sal_True;
-}
-
-sal_Bool SdrCircKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
-{
- drawing::CircleKind eKind;
- if(!(rVal >>= eKind))
- {
- sal_Int32 nEnum = 0;
- if(!(rVal >>= nEnum))
- return sal_False;
-
- eKind = (drawing::CircleKind)nEnum;
- }
-
- SetValue( sal::static_int_cast< sal_uInt16 >( (SdrCircKind)eKind ) );
- return sal_True;
-}
-
//------------------------------------------------------------
// class SdrSignedPercentItem
//------------------------------------------------------------
-TYPEINIT1_AUTOFACTORY( SdrSignedPercentItem, SfxInt16Item );
-
-
SfxPoolItem* __EXPORT SdrSignedPercentItem::Clone(SfxItemPool* /*pPool*/) const
{
return new SdrSignedPercentItem( Which(), GetValue() );
@@ -2174,7 +2313,6 @@ SfxItemPresentation __EXPORT SdrSignedPercentItem::GetPresentation(
}
#ifdef SDR_ISPOOLABLE
-
int __EXPORT SdrSignedPercentItem::IsPoolable() const
{
sal_uInt16 nId=Which();
@@ -2186,8 +2324,6 @@ int __EXPORT SdrSignedPercentItem::IsPoolable() const
// SdrGrafRedItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafRedItem, SdrSignedPercentItem );
-
SfxPoolItem* __EXPORT SdrGrafRedItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafRedItem( *this );
@@ -2202,8 +2338,6 @@ SfxPoolItem* __EXPORT SdrGrafRedItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/
// SdrGrafGreenItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafGreenItem, SdrSignedPercentItem );
-
SfxPoolItem* __EXPORT SdrGrafGreenItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafGreenItem( *this );
@@ -2218,8 +2352,6 @@ SfxPoolItem* __EXPORT SdrGrafGreenItem::Create( SvStream& rIn, sal_uInt16 /*nVer
// SdrGrafBlueItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafBlueItem, SdrSignedPercentItem );
-
SfxPoolItem* __EXPORT SdrGrafBlueItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafBlueItem( *this );
@@ -2234,8 +2366,6 @@ SfxPoolItem* __EXPORT SdrGrafBlueItem::Create( SvStream& rIn, sal_uInt16 /*nVer*
// SdrGrafLuminanceItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafLuminanceItem, SdrSignedPercentItem );
-
SfxPoolItem* __EXPORT SdrGrafLuminanceItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafLuminanceItem( *this );
@@ -2250,8 +2380,6 @@ SfxPoolItem* __EXPORT SdrGrafLuminanceItem::Create( SvStream& rIn, sal_uInt16 /*
// SdrGrafContrastItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafContrastItem, SdrSignedPercentItem );
-
SfxPoolItem* __EXPORT SdrGrafContrastItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafContrastItem( *this );
@@ -2266,8 +2394,6 @@ SfxPoolItem* __EXPORT SdrGrafContrastItem::Create( SvStream& rIn, sal_uInt16 /*n
// SdrGrafGamma100Item
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafGamma100Item, SfxUInt32Item );
-
SfxPoolItem* __EXPORT SdrGrafGamma100Item::Clone( SfxItemPool* /*pPool */) const
{
return new SdrGrafGamma100Item( *this );
@@ -2287,6 +2413,7 @@ sal_Bool SdrGrafGamma100Item::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*
sal_Bool SdrGrafGamma100Item::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
{
double nGamma = 0;
+
if(!(rVal >>= nGamma))
return sal_False;
@@ -2298,8 +2425,6 @@ sal_Bool SdrGrafGamma100Item::PutValue( const uno::Any& rVal, sal_uInt8 /*nMembe
// SdrGrafInvertItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafInvertItem, SdrOnOffItem );
-
SfxPoolItem* __EXPORT SdrGrafInvertItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafInvertItem( *this );
@@ -2314,8 +2439,6 @@ SfxPoolItem* __EXPORT SdrGrafInvertItem::Create( SvStream& rIn, sal_uInt16 /*nVe
// SdrGrafTransparenceItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafTransparenceItem, SdrPercentItem );
-
SfxPoolItem* __EXPORT SdrGrafTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafTransparenceItem( *this );
@@ -2330,8 +2453,6 @@ SfxPoolItem* __EXPORT SdrGrafTransparenceItem::Create( SvStream& rIn, sal_uInt16
// SdrGrafModeItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafModeItem, SfxEnumItem );
-
SfxPoolItem* __EXPORT SdrGrafModeItem::Clone(SfxItemPool* /*pPool*/) const
{
return new SdrGrafModeItem( *this );
@@ -2383,8 +2504,8 @@ XubString __EXPORT SdrGrafModeItem::GetValueTextByPos(sal_uInt16 nPos) const
}
SfxItemPresentation __EXPORT SdrGrafModeItem::GetPresentation( SfxItemPresentation ePres,
- SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
- XubString& rText, const IntlWrapper *) const
+ SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/,
+ XubString& rText, const IntlWrapper *) const
{
rText = GetValueTextByPos( sal::static_int_cast< sal_uInt16 >( GetValue() ) );
@@ -2404,8 +2525,6 @@ SfxItemPresentation __EXPORT SdrGrafModeItem::GetPresentation( SfxItemPresentati
// SdrGrafCropItem
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1( SdrGrafCropItem, SvxGrfCrop );
-
SfxPoolItem* SdrGrafCropItem::Clone( SfxItemPool* /*pPool*/) const
{
return new SdrGrafCropItem( *this );
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index dc6a6f34f978..93c9749a3e22 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -47,6 +47,9 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <svx/svdtrans.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -70,14 +73,14 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S
{
basegfx::B2DPolyPolygon aB2DPolyPolygon(rObject.TakeXorPoly());
- for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
+ for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
if(pTargetOverlay)
{
- Size aHalfLogicSize(pTargetOverlay->getOutputDevice().PixelToLogic(Size(4, 4)));
+ const basegfx::B2DVector aHalfLogicSize(pTargetOverlay->getOutputDevice().GetInverseViewTransformation() * basegfx::B2DVector(4.0, 4.0));
// object
::sdr::overlay::OverlayPolyPolygonStriped* pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aB2DPolyPolygon);
@@ -85,30 +88,16 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S
maObjects.append(*pNew);
// gluepoints
- if(rView.IsAutoVertexConnectors())
+ for(sal_uInt32 i(0); i < 4; i++)
{
- for(sal_uInt16 i(0); i < 4; i++)
- {
- SdrGluePoint aGluePoint(rObject.GetVertexGluePoint(i));
- const Point& rPosition = aGluePoint.GetAbsolutePos(rObject);
-
- basegfx::B2DPoint aTopLeft(rPosition.X() - aHalfLogicSize.Width(), rPosition.Y() - aHalfLogicSize.Height());
- basegfx::B2DPoint aBottomRight(rPosition.X() + aHalfLogicSize.Width(), rPosition.Y() + aHalfLogicSize.Height());
-
- basegfx::B2DPolygon aTempPoly;
- aTempPoly.append(aTopLeft);
- aTempPoly.append(basegfx::B2DPoint(aBottomRight.getX(), aTopLeft.getY()));
- aTempPoly.append(aBottomRight);
- aTempPoly.append(basegfx::B2DPoint(aTopLeft.getX(), aBottomRight.getY()));
- aTempPoly.setClosed(true);
-
- basegfx::B2DPolyPolygon aTempPolyPoly;
- aTempPolyPoly.append(aTempPoly);
+ const SdrGluePoint aGluePoint(rObject.GetVertexGluePoint(i));
+ const basegfx::B2DPoint& rPosition = aGluePoint.GetAbsolutePos(sdr::legacy::GetSnapRange(rObject));
+ const basegfx::B2DRange aBigRange(rPosition - aHalfLogicSize, rPosition + aHalfLogicSize);
+ const basegfx::B2DPolygon aTempPoly(basegfx::tools::createPolygonFromRect(aBigRange));
- pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(aTempPolyPoly);
+ pNew = new ::sdr::overlay::OverlayPolyPolygonStriped(basegfx::B2DPolyPolygon(aTempPoly));
pTargetOverlay->add(*pNew);
maObjects.append(*pNew);
- }
}
}
}
@@ -182,91 +171,75 @@ void ImpSdrCreateViewExtraData::HideOverlay()
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@ @@@@ @@@@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@ @@@@@ @@@@ @@@@@@ @@ @@@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@ @@ @@ @@@@@ @@ @@ @@ @@@@@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrCreateView::ImpClearConnectMarker()
{
if(mpCoMaOverlay)
{
delete mpCoMaOverlay;
- mpCoMaOverlay = 0L;
+ mpCoMaOverlay = 0;
}
}
-void SdrCreateView::ImpClearVars()
+SdrCreateView::SdrCreateView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrDragView(rModel1, pOut),
+ mpAktCreate(0),
+ mpCoMaOverlay(0),
+ mpCreateViewExtraData(new ImpSdrCreateViewExtraData()),
+ maSdrObjectCreationInfo(),
+ maCreatePointer(POINTER_CROSS),
+ mnAutoCloseDistPix(5),
+ mnFreeHandMinDistPix(10),
+ mbAutoTextEdit(false),
+ mb1stPointAsCenter(false),
+ mbAutoClosePolys(true)
{
- nAktInvent=SdrInventor;
- nAktIdent=OBJ_NONE;
- pAktCreate=NULL;
- pCreatePV=NULL;
- bAutoTextEdit=sal_False;
- b1stPointAsCenter=sal_False;
- aAktCreatePointer=Pointer(POINTER_CROSS);
- bUseIncompatiblePathCreateInterface=sal_False;
- bAutoClosePolys=sal_True;
- nAutoCloseDistPix=5;
- nFreeHandMinDistPix=10;
-
ImpClearConnectMarker();
}
-void SdrCreateView::ImpMakeCreateAttr()
-{
-}
-
-SdrCreateView::SdrCreateView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrDragView(pModel1,pOut),
- mpCoMaOverlay(0L),
- mpCreateViewExtraData(new ImpSdrCreateViewExtraData())
-{
- ImpClearVars();
- ImpMakeCreateAttr();
-}
-
SdrCreateView::~SdrCreateView()
{
ImpClearConnectMarker();
delete mpCreateViewExtraData;
- SdrObject::Free( pAktCreate );
-}
-void SdrCreateView::ImpDelCreateAttr()
-{
+ if(mpAktCreate)
+ {
+ deleteSdrObjectSafeAndClearPointer(mpAktCreate);
+ }
}
-sal_Bool SdrCreateView::IsAction() const
+bool SdrCreateView::IsAction() const
{
- return SdrDragView::IsAction() || pAktCreate!=NULL;
+ return SdrDragView::IsAction() || GetCreateObj();
}
-void SdrCreateView::MovAction(const Point& rPnt)
+void SdrCreateView::MovAction(const basegfx::B2DPoint& rPnt)
{
SdrDragView::MovAction(rPnt);
- if (pAktCreate!=NULL) {
+
+ if(GetCreateObj())
+ {
MovCreateObj(rPnt);
}
}
void SdrCreateView::EndAction()
{
- if (pAktCreate!=NULL) EndCreateObj(SDRCREATE_FORCEEND);
+ if(GetCreateObj())
+ {
+ EndCreateObj(SDRCREATE_FORCEEND);
+ }
+
SdrDragView::EndAction();
}
void SdrCreateView::BckAction()
{
- if (pAktCreate!=NULL) BckCreateObj();
+ if(GetCreateObj())
+ {
+ BckCreateObj();
+ }
+
SdrDragView::BckAction();
}
@@ -276,49 +249,50 @@ void SdrCreateView::BrkAction()
BrkCreateObj();
}
-void SdrCreateView::TakeActionRect(Rectangle& rRect) const
+basegfx::B2DRange SdrCreateView::TakeActionRange() const
{
- if (pAktCreate!=NULL)
+ if(GetCreateObj())
{
- rRect=aDragStat.GetActionRect();
- if (rRect.IsEmpty())
+ basegfx::B2DRange aRetval(GetDragStat().GetActionRange());
+
+ if(aRetval.isEmpty())
{
- rRect=Rectangle(aDragStat.GetPrev(),aDragStat.GetNow());
+ aRetval = basegfx::B2DRange(GetDragStat().GetPrev(), GetDragStat().GetNow());
}
+
+ return aRetval;
}
else
{
- SdrDragView::TakeActionRect(rRect);
+ return SdrDragView::TakeActionRange();
}
}
-sal_Bool SdrCreateView::CheckEdgeMode()
+bool SdrCreateView::CheckEdgeMode()
{
- sal_uInt32 nInv=nAktInvent;
- sal_uInt16 nIdn=nAktIdent;
- if (pAktCreate!=NULL)
+ const bool bCreatingEdge(SdrInventor == getSdrObjectCreationInfo().getInvent() && OBJ_EDGE == getSdrObjectCreationInfo().getIdent());
+
+ if(GetCreateObj() && bCreatingEdge)
{
- nInv=pAktCreate->GetObjInventor();
- nIdn=pAktCreate->GetObjIdentifier();
- // wird vom EdgeObj gemanaged
- if (nAktInvent==SdrInventor && nAktIdent==OBJ_EDGE) return sal_False;
+ return false;
}
- if (!IsCreateMode() || nAktInvent!=SdrInventor || nAktIdent!=OBJ_EDGE)
+ if(!IsCreateMode() || !bCreatingEdge)
{
ImpClearConnectMarker();
- return sal_False;
+
+ return false;
}
else
{
- // sal_True heisst: MouseMove soll Connect checken
+ // true heisst: MouseMove soll Connect checken
return !IsAction();
}
}
-void SdrCreateView::SetConnectMarker(const SdrObjConnection& rCon, const SdrPageView& /*rPV*/)
+void SdrCreateView::SetConnectMarker(const SdrObjConnection& rCon)
{
- SdrObject* pTargetObject = rCon.pObj;
+ SdrObject* pTargetObject = rCon.GetObject();
if(pTargetObject)
{
@@ -344,278 +318,293 @@ void SdrCreateView::HideConnectMarker()
ImpClearConnectMarker();
}
-sal_Bool SdrCreateView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
+bool SdrCreateView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
{
if(CheckEdgeMode() && pWin)
{
- SdrPageView* pPV = GetSdrPageView();
-
- if(pPV)
+ if(GetSdrPageView())
{
- // Defaultete Hit-Toleranz bei IsMarkedHit() mal aendern !!!!
- Point aPos(pWin->PixelToLogic(rMEvt.GetPosPixel()));
- sal_Bool bMarkHit=PickHandle(aPos)!=NULL || IsMarkedObjHit(aPos);
+ const basegfx::B2DPoint aLogic(pWin->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+ bool bMarkHit(PickHandle(aLogic) || IsMarkedObjHit(aLogic));
SdrObjConnection aCon;
- if (!bMarkHit) SdrEdgeObj::ImpFindConnector(aPos,*pPV,aCon,NULL,pWin);
- SetConnectMarker(aCon,*pPV);
+
+ if(!bMarkHit)
+ {
+ SdrEdgeObj::FindConnector(aLogic, *getAsSdrView(), aCon, 0, pWin);
+ }
+
+ SetConnectMarker(aCon);
}
}
+
return SdrDragView::MouseMove(rMEvt,pWin);
}
-sal_Bool SdrCreateView::IsTextTool() const
+bool SdrCreateView::IsTextTool() const
{
- return eEditMode==SDREDITMODE_CREATE && nAktInvent==SdrInventor && (nAktIdent==OBJ_TEXT || nAktIdent==OBJ_TEXTEXT || nAktIdent==OBJ_TITLETEXT || nAktIdent==OBJ_OUTLINETEXT);
+ return (SDREDITMODE_CREATE == GetViewEditMode()
+ && SdrInventor == getSdrObjectCreationInfo().getInvent()
+ && (OBJ_TEXT == getSdrObjectCreationInfo().getIdent()
+ || OBJ_TITLETEXT == getSdrObjectCreationInfo().getIdent()
+ || OBJ_OUTLINETEXT == getSdrObjectCreationInfo().getIdent()));
}
-sal_Bool SdrCreateView::IsEdgeTool() const
+bool SdrCreateView::IsEdgeTool() const
{
- return eEditMode==SDREDITMODE_CREATE && nAktInvent==SdrInventor && (nAktIdent==OBJ_EDGE);
+ return (SDREDITMODE_CREATE == GetViewEditMode()
+ && SdrInventor == getSdrObjectCreationInfo().getInvent()
+ && OBJ_EDGE == getSdrObjectCreationInfo().getIdent());
}
-sal_Bool SdrCreateView::IsMeasureTool() const
+bool SdrCreateView::IsMeasureTool() const
{
- return eEditMode==SDREDITMODE_CREATE && nAktInvent==SdrInventor && (nAktIdent==OBJ_MEASURE);
+ return (SDREDITMODE_CREATE == GetViewEditMode()
+ && SdrInventor == getSdrObjectCreationInfo().getInvent()
+ && OBJ_MEASURE == getSdrObjectCreationInfo().getIdent());
}
-void SdrCreateView::SetCurrentObj(sal_uInt16 nIdent, sal_uInt32 nInvent)
+void SdrCreateView::setSdrObjectCreationInfo(const SdrObjectCreationInfo& rNew)
{
- if (nAktInvent!=nInvent || nAktIdent!=nIdent)
+ // copy values
+ maSdrObjectCreationInfo = rNew;
+
+ // Always use I-Beam for text tool
+ if(IsTextTool())
+ {
+ setCreatePointer(POINTER_TEXT);
+ }
+ else if(static_cast< sal_uInt16 >(OBJ_NONE) != maSdrObjectCreationInfo.getIdent())
{
- nAktInvent=nInvent;
- nAktIdent=nIdent;
- SdrObject* pObj = SdrObjFactory::MakeNewObject(nInvent,nIdent,NULL,NULL);
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ getSdrModelFromSdrView(),
+ getSdrObjectCreationInfo());
if(pObj)
{
- // Auf pers. Wunsch von Marco:
- // Mauszeiger bei Textwerkzeug immer I-Beam. Fadenkreuz
- // mit kleinem I-Beam erst bai MouseButtonDown
- if(IsTextTool())
- {
- // #81944# AW: Here the correct pointer needs to be used
- // if the default is set to vertical writing
- aAktCreatePointer = POINTER_TEXT;
- }
- else
- aAktCreatePointer = pObj->GetCreatePointer();
-
- SdrObject::Free( pObj );
- }
- else
- {
- aAktCreatePointer = Pointer(POINTER_CROSS);
+ setCreatePointer(pObj->GetCreatePointer(*getAsSdrView()));
+ deleteSdrObjectSafeAndClearPointer(pObj);
}
}
-
- CheckEdgeMode();
- ImpSetGlueVisible3(IsEdgeTool());
}
-sal_Bool SdrCreateView::ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut,
- short nMinMov, SdrPageView* pPV, const Rectangle& rLogRect, SdrObject* pPreparedFactoryObject)
+bool SdrCreateView::ImpBegCreateObj(
+ const SdrObjectCreationInfo& rSdrObjectCreationInfo,
+ const basegfx::B2DPoint& rPnt,
+ double fMinMovLogic,
+ const basegfx::B2DRange& rLogRange,
+ SdrObject* pPreparedFactoryObject)
{
- sal_Bool bRet=sal_False;
+ bool bRetval(false);
+
UnmarkAllObj();
BrkAction();
-
ImpClearConnectMarker();
- if (pPV!=NULL)
- {
- pCreatePV=pPV;
- }
- else
+ if(GetSdrPageView())
{
- pCreatePV = GetSdrPageView();
- }
- if (pCreatePV!=NULL)
- { // ansonsten keine Seite angemeldet!
- String aLay(aAktLayer);
+ String aLay(GetActiveLayer());
+
+ if(SdrInventor == rSdrObjectCreationInfo.getInvent()
+ && OBJ_MEASURE == rSdrObjectCreationInfo.getIdent()
+ && GetMeasureLayer().Len())
+ {
+ aLay = GetMeasureLayer();
+ }
+
+ SdrLayerID nLayer(GetSdrPageView()->getSdrPageFromSdrPageView().GetPageLayerAdmin().GetLayerID(aLay, true));
- if(nInvent == SdrInventor && nIdent == OBJ_MEASURE && aMeasureLayer.Len())
+ if(SDRLAYER_NOTFOUND == nLayer)
{
- aLay = aMeasureLayer;
+ nLayer = 0;
}
- SdrLayerID nLayer=pCreatePV->GetPage()->GetLayerAdmin().GetLayerID(aLay,sal_True);
- if (nLayer==SDRLAYER_NOTFOUND) nLayer=0;
- if (!pCreatePV->GetLockedLayers().IsSet(nLayer) && pCreatePV->GetVisibleLayers().IsSet(nLayer))
+ if(!GetSdrPageView()->GetLockedLayers().IsSet(nLayer) && GetSdrPageView()->GetVisibleLayers().IsSet(nLayer))
{
if(pPreparedFactoryObject)
{
- pAktCreate = pPreparedFactoryObject;
-
- if(pCreatePV->GetPage())
- {
- pAktCreate->SetPage(pCreatePV->GetPage());
- }
- else if (pMod)
- {
- pAktCreate->SetModel(pMod);
- }
+ mpAktCreate = pPreparedFactoryObject;
}
else
{
- pAktCreate = SdrObjFactory::MakeNewObject(nInvent, nIdent, pCreatePV->GetPage(), pMod);
+ mpAktCreate = SdrObjFactory::MakeNewObject(getSdrModelFromSdrView(), rSdrObjectCreationInfo);
}
- Point aPnt(rPnt);
- if (nAktInvent!=SdrInventor || (nAktIdent!=sal_uInt16(OBJ_EDGE) &&
- nAktIdent!=sal_uInt16(OBJ_FREELINE) &&
- nAktIdent!=sal_uInt16(OBJ_FREEFILL) )) { // Kein Fang fuer Edge und Freihand!
- aPnt=GetSnapPos(aPnt,pCreatePV);
+ basegfx::B2DPoint aPnt(rPnt);
+
+ // no snap for edge and freehand
+ const bool bNoSnap(SdrInventor == getSdrObjectCreationInfo().getInvent() && (
+ sal_uInt16(OBJ_EDGE) == getSdrObjectCreationInfo().getIdent() || getSdrObjectCreationInfo().getFreehandMode()));
+
+ if(!bNoSnap)
+ {
+ // Kein Fang fuer Edge und Freihand!
+ aPnt = GetSnapPos(aPnt);
}
- if (pAktCreate!=NULL)
+
+ if(GetCreateObj())
{
- sal_Bool bStartEdit=sal_False; // nach Ende von Create automatisch TextEdit starten
- if (pDefaultStyleSheet!=NULL) pAktCreate->NbcSetStyleSheet(pDefaultStyleSheet, sal_False);
+ bool bStartEdit(false); // nach Ende von Create automatisch TextEdit starten
+
+ if(GetDefaultStyleSheet())
+ {
+ GetCreateObj()->SetStyleSheet(GetDefaultStyleSheet(), false);
+ }
// #101618# SW uses a naked SdrObject for frame construction. Normally, such an
// object should not be created. Since it is possible to use it as a helper
// object (e.g. in letting the user define an area with the interactive
// construction) at least no items should be set at that object.
- if(nInvent != SdrInventor || nIdent != OBJ_NONE)
+ if(SdrInventor != rSdrObjectCreationInfo.getInvent() || OBJ_NONE != rSdrObjectCreationInfo.getIdent())
{
- pAktCreate->SetMergedItemSet(aDefaultAttr);
+ GetCreateObj()->SetMergedItemSet(GetDefaultAttr());
}
- if (HAS_BASE(SdrCaptionObj,pAktCreate))
+ if(dynamic_cast< SdrCaptionObj* >(GetCreateObj()))
{
- SfxItemSet aSet(pMod->GetItemPool());
+ SfxItemSet aSet(GetCreateObj()->GetObjectItemPool());
+
aSet.Put(XFillColorItem(String(),Color(COL_WHITE))); // Falls einer auf Solid umschaltet
aSet.Put(XFillStyleItem(XFILL_NONE));
-
- pAktCreate->SetMergedItemSet(aSet);
-
- bStartEdit=sal_True;
+ GetCreateObj()->SetMergedItemSet(aSet);
+ bStartEdit = true;
}
- if (nInvent==SdrInventor && (nIdent==OBJ_TEXT || nIdent==OBJ_TEXTEXT ||
- nIdent==OBJ_TITLETEXT || nIdent==OBJ_OUTLINETEXT))
+
+ if(GetCreateObj()
+ && SdrInventor == rSdrObjectCreationInfo.getInvent()
+ && (OBJ_TEXT == rSdrObjectCreationInfo.getIdent()
+ || OBJ_TITLETEXT == rSdrObjectCreationInfo.getIdent()
+ || OBJ_OUTLINETEXT == rSdrObjectCreationInfo.getIdent()))
{
// Fuer alle Textrahmen default keinen Hintergrund und keine Umrandung
- SfxItemSet aSet(pMod->GetItemPool());
+ SfxItemSet aSet(GetCreateObj()->GetObjectItemPool());
+
aSet.Put(XFillColorItem(String(),Color(COL_WHITE))); // Falls einer auf Solid umschaltet
aSet.Put(XFillStyleItem(XFILL_NONE));
aSet.Put(XLineColorItem(String(),Color(COL_BLACK))); // Falls einer auf Solid umschaltet
aSet.Put(XLineStyleItem(XLINE_NONE));
+ GetCreateObj()->SetMergedItemSet(aSet);
- pAktCreate->SetMergedItemSet(aSet);
+ bStartEdit = true;
+ }
- bStartEdit=sal_True;
+ if(!rLogRange.isEmpty())
+ {
+ sdr::legacy::SetLogicRange(*GetCreateObj(), rLogRange);
}
- if (!rLogRect.IsEmpty()) pAktCreate->NbcSetLogicRect(rLogRect);
// #90129# make sure drag start point is inside WorkArea
- const Rectangle& rWorkArea = ((SdrDragView*)this)->GetWorkArea();
+ const basegfx::B2DRange& rWorkRange = ((SdrDragView*)this)->GetWorkArea();
- if(!rWorkArea.IsEmpty())
+ if(!rWorkRange.isEmpty())
{
- if(aPnt.X() < rWorkArea.Left())
- {
- aPnt.X() = rWorkArea.Left();
- }
-
- if(aPnt.X() > rWorkArea.Right())
- {
- aPnt.X() = rWorkArea.Right();
- }
-
- if(aPnt.Y() < rWorkArea.Top())
- {
- aPnt.Y() = rWorkArea.Top();
- }
-
- if(aPnt.Y() > rWorkArea.Bottom())
- {
- aPnt.Y() = rWorkArea.Bottom();
- }
+ aPnt = rWorkRange.clamp(aPnt);
}
- aDragStat.Reset(aPnt);
- aDragStat.SetView((SdrView*)this);
- aDragStat.SetPageView(pCreatePV);
- aDragStat.SetMinMove(ImpGetMinMovLogic(nMinMov,pOut));
- pDragWin=pOut;
- if (pAktCreate->BegCreate(aDragStat))
+ GetDragStat().Reset(aPnt);
+ GetDragStat().SetMinMove(fMinMovLogic);
+
+ if (GetCreateObj()->BegCreate(GetDragStat()))
{
- ShowCreateObj(/*pOut,sal_True*/);
- bRet=sal_True;
+ ShowCreateObj();
+ bRetval = true;
}
else
{
- SdrObject::Free( pAktCreate );
- pAktCreate=NULL;
- pCreatePV=NULL;
+ SdrObject* pTarget = GetCreateObj();
+ deleteSdrObjectSafeAndClearPointer(pTarget);
+ mpAktCreate = 0;
}
}
}
}
- return bRet;
+
+ return bRetval;
}
-sal_Bool SdrCreateView::BegCreateObj(const Point& rPnt, OutputDevice* pOut, short nMinMov, SdrPageView* pPV)
+bool SdrCreateView::BegCreateObj(const basegfx::B2DPoint& rPnt, double fMinMovLogic)
{
- return ImpBegCreateObj(nAktInvent,nAktIdent,rPnt,pOut,nMinMov,pPV,Rectangle(), 0L);
+ return ImpBegCreateObj(getSdrObjectCreationInfo(), rPnt, fMinMovLogic, basegfx::B2DRange(), 0);
}
-sal_Bool SdrCreateView::BegCreatePreparedObject(const Point& rPnt, sal_Int16 nMinMov, SdrObject* pPreparedFactoryObject)
+bool SdrCreateView::BegCreatePreparedObject(const basegfx::B2DPoint& rPnt, double fMinMovLogic, SdrObject* pPreparedFactoryObject)
{
- sal_uInt32 nInvent(nAktInvent);
- sal_uInt16 nIdent(nAktIdent);
+ SdrObjectCreationInfo aSdrObjectCreationInfo(getSdrObjectCreationInfo());
if(pPreparedFactoryObject)
{
- nInvent = pPreparedFactoryObject->GetObjInventor();
- nIdent = pPreparedFactoryObject->GetObjIdentifier();
+ aSdrObjectCreationInfo.setInvent(pPreparedFactoryObject->GetObjInventor());
+ aSdrObjectCreationInfo.setIdent(pPreparedFactoryObject->GetObjIdentifier());
}
- return ImpBegCreateObj(nInvent, nIdent, rPnt, 0L, nMinMov, 0L, Rectangle(), pPreparedFactoryObject);
+ return ImpBegCreateObj(aSdrObjectCreationInfo, rPnt, fMinMovLogic, basegfx::B2DRange(), pPreparedFactoryObject);
}
-sal_Bool SdrCreateView::BegCreateCaptionObj(const Point& rPnt, const Size& rObjSiz,
- OutputDevice* pOut, short nMinMov, SdrPageView* pPV)
+bool SdrCreateView::BegCreateCaptionObj(const basegfx::B2DPoint& rPnt, const basegfx::B2DVector& rObjSiz, double fMinMovLogic)
{
- return ImpBegCreateObj(SdrInventor,OBJ_CAPTION,rPnt,pOut,nMinMov,pPV,
- Rectangle(rPnt,Size(rObjSiz.Width()+1,rObjSiz.Height()+1)), 0L);
+ const basegfx::B2DRange aNewRange(rPnt, rPnt + rObjSiz);
+
+ return ImpBegCreateObj(SdrObjectCreationInfo(OBJ_CAPTION, SdrInventor), rPnt, fMinMovLogic, aNewRange, 0);
}
-void SdrCreateView::MovCreateObj(const Point& rPnt)
+void SdrCreateView::MovCreateObj(const basegfx::B2DPoint& rPnt)
{
- if (pAktCreate!=NULL) {
- Point aPnt(rPnt);
- if (!aDragStat.IsNoSnap())
+ if(GetCreateObj())
+ {
+ basegfx::B2DPoint aPnt(rPnt);
+
+ if(!GetDragStat().IsNoSnap())
{
- aPnt=GetSnapPos(aPnt,pCreatePV);
+ aPnt = GetSnapPos(aPnt);
}
- if (IsOrtho())
+
+ if(IsOrthogonal())
{
- if (aDragStat.IsOrtho8Possible()) OrthoDistance8(aDragStat.GetPrev(),aPnt,IsBigOrtho());
- else if (aDragStat.IsOrtho4Possible()) OrthoDistance4(aDragStat.GetPrev(),aPnt,IsBigOrtho());
+ if(GetDragStat().IsOrtho8Possible())
+ {
+ aPnt = OrthoDistance8(GetDragStat().GetPrev(), aPnt, IsBigOrthogonal());
+ }
+ else if(GetDragStat().IsOrtho4Possible())
+ {
+ aPnt = OrthoDistance4(GetDragStat().GetPrev(), aPnt, IsBigOrthogonal());
+ }
}
// #77734# If the drag point was limited and Ortho is active, do
- // the small ortho correction (reduction) -> last parameter to FALSE.
- sal_Bool bDidLimit(ImpLimitToWorkArea(aPnt));
- if(bDidLimit && IsOrtho())
+ // the small ortho correction (reduction) -> last parameter to false.
+ const basegfx::B2DPoint aOrigPnt(aPnt);
+ aPnt = ImpLimitToWorkArea(aPnt);
+
+ if(!aOrigPnt.equal(aPnt) && IsOrthogonal())
+ {
+ if(GetDragStat().IsOrtho8Possible())
+ {
+ aPnt = OrthoDistance8(GetDragStat().GetPrev(), aPnt, false);
+ }
+ else if(GetDragStat().IsOrtho4Possible())
+ {
+ aPnt = OrthoDistance4(GetDragStat().GetPrev(), aPnt, false);
+ }
+ }
+
+ if(aPnt.equal(GetDragStat().GetNow()))
{
- if(aDragStat.IsOrtho8Possible())
- OrthoDistance8(aDragStat.GetPrev(), aPnt, sal_False);
- else if(aDragStat.IsOrtho4Possible())
- OrthoDistance4(aDragStat.GetPrev(), aPnt, sal_False);
+ return;
}
- if (aPnt==aDragStat.GetNow()) return;
- bool bMerk(aDragStat.IsMinMoved());
- if (aDragStat.CheckMinMoved(aPnt))
+ const bool bMerk(GetDragStat().IsMinMoved());
+
+ if(GetDragStat().CheckMinMoved(aPnt))
{
- Rectangle aBound;
- if (!bMerk) aDragStat.NextPoint();
- aDragStat.NextMove(aPnt);
- pAktCreate->MovCreate(aDragStat);
+ if(!bMerk)
+ {
+ GetDragStat().NextPoint();
+ }
+
+ GetDragStat().NextMove(aPnt);
+ GetCreateObj()->MovCreate(GetDragStat());
// MovCreate changes the object, so use ActionChanged() on it
- pAktCreate->ActionChanged();
+ GetCreateObj()->ActionChanged();
// replace for DrawCreateObjDiff
HideCreateObj();
@@ -624,49 +613,54 @@ void SdrCreateView::MovCreateObj(const Point& rPnt)
}
}
-sal_Bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
+bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
{
- sal_Bool bRet=sal_False;
- SdrObject* pObjMerk=pAktCreate;
- SdrPageView* pPVMerk=pCreatePV;
+ bool bRetval(true);
+ SdrObject* pObjRemember = GetCreateObj();
- if (pAktCreate!=NULL)
+ if(GetCreateObj())
{
- sal_uIntPtr nAnz=aDragStat.GetPointAnz();
+ const sal_uInt32 nAnz(GetDragStat().GetPointAnz());
- if (nAnz<=1 && eCmd==SDRCREATE_FORCEEND)
+ if(nAnz <= 1 && SDRCREATE_FORCEEND == eCmd)
{
BrkCreateObj(); // Objekte mit nur einem Punkt gibt's nicht (zumindest noch nicht)
- return sal_False; // sal_False=Event nicht ausgewertet
+
+ return false; // false=Event nicht ausgewertet
}
- sal_Bool bPntsEq=nAnz>1;
- sal_uIntPtr i=1;
- Point aP0=aDragStat.GetPoint(0);
- while (bPntsEq && i<nAnz) { bPntsEq=aP0==aDragStat.GetPoint(i); i++; }
+ bool bPntsEq(nAnz > 1);
+ sal_uInt32 i(1);
+ basegfx::B2DPoint aP0(GetDragStat().GetPoint(0));
+
+ while(bPntsEq && i < nAnz)
+ {
+ bPntsEq = aP0.equal(GetDragStat().GetPoint(i));
+ i++;
+ }
- if (pAktCreate->EndCreate(aDragStat,eCmd))
+ if(GetCreateObj()->EndCreate(GetDragStat(), eCmd))
{
HideCreateObj();
- if (!bPntsEq)
+ if(!bPntsEq && GetSdrPageView())
{
// sonst Brk, weil alle Punkte gleich sind.
- SdrObject* pObj=pAktCreate;
- pAktCreate=NULL;
+ SdrObject* pObj = GetCreateObj();
+ mpAktCreate = 0;
- const SdrLayerAdmin& rAd = pCreatePV->GetPage()->GetLayerAdmin();
+ const SdrLayerAdmin& rAd = GetSdrPageView()->getSdrPageFromSdrPageView().GetPageLayerAdmin();
SdrLayerID nLayer(0);
// #i72535#
- if(pObj->ISA(FmFormObj))
+ if(dynamic_cast< FmFormObj* >(pObj))
{
// for FormControls, force to form layer
nLayer = rAd.GetLayerID(rAd.GetControlLayerName(), true);
}
else
{
- nLayer = rAd.GetLayerID(aAktLayer, sal_True);
+ nLayer = rAd.GetLayerID(GetActiveLayer(), true);
}
if(SDRLAYER_NOTFOUND == nLayer)
@@ -677,35 +671,43 @@ sal_Bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
pObj->SetLayer(nLayer);
// #83403# recognize creation of a new 3D object inside a 3D scene
- sal_Bool bSceneIntoScene(sal_False);
+ bool bSceneIntoScene(false);
+ E3dScene* pE3dSceneA = dynamic_cast< E3dScene* >(pObjRemember);
- if(pObjMerk
- && pObjMerk->ISA(E3dScene)
- && pCreatePV
- && pCreatePV->GetAktGroup()
- && pCreatePV->GetAktGroup()->ISA(E3dScene))
+ if(pE3dSceneA)
{
- sal_Bool bDidInsert = ((E3dView*)this)->ImpCloneAll3DObjectsToDestScene(
- (E3dScene*)pObjMerk, (E3dScene*)pCreatePV->GetAktGroup(), Point(0, 0));
+ E3dScene* pE3dSceneB = dynamic_cast< E3dScene* >(GetSdrPageView()->GetCurrentGroup());
- if(bDidInsert)
+ if(pE3dSceneB)
{
- // delete object, it's content is cloned and inserted
- SdrObject::Free( pObjMerk );
- pObjMerk = 0L;
- bRet = sal_False;
- bSceneIntoScene = sal_True;
+ E3dView* pE3dView = dynamic_cast< E3dView* >(this);
+
+ if(pE3dView)
+ {
+ const bool bDidInsert(
+ pE3dView->ImpCloneAll3DObjectsToDestScene(
+ pE3dSceneA,
+ pE3dSceneB));
+
+ if(bDidInsert)
+ {
+ // delete object, it's content is cloned and inserted
+ deleteSdrObjectSafeAndClearPointer(pObjRemember);
+ pObjRemember = 0;
+ bRetval = false;
+ bSceneIntoScene = true;
+ }
+ }
}
}
if(!bSceneIntoScene)
{
// do the same as before
- InsertObjectAtView(pObj, *pCreatePV);
+ InsertObjectAtView(*pObj);
}
- pCreatePV=NULL;
- bRet=sal_True; // sal_True=Event ausgewertet
+ bRetval = true; // true=Event ausgewertet
}
else
{
@@ -713,10 +715,11 @@ sal_Bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
}
}
else
- { // Mehr Punkte
- if (eCmd==SDRCREATE_FORCEEND || // nix da, Ende erzwungen
- nAnz==0 || // keine Punkte da (kann eigentlich nicht vorkommen)
- (nAnz<=1 && !aDragStat.IsMinMoved())) { // MinMove nicht erfuellt
+ {
+ if(SDRCREATE_FORCEEND == eCmd || // nix da, Ende erzwungen
+ 0 == nAnz || // keine Punkte da (kann eigentlich nicht vorkommen)
+ (nAnz <= 1 && !GetDragStat().IsMinMoved())) // MinMove nicht erfuellt
+ {
BrkCreateObj();
}
else
@@ -724,35 +727,39 @@ sal_Bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
// replace for DrawCreateObjDiff
HideCreateObj();
ShowCreateObj();
- aDragStat.ResetMinMoved(); // NextPoint gibt's bei MovCreateObj()
- bRet=sal_True;
+ GetDragStat().ResetMinMoved(); // NextPoint gibt's bei MovCreateObj()
+ bRetval = true;
}
}
- if (bRet && pObjMerk!=NULL && IsTextEditAfterCreate())
+
+ if(bRetval && pObjRemember && IsTextEditAfterCreate())
{
- SdrTextObj* pText=PTR_CAST(SdrTextObj,pObjMerk);
- if (pText!=NULL && pText->IsTextFrame())
+ SdrTextObj* pText = dynamic_cast< SdrTextObj* >(pObjRemember);
+
+ if(pText && pText->IsTextFrame())
{
- SdrBeginTextEdit(pText, pPVMerk, (Window*)0L, sal_True, (SdrOutliner*)0L, (OutlinerView*)0L);
+ SdrBeginTextEdit(pText, (Window*)0, true, (SdrOutliner*)0, (OutlinerView*)0);
}
}
}
- return bRet;
+
+ return bRetval;
}
void SdrCreateView::BckCreateObj()
{
- if (pAktCreate!=NULL)
+ if (GetCreateObj())
{
- if (aDragStat.GetPointAnz()<=2 )
+ if (GetDragStat().GetPointAnz()<=2 )
{
BrkCreateObj();
}
else
{
HideCreateObj();
- aDragStat.PrevPoint();
- if (pAktCreate->BckCreate(aDragStat))
+ GetDragStat().PrevPoint();
+
+ if(GetCreateObj()->BckCreate(GetDragStat()))
{
ShowCreateObj();
}
@@ -766,31 +773,31 @@ void SdrCreateView::BckCreateObj()
void SdrCreateView::BrkCreateObj()
{
- if (pAktCreate!=NULL)
+ if (GetCreateObj())
{
HideCreateObj();
- pAktCreate->BrkCreate(aDragStat);
- SdrObject::Free( pAktCreate );
- pAktCreate=NULL;
- pCreatePV=NULL;
+ GetCreateObj()->BrkCreate(GetDragStat());
+ SdrObject* pTarget = GetCreateObj();
+ deleteSdrObjectSafeAndClearPointer(pTarget);
+ mpAktCreate = 0;
}
}
-void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/)
+void SdrCreateView::ShowCreateObj()
{
- if(IsCreateObj() && !aDragStat.IsShown())
+ if(GetCreateObj() && !GetDragStat().IsShown())
{
- if(pAktCreate)
+ if(GetCreateObj())
{
// for migration from XOR, replace DrawDragObj here to create
// overlay objects instead.
- sal_Bool bUseSolidDragging(IsSolidDragging());
+ bool bUseSolidDragging(IsSolidDragging());
// #i101648# check if dragged object is a naked SdrObject (no
// derivation of). This is e.g. used in SW Frame construction
// as placeholder. Do not use SolidDragging for naked SDrObjects,
// they cannot have a valid optical representation
- if(bUseSolidDragging && OBJ_NONE == pAktCreate->GetObjIdentifier())
+ if(bUseSolidDragging && OBJ_NONE == GetCreateObj()->GetObjIdentifier())
{
bUseSolidDragging = false;
}
@@ -798,34 +805,34 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/)
// check for objects with no fill and no line
if(bUseSolidDragging)
{
- const SfxItemSet& rSet = pAktCreate->GetMergedItemSet();
+ const SfxItemSet& rSet = GetCreateObj()->GetMergedItemSet();
const XFillStyle eFill(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
const XLineStyle eLine(((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue());
if(XLINE_NONE == eLine && XFILL_NONE == eFill)
{
- bUseSolidDragging = sal_False;
+ bUseSolidDragging = false;
}
}
// check for form controls
if(bUseSolidDragging)
{
- if(pAktCreate->ISA(SdrUnoObj))
+ if(dynamic_cast< SdrUnoObj* >(GetCreateObj()))
{
- bUseSolidDragging = sal_False;
+ bUseSolidDragging = false;
}
}
// #i101781# force to non-solid dragging when not creating a full circle
if(bUseSolidDragging)
{
- SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(pAktCreate);
+ SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(GetCreateObj());
- if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier())
+ if(pCircObj && CircleType_Circle != pCircObj->GetSdrCircleObjType())
{
// #i103058# Allow SolidDragging with four points
- if(aDragStat.GetPointAnz() < 4)
+ if(GetDragStat().GetPointAnz() < 4)
{
bUseSolidDragging = false;
}
@@ -835,41 +842,28 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/)
if(bUseSolidDragging)
{
basegfx::B2DPolyPolygon aDragPolyPolygon;
+ SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >(GetCreateObj());
- if(pAktCreate->ISA(SdrRectObj))
- {
- // ensure object has some size, necessary for SdrTextObj because
- // there are still untested divisions by that sizes
- Rectangle aCurrentSnapRect(pAktCreate->GetSnapRect());
-
- if(!(aCurrentSnapRect.GetWidth() > 1 && aCurrentSnapRect.GetHeight() > 1))
- {
- Rectangle aNewRect(aDragStat.GetStart(), aDragStat.GetStart() + Point(2, 2));
- pAktCreate->NbcSetSnapRect(aNewRect);
- }
- }
-
- if(pAktCreate->ISA(SdrPathObj))
+ if(pPathObj)
{
// The up-to-now created path needs to be set at the object to have something
// that can be visualized
- SdrPathObj& rPathObj((SdrPathObj&)(*pAktCreate));
- const basegfx::B2DPolyPolygon aCurrentPolyPolygon(rPathObj.getObjectPolyPolygon(aDragStat));
+ const basegfx::B2DPolyPolygon aCurrentPolyPolygon(pPathObj->getObjectPolyPolygon(GetDragStat()));
if(aCurrentPolyPolygon.count())
{
- rPathObj.NbcSetPathPoly(aCurrentPolyPolygon);
+ pPathObj->setB2DPolyPolygonInObjectCoordinates(aCurrentPolyPolygon);
}
- aDragPolyPolygon = rPathObj.getDragPolyPolygon(aDragStat);
+ aDragPolyPolygon = pPathObj->getDragPolyPolygon(GetDragStat());
}
// use directly the SdrObject for overlay
- mpCreateViewExtraData->CreateAndShowOverlay(*this, pAktCreate, aDragPolyPolygon);
+ mpCreateViewExtraData->CreateAndShowOverlay(*this, GetCreateObj(), aDragPolyPolygon);
}
else
{
- mpCreateViewExtraData->CreateAndShowOverlay(*this, 0, pAktCreate->TakeCreatePoly(aDragStat));
+ mpCreateViewExtraData->CreateAndShowOverlay(*this, 0, GetCreateObj()->TakeCreatePoly(GetDragStat()));
}
// #i101679# Force changed overlay to be shown
@@ -885,32 +879,31 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/)
}
}
- aDragStat.SetShown(sal_True);
+ GetDragStat().SetShown(true);
}
}
void SdrCreateView::HideCreateObj()
{
- if(IsCreateObj() && aDragStat.IsShown())
+ if(GetCreateObj() && GetDragStat().IsShown())
{
// for migration from XOR, replace DrawDragObj here to create
// overlay objects instead.
mpCreateViewExtraData->HideOverlay();
- //DrawCreateObj(pOut,bFull);
- aDragStat.SetShown(sal_False);
+ GetDragStat().SetShown(false);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-/* new interface src537 */
-sal_Bool SdrCreateView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const
+bool SdrCreateView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
{
- if(pAktCreate)
+ if(GetCreateObj())
{
- rTargetSet.Put(pAktCreate->GetMergedItemSet());
- return sal_True;
+ rTargetSet.Put(GetCreateObj()->GetMergedItemSet());
+
+ return true;
}
else
{
@@ -918,13 +911,13 @@ sal_Bool SdrCreateView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHard
}
}
-sal_Bool SdrCreateView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll)
+bool SdrCreateView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
- if(pAktCreate)
+ if(GetCreateObj())
{
- pAktCreate->SetMergedItemSetAndBroadcast(rSet, bReplaceAll);
+ GetCreateObj()->SetMergedItemSetAndBroadcast(rSet, bReplaceAll);
- return sal_True;
+ return true;
}
else
{
@@ -932,12 +925,11 @@ sal_Bool SdrCreateView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceA
}
}
-SfxStyleSheet* SdrCreateView::GetStyleSheet() const // SfxStyleSheet* SdrCreateView::GetStyleSheet(sal_Bool& rOk) const
+SfxStyleSheet* SdrCreateView::GetStyleSheet() const
{
- if (pAktCreate!=NULL)
+ if (GetCreateObj())
{
- //rOk=sal_True;
- return pAktCreate->GetStyleSheet();
+ return GetCreateObj()->GetStyleSheet();
}
else
{
@@ -945,12 +937,12 @@ SfxStyleSheet* SdrCreateView::GetStyleSheet() const // SfxStyleSheet* SdrCreateV
}
}
-sal_Bool SdrCreateView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+bool SdrCreateView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
- if (pAktCreate!=NULL)
+ if (GetCreateObj())
{
- pAktCreate->SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
- return sal_True;
+ GetCreateObj()->SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
+ return true;
}
else
{
@@ -958,3 +950,5 @@ sal_Bool SdrCreateView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDont
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svddrag.cxx b/svx/source/svdraw/svddrag.cxx
index b77c1d14edfb..1444b7d12ba9 100644
--- a/svx/source/svdraw/svddrag.cxx
+++ b/svx/source/svdraw/svddrag.cxx
@@ -26,124 +26,286 @@
#include <svx/svdview.hxx>
#include <svx/svddrag.hxx>
-void SdrDragStat::Clear(FASTBOOL bLeaveOne)
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrDragStat::SdrDragStat(SdrView& rSdrView)
+: boost::noncopyable(),
+ mpHdl(0),
+ mrSdrView(rSdrView),
+ mpDragMethod(0),
+ mpUser(0),
+ maPnts(),
+ maRef1(),
+ maRef2(),
+ maPos0(),
+ maRealPos0(),
+ maRealNow(),
+ maActionRange(),
+ mfMinMov(1.0),
+ mbEndDragChangesAttributes(false),
+ mbEndDragChangesGeoAndAttributes(false),
+ mbMouseIsUp(false),
+ mbShown(false),
+ mbMinMoved(false),
+ mbHorFixed(false),
+ mbVerFixed(false),
+ mbWantNoSnap(false),
+ mbOrtho4(false),
+ mbOrtho8(false)
+{
+}
+
+SdrDragStat::~SdrDragStat()
+{
+ if(mpUser)
+ {
+ delete mpUser;
+ mpUser = 0;
+ }
+}
+
+const basegfx::B2DPoint& SdrDragStat::GetPoint(sal_uInt32 nNum) const
+{
+ if(nNum < maPnts.size())
+ {
+ return *(maPnts.begin() + nNum);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrDragStat::GetPoint access out of range (!)");
+ return maRef1;
+ }
+}
+
+const basegfx::B2DPoint& SdrDragStat::GetStart() const
+{
+ if(!maPnts.empty())
+ {
+ return *(maPnts.begin());
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrDragStat::GetStart not possible, too less points (!)");
+ return maRef1;
+ }
+}
+
+void SdrDragStat::SetStart(const basegfx::B2DPoint& rNew)
+{
+ if(!maPnts.empty())
+ {
+ *(maPnts.begin()) = rNew;
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrDragStat::SetStart not possible, too less points (!)");
+ }
+}
+
+const basegfx::B2DPoint& SdrDragStat::GetPrev() const
+{
+ if(maPnts.size())
+ {
+ return *(maPnts.begin() + (maPnts.size() - (maPnts.size() >= 2 ? 2 : 1)));
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrDragStat::GetPrev invalid access");
+ return maRef1;
+ }
+}
+
+void SdrDragStat::SetPrev(const basegfx::B2DPoint& rNew)
+{
+ if(maPnts.size())
+ {
+ B2DPointVector::iterator aCandidate(maPnts.begin() + (maPnts.size() - (maPnts.size() >= 2 ? 2 : 1)));
+
+ if(*aCandidate != rNew)
+ {
+ *aCandidate = rNew;
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrDragStat::GetPrev invalid access");
+ }
+}
+
+const basegfx::B2DPoint& SdrDragStat::GetNow() const
+{
+ if(!maPnts.empty())
+ {
+ return *(maPnts.end() - 1);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrDragStat::GetNow not possible, too less points (!)");
+ return maRef1;
+ }
+}
+
+void SdrDragStat::SetNow(const basegfx::B2DPoint& rNew)
{
- void* pP=aPnts.First();
- while (pP!=NULL) {
- delete (Point*)pP;
- pP=aPnts.Next();
+ if(!maPnts.empty())
+ {
+ B2DPointVector::iterator aPosition(maPnts.end() - 1);
+
+ if(*aPosition != rNew)
+ {
+ *aPosition = rNew;
+ }
}
- if (pUser!=NULL) delete pUser;
- pUser=NULL;
- aPnts.Clear();
- if (bLeaveOne) {
- aPnts.Insert(new Point,CONTAINER_APPEND);
+ else
+ {
+ OSL_ENSURE(false, "SdrDragStat::SetNow not possible, too less points (!)");
}
}
void SdrDragStat::Reset()
{
- pView=NULL;
- pPageView=NULL;
- bShown=sal_False;
- nMinMov=1;
- bMinMoved=sal_False;
- bHorFixed=sal_False;
- bVerFixed=sal_False;
- bWantNoSnap=sal_False;
- pHdl=NULL;
- bOrtho4=sal_False;
- bOrtho8=sal_False;
- pDragMethod=NULL;
- bEndDragChangesAttributes=sal_False;
- bEndDragChangesGeoAndAttributes=sal_False;
- bMouseIsUp=sal_False;
- Clear(sal_True);
- aActionRect=Rectangle();
-}
-
-void SdrDragStat::Reset(const Point& rPnt)
+ mpHdl = 0;
+ mpDragMethod = 0;
+
+ if(mpUser)
+ {
+ delete mpUser;
+ mpUser = 0;
+ }
+
+ maPnts.clear();
+ maPnts.push_back(basegfx::B2DPoint());
+
+ maRef1 = maRef2 = maPos0 = maRealPos0 = maRealNow = basegfx::B2DPoint();
+
+ maActionRange.reset();
+ mfMinMov = 1.0;
+ mbEndDragChangesAttributes = false;
+ mbEndDragChangesGeoAndAttributes = false;
+ mbMouseIsUp = false;
+ mbShown = false;
+ mbMinMoved = false;
+ mbHorFixed = false;
+ mbVerFixed = false;
+ mbWantNoSnap = false;
+ mbOrtho4 = false;
+ mbOrtho8 = false;
+}
+
+void SdrDragStat::Reset(const basegfx::B2DPoint& rPnt)
{
Reset();
- Start()=rPnt;
- aPos0=rPnt;
- aRealPos0=rPnt;
- RealNow()=rPnt;
+
+ SetStart(rPnt);
+ SetPos0(rPnt);
+ maRealPos0 = rPnt;
+ SetRealNow(rPnt);
}
-void SdrDragStat::NextMove(const Point& rPnt)
+void SdrDragStat::NextMove(const basegfx::B2DPoint& rPnt)
{
- aRealPos0=GetRealNow();
- aPos0=GetNow();
- RealNow()=rPnt;
- Point aBla=KorregPos(GetRealNow(),GetPrev());
- Now()=aBla;
+ maRealPos0 = GetRealNow();
+ SetPos0(GetNow());
+ SetRealNow(rPnt);
+ SetNow(KorregPos(GetRealNow(), GetPrev()));
}
-void SdrDragStat::NextPoint(FASTBOOL bSaveReal)
+void SdrDragStat::NextPoint(bool bSaveReal)
{
- Point aPnt(GetNow());
- if (bSaveReal) aPnt=aRealNow;
- aPnts.Insert(new Point(KorregPos(GetRealNow(),aPnt)),CONTAINER_APPEND);
- Prev()=aPnt;
+ basegfx::B2DPoint aPnt(GetNow());
+
+ if(bSaveReal)
+ {
+ aPnt = maRealNow;
+ }
+
+ maPnts.push_back(KorregPos(GetRealNow(), aPnt));
+ SetPrev(aPnt);
}
void SdrDragStat::PrevPoint()
{
- if (aPnts.Count()>=2) { // einer muss immer da bleiben
- Point* pPnt=(Point*)(aPnts.GetObject(aPnts.Count()-2));
- aPnts.Remove(aPnts.Count()-2);
- delete pPnt;
- Now()=KorregPos(GetRealNow(),GetPrev());
+ if(maPnts.size() >= 2)
+ {
+ // always leave one point
+ maPnts.erase(maPnts.end() - 2);
+ SetNow(KorregPos(GetRealNow(), GetPrev()));
}
}
-Point SdrDragStat::KorregPos(const Point& rNow, const Point& /*rPrev*/) const
+basegfx::B2DPoint SdrDragStat::KorregPos(const basegfx::B2DPoint& rNow, const basegfx::B2DPoint& /*rPrev*/) const
{
- Point aRet(rNow);
+ basegfx::B2DPoint aRet(rNow);
+
return aRet;
}
-FASTBOOL SdrDragStat::CheckMinMoved(const Point& rPnt)
+bool SdrDragStat::CheckMinMoved(const basegfx::B2DPoint& rPnt)
{
- if (!bMinMoved) {
- long dx=rPnt.X()-GetPrev().X(); if (dx<0) dx=-dx;
- long dy=rPnt.Y()-GetPrev().Y(); if (dy<0) dy=-dy;
- if (dx>=long(nMinMov) || dy>=long(nMinMov))
- bMinMoved=sal_True;
+ if(!mbMinMoved)
+ {
+ mbMinMoved = basegfx::B2DVector(rPnt - GetPrev()).getLength() > GetMinMove();
}
- return bMinMoved;
+
+ return mbMinMoved;
}
-Fraction SdrDragStat::GetXFact() const
+double SdrDragStat::GetXFact() const
{
- long nMul=GetNow().X()-aRef1.X();
- long nDiv=GetPrev().X()-aRef1.X();
- if (nDiv==0) nDiv=1;
- if (bHorFixed) { nMul=1; nDiv=1; }
- return Fraction(nMul,nDiv);
+ if(IsHorFixed())
+ {
+ return 1.0;
+ }
+ else
+ {
+ const double fMul(GetNow().getX() - GetRef1().getX());
+ const double fDiv(GetPrev().getX() - GetRef1().getX());
+
+ if(basegfx::fTools::equalZero(fDiv))
+ {
+ return fMul;
+ }
+ else
+ {
+ return fMul / fDiv;
+ }
+ }
}
-Fraction SdrDragStat::GetYFact() const
+double SdrDragStat::GetYFact() const
{
- long nMul=GetNow().Y()-aRef1.Y();
- long nDiv=GetPrev().Y()-aRef1.Y();
- if (nDiv==0) nDiv=1;
- if (bVerFixed) { nMul=1; nDiv=1; }
- return Fraction(nMul,nDiv);
+ if(IsVerFixed())
+ {
+ return 1.0;
+ }
+ else
+ {
+ const double fMul(GetNow().getY() - GetRef1().getY());
+ const double fDiv(GetPrev().getY() - GetRef1().getY());
+
+ if(basegfx::fTools::equalZero(fDiv))
+ {
+ return fMul;
+ }
+ else
+ {
+ return fMul / fDiv;
+ }
+ }
}
-void SdrDragStat::TakeCreateRect(Rectangle& rRect) const
+basegfx::B2DRange SdrDragStat::TakeCreateRange() const
{
- rRect=Rectangle(GetStart(),GetNow());
- if (GetPointAnz()>=2) {
- Point aBtmRgt(GetPoint(1));
- rRect.Right()=aBtmRgt.X();
- rRect.Bottom()=aBtmRgt.Y();
- }
- if (pView!=NULL && pView->IsCreate1stPointAsCenter()) {
- rRect.Top()+=rRect.Top()-rRect.Bottom();
- rRect.Left()+=rRect.Left()-rRect.Right();
+ basegfx::B2DPoint aTopLeft(GetStart());
+ basegfx::B2DPoint aBottomRight(maPnts.size() >= 2 ? GetPoint(1) : GetNow());
+
+ if(GetSdrViewFromSdrDragStat().IsCreate1stPointAsCenter())
+ {
+ aTopLeft += aTopLeft - aBottomRight;
}
+
+ return basegfx::B2DRange(aTopLeft, aBottomRight);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svddrgm1.hxx b/svx/source/svdraw/svddrgm1.hxx
index 92cd4c280d2f..0a1467e21a15 100644
--- a/svx/source/svdraw/svddrgm1.hxx
+++ b/svx/source/svdraw/svddrgm1.hxx
@@ -24,15 +24,14 @@
#ifndef _SVDDRGM1_HXX
#define _SVDDRGM1_HXX
-#include <svx/xpoly.hxx>
#include <svx/svdhdl.hxx>
-#include <svx/svddrgv.hxx>
+#include <svx/svdview.hxx>
#include <svx/svddrgmt.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-// predeclarations
+// predefines
-class SdrDragView;
class SdrDragStat;
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -41,19 +40,16 @@ class SdrDragStat;
class SdrDragMovHdl : public SdrDragMethod
{
private:
- bool bMirrObjShown;
-
protected:
// define nothing, overload to do so
virtual void createSdrDragEntries();
public:
- TYPEINFO();
- SdrDragMovHdl(SdrDragView& rNewView);
+ SdrDragMovHdl(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual void CancelSdrDrag();
virtual Pointer GetSdrDragPointer() const;
@@ -65,24 +61,19 @@ public:
class SdrDragRotate : public SdrDragMethod
{
private:
- double nSin;
- double nCos;
- long nWink0;
- long nWink;
- bool bRight;
+ double mfStartRotation;
+ double mfDeltaRotation;
public:
- TYPEINFO();
- SdrDragRotate(SdrDragView& rNewView);
+ SdrDragRotate(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
virtual basegfx::B2DHomMatrix getCurrentTransformation();
- virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -91,27 +82,23 @@ public:
class SdrDragShear : public SdrDragMethod
{
private:
- Fraction aFact;
- long nWink0;
- long nWink;
- double nTan;
- bool bVertical; // Vertikales verzerren
- bool bResize; // Shear mit Resize
- bool bUpSideDown; // Beim Shear/Slant gespiegelt
- bool bSlant;
+ double mfStartAngle;
+ double mfDeltaAngle;
+ double mfFactor;
+
+ /// bitfield
+ bool mbVertical : 1; // Vertikales verzerren
public:
- TYPEINFO();
- SdrDragShear(SdrDragView& rNewView,bool bSlant1);
+ SdrDragShear(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
virtual basegfx::B2DHomMatrix getCurrentTransformation();
- virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -120,25 +107,16 @@ public:
class SdrDragMirror : public SdrDragMethod
{
private:
- Point aDif;
- long nWink;
- bool bMirrored;
- bool bSide0;
-
- bool ImpCheckSide(const Point& rPnt) const;
-
public:
- TYPEINFO();
- SdrDragMirror(SdrDragView& rNewView);
+ SdrDragMirror(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
virtual basegfx::B2DHomMatrix getCurrentTransformation();
- virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -151,17 +129,16 @@ private:
SdrHdlGradient* pIAOHandle;
// is this for gradient (or for transparence) ?
- unsigned bIsGradient : 1;
+ bool bIsGradient : 1;
public:
- TYPEINFO();
- SdrDragGradient(SdrDragView& rNewView, bool bGrad = true);
+ SdrDragGradient(SdrView& rNewView, bool bGrad = true);
bool IsGradient() const { return bIsGradient; }
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
virtual void CancelSdrDrag();
@@ -173,45 +150,49 @@ public:
class SdrDragCrook : public SdrDragMethod
{
private:
- Rectangle aMarkRect;
- Point aMarkCenter;
- Point aCenter;
- Point aStart;
- Fraction aFact;
- Point aRad;
- bool bContortionAllowed;
- bool bNoContortionAllowed;
- bool bContortion;
- bool bResizeAllowed;
- bool bResize;
- bool bRotateAllowed;
- bool bRotate;
- bool bVertical;
- bool bValid;
- bool bLft;
- bool bRgt;
- bool bUpr;
- bool bLwr;
- bool bAtCenter;
- long nWink;
- long nMarkSize;
- SdrCrookMode eMode;
+ basegfx::B2DRange maMarkedRange;
+
+ basegfx::B2DPoint maMarkedCenter;
+ basegfx::B2DPoint maCenter;
+ basegfx::B2DPoint maStart;
+ basegfx::B2DPoint maRadius;
+
+ double mfFactor;
+ double mfAngle;
+ double mfMarkedSize;
+
+ SdrCrookMode meMode;
+
+ /// bitfield
+ bool mbContortionAllowed : 1;
+ bool mbNoContortionAllowed : 1;
+ bool mbContortion : 1;
+ bool mbResizeAllowed : 1;
+ bool mbResize : 1;
+ bool mbRotateAllowed : 1;
+ bool mbRotate : 1;
+ bool mbVertical : 1;
+ bool mbValid : 1;
+ bool mbLeft : 1;
+ bool mbRight : 1;
+ bool mbTop : 1;
+ bool mbBottom : 1;
+ bool mbAtCenter : 1;
// helpers for applyCurrentTransformationToPolyPolygon
void _MovAllPoints(basegfx::B2DPolyPolygon& rTarget);
- void _MovCrookPoint(Point& rPnt, Point* pC1, Point* pC2);
+ void _MovCrookPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2);
protected:
// needs to add drag geometry to the default
virtual void createSdrDragEntries();
public:
- TYPEINFO();
- SdrDragCrook(SdrDragView& rNewView);
+ SdrDragCrook(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
@@ -225,12 +206,14 @@ public:
class SdrDragDistort : public SdrDragMethod
{
private:
- Rectangle aMarkRect;
- XPolygon aDistortedRect;
- sal_uInt16 nPolyPt;
- bool bContortionAllowed;
- bool bNoContortionAllowed;
- bool bContortion;
+ basegfx::B2DRange maMarkedRange;
+ basegfx::B2DPolygon maDistortedRangePolygon;
+ sal_uInt32 mnPointIndex;
+
+ /// bitfield
+ bool mbContortionAllowed : 1;
+ bool mbNoContortionAllowed : 1;
+ bool mbContortion : 1;
// helper for applyCurrentTransformationToPolyPolygon
void _MovAllPoints(basegfx::B2DPolyPolygon& rTarget);
@@ -240,12 +223,11 @@ protected:
virtual void createSdrDragEntries();
public:
- TYPEINFO();
- SdrDragDistort(SdrDragView& rNewView);
+ SdrDragDistort(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool BeginSdrDrag();
- virtual void MoveSdrDrag(const Point& rPnt);
+ virtual void MoveSdrDrag(const basegfx::B2DPoint& rPnt);
virtual bool EndSdrDrag(bool bCopy);
virtual Pointer GetSdrDragPointer() const;
@@ -259,8 +241,7 @@ public:
class SdrDragCrop : public SdrDragResize
{
public:
- TYPEINFO();
- SdrDragCrop(SdrDragView& rNewView);
+ SdrDragCrop(SdrView& rNewView);
virtual void TakeSdrDragComment(String& rStr) const;
virtual bool EndSdrDrag(bool bCopy);
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index d193d54e2aab..1632d36531c5 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -37,7 +37,6 @@
#include <svx/svdetc.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdundo.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svdpagv.hxx>
#include "svx/svdstr.hrc" // Namen aus der Resource
@@ -63,7 +62,7 @@
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdopath.hxx>
#include <svx/polypolygoneditor.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
@@ -72,12 +71,12 @@
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <svx/svdoole2.hxx>
-#include <svx/svdovirt.hxx>
#include <svx/svdouno.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/attribute/sdrlineattribute.hxx>
#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <svx/svdlegacy.hxx>
#include <map>
#include <vector>
@@ -150,7 +149,7 @@ SdrDragEntrySdrObject::~SdrDragEntrySdrObject()
{
if(mpClone)
{
- SdrObject::Free(mpClone);
+ deleteSdrObjectSafeAndClearPointer(mpClone);
}
}
@@ -159,16 +158,9 @@ void SdrDragEntrySdrObject::prepareCurrentState(SdrDragMethod& rDragMethod)
// for the moment, i need to re-create the clone in all cases. I need to figure
// out when clone and original have the same class, so that i can use operator=
// in those cases
-
- // // copy all other needed stuff
- // basegfx::B2DHomMatrix aMatrix;
- // basegfx::B2DPolyPolygon aPolyPolygon;
- // pOleObject->TRGetBaseGeometry(aMatrix, aPolyPolygon);
- // pClone->TRSetBaseGeometry(aMatrix, aPolyPolygon);
-
if(mpClone)
{
- SdrObject::Free(mpClone);
+ deleteSdrObjectSafeAndClearPointer(mpClone);
mpClone = 0;
}
@@ -250,7 +242,7 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragEntryPointGlueDrag::create
{
drawinglayer::primitive2d::Primitive2DSequence aRetval;
- if(!maPositions.empty())
+ if(maPositions.size())
{
basegfx::B2DPolygon aPolygon;
sal_uInt32 a(0);
@@ -307,7 +299,20 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragEntryPointGlueDrag::create
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT0(SdrDragMethod);
+const basegfx::B2DRange& SdrDragMethod::GetMarkedRange() const
+{
+ if(HDL_POLY == getSdrView().GetDragHdlKind())
+ {
+ return getSdrView().getMarkedPointRange();
+ }
+
+ if(HDL_GLUE == getSdrView().GetDragHdlKind())
+ {
+ return getSdrView().getMarkedGluePointRange();
+ }
+
+ return getSdrView().getMarkedObjectSnapRange();
+}
void SdrDragMethod::resetSdrDragEntries()
{
@@ -340,13 +345,13 @@ void SdrDragMethod::addSdrDragEntry(SdrDragEntry* pNew)
void SdrDragMethod::createSdrDragEntries()
{
- if(getSdrDragView().GetSdrPageView() && getSdrDragView().GetSdrPageView()->HasMarkedObjPageView())
+ if(getSdrView().GetSdrPageView())
{
- if(getSdrDragView().IsDraggingPoints())
+ if(getSdrView().IsDraggingPoints())
{
createSdrDragEntries_PointDrag();
}
- else if(getSdrDragView().IsDraggingGluePoints())
+ else if(getSdrView().IsDraggingGluePoints())
{
createSdrDragEntries_GlueDrag();
}
@@ -373,57 +378,46 @@ void SdrDragMethod::createSdrDragEntryForSdrObject(const SdrObject& rOriginal, s
void SdrDragMethod::createSdrDragEntries_SolidDrag()
{
- const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount());
- SdrPageView* pPV = getSdrDragView().GetSdrPageView();
+ SdrPageView* pPV = getSdrView().GetSdrPageView();
- if(pPV)
+ if(pPV && pPV->PageWindowCount())
{
- for(sal_uInt32 a(0); a < nMarkAnz; a++)
+ sdr::contact::ObjectContact& rOC = pPV->GetPageWindow(0)->GetObjectContact();
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(a);
+ const SdrObject* pObject = aSelection[a];
+ SdrObjListIter aIter(*pObject);
- if(pM->GetPageView() == pPV)
+ while(aIter.IsMore())
{
- const SdrObject* pObject = pM->GetMarkedSdrObj();
+ SdrObject* pCandidate = aIter.Next();
- if(pObject)
+ if(pCandidate)
{
- if(pPV->PageWindowCount())
+ const bool bSuppressFullDrag(!pCandidate->supportsFullDrag());
+ bool bAddWireframe(bSuppressFullDrag);
+
+ if(!bAddWireframe && !pCandidate->HasLineStyle())
{
- sdr::contact::ObjectContact& rOC = pPV->GetPageWindow(0)->GetObjectContact();
- SdrObjListIter aIter(*pObject);
+ // add wireframe for objects without outline
+ bAddWireframe = true;
+ }
- while(aIter.IsMore())
- {
- SdrObject* pCandidate = aIter.Next();
+ if(!bSuppressFullDrag)
+ {
+ // add full obejct drag; Clone() at the object has to work
+ // for this
+ createSdrDragEntryForSdrObject(*pCandidate, rOC, true);
+ }
- if(pCandidate)
- {
- const bool bSuppressFullDrag(!pCandidate->supportsFullDrag());
- bool bAddWireframe(bSuppressFullDrag);
-
- if(!bAddWireframe && !pCandidate->HasLineStyle())
- {
- // add wireframe for objects without outline
- bAddWireframe = true;
- }
-
- if(!bSuppressFullDrag)
- {
- // add full obejct drag; Clone() at the object has to work
- // for this
- createSdrDragEntryForSdrObject(*pCandidate, rOC, true);
- }
-
- if(bAddWireframe)
- {
- // when dragging a 50% transparent copy of a filled or not filled object without
- // outline, this is normally hard to see. Add extra wireframe in that case. This
- // works nice e.g. with thext frames etc.
- addSdrDragEntry(new SdrDragEntryPolyPolygon(pCandidate->TakeXorPoly()));
- }
- }
- }
+ if(bAddWireframe)
+ {
+ // when dragging a 50% transparent copy of a filled or not filled object without
+ // outline, this is normally hard to see. Add extra wireframe in that case. This
+ // works nice e.g. with thext frames etc.
+ addSdrDragEntry(new SdrDragEntryPolyPolygon(pCandidate->TakeXorPoly()));
}
}
}
@@ -433,41 +427,35 @@ void SdrDragMethod::createSdrDragEntries_SolidDrag()
void SdrDragMethod::createSdrDragEntries_PolygonDrag()
{
- const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount());
- bool bNoPolygons(getSdrDragView().IsNoDragXorPolys() || nMarkAnz > getSdrDragView().GetDragXorPolyLimit());
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bNoPolygons(getSdrView().IsNoDragXorPolys() || aSelection.size() > 1200); // DragXorPolyLimit, was at 100
basegfx::B2DPolyPolygon aResult;
sal_uInt32 nPointCount(0);
- for(sal_uInt32 a(0); !bNoPolygons && a < nMarkAnz; a++)
+ for(sal_uInt32 a(0); !bNoPolygons && a < aSelection.size(); a++)
{
- SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(a);
+ const basegfx::B2DPolyPolygon aNewPolyPolygon(aSelection[a]->TakeXorPoly());
- if(pM->GetPageView() == getSdrDragView().GetSdrPageView())
+ for(sal_uInt32 b(0); b < aNewPolyPolygon.count(); b++)
{
- const basegfx::B2DPolyPolygon aNewPolyPolygon(pM->GetMarkedSdrObj()->TakeXorPoly());
-
- for(sal_uInt32 b(0); b < aNewPolyPolygon.count(); b++)
- {
- nPointCount += aNewPolyPolygon.getB2DPolygon(b).count();
- }
+ nPointCount += aNewPolyPolygon.getB2DPolygon(b).count();
+ }
- if(nPointCount > getSdrDragView().GetDragXorPointLimit())
- {
- bNoPolygons = true;
- }
+ if(nPointCount > 50000) // old DragXorPointLimit, was at 500
+ {
+ bNoPolygons = true;
+ }
- if(!bNoPolygons)
- {
- aResult.append(aNewPolyPolygon);
- }
+ if(!bNoPolygons)
+ {
+ aResult.append(aNewPolyPolygon);
}
}
if(bNoPolygons)
{
- const Rectangle aR(getSdrDragView().GetSdrPageView()->MarkSnap());
- const basegfx::B2DRange aNewRectangle(aR.Left(), aR.Top(), aR.Right(), aR.Bottom());
- basegfx::B2DPolygon aNewPolygon(basegfx::tools::createPolygonFromRect(aNewRectangle));
+ const basegfx::B2DRange aNewRange(sdr::legacy::GetAllObjBoundRange(aSelection));
+ basegfx::B2DPolygon aNewPolygon(basegfx::tools::createPolygonFromRect(aNewRange));
aResult = basegfx::B2DPolyPolygon(basegfx::tools::expandToCurve(aNewPolygon));
}
@@ -480,36 +468,31 @@ void SdrDragMethod::createSdrDragEntries_PolygonDrag()
void SdrDragMethod::createSdrDragEntries_PointDrag()
{
- const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount());
- std::vector< basegfx::B2DPoint > aPositions;
-
- for(sal_uInt32 nm(0); nm < nMarkAnz; nm++)
+ if(getSdrView().areSdrObjectsSelected())
{
- SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(nm);
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
+ std::vector< basegfx::B2DPoint > aPositions;
- if(pM->GetPageView() == getSdrDragView().GetSdrPageView())
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- const SdrUShortCont* pPts = pM->GetMarkedPoints();
+ const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >(aSelection[nm]);
- if(pPts && pPts->GetCount())
+ if(pPath)
{
- const SdrObject* pObj = pM->GetMarkedSdrObj();
- const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >(pObj);
+ const sdr::selection::Indices aMarkedPoints(getSdrView().getSelectedPointsForSelectedSdrObject(*pPath));
- if(pPath)
+ if(aMarkedPoints.size())
{
- const basegfx::B2DPolyPolygon aPathXPP = pPath->GetPathPoly();
+ const basegfx::B2DPolyPolygon aPathXPP(pPath->getB2DPolyPolygonInObjectCoordinates());
if(aPathXPP.count())
{
- const sal_uInt32 nPtAnz(pPts->GetCount());
-
- for(sal_uInt32 nPtNum(0); nPtNum < nPtAnz; nPtNum++)
+ for(sdr::selection::Indices::const_iterator aMarkedPoint(aMarkedPoints.begin());
+ aMarkedPoint != aMarkedPoints.end(); aMarkedPoint++)
{
sal_uInt32 nPolyNum, nPointNum;
- const sal_uInt16 nObjPt(pPts->GetObject(nPtNum));
- if(sdr::PolyPolygonEditor::GetRelativePolyPoint(aPathXPP, nObjPt, nPolyNum, nPointNum))
+ if(sdr::PolyPolygonEditor::GetRelativePolyPoint(aPathXPP, *aMarkedPoint, nPolyNum, nPointNum))
{
aPositions.push_back(aPathXPP.getB2DPolygon(nPolyNum).getB2DPoint(nPointNum));
}
@@ -518,129 +501,92 @@ void SdrDragMethod::createSdrDragEntries_PointDrag()
}
}
}
- }
- if(!aPositions.empty())
- {
- addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, true));
+ if(aPositions.size())
+ {
+ addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, true));
+ }
}
}
void SdrDragMethod::createSdrDragEntries_GlueDrag()
{
- const sal_uInt32 nMarkAnz(getSdrDragView().GetMarkedObjectCount());
- std::vector< basegfx::B2DPoint > aPositions;
-
- for(sal_uInt32 nm(0); nm < nMarkAnz; nm++)
+ if(getSdrView().areSdrObjectsSelected())
{
- SdrMark* pM = getSdrDragView().GetSdrMarkByIndex(nm);
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
+ std::vector< basegfx::B2DPoint > aPositions;
- if(pM->GetPageView() == getSdrDragView().GetSdrPageView())
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- const SdrUShortCont* pPts = pM->GetMarkedGluePoints();
+ const sdr::selection::Indices aMarkedGluePoints(getSdrView().getSelectedGluesForSelectedSdrObject(*aSelection[nm]));
- if(pPts && pPts->GetCount())
+ if(aMarkedGluePoints.size())
{
- const SdrObject* pObj = pM->GetMarkedSdrObj();
- const SdrGluePointList* pGPL = pObj->GetGluePointList();
+ const SdrGluePointList* pGPL = aSelection[nm]->GetGluePointList();
if(pGPL)
{
- const sal_uInt32 nPtAnz(pPts->GetCount());
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(*aSelection[nm]));
- for(sal_uInt32 nPtNum(0); nPtNum < nPtAnz; nPtNum++)
+ for(sdr::selection::Indices::const_iterator aCurrent(aMarkedGluePoints.begin());
+ aCurrent != aMarkedGluePoints.end(); aCurrent++)
{
- const sal_uInt16 nObjPt(pPts->GetObject(nPtNum));
- const sal_uInt16 nGlueNum(pGPL->FindGluePoint(nObjPt));
+ const sal_uInt32 nObjPt(*aCurrent);
+ const sal_uInt32 nGlueNum(pGPL->FindGluePoint(nObjPt));
if(SDRGLUEPOINT_NOTFOUND != nGlueNum)
{
- const Point aPoint((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
- aPositions.push_back(basegfx::B2DPoint(aPoint.X(), aPoint.Y()));
+ aPositions.push_back((*pGPL)[nGlueNum].GetAbsolutePos(aSnapRange));
}
}
}
}
}
- }
- if(!aPositions.empty())
- {
- addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, false));
+ if(aPositions.size())
+ {
+ addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, false));
+ }
}
}
-void SdrDragMethod::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 nVal) const
+void SdrDragMethod::TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 nVal) const
{
- sal_uInt16 nOpt=0;
- if (IsDraggingPoints()) {
- nOpt=IMPSDR_POINTSDESCRIPTION;
- } else if (IsDraggingGluePoints()) {
- nOpt=IMPSDR_GLUEPOINTSDESCRIPTION;
- }
- getSdrDragView().ImpTakeDescriptionStr(nStrCacheID,rStr,nVal,nOpt);
-}
+ sal_uInt16 nOpt(0);
-SdrObject* SdrDragMethod::GetDragObj() const
-{
- SdrObject* pObj=NULL;
- if (getSdrDragView().pDragHdl!=NULL) pObj=getSdrDragView().pDragHdl->GetObj();
- if (pObj==NULL) pObj=getSdrDragView().pMarkedObj;
- return pObj;
-}
+ if(IsDraggingPoints())
+ {
+ nOpt = IMPSDR_POINTSDESCRIPTION;
+ }
+ else if(IsDraggingGluePoints())
+ {
+ nOpt = IMPSDR_GLUEPOINTSDESCRIPTION;
+ }
-SdrPageView* SdrDragMethod::GetDragPV() const
-{
- SdrPageView* pPV=NULL;
- if (getSdrDragView().pDragHdl!=NULL) pPV=getSdrDragView().pDragHdl->GetPageView();
- if (pPV==NULL) pPV=getSdrDragView().pMarkedPV;
- return pPV;
+ getSdrView().TakeMarkedDescriptionString(nStrCacheID, rStr, nVal, nOpt);
}
-void SdrDragMethod::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
+SdrObject* SdrDragMethod::GetDragObj() const
{
- // the original applies the transformation using TRGetBaseGeometry/TRSetBaseGeometry.
- // Later this should be the only needed one for linear transforms (not for SdrDragCrook and
- // SdrDragDistort, those are NOT linear). Currently, this can not yet be used since the
- // special handling of rotate/mirror due to the not-being-able to handle it in the old
- // drawinglayer stuff. Text would currently not correctly be mirrored in the preview.
- basegfx::B2DHomMatrix aObjectTransform;
- basegfx::B2DPolyPolygon aObjectPolyPolygon;
- bool bPolyUsed(rTarget.TRGetBaseGeometry(aObjectTransform, aObjectPolyPolygon));
+ SdrObject* pObj = 0;
- // apply transform to object transform
- aObjectTransform *= getCurrentTransformation();
-
- if(bPolyUsed)
+ if(getSdrView().GetDragHdl())
{
- // do something special since the object size is in the polygon
- // break up matrix to get the scale
- basegfx::B2DTuple aScale;
- basegfx::B2DTuple aTranslate;
- double fRotate, fShearX;
- aObjectTransform.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // get polygon's pos and size
- const basegfx::B2DRange aPolyRange(aObjectPolyPolygon.getB2DRange());
-
- // get the scaling factors (do not mirror, this is in the object transformation)
- const double fScaleX(fabs(aScale.getX()) / (basegfx::fTools::equalZero(aPolyRange.getWidth()) ? 1.0 : aPolyRange.getWidth()));
- const double fScaleY(fabs(aScale.getY()) / (basegfx::fTools::equalZero(aPolyRange.getHeight()) ? 1.0 : aPolyRange.getHeight()));
-
- // prepare transform matrix for polygon
- basegfx::B2DHomMatrix aPolyTransform(basegfx::tools::createTranslateB2DHomMatrix(
- -aPolyRange.getMinX(), -aPolyRange.getMinY()));
- aPolyTransform.scale(fScaleX, fScaleY);
-
- // normally the poly should be moved back, but the translation is in the object
- // transformation and thus does not need to be done
- // aPolyTransform.translate(-aPolyRange.getMinX(), -aPolyRange.getMinY());
+ pObj = const_cast< SdrObject*>(getSdrView().GetDragHdl()->GetObj());
+ }
- // transform the polygon
- aObjectPolyPolygon.transform(aPolyTransform);
+ if(!pObj)
+ {
+ pObj = getSdrView().getSelectedIfSingle();
}
- rTarget.TRSetBaseGeometry(getCurrentTransformation() * aObjectTransform, aObjectPolyPolygon);
+ return pObj;
+}
+
+void SdrDragMethod::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
+{
+ // use get/setSdrObjectTransformation now. This will also work when object has a path
+ rTarget.setSdrObjectTransformation(getCurrentTransformation() * rTarget.getSdrObjectTransformation());
}
void SdrDragMethod::applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon& rTarget)
@@ -649,12 +595,12 @@ void SdrDragMethod::applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPoly
rTarget.transform(getCurrentTransformation());
}
-SdrDragMethod::SdrDragMethod(SdrDragView& rNewView)
+SdrDragMethod::SdrDragMethod(SdrView& rNewView)
: maSdrDragEntries(),
maOverlayObjectList(),
- mrSdrDragView(rNewView),
+ mrSdrView(rNewView),
mbMoveOnly(false),
- mbSolidDraggingActive(getSdrDragView().IsSolidDragging())
+ mbSolidDraggingActive(getSdrView().IsSolidDragging())
{
if(mbSolidDraggingActive && Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
@@ -670,12 +616,12 @@ SdrDragMethod::~SdrDragMethod()
void SdrDragMethod::Show()
{
- getSdrDragView().ShowDragObj();
+ getSdrView().ShowDragObj();
}
void SdrDragMethod::Hide()
{
- getSdrDragView().HideDragObj();
+ getSdrView().HideDragObj();
}
basegfx::B2DHomMatrix SdrDragMethod::getCurrentTransformation()
@@ -701,14 +647,14 @@ typedef std::map< const SdrObject*, SdrObject*, compareConstSdrObjectRefs> SdrOb
void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlayManager)
{
// create SdrDragEntries on demand
- if(maSdrDragEntries.empty())
+ if(!maSdrDragEntries.size())
{
createSdrDragEntries();
}
// if there are entries, derive OverlayObjects from the entries, including
// modification from current interactive state
- if(!maSdrDragEntries.empty())
+ if(maSdrDragEntries.size())
{
// #54102# SdrDragEntrySdrObject creates clones of SdrObjects as base for creating the needed
// primitives, holding the original and the clone. If connectors (Edges) are involved,
@@ -832,15 +778,15 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay
}
// evtl add DragStripes (help lines cross the page when dragging)
- if(getSdrDragView().IsDragStripes())
+ if(getSdrView().IsDragStripes())
{
- Rectangle aActionRectangle;
- getSdrDragView().TakeActionRect(aActionRectangle);
-
- const basegfx::B2DPoint aTopLeft(aActionRectangle.Left(), aActionRectangle.Top());
- const basegfx::B2DPoint aBottomRight(aActionRectangle.Right(), aActionRectangle.Bottom());
- sdr::overlay::OverlayRollingRectangleStriped* pNew = new sdr::overlay::OverlayRollingRectangleStriped(
- aTopLeft, aBottomRight, true, false);
+ const basegfx::B2DRange aActionRange(getSdrView().TakeActionRange());
+ sdr::overlay::OverlayRollingRectangleStriped* pNew =
+ new sdr::overlay::OverlayRollingRectangleStriped(
+ aActionRange.getMinimum(),
+ aActionRange.getMaximum(),
+ true,
+ false);
rOverlayManager.add(*pNew);
addToOverlayObjectList(*pNew);
@@ -854,42 +800,35 @@ void SdrDragMethod::destroyOverlayGeometry()
bool SdrDragMethod::DoAddConnectorOverlays()
{
- // these conditions are translated from SdrDragView::ImpDrawEdgeXor
- const SdrMarkList& rMarkedNodes = getSdrDragView().GetEdgesOfMarkedNodes();
-
- if(!rMarkedNodes.GetMarkCount())
- {
- return false;
- }
-
- if(!getSdrDragView().IsRubberEdgeDragging() && !getSdrDragView().IsDetailedEdgeDragging())
- {
- return false;
- }
-
- if(getSdrDragView().IsDraggingPoints() || getSdrDragView().IsDraggingGluePoints())
+ if(getSdrView().areSdrObjectsSelected())
{
- return false;
- }
+ if(!getMoveOnly() && !(
+ dynamic_cast< SdrDragMove* >(this) ||
+ dynamic_cast< SdrDragResize* >(this) ||
+ dynamic_cast< SdrDragRotate* >(this) ||
+ dynamic_cast< SdrDragMirror* >(this)))
+ {
+ return false;
+ }
- if(!getMoveOnly() && !(
- IS_TYPE(SdrDragMove, this) || IS_TYPE(SdrDragResize, this) ||
- IS_TYPE(SdrDragRotate,this) || IS_TYPE(SdrDragMirror,this)))
- {
- return false;
- }
+ if(getSdrView().IsDraggingPoints() || getSdrView().IsDraggingGluePoints())
+ {
+ return false;
+ }
- const bool bDetail(getSdrDragView().IsDetailedEdgeDragging() && getMoveOnly());
+ if(dynamic_cast< SdrDragObjOwn* >(this) || dynamic_cast< SdrDragMovHdl* >(this))
+ {
+ return false;
+ }
- if(!bDetail && !getSdrDragView().IsRubberEdgeDragging())
- {
- return false;
- }
+ /// get all SdrEdgeObj which are connected to selected SdrObjects, but not selected themselves
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
+ const ::std::vector< SdrEdgeObj* > aConnectedSdrEdgeObjs(getAllSdrEdgeObjConnectedToSdrObjectVector(aSelection, false));
- // one more migrated from SdrEdgeObj::NspToggleEdgeXor
- if(IS_TYPE(SdrDragObjOwn, this) || IS_TYPE(SdrDragMovHdl, this))
- {
- return false;
+ if(!aConnectedSdrEdgeObjs.size())
+ {
+ return false;
+ }
}
return true;
@@ -898,76 +837,77 @@ bool SdrDragMethod::DoAddConnectorOverlays()
drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverlays()
{
drawinglayer::primitive2d::Primitive2DSequence aRetval;
- const bool bDetail(getSdrDragView().IsDetailedEdgeDragging() && getMoveOnly());
- const SdrMarkList& rMarkedNodes = getSdrDragView().GetEdgesOfMarkedNodes();
+ const bool bDetail(getMoveOnly());
- for(sal_uInt16 a(0); a < rMarkedNodes.GetMarkCount(); a++)
+ if(getSdrView().areSdrObjectsSelected())
{
- SdrMark* pEM = rMarkedNodes.GetMark(a);
+ /// get all SdrEdgeObj which are connected to selected SdrObjects, but not selected themselves
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
+ const ::std::vector< SdrEdgeObj* > aConnectedSdrEdgeObjs(getAllSdrEdgeObjConnectedToSdrObjectVector(aSelection, false));
- if(pEM && pEM->GetMarkedSdrObj())
+ for(sal_uInt32 a(0); a < aConnectedSdrEdgeObjs.size(); a++)
{
- SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(pEM->GetMarkedSdrObj());
+ const SdrEdgeObj* pEdge = aConnectedSdrEdgeObjs[a];
+ const SdrObject* pCon1(pEdge->GetConnectedNode(true));
+ const SdrObject* pCon2(pEdge->GetConnectedNode(false));
+ const bool bCon1(pCon1 && getSdrView().isSdrObjectSelected(*pCon1));
+ const bool bCon2(pCon2 && getSdrView().isSdrObjectSelected(*pCon2));
+ const basegfx::B2DPolygon aEdgePolygon(pEdge->ImplAddConnectorOverlay(*this, bCon1, bCon2, bDetail));
- if(pEdge)
+ if(aEdgePolygon.count())
{
- const basegfx::B2DPolygon aEdgePolygon(pEdge->ImplAddConnectorOverlay(*this, pEM->IsCon1(), pEM->IsCon2(), bDetail));
+ // this polygon is a temporary calculated connector path, so it is not possible to fetch
+ // the needed primitives directly from the pEdge object which does not get changed. If full
+ // drag is on, use the SdrObjects ItemSet to create a adequate representation
+ bool bUseSolidDragging(getSolidDraggingActive());
- if(aEdgePolygon.count())
+ if(bUseSolidDragging)
{
- // this polygon is a temporary calculated connector path, so it is not possible to fetch
- // the needed primitives directly from the pEdge object which does not get changed. If full
- // drag is on, use the SdrObjects ItemSet to create a adequate representation
- bool bUseSolidDragging(getSolidDraggingActive());
-
- if(bUseSolidDragging)
+ // switch off solid dragging if connector is not visible
+ if(!pEdge->HasLineStyle())
{
- // switch off solid dragging if connector is not visible
- if(!pEdge->HasLineStyle())
- {
- bUseSolidDragging = false;
- }
+ bUseSolidDragging = false;
}
+ }
- if(bUseSolidDragging)
- {
- const SfxItemSet& rItemSet = pEdge->GetMergedItemSet();
- const drawinglayer::attribute::SdrLineAttribute aLine(
- drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet));
+ if(bUseSolidDragging)
+ {
+ const SfxItemSet& rItemSet = pEdge->GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineAttribute aLine(
+ drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet));
- if(!aLine.isDefault())
- {
- const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd(
- drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(
- rItemSet,
- aLine.getWidth()));
-
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(
- aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive(
- aEdgePolygon,
- basegfx::B2DHomMatrix(),
- aLine,
- aLineStartEnd));
- }
- }
- else
+ if(!aLine.isDefault())
{
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- basegfx::BColor aColA(aSvtOptionsDrawinglayer.GetStripeColorA().getBColor());
- basegfx::BColor aColB(aSvtOptionsDrawinglayer.GetStripeColorB().getBColor());
- const double fStripeLength(aSvtOptionsDrawinglayer.GetStripeLength());
-
- if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
- {
- aColA = aColB = Application::GetSettings().GetStyleSettings().GetHighlightColor().getBColor();
- aColB.invert();
- }
+ const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd(
+ drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(
+ rItemSet,
+ aLine.getWidth()));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(
+ aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive(
+ aEdgePolygon,
+ basegfx::B2DHomMatrix(),
+ aLine,
+ aLineStartEnd));
+ }
+ }
+ else
+ {
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ basegfx::BColor aColA(aSvtOptionsDrawinglayer.GetStripeColorA().getBColor());
+ basegfx::BColor aColB(aSvtOptionsDrawinglayer.GetStripeColorB().getBColor());
+ const double fStripeLength(aSvtOptionsDrawinglayer.GetStripeLength());
- drawinglayer::primitive2d::Primitive2DReference aPolyPolygonMarkerPrimitive2D(
- new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
- basegfx::B2DPolyPolygon(aEdgePolygon), aColA, aColB, fStripeLength));
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aPolyPolygonMarkerPrimitive2D);
+ if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ aColA = aColB = Application::GetSettings().GetStyleSettings().GetHighlightColor().getBColor();
+ aColB.invert();
}
+
+ drawinglayer::primitive2d::Primitive2DReference aPolyPolygonMarkerPrimitive2D(
+ new drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D(
+ basegfx::B2DPolyPolygon(aEdgePolygon), aColA, aColB, fStripeLength));
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aPolyPolygonMarkerPrimitive2D);
}
}
}
@@ -978,11 +918,8 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragMovHdl,SdrDragMethod);
-
-SdrDragMovHdl::SdrDragMovHdl(SdrDragView& rNewView)
-: SdrDragMethod(rNewView),
- bMirrObjShown(false)
+SdrDragMovHdl::SdrDragMovHdl(SdrView& rNewView)
+: SdrDragMethod(rNewView)
{
}
@@ -995,7 +932,7 @@ void SdrDragMovHdl::createSdrDragEntries()
void SdrDragMovHdl::TakeSdrDragComment(XubString& rStr) const
{
rStr=ImpGetResStr(STR_DragMethMovHdl);
- if (getSdrDragView().IsDragWithCopy()) rStr+=ImpGetResStr(STR_EditWithCopy);
+ if (getSdrView().IsDragWithCopy()) rStr+=ImpGetResStr(STR_EditWithCopy);
}
bool SdrDragMovHdl::BeginSdrDrag()
@@ -1003,139 +940,170 @@ bool SdrDragMovHdl::BeginSdrDrag()
if( !GetDragHdl() )
return false;
- DragStat().Ref1()=GetDragHdl()->GetPos();
+ DragStat().SetRef1(GetDragHdl()->getPosition());
DragStat().SetShown(!DragStat().IsShown());
- SdrHdlKind eKind=GetDragHdl()->GetKind();
- SdrHdl* pH1=GetHdlList().GetHdl(HDL_REF1);
- SdrHdl* pH2=GetHdlList().GetHdl(HDL_REF2);
- if (eKind==HDL_MIRX)
+ const SdrHdlKind eKind(GetDragHdl()->GetKind());
+ SdrHdl* pH1 = GetHdlList().GetHdlByKind(HDL_REF1);
+ SdrHdl* pH2 = GetHdlList().GetHdlByKind(HDL_REF2);
+
+ if(HDL_MIRX == eKind)
{
- if (pH1==NULL || pH2==NULL)
+ if(!pH1 || !pH2)
{
DBG_ERROR("SdrDragMovHdl::BeginSdrDrag(): Verschieben der Spiegelachse: Referenzhandles nicht gefunden");
return false;
}
- DragStat().SetActionRect(Rectangle(pH1->GetPos(),pH2->GetPos()));
+ DragStat().SetActionRange(basegfx::B2DRange(pH1->getPosition(), pH2->getPosition()));
}
else
{
- Point aPt(GetDragHdl()->GetPos());
- DragStat().SetActionRect(Rectangle(aPt,aPt));
+ const basegfx::B2DPoint aPt(GetDragHdl()->getPosition());
+
+ DragStat().SetActionRange(basegfx::B2DRange(aPt,aPt));
}
return true;
}
-void SdrDragMovHdl::MoveSdrDrag(const Point& rNoSnapPnt)
+void SdrDragMovHdl::MoveSdrDrag(const basegfx::B2DPoint& rNoSnapPnt)
{
- Point aPnt(rNoSnapPnt);
-
- if ( GetDragHdl() && DragStat().CheckMinMoved(rNoSnapPnt))
+ if(GetDragHdl() && DragStat().CheckMinMoved(rNoSnapPnt))
{
- if (GetDragHdl()->GetKind()==HDL_MIRX)
+ basegfx::B2DPoint aPnt(rNoSnapPnt);
+
+ if(HDL_MIRX == GetDragHdl()->GetKind())
{
- SdrHdl* pH1=GetHdlList().GetHdl(HDL_REF1);
- SdrHdl* pH2=GetHdlList().GetHdl(HDL_REF2);
+ SdrHdl* pH1 = GetHdlList().GetHdlByKind(HDL_REF1);
+ SdrHdl* pH2 = GetHdlList().GetHdlByKind(HDL_REF2);
- if (pH1==NULL || pH2==NULL)
+ if(!pH1 || !pH2)
+ {
return;
+ }
- if (!DragStat().IsNoSnap())
+ if(!DragStat().IsNoSnap())
{
- long nBestXSnap=0;
- long nBestYSnap=0;
- bool bXSnapped=false;
- bool bYSnapped=false;
- Point aDif(aPnt-DragStat().GetStart());
- getSdrDragView().CheckSnap(Ref1()+aDif,NULL,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
- getSdrDragView().CheckSnap(Ref2()+aDif,NULL,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
- aPnt.X()+=nBestXSnap;
- aPnt.Y()+=nBestYSnap;
+ const basegfx::B2DVector aOffset(aPnt - DragStat().GetStart());
+ const basegfx::B2DPoint aPossibleRef1(GetRef1() + aOffset);
+ const basegfx::B2DPoint aPossibleRef2(GetRef2() + aOffset);
+ const basegfx::B2DVector aSnap1(aPossibleRef1 - getSdrView().GetSnapPos(aPossibleRef1));
+ const basegfx::B2DVector aSnap2(aPossibleRef2 - getSdrView().GetSnapPos(aPossibleRef2));
+
+ if(basegfx::fTools::less(aSnap1.getLength(), aSnap2.getLength()))
+ {
+ aPnt += aSnap1;
+ }
+ else
+ {
+ aPnt += aSnap2;
+ }
}
- if (aPnt!=DragStat().GetNow())
+ if(!aPnt.equal(DragStat().GetNow()))
{
Hide();
DragStat().NextMove(aPnt);
- Point aDif(DragStat().GetNow()-DragStat().GetStart());
- pH1->SetPos(Ref1()+aDif);
- pH2->SetPos(Ref2()+aDif);
- SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX);
+ const basegfx::B2DVector aDif(DragStat().GetNow() - DragStat().GetStart());
+
+ pH1->setPosition(GetRef1() + aDif);
+ pH2->setPosition(GetRef2() + aDif);
+
+ SdrHdl* pHM = GetHdlList().GetHdlByKind(HDL_MIRX);
if(pHM)
+ {
pHM->Touch();
+ }
Show();
- DragStat().SetActionRect(Rectangle(pH1->GetPos(),pH2->GetPos()));
+ DragStat().SetActionRange(basegfx::B2DRange(pH1->getPosition(), pH2->getPosition()));
}
}
else
{
- if (!DragStat().IsNoSnap()) SnapPos(aPnt);
- long nSA=0;
+ if(!DragStat().IsNoSnap())
+ {
+ aPnt = getSdrView().GetSnapPos(aPnt);
+ }
+
+ double fSnapAngle(0.0);
+
+ if(getSdrView().IsAngleSnapEnabled())
+ {
+ fSnapAngle = ((getSdrView().GetSnapAngle() % 36000) * F_PI) / 18000.0;
+ }
- if (getSdrDragView().IsAngleSnapEnabled())
- nSA=getSdrDragView().GetSnapAngle();
+ if(getSdrView().IsMirrorAllowed(true, true))
+ {
+ // eingeschraenkt
+ if(!getSdrView().IsMirrorAllowed(false, false))
+ {
+ fSnapAngle = F_PI4; // 4500;
+ }
- if (getSdrDragView().IsMirrorAllowed(true,true))
- { // eingeschraenkt
- if (!getSdrDragView().IsMirrorAllowed(false,false)) nSA=4500;
- if (!getSdrDragView().IsMirrorAllowed(true,false)) nSA=9000;
+ if(!getSdrView().IsMirrorAllowed(true, false))
+ {
+ fSnapAngle = F_PI2; // 9000;
+ }
}
- if (getSdrDragView().IsOrtho() && nSA!=9000)
- nSA=4500;
+ if(getSdrView().IsOrthogonal() && !basegfx::fTools::equal(fSnapAngle, F_PI2))
+ {
+ fSnapAngle = F_PI4; // 4500;
+ }
- if (nSA!=0)
- { // Winkelfang
- SdrHdlKind eRef=HDL_REF1;
+ if(!basegfx::fTools::equalZero(fSnapAngle))
+ {
+ // Winkelfang
+ SdrHdlKind eRef = HDL_REF1;
- if (GetDragHdl()->GetKind()==HDL_REF1)
- eRef=HDL_REF2;
+ if(HDL_REF1 == GetDragHdl()->GetKind())
+ {
+ eRef = HDL_REF2;
+ }
- SdrHdl* pH=GetHdlList().GetHdl(eRef);
+ SdrHdl* pH = GetHdlList().GetHdlByKind(eRef);
- if (pH!=NULL)
+ if(pH)
{
- Point aRef(pH->GetPos());
- long nWink=NormAngle360(GetAngle(aPnt-aRef));
- long nNeuWink=nWink;
- nNeuWink+=nSA/2;
- nNeuWink/=nSA;
- nNeuWink*=nSA;
- nNeuWink=NormAngle360(nNeuWink);
- double a=(nNeuWink-nWink)*nPi180;
- double nSin=sin(a);
- double nCos=cos(a);
- RotatePoint(aPnt,aRef,nSin,nCos);
-
- // Bei bestimmten Werten Rundungsfehler ausschliessen:
- if (nSA==9000)
+ const basegfx::B2DPoint aFixPoint(pH->getPosition());
+
+ if(!aFixPoint.equal(aPnt))
{
- if (nNeuWink==0 || nNeuWink==18000) aPnt.Y()=aRef.Y();
- if (nNeuWink==9000 || nNeuWink==27000) aPnt.X()=aRef.X();
- }
+ const basegfx::B2DVector aDelta(aPnt - aFixPoint);
+ const double fCurrentAngle(atan2(aDelta.getY(), aDelta.getX()));
+ double fNewAngle(basegfx::snapToNearestMultiple(fCurrentAngle, fSnapAngle));
- if (nSA==4500)
- OrthoDistance8(aRef,aPnt,true);
+ if(!basegfx::fTools::equal(fCurrentAngle, fNewAngle))
+ {
+ aPnt += basegfx::B2DPoint(cos(fNewAngle), sin(fNewAngle));
+
+ if(basegfx::fTools::equal(fSnapAngle, F_PI4)) // 4500 == fSnapAngle
+ {
+ aPnt = OrthoDistance8(aFixPoint, aPnt, true);
+ }
+ }
+ }
}
}
- if (aPnt!=DragStat().GetNow())
+ if(!aPnt.equal(DragStat().GetNow()))
{
Hide();
DragStat().NextMove(aPnt);
- GetDragHdl()->SetPos(DragStat().GetNow());
- SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX);
+ GetDragHdl()->setPosition(DragStat().GetNow());
+ SdrHdl* pHM = GetHdlList().GetHdlByKind(HDL_MIRX);
if(pHM)
+ {
pHM->Touch();
+ }
Show();
- DragStat().SetActionRect(Rectangle(aPnt,aPnt));
+ DragStat().SetActionRange(basegfx::B2DRange(aPnt));
}
}
}
@@ -1148,19 +1116,20 @@ bool SdrDragMovHdl::EndSdrDrag(bool /*bCopy*/)
switch (GetDragHdl()->GetKind())
{
case HDL_REF1:
- Ref1()=DragStat().GetNow();
+ SetRef1(DragStat().GetNow());
break;
case HDL_REF2:
- Ref2()=DragStat().GetNow();
+ SetRef2(DragStat().GetNow());
break;
case HDL_MIRX:
- Ref1()+=DragStat().GetNow()-DragStat().GetStart();
- Ref2()+=DragStat().GetNow()-DragStat().GetStart();
+ SetRef1(GetRef1()+DragStat().GetNow()-DragStat().GetStart());
+ SetRef2(GetRef2()+DragStat().GetNow()-DragStat().GetStart());
break;
- default: break;
+ default:
+ break;
}
}
@@ -1171,21 +1140,24 @@ void SdrDragMovHdl::CancelSdrDrag()
{
Hide();
- SdrHdl* pHdl = GetDragHdl();
- if( pHdl )
- pHdl->SetPos(DragStat().GetRef1());
+ if(GetDragHdl())
+ {
+ GetDragHdl()->setPosition(DragStat().GetRef1());
- SdrHdl* pHM = GetHdlList().GetHdl(HDL_MIRX);
+ SdrHdl* pHM = GetHdlList().GetHdlByKind(HDL_MIRX);
- if(pHM)
- pHM->Touch();
+ if(pHM)
+ {
+ pHM->Touch();
+ }
+ }
}
Pointer SdrDragMovHdl::GetSdrDragPointer() const
{
const SdrHdl* pHdl = GetDragHdl();
- if (pHdl!=NULL)
+ if (pHdl)
{
return pHdl->GetPointer();
}
@@ -1195,9 +1167,7 @@ Pointer SdrDragMovHdl::GetSdrDragPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragObjOwn,SdrDragMethod);
-
-SdrDragObjOwn::SdrDragObjOwn(SdrDragView& rNewView)
+SdrDragObjOwn::SdrDragObjOwn(SdrView& rNewView)
: SdrDragMethod(rNewView),
mpClone(0)
{
@@ -1214,7 +1184,7 @@ SdrDragObjOwn::~SdrDragObjOwn()
{
if(mpClone)
{
- SdrObject::Free(mpClone);
+ deleteSdrObjectSafeAndClearPointer(mpClone);
}
}
@@ -1227,7 +1197,7 @@ void SdrDragObjOwn::createSdrDragEntries()
if(getSolidDraggingActive())
{
- SdrPageView* pPV = getSdrDragView().GetSdrPageView();
+ SdrPageView* pPV = getSdrView().GetSdrPageView();
if(pPV && pPV->PageWindowCount())
{
@@ -1311,31 +1281,32 @@ bool SdrDragObjOwn::BeginSdrDrag()
return false;
}
-void SdrDragObjOwn::MoveSdrDrag(const Point& rNoSnapPnt)
+void SdrDragObjOwn::MoveSdrDrag(const basegfx::B2DPoint& rNoSnapPnt)
{
const SdrObject* pObj = GetDragObj();
if(pObj)
{
- Point aPnt(rNoSnapPnt);
- SdrPageView* pPV = GetDragPV();
+ SdrPageView* pPV = getSdrView().GetSdrPageView();
if(pPV)
{
+ basegfx::B2DPoint aPnt(rNoSnapPnt);
+
if(!DragStat().IsNoSnap())
{
- SnapPos(aPnt);
+ aPnt = getSdrView().GetSnapPos(aPnt);
}
- if(getSdrDragView().IsOrtho())
+ if(getSdrView().IsOrthogonal())
{
if (DragStat().IsOrtho8Possible())
{
- OrthoDistance8(DragStat().GetStart(),aPnt,getSdrDragView().IsBigOrtho());
+ aPnt = OrthoDistance8(DragStat().GetStart(), aPnt, getSdrView().IsBigOrthogonal());
}
else if (DragStat().IsOrtho4Possible())
{
- OrthoDistance4(DragStat().GetStart(),aPnt,getSdrDragView().IsBigOrtho());
+ aPnt = OrthoDistance4(DragStat().GetStart(), aPnt, getSdrView().IsBigOrthogonal());
}
}
@@ -1355,7 +1326,7 @@ void SdrDragObjOwn::MoveSdrDrag(const Point& rNoSnapPnt)
// delete current clone (after the last reference to it is deleted above)
if(mpClone)
{
- SdrObject::Free(mpClone);
+ deleteSdrObjectSafeAndClearPointer(mpClone);
mpClone = 0;
}
@@ -1370,12 +1341,12 @@ void SdrDragObjOwn::MoveSdrDrag(const Point& rNoSnapPnt)
// also this (pretty indirect) property change is possible. If it gets
// changed, it needs to be copied to the original since nothing will
// happen when it only changes in the drag clone
- const bool bOldAutoGrowWidth(((SdrTextAutoGrowWidthItem&)pObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue());
- const bool bNewAutoGrowWidth(((SdrTextAutoGrowWidthItem&)mpClone->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue());
+ const bool bOldAutoGrowWidth(((SdrOnOffItem&)pObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue());
+ const bool bNewAutoGrowWidth(((SdrOnOffItem&)mpClone->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue());
if(bOldAutoGrowWidth != bNewAutoGrowWidth)
{
- GetDragObj()->SetMergedItem(SdrTextAutoGrowWidthItem(bNewAutoGrowWidth));
+ GetDragObj()->SetMergedItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, bNewAutoGrowWidth));
}
}
@@ -1389,44 +1360,44 @@ void SdrDragObjOwn::MoveSdrDrag(const Point& rNoSnapPnt)
bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
{
Hide();
- SdrUndoAction* pUndo = NULL;
- SdrUndoAction* pUndo2 = NULL;
+ SdrUndoAction* pUndo = 0;
+ SdrUndoAction* pUndo2 = 0;
std::vector< SdrUndoAction* > vConnectorUndoActions;
bool bRet = false;
SdrObject* pObj = GetDragObj();
if(pObj)
{
- const bool bUndo = getSdrDragView().IsUndoEnabled();
+ const bool bUndo = getSdrView().IsUndoEnabled();
if( bUndo )
{
- if(!getSdrDragView().IsInsObjPoint() && pObj->IsInserted() )
+ if(!getSdrView().IsInsObjPoint() && pObj->IsObjectInserted() )
{
if (DragStat().IsEndDragChangesAttributes())
{
- pUndo=getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj);
+ pUndo = getSdrView().getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pObj);
if (DragStat().IsEndDragChangesGeoAndAttributes())
{
- vConnectorUndoActions = getSdrDragView().CreateConnectorUndo( *pObj );
- pUndo2 = getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
+ vConnectorUndoActions = getSdrView().CreateConnectorUndo( *pObj );
+ pUndo2 = getSdrView().getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
}
}
else
{
- vConnectorUndoActions = getSdrDragView().CreateConnectorUndo( *pObj );
- pUndo= getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
+ vConnectorUndoActions = getSdrView().CreateConnectorUndo( *pObj );
+ pUndo = getSdrView().getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
}
}
if( pUndo )
{
- getSdrDragView().BegUndo( pUndo->GetComment() );
+ getSdrView().BegUndo( pUndo->GetComment() );
}
else
{
- getSdrDragView().BegUndo();
+ getSdrView().BegUndo();
}
}
@@ -1436,36 +1407,28 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
// in it's SdrTableObj::endSpecialDrag, so currently not possible. OTOH it uses
// a CreateUndoGeoObject() so maybe setting SetEndDragChangesAttributes is okay. I
// will test this now
- Rectangle aBoundRect0;
-
- if(pObj->GetUserCall())
- {
- aBoundRect0 = pObj->GetLastBoundRect();
- }
-
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj, HINT_OBJCHG_RESIZE);
bRet = pObj->applySpecialDrag(DragStat());
if(bRet)
{
pObj->SetChanged();
- pObj->BroadcastObjectChange();
- pObj->SendUserCall( SDRUSERCALL_RESIZE, aBoundRect0 );
}
if(bRet)
{
if( bUndo )
{
- getSdrDragView().AddUndoActions( vConnectorUndoActions );
+ getSdrView().AddUndoActions( vConnectorUndoActions );
if ( pUndo )
{
- getSdrDragView().AddUndo(pUndo);
+ getSdrView().AddUndo(pUndo);
}
if ( pUndo2 )
{
- getSdrDragView().AddUndo(pUndo2);
+ getSdrView().AddUndo(pUndo2);
}
}
}
@@ -1486,7 +1449,7 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
}
if( bUndo )
- getSdrDragView().EndUndo();
+ getSdrView().EndUndo();
}
return bRet;
@@ -1506,8 +1469,6 @@ 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
@@ -1523,13 +1484,11 @@ void SdrDragMove::createSdrDragEntryForSdrObject(const SdrObject& rOriginal, sdr
addSdrDragEntry(new SdrDragEntryPrimitive2DSequence(rVOC.getPrimitive2DSequenceHierarchy(aDisplayInfo), true));
}
-void SdrDragMove::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
-{
- rTarget.Move(Size(DragStat().GetDX(), DragStat().GetDY()));
-}
-
-SdrDragMove::SdrDragMove(SdrDragView& rNewView)
-: SdrDragMethod(rNewView)
+SdrDragMove::SdrDragMove(SdrView& rNewView)
+: SdrDragMethod(rNewView),
+ maBestSnap(0.0, 0.0),
+ mbXSnapped(false),
+ mbYSnapped(false)
{
setMoveOnly(true);
}
@@ -1538,18 +1497,18 @@ void SdrDragMove::TakeSdrDragComment(XubString& rStr) const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_DragMethMove, rStr);
+ TakeMarkedDescriptionString(STR_DragMethMove, rStr);
rStr.AppendAscii(" (x=");
- getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr);
+ getSdrView().getSdrModelFromSdrView().TakeMetricStr(DragStat().GetDX(), aStr);
rStr += aStr;
rStr.AppendAscii(" y=");
- getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr);
+ getSdrView().getSdrModelFromSdrView().TakeMetricStr(DragStat().GetDY(), aStr);
rStr += aStr;
rStr += sal_Unicode(')');
- if(getSdrDragView().IsDragWithCopy())
+ if(getSdrView().IsDragWithCopy())
{
- if(!getSdrDragView().IsInsObjPoint() && !getSdrDragView().IsInsGluePoint())
+ if(!getSdrView().IsInsObjPoint() && !(getSdrView().GetDragMethod() && getSdrView().IsInsertGluePoint()))
{
rStr += ImpGetResStr(STR_EditWithCopy);
}
@@ -1558,7 +1517,7 @@ void SdrDragMove::TakeSdrDragComment(XubString& rStr) const
bool SdrDragMove::BeginSdrDrag()
{
- DragStat().SetActionRect(GetMarkedRect());
+ DragStat().SetActionRange(GetMarkedRange());
Show();
return true;
@@ -1566,181 +1525,200 @@ bool SdrDragMove::BeginSdrDrag()
basegfx::B2DHomMatrix SdrDragMove::getCurrentTransformation()
{
- return basegfx::tools::createTranslateB2DHomMatrix(DragStat().GetDX(), DragStat().GetDY());
+ return basegfx::tools::createTranslateB2DHomMatrix(DragStat().GetNow() - DragStat().GetPrev());
}
-void SdrDragMove::ImpCheckSnap(const Point& rPt)
+void SdrDragMove::ImpCheckSnap(const basegfx::B2DPoint& rPt)
{
- Point aPt(rPt);
- sal_uInt16 nRet=SnapPos(aPt);
- aPt-=rPt;
+ sal_uInt16 nWhichOrientationSnapped(0);
+ const basegfx::B2DPoint aSnappedPoint(getSdrView().GetSnapPos(rPt, &nWhichOrientationSnapped));
+ const basegfx::B2DVector aSnapVector(aSnappedPoint - rPt);
- if ((nRet & SDRSNAP_XSNAPPED) !=0)
+ if(nWhichOrientationSnapped & SDRSNAP_XSNAPPED)
{
- if (bXSnapped)
+ if(mbXSnapped)
{
- if (Abs(aPt.X())<Abs(nBestXSnap))
- {
- nBestXSnap=aPt.X();
- }
+ maBestSnap.setX(fabs(aSnapVector.getX()) < fabs(maBestSnap.getX())
+ ? aSnapVector.getX()
+ : maBestSnap.getX());
}
else
{
- nBestXSnap=aPt.X();
- bXSnapped=true;
+ maBestSnap.setX(aSnapVector.getX());
+ mbXSnapped = true;
}
}
- if ((nRet & SDRSNAP_YSNAPPED) !=0)
+ if(nWhichOrientationSnapped & SDRSNAP_YSNAPPED)
{
- if (bYSnapped)
+ if(mbYSnapped)
{
- if (Abs(aPt.Y())<Abs(nBestYSnap))
- {
- nBestYSnap=aPt.Y();
- }
+ maBestSnap.setY(fabs(aSnapVector.getY()) < fabs(maBestSnap.getY())
+ ? aSnapVector.getY()
+ : maBestSnap.getY());
}
else
{
- nBestYSnap=aPt.Y();
- bYSnapped=true;
+ maBestSnap.setY(aSnapVector.getY());
+ mbYSnapped = true;
}
}
}
-void SdrDragMove::MoveSdrDrag(const Point& rNoSnapPnt_)
+void SdrDragMove::MoveSdrDrag(const basegfx::B2DPoint& rPoint)
{
- nBestXSnap=0;
- nBestYSnap=0;
- bXSnapped=false;
- bYSnapped=false;
- Point aNoSnapPnt(rNoSnapPnt_);
- const Rectangle& aSR=GetMarkedRect();
- long nMovedx=aNoSnapPnt.X()-DragStat().GetStart().X();
- long nMovedy=aNoSnapPnt.Y()-DragStat().GetStart().Y();
- Point aLO(aSR.TopLeft()); aLO.X()+=nMovedx; aLO.Y()+=nMovedy;
- Point aRU(aSR.BottomRight()); aRU.X()+=nMovedx; aRU.Y()+=nMovedy;
- Point aLU(aLO.X(),aRU.Y());
- Point aRO(aRU.X(),aLO.Y());
- ImpCheckSnap(aLO);
-
- if (!getSdrDragView().IsMoveSnapOnlyTopLeft())
+ if(DragStat().CheckMinMoved(rPoint))
{
- ImpCheckSnap(aRO);
- ImpCheckSnap(aLU);
- ImpCheckSnap(aRU);
- }
+ maBestSnap.setX(0.0);
+ maBestSnap.setY(0.0);
+ mbXSnapped = mbYSnapped = false;
- Point aPnt(aNoSnapPnt.X()+nBestXSnap,aNoSnapPnt.Y()+nBestYSnap);
- bool bOrtho=getSdrDragView().IsOrtho();
+ const basegfx::B2DRange& rFixSnapRange(GetMarkedRange());
+ basegfx::B2DRange aSnapRange(rFixSnapRange);
+ aSnapRange.transform(basegfx::tools::createTranslateB2DHomMatrix(rPoint - DragStat().GetStart()));
- if (bOrtho)
- OrthoDistance8(DragStat().GetStart(),aPnt,getSdrDragView().IsBigOrtho());
+ ImpCheckSnap(aSnapRange.getMinimum());
- if (DragStat().CheckMinMoved(aNoSnapPnt))
- {
- Point aPt1(aPnt);
- Rectangle aLR(getSdrDragView().GetWorkArea());
- bool bWorkArea=!aLR.IsEmpty();
- bool bDragLimit=IsDragLimit();
+ if(!getSdrView().IsMoveSnapOnlyTopLeft())
+ {
+ ImpCheckSnap(basegfx::B2DPoint(aSnapRange.getMaxX(), aSnapRange.getMinY()));
+ ImpCheckSnap(basegfx::B2DPoint(aSnapRange.getMinX(), aSnapRange.getMaxY()));
+ ImpCheckSnap(aSnapRange.getMaximum());
+ }
+
+ basegfx::B2DPoint aNewPos(rPoint + maBestSnap);
+
+ if(getSdrView().IsOrthogonal())
+ {
+ aNewPos = OrthoDistance8(DragStat().GetStart(), aNewPos, getSdrView().IsBigOrthogonal());
+ }
+
+ basegfx::B2DRange aWorkArea(getSdrView().GetWorkArea());
+ const bool bWorkArea(!aWorkArea.isEmpty());
+ const bool bDragLimit(IsDragLimit());
- if (bDragLimit || bWorkArea)
+ if(bDragLimit || bWorkArea)
{
- Rectangle aSR2(GetMarkedRect());
- Point aD(aPt1-DragStat().GetStart());
+ basegfx::B2DRange aSnapRange2(rFixSnapRange);
+ const basegfx::B2DVector aDelta(aNewPos - DragStat().GetStart());
- if (bDragLimit)
+ if(bDragLimit)
{
- Rectangle aR2(GetDragLimitRect());
+ const basegfx::B2DRange aDragLimit(getSdrView().GetDragLimit());
- if (bWorkArea)
- aLR.Intersection(aR2);
+ if(bWorkArea)
+ {
+ aWorkArea.intersect(aDragLimit);
+ }
else
- aLR=aR2;
+ {
+ aWorkArea = aDragLimit;
+ }
}
- if (aSR2.Left()>aLR.Left() || aSR2.Right()<aLR.Right())
- { // ist ueberhaupt Platz zum verschieben?
- aSR2.Move(aD.X(),0);
+ if(aSnapRange2.getMinX() > aWorkArea.getMinX() || aSnapRange2.getMaxX() < aWorkArea.getMaxX())
+ {
+ // ist ueberhaupt Platz zum verschieben?
+ aSnapRange2.transform(basegfx::tools::createTranslateB2DHomMatrix(aDelta.getX(), 0.0));
- if (aSR2.Left()<aLR.Left())
+ if(aSnapRange2.getMinX() < aWorkArea.getMinX())
{
- aPt1.X()-=aSR2.Left()-aLR.Left();
+ aNewPos.setX(aNewPos.getX() - (aSnapRange2.getMinX() - aWorkArea.getMinX()));
}
- else if (aSR2.Right()>aLR.Right())
+ else if(aSnapRange2.getMaxX() > aWorkArea.getMaxX())
{
- aPt1.X()-=aSR2.Right()-aLR.Right();
+ aNewPos.setX(aNewPos.getX() - (aSnapRange2.getMaxX() - aWorkArea.getMaxX()));
}
}
else
- aPt1.X()=DragStat().GetStart().X(); // kein Platz zum verschieben
+ {
+ // kein Platz zum verschieben
+ aNewPos.setX(DragStat().GetStart().getX());
+ }
- if (aSR2.Top()>aLR.Top() || aSR2.Bottom()<aLR.Bottom())
- { // ist ueberhaupt Platz zum verschieben?
- aSR2.Move(0,aD.Y());
+ if(aSnapRange2.getMinY() > aWorkArea.getMinY() || aSnapRange2.getMaxY() < aWorkArea.getMaxY())
+ {
+ // ist ueberhaupt Platz zum verschieben?
+ aSnapRange2.transform(basegfx::tools::createTranslateB2DHomMatrix(0.0, aDelta.getY()));
- if (aSR2.Top()<aLR.Top())
+ if(aSnapRange2.getMinY() < aWorkArea.getMinY())
{
- aPt1.Y()-=aSR2.Top()-aLR.Top();
+ aNewPos.setY(aNewPos.getY() - (aSnapRange2.getMinY() - aWorkArea.getMinY()));
}
- else if (aSR2.Bottom()>aLR.Bottom())
+ else if(aSnapRange2.getMaxY() > aWorkArea.getMaxY())
{
- aPt1.Y()-=aSR2.Bottom()-aLR.Bottom();
+ aNewPos.setY(aNewPos.getY() - (aSnapRange2.getMaxY() - aWorkArea.getMaxY()));
}
}
else
- aPt1.Y()=DragStat().GetStart().Y(); // kein Platz zum verschieben
+ {
+ // kein Platz zum verschieben
+ aNewPos.setY(DragStat().GetStart().getY());
+ }
}
- if (getSdrDragView().IsDraggingGluePoints())
- { // Klebepunkte aufs BoundRect des Obj limitieren
- aPt1-=DragStat().GetStart();
- const SdrMarkList& rML=GetMarkedObjectList();
- sal_uLong nMarkAnz=rML.GetMarkCount();
+ if(getSdrView().IsDraggingGluePoints() && getSdrView().areSdrObjectsSelected())
+ {
+ // Klebepunkte aufs BoundRect des Obj limitieren
+ aNewPos -= DragStat().GetStart();
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
- for (sal_uLong nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++)
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
{
- const SdrMark* pM=rML.GetMark(nMarkNum);
- const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- sal_uLong nPtAnz=pPts==NULL ? 0 : pPts->GetCount();
+ const SdrObject* pObj = aSelection[nMarkNum];
+ const sdr::selection::Indices rMarkedGluePoints = getSdrView().getSelectedGluesForSelectedSdrObject(*pObj);
- if (nPtAnz!=0)
+ if(rMarkedGluePoints.size())
{
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- const SdrGluePointList* pGPL=pObj->GetGluePointList();
- Rectangle aBound(pObj->GetCurrentBoundRect());
+ const SdrGluePointList* pGPL = pObj->GetGluePointList();
+ const basegfx::B2DRange& rObjectRange(pObj->getObjectRange(&getSdrView()));
+ const basegfx::B2DRange aObjectSnapRange(sdr::legacy::GetSnapRange(*pObj));
- for (sal_uLong nPtNum=0; nPtNum<nPtAnz; nPtNum++)
+ for(sdr::selection::Indices::const_iterator aCurrent(rMarkedGluePoints.begin()); aCurrent != rMarkedGluePoints.end(); aCurrent++)
{
- sal_uInt16 nId=pPts->GetObject(nPtNum);
- sal_uInt16 nGlueNum=pGPL->FindGluePoint(nId);
+ const sal_uInt32 nId(*aCurrent);
+ const sal_uInt32 nGlueNum(pGPL->FindGluePoint(nId));
- if (nGlueNum!=SDRGLUEPOINT_NOTFOUND)
+ if(SDRGLUEPOINT_NOTFOUND != nGlueNum)
{
- Point aPt((*pGPL)[nGlueNum].GetAbsolutePos(*pObj));
- aPt+=aPt1; // soviel soll verschoben werden
- if (aPt.X()<aBound.Left() ) aPt1.X()-=aPt.X()-aBound.Left() ;
- if (aPt.X()>aBound.Right() ) aPt1.X()-=aPt.X()-aBound.Right() ;
- if (aPt.Y()<aBound.Top() ) aPt1.Y()-=aPt.Y()-aBound.Top() ;
- if (aPt.Y()>aBound.Bottom()) aPt1.Y()-=aPt.Y()-aBound.Bottom();
+ basegfx::B2DPoint aPt((*pGPL)[nGlueNum].GetAbsolutePos(aObjectSnapRange) + aNewPos);
+
+ if(aPt.getX() < rObjectRange.getMinX())
+ {
+ aNewPos.setX(aNewPos.getX() - (aPt.getX() - rObjectRange.getMinX()));
+ }
+ if(aPt.getX() > rObjectRange.getMaxX())
+ {
+ aNewPos.setX(aNewPos.getX() - (aPt.getX() - rObjectRange.getMaxX()));
+ }
+ if(aPt.getY() < rObjectRange.getMinY())
+ {
+ aNewPos.setY(aNewPos.getY() - (aPt.getY() - rObjectRange.getMinY()));
+ }
+ if(aPt.getY() > rObjectRange.getMaxY())
+ {
+ aNewPos.setY(aNewPos.getY() - (aPt.getY() - rObjectRange.getMaxY()));
+ }
}
}
}
}
- aPt1+=DragStat().GetStart();
+ aNewPos += DragStat().GetStart();
}
- if (bOrtho)
- OrthoDistance8(DragStat().GetStart(),aPt1,false);
+ if(getSdrView().IsOrthogonal())
+ {
+ aNewPos = OrthoDistance8(DragStat().GetStart(), aNewPos, false);
+ }
- if (aPt1!=DragStat().GetNow())
+ if(!aNewPos.equal(DragStat().GetNow()))
{
Hide();
- DragStat().NextMove(aPt1);
- Rectangle aAction(GetMarkedRect());
- aAction.Move(DragStat().GetDX(),DragStat().GetDY());
- DragStat().SetActionRect(aAction);
+ DragStat().NextMove(aNewPos);
+ basegfx::B2DRange aActionRange(GetMarkedRange());
+ aActionRange.transform(basegfx::tools::createTranslateB2DHomMatrix(DragStat().GetNow() - DragStat().GetPrev()));
+ DragStat().SetActionRange(aActionRange);
Show();
}
}
@@ -1750,20 +1728,25 @@ bool SdrDragMove::EndSdrDrag(bool bCopy)
{
Hide();
- if (getSdrDragView().IsInsObjPoint() || getSdrDragView().IsInsGluePoint())
- bCopy=false;
+ if(getSdrView().IsInsObjPoint() || (getSdrView().GetDragMethod() && getSdrView().IsInsertGluePoint()))
+ {
+ bCopy = false;
+ }
- if (IsDraggingPoints())
+ if(IsDraggingPoints())
{
- getSdrDragView().MoveMarkedPoints(Size(DragStat().GetDX(),DragStat().GetDY()),bCopy);
+ getSdrView().TransformMarkedPoints(
+ basegfx::tools::createTranslateB2DHomMatrix(DragStat().GetNow() - DragStat().GetPrev()),
+ SDRREPFUNC_OBJ_MOVE,
+ bCopy);
}
else if (IsDraggingGluePoints())
{
- getSdrDragView().MoveMarkedGluePoints(Size(DragStat().GetDX(),DragStat().GetDY()),bCopy);
+ getSdrView().MoveMarkedGluePoints(DragStat().GetNow() - DragStat().GetPrev(), bCopy);
}
else
{
- getSdrDragView().MoveMarkedObj(Size(DragStat().GetDX(),DragStat().GetDY()),bCopy);
+ getSdrView().MoveMarkedObj(DragStat().GetNow() - DragStat().GetPrev(), bCopy);
}
return true;
@@ -1771,7 +1754,7 @@ bool SdrDragMove::EndSdrDrag(bool bCopy)
Pointer SdrDragMove::GetSdrDragPointer() const
{
- if (IsDraggingPoints() || IsDraggingGluePoints())
+ if(IsDraggingPoints() || IsDraggingGluePoints())
{
return Pointer(POINTER_MOVEPOINT);
}
@@ -1783,73 +1766,64 @@ Pointer SdrDragMove::GetSdrDragPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragResize,SdrDragMethod);
-
-SdrDragResize::SdrDragResize(SdrDragView& rNewView)
+SdrDragResize::SdrDragResize(SdrView& rNewView)
: SdrDragMethod(rNewView),
- aXFact(1,1),
- aYFact(1,1)
+ maScale(1.0, 1.0)
{
}
void SdrDragResize::TakeSdrDragComment(XubString& rStr) const
{
- ImpTakeDescriptionStr(STR_DragMethResize, rStr);
- bool bEqual(aXFact == aYFact);
- Fraction aFact1(1,1);
- Point aStart(DragStat().GetStart());
- Point aRef(DragStat().GetRef1());
- sal_Int32 nXDiv(aStart.X() - aRef.X());
-
- if(!nXDiv)
- nXDiv = 1;
-
- sal_Int32 nYDiv(aStart.Y() - aRef.Y());
-
- if(!nYDiv)
- nYDiv = 1;
-
- bool bX(aXFact != aFact1 && Abs(nXDiv) > 1);
- bool bY(aYFact != aFact1 && Abs(nYDiv) > 1);
+ TakeMarkedDescriptionString(STR_DragMethResize, rStr);
+ const basegfx::B2DVector aDelta(absolute(DragStat().GetStart() - DragStat().GetRef1()));
+ bool bX(!basegfx::fTools::equal(maScale.getX(), 1.0) && aDelta.getX() > 1.0);
+ bool bY(!basegfx::fTools::equal(maScale.getY(), 1.0) && aDelta.getY() > 1.0);
if(bX || bY)
{
XubString aStr;
+ bool bEqual(basegfx::fTools::equal(maScale.getX(), maScale.getY()));
rStr.AppendAscii(" (");
if(bX)
{
if(!bEqual)
+ {
rStr.AppendAscii("x=");
+ }
- getSdrDragView().GetModel()->TakePercentStr(aXFact, aStr);
+ getSdrView().getSdrModelFromSdrView().TakePercentStr(maScale.getX(), aStr);
rStr += aStr;
}
if(bY && !bEqual)
{
if(bX)
+ {
rStr += sal_Unicode(' ');
+ }
rStr.AppendAscii("y=");
- getSdrDragView().GetModel()->TakePercentStr(aYFact, aStr);
+ getSdrView().getSdrModelFromSdrView().TakePercentStr(maScale.getY(), aStr);
rStr += aStr;
}
rStr += sal_Unicode(')');
}
- if(getSdrDragView().IsDragWithCopy())
+ if(getSdrView().IsDragWithCopy())
+ {
rStr += ImpGetResStr(STR_EditWithCopy);
+ }
}
bool SdrDragResize::BeginSdrDrag()
{
- SdrHdlKind eRefHdl=HDL_MOVE;
- SdrHdl* pRefHdl=NULL;
+ SdrHdlKind eRefHdl(HDL_MOVE);
+ SdrHdl* pRefHdl = 0;
- switch (GetDragHdlKind())
+ switch(GetDragHdlKind())
{
case HDL_UPLFT: eRefHdl=HDL_LWRGT; break;
case HDL_UPPER: eRefHdl=HDL_LOWER; DragStat().SetHorFixed(true); break;
@@ -1862,25 +1836,29 @@ bool SdrDragResize::BeginSdrDrag()
default: break;
}
- if (eRefHdl!=HDL_MOVE)
- pRefHdl=GetHdlList().GetHdl(eRefHdl);
+ if(HDL_MOVE != eRefHdl)
+ {
+ pRefHdl = GetHdlList().GetHdlByKind(eRefHdl);
+ }
- if (pRefHdl!=NULL && !getSdrDragView().IsResizeAtCenter())
+ if(pRefHdl && !getSdrView().IsResizeAtCenter())
{
- DragStat().Ref1()=pRefHdl->GetPos();
+ DragStat().SetRef1(pRefHdl->getPosition());
}
else
{
- SdrHdl* pRef1=GetHdlList().GetHdl(HDL_UPLFT);
- SdrHdl* pRef2=GetHdlList().GetHdl(HDL_LWRGT);
+ SdrHdl* pRef1 = GetHdlList().GetHdlByKind(HDL_UPLFT);
+ SdrHdl* pRef2 = GetHdlList().GetHdlByKind(HDL_LWRGT);
- if (pRef1!=NULL && pRef2!=NULL)
+ if(pRef1 && pRef2)
{
- DragStat().Ref1()=Rectangle(pRef1->GetPos(),pRef2->GetPos()).Center();
+ const basegfx::B2DRange aRefRange(pRef1->getPosition(), pRef2->getPosition());
+
+ DragStat().SetRef1(aRefRange.getCenter());
}
else
{
- DragStat().Ref1()=GetMarkedRect().Center();
+ DragStat().SetRef1(GetMarkedRange().getCenter());
}
}
@@ -1891,215 +1869,179 @@ bool SdrDragResize::BeginSdrDrag()
basegfx::B2DHomMatrix SdrDragResize::getCurrentTransformation()
{
- basegfx::B2DHomMatrix aRetval(basegfx::tools::createTranslateB2DHomMatrix(
- -DragStat().Ref1().X(), -DragStat().Ref1().Y()));
- aRetval.scale(aXFact, aYFact);
- aRetval.translate(DragStat().Ref1().X(), DragStat().Ref1().Y());
+ basegfx::B2DHomMatrix aRetval;
+
+ aRetval.translate(-DragStat().GetRef1());
+ aRetval.scale(maScale);
+ aRetval.translate(DragStat().GetRef1());
return aRetval;
}
-void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt)
+void SdrDragResize::MoveSdrDrag(const basegfx::B2DPoint& rNoSnapPnt)
{
- Point aPnt(GetSnapPos(rNoSnapPnt));
- Point aStart(DragStat().GetStart());
- Point aRef(DragStat().GetRef1());
- Fraction aMaxFact(0x7FFFFFFF,1);
- Rectangle aLR(getSdrDragView().GetWorkArea());
- bool bWorkArea=!aLR.IsEmpty();
- bool bDragLimit=IsDragLimit();
+ basegfx::B2DPoint aNewPos(getSdrView().GetSnapPos(rNoSnapPnt));
+ double fMaximumLimit(DBL_MAX);
+ const basegfx::B2DPoint& rRef1(DragStat().GetRef1());
+ basegfx::B2DRange aWorkArea(getSdrView().GetWorkArea());
+ const bool bWorkArea(!aWorkArea.isEmpty());
+ const bool bDragLimit(IsDragLimit());
+ const bool bOrtho(getSdrView().IsOrthogonal() || !getSdrView().IsResizeAllowed(false));
- if (bDragLimit || bWorkArea)
+ if(bDragLimit || bWorkArea)
{
- Rectangle aSR(GetMarkedRect());
+ const basegfx::B2DRange aSnapRange(GetMarkedRange());
- if (bDragLimit)
+ if(bDragLimit)
{
- Rectangle aR2(GetDragLimitRect());
+ const basegfx::B2DRange aDragLimit(getSdrView().GetDragLimit());
- if (bWorkArea)
- aLR.Intersection(aR2);
+ if(bWorkArea)
+ {
+ aWorkArea.intersect(aDragLimit);
+ }
else
- aLR=aR2;
+ {
+ aWorkArea = aDragLimit;
+ }
}
- if (aPnt.X()<aLR.Left())
- aPnt.X()=aLR.Left();
- else if (aPnt.X()>aLR.Right())
- aPnt.X()=aLR.Right();
-
- if (aPnt.Y()<aLR.Top())
- aPnt.Y()=aLR.Top();
- else if (aPnt.Y()>aLR.Bottom())
- aPnt.Y()=aLR.Bottom();
+ aNewPos = aWorkArea.clamp(aNewPos);
- if (aRef.X()>aSR.Left())
+ if(bOrtho)
{
- Fraction aMax(aRef.X()-aLR.Left(),aRef.X()-aSR.Left());
+ if(rRef1.getX() > aSnapRange.getMinX())
+ {
+ const double fDividend(rRef1.getX() - aWorkArea.getMinX());
+ const double fDivisor(rRef1.getX() - aSnapRange.getMinX());
+ const double fMax(fDividend / (basegfx::fTools::equalZero(fDivisor) ? 1.0 : fDivisor));
- if (aMax<aMaxFact)
- aMaxFact=aMax;
- }
+ fMaximumLimit = std::min(fMax, fabs(fMaximumLimit));
+ }
- if (aRef.X()<aSR.Right())
- {
- Fraction aMax(aLR.Right()-aRef.X(),aSR.Right()-aRef.X());
+ if (rRef1.getX()<aSnapRange.getMaxX())
+ {
+ const double fDividend(aWorkArea.getMaxX() - rRef1.getX());
+ const double fDivisor(aSnapRange.getMaxX() - rRef1.getX());
+ const double fMax(fDividend / (basegfx::fTools::equalZero(fDivisor) ? 1.0 : fDivisor));
- if (aMax<aMaxFact)
- aMaxFact=aMax;
- }
+ fMaximumLimit = std::min(fMax, fabs(fMaximumLimit));
+ }
- if (aRef.Y()>aSR.Top())
- {
- Fraction aMax(aRef.Y()-aLR.Top(),aRef.Y()-aSR.Top());
+ if (rRef1.getY()>aSnapRange.getMinY())
+ {
+ const double fDividend(rRef1.getY() - aWorkArea.getMinY());
+ const double fDivisor(rRef1.getY() - aSnapRange.getMinY());
+ const double fMax(fDividend / (basegfx::fTools::equalZero(fDivisor) ? 1.0 : fDivisor));
- if (aMax<aMaxFact)
- aMaxFact=aMax;
- }
+ fMaximumLimit = std::min(fMax, fabs(fMaximumLimit));
+ }
- if (aRef.Y()<aSR.Bottom())
- {
- Fraction aMax(aLR.Bottom()-aRef.Y(),aSR.Bottom()-aRef.Y());
+ if (rRef1.getY()<aSnapRange.getMaxY())
+ {
+ const double fDividend(aWorkArea.getMaxY() - rRef1.getY());
+ const double fDivisor(aSnapRange.getMaxY() - rRef1.getY());
+ const double fMax(fDividend / (basegfx::fTools::equalZero(fDivisor) ? 1.0 : fDivisor));
- if (aMax<aMaxFact)
- aMaxFact=aMax;
+ fMaximumLimit = std::min(fMax, fabs(fMaximumLimit));
+ }
}
}
- long nXDiv=aStart.X()-aRef.X(); if (nXDiv==0) nXDiv=1;
- long nYDiv=aStart.Y()-aRef.Y(); if (nYDiv==0) nYDiv=1;
- long nXMul=aPnt.X()-aRef.X();
- long nYMul=aPnt.Y()-aRef.Y();
-
- if (nXDiv<0)
- {
- nXDiv=-nXDiv;
- nXMul=-nXMul;
- }
-
- if (nYDiv<0)
- {
- nYDiv=-nYDiv;
- nYMul=-nYMul;
- }
+ const basegfx::B2DPoint aOldDelta(DragStat().GetStart() - rRef1);
+ const basegfx::B2DPoint aNewDelta(aNewPos - rRef1);
+ double fXFactor(aNewDelta.getX() / (basegfx::fTools::equalZero(aOldDelta.getX()) ? 1.0 : aOldDelta.getX()));
+ double fYFactor(aNewDelta.getY() / (basegfx::fTools::equalZero(aOldDelta.getY()) ? 1.0 : aOldDelta.getY()));
- bool bXNeg=nXMul<0; if (bXNeg) nXMul=-nXMul;
- bool bYNeg=nYMul<0; if (bYNeg) nYMul=-nYMul;
- bool bOrtho=getSdrDragView().IsOrtho() || !getSdrDragView().IsResizeAllowed(false);
-
- if (!DragStat().IsHorFixed() && !DragStat().IsVerFixed())
+ if(!DragStat().IsHorFixed() && !DragStat().IsVerFixed())
{
- if (Abs(nXDiv)<=1 || Abs(nYDiv)<=1)
- bOrtho=false;
-
- if (bOrtho)
+ if(bOrtho)
{
- if ((Fraction(nXMul,nXDiv)>Fraction(nYMul,nYDiv)) !=getSdrDragView().IsBigOrtho())
+ if(basegfx::fTools::more(fabs(fXFactor), fabs(fYFactor)) != getSdrView().IsBigOrthogonal())
{
- nXMul=nYMul;
- nXDiv=nYDiv;
+ fXFactor = basegfx::copySign(fYFactor, fXFactor);
}
else
{
- nYMul=nXMul;
- nYDiv=nXDiv;
+ fYFactor = basegfx::copySign(fXFactor, fYFactor);
}
}
}
else
{
- if (bOrtho)
+ if(bOrtho)
{
- if (DragStat().IsHorFixed())
+ if(DragStat().IsHorFixed())
{
- bXNeg=false;
- nXMul=nYMul;
- nXDiv=nYDiv;
+ fXFactor = fabs(fYFactor);
}
- if (DragStat().IsVerFixed())
+ if(DragStat().IsVerFixed())
{
- bYNeg=false;
- nYMul=nXMul;
- nYDiv=nXDiv;
+ fYFactor = fabs(fXFactor);
}
}
else
{
- if (DragStat().IsHorFixed())
+ if(DragStat().IsHorFixed())
{
- bXNeg=false;
- nXMul=1;
- nXDiv=1;
+ fXFactor = 1.0;
}
if (DragStat().IsVerFixed())
{
- bYNeg=false;
- nYMul=1;
- nYDiv=1;
+ fYFactor = 1.0;
}
}
}
- Fraction aNeuXFact(nXMul,nXDiv);
- Fraction aNeuYFact(nYMul,nYDiv);
-
- if (bOrtho)
+ if(bOrtho)
{
- if (aNeuXFact>aMaxFact)
- {
- aNeuXFact=aMaxFact;
- aNeuYFact=aMaxFact;
- }
-
- if (aNeuYFact>aMaxFact)
+ if(fabs(fXFactor) > fMaximumLimit || fabs(fYFactor) > fMaximumLimit)
{
- aNeuXFact=aMaxFact;
- aNeuYFact=aMaxFact;
+ fXFactor = (fXFactor > 0.0) ? fMaximumLimit : -fMaximumLimit;
+ fYFactor = (fYFactor > 0.0) ? fMaximumLimit : -fMaximumLimit;
}
}
- if (bXNeg)
- aNeuXFact=Fraction(-aNeuXFact.GetNumerator(),aNeuXFact.GetDenominator());
-
- if (bYNeg)
- aNeuYFact=Fraction(-aNeuYFact.GetNumerator(),aNeuYFact.GetDenominator());
-
- if (DragStat().CheckMinMoved(aPnt))
+ if(DragStat().CheckMinMoved(aNewPos))
{
- if ((!DragStat().IsHorFixed() && aPnt.X()!=DragStat().GetNow().X()) ||
- (!DragStat().IsVerFixed() && aPnt.Y()!=DragStat().GetNow().Y()))
+ if((!DragStat().IsHorFixed() && !basegfx::fTools::equal(aNewPos.getX(), DragStat().GetNow().getX())) ||
+ (!DragStat().IsVerFixed() && !basegfx::fTools::equal(aNewPos.getY(), DragStat().GetNow().getY())))
{
Hide();
- DragStat().NextMove(aPnt);
- aXFact=aNeuXFact;
- aYFact=aNeuYFact;
+ DragStat().NextMove(aNewPos);
+ maScale.setX(fXFactor);
+ maScale.setY(fYFactor);
Show();
}
}
}
-void SdrDragResize::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
-{
- rTarget.Resize(DragStat().Ref1(),aXFact,aYFact);
-}
-
bool SdrDragResize::EndSdrDrag(bool bCopy)
{
Hide();
- if (IsDraggingPoints())
+ if(IsDraggingPoints())
{
- getSdrDragView().ResizeMarkedPoints(DragStat().Ref1(),aXFact,aYFact,bCopy);
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-DragStat().GetRef1());
+ aTransform.scale(maScale);
+ aTransform.translate(DragStat().GetRef1());
+
+ getSdrView().TransformMarkedPoints(
+ aTransform,
+ SDRREPFUNC_OBJ_RESIZE,
+ bCopy);
}
else if (IsDraggingGluePoints())
{
- getSdrDragView().ResizeMarkedGluePoints(DragStat().Ref1(),aXFact,aYFact,bCopy);
+ getSdrView().ResizeMarkedGluePoints(DragStat().GetRef1(), maScale, bCopy);
}
else
{
- getSdrDragView().ResizeMarkedObj(DragStat().Ref1(),aXFact,aYFact,bCopy);
+ getSdrView().ResizeMarkedObj(DragStat().GetRef1(), maScale, bCopy);
}
return true;
@@ -2107,9 +2049,9 @@ bool SdrDragResize::EndSdrDrag(bool bCopy)
Pointer SdrDragResize::GetSdrDragPointer() const
{
- const SdrHdl* pHdl=GetDragHdl();
+ const SdrHdl* pHdl = GetDragHdl();
- if (pHdl!=NULL)
+ if(pHdl)
{
return pHdl->GetPointer();
}
@@ -2119,52 +2061,41 @@ Pointer SdrDragResize::GetSdrDragPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragRotate,SdrDragMethod);
-
-void SdrDragRotate::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
-{
- rTarget.Rotate(DragStat().GetRef1(), nWink, sin(nWink*nPi180), cos(nWink*nPi180));
-}
-
-SdrDragRotate::SdrDragRotate(SdrDragView& rNewView)
+SdrDragRotate::SdrDragRotate(SdrView& rNewView)
: SdrDragMethod(rNewView),
- nSin(0.0),
- nCos(1.0),
- nWink0(0),
- nWink(0),
- bRight(false)
+ mfStartRotation(0.0),
+ mfDeltaRotation(0.0)
{
}
void SdrDragRotate::TakeSdrDragComment(XubString& rStr) const
{
- ImpTakeDescriptionStr(STR_DragMethRotate, rStr);
+ TakeMarkedDescriptionString(STR_DragMethRotate, rStr);
rStr.AppendAscii(" (");
XubString aStr;
- sal_Int32 nTmpWink(NormAngle360(nWink));
-
- if(bRight && nWink)
- {
- nTmpWink -= 36000;
- }
+ const double fSnappedDelta(basegfx::snapToRange(mfDeltaRotation, -F_2PI, F_2PI));
+ sal_Int32 nOldAngle(basegfx::fround((fSnappedDelta * -18000.0) / F_PI) % 36000);
- getSdrDragView().GetModel()->TakeWinkStr(nTmpWink, aStr);
+ getSdrView().getSdrModelFromSdrView().TakeWinkStr(nOldAngle, aStr);
rStr += aStr;
rStr += sal_Unicode(')');
- if(getSdrDragView().IsDragWithCopy())
+ if(getSdrView().IsDragWithCopy())
+ {
rStr += ImpGetResStr(STR_EditWithCopy);
+ }
}
bool SdrDragRotate::BeginSdrDrag()
{
- SdrHdl* pH=GetHdlList().GetHdl(HDL_REF1);
+ SdrHdl* pH = GetHdlList().GetHdlByKind(HDL_REF1);
- if (pH!=NULL)
+ if(pH)
{
Show();
- DragStat().Ref1()=pH->GetPos();
- nWink0=GetAngle(DragStat().GetStart()-DragStat().GetRef1());
+ DragStat().SetRef1(pH->getPosition());
+ const basegfx::B2DVector aDirection(DragStat().GetStart() - DragStat().GetRef1());
+ mfStartRotation = atan2(aDirection.getY(), aDirection.getX());
return true;
}
else
@@ -2176,54 +2107,43 @@ bool SdrDragRotate::BeginSdrDrag()
basegfx::B2DHomMatrix SdrDragRotate::getCurrentTransformation()
{
- return basegfx::tools::createRotateAroundPoint(
- DragStat().GetRef1().X(), DragStat().GetRef1().Y(),
- -atan2(nSin, nCos));
+ return basegfx::tools::createRotateAroundPoint(DragStat().GetRef1(), mfDeltaRotation);
}
-void SdrDragRotate::MoveSdrDrag(const Point& rPnt_)
+void SdrDragRotate::MoveSdrDrag(const basegfx::B2DPoint& rPoint)
{
- Point aPnt(rPnt_);
- if (DragStat().CheckMinMoved(aPnt))
+ if(DragStat().CheckMinMoved(rPoint))
{
- long nNeuWink=NormAngle360(GetAngle(aPnt-DragStat().GetRef1())-nWink0);
- long nSA=0;
-
- if (getSdrDragView().IsAngleSnapEnabled())
- nSA=getSdrDragView().GetSnapAngle();
+ const basegfx::B2DVector aDirection(rPoint - DragStat().GetRef1());
+ double fNewDeltaRotation(atan2(aDirection.getY(), aDirection.getX()) - mfStartRotation);
- if (!getSdrDragView().IsRotateAllowed(false))
- nSA=9000;
-
- if (nSA!=0)
- { // Winkelfang
- nNeuWink+=nSA/2;
- nNeuWink/=nSA;
- nNeuWink*=nSA;
- }
+ if(!basegfx::fTools::equalZero(fNewDeltaRotation))
+ {
+ double fSnapAngle(0.0);
- nNeuWink=NormAngle180(nNeuWink);
+ if(getSdrView().IsAngleSnapEnabled())
+ {
+ fSnapAngle = ((getSdrView().GetSnapAngle() % 36000) * F_PI) / 18000.0;
+ }
- if (nWink!=nNeuWink)
- {
- sal_uInt16 nSekt0=GetAngleSector(nWink);
- sal_uInt16 nSekt1=GetAngleSector(nNeuWink);
+ if(!getSdrView().IsRotateAllowed(false))
+ {
+ fSnapAngle = F_PI2;
+ }
- if (nSekt0==0 && nSekt1==3)
- bRight=true;
+ if(!basegfx::fTools::equalZero(fSnapAngle))
+ {
+ fNewDeltaRotation = basegfx::snapToNearestMultiple(fNewDeltaRotation, fSnapAngle);
+ }
- if (nSekt0==3 && nSekt1==0)
- bRight=false;
+ if(!basegfx::fTools::equal(fNewDeltaRotation, mfDeltaRotation))
+ {
+ mfDeltaRotation = fNewDeltaRotation;
- nWink=nNeuWink;
- double a=nWink*nPi180;
- double nSin1=sin(a); // schonmal berechnen, damit mgl. wenig Zeit
- double nCos1=cos(a); // zwischen Hide() und Show() vergeht
- Hide();
- nSin=nSin1;
- nCos=nCos1;
- DragStat().NextMove(aPnt);
- Show();
+ Hide();
+ DragStat().NextMove(rPoint);
+ Show();
+ }
}
}
}
@@ -2232,19 +2152,22 @@ bool SdrDragRotate::EndSdrDrag(bool bCopy)
{
Hide();
- if (nWink!=0)
+ if(!basegfx::fTools::equalZero(mfDeltaRotation))
{
- if (IsDraggingPoints())
+ if(IsDraggingPoints())
{
- getSdrDragView().RotateMarkedPoints(DragStat().GetRef1(),nWink,bCopy);
+ getSdrView().TransformMarkedPoints(
+ basegfx::tools::createRotateAroundPoint(DragStat().GetRef1(), mfDeltaRotation),
+ SDRREPFUNC_OBJ_ROTATE,
+ bCopy);
}
- else if (IsDraggingGluePoints())
+ else if(IsDraggingGluePoints())
{
- getSdrDragView().RotateMarkedGluePoints(DragStat().GetRef1(),nWink,bCopy);
+ getSdrView().RotateMarkedGluePoints(DragStat().GetRef1(), mfDeltaRotation, bCopy);
}
else
{
- getSdrDragView().RotateMarkedObj(DragStat().GetRef1(),nWink,bCopy);
+ getSdrView().RotateMarkedObj(DragStat().GetRef1(), mfDeltaRotation, bCopy);
}
}
return true;
@@ -2257,274 +2180,194 @@ Pointer SdrDragRotate::GetSdrDragPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragShear,SdrDragMethod);
-
-SdrDragShear::SdrDragShear(SdrDragView& rNewView, bool bSlant1)
+SdrDragShear::SdrDragShear(SdrView& rNewView)
: SdrDragMethod(rNewView),
- aFact(1,1),
- nWink0(0),
- nWink(0),
- nTan(0.0),
- bVertical(false),
- bResize(false),
- bUpSideDown(false),
- bSlant(bSlant1)
+ mfStartAngle(0.0),
+ mfDeltaAngle(0.0),
+ mfFactor(1.0),
+ mbVertical(false)
{
}
void SdrDragShear::TakeSdrDragComment(XubString& rStr) const
{
- ImpTakeDescriptionStr(STR_DragMethShear, rStr);
- rStr.AppendAscii(" (");
-
- sal_Int32 nTmpWink(nWink);
-
- if(bUpSideDown)
- nTmpWink += 18000;
-
- nTmpWink = NormAngle180(nTmpWink);
-
+ TakeMarkedDescriptionString(STR_DragMethShear, rStr);
+ sal_Int32 nOldAngle(basegfx::fround((mfDeltaAngle * -18000.0) / F_PI) % 36000);
XubString aStr;
- getSdrDragView().GetModel()->TakeWinkStr(nTmpWink, aStr);
+ if(nOldAngle > 18000)
+ {
+ nOldAngle = 36000 - nOldAngle;
+ }
+
+ rStr.AppendAscii(" (");
+ getSdrView().getSdrModelFromSdrView().TakeWinkStr(nOldAngle, aStr);
rStr += aStr;
rStr += sal_Unicode(')');
- if(getSdrDragView().IsDragWithCopy())
+ if(getSdrView().IsDragWithCopy())
+ {
rStr += ImpGetResStr(STR_EditWithCopy);
+ }
}
bool SdrDragShear::BeginSdrDrag()
{
- SdrHdlKind eRefHdl=HDL_MOVE;
- SdrHdl* pRefHdl=NULL;
+ SdrHdlKind eRefHdl(HDL_MOVE);
+ SdrHdl* pRefHdl = 0;
- switch (GetDragHdlKind())
+ switch(GetDragHdlKind())
{
- case HDL_UPPER: eRefHdl=HDL_LOWER; break;
- case HDL_LOWER: eRefHdl=HDL_UPPER; break;
- case HDL_LEFT : eRefHdl=HDL_RIGHT; bVertical=true; break;
- case HDL_RIGHT: eRefHdl=HDL_LEFT ; bVertical=true; break;
+ case HDL_UPPER: eRefHdl = HDL_LOWER; break;
+ case HDL_LOWER: eRefHdl = HDL_UPPER; break;
+ case HDL_LEFT : eRefHdl = HDL_RIGHT; mbVertical = true; break;
+ case HDL_RIGHT: eRefHdl = HDL_LEFT; mbVertical = true; break;
default: break;
}
- if (eRefHdl!=HDL_MOVE)
- pRefHdl=GetHdlList().GetHdl(eRefHdl);
+ if(HDL_MOVE != eRefHdl)
+ {
+ pRefHdl = GetHdlList().GetHdlByKind(eRefHdl);
+ }
- if (pRefHdl!=NULL)
+ if(pRefHdl)
{
- DragStat().Ref1()=pRefHdl->GetPos();
- nWink0=GetAngle(DragStat().GetStart()-DragStat().GetRef1());
+ DragStat().SetRef1(pRefHdl->getPosition());
+
+ const basegfx::B2DVector aDirection(DragStat().GetStart() - DragStat().GetRef1());
+ mfStartAngle = atan2(aDirection.getY(), aDirection.getX());
}
else
{
DBG_ERROR("SdrDragShear::BeginSdrDrag(): Kein Referenzpunkt-Handle fuer Shear gefunden");
+
return false;
}
Show();
+
return true;
}
basegfx::B2DHomMatrix SdrDragShear::getCurrentTransformation()
{
- basegfx::B2DHomMatrix aRetval(basegfx::tools::createTranslateB2DHomMatrix(
- -DragStat().GetRef1().X(), -DragStat().GetRef1().Y()));
+ basegfx::B2DHomMatrix aRetval;
+ const bool bResizeUsed(!basegfx::fTools::equal(mfFactor, 1.0));
+ const bool bShearUsed(!basegfx::fTools::equalZero(mfDeltaAngle));
- if (bResize)
+ if(bResizeUsed || bShearUsed)
{
- if (bVertical)
+ aRetval.translate(-DragStat().GetRef1());
+
+ if(bResizeUsed)
{
- aRetval.scale(aFact, 1.0);
- aRetval.shearY(-nTan);
+ if(mbVertical)
+ {
+ aRetval.scale(mfFactor, 1.0);
+ }
+ else
+ {
+ aRetval.scale(1.0, mfFactor);
+ }
}
- else
+
+ if(bShearUsed)
{
- aRetval.scale(1.0, aFact);
- aRetval.shearX(-nTan);
+ if(mbVertical)
+ {
+ aRetval.shearY(tan(mfDeltaAngle));
+ }
+ else
+ {
+ aRetval.shearX(tan(mfDeltaAngle));
+ }
}
- }
- aRetval.translate(DragStat().GetRef1().X(), DragStat().GetRef1().Y());
+ aRetval.translate(DragStat().GetRef1());
+ }
return aRetval;
}
-void SdrDragShear::MoveSdrDrag(const Point& rPnt)
+void SdrDragShear::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
- if (DragStat().CheckMinMoved(rPnt))
+ if(DragStat().CheckMinMoved(rPnt))
{
- bResize=!getSdrDragView().IsOrtho();
- long nSA=0;
-
- if (getSdrDragView().IsAngleSnapEnabled())
- nSA=getSdrDragView().GetSnapAngle();
-
- Point aP0(DragStat().GetStart());
- Point aPnt(rPnt);
- Fraction aNeuFact(1,1);
-
- // Wenn kein Winkelfang, dann ggf. Rasterfang (ausser bei Slant)
- if (nSA==0 && !bSlant)
- aPnt=GetSnapPos(aPnt);
-
- if (!bSlant && !bResize)
- { // Shear ohne Resize
- if (bVertical)
- aPnt.X()=aP0.X();
- else
- aPnt.Y()=aP0.Y();
- }
-
- Point aRef(DragStat().GetRef1());
- Point aDif(aPnt-aRef);
+ const basegfx::B2DVector aDirection(rPnt - DragStat().GetRef1());
+ double fNewDeltaAngle(0.0);
- long nNeuWink=0;
-
- if (bSlant)
+ if(mbVertical)
{
- nNeuWink=NormAngle180(-(GetAngle(aDif)-nWink0));
-
- if (bVertical)
- nNeuWink=NormAngle180(-nNeuWink);
+ fNewDeltaAngle = atan2(aDirection.getY(), aDirection.getX()) - mfStartAngle;
}
else
{
- if (bVertical)
- nNeuWink=NormAngle180(GetAngle(aDif));
- else
- nNeuWink=NormAngle180(-(GetAngle(aDif)-9000));
-
- if (nNeuWink<-9000 || nNeuWink>9000)
- nNeuWink=NormAngle180(nNeuWink+18000);
-
- if (bResize)
- {
- Point aPt2(aPnt);
-
- if (nSA!=0)
- aPt2=GetSnapPos(aPnt); // den also in jedem Falle fangen
-
- if (bVertical)
- {
- aNeuFact=Fraction(aPt2.X()-aRef.X(),aP0.X()-aRef.X());
- }
- else
- {
- aNeuFact=Fraction(aPt2.Y()-aRef.Y(),aP0.Y()-aRef.Y());
- }
- }
+ fNewDeltaAngle = mfStartAngle - atan2(aDirection.getY(), aDirection.getX());
}
- bool bNeg=nNeuWink<0;
-
- if (bNeg)
- nNeuWink=-nNeuWink;
-
- if (nSA!=0)
- { // Winkelfang
- nNeuWink+=nSA/2;
- nNeuWink/=nSA;
- nNeuWink*=nSA;
- }
+ fNewDeltaAngle = basegfx::snapToRange(fNewDeltaAngle, -F_PI, F_PI);
- nNeuWink=NormAngle360(nNeuWink);
- bUpSideDown=nNeuWink>9000 && nNeuWink<27000;
+ if(getSdrView().IsAngleSnapEnabled())
+ {
+ const double fSnapAngle(((getSdrView().GetSnapAngle() % 36000) * F_PI) / 18000.0);
- if (bSlant)
- { // Resize fuer Slant berechnen
- // Mit Winkelfang jedoch ohne 89deg Begrenzung
- long nTmpWink=nNeuWink;
- if (bUpSideDown) nNeuWink-=18000;
- if (bNeg) nTmpWink=-nTmpWink;
- bResize=true;
- double nCos=cos(nTmpWink*nPi180);
- aNeuFact=nCos;
- Kuerzen(aFact,10); // 3 Dezimalstellen sollten reichen
+ fNewDeltaAngle = basegfx::snapToNearestMultiple(fNewDeltaAngle, fSnapAngle);
}
- if (nNeuWink>8900)
- nNeuWink=8900;
-
- if (bNeg)
- nNeuWink=-nNeuWink;
+ // calc resize for slant
+ double fNewFactor(cos(fNewDeltaAngle));
- if (nWink!=nNeuWink || aFact!=aNeuFact)
+ if(!basegfx::fTools::equal(mfDeltaAngle, fNewDeltaAngle) || !basegfx::fTools::equal(mfFactor, fNewFactor))
{
- nWink=nNeuWink;
- aFact=aNeuFact;
- double a=nWink*nPi180;
- double nTan1=0.0;
- nTan1=tan(a); // schonmal berechnen, damit mgl. wenig Zeit zwischen Hide() und Show() vergeht
+ mfDeltaAngle = fNewDeltaAngle;
+ mfFactor = fNewFactor;
+
Hide();
- nTan=nTan1;
DragStat().NextMove(rPnt);
Show();
}
}
}
-void SdrDragShear::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
-{
- if (bResize)
- {
- if (bVertical)
- {
- rTarget.Resize(DragStat().GetRef1(),aFact,Fraction(1,1));
- }
- else
- {
- rTarget.Resize(DragStat().GetRef1(),Fraction(1,1),aFact);
- }
- }
-
- if (nWink!=0)
- {
- rTarget.Shear(DragStat().GetRef1(),nWink,tan(nWink*nPi180),bVertical);
- }
-}
-
bool SdrDragShear::EndSdrDrag(bool bCopy)
{
Hide();
- if (bResize && aFact==Fraction(1,1))
- bResize=false;
+ const bool bResizeUsed(!basegfx::fTools::equal(mfFactor, 1.0));
+ const bool bShearUsed(!basegfx::fTools::equalZero(mfDeltaAngle));
- if (nWink!=0 || bResize)
+ if(bResizeUsed || bShearUsed)
{
- if (nWink!=0 && bResize)
- {
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditShear,aStr);
-
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
+ XubString aStr;
+ TakeMarkedDescriptionString(STR_EditShear, aStr);
- getSdrDragView().BegUndo(aStr);
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
}
- if (bResize)
+ getSdrView().BegUndo(aStr);
+
+ if(bResizeUsed)
{
- if (bVertical)
+ if(mbVertical)
{
- getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),aFact,Fraction(1,1),bCopy);
+ getSdrView().ResizeMarkedObj(DragStat().GetRef1(), basegfx::B2DVector(mfFactor, 1.0), bCopy);
}
else
{
- getSdrDragView().ResizeMarkedObj(DragStat().GetRef1(),Fraction(1,1),aFact,bCopy);
+ getSdrView().ResizeMarkedObj(DragStat().GetRef1(), basegfx::B2DVector(1.0, mfFactor), bCopy);
}
- bCopy=false;
+ bCopy = false;
}
- if (nWink!=0)
+ if(bShearUsed)
{
- getSdrDragView().ShearMarkedObj(DragStat().GetRef1(),nWink,bVertical,bCopy);
+ getSdrView().ShearMarkedObj(DragStat().GetRef1(), mfDeltaAngle, mbVertical, bCopy);
}
- if (nWink!=0 && bResize)
- getSdrDragView().EndUndo();
+ getSdrView().EndUndo();
return true;
}
@@ -2534,85 +2377,98 @@ bool SdrDragShear::EndSdrDrag(bool bCopy)
Pointer SdrDragShear::GetSdrDragPointer() const
{
- if (bVertical)
+ if(mbVertical)
+ {
return Pointer(POINTER_VSHEAR);
+ }
else
+ {
return Pointer(POINTER_HSHEAR);
+ }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragMirror,SdrDragMethod);
-
-void SdrDragMirror::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
-{
- if(bMirrored)
- {
- rTarget.Mirror(DragStat().GetRef1(), DragStat().GetRef2());
- }
-}
-
-SdrDragMirror::SdrDragMirror(SdrDragView& rNewView)
-: SdrDragMethod(rNewView),
- nWink(0),
- bMirrored(false),
- bSide0(false)
+SdrDragMirror::SdrDragMirror(SdrView& rNewView)
+: SdrDragMethod(rNewView)
{
}
-bool SdrDragMirror::ImpCheckSide(const Point& rPnt) const
+void SdrDragMirror::TakeSdrDragComment(XubString& rStr) const
{
- long nWink1=GetAngle(rPnt-DragStat().GetRef1());
- nWink1-=nWink;
- nWink1=NormAngle360(nWink1);
+ SdrHdl* pH1 = GetHdlList().GetHdlByKind(HDL_REF1);
+ SdrHdl* pH2 = GetHdlList().GetHdlByKind(HDL_REF2);
- return nWink1<18000;
-}
+ if(pH1 && pH2)
+ {
+ const basegfx::B2DVector aDelta(pH2->getPosition() - pH1->getPosition());
+ const bool bHorizontal(basegfx::fTools::equalZero(aDelta.getX()));
+ const bool bVertical(basegfx::fTools::equalZero(aDelta.getY()));
+ const bool b90(bHorizontal || bVertical);
+ const bool b45(b90 || basegfx::fTools::equal(fabs(aDelta.getX()), fabs(aDelta.getY())));
-void SdrDragMirror::TakeSdrDragComment(XubString& rStr) const
-{
- if (aDif.X()==0)
- ImpTakeDescriptionStr(STR_DragMethMirrorHori,rStr);
- else if (aDif.Y()==0)
- ImpTakeDescriptionStr(STR_DragMethMirrorVert,rStr);
- else if (Abs(aDif.X())==Abs(aDif.Y()))
- ImpTakeDescriptionStr(STR_DragMethMirrorDiag,rStr);
- else
- ImpTakeDescriptionStr(STR_DragMethMirrorFree,rStr);
+ if(bHorizontal)
+ {
+ TakeMarkedDescriptionString(STR_DragMethMirrorHori, rStr);
+ }
+ else if(bVertical)
+ {
+ TakeMarkedDescriptionString(STR_DragMethMirrorVert, rStr);
+ }
+ else if(b45)
+ {
+ TakeMarkedDescriptionString(STR_DragMethMirrorDiag, rStr);
+ }
+ else
+ {
+ TakeMarkedDescriptionString(STR_DragMethMirrorFree, rStr);
+ }
- if (getSdrDragView().IsDragWithCopy())
- rStr+=ImpGetResStr(STR_EditWithCopy);
+ if(getSdrView().IsDragWithCopy())
+ {
+ rStr += ImpGetResStr(STR_EditWithCopy);
+ }
+ }
}
bool SdrDragMirror::BeginSdrDrag()
{
- SdrHdl* pH1=GetHdlList().GetHdl(HDL_REF1);
- SdrHdl* pH2=GetHdlList().GetHdl(HDL_REF2);
+ SdrHdl* pH1 = GetHdlList().GetHdlByKind(HDL_REF1);
+ SdrHdl* pH2 = GetHdlList().GetHdlByKind(HDL_REF2);
- if (pH1!=NULL && pH2!=NULL)
+ if(pH1 && pH2)
{
- DragStat().Ref1()=pH1->GetPos();
- DragStat().Ref2()=pH2->GetPos();
- Ref1()=pH1->GetPos();
- Ref2()=pH2->GetPos();
- aDif=pH2->GetPos()-pH1->GetPos();
- bool b90=(aDif.X()==0) || aDif.Y()==0;
- bool b45=b90 || (Abs(aDif.X())==Abs(aDif.Y()));
- nWink=NormAngle360(GetAngle(aDif));
+ DragStat().SetRef1(pH1->getPosition());
+ DragStat().SetRef2(pH2->getPosition());
+ SetRef1(pH1->getPosition());
+ SetRef2(pH2->getPosition());
+
+ const basegfx::B2DVector aDelta(pH2->getPosition() - pH1->getPosition());
+ const bool bHorizontal(basegfx::fTools::equalZero(aDelta.getX()));
+ const bool bVertical(basegfx::fTools::equalZero(aDelta.getY()));
+ const bool b90(bHorizontal || bVertical);
+ const bool b45(b90 || basegfx::fTools::equal(fabs(aDelta.getX()), fabs(aDelta.getY())));
- if (!getSdrDragView().IsMirrorAllowed(false,false) && !b45)
- return false; // freier Achsenwinkel nicht erlaubt
+ if(!getSdrView().IsMirrorAllowed(false, false) && !b45)
+ {
+ // freier Achsenwinkel nicht erlaubt
+ return false;
+ }
- if (!getSdrDragView().IsMirrorAllowed(true,false) && !b90)
- return false; // 45deg auch nicht erlaubt
+ if(!getSdrView().IsMirrorAllowed(true, false) && !b90)
+ {
+ // 45deg auch nicht erlaubt
+ return false;
+ }
- bSide0=ImpCheckSide(DragStat().GetStart());
Show();
+
return true;
}
else
{
DBG_ERROR("SdrDragMirror::BeginSdrDrag(): Spiegelachse nicht gefunden");
+
return false;
}
}
@@ -2620,34 +2476,33 @@ bool SdrDragMirror::BeginSdrDrag()
basegfx::B2DHomMatrix SdrDragMirror::getCurrentTransformation()
{
basegfx::B2DHomMatrix aRetval;
+ const bool bMirrored(!basegfx::tools::arePointsOnSameSideOfLine(GetRef1(), GetRef2(), DragStat().GetStart(), DragStat().GetNow()));
- if (bMirrored)
+ if(bMirrored)
{
- const double fDeltaX(DragStat().GetRef2().X() - DragStat().GetRef1().X());
- const double fDeltaY(DragStat().GetRef2().Y() - DragStat().GetRef1().Y());
- const double fRotation(atan2(fDeltaY, fDeltaX));
+ const basegfx::B2DVector aDelta(DragStat().GetRef2() - DragStat().GetRef1());
+ const double fRotation(atan2(aDelta.getY(), aDelta.getX()));
- aRetval = basegfx::tools::createTranslateB2DHomMatrix(-DragStat().GetRef1().X(), -DragStat().GetRef1().Y());
+ aRetval.translate(-DragStat().GetRef1());
aRetval.rotate(-fRotation);
aRetval.scale(1.0, -1.0);
aRetval.rotate(fRotation);
- aRetval.translate(DragStat().GetRef1().X(), DragStat().GetRef1().Y());
+ aRetval.translate(DragStat().GetRef1());
}
return aRetval;
}
-void SdrDragMirror::MoveSdrDrag(const Point& rPnt)
+void SdrDragMirror::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
- if (DragStat().CheckMinMoved(rPnt))
+ if(DragStat().CheckMinMoved(rPnt))
{
- bool bNeuSide=ImpCheckSide(rPnt);
- bool bNeuMirr=bSide0!=bNeuSide;
+ const bool bMirroredOld(!basegfx::tools::arePointsOnSameSideOfLine(GetRef1(), GetRef2(), DragStat().GetStart(), DragStat().GetNow()));
+ const bool bMirroredNew(!basegfx::tools::arePointsOnSameSideOfLine(GetRef1(), GetRef2(), DragStat().GetStart(), rPnt));
- if (bMirrored!=bNeuMirr)
+ if(bMirroredOld != bMirroredNew)
{
Hide();
- bMirrored=bNeuMirr;
DragStat().NextMove(rPnt);
Show();
}
@@ -2658,9 +2513,11 @@ bool SdrDragMirror::EndSdrDrag(bool bCopy)
{
Hide();
- if (bMirrored)
+ const bool bMirrored(!basegfx::tools::arePointsOnSameSideOfLine(GetRef1(), GetRef2(), DragStat().GetStart(), DragStat().GetNow()));
+
+ if(bMirrored)
{
- getSdrDragView().MirrorMarkedObj(DragStat().GetRef1(),DragStat().GetRef2(),bCopy);
+ getSdrView().MirrorMarkedObj(DragStat().GetRef1(), DragStat().GetRef2(), bCopy);
}
return true;
@@ -2673,11 +2530,9 @@ Pointer SdrDragMirror::GetSdrDragPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragGradient, SdrDragMethod);
-
-SdrDragGradient::SdrDragGradient(SdrDragView& rNewView, bool bGrad)
+SdrDragGradient::SdrDragGradient(SdrView& rNewView, bool bGrad)
: SdrDragMethod(rNewView),
- pIAOHandle(NULL),
+ pIAOHandle(0),
bIsGradient(bGrad)
{
}
@@ -2685,67 +2540,52 @@ SdrDragGradient::SdrDragGradient(SdrDragView& rNewView, bool bGrad)
void SdrDragGradient::TakeSdrDragComment(XubString& rStr) const
{
if(IsGradient())
- ImpTakeDescriptionStr(STR_DragMethGradient, rStr);
+ {
+ TakeMarkedDescriptionString(STR_DragMethGradient, rStr);
+ }
else
- ImpTakeDescriptionStr(STR_DragMethTransparence, rStr);
+ {
+ TakeMarkedDescriptionString(STR_DragMethTransparence, rStr);
+ }
}
bool SdrDragGradient::BeginSdrDrag()
{
bool bRetval(false);
-
- pIAOHandle = (SdrHdlGradient*)GetHdlList().GetHdl(IsGradient() ? HDL_GRAD : HDL_TRNS);
+ pIAOHandle = dynamic_cast< SdrHdlGradient* >(GetHdlList().GetHdlByKind(IsGradient() ? HDL_GRAD : HDL_TRNS));
if(pIAOHandle)
{
// save old values
- DragStat().Ref1() = pIAOHandle->GetPos();
- DragStat().Ref2() = pIAOHandle->Get2ndPos();
+ DragStat().SetRef1(pIAOHandle->getPosition());
+ DragStat().SetRef2(pIAOHandle->get2ndPosition());
// what was hit?
bool bHit(false);
- SdrHdlColor* pColHdl = pIAOHandle->GetColorHdl1();
// init handling flags
pIAOHandle->SetMoveSingleHandle(false);
pIAOHandle->SetMoveFirstHandle(false);
// test first color handle
- if(pColHdl)
+ if(pIAOHandle->getColHdl1().getOverlayObjectList().isHitLogic(DragStat().GetStart()))
{
- basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y());
-
- if(pColHdl->getOverlayObjectList().isHitLogic(aPosition))
- {
- bHit = true;
- pIAOHandle->SetMoveSingleHandle(true);
- pIAOHandle->SetMoveFirstHandle(true);
- }
+ bHit = true;
+ pIAOHandle->SetMoveSingleHandle(true);
+ pIAOHandle->SetMoveFirstHandle(true);
}
// test second color handle
- pColHdl = pIAOHandle->GetColorHdl2();
-
- if(!bHit && pColHdl)
+ if(!bHit && pIAOHandle->getColHdl2().getOverlayObjectList().isHitLogic(DragStat().GetStart()))
{
- basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y());
-
- if(pColHdl->getOverlayObjectList().isHitLogic(aPosition))
- {
- bHit = true;
- pIAOHandle->SetMoveSingleHandle(true);
- }
+ bHit = true;
+ pIAOHandle->SetMoveSingleHandle(true);
}
// test gradient handle itself
- if(!bHit)
+ if(!bHit && pIAOHandle->getOverlayObjectList().isHitLogic(DragStat().GetStart()))
{
- basegfx::B2DPoint aPosition(DragStat().GetStart().X(), DragStat().GetStart().Y());
-
- if(pIAOHandle->getOverlayObjectList().isHitLogic(aPosition))
- {
- bHit = true;
- }
+ bHit = true;
}
// everything up and running :o}
@@ -2759,55 +2599,43 @@ bool SdrDragGradient::BeginSdrDrag()
return bRetval;
}
-void SdrDragGradient::MoveSdrDrag(const Point& rPnt)
+void SdrDragGradient::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
if(pIAOHandle && DragStat().CheckMinMoved(rPnt))
{
DragStat().NextMove(rPnt);
-
- // Do the Move here!!! DragStat().GetStart()
- Point aMoveDiff = rPnt - DragStat().GetStart();
+ const basegfx::B2DVector aMoveDiff(rPnt - DragStat().GetStart());
if(pIAOHandle->IsMoveSingleHandle())
{
if(pIAOHandle->IsMoveFirstHandle())
{
- pIAOHandle->SetPos(DragStat().Ref1() + aMoveDiff);
- if(pIAOHandle->GetColorHdl1())
- pIAOHandle->GetColorHdl1()->SetPos(DragStat().Ref1() + aMoveDiff);
+ pIAOHandle->setPosition(DragStat().GetRef1() + aMoveDiff);
}
else
{
- pIAOHandle->Set2ndPos(DragStat().Ref2() + aMoveDiff);
- if(pIAOHandle->GetColorHdl2())
- pIAOHandle->GetColorHdl2()->SetPos(DragStat().Ref2() + aMoveDiff);
+ pIAOHandle->set2ndPosition(DragStat().GetRef2() + aMoveDiff);
}
}
else
{
- pIAOHandle->SetPos(DragStat().Ref1() + aMoveDiff);
- pIAOHandle->Set2ndPos(DragStat().Ref2() + aMoveDiff);
-
- if(pIAOHandle->GetColorHdl1())
- pIAOHandle->GetColorHdl1()->SetPos(DragStat().Ref1() + aMoveDiff);
-
- if(pIAOHandle->GetColorHdl2())
- pIAOHandle->GetColorHdl2()->SetPos(DragStat().Ref2() + aMoveDiff);
+ pIAOHandle->setPosition(DragStat().GetRef1() + aMoveDiff);
+ pIAOHandle->set2ndPosition(DragStat().GetRef2() + aMoveDiff);
}
// new state
- pIAOHandle->FromIAOToItem(getSdrDragView().GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(), false, false);
+ pIAOHandle->FromIAOToItem(false, false);
}
}
bool SdrDragGradient::EndSdrDrag(bool /*bCopy*/)
{
// here the result is clear, do something with the values
- Ref1() = pIAOHandle->GetPos();
- Ref2() = pIAOHandle->Get2ndPos();
+ SetRef1(pIAOHandle->getColHdl1().getPosition());
+ SetRef2(pIAOHandle->getColHdl2().getPosition());
// new state
- pIAOHandle->FromIAOToItem(getSdrDragView().GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(), true, true);
+ pIAOHandle->FromIAOToItem(true, true);
return true;
}
@@ -2815,17 +2643,11 @@ bool SdrDragGradient::EndSdrDrag(bool /*bCopy*/)
void SdrDragGradient::CancelSdrDrag()
{
// restore old values
- pIAOHandle->SetPos(DragStat().Ref1());
- pIAOHandle->Set2ndPos(DragStat().Ref2());
-
- if(pIAOHandle->GetColorHdl1())
- pIAOHandle->GetColorHdl1()->SetPos(DragStat().Ref1());
-
- if(pIAOHandle->GetColorHdl2())
- pIAOHandle->GetColorHdl2()->SetPos(DragStat().Ref2());
+ pIAOHandle->setPosition(DragStat().GetRef1());
+ pIAOHandle->set2ndPosition(DragStat().GetRef2());
// new state
- pIAOHandle->FromIAOToItem(getSdrDragView().GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(), true, false);
+ pIAOHandle->FromIAOToItem(true, false);
}
Pointer SdrDragGradient::GetSdrDragPointer() const
@@ -2835,52 +2657,62 @@ Pointer SdrDragGradient::GetSdrDragPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragCrook,SdrDragMethod);
-
-SdrDragCrook::SdrDragCrook(SdrDragView& rNewView)
+SdrDragCrook::SdrDragCrook(SdrView& rNewView)
: SdrDragMethod(rNewView),
- aFact(1,1),
- bContortionAllowed(false),
- bNoContortionAllowed(false),
- bContortion(false),
- bResizeAllowed(false),
- bResize(false),
- bRotateAllowed(false),
- bRotate(false),
- bVertical(false),
- bValid(false),
- bLft(false),
- bRgt(false),
- bUpr(false),
- bLwr(false),
- bAtCenter(false),
- nWink(0),
- nMarkSize(0),
- eMode(SDRCROOK_ROTATE)
+ maMarkedRange(),
+ maMarkedCenter(0.0, 0.0),
+ maCenter(0.0, 0.0),
+ maStart(0.0, 0.0),
+ maRadius(0.0, 0.0),
+ mfFactor(1.0),
+ mfAngle(0.0),
+ mfMarkedSize(0.0),
+ meMode(SDRCROOK_ROTATE),
+ mbContortionAllowed(false),
+ mbNoContortionAllowed(false),
+ mbContortion(false),
+ mbResizeAllowed(false),
+ mbResize(false),
+ mbRotateAllowed(false),
+ mbRotate(false),
+ mbVertical(false),
+ mbValid(false),
+ mbLeft(false),
+ mbRight(false),
+ mbTop(false),
+ mbBottom(false),
+ mbAtCenter(false)
{
}
void SdrDragCrook::TakeSdrDragComment(XubString& rStr) const
{
- ImpTakeDescriptionStr(!bContortion ? STR_DragMethCrook : STR_DragMethCrookContortion, rStr);
+ TakeMarkedDescriptionString(!mbContortion ? STR_DragMethCrook : STR_DragMethCrookContortion, rStr);
- if(bValid)
+ if(mbValid)
{
rStr.AppendAscii(" (");
XubString aStr;
- sal_Int32 nVal(nWink);
+ sal_Int32 nVal(basegfx::fround(mfAngle * (18000.0 / F_PI)) % 36000);
+
+ if(nVal < 0)
+ {
+ nVal += 36000.0;
+ }
- if(bAtCenter)
+ if(mbAtCenter)
+ {
nVal *= 2;
+ }
nVal = Abs(nVal);
- getSdrDragView().GetModel()->TakeWinkStr(nVal, aStr);
+ getSdrView().getSdrModelFromSdrView().TakeWinkStr(nVal, aStr);
rStr += aStr;
rStr += sal_Unicode(')');
}
- if(getSdrDragView().IsDragWithCopy())
+ if(getSdrView().IsDragWithCopy())
rStr += ImpGetResStr(STR_EditWithCopy);
}
@@ -2890,30 +2722,40 @@ void SdrDragCrook::TakeSdrDragComment(XubString& rStr) const
#define DRAG_CROOK_RASTER_MAXIMUM (15)
#define DRAG_CROOK_RASTER_DISTANCE (30)
-basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView& rPageView, const Rectangle& rMarkRect)
+basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView& rPageView, const basegfx::B2DRange& rMarkRange)
{
basegfx::B2DPolyPolygon aRetval;
if(rPageView.PageWindowCount())
{
OutputDevice& rOut = (rPageView.GetPageWindow(0)->GetPaintWindow().GetOutputDevice());
- Rectangle aPixelSize = rOut.LogicToPixel(rMarkRect);
- sal_uInt32 nHorDiv(aPixelSize.GetWidth() / DRAG_CROOK_RASTER_DISTANCE);
- sal_uInt32 nVerDiv(aPixelSize.GetHeight() / DRAG_CROOK_RASTER_DISTANCE);
+ const basegfx::B2DRange aDiscreteRange(rOut.GetViewTransformation() * rMarkRange);
+ sal_uInt32 nHorDiv(basegfx::fround(aDiscreteRange.getWidth() / DRAG_CROOK_RASTER_DISTANCE));
+ sal_uInt32 nVerDiv(basegfx::fround(aDiscreteRange.getHeight() / DRAG_CROOK_RASTER_DISTANCE));
if(nHorDiv > DRAG_CROOK_RASTER_MAXIMUM)
+ {
nHorDiv = DRAG_CROOK_RASTER_MAXIMUM;
+ }
+
if(nHorDiv < DRAG_CROOK_RASTER_MINIMUM)
+ {
nHorDiv = DRAG_CROOK_RASTER_MINIMUM;
+ }
if(nVerDiv > DRAG_CROOK_RASTER_MAXIMUM)
+ {
nVerDiv = DRAG_CROOK_RASTER_MAXIMUM;
+ }
+
if(nVerDiv < DRAG_CROOK_RASTER_MINIMUM)
+ {
nVerDiv = DRAG_CROOK_RASTER_MINIMUM;
+ }
- const double fXLen(rMarkRect.GetWidth() / (double)nHorDiv);
- const double fYLen(rMarkRect.GetHeight() / (double)nVerDiv);
- double fYPos(rMarkRect.Top());
+ const double fXLen(rMarkRange.getWidth() / (double)nHorDiv);
+ const double fYLen(rMarkRange.getHeight() / (double)nVerDiv);
+ double fYPos(rMarkRange.getMinY());
sal_uInt32 a, b;
for(a = 0; a <= nVerDiv; a++)
@@ -2923,7 +2765,7 @@ basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView& rPageView, const Rectan
{
basegfx::B2DPolygon aHorLineSegment;
- const double fNewX(rMarkRect.Left() + (b * fXLen));
+ const double fNewX(rMarkRange.getMinX() + (b * fXLen));
aHorLineSegment.append(basegfx::B2DPoint(fNewX, fYPos));
aHorLineSegment.appendBezierSegment(
basegfx::B2DPoint(fNewX + (fXLen * (1.0 / 3.0)), fYPos),
@@ -2936,7 +2778,7 @@ basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView& rPageView, const Rectan
fYPos += fYLen;
}
- double fXPos(rMarkRect.Left());
+ double fXPos(rMarkRange.getMinX());
for(a = 0; a <= nHorDiv; a++)
{
@@ -2945,7 +2787,7 @@ basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView& rPageView, const Rectan
{
basegfx::B2DPolygon aVerLineSegment;
- const double fNewY(rMarkRect.Top() + (b * fYLen));
+ const double fNewY(rMarkRange.getMinY() + (b * fYLen));
aVerLineSegment.append(basegfx::B2DPoint(fXPos, fNewY));
aVerLineSegment.appendBezierSegment(
basegfx::B2DPoint(fXPos, fNewY + (fYLen * (1.0 / 3.0))),
@@ -2965,9 +2807,9 @@ basegfx::B2DPolyPolygon impCreateDragRaster(SdrPageView& rPageView, const Rectan
void SdrDragCrook::createSdrDragEntries()
{
// Add extended frame raster first, so it will be behind objects
- if(getSdrDragView().GetSdrPageView())
+ if(getSdrView().GetSdrPageView())
{
- const basegfx::B2DPolyPolygon aDragRaster(impCreateDragRaster(*getSdrDragView().GetSdrPageView(), GetMarkedRect()));
+ const basegfx::B2DPolyPolygon aDragRaster(impCreateDragRaster(*getSdrView().GetSdrPageView(), GetMarkedRange()));
if(aDragRaster.count())
{
@@ -2981,20 +2823,21 @@ void SdrDragCrook::createSdrDragEntries()
bool SdrDragCrook::BeginSdrDrag()
{
- bContortionAllowed=getSdrDragView().IsCrookAllowed(false);
- bNoContortionAllowed=getSdrDragView().IsCrookAllowed(true);
- bResizeAllowed=getSdrDragView().IsResizeAllowed(false);
- bRotateAllowed=getSdrDragView().IsRotateAllowed(false);
+ mbContortionAllowed = getSdrView().IsCrookAllowed(false);
+ mbNoContortionAllowed = getSdrView().IsCrookAllowed(true);
+ mbResizeAllowed = getSdrView().IsResizeAllowed(false);
+ mbRotateAllowed = getSdrView().IsRotateAllowed(false);
- if (bContortionAllowed || bNoContortionAllowed)
+ if(mbContortionAllowed || mbNoContortionAllowed)
{
- bVertical=(GetDragHdlKind()==HDL_LOWER || GetDragHdlKind()==HDL_UPPER);
- aMarkRect=GetMarkedRect();
- aMarkCenter=aMarkRect.Center();
- nMarkSize=bVertical ? (aMarkRect.GetHeight()-1) : (aMarkRect.GetWidth()-1);
- aCenter=aMarkCenter;
- aStart=DragStat().GetStart();
+ mbVertical = (HDL_LOWER == GetDragHdlKind() || HDL_UPPER == GetDragHdlKind());
+ maMarkedRange = GetMarkedRange();
+ maMarkedCenter = maMarkedRange.getCenter();
+ mfMarkedSize = mbVertical ? maMarkedRange.getHeight() : maMarkedRange.getWidth();
+ maCenter = maMarkedCenter;
+ maStart = DragStat().GetStart();
Show();
+
return true;
}
else
@@ -3005,361 +2848,385 @@ bool SdrDragCrook::BeginSdrDrag()
void SdrDragCrook::_MovAllPoints(basegfx::B2DPolyPolygon& rTarget)
{
- SdrPageView* pPV = getSdrDragView().GetSdrPageView();
+ const sal_uInt32 nPolyAnz(rTarget.count());
- if(pPV)
+ if(!mbContortion && !getSdrView().IsNoDragXorPolys())
{
- XPolyPolygon aTempPolyPoly(rTarget);
+ sal_uInt32 n1st(0);
+ sal_uInt32 nLast(0);
+ basegfx::B2DPoint aCenter(maCenter);
- if (pPV->HasMarkedObjPageView())
+ while(n1st < nPolyAnz)
{
- sal_uInt16 nPolyAnz=aTempPolyPoly.Count();
+ nLast = n1st;
- if (!bContortion && !getSdrDragView().IsNoDragXorPolys())
+ while(nLast < nPolyAnz && rTarget.getB2DPolygon(nLast).count())
{
- sal_uInt16 n1st=0,nLast=0;
- Point aC(aCenter);
-
- while (n1st<nPolyAnz)
- {
- nLast=n1st;
- while (nLast<nPolyAnz && aTempPolyPoly[nLast].GetPointCount()!=0) nLast++;
- Rectangle aBound(aTempPolyPoly[n1st].GetBoundRect());
- sal_uInt16 i;
+ nLast++;
+ }
- for (i=n1st+1; i<nLast; i++)
- {
- aBound.Union(aTempPolyPoly[n1st].GetBoundRect());
- }
+ basegfx::B2DRange aBound;
+ sal_uInt32 i(0);
- Point aCtr0(aBound.Center());
- Point aCtr1(aCtr0);
+ for(i = n1st; i < nLast; i++)
+ {
+ aBound.expand(rTarget.getB2DPolygon(i).getB2DRange());
+ }
- if (bResize)
- {
- Fraction aFact1(1,1);
+ basegfx::B2DPoint aCtr0(aBound.getCenter());
+ basegfx::B2DPoint aCtr1(aCtr0);
- if (bVertical)
- {
- ResizePoint(aCtr1,aC,aFact1,aFact);
- }
- else
- {
- ResizePoint(aCtr1,aC,aFact,aFact1);
- }
- }
+ if(mbResize)
+ {
+ Fraction aFact1(1,1);
- bool bRotOk=false;
- double nSin=0,nCos=0;
+ if (mbVertical)
+ {
+ aCtr1.setY(aCenter.getY() + ((aCtr1.getY() - aCenter.getY()) * mfFactor));
+ }
+ else
+ {
+ aCtr1.setX(aCenter.getX() + ((aCtr1.getX() - aCenter.getX()) * mfFactor));
+ }
+ }
- if (aRad.X()!=0 && aRad.Y()!=0)
- {
- bRotOk=bRotate;
+ bool bRotOk(false);
+ double fSinus(0.0), fCosinus(0.0);
- switch (eMode)
- {
- case SDRCROOK_ROTATE : CrookRotateXPoint (aCtr1,NULL,NULL,aC,aRad,nSin,nCos,bVertical); break;
- case SDRCROOK_SLANT : CrookSlantXPoint (aCtr1,NULL,NULL,aC,aRad,nSin,nCos,bVertical); break;
- case SDRCROOK_STRETCH: CrookStretchXPoint(aCtr1,NULL,NULL,aC,aRad,nSin,nCos,bVertical,aMarkRect); break;
- } // switch
- }
+ if(!maRadius.equalZero())
+ {
+ bRotOk = mbRotate;
- aCtr1-=aCtr0;
+ switch(meMode)
+ {
+ case SDRCROOK_ROTATE : CrookRotateXPoint(aCtr1, 0, 0, aCenter, maRadius, fSinus, fCosinus, mbVertical); break;
+ case SDRCROOK_SLANT : CrookSlantXPoint(aCtr1, 0, 0, aCenter, maRadius, fSinus, fCosinus, mbVertical); break;
+ case SDRCROOK_STRETCH: CrookStretchXPoint(aCtr1, 0, 0, aCenter, maRadius, fSinus, fCosinus, mbVertical, maMarkedRange); break;
+ }
+ }
- for (i=n1st; i<nLast; i++)
- {
- if (bRotOk)
- {
- RotateXPoly(aTempPolyPoly[i],aCtr0,nSin,nCos);
- }
+ aCtr1 -= aCtr0;
- aTempPolyPoly[i].Move(aCtr1.X(),aCtr1.Y());
- }
+ for(i = n1st; i < nLast; i++)
+ {
+ basegfx::B2DHomMatrix aTransform;
- n1st=nLast+1;
+ if(bRotOk)
+ {
+ aTransform.translate(-aCtr0);
+ aTransform.rotate(atan2(fSinus, fCosinus));
+ aTransform.translate(aCtr0);
}
+
+ aTransform.translate(aCtr1);
+
+ basegfx::B2DPolygon aPartialTarget(rTarget.getB2DPolygon(i));
+
+ aPartialTarget.transform(aTransform);
+ rTarget.setB2DPolygon(i, aPartialTarget);
}
- else
- {
- sal_uInt16 i,j;
- for (j=0; j<nPolyAnz; j++)
- {
- XPolygon& aPol=aTempPolyPoly[j];
- sal_uInt16 nPtAnz=aPol.GetPointCount();
- i=0;
+ n1st = nLast + 1;
+ }
+ }
+ else
+ {
+ for(sal_uInt32 j(0); j < nPolyAnz; j++)
+ {
+ basegfx::B2DPolygon aPol(rTarget.getB2DPolygon(j));
+ const sal_uInt32 nPtAnz(aPol.count());
+ const bool bIsCurve(aPol.areControlPointsUsed());
- while (i<nPtAnz)
- {
- Point* pPnt=&aPol[i];
- Point* pC1=NULL;
- Point* pC2=NULL;
-
- if (i+1<nPtAnz && aPol.IsControl(i))
- { // Kontrollpunkt links
- pC1=pPnt;
- i++;
- pPnt=&aPol[i];
- }
+ for(sal_uInt32 i(0); i < nPtAnz; i++)
+ {
+ basegfx::B2DPoint aPnt(aPol.getB2DPoint(i));
- i++;
+ if(bIsCurve && (aPol.isNextControlPointUsed(i) || aPol.isPrevControlPointUsed(i)))
+ {
+ basegfx::B2DPoint aPrev(aPol.getPrevControlPoint(i));
+ basegfx::B2DPoint aNext(aPol.getNextControlPoint(i));
- if (i<nPtAnz && aPol.IsControl(i))
- { // Kontrollpunkt rechts
- pC2=&aPol[i];
- i++;
- }
+ _MovCrookPoint(aPnt, &aPrev, &aNext);
- _MovCrookPoint(*pPnt,pC1,pC2);
- }
+ aPol.setB2DPoint(i, aPnt);
+ aPol.setControlPoints(i, aPrev, aNext);
+ }
+ else
+ {
+ _MovCrookPoint(aPnt, 0, 0);
+ aPol.setB2DPoint(i, aPnt);
}
}
- }
- rTarget = aTempPolyPoly.getB2DPolyPolygon();
+ rTarget.setB2DPolygon(j, aPol);
+ }
}
}
-void SdrDragCrook::_MovCrookPoint(Point& rPnt, Point* pC1, Point* pC2)
+void SdrDragCrook::_MovCrookPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2)
{
- bool bVert=bVertical;
- bool bC1=pC1!=NULL;
- bool bC2=pC2!=NULL;
- Point aC(aCenter);
+ bool bVert(mbVertical);
+ basegfx::B2DPoint aCenter(maCenter);
- if (bResize)
+ if(mbResize)
{
- Fraction aFact1(1,1);
-
- if (bVert)
+ if(bVert)
{
- ResizePoint(rPnt,aC,aFact1,aFact);
+ rPnt.setY(aCenter.getY() + (rPnt.getY() - aCenter.getY()) * mfFactor);
- if (bC1)
- ResizePoint(*pC1,aC,aFact1,aFact);
+ if(pC1)
+ {
+ pC1->setY(aCenter.getY() + (pC1->getY() - aCenter.getY()) * mfFactor);
+ }
- if (bC2)
- ResizePoint(*pC2,aC,aFact1,aFact);
+ if(pC2)
+ {
+ pC2->setY(aCenter.getY() + (pC2->getY() - aCenter.getY()) * mfFactor);
+ }
}
else
{
- ResizePoint(rPnt,aC,aFact,aFact1);
+ rPnt.setX(aCenter.getX() + (rPnt.getX() - aCenter.getX()) * mfFactor);
- if (bC1)
- ResizePoint(*pC1,aC,aFact,aFact1);
+ if(pC1)
+ {
+ pC1->setX(aCenter.getX() + (pC1->getX() - aCenter.getX()) * mfFactor);
+ }
- if (bC2)
- ResizePoint(*pC2,aC,aFact,aFact1);
+ if(pC2)
+ {
+ pC2->setX(aCenter.getX() + (pC2->getX() - aCenter.getX()) * mfFactor);
+ }
}
}
- if (aRad.X()!=0 && aRad.Y()!=0)
+ if(!maRadius.equalZero())
{
- double nSin,nCos;
+ double nSin, nCos;
- switch (eMode)
+ switch(meMode)
{
- case SDRCROOK_ROTATE : CrookRotateXPoint (rPnt,pC1,pC2,aC,aRad,nSin,nCos,bVert); break;
- case SDRCROOK_SLANT : CrookSlantXPoint (rPnt,pC1,pC2,aC,aRad,nSin,nCos,bVert); break;
- case SDRCROOK_STRETCH: CrookStretchXPoint(rPnt,pC1,pC2,aC,aRad,nSin,nCos,bVert,aMarkRect); break;
- } // switch
+ case SDRCROOK_ROTATE : CrookRotateXPoint(rPnt, pC1, pC2, aCenter, maRadius, nSin, nCos, bVert); break;
+ case SDRCROOK_SLANT : CrookSlantXPoint(rPnt, pC1, pC2, aCenter, maRadius, nSin, nCos, bVert); break;
+ case SDRCROOK_STRETCH : CrookStretchXPoint(rPnt, pC1, pC2, aCenter, maRadius, nSin, nCos, bVert, maMarkedRange); break;
+ }
}
}
-void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
+void SdrDragCrook::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
- if (DragStat().CheckMinMoved(rPnt))
+ if(DragStat().CheckMinMoved(rPnt))
{
- Point aPnt(rPnt);
- bool bNeuMoveOnly=getSdrDragView().IsMoveOnlyDragging();
- bAtCenter=false;
- SdrCrookMode eNeuMode=getSdrDragView().GetCrookMode();
- bool bNeuContortion=!bNeuMoveOnly && ((bContortionAllowed && !getSdrDragView().IsCrookNoContortion()) || !bNoContortionAllowed);
- bResize=!getSdrDragView().IsOrtho() && bResizeAllowed && !bNeuMoveOnly;
- bool bNeuRotate=bRotateAllowed && !bNeuContortion && !bNeuMoveOnly && eNeuMode==SDRCROOK_ROTATE;
- long nSA=0;
-
- if (nSA==0)
- aPnt=GetSnapPos(aPnt);
+ basegfx::B2DPoint aPnt(rPnt);
+ const bool bNeuMoveOnly(getSdrView().IsMoveOnlyDragging());
+ mbAtCenter = false;
+ SdrCrookMode eNeuMode(getSdrView().GetCrookMode());
+ const bool bNeuContortion(!bNeuMoveOnly && ((mbContortionAllowed && !getSdrView().IsCrookNoContortion()) || !mbNoContortionAllowed));
+ mbResize = !getSdrView().IsOrthogonal() && mbResizeAllowed && !bNeuMoveOnly;
+ const bool bNeuRotate(mbRotateAllowed && !bNeuContortion && !bNeuMoveOnly && SDRCROOK_ROTATE == eNeuMode);
- Point aNeuCenter(aMarkCenter.X(),aStart.Y());
+ aPnt = getSdrView().GetSnapPos(aPnt);
+ basegfx::B2DPoint aNeuCenter(maMarkedCenter.getX(), maStart.getY());
- if (bVertical)
+ if(mbVertical)
{
- aNeuCenter.X()=aStart.X();
- aNeuCenter.Y()=aMarkCenter.Y();
+ aNeuCenter.setX(maStart.getX());
+ aNeuCenter.setY(maMarkedCenter.getY());
}
- if (!getSdrDragView().IsCrookAtCenter())
+ if(!getSdrView().IsCrookAtCenter())
{
- switch (GetDragHdlKind())
+ switch(GetDragHdlKind())
{
- case HDL_UPLFT: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break;
- case HDL_UPPER: aNeuCenter.Y()=aMarkRect.Bottom(); bUpr=true; break;
- case HDL_UPRGT: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break;
- case HDL_LEFT : aNeuCenter.X()=aMarkRect.Right(); bLft=true; break;
- case HDL_RIGHT: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break;
- case HDL_LWLFT: aNeuCenter.X()=aMarkRect.Right(); bLft=true; break;
- case HDL_LOWER: aNeuCenter.Y()=aMarkRect.Top(); bLwr=true; break;
- case HDL_LWRGT: aNeuCenter.X()=aMarkRect.Left(); bRgt=true; break;
- default: bAtCenter=true;
+ case HDL_UPLFT: aNeuCenter.setX(maMarkedRange.getMaxX()); mbLeft = true; break;
+ case HDL_UPPER: aNeuCenter.setY(maMarkedRange.getMaxY()); mbTop = true; break;
+ case HDL_UPRGT: aNeuCenter.setX(maMarkedRange.getMinX()); mbRight = true; break;
+ case HDL_LEFT: aNeuCenter.setX(maMarkedRange.getMaxX()); mbLeft = true; break;
+ case HDL_RIGHT: aNeuCenter.setX(maMarkedRange.getMinX()); mbRight = true; break;
+ case HDL_LWLFT: aNeuCenter.setX(maMarkedRange.getMaxX()); mbLeft = true; break;
+ case HDL_LOWER: aNeuCenter.setY(maMarkedRange.getMinY()); mbBottom = true; break;
+ case HDL_LWRGT: aNeuCenter.setX(maMarkedRange.getMinX()); mbRight = true; break;
+ default: mbAtCenter = true;
}
}
else
- bAtCenter=true;
+ {
+ mbAtCenter = true;
+ }
- Fraction aNeuFact(1,1);
- long dx1=aPnt.X()-aNeuCenter.X();
- long dy1=aPnt.Y()-aNeuCenter.Y();
- bValid=bVertical ? dx1!=0 : dy1!=0;
+ double fNewFactor(1.0);
+ const basegfx::B2DVector aDelta(aPnt - aNeuCenter);
+ mbValid = !basegfx::fTools::equalZero(mbVertical ? aDelta.getX() : aDelta.getY());
- if (bValid)
+ if(mbValid)
{
- if (bVertical)
- bValid=Abs(dx1)*100>Abs(dy1);
+ if(mbVertical)
+ {
+ mbValid = fabs(aDelta.getX()) * 100.0 > fabs(aDelta.getY());
+ }
else
- bValid=Abs(dy1)*100>Abs(dx1);
+ {
+ mbValid = fabs(aDelta.getY()) * 100.0 > fabs(aDelta.getX());
+ }
}
- long nNeuRad=0;
- nWink=0;
+ double fNewRadius(0.0);
+ mfAngle = 0.0;
- if (bValid)
+ if(mbValid)
{
- double a=0; // Steigung des Radius
- long nPntWink=0;
+ double a(0.0); // Steigung des Radius
+ double fAngleWithPnt(0.0);
- if (bVertical)
+ if(mbVertical)
{
- a=((double)dy1)/((double)dx1); // Steigung des Radius
- nNeuRad=((long)(dy1*a)+dx1) /2;
- aNeuCenter.X()+=nNeuRad;
- nPntWink=GetAngle(aPnt-aNeuCenter);
+ a = aDelta.getY() / aDelta.getX(); // Steigung des Radius
+ fNewRadius = ((aDelta.getY() * a) + aDelta.getX()) * 0.5;
+ aNeuCenter.setX(aNeuCenter.getX() + fNewRadius);
+
+ const basegfx::B2DVector aVector(aPnt - aNeuCenter);
+ // keep fAngleWithPnt in old angle to not change below
+ // calculations using it in a hardly comprehensible way;
+ // at least double precision will be used now.
+ fAngleWithPnt = atan2(-aVector.getY(), aVector.getX())/ (F_PI / 18000.0);
}
else
{
- a=((double)dx1)/((double)dy1); // Steigung des Radius
- nNeuRad=((long)(dx1*a)+dy1) /2;
- aNeuCenter.Y()+=nNeuRad;
- nPntWink=GetAngle(aPnt-aNeuCenter)-9000;
+ a = aDelta.getX() / aDelta.getY(); // Steigung des Radius
+ fNewRadius = ((aDelta.getX() * a) + aDelta.getY()) * 0.5;
+ aNeuCenter.setY(aNeuCenter.getY() + fNewRadius);
+
+ const basegfx::B2DVector aVector(aPnt - aNeuCenter);
+ // keep fAngleWithPnt in old angle to not change below
+ // calculations using it in a hardly comprehensible way;
+ // at least double precision will be used now.
+ fAngleWithPnt = atan2(-aVector.getY(), aVector.getX()) / (F_PI / 18000.0);
+ fAngleWithPnt = fAngleWithPnt - 9000.0;
}
- if (!bAtCenter)
+ if(!mbAtCenter)
{
- if (nNeuRad<0)
+ if(fNewRadius < 0.0)
{
- if (bRgt) nPntWink+=18000;
- if (bLft) nPntWink=18000-nPntWink;
- if (bLwr) nPntWink=-nPntWink;
+ if(mbRight)
+ {
+ fAngleWithPnt += 18000.0;
+ }
+
+ if(mbLeft)
+ {
+ fAngleWithPnt = 18000.0 - fAngleWithPnt;
+ }
+
+ if(mbBottom)
+ {
+ fAngleWithPnt = -fAngleWithPnt;
+ }
}
else
{
- if (bRgt) nPntWink=-nPntWink;
- if (bUpr) nPntWink=18000-nPntWink;
- if (bLwr) nPntWink+=18000;
+ if(mbRight)
+ {
+ fAngleWithPnt = -fAngleWithPnt;
+ }
+
+ if(mbTop)
+ {
+ fAngleWithPnt = 18000.0 - fAngleWithPnt;
+ }
+
+ if(mbBottom)
+ {
+ fAngleWithPnt += 18000;
+ }
}
- nPntWink=NormAngle360(nPntWink);
+ fAngleWithPnt = basegfx::snapToZeroRange(fAngleWithPnt, 36000.0);
}
else
{
- if (nNeuRad<0) nPntWink+=18000;
- if (bVertical) nPntWink=18000-nPntWink;
- nPntWink=NormAngle180(nPntWink);
- nPntWink=Abs(nPntWink);
+ if(fNewRadius < 0.0)
+ {
+ fAngleWithPnt += 18000.0;
+ }
+
+ if(mbVertical)
+ {
+ fAngleWithPnt = 18000.0 - fAngleWithPnt;
+ }
+
+ fAngleWithPnt = fabs(basegfx::snapToRange(fAngleWithPnt, -18000.0, 18000.0));
}
- double nUmfang=2*Abs(nNeuRad)*nPi;
+ double fPerimeter(2.0 * fabs(fNewRadius) * F_PI);
- if (bResize)
+ if(mbResize)
{
- if (nSA!=0)
- { // Winkelfang
- long nWink0=nPntWink;
- nPntWink+=nSA/2;
- nPntWink/=nSA;
- nPntWink*=nSA;
- BigInt a2(nNeuRad);
- a2*=BigInt(nWink);
- a2/=BigInt(nWink0);
- nNeuRad=long(a2);
+ double fMultiplicator(fPerimeter * basegfx::snapToZeroRange(fAngleWithPnt, 36000.0) / 36000.0);
- if (bVertical)
- aNeuCenter.X()=aStart.X()+nNeuRad;
- else
- aNeuCenter.Y()=aStart.Y()+nNeuRad;
+ if(mbAtCenter)
+ {
+ fMultiplicator *= 2.0;
}
- long nMul=(long)(nUmfang*NormAngle360(nPntWink)/36000);
-
- if (bAtCenter)
- nMul*=2;
-
- aNeuFact=Fraction(nMul,nMarkSize);
- nWink=nPntWink;
+ fNewFactor = fMultiplicator / mfMarkedSize;
+ mfAngle = fAngleWithPnt * (F_PI / 18000.0);
}
else
{
- nWink=(long)((nMarkSize*360/nUmfang)*100)/2;
-
- if (nWink==0)
- bValid=false;
-
- if (bValid && nSA!=0)
- { // Winkelfang
- long nWink0=nWink;
- nWink+=nSA/2;
- nWink/=nSA;
- nWink*=nSA;
- BigInt a2(nNeuRad);
- a2*=BigInt(nWink);
- a2/=BigInt(nWink0);
- nNeuRad=long(a2);
+ mfAngle = (mfMarkedSize * 360.0 / fPerimeter) * 50.0;
+ mfAngle = mfAngle * (F_PI / 18000.0);
- if (bVertical)
- aNeuCenter.X()=aStart.X()+nNeuRad;
- else
- aNeuCenter.Y()=aStart.Y()+nNeuRad;
+ if(basegfx::fTools::equalZero(mfAngle))
+ {
+ mbValid = false;
}
}
}
- if (nWink==0 || nNeuRad==0)
- bValid=false;
-
- if (!bValid)
- nNeuRad=0;
+ if(basegfx::fTools::equalZero(mfAngle) || basegfx::fTools::equalZero(fNewRadius))
+ {
+ mbValid = false;
+ }
- if (!bValid && bResize)
+ if(!mbValid)
{
- long nMul=bVertical ? dy1 : dx1;
+ fNewRadius = 0.0;
+ }
- if (bLft || bUpr)
- nMul=-nMul;
+ if(!mbValid && mbResize)
+ {
+ double fMultiplicator(mbVertical ? aDelta.getY() : aDelta.getX());
- long nDiv=nMarkSize;
+ if(mbLeft || mbTop)
+ {
+ fMultiplicator = -fMultiplicator;
+ }
- if (bAtCenter)
+ if(mbAtCenter)
{
- nMul*=2;
- nMul=Abs(nMul);
+ fMultiplicator = fabs(fMultiplicator * 2.0);
}
- aNeuFact=Fraction(nMul,nDiv);
+ fNewFactor = fMultiplicator / mfMarkedSize;
}
- if (aNeuCenter!=aCenter || bNeuContortion!=bContortion || aNeuFact!=aFact ||
- bNeuMoveOnly != getMoveOnly() || bNeuRotate!=bRotate || eNeuMode!=eMode)
+ if(!aNeuCenter.equal(maCenter)
+ || bNeuContortion != mbContortion
+ || !basegfx::fTools::equal(fNewFactor, mfFactor)
+ || bNeuMoveOnly != getMoveOnly()
+ || bNeuRotate != mbRotate
+ || eNeuMode != meMode)
{
Hide();
setMoveOnly(bNeuMoveOnly);
- bRotate=bNeuRotate;
- eMode=eNeuMode;
- bContortion=bNeuContortion;
- aCenter=aNeuCenter;
- aFact=aNeuFact;
- aRad=Point(nNeuRad,nNeuRad);
- bResize=aFact!=Fraction(1,1) && aFact.GetDenominator()!=0 && aFact.IsValid();
+ mbRotate = bNeuRotate;
+ meMode = eNeuMode;
+ mbContortion = bNeuContortion;
+ maCenter = aNeuCenter;
+ mfFactor = fNewFactor;
+ maRadius = basegfx::B2DPoint(fNewRadius, fNewRadius);
+ mbResize = !basegfx::fTools::equal(mfFactor, 1.0);
DragStat().NextMove(aPnt);
Show();
}
@@ -3368,52 +3235,47 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt)
void SdrDragCrook::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
{
- const bool bDoResize(aFact!=Fraction(1,1));
- const bool bDoCrook(aCenter!=aMarkCenter && aRad.X()!=0 && aRad.Y()!=0);
+ const bool bDoResize(!basegfx::fTools::equal(mfFactor, 1.0));
+ const bool bDoCrook(!maCenter.equal(maMarkedCenter) && !maRadius.equalZero());
- if (bDoCrook || bDoResize)
+ if(bDoCrook || bDoResize)
{
- if (bDoResize)
+ if(bDoResize)
{
- Fraction aFact1(1,1);
-
- if (bContortion)
+ if(mbContortion)
{
- if (bVertical)
- {
- rTarget.Resize(aCenter,aFact1,aFact);
- }
- else
- {
- rTarget.Resize(aCenter,aFact,aFact1);
- }
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-maCenter);
+ aTransform.scale(mbVertical ? 1.0 : mfFactor, mbVertical ? mfFactor : 1.0);
+ aTransform.translate(maCenter);
+
+ sdr::legacy::transformSdrObject(rTarget, aTransform);
}
else
{
- Point aCtr0(rTarget.GetSnapRect().Center());
- Point aCtr1(aCtr0);
+ const basegfx::B2DPoint aCtr0(sdr::legacy::GetSnapRange(rTarget).getCenter());
+ basegfx::B2DPoint aCtr1(aCtr0);
- if (bVertical)
+ if(mbVertical)
{
- ResizePoint(aCtr1,aCenter,aFact1,aFact);
+ aCtr1.setY(maCenter.getY() + ((aCtr1.getY() - maCenter.getY()) * mfFactor));
}
else
{
- ResizePoint(aCtr1,aCenter,aFact,aFact1);
+ aCtr1.setX(maCenter.getX() + ((aCtr1.getX() - maCenter.getX()) * mfFactor));
}
- Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
-
- rTarget.Move(aSiz);
+ sdr::legacy::transformSdrObject(rTarget, basegfx::tools::createTranslateB2DHomMatrix(aCtr1 - aCtr0));
}
}
- if (bDoCrook)
+ if(bDoCrook)
{
- const Rectangle aLocalMarkRect(getSdrDragView().GetMarkedObjRect());
- const bool bLocalRotate(!bContortion && eMode == SDRCROOK_ROTATE && getSdrDragView().IsRotateAllowed(false));
+ const basegfx::B2DRange aLocalMarkRange(getSdrView().getMarkedObjectSnapRange());
+ const bool bLocalRotate(!mbContortion && SDRCROOK_ROTATE == meMode && getSdrView().IsRotateAllowed(false));
- getSdrDragView().ImpCrookObj(&rTarget,aCenter,aRad,eMode,bVertical,!bContortion,bLocalRotate,aLocalMarkRect);
+ getSdrView().ImpCrookObj(rTarget, maCenter, maRadius, meMode, mbVertical, !mbContortion, bLocalRotate, aLocalMarkRange);
}
}
}
@@ -3428,74 +3290,91 @@ bool SdrDragCrook::EndSdrDrag(bool bCopy)
{
Hide();
- if (bResize && aFact==Fraction(1,1))
- bResize=false;
-
- const bool bUndo = getSdrDragView().IsUndoEnabled();
+ if(mbResize && basegfx::fTools::equal(mfFactor, 1.0))
+ {
+ mbResize = false;
+ }
- bool bDoCrook=aCenter!=aMarkCenter && aRad.X()!=0 && aRad.Y()!=0;
+ const bool bUndo(getSdrView().IsUndoEnabled());
+ const bool bDoCrook(!maCenter.equal(maMarkedCenter) && !maRadius.equalZero());
- if (bDoCrook || bResize)
+ if(bDoCrook || mbResize)
{
- if (bResize && bUndo)
+ if(mbResize && bUndo)
{
XubString aStr;
- ImpTakeDescriptionStr(!bContortion?STR_EditCrook:STR_EditCrookContortion,aStr);
+ TakeMarkedDescriptionString(!mbContortion ? STR_EditCrook : STR_EditCrookContortion, aStr);
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
- getSdrDragView().BegUndo(aStr);
+ getSdrView().BegUndo(aStr);
}
- if (bResize)
+ if(mbResize)
{
- Fraction aFact1(1,1);
-
- if (bContortion)
+ if(mbContortion)
{
- if (bVertical)
- getSdrDragView().ResizeMarkedObj(aCenter,aFact1,aFact,bCopy);
+ if(mbVertical)
+ {
+ getSdrView().ResizeMarkedObj(maCenter, basegfx::B2DVector(1.0, mfFactor), bCopy);
+ }
else
- getSdrDragView().ResizeMarkedObj(aCenter,aFact,aFact1,bCopy);
+ {
+ getSdrView().ResizeMarkedObj(maCenter, basegfx::B2DVector(mfFactor, 1.0), bCopy);
+ }
}
else
{
- if (bCopy)
- getSdrDragView().CopyMarkedObj();
-
- sal_uLong nMarkAnz=getSdrDragView().GetMarkedObjectList().GetMarkCount();
+ if(bCopy)
+ {
+ getSdrView().CopyMarkedObj();
+ }
- for (sal_uLong nm=0; nm<nMarkAnz; nm++)
+ if(getSdrView().areSdrObjectsSelected())
{
- SdrMark* pM=getSdrDragView().GetMarkedObjectList().GetMark(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- Point aCtr0(pO->GetSnapRect().Center());
- Point aCtr1(aCtr0);
+ const SdrObjectVector aSelection(getSdrView().getSelectedSdrObjectVectorFromSdrMarkView());
- if (bVertical)
- ResizePoint(aCtr1,aCenter,aFact1,aFact);
- else
- ResizePoint(aCtr1,aCenter,aFact,aFact1);
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
+ const basegfx::B2DPoint aCtr0(sdr::legacy::GetSnapRange(*pO).getCenter());
+ basegfx::B2DPoint aCtr1(aCtr0);
+
+ if(mbVertical)
+ {
+ aCtr1.setY(maCenter.getY() + ((aCtr1.getY() - maCenter.getY()) * mfFactor));
+ }
+ else
+ {
+ aCtr1.setX(maCenter.getX() + ((aCtr1.getX() - maCenter.getX()) * mfFactor));
+ }
+
+ if(bUndo)
+ {
+ AddUndo(getSdrView().getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
- Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
- if( bUndo )
- AddUndo(getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pO,aSiz));
- pO->Move(aSiz);
+ sdr::legacy::transformSdrObject(*pO, basegfx::tools::createTranslateB2DHomMatrix(aCtr1 - aCtr0));
+ }
}
}
- bCopy=false;
+ bCopy = false;
}
- if (bDoCrook)
+ if(bDoCrook)
{
- getSdrDragView().CrookMarkedObj(aCenter,aRad,eMode,bVertical,!bContortion,bCopy);
- getSdrDragView().SetLastCrookCenter(aCenter);
+ getSdrView().CrookMarkedObj(maCenter, maRadius, meMode, mbVertical, !mbContortion, bCopy);
+ getSdrView().SetLastCrookCenter(maCenter);
}
- if (bResize && bUndo)
- getSdrDragView().EndUndo();
+ if(mbResize && bUndo)
+ {
+ getSdrView().EndUndo();
+ }
return true;
}
@@ -3510,41 +3389,42 @@ Pointer SdrDragCrook::GetSdrDragPointer() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragDistort,SdrDragMethod);
-
-SdrDragDistort::SdrDragDistort(SdrDragView& rNewView)
+SdrDragDistort::SdrDragDistort(SdrView& rNewView)
: SdrDragMethod(rNewView),
- nPolyPt(0),
- bContortionAllowed(false),
- bNoContortionAllowed(false),
- bContortion(false)
+ maMarkedRange(),
+ maDistortedRangePolygon(),
+ mnPointIndex(0),
+ mbContortionAllowed(false),
+ mbNoContortionAllowed(false),
+ mbContortion(false)
{
}
void SdrDragDistort::TakeSdrDragComment(XubString& rStr) const
{
- ImpTakeDescriptionStr(STR_DragMethDistort, rStr);
-
+ TakeMarkedDescriptionString(STR_DragMethDistort, rStr);
XubString aStr;
rStr.AppendAscii(" (x=");
- getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr);
+ getSdrView().getSdrModelFromSdrView().TakeMetricStr(DragStat().GetDX(), aStr);
rStr += aStr;
rStr.AppendAscii(" y=");
- getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr);
+ getSdrView().getSdrModelFromSdrView().TakeMetricStr(DragStat().GetDY(), aStr);
rStr += aStr;
rStr += sal_Unicode(')');
- if(getSdrDragView().IsDragWithCopy())
+ if(getSdrView().IsDragWithCopy())
+ {
rStr += ImpGetResStr(STR_EditWithCopy);
+ }
}
void SdrDragDistort::createSdrDragEntries()
{
// Add extended frame raster first, so it will be behind objects
- if(getSdrDragView().GetSdrPageView())
+ if(getSdrView().GetSdrPageView())
{
- const basegfx::B2DPolyPolygon aDragRaster(impCreateDragRaster(*getSdrDragView().GetSdrPageView(), GetMarkedRect()));
+ const basegfx::B2DPolyPolygon aDragRaster(impCreateDragRaster(*getSdrView().GetSdrPageView(), GetMarkedRange()));
if(aDragRaster.count())
{
@@ -3558,22 +3438,26 @@ void SdrDragDistort::createSdrDragEntries()
bool SdrDragDistort::BeginSdrDrag()
{
- bContortionAllowed=getSdrDragView().IsDistortAllowed(false);
- bNoContortionAllowed=getSdrDragView().IsDistortAllowed(true);
+ mbContortionAllowed = getSdrView().IsDistortAllowed(false);
+ mbNoContortionAllowed = getSdrView().IsDistortAllowed(true);
- if (bContortionAllowed || bNoContortionAllowed)
+ if(mbContortionAllowed || mbNoContortionAllowed)
{
- SdrHdlKind eKind=GetDragHdlKind();
- nPolyPt=0xFFFF;
+ SdrHdlKind eKind(GetDragHdlKind());
+ mnPointIndex = 4;
+
+ if(HDL_UPLFT == eKind) mnPointIndex = 0;
+ if(HDL_UPRGT == eKind) mnPointIndex = 1;
+ if(HDL_LWRGT == eKind) mnPointIndex = 2;
+ if(HDL_LWLFT == eKind) mnPointIndex = 3;
- if (eKind==HDL_UPLFT) nPolyPt=0;
- if (eKind==HDL_UPRGT) nPolyPt=1;
- if (eKind==HDL_LWRGT) nPolyPt=2;
- if (eKind==HDL_LWLFT) nPolyPt=3;
- if (nPolyPt>3) return false;
+ if(mnPointIndex > 3)
+ {
+ return false;
+ }
- aMarkRect=GetMarkedRect();
- aDistortedRect=XPolygon(aMarkRect);
+ maMarkedRange = GetMarkedRange();
+ maDistortedRangePolygon = basegfx::tools::createPolygonFromRect(maMarkedRange);
Show();
return true;
}
@@ -3585,44 +3469,39 @@ bool SdrDragDistort::BeginSdrDrag()
void SdrDragDistort::_MovAllPoints(basegfx::B2DPolyPolygon& rTarget)
{
- if (bContortion)
+ if(mbContortion)
{
- SdrPageView* pPV = getSdrDragView().GetSdrPageView();
-
- if(pPV)
+ if(maDistortedRangePolygon.count() > 3)
{
- if (pPV->HasMarkedObjPageView())
- {
- basegfx::B2DPolyPolygon aDragPolygon(rTarget);
- const basegfx::B2DRange aOriginalRange(aMarkRect.Left(), aMarkRect.Top(), aMarkRect.Right(), aMarkRect.Bottom());
- const basegfx::B2DPoint aTopLeft(aDistortedRect[0].X(), aDistortedRect[0].Y());
- const basegfx::B2DPoint aTopRight(aDistortedRect[1].X(), aDistortedRect[1].Y());
- const basegfx::B2DPoint aBottomLeft(aDistortedRect[3].X(), aDistortedRect[3].Y());
- const basegfx::B2DPoint aBottomRight(aDistortedRect[2].X(), aDistortedRect[2].Y());
-
- aDragPolygon = basegfx::tools::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight);
- rTarget = aDragPolygon;
- }
+ rTarget = basegfx::tools::distort(
+ rTarget,
+ maMarkedRange,
+ maDistortedRangePolygon.getB2DPoint(0), // TopLeft
+ maDistortedRangePolygon.getB2DPoint(1), // rTopRight
+ maDistortedRangePolygon.getB2DPoint(3), // rBottomLeft
+ maDistortedRangePolygon.getB2DPoint(2)); // rBottomRight
}
}
}
-void SdrDragDistort::MoveSdrDrag(const Point& rPnt)
+void SdrDragDistort::MoveSdrDrag(const basegfx::B2DPoint& rPnt)
{
- if (DragStat().CheckMinMoved(rPnt))
+ if(DragStat().CheckMinMoved(rPnt))
{
- Point aPnt(GetSnapPos(rPnt));
+ basegfx::B2DPoint aPnt(getSdrView().GetSnapPos(rPnt));
- if (getSdrDragView().IsOrtho())
- OrthoDistance8(DragStat().GetStart(),aPnt,getSdrDragView().IsBigOrtho());
+ if(getSdrView().IsOrthogonal())
+ {
+ aPnt = OrthoDistance8(DragStat().GetStart(), aPnt, getSdrView().IsBigOrthogonal());
+ }
- bool bNeuContortion=(bContortionAllowed && !getSdrDragView().IsCrookNoContortion()) || !bNoContortionAllowed;
+ bool bNeuContortion((mbContortionAllowed && !getSdrView().IsCrookNoContortion()) || !mbNoContortionAllowed);
- if (bNeuContortion!=bContortion || aDistortedRect[nPolyPt]!=aPnt)
+ if(bNeuContortion != mbContortion || !aPnt.equal(maDistortedRangePolygon.getB2DPoint(mnPointIndex)))
{
Hide();
- aDistortedRect[nPolyPt]=aPnt;
- bContortion=bNeuContortion;
+ maDistortedRangePolygon.setB2DPoint(mnPointIndex, aPnt);
+ mbContortion = bNeuContortion;
DragStat().NextMove(aPnt);
Show();
}
@@ -3632,11 +3511,13 @@ void SdrDragDistort::MoveSdrDrag(const Point& rPnt)
bool SdrDragDistort::EndSdrDrag(bool bCopy)
{
Hide();
- bool bDoDistort=DragStat().GetDX()!=0 || DragStat().GetDY()!=0;
+ const basegfx::B2DVector aDelta(DragStat().GetNow() - DragStat().GetPrev());
+ bool bDoDistort(!aDelta.equalZero());
- if (bDoDistort)
+ if(bDoDistort)
{
- getSdrDragView().DistortMarkedObj(aMarkRect,aDistortedRect,!bContortion,bCopy);
+ getSdrView().DistortMarkedObj(maMarkedRange, maDistortedRangePolygon, !mbContortion, bCopy);
+
return true;
}
@@ -3650,11 +3531,12 @@ Pointer SdrDragDistort::GetSdrDragPointer() const
void SdrDragDistort::applyCurrentTransformationToSdrObject(SdrObject& rTarget)
{
- const bool bDoDistort(DragStat().GetDX()!=0 || DragStat().GetDY()!=0);
+ const basegfx::B2DVector aDelta(DragStat().GetNow() - DragStat().GetPrev());
+ bool bDoDistort(!aDelta.equalZero());
- if (bDoDistort)
+ if(bDoDistort)
{
- getSdrDragView().ImpDistortObj(&rTarget, aMarkRect, aDistortedRect, !bContortion);
+ getSdrView().ImpDistortObj(rTarget, maMarkedRange, maDistortedRangePolygon, !mbContortion);
}
}
@@ -3666,9 +3548,7 @@ void SdrDragDistort::applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPol
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrDragCrop,SdrDragResize);
-
-SdrDragCrop::SdrDragCrop(SdrDragView& rNewView)
+SdrDragCrop::SdrDragCrop(SdrView& rNewView)
: SdrDragResize(rNewView)
{
// switch off solid dragging for crop; it just makes no sense since showing
@@ -3678,19 +3558,19 @@ SdrDragCrop::SdrDragCrop(SdrDragView& rNewView)
void SdrDragCrop::TakeSdrDragComment(XubString& rStr) const
{
- ImpTakeDescriptionStr(STR_DragMethCrop, rStr);
+ TakeMarkedDescriptionString(STR_DragMethCrop, rStr);
XubString aStr;
rStr.AppendAscii(" (x=");
- getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDX(), aStr);
+ getSdrView().getSdrModelFromSdrView().TakeMetricStr(DragStat().GetDX(), aStr);
rStr += aStr;
rStr.AppendAscii(" y=");
- getSdrDragView().GetModel()->TakeMetricStr(DragStat().GetDY(), aStr);
+ getSdrView().getSdrModelFromSdrView().TakeMetricStr(DragStat().GetDY(), aStr);
rStr += aStr;
rStr += sal_Unicode(')');
- if(getSdrDragView().IsDragWithCopy())
+ if(getSdrView().IsDragWithCopy())
rStr += ImpGetResStr(STR_EditWithCopy);
}
@@ -3701,12 +3581,7 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy)
if( DragStat().GetDX()==0 && DragStat().GetDY()==0 )
return false;
- const SdrMarkList& rMarkList = getSdrDragView().GetMarkedObjectList();
-
- if( rMarkList.GetMarkCount() != 1 )
- return false;
-
- SdrGrafObj* pObj = dynamic_cast<SdrGrafObj*>( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
+ SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >(getSdrView().getSelectedIfSingle());
if( !pObj || (pObj->GetGraphicType() == GRAPHIC_NONE) || (pObj->GetGraphicType() == GRAPHIC_DEFAULT) )
return false;
@@ -3725,30 +3600,33 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy)
const SdrGrafCropItem& rOldCrop = (const SdrGrafCropItem&)pObj->GetMergedItem(SDRATTR_GRAFCROP);
- const bool bUndo = getSdrDragView().IsUndoEnabled();
+ const bool bUndo = getSdrView().IsUndoEnabled();
if( bUndo )
{
String aUndoStr;
- ImpTakeDescriptionStr(STR_DragMethCrop, aUndoStr);
+ TakeMarkedDescriptionString(STR_DragMethCrop, aUndoStr);
- getSdrDragView().BegUndo( aUndoStr );
- getSdrDragView().AddUndo( getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
+ getSdrView().BegUndo( aUndoStr );
+ getSdrView().AddUndo( getSdrView().getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
}
- Rectangle aOldRect( pObj->GetLogicRect() );
- getSdrDragView().ResizeMarkedObj(DragStat().Ref1(),aXFact,aYFact,bCopy);
- Rectangle aNewRect( pObj->GetLogicRect() );
+ Rectangle aOldRect( sdr::legacy::GetLogicRect(*pObj) );
+ getSdrView().ResizeMarkedObj(DragStat().GetRef1(), maScale, bCopy);
+ Rectangle aNewRect( sdr::legacy::GetLogicRect(*pObj) );
double fScaleX = ( aGraphicSize.Width() - rOldCrop.GetLeft() - rOldCrop.GetRight() ) / (double)aOldRect.GetWidth();
double fScaleY = ( aGraphicSize.Height() - rOldCrop.GetTop() - rOldCrop.GetBottom() ) / (double)aOldRect.GetHeight();
+ // aw080: need to check here
// to correct the never working combination of cropped images and mirroring
// I have to correct the rectangles the calculation is based on here. In the current
// core geometry stuff a vertical mirror is expressed as 180 degree rotation. All
// this can be removed again when aw080 will have cleaned up the old
// (non-)transformation mess in the core.
- if(18000 == pObj->GetGeoStat().nDrehWink)
+ const long nOldRotAngle(sdr::legacy::GetRotateAngle(*pObj));
+
+ if(18000 == nOldRotAngle)
{
// old notation of vertical mirror, need to correct diffs since both rects
// are rotated by 180 degrees
@@ -3766,13 +3644,13 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy)
sal_Int32 nRightCrop = static_cast<sal_Int32>( rOldCrop.GetRight() - nDiffRight * fScaleX );
sal_Int32 nBottomCrop = static_cast<sal_Int32>( rOldCrop.GetBottom() - nDiffBottom * fScaleY );
- SfxItemPool& rPool = getSdrDragView().GetModel()->GetItemPool();
+ SfxItemPool& rPool = getSdrView().getSdrModelFromSdrView().GetItemPool();
SfxItemSet aSet( rPool, SDRATTR_GRAFCROP, SDRATTR_GRAFCROP );
aSet.Put( SdrGrafCropItem( nLeftCrop, nTopCrop, nRightCrop, nBottomCrop ) );
- getSdrDragView().SetAttributes( aSet, false );
+ getSdrView().SetAttributes( aSet, false );
if( bUndo )
- getSdrDragView().EndUndo();
+ getSdrView().EndUndo();
return true;
}
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index ff1bf0ed2da4..d1448924ec00 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -45,88 +45,51 @@
#include <svx/polypolygoneditor.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <svx/svdlegacy.hxx>
using namespace sdr;
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@@ @@@@ @@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@ @@ @@@@@ @@@@@@ @@ @@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@ @@ @@ @@ @@@@@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrDragView::ImpClearVars()
-{
- bFramDrag=sal_False;
- eDragMode=SDRDRAG_MOVE;
- bDragLimit=sal_False;
- bMarkedHitMovesAlways=sal_False;
- eDragHdl=HDL_MOVE;
- pDragHdl=NULL;
- bDragHdl=sal_False;
- bDragSpecial=sal_False;
- mpCurrentSdrDragMethod=NULL;
- bDragStripes=sal_False;
- bMirrRefDragObj=sal_True;
- bDragWithCopy=sal_False;
- pInsPointUndo=NULL;
- bInsGluePoint=sal_False;
- bInsObjPointMode=sal_False;
- bInsGluePointMode=sal_False;
- nDragXorPolyLimit=100;
- nDragXorPointLimit=500;
- bNoDragXorPolys=sal_False;
- bAutoVertexCon=sal_True;
- bAutoCornerCon=sal_False;
- bRubberEdgeDragging=sal_True;
- nRubberEdgeDraggingLimit=100;
- bDetailedEdgeDragging=sal_True;
- nDetailedEdgeDraggingLimit=10;
- bResizeAtCenter=sal_False;
- bCrookAtCenter=sal_False;
- bMouseHideWhileDraggingPoints=sal_False;
-
- // init using default
- mbSolidDragging = getOptionsDrawinglayer().IsSolidDragCreate();
-}
-void SdrDragView::ImpMakeDragAttr()
+SdrDragView::SdrDragView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrExchangeView(rModel1, pOut),
+ mpDragHdl(0),
+ mpCurrentSdrDragMethod(0),
+ mpInsPointUndo(0),
+ maDragLimit(),
+ maInsPointUndoStr(),
+ meDragHdl(HDL_MOVE),
+ mbFrameDrag(false),
+ mbDragSpecial(false),
+ mbMarkedHitMovesAlways(false),
+ mbDragLimit(false),
+ mbDragHdl(false),
+ mbDragStripes(false),
+ mbSolidDragging(getOptionsDrawinglayer().IsSolidDragCreate()),
+ mbResizeAtCenter(false),
+ mbCrookAtCenter(false),
+ mbDragWithCopy(false),
+ mbInsGluePoint(false),
+ mbInsObjPointMode(false),
+ mbInsGluePointMode(false),
+ mbNoDragXorPolys(false)
{
- ImpDelDragAttr();
-}
-
-SdrDragView::SdrDragView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrExchangeView(pModel1,pOut)
-{
- ImpClearVars();
- ImpMakeDragAttr();
}
SdrDragView::~SdrDragView()
{
- ImpDelDragAttr();
}
-void SdrDragView::ImpDelDragAttr()
+bool SdrDragView::IsAction() const
{
+ return (GetDragMethod() || SdrExchangeView::IsAction());
}
-sal_Bool SdrDragView::IsAction() const
-{
- return (mpCurrentSdrDragMethod || SdrExchangeView::IsAction());
-}
-
-void SdrDragView::MovAction(const Point& rPnt)
+void SdrDragView::MovAction(const basegfx::B2DPoint& rPnt)
{
SdrExchangeView::MovAction(rPnt);
- if (mpCurrentSdrDragMethod)
+
+ if(GetDragMethod())
{
MovDragObj(rPnt);
}
@@ -134,10 +97,11 @@ void SdrDragView::MovAction(const Point& rPnt)
void SdrDragView::EndAction()
{
- if (mpCurrentSdrDragMethod)
+ if (GetDragMethod())
{
- EndDragObj(sal_False);
+ EndDragObj(false);
}
+
SdrExchangeView::EndAction();
}
@@ -153,523 +117,618 @@ void SdrDragView::BrkAction()
BrkDragObj();
}
-void SdrDragView::TakeActionRect(Rectangle& rRect) const
+basegfx::B2DRange SdrDragView::TakeActionRange() const
{
- if (mpCurrentSdrDragMethod)
+ if(GetDragMethod())
{
- rRect=aDragStat.GetActionRect();
- if (rRect.IsEmpty())
- {
- SdrPageView* pPV = GetSdrPageView();
+ basegfx::B2DRange aRetval(GetDragStat().GetActionRange());
- if(pPV&& pPV->HasMarkedObjPageView())
- {
- // #i95646# is this used..?
- const basegfx::B2DRange aBoundRange(mpCurrentSdrDragMethod->getCurrentRange());
- rRect = Rectangle(
- basegfx::fround(aBoundRange.getMinX()), basegfx::fround(aBoundRange.getMinY()),
- basegfx::fround(aBoundRange.getMaxX()), basegfx::fround(aBoundRange.getMaxY()));
- }
+ if(aRetval.isEmpty())
+ {
+ // #i95646# is this used..?
+ aRetval = GetDragMethod()->getCurrentRange();
}
- if (rRect.IsEmpty())
+
+ if(aRetval.isEmpty())
{
- rRect=Rectangle(aDragStat.GetNow(),aDragStat.GetNow());
+ aRetval = basegfx::B2DRange(GetDragStat().GetNow(), GetDragStat().GetNow());
}
+
+ return aRetval;
}
else
{
- SdrExchangeView::TakeActionRect(rRect);
+ return SdrExchangeView::TakeActionRange();
}
}
-sal_Bool SdrDragView::TakeDragObjAnchorPos(Point& rPos, sal_Bool bTR ) const
+bool SdrDragView::TakeDragObjAnchorPos(basegfx::B2DPoint& rPos, bool bTR ) const
{
- Rectangle aR;
- TakeActionRect(aR);
- rPos = bTR ? aR.TopRight() : aR.TopLeft();
- if (GetMarkedObjectCount()==1 && IsDragObj() && // nur bei Einzelselektion
- !IsDraggingPoints() && !IsDraggingGluePoints() && // nicht beim Punkteschieben
- !mpCurrentSdrDragMethod->ISA(SdrDragMovHdl)) // nicht beim Handlesschieben
+ const basegfx::B2DRange aActionRange(TakeActionRange());
+ const basegfx::B2DPoint aTopLeft(bTR ? aActionRange.getMaxX() : aActionRange.getMinX(), aActionRange.getMinY());
+ SdrObject* pSelected = getSelectedIfSingle();
+
+ rPos = aTopLeft;
+
+ if(pSelected
+ && IsDragObj()
+ && !IsDraggingPoints()
+ && !IsDraggingGluePoints())
{
- SdrObject* pObj=GetMarkedObjectByIndex(0);
- if (pObj->ISA(SdrCaptionObj))
+ if(!dynamic_cast< SdrDragMovHdl* >(GetDragMethod()))
{
- Point aPt(((SdrCaptionObj*)pObj)->GetTailPos());
- sal_Bool bTail=eDragHdl==HDL_POLY; // Schwanz wird gedraggt (nicht so ganz feine Abfrage hier)
- sal_Bool bOwn=mpCurrentSdrDragMethod->ISA(SdrDragObjOwn); // Objektspeziefisch
- if (!bTail)
- { // bei bTail liefert TakeActionRect schon das richtige
- if (bOwn)
- { // bOwn kann sein MoveTextFrame, ResizeTextFrame aber eben nicht mehr DragTail
- rPos=aPt;
- }
- else
+ const SdrCaptionObj* pCaptionObj = dynamic_cast< const SdrCaptionObj* >(pSelected);
+
+ if(pCaptionObj)
+ {
+ basegfx::B2DPoint aPt(pCaptionObj->GetTailPos());
+
+ if(!HDL_POLY == GetDragHdlKind())
{
- // drag the whole Object (Move, Resize, ...)
- const basegfx::B2DPoint aTransformed(mpCurrentSdrDragMethod->getCurrentTransformation() * basegfx::B2DPoint(aPt.X(), aPt.Y()));
- rPos.X() = basegfx::fround(aTransformed.getX());
- rPos.Y() = basegfx::fround(aTransformed.getY());
+ if(dynamic_cast< SdrDragObjOwn* >(GetDragMethod()))
+ {
+ rPos=aPt;
+ }
+ else
+ {
+ // drag the whole Object (Move, Resize, ...)
+ rPos = GetDragMethod()->getCurrentTransformation() * aPt;
+ }
}
}
+
+ return true;
}
- return sal_True;
}
- return sal_False;
+
+ return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrDragView::TakeDragLimit(SdrDragMode /*eMode*/, Rectangle& /*rRect*/) const
+bool SdrDragView::TakeDragLimit(SdrDragMode /*eMode*/, basegfx::B2DRange& /*rRange*/) const
{
- return sal_False;
+ return false;
}
-sal_Bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl, short nMinMov, SdrDragMethod* pForcedMeth)
+bool SdrDragView::BegDragObj(const basegfx::B2DPoint& rPnt, const SdrHdl* pHdl, double fMinMovLogic, SdrDragMethod* pForcedMeth)
{
+ bool bRetval(false);
+
BrkAction();
+ SetDragWithCopy(false);
+ mpCurrentSdrDragMethod = 0;
+ mbDragSpecial = false;
+ mbDragLimit = false;
+ SdrDragMode eTmpMode(GetDragMode());
- bool bRet=false;
+ if(SDRDRAG_MOVE == eTmpMode && pHdl && HDL_MOVE != pHdl->GetKind())
{
- SetDragWithCopy(sal_False);
- //ForceEdgesOfMarkedNodes();
- //TODO: aAni.Reset();
- mpCurrentSdrDragMethod=NULL;
- bDragSpecial=sal_False;
- bDragLimit=sal_False;
- SdrDragMode eTmpMode=eDragMode;
- if (eTmpMode==SDRDRAG_MOVE && pHdl!=NULL && pHdl->GetKind()!=HDL_MOVE) {
eTmpMode=SDRDRAG_RESIZE;
- }
- bDragLimit=TakeDragLimit(eTmpMode,aDragLimit);
- bFramDrag=ImpIsFrameHandles();
- if (!bFramDrag &&
- (pMarkedObj==NULL || !pMarkedObj->hasSpecialDrag()) &&
- (pHdl==NULL || pHdl->GetObj()==NULL)) {
- bFramDrag=sal_True;
- }
+ }
- Point aPnt(rPnt);
- if(pHdl == NULL
- || pHdl->GetKind() == HDL_MOVE
- || pHdl->GetKind() == HDL_MIRX
- || pHdl->GetKind() == HDL_TRNS
- || pHdl->GetKind() == HDL_GRAD)
- {
- aDragStat.Reset(aPnt);
- }
- else
+ mbDragLimit = TakeDragLimit(eTmpMode, maDragLimit);
+ mbFrameDrag =ImpIsFrameHandles();
+
+ if(!mbFrameDrag)
+ {
+ const SdrObject* pMarkedObject = getSelectedIfSingle();
+
+ if((!pMarkedObject || !pMarkedObject->hasSpecialDrag())
+ && (!pHdl || !pHdl->GetObj()))
{
- aDragStat.Reset(pHdl->GetPos());
+ mbFrameDrag = true;
}
+ }
- aDragStat.SetView((SdrView*)this);
- aDragStat.SetPageView(pMarkedPV); // <<-- hier muss die DragPV rein!!!
- aDragStat.SetMinMove(ImpGetMinMovLogic(nMinMov,pOut));
- aDragStat.SetHdl(pHdl);
- aDragStat.NextPoint();
- pDragWin=pOut;
- pDragHdl=pHdl;
- eDragHdl= pHdl==NULL ? HDL_MOVE : pHdl->GetKind();
- bDragHdl=eDragHdl==HDL_REF1 || eDragHdl==HDL_REF2 || eDragHdl==HDL_MIRX;
+ const basegfx::B2DPoint aPnt(rPnt);
- // #103894# Expand test for HDL_ANCHOR_TR
- sal_Bool bNotDraggable = (HDL_ANCHOR == eDragHdl || HDL_ANCHOR_TR == eDragHdl);
+ if(!pHdl
+ || HDL_MOVE == pHdl->GetKind()
+ || HDL_MIRX == pHdl->GetKind()
+ || HDL_TRNS == pHdl->GetKind()
+ || HDL_GRAD == pHdl->GetKind())
+ {
+ GetDragStat().Reset(aPnt);
+ }
+ else
+ {
+ GetDragStat().Reset(pHdl->getPosition());
+ }
- if(pHdl && (pHdl->GetKind() == HDL_SMARTTAG) && pForcedMeth )
- {
- // just use the forced method for smart tags
- }
- else if(bDragHdl)
- {
- mpCurrentSdrDragMethod = new SdrDragMovHdl(*this);
- }
- else if(!bNotDraggable)
+ GetDragStat().SetMinMove(fMinMovLogic);
+ GetDragStat().SetActiveHdl(const_cast< SdrHdl* >(pHdl));
+ GetDragStat().NextPoint();
+
+ mpDragHdl = const_cast< SdrHdl* >(pHdl);
+ meDragHdl = pHdl ? pHdl->GetKind() : HDL_MOVE;
+ mbDragHdl = (HDL_REF1 == GetDragHdlKind() || HDL_REF2 == GetDragHdlKind() || HDL_MIRX == GetDragHdlKind());
+
+ // #103894# Expand test for HDL_ANCHOR_TR
+ const bool bNotDraggable = (HDL_ANCHOR == GetDragHdlKind() || HDL_ANCHOR_TR == GetDragHdlKind());
+ SdrView* pSdrView = static_cast< SdrView* >(this);
+
+ if(pHdl && (HDL_SMARTTAG == pHdl->GetKind()) && pForcedMeth)
+ {
+ // just use the forced method for smart tags
+ }
+ else if(mbDragHdl)
+ {
+ mpCurrentSdrDragMethod = new SdrDragMovHdl(*pSdrView);
+ }
+ else if(!bNotDraggable)
+ {
+ switch(GetDragMode())
{
- switch (eDragMode)
+ case SDRDRAG_ROTATE:
+ case SDRDRAG_SHEAR:
+ case SDRDRAG_DISTORT:
{
- case SDRDRAG_ROTATE: case SDRDRAG_SHEAR: case SDRDRAG_DISTORT:
+ switch(GetDragHdlKind())
{
- switch (eDragHdl)
+ case HDL_LEFT:
+ case HDL_RIGHT:
+ case HDL_UPPER:
+ case HDL_LOWER:
{
- case HDL_LEFT: case HDL_RIGHT:
- case HDL_UPPER: case HDL_LOWER:
+ // Sind 3D-Objekte selektiert?
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ bool b3DObjSelected(false);
+
+ for(sal_uInt32 a(0); !b3DObjSelected && a < aSelection.size(); a++)
{
- // Sind 3D-Objekte selektiert?
- sal_Bool b3DObjSelected = sal_False;
- for(sal_uInt32 a=0;!b3DObjSelected && a<GetMarkedObjectCount();a++)
+ if(dynamic_cast< E3dObject* >(aSelection[a]))
{
- SdrObject* pObj = GetMarkedObjectByIndex(a);
- if(pObj && pObj->ISA(E3dObject))
- b3DObjSelected = sal_True;
+ b3DObjSelected = true;
}
- // Falls ja, Shear auch bei !IsShearAllowed zulassen,
- // da es sich bei 3D-Objekten um eingeschraenkte
- // Rotationen handelt
- if (!b3DObjSelected && !IsShearAllowed())
- return sal_False;
- mpCurrentSdrDragMethod = new SdrDragShear(*this,eDragMode==SDRDRAG_ROTATE);
- } break;
- case HDL_UPLFT: case HDL_UPRGT:
- case HDL_LWLFT: case HDL_LWRGT:
+ }
+
+ // Falls ja, Shear auch bei !IsShearAllowed zulassen,
+ // da es sich bei 3D-Objekten um eingeschraenkte
+ // Rotationen handelt
+ if (!b3DObjSelected && !IsShearAllowed())
{
- if (eDragMode==SDRDRAG_SHEAR || eDragMode==SDRDRAG_DISTORT)
+ return false;
+ }
+
+ mpCurrentSdrDragMethod = new SdrDragShear(*pSdrView);
+ break;
+ }
+
+ case HDL_UPLFT:
+ case HDL_UPRGT:
+ case HDL_LWLFT:
+ case HDL_LWRGT:
+ {
+ if(SDRDRAG_SHEAR == GetDragMode() || SDRDRAG_DISTORT == GetDragMode())
+ {
+ if(!IsDistortAllowed(true) && !IsDistortAllowed(false))
{
- if (!IsDistortAllowed(sal_True) && !IsDistortAllowed(sal_False)) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragDistort(*this);
+ return false;
}
- else
+
+ mpCurrentSdrDragMethod = new SdrDragDistort(*pSdrView);
+ }
+ else
+ {
+ if(!IsRotateAllowed(true))
{
- if (!IsRotateAllowed(sal_True)) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragRotate(*this);
+ return false;
}
- } break;
- default:
+
+ mpCurrentSdrDragMethod = new SdrDragRotate(*pSdrView);
+ }
+ break;
+ }
+
+ default:
+ {
+ if(IsMarkedHitMovesAlways() && HDL_MOVE == GetDragHdlKind())
{
- if (IsMarkedHitMovesAlways() && eDragHdl==HDL_MOVE)
- { // HDL_MOVE ist auch wenn Obj direkt getroffen
- if (!IsMoveAllowed()) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
+ // HDL_MOVE ist auch wenn Obj direkt getroffen
+ if(!IsMoveAllowed())
+ {
+ return false;
}
- else
+
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ }
+ else
+ {
+ if(!IsRotateAllowed(true))
{
- if (!IsRotateAllowed(sal_True)) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragRotate(*this);
+ return false;
}
+
+ mpCurrentSdrDragMethod = new SdrDragRotate(*pSdrView);
}
}
- } break;
- case SDRDRAG_MIRROR:
+ }
+ break;
+ }
+
+ case SDRDRAG_MIRROR:
+ {
+ if(HDL_MOVE == GetDragHdlKind() && IsMarkedHitMovesAlways())
{
- if (eDragHdl==HDL_MOVE && IsMarkedHitMovesAlways())
+ if(!IsMoveAllowed())
{
- if (!IsMoveAllowed()) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
+ return false;
}
- else
+
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ }
+ else
+ {
+ if(!IsMirrorAllowed(true, true))
{
- if (!IsMirrorAllowed(sal_True,sal_True)) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragMirror(*this);
+ return false;
}
- } break;
- case SDRDRAG_CROP:
+ mpCurrentSdrDragMethod = new SdrDragMirror(*pSdrView);
+ }
+ break;
+ }
+
+ case SDRDRAG_CROP:
+ {
+ if(HDL_MOVE == GetDragHdlKind() && IsMarkedHitMovesAlways())
{
- if (eDragHdl==HDL_MOVE && IsMarkedHitMovesAlways())
+ if (!IsMoveAllowed())
{
- if (!IsMoveAllowed())
- return sal_False;
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
+ return false;
}
- else
+
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ }
+ else
+ {
+ if(!IsCrookAllowed(true) && !IsCrookAllowed(false))
{
- if (!IsCrookAllowed(sal_True) && !IsCrookAllowed(sal_False))
- return sal_False;
- mpCurrentSdrDragMethod = new SdrDragCrop(*this);
+ return false;
}
+
+ mpCurrentSdrDragMethod = new SdrDragCrop(*pSdrView);
}
break;
+ }
- case SDRDRAG_TRANSPARENCE:
+ case SDRDRAG_TRANSPARENCE:
+ {
+ if(HDL_MOVE == GetDragHdlKind() && IsMarkedHitMovesAlways())
{
- if(eDragHdl == HDL_MOVE && IsMarkedHitMovesAlways())
+ if(!IsMoveAllowed())
{
- if(!IsMoveAllowed())
- return sal_False;
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
+ return false;
}
- else
- {
- if(!IsTransparenceAllowed())
- return sal_False;
- mpCurrentSdrDragMethod = new SdrDragGradient(*this, sal_False);
- }
- break;
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
}
- case SDRDRAG_GRADIENT:
+ else
{
- if(eDragHdl == HDL_MOVE && IsMarkedHitMovesAlways())
- {
- if(!IsMoveAllowed())
- return sal_False;
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
- }
- else
- {
- if(!IsGradientAllowed())
- return sal_False;
+ if(!IsTransparenceAllowed())
+ {
+ return false;
+ }
- mpCurrentSdrDragMethod = new SdrDragGradient(*this);
- }
- break;
+ mpCurrentSdrDragMethod = new SdrDragGradient(*pSdrView, false);
}
+ break;
+ }
- case SDRDRAG_CROOK :
+ case SDRDRAG_GRADIENT:
+ {
+ if(HDL_MOVE == GetDragHdlKind() && IsMarkedHitMovesAlways())
{
- if (eDragHdl==HDL_MOVE && IsMarkedHitMovesAlways())
+ if(!IsMoveAllowed())
{
- if (!IsMoveAllowed()) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
+ return false;
}
- else
+
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ }
+ else
+ {
+ if(!IsGradientAllowed())
{
- if (!IsCrookAllowed(sal_True) && !IsCrookAllowed(sal_False)) return sal_False;
- mpCurrentSdrDragMethod = new SdrDragCrook(*this);
+ return false;
}
- } break;
- default:
+ mpCurrentSdrDragMethod = new SdrDragGradient(*pSdrView);
+ }
+ break;
+ }
+
+ case SDRDRAG_CROOK :
+ {
+ if(HDL_MOVE == GetDragHdlKind() && IsMarkedHitMovesAlways())
{
- // SDRDRAG_MOVE
- if((eDragHdl == HDL_MOVE) && !IsMoveAllowed())
+ if(!IsMoveAllowed())
{
- return sal_False;
+ return false;
}
- else if(eDragHdl == HDL_GLUE)
+
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ }
+ else
+ {
+ if(!IsCrookAllowed(true) && !IsCrookAllowed(false))
{
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
+ return false;
}
- else
+
+ mpCurrentSdrDragMethod = new SdrDragCrook(*pSdrView);
+ }
+ break;
+ }
+
+ default:
+ {
+ // SDRDRAG_MOVE
+ if((HDL_MOVE == GetDragHdlKind()) && !IsMoveAllowed())
+ {
+ return false;
+ }
+ else if(HDL_GLUE == GetDragHdlKind())
+ {
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ }
+ else
+ {
+ if(mbFrameDrag)
{
- if(bFramDrag)
+ if(HDL_MOVE == GetDragHdlKind())
{
- if(eDragHdl == HDL_MOVE)
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ }
+ else
+ {
+ if(!IsResizeAllowed(true))
{
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
+ return false;
}
- else
+
+ bool bSingleTextObjMark(false); // SJ: #i100490#
+ const SdrObject* pMarkedObject = getSelectedIfSingle();
+
+ if(pMarkedObject)
{
- if(!IsResizeAllowed(sal_True))
- {
- return sal_False;
- }
+ const SdrTextObj* pMarkedText = dynamic_cast< const SdrTextObj* >(pMarkedObject);
- sal_Bool bSingleTextObjMark = sal_False; // SJ: #i100490#
- if ( GetMarkedObjectCount() == 1 )
+ if(pMarkedText && pMarkedText->IsTextFrame())
{
- pMarkedObj=GetMarkedObjectByIndex(0);
- if ( pMarkedObj &&
- pMarkedObj->ISA( SdrTextObj ) &&
- static_cast<SdrTextObj*>(pMarkedObj)->IsTextFrame() )
- bSingleTextObjMark = sal_True;
+ bSingleTextObjMark = true;
}
- if ( bSingleTextObjMark )
- mpCurrentSdrDragMethod = new SdrDragObjOwn(*this);
- else
- mpCurrentSdrDragMethod = new SdrDragResize(*this);
}
- }
- else
- {
- if(HDL_MOVE == eDragHdl)
- {
- const bool bCustomShapeSelected(1 == GetMarkedObjectCount() && GetMarkedObjectByIndex(0)->ISA(SdrObjCustomShape));
- if(bCustomShapeSelected)
- {
- mpCurrentSdrDragMethod = new SdrDragMove( *this );
- }
+ if ( bSingleTextObjMark )
+ {
+ mpCurrentSdrDragMethod = new SdrDragObjOwn(*pSdrView);
}
- else if(HDL_POLY == eDragHdl)
+ else
{
- const bool bConnectorSelected(1 == GetMarkedObjectCount() && GetMarkedObjectByIndex(0)->ISA(SdrEdgeObj));
+ mpCurrentSdrDragMethod = new SdrDragResize(*pSdrView);
+ }
+ }
+ }
+ else
+ {
+ if(HDL_MOVE == GetDragHdlKind())
+ {
+ const SdrObject* pMarkedObject = getSelectedIfSingle();
+ const bool bCustomShapeSelected(dynamic_cast< const SdrObjCustomShape* >(pMarkedObject));
- if(bConnectorSelected)
- {
- // #i97784#
- // fallback to old behaviour for connectors (see
- // text in task description for more details)
- }
- else if(!IsMoveAllowed() || !IsResizeAllowed())
- {
- // #i77187#
- // do not allow move of polygon points if object is move or size protected
- return sal_False;
- }
+ if(bCustomShapeSelected)
+ {
+ mpCurrentSdrDragMethod = new SdrDragMove( *pSdrView );
}
+ }
+ else if(HDL_POLY == GetDragHdlKind())
+ {
+ const SdrObject* pMarkedObject = getSelectedIfSingle();
+ const bool bConnectorSelected(pMarkedObject && pMarkedObject->IsSdrEdgeObj());
- if(!mpCurrentSdrDragMethod)
+ if(bConnectorSelected)
+ {
+ // #i97784#
+ // fallback to old behaviour for connectors (see
+ // text in task description for more details)
+ }
+ else if(!IsMoveAllowed() || !IsResizeAllowed())
{
- // fallback to DragSpecial if no interaction defined
- bDragSpecial = sal_True;
- mpCurrentSdrDragMethod = new SdrDragObjOwn(*this);
+ // #i77187#
+ // do not allow move of polygon points if object is move or size protected
+ return false;
}
}
+
+ if(!GetDragMethod())
+ {
+ // fallback to DragSpecial if no interaction defined
+ mbDragSpecial = true;
+ mpCurrentSdrDragMethod = new SdrDragObjOwn(*pSdrView);
+ }
}
}
}
}
- if (pForcedMeth!=NULL)
- {
- delete mpCurrentSdrDragMethod;
- mpCurrentSdrDragMethod = pForcedMeth;
- }
- aDragStat.SetDragMethod(mpCurrentSdrDragMethod);
- if (mpCurrentSdrDragMethod)
- {
- bRet = mpCurrentSdrDragMethod->BeginSdrDrag();
- if (!bRet)
- {
- if (pHdl==NULL && IS_TYPE(SdrDragObjOwn,mpCurrentSdrDragMethod))
- {
- // Aha, Obj kann nicht Move SpecialDrag, also MoveFrameDrag versuchen
- delete mpCurrentSdrDragMethod;
- mpCurrentSdrDragMethod = 0;
- bDragSpecial=sal_False;
+ }
- if (!IsMoveAllowed())
- return sal_False;
+ if(pForcedMeth)
+ {
+ delete mpCurrentSdrDragMethod;
- bFramDrag=sal_True;
- mpCurrentSdrDragMethod = new SdrDragMove(*this);
- aDragStat.SetDragMethod(mpCurrentSdrDragMethod);
- bRet = mpCurrentSdrDragMethod->BeginSdrDrag();
- }
- }
- if (!bRet)
+ mpCurrentSdrDragMethod = pForcedMeth;
+ }
+
+ GetDragStat().SetDragMethod(GetDragMethod());
+
+ if(GetDragMethod())
+ {
+ bRetval = GetDragMethod()->BeginSdrDrag();
+
+ if(!bRetval)
+ {
+ if(!pHdl && dynamic_cast< SdrDragObjOwn* >(GetDragMethod()))
{
+ // Aha, Obj kann nicht Move SpecialDrag, also MoveFrameDrag versuchen
delete mpCurrentSdrDragMethod;
mpCurrentSdrDragMethod = 0;
- aDragStat.SetDragMethod(mpCurrentSdrDragMethod);
+ mbDragSpecial = false;
+
+ if (!IsMoveAllowed())
+ {
+ return false;
+ }
+
+ mbFrameDrag = true;
+ mpCurrentSdrDragMethod = new SdrDragMove(*pSdrView);
+ GetDragStat().SetDragMethod(GetDragMethod());
+ bRetval = GetDragMethod()->BeginSdrDrag();
}
}
+
+ if(!bRetval)
+ {
+ delete mpCurrentSdrDragMethod;
+ mpCurrentSdrDragMethod = 0;
+ GetDragStat().SetDragMethod(0);
+ }
}
- return bRet;
+ return bRetval;
}
-void SdrDragView::MovDragObj(const Point& rPnt)
+void SdrDragView::MovDragObj(const basegfx::B2DPoint& rPnt)
{
- if (mpCurrentSdrDragMethod)
+ if (GetDragMethod())
{
- Point aPnt(rPnt);
- ImpLimitToWorkArea(aPnt);
- mpCurrentSdrDragMethod->MoveSdrDrag(aPnt); // this call already makes a Hide()/Show combination
+ const basegfx::B2DPoint aPnt(ImpLimitToWorkArea(rPnt));
+
+ GetDragMethod()->MoveSdrDrag(aPnt);
}
}
-sal_Bool SdrDragView::EndDragObj(sal_Bool bCopy)
+bool SdrDragView::EndDragObj(bool bCopy)
{
- bool bRet(false);
+ bool bRetval(false);
// #i73341# If insert GluePoint, do not insist on last points being different
- if(mpCurrentSdrDragMethod && aDragStat.IsMinMoved() && (IsInsertGluePoint() || aDragStat.GetNow() != aDragStat.GetPrev()))
+ if(GetDragMethod() && GetDragStat().IsMinMoved() && (IsInsertGluePoint() || GetDragStat().GetNow() != GetDragStat().GetPrev()))
{
- sal_uIntPtr nHdlAnzMerk=0;
+ sal_uInt32 nHdlAnzMerk(0);
- if (bEliminatePolyPoints)
- { // IBM Special
+ if(IsEliminatePolyPoints())
+ {
+ // IBM Special
nHdlAnzMerk=GetMarkablePointCount();
}
const bool bUndo = IsUndoEnabled();
+
if (IsInsertGluePoint() && bUndo)
{
- BegUndo(aInsPointUndoStr);
- AddUndo(pInsPointUndo);
+ BegUndo(maInsPointUndoStr);
+ AddUndo(mpInsPointUndo);
}
- bRet = mpCurrentSdrDragMethod->EndSdrDrag(bCopy);
+ bRetval = GetDragMethod()->EndSdrDrag(bCopy);
if( IsInsertGluePoint() && bUndo)
+ {
EndUndo();
+ }
delete mpCurrentSdrDragMethod;
mpCurrentSdrDragMethod = 0;
- if (bEliminatePolyPoints)
- { // IBM Special
+ if(IsEliminatePolyPoints())
+ {
+ // IBM Special
if (nHdlAnzMerk!=GetMarkablePointCount())
{
- UnmarkAllPoints();
+ MarkPoints(0, true); // unmarkall
}
}
- if (bInsPolyPoint)
+ if(mbInsPolyPoint)
{
SetMarkHandles();
- bInsPolyPoint=sal_False;
+ mbInsPolyPoint = false;
+
if( bUndo )
{
- BegUndo(aInsPointUndoStr);
- AddUndo(pInsPointUndo);
+ BegUndo(maInsPointUndoStr);
+ AddUndo(mpInsPointUndo);
EndUndo();
}
}
- eDragHdl=HDL_MOVE;
- pDragHdl=NULL;
-
- if (!bSomeObjChgdFlag)
- {
- // Aha, Obj hat nicht gebroadcastet (z.B. Writer FlyFrames)
- if(!bDragHdl)
- {
- AdjustMarkHdl();
- }
- }
+ meDragHdl = HDL_MOVE;
+ mpDragHdl = 0;
}
else
{
BrkDragObj();
}
- bInsPolyPoint=sal_False;
- SetInsertGluePoint(sal_False);
+ mbInsPolyPoint = false;
+ SetInsertGluePoint(false);
- return bRet;
+ return bRetval;
}
void SdrDragView::BrkDragObj()
{
- if (mpCurrentSdrDragMethod)
+ if(GetDragMethod())
{
- mpCurrentSdrDragMethod->CancelSdrDrag();
-
+ GetDragMethod()->CancelSdrDrag();
delete mpCurrentSdrDragMethod;
mpCurrentSdrDragMethod = 0;
- if (bInsPolyPoint)
+ if(mbInsPolyPoint)
{
- pInsPointUndo->Undo(); // Den eingefuegten Punkt wieder raus
- delete pInsPointUndo;
- pInsPointUndo=NULL;
+ mpInsPointUndo->Undo(); // Den eingefuegten Punkt wieder raus
+ delete mpInsPointUndo;
+ mpInsPointUndo = 0;
SetMarkHandles();
- bInsPolyPoint=sal_False;
+ mbInsPolyPoint = false;
}
if (IsInsertGluePoint())
{
- pInsPointUndo->Undo(); // Den eingefuegten Klebepunkt wieder raus
- delete pInsPointUndo;
- pInsPointUndo=NULL;
- SetInsertGluePoint(sal_False);
+ mpInsPointUndo->Undo(); // Den eingefuegten Klebepunkt wieder raus
+ delete mpInsPointUndo;
+ mpInsPointUndo = 0;
+ SetInsertGluePoint(false);
}
- eDragHdl=HDL_MOVE;
- pDragHdl=NULL;
+ meDragHdl = HDL_MOVE;
+ mpDragHdl = 0;
}
}
-sal_Bool SdrDragView::IsInsObjPointPossible() const
+bool SdrDragView::IsInsObjPointPossible() const
{
- return pMarkedObj!=NULL && pMarkedObj->IsPolyObj();
+ const SdrObject* pMarkedObject = getSelectedIfSingle();
+
+ return pMarkedObject && pMarkedObject->IsPolygonObject();
}
-sal_Bool SdrDragView::ImpBegInsObjPoint(sal_Bool bIdxZwang, sal_uInt32 nIdx, const Point& rPnt, sal_Bool bNewObj, OutputDevice* pOut)
+bool SdrDragView::ImpBegInsObjPoint(bool bIdxZwang, sal_uInt32 /*nIdx*/, const basegfx::B2DPoint& rPnt, bool bNewObj)
{
- sal_Bool bRet(sal_False);
+ bool bRetval(false);
+ SdrPathObj* pMarkedPath = dynamic_cast< SdrPathObj* >(getSelectedIfSingle());
- if(pMarkedObj && pMarkedObj->ISA(SdrPathObj))
+ if(pMarkedPath)
{
- SdrPathObj* pMarkedPath = (SdrPathObj*)pMarkedObj;
BrkAction();
- pInsPointUndo = dynamic_cast< SdrUndoGeoObj* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pMarkedObj) );
- DBG_ASSERT( pInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
+ mpInsPointUndo = dynamic_cast< SdrUndoGeoObj* >( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pMarkedPath) );
+ DBG_ASSERT( mpInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
XubString aStr(ImpGetResStr(STR_DragInsertPoint));
XubString aName;
- pMarkedObj->TakeObjNameSingul(aName);
+ pMarkedPath->TakeObjNameSingul(aName);
xub_StrLen nPos(aStr.SearchAscii("%1"));
if(STRING_NOTFOUND != nPos)
@@ -678,139 +737,153 @@ sal_Bool SdrDragView::ImpBegInsObjPoint(sal_Bool bIdxZwang, sal_uInt32 nIdx, con
aStr.Insert(aName, nPos);
}
- aInsPointUndoStr = aStr;
- Point aPt(rPnt);
+ maInsPointUndoStr = aStr;
+ basegfx::B2DPoint aPt(rPnt);
if(bNewObj)
- aPt = GetSnapPos(aPt,pMarkedPV);
+ {
+ aPt = GetSnapPos(aPt);
+ }
- sal_Bool bClosed0(pMarkedPath->IsClosedObj());
+ bool bClosed0(pMarkedPath->IsClosedObj());
if(bIdxZwang)
{
- mnInsPointNum = pMarkedPath->NbcInsPoint(nIdx, aPt, bNewObj, sal_True);
+ const Point aOldPoint(basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY()));
+ mnInsPointNum = pMarkedPath->InsPoint(aOldPoint, bNewObj);
}
else
{
- mnInsPointNum = pMarkedPath->NbcInsPointOld(aPt, bNewObj, sal_True);
+ const Point aOldPoint(basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY()));
+ mnInsPointNum = pMarkedPath->InsPointOld(aOldPoint, bNewObj);
}
if(bClosed0 != pMarkedPath->IsClosedObj())
{
- // Obj was closed implicit
- // object changed
+ // Obj was closed implicit, object changed
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pMarkedPath);
pMarkedPath->SetChanged();
- pMarkedPath->BroadcastObjectChange();
}
if(0xffffffff != mnInsPointNum)
{
- bInsPolyPoint = sal_True;
- UnmarkAllPoints();
- AdjustMarkHdl();
+ mbInsPolyPoint = true;
+ MarkPoints(0, true); // unmarkall
+ SetMarkHandles();
- bRet = BegDragObj(rPnt, pOut, aHdl.GetHdl(mnInsPointNum), 0);
+ bRetval = BegDragObj(rPnt, maViewHandleList.GetHdlByIndex(mnInsPointNum), 0.0);
- if (bRet)
+ if (bRetval)
{
- aDragStat.SetMinMoved();
+ GetDragStat().SetMinMoved();
MovDragObj(rPnt);
}
}
else
{
- delete pInsPointUndo;
- pInsPointUndo = NULL;
+ delete mpInsPointUndo;
+ mpInsPointUndo = 0;
}
}
- return bRet;
+ return bRetval;
}
-sal_Bool SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd)
+bool SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd)
{
if(IsInsObjPoint())
{
sal_uInt32 nNextPnt(mnInsPointNum);
- Point aPnt(aDragStat.GetNow());
- sal_Bool bOk=EndDragObj(sal_False);
- if (bOk==sal_True && eCmd!=SDRCREATE_FORCEEND)
+ basegfx::B2DPoint aPnt(GetDragStat().GetNow());
+ bool bOk(EndDragObj(false));
+
+ if(bOk && SDRCREATE_FORCEEND != eCmd)
{
// Ret=True bedeutet: Action ist vorbei.
- bOk=!(ImpBegInsObjPoint(sal_True, nNextPnt, aPnt, eCmd == SDRCREATE_NEXTOBJECT, pDragWin));
+ bOk = !ImpBegInsObjPoint(true, nNextPnt, aPnt, eCmd == SDRCREATE_NEXTOBJECT);
}
return bOk;
- } else return sal_False;
+ }
+ else
+ {
+ return false;
+ }
}
-sal_Bool SdrDragView::IsInsGluePointPossible() const
+bool SdrDragView::IsInsGluePointPossible() const
{
- sal_Bool bRet=sal_False;
- if (IsInsGluePointMode() && AreObjectsMarked())
+ bool bRetval(false);
+
+ if(IsInsGluePointMode() && areSdrObjectsSelected())
{
- if (GetMarkedObjectCount()==1)
+ const SdrObject* pMarkedObject = getSelectedIfSingle();
+
+ if(pMarkedObject)
{
- // sal_False liefern, wenn 1 Objekt und dieses ein Verbinder ist.
- const SdrObject* pObj=GetMarkedObjectByIndex(0);
- if (!HAS_BASE(SdrEdgeObj,pObj))
+ if(!pMarkedObject->IsSdrEdgeObj())
{
- bRet=sal_True;
+ bRetval = true;
}
}
else
{
- bRet=sal_True;
+ bRetval = true;
}
}
- return bRet;
+
+ return bRetval;
}
-sal_Bool SdrDragView::BegInsGluePoint(const Point& rPnt)
+bool SdrDragView::BegInsGluePoint(const basegfx::B2DPoint& rPnt)
{
- sal_Bool bRet=sal_False;
- SdrObject* pObj;
- SdrPageView* pPV;
- sal_uIntPtr nMarkNum;
- if (PickMarkedObj(rPnt,pObj,pPV,&nMarkNum,SDRSEARCH_PASS2BOUND))
+ bool bRetval(false);
+ SdrObject* pObj = 0;
+ sal_uInt32 nMarkNum;
+
+ if(PickMarkedObj(rPnt, pObj, &nMarkNum, SDRSEARCH_PASS2BOUND))
{
BrkAction();
- UnmarkAllGluePoints();
- pInsPointUndo= dynamic_cast< SdrUndoGeoObj* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj) );
- DBG_ASSERT( pInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
+ MarkGluePoints(0, true);
+ mpInsPointUndo = dynamic_cast< SdrUndoGeoObj* >( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj) );
+ DBG_ASSERT( mpInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" );
XubString aStr(ImpGetResStr(STR_DragInsertGluePoint));
- XubString aName; pObj->TakeObjNameSingul(aName);
+ XubString aName;
+ pObj->TakeObjNameSingul(aName);
aStr.SearchAndReplaceAscii("%1", aName);
-
- aInsPointUndoStr=aStr;
+ maInsPointUndoStr = aStr;
SdrGluePointList* pGPL=pObj->ForceGluePointList();
- if (pGPL!=NULL)
+
+ if(pGPL)
{
- sal_uInt16 nGlueIdx=pGPL->Insert(SdrGluePoint());
+ const sal_uInt32 nGlueIdx(pGPL->Insert(SdrGluePoint()));
SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
- sal_uInt16 nGlueId=rGP.GetId();
- rGP.SetAbsolutePos(rPnt,*pObj);
+ const sal_uInt32 nGlueId(rGP.GetId());
+ SdrHdl* pHdl = 0;
+
+ rGP.SetAbsolutePos(rPnt, sdr::legacy::GetSnapRange(*pObj));
- SdrHdl* pHdl=NULL;
- if (MarkGluePoint(pObj,nGlueId,pPV))
+ if(MarkGluePoint(pObj, nGlueId))
{
pHdl=GetGluePointHdl(pObj,nGlueId);
}
- if (pHdl!=NULL && pHdl->GetKind()==HDL_GLUE && pHdl->GetObj()==pObj && pHdl->GetObjHdlNum()==nGlueId)
+
+ if(pHdl && HDL_GLUE == pHdl->GetKind() && pHdl->GetObj() == pObj && pHdl->GetObjHdlNum() == nGlueId)
{
- SetInsertGluePoint(sal_True);
- bRet=BegDragObj(rPnt,NULL,pHdl,0);
- if (bRet)
+ SetInsertGluePoint(true);
+ bRetval = BegDragObj(rPnt, pHdl, 0.0);
+
+ if(bRetval)
{
- aDragStat.SetMinMoved();
+ GetDragStat().SetMinMoved();
MovDragObj(rPnt);
}
else
{
- SetInsertGluePoint(sal_False);
- delete pInsPointUndo;
- pInsPointUndo=NULL;
+ SetInsertGluePoint(false);
+ delete mpInsPointUndo;
+ mpInsPointUndo = 0;
}
}
else
@@ -821,18 +894,18 @@ sal_Bool SdrDragView::BegInsGluePoint(const Point& rPnt)
else
{
// Keine Klebepunkte moeglich bei diesem Objekt (z.B. Edge)
- SetInsertGluePoint(sal_False);
- delete pInsPointUndo;
- pInsPointUndo=NULL;
+ SetInsertGluePoint(false);
+ delete mpInsPointUndo;
+ mpInsPointUndo = 0;
}
}
- return bRet;
+ return bRetval;
}
void SdrDragView::ShowDragObj()
{
- if(mpCurrentSdrDragMethod && !aDragStat.IsShown())
+ if(GetDragMethod() && !GetDragStat().IsShown())
{
for(sal_uInt32 a(0); a < PaintWindowCount(); a++)
{
@@ -841,155 +914,82 @@ void SdrDragView::ShowDragObj()
if(pOverlayManager)
{
- mpCurrentSdrDragMethod->CreateOverlayGeometry(*pOverlayManager);
+ GetDragMethod()->CreateOverlayGeometry(*pOverlayManager);
// #i101679# Force changed overlay to be shown
pOverlayManager->flush();
}
}
- aDragStat.SetShown(sal_True);
+ GetDragStat().SetShown(true);
}
}
void SdrDragView::HideDragObj()
{
- if(mpCurrentSdrDragMethod && aDragStat.IsShown())
+ if(GetDragMethod() && GetDragStat().IsShown())
{
- mpCurrentSdrDragMethod->destroyOverlayGeometry();
- aDragStat.SetShown(sal_False);
+ GetDragMethod()->destroyOverlayGeometry();
+ GetDragStat().SetShown(false);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrDragView::SetNoDragXorPolys(sal_Bool bOn)
+void SdrDragView::SetNoDragXorPolys(bool bOn)
{
if (IsNoDragXorPolys()!=bOn)
{
- const bool bDragging(mpCurrentSdrDragMethod);
- const bool bShown(bDragging && aDragStat.IsShown());
-
- if(bShown)
- {
HideDragObj();
- }
+ mbNoDragXorPolys = bOn;
- bNoDragXorPolys = bOn;
-
- if(bDragging)
+ if(GetDragMethod())
{
// force recreation of drag content
- mpCurrentSdrDragMethod->resetSdrDragEntries();
- }
-
- if(bShown)
- {
- ShowDragObj();
+ GetDragMethod()->resetSdrDragEntries();
}
- }
-}
-void SdrDragView::SetDragStripes(sal_Bool bOn)
-{
- if (mpCurrentSdrDragMethod && aDragStat.IsShown())
- {
- HideDragObj();
- bDragStripes=bOn;
ShowDragObj();
}
- else
- {
- bDragStripes=bOn;
- }
-}
-
-sal_Bool SdrDragView::IsOrthoDesired() const
-{
- if(mpCurrentSdrDragMethod && (IS_TYPE(SdrDragObjOwn, mpCurrentSdrDragMethod) || IS_TYPE(SdrDragResize, mpCurrentSdrDragMethod)))
- {
- return bOrthoDesiredOnMarked;
- }
-
- return sal_False;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrDragView::SetRubberEdgeDragging(sal_Bool bOn)
+void SdrDragView::SetDragStripes(bool bOn)
{
- if (bOn!=IsRubberEdgeDragging())
+ if(mbDragStripes != bOn)
{
- sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
- sal_Bool bShowHide=nAnz!=0 && IsDragObj() &&
- (nRubberEdgeDraggingLimit>=nAnz);
- if (bShowHide)
+ if(GetDragMethod() && GetDragStat().IsShown())
+ {
HideDragObj();
- bRubberEdgeDragging=bOn;
- if (bShowHide)
+ mbDragStripes = bOn;
ShowDragObj();
+ }
+ else
+ {
+ mbDragStripes = bOn;
+ }
}
}
-void SdrDragView::SetRubberEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz)
+bool SdrDragView::IsOrthoDesired() const
{
- if (nEdgeObjAnz!=nRubberEdgeDraggingLimit)
+ if(GetDragMethod() && (dynamic_cast< SdrDragObjOwn* >(GetDragMethod()) || dynamic_cast< SdrDragResize* >(GetDragMethod())))
{
- sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
- sal_Bool bShowHide=IsRubberEdgeDragging() && nAnz!=0 && IsDragObj() &&
- (nEdgeObjAnz>=nAnz)!=(nRubberEdgeDraggingLimit>=nAnz);
- if (bShowHide)
- HideDragObj();
- nRubberEdgeDraggingLimit=nEdgeObjAnz;
- if (bShowHide)
- ShowDragObj();
+ return mbOrthoDesiredOnMarked;
}
-}
-void SdrDragView::SetDetailedEdgeDragging(sal_Bool bOn)
-{
- if (bOn!=IsDetailedEdgeDragging())
- {
- sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
- sal_Bool bShowHide=nAnz!=0 && IsDragObj() &&
- (nDetailedEdgeDraggingLimit>=nAnz);
- if (bShowHide)
- HideDragObj();
- bDetailedEdgeDragging=bOn;
- if (bShowHide)
- ShowDragObj();
- }
+ return false;
}
-void SdrDragView::SetDetailedEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz)
-{
- if (nEdgeObjAnz!=nDetailedEdgeDraggingLimit)
- {
- sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
- sal_Bool bShowHide=IsDetailedEdgeDragging() && nAnz!=0 && IsDragObj() &&
- (nEdgeObjAnz>=nAnz)!=(nDetailedEdgeDraggingLimit>=nAnz);
- if (bShowHide)
- HideDragObj();
- nDetailedEdgeDraggingLimit=nEdgeObjAnz;
- if (bShowHide)
- ShowDragObj();
- }
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrDragView::SetMarkHandles()
{
- if( pDragHdl )
- pDragHdl = 0;
-
- SdrExchangeView::SetMarkHandles();
-}
-
-void SdrDragView::SetSolidDragging(bool bOn)
-{
- if((bool)mbSolidDragging != bOn)
+ if(GetDragHdl())
{
- mbSolidDragging = bOn;
+ mpDragHdl = 0;
}
+
+ SdrExchangeView::SetMarkHandles();
}
bool SdrDragView::IsSolidDragging() const
@@ -999,4 +999,5 @@ bool SdrDragView::IsSolidDragging() const
return mbSolidDragging && getOptionsDrawinglayer().IsSolidDragCreate();
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 5656cf02b34e..f2c67ad95edd 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -36,134 +36,154 @@
#include <svx/svdpagv.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpoev.hxx> // fuer die PolyPossiblities
-#include "svx/svdstr.hrc" // Namen aus der Resource
-#include "svx/svdglob.hxx" // StringCache
+#include <svx/svdstr.hrc> // Namen aus der Resource
+#include <svx/svdglob.hxx> // StringCache
#include <svx/e3dsceneupdater.hxx>
-
-// #i13033#
#include <clonelist.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/scene3d.hxx>
+#include <svx/svditer.hxx>
+#include <svx/svdview.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrEditView::ImpResetPossibilityFlags()
{
- bReadOnly =sal_False;
-
- bGroupPossible =sal_False;
- bUnGroupPossible =sal_False;
- bGrpEnterPossible =sal_False;
- bDeletePossible =sal_False;
- bToTopPossible =sal_False;
- bToBtmPossible =sal_False;
- bReverseOrderPossible =sal_False;
-
- bImportMtfPossible =sal_False;
- bCombinePossible =sal_False;
- bDismantlePossible =sal_False;
- bCombineNoPolyPolyPossible =sal_False;
- bDismantleMakeLinesPossible=sal_False;
- bOrthoDesiredOnMarked =sal_False;
-
- bMoreThanOneNotMovable =sal_False;
- bOneOrMoreMovable =sal_False;
- bMoreThanOneNoMovRot =sal_False;
- bContortionPossible =sal_False;
- bAllPolys =sal_False;
- bOneOrMorePolys =sal_False;
- bMoveAllowed =sal_False;
- bResizeFreeAllowed =sal_False;
- bResizePropAllowed =sal_False;
- bRotateFreeAllowed =sal_False;
- bRotate90Allowed =sal_False;
- bMirrorFreeAllowed =sal_False;
- bMirror45Allowed =sal_False;
- bMirror90Allowed =sal_False;
- bTransparenceAllowed =sal_False;
- bGradientAllowed =sal_False;
- bShearAllowed =sal_False;
- bEdgeRadiusAllowed =sal_False;
- bCanConvToPath =sal_False;
- bCanConvToPoly =sal_False;
- bCanConvToContour =sal_False;
- bCanConvToPathLineToArea=sal_False;
- bCanConvToPolyLineToArea=sal_False;
- bMoveProtect =sal_False;
- bResizeProtect =sal_False;
+ mbSelectionIsReadOnly = false;
+ mbGroupPossible = false;
+ mbUnGroupPossible = false;
+ mbGrpEnterPossible = false;
+ mbDeletePossible = false;
+ mbToTopPossible = false;
+ mbToBtmPossible = false;
+ mbReverseOrderPossible = false;
+ mbImportMtfPossible = false;
+ mbCombinePossible = false;
+ mbDismantlePossible = false;
+ mbCombineNoPolyPolyPossible = false;
+ mbDismantleMakeLinesPossible = false;
+ mbOrthoDesiredOnMarked = false;
+ mbMoreThanOneNotMovable = false;
+ mbOneOrMoreMovable = false;
+ mbMoreThanOneNoMovRot = false;
+ mbContortionPossible = false;
+ mbMoveAllowedOnSelection = false;
+ mbResizeFreeAllowed = false;
+ mbResizePropAllowed = false;
+ mbRotateFreeAllowed = false;
+ mbRotate90Allowed = false;
+ mbMirrorFreeAllowed = false;
+ mbMirror45Allowed = false;
+ mbMirror90Allowed = false;
+ mbShearAllowed = false;
+ mbEdgeRadiusAllowed = false;
+ mbTransparenceAllowed = false;
+ mbGradientAllowed = false;
+ mbCanConvToPath = false;
+ mbCanConvToPoly = false;
+ mbCanConvToContour = false;
+ mbCanConvToPathLineToArea = false;
+ mbCanConvToPolyLineToArea = false;
+ mbMoveProtect = false;
+ mbResizeProtect = false;
}
-void SdrEditView::ImpClearVars()
+SdrEditView::SdrEditView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrMarkView(rModel1, pOut),
+ mbPossibilitiesDirty(true),
+ mbSelectionIsReadOnly(false),
+ mbGroupPossible(false),
+ mbUnGroupPossible(false),
+ mbGrpEnterPossible(false),
+ mbDeletePossible(false),
+ mbToTopPossible(false),
+ mbToBtmPossible(false),
+ mbReverseOrderPossible(false),
+ mbImportMtfPossible(false),
+ mbCombinePossible(false),
+ mbDismantlePossible(false),
+ mbCombineNoPolyPolyPossible(false),
+ mbDismantleMakeLinesPossible(false),
+ mbOrthoDesiredOnMarked(false),
+ mbMoreThanOneNotMovable(false),
+ mbOneOrMoreMovable(false),
+ mbMoreThanOneNoMovRot(false),
+ mbContortionPossible(false),
+ mbMoveAllowedOnSelection(false),
+ mbResizeFreeAllowed(false),
+ mbResizePropAllowed(false),
+ mbRotateFreeAllowed(false),
+ mbRotate90Allowed(false),
+ mbMirrorFreeAllowed(false),
+ mbMirror45Allowed(false),
+ mbMirror90Allowed(false),
+ mbShearAllowed(false),
+ mbEdgeRadiusAllowed(false),
+ mbTransparenceAllowed(false),
+ mbGradientAllowed(false),
+ mbCanConvToPath(false),
+ mbCanConvToPoly(false),
+ mbCanConvToContour(false),
+ mbCanConvToPathLineToArea(false),
+ mbCanConvToPolyLineToArea(false),
+ mbMoveProtect(false),
+ mbResizeProtect(false),
+ mbBundleVirtObj(false)
{
- ImpResetPossibilityFlags();
- bPossibilitiesDirty=sal_True; // << war von Purify angemeckert
- bBundleVirtObj=sal_False;
-}
-
-SdrEditView::SdrEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrMarkView(pModel1,pOut)
-{
- ImpClearVars();
}
SdrEditView::~SdrEditView()
{
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
SdrLayer* SdrEditView::InsertNewLayer(const XubString& rName, sal_uInt16 nPos)
{
- SdrLayerAdmin& rLA=pMod->GetLayerAdmin();
- sal_uInt16 nMax=rLA.GetLayerCount();
- if (nPos>nMax) nPos=nMax;
- SdrLayer* pNewLayer=rLA.NewLayer(rName,nPos);
+ SdrLayerAdmin& rLA = getSdrModelFromSdrView().GetModelLayerAdmin();
+ const sal_uInt16 nMax(rLA.GetLayerCount());
- if( GetModel()->IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewLayer(nPos,rLA,*pMod));
+ if(nPos > nMax)
+ {
+ nPos = nMax;
+ }
+
+ SdrLayer* pNewLayer = rLA.NewLayer(rName, nPos);
+
+ if(getSdrModelFromSdrView().IsUndoEnabled())
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewLayer(nPos, rLA, getSdrModelFromSdrView()));
+ }
+
+ getSdrModelFromSdrView().SetChanged();
- pMod->SetChanged();
return pNewLayer;
}
-#include <svx/svdogrp.hxx>
-#include <svx/scene3d.hxx>
-sal_Bool SdrEditView::ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const
+bool SdrEditView::ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const
{
- sal_Bool bDelAll(sal_True);
- sal_uInt32 nObjAnz(pOL->GetObjCount());
+ bool bDelAll(true);
+ const sal_uInt32 nObjAnz(pOL->GetObjCount());
for(sal_uInt32 nObjNum(nObjAnz); nObjNum > 0 && bDelAll;)
{
nObjNum--;
SdrObject* pObj = pOL->GetObj(nObjNum);
- SdrObjList* pSubOL = pObj->GetSubList();
+ SdrObjList* pSubOL = pObj->getChildrenOfSdrObject();
- // #104809# Test explicitely for group objects and 3d scenes
- if(pSubOL && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dScene)))
+ if(pSubOL)
{
if(!ImpDelLayerCheck(pSubOL, nDelID))
{
// Rekursion
- bDelAll = sal_False;
+ bDelAll = false;
}
}
else
{
if(pObj->GetLayer() != nDelID)
{
- bDelAll = sal_False;
+ bDelAll = false;
}
}
}
@@ -173,30 +193,30 @@ sal_Bool SdrEditView::ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const
void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID)
{
- sal_uInt32 nObjAnz(pOL->GetObjCount());
- // make sure OrdNums are correct
- pOL->GetObj(0)->GetOrdNum();
-
- const bool bUndo = GetModel()->IsUndoEnabled();
+ const sal_uInt32 nObjAnz(pOL->GetObjCount());
+ const bool bUndo(getSdrModelFromSdrView().IsUndoEnabled());
for(sal_uInt32 nObjNum(nObjAnz); nObjNum > 0;)
{
nObjNum--;
SdrObject* pObj = pOL->GetObj(nObjNum);
- SdrObjList* pSubOL = pObj->GetSubList();
-
+ SdrObjList* pSubOL = pObj->getChildrenOfSdrObject();
- // #104809# Test explicitely for group objects and 3d scenes
- if(pSubOL && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dScene)))
+ if(pSubOL)
{
if(ImpDelLayerCheck(pSubOL, nDelID))
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
- pOL->RemoveObject(nObjNum);
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
+ }
+
+ pOL->RemoveObjectFromSdrObjList(nObjNum);
- if( !bUndo )
- SdrObject::Free( pObj );
+ if(!bUndo)
+ {
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
}
else
{
@@ -205,13 +225,19 @@ void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID)
}
else
{
- if(pObj->GetLayer() == nDelID)
+ if(nDelID == pObj->GetLayer())
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
- pOL->RemoveObject(nObjNum);
- if( !bUndo )
- SdrObject::Free( pObj );
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
+ }
+
+ pOL->RemoveObjectFromSdrObjList(nObjNum);
+
+ if(!bUndo)
+ {
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
}
}
}
@@ -219,52 +245,53 @@ void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID)
void SdrEditView::DeleteLayer(const XubString& rName)
{
- SdrLayerAdmin& rLA = pMod->GetLayerAdmin();
- SdrLayer* pLayer = rLA.GetLayer(rName, sal_True);
+ SdrLayerAdmin& rLA = getSdrModelFromSdrView().GetModelLayerAdmin();
+ SdrLayer* pLayer = rLA.GetLayer(rName, true);
sal_uInt16 nLayerNum(rLA.GetLayerPos(pLayer));
if(SDRLAYER_NOTFOUND != nLayerNum)
{
+ const SdrLayerID nDelID(pLayer->GetID());
+ const bool bUndo(IsUndoEnabled());
+ bool bMaPg(true);
- SdrLayerID nDelID = pLayer->GetID();
-
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
+ if(bUndo)
+ {
BegUndo(ImpGetResStr(STR_UndoDelLayer));
-
- sal_Bool bMaPg(sal_True);
+ }
for(sal_uInt16 nPageKind(0); nPageKind < 2; nPageKind++)
{
// MasterPages and DrawPages
- sal_uInt16 nPgAnz(bMaPg ? pMod->GetMasterPageCount() : pMod->GetPageCount());
+ const sal_uInt16 nPgAnz(bMaPg ? getSdrModelFromSdrView().GetMasterPageCount() : getSdrModelFromSdrView().GetPageCount());
for(sal_uInt16 nPgNum(0); nPgNum < nPgAnz; nPgNum++)
{
// over all pages
- SdrPage* pPage = (bMaPg) ? pMod->GetMasterPage(nPgNum) : pMod->GetPage(nPgNum);
- sal_uInt32 nObjAnz(pPage->GetObjCount());
-
- // make sure OrdNums are correct
- if(nObjAnz)
- pPage->GetObj(0)->GetOrdNum();
+ SdrPage* pPage = (bMaPg) ? getSdrModelFromSdrView().GetMasterPage(nPgNum) : getSdrModelFromSdrView().GetPage(nPgNum);
+ const sal_uInt32 nObjAnz(pPage->GetObjCount());
for(sal_uInt32 nObjNum(nObjAnz); nObjNum > 0;)
{
nObjNum--;
SdrObject* pObj = pPage->GetObj(nObjNum);
- SdrObjList* pSubOL = pObj->GetSubList();
+ SdrObjList* pSubOL = pObj->getChildrenOfSdrObject();
- // #104809# Test explicitely for group objects and 3d scenes
- if(pSubOL && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dScene)))
+ if(pSubOL)
{
if(ImpDelLayerCheck(pSubOL, nDelID))
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
- pPage->RemoveObject(nObjNum);
- if( !bUndo )
- SdrObject::Free(pObj);
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
+ }
+
+ pPage->RemoveObjectFromSdrObjList(nObjNum);
+
+ if(!bUndo)
+ {
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
}
else
{
@@ -273,23 +300,30 @@ void SdrEditView::DeleteLayer(const XubString& rName)
}
else
{
- if(pObj->GetLayer() == nDelID)
+ if(nDelID == pObj->GetLayer())
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
- pPage->RemoveObject(nObjNum);
- if( !bUndo )
- SdrObject::Free(pObj);
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
+ }
+
+ pPage->RemoveObjectFromSdrObjList(nObjNum);
+
+ if(!bUndo)
+ {
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
}
}
}
}
- bMaPg = sal_False;
+
+ bMaPg = false;
}
- if( bUndo )
+ if(bUndo)
{
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteLayer(nLayerNum, rLA, *pMod));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteLayer(nLayerNum, rLA, getSdrModelFromSdrView()));
rLA.RemoveLayer(nLayerNum);
EndUndo();
}
@@ -298,32 +332,16 @@ void SdrEditView::DeleteLayer(const XubString& rName)
delete rLA.RemoveLayer(nLayerNum);
}
- pMod->SetChanged();
+ getSdrModelFromSdrView().SetChanged();
}
}
-void SdrEditView::MoveLayer(const XubString& rName, sal_uInt16 nNewPos)
-{
- SdrLayerAdmin& rLA=pMod->GetLayerAdmin();
- SdrLayer* pLayer=rLA.GetLayer(rName,sal_True);
- sal_uInt16 nLayerNum=rLA.GetLayerPos(pLayer);
- if (nLayerNum!=SDRLAYER_NOTFOUND)
- {
- if( IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveLayer(nLayerNum,rLA,*pMod,nNewPos));
- rLA.MoveLayer(nLayerNum,nNewPos);
- pMod->SetChanged();
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrEditView::EndUndo()
{
// #i13033#
// Comparison changed to 1L since EndUndo() is called later now
// and EndUndo WILL change count to count-1
- if(1L == pMod->GetUndoBracketLevel())
+ if(getSdrModelFromSdrView().IsLastEndUndo())
{
ImpBroadcastEdgesOfMarkedNodes();
}
@@ -331,716 +349,919 @@ void SdrEditView::EndUndo()
// #i13033#
// moved to bottom to still have access to UNDOs inside of
// ImpBroadcastEdgesOfMarkedNodes()
- pMod->EndUndo();
+ getSdrModelFromSdrView().EndUndo();
}
void SdrEditView::ImpBroadcastEdgesOfMarkedNodes()
{
- const List& rAllMarkedObjects = GetTransitiveHullOfMarkedObjects();
-
- // #i13033#
- // New mechanism to search for necessary disconnections for
- // changed connectors inside the transitive hull of all at
- // the beginning of UNDO selected objects
- for(sal_uInt32 a(0L); a < rAllMarkedObjects.Count(); a++)
+ if(areSdrObjectsSelected())
{
- SdrEdgeObj* pEdge = PTR_CAST(SdrEdgeObj, (SdrObject*)rAllMarkedObjects.GetObject(a));
+ // New mechanism to search for necessary disconnections for
+ // changed connectors inside the transitive hull of all at
+ // the beginning of UNDO selected objects
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- if(pEdge)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrObject* pObj1 = pEdge->GetConnectedNode(sal_False);
- SdrObject* pObj2 = pEdge->GetConnectedNode(sal_True);
+ SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(aSelection[a]);
- if(pObj1
- && LIST_ENTRY_NOTFOUND == rAllMarkedObjects.GetPos(pObj1)
- && !pEdge->CheckNodeConnection(sal_False))
+ if(pEdge)
{
- if( IsUndoEnabled() )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pEdge));
- pEdge->DisconnectFromNode(sal_False);
- }
+ SdrObject* pObj1 = pEdge->GetConnectedNode(false);
+ SdrObject* pObj2 = pEdge->GetConnectedNode(true);
- if(pObj2
- && LIST_ENTRY_NOTFOUND == rAllMarkedObjects.GetPos(pObj2)
- && !pEdge->CheckNodeConnection(sal_True))
- {
- if( IsUndoEnabled() )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pEdge));
- pEdge->DisconnectFromNode(sal_True);
+ if(pObj1 && !pEdge->CheckNodeConnection(false))
+ {
+ bool bContains(false);
+
+ for(sal_uInt32 b(0); b < aSelection.size(); b++)
+ {
+ if(aSelection[b] == pObj1)
+ {
+ bContains = true;
+ break;
+ }
+ }
+
+ if(!bContains)
+ {
+ if(IsUndoEnabled())
+ {
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pEdge));
+ }
+
+ pEdge->DisconnectFromNode(false);
+ }
+ }
+
+ if(pObj2 && !pEdge->CheckNodeConnection(true))
+ {
+ bool bContains(false);
+
+ for(sal_uInt32 b(0); b < aSelection.size(); b++)
+ {
+ if(aSelection[b] == pObj2)
+ {
+ bContains = true;
+ break;
+ }
+ }
+
+ if(!bContains)
+ {
+ if(IsUndoEnabled())
+ {
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pEdge));
+ }
+
+ pEdge->DisconnectFromNode(true);
+ }
+ }
}
}
- }
- sal_uIntPtr nMarkedEdgeAnz = GetMarkedEdgesOfMarkedNodes().GetMarkCount();
- sal_uInt16 i;
+ /// get all SdrEdgeObj which are connected to a selected SdrObject and are selected themselves
+ const ::std::vector< SdrEdgeObj* > aConnectedSdrEdgeObjs(getAllSdrEdgeObjConnectedToSdrObjectVector(aSelection, true));
- for (i=0; i<nMarkedEdgeAnz; i++) {
- SdrMark* pEM = GetMarkedEdgesOfMarkedNodes().GetMark(i);
- SdrObject* pEdgeTmp=pEM->GetMarkedSdrObj();
- SdrEdgeObj* pEdge=PTR_CAST(SdrEdgeObj,pEdgeTmp);
- if (pEdge!=NULL) {
+ for(sal_uInt32 i(0); i < aConnectedSdrEdgeObjs.size(); i++)
+ {
+ SdrEdgeObj* pEdge = aConnectedSdrEdgeObjs[i];
+
+ /// TTTT: is this needed or will this happen automatically...?
pEdge->SetEdgeTrackDirty();
}
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// #### ### #### #### # #### # # # ##### # ##### ####
-// # # # # # # # # # # # # # # # #
-// #### # # ### ### # #### # # # # # #### ###
-// # # # # # # # # # # # # # # #
-// # ### #### #### # #### # #### # # # ##### ####
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrEditView::MarkListHasChanged()
+void SdrEditView::handleSelectionChange()
{
- SdrMarkView::MarkListHasChanged();
- bPossibilitiesDirty=sal_True;
-}
+ // call parent
+ SdrMarkView::handleSelectionChange();
-void SdrEditView::ModelHasChanged()
-{
- SdrMarkView::ModelHasChanged();
- bPossibilitiesDirty=sal_True;
+ // invalidate possibilities which are based on selection
+ mbPossibilitiesDirty = true;
}
-sal_Bool SdrEditView::IsResizeAllowed(sal_Bool bProp) const
+bool SdrEditView::IsResizeAllowed(bool bProp) const
{
ForcePossibilities();
- if (bResizeProtect) return sal_False;
- if (bProp) return bResizePropAllowed;
- return bResizeFreeAllowed;
+
+ if(mbResizeProtect)
+ {
+ return false;
+ }
+
+ if(bProp)
+ {
+ return mbResizePropAllowed;
+ }
+
+ return mbResizeFreeAllowed;
}
-sal_Bool SdrEditView::IsRotateAllowed(sal_Bool b90Deg) const
+bool SdrEditView::IsRotateAllowed(bool b90Deg) const
{
ForcePossibilities();
- if (bMoveProtect) return sal_False;
- if (b90Deg) return bRotate90Allowed;
- return bRotateFreeAllowed;
+
+ if(mbMoveProtect)
+ {
+ return false;
+ }
+
+ if(b90Deg)
+ {
+ return mbRotate90Allowed;
+ }
+
+ return mbRotateFreeAllowed;
}
-sal_Bool SdrEditView::IsMirrorAllowed(sal_Bool b45Deg, sal_Bool b90Deg) const
+bool SdrEditView::IsMirrorAllowed(bool b45Deg, bool b90Deg) const
{
ForcePossibilities();
- if (bMoveProtect) return sal_False;
- if (b90Deg) return bMirror90Allowed;
- if (b45Deg) return bMirror45Allowed;
- return bMirrorFreeAllowed && !bMoveProtect;
+
+ if(mbMoveProtect)
+ {
+ return false;
+ }
+
+ if(b90Deg)
+ {
+ return mbMirror90Allowed;
+ }
+
+ if(b45Deg)
+ {
+ return mbMirror45Allowed;
+ }
+
+ return mbMirrorFreeAllowed && !mbMoveProtect;
}
-sal_Bool SdrEditView::IsTransparenceAllowed() const
+bool SdrEditView::IsTransparenceAllowed() const
{
ForcePossibilities();
- return bTransparenceAllowed;
+
+ return mbTransparenceAllowed;
}
-sal_Bool SdrEditView::IsGradientAllowed() const
+bool SdrEditView::IsGradientAllowed() const
{
ForcePossibilities();
- return bGradientAllowed;
+
+ return mbGradientAllowed;
}
-sal_Bool SdrEditView::IsShearAllowed() const
+bool SdrEditView::IsShearAllowed() const
{
ForcePossibilities();
- if (bResizeProtect) return sal_False;
- return bShearAllowed;
+
+ if(mbResizeProtect)
+ {
+ return false;
+ }
+
+ return mbShearAllowed;
}
-sal_Bool SdrEditView::IsEdgeRadiusAllowed() const
+bool SdrEditView::IsEdgeRadiusAllowed() const
{
ForcePossibilities();
- return bEdgeRadiusAllowed;
+
+ return mbEdgeRadiusAllowed;
}
-sal_Bool SdrEditView::IsCrookAllowed(sal_Bool bNoContortion) const
+bool SdrEditView::IsCrookAllowed(bool bNoContortion) const
{
// CrookMode fehlt hier (weil kein Rotate bei Shear ...)
ForcePossibilities();
- if (bNoContortion) {
- if (!bRotateFreeAllowed) return sal_False; // Crook is nich
- return !bMoveProtect && bMoveAllowed;
- } else {
- return !bResizeProtect && bContortionPossible;
+
+ if(bNoContortion)
+ {
+ if(!mbRotateFreeAllowed)
+ {
+ return false; // Crook is nich
+ }
+
+ return !mbMoveProtect && mbMoveAllowedOnSelection;
+ }
+ else
+ {
+ return !mbResizeProtect && mbContortionPossible;
}
}
-sal_Bool SdrEditView::IsDistortAllowed(sal_Bool bNoContortion) const
+bool SdrEditView::IsDistortAllowed(bool bNoContortion) const
{
ForcePossibilities();
- if (bNoContortion) {
- return sal_False;
- } else {
- return !bResizeProtect && bContortionPossible;
+
+ if(bNoContortion)
+ {
+ return false;
+ }
+ else
+ {
+ return !mbResizeProtect && mbContortionPossible;
}
}
-sal_Bool SdrEditView::IsCombinePossible(sal_Bool bNoPolyPoly) const
+bool SdrEditView::IsCombinePossible(bool bNoPolyPoly) const
{
ForcePossibilities();
- if (bNoPolyPoly) return bCombineNoPolyPolyPossible;
- else return bCombinePossible;
+
+ if(bNoPolyPoly)
+ {
+ return mbCombineNoPolyPolyPossible;
+ }
+ else
+ {
+ return mbCombinePossible;
+ }
}
-sal_Bool SdrEditView::IsDismantlePossible(sal_Bool bMakeLines) const
+bool SdrEditView::IsDismantlePossible(bool bMakeLines) const
{
ForcePossibilities();
- if (bMakeLines) return bDismantleMakeLinesPossible;
- else return bDismantlePossible;
+
+ if(bMakeLines)
+ {
+ return mbDismantleMakeLinesPossible;
+ }
+ else
+ {
+ return mbDismantlePossible;
+ }
}
void SdrEditView::CheckPossibilities()
{
- if (bSomeObjChgdFlag) bPossibilitiesDirty=sal_True;
-
- if(bSomeObjChgdFlag)
+ if(mbPossibilitiesDirty)
{
- // This call IS necessary to correct the MarkList, in which
- // no longer to the model belonging objects still can reside.
- // These ones nned to be removed.
- CheckMarked();
- }
-
- if (bPossibilitiesDirty) {
ImpResetPossibilityFlags();
- SortMarkedObjects();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- if (nMarkAnz!=0) {
- bReverseOrderPossible=nMarkAnz>=2;
-
- sal_uIntPtr nMovableCount=0;
- bGroupPossible=nMarkAnz>=2;
- bCombinePossible=nMarkAnz>=2;
- if (nMarkAnz==1) {
- // bCombinePossible gruendlicher checken
- // fehlt noch ...
- const SdrObject* pObj=GetMarkedObjectByIndex(0);
- //const SdrPathObj* pPath=PTR_CAST(SdrPathObj,pObj);
- sal_Bool bGroup=pObj->GetSubList()!=NULL;
- sal_Bool bHasText=pObj->GetOutlinerParaObject()!=NULL;
- if (bGroup || bHasText) {
- bCombinePossible=sal_True;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const bool bExactlyOne(1 == aSelection.size());
+
+ if(aSelection.size())
+ {
+ sal_uInt32 nMovableCount(0);
+ const bool bMoreOrEqualTwo(aSelection.size() >= 2);
+ mbReverseOrderPossible = bMoreOrEqualTwo;
+ mbGroupPossible = bMoreOrEqualTwo;
+ mbCombinePossible = bMoreOrEqualTwo;
+
+ if(bExactlyOne)
+ {
+ const SdrObject* pObj = aSelection[0];
+ const bool bGroup(pObj->getChildrenOfSdrObject());
+ const bool bHasText(0 != pObj->GetOutlinerParaObject());
+
+ if(bGroup || bHasText)
+ {
+ mbCombinePossible = true;
}
}
- bCombineNoPolyPolyPossible=bCombinePossible;
- bDeletePossible=sal_True;
+
+ mbCombineNoPolyPolyPossible = mbCombinePossible;
+ mbDeletePossible = true;
+
// Zu den Transformationen erstmal ja sagen
- bMoveAllowed =sal_True;
- bResizeFreeAllowed=sal_True;
- bResizePropAllowed=sal_True;
- bRotateFreeAllowed=sal_True;
- bRotate90Allowed =sal_True;
- bMirrorFreeAllowed=sal_True;
- bMirror45Allowed =sal_True;
- bMirror90Allowed =sal_True;
- bShearAllowed =sal_True;
- bEdgeRadiusAllowed=sal_False;
- bContortionPossible=sal_True;
- bCanConvToContour = sal_True;
+ mbMoveAllowedOnSelection = true;
+ mbResizeFreeAllowed = true;
+ mbResizePropAllowed = true;
+ mbRotateFreeAllowed = true;
+ mbRotate90Allowed = true;
+ mbMirrorFreeAllowed = true;
+ mbMirror45Allowed = true;
+ mbMirror90Allowed = true;
+ mbShearAllowed = true;
+ mbEdgeRadiusAllowed = false;
+ mbContortionPossible = true;
+ mbCanConvToContour = true;
// these ones are only allowed when single object is selected
- bTransparenceAllowed = (nMarkAnz == 1);
- bGradientAllowed = (nMarkAnz == 1);
- if(bGradientAllowed)
+ mbTransparenceAllowed = bExactlyOne;
+ mbGradientAllowed = bExactlyOne;
+
+ if(mbGradientAllowed)
{
// gradient depends on fillstyle
- const SdrMark* pM = GetSdrMarkByIndex(0);
- const SdrObject* pObj = pM->GetMarkedSdrObj();
+ const SdrObject* pObj = aSelection[0];
// maybe group object, so get merged ItemSet
const SfxItemSet& rSet = pObj->GetMergedItemSet();
- SfxItemState eState = rSet.GetItemState(XATTR_FILLSTYLE, sal_False);
+ const SfxItemState eState = rSet.GetItemState(XATTR_FILLSTYLE, false);
if(SFX_ITEM_DONTCARE != eState)
{
// If state is not DONTCARE, test the item
- XFillStyle eFillStyle = ((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue();
+ const XFillStyle eFillStyle(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
- if(eFillStyle != XFILL_GRADIENT)
+ if(XFILL_GRADIENT != eFillStyle)
{
- bGradientAllowed = sal_False;
+ mbGradientAllowed = false;
}
}
}
- sal_Bool bNoMovRotFound=sal_False;
- const SdrPageView* pPV0=NULL;
-
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
- const SdrMark* pM=GetSdrMarkByIndex(nm);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- const SdrPageView* pPV=pM->GetPageView();
- if (pPV!=pPV0) {
- if (pPV->IsReadOnly()) bReadOnly=sal_True;
- pPV0=pPV;
- }
+ bool bNoMovRotFound(false);
+ mbSelectionIsReadOnly = GetSdrPageView() ? GetSdrPageView()->IsReadOnly() : false;
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ const SdrObject* pObj = aSelection[nm];
SdrObjTransformInfoRec aInfo;
pObj->TakeObjInfo(aInfo);
- sal_Bool bMovPrt=pObj->IsMoveProtect();
- sal_Bool bSizPrt=pObj->IsResizeProtect();
- if (!bMovPrt && aInfo.bMoveAllowed) nMovableCount++; // Menge der MovableObjs zaehlen
- if (bMovPrt) bMoveProtect=sal_True;
- if (bSizPrt) bResizeProtect=sal_True;
+ const bool bMovPrt(pObj->IsMoveProtect());
+ const bool bSizPrt(pObj->IsResizeProtect());
+
+ if(!bMovPrt && aInfo.mbMoveAllowed)
+ {
+ nMovableCount++; // Menge der MovableObjs zaehlen
+ }
+
+ if(bMovPrt)
+ {
+ mbMoveProtect = true;
+ }
+
+ if(bSizPrt)
+ {
+ mbResizeProtect = true;
+ }
// not allowed when not allowed at one object
- if(!aInfo.bTransparenceAllowed)
- bTransparenceAllowed = sal_False;
+ if(!aInfo.mbTransparenceAllowed)
+ {
+ mbTransparenceAllowed = false;
+ }
// Wenn einer was nicht kann, duerfen's alle nicht
- if (!aInfo.bMoveAllowed ) bMoveAllowed =sal_False;
- if (!aInfo.bResizeFreeAllowed) bResizeFreeAllowed=sal_False;
- if (!aInfo.bResizePropAllowed) bResizePropAllowed=sal_False;
- if (!aInfo.bRotateFreeAllowed) bRotateFreeAllowed=sal_False;
- if (!aInfo.bRotate90Allowed ) bRotate90Allowed =sal_False;
- if (!aInfo.bMirrorFreeAllowed) bMirrorFreeAllowed=sal_False;
- if (!aInfo.bMirror45Allowed ) bMirror45Allowed =sal_False;
- if (!aInfo.bMirror90Allowed ) bMirror90Allowed =sal_False;
- if (!aInfo.bShearAllowed ) bShearAllowed =sal_False;
- if (aInfo.bEdgeRadiusAllowed) bEdgeRadiusAllowed=sal_True;
- if (aInfo.bNoContortion ) bContortionPossible=sal_False;
+ if(!aInfo.mbMoveAllowed)
+ {
+ mbMoveAllowedOnSelection = false;
+ }
+
+ if(!aInfo.mbResizeFreeAllowed)
+ {
+ mbResizeFreeAllowed = false;
+ }
+
+ if(!aInfo.mbResizePropAllowed)
+ {
+ mbResizePropAllowed = false;
+ }
+
+ if(!aInfo.mbRotateFreeAllowed)
+ {
+ mbRotateFreeAllowed = false;
+ }
+
+ if(!aInfo.mbRotate90Allowed)
+ {
+ mbRotate90Allowed = false;
+ }
+
+ if(!aInfo.mbMirrorFreeAllowed)
+ {
+ mbMirrorFreeAllowed = false;
+ }
+
+ if(!aInfo.mbMirror45Allowed)
+ {
+ mbMirror45Allowed = false;
+ }
+
+ if(!aInfo.mbMirror90Allowed)
+ {
+ mbMirror90Allowed = false;
+ }
+
+ if(!aInfo.mbShearAllowed)
+ {
+ mbShearAllowed = false;
+ }
+
+ if(aInfo.mbEdgeRadiusAllowed)
+ {
+ mbEdgeRadiusAllowed = true;
+ }
+
+ if(aInfo.mbNoContortion)
+ {
+ mbContortionPossible = false;
+ }
+
// Fuer Crook mit Contortion: Alle Objekte muessen
// Movable und Rotatable sein, ausser maximal 1
- if (!bMoreThanOneNoMovRot) {
- if (!aInfo.bMoveAllowed || !aInfo.bResizeFreeAllowed) {
- bMoreThanOneNoMovRot=bNoMovRotFound;
- bNoMovRotFound=sal_True;
+ if(!mbMoreThanOneNoMovRot)
+ {
+ if(!aInfo.mbMoveAllowed || !aInfo.mbResizeFreeAllowed)
+ {
+ mbMoreThanOneNoMovRot = bNoMovRotFound;
+ bNoMovRotFound = true;
}
}
// when one member cannot be converted, no conversion is possible
- if(!aInfo.bCanConvToContour)
- bCanConvToContour = sal_False;
+ if(!aInfo.mbCanConvToContour)
+ {
+ mbCanConvToContour = false;
+ }
// Ungroup
- if (!bUnGroupPossible) bUnGroupPossible=pObj->GetSubList()!=NULL;
+ if(!mbUnGroupPossible)
+ {
+ mbUnGroupPossible = (0 != pObj->getChildrenOfSdrObject());
+ }
+
// ConvertToCurve: Wenn mind. einer konvertiert werden kann ist das ok.
- if (aInfo.bCanConvToPath ) bCanConvToPath =sal_True;
- if (aInfo.bCanConvToPoly ) bCanConvToPoly =sal_True;
- if (aInfo.bCanConvToPathLineToArea) bCanConvToPathLineToArea=sal_True;
- if (aInfo.bCanConvToPolyLineToArea) bCanConvToPolyLineToArea=sal_True;
+ if(aInfo.mbCanConvToPath)
+ {
+ mbCanConvToPath = true;
+ }
+
+ if(aInfo.mbCanConvToPoly)
+ {
+ mbCanConvToPoly = true;
+ }
+
+ if(aInfo.mbCanConvToPathLineToArea)
+ {
+ mbCanConvToPathLineToArea = true;
+ }
+
+ if(aInfo.mbCanConvToPolyLineToArea)
+ {
+ mbCanConvToPolyLineToArea = true;
+ }
// Combine/Dismantle
- if(bCombinePossible)
+ if(mbCombinePossible)
{
- bCombinePossible = ImpCanConvertForCombine(pObj);
- bCombineNoPolyPolyPossible = bCombinePossible;
+ mbCombinePossible = ImpCanConvertForCombine(pObj);
+ mbCombineNoPolyPolyPossible = mbCombinePossible;
+ }
+
+ if(!mbDismantlePossible)
+ {
+ mbDismantlePossible = ImpCanDismantle(pObj, false);
+ }
+
+ if(!mbDismantleMakeLinesPossible)
+ {
+ mbDismantleMakeLinesPossible = ImpCanDismantle(pObj, true);
}
- if (!bDismantlePossible) bDismantlePossible = ImpCanDismantle(pObj, sal_False);
- if (!bDismantleMakeLinesPossible) bDismantleMakeLinesPossible = ImpCanDismantle(pObj, sal_True);
// OrthoDesiredOnMarked checken
- if (!bOrthoDesiredOnMarked && !aInfo.bNoOrthoDesired) bOrthoDesiredOnMarked=sal_True;
- // ImportMtf checken
+ if(!mbOrthoDesiredOnMarked && !aInfo.mbNoOrthoDesired)
+ {
+ mbOrthoDesiredOnMarked = true;
+ }
- if (!bImportMtfPossible)
+ // ImportMtf checken
+ if(!mbImportMtfPossible)
{
const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pObj);
const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObj);
if(pSdrGrafObj && ((pSdrGrafObj->HasGDIMetaFile() && !pSdrGrafObj->IsEPS()) || pSdrGrafObj->isEmbeddedSvg()))
{
- bImportMtfPossible = sal_True;
+ mbImportMtfPossible = true;
}
if(pSdrOle2Obj)
{
- bImportMtfPossible = pSdrOle2Obj->GetObjRef().is();
+ mbImportMtfPossible = pSdrOle2Obj->GetObjRef().is();
}
}
}
- bMoreThanOneNotMovable=nMovableCount<nMarkAnz-1;
- bOneOrMoreMovable=nMovableCount!=0;
- bGrpEnterPossible=bUnGroupPossible;
+ mbMoreThanOneNotMovable = (nMovableCount < aSelection.size() - 1);
+ mbOneOrMoreMovable = (0 != nMovableCount);
+ mbGrpEnterPossible = mbUnGroupPossible;
}
+
ImpCheckToTopBtmPossible();
- ((SdrPolyEditView*)this)->ImpCheckPolyPossibilities();
- bPossibilitiesDirty=sal_False;
+ ImpCheckPolyPossibilities();
+ mbPossibilitiesDirty = false;
+
+ if(mbSelectionIsReadOnly)
+ {
+ const bool bMerker1(mbGrpEnterPossible);
- if (bReadOnly) {
- sal_Bool bMerker1=bGrpEnterPossible;
ImpResetPossibilityFlags();
- bReadOnly=sal_True;
- bGrpEnterPossible=bMerker1;
+ mbSelectionIsReadOnly = true;
+ mbGrpEnterPossible = bMerker1;
}
- if (bMoveAllowed) {
+
+ if(mbMoveAllowedOnSelection)
+ {
// Verschieben von angeklebten Verbindern unterbinden
// Derzeit nur fuer Einfachselektion implementiert.
- if (nMarkAnz==1) {
- SdrObject* pObj=GetMarkedObjectByIndex(0);
- SdrEdgeObj* pEdge=PTR_CAST(SdrEdgeObj,pObj);
- if (pEdge!=NULL) {
- SdrObject* pNode1=pEdge->GetConnectedNode(sal_True);
- SdrObject* pNode2=pEdge->GetConnectedNode(sal_False);
- if (pNode1!=NULL || pNode2!=NULL) bMoveAllowed=sal_False;
+ if(bExactlyOne)
+ {
+ SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(aSelection[0]);
+
+ if(pEdge)
+ {
+ SdrObject* pNode1 = pEdge->GetConnectedNode(true);
+ SdrObject* pNode2 = pEdge->GetConnectedNode(false);
+
+ if(pNode1 || pNode2)
+ {
+ mbMoveAllowedOnSelection = false;
+ }
}
}
}
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrEditView::ForceMarkedObjToAnotherPage()
+void SdrEditView::ForcePossibilities() const
{
- sal_Bool bFlg=sal_False;
- for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount(); nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- Rectangle aObjRect(pObj->GetCurrentBoundRect());
- Rectangle aPgRect(pM->GetPageView()->GetPageRect());
- if (!aObjRect.IsOver(aPgRect)) {
- sal_Bool bFnd=sal_False;
- SdrPageView* pPV = GetSdrPageView();
-
- if(pPV)
- {
- bFnd = aObjRect.IsOver(pPV->GetPageRect());
- }
+ // trigger evtl. delayed selection changes
+ const_cast< SdrEditView* >(this)->forceSelectionChange();
- if(bFnd)
- {
- pM->GetPageView()->GetObjList()->RemoveObject(pObj->GetOrdNum());
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- pPV->GetObjList()->InsertObject(pObj,CONTAINER_APPEND,&aReason);
- pM->SetPageView(pPV);
- InvalidateAllWin(aObjRect);
- bFlg=sal_True;
- }
- }
- }
- if (bFlg) {
- MarkListHasChanged();
+ if(mbPossibilitiesDirty)
+ {
+ const_cast< SdrEditView* >(this)->CheckPossibilities();
}
}
-void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark)
+void SdrEditView::ImpCheckPolyPossibilities()
{
- if (rMark.GetMarkCount()!=0)
+}
+
+void SdrEditView::deleteSdrObjectsWithUndo(const SdrObjectVector& rSdrObjectVector)
+{
+ if(rSdrObjectVector.size())
{
- rMark.ForceSort();
+ const bool bUndo(IsUndoEnabled());
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
+ if(bUndo)
+ {
BegUndo();
- const sal_uInt32 nMarkAnz(rMark.GetMarkCount());
+ }
- if(nMarkAnz)
- {
- sal_uInt32 nm(0);
- std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
+ sal_uInt32 nm(0);
+ std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
- if( bUndo )
+ if(bUndo)
+ {
+ for(nm = rSdrObjectVector.size(); nm > 0;)
{
- for(nm = nMarkAnz; nm > 0;)
- {
- nm--;
- SdrMark* pM = rMark.GetMark(nm);
- SdrObject* pObj = pM->GetMarkedSdrObj();
-
- // extra undo actions for changed connector which now may hold it's layouted path (SJ)
- std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) );
- AddUndoActions( vConnectorUndoActions );
+ nm--;
+ SdrObject* pObj = rSdrObjectVector[nm];
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
- }
+ // extra undo actions for changed connector which now may hold it's layouted path (SJ)
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) );
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
}
+ }
- // Sicherstellen, dass die OrderNums stimmen:
- rMark.GetMark(0)->GetMarkedSdrObj()->GetOrdNum();
+ SdrObjectVector aRemoved3DObjects;
- std::vector< SdrObject* > aRemoved3DObjects;
+ for(nm = rSdrObjectVector.size(); nm > 0;)
+ {
+ nm--;
+ SdrObject* pObj = rSdrObjectVector[nm];
+ const bool bIs3D = dynamic_cast< E3dObject* >(pObj);
- for(nm = nMarkAnz; nm > 0;)
+ // set up a scene updater if object is a 3d object
+ if(bIs3D)
{
- nm--;
- SdrMark* pM = rMark.GetMark(nm);
- SdrObject* pObj = pM->GetMarkedSdrObj();
- SdrObjList* pOL = pObj->GetObjList(); //#52680#
- const sal_uInt32 nOrdNum(pObj->GetOrdNumDirect());
+ aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj));
+ }
+
+ SdrObjList* pParentList = pObj->getParentOfSdrObject();
+
+ if(pParentList)
+ {
+ pParentList->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+ }
- bool bIs3D = dynamic_cast< E3dObject* >(pObj);
- // set up a scene updater if object is a 3d object
+ if(!bUndo)
+ {
if(bIs3D)
{
- aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj));
+ aRemoved3DObjects.push_back( pObj ); // may be needed later
}
-
- pOL->RemoveObject(nOrdNum);
-
- if( !bUndo )
+ else
{
- if( bIs3D )
- aRemoved3DObjects.push_back( pObj ); // may be needed later
- else
- SdrObject::Free(pObj);
+ deleteSdrObjectSafeAndClearPointer(pObj);
}
}
+ }
- // fire scene updaters
- while(!aUpdaters.empty())
- {
- delete aUpdaters.back();
- aUpdaters.pop_back();
- }
+ // fire scene updaters
+ while(aUpdaters.size())
+ {
+ delete aUpdaters.back();
+ aUpdaters.pop_back();
+ }
- if( !bUndo )
+ if(!bUndo)
+ {
+ // now delete removed scene objects
+ while(aRemoved3DObjects.size())
{
- // now delete removed scene objects
- while(!aRemoved3DObjects.empty())
- {
- SdrObject::Free( aRemoved3DObjects.back() );
- aRemoved3DObjects.pop_back();
- }
+ deleteSdrObjectSafeAndClearPointer(aRemoved3DObjects.back());
+ aRemoved3DObjects.pop_back();
}
}
- if( bUndo )
+ if(bUndo)
+ {
EndUndo();
+ }
}
}
void SdrEditView::DeleteMarkedObj()
{
// #i110981# return when nothing is to be done at all
- if(!GetMarkedObjectCount())
+ if(!areSdrObjectsSelected())
{
return;
}
// moved breaking action and undo start outside loop
BrkAction();
- BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
+ SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ BegUndo(ImpGetResStr(STR_EditDelete), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_DELETE);
+ clearSdrObjectSelection();
// remove as long as something is selected. This allows to schedule objects for
// removal for a next run as needed
- while(GetMarkedObjectCount())
+ while(aSelection.size())
{
// vector to remember the parents which may be empty after object removal
- std::vector< SdrObject* > aParents;
+ ::std::set< SdrObject*, sdr::selection::IndicesComparator > aParents;
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- const sal_uInt32 nCount(rMarkList.GetMarkCount());
- sal_uInt32 a(0);
+ // in the first run, add all found parents, but only once
+ SdrObject* pObject = aSelection[a];
+ SdrObjList* pObjectsParentList = pObject->getParentOfSdrObject();
- for(a = 0; a < nCount; a++)
+ if(pObjectsParentList)
{
- // in the first run, add all found parents, but only once
- SdrMark* pMark = rMarkList.GetMark(a);
- SdrObject* pObject = pMark->GetMarkedSdrObj();
- SdrObject* pParent = pObject->GetObjList()->GetOwnerObj();
+ SdrObject* pParent = pObjectsParentList->getSdrObjectFromSdrObjList();
if(pParent)
{
- if(!aParents.empty())
- {
- std::vector< SdrObject* >::iterator aFindResult =
- std::find(aParents.begin(), aParents.end(), pParent);
-
- if(aFindResult == aParents.end())
- {
- aParents.push_back(pParent);
- }
- }
- else
- {
- aParents.push_back(pParent);
- }
+ aParents.insert(pParent);
}
}
+ }
- if(!aParents.empty())
+ if(!aParents.empty())
+ {
+ // in a 2nd run, remove all objects which may already be scheduled for
+ // removal. I am not sure if this can happen, but theoretically
+ // a to-be-removed object may already be the group/3DScene itself
+ for(sal_uInt32 b(0); !aParents.empty() && b < aSelection.size(); b++)
{
- // in a 2nd run, remove all objects which may already be scheduled for
- // removal. I am not sure if this can happen, but theoretically
- // a to-be-removed object may already be the group/3DScene itself
- for(a = 0; a < nCount; a++)
- {
- SdrMark* pMark = rMarkList.GetMark(a);
- SdrObject* pObject = pMark->GetMarkedSdrObj();
-
- std::vector< SdrObject* >::iterator aFindResult =
- std::find(aParents.begin(), aParents.end(), pObject);
-
- if(aFindResult != aParents.end())
- {
- aParents.erase(aFindResult);
- }
- }
+ aParents.erase(aSelection[b]);
}
}
// original stuff: remove selected objects. Handle clear will
// do something only once
- DeleteMarkedList(GetMarkedObjectList());
- GetMarkedObjectListWriteAccess().Clear();
- aHdl.Clear();
+ deleteSdrObjectsWithUndo(aSelection);
+ aSelection.clear();
- while(aParents.size() && !GetMarkedObjectCount())
+ while(!aParents.empty() && aSelection.empty())
{
// iterate over remembered parents
- SdrObject* pParent = aParents.back();
- aParents.pop_back();
+ SdrObject* pParent = *aParents.begin();
+ aParents.erase(aParents.begin());
- if(pParent->GetSubList() && 0 == pParent->GetSubList()->GetObjCount())
+ if(pParent->getChildrenOfSdrObject() && 0 == pParent->getChildrenOfSdrObject()->GetObjCount())
{
// we detected an empty parent, a candidate to leave group/3DScene
// if entered
- if(GetSdrPageView()->GetAktGroup()
- && GetSdrPageView()->GetAktGroup() == pParent)
+ if(GetSdrPageView()
+ && GetSdrPageView()->GetCurrentGroup()
+ && GetSdrPageView()->GetCurrentGroup() == pParent)
{
GetSdrPageView()->LeaveOneGroup();
}
// schedule empty parent for removal
- GetMarkedObjectListWriteAccess().InsertEntry(
- SdrMark(pParent, GetSdrPageView()));
+ aSelection.push_back(pParent);
}
}
}
// end undo and change messaging moved at the end
EndUndo();
- MarkListHasChanged();
}
void SdrEditView::CopyMarkedObj()
{
- SortMarkedObjects();
-
- SdrMarkList aSourceObjectsForCopy(GetMarkedObjectList());
- // Folgende Schleife Anstatt MarkList::Merge(), damit
- // ich jeweils mein Flag an die MarkEntries setzen kann.
- sal_uIntPtr nEdgeAnz = GetEdgesOfMarkedNodes().GetMarkCount();
- for (sal_uIntPtr nEdgeNum=0; nEdgeNum<nEdgeAnz; nEdgeNum++) {
- SdrMark aM(*GetEdgesOfMarkedNodes().GetMark(nEdgeNum));
- aM.SetUser(1);
- aSourceObjectsForCopy.InsertEntry(aM);
- }
- aSourceObjectsForCopy.ForceSort();
+ if(areSdrObjectsSelected() && GetSdrPageView() && GetSdrPageView()->GetCurrentObjectList())
+ {
+ // not only the selected SdrObjects are copied, but also SdrEdgeObjs which are
+ // connected to a selected SdrObject, thus add them to the selection. To be able to
+ // identify those later, keep them in a local set
+ SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const ::std::vector< SdrEdgeObj* > aConnectedSdrEdgeObjs(getAllSdrEdgeObjConnectedToSdrObjectVector(aSelection, false));
- // #i13033#
- // New mechanism to re-create the connections of cloned connectors
- CloneList aCloneList;
-
- const bool bUndo = IsUndoEnabled();
-
- GetMarkedObjectListWriteAccess().Clear();
- sal_uIntPtr nCloneErrCnt=0;
- sal_uIntPtr nMarkAnz=aSourceObjectsForCopy.GetMarkCount();
- sal_uIntPtr nm;
- for (nm=0; nm<nMarkAnz; nm++) {
- SdrMark* pM=aSourceObjectsForCopy.GetMark(nm);
- SdrObject* pO=pM->GetMarkedSdrObj()->Clone();
- if (pO!=NULL) {
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- pM->GetPageView()->GetObjList()->InsertObject(pO,CONTAINER_APPEND,&aReason);
-
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoCopyObject(*pO));
-
- SdrMark aME(*pM);
- aME.SetMarkedSdrObj(pO);
- aCloneList.AddPair(pM->GetMarkedSdrObj(), pO);
-
- if (pM->GetUser()==0)
+ // use a simple, just by address of SdrObject sorted set of extzra-selected SdrEdgeObjs
+ ::std::set< SdrEdgeObj*, sdr::selection::IndicesComparator > aSdrEdgeObjSet;
+
+ SdrObjectVector aNewSelection;
+ CloneList aCloneList;
+ sal_uInt32 nCloneErrCnt(0);
+ const bool bUndo(IsUndoEnabled());
+
+ if(aConnectedSdrEdgeObjs.size())
+ {
+ // add extra-selected SdrEdgeObjs to remember them
+ aSdrEdgeObjSet.insert(aConnectedSdrEdgeObjs.begin(), aConnectedSdrEdgeObjs.end());
+
+ // also add them to the selection. Set the selection once ang re-get it to have the
+ // correctly sorted order which the view wants to have
+ aSelection.insert(aSelection.begin(), aConnectedSdrEdgeObjs.begin(), aConnectedSdrEdgeObjs.end());
+ setSdrObjectSelection(aSelection);
+ aSelection = getSelectedSdrObjectVectorFromSdrMarkView();
+ }
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
+ {
+ SdrObject* pOriginal = aSelection[a];
+ SdrObject* pClone = pOriginal->CloneSdrObject();
+
+ if(pClone)
+ {
+ GetSdrPageView()->GetCurrentObjectList()->InsertObjectToSdrObjList(*pClone);
+
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoCopyObject(*pClone));
+ }
+
+ aCloneList.AddPair(pOriginal, pClone);
+ bool bNewSelection(aSdrEdgeObjSet.empty());
+
+ if(!bNewSelection)
+ {
+ SdrEdgeObj* pOriginalEdgeObj = dynamic_cast< SdrEdgeObj* >(pOriginal);
+
+ if(pOriginalEdgeObj)
+ {
+ if(0 == aSdrEdgeObjSet.count(pOriginalEdgeObj))
+ {
+ bNewSelection = true;
+ }
+ }
+ else
+ {
+ bNewSelection = true;
+ }
+ }
+
+ if(bNewSelection)
+ {
+ // add o new selection, else it was an extra-selected SdrEdgeObj which
+ // we do not want to have in the new selection
+ aNewSelection.push_back(pClone);
+ }
+ }
+ else
+ {
+ nCloneErrCnt++;
+ }
+ }
+
+ // New mechanism to re-create the connections of cloned connectors
+ aCloneList.CopyConnections();
+ setSdrObjectSelection(aNewSelection);
+
+ if(nCloneErrCnt)
+ {
+#ifdef DBG_UTIL
+ ByteString aStr("SdrEditView::CopyMarkedObj(): Error while cloning ");
+
+ if(nCloneErrCnt == 1)
+ {
+ aStr += "a SdrObject.";
+ }
+ else
{
- // Sonst war's nur eine mitzukierende Edge
- GetMarkedObjectListWriteAccess().InsertEntry(aME);
+ aStr += ByteString::CreateFromInt32( nCloneErrCnt );
+ aStr += " SdrObjects.";
}
- } else {
- nCloneErrCnt++;
+
+ aStr += " Connectors are not cloned.";
+ OSL_ENSURE(false, aStr.GetBuffer());
+#endif
}
+
}
+}
- // #i13033#
- // New mechanism to re-create the connections of cloned connectors
- aCloneList.CopyConnections();
+bool SdrEditView::InsertObjectAtView(SdrObject& rObj, sal_uInt32 nOptions)
+{
+ if(!GetSdrPageView() || !GetSdrPageView()->GetCurrentObjectList())
+ {
+ OSL_ENSURE(false, "InsertObjectAtView without target (!)");
+ deleteSdrObjectSafe( &rObj );
+ return false;
+ }
- if(0L != nCloneErrCnt)
+ if(!rObj.IsE3dObject())
{
-#ifdef DBG_UTIL
- ByteString aStr("SdrEditView::CopyMarkedObj(): Fehler beim Clonen ");
+ SdrObject* pParent = GetSdrPageView()->GetCurrentObjectList()->getSdrObjectFromSdrObjList();
- if(nCloneErrCnt == 1)
+ if(pParent && pParent->IsE3dObject())
{
- aStr += "eines Zeichenobjekts.";
+ OSL_ENSURE(false, "InsertObjectAtView non-3D to 3D parent (!)");
+ deleteSdrObjectSafe( &rObj );
+ return false;
}
- else
+ }
+
+ if(nOptions & SDRINSERT_SETDEFLAYER)
+ {
+ SdrLayerID nLayer(GetSdrPageView()->getSdrPageFromSdrPageView().GetPageLayerAdmin().GetLayerID(GetActiveLayer(), true));
+
+ if(SDRLAYER_NOTFOUND == nLayer)
{
- aStr += "von ";
- aStr += ByteString::CreateFromInt32( nCloneErrCnt );
- aStr += " Zeichenobjekten.";
+ nLayer = 0;
}
- aStr += " Objektverbindungen werden nicht mitkopiert.";
- DBG_ERROR(aStr.GetBuffer());
-#endif
- }
- MarkListHasChanged();
-}
+ if(GetSdrPageView()->GetLockedLayers().IsSet(nLayer) || !GetSdrPageView()->GetVisibleLayers().IsSet(nLayer))
+ {
+ deleteSdrObjectSafe( &rObj ); // Layer gesperrt oder nicht sichtbar
+ return false;
+ }
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ rObj.SetLayer(nLayer);
+ }
-sal_Bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uIntPtr nOptions)
-{
- if ((nOptions & SDRINSERT_SETDEFLAYER)!=0) {
- SdrLayerID nLayer=rPV.GetPage()->GetLayerAdmin().GetLayerID(aAktLayer,sal_True);
- if (nLayer==SDRLAYER_NOTFOUND) nLayer=0;
- if (rPV.GetLockedLayers().IsSet(nLayer) || !rPV.GetVisibleLayers().IsSet(nLayer)) {
- SdrObject::Free( pObj ); // Layer gesperrt oder nicht sichtbar
- return sal_False;
+ if(nOptions & SDRINSERT_SETDEFATTR)
+ {
+ if(GetDefaultStyleSheet())
+ {
+ rObj.SetStyleSheet(GetDefaultStyleSheet(), false);
}
- pObj->NbcSetLayer(nLayer);
+
+ rObj.SetMergedItemSet(GetDefaultAttr());
}
- if ((nOptions & SDRINSERT_SETDEFATTR)!=0) {
- if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet, sal_False);
- pObj->SetMergedItemSet(aDefaultAttr);
+
+ if(!rObj.IsObjectInserted())
+ {
+ GetSdrPageView()->GetCurrentObjectList()->InsertObjectToSdrObjList(rObj);
}
- if (!pObj->IsInserted()) {
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- if ((nOptions & SDRINSERT_NOBROADCAST)!=0) {
- rPV.GetObjList()->NbcInsertObject(pObj,CONTAINER_APPEND,&aReason);
- } else {
- rPV.GetObjList()->InsertObject(pObj,CONTAINER_APPEND,&aReason);
- }
+
+ if(IsUndoEnabled())
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(rObj));
}
- if( IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
- if ((nOptions & SDRINSERT_DONTMARK)==0) {
- if ((nOptions & SDRINSERT_ADDMARK)==0) UnmarkAllObj();
- MarkObj(pObj,&rPV);
+ if(0 == (nOptions & SDRINSERT_DONTMARK))
+ {
+ if(0 == (nOptions & SDRINSERT_ADDMARK))
+ {
+ UnmarkAllObj();
+ }
+
+ MarkObj(rObj);
}
- return sal_True;
+
+ return true;
}
-void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, sal_Bool bMark)
+void SdrEditView::ReplaceObjectAtView(SdrObject& rOldObj, SdrObject& rNewObj, bool bMark)
{
- SdrObjList* pOL=pOldObj->GetObjList();
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pOldObj,*pNewObj));
+ const bool bUndo(IsUndoEnabled());
+ SdrObjList* pOL = rOldObj.getParentOfSdrObject();
- if( IsObjMarked( pOldObj ) )
- MarkObj( pOldObj, &rPV, sal_True /*unmark!*/ );
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoReplaceObject(rOldObj, rNewObj));
+ }
+
+ if(IsObjMarked(rOldObj))
+ {
+ MarkObj(rOldObj, true /*unmark!*/ );
+ }
- pOL->ReplaceObject(pNewObj,pOldObj->GetOrdNum());
+ pOL->ReplaceObjectInSdrObjList(rNewObj, rOldObj.GetNavigationPosition());
- if( !bUndo )
- SdrObject::Free( pOldObj );
+ if(!bUndo )
+ {
+ deleteSdrObjectSafe( &rOldObj );
+ }
- if (bMark) MarkObj(pNewObj,&rPV);
+ if(bMark)
+ {
+ MarkObj(rNewObj);
+ }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-
-bool SdrEditView::IsUndoEnabled() const
-{
- return pMod->IsUndoEnabled();
-}
+// eof
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 392fa5327490..537afef44916 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -26,7 +26,6 @@
#include <svx/svdedtv.hxx>
#include <math.h>
-
#ifndef _MATH_H
#define _MATH_H
#endif
@@ -36,8 +35,8 @@
#include <svx/rectenum.hxx>
#include <svx/svxids.hrc> // fuer SID_ATTR_TRANSFORM_...
#include <svx/svdattr.hxx> // fuer Get/SetGeoAttr
-#include "svx/svditext.hxx"
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdpage.hxx>
@@ -55,253 +54,289 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/e3dsceneupdater.hxx>
#include <svx/obj3d.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrEditView::SetMarkedObjRect(const Rectangle& rRect, sal_Bool bCopy)
+void SdrEditView::SetMarkedObjSnapRange(const basegfx::B2DRange& rRange, bool bCopy)
{
- DBG_ASSERT(!rRect.IsEmpty(),"SetMarkedObjRect() mit leerem Rect mach keinen Sinn");
- if (rRect.IsEmpty()) return;
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- if (nAnz==0) return;
- Rectangle aR0(GetMarkedObjRect());
- DBG_ASSERT(!aR0.IsEmpty(),"SetMarkedObjRect(): GetMarkedObjRect() ist leer");
- if (aR0.IsEmpty()) return;
- long x0=aR0.Left();
- long y0=aR0.Top();
- long w0=aR0.Right()-x0;
- long h0=aR0.Bottom()-y0;
- long x1=rRect.Left();
- long y1=rRect.Top();
- long w1=rRect.Right()-x1;
- long h1=rRect.Bottom()-y1;
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditPosSize,aStr);
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
-
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
- BegUndo(aStr);
-
- if (bCopy)
- CopyMarkedObj();
-
- for (sal_uIntPtr nm=0; nm<nAnz; nm++)
+ if(!rRange.isEmpty() && areSdrObjectsSelected())
{
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- if( bUndo )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const basegfx::B2DRange& rCurrentRange(getMarkedObjectSnapRange());
- Rectangle aR1(pO->GetSnapRect());
- if (!aR1.IsEmpty())
+ if(!rCurrentRange.equal(rRange))
{
- if (aR1==aR0)
+ String aStr;
+ TakeMarkedDescriptionString(STR_EditPosSize, aStr);
+
+ if(bCopy)
{
- aR1=rRect;
+ aStr += ImpGetResStr(STR_EditWithCopy);
}
- else
- { // aR1 von aR0 nach rRect transformieren
- aR1.Move(-x0,-y0);
- BigInt l(aR1.Left());
- BigInt r(aR1.Right());
- BigInt t(aR1.Top());
- BigInt b(aR1.Bottom());
- if (w0!=0) {
- l*=w1; l/=w0;
- r*=w1; r/=w0;
- } else {
- l=0; r=w1;
- }
- if (h0!=0) {
- t*=h1; t/=h0;
- b*=h1; b/=h0;
- } else {
- t=0; b=h1;
+
+ const bool bUndo(IsUndoEnabled());
+
+ if(bUndo)
+ {
+ BegUndo(aStr);
+ }
+
+ if(bCopy)
+ {
+ CopyMarkedObj();
+ aSelection = getSelectedSdrObjectVectorFromSdrMarkView();
+ }
+
+ basegfx::B2DHomMatrix aTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rCurrentRange.getRange(),
+ rCurrentRange.getMinimum()));
+ aTransformation.invert();
+ aTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRange.getRange(),
+ rRange.getMinimum()) * aTransformation;
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
+
+ if(bUndo)
+ {
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
}
- aR1.Left ()=long(l);
- aR1.Right ()=long(r);
- aR1.Top ()=long(t);
- aR1.Bottom()=long(b);
- aR1.Move(x1,y1);
+
+ sdr::legacy::transformSdrObject(*pO, aTransformation);
+ }
+
+ if(bUndo)
+ {
+ EndUndo();
}
- pO->SetSnapRect(aR1);
- } else {
- DBG_ERROR("SetMarkedObjRect(): pObj->GetSnapRect() liefert leeres Rect");
}
}
- if( bUndo )
- EndUndo();
}
-std::vector< SdrUndoAction* > SdrEditView::CreateConnectorUndo( SdrObject& rO )
+std::vector< SdrUndoAction* > SdrEditView::CreateConnectorUndo(SdrObject& rO)
{
std::vector< SdrUndoAction* > vUndoActions;
+ ::std::vector< SdrEdgeObj* > aConnectedEdges(rO.getAllConnectedSdrEdgeObj());
- if ( rO.GetBroadcaster() )
+ if(!aConnectedEdges.empty())
{
- const SdrPage* pPage = rO.GetPage();
- if ( pPage )
+ for(sal_uInt32 a(0); a < aConnectedEdges.size(); a++)
{
- SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
- while( aIter.IsMore() )
- {
- SdrObject* pPartObj = aIter.Next();
- if ( pPartObj->ISA( SdrEdgeObj ) )
- {
- if ( ( pPartObj->GetConnectedNode( sal_False ) == &rO ) ||
- ( pPartObj->GetConnectedNode( sal_True ) == &rO ) )
- {
- vUndoActions.push_back( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject( *pPartObj ) );
- }
- }
- }
+ vUndoActions.push_back(
+ getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*aConnectedEdges[a]));
}
}
+
return vUndoActions;
}
void SdrEditView::AddUndoActions( std::vector< SdrUndoAction* >& rUndoActions )
{
std::vector< SdrUndoAction* >::iterator aUndoActionIter( rUndoActions.begin() );
+
while( aUndoActionIter != rUndoActions.end() )
+ {
AddUndo( *aUndoActionIter++ );
+ }
}
-void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
+void SdrEditView::MoveMarkedObj(const basegfx::B2DVector& rOffset, bool bCopy)
{
- const bool bUndo = IsUndoEnabled();
-
- if( bUndo )
+ if(areSdrObjectsSelected() && !rOffset.equalZero())
{
- XubString aStr(ImpGetResStr(STR_EditMove));
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
- // benoetigt eigene UndoGroup wegen Parameter
- BegUndo(aStr,GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_MOVE);
- }
+ const bool bUndo(IsUndoEnabled());
+
+ if(bUndo)
+ {
+ XubString aStr(ImpGetResStr(STR_EditMove));
- if (bCopy)
- CopyMarkedObj();
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- if( bUndo )
+ // benoetigt eigene UndoGroup wegen Parameter
+ BegUndo(aStr, getSelectionDescription(getSelectedSdrObjectVectorFromSdrMarkView()), SDRREPFUNC_OBJ_MOVE);
+ }
+
+ if(bCopy)
{
- std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
- AddUndoActions( vConnectorUndoActions );
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pO,rSiz));
+ CopyMarkedObj();
}
- pO->Move(rSiz);
- }
- if( bUndo )
- EndUndo();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ basegfx::B2DHomMatrix aTransformation(basegfx::tools::createTranslateB2DHomMatrix(rOffset));
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
+
+ if(bUndo)
+ {
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
+
+ sdr::legacy::transformSdrObject(*pO, aTransformation);
+ }
+
+ if(bUndo)
+ {
+ EndUndo();
+ }
+ }
}
-void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy)
+void SdrEditView::ResizeMarkedObj(const basegfx::B2DPoint& rRefPoint, const basegfx::B2DTuple& rScale, bool bCopy)
{
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
+ if(areSdrObjectsSelected() && !rScale.equalZero())
{
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditResize,aStr);
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr);
- }
+ const bool bUndo(IsUndoEnabled());
+
+ if(bUndo)
+ {
+ XubString aStr;
- if (bCopy)
- CopyMarkedObj();
+ TakeMarkedDescriptionString(STR_EditResize,aStr);
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- if( bUndo )
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
+
+ BegUndo(aStr);
+ }
+
+ if(bCopy)
{
- std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
- AddUndoActions( vConnectorUndoActions );
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ CopyMarkedObj();
}
- pO->Resize(rRef,xFact,yFact);
- }
- if( bUndo )
- EndUndo();
+ basegfx::B2DHomMatrix aTransformation;
+
+ if(rRefPoint.equalZero())
+ {
+ aTransformation = basegfx::tools::createScaleB2DHomMatrix(rScale);
+ }
+ else
+ {
+ aTransformation.translate(-rRefPoint);
+ aTransformation.scale(rScale);
+ aTransformation.translate(rRefPoint);
+ }
+
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
+
+ if(bUndo)
+ {
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
+
+ sdr::legacy::transformSdrObject(*pO, aTransformation);
+ }
+
+ if(bUndo)
+ {
+ EndUndo();
+ }
+ }
}
-long SdrEditView::GetMarkedObjRotate() const
+double SdrEditView::GetMarkedObjRotate() const
{
- sal_Bool b1st=sal_True;
- sal_Bool bOk=sal_True;
- long nWink=0;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz && bOk; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- long nWink2=pO->GetRotateAngle();
- if (b1st) nWink=nWink2;
- else if (nWink2!=nWink) bOk=sal_False;
- b1st=sal_False;
+ double fRetval(0.0);
+
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
+ {
+ SdrObject* pObject = aSelection[a];
+
+ if(a)
+ {
+ const double fNew(pObject->getSdrObjectRotate());
+
+ if(!basegfx::fTools::equal(fNew, fRetval))
+ {
+ return 0.0;
+ }
+ }
+ else
+ {
+ fRetval = pObject->getSdrObjectRotate();
+ }
+ }
}
- if (!bOk) nWink=0;
- return nWink;
+
+ return fRetval;
}
-void SdrEditView::RotateMarkedObj(const Point& rRef, long nWink, bool bCopy)
+void SdrEditView::RotateMarkedObj(const basegfx::B2DPoint& rRefPoint, double fAngle, bool bCopy)
{
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
+ if(areSdrObjectsSelected() && (bCopy || !basegfx::fTools::equalZero(fAngle)))
{
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditRotate,aStr);
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr);
- }
+ const bool bUndo(IsUndoEnabled());
- if (bCopy)
- CopyMarkedObj();
+ if(bUndo)
+ {
+ XubString aStr;
- double nSin=sin(nWink*nPi180);
- double nCos=cos(nWink*nPi180);
- const sal_uInt32 nMarkAnz(GetMarkedObjectCount());
+ TakeMarkedDescriptionString(STR_EditRotate,aStr);
+
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
+
+ BegUndo(aStr);
+ }
+
+ if(bCopy)
+ {
+ CopyMarkedObj();
+ }
- if(nMarkAnz)
- {
std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
+ basegfx::B2DHomMatrix aTransformation;
- for(sal_uInt32 nm(0); nm < nMarkAnz; nm++)
+ if(rRefPoint.equalZero())
{
- SdrMark* pM = GetSdrMarkByIndex(nm);
- SdrObject* pO = pM->GetMarkedSdrObj();
+ aTransformation = basegfx::tools::createRotateB2DHomMatrix(fAngle);
+ }
+ else
+ {
+ aTransformation.translate(-rRefPoint);
+ aTransformation.rotate(fAngle);
+ aTransformation.translate(rRefPoint);
+ }
- if( bUndo )
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
+
+ if(bUndo)
{
// extra undo actions for changed connector which now may hold it's layouted path (SJ)
std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
AddUndoActions( vConnectorUndoActions );
-
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
}
// set up a scene updater if object is a 3d object
@@ -310,50 +345,79 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nWink, bool bCopy)
aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pO));
}
- pO->Rotate(rRef,nWink,nSin,nCos);
+ sdr::legacy::transformSdrObject(*pO, aTransformation);
}
// fire scene updaters
- while(!aUpdaters.empty())
+ while(aUpdaters.size())
{
delete aUpdaters.back();
aUpdaters.pop_back();
}
- }
- if( bUndo )
- EndUndo();
+ if(bUndo)
+ {
+ EndUndo();
+ }
+ }
}
-void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy)
+void SdrEditView::MirrorMarkedObj(const basegfx::B2DPoint& rRef1, const basegfx::B2DPoint& rRef2, bool bCopy)
{
- const bool bUndo = IsUndoEnabled();
-
- if( bUndo )
+ if(areSdrObjectsSelected() && !rRef1.equal(rRef2))
{
- XubString aStr;
- Point aDif(rRef2-rRef1);
- if (aDif.X()==0) ImpTakeDescriptionStr(STR_EditMirrorHori,aStr);
- else if (aDif.Y()==0) ImpTakeDescriptionStr(STR_EditMirrorVert,aStr);
- else if (Abs(aDif.X())==Abs(aDif.Y())) ImpTakeDescriptionStr(STR_EditMirrorDiag,aStr);
- else ImpTakeDescriptionStr(STR_EditMirrorFree,aStr);
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr);
- }
+ const bool bUndo(IsUndoEnabled());
+ const basegfx::B2DVector aMirrorEdge(rRef2 - rRef1);
+
+ if(bUndo)
+ {
+ XubString aStr;
- if (bCopy)
- CopyMarkedObj();
+ if(basegfx::fTools::equalZero(aMirrorEdge.getX()))
+ {
+ TakeMarkedDescriptionString(STR_EditMirrorHori,aStr);
+ }
+ else if(basegfx::fTools::equalZero(aMirrorEdge.getY()))
+ {
+ TakeMarkedDescriptionString(STR_EditMirrorVert,aStr);
+ }
+ else if(basegfx::fTools::equal(fabs(aMirrorEdge.getX()), fabs(aMirrorEdge.getY())))
+ {
+ TakeMarkedDescriptionString(STR_EditMirrorDiag,aStr);
+ }
+ else
+ {
+ TakeMarkedDescriptionString(STR_EditMirrorFree,aStr);
+ }
- const sal_uInt32 nMarkAnz(GetMarkedObjectCount());
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
+
+ BegUndo(aStr);
+ }
+
+ if (bCopy)
+ {
+ CopyMarkedObj();
+ }
+
+ const double fAngleToXAxis(atan2(aMirrorEdge.getY(), aMirrorEdge.getX()));
+ basegfx::B2DHomMatrix aTransformation;
+
+ aTransformation.translate(-rRef1);
+ aTransformation.rotate(-fAngleToXAxis);
+ aTransformation.scale(1.0, -1.0);
+ aTransformation.rotate(fAngleToXAxis);
+ aTransformation.translate(rRef1);
- if(nMarkAnz)
- {
std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for(sal_uInt32 nm(0); nm < nMarkAnz; nm++)
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- SdrMark* pM = GetSdrMarkByIndex(nm);
- SdrObject* pO = pM->GetMarkedSdrObj();
+ SdrObject* pO = aSelection[nm];
if( bUndo )
{
@@ -361,7 +425,7 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b
std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
AddUndoActions( vConnectorUndoActions );
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
}
// set up a scene updater if object is a 3d object
@@ -370,554 +434,851 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b
aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pO));
}
- pO->Mirror(rRef1,rRef2);
+ sdr::legacy::transformSdrObject(*pO, aTransformation);
}
// fire scene updaters
- while(!aUpdaters.empty())
+ while(aUpdaters.size())
{
delete aUpdaters.back();
aUpdaters.pop_back();
}
- }
- if( bUndo )
- EndUndo();
+ if(bUndo)
+ {
+ EndUndo();
+ }
+ }
}
-void SdrEditView::MirrorMarkedObjHorizontal(sal_Bool bCopy)
+void SdrEditView::MirrorMarkedObjHorizontal(bool bCopy)
{
- Point aCenter(GetMarkedObjRect().Center());
- Point aPt2(aCenter);
- aPt2.Y()++;
- MirrorMarkedObj(aCenter,aPt2,bCopy);
-}
+ if(areSdrObjectsSelected())
+ {
+ const basegfx::B2DRange& rCurrentRange(getMarkedObjectSnapRange());
-void SdrEditView::MirrorMarkedObjVertical(sal_Bool bCopy)
-{
- Point aCenter(GetMarkedObjRect().Center());
- Point aPt2(aCenter);
- aPt2.X()++;
- MirrorMarkedObj(aCenter,aPt2,bCopy);
+ MirrorMarkedObj(
+ basegfx::B2DPoint(rCurrentRange.getCenterX(), rCurrentRange.getMinY()),
+ basegfx::B2DPoint(rCurrentRange.getCenterX(), rCurrentRange.getMaxY()),
+ bCopy);
+ }
}
-long SdrEditView::GetMarkedObjShear() const
+void SdrEditView::MirrorMarkedObjVertical(bool bCopy)
{
- sal_Bool b1st=sal_True;
- sal_Bool bOk=sal_True;
- long nWink=0;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz && bOk; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- long nWink2=pO->GetShearAngle();
- if (b1st) nWink=nWink2;
- else if (nWink2!=nWink) bOk=sal_False;
- b1st=sal_False;
+ if(areSdrObjectsSelected())
+ {
+ const basegfx::B2DRange& rCurrentRange(getMarkedObjectSnapRange());
+
+ MirrorMarkedObj(
+ basegfx::B2DPoint(rCurrentRange.getMinX(), rCurrentRange.getCenterY()),
+ basegfx::B2DPoint(rCurrentRange.getMaxX(), rCurrentRange.getCenterY()),
+ bCopy);
}
- if (nWink>SDRMAXSHEAR) nWink=SDRMAXSHEAR;
- if (nWink<-SDRMAXSHEAR) nWink=-SDRMAXSHEAR;
- if (!bOk) nWink=0;
- return nWink;
}
-void SdrEditView::ShearMarkedObj(const Point& rRef, long nWink, bool bVShear, bool bCopy)
+double SdrEditView::GetMarkedObjShearX() const
{
- const bool bUndo = IsUndoEnabled();
+ double fRetval(0.0);
- if( bUndo )
+ if(areSdrObjectsSelected())
{
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditShear,aStr);
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr);
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
+ {
+ SdrObject* pObject = aSelection[a];
+
+ if(a)
+ {
+ const double fNew(pObject->getSdrObjectShearX());
+
+ if(!basegfx::fTools::equal(fNew, fRetval))
+ {
+ return 0.0;
+ }
+ }
+ else
+ {
+ fRetval = pObject->getSdrObjectShearX();
+ }
+ }
+
+ const double fMaxShearRange(F_PI2 * (89.0/90.0));
+ fRetval = basegfx::clamp(fRetval, -fMaxShearRange, fMaxShearRange);
}
- if (bCopy)
- CopyMarkedObj();
+ return fRetval;
+}
- double nTan=tan(nWink*nPi180);
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
+void SdrEditView::ShearMarkedObj(const basegfx::B2DPoint& rRefPoint, double fAngle, bool bVShear, bool bCopy)
+{
+ if(areSdrObjectsSelected() && !basegfx::fTools::equalZero(fAngle))
{
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- if( bUndo )
+ const bool bUndo(IsUndoEnabled());
+
+ if(bUndo)
+ {
+ XubString aStr;
+
+ TakeMarkedDescriptionString(STR_EditShear,aStr);
+
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
+
+ BegUndo(aStr);
+ }
+
+ if(bCopy)
{
- std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
- AddUndoActions( vConnectorUndoActions );
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ CopyMarkedObj();
}
- pO->Shear(rRef,nWink,nTan,bVShear);
- }
- if( bUndo )
- EndUndo();
+ basegfx::B2DHomMatrix aTransformation;
+
+ if(rRefPoint.equalZero())
+ {
+ if(bVShear)
+ {
+ aTransformation = basegfx::tools::createShearYB2DHomMatrix(tan(fAngle));
+ }
+ else
+ {
+ aTransformation = basegfx::tools::createShearXB2DHomMatrix(tan(fAngle));
+ }
+ }
+ else
+ {
+ aTransformation.translate(-rRefPoint);
+
+ if(bVShear)
+ {
+ aTransformation.shearY(tan(fAngle));
+ }
+ else
+ {
+ aTransformation.shearX(tan(fAngle));
+ }
+
+ aTransformation.translate(rRefPoint);
+ }
+
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
+
+ if(bUndo)
+ {
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pO ) );
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
+
+ sdr::legacy::transformSdrObject(*pO, aTransformation);
+ }
+
+ if(bUndo)
+ {
+ EndUndo();
+ }
+ }
}
-void SdrEditView::ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRad,
- SdrCrookMode eMode, sal_Bool bVertical, sal_Bool bNoContortion, sal_Bool bRotate, const Rectangle& rMarkRect)
+void SdrEditView::ImpCrookObj(SdrObject& rO, const basegfx::B2DPoint& rRef, const basegfx::B2DPoint& rRad,
+ SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bRotate, const basegfx::B2DRange& rMarkRange)
{
- SdrPathObj* pPath=PTR_CAST(SdrPathObj,pO);
- sal_Bool bDone = sal_False;
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(&rO);
+ bool bDone(false);
- if(pPath!=NULL && !bNoContortion)
+ if(pPath && !bNoContortion)
{
- XPolyPolygon aXPP(pPath->GetPathPoly());
- switch (eMode) {
- case SDRCROOK_ROTATE : CrookRotatePoly (aXPP,rRef,rRad,bVertical); break;
- case SDRCROOK_SLANT : CrookSlantPoly (aXPP,rRef,rRad,bVertical); break;
- case SDRCROOK_STRETCH: CrookStretchPoly(aXPP,rRef,rRad,bVertical,rMarkRect); break;
- } // switch
- pPath->SetPathPoly(aXPP.getB2DPolyPolygon());
- bDone = sal_True;
+ basegfx::B2DPolyPolygon aPolyPolygon(pPath->getB2DPolyPolygonInObjectCoordinates());
+
+ switch(eMode)
+ {
+ case SDRCROOK_ROTATE : CrookRotatePoly(aPolyPolygon, rRef, rRad, bVertical); break;
+ case SDRCROOK_SLANT : CrookSlantPoly(aPolyPolygon, rRef, rRad, bVertical); break;
+ case SDRCROOK_STRETCH: CrookStretchPoly(aPolyPolygon, rRef, rRad, bVertical, rMarkRange); break;
+ }
+
+ pPath->setB2DPolyPolygonInObjectCoordinates(aPolyPolygon);
+ bDone = true;
}
- if(!bDone && !pPath && pO->IsPolyObj() && 0L != pO->GetPointCount())
+ if(!bDone && !pPath && rO.IsPolygonObject() && rO.GetObjectPointCount())
{
// FuerPolyObj's, aber NICHT fuer SdrPathObj's, z.B. fuer's Bemassungsobjekt
- sal_uInt32 nPtAnz(pO->GetPointCount());
- XPolygon aXP((sal_uInt16)nPtAnz);
+ const sal_uInt32 nPtAnz(rO.GetObjectPointCount());
+ basegfx::B2DPolygon aPolygon;
sal_uInt32 nPtNum;
- for(nPtNum = 0L; nPtNum < nPtAnz; nPtNum++)
+ for(nPtNum = 0; nPtNum < nPtAnz; nPtNum++)
{
- Point aPt(pO->GetPoint(nPtNum));
- aXP[(sal_uInt16)nPtNum]=aPt;
+ aPolygon.append(rO.GetObjectPoint(nPtNum));
}
switch (eMode)
{
- case SDRCROOK_ROTATE : CrookRotatePoly (aXP,rRef,rRad,bVertical); break;
- case SDRCROOK_SLANT : CrookSlantPoly (aXP,rRef,rRad,bVertical); break;
- case SDRCROOK_STRETCH: CrookStretchPoly(aXP,rRef,rRad,bVertical,rMarkRect); break;
+ case SDRCROOK_ROTATE : CrookRotatePoly(aPolygon, rRef, rRad, bVertical); break;
+ case SDRCROOK_SLANT : CrookSlantPoly(aPolygon, rRef, rRad, bVertical); break;
+ case SDRCROOK_STRETCH: CrookStretchPoly(aPolygon, rRef, rRad, bVertical, rMarkRange); break;
}
- for(nPtNum = 0L; nPtNum < nPtAnz; nPtNum++)
+ for(nPtNum = 0; nPtNum < nPtAnz; nPtNum++)
{
- // hier koennte man vieleicht auch mal das Broadcasting optimieren
- // ist aber z.Zt. bei den 2 Punkten des Bemassungsobjekts noch nicht so tragisch
- pO->SetPoint(aXP[(sal_uInt16)nPtNum],nPtNum);
+ rO.SetObjectPoint(aPolygon.getB2DPoint(nPtNum), nPtNum);
}
- bDone = sal_True;
+ bDone = true;
}
if(!bDone)
{
// Fuer alle anderen oder wenn bNoContortion
- Point aCtr0(pO->GetSnapRect().Center());
- Point aCtr1(aCtr0);
- sal_Bool bRotOk(sal_False);
+ const basegfx::B2DPoint aCtr0(sdr::legacy::GetSnapRange(rO).getCenter());
+ basegfx::B2DPoint aCtr1(aCtr0);
+ bool bRotOk(false);
double nSin(0.0), nCos(1.0);
- double nWink(0.0);
+ double fAngle(0.0);
- if(0 != rRad.X() && 0 != rRad.Y())
+ if(!rRad.equalZero())
{
bRotOk = bRotate;
switch (eMode)
{
- case SDRCROOK_ROTATE : nWink=CrookRotateXPoint (aCtr1,NULL,NULL,rRef,rRad,nSin,nCos,bVertical); bRotOk=bRotate; break;
- case SDRCROOK_SLANT : nWink=CrookSlantXPoint (aCtr1,NULL,NULL,rRef,rRad,nSin,nCos,bVertical); break;
- case SDRCROOK_STRETCH: nWink=CrookStretchXPoint(aCtr1,NULL,NULL,rRef,rRad,nSin,nCos,bVertical,rMarkRect); break;
+ case SDRCROOK_ROTATE : fAngle = CrookRotateXPoint(aCtr1, 0, 0, rRef, rRad, nSin, nCos, bVertical); bRotOk = bRotate; break;
+ case SDRCROOK_SLANT : fAngle = CrookSlantXPoint(aCtr1, 0, 0, rRef, rRad, nSin, nCos, bVertical); break;
+ case SDRCROOK_STRETCH: fAngle = CrookStretchXPoint(aCtr1, 0, 0, rRef, rRad, nSin, nCos, bVertical, rMarkRange); break;
}
}
- aCtr1 -= aCtr0;
+ basegfx::B2DHomMatrix aObjectTransform;
if(bRotOk)
- pO->Rotate(aCtr0, Round(nWink/nPi180), nSin, nCos);
+ {
+ aObjectTransform.translate(-aCtr0);
+ aObjectTransform.rotate(fAngle);
+ aObjectTransform.translate(aCtr0);
+ }
+
+ aObjectTransform.translate(aCtr1 - aCtr0);
- pO->Move(Size(aCtr1.X(),aCtr1.Y()));
+ sdr::legacy::transformSdrObject(rO, aObjectTransform);
}
}
-void SdrEditView::CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookMode eMode,
+void SdrEditView::CrookMarkedObj(const basegfx::B2DPoint& rRef, const basegfx::B2DPoint& rRad, SdrCrookMode eMode,
bool bVertical, bool bNoContortion, bool bCopy)
{
- Rectangle aMarkRect(GetMarkedObjRect());
- const bool bUndo = IsUndoEnabled();
+ if(areSdrObjectsSelected())
+ {
+ SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const basegfx::B2DRange& rMarkRange(getMarkedObjectSnapRange());
+ const bool bUndo(IsUndoEnabled());
+ const bool bRotate(bNoContortion && SDRCROOK_ROTATE == eMode && IsRotateAllowed(false));
+
+ if(bUndo)
+ {
+ XubString aStr;
- bool bRotate=bNoContortion && eMode==SDRCROOK_ROTATE && IsRotateAllowed(sal_False);
+ TakeMarkedDescriptionString(bNoContortion ? STR_EditCrook : STR_EditCrookContortion, aStr);
- if( bUndo )
- {
- XubString aStr;
- ImpTakeDescriptionStr(bNoContortion?STR_EditCrook:STR_EditCrookContortion,aStr);
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr);
- }
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
- if (bCopy)
- CopyMarkedObj();
+ BegUndo(aStr);
+ }
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- if( bUndo )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ if(bCopy)
+ {
+ CopyMarkedObj();
+ aSelection = getSelectedSdrObjectVectorFromSdrMarkView();
+ }
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
- const SdrObjList* pOL=pO->GetSubList();
- if (bNoContortion || pOL==NULL) {
- ImpCrookObj(pO,rRef,rRad,eMode,bVertical,bNoContortion,bRotate,aMarkRect);
- } else {
- SdrObjListIter aIter(*pOL,IM_DEEPNOGROUPS);
- while (aIter.IsMore()) {
- SdrObject* pO1=aIter.Next();
- ImpCrookObj(pO1,rRef,rRad,eMode,bVertical,bNoContortion,bRotate,aMarkRect);
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
+
+ const SdrObjList* pOL = pO->getChildrenOfSdrObject();
+
+ if(bNoContortion || !pOL)
+ {
+ ImpCrookObj(*pO, rRef, rRad, eMode, bVertical, bNoContortion, bRotate, rMarkRange);
+ }
+ else
+ {
+ SdrObjListIter aIter(*pOL, IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ SdrObject* pO1 = aIter.Next();
+
+ ImpCrookObj(*pO1, rRef, rRad, eMode, bVertical, bNoContortion, bRotate, rMarkRange);
+ }
}
}
- }
- if( bUndo )
- EndUndo();
+ if(bUndo)
+ {
+ EndUndo();
+ }
+ }
}
-void SdrEditView::ImpDistortObj(SdrObject* pO, const Rectangle& rRef, const XPolygon& rDistortedRect, sal_Bool bNoContortion)
+void SdrEditView::ImpDistortObj(SdrObject& rO, const basegfx::B2DRange& rRefRange, const basegfx::B2DPolygon& rDistortedPolygon, bool bNoContortion)
{
- SdrPathObj* pPath = PTR_CAST(SdrPathObj, pO);
-
- if(!bNoContortion && pPath)
+ if(rDistortedPolygon.count() > 3)
{
- XPolyPolygon aXPP(pPath->GetPathPoly());
- aXPP.Distort(rRef, rDistortedRect);
- pPath->SetPathPoly(aXPP.getB2DPolyPolygon());
- }
- else if(pO->IsPolyObj())
- {
- // z.B. fuer's Bemassungsobjekt
- sal_uInt32 nPtAnz(pO->GetPointCount());
- XPolygon aXP((sal_uInt16)nPtAnz);
- sal_uInt32 nPtNum;
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(&rO);
- for(nPtNum = 0L; nPtNum < nPtAnz; nPtNum++)
+ if(!bNoContortion && pPath)
{
- Point aPt(pO->GetPoint(nPtNum));
- aXP[(sal_uInt16)nPtNum]=aPt;
+ const basegfx::B2DPolyPolygon aPolyPolygon(
+ basegfx::tools::distort(
+ pPath->getB2DPolyPolygonInObjectCoordinates(),
+ rRefRange,
+ rDistortedPolygon.getB2DPoint(0), // TopLeft
+ rDistortedPolygon.getB2DPoint(1), // rTopRight
+ rDistortedPolygon.getB2DPoint(3), // rBottomLeft
+ rDistortedPolygon.getB2DPoint(2))); // rBottomRight
+
+ pPath->setB2DPolyPolygonInObjectCoordinates(aPolyPolygon);
}
+ else if(rO.IsPolygonObject())
+ {
+ // z.B. fuer's Bemassungsobjekt
+ const sal_uInt32 nPtAnz(rO.GetObjectPointCount());
+ basegfx::B2DPolygon aPolygon;
- aXP.Distort(rRef, rDistortedRect);
+ for(sal_uInt32 a(0); a < nPtAnz; a++)
+ {
+ aPolygon.append(rO.GetObjectPoint(a));
+ }
- for(nPtNum = 0L; nPtNum < nPtAnz; nPtNum++)
- {
- // hier koennte man vieleicht auch mal das Broadcasting optimieren
- // ist aber z.Zt. bei den 2 Punkten des Bemassungsobjekts noch nicht so tragisch
- pO->SetPoint(aXP[(sal_uInt16)nPtNum],nPtNum);
+ aPolygon = basegfx::tools::distort(
+ aPolygon,
+ rRefRange,
+ rDistortedPolygon.getB2DPoint(0), // TopLeft
+ rDistortedPolygon.getB2DPoint(1), // rTopRight
+ rDistortedPolygon.getB2DPoint(3), // rBottomLeft
+ rDistortedPolygon.getB2DPoint(2)); // rBottomRight
+
+ for(sal_uInt32 b(0); b < nPtAnz; b++)
+ {
+ rO.SetObjectPoint(aPolygon.getB2DPoint(b), b);
+ }
}
}
+ else
+ {
+ OSL_ENSURE(false, "SdrEditView::ImpDistortObj: DistortedPolygon needs to have four corner points (!)");
+ }
}
-void SdrEditView::DistortMarkedObj(const Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion, bool bCopy)
+void SdrEditView::DistortMarkedObj(const basegfx::B2DRange& rRefRange, const basegfx::B2DPolygon& rDistortedRect, bool bNoContortion, bool bCopy)
{
- const bool bUndo = IsUndoEnabled();
-
- if( bUndo )
+ if(areSdrObjectsSelected())
{
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditDistort,aStr);
- if (bCopy)
- aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr);
- }
+ const bool bUndo(IsUndoEnabled());
+
+ if(bUndo)
+ {
+ XubString aStr;
- if (bCopy)
- CopyMarkedObj();
+ TakeMarkedDescriptionString(STR_EditDistort, aStr);
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- if( bUndo )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
-
- Rectangle aRefRect(rRef);
- XPolygon aRefPoly(rDistortedRect);
- const SdrObjList* pOL=pO->GetSubList();
- if (bNoContortion || pOL==NULL) {
- ImpDistortObj(pO,aRefRect,aRefPoly,bNoContortion);
- } else {
- SdrObjListIter aIter(*pOL,IM_DEEPNOGROUPS);
- while (aIter.IsMore()) {
- SdrObject* pO1=aIter.Next();
- ImpDistortObj(pO1,aRefRect,aRefPoly,bNoContortion);
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
}
+
+ BegUndo(aStr);
+ }
+
+ if(bCopy)
+ {
+ CopyMarkedObj();
+ }
+
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pO = aSelection[nm];
+
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
+
+ const SdrObjList* pOL = pO->getChildrenOfSdrObject();
+
+ if(bNoContortion || !pOL)
+ {
+ ImpDistortObj(*pO, rRefRange, rDistortedRect, bNoContortion);
+ }
+ else
+ {
+ SdrObjListIter aIter(*pOL, IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ SdrObject* pO1 = aIter.Next();
+
+ ImpDistortObj(*pO1, rRefRange, rDistortedRect, bNoContortion);
+ }
+ }
+ }
+
+ if(bUndo)
+ {
+ EndUndo();
}
}
- if( bUndo )
- EndUndo();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr, sal_Bool /*bReplaceAll*/)
+void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr, bool /*bReplaceAll*/)
{
- // bReplaceAll hat hier keinerlei Wirkung
- Rectangle aAllSnapRect(GetMarkedObjRect());
- const SfxPoolItem *pPoolItem=NULL;
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrTransformRef1XItem*)pPoolItem)->GetValue();
- SetRef1(Point(n,GetRef1().Y()));
- }
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrTransformRef1YItem*)pPoolItem)->GetValue();
- SetRef1(Point(GetRef1().X(),n));
- }
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrTransformRef2XItem*)pPoolItem)->GetValue();
- SetRef2(Point(n,GetRef2().Y()));
- }
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrTransformRef2YItem*)pPoolItem)->GetValue();
- SetRef2(Point(GetRef2().X(),n));
- }
- long nAllPosX=0; sal_Bool bAllPosX=sal_False;
- long nAllPosY=0; sal_Bool bAllPosY=sal_False;
- long nAllWdt=0; sal_Bool bAllWdt=sal_False;
- long nAllHgt=0; sal_Bool bAllHgt=sal_False;
- sal_Bool bDoIt=sal_False;
- if (rAttr.GetItemState(SDRATTR_ALLPOSITIONX,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- nAllPosX=((const SdrAllPositionXItem*)pPoolItem)->GetValue();
- bAllPosX=sal_True; bDoIt=sal_True;
- }
- if (rAttr.GetItemState(SDRATTR_ALLPOSITIONY,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- nAllPosY=((const SdrAllPositionYItem*)pPoolItem)->GetValue();
- bAllPosY=sal_True; bDoIt=sal_True;
- }
- if (rAttr.GetItemState(SDRATTR_ALLSIZEWIDTH,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- nAllWdt=((const SdrAllSizeWidthItem*)pPoolItem)->GetValue();
- bAllWdt=sal_True; bDoIt=sal_True;
- }
- if (rAttr.GetItemState(SDRATTR_ALLSIZEHEIGHT,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- nAllHgt=((const SdrAllSizeHeightItem*)pPoolItem)->GetValue();
- bAllHgt=sal_True; bDoIt=sal_True;
- }
- if (bDoIt) {
- Rectangle aRect(aAllSnapRect); // !!! fuer PolyPt's und GluePt's aber bitte noch aendern !!!
- if (bAllPosX) aRect.Move(nAllPosX-aRect.Left(),0);
- if (bAllPosY) aRect.Move(0,nAllPosY-aRect.Top());
- if (bAllWdt) aRect.Right()=aAllSnapRect.Left()+nAllWdt;
- if (bAllHgt) aRect.Bottom()=aAllSnapRect.Top()+nAllHgt;
- SetMarkedObjRect(aRect);
- }
- if (rAttr.GetItemState(SDRATTR_RESIZEXALL,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- Fraction aXFact=((const SdrResizeXAllItem*)pPoolItem)->GetValue();
- ResizeMarkedObj(aAllSnapRect.TopLeft(),aXFact,Fraction(1,1));
- }
- if (rAttr.GetItemState(SDRATTR_RESIZEYALL,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- Fraction aYFact=((const SdrResizeYAllItem*)pPoolItem)->GetValue();
- ResizeMarkedObj(aAllSnapRect.TopLeft(),Fraction(1,1),aYFact);
- }
- if (rAttr.GetItemState(SDRATTR_ROTATEALL,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long nAngle=((const SdrRotateAllItem*)pPoolItem)->GetValue();
- RotateMarkedObj(aAllSnapRect.Center(),nAngle);
- }
- if (rAttr.GetItemState(SDRATTR_HORZSHEARALL,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long nAngle=((const SdrHorzShearAllItem*)pPoolItem)->GetValue();
- ShearMarkedObj(aAllSnapRect.Center(),nAngle,sal_False);
- }
- if (rAttr.GetItemState(SDRATTR_VERTSHEARALL,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long nAngle=((const SdrVertShearAllItem*)pPoolItem)->GetValue();
- ShearMarkedObj(aAllSnapRect.Center(),nAngle,sal_True);
- }
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const basegfx::B2DRange& rAllSnapRange(getMarkedObjectSnapRange());
+ const SfxPoolItem *pPoolItem = 0;
+ const bool bUndo(IsUndoEnabled());
- const bool bUndo = IsUndoEnabled();
+ basegfx::B2DPoint aRef1(GetRef1());
+ basegfx::B2DPoint aRef2(GetRef2());
- // Todo: WhichRange nach Notwendigkeit ueberpruefen.
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
- {
- const SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- //const SdrPageView* pPV=pM->GetPageView();
- if( bUndo )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ aRef1.setX(((const SdrMetricItem*)pPoolItem)->GetValue());
+ }
+
+ if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ aRef1.setY(((const SdrMetricItem*)pPoolItem)->GetValue());
+ }
+
+ if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ aRef2.setX(((const SdrMetricItem*)pPoolItem)->GetValue());
+ }
+
+ if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ aRef2.setY(((const SdrMetricItem*)pPoolItem)->GetValue());
+ }
+
+ if(!aRef1.equal(GetRef1()))
+ {
+ SetRef1(aRef1);
+ }
+
+ if(!aRef2.equal(GetRef2()))
+ {
+ SetRef2(aRef2);
+ }
+
+ double fLeft(rAllSnapRange.getMinX());
+ double fTop(rAllSnapRange.getMinY());
+ double fWidth(rAllSnapRange.getWidth());
+ double fHeight(rAllSnapRange.getHeight());
+
+ if (rAttr.GetItemState(SDRATTR_ALLPOSITIONX,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ fLeft = ((const SdrMetricItem*)pPoolItem)->GetValue();
+ }
+
+ if (rAttr.GetItemState(SDRATTR_ALLPOSITIONY,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ fTop = ((const SdrMetricItem*)pPoolItem)->GetValue();
+ }
+
+ if (rAttr.GetItemState(SDRATTR_ALLSIZEWIDTH,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ fWidth = ((const SdrMetricItem*)pPoolItem)->GetValue();
+ }
+
+ if (rAttr.GetItemState(SDRATTR_ALLSIZEHEIGHT,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ fHeight = ((const SdrMetricItem*)pPoolItem)->GetValue();
+ }
+
+ const basegfx::B2DRange aNewRange(fLeft, fTop, fLeft + fWidth, fTop + fHeight);
+
+ if(!aNewRange.equal(rAllSnapRange))
+ {
+ SetMarkedObjSnapRange(aNewRange);
+ }
+
+ basegfx::B2DTuple aScale(1.0, 1.0);
+
+ if (rAttr.GetItemState(SDRATTR_RESIZEXALL,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ aScale.setX(((const SdrFractionItem*)pPoolItem)->GetValue());
+ }
+
+ if (rAttr.GetItemState(SDRATTR_RESIZEYALL,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ aScale.setY(((const SdrFractionItem*)pPoolItem)->GetValue());
+ }
+
+ if(!aScale.equal(basegfx::B2DTuple(1.0, 1.0)))
+ {
+ ResizeMarkedObj(rAllSnapRange.getMinimum(), aScale);
+ }
+
+ if (rAttr.GetItemState(SDRATTR_ROTATEALL,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ const sal_Int32 nAngle(((const SdrAngleItem*)pPoolItem)->GetValue());
+ const double fNewAngle((((36000 - nAngle) % 36000) * F_PI) / 18000.0);
- pObj->ApplyNotPersistAttr(rAttr);
+ RotateMarkedObj(rAllSnapRange.getCenter(), fNewAngle);
+ }
+
+ if (rAttr.GetItemState(SDRATTR_HORZSHEARALL,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ const sal_Int32 nAngle(((const SdrAngleItem*)pPoolItem)->GetValue());
+ const double fAngle(tan(((36000 - nAngle) * F_PI) / 18000.0));
+
+ ShearMarkedObj(rAllSnapRange.getCenter(), fAngle, false);
+ }
+
+ if (rAttr.GetItemState(SDRATTR_VERTSHEARALL,true,&pPoolItem)==SFX_ITEM_SET)
+ {
+ const sal_Int32 nAngle(((const SdrAngleItem*)pPoolItem)->GetValue());
+ const double fAngle(tan(((36000 - nAngle) * F_PI) / 18000.0));
+
+ ShearMarkedObj(rAllSnapRange.getCenter(), fAngle, true);
+ }
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pObj = aSelection[nm];
+
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ }
+
+ pObj->ApplyNotPersistAttr(rAttr);
+ }
}
}
-void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, sal_Bool /*bOnlyHardAttr*/) const
+void SdrEditView::MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const
{
- // bOnlyHardAttr hat hier keinerlei Wirkung
- // Hier muss ausserdem noch der Nullpunkt und
- // die PvPos berueksichtigt werden.
- Rectangle aAllSnapRect(GetMarkedObjRect()); // !!! fuer PolyPt's und GluePt's aber bitte noch aendern !!!
- long nAllSnapPosX=aAllSnapRect.Left();
- long nAllSnapPosY=aAllSnapRect.Top();
- long nAllSnapWdt=aAllSnapRect.GetWidth()-1;
- long nAllSnapHgt=aAllSnapRect.GetHeight()-1;
- // koennte mal zu CheckPossibilities mit rein
- sal_Bool bMovProtect=sal_False,bMovProtectDC=sal_False;
- sal_Bool bSizProtect=sal_False,bSizProtectDC=sal_False;
- sal_Bool bPrintable =sal_True ,bPrintableDC=sal_False;
- sal_Bool bVisible = sal_True, bVisibleDC=sal_False;
- SdrLayerID nLayerId=0; sal_Bool bLayerDC=sal_False;
- XubString aObjName; sal_Bool bObjNameDC=sal_False,bObjNameSet=sal_False;
- long nSnapPosX=0; sal_Bool bSnapPosXDC=sal_False;
- long nSnapPosY=0; sal_Bool bSnapPosYDC=sal_False;
- long nSnapWdt=0; sal_Bool bSnapWdtDC=sal_False;
- long nSnapHgt=0; sal_Bool bSnapHgtDC=sal_False;
- long nLogicWdt=0; sal_Bool bLogicWdtDC=sal_False,bLogicWdtDiff=sal_False;
- long nLogicHgt=0; sal_Bool bLogicHgtDC=sal_False,bLogicHgtDiff=sal_False;
- long nRotAngle=0; sal_Bool bRotAngleDC=sal_False;
- long nShrAngle=0; sal_Bool bShrAngleDC=sal_False;
- Rectangle aSnapRect;
- Rectangle aLogicRect;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
- const SdrMark* pM=GetSdrMarkByIndex(nm);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- if (nm==0) {
- nLayerId=pObj->GetLayer();
- bMovProtect=pObj->IsMoveProtect();
- bSizProtect=pObj->IsResizeProtect();
- bPrintable =pObj->IsPrintable();
- bVisible = pObj->IsVisible();
- Rectangle aSnapRect2(pObj->GetSnapRect());
- Rectangle aLogicRect2(pObj->GetLogicRect());
- nSnapPosX=aSnapRect2.Left();
- nSnapPosY=aSnapRect2.Top();
- nSnapWdt=aSnapRect2.GetWidth()-1;
- nSnapHgt=aSnapRect2.GetHeight()-1;
- nLogicWdt=aLogicRect2.GetWidth()-1;
- nLogicHgt=aLogicRect2.GetHeight()-1;
- bLogicWdtDiff=nLogicWdt!=nSnapWdt;
- bLogicHgtDiff=nLogicHgt!=nSnapHgt;
- nRotAngle=pObj->GetRotateAngle();
- nShrAngle=pObj->GetShearAngle();
- } else {
- if (!bLayerDC && nLayerId !=pObj->GetLayer()) bLayerDC=sal_True;
- if (!bMovProtectDC && bMovProtect!=pObj->IsMoveProtect()) bMovProtectDC=sal_True;
- if (!bSizProtectDC && bSizProtect!=pObj->IsResizeProtect()) bSizProtectDC=sal_True;
- if (!bPrintableDC && bPrintable !=pObj->IsPrintable()) bPrintableDC=sal_True;
- if (!bVisibleDC && bVisible !=pObj->IsVisible()) bVisibleDC=sal_True;
- if (!bRotAngleDC && nRotAngle !=pObj->GetRotateAngle()) bRotAngleDC=sal_True;
- if (!bShrAngleDC && nShrAngle !=pObj->GetShearAngle()) bShrAngleDC=sal_True;
- if (!bSnapWdtDC || !bSnapHgtDC || !bSnapPosXDC || !bSnapPosYDC || !bLogicWdtDiff || !bLogicHgtDiff) {
- aSnapRect=pObj->GetSnapRect();
- if (nSnapPosX!=aSnapRect.Left()) bSnapPosXDC=sal_True;
- if (nSnapPosY!=aSnapRect.Top()) bSnapPosYDC=sal_True;
- if (nSnapWdt!=aSnapRect.GetWidth()-1) bSnapWdtDC=sal_True;
- if (nSnapHgt!=aSnapRect.GetHeight()-1) bSnapHgtDC=sal_True;
- }
- if (!bLogicWdtDC || !bLogicHgtDC || !bLogicWdtDiff || !bLogicHgtDiff) {
- aLogicRect=pObj->GetLogicRect();
- if (nLogicWdt!=aLogicRect.GetWidth()-1) bLogicWdtDC=sal_True;
- if (nLogicHgt!=aLogicRect.GetHeight()-1) bLogicHgtDC=sal_True;
- if (!bLogicWdtDiff && aSnapRect.GetWidth()!=aLogicRect.GetWidth()) bLogicWdtDiff=sal_True;
- if (!bLogicHgtDiff && aSnapRect.GetHeight()!=aLogicRect.GetHeight()) bLogicHgtDiff=sal_True;
- }
- }
- if (!bObjNameDC ) {
- if (!bObjNameSet) {
- aObjName=pObj->GetName();
- } else {
- if (aObjName!=pObj->GetName()) bObjNameDC=sal_True;
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const Rectangle aAllSnapRect(sdr::legacy::GetAllObjSnapRect(aSelection));
+ const sal_Int32 nAllSnapPosX(aAllSnapRect.Left());
+ const sal_Int32 nAllSnapPosY(aAllSnapRect.Top());
+ const sal_Int32 nAllSnapWdt(aAllSnapRect.GetWidth() - 1);
+ const sal_Int32 nAllSnapHgt(aAllSnapRect.GetHeight() - 1);
+
+ // koennte mal zu CheckPossibilities mit rein
+ bool bMovProtect(false);
+ bool bMovProtectDC(false);
+ bool bSizProtect(false);
+ bool bSizProtectDC(false);
+ bool bPrintable(true);
+ bool bPrintableDC(false);
+ bool bVisible(true);
+ bool bVisibleDC(false);
+ SdrLayerID nLayerId(0);
+ bool bLayerDC(false);
+ XubString aObjName;
+ bool bObjNameDC(false);
+ bool bObjNameSet(false);
+
+ sal_Int32 nSnapPosX(0);
+ sal_Int32 nSnapPosY(0);
+ sal_Int32 nSnapWdt(0);
+ sal_Int32 nSnapHgt(0);
+ sal_Int32 nLogicWdt(0);
+ sal_Int32 nLogicHgt(0);
+ sal_Int32 nRotAngle(0);
+ sal_Int32 nShrAngle(0);
+ bool bSnapPosXDC(false);
+ bool bSnapPosYDC(false);
+ bool bSnapWdtDC(false);
+ bool bSnapHgtDC(false);
+ bool bLogicWdtDC(false);
+ bool bLogicWdtDiff(false);
+ bool bLogicHgtDC(false);
+ bool bLogicHgtDiff(false);
+ bool bRotAngleDC(false);
+ bool bShrAngleDC(false);
+ Rectangle aSnapRect;
+ Rectangle aLogicRect;
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ const SdrObject* pObj = aSelection[nm];
+
+ if(!nm)
+ {
+ nLayerId = pObj->GetLayer();
+ bMovProtect = pObj->IsMoveProtect();
+ bSizProtect = pObj->IsResizeProtect();
+ bPrintable = pObj->IsPrintable();
+ bVisible = pObj->IsVisible();
+ const Rectangle aSnapRect2(sdr::legacy::GetSnapRect(*pObj));
+ const Rectangle aLogicRect2(sdr::legacy::GetLogicRect(*pObj));
+ nSnapPosX = aSnapRect2.Left();
+ nSnapPosY = aSnapRect2.Top();
+ nSnapWdt = aSnapRect2.GetWidth() - 1;
+ nSnapHgt = aSnapRect2.GetHeight() - 1;
+ nLogicWdt = aLogicRect2.GetWidth() - 1;
+ nLogicHgt = aLogicRect2.GetHeight() - 1;
+ bLogicWdtDiff = nLogicWdt != nSnapWdt;
+ bLogicHgtDiff = nLogicHgt != nSnapHgt;
+ nRotAngle = sdr::legacy::GetRotateAngle(*pObj);
+ nShrAngle = sdr::legacy::GetShearAngleX(*pObj);
+ }
+ else
+ {
+ if(!bLayerDC && nLayerId != pObj->GetLayer())
+ {
+ bLayerDC = true;
+ }
+
+ if(!bMovProtectDC && bMovProtect != pObj->IsMoveProtect())
+ {
+ bMovProtectDC = true;
+ }
+
+ if(!bSizProtectDC && bSizProtect != pObj->IsResizeProtect())
+ {
+ bSizProtectDC = true;
+ }
+
+ if(!bPrintableDC && bPrintable != pObj->IsPrintable())
+ {
+ bPrintableDC = true;
+ }
+
+ if(!bVisibleDC && bVisible != pObj->IsVisible())
+ {
+ bVisibleDC = true;
+ }
+
+ if(!bRotAngleDC && nRotAngle != sdr::legacy::GetRotateAngle(*pObj))
+ {
+ bRotAngleDC = true;
+ }
+
+ if(!bShrAngleDC && nShrAngle != sdr::legacy::GetShearAngleX(*pObj))
+ {
+ bShrAngleDC = true;
+ }
+
+ if(!bSnapWdtDC || !bSnapHgtDC || !bSnapPosXDC || !bSnapPosYDC || !bLogicWdtDiff || !bLogicHgtDiff)
+ {
+ aSnapRect = sdr::legacy::GetSnapRect(*pObj);
+
+ if(nSnapPosX != aSnapRect.Left())
+ {
+ bSnapPosXDC = true;
+ }
+
+ if(nSnapPosY != aSnapRect.Top())
+ {
+ bSnapPosYDC = true;
+ }
+
+ if(nSnapWdt != aSnapRect.GetWidth() - 1)
+ {
+ bSnapWdtDC = true;
+ }
+
+ if(nSnapHgt != aSnapRect.GetHeight() - 1)
+ {
+ bSnapHgtDC = true;
+ }
+ }
+
+ if(!bLogicWdtDC || !bLogicHgtDC || !bLogicWdtDiff || !bLogicHgtDiff)
+ {
+ aLogicRect = sdr::legacy::GetLogicRect(*pObj);
+
+ if(nLogicWdt != aLogicRect.GetWidth() - 1)
+ {
+ bLogicWdtDC = true;
+ }
+
+ if(nLogicHgt != aLogicRect.GetHeight() - 1)
+ {
+ bLogicHgtDC = true;
+ }
+
+ if(!bLogicWdtDiff && aSnapRect.GetWidth() != aLogicRect.GetWidth())
+ {
+ bLogicWdtDiff = true;
+ }
+
+ if(!bLogicHgtDiff && aSnapRect.GetHeight() != aLogicRect.GetHeight())
+ {
+ bLogicHgtDiff = true;
+ }
+ }
+ }
+
+ if(!bObjNameDC)
+ {
+ if(!bObjNameSet)
+ {
+ aObjName = pObj->GetName();
+ }
+ else
+ {
+ if(aObjName != pObj->GetName())
+ {
+ bObjNameDC = true;
+ }
+ }
}
}
- }
- if (bSnapPosXDC || nAllSnapPosX!=nSnapPosX) rAttr.Put(SdrAllPositionXItem(nAllSnapPosX));
- if (bSnapPosYDC || nAllSnapPosY!=nSnapPosY) rAttr.Put(SdrAllPositionYItem(nAllSnapPosY));
- if (bSnapWdtDC || nAllSnapWdt !=nSnapWdt ) rAttr.Put(SdrAllSizeWidthItem(nAllSnapWdt));
- if (bSnapHgtDC || nAllSnapHgt !=nSnapHgt ) rAttr.Put(SdrAllSizeHeightItem(nAllSnapHgt));
-
- // Items fuer reine Transformationen
- rAttr.Put(SdrMoveXItem());
- rAttr.Put(SdrMoveYItem());
- rAttr.Put(SdrResizeXOneItem());
- rAttr.Put(SdrResizeYOneItem());
- rAttr.Put(SdrRotateOneItem());
- rAttr.Put(SdrHorzShearOneItem());
- rAttr.Put(SdrVertShearOneItem());
-
- if (nMarkAnz>1) {
- rAttr.Put(SdrResizeXAllItem());
- rAttr.Put(SdrResizeYAllItem());
- rAttr.Put(SdrRotateAllItem());
- rAttr.Put(SdrHorzShearAllItem());
- rAttr.Put(SdrVertShearAllItem());
- }
+ if(bSnapPosXDC || nAllSnapPosX != nSnapPosX)
+ {
+ rAttr.Put(SdrMetricItem(SDRATTR_ALLPOSITIONX, nAllSnapPosX));
+ }
- if(eDragMode == SDRDRAG_ROTATE || eDragMode == SDRDRAG_MIRROR)
- {
- rAttr.Put(SdrTransformRef1XItem(GetRef1().X()));
- rAttr.Put(SdrTransformRef1YItem(GetRef1().Y()));
- }
+ if(bSnapPosYDC || nAllSnapPosY != nSnapPosY)
+ {
+ rAttr.Put(SdrMetricItem(SDRATTR_ALLPOSITIONY, nAllSnapPosY));
+ }
- if(eDragMode == SDRDRAG_MIRROR)
- {
- rAttr.Put(SdrTransformRef2XItem(GetRef2().X()));
- rAttr.Put(SdrTransformRef2YItem(GetRef2().Y()));
+ if(bSnapWdtDC || nAllSnapWdt != nSnapWdt)
+ {
+ rAttr.Put(SdrMetricItem(SDRATTR_ALLSIZEWIDTH, nAllSnapWdt));
+ }
+
+ if(bSnapHgtDC || nAllSnapHgt != nSnapHgt)
+ {
+ rAttr.Put(SdrMetricItem(SDRATTR_ALLSIZEHEIGHT, nAllSnapHgt));
+ }
+
+ // Items fuer reine Transformationen
+ rAttr.Put(SdrMetricItem(SDRATTR_MOVEX, 0));
+ rAttr.Put(SdrMetricItem(SDRATTR_MOVEY, 0));
+ rAttr.Put(SdrFractionItem(SDRATTR_RESIZEXONE, Fraction(1,1)));
+ rAttr.Put(SdrFractionItem(SDRATTR_RESIZEYONE, Fraction(1,1)));
+ rAttr.Put(SdrAngleItem(SDRATTR_ROTATEONE, 0));
+ rAttr.Put(SdrAngleItem(SDRATTR_HORZSHEARONE, 0));
+ rAttr.Put(SdrAngleItem(SDRATTR_VERTSHEARONE, 0));
+
+ if(aSelection.size() > 1)
+ {
+ rAttr.Put(SdrFractionItem(SDRATTR_RESIZEXALL, Fraction(1,1)));
+ rAttr.Put(SdrFractionItem(SDRATTR_RESIZEYALL, Fraction(1,1)));
+ rAttr.Put(SdrAngleItem(SDRATTR_ROTATEALL, 0));
+ rAttr.Put(SdrAngleItem(SDRATTR_HORZSHEARALL, 0));
+ rAttr.Put(SdrAngleItem(SDRATTR_VERTSHEARALL, 0));
+ }
+
+ if(SDRDRAG_ROTATE == GetDragMode() || SDRDRAG_MIRROR == GetDragMode())
+ {
+ rAttr.Put(SdrMetricItem(SDRATTR_TRANSFORMREF1X, basegfx::fround(GetRef1().getX())));
+ rAttr.Put(SdrMetricItem(SDRATTR_TRANSFORMREF1Y, basegfx::fround(GetRef1().getY())));
+ }
+
+ if(SDRDRAG_MIRROR == GetDragMode())
+ {
+ rAttr.Put(SdrMetricItem(SDRATTR_TRANSFORMREF2X, basegfx::fround(GetRef2().getX())));
+ rAttr.Put(SdrMetricItem(SDRATTR_TRANSFORMREF2Y, basegfx::fround(GetRef2().getY())));
+ }
}
}
-SfxItemSet SdrEditView::GetAttrFromMarked(sal_Bool bOnlyHardAttr) const
+SfxItemSet SdrEditView::GetAttrFromMarked(bool bOnlyHardAttr) const
{
- SfxItemSet aSet(pMod->GetItemPool());
- MergeAttrFromMarked(aSet,bOnlyHardAttr);
- //the EE_FEATURE items should not be set with SetAttrToMarked (see error message there)
- //so we do not set them here
- // #i32448#
- // Do not disable, but clear the items.
- aSet.ClearItem(EE_FEATURE_TAB);
- aSet.ClearItem(EE_FEATURE_LINEBR);
- aSet.ClearItem(EE_FEATURE_NOTCONV);
- aSet.ClearItem(EE_FEATURE_FIELD);
+ SfxItemSet aSet(getSdrModelFromSdrView().GetItemPool());
+
+ if(areSdrObjectsSelected())
+ {
+ MergeAttrFromMarked(aSet, bOnlyHardAttr);
+ //the EE_FEATURE items should not be set with SetAttrToMarked (see error message there)
+ //so we do not set them here
+ // #i32448#
+ // Do not disable, but clear the items.
+ aSet.ClearItem(EE_FEATURE_TAB);
+ aSet.ClearItem(EE_FEATURE_LINEBR);
+ aSet.ClearItem(EE_FEATURE_NOTCONV);
+ aSet.ClearItem(EE_FEATURE_FIELD);
+ }
+
return aSet;
}
-void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const
+void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) const
{
- sal_uInt32 nMarkAnz(GetMarkedObjectCount());
-
- for(sal_uInt32 a(0); a < nMarkAnz; a++)
+ if(areSdrObjectsSelected())
{
- // #80277# merging was done wrong in the prev version
- //const SfxItemSet& rSet = GetMarkedObjectByIndex()->GetItemSet();
- const SfxItemSet& rSet = GetMarkedObjectByIndex(a)->GetMergedItemSet();
- SfxWhichIter aIter(rSet);
- sal_uInt16 nWhich(aIter.FirstWhich());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- while(nWhich)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- if(!bOnlyHardAttr)
- {
- if(SFX_ITEM_DONTCARE == rSet.GetItemState(nWhich, sal_False))
- rAttr.InvalidateItem(nWhich);
- else
- rAttr.MergeValue(rSet.Get(nWhich), sal_True);
- }
- else if(SFX_ITEM_SET == rSet.GetItemState(nWhich, sal_False))
+ const SfxItemSet& rSet = aSelection[a]->GetMergedItemSet();
+ SfxWhichIter aIter(rSet);
+ sal_uInt16 nWhich(aIter.FirstWhich());
+
+ while(nWhich)
{
- const SfxPoolItem& rItem = rSet.Get(nWhich);
- rAttr.MergeValue(rItem, sal_True);
- }
+ if(!bOnlyHardAttr)
+ {
+ if(SFX_ITEM_DONTCARE == rSet.GetItemState(nWhich, false))
+ {
+ rAttr.InvalidateItem(nWhich);
+ }
+ else
+ {
+ rAttr.MergeValue(rSet.Get(nWhich), true);
+ }
+ }
+ else if(SFX_ITEM_SET == rSet.GetItemState(nWhich, false))
+ {
+ const SfxPoolItem& rItem = rSet.Get(nWhich);
- nWhich = aIter.NextWhich();
+ rAttr.MergeValue(rItem, true);
+ }
+
+ nWhich = aIter.NextWhich();
+ }
}
}
}
-void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
+void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
{
- if (AreObjectsMarked())
+ if (areSdrObjectsSelected())
{
#ifdef DBG_UTIL
{
- sal_Bool bHasEEFeatureItems=sal_False;
+ bool bHasEEFeatureItems=false;
SfxItemIter aIter(rAttr);
const SfxPoolItem* pItem=aIter.FirstItem();
- while (!bHasEEFeatureItems && pItem!=NULL) {
+ while (!bHasEEFeatureItems && pItem)
+ {
if (!IsInvalidItem(pItem)) {
sal_uInt16 nW=pItem->Which();
- if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=sal_True;
+ if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=true;
}
pItem=aIter.NextItem();
}
@@ -935,33 +1296,41 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
// which ids from the text. We do that later but here we remember
// all character attribute which id's that are set.
std::vector<sal_uInt16> aCharWhichIds;
+
{
SfxItemIter aIter(rAttr);
- const SfxPoolItem* pItem=aIter.FirstItem();
- while( pItem!=NULL )
+ const SfxPoolItem* pItem = aIter.FirstItem();
+
+ while(pItem)
{
- if (!IsInvalidItem(pItem))
+ if(!IsInvalidItem(pItem))
{
- sal_uInt16 nWhich = pItem->Which();
- if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
- aCharWhichIds.push_back( nWhich );
+ const sal_uInt16 nWhich(pItem->Which());
+
+ if(nWhich >= EE_CHAR_START && nWhich <= EE_CHAR_END)
+ {
+ aCharWhichIds.push_back(nWhich);
+ }
}
- pItem=aIter.NextItem();
+
+ pItem = aIter.NextItem();
}
}
// Joe, 2.7.98: Damit Undo nach Format.Standard auch die Textattribute korrekt restauriert
- sal_Bool bHasEEItems=SearchOutlinerItems(rAttr,bReplaceAll);
+ bool bHasEEItems(SearchOutlinerItems(rAttr, bReplaceAll));
// AW 030100: save additional geom info when para or char attributes
// are changed and the geom form of the text object might be changed
- sal_Bool bPossibleGeomChange(sal_False);
+ bool bPossibleGeomChange(false);
SfxWhichIter aIter(rAttr);
- sal_uInt16 nWhich = aIter.FirstWhich();
+ sal_uInt16 nWhich(aIter.FirstWhich());
+
while(!bPossibleGeomChange && nWhich)
{
- SfxItemState eState = rAttr.GetItemState(nWhich);
- if(eState == SFX_ITEM_SET)
+ const SfxItemState eState(rAttr.GetItemState(nWhich));
+
+ if(SFX_ITEM_SET == eState)
{
if((nWhich >= SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich <= SDRATTR_TEXT_CONTOURFRAME)
|| nWhich == SDRATTR_3DOBJ_PERCENT_DIAGONAL
@@ -970,54 +1339,59 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
|| nWhich == SDRATTR_3DOBJ_END_ANGLE
|| nWhich == SDRATTR_3DSCENE_DISTANCE)
{
- bPossibleGeomChange = sal_True;
+ bPossibleGeomChange = true;
}
}
+
nWhich = aIter.NextWhich();
}
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
+ const bool bUndo(IsUndoEnabled());
+
+ if(bUndo)
{
XubString aStr;
- ImpTakeDescriptionStr(STR_EditSetAttributes,aStr);
+
+ TakeMarkedDescriptionString(STR_EditSetAttributes, aStr);
BegUndo(aStr);
}
- const sal_uInt32 nMarkAnz(GetMarkedObjectCount());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
// create ItemSet without SFX_ITEM_DONTCARE. Put()
// uses it's second parameter (bInvalidAsDefault) to
// remove all such items to set them to default.
SfxItemSet aAttr(*rAttr.GetPool(), rAttr.GetRanges());
- aAttr.Put(rAttr, sal_True);
+ aAttr.Put(rAttr, true);
// #i38135#
bool bResetAnimationTimer(false);
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj = pM->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[nm];
- if( bUndo )
+ if(bUndo)
{
- std::vector< SdrUndoAction* > vConnectorUndoActions;
- SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >( pObj );
- if ( pEdgeObj )
- bPossibleGeomChange = sal_True;
- else if( bUndo )
- vConnectorUndoActions = CreateConnectorUndo( *pObj );
+ if(pObj->IsSdrEdgeObj())
+ {
+ bPossibleGeomChange = true;
+ }
+ else if(bUndo)
+ {
+ std::vector< SdrUndoAction* > vConnectorUndoActions;
- AddUndoActions( vConnectorUndoActions );
+ vConnectorUndoActions = CreateConnectorUndo(*pObj);
+ AddUndoActions( vConnectorUndoActions );
+ }
}
// new geometry undo
if(bPossibleGeomChange && bUndo)
{
// save position and size of obect, too
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ AddUndo( getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
}
if( bUndo )
@@ -1031,7 +1405,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
const bool bRescueText = dynamic_cast< SdrTextObj* >(pObj) != 0;
// add attribute undo
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj,sal_False,bHasEEItems || bPossibleGeomChange || bRescueText));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pObj, false, bHasEEItems || bPossibleGeomChange || bRescueText));
}
// set up a scxene updater if object is a 3d object
@@ -1043,24 +1417,16 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
// set attributes at object
pObj->SetMergedItemSetAndBroadcast(aAttr, bReplaceAll);
- if(pObj->ISA(SdrTextObj))
- {
- SdrTextObj* pTextObj = ((SdrTextObj*)pObj);
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(pObj);
- if(!aCharWhichIds.empty())
+ if(pTextObj)
+ {
+ if(aCharWhichIds.size())
{
- Rectangle aOldBoundRect = pTextObj->GetLastBoundRect();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pTextObj, HINT_OBJCHG_ATTR);
- // #110094#-14 pTextObj->SendRepaintBroadcast(pTextObj->GetBoundRect());
pTextObj->RemoveOutlinerCharacterAttribs( aCharWhichIds );
-
- // object has changed, should be called form
- // RemoveOutlinerCharacterAttribs. This will change when the text
- // object implementation changes.
pTextObj->SetChanged();
-
- pTextObj->BroadcastObjectChange();
- pTextObj->SendUserCall(SDRUSERCALL_CHGATTR, aOldBoundRect);
}
}
@@ -1075,7 +1441,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
}
// fire scene updaters
- while(!aUpdaters.empty())
+ while(aUpdaters.size())
{
delete aUpdaters.back();
aUpdaters.pop_back();
@@ -1084,76 +1450,99 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
// #i38135#
if(bResetAnimationTimer)
{
- SetAnimationTimer(0L);
+ SetAnimationTimer(0);
}
// besser vorher checken, was gemacht werden soll:
// pObj->SetAttr() oder SetNotPersistAttr()
// !!! fehlende Implementation !!!
- SetNotPersistAttrToMarked(rAttr,bReplaceAll);
+ SetNotPersistAttrToMarked(rAttr, bReplaceAll);
- if( bUndo )
+ if(bUndo)
+ {
EndUndo();
+ }
}
}
SfxStyleSheet* SdrEditView::GetStyleSheetFromMarked() const
{
- SfxStyleSheet* pRet=NULL;
- sal_Bool b1st=sal_True;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SfxStyleSheet* pSS=pM->GetMarkedSdrObj()->GetStyleSheet();
- if (b1st) pRet=pSS;
- else if (pRet!=pSS) return NULL; // verschiedene StyleSheets
- b1st=sal_False;
+ SfxStyleSheet* pRet = 0;
+
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SfxStyleSheet* pSS = aSelection[nm]->GetStyleSheet();
+
+ if(!nm)
+ {
+ pRet = pSS;
+ }
+ else if(pRet != pSS)
+ {
+ return 0; // different StyleSheets
+ }
+ }
}
+
return pRet;
}
-void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
- if (AreObjectsMarked())
+ if(areSdrObjectsSelected())
{
- const bool bUndo = IsUndoEnabled();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const bool bUndo(IsUndoEnabled());
- if( bUndo )
+ if(bUndo)
{
XubString aStr;
- if (pStyleSheet!=NULL)
- ImpTakeDescriptionStr(STR_EditSetStylesheet,aStr);
+
+ if(pStyleSheet)
+ {
+ TakeMarkedDescriptionString(STR_EditSetStylesheet, aStr);
+ }
else
- ImpTakeDescriptionStr(STR_EditDelStylesheet,aStr);
+ {
+ TakeMarkedDescriptionString(STR_EditDelStylesheet, aStr);
+ }
+
BegUndo(aStr);
}
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- SdrMark* pM=GetSdrMarkByIndex(nm);
- if( bUndo )
+ SdrObject* pMarkedSdrObject = aSelection[nm];
+
+ if(bUndo)
{
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pM->GetMarkedSdrObj()));
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pM->GetMarkedSdrObj(),true,true));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pMarkedSdrObject));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pMarkedSdrObject, true, true));
}
- pM->GetMarkedSdrObj()->SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
+
+ pMarkedSdrObject->SetStyleSheet(pStyleSheet, bDontRemoveHardAttr);
}
- if( bUndo )
+ if(bUndo)
+ {
EndUndo();
+ }
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-/* new interface src537 */
-sal_Bool SdrEditView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const
+bool SdrEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
{
- if(GetMarkedObjectCount())
+ if(areSdrObjectsSelected())
{
- rTargetSet.Put(GetAttrFromMarked(bOnlyHardAttr), sal_False);
- return sal_True;
+ rTargetSet.Put(GetAttrFromMarked(bOnlyHardAttr), false);
+
+ return true;
}
else
{
@@ -1161,33 +1550,43 @@ sal_Bool SdrEditView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAt
}
}
-sal_Bool SdrEditView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll)
+bool SdrEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
- if (GetMarkedObjectCount()!=0) {
- SetAttrToMarked(rSet,bReplaceAll);
- return sal_True;
- } else {
- return SdrMarkView::SetAttributes(rSet,bReplaceAll);
+ if(areSdrObjectsSelected())
+ {
+ SetAttrToMarked(rSet, bReplaceAll);
+
+ return true;
+ }
+ else
+ {
+ return SdrMarkView::SetAttributes(rSet, bReplaceAll);
}
}
-SfxStyleSheet* SdrEditView::GetStyleSheet() const // SfxStyleSheet* SdrEditView::GetStyleSheet(sal_Bool& rOk) const
+SfxStyleSheet* SdrEditView::GetStyleSheet() const
{
- if (GetMarkedObjectCount()!=0) {
- //rOk=sal_True;
+ if(areSdrObjectsSelected())
+ {
return GetStyleSheetFromMarked();
- } else {
- return SdrMarkView::GetStyleSheet(); // SdrMarkView::GetStyleSheet(rOk);
+ }
+ else
+ {
+ return SdrMarkView::GetStyleSheet();
}
}
-sal_Bool SdrEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+bool SdrEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
- if (GetMarkedObjectCount()!=0) {
- SetStyleSheetToMarked(pStyleSheet,bDontRemoveHardAttr);
- return sal_True;
- } else {
- return SdrMarkView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr);
+ if(areSdrObjectsSelected())
+ {
+ SetStyleSheetToMarked(pStyleSheet, bDontRemoveHardAttr);
+
+ return true;
+ }
+ else
+ {
+ return SdrMarkView::SetStyleSheet(pStyleSheet, bDontRemoveHardAttr);
}
}
@@ -1195,586 +1594,657 @@ sal_Bool SdrEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRe
SfxItemSet SdrEditView::GetGeoAttrFromMarked() const
{
- SfxItemSet aRetSet(pMod->GetItemPool(), // SID_ATTR_TRANSFORM_... aus s:svxids.hrc
- SID_ATTR_TRANSFORM_POS_X,SID_ATTR_TRANSFORM_ANGLE,
- SID_ATTR_TRANSFORM_PROTECT_POS,SID_ATTR_TRANSFORM_AUTOHEIGHT,
- SDRATTR_ECKENRADIUS,SDRATTR_ECKENRADIUS,
- 0);
- if (AreObjectsMarked()) {
- SfxItemSet aMarkAttr(GetAttrFromMarked(sal_False)); // wg. AutoGrowHeight und Eckenradius
- Rectangle aRect(GetMarkedObjRect());
-
- if(GetSdrPageView())
- {
- GetSdrPageView()->LogicToPagePos(aRect);
- }
-
- // Position
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X,aRect.Left()));
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y,aRect.Top()));
-
- // Groesse
- long nResizeRefX=aRect.Left();
- long nResizeRefY=aRect.Top();
- if (eDragMode==SDRDRAG_ROTATE) { // Drehachse auch als Referenz fuer Resize
- nResizeRefX=aRef1.X();
- nResizeRefY=aRef1.Y();
- }
- aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH,aRect.Right()-aRect.Left()));
- aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT,aRect.Bottom()-aRect.Top()));
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_X,nResizeRefX));
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_Y,nResizeRefY));
-
- Point aRotateAxe(aRef1);
-
- if(GetSdrPageView())
- {
- GetSdrPageView()->LogicToPagePos(aRotateAxe);
- }
-
- // Drehung
- long nRotateRefX=aRect.Center().X();
- long nRotateRefY=aRect.Center().Y();
- if (eDragMode==SDRDRAG_ROTATE) {
- nRotateRefX=aRotateAxe.X();
- nRotateRefY=aRotateAxe.Y();
- }
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE,GetMarkedObjRotate()));
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X,nRotateRefX));
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y,nRotateRefY));
-
- // Shear
- long nShearRefX=aRect.Left();
- long nShearRefY=aRect.Bottom();
- if (eDragMode==SDRDRAG_ROTATE) { // Drehachse auch als Referenz fuer Shear
- nShearRefX=aRotateAxe.X();
- nShearRefY=aRotateAxe.Y();
- }
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR,GetMarkedObjShear()));
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X,nShearRefX));
- aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y,nShearRefY));
-
- // Pruefen der einzelnen Objekte, ob Objekte geschuetzt sind
- const SdrMarkList& rMarkList=GetMarkedObjectList();
- sal_uIntPtr nMarkCount=rMarkList.GetMarkCount();
- SdrObject* pObj=rMarkList.GetMark(0)->GetMarkedSdrObj();
- sal_Bool bPosProt=pObj->IsMoveProtect();
- sal_Bool bSizProt=pObj->IsResizeProtect();
- sal_Bool bPosProtDontCare=sal_False;
- sal_Bool bSizProtDontCare=sal_False;
- for (sal_uIntPtr i=1; i<nMarkCount && (!bPosProtDontCare || !bSizProtDontCare); i++) {
- pObj=rMarkList.GetMark(i)->GetMarkedSdrObj();
- if (bPosProt!=pObj->IsMoveProtect()) bPosProtDontCare=sal_True;
- if (bSizProt!=pObj->IsResizeProtect()) bSizProtDontCare=sal_True;
- }
-
- // InvalidateItem setzt das Item auf DONT_CARE
- if (bPosProtDontCare) {
+ SfxItemSet aRetSet(getSdrModelFromSdrView().GetItemPool(), // SID_ATTR_TRANSFORM_... aus s:svxids.hrc
+ SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
+ SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT,
+ SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS,
+ 0, 0);
+
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ basegfx::B2DRange aRange(getMarkedObjectSnapRange());
+
+ if(aRange.isEmpty())
+ {
+ return aRetSet;
+ }
+
+ const basegfx::B2DPoint aPageOrigin(GetSdrPageView()
+ ? GetSdrPageView()->GetPageOrigin()
+ : basegfx::B2DPoint(0.0, 0.0));
+
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-aPageOrigin));
+
+ // translation
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X, basegfx::fround(aRange.getMinX())));
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y, basegfx::fround(aRange.getMinY())));
+
+ // scale
+ double fResizeRefX(aRange.getMinX());
+ double fResizeRefY(aRange.getMinY());
+
+ if(SDRDRAG_ROTATE == GetDragMode())
+ {
+ // rotation axis also for scale
+ fResizeRefX = GetRef1().getX();
+ fResizeRefY = GetRef1().getY();
+ }
+
+ aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH,basegfx::fround(aRange.getWidth())));
+ aRetSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT,basegfx::fround(aRange.getHeight())));
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_X,basegfx::fround(fResizeRefX)));
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_RESIZE_REF_Y,basegfx::fround(fResizeRefY)));
+
+ basegfx::B2DPoint aRotateAxe(GetRef1() - aPageOrigin);
+
+ // rotation
+ double fRotateRefX(aRange.getCenterX());
+ double fRotateRefY(aRange.getCenterY());
+
+ if(SDRDRAG_ROTATE == GetDragMode())
+ {
+ fRotateRefX = aRotateAxe.getX();
+ fRotateRefY = aRotateAxe.getY();
+ }
+
+ const double fAllRotation(GetMarkedObjRotate());
+ const sal_Int32 nOldAllRot((basegfx::fround(((F_2PI - fAllRotation) * 18000.0) / F_PI)) % 36000);
+
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE,nOldAllRot));
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X,basegfx::fround(fRotateRefX)));
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y,basegfx::fround(fRotateRefY)));
+
+ // shear
+ double fShearRefX(aRange.getMinX());
+ double fShearRefY(aRange.getMaxY());
+
+ if(SDRDRAG_ROTATE == GetDragMode())
+ {
+ // rotation axis also for shear
+ fShearRefX = aRotateAxe.getX();
+ fShearRefY = aRotateAxe.getY();
+ }
+
+ double fAllShearX(GetMarkedObjShearX());
+ const double fMaxShearRange(F_PI2 * (89.0/90.0));
+
+ fAllShearX = basegfx::snapToRange(fAllShearX, -F_PI, F_PI);
+ fAllShearX = basegfx::clamp(fAllShearX, -fMaxShearRange, fMaxShearRange);
+
+ const sal_Int32 nOldAllShearX(basegfx::fround(((-fAllShearX) * 18000.0) / F_PI));
+
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR,nOldAllShearX));
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X,basegfx::fround(fShearRefX)));
+ aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y,basegfx::fround(fShearRefY)));
+
+ // check single objects for translation/scale protection
+ SdrObject* pObj = aSelection[0];
+ bool bPosProt(pObj->IsMoveProtect());
+ bool bSizProt(pObj->IsResizeProtect());
+ bool bPosProtDontCare(false);
+ bool bSizProtDontCare(false);
+
+ for(sal_uInt32 i(1); i < aSelection.size() && (!bPosProtDontCare || !bSizProtDontCare); i++)
+ {
+ pObj = aSelection[i];
+
+ if(bPosProt != pObj->IsMoveProtect())
+ {
+ bPosProtDontCare = true;
+ }
+
+ if(bSizProt != pObj->IsResizeProtect())
+ {
+ bSizProtDontCare = true;
+ }
+ }
+
+ // use InvalidateItem to set to DONT_CARE if needed
+ if(bPosProtDontCare)
+ {
aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_POS);
- } else {
+ }
+ else
+ {
aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_POS,bPosProt));
}
- if (bSizProtDontCare) {
+
+ if(bSizProtDontCare)
+ {
aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_PROTECT_SIZE);
- } else {
+ }
+ else
+ {
aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_PROTECT_SIZE,bSizProt));
}
- SfxItemState eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWWIDTH);
- sal_Bool bAutoGrow=((SdrTextAutoGrowWidthItem&)(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH))).GetValue();
- if (eState==SFX_ITEM_DONTCARE) {
+ // get all attributes from marked SdrObjects
+ SfxItemSet aMarkAttr(GetAttrFromMarked(false));
+
+ SfxItemState eState(aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWWIDTH));
+ bool bAutoGrow(((SdrOnOffItem&)(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH))).GetValue());
+
+ if(SFX_ITEM_DONTCARE == eState)
+ {
aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOWIDTH);
- } else if (eState==SFX_ITEM_SET) {
- aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOWIDTH,bAutoGrow));
+ }
+ else if(SFX_ITEM_SET == eState)
+ {
+ aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOWIDTH, bAutoGrow));
}
- eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT);
- bAutoGrow=((SdrTextAutoGrowHeightItem&)(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
- if (eState==SFX_ITEM_DONTCARE) {
+ eState = aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT);
+ bAutoGrow = ((SdrOnOffItem&)(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
+
+ if(SFX_ITEM_DONTCARE == eState)
+ {
aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOHEIGHT);
- } else if (eState==SFX_ITEM_SET) {
+ }
+ else if(SFX_ITEM_SET == eState)
+ {
aRetSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_AUTOHEIGHT,bAutoGrow));
}
- eState=aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS);
- long nRadius=((SdrEckenradiusItem&)(aMarkAttr.Get(SDRATTR_ECKENRADIUS))).GetValue();
- if (eState==SFX_ITEM_DONTCARE) {
+ eState = aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS);
+ const sal_Int32 nRadius(((SdrMetricItem&)(aMarkAttr.Get(SDRATTR_ECKENRADIUS))).GetValue());
+
+ if(SFX_ITEM_DONTCARE == eState)
+ {
aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS);
- } else if (eState==SFX_ITEM_SET) {
- aRetSet.Put(SdrEckenradiusItem(nRadius));
}
-
+ else if(SFX_ITEM_SET == eState)
+ {
+ aRetSet.Put(SdrMetricItem(SDRATTR_ECKENRADIUS, nRadius));
+ }
}
- return aRetSet;
-}
-Point ImpGetPoint(Rectangle aRect, RECT_POINT eRP)
-{
- switch(eRP) {
- case RP_LT: return aRect.TopLeft();
- case RP_MT: return aRect.TopCenter();
- case RP_RT: return aRect.TopRight();
- case RP_LM: return aRect.LeftCenter();
- case RP_MM: return aRect.Center();
- case RP_RM: return aRect.RightCenter();
- case RP_LB: return aRect.BottomLeft();
- case RP_MB: return aRect.BottomCenter();
- case RP_RB: return aRect.BottomRight();
- }
- return Point(); // Sollte nicht vorkommen !
+ return aRetSet;
}
void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
{
- Rectangle aRect(GetMarkedObjRect());
-
- if(GetSdrPageView())
+ if(areSdrObjectsSelected())
{
- GetSdrPageView()->LogicToPagePos(aRect);
- }
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ basegfx::B2DRange aRange(getMarkedObjectSnapRange());
- long nOldRotateAngle=GetMarkedObjRotate();
- long nOldShearAngle=GetMarkedObjShear();
- const SdrMarkList& rMarkList=GetMarkedObjectList();
- sal_uIntPtr nMarkCount=rMarkList.GetMarkCount();
- SdrObject* pObj=NULL;
-
- RECT_POINT eSizePoint=RP_MM;
- long nPosDX=0;
- long nPosDY=0;
- long nSizX=0;
- long nSizY=0;
- long nRotateAngle=0;
-
- // #86909#
- sal_Bool bModeIsRotate(eDragMode == SDRDRAG_ROTATE);
- long nRotateX(0);
- long nRotateY(0);
- long nOldRotateX(0);
- long nOldRotateY(0);
- if(bModeIsRotate)
- {
- Point aRotateAxe(aRef1);
-
- if(GetSdrPageView())
+ if(aRange.isEmpty())
{
- GetSdrPageView()->LogicToPagePos(aRotateAxe);
+ return;
}
- nRotateX = nOldRotateX = aRotateAxe.X();
- nRotateY = nOldRotateY = aRotateAxe.Y();
- }
+ const basegfx::B2DPoint aPageOrigin(GetSdrPageView()
+ ? GetSdrPageView()->GetPageOrigin()
+ : basegfx::B2DPoint(0.0, 0.0));
- long nNewShearAngle=0;
- long nShearAngle=0;
- long nShearX=0;
- long nShearY=0;
- sal_Bool bShearVert=sal_False;
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-aPageOrigin));
- sal_Bool bChgPos=sal_False;
- sal_Bool bChgSiz=sal_False;
- sal_Bool bChgHgt=sal_False;
- sal_Bool bRotate=sal_False;
- sal_Bool bShear =sal_False;
+ const bool bModeIsRotate(SDRDRAG_ROTATE == GetDragMode());
+ basegfx::B2DPoint aNewRotateCenter(0.0, 0.0);
+ basegfx::B2DPoint aOldRotateCenter(aNewRotateCenter);
- sal_Bool bSetAttr=sal_False;
- SfxItemSet aSetAttr(pMod->GetItemPool());
+ if(bModeIsRotate)
+ {
+ const basegfx::B2DPoint aRotateAxe(GetRef1() - aPageOrigin);
- const SfxPoolItem* pPoolItem=NULL;
+ aNewRotateCenter = aOldRotateCenter = aRotateAxe;
+ }
- // Position
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_X,sal_True,&pPoolItem)) {
- nPosDX=((const SfxInt32Item*)pPoolItem)->GetValue()-aRect.Left();
- bChgPos=sal_True;
- }
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_Y,sal_True,&pPoolItem)){
- nPosDY=((const SfxInt32Item*)pPoolItem)->GetValue()-aRect.Top();
- bChgPos=sal_True;
- }
- // Groesse
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,sal_True,&pPoolItem)) {
- nSizX=((const SfxUInt32Item*)pPoolItem)->GetValue();
- bChgSiz=sal_True;
- }
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,sal_True,&pPoolItem)) {
- nSizY=((const SfxUInt32Item*)pPoolItem)->GetValue();
- bChgSiz=sal_True;
- bChgHgt=sal_True;
- }
- if (bChgSiz) {
- eSizePoint=(RECT_POINT)((const SfxAllEnumItem&)rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT)).GetValue();
- }
+ SfxItemSet aSetAttr(getSdrModelFromSdrView().GetItemPool());
+ const SfxPoolItem* pPoolItem = 0;
- // Rotation
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE,sal_True,&pPoolItem)) {
- nRotateAngle=((const SfxInt32Item*)pPoolItem)->GetValue()-nOldRotateAngle;
- bRotate = (nRotateAngle != 0);
- }
+ // position change?
+ const basegfx::B2DPoint aOldTranslate(aRange.getMinimum());
+ basegfx::B2DPoint aNewTranslate(aOldTranslate);
- // #86909# pos rot point x
- if(bRotate || SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_X, sal_True ,&pPoolItem))
- nRotateX = ((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_ROT_X)).GetValue();
-
- // #86909# pos rot point y
- if(bRotate || SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_Y, sal_True ,&pPoolItem))
- nRotateY = ((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_ROT_Y)).GetValue();
-
- // Shear
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_SHEAR,sal_True,&pPoolItem)) {
- nNewShearAngle=((const SfxInt32Item*)pPoolItem)->GetValue();
- if (nNewShearAngle>SDRMAXSHEAR) nNewShearAngle=SDRMAXSHEAR;
- if (nNewShearAngle<-SDRMAXSHEAR) nNewShearAngle=-SDRMAXSHEAR;
- if (nNewShearAngle!=nOldShearAngle) {
- bShearVert=((const SfxBoolItem&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL)).GetValue();
- if (bShearVert) {
- nShearAngle=nNewShearAngle;
- } else {
- if (nNewShearAngle!=0 && nOldShearAngle!=0) {
- // Bugfix #25714#.
- double nOld=tan((double)nOldShearAngle*nPi180);
- double nNew=tan((double)nNewShearAngle*nPi180);
- nNew-=nOld;
- nNew=atan(nNew)/nPi180;
- nShearAngle=Round(nNew);
- } else {
- nShearAngle=nNewShearAngle-nOldShearAngle;
- }
- }
- bShear=nShearAngle!=0;
- if (bShear) {
- nShearX=((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X)).GetValue();
- nShearY=((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y)).GetValue();
- }
+ if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem))
+ {
+ aNewTranslate.setX(((const SfxInt32Item*)pPoolItem)->GetValue());
}
- }
- // AutoGrow
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOWIDTH,sal_True,&pPoolItem)) {
- sal_Bool bAutoGrow=((const SfxBoolItem*)pPoolItem)->GetValue();
- aSetAttr.Put(SdrTextAutoGrowWidthItem(bAutoGrow));
- bSetAttr=sal_True;
- }
+ if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem))
+ {
+ aNewTranslate.setY(((const SfxInt32Item*)pPoolItem)->GetValue());
+ }
- if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOHEIGHT,sal_True,&pPoolItem)) {
- sal_Bool bAutoGrow=((const SfxBoolItem*)pPoolItem)->GetValue();
- aSetAttr.Put(SdrTextAutoGrowHeightItem(bAutoGrow));
- bSetAttr=sal_True;
- }
+ // scale change?
+ const basegfx::B2DVector aOldSize(aRange.getRange());
+ basegfx::B2DVector aNewSize(aOldSize);
+ bool bChgHgt(false);
- // Eckenradius
- if (bEdgeRadiusAllowed && SFX_ITEM_SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,sal_True,&pPoolItem)) {
- long nRadius=((SdrEckenradiusItem*)pPoolItem)->GetValue();
- aSetAttr.Put(SdrEckenradiusItem(nRadius));
- bSetAttr=sal_True;
- }
+ if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem))
+ {
+ aNewSize.setX(((const SfxUInt32Item*)pPoolItem)->GetValue());
+ }
- ForcePossibilities();
+ if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem))
+ {
+ aNewSize.setY(((const SfxUInt32Item*)pPoolItem)->GetValue());
+ bChgHgt = true;
+ }
- BegUndo(ImpGetResStr(STR_EditTransform),GetDescriptionOfMarkedObjects());
+ RECT_POINT eSizePoint(RP_MM);
+ const bool bScaleChanged(!aNewSize.equal(aOldSize));
- if (bSetAttr) {
- SetAttrToMarked(aSetAttr,sal_False);
- }
+ if(bScaleChanged)
+ {
+ eSizePoint=(RECT_POINT)((const SfxAllEnumItem&)rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT)).GetValue();
+ }
- // Groesse und Hoehe aendern
- if (bChgSiz && (bResizeFreeAllowed || bResizePropAllowed)) {
- Fraction aWdt(nSizX,aRect.Right()-aRect.Left());
- Fraction aHgt(nSizY,aRect.Bottom()-aRect.Top());
- Point aRef(ImpGetPoint(aRect,eSizePoint));
+ // rotation change?
+ const double fOldRotateAngle(GetMarkedObjRotate());
+ double fNewRotateAngle(fOldRotateAngle);
- if(GetSdrPageView())
+ if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE,true,&pPoolItem))
{
- GetSdrPageView()->PagePosToLogic(aRef);
+ const sal_Int32 nAllRot(((const SfxInt32Item*)pPoolItem)->GetValue());
+ fNewRotateAngle = (((36000 - nAllRot) % 36000) * F_PI) / 18000.0;
}
- ResizeMarkedObj(aRef,aWdt,aHgt);
- }
+ const bool bRotate(!basegfx::fTools::equal(fOldRotateAngle, fNewRotateAngle));
- // Rotieren
- if (bRotate && (bRotateFreeAllowed || bRotate90Allowed)) {
- Point aRef(nRotateX,nRotateY);
+ // #86909# pos rot point x
+ if(bRotate || SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_X, true ,&pPoolItem))
+ {
+ aNewRotateCenter.setX(((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_ROT_X)).GetValue());
+ }
- if(GetSdrPageView())
+ // #86909# pos rot point y
+ if(bRotate || SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_Y, true ,&pPoolItem))
{
- GetSdrPageView()->PagePosToLogic(aRef);
+ aNewRotateCenter.setY(((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_ROT_Y)).GetValue());
}
- RotateMarkedObj(aRef,nRotateAngle);
- }
+ // shear change?
+ double fShearAngle(0.0);
+ basegfx::B2DPoint aShearOffset(0.0, 0.0);
+ bool bShearVert(false);
+ bool bShear(false);
- // #86909# set rotation point position
- if(bModeIsRotate && (nRotateX != nOldRotateX || nRotateY != nOldRotateY))
- {
- Point aNewRef1(nRotateX, nRotateY);
-
- if(GetSdrPageView())
+ if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_SHEAR,true,&pPoolItem))
{
- GetSdrPageView()->PagePosToLogic(aNewRef1);
- }
+ const sal_Int32 nAllShear(((const SfxInt32Item*)pPoolItem)->GetValue());
+ const double fMaxShearRange(F_PI2 * (89.0/90.0));
+ double fNewShearAngle(((-nAllShear) * F_PI) / 18000.0);
- SetRef1(aNewRef1);
- }
+ fNewShearAngle = basegfx::snapToRange(fNewShearAngle, -F_PI, F_PI);
+ fNewShearAngle = basegfx::clamp(fNewShearAngle, -fMaxShearRange, fMaxShearRange);
+
+ bShearVert = ((const SfxBoolItem&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL)).GetValue();
+ double fOldShearAngle(GetMarkedObjShearX());
+
+ if(bShearVert)
+ {
+ // Currently only ShearX is directly used at the SdrObject since the homogen
+ // matrix only has six degrees of freedom and it has to be decided which one
+ // to use. It can be shown mathematically that a ShearY about degree x is
+ // the same as a 90 degree rotation, a ShearY(-x) and a -90 degree back-rotation.
+ // Exactly this will be used below. It also shows that the ShearY is -ShearX, thus
+ // the compare value can be detected
+ fOldShearAngle = -fOldShearAngle;
+ }
+
+ if(!basegfx::fTools::equal(fNewShearAngle, fOldShearAngle))
+ {
+ fShearAngle = fNewShearAngle - fOldShearAngle;
+ bShear = true;
+ }
- // Shear
- if (bShear && bShearAllowed) {
- Point aRef(nShearX,nShearY);
+ if(bShear)
+ {
+ aShearOffset.setX(((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X)).GetValue());
+ aShearOffset.setY(((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y)).GetValue());
+ }
+ }
- if(GetSdrPageView())
+ bool bSetAttr(false);
+
+ // AutoGrow
+ if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOWIDTH,true,&pPoolItem))
{
- GetSdrPageView()->PagePosToLogic(aRef);
+ bool bAutoGrow=((const SfxBoolItem*)pPoolItem)->GetValue();
+ aSetAttr.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, bAutoGrow));
+ bSetAttr = true;
}
- ShearMarkedObj(aRef,nShearAngle,bShearVert);
+ if (SFX_ITEM_SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOHEIGHT,true,&pPoolItem))
+ {
+ bool bAutoGrow=((const SfxBoolItem*)pPoolItem)->GetValue();
+ aSetAttr.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, bAutoGrow));
+ bSetAttr = true;
+ }
- // #i74358#
- // ShearMarkedObj creates a linear combination of the existing transformation and
- // the new shear to apply. If the object is already transformed (e.g. rotated) the
- // linear combination will not decompose to the same start values again, but to a
- // new combination. Thus it makes no sense to check if the wanted shear is reached
- // or not. Taking out.
-#if 0
- long nTempAngle=GetMarkedObjShear();
- if (nTempAngle!=0 && nTempAngle!=nNewShearAngle && !bShearVert) {
- // noch eine 2. Iteration zur Kompensation der Rundungsfehler
- double nOld=tan((double)nTempAngle*nPi180);
- double nNew=tan((double)nNewShearAngle*nPi180);
- nNew-=nOld;
- nNew=atan(nNew)/nPi180;
- nTempAngle=Round(nNew);
- if (nTempAngle!=0) {
- ShearMarkedObj(aRef,nTempAngle,bShearVert);
- }
+ // rounded edge changed?
+ if (mbEdgeRadiusAllowed && SFX_ITEM_SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,true,&pPoolItem))
+ {
+ sal_Int32 nRadius=((SdrMetricItem*)pPoolItem)->GetValue();
+ aSetAttr.Put(SdrMetricItem(SDRATTR_ECKENRADIUS, nRadius));
+ bSetAttr = true;
}
-#endif
- }
- // Position aendern
- if (bChgPos && bMoveAllowed) {
- MoveMarkedObj(Size(nPosDX,nPosDY));
- }
+ ForcePossibilities();
+ BegUndo(ImpGetResStr(STR_EditTransform), getSelectionDescription(aSelection));
- // protect position
- if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, sal_True, &pPoolItem))
- {
- const sal_Bool bProtPos(((const SfxBoolItem*)pPoolItem)->GetValue());
- bool bChanged(false);
+ if(bSetAttr)
+ {
+ SetAttrToMarked(aSetAttr, false);
+ }
- for(sal_uInt32 i(0); i < nMarkCount; i++)
+ // change scale
+ if(bScaleChanged && (mbResizeFreeAllowed || mbResizePropAllowed))
{
- pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ basegfx::B2DPoint aRefPoint(aRange.getMinimum());
- if(pObj->IsMoveProtect() != bProtPos)
+ switch(eSizePoint)
{
- bChanged = true;
- pObj->SetMoveProtect(bProtPos);
-
- if(bProtPos)
- {
- pObj->SetResizeProtect(true);
- }
+ default: break; // case RP_LT
+ case RP_MT: aRefPoint = basegfx::B2DPoint(aRange.getCenterX(), aRange.getMinY()); break;
+ case RP_RT: aRefPoint = basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()); break;
+ case RP_LM: aRefPoint = basegfx::B2DPoint(aRange.getMinX(), aRange.getCenterY()); break;
+ case RP_MM: aRefPoint = aRange.getCenter(); break;
+ case RP_RM: aRefPoint = basegfx::B2DPoint(aRange.getMaxX(), aRange.getCenterY()); break;
+ case RP_LB: aRefPoint = basegfx::B2DPoint(aRange.getMinX(), aRange.getMaxY()); break;
+ case RP_MB: aRefPoint = basegfx::B2DPoint(aRange.getCenterX(), aRange.getMaxY()); break;
+ case RP_RB: aRefPoint = aRange.getMaximum(); break;
}
+
+ aRefPoint += aPageOrigin;
+
+ const basegfx::B2DTuple aScale(
+ aNewSize.getX() / (basegfx::fTools::equalZero(aOldSize.getX()) ? 1.0 : aOldSize.getX()),
+ aNewSize.getY() / (basegfx::fTools::equalZero(aOldSize.getY()) ? 1.0 : aOldSize.getY()));
+
+ ResizeMarkedObj(aRefPoint, aScale);
}
- if(bChanged)
+ // change shear
+ if(bShear && mbShearAllowed)
{
- bMoveProtect = bProtPos;
+ basegfx::B2DPoint aRef(aShearOffset + aPageOrigin);
- if(bProtPos)
+ if(bShearVert)
+ {
+ // see explanation at setting bShearVert
+ RotateMarkedObj(aRef, F_PI2);
+ ShearMarkedObj(aRef, -fShearAngle, true);
+ RotateMarkedObj(aRef, -F_PI2);
+ }
+ else
{
- bResizeProtect = true;
+ ShearMarkedObj(aRef, fShearAngle, false);
}
+ }
- // #i77187# there is no simple method to get the toolbars updated
- // in the application. The App is listening to selection change and i
- // will use it here (even if not true). It's acceptable since changing
- // this model data is pretty rare and only possible using the F4 dialog
- MarkListHasChanged();
+ // change rotation
+ if(bRotate && (mbRotateFreeAllowed || mbRotate90Allowed))
+ {
+ const basegfx::B2DPoint aRef(aNewRotateCenter + aPageOrigin);
+
+ RotateMarkedObj(aRef, fNewRotateAngle - fOldRotateAngle);
}
- }
- if(!bMoveProtect)
- {
- // protect size
- if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_True, &pPoolItem))
+ // set rotation point position
+ if(bModeIsRotate && !aNewRotateCenter.equal(aOldRotateCenter))
{
- const sal_Bool bProtSize(((const SfxBoolItem*)pPoolItem)->GetValue());
+ const basegfx::B2DPoint aNewRef1(aNewRotateCenter + aPageOrigin);
+
+ SetRef1(aNewRef1);
+ }
+
+ // change translation
+ if(!aOldTranslate.equal(aNewTranslate) && mbMoveAllowedOnSelection)
+ {
+ MoveMarkedObj(aNewTranslate - aOldTranslate);
+ }
+
+ // protect position
+ if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, true, &pPoolItem))
+ {
+ const bool bProtPos(((const SfxBoolItem*)pPoolItem)->GetValue());
bool bChanged(false);
- for(sal_uInt32 i(0); i < nMarkCount; i++)
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[i];
- if(pObj->IsResizeProtect() != bProtSize)
+ if(pObj->IsMoveProtect() != bProtPos)
{
bChanged = true;
- pObj->SetResizeProtect(bProtSize);
+ pObj->SetMoveProtect(bProtPos);
+
+ if(bProtPos)
+ {
+ pObj->SetResizeProtect(true);
+ }
}
}
if(bChanged)
{
- bResizeProtect = bProtSize;
+ mbMoveProtect = bProtPos;
- // #i77187# see above
- MarkListHasChanged();
+ if(bProtPos)
+ {
+ mbResizeProtect = true;
+ }
}
}
- }
- EndUndo();
+ if(!mbMoveProtect)
+ {
+ // protect size
+ if(SFX_ITEM_SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE, true, &pPoolItem))
+ {
+ const bool bProtSize(((const SfxBoolItem*)pPoolItem)->GetValue());
+ bool bChanged(false);
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
+ {
+ SdrObject* pObj = aSelection[i];
+
+ if(pObj->IsResizeProtect() != bProtSize)
+ {
+ bChanged = true;
+ pObj->SetResizeProtect(bProtSize);
+ }
+ }
+
+ if(bChanged)
+ {
+ mbResizeProtect = bProtSize;
+ }
+ }
+ }
+
+ EndUndo();
+ }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrEditView::IsAlignPossible() const
-{ // Mindestens 2 markierte Objekte, davon mind. 1 beweglich
- ForcePossibilities();
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- if (nAnz==0) return sal_False; // Nix markiert!
- if (nAnz==1) return bMoveAllowed; // einzelnes Obj an der Seite ausrichten
- return bOneOrMoreMovable; // ansonsten ist MarkCount>=2
+bool SdrEditView::IsAlignPossible() const
+{
+ if(!areSdrObjectsSelected())
+ {
+ return false; // Nix markiert!
+ }
+ else
+ {
+ ForcePossibilities();
+ SdrObject* pSingleSelected = getSelectedIfSingle();
+
+ if(pSingleSelected)
+ {
+ // einzelnes Obj an der Seite ausrichten
+ return mbMoveAllowedOnSelection;
+ }
+
+ // ansonsten ist MarkCount>=2
+ return mbOneOrMoreMovable;
+ }
}
-void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, sal_Bool bBoundRects)
+void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, bool bBoundRects)
{
- if (eHor==SDRHALIGN_NONE && eVert==SDRVALIGN_NONE)
- return;
-
- SortMarkedObjects();
- if (GetMarkedObjectCount()<1)
+ if(SDRHALIGN_NONE == eHor && SDRVALIGN_NONE == eVert)
+ {
return;
+ }
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
+ if(areSdrObjectsSelected())
{
- XubString aStr(GetDescriptionOfMarkedObjects());
- if (eHor==SDRHALIGN_NONE)
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const bool bUndo(IsUndoEnabled());
+
+ if(bUndo)
{
- switch (eVert)
+ String aStr(getSelectionDescription(aSelection));
+
+ if(SDRHALIGN_NONE == eHor)
{
- case SDRVALIGN_TOP : ImpTakeDescriptionStr(STR_EditAlignVTop ,aStr); break;
- case SDRVALIGN_BOTTOM: ImpTakeDescriptionStr(STR_EditAlignVBottom,aStr); break;
- case SDRVALIGN_CENTER: ImpTakeDescriptionStr(STR_EditAlignVCenter,aStr); break;
- default: break;
+ switch(eVert)
+ {
+ case SDRVALIGN_TOP : TakeMarkedDescriptionString(STR_EditAlignVTop ,aStr); break;
+ case SDRVALIGN_BOTTOM: TakeMarkedDescriptionString(STR_EditAlignVBottom,aStr); break;
+ case SDRVALIGN_CENTER: TakeMarkedDescriptionString(STR_EditAlignVCenter,aStr); break;
+ default: break;
+ }
}
- }
- else if (eVert==SDRVALIGN_NONE)
- {
- switch (eHor)
+ else if(SDRVALIGN_NONE == eVert)
{
- case SDRHALIGN_LEFT : ImpTakeDescriptionStr(STR_EditAlignHLeft ,aStr); break;
- case SDRHALIGN_RIGHT : ImpTakeDescriptionStr(STR_EditAlignHRight ,aStr); break;
- case SDRHALIGN_CENTER: ImpTakeDescriptionStr(STR_EditAlignHCenter,aStr); break;
- default: break;
+ switch(eHor)
+ {
+ case SDRHALIGN_LEFT : TakeMarkedDescriptionString(STR_EditAlignHLeft ,aStr); break;
+ case SDRHALIGN_RIGHT : TakeMarkedDescriptionString(STR_EditAlignHRight ,aStr); break;
+ case SDRHALIGN_CENTER: TakeMarkedDescriptionString(STR_EditAlignHCenter,aStr); break;
+ default: break;
+ }
}
+ else if(SDRHALIGN_CENTER == eHor && SDRVALIGN_CENTER == eVert)
+ {
+ TakeMarkedDescriptionString(STR_EditAlignCenter, aStr);
+ }
+ else
+ {
+ TakeMarkedDescriptionString(STR_EditAlign, aStr);
+ }
+
+ BegUndo(aStr);
}
- else if (eHor==SDRHALIGN_CENTER && eVert==SDRVALIGN_CENTER)
- {
- ImpTakeDescriptionStr(STR_EditAlignCenter,aStr);
- }
- else
+
+ basegfx::B2DRange aBound;
+ sal_uInt32 nm;
+ bool bHasFixed(false);
+
+ for(nm = 0; nm < aSelection.size(); nm++)
{
- ImpTakeDescriptionStr(STR_EditAlign,aStr);
+ SdrObject* pObj = aSelection[nm];
+ SdrObjTransformInfoRec aInfo;
+ pObj->TakeObjInfo(aInfo);
+
+ if(!aInfo.mbMoveAllowed || pObj->IsMoveProtect())
+ {
+ const basegfx::B2DRange aObjRange(bBoundRects
+ ? pObj->getObjectRange(getAsSdrView())
+ : sdr::legacy::GetSnapRange(*pObj));
+
+ aBound.expand(aObjRange);
+ bHasFixed = true;
+ }
}
- BegUndo(aStr);
- }
- Rectangle aBound;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_uIntPtr nm;
- sal_Bool bHasFixed=sal_False;
- for (nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrObjTransformInfoRec aInfo;
- pObj->TakeObjInfo(aInfo);
- if (!aInfo.bMoveAllowed || pObj->IsMoveProtect())
+ if(!bHasFixed)
{
- Rectangle aObjRect(bBoundRects?pObj->GetCurrentBoundRect():pObj->GetSnapRect());
- aBound.Union(aObjRect);
- bHasFixed=sal_True;
- }
- }
- if (!bHasFixed)
- {
- if (nMarkAnz==1)
- { // einzelnes Obj an der Seite ausrichten
- const SdrObject* pObj=GetMarkedObjectByIndex(0L);
- const SdrPage* pPage=pObj->GetPage();
- const SdrPageGridFrameList* pGFL=pPage->GetGridFrameList(GetSdrPageViewOfMarkedByIndex(0),&(pObj->GetSnapRect()));
- const SdrPageGridFrame* pFrame=NULL;
- if (pGFL!=NULL && pGFL->GetCount()!=0)
- { // Writer
- pFrame=&((*pGFL)[0]);
- }
+ if(1 == aSelection.size())
+ {
+ // einzelnes Obj an der Seite ausrichten
+ const SdrObject* pObj = aSelection[0];
+ const SdrPage* pPage = pObj->getSdrPageFromSdrObject();
+ const Rectangle aCurrentSnapRect(sdr::legacy::GetSnapRect(*pObj));
+ const SdrPageGridFrameList* pGFL = pPage->GetGridFrameList(*getAsSdrView(), &aCurrentSnapRect);
+ const SdrPageGridFrame* pFrame = 0;
+
+ if(pGFL && pGFL->GetCount())
+ {
+ // Writer
+ pFrame = &((*pGFL)[0]);
+ }
- if (pFrame!=NULL)
- { // Writer
- aBound=pFrame->GetUserArea();
+ if(pFrame)
+ {
+ // Writer
+ aBound = pFrame->GetUserArea();
+ }
+ else
+ {
+ aBound = pPage->GetInnerPageRange();
+ }
}
else
{
- aBound=Rectangle(pPage->GetLftBorder(),pPage->GetUppBorder(),
- pPage->GetWdt()-pPage->GetRgtBorder(),
- pPage->GetHgt()-pPage->GetLwrBorder());
+ if (bBoundRects)
+ {
+ aBound = sdr::legacy::GetAllObjBoundRange(aSelection);
+ }
+ else
+ {
+ aBound = getMarkedObjectSnapRange();
+ }
}
}
- else
+
+ const basegfx::B2DPoint aCenter(aBound.getCenter());
+
+ for(nm = 0; nm < aSelection.size(); nm++)
{
- if (bBoundRects)
- aBound=GetMarkedObjBoundRect();
- else
- aBound=GetMarkedObjRect();
- }
- }
- Point aCenter(aBound.Center());
- for (nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrObjTransformInfoRec aInfo;
- pObj->TakeObjInfo(aInfo);
- if (aInfo.bMoveAllowed && !pObj->IsMoveProtect())
- {
- // SdrPageView* pPV=pM->GetPageView();
- long nXMov=0;
- long nYMov=0;
- Rectangle aObjRect(bBoundRects?pObj->GetCurrentBoundRect():pObj->GetSnapRect());
- switch (eVert)
- {
- case SDRVALIGN_TOP : nYMov=aBound.Top() -aObjRect.Top() ; break;
- case SDRVALIGN_BOTTOM: nYMov=aBound.Bottom()-aObjRect.Bottom() ; break;
- case SDRVALIGN_CENTER: nYMov=aCenter.Y() -aObjRect.Center().Y(); break;
- default: break;
- }
- switch (eHor)
- {
- case SDRHALIGN_LEFT : nXMov=aBound.Left() -aObjRect.Left() ; break;
- case SDRHALIGN_RIGHT : nXMov=aBound.Right() -aObjRect.Right() ; break;
- case SDRHALIGN_CENTER: nXMov=aCenter.X() -aObjRect.Center().X(); break;
- default: break;
- }
- if (nXMov!=0 || nYMov!=0)
- {
- // #104104# SdrEdgeObj needs an extra SdrUndoGeoObj since the
- // connections may need to be saved
- if( bUndo )
+ SdrObject* pObj = aSelection[nm];
+ SdrObjTransformInfoRec aInfo;
+ pObj->TakeObjInfo(aInfo);
+
+ if(aInfo.mbMoveAllowed && !pObj->IsMoveProtect())
+ {
+ basegfx::B2DVector aMove(0.0, 0.0);
+ const basegfx::B2DRange aObjRange(bBoundRects
+ ? pObj->getObjectRange(getAsSdrView())
+ : sdr::legacy::GetSnapRange(*pObj));
+
+ switch(eVert)
{
- if( dynamic_cast<SdrEdgeObj*>(pObj) )
+ case SDRVALIGN_TOP : aMove.setY(aBound.getMinY() - aObjRange.getMinY()); break;
+ case SDRVALIGN_BOTTOM: aMove.setY(aBound.getMaxY() - aObjRange.getMaxY()); break;
+ case SDRVALIGN_CENTER: aMove.setY(aCenter.getY() - aObjRange.getCenter().getY()); break;
+ default: break;
+ }
+
+ switch(eHor)
+ {
+ case SDRHALIGN_LEFT : aMove.setX(aBound.getMinX() - aObjRange.getMinX()); break;
+ case SDRHALIGN_RIGHT : aMove.setX(aBound.getMaxX() - aObjRange.getMaxX()); break;
+ case SDRHALIGN_CENTER: aMove.setX(aCenter.getX() - aObjRange.getCenter().getX()); break;
+ default: break;
+ }
+
+ if(!aMove.equalZero())
+ {
+ // #104104# SdrEdgeObj needs an extra SdrUndoGeoObj since the
+ // connections may need to be saved
+ if(bUndo)
{
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
}
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj,Size(nXMov,nYMov)));
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(aMove));
}
-
- pObj->Move(Size(nXMov,nYMov));
}
}
- }
- if( bUndo )
- EndUndo();
+ if(bUndo)
+ {
+ EndUndo();
+ }
+ }
}
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 89e4d2603ba7..46d552814f4b 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -28,11 +28,10 @@
#include <editeng/outliner.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdogrp.hxx> // fuer's Gruppieren
-#include <svx/svdovirt.hxx> // fuer VirtualObject-Bundling (Writer)
#include <svx/svdopath.hxx> // fuer CombineObjects
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdograf.hxx> // fuer Possibilities
#include <svx/svdoole2.hxx> // und Mtf-Import
#include "svx/svdstr.hrc" // Namen aus der Resource
@@ -45,586 +44,715 @@
#include <editeng/eeitem.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-
#include <svx/svxdlg.hxx> //CHINA001
#include <svx/dialogs.hrc> //CHINA001
-
-// #i37011#
#include <svx/svdoashp.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdview.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrEditView::ImpBundleVirtObjOfMarkList()
-{
- // ... fehlende Implementation
-}
SdrObject* SdrEditView::GetMaxToTopObj(SdrObject* /*pObj*/) const
{
- return NULL;
+ return 0;
}
SdrObject* SdrEditView::GetMaxToBtmObj(SdrObject* /*pObj*/) const
{
- return NULL;
+ return 0;
}
-void SdrEditView::ObjOrderChanged(SdrObject* /*pObj*/, sal_uIntPtr /*nOldPos*/, sal_uIntPtr /*nNewPos*/)
+void SdrEditView::ObjOrderChanged(SdrObject* /*pObj*/, sal_uInt32 /*nOldPos*/, sal_uInt32 /*nNewPos*/)
{
}
void SdrEditView::MovMarkedToTop()
{
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- if (nAnz!=0)
+ if(areSdrObjectsSelected())
{
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ clearSdrObjectSelection(); // TTTT: check if this works
if( bUndo )
- BegUndo(ImpGetResStr(STR_EditMovToTop),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_MOVTOTOP);
-
- SortMarkedObjects();
- sal_uIntPtr nm;
- for (nm=0; nm<nAnz; nm++)
- { // Ordnums muessen alle stimmen!
- GetMarkedObjectByIndex(nm)->GetOrdNum();
+ {
+ BegUndo(ImpGetResStr(STR_EditMovToTop), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_MOVTOTOP);
}
- sal_Bool bChg=sal_False;
- SdrObjList* pOL0=NULL;
- sal_uIntPtr nNewPos=0;
- for (nm=nAnz; nm>0;)
+
+ sal_uInt32 nm(0);
+ SdrObjList* pOL0 = 0;
+ sal_uInt32 nNewPos(0);
+
+ for(nm = aSelection.size(); nm > 0;)
{
nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrObjList* pOL=pObj->GetObjList();
+ SdrObject* pObj = aSelection[nm];
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+
if (pOL!=pOL0)
{
- nNewPos=sal_uIntPtr(pOL->GetObjCount()-1);
+ nNewPos = sal_uInt32(pOL->GetObjCount() - 1);
pOL0=pOL;
}
- sal_uIntPtr nNowPos=pObj->GetOrdNumDirect();
- const Rectangle& rBR=pObj->GetCurrentBoundRect();
- sal_uIntPtr nCmpPos=nNowPos+1;
+
+ const sal_uInt32 nNowPos(pObj->GetNavigationPosition());
+ sal_uInt32 nCmpPos(nNowPos + 1);
SdrObject* pMaxObj=GetMaxToTopObj(pObj);
- if (pMaxObj!=NULL)
+
+ if(pMaxObj)
{
- sal_uIntPtr nMaxPos=pMaxObj->GetOrdNum();
- if (nMaxPos!=0)
+ sal_uInt32 nMaxPos(pMaxObj->GetNavigationPosition());
+
+ if(nMaxPos)
+ {
nMaxPos--;
+ }
+
if (nNewPos>nMaxPos)
+ {
nNewPos=nMaxPos; // diesen nicht ueberholen.
+ }
+
if (nNewPos<nNowPos)
+ {
nNewPos=nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
+ }
}
- sal_Bool bEnd=sal_False;
+
+ bool bEnd(false);
+ const basegfx::B2DRange aBoundRange(pObj->getObjectRange(getAsSdrView()));
+
while (nCmpPos<nNewPos && !bEnd)
{
SdrObject* pCmpObj=pOL->GetObj(nCmpPos);
- if (pCmpObj==NULL)
+
+ if(!pCmpObj)
{
DBG_ERROR("MovMarkedToTop(): Vergleichsobjekt nicht gefunden");
- bEnd=sal_True;
+ bEnd = true;
}
else if (pCmpObj==pMaxObj)
{
nNewPos=nCmpPos;
nNewPos--;
- bEnd=sal_True;
+ bEnd = true;
}
- else if (rBR.IsOver(pCmpObj->GetCurrentBoundRect()))
+ else if(aBoundRange.overlaps(pCmpObj->getObjectRange(getAsSdrView())))
{
nNewPos=nCmpPos;
- bEnd=sal_True;
+ bEnd = true;
}
else
{
nCmpPos++;
}
}
+
if (nNowPos!=nNewPos)
{
- bChg=sal_True;
- pOL->SetObjectOrdNum(nNowPos,nNewPos);
+ pOL->SetNavigationPosition(nNowPos, nNewPos);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj,nNowPos,nNewPos));
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj,nNowPos,nNewPos));
+ }
+
ObjOrderChanged(pObj,nNowPos,nNewPos);
}
+
nNewPos--;
}
if( bUndo )
+ {
EndUndo();
+ }
- if (bChg)
- MarkListHasChanged();
+ setSdrObjectSelection(aSelection); // TTTT: check if this works
}
}
void SdrEditView::MovMarkedToBtm()
{
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- if (nAnz!=0)
+ if(areSdrObjectsSelected())
{
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ clearSdrObjectSelection(); // TTTT: check if this works
if( bUndo )
- BegUndo(ImpGetResStr(STR_EditMovToBtm),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_MOVTOBTM);
-
- SortMarkedObjects();
- sal_uIntPtr nm;
- for (nm=0; nm<nAnz; nm++)
- { // Ordnums muessen alle stimmen!
- GetMarkedObjectByIndex(nm)->GetOrdNum();
+ {
+ BegUndo(ImpGetResStr(STR_EditMovToBtm), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_MOVTOBTM);
}
- sal_Bool bChg=sal_False;
- SdrObjList* pOL0=NULL;
- sal_uIntPtr nNewPos=0;
- for (nm=0; nm<nAnz; nm++)
+ sal_uInt32 nm(0);
+ SdrObjList* pOL0 = 0;
+ sal_uInt32 nNewPos(0);
+
+ for(nm = 0; nm < aSelection.size(); nm++)
{
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrObjList* pOL=pObj->GetObjList();
+ SdrObject* pObj = aSelection[nm];
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+
if (pOL!=pOL0)
{
nNewPos=0;
pOL0=pOL;
}
- sal_uIntPtr nNowPos=pObj->GetOrdNumDirect();
- const Rectangle& rBR=pObj->GetCurrentBoundRect();
- sal_uIntPtr nCmpPos=nNowPos; if (nCmpPos>0) nCmpPos--;
+
+ const sal_uInt32 nNowPos(pObj->GetNavigationPosition());
+ sal_uInt32 nCmpPos(nNowPos);
+
+ if(nCmpPos > 0)
+ {
+ nCmpPos--;
+ }
+
SdrObject* pMaxObj=GetMaxToBtmObj(pObj);
- if (pMaxObj!=NULL)
+
+ if(pMaxObj)
{
- sal_uIntPtr nMinPos=pMaxObj->GetOrdNum()+1;
+ sal_uInt32 nMinPos(pMaxObj->GetNavigationPosition() + 1);
+
if (nNewPos<nMinPos)
+ {
nNewPos=nMinPos; // diesen nicht ueberholen.
+ }
+
if (nNewPos>nNowPos)
+ {
nNewPos=nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
+ }
}
- sal_Bool bEnd=sal_False;
+
+ bool bEnd(false);
+ const basegfx::B2DRange aBoundRange(pObj->getObjectRange(getAsSdrView()));
// nNewPos ist an dieser Stelle noch die maximale Position,
// an der das Obj hinruecken darf, ohne seinen Vorgaenger
// (Mehrfachselektion) zu ueberholen.
+
while (nCmpPos>nNewPos && !bEnd)
{
SdrObject* pCmpObj=pOL->GetObj(nCmpPos);
- if (pCmpObj==NULL)
+
+ if(!pCmpObj)
{
DBG_ERROR("MovMarkedToBtm(): Vergleichsobjekt nicht gefunden");
- bEnd=sal_True;
+ bEnd = true;
}
else if (pCmpObj==pMaxObj)
{
nNewPos=nCmpPos;
nNewPos++;
- bEnd=sal_True;
+ bEnd = true;
}
- else if (rBR.IsOver(pCmpObj->GetCurrentBoundRect()))
+ else if(aBoundRange.overlaps(pCmpObj->getObjectRange(getAsSdrView())))
{
nNewPos=nCmpPos;
- bEnd=sal_True;
+ bEnd = true;
}
else
{
nCmpPos--;
}
}
+
if (nNowPos!=nNewPos)
{
- bChg=sal_True;
- pOL->SetObjectOrdNum(nNowPos,nNewPos);
+ pOL->SetNavigationPosition(nNowPos, nNewPos);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj,nNowPos,nNewPos));
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj,nNowPos,nNewPos));
+ }
+
ObjOrderChanged(pObj,nNowPos,nNewPos);
}
+
nNewPos++;
}
if(bUndo)
+ {
EndUndo();
+ }
- if(bChg)
- MarkListHasChanged();
+ setSdrObjectSelection(aSelection); // TTTT: check if this works
}
}
void SdrEditView::PutMarkedToTop()
{
- PutMarkedInFrontOfObj(NULL);
+ PutMarkedInFrontOfObj(0);
}
void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj)
{
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- if (nAnz!=0)
+ if(areSdrObjectsSelected())
{
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
- BegUndo(ImpGetResStr(STR_EditPutToTop),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_PUTTOTOP);
+ const bool bUndo(IsUndoEnabled());
+ SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- SortMarkedObjects();
+ if(bUndo)
+ {
+ BegUndo(ImpGetResStr(STR_EditPutToTop), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_PUTTOTOP);
+ }
- if (pRefObj!=NULL)
+ if(pRefObj)
{
// Damit "Vor das Objekt" auch funktioniert wenn die
// markierten Objekte bereits vor dem Objekt stehen
- sal_uIntPtr nRefMark=TryToFindMarkedObject(pRefObj);
- SdrMark aRefMark;
- if (nRefMark!=CONTAINER_ENTRY_NOTFOUND)
+ const bool bWasSelected(isSdrObjectSelected(*pRefObj));
+
+ if(bWasSelected)
{
- aRefMark=*GetSdrMarkByIndex(nRefMark);
- GetMarkedObjectListWriteAccess().DeleteMark(nRefMark);
+ removeSdrObjectFromSelection(*pRefObj);
}
+
PutMarkedToBtm();
- if (nRefMark!=CONTAINER_ENTRY_NOTFOUND)
+
+ if(bWasSelected)
{
- GetMarkedObjectListWriteAccess().InsertEntry(aRefMark);
- SortMarkedObjects();
+ addSdrObjectToSelection(*pRefObj);
}
}
- sal_uIntPtr nm;
- for (nm=0; nm<nAnz; nm++)
- { // Ordnums muessen alle stimmen!
- GetMarkedObjectByIndex(nm)->GetOrdNum();
- }
- sal_Bool bChg=sal_False;
- SdrObjList* pOL0=NULL;
- sal_uIntPtr nNewPos=0;
- for (nm=nAnz; nm>0;)
+
+ // selection was changed, re-fetch
+ aSelection = getSelectedSdrObjectVectorFromSdrMarkView();
+ clearSdrObjectSelection(); // TTTT: check if this works
+
+ sal_uInt32 nm(0);
+ SdrObjList* pOL0 = 0;
+ sal_uInt32 nNewPos(0);
+
+ for(nm = aSelection.size(); nm > 0;)
{
nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[nm];
+
if (pObj!=pRefObj)
{
- SdrObjList* pOL=pObj->GetObjList();
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+
if (pOL!=pOL0)
{
- nNewPos=sal_uIntPtr(pOL->GetObjCount()-1);
+ nNewPos = sal_uInt32(pOL->GetObjCount() - 1);
pOL0=pOL;
}
- sal_uIntPtr nNowPos=pObj->GetOrdNumDirect();
+
+ const sal_uInt32 nNowPos(pObj->GetNavigationPosition());
SdrObject* pMaxObj=GetMaxToTopObj(pObj);
- if (pMaxObj!=NULL)
+
+ if(pMaxObj)
{
- sal_uIntPtr nMaxOrd=pMaxObj->GetOrdNum(); // geht leider nicht anders
+ sal_uInt32 nMaxOrd(pMaxObj->GetNavigationPosition()); // geht leider nicht anders
+
if (nMaxOrd>0)
+ {
nMaxOrd--;
+ }
+
if (nNewPos>nMaxOrd)
+ {
nNewPos=nMaxOrd; // nicht ueberholen.
+ }
+
if (nNewPos<nNowPos)
+ {
nNewPos=nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
+ }
}
- if (pRefObj!=NULL)
+
+ if(pRefObj)
{
- if (pRefObj->GetObjList()==pObj->GetObjList())
+ if(pRefObj->getParentOfSdrObject() == pObj->getParentOfSdrObject())
{
- sal_uIntPtr nMaxOrd=pRefObj->GetOrdNum(); // geht leider nicht anders
+ const sal_uInt32 nMaxOrd(pRefObj->GetNavigationPosition()); // geht leider nicht anders
+
if (nNewPos>nMaxOrd)
+ {
nNewPos=nMaxOrd; // nicht ueberholen.
+ }
+
if (nNewPos<nNowPos)
+ {
nNewPos=nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
+ }
}
else
{
nNewPos=nNowPos; // andere PageView, also nicht veraendern
}
}
+
if (nNowPos!=nNewPos)
{
- bChg=sal_True;
- pOL->SetObjectOrdNum(nNowPos,nNewPos);
+ pOL->SetNavigationPosition(nNowPos, nNewPos);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj,nNowPos,nNewPos));
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj, nNowPos, nNewPos));
+ }
+
ObjOrderChanged(pObj,nNowPos,nNewPos);
}
+
nNewPos--;
- } // if (pObj!=pRefObj)
- } // for-Schleife ueber alle Markierten Objekte
+ }
+ }
if( bUndo )
+ {
EndUndo();
+ }
- if(bChg)
- MarkListHasChanged();
+ setSdrObjectSelection(aSelection); // TTTT: check if this works
}
}
void SdrEditView::PutMarkedToBtm()
{
- PutMarkedBehindObj(NULL);
+ PutMarkedBehindObj(0);
}
void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj)
{
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- if (nAnz!=0)
+ if(areSdrObjectsSelected())
{
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
+ SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
if( bUndo )
- BegUndo(ImpGetResStr(STR_EditPutToBtm),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_PUTTOBTM);
+ {
+ BegUndo(ImpGetResStr(STR_EditPutToBtm), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_PUTTOBTM);
+ }
- SortMarkedObjects();
- if (pRefObj!=NULL)
+ if(pRefObj)
{
// Damit "Hinter das Objekt" auch funktioniert wenn die
// markierten Objekte bereits hinter dem Objekt stehen
- sal_uIntPtr nRefMark=TryToFindMarkedObject(pRefObj);
- SdrMark aRefMark;
- if (nRefMark!=CONTAINER_ENTRY_NOTFOUND)
+ const bool bWasSelected(isSdrObjectSelected(*pRefObj));
+
+ if(bWasSelected)
{
- aRefMark=*GetSdrMarkByIndex(nRefMark);
- GetMarkedObjectListWriteAccess().DeleteMark(nRefMark);
+ removeSdrObjectFromSelection(*pRefObj);
}
+
PutMarkedToTop();
- if (nRefMark!=CONTAINER_ENTRY_NOTFOUND)
+
+ if(bWasSelected)
{
- GetMarkedObjectListWriteAccess().InsertEntry(aRefMark);
- SortMarkedObjects();
+ addSdrObjectToSelection(*pRefObj);
}
}
- sal_uIntPtr nm;
- for (nm=0; nm<nAnz; nm++) { // Ordnums muessen alle stimmen!
- GetMarkedObjectByIndex(nm)->GetOrdNum();
- }
- sal_Bool bChg=sal_False;
- SdrObjList* pOL0=NULL;
- sal_uIntPtr nNewPos=0;
- for (nm=0; nm<nAnz; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- if (pObj!=pRefObj) {
- SdrObjList* pOL=pObj->GetObjList();
- if (pOL!=pOL0) {
+
+ // selection was changed, re-fetch
+ aSelection = getSelectedSdrObjectVectorFromSdrMarkView();
+ clearSdrObjectSelection(); // TTTT: check if this works
+
+ sal_uInt32 nm(0);
+ SdrObjList* pOL0 = 0;
+ sal_uInt32 nNewPos(0);
+
+ for(nm = 0; nm < aSelection.size(); nm++)
+ {
+ SdrObject* pObj = aSelection[nm];
+
+ if(pObj != pRefObj)
+ {
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+
+ if(pOL != pOL0)
+ {
nNewPos=0;
pOL0=pOL;
}
- sal_uIntPtr nNowPos=pObj->GetOrdNumDirect();
+
+ const sal_uInt32 nNowPos(pObj->GetNavigationPosition());
SdrObject* pMinObj=GetMaxToBtmObj(pObj);
- if (pMinObj!=NULL) {
- sal_uIntPtr nMinOrd=pMinObj->GetOrdNum()+1; // geht leider nicht anders
- if (nNewPos<nMinOrd) nNewPos=nMinOrd; // nicht ueberholen.
- if (nNewPos>nNowPos) nNewPos=nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
- }
- if (pRefObj!=NULL) {
- if (pRefObj->GetObjList()==pObj->GetObjList()) {
- sal_uIntPtr nMinOrd=pRefObj->GetOrdNum(); // geht leider nicht anders
- if (nNewPos<nMinOrd) nNewPos=nMinOrd; // nicht ueberholen.
- if (nNewPos>nNowPos) nNewPos=nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
- } else {
+
+ if(pMinObj)
+ {
+ const sal_uInt32 nMinOrd(pMinObj->GetNavigationPosition() + 1); // geht leider nicht anders
+
+ if(nNewPos < nMinOrd)
+ {
+ nNewPos = nMinOrd; // nicht ueberholen.
+ }
+
+ if(nNewPos > nNowPos)
+ {
+ nNewPos = nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
+ }
+ }
+
+ if(pRefObj)
+ {
+ if(pRefObj->getParentOfSdrObject() == pObj->getParentOfSdrObject())
+ {
+ const sal_uInt32 nMinOrd(pRefObj->GetNavigationPosition()); // geht leider nicht anders
+
+ if(nNewPos < nMinOrd)
+ {
+ nNewPos = nMinOrd; // nicht ueberholen.
+ }
+
+ if(nNewPos > nNowPos)
+ {
+ nNewPos = nNowPos; // aber dabei auch nicht in die falsche Richtung schieben
+ }
+ }
+ else
+ {
nNewPos=nNowPos; // andere PageView, also nicht veraendern
}
}
- if (nNowPos!=nNewPos) {
- bChg=sal_True;
- pOL->SetObjectOrdNum(nNowPos,nNewPos);
+
+ if(nNowPos != nNewPos)
+ {
+ pOL->SetNavigationPosition(nNowPos, nNewPos);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj,nNowPos,nNewPos));
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj, nNowPos, nNewPos));
+ }
+
ObjOrderChanged(pObj,nNowPos,nNewPos);
}
+
nNewPos++;
- } // if (pObj!=pRefObj)
- } // for-Schleife ueber alle markierten Objekte
+ }
+ }
if(bUndo)
+ {
EndUndo();
+ }
- if(bChg)
- MarkListHasChanged();
+ setSdrObjectSelection(aSelection); // TTTT: check if this works
}
}
void SdrEditView::ReverseOrderOfMarked()
{
- SortMarkedObjects();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- if (nMarkAnz>0)
+ if(areSdrObjectsSelected())
{
- //sal_Bool bNeedBundle=sal_False;
- sal_Bool bChg=sal_False;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ clearSdrObjectSelection(); // TTTT: check if this works
+ const bool bUndo(IsUndoEnabled());
- bool bUndo = IsUndoEnabled();
- if( bUndo )
- BegUndo(ImpGetResStr(STR_EditRevOrder),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_REVORDER);
+ if(bUndo)
+ {
+ BegUndo(ImpGetResStr(STR_EditRevOrder), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_REVORDER);
+ }
- sal_uIntPtr a=0;
- do {
- // Markierung ueber mehrere PageViews berueksichtigen
- sal_uIntPtr b=a+1;
- while (b<nMarkAnz && GetSdrPageViewOfMarkedByIndex(b) == GetSdrPageViewOfMarkedByIndex(a)) b++;
- b--;
- SdrObjList* pOL=GetSdrPageViewOfMarkedByIndex(a)->GetObjList();
- sal_uIntPtr c=b;
- if (a<c) { // Sicherstellen, dass die OrdNums nicht Dirty sind
- GetMarkedObjectByIndex(a)->GetOrdNum();
- }
- while (a<c) {
- SdrObject* pObj1=GetMarkedObjectByIndex(a);
- SdrObject* pObj2=GetMarkedObjectByIndex(c);
- sal_uIntPtr nOrd1=pObj1->GetOrdNumDirect();
- sal_uIntPtr nOrd2=pObj2->GetOrdNumDirect();
- if( bUndo )
+ sal_uInt32 a(0);
+ sal_uInt32 b(aSelection.size() - 1);
+
+ while(a < b)
+ {
+ SdrObject* pObj1 = aSelection[a];
+ SdrObject* pObj2 = aSelection[b];
+
+ if(pObj1 && pObj2)
+ {
+ SdrObjList* pOL = pObj1->getParentOfSdrObject();
+
+ if(pOL && pOL == pObj2->getParentOfSdrObject())
{
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj1,nOrd1,nOrd2));
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj2,nOrd2-1,nOrd1));
+ const sal_uInt32 nTargetPos1(pObj2->GetNavigationPosition());
+ const sal_uInt32 nTargetPos2(pObj1->GetNavigationPosition());
+
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj1, pObj1->GetNavigationPosition(), nTargetPos1));
+ }
+
+ pOL->SetNavigationPosition(pObj1->GetNavigationPosition(), nTargetPos1);
+
+ // check if 2nd move is not needed; may be the case when the list
+ // has already correctly changed by 1st operation
+ if(pObj2->GetNavigationPosition() != nTargetPos2)
+ {
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectOrdNum(*pObj2, pObj2->GetNavigationPosition(), nTargetPos2));
+ }
+
+ pOL->SetNavigationPosition(pObj2->GetNavigationPosition(), nTargetPos2);
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "ReverseOrderOfMarked: objects with different parent in selection (!)");
}
- pOL->SetObjectOrdNum(nOrd1,nOrd2);
- // Obj 2 ist um eine Position nach vorn gerutscht, deshalb nun nOrd2-1
- pOL->SetObjectOrdNum(nOrd2-1,nOrd1);
- // Verwendung von Replace statt SetOrdNum wg. Performance (Neuberechnung der Ordnums)
- a++; c--;
- bChg=sal_True;
}
- a=b+1;
- } while (a<nMarkAnz);
+ else
+ {
+ OSL_ENSURE(false, "ReverseOrderOfMarked: selection contains NULL-SdrObjects (!)");
+ }
+
+ a++;
+ b--;
+ }
if(bUndo)
+ {
EndUndo();
+ }
- if(bChg)
- MarkListHasChanged();
+ setSdrObjectSelection(aSelection); // TTTT: check if this works
}
}
void SdrEditView::ImpCheckToTopBtmPossible()
{
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- if (nAnz==0)
- return;
- if (nAnz==1)
- { // Sonderbehandlung fuer Einzelmarkierung
- SdrObject* pObj=GetMarkedObjectByIndex(0);
- SdrObjList* pOL=pObj->GetObjList();
- sal_uIntPtr nMax=pOL->GetObjCount();
- sal_uIntPtr nMin=0;
- sal_uIntPtr nObjNum=pObj->GetOrdNum();
- SdrObject* pRestrict=GetMaxToTopObj(pObj);
- if (pRestrict!=NULL) {
- sal_uIntPtr nRestrict=pRestrict->GetOrdNum();
- if (nRestrict<nMax) nMax=nRestrict;
- }
- pRestrict=GetMaxToBtmObj(pObj);
- if (pRestrict!=NULL) {
- sal_uIntPtr nRestrict=pRestrict->GetOrdNum();
- if (nRestrict>nMin) nMin=nRestrict;
- }
- bToTopPossible=nObjNum<sal_uIntPtr(nMax-1);
- bToBtmPossible=nObjNum>nMin;
- } else { // Mehrfachselektion
- sal_uIntPtr nm=0;
- SdrObjList* pOL0=NULL;
- long nPos0=-1;
- while (!bToBtmPossible && nm<nAnz) { // 'nach hinten' checken
- SdrObject* pObj=GetMarkedObjectByIndex(nm);
- SdrObjList* pOL=pObj->GetObjList();
- if (pOL!=pOL0) {
- nPos0=-1;
- pOL0=pOL;
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(1 == aSelection.size())
+ {
+ // Sonderbehandlung fuer Einzelmarkierung
+ SdrObject* pObj = aSelection[0];
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+ sal_uInt32 nMax(pOL->GetObjCount());
+ sal_uInt32 nMin(0);
+ const sal_uInt32 nObjNum(pObj->GetNavigationPosition());
+ SdrObject* pRestrict=GetMaxToTopObj(pObj);
+
+ if(pRestrict)
+ {
+ const sal_uInt32 nRestrict(pRestrict->GetNavigationPosition());
+
+ if(nRestrict < nMax)
+ {
+ nMax = nRestrict;
+ }
}
- sal_uIntPtr nPos=pObj->GetOrdNum();
- bToBtmPossible=nPos>sal_uIntPtr(nPos0+1);
- nPos0=long(nPos);
- nm++;
+
+ pRestrict=GetMaxToBtmObj(pObj);
+
+ if(pRestrict)
+ {
+ const sal_uInt32 nRestrict(pRestrict->GetNavigationPosition());
+
+ if(nRestrict > nMin)
+ {
+ nMin = nRestrict;
+ }
+ }
+
+ mbToTopPossible = nObjNum < sal_uInt32(nMax - 1);
+ mbToBtmPossible = nObjNum > nMin;
}
- nm=nAnz;
- pOL0=NULL;
- nPos0=0x7FFFFFFF;
- while (!bToTopPossible && nm>0) { // 'nach vorn' checken
- nm--;
- SdrObject* pObj=GetMarkedObjectByIndex(nm);
- SdrObjList* pOL=pObj->GetObjList();
- if (pOL!=pOL0) {
- nPos0=pOL->GetObjCount();
- pOL0=pOL;
+ else
+ {
+ // Mehrfachselektion
+ sal_uInt32 nm(0);
+ SdrObjList* pOL0 = 0;
+ sal_Int32 nPos0(-1);
+
+ while(!mbToBtmPossible && nm < aSelection.size())
+ {
+ // 'nach hinten' checken
+ SdrObject* pObj = aSelection[nm];
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+
+ if(pOL != pOL0)
+ {
+ nPos0=-1;
+ pOL0=pOL;
+ }
+
+ const sal_uInt32 nPos(pObj->GetNavigationPosition());
+
+ mbToBtmPossible = (nPos > sal_uInt32(nPos0 + 1));
+ nPos0 = sal_Int32(nPos);
+ nm++;
+ }
+
+ nm = aSelection.size();
+ pOL0 = 0;
+ nPos0=0x7FFFFFFF;
+
+ while(!mbToTopPossible && nm > 0)
+ {
+ // 'nach vorn' checken
+ nm--;
+ SdrObject* pObj = aSelection[nm];
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+
+ if(pOL != pOL0)
+ {
+ nPos0=pOL->GetObjCount();
+ pOL0=pOL;
+ }
+
+ const sal_uInt32 nPos(pObj->GetNavigationPosition());
+
+ mbToTopPossible = (nPos + 1 < sal_uInt32(nPos0));
+ nPos0=nPos;
}
- sal_uIntPtr nPos=pObj->GetOrdNum();
- bToTopPossible=nPos+1<sal_uIntPtr(nPos0);
- nPos0=nPos;
}
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@ @@ @@ @@@@@ @@ @@ @@ @@@@@
-// @@ @@ @@ @@ @@@ @@@ @@ @@ @@ @@@ @@ @@
-// @@ @@ @@ @@@@@@@ @@ @@ @@ @@@@@@ @@
-// @@ @@ @@ @@@@@@@ @@@@@ @@ @@@@@@ @@@@
-// @@ @@ @@ @@ @ @@ @@ @@ @@ @@ @@@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@@@ @@ @@ @@@@@ @@ @@ @@ @@@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrEditView::ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) const
{
- if (pSource!=NULL) {
- SdrObjList* pOL=pSource->GetSubList();
- if (pOL!=NULL && !pSource->Is3DObj()) { // erstes Nichtgruppenobjekt aus der Gruppe holen
+ if(pSource)
+ {
+ SdrObjList* pOL = pSource->getChildrenOfSdrObject();
+
+ if(pOL && !pSource->IsE3dObject())
+ {
+ // erstes Nichtgruppenobjekt aus der Gruppe holen
SdrObjListIter aIter(*pOL,IM_DEEPNOGROUPS);
+
pSource=aIter.Next();
}
}
if(pSource && pDest)
{
- SfxItemSet aSet(pMod->GetItemPool(),
+ SfxItemSet aSet(pDest->GetObjectItemPool(),
SDRATTR_START, SDRATTR_NOTPERSIST_FIRST-1,
SDRATTR_NOTPERSIST_LAST+1, SDRATTR_END,
EE_ITEMS_START, EE_ITEMS_END,
0, 0); // #52757#, #52762#
aSet.Put(pSource->GetMergedItemSet());
-
pDest->ClearMergedItem();
pDest->SetMergedItemSet(aSet);
-
- pDest->NbcSetLayer(pSource->GetLayer());
- pDest->NbcSetStyleSheet(pSource->GetStyleSheet(), sal_True);
+ pDest->SetLayer(pSource->GetLayer());
+ pDest->SetStyleSheet(pSource->GetStyleSheet(), true);
}
}
-sal_Bool SdrEditView::ImpCanConvertForCombine1(const SdrObject* pObj) const
+bool SdrEditView::ImpCanConvertForCombine1(const SdrObject* pObj) const
{
- // #69711 : new condition IsLine() to be able to combine simple Lines
- sal_Bool bIsLine(sal_False);
-
- const SdrPathObj* pPath = PTR_CAST(SdrPathObj,pObj);
+ // #69711 : new condition isLine() to be able to combine simple Lines
+ bool bIsLine(false);
+ const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >(pObj);
if(pPath)
{
- bIsLine = pPath->IsLine();
+ bIsLine = pPath->isLine();
}
SdrObjTransformInfoRec aInfo;
+
pObj->TakeObjInfo(aInfo);
- return (aInfo.bCanConvToPath || aInfo.bCanConvToPoly || bIsLine);
+ return (aInfo.mbCanConvToPath || aInfo.mbCanConvToPoly || bIsLine);
}
-sal_Bool SdrEditView::ImpCanConvertForCombine(const SdrObject* pObj) const
+bool SdrEditView::ImpCanConvertForCombine(const SdrObject* pObj) const
{
- SdrObjList* pOL = pObj->GetSubList();
+ SdrObjList* pOL = pObj->getChildrenOfSdrObject();
- if(pOL && !pObj->Is3DObj())
+ if(pOL && !pObj->IsE3dObject())
{
SdrObjListIter aIter(*pOL, IM_DEEPNOGROUPS);
@@ -635,7 +763,7 @@ sal_Bool SdrEditView::ImpCanConvertForCombine(const SdrObject* pObj) const
// Es muessen alle Member einer Gruppe konvertierbar sein
if(!ImpCanConvertForCombine1(pObj1))
{
- return sal_False;
+ return false;
}
}
}
@@ -643,29 +771,29 @@ sal_Bool SdrEditView::ImpCanConvertForCombine(const SdrObject* pObj) const
{
if(!ImpCanConvertForCombine1(pObj))
{
- return sal_False;
+ return false;
}
}
- return sal_True;
+ return true;
}
-basegfx::B2DPolyPolygon SdrEditView::ImpGetPolyPolygon1(const SdrObject* pObj, sal_Bool bCombine) const
+basegfx::B2DPolyPolygon SdrEditView::ImpGetPolyPolygon1(const SdrObject* pObj, bool bCombine) const
{
basegfx::B2DPolyPolygon aRetval;
- SdrPathObj* pPath = PTR_CAST(SdrPathObj, pObj);
+ const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >(pObj);
if(bCombine && pPath && !pObj->GetOutlinerParaObject())
{
- aRetval = pPath->GetPathPoly();
+ aRetval = pPath->getB2DPolyPolygonInObjectCoordinates();
}
else
{
- SdrObject* pConvObj = pObj->ConvertToPolyObj(bCombine, sal_False);
+ SdrObject* pConvObj = pObj->ConvertToPolyObj(bCombine, false);
if(pConvObj)
{
- SdrObjList* pOL = pConvObj->GetSubList();
+ SdrObjList* pOL = pConvObj->getChildrenOfSdrObject();
if(pOL)
{
@@ -674,36 +802,36 @@ basegfx::B2DPolyPolygon SdrEditView::ImpGetPolyPolygon1(const SdrObject* pObj, s
while(aIter.IsMore())
{
SdrObject* pObj1 = aIter.Next();
- pPath = PTR_CAST(SdrPathObj, pObj1);
+ pPath = dynamic_cast< SdrPathObj* >(pObj1);
if(pPath)
{
- aRetval.append(pPath->GetPathPoly());
+ aRetval.append(pPath->getB2DPolyPolygonInObjectCoordinates());
}
}
}
else
{
- pPath = PTR_CAST(SdrPathObj, pConvObj);
+ pPath = dynamic_cast< SdrPathObj* >(pConvObj);
if(pPath)
{
- aRetval = pPath->GetPathPoly();
+ aRetval = pPath->getB2DPolyPolygonInObjectCoordinates();
}
}
- SdrObject::Free( pConvObj );
+ deleteSdrObjectSafeAndClearPointer( pConvObj );
}
}
return aRetval;
}
-basegfx::B2DPolyPolygon SdrEditView::ImpGetPolyPolygon(const SdrObject* pObj, sal_Bool bCombine) const
+basegfx::B2DPolyPolygon SdrEditView::ImpGetPolyPolygon(const SdrObject* pObj, bool bCombine) const
{
- SdrObjList* pOL = pObj->GetSubList();
+ SdrObjList* pOL = pObj->getChildrenOfSdrObject();
- if(pOL && !pObj->Is3DObj())
+ if(pOL && !pObj->IsE3dObject())
{
basegfx::B2DPolyPolygon aRetval;
SdrObjListIter aIter(*pOL, IM_DEEPNOGROUPS);
@@ -726,19 +854,19 @@ basegfx::B2DPolygon SdrEditView::ImpCombineToSinglePolygon(const basegfx::B2DPol
{
const sal_uInt32 nPolyCount(rPolyPolygon.count());
- if(0L == nPolyCount)
+ if(!nPolyCount)
{
return basegfx::B2DPolygon();
}
- else if(1L == nPolyCount)
+ else if(1 == nPolyCount)
{
- return rPolyPolygon.getB2DPolygon(0L);
+ return rPolyPolygon.getB2DPolygon(0);
}
else
{
- basegfx::B2DPolygon aRetval(rPolyPolygon.getB2DPolygon(0L));
+ basegfx::B2DPolygon aRetval(rPolyPolygon.getB2DPolygon(0));
- for(sal_uInt32 a(1L); a < nPolyCount; a++)
+ for(sal_uInt32 a(1); a < nPolyCount; a++)
{
basegfx::B2DPolygon aCandidate(rPolyPolygon.getB2DPolygon(a));
@@ -792,276 +920,327 @@ basegfx::B2DPolygon SdrEditView::ImpCombineToSinglePolygon(const basegfx::B2DPol
struct ImpDistributeEntry
{
SdrObject* mpObj;
- sal_Int32 mnPos;
- sal_Int32 mnLength;
+ double mfPosition;
+ double mfWidth;
+
+ // for ::std::sort
+ bool operator<(const ImpDistributeEntry& rComp) const
+ {
+ return (mfPosition < rComp.mfPosition);
+ }
};
-DECLARE_LIST(ImpDistributeEntryList, ImpDistributeEntry*)
+// moved to stl vector, double and transformations
+// TTTT: check changes
+typedef ::std::vector< ImpDistributeEntry* > ImpDistributeEntryVector;
void SdrEditView::DistributeMarkedObjects()
{
- sal_uInt32 nMark(GetMarkedObjectCount());
-
- if(nMark > 2)
+ if(areSdrObjectsSelected())
{
- SfxItemSet aNewAttr(pMod->GetItemPool());
- //CHINA001 SvxDistributeDialog* pDlg = new SvxDistributeDialog(NULL, aNewAttr);
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if(pFact)
- {
- AbstractSvxDistributeDialog *pDlg = pFact->CreateSvxDistributeDialog(NULL, aNewAttr);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- sal_uInt16 nResult = pDlg->Execute();
+ if(aSelection.size() > 2)
+ {
+ SfxItemSet aNewAttr(getSdrModelFromSdrView().GetItemPool());
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if(nResult == RET_OK)
+ if(pFact)
{
- SvxDistributeHorizontal eHor = pDlg->GetDistributeHor();
- SvxDistributeVertical eVer = pDlg->GetDistributeVer();
- ImpDistributeEntryList aEntryList;
- sal_uInt32 a, nInsPos, nFullLength;
+ AbstractSvxDistributeDialog *pDlg = pFact->CreateSvxDistributeDialog(0, aNewAttr);
+ DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ const sal_uInt16 nResult(pDlg->Execute());
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
- BegUndo();
-
- if(eHor != SvxDistributeHorizontalNone)
+ if(RET_OK == nResult)
{
- // build sorted entry list
- nFullLength = 0L;
+ clearSdrObjectSelection();
+ const SvxDistributeHorizontal eHor(pDlg->GetDistributeHor());
+ const SvxDistributeVertical eVer(pDlg->GetDistributeVer());
+ sal_uInt32 a(0);
+ double fFullLength(0.0);
+ const bool bUndo(IsUndoEnabled());
- for(a=0;a<nMark;a++)
+ if( bUndo )
{
- SdrMark* pMark = GetSdrMarkByIndex(a);
- ImpDistributeEntry* pNew = new ImpDistributeEntry;
+ BegUndo();
+ }
- pNew->mpObj = pMark->GetMarkedSdrObj();
- nInsPos = 0;
+ if(eHor != SvxDistributeHorizontalNone)
+ {
+ // build sorted entry list
+ ImpDistributeEntryVector aEntries;
+ aEntries.reserve(aSelection.size());
+ fFullLength = 0.0;
- switch(eHor)
+ for(a = 0; a < aSelection.size(); a++)
{
- case SvxDistributeHorizontalLeft:
- {
- pNew->mnPos = pNew->mpObj->GetSnapRect().Left();
- break;
- }
- case SvxDistributeHorizontalCenter:
- {
- pNew->mnPos = (pNew->mpObj->GetSnapRect().Right() + pNew->mpObj->GetSnapRect().Left()) / 2;
- break;
- }
- case SvxDistributeHorizontalDistance:
+ ImpDistributeEntry* pNew = new ImpDistributeEntry;
+ pNew->mpObj = aSelection[a];
+ const basegfx::B2DRange aOldObjSnapRange(sdr::legacy::GetSnapRange(*pNew->mpObj));
+
+ switch(eHor)
{
- pNew->mnLength = pNew->mpObj->GetSnapRect().GetWidth() + 1;
- nFullLength += pNew->mnLength;
- pNew->mnPos = (pNew->mpObj->GetSnapRect().Right() + pNew->mpObj->GetSnapRect().Left()) / 2;
- break;
+ case SvxDistributeHorizontalLeft:
+ {
+ pNew->mfPosition = aOldObjSnapRange.getMinX();
+ break;
+ }
+ case SvxDistributeHorizontalCenter:
+ {
+ pNew->mfPosition = aOldObjSnapRange.getCenterX();
+ break;
+ }
+ case SvxDistributeHorizontalDistance:
+ {
+ pNew->mfWidth = aOldObjSnapRange.getWidth();
+ fFullLength += pNew->mfWidth;
+ pNew->mfPosition = aOldObjSnapRange.getCenterX();
+ break;
+ }
+ case SvxDistributeHorizontalRight:
+ {
+ pNew->mfPosition = aOldObjSnapRange.getMaxX();
+ break;
+ }
+ default: break;
}
- case SvxDistributeHorizontalRight:
+
+ aEntries.push_back(pNew);
+ }
+
+ // sort by mfPosition
+ ::std::sort(aEntries.begin(), aEntries.end());
+
+ if(eHor == SvxDistributeHorizontalDistance)
+ {
+ // calc room in-between
+ const double fWidth(sdr::legacy::GetAllObjBoundRange(getSelectedSdrObjectVectorFromSdrMarkView()).getWidth());
+ const double fStepWidth((fWidth - fFullLength) / (double)(aEntries.size() - 1));
+ double fStepStart(aEntries[0]->mfPosition);
+
+ fStepStart += fStepWidth + ((aEntries[0]->mfWidth + aEntries[1]->mfWidth) * 0.5);
+
+ // move entries 1..n-1
+ for(a = 1; a < aEntries.size() - 1; a++)
{
- pNew->mnPos = pNew->mpObj->GetSnapRect().Right();
- break;
+ ImpDistributeEntry* pCurr = aEntries[a];
+ ImpDistributeEntry* pNext = aEntries[a + 1];
+ const double fDelta((fStepStart + 0.5) - pCurr->mfPosition);
+
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
+ }
+
+ sdr::legacy::transformSdrObject(
+ *pCurr->mpObj,
+ basegfx::tools::createTranslateB2DHomMatrix(fDelta, 0.0));
+
+ fStepStart += fStepWidth + ((pCurr->mfWidth + pNext->mfWidth) * 0.5);
}
- default: break;
}
+ else
+ {
+ // calc distances
+ const double fWidth(aEntries[aEntries.size() - 1]->mfPosition - aEntries[0]->mfPosition);
+ const double fStepWidth(fWidth / (double)(aEntries.size() - 1));
+ double fStepStart(aEntries[0]->mfPosition);
- while(nInsPos < aEntryList.Count() && aEntryList.GetObject(nInsPos)->mnPos < pNew->mnPos)
- nInsPos++;
+ fStepStart += fStepWidth;
- aEntryList.Insert(pNew, nInsPos);
- }
+ // move entries 1..n-1
+ for(a = 1 ; a < aEntries.size() - 1; a++)
+ {
+ ImpDistributeEntry* pCurr = aEntries[a];
+ const double fDelta((fStepStart + 0.5) - pCurr->mfPosition);
- if(eHor == SvxDistributeHorizontalDistance)
- {
- // calc room in-between
- sal_Int32 nWidth = GetAllMarkedBoundRect().GetWidth() + 1;
- double fStepWidth = ((double)nWidth - (double)nFullLength) / (double)(aEntryList.Count() - 1);
- double fStepStart = (double)aEntryList.GetObject(0)->mnPos;
- fStepStart += fStepWidth + (double)((aEntryList.GetObject(0)->mnLength + aEntryList.GetObject(1)->mnLength) / 2);
-
- // move entries 1..n-1
- for(a=1;a<aEntryList.Count()-1;a++)
- {
- ImpDistributeEntry* pCurr = aEntryList.GetObject(a);
- ImpDistributeEntry* pNext = aEntryList.GetObject(a+1);
- sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos;
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
- pCurr->mpObj->Move(Size(nDelta, 0));
- fStepStart += fStepWidth + (double)((pCurr->mnLength + pNext->mnLength) / 2);
+ if( bUndo )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
+ }
+
+ sdr::legacy::transformSdrObject(
+ *pCurr->mpObj,
+ basegfx::tools::createTranslateB2DHomMatrix(fDelta, 0.0));
+
+ fStepStart += fStepWidth;
+ }
}
- }
- else
- {
- // calc distances
- sal_Int32 nWidth = aEntryList.GetObject(aEntryList.Count() - 1)->mnPos - aEntryList.GetObject(0)->mnPos;
- double fStepWidth = (double)nWidth / (double)(aEntryList.Count() - 1);
- double fStepStart = (double)aEntryList.GetObject(0)->mnPos;
- fStepStart += fStepWidth;
-
- // move entries 1..n-1
- for(a=1;a<aEntryList.Count()-1;a++)
+
+ for(a = 0; a < aEntries.size(); a++)
{
- ImpDistributeEntry* pCurr = aEntryList.GetObject(a);
- sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos;
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
- pCurr->mpObj->Move(Size(nDelta, 0));
- fStepStart += fStepWidth;
+ delete aEntries[a];
}
}
- // clear list
- while(aEntryList.Count())
- delete aEntryList.Remove((sal_uIntPtr)0L);
- }
-
- if(eVer != SvxDistributeVerticalNone)
- {
- // build sorted entry list
- nFullLength = 0L;
-
- for(a=0;a<nMark;a++)
+ if(eVer != SvxDistributeVerticalNone)
{
- SdrMark* pMark = GetSdrMarkByIndex(a);
- ImpDistributeEntry* pNew = new ImpDistributeEntry;
+ // build sorted entry list
+ ImpDistributeEntryVector aEntries;
+ aEntries.reserve(aSelection.size());
+ fFullLength = 0.0;
- pNew->mpObj = pMark->GetMarkedSdrObj();
- nInsPos = 0;
-
- switch(eVer)
+ for(a = 0; a < aSelection.size(); a++)
{
- case SvxDistributeVerticalTop:
- {
- pNew->mnPos = pNew->mpObj->GetSnapRect().Top();
- break;
- }
- case SvxDistributeVerticalCenter:
- {
- pNew->mnPos = (pNew->mpObj->GetSnapRect().Bottom() + pNew->mpObj->GetSnapRect().Top()) / 2;
- break;
- }
- case SvxDistributeVerticalDistance:
+ ImpDistributeEntry* pNew = new ImpDistributeEntry;
+ pNew->mpObj = aSelection[a];
+ const basegfx::B2DRange aOldObjSnapRange(sdr::legacy::GetSnapRange(*pNew->mpObj));
+
+ switch(eVer)
{
- pNew->mnLength = pNew->mpObj->GetSnapRect().GetHeight() + 1;
- nFullLength += pNew->mnLength;
- pNew->mnPos = (pNew->mpObj->GetSnapRect().Bottom() + pNew->mpObj->GetSnapRect().Top()) / 2;
+ case SvxDistributeVerticalTop:
+ {
+ pNew->mfPosition = aOldObjSnapRange.getMinY();
+ break;
+ }
+ case SvxDistributeVerticalCenter:
+ {
+ pNew->mfPosition = aOldObjSnapRange.getCenterY();
+ break;
+ }
+ case SvxDistributeVerticalDistance:
+ {
+ pNew->mfWidth = aOldObjSnapRange.getHeight();
+ fFullLength += pNew->mfWidth;
+ pNew->mfPosition = aOldObjSnapRange.getCenterY();
+ break;
+ }
+ case SvxDistributeVerticalBottom:
+ {
+ pNew->mfPosition = aOldObjSnapRange.getMaxY();
break;
+ }
+ default: break;
}
- case SvxDistributeVerticalBottom:
+
+ aEntries.push_back(pNew);
+ }
+
+ // sort by mfPosition
+ ::std::sort(aEntries.begin(), aEntries.end());
+
+ if(eVer == SvxDistributeVerticalDistance)
+ {
+ // calc room in-between
+ const double fHeight(sdr::legacy::GetAllObjBoundRange(getSelectedSdrObjectVectorFromSdrMarkView()).getHeight());
+ const double fStepWidth((fHeight - fFullLength) / (double)(aEntries.size() - 1));
+ double fStepStart(aEntries[0]->mfPosition);
+
+ fStepStart += fStepWidth + ((aEntries[0]->mfWidth + aEntries[1]->mfWidth) * 0.5);
+
+ // move entries 1..n-1
+ for(a = 1; a < aEntries.size() - 1; a++)
{
- pNew->mnPos = pNew->mpObj->GetSnapRect().Bottom();
- break;
+ ImpDistributeEntry* pCurr = aEntries[a];
+ ImpDistributeEntry* pNext = aEntries[a + 1];
+ const double fDelta((fStepStart + 0.5) - pCurr->mfPosition);
+
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
+ }
+
+ sdr::legacy::transformSdrObject(
+ *pCurr->mpObj,
+ basegfx::tools::createTranslateB2DHomMatrix(0.0, fDelta));
+
+ fStepStart += fStepWidth + ((pCurr->mfWidth + pNext->mfWidth) * 0.5);
}
- default: break;
}
+ else
+ {
+ // calc distances
+ const double fHeight(aEntries[aEntries.size() - 1]->mfPosition - aEntries[0]->mfPosition);
+ const double fStepWidth(fHeight / (double)(aEntries.size() - 1));
+ double fStepStart(aEntries[0]->mfPosition);
- while(nInsPos < aEntryList.Count() && aEntryList.GetObject(nInsPos)->mnPos < pNew->mnPos)
- nInsPos++;
+ fStepStart += fStepWidth;
- aEntryList.Insert(pNew, nInsPos);
- }
+ // move entries 1..n-1
+ for(a = 1; a < aEntries.size() - 1; a++)
+ {
+ ImpDistributeEntry* pCurr = aEntries[a];
+ const double fDelta((fStepStart + 0.5) - pCurr->mfPosition);
- if(eVer == SvxDistributeVerticalDistance)
- {
- // calc room in-between
- sal_Int32 nHeight = GetAllMarkedBoundRect().GetHeight() + 1;
- double fStepWidth = ((double)nHeight - (double)nFullLength) / (double)(aEntryList.Count() - 1);
- double fStepStart = (double)aEntryList.GetObject(0)->mnPos;
- fStepStart += fStepWidth + (double)((aEntryList.GetObject(0)->mnLength + aEntryList.GetObject(1)->mnLength) / 2);
-
- // move entries 1..n-1
- for(a=1;a<aEntryList.Count()-1;a++)
+ if( bUndo )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
+ }
+
+ sdr::legacy::transformSdrObject(
+ *pCurr->mpObj,
+ basegfx::tools::createTranslateB2DHomMatrix(0.0, fDelta));
+
+ fStepStart += fStepWidth;
+ }
+ }
+
+ for(a = 0; a < aEntries.size(); a++)
{
- ImpDistributeEntry* pCurr = aEntryList.GetObject(a);
- ImpDistributeEntry* pNext = aEntryList.GetObject(a+1);
- sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos;
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
- pCurr->mpObj->Move(Size(0, nDelta));
- fStepStart += fStepWidth + (double)((pCurr->mnLength + pNext->mnLength) / 2);
+ delete aEntries[a];
}
}
- else
+
+ // UNDO-Comment and end of UNDO
+ SetUndoComment(ImpGetResStr(STR_DistributeMarkedObjects));
+
+ if( bUndo )
{
- // calc distances
- sal_Int32 nHeight = aEntryList.GetObject(aEntryList.Count() - 1)->mnPos - aEntryList.GetObject(0)->mnPos;
- double fStepWidth = (double)nHeight / (double)(aEntryList.Count() - 1);
- double fStepStart = (double)aEntryList.GetObject(0)->mnPos;
- fStepStart += fStepWidth;
-
- // move entries 1..n-1
- for(a=1;a<aEntryList.Count()-1;a++)
- {
- ImpDistributeEntry* pCurr = aEntryList.GetObject(a);
- sal_Int32 nDelta = (sal_Int32)(fStepStart + 0.5) - pCurr->mnPos;
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pCurr->mpObj));
- pCurr->mpObj->Move(Size(0, nDelta));
- fStepStart += fStepWidth;
- }
+ EndUndo();
}
- // clear list
- while(aEntryList.Count())
- delete aEntryList.Remove((sal_uIntPtr)0L);
+ setSdrObjectSelection(aSelection); // TTTT: check if this works
}
- // UNDO-Comment and end of UNDO
- SetUndoComment(ImpGetResStr(STR_DistributeMarkedObjects));
-
- if( bUndo )
- EndUndo();
+ delete(pDlg);
}
-
- delete(pDlg);
}
}
}
void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
{
- // #i73441# check content
- if(AreObjectsMarked())
+ if(areSdrObjectsSelected())
{
- SdrMarkList aRemove;
- SortMarkedObjects();
-
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
if( bUndo )
+ {
BegUndo();
+ }
- sal_uInt32 nInsPos=0xFFFFFFFF;
- const SdrObject* pAttrObj = NULL;
+ sal_uInt32 nInsPos(0xFFFFFFFF);
+ const SdrObject* pAttrObj = 0;
basegfx::B2DPolyPolygon aMergePolyPolygonA;
basegfx::B2DPolyPolygon aMergePolyPolygonB;
- SdrObjList* pInsOL = NULL;
- SdrPageView* pInsPV = NULL;
- sal_Bool bFirstObjectComplete(sal_False);
+ SdrObjList* pInsOL = 0;
+ bool bFirstObjectComplete(false);
// make sure selected objects are contour objects
// since now basegfx::tools::adaptiveSubdivide() is used, it is no longer
// necessary to use ConvertMarkedToPolyObj which will subdivide curves using the old
// mechanisms. In a next step the polygon clipper will even be able to clip curves...
- // ConvertMarkedToPolyObj(sal_True);
- ConvertMarkedToPathObj(sal_True);
- OSL_ENSURE(AreObjectsMarked(), "no more objects selected after preparations (!)");
-
- for(sal_uInt32 a=0;a<GetMarkedObjectCount();a++)
+ // ConvertMarkedToPolyObj(true);
+ ConvertMarkedToPathObj(true);
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ OSL_ENSURE(aSelection.size(), "no more objects selected after preparations (!)");
+ SdrObjectVector aRemove;
+ clearSdrObjectSelection();
+
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- SdrMark* pM = GetSdrMarkByIndex(a);
- SdrObject* pObj = pM->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[a];
if(ImpCanConvertForCombine(pObj))
{
if(!pAttrObj)
+ {
pAttrObj = pObj;
+ }
- nInsPos = pObj->GetOrdNum() + 1;
- pInsPV = pM->GetPageView();
- pInsOL = pObj->GetObjList();
+ nInsPos = pObj->GetNavigationPosition() + 1;
+ pInsOL = pObj->getParentOfSdrObject();
// #i76891# use single iter from SJ here whcih works on SdrObjects and takes
// groups into account by itself
@@ -1070,10 +1249,11 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
while(aIter.IsMore())
{
SdrObject* pCandidate = aIter.Next();
- SdrPathObj* pPathObj = PTR_CAST(SdrPathObj, pCandidate);
+ SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >(pCandidate);
+
if(pPathObj)
{
- basegfx::B2DPolyPolygon aTmpPoly(pPathObj->GetPathPoly());
+ basegfx::B2DPolyPolygon aTmpPoly(pPathObj->getB2DPolyPolygonInObjectCoordinates());
// #i76891# unfortunately ConvertMarkedToPathObj has converted all
// involved polygon data to curve segments, even if not necessary.
@@ -1117,11 +1297,11 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
// was there something added to the first poly?
if(!bFirstObjectComplete && aMergePolyPolygonA.count())
{
- bFirstObjectComplete = sal_True;
+ bFirstObjectComplete = true;
}
// move object to temporary delete list
- aRemove.InsertEntry(SdrMark(pObj, pM->GetPageView()));
+ aRemove.push_back(pObj);
}
}
@@ -1131,6 +1311,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
{
// merge all contained parts (OR)
static bool bTestXOR(false);
+
if(bTestXOR)
{
aMergePolyPolygonA = basegfx::tools::solvePolygonOperationXor(aMergePolyPolygonA, aMergePolyPolygonB);
@@ -1158,264 +1339,271 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
// #i73441# check insert list before taking actions
if(pInsOL)
{
- SdrPathObj* pPath = new SdrPathObj(OBJ_PATHFILL, aMergePolyPolygonA);
+ SdrPathObj* pPath = new SdrPathObj(getSdrModelFromSdrView(), aMergePolyPolygonA);
+
ImpCopyAttributes(pAttrObj, pPath);
- SdrInsertReason aReason(SDRREASON_VIEWCALL, pAttrObj);
- pInsOL->InsertObject(pPath, nInsPos, &aReason);
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath));
- MarkObj(pPath, pInsPV, sal_False, sal_True);
+ pInsOL->InsertObjectToSdrObjList(*pPath, nInsPos);
+
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pPath));
+ }
+
+ MarkObj(*pPath, false );
+ }
+ else
+ {
+ setSdrObjectSelection(aSelection);
}
- aRemove.ForceSort();
+ // sort as if selection to get comment identical to behaviour before selection change
+ sortSdrObjectSelection(aRemove);
+
switch(eMode)
{
case SDR_MERGE_MERGE:
{
SetUndoComment(
ImpGetResStr(STR_EditMergeMergePoly),
- aRemove.GetMarkDescription());
+ getSelectionDescription(aRemove));
break;
}
case SDR_MERGE_SUBSTRACT:
{
SetUndoComment(
ImpGetResStr(STR_EditMergeSubstractPoly),
- aRemove.GetMarkDescription());
+ getSelectionDescription(aRemove));
break;
}
case SDR_MERGE_INTERSECT:
{
SetUndoComment(
ImpGetResStr(STR_EditMergeIntersectPoly),
- aRemove.GetMarkDescription());
+ getSelectionDescription(aRemove));
break;
}
}
- DeleteMarkedList(aRemove);
+
+ deleteSdrObjectsWithUndo(aRemove);
if( bUndo )
+ {
EndUndo();
+ }
}
}
-void SdrEditView::CombineMarkedObjects(sal_Bool bNoPolyPoly)
+void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly)
{
- // #105899# Start of Combine-Undo put to front, else ConvertMarkedToPolyObj would
- // create a 2nd Undo-action and Undo-Comment.
-
- bool bUndo = IsUndoEnabled();
-
- // Undo-String will be set later
- if( bUndo )
- BegUndo(String(), String(), bNoPolyPoly ? SDRREPFUNC_OBJ_COMBINE_ONEPOLY : SDRREPFUNC_OBJ_COMBINE_POLYPOLY);
-
- // #105899# First, guarantee that all objects are converted to polyobjects,
- // especially for SdrGrafObj with bitmap filling this is necessary to not
- // loose the bitmap filling.
-
- // #i12392#
- // ConvertMarkedToPolyObj was too strong here, it will loose quality and
- // information when curve objects are combined. This can be replaced by
- // using ConvertMarkedToPathObj without changing the previous fix.
-
- // #i21250#
- // Instead of simply passing sal_True as LineToArea, use bNoPolyPoly as info
- // if this command is a 'Combine' or a 'Connect' command. On Connect it's sal_True.
- // To not concert line segments with a set line width to polygons in that case,
- // use this info. Do not convert LineToArea on Connect commands.
- // ConvertMarkedToPathObj(!bNoPolyPoly);
-
- // #114310#
- // This is used for Combine and Connect. In no case it is necessary to force
- // the content to curve, but it is also not good to force to polygons. Thus,
- // curve is the less information loosing one. Remember: This place is not
- // used for merge.
- // LineToArea is never necessary, both commands are able to take over the
- // set line style and to display it correctly. Thus, i will use a
- // ConvertMarkedToPathObj with a sal_False in any case. Only drawback is that
- // simple polygons will be changed to curves, but with no information loss.
- ConvertMarkedToPathObj(sal_False /* bLineToArea */);
-
- // continue as before
- basegfx::B2DPolyPolygon aPolyPolygon;
- SdrObjList* pAktOL = 0L;
- SdrMarkList aRemoveMerker;
-
- SortMarkedObjects();
- sal_uInt32 nInsPos(0xFFFFFFFF);
- SdrObjList* pInsOL = 0L;
- SdrPageView* pInsPV = 0L;
- const sal_uInt32 nAnz(GetMarkedObjectCount());
- const SdrObject* pAttrObj = 0L;
-
- for(sal_uInt32 a(nAnz); a > 0L; )
+ if(areSdrObjectsSelected())
{
- a--;
- SdrMark* pM = GetSdrMarkByIndex(a);
- SdrObject* pObj = pM->GetMarkedSdrObj();
- SdrObjList* pThisOL = pObj->GetObjList();
+ // #105899# Start of Combine-Undo put to front, else ConvertMarkedToPolyObj would
+ // create a 2nd Undo-action and Undo-Comment.
+ const bool bUndo(IsUndoEnabled());
- if(pAktOL != pThisOL)
+ // Undo-String will be set later
+ if( bUndo )
{
- pAktOL = pThisOL;
+ BegUndo(String(), String(), bNoPolyPoly ? SDRREPFUNC_OBJ_COMBINE_ONEPOLY : SDRREPFUNC_OBJ_COMBINE_POLYPOLY);
}
- if(ImpCanConvertForCombine(pObj))
+ // #105899# First, guarantee that all objects are converted to polyobjects,
+ // especially for SdrGrafObj with bitmap filling this is necessary to not
+ // loose the bitmap filling.
+
+ // #i12392#
+ // ConvertMarkedToPolyObj was too strong here, it will loose quality and
+ // information when curve objects are combined. This can be replaced by
+ // using ConvertMarkedToPathObj without changing the previous fix.
+
+ // #i21250#
+ // Instead of simply passing true as LineToArea, use bNoPolyPoly as info
+ // if this command is a 'Combine' or a 'Connect' command. On Connect it's true.
+ // To not concert line segments with a set line width to polygons in that case,
+ // use this info. Do not convert LineToArea on Connect commands.
+ // ConvertMarkedToPathObj(!bNoPolyPoly);
+
+ // #114310#
+ // This is used for Combine and Connect. In no case it is necessary to force
+ // the content to curve, but it is also not good to force to polygons. Thus,
+ // curve is the less information loosing one. Remember: This place is not
+ // used for merge.
+ // LineToArea is never necessary, both commands are able to take over the
+ // set line style and to display it correctly. Thus, i will use a
+ // ConvertMarkedToPathObj with a false in any case. Only drawback is that
+ // simple polygons will be changed to curves, but with no information loss.
+ ConvertMarkedToPathObj(false /* bLineToArea */);
+
+ // continue as before
+ basegfx::B2DPolyPolygon aPolyPolygon;
+ SdrObjList* pAktOL = 0;
+ SdrObjectVector aRemoveMerker;
+
+ sal_uInt32 nInsPos(0xFFFFFFFF);
+ SdrObjList* pInsOL = 0;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const SdrObject* pAttrObj = 0;
+ clearSdrObjectSelection();
+
+ for(sal_uInt32 a(aSelection.size()); a > 0;)
{
- // Obj merken fuer Attribute kopieren
- pAttrObj = pObj;
-
- // unfortunately ConvertMarkedToPathObj has converted all
- // involved polygon data to curve segments, even if not necessary.
- // It is better to try to reduce to more simple polygons.
- basegfx::B2DPolyPolygon aTmpPoly(basegfx::tools::simplifyCurveSegments(ImpGetPolyPolygon(pObj, sal_True)));
- aPolyPolygon.insert(0L, aTmpPoly);
+ a--;
+ SdrObject* pObj = aSelection[a];
+ SdrObjList* pThisOL = pObj->getParentOfSdrObject();
- if(!pInsOL)
+ if(pAktOL != pThisOL)
{
- nInsPos = pObj->GetOrdNum() + 1L;
- pInsPV = pM->GetPageView();
- pInsOL = pObj->GetObjList();
+ pAktOL = pThisOL;
}
- aRemoveMerker.InsertEntry(SdrMark(pObj, pM->GetPageView()));
- }
- }
+ if(ImpCanConvertForCombine(pObj))
+ {
+ // Obj merken fuer Attribute kopieren
+ pAttrObj = pObj;
- if(bNoPolyPoly)
- {
- basegfx::B2DPolygon aCombinedPolygon(ImpCombineToSinglePolygon(aPolyPolygon));
- aPolyPolygon.clear();
- aPolyPolygon.append(aCombinedPolygon);
- }
+ // unfortunately ConvertMarkedToPathObj has converted all
+ // involved polygon data to curve segments, even if not necessary.
+ // It is better to try to reduce to more simple polygons.
+ basegfx::B2DPolyPolygon aTmpPoly(basegfx::tools::simplifyCurveSegments(ImpGetPolyPolygon(pObj, true)));
+ aPolyPolygon.insert(0, aTmpPoly);
- const sal_uInt32 nPolyCount(aPolyPolygon.count());
+ if(!pInsOL)
+ {
+ nInsPos = pObj->GetNavigationPosition() + 1L;
+ pInsOL = pObj->getParentOfSdrObject();
+ }
- if(nPolyCount)
- {
- SdrObjKind eKind = OBJ_PATHFILL;
+ aRemoveMerker.push_back(pObj);
+ }
+ }
- if(nPolyCount > 1L)
+ if(bNoPolyPoly)
{
- aPolyPolygon.setClosed(true);
+ basegfx::B2DPolygon aCombinedPolygon(ImpCombineToSinglePolygon(aPolyPolygon));
+ aPolyPolygon.clear();
+ aPolyPolygon.append(aCombinedPolygon);
}
- else
- {
- // auf Polyline Checken
- const basegfx::B2DPolygon aPolygon(aPolyPolygon.getB2DPolygon(0L));
- const sal_uInt32 nPointCount(aPolygon.count());
- if(nPointCount <= 2L)
+ const sal_uInt32 nPolyCount(aPolyPolygon.count());
+
+ if(nPolyCount)
+ {
+ if(nPolyCount > 1L)
{
- eKind = OBJ_PATHLINE;
+ aPolyPolygon.setClosed(true);
}
else
{
- if(!aPolygon.isClosed())
- {
- const basegfx::B2DPoint aPointA(aPolygon.getB2DPoint(0L));
- const basegfx::B2DPoint aPointB(aPolygon.getB2DPoint(nPointCount - 1L));
- const double fDistance(basegfx::B2DVector(aPointB - aPointA).getLength());
- const double fJoinTolerance(10.0);
+ // auf Polyline Checken
+ const basegfx::B2DPolygon aPolygon(aPolyPolygon.getB2DPolygon(0L));
+ const sal_uInt32 nPointCount(aPolygon.count());
- if(fDistance < fJoinTolerance)
- {
- aPolyPolygon.setClosed(true);
- }
- else
+ if(nPointCount > 2)
+ {
+ if(!aPolygon.isClosed())
{
- eKind = OBJ_PATHLINE;
+ const basegfx::B2DPoint aPointA(aPolygon.getB2DPoint(0L));
+ const basegfx::B2DPoint aPointB(aPolygon.getB2DPoint(nPointCount - 1L));
+ const double fDistance(basegfx::B2DVector(aPointB - aPointA).getLength());
+ const double fJoinTolerance(10.0);
+
+ if(fDistance < fJoinTolerance)
+ {
+ aPolyPolygon.setClosed(true);
+ }
}
}
}
- }
- SdrPathObj* pPath = new SdrPathObj(eKind,aPolyPolygon);
+ SdrPathObj* pPath = new SdrPathObj(getSdrModelFromSdrView(), aPolyPolygon);
- // Attribute des untersten Objekts
- ImpCopyAttributes(pAttrObj, pPath);
+ // Attribute des untersten Objekts
+ ImpCopyAttributes(pAttrObj, pPath);
- // #100408# If LineStyle of pAttrObj is XLINE_NONE force to XLINE_SOLID to make visible.
- const XLineStyle eLineStyle = ((const XLineStyleItem&)pAttrObj->GetMergedItem(XATTR_LINESTYLE)).GetValue();
- const XFillStyle eFillStyle = ((const XFillStyleItem&)pAttrObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue();
+ // #100408# If LineStyle of pAttrObj is XLINE_NONE force to XLINE_SOLID to make visible.
+ const XLineStyle eLineStyle = ((const XLineStyleItem&)pAttrObj->GetMergedItem(XATTR_LINESTYLE)).GetValue();
+ const XFillStyle eFillStyle = ((const XFillStyleItem&)pAttrObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue();
- // #110635#
- // Take fill style/closed state of pAttrObj in account when deciding to change the line style
- sal_Bool bIsClosedPathObj(pAttrObj->ISA(SdrPathObj) && ((SdrPathObj*)pAttrObj)->IsClosed());
+ // #110635#
+ // Take fill style/closed state of pAttrObj in account when deciding to change the line style
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(pAttrObj);
+ const bool bIsClosedPathObj(pSdrPathObj && pSdrPathObj->isClosed());
- if(XLINE_NONE == eLineStyle && (XFILL_NONE == eFillStyle || !bIsClosedPathObj))
+ if(XLINE_NONE == eLineStyle && (XFILL_NONE == eFillStyle || !bIsClosedPathObj))
+ {
+ pPath->SetMergedItem(XLineStyleItem(XLINE_SOLID));
+ }
+
+ pInsOL->InsertObjectToSdrObjList(*pPath,nInsPos);
+
+ if( bUndo )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pPath));
+ }
+
+ // #111111#
+ // Here was a severe error: Without UnmarkAllObj, the new object was marked
+ // additionally to the two ones which are deleted below. As sal_Int32 as those are
+ // in the UNDO there is no problem, but as soon as they get deleted, the
+ // MarkList will contain deleted objects -> GPF.
+// UnmarkAllObj();
+ MarkObj(*pPath, false );
+ }
+ else
{
- pPath->SetMergedItem(XLineStyleItem(XLINE_SOLID));
+ setSdrObjectSelection(aSelection);
}
- SdrInsertReason aReason(SDRREASON_VIEWCALL,pAttrObj);
- pInsOL->InsertObject(pPath,nInsPos,&aReason);
+ // sort as if selection to get comment identical to behaviour before selection change
+ sortSdrObjectSelection(aRemoveMerker);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath));
-
- // #111111#
- // Here was a severe error: Without UnmarkAllObj, the new object was marked
- // additionally to the two ones which are deleted below. As long as those are
- // in the UNDO there is no problem, but as soon as they get deleted, the
- // MarkList will contain deleted objects -> GPF.
- UnmarkAllObj(pInsPV);
- MarkObj(pPath, pInsPV, sal_False, sal_True);
- }
+ {
+ SetUndoComment(
+ ImpGetResStr(bNoPolyPoly ? STR_EditCombine_OnePoly : STR_EditCombine_PolyPoly),
+ getSelectionDescription(aRemoveMerker));
+ }
- // UndoComment aus den tatsaechlich verwendeten Objekten zusammenbauen
- aRemoveMerker.ForceSort(); // wichtig fuer Remove (s.u.)
- if( bUndo )
- SetUndoComment(ImpGetResStr(bNoPolyPoly?STR_EditCombine_OnePoly:STR_EditCombine_PolyPoly),aRemoveMerker.GetMarkDescription());
+ // die tatsaechlich verwendeten Objekte aus der Liste entfernen
+ deleteSdrObjectsWithUndo(aRemoveMerker);
- // die tatsaechlich verwendeten Objekten aus der Liste entfernen
- DeleteMarkedList(aRemoveMerker);
- if( bUndo )
- EndUndo();
+ if( bUndo )
+ {
+ EndUndo();
+ }
+ }
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@ @@@@ @@ @@ @@@@ @@ @@ @@@@@@ @@ @@@@@
-// @@ @@ @@ @@ @@ @@@ @@@ @@ @@ @@@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@@@@@@ @@ @@ @@@@@@ @@ @@ @@
-// @@ @@ @@ @@@@ @@@@@@@ @@@@@@ @@@@@@ @@ @@ @@@@
-// @@ @@ @@ @@ @@ @ @@ @@ @@ @@ @@@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@ @@@@ @@ @@ @@ @@ @@ @@ @@ @@@@@ @@@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrEditView::ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPolygon, sal_Bool bMakeLines) const
+bool SdrEditView::ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPolygon, bool bMakeLines) const
{
- sal_Bool bCan(sal_False);
+ bool bCan(false);
const sal_uInt32 nPolygonCount(rPpolyPolygon.count());
- if(nPolygonCount >= 2L)
+ if(nPolygonCount >= 2)
{
// #i69172# dismantle makes sense with 2 or more polygons in a polyPolygon
- bCan = sal_True;
+ bCan = true;
}
- else if(bMakeLines && 1L == nPolygonCount)
+ else if(bMakeLines && 1 == nPolygonCount)
{
// #i69172# ..or with at least 2 edges (curves or lines)
const basegfx::B2DPolygon aPolygon(rPpolyPolygon.getB2DPolygon(0L));
const sal_uInt32 nPointCount(aPolygon.count());
- if(nPointCount > 2L)
+ if(nPointCount > 2)
{
- bCan = sal_True;
+ bCan = true;
}
}
return bCan;
}
-sal_Bool SdrEditView::ImpCanDismantle(const SdrObject* pObj, sal_Bool bMakeLines) const
+bool SdrEditView::ImpCanDismantle(const SdrObject* pObj, bool bMakeLines) const
{
- sal_Bool bOtherObjs(sal_False); // sal_True=andere Objekte ausser PathObj's vorhanden
- sal_Bool bMin1PolyPoly(sal_False); // sal_True=mind. 1 PolyPolygon mit mehr als ein Polygon vorhanden
- SdrObjList* pOL = pObj->GetSubList();
+ bool bOtherObjs(false); // true=andere Objekte ausser PathObj's vorhanden
+ bool bMin1PolyPoly(false); // true=mind. 1 PolyPolygon mit mehr als ein Polygon vorhanden
+ SdrObjList* pOL = pObj->getChildrenOfSdrObject();
if(pOL)
{
@@ -1426,51 +1614,51 @@ sal_Bool SdrEditView::ImpCanDismantle(const SdrObject* pObj, sal_Bool bMakeLines
while(aIter.IsMore() && !bOtherObjs)
{
const SdrObject* pObj1 = aIter.Next();
- const SdrPathObj* pPath = PTR_CAST(SdrPathObj, pObj1);
+ const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >( pObj1);
if(pPath)
{
- if(ImpCanDismantle(pPath->GetPathPoly(), bMakeLines))
+ if(ImpCanDismantle(pPath->getB2DPolyPolygonInObjectCoordinates(), bMakeLines))
{
- bMin1PolyPoly = sal_True;
+ bMin1PolyPoly = true;
}
SdrObjTransformInfoRec aInfo;
pObj1->TakeObjInfo(aInfo);
- if(!aInfo.bCanConvToPath)
+ if(!aInfo.mbCanConvToPath)
{
// Passiert z.B. im Falle Fontwork (Joe, 28-11-95)
- bOtherObjs = sal_True;
+ bOtherObjs = true;
}
}
else
{
- bOtherObjs = sal_True;
+ bOtherObjs = true;
}
}
}
else
{
- const SdrPathObj* pPath = PTR_CAST(SdrPathObj, pObj);
- const SdrObjCustomShape* pCustomShape = PTR_CAST(SdrObjCustomShape, pObj);
+ const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >(pObj);
+ const SdrObjCustomShape* pCustomShape = dynamic_cast< const SdrObjCustomShape* >(pObj);
// #i37011#
if(pPath)
{
- if(ImpCanDismantle(pPath->GetPathPoly(),bMakeLines))
+ if(ImpCanDismantle(pPath->getB2DPolyPolygonInObjectCoordinates(), bMakeLines))
{
- bMin1PolyPoly = sal_True;
+ bMin1PolyPoly = true;
}
SdrObjTransformInfoRec aInfo;
pObj->TakeObjInfo(aInfo);
- // #69711 : new condition IsLine() to be able to break simple Lines
- if(!(aInfo.bCanConvToPath || aInfo.bCanConvToPoly) && !pPath->IsLine())
+ // #69711 : new condition isLine() to be able to break simple Lines
+ if(!(aInfo.mbCanConvToPath || aInfo.mbCanConvToPoly) && !pPath->isLine())
{
// Passiert z.B. im Falle Fontwork (Joe, 28-11-95)
- bOtherObjs = sal_True;
+ bOtherObjs = true;
}
}
else if(pCustomShape)
@@ -1478,46 +1666,48 @@ sal_Bool SdrEditView::ImpCanDismantle(const SdrObject* pObj, sal_Bool bMakeLines
if(bMakeLines)
{
// allow break command
- bMin1PolyPoly = sal_True;
+ bMin1PolyPoly = true;
}
}
else
{
- bOtherObjs = sal_True;
+ bOtherObjs = true;
}
}
return bMin1PolyPoly && !bOtherObjs;
}
-void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, sal_uIntPtr& rPos, SdrPageView* pPV, sal_Bool bMakeLines)
+void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, sal_uInt32& rPos, bool bMakeLines)
{
- const SdrPathObj* pSrcPath = PTR_CAST(SdrPathObj, pObj);
- const SdrObjCustomShape* pCustomShape = PTR_CAST(SdrObjCustomShape, pObj);
-
- const bool bUndo = IsUndoEnabled();
+ const SdrPathObj* pSrcPath = dynamic_cast< const SdrPathObj* >(pObj);
+ const SdrObjCustomShape* pCustomShape = dynamic_cast< const SdrObjCustomShape* >(pObj);
+ const bool bUndo(IsUndoEnabled());
if(pSrcPath)
{
// #i74631# redesigned due to XpolyPolygon removal and explicit constructors
SdrObject* pLast = 0; // fuer die Zuweisung des OutlinerParaObject
- const basegfx::B2DPolyPolygon& rPolyPolygon(pSrcPath->GetPathPoly());
- const sal_uInt32 nPolyCount(rPolyPolygon.count());
+ const basegfx::B2DPolyPolygon aPolyPolygon(pSrcPath->getB2DPolyPolygonInObjectCoordinates());
+ const sal_uInt32 nPolyCount(aPolyPolygon.count());
for(sal_uInt32 a(0); a < nPolyCount; a++)
{
- const basegfx::B2DPolygon& rCandidate(rPolyPolygon.getB2DPolygon(a));
+ const basegfx::B2DPolygon& rCandidate(aPolyPolygon.getB2DPolygon(a));
const sal_uInt32 nPointCount(rCandidate.count());
if(!bMakeLines || nPointCount < 2)
{
- SdrPathObj* pPath = new SdrPathObj((SdrObjKind)pSrcPath->GetObjIdentifier(), basegfx::B2DPolyPolygon(rCandidate));
+ SdrPathObj* pPath = new SdrPathObj(getSdrModelFromSdrView(), basegfx::B2DPolyPolygon(rCandidate));
ImpCopyAttributes(pSrcPath, pPath);
pLast = pPath;
- SdrInsertReason aReason(SDRREASON_VIEWCALL, pSrcPath);
- rOL.InsertObject(pPath, rPos, &aReason);
+ rOL.InsertObjectToSdrObjList(*pPath, rPos);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath, sal_True));
- MarkObj(pPath, pPV, sal_False, sal_True);
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pPath));
+ }
+
+ MarkObj(*pPath, false );
rPos++;
}
else
@@ -1526,7 +1716,6 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
for(sal_uInt32 b(0); b < nLoopCount; b++)
{
- SdrObjKind eKind(OBJ_PLIN);
basegfx::B2DPolygon aNewPolygon;
const sal_uInt32 nNextIndex((b + 1) % nPointCount);
@@ -1538,21 +1727,23 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
rCandidate.getNextControlPoint(b),
rCandidate.getPrevControlPoint(nNextIndex),
rCandidate.getB2DPoint(nNextIndex));
- eKind = OBJ_PATHLINE;
}
else
{
aNewPolygon.append(rCandidate.getB2DPoint(nNextIndex));
}
- SdrPathObj* pPath = new SdrPathObj(eKind, basegfx::B2DPolyPolygon(aNewPolygon));
+ SdrPathObj* pPath = new SdrPathObj(getSdrModelFromSdrView(), basegfx::B2DPolyPolygon(aNewPolygon));
ImpCopyAttributes(pSrcPath, pPath);
pLast = pPath;
- SdrInsertReason aReason(SDRREASON_VIEWCALL, pSrcPath);
- rOL.InsertObject(pPath, rPos, &aReason);
+ rOL.InsertObjectToSdrObjList(*pPath, rPos);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath, sal_True));
- MarkObj(pPath, pPV, sal_False, sal_True);
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pPath));
+ }
+
+ MarkObj(*pPath, false );
rPos++;
}
}
@@ -1572,35 +1763,40 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
if(pReplacement)
{
- SdrObject* pCandidate = pReplacement->Clone();
+ SdrObject* pCandidate = pReplacement->CloneSdrObject();
DBG_ASSERT(pCandidate, "SdrEditView::ImpDismantleOneObject: Could not clone SdrObject (!)");
- pCandidate->SetModel(pCustomShape->GetModel());
+ //pCandidate->SetModel(pCustomShape->GetModel());
- if(((SdrShadowItem&)pCustomShape->GetMergedItem(SDRATTR_SHADOW)).GetValue())
+ if(((SdrOnOffItem&)pCustomShape->GetMergedItem(SDRATTR_SHADOW)).GetValue())
{
- if(pReplacement->ISA(SdrObjGroup))
+ if(dynamic_cast< const SdrObjGroup* >(pReplacement))
{
- pCandidate->SetMergedItem(SdrShadowItem(sal_True));
+ pCandidate->SetMergedItem(SdrOnOffItem(SDRATTR_SHADOW, true));
}
}
- SdrInsertReason aReason(SDRREASON_VIEWCALL, pCustomShape);
- rOL.InsertObject(pCandidate, rPos, &aReason);
+ rOL.InsertObjectToSdrObjList(*pCandidate, rPos);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pCandidate, true));
- MarkObj(pCandidate, pPV, sal_False, sal_True);
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pCandidate));
+ }
+
+ MarkObj(*pCandidate, false );
if(pCustomShape->HasText() && !pCustomShape->IsTextPath())
{
// #i37011# also create a text object and add at rPos + 1
SdrTextObj* pTextObj = (SdrTextObj*)SdrObjFactory::MakeNewObject(
- pCustomShape->GetObjInventor(), OBJ_TEXT, 0L, pCustomShape->GetModel());
+ getSdrModelFromSdrView(),
+ SdrObjectCreationInfo(OBJ_TEXT, pCustomShape->GetObjInventor()));
// Copy text content
OutlinerParaObject* pParaObj = pCustomShape->GetOutlinerParaObject();
+
if(pParaObj)
{
- pTextObj->NbcSetOutlinerParaObject(new OutlinerParaObject(*pParaObj));
+ pTextObj->SetOutlinerParaObject(new OutlinerParaObject(*pParaObj));
}
// copy all attributes
@@ -1610,565 +1806,674 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
aTargetItemSet.Put(XLineStyleItem(XLINE_NONE));
aTargetItemSet.Put(XFillStyleItem(XFILL_NONE));
- // get the text bounds and set at text object
- Rectangle aTextBounds = pCustomShape->GetSnapRect();
- if(pCustomShape->GetTextBounds(aTextBounds))
- {
- pTextObj->SetSnapRect(aTextBounds);
- }
-
- // if rotated, copy GeoStat, too.
- const GeoStat& rSourceGeo = pCustomShape->GetGeoStat();
- if(rSourceGeo.nDrehWink)
- {
- pTextObj->NbcRotate(
- pCustomShape->GetSnapRect().Center(), rSourceGeo.nDrehWink,
- rSourceGeo.nSin, rSourceGeo.nCos);
- }
+ // create transformation for text object.
+ // TTTT: Need to check text border distances handling
+ const basegfx::B2DRange aRawUnitTextRange(pCustomShape->getRawUnifiedTextRange());
+
+ // get TopLeft and BottomRight when applying current objects scale and translate,
+ // but leave out rot and shear TTTT need to check mirroring
+ const basegfx::B2DHomMatrix aJustScaleTranslate(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ pCustomShape->getSdrObjectScale(),
+ pCustomShape->getSdrObjectTranslate()));
+ const basegfx::B2DPoint aTopLeft(aJustScaleTranslate * aRawUnitTextRange.getMinimum());
+ const basegfx::B2DPoint aBottomRight(aJustScaleTranslate * aRawUnitTextRange.getMaximum());
+
+ // aBottomRight may now be top/left of aTopLeft containing the evtl. applied
+ // mirroring. Use it to create scale for the traget transformation. Also use
+ // already created TopLeft as translation
+ const basegfx::B2DHomMatrix aTextTransform(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aBottomRight - aTopLeft,
+ pCustomShape->getSdrObjectShearX(),
+ pCustomShape->getSdrObjectRotate(),
+ aTopLeft));
+
+ // set new transformation to text object
+ pTextObj->setSdrObjectTransformation(aTextTransform);
// set modified ItemSet at text object
pTextObj->SetMergedItemSet(aTargetItemSet);
// insert object
- rOL.InsertObject(pTextObj, rPos + 1, &aReason);
+ rOL.InsertObjectToSdrObjList(*pTextObj, rPos + 1);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pTextObj, true));
- MarkObj(pTextObj, pPV, sal_False, sal_True);
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pTextObj));
+ }
+
+ MarkObj(*pTextObj, false );
}
}
}
}
}
-void SdrEditView::DismantleMarkedObjects(sal_Bool bMakeLines)
+void SdrEditView::DismantleMarkedObjects(bool bMakeLines)
{
- //sal_uInt32 nCnt(0);
- // Temporaere Marklist
- SdrMarkList aRemoveMerker;
+ if(areSdrObjectsSelected())
+ {
+ // Temporaere Marklist
+ SdrObjectVector aRemoveMerker;
+ const bool bUndo(IsUndoEnabled());
- SortMarkedObjects();
+ if( bUndo )
+ {
+ // Der Comment wird spaeter zusammengebaut
+ BegUndo(String(), String(),
+ bMakeLines ? SDRREPFUNC_OBJ_DISMANTLE_LINES : SDRREPFUNC_OBJ_DISMANTLE_POLYS);
+ }
- const bool bUndo = IsUndoEnabled();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ clearSdrObjectSelection();
+ sal_uInt32 nm(0);
+ SdrObjList* pOL0 = 0;
- if( bUndo )
- {
- // Der Comment wird spaeter zusammengebaut
- BegUndo(String(), String(),
- bMakeLines ? SDRREPFUNC_OBJ_DISMANTLE_LINES : SDRREPFUNC_OBJ_DISMANTLE_POLYS);
- }
+ for(nm = aSelection.size(); nm > 0;)
+ {
+ nm--;
+ SdrObject* pObj = aSelection[nm];
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
- sal_uIntPtr nm;
- sal_uIntPtr nAnz=GetMarkedObjectCount();
- SdrObjList* pOL0=NULL;
- for (nm=nAnz; nm>0;) {
- nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- SdrObjList* pOL=pObj->GetObjList();
- if (pOL!=pOL0) { pOL0=pOL; pObj->GetOrdNum(); } // sicherstellen, dass OrdNums stimmen!
- if (ImpCanDismantle(pObj,bMakeLines)) {
- aRemoveMerker.InsertEntry(SdrMark(pObj,pM->GetPageView()));
- sal_uIntPtr nPos0=pObj->GetOrdNumDirect();
- sal_uIntPtr nPos=nPos0+1;
- SdrObjList* pSubList=pObj->GetSubList();
- if (pSubList!=NULL && !pObj->Is3DObj()) {
- SdrObjListIter aIter(*pSubList,IM_DEEPNOGROUPS);
- while (aIter.IsMore()) {
- const SdrObject* pObj1=aIter.Next();
- ImpDismantleOneObject(pObj1,*pOL,nPos,pPV,bMakeLines);
- }
- } else {
- ImpDismantleOneObject(pObj,*pOL,nPos,pPV,bMakeLines);
+ if(pOL != pOL0)
+ {
+ pOL0 = pOL;
}
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj,sal_True));
- pOL->RemoveObject(nPos0);
- if( !bUndo )
- SdrObject::Free(pObj);
+ if(ImpCanDismantle(pObj, bMakeLines))
+ {
+ aRemoveMerker.push_back(pObj);
+ const sal_uInt32 nPos0(pObj->GetNavigationPosition());
+ sal_uInt32 nPos(nPos0 + 1);
+ SdrObjList* pSubList = pObj->getChildrenOfSdrObject();
+
+ if(pSubList && !pObj->IsE3dObject())
+ {
+ SdrObjListIter aIter(*pSubList,IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ const SdrObject* pObj1=aIter.Next();
+
+ ImpDismantleOneObject(pObj1, *pOL, nPos, bMakeLines);
+ }
+ }
+ else
+ {
+ ImpDismantleOneObject(pObj, *pOL, nPos, bMakeLines);
+ }
+
+ if( bUndo )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
+ }
+
+ pOL->RemoveObjectFromSdrObjList(nPos0);
+
+ if( !bUndo )
+ {
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
+ }
}
- }
- if( bUndo )
- {
- // UndoComment aus den tatsaechlich verwendeten Objekten zusammenbauen
- SetUndoComment(ImpGetResStr(bMakeLines?STR_EditDismantle_Lines:STR_EditDismantle_Polys),aRemoveMerker.GetMarkDescription());
- // die tatsaechlich verwendeten Objekten aus der Liste entfernen
- EndUndo();
+ if( bUndo )
+ {
+ // UndoComment aus den tatsaechlich verwendeten Objekten zusammenbauen
+ const String aDescription(getSelectionDescription(aRemoveMerker));
+ SetUndoComment(ImpGetResStr(bMakeLines ? STR_EditDismantle_Lines : STR_EditDismantle_Polys), aDescription);
+
+ // die tatsaechlich verwendeten Objekten aus der Liste entfernen
+ EndUndo();
+ }
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// #### #### ### # # ####
-// # # # # # # # # #
-// # ## #### # # # # ####
-// # # # # # # # # #
-// #### # # ### ### #
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrEditView::GroupMarked(const SdrObject* pUserGrp)
{
- if (AreObjectsMarked())
+ if(areSdrObjectsSelected())
{
- SortMarkedObjects();
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const bool bUndo(IsUndoEnabled());
+ clearSdrObjectSelection();
- const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- BegUndo(ImpGetResStr(STR_EditGroup),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_GROUP);
+ BegUndo(ImpGetResStr(STR_EditGroup), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_GROUP);
- const sal_uIntPtr nAnz = GetMarkedObjectCount();
- for(sal_uIntPtr nm = nAnz; nm>0; )
+ for(sal_uInt32 nm(aSelection.size()); nm > 0;)
{
// UndoActions fuer alle betroffenen Objekte anlegen
nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj = pM->GetMarkedSdrObj();
- std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) );
- AddUndoActions( vConnectorUndoActions );
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoRemoveObject( *pObj ));
+ SdrObject* pObj = aSelection[nm];
+ std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) );
+
+ AddUndoActions( vConnectorUndoActions );
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoRemoveObject( *pObj ));
}
}
- SdrMarkList aNewMark;
- SdrPageView* pPV = GetSdrPageView();
+ SdrObjectVector aNewMark;
+ SdrPageView* pSdrPageView = GetSdrPageView();
- if(pPV)
+ if(pSdrPageView)
{
- SdrObjList* pAktLst=pPV->GetObjList();
+ SdrObjList* pAktLst = pSdrPageView->GetCurrentObjectList();
SdrObjList* pSrcLst=pAktLst;
SdrObjList* pSrcLst0=pSrcLst;
- SdrPage* pPage=pPV->GetPage();
- // sicherstellen, dass die OrdNums stimmen
- if (pSrcLst->IsObjOrdNumsDirty())
- pSrcLst->RecalcObjOrdNums();
- SdrObject* pGrp=NULL;
- SdrObject* pRefObj=NULL; // Referenz fuer InsertReason (-> rumankern im Writer)
- SdrObject* pRefObj1=NULL; // Referenz fuer InsertReason (-> rumankern im Writer)
- SdrObjList* pDstLst=NULL;
+ SdrPage& rPage = pSdrPageView->getSdrPageFromSdrPageView();
+ SdrObject* pGrp = 0;
+ SdrObject* pRefObj = 0; // Referenz fuer InsertReason (-> rumankern im Writer)
+ SdrObject* pRefObj1 = 0; // Referenz fuer InsertReason (-> rumankern im Writer)
+ SdrObjList* pDstLst = 0;
+
// Falls alle markierten Objekte aus Fremden Obj-Listen
// kommen, kommt das Gruppenobjekt an das Ende der Liste.
- sal_uIntPtr nInsPos=pSrcLst->GetObjCount();
- sal_Bool bNeedInsPos=sal_True;
- for (sal_uIntPtr nm=GetMarkedObjectCount(); nm>0;)
+ sal_uInt32 nInsPos(pSrcLst->GetObjCount());
+ bool bNeedInsPos(true);
+
+ for(sal_uInt32 nm(aSelection.size()); nm > 0;)
{
nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- if (pM->GetPageView()==pPV)
+
+ if(!pGrp)
{
- if (pGrp==NULL)
- {
- if (pUserGrp!=NULL)
- pGrp=pUserGrp->Clone();
- if (pGrp==NULL)
- pGrp=new SdrObjGroup;
- pDstLst=pGrp->GetSubList();
- DBG_ASSERT(pDstLst!=NULL,"Angebliches Gruppenobjekt liefert keine Objektliste");
- }
- SdrObject* pObj=pM->GetMarkedSdrObj();
- pSrcLst=pObj->GetObjList();
- if (pSrcLst!=pSrcLst0)
+ if(pUserGrp)
{
- if (pSrcLst->IsObjOrdNumsDirty())
- pSrcLst->RecalcObjOrdNums();
+ pGrp = pUserGrp->CloneSdrObject();
}
- sal_Bool bForeignList=pSrcLst!=pAktLst;
- sal_Bool bGrouped=pSrcLst!=pPage;
- if (!bForeignList && bNeedInsPos)
+
+ if(!pGrp)
{
- nInsPos=pObj->GetOrdNum(); // ua, damit sind alle ObjOrdNum der Page gesetzt
- nInsPos++;
- bNeedInsPos=sal_False;
+ pGrp = new SdrObjGroup(getSdrModelFromSdrView());
}
- pSrcLst->RemoveObject(pObj->GetOrdNumDirect());
- if (!bForeignList)
- nInsPos--; // InsertPos korregieren
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- pDstLst->InsertObject(pObj,0,&aReason);
- GetMarkedObjectListWriteAccess().DeleteMark(nm);
- if (pRefObj1==NULL)
- pRefObj1=pObj; // Das oberste sichtbare Objekt
- if (!bGrouped)
+
+ pDstLst = pGrp->getChildrenOfSdrObject();
+ DBG_ASSERT(pDstLst!=0,"Angebliches Gruppenobjekt liefert keine Objektliste");
+ }
+
+ SdrObject* pObj = aSelection[nm];
+ pSrcLst = pObj->getParentOfSdrObject();
+
+ const bool bForeignList(pSrcLst != pAktLst);
+ const bool bGrouped(pSrcLst != &rPage);
+
+ if (!bForeignList && bNeedInsPos)
+ {
+ nInsPos = pObj->GetNavigationPosition(); // ua, damit sind alle ObjOrdNum der Page gesetzt
+ nInsPos++;
+ bNeedInsPos = false;
+ }
+
+ pSrcLst->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+
+ if (!bForeignList)
+ {
+ nInsPos--; // InsertPos korregieren
+ }
+
+ pDstLst->InsertObjectToSdrObjList(*pObj, 0);
+ removeSdrObjectFromSelection(*pObj);
+
+ if(!pRefObj1)
+ {
+ pRefObj1=pObj; // Das oberste sichtbare Objekt
+ }
+
+ if (!bGrouped)
+ {
+ if(!pRefObj)
{
- if (pRefObj==NULL)
pRefObj=pObj; // Das oberste sichtbare nicht gruppierte Objekt
}
- pSrcLst0=pSrcLst;
}
+
+ pSrcLst0 = pSrcLst;
}
- if (pRefObj==NULL)
+
+ if(!pRefObj)
+ {
pRefObj=pRefObj1;
- if (pGrp!=NULL)
+ }
+
+ if(pGrp)
{
- aNewMark.InsertEntry(SdrMark(pGrp,pPV));
- sal_uIntPtr nAnz=pDstLst->GetObjCount();
- SdrInsertReason aReason(SDRREASON_VIEWCALL,pRefObj);
- pAktLst->InsertObject(pGrp,nInsPos,&aReason);
+ aNewMark.push_back(pGrp);
+ pAktLst->InsertObjectToSdrObjList(*pGrp, nInsPos);
+
if( bUndo )
{
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pGrp,true)); // Kein Recalc!
- for (sal_uIntPtr no=0; no<nAnz; no++)
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pGrp));
+ const sal_uInt32 nAnz(pDstLst->GetObjCount());
+
+ for(sal_uInt32 no(0); no < nAnz; no++)
{
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoInsertObject(*pDstLst->GetObj(no)));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoInsertObject(*pDstLst->GetObj(no)));
}
}
}
}
- GetMarkedObjectListWriteAccess().Merge(aNewMark);
- MarkListHasChanged();
+
+ if(aNewMark.size())
+ {
+ setSdrObjectSelection(aNewMark); // TTTT should be the same, check grouping
+ }
+ else
+ {
+ setSdrObjectSelection(aSelection); // TTTT: set old selection
+ }
if( bUndo )
+ {
EndUndo();
+ }
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// # # # # #### #### ### # # ####
-// # # ## # # # # # # # # # #
-// # # # # # # ## #### # # # # ####
-// # # # ## # # # # # # # # #
-// ### # # #### # # ### ### #
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrEditView::UnGroupMarked()
{
- SdrMarkList aNewMark;
-
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
- BegUndo(String(), String(), SDRREPFUNC_OBJ_UNGROUP);
-
- sal_uIntPtr nCount=0;
- XubString aName1;
- XubString aName;
- sal_Bool bNameOk=sal_False;
- for (sal_uIntPtr nm=GetMarkedObjectCount(); nm>0;) {
- nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pGrp=pM->GetMarkedSdrObj();
- SdrObjList* pSrcLst=pGrp->GetSubList();
- if (pSrcLst!=NULL) {
- nCount++;
- if (nCount==1) {
- pGrp->TakeObjNameSingul(aName); // Bezeichnung der Gruppe holen
- pGrp->TakeObjNamePlural(aName1); // Bezeichnung der Gruppe holen
- bNameOk=sal_True;
- } else {
- if (nCount==2) aName=aName1; // Pluralname setzen
- if (bNameOk) {
- XubString aStr;
- pGrp->TakeObjNamePlural(aStr); // Bezeichnung der Gruppe holen
-
- if(!aStr.Equals(aName))
- bNameOk = sal_False;
- }
- }
- sal_uIntPtr nDstCnt=pGrp->GetOrdNum();
- SdrObjList* pDstLst=pM->GetPageView()->GetObjList();
-
- // FIRST move contained objects to parent of group, so that
- // the contained objects are NOT migrated to the UNDO-ItemPool
- // when AddUndo(new SdrUndoDelObj(*pGrp)) is called.
- sal_uIntPtr nAnz=pSrcLst->GetObjCount();
- sal_uIntPtr no;
+ if(areSdrObjectsSelected() && GetSdrPageView())
+ {
+ SdrObjList* pDstLst = GetSdrPageView()->GetCurrentObjectList();
+
+ if(pDstLst)
+ {
+ const bool bUndo(IsUndoEnabled());
if( bUndo )
{
- for (no=nAnz; no>0;)
+ BegUndo(String(), String(), SDRREPFUNC_OBJ_UNGROUP);
+ }
+
+ sal_uInt32 nCount(0);
+ XubString aName1;
+ XubString aName;
+ bool bNameOk(false);
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ SdrObjectVector aNewMark;
+ clearSdrObjectSelection();
+
+ for(sal_uInt32 nm(aSelection.size()); nm > 0;)
+ {
+ nm--;
+ SdrObject* pGrp = aSelection[nm];
+ SdrObjList* pSrcLst = pGrp->getChildrenOfSdrObject();
+
+ if(pSrcLst)
{
- no--;
- SdrObject* pObj=pSrcLst->GetObj(no);
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoRemoveObject(*pObj));
+ nCount++;
+
+ if(1 == nCount)
+ {
+ pGrp->TakeObjNameSingul(aName); // Bezeichnung der Gruppe holen
+ pGrp->TakeObjNamePlural(aName1); // Bezeichnung der Gruppe holen
+ bNameOk = true;
+ }
+ else
+ {
+ if(2 == nCount)
+ {
+ aName = aName1; // Pluralname setzen
+ }
+
+ if(bNameOk)
+ {
+ XubString aStr;
+ pGrp->TakeObjNamePlural(aStr); // Bezeichnung der Gruppe holen
+
+ if(!aStr.Equals(aName))
+ {
+ bNameOk = false;
+ }
+ }
+ }
+
+ // FIRST move contained objects to parent of group, so that
+ // the contained objects are NOT migrated to the UNDO-ItemPool
+ // when AddUndo(new SdrUndoDelObj(*pGrp)) is called.
+ const sal_uInt32 nAnz(pSrcLst->GetObjCount());
+ sal_uInt32 nDstCnt(pGrp->GetNavigationPosition());
+ sal_uInt32 no;
+
+ if( bUndo )
+ {
+ for (no=nAnz; no>0;)
+ {
+ no--;
+ SdrObject* pObj=pSrcLst->GetObj(no);
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoRemoveObject(*pObj));
+ }
+ }
+
+ for (no=0; no<nAnz; no++)
+ {
+ SdrObject* pObj = pSrcLst->RemoveObjectFromSdrObjList(0);
+ pDstLst->InsertObjectToSdrObjList(*pObj, nDstCnt);
+
+ if( bUndo )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoInsertObject(*pObj));
+ }
+
+ nDstCnt++;
+
+ // Kein SortCheck beim einfuegen in die MarkList, denn das
+ // wuerde wg. pObj->GetNavigationPosition() jedesmal ein RecalcOrdNums()
+ // provozieren:
+ aNewMark.push_back(pObj);
+ }
+
+ if( bUndo )
+ {
+ // nDstCnt is right, because previous inserts move group
+ // object deeper and increase nDstCnt.
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pGrp));
+ }
+
+ pDstLst->RemoveObjectFromSdrObjList(nDstCnt);
+ removeSdrObjectFromSelection(*pGrp);
+
+ if(!bUndo)
+ {
+ deleteSdrObjectSafeAndClearPointer(pGrp);
+ }
}
}
- for (no=0; no<nAnz; no++)
+
+ if(nCount)
{
- SdrObject* pObj=pSrcLst->RemoveObject(0);
- SdrInsertReason aReason(SDRREASON_VIEWCALL,pGrp);
- pDstLst->InsertObject(pObj,nDstCnt,&aReason);
- if( bUndo )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoInsertObject(*pObj,true));
- nDstCnt++;
- // Kein SortCheck beim einfuegen in die MarkList, denn das
- // wuerde wg. pObj->GetOrdNum() jedesmal ein RecalcOrdNums()
- // provozieren:
- aNewMark.InsertEntry(SdrMark(pObj,pM->GetPageView()),sal_False);
+ if (!bNameOk)
+ {
+ aName=ImpGetResStr(STR_ObjNamePluralGRUP); // Oberbegriff Gruppenobjekte verwenden, wenn verschiedene Objekte.
+ }
+
+ SetUndoComment(ImpGetResStr(STR_EditUngroup),aName);
}
if( bUndo )
{
- // Now it is safe to add the delete-UNDO which trigers the
- // MigrateItemPool now only for itself, not for the subobjects.
- // nDstCnt is right, because previous inserts move group
- // object deeper and increase nDstCnt.
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pGrp));
+ EndUndo();
}
- pDstLst->RemoveObject(nDstCnt);
- if( !bUndo )
- SdrObject::Free(pGrp);
-
- GetMarkedObjectListWriteAccess().DeleteMark(nm);
+ if(!aNewMark.empty())
+ {
+ setSdrObjectSelection(aNewMark); // TTTT: check if this is the same
+ }
+ else
+ {
+ setSdrObjectSelection(aSelection);
+ }
}
}
- if (nCount!=0)
- {
- if (!bNameOk)
- aName=ImpGetResStr(STR_ObjNamePluralGRUP); // Oberbegriff Gruppenobjekte verwenden, wenn verschiedene Objekte.
- SetUndoComment(ImpGetResStr(STR_EditUngroup),aName);
- }
-
- if( bUndo )
- EndUndo();
-
- if (nCount!=0)
- {
- GetMarkedObjectListWriteAccess().Merge(aNewMark,sal_True); // Durch das obige Einsortieren ist aNewMark genau verkehrtherum
- MarkListHasChanged();
- }
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// ### ### # # # # ##### #### ##### ##### ### #### ### # # #
-// # # # # ## # # # # # # # # # # # # # # # # #
-// # # # # # # # # #### #### # # # # #### # # # #
-// # # # # # ## # # # # # # # # # # # # # #
-// ### ### # # # ##### # # # # ### # ### #### #
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrObject* SdrEditView::ImpConvertOneObj(SdrObject* pObj, sal_Bool bPath, sal_Bool bLineToArea)
+SdrObject* SdrEditView::ImpConvertOneObj(SdrObject* pObj, bool bPath, bool bLineToArea)
{
SdrObject* pNewObj = pObj->ConvertToPolyObj(bPath, bLineToArea);
- if (pNewObj!=NULL)
+
+ if(pNewObj)
{
- SdrObjList* pOL=pObj->GetObjList();
- DBG_ASSERT(pOL!=NULL,"ConvertTo: Obj liefert keine ObjList");
- if (pOL!=NULL)
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+ DBG_ASSERT(pOL!=0,"ConvertTo: Obj liefert keine ObjList");
+
+ if(pOL)
{
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pObj,*pNewObj));
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoReplaceObject(*pObj, *pNewObj));
+ }
- pOL->ReplaceObject(pNewObj,pObj->GetOrdNum());
+ pOL->ReplaceObjectInSdrObjList(*pNewObj, pObj->GetNavigationPosition());
if( !bUndo )
- SdrObject::Free(pObj);
+ {
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
}
}
+
return pNewObj;
}
-void SdrEditView::ImpConvertTo(sal_Bool bPath, sal_Bool bLineToArea)
+void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea)
{
- sal_Bool bMrkChg=sal_False;
- sal_Bool bModChg=sal_False;
- if (AreObjectsMarked()) {
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_uInt16 nDscrID=0;
+ bool bModChg(false);
+
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt16 nDscrID(0);
+ clearSdrObjectSelection();
+
if(bLineToArea)
{
- if(nMarkAnz == 1)
+ if(1 == aSelection.size())
+ {
nDscrID = STR_EditConvToContour;
+ }
else
+ {
nDscrID = STR_EditConvToContours;
+ }
- BegUndo(ImpGetResStr(nDscrID), GetDescriptionOfMarkedObjects());
+ BegUndo(ImpGetResStr(nDscrID), getSelectionDescription(aSelection));
}
else
{
- if (bPath) {
- if (nMarkAnz==1) nDscrID=STR_EditConvToCurve;
- else nDscrID=STR_EditConvToCurves;
- BegUndo(ImpGetResStr(nDscrID),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_CONVERTTOPATH);
- } else {
- if (nMarkAnz==1) nDscrID=STR_EditConvToPoly;
- else nDscrID=STR_EditConvToPolys;
- BegUndo(ImpGetResStr(nDscrID),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_CONVERTTOPOLY);
+ if(bPath)
+ {
+ if(1 == aSelection.size())
+ {
+ nDscrID = STR_EditConvToCurve;
+ }
+ else
+ {
+ nDscrID = STR_EditConvToCurves;
+ }
+
+ BegUndo(ImpGetResStr(nDscrID), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_CONVERTTOPATH);
+ }
+ else
+ {
+ if(1 == aSelection.size())
+ {
+ nDscrID = STR_EditConvToPoly;
+ }
+ else
+ {
+ nDscrID = STR_EditConvToPolys;
+ }
+
+ BegUndo(ImpGetResStr(nDscrID), getSelectionDescription(aSelection), SDRREPFUNC_OBJ_CONVERTTOPOLY);
}
}
- for (sal_uIntPtr nm=nMarkAnz; nm>0;) {
+
+ SdrObjectVector aNewSelection;
+
+ for(sal_uInt32 nm(aSelection.size()); nm > 0;)
+ {
nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- if (pObj->IsGroupObject() && !pObj->Is3DObj()) {
+ SdrObject* pObj = aSelection[nm];
+
+ if(pObj->getChildrenOfSdrObject() && !pObj->IsE3dObject())
+ {
SdrObject* pGrp=pObj;
SdrObjListIter aIter(*pGrp,IM_DEEPNOGROUPS);
- while (aIter.IsMore()) {
+
+ while(aIter.IsMore())
+ {
pObj=aIter.Next();
- if (ImpConvertOneObj(pObj,bPath,bLineToArea)) bModChg=sal_True;
+
+ if(ImpConvertOneObj(pObj, bPath, bLineToArea))
+ {
+ bModChg = true;
+ }
}
- } else {
+ }
+ else
+ {
SdrObject* pNewObj=ImpConvertOneObj(pObj,bPath,bLineToArea);
- if (pNewObj!=NULL) {
- bModChg=sal_True;
- bMrkChg=sal_True;
- GetMarkedObjectListWriteAccess().ReplaceMark(SdrMark(pNewObj,pPV),nm);
+
+ if(pNewObj)
+ {
+ bModChg = true;
+ aNewSelection.push_back(pNewObj);
}
}
}
+
EndUndo();
- if (bMrkChg) AdjustMarkHdl();
- if (bMrkChg) MarkListHasChanged();
+
+ if(!aNewSelection.empty())
+ {
+ setSdrObjectSelection(aNewSelection); // TTTT check if it's the same
+ }
+ else
+ {
+ setSdrObjectSelection(aSelection);
+ }
}
}
-void SdrEditView::ConvertMarkedToPathObj(sal_Bool bLineToArea)
+void SdrEditView::ConvertMarkedToPathObj(bool bLineToArea)
{
- ImpConvertTo(sal_True, bLineToArea);
+ ImpConvertTo(true, bLineToArea);
}
-void SdrEditView::ConvertMarkedToPolyObj(sal_Bool bLineToArea)
+void SdrEditView::ConvertMarkedToPolyObj(bool bLineToArea)
{
- ImpConvertTo(sal_False, bLineToArea);
+ ImpConvertTo(false, bLineToArea);
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// # # ##### ##### ### ##### # # ##### # # # #### ### #### #####
-// ## ## # # # # # # # # # ## ## # # # # # # #
-// # # # #### # ##### ### # # #### ### # # # # #### # # #### #
-// # # # # # # # # # # # # # # # # # # #
-// # # ##### # # # # # #### ##### # # # # ### # # #
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo)
{
- const bool bUndo = IsUndoEnabled();
-
- if( bUndo )
- BegUndo(String(), String(), SDRREPFUNC_OBJ_IMPORTMTF);
-
- SortMarkedObjects();
- SdrMarkList aForTheDescription;
- SdrMarkList aNewMarked;
- sal_uIntPtr nAnz=GetMarkedObjectCount();
+ if(areSdrObjectsSelected())
+ {
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ SdrObjectVector aNewMarked;
- for (sal_uIntPtr nm=nAnz; nm>0;)
- { // Undo Objekte fuer alle neuen Objekte erzeugen
- // zwischen den Metafiles auf Abbruch testen
- if( pProgrInfo != NULL )
+ if(bUndo)
{
- pProgrInfo->SetNextObject();
- if(!pProgrInfo->ReportActions(0))
- break;
+ BegUndo(
+ ImpGetResStr(STR_EditImportMtf),
+ getSelectionDescription(aSelection),
+ SDRREPFUNC_OBJ_IMPORTMTF);
}
- nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- SdrObjList* pOL=pObj->GetObjList();
- sal_uIntPtr nInsPos=pObj->GetOrdNum()+1;
- SdrGrafObj* pGraf=PTR_CAST(SdrGrafObj,pObj);
- SdrOle2Obj* pOle2=PTR_CAST(SdrOle2Obj,pObj);
- sal_uIntPtr nInsAnz=0;
- Rectangle aLogicRect;
+ clearSdrObjectSelection();
- if(pGraf && (pGraf->HasGDIMetaFile() || pGraf->isEmbeddedSvg()))
+ for(sal_uInt32 nm(aSelection.size()); nm > 0;)
{
- GDIMetaFile aMetaFile;
-
- if(pGraf->HasGDIMetaFile())
+ // Undo Objekte fuer alle neuen Objekte erzeugen
+ // zwischen den Metafiles auf Abbruch testen
+ if(pProgrInfo)
{
- aMetaFile = pGraf->GetTransformedGraphic(SDRGRAFOBJ_TRANSFORMATTR_COLOR|SDRGRAFOBJ_TRANSFORMATTR_MIRROR).GetGDIMetaFile();
- }
- else if(pGraf->isEmbeddedSvg())
- {
- aMetaFile = pGraf->getMetafileFromEmbeddedSvg();
+ pProgrInfo->SetNextObject();
+
+ if(!pProgrInfo->ReportActions(0))
+ {
+ break;
+ }
}
- if(aMetaFile.GetActionCount())
+ nm--;
+ SdrObject* pObj = aSelection[nm];
+ SdrObjList* pOL = pObj->getParentOfSdrObject();
+ const sal_uInt32 nInsPos(pObj->GetNavigationPosition() + 1);
+ SdrGrafObj* pGraf = dynamic_cast< SdrGrafObj* >(pObj);
+ SdrOle2Obj* pOle2 = dynamic_cast< SdrOle2Obj* >(pObj);
+ sal_uInt32 nInsAnz(0);
+ GDIMetaFile aMetaFile;
+ basegfx::B2DHomMatrix aObjectTransform;
+
+ if(pGraf && (pGraf->HasGDIMetaFile() || pGraf->isEmbeddedSvg()))
{
- aLogicRect = pGraf->GetLogicRect();
- ImpSdrGDIMetaFileImport aFilter(*pMod, pObj->GetLayer(), aLogicRect);
- nInsAnz = aFilter.DoImport(aMetaFile, *pOL, nInsPos, pProgrInfo);
+ if(pGraf->HasGDIMetaFile())
+ {
+ aMetaFile = pGraf->GetTransformedGraphic(
+ SDRGRAFOBJ_TRANSFORMATTR_COLOR|SDRGRAFOBJ_TRANSFORMATTR_MIRROR).GetGDIMetaFile();
+ }
+ else if(pGraf->isEmbeddedSvg())
+ {
+ aMetaFile = pGraf->getMetafileFromEmbeddedSvg();
+ }
+
+ if(aMetaFile.GetActionCount())
+ {
+ aObjectTransform = pObj->getSdrObjectTransformation();
+ }
}
- }
- if ( pOle2!=NULL && pOle2->GetGraphic() )
- {
- aLogicRect = pOle2->GetLogicRect();
- ImpSdrGDIMetaFileImport aFilter(*pMod, pObj->GetLayer(), aLogicRect);
- nInsAnz = aFilter.DoImport(pOle2->GetGraphic()->GetGDIMetaFile(), *pOL, nInsPos, pProgrInfo);
- }
- if (nInsAnz!=0)
- {
- // transformation
- GeoStat aGeoStat(pGraf ? pGraf->GetGeoStat() : pOle2->GetGeoStat());
- sal_uIntPtr nObj=nInsPos;
- if(aGeoStat.nShearWink)
+ if(pOle2 && pOle2->GetGraphic())
{
- aGeoStat.RecalcTan();
+ aMetaFile = pOle2->GetGraphic()->GetGDIMetaFile();
+
+ if(aMetaFile.GetActionCount())
+ {
+ aObjectTransform = pOle2->getSdrObjectTransformation();
+ }
}
- if(aGeoStat.nDrehWink)
+ // TTTT: ObjectTransform probably needs to be adapted, e.g. when metafile
+ // already contains rotations, it should be removed
+ if(aMetaFile.GetActionCount())
{
- aGeoStat.RecalcSinCos();
+ ImpSdrGDIMetaFileImport aFilter(getSdrModelFromSdrView(), pObj->GetLayer(), aObjectTransform);
+
+ nInsAnz = aFilter.DoImport(aMetaFile, *pOL, nInsPos, pProgrInfo);
}
- for (sal_uIntPtr i=0; i<nInsAnz; i++)
+ if(nInsAnz)
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pOL->GetObj(nObj)));
+ for(sal_uInt32 i(0), nObj(nInsPos); i < nInsAnz; i++, nObj++)
+ {
+ SdrObject* pCandidate = pOL->GetObj(nObj);
- // Neue MarkList pflegen
- SdrObject* pCandidate = pOL->GetObj(nObj);
+ if(bUndo)
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pCandidate));
+ }
- // apply original transformation
- if(aGeoStat.nShearWink)
- {
- pCandidate->NbcShear(aLogicRect.TopLeft(), aGeoStat.nShearWink, aGeoStat.nTan, false);
+ // add to new selection
+ aNewMarked.push_back(pCandidate);
}
- if(aGeoStat.nDrehWink)
+ if(bUndo)
{
- pCandidate->NbcRotate(aLogicRect.TopLeft(), aGeoStat.nDrehWink, aGeoStat.nSin, aGeoStat.nCos);
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
}
- SdrMark aNewMark(pCandidate, pPV);
- aNewMarked.InsertEntry(aNewMark);
+ // remove object
+ pOL->RemoveObjectFromSdrObjList(nInsPos - 1);
- nObj++;
+ if(!bUndo)
+ {
+ // if no undo, delete object
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
+ }
+ else
+ {
+ // keep unchanged object in new selection
+ aNewMarked.push_back(pObj);
}
- aForTheDescription.InsertEntry(*pM);
-
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
-
- // Objekt aus selektion loesen und loeschen
- GetMarkedObjectListWriteAccess().DeleteMark(TryToFindMarkedObject(pObj));
- pOL->RemoveObject(nInsPos-1);
-
- if( !bUndo )
- SdrObject::Free(pObj);
}
- }
- // MarkObj... fehlt... jetzt nicht mehr (AW)
- if(aNewMarked.GetMarkCount())
- {
- // Neue Selektion bilden
- for(sal_uIntPtr a(0); a < aNewMarked.GetMarkCount(); a++)
+ if(!aNewMarked.empty())
{
- GetMarkedObjectListWriteAccess().InsertEntry(*aNewMarked.GetMark(a));
+ setSdrObjectSelection(aNewMarked); // TTTT check for equality
}
- SortMarkedObjects();
- }
-
- if( bUndo )
- {
- SetUndoComment(ImpGetResStr(STR_EditImportMtf),aForTheDescription.GetMarkDescription());
- EndUndo();
+ if(bUndo)
+ {
+ EndUndo();
+ }
}
}
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index a58695d3b662..e2ff3042f24a 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -25,13 +25,9 @@
#include "precompiled_svx.hxx"
#include <com/sun/star/i18n/WordType.hpp>
-
#include <svtools/accessibilityoptions.hxx>
-
#include <svx/svdedxv.hxx>
#include <svl/solar.hrc>
-
-//#include <tools/string.h>
#include <svl/itemiter.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/hatch.hxx>
@@ -41,22 +37,23 @@
#include <tools/config.hxx>
#include <vcl/cursor.hxx>
#include <editeng/unotext.hxx>
-
#include <editeng/editeng.hxx>
#include <editeng/editobj.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/scripttypeitem.hxx>
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdoutl.hxx>
#include <svx/sdtfchim.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdundo.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include "svx/svdpagv.hxx"
#include "svx/svdpage.hxx"
#include "svx/svdetc.hxx" // fuer GetDraftFillColor
#include "svx/svdotable.hxx"
#include <svx/selectioncontroller.hxx>
+
#ifdef DBG_UTIL
#include <svdibrow.hxx>
#endif
@@ -68,48 +65,55 @@
#include "svx/globl3d.hxx"
#include <editeng/outliner.hxx>
#include <editeng/adjitem.hxx>
-
-// #98988#
#include <svtools/colorcfg.hxx>
#include <vcl/svapp.hxx> //add CHINA001
+#include <svx/svdlegacy.hxx>
#include <svx/sdrpaintwindow.hxx>
+#include <svx/sdrtexthelpers.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <svx/sdrundomanager.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrObjEditView::ImpClearVars()
-{
- bQuickTextEditMode=sal_True;
- bMacroMode=sal_True;
- pTextEditOutliner=NULL;
- pTextEditOutlinerView=NULL;
- pTextEditPV=NULL;
- pTextEditWin=NULL;
- pTextEditCursorMerker=NULL;
- pEditPara=NULL;
- bTextEditNewObj=sal_False;
- bMacroDown=sal_False;
- pMacroObj=NULL;
- pMacroPV=NULL;
- pMacroWin=NULL;
- nMacroTol=0;
- bTextEditDontDelete=sal_False;
- bTextEditOnlyOneView=sal_False;
-}
-
-SdrObjEditView::SdrObjEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrGlueEditView(pModel1,pOut),
+SdrObjEditView::SdrObjEditView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrGlueEditView(rModel1, pOut),
+ mxTextEditObj(),
+ mpTextEditOutliner(0),
+ mpTextEditOutlinerView(0),
+ mpTextEditWin(0),
+ mpTextEditCursorMerker(0),
+ mpMacroObj(0),
+ mpMacroWin(0),
+ maTextEditArea(),
+ maMinTextEditArea(),
+ maOldCalcFieldValueLink(),
+ maMacroDownPos(0.0, 0.0),
+ mnMacroTol(0),
+ mbTextEditDontDelete(false),
+ mbTextEditOnlyOneView(false),
+ mbTextEditNewObj(false),
+ mbQuickTextEditMode(true),
+ mbMacroDown(false),
+ mxSelectionController(),
+ mxLastSelectionController(),
mpOldTextEditUndoManager(0)
{
- ImpClearVars();
}
SdrObjEditView::~SdrObjEditView()
{
- pTextEditWin = NULL; // Damit es in SdrEndTextEdit kein ShowCursor gibt
- if (IsTextEdit()) SdrEndTextEdit();
- if (pTextEditOutliner!=NULL) {
- delete pTextEditOutliner;
+ mpTextEditWin = 0; // Damit es in SdrEndTextEdit kein ShowCursor gibt
+
+ if(IsTextEdit())
+ {
+ SdrEndTextEdit();
+ }
+
+ if(GetTextEditOutliner())
+ {
+ delete mpTextEditOutliner;
}
if(mpOldTextEditUndoManager)
@@ -118,22 +122,28 @@ SdrObjEditView::~SdrObjEditView()
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrObjEditView::IsAction() const
+bool SdrObjEditView::IsAction() const
{
return IsMacroObj() || SdrGlueEditView::IsAction();
}
-void SdrObjEditView::MovAction(const Point& rPnt)
+void SdrObjEditView::MovAction(const basegfx::B2DPoint& rPnt)
{
- if (IsMacroObj()) MovMacroObj(rPnt);
+ if(IsMacroObj())
+ {
+ MovMacroObj(rPnt);
+ }
+
SdrGlueEditView::MovAction(rPnt);
}
void SdrObjEditView::EndAction()
{
- if (IsMacroObj()) EndMacroObj();
+ if(IsMacroObj())
+ {
+ EndMacroObj();
+ }
+
SdrGlueEditView::EndAction();
}
@@ -149,169 +159,219 @@ void SdrObjEditView::BrkAction()
SdrGlueEditView::BrkAction();
}
-void SdrObjEditView::TakeActionRect(Rectangle& rRect) const
+basegfx::B2DRange SdrObjEditView::TakeActionRange() const
{
- if (IsMacroObj()) {
- rRect=pMacroObj->GetCurrentBoundRect();
- } else {
- SdrGlueEditView::TakeActionRect(rRect);
+ if(IsMacroObj())
+ {
+ return mpMacroObj->getObjectRange(getAsSdrView());
+ }
+ else
+ {
+ return SdrGlueEditView::TakeActionRange();
}
}
void __EXPORT SdrObjEditView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
SdrGlueEditView::Notify(rBC,rHint);
+
// Printerwechsel waerend des Editierens
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
- if (pSdrHint!=NULL && pTextEditOutliner!=NULL) {
- SdrHintKind eKind=pSdrHint->GetKind();
- if (eKind==HINT_REFDEVICECHG) {
- pTextEditOutliner->SetRefDevice(pMod->GetRefDevice());
- }
- if (eKind==HINT_DEFAULTTABCHG) {
- pTextEditOutliner->SetDefTab(pMod->GetDefaultTabulator());
- }
- if (eKind==HINT_DEFFONTHGTCHG) {
- // ...
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrHint && GetTextEditOutliner())
+ {
+ const SdrHintKind eKind(pSdrHint->GetSdrHintKind());
+
+ if(HINT_REFDEVICECHG == eKind)
+ {
+ GetTextEditOutliner()->SetRefDevice(getSdrModelFromSdrView().GetReferenceDevice());
}
- if (eKind==HINT_MODELSAVED) { // #43095#
- pTextEditOutliner->ClearModifyFlag();
+
+ if(HINT_DEFAULTTABCHG == eKind)
+ {
+ GetTextEditOutliner()->SetDefTab(getSdrModelFromSdrView().GetDefaultTabulator());
}
+
+// if(eKind==HINT_DEFFONTHGTCHG)
+// {
+// // ...
+// }
}
}
-void SdrObjEditView::ModelHasChanged()
+void SdrObjEditView::LazyReactOnObjectChanges()
{
- SdrGlueEditView::ModelHasChanged();
- if (mxTextEditObj.is() && !mxTextEditObj->IsInserted()) SdrEndTextEdit(); // Objekt geloescht
+ // call parent
+ SdrGlueEditView::LazyReactOnObjectChanges();
+
+ if(mxTextEditObj.is() && !mxTextEditObj->IsObjectInserted())
+ {
+ SdrEndTextEdit(); // Objekt geloescht
+ }
+
// TextEditObj geaendert?
- if (IsTextEdit()) {
+ if(IsTextEdit())
+ {
SdrTextObj* pTextObj=dynamic_cast<SdrTextObj*>( mxTextEditObj.get() );
- if (pTextObj!=NULL) {
- sal_uIntPtr nOutlViewAnz=pTextEditOutliner->GetViewCount();
- sal_Bool bAreaChg=sal_False;
- sal_Bool bAnchorChg=sal_False;
- sal_Bool bColorChg=sal_False;
- bool bContourFrame=pTextObj->IsContourTextFrame();
+
+ if(pTextObj)
+ {
+ SdrOutliner* pTextEditOutliner = GetTextEditOutliner();
+ OSL_ENSURE(pTextEditOutliner, "TextEdit, but no TextEditOutliner (!)");
+
+ const sal_uInt32 nOutlViewAnz(pTextEditOutliner->GetViewCount());
+ bool bAreaChg(false);
+ bool bAnchorChg(false);
+ bool bColorChg(false);
+ bool bContourFrame(pTextObj->IsContourTextFrame());
EVAnchorMode eNewAnchor(ANCHOR_VCENTER_HCENTER);
- Rectangle aOldArea(aMinTextEditArea);
- aOldArea.Union(aTextEditArea);
Color aNewColor;
+
+ basegfx::B2DRange aOldArea(maMinTextEditArea);
+
+ aOldArea.expand(maTextEditArea);
+
{ // Area Checken
- Size aPaperMin1;
- Size aPaperMax1;
- Rectangle aEditArea1;
- Rectangle aMinArea1;
- pTextObj->TakeTextEditArea(&aPaperMin1,&aPaperMax1,&aEditArea1,&aMinArea1);
+ basegfx::B2DVector aPaperMinVector1;
+ basegfx::B2DVector aPaperMaxVector1;
+ basegfx::B2DRange aEditArea1;
+ basegfx::B2DRange aMinArea1;
+
+ pTextObj->TakeTextEditArea(&aPaperMinVector1, &aPaperMaxVector1, &aEditArea1, &aMinArea1);
+
+ const Size aPaperMin1(basegfx::fround(aPaperMinVector1.getX()), basegfx::fround(aPaperMinVector1.getY()));
+ const Size aPaperMax1(basegfx::fround(aPaperMaxVector1.getX()), basegfx::fround(aPaperMaxVector1.getY()));
// #108784#
- Point aPvOfs(pTextObj->GetTextEditOffset());
-
- aEditArea1.Move(aPvOfs.X(),aPvOfs.Y());
- aMinArea1.Move(aPvOfs.X(),aPvOfs.Y());
- Rectangle aNewArea(aMinArea1);
- aNewArea.Union(aEditArea1);
-
- if (aNewArea!=aOldArea || aEditArea1!=aTextEditArea || aMinArea1!=aMinTextEditArea ||
- pTextEditOutliner->GetMinAutoPaperSize()!=aPaperMin1 || pTextEditOutliner->GetMaxAutoPaperSize()!=aPaperMax1) {
- aTextEditArea=aEditArea1;
- aMinTextEditArea=aMinArea1;
- pTextEditOutliner->SetUpdateMode(sal_False);
+ const basegfx::B2DHomMatrix aTextEditOffsetTransform(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ pTextObj->GetTextEditOffset()));
+
+ aEditArea1.transform(aTextEditOffsetTransform);
+ aMinArea1.transform(aTextEditOffsetTransform);
+
+ basegfx::B2DRange aNewArea(aMinArea1);
+
+ aNewArea.expand(aEditArea1);
+
+ if(!aNewArea.equal(aOldArea)
+ || !aEditArea1.equal(maTextEditArea)
+ || !aMinArea1.equal(maMinTextEditArea)
+ || pTextEditOutliner->GetMinAutoPaperSize() != aPaperMin1
+ || pTextEditOutliner->GetMaxAutoPaperSize() != aPaperMax1)
+ {
+ maTextEditArea = aEditArea1;
+ maMinTextEditArea = aMinArea1;
+ pTextEditOutliner->SetUpdateMode(false);
pTextEditOutliner->SetMinAutoPaperSize(aPaperMin1);
pTextEditOutliner->SetMaxAutoPaperSize(aPaperMax1);
pTextEditOutliner->SetPaperSize(Size(0,0)); // Damit der Outliner neu formatiert
- if (!bContourFrame) {
+
+ if(!bContourFrame)
+ {
pTextEditOutliner->ClearPolygon();
- sal_uIntPtr nStat=pTextEditOutliner->GetControlWord();
- nStat|=EE_CNTRL_AUTOPAGESIZE;
- pTextEditOutliner->SetControlWord(nStat);
- } else {
- sal_uIntPtr nStat=pTextEditOutliner->GetControlWord();
- nStat&=~EE_CNTRL_AUTOPAGESIZE;
- pTextEditOutliner->SetControlWord(nStat);
- Rectangle aAnchorRect;
- pTextObj->TakeTextAnchorRect(aAnchorRect);
- pTextObj->ImpSetContourPolygon(*pTextEditOutliner,aAnchorRect, sal_True);
+ pTextEditOutliner->SetControlWord(pTextEditOutliner->GetControlWord() | EE_CNTRL_AUTOPAGESIZE);
}
- for (sal_uIntPtr nOV=0; nOV<nOutlViewAnz; nOV++) {
+ else
+ {
+ pTextEditOutliner->SetControlWord(pTextEditOutliner->GetControlWord() &~EE_CNTRL_AUTOPAGESIZE);
+ basegfx::B2DPolyPolygon aContourOutline(getAlignedTextContourPolyPolygon(*pTextObj));
+ aContourOutline.transform(basegfx::tools::createTranslateB2DHomMatrix(-aContourOutline.getB2DRange().getMinimum()));
+ pTextEditOutliner->SetPolygon(aContourOutline);
+ }
+
+ for(sal_uInt32 nOV(0); nOV < nOutlViewAnz; nOV++)
+ {
OutlinerView* pOLV=pTextEditOutliner->GetView(nOV);
- sal_uIntPtr nStat0=pOLV->GetControlWord();
- sal_uIntPtr nStat=nStat0;
+ sal_uInt32 nStat0 = pOLV->GetControlWord();
+ sal_uInt32 nStat = nStat0;
+
// AutoViewSize nur wenn nicht KontourFrame.
- if (!bContourFrame) nStat|=EV_CNTRL_AUTOSIZE;
- else nStat&=~EV_CNTRL_AUTOSIZE;
- if (nStat!=nStat0) pOLV->SetControlWord(nStat);
+ if(!bContourFrame)
+ {
+ nStat |= EV_CNTRL_AUTOSIZE;
+ }
+ else
+ {
+ nStat &= ~EV_CNTRL_AUTOSIZE;
+ }
+
+ if(nStat != nStat0)
+ {
+ pOLV->SetControlWord(nStat);
+ }
}
- pTextEditOutliner->SetUpdateMode(sal_True);
- bAreaChg=sal_True;
+
+ pTextEditOutliner->SetUpdateMode(true);
+ bAreaChg = true;
}
}
- if (pTextEditOutlinerView!=NULL) { // Fuellfarbe und Anker checken
- EVAnchorMode eOldAnchor=pTextEditOutlinerView->GetAnchorMode();
+
+ if(GetTextEditOutlinerView())
+ {
+ // Fuellfarbe und Anker checken
+ EVAnchorMode eOldAnchor = GetTextEditOutlinerView()->GetAnchorMode();
eNewAnchor=(EVAnchorMode)pTextObj->GetOutlinerViewAnchorMode();
bAnchorChg=eOldAnchor!=eNewAnchor;
- Color aOldColor(pTextEditOutlinerView->GetBackgroundColor());
+ Color aOldColor(GetTextEditOutlinerView()->GetBackgroundColor());
aNewColor = GetTextEditBackgroundColor(*this);
bColorChg=aOldColor!=aNewColor;
}
+
// #104082# refresh always when it's a contour frame. That
// refresh is necessary since it triggers the repaint
- // which makes the Handles visible. Changes at TakeTextRect()
+ // which makes the Handles visible. Changes at TakeTextRange()
// seem to have resulted in a case where no refresh is executed.
// Before that, a refresh must have been always executed
// (else this error would have happend earlier), thus i
// even think here a refresh should be done always.
// Since follow-up problems cannot even be guessed I only
// add this one more case to the if below.
- // BTW: It's VERY bad style that here, inside ModelHasChanged()
+ // BTW: It's VERY bad style that here, inside LazyReactOnObjectChanges()
// the outliner is again massively changed for the text object
// in text edit mode. Normally, all necessary data should be
// set at SdrBeginTextEdit(). Some changes and value assigns in
// SdrBeginTextEdit() are completely useless since they are set here
- // again on ModelHasChanged().
+ // again on LazyReactOnObjectChanges().
if (bContourFrame || bAreaChg || bAnchorChg || bColorChg)
{
- for (sal_uIntPtr nOV=0; nOV<nOutlViewAnz; nOV++)
+ for(sal_uInt32 nOV(0); nOV < nOutlViewAnz; nOV++)
{
OutlinerView* pOLV=pTextEditOutliner->GetView(nOV);
- { // Alten OutlinerView-Bereich invalidieren
+
+ {
+ // Alten OutlinerView-Bereich invalidieren
Window* pWin=pOLV->GetWindow();
- Rectangle aTmpRect(aOldArea);
- sal_uInt16 nPixSiz=pOLV->GetInvalidateMore()+1;
- Size aMore(pWin->PixelToLogic(Size(nPixSiz,nPixSiz)));
- aTmpRect.Left()-=aMore.Width();
- aTmpRect.Right()+=aMore.Width();
- aTmpRect.Top()-=aMore.Height();
- aTmpRect.Bottom()+=aMore.Height();
- InvalidateOneWin(*pWin,aTmpRect);
+ basegfx::B2DRange aRange(aOldArea);
+ const basegfx::B2DVector aLogicPix(pWin->GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0));
+
+ aRange.grow(((aLogicPix.getX() + aLogicPix.getY()) * 0.5) * (pOLV->GetInvalidateMore() + 1.0));
+
+ InvalidateOneWin(*pWin, aRange);
}
+
if (bAnchorChg)
+ {
pOLV->SetAnchorMode(eNewAnchor);
+ }
+
if (bColorChg)
+ {
pOLV->SetBackgroundColor( aNewColor );
+ }
- pOLV->SetOutputArea(aTextEditArea); // weil sonst scheinbar nicht richtig umgeankert wird
+ pOLV->SetOutputArea(maTextEditArea); // weil sonst scheinbar nicht richtig umgeankert wird
ImpInvalidateOutlinerView(*pOLV);
}
- pTextEditOutlinerView->ShowCursor();
+
+ GetTextEditOutlinerView()->ShowCursor();
}
}
+
ImpMakeTextCursorAreaVisible();
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@@ @@@@@ @@ @@@@@@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@@ @@ @@@@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@@@@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow) const
{
// draw old text edit stuff
@@ -327,6 +387,7 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow) const
{
const Region& rRedrawRegion = rPaintWindow.GetRedrawRegion();
const Rectangle aCheckRect(rRedrawRegion.GetBoundRect());
+ const basegfx::B2DRange aCheckRange(aCheckRect.Left(), aCheckRect.Top(), aCheckRect.Right(), aCheckRect.Bottom());
for(sal_uInt32 i(0); i < nViewAnz; i++)
{
@@ -334,7 +395,7 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow) const
if(pOLV->GetWindow() == &rPaintWindow.GetOutputDevice())
{
- ImpPaintOutlinerView(*pOLV, aCheckRect, rPaintWindow.GetTargetOutputDevice());
+ ImpPaintOutlinerView(*pOLV, aCheckRange, rPaintWindow.GetTargetOutputDevice());
return;
}
}
@@ -343,64 +404,66 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow) const
}
}
-void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const Rectangle& rRect, OutputDevice& rTargetDevice) const
+void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const basegfx::B2DRange& rRange, OutputDevice& rTargetDevice) const
{
- const SdrTextObj* pText = PTR_CAST(SdrTextObj,GetTextEditObject());
+ const SdrTextObj* pText = dynamic_cast< const SdrTextObj* >(GetTextEditObject());
bool bTextFrame(pText && pText->IsTextFrame());
- bool bFitToSize(0 != (pTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING));
- bool bModifyMerk(pTextEditOutliner->IsModified()); // #43095#
- Rectangle aBlankRect(rOutlView.GetOutputArea());
- aBlankRect.Union(aMinTextEditArea);
- Rectangle aPixRect(rTargetDevice.LogicToPixel(aBlankRect));
- aBlankRect.Intersection(rRect);
- rOutlView.GetOutliner()->SetUpdateMode(sal_True); // Bugfix #22596#
- rOutlView.Paint(aBlankRect, &rTargetDevice);
+ bool bFitToSize(0 != (mpTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING));
+ bool bModifyMerk(mpTextEditOutliner->IsModified()); // #43095#
+ basegfx::B2DRange aBlankRange(rOutlView.GetOutputAreaRange());
+
+ aBlankRange.expand(maMinTextEditArea);
+
+ basegfx::B2DRange aPixRange(rTargetDevice.GetViewTransformation() * aBlankRange);
+
+ aBlankRange.intersect(rRange);
+
+ rOutlView.GetOutliner()->SetUpdateMode(true); // Bugfix #22596#
+ rOutlView.Paint(aBlankRange, &rTargetDevice);
if(!bModifyMerk)
{
// #43095#
- pTextEditOutliner->ClearModifyFlag();
+ mpTextEditOutliner->ClearModifyFlag();
}
if(bTextFrame && !bFitToSize)
{
- aPixRect.Left()--;
- aPixRect.Top()--;
- aPixRect.Right()++;
- aPixRect.Bottom()++;
- sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
+ aPixRange.grow(1.0);
+
+ const sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
{
// xPixRect Begrenzen, wegen Treiberproblem bei zu weit hinausragenden Pixelkoordinaten
- Size aMaxXY(rTargetDevice.GetOutputSizePixel());
- long a(2 * nPixSiz);
- long nMaxX(aMaxXY.Width() + a);
- long nMaxY(aMaxXY.Height() + a);
-
- if (aPixRect.Left ()<-a) aPixRect.Left()=-a;
- if (aPixRect.Top ()<-a) aPixRect.Top ()=-a;
- if (aPixRect.Right ()>nMaxX) aPixRect.Right ()=nMaxX;
- if (aPixRect.Bottom()>nMaxY) aPixRect.Bottom()=nMaxY;
+ const basegfx::B2DVector aDiscreteScale(rTargetDevice.GetDiscreteRange().getRange());
+ const double a(2.0 * nPixSiz);
+ const double fMaxX(aDiscreteScale.getX() + a);
+ const double fMaxY(aDiscreteScale.getY() + a);
+
+ aPixRange = basegfx::B2DRange(
+ basegfx::fTools::less(aPixRange.getMinX(), -a) ? aPixRange.getMinX() - a : aPixRange.getMinX(),
+ basegfx::fTools::less(aPixRange.getMinY(), -a) ? aPixRange.getMinY() - a : aPixRange.getMinY(),
+ basegfx::fTools::more(aPixRange.getMaxX(), fMaxX) ? fMaxX : aPixRange.getMaxX(),
+ basegfx::fTools::more(aPixRange.getMaxY(), fMaxY) ? fMaxY : aPixRange.getMaxY());
}
- Rectangle aOuterPix(aPixRect);
- aOuterPix.Left()-=nPixSiz;
- aOuterPix.Top()-=nPixSiz;
- aOuterPix.Right()+=nPixSiz;
- aOuterPix.Bottom()+=nPixSiz;
+ basegfx::B2DRange aOuterPix(aPixRange);
- bool bMerk(rTargetDevice.IsMapModeEnabled());
- rTargetDevice.EnableMapMode(sal_False);
- PolyPolygon aPolyPoly( 2 );
+ aOuterPix.grow(nPixSiz);
+
+ const bool bMerk(rTargetDevice.IsMapModeEnabled());
+
+ rTargetDevice.EnableMapMode(false);
svtools::ColorConfig aColorConfig;
Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
const Hatch aHatch( HATCH_SINGLE, aHatchCol, 3, 450 );
+ basegfx::B2DPolyPolygon aPolyPoly;
- aPolyPoly.Insert( aOuterPix );
- aPolyPoly.Insert( aPixRect );
- rTargetDevice.DrawHatch( aPolyPoly, aHatch );
+ aPolyPoly.append(basegfx::tools::createPolygonFromRect(aOuterPix));
+ aPolyPoly.append(basegfx::tools::createPolygonFromRect(aPixRange));
+ rTargetDevice.DrawHatch(PolyPolygon(aPolyPoly), aHatch);
rTargetDevice.EnableMapMode(bMerk);
}
@@ -413,135 +476,172 @@ void SdrObjEditView::ImpInvalidateOutlinerView(OutlinerView& rOutlView) const
if(pWin)
{
- const SdrTextObj* pText = PTR_CAST(SdrTextObj,GetTextEditObject());
- bool bTextFrame(pText && pText->IsTextFrame());
- bool bFitToSize(0 != (pTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING));
+ const SdrTextObj* pText = dynamic_cast< SdrTextObj* >(GetTextEditObject());
+ const bool bTextFrame(pText && pText->IsTextFrame());
+ const bool bFitToSize(0 != (GetTextEditOutliner()->GetControlWord() & EE_CNTRL_STRETCHING));
if(bTextFrame && !bFitToSize)
{
- Rectangle aBlankRect(rOutlView.GetOutputArea());
- aBlankRect.Union(aMinTextEditArea);
- Rectangle aPixRect(pWin->LogicToPixel(aBlankRect));
- sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
+ basegfx::B2DRange aBlankRange(rOutlView.GetOutputAreaRange());
+
+ aBlankRange.expand(maMinTextEditArea);
- aPixRect.Left()--;
- aPixRect.Top()--;
- aPixRect.Right()++;
- aPixRect.Bottom()++;
+ basegfx::B2DRange aPixRange(pWin->GetViewTransformation() * aBlankRange);
+ aPixRange.grow(1.0);
+
+ const sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
{
// xPixRect Begrenzen, wegen Treiberproblem bei zu weit hinausragenden Pixelkoordinaten
- Size aMaxXY(pWin->GetOutputSizePixel());
- long a(2 * nPixSiz);
- long nMaxX(aMaxXY.Width() + a);
- long nMaxY(aMaxXY.Height() + a);
-
- if (aPixRect.Left ()<-a) aPixRect.Left()=-a;
- if (aPixRect.Top ()<-a) aPixRect.Top ()=-a;
- if (aPixRect.Right ()>nMaxX) aPixRect.Right ()=nMaxX;
- if (aPixRect.Bottom()>nMaxY) aPixRect.Bottom()=nMaxY;
- }
-
- Rectangle aOuterPix(aPixRect);
- aOuterPix.Left()-=nPixSiz;
- aOuterPix.Top()-=nPixSiz;
- aOuterPix.Right()+=nPixSiz;
- aOuterPix.Bottom()+=nPixSiz;
-
- bool bMerk(pWin->IsMapModeEnabled());
- pWin->EnableMapMode(sal_False);
- pWin->Invalidate(aOuterPix);
+ const basegfx::B2DVector aDiscreteScale(pWin->GetDiscreteRange().getRange());
+ const double a(2.0 * nPixSiz);
+ const double fMaxX(aDiscreteScale.getX() + a);
+ const double fMaxY(aDiscreteScale.getY() + a);
+
+ aPixRange = basegfx::B2DRange(
+ basegfx::fTools::less(aPixRange.getMinX(), -a) ? aPixRange.getMinX() - a : aPixRange.getMinX(),
+ basegfx::fTools::less(aPixRange.getMinY(), -a) ? aPixRange.getMinY() - a : aPixRange.getMinY(),
+ basegfx::fTools::more(aPixRange.getMaxX(), fMaxX) ? fMaxX : aPixRange.getMaxX(),
+ basegfx::fTools::more(aPixRange.getMaxY(), fMaxY) ? fMaxY : aPixRange.getMaxY());
+ }
+
+ basegfx::B2DRange aOuterPix(aPixRange);
+ aOuterPix.grow(nPixSiz);
+
+ const bool bMerk(pWin->IsMapModeEnabled());
+
+ pWin->EnableMapMode(false);
+ InvalidateOneWin(*pWin, aOuterPix);
pWin->EnableMapMode(bMerk);
}
}
}
-OutlinerView* SdrObjEditView::ImpMakeOutlinerView(Window* pWin, sal_Bool /*bNoPaint*/, OutlinerView* pGivenView) const
+OutlinerView* SdrObjEditView::ImpMakeOutlinerView(Window* pWin, bool /*bNoPaint*/, OutlinerView* pGivenView) const
{
// Hintergrund
Color aBackground(GetTextEditBackgroundColor(*this));
SdrTextObj* pText = dynamic_cast< SdrTextObj * >( mxTextEditObj.get() );
- sal_Bool bTextFrame=pText!=NULL && pText->IsTextFrame();
- sal_Bool bContourFrame=pText!=NULL && pText->IsContourTextFrame();
+ const bool bTextFrame(pText && pText->IsTextFrame());
+ const bool bContourFrame(pText && pText->IsContourTextFrame());
+
// OutlinerView erzeugen
OutlinerView* pOutlView=pGivenView;
- pTextEditOutliner->SetUpdateMode(sal_False);
- if (pOutlView==NULL) pOutlView=new OutlinerView(pTextEditOutliner,pWin);
- else pOutlView->SetWindow(pWin);
+ SdrOutliner* pTextEditOutliner = const_cast< SdrOutliner* >(GetTextEditOutliner());
+ pTextEditOutliner->SetUpdateMode(false);
+
+ if(!pOutlView)
+ {
+ pOutlView = new OutlinerView(pTextEditOutliner, pWin);
+ }
+ else
+ {
+ pOutlView->SetWindow(pWin);
+ }
+
// Scrollen verbieten
- sal_uIntPtr nStat=pOutlView->GetControlWord();
+ sal_uInt32 nStat = pOutlView->GetControlWord();
nStat&=~EV_CNTRL_AUTOSCROLL;
+
// AutoViewSize nur wenn nicht KontourFrame.
- if (!bContourFrame) nStat|=EV_CNTRL_AUTOSIZE;
- if (bTextFrame) {
- sal_uInt16 nPixSiz=aHdl.GetHdlSize()*2+1;
+ if(!bContourFrame)
+ {
+ nStat |= EV_CNTRL_AUTOSIZE;
+ }
+
+ if(bTextFrame)
+ {
+ sal_uInt16 nPixSiz = maViewHandleList.GetHdlSize() * 2 + 1;
nStat|=EV_CNTRL_INVONEMORE;
pOutlView->SetInvalidateMore(nPixSiz);
}
+
pOutlView->SetControlWord(nStat);
pOutlView->SetBackgroundColor( aBackground );
- if (pText!=NULL)
+
+ if(pText)
{
pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnchorMode()));
pTextEditOutliner->SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)pText->GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
}
- pOutlView->SetOutputArea(aTextEditArea);
- pTextEditOutliner->SetUpdateMode(sal_True);
+
+ pOutlView->SetOutputArea(maTextEditArea);
+ pTextEditOutliner->SetUpdateMode(true);
ImpInvalidateOutlinerView(*pOutlView);
+
return pOutlView;
}
-sal_Bool SdrObjEditView::IsTextEditFrame() const
+bool SdrObjEditView::IsTextEditFrame() const
{
SdrTextObj* pText = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() );
- return pText!=NULL && pText->IsTextFrame();
+
+ return (pText && pText->IsTextFrame());
}
IMPL_LINK(SdrObjEditView,ImpOutlinerStatusEventHdl,EditStatus*,pEditStat)
{
- if(pTextEditOutliner )
+ if(GetTextEditOutliner() )
{
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj * >( mxTextEditObj.get() );
+
if( pTextObj )
{
pTextObj->onEditOutlinerStatusEvent( pEditStat );
}
}
+
return 0;
}
IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
{
- bool bOk=false;
+ bool bOk(false);
String& rStr=pFI->GetRepresentation();
rStr.Erase();
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() );
- if (pTextObj!=NULL) {
- Color* pTxtCol=NULL;
- Color* pFldCol=NULL;
- bOk=pTextObj->CalcFieldValue(pFI->GetField(),pFI->GetPara(),pFI->GetPos(),sal_True,pTxtCol,pFldCol,rStr);
- if (bOk) {
- if (pTxtCol!=NULL) {
+
+ if(pTextObj)
+ {
+ Color* pTxtCol = 0;
+ Color* pFldCol = 0;
+
+ bOk = pTextObj->CalcFieldValue(pFI->GetField(), pFI->GetPara(), pFI->GetPos(), true, pTxtCol, pFldCol, rStr);
+
+ if(bOk)
+ {
+ if(pTxtCol)
+ {
pFI->SetTxtColor(*pTxtCol);
delete pTxtCol;
}
- if (pFldCol!=NULL) {
+
+ if(pFldCol)
+ {
pFI->SetFldColor(*pFldCol);
delete pFldCol;
- } else {
+ }
+ else
+ {
pFI->SetFldColor(Color(COL_LIGHTGRAY)); // kann spaeter (357) raus
}
}
}
- Outliner& rDrawOutl=pMod->GetDrawOutliner(pTextObj);
+
+ Outliner& rDrawOutl = getSdrModelFromSdrView().GetDrawOutliner(pTextObj);
Link aDrawOutlLink=rDrawOutl.GetCalcFieldValueHdl();
- if (!bOk && aDrawOutlLink.IsSet()) {
+
+ if(!bOk && aDrawOutlLink.IsSet())
+ {
aDrawOutlLink.Call(pFI);
- bOk = (sal_Bool)rStr.Len();
+ bOk = (bool)rStr.Len();
}
- if (!bOk && aOldCalcFieldValueLink.IsSet()) {
- return aOldCalcFieldValueLink.Call(pFI);
+
+ if(!bOk && maOldCalcFieldValueLink.IsSet())
+ {
+ return maOldCalcFieldValueLink.Call(pFI);
}
+
return 0;
}
@@ -554,20 +654,20 @@ IMPL_LINK(SdrObjEditView, EndTextEditHdl, SdrUndoManager*, /*pUndoManager*/)
SdrUndoManager* SdrObjEditView::getSdrUndoManagerForEnhancedTextEdit() const
{
// default returns registered UndoManager
- return GetModel() ? dynamic_cast< SdrUndoManager* >(GetModel()->GetSdrUndoManager()) : 0;
+ return dynamic_cast< SdrUndoManager* >(getSdrModelFromSdrView().GetSdrUndoManager());
}
-sal_Bool SdrObjEditView::SdrBeginTextEdit(
- SdrObject* pObj, SdrPageView* pPV, Window* pWin,
- sal_Bool bIsNewObj, SdrOutliner* pGivenOutliner,
+bool SdrObjEditView::SdrBeginTextEdit(
+ SdrObject* pObj, Window* pWin,
+ bool bIsNewObj, SdrOutliner* pGivenOutliner,
OutlinerView* pGivenOutlinerView,
- sal_Bool bDontDeleteOutliner, sal_Bool bOnlyOneView,
- sal_Bool bGrabFocus)
+ bool bDontDeleteOutliner, bool bOnlyOneView,
+ bool bGrabFocus)
{
SdrEndTextEdit();
if( dynamic_cast< SdrTextObj* >( pObj ) == 0 )
- return sal_False; // currently only possible with text objects
+ return false; // currently only possible with text objects
if(bGrabFocus && pWin)
{
@@ -575,22 +675,22 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit(
pWin->GrabFocus(); // to force the cursor into the edit view
}
- bTextEditDontDelete=bDontDeleteOutliner && pGivenOutliner!=NULL;
- bTextEditOnlyOneView=bOnlyOneView;
- bTextEditNewObj=bIsNewObj;
+ mbTextEditDontDelete = bDontDeleteOutliner && pGivenOutliner;
+ mbTextEditOnlyOneView = bOnlyOneView;
+ mbTextEditNewObj = bIsNewObj;
const sal_uInt32 nWinAnz(PaintWindowCount());
sal_uInt32 i;
- sal_Bool bBrk(sal_False);
- // Abbruch, wenn kein Objekt angegeben.
+ bool bBrk(false);
+ // Abbruch, wenn kein Objekt angegeben.
if(!pObj)
{
- bBrk = sal_True;
+ bBrk = true;
}
if(!bBrk && !pWin)
{
- for(i = 0L; i < nWinAnz && !pWin; i++)
+ for(i = 0; i < nWinAnz && !pWin; i++)
{
SdrPaintWindow* pPaintWindow = GetPaintWindow(i);
@@ -603,187 +703,195 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit(
// Abbruch, wenn kein Window da.
if(!pWin)
{
- bBrk = sal_True;
+ bBrk = true;
}
}
- if(!bBrk && !pPV)
+ if(!bBrk && !GetSdrPageView())
{
- pPV = GetSdrPageView();
-
// Abbruch, wenn keine PageView zu dem Objekt vorhanden.
- if(!pPV)
- {
- bBrk = sal_True;
- }
+ bBrk = true;
}
- if(pObj && pPV)
+ if(pObj && GetSdrPageView())
{
// Kein TextEdit an Objekten im gesperrten Layer
- if(pPV->GetLockedLayers().IsSet(pObj->GetLayer()))
+ if(GetSdrPageView()->GetLockedLayers().IsSet(pObj->GetLayer()))
{
- bBrk = sal_True;
+ bBrk = true;
}
}
- if(pTextEditOutliner)
+ if(GetTextEditOutliner())
{
DBG_ERROR("SdrObjEditView::SdrBeginTextEdit() da stand noch ein alter Outliner rum");
- delete pTextEditOutliner;
- pTextEditOutliner = 0L;
+ delete mpTextEditOutliner;
+ mpTextEditOutliner = 0;
}
if(!bBrk)
{
- pTextEditWin=pWin;
- pTextEditPV=pPV;
+ mpTextEditWin = pWin;
mxTextEditObj.reset( pObj );
- pTextEditOutliner=pGivenOutliner;
- if (pTextEditOutliner==NULL)
- pTextEditOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, mxTextEditObj->GetModel() );
+ mpTextEditOutliner = pGivenOutliner;
+
+ if(!GetTextEditOutliner())
+ {
+ mpTextEditOutliner = SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, &mxTextEditObj->getSdrModelFromSdrObject());
+ }
{
SvtAccessibilityOptions aOptions;
- pTextEditOutliner->ForceAutoColor( aOptions.GetIsAutomaticFontColor() );
+ GetTextEditOutliner()->ForceAutoColor(aOptions.GetIsAutomaticFontColor());
}
- sal_Bool bEmpty = mxTextEditObj->GetOutlinerParaObject()==NULL;
+ bool bEmpty(!mxTextEditObj->GetOutlinerParaObject());
- aOldCalcFieldValueLink=pTextEditOutliner->GetCalcFieldValueHdl();
+ maOldCalcFieldValueLink = GetTextEditOutliner()->GetCalcFieldValueHdl();
// Der FieldHdl muss von SdrBeginTextEdit gesetzt sein, da dor ein UpdateFields gerufen wird.
- pTextEditOutliner->SetCalcFieldValueHdl(LINK(this,SdrObjEditView,ImpOutlinerCalcFieldValueHdl));
- pTextEditOutliner->SetBeginPasteOrDropHdl(LINK(this,SdrObjEditView,BeginPasteOrDropHdl));
- pTextEditOutliner->SetEndPasteOrDropHdl(LINK(this,SdrObjEditView, EndPasteOrDropHdl));
+ GetTextEditOutliner()->SetCalcFieldValueHdl(LINK(this,SdrObjEditView,ImpOutlinerCalcFieldValueHdl));
+ GetTextEditOutliner()->SetBeginPasteOrDropHdl(LINK(this,SdrObjEditView,BeginPasteOrDropHdl));
+ GetTextEditOutliner()->SetEndPasteOrDropHdl(LINK(this,SdrObjEditView, EndPasteOrDropHdl));
// It is just necessary to make the visualized page known. Set it.
- pTextEditOutliner->setVisualizedPage(pPV ? pPV->GetPage() : 0);
-
- pTextEditOutliner->SetTextObjNoInit( dynamic_cast< SdrTextObj* >( mxTextEditObj.get() ) );
+ GetTextEditOutliner()->setVisualizedPage(GetSdrPageView() ? &GetSdrPageView()->getSdrPageFromSdrPageView() : 0);
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() );
+ GetTextEditOutliner()->SetTextObjNoInit(pTextObj);
- if(mxTextEditObj->BegTextEdit(*pTextEditOutliner))
+ if(mxTextEditObj->BegTextEdit(*GetTextEditOutliner()))
{
- SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() );
DBG_ASSERT( pTextObj, "svx::SdrObjEditView::BegTextEdit(), no text object?" );
if( !pTextObj )
- return sal_False;
+ {
+ return false;
+ }
// #111096# Switch off evtl. running TextAnimation
- pTextObj->SetTextAnimationAllowed(sal_False);
+ pTextObj->SetTextAnimationAllowed(false);
// alten Cursor merken
- if (pTextEditOutliner->GetViewCount()!=0)
+ if(GetTextEditOutliner()->GetViewCount())
{
- OutlinerView* pTmpOLV=pTextEditOutliner->RemoveView(sal_uIntPtr(0));
- if(pTmpOLV!=NULL && pTmpOLV!=pGivenOutlinerView)
+ OutlinerView* pTmpOLV = GetTextEditOutliner()->RemoveView(sal_uLong(0));
+
+ if(pTmpOLV && pTmpOLV != pGivenOutlinerView)
+ {
delete pTmpOLV;
+ }
}
// EditArea ueberTakeTextEditArea bestimmen
- // Das koennte eigentlich entfallen, da TakeTextRect() die Berechnung der aTextEditArea vornimmt
- // Die aMinTextEditArea muss jedoch wohl auch erfolgen (darum bleibt es voerst drinnen)
- pTextObj->TakeTextEditArea(NULL,NULL,&aTextEditArea,&aMinTextEditArea);
+ // Das koennte eigentlich entfallen, da TakeTextRange() die Berechnung der maTextEditArea vornimmt
+ // Die maMinTextEditArea muss jedoch wohl auch erfolgen (darum bleibt es voerst drinnen)
+ pTextObj->TakeTextEditArea(0, 0, &maTextEditArea, &maMinTextEditArea);
- Rectangle aTextRect;
- Rectangle aAnchorRect;
- pTextObj->TakeTextRect(*pTextEditOutliner, aTextRect, sal_True,
- &aAnchorRect /* #97097# Give sal_True here, not sal_False */);
+ basegfx::B2DRange aTextRange;
+ basegfx::B2DRange aAnchorRange;
+
+ pTextObj->TakeTextRange(*GetTextEditOutliner(), aTextRange, aAnchorRange);
if ( !pTextObj->IsContourTextFrame() )
{
// FitToSize erstmal nicht mit ContourFrame
- SdrFitToSizeType eFit = pTextObj->GetFitToSize();
- if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES)
- aTextRect = aAnchorRect;
+ SdrFitToSizeType eFit(pTextObj->GetFitToSize());
+
+ if(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit)
+ {
+ aTextRange = aAnchorRange;
+ }
}
- aTextEditArea = aTextRect;
+ maTextEditArea = aTextRange;
// #108784#
- Point aPvOfs(pTextObj->GetTextEditOffset());
-
- aTextEditArea.Move(aPvOfs.X(),aPvOfs.Y());
- aMinTextEditArea.Move(aPvOfs.X(),aPvOfs.Y());
- pTextEditCursorMerker=pWin->GetCursor();
+ const basegfx::B2DHomMatrix aTextEditOffsetTransform(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ pTextObj->GetTextEditOffset()));
- aHdl.SetMoveOutside(sal_True);
+ maTextEditArea.transform(aTextEditOffsetTransform);
+ maMinTextEditArea.transform(aTextEditOffsetTransform);
- // #i72757#
- // Since IsMarkHdlWhenTextEdit() is ignored, it is necessary
- // to call AdjustMarkHdl() always.
- AdjustMarkHdl();
+ mpTextEditCursorMerker = pWin->GetCursor();
+ maViewHandleList.SetMoveOutside(true);
+ SetMarkHandles();
- pTextEditOutlinerView=ImpMakeOutlinerView(pWin,!bEmpty,pGivenOutlinerView);
+ mpTextEditOutlinerView = ImpMakeOutlinerView(pWin, !bEmpty, pGivenOutlinerView);
// check if this view is already inserted
- sal_uIntPtr i2,nCount = pTextEditOutliner->GetViewCount();
+ sal_uInt32 i2, nCount = GetTextEditOutliner()->GetViewCount();
+
for( i2 = 0; i2 < nCount; i2++ )
{
- if( pTextEditOutliner->GetView(i2) == pTextEditOutlinerView )
+ if(GetTextEditOutliner()->GetView(i2) == GetTextEditOutlinerView())
+ {
break;
+ }
}
if( i2 == nCount )
- pTextEditOutliner->InsertView(pTextEditOutlinerView,0);
+ {
+ GetTextEditOutliner()->InsertView(GetTextEditOutlinerView(), 0);
+ }
- aHdl.SetMoveOutside(sal_False);
- aHdl.SetMoveOutside(sal_True);
- //OLMRefreshAllIAOManagers();
+ maViewHandleList.SetMoveOutside(false);
+ maViewHandleList.SetMoveOutside(true);
// alle Wins als OutlinerView beim Outliner anmelden
if(!bOnlyOneView)
{
- for(i = 0L; i < nWinAnz; i++)
+ for(i = 0; i < nWinAnz; i++)
{
SdrPaintWindow* pPaintWindow = GetPaintWindow(i);
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
if(&rOutDev != pWin && OUTDEV_WINDOW == rOutDev.GetOutDevType())
{
- OutlinerView* pOutlView = ImpMakeOutlinerView((Window*)(&rOutDev), !bEmpty, 0L);
- pTextEditOutliner->InsertView(pOutlView, (sal_uInt16)i);
+ OutlinerView* pOutlView = ImpMakeOutlinerView((Window*)(&rOutDev), !bEmpty, 0);
+ GetTextEditOutliner()->InsertView(pOutlView, (sal_uInt16)i);
}
}
}
- pTextEditOutlinerView->ShowCursor();
- pTextEditOutliner->SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
+ GetTextEditOutlinerView()->ShowCursor();
+ GetTextEditOutliner()->SetStatusEventHdl(LINK(this, SdrObjEditView, ImpOutlinerStatusEventHdl));
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
- pTextEditOutliner->ClearModifyFlag();
+ GetTextEditOutliner()->ClearModifyFlag();
// #71519#, #91453#
if(pWin)
{
- sal_Bool bExtraInvalidate(sal_False);
+ bool bExtraInvalidate(false);
// #71519#
if(!bExtraInvalidate)
{
- SdrFitToSizeType eFit = pTextObj->GetFitToSize();
- if(eFit == SDRTEXTFIT_PROPORTIONAL || eFit == SDRTEXTFIT_ALLLINES)
- bExtraInvalidate = sal_True;
+ SdrFitToSizeType eFit(pTextObj->GetFitToSize());
+
+ if(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit)
+ {
+ bExtraInvalidate = true;
+ }
}
if(bExtraInvalidate)
{
- pWin->Invalidate(aTextEditArea);
+ InvalidateOneWin(*pWin, maTextEditArea);
}
}
// send HINT_BEGEDIT #99840#
- if( GetModel() )
- {
- SdrHint aHint(*pTextObj);
- aHint.SetKind(HINT_BEGEDIT);
- GetModel()->Broadcast(aHint);
- }
-
- pTextEditOutliner->setVisualizedPage(0);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pTextObj, HINT_BEGEDIT);
+ GetTextEditOutliner()->setVisualizedPage(0);
if( mxSelectionController.is() )
+ {
mxSelectionController->onSelectionHasChanged();
+ }
if(IsUndoEnabled())
{
@@ -802,7 +910,7 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit(
mpOldTextEditUndoManager = 0;
}
- mpOldTextEditUndoManager = pTextEditOutliner->SetUndoManager(pSdrUndoManager);
+ mpOldTextEditUndoManager = mpTextEditOutliner->SetUndoManager(pSdrUndoManager);
pSdrUndoManager->SetEndTextEditHdl(LINK(this, SdrObjEditView, EndTextEditHdl));
}
else
@@ -815,63 +923,63 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit(
}
else
{
- bBrk = sal_True;
- pTextEditOutliner->SetCalcFieldValueHdl(aOldCalcFieldValueLink);
- pTextEditOutliner->SetBeginPasteOrDropHdl(Link());
- pTextEditOutliner->SetEndPasteOrDropHdl(Link());
+ bBrk = true;
+
+ GetTextEditOutliner()->SetCalcFieldValueHdl(maOldCalcFieldValueLink);
+ GetTextEditOutliner()->SetBeginPasteOrDropHdl(Link());
+ GetTextEditOutliner()->SetEndPasteOrDropHdl(Link());
}
}
- if (pTextEditOutliner != NULL)
+
+ if(GetTextEditOutliner())
{
- pTextEditOutliner->setVisualizedPage(0);
+ GetTextEditOutliner()->setVisualizedPage(0);
}
// wenn hier angekommen, dann ist irgendwas schief gelaufen
if(!bDontDeleteOutliner)
{
- if(pGivenOutliner!=NULL)
+ if(pGivenOutliner)
{
delete pGivenOutliner;
- pTextEditOutliner = NULL;
+ mpTextEditOutliner = 0;
}
- if(pGivenOutlinerView!=NULL)
+
+ if(pGivenOutlinerView)
{
delete pGivenOutlinerView;
- pGivenOutlinerView = NULL;
+
+ pGivenOutlinerView = 0;
}
}
- if( pTextEditOutliner!=NULL )
+
+ if(GetTextEditOutliner())
{
- delete pTextEditOutliner;
+ delete mpTextEditOutliner;
}
- pTextEditOutliner=NULL;
- pTextEditOutlinerView=NULL;
+ mpTextEditOutliner = 0;
+ mpTextEditOutlinerView = 0;
mxTextEditObj.reset(0);
- pTextEditPV=NULL;
- pTextEditWin=NULL;
- //HMHif (bMarkHdlWhenTextEdit) {
- //HMH HideMarkHdl();
- //HMH}
- aHdl.SetMoveOutside(sal_False);
- //HMHShowMarkHdl();
-
- return sal_False;
+ mpTextEditWin = 0;
+ maViewHandleList.SetMoveOutside(false);
+
+ return false;
}
-SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
+SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
{
- SdrEndTextEditKind eRet=SDRENDTEXTEDIT_UNCHANGED;
+ SdrEndTextEditKind eRet(SDRENDTEXTEDIT_UNCHANGED);
SdrTextObj* pTEObj = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() );
- Window* pTEWin =pTextEditWin;
- SdrOutliner* pTEOutliner =pTextEditOutliner;
- OutlinerView* pTEOutlinerView=pTextEditOutlinerView;
- Cursor* pTECursorMerker=pTextEditCursorMerker;
+ Window* pTEWin = GetTextEditWin();
+ SdrOutliner* pTEOutliner = GetTextEditOutliner();
+ OutlinerView* pTEOutlinerView = GetTextEditOutlinerView();
+ Cursor* pTECursorMerker = mpTextEditCursorMerker;
SdrUndoManager* pUndoEditUndoManager = 0;
bool bNeedToUndoSavedRedoTextEdit(false);
- if(IsUndoEnabled() && GetModel() && pTEObj && pTEOutliner)
+ if(IsUndoEnabled() && pTEObj && pTEOutliner)
{
// change back the UndoManager to the remembered original one
::svl::IUndoManager* pOriginal = pTEOutliner->SetUndoManager(mpOldTextEditUndoManager);
@@ -908,58 +1016,64 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
}
else
{
- OSL_ENSURE(false, "´Got UndoManager back in SdrEndTextEdit which is NOT the expected document UndoManager (!)");
+ OSL_ENSURE(false, "�Got UndoManager back in SdrEndTextEdit which is NOT the expected document UndoManager (!)");
delete pOriginal;
}
}
}
// send HINT_ENDEDIT #99840#
- if( GetModel() && mxTextEditObj.is() )
+ if(mxTextEditObj.is())
{
- SdrHint aHint(*mxTextEditObj.get());
- aHint.SetKind(HINT_ENDEDIT);
- GetModel()->Broadcast(aHint);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*mxTextEditObj.get(), HINT_ENDEDIT);
}
mxTextEditObj.reset(0);
- pTextEditPV=NULL;
- pTextEditWin=NULL;
- pTextEditOutliner=NULL;
- pTextEditOutlinerView=NULL;
- pTextEditCursorMerker=NULL;
- aTextEditArea=Rectangle();
+ mpTextEditWin = 0;
+ mpTextEditOutliner = 0;
+ mpTextEditOutlinerView = 0;
+ mpTextEditCursorMerker = 0;
+ maTextEditArea.reset();
- if (pTEOutliner!=NULL)
+ if(pTEOutliner)
{
- sal_Bool bModified=pTEOutliner->IsModified();
- if (pTEOutlinerView!=NULL)
+ bool bModified(pTEOutliner->IsModified());
+
+ if(pTEOutlinerView)
{
pTEOutlinerView->HideCursor();
}
- if (pTEObj!=NULL)
+
+ if(pTEObj)
{
pTEOutliner->CompleteOnlineSpelling();
-
SdrUndoObjSetText* pTxtUndo = 0;
if( bModified )
{
sal_Int32 nText;
+
for( nText = 0; nText < pTEObj->getTextCount(); ++nText )
+ {
if( pTEObj->getText( nText ) == pTEObj->getActiveText() )
+ {
break;
+ }
+ }
- pTxtUndo = dynamic_cast< SdrUndoObjSetText* >( GetModel()->GetSdrUndoFactory().CreateUndoObjectSetText(*pTEObj, nText ) );
+ pTxtUndo = dynamic_cast< SdrUndoObjSetText* >(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoObjectSetText(*pTEObj, nText));
}
+
DBG_ASSERT( !bModified || pTxtUndo, "svx::SdrObjEditView::EndTextEdit(), could not create undo action!" );
+
// Den alten CalcFieldValue-Handler wieder setzen
// Muss vor Obj::EndTextEdit() geschehen, da dort ein UpdateFields() gemacht wird.
- pTEOutliner->SetCalcFieldValueHdl(aOldCalcFieldValueLink);
+ pTEOutliner->SetCalcFieldValueHdl(maOldCalcFieldValueLink);
pTEOutliner->SetBeginPasteOrDropHdl(Link());
pTEOutliner->SetEndPasteOrDropHdl(Link());
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
+
if( bUndo )
{
XubString aObjName;
@@ -969,49 +1083,61 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
pTEObj->EndTextEdit(*pTEOutliner);
- if( (pTEObj->GetRotateAngle() != 0) || (pTEObj && pTEObj->ISA(SdrTextObj) && ((SdrTextObj*)pTEObj)->IsFontwork()) )
- {
- // obviously a repaint
- pTEObj->ActionChanged();
- }
-
- if (pTxtUndo!=NULL)
+ // TTTT should not be needed
+ // if(pTEObj && pTEObj->IsFontwork())
+ // {
+ // pTEObj->ActionChanged();
+ // }
+ // else if(!basegfx::fTools::equalZero(pTEObj->getSdrObjectRotate()))
+ // {
+ // pTEObj->ActionChanged();
+ // }
+
+ if(pTxtUndo)
{
pTxtUndo->AfterSetText();
+
if (!pTxtUndo->IsDifferent())
{
delete pTxtUndo;
- pTxtUndo=NULL;
+ pTxtUndo = 0;
}
}
+
// Loeschung des gesamten TextObj checken
- SdrUndoAction* pDelUndo=NULL;
- sal_Bool bDelObj=sal_False;
- SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pTEObj);
- if (pTextObj!=NULL && bTextEditNewObj)
- {
- bDelObj=pTextObj->IsTextFrame() &&
- !pTextObj->HasText() &&
- !pTextObj->IsEmptyPresObj() &&
- !pTextObj->HasFill() &&
- !pTextObj->HasLine();
-
- if(pTEObj->IsInserted() && bDelObj && pTextObj->GetObjInventor()==SdrInventor && !bDontDeleteReally)
+ SdrUndoAction* pDelUndo = 0;
+ bool bDelObj(false);
+
+ if(pTEObj && mbTextEditNewObj)
+ {
+ bDelObj = pTEObj->IsTextFrame() &&
+ !pTEObj->HasText() &&
+ !pTEObj->IsEmptyPresObj() &&
+ !pTEObj->HasFill() &&
+ !pTEObj->HasLine();
+
+ if(pTEObj->IsObjectInserted() && bDelObj && SdrInventor == pTEObj->GetObjInventor() && !bDontDeleteReally)
{
- SdrObjKind eIdent=(SdrObjKind)pTextObj->GetObjIdentifier();
- if(eIdent==OBJ_TEXT || eIdent==OBJ_TEXTEXT)
+ const SdrObjKind eIdent((SdrObjKind)pTEObj->GetObjIdentifier());
+
+ if(OBJ_TEXT == eIdent)
{
- pDelUndo= GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pTEObj);
+ pDelUndo = getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pTEObj);
}
}
}
- if (pTxtUndo!=NULL)
+
+ if(pTxtUndo)
{
if( bUndo )
+ {
AddUndo(pTxtUndo);
+ }
+
eRet=SDRENDTEXTEDIT_CHANGED;
}
- if (pDelUndo!=NULL)
+
+ if(pDelUndo)
{
if( bUndo )
{
@@ -1021,105 +1147,85 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
{
delete pDelUndo;
}
+
eRet=SDRENDTEXTEDIT_DELETED;
- DBG_ASSERT(pTEObj->GetObjList()!=NULL,"SdrObjEditView::SdrEndTextEdit(): Fatal: Editiertes Objekt hat keine ObjList!");
- if (pTEObj->GetObjList()!=NULL)
+ DBG_ASSERT(pTEObj->getParentOfSdrObject(), "SdrObjEditView::SdrEndTextEdit(): Fatal: Edited Object is not inserted (!)");
+
+ if(pTEObj->getParentOfSdrObject())
{
- pTEObj->GetObjList()->RemoveObject(pTEObj->GetOrdNum());
- CheckMarked(); // und gleich die Maekierung entfernen...
+ pTEObj->getParentOfSdrObject()->RemoveObjectFromSdrObjList(pTEObj->GetNavigationPosition());
}
}
else if (bDelObj)
- { // Fuer den Writer: Loeschen muss die App nachholen.
+ {
+ // Fuer den Writer: Loeschen muss die App nachholen.
eRet=SDRENDTEXTEDIT_SHOULDBEDELETED;
}
if( bUndo )
+ {
EndUndo(); // EndUndo hinter Remove, falls der UndoStack gleich weggehaun' wird
+ }
// #111096#
// Switch on evtl. TextAnimation again after TextEdit
- if(pTEObj->ISA(SdrTextObj))
- {
- ((SdrTextObj*)pTEObj)->SetTextAnimationAllowed(sal_True);
- }
-
- // #i72757#
- // Since IsMarkHdlWhenTextEdit() is ignored, it is necessary
- // to call AdjustMarkHdl() always.
- AdjustMarkHdl();
+ pTEObj->SetTextAnimationAllowed(true);
+ SetMarkHandles();
}
+
// alle OutlinerViews loeschen
- for (sal_uIntPtr i=pTEOutliner->GetViewCount(); i>0;)
+ for(sal_uInt32 i(pTEOutliner->GetViewCount()); i > 0;)
{
i--;
OutlinerView* pOLV=pTEOutliner->GetView(i);
- sal_uInt16 nMorePix=pOLV->GetInvalidateMore() + 10; // solaris aw033 test #i#
Window* pWin=pOLV->GetWindow();
- Rectangle aRect(pOLV->GetOutputArea());
+ basegfx::B2DRange aRange(pOLV->GetOutputAreaRange());
pTEOutliner->RemoveView(i);
- if (!bTextEditDontDelete || i!=0)
+
+ if(!mbTextEditDontDelete || i)
{
// die nullte gehoert mir u.U. nicht.
delete pOLV;
}
- aRect.Union(aTextEditArea);
- aRect.Union(aMinTextEditArea);
- aRect=pWin->LogicToPixel(aRect);
- aRect.Left()-=nMorePix;
- aRect.Top()-=nMorePix;
- aRect.Right()+=nMorePix;
- aRect.Bottom()+=nMorePix;
- aRect=pWin->PixelToLogic(aRect);
- InvalidateOneWin(*pWin,aRect);
-// pWin->Invalidate(INVALIDATE_UPDATE);
-
-// pWin->Update();
-// pWin->Flush();
- pWin->SetFillColor();
- pWin->SetLineColor(COL_BLACK);
- pWin->DrawPixel(aRect.TopLeft());
- pWin->DrawPixel(aRect.TopRight());
- pWin->DrawPixel(aRect.BottomLeft());
- pWin->DrawPixel(aRect.BottomRight());
- //pWin->DrawRect(aRect);
+
+ aRange.expand(maTextEditArea);
+ aRange.expand(maMinTextEditArea);
+
+ const basegfx::B2DVector aLogicPixel(pWin->GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0));
+ aRange.grow((aLogicPixel.getX() + aLogicPixel.getY()) * 0.5);
+
+ InvalidateOneWin(*pWin, aRange);
}
+
// und auch den Outliner selbst
- if (!bTextEditDontDelete) delete pTEOutliner;
- else pTEOutliner->Clear();
- if (pTEWin!=NULL) {
- pTEWin->SetCursor(pTECursorMerker);
+ if(!mbTextEditDontDelete)
+ {
+ delete pTEOutliner;
}
-//HMH if (bMarkHdlWhenTextEdit) {
-//HMH HideMarkHdl();
-//HMH }
- aHdl.SetMoveOutside(sal_False);
- if (eRet!=SDRENDTEXTEDIT_UNCHANGED)
-//HMH {
-//HMH ShowMarkHdl(); // Handles kommen ansonsten via Broadcast
-//HMH }
-//HMH else
+ else
{
- GetMarkedObjectListWriteAccess().SetNameDirty();
+ pTEOutliner->Clear();
+ }
+
+ if(pTEWin)
+ {
+ pTEWin->SetCursor(pTECursorMerker);
}
+
+ maViewHandleList.SetMoveOutside(false);
+
#ifdef DBG_UTIL
- if (pItemBrowser)
+ if(GetItemBrowser())
{
- GetMarkedObjectListWriteAccess().SetNameDirty();
- pItemBrowser->SetDirty();
+ mpItemBrowser->SetDirty();
}
#endif
}
// #108784#
- if( pTEObj &&
- pTEObj->GetModel() &&
- !pTEObj->GetModel()->isLocked() &&
- pTEObj->GetBroadcaster())
+ if(pTEObj)
{
- SdrHint aHint(HINT_ENDEDIT);
- aHint.SetObject(pTEObj);
- ((SfxBroadcaster*)pTEObj->GetBroadcaster())->Broadcast(aHint);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pTEObj, HINT_ENDEDIT);
}
if(pUndoEditUndoManager)
@@ -1141,46 +1247,57 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-// info about TextEdit. Default is sal_False.
+// info about TextEdit. Default is false.
bool SdrObjEditView::IsTextEdit() const
{
return mxTextEditObj.is();
}
-// info about TextEditPageView. Default is 0L.
-SdrPageView* SdrObjEditView::GetTextEditPageView() const
-{
- return pTextEditPV;
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
OutlinerView* SdrObjEditView::ImpFindOutlinerView(Window* pWin) const
{
- if (pWin==NULL) return NULL;
- if (pTextEditOutliner==NULL) return NULL;
- OutlinerView* pNewView=NULL;
- sal_uIntPtr nWinAnz=pTextEditOutliner->GetViewCount();
- for (sal_uIntPtr i=0; i<nWinAnz && pNewView==NULL; i++) {
- OutlinerView* pView=pTextEditOutliner->GetView(i);
- if (pView->GetWindow()==pWin) pNewView=pView;
+ if(!pWin)
+ {
+ return 0;
+ }
+
+ if(!GetTextEditOutliner())
+ {
+ return 0;
}
+
+ OutlinerView* pNewView = 0;
+ const sal_uInt32 nWinAnz(GetTextEditOutliner()->GetViewCount());
+
+ for(sal_uInt32 i(0); i < nWinAnz && !pNewView; i++)
+ {
+ OutlinerView* pView = GetTextEditOutliner()->GetView(i);
+
+ if(pView->GetWindow() == pWin)
+ {
+ pNewView = pView;
+ }
+ }
+
return pNewView;
}
void SdrObjEditView::SetTextEditWin(Window* pWin)
{
- if(mxTextEditObj.is() && pWin!=NULL && pWin!=pTextEditWin)
+ if(mxTextEditObj.is() && pWin && pWin != GetTextEditWin())
{
OutlinerView* pNewView=ImpFindOutlinerView(pWin);
- if (pNewView!=NULL && pNewView!=pTextEditOutlinerView)
+
+ if(pNewView && pNewView != GetTextEditOutlinerView())
{
- if (pTextEditOutlinerView!=NULL)
+ if(GetTextEditOutlinerView())
{
- pTextEditOutlinerView->HideCursor();
+ GetTextEditOutlinerView()->HideCursor();
}
- pTextEditOutlinerView=pNewView;
- pTextEditWin=pWin;
+
+ mpTextEditOutlinerView = pNewView;
+ mpTextEditWin = pWin;
pWin->GrabFocus(); // Damit der Cursor hier auch blinkt
pNewView->ShowCursor();
ImpMakeTextCursorAreaVisible();
@@ -1188,69 +1305,86 @@ void SdrObjEditView::SetTextEditWin(Window* pWin)
}
}
-sal_Bool SdrObjEditView::IsTextEditHit(const Point& rHit, short nTol) const
+bool SdrObjEditView::IsTextEditHit(const basegfx::B2DPoint& rHit, double fTol) const
{
- sal_Bool bOk=sal_False;
+ bool bOk(false);
+
if(mxTextEditObj.is())
{
- nTol=ImpGetHitTolLogic(nTol,NULL);
- // nur drittel Toleranz hier, damit die Handles
- // noch vernuenftig getroffen werden koennen
- nTol=nTol/3;
- nTol=0; // Joe am 6.3.1997: Keine Hittoleranz mehr hier
+ fTol = 0.0; // Joe am 6.3.1997: Keine Hittoleranz mehr hier
+
if (!bOk)
{
- Rectangle aEditArea;
- OutlinerView* pOLV=pTextEditOutliner->GetView(0);
- if (pOLV!=NULL)
+ basegfx::B2DRange aEditRange;
+ OutlinerView* pOLV = GetTextEditOutliner()->GetView(0);
+
+ if(pOLV)
{
- aEditArea.Union(pOLV->GetOutputArea());
+ aEditRange.expand(pOLV->GetOutputAreaRange());
}
- aEditArea.Left()-=nTol;
- aEditArea.Top()-=nTol;
- aEditArea.Right()+=nTol;
- aEditArea.Bottom()+=nTol;
- bOk=aEditArea.IsInside(rHit);
+
+ if(!basegfx::fTools::equalZero(fTol))
+ {
+ aEditRange.grow(fabs(fTol));
+ }
+
+ bOk = aEditRange.isInside(rHit);
+
if (bOk)
- { // Nun noch checken, ob auch wirklich Buchstaben getroffen wurden
- Point aPnt(rHit); aPnt-=aEditArea.TopLeft();
- long nHitTol = 2000;
- OutputDevice* pRef = pTextEditOutliner->GetRefDevice();
+ {
+ // Nun noch checken, ob auch wirklich Buchstaben getroffen wurden
+ const basegfx::B2DPoint aTextPos(rHit - aEditRange.getMinimum());
+ long nHitTol(2000);
+ OutputDevice* pRef = GetTextEditOutliner()->GetRefDevice();
+
if( pRef )
+ {
nHitTol = pRef->LogicToLogic( nHitTol, MAP_100TH_MM, pRef->GetMapMode().GetMapUnit() );
+ }
- bOk = pTextEditOutliner->IsTextPos( aPnt, (sal_uInt16)nHitTol );
+ bOk = const_cast< SdrOutliner* >(GetTextEditOutliner())->IsTextPos(
+ Point(basegfx::fround(aTextPos.getX()), basegfx::fround(aTextPos.getY())),
+ (sal_uInt16)nHitTol);
}
}
}
+
return bOk;
}
-sal_Bool SdrObjEditView::IsTextEditFrameHit(const Point& rHit) const
+bool SdrObjEditView::IsTextEditFrameHit(const basegfx::B2DPoint& rHit) const
{
- sal_Bool bOk=sal_False;
+ bool bOk(false);
+
if(mxTextEditObj.is())
{
- SdrTextObj* pText= dynamic_cast<SdrTextObj*>(mxTextEditObj.get());
- OutlinerView* pOLV=pTextEditOutliner->GetView(0);
- if( pOLV )
+ SdrTextObj* pText = dynamic_cast<SdrTextObj*>(mxTextEditObj.get());
+ OutlinerView* pOLV = GetTextEditOutliner()->GetView(0);
+
+ if(pOLV)
{
- Window* pWin=pOLV->GetWindow();
- if (pText!=NULL && pText->IsTextFrame() && pOLV!=NULL && pWin!=NULL) {
- sal_uInt16 nPixSiz=pOLV->GetInvalidateMore();
- Rectangle aEditArea(aMinTextEditArea);
- aEditArea.Union(pOLV->GetOutputArea());
- if (!aEditArea.IsInside(rHit)) {
- Size aSiz(pWin->PixelToLogic(Size(nPixSiz,nPixSiz)));
- aEditArea.Left()-=aSiz.Width();
- aEditArea.Top()-=aSiz.Height();
- aEditArea.Right()+=aSiz.Width();
- aEditArea.Bottom()+=aSiz.Height();
- bOk=aEditArea.IsInside(rHit);
+ Window* pWin = pOLV->GetWindow();
+
+ if(pText && pText->IsTextFrame() && pOLV && pWin)
+ {
+ const sal_uInt16 nPixSiz(pOLV->GetInvalidateMore());
+ basegfx::B2DRange aEditArea(maMinTextEditArea);
+
+ aEditArea.expand(pOLV->GetOutputAreaRange());
+
+ if(!aEditArea.isInside(rHit))
+ {
+ const basegfx::B2DVector aLogic(pWin->GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0));
+ const double fMetric(aLogic.getLength());
+
+ aEditArea.grow(fMetric);
+
+ bOk = aEditArea.isInside(rHit);
}
}
}
}
+
return bOk;
}
@@ -1259,30 +1393,31 @@ void SdrObjEditView::AddTextEditOfs(MouseEvent& rMEvt) const
if(mxTextEditObj.is())
{
Point aPvOfs;
- SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(mxTextEditObj.get());
- if( pTextObj )
+ if(pTextObj)
{
// #108784#
- aPvOfs += pTextObj->GetTextEditOffset();
+ const basegfx::B2DPoint aTextEdOff(pTextObj->GetTextEditOffset());
+ aPvOfs = Point(basegfx::fround(aTextEdOff.getX()), basegfx::fround(aTextEdOff.getY()));
}
- Point aObjOfs(mxTextEditObj->GetLogicRect().TopLeft());
- (Point&)(rMEvt.GetPosPixel())+=aPvOfs+aObjOfs;
+ Point aObjOfs(sdr::legacy::GetLogicRect(*mxTextEditObj.get()).TopLeft());
+ (Point&)(rMEvt.GetPosPixel()) += aPvOfs + aObjOfs;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
+bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
{
- if(pTextEditOutlinerView)
+ if(GetTextEditOutlinerView())
{
#ifdef DBG_UTIL
- if(rKEvt.GetKeyCode().GetCode() == KEY_RETURN && pTextEditOutliner->GetParagraphCount() == 1)
+ if(KEY_RETURN == rKEvt.GetKeyCode().GetCode() && 1 == GetTextEditOutliner()->GetParagraphCount())
{
ByteString aLine(
- pTextEditOutliner->GetText(pTextEditOutliner->GetParagraph( 0 ), 1),
+ GetTextEditOutliner()->GetText(GetTextEditOutliner()->GetParagraph( 0 ), 1),
gsl_getSystemTextEncoding());
aLine = aLine.ToUpperAscii();
@@ -1290,253 +1425,451 @@ sal_Bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
ShowItemBrowser();
}
#endif
- if (pTextEditOutlinerView->PostKeyEvent(rKEvt))
+ if(GetTextEditOutlinerView()->PostKeyEvent(rKEvt))
{
- if( pMod /* && !pMod->IsChanged() */ )
+ if(GetTextEditOutliner() && GetTextEditOutliner()->IsModified())
{
- if( pTextEditOutliner && pTextEditOutliner->IsModified() )
- pMod->SetChanged( sal_True );
+ getSdrModelFromSdrView().SetChanged(true);
+ }
+
+ if(pWin && pWin != GetTextEditWin())
+ {
+ SetTextEditWin(pWin);
}
- if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
- return sal_True;
+
+ return true;
}
}
- return SdrGlueEditView::KeyInput(rKEvt,pWin);
+
+ return SdrGlueEditView::KeyInput(rKEvt, pWin);
}
-sal_Bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, Window* pWin)
+bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, Window* pWin)
{
- if (pTextEditOutlinerView!=NULL) {
- sal_Bool bPostIt=pTextEditOutliner->IsInSelectionMode();
- if (!bPostIt) {
- Point aPt(rMEvt.GetPosPixel());
- if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,nHitTolLog);
+ if(GetTextEditOutlinerView())
+ {
+ bool bPostIt(GetTextEditOutliner()->IsInSelectionMode());
+
+ if(!bPostIt)
+ {
+ basegfx::B2DPoint aPt(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+
+ if(pWin)
+ {
+ aPt = pWin->GetInverseViewTransformation() * aPt;
+ }
+ else if(GetTextEditWin())
+ {
+ aPt = GetTextEditWin()->GetInverseViewTransformation() * aPt;
+ }
+
+ bPostIt = IsTextEditHit(aPt, getHitTolLog());
}
- if (bPostIt) {
+
+ if(bPostIt)
+ {
Point aPixPos(rMEvt.GetPosPixel());
- Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
- MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
- rMEvt.GetButtons(),rMEvt.GetModifier());
- if (pTextEditOutlinerView->MouseButtonDown(aMEvt)) {
- if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
+ Rectangle aR(pWin->LogicToPixel(GetTextEditOutlinerView()->GetOutputArea()));
+
+ if(aPixPos.X() < aR.Left())
+ {
+ aPixPos.X() = aR.Left();
+ }
+
+ if(aPixPos.X() > aR.Right())
+ {
+ aPixPos.X() = aR.Right();
+ }
+
+ if(aPixPos.Y() < aR.Top())
+ {
+ aPixPos.Y() = aR.Top();
+ }
+
+ if(aPixPos.Y() > aR.Bottom())
+ {
+ aPixPos.Y() = aR.Bottom();
+ }
+
+ MouseEvent aMEvt(aPixPos, rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier());
+
+ if(GetTextEditOutlinerView()->MouseButtonDown(aMEvt))
+ {
+ if(pWin && pWin != GetTextEditWin())
+ {
+ SetTextEditWin(pWin);
+ }
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
- return sal_True;
+
+ return true;
}
}
}
- return SdrGlueEditView::MouseButtonDown(rMEvt,pWin);
+
+ return SdrGlueEditView::MouseButtonDown(rMEvt, pWin);
}
-sal_Bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, Window* pWin)
+bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, Window* pWin)
{
- if (pTextEditOutlinerView!=NULL) {
- sal_Bool bPostIt=pTextEditOutliner->IsInSelectionMode();
- if (!bPostIt) {
- Point aPt(rMEvt.GetPosPixel());
- if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,nHitTolLog);
+ if(GetTextEditOutlinerView())
+ {
+ bool bPostIt(GetTextEditOutliner()->IsInSelectionMode());
+
+ if(!bPostIt)
+ {
+ basegfx::B2DPoint aPt(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+
+ if(pWin)
+ {
+ aPt = pWin->GetInverseViewTransformation() * aPt;
+ }
+ else if(GetTextEditWin())
+ {
+ aPt = GetTextEditWin()->GetInverseViewTransformation() * aPt;
+ }
+
+ bPostIt = IsTextEditHit(aPt, getHitTolLog());
}
- if (bPostIt) {
+
+ if(bPostIt)
+ {
Point aPixPos(rMEvt.GetPosPixel());
- Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
- MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
- rMEvt.GetButtons(),rMEvt.GetModifier());
- if (pTextEditOutlinerView->MouseButtonUp(aMEvt)) {
+ Rectangle aR(pWin->LogicToPixel(GetTextEditOutlinerView()->GetOutputArea()));
+
+ if(aPixPos.X() < aR.Left())
+ {
+ aPixPos.X() = aR.Left();
+ }
+
+ if(aPixPos.X() > aR.Right())
+ {
+ aPixPos.X() = aR.Right();
+ }
+
+ if(aPixPos.Y() < aR.Top())
+ {
+ aPixPos.Y() = aR.Top();
+ }
+
+ if(aPixPos.Y() > aR.Bottom())
+ {
+ aPixPos.Y() = aR.Bottom();
+ }
+
+ MouseEvent aMEvt(aPixPos, rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier());
+
+ if(GetTextEditOutlinerView()->MouseButtonUp(aMEvt))
+ {
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
- return sal_True;
+ return true;
}
}
}
- return SdrGlueEditView::MouseButtonUp(rMEvt,pWin);
+
+ return SdrGlueEditView::MouseButtonUp(rMEvt, pWin);
}
-sal_Bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
+bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
{
- if (pTextEditOutlinerView!=NULL) {
- sal_Bool bSelMode=pTextEditOutliner->IsInSelectionMode();
- sal_Bool bPostIt=bSelMode;
- if (!bPostIt) {
- Point aPt(rMEvt.GetPosPixel());
- if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,nHitTolLog);
+ if(GetTextEditOutlinerView())
+ {
+ bool bSelMode(GetTextEditOutliner()->IsInSelectionMode());
+ bool bPostIt(bSelMode);
+
+ if(!bPostIt)
+ {
+ basegfx::B2DPoint aPt(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+
+ if(pWin)
+ {
+ aPt = pWin->GetInverseViewTransformation() * aPt;
+ }
+ else if(GetTextEditWin())
+ {
+ aPt = GetTextEditWin()->GetInverseViewTransformation() * aPt;
+ }
+
+ bPostIt = IsTextEditHit(aPt, getHitTolLog());
}
- if (bPostIt) {
+
+ if(bPostIt)
+ {
Point aPixPos(rMEvt.GetPosPixel());
- Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
- MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
- rMEvt.GetButtons(),rMEvt.GetModifier());
- if (pTextEditOutlinerView->MouseMove(aMEvt) && bSelMode) {
+ Rectangle aR(pWin->LogicToPixel(GetTextEditOutlinerView()->GetOutputArea()));
+
+ if(aPixPos.X() < aR.Left())
+ {
+ aPixPos.X() = aR.Left();
+ }
+
+ if(aPixPos.X() > aR.Right())
+ {
+ aPixPos.X() = aR.Right();
+ }
+
+ if(aPixPos.Y() < aR.Top())
+ {
+ aPixPos.Y() = aR.Top();
+ }
+
+ if(aPixPos.Y() > aR.Bottom())
+ {
+ aPixPos.Y() = aR.Bottom();
+ }
+
+ MouseEvent aMEvt(aPixPos, rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier());
+
+ if(GetTextEditOutlinerView()->MouseMove(aMEvt) && bSelMode)
+ {
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
- return sal_True;
+
+ return true;
}
}
}
- return SdrGlueEditView::MouseMove(rMEvt,pWin);
+
+ return SdrGlueEditView::MouseMove(rMEvt, pWin);
}
-sal_Bool SdrObjEditView::Command(const CommandEvent& rCEvt, Window* pWin)
+bool SdrObjEditView::Command(const CommandEvent& rCEvt, Window* pWin)
{
- // solange bis die OutlinerView einen sal_Bool zurueckliefert
+ // solange bis die OutlinerView einen bool zurueckliefert
// bekommt sie nur COMMAND_STARTDRAG
- if (pTextEditOutlinerView!=NULL)
+ if(GetTextEditOutlinerView())
{
- if (rCEvt.GetCommand()==COMMAND_STARTDRAG) {
- sal_Bool bPostIt=pTextEditOutliner->IsInSelectionMode() || !rCEvt.IsMouseEvent();
- if (!bPostIt && rCEvt.IsMouseEvent()) {
- Point aPt(rCEvt.GetMousePosPixel());
- if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
- bPostIt=IsTextEditHit(aPt,nHitTolLog);
+ if(COMMAND_STARTDRAG == rCEvt.GetCommand())
+ {
+ bool bPostIt(GetTextEditOutliner()->IsInSelectionMode() || !rCEvt.IsMouseEvent());
+
+ if(!bPostIt && rCEvt.IsMouseEvent())
+ {
+ basegfx::B2DPoint aPt(rCEvt.GetMousePosPixel().X(), rCEvt.GetMousePosPixel().Y());
+
+ if(pWin)
+ {
+ aPt = pWin->GetInverseViewTransformation() * aPt;
+ }
+ else if(GetTextEditWin())
+ {
+ aPt = GetTextEditWin()->GetInverseViewTransformation() * aPt;
+ }
+
+ bPostIt = IsTextEditHit(aPt, getHitTolLog());
}
- if (bPostIt) {
+
+ if(bPostIt)
+ {
Point aPixPos(rCEvt.GetMousePosPixel());
- if (rCEvt.IsMouseEvent()) {
- Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+
+ if(rCEvt.IsMouseEvent())
+ {
+ Rectangle aR(pWin->LogicToPixel(GetTextEditOutlinerView()->GetOutputArea()));
+
+ if(aPixPos.X() < aR.Left())
+ {
+ aPixPos.X() = aR.Left();
+ }
+
+ if(aPixPos.X() > aR.Right())
+ {
+ aPixPos.X() = aR.Right();
+ }
+
+ if(aPixPos.Y() < aR.Top())
+ {
+ aPixPos.Y() = aR.Top();
+ }
+
+ if(aPixPos.Y() > aR.Bottom())
+ {
+ aPixPos.Y() = aR.Bottom();
+ }
}
+
CommandEvent aCEvt(aPixPos,rCEvt.GetCommand(),rCEvt.IsMouseEvent());
+
// Command ist an der OutlinerView leider void
- pTextEditOutlinerView->Command(aCEvt);
- if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
+ GetTextEditOutlinerView()->Command(aCEvt);
+
+ if(pWin && pWin != GetTextEditWin())
+ {
+ SetTextEditWin(pWin);
+ }
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
- return sal_True;
+ return true;
}
}
else // if (rCEvt.GetCommand() == COMMAND_VOICE )
{
- pTextEditOutlinerView->Command(rCEvt);
- return sal_True;
+ GetTextEditOutlinerView()->Command(rCEvt);
+
+ return true;
}
}
+
return SdrGlueEditView::Command(rCEvt,pWin);
}
-sal_Bool SdrObjEditView::Cut(sal_uIntPtr nFormat)
+bool SdrObjEditView::Cut(sal_uInt32 nFormat)
{
- if (pTextEditOutliner!=NULL) {
- pTextEditOutlinerView->Cut();
+ if(GetTextEditOutliner())
+ {
+ GetTextEditOutlinerView()->Cut();
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
- return sal_True;
- } else {
+
+ return true;
+ }
+ else
+ {
return SdrGlueEditView::Cut(nFormat);
}
}
-sal_Bool SdrObjEditView::Yank(sal_uIntPtr nFormat)
+bool SdrObjEditView::Yank(sal_uInt32 nFormat)
{
- if (pTextEditOutliner!=NULL) {
- pTextEditOutlinerView->Copy();
- return sal_True;
- } else {
+ if(GetTextEditOutliner())
+ {
+ GetTextEditOutlinerView()->Copy();
+ return true;
+ }
+ else
+ {
return SdrGlueEditView::Yank(nFormat);
}
}
-sal_Bool SdrObjEditView::Paste(Window* pWin, sal_uIntPtr nFormat)
+bool SdrObjEditView::Paste(Window* pWin, sal_uInt32 nFormat)
{
- if (pTextEditOutliner!=NULL) {
- if (pWin!=NULL) {
+ if(GetTextEditOutliner())
+ {
+ if(pWin)
+ {
OutlinerView* pNewView=ImpFindOutlinerView(pWin);
- if (pNewView!=NULL) {
+
+ if(pNewView)
+ {
pNewView->Paste();
}
- } else {
- pTextEditOutlinerView->Paste();
+ }
+ else
+ {
+ GetTextEditOutlinerView()->Paste();
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
- return sal_True;
- } else {
+
+ return true;
+ }
+ else
+ {
return SdrGlueEditView::Paste(pWin,nFormat);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrObjEditView::ImpIsTextEditAllSelected() const
+bool SdrObjEditView::ImpIsTextEditAllSelected() const
{
- sal_Bool bRet=sal_False;
- if (pTextEditOutliner!=NULL && pTextEditOutlinerView!=NULL)
+ bool bRet(false);
+
+ if(GetTextEditOutliner() && GetTextEditOutlinerView())
{
- if(SdrTextObj::HasTextImpl( pTextEditOutliner ) )
+ if(SdrTextObj::HasTextImpl(GetTextEditOutliner()))
{
- const sal_uInt32 nParaAnz=pTextEditOutliner->GetParagraphCount();
- Paragraph* pLastPara=pTextEditOutliner->GetParagraph( nParaAnz > 1 ? nParaAnz - 1 : 0 );
+ const sal_uInt32 nParaAnz(GetTextEditOutliner()->GetParagraphCount());
+ Paragraph* pLastPara = GetTextEditOutliner()->GetParagraph(nParaAnz > 1 ? nParaAnz - 1 : 0);
+ ESelection aESel(const_cast< OutlinerView* >(GetTextEditOutlinerView())->GetSelection());
- ESelection aESel(pTextEditOutlinerView->GetSelection());
- if (aESel.nStartPara==0 && aESel.nStartPos==0 && aESel.nEndPara==sal_uInt16(nParaAnz-1))
+ if(0 == aESel.nStartPara && 0 == aESel.nStartPos && aESel.nEndPara == sal_uInt16(nParaAnz - 1))
{
- XubString aStr(pTextEditOutliner->GetText(pLastPara));
+ XubString aStr(GetTextEditOutliner()->GetText(pLastPara));
if(aStr.Len() == aESel.nEndPos)
- bRet = sal_True;
+ {
+ bRet = true;
+ }
}
+
// und nun auch noch fuer den Fall, das rueckwaerts selektiert wurde
- if (!bRet && aESel.nEndPara==0 && aESel.nEndPos==0 && aESel.nStartPara==sal_uInt16(nParaAnz-1))
+ if(!bRet && 0 == aESel.nEndPara && 0 == aESel.nEndPos && aESel.nStartPara == sal_uInt16(nParaAnz - 1))
{
- XubString aStr(pTextEditOutliner->GetText(pLastPara));
+ XubString aStr(GetTextEditOutliner()->GetText(pLastPara));
if(aStr.Len() == aESel.nStartPos)
- bRet = sal_True;
+ {
+ bRet = true;
+ }
}
}
else
{
- bRet=sal_True;
+ bRet = true;
}
}
+
return bRet;
}
void SdrObjEditView::ImpMakeTextCursorAreaVisible()
{
- if (pTextEditOutlinerView!=NULL && pTextEditWin!=NULL) {
- Cursor* pCsr=pTextEditWin->GetCursor();
- if (pCsr!=NULL) {
- Size aSiz(pCsr->GetSize());
- if (aSiz.Width()!=0 && aSiz.Height()!=0) { // #38450#
- MakeVisible(Rectangle(pCsr->GetPos(),aSiz),*pTextEditWin);
+ if(GetTextEditOutlinerView() && GetTextEditWin())
+ {
+ const Cursor* pCsr = GetTextEditWin()->GetCursor();
+
+ if(pCsr)
+ {
+ const Size aSiz(pCsr->GetSize());
+
+ if(aSiz.Width() && aSiz.Height())
+ {
+ // #38450#
+ basegfx::B2DRange aRange(basegfx::B2DTuple(pCsr->GetPos().X(), pCsr->GetPos().Y()));
+
+ aRange.expand(aRange.getMinimum() + basegfx::B2DPoint(aSiz.getWidth(), aSiz.getHeight()));
+ MakeVisibleAtView(aRange, *GetTextEditWin());
}
}
}
@@ -1544,23 +1877,27 @@ void SdrObjEditView::ImpMakeTextCursorAreaVisible()
sal_uInt16 SdrObjEditView::GetScriptType() const
{
- sal_uInt16 nScriptType = 0;
+ sal_uInt16 nScriptType(0);
if( IsTextEdit() )
{
if( mxTextEditObj->GetOutlinerParaObject() )
+ {
nScriptType = mxTextEditObj->GetOutlinerParaObject()->GetTextObject().GetScriptType();
+ }
- if( pTextEditOutlinerView )
- nScriptType = pTextEditOutlinerView->GetSelectedScriptType();
+ if(GetTextEditOutlinerView())
+ {
+ nScriptType = GetTextEditOutlinerView()->GetSelectedScriptType();
+ }
}
- else
+ else if(areSdrObjectsSelected())
{
- sal_uInt32 nMarkCount( GetMarkedObjectCount() );
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for( sal_uInt32 i = 0; i < nMarkCount; i++ )
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- OutlinerParaObject* pParaObj = GetMarkedObjectByIndex( i )->GetOutlinerParaObject();
+ OutlinerParaObject* pParaObj = aSelection[i]->GetOutlinerParaObject();
if( pParaObj )
{
@@ -1569,47 +1906,58 @@ sal_uInt16 SdrObjEditView::GetScriptType() const
}
}
- if( nScriptType == 0 )
+ if(!nScriptType)
+ {
nScriptType = SCRIPTTYPE_LATIN;
+ }
return nScriptType;
}
-/* new interface src537 */
-sal_Bool SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const
+bool SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
{
if( mxSelectionController.is() )
+ {
if( mxSelectionController->GetAttributes( rTargetSet, bOnlyHardAttr ) )
- return sal_True;
+ {
+ return true;
+ }
+ }
if(IsTextEdit())
{
- DBG_ASSERT(pTextEditOutlinerView!=NULL,"SdrObjEditView::GetAttributes(): pTextEditOutlinerView=NULL");
- DBG_ASSERT(pTextEditOutliner!=NULL,"SdrObjEditView::GetAttributes(): pTextEditOutliner=NULL");
+ DBG_ASSERT(GetTextEditOutlinerView()!=NULL,"SdrObjEditView::GetAttributes(): GetTextEditOutlinerView()=NULL");
+ DBG_ASSERT(GetTextEditOutliner()!=NULL,"SdrObjEditView::GetAttributes(): GetTextEditOutliner()=NULL");
// #92389# take care of bOnlyHardAttr(!)
if(!bOnlyHardAttr && mxTextEditObj->GetStyleSheet())
+ {
rTargetSet.Put(mxTextEditObj->GetStyleSheet()->GetItemSet());
+ }
// add object attributes
rTargetSet.Put( mxTextEditObj->GetMergedItemSet() );
if( mxTextEditObj->GetOutlinerParaObject() )
+ {
rTargetSet.Put( SvxScriptTypeItem( mxTextEditObj->GetOutlinerParaObject()->GetTextObject().GetScriptType() ) );
+ }
- if(pTextEditOutlinerView)
+ if(GetTextEditOutlinerView())
{
- // FALSE= InvalidItems nicht al Default, sondern als "Loecher" betrachten
- rTargetSet.Put(pTextEditOutlinerView->GetAttribs(), sal_False);
- rTargetSet.Put( SvxScriptTypeItem( pTextEditOutlinerView->GetSelectedScriptType() ), sal_False );
+ // false= InvalidItems nicht al Default, sondern als "Loecher" betrachten
+ rTargetSet.Put(const_cast< OutlinerView* >(GetTextEditOutlinerView())->GetAttribs(), false);
+ rTargetSet.Put( SvxScriptTypeItem( GetTextEditOutlinerView()->GetSelectedScriptType() ), false );
}
- if(GetMarkedObjectCount()==1 && GetMarkedObjectByIndex(0)==mxTextEditObj.get())
+ const SdrObject* pSingleSelected = getSelectedIfSingle();
+
+ if(pSingleSelected && pSingleSelected == mxTextEditObj.get())
{
- MergeNotPersistAttrFromMarked(rTargetSet, bOnlyHardAttr);
+ MergeNotPersistAttrFromMarked(rTargetSet);
}
- return sal_True;
+ return true;
}
else
{
@@ -1617,20 +1965,21 @@ sal_Bool SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHar
}
}
-sal_Bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll)
+bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
- sal_Bool bRet=sal_False;
- sal_Bool bTextEdit=pTextEditOutlinerView!=NULL && mxTextEditObj.is();
- sal_Bool bAllTextSelected=ImpIsTextEditAllSelected();
- SfxItemSet* pModifiedSet=NULL;
+ bool bRet(false);
+ const bool bTextEdit(GetTextEditOutlinerView() && mxTextEditObj.is());
+ bool bAllTextSelected(ImpIsTextEditAllSelected());
+ SfxItemSet* pModifiedSet = 0;
const SfxItemSet* pSet=&rSet;
- //const SvxAdjustItem* pParaJust=NULL;
if (!bTextEdit)
{
// Kein TextEdit aktiv -> alle Items ans Zeichenobjekt
if( mxSelectionController.is() )
+ {
bRet=mxSelectionController->SetAttributes(*pSet,bReplaceAll );
+ }
if( !bRet )
{
@@ -1641,16 +1990,20 @@ sal_Bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplace
{
#ifdef DBG_UTIL
{
- sal_Bool bHasEEFeatureItems=sal_False;
+ bool bHasEEFeatureItems(false);
SfxItemIter aIter(rSet);
const SfxPoolItem* pItem=aIter.FirstItem();
- while (!bHasEEFeatureItems && pItem!=NULL)
+
+ while(!bHasEEFeatureItems && pItem)
{
if (!IsInvalidItem(pItem))
{
- sal_uInt16 nW=pItem->Which();
+ sal_uInt16 nW(pItem->Which());
+
if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END)
- bHasEEFeatureItems=sal_True;
+ {
+ bHasEEFeatureItems = true;
+ }
}
pItem=aIter.NextItem();
@@ -1665,25 +2018,28 @@ sal_Bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplace
}
#endif
- sal_Bool bOnlyEEItems;
- sal_Bool bNoEEItems=!SearchOutlinerItems(*pSet,bReplaceAll,&bOnlyEEItems);
+ bool bOnlyEEItems;
+ bool bNoEEItems(!SearchOutlinerItems(*pSet, bReplaceAll, &bOnlyEEItems));
+
// alles selektiert? -> Attrs auch an den Rahmen
// und falls keine EEItems, dann Attrs nur an den Rahmen
if (bAllTextSelected || bNoEEItems)
{
if( mxSelectionController.is() )
+ {
bRet=mxSelectionController->SetAttributes(*pSet,bReplaceAll );
+ }
if( !bRet )
{
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
if( bUndo )
{
String aStr;
- ImpTakeDescriptionStr(STR_EditSetAttributes,aStr);
+ TakeMarkedDescriptionString(STR_EditSetAttributes,aStr);
BegUndo(aStr);
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get()));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get()));
// #i43537#
// If this is a text object also rescue the OutlinerParaObject since
@@ -1693,14 +2049,14 @@ sal_Bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplace
// implementation itself.
bool bRescueText = dynamic_cast< SdrTextObj* >(mxTextEditObj.get());
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(),false,!bNoEEItems || bRescueText));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(), false, !bNoEEItems || bRescueText));
EndUndo();
}
mxTextEditObj->SetMergedItemSetAndBroadcast(*pSet, bReplaceAll);
- FlushComeBackTimer(); // Damit ModeHasChanged sofort kommt
- bRet=sal_True;
+ ForceLazyReactOnObjectChanges(); // Damit ModeHasChanged sofort kommt
+ bRet = true;
}
}
else if (!bOnlyEEItems)
@@ -1709,64 +2065,83 @@ sal_Bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplace
// Es wird nun ein ItemSet aSet gemacht, in den die EE_Items von
// *pSet nicht enhalten ist (ansonsten ist es eine Kopie).
sal_uInt16* pNewWhichTable=RemoveWhichRange(pSet->GetRanges(),EE_ITEMS_START,EE_ITEMS_END);
- SfxItemSet aSet(pMod->GetItemPool(),pNewWhichTable);
- /*90353*/ delete[] pNewWhichTable;
+ SfxItemSet aSet(getSdrModelFromSdrView().GetItemPool(), pNewWhichTable);
+ delete[] pNewWhichTable;
SfxWhichIter aIter(aSet);
sal_uInt16 nWhich=aIter.FirstWhich();
- while (nWhich!=0)
+
+ while(nWhich)
{
const SfxPoolItem* pItem;
- SfxItemState eState=pSet->GetItemState(nWhich,sal_False,&pItem);
- if (eState==SFX_ITEM_SET) aSet.Put(*pItem);
- nWhich=aIter.NextWhich();
- }
+ SfxItemState eState = pSet->GetItemState(nWhich, false, &pItem);
+ if(SFX_ITEM_SET == eState)
+ {
+ aSet.Put(*pItem);
+ }
+
+ nWhich = aIter.NextWhich();
+ }
if( mxSelectionController.is() )
+ {
bRet=mxSelectionController->SetAttributes(aSet,bReplaceAll );
+ }
if( !bRet )
{
if( IsUndoEnabled() )
{
String aStr;
- ImpTakeDescriptionStr(STR_EditSetAttributes,aStr);
+ TakeMarkedDescriptionString(STR_EditSetAttributes,aStr);
BegUndo(aStr);
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get()));
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(),false,false));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*mxTextEditObj.get()));
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*mxTextEditObj.get(), false, false));
EndUndo();
}
mxTextEditObj->SetMergedItemSetAndBroadcast(aSet, bReplaceAll);
+ const SdrObject* pSingleSelected = getSelectedIfSingle();
- if (GetMarkedObjectCount()==1 && GetMarkedObjectByIndex(0)==mxTextEditObj.get())
+ if(pSingleSelected && pSingleSelected == mxTextEditObj.get())
{
SetNotPersistAttrToMarked(aSet,bReplaceAll);
}
}
- FlushComeBackTimer();
- bRet=sal_True;
+
+ ForceLazyReactOnObjectChanges();
+ bRet = true;
}
+
if(!bNoEEItems)
{
// und nun die Attribute auch noch an die EditEngine
- if (bReplaceAll) {
+ if(bReplaceAll)
+ {
// Am Outliner kann man leider nur alle Attribute platthauen
- pTextEditOutlinerView->RemoveAttribs( sal_True );
+ GetTextEditOutlinerView()->RemoveAttribs(true);
}
- pTextEditOutlinerView->SetAttribs(rSet);
+
+ GetTextEditOutlinerView()->SetAttribs(rSet);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
- pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
ImpMakeTextCursorAreaVisible();
}
- bRet=sal_True;
+
+ bRet = true;
}
- if (pModifiedSet!=NULL)
+
+ if(pModifiedSet)
+ {
delete pModifiedSet;
+ }
+
return bRet;
}
@@ -1777,37 +2152,42 @@ SfxStyleSheet* SdrObjEditView::GetStyleSheet() const
if( mxSelectionController.is() )
{
if( mxSelectionController->GetStyleSheet( pSheet ) )
+ {
return pSheet;
+ }
}
- if ( pTextEditOutlinerView )
+ if(GetTextEditOutlinerView())
{
- pSheet = pTextEditOutlinerView->GetStyleSheet();
+ pSheet = GetTextEditOutlinerView()->GetStyleSheet();
}
else
{
pSheet = SdrGlueEditView::GetStyleSheet();
}
+
return pSheet;
}
-sal_Bool SdrObjEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+bool SdrObjEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
if( mxSelectionController.is() )
{
if( mxSelectionController->SetStyleSheet( pStyleSheet, bDontRemoveHardAttr ) )
- return sal_True;
+ {
+ return true;
+ }
}
// if we are currently in edit mode we must also set the stylesheet
// on all paragraphs in the Outliner for the edit view
// #92191#
- if( NULL != pTextEditOutlinerView )
+ if(GetTextEditOutlinerView())
{
- Outliner* pOutliner = pTextEditOutlinerView->GetOutliner();
+ Outliner* pOutliner = GetTextEditOutlinerView()->GetOutliner();
+ const sal_uInt32 nParaCount(pOutliner->GetParagraphCount());
+ sal_uInt32 nPara;
- const sal_uIntPtr nParaCount = pOutliner->GetParagraphCount();
- sal_uIntPtr nPara;
for( nPara = 0; nPara < nParaCount; nPara++ )
{
pOutliner->SetStyleSheet( nPara, pStyleSheet );
@@ -1823,10 +2203,10 @@ void SdrObjEditView::AddWindowToPaintView(OutputDevice* pNewWin)
{
SdrGlueEditView::AddWindowToPaintView(pNewWin);
- if(mxTextEditObj.is() && !bTextEditOnlyOneView && pNewWin->GetOutDevType()==OUTDEV_WINDOW)
+ if(mxTextEditObj.is() && !mbTextEditOnlyOneView && OUTDEV_WINDOW == pNewWin->GetOutDevType())
{
- OutlinerView* pOutlView=ImpMakeOutlinerView((Window*)pNewWin,sal_False,NULL);
- pTextEditOutliner->InsertView(pOutlView);
+ OutlinerView* pOutlView = ImpMakeOutlinerView((Window*)pNewWin, false, 0);
+ GetTextEditOutliner()->InsertView(pOutlView);
}
}
@@ -1834,132 +2214,145 @@ void SdrObjEditView::DeleteWindowFromPaintView(OutputDevice* pOldWin)
{
SdrGlueEditView::DeleteWindowFromPaintView(pOldWin);
- if(mxTextEditObj.is() && !bTextEditOnlyOneView && pOldWin->GetOutDevType()==OUTDEV_WINDOW)
+ if(mxTextEditObj.is() && !mbTextEditOnlyOneView && OUTDEV_WINDOW == pOldWin->GetOutDevType())
{
- for (sal_uIntPtr i=pTextEditOutliner->GetViewCount(); i>0;) {
+ for(sal_uInt32 i(GetTextEditOutliner()->GetViewCount()); i > 0;)
+ {
i--;
- OutlinerView* pOLV=pTextEditOutliner->GetView(i);
- if (pOLV && pOLV->GetWindow()==(Window*)pOldWin) {
- delete pTextEditOutliner->RemoveView(i);
+ OutlinerView* pOLV = GetTextEditOutliner()->GetView(i);
+
+ if(pOLV && pOLV->GetWindow() == (Window*)pOldWin)
+ {
+ delete GetTextEditOutliner()->RemoveView(i);
}
}
}
}
-sal_Bool SdrObjEditView::IsTextEditInSelectionMode() const
+bool SdrObjEditView::IsTextEditInSelectionMode() const
{
- return pTextEditOutliner!=NULL && pTextEditOutliner->IsInSelectionMode();
+ return GetTextEditOutliner() && GetTextEditOutliner()->IsInSelectionMode();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@ @@@@ @@@@ @@@@@ @@@@ @@ @@ @@@@ @@@@@ @@@@@
-// @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@@ @@ @@ @@ @@ @@
-// @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@@@@@@ @@ @@ @@ @@ @@
-// @@@@@@@ @@@@@@ @@ @@@@@ @@ @@ @@@@@@@ @@ @@ @@ @@ @@@@
-// @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@@@ @@ @@ @@@@ @@ @@ @@@@ @@@@@ @@@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrObjEditView::BegMacroObj(const Point& rPnt, short nTol, SdrObject* pObj, SdrPageView* pPV, Window* pWin)
+bool SdrObjEditView::BegMacroObj(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, Window* pWin)
{
- sal_Bool bRet=sal_False;
+ bool bRet(false);
BrkMacroObj();
- if (pObj!=NULL && pPV!=NULL && pWin!=NULL && pObj->HasMacro()) {
- nTol=ImpGetHitTolLogic(nTol,NULL);
- pMacroObj=pObj;
- pMacroPV=pPV;
- pMacroWin=pWin;
- bMacroDown=sal_False;
- nMacroTol=sal_uInt16(nTol);
- aMacroDownPos=rPnt;
+
+ if(pObj && pWin && pObj->HasMacro())
+ {
+ mpMacroObj = pObj;
+ mpMacroWin = pWin;
+ mbMacroDown = false;
+ mnMacroTol = sal_uInt16(fTol);
+ maMacroDownPos = rPnt;
+
MovMacroObj(rPnt);
}
+
return bRet;
}
-void SdrObjEditView::ImpMacroUp(const Point& rUpPos)
+void SdrObjEditView::ImpMacroUp(const basegfx::B2DPoint& rUpPos)
{
- if (pMacroObj!=NULL && bMacroDown)
+ if(mpMacroObj && mbMacroDown)
{
SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=rUpPos;
- aHitRec.aDownPos=aMacroDownPos;
- aHitRec.nTol=nMacroTol;
- aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
- aHitRec.pPageView=pMacroPV;
- aHitRec.pOut=pMacroWin;
- pMacroObj->PaintMacro(*pMacroWin,Rectangle(),aHitRec);
- bMacroDown=sal_False;
+
+ aHitRec.maPos = rUpPos;
+ aHitRec.maDownPos = maMacroDownPos;
+ aHitRec.mfTol = mnMacroTol;
+ aHitRec.mpSdrView = getAsSdrView();
+ aHitRec.mpOut = mpMacroWin;
+
+ mpMacroObj->PaintMacro(*mpMacroWin, aHitRec);
+ mbMacroDown = false;
}
}
-void SdrObjEditView::ImpMacroDown(const Point& rDownPos)
+void SdrObjEditView::ImpMacroDown(const basegfx::B2DPoint& rDownPos)
{
- if (pMacroObj!=NULL && !bMacroDown)
+ if(mpMacroObj && !mbMacroDown)
{
SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=rDownPos;
- aHitRec.aDownPos=aMacroDownPos;
- aHitRec.nTol=nMacroTol;
- aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
- aHitRec.pPageView=pMacroPV;
- aHitRec.bDown=sal_True;
- aHitRec.pOut=pMacroWin;
- pMacroObj->PaintMacro(*pMacroWin,Rectangle(),aHitRec);
- bMacroDown=sal_True;
+
+ aHitRec.maPos = rDownPos;
+ aHitRec.maDownPos = maMacroDownPos;
+ aHitRec.mfTol = mnMacroTol;
+ aHitRec.mpSdrView = getAsSdrView();
+ aHitRec.mbDown = true;
+ aHitRec.mpOut = mpMacroWin;
+
+ mpMacroObj->PaintMacro(*mpMacroWin, aHitRec);
+ mbMacroDown = true;
}
}
-void SdrObjEditView::MovMacroObj(const Point& rPnt)
+void SdrObjEditView::MovMacroObj(const basegfx::B2DPoint& rPnt)
+{
+ if(mpMacroObj)
{
- if (pMacroObj!=NULL) {
SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=rPnt;
- aHitRec.aDownPos=aMacroDownPos;
- aHitRec.nTol=nMacroTol;
- aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
- aHitRec.pPageView=pMacroPV;
- aHitRec.bDown=bMacroDown;
- aHitRec.pOut=pMacroWin;
- sal_Bool bDown=pMacroObj->IsMacroHit(aHitRec);
- if (bDown) ImpMacroDown(rPnt);
- else ImpMacroUp(rPnt);
+
+ aHitRec.maPos = rPnt;
+ aHitRec.maDownPos = maMacroDownPos;
+ aHitRec.mfTol = mnMacroTol;
+ aHitRec.mpSdrView = getAsSdrView();
+ aHitRec.mbDown = mbMacroDown;
+ aHitRec.mpOut = mpMacroWin;
+
+ bool bDown(mpMacroObj->IsMacroHit(aHitRec));
+
+ if(bDown)
+ {
+ ImpMacroDown(rPnt);
+ }
+ else
+ {
+ ImpMacroUp(rPnt);
+ }
}
}
void SdrObjEditView::BrkMacroObj()
{
- if (pMacroObj!=NULL) {
- ImpMacroUp(aMacroDownPos);
- pMacroObj=NULL;
- pMacroPV=NULL;
- pMacroWin=NULL;
+ if(mpMacroObj)
+ {
+ ImpMacroUp(maMacroDownPos);
+
+ mpMacroObj = 0;
+ mpMacroWin = 0;
}
}
-sal_Bool SdrObjEditView::EndMacroObj()
+bool SdrObjEditView::EndMacroObj()
{
- if (pMacroObj!=NULL && bMacroDown) {
- ImpMacroUp(aMacroDownPos);
+ if(mpMacroObj && mbMacroDown)
+ {
+ ImpMacroUp(maMacroDownPos);
SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=aMacroDownPos;
- aHitRec.aDownPos=aMacroDownPos;
- aHitRec.nTol=nMacroTol;
- aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
- aHitRec.pPageView=pMacroPV;
- aHitRec.bDown=sal_True;
- aHitRec.pOut=pMacroWin;
- bool bRet=pMacroObj->DoMacro(aHitRec);
- pMacroObj=NULL;
- pMacroPV=NULL;
- pMacroWin=NULL;
+
+ aHitRec.maPos = maMacroDownPos;
+ aHitRec.maDownPos = maMacroDownPos;
+ aHitRec.mfTol = mnMacroTol;
+ aHitRec.mpSdrView = getAsSdrView();
+ aHitRec.mbDown = true;
+ aHitRec.mpOut = mpMacroWin;
+
+ bool bRet(mpMacroObj->DoMacro(aHitRec));
+
+ mpMacroObj = 0;
+ mpMacroWin = 0;
+
return bRet;
- } else {
+ }
+ else
+ {
BrkMacroObj();
- return sal_False;
+
+ return false;
}
}
@@ -1970,6 +2363,7 @@ void SdrObjEditView::getTextSelection( ::com::sun::star::uno::Any& rSelection )
if( IsTextEdit() )
{
OutlinerView* pOutlinerView = GetTextEditOutlinerView();
+
if( pOutlinerView && pOutlinerView->HasSelection() )
{
SdrObject* pObj = GetTextEditObject();
@@ -1977,9 +2371,11 @@ void SdrObjEditView::getTextSelection( ::com::sun::star::uno::Any& rSelection )
if( pObj )
{
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xText( pObj->getUnoShape(), ::com::sun::star::uno::UNO_QUERY );
+
if( xText.is() )
{
SvxUnoTextBase* pRange = SvxUnoTextBase::getImplementation( xText );
+
if( pRange )
{
rSelection <<= pRange->createTextCursorBySelection( pOutlinerView->GetSelection() );
@@ -2001,10 +2397,12 @@ extern rtl::Reference< sdr::SelectionController > CreateTableController( SdrObjE
object specific view contact. Currently this method only
works for tables.
*/
-void SdrObjEditView::MarkListHasChanged()
+void SdrObjEditView::handleSelectionChange()
{
- SdrGlueEditView::MarkListHasChanged();
+ // call parent
+ SdrGlueEditView::handleSelectionChange();
+ // local reactions
if( mxSelectionController.is() )
{
mxLastSelectionController = mxSelectionController;
@@ -2013,19 +2411,16 @@ void SdrObjEditView::MarkListHasChanged()
mxSelectionController.clear();
- const SdrMarkList& rMarkList=GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ const sdr::table::SdrTableObj* pSdrTableObj = dynamic_cast< const sdr::table::SdrTableObj* >(getSelectedIfSingle());
+
+ if(pSdrTableObj)
{
- const SdrObject* pObj= rMarkList.GetMark(0)->GetMarkedSdrObj();
- // check for table
- if( pObj && (pObj->GetObjInventor() == SdrInventor ) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
+ mxSelectionController = sdr::table::CreateTableController(this, pSdrTableObj, mxLastSelectionController);
+
+ if( mxSelectionController.is() )
{
- mxSelectionController = sdr::table::CreateTableController( this, pObj, mxLastSelectionController );
- if( mxSelectionController.is() )
- {
- mxLastSelectionController.clear();
- mxSelectionController->onSelectionHasChanged();
- }
+ mxLastSelectionController.clear();
+ mxSelectionController->onSelectionHasChanged();
}
}
}
@@ -2052,54 +2447,30 @@ void SdrObjEditView::OnEndPasteOrDrop( PasteOrDropInfos* )
// applications can derive from these virtual methods to do something before a drop or paste operation
}
-bool SdrObjEditView::SupportsFormatPaintbrush( sal_uInt32 nObjectInventor, sal_uInt16 nObjectIdentifier ) const
+bool SdrObjEditView::SupportsFormatPaintbrush(const SdrObject& rSdrObject) const
{
- if( nObjectInventor != SdrInventor && nObjectInventor != E3dInventor )
- return false;
- switch(nObjectIdentifier)
- {
- case OBJ_NONE:
- case OBJ_GRUP:
- return false;
- case OBJ_LINE:
- case OBJ_RECT:
- case OBJ_CIRC:
- case OBJ_SECT:
- case OBJ_CARC:
- case OBJ_CCUT:
- case OBJ_POLY:
- case OBJ_PLIN:
- case OBJ_PATHLINE:
- case OBJ_PATHFILL:
- case OBJ_FREELINE:
- case OBJ_FREEFILL:
- case OBJ_SPLNLINE:
- case OBJ_SPLNFILL:
- case OBJ_TEXT:
- case OBJ_TEXTEXT:
- case OBJ_TITLETEXT:
- case OBJ_OUTLINETEXT:
- case OBJ_GRAF:
- case OBJ_OLE2:
- case OBJ_TABLE:
- return true;
- case OBJ_EDGE:
- case OBJ_CAPTION:
- return false;
- case OBJ_PATHPOLY:
- case OBJ_PATHPLIN:
- return true;
- case OBJ_PAGE:
- case OBJ_MEASURE:
- case OBJ_DUMMY:
- case OBJ_FRAME:
- case OBJ_UNO:
- return false;
- case OBJ_CUSTOMSHAPE:
- return true;
- default:
- return false;
+ if(SdrInventor == rSdrObject.GetObjInventor())
+ {
+ switch(rSdrObject.GetObjIdentifier())
+ {
+ case OBJ_RECT:
+ case OBJ_CIRC:
+ case OBJ_POLY:
+ case OBJ_TEXT:
+ case OBJ_TITLETEXT:
+ case OBJ_OUTLINETEXT:
+ case OBJ_GRAF:
+ case OBJ_OLE2:
+ case OBJ_TABLE:
+ case OBJ_CUSTOMSHAPE:
+ return true;
+ break;
+ default:
+ break;
+ }
}
+
+ return false;
}
static const sal_uInt16* GetFormatRangeImpl( bool bTextOnly )
@@ -2122,19 +2493,18 @@ bool SdrObjEditView::TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFor
if( mxSelectionController.is() && mxSelectionController->TakeFormatPaintBrush(rFormatSet) )
return true;
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- if( rMarkList.GetMarkCount() >= 1 )
+ if( getSelectedIfSingle() )
{
OutlinerView* pOLV = GetTextEditOutlinerView();
- rFormatSet.reset( new SfxItemSet( GetModel()->GetItemPool(), GetFormatRangeImpl( pOLV != NULL ) ) );
+ rFormatSet.reset( new SfxItemSet( getSdrModelFromSdrView().GetItemPool(), GetFormatRangeImpl( pOLV != NULL ) ) );
if( pOLV )
{
rFormatSet->Put( pOLV->GetAttribs() );
}
else
{
- const sal_Bool bOnlyHardAttr = sal_False;
+ const bool bOnlyHardAttr = false;
rFormatSet->Put( GetAttrFromMarked(bOnlyHardAttr) );
}
return true;
@@ -2197,19 +2567,18 @@ void SdrObjEditView::ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTex
OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
rOutliner.Clear();
- rTextObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
+ rTextObj.SetOutlinerParaObjectForText(pTemp,pText);
}
}
}
void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats )
{
- if( !mxSelectionController.is() || !mxSelectionController->ApplyFormatPaintBrush( rFormatSet, bNoCharacterFormats, bNoParagraphFormats ) )
+ SdrObject* pObj = getSelectedIfSingle();
+
+ if( pObj && (!mxSelectionController.is() || !mxSelectionController->ApplyFormatPaintBrush( rFormatSet, bNoCharacterFormats, bNoParagraphFormats )))
{
- const SdrMarkList& rMarkList = GetMarkedObjectList();
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
OutlinerView* pOLV = GetTextEditOutlinerView();
-
const SfxItemSet& rShapeSet = pObj->GetMergedItemSet();
if( !pOLV )
@@ -2235,7 +2604,7 @@ void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoChar
if( !bTextOnly )
{
SfxItemSet aPaintSet( CreatePaintSet( GetFormatRangeImpl(false), *rShapeSet.GetPool(), rFormatSet, rShapeSet, bNoCharacterFormats, bNoParagraphFormats ) );
- const sal_Bool bReplaceAll = sal_False;
+ const bool bReplaceAll = false;
SetAttrToMarked(aPaintSet, bReplaceAll);
}
@@ -2263,7 +2632,7 @@ void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoChar
if( !aSel.HasRange() )
pOLV->SetSelection( rEditEngine.GetWord( aSel, com::sun::star::i18n::WordType::DICTIONARY_WORD ) );
- const sal_Bool bRemoveParaAttribs = !bNoParagraphFormats;
+ const bool bRemoveParaAttribs = !bNoParagraphFormats;
pOLV->RemoveAttribsKeepLanguages( bRemoveParaAttribs );
SfxItemSet aSet( pOLV->GetAttribs() );
SfxItemSet aPaintSet( CreatePaintSet(GetFormatRangeImpl(true), *aSet.GetPool(), rFormatSet, aSet, bNoCharacterFormats, bNoParagraphFormats ) );
@@ -2272,3 +2641,6 @@ void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoChar
}
}
}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 66f348a98448..f2d2a4ae778e 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -27,12 +27,12 @@
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <svx/svdetc.hxx>
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdtrans.hxx>
#include "svx/svdglob.hxx"
#include "svx/svdstr.hrc"
-#include "svx/svdviter.hxx"
#include <svx/svdview.hxx>
#include <svx/svdoutl.hxx>
#include <vcl/bmpacc.hxx>
@@ -67,6 +67,7 @@
#include <svx/svdpage.hxx>
#include <svx/svdotable.hxx>
#include <svx/sdrhittesthelper.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -317,7 +318,7 @@ void UShortCont::Sort()
class ImpClipMerk {
Region aClip;
- FASTBOOL bClip;
+ bool bClip;
public:
ImpClipMerk(const OutputDevice& rOut): aClip(rOut.GetClipRegion()),bClip(rOut.IsClipRegion()) {}
void Restore(OutputDevice& rOut)
@@ -381,7 +382,7 @@ public:
const Color& GetLineColor() const { return aLineColor; }
};
-ImpSdrHdcMerk::ImpSdrHdcMerk(const OutputDevice& rOut, sal_uInt16 nNewMode, FASTBOOL bAutoMerk):
+ImpSdrHdcMerk::ImpSdrHdcMerk(const OutputDevice& rOut, sal_uInt16 nNewMode, bool bAutoMerk):
pFarbMerk(NULL),
pClipMerk(NULL),
pLineColorMerk(NULL),
@@ -494,10 +495,10 @@ void SdrLinkList::RemoveLink(const Link& rLink)
////////////////////////////////////////////////////////////////////////////////////////////////////
// #98988# Re-implement GetDraftFillColor(...)
-FASTBOOL GetDraftFillColor(const SfxItemSet& rSet, Color& rCol)
+bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol)
{
XFillStyle eFill=((XFillStyleItem&)rSet.Get(XATTR_FILLSTYLE)).GetValue();
- FASTBOOL bRetval(sal_False);
+ bool bRetval(sal_False);
switch(eFill)
{
@@ -690,11 +691,11 @@ String GetResourceString(sal_uInt16 nResID)
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SearchOutlinerItems(const SfxItemSet& rSet, sal_Bool bInklDefaults, sal_Bool* pbOnlyEE)
+bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE)
{
- sal_Bool bHas=sal_False;
- sal_Bool bOnly=sal_True;
- sal_Bool bLookOnly=pbOnlyEE!=NULL;
+ bool bHas=false;
+ bool bOnly=true;
+ bool bLookOnly=pbOnlyEE!=NULL;
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich=aIter.FirstWhich();
while (((bLookOnly && bOnly) || !bHas) && nWhich!=0) {
@@ -703,12 +704,12 @@ sal_Bool SearchOutlinerItems(const SfxItemSet& rSet, sal_Bool bInklDefaults, sal
// Disabled und DontCare wird als Loch im Which-Range betrachtet
SfxItemState eState=rSet.GetItemState(nWhich);
if ((eState==SFX_ITEM_DEFAULT && bInklDefaults) || eState==SFX_ITEM_SET) {
- if (nWhich<EE_ITEMS_START || nWhich>EE_ITEMS_END) bOnly=sal_False;
- else bHas=sal_True;
+ if (nWhich<EE_ITEMS_START || nWhich>EE_ITEMS_END) bOnly=false;
+ else bHas=true;
}
nWhich=aIter.NextWhich();
}
- if (!bHas) bOnly=sal_False;
+ if (!bHas) bOnly=false;
if (pbOnlyEE!=NULL) *pbOnlyEE=bOnly;
return bHas;
}
@@ -861,27 +862,24 @@ namespace
{
bool impGetSdrObjListFillColor(
const SdrObjList& rList,
- const Point& rPnt,
- const SdrPageView& rTextEditPV,
- const SetOfByte& rVisLayers,
+ const basegfx::B2DPoint& rPnt,
+ const SdrView& rTextEditView,
Color& rCol)
{
- if(!rList.GetModel())
- return false;
-
bool bRet(false);
- bool bMaster(rList.GetPage() ? rList.GetPage()->IsMasterPage() : false);
+ SdrPage* pOwningPage = rList.getSdrPageFromSdrObjList();
+ bool bMaster(pOwningPage ? pOwningPage->IsMasterPage() : false);
for(sal_uIntPtr no(rList.GetObjCount()); !bRet && no > 0; )
{
no--;
SdrObject* pObj = rList.GetObj(no);
- SdrObjList* pOL = pObj->GetSubList();
+ SdrObjList* pOL = pObj->getChildrenOfSdrObject();
if(pOL)
{
// group object
- bRet = impGetSdrObjListFillColor(*pOL, rPnt, rTextEditPV, rVisLayers, rCol);
+ bRet = impGetSdrObjListFillColor(*pOL, rPnt, rTextEditView, rCol);
}
else
{
@@ -891,9 +889,9 @@ namespace
if(pText
&& pObj->IsClosedObj()
&& (!bMaster || (!pObj->IsNotVisibleAsMaster() && 0 != no))
- && pObj->GetCurrentBoundRect().IsInside(rPnt)
+ && pObj->getObjectRange(&rTextEditView).isInside(rPnt)
&& !pText->IsHideContour()
- && SdrObjectPrimitiveHit(*pObj, rPnt, 0, rTextEditPV, &rVisLayers, false))
+ && SdrObjectPrimitiveHit(*pObj, rPnt, 0.0, rTextEditView, false, 0))
{
bRet = GetDraftFillColor(pObj->GetMergedItemSet(), rCol);
}
@@ -905,23 +903,17 @@ namespace
bool impGetSdrPageFillColor(
const SdrPage& rPage,
- const Point& rPnt,
- const SdrPageView& rTextEditPV,
- const SetOfByte& rVisLayers,
+ const basegfx::B2DPoint& rPnt,
+ const SdrView& rTextEditView,
Color& rCol,
bool bSkipBackgroundShape)
{
- if(!rPage.GetModel())
- return false;
-
- bool bRet(impGetSdrObjListFillColor(rPage, rPnt, rTextEditPV, rVisLayers, rCol));
+ bool bRet(impGetSdrObjListFillColor(rPage, rPnt, rTextEditView, rCol));
if(!bRet && !rPage.IsMasterPage())
{
if(rPage.TRG_HasMasterPage())
{
- SetOfByte aSet(rVisLayers);
- aSet &= rPage.TRG_GetMasterPageVisibleLayers();
SdrPage& rMasterPage = rPage.TRG_GetMasterPage();
// #108867# Don't fall back to background shape on
@@ -930,7 +922,7 @@ namespace
// the silly ordering: 1. shapes, 2. master page
// shapes, 3. page background, 4. master page
// background.
- bRet = impGetSdrPageFillColor(rMasterPage, rPnt, rTextEditPV, aSet, rCol, true);
+ bRet = impGetSdrPageFillColor(rMasterPage, rPnt, rTextEditView, rCol, true);
}
}
@@ -945,8 +937,8 @@ namespace
}
Color impCalcBackgroundColor(
- const Rectangle& rArea,
- const SdrPageView& rTextEditPV,
+ const basegfx::B2DRange& rArea,
+ const SdrView& rTextEditView,
const SdrPage& rPage)
{
svtools::ColorConfig aColorConfig;
@@ -956,17 +948,17 @@ namespace
if(!rStyleSettings.GetHighContrastMode())
{
// search in page
- const sal_uInt16 SPOTCOUNT(5);
- Point aSpotPos[SPOTCOUNT];
+ const sal_uInt32 SPOTCOUNT(5);
+ basegfx::B2DPoint aSpotPos[SPOTCOUNT];
Color aSpotColor[SPOTCOUNT];
- sal_uIntPtr nHeight( rArea.GetSize().Height() );
- sal_uIntPtr nWidth( rArea.GetSize().Width() );
- sal_uIntPtr nWidth14 = nWidth / 4;
- sal_uIntPtr nHeight14 = nHeight / 4;
- sal_uIntPtr nWidth34 = ( 3 * nWidth ) / 4;
- sal_uIntPtr nHeight34 = ( 3 * nHeight ) / 4;
-
- sal_uInt16 i;
+ const double fHeight( rArea.getHeight() );
+ const double fWidth( rArea.getWidth() );
+ const double fWidth14( fWidth / 4.0 );
+ const double fHeight14( fHeight / 4.0);
+ const double fWidth34(( 3.0 / 4.0) * fWidth );
+ const double fHeight34(( 3.0 / 4.0) * fHeight );
+
+ sal_uInt32 i;
for ( i = 0; i < SPOTCOUNT; i++ )
{
// five spots are used
@@ -975,60 +967,52 @@ namespace
case 0 :
{
// Center-Spot
- aSpotPos[i] = rArea.Center();
+ aSpotPos[i] = rArea.getCenter();
}
break;
case 1 :
{
// TopLeft-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth14;
- aSpotPos[i].Y() += nHeight14;
+ aSpotPos[i] = rArea.getMinimum() + basegfx::B2DPoint(fWidth14, fHeight14);
}
break;
case 2 :
{
// TopRight-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth34;
- aSpotPos[i].Y() += nHeight14;
+ aSpotPos[i] = rArea.getMinimum() + basegfx::B2DPoint(fWidth34, fHeight14);
}
break;
case 3 :
{
// BottomLeft-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth14;
- aSpotPos[i].Y() += nHeight34;
+ aSpotPos[i] = rArea.getMinimum() + basegfx::B2DPoint(fWidth14, fHeight34);
}
break;
case 4 :
{
// BottomRight-Spot
- aSpotPos[i] = rArea.TopLeft();
- aSpotPos[i].X() += nWidth34;
- aSpotPos[i].Y() += nHeight34;
+ aSpotPos[i] = rArea.getMinimum() + basegfx::B2DPoint(fWidth34, fHeight34);
}
break;
}
aSpotColor[i] = Color( COL_WHITE );
- impGetSdrPageFillColor(rPage, aSpotPos[i], rTextEditPV, rTextEditPV.GetVisibleLayers(), aSpotColor[i], false);
+ impGetSdrPageFillColor(rPage, aSpotPos[i], rTextEditView, aSpotColor[i], false);
}
- sal_uInt16 aMatch[SPOTCOUNT];
+ sal_uInt32 aMatch[SPOTCOUNT];
for ( i = 0; i < SPOTCOUNT; i++ )
{
// were same spot colors found?
aMatch[i] = 0;
- for ( sal_uInt16 j = 0; j < SPOTCOUNT; j++ )
+ for ( sal_uInt32 j = 0; j < SPOTCOUNT; j++ )
{
if( j != i )
{
@@ -1043,7 +1027,7 @@ namespace
// highest weight to center spot
aBackground = aSpotColor[0];
- for ( sal_uInt16 nMatchCount = SPOTCOUNT - 1; nMatchCount > 1; nMatchCount-- )
+ for ( sal_uInt32 nMatchCount = SPOTCOUNT - 1; nMatchCount > 1; nMatchCount-- )
{
// which spot color was found most?
for ( i = 0; i < SPOTCOUNT; i++ )
@@ -1086,20 +1070,13 @@ Color GetTextEditBackgroundColor(const SdrObjEditView& rView)
if(!bFound && pText)
{
- SdrPageView* pTextEditPV = rView.GetTextEditPageView();
-
- if(pTextEditPV)
- {
- Point aPvOfs(pText->GetTextEditOffset());
- const SdrPage* pPg = pTextEditPV->GetPage();
-
- if(pPg)
+ if(rView.GetSdrPageView())
{
- Rectangle aSnapRect( pText->GetSnapRect() );
- aSnapRect.Move(aPvOfs.X(), aPvOfs.Y());
+ const SdrPage& rPg = rView.GetSdrPageView()->getSdrPageFromSdrPageView();
+ basegfx::B2DRange aSnapRange( sdr::legacy::GetSnapRange(*pText) );
- return impCalcBackgroundColor(aSnapRect, *pTextEditPV, *pPg);
- }
+ aSnapRange.transform(basegfx::tools::createTranslateB2DHomMatrix(pText->GetTextEditOffset()));
+ return impCalcBackgroundColor(aSnapRange, (SdrView&)rView, rPg);
}
}
}
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index d164cb1ed913..4a563736e110 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -75,51 +75,49 @@
#include <svx/xflbmtit.hxx>
#include <svx/xflbstit.hxx>
#include <svx/svdpntv.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(
SdrModel& rModel,
SdrLayerID nLay,
- const Rectangle& rRect)
+ const basegfx::B2DHomMatrix& rObjectTransform)
: maTmpList(),
maVD(),
- maScaleRect(rRect),
- mnMapScalingOfs(0),
+ maObjectTransform(rObjectTransform),
+ maMetaToUnit(),
+ maCurrent(),
mpLineAttr(0),
mpFillAttr(0),
mpTextAttr(0),
- mpModel(&rModel),
+ mrModel(rModel),
mnLayer(nLay),
maOldLineColor(),
mnLineWidth(0),
maLineJoin(basegfx::B2DLINEJOIN_NONE),
maLineCap(com::sun::star::drawing::LineCap_BUTT),
maDash(XDASH_RECT, 0, 0, 0, 0, 0),
- mbMov(false),
- mbSize(false),
- maOfs(0, 0),
- mfScaleX(1.0),
- mfScaleY(1.0),
- maScaleX(1.0),
- maScaleY(1.0),
+ maClip(),
mbFntDirty(true),
mbLastObjWasPolyWithoutLine(false),
mbNoLine(false),
mbNoFill(false),
- mbLastObjWasLine(false),
- maClip()
+ mbLastObjWasLine(false)
{
maVD.EnableOutput(false);
maVD.SetLineColor();
maVD.SetFillColor();
- maOldLineColor.SetRed( maVD.GetLineColor().GetRed() + 1 );
+ maOldLineColor.SetRed(maVD.GetLineColor().GetRed() + 1);
mpLineAttr = new SfxItemSet(rModel.GetItemPool(), XATTR_LINE_FIRST, XATTR_LINE_LAST, 0, 0);
mpFillAttr = new SfxItemSet(rModel.GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0);
mpTextAttr = new SfxItemSet(rModel.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END, 0, 0);
checkClip();
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
ImpSdrGDIMetaFileImport::~ImpSdrGDIMetaFileImport()
{
delete mpLineAttr;
@@ -127,6 +125,8 @@ ImpSdrGDIMetaFileImport::~ImpSdrGDIMetaFileImport()
delete mpTextAttr;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile& rMtf, SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport)
{
for( MetaAction* pAct = rMtf.FirstAction(); pAct; pAct = rMtf.NextAction() )
@@ -205,118 +205,95 @@ void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile& rMtf, SvdProgressInfo*
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
sal_uInt32 ImpSdrGDIMetaFileImport::DoImport(
const GDIMetaFile& rMtf,
SdrObjList& rOL,
sal_uInt32 nInsPos,
SvdProgressInfo* pProgrInfo)
{
- // setup some global scale parameter
- // mfScaleX, mfScaleY, maScaleX, maScaleY, mbMov, mbSize
- mfScaleX = mfScaleY = 1.0;
- const Size aMtfSize(rMtf.GetPrefSize());
+ const sal_uInt32 nActionCount(rMtf.GetActionCount());
- if(aMtfSize.Width() & aMtfSize.Height() && (!maScaleRect.IsEmpty()))
+ if(nActionCount)
{
- maOfs = maScaleRect.TopLeft();
+ // create mapping from MetaFile coordinates to unit coordinates
+ maMetaToUnit.identity();
+ maMetaToUnit.translate(-rMtf.GetPrefMapMode().GetOrigin().X(), -rMtf.GetPrefMapMode().GetOrigin().X());
+ maMetaToUnit.scale(
+ rMtf.GetPrefSize().Width() ? 1.0 / rMtf.GetPrefSize().Width() : 1.0,
+ rMtf.GetPrefSize().Height() ? 1.0 / rMtf.GetPrefSize().Height() : 1.0);
- if(aMtfSize.Width() != (maScaleRect.GetWidth() - 1))
- {
- mfScaleX = (double)( maScaleRect.GetWidth() - 1 ) / (double)aMtfSize.Width();
- }
+ // create full mapping; first to unit coordinates, then apply object transformation
+ maCurrent = maObjectTransform * maMetaToUnit;
- if(aMtfSize.Height() != (maScaleRect.GetHeight() - 1))
+ if(pProgrInfo)
{
- mfScaleY = (double)( maScaleRect.GetHeight() - 1 ) / (double)aMtfSize.Height();
+ pProgrInfo->SetActionCount(nActionCount);
}
- }
-
- mbMov = maOfs.X()!=0 || maOfs.Y()!=0;
- mbSize = false;
- maScaleX = Fraction( 1, 1 );
- maScaleY = Fraction( 1, 1 );
- if(aMtfSize.Width() != (maScaleRect.GetWidth() - 1))
- {
- maScaleX = Fraction(maScaleRect.GetWidth() - 1, aMtfSize.Width());
- mbSize = true;
- }
+ sal_uInt32 nActionsToReport(0);
- if(aMtfSize.Height() != (maScaleRect.GetHeight() - 1))
- {
- maScaleY = Fraction(maScaleRect.GetHeight() - 1, aMtfSize.Height());
- mbSize = true;
- }
+ // execute
+ DoLoopActions(const_cast< GDIMetaFile& >(rMtf), pProgrInfo, &nActionsToReport);
- if(pProgrInfo)
- {
- pProgrInfo->SetActionCount(rMtf.GetActionCount());
- }
+ if(pProgrInfo)
+ {
+ pProgrInfo->ReportActions(nActionsToReport);
+ nActionsToReport = 0;
+ }
- sal_uInt32 nActionsToReport(0);
+ // Beim berechnen der Fortschrittsanzeige wird GetActionCount()*3 benutzt.
+ // Da in maTmpList allerdings weniger eintraege als GetActionCount()
+ // existieren koennen, muessen hier die zuviel vermuteten Actionen wieder
+ // hinzugefuegt werden.
+ nActionsToReport = (rMtf.GetActionCount() - maTmpList.size()) * 2;
- // execute
- DoLoopActions(const_cast< GDIMetaFile& >(rMtf), pProgrInfo, &nActionsToReport);
+ // Alle noch nicht gemeldeten Rescales melden
+ if(pProgrInfo)
+ {
+ pProgrInfo->ReportRescales(nActionsToReport);
+ pProgrInfo->SetInsertCount(maTmpList.size());
+ }
- if(pProgrInfo)
- {
- pProgrInfo->ReportActions(nActionsToReport);
nActionsToReport = 0;
- }
- // MapMode-Scaling vornehmen
- MapScaling();
-
- // Beim berechnen der Fortschrittsanzeige wird GetActionCount()*3 benutzt.
- // Da in maTmpList allerdings weniger eintraege als GetActionCount()
- // existieren koennen, muessen hier die zuviel vermuteten Actionen wieder
- // hinzugefuegt werden.
- nActionsToReport = (rMtf.GetActionCount() - maTmpList.size()) * 2;
-
- // Alle noch nicht gemeldeten Rescales melden
- if(pProgrInfo)
- {
- pProgrInfo->ReportRescales(nActionsToReport);
- pProgrInfo->SetInsertCount(maTmpList.size());
- }
-
- nActionsToReport = 0;
+ // alle in maTmpList zwischengespeicherten Objekte nun in rOL ab der Position nInsPos einfuegen
+ if(nInsPos > rOL.GetObjCount())
+ {
+ nInsPos = rOL.GetObjCount();
+ }
- // alle in maTmpList zwischengespeicherten Objekte nun in rOL ab der Position nInsPos einfuegen
- if(nInsPos > rOL.GetObjCount())
- {
- nInsPos = rOL.GetObjCount();
- }
+ for(sal_uInt32 i(0); i < maTmpList.size(); i++)
+ {
+ SdrObject* pObj = maTmpList[i];
+ rOL.InsertObjectToSdrObjList(*pObj, nInsPos);
+ nInsPos++;
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
+ if(pProgrInfo)
+ {
+ nActionsToReport++;
- for(sal_uInt32 i(0); i < maTmpList.size(); i++)
- {
- SdrObject* pObj = maTmpList[i];
- rOL.NbcInsertObject(pObj, nInsPos, &aReason);
- nInsPos++;
+ if(nActionsToReport >= 32) // Alle 32 Action updaten
+ {
+ pProgrInfo->ReportInserts(nActionsToReport);
+ nActionsToReport = 0;
+ }
+ }
+ }
+ // ein letztesmal alle verbliebennen Inserts reporten
if(pProgrInfo)
{
- nActionsToReport++;
-
- if(nActionsToReport >= 32) // Alle 32 Action updaten
- {
- pProgrInfo->ReportInserts(nActionsToReport);
- nActionsToReport = 0;
- }
+ pProgrInfo->ReportInserts(nActionsToReport);
}
- }
- // ein letztesmal alle verbliebennen Inserts reporten
- if(pProgrInfo)
- {
- pProgrInfo->ReportInserts(nActionsToReport);
}
-
return maTmpList.size();
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr)
{
mbNoLine = false;
@@ -404,7 +381,8 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr
if(bText && mbFntDirty)
{
Font aFnt(maVD.GetFont());
- const sal_uInt32 nHeight(FRound(aFnt.GetSize().Height() * mfScaleY));
+ const double fUnitInReal((maCurrent * basegfx::B2DVector(0.0, 1.0)).getLength());
+ const sal_uInt32 nHeight(FRound(aFnt.GetSize().Height() * fUnitInReal));
mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO ) );
mpTextAttr->Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CJK ) );
@@ -452,21 +430,10 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr
}
}
-void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale)
-{
- if(bScale && !maScaleRect.IsEmpty())
- {
- if(mbSize)
- {
- pObj->NbcResize(Point(), maScaleX, maScaleY);
- }
-
- if(mbMov)
- {
- pObj->NbcMove(Size(maOfs.X(), maOfs.Y()));
- }
- }
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj)
+{
if(isClip())
{
const basegfx::B2DPolyPolygon aPoly(pObj->TakeXorPoly());
@@ -481,7 +448,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale)
aBitmapEx = pSdrGrafObj->GetGraphic().GetBitmapEx();
}
- SdrObject::Free(pObj);
+ deleteSdrObjectSafeAndClearPointer(pObj);
if(!aOldRange.isEmpty())
{
@@ -497,7 +464,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale)
if(!aNewRange.isEmpty())
{
pObj = new SdrPathObj(
- aNewPoly.isClosed() ? OBJ_POLY : OBJ_PLIN,
+ mrModel,
aNewPoly);
pObj->SetLayer(aOldLayer);
@@ -570,7 +537,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale)
if(!bVisible)
{
- SdrObject::Free(pObj);
+ deleteSdrObjectSafeAndClearPointer(pObj);
}
else
{
@@ -592,30 +559,34 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale)
}
}
-/**************************************************************************************************/
+////////////////////////////////////////////////////////////////////////////////////////////////////
void ImpSdrGDIMetaFileImport::DoAction(MetaPixelAction& /*rAct*/)
{
+ OSL_ENSURE(false, "Tried to construct SdrObject from MetaPixelAction: not supported (!)");
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaPointAction& /*rAct*/)
{
+ OSL_ENSURE(false, "Tried to construct SdrObject from MetaPointAction: not supported (!)");
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction& rAct)
{
- // #i73407# reformulation to use new B2DPolygon classes
const basegfx::B2DPoint aStart(rAct.GetStartPoint().X(), rAct.GetStartPoint().Y());
const basegfx::B2DPoint aEnd(rAct.GetEndPoint().X(), rAct.GetEndPoint().Y());
if(!aStart.equal(aEnd))
{
basegfx::B2DPolygon aLine;
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
aLine.append(aStart);
aLine.append(aEnd);
- aLine.transform(aTransform);
+ aLine.transform(maCurrent);
const LineInfo& rLineInfo = rAct.GetLineInfo();
const sal_Int32 nNewLineWidth(rLineInfo.GetWidth());
@@ -628,7 +599,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction& rAct)
if(bCreateLineObject)
{
- SdrPathObj* pPath = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aLine));
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ basegfx::B2DPolyPolygon(aLine));
+
mnLineWidth = nNewLineWidth;
maLineJoin = rLineInfo.GetLineJoin();
maLineCap = rLineInfo.GetLineCap();
@@ -636,75 +610,164 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction& rAct)
rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
rLineInfo.GetDistance());
+
SetAttributes(pPath);
+
mnLineWidth = 0;
maLineJoin = basegfx::B2DLINEJOIN_NONE;
maDash = XDash();
- InsertObj(pPath, false);
+
+ InsertObj(pPath);
}
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaRectAction& rAct)
{
- SdrRectObj* pRect=new SdrRectObj(rAct.GetRect());
+ const Rectangle& rRect(rAct.GetRect());
+ SdrRectObj* pRect = new SdrRectObj(
+ mrModel,
+ maCurrent * basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRect.getWidth(), rRect.getHeight(),
+ rRect.Left(), rRect.Top()));
+
SetAttributes(pRect);
InsertObj(pRect);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction& rAct)
{
- SdrRectObj* pRect=new SdrRectObj(rAct.GetRect());
+ const Rectangle& rRect(rAct.GetRect());
+ SdrRectObj* pRect = new SdrRectObj(
+ mrModel,
+ maCurrent * basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRect.getWidth(), rRect.getHeight(),
+ rRect.Left(), rRect.Top()));
+
SetAttributes(pRect);
- long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2;
- if (nRad!=0) {
- SfxItemSet aSet(*mpLineAttr->GetPool(), SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS, 0, 0);
- aSet.Put(SdrEckenradiusItem(nRad));
- pRect->SetMergedItemSet(aSet);
+
+ const sal_uInt32 nRad((rAct.GetHorzRound() + rAct.GetVertRound()) / 2);
+
+ if(nRad)
+ {
+ pRect->SetMergedItem(SdrMetricItem(SDRATTR_ECKENRADIUS, nRad));
}
+
InsertObj(pRect);
}
-/**************************************************************************************************/
+////////////////////////////////////////////////////////////////////////////////////////////////////
void ImpSdrGDIMetaFileImport::DoAction(MetaEllipseAction& rAct)
{
- SdrCircObj* pCirc=new SdrCircObj(OBJ_CIRC,rAct.GetRect());
+ const Rectangle& rRect(rAct.GetRect());
+ SdrCircObj* pCirc = new SdrCircObj(
+ mrModel,
+ CircleType_Circle,
+ maCurrent * basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRect.getWidth(), rRect.getHeight(),
+ rRect.Left(), rRect.Top()));
+
SetAttributes(pCirc);
InsertObj(pCirc);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ void impPrepareAngles(const Point& rCenter, const Point& rStart, const Point& rEnd, double& o_Start, double& o_End)
+ {
+ o_Start = atan2((double)(rStart.Y() - rCenter.Y()), (double)(rStart.X() - rCenter.X()));
+
+ if(o_Start < 0.0)
+ {
+ o_Start += F_2PI;
+ }
+
+ o_End = atan2((double)(rEnd.Y() - rCenter.Y()), (double)(rEnd.X() - rCenter.X()));
+
+ if(o_End < 0.0)
+ {
+ o_End += F_2PI;
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaArcAction& rAct)
{
- Point aCenter(rAct.GetRect().Center());
- long nStart=GetAngle(rAct.GetStartPoint()-aCenter);
- long nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
- SdrCircObj* pCirc=new SdrCircObj(OBJ_CARC,rAct.GetRect(),nStart,nEnd);
+ double fStart(0.0);
+ double fEnd(F_2PI);
+ const Rectangle& rRect(rAct.GetRect());
+
+ impPrepareAngles(rRect.Center(), rAct.GetStartPoint(), rAct.GetEndPoint(), fStart, fEnd);
+
+ SdrCircObj* pCirc = new SdrCircObj(
+ mrModel,
+ CircleType_Circle,
+ maCurrent * basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRect.getWidth(), rRect.getHeight(),
+ rRect.Left(), rRect.Top()),
+ fStart,
+ fEnd);
+
SetAttributes(pCirc);
InsertObj(pCirc);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaPieAction& rAct)
{
- Point aCenter(rAct.GetRect().Center());
- long nStart=GetAngle(rAct.GetStartPoint()-aCenter);
- long nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
- SdrCircObj* pCirc=new SdrCircObj(OBJ_SECT,rAct.GetRect(),nStart,nEnd);
+ double fStart(0.0);
+ double fEnd(F_2PI);
+ const Rectangle& rRect(rAct.GetRect());
+
+ impPrepareAngles(rRect.Center(), rAct.GetStartPoint(), rAct.GetEndPoint(), fStart, fEnd);
+
+ SdrCircObj* pCirc = new SdrCircObj(
+ mrModel,
+ CircleType_Sector,
+ maCurrent * basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRect.getWidth(), rRect.getHeight(),
+ rRect.Left(), rRect.Top()),
+ fStart,
+ fEnd);
+
SetAttributes(pCirc);
InsertObj(pCirc);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction& rAct)
{
- Point aCenter(rAct.GetRect().Center());
- long nStart=GetAngle(rAct.GetStartPoint()-aCenter);
- long nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
- SdrCircObj* pCirc=new SdrCircObj(OBJ_CCUT,rAct.GetRect(),nStart,nEnd);
+ double fStart(0.0);
+ double fEnd(F_2PI);
+ const Rectangle& rRect(rAct.GetRect());
+
+ impPrepareAngles(rRect.Center(), rAct.GetStartPoint(), rAct.GetEndPoint(), fStart, fEnd);
+
+ SdrCircObj* pCirc = new SdrCircObj(
+ mrModel,
+ CircleType_Segment,
+ maCurrent * basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rRect.getWidth(), rRect.getHeight(),
+ rRect.Left(), rRect.Top()),
+ fStart,
+ fEnd);
+
SetAttributes(pCirc);
InsertObj(pCirc);
}
-/**************************************************************************************************/
+////////////////////////////////////////////////////////////////////////////////////////////////////
bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrcPoly)
{
@@ -714,7 +777,6 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
return false;
}
- // #i73407# reformulation to use new B2DPolygon classes
if(mbLastObjWasLine && (maOldLineColor == maVD.GetLineColor()) && rSrcPoly.count())
{
SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : 0;
@@ -722,10 +784,10 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
if(pLastPoly)
{
- if(1L == pLastPoly->GetPathPoly().count())
+ if(1 == pLastPoly->getB2DPolyPolygonInObjectCoordinates().count())
{
bool bOk(false);
- basegfx::B2DPolygon aDstPoly(pLastPoly->GetPathPoly().getB2DPolygon(0L));
+ basegfx::B2DPolygon aDstPoly(pLastPoly->getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(0));
// #i102706# Do not merge closed polygons
if(aDstPoly.isClosed())
@@ -767,7 +829,7 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
if(bOk)
{
- pLastPoly->NbcSetPathPoly(basegfx::B2DPolyPolygon(aDstPoly));
+ pLastPoly->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aDstPoly));
}
return bOk;
@@ -778,9 +840,10 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc
return false;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
bool ImpSdrGDIMetaFileImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPolyPolygon & rPolyPolygon)
{
- // #i73407# reformulation to use new B2DPolygon classes
if(mbLastObjWasPolyWithoutLine)
{
SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : 0;
@@ -788,9 +851,9 @@ bool ImpSdrGDIMetaFileImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPo
if(pLastPoly)
{
- if(pLastPoly->GetPathPoly() == rPolyPolygon)
+ if(pLastPoly->getB2DPolyPolygonInObjectCoordinates() == rPolyPolygon)
{
- SetAttributes(NULL);
+ SetAttributes(0);
if(!mbNoLine && mbNoFill)
{
@@ -805,6 +868,8 @@ bool ImpSdrGDIMetaFileImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPo
return false;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::checkClip()
{
if(maVD.IsClipRegion())
@@ -813,227 +878,288 @@ void ImpSdrGDIMetaFileImport::checkClip()
if(isClip())
{
- const basegfx::B2DHomMatrix aTransform(
- basegfx::tools::createScaleTranslateB2DHomMatrix(
- mfScaleX,
- mfScaleY,
- maOfs.X(),
- maOfs.Y()));
-
- maClip.transform(aTransform);
+ maClip.transform(maCurrent);
}
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
bool ImpSdrGDIMetaFileImport::isClip() const
{
return !maClip.getB2DRange().isEmpty();
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction& rAct )
{
- // #i73407# reformulation to use new B2DPolygon classes
basegfx::B2DPolygon aSource(rAct.GetPolygon().getB2DPolygon());
if(aSource.count())
{
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
- aSource.transform(aTransform);
- }
+ aSource.transform(maCurrent);
- const LineInfo& rLineInfo = rAct.GetLineInfo();
- const sal_Int32 nNewLineWidth(rLineInfo.GetWidth());
- bool bCreateLineObject(true);
+ const LineInfo& rLineInfo = rAct.GetLineInfo();
+ const sal_Int32 nNewLineWidth(rLineInfo.GetWidth());
+ bool bCreateLineObject(true);
- if(mbLastObjWasLine && (nNewLineWidth == mnLineWidth) && CheckLastLineMerge(aSource))
- {
- bCreateLineObject = false;
- }
- else if(mbLastObjWasPolyWithoutLine && CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource)))
- {
- bCreateLineObject = false;
- }
+ if(mbLastObjWasLine && (nNewLineWidth == mnLineWidth) && CheckLastLineMerge(aSource))
+ {
+ bCreateLineObject = false;
+ }
+ else if(mbLastObjWasPolyWithoutLine && CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource)))
+ {
+ bCreateLineObject = false;
+ }
- if(bCreateLineObject)
- {
- SdrPathObj* pPath = new SdrPathObj(
- aSource.isClosed() ? OBJ_POLY : OBJ_PLIN,
- basegfx::B2DPolyPolygon(aSource));
- mnLineWidth = nNewLineWidth;
- maLineJoin = rLineInfo.GetLineJoin();
- maLineCap = rLineInfo.GetLineCap();
- maDash = XDash(XDASH_RECT,
- rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
- rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
- rLineInfo.GetDistance());
- SetAttributes(pPath);
- mnLineWidth = 0;
- maLineJoin = basegfx::B2DLINEJOIN_NONE;
- maDash = XDash();
- InsertObj(pPath, false);
+ if(bCreateLineObject)
+ {
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ basegfx::B2DPolyPolygon(aSource));
+
+ mnLineWidth = nNewLineWidth;
+ maLineJoin = rLineInfo.GetLineJoin();
+ maLineCap = rLineInfo.GetLineCap();
+ maDash = XDash(XDASH_RECT,
+ rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
+ rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
+ rLineInfo.GetDistance());
+
+ SetAttributes(pPath);
+
+ mnLineWidth = 0;
+ maLineJoin = basegfx::B2DLINEJOIN_NONE;
+ maDash = XDash();
+
+ InsertObj(pPath);
+ }
}
}
-void ImpSdrGDIMetaFileImport::DoAction( MetaPolygonAction& rAct )
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void ImpSdrGDIMetaFileImport::DoAction(MetaPolygonAction& rAct)
{
- // #i73407# reformulation to use new B2DPolygon classes
basegfx::B2DPolygon aSource(rAct.GetPolygon().getB2DPolygon());
if(aSource.count())
{
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
- aSource.transform(aTransform);
+ aSource.transform(maCurrent);
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource)))
{
// #i73407# make sure polygon is closed, it's a filled primitive
aSource.setClosed(true);
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aSource));
+
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ basegfx::B2DPolyPolygon(aSource));
+
SetAttributes(pPath);
- InsertObj(pPath, false);
+ InsertObj(pPath);
}
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaPolyPolygonAction& rAct)
{
- // #i73407# reformulation to use new B2DPolygon classes
basegfx::B2DPolyPolygon aSource(rAct.GetPolyPolygon().getB2DPolyPolygon());
if(aSource.count())
{
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
- aSource.transform(aTransform);
+ aSource.transform(maCurrent);
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource))
{
// #i73407# make sure polygon is closed, it's a filled primitive
aSource.setClosed(true);
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
+
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ aSource);
+
SetAttributes(pPath);
- InsertObj(pPath, false);
+ InsertObj(pPath);
}
}
}
-/**************************************************************************************************/
+////////////////////////////////////////////////////////////////////////////////////////////////////
void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const XubString& rStr, const MetaAction& rAct )
{
- // calc text box size, add 5% to make it fit safely
-
- FontMetric aFontMetric( maVD.GetFontMetric() );
- Font aFnt( maVD.GetFont() );
- FontAlign eAlg( aFnt.GetAlign() );
+ // calc text box size
+ const FontMetric aFontMetric(maVD.GetFontMetric());
+ const Font aFnt(maVD.GetFont());
+ const FontAlign eAlg(aFnt.GetAlign());
+ basegfx::B2DVector aTextScale(maVD.GetTextWidth(rStr), maVD.GetTextHeight());
+ basegfx::B2DPoint aTextPos(rPos.X(), rPos.Y());
+ basegfx::B2DHomMatrix aTextMatrix;
+
+ if(ALIGN_BASELINE == eAlg)
+ {
+ aTextPos.setY(aTextPos.getY() - aFontMetric.GetAscent());
+ }
+ else if(ALIGN_BOTTOM == eAlg)
+ {
+ aTextPos.setY(aTextPos.getY() - aTextScale.getY());
+ }
- sal_Int32 nTextWidth = (sal_Int32)( maVD.GetTextWidth( rStr ) * mfScaleX );
- sal_Int32 nTextHeight = (sal_Int32)( maVD.GetTextHeight() * mfScaleY );
- //sal_Int32 nDxWidth = 0;
- //sal_Int32 nLen = rStr.Len();
+ aTextScale = maCurrent * aTextScale;
+ aTextPos = maCurrent * aTextPos;
- Point aPos( FRound(rPos.X() * mfScaleX + maOfs.X()), FRound(rPos.Y() * mfScaleY + maOfs.Y()) );
- Size aSize( nTextWidth, nTextHeight );
+ if(aFnt.GetOrientation())
+ {
+ aTextMatrix.rotate(F_PI180 * (aFnt.GetOrientation() * 0.10));
+ }
- if ( eAlg == ALIGN_BASELINE )
- aPos.Y() -= FRound(aFontMetric.GetAscent() * mfScaleY);
- else if ( eAlg == ALIGN_BOTTOM )
- aPos.Y() -= nTextHeight;
+ aTextMatrix.scale(aTextScale);
+ aTextMatrix.translate(aTextPos);
- Rectangle aTextRect( aPos, aSize );
- SdrRectObj* pText =new SdrRectObj( OBJ_TEXT, aTextRect );
+ SdrRectObj* pText = new SdrRectObj(
+ mrModel,
+ aTextMatrix,
+ OBJ_TEXT,
+ true);
if ( aFnt.GetWidth() || ( rAct.GetType() == META_STRETCHTEXT_ACTION ) )
{
pText->ClearMergedItem( SDRATTR_TEXT_AUTOGROWWIDTH );
- pText->SetMergedItem( SdrTextAutoGrowHeightItem( false ) );
+ pText->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false) );
// don't let the margins eat the space needed for the text
- pText->SetMergedItem ( SdrTextUpperDistItem (0));
- pText->SetMergedItem ( SdrTextLowerDistItem (0));
- pText->SetMergedItem ( SdrTextRightDistItem (0));
- pText->SetMergedItem ( SdrTextLeftDistItem (0));
+ pText->SetMergedItem ( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, 0));
+ pText->SetMergedItem ( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, 0));
+ pText->SetMergedItem ( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, 0));
+ pText->SetMergedItem ( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, 0));
pText->SetMergedItem( SdrTextFitToSizeTypeItem( SDRTEXTFIT_ALLLINES ) );
}
else
- pText->SetMergedItem( SdrTextAutoGrowWidthItem( true ) );
+ {
+ pText->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true ) );
+ }
- pText->SetModel(mpModel);
pText->SetLayer(mnLayer);
- pText->NbcSetText( rStr );
- SetAttributes( pText, true );
- pText->SetSnapRect( aTextRect );
+ pText->SetText(rStr);
+ SetAttributes(pText, true);
if (!aFnt.IsTransparent())
{
SfxItemSet aAttr(*mpFillAttr->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0);
+
aAttr.Put(XFillStyleItem(XFILL_SOLID));
aAttr.Put(XFillColorItem(String(), aFnt.GetFillColor()));
pText->SetMergedItemSet(aAttr);
}
- sal_uInt32 nWink = aFnt.GetOrientation();
- if ( nWink )
- {
- nWink*=10;
- double a=nWink*nPi180;
- double nSin=sin(a);
- double nCos=cos(a);
- pText->NbcRotate(aPos,nWink,nSin,nCos);
- }
- InsertObj( pText, false );
+
+ InsertObj(pText);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaTextAction& rAct)
{
XubString aStr(rAct.GetText());
aStr.Erase(0,rAct.GetIndex());
aStr.Erase(rAct.GetLen());
+
ImportText( rAct.GetPoint(), aStr, rAct );
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaTextArrayAction& rAct)
{
XubString aStr(rAct.GetText());
aStr.Erase(0,rAct.GetIndex());
aStr.Erase(rAct.GetLen());
+
ImportText( rAct.GetPoint(), aStr, rAct );
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaStretchTextAction& rAct)
{
XubString aStr(rAct.GetText());
aStr.Erase(0,rAct.GetIndex());
aStr.Erase(rAct.GetLen());
+
ImportText( rAct.GetPoint(), aStr, rAct );
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpAction& rAct)
{
- Rectangle aRect(rAct.GetPoint(),rAct.GetBitmap().GetSizePixel());
- aRect.Right()++; aRect.Bottom()++;
- SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect);
+ const Rectangle aRect(rAct.GetPoint(), rAct.GetBitmap().GetSizePixel());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
+
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ Graphic(rAct.GetBitmap()),
+ maCurrent * aGrafMatrix);
+
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScaleAction& rAct)
{
- Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
- aRect.Right()++; aRect.Bottom()++;
- SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect);
+ const Rectangle aRect(rAct.GetPoint(), rAct.GetSize());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
+
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ Graphic(rAct.GetBitmap()),
+ maCurrent * aGrafMatrix);
+
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExAction& rAct)
{
- Rectangle aRect(rAct.GetPoint(),rAct.GetBitmapEx().GetSizePixel());
- aRect.Right()++; aRect.Bottom()++;
- SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect );
+ const Rectangle aRect(rAct.GetPoint(), rAct.GetBitmapEx().GetSizePixel());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
+
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ rAct.GetBitmapEx(),
+ maCurrent * aGrafMatrix);
+
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScaleAction& rAct)
{
- Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
- aRect.Right()++; aRect.Bottom()++;
- SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect );
+ const Rectangle aRect(rAct.GetPoint(), rAct.GetSize());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
+
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ rAct.GetBitmapEx(),
+ maCurrent * aGrafMatrix);
+
InsertObj(pGraf);
}
@@ -1041,19 +1167,21 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScaleAction& rAct)
void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct )
{
- // #i73407# reformulation to use new B2DPolygon classes
basegfx::B2DPolyPolygon aSource(rAct.GetPolyPolygon().getB2DPolyPolygon());
if(aSource.count())
{
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
- aSource.transform(aTransform);
+ aSource.transform(maCurrent);
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource))
{
const Hatch& rHatch = rAct.GetHatch();
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
- SfxItemSet aHatchAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLHATCH, XATTR_FILLHATCH, 0, 0);
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ aSource);
+ SfxItemSet aHatchAttr(pPath->GetObjectItemPool(),
+ XATTR_FILLSTYLE, XATTR_FILLSTYLE,
+ XATTR_FILLHATCH, XATTR_FILLHATCH, 0, 0 );
XHatchStyle eStyle;
switch(rHatch.GetStyle())
@@ -1079,48 +1207,26 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct )
SetAttributes(pPath);
aHatchAttr.Put(XFillStyleItem(XFILL_HATCH));
- aHatchAttr.Put(XFillHatchItem(&mpModel->GetItemPool(), XHatch(rHatch.GetColor(), eStyle, rHatch.GetDistance(), rHatch.GetAngle())));
+ aHatchAttr.Put(XFillHatchItem(&pPath->GetObjectItemPool(), XHatch(rHatch.GetColor(), eStyle, rHatch.GetDistance(), rHatch.GetAngle())));
pPath->SetMergedItemSet(aHatchAttr);
- InsertObj(pPath, false);
+ InsertObj(pPath);
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void ImpSdrGDIMetaFileImport::DoAction(MetaLineColorAction& rAct)
-{
- rAct.Execute(&maVD);
-}
-
void ImpSdrGDIMetaFileImport::DoAction(MetaMapModeAction& rAct)
{
- MapScaling();
rAct.Execute(&maVD);
- mbLastObjWasPolyWithoutLine = false;
- mbLastObjWasLine = false;
-}
-void ImpSdrGDIMetaFileImport::MapScaling()
-{
- const sal_uInt32 nAnz(maTmpList.size());
- sal_uInt32 i(0);
- const MapMode& rMap = maVD.GetMapMode();
- Point aMapOrg( rMap.GetOrigin() );
- bool bMov2(aMapOrg.X() != 0 || aMapOrg.Y() != 0);
-
- if(bMov2)
- {
- for(i = mnMapScalingOfs; i < nAnz; i++)
- {
- SdrObject* pObj = maTmpList[i];
-
- pObj->NbcMove(Size(aMapOrg.X(), aMapOrg.Y()));
- }
- }
+ // create new transformation since this action may set a relative mapping action.
+ // thus, first apply new mapping, then from metafuile to unit, and then object transformation
+ maCurrent = maObjectTransform * maMetaToUnit * maVD.GetViewTransformation();
- mnMapScalingOfs = nAnz;
+ mbLastObjWasPolyWithoutLine = false;
+ mbLastObjWasLine = false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1135,16 +1241,21 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM
if( pAct && pAct->GetType() == META_GRADIENTEX_ACTION )
{
- // #i73407# reformulation to use new B2DPolygon classes
basegfx::B2DPolyPolygon aSource(pAct->GetPolyPolygon().getB2DPolyPolygon());
if(aSource.count())
{
+ aSource.transform(maCurrent); // TTTT: needed? was missing before
+
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource))
{
const Gradient& rGrad = pAct->GetGradient();
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
- SfxItemSet aGradAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ aSource);
+ SfxItemSet aGradAttr(pPath->GetObjectItemPool(),
+ XATTR_FILLSTYLE, XATTR_FILLSTYLE,
+ XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0 );
XGradient aXGradient;
aXGradient.SetGradientStyle((XGradientStyle)rGrad.GetStyle());
@@ -1173,7 +1284,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM
}
aGradAttr.Put(XFillStyleItem(XFILL_GRADIENT));
- aGradAttr.Put(XFillGradientItem(&mpModel->GetItemPool(), aXGradient));
+ aGradAttr.Put(XFillGradientItem(&pPath->GetObjectItemPool(), aXGradient));
pPath->SetMergedItemSet(aGradAttr);
InsertObj(pPath);
@@ -1203,78 +1314,114 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaTextRectAction& rAct)
{
GDIMetaFile aTemp;
+ // dismantle MetaTextRectActions to own metafile and execute
maVD.AddTextRectActions(rAct.GetRect(), rAct.GetText(), rAct.GetStyle(), aTemp);
DoLoopActions(aTemp, 0, 0);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction& rAct)
{
- Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
+ const Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
Bitmap aBitmap(rAct.GetBitmap());
- aRect.Right()++;
- aRect.Bottom()++;
aBitmap.Crop(Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmap, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ aBitmap,
+ maCurrent * aGrafMatrix);
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScalePartAction& rAct)
{
- Rectangle aRect(rAct.GetDestPoint(),rAct.GetDestSize());
+ const Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
BitmapEx aBitmapEx(rAct.GetBitmapEx());
- aRect.Right()++;
- aRect.Bottom()++;
aBitmapEx.Crop(Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ aBitmapEx,
+ maCurrent * aGrafMatrix);
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaMaskAction& rAct)
{
- Rectangle aRect(rAct.GetPoint(), rAct.GetBitmap().GetSizePixel());
- BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
-
- aRect.Right()++;
- aRect.Bottom()++;
-
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ const Rectangle aRect(rAct.GetPoint(), rAct.GetBitmap().GetSizePixel());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
+ const BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
+
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ aBitmapEx,
+ maCurrent * aGrafMatrix);
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaMaskScaleAction& rAct)
{
- Rectangle aRect(rAct.GetPoint(), rAct.GetSize());
- BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
-
- aRect.Right()++;
- aRect.Bottom()++;
-
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ const Rectangle aRect(rAct.GetPoint(), rAct.GetSize());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
+ const BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
+
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ aBitmapEx,
+ maCurrent * aGrafMatrix);
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaMaskScalePartAction& rAct)
{
- Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
+ const Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
+ const basegfx::B2DHomMatrix aGrafMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRect.getWidth() + 1, aRect.getHeight() + 1,
+ aRect.Left(), aRect.Top()));
BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
- aRect.Right()++;
- aRect.Bottom()++;
aBitmapEx.Crop(Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ aBitmapEx,
+ maCurrent * aGrafMatrix);
InsertObj(pGraf);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
XGradientStyle getXGradientStyleFromGradientStyle(const GradientStyle& rGradientStyle)
{
XGradientStyle aXGradientStyle(XGRAD_LINEAR);
@@ -1298,25 +1445,31 @@ XGradientStyle getXGradientStyleFromGradientStyle(const GradientStyle& rGradient
return aXGradientStyle;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaGradientAction& rAct)
{
- basegfx::B2DRange aRange(rAct.GetRect().Left(), rAct.GetRect().Top(), rAct.GetRect().Right(), rAct.GetRect().Bottom());
+ basegfx::B2DRange aRange(
+ rAct.GetRect().Left(),
+ rAct.GetRect().Top(),
+ rAct.GetRect().Right() + 1,
+ rAct.GetRect().Bottom() + 1);
if(!aRange.isEmpty())
{
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
- aRange.transform(aTransform);
- const Gradient& rGradient = rAct.GetGradient();
+ basegfx::B2DHomMatrix aObjectTransform(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRange.getRange(),
+ aRange.getMinimum()));
SdrRectObj* pRect = new SdrRectObj(
- Rectangle(
- floor(aRange.getMinX()),
- floor(aRange.getMinY()),
- ceil(aRange.getMaxX()),
- ceil(aRange.getMaxY())));
- SfxItemSet aGradientAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
+ mrModel,
+ maCurrent * aObjectTransform);
+
+ SfxItemSet aGradientAttr(mrModel.GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
+ const Gradient& rGradient = rAct.GetGradient();
const XGradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
const XFillGradientItem aXFillGradientItem(
- &mpModel->GetItemPool(),
+ &mrModel.GetItemPool(),
XGradient(
rGradient.GetStartColor(),
rGradient.GetEndColor(),
@@ -1334,59 +1487,72 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientAction& rAct)
aGradientAttr.Put(aXFillGradientItem);
pRect->SetMergedItemSet(aGradientAttr);
- InsertObj(pRect, false);
+ InsertObj(pRect);
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaWallpaperAction& /*rAct*/)
{
OSL_ENSURE(false, "Tried to construct SdrObject from MetaWallpaperAction: not supported (!)");
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaTransparentAction& rAct)
{
basegfx::B2DPolyPolygon aSource(rAct.GetPolyPolygon().getB2DPolyPolygon());
if(aSource.count())
{
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
- aSource.transform(aTransform);
+ aSource.transform(maCurrent);
aSource.setClosed(true);
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ aSource);
+
SetAttributes(pPath);
pPath->SetMergedItem(XFillTransparenceItem(rAct.GetTransparence()));
- InsertObj(pPath, false);
+ InsertObj(pPath);
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaEPSAction& /*rAct*/)
{
OSL_ENSURE(false, "Tried to construct SdrObject from MetaEPSAction: not supported (!)");
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaTextLineAction& /*rAct*/)
{
OSL_ENSURE(false, "Tried to construct SdrObject from MetaTextLineAction: not supported (!)");
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
void ImpSdrGDIMetaFileImport::DoAction(MetaGradientExAction& rAct)
{
basegfx::B2DPolyPolygon aSource(rAct.GetPolyPolygon().getB2DPolyPolygon());
if(aSource.count())
{
- const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
- aSource.transform(aTransform);
+ aSource.transform(maCurrent);
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource))
{
+ SdrPathObj* pPath = new SdrPathObj(
+ mrModel,
+ aSource);
+ SfxItemSet aGradientAttr(mrModel.GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
const Gradient& rGradient = rAct.GetGradient();
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
- SfxItemSet aGradientAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
const XGradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
const XFillGradientItem aXFillGradientItem(
- &mpModel->GetItemPool(),
+ &mrModel.GetItemPool(),
XGradient(
rGradient.GetStartColor(),
rGradient.GetEndColor(),
@@ -1404,7 +1570,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientExAction& rAct)
aGradientAttr.Put(aXFillGradientItem);
pPath->SetMergedItemSet(aGradientAttr);
- InsertObj(pPath, false);
+ InsertObj(pPath);
}
}
}
@@ -1415,15 +1581,17 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
if(rMtf.GetActionCount())
{
- const Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
+ const Rectangle aRect(rAct.GetPoint(), rAct.GetSize());
+ basegfx::B2DRange aRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
+
+ // go to object target coordinates to get a good relative size
+ aRange.transform(maCurrent);
// convert metafile sub-content to BitmapEx
BitmapEx aBitmapEx(
convertMetafileToBitmapEx(
rMtf,
- basegfx::B2DRange(
- aRect.Left(), aRect.Top(),
- aRect.Right(), aRect.Bottom()),
+ aRange,
125000));
// handle colors
@@ -1583,7 +1751,12 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
}
// create and add object
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ mrModel,
+ aBitmapEx,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRange.getRange(),
+ aRange.getMinimum()));
InsertObj(pGraf);
}
diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx
index c0431ce294f5..2999b3c26b1a 100644
--- a/svx/source/svdraw/svdfmtf.hxx
+++ b/svx/source/svdraw/svdfmtf.hxx
@@ -48,12 +48,13 @@ class ImpSdrGDIMetaFileImport
protected:
::std::vector< SdrObject* > maTmpList;
VirtualDevice maVD;
- Rectangle maScaleRect;
- sal_uLong mnMapScalingOfs; // ab hier nocht nicht mit MapScaling bearbeitet
+ const basegfx::B2DHomMatrix maObjectTransform; // transform from the original object
+ basegfx::B2DHomMatrix maMetaToUnit; // transform from meta coordinates to unit coodinates
+ basegfx::B2DHomMatrix maCurrent; // current transform from meta to new object
SfxItemSet* mpLineAttr;
SfxItemSet* mpFillAttr;
SfxItemSet* mpTextAttr;
- SdrModel* mpModel;
+ SdrModel& mrModel;
SdrLayerID mnLayer;
Color maOldLineColor;
sal_Int32 mnLineWidth;
@@ -61,26 +62,19 @@ protected:
com::sun::star::drawing::LineCap maLineCap;
XDash maDash;
- bool mbMov;
- bool mbSize;
- Point maOfs;
- double mfScaleX;
- double mfScaleY;
- Fraction maScaleX;
- Fraction maScaleY;
+ // clipregion
+ basegfx::B2DPolyPolygon maClip;
- bool mbFntDirty;
+ /// bitfield
+ bool mbFntDirty : 1;
// fuer Optimierung von (PenNULL,Brush,DrawPoly),(Pen,BrushNULL,DrawPoly) -> aus 2 mach ein
- bool mbLastObjWasPolyWithoutLine;
- bool mbNoLine;
- bool mbNoFill;
+ bool mbLastObjWasPolyWithoutLine : 1;
+ bool mbNoLine : 1;
+ bool mbNoFill : 1;
// fuer Optimierung mehrerer Linien zu einer Polyline
- bool mbLastObjWasLine;
-
- // clipregion
- basegfx::B2DPolyPolygon maClip;
+ bool mbLastObjWasLine : 1;
protected:
// ckeck for clip and evtl. fill maClip
@@ -108,7 +102,7 @@ protected:
void DoAction(MetaBmpExAction & rAct);
void DoAction(MetaBmpExScaleAction & rAct);
void DoAction(MetaHatchAction & rAct);
- void DoAction(MetaLineColorAction & rAct);
+ void DoAction(MetaLineColorAction & rAct) { rAct.Execute(&maVD); }
void DoAction(MetaMapModeAction & rAct);
void DoAction(MetaFillColorAction & rAct) { rAct.Execute(&maVD); }
void DoAction(MetaTextColorAction & rAct) { rAct.Execute(&maVD); }
@@ -146,8 +140,7 @@ protected:
void ImportText(const Point& rPos, const XubString& rStr, const MetaAction& rAct);
void SetAttributes(SdrObject* pObj, bool bForceTextAttr = false);
- void InsertObj(SdrObject* pObj, bool bScale = true);
- void MapScaling();
+ void InsertObj(SdrObject* pObj);
// #i73407# reformulation to use new B2DPolygon classes
bool CheckLastLineMerge(const basegfx::B2DPolygon& rSrcPoly);
@@ -159,7 +152,7 @@ public:
ImpSdrGDIMetaFileImport(
SdrModel& rModel,
SdrLayerID nLay,
- const Rectangle& rRect);
+ const basegfx::B2DHomMatrix& rObjectTransform);
~ImpSdrGDIMetaFileImport();
sal_uInt32 DoImport(
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx
index 2605cff979bd..832102fc277d 100644
--- a/svx/source/svdraw/svdglev.cxx
+++ b/svx/source/svdraw/svdglev.cxx
@@ -26,7 +26,6 @@
#include <svx/svdglev.hxx>
#include <math.h>
-
#include <svx/svdundo.hxx>
#include "svx/svdstr.hrc" // Namen aus der Resource
#include "svx/svdglob.hxx" // StringCache
@@ -34,65 +33,81 @@
#include <svx/svdglue.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdobj.hxx>
+#include <svx/svdlegacy.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrGlueEditView::ImpClearVars()
+SdrGlueEditView::SdrGlueEditView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrPolyEditView(rModel1, pOut)
{
}
-SdrGlueEditView::SdrGlueEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrPolyEditView(pModel1,pOut)
-{
- ImpClearVars();
-}
-
SdrGlueEditView::~SdrGlueEditView()
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, sal_Bool bConst, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5)
+void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5)
{
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->GetCount();
- if (nPtAnz!=0) {
- SdrGluePointList* pGPL=NULL;
- if (bConst) {
- const SdrGluePointList* pConstGPL=pObj->GetGluePointList();
- pGPL=(SdrGluePointList*)pConstGPL;
- } else {
- pGPL=pObj->ForceGluePointList();
- }
- if (pGPL!=NULL)
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pObj = aSelection[nm];
+ const sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*pObj));
+
+ if(aMarkedGluePoints.size())
{
- if(!bConst && IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ SdrGluePointList* pGPL = 0;
- for (sal_uIntPtr nPtNum=0; nPtNum<nPtAnz; nPtNum++)
+ if(bConst)
{
- sal_uInt16 nPtId=pPts->GetObject(nPtNum);
- sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
- if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
- {
- SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
- (*pDoFunc)(rGP,pObj,p1,p2,p3,p4,p5);
- }
+ pGPL = const_cast< SdrGluePointList* >(pObj->GetGluePointList());
}
- if (!bConst)
+ else
{
- pObj->SetChanged();
- pObj->BroadcastObjectChange();
+ pGPL=pObj->ForceGluePointList();
+ }
+
+ if(pGPL)
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
+
+ if(!bConst && IsUndoEnabled() )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ }
+
+ for(sdr::selection::Indices::const_iterator aCurrent(aMarkedGluePoints.begin());
+ aCurrent != aMarkedGluePoints.end(); aCurrent++)
+ {
+ const sal_uInt32 nPtId(*aCurrent);
+ const sal_uInt32 nGlueIdx(pGPL->FindGluePoint(nPtId));
+
+ if(SDRGLUEPOINT_NOTFOUND != nGlueIdx)
+ {
+ SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
+
+ (*pDoFunc)(rGP,pObj,p1,p2,p3,p4,p5);
+ }
+ }
+
+ if (!bConst)
+ {
+ pObj->SetChanged();
+ }
}
}
}
+
+ if(!bConst && aSelection.size())
+ {
+ getSdrModelFromSdrView().SetChanged();
+ }
}
- if (!bConst && nMarkAnz!=0) pMod->SetChanged();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -100,37 +115,53 @@ void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, sal_Bool bConst
static void ImpGetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnThisEsc, const void* pnRet, const void*, const void*)
{
sal_uInt16& nRet=*(sal_uInt16*)pnRet;
- sal_Bool& bFirst=*(sal_Bool*)pbFirst;
- if (nRet!=FUZZY) {
- sal_uInt16 nEsc=rGP.GetEscDir();
- sal_Bool bOn=(nEsc & *(sal_uInt16*)pnThisEsc)!=0;
- if (bFirst) { nRet=bOn; bFirst=sal_False; }
- else if (nRet!=bOn) nRet=FUZZY;
+ bool& bFirst = *(bool*)pbFirst;
+
+ if(FUZZY != nRet)
+ {
+ const sal_uInt16 nEsc(rGP.GetEscDir());
+ bool bOn(nEsc & *(sal_uInt16*)pnThisEsc);
+
+ if(bFirst)
+ {
+ nRet = bOn ? 1 : 0;
+ bFirst = false;
+ }
+ else if((0 == nRet && bOn) || (1 == nRet && !bOn))
+ {
+ nRet = FUZZY;
+ }
}
}
TRISTATE SdrGlueEditView::IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const
{
- ForceUndirtyMrkPnt();
- sal_Bool bFirst=sal_True;
- sal_uInt16 nRet=sal_False;
- ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetEscDir,sal_True,&bFirst,&nThisEsc,&nRet);
+ bool bFirst(true);
+ sal_uInt16 nRet(false);
+ const_cast< SdrGlueEditView* >(this)->ImpDoMarkedGluePoints(ImpGetEscDir, true, &bFirst, &nThisEsc, &nRet);
return (TRISTATE)nRet;
}
static void ImpSetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pnThisEsc, const void* pbOn, const void*, const void*, const void*)
{
sal_uInt16 nEsc=rGP.GetEscDir();
- if (*(sal_Bool*)pbOn) nEsc|=*(sal_uInt16*)pnThisEsc;
- else nEsc&=~*(sal_uInt16*)pnThisEsc;
+
+ if(*(bool*)pbOn)
+ {
+ nEsc |= *(sal_uInt16*)pnThisEsc;
+ }
+ else
+ {
+ nEsc &= ~*(sal_uInt16*)pnThisEsc;
+ }
+
rGP.SetEscDir(nEsc);
}
-void SdrGlueEditView::SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, sal_Bool bOn)
+void SdrGlueEditView::SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, bool bOn)
{
- ForceUndirtyMrkPnt();
- BegUndo(ImpGetResStr(STR_EditSetGlueEscDir),GetDescriptionOfMarkedGluePoints());
- ImpDoMarkedGluePoints(ImpSetEscDir,sal_False,&nThisEsc,&bOn);
+ BegUndo(ImpGetResStr(STR_EditSetGlueEscDir), getSelectedGluesDescription());
+ ImpDoMarkedGluePoints(ImpSetEscDir, false, &nThisEsc, &bOn);
EndUndo();
}
@@ -139,35 +170,45 @@ void SdrGlueEditView::SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, sal_Bool bO
static void ImpGetPercent(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnRet, const void*, const void*, const void*)
{
sal_uInt16& nRet=*(sal_uInt16*)pnRet;
- sal_Bool& bFirst=*(sal_Bool*)pbFirst;
- if (nRet!=FUZZY) {
- bool bOn=rGP.IsPercent();
- if (bFirst) { nRet=bOn; bFirst=sal_False; }
- else if ((nRet!=0)!=bOn) nRet=FUZZY;
+ bool& bFirst = *(bool*)pbFirst;
+
+ if(FUZZY != nRet)
+ {
+ bool bOn(rGP.IsPercent());
+
+ if(bFirst)
+ {
+ nRet = bOn ? 1 : 0;
+ bFirst = false;
+ }
+ else if((0 == nRet && bOn) || (1 == nRet && !bOn))
+ {
+ nRet = FUZZY;
+ }
}
}
TRISTATE SdrGlueEditView::IsMarkedGluePointsPercent() const
{
- ForceUndirtyMrkPnt();
- sal_Bool bFirst=sal_True;
- sal_uInt16 nRet=sal_True;
- ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetPercent,sal_True,&bFirst,&nRet);
+ bool bFirst(true);
+ sal_uInt16 nRet(true);
+ ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetPercent, true, &bFirst, &nRet);
return (TRISTATE)nRet;
}
static void ImpSetPercent(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbOn, const void*, const void*, const void*, const void*)
{
- Point aPos(rGP.GetAbsolutePos(*pObj));
- rGP.SetPercent(*(sal_Bool*)pbOn);
- rGP.SetAbsolutePos(aPos,*pObj);
+ const basegfx::B2DRange aObjectRange(sdr::legacy::GetSnapRange(*pObj));
+ const basegfx::B2DPoint aPos(rGP.GetAbsolutePos(aObjectRange));
+
+ rGP.SetPercent(*(bool*)pbOn);
+ rGP.SetAbsolutePos(aPos, aObjectRange);
}
-void SdrGlueEditView::SetMarkedGluePointsPercent(sal_Bool bOn)
+void SdrGlueEditView::SetMarkedGluePointsPercent(bool bOn)
{
- ForceUndirtyMrkPnt();
- BegUndo(ImpGetResStr(STR_EditSetGluePercent),GetDescriptionOfMarkedGluePoints());
- ImpDoMarkedGluePoints(ImpSetPercent,sal_False,&bOn);
+ BegUndo(ImpGetResStr(STR_EditSetGluePercent), getSelectedGluesDescription());
+ ImpDoMarkedGluePoints(ImpSetPercent, false, &bOn);
EndUndo();
}
@@ -176,243 +217,361 @@ void SdrGlueEditView::SetMarkedGluePointsPercent(sal_Bool bOn)
static void ImpGetAlign(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pbDontCare, const void* pbVert, const void* pnRet, const void*)
{
sal_uInt16& nRet=*(sal_uInt16*)pnRet;
- sal_Bool& bFirst=*(sal_Bool*)pbFirst;
- sal_Bool& bDontCare=*(sal_Bool*)pbDontCare;
- sal_Bool bVert=*(sal_Bool*)pbVert;
- if (!bDontCare) {
- sal_uInt16 nAlg=0;
- if (bVert) {
+ bool& bFirst = *(bool*)pbFirst;
+ bool& bDontCare = *(bool*)pbDontCare;
+ bool bVert = *(bool*)pbVert;
+
+ if(!bDontCare)
+ {
+ sal_uInt16 nAlg(0);
+
+ if(bVert)
+ {
nAlg=rGP.GetVertAlign();
- } else {
+ }
+ else
+ {
nAlg=rGP.GetHorzAlign();
}
- if (bFirst) { nRet=nAlg; bFirst=sal_False; }
- else if (nRet!=nAlg) {
- if (bVert) {
+
+ if(bFirst)
+ {
+ nRet = nAlg;
+ bFirst = false;
+ }
+ else if(nRet != nAlg)
+ {
+ if(bVert)
+ {
nRet=SDRVERTALIGN_DONTCARE;
- } else {
+ }
+ else
+ {
nRet=SDRHORZALIGN_DONTCARE;
}
- bDontCare=sal_True;
+
+ bDontCare = true;
}
}
}
-sal_uInt16 SdrGlueEditView::GetMarkedGluePointsAlign(sal_Bool bVert) const
+sal_uInt16 SdrGlueEditView::GetMarkedGluePointsAlign(bool bVert) const
{
- ForceUndirtyMrkPnt();
- sal_Bool bFirst=sal_True;
- sal_Bool bDontCare=sal_False;
- sal_uInt16 nRet=0;
- ((SdrGlueEditView*)this)->ImpDoMarkedGluePoints(ImpGetAlign,sal_True,&bFirst,&bDontCare,&bVert,&nRet);
+ bool bFirst(true);
+ bool bDontCare(false);
+ sal_uInt16 nRet(0);
+ const_cast< SdrGlueEditView* >(this)->ImpDoMarkedGluePoints(ImpGetAlign, true, &bFirst, &bDontCare, &bVert, &nRet);
return nRet;
}
static void ImpSetAlign(SdrGluePoint& rGP, const SdrObject* pObj, const void* pbVert, const void* pnAlign, const void*, const void*, const void*)
{
- Point aPos(rGP.GetAbsolutePos(*pObj));
- if (*(sal_Bool*)pbVert) { // bVert?
+ const basegfx::B2DRange aObjectRange(sdr::legacy::GetSnapRange(*pObj));
+ const basegfx::B2DPoint aPos(rGP.GetAbsolutePos(aObjectRange));
+
+ if(*(bool*)pbVert)
+ {
+ // bVert?
rGP.SetVertAlign(*(sal_uInt16*)pnAlign);
- } else {
+ }
+ else
+ {
rGP.SetHorzAlign(*(sal_uInt16*)pnAlign);
}
- rGP.SetAbsolutePos(aPos,*pObj);
+
+ rGP.SetAbsolutePos(aPos, aObjectRange);
}
-void SdrGlueEditView::SetMarkedGluePointsAlign(sal_Bool bVert, sal_uInt16 nAlign)
+void SdrGlueEditView::SetMarkedGluePointsAlign(bool bVert, sal_uInt16 nAlign)
{
- ForceUndirtyMrkPnt();
- BegUndo(ImpGetResStr(STR_EditSetGlueAlign),GetDescriptionOfMarkedGluePoints());
- ImpDoMarkedGluePoints(ImpSetAlign,sal_False,&bVert,&nAlign);
+ BegUndo(ImpGetResStr(STR_EditSetGlueAlign), getSelectedGluesDescription());
+ ImpDoMarkedGluePoints(ImpSetAlign, false, &bVert, &nAlign);
EndUndo();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrGlueEditView::IsDeleteMarkedGluePointsPossible() const
-{
- return HasMarkedGluePoints();
-}
-
void SdrGlueEditView::DeleteMarkedGluePoints()
{
BrkAction();
- ForceUndirtyMrkPnt();
- const bool bUndo = IsUndoEnabled();
- if( bUndo )
- BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_DELETE);
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
+ if(areSdrObjectsSelected())
{
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->GetCount();
- if (nPtAnz!=0)
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const bool bUndo(IsUndoEnabled());
+
+ if( bUndo )
{
- SdrGluePointList* pGPL=pObj->ForceGluePointList();
- if (pGPL!=NULL)
+ BegUndo(ImpGetResStr(STR_EditDelete), getSelectedGluesDescription(), SDRREPFUNC_OBJ_DELETE);
+ }
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pObj = aSelection[nm];
+ const sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*pObj));
+
+ if(!aMarkedGluePoints.empty())
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ SdrGluePointList* pGPL=pObj->ForceGluePointList();
- for (sal_uIntPtr nPtNum=0; nPtNum<nPtAnz; nPtNum++)
+ if(pGPL)
{
- sal_uInt16 nPtId=pPts->GetObject(nPtNum);
- sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
- if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
+
+ if( bUndo )
{
- pGPL->Delete(nGlueIdx);
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ }
+
+ for(sdr::selection::Indices::const_iterator aCurrent(aMarkedGluePoints.begin());
+ aCurrent != aMarkedGluePoints.end(); aCurrent++)
+ {
+ const sal_uInt32 nPtId(*aCurrent);
+ const sal_uInt32 nGlueIdx(pGPL->FindGluePoint(nPtId));
+
+ if(SDRGLUEPOINT_NOTFOUND != nGlueIdx)
+ {
+ pGPL->Delete(nGlueIdx);
+ }
}
+
+ pObj->SetChanged();
}
- pObj->SetChanged();
- pObj->BroadcastObjectChange();
}
}
+
+ if( bUndo )
+ {
+ EndUndo();
+ }
+
+ MarkGluePoints(0, true);
+
+ if(aSelection.size())
+ {
+ getSdrModelFromSdrView().SetChanged();
+ }
}
- if( bUndo )
- EndUndo();
- UnmarkAllGluePoints();
- if (nMarkAnz!=0)
- pMod->SetChanged();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrGlueEditView::ImpCopyMarkedGluePoints()
{
- const bool bUndo = IsUndoEnabled();
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const bool bUndo(IsUndoEnabled());
- if( bUndo )
- BegUndo();
+ if( bUndo )
+ {
+ BegUndo();
+ }
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- SdrGluePointList* pGPL=pObj->ForceGluePointList();
- sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->GetCount();
- if (nPtAnz!=0 && pGPL!=NULL)
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ SdrObject* pObj = aSelection[nm];
+ sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*pObj));
+ bool bMarkedGluePointsChanged(false);
+ SdrGluePointList* pGPL=pObj->ForceGluePointList();
- for (sal_uIntPtr nPtNum=0; nPtNum<nPtAnz; nPtNum++)
+ if(!aMarkedGluePoints.empty() && pGPL)
{
- sal_uInt16 nPtId=pPts->GetObject(nPtNum);
- sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
- if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND)
+ if( bUndo )
{
- SdrGluePoint aNewGP((*pGPL)[nGlueIdx]); // GluePoint klonen
- sal_uInt16 nNewIdx=pGPL->Insert(aNewGP); // und einfuegen
- sal_uInt16 nNewId=(*pGPL)[nNewIdx].GetId(); // Id des neuen GluePoints ermitteln
- pPts->Replace(nNewId,nPtNum); // und diesen markieren (anstelle des alten)
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ }
+
+ for(sdr::selection::Indices::iterator aCurrent(aMarkedGluePoints.begin());
+ aCurrent != aMarkedGluePoints.end(); aCurrent++)
+ {
+ const sal_uInt32 nPtId(*aCurrent);
+ const sal_uInt32 nGlueIdx(pGPL->FindGluePoint(nPtId));
+
+ if(SDRGLUEPOINT_NOTFOUND != nGlueIdx)
+ {
+ SdrGluePoint aNewGP((*pGPL)[nGlueIdx]);
+ const sal_uInt32 nNewIdx(pGPL->Insert(aNewGP));
+ const sal_uInt32 nNewId((*pGPL)[nNewIdx].GetId());
+
+ sdr::selection::Indices::iterator aNext(aCurrent);
+ aNext++;
+ aMarkedGluePoints.erase(aCurrent);
+ aMarkedGluePoints.insert(nNewId);
+ bMarkedGluePointsChanged = true;
+ aCurrent = aNext;
+ }
}
}
+
+ if(bMarkedGluePointsChanged)
+ {
+ setSelectedGluesForSelectedSdrObject(*pObj, aMarkedGluePoints);
+ }
}
- }
- if( bUndo )
- EndUndo();
- if (nMarkAnz!=0)
- pMod->SetChanged();
+ if( bUndo )
+ {
+ EndUndo();
+ }
+
+ if(aSelection.size())
+ {
+ getSdrModelFromSdrView().SetChanged();
+ }
+ }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrGlueEditView::ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5)
{
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->GetCount();
- if (nPtAnz!=0) {
- SdrGluePointList* pGPL=pObj->ForceGluePointList();
- if (pGPL!=NULL)
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ SdrObject* pObj = aSelection[nm];
+ const sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*pObj));
+
+ if(!aMarkedGluePoints.empty())
{
- if( IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
-
- for (sal_uIntPtr nPtNum=0; nPtNum<nPtAnz; nPtNum++) {
- sal_uInt16 nPtId=pPts->GetObject(nPtNum);
- sal_uInt16 nGlueIdx=pGPL->FindGluePoint(nPtId);
- if (nGlueIdx!=SDRGLUEPOINT_NOTFOUND) {
- SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
- Point aPos(rGP.GetAbsolutePos(*pObj));
- (*pTrFunc)(aPos,p1,p2,p3,p4,p5);
- rGP.SetAbsolutePos(aPos,*pObj);
+ SdrGluePointList* pGPL=pObj->ForceGluePointList();
+
+ if(pGPL)
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
+
+ if( IsUndoEnabled() )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
}
+
+ for(sdr::selection::Indices::const_iterator aCurrent(aMarkedGluePoints.begin());
+ aCurrent != aMarkedGluePoints.end(); aCurrent++)
+ {
+ const sal_uInt32 nPtId(*aCurrent);
+ const sal_uInt32 nGlueIdx(pGPL->FindGluePoint(nPtId));
+
+ if(SDRGLUEPOINT_NOTFOUND != nGlueIdx)
+ {
+ SdrGluePoint& rGP=(*pGPL)[nGlueIdx];
+ const basegfx::B2DRange aObjectRange(sdr::legacy::GetSnapRange(*pObj));
+ basegfx::B2DPoint aPos(rGP.GetAbsolutePos(aObjectRange));
+ (*pTrFunc)(aPos,p1,p2,p3,p4,p5);
+ rGP.SetAbsolutePos(aPos, aObjectRange);
+ }
+ }
+
+ pObj->SetChanged();
}
- pObj->SetChanged();
- pObj->BroadcastObjectChange();
}
}
+
+ if(aSelection.size())
+ {
+ getSdrModelFromSdrView().SetChanged();
+ }
}
- if (nMarkAnz!=0) pMod->SetChanged();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-static void ImpMove(Point& rPt, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/)
+static void ImpMove(basegfx::B2DPoint& rPt, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/)
{
- rPt.X()+=((const Size*)p1)->Width();
- rPt.Y()+=((const Size*)p1)->Height();
+ rPt += *(static_cast< const basegfx::B2DVector* >(p1));
}
-void SdrGlueEditView::MoveMarkedGluePoints(const Size& rSiz, bool bCopy)
+void SdrGlueEditView::MoveMarkedGluePoints(const basegfx::B2DVector& rDelta, bool bCopy)
{
- ForceUndirtyMrkPnt();
XubString aStr(ImpGetResStr(STR_EditMove));
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_MOVE);
- if (bCopy) ImpCopyMarkedGluePoints();
- ImpTransformMarkedGluePoints(ImpMove,&rSiz);
+
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
+
+ BegUndo(aStr, getSelectedGluesDescription(), SDRREPFUNC_OBJ_MOVE);
+
+ if(bCopy)
+ {
+ ImpCopyMarkedGluePoints();
+ }
+
+ ImpTransformMarkedGluePoints(ImpMove, &rDelta);
EndUndo();
- AdjustMarkHdl();
+ SetMarkHandles();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-static void ImpResize(Point& rPt, const void* p1, const void* p2, const void* p3, const void* /*p4*/, const void* /*p5*/)
+static void ImpResize(basegfx::B2DPoint& rPt, const void* p1, const void* p2, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/)
{
- ResizePoint(rPt,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3);
+ const basegfx::B2DPoint* pRef = static_cast< const basegfx::B2DPoint* >(p1);
+ const basegfx::B2DVector* pScale = static_cast< const basegfx::B2DVector* >(p2);
+
+ rPt = ((rPt - (*pRef)) * (*pScale)) + (*pRef);
}
-void SdrGlueEditView::ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy)
+void SdrGlueEditView::ResizeMarkedGluePoints(const basegfx::B2DPoint& rRef, const basegfx::B2DVector& rScale, bool bCopy)
{
- ForceUndirtyMrkPnt();
XubString aStr(ImpGetResStr(STR_EditResize));
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_RESIZE);
- if (bCopy) ImpCopyMarkedGluePoints();
- ImpTransformMarkedGluePoints(ImpResize,&rRef,&xFact,&yFact);
+
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
+
+ BegUndo(aStr, getSelectedGluesDescription(), SDRREPFUNC_OBJ_RESIZE);
+
+ if(bCopy)
+ {
+ ImpCopyMarkedGluePoints();
+ }
+
+ ImpTransformMarkedGluePoints(ImpResize, &rRef, &rScale);
EndUndo();
- AdjustMarkHdl();
+ SetMarkHandles();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-static void ImpRotate(Point& rPt, const void* p1, const void* /*p2*/, const void* p3, const void* p4, const void* /*p5*/)
+static void ImpRotate(basegfx::B2DPoint& rPt, const void* p1, const void* /*p2*/, const void* p3, const void* p4, const void* /*p5*/)
{
- RotatePoint(rPt,*(const Point*)p1,*(const double*)p3,*(const double*)p4);
+ const basegfx::B2DPoint* pRef = static_cast< const basegfx::B2DPoint* >(p1);
+ const double* pSin = static_cast< const double* >(p3);
+ const double* pCos = static_cast< const double* >(p4);
+ const double fDx(rPt.getX() - pRef->getX());
+ const double fDy(rPt.getX() - pRef->getX());
+
+ rPt.setX(pRef->getX() + fDx * (*pCos) + fDy * (*pSin));
+ rPt.setY(pRef->getY() + fDy * (*pCos) - fDx * (*pSin));
}
-void SdrGlueEditView::RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy)
+void SdrGlueEditView::RotateMarkedGluePoints(const basegfx::B2DPoint& rRef, double fAngle, bool bCopy)
{
- ForceUndirtyMrkPnt();
XubString aStr(ImpGetResStr(STR_EditRotate));
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr,GetDescriptionOfMarkedGluePoints(),SDRREPFUNC_OBJ_ROTATE);
- if (bCopy) ImpCopyMarkedGluePoints();
- double nSin=sin(nWink*nPi180);
- double nCos=cos(nWink*nPi180);
- ImpTransformMarkedGluePoints(ImpRotate,&rRef,&nWink,&nSin,&nCos);
+
+ if(bCopy)
+ {
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
+
+ BegUndo(aStr, getSelectedGluesDescription(), SDRREPFUNC_OBJ_ROTATE);
+
+ if(bCopy)
+ {
+ ImpCopyMarkedGluePoints();
+ }
+
+ const double fSin(sin(fAngle));
+ const double fCos(cos(fAngle));
+
+ ImpTransformMarkedGluePoints(ImpRotate, &rRef, &fAngle, &fSin, &fCos);
EndUndo();
- AdjustMarkHdl();
+ SetMarkHandles();
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index e8e2a6e503d0..a778e271a895 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -28,107 +28,154 @@
#include <svx/svdglue.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdtrans.hxx>
+#include <svx/svdlegacy.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrGluePoint::SetReallyAbsolute(FASTBOOL bOn, const SdrObject& rObj)
+SdrGluePoint::SdrGluePoint()
+: mnEscDir(SDRESC_SMART),
+ mnId(0),
+ mnAlign(0),
+ mbNoPercent(false),
+ mbReallyAbsolute(false),
+ mbUserDefined(true)
+{
+}
+
+SdrGluePoint::SdrGluePoint(const basegfx::B2DPoint& rNewPos,
+ bool bNewPercent,
+ sal_uInt16 nNewAlign)
+: maPos(rNewPos),
+ mnEscDir(SDRESC_SMART),
+ mnId(0),
+ mnAlign(nNewAlign),
+ mbNoPercent(!bNewPercent),
+ mbReallyAbsolute(false),
+ mbUserDefined(true)
{
- if ( bReallyAbsolute != bOn )
- {
- if ( bOn )
- {
- aPos=GetAbsolutePos(rObj);
- bReallyAbsolute=bOn;
- }
- else
- {
- bReallyAbsolute=bOn;
- Point aPt(aPos);
- SetAbsolutePos(aPt,rObj);
- }
- }
}
-Point SdrGluePoint::GetAbsolutePos(const SdrObject& rObj) const
+bool SdrGluePoint::operator==(const SdrGluePoint& rCmpGP) const
{
- if (bReallyAbsolute) return aPos;
- Rectangle aSnap(rObj.GetSnapRect());
- Rectangle aBound(rObj.GetSnapRect());
- Point aPt(aPos);
-
- Point aOfs(aSnap.Center());
- switch (GetHorzAlign()) {
- case SDRHORZALIGN_LEFT : aOfs.X()=aSnap.Left(); break;
- case SDRHORZALIGN_RIGHT : aOfs.X()=aSnap.Right(); break;
- }
- switch (GetVertAlign()) {
- case SDRVERTALIGN_TOP : aOfs.Y()=aSnap.Top(); break;
- case SDRVERTALIGN_BOTTOM: aOfs.Y()=aSnap.Bottom(); break;
- }
- if (!bNoPercent) {
- long nXMul=aSnap.Right()-aSnap.Left();
- long nYMul=aSnap.Bottom()-aSnap.Top();
- long nXDiv=10000;
- long nYDiv=10000;
- if (nXMul!=nXDiv) {
- aPt.X()*=nXMul;
- aPt.X()/=nXDiv;
+ return GetPos() == rCmpGP.GetPos()
+ && GetEscDir() == rCmpGP.GetEscDir()
+ && GetId() == rCmpGP.GetId()
+ && GetAlign() == rCmpGP.GetAlign()
+ && IsPercent() == rCmpGP.IsPercent()
+ && IsReallyAbsolute() == rCmpGP.IsReallyAbsolute()
+ && IsUserDefined() == rCmpGP.IsUserDefined();
+}
+
+basegfx::B2DPoint SdrGluePoint::GetAbsolutePos(const basegfx::B2DRange& rObjectRange) const
+{
+ if(IsReallyAbsolute() || rObjectRange.isEmpty())
+ {
+ return GetPos();
+ }
+
+ basegfx::B2DPoint aPt(GetPos());
+ basegfx::B2DPoint aOfs(rObjectRange.getCenter());
+
+ switch(GetHorzAlign())
+ {
+ case SDRHORZALIGN_LEFT :
+ {
+ aOfs.setX(rObjectRange.getMinX());
+ break;
+ }
+ case SDRHORZALIGN_RIGHT :
+ {
+ aOfs.setX(rObjectRange.getMaxX());
+ break;
+ }
+ }
+
+ switch(GetVertAlign())
+ {
+ case SDRVERTALIGN_TOP :
+ {
+ aOfs.setY(rObjectRange.getMinY());
+ break;
}
- if (nYMul!=nYDiv) {
- aPt.Y()*=nYMul;
- aPt.Y()/=nYDiv;
+ case SDRVERTALIGN_BOTTOM:
+ {
+ aOfs.setY(rObjectRange.getMaxY());
+ break;
}
}
+
+ if(IsPercent())
+ {
+ const basegfx::B2DVector aScale(rObjectRange.getRange() / basegfx::B2DTuple(10000.0, 10000.0));
+
+ aPt *= aScale;
+ }
+
aPt+=aOfs;
- // Und nun auf's BoundRect des Objekts begrenzen
- if (aPt.X()<aBound.Left ()) aPt.X()=aBound.Left ();
- if (aPt.X()>aBound.Right ()) aPt.X()=aBound.Right ();
- if (aPt.Y()<aBound.Top ()) aPt.Y()=aBound.Top ();
- if (aPt.Y()>aBound.Bottom()) aPt.Y()=aBound.Bottom();
+
+ // limit to object bound
+ aPt = rObjectRange.clamp(aPt);
+
return aPt;
}
-void SdrGluePoint::SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj)
+void SdrGluePoint::SetAbsolutePos(const basegfx::B2DPoint& rNewPos, const basegfx::B2DRange& rObjectRange)
{
- if (bReallyAbsolute) {
- aPos=rNewPos;
+ if(IsReallyAbsolute() || rObjectRange.isEmpty())
+ {
+ SetPos(rNewPos);
return;
}
- Rectangle aSnap(rObj.GetSnapRect());
- Point aPt(rNewPos);
-
- Point aOfs(aSnap.Center());
- switch (GetHorzAlign()) {
- case SDRHORZALIGN_LEFT : aOfs.X()=aSnap.Left(); break;
- case SDRHORZALIGN_RIGHT : aOfs.X()=aSnap.Right(); break;
- }
- switch (GetVertAlign()) {
- case SDRVERTALIGN_TOP : aOfs.Y()=aSnap.Top(); break;
- case SDRVERTALIGN_BOTTOM: aOfs.Y()=aSnap.Bottom(); break;
- }
- aPt-=aOfs;
- if (!bNoPercent) {
- long nXMul=aSnap.Right()-aSnap.Left();
- long nYMul=aSnap.Bottom()-aSnap.Top();
- if (nXMul==0) nXMul=1;
- if (nYMul==0) nYMul=1;
- long nXDiv=10000;
- long nYDiv=10000;
- if (nXMul!=nXDiv) {
- aPt.X()*=nXDiv;
- aPt.X()/=nXMul;
+
+ basegfx::B2DPoint aPt(rNewPos);
+ basegfx::B2DPoint aOfs(rObjectRange.getCenter());
+
+ switch(GetHorzAlign())
+ {
+ case SDRHORZALIGN_LEFT :
+ {
+ aOfs.setX(rObjectRange.getMinX());
+ break;
+ }
+ case SDRHORZALIGN_RIGHT :
+ {
+ aOfs.setX(rObjectRange.getMaxX());
+ break;
+ }
+ }
+
+ switch(GetVertAlign())
+ {
+ case SDRVERTALIGN_TOP :
+ {
+ aOfs.setY(rObjectRange.getMinY());
+ break;
}
- if (nYMul!=nYDiv) {
- aPt.Y()*=nYDiv;
- aPt.Y()/=nYMul;
+ case SDRVERTALIGN_BOTTOM:
+ {
+ aOfs.setY(rObjectRange.getMaxY());
+ break;
}
}
- aPos=aPt;
+
+ aPt -= aOfs;
+
+ if(IsPercent())
+ {
+ const basegfx::B2DVector aScale(
+ 10000.0 / (basegfx::fTools::equalZero(rObjectRange.getWidth()) ? rObjectRange.getWidth() : 1.0),
+ 10000.0 / (basegfx::fTools::equalZero(rObjectRange.getHeight()) ? rObjectRange.getHeight() : 1.0));
+
+ aPt *= aScale;
+ }
+
+ SetPos(aPt);
}
-long SdrGluePoint::GetAlignAngle() const
+sal_Int32 SdrGluePoint::GetAlignAngle() const
{
- switch (nAlign) {
+ switch(GetAlign())
+ {
case SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER: return 0; // Invalid!
case SDRHORZALIGN_RIGHT |SDRVERTALIGN_CENTER: return 0;
case SDRHORZALIGN_RIGHT |SDRVERTALIGN_TOP : return 4500;
@@ -138,193 +185,202 @@ long SdrGluePoint::GetAlignAngle() const
case SDRHORZALIGN_LEFT |SDRVERTALIGN_BOTTOM: return 22500;
case SDRHORZALIGN_CENTER|SDRVERTALIGN_BOTTOM: return 27000;
case SDRHORZALIGN_RIGHT |SDRVERTALIGN_BOTTOM: return 31500;
- } // switch
+ }
+
return 0;
}
-void SdrGluePoint::SetAlignAngle(long nWink)
+void SdrGluePoint::SetAlignAngle(sal_Int32 nWink)
{
nWink=NormAngle360(nWink);
- if (nWink>=33750 || nWink<2250) nAlign=SDRHORZALIGN_RIGHT |SDRVERTALIGN_CENTER;
- else if (nWink< 6750) nAlign=SDRHORZALIGN_RIGHT |SDRVERTALIGN_TOP ;
- else if (nWink<11250) nAlign=SDRHORZALIGN_CENTER|SDRVERTALIGN_TOP ;
- else if (nWink<15750) nAlign=SDRHORZALIGN_LEFT |SDRVERTALIGN_TOP ;
- else if (nWink<20250) nAlign=SDRHORZALIGN_LEFT |SDRVERTALIGN_CENTER;
- else if (nWink<24750) nAlign=SDRHORZALIGN_LEFT |SDRVERTALIGN_BOTTOM;
- else if (nWink<29250) nAlign=SDRHORZALIGN_CENTER|SDRVERTALIGN_BOTTOM;
- else if (nWink<33750) nAlign=SDRHORZALIGN_RIGHT |SDRVERTALIGN_BOTTOM;
+
+ if(nWink >= 33750 || nWink < 2250)
+ {
+ SetAlign(SDRHORZALIGN_RIGHT |SDRVERTALIGN_CENTER);
+ }
+ else if(nWink < 6750)
+ {
+ SetAlign(SDRHORZALIGN_RIGHT |SDRVERTALIGN_TOP );
+ }
+ else if(nWink < 11250)
+ {
+ SetAlign(SDRHORZALIGN_CENTER|SDRVERTALIGN_TOP );
+ }
+ else if(nWink < 15750)
+ {
+ SetAlign(SDRHORZALIGN_LEFT |SDRVERTALIGN_TOP );
+ }
+ else if(nWink < 20250)
+ {
+ SetAlign(SDRHORZALIGN_LEFT |SDRVERTALIGN_CENTER);
+ }
+ else if(nWink < 24750)
+ {
+ SetAlign(SDRHORZALIGN_LEFT |SDRVERTALIGN_BOTTOM);
+ }
+ else if(nWink < 29250)
+ {
+ SetAlign(SDRHORZALIGN_CENTER|SDRVERTALIGN_BOTTOM);
+ }
+ else if(nWink < 33750)
+ {
+ SetAlign(SDRHORZALIGN_RIGHT |SDRVERTALIGN_BOTTOM);
+ }
}
-long SdrGluePoint::EscDirToAngle(sal_uInt16 nEsc) const
+sal_Int32 SdrGluePoint::EscDirToAngle(sal_uInt16 nEsc) const
{
- switch (nEsc) {
+ switch(nEsc)
+ {
case SDRESC_RIGHT : return 0;
case SDRESC_TOP : return 9000;
case SDRESC_LEFT : return 18000;
case SDRESC_BOTTOM: return 27000;
- } // switch
+ }
+
return 0;
}
-sal_uInt16 SdrGluePoint::EscAngleToDir(long nWink) const
+sal_uInt16 SdrGluePoint::EscAngleToDir(sal_Int32 nWink) const
{
nWink=NormAngle360(nWink);
- if (nWink>=31500 || nWink<4500) return SDRESC_RIGHT;
- if (nWink<13500) return SDRESC_TOP;
- if (nWink<22500) return SDRESC_LEFT;
- if (nWink<31500) return SDRESC_BOTTOM;
- return 0;
-}
-void SdrGluePoint::Rotate(const Point& rRef, long nWink, double sn, double cs, const SdrObject* pObj)
-{
- Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
- RotatePoint(aPt,rRef,sn,cs);
- // Bezugskante drehen
- if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER))
- {
- SetAlignAngle(GetAlignAngle()+nWink);
- }
- // Austrittsrichtungen drehen
- sal_uInt16 nEscDir0=nEscDir;
- sal_uInt16 nEscDir1=0;
- if ((nEscDir0&SDRESC_LEFT )!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_LEFT )+nWink);
- if ((nEscDir0&SDRESC_TOP )!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_TOP )+nWink);
- if ((nEscDir0&SDRESC_RIGHT )!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_RIGHT )+nWink);
- if ((nEscDir0&SDRESC_BOTTOM)!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_BOTTOM)+nWink);
- nEscDir=nEscDir1;
- if (pObj!=NULL) SetAbsolutePos(aPt,*pObj); else SetPos(aPt);
-}
+ if(nWink >= 31500 || nWink < 4500)
+ {
+ return SDRESC_RIGHT;
+ }
+ if(nWink < 13500)
+ {
+ return SDRESC_TOP;
+ }
+ if(nWink < 22500)
+ {
+ return SDRESC_LEFT;
+ }
+ if(nWink < 31500)
+ {
+ return SDRESC_BOTTOM;
+ }
-void SdrGluePoint::Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj)
-{
- Point aPt(rRef2); aPt-=rRef1;
- long nWink=GetAngle(aPt);
- Mirror(rRef1,rRef2,nWink,pObj);
+ return 0;
}
-void SdrGluePoint::Mirror(const Point& rRef1, const Point& rRef2, long nWink, const SdrObject* pObj)
+void SdrGluePoint::Transform(const basegfx::B2DHomMatrix& rTransformation, const basegfx::B2DRange& rObjectRange)
{
- Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
- MirrorPoint(aPt,rRef1,rRef2);
- // Bezugskante spiegeln
- if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER))
- {
- long nAW=GetAlignAngle();
- nAW+=2*(nWink-nAW);
- SetAlignAngle(nAW);
- }
- // Austrittsrichtungen spiegeln
- sal_uInt16 nEscDir0=nEscDir;
- sal_uInt16 nEscDir1=0;
- if ((nEscDir0&SDRESC_LEFT)!=0) {
- long nEW=EscDirToAngle(SDRESC_LEFT);
- nEW+=2*(nWink-nEW);
- nEscDir1|=EscAngleToDir(nEW);
- }
- if ((nEscDir0&SDRESC_TOP)!=0) {
- long nEW=EscDirToAngle(SDRESC_TOP);
- nEW+=2*(nWink-nEW);
- nEscDir1|=EscAngleToDir(nEW);
- }
- if ((nEscDir0&SDRESC_RIGHT)!=0) {
- long nEW=EscDirToAngle(SDRESC_RIGHT);
- nEW+=2*(nWink-nEW);
- nEscDir1|=EscAngleToDir(nEW);
- }
- if ((nEscDir0&SDRESC_BOTTOM)!=0) {
- long nEW=EscDirToAngle(SDRESC_BOTTOM);
- nEW+=2*(nWink-nEW);
- nEscDir1|=EscAngleToDir(nEW);
- }
- nEscDir=nEscDir1;
- if (pObj!=NULL) SetAbsolutePos(aPt,*pObj); else SetPos(aPt);
-}
+ basegfx::B2DPoint aPt(GetAbsolutePos(rObjectRange));
+ aPt = rTransformation * aPt;
-void SdrGluePoint::Shear(const Point& rRef, long /*nWink*/, double tn, FASTBOOL bVShear, const SdrObject* pObj)
-{
- Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
- ShearPoint(aPt,rRef,tn,bVShear);
- if (pObj!=NULL) SetAbsolutePos(aPt,*pObj); else SetPos(aPt);
-}
+ // check if old angle is needed
+ sal_Int32 nOldAngle(0);
+ const bool bTransformEscapes(GetEscDir() & (SDRESC_HORZ|SDRESC_VERT));
+ const bool bTransformAligns(GetAlign() != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER));
-void SdrGluePoint::Draw(OutputDevice& rOut, const SdrObject* pObj) const
-{
- Color aBackPenColor(COL_WHITE);
- Color aForePenColor(COL_LIGHTBLUE);
+ if(bTransformEscapes || bTransformAligns)
+ {
+ const basegfx::B2DPoint aRotated(rTransformation * basegfx::B2DPoint(1.0, 0.0));
+ const double fAngleToXAxis(atan2(aRotated.getY(), aRotated.getX()));
+ nOldAngle = basegfx::fround((-fAngleToXAxis * 18000.0) / F_PI) % 36000;
+ }
- bool bMapMerk=rOut.IsMapModeEnabled();
- Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
- aPt=rOut.LogicToPixel(aPt);
- rOut.EnableMapMode(sal_False);
- long x=aPt.X(),y=aPt.Y(); // Groesse erstmal fest auf 7 Pixel
+ // transform escape directions
+ if(bTransformEscapes)
+ {
+ sal_uInt16 nNewEscDir(0);
- rOut.SetLineColor( aBackPenColor );
- rOut.DrawLine(Point(x-2,y-3),Point(x+3,y+2));
- rOut.DrawLine(Point(x-3,y-2),Point(x+2,y+3));
- rOut.DrawLine(Point(x-3,y+2),Point(x+2,y-3));
- rOut.DrawLine(Point(x-2,y+3),Point(x+3,y-2));
+ if(GetEscDir() & SDRESC_LEFT)
+ {
+ nNewEscDir |= EscAngleToDir(EscDirToAngle(SDRESC_LEFT) + nOldAngle);
+ }
- if (bNoPercent)
- {
- switch (GetHorzAlign())
+ if(GetEscDir() & SDRESC_TOP)
{
- case SDRHORZALIGN_LEFT : rOut.DrawLine(Point(x-3,y-1),Point(x-3,y+1)); break;
- case SDRHORZALIGN_RIGHT : rOut.DrawLine(Point(x+3,y-1),Point(x+3,y+1)); break;
+ nNewEscDir |= EscAngleToDir(EscDirToAngle(SDRESC_TOP) + nOldAngle);
}
- switch (GetVertAlign())
+ if(GetEscDir() & SDRESC_RIGHT)
{
- case SDRVERTALIGN_TOP : rOut.DrawLine(Point(x-1,y-3),Point(x+1,y-3)); break;
- case SDRVERTALIGN_BOTTOM: rOut.DrawLine(Point(x-1,y+3),Point(x+1,y+3)); break;
+ nNewEscDir |= EscAngleToDir(EscDirToAngle(SDRESC_RIGHT) + nOldAngle);
}
+
+ if(GetEscDir() & SDRESC_BOTTOM)
+ {
+ nNewEscDir |= EscAngleToDir(EscDirToAngle(SDRESC_BOTTOM) + nOldAngle);
+ }
+
+ SetEscDir(nNewEscDir);
+ }
+
+ // transform alignment edge
+ if(bTransformAligns)
+ {
+ SetAlignAngle(GetAlignAngle() + nOldAngle);
}
- rOut.SetLineColor( aForePenColor );
- rOut.DrawLine(Point(x-2,y-2),Point(x+2,y+2));
- rOut.DrawLine(Point(x-2,y+2),Point(x+2,y-2));
- rOut.EnableMapMode(bMapMerk);
+ SetAbsolutePos(aPt, rObjectRange);
}
-void SdrGluePoint::Invalidate(Window& rWin, const SdrObject* pObj) const
+bool SdrGluePoint::IsHit(const basegfx::B2DPoint& rPnt, double fTolLog, const basegfx::B2DRange& rObjectRange) const
{
- bool bMapMerk=rWin.IsMapModeEnabled();
- Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
- aPt=rWin.LogicToPixel(aPt);
- rWin.EnableMapMode(sal_False);
- long x=aPt.X(),y=aPt.Y(); // Groesse erstmal fest auf 7 Pixel
+ const basegfx::B2DPoint aPt(GetAbsolutePos(rObjectRange));
+ const double fDist(basegfx::B2DVector(aPt - rPnt).getLength());
+
+ return basegfx::fTools::lessOrEqual(fDist, fTolLog);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
- // #111096#
- // do not erase background, that causes flicker (!)
- rWin.Invalidate(Rectangle(Point(x-3,y-3),Point(x+3,y+3)), INVALIDATE_NOERASE);
+SdrGluePointList::SdrGluePointList()
+: maList()
+{
+}
- rWin.EnableMapMode(bMapMerk);
+SdrGluePointList::SdrGluePointList(const SdrGluePointList& rSrcList)
+: maList()
+{
+ *this = rSrcList;
}
-FASTBOOL SdrGluePoint::IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const
+SdrGluePointList::~SdrGluePointList()
{
- Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
- Size aSiz=rOut.PixelToLogic(Size(3,3));
- Rectangle aRect(aPt.X()-aSiz.Width(),aPt.Y()-aSiz.Height(),aPt.X()+aSiz.Width(),aPt.Y()+aSiz.Height());
- return aRect.IsInside(rPnt);
+ Clear();
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
+SdrGluePoint* SdrGluePointList::GetObject(sal_uInt32 i) const
+{
+ if(i < maList.size())
+ {
+ return *(maList.begin() + i);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrGluePointList::GetObject access out of range (!)");
+ return 0;
+ }
+}
void SdrGluePointList::Clear()
{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
+ const sal_uInt32 nAnz(GetCount());
+
+ for(sal_uInt32 i(0); i < nAnz; i++)
+ {
delete GetObject(i);
}
- aList.Clear();
+
+ maList.clear();
}
void SdrGluePointList::operator=(const SdrGluePointList& rSrcList)
{
- if (GetCount()!=0) Clear();
- sal_uInt16 nAnz=rSrcList.GetCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
+ if(GetCount())
+ {
+ Clear();
+ }
+
+ const sal_uInt32 nAnz(rSrcList.GetCount());
+
+ for(sal_uInt32 i(0); i < nAnz; i++)
+ {
Insert(rSrcList[i]);
}
}
@@ -332,115 +388,126 @@ void SdrGluePointList::operator=(const SdrGluePointList& rSrcList)
// Die Id's der Klebepunkte in der Liste sind stets streng monoton steigend!
// Ggf. wird dem neuen Klebepunkt eine neue Id zugewiesen (wenn diese bereits
// vergeben ist). Die Id 0 ist reserviert.
-sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
+sal_uInt32 SdrGluePointList::Insert(const SdrGluePoint& rGP)
{
SdrGluePoint* pGP=new SdrGluePoint(rGP);
- sal_uInt16 nId=pGP->GetId();
- sal_uInt16 nAnz=GetCount();
- sal_uInt16 nInsPos=nAnz;
- sal_uInt16 nLastId=nAnz!=0 ? GetObject(nAnz-1)->GetId() : 0;
+ sal_uInt16 nId(pGP->GetId());
+ const sal_uInt32 nAnz(GetCount());
+ sal_uInt32 nInsPos(nAnz);
+ const sal_uInt16 nLastId(nAnz ? GetObject(nAnz - 1)->GetId() : 0);
DBG_ASSERT(nLastId>=nAnz,"SdrGluePointList::Insert(): nLastId<nAnz");
- FASTBOOL bHole=nLastId>nAnz;
- if (nId<=nLastId) {
- if (!bHole || nId==0) {
+ const bool bHole(nLastId > nAnz);
+
+ if(nId <= nLastId)
+ {
+ if(!bHole || 0 == nId)
+ {
nId=nLastId+1;
- } else {
- FASTBOOL bBrk=sal_False;
- for (sal_uInt16 nNum=0; nNum<nAnz && !bBrk; nNum++) {
+ }
+ else
+ {
+ bool bBrk(false);
+
+ for(sal_uInt32 nNum(0); nNum < nAnz && !bBrk; nNum++)
+ {
const SdrGluePoint* pGP2=GetObject(nNum);
- sal_uInt16 nTmpId=pGP2->GetId();
- if (nTmpId==nId) {
+ const sal_uInt16 nTmpId(pGP2->GetId());
+
+ if(nTmpId == nId)
+ {
nId=nLastId+1; // bereits vorhanden
- bBrk=sal_True;
+ bBrk = true;
}
- if (nTmpId>nId) {
+
+ if(nTmpId > nId)
+ {
nInsPos=nNum; // Hier einfuegen (einsortieren)
- bBrk=sal_True;
+ bBrk = true;
}
}
}
+
pGP->SetId(nId);
}
- aList.Insert(pGP,nInsPos);
+
+ maList.insert(maList.begin() + nInsPos, pGP);
+
return nInsPos;
}
-void SdrGluePointList::Invalidate(Window& rWin, const SdrObject* pObj) const
+void SdrGluePointList::Delete(sal_uInt32 nPos)
{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
- GetObject(nNum)->Invalidate(rWin,pObj);
+ if(nPos < maList.size())
+ {
+ SdrGluePointContainerType::iterator a(maList.begin() + nPos);
+ delete *a;
+ maList.erase(a);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrGluePointList::Delete out of range (!)");
}
}
-sal_uInt16 SdrGluePointList::FindGluePoint(sal_uInt16 nId) const
+sal_uInt32 SdrGluePointList::FindGluePoint(sal_uInt32 nId) const
{
// Hier noch einen optimaleren Suchalgorithmus implementieren.
// Die Liste sollte stets sortiert sein!!!!
- sal_uInt16 nAnz=GetCount();
- sal_uInt16 nRet=SDRGLUEPOINT_NOTFOUND;
- for (sal_uInt16 nNum=0; nNum<nAnz && nRet==SDRGLUEPOINT_NOTFOUND; nNum++) {
- const SdrGluePoint* pGP=GetObject(nNum);
- if (pGP->GetId()==nId) nRet=nNum;
- }
- return nRet;
-}
+ const sal_uInt32 nAnz(GetCount());
+ sal_uInt32 nRet(SDRGLUEPOINT_NOTFOUND);
-sal_uInt16 SdrGluePointList::HitTest(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj, FASTBOOL bBack, FASTBOOL bNext, sal_uInt16 nId0) const
-{
- sal_uInt16 nAnz=GetCount();
- sal_uInt16 nRet=SDRGLUEPOINT_NOTFOUND;
- sal_uInt16 nNum=bBack ? 0 : nAnz;
- while ((bBack ? nNum<nAnz : nNum>0) && nRet==SDRGLUEPOINT_NOTFOUND) {
- if (!bBack) nNum--;
+ for(sal_uInt32 nNum(0); nNum < nAnz && SDRGLUEPOINT_NOTFOUND == nRet; nNum++)
+ {
const SdrGluePoint* pGP=GetObject(nNum);
- if (bNext) {
- if (pGP->GetId()==nId0) bNext=sal_False;
- } else {
- if (pGP->IsHit(rPnt,rOut,pObj)) nRet=nNum;
+
+ if(pGP->GetId() == nId)
+ {
+ nRet = nNum;
}
- if (bBack) nNum++;
}
+
return nRet;
}
-void SdrGluePointList::SetReallyAbsolute(FASTBOOL bOn, const SdrObject& rObj)
+sal_uInt32 SdrGluePointList::GPLHitTest(const basegfx::B2DPoint& rPnt, double fTolLog, const basegfx::B2DRange& rObjectRange,
+ bool bBack, sal_uInt32 nId0) const
{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
- GetObject(nNum)->SetReallyAbsolute(bOn,rObj);
- }
-}
+ const sal_uInt32 nAnz(GetCount());
+ sal_uInt32 nRet(SDRGLUEPOINT_NOTFOUND);
+ sal_uInt32 nNum(bBack ? 0 : nAnz);
-void SdrGluePointList::Rotate(const Point& rRef, long nWink, double sn, double cs, const SdrObject* pObj)
-{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
- GetObject(nNum)->Rotate(rRef,nWink,sn,cs,pObj);
- }
-}
+ while((bBack ? nNum < nAnz : nNum > 0) && SDRGLUEPOINT_NOTFOUND == nRet)
+ {
+ if(!bBack)
+ {
+ nNum--;
+ }
-void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj)
-{
- Point aPt(rRef2); aPt-=rRef1;
- long nWink=GetAngle(aPt);
- Mirror(rRef1,rRef2,nWink,pObj);
-}
+ const SdrGluePoint* pGP = GetObject(nNum);
-void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, long nWink, const SdrObject* pObj)
-{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
- GetObject(nNum)->Mirror(rRef1,rRef2,nWink,pObj);
+ if(pGP->IsHit(rPnt, fTolLog, rObjectRange))
+ {
+ nRet = nNum;
+ }
+
+ if(bBack)
+ {
+ nNum++;
+ }
}
+
+ return nRet;
}
-void SdrGluePointList::Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear, const SdrObject* pObj)
+void SdrGluePointList::TransformGluePoints(const basegfx::B2DHomMatrix& rTransformation, const basegfx::B2DRange& rObjectRange)
{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
- GetObject(nNum)->Shear(rRef,nWink,tn,bVShear,pObj);
+ const sal_uInt32 nAnz(GetCount());
+
+ for(sal_uInt32 nNum(0); nNum < nAnz; nNum++)
+ {
+ GetObject(nNum)->Transform(rTransformation, rObjectRange);
}
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index afbf063a1ea3..a498c8d93ccc 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -24,30 +24,23 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <algorithm>
-
#include <svx/svdhdl.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdetc.hxx>
#include <svx/svdmrkv.hxx>
#include <vcl/window.hxx>
-
#include <vcl/virdev.hxx>
#include <tools/poly.hxx>
#include <vcl/bmpacc.hxx>
-
#include <svx/sxekitm.hxx>
-#include "svx/svdstr.hrc"
-#include "svx/svdglob.hxx"
-
+#include <svx/svdstr.hrc>
+#include <svx/svdglob.hxx>
#include <svx/svdmodel.hxx>
#include "gradtrns.hxx"
#include <svx/xflgrit.hxx>
#include <svx/svdundo.hxx>
#include <svx/dialmgr.hxx>
#include <svx/xflftrit.hxx>
-
-// #105678#
#include <svx/svdopath.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -62,6 +55,8 @@
#include <vcl/svapp.hxx>
#include <svx/sdr/overlay/overlaypolypolygon.hxx>
#include <vcl/lazydelete.hxx>
+#include <svx/svdlegacy.hxx>
+#include <algorithm>
////////////////////////////////////////////////////////////////////////////////////////////////////
// #i15222#
@@ -91,6 +86,7 @@ public:
};
////////////////////////////////////////////////////////////////////////////////////////////////////
+
#define KIND_COUNT (14)
#define INDEX_COUNT (6)
#define INDIVIDUAL_COUNT (4)
@@ -289,53 +285,48 @@ SdrHdlBitmapSet& getHighContrastSet()
////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrHdl::SdrHdl():
- pObj(NULL),
- pPV(NULL),
- pHdlList(NULL),
- eKind(HDL_MOVE),
- nDrehWink(0),
- nObjHdlNum(0),
- nPolyNum(0),
- nPPntNum(0),
- nSourceHdlNum(0),
- bSelect(sal_False),
- b1PixMore(sal_False),
- bPlusHdl(sal_False),
+SdrHdl::SdrHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject,
+ SdrHdlKind eNewKind,
+ const basegfx::B2DPoint& rPosition,
+ bool bIsFrameHandle)
+: boost::noncopyable(),
+ mrHdlList(rHdlList),
+ mpSdrHdlObject(pSdrHdlObject),
+ meKind(eNewKind),
+ maPosition(rPosition),
+ maOverlayGroup(),
+ mnObjHdlNum(0),
+ mnPolyNum(0),
+ mnPPntNum(0),
+ mnSourceHdlNum(0),
+ mbSelect(false),
+ mb1PixMore(false),
+ mbPlusHdl(false),
+ mbIsFrameHandle(bIsFrameHandle),
mbMoveOutside(false),
mbMouseOver(false)
{
-}
+ // add to owning list
+ mrHdlList.maList.push_back(this);
-SdrHdl::SdrHdl(const Point& rPnt, SdrHdlKind eNewKind):
- pObj(NULL),
- pPV(NULL),
- pHdlList(NULL),
- aPos(rPnt),
- eKind(eNewKind),
- nDrehWink(0),
- nObjHdlNum(0),
- nPolyNum(0),
- nPPntNum(0),
- nSourceHdlNum(0),
- bSelect(sal_False),
- b1PixMore(sal_False),
- bPlusHdl(sal_False),
- mbMoveOutside(false),
- mbMouseOver(false)
-{
+ // make sure graphical representation gets created. Cannot call
+ // CreateB2dIAObject() here since it's a virtual function
+ mrHdlList.SdrHdlVisualisationChanged();
}
SdrHdl::~SdrHdl()
{
GetRidOfIAObject();
+ OSL_ENSURE(!mrHdlList.maList.size(), "SdrHdl deleted from someone else than SdrHdlList (!)");
}
-void SdrHdl::Set1PixMore(sal_Bool bJa)
+void SdrHdl::Set1PixMore(bool bJa)
{
- if(b1PixMore != bJa)
+ if(mb1PixMore != bJa)
{
- b1PixMore = bJa;
+ mb1PixMore = bJa;
// create new display
Touch();
@@ -353,65 +344,35 @@ void SdrHdl::SetMoveOutside( bool bMoveOutside )
}
}
-void SdrHdl::SetDrehWink(long n)
+const basegfx::B2DPoint& SdrHdl::getPosition() const
{
- if(nDrehWink != n)
- {
- nDrehWink = n;
-
- // create new display
- Touch();
- }
+ return maPosition;
}
-void SdrHdl::SetPos(const Point& rPnt)
+void SdrHdl::setPosition(const basegfx::B2DPoint& rNew)
{
- if(aPos != rPnt)
+ if(maPosition != rNew)
{
// remember new position
- aPos = rPnt;
+ maPosition = rNew;
// create new display
Touch();
}
}
-void SdrHdl::SetSelected(sal_Bool bJa)
+void SdrHdl::SetSelected(bool bJa)
{
- if(bSelect != bJa)
+ if(mbSelect != bJa)
{
// remember new value
- bSelect = bJa;
+ mbSelect = bJa;
// create new display
Touch();
}
}
-void SdrHdl::SetHdlList(SdrHdlList* pList)
-{
- if(pHdlList != pList)
- {
- // rememver list
- pHdlList = pList;
-
- // now its possible to create graphic representation
- Touch();
- }
-}
-
-void SdrHdl::SetObj(SdrObject* pNewObj)
-{
- if(pObj != pNewObj)
- {
- // remember new object
- pObj = pNewObj;
-
- // graphic representation may have changed
- Touch();
- }
-}
-
void SdrHdl::Touch()
{
// force update of graphic representation
@@ -420,8 +381,6 @@ void SdrHdl::Touch()
void SdrHdl::GetRidOfIAObject()
{
- //OLMaIAOGroup.Delete();
-
// OVERLAYMANAGER
maOverlayGroup.clear();
}
@@ -431,184 +390,192 @@ void SdrHdl::CreateB2dIAObject()
// first throw away old one
GetRidOfIAObject();
- if(pHdlList && pHdlList->GetView() && !pHdlList->GetView()->areMarkHandlesHidden())
- {
- BitmapColorIndex eColIndex = LightGreen;
- BitmapMarkerKind eKindOfMarker = Rect_7x7;
+ SdrPageView* pPageView = mrHdlList.GetViewFromSdrHdlList().GetSdrPageView();
- sal_Bool bRot = pHdlList->IsRotateShear();
- if(pObj)
- eColIndex = (bSelect) ? Cyan : LightCyan;
- if(bRot)
+ if(pPageView)
+ {
+ for(sal_uInt32 a(0); a < pPageView->PageWindowCount(); a++)
{
- // Drehhandles in Rot
- if(pObj && bSelect)
- eColIndex = Red;
- else
- eColIndex = LightRed;
- }
+ const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(a);
- switch(eKind)
- {
- case HDL_MOVE:
- {
- eKindOfMarker = (b1PixMore) ? Rect_9x9 : Rect_7x7;
- break;
- }
- case HDL_UPLFT:
- case HDL_UPRGT:
- case HDL_LWLFT:
- case HDL_LWRGT:
- {
- // corner handles
- if(bRot)
- {
- eKindOfMarker = Circ_7x7;
- }
- else
- {
- eKindOfMarker = Rect_7x7;
- }
- break;
- }
- case HDL_UPPER:
- case HDL_LOWER:
- {
- // Upper/Lower handles
- if(bRot)
- {
- eKindOfMarker = Elli_9x7;
- }
- else
- {
- eKindOfMarker = Rect_7x7;
- }
- break;
- }
- case HDL_LEFT:
- case HDL_RIGHT:
- {
- // Left/Right handles
- if(bRot)
- {
- eKindOfMarker = Elli_7x9;
- }
- else
- {
- eKindOfMarker = Rect_7x7;
- }
- break;
- }
- case HDL_POLY:
+ if(rPageWindow.GetPaintWindow().OutputToWindow())
{
- if(bRot)
- {
- eKindOfMarker = (b1PixMore) ? Circ_9x9 : Circ_7x7;
- }
- else
+ ::sdr::overlay::OverlayManager* pOverlayManager = rPageWindow.GetOverlayManager();
+
+ if(pOverlayManager)
{
- eKindOfMarker = (b1PixMore) ? Rect_9x9 : Rect_7x7;
+ CreateB2dIAObject(*pOverlayManager);
}
- break;
}
- case HDL_BWGT: // weight at poly
+ }
+ }
+}
+
+void SdrHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ BitmapColorIndex eColIndex = LightGreen;
+ BitmapMarkerKind eKindOfMarker = Rect_7x7;
+ bool bRot = mrHdlList.IsRotateShear();
+
+ if(!IsFrameHandle())
+ {
+ eColIndex = (mbSelect) ? Cyan : LightCyan;
+ }
+ else if(bRot)
+ {
+ // Drehhandles in Rot
+ eColIndex = (mbSelect) ? Red : LightRed;
+ }
+
+ switch(meKind)
+ {
+ case HDL_MOVE:
+ {
+ eKindOfMarker = (mb1PixMore) ? Rect_9x9 : Rect_7x7;
+ break;
+ }
+ case HDL_UPLFT:
+ case HDL_UPRGT:
+ case HDL_LWLFT:
+ case HDL_LWRGT:
+ {
+ // corner handles
+ if(bRot)
{
eKindOfMarker = Circ_7x7;
- break;
}
- case HDL_CIRC:
+ else
{
- eKindOfMarker = Rect_11x11;
- break;
+ eKindOfMarker = Rect_7x7;
}
- case HDL_REF1:
- case HDL_REF2:
+ break;
+ }
+ case HDL_UPPER:
+ case HDL_LOWER:
+ {
+ // Upper/Lower handles
+ if(bRot)
{
- eKindOfMarker = Crosshair;
- break;
+ eKindOfMarker = Elli_9x7;
}
- case HDL_GLUE:
+ else
{
- eKindOfMarker = Glue;
- break;
+ eKindOfMarker = Rect_7x7;
}
- case HDL_ANCHOR:
+ break;
+ }
+ case HDL_LEFT:
+ case HDL_RIGHT:
+ {
+ // Left/Right handles
+ if(bRot)
{
- eKindOfMarker = Anchor;
- break;
+ eKindOfMarker = Elli_7x9;
}
- case HDL_USER:
+ else
{
- break;
+ eKindOfMarker = Rect_7x7;
}
- // #101688# top right anchor for SW
- case HDL_ANCHOR_TR:
+ break;
+ }
+ case HDL_POLY:
+ {
+ if(bRot)
{
- eKindOfMarker = AnchorTR;
- break;
+ eKindOfMarker = (mb1PixMore) ? Circ_9x9 : Circ_7x7;
}
-
- // for SJ and the CustomShapeHandles:
- case HDL_CUSTOMSHAPE1:
+ else
{
- eKindOfMarker = Customshape1;
- eColIndex = Yellow;
- break;
+ eKindOfMarker = (mb1PixMore) ? Rect_9x9 : Rect_7x7;
}
- default:
- break;
+ break;
+ }
+ case HDL_BWGT: // weight at poly
+ {
+ eKindOfMarker = Circ_7x7;
+ break;
+ }
+ case HDL_CIRC:
+ {
+ eKindOfMarker = Rect_11x11;
+ break;
+ }
+ case HDL_REF1:
+ case HDL_REF2:
+ {
+ eKindOfMarker = Crosshair;
+ break;
+ }
+ case HDL_GLUE:
+ {
+ eKindOfMarker = Glue;
+ break;
+ }
+ case HDL_ANCHOR:
+ {
+ eKindOfMarker = Anchor;
+ break;
+ }
+ case HDL_USER:
+ {
+ break;
+ }
+ // #101688# top right anchor for SW
+ case HDL_ANCHOR_TR:
+ {
+ eKindOfMarker = AnchorTR;
+ break;
}
- SdrMarkView* pView = pHdlList->GetView();
- SdrPageView* pPageView = pView->GetSdrPageView();
+ // for SJ and the CustomShapeHandles:
+ case HDL_CUSTOMSHAPE1:
+ {
+ eKindOfMarker = Customshape1;
+ eColIndex = Yellow;
+ break;
+ }
+ default:
+ break;
+ }
+
+ sal_Int16 nMoveOutsideX(0);
+ sal_Int16 nMoveOutsideY(0);
+
+ // add offset if necessary
+ if(mrHdlList.IsMoveOutside() || mbMoveOutside)
+ {
+ const basegfx::B2DVector aOffset(rOverlayManager.getOutputDevice().GetInverseViewTransformation() * basegfx::B2DVector(4.0, 4.0));
- if(pPageView)
+ if(meKind == HDL_UPLFT || meKind == HDL_UPPER || meKind == HDL_UPRGT)
{
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+ nMoveOutsideY = -1;
+ }
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- Point aMoveOutsideOffset(0, 0);
+ if(meKind == HDL_LWLFT || meKind == HDL_LOWER || meKind == HDL_LWRGT)
+ {
+ nMoveOutsideY = 1;
+ }
- // add offset if necessary
- if(pHdlList->IsMoveOutside() || mbMoveOutside)
- {
- OutputDevice& rOutDev = rPageWindow.GetPaintWindow().GetOutputDevice();
- Size aOffset = rOutDev.PixelToLogic(Size(4, 4));
-
- if(eKind == HDL_UPLFT || eKind == HDL_UPPER || eKind == HDL_UPRGT)
- aMoveOutsideOffset.Y() -= aOffset.Width();
- if(eKind == HDL_LWLFT || eKind == HDL_LOWER || eKind == HDL_LWRGT)
- aMoveOutsideOffset.Y() += aOffset.Height();
- if(eKind == HDL_UPLFT || eKind == HDL_LEFT || eKind == HDL_LWLFT)
- aMoveOutsideOffset.X() -= aOffset.Width();
- if(eKind == HDL_UPRGT || eKind == HDL_RIGHT || eKind == HDL_LWRGT)
- aMoveOutsideOffset.X() += aOffset.Height();
- }
+ if(meKind == HDL_UPLFT || meKind == HDL_LEFT || meKind == HDL_LWLFT)
+ {
+ nMoveOutsideX = -1;
+ }
- if(rPageWindow.GetOverlayManager())
- {
- basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
- ::sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject(
- aPosition,
- eColIndex,
- eKindOfMarker,
- aMoveOutsideOffset);
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
+ if(meKind == HDL_UPRGT || meKind == HDL_RIGHT || meKind == HDL_LWRGT)
+ {
+ nMoveOutsideX = 1;
}
}
+
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject(
+ maPosition,
+ eColIndex,
+ eKindOfMarker,
+ nMoveOutsideX,
+ nMoveOutsideY);
+
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
}
BitmapMarkerKind SdrHdl::GetNextBigger(BitmapMarkerKind eKnd) const
@@ -652,7 +619,7 @@ BitmapMarkerKind SdrHdl::GetNextBigger(BitmapMarkerKind eKnd) const
}
// #101928#
-BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, sal_Bool bFine, sal_Bool bIsHighContrast)
+BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, bool bFine, bool bIsHighContrast)
{
if(bIsHighContrast)
{
@@ -673,19 +640,22 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd,
::sdr::overlay::OverlayObject* SdrHdl::CreateOverlayObject(
const basegfx::B2DPoint& rPos,
- BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, Point aMoveOutsideOffset)
+ BitmapColorIndex eColIndex,
+ BitmapMarkerKind eKindOfMarker,
+ sal_Int16 nMoveOutsideX,
+ sal_Int16 nMoveOutsideY)
{
::sdr::overlay::OverlayObject* pRetval = 0L;
- sal_Bool bIsFineHdl(pHdlList->IsFineHdl());
+ bool bIsFineHdl(mrHdlList.IsFineHdl());
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- sal_Bool bIsHighContrast(rStyleSettings.GetHighContrastMode());
+ bool bIsHighContrast(rStyleSettings.GetHighContrastMode());
// support bigger sizes
- sal_Bool bForceBiggerSize(sal_False);
+ bool bForceBiggerSize(false);
- if(pHdlList->GetHdlSize() > 3)
+ if(mrHdlList.GetHdlSize() > 3)
{
- bForceBiggerSize = sal_True;
+ bForceBiggerSize = true;
}
// #101928# ...for high contrast, too.
@@ -695,7 +665,7 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd,
// ...but not for anchors, else they will not blink when activated
if(Anchor != eKindOfMarker && AnchorTR != eKindOfMarker)
{
- bForceBiggerSize = sal_True;
+ bForceBiggerSize = true;
}
}
@@ -705,7 +675,7 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd,
}
// #97016# II This handle has the focus, visualize it
- if(IsFocusHdl() && pHdlList && pHdlList->GetFocusHdl() == this)
+ if(IsFocusHdl() && mrHdlList.GetFocusHdl() == this)
{
// create animated handle
BitmapMarkerKind eNextBigger = GetNextBigger(eKindOfMarker);
@@ -786,20 +756,20 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd,
sal_uInt16 nCenX((sal_uInt16)(aBmpEx.GetSizePixel().Width() - 1L) >> 1);
sal_uInt16 nCenY((sal_uInt16)(aBmpEx.GetSizePixel().Height() - 1L) >> 1);
- if(aMoveOutsideOffset.X() > 0)
+ if(nMoveOutsideX > 0)
{
nCenX = 0;
}
- else if(aMoveOutsideOffset.X() < 0)
+ else if(nMoveOutsideX < 0)
{
nCenX = (sal_uInt16)(aBmpEx.GetSizePixel().Width() - 1);
}
- if(aMoveOutsideOffset.Y() > 0)
+ if(nMoveOutsideY > 0)
{
nCenY = 0;
}
- else if(aMoveOutsideOffset.Y() < 0)
+ else if(nMoveOutsideY < 0)
{
nCenY = (sal_uInt16)(aBmpEx.GetSizePixel().Height() - 1);
}
@@ -812,21 +782,20 @@ BitmapEx SdrHdl::ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd,
return pRetval;
}
-bool SdrHdl::IsHdlHit(const Point& rPnt) const
+bool SdrHdl::IsHdlHit(const basegfx::B2DPoint& rPosition) const
{
// OVERLAYMANAGER
- basegfx::B2DPoint aPosition(rPnt.X(), rPnt.Y());
- return maOverlayGroup.isHitLogic(aPosition);
+ return maOverlayGroup.isHitLogic(rPosition);
}
Pointer SdrHdl::GetPointer() const
{
PointerStyle ePtr=POINTER_MOVE;
- const sal_Bool bSize=eKind>=HDL_UPLFT && eKind<=HDL_LWRGT;
- const sal_Bool bRot=pHdlList!=NULL && pHdlList->IsRotateShear();
- const sal_Bool bDis=pHdlList!=NULL && pHdlList->IsDistortShear();
- if (bSize && pHdlList!=NULL && (bRot || bDis)) {
- switch (eKind) {
+ const bool bSize=meKind>=HDL_UPLFT && meKind<=HDL_LWRGT;
+ const bool bRot=mrHdlList.IsRotateShear();
+ const bool bDis=mrHdlList.IsDistortShear();
+ if (bSize && (bRot || bDis)) {
+ switch (meKind) {
case HDL_UPLFT: case HDL_UPRGT:
case HDL_LWLFT: case HDL_LWRGT: ePtr=bRot ? POINTER_ROTATE : POINTER_REFHAND; break;
case HDL_LEFT : case HDL_RIGHT: ePtr=POINTER_VSHEAR; break;
@@ -834,38 +803,68 @@ Pointer SdrHdl::GetPointer() const
default:
break;
}
- } else {
+ }
+ else
+ {
// Fuer Resize von gedrehten Rechtecken die Mauszeiger etwas mitdrehen
- if (bSize && nDrehWink!=0) {
- long nHdlWink=0;
- switch (eKind) {
- case HDL_LWRGT: nHdlWink=31500; break;
- case HDL_LOWER: nHdlWink=27000; break;
- case HDL_LWLFT: nHdlWink=22500; break;
- case HDL_LEFT : nHdlWink=18000; break;
- case HDL_UPLFT: nHdlWink=13500; break;
- case HDL_UPPER: nHdlWink=9000; break;
- case HDL_UPRGT: nHdlWink=4500; break;
- case HDL_RIGHT: nHdlWink=0; break;
- default:
- break;
+ bool bDone(false);
+
+ if(bSize && mpSdrHdlObject)
+ {
+ const sal_Int32 aOldRot(sdr::legacy::GetRotateAngle(*mpSdrHdlObject));
+
+ if(aOldRot)
+ {
+ sal_Int32 nHdlWink(0);
+
+ switch (meKind)
+ {
+ case HDL_LWRGT: nHdlWink=31500; break;
+ case HDL_LOWER: nHdlWink=27000; break;
+ case HDL_LWLFT: nHdlWink=22500; break;
+ case HDL_LEFT : nHdlWink=18000; break;
+ case HDL_UPLFT: nHdlWink=13500; break;
+ case HDL_UPPER: nHdlWink=9000; break;
+ case HDL_UPRGT: nHdlWink=4500; break;
+ case HDL_RIGHT: nHdlWink=0; break;
+ default:
+ break;
+ }
+
+ nHdlWink += aOldRot + 2249;
+
+ while(nHdlWink < 0)
+ {
+ nHdlWink += 36000;
+ }
+
+ while(nHdlWink >= 36000)
+ {
+ nHdlWink -= 36000;
+ }
+
+ nHdlWink/=4500;
+
+ switch ((sal_uInt8)nHdlWink)
+ {
+ case 0: ePtr=POINTER_ESIZE; break;
+ case 1: ePtr=POINTER_NESIZE; break;
+ case 2: ePtr=POINTER_NSIZE; break;
+ case 3: ePtr=POINTER_NWSIZE; break;
+ case 4: ePtr=POINTER_WSIZE; break;
+ case 5: ePtr=POINTER_SWSIZE; break;
+ case 6: ePtr=POINTER_SSIZE; break;
+ case 7: ePtr=POINTER_SESIZE; break;
+ }
+
+ bDone = true;
}
- nHdlWink+=nDrehWink+2249; // und etwas drauf (zum runden)
- while (nHdlWink<0) nHdlWink+=36000;
- while (nHdlWink>=36000) nHdlWink-=36000;
- nHdlWink/=4500;
- switch ((sal_uInt8)nHdlWink) {
- case 0: ePtr=POINTER_ESIZE; break;
- case 1: ePtr=POINTER_NESIZE; break;
- case 2: ePtr=POINTER_NSIZE; break;
- case 3: ePtr=POINTER_NWSIZE; break;
- case 4: ePtr=POINTER_WSIZE; break;
- case 5: ePtr=POINTER_SWSIZE; break;
- case 6: ePtr=POINTER_SSIZE; break;
- case 7: ePtr=POINTER_SESIZE; break;
- } // switch
- } else {
- switch (eKind) {
+ }
+
+ if(!bDone)
+ {
+ switch (meKind)
+ {
case HDL_UPLFT: ePtr=POINTER_NWSIZE; break;
case HDL_UPPER: ePtr=POINTER_NSIZE; break;
case HDL_UPRGT: ePtr=POINTER_NESIZE; break;
@@ -890,9 +889,9 @@ Pointer SdrHdl::GetPointer() const
}
// #97016# II
-sal_Bool SdrHdl::IsFocusHdl() const
+bool SdrHdl::IsFocusHdl() const
{
- switch(eKind)
+ switch(meKind)
{
case HDL_UPLFT: // Oben links
case HDL_UPPER: // Oben
@@ -904,7 +903,7 @@ sal_Bool SdrHdl::IsFocusHdl() const
case HDL_LWRGT: // Unten rechts
{
// if it's a activated TextEdit, it's moved to extended points
- if(pHdlList && pHdlList->IsMoveOutside())
+ if(mrHdlList.IsMoveOutside())
return sal_False;
else
return sal_True;
@@ -957,846 +956,21 @@ bool SdrHdl::isMouseOver() const
return mbMouseOver;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// class SdrHdlColor
-
-SdrHdlColor::SdrHdlColor(const Point& rRef, Color aCol, const Size& rSize, sal_Bool bLum)
-: SdrHdl(rRef, HDL_COLR),
- aMarkerSize(rSize),
- bUseLuminance(bLum)
-{
- if(IsUseLuminance())
- aCol = GetLuminance(aCol);
-
- // remember color
- aMarkerColor = aCol;
-}
-
-SdrHdlColor::~SdrHdlColor()
-{
-}
-
-void SdrHdlColor::CreateB2dIAObject()
-{
- // first throw away old one
- GetRidOfIAObject();
-
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- Bitmap aBmpCol(CreateColorDropper(aMarkerColor));
- basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
- ::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayBitmapEx(
- aPosition,
- BitmapEx(aBmpCol),
- (sal_uInt16)(aBmpCol.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBmpCol.GetSizePixel().Height() - 1) >> 1
- );
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
- }
-}
-
-Bitmap SdrHdlColor::CreateColorDropper(Color aCol)
+void SdrHdl::setMouseOver(bool bNew)
{
- // get the Bitmap
- Bitmap aRetval(aMarkerSize, 24);
- aRetval.Erase(aCol);
-
- // get write access
- BitmapWriteAccess* pWrite = aRetval.AcquireWriteAccess();
- DBG_ASSERT(pWrite, "Got NO write access to a new Bitmap !!!");
-
- if(pWrite)
- {
- // draw outer border
- sal_Int32 nWidth = aMarkerSize.Width();
- sal_Int32 nHeight = aMarkerSize.Height();
-
- pWrite->SetLineColor(Color(COL_LIGHTGRAY));
- pWrite->DrawLine(Point(0, 0), Point(0, nHeight - 1));
- pWrite->DrawLine(Point(1, 0), Point(nWidth - 1, 0));
- pWrite->SetLineColor(Color(COL_GRAY));
- pWrite->DrawLine(Point(1, nHeight - 1), Point(nWidth - 1, nHeight - 1));
- pWrite->DrawLine(Point(nWidth - 1, 1), Point(nWidth - 1, nHeight - 2));
-
- // draw lighter UpperLeft
- const Color aLightColor(
- (sal_uInt8)(::std::min((sal_Int16)((sal_Int16)aCol.GetRed() + (sal_Int16)0x0040), (sal_Int16)0x00ff)),
- (sal_uInt8)(::std::min((sal_Int16)((sal_Int16)aCol.GetGreen() + (sal_Int16)0x0040), (sal_Int16)0x00ff)),
- (sal_uInt8)(::std::min((sal_Int16)((sal_Int16)aCol.GetBlue() + (sal_Int16)0x0040), (sal_Int16)0x00ff)));
- pWrite->SetLineColor(aLightColor);
- pWrite->DrawLine(Point(1, 1), Point(1, nHeight - 2));
- pWrite->DrawLine(Point(2, 1), Point(nWidth - 2, 1));
-
- // draw darker LowerRight
- const Color aDarkColor(
- (sal_uInt8)(::std::max((sal_Int16)((sal_Int16)aCol.GetRed() - (sal_Int16)0x0040), (sal_Int16)0x0000)),
- (sal_uInt8)(::std::max((sal_Int16)((sal_Int16)aCol.GetGreen() - (sal_Int16)0x0040), (sal_Int16)0x0000)),
- (sal_uInt8)(::std::max((sal_Int16)((sal_Int16)aCol.GetBlue() - (sal_Int16)0x0040), (sal_Int16)0x0000)));
- pWrite->SetLineColor(aDarkColor);
- pWrite->DrawLine(Point(2, nHeight - 2), Point(nWidth - 2, nHeight - 2));
- pWrite->DrawLine(Point(nWidth - 2, 2), Point(nWidth - 2, nHeight - 3));
-
- // get rid of write access
- delete pWrite;
- }
-
- return aRetval;
-}
-
-Color SdrHdlColor::GetLuminance(const Color& rCol)
-{
- sal_uInt8 aLum = rCol.GetLuminance();
- Color aRetval(aLum, aLum, aLum);
- return aRetval;
-}
-
-void SdrHdlColor::CallColorChangeLink()
-{
- aColorChangeHdl.Call(this);
-}
-
-void SdrHdlColor::SetColor(Color aNew, sal_Bool bCallLink)
-{
- if(IsUseLuminance())
- aNew = GetLuminance(aNew);
-
- if(aMarkerColor != aNew)
- {
- // remember new color
- aMarkerColor = aNew;
-
- // create new display
- Touch();
-
- // tell about change
- if(bCallLink)
- CallColorChangeLink();
- }
-}
-
-void SdrHdlColor::SetSize(const Size& rNew)
-{
- if(rNew != aMarkerSize)
- {
- // remember new size
- aMarkerSize = rNew;
-
- // create new display
- Touch();
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// class SdrHdlGradient
-
-SdrHdlGradient::SdrHdlGradient(const Point& rRef1, const Point& rRef2, sal_Bool bGrad)
-: SdrHdl(rRef1, bGrad ? HDL_GRAD : HDL_TRNS),
- pColHdl1(NULL),
- pColHdl2(NULL),
- a2ndPos(rRef2),
- bGradient(bGrad)
-{
-}
-
-SdrHdlGradient::~SdrHdlGradient()
-{
-}
-
-void SdrHdlGradient::Set2ndPos(const Point& rPnt)
-{
- if(a2ndPos != rPnt)
- {
- // remember new position
- a2ndPos = rPnt;
-
- // create new display
- Touch();
- }
-}
-
-void SdrHdlGradient::CreateB2dIAObject()
-{
- // first throw away old one
- GetRidOfIAObject();
-
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- // striped line in between
- basegfx::B2DVector aVec(a2ndPos.X() - aPos.X(), a2ndPos.Y() - aPos.Y());
- double fVecLen = aVec.getLength();
- double fLongPercentArrow = (1.0 - 0.05) * fVecLen;
- double fHalfArrowWidth = (0.05 * 0.5) * fVecLen;
- aVec.normalize();
- basegfx::B2DVector aPerpend(-aVec.getY(), aVec.getX());
- sal_Int32 nMidX = (sal_Int32)(aPos.X() + aVec.getX() * fLongPercentArrow);
- sal_Int32 nMidY = (sal_Int32)(aPos.Y() + aVec.getY() * fLongPercentArrow);
- Point aMidPoint(nMidX, nMidY);
-
- basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
- basegfx::B2DPoint aMidPos(aMidPoint.X(), aMidPoint.Y());
-
- ::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayLineStriped(
- aPosition, aMidPos
- );
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
- pNewOverlayObject->setBaseColor(IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE));
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
-
- // arrowhead
- Point aLeft(aMidPoint.X() + (sal_Int32)(aPerpend.getX() * fHalfArrowWidth),
- aMidPoint.Y() + (sal_Int32)(aPerpend.getY() * fHalfArrowWidth));
- Point aRight(aMidPoint.X() - (sal_Int32)(aPerpend.getX() * fHalfArrowWidth),
- aMidPoint.Y() - (sal_Int32)(aPerpend.getY() * fHalfArrowWidth));
-
- basegfx::B2DPoint aPositionLeft(aLeft.X(), aLeft.Y());
- basegfx::B2DPoint aPositionRight(aRight.X(), aRight.Y());
- basegfx::B2DPoint aPosition2(a2ndPos.X(), a2ndPos.Y());
-
- pNewOverlayObject = new
- ::sdr::overlay::OverlayTriangle(
- aPositionLeft,
- aPosition2,
- aPositionRight,
- IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE)
- );
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
-}
-
-IMPL_LINK(SdrHdlGradient, ColorChangeHdl, SdrHdl*, /*pHdl*/)
-{
- if(GetObj())
- FromIAOToItem(GetObj(), sal_True, sal_True);
- return 0;
-}
-
-void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, sal_Bool bSetItemOnObject, sal_Bool bUndo)
-{
- // from IAO positions and colors to gradient
- const SfxItemSet& rSet = _pObj->GetMergedItemSet();
-
- GradTransformer aGradTransformer;
- GradTransGradient aOldGradTransGradient;
- GradTransGradient aGradTransGradient;
- GradTransVector aGradTransVector;
-
- String aString;
-
- aGradTransVector.maPositionA = basegfx::B2DPoint(GetPos().X(), GetPos().Y());
- aGradTransVector.maPositionB = basegfx::B2DPoint(Get2ndPos().X(), Get2ndPos().Y());
- if(pColHdl1)
- aGradTransVector.aCol1 = pColHdl1->GetColor();
- if(pColHdl2)
- aGradTransVector.aCol2 = pColHdl2->GetColor();
-
- if(IsGradient())
- aOldGradTransGradient.aGradient = ((XFillGradientItem&)rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue();
- else
- aOldGradTransGradient.aGradient = ((XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE)).GetGradientValue();
-
- // transform vector data to gradient
- aGradTransformer.VecToGrad(aGradTransVector, aGradTransGradient, aOldGradTransGradient, _pObj, bMoveSingleHandle, bMoveFirstHandle);
-
- if(bSetItemOnObject)
- {
- SdrModel* pModel = _pObj->GetModel();
- SfxItemSet aNewSet(pModel->GetItemPool());
-
- if(IsGradient())
- {
- aString = String();
- XFillGradientItem aNewGradItem(aString, aGradTransGradient.aGradient);
- aNewSet.Put(aNewGradItem);
- }
- else
- {
- aString = String();
- XFillFloatTransparenceItem aNewTransItem(aString, aGradTransGradient.aGradient);
- aNewSet.Put(aNewTransItem);
- }
-
- if(bUndo && pModel->IsUndoEnabled())
- {
- pModel->BegUndo(SVX_RESSTR(IsGradient() ? SIP_XA_FILLGRADIENT : SIP_XA_FILLTRANSPARENCE));
- pModel->AddUndo(pModel->GetSdrUndoFactory().CreateUndoAttrObject(*_pObj));
- pModel->EndUndo();
- }
-
- pObj->SetMergedItemSetAndBroadcast(aNewSet);
- }
-
- // back transformation, set values on pIAOHandle
- aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, _pObj);
-
- SetPos(Point(FRound(aGradTransVector.maPositionA.getX()), FRound(aGradTransVector.maPositionA.getY())));
- Set2ndPos(Point(FRound(aGradTransVector.maPositionB.getX()), FRound(aGradTransVector.maPositionB.getY())));
- if(pColHdl1)
- {
- pColHdl1->SetPos(Point(FRound(aGradTransVector.maPositionA.getX()), FRound(aGradTransVector.maPositionA.getY())));
- pColHdl1->SetColor(aGradTransVector.aCol1);
- }
- if(pColHdl2)
- {
- pColHdl2->SetPos(Point(FRound(aGradTransVector.maPositionB.getX()), FRound(aGradTransVector.maPositionB.getY())));
- pColHdl2->SetColor(aGradTransVector.aCol2);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrHdlLine::~SdrHdlLine() {}
-
-void SdrHdlLine::CreateB2dIAObject()
-{
- // first throw away old one
- GetRidOfIAObject();
-
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden() && pHdl1 && pHdl2)
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- basegfx::B2DPoint aPosition1(pHdl1->GetPos().X(), pHdl1->GetPos().Y());
- basegfx::B2DPoint aPosition2(pHdl2->GetPos().X(), pHdl2->GetPos().Y());
-
- ::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayLineStriped(
- aPosition1,
- aPosition2
- );
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- // color(?)
- pNewOverlayObject->setBaseColor(Color(COL_LIGHTRED));
-
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
- }
-}
-
-Pointer SdrHdlLine::GetPointer() const
-{
- return Pointer(POINTER_REFHAND);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrHdlBezWgt::~SdrHdlBezWgt() {}
-
-void SdrHdlBezWgt::CreateB2dIAObject()
-{
- // call parent
- SdrHdl::CreateB2dIAObject();
-
- // create lines
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- basegfx::B2DPoint aPosition1(pHdl1->GetPos().X(), pHdl1->GetPos().Y());
- basegfx::B2DPoint aPosition2(aPos.X(), aPos.Y());
-
- if(!aPosition1.equal(aPosition2))
- {
- ::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayLineStriped(
- aPosition1,
- aPosition2
- );
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- // line part is not hittable
- pNewOverlayObject->setHittable(sal_False);
-
- // color(?)
- pNewOverlayObject->setBaseColor(Color(COL_LIGHTBLUE));
-
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-E3dVolumeMarker::E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly)
-{
- aWireframePoly = rWireframePoly;
-}
-
-void E3dVolumeMarker::CreateB2dIAObject()
-{
- // create lines
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager() && aWireframePoly.count())
- {
- ::sdr::overlay::OverlayObject* pNewOverlayObject = new
- ::sdr::overlay::OverlayPolyPolygonStriped(aWireframePoly);
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- pNewOverlayObject->setBaseColor(Color(COL_BLACK));
-
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
- }
- }
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-ImpEdgeHdl::~ImpEdgeHdl()
-{
-}
-
-void ImpEdgeHdl::CreateB2dIAObject()
-{
- if(nObjHdlNum <= 1 && pObj)
- {
- // first throw away old one
- GetRidOfIAObject();
-
- BitmapColorIndex eColIndex = LightCyan;
- BitmapMarkerKind eKindOfMarker = Rect_7x7;
-
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- const SdrEdgeObj* pEdge = (SdrEdgeObj*)pObj;
-
- if(pEdge->GetConnectedNode(nObjHdlNum == 0) != NULL)
- eColIndex = LightRed;
-
- if(nPPntNum < 2)
- {
- // Handle with plus sign inside
- eKindOfMarker = Circ_7x7;
- }
-
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
-
- ::sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject(
- aPosition,
- eColIndex,
- eKindOfMarker);
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
- }
- }
- else
- {
- // call parent
- SdrHdl::CreateB2dIAObject();
- }
-}
-
-void ImpEdgeHdl::SetLineCode(SdrEdgeLineCode eCode)
-{
- if(eLineCode != eCode)
+ if(mbMouseOver != bNew)
{
// remember new value
- eLineCode = eCode;
+ mbMouseOver = bNew;
// create new display
Touch();
}
}
-Pointer ImpEdgeHdl::GetPointer() const
-{
- SdrEdgeObj* pEdge=PTR_CAST(SdrEdgeObj,pObj);
- if (pEdge==NULL)
- return SdrHdl::GetPointer();
- if (nObjHdlNum<=1)
- return Pointer(POINTER_MOVEPOINT); //Pointer(POINTER_DRAW_CONNECT);
- if (IsHorzDrag())
- return Pointer(POINTER_ESIZE);
- else
- return Pointer(POINTER_SSIZE);
-}
-
-sal_Bool ImpEdgeHdl::IsHorzDrag() const
-{
- SdrEdgeObj* pEdge=PTR_CAST(SdrEdgeObj,pObj);
- if (pEdge==NULL)
- return sal_False;
- if (nObjHdlNum<=1)
- return sal_False;
-
- SdrEdgeKind eEdgeKind = ((SdrEdgeKindItem&)(pEdge->GetObjectItem(SDRATTR_EDGEKIND))).GetValue();
-
- const SdrEdgeInfoRec& rInfo=pEdge->aEdgeInfo;
- if (eEdgeKind==SDREDGE_ORTHOLINES || eEdgeKind==SDREDGE_BEZIER)
- {
- return !rInfo.ImpIsHorzLine(eLineCode,*pEdge->pEdgeTrack);
- }
- else if (eEdgeKind==SDREDGE_THREELINES)
- {
- long nWink=nObjHdlNum==2 ? rInfo.nAngle1 : rInfo.nAngle2;
- if (nWink==0 || nWink==18000)
- return sal_True;
- else
- return sal_False;
- }
- return sal_False;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-ImpMeasureHdl::~ImpMeasureHdl()
-{
-}
-
-void ImpMeasureHdl::CreateB2dIAObject()
-{
- // first throw away old one
- GetRidOfIAObject();
-
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- BitmapColorIndex eColIndex = LightCyan;
- BitmapMarkerKind eKindOfMarker = Rect_9x9;
-
- if(nObjHdlNum > 1)
- {
- eKindOfMarker = Rect_7x7;
- }
-
- if(bSelect)
- {
- eColIndex = Cyan;
- }
-
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
-
- ::sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject(
- aPosition,
- eColIndex,
- eKindOfMarker);
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
- }
-}
-
-Pointer ImpMeasureHdl::GetPointer() const
-{
- switch (nObjHdlNum)
- {
- case 0: case 1: return Pointer(POINTER_HAND);
- case 2: case 3: return Pointer(POINTER_MOVEPOINT);
- case 4: case 5: return SdrHdl::GetPointer(); // wird dann entsprechend gedreht
- } // switch
- return Pointer(POINTER_NOTALLOWED);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-ImpTextframeHdl::ImpTextframeHdl(const Rectangle& rRect) :
- SdrHdl(rRect.TopLeft(),HDL_MOVE),
- maRect(rRect)
-{
-}
-
-void ImpTextframeHdl::CreateB2dIAObject()
-{
- // first throw away old one
- GetRidOfIAObject();
-
- if(pHdlList)
- {
- SdrMarkView* pView = pHdlList->GetView();
-
- if(pView && !pView->areMarkHandlesHidden())
- {
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- const basegfx::B2DPoint aTopLeft(maRect.Left(), maRect.Top());
- const basegfx::B2DPoint aBottomRight(maRect.Right(), maRect.Bottom());
- const svtools::ColorConfig aColorConfig;
- const Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
-
- ::sdr::overlay::OverlayHatchRect* pNewOverlayObject = new ::sdr::overlay::OverlayHatchRect(
- aTopLeft,
- aBottomRight,
- aHatchCol,
- 3.0,
- 3.0,
- 45 * F_PI180,
- nDrehWink * -F_PI18000);
- pNewOverlayObject->setHittable(false);
-
- // OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- rPageWindow.GetOverlayManager()->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
- }
- }
- }
- }
- }
- }
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
-
-class ImpSdrHdlListSorter: public ContainerSorter {
-public:
- ImpSdrHdlListSorter(Container& rNewCont): ContainerSorter(rNewCont) {}
- virtual int Compare(const void* pElem1, const void* pElem2) const;
-};
-
-int ImpSdrHdlListSorter::Compare(const void* pElem1, const void* pElem2) const
-{
- SdrHdlKind eKind1=((SdrHdl*)pElem1)->GetKind();
- SdrHdlKind eKind2=((SdrHdl*)pElem2)->GetKind();
- // Level 1: Erst normale Handles, dann Glue, dann User, dann Plushandles, dann Retpunkt-Handles
- unsigned n1=1;
- unsigned n2=1;
- if (eKind1!=eKind2)
- {
- if (eKind1==HDL_REF1 || eKind1==HDL_REF2 || eKind1==HDL_MIRX) n1=5;
- else if (eKind1==HDL_GLUE) n1=2;
- else if (eKind1==HDL_USER) n1=3;
- else if (eKind1==HDL_SMARTTAG) n1=0;
- if (eKind2==HDL_REF1 || eKind2==HDL_REF2 || eKind2==HDL_MIRX) n2=5;
- else if (eKind2==HDL_GLUE) n2=2;
- else if (eKind2==HDL_USER) n2=3;
- else if (eKind2==HDL_SMARTTAG) n2=0;
- }
- if (((SdrHdl*)pElem1)->IsPlusHdl()) n1=4;
- if (((SdrHdl*)pElem2)->IsPlusHdl()) n2=4;
- if (n1==n2)
- {
- // Level 2: PageView (Pointer)
- SdrPageView* pPV1=((SdrHdl*)pElem1)->GetPageView();
- SdrPageView* pPV2=((SdrHdl*)pElem2)->GetPageView();
- if (pPV1==pPV2)
- {
- // Level 3: Position (x+y)
- SdrObject* pObj1=((SdrHdl*)pElem1)->GetObj();
- SdrObject* pObj2=((SdrHdl*)pElem2)->GetObj();
- if (pObj1==pObj2)
- {
- sal_uInt32 nNum1=((SdrHdl*)pElem1)->GetObjHdlNum();
- sal_uInt32 nNum2=((SdrHdl*)pElem2)->GetObjHdlNum();
- if (nNum1==nNum2)
- { // #48763#
- if (eKind1==eKind2)
- return (long)pElem1<(long)pElem2 ? -1 : 1; // Notloesung, um immer die gleiche Sortierung zu haben
- return (sal_uInt16)eKind1<(sal_uInt16)eKind2 ? -1 : 1;
- }
- else
- return nNum1<nNum2 ? -1 : 1;
- }
- else
- {
- return (long)pObj1<(long)pObj2 ? -1 : 1;
- }
- }
- else
- {
- return (long)pPV1<(long)pPV2 ? -1 : 1;
- }
- }
- else
- {
- return n1<n2 ? -1 : 1;
- }
-}
-
-SdrMarkView* SdrHdlList::GetView() const
-{
- return pView;
-}
-
// #105678# Help struct for re-sorting handles
+
struct ImplHdlAndIndex
{
SdrHdl* mpHdl;
@@ -1812,7 +986,9 @@ extern "C" int __LOADONCALLAPI ImplSortHdlFunc( const void* pVoid1, const void*
if(p1->mpHdl->GetObj() == p2->mpHdl->GetObj())
{
- if(p1->mpHdl->GetObj() && p1->mpHdl->GetObj()->ISA(SdrPathObj))
+ const SdrPathObj* pSdrPathObj = dynamic_cast< const SdrPathObj* >(p1->mpHdl->GetObj());
+
+ if(pSdrPathObj)
{
// same object and a path object
if((p1->mpHdl->GetKind() == HDL_POLY || p1->mpHdl->GetKind() == HDL_BWGT)
@@ -1854,8 +1030,8 @@ extern "C" int __LOADONCALLAPI ImplSortHdlFunc( const void* pVoid1, const void*
else
{
// different objects, use OrdNum for sort
- const sal_uInt32 nOrdNum1 = p1->mpHdl->GetObj()->GetOrdNum();
- const sal_uInt32 nOrdNum2 = p2->mpHdl->GetObj()->GetOrdNum();
+ const sal_uInt32 nOrdNum1 = p1->mpHdl->GetObj()->GetNavigationPosition();
+ const sal_uInt32 nOrdNum2 = p2->mpHdl->GetObj()->GetNavigationPosition();
if(nOrdNum1 < nOrdNum2)
{
@@ -1880,49 +1056,94 @@ extern "C" int __LOADONCALLAPI ImplSortHdlFunc( const void* pVoid1, const void*
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-// #97016# II
-void SdrHdlList::TravelFocusHdl(sal_Bool bForward)
+void SdrHdlList::Timeout()
+{
+ for(sal_uInt32 a(0); a < maList.size(); a++)
+ {
+ maList[a]->CreateB2dIAObject();
+ }
+}
+
+void SdrHdlList::SdrHdlVisualisationChanged()
+{
+ SetTimeout(1);
+ Start();
+}
+
+SdrHdlList::SdrHdlList(SdrMarkView& rV)
+: boost::noncopyable(),
+ Timer(),
+ mnFocusIndex(CONTAINER_ENTRY_NOTFOUND),
+ mrView(rV),
+ maList(),
+ mnHdlSize(3),
+ mbRotateShear(false),
+ mbDistortShear(false),
+ mbMoveOutside(false),
+ mbFineHandles(false)
+{
+}
+
+SdrHdlList::~SdrHdlList()
+{
+ Clear();
+}
+
+SdrHdl* SdrHdlList::GetHdlByIndex(sal_uInt32 nNum) const
+{
+ if(nNum < maList.size())
+ {
+ return *(maList.begin() + nNum);
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+void SdrHdlList::TravelFocusHdl(bool bForward)
{
// security correction
- if(mnFocusIndex != CONTAINER_ENTRY_NOTFOUND && mnFocusIndex >= GetHdlCount())
+ if(CONTAINER_ENTRY_NOTFOUND != mnFocusIndex && mnFocusIndex >= GetHdlCount())
+ {
mnFocusIndex = CONTAINER_ENTRY_NOTFOUND;
+ }
- if(aList.Count())
+ if(GetHdlCount())
{
// take care of old handle
- const sal_uIntPtr nOldHdlNum(mnFocusIndex);
- SdrHdl* pOld = GetHdl(nOldHdlNum);
- //SDOsal_Bool bRefresh(sal_False);
+ const sal_uInt32 nOldHdlNum(mnFocusIndex);
+ SdrHdl* pOld = CONTAINER_ENTRY_NOTFOUND != nOldHdlNum ? GetHdlByIndex(nOldHdlNum) : 0;
if(pOld)
{
// switch off old handle
mnFocusIndex = CONTAINER_ENTRY_NOTFOUND;
pOld->Touch();
- //SDObRefresh = sal_True;
}
// #105678# Alloc pointer array for sorted handle list
- ImplHdlAndIndex* pHdlAndIndex = new ImplHdlAndIndex[aList.Count()];
+ ImplHdlAndIndex* pHdlAndIndex = new ImplHdlAndIndex[GetHdlCount()];
// #105678# build sorted handle list
- sal_uInt32 a;
- for( a = 0; a < aList.Count(); a++)
+ sal_uInt32 a(0);
+
+ for(a = 0; a < GetHdlCount(); a++)
{
- pHdlAndIndex[a].mpHdl = (SdrHdl*)aList.GetObject(a);
+ pHdlAndIndex[a].mpHdl = GetHdlByIndex(a);
pHdlAndIndex[a].mnIndex = a;
}
// #105678# qsort all entries
- qsort(pHdlAndIndex, aList.Count(), sizeof(ImplHdlAndIndex), ImplSortHdlFunc);
+ qsort(pHdlAndIndex, GetHdlCount(), sizeof(ImplHdlAndIndex), ImplSortHdlFunc);
// #105678# look for old num in sorted array
- sal_uIntPtr nOldHdl(nOldHdlNum);
+ sal_uInt32 nOldHdl(nOldHdlNum);
if(nOldHdlNum != CONTAINER_ENTRY_NOTFOUND)
{
- for(a = 0; a < aList.Count(); a++)
+ for(a = 0; a < GetHdlCount(); a++)
{
if(pHdlAndIndex[a].mpHdl == pOld)
{
@@ -1933,14 +1154,14 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward)
}
// #105678# build new HdlNum
- sal_uIntPtr nNewHdl(nOldHdl);
+ sal_uInt32 nNewHdl(nOldHdl);
// #105678# do the focus travel
if(bForward)
{
if(nOldHdl != CONTAINER_ENTRY_NOTFOUND)
{
- if(nOldHdl == aList.Count() - 1)
+ if(nOldHdl == GetHdlCount() - 1)
{
// end forward run
nNewHdl = CONTAINER_ENTRY_NOTFOUND;
@@ -1962,7 +1183,7 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward)
if(nOldHdl == CONTAINER_ENTRY_NOTFOUND)
{
// start backward run at last entry
- nNewHdl = aList.Count() - 1;
+ nNewHdl = GetHdlCount() - 1;
}
else
@@ -1988,9 +1209,9 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward)
{
SdrHdl* pNew = pHdlAndIndex[nNewHdl].mpHdl;
- for(a = 0; a < aList.Count(); a++)
+ for(a = 0; a < GetHdlCount(); a++)
{
- if((SdrHdl*)aList.GetObject(a) == pNew)
+ if(GetHdlByIndex(a) == pNew)
{
nNewHdlNum = a;
break;
@@ -2002,12 +1223,11 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward)
if(nOldHdlNum != nNewHdlNum)
{
mnFocusIndex = nNewHdlNum;
- SdrHdl* pNew = GetHdl(mnFocusIndex);
+ SdrHdl* pNew = GetHdlByIndex(mnFocusIndex);
if(pNew)
{
pNew->Touch();
- //SDObRefresh = sal_True;
}
}
@@ -2018,10 +1238,14 @@ void SdrHdlList::TravelFocusHdl(sal_Bool bForward)
SdrHdl* SdrHdlList::GetFocusHdl() const
{
- if(mnFocusIndex != CONTAINER_ENTRY_NOTFOUND && mnFocusIndex < GetHdlCount())
- return GetHdl(mnFocusIndex);
+ if(CONTAINER_ENTRY_NOTFOUND != mnFocusIndex && mnFocusIndex < GetHdlCount())
+ {
+ return GetHdlByIndex(mnFocusIndex);
+ }
else
- return 0L;
+ {
+ return 0;
+ }
}
void SdrHdlList::SetFocusHdl(SdrHdl* pNew)
@@ -2032,30 +1256,21 @@ void SdrHdlList::SetFocusHdl(SdrHdl* pNew)
if(!pActual || pActual != pNew)
{
- sal_uIntPtr nNewHdlNum = GetHdlNum(pNew);
+ const sal_uInt32 nNewHdlNum(GetHdlNum(pNew));
- if(nNewHdlNum != CONTAINER_ENTRY_NOTFOUND)
+ if(CONTAINER_ENTRY_NOTFOUND != nNewHdlNum)
{
- //SDOsal_Bool bRefresh(sal_False);
mnFocusIndex = nNewHdlNum;
if(pActual)
{
pActual->Touch();
- //SDObRefresh = sal_True;
}
if(pNew)
{
pNew->Touch();
- //SDObRefresh = sal_True;
}
-
- //OLMif(bRefresh)
- //OLM{
- //OLM if(pView)
- //OLM pView->RefreshAllIAOManagers();
- //OLM}
}
}
}
@@ -2073,101 +1288,172 @@ void SdrHdlList::ResetFocusHdl()
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrHdlList::SdrHdlList(SdrMarkView* pV)
-: mnFocusIndex(CONTAINER_ENTRY_NOTFOUND),
- pView(pV),
- aList(1024,32,32)
-{
- nHdlSize = 3;
- bRotateShear = sal_False;
- bMoveOutside = sal_False;
- bDistortShear = sal_False;
- bFineHandles = sal_False;
-}
-
-SdrHdlList::~SdrHdlList()
-{
- Clear();
-}
-
void SdrHdlList::SetHdlSize(sal_uInt16 nSiz)
{
- if(nHdlSize != nSiz)
+ if(GetHdlSize() != nSiz)
{
// remember new value
- nHdlSize = nSiz;
+ mnHdlSize = nSiz;
// propagate change to IAOs
- for(sal_uInt32 i=0; i<GetHdlCount(); i++)
+ for(sal_uInt32 i(0); i < GetHdlCount(); i++)
{
- SdrHdl* pHdl = GetHdl(i);
+ SdrHdl* pHdl = GetHdlByIndex(i);
pHdl->Touch();
}
}
}
-void SdrHdlList::SetMoveOutside(sal_Bool bOn)
+void SdrHdlList::SetMoveOutside(bool bOn)
{
- if(bMoveOutside != bOn)
+ if(mbMoveOutside != bOn)
{
// remember new value
- bMoveOutside = bOn;
+ mbMoveOutside = bOn;
// propagate change to IAOs
- for(sal_uInt32 i=0; i<GetHdlCount(); i++)
+ for(sal_uInt32 i(0); i < GetHdlCount(); i++)
{
- SdrHdl* pHdl = GetHdl(i);
+ SdrHdl* pHdl = GetHdlByIndex(i);
pHdl->Touch();
}
}
}
-void SdrHdlList::SetRotateShear(sal_Bool bOn)
+void SdrHdlList::SetFineHdl(bool bOn)
{
- bRotateShear = bOn;
-}
-
-void SdrHdlList::SetDistortShear(sal_Bool bOn)
-{
- bDistortShear = bOn;
-}
-
-void SdrHdlList::SetFineHdl(sal_Bool bOn)
-{
- if(bFineHandles != bOn)
+ if(mbFineHandles != bOn)
{
// remember new state
- bFineHandles = bOn;
+ mbFineHandles = bOn;
// propagate change to IAOs
- for(sal_uInt32 i=0; i<GetHdlCount(); i++)
- {
- SdrHdl* pHdl = GetHdl(i);
+ for(sal_uInt32 i(0); i < GetHdlCount(); i++)
+ {
+ SdrHdl* pHdl = GetHdlByIndex(i);
pHdl->Touch();
}
}
}
-SdrHdl* SdrHdlList::RemoveHdl(sal_uIntPtr nNum)
+void SdrHdlList::Clear()
{
- SdrHdl* pRetval = (SdrHdl*)aList.Remove(nNum);
+ // keep a copy ad clear early to avoid that the delete calls
+ // for the SdrHdl have to iterate over the list to remove themselves
+ const SdrHdlContainerType aCopy(maList);
+ maList.clear();
- return pRetval;
+ for(sal_uInt32 i(0); i < aCopy.size(); i++)
+ {
+ delete aCopy[i];
+ }
+
+ mbRotateShear = false;
+ mbDistortShear = false;
}
-void SdrHdlList::Clear()
+namespace
{
- for (sal_uIntPtr i=0; i<GetHdlCount(); i++)
+ struct SdrHdlComparator
{
- SdrHdl* pHdl=GetHdl(i);
- delete pHdl;
- }
- aList.Clear();
+ bool operator()(const SdrHdl* pA, const SdrHdl* pB)
+ {
+ OSL_ENSURE(pA && pB, "SdrHdlComparator: empty pointer (!)");
+ const SdrHdlKind eKind1(pA->GetKind());
+ const SdrHdlKind eKind2(pB->GetKind());
+
+ // Level 1: Erst normale Handles, dann Glue, dann User, dann Plushandles, dann Retpunkt-Handles
+ unsigned n1(1);
+ unsigned n2(1);
+
+ if(eKind1 != eKind2)
+ {
+ if(HDL_REF1 == eKind1 || HDL_REF2 == eKind1 || HDL_MIRX == eKind1)
+ {
+ n1 = 5;
+ }
+ else if(HDL_GLUE == eKind1)
+ {
+ n1 = 2;
+ }
+ else if(HDL_USER == eKind1)
+ {
+ n1 = 3;
+ }
+ else if(HDL_SMARTTAG == eKind1)
+ {
+ n1 = 0;
+ }
+
+ if(HDL_REF1 == eKind2 || HDL_REF2 == eKind2 || HDL_MIRX == eKind2)
+ {
+ n2 = 5;
+ }
+ else if(HDL_GLUE == eKind2)
+ {
+ n2 = 2;
+ }
+ else if(HDL_USER == eKind2)
+ {
+ n2 = 3;
+ }
+ else if(HDL_SMARTTAG == eKind2)
+ {
+ n2 = 0;
+ }
+ }
+
+ if(pA->IsPlusHdl())
+ {
+ n1 = 4;
+ }
- bRotateShear=sal_False;
- bDistortShear=sal_False;
+ if(pB->IsPlusHdl())
+ {
+ n2 = 4;
+ }
+
+ if(n1 == n2)
+ {
+ // Level 2: Position (x+y)
+ const SdrObject* pObj1 = pA->GetObj();
+ const SdrObject* pObj2 = pB->GetObj();
+
+ if(pObj1 == pObj2)
+ {
+ const sal_uInt32 nNum1(pA->GetObjHdlNum());
+ const sal_uInt32 nNum2(pB->GetObjHdlNum());
+
+ if(nNum1 == nNum2)
+ {
+ // #48763#
+ if(eKind1 == eKind2)
+ {
+ return pA < pB; // Notloesung, um immer die gleiche Sortierung zu haben
+ }
+ else
+ {
+ return (sal_uInt16)eKind1 < (sal_uInt16)eKind2;
+ }
+ }
+ else
+ {
+ return nNum1 < nNum2;
+ }
+ }
+ else
+ {
+ return pObj1 < pObj2;
+ }
+ }
+ else
+ {
+ return n1 < n2;
+ }
+
+ return pA->getPosition().getX() < pB->getPosition().getX();
+ }
+ };
}
void SdrHdlList::Sort()
@@ -2175,102 +1461,664 @@ void SdrHdlList::Sort()
// #97016# II: remember current focused handle
SdrHdl* pPrev = GetFocusHdl();
- ImpSdrHdlListSorter aSort(aList);
- aSort.DoSort();
+ ::std::sort(maList.begin(), maList.end(), SdrHdlComparator());
// #97016# II: get now and compare
SdrHdl* pNow = GetFocusHdl();
if(pPrev != pNow)
{
- //SDOsal_Bool bRefresh(sal_False);
-
if(pPrev)
{
pPrev->Touch();
- //SDObRefresh = sal_True;
}
if(pNow)
{
pNow->Touch();
- //SDObRefresh = sal_True;
}
}
}
-sal_uIntPtr SdrHdlList::GetHdlNum(const SdrHdl* pHdl) const
+sal_uInt32 SdrHdlList::GetHdlNum(const SdrHdl* pHdl) const
{
- if (pHdl==NULL)
+ if(!pHdl)
+ {
return CONTAINER_ENTRY_NOTFOUND;
- sal_uIntPtr nPos=aList.GetPos(pHdl);
- return nPos;
+ }
+
+ sal_uInt32 a(0);
+
+ for(SdrHdlContainerType::const_iterator aCandidate(maList.begin());
+ aCandidate != maList.end(); a++, aCandidate++)
+ {
+ if(*aCandidate == pHdl)
+ {
+ return a;
+ }
+ }
+
+ return CONTAINER_ENTRY_NOTFOUND;
}
-void SdrHdlList::AddHdl(SdrHdl* pHdl, sal_Bool bAtBegin)
+SdrHdl* SdrHdlList::IsHdlListHit(const basegfx::B2DPoint& rPosition, SdrHdl* pHdl0) const
{
- if (pHdl!=NULL)
+ SdrHdl* pRet = 0;
+ const sal_uInt32 nAnz(GetHdlCount());
+ sal_uInt32 nNum(nAnz);
+
+ while(nNum && !pRet)
+ {
+ nNum--;
+ SdrHdl* pHdl = GetHdlByIndex(nNum);
+
+ if(pHdl->IsHdlHit(rPosition))
+ {
+ pRet = pHdl;
+ }
+ }
+
+ return pRet;
+}
+
+SdrHdl* SdrHdlList::GetHdlByKind(SdrHdlKind eKind1) const
+{
+ for(sal_uInt32 i(0); i < GetHdlCount(); i++)
{
- if (bAtBegin)
+ SdrHdl* pHdl = GetHdlByIndex(i);
+
+ if(pHdl->GetKind() == eKind1)
{
- aList.Insert(pHdl,sal_uIntPtr(0));
+ return pHdl;
+ }
+ }
+
+ return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// class SdrHdlColor
+
+SdrHdlColor::SdrHdlColor(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DPoint& rRef,
+ Color aCol,
+ const Size& rSize,
+ bool bLum)
+: SdrHdl(rHdlList, &rSdrHdlObject, HDL_COLR, rRef),
+ aMarkerSize(rSize),
+ bUseLuminance(bLum)
+{
+ if(IsUseLuminance())
+ aCol = GetLuminance(aCol);
+
+ // remember color
+ aMarkerColor = aCol;
+}
+
+SdrHdlColor::~SdrHdlColor()
+{
+}
+
+void SdrHdlColor::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ const Bitmap aBmpCol(CreateColorDropper(aMarkerColor));
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = new
+ ::sdr::overlay::OverlayBitmapEx(
+ maPosition,
+ BitmapEx(aBmpCol),
+ (sal_uInt16)(aBmpCol.GetSizePixel().Width() - 1) >> 1,
+ (sal_uInt16)(aBmpCol.GetSizePixel().Height() - 1) >> 1
+ );
+
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+}
+
+Bitmap SdrHdlColor::CreateColorDropper(Color aCol)
+{
+ // get the Bitmap
+ Bitmap aRetval(aMarkerSize, 24);
+ aRetval.Erase(aCol);
+
+ // get write access
+ BitmapWriteAccess* pWrite = aRetval.AcquireWriteAccess();
+ DBG_ASSERT(pWrite, "Got NO write access to a new Bitmap !!!");
+
+ if(pWrite)
+ {
+ // draw outer border
+ sal_Int32 nWidth = aMarkerSize.Width();
+ sal_Int32 nHeight = aMarkerSize.Height();
+
+ pWrite->SetLineColor(Color(COL_LIGHTGRAY));
+ pWrite->DrawLine(Point(0, 0), Point(0, nHeight - 1));
+ pWrite->DrawLine(Point(1, 0), Point(nWidth - 1, 0));
+ pWrite->SetLineColor(Color(COL_GRAY));
+ pWrite->DrawLine(Point(1, nHeight - 1), Point(nWidth - 1, nHeight - 1));
+ pWrite->DrawLine(Point(nWidth - 1, 1), Point(nWidth - 1, nHeight - 2));
+
+ // draw lighter UpperLeft
+ const Color aLightColor(
+ (sal_uInt8)(::std::min((sal_Int16)((sal_Int16)aCol.GetRed() + (sal_Int16)0x0040), (sal_Int16)0x00ff)),
+ (sal_uInt8)(::std::min((sal_Int16)((sal_Int16)aCol.GetGreen() + (sal_Int16)0x0040), (sal_Int16)0x00ff)),
+ (sal_uInt8)(::std::min((sal_Int16)((sal_Int16)aCol.GetBlue() + (sal_Int16)0x0040), (sal_Int16)0x00ff)));
+ pWrite->SetLineColor(aLightColor);
+ pWrite->DrawLine(Point(1, 1), Point(1, nHeight - 2));
+ pWrite->DrawLine(Point(2, 1), Point(nWidth - 2, 1));
+
+ // draw darker LowerRight
+ const Color aDarkColor(
+ (sal_uInt8)(::std::max((sal_Int16)((sal_Int16)aCol.GetRed() - (sal_Int16)0x0040), (sal_Int16)0x0000)),
+ (sal_uInt8)(::std::max((sal_Int16)((sal_Int16)aCol.GetGreen() - (sal_Int16)0x0040), (sal_Int16)0x0000)),
+ (sal_uInt8)(::std::max((sal_Int16)((sal_Int16)aCol.GetBlue() - (sal_Int16)0x0040), (sal_Int16)0x0000)));
+ pWrite->SetLineColor(aDarkColor);
+ pWrite->DrawLine(Point(2, nHeight - 2), Point(nWidth - 2, nHeight - 2));
+ pWrite->DrawLine(Point(nWidth - 2, 2), Point(nWidth - 2, nHeight - 3));
+
+ // get rid of write access
+ delete pWrite;
+ }
+
+ return aRetval;
+}
+
+Color SdrHdlColor::GetLuminance(const Color& rCol)
+{
+ sal_uInt8 aLum = rCol.GetLuminance();
+ Color aRetval(aLum, aLum, aLum);
+ return aRetval;
+}
+
+void SdrHdlColor::CallColorChangeLink()
+{
+ aColorChangeHdl.Call(this);
+}
+
+void SdrHdlColor::SetColor(Color aNew, bool bCallLink)
+{
+ if(IsUseLuminance())
+ aNew = GetLuminance(aNew);
+
+ if(aMarkerColor != aNew)
+ {
+ // remember new color
+ aMarkerColor = aNew;
+
+ // create new display
+ Touch();
+
+ // tell about change
+ if(bCallLink)
+ CallColorChangeLink();
+ }
+}
+
+void SdrHdlColor::SetSize(const Size& rNew)
+{
+ if(rNew != aMarkerSize)
+ {
+ // remember new size
+ aMarkerSize = rNew;
+
+ // create new display
+ Touch();
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// class SdrHdlGradient
+
+SdrHdlGradient::SdrHdlGradient(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ SdrHdlColor& rSdrHdlColor1,
+ SdrHdlColor& rSdrHdlColor2,
+ bool bGrad)
+: SdrHdl(rHdlList, &rSdrHdlObject, bGrad ? HDL_GRAD : HDL_TRNS, rSdrHdlColor1.getPosition()),
+ mrColHdl1(rSdrHdlColor1),
+ mrColHdl2(rSdrHdlColor2),
+ bGradient(bGrad)
+{
+}
+
+SdrHdlGradient::~SdrHdlGradient()
+{
+}
+
+void SdrHdlGradient::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ // striped line in between
+ basegfx::B2DVector aVec(mrColHdl2.getPosition() - mrColHdl1.getPosition());
+ double fVecLen = aVec.getLength();
+ double fLongPercentArrow = (1.0 - 0.05) * fVecLen;
+ double fHalfArrowWidth = (0.05 * 0.5) * fVecLen;
+
+ aVec.normalize();
+
+ const basegfx::B2DVector aPerpend(-aVec.getY(), aVec.getX());
+ const basegfx::B2DPoint aMidPos(mrColHdl1.getPosition() + (aVec * fLongPercentArrow));
+
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = new
+ ::sdr::overlay::OverlayLineStriped(
+ mrColHdl1.getPosition(),
+ aMidPos);
+
+ pNewOverlayObject->setBaseColor(IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE));
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+
+ // arrowhead
+ const basegfx::B2DPoint aPositionLeft(aMidPos + (aPerpend * fHalfArrowWidth));
+ const basegfx::B2DPoint aPositionRight(aMidPos- (aPerpend * fHalfArrowWidth));
+
+ pNewOverlayObject = new
+ ::sdr::overlay::OverlayTriangle(
+ aPositionLeft,
+ mrColHdl2.getPosition(),
+ aPositionRight,
+ IsGradient() ? Color(COL_BLACK) : Color(COL_BLUE));
+
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+}
+
+IMPL_LINK(SdrHdlGradient, ColorChangeHdl, SdrHdl*, /*pHdl*/)
+{
+ FromIAOToItem(true, true);
+
+ return 0;
+}
+
+const basegfx::B2DPoint& SdrHdlGradient::getPosition() const
+{
+ return mrColHdl1.getPosition();
+}
+
+void SdrHdlGradient::setPosition(const basegfx::B2DPoint& rNew)
+{
+ // call parent
+ SdrHdl::setPosition(rNew);
+
+ if(rNew != mrColHdl1.getPosition())
+ {
+ // remember new position
+ mrColHdl1.setPosition(rNew);
+
+ // create new display
+ Touch();
+ }
+}
+
+const basegfx::B2DPoint& SdrHdlGradient::get2ndPosition() const
+{
+ return mrColHdl2.getPosition();
+}
+
+void SdrHdlGradient::set2ndPosition(const basegfx::B2DPoint& rNew)
+{
+ if(rNew != mrColHdl2.getPosition())
+ {
+ // remember new position
+ mrColHdl2.setPosition(rNew);
+
+ // create new display
+ Touch();
+ }
+}
+
+void SdrHdlGradient::FromIAOToItem(bool bSetItemOnObject, bool bUndo)
+{
+ SdrObject* pTarget = const_cast< SdrObject* >(GetObj());
+
+ if(pTarget)
+ {
+ // from IAO positions and colors to gradient
+ const SfxItemSet& rSet = pTarget->GetMergedItemSet();
+ GradTransformer aGradTransformer;
+ GradTransGradient aOldGradTransGradient;
+ GradTransGradient aGradTransGradient;
+ GradTransVector aGradTransVector;
+ String aString;
+
+ aGradTransVector.maPositionA = mrColHdl1.getPosition();
+ aGradTransVector.maPositionB = mrColHdl2.getPosition();
+ aGradTransVector.aCol1 = mrColHdl1.GetColor();
+ aGradTransVector.aCol2 = mrColHdl2.GetColor();
+
+ if(IsGradient())
+ {
+ aOldGradTransGradient.aGradient = ((XFillGradientItem&)rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue();
}
else
{
- aList.Insert(pHdl,CONTAINER_APPEND);
+ aOldGradTransGradient.aGradient = ((XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE)).GetGradientValue();
+ }
+
+ // transform vector data to gradient
+ aGradTransformer.VecToGrad(aGradTransVector, aGradTransGradient, aOldGradTransGradient, pTarget, bMoveSingleHandle, bMoveFirstHandle);
+
+ if(bSetItemOnObject)
+ {
+ SfxItemSet aNewSet(pTarget->GetObjectItemPool());
+
+ if(IsGradient())
+ {
+ aString = String();
+ XFillGradientItem aNewGradItem(aString, aGradTransGradient.aGradient);
+ aNewSet.Put(aNewGradItem);
+ }
+ else
+ {
+ aString = String();
+ XFillFloatTransparenceItem aNewTransItem(aString, aGradTransGradient.aGradient);
+ aNewSet.Put(aNewTransItem);
+ }
+
+ SdrModel& rSdrModel = pTarget->getSdrModelFromSdrObject();
+
+ if(bUndo && rSdrModel.IsUndoEnabled())
+ {
+ rSdrModel.BegUndo(SVX_RESSTR(IsGradient() ? SIP_XA_FILLGRADIENT : SIP_XA_FILLTRANSPARENCE));
+ rSdrModel.AddUndo(rSdrModel.GetSdrUndoFactory().CreateUndoAttrObject(*pTarget));
+ rSdrModel.EndUndo();
+ }
+
+ pTarget->SetMergedItemSetAndBroadcast(aNewSet);
+ }
+
+ // back transformation, set values on pIAOHandle
+ aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, pTarget);
+
+ setPosition(aGradTransVector.maPositionA);
+ mrColHdl1.setPosition(aGradTransVector.maPositionA);
+ mrColHdl2.setPosition(aGradTransVector.maPositionB);
+ mrColHdl1.SetColor(aGradTransVector.aCol1);
+ mrColHdl2.SetColor(aGradTransVector.aCol2);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrHdlLine::~SdrHdlLine()
+{
+}
+
+void SdrHdlLine::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ if(pHdl1 && pHdl2)
+ {
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = new
+ ::sdr::overlay::OverlayLineStriped(
+ pHdl1->getPosition(),
+ pHdl2->getPosition());
+
+ pNewOverlayObject->setBaseColor(Color(COL_LIGHTRED));
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+ }
+}
+
+Pointer SdrHdlLine::GetPointer() const
+{
+ return Pointer(POINTER_REFHAND);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrHdlBezWgt::~SdrHdlBezWgt()
+{
+}
+
+void SdrHdlBezWgt::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ // call parent, create control point handle
+ SdrHdl::CreateB2dIAObject(rOverlayManager);
+
+ // create striped line part
+ if(pHdl1 && !pHdl1->getPosition().equal(maPosition))
+ {
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = new
+ ::sdr::overlay::OverlayLineStriped(
+ pHdl1->getPosition(),
+ maPosition
+ );
+
+ // line part is not hittable
+ pNewOverlayObject->setHittable(false);
+
+ // color(?)
+ pNewOverlayObject->setBaseColor(Color(COL_LIGHTBLUE));
+
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+E3dVolumeMarker::E3dVolumeMarker(
+ SdrHdlList& rHdlList,
+ const SdrObject* pSdrHdlObject,
+ const basegfx::B2DPolyPolygon& rWireframePoly)
+: SdrHdl(rHdlList, pSdrHdlObject),
+ aWireframePoly(rWireframePoly)
+{
+}
+
+E3dVolumeMarker::~E3dVolumeMarker()
+{
+}
+
+void E3dVolumeMarker::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = new
+ ::sdr::overlay::OverlayPolyPolygonStriped(aWireframePoly);
+
+ pNewOverlayObject->setBaseColor(Color(COL_BLACK));
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ImpEdgeHdl::~ImpEdgeHdl()
+{
+}
+
+void ImpEdgeHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ const SdrEdgeObj* pEdge = dynamic_cast< const SdrEdgeObj* >(mpSdrHdlObject);
+
+ if(pEdge && mnObjHdlNum <= 1)
+ {
+ BitmapColorIndex eColIndex = LightCyan;
+ BitmapMarkerKind eKindOfMarker = Rect_7x7;
+
+ if(pEdge->GetConnectedNode(mnObjHdlNum == 0))
+ {
+ eColIndex = LightRed;
}
- pHdl->SetHdlList(this);
+
+ if(mnPPntNum < 2)
+ {
+ // Handle with plus sign inside
+ eKindOfMarker = Circ_7x7;
+ }
+
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject(
+ maPosition,
+ eColIndex,
+ eKindOfMarker,
+ 0, 0);
+
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+ }
+ else
+ {
+ // call parent
+ SdrHdl::CreateB2dIAObject(rOverlayManager);
+ }
+}
+
+void ImpEdgeHdl::SetLineCode(SdrEdgeLineCode eCode)
+{
+ if(eLineCode != eCode)
+ {
+ // remember new value
+ eLineCode = eCode;
+
+ // create new display
+ Touch();
+ }
+}
+
+Pointer ImpEdgeHdl::GetPointer() const
+{
+ if(!mpSdrHdlObject || !mpSdrHdlObject->IsSdrEdgeObj())
+ {
+ return SdrHdl::GetPointer();
+ }
+
+ if(mnObjHdlNum <= 1)
+ {
+ return Pointer(POINTER_MOVEPOINT); //Pointer(POINTER_DRAW_CONNECT);
+ }
+
+ if(IsHorzDrag())
+ {
+ return Pointer(POINTER_ESIZE);
+ }
+ else
+ {
+ return Pointer(POINTER_SSIZE);
+ }
+}
+
+bool ImpEdgeHdl::IsHorzDrag() const
+{
+ const SdrEdgeObj* pEdge = dynamic_cast< const SdrEdgeObj* >(mpSdrHdlObject);
+
+ if(pEdge)
+ {
+ if(mnObjHdlNum <= 1)
+ {
+ return false;
+ }
+
+ SdrEdgeKind eEdgeKind = ((SdrEdgeKindItem&)(pEdge->GetObjectItem(SDRATTR_EDGEKIND))).GetValue();
+ const SdrEdgeInfoRec& rInfo = pEdge->maEdgeInfo;
+
+ if(SDREDGE_ORTHOLINES == eEdgeKind || SDREDGE_BEZIER == eEdgeKind)
+ {
+ return !rInfo.ImpIsHorzLine(eLineCode, pEdge->maEdgeTrack.count());
+ }
+ else if(SDREDGE_THREELINES == eEdgeKind)
+ {
+ const sal_Int32 nWink((2 == mnObjHdlNum) ? rInfo.nAngle1 : rInfo.nAngle2);
+
+ if(!nWink || 18000 == nWink)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ImpMeasureHdl::~ImpMeasureHdl()
+{
+}
+
+void ImpMeasureHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ BitmapColorIndex eColIndex = LightCyan;
+ BitmapMarkerKind eKindOfMarker = Rect_9x9;
+
+ if(mnObjHdlNum > 1)
+ {
+ eKindOfMarker = Rect_7x7;
}
+
+ if(mbSelect)
+ {
+ eColIndex = Cyan;
+ }
+
+ ::sdr::overlay::OverlayObject* pNewOverlayObject = CreateOverlayObject(
+ maPosition,
+ eColIndex,
+ eKindOfMarker,
+ 0, 0);
+
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+}
+
+Pointer ImpMeasureHdl::GetPointer() const
+{
+ switch (mnObjHdlNum)
+ {
+ case 0: case 1: return Pointer(POINTER_HAND);
+ case 2: case 3: return Pointer(POINTER_MOVEPOINT);
+ case 4: case 5: return SdrHdl::GetPointer(); // wird dann entsprechend gedreht
+ } // switch
+ return Pointer(POINTER_NOTALLOWED);
}
-SdrHdl* SdrHdlList::IsHdlListHit(const Point& rPnt, sal_Bool bBack, sal_Bool bNext, SdrHdl* pHdl0) const
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ImpTextframeHdl::ImpTextframeHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DHomMatrix& rTransformation)
+: SdrHdl(rHdlList, &rSdrHdlObject),
+ maTransformation(rTransformation)
{
- SdrHdl* pRet=NULL;
- sal_uIntPtr nAnz=GetHdlCount();
- sal_uIntPtr nNum=bBack ? 0 : nAnz;
- while ((bBack ? nNum<nAnz : nNum>0) && pRet==NULL)
- {
- if (!bBack)
- nNum--;
- SdrHdl* pHdl=GetHdl(nNum);
- if (bNext)
- {
- if (pHdl==pHdl0)
- bNext=sal_False;
- }
- else
- {
- if (pHdl->IsHdlHit(rPnt))
- pRet=pHdl;
- }
- if (bBack)
- nNum++;
- }
- return pRet;
+ // set member aPos, not sure if this is needed
+ setPosition(maTransformation * basegfx::B2DPoint(0.0, 0.0));
}
-SdrHdl* SdrHdlList::GetHdl(SdrHdlKind eKind1) const
+ImpTextframeHdl::~ImpTextframeHdl()
{
- SdrHdl* pRet=NULL;
- for (sal_uIntPtr i=0; i<GetHdlCount() && pRet==NULL; i++)
- {
- SdrHdl* pHdl=GetHdl(i);
- if (pHdl->GetKind()==eKind1)
- pRet=pHdl;
- }
- return pRet;
}
-// --------------------------------------------------------------------
+void ImpTextframeHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
+{
+ const svtools::ColorConfig aColorConfig;
+ const Color aHatchCol( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor );
+ ::sdr::overlay::OverlayHatchRect* pNewOverlayObject = new ::sdr::overlay::OverlayHatchRect(
+ maTransformation,
+ aHatchCol,
+ 3.0,
+ 3.0,
+ 45 * F_PI180);
+
+ pNewOverlayObject->setHittable(false);
+ rOverlayManager.add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
// SdrCropHdl
-// --------------------------------------------------------------------
-SdrCropHdl::SdrCropHdl(const Point& rPnt, SdrHdlKind eNewKind)
-: SdrHdl( rPnt, eNewKind )
+SdrCropHdl::SdrCropHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ SdrHdlKind eNewKind,
+ const basegfx::B2DPoint& rPnt)
+: SdrHdl( rHdlList, &rSdrHdlObject, eNewKind, rPnt)
{
}
-// --------------------------------------------------------------------
+SdrCropHdl::~SdrCropHdl()
+{
+}
BitmapEx SdrCropHdl::GetHandlesBitmap( bool bIsFineHdl, bool bIsHighContrast )
{
@@ -2297,11 +2145,9 @@ BitmapEx SdrCropHdl::GetHandlesBitmap( bool bIsFineHdl, bool bIsHighContrast )
}
}
-// --------------------------------------------------------------------
-
-BitmapEx SdrCropHdl::GetBitmapForHandle( const BitmapEx& rBitmap, int nSize )
+BitmapEx SdrCropHdl::GetBitmapForHandle( const BitmapEx& rBitmap, sal_uInt16 nSize )
{
- int nPixelSize = 0, nX = 0, nY = 0, nOffset = 0;
+ sal_uInt16 nPixelSize = 0, nX = 0, nY = 0, nOffset = 0;
if( nSize <= 3 )
{
@@ -2319,7 +2165,7 @@ BitmapEx SdrCropHdl::GetBitmapForHandle( const BitmapEx& rBitmap, int nSize )
nOffset = 84;
}
- switch( eKind )
+ switch( meKind )
{
case HDL_UPLFT: nX = 0; nY = 0; break;
case HDL_UPPER: nX = 1; nY = 0; break;
@@ -2339,75 +2185,52 @@ BitmapEx SdrCropHdl::GetBitmapForHandle( const BitmapEx& rBitmap, int nSize )
return aRetval;
}
-// --------------------------------------------------------------------
-
-void SdrCropHdl::CreateB2dIAObject()
+void SdrCropHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
{
- // first throw away old one
- GetRidOfIAObject();
-
- SdrMarkView* pView = pHdlList ? pHdlList->GetView() : 0;
- SdrPageView* pPageView = pView ? pView->GetSdrPageView() : 0;
-
- if( pPageView && !pView->areMarkHandlesHidden() )
- {
- sal_Bool bIsFineHdl(pHdlList->IsFineHdl());
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- sal_Bool bIsHighContrast(rStyleSettings.GetHighContrastMode());
- int nHdlSize = pHdlList->GetHdlSize();
- if( bIsHighContrast )
- nHdlSize = 4;
-
- const BitmapEx aHandlesBitmap( GetHandlesBitmap( bIsFineHdl, bIsHighContrast ) );
- BitmapEx aBmpEx1( GetBitmapForHandle( aHandlesBitmap, nHdlSize ) );
-
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
- {
- // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- basegfx::B2DPoint aPosition(aPos.X(), aPos.Y());
-
- ::sdr::overlay::OverlayObject* pOverlayObject = 0L;
-
- // animate focused handles
- if(IsFocusHdl() && (pHdlList->GetFocusHdl() == this))
- {
- if( nHdlSize >= 2 )
- nHdlSize = 1;
-
- BitmapEx aBmpEx2( GetBitmapForHandle( aHandlesBitmap, nHdlSize + 1 ) );
+ bool bIsFineHdl(mrHdlList.IsFineHdl());
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ bool bIsHighContrast(rStyleSettings.GetHighContrastMode());
+ sal_uInt16 nHdlSize = mrHdlList.GetHdlSize();
- const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
+ if( bIsHighContrast )
+ nHdlSize = 4;
- pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(aPosition, aBmpEx1, aBmpEx2, nBlinkTime,
- (sal_uInt16)(aBmpEx1.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBmpEx1.GetSizePixel().Height() - 1) >> 1,
- (sal_uInt16)(aBmpEx2.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBmpEx2.GetSizePixel().Height() - 1) >> 1);
- }
- else
- {
- // create centered handle as default
- pOverlayObject = new ::sdr::overlay::OverlayBitmapEx(aPosition, aBmpEx1,
- (sal_uInt16)(aBmpEx1.GetSizePixel().Width() - 1) >> 1,
- (sal_uInt16)(aBmpEx1.GetSizePixel().Height() - 1) >> 1);
- }
+ const BitmapEx aHandlesBitmap( GetHandlesBitmap( bIsFineHdl, bIsHighContrast ) );
+ BitmapEx aBmpEx1( GetBitmapForHandle( aHandlesBitmap, nHdlSize ) );
+ ::sdr::overlay::OverlayObject* pOverlayObject = 0L;
- // OVERLAYMANAGER
- if(pOverlayObject)
- {
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
- maOverlayGroup.append(*pOverlayObject);
- }
- }
- }
- }
+ // animate focused handles
+ if(IsFocusHdl() && (mrHdlList.GetFocusHdl() == this))
+ {
+ if( nHdlSize >= 2 )
+ nHdlSize = 1;
+
+ BitmapEx aBmpEx2( GetBitmapForHandle( aHandlesBitmap, nHdlSize + 1 ) );
+ const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
+
+ pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(
+ maPosition,
+ aBmpEx1,
+ aBmpEx2,
+ nBlinkTime,
+ (sal_uInt16)(aBmpEx1.GetSizePixel().Width() - 1) >> 1,
+ (sal_uInt16)(aBmpEx1.GetSizePixel().Height() - 1) >> 1,
+ (sal_uInt16)(aBmpEx2.GetSizePixel().Width() - 1) >> 1,
+ (sal_uInt16)(aBmpEx2.GetSizePixel().Height() - 1) >> 1);
+ }
+ else
+ {
+ // create centered handle as default
+ pOverlayObject = new ::sdr::overlay::OverlayBitmapEx(
+ maPosition,
+ aBmpEx1,
+ (sal_uInt16)(aBmpEx1.GetSizePixel().Width() - 1) >> 1,
+ (sal_uInt16)(aBmpEx1.GetSizePixel().Height() - 1) >> 1);
}
+
+ rOverlayManager.add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
}
-// --------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdhlpln.cxx b/svx/source/svdraw/svdhlpln.cxx
index 669bd733cc97..613f1fc08f13 100644
--- a/svx/source/svdraw/svdhlpln.cxx
+++ b/svx/source/svdraw/svdhlpln.cxx
@@ -26,120 +26,188 @@
#include <svx/svdhlpln.hxx>
#include <tools/color.hxx>
-
#include <vcl/outdev.hxx>
#include <vcl/window.hxx>
#include <tools/poly.hxx>
#include <vcl/lineinfo.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
+SdrHelpLine::SdrHelpLine(SdrHelpLineKind eNewKind)
+: maPos(),
+ meKind(eNewKind)
+{
+}
+
+SdrHelpLine::SdrHelpLine(SdrHelpLineKind eNewKind, const basegfx::B2DPoint& rNewPos)
+: maPos(rNewPos),
+ meKind(eNewKind)
+{
+}
+
+bool SdrHelpLine::operator==(const SdrHelpLine& rCmp) const
+{
+ return GetPos() == rCmp.GetPos() && GetKind() == rCmp.GetKind();
+}
+
Pointer SdrHelpLine::GetPointer() const
{
- switch (eKind) {
+ switch(GetKind())
+ {
case SDRHELPLINE_VERTICAL : return Pointer(POINTER_ESIZE);
case SDRHELPLINE_HORIZONTAL: return Pointer(POINTER_SSIZE);
default : return Pointer(POINTER_MOVE);
- } // switch
+ }
}
-FASTBOOL SdrHelpLine::IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const
+bool SdrHelpLine::IsHit(const basegfx::B2DPoint& rPnt, double fTolLog) const
{
- Size a1Pix(rOut.PixelToLogic(Size(1,1)));
- FASTBOOL bXHit=rPnt.X()>=aPos.X()-nTolLog && rPnt.X()<=aPos.X()+nTolLog+a1Pix.Width();
- FASTBOOL bYHit=rPnt.Y()>=aPos.Y()-nTolLog && rPnt.Y()<=aPos.Y()+nTolLog+a1Pix.Height();
- switch (eKind) {
- case SDRHELPLINE_VERTICAL : return bXHit;
- case SDRHELPLINE_HORIZONTAL: return bYHit;
- case SDRHELPLINE_POINT: {
- if (bXHit || bYHit) {
- Size aRad(rOut.PixelToLogic(Size(SDRHELPLINE_POINT_PIXELSIZE,SDRHELPLINE_POINT_PIXELSIZE)));
- return rPnt.X()>=aPos.X()-aRad.Width() && rPnt.X()<=aPos.X()+aRad.Width()+a1Pix.Width() &&
- rPnt.Y()>=aPos.Y()-aRad.Height() && rPnt.Y()<=aPos.Y()+aRad.Height()+a1Pix.Height();
- }
- } break;
- } // switch
- return sal_False;
+ basegfx::B2DPoint aTestPoint(GetPos());
+
+ switch(GetKind())
+ {
+ case SDRHELPLINE_VERTICAL:
+ {
+ aTestPoint.setY(rPnt.getY());
+ break;
+ }
+ case SDRHELPLINE_HORIZONTAL:
+ {
+ aTestPoint.setX(rPnt.getX());
+ break;
+ }
+ default: // case SDRHELPLINE_POINT:
+ {
+ // get multiple precision for point, e.g. 3.0 gets the needed
+ // 15x15 size. All in all the HitTest should be moved to use primitives
+ fTolLog *= 5.0;
+ break;
+ }
+ }
+
+ const double fDistance(basegfx::B2DVector(aTestPoint - rPnt).getLength());
+
+ return basegfx::fTools::lessOrEqual(fDistance, fTolLog);
}
-Rectangle SdrHelpLine::GetBoundRect(const OutputDevice& rOut) const
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrHelpLineList::SdrHelpLineList()
+: maList()
{
- Rectangle aRet(aPos,aPos);
- Point aOfs(rOut.GetMapMode().GetOrigin());
- Size aSiz(rOut.GetOutputSize());
- switch (eKind) {
- case SDRHELPLINE_VERTICAL : aRet.Top()=-aOfs.Y(); aRet.Bottom()=-aOfs.Y()+aSiz.Height(); break;
- case SDRHELPLINE_HORIZONTAL: aRet.Left()=-aOfs.X(); aRet.Right()=-aOfs.X()+aSiz.Width(); break;
- case SDRHELPLINE_POINT : {
- Size aRad(rOut.PixelToLogic(Size(SDRHELPLINE_POINT_PIXELSIZE,SDRHELPLINE_POINT_PIXELSIZE)));
- aRet.Left() -=aRad.Width();
- aRet.Right() +=aRad.Width();
- aRet.Top() -=aRad.Height();
- aRet.Bottom()+=aRad.Height();
- } break;
- } // switch
- return aRet;
}
-bool SdrHelpLine::IsVisibleEqual( const SdrHelpLine& rHelpLine, const OutputDevice& rOut ) const
+SdrHelpLineList::SdrHelpLineList(const SdrHelpLineList& rSrcList)
+: maList()
{
- if( eKind == rHelpLine.eKind)
+ *this = rSrcList;
+}
+
+SdrHelpLineList::~SdrHelpLineList()
+{
+ Clear();
+}
+
+SdrHelpLine* SdrHelpLineList::GetObject(sal_uInt32 i) const
+{
+ if(i < maList.size())
{
- Point aPt1(rOut.LogicToPixel(aPos)), aPt2(rOut.LogicToPixel(rHelpLine.aPos));
- switch( eKind )
- {
- case SDRHELPLINE_POINT:
- return aPt1 == aPt2;
- case SDRHELPLINE_VERTICAL:
- return aPt1.X() == aPt2.X();
- case SDRHELPLINE_HORIZONTAL:
- return aPt1.Y() == aPt2.Y();
- }
+ return *(maList.begin() + i);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrHelpLineList::GetObject access out of range (!)");
+ return 0;
}
- return false;
}
void SdrHelpLineList::Clear()
{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
+ const sal_uInt32 nAnz(GetCount());
+
+ for(sal_uInt32 i(0); i < nAnz; i++)
+ {
delete GetObject(i);
}
- aList.Clear();
+
+ maList.clear();
}
void SdrHelpLineList::operator=(const SdrHelpLineList& rSrcList)
{
Clear();
- sal_uInt16 nAnz=rSrcList.GetCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
+ const sal_uInt32 nAnz(rSrcList.GetCount());
+
+ for(sal_uInt32 i(0); i < nAnz; i++)
+ {
Insert(rSrcList[i]);
}
}
bool SdrHelpLineList::operator==(const SdrHelpLineList& rSrcList) const
{
- FASTBOOL bEqual=sal_False;
- sal_uInt16 nAnz=GetCount();
- if (nAnz==rSrcList.GetCount()) {
- bEqual=sal_True;
- for (sal_uInt16 i=0; i<nAnz && bEqual; i++) {
- if (*GetObject(i)!=*rSrcList.GetObject(i)) {
- bEqual=sal_False;
+ bool bEqual(false);
+ const sal_uInt32 nAnz(GetCount());
+
+ if(nAnz == rSrcList.GetCount())
+ {
+ bEqual = true;
+
+ for(sal_uInt32 i(0); i < nAnz && bEqual; i++)
+ {
+ if(*GetObject(i) != *rSrcList.GetObject(i))
+ {
+ bEqual = false;
}
}
}
+
return bEqual;
}
-sal_uInt16 SdrHelpLineList::HitTest(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const
+void SdrHelpLineList::Insert(const SdrHelpLine& rHL, sal_uInt32 nPos)
+{
+ if(0xffffffff == nPos)
+ {
+ maList.push_back(new SdrHelpLine(rHL));
+ }
+ else
+ {
+ maList.insert(maList.begin() + nPos, new SdrHelpLine(rHL));
+ }
+}
+
+void SdrHelpLineList::Delete(sal_uInt32 nPos)
{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 i=nAnz; i>0;) {
+ if(nPos < maList.size())
+ {
+ SdrHelpLineContainerType::iterator a(maList.begin() + nPos);
+ delete *a;
+ maList.erase(a);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrHelpLineList::Delete out of range (!)");
+ }
+}
+
+sal_uInt32 SdrHelpLineList::HLHitTest(const basegfx::B2DPoint& rPnt, double fTolLog) const
+{
+ const sal_uInt32 nAnz(GetCount());
+
+ for(sal_uInt32 i(nAnz); i > 0;)
+ {
i--;
- if (GetObject(i)->IsHit(rPnt,nTolLog,rOut)) return i;
+
+ if(GetObject(i)->IsHit(rPnt, fTolLog))
+ {
+ return i;
+ }
}
+
return SDRHELPLINE_NOTFOUND;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 97a7c473b523..3dbeba204fe2 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -32,7 +32,8 @@
#define _STDLIB_H
#endif
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <editeng/flditem.hxx>
#include <editeng/editdata.hxx>
#include <svx/svdpool.hxx>
@@ -50,17 +51,14 @@
#include <svx/xflbtoxy.hxx>
#include <svx/xftshit.hxx>
#include <editeng/colritem.hxx>
-
-
+#include <svx/xcolit.hxx>
#include "editeng/fontitem.hxx"
#include <editeng/fhgtitem.hxx>
-
#include <editeng/charscaleitem.hxx>
#include <svl/whiter.hxx>
#include <svl/flagitem.hxx>
#include <svl/ptitem.hxx>
#include <svl/rectitem.hxx>
-
#include <svl/rngitem.hxx>
#include <svx/sdrpaintwindow.hxx>
@@ -89,7 +87,7 @@ public:
SfxItemState eState;
sal_uInt16 nWhichId;
- TypeId pType;
+ const std::type_info* pType;
ItemType eItemType;
sal_Int32 nVal;
@@ -104,7 +102,7 @@ public:
ImpItemListRow()
: eState(SFX_ITEM_UNKNOWN),
nWhichId(0),
- pType(NULL),
+ pType(0),
eItemType(ITEM_DONTKNOW),
nVal(0),
nMin(0),
@@ -411,7 +409,7 @@ void __EXPORT _SdrItemBrowserControl::DoubleClick(const BrowserMouseEvent&)
void __EXPORT _SdrItemBrowserControl::KeyInput(const KeyEvent& rKEvt)
{
sal_uInt16 nKeyCode=rKEvt.GetKeyCode().GetCode()+rKEvt.GetKeyCode().GetModifier();
- FASTBOOL bAusgewertet=sal_False;
+ bool bAusgewertet=sal_False;
sal_uIntPtr nPos=GetCurrentPos();
if (nPos!=CONTAINER_ENTRY_NOTFOUND) {
if (nKeyCode==KEY_RETURN) {
@@ -479,7 +477,7 @@ void _SdrItemBrowserControl::ImpSaveWhich()
void _SdrItemBrowserControl::ImpRestoreWhich()
{
if (nLastWhich!=0) {
- FASTBOOL bFnd=sal_False;
+ bool bFnd=sal_False;
sal_uInt16 nBestMinWh=0,nBestMaxWh=0xFFFF; // not implemented yet
sal_uIntPtr nBestMinPos=0,nBestMaxPos=0xFFFFFFFF; // not implemented yet
sal_uIntPtr nAnz=aList.Count();
@@ -504,10 +502,10 @@ void _SdrItemBrowserControl::ImpRestoreWhich()
}
}
-FASTBOOL _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos)
+bool _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos)
{
BrkChangeEntry();
- FASTBOOL bRet=sal_False;
+ bool bRet=sal_False;
ImpItemListRow* pEntry=ImpGetEntry(nPos);
if (pEntry!=NULL && !pEntry->bComment) {
SetMode(MYBROWSEMODE & ~BROWSER_KEEPHIGHLIGHT);
@@ -543,9 +541,9 @@ FASTBOOL _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos)
return bRet;
}
-FASTBOOL _SdrItemBrowserControl::EndChangeEntry()
+bool _SdrItemBrowserControl::EndChangeEntry()
{
- FASTBOOL bRet=sal_False;
+ bool bRet=sal_False;
if (pEditControl!=NULL) {
aEntryChangedHdl.Call(this);
delete pEditControl;
@@ -580,9 +578,9 @@ void _SdrItemBrowserControl::ImpSetEntry(const ImpItemListRow& rEntry, sal_uIntP
aList.Insert(new ImpItemListRow(rEntry),CONTAINER_APPEND);
RowInserted(nEntryNum);
} else if (*pAktEntry!=rEntry) {
- FASTBOOL bStateDiff=rEntry.eState!=pAktEntry->eState;
- FASTBOOL bValueDiff=!rEntry.aValue.Equals(pAktEntry->aValue);
- FASTBOOL bAllDiff=sal_True;
+ bool bStateDiff=rEntry.eState!=pAktEntry->eState;
+ bool bValueDiff=!rEntry.aValue.Equals(pAktEntry->aValue);
+ bool bAllDiff=sal_True;
if (bStateDiff || bValueDiff) {
// Checken, ob nur State und/oder Value geaendert
ImpItemListRow aTest(rEntry);
@@ -600,7 +598,7 @@ void _SdrItemBrowserControl::ImpSetEntry(const ImpItemListRow& rEntry, sal_uIntP
}
}
-FASTBOOL ImpGetItem(const SfxItemSet& rSet, sal_uInt16 nWhich, const SfxPoolItem*& rpItem)
+bool ImpGetItem(const SfxItemSet& rSet, sal_uInt16 nWhich, const SfxPoolItem*& rpItem)
{
SfxItemState eState=rSet.GetItemState(nWhich,sal_True,&rpItem);
if (eState==SFX_ITEM_DEFAULT) {
@@ -609,12 +607,12 @@ FASTBOOL ImpGetItem(const SfxItemSet& rSet, sal_uInt16 nWhich, const SfxPoolItem
return (eState==SFX_ITEM_DEFAULT || eState==SFX_ITEM_SET) && rpItem!=NULL;
}
-FASTBOOL IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rIndent)
+bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rIndent)
{
rIndent=0;
if (pSet==NULL) return sal_False;
const SfxPoolItem* pItem=NULL;
- FASTBOOL bRet=sal_False;
+ bool bRet=sal_False;
switch (nWhich) {
case XATTR_LINEDASH :
case XATTR_LINEWIDTH :
@@ -683,10 +681,10 @@ FASTBOOL IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16
if (nWhich==XATTR_FILLBITMAP || nWhich==XATTR_FILLBMP_TILE) {
return sal_False; // immer anwaehlbar
}
- FASTBOOL bTileTRUE=sal_False;
- FASTBOOL bTileFALSE=sal_False;
- FASTBOOL bStretchTRUE=sal_False;
- FASTBOOL bStretchFALSE=sal_False;
+ bool bTileTRUE=sal_False;
+ bool bTileFALSE=sal_False;
+ bool bStretchTRUE=sal_False;
+ bool bStretchFALSE=sal_False;
if (ImpGetItem(*pSet,XATTR_FILLBMP_TILE,pItem)) {
bTileTRUE=((const XFillBmpTileItem*)pItem)->GetValue();
bTileFALSE=!bTileTRUE;
@@ -713,7 +711,7 @@ FASTBOOL IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16
if (nWhich==XATTR_FILLBMP_TILEOFFSETX || nWhich==XATTR_FILLBMP_TILEOFFSETY) {
if (bTileFALSE) return sal_True;
sal_uInt16 nX=0,nY=0;
- FASTBOOL bX=sal_False,bY=sal_False;
+ bool bX=sal_False,bY=sal_False;
if (ImpGetItem(*pSet,XATTR_FILLBMP_TILEOFFSETX,pItem)) {
nX=((const XFillBmpTileOffsetXItem*)pItem)->GetValue();
bX=sal_True;
@@ -773,32 +771,32 @@ FASTBOOL IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16
case SDRATTR_SHADOWPERSP : {
rIndent=1;
if (ImpGetItem(*pSet,SDRATTR_SHADOW,pItem)) {
- FASTBOOL bShadow=((const SdrShadowItem*)pItem)->GetValue();
- if (!bShadow) return sal_True;
+ bool bShadow=((const SdrOnOffItem*)pItem)->GetValue();
+ if (!bShadow) return true;
}
} break;
case SDRATTR_CAPTIONANGLE: {
rIndent=1;
if (ImpGetItem(*pSet,SDRATTR_CAPTIONFIXEDANGLE,pItem)) {
- FASTBOOL bFixed=((const SdrCaptionFixedAngleItem*)pItem)->GetValue();
- if (!bFixed) return sal_True;
+ bool bFixed=((const SdrOnOffItem*)pItem)->GetValue();
+ if (!bFixed) return true;
}
} break;
case SDRATTR_CAPTIONESCREL:
case SDRATTR_CAPTIONESCABS: {
rIndent=1;
if (ImpGetItem(*pSet,SDRATTR_CAPTIONESCISREL,pItem)) {
- FASTBOOL bRel=((const SdrCaptionEscIsRelItem*)pItem)->GetValue();
- if (bRel && nWhich==SDRATTR_CAPTIONESCABS) return sal_True;
- if (!bRel && nWhich==SDRATTR_CAPTIONESCREL) return sal_True;
+ bool bRel=((const SdrYesNoItem*)pItem)->GetValue();
+ if (bRel && nWhich==SDRATTR_CAPTIONESCABS) return true;
+ if (!bRel && nWhich==SDRATTR_CAPTIONESCREL) return true;
}
} break;
case SDRATTR_CAPTIONLINELEN: {
rIndent=1;
if (ImpGetItem(*pSet,SDRATTR_CAPTIONFITLINELEN,pItem)) {
- FASTBOOL bFit=((const SdrCaptionFitLineLenItem*)pItem)->GetValue();
- if (bFit) return sal_True;
+ bool bFit=((const SdrYesNoItem*)pItem)->GetValue();
+ if (bFit) return true;
}
} break;
@@ -806,16 +804,16 @@ FASTBOOL IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16
case SDRATTR_TEXT_MAXFRAMEHEIGHT: {
rIndent=1;
if (ImpGetItem(*pSet,SDRATTR_TEXT_AUTOGROWHEIGHT,pItem)) {
- FASTBOOL bAutoGrow=((const SdrTextAutoGrowHeightItem*)pItem)->GetValue();
- if (!bAutoGrow) return sal_True;
+ bool bAutoGrow=((const SdrOnOffItem*)pItem)->GetValue();
+ if (!bAutoGrow) return true;
}
} break;
case SDRATTR_TEXT_MINFRAMEWIDTH:
case SDRATTR_TEXT_MAXFRAMEWIDTH: {
rIndent=1;
if (ImpGetItem(*pSet,SDRATTR_TEXT_AUTOGROWWIDTH,pItem)) {
- FASTBOOL bAutoGrow=((const SdrTextAutoGrowWidthItem*)pItem)->GetValue();
- if (!bAutoGrow) return sal_True;
+ bool bAutoGrow=((const SdrOnOffItem*)pItem)->GetValue();
+ if (!bAutoGrow) return true;
}
} break;
case SDRATTR_TEXT_VERTADJUST:
@@ -854,22 +852,14 @@ FASTBOOL IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16
if (eKind!=SDREDGE_ORTHOLINES && eKind!=SDREDGE_BEZIER) return sal_True;
}
if (ImpGetItem(*pSet,SDRATTR_EDGELINEDELTAANZ,pItem)) {
- sal_uInt16 nAnz=((const SdrEdgeLineDeltaAnzItem*)pItem)->GetValue();
- if (nAnz==0) return sal_True;
- if (nAnz==1 && nWhich>SDRATTR_EDGELINE1DELTA) return sal_True;
- if (nAnz==2 && nWhich>SDRATTR_EDGELINE2DELTA) return sal_True;
- if (nAnz==3 && nWhich>SDRATTR_EDGELINE3DELTA) return sal_True;
+ sal_uInt16 nAnz=((const SfxUInt16Item*)pItem)->GetValue();
+ if (nAnz==0) return true;
+ if (nAnz==1 && nWhich>SDRATTR_EDGELINE1DELTA) return true;
+ if (nAnz==2 && nWhich>SDRATTR_EDGELINE2DELTA) return true;
+ if (nAnz==3 && nWhich>SDRATTR_EDGELINE3DELTA) return true;
}
} break;
- case SDRATTR_CIRCSTARTANGLE:
- case SDRATTR_CIRCENDANGLE : {
- rIndent=1;
- if (ImpGetItem(*pSet,SDRATTR_CIRCKIND,pItem)) {
- SdrCircKind eKind=((const SdrCircKindItem*)pItem)->GetValue();
- if (eKind==SDRCIRC_FULL) return sal_True;
- }
- } break;
} // switch
return bRet;
}
@@ -948,7 +938,7 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
if (eState!=SFX_ITEM_DISABLED) {
const SfxPoolItem& rItem=pSet->Get(nWhich);
sal_uInt16 nIndent=0;
- if (!HAS_BASE(SfxVoidItem,&rItem) && !HAS_BASE(SfxSetItem,&rItem) && (!IsItemIneffective(nWhich,pSet,nIndent) || bDontHideIneffectiveItems)) {
+ if (!dynamic_cast< const SfxVoidItem* >(&rItem) && !dynamic_cast< const SfxSetItem* >(&rItem) && (!IsItemIneffective(nWhich,pSet,nIndent) || bDontHideIneffectiveItems)) {
XubString aCommentStr;
INSERTCOMMENT(XATTR_LINE_FIRST,XATTR_LINE_LAST,String("L I N I E", aTextEncoding));
@@ -959,7 +949,6 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
INSERTCOMMENT(SDRATTR_MISC_FIRST,SDRATTR_MISC_LAST,String("V E R S C H I E D E N E S", aTextEncoding));
INSERTCOMMENT(SDRATTR_EDGE_FIRST,SDRATTR_EDGE_LAST,String("V E R B I N D E R", aTextEncoding));
INSERTCOMMENT(SDRATTR_MEASURE_FIRST,SDRATTR_MEASURE_LAST,String("B E M A S S U N G", aTextEncoding));
- INSERTCOMMENT(SDRATTR_CIRC_FIRST,SDRATTR_CIRC_LAST,String("K R E I S", aTextEncoding));
INSERTCOMMENT(SDRATTR_NOTPERSIST_FIRST,SDRATTR_NOTPERSIST_LAST,String("N O T P E R S I S T", aTextEncoding));
INSERTCOMMENT(SDRATTR_MOVEX,SDRATTR_VERTSHEARONE,String("Transformationen auf alle Objekte einzeln", aTextEncoding));
INSERTCOMMENT(SDRATTR_RESIZEXALL,SDRATTR_VERTSHEARALL,String("Transformationen auf alle Objekte gemeinsam", aTextEncoding));
@@ -990,29 +979,29 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
aEntry.eState=eState;
aEntry.nWhichId=nWhich;
if (!IsInvalidItem(&rItem)) {
- aEntry.pType=rItem.Type();
+ aEntry.pType = &typeid(rItem);
aEntry.nMax=0x7FFFFFFF;
aEntry.nMin=-aEntry.nMax;
aEntry.nVal=-4711;
- if (HAS_BASE(SfxByteItem ,&rItem)) aEntry.eItemType=ITEM_BYTE;
- else if (HAS_BASE(SfxInt16Item ,&rItem)) aEntry.eItemType=ITEM_INT16;
- else if (HAS_BASE(SfxUInt16Item ,&rItem)) aEntry.eItemType=ITEM_UINT16;
- else if (HAS_BASE(SfxInt32Item ,&rItem)) aEntry.eItemType=ITEM_INT32;
- else if (HAS_BASE(SfxUInt32Item ,&rItem)) aEntry.eItemType=ITEM_UINT32;
- else if (HAS_BASE(SfxEnumItemInterface,&rItem)) aEntry.eItemType=ITEM_ENUM;
- else if (HAS_BASE(SfxBoolItem ,&rItem)) aEntry.eItemType=ITEM_BOOL;
- else if (HAS_BASE(SfxFlagItem ,&rItem)) aEntry.eItemType=ITEM_FLAG;
- else if (HAS_BASE(XColorItem ,&rItem)) aEntry.eItemType=ITEM_XCOLOR;
- else if (HAS_BASE(SfxStringItem ,&rItem)) aEntry.eItemType=ITEM_STRING;
- else if (HAS_BASE(SfxPointItem ,&rItem)) aEntry.eItemType=ITEM_POINT;
- else if (HAS_BASE(SfxRectangleItem,&rItem)) aEntry.eItemType=ITEM_RECT;
- else if (HAS_BASE(SfxRangeItem ,&rItem)) aEntry.eItemType=ITEM_RANGE;
- else if (HAS_BASE(SdrFractionItem ,&rItem)) aEntry.eItemType=ITEM_FRACTION;
- else if (HAS_BASE(SvxColorItem ,&rItem)) aEntry.eItemType=ITEM_COLOR;
- else if (HAS_BASE(SvxFontItem ,&rItem)) aEntry.eItemType=ITEM_FONT;
- else if (HAS_BASE(SvxFontHeightItem,&rItem))aEntry.eItemType=ITEM_FONTHEIGHT;
- else if (HAS_BASE(SvxCharScaleWidthItem,&rItem)) aEntry.eItemType=ITEM_FONTWIDTH;
- else if (HAS_BASE(SvxFieldItem ,&rItem)) aEntry.eItemType=ITEM_FIELD;
+ if (dynamic_cast< const SfxByteItem* >(&rItem)) aEntry.eItemType=ITEM_BYTE;
+ else if (dynamic_cast< const SfxInt16Item* >(&rItem)) aEntry.eItemType=ITEM_INT16;
+ else if (dynamic_cast< const SfxUInt16Item* >(&rItem)) aEntry.eItemType=ITEM_UINT16;
+ else if (dynamic_cast< const SfxInt32Item* >(&rItem)) aEntry.eItemType=ITEM_INT32;
+ else if (dynamic_cast< const SfxUInt32Item* >(&rItem)) aEntry.eItemType=ITEM_UINT32;
+ else if (dynamic_cast< const SfxEnumItemInterface* >(&rItem)) aEntry.eItemType=ITEM_ENUM;
+ else if (dynamic_cast< const SfxBoolItem* >(&rItem)) aEntry.eItemType=ITEM_BOOL;
+ else if (dynamic_cast< const SfxFlagItem* >(&rItem)) aEntry.eItemType=ITEM_FLAG;
+ else if (dynamic_cast< const XColorItem* >(&rItem)) aEntry.eItemType=ITEM_XCOLOR;
+ else if (dynamic_cast< const SfxStringItem* >(&rItem)) aEntry.eItemType=ITEM_STRING;
+ else if (dynamic_cast< const SfxPointItem* >(&rItem)) aEntry.eItemType=ITEM_POINT;
+ else if (dynamic_cast< const SfxRectangleItem* >(&rItem)) aEntry.eItemType=ITEM_RECT;
+ else if (dynamic_cast< const SfxRangeItem* >(&rItem)) aEntry.eItemType=ITEM_RANGE;
+ else if (dynamic_cast< const SdrFractionItem* >(&rItem)) aEntry.eItemType=ITEM_FRACTION;
+ else if (dynamic_cast< const SvxColorItem* >(&rItem)) aEntry.eItemType=ITEM_COLOR;
+ else if (dynamic_cast< const SvxFontItem* >(&rItem)) aEntry.eItemType=ITEM_FONT;
+ else if (dynamic_cast< const SvxFontHeightItem* >(&rItem))aEntry.eItemType=ITEM_FONTHEIGHT;
+ else if (dynamic_cast< const SvxCharScaleWidthItem* >(&rItem)) aEntry.eItemType=ITEM_FONTWIDTH;
+ else if (dynamic_cast< const SvxFieldItem* >(&rItem)) aEntry.eItemType=ITEM_FIELD;
switch (aEntry.eItemType) {
case ITEM_BYTE : aEntry.bIsNum=sal_True; aEntry.nVal=((SfxByteItem &)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=255; break;
case ITEM_INT16 : aEntry.bIsNum=sal_True; aEntry.nVal=((SfxInt16Item &)rItem).GetValue(); aEntry.nMin=-32767; aEntry.nMax=32767; break;
@@ -1027,7 +1016,7 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
default: break;
} // switch
if (aEntry.bIsNum) aEntry.bCanNum=sal_True;
- FASTBOOL bGetPres=sal_True;
+ bool bGetPres=sal_True;
if (bGetPres) {
rItem.GetPresentation(SFX_ITEM_PRESENTATION_NAMELESS,
pPool->GetMetric(nWhich),
@@ -1144,14 +1133,14 @@ void SdrItemBrowser::Undirty()
bDirty = sal_False;
// SfxItemSet aSet(pView->GetAttributes());
- SfxItemSet aSet(pView->GetModel()->GetItemPool());
+ SfxItemSet aSet(pView->getSdrModelFromSdrView().GetItemPool());
pView->GetAttributes(aSet);
- if(pView->AreObjectsMarked())
+ if(pView->areSdrObjectsSelected())
{
- // SfxItemSet a2ndSet(pView->GetAttributes(sal_True));
- SfxItemSet a2ndSet(pView->GetModel()->GetItemPool());
- pView->GetAttributes(a2ndSet, sal_True);
+ // SfxItemSet a2ndSet(pView->GetAttributes(TRUE));
+ SfxItemSet a2ndSet(pView->getSdrModelFromSdrView().GetItemPool());
+ pView->GetAttributes(a2ndSet, true);
SetAttributes(&aSet,&a2ndSet);
}
@@ -1173,7 +1162,7 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse)
if (pEntry!=NULL)
{
// SfxItemSet aSet(pView->GetAttributes());
- SfxItemSet aSet(pView->GetModel()->GetItemPool());
+ SfxItemSet aSet(pView->getSdrModelFromSdrView().GetItemPool());
pView->GetAttributes(aSet);
SfxItemSet aNewSet(*aSet.GetPool(),pEntry->nWhichId,pEntry->nWhichId);
@@ -1193,9 +1182,9 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse)
if (nLongVal>pEntry->nMax) nLongVal=pEntry->nMax;
if (nLongVal<pEntry->nMin) nLongVal=pEntry->nMin;
}
- FASTBOOL bPair=sal_False;
- FASTBOOL bPairX=sal_True;
- FASTBOOL bPairY=sal_False;
+ bool bPair=sal_False;
+ bool bPairX=sal_True;
+ bool bPairY=sal_False;
sal_uInt16 nSepLen=1;
long nLongX = aNewText.ToInt32();
long nLongY=0;
@@ -1216,7 +1205,7 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse)
case ITEM_INT16 : ((SfxInt16Item *)pNewItem)->SetValue((sal_Int16 )nLongVal); break;
case ITEM_UINT16: ((SfxUInt16Item*)pNewItem)->SetValue((sal_uInt16)nLongVal); break;
case ITEM_INT32: {
- if(HAS_BASE(SdrAngleItem, pNewItem))
+ if(dynamic_cast< SdrAngleItem* >(pNewItem))
{
aNewText.SearchAndReplace(sal_Unicode(','), sal_Unicode('.'));
double nVal = aNewText.ToFloat();
diff --git a/svx/source/svdraw/svditer.cxx b/svx/source/svdraw/svditer.cxx
index 8601036daa97..a852b145298b 100644
--- a/svx/source/svdraw/svditer.cxx
+++ b/svx/source/svdraw/svditer.cxx
@@ -23,84 +23,64 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include "svx/svditer.hxx"
+
+#include <svx/svditer.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdobj.hxx>
-#include <svx/svdmark.hxx>
-
-// #99190#
#include <svx/scene3d.hxx>
-SdrObjListIter::SdrObjListIter(const SdrObjList& rObjList, SdrIterMode eMode, sal_Bool bReverse)
-: maObjList(1024, 64, 64),
- mnIndex(0L),
- mbReverse(bReverse)
-{
- ImpProcessObjectList(rObjList, eMode, sal_True);
- Reset();
-}
-
-SdrObjListIter::SdrObjListIter(const SdrObjList& rObjList, sal_Bool bUseZOrder, SdrIterMode eMode, sal_Bool bReverse)
-: maObjList(1024, 64, 64),
- mnIndex(0L),
- mbReverse(bReverse)
-{
- ImpProcessObjectList(rObjList, eMode, bUseZOrder);
- Reset();
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrObjListIter::SdrObjListIter( const SdrObject& rObj, SdrIterMode eMode, sal_Bool bReverse )
-: maObjList(1024, 64, 64),
- mnIndex(0L),
+SdrObjListIter::SdrObjListIter(const SdrObjList& rObjList, SdrIterMode eMode, bool bReverse)
+: maObjList(),
+ mnIndex(0),
mbReverse(bReverse)
{
- if ( rObj.ISA( SdrObjGroup ) )
- ImpProcessObjectList(*rObj.GetSubList(), eMode, sal_True);
- else
- maObjList.Insert( (void*)&rObj, LIST_APPEND );
+ ImpProcessObjectList(rObjList, eMode);
Reset();
}
-SdrObjListIter::SdrObjListIter( const SdrMarkList& rMarkList, SdrIterMode eMode, sal_Bool bReverse )
-: maObjList(1024, 64, 64),
- mnIndex(0L),
+SdrObjListIter::SdrObjListIter(const SdrObject& rObj, SdrIterMode eMode, bool bReverse)
+: maObjList(),
+ mnIndex(0),
mbReverse(bReverse)
{
- ImpProcessMarkList(rMarkList, eMode);
+ ImpProcessObj(rObj, eMode); // , true);
Reset();
}
-void SdrObjListIter::ImpProcessObjectList(const SdrObjList& rObjList, SdrIterMode eMode, sal_Bool bUseZOrder)
+void SdrObjListIter::ImpProcessObjectList(const SdrObjList& rObjList, SdrIterMode eMode)
{
- for( sal_uIntPtr nIdx = 0, nCount = rObjList.GetObjCount(); nIdx < nCount; ++nIdx )
+ for(sal_uInt32 nIdx(0), nCount(rObjList.GetObjCount()); nIdx < nCount; nIdx++)
{
- SdrObject* pObj = bUseZOrder ?
- rObjList.GetObj( nIdx ) : rObjList.GetObjectForNavigationPosition( nIdx );
- OSL_ASSERT( pObj != 0 );
- if( pObj )
- ImpProcessObj( pObj, eMode, bUseZOrder );
- }
-}
+ SdrObject* pObj = rObjList.GetObj(nIdx);
-void SdrObjListIter::ImpProcessMarkList( const SdrMarkList& rMarkList, SdrIterMode eMode )
-{
- for( sal_uIntPtr nIdx = 0, nCount = rMarkList.GetMarkCount(); nIdx < nCount; ++nIdx )
- if( SdrObject* pObj = rMarkList.GetMark( nIdx )->GetMarkedSdrObj() )
- ImpProcessObj( pObj, eMode, sal_False );
+ if(pObj)
+ {
+ ImpProcessObj(*pObj, eMode);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrObjListIter: corrupted SdrObjList (!)");
+ }
+ }
}
-void SdrObjListIter::ImpProcessObj(SdrObject* pObj, SdrIterMode eMode, sal_Bool bUseZOrder)
+void SdrObjListIter::ImpProcessObj(const SdrObject& rObj, SdrIterMode eMode)
{
- bool bIsGroup = pObj->IsGroupObject();
- // #99190# 3D objects are no group objects, IsGroupObject()
- // only tests if pSub is not null ptr :-(
- if( bIsGroup && pObj->ISA( E3dObject ) && !pObj->ISA( E3dScene ) )
- bIsGroup = false;
+ const bool bIsGroup(rObj.getChildrenOfSdrObject());
- if( !bIsGroup || (eMode != IM_DEEPNOGROUPS) )
- maObjList.Insert( pObj, LIST_APPEND );
+ if(!bIsGroup || (IM_DEEPNOGROUPS != eMode))
+ {
+ maObjList.push_back(const_cast< SdrObject* >(&rObj));
+ }
- if( bIsGroup && (eMode != IM_FLAT) )
- ImpProcessObjectList( *pObj->GetSubList(), eMode, bUseZOrder );
+ if(bIsGroup && (IM_FLAT != eMode))
+ {
+ ImpProcessObjectList(*rObj.getChildrenOfSdrObject(), eMode);
+ }
}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx
index 4bdcc444c1e4..fc1b8d765508 100644
--- a/svx/source/svdraw/svdlayer.cxx
+++ b/svx/source/svdraw/svdlayer.cxx
@@ -23,7 +23,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
-#include <com/sun/star/uno/Sequence.hxx>
#include <svx/svdlayer.hxx>
#include <svx/svdmodel.hxx> // fuer Broadcasting
@@ -31,392 +30,295 @@
#include "svx/svdstr.hrc" // Namen aus der Resource
////////////////////////////////////////////////////////////////////////////////////////////////////
-// SetOfByte
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SetOfByte::IsEmpty() const
-{
- for(sal_uInt16 i(0); i < 32; i++)
- {
- if(aData[i] != 0)
- return sal_False;
- }
-
- return sal_True;
-}
+// SdrLayer
-sal_Bool SetOfByte::IsFull() const
+SdrLayer::SdrLayer(SdrLayerID nNewID, const String& rNewName, SdrModel& rSdrModel)
+: maName(rNewName),
+ maTitle(),
+ maDescription(),
+ mrModel(rSdrModel),
+ mnID(nNewID),
+ mbStandardlayer(false)
{
- for(sal_uInt16 i(0); i < 32; i++)
- {
- if(aData[i] != 0xFF)
- return sal_False;
- }
-
- return sal_True;
}
-sal_uInt16 SetOfByte::GetSetCount() const
+void SdrLayer::SetStandardLayer(bool bStd)
{
- sal_uInt16 nRet(0);
-
- for(sal_uInt16 i(0); i < 32; i++)
+ if(IsStandardLayer() != bStd)
{
- sal_uInt8 a(aData[i]);
+ mbStandardlayer = bStd;
- if(a != 0)
+ if(IsStandardLayer())
{
- if(a & 0x80) nRet++;
- if(a & 0x40) nRet++;
- if(a & 0x20) nRet++;
- if(a & 0x10) nRet++;
- if(a & 0x08) nRet++;
- if(a & 0x04) nRet++;
- if(a & 0x02) nRet++;
- if(a & 0x01) nRet++;
+ maName = ImpGetResStr(STR_StandardLayerName);
}
- }
- return nRet;
+ GetSdrModel().Broadcast(SdrBaseHint(HINT_LAYERCHG));
+ GetSdrModel().SetChanged();
+ }
}
-sal_uInt8 SetOfByte::GetSetBit(sal_uInt16 nNum) const
+void SdrLayer::SetName(const XubString& rNewName)
{
- nNum++;
- sal_uInt16 i(0), j(0);
- sal_uInt16 nRet(0);
-
- while(j < nNum && i < 256)
+ if(rNewName != GetName())
{
- if(IsSet(sal_uInt8(i)))
- j++;
- i++;
+ maName = rNewName;
+ mbStandardlayer = false; // Userdefined
+
+ GetSdrModel().Broadcast(SdrBaseHint(HINT_LAYERCHG));
+ GetSdrModel().SetChanged();
}
+}
- if(j == nNum)
- nRet = i - 1;
+bool SdrLayer::operator==(const SdrLayer& rCmpLayer) const
+{
+ return (GetID() == rCmpLayer.GetID()
+ && IsStandardLayer() == rCmpLayer.IsStandardLayer()
+ && GetName() == rCmpLayer.GetName());
- return sal_uInt8(nRet);
+ // title and description is not (yet?) part of this operator
}
-sal_uInt16 SetOfByte::GetClearCount() const
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SdrLayerAdmin
+
+SdrLayerAdmin::SdrLayerAdmin(SdrModel& rSdrModel, SdrLayerAdmin* pNewParent)
+: maLayer(),
+ mpParent(pNewParent),
+ mrModel(rSdrModel),
+ maControlLayerName()
{
- return sal_uInt16(256 - GetSetCount());
}
-sal_uInt8 SetOfByte::GetClearBit(sal_uInt16 nNum) const
+SdrLayerAdmin::~SdrLayerAdmin()
{
- nNum++;
- sal_uInt16 i(0), j(0);
- sal_uInt16 nRet(0);
-
- while(j < nNum && i < 256)
- {
- if(!IsSet(sal_uInt8(i)))
- j++;
- i++;
- }
-
- if(j == nNum)
- nRet = i - 1;
-
- return sal_uInt8(nRet);
+ ClearLayer();
}
-void SetOfByte::operator&=(const SetOfByte& r2ndSet)
+SdrLayer* SdrLayerAdmin::GetLayer(sal_uInt32 i) const
{
- for(sal_uInt16 i(0); i < 32; i++)
+ if(i < maLayer.size())
{
- aData[i] &= r2ndSet.aData[i];
+ return *(maLayer.begin() + i);
}
-}
-
-void SetOfByte::operator|=(const SetOfByte& r2ndSet)
-{
- for(sal_uInt16 i(0); i < 32; i++)
+ else
{
- aData[i] |= r2ndSet.aData[i];
+ OSL_ENSURE(false, "SdrLayerAdmin::GetLayer access out of range (!)");
+ return 0;
}
}
-/** initialize this set with a uno sequence of sal_Int8
-*/
-void SetOfByte::PutValue( const com::sun::star::uno::Any & rAny )
+void SdrLayerAdmin::ClearLayer()
{
- com::sun::star::uno::Sequence< sal_Int8 > aSeq;
- if( rAny >>= aSeq )
+ for(SdrLayerContainerType::iterator aCandidate(maLayer.begin());
+ aCandidate != maLayer.end(); aCandidate++)
{
- sal_Int16 nCount = (sal_Int16)aSeq.getLength();
- if( nCount > 32 )
- nCount = 32;
-
- sal_Int16 nIndex;
- for( nIndex = 0; nIndex < nCount; nIndex++ )
- {
- aData[nIndex] = static_cast<sal_uInt8>(aSeq[nIndex]);
- }
-
- for( ; nIndex < 32; nIndex++ )
- {
- aData[nIndex] = 0;
- }
+ delete *aCandidate;
}
+
+ maLayer.clear();
}
-/** returns a uno sequence of sal_Int8
-*/
-void SetOfByte::QueryValue( com::sun::star::uno::Any & rAny ) const
+bool SdrLayerAdmin::operator==(const SdrLayerAdmin& rCmpLayerAdmin) const
{
- sal_Int16 nNumBytesSet = 0;
- sal_Int16 nIndex;
- for( nIndex = 31; nIndex >= 00; nIndex-- )
+ if(GetParent() != rCmpLayerAdmin.GetParent() || maLayer.size() != rCmpLayerAdmin.maLayer.size())
{
- if( 0 != aData[nIndex] )
- {
- nNumBytesSet = nIndex + 1;
- break;
- }
+ return false;
}
- com::sun::star::uno::Sequence< sal_Int8 > aSeq( nNumBytesSet );
+ bool bEqual(true);
- for( nIndex = 0; nIndex < nNumBytesSet; nIndex++ )
+ for(sal_uInt32 a(0); bEqual && a < GetLayerCount(); a++)
{
- aSeq[nIndex] = static_cast<sal_Int8>(aData[nIndex]);
+ bEqual = *GetLayer(a) == *rCmpLayerAdmin.GetLayer(a);
}
- rAny <<= aSeq;
+ return bEqual;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// SdrLayer
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrLayer::SetStandardLayer(FASTBOOL bStd)
+void SdrLayerAdmin::Broadcast() const
{
- nType=(sal_uInt16)bStd;
- if (bStd) {
- aName=ImpGetResStr(STR_StandardLayerName);
- }
- if (pModel!=NULL) {
- SdrHint aHint(HINT_LAYERCHG);
- pModel->Broadcast(aHint);
- pModel->SetChanged();
- }
+ GetSdrModel().Broadcast(SdrBaseHint(HINT_LAYERORDERCHG));
+ GetSdrModel().SetChanged();
}
-void SdrLayer::SetName(const XubString& rNewName)
+void SdrLayerAdmin::InsertLayerFromUndoRedo(SdrLayer* pLayer, sal_uInt32 nPos)
{
- if(!rNewName.Equals(aName))
+ if(pLayer && &pLayer->GetSdrModel() == &GetSdrModel())
{
- aName = rNewName;
- nType = 0; // Userdefined
-
- if(pModel)
+ if(nPos >= maLayer.size())
{
- SdrHint aHint(HINT_LAYERCHG);
-
- pModel->Broadcast(aHint);
- pModel->SetChanged();
+ maLayer.push_back(pLayer);
+ }
+ else
+ {
+ maLayer.insert(maLayer.begin() + nPos, pLayer);
}
- }
-}
-bool SdrLayer::operator==(const SdrLayer& rCmpLayer) const
-{
- return (nID == rCmpLayer.nID
- && nType == rCmpLayer.nType
- && aName.Equals(rCmpLayer.aName));
+ Broadcast();
+ }
+ else
+ {
+ OSL_ENSURE(pLayer, "No SdrLayer given (!)");
+ OSL_ENSURE(&pLayer->GetSdrModel() == &GetSdrModel(), "SdrLayer with alien SdrModel inserted (!)");
+ }
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// SdrLayerAdmin
-////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrLayerAdmin::SdrLayerAdmin(SdrLayerAdmin* pNewParent):
- aLayer(1024,16,16),
- aLSets(1024,16,16),
- pModel(NULL)
+SdrLayer* SdrLayerAdmin::RemoveLayer(sal_uInt32 nPos)
{
- sal_Char aTextControls[] = "Controls";
- aControlLayerName = String(aTextControls, sizeof(aTextControls-1));
- pParent=pNewParent;
-}
+ SdrLayer* pRetval = 0;
-SdrLayerAdmin::SdrLayerAdmin(const SdrLayerAdmin& rSrcLayerAdmin):
- aLayer(1024,16,16),
- aLSets(1024,16,16),
- pParent(NULL),
- pModel(NULL)
-{
- sal_Char aTextControls[] = "Controls";
- aControlLayerName = String(aTextControls, sizeof(aTextControls-1));
- *this = rSrcLayerAdmin;
-}
-
-SdrLayerAdmin::~SdrLayerAdmin()
-{
- ClearLayer();
-}
+ if(nPos < maLayer.size())
+ {
+ const SdrLayerContainerType::iterator aCandidate(maLayer.begin() + nPos);
-void SdrLayerAdmin::ClearLayer()
-{
- SdrLayer* pL;
- pL=(SdrLayer*)aLayer.First();
- while (pL!=NULL) {
- delete pL;
- pL=(SdrLayer*)aLayer.Next();
+ pRetval = *aCandidate;
+ maLayer.erase(aCandidate);
}
- aLayer.Clear();
-}
-
-const SdrLayerAdmin& SdrLayerAdmin::operator=(const SdrLayerAdmin& rSrcLayerAdmin)
-{
- ClearLayer();
- pParent=rSrcLayerAdmin.pParent;
- sal_uInt16 i;
- sal_uInt16 nAnz=rSrcLayerAdmin.GetLayerCount();
- for (i=0; i<nAnz; i++) {
- aLayer.Insert(new SdrLayer(*rSrcLayerAdmin.GetLayer(i)),CONTAINER_APPEND);
+ else
+ {
+ OSL_ENSURE(false, "SdrLayerAdmin::RemoveLayer with wrong index (!)");
}
- return *this;
-}
-bool SdrLayerAdmin::operator==(const SdrLayerAdmin& rCmpLayerAdmin) const
-{
- if (pParent!=rCmpLayerAdmin.pParent ||
- aLayer.Count()!=rCmpLayerAdmin.aLayer.Count() ||
- aLSets.Count()!=rCmpLayerAdmin.aLSets.Count()) return sal_False;
- FASTBOOL bOk=sal_True;
- sal_uInt16 nAnz=GetLayerCount();
- sal_uInt16 i=0;
- while (bOk && i<nAnz) {
- bOk=*GetLayer(i)==*rCmpLayerAdmin.GetLayer(i);
- i++;
+ if(pRetval)
+ {
+ Broadcast();
}
- return bOk;
-}
-void SdrLayerAdmin::SetModel(SdrModel* pNewModel)
-{
- if (pNewModel!=pModel) {
- pModel=pNewModel;
- sal_uInt16 nAnz=GetLayerCount();
- sal_uInt16 i;
- for (i=0; i<nAnz; i++) {
- GetLayer(i)->SetModel(pNewModel);
- }
- }
+ return pRetval;
}
-void SdrLayerAdmin::Broadcast() const
+SdrLayer* SdrLayerAdmin::NewLayer(const XubString& rName, sal_uInt32 nPos)
{
- if (pModel!=NULL) {
- SdrHint aHint(HINT_LAYERORDERCHG);
- pModel->Broadcast(aHint);
- pModel->SetChanged();
+ const SdrLayerID nID(GetUniqueLayerID());
+ SdrLayer* pLayer = new SdrLayer(nID, rName, GetSdrModel());
+
+ if(nPos >= maLayer.size())
+ {
+ maLayer.push_back(pLayer);
+ }
+ else
+ {
+ maLayer.insert(maLayer.begin() + nPos, pLayer);
}
-}
-SdrLayer* SdrLayerAdmin::RemoveLayer(sal_uInt16 nPos)
-{
- SdrLayer* pRetLayer=(SdrLayer*)(aLayer.Remove(nPos));
Broadcast();
- return pRetLayer;
-}
-SdrLayer* SdrLayerAdmin::NewLayer(const XubString& rName, sal_uInt16 nPos)
-{
- SdrLayerID nID=GetUniqueLayerID();
- SdrLayer* pLay=new SdrLayer(nID,rName);
- pLay->SetModel(pModel);
- aLayer.Insert(pLay,nPos);
- Broadcast();
- return pLay;
+ return pLayer;
}
-SdrLayer* SdrLayerAdmin::NewStandardLayer(sal_uInt16 nPos)
+void SdrLayerAdmin::DeleteLayer(SdrLayer* pLayer)
{
- SdrLayerID nID=GetUniqueLayerID();
- SdrLayer* pLay=new SdrLayer(nID,String());
- pLay->SetStandardLayer();
- pLay->SetModel(pModel);
- aLayer.Insert(pLay,nPos);
- Broadcast();
- return pLay;
+ if(pLayer)
+ {
+ bool bFound(false);
+
+ for(SdrLayerContainerType::iterator aCandidate(maLayer.begin());
+ !bFound && aCandidate != maLayer.end(); aCandidate++)
+ {
+ if(*aCandidate == pLayer)
+ {
+ bFound = true;
+ maLayer.erase(aCandidate);
+ }
+ }
+
+ if(bFound)
+ {
+ delete pLayer;
+ Broadcast();
+ }
+ }
}
-SdrLayer* SdrLayerAdmin::MoveLayer(sal_uInt16 nPos, sal_uInt16 nNewPos)
+SdrLayer* SdrLayerAdmin::NewStandardLayer(sal_uInt32 nPos)
{
- SdrLayer* pLayer=(SdrLayer*)(aLayer.Remove(nPos));
- if (pLayer!=NULL) {
- aLayer.Insert(pLayer,nNewPos);
+ const SdrLayerID nID(GetUniqueLayerID());
+ SdrLayer* pLayer = new SdrLayer(nID, String(), GetSdrModel());
+
+ pLayer->SetStandardLayer();
+
+ if(nPos >= maLayer.size())
+ {
+ maLayer.push_back(pLayer);
+ }
+ else
+ {
+ maLayer.insert(maLayer.begin() + nPos, pLayer);
}
Broadcast();
+
return pLayer;
}
-void SdrLayerAdmin::MoveLayer(SdrLayer* pLayer, sal_uInt16 nNewPos)
+sal_uInt32 SdrLayerAdmin::GetLayerPos(SdrLayer* pLayer) const
{
- sal_uIntPtr nPos=aLayer.GetPos(pLayer);
- if (nPos!=CONTAINER_ENTRY_NOTFOUND) {
- aLayer.Remove(nPos);
- aLayer.Insert(pLayer,nNewPos);
- Broadcast();
- }
-}
+ if(pLayer)
+ {
+ sal_uInt32 a(0);
-sal_uInt16 SdrLayerAdmin::GetLayerPos(SdrLayer* pLayer) const
-{
- sal_uIntPtr nRet=SDRLAYER_NOTFOUND;
- if (pLayer!=NULL) {
- nRet=aLayer.GetPos(pLayer);
- if (nRet==CONTAINER_ENTRY_NOTFOUND) {
- nRet=SDRLAYER_NOTFOUND;
+ for(SdrLayerContainerType::const_iterator aCandidate(maLayer.begin());
+ aCandidate != maLayer.end(); a++, aCandidate++)
+ {
+ if(*aCandidate == pLayer)
+ {
+ return a;
+ }
}
}
- return sal_uInt16(nRet);
+
+ return SDRLAYER_NOTFOUND;
}
-const SdrLayer* SdrLayerAdmin::GetLayer(const XubString& rName, FASTBOOL /*bInherited*/) const
+SdrLayer* SdrLayerAdmin::GetLayer(const XubString& rName, bool /*bInherited*/) const
{
- sal_uInt16 i(0);
- const SdrLayer* pLay = NULL;
+ SdrLayer* pFound = 0;
- while(i < GetLayerCount() && !pLay)
+ for(SdrLayerContainerType::const_iterator aCandidate(maLayer.begin());
+ !pFound && aCandidate != maLayer.end(); aCandidate++)
{
- if(rName.Equals(GetLayer(i)->GetName()))
- pLay = GetLayer(i);
- else
- i++;
+ if(rName == (*aCandidate)->GetName())
+ {
+ pFound = *aCandidate;
+ }
}
- if(!pLay && pParent)
+ if(!pFound && GetParent())
{
- pLay = pParent->GetLayer(rName, sal_True);
+ pFound = GetParent()->GetLayer(rName, true);
}
- return pLay;
+ return pFound;
}
-SdrLayerID SdrLayerAdmin::GetLayerID(const XubString& rName, FASTBOOL bInherited) const
+SdrLayerID SdrLayerAdmin::GetLayerID(const XubString& rName, bool bInherited) const
{
- SdrLayerID nRet=SDRLAYER_NOTFOUND;
- const SdrLayer* pLay=GetLayer(rName,bInherited);
- if (pLay!=NULL) nRet=pLay->GetID();
- return nRet;
+ const SdrLayer* pLayer = GetLayer(rName, bInherited);
+
+ if(pLayer)
+ {
+ return pLayer->GetID();
+ }
+ else
+ {
+ return SDRLAYER_NOTFOUND;
+ }
}
-const SdrLayer* SdrLayerAdmin::GetLayerPerID(sal_uInt16 nID) const
+SdrLayer* SdrLayerAdmin::GetLayerPerID(SdrLayerID nID) const
{
- sal_uInt16 i=0;
- const SdrLayer* pLay=NULL;
- while (i<GetLayerCount() && pLay==NULL) {
- if (nID==GetLayer(i)->GetID()) pLay=GetLayer(i);
- else i++;
+ for(SdrLayerContainerType::const_iterator aCandidate(maLayer.begin());
+ aCandidate != maLayer.end(); aCandidate++)
+ {
+ if(nID == (*aCandidate)->GetID())
+ {
+ return *aCandidate;
+ }
}
- return pLay;
+
+ return 0;
}
// Globale LayerID's beginnen mit 0 aufsteigend.
@@ -426,29 +328,62 @@ const SdrLayer* SdrLayerAdmin::GetLayerPerID(sal_uInt16 nID) const
SdrLayerID SdrLayerAdmin::GetUniqueLayerID() const
{
SetOfByte aSet;
- sal_Bool bDown = (pParent == NULL);
- sal_uInt16 j;
- for (j=0; j<GetLayerCount(); j++)
+ bool bDown(!GetParent());
+
+ for(SdrLayerContainerType::const_iterator aCandidate(maLayer.begin());
+ aCandidate != maLayer.end(); aCandidate++)
{
- aSet.Set(GetLayer((sal_uInt16)j)->GetID());
+ aSet.Set((*aCandidate)->GetID());
}
+
SdrLayerID i;
+
if (!bDown)
{
i=254;
+
while (i && aSet.IsSet(sal_uInt8(i)))
+ {
--i;
- if (i == 0)
+ }
+
+ if(!i)
+ {
i=254;
+ }
}
else
{
i=0;
+
while (i<=254 && aSet.IsSet(sal_uInt8(i)))
+ {
i++;
+ }
+
if (i>254)
+ {
i=0;
+ }
}
+
return i;
}
+const String& SdrLayerAdmin::GetControlLayerName() const
+{
+ if(maControlLayerName.Len())
+ {
+ return maControlLayerName;
+ }
+ else
+ {
+ static const sal_Char aTextControls[] = "Controls";
+ static const String aString(aTextControls, sizeof(aTextControls - 1));
+
+ return aString;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdlegacy.cxx b/svx/source/svdraw/svdlegacy.cxx
new file mode 100644
index 000000000000..e5f0a2872fbe
--- /dev/null
+++ b/svx/source/svdraw/svdlegacy.cxx
@@ -0,0 +1,469 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/svdlegacy.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdpage.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// helpers for old access styles
+
+namespace sdr
+{
+ namespace legacy
+ {
+ Rectangle GetBoundRect(const SdrObject& rObject, const SdrView* pSdrView)
+ {
+ const basegfx::B2DRange& rRange = rObject.getObjectRange(pSdrView);
+
+ if(rRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY()));
+ }
+ }
+
+ basegfx::B2DRange GetAllObjBoundRange(const SdrObjectVector& rObjVec, const SdrView* pSdrView)
+ {
+ basegfx::B2DRange aRetval;
+
+ for(SdrObjectVector::const_iterator aCandidate = rObjVec.begin();
+ aCandidate != rObjVec.end();
+ ++aCandidate)
+ {
+ aRetval.expand((*aCandidate)->getObjectRange(pSdrView));
+ }
+
+ return aRetval;
+ }
+
+ Rectangle GetAllObjBoundRect(const SdrObjectVector& rObjVec, const SdrView* pSdrView)
+ {
+ const basegfx::B2DRange aBoundRange(GetAllObjBoundRange(rObjVec, pSdrView));
+
+ if(aBoundRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(aBoundRange.getMinX()), (sal_Int32)floor(aBoundRange.getMinY()),
+ (sal_Int32)ceil(aBoundRange.getMaxX()), (sal_Int32)ceil(aBoundRange.getMaxY()));
+ }
+ }
+
+ basegfx::B2DRange GetSnapRange(const SdrObject& rObject)
+ {
+ return rObject.getSnapRange();
+// return rObject.getSdrObjectTransformation() * basegfx::B2DRange::getUnitB2DRange();
+ }
+
+ Rectangle GetSnapRect(const SdrObject& rObject)
+ {
+ const basegfx::B2DRange aSnapRange(GetSnapRange(rObject));
+
+ if(aSnapRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(aSnapRange.getMinX()), (sal_Int32)floor(aSnapRange.getMinY()),
+ (sal_Int32)ceil(aSnapRange.getMaxX()), (sal_Int32)ceil(aSnapRange.getMaxY()));
+ }
+ }
+
+ void SetSnapRange(SdrObject& rObject, const basegfx::B2DRange& rRange)
+ {
+ if(rRange.isEmpty())
+ {
+ rObject.setSdrObjectTransformation(basegfx::B2DHomMatrix());
+ }
+ else
+ {
+ if(rObject.isRotatedOrSheared())
+ {
+ const basegfx::B2DRange aCurrentSnapRange(GetSnapRange(rObject));
+
+ if(aCurrentSnapRange != rRange)
+ {
+ basegfx::B2DHomMatrix aRemoveCurrent;
+ basegfx::B2DRange aCorrected(rRange);
+
+ aRemoveCurrent.translate(-rObject.getSdrObjectTranslate());
+ aRemoveCurrent.rotate(-rObject.getSdrObjectRotate());
+ aRemoveCurrent.shearX(tan(-rObject.getSdrObjectShearX()));
+ aCorrected.transform(aRemoveCurrent);
+
+ const basegfx::B2DVector aScale(
+ rObject.isMirroredX() ? -aCorrected.getWidth() : aCorrected.getWidth(),
+ rObject.isMirroredY() ? -aCorrected.getHeight() : aCorrected.getHeight());
+
+ rObject.setSdrObjectTransformation(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ rObject.getSdrObjectShearX(),
+ rObject.getSdrObjectRotate(),
+ aCorrected.getMinimum()));
+ }
+ }
+ else
+ {
+ // no rotate and/or shear, thus the same as SetLogicRange
+ // without rotate/shear
+ const basegfx::B2DVector aScale(
+ rObject.isMirroredX() ? -rRange.getWidth() : rRange.getWidth(),
+ rObject.isMirroredY() ? -rRange.getHeight() : rRange.getHeight());
+
+ rObject.setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ rRange.getMinimum()));
+ }
+ }
+ }
+
+ void SetSnapRect(SdrObject& rObject, const Rectangle& rRectangle)
+ {
+ if(rRectangle.IsEmpty())
+ {
+ rObject.setSdrObjectTransformation(basegfx::B2DHomMatrix());
+ }
+ else
+ {
+ const basegfx::B2DRange aSnapRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ SetSnapRange(rObject, aSnapRange);
+ }
+ }
+
+ basegfx::B2DRange GetAllObjSnapRange(const SdrObjectVector& rObjVec)
+ {
+ basegfx::B2DRange aRetval;
+
+ for(SdrObjectVector::const_iterator aCandidate = rObjVec.begin();
+ aCandidate != rObjVec.end();
+ ++aCandidate)
+ {
+ aRetval.expand(GetSnapRange(*(*aCandidate)));
+ }
+
+ return aRetval;
+ }
+
+ Rectangle GetAllObjSnapRect(const SdrObjectVector& rObjVec)
+ {
+ const basegfx::B2DRange aSnapRange(GetAllObjSnapRange(rObjVec));
+
+ if(aSnapRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(aSnapRange.getMinX()), (sal_Int32)floor(aSnapRange.getMinY()),
+ (sal_Int32)ceil(aSnapRange.getMaxX()), (sal_Int32)ceil(aSnapRange.getMaxY()));
+ }
+ }
+
+ basegfx::B2DRange GetLogicRange(const SdrObject& rObject)
+ {
+ const basegfx::B2DHomMatrix& rObjectMatrix(rObject.getSdrObjectTransformation());
+
+ if(rObjectMatrix.isIdentity())
+ {
+ return basegfx::B2DRange();
+ }
+ else
+ {
+ // build range without rotation, mirror and shear
+ return basegfx::B2DRange(
+ rObject.getSdrObjectTranslate(),
+ rObject.getSdrObjectTranslate() + basegfx::absolute(rObject.getSdrObjectScale()));
+ }
+ }
+
+ Rectangle GetLogicRect(const SdrObject& rObject)
+ {
+ const basegfx::B2DRange aLogicRange(GetLogicRange(rObject));
+
+ if(aLogicRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(aLogicRange.getMinX()), (sal_Int32)floor(aLogicRange.getMinY()),
+ (sal_Int32)ceil(aLogicRange.getMaxX()), (sal_Int32)ceil(aLogicRange.getMaxY()));
+ }
+ }
+
+ void SetLogicRange(SdrObject& rObject, const basegfx::B2DRange& rRange)
+ {
+ if(rRange.isEmpty())
+ {
+ rObject.setSdrObjectTransformation(basegfx::B2DHomMatrix());
+ }
+ else
+ {
+ // keep mirroring, rotation and shear, replace absolute size and translation
+ const basegfx::B2DVector aScale(
+ rObject.isMirroredX() ? -rRange.getWidth() : rRange.getWidth(),
+ rObject.isMirroredY() ? -rRange.getHeight() : rRange.getHeight());
+
+ if(rObject.isRotatedOrSheared())
+ {
+ rObject.setSdrObjectTransformation(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ rObject.getSdrObjectShearX(),
+ rObject.getSdrObjectRotate(),
+ rRange.getMinimum()));
+ }
+ else
+ {
+ rObject.setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ rRange.getMinimum()));
+ }
+ }
+ }
+
+ void SetLogicRect(SdrObject& rObject, const Rectangle& rRectangle)
+ {
+ if(rRectangle.IsEmpty())
+ {
+ rObject.setSdrObjectTransformation(basegfx::B2DHomMatrix());
+ }
+ else
+ {
+ const basegfx::B2DRange aLogicRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ SetLogicRange(rObject, aLogicRange);
+ }
+ }
+
+ Point GetAnchorPos(const SdrObject& rObject)
+ {
+ const basegfx::B2DPoint& rAnchor = rObject.GetAnchorPos();
+
+ return Point(basegfx::fround(rAnchor.getX()), basegfx::fround(rAnchor.getY()));
+ }
+
+ long GetRotateAngle(const SdrObject& rObject)
+ {
+ if(rObject.isRotated())
+ {
+ const double fRotate(rObject.getSdrObjectRotate());
+ const double fSnapped(basegfx::snapToZeroRange(-fRotate / F_PI18000, 36000.0));
+
+ return basegfx::fround(fSnapped);
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ long GetShearAngleX(const SdrObject& rObject)
+ {
+ if(rObject.isSheared())
+ {
+ const double fShearX(rObject.getSdrObjectShearX());
+ long nRetval(basegfx::fround(-atan(fShearX) / F_PI18000));
+
+ while(nRetval < -18000)
+ {
+ nRetval += 36000;
+ }
+
+ while(nRetval >= 18000)
+ {
+ nRetval -= 36000;
+ }
+
+ return nRetval;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ void transformSdrObject(SdrObject& rObject, const basegfx::B2DHomMatrix& rTransform)
+ {
+ if(!rTransform.isIdentity())
+ {
+ basegfx::B2DHomMatrix aObjectMatrix(rObject.getSdrObjectTransformation());
+
+ if(aObjectMatrix.isIdentity())
+ {
+ rObject.setSdrObjectTransformation(rTransform);
+ }
+ else
+ {
+ aObjectMatrix = rTransform * aObjectMatrix;
+
+ rObject.setSdrObjectTransformation(aObjectMatrix);
+ }
+ }
+ }
+
+ void MoveSdrObject(SdrObject& rObject, const Size& rSiz)
+ {
+ const long nWidth(rSiz.Width());
+ const long nHeight(rSiz.Height());
+
+ if(nWidth || nHeight)
+ {
+ transformSdrObject(rObject, basegfx::tools::createTranslateB2DHomMatrix(nWidth, nHeight));
+ }
+ }
+
+ void ResizeSdrObject(SdrObject& rObject, const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+ {
+ const basegfx::B2DTuple aScale(xFact, yFact);
+
+ if(!aScale.equalZero())
+ {
+ const basegfx::B2DTuple aRefPoint(rRef.X(), rRef.Y());
+
+ if(aRefPoint.equalZero())
+ {
+ transformSdrObject(rObject, basegfx::tools::createScaleB2DHomMatrix(aScale));
+ }
+ else
+ {
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aRefPoint);
+ aTransform.scale(aScale);
+ aTransform.translate(aRefPoint);
+
+ transformSdrObject(rObject, aTransform);
+ }
+ }
+ }
+
+ void RotateSdrObject(SdrObject& rObject, const Point& rRef, long nWink)
+ {
+ if(0 != nWink)
+ {
+ const double fAngle((-nWink * F_PI) / 18000.0);
+ const basegfx::B2DTuple aRefPoint(rRef.X(), rRef.Y());
+
+ if(aRefPoint.equalZero())
+ {
+ transformSdrObject(rObject, basegfx::tools::createRotateB2DHomMatrix(fAngle));
+ }
+ else
+ {
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aRefPoint);
+ aTransform.rotate(fAngle);
+ aTransform.translate(aRefPoint);
+
+ transformSdrObject(rObject, aTransform);
+ }
+ }
+ }
+
+ void MirrorSdrObject(SdrObject& rObject, const Point& rRef1, const Point& rRef2)
+ {
+ if(rRef1 != rRef2)
+ {
+ const basegfx::B2DVector aMirrorEdge(rRef2.X() - rRef1.X(), rRef2.Y() - rRef1.Y());
+ const double fAngleToXAxis(atan2(aMirrorEdge.getY(), aMirrorEdge.getX()));
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-rRef1.X(), -rRef1.Y());
+ aTransform.rotate(-fAngleToXAxis);
+ aTransform.scale(1.0, -1.0);
+ aTransform.rotate(fAngleToXAxis);
+ aTransform.translate(rRef1.X(), rRef1.Y());
+
+ transformSdrObject(rObject, aTransform);
+ }
+ }
+
+ void ShearSdrObject(SdrObject& rObject, const Point& rRef, long nWink, bool bVShear)
+ {
+ if(nWink)
+ {
+ const double fAngle((-nWink * F_PI) / 18000.0);
+ const basegfx::B2DTuple aRefPoint(rRef.X(), rRef.Y());
+
+ if(aRefPoint.equalZero())
+ {
+ if(bVShear)
+ {
+ transformSdrObject(rObject, basegfx::tools::createShearYB2DHomMatrix(tan(fAngle)));
+ }
+ else
+ {
+ transformSdrObject(rObject, basegfx::tools::createShearXB2DHomMatrix(tan(fAngle)));
+ }
+ }
+ else
+ {
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aRefPoint);
+
+ if(bVShear)
+ {
+ aTransform.shearY(tan(fAngle));
+ }
+ else
+ {
+ aTransform.shearX(tan(fAngle));
+ }
+
+ aTransform.translate(aRefPoint);
+
+ transformSdrObject(rObject, aTransform);
+ }
+ }
+ }
+
+ } // end of namespace legacy
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 0f198f6bd0de..f707dc4e425b 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -25,7 +25,6 @@
#include "precompiled_svx.hxx"
#include <svx/svdmodel.hxx>
-
#include <rtl/uuid.h>
#include <com/sun/star/lang/XComponent.hpp>
#include <osl/endian.h>
@@ -33,7 +32,6 @@
#include <math.h>
#include <tools/urlobj.hxx>
#include <unotools/ucbstreamhelper.hxx>
-
#include <tools/string.hxx>
#include <svl/whiter.hxx>
#include <svx/xit.hxx>
@@ -44,12 +42,11 @@
#include <svx/xflftrit.hxx>
#include <svx/xflhtit.hxx>
#include <svx/xlnstit.hxx>
-
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <editeng/editeng.hxx> // Fuer EditEngine::CreatePool()
-
#include <svx/xtable.hxx>
-
+#include <svx/svditer.hxx>
#include "svx/svditer.hxx"
#include <svx/svdtrans.hxx>
#include <svx/svdpage.hxx>
@@ -64,11 +61,6 @@
#include "svx/svdglob.hxx" // Stringcache
#include "svx/svdstr.hrc" // Objektname
#include "svdoutlinercache.hxx"
-
-#include "svx/xflclit.hxx"
-#include "svx/xflhtit.hxx"
-#include "svx/xlnclit.hxx"
-
#include <svl/asiancfg.hxx>
#include "editeng/fontitem.hxx"
#include <editeng/colritem.hxx>
@@ -81,304 +73,230 @@
#include "editeng/forbiddencharacterstable.hxx"
#include <svl/zforlist.hxx>
#include <comphelper/processfactory.hxx>
-
-// #90477#
#include <tools/tenccvt.hxx>
#include <unotools/syslocale.hxx>
-
-// #95114#
#include <vcl/svapp.hxx>
#include <svx/sdr/properties/properties.hxx>
#include <editeng/eeitem.hxx>
#include <svl/itemset.hxx>
+#include <svx/svdoedge.hxx>
+#include <svx/svdview.hxx>
+#include <svx/xflclit.hxx>
+#include <svx/xlnclit.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
////////////////////////////////////////////////////////////////////////////////////////////////////
+// helper to allow changing page number at SdrPage, but only from SdrModel
-struct SdrModelImpl
+void SVX_DLLPRIVATE SetPageNumberAtSdrPageFromSdrModel(SdrPage& rPage, sal_uInt32 nPageNum)
{
- SfxUndoManager* mpUndoManager;
- SdrUndoFactory* mpUndoFactory;
- bool mbAllowShapePropertyChangeListener;
-};
+ rPage.SetPageNumber(nPageNum);
+}
////////////////////////////////////////////////////////////////////////////////////////////////////
+// helper to allow changing SdrModel at SdrPage, but only from SdrModel
-DBG_NAME(SdrModel)
-TYPEINIT1(SdrModel,SfxBroadcaster);
-void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbeddedHelper,
- bool bUseExtColorTable, bool bLoadRefCounts)
-{
- mpImpl = new SdrModelImpl;
- mpImpl->mpUndoManager=0;
- mpImpl->mpUndoFactory=0;
- mpImpl->mbAllowShapePropertyChangeListener=false;
- mbInDestruction=false;
- aObjUnit=SdrEngineDefaults::GetMapFraction();
- eObjUnit=SdrEngineDefaults::GetMapUnit();
- eUIUnit=FUNIT_MM;
- aUIScale=Fraction(1,1);
- nUIUnitKomma=0;
- bUIOnlyKomma=sal_False;
- pLayerAdmin=NULL;
- pItemPool=pPool;
- bMyPool=sal_False;
- m_pEmbeddedHelper=_pEmbeddedHelper;
- pDrawOutliner=NULL;
- pHitTestOutliner=NULL;
- pRefOutDev=NULL;
- nProgressAkt=0;
- nProgressMax=0;
- nProgressOfs=0;
- pDefaultStyleSheet=NULL;
- mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj = 0;
- pLinkManager=NULL;
- pUndoStack=NULL;
- pRedoStack=NULL;
- nMaxUndoCount=16;
- pAktUndoGroup=NULL;
- nUndoLevel=0;
- mbUndoEnabled=true;
- nProgressPercent=0;
- nLoadVersion=0;
- bExtColorTable=sal_False;
- mbChanged = sal_False;
- bInfoChanged=sal_False;
- bPagNumsDirty=sal_False;
- bMPgNumsDirty=sal_False;
- bPageNotValid=sal_False;
- bSavePortable=sal_False;
- bSaveCompressed=sal_False;
- bSaveNative=sal_False;
- bSwapGraphics=sal_False;
- nSwapGraphicsMode=SDR_SWAPGRAPHICSMODE_DEFAULT;
- bSaveOLEPreview=sal_False;
- bPasteResize=sal_False;
- bNoBitmapCaching=sal_False;
- bReadOnly=sal_False;
- nStreamCompressMode=COMPRESSMODE_NONE;
- nStreamNumberFormat=NUMBERFORMAT_INT_BIGENDIAN;
- nDefaultTabulator=0;
- pColorTable=NULL;
- pDashList=NULL;
- pLineEndList=NULL;
- pHatchList=NULL;
- pGradientList=NULL;
- pBitmapList=NULL;
- mpNumberFormatter = NULL;
- bTransparentTextFrames=sal_False;
- bStarDrawPreviewMode = sal_False;
- nStarDrawPreviewMasterPageNum = SDRPAGE_NOTFOUND;
- pModelStorage = NULL;
- mpForbiddenCharactersTable = NULL;
- mbModelLocked = sal_False;
- mpOutlinerCache = NULL;
- mbKernAsianPunctuation = sal_False;
- mbAddExtLeading = sal_False;
- mnHandoutPageCount = 0;
+void SVX_DLLPRIVATE SetInsertedAtSdrPageFromSdrModel(SdrPage& rPage, bool bInserted)
+{
+ rPage.SetInserted(bInserted);
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable)
+: mxUnoModel(),
+ maMasterPageVector(),
+ maPageVector(),
+ mpModelLayerAdmin(0),
+ mpItemPool(pPool),
+ maUndoLink(),
+ mpUndoStack(0),
+ mpRedoStack(0),
+ mpCurrentUndoGroup(0),
+ mnUndoLevel(0),
+ mnMaxUndoCount(16),
+ mpUndoManager(0),
+ mpUndoFactory(0),
+ maMaxObjectScale(0.0, 0.0),
+ maExchangeObjectScale(SdrEngineDefaults::GetMapFraction()),
+ meExchangeObjectUnit(SdrEngineDefaults::GetMapUnit()),
+ meUIUnit(FUNIT_MM),
+ maUIScale(1, 1),
+ maUIUnitString(),
+ maUIUnitScale(),
+ mnUIUnitKomma(0),
+ mpDrawOutliner(0),
+ mpOutlinerCache(0),
+ mxStyleSheetPool(),
+ mpDefaultStyleSheet(0),
+ mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(0),
+ m_pEmbeddedHelper(pPers),
+ mpReferenceOutputDevice(0),
+ mpLinkManager(0),
+ mpForbiddenCharactersTable(0),
+ mpNumberFormatter(0),
+ mnDefaultFontHeight(SdrEngineDefaults::GetFontHeight()),
+ mnSwapGraphicsMode(SDR_SWAPGRAPHICSMODE_DEFAULT),
+ mnDefaultTabulator(0),
+ mnCharCompressType(0),
+ maTablePath(rPath),
+ mpColorTable(0),
+ mpDashList(0),
+ mpLineEndList(0),
+ mpHatchList(0),
+ mpGradientList(0),
+ mpBitmapList(0),
+ mnHandoutPageCount(0),
+ mbDeletePool(false),
+ mbUndoEnabled(true),
+ mbChanged(false),
+ mbExternalColorTable(bUseExtColorTable),
+ mbReadOnly(false),
+ mbPickThroughTransparentTextFrames(false),
+ mbSwapGraphics(false),
+ mbStarDrawPreviewMode(false),
+ mbModelLocked(false),
+ mbKernAsianPunctuation(false),
+ mbAddExtLeading(false),
+ mbInDestruction(false)
+{
SvxAsianConfig aAsian;
mnCharCompressType = aAsian.GetCharDistanceCompression();
-#ifdef OSL_LITENDIAN
- nStreamNumberFormat=NUMBERFORMAT_INT_LITTLEENDIAN;
-#endif
- bExtColorTable=bUseExtColorTable;
-
- if ( pPool == NULL )
+ if(!mpItemPool)
{
- pItemPool=new SdrItemPool(0L, bLoadRefCounts);
- // Der Outliner hat keinen eigenen Pool, deshalb den der EditEngine
- SfxItemPool* pOutlPool=EditEngine::CreatePool( bLoadRefCounts );
- // OutlinerPool als SecondaryPool des SdrPool
- pItemPool->SetSecondaryPool(pOutlPool);
- // Merken, dass ich mir die beiden Pools selbst gemacht habe
- bMyPool=sal_True;
+ mpItemPool = new SdrItemPool(0, false);
+ SfxItemPool* pOutlPool = EditEngine::CreatePool(false);
+ GetItemPool().SetSecondaryPool(pOutlPool);
+ mbDeletePool = true;
}
- pItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit);
-
-// SJ: #95129# using static SdrEngineDefaults only if default SvxFontHeight item is not available
- const SfxPoolItem* pPoolItem = pItemPool->GetPoolDefaultItem( EE_CHAR_FONTHEIGHT );
- if ( pPoolItem )
- nDefTextHgt = ((SvxFontHeightItem*)pPoolItem)->GetHeight();
- else
- nDefTextHgt = SdrEngineDefaults::GetFontHeight();
- pItemPool->SetPoolDefaultItem( SdrTextWordWrapItem( sal_False ) );
+ GetItemPool().SetDefaultMetric((SfxMapUnit)GetExchangeObjectUnit());
- SetTextDefaults();
+ // SJ: #95129# using static SdrEngineDefaults only if default SvxFontHeight item is not available
+ const SfxPoolItem* pPoolItem = GetItemPool().GetPoolDefaultItem( EE_CHAR_FONTHEIGHT );
- pLayerAdmin=new SdrLayerAdmin;
- pLayerAdmin->SetModel(this);
- ImpSetUIUnit();
-
- // den DrawOutliner OnDemand erzeugen geht noch nicht, weil ich den Pool
- // sonst nicht kriege (erst ab 302!)
- pDrawOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this );
- ImpSetOutlinerDefaults(pDrawOutliner, sal_True);
-
- pHitTestOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this );
- ImpSetOutlinerDefaults(pHitTestOutliner, sal_True);
-
- ImpCreateTables();
-}
-
-SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
- maMaPag(1024,32,32),
- maPages(1024,32,32)
-{
-#ifdef TIMELOG
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
-#endif
-
- DBG_CTOR(SdrModel,NULL);
- ImpCtor(pPool,pPers,sal_False, (FASTBOOL)bLoadRefCounts);
-}
-
-SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, sal_Bool bLoadRefCounts):
- maMaPag(1024,32,32),
- maPages(1024,32,32),
- aTablePath(rPath)
-{
-#ifdef TIMELOG
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
-#endif
-
- DBG_CTOR(SdrModel,NULL);
- ImpCtor(pPool,pPers,sal_False, (FASTBOOL)bLoadRefCounts);
-}
+ if(pPoolItem)
+ {
+ mnDefaultFontHeight = ((SvxFontHeightItem*)pPoolItem)->GetHeight();
+ }
-SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, FASTBOOL bUseExtColorTable, sal_Bool bLoadRefCounts):
- maMaPag(1024,32,32),
- maPages(1024,32,32)
-{
-#ifdef TIMELOG
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
-#endif
+ SetTextDefaults(&GetItemPool(), GetDefaultFontHeight());
+ mpModelLayerAdmin = new SdrLayerAdmin(*this);
+ GetItemPool().SetPoolDefaultItem( SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, false) );
- DBG_CTOR(SdrModel,NULL);
- ImpCtor(pPool,pPers,bUseExtColorTable, (FASTBOOL)bLoadRefCounts);
-}
+ ImpSetUIUnit();
-SdrModel::SdrModel(const String& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, FASTBOOL bUseExtColorTable, sal_Bool bLoadRefCounts):
- maMaPag(1024,32,32),
- maPages(1024,32,32),
- aTablePath(rPath)
-{
-#ifdef TIMELOG
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
-#endif
+ mpDrawOutliner = SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, this);
+ ImpSetOutlinerDefaults(mpDrawOutliner, true);
- DBG_CTOR(SdrModel,NULL);
- ImpCtor(pPool,pPers,bUseExtColorTable, (FASTBOOL)bLoadRefCounts);
-}
+ XOutdevItemPool* pXOutdevItemPool = dynamic_cast< XOutdevItemPool* >(&GetItemPool());
-SdrModel::SdrModel(const SdrModel& /*rSrcModel*/):
- SfxBroadcaster(),
- tools::WeakBase< SdrModel >(),
- maMaPag(1024,32,32),
- maPages(1024,32,32)
-{
-#ifdef TIMELOG
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::SdrModel(...)" );
-#endif
+ if(!mbExternalColorTable)
+ {
+ mpColorTable = new XColorTable(maTablePath, pXOutdevItemPool);
+ }
- // noch nicht implementiert
- DBG_ERROR("SdrModel::CopyCtor() ist noch nicht implementiert");
+ mpDashList = new XDashList(maTablePath, pXOutdevItemPool);
+ mpLineEndList = new XLineEndList(maTablePath, pXOutdevItemPool);
+ mpHatchList = new XHatchList(maTablePath, pXOutdevItemPool);
+ mpGradientList = new XGradientList(maTablePath, pXOutdevItemPool);
+ mpBitmapList = new XBitmapList(maTablePath, pXOutdevItemPool);
}
SdrModel::~SdrModel()
{
-#ifdef TIMELOG
- RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "svx", "aw93748", "SdrModel::~SdrModel(...)" );
-#endif
-
- DBG_DTOR(SdrModel,NULL);
-
mbInDestruction = true;
- Broadcast(SdrHint(HINT_MODELCLEARED));
+ Broadcast(SdrBaseHint(HINT_MODELCLEARED));
delete mpOutlinerCache;
ClearUndoBuffer();
+
#ifdef DBG_UTIL
- if(pAktUndoGroup)
+ if(mpCurrentUndoGroup)
{
ByteString aStr("Im Dtor des SdrModel steht noch ein offenes Undo rum: \"");
- aStr += ByteString(pAktUndoGroup->GetComment(), gsl_getSystemTextEncoding());
+ aStr += ByteString(mpCurrentUndoGroup->GetComment(), gsl_getSystemTextEncoding());
aStr += '\"';
DBG_ERROR(aStr.GetBuffer());
}
#endif
- if (pAktUndoGroup!=NULL)
- delete pAktUndoGroup;
+
+ if(mpCurrentUndoGroup)
+ {
+ delete mpCurrentUndoGroup;
+ }
// #116168#
- ClearModel(sal_True);
+ ClearModel(true);
- delete pLayerAdmin;
+ delete mpModelLayerAdmin;
// Den DrawOutliner erst nach dem ItemPool loeschen, da
// der ItemPool Items des DrawOutliners referenziert !!! (<- das war mal)
// Wg. Problem bei Malte Reihenfolge wieder umgestellt.
// Loeschen des Outliners vor dem loeschen des ItemPools
- delete pHitTestOutliner;
- delete pDrawOutliner;
+ delete mpDrawOutliner;
// delete StyleSheetPool, derived classes should not do this since
// the DrawingEngine may need it in its destrctor (SB)
- if( mxStyleSheetPool.is() )
+ if(GetStyleSheetPool())
{
- Reference< XComponent > xComponent( dynamic_cast< cppu::OWeakObject* >( mxStyleSheetPool.get() ), UNO_QUERY );
- if( xComponent.is() ) try
+ Reference< XComponent > xComponent( dynamic_cast< cppu::OWeakObject* >(GetStyleSheetPool()), UNO_QUERY );
+
+ if(xComponent.is()) try
{
xComponent->dispose();
}
catch( RuntimeException& )
{
}
+
mxStyleSheetPool.clear();
}
- if (bMyPool)
+ if(mbDeletePool)
{
// Pools loeschen, falls es meine sind
- SfxItemPool* pOutlPool=pItemPool->GetSecondaryPool();
- SfxItemPool::Free(pItemPool);
+ SfxItemPool* pOutlPool = GetItemPool().GetSecondaryPool();
+ SfxItemPool::Free(&GetItemPool());
+
// Der OutlinerPool muss nach dem ItemPool plattgemacht werden, da der
// ItemPool SetItems enthaelt die ihrerseits Items des OutlinerPools
// referenzieren (Joe)
SfxItemPool::Free(pOutlPool);
}
- if( mpForbiddenCharactersTable )
+ if(mpForbiddenCharactersTable)
+ {
mpForbiddenCharactersTable->release();
+ }
// Tabellen, Listen und Paletten loeschen
- if (!bExtColorTable)
- delete pColorTable;
- delete pDashList;
- delete pLineEndList;
- delete pHatchList;
- delete pGradientList;
- delete pBitmapList;
+ if(!mbExternalColorTable)
+ {
+ delete mpColorTable;
+ }
+
+ delete mpDashList;
+ delete mpLineEndList;
+ delete mpHatchList;
+ delete mpGradientList;
+ delete mpBitmapList;
if(mpNumberFormatter)
+ {
delete mpNumberFormatter;
+ }
- delete mpImpl->mpUndoFactory;
- delete mpImpl;
-}
-
-bool SdrModel::IsInDestruction() const
-{
- return mbInDestruction;
+ delete mpUndoFactory;
}
const SvNumberFormatter& SdrModel::GetNumberFormatter() const
@@ -386,123 +304,181 @@ const SvNumberFormatter& SdrModel::GetNumberFormatter() const
if(!mpNumberFormatter)
{
// use cast here since from outside view this IS a const method
- ((SdrModel*)this)->mpNumberFormatter = new SvNumberFormatter(
- ::comphelper::getProcessServiceFactory(), LANGUAGE_SYSTEM);
+ const_cast< SdrModel* >(this)->mpNumberFormatter = new SvNumberFormatter(::comphelper::getProcessServiceFactory(), LANGUAGE_SYSTEM);
}
return *mpNumberFormatter;
}
-// noch nicht implementiert:
-void SdrModel::operator=(const SdrModel& /*rSrcModel*/)
+bool SdrModel::IsReadOnly() const
{
- DBG_ERROR("SdrModel::operator=() ist noch nicht implementiert");
+ return mbReadOnly;
}
-FASTBOOL SdrModel::operator==(const SdrModel& /*rCmpModel*/) const
+void SdrModel::SetReadOnly(bool bYes)
{
- DBG_ERROR("SdrModel::operator==() ist noch nicht implementiert");
- return sal_False;
+ if(mbReadOnly != bYes)
+ {
+ mbReadOnly = bYes;
+ }
}
-void SdrModel::SetSwapGraphics( FASTBOOL bSwap )
+void SdrModel::SetMaxUndoActionCount(sal_uInt32 nAnz)
{
- bSwapGraphics = bSwap;
-}
+ if(nAnz < 1)
+ {
+ nAnz = 1;
+ }
-FASTBOOL SdrModel::IsReadOnly() const
-{
- return bReadOnly;
+ if(GetMaxUndoActionCount() != nAnz)
+ {
+ mnMaxUndoCount = nAnz;
+
+ if(mpUndoStack)
+ {
+ while(mpUndoStack->size() > GetMaxUndoActionCount())
+ {
+ delete mpUndoStack->back();
+ mpUndoStack->pop_back();
+ }
+ }
+ }
}
-void SdrModel::SetReadOnly(FASTBOOL bYes)
+void SdrModel::ClearUndoBuffer()
{
- bReadOnly=bYes;
-}
+ if(mpUndoStack)
+ {
+ while(mpUndoStack->size())
+ {
+ delete mpUndoStack->back();
+ mpUndoStack->pop_back();
+ }
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ delete mpUndoStack;
+ mpUndoStack = 0;
+ }
-void SdrModel::SetMaxUndoActionCount(sal_uIntPtr nAnz)
-{
- if (nAnz<1) nAnz=1;
- nMaxUndoCount=nAnz;
- if (pUndoStack!=NULL) {
- while (pUndoStack->Count()>nMaxUndoCount) {
- delete (SfxUndoAction*) pUndoStack->Remove(pUndoStack->Count());
+ if(mpRedoStack)
+ {
+ while(mpRedoStack->size())
+ {
+ delete mpRedoStack->back();
+ mpRedoStack->pop_back();
}
+
+ delete mpRedoStack;
+ mpRedoStack = 0;
}
}
-void SdrModel::ClearUndoBuffer()
+const SfxUndoAction* SdrModel::GetUndoAction(sal_uInt32 nNum) const
{
- if (pUndoStack!=NULL) {
- while (pUndoStack->Count()!=0) {
- delete (SfxUndoAction*) pUndoStack->Remove(pUndoStack->Count()-1);
+ if(mpUndoStack)
+ {
+ if(nNum < mpUndoStack->size())
+ {
+ return *(mpUndoStack->begin() + nNum);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::GetUndoAction access out of range (!)");
}
- delete pUndoStack;
- pUndoStack=NULL;
}
- if (pRedoStack!=NULL) {
- while (pRedoStack->Count()!=0) {
- delete (SfxUndoAction*) pRedoStack->Remove(pRedoStack->Count()-1);
+
+ return 0;
+}
+
+const SfxUndoAction* SdrModel::GetRedoAction(sal_uInt32 nNum) const
+{
+ if(mpRedoStack)
+ {
+ if(nNum < mpRedoStack->size())
+ {
+ return *(mpRedoStack->begin() + nNum);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::GetRedoAction access out of range (!)");
}
- delete pRedoStack;
- pRedoStack=NULL;
}
+
+ return 0;
}
-FASTBOOL SdrModel::Undo()
+bool SdrModel::Undo()
{
- FASTBOOL bRet=sal_False;
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
DBG_ERROR("svx::SdrModel::Undo(), method not supported with application undo manager!");
}
else
{
- SfxUndoAction* pDo=(SfxUndoAction*)GetUndoAction(0);
- if(pDo!=NULL)
+ SfxUndoAction* pDo = (SfxUndoAction*)GetUndoAction(0);
+
+ if(pDo)
{
- const bool bWasUndoEnabled = mbUndoEnabled;
+ const bool bWasUndoEnabled(mbUndoEnabled);
+
mbUndoEnabled = false;
pDo->Undo();
- if(pRedoStack==NULL)
- pRedoStack=new Container(1024,16,16);
- pRedoStack->Insert(pUndoStack->Remove((sal_uIntPtr)0),(sal_uIntPtr)0);
+
+ if(!mpRedoStack)
+ {
+ mpRedoStack = new SfxUndoActionContainerType();
+ }
+
+ const SfxUndoActionContainerType::iterator aCandidate(mpUndoStack->begin());
+ SfxUndoAction* pCandidate = *aCandidate;
+ mpUndoStack->erase(aCandidate);
+ mpRedoStack->insert(mpRedoStack->begin(), pCandidate);
mbUndoEnabled = bWasUndoEnabled;
+
+ return true;
}
}
- return bRet;
+
+ return false;
}
-FASTBOOL SdrModel::Redo()
+bool SdrModel::Redo()
{
- FASTBOOL bRet=sal_False;
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
DBG_ERROR("svx::SdrModel::Redo(), method not supported with application undo manager!");
}
else
{
- SfxUndoAction* pDo=(SfxUndoAction*)GetRedoAction(0);
- if(pDo!=NULL)
+ SfxUndoAction* pDo = (SfxUndoAction*)GetRedoAction(0);
+
+ if(pDo)
{
- const bool bWasUndoEnabled = mbUndoEnabled;
+ const bool bWasUndoEnabled(mbUndoEnabled);
+
mbUndoEnabled = false;
pDo->Redo();
- if(pUndoStack==NULL)
- pUndoStack=new Container(1024,16,16);
- pUndoStack->Insert(pRedoStack->Remove((sal_uIntPtr)0),(sal_uIntPtr)0);
+
+ if(!mpUndoStack)
+ {
+ mpUndoStack = new SfxUndoActionContainerType();
+ }
+
+ const SfxUndoActionContainerType::iterator aCandidate(mpRedoStack->begin());
+ SfxUndoAction* pCandidate = *aCandidate;
+ mpRedoStack->erase(aCandidate);
+ mpUndoStack->insert(mpUndoStack->begin(), pCandidate);
mbUndoEnabled = bWasUndoEnabled;
+
+ return true;
}
}
- return bRet;
+
+ return false;
}
-FASTBOOL SdrModel::Repeat(SfxRepeatTarget& rView)
+bool SdrModel::Repeat(SfxRepeatTarget& rView)
{
- FASTBOOL bRet=sal_False;
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager )
{
DBG_ERROR("svx::SdrModel::Redo(), method not supported with application undo manager!");
}
@@ -514,33 +490,44 @@ FASTBOOL SdrModel::Repeat(SfxRepeatTarget& rView)
if(pDo->CanRepeat(rView))
{
pDo->Repeat(rView);
- bRet=sal_True;
+
+ return true;
}
}
}
- return bRet;
+
+ return false;
}
void SdrModel::ImpPostUndoAction(SdrUndoAction* pUndo)
{
- DBG_ASSERT( mpImpl->mpUndoManager == 0, "svx::SdrModel::ImpPostUndoAction(), method not supported with application undo manager!" );
- if( IsUndoEnabled() )
+ DBG_ASSERT(mpUndoManager == 0, "svx::SdrModel::ImpPostUndoAction(), method not supported with application undo manager!" );
+
+ if(IsUndoEnabled())
{
- if (aUndoLink.IsSet())
+ if(GetNotifyUndoActionHdl().IsSet())
{
- aUndoLink.Call(pUndo);
+ maUndoLink.Call(pUndo);
}
else
{
- if (pUndoStack==NULL)
- pUndoStack=new Container(1024,16,16);
- pUndoStack->Insert(pUndo,(sal_uIntPtr)0);
- while (pUndoStack->Count()>nMaxUndoCount)
+ if(!mpUndoStack)
{
- delete (SfxUndoAction*)pUndoStack->Remove(pUndoStack->Count()-1);
+ mpUndoStack = new SfxUndoActionContainerType();
+ }
+
+ mpUndoStack->insert(mpUndoStack->begin(), pUndo);
+
+ while(mpUndoStack->size() > GetMaxUndoActionCount())
+ {
+ delete mpUndoStack->back();
+ mpUndoStack->pop_back();
+ }
+
+ if(mpRedoStack)
+ {
+ mpRedoStack->clear();
}
- if (pRedoStack!=NULL)
- pRedoStack->Clear();
}
}
else
@@ -551,88 +538,94 @@ void SdrModel::ImpPostUndoAction(SdrUndoAction* pUndo)
void SdrModel::BegUndo()
{
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
const String aEmpty;
- mpImpl->mpUndoManager->EnterListAction(aEmpty,aEmpty);
- nUndoLevel++;
+
+ mpUndoManager->EnterListAction(aEmpty,aEmpty);
+ mnUndoLevel++;
}
- else if( IsUndoEnabled() )
+ else if(IsUndoEnabled())
{
- if(pAktUndoGroup==NULL)
+ if(!mpCurrentUndoGroup)
{
- pAktUndoGroup = new SdrUndoGroup(*this);
- nUndoLevel=1;
+ mpCurrentUndoGroup = new SdrUndoGroup(*this);
+ mnUndoLevel = 1;
}
else
{
- nUndoLevel++;
+ mnUndoLevel++;
}
}
}
void SdrModel::BegUndo(const XubString& rComment)
{
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
const String aEmpty;
- mpImpl->mpUndoManager->EnterListAction( rComment, aEmpty );
- nUndoLevel++;
+ mpUndoManager->EnterListAction(rComment, aEmpty);
+ mnUndoLevel++;
}
- else if( IsUndoEnabled() )
+ else if(IsUndoEnabled())
{
BegUndo();
- if (nUndoLevel==1)
+
+ if(IsLastEndUndo())
{
- pAktUndoGroup->SetComment(rComment);
+ mpCurrentUndoGroup->SetComment(rComment);
}
}
}
void SdrModel::BegUndo(const XubString& rComment, const XubString& rObjDescr, SdrRepeatFunc eFunc)
{
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager )
{
String aComment(rComment);
- if( aComment.Len() && rObjDescr.Len() )
+
+ if(aComment.Len() && rObjDescr.Len())
{
String aSearchString(RTL_CONSTASCII_USTRINGPARAM("%1"));
aComment.SearchAndReplace(aSearchString, rObjDescr);
}
+
const String aEmpty;
- mpImpl->mpUndoManager->EnterListAction( aComment,aEmpty );
- nUndoLevel++;
+
+ mpUndoManager->EnterListAction(aComment, aEmpty);
+ mnUndoLevel++;
}
- else if( IsUndoEnabled() )
+ else if(IsUndoEnabled())
{
BegUndo();
- if (nUndoLevel==1)
+
+ if(IsLastEndUndo())
{
- pAktUndoGroup->SetComment(rComment);
- pAktUndoGroup->SetObjDescription(rObjDescr);
- pAktUndoGroup->SetRepeatFunction(eFunc);
+ mpCurrentUndoGroup->SetComment(rComment);
+ mpCurrentUndoGroup->SetObjDescription(rObjDescr);
+ mpCurrentUndoGroup->SetRepeatFunction(eFunc);
}
}
}
void SdrModel::BegUndo(SdrUndoGroup* pUndoGrp)
{
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager )
{
DBG_ERROR("svx::SdrModel::BegUndo(), method not supported with application undo manager!" );
- nUndoLevel++;
+ mnUndoLevel++;
}
- else if( IsUndoEnabled() )
+ else if(IsUndoEnabled())
{
- if (pAktUndoGroup==NULL)
+ if(!mpCurrentUndoGroup)
{
- pAktUndoGroup=pUndoGrp;
- nUndoLevel=1;
+ mpCurrentUndoGroup = pUndoGrp;
+ mnUndoLevel = 1;
}
else
{
delete pUndoGrp;
- nUndoLevel++;
+ mnUndoLevel++;
}
}
else
@@ -643,33 +636,35 @@ void SdrModel::BegUndo(SdrUndoGroup* pUndoGrp)
void SdrModel::EndUndo()
{
- DBG_ASSERT(nUndoLevel!=0,"SdrModel::EndUndo(): UndoLevel is already 0!");
- if( mpImpl->mpUndoManager )
+ DBG_ASSERT(mnUndoLevel != 0,"SdrModel::EndUndo(): UndoLevel is already 0!");
+
+ if(mpUndoManager)
{
- if( nUndoLevel )
+ if(mnUndoLevel)
{
- nUndoLevel--;
- mpImpl->mpUndoManager->LeaveListAction();
+ mnUndoLevel--;
+ mpUndoManager->LeaveListAction();
}
}
else
{
- if(pAktUndoGroup!=NULL && IsUndoEnabled())
+ if(mpCurrentUndoGroup && IsUndoEnabled())
{
- nUndoLevel--;
- if(nUndoLevel==0)
+ mnUndoLevel--;
+
+ if(!mnUndoLevel)
{
- if(pAktUndoGroup->GetActionCount()!=0)
+ if(mpCurrentUndoGroup->GetActionCount())
{
- SdrUndoAction* pUndo=pAktUndoGroup;
- pAktUndoGroup=NULL;
+ SdrUndoAction* pUndo = mpCurrentUndoGroup;
+ mpCurrentUndoGroup = 0;
ImpPostUndoAction(pUndo);
}
else
{
// was empty
- delete pAktUndoGroup;
- pAktUndoGroup=NULL;
+ delete mpCurrentUndoGroup;
+ mpCurrentUndoGroup = 0;
}
}
}
@@ -678,53 +673,54 @@ void SdrModel::EndUndo()
void SdrModel::SetUndoComment(const XubString& rComment)
{
- DBG_ASSERT(nUndoLevel!=0,"SdrModel::SetUndoComment(): UndoLevel is on level 0!");
+ DBG_ASSERT(mnUndoLevel != 0,"SdrModel::SetUndoComment(): UndoLevel is on level 0!");
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
DBG_ERROR("svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
}
- else if( IsUndoEnabled() )
+ else if(IsUndoEnabled())
{
- if(nUndoLevel==1)
+ if(IsLastEndUndo())
{
- pAktUndoGroup->SetComment(rComment);
+ mpCurrentUndoGroup->SetComment(rComment);
}
}
}
void SdrModel::SetUndoComment(const XubString& rComment, const XubString& rObjDescr)
{
- DBG_ASSERT(nUndoLevel!=0,"SdrModel::SetUndoComment(): UndoLevel is 0!");
- if( mpImpl->mpUndoManager )
+ DBG_ASSERT(mnUndoLevel != 0,"SdrModel::SetUndoComment(): UndoLevel is 0!");
+
+ if(mpUndoManager)
{
DBG_ERROR("svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
}
else
{
- if (nUndoLevel==1)
+ if(IsLastEndUndo())
{
- pAktUndoGroup->SetComment(rComment);
- pAktUndoGroup->SetObjDescription(rObjDescr);
+ mpCurrentUndoGroup->SetComment(rComment);
+ mpCurrentUndoGroup->SetObjDescription(rObjDescr);
}
}
}
void SdrModel::AddUndo(SdrUndoAction* pUndo)
{
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
- mpImpl->mpUndoManager->AddUndoAction( pUndo );
+ mpUndoManager->AddUndoAction(pUndo);
}
- else if( !IsUndoEnabled() )
+ else if(!IsUndoEnabled())
{
delete pUndo;
}
else
{
- if (pAktUndoGroup!=NULL)
+ if(mpCurrentUndoGroup)
{
- pAktUndoGroup->AddAction(pUndo);
+ mpCurrentUndoGroup->AddAction(pUndo);
}
else
{
@@ -733,11 +729,11 @@ void SdrModel::AddUndo(SdrUndoAction* pUndo)
}
}
-void SdrModel::EnableUndo( bool bEnable )
+void SdrModel::EnableUndo(bool bEnable)
{
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
- mpImpl->mpUndoManager->EnableUndo( bEnable );
+ mpUndoManager->EnableUndo(bEnable);
}
else
{
@@ -747,9 +743,9 @@ void SdrModel::EnableUndo( bool bEnable )
bool SdrModel::IsUndoEnabled() const
{
- if( mpImpl->mpUndoManager )
+ if(mpUndoManager)
{
- return mpImpl->mpUndoManager->IsUndoEnabled();
+ return mpUndoManager->IsUndoEnabled();
}
else
{
@@ -757,81 +753,59 @@ bool SdrModel::IsUndoEnabled() const
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrModel::ImpCreateTables()
-{
- // der Writer hat seinen eigenen ColorTable
- if (!bExtColorTable) pColorTable=new XColorTable(aTablePath,(XOutdevItemPool*)pItemPool);
- pDashList =new XDashList (aTablePath,(XOutdevItemPool*)pItemPool);
- pLineEndList =new XLineEndList (aTablePath,(XOutdevItemPool*)pItemPool);
- pHatchList =new XHatchList (aTablePath,(XOutdevItemPool*)pItemPool);
- pGradientList=new XGradientList(aTablePath,(XOutdevItemPool*)pItemPool);
- pBitmapList =new XBitmapList (aTablePath,(XOutdevItemPool*)pItemPool);
-}
-
-// #116168#
-void SdrModel::ClearModel(sal_Bool bCalledFromDestructor)
+void SdrModel::ClearModel(bool bCalledFromDestructor)
{
if(bCalledFromDestructor)
{
mbInDestruction = true;
}
- sal_Int32 i;
// delete all drawing pages
- sal_Int32 nAnz=GetPageCount();
- for (i=nAnz-1; i>=0; i--)
+ while(GetPageCount())
{
- DeletePage( (sal_uInt16)i );
+ DeletePage(GetPageCount() - 1);
}
- maPages.Clear();
- // #109538#
- PageListChanged();
// delete all Masterpages
- nAnz=GetMasterPageCount();
- for(i=nAnz-1; i>=0; i--)
+ while(GetMasterPageCount())
{
- DeleteMasterPage( (sal_uInt16)i );
+ DeleteMasterPage(GetMasterPageCount() - 1);
}
- maMaPag.Clear();
- // #109538#
- MasterPageListChanged();
- pLayerAdmin->ClearLayer();
+ mpModelLayerAdmin->ClearLayer();
}
SdrModel* SdrModel::AllocModel() const
{
- SdrModel* pModel=new SdrModel;
- pModel->SetScaleUnit(eObjUnit,aObjUnit);
+ SdrModel* pModel = new SdrModel;
+
+ pModel->SetExchangeObjectUnit(GetExchangeObjectUnit());
+ pModel->SetExchangeObjectScale(GetExchangeObjectScale());
+
return pModel;
}
-SdrPage* SdrModel::AllocPage(FASTBOOL bMasterPage)
+SdrPage* SdrModel::AllocPage(bool bMasterPage)
{
- return new SdrPage(*this,bMasterPage);
+ return new SdrPage(*this, bMasterPage);
}
-void SdrModel::SetTextDefaults() const
+void ImpGetDefaultFontsLanguage(SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rComplex)
{
- SetTextDefaults( pItemPool, nDefTextHgt );
-}
+ const sal_uInt16 nItemCnt(3);
-void ImpGetDefaultFontsLanguage( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rComplex)
-{
- const sal_uInt16 nItemCnt = 3;
- static struct {
+ static struct
+ {
sal_uInt16 nFntType, nLanguage;
} aOutTypeArr[ nItemCnt ] = {
{ DEFAULTFONT_LATIN_TEXT, LANGUAGE_ENGLISH_US },
{ DEFAULTFONT_CJK_TEXT, LANGUAGE_ENGLISH_US },
{ DEFAULTFONT_CTL_TEXT, LANGUAGE_ARABIC_SAUDI_ARABIA }
};
+
SvxFontItem* aItemArr[ nItemCnt ] = { &rLatin, &rAsian, &rComplex };
- for( sal_uInt16 n = 0; n < nItemCnt; ++n )
+ for(sal_uInt16 n(0); n < nItemCnt; ++n )
{
Font aFnt( OutputDevice::GetDefaultFont(
aOutTypeArr[ n ].nFntType, aOutTypeArr[ n ].nLanguage,
@@ -845,7 +819,7 @@ void ImpGetDefaultFontsLanguage( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFo
}
}
-void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt )
+void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uInt32 nDefaultFontHeight )
{
// #95114# set application-language specific dynamic pool language defaults
SvxFontItem aSvxFontItem( EE_CHAR_FONTINFO) ;
@@ -881,9 +855,9 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt
pItemPool->SetPoolDefaultItem(aSvxFontItemCTL);
// set dynamic FontHeight defaults
- pItemPool->SetPoolDefaultItem( SvxFontHeightItem(nDefTextHgt, 100, EE_CHAR_FONTHEIGHT ) );
- pItemPool->SetPoolDefaultItem( SvxFontHeightItem(nDefTextHgt, 100, EE_CHAR_FONTHEIGHT_CJK ) );
- pItemPool->SetPoolDefaultItem( SvxFontHeightItem(nDefTextHgt, 100, EE_CHAR_FONTHEIGHT_CTL ) );
+ pItemPool->SetPoolDefaultItem( SvxFontHeightItem( nDefaultFontHeight, 100, EE_CHAR_FONTHEIGHT ) );
+ pItemPool->SetPoolDefaultItem( SvxFontHeightItem( nDefaultFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
+ pItemPool->SetPoolDefaultItem( SvxFontHeightItem( nDefaultFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
// set FontColor defaults
pItemPool->SetPoolDefaultItem( SvxColorItem(SdrEngineDefaults::GetFontColor(), EE_CHAR_COLOR) );
@@ -891,73 +865,65 @@ void SdrModel::SetTextDefaults( SfxItemPool* pItemPool, sal_uIntPtr nDefTextHgt
SdrOutliner& SdrModel::GetDrawOutliner(const SdrTextObj* pObj) const
{
- pDrawOutliner->SetTextObj(pObj);
- return *pDrawOutliner;
+ mpDrawOutliner->SetTextObj(pObj);
+
+ return *mpDrawOutliner;
}
boost::shared_ptr< SdrOutliner > SdrModel::CreateDrawOutliner(const SdrTextObj* pObj)
{
- boost::shared_ptr< SdrOutliner > xDrawOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ) );
- ImpSetOutlinerDefaults(xDrawOutliner.get(), sal_True);
+ boost::shared_ptr< SdrOutliner > xDrawOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, this));
+ ImpSetOutlinerDefaults(xDrawOutliner.get(), true);
xDrawOutliner->SetTextObj(pObj);
+
return xDrawOutliner;
}
const SdrTextObj* SdrModel::GetFormattingTextObj() const
{
- if (pDrawOutliner!=NULL) {
- return pDrawOutliner->GetTextObj();
+ if(mpDrawOutliner)
+ {
+ return mpDrawOutliner->GetTextObj();
}
- return NULL;
+
+ return 0;
}
-void SdrModel::ImpSetOutlinerDefaults( SdrOutliner* pOutliner, sal_Bool bInit )
+void SdrModel::ImpSetOutlinerDefaults( SdrOutliner* pOutliner, bool bInit )
{
/**************************************************************************
* Initialisierung der Outliner fuer Textausgabe und HitTest
**************************************************************************/
- if( bInit )
+ if(bInit)
{
pOutliner->EraseVirtualDevice();
- pOutliner->SetUpdateMode(sal_False);
- pOutliner->SetEditTextObjectPool(pItemPool);
- pOutliner->SetDefTab(nDefaultTabulator);
+ pOutliner->SetUpdateMode(false);
+ pOutliner->SetEditTextObjectPool(&GetItemPool());
+ pOutliner->SetDefTab(GetDefaultTabulator());
}
- pOutliner->SetRefDevice(GetRefDevice());
+ pOutliner->SetRefDevice(GetReferenceDevice());
pOutliner->SetForbiddenCharsTable(GetForbiddenCharsTable());
pOutliner->SetAsianCompressionMode( mnCharCompressType );
pOutliner->SetKernAsianPunctuation( IsKernAsianPunctuation() );
pOutliner->SetAddExtLeading( IsAddExtLeading() );
- if ( !GetRefDevice() )
+ if(!GetReferenceDevice())
{
- MapMode aMapMode(eObjUnit, Point(0,0), aObjUnit, aObjUnit);
+ MapMode aMapMode(GetExchangeObjectUnit(), Point(0, 0), GetExchangeObjectScale(), GetExchangeObjectScale());
pOutliner->SetRefMapMode(aMapMode);
}
}
-void SdrModel::SetRefDevice(OutputDevice* pDev)
+void SdrModel::SetReferenceDevice(OutputDevice* pDev)
{
- pRefOutDev=pDev;
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
- RefDeviceChanged();
-}
-
-void SdrModel::ImpReformatAllTextObjects()
-{
- if( isLocked() )
- return;
+ if(GetReferenceDevice() != pDev)
+ {
+ mpReferenceOutputDevice = pDev;
- sal_uInt16 nAnz=GetMasterPageCount();
- sal_uInt16 nNum;
- for (nNum=0; nNum<nAnz; nNum++) {
- GetMasterPage(nNum)->ReformatAllTextObjects();
- }
- nAnz=GetPageCount();
- for (nNum=0; nNum<nAnz; nNum++) {
- GetPage(nNum)->ReformatAllTextObjects();
+ ImpSetOutlinerDefaults(mpDrawOutliner);
+ Broadcast(SdrBaseHint(HINT_REFDEVICECHG));
+ ReformatAllTextObjects();
}
}
@@ -968,92 +934,129 @@ void SdrModel::ImpReformatAllTextObjects()
*/
void SdrModel::ImpReformatAllEdgeObjects()
{
- if( isLocked() )
+ if(isLocked())
+ {
return;
+ }
+
+ sal_uInt32 nAnz(GetMasterPageCount());
+ sal_uInt32 nNum;
- sal_uInt16 nAnz=GetMasterPageCount();
- sal_uInt16 nNum;
- for (nNum=0; nNum<nAnz; nNum++)
+ for(nNum = 0; nNum < nAnz; nNum++)
{
- GetMasterPage(nNum)->ReformatAllEdgeObjects();
+ SdrObjListIter aIter(*GetMasterPage(nNum), IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ SdrEdgeObj* pSdrEdgeObj = dynamic_cast< SdrEdgeObj* >(aIter.Next());
+
+ if(pSdrEdgeObj)
+ {
+ pSdrEdgeObj->ReformatEdge();
+ }
+ }
}
- nAnz=GetPageCount();
- for (nNum=0; nNum<nAnz; nNum++)
+
+ nAnz = GetPageCount();
+
+ for(nNum = 0; nNum < nAnz; nNum++)
{
- GetPage(nNum)->ReformatAllEdgeObjects();
+ SdrObjListIter aIter(*GetPage(nNum), IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ SdrEdgeObj* pSdrEdgeObj = dynamic_cast< SdrEdgeObj* >(aIter.Next());
+
+ if(pSdrEdgeObj)
+ {
+ pSdrEdgeObj->ReformatEdge();
+ }
+ }
}
}
SvStream* SdrModel::GetDocumentStream(SdrDocumentStreamInfo& /*rStreamInfo*/) const
{
- return NULL;
+ return 0;
}
-// Die Vorlagenattribute der Zeichenobjekte in harte Attribute verwandeln.
void SdrModel::BurnInStyleSheetAttributes()
{
- sal_uInt16 nAnz=GetMasterPageCount();
- sal_uInt16 nNum;
- for (nNum=0; nNum<nAnz; nNum++) {
- GetMasterPage(nNum)->BurnInStyleSheetAttributes();
+ sal_uInt32 nAnz(GetMasterPageCount());
+ sal_uInt32 nNum;
+
+ for(nNum = 0; nNum < nAnz; nNum++)
+ {
+ SdrObjListIter aIter(*GetMasterPage(nNum), IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ aIter.Next()->BurnInStyleSheetAttributes();
+ }
}
- nAnz=GetPageCount();
- for (nNum=0; nNum<nAnz; nNum++) {
- GetPage(nNum)->BurnInStyleSheetAttributes();
+
+ nAnz = GetPageCount();
+
+ for(nNum=0; nNum<nAnz; nNum++)
+ {
+ SdrObjListIter aIter(*GetPage(nNum), IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ aIter.Next()->BurnInStyleSheetAttributes();
+ }
}
}
-void SdrModel::RefDeviceChanged()
+void SdrModel::SetDefaultFontHeight(sal_uInt32 nVal)
{
- Broadcast(SdrHint(HINT_REFDEVICECHG));
- ImpReformatAllTextObjects();
-}
+ if(nVal != GetDefaultFontHeight())
+ {
+ mnDefaultFontHeight = nVal;
-void SdrModel::SetDefaultFontHeight(sal_uIntPtr nVal)
-{
- if (nVal!=nDefTextHgt) {
- nDefTextHgt=nVal;
- Broadcast(SdrHint(HINT_DEFFONTHGTCHG));
- ImpReformatAllTextObjects();
+ Broadcast(SdrBaseHint(HINT_DEFFONTHGTCHG));
+ ReformatAllTextObjects();
}
}
void SdrModel::SetDefaultTabulator(sal_uInt16 nVal)
{
- if (nDefaultTabulator!=nVal) {
- nDefaultTabulator=nVal;
- Outliner& rOutliner=GetDrawOutliner();
+ if(GetDefaultTabulator() != nVal)
+ {
+ mnDefaultTabulator = nVal;
+
+ Outliner& rOutliner = GetDrawOutliner();
rOutliner.SetDefTab(nVal);
- Broadcast(SdrHint(HINT_DEFAULTTABCHG));
- ImpReformatAllTextObjects();
+ Broadcast(SdrBaseHint(HINT_DEFAULTTABCHG));
+ ReformatAllTextObjects();
}
}
void SdrModel::ImpSetUIUnit()
{
- if(0 == aUIScale.GetNumerator() || 0 == aUIScale.GetDenominator())
+ if(0 == GetUIScale().GetNumerator() || 0 == GetUIScale().GetDenominator())
{
- aUIScale = Fraction(1,1);
+ maUIScale = Fraction(1,1);
}
// set start values
- nUIUnitKomma = 0;
+ mnUIUnitKomma = 0;
sal_Int64 nMul(1);
sal_Int64 nDiv(1);
// normalize on meters resp. inch
- switch (eObjUnit)
- {
- case MAP_100TH_MM : nUIUnitKomma+=5; break;
- case MAP_10TH_MM : nUIUnitKomma+=4; break;
- case MAP_MM : nUIUnitKomma+=3; break;
- case MAP_CM : nUIUnitKomma+=2; break;
- case MAP_1000TH_INCH: nUIUnitKomma+=3; break;
- case MAP_100TH_INCH : nUIUnitKomma+=2; break;
- case MAP_10TH_INCH : nUIUnitKomma+=1; break;
- case MAP_INCH : nUIUnitKomma+=0; break;
+ switch (GetExchangeObjectUnit())
+ {
+ case MAP_100TH_MM : mnUIUnitKomma += 5; break;
+ case MAP_10TH_MM : mnUIUnitKomma += 4; break;
+ case MAP_MM : mnUIUnitKomma += 3; break;
+ case MAP_CM : mnUIUnitKomma += 2; break;
+ case MAP_1000TH_INCH: mnUIUnitKomma += 3; break;
+ case MAP_100TH_INCH : mnUIUnitKomma += 2; break;
+ case MAP_10TH_INCH : mnUIUnitKomma += 1; break;
+ case MAP_INCH : mnUIUnitKomma += 0; break;
case MAP_POINT : nDiv=72; break; // 1Pt = 1/72"
- case MAP_TWIP : nDiv=144; nUIUnitKomma++; break; // 1Twip = 1/1440"
+ case MAP_TWIP : nDiv=144; mnUIUnitKomma++; break; // 1Twip = 1/1440"
case MAP_PIXEL : break;
case MAP_SYSFONT : break;
case MAP_APPFONT : break;
@@ -1067,44 +1070,44 @@ void SdrModel::ImpSetUIUnit()
// 1 pole = 5 1/2 yd = 198" = 5.029,2mm
// 1 yd = 3 ft = 36" = 914,4mm
// 1 ft = 12 " = 1" = 304,8mm
- switch (eUIUnit)
+ switch(GetUIUnit())
{
case FUNIT_NONE : break;
// Metrisch
- case FUNIT_100TH_MM: nUIUnitKomma-=5; break;
- case FUNIT_MM : nUIUnitKomma-=3; break;
- case FUNIT_CM : nUIUnitKomma-=2; break;
- case FUNIT_M : nUIUnitKomma+=0; break;
- case FUNIT_KM : nUIUnitKomma+=3; break;
+ case FUNIT_100TH_MM: mnUIUnitKomma -= 5; break;
+ case FUNIT_MM : mnUIUnitKomma -= 3; break;
+ case FUNIT_CM : mnUIUnitKomma -= 2; break;
+ case FUNIT_M : mnUIUnitKomma += 0; break;
+ case FUNIT_KM : mnUIUnitKomma += 3; break;
// Inch
- case FUNIT_TWIP : nMul=144; nUIUnitKomma--; break; // 1Twip = 1/1440"
+ case FUNIT_TWIP : nMul=144; mnUIUnitKomma--; break; // 1Twip = 1/1440"
case FUNIT_POINT : nMul=72; break; // 1Pt = 1/72"
case FUNIT_PICA : nMul=6; break; // 1Pica = 1/6" ?
case FUNIT_INCH : break; // 1" = 1"
case FUNIT_FOOT : nDiv*=12; break; // 1Ft = 12"
- case FUNIT_MILE : nDiv*=6336; nUIUnitKomma++; break; // 1mile = 63360"
+ case FUNIT_MILE : nDiv*=6336; mnUIUnitKomma++; break; // 1mile = 63360"
// sonstiges
case FUNIT_CUSTOM : break;
- case FUNIT_PERCENT: nUIUnitKomma+=2; break;
+ case FUNIT_PERCENT: mnUIUnitKomma += 2; break;
} // switch
// check if mapping is from metric to inch and adapt
- const bool bMapInch(IsInch(eObjUnit));
- const bool bUIMetr(IsMetric(eUIUnit));
+ const bool bMapInch(IsInch(GetExchangeObjectUnit()));
+ const bool bUIMetr(IsMetric(GetUIUnit()));
if (bMapInch && bUIMetr)
{
- nUIUnitKomma += 4;
+ mnUIUnitKomma += 4;
nMul *= 254;
}
// check if mapping is from inch to metric and adapt
- const bool bMapMetr(IsMetric(eObjUnit));
- const bool bUIInch(IsInch(eUIUnit));
+ const bool bMapMetr(IsMetric(GetExchangeObjectUnit()));
+ const bool bUIInch(IsInch(GetUIUnit()));
if (bMapMetr && bUIInch)
{
- nUIUnitKomma -= 4;
+ mnUIUnitKomma -= 4;
nDiv *= 254;
}
@@ -1118,94 +1121,76 @@ void SdrModel::ImpSetUIUnit()
}
// #i89872# take Unit of Measurement into account
- if(1 != aUIScale.GetDenominator() || 1 != aUIScale.GetNumerator())
+ if(1 != GetUIScale().GetDenominator() || 1 != GetUIScale().GetNumerator())
{
// divide by UIScale
- nMul *= aUIScale.GetDenominator();
- nDiv *= aUIScale.GetNumerator();
+ nMul *= GetUIScale().GetDenominator();
+ nDiv *= GetUIScale().GetNumerator();
}
// shorten trailing zeroes for dividend
while(0 == (nMul % 10))
{
- nUIUnitKomma--;
+ mnUIUnitKomma--;
nMul /= 10;
}
// shorten trailing zeroes for divisor
while(0 == (nDiv % 10))
{
- nUIUnitKomma++;
+ mnUIUnitKomma++;
nDiv /= 10;
}
// end preparations, set member values
- aUIUnitFact = Fraction(sal_Int32(nMul), sal_Int32(nDiv));
- bUIOnlyKomma = (nMul == nDiv);
- TakeUnitStr(eUIUnit, aUIUnitStr);
+ maUIUnitScale = Fraction(sal_Int32(nMul), sal_Int32(nDiv));
+ TakeUnitStr(GetUIUnit(), maUIUnitString);
}
-void SdrModel::SetScaleUnit(MapUnit eMap, const Fraction& rFrac)
+void SdrModel::SetExchangeObjectUnit(MapUnit eMap)
{
- if (eObjUnit!=eMap || aObjUnit!=rFrac) {
- eObjUnit=eMap;
- aObjUnit=rFrac;
- pItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit);
- ImpSetUIUnit();
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
- ImpReformatAllTextObjects(); // #40424#
- }
-}
+ if(GetExchangeObjectUnit() != eMap)
+ {
+ meExchangeObjectUnit = eMap;
-void SdrModel::SetScaleUnit(MapUnit eMap)
-{
- if (eObjUnit!=eMap) {
- eObjUnit=eMap;
- pItemPool->SetDefaultMetric((SfxMapUnit)eObjUnit);
+ GetItemPool().SetDefaultMetric((SfxMapUnit)GetExchangeObjectUnit());
ImpSetUIUnit();
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
- ImpReformatAllTextObjects(); // #40424#
+ ImpSetOutlinerDefaults(mpDrawOutliner);
+ ReformatAllTextObjects(); // #40424#
}
}
-void SdrModel::SetScaleFraction(const Fraction& rFrac)
+void SdrModel::SetExchangeObjectScale(const Fraction& rFrac)
{
- if (aObjUnit!=rFrac) {
- aObjUnit=rFrac;
+ if(GetExchangeObjectScale() != rFrac)
+ {
+ maExchangeObjectScale = rFrac;
+
ImpSetUIUnit();
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
- ImpReformatAllTextObjects(); // #40424#
+ ImpSetOutlinerDefaults(mpDrawOutliner);
+ ReformatAllTextObjects(); // #40424#
}
}
void SdrModel::SetUIUnit(FieldUnit eUnit)
{
- if (eUIUnit!=eUnit) {
- eUIUnit=eUnit;
+ if(GetUIUnit() != eUnit)
+ {
+ meUIUnit = eUnit;
+
ImpSetUIUnit();
- ImpReformatAllTextObjects(); // #40424#
+ ReformatAllTextObjects(); // #40424#
}
}
void SdrModel::SetUIScale(const Fraction& rScale)
{
- if (aUIScale!=rScale) {
- aUIScale=rScale;
- ImpSetUIUnit();
- ImpReformatAllTextObjects(); // #40424#
- }
-}
+ if(GetUIScale() != rScale)
+ {
+ maUIScale = rScale;
-void SdrModel::SetUIUnit(FieldUnit eUnit, const Fraction& rScale)
-{
- if (eUIUnit!=eUnit || aUIScale!=rScale) {
- eUIUnit=eUnit;
- aUIScale=rScale;
ImpSetUIUnit();
- ImpReformatAllTextObjects(); // #40424#
+ ReformatAllTextObjects(); // #40424#
}
}
@@ -1295,14 +1280,13 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
}
-void SdrModel::TakeMetricStr(long nVal, XubString& rStr, FASTBOOL bNoUnitChars, sal_Int32 nNumDigits) const
+void SdrModel::TakeMetricStr(long nVal, XubString& rStr, bool bNoUnitChars, sal_Int32 nNumDigits) const
{
- // #i22167#
- // change to double precision usage to not loose decimal places after comma
- const bool bNegative(nVal < 0L);
+ // change to double precision usage to not lose decimal places after comma
+ const bool bNegative(nVal < 0);
SvtSysLocale aSysLoc;
const LocaleDataWrapper& rLoc(aSysLoc.GetLocaleData());
- double fLocalValue(double(nVal) * double(aUIUnitFact));
+ double fLocalValue(double(nVal) * double(maUIUnitScale));
if(bNegative)
{
@@ -1314,7 +1298,7 @@ void SdrModel::TakeMetricStr(long nVal, XubString& rStr, FASTBOOL bNoUnitChars,
nNumDigits = rLoc.getNumDigits();
}
- sal_Int32 nKomma(nUIUnitKomma);
+ sal_Int32 nKomma(mnUIUnitKomma);
if(nKomma > nNumDigits)
{
@@ -1406,15 +1390,19 @@ void SdrModel::TakeMetricStr(long nVal, XubString& rStr, FASTBOOL bNoUnitChars,
}
if(!bNoUnitChars)
- rStr += aUIUnitStr;
+ {
+ rStr += maUIUnitString;
+ }
}
-void SdrModel::TakeWinkStr(long nWink, XubString& rStr, FASTBOOL bNoDegChar) const
+void SdrModel::TakeWinkStr(long nWink, XubString& rStr, bool bNoDegChar) const
{
- sal_Bool bNeg(nWink < 0);
+ bool bNeg(nWink < 0);
if(bNeg)
+ {
nWink = -nWink;
+ }
rStr = UniString::CreateFromInt32(nWink);
@@ -1423,34 +1411,48 @@ void SdrModel::TakeWinkStr(long nWink, XubString& rStr, FASTBOOL bNoDegChar) con
xub_StrLen nAnz(2);
if(rLoc.isNumLeadingZero())
+ {
nAnz++;
+ }
while(rStr.Len() < nAnz)
+ {
rStr.Insert(sal_Unicode('0'), 0);
+ }
rStr.Insert(rLoc.getNumDecimalSep().GetChar(0), rStr.Len() - 2);
if(bNeg)
+ {
rStr.Insert(sal_Unicode('-'), 0);
+ }
if(!bNoDegChar)
+ {
rStr += DEGREE_CHAR;
+ }
}
-void SdrModel::TakePercentStr(const Fraction& rVal, XubString& rStr, FASTBOOL bNoPercentChar) const
+void SdrModel::TakePercentStr(const Fraction& rVal, XubString& rStr, bool bNoPercentChar) const
{
sal_Int32 nMul(rVal.GetNumerator());
sal_Int32 nDiv(rVal.GetDenominator());
- sal_Bool bNeg(nMul < 0);
+ bool bNeg(nMul < 0);
if(nDiv < 0)
+ {
bNeg = !bNeg;
+ }
if(nMul < 0)
+ {
nMul = -nMul;
+ }
if(nDiv < 0)
+ {
nDiv = -nDiv;
+ }
nMul *= 100;
nMul += nDiv/2;
@@ -1459,301 +1461,474 @@ void SdrModel::TakePercentStr(const Fraction& rVal, XubString& rStr, FASTBOOL bN
rStr = UniString::CreateFromInt32(nMul);
if(bNeg)
+ {
rStr.Insert(sal_Unicode('-'), 0);
+ }
if(!bNoPercentChar)
+ {
rStr += sal_Unicode('%');
+ }
}
-void SdrModel::SetChanged(sal_Bool bFlg)
+void SdrModel::SetChanged(bool bFlg)
{
mbChanged = bFlg;
}
-void SdrModel::RecalcPageNums(FASTBOOL bMaster)
+void SdrModel::EnsureValidPageNumbers(bool bMaster)
{
- Container& rPL=*(bMaster ? &maMaPag : &maPages);
- sal_uInt16 nAnz=sal_uInt16(rPL.Count());
- sal_uInt16 i;
- for (i=0; i<nAnz; i++) {
- SdrPage* pPg=(SdrPage*)(rPL.GetObject(i));
- pPg->SetPageNum(i);
+ sal_uInt32 a(0);
+ SdrPageContainerType::const_iterator aCandidate;
+
+ if(bMaster)
+ {
+ for(aCandidate = maMasterPageVector.begin();
+ aCandidate != maMasterPageVector.end(); a++, aCandidate++)
+ {
+ OSL_ENSURE(*aCandidate, "Error in MasterPageVector (!)");
+ SetPageNumberAtSdrPageFromSdrModel(**aCandidate, a);
+ }
+ }
+ else
+ {
+ for(aCandidate = maPageVector.begin();
+ aCandidate != maPageVector.end(); a++, aCandidate++)
+ {
+ OSL_ENSURE(*aCandidate, "Error in PageVector (!)");
+ SetPageNumberAtSdrPageFromSdrModel(**aCandidate, a);
+ }
}
- if (bMaster) bMPgNumsDirty=sal_False;
- else bPagNumsDirty=sal_False;
}
-void SdrModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
+void SdrModel::InsertPage(SdrPage* pPage, sal_uInt32 nPos)
{
- sal_uInt16 nAnz=GetPageCount();
- if (nPos>nAnz) nPos=nAnz;
- maPages.Insert(pPage,nPos);
- // #109538#
- PageListChanged();
- pPage->SetInserted(sal_True);
- pPage->SetPageNum(nPos);
- pPage->SetModel(this);
- if (nPos<nAnz) bPagNumsDirty=sal_True;
- SetChanged();
- SdrHint aHint(HINT_PAGEORDERCHG);
- aHint.SetPage(pPage);
- Broadcast(aHint);
+ if(pPage && &pPage->getSdrModelFromSdrPage() == this)
+ {
+ const sal_uInt32 nAnz(GetPageCount());
+
+ if(nPos >= nAnz)
+ {
+ maPageVector.push_back(pPage);
+ SetPageNumberAtSdrPageFromSdrModel(*pPage, nAnz);
+ }
+ else
+ {
+ maPageVector.insert(maPageVector.begin() + nPos, pPage);
+ EnsureValidPageNumbers(false);
+ }
+
+ SetInsertedAtSdrPageFromSdrModel(*pPage, true);
+ SetChanged();
+ Broadcast(SdrBaseHint(*pPage, HINT_PAGEORDERCHG));
+ }
+ else
+ {
+ OSL_ENSURE(pPage, "SdrModel::InsertPage without Page (!)");
+ OSL_ENSURE(&pPage->getSdrModelFromSdrPage() == this, "SdrModel::InsertPage with SdrPage from alien SdrModel (!)");
+ }
}
-void SdrModel::DeletePage(sal_uInt16 nPgNum)
+void SdrModel::DeletePage(sal_uInt32 nPgNum)
{
- SdrPage* pPg=RemovePage(nPgNum);
- delete pPg;
+ SdrPage* pPg = RemovePage(nPgNum);
+
+ if(pPg)
+ {
+ delete pPg;
+ }
}
-SdrPage* SdrModel::RemovePage(sal_uInt16 nPgNum)
+SdrPage* SdrModel::RemovePage(sal_uInt32 nPgNum)
{
- SdrPage* pPg=(SdrPage*)maPages.Remove(nPgNum);
- // #109538#
- PageListChanged();
- if (pPg!=NULL) {
- pPg->SetInserted(sal_False);
+ SdrPage* pPage = 0;
+
+ if(nPgNum < maPageVector.size())
+ {
+ const SdrPageContainerType::iterator aCandidate(maPageVector.begin() + nPgNum);
+ pPage = *aCandidate;
+
+ maPageVector.erase(aCandidate);
+
+ if(nPgNum != maPageVector.size())
+ {
+ EnsureValidPageNumbers(false);
+ }
+
+ OSL_ENSURE(pPage, "SdrModel::RemovePage detected non-existent Page (!)");
+
+ SetInsertedAtSdrPageFromSdrModel(*pPage, false);
+ SetChanged();
+ Broadcast(SdrBaseHint(*pPage, HINT_PAGEORDERCHG));
}
- bPagNumsDirty=sal_True;
- SetChanged();
- SdrHint aHint(HINT_PAGEORDERCHG);
- aHint.SetPage(pPg);
- Broadcast(aHint);
- return pPg;
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::RemovePage with wrong index (!)");
+ }
+
+ return pPage;
}
-void SdrModel::MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
+void SdrModel::MovePage(sal_uInt32 nPgNum, sal_uInt32 nNewPos)
{
- SdrPage* pPg=(SdrPage*)maPages.Remove(nPgNum);
- // #109538#
- PageListChanged();
- if (pPg!=NULL) {
- pPg->SetInserted(sal_False);
- InsertPage(pPg,nNewPos);
+ if(nPgNum == nNewPos)
+ {
+ return;
+ }
+ else
+ {
+ const sal_uInt32 nCount(GetPageCount());
+
+ if(nPgNum < nCount && nNewPos < nCount)
+ {
+ const SdrPageContainerType::iterator aCandidate(maPageVector.begin() + nPgNum);
+ SdrPage* pPg = *aCandidate;
+
+ maPageVector.erase(aCandidate);
+
+ OSL_ENSURE(pPg, "SdrModel::MovePage detected non-existent Page (!)");
+
+ if(pPg)
+ {
+ InsertPage(pPg, nNewPos);
+ }
+
+ EnsureValidPageNumbers(false);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::MovePage with wrong index (!)");
+ }
}
}
-void SdrModel::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos)
+void SdrModel::InsertMasterPage(SdrPage* pPage, sal_uInt32 nPos)
{
- sal_uInt16 nAnz=GetMasterPageCount();
- if (nPos>nAnz) nPos=nAnz;
- maMaPag.Insert(pPage,nPos);
- // #109538#
- MasterPageListChanged();
- pPage->SetInserted(sal_True);
- pPage->SetPageNum(nPos);
- pPage->SetModel(this);
- if (nPos<nAnz) {
- bMPgNumsDirty=sal_True;
+ if(pPage && &pPage->getSdrModelFromSdrPage() == this)
+ {
+ const sal_uInt32 nAnz(GetMasterPageCount());
+
+ if(nPos >= nAnz)
+ {
+ maMasterPageVector.push_back(pPage);
+ SetPageNumberAtSdrPageFromSdrModel(*pPage, nAnz);
+ }
+ else
+ {
+ maMasterPageVector.insert(maMasterPageVector.begin() + nPos, pPage);
+ EnsureValidPageNumbers(true);
+ }
+
+ SetInsertedAtSdrPageFromSdrModel(*pPage, true);
+ SetChanged();
+ Broadcast(SdrBaseHint(*pPage, HINT_PAGEORDERCHG));
+ }
+ else
+ {
+ OSL_ENSURE(pPage, "SdrModel::InsertMasterPage without Page (!)");
+ OSL_ENSURE(&pPage->getSdrModelFromSdrPage() == this, "SdrModel::InsertMasterPage with SdrPage from alien SdrModel (!)");
}
- SetChanged();
- SdrHint aHint(HINT_PAGEORDERCHG);
- aHint.SetPage(pPage);
- Broadcast(aHint);
}
-void SdrModel::DeleteMasterPage(sal_uInt16 nPgNum)
+void SdrModel::DeleteMasterPage(sal_uInt32 nPgNum)
{
- SdrPage* pPg=RemoveMasterPage(nPgNum);
- if (pPg!=NULL) delete pPg;
+ SdrPage* pPg = RemoveMasterPage(nPgNum);
+
+ if(pPg)
+ {
+ delete pPg;
+ }
}
-SdrPage* SdrModel::RemoveMasterPage(sal_uInt16 nPgNum)
+SdrPage* SdrModel::RemoveMasterPage(sal_uInt32 nPgNum)
{
- SdrPage* pRetPg=(SdrPage*)maMaPag.Remove(nPgNum);
- // #109538#
- MasterPageListChanged();
+ SdrPage* pPage = 0;
- if(pRetPg)
+ if(nPgNum < GetMasterPageCount())
{
- // Nun die Verweise der normalen Zeichenseiten auf die entfernte MasterPage loeschen
- sal_uInt16 nPageAnz(GetPageCount());
+ const SdrPageContainerType::iterator aCandidate(maMasterPageVector.begin() + nPgNum);
+
+ pPage = *aCandidate;
+ maMasterPageVector.erase(aCandidate);
- for(sal_uInt16 np(0); np < nPageAnz; np++)
+ if(nPgNum != maMasterPageVector.size())
{
- GetPage(np)->TRG_ImpMasterPageRemoved(*pRetPg);
+ EnsureValidPageNumbers(true);
+ }
+
+ OSL_ENSURE(pPage, "SdrModel::RemoveMasterPage detected non-existent Page (!)");
+
+ if(pPage)
+ {
+ // Nun die Verweise der normalen Zeichenseiten auf die entfernte MasterPage loeschen
+ const sal_uInt32 nPageAnz(GetPageCount());
+
+ for(sal_uInt32 np(0); np < nPageAnz; np++)
+ {
+ GetPage(np)->TRG_MasterPageRemoved(*pPage);
+ }
}
- pRetPg->SetInserted(sal_False);
+ SetInsertedAtSdrPageFromSdrModel(*pPage, false);
+ SetChanged();
+ Broadcast(SdrBaseHint(*pPage, HINT_PAGEORDERCHG));
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::RemoveMasterPage with wrong index (!)");
}
- bMPgNumsDirty=sal_True;
- SetChanged();
- SdrHint aHint(HINT_PAGEORDERCHG);
- aHint.SetPage(pRetPg);
- Broadcast(aHint);
- return pRetPg;
+ return pPage;
}
-void SdrModel::MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
+void SdrModel::MoveMasterPage(sal_uInt32 nPgNum, sal_uInt32 nNewPos)
{
- SdrPage* pPg=(SdrPage*)maMaPag.Remove(nPgNum);
- // #109538#
- MasterPageListChanged();
- if (pPg!=NULL) {
- pPg->SetInserted(sal_False);
- maMaPag.Insert(pPg,nNewPos);
- // #109538#
- MasterPageListChanged();
+ if(nPgNum == nNewPos)
+ {
+ return;
}
- bMPgNumsDirty=sal_True;
- SetChanged();
- SdrHint aHint(HINT_PAGEORDERCHG);
- aHint.SetPage(pPg);
- Broadcast(aHint);
-}
+ else
+ {
+ const sal_uInt32 nCount(GetMasterPageCount());
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ if(nPgNum < nCount && nNewPos < nCount)
+ {
+ const SdrPageContainerType::iterator aCandidate(maMasterPageVector.begin() + nPgNum);
+ SdrPage* pPg = *aCandidate;
-FASTBOOL SdrModel::CheckConsistence() const
-{
- FASTBOOL bRet=sal_True;
-#ifdef DBG_UTIL
- DBG_CHKTHIS(SdrModel,NULL);
-#endif
- return bRet;
-}
+ maMasterPageVector.erase(aCandidate);
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ OSL_ENSURE(pPg, "SdrModel::MoveMasterPage detected non-existent Page (!)");
+
+ if(pPg)
+ {
+ maMasterPageVector.insert(maMasterPageVector.begin() + nNewPos, pPg);
+ }
+
+ EnsureValidPageNumbers(true);
+ SetChanged();
+ Broadcast(SdrBaseHint(*pPg, HINT_PAGEORDERCHG));
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::MoveMasterPage with wrong index (!)");
+ }
+ }
+}
-// #48289#
-void SdrModel::CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
- sal_uInt16 nDestPos,
- FASTBOOL bUndo, FASTBOOL bMoveNoCopy)
+void SdrModel::CopyPages(
+ sal_uInt32 nFirstPageNum,
+ sal_uInt32 nLastPageNum,
+ sal_uInt32 nDestPos,
+ bool bUndo,
+ bool bMoveNoCopy)
{
- if( bUndo && !IsUndoEnabled() )
+ if(bUndo && !IsUndoEnabled())
+ {
bUndo = false;
+ }
- if( bUndo )
+ if(bUndo)
+ {
BegUndo(ImpGetResStr(STR_UndoMergeModel));
+ }
- sal_uInt16 nPageAnz=GetPageCount();
- sal_uInt16 nMaxPage=nPageAnz;
+ const sal_uInt32 nPageAnz(GetPageCount());
+ sal_uInt32 nMaxPage(nPageAnz);
- if (nMaxPage!=0)
+ if(nMaxPage)
+ {
nMaxPage--;
- if (nFirstPageNum>nMaxPage)
- nFirstPageNum=nMaxPage;
- if (nLastPageNum>nMaxPage)
- nLastPageNum =nMaxPage;
- FASTBOOL bReverse=nLastPageNum<nFirstPageNum;
- if (nDestPos>nPageAnz)
- nDestPos=nPageAnz;
+ }
+
+ if(nFirstPageNum > nMaxPage)
+ {
+ nFirstPageNum = nMaxPage;
+ }
+
+ if(nLastPageNum > nMaxPage)
+ {
+ nLastPageNum = nMaxPage;
+ }
+
+ const bool bReverse(nLastPageNum < nFirstPageNum);
+
+ if(nDestPos > nPageAnz)
+ {
+ nDestPos = nPageAnz;
+ }
// Zunaechst die Zeiger der betroffenen Seiten in einem Array sichern
- sal_uInt16 nPageNum=nFirstPageNum;
- sal_uInt16 nCopyAnz=((!bReverse)?(nLastPageNum-nFirstPageNum):(nFirstPageNum-nLastPageNum))+1;
- SdrPage** pPagePtrs=new SdrPage*[nCopyAnz];
- sal_uInt16 nCopyNum;
- for(nCopyNum=0; nCopyNum<nCopyAnz; nCopyNum++)
- {
- pPagePtrs[nCopyNum]=GetPage(nPageNum);
- if (bReverse)
+ sal_uInt32 nPageNum(nFirstPageNum);
+ sal_uInt32 nCopyAnz(((!bReverse) ? (nLastPageNum - nFirstPageNum) : (nFirstPageNum - nLastPageNum)) + 1);
+ SdrPage** pPagePtrs = new SdrPage*[nCopyAnz];
+ sal_uInt32 nCopyNum;
+
+ for(nCopyNum = 0; nCopyNum < nCopyAnz; nCopyNum++)
+ {
+ pPagePtrs[nCopyNum] = GetPage(nPageNum);
+
+ if(bReverse)
+ {
nPageNum--;
+ }
else
+ {
nPageNum++;
+ }
}
// Jetzt die Seiten kopieren
- sal_uInt16 nDestNum=nDestPos;
- for (nCopyNum=0; nCopyNum<nCopyAnz; nCopyNum++)
+ sal_uInt32 nDestNum(nDestPos);
+
+ for(nCopyNum = 0; nCopyNum < nCopyAnz; nCopyNum++)
{
- SdrPage* pPg=pPagePtrs[nCopyNum];
- sal_uInt16 nPageNum2=pPg->GetPageNum();
- if (!bMoveNoCopy)
+ SdrPage* pPg = pPagePtrs[nCopyNum];
+ sal_uInt32 nPageNum2(pPg->GetPageNumber());
+
+ if(!bMoveNoCopy)
{
- const SdrPage* pPg1=GetPage(nPageNum2);
- pPg=pPg1->Clone();
- InsertPage(pPg,nDestNum);
- if (bUndo)
+ const SdrPage* pPg1 = GetPage(nPageNum2);
+
+ pPg = pPg1->CloneSdrPage(this);
+ InsertPage(pPg, nDestNum);
+
+ if(bUndo)
+ {
AddUndo(GetSdrUndoFactory().CreateUndoCopyPage(*pPg));
+ }
+
nDestNum++;
}
else
{
- // Move ist nicht getestet!
- if (nDestNum>nPageNum2)
+ if(nDestNum > nPageNum2)
+ {
nDestNum--;
+ }
if(bUndo)
- AddUndo(GetSdrUndoFactory().CreateUndoSetPageNum(*GetPage(nPageNum2),nPageNum2,nDestNum));
+ {
+ AddUndo(GetSdrUndoFactory().CreateUndoSetPageNum(*GetPage(nPageNum2), nPageNum2, nDestNum));
+ }
- pPg=RemovePage(nPageNum2);
- InsertPage(pPg,nDestNum);
+ pPg = RemovePage(nPageNum2);
+ InsertPage(pPg, nDestNum);
nDestNum++;
}
if(bReverse)
+ {
nPageNum2--;
+ }
else
+ {
nPageNum2++;
+ }
}
delete[] pPagePtrs;
+
if(bUndo)
+ {
EndUndo();
+ }
}
-void SdrModel::Merge(SdrModel& rSourceModel,
- sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
- sal_uInt16 nDestPos,
- FASTBOOL bMergeMasterPages, FASTBOOL bAllMasterPages,
- FASTBOOL bUndo, FASTBOOL bTreadSourceAsConst)
+void SdrModel::Merge(
+ SdrModel& rSourceModel,
+ sal_uInt32 nFirstPageNum,
+ sal_uInt32 nLastPageNum,
+ sal_uInt32 nDestPos,
+ bool bMergeMasterPages,
+ bool bAllMasterPages,
+ bool bUndo,
+ bool bTreadSourceAsConst)
{
- if (&rSourceModel==this)
- { // #48289#
+ if(&rSourceModel == this)
+ {
CopyPages(nFirstPageNum,nLastPageNum,nDestPos,bUndo,!bTreadSourceAsConst);
return;
}
- if( bUndo && !IsUndoEnabled() )
+ if(bUndo && !IsUndoEnabled())
+ {
bUndo = false;
+ }
- if (bUndo)
+ if(bUndo)
+ {
BegUndo(ImpGetResStr(STR_UndoMergeModel));
+ }
+
+ const sal_uInt32 nSrcPageAnz(rSourceModel.GetPageCount());
+ const sal_uInt32 nSrcMasterPageAnz(rSourceModel.GetMasterPageCount());
+ const sal_uInt32 nDstMasterPageAnz(GetMasterPageCount());
+ bool bInsPages((nFirstPageNum < nSrcPageAnz || nLastPageNum < nSrcPageAnz));
+ sal_uInt32 nMaxSrcPage(nSrcPageAnz);
+
+ if(nMaxSrcPage)
+ {
+ nMaxSrcPage--;
+ }
+
+ if(nFirstPageNum > nMaxSrcPage)
+ {
+ nFirstPageNum = nMaxSrcPage;
+ }
+
+ if(nLastPageNum > nMaxSrcPage)
+ {
+ nLastPageNum = nMaxSrcPage;
+ }
+
+ const bool bReverse(nLastPageNum < nFirstPageNum);
+ sal_uInt32* pMasterMap = 0;
+ bool* pMasterNeed = 0;
+ sal_uInt32 nMasterNeed(0);
- sal_uInt16 nSrcPageAnz=rSourceModel.GetPageCount();
- sal_uInt16 nSrcMasterPageAnz=rSourceModel.GetMasterPageCount();
- sal_uInt16 nDstMasterPageAnz=GetMasterPageCount();
- FASTBOOL bInsPages=(nFirstPageNum<nSrcPageAnz || nLastPageNum<nSrcPageAnz);
- sal_uInt16 nMaxSrcPage=nSrcPageAnz; if (nMaxSrcPage!=0) nMaxSrcPage--;
- if (nFirstPageNum>nMaxSrcPage) nFirstPageNum=nMaxSrcPage;
- if (nLastPageNum>nMaxSrcPage) nLastPageNum =nMaxSrcPage;
- FASTBOOL bReverse=nLastPageNum<nFirstPageNum;
-
- sal_uInt16* pMasterMap=NULL;
- int* pMasterNeed=NULL;
- sal_uInt16 nMasterNeed=0;
- if (bMergeMasterPages && nSrcMasterPageAnz!=0) {
+ if(bMergeMasterPages && nSrcMasterPageAnz)
+ {
// Feststellen, welche MasterPages aus rSrcModel benoetigt werden
- pMasterMap=new sal_uInt16[nSrcMasterPageAnz];
- pMasterNeed=new int[nSrcMasterPageAnz];
- memset(pMasterMap,0xFF,nSrcMasterPageAnz*sizeof(sal_uInt16));
- if (bAllMasterPages) {
- memset(pMasterNeed,sal_True,nSrcMasterPageAnz*sizeof(FASTBOOL));
- } else {
- memset(pMasterNeed,sal_False,nSrcMasterPageAnz*sizeof(FASTBOOL));
- sal_uInt16 nAnf= bReverse ? nLastPageNum : nFirstPageNum;
- sal_uInt16 nEnd= bReverse ? nFirstPageNum : nLastPageNum;
- for (sal_uInt16 i=nAnf; i<=nEnd; i++) {
- const SdrPage* pPg=rSourceModel.GetPage(i);
+ pMasterMap = new sal_uInt32[nSrcMasterPageAnz];
+ pMasterNeed = new bool[nSrcMasterPageAnz];
+ memset(pMasterMap, 0xff, nSrcMasterPageAnz * sizeof(sal_uInt32));
+
+ if(bAllMasterPages)
+ {
+ memset(pMasterNeed, true, nSrcMasterPageAnz * sizeof(bool));
+ }
+ else
+ {
+ memset(pMasterNeed, false, nSrcMasterPageAnz * sizeof(bool));
+ sal_uInt32 nAnf(bReverse ? nLastPageNum : nFirstPageNum);
+ sal_uInt32 nEnd(bReverse ? nFirstPageNum : nLastPageNum);
+
+ for(sal_uInt32 i(nAnf); i <= nEnd; i++)
+ {
+ const SdrPage* pPg = rSourceModel.GetPage(i);
+
if(pPg->TRG_HasMasterPage())
{
SdrPage& rMasterPage = pPg->TRG_GetMasterPage();
- sal_uInt16 nMPgNum(rMasterPage.GetPageNum());
+ const sal_uInt32 nMPgNum(rMasterPage.GetPageNumber());
if(nMPgNum < nSrcMasterPageAnz)
{
- pMasterNeed[nMPgNum] = sal_True;
+ pMasterNeed[nMPgNum] = true;
}
}
}
}
+
// Nun das Mapping der MasterPages bestimmen
- sal_uInt16 nAktMaPagNum=nDstMasterPageAnz;
- for (sal_uInt16 i=0; i<nSrcMasterPageAnz; i++) {
- if (pMasterNeed[i]) {
- pMasterMap[i]=nAktMaPagNum;
+ sal_uInt32 nAktMaPagNum(nDstMasterPageAnz);
+
+ for(sal_uInt32 i(0); i < nSrcMasterPageAnz; i++)
+ {
+ if(pMasterNeed[i])
+ {
+ pMasterMap[i] = nAktMaPagNum;
nAktMaPagNum++;
nMasterNeed++;
}
@@ -1761,61 +1936,83 @@ void SdrModel::Merge(SdrModel& rSourceModel,
}
// rueberholen der Masterpages
- if (pMasterMap!=NULL && pMasterNeed!=NULL && nMasterNeed!=0) {
- for (sal_uInt16 i=nSrcMasterPageAnz; i>0;) {
+ if(pMasterMap && pMasterNeed && nMasterNeed)
+ {
+ for(sal_uInt32 i(nSrcMasterPageAnz); i > 0;)
+ {
i--;
- if (pMasterNeed[i]) {
- SdrPage* pPg=NULL;
- if (bTreadSourceAsConst) {
- const SdrPage* pPg1=rSourceModel.GetMasterPage(i);
- pPg=pPg1->Clone();
- } else {
- pPg=rSourceModel.RemoveMasterPage(i);
+
+ if(pMasterNeed[i])
+ {
+ SdrPage* pPg = rSourceModel.GetMasterPage(i)->CloneSdrPage(this);;
+
+ if(!bTreadSourceAsConst)
+ {
+ delete rSourceModel.RemoveMasterPage(i);
}
- if (pPg!=NULL) {
+
+ if(pPg)
+ {
// und alle ans einstige Ende des DstModel reinschieben.
// nicht InsertMasterPage() verwenden da die Sache
// inkonsistent ist bis alle drin sind
- maMaPag.Insert(pPg,nDstMasterPageAnz);
- // #109538#
- MasterPageListChanged();
- pPg->SetInserted(sal_True);
- pPg->SetModel(this);
- bMPgNumsDirty=sal_True;
- if (bUndo) AddUndo(GetSdrUndoFactory().CreateUndoNewPage(*pPg));
- } else {
+ maMasterPageVector.insert(maMasterPageVector.begin() + nDstMasterPageAnz, pPg);
+ SetInsertedAtSdrPageFromSdrModel(*pPg, true);
+ Broadcast(SdrBaseHint(*pPg, HINT_PAGEORDERCHG));
+
+ if(bUndo)
+ {
+ AddUndo(GetSdrUndoFactory().CreateUndoNewPage(*pPg));
+ }
+ }
+ else
+ {
DBG_ERROR("SdrModel::Merge(): MasterPage im SourceModel nicht gefunden");
}
}
}
+
+ EnsureValidPageNumbers(true);
}
// rueberholen der Zeichenseiten
- if (bInsPages) {
- sal_uInt16 nSourcePos=nFirstPageNum;
- sal_uInt16 nMergeCount=sal_uInt16(Abs((long)((long)nFirstPageNum-nLastPageNum))+1);
- if (nDestPos>GetPageCount()) nDestPos=GetPageCount();
- while (nMergeCount>0) {
- SdrPage* pPg=NULL;
- if (bTreadSourceAsConst) {
- const SdrPage* pPg1=rSourceModel.GetPage(nSourcePos);
- pPg=pPg1->Clone();
- } else {
- pPg=rSourceModel.RemovePage(nSourcePos);
+ if(bInsPages)
+ {
+ sal_uInt32 nSourcePos(nFirstPageNum);
+ sal_uInt32 nMergeCount((nLastPageNum > nFirstPageNum ? (nLastPageNum - nFirstPageNum) : (nFirstPageNum - nLastPageNum)) + 1);
+
+ if(nDestPos > GetPageCount())
+ {
+ nDestPos = GetPageCount();
+ }
+
+ while(nMergeCount)
+ {
+ SdrPage* pPg = rSourceModel.GetPage(nSourcePos)->CloneSdrPage(this);
+
+ if(!bTreadSourceAsConst)
+ {
+ delete rSourceModel.RemovePage(nSourcePos);
}
- if (pPg!=NULL) {
- InsertPage(pPg,nDestPos);
- if (bUndo) AddUndo(GetSdrUndoFactory().CreateUndoNewPage(*pPg));
- // und nun zu den MasterPageDescriptoren
+ if(pPg)
+ {
+ InsertPage(pPg, nDestPos);
+
+ if(bUndo)
+ {
+ AddUndo(GetSdrUndoFactory().CreateUndoNewPage(*pPg));
+ }
+
+ // und nun zu den MasterPageDescriptoren
if(pPg->TRG_HasMasterPage())
{
SdrPage& rMasterPage = pPg->TRG_GetMasterPage();
- sal_uInt16 nMaPgNum(rMasterPage.GetPageNum());
+ sal_uInt32 nMaPgNum(rMasterPage.GetPageNumber());
if (bMergeMasterPages)
{
- sal_uInt16 nNeuNum(0xFFFF);
+ sal_uInt32 nNeuNum(0xffffffff);
if(pMasterMap)
{
@@ -1831,21 +2028,35 @@ void SdrModel::Merge(SdrModel& rSourceModel,
pPg->TRG_SetMasterPage(*GetMasterPage(nNeuNum));
}
+
DBG_ASSERT(nNeuNum!=0xFFFF,"SdrModel::Merge(): Irgendwas ist krumm beim Mappen der MasterPages");
- } else {
- if (nMaPgNum>=nDstMasterPageAnz) {
+ }
+ else
+ {
+ if(nMaPgNum >= nDstMasterPageAnz)
+ {
// Aha, die ist ausserbalb des urspruenglichen Bereichs der Masterpages des DstModel
pPg->TRG_ClearMasterPage();
}
}
}
-
- } else {
+ }
+ else
+ {
DBG_ERROR("SdrModel::Merge(): Zeichenseite im SourceModel nicht gefunden");
}
+
nDestPos++;
- if (bReverse) nSourcePos--;
- else if (bTreadSourceAsConst) nSourcePos++;
+
+ if(bReverse)
+ {
+ nSourcePos--;
+ }
+ else if(bTreadSourceAsConst)
+ {
+ nSourcePos++;
+ }
+
nMergeCount--;
}
}
@@ -1853,32 +2064,39 @@ void SdrModel::Merge(SdrModel& rSourceModel,
delete [] pMasterMap;
delete [] pMasterNeed;
- bMPgNumsDirty=sal_True;
- bPagNumsDirty=sal_True;
-
SetChanged();
+
// Fehlt: Mergen und Mapping der Layer
// an den Objekten sowie an den MasterPageDescriptoren
- if (bUndo) EndUndo();
+
+ if(bUndo)
+ {
+ EndUndo();
+ }
}
-void SdrModel::SetStarDrawPreviewMode(sal_Bool bPreview)
+void SdrModel::SetStarDrawPreviewMode(bool bPreview)
{
- if (!bPreview && bStarDrawPreviewMode && GetPageCount())
+ if(!bPreview && IsStarDrawPreviewMode() && GetPageCount())
{
// Das Zuruecksetzen ist nicht erlaubt, da das Model ev. nicht vollstaendig geladen wurde
- DBG_ASSERT(sal_False,"SdrModel::SetStarDrawPreviewMode(): Zuruecksetzen nicht erlaubt, da Model ev. nicht vollstaendig");
+ DBG_ASSERT(false,"SdrModel::SetStarDrawPreviewMode(): Zuruecksetzen nicht erlaubt, da Model ev. nicht vollstaendig");
}
else
{
- bStarDrawPreviewMode = bPreview;
+ if(mbStarDrawPreviewMode != bPreview)
+ {
+ mbStarDrawPreviewMode = bPreview;
+ }
}
}
uno::Reference< uno::XInterface > SdrModel::getUnoModel()
{
- if( !mxUnoModel.is() )
+ if(!mxUnoModel.is())
+ {
mxUnoModel = createUnoModel();
+ }
return mxUnoModel;
}
@@ -1892,99 +2110,39 @@ uno::Reference< uno::XInterface > SdrModel::createUnoModel()
{
DBG_ERROR( "SdrModel::createUnoModel() - base implementation should not be called!" );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInt;
+
return xInt;
}
-void SdrModel::setLock( sal_Bool bLock )
+void SdrModel::setLock( bool bLock )
{
- if( mbModelLocked != bLock )
+ if(mbModelLocked != bLock)
{
// #120437# need to set first, else ImpReformatAllEdgeObjects will do nothing
mbModelLocked = bLock;
- if( sal_False == bLock )
- {
- // ReformatAllTextObjects(); #103122# due to a typo in the above if, this code was never
- // executed, so I remove it until we discover that we need it here
- ImpReformatAllEdgeObjects(); // #103122#
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrModel::MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel )
-{
- if( pSourceSet && pDestSet && (pSourceSet != pDestSet ) )
- {
- if( pNewModel == NULL )
- pNewModel = this;
-
- SfxWhichIter aWhichIter(*pSourceSet);
- sal_uInt16 nWhich(aWhichIter.FirstWhich());
- const SfxPoolItem *pPoolItem;
-
- while(nWhich)
+ if(!bLock)
{
- if(SFX_ITEM_SET == pSourceSet->GetItemState(nWhich, sal_False, &pPoolItem))
- {
- const SfxPoolItem* pItem = pPoolItem;
-
- switch( nWhich )
- {
- case XATTR_FILLBITMAP:
- pItem = ((XFillBitmapItem*)pItem)->checkForUniqueItem( pNewModel );
- break;
- case XATTR_LINEDASH:
- pItem = ((XLineDashItem*)pItem)->checkForUniqueItem( pNewModel );
- break;
- case XATTR_LINESTART:
- pItem = ((XLineStartItem*)pItem)->checkForUniqueItem( pNewModel );
- break;
- case XATTR_LINEEND:
- pItem = ((XLineEndItem*)pItem)->checkForUniqueItem( pNewModel );
- break;
- case XATTR_FILLGRADIENT:
- pItem = ((XFillGradientItem*)pItem)->checkForUniqueItem( pNewModel );
- break;
- case XATTR_FILLFLOATTRANSPARENCE:
- // #85953# allow all kinds of XFillFloatTransparenceItem to be set
- pItem = ((XFillFloatTransparenceItem*)pItem)->checkForUniqueItem( pNewModel );
- break;
- case XATTR_FILLHATCH:
- pItem = ((XFillHatchItem*)pItem)->checkForUniqueItem( pNewModel );
- break;
- }
-
- // set item
- if( pItem )
- {
- pDestSet->Put(*pItem);
-
- // delete item if it was a generated one
- if( pItem != pPoolItem)
- delete (SfxPoolItem*)pItem;
- }
- }
- nWhich = aWhichIter.NextWhich();
+ ImpReformatAllEdgeObjects();
}
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrModel::SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars )
{
- if( mpForbiddenCharactersTable )
+ if(mpForbiddenCharactersTable)
+ {
mpForbiddenCharactersTable->release();
+ }
mpForbiddenCharactersTable = xForbiddenChars.getBodyPtr();
- if( mpForbiddenCharactersTable )
+ if(mpForbiddenCharactersTable)
+ {
mpForbiddenCharactersTable->acquire();
+ }
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
+ ImpSetOutlinerDefaults(mpDrawOutliner);
}
vos::ORef<SvxForbiddenCharactersTable> SdrModel::GetForbiddenCharsTable() const
@@ -1992,73 +2150,84 @@ vos::ORef<SvxForbiddenCharactersTable> SdrModel::GetForbiddenCharsTable() const
return mpForbiddenCharactersTable;
}
-void SdrModel::SetCharCompressType( sal_uInt16 nType )
+void SdrModel::SetCharCompressType(sal_uInt16 nType)
{
- if( nType != mnCharCompressType )
+ if(nType != mnCharCompressType)
{
mnCharCompressType = nType;
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
+
+ ImpSetOutlinerDefaults(mpDrawOutliner);
}
}
-void SdrModel::SetKernAsianPunctuation( sal_Bool bEnabled )
+void SdrModel::SetKernAsianPunctuation(bool bEnabled)
{
- if( mbKernAsianPunctuation != bEnabled )
+ if(mbKernAsianPunctuation != bEnabled)
{
mbKernAsianPunctuation = bEnabled;
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
+
+ ImpSetOutlinerDefaults(mpDrawOutliner);
}
}
-void SdrModel::SetAddExtLeading( sal_Bool bEnabled )
+void SdrModel::SetAddExtLeading( bool bEnabled )
{
- if( mbAddExtLeading != bEnabled )
+ if(mbAddExtLeading != bEnabled)
{
mbAddExtLeading = bEnabled;
- ImpSetOutlinerDefaults( pDrawOutliner );
- ImpSetOutlinerDefaults( pHitTestOutliner );
+
+ ImpSetOutlinerDefaults(mpDrawOutliner);
}
}
void SdrModel::ReformatAllTextObjects()
{
- ImpReformatAllTextObjects();
-}
-
-FASTBOOL SdrModel::HasTransparentObjects( sal_Bool bCheckForAlphaChannel ) const
-{
- FASTBOOL bRet = sal_False;
- sal_uInt16 n, nCount;
+ if(isLocked())
+ {
+ return;
+ }
- for( n = 0, nCount = GetMasterPageCount(); ( n < nCount ) && !bRet; n++ )
- if( GetMasterPage( n )->HasTransparentObjects( bCheckForAlphaChannel ) )
- bRet = sal_True;
+ sal_uInt32 nAnz(GetMasterPageCount());
+ sal_uInt32 nNum;
- if( !bRet )
+ for(nNum = 0; nNum < nAnz; nNum++)
{
- for( n = 0, nCount = GetPageCount(); ( n < nCount ) && !bRet; n++ )
- if( GetPage( n )->HasTransparentObjects( bCheckForAlphaChannel ) )
- bRet = sal_True;
+ SdrObjListIter aIter(*GetMasterPage(nNum), IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ aIter.Next()->ReformatText();
+ }
}
- return bRet;
+ nAnz = GetPageCount();
+
+ for(nNum = 0; nNum < nAnz; nNum++)
+ {
+ SdrObjListIter aIter(*GetPage(nNum), IM_DEEPNOGROUPS);
+
+ while(aIter.IsMore())
+ {
+ aIter.Next()->ReformatText();
+ }
+ }
}
-SdrOutliner* SdrModel::createOutliner( sal_uInt16 nOutlinerMode )
+SdrOutliner* SdrModel::createOutliner(sal_uInt16 nOutlinerMode)
{
- if( NULL == mpOutlinerCache )
+ if(!mpOutlinerCache)
+ {
mpOutlinerCache = new SdrOutlinerCache(this);
+ }
- return mpOutlinerCache->createOutliner( nOutlinerMode );
+ return mpOutlinerCache->createOutliner(nOutlinerMode);
}
-void SdrModel::disposeOutliner( SdrOutliner* pOutliner )
+void SdrModel::disposeOutliner(SdrOutliner* pOutliner)
{
- if( mpOutlinerCache )
+ if(mpOutlinerCache)
{
- mpOutlinerCache->disposeOutliner( pOutliner );
+ mpOutlinerCache->disposeOutliner(pOutliner);
}
else
{
@@ -2071,102 +2240,79 @@ SvxNumType SdrModel::GetPageNumType() const
return SVX_ARABIC;
}
-const SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum) const
-{
- DBG_ASSERT(nPgNum < maPages.Count(), "SdrModel::GetPage: Access out of range (!)");
- return (SdrPage*)(maPages.GetObject(nPgNum));
-}
-
-SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum)
-{
- DBG_ASSERT(nPgNum < maPages.Count(), "SdrModel::GetPage: Access out of range (!)");
- return (SdrPage*)(maPages.GetObject(nPgNum));
-}
-
-sal_uInt16 SdrModel::GetPageCount() const
-{
- return sal_uInt16(maPages.Count());
-}
-
-void SdrModel::PageListChanged()
-{
-}
-
-const SdrPage* SdrModel::GetMasterPage(sal_uInt16 nPgNum) const
-{
- DBG_ASSERT(nPgNum < maMaPag.Count(), "SdrModel::GetMasterPage: Access out of range (!)");
- return (SdrPage*)(maMaPag.GetObject(nPgNum));
-}
-
-SdrPage* SdrModel::GetMasterPage(sal_uInt16 nPgNum)
-{
- DBG_ASSERT(nPgNum < maMaPag.Count(), "SdrModel::GetMasterPage: Access out of range (!)");
- return (SdrPage*)(maMaPag.GetObject(nPgNum));
-}
-
-sal_uInt16 SdrModel::GetMasterPageCount() const
+SdrPage* SdrModel::GetPage(sal_uInt32 nPgNum) const
{
- return sal_uInt16(maMaPag.Count());
+ if(nPgNum < maPageVector.size())
+ {
+ return *(maPageVector.begin() + nPgNum);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::GetPage access oot of range (!)");
+ return 0;
+ }
}
-void SdrModel::MasterPageListChanged()
+SdrPage* SdrModel::GetMasterPage(sal_uInt32 nPgNum) const
{
+ if(nPgNum < maMasterPageVector.size())
+ {
+ return *(maMasterPageVector.begin() + nPgNum);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrModel::GetMasterPage access out of range (!)");
+ return 0;
+ }
}
-void SdrModel::SetSdrUndoManager( SfxUndoManager* pUndoManager )
+void SdrModel::SetSdrUndoManager(SfxUndoManager* pUndoManager)
{
- mpImpl->mpUndoManager = pUndoManager;
+ mpUndoManager = pUndoManager;
}
SfxUndoManager* SdrModel::GetSdrUndoManager() const
{
- return mpImpl->mpUndoManager;
+ return mpUndoManager;
}
SdrUndoFactory& SdrModel::GetSdrUndoFactory() const
{
- if( !mpImpl->mpUndoFactory )
- mpImpl->mpUndoFactory = new SdrUndoFactory;
- return *mpImpl->mpUndoFactory;
-}
-
-void SdrModel::SetSdrUndoFactory( SdrUndoFactory* pUndoFactory )
-{
- if( pUndoFactory && (pUndoFactory != mpImpl->mpUndoFactory) )
+ if(!mpUndoFactory)
{
- delete mpImpl->mpUndoFactory;
- mpImpl->mpUndoFactory = pUndoFactory;
+ const_cast< SdrModel* >(this)->mpUndoFactory = new SdrUndoFactory();
}
-}
-/** cl: added this for OJ to complete his reporting engine, does not work
- correctly so only enable it for his model */
-bool SdrModel::IsAllowShapePropertyChangeListener() const
-{
- return mpImpl && mpImpl->mbAllowShapePropertyChangeListener;
+ return *mpUndoFactory;
}
-void SdrModel::SetAllowShapePropertyChangeListener( bool bAllow )
+void SdrModel::SetSdrUndoFactory(SdrUndoFactory* pUndoFactory)
{
- if( mpImpl )
+ if(pUndoFactory && (pUndoFactory != mpUndoFactory))
{
- mpImpl->mbAllowShapePropertyChangeListener = bAllow;
+ delete mpUndoFactory;
+
+ mpUndoFactory = pUndoFactory;
}
}
const ::com::sun::star::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImplementationId()
{
static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
- if( !pSeq )
+
+ if(!pSeq)
{
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !pSeq )
+ ::osl::MutexGuard aGuard(::osl::Mutex::getGlobalMutex());
+
+ if(!pSeq)
{
static Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
+
+ rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, true);
pSeq = &aSeq;
}
}
+
return *pSeq;
}
@@ -2177,107 +2323,74 @@ void SdrModel::SetDrawingLayerPoolDefaults()
const Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING);
const XHatch aNullHatch(aNullLineCol);
- pItemPool->SetPoolDefaultItem( XFillColorItem(aNullStr,aNullFillCol) );
- pItemPool->SetPoolDefaultItem( XFillHatchItem(pItemPool,aNullHatch) );
- pItemPool->SetPoolDefaultItem( XLineColorItem(aNullStr,aNullLineCol) );
-}
-
-//
-// i120668, move from the header files, add delete action
-//
-void SdrModel::SetColorTable(XColorTable* pTable) { delete pColorTable; pColorTable=pTable; }
-void SdrModel::SetDashList(XDashList* pList) { delete pDashList; pDashList=pList; }
-void SdrModel::SetLineEndList(XLineEndList* pList) { delete pLineEndList; pLineEndList=pList; }
-void SdrModel::SetHatchList(XHatchList* pList) { delete pHatchList; pHatchList=pList; }
-void SdrModel::SetGradientList(XGradientList* pList) { delete pGradientList; pGradientList=pList; }
-void SdrModel::SetBitmapList(XBitmapList* pList) { delete pBitmapList; pBitmapList=pList; }
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1(SdrHint,SfxHint);
-
-SdrHint::SdrHint()
-: mpPage(0L),
- mpObj(0L),
- mpObjList(0L),
- meHint(HINT_UNKNOWN)
-{
+ mpItemPool->SetPoolDefaultItem(XFillColorItem(aNullStr, aNullFillCol));
+ mpItemPool->SetPoolDefaultItem(XFillHatchItem(mpItemPool, aNullHatch));
+ mpItemPool->SetPoolDefaultItem(XLineColorItem(aNullStr, aNullLineCol));
}
-SdrHint::SdrHint(SdrHintKind eNewHint)
-: mpPage(0L),
- mpObj(0L),
- mpObjList(0L),
- meHint(eNewHint)
+bool SdrModel::IsWriter() const
{
+ return false;
}
-SdrHint::SdrHint(const SdrObject& rNewObj)
-: mpPage(rNewObj.GetPage()),
- mpObj(&rNewObj),
- mpObjList(rNewObj.GetObjList()),
- meHint(HINT_OBJCHG)
-{
- maRectangle = rNewObj.GetLastBoundRect();
-}
-
-SdrHint::SdrHint(const SdrObject& rNewObj, const Rectangle& rRect)
-: mpPage(rNewObj.GetPage()),
- mpObj(&rNewObj),
- mpObjList(rNewObj.GetObjList()),
- meHint(HINT_OBJCHG)
-{
- maRectangle = rRect;
-}
-
-void SdrHint::SetPage(const SdrPage* pNewPage)
-{
- mpPage = pNewPage;
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// i120668, move from the header files, add delete action
-void SdrHint::SetObjList(const SdrObjList* pNewOL)
-{
- mpObjList = pNewOL;
-}
+void SdrModel::SetColorTable(XColorTable* pTable) { delete mpColorTable; mpColorTable = pTable; }
+void SdrModel::SetDashList(XDashList* pList) { delete mpDashList; mpDashList = pList; }
+void SdrModel::SetLineEndList(XLineEndList* pList) { delete mpLineEndList; mpLineEndList = pList; }
+void SdrModel::SetHatchList(XHatchList* pList) { delete mpHatchList; mpHatchList = pList; }
+void SdrModel::SetGradientList(XGradientList* pList) { delete mpGradientList; mpGradientList = pList; }
+void SdrModel::SetBitmapList(XBitmapList* pList) { delete mpBitmapList; mpBitmapList = pList; }
-void SdrHint::SetObject(const SdrObject* pNewObj)
+::std::set< SdrView* > SdrModel::getSdrViews() const
{
- mpObj = pNewObj;
-}
+ ::std::set< SdrView* > aRetval;
+ const sal_uInt16 nCount(GetListenerCount());
-void SdrHint::SetKind(SdrHintKind eNewKind)
-{
- meHint = eNewKind;
-}
+ for(sal_uInt16 a(0); a < nCount; a++)
+ {
+ SdrView* pCandidate = dynamic_cast< SdrView* >(GetListener(a));
-void SdrHint::SetRect(const Rectangle& rNewRect)
-{
- maRectangle = rNewRect;
-}
+ if(pCandidate)
+ {
+ aRetval.insert(pCandidate);
+ }
+ }
-const SdrPage* SdrHint::GetPage() const
-{
- return mpPage;
+ return aRetval;
}
-const SdrObjList* SdrHint::GetObjList() const
-{
- return mpObjList;
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
-const SdrObject* SdrHint::GetObject() const
+SdrBaseHint::SdrBaseHint(
+ SdrHintKind eSdrHintKind)
+: SfxHint(),
+ meSdrHint(eSdrHintKind),
+ mpSdrPage(0),
+ mpSdrObject(0)
{
- return mpObj;
}
-SdrHintKind SdrHint::GetKind() const
+SdrBaseHint::SdrBaseHint(
+ const SdrPage& rSdrPage,
+ SdrHintKind eSdrHintKind)
+: SfxHint(),
+ meSdrHint(eSdrHintKind),
+ mpSdrPage(&rSdrPage),
+ mpSdrObject(0)
{
- return meHint;
}
-const Rectangle& SdrHint::GetRect() const
+SdrBaseHint::SdrBaseHint(
+ const SdrObject& rSdrObject,
+ SdrHintKind eSdrHintKind)
+: SfxHint(),
+ meSdrHint(eSdrHintKind),
+ mpSdrPage(rSdrObject.getSdrPageFromSdrObject()),
+ mpSdrObject(&rSdrObject)
{
- return maRectangle;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 3cf0c5f38c15..8779d2481684 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -27,8 +27,9 @@
#include <svx/svdmrkv.hxx>
#include <svx/svdetc.hxx>
#include <svx/svdoedge.hxx>
-#include "svx/svdglob.hxx"
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svdglob.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdview.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdpage.hxx>
@@ -48,20 +49,15 @@
#include <svx/svdundo.hxx>
#include <svx/svdopath.hxx>
#include <svx/scene3d.hxx>
-#include <svx/svdovirt.hxx>
#include <svx/sdr/overlay/overlayrollingrectangle.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/sdrhittesthelper.hxx>
+#include <svx/svdlegacy.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-// predefines
-
-class SdrUnoControlList;
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// #114409#-3 Migrate Marking of Objects, Points and GluePoints
+// selection visualisation of Objects, Points and GluePoints
class ImplMarkingOverlay
{
@@ -73,17 +69,17 @@ class ImplMarkingOverlay
// bitfield
// A flag to remember if the action is for unmarking.
- unsigned mbUnmarking : 1;
+ bool mbUnmarking : 1;
public:
- ImplMarkingOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos, sal_Bool bUnmarking = sal_False);
+ ImplMarkingOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos, bool bUnmarking = false);
~ImplMarkingOverlay();
void SetSecondPosition(const basegfx::B2DPoint& rNewPosition);
- sal_Bool IsUnmarking() const { return mbUnmarking; }
+ bool IsUnmarking() const { return mbUnmarking; }
};
-ImplMarkingOverlay::ImplMarkingOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos, sal_Bool bUnmarking)
+ImplMarkingOverlay::ImplMarkingOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos, bool bUnmarking)
: maSecondPosition(rStartPos),
mbUnmarking(bUnmarking)
{
@@ -126,118 +122,157 @@ void ImplMarkingOverlay::SetSecondPosition(const basegfx::B2DPoint& rNewPosition
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@ @@@@ @@@@@ @@ @@ @@ @@ @@ @@@@@ @@ @@
-// @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@@@@ @@@@@@ @@@@@ @@@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
+// global helpers for selection
-void SdrMarkView::ImpClearVars()
-{
- eDragMode=SDRDRAG_MOVE;
- //HMHbHdlShown=sal_False;
- bRefHdlShownOnly=sal_False;
- eEditMode=SDREDITMODE_EDIT;
- eEditMode0=SDREDITMODE_EDIT;
- bDesignMode=sal_False;
- pMarkedObj=NULL;
- pMarkedPV=NULL;
- bForceFrameHandles=sal_False;
- bPlusHdlAlways=sal_False;
- nFrameHandlesLimit=50;
- bInsPolyPoint=sal_False;
- mnInsPointNum = 0L;
- bMarkedObjRectDirty=sal_False;
- bMarkedPointsRectsDirty=sal_False;
- mbMarkHandlesHidden = false;
- bMrkPntDirty=sal_False;
- bMarkHdlWhenTextEdit=sal_False;
- bMarkableObjCountDirty=sal_False; // noch nicht implementiert
- nMarkableObjCount=0; // noch nicht implementiert
-
- // #114409#-3 Migrate selections
- BrkMarkObj();
- BrkMarkPoints();
- BrkMarkGluePoints();
+const String getSelectionDescription(const SdrObjectVector& rSdrObjectVector)
+{
+ String aRetval;
+
+ if(rSdrObjectVector.empty())
+ {
+ aRetval = ImpGetResStr(STR_ObjNameNoObj);
+ }
+ else
+ {
+ SdrObject* pMarkedObject = rSdrObjectVector[0];
+
+ if(1 == rSdrObjectVector.size())
+ {
+ pMarkedObject->TakeObjNameSingul(aRetval);
+ }
+ else
+ {
+ pMarkedObject->TakeObjNamePlural(aRetval);
+ String aCompare;
+ bool bEq(true);
+
+ for(SdrObjectVector::const_iterator aCandidate(rSdrObjectVector.begin() + 1);
+ bEq && aCandidate != rSdrObjectVector.end(); aCandidate++)
+ {
+ (*aCandidate)->TakeObjNamePlural(aCompare);
+ bEq = aRetval.Equals(aCompare);
+ }
+
+ if(!bEq)
+ {
+ aRetval = ImpGetResStr(STR_ObjNamePlural);
+ }
+
+ aRetval.Insert(sal_Unicode(' '), 0);
+ aRetval.Insert(UniString::CreateFromInt32(rSdrObjectVector.size()), 0);
+ }
+ }
+
+ return aRetval;
}
-SdrMarkView::SdrMarkView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrSnapView(pModel1,pOut),
- mpMarkObjOverlay(0L),
- mpMarkPointsOverlay(0L),
- mpMarkGluePointsOverlay(0L),
- aHdl(this),
- mpSdrViewSelection(new sdr::ViewSelection())
+void sortSdrObjectSelection(SdrObjectVector& rSdrObjectVector)
{
- ImpClearVars();
- StartListening(*pModel1);
+ ::std::sort(rSdrObjectVector.begin(), rSdrObjectVector.end(), sdr::selection::SelectionComparator());
}
-SdrMarkView::~SdrMarkView()
+::std::set< SdrEdgeObj*, sdr::selection::SelectionComparator > getAllConnectedEdges(const SdrObjectVector& rSdrObjectVector)
{
- // #114409#-3 Migrate selections
- BrkMarkObj();
- BrkMarkPoints();
- BrkMarkGluePoints();
- delete mpSdrViewSelection;
+ ::std::set< SdrEdgeObj*, sdr::selection::SelectionComparator > aRetval;
+
+ if(!rSdrObjectVector.empty())
+ {
+ for(SdrObjectVector::const_iterator aCandidate(rSdrObjectVector.begin());
+ aCandidate != rSdrObjectVector.end(); aCandidate++)
+ {
+ const ::std::vector< SdrEdgeObj* > aConnectedEdges((*aCandidate)->getAllConnectedSdrEdgeObj());
+
+ if(!aConnectedEdges.empty())
+ {
+ for(::std::vector< SdrEdgeObj* >::const_iterator aEdge(aConnectedEdges.begin());
+ aEdge != aConnectedEdges.end(); aEdge++)
+ {
+ if((*aEdge)->IsObjectInserted())
+ {
+ aRetval.insert(*aEdge);
+ }
+ }
+ }
+ }
+ }
+
+ return aRetval;
}
-void __EXPORT SdrMarkView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
+::std::vector< SdrEdgeObj* > getAllSdrEdgeObjConnectedToSdrObjectVector(const SdrObjectVector& rSdrObjects, bool bContained)
{
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
- if (pSdrHint!=NULL)
+ ::std::vector< SdrEdgeObj* > aRetval;
+
+ if(!rSdrObjects.empty())
{
- SdrHintKind eKind=pSdrHint->GetKind();
+ const ::std::set< SdrEdgeObj*, sdr::selection::SelectionComparator > aSetOfConnected(getAllConnectedEdges(rSdrObjects));
- if (eKind==HINT_OBJCHG || eKind==HINT_OBJINSERTED || eKind==HINT_OBJREMOVED)
- {
- bMarkedObjRectDirty=sal_True;
- bMarkedPointsRectsDirty=sal_True;
- }
-/* removed for now since this breaks existing code who iterates over the mark list and sequentially replaces objects
- if( eKind==HINT_OBJREMOVED && IsObjMarked( const_cast<SdrObject*>(pSdrHint->GetObject()) ) )
+ if(!aSetOfConnected.empty())
{
- MarkObj( const_cast<SdrObject*>(pSdrHint->GetObject()), GetSdrPageView(), sal_True );
+ ::std::set< SdrEdgeObj*, sdr::selection::SelectionComparator >::const_iterator aIter(aSetOfConnected.begin());
+ const ::std::set< SdrObject*, sdr::selection::IndicesComparator > aSelectionSet(rSdrObjects.begin(), rSdrObjects.end());
+
+ for(;aIter != aSetOfConnected.end(); aIter++)
+ {
+ const bool bIsContained(0 != aSelectionSet.count(*aIter));
+
+ if(bContained == bIsContained)
+ {
+ aRetval.push_back(*aIter);
+ }
+ }
}
-*/
}
- SdrSnapView::Notify(rBC,rHint);
+
+ return aRetval;
}
-void SdrMarkView::ModelHasChanged()
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrMarkView::SdrMarkView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrSnapView(rModel1, pOut),
+ mpMarkObjOverlay(0),
+ mpMarkPointsOverlay(0),
+ mpMarkGluePointsOverlay(0),
+ maRef1(),
+ maRef2(),
+ maLastCrookCenter(),
+ maViewHandleList(*this),
+ maSelection(*getAsSdrView()),
+ maMarkedPointRange(),
+ maMarkedGluePointRange(),
+ mnInsPointNum(0),
+ meViewDragMode(SDRDRAG_MOVE),
+ meViewEditMode(SDREDITMODE_EDIT),
+ mbDesignMode(false),
+ mbForceFrameHandles(false),
+ mbPlusHdlAlways(false),
+ mbInsPolyPoint(false)
{
- SdrPaintView::ModelHasChanged();
- GetMarkedObjectListWriteAccess().SetNameDirty();
- bMarkedObjRectDirty=sal_True;
- bMarkedPointsRectsDirty=sal_True;
- // Es sind beispielsweise Obj markiert und maMarkedObjectListist Sorted.
- // In einer anderen View 2 wird die ObjOrder veraendert
- // (z.B. MovToTop()). Dann ist Neusortieren der MarkList erforderlich.
- GetMarkedObjectListWriteAccess().SetUnsorted();
- SortMarkedObjects();
- bMrkPntDirty=sal_True;
- UndirtyMrkPnt();
- SdrView* pV=(SdrView*)this;
- if (pV!=NULL && !pV->IsDragObj() && !pV->IsInsObjPoint()) { // an dieser Stelle habe ich ein ziemliches Problem !!!
- AdjustMarkHdl();
- }
+ BrkMarkObj();
+ BrkMarkPoints();
+ BrkMarkGluePoints();
+
+ StartListening(rModel1);
+}
+
+SdrMarkView::~SdrMarkView()
+{
+ EndListening(getSdrModelFromSdrView());
+
+ BrkMarkObj();
+ BrkMarkPoints();
+ BrkMarkGluePoints();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrMarkView::IsAction() const
+bool SdrMarkView::IsAction() const
{
return SdrSnapView::IsAction() || IsMarkObj() || IsMarkPoints() || IsMarkGluePoints();
}
-void SdrMarkView::MovAction(const Point& rPnt)
+void SdrMarkView::MovAction(const basegfx::B2DPoint& rPnt)
{
SdrSnapView::MovAction(rPnt);
@@ -276,6 +311,7 @@ void SdrMarkView::EndAction()
void SdrMarkView::BckAction()
{
SdrSnapView::BckAction();
+
BrkMarkObj();
BrkMarkPoints();
BrkMarkGluePoints();
@@ -284,105 +320,67 @@ void SdrMarkView::BckAction()
void SdrMarkView::BrkAction()
{
SdrSnapView::BrkAction();
+
BrkMarkObj();
BrkMarkPoints();
BrkMarkGluePoints();
}
-void SdrMarkView::TakeActionRect(Rectangle& rRect) const
+basegfx::B2DRange SdrMarkView::TakeActionRange() const
{
if(IsMarkObj() || IsMarkPoints() || IsMarkGluePoints())
{
- rRect = Rectangle(aDragStat.GetStart(), aDragStat.GetNow());
+ return basegfx::B2DRange(GetDragStat().GetStart(), GetDragStat().GetNow());
}
else
{
- SdrSnapView::TakeActionRect(rRect);
+ return SdrSnapView::TakeActionRange();
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrMarkView::ClearPageView()
-{
- UnmarkAllObj();
- SdrSnapView::ClearPageView();
-}
-
void SdrMarkView::HideSdrPage()
{
- bool bMrkChg(false);
- //HMHbool bVis(false);
-
- if(mpPageView)
- {
- // break all creation actions when hiding page (#75081#)
- BrkAction();
- //HMHbVis = IsMarkHdlShown();
-
- //HMHif(bVis)
- //HMH{
- //HMH HideMarkHdl();
- //HMH}
-
- // Alle Markierungen dieser Seite verwerfen
- bMrkChg = GetMarkedObjectListWriteAccess().DeletePageView(*mpPageView);
- }
+ UnmarkAllObj();
SdrSnapView::HideSdrPage();
-
- if(bMrkChg)
- {
- MarkListHasChanged();
- AdjustMarkHdl();
- }
-
- //HMHif(bVis)
- //HMH{
- //HMH ShowMarkHdl();
- //HMH}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrMarkView::BegMarkObj(const Point& rPnt, sal_Bool bUnmark)
+bool SdrMarkView::BegMarkObj(const basegfx::B2DPoint& rPnt, bool bUnmark)
{
BrkAction();
DBG_ASSERT(0L == mpMarkObjOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkObjOverlay (!)");
- basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
- mpMarkObjOverlay = new ImplMarkingOverlay(*this, aStartPos, bUnmark);
+ mpMarkObjOverlay = new ImplMarkingOverlay(*this, rPnt, bUnmark);
- aDragStat.Reset(rPnt);
- aDragStat.NextPoint();
- aDragStat.SetMinMove(nMinMovLog);
+ GetDragStat().Reset(rPnt);
+ GetDragStat().NextPoint();
+ GetDragStat().SetMinMove(getMinMovLog());
- return sal_True;
+ return true;
}
-void SdrMarkView::MovMarkObj(const Point& rPnt)
+void SdrMarkView::MovMarkObj(const basegfx::B2DPoint& rPnt)
{
- if(IsMarkObj() && aDragStat.CheckMinMoved(rPnt))
+ if(IsMarkObj() && GetDragStat().CheckMinMoved(rPnt))
{
- aDragStat.NextMove(rPnt);
- DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
- basegfx::B2DPoint aNewPos(rPnt.X(), rPnt.Y());
- mpMarkObjOverlay->SetSecondPosition(aNewPos);
+ GetDragStat().NextMove(rPnt);
+ DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::MovMarkObj: no ImplPageOriginOverlay (!)");
+ mpMarkObjOverlay->SetSecondPosition(rPnt);
}
}
-sal_Bool SdrMarkView::EndMarkObj()
+bool SdrMarkView::EndMarkObj()
{
- sal_Bool bRetval(sal_False);
+ bool bRetval(false);
if(IsMarkObj())
{
- if(aDragStat.IsMinMoved())
+ if(GetDragStat().IsMinMoved())
{
- Rectangle aRect(aDragStat.GetStart(), aDragStat.GetNow());
- aRect.Justify();
- MarkObj(aRect, mpMarkObjOverlay->IsUnmarking());
- bRetval = sal_True;
+ const basegfx::B2DRange aRange(GetDragStat().GetStart(), GetDragStat().GetNow());
+
+ MarkObj(aRange, mpMarkObjOverlay->IsUnmarking());
+ bRetval = true;
}
// cleanup
@@ -396,59 +394,55 @@ void SdrMarkView::BrkMarkObj()
{
if(IsMarkObj())
{
- DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
+ DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::BrkMarkObj: no ImplPageOriginOverlay (!)");
delete mpMarkObjOverlay;
- mpMarkObjOverlay = 0L;
+ mpMarkObjOverlay = 0;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrMarkView::BegMarkPoints(const Point& rPnt, sal_Bool bUnmark)
+bool SdrMarkView::BegMarkPoints(const basegfx::B2DPoint& rPnt, bool bUnmark)
{
if(HasMarkablePoints())
{
BrkAction();
DBG_ASSERT(0L == mpMarkPointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkPointsOverlay (!)");
- basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
- mpMarkPointsOverlay = new ImplMarkingOverlay(*this, aStartPos, bUnmark);
+ mpMarkPointsOverlay = new ImplMarkingOverlay(*this, rPnt, bUnmark);
- aDragStat.Reset(rPnt);
- aDragStat.NextPoint();
- aDragStat.SetMinMove(nMinMovLog);
+ GetDragStat().Reset(rPnt);
+ GetDragStat().NextPoint();
+ GetDragStat().SetMinMove(getMinMovLog());
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
-void SdrMarkView::MovMarkPoints(const Point& rPnt)
+void SdrMarkView::MovMarkPoints(const basegfx::B2DPoint& rPnt)
{
- if(IsMarkPoints() && aDragStat.CheckMinMoved(rPnt))
+ if(IsMarkPoints() && GetDragStat().CheckMinMoved(rPnt))
{
- aDragStat.NextMove(rPnt);
-
- DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
- basegfx::B2DPoint aNewPos(rPnt.X(), rPnt.Y());
- mpMarkPointsOverlay->SetSecondPosition(aNewPos);
+ GetDragStat().NextMove(rPnt);
+ DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::MovMarkPoints: no ImplPageOriginOverlay (!)");
+ mpMarkPointsOverlay->SetSecondPosition(rPnt);
}
}
-sal_Bool SdrMarkView::EndMarkPoints()
+bool SdrMarkView::EndMarkPoints()
{
- sal_Bool bRetval(sal_False);
+ bool bRetval(false);
if(IsMarkPoints())
{
- if(aDragStat.IsMinMoved())
+ if(GetDragStat().IsMinMoved())
{
- Rectangle aRect(aDragStat.GetStart(), aDragStat.GetNow());
- aRect.Justify();
- MarkPoints(aRect, mpMarkPointsOverlay->IsUnmarking());
+ const basegfx::B2DRange aRange(GetDragStat().GetStart(), GetDragStat().GetNow());
+ MarkPoints(&aRange, mpMarkPointsOverlay->IsUnmarking());
- bRetval = sal_True;
+ bRetval = true;
}
// cleanup
@@ -462,59 +456,53 @@ void SdrMarkView::BrkMarkPoints()
{
if(IsMarkPoints())
{
- DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
+ DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::BrkMarkPoints: no ImplPageOriginOverlay (!)");
delete mpMarkPointsOverlay;
mpMarkPointsOverlay = 0L;
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrMarkView::BegMarkGluePoints(const Point& rPnt, sal_Bool bUnmark)
+bool SdrMarkView::BegMarkGluePoints(const basegfx::B2DPoint& rPnt, bool bUnmark)
{
if(HasMarkableGluePoints())
{
BrkAction();
DBG_ASSERT(0L == mpMarkGluePointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkGluePointsOverlay (!)");
- basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
- mpMarkGluePointsOverlay = new ImplMarkingOverlay(*this, aStartPos, bUnmark);
+ mpMarkGluePointsOverlay = new ImplMarkingOverlay(*this, rPnt, bUnmark);
- aDragStat.Reset(rPnt);
- aDragStat.NextPoint();
- aDragStat.SetMinMove(nMinMovLog);
+ GetDragStat().Reset(rPnt);
+ GetDragStat().NextPoint();
+ GetDragStat().SetMinMove(getMinMovLog());
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
-void SdrMarkView::MovMarkGluePoints(const Point& rPnt)
+void SdrMarkView::MovMarkGluePoints(const basegfx::B2DPoint& rPnt)
{
- if(IsMarkGluePoints() && aDragStat.CheckMinMoved(rPnt))
+ if(IsMarkGluePoints() && GetDragStat().CheckMinMoved(rPnt))
{
- aDragStat.NextMove(rPnt);
-
- DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
- basegfx::B2DPoint aNewPos(rPnt.X(), rPnt.Y());
- mpMarkGluePointsOverlay->SetSecondPosition(aNewPos);
+ GetDragStat().NextMove(rPnt);
+ DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::MovMarkGluePoints: no ImplPageOriginOverlay (!)");
+ mpMarkGluePointsOverlay->SetSecondPosition(rPnt);
}
}
-sal_Bool SdrMarkView::EndMarkGluePoints()
+bool SdrMarkView::EndMarkGluePoints()
{
- sal_Bool bRetval(sal_False);
+ bool bRetval(false);
if(IsMarkGluePoints())
{
- if(aDragStat.IsMinMoved())
+ if(GetDragStat().IsMinMoved())
{
- Rectangle aRect(aDragStat.GetStart(),aDragStat.GetNow());
- aRect.Justify();
- MarkGluePoints(&aRect, mpMarkGluePointsOverlay->IsUnmarking());
+ const basegfx::B2DRange aRange(GetDragStat().GetStart(),GetDragStat().GetNow());
+ MarkGluePoints(&aRange, mpMarkGluePointsOverlay->IsUnmarking());
- bRetval = sal_True;
+ bRetval = true;
}
// cleanup
@@ -528,370 +516,333 @@ void SdrMarkView::BrkMarkGluePoints()
{
if(IsMarkGluePoints())
{
- DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
+ DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::BrkMarkGluePoints: no ImplPageOriginOverlay (!)");
delete mpMarkGluePointsOverlay;
mpMarkGluePointsOverlay = 0L;
}
}
-sal_Bool SdrMarkView::HasMarkableObj() const
+bool SdrMarkView::HasMarkableObj() const
{
- sal_uIntPtr nCount=0;
+ const sal_uInt32 nCount(GetMarkableObjCount());
- SdrPageView* pPV = GetSdrPageView();
- if(pPV)
- {
- SdrObjList* pOL=pPV->GetObjList();
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz && nCount==0; nObjNum++) {
- SdrObject* pObj=pOL->GetObj(nObjNum);
- if (IsObjMarkable(pObj,pPV)) {
- nCount++;
- }
- }
- }
- return nCount!=0;
+ return (0 != nCount);
}
-sal_uIntPtr SdrMarkView::GetMarkableObjCount() const
+sal_uInt32 SdrMarkView::GetMarkableObjCount() const
{
- sal_uIntPtr nCount=0;
+ sal_uInt32 nCount(0);
SdrPageView* pPV = GetSdrPageView();
if(pPV)
{
- SdrObjList* pOL=pPV->GetObjList();
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz; nObjNum++) {
+ SdrObjList* pOL = pPV->GetCurrentObjectList();
+ sal_uInt32 nObjAnz = pOL->GetObjCount();
+
+ for(sal_uInt32 nObjNum(0); nObjNum < nObjAnz && !nCount; nObjNum++)
+ {
SdrObject* pObj=pOL->GetObj(nObjNum);
- if (IsObjMarkable(pObj,pPV)) {
+
+ if(IsObjMarkable(*pObj))
+ {
nCount++;
}
}
}
+
return nCount;
}
-//HMHvoid SdrMarkView::ImpShowMarkHdl(bool /*bNoRefHdl*/)
-//HMH{
-//HMH bNoRefHdl=sal_False; // geht leider erstmal nicht anders
-//HMH if (!bHdlShown) {
-//HMH bRefHdlShownOnly=sal_False;
-//HMH bHdlShown=sal_True;
-//HMH }
-//HMH}
-
-//HMHvoid SdrMarkView::ShowMarkHdl(bool /*bNoRefHdl*/)
-//HMH{
-//HMH bNoRefHdl=sal_False; // geht leider erstmal nicht anders
-//HMH ImpShowMarkHdl(bNoRefHdl);
-//HMH}
-
-
-//HMHvoid SdrMarkView::HideMarkHdl(bool /*bNoRefHdl*/)
-//HMH{
-//HMH bNoRefHdl=sal_False; // geht leider erstmal nicht anders
-//HMH if (bHdlShown) {
-//HMH bRefHdlShownOnly=bNoRefHdl;
-//HMH bHdlShown=sal_False;
-//HMH }
-//HMH}
-
-void SdrMarkView::hideMarkHandles()
+bool SdrMarkView::ImpIsFrameHandles() const
{
- if(!mbMarkHandlesHidden)
- {
- mbMarkHandlesHidden = true;
- AdjustMarkHdl();
- }
-}
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bFrmHdl(aSelection.size() > FRAME_HANDLES_LIMIT || IsFrameHandles());
+ const bool bStdDrag(SDRDRAG_MOVE == GetDragMode());
-void SdrMarkView::showMarkHandles()
-{
- if(mbMarkHandlesHidden)
+ if(1 == aSelection.size() && bStdDrag && bFrmHdl)
{
- mbMarkHandlesHidden = false;
- AdjustMarkHdl();
- }
-}
+ const SdrObject* pObj = aSelection[0];
-sal_Bool SdrMarkView::ImpIsFrameHandles() const
-{
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_Bool bFrmHdl=nMarkAnz>nFrameHandlesLimit || bForceFrameHandles;
- sal_Bool bStdDrag=eDragMode==SDRDRAG_MOVE;
- if (nMarkAnz==1 && bStdDrag && bFrmHdl)
- {
- const SdrObject* pObj=GetMarkedObjectByIndex(0);
- if (pObj->GetObjInventor()==SdrInventor)
+ if(SdrInventor == pObj->GetObjInventor())
{
- sal_uInt16 nIdent=pObj->GetObjIdentifier();
- if (nIdent==OBJ_LINE || nIdent==OBJ_EDGE || nIdent==OBJ_CAPTION || nIdent==OBJ_MEASURE || nIdent==OBJ_CUSTOMSHAPE || nIdent==OBJ_TABLE )
+ const sal_uInt16 nIdent(pObj->GetObjIdentifier());
+
+ if(OBJ_EDGE == nIdent
+ || OBJ_CAPTION == nIdent
+ || OBJ_MEASURE == nIdent
+ || OBJ_CUSTOMSHAPE == nIdent
+ || OBJ_TABLE == nIdent)
{
- bFrmHdl=sal_False;
+ bFrmHdl = false;
+ }
+
+ if(bFrmHdl && OBJ_POLY == nIdent)
+ {
+ const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >(pObj);
+
+ if(pPath && pPath->isLine())
+ {
+ bFrmHdl = false;
+ }
}
}
}
- if (!bStdDrag && !bFrmHdl) {
+
+ if(!bStdDrag && !bFrmHdl)
+ {
// Grundsaetzlich erstmal alle anderen Dragmodi nur mit FrameHandles
- bFrmHdl=sal_True;
- if (eDragMode==SDRDRAG_ROTATE) {
+ bFrmHdl = true;
+
+ if(SDRDRAG_ROTATE == GetDragMode())
+ {
// bei Rotate ObjOwn-Drag, wenn mind. 1 PolyObj
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && bFrmHdl; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- bFrmHdl=!pObj->IsPolyObj();
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size() && bFrmHdl; nMarkNum++)
+ {
+ bFrmHdl = !aSelection[nMarkNum]->IsPolygonObject();
}
}
}
- if (!bFrmHdl) {
+
+ if(!bFrmHdl)
+ {
// FrameHandles, wenn wenigstens 1 Obj kein SpecialDrag kann
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bFrmHdl; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- bFrmHdl=!pObj->hasSpecialDrag();
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size() && !bFrmHdl; nMarkNum++)
+ {
+ bFrmHdl = !aSelection[nMarkNum]->hasSpecialDrag();
}
}
+
return bFrmHdl;
}
void SdrMarkView::SetMarkHandles()
{
// #105722# remember old focus handle values to search for it again
- const SdrHdl* pSaveOldFocusHdl = aHdl.GetFocusHdl();
- sal_Bool bSaveOldFocus(sal_False);
- sal_uInt32 nSavePolyNum(0L), nSavePointNum(0L);
+ const SdrHdl* pSaveOldFocusHdl = maViewHandleList.GetFocusHdl();
+ bool bSaveOldFocus(false);
+ sal_uInt32 nSavePolyNum(0);
+ sal_uInt32 nSavePointNum(0);
SdrHdlKind eSaveKind(HDL_MOVE);
- SdrObject* pSaveObj = NULL;
+ const SdrObject* pSaveObj = 0;
if(pSaveOldFocusHdl
- && pSaveOldFocusHdl->GetObj()
- && pSaveOldFocusHdl->GetObj()->ISA(SdrPathObj)
- && (pSaveOldFocusHdl->GetKind() == HDL_POLY || pSaveOldFocusHdl->GetKind() == HDL_BWGT))
+ && dynamic_cast< const SdrPathObj* >(pSaveOldFocusHdl->GetObj())
+ && (HDL_POLY == pSaveOldFocusHdl->GetKind() || HDL_BWGT == pSaveOldFocusHdl->GetKind()))
{
- bSaveOldFocus = sal_True;
+ bSaveOldFocus = true;
nSavePolyNum = pSaveOldFocusHdl->GetPolyNum();
nSavePointNum = pSaveOldFocusHdl->GetPointNum();
pSaveObj = pSaveOldFocusHdl->GetObj();
eSaveKind = pSaveOldFocusHdl->GetKind();
}
- // delete/clear all handles. This will always be done, even with areMarkHandlesHidden()
- aHdl.Clear();
- aHdl.SetRotateShear(eDragMode==SDRDRAG_ROTATE);
- aHdl.SetDistortShear(eDragMode==SDRDRAG_SHEAR);
- pMarkedObj=NULL;
- pMarkedPV=NULL;
+ // delete/clear all handles. This will always be done
+ maViewHandleList.Clear();
+ maViewHandleList.SetRotateShear(SDRDRAG_ROTATE == GetDragMode());
+ maViewHandleList.SetDistortShear(SDRDRAG_SHEAR == GetDragMode());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ const bool bStdDrag(SDRDRAG_MOVE == GetDragMode());
+ const bool bFrmHdl(ImpIsFrameHandles());
- // are handles enabled at all? Create only then
- if(!areMarkHandlesHidden())
+ if(bFrmHdl)
{
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_Bool bStdDrag=eDragMode==SDRDRAG_MOVE;
- sal_Bool bSingleTextObjMark=sal_False;
+ const basegfx::B2DRange& rSnapRange(getMarkedObjectSnapRange());
+ SdrObject* pSingleSelected = getSelectedIfSingle();
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(pSingleSelected);
+ const bool bHideHandlesWhenInTextEdit(getAsSdrView()->IsTextEdit() && pTextObj && pTextObj->IsInEditMode());
+
+ // #i118524# if inplace activated OLE is selected,
+ // suppress handles
+ bool bHideHandlesWhenOleActive(false);
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pSingleSelected);
- if (nMarkAnz==1)
+ if(pSdrOle2Obj && (pSdrOle2Obj->isInplaceActive() || pSdrOle2Obj->isUiActive()))
{
- pMarkedObj=GetMarkedObjectByIndex(0);
- bSingleTextObjMark =
- pMarkedObj &&
- pMarkedObj->ISA(SdrTextObj) &&
- static_cast<SdrTextObj*>(pMarkedObj)->IsTextFrame();
+ bHideHandlesWhenOleActive = true;
}
- sal_Bool bFrmHdl=ImpIsFrameHandles();
-
- if (nMarkAnz>0)
+ if(!rSnapRange.isEmpty() && !bHideHandlesWhenInTextEdit && !bHideHandlesWhenOleActive)
{
- pMarkedPV=GetSdrPageViewOfMarkedByIndex(0);
+ const bool bSingleTextObjMark(1 == aSelection.size() && pTextObj && pTextObj->IsTextFrame());
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && (pMarkedPV!=NULL || !bFrmHdl); nMarkNum++)
+ if(bSingleTextObjMark)
{
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
+ const sal_uInt32 nSiz0(maViewHandleList.GetHdlCount());
+ pTextObj->AddToHdlList(maViewHandleList);
+ const sal_uInt32 nSiz1(maViewHandleList.GetHdlCount());
- if (pMarkedPV!=pM->GetPageView())
+ for(sal_uInt32 i(nSiz0); i < nSiz1; i++)
{
- pMarkedPV=NULL;
+ SdrHdl* pHdl = maViewHandleList.GetHdlByIndex(i);
+ pHdl->SetObjHdlNum(i - nSiz0);
}
}
- }
-
- if (bFrmHdl)
- {
- Rectangle aRect(GetMarkedObjRect());
-
- // #i33755#
- const sal_Bool bHideHandlesWhenInTextEdit(
- ((SdrView*)this)->IsTextEdit()
- && pMarkedObj
- && pMarkedObj->ISA(SdrTextObj)
- && ((SdrTextObj*)pMarkedObj)->IsInEditMode());
-
- // #i118524# if inplace activated OLE is selected,
- // suppress handles
- bool bHideHandlesWhenOleActive(false);
- const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pMarkedObj);
-
- if(pSdrOle2Obj && (pSdrOle2Obj->isInplaceActive() || pSdrOle2Obj->isUiActive()))
+ else if(SDRDRAG_CROP == GetDragMode())
{
- bHideHandlesWhenOleActive = true;
+ const basegfx::B2DPoint aCenter(rSnapRange.getCenter());
+
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_UPLFT, rSnapRange.getMinimum());
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_UPPER, basegfx::B2DTuple(aCenter.getX(), rSnapRange.getMinY()));
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_UPRGT, basegfx::B2DTuple(rSnapRange.getMaxX(), rSnapRange.getMinY()));
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_LEFT, basegfx::B2DTuple(rSnapRange.getMinX(), aCenter.getY()));
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_RIGHT, basegfx::B2DTuple(rSnapRange.getMaxX(), aCenter.getY()));
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_LWLFT, basegfx::B2DTuple(rSnapRange.getMinX(), rSnapRange.getMaxY()));
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_LOWER, basegfx::B2DTuple(aCenter.getX(), rSnapRange.getMaxY()));
+ new SdrCropHdl(maViewHandleList, *pSingleSelected, HDL_LWRGT, rSnapRange.getMaximum());
}
+ else
+ {
+ const bool bNoWidth(basegfx::fTools::equalZero(rSnapRange.getWidth()));
+ const bool bNoHeight(basegfx::fTools::equalZero(rSnapRange.getHeight()));
- if(!aRect.IsEmpty() && !bHideHandlesWhenInTextEdit && !bHideHandlesWhenOleActive)
- { // sonst nix gefunden
- if( bSingleTextObjMark )
+ if (bNoWidth && bNoHeight)
{
- const sal_uIntPtr nSiz0=aHdl.GetHdlCount();
- pMarkedObj->AddToHdlList(aHdl);
- const sal_uIntPtr nSiz1=aHdl.GetHdlCount();
- for (sal_uIntPtr i=nSiz0; i<nSiz1; i++)
- {
- SdrHdl* pHdl=aHdl.GetHdl(i);
- pHdl->SetObj(pMarkedObj);
- pHdl->SetPageView(pMarkedPV);
- pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
- }
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_UPLFT, rSnapRange.getMinimum(), true);
}
- else if( eDragMode==SDRDRAG_CROP )
+ else if (!bStdDrag && (bNoWidth || bNoHeight))
{
- aHdl.AddHdl(new SdrCropHdl(aRect.TopLeft() ,HDL_UPLFT));
- aHdl.AddHdl(new SdrCropHdl(aRect.TopCenter() ,HDL_UPPER));
- aHdl.AddHdl(new SdrCropHdl(aRect.TopRight() ,HDL_UPRGT));
- aHdl.AddHdl(new SdrCropHdl(aRect.LeftCenter() ,HDL_LEFT ));
- aHdl.AddHdl(new SdrCropHdl(aRect.RightCenter() ,HDL_RIGHT));
- aHdl.AddHdl(new SdrCropHdl(aRect.BottomLeft() ,HDL_LWLFT));
- aHdl.AddHdl(new SdrCropHdl(aRect.BottomCenter(),HDL_LOWER));
- aHdl.AddHdl(new SdrCropHdl(aRect.BottomRight() ,HDL_LWRGT));
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_UPLFT, rSnapRange.getMinimum(), true);
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_LWRGT, rSnapRange.getMaximum(), true);
}
else
{
- sal_Bool bWdt0=aRect.Left()==aRect.Right();
- sal_Bool bHgt0=aRect.Top()==aRect.Bottom();
- if (bWdt0 && bHgt0)
+ const basegfx::B2DPoint aCenter(rSnapRange.getCenter());
+
+ if(!bNoWidth && !bNoHeight)
+ {
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_UPLFT, rSnapRange.getMinimum(), true);
+ }
+
+ if(!bNoHeight)
+ {
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_UPPER, basegfx::B2DTuple(aCenter.getX(), rSnapRange.getMinY()), true);
+ }
+
+ if(!bNoWidth && !bNoHeight)
+ {
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_UPRGT, basegfx::B2DTuple(rSnapRange.getMaxX(), rSnapRange.getMinY()), true);
+ }
+
+ if(!bNoWidth)
{
- aHdl.AddHdl(new SdrHdl(aRect.TopLeft(),HDL_UPLFT));
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_LEFT, basegfx::B2DTuple(rSnapRange.getMinX(), aCenter.getY()), true);
}
- else if (!bStdDrag && (bWdt0 || bHgt0))
+
+ if(!bNoWidth)
+ {
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_RIGHT, basegfx::B2DTuple(rSnapRange.getMaxX(), aCenter.getY()), true);
+ }
+
+ if(!bNoWidth && !bNoHeight)
{
- aHdl.AddHdl(new SdrHdl(aRect.TopLeft() ,HDL_UPLFT));
- aHdl.AddHdl(new SdrHdl(aRect.BottomRight(),HDL_LWRGT));
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_LWLFT, basegfx::B2DTuple(rSnapRange.getMinX(), rSnapRange.getMaxY()), true);
}
- else
+
+ if(!bNoHeight)
+ {
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_LOWER, basegfx::B2DTuple(aCenter.getX(), rSnapRange.getMaxY()), true);
+ }
+
+ if(!bNoWidth && !bNoHeight)
{
- if (!bWdt0 && !bHgt0) aHdl.AddHdl(new SdrHdl(aRect.TopLeft() ,HDL_UPLFT));
- if ( !bHgt0) aHdl.AddHdl(new SdrHdl(aRect.TopCenter() ,HDL_UPPER));
- if (!bWdt0 && !bHgt0) aHdl.AddHdl(new SdrHdl(aRect.TopRight() ,HDL_UPRGT));
- if (!bWdt0 ) aHdl.AddHdl(new SdrHdl(aRect.LeftCenter() ,HDL_LEFT ));
- if (!bWdt0 ) aHdl.AddHdl(new SdrHdl(aRect.RightCenter() ,HDL_RIGHT));
- if (!bWdt0 && !bHgt0) aHdl.AddHdl(new SdrHdl(aRect.BottomLeft() ,HDL_LWLFT));
- if ( !bHgt0) aHdl.AddHdl(new SdrHdl(aRect.BottomCenter(),HDL_LOWER));
- if (!bWdt0 && !bHgt0) aHdl.AddHdl(new SdrHdl(aRect.BottomRight() ,HDL_LWRGT));
+ new SdrHdl(maViewHandleList, pSingleSelected, HDL_LWRGT, rSnapRange.getMaximum(), true);
}
}
}
}
- else
+ }
+ else
+ {
+ for (sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
{
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++)
+ SdrObject* pObj = aSelection[nMarkNum];
+ const sal_uInt32 nSiz0(maViewHandleList.GetHdlCount());
+ pObj->AddToHdlList(maViewHandleList);
+ const sal_uInt32 nSiz1(maViewHandleList.GetHdlCount());
+ const bool bPoly(pObj->IsPolygonObject());
+ const sdr::selection::Indices aMarkedPoints(bPoly ? getSelectedPointsForSelectedSdrObject(*pObj) : sdr::selection::Indices());
+
+ for(sal_uInt32 i(nSiz0); i < nSiz1; i++)
{
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- const sal_uIntPtr nSiz0=aHdl.GetHdlCount();
- pObj->AddToHdlList(aHdl);
- const sal_uIntPtr nSiz1=aHdl.GetHdlCount();
- bool bPoly=pObj->IsPolyObj();
- const SdrUShortCont* pMrkPnts=pM->GetMarkedPoints();
- for (sal_uIntPtr i=nSiz0; i<nSiz1; i++)
+ SdrHdl* pHdl = maViewHandleList.GetHdlByIndex(i);
+ pHdl->SetObjHdlNum(i - nSiz0);
+
+ if (bPoly)
{
- SdrHdl* pHdl=aHdl.GetHdl(i);
- pHdl->SetObj(pObj);
- pHdl->SetPageView(pPV);
- pHdl->SetObjHdlNum(sal_uInt16(i-nSiz0));
- if (bPoly)
+ const bool bSelected(0 != aMarkedPoints.count(i - nSiz0));
+
+ pHdl->SetSelected(bSelected);
+
+ if(IsPlusHandlesAlwaysVisible() || bSelected)
{
- sal_Bool bSelected=pMrkPnts!=NULL && pMrkPnts->Exist(sal_uInt16(i-nSiz0));
- pHdl->SetSelected(bSelected);
- //sal_Bool bPlus=bPlusHdlAlways;
- if (bPlusHdlAlways || bSelected)
+ const sal_uInt32 nPlusAnz(pObj->GetPlusHdlCount(*pHdl));
+
+ for(sal_uInt32 nPlusNum(0); nPlusNum < nPlusAnz; nPlusNum++)
{
- sal_uInt32 nPlusAnz=pObj->GetPlusHdlCount(*pHdl);
- for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusAnz; nPlusNum++)
- {
- SdrHdl* pPlusHdl=pObj->GetPlusHdl(*pHdl,nPlusNum);
- if (pPlusHdl!=NULL)
- {
- pPlusHdl->SetObj(pObj);
- pPlusHdl->SetPageView(pPV);
- pPlusHdl->SetPlusHdl(sal_True);
- aHdl.AddHdl(pPlusHdl);
- }
- }
+ pObj->GetPlusHdl(maViewHandleList, *pObj, *pHdl, nPlusNum);
}
}
}
- } // for nMarkNum
- } // if bFrmHdl else
+ }
+ }
+ }
- // GluePoint-Handles
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++)
+ // GluePoint-Handles
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
+ {
+ SdrObject* pObj = aSelection[nMarkNum];
+ const sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*pObj));
+
+ if(!aMarkedGluePoints.empty())
{
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- const SdrUShortCont* pMrkGlue=pM->GetMarkedGluePoints();
- if (pMrkGlue!=NULL)
+ const SdrGluePointList* pGPL=pObj->GetGluePointList();
+
+ if(pGPL)
{
- const SdrGluePointList* pGPL=pObj->GetGluePointList();
- if (pGPL!=NULL)
+ const basegfx::B2DRange aObjSnapRange(sdr::legacy::GetSnapRange(*pObj));
+
+ for(sdr::selection::Indices::const_iterator aCurrent(aMarkedGluePoints.begin());
+ aCurrent != aMarkedGluePoints.end(); aCurrent++)
{
- //sal_uInt16 nGlueAnz=pGPL->GetCount();
- sal_uInt16 nAnz=(sal_uInt16)pMrkGlue->GetCount();
- for (sal_uInt16 nNum=0; nNum<nAnz; nNum++)
+ const sal_uInt32 nId(*aCurrent);
+ const sal_uInt32 nNumGP(pGPL->FindGluePoint(nId));
+
+ if(SDRGLUEPOINT_NOTFOUND != nNumGP)
{
- sal_uInt16 nId=pMrkGlue->GetObject(nNum);
- //nNum changed to nNumGP because already used in for loop
- sal_uInt16 nNumGP=pGPL->FindGluePoint(nId);
- if (nNumGP!=SDRGLUEPOINT_NOTFOUND)
- {
- const SdrGluePoint& rGP=(*pGPL)[nNumGP];
- Point aPos(rGP.GetAbsolutePos(*pObj));
- SdrHdl* pGlueHdl=new SdrHdl(aPos,HDL_GLUE);
- pGlueHdl->SetObj(pObj);
- pGlueHdl->SetPageView(pPV);
- pGlueHdl->SetObjHdlNum(nId);
- aHdl.AddHdl(pGlueHdl);
- }
+ const SdrGluePoint& rGP=(*pGPL)[nNumGP];
+ basegfx::B2DPoint aPos(rGP.GetAbsolutePos(aObjSnapRange));
+ SdrHdl* pGlueHdl = new SdrHdl(maViewHandleList, pObj, HDL_GLUE, aPos);
+ pGlueHdl->SetObjHdlNum(nId);
}
}
}
}
+ }
- // Drehpunkt/Spiegelachse
- AddDragModeHdl(eDragMode);
+ // Drehpunkt/Spiegelachse
+ AddDragModeHdl(GetDragMode());
- // add custom handles (used by other apps, e.g. AnchorPos)
- AddCustomHdl();
+ // add custom handles (used by other apps, e.g. AnchorPos)
+ AddCustomHdl();
- // sort handles
- aHdl.Sort();
+ // sort handles
+ maViewHandleList.Sort();
- // #105722# try to restore focus handle index from remembered values
- if(bSaveOldFocus)
+ // #105722# try to restore focus handle index from remembered values
+ if(bSaveOldFocus)
+ {
+ for(sal_uInt32 a(0); a < maViewHandleList.GetHdlCount(); a++)
{
- for(sal_uInt32 a(0); a < aHdl.GetHdlCount(); a++)
- {
- SdrHdl* pCandidate = aHdl.GetHdl(a);
+ SdrHdl* pCandidate = maViewHandleList.GetHdlByIndex(a);
- if(pCandidate->GetObj()
- && pCandidate->GetObj() == pSaveObj
- && pCandidate->GetKind() == eSaveKind
- && pCandidate->GetPolyNum() == nSavePolyNum
- && pCandidate->GetPointNum() == nSavePointNum)
- {
- aHdl.SetFocusHdl(pCandidate);
- break;
- }
+ if(pCandidate->GetObj()
+ && pCandidate->GetObj() == pSaveObj
+ && pCandidate->GetKind() == eSaveKind
+ && pCandidate->GetPolyNum() == nSavePolyNum
+ && pCandidate->GetPointNum() == nSavePointNum)
+ {
+ maViewHandleList.SetFocusHdl(pCandidate);
+ break;
}
}
}
@@ -904,18 +855,16 @@ void SdrMarkView::AddCustomHdl()
void SdrMarkView::SetDragMode(SdrDragMode eMode)
{
- SdrDragMode eMode0=eDragMode;
- eDragMode=eMode;
- if (eDragMode==SDRDRAG_RESIZE) eDragMode=SDRDRAG_MOVE;
- if (eDragMode!=eMode0) {
- //HMHBOOL bVis=IsMarkHdlShown();
- //HMHif (bVis) HideMarkHdl();
+ if(SDRDRAG_RESIZE == eMode)
+ {
+ eMode = SDRDRAG_MOVE;
+ }
+
+ if(GetDragMode() != eMode)
+ {
+ meViewDragMode = eMode;
+
ForceRefToMarked();
- SetMarkHandles();
- //HMHif (bVis) ShowMarkHdl();
- {
- if (AreObjectsMarked()) MarkListHasChanged();
- }
}
}
@@ -926,63 +875,55 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
case SDRDRAG_ROTATE:
{
// add rotation center
- SdrHdl* pHdl = new SdrHdl(aRef1, HDL_REF1);
-
- aHdl.AddHdl(pHdl);
-
+ new SdrHdl(maViewHandleList, 0, HDL_REF1, GetRef1());
break;
}
case SDRDRAG_MIRROR:
{
// add mirror axis
- SdrHdl* pHdl3 = new SdrHdl(aRef2, HDL_REF2);
- SdrHdl* pHdl2 = new SdrHdl(aRef1, HDL_REF1);
- SdrHdl* pHdl1 = new SdrHdlLine(*pHdl2, *pHdl3, HDL_MIRX);
-
- pHdl1->SetObjHdlNum(1); // fuer Sortierung
- pHdl2->SetObjHdlNum(2); // fuer Sortierung
- pHdl3->SetObjHdlNum(3); // fuer Sortierung
+ SdrHdlLine* pHdl1 = new SdrHdlLine(maViewHandleList, HDL_MIRX);
+ SdrHdl* pHdl2 = new SdrHdl(maViewHandleList, 0, HDL_REF1, GetRef1());
+ SdrHdl* pHdl3 = new SdrHdl(maViewHandleList, 0, HDL_REF2, GetRef2());
- aHdl.AddHdl(pHdl1); // Linie als erstes, damit als letztes im HitTest
- aHdl.AddHdl(pHdl2);
- aHdl.AddHdl(pHdl3);
+ pHdl1->SetHandles(pHdl2, pHdl3);
+ pHdl1->SetObjHdlNum(1);
+ pHdl2->SetObjHdlNum(2);
+ pHdl3->SetObjHdlNum(3);
break;
}
case SDRDRAG_TRANSPARENCE:
{
// add interactive transparence handle
- sal_uIntPtr nMarkAnz = GetMarkedObjectCount();
- if(nMarkAnz == 1)
+ SdrObject* pSingleSelected = getSelectedIfSingle();
+
+ if(pSingleSelected)
{
- SdrObject* pObj = GetMarkedObjectByIndex(0);
- SdrModel* pModel = GetModel();
- const SfxItemSet& rSet = pObj->GetMergedItemSet();
+ const SfxItemSet& rSet = pSingleSelected->GetMergedItemSet();
- if(SFX_ITEM_SET != rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, sal_False))
+ if(SFX_ITEM_SET != rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, false))
{
// add this item, it's not yet there
XFillFloatTransparenceItem aNewItem(
(const XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE));
XGradient aGrad = aNewItem.GetGradientValue();
- aNewItem.SetEnabled(sal_True);
+ aNewItem.SetEnabled(true);
aGrad.SetStartIntens(100);
aGrad.SetEndIntens(100);
aNewItem.SetGradientValue(aGrad);
// add undo to allow user to take back this step
- if( pModel->IsUndoEnabled() )
+ if( getSdrModelFromSdrView().IsUndoEnabled() )
{
- pModel->BegUndo(SVX_RESSTR(SIP_XA_FILLTRANSPARENCE));
- pModel->AddUndo(pModel->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
- pModel->EndUndo();
+ getSdrModelFromSdrView().BegUndo(SVX_RESSTR(SIP_XA_FILLTRANSPARENCE));
+ getSdrModelFromSdrView().AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pSingleSelected));
+ getSdrModelFromSdrView().EndUndo();
}
- //pObj->SetItemAndBroadcast(aNewItem);
- SfxItemSet aNewSet(pModel->GetItemPool());
+ SfxItemSet aNewSet(pSingleSelected->GetObjectItemPool());
aNewSet.Put(aNewItem);
- pObj->SetMergedItemSetAndBroadcast(aNewSet);
+ pSingleSelected->SetMergedItemSetAndBroadcast(aNewSet);
}
// set values and transform to vector set
@@ -991,37 +932,27 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
GradTransGradient aGradTransGradient;
aGradTransGradient.aGradient = ((XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE)).GetGradientValue();
- aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, pObj);
+ aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, pSingleSelected);
// build handles
- const Point aTmpPos1(basegfx::fround(aGradTransVector.maPositionA.getX()), basegfx::fround(aGradTransVector.maPositionA.getY()));
- const Point aTmpPos2(basegfx::fround(aGradTransVector.maPositionB.getX()), basegfx::fround(aGradTransVector.maPositionB.getY()));
- SdrHdlColor* pColHdl1 = new SdrHdlColor(aTmpPos1, aGradTransVector.aCol1, SDR_HANDLE_COLOR_SIZE_NORMAL, sal_True);
- SdrHdlColor* pColHdl2 = new SdrHdlColor(aTmpPos2, aGradTransVector.aCol2, SDR_HANDLE_COLOR_SIZE_NORMAL, sal_True);
- SdrHdlGradient* pGradHdl = new SdrHdlGradient(aTmpPos1, aTmpPos2, sal_False);
- DBG_ASSERT(pColHdl1 && pColHdl2 && pGradHdl, "Got not all necessary handles!!");
+ SdrHdlColor* pColHdl1 = new SdrHdlColor(maViewHandleList, *pSingleSelected, aGradTransVector.maPositionA, aGradTransVector.aCol1, SDR_HANDLE_COLOR_SIZE_NORMAL, true);
+ SdrHdlColor* pColHdl2 = new SdrHdlColor(maViewHandleList, *pSingleSelected, aGradTransVector.maPositionB, aGradTransVector.aCol2, SDR_HANDLE_COLOR_SIZE_NORMAL, true);
+ SdrHdlGradient* pGradHdl = new SdrHdlGradient(maViewHandleList, *pSingleSelected, *pColHdl1, *pColHdl2, false);
// link them
- pGradHdl->SetColorHandles(pColHdl1, pColHdl2);
- pGradHdl->SetObj(pObj);
pColHdl1->SetColorChangeHdl(LINK(pGradHdl, SdrHdlGradient, ColorChangeHdl));
pColHdl2->SetColorChangeHdl(LINK(pGradHdl, SdrHdlGradient, ColorChangeHdl));
-
- // insert them
- aHdl.AddHdl(pColHdl1);
- aHdl.AddHdl(pColHdl2);
- aHdl.AddHdl(pGradHdl);
}
break;
}
case SDRDRAG_GRADIENT:
{
// add interactive gradient handle
- sal_uIntPtr nMarkAnz = GetMarkedObjectCount();
- if(nMarkAnz == 1)
+ SdrObject* pSingleSelected = getSelectedIfSingle();
+
+ if(pSingleSelected)
{
- SdrObject* pObj = GetMarkedObjectByIndex(0);
- const SfxItemSet& rSet = pObj->GetMergedItemSet();
+ const SfxItemSet& rSet = pSingleSelected->GetMergedItemSet();
XFillStyle eFillStyle = ((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue();
if(eFillStyle == XFILL_GRADIENT)
@@ -1033,26 +964,16 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
Size aHdlSize(15, 15);
aGradTransGradient.aGradient = ((XFillGradientItem&)rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue();
- aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, pObj);
+ aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, pSingleSelected);
// build handles
- const Point aTmpPos1(basegfx::fround(aGradTransVector.maPositionA.getX()), basegfx::fround(aGradTransVector.maPositionA.getY()));
- const Point aTmpPos2(basegfx::fround(aGradTransVector.maPositionB.getX()), basegfx::fround(aGradTransVector.maPositionB.getY()));
- SdrHdlColor* pColHdl1 = new SdrHdlColor(aTmpPos1, aGradTransVector.aCol1, aHdlSize, sal_False);
- SdrHdlColor* pColHdl2 = new SdrHdlColor(aTmpPos2, aGradTransVector.aCol2, aHdlSize, sal_False);
- SdrHdlGradient* pGradHdl = new SdrHdlGradient(aTmpPos1, aTmpPos2, sal_True);
- DBG_ASSERT(pColHdl1 && pColHdl2 && pGradHdl, "Got not all necessary handles!!");
+ SdrHdlColor* pColHdl1 = new SdrHdlColor(maViewHandleList, *pSingleSelected, aGradTransVector.maPositionA, aGradTransVector.aCol1, aHdlSize, false);
+ SdrHdlColor* pColHdl2 = new SdrHdlColor(maViewHandleList, *pSingleSelected, aGradTransVector.maPositionB, aGradTransVector.aCol2, aHdlSize, false);
+ SdrHdlGradient* pGradHdl = new SdrHdlGradient(maViewHandleList, *pSingleSelected, *pColHdl1, *pColHdl2, true);
// link them
- pGradHdl->SetColorHandles(pColHdl1, pColHdl2);
- pGradHdl->SetObj(pObj);
pColHdl1->SetColorChangeHdl(LINK(pGradHdl, SdrHdlGradient, ColorChangeHdl));
pColHdl2->SetColorChangeHdl(LINK(pGradHdl, SdrHdlGradient, ColorChangeHdl));
-
- // insert them
- aHdl.AddHdl(pColHdl1);
- aHdl.AddHdl(pColHdl2);
- aHdl.AddHdl(pGradHdl);
}
}
break;
@@ -1066,118 +987,152 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
}
}
-/** handle mouse over effects for handles */
-sal_Bool SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
+bool SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
{
- if(aHdl.GetHdlCount())
+ if(maViewHandleList.GetHdlCount())
{
- SdrHdl* pMouseOverHdl = 0;
+ SdrHdl* pMouseOverHdl(0);
+
if( !rMEvt.IsLeaveWindow() && pWin )
{
- Point aMDPos( pWin->PixelToLogic( rMEvt.GetPosPixel() ) );
- pMouseOverHdl = PickHandle(aMDPos);
+ const basegfx::B2DPoint aPosLogic(pWin->GetInverseViewTransformation() *
+ basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+
+ pMouseOverHdl = PickHandle(aPosLogic);
}
// notify last mouse over handle that he lost the mouse
- const sal_uIntPtr nHdlCount = aHdl.GetHdlCount();
+ const sal_uInt32 nHdlCount(maViewHandleList.GetHdlCount());
- for(sal_uIntPtr nHdl = 0; nHdl < nHdlCount; nHdl++ )
+ for(sal_uInt32 nHdl(0); nHdl < nHdlCount; nHdl++)
{
- SdrHdl* pCurrentHdl = GetHdl(nHdl);
- if( pCurrentHdl->mbMouseOver )
+ SdrHdl* pCurrentHdl = GetHdlByIndex(nHdl);
+
+ if(pCurrentHdl->isMouseOver())
{
if( pCurrentHdl != pMouseOverHdl )
{
- pCurrentHdl->mbMouseOver = false;
+ pCurrentHdl->setMouseOver(false);
pCurrentHdl->onMouseLeave();
}
+
break;
}
}
// notify current mouse over handle
- if( pMouseOverHdl /* && !pMouseOverHdl->mbMouseOver */ )
+ if(pMouseOverHdl)
{
- pMouseOverHdl->mbMouseOver = true;
+ pMouseOverHdl->setMouseOver(true);
pMouseOverHdl->onMouseEnter(rMEvt);
}
}
+
return SdrSnapView::MouseMove(rMEvt, pWin);
}
void SdrMarkView::ForceRefToMarked()
{
- switch(eDragMode)
+ switch(GetDragMode())
{
case SDRDRAG_ROTATE:
{
- Rectangle aR(GetMarkedObjRect());
- aRef1 = aR.Center();
-
+ const basegfx::B2DRange aSnapRange(getMarkedObjectSnapRange());
+ maRef1 = aSnapRange.getCenter();
break;
}
case SDRDRAG_MIRROR:
{
// Erstmal die laenge der Spiegelachsenlinie berechnen
- long nOutMin=0;
- long nOutMax=0;
- long nMinLen=0;
- long nObjDst=0;
- long nOutHgt=0;
+ sal_Int32 nOutMin(0);
+ sal_Int32 nOutMax(0);
+ sal_Int32 nMinLen(0);
+ sal_Int32 nObjDst(0);
+ sal_Int32 nOutHgt(0);
OutputDevice* pOut=GetFirstOutputDevice();
- //OutputDevice* pOut=GetWin(0);
- if (pOut!=NULL) {
+
+ if(pOut)
+ {
// Mindestlaenge 50 Pixel
nMinLen=pOut->PixelToLogic(Size(0,50)).Height();
+
// 20 Pixel fuer RefPt-Abstand vom Obj
nObjDst=pOut->PixelToLogic(Size(0,20)).Height();
+
// MinY/MaxY
// Abstand zum Rand = Mindestlaenge = 10 Pixel
- long nDst=pOut->PixelToLogic(Size(0,10)).Height();
+ const sal_Int32 nDst(pOut->PixelToLogic(Size(0,10)).Height());
+
nOutMin=-pOut->GetMapMode().GetOrigin().Y();
nOutMax=pOut->GetOutputSize().Height()-1+nOutMin;
nOutMin+=nDst;
nOutMax-=nDst;
+
// Absolute Mindestlaenge jedoch 10 Pixel
- if (nOutMax-nOutMin<nDst) {
+ if(nOutMax - nOutMin < nDst)
+ {
nOutMin+=nOutMax+1;
nOutMin/=2;
nOutMin-=(nDst+1)/2;
nOutMax=nOutMin+nDst;
}
+
nOutHgt=nOutMax-nOutMin;
+
// Sonst Mindestlaenge = 1/4 OutHgt
- long nTemp=nOutHgt/4;
- if (nTemp>nMinLen) nMinLen=nTemp;
+ const sal_Int32 nTemp(nOutHgt / 4);
+
+ if(nTemp > nMinLen)
+ {
+ nMinLen = nTemp;
+ }
}
- Rectangle aR(GetMarkedObjBoundRect());
- Point aCenter(aR.Center());
- long nMarkHgt=aR.GetHeight()-1;
- long nHgt=nMarkHgt+nObjDst*2; // 20 Pixel obej und unten ueberstehend
- if (nHgt<nMinLen) nHgt=nMinLen; // Mindestlaenge 50 Pixel bzw. 1/4 OutHgt
+ const Rectangle aR(sdr::legacy::GetAllObjBoundRect(getSelectedSdrObjectVectorFromSdrMarkView()));
+ const Point aCenter(aR.Center());
+ const sal_Int32 nMarkHgt(aR.GetHeight() - 1);
+ sal_Int32 nHgt(nMarkHgt + nObjDst * 2); // 20 Pixel obej und unten ueberstehend
- long nY1=aCenter.Y()-(nHgt+1)/2;
- long nY2=nY1+nHgt;
+ if(nHgt < nMinLen)
+ {
+ nHgt = nMinLen; // Mindestlaenge 50 Pixel bzw. 1/4 OutHgt
+ }
- if (pOut!=NULL && nMinLen>nOutHgt) nMinLen=nOutHgt; // evtl. noch etwas verkuerzen
+ sal_Int32 nY1(aCenter.Y() - (nHgt + 1) / 2);
+ sal_Int32 nY2(nY1 + nHgt);
- if (pOut!=NULL) { // nun vollstaendig in den sichtbaren Bereich schieben
- if (nY1<nOutMin) {
+ if(pOut && nMinLen > nOutHgt)
+ {
+ nMinLen = nOutHgt; // evtl. noch etwas verkuerzen
+ }
+
+ if(pOut)
+ {
+ // nun vollstaendig in den sichtbaren Bereich schieben
+ if(nY1 < nOutMin)
+ {
nY1=nOutMin;
- if (nY2<nY1+nMinLen) nY2=nY1+nMinLen;
+
+ if(nY2 < nY1 + nMinLen)
+ {
+ nY2 = nY1 + nMinLen;
+ }
}
- if (nY2>nOutMax) {
+
+ if(nY2 > nOutMax)
+ {
nY2=nOutMax;
- if (nY1>nY2-nMinLen) nY1=nY2-nMinLen;
+
+ if(nY1 > nY2 - nMinLen)
+ {
+ nY1 = nY2 - nMinLen;
+ }
}
}
- aRef1.X()=aCenter.X();
- aRef1.Y()=nY1;
- aRef2.X()=aCenter.X();
- aRef2.Y()=nY2;
+ maRef1 = basegfx::B2DPoint(aCenter.X(), nY1);
+ maRef2 = basegfx::B2DPoint(aCenter.X(), nY2);
break;
}
@@ -1186,295 +1141,275 @@ void SdrMarkView::ForceRefToMarked()
case SDRDRAG_GRADIENT:
case SDRDRAG_CROP:
{
- Rectangle aRect(GetMarkedObjBoundRect());
- aRef1 = aRect.TopLeft();
- aRef2 = aRect.BottomRight();
+ const basegfx::B2DRange aBoundRange(sdr::legacy::GetAllObjBoundRange(getSelectedSdrObjectVectorFromSdrMarkView()));
+ maRef1 = aBoundRange.getMinimum();
+ maRef2 = aBoundRange.getMaximum();
break;
}
default: break;
}
+
+ // force recreation of SdrHdls TTTT needed?
+ SetMarkHandles();
}
-void SdrMarkView::SetRef1(const Point& rPt)
+void SdrMarkView::SetRef1(const basegfx::B2DPoint& rPt)
{
- if(eDragMode == SDRDRAG_ROTATE || eDragMode == SDRDRAG_MIRROR)
+ if(SDRDRAG_ROTATE == GetDragMode() || SDRDRAG_MIRROR == GetDragMode())
{
- aRef1 = rPt;
- SdrHdl* pH = aHdl.GetHdl(HDL_REF1);
+ maRef1 = rPt;
+ SdrHdl* pH = maViewHandleList.GetHdlByKind(HDL_REF1);
+
if(pH)
- pH->SetPos(rPt);
- //HMHShowMarkHdl();
+ {
+ pH->setPosition(rPt);
+ }
}
}
-void SdrMarkView::SetRef2(const Point& rPt)
+void SdrMarkView::SetRef2(const basegfx::B2DPoint& rPt)
{
- if(eDragMode == SDRDRAG_MIRROR)
+ if(SDRDRAG_MIRROR == GetDragMode())
{
- aRef2 = rPt;
- SdrHdl* pH = aHdl.GetHdl(HDL_REF2);
+ maRef2 = rPt;
+ SdrHdl* pH = maViewHandleList.GetHdlByKind(HDL_REF2);
+
if(pH)
- pH->SetPos(rPt);
- //HMHShowMarkHdl();
+ {
+ pH->setPosition(rPt);
+ }
}
}
-void SdrMarkView::CheckMarked()
+void SdrMarkView::SetFrameHandles(bool bOn)
{
- for (sal_uIntPtr nm=GetMarkedObjectCount(); nm>0;) {
- nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- SdrLayerID nLay=pObj->GetLayer();
- sal_Bool bRaus=!pObj->IsInserted(); // Obj geloescht?
- if (!pObj->Is3DObj()) {
- bRaus=bRaus || pObj->GetPage()!=pPV->GetPage(); // Obj ploetzlich in anderer Page oder Group
- }
- bRaus=bRaus || pPV->GetLockedLayers().IsSet(nLay) || // Layer gesperrt?
- !pPV->GetVisibleLayers().IsSet(nLay); // Layer nicht sichtbar?
-
- if( !bRaus )
- bRaus = !pObj->IsVisible(); // not visible objects can not be marked
-
- if (!bRaus) {
- // Joe am 9.3.1997: Gruppierte Objekten koennen nun auch
- // markiert werden. Nach EnterGroup muessen aber die Objekte
- // der hoeheren Ebene deselektiert werden.
- const SdrObjList* pOOL=pObj->GetObjList();
- const SdrObjList* pVOL=pPV->GetObjList();
- while (pOOL!=NULL && pOOL!=pVOL) {
- pOOL=pOOL->GetUpList();
- }
- bRaus=pOOL!=pVOL;
- }
+ if(bOn != IsFrameHandles())
+ {
+ const bool bOld(ImpIsFrameHandles());
+ mbForceFrameHandles = bOn;
+ const bool bNew(ImpIsFrameHandles());
- if (bRaus)
- {
- GetMarkedObjectListWriteAccess().DeleteMark(nm);
- }
- else
+ if(bNew != bOld)
{
- if (!IsGluePointEditMode()) { // Markierte GluePoints nur im GlueEditMode
- SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- if (pPts!=NULL && pPts->GetCount()!=0) {
- pPts->Clear();
- }
- }
+ // force recreation of SdrHdls
+ SetMarkHandles();
}
}
-
- // #97995# at least reset the remembered BoundRect to prevent handle
- // generation if bForceFrameHandles is TRUE.
- bMarkedObjRectDirty = sal_True;
}
-void SdrMarkView::SetMarkRects()
+void SdrMarkView::SetViewEditMode(SdrViewEditMode eMode)
{
- SdrPageView* pPV = GetSdrPageView();
-
- if(pPV)
+ if(eMode != GetViewEditMode())
{
- pPV->SetHasMarkedObj(GetSnapRectFromMarkedObjects(pPV, pPV->MarkSnap()));
- GetBoundRectFromMarkedObjects(pPV, pPV->MarkBound());
- }
-}
+ bool bGlue0(SDREDITMODE_GLUEPOINTEDIT == GetViewEditMode());
+ bool bEdge0(((SdrCreateView*)this)->IsEdgeTool());
-void SdrMarkView::SetFrameHandles(sal_Bool bOn)
-{
- if (bOn!=bForceFrameHandles) {
- sal_Bool bOld=ImpIsFrameHandles();
- bForceFrameHandles=bOn;
- sal_Bool bNew=ImpIsFrameHandles();
- if (bNew!=bOld) {
- AdjustMarkHdl(); //HMHTRUE);
- MarkListHasChanged();
+ meViewEditMode = eMode;
+
+ bool bGlue1(SDREDITMODE_GLUEPOINTEDIT == GetViewEditMode());
+ bool bEdge1(((SdrCreateView*)this)->IsEdgeTool());
+
+ // etwas Aufwand um Flackern zu verhindern beim Umschalten
+ // zwischen GlueEdit und EdgeTool
+ if(bGlue1 && !bGlue0)
+ {
+ ImpSetGlueVisible2(bGlue1);
+ }
+
+ if(bEdge1 != bEdge0)
+ {
+ ImpSetGlueVisible3(bEdge1);
+ }
+
+ if(!bGlue1 && bGlue0)
+ {
+ ImpSetGlueVisible2(bGlue1);
+ }
+
+ if(bGlue0 && !bGlue1)
+ {
+ MarkGluePoints(0, true);
}
}
}
-void SdrMarkView::SetEditMode(SdrViewEditMode eMode)
+bool SdrMarkView::IsObjMarkable(const SdrObject& rObj) const
{
- if (eMode!=eEditMode) {
- sal_Bool bGlue0=eEditMode==SDREDITMODE_GLUEPOINTEDIT;
- sal_Bool bEdge0=((SdrCreateView*)this)->IsEdgeTool();
- eEditMode0=eEditMode;
- eEditMode=eMode;
- sal_Bool bGlue1=eEditMode==SDREDITMODE_GLUEPOINTEDIT;
- sal_Bool bEdge1=((SdrCreateView*)this)->IsEdgeTool();
- // etwas Aufwand um Flackern zu verhindern beim Umschalten
- // zwischen GlueEdit und EdgeTool
- if (bGlue1 && !bGlue0) ImpSetGlueVisible2(bGlue1);
- if (bEdge1!=bEdge0) ImpSetGlueVisible3(bEdge1);
- if (!bGlue1 && bGlue0) ImpSetGlueVisible2(bGlue1);
- if (bGlue0 && !bGlue1) UnmarkAllGluePoints();
+ if(rObj.IsMarkProtect() || (!IsDesignMode() && rObj.IsSdrUnoObj()))
+ {
+ // Objekt nicht selektierbar oder
+ // SdrUnoObj nicht im DesignMode
+ return false;
}
-}
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ return GetSdrPageView() ? GetSdrPageView()->IsObjMarkable(rObj) : true;
+}
-sal_Bool SdrMarkView::IsObjMarkable(SdrObject* pObj, SdrPageView* pPV) const
+bool SdrMarkView::IsMarkedObjHit(const basegfx::B2DPoint& rPnt, double fTol) const
{
- if (pObj)
+ bool bRet(false);
+
+ if(areSdrObjectsSelected())
{
- if (pObj->IsMarkProtect() ||
- (!bDesignMode && pObj->IsUnoObj()))
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nm(0); nm < aSelection.size() && !bRet; nm++)
{
- // Objekt nicht selektierbar oder
- // SdrUnoObj nicht im DesignMode
- return sal_False;
+ bRet = CheckSingleSdrObjectHit(rPnt, fTol, aSelection[nm], 0, 0);
}
}
- return pPV!=NULL ? pPV->IsObjMarkable(pObj) : sal_True;
-}
-sal_Bool SdrMarkView::IsMarkedObjHit(const Point& rPnt, short nTol) const
-{
- sal_Bool bRet=sal_False;
- nTol=ImpGetHitTolLogic(nTol,NULL);
- Point aPt(rPnt);
- for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount() && !bRet; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- bRet = 0 != CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0);
- }
return bRet;
}
-SdrHdl* SdrMarkView::PickHandle(const Point& rPnt, sal_uIntPtr nOptions, SdrHdl* pHdl0) const
+SdrHdl* SdrMarkView::PickHandle(const basegfx::B2DPoint& rPnt, sal_uInt32 nOptions, SdrHdl* pHdl0) const
{
- if (bSomeObjChgdFlag) { // ggf. Handles neu berechnen lassen!
- FlushComeBackTimer();
- }
- sal_Bool bBack=(nOptions & SDRSEARCH_BACKWARD) !=0;
- sal_Bool bNext=(nOptions & SDRSEARCH_NEXT) !=0;
- Point aPt(rPnt);
- return aHdl.IsHdlListHit(aPt,bBack,bNext,pHdl0);
+ return maViewHandleList.IsHdlListHit(rPnt, pHdl0);
}
-sal_Bool SdrMarkView::MarkObj(const Point& rPnt, short nTol, sal_Bool bToggle, sal_Bool bDeep)
+bool SdrMarkView::MarkObj(const basegfx::B2DPoint& rPnt, double fTol, bool bToggle, bool bDeep)
{
SdrObject* pObj;
- SdrPageView* pPV;
- nTol=ImpGetHitTolLogic(nTol,NULL);
- sal_uIntPtr nOptions=SDRSEARCH_PICKMARKABLE;
- if (bDeep) nOptions=nOptions|SDRSEARCH_DEEP;
- sal_Bool bRet=PickObj(rPnt,(sal_uInt16)nTol,pObj,pPV,nOptions);
- if (bRet) {
- sal_Bool bUnmark=bToggle && IsObjMarked(pObj);
- MarkObj(pObj,pPV,bUnmark);
+ sal_uInt32 nOptions(SDRSEARCH_PICKMARKABLE);
+
+ if(bDeep)
+ {
+ nOptions = nOptions|SDRSEARCH_DEEP;
}
+
+ bool bRet(PickObj(rPnt, fTol, pObj, nOptions));
+
+ if(bRet)
+ {
+ bool bUnmark = bToggle && IsObjMarked(*pObj);
+
+ MarkObj(*pObj, bUnmark);
+ }
+
return bRet;
}
-sal_Bool SdrMarkView::MarkNextObj(sal_Bool bPrev)
+bool SdrMarkView::MarkNextObj(bool bPrev)
{
SdrPageView* pPageView = GetSdrPageView();
- if(!pPageView)
+ if(pPageView)
{
- return sal_False;
- }
+ SdrObject* pChangeSdrObject(0); // Nummer des zu ersetzenden MarkEntries
+ sal_uInt32 nSearchObjNum(bPrev ? 0 : SAL_MAX_UINT32);
- SortMarkedObjects();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_uIntPtr nChgMarkNum = ULONG_MAX; // Nummer des zu ersetzenden MarkEntries
- sal_uIntPtr nSearchObjNum = bPrev ? 0 : ULONG_MAX;
- if (nMarkAnz!=0) {
- nChgMarkNum=bPrev ? 0 : sal_uIntPtr(nMarkAnz-1);
- SdrMark* pM=GetSdrMarkByIndex(nChgMarkNum);
- OSL_ASSERT(pM!=NULL);
- if (pM->GetMarkedSdrObj() != NULL)
- nSearchObjNum = pM->GetMarkedSdrObj()->GetNavigationPosition();
- }
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ pChangeSdrObject = aSelection[bPrev ? 0 : aSelection.size() - 1];
+ nSearchObjNum = pChangeSdrObject->GetNavigationPosition();
+ }
+
+ SdrObject* pMarkObj = 0;
+ const SdrObjList* pSearchObjList = pPageView->GetCurrentObjectList();
+ const sal_uInt32 nObjAnz(pSearchObjList->GetObjCount());
- SdrObject* pMarkObj=NULL;
- SdrObjList* pSearchObjList=pPageView->GetObjList();
- sal_uIntPtr nObjAnz=pSearchObjList->GetObjCount();
- if (nObjAnz!=0) {
- if (nSearchObjNum>nObjAnz) nSearchObjNum=nObjAnz;
- while (pMarkObj==NULL && ((!bPrev && nSearchObjNum>0) || (bPrev && nSearchObjNum<nObjAnz)))
+ if(nObjAnz)
{
- if (!bPrev)
- nSearchObjNum--;
- SdrObject* pSearchObj = pSearchObjList->GetObjectForNavigationPosition(nSearchObjNum);
- if (IsObjMarkable(pSearchObj,pPageView))
+ if(nSearchObjNum > nObjAnz)
{
- if (TryToFindMarkedObject(pSearchObj)==CONTAINER_ENTRY_NOTFOUND)
+ nSearchObjNum = nObjAnz;
+ }
+
+ while(!pMarkObj && ((!bPrev && nSearchObjNum > 0) || (bPrev && nSearchObjNum < nObjAnz)))
+ {
+ if (!bPrev)
+ {
+ nSearchObjNum--;
+ }
+
+ SdrObject* pSearchObj = pSearchObjList->GetObj(nSearchObjNum);
+
+ if(IsObjMarkable(*pSearchObj))
{
- pMarkObj=pSearchObj;
+ if(!isSdrObjectSelected(*pSearchObj))
+ {
+ pMarkObj=pSearchObj;
+ }
+ }
+
+ if(bPrev)
+ {
+ nSearchObjNum++;
}
}
- if (bPrev) nSearchObjNum++;
}
- }
- if(!pMarkObj)
- {
- return sal_False;
- }
+ if(!pMarkObj)
+ {
+ return false;
+ }
- if (nChgMarkNum!=ULONG_MAX)
- {
- GetMarkedObjectListWriteAccess().DeleteMark(nChgMarkNum);
+ if(pChangeSdrObject)
+ {
+ removeSdrObjectFromSelection(*pChangeSdrObject);
+ }
+
+ MarkObj(*pMarkObj);
+ return true;
}
- MarkObj(pMarkObj,pPageView); // ruft auch MarkListHasChanged(), AdjustMarkHdl()
- return sal_True;
+
+ return false;
}
-sal_Bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, sal_Bool bPrev)
+bool SdrMarkView::MarkNextObj(const basegfx::B2DPoint& rPnt, double fTol, bool bPrev)
{
- SortMarkedObjects();
- nTol=ImpGetHitTolLogic(nTol,NULL);
- Point aPt(rPnt);
- SdrMark* pTopMarkHit=NULL;
- SdrMark* pBtmMarkHit=NULL;
- sal_uIntPtr nTopMarkHit=0;
- sal_uIntPtr nBtmMarkHit=0;
+ SdrObject* pTopMarkHit = 0;
+ SdrObject* pBtmMarkHit = 0;
+
// oberstes der markierten Objekte suchen, das von rPnt getroffen wird
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_uIntPtr nm=0;
- for (nm=nMarkAnz; nm>0 && pTopMarkHit==NULL;) {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt32 nm(0);
+
+ for(nm = aSelection.size(); nm > 0 && !pTopMarkHit;)
+ {
nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- if(CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pM->GetPageView(),0,0))
+
+ if(CheckSingleSdrObjectHit(rPnt, fTol, aSelection[nm], 0, 0))
{
- pTopMarkHit=pM;
- nTopMarkHit=nm;
+ pTopMarkHit = aSelection[nm];
}
}
+
// Nichts gefunden, dann ganz normal ein Obj markieren.
- if (pTopMarkHit==NULL) return MarkObj(rPnt,sal_uInt16(nTol),sal_False);
+ if(!pTopMarkHit)
+ {
+ return MarkObj(rPnt, fTol, false);
+ }
+
+ SdrObjList* pObjList = pTopMarkHit->getParentOfSdrObject();
- SdrObject* pTopObjHit=pTopMarkHit->GetMarkedSdrObj();
- SdrObjList* pObjList=pTopObjHit->GetObjList();
- SdrPageView* pPV=pTopMarkHit->GetPageView();
// unterstes der markierten Objekte suchen, das von rPnt getroffen wird
- // und auf der gleichen PageView liegt wie pTopMarkHit
- for (nm=0; nm<nMarkAnz && pBtmMarkHit==NULL; nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrPageView* pPV2=pM->GetPageView();
- if (pPV2==pPV && CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pM->GetMarkedSdrObj(),pPV2,0,0))
+ for(nm = 0; nm < aSelection.size() && !pBtmMarkHit; nm++)
+ {
+ if(CheckSingleSdrObjectHit(rPnt, fTol, aSelection[nm], 0, 0))
{
- pBtmMarkHit=pM;
- nBtmMarkHit=nm;
+ pBtmMarkHit = aSelection[nm];
}
}
- if (pBtmMarkHit==NULL) { pBtmMarkHit=pTopMarkHit; nBtmMarkHit=nTopMarkHit; }
- SdrObject* pBtmObjHit=pBtmMarkHit->GetMarkedSdrObj();
- sal_uIntPtr nObjAnz=pObjList->GetObjCount();
- // #110988#
- //sal_uIntPtr nSearchBeg=bPrev ? pBtmObjHit->GetOrdNum()+1 : pTopObjHit->GetOrdNum();
+ if(!pBtmMarkHit)
+ {
+ pBtmMarkHit = pTopMarkHit;
+ }
+
+ const sal_uInt32 nObjAnz(pObjList->GetObjCount());
sal_uInt32 nSearchBeg;
- E3dScene* pScene = NULL;
- SdrObject* pObjHit = (bPrev) ? pBtmObjHit : pTopObjHit;
- sal_Bool bRemap = pObjHit->ISA(E3dCompoundObject)
- ? ((E3dCompoundObject*)pObjHit)->IsAOrdNumRemapCandidate(pScene)
- : sal_False;
+ E3dScene* pScene = 0;
+ E3dCompoundObject* pObjHit = dynamic_cast< E3dCompoundObject* >(bPrev ? pBtmMarkHit : pTopMarkHit);
+ bool bRemap(pObjHit
+ ? pObjHit->IsAOrdNumRemapCandidate(pScene)
+ : false);
if(bPrev)
{
- sal_uInt32 nOrdNumBtm(pBtmObjHit->GetOrdNum());
+ sal_uInt32 nOrdNumBtm(pBtmMarkHit->GetNavigationPosition());
if(bRemap)
{
@@ -1485,7 +1420,7 @@ sal_Bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, sal_Bool bPrev)
}
else
{
- sal_uInt32 nOrdNumTop(pTopObjHit->GetOrdNum());
+ sal_uInt32 nOrdNumTop(pTopMarkHit->GetNavigationPosition());
if(bRemap)
{
@@ -1495,11 +1430,16 @@ sal_Bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, sal_Bool bPrev)
nSearchBeg = nOrdNumTop;
}
- sal_uIntPtr no=nSearchBeg;
- SdrObject* pFndObj=NULL;
- //SdrObject* pAktObj=NULL;
- while (pFndObj==NULL && ((!bPrev && no>0) || (bPrev && no<nObjAnz))) {
- if (!bPrev) no--;
+ sal_uInt32 no(nSearchBeg);
+ SdrObject* pFndObj = 0;
+
+ while(!pFndObj && ((!bPrev && no > 0) || (bPrev && no < nObjAnz)))
+ {
+ if(!bPrev)
+ {
+ no--;
+ }
+
SdrObject* pObj;
if(bRemap)
@@ -1511,30 +1451,37 @@ sal_Bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, sal_Bool bPrev)
pObj = pObjList->GetObj(no);
}
- if (CheckSingleSdrObjectHit(aPt,sal_uInt16(nTol),pObj,pPV,SDRSEARCH_TESTMARKABLE,0))
+ if(CheckSingleSdrObjectHit(rPnt, fTol, pObj, SDRSEARCH_TESTMARKABLE, 0))
{
- if (TryToFindMarkedObject(pObj)==CONTAINER_ENTRY_NOTFOUND) {
+ if(!isSdrObjectSelected(*pObj))
+ {
pFndObj=pObj;
- } else {
+ }
+ else
+ {
// hier wg. Performance ggf. noch no auf Top bzw. auf Btm stellen
}
}
- if (bPrev) no++;
+
+ if(bPrev)
+ {
+ no++;
+ }
}
- if (pFndObj!=NULL)
+
+ if(pFndObj)
{
- GetMarkedObjectListWriteAccess().DeleteMark(bPrev?nBtmMarkHit:nTopMarkHit);
- GetMarkedObjectListWriteAccess().InsertEntry(SdrMark(pFndObj,pPV));
- MarkListHasChanged();
- AdjustMarkHdl(); //HMHTRUE);
+ removeSdrObjectFromSelection(bPrev ? *pBtmMarkHit : *pTopMarkHit);
+ addSdrObjectToSelection(*pFndObj);
}
- return pFndObj!=NULL;
+
+ return (0 != pFndObj);
}
-sal_Bool SdrMarkView::MarkObj(const Rectangle& rRect, sal_Bool bUnmark)
+bool SdrMarkView::MarkObj(const basegfx::B2DRange& rRange, bool bUnmark)
{
- sal_Bool bFnd=sal_False;
- Rectangle aR(rRect);
+ bool bFnd(false);
+ const basegfx::B2DRange aR(rRange);
SdrObject* pObj;
SdrObjList* pObjList;
BrkAction();
@@ -1542,86 +1489,74 @@ sal_Bool SdrMarkView::MarkObj(const Rectangle& rRect, sal_Bool bUnmark)
if(pPV)
{
- pObjList=pPV->GetObjList();
- Rectangle aFrm1(aR);
- sal_uIntPtr nObjAnz=pObjList->GetObjCount();
- for (sal_uIntPtr nO=0; nO<nObjAnz; nO++) {
+ pObjList = pPV->GetCurrentObjectList();
+ basegfx::B2DRange aFrm1(aR);
+ const sal_uInt32 nObjAnz(pObjList->GetObjCount());
+
+ for(sal_uInt32 nO(0); nO < nObjAnz; nO++)
+ {
pObj=pObjList->GetObj(nO);
- Rectangle aRect(pObj->GetCurrentBoundRect());
- if (aFrm1.IsInside(aRect)) {
- if (!bUnmark) {
- if (IsObjMarkable(pObj,pPV))
+ const basegfx::B2DRange& rObjectBound(pObj->getObjectRange(getAsSdrView()));
+
+ if(aFrm1.isInside(rObjectBound))
+ {
+ if(!bUnmark)
+ {
+ if(IsObjMarkable(*pObj))
{
- GetMarkedObjectListWriteAccess().InsertEntry(SdrMark(pObj,pPV));
- bFnd=sal_True;
+ addSdrObjectToSelection(*pObj);
+ bFnd = true;
}
- } else {
- sal_uIntPtr nPos=TryToFindMarkedObject(pObj);
- if (nPos!=CONTAINER_ENTRY_NOTFOUND)
+ }
+ else
+ {
+ if(isSdrObjectSelected(*pObj))
{
- GetMarkedObjectListWriteAccess().DeleteMark(nPos);
- bFnd=sal_True;
+ removeSdrObjectFromSelection(*pObj);
+ bFnd = true;
}
}
}
}
}
- if (bFnd) {
- SortMarkedObjects();
- MarkListHasChanged();
- AdjustMarkHdl(); //HMHTRUE);
- //HMHShowMarkHdl();
- }
- return bFnd;
+
+ return bFnd; // TTTT: needed?
}
-void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, sal_Bool bUnmark, sal_Bool bImpNoSetMarkHdl)
+void SdrMarkView::MarkObj(SdrObject& rObj, bool bUnmark)
{
- if (pObj!=NULL && pPV!=NULL && IsObjMarkable(pObj, pPV)) {
+ if (IsObjMarkable(rObj))
+ {
BrkAction();
+
if (!bUnmark)
{
- GetMarkedObjectListWriteAccess().InsertEntry(SdrMark(pObj,pPV));
+ addSdrObjectToSelection(rObj);
}
else
{
- sal_uIntPtr nPos=TryToFindMarkedObject(pObj);
- if (nPos!=CONTAINER_ENTRY_NOTFOUND)
- {
- GetMarkedObjectListWriteAccess().DeleteMark(nPos);
- }
- }
- if (!bImpNoSetMarkHdl) {
- MarkListHasChanged();
- AdjustMarkHdl(); //HMHTRUE);
- //HMHif (!bSomeObjChgdFlag) {
- // ShowMarkHdl kommt sonst mit dem AfterPaintTimer
- //HMHShowMarkHdl();
- //HMH}
+ removeSdrObjectFromSelection(rObj);
}
}
}
-sal_Bool SdrMarkView::IsObjMarked(SdrObject* pObj) const
+bool SdrMarkView::IsObjMarked(const SdrObject& rObj) const
{
// nicht so ganz die feine Art: Da FindObject() nicht const ist
// muss ich mich hier auf non-const casten.
- sal_uIntPtr nPos=((SdrMarkView*)this)->TryToFindMarkedObject(pObj);
- return nPos!=CONTAINER_ENTRY_NOTFOUND;
+ return isSdrObjectSelected(rObj);
}
sal_uInt16 SdrMarkView::GetMarkHdlSizePixel() const
{
- return aHdl.GetHdlSize()*2+1;
+ return maViewHandleList.GetHdlSize()*2+1;
}
-void SdrMarkView::SetSolidMarkHdl(sal_Bool bOn)
+void SdrMarkView::SetSolidMarkHdl(bool bOn)
{
- if (bOn!=aHdl.IsFineHdl()) {
- //HMHBOOL bMerk=IsMarkHdlShown();
- //HMHif (bMerk) HideMarkHdl();
- aHdl.SetFineHdl(bOn);
- //HMHif (bMerk) ShowMarkHdl();
+ if(bOn != maViewHandleList.IsFineHdl())
+ {
+ maViewHandleList.SetFineHdl(bOn);
}
}
@@ -1629,74 +1564,64 @@ void SdrMarkView::SetMarkHdlSizePixel(sal_uInt16 nSiz)
{
if (nSiz<3) nSiz=3;
nSiz/=2;
- if (nSiz!=aHdl.GetHdlSize()) {
- //HMHBOOL bMerk=IsMarkHdlShown();
- //HMHif (bMerk) HideMarkHdl();
- aHdl.SetHdlSize(nSiz);
- //HMHif (bMerk) ShowMarkHdl();
+ if (nSiz!=maViewHandleList.GetHdlSize())
+ {
+ maViewHandleList.SetHdlSize(nSiz);
}
}
#define SDRSEARCH_IMPISMASTER 0x80000000 /* MasterPage wird gerade durchsucht */
-SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay) const
+
+SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, sal_uInt32 nOptions, const SetOfByte* pMVisLay) const
{
if(((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster()) || (!pObj->IsVisible()))
{
- return NULL;
+ return 0;
}
const bool bCheckIfMarkable(nOptions & SDRSEARCH_TESTMARKABLE);
const bool bDeep(nOptions & SDRSEARCH_DEEP);
- const bool bOLE(pObj->ISA(SdrOle2Obj));
- const bool bTXT(pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsTextFrame());
- SdrObject* pRet=NULL;
- Rectangle aRect(pObj->GetCurrentBoundRect());
- sal_uInt16 nTol2(nTol);
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pObj);
+ const SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pObj);
+ SdrObject* pRet = 0;
+ basegfx::B2DRange aBoundRange(pObj->getObjectRange(getAsSdrView()));
+ double fTol2(fTol);
// double tolerance for OLE, text frames and objects in
// active text edit
- if(bOLE || bTXT || pObj==((SdrObjEditView*)this)->GetTextEditObject())
+ if(pSdrOle2Obj || (pSdrTextObj && pSdrTextObj->IsTextFrame()) || pObj==((SdrObjEditView*)this)->GetTextEditObject())
{
- nTol2*=2;
+ fTol2 *= 2.0;
}
- aRect.Left ()-=nTol2; // Einmal Toleranz drauf fuer alle Objekte
- aRect.Top ()-=nTol2;
- aRect.Right ()+=nTol2;
- aRect.Bottom()+=nTol2;
+ if(!basegfx::fTools::equalZero(fTol2))
+ {
+ aBoundRange.grow(fabs(fTol2));
+ }
- if (aRect.IsInside(rPnt))
+ if(aBoundRange.isInside(rPnt))
{
- if ((!bCheckIfMarkable || IsObjMarkable(pObj,pPV)))
+ if((!bCheckIfMarkable || IsObjMarkable(*pObj)))
{
- SdrObjList* pOL=pObj->GetSubList();
+ SdrObjList* pOL = pObj->getChildrenOfSdrObject();
- if (pOL!=NULL && pOL->GetObjCount()!=0)
+ if(pOL && pOL->GetObjCount())
{
SdrObject* pTmpObj;
- // OD 30.06.2003 #108784# - adjustment hit point for virtual
- // objects.
- Point aPnt( rPnt );
- if ( pObj->ISA(SdrVirtObj) )
- {
- Point aOffset = static_cast<SdrVirtObj*>(pObj)->GetOffset();
- aPnt.Move( -aOffset.X(), -aOffset.Y() );
- }
-
- pRet=CheckSingleSdrObjectHit(aPnt,nTol,pOL,pPV,nOptions,pMVisLay,pTmpObj);
+ pRet = CheckSingleSdrObjectHit(rPnt, fTol, pOL, nOptions, pMVisLay, pTmpObj);
}
else
{
if(!pMVisLay || pMVisLay->IsSet(pObj->GetLayer()))
{
- pRet = SdrObjectPrimitiveHit(*pObj, rPnt, nTol2, *pPV, &pPV->GetVisibleLayers(), false);
+ pRet = SdrObjectPrimitiveHit(*pObj, rPnt, fTol2, *getAsSdrView(), false, 0);
}
}
}
}
- if (!bDeep && pRet!=NULL)
+ if(!bDeep && pRet)
{
pRet=pObj;
}
@@ -1704,25 +1629,23 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
return pRet;
}
-SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList* pOL, SdrPageView* pPV, sal_uIntPtr nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const
+SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObjList* pOL, sal_uInt32 nOptions, const SetOfByte* pMVisLay, SdrObject*& rpRootObj) const
{
- sal_Bool bBack=(nOptions & SDRSEARCH_BACKWARD)!=0;
- SdrObject* pRet=NULL;
- rpRootObj=NULL;
- if (pOL!=NULL)
+ SdrObject* pRet = 0;
+ rpRootObj = 0;
+
+ if(pOL)
{
- // #110988#
- sal_Bool bRemap(pOL->GetOwnerObj() && pOL->GetOwnerObj()->ISA(E3dScene));
- E3dScene* pRemapScene = (bRemap ? (E3dScene*)pOL->GetOwnerObj() : 0L);
+ E3dScene* pRemapScene = dynamic_cast< E3dScene* >(pOL->getSdrObjectFromSdrObjList());
+ const sal_uInt32 nObjAnz(pOL->GetObjCount());
+ sal_uInt32 nObjNum(nObjAnz);
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- sal_uIntPtr nObjNum=bBack ? 0 : nObjAnz;
- while (pRet==NULL && (bBack ? nObjNum<nObjAnz : nObjNum>0)) {
- if (!bBack) nObjNum--;
+ while(!pRet && nObjNum > 0)
+ {
+ nObjNum--;
SdrObject* pObj;
- // #110988#
- if(bRemap)
+ if(pRemapScene)
{
pObj = pOL->GetObj(pRemapScene->RemapOrdNum(nObjNum));
}
@@ -1731,453 +1654,465 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
pObj = pOL->GetObj(nObjNum);
}
- pRet=CheckSingleSdrObjectHit(rPnt,nTol,pObj,pPV,nOptions,pMVisLay);
- if (pRet!=NULL) rpRootObj=pObj;
- if (bBack) nObjNum++;
+ pRet = CheckSingleSdrObjectHit(rPnt, fTol, pObj, nOptions, pMVisLay);
+
+ if(pRet)
+ {
+ rpRootObj = pObj;
+ }
}
}
+
return pRet;
}
-sal_Bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions) const
+bool SdrMarkView::PickObj(const basegfx::B2DPoint& rPnt, double fTol, SdrObject*& rpObj, sal_uInt32 nOptions) const
{
- return PickObj(rPnt,nTol,rpObj,rpPV,nOptions,NULL,NULL,NULL);
+ return PickObj(rPnt, fTol, rpObj, nOptions, 0, 0, 0);
}
-sal_Bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr nOptions, SdrObject** ppRootObj, sal_uIntPtr* pnMarkNum, sal_uInt16* pnPassNum) const
-{ // Fehlt noch Pass2,Pass3
- SortMarkedObjects();
- if (ppRootObj!=NULL) *ppRootObj=NULL;
- if (pnMarkNum!=NULL) *pnMarkNum=CONTAINER_ENTRY_NOTFOUND;
- if (pnPassNum!=NULL) *pnPassNum=0;
- rpObj=NULL;
- rpPV=NULL;
- sal_Bool bWholePage=(nOptions & SDRSEARCH_WHOLEPAGE) !=0;
- sal_Bool bMarked=(nOptions & SDRSEARCH_MARKED) !=0;
- sal_Bool bMasters=!bMarked && (nOptions & SDRSEARCH_ALSOONMASTER) !=0;
- sal_Bool bBack=(nOptions & SDRSEARCH_BACKWARD) !=0;
-#if OSL_DEBUG_LEVEL > 0
- sal_Bool bNext=(nOptions & SDRSEARCH_NEXT) !=0; (void)bNext; // n.i.
- sal_Bool bBoundCheckOn2ndPass=(nOptions & SDRSEARCH_PASS2BOUND) !=0; (void)bBoundCheckOn2ndPass;// n.i.
- sal_Bool bCheckNearestOn3rdPass=(nOptions & SDRSEARCH_PASS3NEAREST) !=0; (void)bCheckNearestOn3rdPass;// n.i.
-#endif
- if (nTol<0) nTol=ImpGetHitTolLogic(nTol,NULL);
- Point aPt(rPnt);
- SdrObject* pObj=NULL;
- SdrObject* pHitObj=NULL;
- SdrPageView* pPV=NULL;
- if (!bBack && ((SdrObjEditView*)this)->IsTextEditFrameHit(rPnt)) {
- pObj=((SdrObjEditView*)this)->GetTextEditObject();
+bool SdrMarkView::PickObj(const basegfx::B2DPoint& rPnt, double fTol, SdrObject*& rpObj, sal_uInt32 nOptions, SdrObject** ppRootObj, sal_uInt32* pnMarkNum, sal_uInt16* pnPassNum) const
+{
+ if(ppRootObj)
+ {
+ *ppRootObj = 0;
+ }
+
+ if(pnMarkNum)
+ {
+ *pnMarkNum = CONTAINER_ENTRY_NOTFOUND;
+ }
+
+ if(pnPassNum)
+ {
+ *pnPassNum = 0;
+ }
+
+ rpObj = 0;
+
+ const bool bWholePage(nOptions & SDRSEARCH_WHOLEPAGE);
+ const bool bMarked(nOptions & SDRSEARCH_MARKED);
+ const bool bMasters(!bMarked && (nOptions & SDRSEARCH_ALSOONMASTER));
+
+ SdrObject* pObj = 0;
+ SdrObject* pHitObj = 0;
+
+ if(static_cast< const SdrView* >(this)->IsTextEditFrameHit(rPnt))
+ {
+ pObj = static_cast< const SdrView* >(this)->GetTextEditObject();
pHitObj=pObj;
- pPV=((SdrObjEditView*)this)->GetTextEditPageView();
}
- if (bMarked) {
- sal_uIntPtr nMrkAnz=GetMarkedObjectCount();
- sal_uIntPtr nMrkNum=bBack ? 0 : nMrkAnz;
- while (pHitObj==NULL && (bBack ? nMrkNum<nMrkAnz : nMrkNum>0)) {
- if (!bBack) nMrkNum--;
- SdrMark* pM=GetSdrMarkByIndex(nMrkNum);
- pObj=pM->GetMarkedSdrObj();
- pPV=pM->GetPageView();
- pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObj,pPV,nOptions,NULL);
- if (bBack) nMrkNum++;
+
+ if(bMarked)
+ {
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt32 nMrkNum(aSelection.size());
+
+ while(!pHitObj && nMrkNum > 0)
+ {
+ nMrkNum--;
+ pObj = aSelection[nMrkNum];
+ pHitObj = CheckSingleSdrObjectHit(rPnt, fTol, pObj, nOptions, 0);
+ }
}
}
else
{
- pPV = GetSdrPageView();
-
- if(pPV)
+ if(GetSdrPageView())
{
- SdrPage* pPage=pPV->GetPage();
- sal_uInt16 nPgAnz=1;
+ SdrPage& rPage = GetSdrPageView()->getSdrPageFromSdrPageView();
+ sal_uInt16 nPgAnz(1);
- if(bMasters && pPage->TRG_HasMasterPage())
+ if(bMasters && rPage.TRG_HasMasterPage())
{
nPgAnz++;
}
- sal_Bool bExtraPassForWholePage=bWholePage && pPage!=pPV->GetObjList();
- if (bExtraPassForWholePage) nPgAnz++; // Suche erst in AktObjList, dann auf der gesamten Page
- sal_uInt16 nPgNum=bBack ? 0 : nPgAnz;
- while (pHitObj==NULL && (bBack ? nPgNum<nPgAnz : nPgNum>0)) {
- sal_uIntPtr nTmpOptions=nOptions;
- if (!bBack) nPgNum--;
- const SetOfByte* pMVisLay=NULL;
- SdrObjList* pObjList=NULL;
- if (pnPassNum!=NULL) *pnPassNum&=~(SDRSEARCHPASS_MASTERPAGE|SDRSEARCHPASS_INACTIVELIST);
+ const bool bExtraPassForWholePage(bWholePage && &rPage != GetSdrPageView()->GetCurrentObjectList());
+
+ if(bExtraPassForWholePage)
+ {
+ nPgAnz++; // Suche erst in AktObjList, dann auf der gesamten Page
+ }
+
+ sal_uInt16 nPgNum(nPgAnz);
+
+ while(!pHitObj && nPgNum > 0)
+ {
+ sal_uInt32 nTmpOptions(nOptions);
+ nPgNum--;
+ const SetOfByte* pMVisLay = 0;
+ SdrObjList* pObjList = 0;
+
+ if(pnPassNum)
+ {
+ *pnPassNum &= ~(SDRSEARCHPASS_MASTERPAGE|SDRSEARCHPASS_INACTIVELIST);
+ }
+
if (nPgNum>=nPgAnz-1 || (bExtraPassForWholePage && nPgNum>=nPgAnz-2))
{
- pObjList=pPV->GetObjList();
- if (bExtraPassForWholePage && nPgNum==nPgAnz-2) {
- pObjList=pPage;
- if (pnPassNum!=NULL) *pnPassNum|=SDRSEARCHPASS_INACTIVELIST;
+ pObjList = GetSdrPageView()->GetCurrentObjectList();
+
+ if(bExtraPassForWholePage && nPgNum == nPgAnz - 2)
+ {
+ pObjList = &rPage;
+
+ if(pnPassNum)
+ {
+ *pnPassNum |= SDRSEARCHPASS_INACTIVELIST;
+ }
}
}
else
{
// sonst MasterPage
- SdrPage& rMasterPage = pPage->TRG_GetMasterPage();
- pMVisLay = &pPage->TRG_GetMasterPageVisibleLayers();
+ SdrPage& rMasterPage = rPage.TRG_GetMasterPage();
+ pMVisLay = &rPage.TRG_GetMasterPageVisibleLayers();
pObjList = &rMasterPage;
- if (pnPassNum!=NULL) *pnPassNum|=SDRSEARCHPASS_MASTERPAGE;
+ if(pnPassNum)
+ {
+ *pnPassNum |= SDRSEARCHPASS_MASTERPAGE;
+ }
+
nTmpOptions=nTmpOptions | SDRSEARCH_IMPISMASTER;
}
- pHitObj=CheckSingleSdrObjectHit(aPt,nTol,pObjList,pPV,nTmpOptions,pMVisLay,pObj);
- if (bBack) nPgNum++;
+
+ pHitObj = CheckSingleSdrObjectHit(rPnt, fTol, pObjList, nTmpOptions, pMVisLay, pObj);
}
}
}
- if (pHitObj!=NULL) {
- if (ppRootObj!=NULL) *ppRootObj=pObj;
- if ((nOptions & SDRSEARCH_DEEP) !=0) pObj=pHitObj;
- if ((nOptions & SDRSEARCH_TESTTEXTEDIT) !=0) {
- if (!pObj->HasTextEdit() || pPV->GetLockedLayers().IsSet(pObj->GetLayer())) {
- pObj=NULL;
- }
+
+ if(pHitObj)
+ {
+ if(ppRootObj)
+ {
+ *ppRootObj = pObj;
}
- if (pObj!=NULL && (nOptions & SDRSEARCH_TESTMACRO) !=0) {
- SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=aPt;
- aHitRec.aDownPos=aPt;
- aHitRec.nTol=nTol;
- aHitRec.pVisiLayer=&pPV->GetVisibleLayers();
- aHitRec.pPageView=pPV;
- if (!pObj->HasMacro() || !pObj->IsMacroHit(aHitRec)) pObj=NULL;
+
+ if(nOptions & SDRSEARCH_DEEP)
+ {
+ pObj = pHitObj;
+ }
+
+ if(nOptions & SDRSEARCH_TESTTEXTEDIT)
+ {
+ if(!pObj->HasTextEdit() || (GetSdrPageView() && GetSdrPageView()->GetLockedLayers().IsSet(pObj->GetLayer())))
+ {
+ pObj = 0;
+ }
}
- if (pObj!=NULL && (nOptions & SDRSEARCH_WITHTEXT) !=0 && pObj->GetOutlinerParaObject()==NULL) pObj=NULL;
- if (pObj!=NULL && (nOptions & SDRSEARCH_TESTTEXTAREA) !=0)
+
+ if(pObj && (nOptions & SDRSEARCH_TESTMACRO))
{
- if(!SdrObjectPrimitiveHit(*pObj, aPt, 0, *pPV, 0, true))
+ SdrObjMacroHitRec aHitRec;
+
+ aHitRec.maPos = rPnt;
+ aHitRec.maDownPos = rPnt;
+ aHitRec.mfTol = fTol;
+ aHitRec.mpSdrView = getAsSdrView();
+
+ if(!pObj->HasMacro() || !pObj->IsMacroHit(aHitRec))
{
pObj = 0;
}
}
- if (pObj!=NULL) {
+
+// if(pObj && (nOptions & SDRSEARCH_WITHTEXT) && !pObj->GetOutlinerParaObject())
+// {
+// pObj = 0;
+// }
+
+ if(pObj)
+ {
rpObj=pObj;
- rpPV=pPV;
- if (pnPassNum!=NULL) *pnPassNum|=SDRSEARCHPASS_DIRECT;
+
+ if(pnPassNum)
+ {
+ *pnPassNum |= SDRSEARCHPASS_DIRECT;
+ }
}
}
- return rpObj!=NULL;
+
+ return (0 != rpObj);
}
-sal_Bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uIntPtr* pnMarkNum, sal_uIntPtr nOptions) const
+bool SdrMarkView::PickMarkedObj(const basegfx::B2DPoint& rPnt, SdrObject*& rpObj, sal_uInt32* pnMarkNum, sal_uInt32 nOptions) const
{
- SortMarkedObjects();
- sal_Bool bBoundCheckOn2ndPass=(nOptions & SDRSEARCH_PASS2BOUND) !=0;
- sal_Bool bCheckNearestOn3rdPass=(nOptions & SDRSEARCH_PASS3NEAREST) !=0;
- rpObj=NULL;
- rpPV=NULL;
- if (pnMarkNum!=NULL) *pnMarkNum=CONTAINER_ENTRY_NOTFOUND;
- Point aPt(rPnt);
- sal_uInt16 nTol=(sal_uInt16)nHitTolLog;
- sal_Bool bFnd=sal_False;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_uIntPtr nMarkNum;
- for (nMarkNum=nMarkAnz; nMarkNum>0 && !bFnd;) {
+ const bool bBoundCheckOn2ndPass(nOptions & SDRSEARCH_PASS2BOUND);
+ const bool bCheckNearestOn3rdPass(nOptions & SDRSEARCH_PASS3NEAREST);
+ rpObj = 0;
+
+ if(pnMarkNum)
+ {
+ *pnMarkNum = CONTAINER_ENTRY_NOTFOUND;
+ }
+
+ double fTol(getHitTolLog());
+ bool bFnd(false);
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt32 nMarkNum(0);
+
+ for(nMarkNum = aSelection.size(); nMarkNum > 0 && !bFnd;)
+ {
nMarkNum--;
- SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrPageView* pPV=pM->GetPageView();
- SdrObject* pObj=pM->GetMarkedSdrObj();
- bFnd = 0 != CheckSingleSdrObjectHit(aPt,nTol,pObj,pPV,SDRSEARCH_TESTMARKABLE,0);
- if (bFnd) {
+ SdrObject* pObj = aSelection[nMarkNum];
+ bFnd = CheckSingleSdrObjectHit(rPnt, fTol, pObj, SDRSEARCH_TESTMARKABLE, 0);
+
+ if(bFnd)
+ {
rpObj=pObj;
- rpPV=pPV;
- if (pnMarkNum!=NULL) *pnMarkNum=nMarkNum;
+
+ if(pnMarkNum)
+ {
+ *pnMarkNum = nMarkNum;
+ }
}
}
- if ((bBoundCheckOn2ndPass || bCheckNearestOn3rdPass) && !bFnd) {
- SdrObject* pBestObj=NULL;
- SdrPageView* pBestPV=NULL;
- sal_uIntPtr nBestMarkNum=0;
- sal_uIntPtr nBestDist=ULONG_MAX;
- for (nMarkNum=nMarkAnz; nMarkNum>0 && !bFnd;) {
+
+ if((bBoundCheckOn2ndPass || bCheckNearestOn3rdPass) && !bFnd)
+ {
+ SdrObject* pBestObj = 0;
+ sal_uInt32 nBestMarkNum(0);
+ double fBestDist(0.0);
+
+ for(nMarkNum = aSelection.size(); nMarkNum > 0 && !bFnd;)
+ {
nMarkNum--;
- SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrPageView* pPV=pM->GetPageView();
- SdrObject* pObj=pM->GetMarkedSdrObj();
- Rectangle aRect(pObj->GetCurrentBoundRect());
- aRect.Left ()-=nTol;
- aRect.Top ()-=nTol;
- aRect.Right ()+=nTol;
- aRect.Bottom()+=nTol;
- if (aRect.IsInside(aPt)) {
- bFnd=sal_True;
+ SdrObject* pObj = aSelection[nMarkNum];
+ basegfx::B2DRange aObjRange(pObj->getObjectRange(getAsSdrView()));
+
+ if(!basegfx::fTools::equalZero(fTol))
+ {
+ aObjRange.grow(fabs(fTol));
+ }
+
+ if(aObjRange.isInside(rPnt))
+ {
+ bFnd = true;
rpObj=pObj;
- rpPV=pPV;
- if (pnMarkNum!=NULL) *pnMarkNum=nMarkNum;
- } else if (bCheckNearestOn3rdPass) {
- sal_uIntPtr nDist=0;
- if (aPt.X()<aRect.Left()) nDist+=aRect.Left()-aPt.X();
- if (aPt.X()>aRect.Right()) nDist+=aPt.X()-aRect.Right();
- if (aPt.Y()<aRect.Top()) nDist+=aRect.Top()-aPt.Y();
- if (aPt.Y()>aRect.Bottom()) nDist+=aPt.Y()-aRect.Bottom();
- if (nDist<nBestDist) {
+
+ if(pnMarkNum)
+ {
+ *pnMarkNum = nMarkNum;
+ }
+ }
+ else if(bCheckNearestOn3rdPass)
+ {
+ double fDist(0.0);
+
+ if(rPnt.getX() < aObjRange.getMinX())
+ {
+ fDist += aObjRange.getMinX() - rPnt.getX();
+ }
+
+ if(rPnt.getX() > aObjRange.getMaxX())
+ {
+ fDist += rPnt.getX() - aObjRange.getMaxX();
+ }
+
+
+ if(rPnt.getY() < aObjRange.getMinY())
+ {
+ fDist += aObjRange.getMinY() - rPnt.getY();
+ }
+
+
+ if(rPnt.getY() > aObjRange.getMaxY())
+ {
+ fDist += rPnt.getY() - aObjRange.getMaxY();
+ }
+
+ if(basegfx::fTools::equalZero(fBestDist) || basegfx::fTools::less(fDist, fBestDist))
+ {
+ fBestDist = fDist;
pBestObj=pObj;
- pBestPV=pPV;
nBestMarkNum=nMarkNum;
}
}
}
- if (bCheckNearestOn3rdPass && !bFnd) {
+
+ if(bCheckNearestOn3rdPass && !bFnd)
+ {
rpObj=pBestObj;
- rpPV=pBestPV;
- if (pnMarkNum!=NULL) *pnMarkNum=nBestMarkNum;
- bFnd=pBestObj!=NULL;
+
+ if(pnMarkNum)
+ {
+ *pnMarkNum = nBestMarkNum;
+ }
+
+ bFnd = (0 != pBestObj);
}
}
+
return bFnd;
}
-SdrHitKind SdrMarkView::PickSomething(const Point& rPnt, short nTol) const
+SdrHitKind SdrMarkView::PickSomething(const basegfx::B2DPoint& rPnt, double fTol) const
{
- nTol=ImpGetHitTolLogic(nTol,NULL);
- SdrHitKind eRet=SDRHIT_NONE;
- Point aPt(rPnt);
- SdrObject* pObj=NULL;
- SdrPageView* pPV=NULL;
- if (eRet==SDRHIT_NONE && PickObj(rPnt,sal_uInt16(nTol),pObj,pPV,SDRSEARCH_PICKMARKABLE)) {
- Rectangle aRct1(aPt-Point(nTol,nTol),aPt+Point(nTol,nTol)); // HitRect fuer Toleranz
- Rectangle aBR(pObj->GetCurrentBoundRect());
- if (aRct1.IsInside(aBR.TopLeft())) eRet=SDRHIT_BOUNDTL;
- else if (aRct1.IsInside(aBR.TopCenter())) eRet=SDRHIT_BOUNDTC;
- else if (aRct1.IsInside(aBR.TopRight())) eRet=SDRHIT_BOUNDTR;
- else if (aRct1.IsInside(aBR.LeftCenter())) eRet=SDRHIT_BOUNDCL;
- else if (aRct1.IsInside(aBR.RightCenter())) eRet=SDRHIT_BOUNDCR;
- else if (aRct1.IsInside(aBR.BottomLeft())) eRet=SDRHIT_BOUNDBL;
- else if (aRct1.IsInside(aBR.BottomCenter())) eRet=SDRHIT_BOUNDBC;
- else if (aRct1.IsInside(aBR.BottomRight())) eRet=SDRHIT_BOUNDBR;
- else eRet=SDRHIT_OBJECT;
+ SdrObject* pObj = 0;
+
+ if(PickObj(rPnt, fTol, pObj, SDRSEARCH_PICKMARKABLE))
+ {
+ return SDRHIT_OBJECT;
}
- return eRet;
+
+ return SDRHIT_NONE;
}
-void SdrMarkView::UnmarkAllObj(SdrPageView* pPV)
+void SdrMarkView::UnmarkAllObj()
{
- if (GetMarkedObjectCount()!=0) {
+ if(areSdrObjectsSelected())
+ {
BrkAction();
- //HMHBOOL bVis=bHdlShown;
- //HMHif (bVis) HideMarkHdl();
- if (pPV!=NULL)
- {
- GetMarkedObjectListWriteAccess().DeletePageView(*pPV);
- }
- else
- {
- GetMarkedObjectListWriteAccess().Clear();
- }
- pMarkedObj=NULL;
- pMarkedPV=NULL;
- MarkListHasChanged();
- AdjustMarkHdl(); //HMHTRUE);
- //HMHif (bVis) ShowMarkHdl(); // ggf. fuer die RefPoints
+ clearSdrObjectSelection();
}
}
-void SdrMarkView::MarkAllObj(SdrPageView* _pPV)
+void SdrMarkView::MarkAllObj()
{
BrkAction();
- //HMHHideMarkHdl();
+ const SdrPageView* pSourceSdrPageView = GetSdrPageView();
- if(!_pPV)
+ if(pSourceSdrPageView)
{
- _pPV = GetSdrPageView();
- }
+ const SdrObjList* pList = pSourceSdrPageView->GetCurrentObjectList();
+ const sal_uInt32 nCount(pList->GetObjCount());
+ SdrObjectVector aNewSelection;
- // #i69171# _pPV may still be NULL if there is no SDrPageView (!), e.g. when inserting
- // other files
- if(_pPV)
- {
- const bool bMarkChg(GetMarkedObjectListWriteAccess().InsertPageView(*_pPV));
+ aNewSelection.reserve(nCount);
- if(bMarkChg)
+ for(sal_uInt32 a(0); a < nCount; a++)
{
- MarkListHasChanged();
- }
- }
-
- if(GetMarkedObjectCount())
- {
- AdjustMarkHdl(); //HMHTRUE);
- //HMHShowMarkHdl();
- }
-}
+ SdrObject* pObj = pList->GetObj(a);
-void SdrMarkView::AdjustMarkHdl() //HMHBOOL bRestraintPaint)
-{
- //HMHBOOL bVis=bHdlShown;
- //HMHif (bVis) HideMarkHdl();
- CheckMarked();
- SetMarkRects();
- SetMarkHandles();
- //HMHif(bRestraintPaint && bVis)
- //HMH{
- //HMH ShowMarkHdl();
- //HMH}
-}
+ if(pSourceSdrPageView->IsObjMarkable(*pObj))
+ {
+ aNewSelection.push_back(pObj);
+ }
+ }
-Rectangle SdrMarkView::GetMarkedObjBoundRect() const
-{
- Rectangle aRect;
- for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount(); nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- Rectangle aR1(pO->GetCurrentBoundRect());
- if (aRect.IsEmpty()) aRect=aR1;
- else aRect.Union(aR1);
+ setSdrObjectSelection(aNewSelection);
}
- return aRect;
}
-const Rectangle& SdrMarkView::GetMarkedObjRect() const
+const basegfx::B2DRange& SdrMarkView::getMarkedObjectSnapRange() const
{
- if (bMarkedObjRectDirty) {
- ((SdrMarkView*)this)->bMarkedObjRectDirty=sal_False;
- Rectangle aRect;
- for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount(); nm++) {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- Rectangle aR1(pO->GetSnapRect());
- if (aRect.IsEmpty()) aRect=aR1;
- else aRect.Union(aR1);
- }
- ((SdrMarkView*)this)->aMarkedObjRect=aRect;
- }
- return aMarkedObjRect;
+ return maSelection.getSnapRange();
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrMarkView::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 nVal, sal_uInt16 nOpt) const
+void SdrMarkView::TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 nVal, sal_uInt16 nOpt) const
{
- rStr = ImpGetResStr(nStrCacheID);
- xub_StrLen nPos = rStr.SearchAscii("%1");
-
- if(nPos != STRING_NOTFOUND)
+ if(areSdrObjectsSelected())
{
- rStr.Erase(nPos, 2);
+ rStr = ImpGetResStr(nStrCacheID);
+ xub_StrLen nPos = rStr.SearchAscii("%1");
- if(nOpt == IMPSDR_POINTSDESCRIPTION)
- {
- rStr.Insert(GetDescriptionOfMarkedPoints(), nPos);
- }
- else if(nOpt == IMPSDR_GLUEPOINTSDESCRIPTION)
- {
- rStr.Insert(GetDescriptionOfMarkedGluePoints(), nPos);
- }
- else
+ if(nPos != STRING_NOTFOUND)
{
- rStr.Insert(GetDescriptionOfMarkedObjects(), nPos);
+ rStr.Erase(nPos, 2);
+
+ if(nOpt == IMPSDR_POINTSDESCRIPTION)
+ {
+ rStr.Insert(getSelectedPointsDescription(), nPos);
+ }
+ else if(nOpt == IMPSDR_GLUEPOINTSDESCRIPTION)
+ {
+ rStr.Insert(getSelectedGluesDescription(), nPos);
+ }
+ else
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ rStr.Insert(getSelectionDescription(aSelection), nPos);
+ }
}
- }
- nPos = rStr.SearchAscii("%2");
+ nPos = rStr.SearchAscii("%2");
- if(nPos != STRING_NOTFOUND)
- {
- rStr.Erase(nPos, 2);
- rStr.Insert(UniString::CreateFromInt32(nVal), nPos);
+ if(nPos != STRING_NOTFOUND)
+ {
+ rStr.Erase(nPos, 2);
+ rStr.Insert(UniString::CreateFromInt32(nVal), nPos);
+ }
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrMarkView::EnterMarkedGroup()
+bool SdrMarkView::EnterMarkedGroup()
{
- sal_Bool bRet=sal_False;
- // Es wird nur die erste gefundene Gruppe (also nur in einer PageView) geentert
- // Weil PageView::EnterGroup ein AdjustMarkHdl ruft.
- // Das muss ich per Flag mal unterbinden vvvvvvvv
+ bool bRet(false);
SdrPageView* pPV = GetSdrPageView();
- if(pPV)
+ if(pPV && areSdrObjectsSelected())
{
- sal_Bool bEnter=sal_False;
- for (sal_uInt32 nm(GetMarkedObjectCount()); nm > 0 && !bEnter;)
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bEnter(false);
+
+ for(sal_uInt32 nm(aSelection.size()); nm > 0 && !bEnter;)
{
nm--;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- if (pM->GetPageView()==pPV) {
- SdrObject* pObj=pM->GetMarkedSdrObj();
- if (pObj->IsGroupObject()) {
- if (pPV->EnterGroup(pObj)) {
- bRet=sal_True;
- bEnter=sal_True;
- }
+
+ SdrObject* pObj = aSelection[nm];
+
+ if(pObj->getChildrenOfSdrObject())
+ {
+ if(pPV->EnterGroup(pObj))
+ {
+ bRet = true;
+ bEnter = true;
}
}
}
}
+
return bRet;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrMarkView::MarkListHasChanged()
+void SdrMarkView::handleSelectionChange()
{
- GetMarkedObjectListWriteAccess().SetNameDirty();
- SetEdgesOfMarkedNodesDirty(); // bEdgesOfMarkedNodesDirty=sal_True;
+ // call parent
+ SdrSnapView::handleSelectionChange();
+
+ // local reactions
+ maMarkedPointRange.reset();
+ maMarkedGluePointRange.reset();
- bMarkedObjRectDirty=sal_True;
- bMarkedPointsRectsDirty=sal_True;
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
-#endif
- sal_Bool bOneEdgeMarked=sal_False;
- if (GetMarkedObjectCount()==1) {
- const SdrObject* pObj=GetMarkedObjectByIndex(0);
- if (pObj->GetObjInventor()==SdrInventor) {
- sal_uInt16 nIdent=pObj->GetObjIdentifier();
- bOneEdgeMarked=nIdent==OBJ_EDGE;
- }
+ // evtl. reset ItemBrowser
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
}
- ImpSetGlueVisible4(bOneEdgeMarked);
-}
+#endif
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ // handle GlueVisible flag
+ ImpSetGlueVisible4(0 != dynamic_cast< SdrEdgeObj* >(getSelectedIfSingle()));
-void SdrMarkView::SetMoveOutside(sal_Bool bOn)
+ // visualize new selection
+ SetMarkHandles();
+}
+
+void SdrMarkView::SetMoveOutside(bool bOn)
{
- aHdl.SetMoveOutside(bOn);
+ maViewHandleList.SetMoveOutside(bOn);
}
-sal_Bool SdrMarkView::IsMoveOutside() const
+bool SdrMarkView::IsMoveOutside() const
{
- return aHdl.IsMoveOutside();
+ return maViewHandleList.IsMoveOutside();
}
-void SdrMarkView::SetDesignMode( sal_Bool _bOn )
+void SdrMarkView::SetDesignMode( bool _bOn )
{
- if ( bDesignMode != _bOn )
+ if ( IsDesignMode() != _bOn )
{
- bDesignMode = _bOn;
+ mbDesignMode = _bOn;
SdrPageView* pPageView = GetSdrPageView();
if ( pPageView )
pPageView->SetDesignMode( _bOn );
}
}
-// MarkHandles Objektaenderung:
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// - Bei Notify mit HINT_OBJCHG (oder so) werden die Handles erstmal versteckt
-// (wenn nicht schon wegen Dragging versteckt).
-// - XorHdl: Bei ModelHasChanged() werden sie dann wieder angezeigt.
-// - PaintEvents kommen nun durch.
-// - Die XorHandles werden z.T. wieder uebermalt.
-// - Xor: Nach dem Painten werden die Handles im (vom PaintHandler gerufenen)
-// CompleteRedraw per ToggleShownXor bei gesetzter ClipRegion nochmal gemalt
-// und damit ist alles in Butter.
-// - ToggleShownXor macht bei SolidHdl nix weil bHdlShown=FALSE
-// - Der AfterPaintTimer wird gestartet.
-// - SolidHdl: Im AfterPaintHandler wird ShowMarkHdl gerufen.
-// Da die Handles zu diesem Zeitpunkt nicht angezeigt sind wird:
-// - SaveBackground durchgefuehrt.
-// - DrawMarkHdl gerufen und bHdlShown gesetzt.
-//
-// MarkHandles bei sonstigem Invalidate:
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// In diesem Fall bekomme ich kein Notify und beim Aufruf des
-// PaintHandlers->CompleteRedraw() sind auch die SolidHandles sichtbar.
-
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx
index 68a4f9763028..fca5f19a647b 100644
--- a/svx/source/svdraw/svdmrkv1.cxx
+++ b/svx/source/svdraw/svdmrkv1.cxx
@@ -31,195 +31,157 @@
#include <svx/svdpagv.hxx>
#include <svx/svdpage.hxx>
#include "svddrgm1.hxx"
+#include <svx/svdlegacy.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@ @@ @@ @@ @@ @@ @@@@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@@@@ @@ @@ @@ @@ @@@@
-// @@ @@ @@ @@ @@@ @@ @@ @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@
-// @@ @@ @@ @@ @@@@@@ @@ @@ @@ @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@@@@ @@
-// @@@@@ @@ @@ @@@@@@ @@@@ @@ @@@@@@@ @@@@@@ @@@@@ @@@@ @@ @@@@ @@@@@ @@ @@ @@@@@@ @@ @@@
-// @@ @@ @@ @@ @@@ @@ @@ @@ @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@@@ @@ @@ @@@@ @@ @@ @@@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrMarkView::HasMarkablePoints() const
+bool SdrMarkView::HasMarkablePoints() const
{
- ForceUndirtyMrkPnt();
- bool bRet=false;
- if (!ImpIsFrameHandles()) {
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- if (nMarkAnz<=nFrameHandlesLimit) {
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- bRet=pObj->IsPolyObj();
+ bool bRet(false);
+
+ if(!ImpIsFrameHandles() && areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSelection.size() <= FRAME_HANDLES_LIMIT)
+ {
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size() && !bRet; nMarkNum++)
+ {
+ bRet = aSelection[nMarkNum]->IsPolygonObject();
}
}
}
+
return bRet;
}
-sal_uIntPtr SdrMarkView::GetMarkablePointCount() const
+sal_uInt32 SdrMarkView::GetMarkablePointCount() const
{
- ForceUndirtyMrkPnt();
- sal_uIntPtr nAnz=0;
- if (!ImpIsFrameHandles()) {
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- if (nMarkAnz<=nFrameHandlesLimit) {
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- if (pObj->IsPolyObj()) {
- nAnz+=pObj->GetPointCount();
+ sal_uInt32 nAnz(0);
+
+ if(!ImpIsFrameHandles() && areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSelection.size() <= FRAME_HANDLES_LIMIT)
+ {
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
+ {
+ const SdrObject* pObj = aSelection[nMarkNum];
+
+ if(pObj->IsPolygonObject())
+ {
+ nAnz += pObj->GetObjectPointCount();
}
}
}
}
+
return nAnz;
}
-sal_Bool SdrMarkView::HasMarkedPoints() const
+bool SdrMarkView::HasMarkedPoints() const
{
- ForceUndirtyMrkPnt();
- sal_Bool bRet=sal_False;
- if (!ImpIsFrameHandles()) {
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- if (nMarkAnz<=nFrameHandlesLimit) {
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrUShortCont* pPts=pM->GetMarkedPoints();
- bRet=pPts!=NULL && pPts->GetCount()!=0;
- }
- }
- }
- return bRet;
+ return arePointsSelected();
}
-sal_uIntPtr SdrMarkView::GetMarkedPointCount() const
+sal_uInt32 SdrMarkView::GetMarkedPointCount() const
{
- ForceUndirtyMrkPnt();
- sal_uIntPtr nAnz=0;
- if (!ImpIsFrameHandles()) {
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- if (nMarkAnz<=nFrameHandlesLimit) {
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrUShortCont* pPts=pM->GetMarkedPoints();
- if (pPts!=NULL) nAnz+=pPts->GetCount();
+ sal_uInt32 nAnz(0);
+
+ if(!ImpIsFrameHandles() && areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ if(aSelection.size() <= FRAME_HANDLES_LIMIT)
+ {
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
+ {
+ const sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*aSelection[nMarkNum]));
+
+ nAnz += aMarkedPoints.size();
}
}
}
+
return nAnz;
}
-sal_Bool SdrMarkView::IsPointMarkable(const SdrHdl& rHdl) const
+bool SdrMarkView::IsPointMarkable(const SdrHdl& rHdl) const
{
- return !ImpIsFrameHandles() && &rHdl!=NULL && !rHdl.IsPlusHdl() && rHdl.GetKind()!=HDL_GLUE && rHdl.GetKind()!=HDL_SMARTTAG && rHdl.GetObj()!=NULL && rHdl.GetObj()->IsPolyObj();
+ return !ImpIsFrameHandles()
+ && (&rHdl)
+ && !rHdl.IsPlusHdl()
+ && HDL_GLUE != rHdl.GetKind()
+ && HDL_SMARTTAG != rHdl.GetKind()
+ && rHdl.GetObj()
+ && rHdl.GetObj()->IsPolygonObject();
}
-sal_Bool SdrMarkView::MarkPointHelper(SdrHdl* pHdl, SdrMark* pMark, sal_Bool bUnmark)
+bool SdrMarkView::MarkPointHelper(SdrHdl* pHdl, bool bUnmark)
{
- return ImpMarkPoint( pHdl, pMark, bUnmark );
+ return ImpMarkPoint(pHdl, bUnmark);
}
-sal_Bool SdrMarkView::ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, sal_Bool bUnmark)
+bool SdrMarkView::ImpMarkPoint(SdrHdl* pHdl, bool bUnmark)
{
- if (pHdl==NULL || pHdl->IsPlusHdl() || pHdl->GetKind()==HDL_GLUE)
- return sal_False;
+ if(!pHdl || pHdl->IsPlusHdl() || HDL_GLUE == pHdl->GetKind())
+ {
+ return false;
+ }
- if (pHdl->IsSelected() != bUnmark)
- return sal_False;
+ if(pHdl->IsSelected() != bUnmark)
+ {
+ return false;
+ }
- SdrObject* pObj=pHdl->GetObj();
- if (pObj==NULL || !pObj->IsPolyObj())
- return sal_False;
+ const SdrObject* pObj = pHdl->GetObj();
- if (pMark==NULL)
+ if(!pObj || !pObj->IsPolygonObject())
{
- sal_uIntPtr nMarkNum=TryToFindMarkedObject(pObj);
- if (nMarkNum==CONTAINER_ENTRY_NOTFOUND)
- return sal_False;
- pMark=GetSdrMarkByIndex(nMarkNum);
+ return false;
}
+
+ sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*pObj));
const sal_uInt32 nHdlNum(pHdl->GetObjHdlNum());
- SdrUShortCont* pPts=pMark->ForceMarkedPoints();
+
if (!bUnmark)
{
- pPts->Insert((sal_uInt16)nHdlNum);
+ aMarkedPoints.insert(nHdlNum);
}
else
{
- sal_uIntPtr nBla=pPts->GetPos((sal_uInt16)nHdlNum);
- if (nBla!=CONTAINER_ENTRY_NOTFOUND)
+ if(!aMarkedPoints.erase(nHdlNum))
{
- pPts->Remove(nBla);
- }
- else
- {
- return sal_False; // Fehlerfall!
+ return false;
}
}
+ setSelectedPointsForSelectedSdrObject(*pObj, aMarkedPoints);
pHdl->SetSelected(!bUnmark);
- if (!bPlusHdlAlways)
- {
- if (!bUnmark)
- {
- sal_uInt32 nAnz(pObj->GetPlusHdlCount(*pHdl));
- for (sal_uInt32 i=0; i<nAnz; i++)
- {
- SdrHdl* pPlusHdl=pObj->GetPlusHdl(*pHdl,i);
- if (pPlusHdl!=NULL)
- {
- pPlusHdl->SetObj(pObj);
- pPlusHdl->SetPageView(pMark->GetPageView());
- pPlusHdl->SetPlusHdl(sal_True);
- aHdl.AddHdl(pPlusHdl);
- }
- }
- }
- else
- {
- for (sal_uIntPtr i = aHdl.GetHdlCount(); i>0;)
- {
- i--;
- SdrHdl* pPlusHdl=aHdl.GetHdl(i);
- if (pPlusHdl->IsPlusHdl() && pPlusHdl->GetSourceHdlNum()==nHdlNum)
- {
- aHdl.RemoveHdl(i);
- delete pPlusHdl;
- }
- }
- }
- }
-
- // #97016# II: Sort handles. This was missing in ImpMarkPoint all the time.
- aHdl.Sort();
- return sal_True;
+ return true;
}
-sal_Bool SdrMarkView::MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark)
+bool SdrMarkView::MarkPoint(SdrHdl& rHdl, bool bUnmark)
{
- if (&rHdl==NULL) return sal_False;
- ForceUndirtyMrkPnt();
- sal_Bool bRet=sal_False;
+ if(!(&rHdl))
+ {
+ return false;
+ }
+
+ bool bRet(false);
+
+ if(IsPointMarkable(rHdl) && rHdl.IsSelected() == bUnmark)
+ {
const SdrObject* pObj=rHdl.GetObj();
- if (IsPointMarkable(rHdl) && rHdl.IsSelected()==bUnmark) {
- sal_uIntPtr nMarkNum=TryToFindMarkedObject(pObj);
- if (nMarkNum!=CONTAINER_ENTRY_NOTFOUND) {
- SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrUShortCont* pPts=pM->ForceMarkedPoints();
- pPts->ForceSort();
- if (ImpMarkPoint(&rHdl,pM,bUnmark)) {
- pPts->ForceSort();
- MarkListHasChanged();
- bRet=sal_True;
+
+ if(isSdrObjectSelected(*pObj))
+ {
+ if(ImpMarkPoint(&rHdl, bUnmark))
+ {
+ bRet = true;
}
}
}
@@ -227,260 +189,117 @@ sal_Bool SdrMarkView::MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark)
return bRet;
}
-sal_Bool SdrMarkView::MarkPoints(const Rectangle* pRect, sal_Bool bUnmark)
+void SdrMarkView::MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark)
{
- ForceUndirtyMrkPnt();
- sal_Bool bChgd=sal_False;
- SortMarkedObjects();
- const SdrObject* pObj0=NULL;
- const SdrPageView* pPV0=NULL;
- SdrMark* pM=NULL;
- aHdl.Sort();
- //HMHBOOL bHideHdl=IsMarkHdlShown() && IsSolidMarkHdl() && !bPlusHdlAlways;
- sal_uIntPtr nHdlAnz=aHdl.GetHdlCount();
- for (sal_uIntPtr nHdlNum=nHdlAnz; nHdlNum>0;) {
+ const SdrObject* pObj0 = 0;
+
+ maViewHandleList.Sort();
+ const sal_uInt32 nHdlAnz(maViewHandleList.GetHdlCount());
+
+ for(sal_uInt32 nHdlNum(nHdlAnz); nHdlNum > 0;)
+ {
nHdlNum--;
- SdrHdl* pHdl=aHdl.GetHdl(nHdlNum);
- if (IsPointMarkable(*pHdl) && pHdl->IsSelected()==bUnmark) {
- const SdrObject* pObj=pHdl->GetObj();
- const SdrPageView* pPV=pHdl->GetPageView();
- if (pObj!=pObj0 || pPV!=pPV0 || pM==NULL) { // Dieser Abschnitt dient zur Optimierung,
- if (pM!=NULL) {
- SdrUShortCont* pPts=pM->GetMarkedPoints();
- if (pPts!=NULL) pPts->ForceSort();
- }
- sal_uIntPtr nMarkNum=TryToFindMarkedObject(pObj); // damit ImpMarkPoint() nicht staendig das
- if (nMarkNum!=CONTAINER_ENTRY_NOTFOUND) { // Objekt in der MarkList suchen muss.
- pM=GetSdrMarkByIndex(nMarkNum);
- pObj0=pObj;
- pPV0=pPV;
- SdrUShortCont* pPts=pM->ForceMarkedPoints();
- pPts->ForceSort();
- } else {
-#ifdef DBG_UTIL
- if (pObj->IsInserted()) {
- DBG_ERROR("SdrMarkView::MarkPoints(const Rectangle* pRect): Markiertes Objekt nicht gefunden");
- }
-#endif
- pM=NULL;
- }
- }
- Point aPos(pHdl->GetPos());
- if (pM!=NULL && (pRect==NULL || pRect->IsInside(aPos))) {
- //HMHif (bHideHdl && IsMarkHdlShown() && pHdl->GetObj()!=NULL) {
- //HMHsal_uInt32 nAnz=pHdl->GetObj()->GetPlusHdlCount(*pHdl);
- //HMHif (nAnz!=0L) HideMarkHdl(); // #36987#
- //HMH}
- if (ImpMarkPoint(pHdl,pM,bUnmark)) bChgd=sal_True;
+ SdrHdl* pHdl = maViewHandleList.GetHdlByIndex(nHdlNum);
+
+ if(IsPointMarkable(*pHdl) && pHdl->IsSelected() == bUnmark)
+ {
+ if(!pRange || pRange->isInside(pHdl->getPosition()))
+ {
+ ImpMarkPoint(pHdl, bUnmark);
}
}
}
- if (pM!=NULL) { // Den zuletzt geaenderten MarkEntry ggf. noch aufraeumen
- SdrUShortCont* pPts=pM->GetMarkedPoints();
- if (pPts!=NULL) pPts->ForceSort();
- }
- //HMHif (bHideHdl) ShowMarkHdl(); // #36987#
- if (bChgd) {
- MarkListHasChanged();
- }
-
- return bChgd;
}
-sal_Bool SdrMarkView::MarkNextPoint(sal_Bool /*bPrev*/)
+const basegfx::B2DRange& SdrMarkView::getMarkedPointRange() const
{
- ForceUndirtyMrkPnt();
- sal_Bool bChgd=sal_False;
- SortMarkedObjects();
- // ...
- if (bChgd) {
- MarkListHasChanged();
+ if(maMarkedPointRange.isEmpty())
+ {
+ impCreatePointRanges();
}
- return bChgd;
-}
-sal_Bool SdrMarkView::MarkNextPoint(const Point& /*rPnt*/, sal_Bool /*bPrev*/)
-{
- ForceUndirtyMrkPnt();
- sal_Bool bChgd=sal_False;
- SortMarkedObjects();
- // ...
- if (bChgd) {
- MarkListHasChanged();
- }
- return bChgd;
+ return maMarkedPointRange;
}
-const Rectangle& SdrMarkView::GetMarkedPointsRect() const
+void SdrMarkView::SetPlusHandlesAlwaysVisible(bool bOn)
{
- ForceUndirtyMrkPnt();
- if (bMarkedPointsRectsDirty) ImpSetPointsRects();
- return aMarkedPointsRect;
-}
-
-void SdrMarkView::SetPlusHandlesAlwaysVisible(sal_Bool bOn)
-{ // HandlePaint optimieren !!!!!!!
- ForceUndirtyMrkPnt();
- if (bOn!=bPlusHdlAlways) {
- //HMHBOOL bVis=IsMarkHdlShown();
- //HMHif (bVis) HideMarkHdl();
- bPlusHdlAlways=bOn;
+ if(bOn != IsPlusHandlesAlwaysVisible())
+ {
+ mbPlusHdlAlways = bOn;
SetMarkHandles();
- //HMHif (bVis) ShowMarkHdl();
- MarkListHasChanged();
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// ImpSetPointsRects() ist fuer PolyPoints und GluePoints!
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrMarkView::ImpSetPointsRects() const
+void SdrMarkView::impCreatePointRanges() const
{
- Rectangle aPnts;
- Rectangle aGlue;
- sal_uIntPtr nHdlAnz=aHdl.GetHdlCount();
- for (sal_uIntPtr nHdlNum=0; nHdlNum<nHdlAnz; nHdlNum++) {
- const SdrHdl* pHdl=aHdl.GetHdl(nHdlNum);
- SdrHdlKind eKind=pHdl->GetKind();
- if ((eKind==HDL_POLY && pHdl->IsSelected()) || eKind==HDL_GLUE) {
- Point aPt(pHdl->GetPos());
- Rectangle& rR=eKind==HDL_GLUE ? aGlue : aPnts;
- if (rR.IsEmpty()) {
- rR=Rectangle(aPt,aPt);
- } else {
- if (aPt.X()<rR.Left ()) rR.Left ()=aPt.X();
- if (aPt.X()>rR.Right ()) rR.Right ()=aPt.X();
- if (aPt.Y()<rR.Top ()) rR.Top ()=aPt.Y();
- if (aPt.Y()>rR.Bottom()) rR.Bottom()=aPt.Y();
- }
- }
- }
- ((SdrMarkView*)this)->aMarkedPointsRect=aPnts;
- ((SdrMarkView*)this)->aMarkedGluePointsRect=aGlue;
- ((SdrMarkView*)this)->bMarkedPointsRectsDirty=sal_False;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// UndirtyMrkPnt() ist fuer PolyPoints und GluePoints!
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ basegfx::B2DRange aNewMarkedPointRange;
+ basegfx::B2DRange aNewMarkedGluePointRange;
+ const sal_uInt32 nCount(maViewHandleList.GetHdlCount());
-void SdrMarkView::UndirtyMrkPnt() const
-{
- sal_Bool bChg=sal_False;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) {
- SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
- // PolyPoints
- SdrUShortCont* pPts=pM->GetMarkedPoints();
- if (pPts!=NULL) {
- if (pObj->IsPolyObj()) {
- // Ungueltig markierte Punkte entfernen, also alle
- // Eintraege die groesser sind als die Punktanzahl des Objekts
- sal_uInt32 nMax(pObj->GetPointCount());
- sal_uInt32 nPtNum(0xffffffff);
-
- pPts->ForceSort();
-
- for (sal_uInt32 nIndex(pPts->GetCount()); nIndex > 0L && nPtNum >= nMax;)
+ for(sal_uInt32 a(0); a < nCount; a++)
{
- nIndex--;
- nPtNum = pPts->GetObject(nIndex);
+ const SdrHdl* pHdl = maViewHandleList.GetHdlByIndex(a);
+ const SdrHdlKind eKind(pHdl->GetKind());
- if(nPtNum >= nMax)
- {
- pPts->Remove(nIndex);
- bChg = sal_True;
- }
- }
- }
- else
- {
- DBG_ERROR("SdrMarkView::UndirtyMrkPnt(): Markierte Punkte an einem Objekt, dass kein PolyObj ist!");
- if(pPts && pPts->GetCount())
- {
- pPts->Clear();
- bChg = sal_True;
- }
- }
+ if(HDL_POLY == eKind && pHdl->IsSelected())
+ {
+ aNewMarkedPointRange.expand(pHdl->getPosition());
}
-
- // GluePoints
- pPts=pM->GetMarkedGluePoints();
- const SdrGluePointList* pGPL=pObj->GetGluePointList();
- if (pPts!=NULL) {
- if (pGPL!=NULL) {
- // Ungueltig markierte Klebepunkte entfernen, also alle
- // Eintraege (Id's) die nicht in der GluePointList des
- // Objekts enthalten sind
- pPts->ForceSort();
- for (sal_uIntPtr nIndex=pPts->GetCount(); nIndex>0;) {
- nIndex--;
- sal_uInt16 nId=pPts->GetObject(nIndex);
- if (pGPL->FindGluePoint(nId)==SDRGLUEPOINT_NOTFOUND) {
- pPts->Remove(nIndex);
- bChg=sal_True;
- }
- }
- } else {
- if (pPts!=NULL && pPts->GetCount()!=0) {
- pPts->Clear(); // Objekt hat keine Klebepunkte (mehr)
- bChg=sal_True;
- }
- }
+ else if(HDL_GLUE == eKind)
+ {
+ aNewMarkedGluePointRange.expand(pHdl->getPosition());
}
}
- if (bChg) ((SdrMarkView*)this)->bMarkedPointsRectsDirty=sal_True;
- ((SdrMarkView*)this)->bMrkPntDirty=sal_False;
-}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ const_cast< SdrMarkView* >(this)->maMarkedPointRange = aNewMarkedPointRange;
+ const_cast< SdrMarkView* >(this)->maMarkedGluePointRange = aNewMarkedGluePointRange;
+}
-sal_Bool SdrMarkView::HasMarkableGluePoints() const
+bool SdrMarkView::HasMarkableGluePoints() const
{
- sal_Bool bRet=sal_False;
- if (IsGluePointEditMode()) {
- ForceUndirtyMrkPnt();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
+ bool bRet(false);
+
+ if(IsGluePointEditMode() && areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size() && !bRet; nMarkNum++)
+ {
+ const SdrObject* pObj = aSelection[nMarkNum];
const SdrGluePointList* pGPL=pObj->GetGluePointList();
- // #i38892#
if(pGPL && pGPL->GetCount())
{
- for(sal_uInt16 a(0); !bRet && a < pGPL->GetCount(); a++)
+ for(sal_uInt32 a(0); !bRet && a < pGPL->GetCount(); a++)
{
if((*pGPL)[a].IsUserDefined())
{
- bRet = sal_True;
+ bRet = true;
}
}
}
}
}
+
return bRet;
}
-sal_uIntPtr SdrMarkView::GetMarkableGluePointCount() const
+sal_uInt32 SdrMarkView::GetMarkableGluePointCount() const
{
- sal_uIntPtr nAnz=0;
- if (IsGluePointEditMode()) {
- ForceUndirtyMrkPnt();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
+ sal_uInt32 nAnz(0);
+
+ if(IsGluePointEditMode() && areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
+ {
+ const SdrObject* pObj = aSelection[nMarkNum];
const SdrGluePointList* pGPL=pObj->GetGluePointList();
- // #i38892#
if(pGPL && pGPL->GetCount())
{
- for(sal_uInt16 a(0); a < pGPL->GetCount(); a++)
+ for(sal_uInt32 a(0); a < pGPL->GetCount(); a++)
{
if((*pGPL)[a].IsUserDefined())
{
@@ -490,116 +309,126 @@ sal_uIntPtr SdrMarkView::GetMarkableGluePointCount() const
}
}
}
+
return nAnz;
}
-sal_Bool SdrMarkView::HasMarkedGluePoints() const
+sal_uInt32 SdrMarkView::GetMarkedGluePointCount() const
{
- ForceUndirtyMrkPnt();
- sal_Bool bRet=sal_False;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz && !bRet; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- bRet=pPts!=NULL && pPts->GetCount()!=0;
- }
- return bRet;
-}
+ sal_uInt32 nAnz(0);
-sal_uIntPtr SdrMarkView::GetMarkedGluePointCount() const
-{
- ForceUndirtyMrkPnt();
- sal_uIntPtr nAnz=0;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) {
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- if (pPts!=NULL) nAnz+=pPts->GetCount();
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
+ {
+ const sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*aSelection[nMarkNum]));
+
+ nAnz += aMarkedGluePoints.size();
+ }
}
+
return nAnz;
}
-sal_Bool SdrMarkView::MarkGluePoints(const Rectangle* pRect, sal_Bool bUnmark)
+void SdrMarkView::MarkGluePoints(const basegfx::B2DRange* pRange, bool bUnmark)
{
- if (!IsGluePointEditMode() && !bUnmark) return sal_False;
- ForceUndirtyMrkPnt();
- sal_Bool bChgd=sal_False;
- SortMarkedObjects();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nMarkNum=0; nMarkNum<nMarkAnz; nMarkNum++) {
- SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- const SdrObject* pObj=pM->GetMarkedSdrObj();
+ if(!IsGluePointEditMode() && !bUnmark)
+ {
+ return;
+ }
+
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
+ {
+ const SdrObject* pObj = aSelection[nMarkNum];
const SdrGluePointList* pGPL=pObj->GetGluePointList();
- SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- if (bUnmark && pRect==NULL) { // UnmarkAll
- if (pPts!=NULL && pPts->GetCount()!=0) {
- pPts->Clear();
- bChgd=sal_True;
+ sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*pObj));
+ bool bGluePointsChanged(false);
+
+ if(bUnmark && !pRange)
+ {
+ // UnmarkAll
+ if(aMarkedGluePoints.size())
+ {
+ aMarkedGluePoints.clear();
+ bGluePointsChanged = true;
}
- } else {
- if (pGPL!=NULL && (pPts!=NULL || !bUnmark)) {
- sal_uInt16 nGPAnz=pGPL->GetCount();
- for (sal_uInt16 nGPNum=0; nGPNum<nGPAnz; nGPNum++) {
+ }
+ else
+ {
+ if(pGPL && (!aMarkedGluePoints.empty() || !bUnmark))
+ {
+ const sal_uInt32 nGPAnz(pGPL->GetCount());
+ const basegfx::B2DRange aObjSnapRange(nGPAnz ? sdr::legacy::GetSnapRange(*pObj) : basegfx::B2DRange());
+
+ for(sal_uInt32 nGPNum(0); nGPNum < nGPAnz; nGPNum++)
+ {
const SdrGluePoint& rGP=(*pGPL)[nGPNum];
- // #i38892#
if(rGP.IsUserDefined())
{
- Point aPos(rGP.GetAbsolutePos(*pObj));
- if (pRect==NULL || pRect->IsInside(aPos)) {
- if (pPts==NULL) pPts=pM->ForceMarkedGluePoints();
- else pPts->ForceSort();
- sal_uIntPtr nPos=pPts->GetPos(rGP.GetId());
- if (!bUnmark && nPos==CONTAINER_ENTRY_NOTFOUND) {
- bChgd=sal_True;
- pPts->Insert(rGP.GetId());
+ if(!pRange || pRange->isInside(rGP.GetAbsolutePos(aObjSnapRange)))
+ {
+ sdr::selection::Indices::iterator aFound(aMarkedGluePoints.find(rGP.GetId()));
+
+ if(bUnmark)
+ {
+ if(aFound != aMarkedGluePoints.end())
+ {
+ aMarkedGluePoints.erase(aFound);
+ bGluePointsChanged = true;
+ }
}
- if (bUnmark && nPos!=CONTAINER_ENTRY_NOTFOUND) {
- bChgd=sal_True;
- pPts->Remove(nPos);
+ else
+ {
+ if(aFound == aMarkedGluePoints.end())
+ {
+ aMarkedGluePoints.insert(rGP.GetId());
+ bGluePointsChanged = true;
+ }
}
}
}
}
}
}
+
+ if(bGluePointsChanged)
+ {
+ setSelectedGluesForSelectedSdrObject(*pObj, aMarkedGluePoints);
+ }
}
- if (bChgd) {
- AdjustMarkHdl();
- MarkListHasChanged();
- }
- return bChgd;
}
-sal_Bool SdrMarkView::PickGluePoint(const Point& rPnt, SdrObject*& rpObj, sal_uInt16& rnId, SdrPageView*& rpPV, sal_uIntPtr nOptions) const
+bool SdrMarkView::PickGluePoint(const basegfx::B2DPoint& rPnt, SdrObject*& rpObj, sal_uInt32& rnId, sal_uInt32 nOptions) const
{
- SdrObject* pObj0=rpObj;
- //SdrPageView* pPV0=rpPV;
- sal_uInt16 nId0=rnId;
- rpObj=NULL; rpPV=NULL; rnId=0;
- if (!IsGluePointEditMode()) return sal_False;
- sal_Bool bBack=(nOptions & SDRSEARCH_BACKWARD) !=0;
- sal_Bool bNext=(nOptions & SDRSEARCH_NEXT) !=0;
- OutputDevice* pOut=(OutputDevice*)pActualOutDev;
- if (pOut==NULL) pOut=GetFirstOutputDevice(); //GetWin(0);
- if (pOut==NULL) return sal_False;
- SortMarkedObjects();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- sal_uIntPtr nMarkNum=bBack ? 0 : nMarkAnz;
- if (bNext) {
- nMarkNum=((SdrMarkView*)this)->TryToFindMarkedObject(pObj0);
- if (nMarkNum==CONTAINER_ENTRY_NOTFOUND) return sal_False;
- if (!bBack) nMarkNum++;
+ rpObj = 0;
+ rnId = 0;
+
+ if(!IsGluePointEditMode())
+ {
+ return false;
}
- while (bBack ? nMarkNum<nMarkAnz : nMarkNum>0) {
- if (!bBack) nMarkNum--;
- const SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
+
+ SdrObject* pObj0=rpObj;
+ sal_uInt32 nId0 = rnId;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt32 nMarkNum(aSelection.size());
+
+ while(nMarkNum > 0)
+ {
+ nMarkNum--;
+ SdrObject* pObj = aSelection[nMarkNum];
const SdrGluePointList* pGPL=pObj->GetGluePointList();
- if (pGPL!=NULL) {
- sal_uInt16 nNum=pGPL->HitTest(rPnt,*pOut,pObj,bBack,bNext,nId0);
- if (nNum!=SDRGLUEPOINT_NOTFOUND)
+
+ if(pGPL)
+ {
+ const sal_uInt32 nNum(pGPL->GPLHitTest(rPnt, getHitTolLog(), sdr::legacy::GetSnapRange(*pObj), false, nId0));
+
+ if(SDRGLUEPOINT_NOTFOUND != nNum)
{
// #i38892#
const SdrGluePoint& rCandidate = (*pGPL)[nNum];
@@ -608,113 +437,111 @@ sal_Bool SdrMarkView::PickGluePoint(const Point& rPnt, SdrObject*& rpObj, sal_uI
{
rpObj=pObj;
rnId=(*pGPL)[nNum].GetId();
- rpPV=pPV;
- return sal_True;
+
+ return true;
}
}
}
- bNext=sal_False; // HitNextGluePoint nur beim ersten Obj
- if (bBack) nMarkNum++;
}
- return sal_False;
+
+ return false;
}
-sal_Bool SdrMarkView::MarkGluePoint(const SdrObject* pObj, sal_uInt16 nId, const SdrPageView* /*pPV*/, sal_Bool bUnmark)
+bool SdrMarkView::MarkGluePoint(const SdrObject* pObj, sal_uInt32 nId, bool bUnmark)
{
- if (!IsGluePointEditMode()) return sal_False;
- ForceUndirtyMrkPnt();
- sal_Bool bChgd=sal_False;
- if (pObj!=NULL) {
- sal_uIntPtr nMarkPos=TryToFindMarkedObject(pObj);
- if (nMarkPos!=CONTAINER_ENTRY_NOTFOUND) {
- SdrMark* pM=GetSdrMarkByIndex(nMarkPos);
- SdrUShortCont* pPts=bUnmark ? pM->GetMarkedGluePoints() : pM->ForceMarkedGluePoints();
- if (pPts!=NULL) {
- sal_uIntPtr nPointPos=pPts->GetPos(nId);
- if (!bUnmark && nPointPos==CONTAINER_ENTRY_NOTFOUND) {
- bChgd=sal_True;
- pPts->Insert(nId);
+ if(!IsGluePointEditMode())
+ {
+ return false;
+ }
+
+ bool bChgd(false);
+
+ if(pObj)
+ {
+ if(isSdrObjectSelected(*pObj))
+ {
+ sdr::selection::Indices aMarkedGluePoints(getSelectedGluesForSelectedSdrObject(*pObj));
+ sdr::selection::Indices::iterator aFound(aMarkedGluePoints.find(nId));
+ bool bGluePointsChanged(false);
+
+ if(bUnmark)
+ {
+ if(aFound != aMarkedGluePoints.end())
+ {
+ aMarkedGluePoints.erase(aFound);
+ bGluePointsChanged = true;
}
- if (bUnmark && nPointPos!=CONTAINER_ENTRY_NOTFOUND) {
- bChgd=sal_True;
- pPts->Remove(nPointPos);
+ }
+ else
+ {
+ if(aFound == aMarkedGluePoints.end())
+ {
+ aMarkedGluePoints.insert(nId);
+ bGluePointsChanged = true;
}
}
- } else {
+
+ if(bGluePointsChanged)
+ {
+ bChgd = true;
+ setSelectedGluesForSelectedSdrObject(*pObj, aMarkedGluePoints);
+ }
+ }
+ else
+ {
// Objekt implizit markieren ...
// ... fehlende Implementation
}
}
- if (bChgd) {
- AdjustMarkHdl();
- MarkListHasChanged();
- }
+
return bChgd;
}
-sal_Bool SdrMarkView::IsGluePointMarked(const SdrObject* pObj, sal_uInt16 nId) const
+bool SdrMarkView::IsGluePointMarked(const SdrObject& rObj, sal_uInt32 nId) const
{
- ForceUndirtyMrkPnt();
- sal_Bool bRet=sal_False;
- sal_uIntPtr nPos=((SdrMarkView*)this)->TryToFindMarkedObject(pObj); // casting auf NonConst
- if (nPos!=CONTAINER_ENTRY_NOTFOUND) {
- const SdrMark* pM=GetSdrMarkByIndex(nPos);
- const SdrUShortCont* pPts=pM->GetMarkedGluePoints();
- if (pPts!=NULL) {
- bRet=pPts->Exist(nId);
- }
- }
- return bRet;
+ return (0 != getSelectedGluesForSelectedSdrObject(rObj).count(nId));
}
-sal_Bool SdrMarkView::UnmarkGluePoint(const SdrHdl& rHdl)
+bool SdrMarkView::UnmarkGluePoint(const SdrHdl& rHdl)
{
- if (&rHdl!=NULL && rHdl.GetKind()==HDL_GLUE && rHdl.GetObj()!=NULL) {
- return MarkGluePoint(rHdl.GetObj(),(sal_uInt16)rHdl.GetObjHdlNum(),rHdl.GetPageView(),sal_True);
- } else return sal_False;
+ if(&rHdl && HDL_GLUE == rHdl.GetKind() && rHdl.GetObj())
+ {
+ return MarkGluePoint(rHdl.GetObj(), rHdl.GetObjHdlNum(), true);
+ }
+ else
+ {
+ return false;
+ }
}
-SdrHdl* SdrMarkView::GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) const
+SdrHdl* SdrMarkView::GetGluePointHdl(const SdrObject* pObj, sal_uInt32 nId) const
{
- ForceUndirtyMrkPnt();
- sal_uIntPtr nHdlAnz=aHdl.GetHdlCount();
- for (sal_uIntPtr nHdlNum=0; nHdlNum<nHdlAnz; nHdlNum++) {
- SdrHdl* pHdl=aHdl.GetHdl(nHdlNum);
+ const sal_uInt32 nHdlAnz(maViewHandleList.GetHdlCount());
+
+ for(sal_uInt32 nHdlNum(0); nHdlNum < nHdlAnz; nHdlNum++)
+ {
+ SdrHdl* pHdl = maViewHandleList.GetHdlByIndex(nHdlNum);
+
if (pHdl->GetObj()==pObj &&
- pHdl->GetKind()==HDL_GLUE &&
- pHdl->GetObjHdlNum()==nId ) return pHdl;
+ HDL_GLUE == pHdl->GetKind() &&
+ pHdl->GetObjHdlNum() == nId)
+ {
+ return pHdl;
+ }
}
- return NULL;
-}
-sal_Bool SdrMarkView::MarkNextGluePoint(sal_Bool /*bPrev*/)
-{
- ForceUndirtyMrkPnt();
- sal_Bool bChgd=sal_False;
- SortMarkedObjects();
- // ...
- if (bChgd) {
- MarkListHasChanged();
- }
- return bChgd;
+ return 0;
}
-sal_Bool SdrMarkView::MarkNextGluePoint(const Point& /*rPnt*/, sal_Bool /*bPrev*/)
+const basegfx::B2DRange& SdrMarkView::getMarkedGluePointRange() const
{
- ForceUndirtyMrkPnt();
- sal_Bool bChgd=sal_False;
- SortMarkedObjects();
- // ...
- if (bChgd) {
- MarkListHasChanged();
+ if(maMarkedGluePointRange.isEmpty())
+ {
+ impCreatePointRanges();
}
- return bChgd;
-}
-const Rectangle& SdrMarkView::GetMarkedGluePointsRect() const
-{
- ForceUndirtyMrkPnt();
- if (bMarkedPointsRectsDirty) ImpSetPointsRects();
- return aMarkedGluePointsRect;
+ return maMarkedGluePointRange;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index aa9fd6f6dbbe..50b9bdaed59b 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -23,6 +23,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
#include <svx/svdoashp.hxx>
#include "svx/unoapi.hxx"
#include <svx/unoshape.hxx>
@@ -48,7 +49,7 @@
#include <svx/xpoly.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdetc.hxx>
@@ -88,10 +89,8 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
-
-// #104018# replace macros above with type-safe methods
-inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); }
-inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
+#include <svx/svdlegacy.hxx>
+#include <svx/sdrtexthelpers.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -103,7 +102,7 @@ static MSO_SPT ImpGetCustomShapeType( const SdrObjCustomShape& rCustoShape )
{
MSO_SPT eRetValue = mso_sptNil;
- rtl::OUString aEngine( ( (SdrCustomShapeEngineItem&)rCustoShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE ) ).GetValue() );
+ rtl::OUString aEngine( ( (SfxStringItem&)rCustoShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE ) ).GetValue() );
if ( !aEngine.getLength() || aEngine.equalsAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) )
{
rtl::OUString sShapeType;
@@ -116,9 +115,9 @@ static MSO_SPT ImpGetCustomShapeType( const SdrObjCustomShape& rCustoShape )
return eRetValue;
};
-static sal_Bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape )
+static bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
MSO_SPT eShapeType( ImpGetCustomShapeType( rCustoShape ) );
switch( eShapeType )
{
@@ -126,7 +125,7 @@ static sal_Bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape )
case mso_sptBorderCallout1 : // 2 diag
case mso_sptBorderCallout2 : // 3
{
- bRet = sal_True;
+ bRet = true;
}
break;
/*
@@ -155,26 +154,26 @@ static sal_Bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape )
SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemSet& rOriginalSet)
{
SdrObject* pRetval = 0L;
- const sal_Bool bShadow(((SdrShadowItem&)rOriginalSet.Get(SDRATTR_SHADOW)).GetValue());
+ const bool bShadow(((SdrOnOffItem&)rOriginalSet.Get(SDRATTR_SHADOW)).GetValue());
if(bShadow)
{
// create a shadow representing object
- const sal_Int32 nXDist(((SdrShadowXDistItem&)(rOriginalSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
- const sal_Int32 nYDist(((SdrShadowYDistItem&)(rOriginalSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
- const ::Color aShadowColor(((SdrShadowColorItem&)(rOriginalSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
- const sal_uInt16 nShadowTransparence(((SdrShadowTransparenceItem&)(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
- pRetval = rOriginal.Clone();
+ const sal_Int32 nXDist(((SdrMetricItem&)(rOriginalSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
+ const sal_Int32 nYDist(((SdrMetricItem&)(rOriginalSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
+ const ::Color aShadowColor(((XColorItem&)(rOriginalSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
+ const sal_uInt16 nShadowTransparence(((SdrPercentItem&)(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ pRetval = rOriginal.CloneSdrObject();
DBG_ASSERT(pRetval, "ImpCreateShadowObjectClone: Could not clone object (!)");
// look for used stuff
SdrObjListIter aIterator(rOriginal);
- sal_Bool bLineUsed(sal_False);
- sal_Bool bAllFillUsed(sal_False);
- sal_Bool bSolidFillUsed(sal_False);
- sal_Bool bGradientFillUsed(sal_False);
- sal_Bool bHatchFillUsed(sal_False);
- sal_Bool bBitmapFillUsed(sal_False);
+ bool bLineUsed(false);
+ bool bAllFillUsed(false);
+ bool bSolidFillUsed(false);
+ bool bGradientFillUsed(false);
+ bool bHatchFillUsed(false);
+ bool bBitmapFillUsed(false);
while(aIterator.IsMore())
{
@@ -187,7 +186,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
if(XLINE_NONE != eLineStyle)
{
- bLineUsed = sal_True;
+ bLineUsed = true;
}
}
@@ -195,29 +194,29 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
{
if(!bSolidFillUsed && XFILL_SOLID == eFillStyle)
{
- bSolidFillUsed = sal_True;
+ bSolidFillUsed = true;
bAllFillUsed = (bSolidFillUsed || bGradientFillUsed || bHatchFillUsed || bBitmapFillUsed);
}
if(!bGradientFillUsed && XFILL_GRADIENT == eFillStyle)
{
- bGradientFillUsed = sal_True;
+ bGradientFillUsed = true;
bAllFillUsed = (bSolidFillUsed || bGradientFillUsed || bHatchFillUsed || bBitmapFillUsed);
}
if(!bHatchFillUsed && XFILL_HATCH == eFillStyle)
{
- bHatchFillUsed = sal_True;
+ bHatchFillUsed = true;
bAllFillUsed = (bSolidFillUsed || bGradientFillUsed || bHatchFillUsed || bBitmapFillUsed);
}
if(!bBitmapFillUsed && XFILL_BITMAP == eFillStyle)
{
- bBitmapFillUsed = sal_True;
+ bBitmapFillUsed = true;
bAllFillUsed = (bSolidFillUsed || bGradientFillUsed || bHatchFillUsed || bBitmapFillUsed);
}
}
}
// translate to shadow coordinates
- pRetval->NbcMove(Size(nXDist, nYDist));
+ sdr::legacy::MoveSdrObject(*pRetval, Size(nXDist, nYDist));
// set items as needed
SfxItemSet aTempSet(rOriginalSet);
@@ -229,9 +228,9 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
aTempSet.Put( SvxWritingModeItem( com::sun::star::text::WritingMode_LR_TB, SDRATTR_TEXTDIRECTION ) );
// no shadow
- aTempSet.Put(SdrShadowItem(sal_False));
- aTempSet.Put(SdrShadowXDistItem(0L));
- aTempSet.Put(SdrShadowYDistItem(0L));
+ aTempSet.Put(SdrOnOffItem(SDRATTR_SHADOW, false));
+ aTempSet.Put(SdrMetricItem(SDRATTR_SHADOWXDIST, 0L));
+ aTempSet.Put(SdrMetricItem(SDRATTR_SHADOWYDIST, 0L));
// line color and transparence like shadow
if(bLineUsed)
@@ -358,7 +357,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape )
{
Reference< XCustomShapeEngine > xCustomShapeEngine;
- String aEngine(((SdrCustomShapeEngineItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue());
+ String aEngine(((SfxStringItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue());
if ( !aEngine.Len() )
aEngine = String( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) );
@@ -404,7 +403,7 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectShadowFromCustomShape() const
if(pSdrObject)
{
const SfxItemSet& rOriginalSet = GetObjectItemSet();
- const sal_Bool bShadow(((SdrShadowItem&)rOriginalSet.Get( SDRATTR_SHADOW )).GetValue());
+ const bool bShadow(((SdrOnOffItem&)rOriginalSet.Get( SDRATTR_SHADOW )).GetValue());
if(bShadow)
{
@@ -418,10 +417,10 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectShadowFromCustomShape() const
return mpLastShadowGeometry;
}
-sal_Bool SdrObjCustomShape::IsTextPath() const
+bool SdrObjCustomShape::IsTextPath() const
{
const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
- sal_Bool bTextPathOn = sal_False;
+ bool bTextPathOn = false;
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
if ( pAny )
@@ -429,9 +428,9 @@ sal_Bool SdrObjCustomShape::IsTextPath() const
return bTextPathOn;
}
-sal_Bool SdrObjCustomShape::UseNoFillStyle() const
+bool SdrObjCustomShape::UseNoFillStyle() const
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
rtl::OUString sShapeType;
const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
SdrCustomShapeGeometryItem& rGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
@@ -443,53 +442,55 @@ sal_Bool SdrObjCustomShape::UseNoFillStyle() const
return bRet;
}
-sal_Bool SdrObjCustomShape::IsMirroredX() const
-{
- sal_Bool bMirroredX = sal_False;
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
- if ( pAny )
- *pAny >>= bMirroredX;
- return bMirroredX;
-}
-sal_Bool SdrObjCustomShape::IsMirroredY() const
-{
- sal_Bool bMirroredY = sal_False;
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
- if ( pAny )
- *pAny >>= bMirroredY;
- return bMirroredY;
-}
-void SdrObjCustomShape::SetMirroredX( const sal_Bool bMirrorX )
-{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- //com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
- PropertyValue aPropVal;
- aPropVal.Name = sMirroredX;
- aPropVal.Value <<= bMirrorX;
- aGeometryItem.SetPropertyValue( aPropVal );
- SetMergedItem( aGeometryItem );
-}
-void SdrObjCustomShape::SetMirroredY( const sal_Bool bMirrorY )
-{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- //com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
- PropertyValue aPropVal;
- aPropVal.Name = sMirroredY;
- aPropVal.Value <<= bMirrorY;
- aGeometryItem.SetPropertyValue( aPropVal );
- SetMergedItem( aGeometryItem );
-}
+// TTTT: MirroredX/Y removed
+//bool SdrObjCustomShape::IsMirroredX() const
+//{
+// bool bMirroredX = false;
+// SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+// const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+// com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
+// if ( pAny )
+// *pAny >>= bMirroredX;
+// return bMirroredX;
+//}
+//bool SdrObjCustomShape::IsMirroredY() const
+//{
+// bool bMirroredY = false;
+// SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+// const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
+// com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
+// if ( pAny )
+// *pAny >>= bMirroredY;
+// return bMirroredY;
+//}
+//void SdrObjCustomShape::SetMirroredX( const bool bMirrorX )
+//{
+// SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+// const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+// //com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
+// PropertyValue aPropVal;
+// aPropVal.Name = sMirroredX;
+// aPropVal.Value <<= bMirrorX;
+// aGeometryItem.SetPropertyValue( aPropVal );
+// SetMergedItem( aGeometryItem );
+//}
+//void SdrObjCustomShape::SetMirroredY( const bool bMirrorY )
+//{
+// SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+// const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
+// //com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
+// PropertyValue aPropVal;
+// aPropVal.Name = sMirroredY;
+// aPropVal.Value <<= bMirrorY;
+// aGeometryItem.SetPropertyValue( aPropVal );
+// SetMergedItem( aGeometryItem );
+//}
-double SdrObjCustomShape::GetObjectRotation() const
-{
- return fObjectRotation;
-}
+// TTTT: Probably obsolete
+//double SdrObjCustomShape::GetObjectRotation() const
+//{
+// return fObjectRotation;
+//}
double SdrObjCustomShape::GetExtraTextRotation() const
{
@@ -502,37 +503,22 @@ double SdrObjCustomShape::GetExtraTextRotation() const
*pAny >>= fExtraTextRotateAngle;
return fExtraTextRotateAngle;
}
-sal_Bool SdrObjCustomShape::GetTextBounds( Rectangle& rTextBound ) const
-{
- sal_Bool bRet = sal_False;
- Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine( this ) ); // a candidate for being cached
- if ( xCustomShapeEngine.is() )
- {
- awt::Rectangle aR( xCustomShapeEngine->getTextBounds() );
- if ( aR.Width || aR.Height )
- {
- rTextBound = Rectangle( Point( aR.X, aR.Y ), Size( aR.Width, aR.Height ) );
- bRet = sal_True;
- }
- }
- return bRet;
-}
-basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed )
+basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const SdrObjCustomShape* pCustomShape, const bool bBezierAllowed )
{
basegfx::B2DPolyPolygon aRetval;
- sal_Bool bRet = sal_False;
+ bool bRet = false;
Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine( pCustomShape ) );
if ( xCustomShapeEngine.is() )
{
com::sun::star::drawing::PolyPolygonBezierCoords aBezierCoords = xCustomShapeEngine->getLineGeometry();
try
{
- aRetval = SvxConvertPolyPolygonBezierToB2DPolyPolygon( &aBezierCoords );
+ aRetval = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(aBezierCoords);
if ( !bBezierAllowed && aRetval.areControlPointsUsed())
{
aRetval = basegfx::tools::adaptiveSubdivideByAngle(aRetval);
}
- bRet = sal_True;
+ bRet = true;
}
catch ( const com::sun::star::lang::IllegalArgumentException )
{
@@ -639,13 +625,11 @@ sdr::properties::BaseProperties* SdrObjCustomShape::CreateObjectSpecificProperti
return new sdr::properties::CustomShapeProperties(*this);
}
-TYPEINIT1(SdrObjCustomShape,SdrTextObj);
-SdrObjCustomShape::SdrObjCustomShape() :
- SdrTextObj(),
- fObjectRotation( 0.0 ),
- mpLastShadowGeometry(0L)
+SdrObjCustomShape::SdrObjCustomShape(SdrModel& rSdrModel)
+: SdrTextObj(rSdrModel, basegfx::B2DHomMatrix(), OBJ_TEXT, true),
+ // TTTT: fObjectRotation( 0.0 ),
+ mpLastShadowGeometry(0)
{
- bTextFrame = sal_True;
}
SdrObjCustomShape::~SdrObjCustomShape()
@@ -654,6 +638,39 @@ SdrObjCustomShape::~SdrObjCustomShape()
InvalidateRenderGeometry();
}
+void SdrObjCustomShape::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const SdrObjCustomShape* pSource = dynamic_cast< const SdrObjCustomShape* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrTextObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ aName = pSource->aName;
+ // TTTT: fObjectRotation = pSource->fObjectRotation;
+ InvalidateRenderGeometry();
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* SdrObjCustomShape::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SdrObjCustomShape* pClone = new SdrObjCustomShape(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
{
PropertyValue aPropVal;
@@ -1041,29 +1058,29 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
{
const rtl::OUString sPosition( RTL_CONSTASCII_USTRINGPARAM ( "Position" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.First, pData->nPositionX, sal_True, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.Second, pData->nPositionY, sal_True, sal_False );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.First, pData->nPositionX, true, true );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.Second, pData->nPositionY, true, false );
rPropValues[ n ].Name = sPosition;
rPropValues[ n++ ].Value <<= aPosition;
}
if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_X )
{
const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- sal_Bool bMirroredX = sal_True;
+ bool bMirroredX = true;
rPropValues[ n ].Name = sMirroredX;
rPropValues[ n++ ].Value <<= bMirroredX;
}
if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_Y )
{
const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- sal_Bool bMirroredY = sal_True;
+ bool bMirroredY = true;
rPropValues[ n ].Name = sMirroredY;
rPropValues[ n++ ].Value <<= bMirroredY;
}
if ( nFlags & MSDFF_HANDLE_FLAGS_SWITCHED )
{
const rtl::OUString sSwitched( RTL_CONSTASCII_USTRINGPARAM ( "Switched" ) );
- sal_Bool bSwitched = sal_True;
+ bool bSwitched = true;
rPropValues[ n ].Name = sSwitched;
rPropValues[ n++ ].Value <<= bSwitched;
}
@@ -1072,9 +1089,9 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
const rtl::OUString sPolar( RTL_CONSTASCII_USTRINGPARAM ( "Polar" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aCenter;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aCenter.First, pData->nCenterX,
- ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_X_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_X_IS_SPECIAL ) != 0, true );
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aCenter.Second, pData->nCenterY,
- ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_Y_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_Y_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sPolar;
rPropValues[ n++ ].Value <<= aCenter;
if ( nFlags & MSDFF_HANDLE_FLAGS_RADIUS_RANGE )
@@ -1084,7 +1101,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
const rtl::OUString sRadiusRangeMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMinimum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMinimum, pData->nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, true );
rPropValues[ n ].Name = sRadiusRangeMinimum;
rPropValues[ n++ ].Value <<= aRadiusRangeMinimum;
}
@@ -1093,7 +1110,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
const rtl::OUString sRadiusRangeMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMaximum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMaximum, pData->nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sRadiusRangeMaximum;
rPropValues[ n++ ].Value <<= aRadiusRangeMaximum;
}
@@ -1106,7 +1123,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
const rtl::OUString sRangeXMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMinimum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMinimum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMinimum, pData->nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, true );
rPropValues[ n ].Name = sRangeXMinimum;
rPropValues[ n++ ].Value <<= aRangeXMinimum;
}
@@ -1115,7 +1132,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
const rtl::OUString sRangeXMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMaximum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMaximum, pData->nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sRangeXMaximum;
rPropValues[ n++ ].Value <<= aRangeXMaximum;
}
@@ -1124,7 +1141,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
const rtl::OUString sRangeYMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMinimum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMinimum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMinimum, pData->nRangeYMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL ) != 0, true );
rPropValues[ n ].Name = sRangeYMinimum;
rPropValues[ n++ ].Value <<= aRangeYMinimum;
}
@@ -1133,7 +1150,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
const rtl::OUString sRangeYMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMaximum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMaximum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMaximum, pData->nRangeYMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sRangeYMaximum;
rPropValues[ n++ ].Value <<= aRangeYMaximum;
}
@@ -1146,9 +1163,9 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
SetMergedItem( aGeometryItem );
}
-sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) const
+bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) const
{
- sal_Bool bIsDefaultGeometry = sal_False;
+ bool bIsDefaultGeometry = false;
PropertyValue aPropVal;
rtl::OUString sShapeType;
@@ -1174,7 +1191,7 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
{
if ( ( aViewBox.Width == pDefCustomShape->nCoordWidth )
&& ( aViewBox.Height == pDefCustomShape->nCoordHeight ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
break;
@@ -1196,11 +1213,11 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( seqCoordinates2[ i ].Second, pDefCustomShape->pVertices[ i ].nValB );
}
if ( seqCoordinates1 == seqCoordinates2 )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else if ( pDefCustomShape && ( ( pDefCustomShape->nVertices == 0 ) || ( pDefCustomShape->pVertices == 0 ) ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
@@ -1221,11 +1238,11 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( seqGluePoints2[ i ].Second, pDefCustomShape->pGluePoints[ i ].nValB );
}
if ( seqGluePoints1 == seqGluePoints2 )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else if ( pDefCustomShape && ( pDefCustomShape->nGluePoints == 0 ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
@@ -1359,7 +1376,7 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
}
}
if ( seqSegments1 == seqSegments2 )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else
@@ -1371,13 +1388,13 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
&& ( seqSegments1[ 1 ].Command == EnhancedCustomShapeSegmentCommand::LINETO )
&& ( seqSegments1[ 2 ].Command == EnhancedCustomShapeSegmentCommand::CLOSESUBPATH )
&& ( seqSegments1[ 3 ].Command == EnhancedCustomShapeSegmentCommand::ENDSUBPATH ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
}
}
else if ( pDefCustomShape && ( ( pDefCustomShape->nElements == 0 ) || ( pDefCustomShape->pElements == 0 ) ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
@@ -1391,11 +1408,11 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
if ( *pAny >>= nStretchX )
{
if ( pDefCustomShape->nXRef == nStretchX )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else if ( pDefCustomShape && ( pDefCustomShape->nXRef == DEFAULT_MINIMUM_SIGNED_COMPARE ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
@@ -1409,11 +1426,11 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
if ( *pAny >>= nStretchY )
{
if ( pDefCustomShape->nYRef == nStretchY )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else if ( pDefCustomShape && ( pDefCustomShape->nYRef == DEFAULT_MINIMUM_SIGNED_COMPARE ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
@@ -1434,11 +1451,11 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
seqEquations2[ i ] = EnhancedCustomShape2d::GetEquation( pData->nFlags, pData->nVal[ 0 ], pData->nVal[ 1 ], pData->nVal[ 2 ] );
if ( seqEquations1 == seqEquations2 )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else if ( pDefCustomShape && ( ( pDefCustomShape->nCalculation == 0 ) || ( pDefCustomShape->pCalculation == 0 ) ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
@@ -1462,11 +1479,11 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( seqTextFrames2[ i ].BottomRight.Second, pRectangles->nPairB.nValB );
}
if ( seqTextFrames1 == seqTextFrames2 )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else if ( pDefCustomShape && ( ( pDefCustomShape->nTextRect == 0 ) || ( pDefCustomShape->pTextRect == 0 ) ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
@@ -1523,29 +1540,29 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
{
const rtl::OUString sPosition( RTL_CONSTASCII_USTRINGPARAM ( "Position" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aPosition;
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.First, pData->nPositionX, sal_True, sal_True );
- EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.Second, pData->nPositionY, sal_True, sal_False );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.First, pData->nPositionX, true, true );
+ EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aPosition.Second, pData->nPositionY, true, false );
rPropValues[ n ].Name = sPosition;
rPropValues[ n++ ].Value <<= aPosition;
}
if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_X )
{
const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- sal_Bool bMirroredX = sal_True;
+ bool bMirroredX = true;
rPropValues[ n ].Name = sMirroredX;
rPropValues[ n++ ].Value <<= bMirroredX;
}
if ( nFlags & MSDFF_HANDLE_FLAGS_MIRRORED_Y )
{
const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- sal_Bool bMirroredY = sal_True;
+ bool bMirroredY = true;
rPropValues[ n ].Name = sMirroredY;
rPropValues[ n++ ].Value <<= bMirroredY;
}
if ( nFlags & MSDFF_HANDLE_FLAGS_SWITCHED )
{
const rtl::OUString sSwitched( RTL_CONSTASCII_USTRINGPARAM ( "Switched" ) );
- sal_Bool bSwitched = sal_True;
+ bool bSwitched = true;
rPropValues[ n ].Name = sSwitched;
rPropValues[ n++ ].Value <<= bSwitched;
}
@@ -1554,9 +1571,9 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
const rtl::OUString sPolar( RTL_CONSTASCII_USTRINGPARAM ( "Polar" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aCenter;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aCenter.First, pData->nCenterX,
- ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_X_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_X_IS_SPECIAL ) != 0, true );
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aCenter.Second, pData->nCenterY,
- ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_Y_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_CENTER_Y_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sPolar;
rPropValues[ n++ ].Value <<= aCenter;
if ( nFlags & MSDFF_HANDLE_FLAGS_RADIUS_RANGE )
@@ -1566,7 +1583,7 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
const rtl::OUString sRadiusRangeMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMinimum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMinimum, pData->nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, true );
rPropValues[ n ].Name = sRadiusRangeMinimum;
rPropValues[ n++ ].Value <<= aRadiusRangeMinimum;
}
@@ -1575,7 +1592,7 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
const rtl::OUString sRadiusRangeMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RadiusRangeMaximum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRadiusRangeMaximum, pData->nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sRadiusRangeMaximum;
rPropValues[ n++ ].Value <<= aRadiusRangeMaximum;
}
@@ -1588,7 +1605,7 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
const rtl::OUString sRangeXMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMinimum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMinimum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMinimum, pData->nRangeXMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL ) != 0, true );
rPropValues[ n ].Name = sRangeXMinimum;
rPropValues[ n++ ].Value <<= aRangeXMinimum;
}
@@ -1597,7 +1614,7 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
const rtl::OUString sRangeXMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeXMaximum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeXMaximum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeXMaximum, pData->nRangeXMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sRangeXMaximum;
rPropValues[ n++ ].Value <<= aRangeXMaximum;
}
@@ -1606,7 +1623,7 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
const rtl::OUString sRangeYMinimum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMinimum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMinimum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMinimum, pData->nRangeYMin,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL ) != 0, sal_True );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL ) != 0, true );
rPropValues[ n ].Name = sRangeYMinimum;
rPropValues[ n++ ].Value <<= aRangeYMinimum;
}
@@ -1615,18 +1632,18 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
const rtl::OUString sRangeYMaximum( RTL_CONSTASCII_USTRINGPARAM ( "RangeYMaximum" ) );
::com::sun::star::drawing::EnhancedCustomShapeParameter aRangeYMaximum;
EnhancedCustomShape2d::SetEnhancedCustomShapeHandleParameter( aRangeYMaximum, pData->nRangeYMax,
- ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL ) != 0, sal_False );
+ ( nFlags & MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL ) != 0, false );
rPropValues[ n ].Name = sRangeYMaximum;
rPropValues[ n++ ].Value <<= aRangeYMaximum;
}
}
}
if ( seqHandles1 == seqHandles2 )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
}
else if ( pDefCustomShape && ( ( pDefCustomShape->nHandles == 0 ) || ( pDefCustomShape->pHandles == 0 ) ) )
- bIsDefaultGeometry = sal_True;
+ bIsDefaultGeometry = true;
}
break;
}
@@ -1635,18 +1652,18 @@ sal_Bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType )
void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bResizeFreeAllowed=fObjectRotation == 0.0;
- rInfo.bResizePropAllowed=sal_True;
- rInfo.bRotateFreeAllowed=sal_True;
- rInfo.bRotate90Allowed =sal_True;
- rInfo.bMirrorFreeAllowed=sal_True;
- rInfo.bMirror45Allowed =sal_True;
- rInfo.bMirror90Allowed =sal_True;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed =sal_True;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bNoContortion =sal_True;
+ rInfo.mbResizeFreeAllowed = basegfx::fTools::equalZero(getSdrObjectRotate()); // TTTT: 0.0 == fObjectRotation;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = true;
+ rInfo.mbRotate90Allowed = true;
+ rInfo.mbMirrorFreeAllowed = true;
+ rInfo.mbMirror45Allowed = true;
+ rInfo.mbMirror90Allowed = true;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = true;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbNoContortion = true;
// #i37011#
if ( mXRenderedCustomShape.is() )
@@ -1656,8 +1673,8 @@ void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
// #i37262#
// Iterate self over the contained objects, since there are combinations of
- // polygon and curve objects. In that case, aInfo.bCanConvToPath and
- // aInfo.bCanConvToPoly would be false. What is needed here is an or, not an and.
+ // polygon and curve objects. In that case, aInfo.mbCanConvToPath and
+ // aInfo.mbCanConvToPoly would be false. What is needed here is an or, not an and.
SdrObjListIter aIterator(*pRenderedCustomShape);
while(aIterator.IsMore())
{
@@ -1667,374 +1684,75 @@ void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
// set path and poly conversion if one is possible since
// this object will first be broken
- const sal_Bool bCanConvToPathOrPoly(aInfo.bCanConvToPath || aInfo.bCanConvToPoly);
- if(rInfo.bCanConvToPath != bCanConvToPathOrPoly)
+ const bool bCanConvToPathOrPoly(aInfo.mbCanConvToPath || aInfo.mbCanConvToPoly);
+
+ if(rInfo.mbCanConvToPath != bCanConvToPathOrPoly)
{
- rInfo.bCanConvToPath = bCanConvToPathOrPoly;
+ rInfo.mbCanConvToPath = bCanConvToPathOrPoly;
}
- if(rInfo.bCanConvToPoly != bCanConvToPathOrPoly)
+ if(rInfo.mbCanConvToPoly != bCanConvToPathOrPoly)
{
- rInfo.bCanConvToPoly = bCanConvToPathOrPoly;
+ rInfo.mbCanConvToPoly = bCanConvToPathOrPoly;
}
- if(rInfo.bCanConvToContour != aInfo.bCanConvToContour)
+ if(rInfo.mbCanConvToContour != aInfo.mbCanConvToContour)
{
- rInfo.bCanConvToContour = aInfo.bCanConvToContour;
+ rInfo.mbCanConvToContour = aInfo.mbCanConvToContour;
}
}
}
}
}
-void SdrObjCustomShape::SetModel(SdrModel* pNewModel)
-{
- SdrTextObj::SetModel(pNewModel);
- mXRenderedCustomShape.clear();
-}
-
sal_uInt16 SdrObjCustomShape::GetObjIdentifier() const
{
return sal_uInt16(OBJ_CUSTOMSHAPE);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrObjCustomShape::RecalcSnapRect()
-{
- SdrTextObj::RecalcSnapRect();
-}
-const Rectangle& SdrObjCustomShape::GetSnapRect() const
-{
- return SdrTextObj::GetSnapRect();
-}
-const Rectangle& SdrObjCustomShape::GetCurrentBoundRect() const
-{
- return SdrTextObj::GetCurrentBoundRect();
-}
-const Rectangle& SdrObjCustomShape::GetLogicRect() const
-{
- return SdrTextObj::GetLogicRect();
-}
-void SdrObjCustomShape::NbcSetSnapRect( const Rectangle& rRect )
-{
- aRect=rRect;
- ImpJustifyRect(aRect);
- InvalidateRenderGeometry();
- Rectangle aTextBound( aRect );
- if ( GetTextBounds( aTextBound ) )
- {
- if ( pModel==NULL || !pModel->IsPasteResize() )
- {
- long nHDist=GetTextLeftDistance()+GetTextRightDistance();
- long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
- long nTWdt=aTextBound.GetWidth ()-1-nHDist; if (nTWdt<0) nTWdt=0;
- long nTHgt=aTextBound.GetHeight()-1-nVDist; if (nTHgt<0) nTHgt=0;
- if ( IsAutoGrowWidth() )
- NbcSetMinTextFrameWidth( nTWdt );
- if ( IsAutoGrowHeight() )
- NbcSetMinTextFrameHeight( nTHgt );
- NbcAdjustTextFrameWidthAndHeight();
- }
- }
- ImpCheckShear();
- SetRectsDirty();
- SetChanged();
-}
-void SdrObjCustomShape::SetSnapRect( const Rectangle& rRect )
-{
- Rectangle aBoundRect0;
- if ( pUserCall )
- aBoundRect0 = GetLastBoundRect();
- NbcSetSnapRect( rRect );
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
-}
-void SdrObjCustomShape::NbcSetLogicRect( const Rectangle& rRect )
-{
- aRect = rRect;
- ImpJustifyRect( aRect );
- InvalidateRenderGeometry();
- Rectangle aTextBound( aRect );
- if ( GetTextBounds( aTextBound ) )
- {
- long nHDist=GetTextLeftDistance()+GetTextRightDistance();
- long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
-
- long nTWdt=aTextBound.GetWidth()-1-nHDist; if (nTWdt<0) nTWdt=0;
- long nTHgt=aTextBound.GetHeight()-1-nVDist; if (nTHgt<0) nTHgt=0;
- if ( IsAutoGrowWidth() )
- NbcSetMinTextFrameWidth( nTWdt );
- if ( IsAutoGrowHeight() )
- NbcSetMinTextFrameHeight( nTHgt );
- NbcAdjustTextFrameWidthAndHeight();
- }
- SetRectsDirty();
- SetChanged();
-}
-void SdrObjCustomShape::SetLogicRect( const Rectangle& rRect )
-{
- Rectangle aBoundRect0;
- if ( pUserCall )
- aBoundRect0 = GetLastBoundRect();
- NbcSetLogicRect(rRect);
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
-}
-void SdrObjCustomShape::Move( const Size& rSiz )
-{
- if ( rSiz.Width() || rSiz.Height() )
- {
- Rectangle aBoundRect0;
- if ( pUserCall )
- aBoundRect0 = GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcMove(rSiz);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
- }
-}
-void SdrObjCustomShape::NbcMove( const Size& rSiz )
-{
- SdrTextObj::NbcMove( rSiz );
- if ( mXRenderedCustomShape.is() )
- {
- SdrObject* pRenderedCustomShape = GetSdrObjectFromXShape( mXRenderedCustomShape );
- if ( pRenderedCustomShape )
- {
- // #i97149# the visualisation shape needs to be informed
- // about change, too
- pRenderedCustomShape->ActionChanged();
- pRenderedCustomShape->NbcMove( rSiz );
- }
- }
+void SdrObjCustomShape::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
+{
+ // call parent
+ SdrTextObj::setSdrObjectTransformation(rTransformation);
+
+ // TTTT: extract mirror flags and trigger SetMirroredX/SetMirroredY
+ // const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
+ // PropertyValue aPropVal;
+ // aPropVal.Name = sMirroredX;
+ // aPropVal.Value <<= bHorz;
+ // aGeometryItem.SetPropertyValue( aPropVal );
+
+ // TTTT: extra-actions from old NbcSetSnapRect
+
+ // TTTT: extra evtl. adapt InteractionHandles
+ //std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
+ //while ( aIter != aInteractionHandles.end() )
+ //{
+ // try
+ // {
+ // if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_FIXED )
+ // aIter->xInteraction->setControllerPosition( aIter->aPosition );
+ // if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X )
+ // {
+ // sal_Int32 nX = ( aIter->aPosition.X - aOld.Left() ) + aRect.Left();
+ // aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( nX, aIter->xInteraction->getPosition().Y ) );
+ // }
+ // if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y )
+ // {
+ // sal_Int32 nY = ( aIter->aPosition.Y - aOld.Top() ) + aRect.Top();
+ // aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( aIter->xInteraction->getPosition().X, nY ) );
+ // }
+ // }
+ // catch ( const uno::RuntimeException& )
+ // {
+ // }
+ // aIter++;
+ //}
+
+ // TTTT: fObjectRotation?
- // #i37011# adapt geometry shadow
- if(mpLastShadowGeometry)
- {
- mpLastShadowGeometry->NbcMove( rSiz );
- }
-}
-void SdrObjCustomShape::Resize( const Point& rRef, const Fraction& xFact, const Fraction& yFact )
-{
- SdrTextObj::Resize( rRef, xFact, yFact );
-}
-
-void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, const Fraction& ryFact )
-{
- Fraction xFact( rxFact );
- Fraction yFact( ryFact );
-
- // taking care of handles that should not been changed
- Rectangle aOld( aRect );
- std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
-
- SdrTextObj::NbcResize( rRef, xFact, yFact );
-
- if ( ( xFact.GetNumerator() != xFact.GetDenominator() )
- || ( yFact.GetNumerator()!= yFact.GetDenominator() ) )
- {
- if ( ( ( xFact.GetNumerator() < 0 ) && ( xFact.GetDenominator() > 0 ) ) ||
- ( ( xFact.GetNumerator() > 0 ) && ( xFact.GetDenominator() < 0 ) ) )
- {
- SetMirroredX( IsMirroredX() == sal_False );
- }
- if ( ( ( yFact.GetNumerator() < 0 ) && ( yFact.GetDenominator() > 0 ) ) ||
- ( ( yFact.GetNumerator() > 0 ) && ( yFact.GetDenominator() < 0 ) ) )
- {
- SetMirroredY( IsMirroredY() == sal_False );
- }
- }
-
- std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
- while ( aIter != aInteractionHandles.end() )
- {
- try
- {
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X )
- {
- sal_Int32 nX = ( aIter->aPosition.X - aOld.Left() ) + aRect.Left();
- aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( nX, aIter->xInteraction->getPosition().Y ) );
- }
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y )
- {
- sal_Int32 nY = ( aIter->aPosition.Y - aOld.Top() ) + aRect.Top();
- aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( aIter->xInteraction->getPosition().X, nY ) );
- }
- }
- catch ( const uno::RuntimeException& )
- {
- }
- aIter++;
- }
- InvalidateRenderGeometry();
-}
-void SdrObjCustomShape::NbcRotate( const Point& rRef, long nWink, double sn, double cs )
-{
- sal_Bool bMirroredX = IsMirroredX();
- sal_Bool bMirroredY = IsMirroredY();
-
- fObjectRotation = fmod( fObjectRotation, 360.0 );
- if ( fObjectRotation < 0 )
- fObjectRotation = 360 + fObjectRotation;
-
- // the rotation angle for ashapes is stored in fObjectRotation, this rotation
- // has to be applied to the text object (which is internally using aGeo.nWink).
- SdrTextObj::NbcRotate( aRect.TopLeft(), -aGeo.nDrehWink, // retrieving the unrotated text object
- sin( (-aGeo.nDrehWink) * F_PI18000 ),
- cos( (-aGeo.nDrehWink) * F_PI18000 ) );
- aGeo.nDrehWink = 0; // resetting aGeo data
- aGeo.RecalcSinCos();
-
- long nW = (long)( fObjectRotation * 100 ); // applying our object rotation
- if ( bMirroredX )
- nW = 36000 - nW;
- if ( bMirroredY )
- nW = 18000 - nW;
- nW = nW % 36000;
- if ( nW < 0 )
- nW = 36000 + nW;
- SdrTextObj::NbcRotate( aRect.TopLeft(), nW, // applying text rotation
- sin( nW * F_PI18000 ),
- cos( nW * F_PI18000 ) );
-
- int nSwap = 0;
- if ( bMirroredX )
- nSwap ^= 1;
- if ( bMirroredY )
- nSwap ^= 1;
-
- double fWink = nWink; // updating to our new object rotation
- fWink /= 100.0;
- fObjectRotation = fmod( nSwap ? fObjectRotation - fWink : fObjectRotation + fWink, 360.0 );
- if ( fObjectRotation < 0 )
- fObjectRotation = 360 + fObjectRotation;
-
- SdrTextObj::NbcRotate( rRef, nWink, sn, cs ); // applying text rotation
- InvalidateRenderGeometry();
-}
-
-void SdrObjCustomShape::NbcMirror( const Point& rRef1, const Point& rRef2 )
-{
- // storing horizontal and vertical flipping without modifying the rotate angle
-
- sal_Bool bHorz = sal_False;
- sal_Bool bVert = sal_False;
- if ( rRef1.X() == rRef2.X() )
- bHorz = sal_True;
- if ( rRef1.Y() == rRef2.Y() )
- bVert = sal_True;
- if ( !bHorz && !bVert )
- bHorz = bVert = sal_True;
-
- if ( bHorz || bVert )
- {
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-
- /////////////////
- // "MirroredX" //
- /////////////////
- if ( bHorz )
- {
- const rtl::OUString sMirroredX( RTL_CONSTASCII_USTRINGPARAM ( "MirroredX" ) );
- com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX );
- if ( pAny )
- {
- sal_Bool bFlip = sal_Bool();
- if ( *pAny >>= bFlip )
- {
- if ( bFlip )
- bHorz = sal_False;
- }
- }
- PropertyValue aPropVal;
- aPropVal.Name = sMirroredX;
- aPropVal.Value <<= bHorz;
- aGeometryItem.SetPropertyValue( aPropVal );
- }
-
- /////////////////
- // "MirroredY" //
- /////////////////
- if ( bVert )
- {
- const rtl::OUString sMirroredY( RTL_CONSTASCII_USTRINGPARAM ( "MirroredY" ) );
- com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY );
- if ( pAny )
- {
- sal_Bool bFlip = sal_Bool();
- if ( *pAny >>= bFlip )
- {
- if ( bFlip )
- bVert = sal_False;
- }
- }
- PropertyValue aPropVal;
- aPropVal.Name = sMirroredY;
- aPropVal.Value <<= bVert;
- aGeometryItem.SetPropertyValue( aPropVal );
- }
- SetMergedItem( aGeometryItem );
- }
- SdrTextObj::NbcMirror( rRef1, rRef2 );
- InvalidateRenderGeometry();
-}
-
-void SdrObjCustomShape::Shear( const Point& rRef, long nWink, double tn, FASTBOOL bVShear )
-{
- SdrTextObj::Shear( rRef, nWink, tn, bVShear );
- InvalidateRenderGeometry();
-}
-void SdrObjCustomShape::NbcShear( const Point& rRef, long nWink, double tn, FASTBOOL bVShear )
-{
- long nDrehWink = aGeo.nDrehWink;
- if ( nDrehWink )
- {
- aGeo.nDrehWink = -nDrehWink;
- aGeo.RecalcSinCos();
- NbcRotate( rRef, aGeo.nDrehWink, aGeo.nSin, aGeo.nCos );
- }
- SdrTextObj::NbcShear(rRef,nWink,tn,bVShear);
- if ( nDrehWink )
- {
- aGeo.nDrehWink = nDrehWink;
- aGeo.RecalcSinCos();
- Rotate( rRef, aGeo.nDrehWink, aGeo.nSin, aGeo.nCos );
- }
- InvalidateRenderGeometry();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrGluePoint SdrObjCustomShape::GetVertexGluePoint(sal_uInt16 nPosNum) const
-{
- sal_Int32 nWdt = ImpGetLineWdt(); // #i25616# ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue();
-
- // #i25616#
- if(!LineIsOutsideGeometry())
- {
- nWdt++;
- nWdt /= 2;
- }
-
- Point aPt;
- switch (nPosNum) {
- case 0: aPt=aRect.TopCenter(); aPt.Y()-=nWdt; break;
- case 1: aPt=aRect.RightCenter(); aPt.X()+=nWdt; break;
- case 2: aPt=aRect.BottomCenter(); aPt.Y()+=nWdt; break;
- case 3: aPt=aRect.LeftCenter(); aPt.X()-=nWdt; break;
- }
- if (aGeo.nShearWink!=0) ShearPoint(aPt,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoint(aPt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- aPt-=GetSnapRect().Center();
- SdrGluePoint aGP(aPt);
- aGP.SetPercent(sal_False);
- return aGP;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -2062,58 +1780,21 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
SdrGluePointList aNewList;
sal_uInt16 a;
+ // build transform matrix from helper object to local
+ basegfx::B2DHomMatrix aTransFromHelperToLocal(pSdrObject->getSdrObjectTransformation());
+ aTransFromHelperToLocal.invert();
+ aTransFromHelperToLocal = getSdrObjectTransformation() * aTransFromHelperToLocal;
+
for(a = 0; a < pSource->GetCount(); a++)
{
SdrGluePoint aCopy((*pSource)[a]);
- aCopy.SetUserDefined(sal_False);
- aNewList.Insert(aCopy);
- }
+ aCopy.SetUserDefined(false);
- sal_Bool bMirroredX = IsMirroredX();
- sal_Bool bMirroredY = IsMirroredY();
-
- long nShearWink = aGeo.nShearWink;
- double fTan = aGeo.nTan;
-
- if ( aGeo.nDrehWink || nShearWink || bMirroredX || bMirroredY )
- {
- Polygon aPoly( aRect );
- if( nShearWink )
- {
- sal_uInt16 nPointCount=aPoly.GetSize();
- for (sal_uInt16 i=0; i<nPointCount; i++)
- ShearPoint(aPoly[i],aRect.Center(), fTan, sal_False );
- }
- if ( aGeo.nDrehWink )
- aPoly.Rotate( aRect.Center(), aGeo.nDrehWink / 10 );
-
- Rectangle aBoundRect( aPoly.GetBoundRect() );
- sal_Int32 nXDiff = aBoundRect.Left() - aRect.Left();
- sal_Int32 nYDiff = aBoundRect.Top() - aRect.Top();
-
- if (nShearWink&&((bMirroredX&&!bMirroredY)||(bMirroredY&&!bMirroredX)))
- {
- nShearWink = -nShearWink;
- fTan = -fTan;
- }
+ basegfx::B2DPoint aGluePos(aCopy.GetPos());
+ aGluePos *= aTransFromHelperToLocal;
+ aCopy.SetPos(aGluePos);
- Point aRef( aRect.GetWidth() / 2, aRect.GetHeight() / 2 );
- for ( a = 0; a < aNewList.GetCount(); a++ )
- {
- SdrGluePoint& rPoint = aNewList[ a ];
- Point aGlue( rPoint.GetPos() );
- if ( nShearWink )
- ShearPoint( aGlue, aRef, fTan );
-
- RotatePoint( aGlue, aRef, sin( fObjectRotation * F_PI180 ), cos( fObjectRotation * F_PI180 ) );
- if ( bMirroredX )
- aGlue.X() = aRect.GetWidth() - aGlue.X();
- if ( bMirroredY )
- aGlue.Y() = aRect.GetHeight() - aGlue.Y();
- aGlue.X() -= nXDiff;
- aGlue.Y() -= nYDiff;
- rPoint.SetPos( aGlue );
- }
+ aNewList.Insert(aCopy);
}
for(a = 0; a < pList->GetCount(); a++)
@@ -2130,9 +1811,9 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
// GluePointList should not be set, but be delivered by using GetGluePointList(),
// maybe on demand. Since the local object is changed here, this is assumed to
// be a result of GetGluePointList and thus the list is copied
- if(pPlusData)
+ if(mpPlusData)
{
- *pPlusData->pGluePoints = aNewList;
+ *mpPlusData->mpGluePoints = aNewList;
}
}
}
@@ -2147,13 +1828,6 @@ const SdrGluePointList* SdrObjCustomShape::GetGluePointList() const
}
// #i38892#
-//SdrGluePointList* SdrObjCustomShape::GetGluePointList()
-//{
-// ImpCheckCustomGluePointsAreAdded();
-// return SdrTextObj::GetGluePointList();
-//}
-
-// #i38892#
SdrGluePointList* SdrObjCustomShape::ForceGluePointList()
{
if(SdrTextObj::ForceGluePointList())
@@ -2168,46 +1842,30 @@ SdrGluePointList* SdrObjCustomShape::ForceGluePointList()
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_uInt32 SdrObjCustomShape::GetHdlCount() const
+void SdrObjCustomShape::AddToHdlList(SdrHdlList& rHdlList) const
{
- const sal_uInt32 nBasicHdlCount(SdrTextObj::GetHdlCount());
- std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
- return ( aInteractionHandles.size() + nBasicHdlCount );
-}
+ // add handles from parent object
+ SdrTextObj::AddToHdlList(rHdlList);
-SdrHdl* SdrObjCustomShape::GetHdl( sal_uInt32 nHdlNum ) const
-{
- SdrHdl* pH = NULL;
- const sal_uInt32 nBasicHdlCount(SdrTextObj::GetHdlCount());
+ // add own handles
+ std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
- if ( nHdlNum < nBasicHdlCount )
- pH = SdrTextObj::GetHdl( nHdlNum );
- else
+ for(sal_uInt32 a(0); a < aInteractionHandles.size(); a++)
{
- std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
- const sal_uInt32 nCustomShapeHdlNum(nHdlNum - nBasicHdlCount);
-
- if ( nCustomShapeHdlNum < aInteractionHandles.size() )
+ if(aInteractionHandles[a].xInteraction.is())
{
- if ( aInteractionHandles[ nCustomShapeHdlNum ].xInteraction.is() )
+ try
+ {
+ const com::sun::star::awt::Point aPosition(aInteractionHandles[a].xInteraction->getPosition());
+ SdrHdl* pHdl = new SdrHdl(rHdlList, this, HDL_CUSTOMSHAPE1, basegfx::B2DPoint(aPosition.X, aPosition.Y));
+ pHdl->SetPointNum(a);
+ }
+ catch ( const uno::RuntimeException& )
{
- try
- {
- com::sun::star::awt::Point aPosition( aInteractionHandles[ nCustomShapeHdlNum ].xInteraction->getPosition() );
- pH = new SdrHdl( Point( aPosition.X, aPosition.Y ), HDL_CUSTOMSHAPE1 );
- pH->SetPointNum( nCustomShapeHdlNum );
- pH->SetObj( (SdrObject*)this );
- }
- catch ( const uno::RuntimeException& )
- {
- }
}
}
}
- return pH;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -2219,7 +1877,7 @@ bool SdrObjCustomShape::hasSpecialDrag() const
bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
if(pHdl && HDL_CUSTOMSHAPE1 == pHdl->GetKind())
{
@@ -2228,7 +1886,7 @@ bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const
}
else
{
- const SdrHdl* pHdl2 = rDrag.GetHdl();
+ const SdrHdl* pHdl2 = rDrag.GetActiveHdl();
const SdrHdlKind eHdl((pHdl2 == NULL) ? HDL_MOVE : pHdl2->GetKind());
switch( eHdl )
@@ -2255,103 +1913,7 @@ bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const
return true;
}
-void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObjCustomShape* pObj ) const
-{
- Rectangle aOld( pObj->aRect );
- sal_Bool bOldMirroredX( pObj->IsMirroredX() );
- sal_Bool bOldMirroredY( pObj->IsMirroredY() );
-
- Rectangle aNewRect( rNewRect );
- aNewRect.Justify();
-
- std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( pObj ) );
-
- GeoStat aGeoStat( pObj->GetGeoStat() );
- if ( aNewRect.TopLeft()!= pObj->aRect.TopLeft() &&
- ( pObj->aGeo.nDrehWink || pObj->aGeo.nShearWink ) )
- {
- Point aNewPos( aNewRect.TopLeft() );
- if ( pObj->aGeo.nShearWink ) ShearPoint( aNewPos, aOld.TopLeft(), aGeoStat.nTan );
- if ( pObj->aGeo.nDrehWink ) RotatePoint(aNewPos, aOld.TopLeft(), aGeoStat.nSin, aGeoStat.nCos );
- aNewRect.SetPos( aNewPos );
- }
- if ( aNewRect != pObj->aRect )
- {
- pObj->SetLogicRect( aNewRect );
- pObj->InvalidateRenderGeometry();
-
- if ( rNewRect.Left() > rNewRect.Right() )
- {
- Point aTop( ( pObj->GetSnapRect().Left() + pObj->GetSnapRect().Right() ) >> 1, pObj->GetSnapRect().Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pObj->NbcMirror( aTop, aBottom );
- }
- if ( rNewRect.Top() > rNewRect.Bottom() )
- {
- Point aLeft( pObj->GetSnapRect().Left(), ( pObj->GetSnapRect().Top() + pObj->GetSnapRect().Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pObj->NbcMirror( aLeft, aRight );
- }
-
- std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
- while ( aIter != aInteractionHandles.end() )
- {
- try
- {
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X )
- {
- sal_Int32 nX;
- if ( bOldMirroredX )
- {
- nX = ( aIter->aPosition.X - aOld.Right() );
- if ( rNewRect.Left() > rNewRect.Right() )
- nX = pObj->aRect.Left() - nX;
- else
- nX += pObj->aRect.Right();
- }
- else
- {
- nX = ( aIter->aPosition.X - aOld.Left() );
- if ( rNewRect.Left() > rNewRect.Right() )
- nX = pObj->aRect.Right() - nX;
- else
- nX += pObj->aRect.Left();
- }
- aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( nX, aIter->xInteraction->getPosition().Y ) );
- }
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y )
- {
- sal_Int32 nY;
- if ( bOldMirroredY )
- {
- nY = ( aIter->aPosition.Y - aOld.Bottom() );
- if ( rNewRect.Top() > rNewRect.Bottom() )
- nY = pObj->aRect.Top() - nY;
- else
- nY += pObj->aRect.Bottom();
- }
- else
- {
- nY = ( aIter->aPosition.Y - aOld.Top() );
- if ( rNewRect.Top() > rNewRect.Bottom() )
- nY = pObj->aRect.Bottom() - nY;
- else
- nY += pObj->aRect.Top();
- }
- aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( aIter->xInteraction->getPosition().X, nY ) );
- }
- }
- catch ( const uno::RuntimeException& )
- {
- }
- aIter++;
- }
- }
-}
-
-void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj ) const
+void SdrObjCustomShape::DragMoveCustomShapeHdl( const basegfx::B2DPoint& rDestination, const sal_uInt32 nCustomShapeHdlNum, SdrObjCustomShape* pObj ) const
{
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( pObj ) );
if ( nCustomShapeHdlNum < aInteractionHandles.size() )
@@ -2361,17 +1923,13 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, const
{
try
{
- com::sun::star::awt::Point aPt( aDestination.X(), aDestination.Y() );
+ com::sun::star::awt::Point aPt( basegfx::fround(rDestination.getX()), basegfx::fround(rDestination.getY()) );
if ( aInteractionHandle.nMode & CUSTOMSHAPE_HANDLE_MOVE_SHAPE )
{
- sal_Int32 nXDiff = aPt.X - aInteractionHandle.aPosition.X;
- sal_Int32 nYDiff = aPt.Y - aInteractionHandle.aPosition.Y;
+ const sal_Int32 nXDiff(aPt.X - aInteractionHandle.aPosition.X);
+ const sal_Int32 nYDiff(aPt.Y - aInteractionHandle.aPosition.Y);
- pObj->aRect.Move( nXDiff, nYDiff );
- pObj->aOutRect.Move( nXDiff, nYDiff );
- pObj->maSnapRect.Move( nXDiff, nYDiff );
- pObj->SetRectsDirty(sal_True);
- pObj->InvalidateRenderGeometry();
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(nXDiff, nYDiff));
std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
while ( aIter != aInteractionHandles.end() )
@@ -2395,16 +1953,16 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, const
bool SdrObjCustomShape::applySpecialDrag(SdrDragStat& rDrag)
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
const SdrHdlKind eHdl((pHdl == NULL) ? HDL_MOVE : pHdl->GetKind());
+ bool bRetval(true);
switch(eHdl)
{
case HDL_CUSTOMSHAPE1 :
{
rDrag.SetEndDragChangesGeoAndAttributes(true);
- DragMoveCustomShapeHdl( rDrag.GetNow(), (sal_uInt16)pHdl->GetPointNum(), this );
- SetRectsDirty();
+ DragMoveCustomShapeHdl( rDrag.GetNow(), pHdl->GetPointNum(), this );
InvalidateRenderGeometry();
SetChanged();
break;
@@ -2419,48 +1977,50 @@ bool SdrObjCustomShape::applySpecialDrag(SdrDragStat& rDrag)
case HDL_LOWER :
case HDL_LWRGT :
{
- DragResizeCustomShape(ImpDragCalcRect(rDrag), this);
+ bRetval = SdrTextObj::applySpecialDrag(rDrag);
break;
}
case HDL_MOVE :
{
- Move(Size(rDrag.GetDX(), rDrag.GetDY()));
+ sdr::legacy::MoveSdrObject(*this, Size(rDrag.GetDX(), rDrag.GetDY()));
break;
}
default: break;
}
- return true;
+ return bRetval;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
{
- Rectangle aRect1;
- rStat.TakeCreateRect( aRect1 );
+ basegfx::B2DRange aRange(rStat.TakeCreateRange());
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
sal_uInt32 nDefaultObjectSizeWidth = 3000; // default width from SDOptions ?
sal_uInt32 nDefaultObjectSizeHeight= 3000;
- if ( ImpVerticalSwitch( *this ) )
+ if ( ImpVerticalSwitch( *this ) ) // TTTT: What is this good for?
{
- SetMirroredX( aRect1.Left() > aRect1.Right() );
+ // TTTT: Not possible, maybe (if needed) need to use rStat.GetNow() - rStat.GetStart()
+ // to detect mirroring
+ // SetMirroredX( aRange.getMinX() > aRange.getMaxX() );
- aRect1 = Rectangle( rStat.GetNow(), Size( nDefaultObjectSizeWidth, nDefaultObjectSizeHeight ) );
+ aRange = basegfx::B2DRange( rStat.GetNow(), basegfx::B2DTuple( nDefaultObjectSizeWidth, nDefaultObjectSizeHeight ) );
// subtracting the horizontal difference of the latest handle from shape position
- if ( !aInteractionHandles.empty() )
+ if ( aInteractionHandles.size() )
{
sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X;
- aRect1.Move( aRect.Left() - nHandlePos, 0 );
+ const basegfx::B2DRange aOldObjRange(sdr::legacy::GetLogicRange(*this));
+
+ aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(aOldObjRange.getMinX() - nHandlePos, 0.0));
}
}
- ImpJustifyRect( aRect1 );
- rStat.SetActionRect( aRect1 );
- aRect = aRect1;
- SetRectsDirty();
+
+ rStat.SetActionRange( aRange );
+ sdr::legacy::SetLogicRange(*this, aRange);
std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
while ( aIter != aInteractionHandles.end() )
@@ -2468,7 +2028,10 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
try
{
if ( aIter->nMode & CUSTOMSHAPE_HANDLE_CREATE_FIXED )
- aIter->xInteraction->setControllerPosition( awt::Point( rStat.GetStart().X(), rStat.GetStart().Y() ) );
+ {
+ aIter->xInteraction->setControllerPosition(
+ awt::Point( basegfx::fround(rStat.GetStart().getX()), basegfx::fround(rStat.GetStart().getY()) ) );
+ }
}
catch ( const uno::RuntimeException& )
{
@@ -2476,79 +2039,75 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
aIter++;
}
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
+ ActionChanged();
}
-FASTBOOL SdrObjCustomShape::BegCreate( SdrDragStat& rDrag )
+bool SdrObjCustomShape::MovCreate(SdrDragStat& rStat)
{
- return SdrTextObj::BegCreate( rDrag );
-}
-
-FASTBOOL SdrObjCustomShape::MovCreate(SdrDragStat& rStat)
-{
- SdrView* pView = rStat.GetView(); // #i37448#
- if( pView && pView->IsSolidDragging() )
+ SdrView& rView = rStat.GetSdrViewFromSdrDragStat(); // #i37448#
+ if( rView.IsSolidDragging() )
{
InvalidateRenderGeometry();
}
DragCreateObject( rStat );
- SetRectsDirty();
- return sal_True;
+ ActionChanged();
+
+ return true;
}
-FASTBOOL SdrObjCustomShape::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
+bool SdrObjCustomShape::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
{
DragCreateObject( rStat );
if ( bTextFrame )
{
+ const Rectangle aOldObjRect(sdr::legacy::GetLogicRect(*this));
+
if ( IsAutoGrowHeight() )
{
// MinTextHeight
- long nHgt=aRect.GetHeight()-1;
+ long nHgt=aOldObjRect.GetHeight()-1;
if (nHgt==1) nHgt=0;
- NbcSetMinTextFrameHeight( nHgt );
+ SetMinTextFrameHeight( nHgt );
}
if ( IsAutoGrowWidth() )
{
// MinTextWidth
- long nWdt=aRect.GetWidth()-1;
+ long nWdt=aOldObjRect.GetWidth()-1;
if (nWdt==1) nWdt=0;
- NbcSetMinTextFrameWidth( nWdt );
+ SetMinTextFrameWidth( nWdt );
}
+
// Textrahmen neu berechnen
- NbcAdjustTextFrameWidthAndHeight();
+ AdjustTextFrameWidthAndHeight();
}
- SetRectsDirty();
+ ActionChanged();
return ( eCmd == SDRCREATE_FORCEEND || rStat.GetPointAnz() >= 2 );
}
basegfx::B2DPolyPolygon SdrObjCustomShape::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
{
- return GetLineGeometry( this, sal_False );
+ return GetLineGeometry( this, false );
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// in context with the SdrObjCustomShape the SdrTextAutoGrowHeightItem == true -> Resize Shape to fit text,
-// the SdrTextAutoGrowWidthItem == true -> Word wrap text in Shape
-FASTBOOL SdrObjCustomShape::IsAutoGrowHeight() const
+// in context with the SdrObjCustomShape the TextAutoGrowHeight == true -> Resize Shape to fit text,
+// the TextAutoGrowWidth == true -> Word wrap text in Shape
+bool SdrObjCustomShape::IsAutoGrowHeight() const
{
const SfxItemSet& rSet = GetMergedItemSet();
- FASTBOOL bIsAutoGrowHeight = ((SdrTextAutoGrowHeightItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
+ bool bIsAutoGrowHeight = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
if ( bIsAutoGrowHeight && IsVerticalWriting() )
- bIsAutoGrowHeight = ((SdrTextWordWrapItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue() == sal_False;
+ bIsAutoGrowHeight = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue() == false;
return bIsAutoGrowHeight;
}
-FASTBOOL SdrObjCustomShape::IsAutoGrowWidth() const
+bool SdrObjCustomShape::IsAutoGrowWidth() const
{
const SfxItemSet& rSet = GetMergedItemSet();
- FASTBOOL bIsAutoGrowWidth = ((SdrTextAutoGrowHeightItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
+ bool bIsAutoGrowWidth = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
if ( bIsAutoGrowWidth && !IsVerticalWriting() )
- bIsAutoGrowWidth = ((SdrTextWordWrapItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue() == sal_False;
+ bIsAutoGrowWidth = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue() == false;
return bIsAutoGrowWidth;
}
@@ -2556,7 +2115,7 @@ FASTBOOL SdrObjCustomShape::IsAutoGrowWidth() const
is that the SdrAutoGrowWidthItem and SdrAutoGrowHeightItem are not exchanged if the vertical writing
mode has been changed */
-void SdrObjCustomShape::SetVerticalWriting( sal_Bool bVertical )
+void SdrObjCustomShape::SetVerticalWriting( bool bVertical )
{
ForceOutlinerParaObject();
@@ -2576,7 +2135,7 @@ void SdrObjCustomShape::SetVerticalWriting( sal_Bool bVertical )
SdrTextVertAdjust eVert = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue();
// rescue object size
- Rectangle aObjectRect = GetSnapRect();
+ Rectangle aObjectRect(sdr::legacy::GetSnapRect(*this));
// prepare ItemSet to set exchanged width and height items
SfxItemSet aNewSet(*rSet.GetPool(),
@@ -2610,402 +2169,337 @@ void SdrObjCustomShape::SetVerticalWriting( sal_Bool bVertical )
pOutlinerParaObject->SetVertical(bVertical);
// restore object size
- SetSnapRect(aObjectRect);
+ sdr::legacy::SetSnapRect(*this, aObjectRect);
}
}
}
-FASTBOOL SdrObjCustomShape::AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt, FASTBOOL bWdt) const
+
+basegfx::B2DRange SdrObjCustomShape::AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt, bool bWdt) const
{
- if ( pModel && HasText() && !rR.IsEmpty() )
- {
- FASTBOOL bWdtGrow=bWdt && IsAutoGrowWidth();
- FASTBOOL bHgtGrow=bHgt && IsAutoGrowHeight();
- if ( bWdtGrow || bHgtGrow )
- {
- Rectangle aR0(rR);
- long nHgt=0,nMinHgt=0,nMaxHgt=0;
- long nWdt=0,nMinWdt=0,nMaxWdt=0;
- Size aSiz(rR.GetSize()); aSiz.Width()--; aSiz.Height()--;
- Size aMaxSiz(100000,100000);
- Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
- if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
- if (bWdtGrow)
- {
- nMinWdt=GetMinTextFrameWidth();
- nMaxWdt=GetMaxTextFrameWidth();
- if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width()) nMaxWdt=aMaxSiz.Width();
- if (nMinWdt<=0) nMinWdt=1;
- aSiz.Width()=nMaxWdt;
- }
- if (bHgtGrow)
- {
- nMinHgt=GetMinTextFrameHeight();
- nMaxHgt=GetMaxTextFrameHeight();
- if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
- if (nMinHgt<=0) nMinHgt=1;
- aSiz.Height()=nMaxHgt;
- }
- long nHDist=GetTextLeftDistance()+GetTextRightDistance();
- long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
- aSiz.Width()-=nHDist;
- aSiz.Height()-=nVDist;
- if ( aSiz.Width() < 2 )
- aSiz.Width() = 2; // Mindestgroesse 2
- if ( aSiz.Height() < 2 )
- aSiz.Height() = 2; // Mindestgroesse 2
-
- if(pEdtOutl)
- {
- pEdtOutl->SetMaxAutoPaperSize( aSiz );
- if (bWdtGrow)
- {
- Size aSiz2(pEdtOutl->CalcTextSize());
- nWdt=aSiz2.Width()+1; // lieber etwas Tolleranz
- if (bHgtGrow) nHgt=aSiz2.Height()+1; // lieber etwas Tolleranz
- } else
- {
- nHgt=pEdtOutl->GetTextHeight()+1; // lieber etwas Tolleranz
- }
- }
- else
- {
- Outliner& rOutliner=ImpGetDrawOutliner();
- rOutliner.SetPaperSize(aSiz);
- rOutliner.SetUpdateMode(sal_True);
- // !!! hier sollte ich wohl auch noch mal die Optimierung mit
- // bPortionInfoChecked usw einbauen
- OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
- if( pOutlinerParaObject != NULL )
- {
- rOutliner.SetText(*pOutlinerParaObject);
- rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
- }
- if ( bWdtGrow )
- {
- Size aSiz2(rOutliner.CalcTextSize());
- nWdt=aSiz2.Width()+1; // lieber etwas Tolleranz
- if ( bHgtGrow )
- nHgt=aSiz2.Height()+1; // lieber etwas Tolleranz
- }
- else
- nHgt = rOutliner.GetTextHeight()+1; // lieber etwas Tolleranz
- rOutliner.Clear();
- }
- if ( nWdt < nMinWdt )
- nWdt = nMinWdt;
- if ( nWdt > nMaxWdt )
- nWdt = nMaxWdt;
- nWdt += nHDist;
- if ( nWdt < 1 )
- nWdt = 1; // nHDist kann auch negativ sein
- if ( nHgt < nMinHgt )
- nHgt = nMinHgt;
- if ( nHgt > nMaxHgt )
- nHgt = nMaxHgt;
- nHgt+=nVDist;
- if ( nHgt < 1 )
- nHgt = 1; // nVDist kann auch negativ sein
- long nWdtGrow = nWdt-(rR.Right()-rR.Left());
- long nHgtGrow = nHgt-(rR.Bottom()-rR.Top());
- if ( nWdtGrow == 0 )
- bWdtGrow = sal_False;
- if ( nHgtGrow == 0 )
- bHgtGrow=sal_False;
- if ( bWdtGrow || bHgtGrow )
- {
- if ( bWdtGrow )
- {
- SdrTextHorzAdjust eHAdj=GetTextHorizontalAdjust();
- if ( eHAdj == SDRTEXTHORZADJUST_LEFT )
- rR.Right()+=nWdtGrow;
- else if ( eHAdj == SDRTEXTHORZADJUST_RIGHT )
- rR.Left()-=nWdtGrow;
- else
- {
- long nWdtGrow2=nWdtGrow/2;
- rR.Left()-=nWdtGrow2;
- rR.Right()=rR.Left()+nWdt;
- }
- }
- if ( bHgtGrow )
- {
- SdrTextVertAdjust eVAdj=GetTextVerticalAdjust();
- if ( eVAdj == SDRTEXTVERTADJUST_TOP )
- rR.Bottom()+=nHgtGrow;
- else if ( eVAdj == SDRTEXTVERTADJUST_BOTTOM )
- rR.Top()-=nHgtGrow;
- else
- {
- long nHgtGrow2=nHgtGrow/2;
- rR.Top()-=nHgtGrow2;
- rR.Bottom()=rR.Top()+nHgt;
- }
- }
- if ( aGeo.nDrehWink )
- {
- Point aD1(rR.TopLeft());
- aD1-=aR0.TopLeft();
- Point aD2(aD1);
- RotatePoint(aD2,Point(),aGeo.nSin,aGeo.nCos);
- aD2-=aD1;
- rR.Move(aD2.X(),aD2.Y());
- }
- return sal_True;
- }
- }
+ if(HasText() && !rRange.isEmpty())
+ {
+ return ImpAdjustTextFrameWidthAndHeight(rRange, bHgt, bWdt, false);
}
- return sal_False;
+
+ return rRange;
}
-Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const FASTBOOL bHgt, const FASTBOOL bWdt )
+basegfx::B2DRange SdrObjCustomShape::ImpCalculateTextFrame(const bool bHgt, const bool bWdt)
{
- Rectangle aReturnValue;
+ basegfx::B2DRange aReturnValue;
+ const basegfx::B2DRange aOldObjRange(
+ getSdrObjectTranslate(),
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+
+ // initial text rectangle
+ const basegfx::B2DRange aOldTextRange(aOldObjRange);
- Rectangle aOldTextRect( aRect ); // <- initial text rectangle
+ // new text range returned from the custom shape renderer. It is
+ // in unit coordinates initially, so needs to be transformed by
+ // object scale and position
+ basegfx::B2DRange aNewTextRange(getRawUnifiedTextRange());
+ aNewTextRange.transform(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ basegfx::absolute(getSdrObjectScale()),
+ getSdrObjectTranslate()));
- Rectangle aNewTextRect( aRect ); // <- new text rectangle returned from the custom shape renderer,
- GetTextBounds( aNewTextRect ); // it depends to the current logical shape size
+ // new text rectangle is being tested by AdjustTextFrameWidthAndHeight to ensure
+ // that the new text rectangle is matching the current text size from the outliner
+ const basegfx::B2DRange aAdjustedTextRange(AdjustTextFrameWidthAndHeight(aNewTextRange, bHgt, bWdt));
- Rectangle aAdjustedTextRect( aNewTextRect ); // <- new text rectangle is being tested by AdjustTextFrameWidthAndHeight to ensure
- if ( AdjustTextFrameWidthAndHeight( aAdjustedTextRect, bHgt, bWdt ) ) // that the new text rectangle is matching the current text size from the outliner
+ if((aAdjustedTextRange != aNewTextRange) && (aOldTextRange != aAdjustedTextRange))
{
- if ( ( aAdjustedTextRect != aNewTextRect ) && ( aOldTextRect != aAdjustedTextRect ) )
- {
- aReturnValue = aRect;
- double fXScale = (double)aOldTextRect.GetWidth() / (double)aNewTextRect.GetWidth();
- double fYScale = (double)aOldTextRect.GetHeight() / (double)aNewTextRect.GetHeight();
- double fRightDiff = (double)( aAdjustedTextRect.Right() - aNewTextRect.Right() ) * fXScale;
- double fLeftDiff = (double)( aAdjustedTextRect.Left() - aNewTextRect.Left() ) * fXScale;
- double fTopDiff = (double)( aAdjustedTextRect.Top() - aNewTextRect.Top() ) * fYScale;
- double fBottomDiff= (double)( aAdjustedTextRect.Bottom()- aNewTextRect.Bottom()) * fYScale;
- aReturnValue.Left() += (sal_Int32)fLeftDiff;
- aReturnValue.Right() += (sal_Int32)fRightDiff;
- aReturnValue.Top() += (sal_Int32)fTopDiff;
- aReturnValue.Bottom() += (sal_Int32)fBottomDiff;
- }
+ const basegfx::B2DVector aScale(aOldTextRange.getRange() / aNewTextRange.getRange());
+ const basegfx::B2DVector aTopLeftDiff((aAdjustedTextRange.getMinimum() - aNewTextRange.getMinimum()) * aScale);
+ const basegfx::B2DVector aBottomRightDiff((aAdjustedTextRange.getMaximum() - aNewTextRange.getMaximum()) * aScale);
+
+ aReturnValue = basegfx::B2DRange(
+ aReturnValue.getMinimum() + aTopLeftDiff,
+ aReturnValue.getMaximum() + aBottomRightDiff);
}
+
return aReturnValue;
}
-FASTBOOL SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(FASTBOOL bHgt, FASTBOOL bWdt)
+bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
- Rectangle aNewTextRect = ImpCalculateTextFrame( bHgt, bWdt );
- sal_Bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != aRect );
- if ( bRet )
- {
- // taking care of handles that should not been changed
- std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
-
- aRect = aNewTextRect;
- SetRectsDirty();
- SetChanged();
+ const basegfx::B2DRange aNewTextRange(ImpCalculateTextFrame(bHgt, bWdt));
+ const basegfx::B2DRange aOldObjRange(getSdrObjectTranslate(), getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
- std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
- while ( aIter != aInteractionHandles.end() )
- {
- try
- {
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
- }
- catch ( const uno::RuntimeException& )
- {
- }
- aIter++;
- }
- InvalidateRenderGeometry();
- }
- return bRet;
-}
-FASTBOOL SdrObjCustomShape::AdjustTextFrameWidthAndHeight(FASTBOOL bHgt, FASTBOOL bWdt)
-{
- Rectangle aNewTextRect = ImpCalculateTextFrame( bHgt, bWdt );
- sal_Bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != aRect );
- if ( bRet )
+ if(!aNewTextRange.isEmpty() && !aNewTextRange.equal(aOldObjRange))
{
- Rectangle aBoundRect0;
- if ( pUserCall )
- aBoundRect0 = GetCurrentBoundRect();
-
// taking care of handles that should not been changed
- std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ std::vector< SdrCustomShapeInteraction > aInteractionHandles(GetInteractionHandles(this));
+ sdr::legacy::SetLogicRange(*this, aNewTextRange);
+ std::vector< SdrCustomShapeInteraction >::iterator aIter(aInteractionHandles.begin());
-// SendRepaintBroadcast();
- aRect = aNewTextRect;
- SetRectsDirty();
-
- std::vector< SdrCustomShapeInteraction >::iterator aIter( aInteractionHandles.begin() );
- while ( aIter != aInteractionHandles.end() )
+ while(aIter != aInteractionHandles.end())
{
try
{
- if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_FIXED )
- aIter->xInteraction->setControllerPosition( aIter->aPosition );
+ if(aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_FIXED)
+ {
+ aIter->xInteraction->setControllerPosition(aIter->aPosition);
+ }
}
- catch ( const uno::RuntimeException& )
+ catch(const uno::RuntimeException&)
{
}
+
aIter++;
}
InvalidateRenderGeometry();
SetChanged();
-// SendRepaintBroadcast();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+
+ return true;
}
- return bRet;
+
+ return false;
}
-sal_Bool SdrObjCustomShape::BegTextEdit( SdrOutliner& rOutl )
+
+bool SdrObjCustomShape::BegTextEdit( SdrOutliner& rOutl )
{
return SdrTextObj::BegTextEdit( rOutl );
}
-void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const
+
+void SdrObjCustomShape::TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const
{
- Size aPaperMin,aPaperMax;
- Rectangle aViewInit;
- TakeTextAnchorRect( aViewInit );
- if ( aGeo.nDrehWink )
- {
- Point aCenter(aViewInit.Center());
- aCenter-=aViewInit.TopLeft();
- Point aCenter0(aCenter);
- RotatePoint(aCenter,Point(),aGeo.nSin,aGeo.nCos);
- aCenter-=aCenter0;
- aViewInit.Move(aCenter.X(),aCenter.Y());
- }
- Size aAnkSiz(aViewInit.GetSize());
- aAnkSiz.Width()--; aAnkSiz.Height()--; // weil GetSize() ein draufaddiert
- Size aMaxSiz(1000000,1000000);
- if (pModel!=NULL) {
- Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
- if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
+ // get TextRange without shear, rotate and mirror, just scaled
+ // and centered in logic coordinates
+ basegfx::B2DRange aViewInit(getScaledCenteredTextRange(*this));
+
+ basegfx::B2DVector aPaperMin;
+ basegfx::B2DVector aPaperMax;
+ basegfx::B2DVector aAnkSiz(aViewInit.getRange());
+ basegfx::B2DVector aMaxSiz(1000000.0, 1000000.0);
+
+ if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getX()))
+ {
+ aMaxSiz.setX(getSdrModelFromSdrObject().GetMaxObjectScale().getX());
+ }
+
+ if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getY()))
+ {
+ aMaxSiz.setY(getSdrModelFromSdrObject().GetMaxObjectScale().getY());
}
+
SdrTextHorzAdjust eHAdj(GetTextHorizontalAdjust());
SdrTextVertAdjust eVAdj(GetTextVerticalAdjust());
- long nMinWdt = GetMinTextFrameWidth();
- long nMinHgt = GetMinTextFrameHeight();
- long nMaxWdt = GetMaxTextFrameWidth();
- long nMaxHgt = GetMaxTextFrameHeight();
- if (nMinWdt<1) nMinWdt=1;
- if (nMinHgt<1) nMinHgt=1;
- if ( nMaxWdt == 0 || nMaxWdt > aMaxSiz.Width() )
- nMaxWdt = aMaxSiz.Width();
- if ( nMaxHgt == 0 || nMaxHgt > aMaxSiz.Height() )
- nMaxHgt=aMaxSiz.Height();
+ double fMinWdt(std::max(1.0, (double)GetMinTextFrameWidth()));
+ double fMinHgt(std::max(1.0, (double)GetMinTextFrameHeight()));
+ double fMaxWdt(GetMaxTextFrameWidth());
+ double fMaxHgt(GetMaxTextFrameHeight());
+
+ if(basegfx::fTools::equalZero(fMaxWdt) || basegfx::fTools::more(fMaxWdt, aMaxSiz.getX()))
+ {
+ fMaxWdt = aMaxSiz.getX();
+ }
+
+ if(basegfx::fTools::equalZero(fMaxHgt) || basegfx::fTools::more(fMaxHgt, aMaxSiz.getY()))
+ {
+ fMaxHgt = aMaxSiz.getY();
+ }
- if (((SdrTextWordWrapItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
+ if(((SdrOnOffItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
{
- if ( IsVerticalWriting() )
+ if(IsVerticalWriting())
{
- nMaxHgt = aAnkSiz.Height();
- nMinHgt = nMaxHgt;
+ fMaxHgt = aAnkSiz.getY();
+ fMinHgt = fMaxHgt;
}
else
{
- nMaxWdt = aAnkSiz.Width();
- nMinWdt = nMaxWdt;
+ fMaxWdt = aAnkSiz.getX();
+ fMinWdt = fMaxWdt;
}
}
- aPaperMax.Width()=nMaxWdt;
- aPaperMax.Height()=nMaxHgt;
- aPaperMin.Width()=nMinWdt;
- aPaperMin.Height()=nMinHgt;
+ aPaperMax.setX(fMaxWdt);
+ aPaperMax.setY(fMaxHgt);
+
+ aPaperMin.setX(fMinWdt);
+ aPaperMin.setY(fMinHgt);
- if ( pViewMin )
+ if(pViewMin)
{
*pViewMin = aViewInit;
+ const double fXFree(aAnkSiz.getX() - aPaperMin.getX());
+
+ if(SDRTEXTHORZADJUST_LEFT == eHAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY(),
+ pViewMin->getMaxX() - fXFree,
+ pViewMin->getMaxY());
+ }
+ else if(SDRTEXTHORZADJUST_RIGHT == eHAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX() + fXFree,
+ pViewMin->getMinY(),
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY());
+ }
+ else
+ {
+ const double fNewMinX(pViewMin->getMinX() + (fXFree * 0.5));
+ *pViewMin = basegfx::B2DRange(
+ fNewMinX,
+ pViewMin->getMinY(),
+ fNewMinX + aPaperMin.getX(),
+ pViewMin->getMaxY());
+ }
- long nXFree = aAnkSiz.Width() - aPaperMin.Width();
- if ( eHAdj == SDRTEXTHORZADJUST_LEFT )
- pViewMin->Right() -= nXFree;
- else if ( eHAdj == SDRTEXTHORZADJUST_RIGHT )
- pViewMin->Left() += nXFree;
- else { pViewMin->Left() += nXFree / 2; pViewMin->Right() = pViewMin->Left() + aPaperMin.Width(); }
+ const double fYFree(aAnkSiz.getY() - aPaperMin.getY());
- long nYFree = aAnkSiz.Height() - aPaperMin.Height();
- if ( eVAdj == SDRTEXTVERTADJUST_TOP )
- pViewMin->Bottom() -= nYFree;
- else if ( eVAdj == SDRTEXTVERTADJUST_BOTTOM )
- pViewMin->Top() += nYFree;
- else { pViewMin->Top() += nYFree / 2; pViewMin->Bottom() = pViewMin->Top() + aPaperMin.Height(); }
+ if(SDRTEXTVERTADJUST_TOP == eVAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY(),
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY() - fYFree);
+ }
+ else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY() + fYFree,
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY());
+ }
+ else
+ {
+ const double fNewMinY(pViewMin->getMinY() + (fYFree * 0.5));
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ fNewMinY,
+ pViewMin->getMaxX(),
+ fNewMinY + aPaperMin.getY());
+ }
}
- if( IsVerticalWriting() )
- aPaperMin.Width() = 0;
+ if(IsVerticalWriting())
+ {
+ aPaperMin.setX(0.0);
+ }
else
- aPaperMin.Height() = 0; // #33102#
+ {
+ // #33102#
+ aPaperMin.setY(0.0);
+ }
if( eHAdj != SDRTEXTHORZADJUST_BLOCK )
- aPaperMin.Width()=0;
+ {
+ aPaperMin.setX(0.0);
+ }
// #103516# For complete ver adjust support, set paper min height to 0, here.
if(SDRTEXTVERTADJUST_BLOCK != eVAdj )
- aPaperMin.Height() = 0;
+ {
+ aPaperMin.setY(0.0);
+ }
+
+ if(pPaperMin)
+ {
+ *pPaperMin = aPaperMin;
+ }
+
+ if(pPaperMax)
+ {
+ *pPaperMax = aPaperMax;
+ }
- if (pPaperMin!=NULL) *pPaperMin=aPaperMin;
- if (pPaperMax!=NULL) *pPaperMax=aPaperMax;
- if (pViewInit!=NULL) *pViewInit=aViewInit;
+ if(pViewInit)
+ {
+ *pViewInit = aViewInit;
+ }
}
void SdrObjCustomShape::EndTextEdit( SdrOutliner& rOutl )
{
SdrTextObj::EndTextEdit( rOutl );
InvalidateRenderGeometry();
}
-void SdrObjCustomShape::TakeTextAnchorRect( Rectangle& rAnchorRect ) const
+basegfx::B2DRange SdrObjCustomShape::getRawUnifiedTextRange() const
{
- if ( GetTextBounds( rAnchorRect ) )
+ // a candidate for being cached
+ Reference< XCustomShapeEngine > xCustomShapeEngine(GetCustomShapeEngine(this));
+
+ if(xCustomShapeEngine.is())
{
- Point aRotateRef( maSnapRect.Center() );
- rAnchorRect.Left() += GetTextLeftDistance();
- rAnchorRect.Top() += GetTextUpperDistance();
- rAnchorRect.Right() -= GetTextRightDistance();
- rAnchorRect.Bottom() -= GetTextLowerDistance();
- ImpJustifyRect( rAnchorRect );
+ awt::Rectangle aR(xCustomShapeEngine->getTextBounds());
- if ( rAnchorRect.GetWidth() < 2 )
- rAnchorRect.Right() = rAnchorRect.Left() + 1; // minimal width is 2
- if ( rAnchorRect.GetHeight() < 2 )
- rAnchorRect.Bottom() = rAnchorRect.Top() + 1; // minimal height is 2
- if ( aGeo.nDrehWink )
+ if(aR.Width || aR.Height)
{
- Point aP( rAnchorRect.TopLeft() );
- RotatePoint( aP, aRotateRef, aGeo.nSin, aGeo. nCos );
- rAnchorRect.SetPos( aP );
+ // the text bounds from CustomShapeEngine can be seen as scaled and translated
+ // whereby scale is absolute (without mirrorings AFAIK). To get the unified range,
+ // multiply with the inverse of M = T(obj) * S(obj). This can be done directly
+ // here
+ const double fAbsInvScaleX(basegfx::fTools::equalZero(getSdrObjectScale().getX()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getX()));
+ const double fAbsInvScaleY(basegfx::fTools::equalZero(getSdrObjectScale().getY()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getY()));
+ const double fX((aR.X - getSdrObjectTranslate().getX()) * fAbsInvScaleX);
+ const double fY((aR.Y - getSdrObjectTranslate().getY()) * fAbsInvScaleY);
+ const double fW(aR.Width * fAbsInvScaleX);
+ const double fH(aR.Height * fAbsInvScaleY);
+
+ return basegfx::B2DRange(fX, fY, fX + fW, fY + fH);
}
}
- else
- SdrTextObj::TakeTextAnchorRect( rAnchorRect );
+
+ // per default the text range is the whole object range
+ return basegfx::B2DRange::getUnitB2DRange();
}
-void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText,
- Rectangle* pAnchorRect, sal_Bool /*bLineWidth*/) const
+basegfx::B2DRange SdrObjCustomShape::getUnifiedTextRange() const
{
- Rectangle aAnkRect; // Rect innerhalb dem geankert wird
- TakeTextAnchorRect(aAnkRect);
- SdrTextVertAdjust eVAdj=GetTextVerticalAdjust();
- SdrTextHorzAdjust eHAdj=GetTextHorizontalAdjust();
- sal_uIntPtr nStat0=rOutliner.GetControlWord();
+ // get raw range (without text borders)
+ basegfx::B2DRange aRawRange(getRawUnifiedTextRange());
+ const double fAbsInvScaleX(basegfx::fTools::equalZero(getSdrObjectScale().getX()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getX()));
+ const double fAbsInvScaleY(basegfx::fTools::equalZero(getSdrObjectScale().getY()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getY()));
+
+ // add/remove the text borders
+ return basegfx::B2DRange(
+ aRawRange.getMinX() + (GetTextLeftDistance() * fAbsInvScaleX),
+ aRawRange.getMinY() + (GetTextUpperDistance() * fAbsInvScaleY),
+ aRawRange.getMaxX() - (GetTextRightDistance() * fAbsInvScaleX),
+ aRawRange.getMaxY() - (GetTextLowerDistance() * fAbsInvScaleY));
+}
+void SdrObjCustomShape::TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const
+{
+ // get TextRange without shear, rotate and mirror, just scaled
+ // and centered in logic coordinates
+ rAnchorRange = getScaledCenteredTextRange(*this);
+
+ // Rect innerhalb dem geankert wird
+ SdrTextVertAdjust eVAdj = GetTextVerticalAdjust();
+ SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust();
+ sal_uInt32 nStat0 = rOutliner.GetControlWord();
Size aNullSize;
rOutliner.SetControlWord(nStat0|EE_CNTRL_AUTOPAGESIZE);
rOutliner.SetMinAutoPaperSize(aNullSize);
+
sal_Int32 nMaxAutoPaperWidth = 1000000;
sal_Int32 nMaxAutoPaperHeight= 1000000;
- long nAnkWdt=aAnkRect.GetWidth();
- long nAnkHgt=aAnkRect.GetHeight();
+ long nAnkWdt(basegfx::fround(rAnchorRange.getWidth()));
+ long nAnkHgt(basegfx::fround(rAnchorRange.getHeight()));
- if (((SdrTextWordWrapItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
+ if(((SdrOnOffItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
{
- if ( IsVerticalWriting() )
+ if(IsVerticalWriting())
+ {
nMaxAutoPaperHeight = nAnkHgt;
+ }
else
+ {
nMaxAutoPaperWidth = nAnkWdt;
+ }
}
+
if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !IsVerticalWriting())
{
rOutliner.SetMinAutoPaperSize(Size(nAnkWdt, 0));
@@ -3015,28 +2509,29 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe
{
rOutliner.SetMinAutoPaperSize(Size(0, nAnkHgt));
}
+
rOutliner.SetMaxAutoPaperSize( Size( nMaxAutoPaperWidth, nMaxAutoPaperHeight ) );
rOutliner.SetPaperSize( aNullSize );
// Text in den Outliner stecken - ggf. den aus dem EditOutliner
- OutlinerParaObject* pPara= GetOutlinerParaObject();
- if (pEdtOutl && !bNoEditText)
- pPara=pEdtOutl->CreateParaObject();
+ OutlinerParaObject* pPara = GetOutlinerParaObject();
+ bool bNeedToDestroy(false);
- if (pPara)
+ if(pEdtOutl)
{
- sal_Bool bHitTest = sal_False;
- if( pModel )
- bHitTest = &pModel->GetHitTestOutliner() == &rOutliner;
+ pPara = pEdtOutl->CreateParaObject();
+ bNeedToDestroy = true;
+ }
+ if (pPara)
+ {
const SdrTextObj* pTestObj = rOutliner.GetTextObj();
- if( !pTestObj || !bHitTest || pTestObj != this ||
+
+ if( !pTestObj || pTestObj != this ||
pTestObj->GetOutlinerParaObject() != GetOutlinerParaObject() )
{
- if( bHitTest )
- rOutliner.SetTextObj( this );
-
- rOutliner.SetUpdateMode(sal_True);
+ rOutliner.SetTextObj( this );
+ rOutliner.SetUpdateMode(true);
rOutliner.SetText(*pPara);
}
}
@@ -3044,18 +2539,24 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe
{
rOutliner.SetTextObj( NULL );
}
- if (pEdtOutl && !bNoEditText && pPara)
+
+ if (bNeedToDestroy && pPara)
+ {
delete pPara;
+ }
- rOutliner.SetUpdateMode(sal_True);
+ rOutliner.SetUpdateMode(true);
rOutliner.SetControlWord(nStat0);
SdrText* pText = getActiveText();
+
if( pText )
+ {
pText->CheckPortionInfo( rOutliner );
+ }
- Point aTextPos(aAnkRect.TopLeft());
- Size aTextSiz(rOutliner.GetPaperSize()); // GetPaperSize() hat etwas Toleranz drauf, oder?
+ basegfx::B2DPoint aTextPos(rAnchorRange.getMinimum());
+ const basegfx::B2DVector aTextSiz(rOutliner.GetPaperSize().getWidth(), rOutliner.GetPaperSize().getHeight());
// #106653#
// For draw objects containing text correct hor/ver alignment if text is bigger
@@ -3064,7 +2565,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe
if( !IsTextFrame() )
{
- if(aAnkRect.GetWidth() < aTextSiz.Width() && !IsVerticalWriting())
+ if(rAnchorRange.getWidth() < aTextSiz.getX() && !IsVerticalWriting())
{
// #110129#
// Horizontal case here. Correct only if eHAdj == SDRTEXTHORZADJUST_BLOCK,
@@ -3075,7 +2576,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe
}
}
- if(aAnkRect.GetHeight() < aTextSiz.Height() && IsVerticalWriting())
+ if(rAnchorRange.getHeight() < aTextSiz.getY() && IsVerticalWriting())
{
// #110129#
// Vertical case here. Correct only if eHAdj == SDRTEXTVERTADJUST_BLOCK,
@@ -3087,49 +2588,46 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe
}
}
- if (eHAdj==SDRTEXTHORZADJUST_CENTER || eHAdj==SDRTEXTHORZADJUST_RIGHT)
+ if (SDRTEXTHORZADJUST_CENTER == eHAdj || SDRTEXTHORZADJUST_RIGHT == eHAdj)
{
- long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width();
- if (eHAdj==SDRTEXTHORZADJUST_CENTER)
- aTextPos.X()+=nFreeWdt/2;
- if (eHAdj==SDRTEXTHORZADJUST_RIGHT)
- aTextPos.X()+=nFreeWdt;
+ const double fFreeWdt(rAnchorRange.getWidth() - aTextSiz.getX());
+
+ if(SDRTEXTHORZADJUST_CENTER == eHAdj)
+ {
+ aTextPos.setX(aTextPos.getX() + (fFreeWdt * 0.5));
+ }
+ else if(SDRTEXTHORZADJUST_RIGHT == eHAdj)
+ {
+ aTextPos.setX(aTextPos.getX() + fFreeWdt);
+ }
}
- if (eVAdj==SDRTEXTVERTADJUST_CENTER || eVAdj==SDRTEXTVERTADJUST_BOTTOM)
+
+ if (SDRTEXTVERTADJUST_CENTER == eVAdj || SDRTEXTVERTADJUST_BOTTOM == eVAdj)
{
- long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height();
- if (eVAdj==SDRTEXTVERTADJUST_CENTER)
- aTextPos.Y()+=nFreeHgt/2;
- if (eVAdj==SDRTEXTVERTADJUST_BOTTOM)
- aTextPos.Y()+=nFreeHgt;
- }
- if (aGeo.nDrehWink!=0)
- RotatePoint(aTextPos,aAnkRect.TopLeft(),aGeo.nSin,aGeo.nCos);
+ const double fFreeHgt(rAnchorRange.getHeight() - aTextSiz.getY());
- if (pAnchorRect)
- *pAnchorRect=aAnkRect;
+ if(SDRTEXTVERTADJUST_CENTER == eVAdj)
+ {
+ aTextPos.setY(aTextPos.getY() + (fFreeHgt * 0.5));
+ }
+ else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
+ {
+ aTextPos.setY(aTextPos.getY() + fFreeHgt);
+ }
+ }
- // rTextRect ist bei ContourFrame in einigen Faellen nicht korrekt
- rTextRect=Rectangle(aTextPos,aTextSiz);
+ rTextRange = basegfx::B2DRange(aTextPos, aTextPos + aTextSiz);
}
-void SdrObjCustomShape::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject)
+void SdrObjCustomShape::SetChanged()
{
- SdrTextObj::NbcSetOutlinerParaObject( pTextObject );
- SetBoundRectDirty();
- SetRectsDirty(sal_True);
- InvalidateRenderGeometry();
-}
+ // call parent
+ SdrTextObj::SetChanged();
-void SdrObjCustomShape::operator=(const SdrObject& rObj)
-{
- SdrTextObj::operator=( rObj );
- aName =((SdrObjCustomShape&)rObj).aName;
- fObjectRotation = ((SdrObjCustomShape&)rObj).fObjectRotation;
+ // own reactions
InvalidateRenderGeometry();
}
-
void SdrObjCustomShape::TakeObjNameSingul(XubString& rName) const
{
rName = ImpGetResStr(STR_ObjNameSingulCUSTOMSHAPE);
@@ -3150,18 +2648,10 @@ void SdrObjCustomShape::TakeObjNamePlural(XubString& rName) const
basegfx::B2DPolyPolygon SdrObjCustomShape::TakeXorPoly() const
{
- return GetLineGeometry( (SdrObjCustomShape*)this, sal_False );
+ return GetLineGeometry( (SdrObjCustomShape*)this, false );
}
-basegfx::B2DPolyPolygon SdrObjCustomShape::TakeContour() const
-{
- const SdrObject* pSdrObject = GetSdrObjectFromCustomShape();
- if ( pSdrObject )
- return pSdrObject->TakeContour();
- return basegfx::B2DPolyPolygon();
-}
-
-SdrObject* SdrObjCustomShape::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+SdrObject* SdrObjCustomShape::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
// #i37011#
SdrObject* pRetval = 0L;
@@ -3180,18 +2670,17 @@ SdrObject* SdrObjCustomShape::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText
if ( pRenderedCustomShape )
{
- SdrObject* pCandidate = pRenderedCustomShape->Clone();
- DBG_ASSERT(pCandidate, "SdrObjCustomShape::DoConvertToPolyObj: Could not clone SdrObject (!)");
- pCandidate->SetModel(GetModel());
- pRetval = pCandidate->DoConvertToPolyObj(bBezier, bAddText);
- SdrObject::Free( pCandidate );
+ SdrObject* pCandidate = pRenderedCustomShape->CloneSdrObject();
+ DBG_ASSERT(pCandidate, "SdrObjCustomShape::DoConvertToPolygonObject: Could not clone SdrObject (!)");
+ pRetval = pCandidate->DoConvertToPolygonObject(bBezier, bAddText);
+ deleteSdrObjectSafeAndClearPointer(pCandidate);
if(pRetval)
{
- const sal_Bool bShadow(((SdrShadowItem&)GetMergedItem(SDRATTR_SHADOW)).GetValue());
+ const bool bShadow(((SdrOnOffItem&)GetMergedItem(SDRATTR_SHADOW)).GetValue());
if(bShadow)
{
- pRetval->SetMergedItem(SdrShadowItem(sal_True));
+ pRetval->SetMergedItem(SdrOnOffItem(SDRATTR_SHADOW, true));
}
}
@@ -3204,24 +2693,29 @@ SdrObject* SdrObjCustomShape::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText
return pRetval;
}
-void SdrObjCustomShape::NbcSetStyleSheet( SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr )
+void SdrObjCustomShape::SetStyleSheet( SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr )
{
// #i40944#
InvalidateRenderGeometry();
- SdrObject::NbcSetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
+
+ // call parent
+ SdrObject::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
}
-void SdrObjCustomShape::SetPage( SdrPage* pNewPage )
+void SdrObjCustomShape::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
{
- SdrTextObj::SetPage( pNewPage );
-
- if( pNewPage )
+ if(pOldPage != pNewPage)
{
- // invalidating rectangles by SetRectsDirty is not sufficient,
- // AdjustTextFrameWidthAndHeight() also has to be made, both
- // actions are done by NbcSetSnapRect
- Rectangle aTmp( aRect ); //creating temporary rectangle #i61108#
- NbcSetSnapRect( aTmp );
+ // call parent
+ SdrTextObj::handlePageChange(pOldPage, pNewPage);
+
+ if( pNewPage )
+ {
+ // invalidating rectangles by invalidateObjectRange is not sufficient,
+ // AdjustTextFrameWidthAndHeight() also has to be made
+ ActionChanged();
+ AdjustTextFrameWidthAndHeight();
+ }
}
}
@@ -3232,268 +2726,61 @@ SdrObjGeoData* SdrObjCustomShape::NewGeoData() const
void SdrObjCustomShape::SaveGeoData(SdrObjGeoData& rGeo) const
{
+ // call parent
SdrTextObj::SaveGeoData( rGeo );
- SdrAShapeObjGeoData& rAGeo=(SdrAShapeObjGeoData&)rGeo;
- rAGeo.fObjectRotation = fObjectRotation;
- rAGeo.bMirroredX = IsMirroredX();
- rAGeo.bMirroredY = IsMirroredY();
-
- const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
- Any* pAny( ( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ).GetPropertyValueByName( sAdjustmentValues ) );
- if ( pAny )
- *pAny >>= rAGeo.aAdjustmentSeq;
-}
-
-void SdrObjCustomShape::RestGeoData(const SdrObjGeoData& rGeo)
-{
- SdrTextObj::RestGeoData( rGeo );
- SdrAShapeObjGeoData& rAGeo=(SdrAShapeObjGeoData&)rGeo;
- fObjectRotation = rAGeo.fObjectRotation;
- SetMirroredX( rAGeo.bMirroredX );
- SetMirroredY( rAGeo.bMirroredY );
-
- SdrCustomShapeGeometryItem rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- const rtl::OUString sAdjustmentValues( RTL_CONSTASCII_USTRINGPARAM ( "AdjustmentValues" ) );
- PropertyValue aPropVal;
- aPropVal.Name = sAdjustmentValues;
- aPropVal.Value <<= rAGeo.aAdjustmentSeq;
- rGeometryItem.SetPropertyValue( aPropVal );
- SetMergedItem( rGeometryItem );
-
- InvalidateRenderGeometry();
-}
-
-void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& /*rPolyPolygon*/)
-{
- // break up matrix
- basegfx::B2DTuple aScale;
- basegfx::B2DTuple aTranslate;
- double fRotate, fShearX;
- rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
- // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
- const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
- const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
- if(bMirrorX && bMirrorY)
- {
- aScale.setX(fabs(aScale.getX()));
- aScale.setY(fabs(aScale.getY()));
- fRotate = fmod(fRotate + F_PI, F_2PI);
- }
- else if(bMirrorX || bMirrorY)
- {
- basegfx::B2DHomMatrix aNew;
-
- // create pre-multiplied matrix without mirroring
- aNew.translate(-0.5, -0.5);
- aNew.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0);
- aNew.translate(0.5, 0.5);
- aNew = rMatrix * aNew;
-
- // decompose to get corrected, mirror-free values
- aNew.decompose(aScale, aTranslate, fRotate, fShearX);
+ SdrAShapeObjGeoData* pSdrAShapeObjGeoData = dynamic_cast< SdrAShapeObjGeoData* >(&rGeo);
- // apply mirroring to CustomShapeGeometry
- if((bool)IsMirroredX() != bMirrorX)
- {
- SetMirroredX(bMirrorX);
- }
-
- if((bool)IsMirroredY() != bMirrorY)
- {
- SetMirroredY(bMirrorY);
- }
- }
-
- // reset object shear and rotations
- aGeo.nDrehWink = 0;
- aGeo.RecalcSinCos();
- aGeo.nShearWink = 0;
- aGeo.RecalcTan();
-
- // force metric to pool metric
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ if(pSdrAShapeObjGeoData)
{
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // position
- aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
- aTranslate.setY(ImplMMToTwips(aTranslate.getY()));
+ // TTTT: Should be obsolete
+ //rAGeo.fObjectRotation = fObjectRotation;
- // size
- aScale.setX(ImplMMToTwips(aScale.getX()));
- aScale.setY(ImplMMToTwips(aScale.getY()));
+ // TTTT: MirrorX/Y removed
+ //rAGeo.bMirroredX = IsMirroredX();
+ //rAGeo.bMirroredY = IsMirroredY();
- break;
- }
- default:
- {
- DBG_ERROR("TRSetBaseGeometry: Missing unit translation to PoolMetric!");
- }
- }
- }
+ const rtl::OUString sAdjustmentValues(RTL_CONSTASCII_USTRINGPARAM("AdjustmentValues"));
+ Any* pAny(((SdrCustomShapeGeometryItem&)GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)).GetPropertyValueByName(sAdjustmentValues));
- // if anchor is used, make position relative to it
- if( pModel && pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
+ if(pAny)
{
- aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
+ *pAny >>= pSdrAShapeObjGeoData->aAdjustmentSeq;
}
}
-
- // build and set BaseRect (use scale)
- Point aPoint = Point();
- Size aSize(FRound(aScale.getX()), FRound(aScale.getY()));
- Rectangle aBaseRect(aPoint, aSize);
- SetSnapRect(aBaseRect);
-
- // shear?
- if(!basegfx::fTools::equalZero(fShearX))
- {
- GeoStat aGeoStat;
- aGeoStat.nShearWink = FRound((atan(fShearX) / F_PI180) * 100.0);
- aGeoStat.RecalcTan();
- Shear(Point(), aGeoStat.nShearWink, aGeoStat.nTan, sal_False);
- }
-
- // rotation?
- if(!basegfx::fTools::equalZero(fRotate))
- {
- GeoStat aGeoStat;
-
- // #i78696#
- // fRotate is mathematically correct, but aGeoStat.nDrehWink is
- // mirrored -> mirror value here
- aGeoStat.nDrehWink = NormAngle360(FRound(-fRotate / F_PI18000));
- aGeoStat.RecalcSinCos();
- Rotate(Point(), aGeoStat.nDrehWink, aGeoStat.nSin, aGeoStat.nCos);
- }
-
- // translate?
- if(!aTranslate.equalZero())
- {
- Move(Size(FRound(aTranslate.getX()), FRound(aTranslate.getY())));
- }
}
-// taking fObjectRotation instead of aGeo.nWink
-sal_Bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& /*rPolyPolygon*/) const
+void SdrObjCustomShape::RestGeoData(const SdrObjGeoData& rGeo)
{
- // get turn and shear
-// double fRotate = (aGeo.nDrehWink / 100.0) * F_PI180;
- double fRotate = fObjectRotation * F_PI180;
- double fShearX = (aGeo.nShearWink / 100.0) * F_PI180;
-
- // get aRect, this is the unrotated snaprect
- Rectangle aRectangle(aRect);
-
- sal_Bool bMirroredX = IsMirroredX();
- sal_Bool bMirroredY = IsMirroredY();
- if ( bMirroredX || bMirroredY )
- { // we have to retrieve the unmirrored rect
-
- GeoStat aNewGeo( aGeo );
-
- if ( bMirroredX )
- {
- Polygon aPol( Rect2Poly( aRect, aNewGeo ) );
- Rectangle aBoundRect( aPol.GetBoundRect() );
-
- Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
- Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
- sal_uInt16 i;
- sal_uInt16 nPntAnz=aPol.GetSize();
- for (i=0; i<nPntAnz; i++)
- {
- MirrorPoint(aPol[i],aRef1,aRef2);
- }
- // Polygon wenden und etwas schieben
- Polygon aPol0(aPol);
- aPol[0]=aPol0[1];
- aPol[1]=aPol0[0];
- aPol[2]=aPol0[3];
- aPol[3]=aPol0[2];
- aPol[4]=aPol0[1];
- Poly2Rect(aPol,aRectangle,aNewGeo);
- }
- if ( bMirroredY )
- {
- Polygon aPol( Rect2Poly( aRectangle, aNewGeo ) );
- Rectangle aBoundRect( aPol.GetBoundRect() );
-
- Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1 );
- Point aRef2( aRef1.X() + 1000, aRef1.Y() );
- sal_uInt16 i;
- sal_uInt16 nPntAnz=aPol.GetSize();
- for (i=0; i<nPntAnz; i++)
- {
- MirrorPoint(aPol[i],aRef1,aRef2);
- }
- // Polygon wenden und etwas schieben
- Polygon aPol0(aPol);
- aPol[0]=aPol0[3]; // This was WRONG for vertical (!)
- aPol[1]=aPol0[2];
- aPol[2]=aPol0[1];
- aPol[3]=aPol0[0];
- aPol[4]=aPol0[3];
- Poly2Rect(aPol,aRectangle,aNewGeo);
- }
- }
+ // call parent
+ SdrTextObj::RestGeoData( rGeo );
- // fill other values
- basegfx::B2DTuple aScale(aRectangle.GetWidth(), aRectangle.GetHeight());
- basegfx::B2DTuple aTranslate(aRectangle.Left(), aRectangle.Top());
+ const SdrAShapeObjGeoData* pSdrAShapeObjGeoData = dynamic_cast< const SdrAShapeObjGeoData* >(&rGeo);
- // position maybe relative to anchorpos, convert
- if( pModel && pModel->IsWriter() )
+ if(pSdrAShapeObjGeoData)
{
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
- }
-
- // force MapUnit to 100th mm
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // postion
- aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
- aTranslate.setY(ImplTwipsToMM(aTranslate.getY()));
+ // TTTT: Should be obsolete
+ //fObjectRotation = rAGeo.fObjectRotation;
- // size
- aScale.setX(ImplTwipsToMM(aScale.getX()));
- aScale.setY(ImplTwipsToMM(aScale.getY()));
+ // TTTT: MirrorX/Y removed
+ //SetMirroredX( rAGeo.bMirroredX );
+ //SetMirroredY( rAGeo.bMirroredY );
- break;
- }
- default:
- {
- DBG_ERROR("TRGetBaseGeometry: Missing unit translation to 100th mm!");
- }
- }
- }
+ SdrCustomShapeGeometryItem rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY);
+ const rtl::OUString sAdjustmentValues(RTL_CONSTASCII_USTRINGPARAM("AdjustmentValues"));
+ PropertyValue aPropVal;
- // build matrix
- rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aScale,
- basegfx::fTools::equalZero(fShearX) ? 0.0 : tan(fShearX),
- basegfx::fTools::equalZero(fRotate) ? 0.0 : -fRotate,
- aTranslate);
+ aPropVal.Name = sAdjustmentValues;
+ aPropVal.Value <<= pSdrAShapeObjGeoData->aAdjustmentSeq;
+ rGeometryItem.SetPropertyValue(aPropVal);
+ SetMergedItem(rGeometryItem);
- return sal_False;
+ InvalidateRenderGeometry();
+ }
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
sdr::contact::ViewContact* SdrObjCustomShape::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfSdrObjCustomShape(*this);
@@ -3537,7 +2824,7 @@ bool SdrObjCustomShape::doConstructOrthogonal(const ::rtl::OUString& rName)
void SdrObjCustomShape::InvalidateRenderGeometry()
{
mXRenderedCustomShape = 0L;
- SdrObject::Free( mpLastShadowGeometry );
+ deleteSdrObjectSafeAndClearPointer( mpLastShadowGeometry );
mpLastShadowGeometry = 0L;
}
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx
index 54d51f9b18f4..2a31255c3824 100644
--- a/svx/source/svdraw/svdoattr.cxx
+++ b/svx/source/svdraw/svdoattr.cxx
@@ -26,7 +26,8 @@
#include <svx/svdoattr.hxx>
#include <svx/xpool.hxx>
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdattr.hxx>
@@ -51,13 +52,9 @@
#include <svx/xflbstit.hxx>
#include <svx/xflbtoxy.hxx>
#include <svx/xftshit.hxx>
-
-
#include <editeng/colritem.hxx>
#include "editeng/fontitem.hxx"
#include <editeng/fhgtitem.hxx>
-
-//#include <editeng/charscaleitem.hxx>
#include <svx/xlnstcit.hxx>
#include <svx/xlnwtit.hxx>
#include <svl/style.hxx>
@@ -81,7 +78,6 @@
#include <svx/sdr/properties/attributeproperties.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include "svx/xlinjoit.hxx"
-#include <svdoimp.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -92,9 +88,8 @@ sdr::properties::BaseProperties* SdrAttrObj::CreateObjectSpecificProperties()
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrAttrObj,SdrObject);
-
-SdrAttrObj::SdrAttrObj()
+SdrAttrObj::SdrAttrObj(SdrModel& rSdrModel, const basegfx::B2DHomMatrix& rTransform)
+: SdrObject(rSdrModel, rTransform)
{
}
@@ -102,52 +97,15 @@ SdrAttrObj::~SdrAttrObj()
{
}
-const Rectangle& SdrAttrObj::GetSnapRect() const
-{
- if(bSnapRectDirty)
- {
- ((SdrAttrObj*)this)->RecalcSnapRect();
- ((SdrAttrObj*)this)->bSnapRectDirty = false;
- }
-
- return maSnapRect;
-}
-
-void SdrAttrObj::SetModel(SdrModel* pNewModel)
-{
- SdrModel* pOldModel = pModel;
-
- // test for correct pool in ItemSet; move to new pool if necessary
- if(pNewModel && GetObjectItemPool() && GetObjectItemPool() != &pNewModel->GetItemPool())
- {
- MigrateItemPool(GetObjectItemPool(), &pNewModel->GetItemPool(), pNewModel);
- }
-
- // call parent
- SdrObject::SetModel(pNewModel);
-
- // modify properties
- GetProperties().SetModel(pOldModel, pNewModel);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// syntactical sugar for ItemSet accesses
-
void __EXPORT SdrAttrObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
- SfxSimpleHint *pSimple = PTR_CAST(SfxSimpleHint, &rHint);
- sal_Bool bDataChg(pSimple && SFX_HINT_DATACHANGED == pSimple->GetId());
+ const SfxSimpleHint *pSimple = dynamic_cast< const SfxSimpleHint* >(&rHint);
+ bool bDataChg(pSimple && SFX_HINT_DATACHANGED == pSimple->GetId());
if(bDataChg)
{
- Rectangle aBoundRect = GetLastBoundRect();
- SetBoundRectDirty();
- SetRectsDirty(sal_True);
-
- // This may have lead to object change
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this, HINT_OBJCHG_ATTR);
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_CHGATTR, aBoundRect);
}
}
@@ -155,22 +113,23 @@ sal_Int32 SdrAttrObj::ImpGetLineWdt() const
{
sal_Int32 nRetval(0);
- if(XLINE_NONE != ((XLineStyleItem&)(GetObjectItem(XATTR_LINESTYLE))).GetValue())
+ if(XLINE_NONE != ((XLineStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE))).GetValue())
{
- nRetval = ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue();
+ nRetval = ((XLineWidthItem&)(GetProperties().GetObjectItemSet().Get(XATTR_LINEWIDTH))).GetValue();
}
return nRetval;
}
-sal_Bool SdrAttrObj::HasFill() const
+bool SdrAttrObj::HasFill() const
{
- return bClosedObj && ((XFillStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE))).GetValue()!=XFILL_NONE;
+ return IsClosedObj() && XFILL_NONE != ((XFillStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE))).GetValue();
}
-sal_Bool SdrAttrObj::HasLine() const
+bool SdrAttrObj::HasLine() const
{
- return ((XLineStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE))).GetValue()!=XLINE_NONE;
+ return XLINE_NONE != ((XLineStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE))).GetValue();
}
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 653b6ea4eb25..df50fbee3e33 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -27,7 +27,6 @@
#define _USE_MATH_DEFINES
#include <math.h>
-#include <vcl/metaact.hxx> // fuer TakeContour
#include <vcl/cvtsvm.hxx>
#include <tools/line.hxx>
#include <tools/bigint.hxx>
@@ -41,7 +40,6 @@
#include <svx/svddrag.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
-#include <svx/svdovirt.hxx> // Fuer Add/Del Ref
#include <svx/svdview.hxx> // fuer Dragging (Ortho abfragen)
#include "svx/svdglob.hxx" // StringCache
#include <svx/svdstr.hrc> // Objektname
@@ -87,12 +85,9 @@
#include <editeng/editeng.hxx>
#include <vcl/salbtype.hxx> // FRound
#include <svl/whiter.hxx>
-
-// #97849#
#include <svx/fmmodel.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/objface.hxx>
-#include "svdoimp.hxx"
#include <vcl/graphictools.hxx>
#include <svtools/colorcfg.hxx>
#include <svx/sdr/properties/emptyproperties.hxx>
@@ -110,66 +105,114 @@
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <drawinglayer/processor2d/contourextractor2d.hxx>
#include <drawinglayer/processor2d/linegeometryextractor2d.hxx>
-#include <svx/polysc3d.hxx>
#include "svx/svdotable.hxx"
#include "svx/shapepropertynotifier.hxx"
#include <svx/sdrhittesthelper.hxx>
#include <svx/svdundo.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/gluepoint.hxx>
#include <svx/sdrobjectfilter.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/sdr/contact/viewobjectcontact.hxx>
+#include <svx/sdrpagewindow.hxx>
using namespace ::com::sun::star;
-// #104018# replace macros above with type-detecting methods
-inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); }
-inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
-
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT0(SdrObjUserCall);
-
-SdrObjUserCall::~SdrObjUserCall()
+SdrObjectChangeBroadcaster::SdrObjectChangeBroadcaster(
+ const SdrObject& rSdrObject,
+ SdrHintKind eSdrHintKind)
+: SdrBaseHint(rSdrObject, eSdrHintKind)
{
}
-void SdrObjUserCall::Changed(const SdrObject& /*rObj*/, SdrUserCallType /*eType*/, const Rectangle& /*rOldBoundRect*/)
+SdrObjectChangeBroadcaster::~SdrObjectChangeBroadcaster()
{
-}
+ // no notifications when model is locked
+ if(GetSdrHintObject()->getSdrModelFromSdrObject().isLocked() )
+ {
+ return;
+ }
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ // UNO shape listener part
+ switch(GetSdrHintKind())
+ {
+ case HINT_OBJCHG_RESIZE:
+ {
+ GetSdrHintObject()->notifyShapePropertyChange( ::svx::eShapeSize );
+ // fall through - RESIZE might also imply a change of the position
+ }
+ case HINT_OBJCHG_MOVE:
+ {
+ GetSdrHintObject()->notifyShapePropertyChange( ::svx::eShapePosition );
+ break;
+ }
+ default:
+ {
+ // not interested in
+ break;
+ }
+ }
-TYPEINIT0(SdrObjUserData);
+ // broadcast to listeners directly listening at SdrObject
+ if(GetSdrHintObject()->HasListeners())
+ {
+ const_cast< SdrObject& >(*GetSdrHintObject()).Broadcast(*this);
+ }
-void SdrObjUserData::operator=(const SdrObjUserData& /*rData*/) // nicht implementiert
-{
+ // broadcast to listeners listening at SdrModel
+ const bool bObjectChange(GetSdrHintObject()->IsObjectInserted());
+
+ if(bObjectChange)
+ {
+ GetSdrHintObject()->getSdrModelFromSdrObject().Broadcast(*this);
+ }
+
+ // broadcast SdrObjList change up the hierarchy
+ SdrObjList* pParent = GetSdrHintObject()->getParentOfSdrObject();
+
+ while(pParent)
+ {
+ // tell parent about content change
+ pParent->handleContentChange(*this);
+
+ // get next upper SdrObject parent, ignore SdrPage
+ SdrObject* pParentObject = pParent->getSdrObjectFromSdrObjList();
+ pParent = pParentObject ? pParentObject->getParentOfSdrObject() : 0;
+ }
}
-sal_Bool SdrObjUserData::operator==(const SdrObjUserData& /*rData*/) const // nicht implementiert
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrObjUserData::SdrObjUserData(sal_uInt32 nInv, sal_uInt16 nId)
+: mnInventor(nInv),
+ mnIdentifier(nId)
{
- return sal_False;
}
-sal_Bool SdrObjUserData::operator!=(const SdrObjUserData& /*rData*/) const // nicht implementiert
+SdrObjUserData::SdrObjUserData(const SdrObjUserData& rData)
+: mnInventor(rData.mnInventor),
+ mnIdentifier(rData.mnIdentifier)
{
- return sal_False;
}
SdrObjUserData::~SdrObjUserData()
{
}
-FASTBOOL SdrObjUserData::HasMacro(const SdrObject* /*pObj*/) const
+bool SdrObjUserData::HasMacro(const SdrObject* /*pObj*/) const
{
- return sal_False;
+ return false;
}
SdrObject* SdrObjUserData::CheckMacroHit(const SdrObjMacroHitRec& rRec, const SdrObject* pObj) const
{
if(pObj)
{
- if(rRec.pPageView)
+ if(rRec.mpSdrView)
{
- return SdrObjectPrimitiveHit(*pObj, rRec.aPos, rRec.nTol, *rRec.pPageView, rRec.pVisiLayer, false);
+ return SdrObjectPrimitiveHit(*pObj, rRec.maPos, rRec.mfTol, *rRec.mpSdrView, false, 0);
}
}
@@ -181,10 +224,12 @@ Pointer SdrObjUserData::GetMacroPointer(const SdrObjMacroHitRec& /*rRec*/, const
return Pointer(POINTER_REFHAND);
}
-void SdrObjUserData::PaintMacro(OutputDevice& rOut, const Rectangle& /*rDirtyRect*/, const SdrObjMacroHitRec& /*rRec*/, const SdrObject* pObj) const
+void SdrObjUserData::PaintMacro(OutputDevice& rOut, const SdrObjMacroHitRec& /*rRec*/, const SdrObject* pObj) const
{
if(!pObj)
+ {
return;
+ }
const RasterOp eRop(rOut.GetRasterOp());
const basegfx::B2DPolyPolygon aPolyPolygon(pObj->TakeXorPoly());
@@ -202,9 +247,9 @@ void SdrObjUserData::PaintMacro(OutputDevice& rOut, const Rectangle& /*rDirtyRec
rOut.SetRasterOp(eRop);
}
-FASTBOOL SdrObjUserData::DoMacro(const SdrObjMacroHitRec& /*rRec*/, SdrObject* /*pObj*/)
+bool SdrObjUserData::DoMacro(const SdrObjMacroHitRec& /*rRec*/, SdrObject* /*pObj*/)
{
- return sal_False;
+ return false;
}
XubString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/, const SdrObject* /*pObj*/) const
@@ -212,107 +257,205 @@ XubString SdrObjUserData::GetMacroPopupComment(const SdrObjMacroHitRec& /*rRec*/
return String();
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrObjUserDataList::SdrObjUserDataList()
+: maList()
+{
+}
+
+SdrObjUserDataList::~SdrObjUserDataList()
+{
+ Clear();
+}
+
+SdrObjUserData* SdrObjUserDataList::GetUserData(sal_uInt32 nNum) const
+{
+ if(nNum < maList.size())
+ {
+ return *(maList.begin() + nNum);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrObjUserDataList::GetUserData access out of range (!)");
+ return 0;
+ }
+}
+
void SdrObjUserDataList::Clear()
{
- sal_uInt16 nAnz=GetUserDataCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- delete GetUserData(i);
+ for(SdrObjUserDataContainerType::iterator aCandidate(maList.begin());
+ aCandidate != maList.end(); aCandidate++)
+ {
+ delete *aCandidate;
}
- aList.Clear();
+
+ maList.clear();
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
+void SdrObjUserDataList::InsertUserData(SdrObjUserData* pData, sal_uInt32 nPos)
+{
+ if(nPos >= maList.size())
+ {
+ maList.push_back(pData);
+ }
+ else
+ {
+ maList.insert(maList.begin() + nPos, pData);
+ }
+}
-DBG_NAME(SdrObjGeoData);
+SdrObjUserData* SdrObjUserDataList::RemoveUserData(sal_uInt32 nNum)
+{
+ SdrObjUserData* pRetval = 0;
-SdrObjGeoData::SdrObjGeoData():
- pGPL(NULL),
- bMovProt(sal_False),
- bSizProt(sal_False),
- bNoPrint(sal_False),
- bClosedObj(sal_False),
- mbVisible(true),
- mnLayerID(0)
+ if(nNum < maList.size())
+ {
+ const SdrObjUserDataContainerType::iterator aCandidate(maList.begin() + nNum);
+
+ pRetval = *aCandidate;
+ maList.erase(aCandidate);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrObjUserDataList::RemoveUserData with wrong index (!)");
+ }
+
+ return pRetval;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrObjGeoData::SdrObjGeoData()
+: maSdrObjectTransformation(),
+ maObjectAnchor(0.0, 0.0),
+ mpGPL(0),
+ mnLayerID(0),
+ mbMoveProtect(false),
+ mbSizeProtect(false),
+ mbNoPrint(false),
+ mbVisible(true)
{
- DBG_CTOR(SdrObjGeoData,NULL);
}
SdrObjGeoData::~SdrObjGeoData()
{
- DBG_DTOR(SdrObjGeoData,NULL);
- delete pGPL;
+ delete mpGPL;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT0(SdrObjPlusData);
-
-SdrObjPlusData::SdrObjPlusData():
- pBroadcast(NULL),
- pUserDataList(NULL),
- pGluePoints(NULL),
- pAutoTimer(NULL)
+SdrObjPlusData::SdrObjPlusData()
+: mpUserDataList(0),
+ mpGluePoints(0),
+ maObjName(),
+ maObjTitle(),
+ maObjDescription(),
+ maHTMLName(),
+ maBLIPSizeRange(),
+ maObjectAnchor(0.0, 0.0)
{
}
SdrObjPlusData::~SdrObjPlusData()
{
- if (pBroadcast !=NULL) delete pBroadcast;
- if (pUserDataList!=NULL) delete pUserDataList;
- if (pGluePoints !=NULL) delete pGluePoints;
- if (pAutoTimer !=NULL) delete pAutoTimer;
+ if(mpUserDataList)
+ {
+ delete mpUserDataList;
+ }
+
+ if(mpGluePoints)
+ {
+ delete mpGluePoints;
+ }
}
SdrObjPlusData* SdrObjPlusData::Clone(SdrObject* pObj1) const
{
- SdrObjPlusData* pNeuPlusData=new SdrObjPlusData;
- if (pUserDataList!=NULL) {
- sal_uInt16 nAnz=pUserDataList->GetUserDataCount();
- if (nAnz!=0) {
- pNeuPlusData->pUserDataList=new SdrObjUserDataList;
- for (sal_uInt16 i=0; i<nAnz; i++) {
- SdrObjUserData* pNeuUserData=pUserDataList->GetUserData(i)->Clone(pObj1);
- if (pNeuUserData!=NULL) {
- pNeuPlusData->pUserDataList->InsertUserData(pNeuUserData);
- } else {
- DBG_ERROR("SdrObjPlusData::Clone(): UserData.Clone() liefert NULL");
+ SdrObjPlusData* pNeuPlusData = new SdrObjPlusData;
+
+ // copy UserData
+ if(mpUserDataList)
+ {
+ const sal_uInt32 nAnz(mpUserDataList->GetUserDataCount());
+
+ if(nAnz)
+ {
+ pNeuPlusData->mpUserDataList = new SdrObjUserDataList;
+
+ for(sal_uInt32 i(0); i < nAnz; i++)
+ {
+ SdrObjUserData* pNeuUserData = mpUserDataList->GetUserData(i)->Clone(pObj1);
+ OSL_ENSURE(pNeuUserData, "SdrObjPlusData::Clone(): UserData.Clone() liefert NULL");
+
+ if(pNeuUserData)
+ {
+ pNeuPlusData->mpUserDataList->InsertUserData(pNeuUserData);
}
}
}
}
- if (pGluePoints!=NULL) pNeuPlusData->pGluePoints=new SdrGluePointList(*pGluePoints);
- // MtfAnimator wird auch nicht mitkopiert
- // #i68101#
+ // copy GluePoints
+ if(mpGluePoints)
+ {
+ pNeuPlusData->mpGluePoints = new SdrGluePointList(*mpGluePoints);
+ }
+
// copy object name, title and description
- pNeuPlusData->aObjName = aObjName;
- pNeuPlusData->aObjTitle = aObjTitle;
- pNeuPlusData->aObjDescription = aObjDescription;
+ pNeuPlusData->maObjName = maObjName;
+ pNeuPlusData->maObjTitle = maObjTitle;
+ pNeuPlusData->maObjDescription = maObjDescription;
- if (pAutoTimer!=NULL) {
- pNeuPlusData->pAutoTimer=new AutoTimer;
- // Handler, etc. nicht mitkopieren!
+ // For HTMLName: Do not clone, leave uninitialized (empty string)
+
+ // copy maBLIPSizeRange if used
+ if(!maBLIPSizeRange.isEmpty())
+ {
+ pNeuPlusData->maBLIPSizeRange = maBLIPSizeRange;
}
- // For HTMLName: Do not clone, leave uninitialized (empty string)
+ // copy object anchor (sw only)
+ pNeuPlusData->maObjectAnchor = maObjectAnchor;
return pNeuPlusData;
}
+//////////////////////////////////////////////////////////////////////////////
+
+SdrObjTransformInfoRec::SdrObjTransformInfoRec()
+: mbSelectAllowed(true),
+ mbMoveAllowed(true),
+ mbResizeFreeAllowed(true),
+ mbResizePropAllowed(true),
+ mbRotateFreeAllowed(true),
+ mbRotate90Allowed(true),
+ mbMirrorFreeAllowed(true),
+ mbMirror45Allowed(true),
+ mbMirror90Allowed(true),
+ mbTransparenceAllowed(true),
+ mbGradientAllowed(true),
+ mbShearAllowed(true),
+ mbEdgeRadiusAllowed(true),
+ mbNoOrthoDesired(true),
+ mbNoContortion(true),
+ mbCanConvToPath(true),
+ mbCanConvToPoly(true),
+ mbCanConvToContour(false),
+ mbCanConvToPathLineToArea(true),
+ mbCanConvToPolyLineToArea(true)
+{
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@@@@ @@@@ @@@@@ @@@@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
+// helper to allow setting the SvxShape (UnoShape) at SdrObject, but only from SvxShape itself
+
+void SVX_DLLPUBLIC SetUnoShapeAtSdrObjectFromSvxShape(SdrObject& rSdrObject, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxUnoShape)
+{
+ rSdrObject.impl_setUnoShape(_rxUnoShape);
+}
//////////////////////////////////////////////////////////////////////////////
-// BaseProperties section
sdr::properties::BaseProperties* SdrObject::CreateObjectSpecificProperties()
{
@@ -323,133 +466,133 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const
{
if(!mpProperties)
{
- const_cast< SdrObject* >(this)->mpProperties =
- const_cast< SdrObject* >(this)->CreateObjectSpecificProperties();
+ const_cast< SdrObject* >(this)->mpProperties = const_cast< SdrObject* >(this)->CreateObjectSpecificProperties();
}
return *mpProperties;
}
-//////////////////////////////////////////////////////////////////////////////
-// ObjectUser section
-
-void SdrObject::AddObjectUser(sdr::ObjectUser& rNewUser)
+sdr::contact::ViewContact* SdrObject::CreateObjectSpecificViewContact()
{
- maObjectUsers.push_back(&rNewUser);
+ return new sdr::contact::ViewContactOfSdrObj(*this);
}
-void SdrObject::RemoveObjectUser(sdr::ObjectUser& rOldUser)
+sdr::contact::ViewContact& SdrObject::GetViewContact() const
{
- const ::sdr::ObjectUserVector::iterator aFindResult = ::std::find(maObjectUsers.begin(), maObjectUsers.end(), &rOldUser);
- if(aFindResult != maObjectUsers.end())
+ if(!mpViewContact)
{
- maObjectUsers.erase(aFindResult);
+ const_cast< SdrObject* >(this)->mpViewContact = const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact();
}
-}
-//////////////////////////////////////////////////////////////////////////////
-// #110094# DrawContact section
+ return *mpViewContact;
+}
-sdr::contact::ViewContact* SdrObject::CreateObjectSpecificViewContact()
+sdr::gluepoint::GluePointProvider* SdrObject::CreateObjectSpecificGluePointProvider()
{
- return new sdr::contact::ViewContactOfSdrObj(*this);
+ return new sdr::gluepoint::GluePointProvider();
}
-sdr::contact::ViewContact& SdrObject::GetViewContact() const
+sdr::gluepoint::GluePointProvider& SdrObject::GetGluePointProvider() const
{
- if(!mpViewContact)
+ if(!mpGluePointProvider)
{
- const_cast< SdrObject* >(this)->mpViewContact =
- const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact();
+ const_cast< SdrObject* >(this)->mpGluePointProvider = const_cast< SdrObject* >(this)->CreateObjectSpecificGluePointProvider();
}
- return *mpViewContact;
+ return *mpGluePointProvider;
}
-// DrawContact support: Methods for handling Object changes
void SdrObject::ActionChanged() const
{
// Do necessary ViewContact actions
GetViewContact().ActionChanged();
}
-//////////////////////////////////////////////////////////////////////////////
+SdrPage* SdrObject::getSdrPageFromSdrObject() const
+{
+ if(getParentOfSdrObject())
+ {
+ return getParentOfSdrObject()->getSdrPageFromSdrObjList();
+ }
+
+ return 0;
+}
-void SdrObject::SetBoundRectDirty()
+SdrModel& SdrObject::getSdrModelFromSdrObject() const
{
- aOutRect = Rectangle();
+ return mrSdrModelFromSdrObject;
}
-//////////////////////////////////////////////////////////////////////////////
+SdrObjList* SdrObject::getChildrenOfSdrObject() const
+{
+ // default has no children
+ return 0;
+}
-DBG_NAME(SdrObject);
-TYPEINIT1(SdrObject,SfxListener);
-
-SdrObject::SdrObject()
- :mpProperties(0L)
- ,mpViewContact(0L)
- ,pObjList(NULL)
- ,pPage(NULL)
- ,pModel(NULL)
- ,pUserCall(NULL)
- ,pPlusData(NULL)
- ,nOrdNum(0)
- ,mnNavigationPosition(SAL_MAX_UINT32)
- ,mnLayerID(0)
- ,mpSvxShape( NULL )
- ,maWeakUnoShape()
-{
- DBG_CTOR(SdrObject,NULL);
- bVirtObj =sal_False;
- bSnapRectDirty =sal_True;
- bNetLock =sal_False;
- bInserted =sal_False;
- bGrouped =sal_False;
- bMovProt =sal_False;
- bSizProt =sal_False;
- bNoPrint =sal_False;
- bEmptyPresObj =sal_False;
- bNotVisibleAsMaster=sal_False;
- bClosedObj =sal_False;
- mbVisible = true;
-
- // #i25616#
- mbLineIsOutsideGeometry = sal_False;
-
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
-
- //#110094#-1
- //bWriterFlyFrame =sal_False;
-
- bNotMasterCachable=sal_False;
- bIsEdge=sal_False;
- bIs3DObj=sal_False;
- bMarkProt=sal_False;
- bIsUnoObj=sal_False;
+void SdrObject::SetOrdNum(sal_uInt32 nOrdNum)
+{
+ if(mnOrdNum != nOrdNum)
+ {
+ mnOrdNum = nOrdNum;
+ }
}
-SdrObject::~SdrObject()
+void SdrObject::setParentOfSdrObject(SdrObjList* pNew)
{
- // tell all the registered ObjectUsers that the page is in destruction
- ::sdr::ObjectUserVector aListCopy(maObjectUsers.begin(), maObjectUsers.end());
- for(::sdr::ObjectUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); aIterator++)
+ if(getParentOfSdrObject() != pNew)
{
- sdr::ObjectUser* pObjectUser = *aIterator;
- DBG_ASSERT(pObjectUser, "SdrObject::~SdrObject: corrupt ObjectUser list (!)");
- pObjectUser->ObjectInDestruction(*this);
+ // remember current page
+ SdrPage* pOldPage = getSdrPageFromSdrObject();
+
+ // set new parent
+ mpParentOfSdrObject = pNew;
+
+ // get new page
+ SdrPage* pNewPage = getSdrPageFromSdrObject();
+
+ // broadcast page change over objects if needed
+ if(pOldPage != pNewPage)
+ {
+ handlePageChange(pOldPage, pNewPage);
+ }
}
+}
- // Clear the vector. This means that user do not need to call RemoveObjectUser()
- // when they get called from ObjectInDestruction().
- maObjectUsers.clear();
+SdrObject::SdrObject(SdrModel& rSdrModel, const basegfx::B2DHomMatrix& rTransform)
+: SfxListener(),
+ SfxBroadcaster(),
+ tools::WeakBase< SdrObject >(),
+ mrSdrModelFromSdrObject(rSdrModel),
+ mpProperties(0),
+ mpViewContact(0),
+ mpGluePointProvider(0),
+ mpSvxShape(0),
+ maWeakUnoShape(),
+ maSdrObjectTransformation(rTransform),
+ mpParentOfSdrObject(),
+ mpPlusData(0),
+ mnOrdNum(0),
+ mnLayerID(0),
+ mbMoveProtect(false),
+ mbSizeProtect(false),
+ mbNoPrint(false),
+ mbMarkProtect(false),
+ mbVisible(true),
+ mbEmptyPresObj(false),
+ mbNotVisibleAsMaster(false),
+ mbUniversalApplicationFlag01(false),
+ mbPasteResize(false)
+{
+}
+SdrObject::~SdrObject()
+{
try
{
SvxShape* pSvxShape = getSvxShape();
if ( pSvxShape )
{
- OSL_ENSURE(!pSvxShape->HasSdrObjectOwnership(),"Please check where this call come from and replace it with SdrObject::Free");
+ OSL_ENSURE(!pSvxShape->HasSdrObjectOwnership(),"Please check where this call come from and replace it with deleteSdrObjectSafeAndClearPointer");
pSvxShape->InvalidateSdrObject();
uno::Reference< lang::XComponent > xShapeComp( getWeakUnoShape(), uno::UNO_QUERY_THROW );
xShapeComp->dispose();
@@ -460,9 +603,11 @@ SdrObject::~SdrObject()
DBG_UNHANDLED_EXCEPTION();
}
- DBG_DTOR(SdrObject,NULL);
- SendUserCall(SDRUSERCALL_DELETE, GetLastBoundRect());
- if (pPlusData!=NULL) delete pPlusData;
+ if(mpPlusData)
+ {
+ delete mpPlusData;
+ mpPlusData = 0;
+ }
if(mpProperties)
{
@@ -470,116 +615,57 @@ SdrObject::~SdrObject()
mpProperties = 0L;
}
- // #110094#
if(mpViewContact)
{
delete mpViewContact;
mpViewContact = 0L;
}
-}
-
-void SdrObject::Free( SdrObject*& _rpObject )
-{
- SdrObject* pObject = _rpObject; _rpObject = NULL;
- if ( pObject == NULL )
- // nothing to do
- return;
- SvxShape* pShape = pObject->getSvxShape();
- if ( pShape && pShape->HasSdrObjectOwnership() )
- // only the shape is allowed to delete me, and will reset the ownership before doing so
- return;
-
- delete pObject;
-}
-
-SdrObjPlusData* SdrObject::NewPlusData() const
-{
- return new SdrObjPlusData;
-}
-
-void SdrObject::SetRectsDirty(sal_Bool bNotMyself)
-{
- if (!bNotMyself) {
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- }
- if (pObjList!=NULL) {
- pObjList->SetRectsDirty();
+ if(mpGluePointProvider)
+ {
+ delete mpGluePointProvider;
+ mpGluePointProvider = 0;
}
}
-void SdrObject::SetModel(SdrModel* pNewModel)
+void SdrObject::deleteSafe(SdrObject* pObject)
{
- if(pNewModel && pPage)
+ if(pObject)
{
- if(pPage->GetModel() != pNewModel)
+ SvxShape* pShape = pObject->getSvxShape();
+
+ if(pShape && pShape->HasSdrObjectOwnership())
{
- pPage = NULL;
+ // only the shape is allowed to delete me, and will reset the ownership before doing so
}
- }
+ else
+ {
+ // immediately broadcast to listeners directly listening at SdrObject
+ {
+ const SdrBaseHint aSdrBaseHint(*pObject, HINT_SDROBJECTDYING);
+ pObject->Broadcast(aSdrBaseHint);
+ }
- // update listeners at possible api wrapper object
- if( pModel != pNewModel )
- {
- SvxShape* pShape = getSvxShape();
- if( pShape )
- pShape->ChangeModel( pNewModel );
+ // delete SdrObject. This should be the onlylegal call to the
+ // SdrObject destructor
+ delete pObject;
+ }
}
-
- pModel = pNewModel;
}
-void SdrObject::SetObjList(SdrObjList* pNewObjList)
-{
- pObjList=pNewObjList;
-}
-
-void SdrObject::SetPage(SdrPage* pNewPage)
-{
- pPage=pNewPage;
- if (pPage!=NULL) {
- SdrModel* pMod=pPage->GetModel();
- if (pMod!=pModel && pMod!=NULL) {
- SetModel(pMod);
- }}
-}
-
-// init global static itempool
-SdrItemPool* SdrObject::mpGlobalItemPool = NULL;
-
-SdrItemPool& SdrObject::GetGlobalDrawObjectItemPool()
+SdrObjPlusData* SdrObject::NewPlusData() const
{
- if(!mpGlobalItemPool)
- {
- mpGlobalItemPool = new SdrItemPool();
- SfxItemPool* pGlobalOutlPool = EditEngine::CreatePool();
- mpGlobalItemPool->SetSecondaryPool(pGlobalOutlPool);
- mpGlobalItemPool->SetDefaultMetric((SfxMapUnit)SdrEngineDefaults::GetMapUnit());
- mpGlobalItemPool->FreezeIdRanges();
- }
-
- return *mpGlobalItemPool;
+ return new SdrObjPlusData;
}
-void SdrObject::FreeGlobalDrawObjectItemPool()
+void SdrObject::handlePageChange(SdrPage* /*pOldPage*/, SdrPage* /*pNewPage*/)
{
- // code for deletion of GlobalItemPool
- if(mpGlobalItemPool)
- {
- SfxItemPool* pGlobalOutlPool = mpGlobalItemPool->GetSecondaryPool();
- SfxItemPool::Free(mpGlobalItemPool);
- SfxItemPool::Free(pGlobalOutlPool);
- }
+ // nothing to do in the default
}
-SdrItemPool* SdrObject::GetObjectItemPool() const
+SfxItemPool& SdrObject::GetObjectItemPool() const
{
- if(pModel)
- return (SdrItemPool*)(&pModel->GetItemPool());
-
- // use a static global default pool
- return &SdrObject::GetGlobalDrawObjectItemPool();
+ return getSdrModelFromSdrObject().GetItemPool();
}
sal_uInt32 SdrObject::GetObjInventor() const
@@ -589,22 +675,22 @@ sal_uInt32 SdrObject::GetObjInventor() const
sal_uInt16 SdrObject::GetObjIdentifier() const
{
- return sal_uInt16(OBJ_NONE);
+ return static_cast< sal_uInt16 >(OBJ_NONE);
}
void SdrObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bRotateFreeAllowed=sal_False;
- rInfo.bMirrorFreeAllowed=sal_False;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed =sal_False;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bCanConvToPath =sal_False;
- rInfo.bCanConvToPoly =sal_False;
- rInfo.bCanConvToContour = sal_False;
- rInfo.bCanConvToPathLineToArea=sal_False;
- rInfo.bCanConvToPolyLineToArea=sal_False;
+ rInfo.mbRotateFreeAllowed = false;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbCanConvToPath = false;
+ rInfo.mbCanConvToPoly = false;
+ rInfo.mbCanConvToContour = false;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
}
SdrLayerID SdrObject::GetLayer() const
@@ -615,131 +701,63 @@ SdrLayerID SdrObject::GetLayer() const
void SdrObject::getMergedHierarchyLayerSet(SetOfByte& rSet) const
{
rSet.Set(GetLayer());
- SdrObjList* pOL=GetSubList();
- if (pOL!=NULL) {
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz; nObjNum++) {
- pOL->GetObj(nObjNum)->getMergedHierarchyLayerSet(rSet);
- }
- }
}
-void SdrObject::NbcSetLayer(SdrLayerID nLayer)
+void SdrObject::SetLayer(SdrLayerID nLayer)
{
if(GetLayer() != nLayer)
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
mnLayerID = nLayer;
+ SetChanged();
}
}
-void SdrObject::SetLayer(SdrLayerID nLayer)
-{
- NbcSetLayer(nLayer);
- SetChanged();
- BroadcastObjectChange();
-}
-
-void SdrObject::AddListener(SfxListener& rListener)
-{
- ImpForcePlusData();
- if (pPlusData->pBroadcast==NULL) pPlusData->pBroadcast=new SfxBroadcaster;
- rListener.StartListening(*pPlusData->pBroadcast);
-}
-
-void SdrObject::RemoveListener(SfxListener& rListener)
-{
- if (pPlusData!=NULL && pPlusData->pBroadcast!=NULL) {
- rListener.EndListening(*pPlusData->pBroadcast);
- if (!pPlusData->pBroadcast->HasListeners()) {
- delete pPlusData->pBroadcast;
- pPlusData->pBroadcast=NULL;
- }
- }
-}
-
-void SdrObject::AddReference(SdrVirtObj& rVrtObj)
-{
- AddListener(rVrtObj);
-}
-
-void SdrObject::DelReference(SdrVirtObj& rVrtObj)
+SdrObject* SdrObject::GetParentSdrObject() const
{
- RemoveListener(rVrtObj);
-}
-
-AutoTimer* SdrObject::ForceAutoTimer()
-{
- ImpForcePlusData();
- if (pPlusData->pAutoTimer==NULL) pPlusData->pAutoTimer=new AutoTimer;
- return pPlusData->pAutoTimer;
-}
-
-FASTBOOL SdrObject::HasRefPoint() const
-{
- return sal_False;
-}
-
-Point SdrObject::GetRefPoint() const
-{
- return GetCurrentBoundRect().Center();
-}
-
-void SdrObject::SetRefPoint(const Point& /*rPnt*/)
-{
-}
-
-SdrObjList* SdrObject::GetSubList() const
-{
- return NULL;
-}
-
-SdrObject* SdrObject::GetUpGroup() const
-{
- return pObjList!=NULL ? pObjList->GetOwnerObj() : NULL;
+ return getParentOfSdrObject()
+ ? getParentOfSdrObject()->getSdrObjectFromSdrObjList()
+ : 0;
}
void SdrObject::SetName(const String& rStr)
{
- if(rStr.Len() && !pPlusData)
+ if(rStr.Len() && !mpPlusData)
{
ImpForcePlusData();
}
- if(pPlusData && pPlusData->aObjName != rStr)
+ if(mpPlusData && mpPlusData->maObjName != rStr)
{
- // --> OD 2009-07-09 #i73249#
// Undo/Redo for setting object's name
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
bool bUndo( false );
- if ( GetModel() && GetModel()->IsUndoEnabled() )
+
+ if(getSdrModelFromSdrObject().IsUndoEnabled())
{
bUndo = true;
- SdrUndoAction* pUndoAction =
- GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
- *this,
- SdrUndoObjStrAttr::OBJ_NAME,
- GetName(),
- rStr );
- GetModel()->BegUndo( pUndoAction->GetComment() );
- GetModel()->AddUndo( pUndoAction );
+ SdrUndoAction* pUndoAction = getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this, SdrUndoObjStrAttr::OBJ_NAME, GetName(), rStr);
+ getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
+ getSdrModelFromSdrObject().AddUndo( pUndoAction );
}
- // <--
- pPlusData->aObjName = rStr;
- // --> OD 2009-07-09 #i73249#
- if ( bUndo )
+
+ mpPlusData->maObjName = rStr;
+
+ if(bUndo)
{
- GetModel()->EndUndo();
+ getSdrModelFromSdrObject().EndUndo();
}
- // <--
+
SetChanged();
- BroadcastObjectChange();
}
}
String SdrObject::GetName() const
{
- if(pPlusData)
+ if(mpPlusData)
{
- return pPlusData->aObjName;
+ return mpPlusData->maObjName;
}
return String();
@@ -747,46 +765,42 @@ String SdrObject::GetName() const
void SdrObject::SetTitle(const String& rStr)
{
- if(rStr.Len() && !pPlusData)
+ if(rStr.Len() && !mpPlusData)
{
ImpForcePlusData();
}
- if(pPlusData && pPlusData->aObjTitle != rStr)
+ if(mpPlusData && mpPlusData->maObjTitle != rStr)
{
- // --> OD 2009-07-13 #i73249#
// Undo/Redo for setting object's title
bool bUndo( false );
- if ( GetModel() && GetModel()->IsUndoEnabled() )
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
+ if(getSdrModelFromSdrObject().IsUndoEnabled())
{
bUndo = true;
- SdrUndoAction* pUndoAction =
- GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
- *this,
- SdrUndoObjStrAttr::OBJ_TITLE,
- GetTitle(),
- rStr );
- GetModel()->BegUndo( pUndoAction->GetComment() );
- GetModel()->AddUndo( pUndoAction );
+ SdrUndoAction* pUndoAction = getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this, SdrUndoObjStrAttr::OBJ_TITLE, GetTitle(), rStr );
+ getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
+ getSdrModelFromSdrObject().AddUndo( pUndoAction );
}
- // <--
- pPlusData->aObjTitle = rStr;
- // --> OD 2009-07-13 #i73249#
- if ( bUndo )
+
+ mpPlusData->maObjTitle = rStr;
+
+ if(bUndo)
{
- GetModel()->EndUndo();
+ getSdrModelFromSdrObject().EndUndo();
}
- // <--
+
SetChanged();
- BroadcastObjectChange();
}
}
String SdrObject::GetTitle() const
{
- if(pPlusData)
+ if(mpPlusData)
{
- return pPlusData->aObjTitle;
+ return mpPlusData->maObjTitle;
}
return String();
@@ -794,46 +808,42 @@ String SdrObject::GetTitle() const
void SdrObject::SetDescription(const String& rStr)
{
- if(rStr.Len() && !pPlusData)
+ if(rStr.Len() && !mpPlusData)
{
ImpForcePlusData();
}
- if(pPlusData && pPlusData->aObjDescription != rStr)
+ if(mpPlusData && mpPlusData->maObjDescription != rStr)
{
- // --> OD 2009-07-13 #i73249#
// Undo/Redo for setting object's description
bool bUndo( false );
- if ( GetModel() && GetModel()->IsUndoEnabled() )
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
+ if(getSdrModelFromSdrObject().IsUndoEnabled())
{
bUndo = true;
- SdrUndoAction* pUndoAction =
- GetModel()->GetSdrUndoFactory().CreateUndoObjectStrAttr(
- *this,
- SdrUndoObjStrAttr::OBJ_DESCRIPTION,
- GetDescription(),
- rStr );
- GetModel()->BegUndo( pUndoAction->GetComment() );
- GetModel()->AddUndo( pUndoAction );
+ SdrUndoAction* pUndoAction = getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoObjectStrAttr(
+ *this, SdrUndoObjStrAttr::OBJ_DESCRIPTION, GetDescription(), rStr );
+ getSdrModelFromSdrObject().BegUndo( pUndoAction->GetComment() );
+ getSdrModelFromSdrObject().AddUndo( pUndoAction );
}
- // <--
- pPlusData->aObjDescription = rStr;
- // --> OD 2009-07-13 #i73249#
- if ( bUndo )
+
+ mpPlusData->maObjDescription = rStr;
+
+ if(bUndo)
{
- GetModel()->EndUndo();
+ getSdrModelFromSdrObject().EndUndo();
}
- // <--
+
SetChanged();
- BroadcastObjectChange();
}
}
String SdrObject::GetDescription() const
{
- if(pPlusData)
+ if(mpPlusData)
{
- return pPlusData->aObjDescription;
+ return mpPlusData->maObjDescription;
}
return String();
@@ -841,235 +851,172 @@ String SdrObject::GetDescription() const
void SdrObject::SetHTMLName(const String& rStr)
{
- if(rStr.Len() && !pPlusData)
+ if(rStr.Len() && !mpPlusData)
{
ImpForcePlusData();
}
- if(pPlusData && pPlusData->aObjName != rStr)
+ if(mpPlusData && mpPlusData->maObjName != rStr)
{
- pPlusData->aHTMLName = rStr;
+ mpPlusData->maHTMLName = rStr;
SetChanged();
}
}
String SdrObject::GetHTMLName() const
{
- if(pPlusData)
+ if(mpPlusData)
{
- return pPlusData->aHTMLName;
+ return mpPlusData->maHTMLName;
}
return String();
}
-sal_uInt32 SdrObject::GetOrdNum() const
+sal_uInt32 SdrObject::GetNavigationPosition() const
{
- if (pObjList!=NULL) {
- if (pObjList->IsObjOrdNumsDirty()) {
- pObjList->RecalcObjOrdNums();
- }
- } else ((SdrObject*)this)->nOrdNum=0;
- return nOrdNum;
-}
-
-
-
-
-sal_uInt32 SdrObject::GetNavigationPosition (void)
-{
- if (pObjList!=NULL && pObjList->RecalcNavigationPositions())
- {
- return mnNavigationPosition;
- }
- else
- return GetOrdNum();
-}
-
-
-
-
-void SdrObject::SetNavigationPosition (const sal_uInt32 nNewPosition)
-{
- mnNavigationPosition = nNewPosition;
-}
-
-
-
-
-// #111111#
-// To make clearer that this method may trigger RecalcBoundRect and thus may be
-// expensive and somtimes problematic (inside a bigger object change You will get
-// non-useful BoundRects sometimes) i rename that method from GetBoundRect() to
-// GetCurrentBoundRect().
-const Rectangle& SdrObject::GetCurrentBoundRect() const
-{
- if(aOutRect.IsEmpty())
+ if(!getParentOfSdrObject())
{
- const_cast< SdrObject* >(this)->RecalcBoundRect();
+ return 0;
}
- return aOutRect;
+ return mnOrdNum;
}
-// #111111#
-// To have a possibility to get the last calculated BoundRect e.g for producing
-// the first rectangle for repaints (old and new need to be used) without forcing
-// a RecalcBoundRect (which may be problematical and expensive sometimes) i add here
-// a new method for accessing the last BoundRect.
-const Rectangle& SdrObject::GetLastBoundRect() const
+const basegfx::B2DRange& SdrObject::getObjectRange(const SdrView* pSdrView) const
{
- return aOutRect;
-}
-
-void SdrObject::RecalcBoundRect()
-{
- // #i101680# suppress BoundRect calculations on import(s)
- if(pModel && pModel->isLocked())
- return;
-
- // central new method which will calculate the BoundRect using primitive geometry
- if(aOutRect.IsEmpty())
+ // try to get the view dependent range first
+ if(pSdrView)
{
- const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence());
+ const SdrPageView* pSdrPageView = pSdrView->GetSdrPageView();
- if(xPrimitives.hasElements())
+ if(pSdrPageView)
{
- // use neutral ViewInformation and get the range of the primitives
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
- const basegfx::B2DRange aRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D));
+ if(1 == pSdrPageView->PageWindowCount())
+ {
+ const sdr::contact::ViewObjectContact& rViewObjectContact = GetViewContact().GetViewObjectContact(
+ pSdrPageView->GetPageWindow(0)->GetObjectContact());
- if(!aRange.isEmpty())
+ return rViewObjectContact.getViewDependentRange();
+ }
+ else
{
- aOutRect = Rectangle(
- (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()),
- (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY()));
- return;
+ OSL_ENSURE(false, "no unique ObjectContact found, determine one yourself and get the range from there (!)");
}
}
}
+
+ // no ObjectContact found, fallback to view-independent range
+ return GetViewContact().getViewIndependentRange();
}
-void SdrObject::BroadcastObjectChange() const
+const basegfx::B2DRange& SdrObject::getSnapRange() const
{
- if( pModel && pModel->isLocked() )
- return;
-
- sal_Bool bPlusDataBroadcast(pPlusData && pPlusData->pBroadcast);
- sal_Bool bObjectChange(IsInserted() && pModel);
-
- if(bPlusDataBroadcast || bObjectChange)
- {
- SdrHint aHint(*this);
-
- if(bPlusDataBroadcast)
- {
- pPlusData->pBroadcast->Broadcast(aHint);
- }
-
- if(bObjectChange)
- {
- pModel->Broadcast(aHint);
- }
- }
+ return GetViewContact().getSnapRange();
}
void SdrObject::SetChanged()
{
- // #110094#-11
- // For test purposes, use the new ViewContact for change
- // notification now.
ActionChanged();
- if(IsInserted() && pModel)
+ if(IsObjectInserted())
{
- pModel->SetChanged();
+ getSdrModelFromSdrObject().SetChanged();
}
}
// Tooling for painting a single object to a OutputDevice.
-sal_Bool SdrObject::SingleObjectPainter(OutputDevice& rOut) const
+bool SdrObject::SingleObjectPainter(OutputDevice& rOut) const
{
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(const_cast< SdrObject* >(this));
- sdr::contact::ObjectContactOfObjListPainter aPainter(rOut, aObjectVector, GetPage());
+ sdr::contact::ObjectContactOfObjListPainter aPainter(rOut, aObjectVector, getSdrPageFromSdrObject());
sdr::contact::DisplayInfo aDisplayInfo;
// do processing
aPainter.ProcessDisplay(aDisplayInfo);
- return sal_True;
+ return true;
}
-sal_Bool SdrObject::LineGeometryUsageIsNecessary() const
+bool SdrObject::LineGeometryUsageIsNecessary() const
{
- XLineStyle eXLS = (XLineStyle)((const XLineStyleItem&)GetMergedItem(XATTR_LINESTYLE)).GetValue();
- return (eXLS != XLINE_NONE);
-}
+ const XLineStyle eXLS((XLineStyle)((const XLineStyleItem&)GetMergedItem(XATTR_LINESTYLE)).GetValue());
-SdrObject* SdrObject::Clone() const
-{
- SdrObject* pObj=SdrObjFactory::MakeNewObject(GetObjInventor(),GetObjIdentifier(),NULL);
- if (pObj!=NULL) {
- pObj->pModel=pModel;
- pObj->pPage=pPage;
- *pObj=*this;
- }
- return pObj;
+ return (XLINE_NONE != eXLS);
}
-void SdrObject::operator=(const SdrObject& rObj)
+void SdrObject::copyDataFromSdrObject(const SdrObject& rSource)
{
- if(mpProperties)
+ if(this != &rSource)
{
- delete mpProperties;
- mpProperties = 0L;
- }
+ if(mpProperties)
+ {
+ delete mpProperties;
+ mpProperties = 0;
+ }
- // #110094#
- if(mpViewContact)
- {
- delete mpViewContact;
- mpViewContact = 0L;
- }
+ if(rSource.mpProperties)
+ {
+ mpProperties = &rSource.GetProperties().Clone(*this);
+ }
- // The Clone() method uses the local copy constructor from the individual
- // sdr::properties::BaseProperties class. Since the target class maybe for another
- // draw object a SdrObject needs to be provided, as in the nromal constructor.
- mpProperties = &rObj.GetProperties().Clone(*this);
-
- pModel =rObj.pModel;
- aOutRect=rObj.aOutRect;
- mnLayerID = rObj.mnLayerID;
- aAnchor =rObj.aAnchor;
- bVirtObj=rObj.bVirtObj;
- bSizProt=rObj.bSizProt;
- bMovProt=rObj.bMovProt;
- bNoPrint=rObj.bNoPrint;
- mbVisible=rObj.mbVisible;
- bMarkProt=rObj.bMarkProt;
- //EmptyPresObj wird nicht kopiert: nun doch! (25-07-1995, Joe)
- bEmptyPresObj =rObj.bEmptyPresObj;
- //NotVisibleAsMaster wird nicht kopiert: nun doch! (25-07-1995, Joe)
- bNotVisibleAsMaster=rObj.bNotVisibleAsMaster;
- bSnapRectDirty=sal_True; //rObj.bSnapRectDirty;
- bNotMasterCachable=rObj.bNotMasterCachable;
- if (pPlusData!=NULL) { delete pPlusData; pPlusData=NULL; }
- if (rObj.pPlusData!=NULL) {
- pPlusData=rObj.pPlusData->Clone(this);
- }
- if (pPlusData!=NULL && pPlusData->pBroadcast!=NULL) {
- delete pPlusData->pBroadcast; // der Broadcaster wird nicht mitkopiert
- pPlusData->pBroadcast=NULL;
+ if(mpViewContact)
+ {
+ delete mpViewContact;
+ mpViewContact = 0;
+ }
+
+ if(mpGluePointProvider)
+ {
+ delete mpGluePointProvider;
+ mpGluePointProvider = 0;
+ }
+
+ if(rSource.mpGluePointProvider)
+ {
+ mpGluePointProvider = &rSource.GetGluePointProvider().Clone();
+ }
+
+ maSdrObjectTransformation = rSource.maSdrObjectTransformation.getB2DHomMatrix();
+ mnLayerID = rSource.mnLayerID;
+ mbMoveProtect = rSource.mbMoveProtect;
+ mbSizeProtect = rSource.mbSizeProtect;
+ mbNoPrint = rSource.mbNoPrint;
+ mbMarkProtect = rSource.mbMarkProtect;
+ mbVisible = rSource.mbVisible;
+ mbEmptyPresObj = rSource.mbEmptyPresObj;
+ mbNotVisibleAsMaster = rSource.mbNotVisibleAsMaster;
+
+ if(mpPlusData)
+ {
+ delete mpPlusData;
+ mpPlusData = 0;
+ }
+
+ if(rSource.mpPlusData)
+ {
+ mpPlusData = rSource.mpPlusData->Clone(this);
+ }
}
}
-void SdrObject::TakeObjNameSingul(XubString& rName) const
+SdrObject* SdrObject::CloneSdrObject(SdrModel* pTargetModel) const
{
- rName=ImpGetResStr(STR_ObjNameSingulNONE);
+ SdrObject* pClone = new SdrObject(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+ return pClone;
+}
+
+void SdrObject::TakeObjNameSingul(XubString& rName) const
+{
+ rName = ImpGetResStr(STR_ObjNameSingulNONE);
String aName( GetName() );
+
if(aName.Len())
{
rName += sal_Unicode(' ');
@@ -1081,10 +1028,10 @@ void SdrObject::TakeObjNameSingul(XubString& rName) const
void SdrObject::TakeObjNamePlural(XubString& rName) const
{
- rName=ImpGetResStr(STR_ObjNamePluralNONE);
+ rName = ImpGetResStr(STR_ObjNamePluralNONE);
}
-void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 nVal) const
+void SdrObject::TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 nVal) const
{
rStr = ImpGetResStr(nStrCacheID);
@@ -1111,262 +1058,85 @@ void SdrObject::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, s
}
}
-XubString SdrObject::GetWinkStr(long nWink, FASTBOOL bNoDegChar) const
+XubString SdrObject::GetWinkStr(sal_Int32 nWink, bool bNoDegChar) const
{
XubString aStr;
- if (pModel!=NULL) {
- pModel->TakeWinkStr(nWink,aStr,bNoDegChar);
- }
+
+ getSdrModelFromSdrObject().TakeWinkStr(nWink, aStr, bNoDegChar);
+
return aStr;
}
-XubString SdrObject::GetMetrStr(long nVal, MapUnit /*eWantMap*/, FASTBOOL bNoUnitChars) const
+XubString SdrObject::GetMetrStr(sal_Int32 nVal, MapUnit /*eWantMap*/, bool bNoUnitChars) const
{
XubString aStr;
- if (pModel!=NULL) {
- pModel->TakeMetricStr(nVal,aStr,bNoUnitChars);
- }
- return aStr;
-}
-basegfx::B2DPolyPolygon SdrObject::TakeXorPoly() const
-{
- basegfx::B2DPolyPolygon aRetval;
- const Rectangle aR(GetCurrentBoundRect());
- const basegfx::B2DRange aRange(aR.Left(), aR.Top(), aR.Right(), aR.Bottom());
- aRetval.append(basegfx::tools::createPolygonFromRect(aRange));
+ getSdrModelFromSdrObject().TakeMetricStr(nVal, aStr, bNoUnitChars);
- return aRetval;
+ return aStr;
}
-basegfx::B2DPolyPolygon SdrObject::TakeContour() const
+basegfx::B2DPolyPolygon SdrObject::TakeXorPoly() const
{
- basegfx::B2DPolyPolygon aRetval;
-
- // create cloned object without text, but with XLINE_SOLID,
- // COL_BLACK as line color and XFILL_NONE
- SdrObject* pClone = Clone();
-
- if(pClone)
- {
- const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >(this);
-
- if(pTextObj)
- {
- // no text and no text animation
- pClone->SetMergedItem(SdrTextAniKindItem(SDRTEXTANI_NONE));
- pClone->SetOutlinerParaObject(0);
- }
-
- const SdrEdgeObj* pEdgeObj = dynamic_cast< const SdrEdgeObj* >(this);
-
- if(pEdgeObj)
- {
- // create connections if connector, will be cleaned up when
- // deleting the connector again
- SdrObject* pLeft = pEdgeObj->GetConnectedNode(sal_True);
- SdrObject* pRight = pEdgeObj->GetConnectedNode(sal_False);
-
- if(pLeft)
- {
- pClone->ConnectToNode(sal_True, pLeft);
- }
-
- if(pRight)
- {
- pClone->ConnectToNode(sal_False, pRight);
- }
- }
-
- SfxItemSet aNewSet(*GetObjectItemPool());
-
- // #i101980# ignore LineWidth; that's what the old implementation
- // did. With linewidth, the result may be huge due to fat/thick
- // line decompositions
- aNewSet.Put(XLineWidthItem(0));
-
- // solid black lines and no fill
- aNewSet.Put(XLineStyleItem(XLINE_SOLID));
- aNewSet.Put(XLineColorItem(String(), Color(COL_BLACK)));
- aNewSet.Put(XFillStyleItem(XFILL_NONE));
- pClone->SetMergedItemSet(aNewSet);
-
- // get sequence from clone
- const sdr::contact::ViewContact& rVC(pClone->GetViewContact());
- const drawinglayer::primitive2d::Primitive2DSequence xSequence(rVC.getViewIndependentPrimitive2DSequence());
-
- if(xSequence.hasElements())
- {
- // use neutral ViewInformation
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
-
- // create extractor, process and get result (with hairlines as opened polygons)
- drawinglayer::processor2d::ContourExtractor2D aExtractor(aViewInformation2D, false);
- aExtractor.process(xSequence);
- const basegfx::B2DPolyPolygonVector& rResult(aExtractor.getExtractedContour());
- const sal_uInt32 nSize(rResult.size());
-
- // when count is one, it is implied that the object has only it's normal
- // contour anyways and TakeCountour() is to return an empty PolyPolygon
- // (see old implementation for historical reasons)
- if(nSize > 1)
- {
- // the topology for contour is correctly a vector of PolyPolygons; for
- // historical reasons cut it back to a single PolyPolygon here
- for(sal_uInt32 a(0); a < nSize; a++)
- {
- aRetval.append(rResult[a]);
- }
- }
- }
-
- delete pClone;
- }
-
- return aRetval;
+ return basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange(0)));
}
-sal_uInt32 SdrObject::GetHdlCount() const
+void SdrObject::AddToHdlList(SdrHdlList& rHdlList) const
{
- return 8L;
-}
+ const basegfx::B2DHomMatrix& rObjTrans = getSdrObjectTransformation();
-SdrHdl* SdrObject::GetHdl(sal_uInt32 nHdlNum) const
-{
- SdrHdl* pH=NULL;
- const Rectangle& rR=GetSnapRect();
- switch (nHdlNum) {
- case 0: pH=new SdrHdl(rR.TopLeft(), HDL_UPLFT); break; // Oben links
- case 1: pH=new SdrHdl(rR.TopCenter(), HDL_UPPER); break; // Oben
- case 2: pH=new SdrHdl(rR.TopRight(), HDL_UPRGT); break; // Oben rechts
- case 3: pH=new SdrHdl(rR.LeftCenter(), HDL_LEFT ); break; // Links
- case 4: pH=new SdrHdl(rR.RightCenter(), HDL_RIGHT); break; // Rechts
- case 5: pH=new SdrHdl(rR.BottomLeft(), HDL_LWLFT); break; // Unten links
- case 6: pH=new SdrHdl(rR.BottomCenter(),HDL_LOWER); break; // Unten
- case 7: pH=new SdrHdl(rR.BottomRight(), HDL_LWRGT); break; // Unten rechts
- }
- return pH;
+ new SdrHdl(rHdlList, this, HDL_UPLFT, rObjTrans * basegfx::B2DPoint(0.0, 0.0)); // TopLeft
+ new SdrHdl(rHdlList, this, HDL_UPPER, rObjTrans * basegfx::B2DPoint(0.5, 0.0)); // Top
+ new SdrHdl(rHdlList, this, HDL_UPRGT, rObjTrans * basegfx::B2DPoint(1.0, 0.0)); // TopRight
+ new SdrHdl(rHdlList, this, HDL_LEFT , rObjTrans * basegfx::B2DPoint(0.0, 0.5)); // Left
+ new SdrHdl(rHdlList, this, HDL_RIGHT, rObjTrans * basegfx::B2DPoint(1.0, 0.5)); // Right
+ new SdrHdl(rHdlList, this, HDL_LWLFT, rObjTrans * basegfx::B2DPoint(0.0, 1.0)); // BottomLeft
+ new SdrHdl(rHdlList, this, HDL_LOWER, rObjTrans * basegfx::B2DPoint(0.5, 1.0)); // Bottom
+ new SdrHdl(rHdlList, this, HDL_LWRGT, rObjTrans * basegfx::B2DPoint(1.0, 1.0)); // BottomRight
}
sal_uInt32 SdrObject::GetPlusHdlCount(const SdrHdl& /*rHdl*/) const
{
- return 0L;
-}
-
-SdrHdl* SdrObject::GetPlusHdl(const SdrHdl& /*rHdl*/, sal_uInt32 /*nPlNum*/) const
-{
- return 0L;
+ return 0;
}
-void SdrObject::AddToHdlList(SdrHdlList& rHdlList) const
+void SdrObject::GetPlusHdl(SdrHdlList& /*rHdlList*/, const SdrObject& /*rSdrObject*/, const SdrHdl& /*rHdl*/, sal_uInt32 /*nPlNum*/) const
{
- sal_uInt32 nAnz=GetHdlCount();
- for (sal_uInt32 i=0L; i<nAnz; i++) {
- SdrHdl* pHdl=GetHdl(i);
- if (pHdl!=NULL) {
- rHdlList.AddHdl(pHdl);
- }
- }
}
-Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const
-{
- Rectangle aTmpRect(GetSnapRect());
- Rectangle aRect(aTmpRect);
- const SdrHdl* pHdl=rDrag.GetHdl();
- SdrHdlKind eHdl=pHdl==NULL ? HDL_MOVE : pHdl->GetKind();
- FASTBOOL bEcke=(eHdl==HDL_UPLFT || eHdl==HDL_UPRGT || eHdl==HDL_LWLFT || eHdl==HDL_LWRGT);
- FASTBOOL bOrtho=rDrag.GetView()!=NULL && rDrag.GetView()->IsOrtho();
- FASTBOOL bBigOrtho=bEcke && bOrtho && rDrag.GetView()->IsBigOrtho();
- Point aPos(rDrag.GetNow());
- FASTBOOL bLft=(eHdl==HDL_UPLFT || eHdl==HDL_LEFT || eHdl==HDL_LWLFT);
- FASTBOOL bRgt=(eHdl==HDL_UPRGT || eHdl==HDL_RIGHT || eHdl==HDL_LWRGT);
- FASTBOOL bTop=(eHdl==HDL_UPRGT || eHdl==HDL_UPPER || eHdl==HDL_UPLFT);
- FASTBOOL bBtm=(eHdl==HDL_LWRGT || eHdl==HDL_LOWER || eHdl==HDL_LWLFT);
- if (bLft) aTmpRect.Left() =aPos.X();
- if (bRgt) aTmpRect.Right() =aPos.X();
- if (bTop) aTmpRect.Top() =aPos.Y();
- if (bBtm) aTmpRect.Bottom()=aPos.Y();
- if (bOrtho) { // Ortho
- long nWdt0=aRect.Right() -aRect.Left();
- long nHgt0=aRect.Bottom()-aRect.Top();
- long nXMul=aTmpRect.Right() -aTmpRect.Left();
- long nYMul=aTmpRect.Bottom()-aTmpRect.Top();
- long nXDiv=nWdt0;
- long nYDiv=nHgt0;
- FASTBOOL bXNeg=(nXMul<0)!=(nXDiv<0);
- FASTBOOL bYNeg=(nYMul<0)!=(nYDiv<0);
- nXMul=Abs(nXMul);
- nYMul=Abs(nYMul);
- nXDiv=Abs(nXDiv);
- nYDiv=Abs(nYDiv);
- Fraction aXFact(nXMul,nXDiv); // Fractions zum kuerzen
- Fraction aYFact(nYMul,nYDiv); // und zum vergleichen
- nXMul=aXFact.GetNumerator();
- nYMul=aYFact.GetNumerator();
- nXDiv=aXFact.GetDenominator();
- nYDiv=aYFact.GetDenominator();
- if (bEcke) { // Eckpunkthandles
- FASTBOOL bUseX=(aXFact<aYFact) != bBigOrtho;
- if (bUseX) {
- long nNeed=long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
- if (bYNeg) nNeed=-nNeed;
- if (bTop) aTmpRect.Top()=aTmpRect.Bottom()-nNeed;
- if (bBtm) aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
- } else {
- long nNeed=long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
- if (bXNeg) nNeed=-nNeed;
- if (bLft) aTmpRect.Left()=aTmpRect.Right()-nNeed;
- if (bRgt) aTmpRect.Right()=aTmpRect.Left()+nNeed;
- }
- } else { // Scheitelpunkthandles
- if ((bLft || bRgt) && nXDiv!=0) {
- long nHgt0b=aRect.Bottom()-aRect.Top();
- long nNeed=long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
- aTmpRect.Top()-=(nNeed-nHgt0b)/2;
- aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
- }
- if ((bTop || bBtm) && nYDiv!=0) {
- long nWdt0b=aRect.Right()-aRect.Left();
- long nNeed=long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
- aTmpRect.Left()-=(nNeed-nWdt0b)/2;
- aTmpRect.Right()=aTmpRect.Left()+nNeed;
- }
- }
- }
- aTmpRect.Justify();
- return aTmpRect;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
bool SdrObject::hasSpecialDrag() const
{
+ // default has no special drag
return false;
}
bool SdrObject::supportsFullDrag() const
{
+ // default supports full drag
return true;
}
SdrObject* SdrObject::getFullDragClone() const
{
// default uses simple clone
- return Clone();
+ return CloneSdrObject();
}
bool SdrObject::beginSpecialDrag(SdrDragStat& rDrag) const
{
- const SdrHdl* pHdl = rDrag.GetHdl();
-
- SdrHdlKind eHdl = (pHdl == NULL) ? HDL_MOVE : pHdl->GetKind();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
- if(eHdl==HDL_UPLFT || eHdl==HDL_UPPER || eHdl==HDL_UPRGT ||
- eHdl==HDL_LEFT || eHdl==HDL_RIGHT || eHdl==HDL_LWLFT ||
- eHdl==HDL_LOWER || eHdl==HDL_LWRGT)
+ if(pHdl)
{
- return true;
+ const SdrHdlKind eHdl(pHdl->GetKind());
+
+ if( eHdl==HDL_UPLFT || eHdl==HDL_UPPER || eHdl==HDL_UPRGT ||
+ eHdl==HDL_LEFT || eHdl==HDL_RIGHT ||
+ eHdl==HDL_LWLFT || eHdl==HDL_LOWER || eHdl==HDL_LWRGT)
+ {
+ // confirm special drag
+ return true;
+ }
}
return false;
@@ -1374,440 +1144,307 @@ bool SdrObject::beginSpecialDrag(SdrDragStat& rDrag) const
bool SdrObject::applySpecialDrag(SdrDragStat& rDrag)
{
- Rectangle aNewRect(ImpDragCalcRect(rDrag));
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
- if(aNewRect != GetSnapRect())
+ if(pHdl)
{
- NbcSetSnapRect(aNewRect);
- }
-
- return true;
-}
-
-String SdrObject::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
-{
- return String();
-}
-
-basegfx::B2DPolyPolygon SdrObject::getSpecialDragPoly(const SdrDragStat& /*rDrag*/) const
-{
- // default has nothing to add
- return basegfx::B2DPolyPolygon();
-}
+ const SdrHdlKind eHdl(pHdl->GetKind());
+ const bool bLeft(eHdl==HDL_UPLFT || eHdl==HDL_LEFT || eHdl==HDL_LWLFT);
+ const bool bTop(eHdl==HDL_UPRGT || eHdl==HDL_UPPER || eHdl==HDL_UPLFT);
+ const bool bRight(eHdl==HDL_UPRGT || eHdl==HDL_RIGHT || eHdl==HDL_LWRGT);
+ const bool bBottom(eHdl==HDL_LWRGT || eHdl==HDL_LOWER || eHdl==HDL_LWLFT);
+ double fLeft(0.0);
+ double fTop(0.0);
+ double fRight(1.0);
+ double fBottom(1.0);
+ basegfx::B2DHomMatrix aInvObject(getSdrObjectTransformation());
+ aInvObject.invert();
+ const basegfx::B2DPoint aMousePos(aInvObject * rDrag.GetNow());
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Create
-FASTBOOL SdrObject::BegCreate(SdrDragStat& rStat)
-{
- rStat.SetOrtho4Possible();
- Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
- aRect1.Justify();
- rStat.SetActionRect(aRect1);
- aOutRect = aRect1;
- return sal_True;
-}
+ if(bLeft)
+ {
+ fLeft = aMousePos.getX();
+ }
-FASTBOOL SdrObject::MovCreate(SdrDragStat& rStat)
-{
- rStat.TakeCreateRect(aOutRect);
- rStat.SetActionRect(aOutRect);
- aOutRect.Justify();
+ if(bTop)
+ {
+ fTop = aMousePos.getY();
+ }
- // #i101648# for naked (non-derived) SdrObjects, do not invalidate aOutRect
- // by calling SetBoundRectDirty(); aOutRect IS the geometry for such objects.
- // No derivation implementation calls the parent implementation, so this will
- // cause no further prolems
- //
- // SetBoundRectDirty();
- // bSnapRectDirty=sal_True;
+ if(bRight)
+ {
+ fRight = aMousePos.getX();
+ }
- return sal_True;
-}
+ if(bBottom)
+ {
+ fBottom = aMousePos.getY();
+ }
-FASTBOOL SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
-{
- rStat.TakeCreateRect(aOutRect);
- aOutRect.Justify();
+ const bool bCorner(eHdl==HDL_UPLFT || eHdl==HDL_UPRGT || eHdl==HDL_LWLFT || eHdl==HDL_LWRGT);
+ const bool bOrtho(rDrag.GetSdrViewFromSdrDragStat().IsOrthogonal());
- // #i101648# see description at MovCreate
- //
- // SetRectsDirty();
+ if(bOrtho)
+ {
+ const double fXScale(fRight - fLeft);
+ const double fYScale(fBottom - fTop);
- return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
-}
+ if(!basegfx::fTools::equal(fXScale, fYScale))
+ {
+ if(bCorner)
+ {
+ static bool bInverse(false);
+ const bool bBigOrtho(bInverse
+ ? !rDrag.GetSdrViewFromSdrDragStat().IsBigOrthogonal()
+ : rDrag.GetSdrViewFromSdrDragStat().IsBigOrthogonal());
+
+ if((fabs(fXScale) < fabs(fYScale)) != bBigOrtho)
+ {
+ // adapt height
+ const double fChange((fXScale < 0.0) != (fYScale < 0.0) ? -fXScale : fXScale);
+
+ if(bTop)
+ {
+ fTop = fBottom - fChange;
+ }
+ else // if(bBottom)
+ {
+ fBottom = fTop + fChange;
+ }
+ }
+ else
+ {
+ // adapt width
+ const double fChange((fXScale < 0.0) != (fYScale < 0.0) ? -fYScale : fYScale);
+
+ if(bLeft)
+ {
+ fLeft = fRight - fChange;
+ }
+ else // if(bRight)
+ {
+ fRight = fLeft + fChange;
+ }
+ }
+ }
+ else
+ {
+ if(bLeft || bRight)
+ {
+ // adapt height
+ const double fChange((fXScale - fYScale) * 0.5);
+
+ fTop -= fChange;
+ fBottom += fChange;
+
+ if(fXScale < 0.0)
+ {
+ std::swap(fTop, fBottom);
+ }
+ }
+ else // bTop || bBottom
+ {
+ // adapt width
+ const double fChange((fYScale - fXScale) * 0.5);
+
+ fLeft -= fChange;
+ fRight += fChange;
+
+ if(fYScale < 0.0)
+ {
+ std::swap(fLeft, fRight);
+ }
+ }
+ }
+ }
+ }
-void SdrObject::BrkCreate(SdrDragStat& /*rStat*/)
-{
-}
+ const basegfx::B2DVector aNewScale(fRight - fLeft, fBottom - fTop);
+ const basegfx::B2DPoint aNewTranslate(fLeft, fTop);
-FASTBOOL SdrObject::BckCreate(SdrDragStat& /*rStat*/)
-{
- return sal_False;
-}
+ if(!aNewScale.equal(getSdrObjectScale()) || !aNewTranslate.equalZero())
+ {
+ basegfx::B2DHomMatrix aNew(
+ getSdrObjectTransformation() *
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aNewScale,
+ aNewTranslate));
-basegfx::B2DPolyPolygon SdrObject::TakeCreatePoly(const SdrDragStat& rDrag) const
-{
- Rectangle aRect1;
- rDrag.TakeCreateRect(aRect1);
- aRect1.Justify();
+ setSdrObjectTransformation(aNew);
+ }
+ }
- basegfx::B2DPolyPolygon aRetval;
- const basegfx::B2DRange aRange(aRect1.Left(), aRect1.Top(), aRect1.Right(), aRect1.Bottom());
- aRetval.append(basegfx::tools::createPolygonFromRect(aRange));
- return aRetval;
+ return true;
}
-Pointer SdrObject::GetCreatePointer() const
+String SdrObject::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
{
- return Pointer(POINTER_CROSS);
+ // default has no drag comment
+ return String();
}
-// Transformationen
-void SdrObject::NbcMove(const Size& rSiz)
+basegfx::B2DPolyPolygon SdrObject::getSpecialDragPoly(const SdrDragStat& /*rDrag*/) const
{
- MoveRect(aOutRect,rSiz);
- SetRectsDirty();
+ // default has nothing to add
+ return basegfx::B2DPolyPolygon();
}
-void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+bool SdrObject::BegCreate(SdrDragStat& rStat)
{
- FASTBOOL bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
- FASTBOOL bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
- if (bXMirr || bYMirr) {
- Point aRef1(GetSnapRect().Center());
- if (bXMirr) {
- Point aRef2(aRef1);
- aRef2.Y()++;
- NbcMirrorGluePoints(aRef1,aRef2);
- }
- if (bYMirr) {
- Point aRef2(aRef1);
- aRef2.X()++;
- NbcMirrorGluePoints(aRef1,aRef2);
- }
- }
- ResizeRect(aOutRect,rRef,xFact,yFact);
- SetRectsDirty();
-}
-
-void SdrObject::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
-{
- SetGlueReallyAbsolute(sal_True);
- aOutRect.Move(-rRef.X(),-rRef.Y());
- Rectangle R(aOutRect);
- if (sn==1.0 && cs==0.0) { // 90deg
- aOutRect.Left() =-R.Bottom();
- aOutRect.Right() =-R.Top();
- aOutRect.Top() =R.Left();
- aOutRect.Bottom()=R.Right();
- } else if (sn==0.0 && cs==-1.0) { // 180deg
- aOutRect.Left() =-R.Right();
- aOutRect.Right() =-R.Left();
- aOutRect.Top() =-R.Bottom();
- aOutRect.Bottom()=-R.Top();
- } else if (sn==-1.0 && cs==0.0) { // 270deg
- aOutRect.Left() =R.Top();
- aOutRect.Right() =R.Bottom();
- aOutRect.Top() =-R.Right();
- aOutRect.Bottom()=-R.Left();
- }
- aOutRect.Move(rRef.X(),rRef.Y());
- aOutRect.Justify(); // Sicherheitshalber
- SetRectsDirty();
- NbcRotateGluePoints(rRef,nWink,sn,cs);
- SetGlueReallyAbsolute(sal_False);
-}
-
-void SdrObject::NbcMirror(const Point& rRef1, const Point& rRef2)
-{
- SetGlueReallyAbsolute(sal_True);
- aOutRect.Move(-rRef1.X(),-rRef1.Y());
- Rectangle R(aOutRect);
- long dx=rRef2.X()-rRef1.X();
- long dy=rRef2.Y()-rRef1.Y();
- if (dx==0) { // Vertikale Achse
- aOutRect.Left() =-R.Right();
- aOutRect.Right()=-R.Left();
- } else if (dy==0) { // Horizontale Achse
- aOutRect.Top() =-R.Bottom();
- aOutRect.Bottom()=-R.Top();
- } else if (dx==dy) { /* 45 Grad Achse \ */
- aOutRect.Left() =R.Top();
- aOutRect.Right() =R.Bottom();
- aOutRect.Top() =R.Left();
- aOutRect.Bottom()=R.Right();
- } else if (dx==-dy) { // 45 Grad Achse /
- aOutRect.Left() =-R.Bottom();
- aOutRect.Right() =-R.Top();
- aOutRect.Top() =-R.Right();
- aOutRect.Bottom()=-R.Left();
- }
- aOutRect.Move(rRef1.X(),rRef1.Y());
- aOutRect.Justify(); // Sicherheitshalber
- SetRectsDirty();
- NbcMirrorGluePoints(rRef1,rRef2);
- SetGlueReallyAbsolute(sal_False);
-}
-
-void SdrObject::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
-{
- SetGlueReallyAbsolute(sal_True);
- NbcShearGluePoints(rRef,nWink,tn,bVShear);
- SetGlueReallyAbsolute(sal_False);
-}
-
-void SdrObject::Move(const Size& rSiz)
-{
- if (rSiz.Width()!=0 || rSiz.Height()!=0) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcMove(rSiz);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
- }
-}
+ rStat.SetActionRange(rStat.TakeCreateRange());
+ rStat.SetOrtho4Possible();
-void SdrObject::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcResize(rRef,xFact,yFact);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- }
-}
+ const basegfx::B2DVector aScale(rStat.GetNow() - rStat.GetStart());
+ const basegfx::B2DPoint aTranslate(rStat.GetStart());
-void SdrObject::Rotate(const Point& rRef, long nWink, double sn, double cs)
-{
- if (nWink!=0) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcRotate(rRef,nWink,sn,cs);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- }
-}
+ setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aTranslate));
-void SdrObject::Mirror(const Point& rRef1, const Point& rRef2)
-{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcMirror(rRef1,rRef2);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+ return true;
}
-void SdrObject::Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+namespace
{
- if (nWink!=0) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcShear(rRef,nWink,tn,bVShear);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- }
-}
+ void impSingleCreateStep(SdrObject& rObject, SdrDragStat& rStat)
+ {
+ basegfx::B2DVector aScale(rStat.GetNow() - rStat.GetStart());
+ basegfx::B2DPoint aTranslate(rStat.GetStart());
-void SdrObject::NbcSetRelativePos(const Point& rPnt)
-{
- Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
- Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
- NbcMove(aSiz); // Der ruft auch das SetRectsDirty()
-}
+ static bool bForceCrCe(false);
+ if(bForceCrCe || rStat.GetSdrViewFromSdrDragStat().IsCreate1stPointAsCenter())
+ {
+ aTranslate -= aScale;
+ aScale *= 2.0;
+ }
-void SdrObject::SetRelativePos(const Point& rPnt)
-{
- if (rPnt!=GetRelativePos()) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetRelativePos(rPnt);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
+ rObject.setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ aTranslate));
}
}
-Point SdrObject::GetRelativePos() const
-{
- return GetSnapRect().TopLeft()-aAnchor;
-}
-
-void SdrObject::NbcSetAnchorPos(const Point& rPnt)
+bool SdrObject::MovCreate(SdrDragStat& rStat)
{
- Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
- aAnchor=rPnt;
- NbcMove(aSiz); // Der ruft auch das SetRectsDirty()
-}
+ rStat.SetActionRange(rStat.TakeCreateRange());
+ impSingleCreateStep(*this, rStat);
-void SdrObject::SetAnchorPos(const Point& rPnt)
-{
- if (rPnt!=aAnchor) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetAnchorPos(rPnt);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
- }
+ return true;
}
-const Point& SdrObject::GetAnchorPos() const
+bool SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- return aAnchor;
-}
+ impSingleCreateStep(*this, rStat);
-void SdrObject::RecalcSnapRect()
-{
+ return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz() >= 2);
}
-const Rectangle& SdrObject::GetSnapRect() const
+void SdrObject::BrkCreate(SdrDragStat& /*rStat*/)
{
- return aOutRect;
}
-void SdrObject::NbcSetSnapRect(const Rectangle& rRect)
+bool SdrObject::BckCreate(SdrDragStat& /*rStat*/)
{
- aOutRect=rRect;
+ return false;
}
-const Rectangle& SdrObject::GetLogicRect() const
+basegfx::B2DPolyPolygon SdrObject::TakeCreatePoly(const SdrDragStat& rDrag) const
{
- return GetSnapRect();
+ return basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(rDrag.TakeCreateRange()));
}
-void SdrObject::NbcSetLogicRect(const Rectangle& rRect)
+Pointer SdrObject::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
- NbcSetSnapRect(rRect);
+ return Pointer(POINTER_CROSS);
}
-void SdrObject::AdjustToMaxRect( const Rectangle& rMaxRect, bool /* bShrinkOnly = false */ )
+void SdrObject::SetAnchorPos(const basegfx::B2DPoint& rPnt)
{
- SetLogicRect( rMaxRect );
-}
+ if(!rPnt.equalZero() && !mpPlusData)
+ {
+ ImpForcePlusData();
+ }
-void SdrObject::SetSnapRect(const Rectangle& rRect)
-{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetSnapRect(rRect);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+ if(mpPlusData && mpPlusData->maObjectAnchor != rPnt)
+ {
+ mpPlusData->maObjectAnchor = rPnt;
+ }
}
-void SdrObject::SetLogicRect(const Rectangle& rRect)
+basegfx::B2DPoint SdrObject::GetAnchorPos() const
{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetLogicRect(rRect);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
-}
+ if(mpPlusData)
+ {
+ return mpPlusData->maObjectAnchor;
+ }
-long SdrObject::GetRotateAngle() const
-{
- return 0;
+ return basegfx::B2DPoint(0.0, 0.0);
}
-long SdrObject::GetShearAngle(FASTBOOL /*bVertical*/) const
+void SdrObject::AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool /* bShrinkOnly = false */ )
{
- return 0;
+ sdr::legacy::SetLogicRange(*this, rMaxRange);
}
sal_uInt32 SdrObject::GetSnapPointCount() const
{
- return GetPointCount();
-}
-
-Point SdrObject::GetSnapPoint(sal_uInt32 i) const
-{
- return GetPoint(i);
+ return GetObjectPointCount();
}
-sal_Bool SdrObject::IsPolyObj() const
+basegfx::B2DPoint SdrObject::GetSnapPoint(sal_uInt32 i) const
{
- return sal_False;
+ return GetObjectPoint(i);
}
-sal_uInt32 SdrObject::GetPointCount() const
+bool SdrObject::IsPolygonObject() const
{
- return 0L;
+ return false;
}
-Point SdrObject::GetPoint(sal_uInt32 /*i*/) const
+sal_uInt32 SdrObject::GetObjectPointCount() const
{
- return Point();
+ return 0;
}
-void SdrObject::SetPoint(const Point& rPnt, sal_uInt32 i)
+basegfx::B2DPoint SdrObject::GetObjectPoint(sal_uInt32 /*i*/) const
{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetPoint(rPnt, i);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+ return basegfx::B2DPoint(0.0, 0.0);
}
-void SdrObject::NbcSetPoint(const Point& /*rPnt*/, sal_uInt32 /*i*/)
+void SdrObject::SetObjectPoint(const basegfx::B2DPoint& /*rPnt*/, sal_uInt32 /*i*/)
{
+ // default does nothing
}
-FASTBOOL SdrObject::HasTextEdit() const
+bool SdrObject::HasTextEdit() const
{
- return sal_False;
+ return false;
}
-sal_Bool SdrObject::BegTextEdit(SdrOutliner& /*rOutl*/)
+bool SdrObject::BegTextEdit(SdrOutliner& /*rOutl*/)
{
- return sal_False;
+ return false;
}
void SdrObject::EndTextEdit(SdrOutliner& /*rOutl*/)
{
}
-void SdrObject::SetOutlinerParaObject(OutlinerParaObject* pTextObject)
-{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetOutlinerParaObject(pTextObject);
- SetChanged();
- BroadcastObjectChange();
- if (GetCurrentBoundRect()!=aBoundRect0) {
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- }
-}
-
-void SdrObject::NbcSetOutlinerParaObject(OutlinerParaObject* /*pTextObject*/)
+void SdrObject::SetOutlinerParaObject(OutlinerParaObject* /*pTextObject*/)
{
+ // default does nothing
}
OutlinerParaObject* SdrObject::GetOutlinerParaObject() const
{
- return NULL;
-}
-
-void SdrObject::NbcReformatText()
-{
+ return 0;
}
void SdrObject::ReformatText()
{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- NbcReformatText();
- SetChanged();
- BroadcastObjectChange();
- if (GetCurrentBoundRect()!=aBoundRect0) {
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- }
+ // default does nothing
}
void SdrObject::BurnInStyleSheetAttributes()
@@ -1815,23 +1452,30 @@ void SdrObject::BurnInStyleSheetAttributes()
GetProperties().ForceStyleToHardAttributes();
}
-#define Imp2ndKennung (0x434F4D43)
SdrObjUserData* SdrObject::ImpGetMacroUserData() const
{
- SdrObjUserData* pData=NULL;
- sal_uInt16 nAnz=GetUserDataCount();
- for (sal_uInt16 nNum=nAnz; nNum>0 && pData==NULL;) {
+ SdrObjUserData* pData = 0;
+ const sal_uInt32 nAnz(GetUserDataCount());
+
+ for(sal_uInt32 nNum(nAnz); nNum > 0 && !pData;)
+ {
nNum--;
- pData=GetUserData(nNum);
- if (!pData->HasMacro(this)) pData=NULL;
+ pData = GetUserData(nNum);
+
+ if(!pData->HasMacro(this))
+ {
+ pData = 0;
+ }
}
+
return pData;
}
-FASTBOOL SdrObject::HasMacro() const
+bool SdrObject::HasMacro() const
{
SdrObjUserData* pData=ImpGetMacroUserData();
- return pData!=NULL ? pData->HasMacro(this) : sal_False;
+
+ return pData ? pData->HasMacro(this) : false;
}
SdrObject* SdrObject::CheckMacroHit(const SdrObjMacroHitRec& rRec) const
@@ -1843,9 +1487,9 @@ SdrObject* SdrObject::CheckMacroHit(const SdrObjMacroHitRec& rRec) const
return pData->CheckMacroHit(rRec, this);
}
- if(rRec.pPageView)
+ if(rRec.mpSdrView)
{
- return SdrObjectPrimitiveHit(*this, rRec.aPos, rRec.nTol, *rRec.pPageView, rRec.pVisiLayer, false);
+ return SdrObjectPrimitiveHit(*this, rRec.maPos, rRec.mfTol, *rRec.mpSdrView, false, 0);
}
return 0;
@@ -1853,20 +1497,23 @@ SdrObject* SdrObject::CheckMacroHit(const SdrObjMacroHitRec& rRec) const
Pointer SdrObject::GetMacroPointer(const SdrObjMacroHitRec& rRec) const
{
- SdrObjUserData* pData=ImpGetMacroUserData();
- if (pData!=NULL) {
- return pData->GetMacroPointer(rRec,this);
+ SdrObjUserData* pData = ImpGetMacroUserData();
+
+ if(pData)
+ {
+ return pData->GetMacroPointer(rRec, this);
}
+
return Pointer(POINTER_REFHAND);
}
-void SdrObject::PaintMacro(OutputDevice& rOut, const Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const
+void SdrObject::PaintMacro(OutputDevice& rOut, const SdrObjMacroHitRec& rRec) const
{
- SdrObjUserData* pData=ImpGetMacroUserData();
+ SdrObjUserData* pData = ImpGetMacroUserData();
if(pData)
{
- pData->PaintMacro(rOut,rDirtyRect,rRec,this);
+ pData->PaintMacro(rOut, rRec, this);
}
else
{
@@ -1887,26 +1534,30 @@ void SdrObject::PaintMacro(OutputDevice& rOut, const Rectangle& rDirtyRect, cons
}
}
-FASTBOOL SdrObject::DoMacro(const SdrObjMacroHitRec& rRec)
+bool SdrObject::DoMacro(const SdrObjMacroHitRec& rRec)
{
- SdrObjUserData* pData=ImpGetMacroUserData();
- if (pData!=NULL) {
- return pData->DoMacro(rRec,this);
+ SdrObjUserData* pData = ImpGetMacroUserData();
+
+ if(pData)
+ {
+ return pData->DoMacro(rRec, this);
}
- return sal_False;
+
+ return false;
}
XubString SdrObject::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
{
- SdrObjUserData* pData=ImpGetMacroUserData();
- if (pData!=NULL) {
- return pData->GetMacroPopupComment(rRec,this);
+ SdrObjUserData* pData = ImpGetMacroUserData();
+
+ if(pData)
+ {
+ return pData->GetMacroPopupComment(rRec, this);
}
+
return String();
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
SdrObjGeoData* SdrObject::NewGeoData() const
{
return new SdrObjGeoData;
@@ -1914,54 +1565,87 @@ SdrObjGeoData* SdrObject::NewGeoData() const
void SdrObject::SaveGeoData(SdrObjGeoData& rGeo) const
{
- rGeo.aBoundRect =GetCurrentBoundRect();
- rGeo.aAnchor =aAnchor ;
- rGeo.bMovProt =bMovProt ;
- rGeo.bSizProt =bSizProt ;
- rGeo.bNoPrint =bNoPrint ;
- rGeo.mbVisible =mbVisible ;
- rGeo.bClosedObj =bClosedObj ;
+ rGeo.maSdrObjectTransformation = maSdrObjectTransformation.getB2DHomMatrix();
+
+ if(mpPlusData)
+ {
+ rGeo.maObjectAnchor = mpPlusData->maObjectAnchor;
+ }
+ else
+ {
+ rGeo.maObjectAnchor = basegfx::B2DPoint(0.0, 0.0);
+ }
+
+ rGeo.mbMoveProtect = mbMoveProtect;
+ rGeo.mbSizeProtect = mbSizeProtect;
+ rGeo.mbNoPrint = mbNoPrint;
+ rGeo.mbVisible = mbVisible;
rGeo.mnLayerID = mnLayerID;
// Benutzerdefinierte Klebepunkte
- if (pPlusData!=NULL && pPlusData->pGluePoints!=NULL) {
- if (rGeo.pGPL!=NULL) {
- *rGeo.pGPL=*pPlusData->pGluePoints;
- } else {
- rGeo.pGPL=new SdrGluePointList(*pPlusData->pGluePoints);
+ if(mpPlusData && mpPlusData->mpGluePoints)
+ {
+ if(rGeo.mpGPL)
+ {
+ *rGeo.mpGPL = *mpPlusData->mpGluePoints;
}
- } else {
- if (rGeo.pGPL!=NULL) {
- delete rGeo.pGPL;
- rGeo.pGPL=NULL;
+ else
+ {
+ rGeo.mpGPL = new SdrGluePointList(*mpPlusData->mpGluePoints);
+ }
+ }
+ else
+ {
+ if(rGeo.mpGPL)
+ {
+ delete rGeo.mpGPL;
+ rGeo.mpGPL = 0;
}
}
}
void SdrObject::RestGeoData(const SdrObjGeoData& rGeo)
{
- SetRectsDirty();
- aOutRect =rGeo.aBoundRect ;
- aAnchor =rGeo.aAnchor ;
- bMovProt =rGeo.bMovProt ;
- bSizProt =rGeo.bSizProt ;
- bNoPrint =rGeo.bNoPrint ;
- mbVisible =rGeo.mbVisible ;
- bClosedObj =rGeo.bClosedObj ;
+ ActionChanged();
+
+ maSdrObjectTransformation.setB2DHomMatrix(rGeo.maSdrObjectTransformation);
+
+ if(!rGeo.maObjectAnchor.equalZero())
+ {
+ ImpForcePlusData();
+ }
+
+ if(mpPlusData)
+ {
+ mpPlusData->maObjectAnchor = rGeo.maObjectAnchor;
+ }
+
+ mbMoveProtect = rGeo.mbMoveProtect;
+ mbSizeProtect = rGeo.mbSizeProtect;
+ mbNoPrint = rGeo.mbNoPrint;
+ mbVisible = rGeo.mbVisible;
mnLayerID = rGeo.mnLayerID;
// Benutzerdefinierte Klebepunkte
- if (rGeo.pGPL!=NULL) {
+ if(rGeo.mpGPL)
+ {
ImpForcePlusData();
- if (pPlusData->pGluePoints!=NULL) {
- *pPlusData->pGluePoints=*rGeo.pGPL;
- } else {
- pPlusData->pGluePoints=new SdrGluePointList(*rGeo.pGPL);
+
+ if(mpPlusData->mpGluePoints)
+ {
+ *mpPlusData->mpGluePoints = *rGeo.mpGPL;
}
- } else {
- if (pPlusData!=NULL && pPlusData->pGluePoints!=NULL) {
- delete pPlusData->pGluePoints;
- pPlusData->pGluePoints=NULL;
+ else
+ {
+ mpPlusData->mpGluePoints = new SdrGluePointList(*rGeo.mpGPL);
+ }
+ }
+ else
+ {
+ if(mpPlusData && mpPlusData->mpGluePoints)
+ {
+ delete mpPlusData->mpGluePoints;
+ mpPlusData->mpGluePoints = 0;
}
}
}
@@ -1970,21 +1654,18 @@ SdrObjGeoData* SdrObject::GetGeoData() const
{
SdrObjGeoData* pGeo=NewGeoData();
SaveGeoData(*pGeo);
+
return pGeo;
}
void SdrObject::SetGeoData(const SdrObjGeoData& rGeo)
{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
RestGeoData(rGeo);
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// ItemSet access
-
const SfxItemSet& SdrObject::GetObjectItemSet() const
{
return GetProperties().GetObjectItemSet();
@@ -2020,7 +1701,7 @@ void SdrObject::SetObjectItemSet(const SfxItemSet& rSet)
GetProperties().SetObjectItemSet(rSet);
}
-void SdrObject::SetMergedItemSet(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+void SdrObject::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems)
{
GetProperties().SetMergedItemSet(rSet, bClearAllItems);
}
@@ -2035,225 +1716,316 @@ const SfxPoolItem& SdrObject::GetMergedItem(const sal_uInt16 nWhich) const
return GetMergedItemSet().Get(nWhich);
}
-void SdrObject::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+void SdrObject::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems)
{
GetProperties().SetMergedItemSetAndBroadcast(rSet, bClearAllItems);
}
void SdrObject::ApplyNotPersistAttr(const SfxItemSet& rAttr)
{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- NbcApplyNotPersistAttr(rAttr);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
-}
-void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
-{
- const Rectangle& rSnap=GetSnapRect();
- const Rectangle& rLogic=GetLogicRect();
- Point aRef1(rSnap.Center());
+ const Rectangle aSnap(sdr::legacy::GetSnapRect(*this));
+ const Rectangle aLogic(sdr::legacy::GetLogicRect(*this));
+ Point aRef1(aSnap.Center());
Point aRef2(aRef1); aRef2.Y()++;
- const SfxPoolItem *pPoolItem=NULL;
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- aRef1.X()=((const SdrTransformRef1XItem*)pPoolItem)->GetValue();
+ const SfxPoolItem *pPoolItem = 0;
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_TRANSFORMREF1X, true, &pPoolItem))
+ {
+ aRef1.X() = ((const SdrMetricItem*)pPoolItem)->GetValue();
}
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- aRef1.Y()=((const SdrTransformRef1YItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y, true, &pPoolItem))
+ {
+ aRef1.Y() = ((const SdrMetricItem*)pPoolItem)->GetValue();
}
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- aRef2.X()=((const SdrTransformRef2XItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_TRANSFORMREF2X, true, &pPoolItem))
+ {
+ aRef2.X() = ((const SdrMetricItem*)pPoolItem)->GetValue();
}
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- aRef2.Y()=((const SdrTransformRef2YItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y, true, &pPoolItem))
+ {
+ aRef2.Y() = ((const SdrMetricItem*)pPoolItem)->GetValue();
}
- Rectangle aNewSnap(rSnap);
- if (rAttr.GetItemState(SDRATTR_MOVEX,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrMoveXItem*)pPoolItem)->GetValue();
+ Rectangle aNewSnap(aSnap);
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_MOVEX, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrMetricItem*)pPoolItem)->GetValue();
aNewSnap.Move(n,0);
}
- if (rAttr.GetItemState(SDRATTR_MOVEY,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrMoveYItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_MOVEY, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrMetricItem*)pPoolItem)->GetValue();
aNewSnap.Move(0,n);
}
- if (rAttr.GetItemState(SDRATTR_ONEPOSITIONX,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrOnePositionXItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_ONEPOSITIONX, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrMetricItem*)pPoolItem)->GetValue();
aNewSnap.Move(n-aNewSnap.Left(),0);
}
- if (rAttr.GetItemState(SDRATTR_ONEPOSITIONY,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrOnePositionYItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_ONEPOSITIONY, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrMetricItem*)pPoolItem)->GetValue();
aNewSnap.Move(0,n-aNewSnap.Top());
}
- if (rAttr.GetItemState(SDRATTR_ONESIZEWIDTH,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrOneSizeWidthItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_ONESIZEWIDTH, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrMetricItem*)pPoolItem)->GetValue();
aNewSnap.Right()=aNewSnap.Left()+n;
}
- if (rAttr.GetItemState(SDRATTR_ONESIZEHEIGHT,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrOneSizeHeightItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_ONESIZEHEIGHT, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrMetricItem*)pPoolItem)->GetValue();
aNewSnap.Bottom()=aNewSnap.Top()+n;
}
- if (aNewSnap!=rSnap) {
- if (aNewSnap.GetSize()==rSnap.GetSize()) {
- NbcMove(Size(aNewSnap.Left()-rSnap.Left(),aNewSnap.Top()-rSnap.Top()));
- } else {
- NbcSetSnapRect(aNewSnap);
+
+ if(aNewSnap!=aSnap)
+ {
+ if(aNewSnap.GetSize() == aSnap.GetSize())
+ {
+ sdr::legacy::MoveSdrObject(*this, Size(aNewSnap.Left()-aSnap.Left(),aNewSnap.Top()-aSnap.Top()));
+ }
+ else
+ {
+ sdr::legacy::SetSnapRect(*this, aNewSnap);
}
}
- if (rAttr.GetItemState(SDRATTR_SHEARANGLE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrShearAngleItem*)pPoolItem)->GetValue();
- n-=GetShearAngle();
- if (n!=0) {
- double nTan=tan(n*nPi180);
- NbcShear(aRef1,n,nTan,sal_False);
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_SHEARANGLE, true, &pPoolItem))
+ {
+ sal_Int32 n(((const SdrAngleItem*)pPoolItem)->GetValue());
+ n -= sdr::legacy::GetShearAngleX(*this);
+
+ if(n)
+ {
+ sdr::legacy::ShearSdrObject(*this, aRef1, n, false);
}
}
- if (rAttr.GetItemState(SDRATTR_ROTATEANGLE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrRotateAngleItem*)pPoolItem)->GetValue();
- n-=GetRotateAngle();
- if (n!=0) {
- double nSin=sin(n*nPi180);
- double nCos=cos(n*nPi180);
- NbcRotate(aRef1,n,nSin,nCos);
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_ROTATEANGLE, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrAngleItem*)pPoolItem)->GetValue();
+ n -= sdr::legacy::GetRotateAngle(*this);
+
+ if(n)
+ {
+ sdr::legacy::RotateSdrObject(*this, aRef1, n);
}
}
- if (rAttr.GetItemState(SDRATTR_ROTATEONE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrRotateOneItem*)pPoolItem)->GetValue();
- double nSin=sin(n*nPi180);
- double nCos=cos(n*nPi180);
- NbcRotate(aRef1,n,nSin,nCos);
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_ROTATEONE, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrAngleItem*)pPoolItem)->GetValue();
+ sdr::legacy::RotateSdrObject(*this, aRef1, n);
}
- if (rAttr.GetItemState(SDRATTR_HORZSHEARONE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrHorzShearOneItem*)pPoolItem)->GetValue();
- double nTan=tan(n*nPi180);
- NbcShear(aRef1,n,nTan,sal_False);
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_HORZSHEARONE, true, &pPoolItem))
+ {
+ const sal_Int32 n(((const SdrAngleItem*)pPoolItem)->GetValue());
+
+ if(n)
+ {
+ sdr::legacy::ShearSdrObject(*this, aRef1, n, false);
+ }
}
- if (rAttr.GetItemState(SDRATTR_VERTSHEARONE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrVertShearOneItem*)pPoolItem)->GetValue();
- double nTan=tan(n*nPi180);
- NbcShear(aRef1,n,nTan,sal_True);
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_VERTSHEARONE, true, &pPoolItem))
+ {
+ const sal_Int32 n(((const SdrAngleItem*)pPoolItem)->GetValue());
+
+ if(n)
+ {
+ sdr::legacy::ShearSdrObject(*this, aRef1, n, true);
+ }
}
- if (rAttr.GetItemState(SDRATTR_OBJMOVEPROTECT,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- bool b=((const SdrObjMoveProtectItem*)pPoolItem)->GetValue();
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_OBJMOVEPROTECT, true, &pPoolItem))
+ {
+ bool b = ((const SdrYesNoItem*)pPoolItem)->GetValue();
SetMoveProtect(b);
}
- if (rAttr.GetItemState(SDRATTR_OBJSIZEPROTECT,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- bool b=((const SdrObjSizeProtectItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_OBJSIZEPROTECT, true, &pPoolItem))
+ {
+ bool b = ((const SdrYesNoItem*)pPoolItem)->GetValue();
SetResizeProtect(b);
}
/* #67368# move protect always sets size protect */
- if( IsMoveProtect() )
- SetResizeProtect( true );
+ if(IsMoveProtect())
+ {
+ SetResizeProtect(true);
+ }
- if (rAttr.GetItemState(SDRATTR_OBJPRINTABLE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- bool b=((const SdrObjPrintableItem*)pPoolItem)->GetValue();
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_OBJPRINTABLE, true, &pPoolItem))
+ {
+ bool b = ((const SdrYesNoItem*)pPoolItem)->GetValue();
SetPrintable(b);
}
- if (rAttr.GetItemState(SDRATTR_OBJVISIBLE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- bool b=((const SdrObjVisibleItem*)pPoolItem)->GetValue();
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_OBJVISIBLE, true, &pPoolItem))
+ {
+ bool b = ((const SdrYesNoItem*)pPoolItem)->GetValue();
SetVisible(b);
}
- SdrLayerID nLayer=SDRLAYER_NOTFOUND;
- if (rAttr.GetItemState(SDRATTR_LAYERID,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- nLayer=((const SdrLayerIdItem*)pPoolItem)->GetValue();
+ SdrLayerID nLayer(SDRLAYER_NOTFOUND);
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_LAYERID, true, &pPoolItem))
+ {
+ nLayer = SdrLayerID(((const SfxUInt16Item*)pPoolItem)->GetValue());
}
- if (rAttr.GetItemState(SDRATTR_LAYERNAME,sal_True,&pPoolItem)==SFX_ITEM_SET && pModel!=NULL) {
- XubString aLayerName=((const SdrLayerNameItem*)pPoolItem)->GetValue();
- const SdrLayerAdmin* pLayAd=pPage!=NULL ? &pPage->GetLayerAdmin() : pModel!=NULL ? &pModel->GetLayerAdmin() : NULL;
- if (pLayAd!=NULL) {
- const SdrLayer* pLayer=pLayAd->GetLayer(aLayerName, sal_True);
- if (pLayer!=NULL) {
- nLayer=pLayer->GetID();
+
+ SdrPage* pPage = getSdrPageFromSdrObject();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_LAYERNAME, true, &pPoolItem))
+ {
+ XubString aLayerName=((const SfxStringItem*)pPoolItem)->GetValue();
+ const SdrLayerAdmin* pLayAd = pPage
+ ? &pPage->GetPageLayerAdmin()
+ : &pPage->getSdrModelFromSdrPage().GetModelLayerAdmin();
+
+ if(pLayAd)
+ {
+ const SdrLayer* pLayer = pLayAd->GetLayer(aLayerName, true);
+
+ if(pLayer)
+ {
+ nLayer = pLayer->GetID();
}
}
}
- if (nLayer!=SDRLAYER_NOTFOUND) {
- NbcSetLayer(nLayer);
+
+ if(SDRLAYER_NOTFOUND != nLayer)
+ {
+ SetLayer(nLayer);
}
- if (rAttr.GetItemState(SDRATTR_OBJECTNAME,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- XubString aName=((const SdrObjectNameItem*)pPoolItem)->GetValue();
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_OBJECTNAME, true, &pPoolItem))
+ {
+ XubString aName = ((const SfxStringItem*)pPoolItem)->GetValue();
SetName(aName);
}
- Rectangle aNewLogic(rLogic);
- if (rAttr.GetItemState(SDRATTR_LOGICSIZEWIDTH,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrLogicSizeWidthItem*)pPoolItem)->GetValue();
+
+ Rectangle aNewLogic(aLogic);
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_LOGICSIZEWIDTH, true, &pPoolItem))
+ {
+ sal_Int32 n=((const SdrMetricItem*)pPoolItem)->GetValue();
aNewLogic.Right()=aNewLogic.Left()+n;
}
- if (rAttr.GetItemState(SDRATTR_LOGICSIZEHEIGHT,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- long n=((const SdrLogicSizeHeightItem*)pPoolItem)->GetValue();
- aNewLogic.Bottom()=aNewLogic.Top()+n;
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_LOGICSIZEHEIGHT, true, &pPoolItem))
+ {
+ sal_Int32 n = ((const SdrMetricItem*)pPoolItem)->GetValue();
+ aNewLogic.Bottom() = aNewLogic.Top() + n;
}
- if (aNewLogic!=rLogic) {
- NbcSetLogicRect(aNewLogic);
+
+ if(aNewLogic != aLogic)
+ {
+ sdr::legacy::SetLogicRect(*this, aNewLogic);
}
+
Fraction aResizeX(1,1);
Fraction aResizeY(1,1);
- if (rAttr.GetItemState(SDRATTR_RESIZEXONE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- aResizeX*=((const SdrResizeXOneItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_RESIZEXONE, true, &pPoolItem))
+ {
+ aResizeX *= ((const SdrFractionItem*)pPoolItem)->GetValue();
}
- if (rAttr.GetItemState(SDRATTR_RESIZEYONE,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- aResizeY*=((const SdrResizeYOneItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_RESIZEYONE, true, &pPoolItem))
+ {
+ aResizeY *= ((const SdrFractionItem*)pPoolItem)->GetValue();
}
- if (aResizeX!=Fraction(1,1) || aResizeY!=Fraction(1,1)) {
- NbcResize(aRef1,aResizeX,aResizeY);
+
+ if(aResizeX != Fraction(1,1) || aResizeY != Fraction(1,1))
+ {
+ sdr::legacy::ResizeSdrObject(*this, aRef1, aResizeX, aResizeY);
}
}
-void lcl_SetItem(SfxItemSet& rAttr, FASTBOOL bMerge, const SfxPoolItem& rItem)
+void lcl_SetItem(SfxItemSet& rAttr, bool bMerge, const SfxPoolItem& rItem)
{
- if (bMerge) rAttr.MergeValue(rItem,sal_True);
- else rAttr.Put(rItem);
+ if(bMerge)
+ {
+ rAttr.MergeValue(rItem, true);
+ }
+ else
+ {
+ rAttr.Put(rItem);
+ }
}
-void SdrObject::TakeNotPersistAttr(SfxItemSet& rAttr, FASTBOOL bMerge) const
+void SdrObject::TakeNotPersistAttr(SfxItemSet& rAttr, bool bMerge) const
{
- const Rectangle& rSnap=GetSnapRect();
- const Rectangle& rLogic=GetLogicRect();
- lcl_SetItem(rAttr,bMerge,SdrObjMoveProtectItem(IsMoveProtect()));
- lcl_SetItem(rAttr,bMerge,SdrObjSizeProtectItem(IsResizeProtect()));
- lcl_SetItem(rAttr,bMerge,SdrObjPrintableItem(IsPrintable()));
- lcl_SetItem(rAttr,bMerge,SdrObjVisibleItem(IsVisible()));
- lcl_SetItem(rAttr,bMerge,SdrRotateAngleItem(GetRotateAngle()));
- lcl_SetItem(rAttr,bMerge,SdrShearAngleItem(GetShearAngle()));
- lcl_SetItem(rAttr,bMerge,SdrOneSizeWidthItem(rSnap.GetWidth()-1));
- lcl_SetItem(rAttr,bMerge,SdrOneSizeHeightItem(rSnap.GetHeight()-1));
- lcl_SetItem(rAttr,bMerge,SdrOnePositionXItem(rSnap.Left()));
- lcl_SetItem(rAttr,bMerge,SdrOnePositionYItem(rSnap.Top()));
- if (rLogic.GetWidth()!=rSnap.GetWidth()) {
- lcl_SetItem(rAttr,bMerge,SdrLogicSizeWidthItem(rLogic.GetWidth()-1));
+ const Rectangle aSnap(sdr::legacy::GetSnapRect(*this));
+ const Rectangle aLogic(sdr::legacy::GetLogicRect(*this));
+
+ lcl_SetItem(rAttr, bMerge, SdrYesNoItem(SDRATTR_OBJMOVEPROTECT, IsMoveProtect()));
+ lcl_SetItem(rAttr, bMerge, SdrYesNoItem(SDRATTR_OBJSIZEPROTECT, IsResizeProtect()));
+ lcl_SetItem(rAttr, bMerge, SdrYesNoItem(SDRATTR_OBJPRINTABLE, IsPrintable()));
+ lcl_SetItem(rAttr, bMerge, SdrYesNoItem(SDRATTR_OBJVISIBLE, IsVisible()));
+ lcl_SetItem(rAttr, bMerge, SdrAngleItem(SDRATTR_ROTATEANGLE, sdr::legacy::GetRotateAngle(*this)));
+ lcl_SetItem(rAttr, bMerge, SdrAngleItem(SDRATTR_SHEARANGLE, sdr::legacy::GetShearAngleX(*this)));
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_ONESIZEWIDTH, aSnap.GetWidth() - 1));
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_ONESIZEHEIGHT, aSnap.GetHeight() - 1));
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_ONEPOSITIONX, aSnap.Left()));
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_ONEPOSITIONY, aSnap.Top()));
+
+ if(aLogic.GetWidth() != aSnap.GetWidth())
+ {
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_LOGICSIZEWIDTH, aLogic.GetWidth() - 1));
}
- if (rLogic.GetHeight()!=rSnap.GetHeight()) {
- lcl_SetItem(rAttr,bMerge,SdrLogicSizeHeightItem(rLogic.GetHeight()-1));
+
+ if(aLogic.GetHeight() != aSnap.GetHeight())
+ {
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_LOGICSIZEHEIGHT, aLogic.GetHeight() - 1));
}
+
XubString aName(GetName());
if(aName.Len())
{
- lcl_SetItem(rAttr, bMerge, SdrObjectNameItem(aName));
+ lcl_SetItem(rAttr, bMerge, SfxStringItem(SDRATTR_OBJECTNAME, aName));
}
- lcl_SetItem(rAttr,bMerge,SdrLayerIdItem(GetLayer()));
- const SdrLayerAdmin* pLayAd=pPage!=NULL ? &pPage->GetLayerAdmin() : pModel!=NULL ? &pModel->GetLayerAdmin() : NULL;
- if (pLayAd!=NULL) {
- const SdrLayer* pLayer=pLayAd->GetLayerPerID(GetLayer());
- if (pLayer!=NULL) {
- lcl_SetItem(rAttr,bMerge,SdrLayerNameItem(pLayer->GetName()));
+ lcl_SetItem(rAttr, bMerge, SfxUInt16Item(SDRATTR_LAYERID, GetLayer()));
+
+ SdrPage* pPage = getSdrPageFromSdrObject();
+ const SdrLayerAdmin* pLayAd = pPage
+ ? &pPage->GetPageLayerAdmin()
+ : &pPage->getSdrModelFromSdrPage().GetModelLayerAdmin();
+
+ if(pLayAd)
+ {
+ const SdrLayer* pLayer = pLayAd->GetLayerPerID(GetLayer());
+
+ if(pLayer)
+ {
+ lcl_SetItem(rAttr, bMerge, SfxStringItem(SDRATTR_LAYERNAME, pLayer->GetName()));
}
}
- Point aRef1(rSnap.Center());
+
+ Point aRef1(aSnap.Center());
Point aRef2(aRef1); aRef2.Y()++;
- lcl_SetItem(rAttr,bMerge,SdrTransformRef1XItem(aRef1.X()));
- lcl_SetItem(rAttr,bMerge,SdrTransformRef1YItem(aRef1.Y()));
- lcl_SetItem(rAttr,bMerge,SdrTransformRef2XItem(aRef2.X()));
- lcl_SetItem(rAttr,bMerge,SdrTransformRef2YItem(aRef2.Y()));
+
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_TRANSFORMREF1X, aRef1.X()));
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_TRANSFORMREF1Y, aRef1.Y()));
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_TRANSFORMREF2X, aRef2.X()));
+ lcl_SetItem(rAttr, bMerge, SdrMetricItem(SDRATTR_TRANSFORMREF2Y, aRef2.Y()));
}
SfxStyleSheet* SdrObject::GetStyleSheet() const
@@ -2261,160 +2033,83 @@ SfxStyleSheet* SdrObject::GetStyleSheet() const
return GetProperties().GetStyleSheet();
}
-void SdrObject::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
-{
- Rectangle aBoundRect0;
-
- if(pUserCall)
- aBoundRect0 = GetLastBoundRect();
-
- // #110094#-14 SendRepaintBroadcast();
- NbcSetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_CHGATTR, aBoundRect0);
-}
-
-void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+void SdrObject::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
// only allow graphic and presentation styles for shapes
- if( pNewStyleSheet && (pNewStyleSheet->GetFamily() == SFX_STYLE_FAMILY_PARA) && (pNewStyleSheet->GetFamily() == SFX_STYLE_FAMILY_PAGE) )
+ if(pNewStyleSheet
+ && (SFX_STYLE_FAMILY_PARA == pNewStyleSheet->GetFamily())
+ && (SFX_STYLE_FAMILY_PAGE == pNewStyleSheet->GetFamily()))
+ {
return;
+ }
- GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
-}
-
-// Das Broadcasting beim Setzen der Attribute wird vom AttrObj gemanagt
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ if(GetProperties().GetStyleSheet() != pNewStyleSheet)
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this, HINT_OBJCHG_ATTR);
-FASTBOOL SdrObject::IsNode() const
-{
- return sal_True;
+ GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
+ SetChanged();
+ }
}
-SdrGluePoint SdrObject::GetVertexGluePoint(sal_uInt16 nPosNum) const
+SdrGluePoint SdrObject::GetVertexGluePoint(sal_uInt32 nPosNum) const
{
- // #i41936# Use SnapRect for default GluePoints
- const Rectangle aR(GetSnapRect());
- Point aPt;
+ basegfx::B2DPoint aGluePoint(0.5, 0.5);
switch(nPosNum)
{
- case 0 : aPt = aR.TopCenter(); break;
- case 1 : aPt = aR.RightCenter(); break;
- case 2 : aPt = aR.BottomCenter(); break;
- case 3 : aPt = aR.LeftCenter(); break;
+ default: //case 0: TopCenter
+ {
+ aGluePoint.setY(0.0);
+ break;
+ }
+ case 1: // RightCenter
+ {
+ aGluePoint.setX(1.0);
+ break;
+ }
+ case 2: // BottomCenter
+ {
+ aGluePoint.setY(1.0);
+ break;
+ }
+ case 3: // LeftCenter
+ {
+ aGluePoint.setX(0.0);
+ break;
+ }
}
- aPt -= aR.Center();
- SdrGluePoint aGP(aPt);
- aGP.SetPercent(sal_False);
+ aGluePoint = getSdrObjectTransformation() * aGluePoint;
+ SdrGluePoint aGP(aGluePoint - sdr::legacy::GetSnapRange(*this).getCenter());
+ aGP.SetPercent(false);
return aGP;
}
-SdrGluePoint SdrObject::GetCornerGluePoint(sal_uInt16 nPosNum) const
+const SdrGluePointList* SdrObject::GetGluePointList() const
{
- Rectangle aR(GetCurrentBoundRect());
- Point aPt;
- switch (nPosNum) {
- case 0 : aPt=aR.TopLeft(); break;
- case 1 : aPt=aR.TopRight(); break;
- case 2 : aPt=aR.BottomRight(); break;
- case 3 : aPt=aR.BottomLeft(); break;
+ if(mpPlusData)
+ {
+ return mpPlusData->mpGluePoints;
}
- aPt-=GetSnapRect().Center();
- SdrGluePoint aGP(aPt);
- aGP.SetPercent(sal_False);
- return aGP;
-}
-const SdrGluePointList* SdrObject::GetGluePointList() const
-{
- if (pPlusData!=NULL) return pPlusData->pGluePoints;
- return NULL;
+ return 0;
}
-//SdrGluePointList* SdrObject::GetGluePointList()
-//{
-// if (pPlusData!=NULL) return pPlusData->pGluePoints;
-// return NULL;
-//}
-
SdrGluePointList* SdrObject::ForceGluePointList()
{
ImpForcePlusData();
- if (pPlusData->pGluePoints==NULL) {
- pPlusData->pGluePoints=new SdrGluePointList;
- }
- return pPlusData->pGluePoints;
-}
-
-void SdrObject::SetGlueReallyAbsolute(FASTBOOL bOn)
-{
- // erst Const-Aufruf um zu sehen, ob
- // ueberhaupt Klebepunkte da sind
- // const-Aufruf erzwingen!
- if (GetGluePointList()!=NULL) {
- SdrGluePointList* pGPL=ForceGluePointList();
- pGPL->SetReallyAbsolute(bOn,*this);
- }
-}
-
-void SdrObject::NbcRotateGluePoints(const Point& rRef, long nWink, double sn, double cs)
-{
- // erst Const-Aufruf um zu sehen, ob
- // ueberhaupt Klebepunkte da sind
- // const-Aufruf erzwingen!
- if (GetGluePointList()!=NULL) {
- SdrGluePointList* pGPL=ForceGluePointList();
- pGPL->Rotate(rRef,nWink,sn,cs,this);
- }
-}
-void SdrObject::NbcMirrorGluePoints(const Point& rRef1, const Point& rRef2)
-{
- // erst Const-Aufruf um zu sehen, ob
- // ueberhaupt Klebepunkte da sind
- // const-Aufruf erzwingen!
- if (GetGluePointList()!=NULL) {
- SdrGluePointList* pGPL=ForceGluePointList();
- pGPL->Mirror(rRef1,rRef2,this);
- }
-}
-
-void SdrObject::NbcShearGluePoints(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
-{
- // erst Const-Aufruf um zu sehen, ob
- // ueberhaupt Klebepunkte da sind
- // const-Aufruf erzwingen!
- if (GetGluePointList()!=NULL) {
- SdrGluePointList* pGPL=ForceGluePointList();
- pGPL->Shear(rRef,nWink,tn,bVShear,this);
+ if(!mpPlusData->mpGluePoints)
+ {
+ mpPlusData->mpGluePoints = new SdrGluePointList;
}
-}
-
-FASTBOOL SdrObject::IsEdge() const
-{
- return sal_False;
-}
-void SdrObject::ConnectToNode(FASTBOOL /*bTail1*/, SdrObject* /*pObj*/)
-{
-}
-
-void SdrObject::DisconnectFromNode(FASTBOOL /*bTail1*/)
-{
+ return mpPlusData->mpGluePoints;
}
-SdrObject* SdrObject::GetConnectedNode(FASTBOOL /*bTail1*/) const
-{
- return NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDash) const
+SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash) const
{
bool bNoChange(true);
@@ -2436,7 +2131,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
// #i102241# check for line results
const basegfx::B2DPolygonVector& rHairlineVector = aExtractor.getExtractedHairlines();
- if(!rHairlineVector.empty())
+ if(rHairlineVector.size())
{
// for SdrObject creation, just copy all to a single Hairline-PolyPolygon
for(sal_uInt32 a(0); a < rHairlineVector.size(); a++)
@@ -2448,15 +2143,13 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
// #i102241# check for fill rsults
const basegfx::B2DPolyPolygonVector& rLineFillVector(aExtractor.getExtractedLineFills());
- if(!rLineFillVector.empty())
+ if(rLineFillVector.size())
{
// merge to a single PolyPolygon (OR)
aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(rLineFillVector);
}
}
- // || aMergedHairlinePolyPolygon.Count() removed; the conversion is ONLY
- // useful when new closed filled polygons are created
if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count()))
{
SfxItemSet aSet(pRet->GetMergedItemSet());
@@ -2468,8 +2161,9 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
if(aMergedLineFillPolyPolygon.count())
{
// create SdrObject for filled line geometry
- aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aMergedLineFillPolyPolygon);
- aLinePolygonPart->SetModel(pRet->GetModel());
+ aLinePolygonPart = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ aMergedLineFillPolyPolygon);
// correct item properties
aSet.Put(XLineWidthItem(0L));
@@ -2489,8 +2183,9 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
// OBJ_PATHLINE is necessary here, not OBJ_PATHFILL. This is intended
// to get a non-filled object. If the poly is closed, the PathObj takes care for
// the correct closed state.
- aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aMergedHairlinePolyPolygon);
- aLineHairlinePart->SetModel(pRet->GetModel());
+ aLineHairlinePart = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ aMergedHairlinePolyPolygon);
aSet.Put(XLineWidthItem(0L));
aSet.Put(XFillStyleItem(XFILL_NONE));
@@ -2510,9 +2205,9 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
// check if original geometry should be added (e.g. filled and closed)
bool bAddOriginalGeometry(false);
- SdrPathObj* pPath = PTR_CAST(SdrPathObj, pRet);
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pRet);
- if(pPath && pPath->IsClosed())
+ if(pPath && pPath->isClosed())
{
if(eOldFillStyle != XFILL_NONE)
{
@@ -2524,8 +2219,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
// do we need a group?
if(bBuildGroup || bAddOriginalGeometry)
{
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->SetModel(pRet->GetModel());
+ SdrObjGroup* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
if(bAddOriginalGeometry)
{
@@ -2535,22 +2229,20 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
aSet.Put(XLineStyleItem(XLINE_NONE));
aSet.Put(XLineWidthItem(0L));
- SdrObject* pClone = pRet->Clone();
+ SdrObject* pClone = pRet->CloneSdrObject();
- pClone->SetModel(pRet->GetModel());
pClone->SetMergedItemSet(aSet);
-
- pGroup->GetSubList()->NbcInsertObject(pClone);
+ pGroup->InsertObjectToSdrObjList(*pClone);
}
if(aLinePolygonPart)
{
- pGroup->GetSubList()->NbcInsertObject(aLinePolygonPart);
+ pGroup->InsertObjectToSdrObjList(*aLinePolygonPart);
}
if(aLineHairlinePart)
{
- pGroup->GetSubList()->NbcInsertObject(aLineHairlinePart);
+ pGroup->InsertObjectToSdrObjList(*aLineHairlinePart);
}
pRet = pGroup;
@@ -2579,41 +2271,56 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin
if(bNoChange)
{
// due to current method usage, create and return a clone when nothing has changed
- SdrObject* pClone = pRet->Clone();
- pClone->SetModel(pRet->GetModel());
+ SdrObject* pClone = pRet->CloneSdrObject();
pRet = pClone;
}
return pRet;
}
+bool SdrObject::IsClosedObj() const
+{
+ // default is false
+ return false;
+}
+
// convert this path object to contour object, even when it is a group
-SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDash) const
+SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, bool bForceLineDash) const
{
- if(pRet->ISA(SdrObjGroup))
+ if(dynamic_cast< SdrObjGroup* >(pRet))
{
- SdrObjList* pObjList2 = pRet->GetSubList();
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->SetModel(pRet->GetModel());
+ SdrObjList* pObjList2 = pRet->getChildrenOfSdrObject();
+ SdrObjGroup* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
- for(sal_uInt32 a=0;a<pObjList2->GetObjCount();a++)
+ for(sal_uInt32 a(0); a < pObjList2->GetObjCount(); a++)
{
SdrObject* pIterObj = pObjList2->GetObj(a);
- pGroup->GetSubList()->NbcInsertObject(ConvertToContourObj(pIterObj, bForceLineDash));
+ SdrObject* pConverted = ConvertToContourObj(pIterObj, bForceLineDash);
+
+ if(pConverted)
+ {
+ pGroup->InsertObjectToSdrObjList(*pConverted);
+ }
+ else
+ {
+ OSL_ENSURE(false, "OOps, ConvertToContourObj() returned NO shape (!)");
+ }
}
pRet = pGroup;
}
else
{
- if(pRet && pRet->ISA(SdrPathObj))
- {
- SdrPathObj* pPathObj = (SdrPathObj*)pRet;
+ SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >(pRet);
+ if(pPathObj)
+ {
// bezier geometry got created, even for straight edges since the given
- // object is a result of DoConvertToPolyObj. For conversion to contour
+ // object is a result of DoConvertToPolygonObject. For conversion to contour
// this is not really needed and can be reduced again AFAP
- pPathObj->SetPathPoly(basegfx::tools::simplifyCurveSegments(pPathObj->GetPathPoly()));
+ pPathObj->setB2DPolyPolygonInObjectCoordinates(
+ basegfx::tools::simplifyCurveSegments(
+ pPathObj->getB2DPolyPolygonInObjectCoordinates()));
}
pRet = ImpConvertToContourObj(pRet, bForceLineDash);
@@ -2628,11 +2335,34 @@ SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, sal_Bool bForceLineDa
return pRet;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
+bool SdrObject::IsSdrEdgeObj() const
+{
+ return false;
+}
-SdrObject* SdrObject::ConvertToPolyObj(sal_Bool bBezier, sal_Bool bLineToArea) const
+bool SdrObject::IsE3dObject() const
{
- SdrObject* pRet = DoConvertToPolyObj(bBezier, true);
+ return false;
+}
+
+bool SdrObject::IsSdrUnoObj() const
+{
+ return false;
+}
+
+bool SdrObject::IsSdrGrafObj() const
+{
+ return false;
+}
+
+bool SdrObject::DoesSupportTextIndentingOnLineWidthChange() const
+{
+ return false;
+}
+
+SdrObject* SdrObject::ConvertToPolyObj(bool bBezier, bool bLineToArea) const
+{
+ SdrObject* pRet = DoConvertToPolygonObject(bBezier, true);
if(pRet && bLineToArea)
{
@@ -2650,275 +2380,118 @@ SdrObject* SdrObject::ConvertToPolyObj(sal_Bool bBezier, sal_Bool bLineToArea) c
return pRet;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrObject* SdrObject::DoConvertToPolyObj(sal_Bool /*bBezier*/, bool /*bAddText*/) const
+SdrObject* SdrObject::DoConvertToPolygonObject(bool /*bBezier*/, bool /*bAddText*/) const
{
return NULL;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrObject::SetInserted(sal_Bool bIns)
-{
- if (bIns!=IsInserted()) {
- bInserted=bIns;
- Rectangle aBoundRect0(GetLastBoundRect());
- if (bIns) SendUserCall(SDRUSERCALL_INSERTED,aBoundRect0);
- else SendUserCall(SDRUSERCALL_REMOVED,aBoundRect0);
-
- if (pPlusData!=NULL && pPlusData->pBroadcast!=NULL) { // #42522#
- SdrHint aHint(*this);
- aHint.SetKind(bIns?HINT_OBJINSERTED:HINT_OBJREMOVED);
- pPlusData->pBroadcast->Broadcast(aHint);
- }
- }
-}
-
-void SdrObject::SetMoveProtect(sal_Bool bProt)
+void SdrObject::SetMoveProtect(bool bNew)
{
- if(IsMoveProtect() != bProt)
+ if(IsMoveProtect() != bNew)
{
- // #i77187# secured and simplified
- bMovProt = bProt;
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ mbMoveProtect = bNew;
SetChanged();
- BroadcastObjectChange();
}
}
-void SdrObject::SetResizeProtect(sal_Bool bProt)
+void SdrObject::SetResizeProtect(bool bNew)
{
- if(IsResizeProtect() != bProt)
+ if(IsResizeProtect() != bNew)
{
- // #i77187# secured and simplified
- bSizProt = bProt;
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ mbSizeProtect = bNew;
SetChanged();
- BroadcastObjectChange();
}
}
-void SdrObject::SetPrintable(sal_Bool bPrn)
+void SdrObject::SetPrintable(bool bNew)
{
- if( bPrn == bNoPrint )
+ if(bNew == IsPrintable())
{
- bNoPrint=!bPrn;
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ mbNoPrint = !bNew;
SetChanged();
- if (IsInserted() && pModel!=NULL)
- {
- SdrHint aHint(*this);
- pModel->Broadcast(aHint);
- }
}
}
-void SdrObject::SetVisible(sal_Bool bVisible)
+void SdrObject::SetVisible(bool bNew)
{
- if( bVisible != mbVisible )
+ if(bNew == IsVisible())
{
- mbVisible = bVisible;
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ mbVisible = bNew;
SetChanged();
- if (IsInserted() && pModel!=NULL)
- {
- SdrHint aHint(*this);
- pModel->Broadcast(aHint);
- }
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_uInt16 SdrObject::GetUserDataCount() const
+sal_uInt32 SdrObject::GetUserDataCount() const
{
- if (pPlusData==NULL || pPlusData->pUserDataList==NULL) return 0;
- return pPlusData->pUserDataList->GetUserDataCount();
-}
+ if(!mpPlusData || !mpPlusData->mpUserDataList)
+ {
+ return 0;
+ }
-SdrObjUserData* SdrObject::GetUserData(sal_uInt16 nNum) const
-{
- if (pPlusData==NULL || pPlusData->pUserDataList==NULL) return NULL;
- return pPlusData->pUserDataList->GetUserData(nNum);
+ return mpPlusData->mpUserDataList->GetUserDataCount();
}
-void SdrObject::InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos)
+SdrObjUserData* SdrObject::GetUserData(sal_uInt32 nNum) const
{
- if (pData!=NULL) {
- ImpForcePlusData();
- if (pPlusData->pUserDataList==NULL) pPlusData->pUserDataList=new SdrObjUserDataList;
- pPlusData->pUserDataList->InsertUserData(pData,nPos);
- } else {
- DBG_ERROR("SdrObject::InsertUserData(): pData ist NULL-Pointer");
+ if(!mpPlusData || !mpPlusData->mpUserDataList)
+ {
+ return 0;
}
-}
-void SdrObject::DeleteUserData(sal_uInt16 nNum)
-{
- sal_uInt16 nAnz=GetUserDataCount();
- if (nNum<nAnz) {
- pPlusData->pUserDataList->DeleteUserData(nNum);
- if (nAnz==1) {
- delete pPlusData->pUserDataList;
- pPlusData->pUserDataList=NULL;
- }
- } else {
- DBG_ERROR("SdrObject::DeleteUserData(): ungueltiger Index");
- }
+ return mpPlusData->mpUserDataList->GetUserData(nNum);
}
-void SdrObject::SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundRect) const
+void SdrObject::InsertUserData(SdrObjUserData* pData, sal_uInt32 nPos)
{
- SdrObjGroup* pGroup = NULL;
-
- if( pObjList && pObjList->GetListKind() == SDROBJLIST_GROUPOBJ )
- pGroup = (SdrObjGroup*) pObjList->GetOwnerObj();
-
- if ( pUserCall )
+ if(pData)
{
- // UserCall ausfuehren
- pUserCall->Changed( *this, eUserCall, rBoundRect );
- }
+ ImpForcePlusData();
- while( pGroup )
- {
- // Gruppe benachrichtigen
- if( pGroup->GetUserCall() )
+ if(!mpPlusData->mpUserDataList)
{
- SdrUserCallType eChildUserType = SDRUSERCALL_CHILD_CHGATTR;
-
- switch( eUserCall )
- {
- case SDRUSERCALL_MOVEONLY:
- eChildUserType = SDRUSERCALL_CHILD_MOVEONLY;
- break;
-
- case SDRUSERCALL_RESIZE:
- eChildUserType = SDRUSERCALL_CHILD_RESIZE;
- break;
-
- case SDRUSERCALL_CHGATTR:
- eChildUserType = SDRUSERCALL_CHILD_CHGATTR;
- break;
-
- case SDRUSERCALL_DELETE:
- eChildUserType = SDRUSERCALL_CHILD_DELETE;
- break;
-
- case SDRUSERCALL_COPY:
- eChildUserType = SDRUSERCALL_CHILD_COPY;
- break;
-
- case SDRUSERCALL_INSERTED:
- eChildUserType = SDRUSERCALL_CHILD_INSERTED;
- break;
-
- case SDRUSERCALL_REMOVED:
- eChildUserType = SDRUSERCALL_CHILD_REMOVED;
- break;
-
- default: break;
- }
-
- pGroup->GetUserCall()->Changed( *this, eChildUserType, rBoundRect );
+ mpPlusData->mpUserDataList = new SdrObjUserDataList;
}
- if( pGroup->GetObjList() &&
- pGroup->GetObjList()->GetListKind() == SDROBJLIST_GROUPOBJ &&
- pGroup != (SdrObjGroup*) pObjList->GetOwnerObj() )
- pGroup = (SdrObjGroup*) pObjList->GetOwnerObj();
- else
- pGroup = NULL;
- }
-
- // notify our UNO shape listeners
- switch ( eUserCall )
- {
- case SDRUSERCALL_RESIZE:
- notifyShapePropertyChange( ::svx::eShapeSize );
- // fall through - RESIZE might also imply a change of the position
- case SDRUSERCALL_MOVEONLY:
- notifyShapePropertyChange( ::svx::eShapePosition );
- break;
- default:
- // not interested in
- break;
- }
-}
-
-// ItemPool fuer dieses Objekt wechseln
-void SdrObject::MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel)
-{
- if(pSrcPool && pDestPool && (pSrcPool != pDestPool))
- {
- GetProperties().MoveToItemPool(pSrcPool, pDestPool, pNewModel);
+ mpPlusData->mpUserDataList->InsertUserData(pData, nPos);
}
}
-sal_Bool SdrObject::IsTransparent( sal_Bool /*bCheckForAlphaChannel*/) const
+void SdrObject::DeleteUserData(sal_uInt32 nNum)
{
- bool bRet = false;
+ const sal_uInt32 nAnz(GetUserDataCount());
- if( IsGroupObject() )
+ if(nNum < nAnz)
{
- SdrObjListIter aIter( *GetSubList(), IM_DEEPNOGROUPS );
+ mpPlusData->mpUserDataList->DeleteUserData(nNum);
- for( SdrObject* pO = aIter.Next(); pO && !bRet; pO = aIter.Next() )
+ if(1 == nAnz)
{
- const SfxItemSet& rAttr = pO->GetMergedItemSet();
-
- if( ( ( (const XFillTransparenceItem&) rAttr.Get( XATTR_FILLTRANSPARENCE ) ).GetValue() ||
- ( (const XLineTransparenceItem&) rAttr.Get( XATTR_LINETRANSPARENCE ) ).GetValue() ) ||
- ( ( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SFX_ITEM_SET ) &&
- ( (const XFillFloatTransparenceItem&) rAttr.Get( XATTR_FILLFLOATTRANSPARENCE ) ).IsEnabled() ) )
- {
- bRet = sal_True;
- }
- else if( pO->ISA( SdrGrafObj ) )
- {
- SdrGrafObj* pGrafObj = (SdrGrafObj*) pO;
- if( ( (const SdrGrafTransparenceItem&) rAttr.Get( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ||
- ( pGrafObj->GetGraphicType() == GRAPHIC_BITMAP && pGrafObj->GetGraphic().GetBitmapEx().IsAlpha() ) )
- {
- bRet = sal_True;
- }
- }
+ delete mpPlusData->mpUserDataList;
+ mpPlusData->mpUserDataList = 0;
}
}
else
{
- const SfxItemSet& rAttr = GetMergedItemSet();
-
- if( ( ( (const XFillTransparenceItem&) rAttr.Get( XATTR_FILLTRANSPARENCE ) ).GetValue() ||
- ( (const XLineTransparenceItem&) rAttr.Get( XATTR_LINETRANSPARENCE ) ).GetValue() ) ||
- ( ( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SFX_ITEM_SET ) &&
- ( (const XFillFloatTransparenceItem&) rAttr.Get( XATTR_FILLFLOATTRANSPARENCE ) ).IsEnabled() ) )
- {
- bRet = sal_True;
- }
- else if( ISA( SdrGrafObj ) )
- {
- SdrGrafObj* pGrafObj = (SdrGrafObj*) this;
-
- // #i25616#
- bRet = pGrafObj->IsObjectTransparent();
- }
+ DBG_ERROR("SdrObject::DeleteUserData(): ungueltiger Index");
}
-
- return bRet;
}
void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUnoShape )
{
maWeakUnoShape = _rxUnoShape;
mpSvxShape = SvxShape::getImplementation( _rxUnoShape );
-// OSL_ENSURE( mpSvxShape || !_rxUnoShape.is(),
-// "SdrObject::setUnoShape: not sure it's a good idea to have an XShape which is not implemented by SvxShape ..." );
}
/** only for internal use! */
-SvxShape* SdrObject::getSvxShape()
+SvxShape* SdrObject::getSvxShape() const
{
DBG_TESTSOLARMUTEX();
- // retrieving the impl pointer and subsequently using it is not thread-safe, of course, so it needs to be
- // guarded by the SolarMutex
+ // retrieving the impl pointer and subsequently using it is not thread-safe, of course, so it needs to be
+ // guarded by the SolarMutex
uno::Reference< uno::XInterface > xShape( maWeakUnoShape );
#if OSL_DEBUG_LEVE > 0
@@ -2927,7 +2500,9 @@ SvxShape* SdrObject::getSvxShape()
#endif
//#113608#, make sure mpSvxShape is always synchronized with maWeakUnoShape
if ( mpSvxShape && !xShape.is() )
- mpSvxShape = NULL;
+ {
+ const_cast< SdrObject* >(this)->mpSvxShape = NULL;
+ }
return mpSvxShape;
}
@@ -2939,9 +2514,11 @@ SvxShape* SdrObject::getSvxShape()
if( !xShape.is() )
{
OSL_ENSURE( mpSvxShape == NULL, "SdrObject::getUnoShape: XShape already dead, but still an IMPL pointer!" );
- if ( pPage )
+ SdrPage* pOwningPage = getSdrPageFromSdrObject();
+
+ if ( pOwningPage )
{
- uno::Reference< uno::XInterface > xPage( pPage->getUnoPage() );
+ uno::Reference< uno::XInterface > xPage( pOwningPage->getUnoPage() );
if( xPage.is() )
{
SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation(xPage);
@@ -2955,7 +2532,10 @@ SvxShape* SdrObject::getSvxShape()
}
else
{
- mpSvxShape = SvxDrawPage::CreateShapeByTypeAndInventor( GetObjIdentifier(), GetObjInventor(), this, NULL );
+ mpSvxShape = SvxDrawPage::CreateShapeBySvxShapeKind(
+ SdrObjectCreatorInventorToSvxShapeKind(GetObjIdentifier(), GetObjInventor()),
+ this,
+ 0);
maWeakUnoShape = xShape = static_cast< ::cppu::OWeakObject* >( mpSvxShape );
}
}
@@ -2981,137 +2561,38 @@ void SdrObject::notifyShapePropertyChange( const ::svx::ShapeProperty _eProperty
return pSvxShape->getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty );
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// transformation interface for StarOfficeAPI. This implements support for
-// homogen 3x3 matrices containing the transformation of the SdrObject. At the
-// moment it contains a shearX, rotation and translation, but for setting all linear
-// transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
-// with the base geometry and returns TRUE. Otherwise it returns FALSE.
-sal_Bool SdrObject::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& /*rPolyPolygon*/) const
+const basegfx::B2DHomMatrix& SdrObject::getSdrObjectTransformation() const
{
- // any kind of SdrObject, just use SnapRect
- Rectangle aRectangle(GetSnapRect());
-
- // convert to transformation values
- basegfx::B2DTuple aScale(aRectangle.GetWidth(), aRectangle.GetHeight());
- basegfx::B2DTuple aTranslate(aRectangle.Left(), aRectangle.Top());
-
- // position maybe relative to anchorpos, convert
- if( pModel && pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
- }
-
- // force MapUnit to 100th mm
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // postion
- aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
- aTranslate.setY(ImplTwipsToMM(aTranslate.getY()));
-
- // size
- aScale.setX(ImplTwipsToMM(aScale.getX()));
- aScale.setY(ImplTwipsToMM(aScale.getY()));
-
- break;
- }
- default:
- {
- DBG_ERROR("TRGetBaseGeometry: Missing unit translation to 100th mm!");
- }
- }
- }
-
- // build matrix
- rMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aScale, aTranslate);
-
- return sal_False;
+ return maSdrObjectTransformation.getB2DHomMatrix();
}
-// sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
-// If it's an SdrPathObj it will use the provided geometry information. The Polygon has
-// to use (0,0) as upper left and will be scaled to the given size in the matrix.
-void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& /*rPolyPolygon*/)
+void SdrObject::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- // break up matrix
- basegfx::B2DTuple aScale;
- basegfx::B2DTuple aTranslate;
- double fRotate, fShearX;
- rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+ // TTTT: Need to handle GluePoints, too. Check GluePoint transformation
+ //SetGlueReallyAbsolute(true);
+ //NbcShearGluePoints(rRef,nWink,tn,bVShear);
+ //SetGlueReallyAbsolute(false);
- // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
- // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
- if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
- {
- aScale.setX(fabs(aScale.getX()));
- aScale.setY(fabs(aScale.getY()));
- fRotate = fmod(fRotate + F_PI, F_2PI);
- }
+ //if (GetGluePointList()!=NULL) {
+ // SdrGluePointList* pGPL=ForceGluePointList();
+ // pGPL->SetReallyAbsolute(true,*this);
+ // NbcShearGluePoints(rRef,nWink,tn,bVShear);
+ // pGPL->SetReallyAbsolute(false,*this);
+ //}
- // force metric to pool metric
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ if(rTransformation != maSdrObjectTransformation.getB2DHomMatrix())
{
- switch(eMapUnit)
+ if(GetGluePointList())
{
- case SFX_MAPUNIT_TWIP :
- {
- // position
- aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
- aTranslate.setY(ImplMMToTwips(aTranslate.getY()));
-
- // size
- aScale.setX(ImplMMToTwips(aScale.getX()));
- aScale.setY(ImplMMToTwips(aScale.getY()));
-
- break;
- }
- default:
- {
- DBG_ERROR("TRSetBaseGeometry: Missing unit translation to PoolMetric!");
- }
+ ForceGluePointList()->TransformGluePoints(rTransformation, sdr::legacy::GetSnapRange(*this));
}
- }
- // if anchor is used, make position relative to it
- if( pModel && pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ maSdrObjectTransformation.setB2DHomMatrix(rTransformation);
+ SetChanged();
}
-
- // build BaseRect
- Point aPoint(FRound(aTranslate.getX()), FRound(aTranslate.getY()));
- Rectangle aBaseRect(aPoint, Size(FRound(aScale.getX()), FRound(aScale.getY())));
-
- // set BaseRect
- SetSnapRect(aBaseRect);
-}
-
-// #116168#
-// Give info if object is in destruction
-sal_Bool SdrObject::IsInDestruction() const
-{
- if(pModel)
- return pModel->IsInDestruction();
- return sal_False;
}
-// return if fill is != XFILL_NONE
bool SdrObject::HasFillStyle() const
{
return (((const XFillStyleItem&)GetObjectItem(XATTR_FILLSTYLE)).GetValue() != XFILL_NONE);
@@ -3122,21 +2603,31 @@ bool SdrObject::HasLineStyle() const
return (((const XLineStyleItem&)GetObjectItem(XATTR_LINESTYLE)).GetValue() != XLINE_NONE);
}
-
// #i52224#
// on import of OLE object from MS documents the BLIP size might be retrieved,
// the following four methods are used to control it;
// usually this data makes no sence after the import is finished, since the object
// might be resized
-Rectangle SdrObject::GetBLIPSizeRectangle() const
+const basegfx::B2DRange SdrObject::GetBLIPSizeRange() const
{
- return maBLIPSizeRectangle;
+ if(mpPlusData)
+ {
+ return mpPlusData->maBLIPSizeRange;
+ }
+ else
+ {
+ return basegfx::B2DRange();
+ }
}
-void SdrObject::SetBLIPSizeRectangle( const Rectangle& aRect )
+void SdrObject::SetBLIPSizeRange(const basegfx::B2DRange& aRange)
{
- maBLIPSizeRectangle = aRect;
+ if(aRange != GetBLIPSizeRange())
+ {
+ ImpForcePlusData();
+ mpPlusData->maBLIPSizeRange = aRange;
+ }
}
void SdrObject::SetContextWritingMode( const sal_Int16 /*_nContextWritingMode*/ )
@@ -3144,166 +2635,24 @@ void SdrObject::SetContextWritingMode( const sal_Int16 /*_nContextWritingMode*/
// this base class does not support different writing modes, so ignore the call
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@ @@@@@@ @@@@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@@@ @@@@@@ @@ @@ @@ @@ @@@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@@@@ @@@@ @@ @@ @@ @@@@ @@ @@@@ @@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-SdrObjFactory::SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNewPage, SdrModel* pNewModel)
-{
- nInventor=nInvent;
- nIdentifier=nIdent;
- pNewObj=NULL;
- pPage=pNewPage;
- pModel=pNewModel;
- pObj=NULL;
- pNewData=NULL;
-}
-
-SdrObjFactory::SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrObject* pObj1)
+::std::vector< SdrEdgeObj* > SdrObject::getAllConnectedSdrEdgeObj() const
{
- nInventor=nInvent;
- nIdentifier=nIdent;
- pNewObj=NULL;
- pPage=NULL;
- pModel=NULL;
- pObj=pObj1;
- pNewData=NULL;
-}
-
-SdrObject* SdrObjFactory::MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel)
-{
- if(pModel == NULL && pPage != NULL)
- pModel = pPage->GetModel();
- SdrObject* pObj = NULL;
+ // travel over broadcaster/listener to access connected edges
+ ::std::vector< SdrEdgeObj* > aRetval;
+ const sal_uInt16 nListenerCount(GetListenerCount());
- if(nInvent == SdrInventor)
+ for(sal_uInt16 nListener(0); nListener < nListenerCount; nListener++)
{
- switch (nIdent)
- {
- case sal_uInt16(OBJ_NONE ): pObj=new SdrObject; break;
- case sal_uInt16(OBJ_GRUP ): pObj=new SdrObjGroup; break;
- case sal_uInt16(OBJ_LINE ): pObj=new SdrPathObj(OBJ_LINE ); break;
- case sal_uInt16(OBJ_POLY ): pObj=new SdrPathObj(OBJ_POLY ); break;
- case sal_uInt16(OBJ_PLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break;
- case sal_uInt16(OBJ_PATHLINE ): pObj=new SdrPathObj(OBJ_PATHLINE ); break;
- case sal_uInt16(OBJ_PATHFILL ): pObj=new SdrPathObj(OBJ_PATHFILL ); break;
- case sal_uInt16(OBJ_FREELINE ): pObj=new SdrPathObj(OBJ_FREELINE ); break;
- case sal_uInt16(OBJ_FREEFILL ): pObj=new SdrPathObj(OBJ_FREEFILL ); break;
- case sal_uInt16(OBJ_PATHPOLY ): pObj=new SdrPathObj(OBJ_POLY ); break;
- case sal_uInt16(OBJ_PATHPLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break;
- case sal_uInt16(OBJ_EDGE ): pObj=new SdrEdgeObj; break;
- case sal_uInt16(OBJ_RECT ): pObj=new SdrRectObj; break;
- case sal_uInt16(OBJ_CIRC ): pObj=new SdrCircObj(OBJ_CIRC ); break;
- case sal_uInt16(OBJ_SECT ): pObj=new SdrCircObj(OBJ_SECT ); break;
- case sal_uInt16(OBJ_CARC ): pObj=new SdrCircObj(OBJ_CARC ); break;
- case sal_uInt16(OBJ_CCUT ): pObj=new SdrCircObj(OBJ_CCUT ); break;
- case sal_uInt16(OBJ_TEXT ): pObj=new SdrRectObj(OBJ_TEXT ); break;
- case sal_uInt16(OBJ_TEXTEXT ): pObj=new SdrRectObj(OBJ_TEXTEXT ); break;
- case sal_uInt16(OBJ_TITLETEXT ): pObj=new SdrRectObj(OBJ_TITLETEXT ); break;
- case sal_uInt16(OBJ_OUTLINETEXT): pObj=new SdrRectObj(OBJ_OUTLINETEXT); break;
- case sal_uInt16(OBJ_MEASURE ): pObj=new SdrMeasureObj; break;
- case sal_uInt16(OBJ_GRAF ): pObj=new SdrGrafObj; break;
- case sal_uInt16(OBJ_OLE2 ): pObj=new SdrOle2Obj; break;
- case sal_uInt16(OBJ_FRAME ): pObj=new SdrOle2Obj(sal_True); break;
- case sal_uInt16(OBJ_CAPTION ): pObj=new SdrCaptionObj; break;
- case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj; break;
- case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(String()); break;
- case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(); break;
- case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(); break;
- case sal_uInt16(OBJ_TABLE ): pObj=new ::sdr::table::SdrTableObj(pModel); break;
- }
- }
+ SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(GetListener(nListener));
- if(pObj == NULL)
- {
- SdrObjFactory* pFact=new SdrObjFactory(nInvent,nIdent,pPage,pModel);
- SdrLinkList& rLL=ImpGetUserMakeObjHdl();
- unsigned nAnz=rLL.GetLinkCount();
- unsigned i=0;
- while (i<nAnz && pObj==NULL) {
- rLL.GetLink(i).Call((void*)pFact);
- pObj=pFact->pNewObj;
- i++;
- }
- delete pFact;
- }
-
- if(pObj == NULL)
- {
- // Na wenn's denn keiner will ...
- }
-
- if(pObj != NULL)
- {
- if(pPage != NULL)
- pObj->SetPage(pPage);
- else if(pModel != NULL)
- pObj->SetModel(pModel);
- }
-
- return pObj;
-}
-
-SdrObjUserData* SdrObjFactory::MakeNewObjUserData(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrObject* pObj1)
-{
- SdrObjUserData* pData=NULL;
- if (nInvent==SdrInventor) {
- switch (nIdent)
+ if(pEdge)
{
- case sal_uInt16(SDRUSERDATA_OBJTEXTLINK) : pData=new ImpSdrObjTextLinkUserData((SdrTextObj*)pObj1); break;
+ aRetval.push_back(pEdge);
}
}
- if (pData==NULL) {
- SdrObjFactory aFact(nInvent,nIdent,pObj1);
- SdrLinkList& rLL=ImpGetUserMakeObjUserDataHdl();
- unsigned nAnz=rLL.GetLinkCount();
- unsigned i=0;
- while (i<nAnz && pData==NULL) {
- rLL.GetLink(i).Call((void*)&aFact);
- pData=aFact.pNewData;
- i++;
- }
- }
- return pData;
-}
-
-void SdrObjFactory::InsertMakeObjectHdl(const Link& rLink)
-{
- SdrLinkList& rLL=ImpGetUserMakeObjHdl();
- rLL.InsertLink(rLink);
-}
-void SdrObjFactory::RemoveMakeObjectHdl(const Link& rLink)
-{
- SdrLinkList& rLL=ImpGetUserMakeObjHdl();
- rLL.RemoveLink(rLink);
-}
-
-void SdrObjFactory::InsertMakeUserDataHdl(const Link& rLink)
-{
- SdrLinkList& rLL=ImpGetUserMakeObjUserDataHdl();
- rLL.InsertLink(rLink);
-}
-
-void SdrObjFactory::RemoveMakeUserDataHdl(const Link& rLink)
-{
- SdrLinkList& rLL=ImpGetUserMakeObjUserDataHdl();
- rLL.RemoveLink(rLink);
-}
-
-namespace svx
-{
- ISdrObjectFilter::~ISdrObjectFilter()
- {
- }
+ return aRetval;
}
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 22244d9c80c0..98185742b8c1 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -54,6 +54,7 @@
#include <basegfx/range/b2drange.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/sdrhittesthelper.hxx>
+#include <svx/svdlegacy.hxx>
// #i32599#
inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); }
@@ -73,9 +74,9 @@ public:
long nEscAbs;
long nLineLen;
SdrCaptionEscDir eEscDir;
- FASTBOOL bFitLineLen;
- FASTBOOL bEscRel;
- FASTBOOL bFixedAngle;
+ bool bFitLineLen;
+ bool bEscRel;
+ bool bFixedAngle;
public:
ImpCaptParams()
@@ -111,7 +112,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
nY+=rRect.Top();
Point aBestPt;
EscDir eBestDir=LKS;
- FASTBOOL bTryH=eEscDir==SDRCAPT_ESCBESTFIT;
+ bool bTryH=eEscDir==SDRCAPT_ESCBESTFIT;
if (!bTryH) {
if (eType!=SDRCAPT_TYPE1) {
bTryH=eEscDir==SDRCAPT_ESCHORIZONTAL;
@@ -119,7 +120,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
bTryH=eEscDir==SDRCAPT_ESCVERTICAL;
}
}
- FASTBOOL bTryV=eEscDir==SDRCAPT_ESCBESTFIT;
+ bool bTryV=eEscDir==SDRCAPT_ESCBESTFIT;
if (!bTryV) {
if (eType!=SDRCAPT_TYPE1) {
bTryV=eEscDir==SDRCAPT_ESCVERTICAL;
@@ -131,7 +132,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
if (bTryH) {
Point aLft(rRect.Left()-nGap,nY);
Point aRgt(rRect.Right()+nGap,nY);
- FASTBOOL bLft=(aTl.X()-aLft.X()<aRgt.X()-aTl.X());
+ bool bLft=(aTl.X()-aLft.X()<aRgt.X()-aTl.X());
if (bLft) {
eBestDir=LKS;
aBestPt=aLft;
@@ -143,7 +144,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
if (bTryV) {
Point aTop(nX,rRect.Top()-nGap);
Point aBtm(nX,rRect.Bottom()+nGap);
- FASTBOOL bTop=(aTl.Y()-aTop.Y()<aBtm.Y()-aTl.Y());
+ bool bTop=(aTl.Y()-aTop.Y()<aBtm.Y()-aTl.Y());
Point aBest2;
EscDir eBest2;
if (bTop) {
@@ -153,7 +154,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
eBest2=UNT;
aBest2=aBtm;
}
- FASTBOOL bTakeIt=eEscDir!=SDRCAPT_ESCBESTFIT;
+ bool bTakeIt=eEscDir!=SDRCAPT_ESCBESTFIT;
if (!bTakeIt) {
BigInt aHorX(aBestPt.X()-aTl.X()); aHorX*=aHorX;
BigInt aHorY(aBestPt.Y()-aTl.Y()); aHorY*=aHorY;
@@ -192,53 +193,85 @@ sdr::contact::ViewContact* SdrCaptionObj::CreateObjectSpecificViewContact()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrCaptionObj,SdrRectObj);
-
-SdrCaptionObj::SdrCaptionObj():
- SdrRectObj(OBJ_TEXT),
+//SdrCaptionObj::SdrCaptionObj(const basegfx::B2DHomMatrix& rTransform)
+//: SdrRectObj(OBJ_TEXT, rTransform),
+// aTailPoly(3), // Default Groesse: 3 Punkte = 2 Linien
+// mbSpecialTextBoxShadow(FALSE),
+// mbFixedTail(FALSE)
+//{
+//}
+
+SdrCaptionObj::SdrCaptionObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DPoint* pTail)
+: SdrRectObj(
+ rSdrModel,
+ rTransform,
+ OBJ_TEXT,
+ true),
aTailPoly(3), // Default Groesse: 3 Punkte = 2 Linien
mbSpecialTextBoxShadow(sal_False),
mbFixedTail(sal_False)
{
+ if(pTail)
+ {
+ aTailPoly[0] = Point(basegfx::fround(pTail->getX()), basegfx::fround(pTail->getY()));
+ maFixedTailPos = *pTail;
+ }
}
-SdrCaptionObj::SdrCaptionObj(const Rectangle& rRect):
- SdrRectObj(OBJ_TEXT,rRect),
- aTailPoly(3), // Default Groesse: 3 Punkte = 2 Linien
- mbSpecialTextBoxShadow(sal_False),
- mbFixedTail(sal_False)
+SdrCaptionObj::~SdrCaptionObj()
{
}
-SdrCaptionObj::SdrCaptionObj(const Rectangle& rRect, const Point& rTail):
- SdrRectObj(OBJ_TEXT,rRect),
- aTailPoly(3), // Default Groesse: 3 Punkte = 2 Linien
- mbSpecialTextBoxShadow(sal_False),
- mbFixedTail(sal_False)
+void SdrCaptionObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- aTailPoly[0]=maFixedTailPos=rTail;
+ if(this != &rSource)
+ {
+ const SdrCaptionObj* pSource = dynamic_cast< const SdrCaptionObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrRectObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ aTailPoly = pSource->aTailPoly;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
}
-SdrCaptionObj::~SdrCaptionObj()
+SdrObject* SdrCaptionObj::CloneSdrObject(SdrModel* pTargetModel) const
{
+ SdrCaptionObj* pClone = new SdrCaptionObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
void SdrCaptionObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bRotateFreeAllowed=sal_False;
- rInfo.bRotate90Allowed =sal_False;
- rInfo.bMirrorFreeAllowed=sal_False;
- rInfo.bMirror45Allowed =sal_False;
- rInfo.bMirror90Allowed =sal_False;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed =sal_False;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bCanConvToPath =sal_True;
- rInfo.bCanConvToPoly =sal_True;
- rInfo.bCanConvToPathLineToArea=sal_False;
- rInfo.bCanConvToPolyLineToArea=sal_False;
- rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
+ rInfo.mbRotateFreeAllowed = false;
+ rInfo.mbRotate90Allowed = false;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbMirror45Allowed = false;
+ rInfo.mbMirror90Allowed = false;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbCanConvToPath = true;
+ rInfo.mbCanConvToPoly = true;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
+ rInfo.mbCanConvToContour = (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
sal_uInt16 SdrCaptionObj::GetObjIdentifier() const
@@ -246,12 +279,6 @@ sal_uInt16 SdrCaptionObj::GetObjIdentifier() const
return sal_uInt16(OBJ_CAPTION);
}
-void SdrCaptionObj::operator=(const SdrObject& rObj)
-{
- SdrRectObj::operator=(rObj);
- aTailPoly=((SdrCaptionObj&)rObj).aTailPoly;
-}
-
void SdrCaptionObj::TakeObjNameSingul(XubString& rName) const
{
rName=ImpGetResStr(STR_ObjNameSingulCAPTION);
@@ -279,38 +306,18 @@ basegfx::B2DPolyPolygon SdrCaptionObj::TakeXorPoly() const
return aPolyPoly;
}
-sal_uInt32 SdrCaptionObj::GetHdlCount() const
+void SdrCaptionObj::AddToHdlList(SdrHdlList& rHdlList) const
{
- sal_uInt32 nAnz1(SdrRectObj::GetHdlCount());
- // sal_uInt32 nAnz2(aTailPoly.GetSize());
- // Derzeit ist nur das Draggen des Schwanzendes implementiert
- return nAnz1 + 1L;
-}
+ // add parent handles
+ SdrRectObj::AddToHdlList(rHdlList);
-SdrHdl* SdrCaptionObj::GetHdl(sal_uInt32 nHdlNum) const
-{
- const sal_uInt32 nRectHdlAnz(SdrRectObj::GetHdlCount());
-
- if(nHdlNum < nRectHdlAnz)
- {
- return SdrRectObj::GetHdl(nHdlNum);
- }
- else
- {
- sal_uInt32 nPntNum(nHdlNum);
- nPntNum -= nRectHdlAnz;
-
- if(nPntNum < aTailPoly.GetSize())
+ // add own handles
+ if(aTailPoly.GetSize())
{
- SdrHdl* pHdl = new SdrHdl(aTailPoly.GetPoint((sal_uInt16)nPntNum), HDL_POLY);
- pHdl->SetPolyNum(1L);
- pHdl->SetPointNum(nPntNum);
- return pHdl;
- }
- else
- {
- return 0L;
- }
+ const Point aOldPoint(aTailPoly.GetPoint(0));
+ SdrHdl* pHdl = new SdrHdl(rHdlList, this, HDL_POLY, basegfx::B2DPoint(aOldPoint.X(), aOldPoint.Y()));
+ pHdl->SetPolyNum(1);
+ pHdl->SetPointNum(0);
}
}
@@ -323,7 +330,7 @@ bool SdrCaptionObj::hasSpecialDrag() const
bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
rDrag.SetEndDragChangesAttributes(true);
rDrag.SetEndDragChangesGeoAndAttributes(true);
@@ -337,15 +344,17 @@ bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const
if(!pHdl)
{
- if (bMovProt)
- return 0;
+ if(mbMoveProtect)
+ {
+ return false;
+ }
rDrag.SetNoSnap(true);
- rDrag.SetActionRect(aRect);
+ rDrag.SetActionRange(getObjectRange(&rDrag.GetSdrViewFromSdrDragStat()));
- Point aHit(rDrag.GetStart());
+ const basegfx::B2DPoint aHit(rDrag.GetStart());
- if(rDrag.GetPageView() && SdrObjectPrimitiveHit(*this, aHit, 0, *rDrag.GetPageView(), 0, false))
+ if(SdrObjectPrimitiveHit(*this, aHit, 0.0, rDrag.GetSdrViewFromSdrDragStat(), false, 0))
{
return true;
}
@@ -353,7 +362,9 @@ bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const
else
{
if((1 == pHdl->GetPolyNum()) && (0 == pHdl->GetPointNum()))
+ {
return true;
+ }
}
}
@@ -362,7 +373,7 @@ bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const
bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag)
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
if(pHdl && 0 == pHdl->GetPolyNum())
{
@@ -374,15 +385,16 @@ bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag)
}
else
{
- Point aDelt(rDrag.GetNow()-rDrag.GetStart());
+ const basegfx::B2DPoint aDelta(rDrag.GetNow()-rDrag.GetStart());
if(!pHdl)
{
- aRect.Move(aDelt.X(),aDelt.Y());
+ sdr::legacy::transformSdrObject(*this, basegfx::tools::createTranslateB2DHomMatrix(aDelta));
}
else
{
- aTailPoly[0] += aDelt;
+ const Point aOldPoint(basegfx::fround(aDelta.getX()), basegfx::fround(aDelta.getY()));
+ aTailPoly[0] += aOldPoint;
}
ImpRecalcTail();
@@ -394,7 +406,7 @@ bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
+ const bool bCreateComment(this == rDrag.GetSdrViewFromSdrDragStat().GetCreateObj());
if(bCreateComment)
{
@@ -402,7 +414,7 @@ String SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const
}
else
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
if(pHdl && 0 == pHdl->GetPolyNum())
{
@@ -414,11 +426,11 @@ String SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const
if(!pHdl)
{
- ImpTakeDescriptionStr(STR_DragCaptFram, aStr);
+ TakeMarkedDescriptionString(STR_DragCaptFram, aStr);
}
else
{
- ImpTakeDescriptionStr(STR_DragCaptTail, aStr);
+ TakeMarkedDescriptionString(STR_DragCaptTail, aStr);
}
return aStr;
@@ -432,24 +444,24 @@ void SdrCaptionObj::ImpGetCaptParams(ImpCaptParams& rPara) const
{
const SfxItemSet& rSet = GetObjectItemSet();
rPara.eType =((SdrCaptionTypeItem&) (rSet.Get(SDRATTR_CAPTIONTYPE ))).GetValue();
- rPara.bFixedAngle=((SdrCaptionFixedAngleItem&)(rSet.Get(SDRATTR_CAPTIONANGLE ))).GetValue();
- rPara.nAngle =((SdrCaptionAngleItem&) (rSet.Get(SDRATTR_CAPTIONFIXEDANGLE))).GetValue();
- rPara.nGap =((SdrCaptionGapItem&) (rSet.Get(SDRATTR_CAPTIONGAP ))).GetValue();
+ rPara.bFixedAngle=((SdrOnOffItem&) (rSet.Get(SDRATTR_CAPTIONANGLE ))).GetValue();
+ rPara.nAngle =((SdrAngleItem&) (rSet.Get(SDRATTR_CAPTIONFIXEDANGLE))).GetValue();
+ rPara.nGap =((SdrMetricItem&) (rSet.Get(SDRATTR_CAPTIONGAP ))).GetValue();
rPara.eEscDir =((SdrCaptionEscDirItem&) (rSet.Get(SDRATTR_CAPTIONESCDIR ))).GetValue();
- rPara.bEscRel =((SdrCaptionEscIsRelItem&) (rSet.Get(SDRATTR_CAPTIONESCISREL ))).GetValue();
- rPara.nEscRel =((SdrCaptionEscRelItem&) (rSet.Get(SDRATTR_CAPTIONESCREL ))).GetValue();
- rPara.nEscAbs =((SdrCaptionEscAbsItem&) (rSet.Get(SDRATTR_CAPTIONESCABS ))).GetValue();
- rPara.nLineLen =((SdrCaptionLineLenItem&) (rSet.Get(SDRATTR_CAPTIONLINELEN ))).GetValue();
- rPara.bFitLineLen=((SdrCaptionFitLineLenItem&)(rSet.Get(SDRATTR_CAPTIONFITLINELEN))).GetValue();
+ rPara.bEscRel =((SdrYesNoItem&) (rSet.Get(SDRATTR_CAPTIONESCISREL ))).GetValue();
+ rPara.nEscRel =((SfxInt32Item&) (rSet.Get(SDRATTR_CAPTIONESCREL ))).GetValue();
+ rPara.nEscAbs =((SdrMetricItem&) (rSet.Get(SDRATTR_CAPTIONESCABS ))).GetValue();
+ rPara.nLineLen =((SdrMetricItem&) (rSet.Get(SDRATTR_CAPTIONLINELEN ))).GetValue();
+ rPara.bFitLineLen=((SdrYesNoItem&) (rSet.Get(SDRATTR_CAPTIONFITLINELEN))).GetValue();
}
void SdrCaptionObj::ImpRecalcTail()
{
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
+ Rectangle aRect(sdr::legacy::GetSnapRect(*this));
ImpCalcTail(aPara,aTailPoly,aRect);
- SetRectsDirty();
- SetXPolyDirty();
+ ActionChanged();
}
// #i35971#
@@ -553,44 +565,61 @@ void SdrCaptionObj::ImpCalcTail(const ImpCaptParams& rPara, Polygon& rPoly, Rect
}
}
-FASTBOOL SdrCaptionObj::BegCreate(SdrDragStat& rStat)
+bool SdrCaptionObj::BegCreate(SdrDragStat& rStat)
{
- if (aRect.IsEmpty()) return sal_False; // Create z.Zt. nur mit vorgegebenen Rect
+ if(getSdrObjectTransformation().isIdentity())
+ {
+ return false;
+ }
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
- aRect.SetPos(rStat.GetNow());
- aTailPoly[0]=rStat.GetStart();
- ImpCalcTail(aPara,aTailPoly,aRect);
- rStat.SetActionRect(aRect);
- return sal_True;
+
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(*this));
+ sdr::legacy::transformSdrObject(*this, basegfx::tools::createTranslateB2DHomMatrix(rStat.GetNow() - aSnapRange.getMinimum()));
+
+ aTailPoly[0]=Point(basegfx::fround(rStat.GetStart().getX()), basegfx::fround(rStat.GetStart().getY()));
+ Rectangle aOldRect(floor(aSnapRange.getMinX()), floor(aSnapRange.getMinY()), ceil(aSnapRange.getMaxX()), ceil(aSnapRange.getMaxY()));
+ ImpCalcTail(aPara, aTailPoly, aOldRect);
+
+ rStat.SetActionRange(aSnapRange);
+
+ return true;
}
-FASTBOOL SdrCaptionObj::MovCreate(SdrDragStat& rStat)
+bool SdrCaptionObj::MovCreate(SdrDragStat& rStat)
{
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
- aRect.SetPos(rStat.GetNow());
- ImpCalcTail(aPara,aTailPoly,aRect);
- rStat.SetActionRect(aRect);
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- return sal_True;
+
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(*this));
+ sdr::legacy::transformSdrObject(*this, basegfx::tools::createTranslateB2DHomMatrix(rStat.GetNow() - aSnapRange.getMinimum()));
+
+ Rectangle aOldRect(floor(aSnapRange.getMinX()), floor(aSnapRange.getMinY()), ceil(aSnapRange.getMaxX()), ceil(aSnapRange.getMaxY()));
+ ImpCalcTail(aPara, aTailPoly, aOldRect);
+
+ rStat.SetActionRange(aSnapRange);
+
+ return true;
}
-FASTBOOL SdrCaptionObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool SdrCaptionObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
ImpCaptParams aPara;
ImpGetCaptParams(aPara);
- aRect.SetPos(rStat.GetNow());
- ImpCalcTail(aPara,aTailPoly,aRect);
- SetRectsDirty();
+
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(*this));
+ sdr::legacy::transformSdrObject(*this, basegfx::tools::createTranslateB2DHomMatrix(rStat.GetNow() - aSnapRange.getMinimum()));
+
+ Rectangle aOldRect(floor(aSnapRange.getMinX()), floor(aSnapRange.getMinY()), ceil(aSnapRange.getMaxX()), ceil(aSnapRange.getMaxY()));
+ ImpCalcTail(aPara, aTailPoly, aOldRect);
+
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
}
-FASTBOOL SdrCaptionObj::BckCreate(SdrDragStat& /*rStat*/)
+bool SdrCaptionObj::BckCreate(SdrDragStat& /*rStat*/)
{
- return sal_False;
+ return false;
}
void SdrCaptionObj::BrkCreate(SdrDragStat& /*rStat*/)
@@ -599,131 +628,58 @@ void SdrCaptionObj::BrkCreate(SdrDragStat& /*rStat*/)
basegfx::B2DPolyPolygon SdrCaptionObj::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
{
- basegfx::B2DPolyPolygon aRetval;
- const basegfx::B2DRange aRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
- aRetval.append(basegfx::tools::createPolygonFromRect(aRange));
+ basegfx::B2DPolyPolygon aRetval(basegfx::tools::createUnitPolygon());
+
+ aRetval.transform(getSdrObjectTransformation());
aRetval.append(aTailPoly.getB2DPolygon());
+
return aRetval;
}
-Pointer SdrCaptionObj::GetCreatePointer() const
+Pointer SdrCaptionObj::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
return Pointer(POINTER_DRAW_CAPTION);
}
-void SdrCaptionObj::NbcMove(const Size& rSiz)
+void SdrCaptionObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- SdrRectObj::NbcMove(rSiz);
- MovePoly(aTailPoly,rSiz);
- if(mbFixedTail)
- SetTailPos(GetFixedTailPos());
-}
+ SdrRectObj::setSdrObjectTransformation(rTransformation);
-void SdrCaptionObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- SdrRectObj::NbcResize(rRef,xFact,yFact);
- ResizePoly(aTailPoly,rRef,xFact,yFact);
- ImpRecalcTail();
if(mbFixedTail)
+ {
SetTailPos(GetFixedTailPos());
+ }
}
-void SdrCaptionObj::NbcSetRelativePos(const Point& rPnt)
-{
- Point aRelPos0(aTailPoly.GetPoint(0)-aAnchor);
- Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
- NbcMove(aSiz); // Der ruft auch das SetRectsDirty()
-}
-
-Point SdrCaptionObj::GetRelativePos() const
-{
- return aTailPoly.GetPoint(0)-aAnchor;
-}
-
-void SdrCaptionObj::NbcSetAnchorPos(const Point& rPnt)
-{
- SdrRectObj::NbcSetAnchorPos(rPnt);
- // !!!!! fehlende Impl.
-}
-
-const Point& SdrCaptionObj::GetAnchorPos() const
-{
- // !!!!! fehlende Impl.
- return SdrRectObj::GetAnchorPos();
-}
-
-void SdrCaptionObj::RecalcSnapRect()
-{
- SdrRectObj::RecalcSnapRect();
- // #i32599#
- // maSnapRect.Union(aTailPoly.GetBoundRect());
- // !!!!! fehlende Impl.
-}
-
-const Rectangle& SdrCaptionObj::GetSnapRect() const
+const basegfx::B2DPoint SdrCaptionObj::GetTailPos() const
{
- return SdrRectObj::GetSnapRect();
+ return basegfx::B2DPoint(aTailPoly[0].X(), aTailPoly[0].Y());
}
-void SdrCaptionObj::NbcSetSnapRect(const Rectangle& rRect)
+void SdrCaptionObj::SetTailPos(const basegfx::B2DPoint& rPos)
{
- // #i32599#
- // Move back to see the rectangle of the underlying SdrRectObj
- // as the SnapRect, without the TailPos. That simplifies SnapRect
- // handling again, if not allows it at all...
- SdrRectObj::NbcSetSnapRect(rRect);
-}
+ const Point aOldPoint(basegfx::fround(rPos.getX()), basegfx::fround(rPos.getY()));
-const Rectangle& SdrCaptionObj::GetLogicRect() const
-{
- return aRect;
-}
-
-void SdrCaptionObj::NbcSetLogicRect(const Rectangle& rRect)
-{
- SdrRectObj::NbcSetLogicRect(rRect);
- ImpRecalcTail();
-}
-
-const Point& SdrCaptionObj::GetTailPos() const
-{
- return aTailPoly[0];
-}
+ if(!aTailPoly.GetSize() || aTailPoly[0] != aOldPoint)
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
-void SdrCaptionObj::SetTailPos(const Point& rPos)
-{
- if (aTailPoly.GetSize()==0 || aTailPoly[0]!=rPos) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetTailPos(rPos);
+ aTailPoly[0] = aOldPoint;
+ ImpRecalcTail();
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
}
-void SdrCaptionObj::NbcSetTailPos(const Point& rPos)
-{
- aTailPoly[0]=rPos;
- ImpRecalcTail();
-}
-
sal_uInt32 SdrCaptionObj::GetSnapPointCount() const
{
// !!!!! fehlende Impl.
return 0L;
}
-Point SdrCaptionObj::GetSnapPoint(sal_uInt32 /*i*/) const
+basegfx::B2DPoint SdrCaptionObj::GetSnapPoint(sal_uInt32 /*i*/) const
{
// !!!!! fehlende Impl.
- return Point(0,0);
-}
-
-void SdrCaptionObj::SetModel(SdrModel* pNewModel)
-{
- SdrRectObj::SetModel(pNewModel);
- ImpRecalcTail();
+ return basegfx::B2DPoint(0.0, 0.0);
}
void SdrCaptionObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
@@ -751,91 +707,54 @@ void SdrCaptionObj::RestGeoData(const SdrObjGeoData& rGeo)
aTailPoly=rCGeo.aTailPoly;
}
-SdrObject* SdrCaptionObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
-{ // #42334# - Convert implementiert
- SdrObject* pRect=SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
- SdrObject* pTail = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aTailPoly.getB2DPolygon()), sal_False, bBezier);
- SdrObject* pRet=(pTail!=NULL) ? pTail : pRect;
- if (pTail!=NULL && pRect!=NULL) {
- FASTBOOL bInsRect=sal_True;
- FASTBOOL bInsTail=sal_True;
- SdrObjList* pOL=pTail->GetSubList();
- if (pOL!=NULL) { pRet=pRect; bInsTail=sal_False; }
- if (pOL==NULL) pOL=pRect->GetSubList();
- if (pOL!=NULL) { pRet=pRect; bInsRect=sal_False; }
- if (pOL==NULL) {
- SdrObjGroup* pGrp=new SdrObjGroup;
- pOL=pGrp->GetSubList();
- pRet=pGrp;
- }
- if (bInsRect) pOL->NbcInsertObject(pRect);
- if (bInsTail) pOL->NbcInsertObject(pTail,0);
- }
- return pRet;
-}
+SdrObject* SdrCaptionObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
+{
+ SdrObject* pRect = SdrRectObj::DoConvertToPolygonObject(bBezier, bAddText);
+ SdrObject* pTail = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aTailPoly.getB2DPolygon()), false, bBezier);
+ SdrObject* pRet= (pTail) ? pTail : pRect;
-// #i32599#
-// Add own implementation for TRSetBaseGeometry to handle TailPos over changes.
-void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& /*rPolyPolygon*/)
-{
- // break up matrix
- basegfx::B2DTuple aScale;
- basegfx::B2DTuple aTranslate;
- double fRotate, fShearX;
- rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
- // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
- if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
+ if(pTail && pRect)
{
- aScale.setX(fabs(aScale.getX()));
- aScale.setY(fabs(aScale.getY()));
- fRotate = fmod(fRotate + F_PI, F_2PI);
- }
+ bool bInsRect(true);
+ bool bInsTail(true);
+ SdrObjList* pOL = pTail->getChildrenOfSdrObject();
- // force metric to pool metric
- SfxMapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
+ if(pOL)
{
- case SFX_MAPUNIT_TWIP :
- {
- // position
- aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
- aTranslate.setY(ImplMMToTwips(aTranslate.getY()));
+ pRet = pRect;
+ bInsTail = false;
+ }
- // size
- aScale.setX(ImplMMToTwips(aScale.getX()));
- aScale.setY(ImplMMToTwips(aScale.getY()));
+ if(!pOL)
+ {
+ pOL = pRect->getChildrenOfSdrObject();
+ }
- break;
- }
- default:
- {
- DBG_ERROR("TRSetBaseGeometry: Missing unit translation to PoolMetric!");
- }
+ if(pOL)
+ {
+ pRet = pRect;
+ bInsRect = false;
}
- }
- // if anchor is used, make position relative to it
- if( pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
+ if(!pOL)
{
- aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
+ SdrObjGroup* pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
+ pOL = pGrp->getChildrenOfSdrObject();
+ pRet = pGrp;
}
- }
- // build BaseRect
- Point aPoint(FRound(aTranslate.getX()), FRound(aTranslate.getY()));
- Rectangle aBaseRect(aPoint, Size(FRound(aScale.getX()), FRound(aScale.getY())));
+ if(bInsRect)
+ {
+ pOL->InsertObjectToSdrObjList(*pRect);
+ }
- // set BaseRect, but rescue TailPos over this call
- const Point aTailPoint = GetTailPos();
- SetSnapRect(aBaseRect);
- SetTailPos(aTailPoint);
- ImpRecalcTail();
+ if(bInsTail)
+ {
+ pOL->InsertObjectToSdrObjList(*pTail, 0);
+ }
+ }
+
+ return pRet;
}
// geometry access
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 6c6c84405f9b..33b78561f751 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -46,8 +46,6 @@
#include "svx/svdglob.hxx" // StringCache
#include "svx/svdstr.hrc" // Objektname
#include <editeng/eeitem.hxx>
-#include "svdoimp.hxx"
-#include <svx/sdr/properties/circleproperties.hxx>
#include <svx/sdr/contact/viewcontactofsdrcircobj.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -55,263 +53,344 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
+// nameless helpers
-Point GetWinkPnt(const Rectangle& rR, long nWink)
+namespace
{
- Point aCenter(rR.Center());
- long nWdt=rR.Right()-rR.Left();
- long nHgt=rR.Bottom()-rR.Top();
- long nMaxRad=((nWdt>nHgt ? nWdt : nHgt)+1) /2;
- double a;
- a=nWink*nPi180;
- Point aRetval(Round(cos(a)*nMaxRad),-Round(sin(a)*nMaxRad));
- if (nWdt==0) aRetval.X()=0;
- if (nHgt==0) aRetval.Y()=0;
- if (nWdt!=nHgt) {
- if (nWdt>nHgt) {
- if (nWdt!=0) {
- // eventuelle Ueberlaeufe bei sehr grossen Objekten abfangen (Bug 23384)
- if (Abs(nHgt)>32767 || Abs(aRetval.Y())>32767) {
- aRetval.Y()=BigMulDiv(aRetval.Y(),nHgt,nWdt);
- } else {
- aRetval.Y()=aRetval.Y()*nHgt/nWdt;
- }
+ double impSnapAngle(double fAngle, const SdrView& rView)
+ {
+ if(rView.IsAngleSnapEnabled())
+ {
+ // angle snap
+ const double fSnapAngle(((rView.GetSnapAngle() % 36000) * F_PI) / 18000.0);
+
+ fAngle = basegfx::snapToNearestMultiple(fAngle, fSnapAngle);
+
+ if(basegfx::fTools::equalZero(fAngle))
+ {
+ fAngle = 0.0;
+ }
+ else if(basegfx::fTools::equal(fAngle, F_2PI))
+ {
+ fAngle = F_2PI;
+ }
+ }
+
+ return fAngle;
+ }
+
+ void impCalcNewStartEnd(SdrDragStat& rStat, SdrCircObj& rCircObj, double& o_rfNewStart, double& o_rfNewEnd)
+ {
+ const sal_uInt32 nPntAnz(rStat.GetPointAnz());
+
+ if(nPntAnz > 2)
+ {
+ basegfx::B2DHomMatrix aInvObj(rCircObj.getSdrObjectTransformation());
+ aInvObj.invert();
+
+ // calc vector in normalized object coordinates
+ const bool bPoint3(3 == nPntAnz);
+ const basegfx::B2DPoint aPoint(bPoint3 ? rStat.GetPoint(2) : rStat.GetPoint(3));
+ const basegfx::B2DPoint aVec(aInvObj * aPoint);
+
+ // calc angle in normalized object coordinates
+ double fNewAngle(atan2(aVec.getY() - 0.5, aVec.getX() - 0.5));
+
+ if(fNewAngle < 0.0)
+ {
+ // move from atan2's [-F_PI .. F_PI] to [0.0 .. F_2PI] range
+ fNewAngle += F_2PI;
}
- } else {
- if (nHgt!=0) {
- // eventuelle Ueberlaeufe bei sehr grossen Objekten abfangen (Bug 23384)
- if (Abs(nWdt)>32767 || Abs(aRetval.X())>32767) {
- aRetval.X()=BigMulDiv(aRetval.X(),nWdt,nHgt);
- } else {
- aRetval.X()=aRetval.X()*nWdt/nHgt;
+
+ // angle snap
+ fNewAngle = impSnapAngle(fNewAngle, rStat.GetSdrViewFromSdrDragStat());
+
+ if(bPoint3)
+ {
+ o_rfNewStart = fNewAngle;
+ }
+
+ o_rfNewEnd = fNewAngle;
+ }
+ }
+
+ basegfx::B2DPolygon ImpCalcXPolyCirc(
+ const SdrCircleObjType eSdrCircleObjType,
+ const basegfx::B2DHomMatrix& rTransform,
+ double fStart,
+ double fEnd)
+ {
+ basegfx::B2DPolygon aCircPolygon;
+
+ if(CircleType_Circle == eSdrCircleObjType || basegfx::fTools::equal(fStart, fEnd))
+ {
+ // create full circle. Do not use createPolygonFromEllipse; it's necessary
+ // to get the start point to the bottom of the circle to keep compatible to
+ // old geometry creation
+ aCircPolygon = basegfx::tools::createPolygonFromUnitCircle(1);
+ }
+ else
+ {
+ // create circle segment. This is not closed by default.
+ // Exchange start and end since the historical definitions spawns
+ // the visible part of the circle segment in mathematically negative
+ // direction
+ aCircPolygon = basegfx::tools::createPolygonFromUnitEllipseSegment(fEnd, fStart);
+
+ // check closing states
+ const bool bCloseSegment(CircleType_Arc != eSdrCircleObjType);
+ const bool bCloseUsingCenter(CircleType_Sector == eSdrCircleObjType);
+
+ if(bCloseSegment)
+ {
+ if(bCloseUsingCenter)
+ {
+ // add center point at start (for historical reasons)
+ basegfx::B2DPolygon aSector;
+ aSector.append(basegfx::B2DPoint(0.0, 0.0));
+ aSector.append(aCircPolygon);
+ aCircPolygon = aSector;
}
+
+ // close
+ aCircPolygon.setClosed(true);
}
}
+
+ // scale and move UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1), then
+ // apply object transformation
+ const basegfx::B2DHomMatrix aUnitToWorld(
+ rTransform *
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
+
+ // apply
+ aCircPolygon.transform(aUnitToWorld);
+
+ return aCircPolygon;
}
- aRetval+=aCenter;
- return aRetval;
}
//////////////////////////////////////////////////////////////////////////////
-// BaseProperties section
+// SdrCircObjGeoData
-sdr::properties::BaseProperties* SdrCircObj::CreateObjectSpecificProperties()
+class SdrCircObjGeoData : public SdrObjGeoData
{
- return new sdr::properties::CircleProperties(*this);
-}
+public:
+ SdrCircleObjType meSdrCircleObjType;
+ double mfStartAngle; // [-F_PI .. F_PI]
+ double mfEndAngle; // [-F_PI .. F_PI]
+};
//////////////////////////////////////////////////////////////////////////////
-// DrawContact section
+// SdrCircObj
sdr::contact::ViewContact* SdrCircObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfSdrCircObj(*this);
}
-//////////////////////////////////////////////////////////////////////////////
+SdrCircObj::SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrCircleObjType eSdrCircleObjType,
+ const basegfx::B2DHomMatrix& rTransform,
+ double fNewStartWink,
+ double fNewEndWink)
+: SdrRectObj(
+ rSdrModel,
+ rTransform),
+ meSdrCircleObjType(eSdrCircleObjType),
+ mfStartAngle(fNewStartWink),
+ mfEndAngle(fNewEndWink)
+{
+ // snap angles to [0.0 .. F_2PI] range
+ if(0.0 != mfStartAngle)
+ {
+ mfStartAngle = basegfx::snapToZeroRange(mfStartAngle, F_2PI);
+ }
-TYPEINIT1(SdrCircObj,SdrRectObj);
+ if(F_2PI != mfEndAngle)
+ {
+ mfEndAngle = basegfx::snapToZeroRange(mfEndAngle, F_2PI);
+ }
+}
-SdrCircObj::SdrCircObj(SdrObjKind eNewKind)
+SdrCircObj::~SdrCircObj()
{
- nStartWink=0;
- nEndWink=36000;
- meCircleKind=eNewKind;
- bClosedObj=eNewKind!=OBJ_CARC;
}
-SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect):
- SdrRectObj(rRect)
+void SdrCircObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- nStartWink=0;
- nEndWink=36000;
- meCircleKind=eNewKind;
- bClosedObj=eNewKind!=OBJ_CARC;
+ if(this != &rSource)
+ {
+ const SdrCircObj* pSource = dynamic_cast< const SdrCircObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrRectObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ meSdrCircleObjType = pSource->meSdrCircleObjType;
+ mfStartAngle = pSource->mfStartAngle;
+ mfEndAngle = pSource->mfEndAngle;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
}
-SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const Rectangle& rRect, long nNewStartWink, long nNewEndWink):
- SdrRectObj(rRect)
+SdrObject* SdrCircObj::CloneSdrObject(SdrModel* pTargetModel) const
{
- long nWinkDif=nNewEndWink-nNewStartWink;
- nStartWink=NormAngle360(nNewStartWink);
- nEndWink=NormAngle360(nNewEndWink);
- if (nWinkDif==36000) nEndWink+=nWinkDif; // Vollkreis
- meCircleKind=eNewKind;
- bClosedObj=eNewKind!=OBJ_CARC;
+ SdrCircObj* pClone = new SdrCircObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
-SdrCircObj::~SdrCircObj()
+bool SdrCircObj::IsClosedObj() const
{
+ return (CircleType_Arc != meSdrCircleObjType);
}
-void SdrCircObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
+double SdrCircObj::GetStartAngle() const
{
- FASTBOOL bCanConv=!HasText() || ImpCanConvTextToCurve();
- rInfo.bEdgeRadiusAllowed = sal_False;
- rInfo.bCanConvToPath=bCanConv;
- rInfo.bCanConvToPoly=bCanConv;
- rInfo.bCanConvToContour = !IsFontwork() && (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
+ return mfStartAngle;
}
-sal_uInt16 SdrCircObj::GetObjIdentifier() const
+double SdrCircObj::GetEndAngle() const
{
- return sal_uInt16(meCircleKind);
+ return mfEndAngle;
}
-FASTBOOL SdrCircObj::PaintNeedsXPolyCirc() const
+SdrCircleObjType SdrCircObj::GetSdrCircleObjType() const
{
- // XPoly ist notwendig fuer alle gedrehten Ellipsenobjekte,
- // fuer alle Kreis- und Ellipsenabschnitte
- // und wenn nicht WIN dann (erstmal) auch fuer Kreis-/Ellipsenausschnitte
- // und Kreis-/Ellipsenboegen (wg. Genauigkeit)
- FASTBOOL bNeed=aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 || meCircleKind==OBJ_CCUT;
- // Wenn nicht Win, dann fuer alle ausser Vollkreis (erstmal!!!)
- if (meCircleKind!=OBJ_CIRC) bNeed=sal_True;
-
- const SfxItemSet& rSet = GetObjectItemSet();
- if(!bNeed)
- {
- // XPoly ist notwendig fuer alles was nicht LineSolid oder LineNone ist
- XLineStyle eLine = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue();
- bNeed = eLine != XLINE_NONE && eLine != XLINE_SOLID;
-
- // XPoly ist notwendig fuer dicke Linien
- if(!bNeed && eLine != XLINE_NONE)
- bNeed = ((XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue() != 0;
-
- // XPoly ist notwendig fuer Kreisboegen mit Linienenden
- if(!bNeed && meCircleKind == OBJ_CARC)
- {
- // Linienanfang ist da, wenn StartPolygon und StartWidth!=0
- bNeed=((XLineStartItem&)(rSet.Get(XATTR_LINESTART))).GetLineStartValue().count() != 0L &&
- ((XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue() != 0;
-
- if(!bNeed)
- {
- // Linienende ist da, wenn EndPolygon und EndWidth!=0
- bNeed = ((XLineEndItem&)(rSet.Get(XATTR_LINEEND))).GetLineEndValue().count() != 0L &&
- ((XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue() != 0;
- }
- }
- }
+ return meSdrCircleObjType;
+}
- // XPoly ist notwendig, wenn Fill !=None und !=Solid
- if(!bNeed && meCircleKind != OBJ_CARC)
+void SdrCircObj::SetSdrCircleObjType(SdrCircleObjType eNew)
+{
+ if(eNew != meSdrCircleObjType)
{
- XFillStyle eFill=((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue();
- bNeed = eFill != XFILL_NONE && eFill != XFILL_SOLID;
- }
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
- if(!bNeed && meCircleKind != OBJ_CIRC && nStartWink == nEndWink)
- bNeed=sal_True; // Weil sonst Vollkreis gemalt wird
-
- return bNeed;
+ meSdrCircleObjType = eNew;
+ SetChanged();
+ }
}
-basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, const Rectangle& rRect1, long nStart, long nEnd) const
+void SdrCircObj::SetStartAngle(double fNew)
{
- const basegfx::B2DRange aRange(rRect1.Left(), rRect1.Top(), rRect1.Right(), rRect1.Bottom());
- basegfx::B2DPolygon aCircPolygon;
+ fNew = basegfx::snapToZeroRange(fNew, F_2PI);
- if(OBJ_CIRC == eCicrleKind)
+ if(!basegfx::fTools::equal(fNew, mfStartAngle))
{
- // create full circle. Do not use createPolygonFromEllipse; it's necessary
- // to get the start point to the bottom of the circle to keep compatible to
- // old geometry creation
- aCircPolygon = basegfx::tools::createPolygonFromUnitCircle(1);
-
- // needs own scaling and translation from unit circle to target size (same as
- // would be in createPolygonFromEllipse)
- const basegfx::B2DPoint aCenter(aRange.getCenter());
- const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(
- aRange.getWidth() / 2.0, aRange.getHeight() / 2.0,
- aCenter.getX(), aCenter.getY()));
- aCircPolygon.transform(aMatrix);
- }
- else
- {
- // mirror start, end for geometry creation since model coordinate system is mirrored in Y
- // #i111715# increase numerical correctness by first dividing and not using F_PI1800
- const double fStart((((36000 - nEnd) % 36000) / 18000.0) * F_PI);
- const double fEnd((((36000 - nStart) % 36000) / 18000.0) * F_PI);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
- // create circle segment. This is not closed by default
- aCircPolygon = basegfx::tools::createPolygonFromEllipseSegment(
- aRange.getCenter(), aRange.getWidth() / 2.0, aRange.getHeight() / 2.0,
- fStart, fEnd);
+ mfStartAngle = fNew;
+ SetChanged();
+ }
+}
- // check closing states
- const bool bCloseSegment(OBJ_CARC != eCicrleKind);
- const bool bCloseUsingCenter(OBJ_SECT == eCicrleKind);
+void SdrCircObj::SetEndAngle(double fNew)
+{
+ fNew = basegfx::snapToZeroRange(fNew, F_2PI);
- if(bCloseSegment)
- {
- if(bCloseUsingCenter)
- {
- // add center point at start (for historical reasons)
- basegfx::B2DPolygon aSector;
- aSector.append(aRange.getCenter());
- aSector.append(aCircPolygon);
- aCircPolygon = aSector;
- }
+ if(!basegfx::fTools::equal(fNew, mfEndAngle))
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
- // close
- aCircPolygon.setClosed(true);
- }
+ mfEndAngle = fNew;
+ SetChanged();
}
+}
- // #i76950#
- if(aGeo.nShearWink || aGeo.nDrehWink)
- {
- // translate top left to (0,0)
- const basegfx::B2DPoint aTopLeft(aRange.getMinimum());
- basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix(
- -aTopLeft.getX(), -aTopLeft.getY()));
-
- // shear, rotate and back to top left (if needed)
- aMatrix = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
- aGeo.nShearWink ? tan((36000 - aGeo.nShearWink) * F_PI18000) : 0.0,
- aGeo.nDrehWink ? (36000 - aGeo.nDrehWink) * F_PI18000 : 0.0,
- aTopLeft) * aMatrix;
-
- // apply transformation
- aCircPolygon.transform(aMatrix);
- }
+void SdrCircObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
+{
+ const bool bCanConv(!HasText() || ImpCanConvTextToCurve());
- return aCircPolygon;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbCanConvToPath = bCanConv;
+ rInfo.mbCanConvToPoly = bCanConv;
+ rInfo.mbCanConvToContour = !IsFontwork() && (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
-void SdrCircObj::RecalcXPoly()
+sal_uInt16 SdrCircObj::GetObjIdentifier() const
{
- const basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, aRect, nStartWink, nEndWink));
- mpXPoly = new XPolygon(aPolyCirc);
+ return sal_uInt16(OBJ_CIRC);
}
void SdrCircObj::TakeObjNameSingul(XubString& rName) const
{
- sal_uInt16 nID=STR_ObjNameSingulCIRC;
- if (aRect.GetWidth()==aRect.GetHeight() && aGeo.nShearWink==0) {
- switch (meCircleKind) {
- case OBJ_CIRC: nID=STR_ObjNameSingulCIRC; break;
- case OBJ_SECT: nID=STR_ObjNameSingulSECT; break;
- case OBJ_CARC: nID=STR_ObjNameSingulCARC; break;
- case OBJ_CCUT: nID=STR_ObjNameSingulCCUT; break;
+ sal_uInt16 nID(STR_ObjNameSingulCIRC);
+ const basegfx::B2DVector& rScale(getSdrObjectScale());
+ const bool bOrthoScaled(basegfx::fTools::equal(fabs(rScale.getX()), fabs(rScale.getY())));
+
+ if(bOrthoScaled && !isSheared())
+ {
+ switch (meSdrCircleObjType)
+ {
+ case CircleType_Circle:
+ {
+ nID = STR_ObjNameSingulCIRC;
+ break;
+ }
+ case CircleType_Sector:
+ {
+ nID = STR_ObjNameSingulSECT;
+ break;
+ }
+ case CircleType_Arc:
+ {
+ nID = STR_ObjNameSingulCARC;
+ break;
+ }
+ case CircleType_Segment:
+ {
+ nID = STR_ObjNameSingulCCUT;
+ break;
+ }
default: break;
}
- } else {
- switch (meCircleKind) {
- case OBJ_CIRC: nID=STR_ObjNameSingulCIRCE; break;
- case OBJ_SECT: nID=STR_ObjNameSingulSECTE; break;
- case OBJ_CARC: nID=STR_ObjNameSingulCARCE; break;
- case OBJ_CCUT: nID=STR_ObjNameSingulCCUTE; break;
+ }
+ else
+ {
+ switch (meSdrCircleObjType)
+ {
+ case CircleType_Circle:
+ {
+ nID = STR_ObjNameSingulCIRCE;
+ break;
+ }
+ case CircleType_Sector:
+ {
+ nID = STR_ObjNameSingulSECTE;
+ break;
+ }
+ case CircleType_Arc:
+ {
+ nID = STR_ObjNameSingulCARCE;
+ break;
+ }
+ case CircleType_Segment:
+ {
+ nID = STR_ObjNameSingulCCUTE;
+ break;
+ }
default: break;
}
}
- rName=ImpGetResStr(nID);
+
+ rName = ImpGetResStr(nID);
String aName( GetName() );
+
if(aName.Len())
{
rName += sal_Unicode(' ');
@@ -323,161 +402,102 @@ void SdrCircObj::TakeObjNameSingul(XubString& rName) const
void SdrCircObj::TakeObjNamePlural(XubString& rName) const
{
- sal_uInt16 nID=STR_ObjNamePluralCIRC;
- if (aRect.GetWidth()==aRect.GetHeight() && aGeo.nShearWink==0) {
- switch (meCircleKind) {
- case OBJ_CIRC: nID=STR_ObjNamePluralCIRC; break;
- case OBJ_SECT: nID=STR_ObjNamePluralSECT; break;
- case OBJ_CARC: nID=STR_ObjNamePluralCARC; break;
- case OBJ_CCUT: nID=STR_ObjNamePluralCCUT; break;
+ sal_uInt16 nID(STR_ObjNamePluralCIRC);
+ const basegfx::B2DVector& rScale(getSdrObjectScale());
+ const bool bOrthoScaled(basegfx::fTools::equal(fabs(rScale.getX()), fabs(rScale.getY())));
+
+ if(bOrthoScaled && !isSheared())
+ {
+ switch (meSdrCircleObjType)
+ {
+ case CircleType_Circle:
+ {
+ nID = STR_ObjNamePluralCIRC;
+ break;
+ }
+ case CircleType_Sector:
+ {
+ nID = STR_ObjNamePluralSECT;
+ break;
+ }
+ case CircleType_Arc:
+ {
+ nID = STR_ObjNamePluralCARC;
+ break;
+ }
+ case CircleType_Segment:
+ {
+ nID = STR_ObjNamePluralCCUT;
+ break;
+ }
default: break;
}
- } else {
- switch (meCircleKind) {
- case OBJ_CIRC: nID=STR_ObjNamePluralCIRCE; break;
- case OBJ_SECT: nID=STR_ObjNamePluralSECTE; break;
- case OBJ_CARC: nID=STR_ObjNamePluralCARCE; break;
- case OBJ_CCUT: nID=STR_ObjNamePluralCCUTE; break;
+ }
+ else
+ {
+ switch (meSdrCircleObjType)
+ {
+ case CircleType_Circle:
+ {
+ nID = STR_ObjNamePluralCIRCE;
+ break;
+ }
+ case CircleType_Sector:
+ {
+ nID = STR_ObjNamePluralSECTE;
+ break;
+ }
+ case CircleType_Arc:
+ {
+ nID = STR_ObjNamePluralCARCE;
+ break;
+ }
+ case CircleType_Segment:
+ {
+ nID = STR_ObjNamePluralCCUTE;
+ break;
+ }
default: break;
}
}
- rName=ImpGetResStr(nID);
-}
-void SdrCircObj::operator=(const SdrObject& rObj)
-{
- SdrRectObj::operator=(rObj);
-
- nStartWink = ((SdrCircObj&)rObj).nStartWink;
- nEndWink = ((SdrCircObj&)rObj).nEndWink;
+ rName = ImpGetResStr(nID);
}
basegfx::B2DPolyPolygon SdrCircObj::TakeXorPoly() const
{
- const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartWink, nEndWink));
- return basegfx::B2DPolyPolygon(aCircPolygon);
-}
-
-struct ImpCircUser : public SdrDragStatUserData
-{
- Rectangle aR;
- Point aCenter;
- Point aRadius;
- Point aP1;
- Point aP2;
- long nMaxRad;
- long nHgt;
- long nWdt;
- long nStart;
- long nEnd;
- long nWink;
- FASTBOOL bRight; // noch nicht implementiert
-
-public:
- ImpCircUser()
- : nMaxRad(0),
- nHgt(0),
- nWdt(0),
- nStart(0),
- nEnd(0),
- bRight(sal_False)
- {}
- void SetCreateParams(SdrDragStat& rStat);
-};
+ const basegfx::B2DPolygon aCircPolygon(
+ ImpCalcXPolyCirc(
+ GetSdrCircleObjType(),
+ getSdrObjectTransformation(),
+ GetStartAngle(),
+ GetEndAngle()));
-sal_uInt32 SdrCircObj::GetHdlCount() const
-{
- if(OBJ_CIRC != meCircleKind)
- {
- return 10L;
- }
- else
- {
- return 8L;
- }
+ return basegfx::B2DPolyPolygon(aCircPolygon);
}
-SdrHdl* SdrCircObj::GetHdl(sal_uInt32 nHdlNum) const
+void SdrCircObj::AddToHdlList(SdrHdlList& rHdlList) const
{
- if (meCircleKind==OBJ_CIRC)
+ if(CircleType_Circle != meSdrCircleObjType)
{
- nHdlNum += 2L;
- }
+ // start angle handle
+ basegfx::B2DPoint aStart(0.5 + (cos(GetStartAngle()) * 0.5), 0.5 + (sin(GetStartAngle()) * 0.5));
+ aStart = getSdrObjectTransformation() * aStart;
+ SdrHdl* pStartHdl = new SdrHdl(rHdlList, this, HDL_CIRC, aStart);
+ pStartHdl->SetPointNum(1);
- SdrHdl* pH = NULL;
- Point aPnt;
- SdrHdlKind eLocalKind(HDL_MOVE);
- sal_uInt32 nPNum(0);
-
- switch (nHdlNum)
- {
- case 0:
- aPnt = GetWinkPnt(aRect,nStartWink);
- eLocalKind = HDL_CIRC;
- nPNum = 1;
- break;
- case 1:
- aPnt = GetWinkPnt(aRect,nEndWink);
- eLocalKind = HDL_CIRC;
- nPNum = 2L;
- break;
- case 2:
- aPnt = aRect.TopLeft();
- eLocalKind = HDL_UPLFT;
- break;
- case 3:
- aPnt = aRect.TopCenter();
- eLocalKind = HDL_UPPER;
- break;
- case 4:
- aPnt = aRect.TopRight();
- eLocalKind = HDL_UPRGT;
- break;
- case 5:
- aPnt = aRect.LeftCenter();
- eLocalKind = HDL_LEFT;
- break;
- case 6:
- aPnt = aRect.RightCenter();
- eLocalKind = HDL_RIGHT;
- break;
- case 7:
- aPnt = aRect.BottomLeft();
- eLocalKind = HDL_LWLFT;
- break;
- case 8:
- aPnt = aRect.BottomCenter();
- eLocalKind = HDL_LOWER;
- break;
- case 9:
- aPnt = aRect.BottomRight();
- eLocalKind = HDL_LWRGT;
- break;
- }
-
- if (aGeo.nShearWink)
- {
- ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
+ // end angle handle
+ basegfx::B2DPoint aEnd(0.5 + (cos(GetEndAngle()) * 0.5), 0.5 + (sin(GetEndAngle()) * 0.5));
+ aEnd = getSdrObjectTransformation() * aEnd;
+ SdrHdl* pEndHdl = new SdrHdl(rHdlList, this, HDL_CIRC, aEnd);
+ pEndHdl->SetPointNum(2);
}
- if (aGeo.nDrehWink)
- {
- RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- }
-
- if (eLocalKind != HDL_MOVE)
- {
- pH = new SdrHdl(aPnt,eLocalKind);
- pH->SetPointNum(nPNum);
- pH->SetObj((SdrObject*)this);
- pH->SetDrehWink(aGeo.nDrehWink);
- }
-
- return pH;
+ // add parent's handles. Use SdrTextObj to not add the thext frame handle,
+ // but the regular object ones (eight, not nine)
+ SdrTextObj::AddToHdlList(rHdlList);
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
bool SdrCircObj::hasSpecialDrag() const
{
return true;
@@ -485,11 +505,11 @@ bool SdrCircObj::hasSpecialDrag() const
bool SdrCircObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bWink(rDrag.GetActiveHdl() && HDL_CIRC == rDrag.GetActiveHdl()->GetKind());
if(bWink)
{
- if(1 == rDrag.GetHdl()->GetPointNum() || 2 == rDrag.GetHdl()->GetPointNum())
+ if(1 == rDrag.GetActiveHdl()->GetPointNum() || 2 == rDrag.GetActiveHdl()->GetPointNum())
{
rDrag.SetNoSnap(true);
}
@@ -502,61 +522,35 @@ bool SdrCircObj::beginSpecialDrag(SdrDragStat& rDrag) const
bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag)
{
- const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bWink(rDrag.GetActiveHdl() && HDL_CIRC == rDrag.GetActiveHdl()->GetKind());
if(bWink)
{
- Point aPt(rDrag.GetNow());
-
- if (aGeo.nDrehWink!=0)
- RotatePoint(aPt,aRect.TopLeft(),-aGeo.nSin,aGeo.nCos);
-
- if (aGeo.nShearWink!=0)
- ShearPoint(aPt,aRect.TopLeft(),-aGeo.nTan);
-
- aPt-=aRect.Center();
+ basegfx::B2DHomMatrix aInverse(getSdrObjectTransformation());
+ aInverse.invert();
+ const basegfx::B2DPoint aObjectCoor(aInverse * rDrag.GetNow());
- long nWdt=aRect.Right()-aRect.Left();
- long nHgt=aRect.Bottom()-aRect.Top();
+ // calc angle in normalized object coordinates
+ double fNewAngle(atan2(aObjectCoor.getY() - 0.5, aObjectCoor.getX() - 0.5));
- if(nWdt>=nHgt)
+ if(fNewAngle < 0.0)
{
- aPt.Y()=BigMulDiv(aPt.Y(),nWdt,nHgt);
+ // move from atan2's [-F_PI .. F_PI] to [0.0 .. F_2PI] range
+ fNewAngle += F_2PI;
}
- else
- {
- aPt.X()=BigMulDiv(aPt.X(),nHgt,nWdt);
- }
-
- long nWink=NormAngle360(GetAngle(aPt));
- if (rDrag.GetView() && rDrag.GetView()->IsAngleSnapEnabled())
- {
- long nSA=rDrag.GetView()->GetSnapAngle();
-
- if (nSA!=0)
- {
- nWink+=nSA/2;
- nWink/=nSA;
- nWink*=nSA;
- nWink=NormAngle360(nWink);
- }
- }
+ // angle snap
+ fNewAngle = impSnapAngle(fNewAngle, rDrag.GetSdrViewFromSdrDragStat());
- if(1 == rDrag.GetHdl()->GetPointNum())
+ if(1 == rDrag.GetActiveHdl()->GetPointNum())
{
- nStartWink = nWink;
+ SetStartAngle(fNewAngle);
}
- else if(2 == rDrag.GetHdl()->GetPointNum())
+ else // (2 == rDrag.GetActiveHdl()->GetPointNum())
{
- nEndWink = nWink;
+ SetEndAngle(fNewAngle);
}
- SetRectsDirty();
- SetXPolyDirty();
- ImpSetCircInfoToAttr();
- SetChanged();
-
return true;
}
else
@@ -567,31 +561,31 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
+ const bool bCreateComment(this == rDrag.GetSdrViewFromSdrDragStat().GetCreateObj());
if(bCreateComment)
{
XubString aStr;
- ImpTakeDescriptionStr(STR_ViewCreateObj, aStr);
+ TakeMarkedDescriptionString(STR_ViewCreateObj, aStr);
const sal_uInt32 nPntAnz(rDrag.GetPointAnz());
- if(OBJ_CIRC != meCircleKind && nPntAnz > 2)
+ if(CircleType_Circle != meSdrCircleObjType && nPntAnz > 2)
{
- ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser();
- sal_Int32 nWink;
+ double fWink(0.0);
aStr.AppendAscii(" (");
if(3 == nPntAnz)
{
- nWink = pU->nStart;
+ fWink = GetStartAngle();
}
else
{
- nWink = pU->nEnd;
+ fWink = GetEndAngle();
}
- aStr += GetWinkStr(nWink,sal_False);
+ const sal_Int32 nWink(basegfx::fround(((F_2PI - fWink) * 18000.0) / F_PI) % 36000);
+ aStr += GetWinkStr(nWink, false);
aStr += sal_Unicode(')');
}
@@ -599,16 +593,17 @@ String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
}
else
{
- const bool bWink(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bWink(rDrag.GetActiveHdl() && HDL_CIRC == rDrag.GetActiveHdl()->GetKind());
if(bWink)
{
XubString aStr;
- const sal_Int32 nWink(1 == rDrag.GetHdl()->GetPointNum() ? nStartWink : nEndWink);
+ const double fWink(1 == rDrag.GetActiveHdl()->GetPointNum() ? GetStartAngle() : GetEndAngle());
+ const sal_Int32 nWink(basegfx::fround(((F_2PI - fWink) * 18000.0) / F_PI) % 36000);
- ImpTakeDescriptionStr(STR_DragCircAngle, aStr);
+ TakeMarkedDescriptionString(STR_DragCircAngle, aStr);
aStr.AppendAscii(" (");
- aStr += GetWinkStr(nWink,sal_False);
+ aStr += GetWinkStr(nWink, false);
aStr += sal_Unicode(')');
return aStr;
@@ -620,170 +615,99 @@ String SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void ImpCircUser::SetCreateParams(SdrDragStat& rStat)
+bool SdrCircObj::MovCreate(SdrDragStat& rStat)
{
- rStat.TakeCreateRect(aR);
- aR.Justify();
- aCenter=aR.Center();
- nWdt=aR.Right()-aR.Left();
- nHgt=aR.Bottom()-aR.Top();
- nMaxRad=((nWdt>nHgt ? nWdt : nHgt)+1) /2;
- nStart=0;
- nEnd=36000;
- if (rStat.GetPointAnz()>2) {
- Point aP(rStat.GetPoint(2)-aCenter);
- if (nWdt==0) aP.X()=0;
- if (nHgt==0) aP.Y()=0;
- if (nWdt>=nHgt) {
- if (nHgt!=0) aP.Y()=aP.Y()*nWdt/nHgt;
- } else {
- if (nWdt!=0) aP.X()=aP.X()*nHgt/nWdt;
- }
- nStart=NormAngle360(GetAngle(aP));
- if (rStat.GetView()!=NULL && rStat.GetView()->IsAngleSnapEnabled()) {
- long nSA=rStat.GetView()->GetSnapAngle();
- if (nSA!=0) { // Winkelfang
- nStart+=nSA/2;
- nStart/=nSA;
- nStart*=nSA;
- nStart=NormAngle360(nStart);
- }
- }
- aP1 = GetWinkPnt(aR,nStart);
- nEnd=nStart;
- aP2=aP1;
- } else aP1=aCenter;
- if (rStat.GetPointAnz()>3) {
- Point aP(rStat.GetPoint(3)-aCenter);
- if (nWdt>=nHgt) {
- aP.Y()=BigMulDiv(aP.Y(),nWdt,nHgt);
- } else {
- aP.X()=BigMulDiv(aP.X(),nHgt,nWdt);
- }
- nEnd=NormAngle360(GetAngle(aP));
- if (rStat.GetView()!=NULL && rStat.GetView()->IsAngleSnapEnabled()) {
- long nSA=rStat.GetView()->GetSnapAngle();
- if (nSA!=0) { // Winkelfang
- nEnd+=nSA/2;
- nEnd/=nSA;
- nEnd*=nSA;
- nEnd=NormAngle360(nEnd);
- }
- }
- aP2 = GetWinkPnt(aR,nEnd);
- } else aP2=aCenter;
-}
+ const sal_uInt32 nPntAnz(rStat.GetPointAnz());
-void SdrCircObj::ImpSetCreateParams(SdrDragStat& rStat) const
-{
- ImpCircUser* pU=(ImpCircUser*)rStat.GetUser();
- if (pU==NULL) {
- pU=new ImpCircUser;
- rStat.SetUser(pU);
+ if(nPntAnz < 3)
+ {
+ return SdrRectObj::MovCreate(rStat);
}
- pU->SetCreateParams(rStat);
-}
+ else
+ {
+ double fNewStart(GetStartAngle());
+ double fNewEnd(GetEndAngle());
-FASTBOOL SdrCircObj::BegCreate(SdrDragStat& rStat)
-{
- rStat.SetOrtho4Possible();
- Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
- aRect1.Justify();
- rStat.SetActionRect(aRect1);
- aRect = aRect1;
- ImpSetCreateParams(rStat);
- return sal_True;
+ impCalcNewStartEnd(rStat, *this, fNewStart, fNewEnd);
+ SetStartAngle(fNewStart);
+ SetEndAngle(fNewEnd);
+ }
+
+ return true;
}
-FASTBOOL SdrCircObj::MovCreate(SdrDragStat& rStat)
+bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- ImpSetCreateParams(rStat);
- ImpCircUser* pU=(ImpCircUser*)rStat.GetUser();
- rStat.SetActionRect(pU->aR);
- aRect=pU->aR; // fuer ObjName
- ImpJustifyRect(aRect);
- nStartWink=pU->nStart;
- nEndWink=pU->nEnd;
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- SetXPolyDirty();
-
- // #i103058# push current angle settings to ItemSet to
- // allow FullDrag visualisation
- if(rStat.GetPointAnz() >= 4)
+ bool bRet(false);
+ const sal_uInt32 nPntAnz(rStat.GetPointAnz());
+
+ if(SDRCREATE_FORCEEND == eCmd && nPntAnz < 4)
{
- ImpSetCircInfoToAttr();
+ meSdrCircleObjType = CircleType_Circle;
}
- return sal_True;
-}
+ if(CircleType_Circle == meSdrCircleObjType)
+ {
+ bRet = (nPntAnz >= 2);
-FASTBOOL SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
-{
- ImpSetCreateParams(rStat);
- ImpCircUser* pU=(ImpCircUser*)rStat.GetUser();
- FASTBOOL bRet=sal_False;
- if (eCmd==SDRCREATE_FORCEEND && rStat.GetPointAnz()<4) meCircleKind=OBJ_CIRC;
- if (meCircleKind==OBJ_CIRC) {
- bRet=rStat.GetPointAnz()>=2;
- if (bRet) {
- aRect=pU->aR;
- ImpJustifyRect(aRect);
- }
- } else {
- rStat.SetNoSnap(rStat.GetPointAnz()>=2);
- rStat.SetOrtho4Possible(rStat.GetPointAnz()<2);
- bRet=rStat.GetPointAnz()>=4;
- if (bRet) {
- aRect=pU->aR;
- ImpJustifyRect(aRect);
- nStartWink=pU->nStart;
- nEndWink=pU->nEnd;
+ if(bRet)
+ {
+ SdrRectObj::EndCreate(rStat, eCmd);
}
}
- bClosedObj=meCircleKind!=OBJ_CARC;
- SetRectsDirty();
- SetXPolyDirty();
- ImpSetCircInfoToAttr();
- if (bRet) {
- delete pU;
- rStat.SetUser(NULL);
+ else
+ {
+ rStat.SetNoSnap(nPntAnz >= 2);
+ rStat.SetOrtho4Possible(nPntAnz < 2);
+ bRet = (nPntAnz >= 4);
+
+ if(bRet)
+ {
+ double fNewStart(GetStartAngle());
+ double fNewEnd(GetEndAngle());
+
+ impCalcNewStartEnd(rStat, *this, fNewStart, fNewEnd);
+ SetStartAngle(fNewStart);
+ SetEndAngle(fNewEnd);
+ }
}
+
return bRet;
}
-void SdrCircObj::BrkCreate(SdrDragStat& rStat)
+bool SdrCircObj::BckCreate(SdrDragStat& rStat)
{
- ImpCircUser* pU=(ImpCircUser*)rStat.GetUser();
- delete pU;
- rStat.SetUser(NULL);
-}
+ const sal_uInt32 nPntAnz(rStat.GetPointAnz());
-FASTBOOL SdrCircObj::BckCreate(SdrDragStat& rStat)
-{
- rStat.SetNoSnap(rStat.GetPointAnz()>=3);
- rStat.SetOrtho4Possible(rStat.GetPointAnz()<3);
- return meCircleKind!=OBJ_CIRC;
+ rStat.SetNoSnap(nPntAnz >= 3);
+ rStat.SetOrtho4Possible(nPntAnz < 3);
+
+ return (CircleType_Circle != meSdrCircleObjType);
}
basegfx::B2DPolyPolygon SdrCircObj::TakeCreatePoly(const SdrDragStat& rDrag) const
{
- ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser();
+ const sal_uInt32 nPntAnz(rDrag.GetPointAnz());
- if(rDrag.GetPointAnz() < 4L)
+ if(nPntAnz < 4)
{
- // force to OBJ_CIRC to get full visualisation
- basegfx::B2DPolyPolygon aRetval(ImpCalcXPolyCirc(OBJ_CIRC, pU->aR, pU->nStart, pU->nEnd));
-
- if(3L == rDrag.GetPointAnz())
+ // force to CircleType_Circle to get full visualisation
+ basegfx::B2DPolyPolygon aRetval(
+ ImpCalcXPolyCirc(
+ CircleType_Circle,
+ getSdrObjectTransformation(),
+ 0.0,
+ 0.0));
+
+ if(3 == nPntAnz)
{
// add edge to first point on ellipse
basegfx::B2DPolygon aNew;
+ const basegfx::B2DPoint aStart(0.5 + (cos(GetStartAngle()) * 0.5), 0.5 + (sin(GetStartAngle()) * 0.5));
- aNew.append(basegfx::B2DPoint(pU->aCenter.X(), pU->aCenter.Y()));
- aNew.append(basegfx::B2DPoint(pU->aP1.X(), pU->aP1.Y()));
+ // add center and point at start angle as line
+ aNew.append(getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5));
+ aNew.append(getSdrObjectTransformation() * aStart);
aRetval.append(aNew);
}
@@ -791,150 +715,27 @@ basegfx::B2DPolyPolygon SdrCircObj::TakeCreatePoly(const SdrDragStat& rDrag) con
}
else
{
- return basegfx::B2DPolyPolygon(ImpCalcXPolyCirc(meCircleKind, pU->aR, pU->nStart, pU->nEnd));
+ return basegfx::B2DPolyPolygon(
+ ImpCalcXPolyCirc(
+ GetSdrCircleObjType(),
+ getSdrObjectTransformation(),
+ GetStartAngle(),
+ GetEndAngle()));
}
}
-Pointer SdrCircObj::GetCreatePointer() const
+Pointer SdrCircObj::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
- switch (meCircleKind) {
- case OBJ_CIRC: return Pointer(POINTER_DRAW_ELLIPSE);
- case OBJ_SECT: return Pointer(POINTER_DRAW_PIE);
- case OBJ_CARC: return Pointer(POINTER_DRAW_ARC);
- case OBJ_CCUT: return Pointer(POINTER_DRAW_CIRCLECUT);
+ switch (meSdrCircleObjType)
+ {
+ case CircleType_Circle: return Pointer(POINTER_DRAW_ELLIPSE);
+ case CircleType_Sector: return Pointer(POINTER_DRAW_PIE);
+ case CircleType_Arc: return Pointer(POINTER_DRAW_ARC);
+ case CircleType_Segment: return Pointer(POINTER_DRAW_CIRCLECUT);
default: break;
- } // switch
- return Pointer(POINTER_CROSS);
-}
-
-void SdrCircObj::NbcMove(const Size& aSiz)
-{
- MoveRect(aRect,aSiz);
- MoveRect(aOutRect,aSiz);
- MoveRect(maSnapRect,aSiz);
- SetXPolyDirty();
- SetRectsDirty(sal_True);
-}
-
-void SdrCircObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- long nWink0=aGeo.nDrehWink;
- FASTBOOL bNoShearRota=(aGeo.nDrehWink==0 && aGeo.nShearWink==0);
- SdrTextObj::NbcResize(rRef,xFact,yFact);
- bNoShearRota|=(aGeo.nDrehWink==0 && aGeo.nShearWink==0);
- if (meCircleKind!=OBJ_CIRC) {
- FASTBOOL bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
- FASTBOOL bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
- if (bXMirr || bYMirr) {
- // bei bXMirr!=bYMirr muessten eigentlich noch die beiden
- // Linienende vertauscht werden. Das ist jedoch mal wieder
- // schlecht (wg. zwangslaeufiger harter Formatierung).
- // Alternativ koennte ein bMirrored-Flag eingefuehrt werden
- // (Vielleicht ja mal grundsaetzlich, auch fuer gepiegelten Text, ...).
- long nS0=nStartWink;
- long nE0=nEndWink;
- if (bNoShearRota) {
- // Das RectObj spiegelt bei VMirror bereits durch durch 180deg Drehung.
- if (! (bXMirr && bYMirr)) {
- long nTmp=nS0;
- nS0=18000-nE0;
- nE0=18000-nTmp;
- }
- } else { // Spiegeln fuer verzerrte Ellipsen
- if (bXMirr!=bYMirr) {
- nS0+=nWink0;
- nE0+=nWink0;
- if (bXMirr) {
- long nTmp=nS0;
- nS0=18000-nE0;
- nE0=18000-nTmp;
- }
- if (bYMirr) {
- long nTmp=nS0;
- nS0=-nE0;
- nE0=-nTmp;
- }
- nS0-=aGeo.nDrehWink;
- nE0-=aGeo.nDrehWink;
- }
- }
- long nWinkDif=nE0-nS0;
- nStartWink=NormAngle360(nS0);
- nEndWink =NormAngle360(nE0);
- if (nWinkDif==36000) nEndWink+=nWinkDif; // Vollkreis
- }
}
- SetXPolyDirty();
- ImpSetCircInfoToAttr();
-}
-void SdrCircObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
-{
- SdrTextObj::NbcShear(rRef,nWink,tn,bVShear);
- SetXPolyDirty();
- ImpSetCircInfoToAttr();
-}
-
-void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2)
-{
- //long nWink0=aGeo.nDrehWink;
- FASTBOOL bFreeMirr=meCircleKind!=OBJ_CIRC;
- Point aTmpPt1;
- Point aTmpPt2;
- if (bFreeMirr) { // bei freier Spiegelachse einige Vorbereitungen Treffen
- Point aCenter(aRect.Center());
- long nWdt=aRect.GetWidth()-1;
- long nHgt=aRect.GetHeight()-1;
- long nMaxRad=((nWdt>nHgt ? nWdt : nHgt)+1) /2;
- double a;
- // Startpunkt
- a=nStartWink*nPi180;
- aTmpPt1=Point(Round(cos(a)*nMaxRad),-Round(sin(a)*nMaxRad));
- if (nWdt==0) aTmpPt1.X()=0;
- if (nHgt==0) aTmpPt1.Y()=0;
- aTmpPt1+=aCenter;
- // Endpunkt
- a=nEndWink*nPi180;
- aTmpPt2=Point(Round(cos(a)*nMaxRad),-Round(sin(a)*nMaxRad));
- if (nWdt==0) aTmpPt2.X()=0;
- if (nHgt==0) aTmpPt2.Y()=0;
- aTmpPt2+=aCenter;
- if (aGeo.nDrehWink!=0) {
- RotatePoint(aTmpPt1,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- RotatePoint(aTmpPt2,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- }
- if (aGeo.nShearWink!=0) {
- ShearPoint(aTmpPt1,aRect.TopLeft(),aGeo.nTan);
- ShearPoint(aTmpPt2,aRect.TopLeft(),aGeo.nTan);
- }
- }
- SdrTextObj::NbcMirror(rRef1,rRef2);
- if (meCircleKind!=OBJ_CIRC) { // Anpassung von Start- und Endwinkel
- MirrorPoint(aTmpPt1,rRef1,rRef2);
- MirrorPoint(aTmpPt2,rRef1,rRef2);
- // Unrotate:
- if (aGeo.nDrehWink!=0) {
- RotatePoint(aTmpPt1,aRect.TopLeft(),-aGeo.nSin,aGeo.nCos); // -sin fuer Umkehrung
- RotatePoint(aTmpPt2,aRect.TopLeft(),-aGeo.nSin,aGeo.nCos); // -sin fuer Umkehrung
- }
- // Unshear:
- if (aGeo.nShearWink!=0) {
- ShearPoint(aTmpPt1,aRect.TopLeft(),-aGeo.nTan); // -tan fuer Umkehrung
- ShearPoint(aTmpPt2,aRect.TopLeft(),-aGeo.nTan); // -tan fuer Umkehrung
- }
- Point aCenter(aRect.Center());
- aTmpPt1-=aCenter;
- aTmpPt2-=aCenter;
- // Weil gespiegelt sind die Winkel nun auch noch vertauscht
- nStartWink=GetAngle(aTmpPt2);
- nEndWink =GetAngle(aTmpPt1);
- long nWinkDif=nEndWink-nStartWink;
- nStartWink=NormAngle360(nStartWink);
- nEndWink =NormAngle360(nEndWink);
- if (nWinkDif==36000) nEndWink+=nWinkDif; // Vollkreis
- }
- SetXPolyDirty();
- ImpSetCircInfoToAttr();
+ return Pointer(POINTER_CROSS);
}
SdrObjGeoData* SdrCircObj::NewGeoData() const
@@ -945,217 +746,77 @@ SdrObjGeoData* SdrCircObj::NewGeoData() const
void SdrCircObj::SaveGeoData(SdrObjGeoData& rGeo) const
{
SdrRectObj::SaveGeoData(rGeo);
- SdrCircObjGeoData& rCGeo=(SdrCircObjGeoData&)rGeo;
- rCGeo.nStartWink=nStartWink;
- rCGeo.nEndWink =nEndWink;
-}
+ SdrCircObjGeoData* pCGeo = dynamic_cast< SdrCircObjGeoData* >(&rGeo);
-void SdrCircObj::RestGeoData(const SdrObjGeoData& rGeo)
-{
- SdrRectObj::RestGeoData(rGeo);
- SdrCircObjGeoData& rCGeo=(SdrCircObjGeoData&)rGeo;
- nStartWink=rCGeo.nStartWink;
- nEndWink =rCGeo.nEndWink;
- SetXPolyDirty();
- ImpSetCircInfoToAttr();
-}
-
-void Union(Rectangle& rR, const Point& rP)
-{
- if (rP.X()<rR.Left ()) rR.Left ()=rP.X();
- if (rP.X()>rR.Right ()) rR.Right ()=rP.X();
- if (rP.Y()<rR.Top ()) rR.Top ()=rP.Y();
- if (rP.Y()>rR.Bottom()) rR.Bottom()=rP.Y();
-}
-
-void SdrCircObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
-{
- rRect=aRect;
- if (meCircleKind!=OBJ_CIRC) {
- const Point aPntStart(GetWinkPnt(aRect,nStartWink));
- const Point aPntEnd(GetWinkPnt(aRect,nEndWink));
- long a=nStartWink;
- long e=nEndWink;
- rRect.Left ()=aRect.Right();
- rRect.Right ()=aRect.Left();
- rRect.Top ()=aRect.Bottom();
- rRect.Bottom()=aRect.Top();
- Union(rRect,aPntStart);
- Union(rRect,aPntEnd);
- if ((a<=18000 && e>=18000) || (a>e && (a<=18000 || e>=18000))) {
- Union(rRect,aRect.LeftCenter());
- }
- if ((a<=27000 && e>=27000) || (a>e && (a<=27000 || e>=27000))) {
- Union(rRect,aRect.BottomCenter());
- }
- if (a>e) {
- Union(rRect,aRect.RightCenter());
- }
- if ((a<=9000 && e>=9000) || (a>e && (a<=9000 || e>=9000))) {
- Union(rRect,aRect.TopCenter());
- }
- if (meCircleKind==OBJ_SECT) {
- Union(rRect,aRect.Center());
- }
- if (aGeo.nDrehWink!=0) {
- Point aDst(rRect.TopLeft());
- aDst-=aRect.TopLeft();
- Point aDst0(aDst);
- RotatePoint(aDst,Point(),aGeo.nSin,aGeo.nCos);
- aDst-=aDst0;
- rRect.Move(aDst.X(),aDst.Y());
- }
- }
- if (aGeo.nShearWink!=0) {
- long nDst=Round((rRect.Bottom()-rRect.Top())*aGeo.nTan);
- if (aGeo.nShearWink>0) {
- Point aRef(rRect.TopLeft());
- rRect.Left()-=nDst;
- Point aTmpPt(rRect.TopLeft());
- RotatePoint(aTmpPt,aRef,aGeo.nSin,aGeo.nCos);
- aTmpPt-=rRect.TopLeft();
- rRect.Move(aTmpPt.X(),aTmpPt.Y());
- } else {
- rRect.Right()-=nDst;
- }
+ if(pCGeo)
+ {
+ pCGeo->meSdrCircleObjType = GetSdrCircleObjType();
+ pCGeo->mfStartAngle = GetStartAngle();
+ pCGeo->mfEndAngle = GetEndAngle();
}
}
-void SdrCircObj::RecalcSnapRect()
+void SdrCircObj::RestGeoData(const SdrObjGeoData& rGeo)
{
- if (PaintNeedsXPolyCirc()) {
- maSnapRect=GetXPoly().GetBoundRect();
- } else {
- TakeUnrotatedSnapRect(maSnapRect);
- }
-}
+ SdrRectObj::RestGeoData(rGeo);
+ const SdrCircObjGeoData* pCGeo = dynamic_cast< const SdrCircObjGeoData* >(&rGeo);
-void SdrCircObj::NbcSetSnapRect(const Rectangle& rRect)
-{
- if (aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 || meCircleKind!=OBJ_CIRC) {
- Rectangle aSR0(GetSnapRect());
- long nWdt0=aSR0.Right()-aSR0.Left();
- long nHgt0=aSR0.Bottom()-aSR0.Top();
- long nWdt1=rRect.Right()-rRect.Left();
- long nHgt1=rRect.Bottom()-rRect.Top();
- NbcResize(maSnapRect.TopLeft(),Fraction(nWdt1,nWdt0),Fraction(nHgt1,nHgt0));
- NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top()));
- } else {
- aRect=rRect;
- ImpJustifyRect(aRect);
+ if(pCGeo)
+ {
+ SetSdrCircleObjType(pCGeo->meSdrCircleObjType);
+ SetStartAngle(pCGeo->mfStartAngle);
+ SetEndAngle(pCGeo->mfEndAngle);
}
- SetRectsDirty();
- SetXPolyDirty();
- ImpSetCircInfoToAttr();
}
sal_uInt32 SdrCircObj::GetSnapPointCount() const
{
- if (meCircleKind==OBJ_CIRC) {
- return 1L;
- } else {
- return 3L;
- }
-}
-
-Point SdrCircObj::GetSnapPoint(sal_uInt32 i) const
-{
- switch (i) {
- case 1 : return GetWinkPnt(aRect,nStartWink);
- case 2 : return GetWinkPnt(aRect,nEndWink);
- default: return aRect.Center();
+ if(CircleType_Circle == meSdrCircleObjType)
+ {
+ return 1;
}
-}
-
-void __EXPORT SdrCircObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
-{
- SetXPolyDirty();
- SdrRectObj::Notify(rBC,rHint);
- ImpSetAttrToCircInfo();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrCircObj::ImpSetAttrToCircInfo()
-{
- const SfxItemSet& rSet = GetObjectItemSet();
- SdrCircKind eNewKindA = ((SdrCircKindItem&)rSet.Get(SDRATTR_CIRCKIND)).GetValue();
- SdrObjKind eNewKind = meCircleKind;
-
- if(eNewKindA == SDRCIRC_FULL)
- eNewKind = OBJ_CIRC;
- else if(eNewKindA == SDRCIRC_SECT)
- eNewKind = OBJ_SECT;
- else if(eNewKindA == SDRCIRC_ARC)
- eNewKind = OBJ_CARC;
- else if(eNewKindA == SDRCIRC_CUT)
- eNewKind = OBJ_CCUT;
-
- sal_Int32 nNewStart = ((SdrCircStartAngleItem&)rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue();
- sal_Int32 nNewEnd = ((SdrCircEndAngleItem&)rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue();
-
- sal_Bool bKindChg = meCircleKind != eNewKind;
- sal_Bool bWinkChg = nNewStart != nStartWink || nNewEnd != nEndWink;
-
- if(bKindChg || bWinkChg)
+ else
{
- meCircleKind = eNewKind;
- nStartWink = nNewStart;
- nEndWink = nNewEnd;
-
- if(bKindChg || (meCircleKind != OBJ_CIRC && bWinkChg))
- {
- SetXPolyDirty();
- SetRectsDirty();
- }
+ return 3;
}
}
-void SdrCircObj::ImpSetCircInfoToAttr()
+basegfx::B2DPoint SdrCircObj::GetSnapPoint(sal_uInt32 i) const
{
- SdrCircKind eNewKindA = SDRCIRC_FULL;
- const SfxItemSet& rSet = GetObjectItemSet();
-
- if(meCircleKind == OBJ_SECT)
- eNewKindA = SDRCIRC_SECT;
- else if(meCircleKind == OBJ_CARC)
- eNewKindA = SDRCIRC_ARC;
- else if(meCircleKind == OBJ_CCUT)
- eNewKindA = SDRCIRC_CUT;
-
- SdrCircKind eOldKindA = ((SdrCircKindItem&)rSet.Get(SDRATTR_CIRCKIND)).GetValue();
- sal_Int32 nOldStartWink = ((SdrCircStartAngleItem&)rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue();
- sal_Int32 nOldEndWink = ((SdrCircEndAngleItem&)rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue();
+ basegfx::B2DPoint aNormalized(0.5, 0.5);
- if(eNewKindA != eOldKindA || nStartWink != nOldStartWink || nEndWink != nOldEndWink)
+ switch(i)
{
- // #81921# since SetItem() implicitly calls ImpSetAttrToCircInfo()
- // setting the item directly is necessary here.
- if(eNewKindA != eOldKindA)
+ case 1:
{
- GetProperties().SetObjectItemDirect(SdrCircKindItem(eNewKindA));
+ aNormalized = basegfx::B2DPoint(0.5 + (cos(GetStartAngle()) * 0.5), 0.5 + (sin(GetStartAngle()) * 0.5));
+ break;
}
-
- if(nStartWink != nOldStartWink)
+ case 2:
{
- GetProperties().SetObjectItemDirect(SdrCircStartAngleItem(nStartWink));
+ aNormalized = basegfx::B2DPoint(0.5 + (cos(GetEndAngle()) * 0.5), 0.5 + (sin(GetEndAngle()) * 0.5));
+ break;
}
-
- if(nEndWink != nOldEndWink)
+ default:
{
- GetProperties().SetObjectItemDirect(SdrCircEndAngleItem(nEndWink));
+ // center requested; already in aNormalized
+ break;
}
-
- SetXPolyDirty();
- ImpSetAttrToCircInfo();
}
+
+ return getSdrObjectTransformation() * aNormalized;
}
-SdrObject* SdrCircObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+SdrObject* SdrCircObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
- const sal_Bool bFill(OBJ_CARC == meCircleKind ? sal_False : sal_True);
- const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartWink, nEndWink));
- SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bFill, bBezier);
+ const bool bCanBeFilled(CircleType_Arc != meSdrCircleObjType);
+ const basegfx::B2DPolygon aCircPolygon(
+ ImpCalcXPolyCirc(
+ GetSdrCircleObjType(),
+ getSdrObjectTransformation(),
+ GetStartAngle(),
+ GetEndAngle()));
+ SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bCanBeFilled, bBezier);
if(bAddText)
{
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 0f05b5fe89ac..1aca3e6a2e1f 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -44,13 +44,14 @@
#include <svl/style.hxx>
#include <svl/smplhint.hxx>
#include <editeng/eeitem.hxx>
-#include "svdoimp.hxx"
#include <svx/sdr/properties/connectorproperties.hxx>
#include <svx/sdr/contact/viewcontactofsdredgeobj.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/svdlegacy.hxx>
#include <svx/sdrhittesthelper.hxx>
+#include <svx/svdobj.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -60,50 +61,56 @@ SdrObjConnection::~SdrObjConnection()
void SdrObjConnection::ResetVars()
{
- pObj=NULL;
- nConId=0;
- nXDist=0;
- nYDist=0;
- bBestConn=sal_True;
- bBestVertex=sal_True;
- bXDistOvr=sal_False;
- bYDistOvr=sal_False;
- bAutoVertex=sal_False;
- bAutoCorner=sal_False;
-}
-
-FASTBOOL SdrObjConnection::TakeGluePoint(SdrGluePoint& rGP, FASTBOOL bSetAbsPos) const
-{
- FASTBOOL bRet=sal_False;
- if (pObj!=NULL) { // Ein Obj muss schon angedockt sein!
- if (bAutoVertex) {
- rGP=pObj->GetVertexGluePoint(nConId);
- bRet=sal_True;
- } else if (bAutoCorner) {
- rGP=pObj->GetCornerGluePoint(nConId);
- bRet=sal_True;
- } else {
- const SdrGluePointList* pGPL=pObj->GetGluePointList();
- if (pGPL!=NULL) {
- sal_uInt16 nNum=pGPL->FindGluePoint(nConId);
- if (nNum!=SDRGLUEPOINT_NOTFOUND) {
+ mpConnectedSdrObject = 0;
+ mnConnectorId = 0;
+ mbBestConnection = true;
+ mbBestVertex = true;
+ mbAutoVertex = false;
+}
+
+bool SdrObjConnection::TakeGluePoint(SdrGluePoint& rGP, bool bSetAbsPos) const
+{
+ bool bRet=false;
+
+ if(mpConnectedSdrObject)
+ {
+ // Ein Obj muss schon angedockt sein!
+ if(mbAutoVertex)
+ {
+ rGP = mpConnectedSdrObject->GetVertexGluePoint(mnConnectorId);
+ bRet = true;
+ }
+ else
+ {
+ const SdrGluePointList* pGPL = mpConnectedSdrObject->GetGluePointList();
+
+ if(pGPL)
+ {
+ const sal_uInt32 nNum(pGPL->FindGluePoint(mnConnectorId));
+
+ if(SDRGLUEPOINT_NOTFOUND != nNum)
+ {
rGP=(*pGPL)[nNum];
- bRet=sal_True;
+ bRet = true;
}
}
}
}
- if (bRet && bSetAbsPos) {
- Point aPt(rGP.GetAbsolutePos(*pObj));
- aPt+=aObjOfs;
- rGP.SetPos(aPt);
+
+ if(bRet && bSetAbsPos)
+ {
+ const basegfx::B2DPoint aPt(rGP.GetAbsolutePos(sdr::legacy::GetSnapRange(*mpConnectedSdrObject)));
+
+ rGP.SetPos(aPt + maObjOfs);
}
+
return bRet;
}
-Point& SdrEdgeInfoRec::ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode)
+basegfx::B2DPoint& SdrEdgeInfoRec::ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode)
{
- switch (eLineCode) {
+ switch (eLineCode)
+ {
case OBJ1LINE2 : return aObj1Line2;
case OBJ1LINE3 : return aObj1Line3;
case OBJ2LINE2 : return aObj2Line2;
@@ -113,42 +120,64 @@ Point& SdrEdgeInfoRec::ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode)
return aMiddleLine;
}
-sal_uInt16 SdrEdgeInfoRec::ImpGetPolyIdx(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const
+sal_uInt16 SdrEdgeInfoRec::ImpGetPolyIdx(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount) const
{
- switch (eLineCode) {
+ switch (eLineCode)
+ {
case OBJ1LINE2 : return 1;
case OBJ1LINE3 : return 2;
- case OBJ2LINE2 : return rXP.GetPointCount()-3;
- case OBJ2LINE3 : return rXP.GetPointCount()-4;
+ case OBJ2LINE2 : return nPointCount - 3;
+ case OBJ2LINE3 : return nPointCount - 4;
case MIDDLELINE: return nMiddleLine;
} // switch
return 0;
}
-FASTBOOL SdrEdgeInfoRec::ImpIsHorzLine(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const
+bool SdrEdgeInfoRec::ImpIsHorzLine(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount) const
{
- sal_uInt16 nIdx=ImpGetPolyIdx(eLineCode,rXP);
- FASTBOOL bHorz=nAngle1==0 || nAngle1==18000;
- if (eLineCode==OBJ2LINE2 || eLineCode==OBJ2LINE3) {
- nIdx=rXP.GetPointCount()-nIdx; // #36314#
- bHorz=nAngle2==0 || nAngle2==18000; // #52000#
+ sal_uInt16 nIdx(ImpGetPolyIdx(eLineCode, nPointCount));
+ bool bHorz(0 == nAngle1 || 18000 == nAngle1);
+
+ if(OBJ2LINE2 == eLineCode || OBJ2LINE3 == eLineCode)
+ {
+ nIdx = nPointCount - nIdx;
+ bHorz = (0 == nAngle2 || 18000 == nAngle2);
+ }
+
+ if(1 == (nIdx & 1))
+ {
+ bHorz = !bHorz;
}
- if ((nIdx & 1)==1) bHorz=!bHorz;
+
return bHorz;
}
-void SdrEdgeInfoRec::ImpSetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP, long nVal)
+void SdrEdgeInfoRec::ImpSetLineVersatz(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount, long nVal)
{
- Point& rPt=ImpGetLineVersatzPoint(eLineCode);
- if (ImpIsHorzLine(eLineCode,rXP)) rPt.Y()=nVal;
- else rPt.X()=nVal;
+ basegfx::B2DPoint& rPt=ImpGetLineVersatzPoint(eLineCode);
+
+ if(ImpIsHorzLine(eLineCode, nPointCount))
+ {
+ rPt.setY(nVal);
+ }
+ else
+ {
+ rPt.setX(nVal);
+ }
}
-long SdrEdgeInfoRec::ImpGetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const
+long SdrEdgeInfoRec::ImpGetLineVersatz(SdrEdgeLineCode eLineCode, sal_uInt32 nPointCount) const
{
- const Point& rPt=ImpGetLineVersatzPoint(eLineCode);
- if (ImpIsHorzLine(eLineCode,rXP)) return rPt.Y();
- else return rPt.X();
+ const basegfx::B2DPoint& rPt = ImpGetLineVersatzPoint(eLineCode);
+
+ if(ImpIsHorzLine(eLineCode, nPointCount))
+ {
+ return rPt.getY();
+ }
+ else
+ {
+ return rPt.getX();
+ }
}
//////////////////////////////////////////////////////////////////////////////
@@ -169,29 +198,72 @@ sdr::contact::ViewContact* SdrEdgeObj::CreateObjectSpecificViewContact()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrEdgeObj,SdrTextObj);
+SdrEdgeObj::SdrEdgeObj(SdrModel& rSdrModel)
+: SdrTextObj(rSdrModel),
+ maCon1(),
+ maCon2(),
+ maEdgeTrack(),
+ maEdgeInfo(),
+ mbEdgeTrackDirty(false),
+ mbEdgeTrackUserDefined(false),
+ mbSuppressDefaultConnect(false)
+{
+ // default connector
+ maEdgeTrack.append(basegfx::B2DPoint(0.0, 0.0));
+ maEdgeTrack.append(basegfx::B2DPoint(0.0, 100.0));
+}
+
+SdrEdgeObj::~SdrEdgeObj()
+{
+ DisconnectFromNode(true);
+ DisconnectFromNode(false);
+}
-SdrEdgeObj::SdrEdgeObj()
-: SdrTextObj(),
- nNotifyingCount(0),
- bEdgeTrackDirty(sal_False),
- bEdgeTrackUserDefined(sal_False),
- // #109007# Default is to allow default connects
- mbSuppressDefaultConnect(sal_False),
- // #110649#
- mbBoundRectCalculationRunning(sal_False)
+void SdrEdgeObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- bClosedObj=sal_False;
- bIsEdge=sal_True;
- pEdgeTrack=new XPolygon;
+ if(this != &rSource)
+ {
+ const SdrEdgeObj* pSource = dynamic_cast< const SdrEdgeObj* >(&rSource);
+ if(pSource)
+ {
+ // call parent
+ SdrTextObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ maEdgeTrack = pSource->maEdgeTrack;
+ mbEdgeTrackDirty = pSource->mbEdgeTrackDirty;
+ maCon1 = pSource->maCon1;
+ maCon2 = pSource->maCon2;
+ maCon1.mpConnectedSdrObject = 0;
+ maCon2.mpConnectedSdrObject = 0;
+ maEdgeInfo = pSource->maEdgeInfo;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
}
-SdrEdgeObj::~SdrEdgeObj()
+SdrObject* SdrEdgeObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SdrEdgeObj* pClone = new SdrEdgeObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+bool SdrEdgeObj::IsClosedObj() const
{
- DisconnectFromNode(sal_True);
- DisconnectFromNode(sal_False);
- delete pEdgeTrack;
+ return false;
+}
+
+bool SdrEdgeObj::IsSdrEdgeObj() const
+{
+ return true;
}
void SdrEdgeObj::ImpSetAttrToEdgeInfo()
@@ -207,57 +279,57 @@ void SdrEdgeObj::ImpSetAttrToEdgeInfo()
sal_Int32 nVals[3] = { nVal1, nVal2, nVal3 };
sal_uInt16 n = 0;
- if(aEdgeInfo.nObj1Lines >= 2 && n < 3)
+ if(maEdgeInfo.nObj1Lines >= 2 && n < 3)
{
- aEdgeInfo.ImpSetLineVersatz(OBJ1LINE2, *pEdgeTrack, nVals[n]);
+ maEdgeInfo.ImpSetLineVersatz(OBJ1LINE2, maEdgeTrack.count(), nVals[n]);
n++;
}
- if(aEdgeInfo.nObj1Lines >= 3 && n < 3)
+ if(maEdgeInfo.nObj1Lines >= 3 && n < 3)
{
- aEdgeInfo.ImpSetLineVersatz(OBJ1LINE3, *pEdgeTrack, nVals[n]);
+ maEdgeInfo.ImpSetLineVersatz(OBJ1LINE3, maEdgeTrack.count(), nVals[n]);
n++;
}
- if(aEdgeInfo.nMiddleLine != 0xFFFF && n < 3)
+ if(maEdgeInfo.nMiddleLine != 0xFFFF && n < 3)
{
- aEdgeInfo.ImpSetLineVersatz(MIDDLELINE, *pEdgeTrack, nVals[n]);
+ maEdgeInfo.ImpSetLineVersatz(MIDDLELINE, maEdgeTrack.count(), nVals[n]);
n++;
}
- if(aEdgeInfo.nObj2Lines >= 3 && n < 3)
+ if(maEdgeInfo.nObj2Lines >= 3 && n < 3)
{
- aEdgeInfo.ImpSetLineVersatz(OBJ2LINE3, *pEdgeTrack, nVals[n]);
+ maEdgeInfo.ImpSetLineVersatz(OBJ2LINE3, maEdgeTrack.count(), nVals[n]);
n++;
}
- if(aEdgeInfo.nObj2Lines >= 2 && n < 3)
+ if(maEdgeInfo.nObj2Lines >= 2 && n < 3)
{
- aEdgeInfo.ImpSetLineVersatz(OBJ2LINE2, *pEdgeTrack, nVals[n]);
+ maEdgeInfo.ImpSetLineVersatz(OBJ2LINE2, maEdgeTrack.count(), nVals[n]);
n++;
}
}
else if(eKind == SDREDGE_THREELINES)
{
- sal_Bool bHor1 = aEdgeInfo.nAngle1 == 0 || aEdgeInfo.nAngle1 == 18000;
- sal_Bool bHor2 = aEdgeInfo.nAngle2 == 0 || aEdgeInfo.nAngle2 == 18000;
+ bool bHor1 = maEdgeInfo.nAngle1 == 0 || maEdgeInfo.nAngle1 == 18000;
+ bool bHor2 = maEdgeInfo.nAngle2 == 0 || maEdgeInfo.nAngle2 == 18000;
if(bHor1)
{
- aEdgeInfo.aObj1Line2.X() = nVal1;
+ maEdgeInfo.aObj1Line2.setX(nVal1);
}
else
{
- aEdgeInfo.aObj1Line2.Y() = nVal1;
+ maEdgeInfo.aObj1Line2.setY(nVal1);
}
if(bHor2)
{
- aEdgeInfo.aObj2Line2.X() = nVal2;
+ maEdgeInfo.aObj2Line2.setX(nVal2);
}
else
{
- aEdgeInfo.aObj2Line2.Y() = nVal2;
+ maEdgeInfo.aObj2Line2.setY(nVal2);
}
}
@@ -269,7 +341,7 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
{
const SfxItemSet& rSet = GetObjectItemSet();
SdrEdgeKind eKind = ((SdrEdgeKindItem&)(rSet.Get(SDRATTR_EDGEKIND))).GetValue();
- sal_Int32 nValAnz = ((SdrEdgeLineDeltaAnzItem&)rSet.Get(SDRATTR_EDGELINEDELTAANZ)).GetValue();
+ sal_Int32 nValAnz = ((SfxUInt16Item&)rSet.Get(SDRATTR_EDGELINEDELTAANZ)).GetValue();
sal_Int32 nVal1 = ((SdrEdgeLine1DeltaItem&)rSet.Get(SDRATTR_EDGELINE1DELTA)).GetValue();
sal_Int32 nVal2 = ((SdrEdgeLine2DeltaItem&)rSet.Get(SDRATTR_EDGELINE2DELTA)).GetValue();
sal_Int32 nVal3 = ((SdrEdgeLine3DeltaItem&)rSet.Get(SDRATTR_EDGELINE3DELTA)).GetValue();
@@ -278,44 +350,44 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
if(eKind == SDREDGE_ORTHOLINES || eKind == SDREDGE_BEZIER)
{
- if(aEdgeInfo.nObj1Lines >= 2 && n < 3)
+ if(maEdgeInfo.nObj1Lines >= 2 && n < 3)
{
- nVals[n] = aEdgeInfo.ImpGetLineVersatz(OBJ1LINE2, *pEdgeTrack);
+ nVals[n] = maEdgeInfo.ImpGetLineVersatz(OBJ1LINE2, maEdgeTrack.count());
n++;
}
- if(aEdgeInfo.nObj1Lines >= 3 && n < 3)
+ if(maEdgeInfo.nObj1Lines >= 3 && n < 3)
{
- nVals[n] = aEdgeInfo.ImpGetLineVersatz(OBJ1LINE3, *pEdgeTrack);
+ nVals[n] = maEdgeInfo.ImpGetLineVersatz(OBJ1LINE3, maEdgeTrack.count());
n++;
}
- if(aEdgeInfo.nMiddleLine != 0xFFFF && n < 3)
+ if(maEdgeInfo.nMiddleLine != 0xFFFF && n < 3)
{
- nVals[n] = aEdgeInfo.ImpGetLineVersatz(MIDDLELINE, *pEdgeTrack);
+ nVals[n] = maEdgeInfo.ImpGetLineVersatz(MIDDLELINE, maEdgeTrack.count());
n++;
}
- if(aEdgeInfo.nObj2Lines >= 3 && n < 3)
+ if(maEdgeInfo.nObj2Lines >= 3 && n < 3)
{
- nVals[n] = aEdgeInfo.ImpGetLineVersatz(OBJ2LINE3, *pEdgeTrack);
+ nVals[n] = maEdgeInfo.ImpGetLineVersatz(OBJ2LINE3, maEdgeTrack.count());
n++;
}
- if(aEdgeInfo.nObj2Lines >= 2 && n < 3)
+ if(maEdgeInfo.nObj2Lines >= 2 && n < 3)
{
- nVals[n] = aEdgeInfo.ImpGetLineVersatz(OBJ2LINE2, *pEdgeTrack);
+ nVals[n] = maEdgeInfo.ImpGetLineVersatz(OBJ2LINE2, maEdgeTrack.count());
n++;
}
}
else if(eKind == SDREDGE_THREELINES)
{
- sal_Bool bHor1 = aEdgeInfo.nAngle1 == 0 || aEdgeInfo.nAngle1 == 18000;
- sal_Bool bHor2 = aEdgeInfo.nAngle2 == 0 || aEdgeInfo.nAngle2 == 18000;
+ bool bHor1 = maEdgeInfo.nAngle1 == 0 || maEdgeInfo.nAngle1 == 18000;
+ bool bHor2 = maEdgeInfo.nAngle2 == 0 || maEdgeInfo.nAngle2 == 18000;
n = 2;
- nVals[0] = bHor1 ? aEdgeInfo.aObj1Line2.X() : aEdgeInfo.aObj1Line2.Y();
- nVals[1] = bHor2 ? aEdgeInfo.aObj2Line2.X() : aEdgeInfo.aObj2Line2.Y();
+ nVals[0] = bHor1 ? maEdgeInfo.aObj1Line2.getX() : maEdgeInfo.aObj1Line2.getY();
+ nVals[1] = bHor2 ? maEdgeInfo.aObj2Line2.getX() : maEdgeInfo.aObj2Line2.getY();
}
if(n != nValAnz || nVals[0] != nVal1 || nVals[1] != nVal2 || nVals[2] != nVal3)
@@ -323,7 +395,7 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
// #75371# Here no more notifying is necessary, just local changes are OK.
if(n != nValAnz)
{
- GetProperties().SetObjectItemDirect(SdrEdgeLineDeltaAnzItem(n));
+ GetProperties().SetObjectItemDirect(SfxUInt16Item(SDRATTR_EDGELINEDELTAANZ, n));
}
if(nVals[0] != nVal1)
@@ -361,19 +433,19 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
void SdrEdgeObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
// #54102# allow rotation, mirror and shear
- rInfo.bRotateFreeAllowed = true;
- rInfo.bRotate90Allowed = true;
- rInfo.bMirrorFreeAllowed = true;
- rInfo.bMirror45Allowed = true;
- rInfo.bMirror90Allowed = true;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed = true;
- rInfo.bEdgeRadiusAllowed = sal_False;
- FASTBOOL bCanConv=!HasText() || ImpCanConvTextToCurve();
- rInfo.bCanConvToPath=bCanConv;
- rInfo.bCanConvToPoly=bCanConv;
- rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
+ rInfo.mbRotateFreeAllowed = true;
+ rInfo.mbRotate90Allowed = true;
+ rInfo.mbMirrorFreeAllowed = true;
+ rInfo.mbMirror45Allowed = true;
+ rInfo.mbMirror90Allowed = true;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = true;
+ rInfo.mbEdgeRadiusAllowed = false;
+ const bool bCanConv(!HasText() || ImpCanConvTextToCurve());
+ rInfo.mbCanConvToPath = bCanConv;
+ rInfo.mbCanConvToPoly = bCanConv;
+ rInfo.mbCanConvToContour = (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
sal_uInt16 SdrEdgeObj::GetObjIdentifier() const
@@ -381,72 +453,41 @@ sal_uInt16 SdrEdgeObj::GetObjIdentifier() const
return sal_uInt16(OBJ_EDGE);
}
-const Rectangle& SdrEdgeObj::GetCurrentBoundRect() const
-{
- if(bEdgeTrackDirty)
- {
- ((SdrEdgeObj*)this)->ImpRecalcEdgeTrack();
- }
-
- return SdrTextObj::GetCurrentBoundRect();
-}
-
-const Rectangle& SdrEdgeObj::GetSnapRect() const
-{
- if(bEdgeTrackDirty)
- {
- ((SdrEdgeObj*)this)->ImpRecalcEdgeTrack();
- }
-
- return SdrTextObj::GetSnapRect();
-}
-
-void SdrEdgeObj::RecalcSnapRect()
-{
- maSnapRect=pEdgeTrack->GetBoundRect();
-}
-
-void SdrEdgeObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
+SdrGluePoint SdrEdgeObj::GetVertexGluePoint(sal_uInt32 nNum) const
{
- rRect=GetSnapRect();
-}
-
-FASTBOOL SdrEdgeObj::IsNode() const
-{
- return sal_True;
-}
+ basegfx::B2DPoint aPoint(0.0, 0.0);
+ const sal_uInt32 nPntAnz(maEdgeTrack.count());
+ basegfx::B2DPoint aOldPoint;
-SdrGluePoint SdrEdgeObj::GetVertexGluePoint(sal_uInt16 nNum) const
-{
- Point aPt;
- sal_uInt16 nPntAnz=pEdgeTrack->GetPointCount();
- if (nPntAnz>0)
+ if(nPntAnz)
{
- Point aOfs = GetSnapRect().Center();
- if (nNum==2 && GetConnectedNode(sal_True)==NULL) aPt=(*pEdgeTrack)[0];
- else if (nNum==3 && GetConnectedNode(sal_False)==NULL) aPt=(*pEdgeTrack)[nPntAnz-1];
- else {
- if ((nPntAnz & 1) ==1) {
- aPt=(*pEdgeTrack)[nPntAnz/2];
- } else {
- Point aPt1((*pEdgeTrack)[nPntAnz/2-1]);
- Point aPt2((*pEdgeTrack)[nPntAnz/2]);
- aPt1+=aPt2;
- aPt1.X()/=2;
- aPt1.Y()/=2;
- aPt=aPt1;
+ if(2 == nNum && !GetConnectedNode(true))
+ {
+ aOldPoint = maEdgeTrack.getB2DPoint(0);
+ }
+ else if(3 == nNum && !GetConnectedNode(false))
+ {
+ aOldPoint = maEdgeTrack.getB2DPoint(nPntAnz - 1);
+ }
+ else
+ {
+ if(1 == (nPntAnz & 1))
+ {
+ aOldPoint = maEdgeTrack.getB2DPoint(nPntAnz / 2);
+ }
+ else
+ {
+ aOldPoint = (maEdgeTrack.getB2DPoint((nPntAnz/2) - 1) + maEdgeTrack.getB2DPoint(nPntAnz/2)) * 0.5;
}
}
- aPt-=aOfs;
+
+ aOldPoint -= sdr::legacy::GetSnapRange(*this).getCenter();
}
- SdrGluePoint aGP(aPt);
- aGP.SetPercent(sal_False);
- return aGP;
-}
-SdrGluePoint SdrEdgeObj::GetCornerGluePoint(sal_uInt16 nNum) const
-{
- return GetVertexGluePoint(nNum);
+ SdrGluePoint aGP(aOldPoint);
+ aGP.SetPercent(false);
+
+ return aGP;
}
const SdrGluePointList* SdrEdgeObj::GetGluePointList() const
@@ -459,161 +500,190 @@ SdrGluePointList* SdrEdgeObj::ForceGluePointList()
return NULL; // Keine benutzerdefinierten Klebepunkte fuer Verbinder #31671#
}
-FASTBOOL SdrEdgeObj::IsEdge() const
-{
- return sal_True;
-}
-
-void SdrEdgeObj::ConnectToNode(FASTBOOL bTail1, SdrObject* pObj)
+void SdrEdgeObj::ConnectToNode(bool bTail1, SdrObject* pObj)
{
SdrObjConnection& rCon=GetConnection(bTail1);
DisconnectFromNode(bTail1);
- if (pObj!=NULL) {
- pObj->AddListener(*this);
- rCon.pObj=pObj;
+
+ if(pObj)
+ {
+ StartListening(*pObj);
+ rCon.mpConnectedSdrObject = pObj;
// #120437# If connection is set, reset bEdgeTrackUserDefined
- bEdgeTrackUserDefined = false;
+ mbEdgeTrackUserDefined = false;
ImpDirtyEdgeTrack();
}
}
-void SdrEdgeObj::DisconnectFromNode(FASTBOOL bTail1)
+void SdrEdgeObj::DisconnectFromNode(bool bTail1)
{
SdrObjConnection& rCon=GetConnection(bTail1);
- if (rCon.pObj!=NULL) {
- rCon.pObj->RemoveListener(*this);
- rCon.pObj=NULL;
+
+ if(rCon.mpConnectedSdrObject)
+ {
+ EndListening(*rCon.mpConnectedSdrObject);
+ rCon.mpConnectedSdrObject = 0;
}
}
-SdrObject* SdrEdgeObj::GetConnectedNode(FASTBOOL bTail1) const
+SdrObject* SdrEdgeObj::GetConnectedNode(bool bTail1) const
{
- SdrObject* pObj=GetConnection(bTail1).pObj;
- if (pObj!=NULL && (pObj->GetPage()!=pPage || !pObj->IsInserted())) pObj=NULL;
+ SdrObject* pObj = GetConnection(bTail1).mpConnectedSdrObject;
+
+ if(pObj && (pObj->getSdrPageFromSdrObject() != getSdrPageFromSdrObject() || !pObj->IsObjectInserted()))
+ {
+ pObj = 0;
+ }
+
return pObj;
}
-FASTBOOL SdrEdgeObj::CheckNodeConnection(FASTBOOL bTail1) const
-{
- FASTBOOL bRet=sal_False;
- const SdrObjConnection& rCon=GetConnection(bTail1);
- sal_uInt16 nPtAnz=pEdgeTrack->GetPointCount();
- if (rCon.pObj!=NULL && rCon.pObj->GetPage()==pPage && nPtAnz!=0) {
- const SdrGluePointList* pGPL=rCon.pObj->GetGluePointList();
- sal_uInt16 nConAnz=pGPL==NULL ? 0 : pGPL->GetCount();
- sal_uInt16 nGesAnz=nConAnz+8;
- Point aTail(bTail1 ? (*pEdgeTrack)[0] : (*pEdgeTrack)[sal_uInt16(nPtAnz-1)]);
- for (sal_uInt16 i=0; i<nGesAnz && !bRet; i++) {
- if (i<nConAnz) { // UserDefined
- bRet=aTail==(*pGPL)[i].GetAbsolutePos(*rCon.pObj);
- } else if (i<nConAnz+4) { // Vertex
- SdrGluePoint aPt(rCon.pObj->GetVertexGluePoint(i-nConAnz));
- bRet=aTail==aPt.GetAbsolutePos(*rCon.pObj);
- } else { // Corner
- SdrGluePoint aPt(rCon.pObj->GetCornerGluePoint(i-nConAnz-4));
- bRet=aTail==aPt.GetAbsolutePos(*rCon.pObj);
+bool SdrEdgeObj::CheckNodeConnection(bool bTail1) const
+{
+ bool bRet(false);
+ const SdrObjConnection& rCon = GetConnection(bTail1);
+ const sal_uInt32 nPtAnz(maEdgeTrack.count());
+
+ if(rCon.mpConnectedSdrObject && rCon.mpConnectedSdrObject->getSdrPageFromSdrObject() == getSdrPageFromSdrObject() && nPtAnz)
+ {
+ const SdrGluePointList* pGPL = rCon.mpConnectedSdrObject->GetGluePointList();
+ const sal_uInt32 nConAnz(pGPL ? pGPL->GetCount() : 0);
+ const sal_uInt32 nGesAnz(nConAnz + 4);
+ const basegfx::B2DPoint aTail(bTail1 ? maEdgeTrack.getB2DPoint(0) : maEdgeTrack.getB2DPoint(nPtAnz - 1));
+
+ for(sal_uInt32 i(0); i < nGesAnz && !bRet; i++)
+ {
+ if(i < nConAnz)
+ {
+ // UserDefined
+ const basegfx::B2DPoint aGluePos((*pGPL)[i].GetAbsolutePos(sdr::legacy::GetSnapRange(*rCon.mpConnectedSdrObject)));
+
+ bRet = (aTail == aGluePos);
+ }
+ else //if (i<nConAnz+4)
+ {
+ // Vertex
+ const SdrGluePoint aPt(rCon.mpConnectedSdrObject->GetVertexGluePoint(i - nConAnz));
+ const basegfx::B2DPoint aGluePos(aPt.GetAbsolutePos(sdr::legacy::GetSnapRange(*rCon.mpConnectedSdrObject)));
+
+ bRet = (aTail == aGluePos);
}
}
}
+
return bRet;
}
-void SdrEdgeObj::ImpSetTailPoint(FASTBOOL bTail1, const Point& rPt)
+void SdrEdgeObj::ImpSetTailPoint(bool bTail1, const basegfx::B2DPoint& rPt)
{
- sal_uInt16 nPtAnz=pEdgeTrack->GetPointCount();
- if (nPtAnz==0) {
- (*pEdgeTrack)[0]=rPt;
- (*pEdgeTrack)[1]=rPt;
- } else if (nPtAnz==1) {
- if (!bTail1) (*pEdgeTrack)[1]=rPt;
- else { (*pEdgeTrack)[1]=(*pEdgeTrack)[0]; (*pEdgeTrack)[0]=rPt; }
- } else {
- if (!bTail1) (*pEdgeTrack)[sal_uInt16(nPtAnz-1)]=rPt;
- else (*pEdgeTrack)[0]=rPt;
+ const sal_uInt32 nPtAnz(maEdgeTrack.count());
+
+ if(nPtAnz)
+ {
+ if(!bTail1)
+ {
+ maEdgeTrack.setB2DPoint(nPtAnz - 1, rPt);
+ }
+ else
+ {
+ maEdgeTrack.setB2DPoint(0, rPt);
+ }
+
+ ImpRecalcEdgeTrack();
+ ActionChanged/*formallyinvalidateobjectrange*/();
}
- ImpRecalcEdgeTrack();
- SetRectsDirty();
}
void SdrEdgeObj::ImpDirtyEdgeTrack()
{
- if ( !bEdgeTrackUserDefined || !(GetModel() && GetModel()->isLocked()) )
- bEdgeTrackDirty = sal_True;
+ if ( !mbEdgeTrackUserDefined )
+ {
+ mbEdgeTrackDirty = true;
+ }
+ else
+ {
+ if ( !(getSdrModelFromSdrObject().isLocked()) )
+ {
+ mbEdgeTrackDirty = true;
+ }
+ }
}
void SdrEdgeObj::ImpUndirtyEdgeTrack()
{
- if (bEdgeTrackDirty && (GetModel() && GetModel()->isLocked()) ) {
- ImpRecalcEdgeTrack();
+ if (mbEdgeTrackDirty )
+ {
+ if (getSdrModelFromSdrObject().isLocked())
+ {
+ ImpRecalcEdgeTrack();
+ }
}
}
void SdrEdgeObj::ImpRecalcEdgeTrack()
{
// #120437# if bEdgeTrackUserDefined, do not recalculate. Also not when model locked
- if(bEdgeTrackUserDefined || !GetModel() || GetModel()->isLocked())
+ if(mbEdgeTrackUserDefined || getSdrModelFromSdrObject().isLocked())
{
return;
}
- // #110649#
- if(IsBoundRectCalculationRunning())
+ static bool mbBoundRectCalculationRunning = false;
+
+ if(mbBoundRectCalculationRunning)
{
// this object is involved into another ImpRecalcEdgeTrack() call
// from another SdrEdgeObj. Do not calculate again to avoid loop.
- // Also, do not change bEdgeTrackDirty so that it gets recalculated
+ // Also, do not change mbEdgeTrackDirty so that it gets recalculated
// later at the first non-looping call.
}
- // #i43068#
- else if(GetModel() && GetModel()->isLocked())
+ else if(getSdrModelFromSdrObject().isLocked())
{
// avoid re-layout during imports/API call sequences
// #i45294# but calc EdgeTrack and secure properties there
- mbBoundRectCalculationRunning = sal_True;
- *pEdgeTrack=ImpCalcEdgeTrack(*pEdgeTrack,aCon1,aCon2,&aEdgeInfo);
+ mbBoundRectCalculationRunning = true;
+ maEdgeTrack = ImpCalcEdgeTrack(maCon1, maCon2, &maEdgeInfo);
ImpSetAttrToEdgeInfo();
- bEdgeTrackDirty=sal_False;
- mbBoundRectCalculationRunning = sal_False;
+ mbEdgeTrackDirty = false;
+ mbBoundRectCalculationRunning = false;
}
else
{
// To not run in a depth loop, use a coloring algorythm on
// SdrEdgeObj BoundRect calculations
- mbBoundRectCalculationRunning = sal_True;
+ mbBoundRectCalculationRunning = true;
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetCurrentBoundRect();
- SetRectsDirty();
- // #110094#-14 if (!bEdgeTrackDirty) SendRepaintBroadcast();
- *pEdgeTrack=ImpCalcEdgeTrack(*pEdgeTrack,aCon1,aCon2,&aEdgeInfo);
- ImpSetEdgeInfoToAttr(); // Die Werte aus aEdgeInfo in den Pool kopieren
- bEdgeTrackDirty=sal_False;
+ { // use local scope to trigger locally
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
- // Only redraw here, no object change
- ActionChanged();
- // BroadcastObjectChange();
+ maEdgeTrack = ImpCalcEdgeTrack(maCon1, maCon2, &maEdgeInfo);
+ ImpSetEdgeInfoToAttr(); // Die Werte aus maEdgeInfo in den Pool kopieren
+ mbEdgeTrackDirty = false;
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+ // Only redraw here, no object change
+ ActionChanged();
+ }
// #110649#
- mbBoundRectCalculationRunning = sal_False;
+ mbBoundRectCalculationRunning = false;
}
}
-sal_uInt16 SdrEdgeObj::ImpCalcEscAngle(SdrObject* pObj, const Point& rPt) const
+sal_uInt16 SdrEdgeObj::ImpCalcEscAngle(SdrObject* pObj, const basegfx::B2DPoint& rPt) const
{
if (pObj==NULL) return SDRESC_ALL;
- Rectangle aR(pObj->GetSnapRect());
- long dxl=rPt.X()-aR.Left();
- long dyo=rPt.Y()-aR.Top();
- long dxr=aR.Right()-rPt.X();
- long dyu=aR.Bottom()-rPt.Y();
- FASTBOOL bxMitt=Abs(dxl-dxr)<2;
- FASTBOOL byMitt=Abs(dyo-dyu)<2;
+ const basegfx::B2DRange aR(sdr::legacy::GetSnapRange(*pObj));
+ long dxl(basegfx::fround(rPt.getX() - aR.getMinX()));
+ long dyo(basegfx::fround(rPt.getY() - aR.getMinY()));
+ long dxr(basegfx::fround(aR.getMaxX() - rPt.getX()));
+ long dyu(basegfx::fround(aR.getMaxY() - rPt.getY()));
+ bool bxMitt=Abs(dxl-dxr)<2;
+ bool byMitt=Abs(dyo-dyu)<2;
long dx=Min(dxl,dxr);
long dy=Min(dyo,dyu);
- FASTBOOL bDiag=Abs(dx-dy)<2;
+ bool bDiag=Abs(dx-dy)<2;
if (bxMitt && byMitt) return SDRESC_ALL; // In der Mitte
if (bDiag) { // diagonal
sal_uInt16 nRet=0;
@@ -639,20 +709,14 @@ sal_uInt16 SdrEdgeObj::ImpCalcEscAngle(SdrObject* pObj, const Point& rPt) const
}
}
-FASTBOOL SdrEdgeObj::ImpStripPolyPoints(XPolygon& /*rXP*/) const
-{
- // fehlende Implementation !!!
- return sal_False;
-}
-
-XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const Rectangle& rRect, const Point& rMeeting) const
+XPolygon ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const Rectangle& rRect, const Point& rMeeting)
{
XPolygon aXP;
aXP.Insert(XPOLY_APPEND,rStPt,XPOLY_NORMAL);
- FASTBOOL bRts=nEscAngle==0;
- FASTBOOL bObn=nEscAngle==9000;
- FASTBOOL bLks=nEscAngle==18000;
- FASTBOOL bUnt=nEscAngle==27000;
+ bool bRts=nEscAngle==0;
+ bool bObn=nEscAngle==9000;
+ bool bLks=nEscAngle==18000;
+ bool bUnt=nEscAngle==27000;
Point aP1(rStPt); // erstmal den Pflichtabstand
if (bLks) aP1.X()=rRect.Left();
@@ -660,7 +724,7 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons
if (bObn) aP1.Y()=rRect.Top();
if (bUnt) aP1.Y()=rRect.Bottom();
- FASTBOOL bFinish=sal_False;
+ bool bFinish=false;
if (!bFinish) {
Point aP2(aP1); // Und nun den Pflichtabstand ggf. bis auf Meetinghoehe erweitern
if (bLks && rMeeting.X()<=aP2.X()) aP2.X()=rMeeting.X();
@@ -707,151 +771,241 @@ XPolygon SdrEdgeObj::ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, cons
return aXP;
}
-XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& rCon1, SdrObjConnection& rCon2, SdrEdgeInfoRec* pInfo) const
-{
- Point aPt1,aPt2;
- SdrGluePoint aGP1,aGP2;
- sal_uInt16 nEsc1=SDRESC_ALL,nEsc2=SDRESC_ALL;
- Rectangle aBoundRect1;
- Rectangle aBoundRect2;
- Rectangle aBewareRect1;
- Rectangle aBewareRect2;
- // Erstmal die alten Endpunkte wiederholen
- if (rTrack0.GetPointCount()!=0) {
- aPt1=rTrack0[0];
- sal_uInt16 nSiz=rTrack0.GetPointCount();
- nSiz--;
- aPt2=rTrack0[nSiz];
- } else {
- if (!aOutRect.IsEmpty()) {
- aPt1=aOutRect.TopLeft();
- aPt2=aOutRect.BottomRight();
- }
- }
+// predeclaration
+basegfx::B2DPolygon ImpOldCalcEdgeTrack(
+ const Point& rPt1, long nAngle1, const Rectangle& rBoundRect1, const Rectangle& rBewareRect1,
+ const Point& rPt2, long nAngle2, const Rectangle& rBoundRect2, const Rectangle& rBewareRect2,
+ SdrEdgeKind eKind,
+ sal_uInt32* pnQuality, SdrEdgeInfoRec* pInfo);
- // #54102# To allow interactive preview, do also if not inserted
- FASTBOOL bCon1=rCon1.pObj!=NULL && rCon1.pObj->GetPage()==pPage; // && rCon1.pObj->IsInserted();
- FASTBOOL bCon2=rCon2.pObj!=NULL && rCon2.pObj->GetPage()==pPage; // && rCon2.pObj->IsInserted();
- const SfxItemSet& rSet = GetObjectItemSet();
+basegfx::B2DPolygon SdrEdgeObj::ImpCalcEdgeTrack(
+ SdrObjConnection& rCon1,
+ SdrObjConnection& rCon2,
+ SdrEdgeInfoRec* pInfo) const
+{
+ const sal_uInt32 nCount(maEdgeTrack.count());
+ basegfx::B2DPolygon aRetval;
- if (bCon1) {
- if (rCon1.pObj==(SdrObject*)this)
+ if(nCount)
+ {
+ // get old start/end points
+ basegfx::B2DPoint aPt1(maEdgeTrack.getB2DPoint(0));
+ basegfx::B2DPoint aPt2(maEdgeTrack.getB2DPoint(nCount - 1));
+ const basegfx::B2DRange aBaseRange(aPt1, aPt2);
+ SdrGluePoint aGP1,aGP2;
+ sal_uInt16 nEsc1(SDRESC_ALL);
+ sal_uInt16 nEsc2(SDRESC_ALL);
+ basegfx::B2DRange aBoundRange1;
+ basegfx::B2DRange aBoundRange2;
+ basegfx::B2DRange aBewareRange1;
+ basegfx::B2DRange aBewareRange2;
+ SdrPage* pOwningPage = getSdrPageFromSdrObject();
+ bool bCon1(rCon1.mpConnectedSdrObject && rCon1.mpConnectedSdrObject->getSdrPageFromSdrObject() == pOwningPage);
+ bool bCon2(rCon2.mpConnectedSdrObject && rCon2.mpConnectedSdrObject->getSdrPageFromSdrObject() == pOwningPage);
+ const SfxItemSet& rSet = GetObjectItemSet();
+
+ if(bCon1)
{
- // sicherheitshalber Abfragen #44515#
- aBoundRect1=aOutRect;
+ if(rCon1.mpConnectedSdrObject == this)
+ {
+ aBoundRange1 = aBaseRange;
+ }
+ else
+ {
+ aBoundRange1 = rCon1.mpConnectedSdrObject->getObjectRange(0);
+ }
+
+ aBoundRange1.transform(basegfx::tools::createTranslateB2DHomMatrix(rCon1.maObjOfs));
+
+ const sal_Int32 nH(((SdrEdgeNode1HorzDistItem&)rSet.Get(SDRATTR_EDGENODE1HORZDIST)).GetValue());
+ const sal_Int32 nV(((SdrEdgeNode1VertDistItem&)rSet.Get(SDRATTR_EDGENODE1VERTDIST)).GetValue());
+
+ aBewareRange1 = basegfx::B2DRange(
+ aBoundRange1.getMinX() - nH, aBoundRange1.getMinY() - nV,
+ aBoundRange1.getMaxX() + nH, aBoundRange1.getMaxY() + nV);
}
else
{
- aBoundRect1 = rCon1.pObj->GetCurrentBoundRect();
+ aBewareRange1 = aBoundRange1 = basegfx::B2DRange(aPt1 + rCon1.maObjOfs);
}
- aBoundRect1.Move(rCon1.aObjOfs.X(),rCon1.aObjOfs.Y());
- aBewareRect1=aBoundRect1;
- sal_Int32 nH = ((SdrEdgeNode1HorzDistItem&)rSet.Get(SDRATTR_EDGENODE1HORZDIST)).GetValue();
- sal_Int32 nV = ((SdrEdgeNode1VertDistItem&)rSet.Get(SDRATTR_EDGENODE1VERTDIST)).GetValue();
+ if(bCon2)
+ {
+ if(rCon2.mpConnectedSdrObject == this)
+ {
+ aBoundRange2 = aBaseRange;
+ }
+ else
+ {
+ aBoundRange2 = rCon2.mpConnectedSdrObject->getObjectRange(0);
+ }
+
+ aBoundRange2.transform(basegfx::tools::createTranslateB2DHomMatrix(rCon2.maObjOfs));
- aBewareRect1.Left()-=nH;
- aBewareRect1.Right()+=nH;
- aBewareRect1.Top()-=nV;
- aBewareRect1.Bottom()+=nV;
- } else {
- aBoundRect1=Rectangle(aPt1,aPt1);
- aBoundRect1.Move(rCon1.aObjOfs.X(),rCon1.aObjOfs.Y());
- aBewareRect1=aBoundRect1;
- }
- if (bCon2) {
- if (rCon2.pObj==(SdrObject*)this) { // sicherheitshalber Abfragen #44515#
- aBoundRect2=aOutRect;
+ const sal_Int32 nH(((SdrEdgeNode2HorzDistItem&)rSet.Get(SDRATTR_EDGENODE2HORZDIST)).GetValue());
+ const sal_Int32 nV(((SdrEdgeNode2VertDistItem&)rSet.Get(SDRATTR_EDGENODE2VERTDIST)).GetValue());
+
+ aBewareRange2 = basegfx::B2DRange(
+ aBoundRange2.getMinX() - nH, aBoundRange2.getMinY() - nV,
+ aBoundRange2.getMaxX() + nH, aBoundRange2.getMaxY() + nV);
}
else
{
- aBoundRect2 = rCon2.pObj->GetCurrentBoundRect();
- }
- aBoundRect2.Move(rCon2.aObjOfs.X(),rCon2.aObjOfs.Y());
- aBewareRect2=aBoundRect2;
-
- sal_Int32 nH = ((SdrEdgeNode2HorzDistItem&)rSet.Get(SDRATTR_EDGENODE2HORZDIST)).GetValue();
- sal_Int32 nV = ((SdrEdgeNode2VertDistItem&)rSet.Get(SDRATTR_EDGENODE2VERTDIST)).GetValue();
-
- aBewareRect2.Left()-=nH;
- aBewareRect2.Right()+=nH;
- aBewareRect2.Top()-=nV;
- aBewareRect2.Bottom()+=nV;
- } else {
- aBoundRect2=Rectangle(aPt2,aPt2);
- aBoundRect2.Move(rCon2.aObjOfs.X(),rCon2.aObjOfs.Y());
- aBewareRect2=aBoundRect2;
- }
- XPolygon aBestXP;
- sal_uIntPtr nBestQual=0xFFFFFFFF;
- SdrEdgeInfoRec aBestInfo;
- FASTBOOL bAuto1=bCon1 && rCon1.bBestVertex;
- FASTBOOL bAuto2=bCon2 && rCon2.bBestVertex;
- if (bAuto1) rCon1.bAutoVertex=sal_True;
- if (bAuto2) rCon2.bAutoVertex=sal_True;
- sal_uInt16 nBestAuto1=0;
- sal_uInt16 nBestAuto2=0;
- sal_uInt16 nAnz1=bAuto1 ? 4 : 1;
- sal_uInt16 nAnz2=bAuto2 ? 4 : 1;
- for (sal_uInt16 nNum1=0; nNum1<nAnz1; nNum1++) {
- if (bAuto1) rCon1.nConId=nNum1;
- if (bCon1 && rCon1.TakeGluePoint(aGP1,sal_True)) {
- aPt1=aGP1.GetPos();
- nEsc1=aGP1.GetEscDir();
- if (nEsc1==SDRESC_SMART) nEsc1=ImpCalcEscAngle(rCon1.pObj,aPt1-rCon1.aObjOfs);
- }
- for (sal_uInt16 nNum2=0; nNum2<nAnz2; nNum2++) {
- if (bAuto2) rCon2.nConId=nNum2;
- if (bCon2 && rCon2.TakeGluePoint(aGP2,sal_True)) {
- aPt2=aGP2.GetPos();
- nEsc2=aGP2.GetEscDir();
- if (nEsc2==SDRESC_SMART) nEsc2=ImpCalcEscAngle(rCon2.pObj,aPt2-rCon2.aObjOfs);
+ aBewareRange2 = aBoundRange2 = basegfx::B2DRange(aPt2 + rCon2.maObjOfs);
+ }
+
+ sal_uInt32 nBestQual=0xFFFFFFFF;
+ SdrEdgeInfoRec aBestInfo;
+ const bool bAuto1(bCon1 && rCon1.mbBestVertex);
+ const bool bAuto2(bCon2 && rCon2.mbBestVertex);
+
+ if(bAuto1)
+ {
+ rCon1.mbAutoVertex = true;
+ }
+
+ if(bAuto2)
+ {
+ rCon2.mbAutoVertex = true;
+ }
+
+ sal_uInt16 nBestAuto1(0);
+ sal_uInt16 nBestAuto2(0);
+ sal_uInt16 nAnz1(bAuto1 ? 4 : 1);
+ sal_uInt16 nAnz2(bAuto2 ? 4 : 1);
+
+ // prepare vars for old interface stuff
+ const Point aPoint1(basegfx::fround(aPt1.getX()), basegfx::fround(aPt1.getY()));
+ const Point aPoint2(basegfx::fround(aPt2.getX()), basegfx::fround(aPt2.getY()));
+ const Rectangle aBoundRect1(
+ basegfx::fround(aBoundRange1.getMinX()), basegfx::fround(aBoundRange1.getMinY()),
+ basegfx::fround(aBoundRange1.getMaxX()), basegfx::fround(aBoundRange1.getMaxY()));
+ const Rectangle aBoundRect2(
+ basegfx::fround(aBoundRange2.getMinX()), basegfx::fround(aBoundRange2.getMinY()),
+ basegfx::fround(aBoundRange2.getMaxX()), basegfx::fround(aBoundRange2.getMaxY()));
+ const Rectangle aBewareRect1(
+ basegfx::fround(aBewareRange1.getMinX()), basegfx::fround(aBewareRange1.getMinY()),
+ basegfx::fround(aBewareRange1.getMaxX()), basegfx::fround(aBewareRange1.getMaxY()));
+ const Rectangle aBewareRect2(
+ basegfx::fround(aBewareRange2.getMinX()), basegfx::fround(aBewareRange2.getMinY()),
+ basegfx::fround(aBewareRange2.getMaxX()), basegfx::fround(aBewareRange2.getMaxY()));
+
+ for(sal_uInt16 nNum1(0); nNum1 < nAnz1; nNum1++)
+ {
+ if(bAuto1)
+ {
+ rCon1.mnConnectorId = nNum1;
}
- for (long nA1=0; nA1<36000; nA1+=9000) {
- sal_uInt16 nE1=nA1==0 ? SDRESC_RIGHT : nA1==9000 ? SDRESC_TOP : nA1==18000 ? SDRESC_LEFT : nA1==27000 ? SDRESC_BOTTOM : 0;
- for (long nA2=0; nA2<36000; nA2+=9000) {
- sal_uInt16 nE2=nA2==0 ? SDRESC_RIGHT : nA2==9000 ? SDRESC_TOP : nA2==18000 ? SDRESC_LEFT : nA2==27000 ? SDRESC_BOTTOM : 0;
- if ((nEsc1&nE1)!=0 && (nEsc2&nE2)!=0) {
- sal_uIntPtr nQual=0;
- SdrEdgeInfoRec aInfo;
- if (pInfo!=NULL) aInfo=*pInfo;
- XPolygon aXP(ImpCalcEdgeTrack(aPt1,nA1,aBoundRect1,aBewareRect1,aPt2,nA2,aBoundRect2,aBewareRect2,&nQual,&aInfo));
- if (nQual<nBestQual) {
- aBestXP=aXP;
- nBestQual=nQual;
- aBestInfo=aInfo;
- nBestAuto1=nNum1;
- nBestAuto2=nNum2;
+
+ if(bCon1 && rCon1.TakeGluePoint(aGP1, true))
+ {
+ aPt1 = aGP1.GetPos();
+ nEsc1 = aGP1.GetEscDir();
+
+ if(SDRESC_SMART == nEsc1)
+ {
+ nEsc1 = ImpCalcEscAngle(rCon1.mpConnectedSdrObject, aPt1 - rCon1.maObjOfs);
+ }
+ }
+
+ for(sal_uInt16 nNum2(0); nNum2 < nAnz2; nNum2++)
+ {
+ if(bAuto2)
+ {
+ rCon2.mnConnectorId = nNum2;
+ }
+
+ if(bCon2 && rCon2.TakeGluePoint(aGP2, true))
+ {
+ aPt2 = aGP2.GetPos();
+ nEsc2 = aGP2.GetEscDir();
+
+ if(SDRESC_SMART == nEsc2)
+ {
+ nEsc2 = ImpCalcEscAngle(rCon2.mpConnectedSdrObject, aPt2 - rCon2.maObjOfs);
+ }
+ }
+
+ for(long nA1(0); nA1 < 36000; nA1 += 9000)
+ {
+ const sal_uInt16 nE1(!nA1 ? SDRESC_RIGHT : 9000 == nA1 ? SDRESC_TOP : 18000 == nA1 ? SDRESC_LEFT : 27000 == nA1 ? SDRESC_BOTTOM : 0);
+
+ for(long nA2(0); nA2 < 36000; nA2 += 9000)
+ {
+ const sal_uInt16 nE2(!nA2 ? SDRESC_RIGHT : 9000 == nA2 ? SDRESC_TOP : 18000 == nA2 ? SDRESC_LEFT : 27000 == nA2 ? SDRESC_BOTTOM : 0);
+
+ if((nEsc1 & nE1) && (nEsc2 & nE2))
+ {
+ sal_uInt32 nQual(0);
+ SdrEdgeInfoRec aInfo;
+
+ if(pInfo)
+ {
+ aInfo = *pInfo;
+ }
+
+ const basegfx::B2DPolygon aXP(
+ ImpOldCalcEdgeTrack(
+ aPoint1, nA1, aBoundRect1, aBewareRect1,
+ aPoint2, nA2, aBoundRect2, aBewareRect2,
+ ((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue(),
+ &nQual,
+ &aInfo));
+
+ if(nQual < nBestQual)
+ {
+ aRetval = aXP;
+ nBestQual = nQual;
+ aBestInfo = aInfo;
+ nBestAuto1 = nNum1;
+ nBestAuto2 = nNum2;
+ }
}
}
}
}
}
+
+ if(bAuto1)
+ {
+ rCon1.mnConnectorId = nBestAuto1;
+ }
+
+ if(bAuto2)
+ {
+ rCon2.mnConnectorId = nBestAuto2;
+ }
+
+ if(pInfo)
+ {
+ *pInfo = aBestInfo;
+ }
+
+ return aRetval;
}
- if (bAuto1) rCon1.nConId=nBestAuto1;
- if (bAuto2) rCon2.nConId=nBestAuto2;
- if (pInfo!=NULL) *pInfo=aBestInfo;
- return aBestXP;
+
+ return aRetval;
}
-XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rectangle& rBoundRect1, const Rectangle& rBewareRect1,
+basegfx::B2DPolygon ImpOldCalcEdgeTrack(
+ const Point& rPt1, long nAngle1, const Rectangle& rBoundRect1, const Rectangle& rBewareRect1,
const Point& rPt2, long nAngle2, const Rectangle& rBoundRect2, const Rectangle& rBewareRect2,
- sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const
-{
- SdrEdgeKind eKind=((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue();
- FASTBOOL bRts1=nAngle1==0;
- FASTBOOL bObn1=nAngle1==9000;
- FASTBOOL bLks1=nAngle1==18000;
- FASTBOOL bUnt1=nAngle1==27000;
- FASTBOOL bHor1=bLks1 || bRts1;
- FASTBOOL bVer1=bObn1 || bUnt1;
- FASTBOOL bRts2=nAngle2==0;
- FASTBOOL bObn2=nAngle2==9000;
- FASTBOOL bLks2=nAngle2==18000;
- FASTBOOL bUnt2=nAngle2==27000;
- FASTBOOL bHor2=bLks2 || bRts2;
- FASTBOOL bVer2=bObn2 || bUnt2;
- FASTBOOL bInfo=pInfo!=NULL;
+ SdrEdgeKind eKind,
+ sal_uInt32* pnQuality, SdrEdgeInfoRec* pInfo)
+{
+ bool bRts1=nAngle1==0;
+ bool bObn1=nAngle1==9000;
+ bool bLks1=nAngle1==18000;
+ bool bUnt1=nAngle1==27000;
+ bool bHor1=bLks1 || bRts1;
+ bool bVer1=bObn1 || bUnt1;
+ bool bRts2=nAngle2==0;
+ bool bObn2=nAngle2==9000;
+ bool bLks2=nAngle2==18000;
+ bool bUnt2=nAngle2==27000;
+ bool bHor2=bLks2 || bRts2;
+ bool bVer2=bObn2 || bUnt2;
+ bool bInfo=pInfo!=NULL;
if (bInfo) {
pInfo->cOrthoForm=0;
pInfo->nAngle1=nAngle1;
@@ -867,8 +1021,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
Rectangle aBewareRect1(rBewareRect1);
Rectangle aBewareRect2(rBewareRect2);
Point aMeeting((aPt1.X()+aPt2.X()+1)/2,(aPt1.Y()+aPt2.Y()+1)/2);
- FASTBOOL bMeetingXMid=sal_True;
- FASTBOOL bMeetingYMid=sal_True;
+ bool bMeetingXMid=true;
+ bool bMeetingYMid=true;
if (eKind==SDREDGE_ONELINE) {
XPolygon aXP(2);
aXP[0]=rPt1;
@@ -876,7 +1030,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
if (pnQuality!=NULL) {
*pnQuality=Abs(rPt1.X()-rPt2.X())+Abs(rPt1.Y()-rPt2.Y());
}
- return aXP;
+ return aXP.getB2DPolygon();
} else if (eKind==SDREDGE_THREELINES) {
XPolygon aXP(4);
aXP[0]=rPt1;
@@ -901,20 +1055,20 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
pInfo->nObj1Lines=2;
pInfo->nObj2Lines=2;
if (bHor1) {
- aXP[1].X()+=pInfo->aObj1Line2.X();
+ aXP[1].X()+=pInfo->aObj1Line2.getX();
} else {
- aXP[1].Y()+=pInfo->aObj1Line2.Y();
+ aXP[1].Y()+=pInfo->aObj1Line2.getY();
}
if (bHor2) {
- aXP[2].X()+=pInfo->aObj2Line2.X();
+ aXP[2].X()+=pInfo->aObj2Line2.getX();
} else {
- aXP[2].Y()+=pInfo->aObj2Line2.Y();
+ aXP[2].Y()+=pInfo->aObj2Line2.getY();
}
}
- return aXP;
+ return aXP.getB2DPolygon();
}
sal_uInt16 nIntersections=0;
- FASTBOOL bForceMeeting=sal_False; // Muss die Linie durch den MeetingPoint laufen?
+ bool bForceMeeting=false; // Muss die Linie durch den MeetingPoint laufen?
{
Point aC1(aBewareRect1.Center());
Point aC2(aBewareRect2.Center());
@@ -952,9 +1106,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
long nXMax=Max(aBewareRect1.Right(),aBewareRect2.Right());
long nYMin=Min(aBewareRect1.Top(),aBewareRect2.Top());
long nYMax=Max(aBewareRect1.Bottom(),aBewareRect2.Bottom());
- //int bBoundOverlap=aBoundRect1.Right()>aBoundRect2.Left() && aBoundRect1.Left()<aBoundRect2.Right() &&
- aBoundRect1.Bottom()>aBoundRect2.Top() && aBoundRect1.Top()<aBoundRect2.Bottom();
- FASTBOOL bBewareOverlap=aBewareRect1.Right()>aBewareRect2.Left() && aBewareRect1.Left()<aBewareRect2.Right() &&
+ //bool bBoundOverlap=aBoundRect1.Right()>aBoundRect2.Left() && aBoundRect1.Left()<aBoundRect2.Right() &&
+ // aBoundRect1.Bottom()>aBoundRect2.Top() && aBoundRect1.Top()<aBoundRect2.Bottom();
+ bool bBewareOverlap=aBewareRect1.Right()>aBewareRect2.Left() && aBewareRect1.Left()<aBewareRect2.Right() &&
aBewareRect1.Bottom()>aBewareRect2.Top() && aBewareRect1.Top()<aBewareRect2.Bottom();
unsigned nMainCase=3;
if (nAngle1==nAngle2) nMainCase=1;
@@ -963,29 +1117,29 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
if (bVer1) aMeeting.X()=(aPt1.X()+aPt2.X()+1)/2; // ist hier besser, als der
if (bHor1) aMeeting.Y()=(aPt1.Y()+aPt2.Y()+1)/2; // Mittelpunkt des Freiraums
// bX1Ok bedeutet, dass die Vertikale, die aus Obj1 austritt, keinen Konflikt mit Obj2 bildet, ...
- FASTBOOL bX1Ok=aPt1.X()<=aBewareRect2.Left() || aPt1.X()>=aBewareRect2.Right();
- FASTBOOL bX2Ok=aPt2.X()<=aBewareRect1.Left() || aPt2.X()>=aBewareRect1.Right();
- FASTBOOL bY1Ok=aPt1.Y()<=aBewareRect2.Top() || aPt1.Y()>=aBewareRect2.Bottom();
- FASTBOOL bY2Ok=aPt2.Y()<=aBewareRect1.Top() || aPt2.Y()>=aBewareRect1.Bottom();
+ bool bX1Ok=aPt1.X()<=aBewareRect2.Left() || aPt1.X()>=aBewareRect2.Right();
+ bool bX2Ok=aPt2.X()<=aBewareRect1.Left() || aPt2.X()>=aBewareRect1.Right();
+ bool bY1Ok=aPt1.Y()<=aBewareRect2.Top() || aPt1.Y()>=aBewareRect2.Bottom();
+ bool bY2Ok=aPt2.Y()<=aBewareRect1.Top() || aPt2.Y()>=aBewareRect1.Bottom();
if (bLks1 && (bY1Ok || aBewareRect1.Left()<aBewareRect2.Right()) && (bY2Ok || aBewareRect2.Left()<aBewareRect1.Right())) {
aMeeting.X()=nXMin;
- bMeetingXMid=sal_False;
+ bMeetingXMid=false;
}
if (bRts1 && (bY1Ok || aBewareRect1.Right()>aBewareRect2.Left()) && (bY2Ok || aBewareRect2.Right()>aBewareRect1.Left())) {
aMeeting.X()=nXMax;
- bMeetingXMid=sal_False;
+ bMeetingXMid=false;
}
if (bObn1 && (bX1Ok || aBewareRect1.Top()<aBewareRect2.Bottom()) && (bX2Ok || aBewareRect2.Top()<aBewareRect1.Bottom())) {
aMeeting.Y()=nYMin;
- bMeetingYMid=sal_False;
+ bMeetingYMid=false;
}
if (bUnt1 && (bX1Ok || aBewareRect1.Bottom()>aBewareRect2.Top()) && (bX2Ok || aBewareRect2.Bottom()>aBewareRect1.Top())) {
aMeeting.Y()=nYMax;
- bMeetingYMid=sal_False;
+ bMeetingYMid=false;
}
} else if (nMainCase==2) {
// Fall 2:
- bForceMeeting=sal_True;
+ bForceMeeting=true;
if (bHor1) { // beide waagerecht
/* 9 Moeglichkeiten: ù ù ù */
/* 2.1 Gegenueber, Ueberschneidung à ´ ù */
@@ -1020,27 +1174,27 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
// Ueberschneidung auf der Y-Achse. Faelle 2.1, 2.8, 2.9
if (aBewR1.Right()>aBewR2.Left()) {
// Faelle 2.8, 2.9
- // Fall 2.8 ist immer Aussenrumlauf (bDirect=sal_False).
+ // Fall 2.8 ist immer Aussenrumlauf (bDirect=false).
// Fall 2.9 kann auch Direktverbindung sein (bei geringer
// Ueberschneidung der BewareRects ohne Ueberschneidung der
// Boundrects wenn die Linienaustritte sonst das BewareRect
// des jeweils anderen Objekts verletzen wuerden.
- FASTBOOL bCase29Direct=sal_False;
- FASTBOOL bCase29=aBewR1.Right()>aBewR2.Left();
+ bool bCase29Direct=false;
+ bool bCase29=aBewR1.Right()>aBewR2.Left();
if (aBndR1.Right()<=aBndR2.Left()) { // Fall 2.9 und keine Boundrectueberschneidung
if ((aPt1.Y()>aBewareRect2.Top() && aPt1.Y()<aBewareRect2.Bottom()) ||
(aPt2.Y()>aBewareRect1.Top() && aPt2.Y()<aBewareRect1.Bottom())) {
- bCase29Direct=sal_True;
+ bCase29Direct=true;
}
}
if (!bCase29Direct) {
- FASTBOOL bObenLang=Abs(nYMin-aMeeting.Y())<=Abs(nYMax-aMeeting.Y());
+ bool bObenLang=Abs(nYMin-aMeeting.Y())<=Abs(nYMax-aMeeting.Y());
if (bObenLang) {
aMeeting.Y()=nYMin;
} else {
aMeeting.Y()=nYMax;
}
- bMeetingYMid=sal_False;
+ bMeetingYMid=false;
if (bCase29) {
// und nun noch dafuer sorgen, dass das
// umzingelte Obj nicht durchquert wird
@@ -1049,7 +1203,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
} else {
aMeeting.X()=aBewR1.Left();
}
- bMeetingXMid=sal_False;
+ bMeetingXMid=false;
}
} else {
// Direkte Verbindung (3-Linien Z-Verbindung), da
@@ -1080,27 +1234,27 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
// Ueberschneidung auf der Y-Achse. Faelle 2.1, 2.8, 2.9
if (aBewR1.Bottom()>aBewR2.Top()) {
// Faelle 2.8, 2.9
- // Fall 2.8 ist immer Aussenrumlauf (bDirect=sal_False).
+ // Fall 2.8 ist immer Aussenrumlauf (bDirect=false).
// Fall 2.9 kann auch Direktverbindung sein (bei geringer
// Ueberschneidung der BewareRects ohne Ueberschneidung der
// Boundrects wenn die Linienaustritte sonst das BewareRect
// des jeweils anderen Objekts verletzen wuerden.
- FASTBOOL bCase29Direct=sal_False;
- FASTBOOL bCase29=aBewR1.Bottom()>aBewR2.Top();
+ bool bCase29Direct=false;
+ bool bCase29=aBewR1.Bottom()>aBewR2.Top();
if (aBndR1.Bottom()<=aBndR2.Top()) { // Fall 2.9 und keine Boundrectueberschneidung
if ((aPt1.X()>aBewareRect2.Left() && aPt1.X()<aBewareRect2.Right()) ||
(aPt2.X()>aBewareRect1.Left() && aPt2.X()<aBewareRect1.Right())) {
- bCase29Direct=sal_True;
+ bCase29Direct=true;
}
}
if (!bCase29Direct) {
- FASTBOOL bLinksLang=Abs(nXMin-aMeeting.X())<=Abs(nXMax-aMeeting.X());
+ bool bLinksLang=Abs(nXMin-aMeeting.X())<=Abs(nXMax-aMeeting.X());
if (bLinksLang) {
aMeeting.X()=nXMin;
} else {
aMeeting.X()=nXMax;
}
- bMeetingXMid=sal_False;
+ bMeetingXMid=false;
if (bCase29) {
// und nun noch dafuer sorgen, dass das
// umzingelte Obj nicht durchquert wird
@@ -1109,7 +1263,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
} else {
aMeeting.Y()=aBewR1.Top();
}
- bMeetingYMid=sal_False;
+ bMeetingYMid=false;
}
} else {
// Direkte Verbindung (3-Linien Z-Verbindung), da
@@ -1180,9 +1334,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
(((bRts2 && aTmpR2.Right ()<=aPt1.X()) || (bLks2 && aTmpR2.Left()>=aPt1.X())) &&
((bUnt1 && aTmpR1.Bottom()<=aPt2.Y()) || (bObn1 && aTmpR1.Top ()>=aPt2.Y())))) {
// Fall 3.2 trifft zu: Verbindung mit lediglich 2 Linien
- bForceMeeting=sal_True;
- bMeetingXMid=sal_False;
- bMeetingYMid=sal_False;
+ bForceMeeting=true;
+ bMeetingXMid=false;
+ bMeetingYMid=false;
if (bHor1) {
aMeeting.X()=aPt2.X();
aMeeting.Y()=aPt1.Y();
@@ -1202,11 +1356,11 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
((bUnt1 && aBewareRect1.Bottom()>aBewareRect2.Top ()) ||
(bObn1 && aBewareRect1.Top ()<aBewareRect2.Bottom())))) {
// Fall 3.3
- bForceMeeting=sal_True;
- if (bRts1 || bRts2) { aMeeting.X()=nXMax; bMeetingXMid=sal_False; }
- if (bLks1 || bLks2) { aMeeting.X()=nXMin; bMeetingXMid=sal_False; }
- if (bUnt1 || bUnt2) { aMeeting.Y()=nYMax; bMeetingYMid=sal_False; }
- if (bObn1 || bObn2) { aMeeting.Y()=nYMin; bMeetingYMid=sal_False; }
+ bForceMeeting=true;
+ if (bRts1 || bRts2) { aMeeting.X()=nXMax; bMeetingXMid=false; }
+ if (bLks1 || bLks2) { aMeeting.X()=nXMin; bMeetingXMid=false; }
+ if (bUnt1 || bUnt2) { aMeeting.Y()=nYMax; bMeetingYMid=false; }
+ if (bObn1 || bObn2) { aMeeting.Y()=nYMin; bMeetingYMid=false; }
}
}
}
@@ -1221,15 +1375,15 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
}
Point aEP1(aXP1[nXP1Anz-1]);
Point aEP2(aXP2[nXP2Anz-1]);
- FASTBOOL bInsMeetingPoint=aEP1.X()!=aEP2.X() && aEP1.Y()!=aEP2.Y();
- FASTBOOL bHorzE1=aEP1.Y()==aXP1[nXP1Anz-2].Y(); // letzte Linie von XP1 horizontal?
- FASTBOOL bHorzE2=aEP2.Y()==aXP2[nXP2Anz-2].Y(); // letzte Linie von XP2 horizontal?
+ bool bInsMeetingPoint=aEP1.X()!=aEP2.X() && aEP1.Y()!=aEP2.Y();
+ bool bHorzE1=aEP1.Y()==aXP1[nXP1Anz-2].Y(); // letzte Linie von XP1 horizontal?
+ bool bHorzE2=aEP2.Y()==aXP2[nXP2Anz-2].Y(); // letzte Linie von XP2 horizontal?
if (aEP1==aEP2 && (bHorzE1 && bHorzE2 && aEP1.Y()==aEP2.Y()) || (!bHorzE1 && !bHorzE2 && aEP1.X()==aEP2.X())) {
// Sonderbehandlung fuer 'I'-Verbinder
nXP1Anz--; aXP1.Remove(nXP1Anz,1);
nXP2Anz--; aXP2.Remove(nXP2Anz,1);
- bMeetingXMid=sal_False;
- bMeetingYMid=sal_False;
+ bMeetingXMid=false;
+ bMeetingYMid=false;
}
if (bInsMeetingPoint) {
aXP1.Insert(XPOLY_APPEND,aMeeting,XPOLY_NORMAL);
@@ -1307,14 +1461,14 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
}
}
if (pnQuality!=NULL) {
- sal_uIntPtr nQual=0;
- sal_uIntPtr nQual0=nQual; // Ueberlaeufe vorbeugen
- FASTBOOL bOverflow=sal_False;
+ sal_uInt32 nQual=0;
+ sal_uInt32 nQual0=nQual; // Ueberlaeufe vorbeugen
+ bool bOverflow=false;
Point aPt0(aXP1[0]);
for (sal_uInt16 nPntNum=1; nPntNum<nPntAnz; nPntNum++) {
Point aPt1b(aXP1[nPntNum]);
nQual+=Abs(aPt1b.X()-aPt0.X())+Abs(aPt1b.Y()-aPt0.Y());
- if (nQual<nQual0) bOverflow=sal_True;
+ if (nQual<nQual0) bOverflow=true;
nQual0=nQual;
aPt0=aPt1b;
}
@@ -1322,11 +1476,11 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
sal_uInt16 nTmp=nPntAnz;
if (cForm=='Z') {
nTmp=2; // Z-Form hat gute Qualitaet (nTmp=2 statt 4)
- sal_uIntPtr n1=Abs(aXP1[1].X()-aXP1[0].X())+Abs(aXP1[1].Y()-aXP1[0].Y());
- sal_uIntPtr n2=Abs(aXP1[2].X()-aXP1[1].X())+Abs(aXP1[2].Y()-aXP1[1].Y());
- sal_uIntPtr n3=Abs(aXP1[3].X()-aXP1[2].X())+Abs(aXP1[3].Y()-aXP1[2].Y());
+ sal_uInt32 n1=Abs(aXP1[1].X()-aXP1[0].X())+Abs(aXP1[1].Y()-aXP1[0].Y());
+ sal_uInt32 n2=Abs(aXP1[2].X()-aXP1[1].X())+Abs(aXP1[2].Y()-aXP1[1].Y());
+ sal_uInt32 n3=Abs(aXP1[3].X()-aXP1[2].X())+Abs(aXP1[3].Y()-aXP1[2].Y());
// fuer moeglichst gleichlange Linien sorgen
- sal_uIntPtr nBesser=0;
+ sal_uInt32 nBesser=0;
n1+=n3;
n3=n2/4;
if (n1>=n2) nBesser=6;
@@ -1337,8 +1491,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
}
if (nTmp>=3) {
nQual0=nQual;
- nQual+=(sal_uIntPtr)nTmp*0x01000000;
- if (nQual<nQual0 || nTmp>15) bOverflow=sal_True;
+ nQual+=(sal_uInt32)nTmp*0x01000000;
+ if (nQual<nQual0 || nTmp>15) bOverflow=true;
}
if (nPntAnz>=2) { // Austrittswinkel nochmal pruefen
Point aP1(aXP1[1]); aP1-=aXP1[0];
@@ -1359,9 +1513,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
for (sal_uInt16 i=0; i<nPntAnz; i++) {
Point aPt1b(aXP1[i]);
- FASTBOOL b1=aPt1b.X()>aBewareRect1.Left() && aPt1b.X()<aBewareRect1.Right() &&
+ bool b1=aPt1b.X()>aBewareRect1.Left() && aPt1b.X()<aBewareRect1.Right() &&
aPt1b.Y()>aBewareRect1.Top() && aPt1b.Y()<aBewareRect1.Bottom();
- FASTBOOL b2=aPt1b.X()>aBewareRect2.Left() && aPt1b.X()<aBewareRect2.Right() &&
+ bool b2=aPt1b.X()>aBewareRect2.Left() && aPt1b.X()<aBewareRect2.Right() &&
aPt1b.Y()>aBewareRect2.Top() && aPt1b.Y()<aBewareRect2.Bottom();
sal_uInt16 nInt0=nIntersections;
if (i==0 || i==nPntAnz-1) {
@@ -1392,61 +1546,61 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
}
if (nPntAnz<=1) nIntersections++;
nQual0=nQual;
- nQual+=(sal_uIntPtr)nIntersections*0x10000000;
- if (nQual<nQual0 || nIntersections>15) bOverflow=sal_True;
+ nQual+=(sal_uInt32)nIntersections*0x10000000;
+ if (nQual<nQual0 || nIntersections>15) bOverflow=true;
if (bOverflow || nQual==0xFFFFFFFF) nQual=0xFFFFFFFE;
*pnQuality=nQual;
}
if (bInfo) { // nun die Linienversaetze auf aXP1 anwenden
if (pInfo->nMiddleLine!=0xFFFF) {
- sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(MIDDLELINE,aXP1);
- if (pInfo->ImpIsHorzLine(MIDDLELINE,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aMiddleLine.Y();
- aXP1[nIdx+1].Y()+=pInfo->aMiddleLine.Y();
+ sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(MIDDLELINE,aXP1.GetPointCount());
+ if (pInfo->ImpIsHorzLine(MIDDLELINE,aXP1.GetPointCount())) {
+ aXP1[nIdx].Y()+=pInfo->aMiddleLine.getY();
+ aXP1[nIdx+1].Y()+=pInfo->aMiddleLine.getY();
} else {
- aXP1[nIdx].X()+=pInfo->aMiddleLine.X();
- aXP1[nIdx+1].X()+=pInfo->aMiddleLine.X();
+ aXP1[nIdx].X()+=pInfo->aMiddleLine.getX();
+ aXP1[nIdx+1].X()+=pInfo->aMiddleLine.getX();
}
}
if (pInfo->nObj1Lines>=2) {
- sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ1LINE2,aXP1);
- if (pInfo->ImpIsHorzLine(OBJ1LINE2,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj1Line2.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj1Line2.Y();
+ sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ1LINE2,aXP1.GetPointCount());
+ if (pInfo->ImpIsHorzLine(OBJ1LINE2,aXP1.GetPointCount())) {
+ aXP1[nIdx].Y()+=pInfo->aObj1Line2.getY();
+ aXP1[nIdx+1].Y()+=pInfo->aObj1Line2.getY();
} else {
- aXP1[nIdx].X()+=pInfo->aObj1Line2.X();
- aXP1[nIdx+1].X()+=pInfo->aObj1Line2.X();
+ aXP1[nIdx].X()+=pInfo->aObj1Line2.getX();
+ aXP1[nIdx+1].X()+=pInfo->aObj1Line2.getX();
}
}
if (pInfo->nObj1Lines>=3) {
- sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ1LINE3,aXP1);
- if (pInfo->ImpIsHorzLine(OBJ1LINE3,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj1Line3.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj1Line3.Y();
+ sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ1LINE3,aXP1.GetPointCount());
+ if (pInfo->ImpIsHorzLine(OBJ1LINE3,aXP1.GetPointCount())) {
+ aXP1[nIdx].Y()+=pInfo->aObj1Line3.getY();
+ aXP1[nIdx+1].Y()+=pInfo->aObj1Line3.getY();
} else {
- aXP1[nIdx].X()+=pInfo->aObj1Line3.X();
- aXP1[nIdx+1].X()+=pInfo->aObj1Line3.X();
+ aXP1[nIdx].X()+=pInfo->aObj1Line3.getX();
+ aXP1[nIdx+1].X()+=pInfo->aObj1Line3.getX();
}
}
if (pInfo->nObj2Lines>=2) {
- sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ2LINE2,aXP1);
- if (pInfo->ImpIsHorzLine(OBJ2LINE2,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj2Line2.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj2Line2.Y();
+ sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ2LINE2,aXP1.GetPointCount());
+ if (pInfo->ImpIsHorzLine(OBJ2LINE2,aXP1.GetPointCount())) {
+ aXP1[nIdx].Y()+=pInfo->aObj2Line2.getY();
+ aXP1[nIdx+1].Y()+=pInfo->aObj2Line2.getY();
} else {
- aXP1[nIdx].X()+=pInfo->aObj2Line2.X();
- aXP1[nIdx+1].X()+=pInfo->aObj2Line2.X();
+ aXP1[nIdx].X()+=pInfo->aObj2Line2.getX();
+ aXP1[nIdx+1].X()+=pInfo->aObj2Line2.getX();
}
}
if (pInfo->nObj2Lines>=3) {
- sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ2LINE3,aXP1);
- if (pInfo->ImpIsHorzLine(OBJ2LINE3,aXP1)) {
- aXP1[nIdx].Y()+=pInfo->aObj2Line3.Y();
- aXP1[nIdx+1].Y()+=pInfo->aObj2Line3.Y();
+ sal_uInt16 nIdx=pInfo->ImpGetPolyIdx(OBJ2LINE3,aXP1.GetPointCount());
+ if (pInfo->ImpIsHorzLine(OBJ2LINE3,aXP1.GetPointCount())) {
+ aXP1[nIdx].Y()+=pInfo->aObj2Line3.getY();
+ aXP1[nIdx+1].Y()+=pInfo->aObj2Line3.getY();
} else {
- aXP1[nIdx].X()+=pInfo->aObj2Line3.X();
- aXP1[nIdx+1].X()+=pInfo->aObj2Line3.X();
+ aXP1[nIdx].X()+=pInfo->aObj2Line3.getX();
+ aXP1[nIdx+1].X()+=pInfo->aObj2Line3.getX();
}
}
}
@@ -1518,7 +1672,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
}
}
}
- return aXP1;
+ return aXP1.getB2DPolygon();
}
/*
@@ -1557,47 +1711,50 @@ je Objekt variiert von 0-3:
void __EXPORT SdrEdgeObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- SfxSimpleHint* pSimple=PTR_CAST(SfxSimpleHint,&rHint);
- sal_uIntPtr nId=pSimple==0 ? 0 : pSimple->GetId();
- FASTBOOL bDataChg=nId==SFX_HINT_DATACHANGED;
- FASTBOOL bDying=nId==SFX_HINT_DYING;
- FASTBOOL bObj1=aCon1.pObj!=NULL && aCon1.pObj->GetBroadcaster()==&rBC;
- FASTBOOL bObj2=aCon2.pObj!=NULL && aCon2.pObj->GetBroadcaster()==&rBC;
+ const SfxSimpleHint* pSimple=dynamic_cast< const SfxSimpleHint* >( &rHint);
+ sal_uInt32 nId=pSimple==0 ? 0 : pSimple->GetId();
+ bool bDataChg=nId==SFX_HINT_DATACHANGED;
+ bool bDying=nId==SFX_HINT_DYING;
+ bool bObj1 = maCon1.mpConnectedSdrObject && maCon1.mpConnectedSdrObject == &rBC;
+ bool bObj2 = maCon2.mpConnectedSdrObject && maCon2.mpConnectedSdrObject == &rBC;
+
if (bDying && (bObj1 || bObj2)) {
// #35605# Dying vorher abfangen, damit AttrObj nicht
// wg. vermeintlicher Vorlagenaenderung rumbroadcastet
- if (bObj1) aCon1.pObj=NULL;
- if (bObj2) aCon2.pObj=NULL;
+ if (bObj1) maCon1.mpConnectedSdrObject = 0;
+ if (bObj2) maCon2.mpConnectedSdrObject = 0;
return; // Und mehr braucht hier nicht getan werden.
}
if ( bObj1 || bObj2 )
{
- bEdgeTrackUserDefined = sal_False;
+ mbEdgeTrackUserDefined = false;
}
SdrTextObj::Notify(rBC,rHint);
- if (nNotifyingCount==0) { // Hier nun auch ein VerriegelungsFlag
- ((SdrEdgeObj*)this)->nNotifyingCount++;
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
+ static sal_uInt16 nNotifyingCount = 0;
+
+ if(!nNotifyingCount)
+ {
+ // Hier nun auch ein VerriegelungsFlag
+ nNotifyingCount++;
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
if (bDataChg) { // StyleSheet geaendert
- ImpSetAttrToEdgeInfo(); // Werte bei Vorlagenaenderung vom Pool nach aEdgeInfo kopieren
+ ImpSetAttrToEdgeInfo(); // Werte bei Vorlagenaenderung vom Pool nach maEdgeInfo kopieren
}
+ SdrPage* pOwningPage = getSdrPageFromSdrObject();
if (bDataChg ||
- (bObj1 && aCon1.pObj->GetPage()==pPage) ||
- (bObj2 && aCon2.pObj->GetPage()==pPage) ||
- (pSdrHint && pSdrHint->GetKind()==HINT_OBJREMOVED))
+ (bObj1 && maCon1.mpConnectedSdrObject->getSdrPageFromSdrObject() == pOwningPage) ||
+ (bObj2 && maCon2.mpConnectedSdrObject->getSdrPageFromSdrObject() == pOwningPage) ||
+ (pSdrHint && pSdrHint->GetSdrHintKind()==HINT_OBJREMOVED))
{
// Broadcasting nur, wenn auf der selben Page
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetCurrentBoundRect();
- // #110094#-14 if (!bEdgeTrackDirty) SendRepaintBroadcast();
- ImpDirtyEdgeTrack();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
- // only redraw here, no objectchange
+ ImpDirtyEdgeTrack();
ActionChanged();
- // BroadcastObjectChange();
-
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
- ((SdrEdgeObj*)this)->nNotifyingCount--;
+
+ nNotifyingCount--;
}
}
@@ -1605,33 +1762,21 @@ void __EXPORT SdrEdgeObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
as if the connected objects send a repaint broadcast
#103122#
*/
-void SdrEdgeObj::Reformat()
+void SdrEdgeObj::ReformatEdge()
{
- if( NULL != aCon1.pObj )
+ if(maCon1.mpConnectedSdrObject)
{
SfxSimpleHint aHint( SFX_HINT_DATACHANGED );
- Notify( *const_cast<SfxBroadcaster*>(aCon1.pObj->GetBroadcaster()), aHint );
+ Notify( *maCon1.mpConnectedSdrObject, aHint );
}
- if( NULL != aCon2.pObj )
+ if(maCon2.mpConnectedSdrObject)
{
SfxSimpleHint aHint( SFX_HINT_DATACHANGED );
- Notify( *const_cast<SfxBroadcaster*>(aCon2.pObj->GetBroadcaster()), aHint );
+ Notify( *maCon2.mpConnectedSdrObject, aHint );
}
}
-void SdrEdgeObj::operator=(const SdrObject& rObj)
-{
- SdrTextObj::operator=(rObj);
- *pEdgeTrack =*((SdrEdgeObj&)rObj).pEdgeTrack;
- bEdgeTrackDirty=((SdrEdgeObj&)rObj).bEdgeTrackDirty;
- aCon1 =((SdrEdgeObj&)rObj).aCon1;
- aCon2 =((SdrEdgeObj&)rObj).aCon2;
- aCon1.pObj=NULL;
- aCon2.pObj=NULL;
- aEdgeInfo=((SdrEdgeObj&)rObj).aEdgeInfo;
-}
-
void SdrEdgeObj::TakeObjNameSingul(XubString& rName) const
{
rName=ImpGetResStr(STR_ObjNameSingulEDGE);
@@ -1653,144 +1798,203 @@ void SdrEdgeObj::TakeObjNamePlural(XubString& rName) const
basegfx::B2DPolyPolygon SdrEdgeObj::TakeXorPoly() const
{
- basegfx::B2DPolyPolygon aPolyPolygon;
+ return basegfx::B2DPolyPolygon(GetEdgeTrackPath());
+}
- if (bEdgeTrackDirty)
+void SdrEdgeObj::SetEdgeTrackPath(const basegfx::B2DPolygon& rPoly)
+{
+ if(rPoly.count() > 1)
{
- ((SdrEdgeObj*)this)->ImpRecalcEdgeTrack();
- }
+ maEdgeTrack = rPoly;
+ mbEdgeTrackDirty = false;
+ mbEdgeTrackUserDefined = true;
- if(pEdgeTrack)
+ // #i110629# also set aRect and maSnapeRect dependent from maEdgeTrack
+ const basegfx::B2DRange aPolygonBounds(maEdgeTrack.getB2DRange());
+ sdr::legacy::SetSnapRange(*this, aPolygonBounds);
+ }
+ else
{
- aPolyPolygon.append(pEdgeTrack->getB2DPolygon());
+ mbEdgeTrackDirty = true;
+ mbEdgeTrackUserDefined = false;
}
-
- return aPolyPolygon;
}
-void SdrEdgeObj::SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly )
+basegfx::B2DPolygon SdrEdgeObj::GetEdgeTrackPath() const
{
- if ( !rPoly.count() )
+ if(mbEdgeTrackDirty)
{
- bEdgeTrackDirty = sal_True;
- bEdgeTrackUserDefined = sal_False;
+ const_cast< SdrEdgeObj* >(this)->ImpRecalcEdgeTrack();
}
- else
- {
- *pEdgeTrack = XPolygon( rPoly.getB2DPolygon( 0 ) );
- bEdgeTrackDirty = sal_False;
- bEdgeTrackUserDefined = sal_True;
- // #i110629# also set aRect and maSnapeRect dependent from pEdgeTrack
- const Rectangle aPolygonBounds(pEdgeTrack->GetBoundRect());
- aRect = aPolygonBounds;
- maSnapRect = aPolygonBounds;
- }
+ return maEdgeTrack;
}
-basegfx::B2DPolyPolygon SdrEdgeObj::GetEdgeTrackPath() const
+void SdrEdgeObj::AddToHdlList(SdrHdlList& rHdlList) const
{
- basegfx::B2DPolyPolygon aPolyPolygon;
-
- if (bEdgeTrackDirty)
- ((SdrEdgeObj*)this)->ImpRecalcEdgeTrack();
-
- aPolyPolygon.append( pEdgeTrack->getB2DPolygon() );
+ // due to old object re-use ol methods
+ const sal_uInt32 nCount(impOldGetHdlCount());
- return aPolyPolygon;
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ impOldGetHdl(rHdlList, a);
+ }
}
-sal_uInt32 SdrEdgeObj::GetHdlCount() const
+sal_uInt32 SdrEdgeObj::impOldGetHdlCount() const
{
- SdrEdgeKind eKind=((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue();
- sal_uInt32 nHdlAnz(0L);
- sal_uInt32 nPntAnz(pEdgeTrack->GetPointCount());
+ const SdrEdgeKind eKind(((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue());
+ const sal_uInt32 nPntAnz(maEdgeTrack.count());
+ sal_uInt32 nHdlAnz(0);
if(nPntAnz)
{
- nHdlAnz = 2L;
+ nHdlAnz = 2;
- if ((eKind==SDREDGE_ORTHOLINES || eKind==SDREDGE_BEZIER) && nPntAnz >= 4L)
+ if((SDREDGE_ORTHOLINES == eKind || SDREDGE_BEZIER == eKind) && 4 <= nPntAnz)
{
- sal_uInt32 nO1(aEdgeInfo.nObj1Lines > 0L ? aEdgeInfo.nObj1Lines - 1L : 0L);
- sal_uInt32 nO2(aEdgeInfo.nObj2Lines > 0L ? aEdgeInfo.nObj2Lines - 1L : 0L);
- sal_uInt32 nM(aEdgeInfo.nMiddleLine != 0xFFFF ? 1L : 0L);
+ const sal_uInt32 nO1(maEdgeInfo.nObj1Lines > 0 ? maEdgeInfo.nObj1Lines - 1 : 0);
+ const sal_uInt32 nO2(maEdgeInfo.nObj2Lines > 0 ? maEdgeInfo.nObj2Lines - 1 : 0);
+ const sal_uInt32 nM(maEdgeInfo.nMiddleLine != 0xFFFF ? 1 : 0);
+
nHdlAnz += nO1 + nO2 + nM;
}
- else if (eKind==SDREDGE_THREELINES && nPntAnz == 4L)
+ else if(SDREDGE_THREELINES == eKind && 4 == nPntAnz)
{
- if(GetConnectedNode(sal_True))
+ if(GetConnectedNode(true))
+ {
nHdlAnz++;
+ }
- if(GetConnectedNode(sal_False))
+ if(GetConnectedNode(false))
+ {
nHdlAnz++;
+ }
}
}
return nHdlAnz;
}
-SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const
+SdrHdl* SdrEdgeObj::impOldGetHdl(SdrHdlList& rHdlList, sal_uInt32 nHdlNum) const
{
- SdrHdl* pHdl=NULL;
- sal_uInt32 nPntAnz(pEdgeTrack->GetPointCount());
- if (nPntAnz!=0) {
- if (nHdlNum==0) {
- pHdl=new ImpEdgeHdl((*pEdgeTrack)[0],HDL_POLY);
- if (aCon1.pObj!=NULL && aCon1.bBestVertex) pHdl->Set1PixMore(sal_True);
- } else if (nHdlNum==1) {
- pHdl=new ImpEdgeHdl((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],HDL_POLY);
- if (aCon2.pObj!=NULL && aCon2.bBestVertex) pHdl->Set1PixMore(sal_True);
- } else {
- SdrEdgeKind eKind=((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue();
- if (eKind==SDREDGE_ORTHOLINES || eKind==SDREDGE_BEZIER) {
- sal_uInt32 nO1(aEdgeInfo.nObj1Lines > 0L ? aEdgeInfo.nObj1Lines - 1L : 0L);
- sal_uInt32 nO2(aEdgeInfo.nObj2Lines > 0L ? aEdgeInfo.nObj2Lines - 1L : 0L);
- sal_uInt32 nM(aEdgeInfo.nMiddleLine != 0xFFFF ? 1L : 0L);
- sal_uInt32 nNum(nHdlNum - 2L);
- sal_Int32 nPt(0L);
- pHdl=new ImpEdgeHdl(Point(),HDL_POLY);
- if (nNum<nO1) {
- nPt=nNum+1L;
- if (nNum==0) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ1LINE2);
- if (nNum==1) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ1LINE3);
- } else {
- nNum=nNum-nO1;
- if (nNum<nO2) {
- nPt=nPntAnz-3-nNum;
- if (nNum==0) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ2LINE2);
- if (nNum==1) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ2LINE3);
- } else {
- nNum=nNum-nO2;
- if (nNum<nM) {
- nPt=aEdgeInfo.nMiddleLine;
- ((ImpEdgeHdl*)pHdl)->SetLineCode(MIDDLELINE);
+ SdrHdl* pHdl = 0;
+ const sal_uInt32 nPntAnz(maEdgeTrack.count());
+
+ if(nPntAnz)
+ {
+ if(!nHdlNum)
+ {
+ pHdl = new ImpEdgeHdl(rHdlList, *this, HDL_POLY, maEdgeTrack.getB2DPoint(0));
+
+ if(maCon1.mpConnectedSdrObject && maCon1.mbBestVertex)
+ {
+ pHdl->Set1PixMore(true);
+ }
+ }
+ else if(1 == nHdlNum)
+ {
+ pHdl = new ImpEdgeHdl(rHdlList, *this, HDL_POLY, maEdgeTrack.getB2DPoint(nPntAnz - 1));
+
+ if(maCon2.mpConnectedSdrObject && maCon2.mbBestVertex)
+ {
+ pHdl->Set1PixMore(true);
+ }
+ }
+ else
+ {
+ const SdrEdgeKind eKind(((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue());
+
+ if(SDREDGE_ORTHOLINES == eKind || SDREDGE_BEZIER == eKind)
+ {
+ const sal_uInt32 nO1(maEdgeInfo.nObj1Lines > 0 ? maEdgeInfo.nObj1Lines - 1 : 0);
+ const sal_uInt32 nO2(maEdgeInfo.nObj2Lines > 0 ? maEdgeInfo.nObj2Lines - 1 : 0);
+ const sal_uInt32 nM(maEdgeInfo.nMiddleLine != 0xFFFF ? 1 : 0);
+ sal_uInt32 nNum(nHdlNum - 2);
+ sal_Int32 nPt(0);
+ SdrEdgeLineCode aSdrEdgeLineCode(OBJ1LINE2);
+
+ if(nNum < nO1)
+ {
+ nPt = nNum + 1;
+
+ if(0 == nNum)
+ {
+ aSdrEdgeLineCode = OBJ1LINE2;
+ }
+
+ if(1 == nNum)
+ {
+ aSdrEdgeLineCode = OBJ1LINE3;
+ }
+ }
+ else
+ {
+ nNum = nNum - nO1;
+
+ if(nNum < nO2)
+ {
+ nPt = nPntAnz - 3 - nNum;
+
+ if(0 == nNum)
+ {
+ aSdrEdgeLineCode = OBJ2LINE2;
+ }
+
+ if(1 == nNum)
+ {
+ aSdrEdgeLineCode = OBJ2LINE3;
+ }
+ }
+ else
+ {
+ nNum = nNum - nO2;
+
+ if(nNum < nM)
+ {
+ nPt = maEdgeInfo.nMiddleLine;
+ aSdrEdgeLineCode = MIDDLELINE;
}
}
}
- if (nPt>0) {
- Point aPos((*pEdgeTrack)[(sal_uInt16)nPt]);
- aPos+=(*pEdgeTrack)[(sal_uInt16)nPt+1];
- aPos.X()/=2;
- aPos.Y()/=2;
- pHdl->SetPos(aPos);
- } else {
- delete pHdl;
- pHdl=NULL;
+
+ if(nPt > 0)
+ {
+ ImpEdgeHdl* pImpEdgeHdl = new ImpEdgeHdl(rHdlList, *this, HDL_POLY, (maEdgeTrack.getB2DPoint(nPt) + maEdgeTrack.getB2DPoint(nPt + 1)) * 0.5);
+ pHdl = pImpEdgeHdl;
+ pImpEdgeHdl->SetLineCode(aSdrEdgeLineCode);
}
- } else if (eKind==SDREDGE_THREELINES) {
+ }
+ else if(SDREDGE_THREELINES == eKind)
+ {
sal_uInt32 nNum(nHdlNum);
- if (GetConnectedNode(sal_True)==NULL) nNum++;
- Point aPos((*pEdgeTrack)[(sal_uInt16)nNum-1]);
- pHdl=new ImpEdgeHdl(aPos,HDL_POLY);
- if (nNum==2) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ1LINE2);
- if (nNum==3) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ2LINE2);
+
+ if(!GetConnectedNode(true))
+ {
+ nNum++;
+ }
+
+ ImpEdgeHdl* pImpEdgeHdl = new ImpEdgeHdl(rHdlList, *this, HDL_POLY, maEdgeTrack.getB2DPoint(nNum - 1));
+ pHdl = pImpEdgeHdl;
+
+ if(2 == nNum)
+ {
+ pImpEdgeHdl->SetLineCode(OBJ1LINE2);
+ }
+
+ if(3 == nNum)
+ {
+ pImpEdgeHdl->SetLineCode(OBJ2LINE2);
+ }
}
}
- if (pHdl!=NULL) {
+
+ if(pHdl)
+ {
pHdl->SetPointNum(nHdlNum);
}
}
+
return pHdl;
}
@@ -1804,7 +2008,7 @@ bool SdrEdgeObj::hasSpecialDrag() const
SdrObject* SdrEdgeObj::getFullDragClone() const
{
// use Clone operator
- SdrEdgeObj* pRetval = (SdrEdgeObj*)Clone();
+ SdrEdgeObj* pRetval = static_cast< SdrEdgeObj* >(CloneSdrObject());
// copy connections for clone, SdrEdgeObj::operator= does not do this
pRetval->ConnectToNode(true, GetConnectedNode(true));
@@ -1815,12 +2019,12 @@ SdrObject* SdrEdgeObj::getFullDragClone() const
bool SdrEdgeObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- if(!rDrag.GetHdl())
+ if(!rDrag.GetActiveHdl())
return false;
rDrag.SetEndDragChangesAttributes(true);
- if(rDrag.GetHdl()->GetPointNum() < 2)
+ if(rDrag.GetActiveHdl()->GetPointNum() < 2)
{
rDrag.SetNoSnap(true);
}
@@ -1830,7 +2034,7 @@ bool SdrEdgeObj::beginSpecialDrag(SdrDragStat& rDrag) const
bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat)
{
- SdrEdgeObj* pOriginalEdge = dynamic_cast< SdrEdgeObj* >(rDragStat.GetHdl()->GetObj());
+ const SdrEdgeObj* pOriginalEdge = dynamic_cast< const SdrEdgeObj* >(rDragStat.GetActiveHdl()->GetObj());
const bool bOriginalEdgeModified(pOriginalEdge == this);
if(!bOriginalEdgeModified && pOriginalEdge)
@@ -1843,86 +2047,82 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat)
ConnectToNode(false, pOriginalEdge->GetConnection(false).GetObject());
}
- if(rDragStat.GetHdl()->GetPointNum() < 2)
+ if(rDragStat.GetActiveHdl()->GetPointNum() < 2)
{
// start or end point connector drag
- const bool bDragA(0 == rDragStat.GetHdl()->GetPointNum());
- const Point aPointNow(rDragStat.GetNow());
+ const bool bDragA(0 == rDragStat.GetActiveHdl()->GetPointNum());
+ const basegfx::B2DPoint aPointNow(rDragStat.GetNow());
+ SdrView& rSdrView = rDragStat.GetSdrViewFromSdrDragStat();
- if(rDragStat.GetPageView())
+ if(rSdrView.GetSdrPageView())
{
- SdrObjConnection* pDraggedOne(bDragA ? &aCon1 : &aCon2);
+ SdrObjConnection* pDraggedOne(bDragA ? &maCon1 : &maCon2);
// clear connection
DisconnectFromNode(bDragA);
// look for new connection
- ImpFindConnector(aPointNow, *rDragStat.GetPageView(), *pDraggedOne, pOriginalEdge);
+ FindConnector(aPointNow, rSdrView, *pDraggedOne, pOriginalEdge);
- if(pDraggedOne->pObj)
+ if(pDraggedOne->mpConnectedSdrObject)
{
- // if found, officially connect to it; ImpFindConnector only
- // sets pObj hard
- SdrObject* pNewConnection = pDraggedOne->pObj;
- pDraggedOne->pObj = 0;
+ // if found, officially connect to it; FindConnector only
+ // sets mpConnectedSdrObject hard
+ SdrObject* pNewConnection = pDraggedOne->mpConnectedSdrObject;
+ pDraggedOne->mpConnectedSdrObject = 0;
ConnectToNode(bDragA, pNewConnection);
}
- if(rDragStat.GetView() && !bOriginalEdgeModified)
+ if(!bOriginalEdgeModified)
{
// show IA helper, but only do this during IA, so not when the original
// Edge gets modified in the last call
- rDragStat.GetView()->SetConnectMarker(*pDraggedOne, *rDragStat.GetPageView());
+ rDragStat.GetSdrViewFromSdrDragStat().SetConnectMarker(*pDraggedOne);
}
}
- if(pEdgeTrack)
+ // change maEdgeTrack to modified position
+ if(bDragA)
{
- // change pEdgeTrack to modified position
- if(bDragA)
- {
- (*pEdgeTrack)[0] = aPointNow;
- }
- else
- {
- (*pEdgeTrack)[sal_uInt16(pEdgeTrack->GetPointCount()-1)] = aPointNow;
- }
+ maEdgeTrack.setB2DPoint(0, aPointNow);
+ }
+ else
+ {
+ maEdgeTrack.setB2DPoint(maEdgeTrack.count() - 1, aPointNow);
}
// reset edge info's offsets, this is a end point drag
- aEdgeInfo.aObj1Line2 = Point();
- aEdgeInfo.aObj1Line3 = Point();
- aEdgeInfo.aObj2Line2 = Point();
- aEdgeInfo.aObj2Line3 = Point();
- aEdgeInfo.aMiddleLine = Point();
+ maEdgeInfo.aObj1Line2 = maEdgeInfo.aObj1Line3 = maEdgeInfo.aObj2Line2 = maEdgeInfo.aObj2Line3 = maEdgeInfo.aMiddleLine = basegfx::B2DPoint();
}
else
{
// control point connector drag
- const ImpEdgeHdl* pEdgeHdl = (ImpEdgeHdl*)rDragStat.GetHdl();
- const SdrEdgeLineCode eLineCode = pEdgeHdl->GetLineCode();
- const Point aDist(rDragStat.GetNow() - rDragStat.GetStart());
- sal_Int32 nDist(pEdgeHdl->IsHorzDrag() ? aDist.X() : aDist.Y());
+ const ImpEdgeHdl* pEdgeHdl = dynamic_cast< const ImpEdgeHdl* >(rDragStat.GetActiveHdl());
+
+ if(pEdgeHdl)
+ {
+ const SdrEdgeLineCode eLineCode = pEdgeHdl->GetLineCode();
+ const basegfx::B2DPoint aDist(rDragStat.GetNow() - rDragStat.GetStart());
+ sal_Int32 nDist(basegfx::fround(pEdgeHdl->IsHorzDrag() ? aDist.getX() : aDist.getY()));
- nDist += aEdgeInfo.ImpGetLineVersatz(eLineCode, *pEdgeTrack);
- aEdgeInfo.ImpSetLineVersatz(eLineCode, *pEdgeTrack, nDist);
+ nDist += maEdgeInfo.ImpGetLineVersatz(eLineCode, maEdgeTrack.count());
+ maEdgeInfo.ImpSetLineVersatz(eLineCode, maEdgeTrack.count(), nDist);
+ }
}
// force recalc EdgeTrack
- *pEdgeTrack = ImpCalcEdgeTrack(*pEdgeTrack, aCon1, aCon2, &aEdgeInfo);
- bEdgeTrackDirty=sal_False;
+ maEdgeTrack = ImpCalcEdgeTrack(maCon1, maCon2, &maEdgeInfo);
+ mbEdgeTrackDirty = false;
// save EdgeInfos and mark object as user modified
ImpSetEdgeInfoToAttr();
- bEdgeTrackUserDefined = false;
- SetRectsDirty();
- //SetChanged();
+ mbEdgeTrackUserDefined = false;
- if(bOriginalEdgeModified && rDragStat.GetView())
+ if(bOriginalEdgeModified)
{
// hide connect marker helper again when original gets changed.
// This happens at the end of the interaction
- rDragStat.GetView()->HideConnectMarker();
+ rDragStat.GetSdrViewFromSdrDragStat().HideConnectMarker();
}
return true;
@@ -1930,7 +2130,7 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat)
String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
+ const bool bCreateComment(this == rDrag.GetSdrViewFromSdrDragStat().GetCreateObj());
if(bCreateComment)
{
@@ -1939,7 +2139,7 @@ String SdrEdgeObj::getSpecialDragComment(const SdrDragStat& rDrag) const
else
{
XubString aStr;
- ImpTakeDescriptionStr(STR_DragEdgeTail, aStr);
+ TakeMarkedDescriptionString(STR_DragEdgeTail, aStr);
return aStr;
}
@@ -1953,481 +2153,445 @@ basegfx::B2DPolygon SdrEdgeObj::ImplAddConnectorOverlay(SdrDragMethod& rDragMeth
if(bDetail)
{
- SdrObjConnection aMyCon1(aCon1);
- SdrObjConnection aMyCon2(aCon2);
+ SdrObjConnection aMyCon1(maCon1);
+ SdrObjConnection aMyCon2(maCon2);
if (bTail1)
{
- const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aMyCon1.aObjOfs.X(), aMyCon1.aObjOfs.Y()));
- aMyCon1.aObjOfs.X() = basegfx::fround(aTemp.getX());
- aMyCon1.aObjOfs.Y() = basegfx::fround(aTemp.getY());
+ aMyCon1.maObjOfs *= rDragMethod.getCurrentTransformation();
}
if (bTail2)
{
- const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aMyCon2.aObjOfs.X(), aMyCon2.aObjOfs.Y()));
- aMyCon2.aObjOfs.X() = basegfx::fround(aTemp.getX());
- aMyCon2.aObjOfs.Y() = basegfx::fround(aTemp.getY());
+ aMyCon2.maObjOfs *= rDragMethod.getCurrentTransformation();
}
- SdrEdgeInfoRec aInfo(aEdgeInfo);
- XPolygon aXP(ImpCalcEdgeTrack(*pEdgeTrack, aMyCon1, aMyCon2, &aInfo));
-
- if(aXP.GetPointCount())
- {
- aResult = aXP.getB2DPolygon();
- }
+ SdrEdgeInfoRec aInfo(maEdgeInfo);
+ aResult = ImpCalcEdgeTrack(aMyCon1, aMyCon2, &aInfo);
}
else
{
- Point aPt1((*pEdgeTrack)[0]);
- Point aPt2((*pEdgeTrack)[sal_uInt16(pEdgeTrack->GetPointCount() - 1)]);
+ basegfx::B2DPoint aPt1(maEdgeTrack.getB2DPoint(0));
+ basegfx::B2DPoint aPt2(maEdgeTrack.getB2DPoint(maEdgeTrack.count() - 1));
- if (aCon1.pObj && (aCon1.bBestConn || aCon1.bBestVertex))
- aPt1 = aCon1.pObj->GetSnapRect().Center();
+ if (maCon1.mpConnectedSdrObject && (maCon1.mbBestConnection || maCon1.mbBestVertex))
+ {
+ aPt1 = sdr::legacy::GetSnapRange(*maCon1.mpConnectedSdrObject).getCenter();
+ }
- if (aCon2.pObj && (aCon2.bBestConn || aCon2.bBestVertex))
- aPt2 = aCon2.pObj->GetSnapRect().Center();
+ if (maCon2.mpConnectedSdrObject && (maCon2.mbBestConnection || maCon2.mbBestVertex))
+ {
+ aPt2 = sdr::legacy::GetSnapRange(*maCon2.mpConnectedSdrObject).getCenter();
+ }
if (bTail1)
{
- const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aPt1.X(), aPt1.Y()));
- aPt1.X() = basegfx::fround(aTemp.getX());
- aPt1.Y() = basegfx::fround(aTemp.getY());
+ aPt1 *= rDragMethod.getCurrentTransformation();
}
if (bTail2)
{
- const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aPt2.X(), aPt2.Y()));
- aPt2.X() = basegfx::fround(aTemp.getX());
- aPt2.Y() = basegfx::fround(aTemp.getY());
+ aPt2 *= rDragMethod.getCurrentTransformation();
}
- aResult.append(basegfx::B2DPoint(aPt1.X(), aPt1.Y()));
- aResult.append(basegfx::B2DPoint(aPt2.X(), aPt2.Y()));
+ aResult.append(aPt1);
+ aResult.append(aPt2);
}
return aResult;
}
-FASTBOOL SdrEdgeObj::BegCreate(SdrDragStat& rDragStat)
+bool SdrEdgeObj::BegCreate(SdrDragStat& rDragStat)
{
- rDragStat.SetNoSnap(sal_True);
- pEdgeTrack->SetPointCount(2);
- (*pEdgeTrack)[0]=rDragStat.GetStart();
- (*pEdgeTrack)[1]=rDragStat.GetNow();
- if (rDragStat.GetPageView()!=NULL) {
- ImpFindConnector(rDragStat.GetStart(),*rDragStat.GetPageView(),aCon1,this);
- ConnectToNode(sal_True,aCon1.pObj);
+ rDragStat.SetNoSnap(true);
+ maEdgeTrack.clear();
+ maEdgeTrack.append(rDragStat.GetStart());
+ maEdgeTrack.append(rDragStat.GetNow());
+
+ SdrView& rSdrView = rDragStat.GetSdrViewFromSdrDragStat();
+
+ if(rSdrView.GetSdrPageView())
+ {
+ FindConnector(rDragStat.GetStart(), rSdrView, maCon1, this);
+ ConnectToNode(true, maCon1.mpConnectedSdrObject);
}
- *pEdgeTrack=ImpCalcEdgeTrack(*pEdgeTrack,aCon1,aCon2,&aEdgeInfo);
- return sal_True;
+
+ maEdgeTrack = ImpCalcEdgeTrack(maCon1, maCon2, &maEdgeInfo);
+
+ return true;
}
-FASTBOOL SdrEdgeObj::MovCreate(SdrDragStat& rDragStat)
+bool SdrEdgeObj::MovCreate(SdrDragStat& rDragStat)
{
- sal_uInt16 nMax=pEdgeTrack->GetPointCount();
- (*pEdgeTrack)[nMax-1]=rDragStat.GetNow();
- if (rDragStat.GetPageView()!=NULL) {
- ImpFindConnector(rDragStat.GetNow(),*rDragStat.GetPageView(),aCon2,this);
- rDragStat.GetView()->SetConnectMarker(aCon2,*rDragStat.GetPageView());
+ maEdgeTrack.setB2DPoint(maEdgeTrack.count() - 1, rDragStat.GetNow());
+
+ SdrView& rSdrView = rDragStat.GetSdrViewFromSdrDragStat();
+
+ if(rSdrView.GetSdrPageView())
+ {
+ FindConnector(rDragStat.GetNow(), rSdrView, maCon2, this);
+ rDragStat.GetSdrViewFromSdrDragStat().SetConnectMarker(maCon2);
+
}
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- ConnectToNode(sal_False,aCon2.pObj);
- *pEdgeTrack=ImpCalcEdgeTrack(*pEdgeTrack,aCon1,aCon2,&aEdgeInfo);
- bEdgeTrackDirty=sal_False;
- return sal_True;
+
+ ActionChanged();
+ ConnectToNode(false, maCon2.mpConnectedSdrObject);
+ maEdgeTrack = ImpCalcEdgeTrack(maCon1, maCon2, &maEdgeInfo);
+ mbEdgeTrackDirty = false;
+
+ return true;
}
-FASTBOOL SdrEdgeObj::EndCreate(SdrDragStat& rDragStat, SdrCreateCmd eCmd)
+bool SdrEdgeObj::EndCreate(SdrDragStat& rDragStat, SdrCreateCmd eCmd)
{
- FASTBOOL bOk=(eCmd==SDRCREATE_FORCEEND || rDragStat.GetPointAnz()>=2);
- if (bOk) {
- ConnectToNode(sal_True,aCon1.pObj);
- ConnectToNode(sal_False,aCon2.pObj);
- if (rDragStat.GetView()!=NULL) {
- rDragStat.GetView()->HideConnectMarker();
- }
- ImpSetEdgeInfoToAttr(); // Die Werte aus aEdgeInfo in den Pool kopieren
+ const bool bOk(SDRCREATE_FORCEEND == eCmd || rDragStat.GetPointAnz() >= 2);
+
+ if(bOk)
+ {
+ ConnectToNode(true, maCon1.mpConnectedSdrObject);
+ ConnectToNode(false, maCon2.mpConnectedSdrObject);
+ rDragStat.GetSdrViewFromSdrDragStat().HideConnectMarker();
+ ImpSetEdgeInfoToAttr(); // Die Werte aus maEdgeInfo in den Pool kopieren
}
- SetRectsDirty();
+
+ ActionChanged();
+
return bOk;
}
-FASTBOOL SdrEdgeObj::BckCreate(SdrDragStat& rDragStat)
+bool SdrEdgeObj::BckCreate(SdrDragStat& rDragStat)
{
- if (rDragStat.GetView()!=NULL) {
- rDragStat.GetView()->HideConnectMarker();
- }
- return sal_False;
+ rDragStat.GetSdrViewFromSdrDragStat().HideConnectMarker();
+
+ return false;
}
void SdrEdgeObj::BrkCreate(SdrDragStat& rDragStat)
{
- if (rDragStat.GetView()!=NULL) {
- rDragStat.GetView()->HideConnectMarker();
- }
+ rDragStat.GetSdrViewFromSdrDragStat().HideConnectMarker();
}
basegfx::B2DPolyPolygon SdrEdgeObj::TakeCreatePoly(const SdrDragStat& /*rStatDrag*/) const
{
- basegfx::B2DPolyPolygon aRetval;
- aRetval.append(pEdgeTrack->getB2DPolygon());
- return aRetval;
+ return basegfx::B2DPolyPolygon(maEdgeTrack);
}
-Pointer SdrEdgeObj::GetCreatePointer() const
+Pointer SdrEdgeObj::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
return Pointer(POINTER_DRAW_CONNECT);
}
-FASTBOOL SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut)
+void SdrEdgeObj::FindConnector(
+ const basegfx::B2DPoint& rPt,
+ const SdrView& rSdrView,
+ SdrObjConnection& rCon,
+ const SdrEdgeObj* pThis,
+ OutputDevice* pOut)
{
rCon.ResetVars();
- if (pOut==NULL) pOut=rPV.GetView().GetFirstOutputDevice(); // GetWin(0);
- if (pOut==NULL) return sal_False;
- SdrObjList* pOL=rPV.GetObjList();
- const SetOfByte& rVisLayer=rPV.GetVisibleLayers();
- // Sensitiver Bereich der Konnektoren ist doppelt so gross wie die Handles:
- sal_uInt16 nMarkHdSiz=rPV.GetView().GetMarkHdlSizePixel();
- Size aHalfConSiz(nMarkHdSiz,nMarkHdSiz);
- aHalfConSiz=pOut->PixelToLogic(aHalfConSiz);
- Size aHalfCenterSiz(2*aHalfConSiz.Width(),2*aHalfConSiz.Height());
- Rectangle aMouseRect(rPt,rPt);
- aMouseRect.Left() -=aHalfConSiz.Width();
- aMouseRect.Top() -=aHalfConSiz.Height();
- aMouseRect.Right() +=aHalfConSiz.Width();
- aMouseRect.Bottom()+=aHalfConSiz.Height();
- sal_uInt16 nBoundHitTol=(sal_uInt16)aHalfConSiz.Width()/2; if (nBoundHitTol==0) nBoundHitTol=1;
- sal_uIntPtr no=pOL->GetObjCount();
- FASTBOOL bFnd=sal_False;
- SdrObjConnection aTestCon;
- SdrObjConnection aBestCon;
- FASTBOOL bTestBoundHit=sal_False;
- //int bBestBoundHit=sal_False;
-
- while (no>0 && !bFnd) {
- // Problem: Gruppenobjekt mit verschiedenen Layern liefert LayerID 0 !!!!
- no--;
- SdrObject* pObj=pOL->GetObj(no);
- if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() && // only visible objects
- (pThis==NULL || pObj!=(SdrObject*)pThis) && // nicht an mich selbst connecten
- pObj->IsNode())
- {
- Rectangle aObjBound(pObj->GetCurrentBoundRect());
- if (aObjBound.IsOver(aMouseRect)) {
- aTestCon.ResetVars();
- bTestBoundHit=sal_False;
- FASTBOOL bEdge=HAS_BASE(SdrEdgeObj,pObj); // kein BestCon fuer Edge
- // Die Userdefined Konnektoren haben absolute Prioritaet.
- // Danach kommt Vertex, Corner und Mitte(Best) gleich priorisiert.
- // Zum Schluss kommt noch ein HitTest aufs Obj.
- const SdrGluePointList* pGPL=pObj->GetGluePointList();
- sal_uInt16 nConAnz=pGPL==NULL ? 0 : pGPL->GetCount();
- sal_uInt16 nGesAnz=nConAnz+9;
- FASTBOOL bUserFnd=sal_False;
- sal_uIntPtr nBestDist=0xFFFFFFFF;
- for (sal_uInt16 i=0; i<nGesAnz; i++)
+
+ if(rSdrView.GetSdrPageView())
+ {
+ if(!pOut)
+ pOut = rSdrView.GetFirstOutputDevice(); // GetWin(0);
+
+ if (!pOut)
+ return;
+
+ const Point aPt(basegfx::fround(rPt.getX()), basegfx::fround(rPt.getY()));
+ SdrObjList* pOL = rSdrView.GetSdrPageView()->GetCurrentObjectList();
+ const SetOfByte& rVisLayer = rSdrView.GetSdrPageView()->GetVisibleLayers();
+ // Sensitiver Bereich der Konnektoren ist doppelt so gross wie die Handles:
+ sal_uInt16 nMarkHdSiz = rSdrView.GetMarkHdlSizePixel();
+ Size aHalfConSiz(nMarkHdSiz,nMarkHdSiz);
+ aHalfConSiz=pOut->PixelToLogic(aHalfConSiz);
+ Size aHalfCenterSiz(2*aHalfConSiz.Width(),2*aHalfConSiz.Height());
+ Rectangle aMouseRect(aPt,aPt);
+ aMouseRect.Left() -=aHalfConSiz.Width();
+ aMouseRect.Top() -=aHalfConSiz.Height();
+ aMouseRect.Right() +=aHalfConSiz.Width();
+ aMouseRect.Bottom()+=aHalfConSiz.Height();
+ sal_uInt16 nBoundHitTol=(sal_uInt16)aHalfConSiz.Width()/2; if (nBoundHitTol==0) nBoundHitTol=1;
+ sal_uInt32 no=pOL->GetObjCount();
+ bool bFnd=false;
+ SdrObjConnection aTestCon;
+ SdrObjConnection aBestCon;
+ bool bTestBoundHit=false;
+ //bool bBestBoundHit=false;
+
+ while (no>0 && !bFnd)
+ {
+ // Problem: Gruppenobjekt mit verschiedenen Layern liefert LayerID 0 !!!!
+ no--;
+ SdrObject* pObj = pOL->GetObj(no);
+ if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() && // only visible objects
+ (pThis==NULL || pObj != pThis)) // nicht an mich selbst connecten
+ {
+ Rectangle aObjBound(sdr::legacy::GetBoundRect(*pObj));
+ if (aObjBound.IsOver(aMouseRect))
{
- FASTBOOL bUser=i<nConAnz;
- FASTBOOL bVertex=i>=nConAnz+0 && i<nConAnz+4;
- FASTBOOL bCorner=i>=nConAnz+4 && i<nConAnz+8;
- FASTBOOL bCenter=i==nConAnz+8;
- FASTBOOL bOk=sal_False;
- Point aConPos;
- sal_uInt16 nConNum=i;
- if (bUser) {
- const SdrGluePoint& rGP=(*pGPL)[nConNum];
- aConPos=rGP.GetAbsolutePos(*pObj);
- nConNum=rGP.GetId();
- bOk=sal_True;
- } else if (bVertex && !bUserFnd) {
- nConNum=nConNum-nConAnz;
- if (rPV.GetView().IsAutoVertexConnectors()) {
- SdrGluePoint aPt(pObj->GetVertexGluePoint(nConNum));
- aConPos=aPt.GetAbsolutePos(*pObj);
- bOk=sal_True;
- } else i+=3;
- } else if (bCorner && !bUserFnd) {
- nConNum-=nConAnz+4;
- if (rPV.GetView().IsAutoCornerConnectors()) {
- SdrGluePoint aPt(pObj->GetCornerGluePoint(nConNum));
- aConPos=aPt.GetAbsolutePos(*pObj);
- bOk=sal_True;
- } else i+=3;
+ aTestCon.ResetVars();
+ bTestBoundHit=false;
+ const bool bEdge(pObj->IsSdrEdgeObj()); // kein BestCon fuer Edge
+ // Die Userdefined Konnektoren haben absolute Prioritaet.
+ // Danach kommt Vertex, Corner und Mitte(Best) gleich priorisiert.
+ // Zum Schluss kommt noch ein HitTest aufs Obj.
+ const SdrGluePointList* pGPL = pObj->GetGluePointList();
+ sal_uInt32 nConAnz=pGPL==NULL ? 0 : pGPL->GetCount();
+ sal_uInt32 nGesAnz=nConAnz+9;
+ bool bUserFnd=false;
+ sal_uInt32 nBestDist=0xFFFFFFFF;
+ for (sal_uInt32 i=0; i<nGesAnz; i++)
+ {
+ bool bUser=i<nConAnz;
+ bool bVertex=i>=nConAnz+0 && i<nConAnz+4;
+ bool bCenter=i==nConAnz+4;
+ bool bOk=false;
+ Point aConPos;
+ sal_uInt32 nConNum=i;
+
+ if(bUser)
+ {
+ const SdrGluePoint& rGP=(*pGPL)[nConNum];
+ const basegfx::B2DPoint aPoint(rGP.GetAbsolutePos(sdr::legacy::GetSnapRange(*pObj)));
+ aConPos=Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()));
+ nConNum=rGP.GetId();
+ bOk=true;
+ }
+ else if (bVertex && !bUserFnd)
+ {
+ nConNum=nConNum-nConAnz;
+ SdrGluePoint aLocalPt(pObj->GetVertexGluePoint(nConNum));
+ const basegfx::B2DPoint aPoint(aLocalPt.GetAbsolutePos(sdr::legacy::GetSnapRange(*pObj)));
+ aConPos=Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()));
+ bOk=true;
+ }
+ else if (bCenter && !bUserFnd && !bEdge)
+ {
+ // #109007#
+ // Suppress default connect at object center
+ if(!pThis || !pThis->GetSuppressDefaultConnect())
+ {
+ // Edges nicht!
+ nConNum=0;
+ aConPos=aObjBound.Center();
+ bOk=true;
+ }
+ }
+ if (bOk && aMouseRect.IsInside(aConPos))
+ {
+ if (bUser) bUserFnd=true;
+ bFnd=true;
+ sal_uInt32 nDist=(sal_uInt32)Abs(aConPos.X()-aPt.X())+(sal_uInt32)Abs(aConPos.Y()-aPt.Y());
+
+ if (nDist<nBestDist)
+ {
+ nBestDist = nDist;
+ aTestCon.mpConnectedSdrObject = pObj;
+ aTestCon.mnConnectorId = nConNum;
+ aTestCon.mbAutoVertex = bVertex;
+ aTestCon.mbBestConnection = false; // bCenter;
+ aTestCon.mbBestVertex = bCenter;
+ }
+ }
}
- else if (bCenter && !bUserFnd && !bEdge)
+ // Falls kein Konnektor getroffen wird nochmal
+ // HitTest versucht fuer BestConnector (=bCenter)
+ const basegfx::B2DPoint aHitTestPos(aPt.X(), aPt.Y());
+ if(!bFnd &&
+ !bEdge &&
+ SdrObjectPrimitiveHit(*pObj, aHitTestPos, nBoundHitTol, rSdrView, false, 0))
{
// #109007#
- // Suppress default connect at object center
+ // Suppress default connect at object inside bound
if(!pThis || !pThis->GetSuppressDefaultConnect())
{
- // Edges nicht!
- nConNum=0;
- aConPos=aObjBound.Center();
- bOk=sal_True;
- }
- }
- if (bOk && aMouseRect.IsInside(aConPos)) {
- if (bUser) bUserFnd=sal_True;
- bFnd=sal_True;
- sal_uIntPtr nDist=(sal_uIntPtr)Abs(aConPos.X()-rPt.X())+(sal_uIntPtr)Abs(aConPos.Y()-rPt.Y());
- if (nDist<nBestDist) {
- nBestDist=nDist;
- aTestCon.pObj=pObj;
- aTestCon.nConId=nConNum;
- aTestCon.bAutoCorner=bCorner;
- aTestCon.bAutoVertex=bVertex;
- aTestCon.bBestConn=sal_False; // bCenter;
- aTestCon.bBestVertex=bCenter;
+ bFnd = true;
+ aTestCon.mpConnectedSdrObject = pObj;
+ aTestCon.mbBestConnection = true;
}
}
- }
- // Falls kein Konnektor getroffen wird nochmal
- // HitTest versucht fuer BestConnector (=bCenter)
- if(!bFnd &&
- !bEdge &&
- SdrObjectPrimitiveHit(*pObj, rPt, nBoundHitTol, rPV, &rVisLayer, false))
- {
- // #109007#
- // Suppress default connect at object inside bound
- if(!pThis || !pThis->GetSuppressDefaultConnect())
+ if (bFnd)
{
- bFnd=sal_True;
- aTestCon.pObj=pObj;
- aTestCon.bBestConn=sal_True;
+ Rectangle aMouseRect2(aPt,aPt);
+ aMouseRect.Left() -=nBoundHitTol;
+ aMouseRect.Top() -=nBoundHitTol;
+ aMouseRect.Right() +=nBoundHitTol;
+ aMouseRect.Bottom()+=nBoundHitTol;
+ bTestBoundHit=aObjBound.IsOver(aMouseRect2);
}
}
- if (bFnd) {
- Rectangle aMouseRect2(rPt,rPt);
- aMouseRect.Left() -=nBoundHitTol;
- aMouseRect.Top() -=nBoundHitTol;
- aMouseRect.Right() +=nBoundHitTol;
- aMouseRect.Bottom()+=nBoundHitTol;
- bTestBoundHit=aObjBound.IsOver(aMouseRect2);
- }
-
}
}
+
+ rCon=aTestCon;
}
- rCon=aTestCon;
- return bFnd;
}
-void SdrEdgeObj::NbcSetSnapRect(const Rectangle& rRect)
+const basegfx::B2DHomMatrix& SdrEdgeObj::getSdrObjectTransformation() const
{
- const Rectangle aOld(GetSnapRect());
+ return SdrTextObj::getSdrObjectTransformation();
+}
+
+void SdrEdgeObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
+{
+ // #54102# handle start and end point if not connected
+ const bool bCon1(maCon1.mpConnectedSdrObject && maCon1.mpConnectedSdrObject->getSdrPageFromSdrObject() == getSdrPageFromSdrObject());
+ const bool bCon2(maCon2.mpConnectedSdrObject && maCon2.mpConnectedSdrObject->getSdrPageFromSdrObject() == getSdrPageFromSdrObject());
+ const sal_uInt32 nCount(maEdgeTrack.count());
+ const bool bApplyTransform(nCount && (!bCon1 || !bCon2 || mbEdgeTrackUserDefined));
+ basegfx::B2DHomMatrix aCompleteTransform;
+
+ if(bApplyTransform)
+ {
+ // get old transform and invert
+ aCompleteTransform = getSdrObjectTransformation();
+ aCompleteTransform.invert();
+ }
+
+ // call parent, set new transform
+ SdrTextObj::setSdrObjectTransformation(rTransformation);
- if(aOld != rRect)
+ if(bApplyTransform)
{
- if(aRect.IsEmpty() && 0 == pEdgeTrack->GetPointCount())
+ // multiply current transform (after change) to get full change
+ aCompleteTransform = getSdrObjectTransformation() * aCompleteTransform;
+
+ if(mbEdgeTrackUserDefined)
{
- // #i110629# When initializing, do not scale on empty Rectangle; this
- // will mirror the underlying text object (!)
- aRect = rRect;
- maSnapRect = rRect;
+ // #120437# special handling when track is user defined
+ maEdgeTrack.transform(aCompleteTransform);
}
else
{
- long nMulX = rRect.Right() - rRect.Left();
- long nDivX = aOld.Right() - aOld.Left();
- long nMulY = rRect.Bottom() - rRect.Top();
- long nDivY = aOld.Bottom() - aOld.Top();
- if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; }
- if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; }
- Fraction aX(nMulX, nDivX);
- Fraction aY(nMulY, nDivY);
- NbcResize(aOld.TopLeft(), aX, aY);
- NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top()));
+ if(!bCon1)
+ {
+ // transform first point
+ maEdgeTrack.setB2DPoint(0, aCompleteTransform * maEdgeTrack.getB2DPoint(0));
+ ImpDirtyEdgeTrack();
+ }
+
+ if(!bCon2)
+ {
+ // transform last point
+ maEdgeTrack.setB2DPoint(nCount - 1, aCompleteTransform * maEdgeTrack.getB2DPoint(nCount - 1));
+ ImpDirtyEdgeTrack();
+ }
}
}
-}
-void SdrEdgeObj::NbcMove(const Size& rSiz)
-{
- SdrTextObj::NbcMove(rSiz);
- MoveXPoly(*pEdgeTrack,rSiz);
+ // if resize is not from paste, forget user distances
+ if(!IsPasteResize())
+ {
+ maEdgeInfo.aObj1Line2 = maEdgeInfo.aObj1Line3 = maEdgeInfo.aObj2Line2 = maEdgeInfo.aObj2Line3 = maEdgeInfo.aMiddleLine = basegfx::B2DPoint();
+ }
}
-void SdrEdgeObj::NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact)
+SdrObject* SdrEdgeObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
- SdrTextObj::NbcResize(rRefPnt,aXFact,aXFact);
- ResizeXPoly(*pEdgeTrack,rRefPnt,aXFact,aYFact);
+ SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(maEdgeTrack), false, bBezier);
- // #75371# if resize is not from paste, forget user distances
- if(!GetModel()->IsPasteResize())
+ if(bAddText)
{
- // #75735#
- aEdgeInfo.aObj1Line2 = Point();
- aEdgeInfo.aObj1Line3 = Point();
- aEdgeInfo.aObj2Line2 = Point();
- aEdgeInfo.aObj2Line3 = Point();
- aEdgeInfo.aMiddleLine = Point();
+ pRet = ImpConvertAddText(pRet, bBezier);
}
+
+ return pRet;
+}
+
+sal_uInt32 SdrEdgeObj::GetSnapPointCount() const
+{
+ return 2;
}
-// #54102# added rotation support
-void SdrEdgeObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
+basegfx::B2DPoint SdrEdgeObj::GetSnapPoint(sal_uInt32 i) const
{
- if(bEdgeTrackUserDefined)
+ const_cast< SdrEdgeObj* >(this)->ImpUndirtyEdgeTrack();
+
+ if(!i)
{
- // #120437# special handling when track is imported, apply
- // transformation directly to imported track.
- SdrTextObj::NbcRotate(rRef, nWink, sn, cs);
- RotateXPoly(*pEdgeTrack, rRef, sn, cs);
+ return maEdgeTrack.getB2DPoint(0);
}
else
{
- // handle start and end point if not connected
- FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
- FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
+ const sal_uInt32 nAnz(maEdgeTrack.count());
- if(!bCon1 && pEdgeTrack)
+ if(nAnz)
{
- RotatePoint((*pEdgeTrack)[0],rRef,sn,cs);
- ImpDirtyEdgeTrack();
+ return maEdgeTrack.getB2DPoint(nAnz - 1);
}
- if(!bCon2 && pEdgeTrack)
- {
- sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
- RotatePoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef,sn,cs);
- ImpDirtyEdgeTrack();
- }
}
+
+ return basegfx::B2DPoint();
}
-// #54102# added mirror support
-void SdrEdgeObj::NbcMirror(const Point& rRef1, const Point& rRef2)
+bool SdrEdgeObj::IsPolygonObject() const
{
- if(bEdgeTrackUserDefined)
+ return false;
+}
+
+sal_uInt32 SdrEdgeObj::GetObjectPointCount() const
+{
+ return 0;
+}
+
+basegfx::B2DPoint SdrEdgeObj::GetObjectPoint(sal_uInt32 i) const
+{
+ const_cast< SdrEdgeObj* >(this)->ImpUndirtyEdgeTrack();
+
+ if(!i)
{
- // #120437# special handling when track is imported, apply
- // transformation directly to imported track.
- SdrTextObj::NbcMirror(rRef1, rRef2);
- MirrorXPoly(*pEdgeTrack, rRef1, rRef2);
+ return maEdgeTrack.getB2DPoint(0);
}
else
{
- // handle start and end point if not connected
- FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
- FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
+ const sal_uInt32 nAnz(maEdgeTrack.count());
- if(!bCon1 && pEdgeTrack)
+ if(nAnz)
{
- MirrorPoint((*pEdgeTrack)[0],rRef1,rRef2);
- ImpDirtyEdgeTrack();
- }
-
- if(!bCon2 && pEdgeTrack)
- {
- sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
- MirrorPoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef1,rRef2);
- ImpDirtyEdgeTrack();
+ return maEdgeTrack.getB2DPoint(nAnz - 1);
}
}
+
+ return basegfx::B2DPoint();
}
-// #54102# added shear support
-void SdrEdgeObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+void SdrEdgeObj::SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i)
{
- if(bEdgeTrackUserDefined)
+ ImpUndirtyEdgeTrack();
+
+ if(!i)
{
- // #120437# special handling when track is imported, apply
- // transformation directly to imported track.
- SdrTextObj::NbcShear(rRef, nWink, tn, bVShear);
- ShearXPoly(*pEdgeTrack, rRef, tn, bVShear);
+ maEdgeTrack.setB2DPoint(0, rPnt);
}
else
{
- // handle start and end point if not connected
- FASTBOOL bCon1=aCon1.pObj!=NULL && aCon1.pObj->GetPage()==pPage;
- FASTBOOL bCon2=aCon2.pObj!=NULL && aCon2.pObj->GetPage()==pPage;
+ const sal_uInt32 nAnz(maEdgeTrack.count());
- if(!bCon1 && pEdgeTrack)
+ if(nAnz)
{
- ShearPoint((*pEdgeTrack)[0],rRef,tn,bVShear);
- ImpDirtyEdgeTrack();
+ maEdgeTrack.setB2DPoint(nAnz - 1, rPnt);
}
-
- if(!bCon2 && pEdgeTrack)
+ else
{
- sal_uInt16 nPntAnz = pEdgeTrack->GetPointCount();
- ShearPoint((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],rRef,tn,bVShear);
- ImpDirtyEdgeTrack();
+ OSL_ENSURE(false, "SetObjectPoint out of bound (!)");
}
}
-}
-
-SdrObject* SdrEdgeObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
-{
- basegfx::B2DPolyPolygon aPolyPolygon;
- aPolyPolygon.append(pEdgeTrack->getB2DPolygon());
- SdrObject* pRet = ImpConvertMakeObj(aPolyPolygon, sal_False, bBezier);
-
- if(bAddText)
- {
- pRet = ImpConvertAddText(pRet, bBezier);
- }
-
- return pRet;
-}
-
-sal_uInt32 SdrEdgeObj::GetSnapPointCount() const
-{
- return 2L;
-}
-
-Point SdrEdgeObj::GetSnapPoint(sal_uInt32 i) const
-{
- ((SdrEdgeObj*)this)->ImpUndirtyEdgeTrack();
- sal_uInt16 nAnz=pEdgeTrack->GetPointCount();
- if (i==0) return (*pEdgeTrack)[0];
- else return (*pEdgeTrack)[nAnz-1];
-}
-
-sal_Bool SdrEdgeObj::IsPolyObj() const
-{
- return sal_False;
-}
-
-sal_uInt32 SdrEdgeObj::GetPointCount() const
-{
- return 0L;
-}
-
-Point SdrEdgeObj::GetPoint(sal_uInt32 i) const
-{
- ((SdrEdgeObj*)this)->ImpUndirtyEdgeTrack();
- sal_uInt16 nAnz=pEdgeTrack->GetPointCount();
- if (0L == i)
- return (*pEdgeTrack)[0];
- else
- return (*pEdgeTrack)[nAnz-1];
-}
-void SdrEdgeObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i)
-{
- // ToDo: Umconnekten fehlt noch
- ImpUndirtyEdgeTrack();
- sal_uInt16 nAnz=pEdgeTrack->GetPointCount();
- if (0L == i)
- (*pEdgeTrack)[0]=rPnt;
- if (1L == i)
- (*pEdgeTrack)[nAnz-1]=rPnt;
SetEdgeTrackDirty();
- SetRectsDirty();
+ ActionChanged();
}
SdrEdgeObjGeoData::SdrEdgeObjGeoData()
{
- pEdgeTrack=new XPolygon;
+ // default connector
+ maEdgeTrack.append(basegfx::B2DPoint(0.0, 0.0));
+ maEdgeTrack.append(basegfx::B2DPoint(0.0, 100.0));
}
SdrEdgeObjGeoData::~SdrEdgeObjGeoData()
{
- delete pEdgeTrack;
}
SdrObjGeoData* SdrEdgeObj::NewGeoData() const
@@ -2438,61 +2602,80 @@ SdrObjGeoData* SdrEdgeObj::NewGeoData() const
void SdrEdgeObj::SaveGeoData(SdrObjGeoData& rGeo) const
{
SdrTextObj::SaveGeoData(rGeo);
- SdrEdgeObjGeoData& rEGeo=(SdrEdgeObjGeoData&)rGeo;
- rEGeo.aCon1 =aCon1;
- rEGeo.aCon2 =aCon2;
- *rEGeo.pEdgeTrack =*pEdgeTrack;
- rEGeo.bEdgeTrackDirty=bEdgeTrackDirty;
- rEGeo.bEdgeTrackUserDefined=bEdgeTrackUserDefined;
- rEGeo.aEdgeInfo =aEdgeInfo;
+
+ SdrEdgeObjGeoData& rEGeo = dynamic_cast< SdrEdgeObjGeoData& >(rGeo);
+ rEGeo.maCon1 = maCon1;
+ rEGeo.maCon2 = maCon2;
+ rEGeo.maEdgeTrack = maEdgeTrack;
+ rEGeo.mbEdgeTrackDirty = mbEdgeTrackDirty;
+ rEGeo.mbEdgeTrackUserDefined = mbEdgeTrackUserDefined;
+ rEGeo.maEdgeInfo = maEdgeInfo;
}
void SdrEdgeObj::RestGeoData(const SdrObjGeoData& rGeo)
{
SdrTextObj::RestGeoData(rGeo);
- SdrEdgeObjGeoData& rEGeo=(SdrEdgeObjGeoData&)rGeo;
- if (aCon1.pObj!=rEGeo.aCon1.pObj) {
- if (aCon1.pObj!=NULL) aCon1.pObj->RemoveListener(*this);
- aCon1=rEGeo.aCon1;
- if (aCon1.pObj!=NULL) aCon1.pObj->AddListener(*this);
+ const SdrEdgeObjGeoData& rEGeo = dynamic_cast< const SdrEdgeObjGeoData& >(rGeo);
+
+ if(maCon1.mpConnectedSdrObject != rEGeo.maCon1.mpConnectedSdrObject)
+ {
+ if(maCon1.mpConnectedSdrObject)
+ {
+ EndListening(*maCon1.mpConnectedSdrObject);
+ }
+
+ maCon1 = rEGeo.maCon1;
+
+ if(maCon1.mpConnectedSdrObject)
+ {
+ StartListening(*maCon1.mpConnectedSdrObject);
+ }
}
- if (aCon2.pObj!=rEGeo.aCon2.pObj) {
- if (aCon2.pObj!=NULL) aCon2.pObj->RemoveListener(*this);
- aCon2=rEGeo.aCon2;
- if (aCon2.pObj!=NULL) aCon2.pObj->AddListener(*this);
+
+ if(maCon2.mpConnectedSdrObject != rEGeo.maCon2.mpConnectedSdrObject)
+ {
+ if(maCon2.mpConnectedSdrObject)
+ {
+ EndListening(*maCon2.mpConnectedSdrObject);
+ }
+
+ maCon2 = rEGeo.maCon2;
+
+ if(maCon2.mpConnectedSdrObject)
+ {
+ StartListening(*maCon2.mpConnectedSdrObject);
+ }
}
- *pEdgeTrack =*rEGeo.pEdgeTrack;
- bEdgeTrackDirty=rEGeo.bEdgeTrackDirty;
- bEdgeTrackUserDefined=rEGeo.bEdgeTrackUserDefined;
- aEdgeInfo =rEGeo.aEdgeInfo;
+
+ maEdgeTrack = rEGeo.maEdgeTrack;
+ mbEdgeTrackDirty = rEGeo.mbEdgeTrackDirty;
+ mbEdgeTrackUserDefined = rEGeo.mbEdgeTrackUserDefined;
+ maEdgeInfo = rEGeo.maEdgeInfo;
}
-Point SdrEdgeObj::GetTailPoint( sal_Bool bTail ) const
+basegfx::B2DPoint SdrEdgeObj::GetTailPoint( bool bTail ) const
{
- if( pEdgeTrack && pEdgeTrack->GetPointCount()!=0)
+ if(maEdgeTrack.count())
{
- const XPolygon& rTrack0 = *pEdgeTrack;
if(bTail)
{
- return rTrack0[0];
+ return maEdgeTrack.getB2DPoint(0);
}
else
{
- const sal_uInt16 nSiz = rTrack0.GetPointCount() - 1;
- return rTrack0[nSiz];
+ const sal_uInt32 nAnz(maEdgeTrack.count());
+
+ if(nAnz)
+ {
+ return maEdgeTrack.getB2DPoint(nAnz - 1);
+ }
}
}
- else
- {
- if(bTail)
- return aOutRect.TopLeft();
- else
- return aOutRect.BottomRight();
- }
+ return basegfx::B2DPoint();
}
-void SdrEdgeObj::SetTailPoint( sal_Bool bTail, const Point& rPt )
+void SdrEdgeObj::SetTailPoint( bool bTail, const basegfx::B2DPoint& rPt )
{
ImpSetTailPoint( bTail, rPt );
SetChanged();
@@ -2503,25 +2686,21 @@ void SdrEdgeObj::SetTailPoint( sal_Bool bTail, const Point& rPt )
0 <= nId <= 3 : One of the default points is choosen
nId >= 4 : A user defined glue point is choosen
*/
-void SdrEdgeObj::setGluePointIndex( sal_Bool bTail, sal_Int32 nIndex /* = -1 */ )
+void SdrEdgeObj::setGluePointIndex(bool bTail, sal_Int32 nIndex /* = -1 */ )
{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetCurrentBoundRect();
- // #110094#-14 BroadcastObjectChange();
-
SdrObjConnection& rConn1 = GetConnection( bTail );
-
rConn1.SetAutoVertex( nIndex >= 0 && nIndex <= 3 );
rConn1.SetBestConnection( nIndex < 0 );
rConn1.SetBestVertex( nIndex < 0 );
if( nIndex > 3 )
{
-// nIndex -= 4;
nIndex -= 3; // SJ: the start api index is 0, whereas the implementation in svx starts from 1
// for user defined glue points we have
// to get the id for this index first
const SdrGluePointList* pList = rConn1.GetObject() ? rConn1.GetObject()->GetGluePointList() : NULL;
+
if( pList == NULL || SDRGLUEPOINT_NOTFOUND == pList->FindGluePoint((sal_uInt16)nIndex) )
return;
}
@@ -2533,14 +2712,12 @@ void SdrEdgeObj::setGluePointIndex( sal_Bool bTail, sal_Int32 nIndex /* = -1 */
rConn1.SetConnectorId( (sal_uInt16)nIndex );
SetChanged();
- SetRectsDirty();
ImpRecalcEdgeTrack();
- // bEdgeTrackDirty=sal_True;
}
/** this method is used by the api to return a glue point id for a connection.
See setGluePointId for possible return values */
-sal_Int32 SdrEdgeObj::getGluePointIndex( sal_Bool bTail )
+sal_Int32 SdrEdgeObj::getGluePointIndex( bool bTail )
{
SdrObjConnection& rConn1 = GetConnection( bTail );
sal_Int32 nId = -1;
@@ -2548,53 +2725,23 @@ sal_Int32 SdrEdgeObj::getGluePointIndex( sal_Bool bTail )
{
nId = rConn1.GetConnectorId();
if( !rConn1.IsAutoVertex() )
-// nId += 4;
nId += 3; // SJ: the start api index is 0, whereas the implementation in svx starts from 1
}
return nId;
}
-// #102344# Implementation was missing; edge track needs to be invalidated additionally.
-void SdrEdgeObj::NbcSetAnchorPos(const Point& rPnt)
-{
- // call parent functionality
- SdrTextObj::NbcSetAnchorPos(rPnt);
-
- // Additionally, invalidate edge track
- ImpDirtyEdgeTrack();
-}
-
-sal_Bool SdrEdgeObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const
-{
- // use base method from SdrObject, it's not rotatable and
- // a call to GetSnapRect() is used. That's what we need for Connector.
- return SdrObject::TRGetBaseGeometry(rMatrix, rPolyPolygon);
-}
-
-void SdrEdgeObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon)
-{
- // evtl. take care for existing connections. For now, just use the
- // implementation from SdrObject.
- SdrObject::TRSetBaseGeometry(rMatrix, rPolyPolygon);
-}
-
-// for geometry access
-::basegfx::B2DPolygon SdrEdgeObj::getEdgeTrack() const
-{
- if(bEdgeTrackDirty)
- {
- const_cast< SdrEdgeObj* >(this)->ImpRecalcEdgeTrack();
- }
-
- if(pEdgeTrack)
- {
- return pEdgeTrack->getB2DPolygon();
- }
- else
- {
- return ::basegfx::B2DPolygon();
- }
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// for geometry access -> GetEdgeTrackPath()
+
+//::basegfx::B2DPolygon SdrEdgeObj::getEdgeTrack() const
+//{
+// if(mbEdgeTrackDirty)
+// {
+// const_cast< SdrEdgeObj* >(this)->ImpRecalcEdgeTrack();
+// }
+//
+// return maEdgeTrack;
+//}
//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index ddecc010385f..c91614b60b0e 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -39,7 +39,6 @@
#include <svl/urihelper.hxx>
#include <svtools/grfmgr.hxx>
#include <vcl/svapp.hxx>
-
#include <sfx2/linkmgr.hxx>
#include <sfx2/docfile.hxx>
#include <svx/svdetc.hxx>
@@ -50,7 +49,6 @@
#include <svx/svdpage.hxx>
#include <svx/svdmrkv.hxx>
#include <svx/svdpagv.hxx>
-#include "svx/svdviter.hxx"
#include <svx/svdview.hxx>
#include "svtools/filter.hxx"
#include <svx/svdograf.hxx>
@@ -65,6 +63,8 @@
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <osl/thread.hxx>
#include <vos/mutex.hxx>
#include <drawinglayer/processor2d/objectinfoextractor2d.hxx>
@@ -132,7 +132,8 @@ public:
const ::com::sun::star::uno::Any & rValue );
void DataChanged( const Graphic& rGraphic );
- sal_Bool Connect() { return 0 != GetRealObject(); }
+
+ bool Connect() { return 0 != GetRealObject(); }
void UpdateAsynchron();
void RemoveGraphicUpdater();
};
@@ -209,7 +210,7 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj* pObj)
, pGrafObj( pObj )
, pGraphicUpdater( NULL )
{
- SetSynchron( sal_False );
+ SetSynchron( false );
}
// -----------------------------------------------------------------------------
@@ -236,10 +237,9 @@ void SdrGraphicLink::RemoveGraphicUpdater()
// -----------------------------------------------------------------------------
-void SdrGraphicLink::DataChanged( const String& rMimeType,
- const ::com::sun::star::uno::Any & rValue )
+void SdrGraphicLink::DataChanged( const String& rMimeType, const ::com::sun::star::uno::Any & rValue )
{
- SdrModel* pModel = pGrafObj ? pGrafObj->GetModel() : 0;
+ SdrModel* pModel = pGrafObj ? &pGrafObj->getSdrModelFromSdrObject() : 0;
sfx2::LinkManager* pLinkManager= pModel ? pModel->GetLinkManager() : 0;
if( pLinkManager && rValue.hasValue() )
@@ -249,13 +249,13 @@ void SdrGraphicLink::DataChanged( const String& rMimeType,
Graphic aGraphic;
if( sfx2::LinkManager::GetGraphicFromAny( rMimeType, rValue, aGraphic ))
{
- pGrafObj->NbcSetGraphic( aGraphic );
+ pGrafObj->SetGraphic( aGraphic );
pGrafObj->ActionChanged();
}
else if( SotExchange::GetFormatIdFromMimeType( rMimeType ) != sfx2::LinkManager::RegisterStatusInfoId() )
{
// broadcasting, to update slidesorter
- pGrafObj->BroadcastObjectChange();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pGrafObj);
}
}
}
@@ -286,7 +286,9 @@ void SdrGraphicLink::UpdateAsynchron()
}
}
else
+ {
pGraphicUpdater = new SdrGraphicUpdater( pGrafObj->GetFileName(), pGrafObj->GetFilterName(), *this );
+ }
}
}
@@ -364,16 +366,17 @@ void SdrGrafObj::onGraphicChanged()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrGrafObj,SdrRectObj);
-
-// -----------------------------------------------------------------------------
-
-SdrGrafObj::SdrGrafObj()
-: SdrRectObj(),
- pGraphicLink ( NULL ),
- bMirrored ( sal_False )
+SdrGrafObj::SdrGrafObj(
+ SdrModel& rSdrModel,
+ const Graphic& rGrf,
+ const basegfx::B2DHomMatrix& rTransform)
+: SdrRectObj(
+ rSdrModel,
+ rTransform),
+ pGraphicLink(0),
+ bMirrored(false)
{
- pGraphic = new GraphicObject;
+ pGraphic = new GraphicObject( rGrf );
mpReplacementGraphic = 0;
pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
onGraphicChanged();
@@ -382,92 +385,88 @@ SdrGrafObj::SdrGrafObj()
bNoShear = false;
// #111096#
- mbGrafAnimationAllowed = sal_True;
-
- // #i25616#
- mbLineIsOutsideGeometry = sal_True;
- mbInsidePaint = sal_False;
- mbIsPreview = sal_False;
-
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
+ mbGrafAnimationAllowed = true;
+ mbInsidePaint = false;
+ mbIsPreview = false;
}
// -----------------------------------------------------------------------------
-SdrGrafObj::SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect)
-: SdrRectObj ( rRect ),
- pGraphicLink ( NULL ),
- bMirrored ( sal_False )
+SdrGrafObj::~SdrGrafObj()
{
- pGraphic = new GraphicObject( rGrf );
- mpReplacementGraphic = 0;
- pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
- onGraphicChanged();
+ delete pGraphic;
+ delete mpReplacementGraphic;
+ ImpLinkAbmeldung();
+}
- // #i118485# Shear allowed and possible now
- bNoShear = false;
+void SdrGrafObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const SdrGrafObj* pSource = dynamic_cast< const SdrGrafObj* >(&rSource);
- // #111096#
- mbGrafAnimationAllowed = sal_True;
+ if(pSource)
+ {
+ // call parent
+ SdrRectObj::copyDataFromSdrObject(rSource);
- // #i25616#
- mbLineIsOutsideGeometry = sal_True;
- mbInsidePaint = sal_False;
- mbIsPreview = sal_False;
+ // copy local data
+ pGraphic->SetGraphic(pSource->GetGraphic(), &pSource->GetGraphicObject());
+ aCropRect = pSource->aCropRect;
+ aFileName = pSource->aFileName;
+ aFilterName = pSource->aFilterName;
+ bMirrored = pSource->bMirrored;
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
-}
+ if(pSource->pGraphicLink)
+ {
+ SetGraphicLink(aFileName, aFilterName);
+ }
-// -----------------------------------------------------------------------------
+ ImpSetAttrToGrafInfo();
+ onGraphicChanged();
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
-SdrGrafObj::SdrGrafObj( const Graphic& rGrf )
-: SdrRectObj(),
- pGraphicLink ( NULL ),
- bMirrored ( sal_False )
+SdrObject* SdrGrafObj::CloneSdrObject(SdrModel* pTargetModel) const
{
- pGraphic = new GraphicObject( rGrf );
- mpReplacementGraphic = 0;
- pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
- onGraphicChanged();
-
- // #i118485# Shear allowed and possible now
- bNoShear = false;
-
- // #111096#
- mbGrafAnimationAllowed = sal_True;
+ SdrGrafObj* pClone = new SdrGrafObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ GetGraphic());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
- // #i25616#
- mbLineIsOutsideGeometry = sal_True;
- mbInsidePaint = sal_False;
- mbIsPreview = sal_False;
-
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
+ return pClone;
}
// -----------------------------------------------------------------------------
-SdrGrafObj::~SdrGrafObj()
+bool SdrGrafObj::IsSdrGrafObj() const
{
- delete pGraphic;
- delete mpReplacementGraphic;
- ImpLinkAbmeldung();
+ return true;
+}
+
+bool SdrGrafObj::DoesSupportTextIndentingOnLineWidthChange() const
+{
+ return false;
}
// -----------------------------------------------------------------------------
void SdrGrafObj::SetGraphicObject( const GraphicObject& rGrfObj )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
*pGraphic = rGrfObj;
delete mpReplacementGraphic;
mpReplacementGraphic = 0;
pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
pGraphic->SetUserData();
- mbIsPreview = sal_False;
+ mbIsPreview = false;
SetChanged();
- BroadcastObjectChange();
onGraphicChanged();
}
@@ -500,21 +499,16 @@ const GraphicObject* SdrGrafObj::GetReplacementGraphicObject() const
// -----------------------------------------------------------------------------
-void SdrGrafObj::NbcSetGraphic( const Graphic& rGrf )
+void SdrGrafObj::SetGraphic( const Graphic& rGrf )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
pGraphic->SetGraphic( rGrf );
delete mpReplacementGraphic;
mpReplacementGraphic = 0;
pGraphic->SetUserData();
- mbIsPreview = sal_False;
+ mbIsPreview = false;
onGraphicChanged();
-}
-
-void SdrGrafObj::SetGraphic( const Graphic& rGrf )
-{
- NbcSetGraphic(rGrf);
SetChanged();
- BroadcastObjectChange();
}
// -----------------------------------------------------------------------------
@@ -527,24 +521,22 @@ const Graphic& SdrGrafObj::GetGraphic() const
// -----------------------------------------------------------------------------
-Graphic SdrGrafObj::GetTransformedGraphic( sal_uIntPtr nTransformFlags ) const
+Graphic SdrGrafObj::GetTransformedGraphic( sal_uIntPtr nTransformFlags ) const // TTTT needed?
{
// #107947# Refactored most of the code to GraphicObject, where
// everybody can use e.g. the cropping functionality
-
- GraphicType eType = GetGraphicType();
- MapMode aDestMap( pModel->GetScaleUnit(), Point(), pModel->GetScaleFraction(), pModel->GetScaleFraction() );
- const Size aDestSize( GetLogicRect().GetSize() );
- const sal_Bool bMirror = ( nTransformFlags & SDRGRAFOBJ_TRANSFORMATTR_MIRROR ) != 0;
- const sal_Bool bRotate = ( ( nTransformFlags & SDRGRAFOBJ_TRANSFORMATTR_ROTATE ) != 0 ) &&
- ( aGeo.nDrehWink && aGeo.nDrehWink != 18000 ) && ( GRAPHIC_NONE != eType );
+ const GraphicType eType(GetGraphicType());
+ const MapMode aDestMap(getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(), getSdrModelFromSdrObject().GetExchangeObjectScale(), getSdrModelFromSdrObject().GetExchangeObjectScale() );
+ const Size aDestSize( sdr::legacy::GetLogicRect(*this).GetSize() );
+ const bool bMirror(0 != (nTransformFlags & SDRGRAFOBJ_TRANSFORMATTR_MIRROR));
+ const long nOldRotAngle(sdr::legacy::GetRotateAngle(*this));
+ const bool bRotate((0 != (nTransformFlags & SDRGRAFOBJ_TRANSFORMATTR_ROTATE)) && (0 != nOldRotAngle) && (GRAPHIC_NONE != eType));
// #104115# Need cropping info earlier
- ( (SdrGrafObj*) this )->ImpSetAttrToGrafInfo();
+ const_cast< SdrGrafObj* >(this)->ImpSetAttrToGrafInfo();
GraphicAttr aActAttr;
- if( SDRGRAFOBJ_TRANSFORMATTR_NONE != nTransformFlags &&
- GRAPHIC_NONE != eType )
+ if(SDRGRAFOBJ_TRANSFORMATTR_NONE != nTransformFlags && GRAPHIC_NONE != eType)
{
// actually transform the graphic only in this case. On the
// other hand, cropping will always happen
@@ -552,15 +544,17 @@ Graphic SdrGrafObj::GetTransformedGraphic( sal_uIntPtr nTransformFlags ) const
if( bMirror )
{
- sal_uInt16 nMirrorCase = ( aGeo.nDrehWink == 18000 ) ? ( bMirrored ? 3 : 4 ) : ( bMirrored ? 2 : 1 );
- FASTBOOL bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
- FASTBOOL bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
+ const sal_uInt16 nMirrorCase((18000 == nOldRotAngle) ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
+ const bool bHMirr(2 == nMirrorCase || 4 == nMirrorCase);
+ const bool bVMirr(3 == nMirrorCase || 4 == nMirrorCase);
aActAttr.SetMirrorFlags( ( bHMirr ? BMP_MIRROR_HORZ : 0 ) | ( bVMirr ? BMP_MIRROR_VERT : 0 ) );
}
if( bRotate )
- aActAttr.SetRotation( sal_uInt16(aGeo.nDrehWink / 10) );
+ {
+ aActAttr.SetRotation(sal_uInt16(nOldRotAngle/10));
+ }
}
// #107947# Delegate to moved code in GraphicObject
@@ -574,19 +568,19 @@ GraphicType SdrGrafObj::GetGraphicType() const
return pGraphic->GetType();
}
-sal_Bool SdrGrafObj::IsAnimated() const
+bool SdrGrafObj::IsAnimated() const
{
return pGraphic->IsAnimated();
}
-sal_Bool SdrGrafObj::IsEPS() const
+bool SdrGrafObj::IsEPS() const
{
return pGraphic->IsEPS();
}
-sal_Bool SdrGrafObj::IsSwappedOut() const
+bool SdrGrafObj::IsSwappedOut() const
{
- return mbIsPreview ? sal_True : pGraphic->IsSwappedOut();
+ return mbIsPreview ? true : pGraphic->IsSwappedOut();
}
const MapMode& SdrGrafObj::GetGrafPrefMapMode() const
@@ -603,18 +597,24 @@ const Size& SdrGrafObj::GetGrafPrefSize() const
void SdrGrafObj::SetGrafStreamURL( const String& rGraphicStreamURL )
{
- mbIsPreview = sal_False;
+ mbIsPreview = false;
+
if( !rGraphicStreamURL.Len() )
{
pGraphic->SetUserData();
}
- else if( pModel->IsSwapGraphics() )
+ else
{
- pGraphic->SetUserData( rGraphicStreamURL );
+ if(getSdrModelFromSdrObject().IsSwapGraphics())
+ {
+ pGraphic->SetUserData( rGraphicStreamURL );
- // set state of graphic object to 'swapped out'
- if( pGraphic->GetType() == GRAPHIC_NONE )
- pGraphic->SetSwapState();
+ // set state of graphic object to 'swapped out'
+ if(GRAPHIC_NONE == pGraphic->GetType())
+ {
+ pGraphic->SetSwapState();
+ }
+ }
}
}
@@ -655,7 +655,7 @@ void SdrGrafObj::ForceSwapIn() const
pGraphic->SetUserData( aUserData );
pGraphic->SetSwapState();
- const_cast< SdrGrafObj* >( this )->mbIsPreview = sal_False;
+ const_cast< SdrGrafObj* >( this )->mbIsPreview = false;
}
if ( pGraphicLink && pGraphic->IsSwappedOut() )
ImpUpdateGraphicLink( sal_False );
@@ -683,14 +683,14 @@ void SdrGrafObj::ForceSwapOut() const
void SdrGrafObj::ImpLinkAnmeldung()
{
- sfx2::LinkManager* pLinkManager = pModel != NULL ? pModel->GetLinkManager() : NULL;
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrObject().GetLinkManager();
- if( pLinkManager != NULL && pGraphicLink == NULL )
+ if(pLinkManager && !pGraphicLink)
{
if( aFileName.Len() )
{
pGraphicLink = new SdrGraphicLink( this );
- pLinkManager->InsertFileLink( *pGraphicLink, OBJECT_CLIENT_GRF, aFileName, ( aFilterName.Len() ? &aFilterName : NULL ), NULL );
+ pLinkManager->InsertFileLink(*pGraphicLink, OBJECT_CLIENT_GRF, aFileName, (aFilterName.Len() ? &aFilterName : 0), 0);
pGraphicLink->Connect();
}
}
@@ -700,13 +700,13 @@ void SdrGrafObj::ImpLinkAnmeldung()
void SdrGrafObj::ImpLinkAbmeldung()
{
- sfx2::LinkManager* pLinkManager = pModel != NULL ? pModel->GetLinkManager() : NULL;
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrObject().GetLinkManager();
- if( pLinkManager != NULL && pGraphicLink!=NULL)
+ if(pLinkManager && pGraphicLink)
{
// Bei Remove wird *pGraphicLink implizit deleted
pLinkManager->Remove( pGraphicLink );
- pGraphicLink=NULL;
+ pGraphicLink = 0;
}
}
@@ -737,31 +737,29 @@ void SdrGrafObj::ReleaseGraphicLink()
void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- FASTBOOL bAnim = pGraphic->IsAnimated();
- FASTBOOL bNoPresGrf = ( pGraphic->GetType() != GRAPHIC_NONE ) && !bEmptyPresObj;
-
- rInfo.bResizeFreeAllowed = aGeo.nDrehWink % 9000 == 0 ||
- aGeo.nDrehWink % 18000 == 0 ||
- aGeo.nDrehWink % 27000 == 0;
+ const bool bAnim(pGraphic->IsAnimated());
+ const bool bNoPresGrf((GRAPHIC_NONE != pGraphic->GetType()) && !IsEmptyPresObj());
+ const long nOldRotAngle(sdr::legacy::GetRotateAngle(*this));
- rInfo.bResizePropAllowed = sal_True;
- rInfo.bRotateFreeAllowed = bNoPresGrf && !bAnim;
- rInfo.bRotate90Allowed = bNoPresGrf && !bAnim;
- rInfo.bMirrorFreeAllowed = bNoPresGrf && !bAnim;
- rInfo.bMirror45Allowed = bNoPresGrf && !bAnim;
- rInfo.bMirror90Allowed = !bEmptyPresObj;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
+ rInfo.mbResizeFreeAllowed = nOldRotAngle % 9000 == 0 || nOldRotAngle % 18000 == 0 || nOldRotAngle % 27000 == 0;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = bNoPresGrf && !bAnim;
+ rInfo.mbRotate90Allowed = bNoPresGrf && !bAnim;
+ rInfo.mbMirrorFreeAllowed = bNoPresGrf && !bAnim;
+ rInfo.mbMirror45Allowed = bNoPresGrf && !bAnim;
+ rInfo.mbMirror90Allowed = !IsEmptyPresObj();
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
// #i118485# Shear allowed and possible now
- rInfo.bShearAllowed = true;
+ rInfo.mbShearAllowed = true;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bCanConvToPath = !IsEPS();
- rInfo.bCanConvToPathLineToArea = sal_False;
- rInfo.bCanConvToPolyLineToArea = sal_False;
- rInfo.bCanConvToPoly = !IsEPS();
- rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
+ rInfo.mbEdgeRadiusAllowed=false;
+ rInfo.mbCanConvToPath = false;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
+ rInfo.mbCanConvToPoly = !IsEPS();
+ rInfo.mbCanConvToContour = (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
// -----------------------------------------------------------------------------
@@ -776,16 +774,16 @@ sal_uInt16 SdrGrafObj::GetObjIdentifier() const
/* The graphic of the GraphicLink will be loaded. If it is called with
bAsynchron = true then the graphic will be set later via DataChanged
*/
-sal_Bool SdrGrafObj::ImpUpdateGraphicLink( sal_Bool bAsynchron ) const
+bool SdrGrafObj::ImpUpdateGraphicLink( bool bAsynchron ) const
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if( pGraphicLink )
{
if ( bAsynchron )
pGraphicLink->UpdateAsynchron();
else
pGraphicLink->DataChanged( ImpLoadLinkedGraphic( aFileName, aFilterName ) );
- bRet = sal_True;
+ bRet = true;
}
return bRet;
}
@@ -794,11 +792,9 @@ sal_Bool SdrGrafObj::ImpUpdateGraphicLink( sal_Bool bAsynchron ) const
void SdrGrafObj::ImpSetLinkedGraphic( const Graphic& rGraphic )
{
- const sal_Bool bIsChanged = GetModel()->IsChanged();
- NbcSetGraphic( rGraphic );
- ActionChanged();
- BroadcastObjectChange();
- GetModel()->SetChanged( bIsChanged );
+ const bool bIsChanged(getSdrModelFromSdrObject().IsChanged());
+ SetGraphic( rGraphic );
+ getSdrModelFromSdrObject().SetChanged( bIsChanged );
}
// -----------------------------------------------------------------------------
@@ -922,47 +918,39 @@ SdrObject* SdrGrafObj::getFullDragClone() const
return pRetval;
}
-void SdrGrafObj::operator=( const SdrObject& rObj )
-{
- SdrRectObj::operator=( rObj );
-
- const SdrGrafObj& rGraf = (SdrGrafObj&) rObj;
-
- pGraphic->SetGraphic( rGraf.GetGraphic(), &rGraf.GetGraphicObject() );
- aCropRect = rGraf.aCropRect;
- aFileName = rGraf.aFileName;
- aFilterName = rGraf.aFilterName;
- bMirrored = rGraf.bMirrored;
-
- if( rGraf.pGraphicLink != NULL)
- {
- SetGraphicLink( aFileName, aFilterName );
- }
-
- ImpSetAttrToGrafInfo();
-}
-
// -----------------------------------------------------------------------------
// #i25616#
basegfx::B2DPolyPolygon SdrGrafObj::TakeXorPoly() const
{
- if(mbInsidePaint)
+ if(mbInsidePaint) // TTTT exception needed here?
{
- basegfx::B2DPolyPolygon aRetval;
-
// take grown rectangle
- const sal_Int32 nHalfLineWidth(ImpGetLineWdt() / 2);
- const Rectangle aGrownRect(
- aRect.Left() - nHalfLineWidth,
- aRect.Top() - nHalfLineWidth,
- aRect.Right() + nHalfLineWidth,
- aRect.Bottom() + nHalfLineWidth);
+ const double fHalfLineWidth(ImpGetLineWdt() * 0.5);
+ basegfx::B2DRange aRange(sdr::legacy::GetSnapRange(*this));
- XPolygon aXPoly(ImpCalcXPoly(aGrownRect, GetEckenradius()));
- aRetval.append(aXPoly.getB2DPolygon());
+ if(!basegfx::fTools::equalZero(fHalfLineWidth))
+ {
+ aRange.grow(fHalfLineWidth);
+ }
+
+ double fCornerRadiusX(0.0);
+ double fCornerRadiusY(0.0);
+
+ if(GetEdgeRadius())
+ {
+ // get absolute object scale
+ const basegfx::B2DVector aObjectScale(absolute(getSdrObjectScale()));
+
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(
+ GetEdgeRadius(),
+ aObjectScale.getX(),
+ aObjectScale.getY(),
+ fCornerRadiusX,
+ fCornerRadiusY);
+ }
- return aRetval;
+ return basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(aRange, fCornerRadiusX, fCornerRadiusY));
}
else
{
@@ -973,188 +961,59 @@ basegfx::B2DPolyPolygon SdrGrafObj::TakeXorPoly() const
// -----------------------------------------------------------------------------
-sal_uInt32 SdrGrafObj::GetHdlCount() const
-{
- return 8L;
-}
-
-// -----------------------------------------------------------------------------
-
-SdrHdl* SdrGrafObj::GetHdl(sal_uInt32 nHdlNum) const
-{
- return SdrRectObj::GetHdl( nHdlNum + 1L );
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- SdrRectObj::NbcResize( rRef, xFact, yFact );
-
- FASTBOOL bMirrX = xFact.GetNumerator() < 0;
- FASTBOOL bMirrY = yFact.GetNumerator() < 0;
-
- if( bMirrX != bMirrY )
- bMirrored = !bMirrored;
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
-{
- SdrRectObj::NbcRotate(rRef,nWink,sn,cs);
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::NbcMirror(const Point& rRef1, const Point& rRef2)
-{
- SdrRectObj::NbcMirror(rRef1,rRef2);
- bMirrored = !bMirrored;
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
-{
- // #i118485# Call Shear now, old version redirected to rotate
- SdrRectObj::NbcShear(rRef, nWink, tn, bVShear);
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::NbcSetSnapRect(const Rectangle& rRect)
-{
- SdrRectObj::NbcSetSnapRect(rRect);
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::NbcSetLogicRect( const Rectangle& rRect)
-{
- //int bChg=rRect.GetSize()!=aRect.GetSize();
- SdrRectObj::NbcSetLogicRect(rRect);
-}
-
-// -----------------------------------------------------------------------------
-
-SdrObjGeoData* SdrGrafObj::NewGeoData() const
-{
- return new SdrGrafObjGeoData;
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::SaveGeoData(SdrObjGeoData& rGeo) const
+void SdrGrafObj::AddToHdlList(SdrHdlList& rHdlList) const
{
- SdrRectObj::SaveGeoData(rGeo);
- SdrGrafObjGeoData& rGGeo=(SdrGrafObjGeoData&)rGeo;
- rGGeo.bMirrored=bMirrored;
+ // add parent handles. Use SdrTextObj, not SdrRectObj, to add
+ // the eight object handles, but not the text frame
+ SdrTextObj::AddToHdlList(rHdlList);
}
// -----------------------------------------------------------------------------
-void SdrGrafObj::RestGeoData(const SdrObjGeoData& rGeo)
+void SdrGrafObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- //long nDrehMerk = aGeo.nDrehWink;
- //long nShearMerk = aGeo.nShearWink;
- //int bMirrMerk = bMirrored;
- Size aSizMerk( aRect.GetSize() );
+ // call parent
+ SdrRectObj::setSdrObjectTransformation(rTransformation);
- SdrRectObj::RestGeoData(rGeo);
- SdrGrafObjGeoData& rGGeo=(SdrGrafObjGeoData&)rGeo;
- bMirrored=rGGeo.bMirrored;
+ // TTTT: extract mirror flags and trigger bMirrored (if needed in the future at all)
}
// -----------------------------------------------------------------------------
-void SdrGrafObj::SetPage( SdrPage* pNewPage )
+void SdrGrafObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
{
- FASTBOOL bRemove = pNewPage == NULL && pPage != NULL;
- FASTBOOL bInsert = pNewPage != NULL && pPage == NULL;
-
- if( bRemove )
+ if(pOldPage != pNewPage)
{
- // hier kein SwapIn noetig, weil wenn nicht geladen, dann auch nicht animiert.
- if( pGraphic->IsAnimated())
- pGraphic->StopAnimation();
+ const bool bRemove(pNewPage && pOldPage);
+ const bool bInsert(pNewPage && !pOldPage);
- if( pGraphicLink != NULL )
- ImpLinkAbmeldung();
- }
-
- if(!pModel && !GetStyleSheet() && pNewPage->GetModel())
- {
- // #119287# Set default StyleSheet for SdrGrafObj here, it is different from 'Default'. This
- // needs to be done before the style 'Default' is set from the :SetModel() call which is triggered
- // from the following :SetPage().
- // TTTT: Needs to be moved in branch aw080 due to having a SdrModel from the beginning, is at this
- // place for convenience currently (works in both versions, is not in the way)
- SfxStyleSheet* pSheet = pNewPage->GetModel()->GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj();
-
- if(pSheet)
- {
- SetStyleSheet(pSheet, false);
- }
- else
+ if( bRemove )
{
- SetMergedItem(XFillStyleItem(XFILL_NONE));
- SetMergedItem(XLineStyleItem(XLINE_NONE));
- }
- }
-
- SdrRectObj::SetPage( pNewPage );
-
- if(aFileName.Len() && bInsert)
- ImpLinkAnmeldung();
-}
+ // hier kein SwapIn noetig, weil wenn nicht geladen, dann auch nicht animiert.
+ if( pGraphic->IsAnimated())
+ {
+ pGraphic->StopAnimation();
+ }
-// -----------------------------------------------------------------------------
+ if(pGraphicLink)
+ {
+ ImpLinkAbmeldung();
+ }
+ }
-void SdrGrafObj::SetModel( SdrModel* pNewModel )
-{
- FASTBOOL bChg = pNewModel != pModel;
+ // call parent
+ SdrRectObj::handlePageChange(pOldPage, pNewPage);
- if( bChg )
- {
- if( pGraphic->HasUserData() )
+ if(aFileName.Len() && bInsert)
{
- ForceSwapIn();
- pGraphic->SetUserData();
+ ImpLinkAnmeldung();
}
-
- if( pGraphicLink != NULL )
- ImpLinkAbmeldung();
}
-
- // Model umsetzen
- SdrRectObj::SetModel(pNewModel);
-
- if( bChg && aFileName.Len() )
- ImpLinkAnmeldung();
}
// -----------------------------------------------------------------------------
-void SdrGrafObj::StartAnimation( OutputDevice* /*pOutDev*/, const Point& /*rPoint*/, const Size& /*rSize*/, long /*nExtraData*/)
-{
- // #111096#
- // use new graf animation
- SetGrafAnimationAllowed(sal_True);
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrGrafObj::StopAnimation(OutputDevice* /*pOutDev*/, long /*nExtraData*/)
-{
- // #111096#
- // use new graf animation
- SetGrafAnimationAllowed(sal_False);
-}
-
-// -----------------------------------------------------------------------------
-
-FASTBOOL SdrGrafObj::HasGDIMetaFile() const
+bool SdrGrafObj::HasGDIMetaFile() const
{
return( pGraphic->GetType() == GRAPHIC_GDIMETAFILE );
}
@@ -1178,11 +1037,15 @@ GDIMetaFile SdrGrafObj::getMetafileFromEmbeddedSvg() const
{
GDIMetaFile aRetval;
- if(isEmbeddedSvg() && GetModel())
+ if(isEmbeddedSvg())
{
VirtualDevice aOut;
- const Rectangle aBoundRect(GetCurrentBoundRect());
- const MapMode aMap(GetModel()->GetScaleUnit(), Point(), GetModel()->GetScaleFraction(), GetModel()->GetScaleFraction());
+ const basegfx::B2DRange& rRange = getObjectRange(0);
+ const MapMode aMap(
+ getSdrModelFromSdrObject().GetExchangeObjectUnit(),
+ Point(),
+ getSdrModelFromSdrObject().GetExchangeObjectScale(),
+ getSdrModelFromSdrObject().GetExchangeObjectScale());
aOut.EnableOutput(false);
aOut.SetMapMode(aMap);
@@ -1190,15 +1053,15 @@ GDIMetaFile SdrGrafObj::getMetafileFromEmbeddedSvg() const
SingleObjectPainter(aOut);
aRetval.Stop();
aRetval.WindStart();
- aRetval.Move(-aBoundRect.Left(), -aBoundRect.Top());
+ aRetval.Move(basegfx::fround(-rRange.getMinX()), basegfx::fround(-rRange.getMinY()));
aRetval.SetPrefMapMode(aMap);
- aRetval.SetPrefSize(aBoundRect.GetSize());
+ aRetval.SetPrefSize(Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight())));
}
return aRetval;
}
-SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+SdrObject* SdrGrafObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
SdrObject* pRetval = NULL;
GraphicType aGraphicType(GetGraphicType());
@@ -1224,32 +1087,18 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
case GRAPHIC_GDIMETAFILE:
{
// NUR die aus dem MetaFile erzeugbaren Objekte in eine Gruppe packen und zurueckliefern
- ImpSdrGDIMetaFileImport aFilter(*GetModel(), GetLayer(), aRect);
- SdrObjGroup* pGrp = new SdrObjGroup();
- sal_uInt32 nInsAnz = aFilter.DoImport(aMtf, *pGrp->GetSubList(), 0);
+ ImpSdrGDIMetaFileImport aFilter(getSdrModelFromSdrObject(), GetLayer(), getSdrObjectTransformation());
+ SdrObjGroup* pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
+ const sal_uInt32 nInsAnz(aFilter.DoImport(GetTransformedGraphic().GetGDIMetaFile(), *pGrp, 0));
if(nInsAnz)
{
- {
- // copy transformation
- GeoStat aGeoStat(GetGeoStat());
-
- if(aGeoStat.nShearWink)
- {
- aGeoStat.RecalcTan();
- pGrp->NbcShear(aRect.TopLeft(), aGeoStat.nShearWink, aGeoStat.nTan, false);
- }
-
- if(aGeoStat.nDrehWink)
- {
- aGeoStat.RecalcSinCos();
- pGrp->NbcRotate(aRect.TopLeft(), aGeoStat.nDrehWink, aGeoStat.nSin, aGeoStat.nCos);
- }
- }
+ // copy transformation
+ pGrp->setSdrObjectTransformation(getSdrObjectTransformation());
+ // copy other aspects
+ pGrp->SetLayer(GetLayer());
pRetval = pGrp;
- pGrp->NbcSetLayer(GetLayer());
- pGrp->SetModel(GetModel());
if(bAddText)
{
@@ -1260,28 +1109,31 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
if( pRetval )
{
SdrObject* pHalfDone = pRetval;
- pRetval = pHalfDone->DoConvertToPolyObj(bBezier, bAddText);
- SdrObject::Free( pHalfDone ); // resulting object is newly created
+ pRetval = pHalfDone->DoConvertToPolygonObject(bBezier, bAddText);
+ deleteSdrObjectSafeAndClearPointer( pHalfDone ); // resulting object is newly created
if( pRetval )
{
// flatten subgroups. As we call
- // DoConvertToPolyObj() on the resulting group
+ // DoConvertToPolygonObject() on the resulting group
// objects, subgroups can exist (e.g. text is
// a group object for every line).
- SdrObjList* pList = pRetval->GetSubList();
+ SdrObjList* pList = pRetval->getChildrenOfSdrObject();
+
if( pList )
+ {
pList->FlattenGroups();
+ }
}
}
}
else
{
- delete pGrp;
+ deleteSdrObjectSafeAndClearPointer(pGrp);
}
// #i118485# convert line and fill
- SdrObject* pLineFill = SdrRectObj::DoConvertToPolyObj(bBezier, false);
+ SdrObject* pLineFill = SdrRectObj::DoConvertToPolygonObject(bBezier, false);
if(pLineFill)
{
@@ -1291,14 +1143,13 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
if(!pGrp)
{
- pGrp = new SdrObjGroup();
+ pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
- pGrp->NbcSetLayer(GetLayer());
- pGrp->SetModel(GetModel());
- pGrp->GetSubList()->NbcInsertObject(pRetval);
+ pGrp->SetLayer(GetLayer());
+ pGrp->getChildrenOfSdrObject()->InsertObjectToSdrObjList(*pRetval);
}
- pGrp->GetSubList()->NbcInsertObject(pLineFill, 0);
+ pGrp->getChildrenOfSdrObject()->InsertObjectToSdrObjList(*pLineFill, 0);
}
else
{
@@ -1311,18 +1162,19 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
case GRAPHIC_BITMAP:
{
// Grundobjekt kreieren und Fuellung ergaenzen
- pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
+ pRetval = SdrRectObj::DoConvertToPolygonObject(bBezier, bAddText);
// Bitmap als Attribut retten
if(pRetval)
{
// Bitmap als Fuellung holen
SfxItemSet aSet(GetObjectItemSet());
+ const BitmapEx aBitmapEx(GetTransformedGraphic().GetBitmapEx());
aSet.Put(XFillStyleItem(XFILL_BITMAP));
- const BitmapEx aBitmapEx(GetTransformedGraphic().GetBitmapEx());
aSet.Put(XFillBitmapItem(String(), Graphic(aBitmapEx)));
aSet.Put(XFillBmpTileItem(false));
+ aSet.Put(SfxBoolItem(XATTR_FILLBMP_STRETCH, true));
pRetval->SetMergedItemSet(aSet);
}
@@ -1331,7 +1183,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
case GRAPHIC_NONE:
case GRAPHIC_DEFAULT:
{
- pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
+ pRetval = SdrRectObj::DoConvertToPolygonObject(bBezier, bAddText);
break;
}
}
@@ -1343,7 +1195,6 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
void SdrGrafObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- SetXPolyDirty();
SdrRectObj::Notify( rBC, rHint );
ImpSetAttrToGrafInfo();
}
@@ -1365,8 +1216,7 @@ void SdrGrafObj::ImpSetAttrToGrafInfo()
aGrafInfo.SetDrawMode( ( (SdrGrafModeItem&) rSet.Get( SDRATTR_GRAFMODE ) ).GetValue() );
aGrafInfo.SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() );
- SetXPolyDirty();
- SetRectsDirty();
+ ActionChanged();
}
// -----------------------------------------------------------------------------
@@ -1387,54 +1237,58 @@ void SdrGrafObj::ImpSetGrafInfoToAttr()
// -----------------------------------------------------------------------------
-void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly )
+void SdrGrafObj::AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool bShrinkOnly )
{
- Size aSize;
- Size aMaxSize( rMaxRect.GetSize() );
- if ( pGraphic->GetPrefMapMode().GetMapUnit() == MAP_PIXEL )
- aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MAP_100TH_MM );
+ Size aLogicSize;
+
+ if(MAP_PIXEL == pGraphic->GetPrefMapMode().GetMapUnit())
+ {
+ aLogicSize = Application::GetDefaultDevice()->PixelToLogic(pGraphic->GetPrefSize(), MAP_100TH_MM);
+ }
else
- aSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(),
- pGraphic->GetPrefMapMode(),
- MapMode( MAP_100TH_MM ) );
+ {
+ aLogicSize = OutputDevice::LogicToLogic(pGraphic->GetPrefSize(), pGraphic->GetPrefMapMode(), MapMode(MAP_100TH_MM));
+ }
+
+ basegfx::B2DVector aSize(aLogicSize.Width(), aLogicSize.Height());
+ const basegfx::B2DVector aMaxSize(rMaxRange.getRange());
- if( aSize.Height() != 0 && aSize.Width() != 0 )
+ if(!aSize.equalZero())
{
- Point aPos( rMaxRect.TopLeft() );
-
- // Falls Grafik zu gross, wird die Grafik
- // in die Seite eingepasst
- if ( (!bShrinkOnly ||
- ( aSize.Height() > aMaxSize.Height() ) ||
- ( aSize.Width() > aMaxSize.Width() ) )&&
- aSize.Height() && aMaxSize.Height() )
- {
- float fGrfWH = (float)aSize.Width() /
- (float)aSize.Height();
- float fWinWH = (float)aMaxSize.Width() /
- (float)aMaxSize.Height();
+ basegfx::B2DPoint aPos(rMaxRange.getMinimum());
- // Grafik an Pagesize anpassen (skaliert)
- if ( fGrfWH < fWinWH )
- {
- aSize.Width() = (long)(aMaxSize.Height() * fGrfWH);
- aSize.Height()= aMaxSize.Height();
- }
- else if ( fGrfWH > 0.F )
+ if(!bShrinkOnly
+ || basegfx::fTools::more(aSize.getY(), aMaxSize.getY())
+ || basegfx::fTools::more(aSize.getX(), aMaxSize.getX()))
+ {
+ if(!basegfx::fTools::equalZero(aSize.getX()) && !basegfx::fTools::equalZero(aMaxSize.getY()))
{
- aSize.Width() = aMaxSize.Width();
- aSize.Height()= (long)(aMaxSize.Width() / fGrfWH);
- }
+ const double fScaleGraphic(aSize.getX() / aSize.getY());
+ const double fScaleLimit(aMaxSize.getX() / aMaxSize.getY());
+
+ if(basegfx::fTools::less(fScaleGraphic, fScaleLimit))
+ {
+ aSize.setX(aMaxSize.getY() * fScaleGraphic);
+ aSize.setY(aMaxSize.getY());
+ }
+ else if(basegfx::fTools::more(fScaleGraphic, 0.0))
+ {
+ aSize.setX(aMaxSize.getX());
+ aSize.setY(aMaxSize.getX() / fScaleGraphic);
+ }
- aPos = rMaxRect.Center();
+ aPos = rMaxRange.getCenter();
+ }
}
if( bShrinkOnly )
- aPos = aRect.TopLeft();
+ {
+ aPos = getSdrObjectTranslate();
+ }
+
+ aPos -= aSize * 0.5;
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- SetLogicRect( Rectangle( aPos, aSize ) );
+ sdr::legacy::SetLogicRange(*this, basegfx::B2DRange(aPos, aPos + aSize));
}
}
@@ -1446,13 +1300,13 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
if( pO->IsInSwapOut() )
{
- if( pModel && !mbIsPreview && pModel->IsSwapGraphics() && pGraphic->GetSizeBytes() > 20480 )
+ if( !mbIsPreview && getSdrModelFromSdrObject().IsSwapGraphics() && pGraphic->GetSizeBytes() > 20480 )
{
// test if this object is visualized from someone
// ## test only if there are VOCs other than the preview renderer
if(!GetViewContact().HasViewObjectContacts(true))
{
- const sal_uIntPtr nSwapMode = pModel->GetSwapGraphicsMode();
+ const sal_uIntPtr nSwapMode = getSdrModelFromSdrObject().GetSwapGraphicsMode();
if( ( pGraphic->HasUserData() || pGraphicLink ) &&
( nSwapMode & SDR_SWAPGRAPHICSMODE_PURGE ) )
@@ -1478,79 +1332,74 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
else if( pO->IsInSwapIn() )
{
// kann aus dem original Doc-Stream nachgeladen werden...
- if( pModel != NULL )
+ if( pGraphic->HasUserData() )
{
- if( pGraphic->HasUserData() )
- {
- SdrDocumentStreamInfo aStreamInfo;
+ SdrDocumentStreamInfo aStreamInfo;
- aStreamInfo.mbDeleteAfterUse = sal_False;
- aStreamInfo.maUserData = pGraphic->GetUserData();
+ aStreamInfo.mbDeleteAfterUse = sal_False;
+ aStreamInfo.maUserData = pGraphic->GetUserData();
- SvStream* pStream = pModel->GetDocumentStream( aStreamInfo );
+ SvStream* pStream = getSdrModelFromSdrObject().GetDocumentStream( aStreamInfo );
- if( pStream != NULL )
- {
- Graphic aGraphic;
+ if( pStream != NULL )
+ {
+ Graphic aGraphic;
- com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL;
- if(mbInsidePaint && !GetViewContact().HasViewObjectContacts(true))
- {
- pFilterData = new com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >( 3 );
-
- com::sun::star::awt::Size aPreviewSizeHint( 64, 64 );
- sal_Bool bAllowPartialStreamRead = sal_True;
- sal_Bool bCreateNativeLink = sal_False;
- (*pFilterData)[ 0 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "PreviewSizeHint" ) );
- (*pFilterData)[ 0 ].Value <<= aPreviewSizeHint;
- (*pFilterData)[ 1 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "AllowPartialStreamRead" ) );
- (*pFilterData)[ 1 ].Value <<= bAllowPartialStreamRead;
- (*pFilterData)[ 2 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "CreateNativeLink" ) );
- (*pFilterData)[ 2 ].Value <<= bCreateNativeLink;
-
- mbIsPreview = sal_True;
- }
+ if(mbInsidePaint && !GetViewContact().HasViewObjectContacts(true))
+ {
+ pFilterData = new com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >( 3 );
+
+ com::sun::star::awt::Size aPreviewSizeHint( 64, 64 );
+ sal_Bool bAllowPartialStreamRead = sal_True;
+ sal_Bool bCreateNativeLink = sal_False;
+ (*pFilterData)[ 0 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "PreviewSizeHint" ) );
+ (*pFilterData)[ 0 ].Value <<= aPreviewSizeHint;
+ (*pFilterData)[ 1 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "AllowPartialStreamRead" ) );
+ (*pFilterData)[ 1 ].Value <<= bAllowPartialStreamRead;
+ (*pFilterData)[ 2 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "CreateNativeLink" ) );
+ (*pFilterData)[ 2 ].Value <<= bCreateNativeLink;
+
+ mbIsPreview = sal_True;
+ }
- if(!GraphicFilter::GetGraphicFilter()->ImportGraphic(
- aGraphic, aStreamInfo.maUserData, *pStream,
- GRFILTER_FORMAT_DONTKNOW, NULL, 0, pFilterData))
- {
- const String aUserData( pGraphic->GetUserData() );
+ if(!GraphicFilter::GetGraphicFilter()->ImportGraphic(
+ aGraphic, aStreamInfo.maUserData, *pStream,
+ GRFILTER_FORMAT_DONTKNOW, NULL, 0, pFilterData))
+ {
+ const String aUserData( pGraphic->GetUserData() );
- pGraphic->SetGraphic( aGraphic );
- pGraphic->SetUserData( aUserData );
+ pGraphic->SetGraphic( aGraphic );
+ pGraphic->SetUserData( aUserData );
- // #142146# Graphic successfully swapped in.
- pRet = GRFMGR_AUTOSWAPSTREAM_LOADED;
- }
- delete pFilterData;
+ // #142146# Graphic successfully swapped in.
+ pRet = GRFMGR_AUTOSWAPSTREAM_LOADED;
+ }
+ delete pFilterData;
- pStream->ResetError();
+ pStream->ResetError();
- if( aStreamInfo.mbDeleteAfterUse || aStreamInfo.mxStorageRef.is() )
+ if( aStreamInfo.mbDeleteAfterUse || aStreamInfo.mxStorageRef.is() )
+ {
+ if ( aStreamInfo.mxStorageRef.is() )
{
- if ( aStreamInfo.mxStorageRef.is() )
- {
- aStreamInfo.mxStorageRef->dispose();
- aStreamInfo.mxStorageRef = 0;
- }
-
- delete pStream;
+ aStreamInfo.mxStorageRef->dispose();
+ aStreamInfo.mxStorageRef = 0;
}
+
+ delete pStream;
}
}
- else if( !ImpUpdateGraphicLink( sal_False ) )
- {
- pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
- }
- else
- {
- pRet = GRFMGR_AUTOSWAPSTREAM_LOADED;
- }
}
- else
+ else if( !ImpUpdateGraphicLink( sal_False ) )
+ {
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
+ }
+ else
+ {
+ pRet = GRFMGR_AUTOSWAPSTREAM_LOADED;
+ }
}
return (long)(void*) pRet;
@@ -1560,12 +1409,12 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
// #111096#
// Access to GrafAnimationAllowed flag
-sal_Bool SdrGrafObj::IsGrafAnimationAllowed() const
+bool SdrGrafObj::IsGrafAnimationAllowed() const
{
return mbGrafAnimationAllowed;
}
-void SdrGrafObj::SetGrafAnimationAllowed(sal_Bool bNew)
+void SdrGrafObj::SetGrafAnimationAllowed(bool bNew)
{
if(mbGrafAnimationAllowed != bNew)
{
@@ -1575,65 +1424,59 @@ void SdrGrafObj::SetGrafAnimationAllowed(sal_Bool bNew)
}
// #i25616#
-sal_Bool SdrGrafObj::IsObjectTransparent() const
+bool SdrGrafObj::IsObjectTransparent() const
{
if(((const SdrGrafTransparenceItem&)GetObjectItem(SDRATTR_GRAFTRANSPARENCE)).GetValue()
|| pGraphic->IsTransparent())
{
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
Reference< XInputStream > SdrGrafObj::getInputStream()
{
Reference< XInputStream > xStream;
- if( pModel )
+ // kann aus dem original Doc-Stream nachgeladen werden...
+ if( pGraphic->HasUserData() )
{
-// if( !pGraphic->HasUserData() )
-// pGraphic->SwapOut();
+ SdrDocumentStreamInfo aStreamInfo;
- // kann aus dem original Doc-Stream nachgeladen werden...
- if( pGraphic->HasUserData() )
- {
- SdrDocumentStreamInfo aStreamInfo;
-
- aStreamInfo.mbDeleteAfterUse = sal_False;
- aStreamInfo.maUserData = pGraphic->GetUserData();
+ aStreamInfo.mbDeleteAfterUse = false;
+ aStreamInfo.maUserData = pGraphic->GetUserData();
- SvStream* pStream = pModel->GetDocumentStream( aStreamInfo );
+ SvStream* pStream = getSdrModelFromSdrObject().GetDocumentStream( aStreamInfo );
- if( pStream )
- xStream.set( new utl::OInputStreamWrapper( pStream, sal_True ) );
- }
- else if( pGraphic && GetGraphic().IsLink() )
+ if( pStream )
+ xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
+ }
+ else if( pGraphic && GetGraphic().IsLink() )
+ {
+ Graphic aGraphic( GetGraphic() );
+ GfxLink aLink( aGraphic.GetLink() );
+ sal_uInt32 nSize = aLink.GetDataSize();
+ const void* pSourceData = (const void*)aLink.GetData();
+ if( nSize && pSourceData )
{
- Graphic aGraphic( GetGraphic() );
- GfxLink aLink( aGraphic.GetLink() );
- sal_uInt32 nSize = aLink.GetDataSize();
- const void* pSourceData = (const void*)aLink.GetData();
- if( nSize && pSourceData )
+ sal_uInt8 * pBuffer = new sal_uInt8[ nSize ];
+ if( pBuffer )
{
- sal_uInt8 * pBuffer = new sal_uInt8[ nSize ];
- if( pBuffer )
- {
- memcpy( pBuffer, pSourceData, nSize );
+ memcpy( pBuffer, pSourceData, nSize );
- SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, STREAM_READ );
- pStream->ObjectOwnsMemory( sal_True );
- xStream.set( new utl::OInputStreamWrapper( pStream, sal_True ) );
- }
+ SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, STREAM_READ );
+ pStream->ObjectOwnsMemory( true );
+ xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
}
}
+ }
- if( !xStream.is() && aFileName.Len() )
- {
- SvFileStream* pStream = new SvFileStream( aFileName, STREAM_READ );
- if( pStream )
- xStream.set( new utl::OInputStreamWrapper( pStream ) );
- }
+ if( !xStream.is() && aFileName.Len() )
+ {
+ SvFileStream* pStream = new SvFileStream( aFileName, STREAM_READ );
+ if( pStream )
+ xStream.set( new utl::OInputStreamWrapper( pStream ) );
}
return xStream;
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 7acee8d8d2cf..e7c5aae73a95 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -28,297 +28,302 @@
#include <ucbhelper/content.hxx>
#include <ucbhelper/contentbroker.hxx>
#include <unotools/datetime.hxx>
-
#include <svx/svdogrp.hxx>
-
#include <sfx2/lnkbase.hxx>
#include <tools/urlobj.hxx>
-
#include <svl/urihelper.hxx>
-
#include <svx/xpool.hxx>
#include <svx/xpoly.hxx>
-
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdetc.hxx>
#include <svx/svdattrx.hxx> // NotPersistItems
#include <svx/svdoedge.hxx> // #32383# Die Verbinder nach Move nochmal anbroadcasten
-#include "svx/svdglob.hxx" // StringCache
-#include "svx/svdstr.hrc" // Objektname
+#include <svx/svdglob.hxx> // StringCache
+#include <svx/svdstr.hrc> // Objektname
#include <svx/svxids.hrc>
#include <svl/whiter.hxx>
#include <svx/svdpool.hxx>
#include <svx/sdr/properties/groupproperties.hxx>
-
-// #110094#
#include <svx/sdr/contact/viewcontactofgroup.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@@ @@@@ @@@@@ @@@@ @@ @@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@@ @@@@@ @@ @@ @@ @@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@@@@ @@@@ @@@@@ @@ @@ @@@@ @@@@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
-// BaseProperties section
sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
{
return new sdr::properties::GroupProperties(*this);
}
-//////////////////////////////////////////////////////////////////////////////
-// #110094# DrawContact section
-
sdr::contact::ViewContact* SdrObjGroup::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfGroup(*this);
}
-//////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1(SdrObjGroup,SdrObject);
-
-SdrObjGroup::SdrObjGroup()
+SdrObjGroup::SdrObjGroup(SdrModel& rSdrModel)
+: SdrObject(rSdrModel),
+ SdrObjList()
{
- pSub=new SdrObjList(NULL,NULL);
- pSub->SetOwnerObj(this);
- pSub->SetListKind(SDROBJLIST_GROUPOBJ);
- bRefPoint=sal_False;
- nDrehWink=0;
- nShearWink=0;
- bClosedObj=sal_False;
}
-
SdrObjGroup::~SdrObjGroup()
{
- delete pSub;
+ if(GetObjCount())
+ {
+ // cannot be called in SdrObjList::ClearSdrObjList() where it originally was
+ // since there it would be a pure virtual function call. Needs to be called
+ // in all destructors of classes derived from SdrObjList
+ getSdrModelFromSdrObjList().SetChanged();
+ }
}
-void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
+void SdrObjGroup::copyDataFromSdrObject(const SdrObject& rSource)
{
- rInfo.bNoContortion=sal_False;
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- SdrObjTransformInfoRec aInfo;
- pObj->TakeObjInfo(aInfo);
- if (!aInfo.bMoveAllowed ) rInfo.bMoveAllowed =sal_False;
- if (!aInfo.bResizeFreeAllowed ) rInfo.bResizeFreeAllowed =sal_False;
- if (!aInfo.bResizePropAllowed ) rInfo.bResizePropAllowed =sal_False;
- if (!aInfo.bRotateFreeAllowed ) rInfo.bRotateFreeAllowed =sal_False;
- if (!aInfo.bRotate90Allowed ) rInfo.bRotate90Allowed =sal_False;
- if (!aInfo.bMirrorFreeAllowed ) rInfo.bMirrorFreeAllowed =sal_False;
- if (!aInfo.bMirror45Allowed ) rInfo.bMirror45Allowed =sal_False;
- if (!aInfo.bMirror90Allowed ) rInfo.bMirror90Allowed =sal_False;
- if (!aInfo.bShearAllowed ) rInfo.bShearAllowed =sal_False;
- if (!aInfo.bEdgeRadiusAllowed ) rInfo.bEdgeRadiusAllowed =sal_False;
- if (!aInfo.bNoOrthoDesired ) rInfo.bNoOrthoDesired =sal_False;
- if (aInfo.bNoContortion ) rInfo.bNoContortion =sal_True;
- if (!aInfo.bCanConvToPath ) rInfo.bCanConvToPath =sal_False;
-
- if(!aInfo.bCanConvToContour)
- rInfo.bCanConvToContour = sal_False;
-
- if (!aInfo.bCanConvToPoly ) rInfo.bCanConvToPoly =sal_False;
- if (!aInfo.bCanConvToPathLineToArea) rInfo.bCanConvToPathLineToArea=sal_False;
- if (!aInfo.bCanConvToPolyLineToArea) rInfo.bCanConvToPolyLineToArea=sal_False;
- }
- if (nObjAnz==0) {
- rInfo.bRotateFreeAllowed=sal_False;
- rInfo.bRotate90Allowed =sal_False;
- rInfo.bMirrorFreeAllowed=sal_False;
- rInfo.bMirror45Allowed =sal_False;
- rInfo.bMirror90Allowed =sal_False;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed =sal_False;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bNoContortion =sal_True;
- }
- if(nObjAnz != 1)
+ if(this != &rSource)
{
- // only allowed if single object selected
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
+ const SdrObjGroup* pSource = dynamic_cast< const SdrObjGroup* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrObject::copyDataFromSdrObject(rSource);
+
+ // copy SubList
+ copyDataFromSdrObjList(*pSource);
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
}
}
-
-void SdrObjGroup::SetBoundRectDirty()
+SdrObject* SdrObjGroup::CloneSdrObject(SdrModel* pTargetModel) const
{
- // avoid resetting aOutRect which in case of this object is model data,
- // not re-creatable view data
+ SdrObjGroup* pClone = new SdrObjGroup(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
-sal_uInt16 SdrObjGroup::GetObjIdentifier() const
+SdrPage* SdrObjGroup::getSdrPageFromSdrObjList() const
{
- return sal_uInt16(OBJ_GRUP);
+ return getSdrPageFromSdrObject();
}
-
-SdrLayerID SdrObjGroup::GetLayer() const
+SdrObject* SdrObjGroup::getSdrObjectFromSdrObjList() const
{
- FASTBOOL b1st=sal_True;
- SdrLayerID nLay=SdrLayerID(SdrObject::GetLayer());
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrLayerID nLay1=pOL->GetObj(i)->GetLayer();
- if (b1st) { nLay=nLay1; b1st=sal_False; }
- else if (nLay1!=nLay) return 0;
- }
- return nLay;
+ return const_cast< SdrObjGroup* >(this);
}
-
-void SdrObjGroup::NbcSetLayer(SdrLayerID nLayer)
+SdrModel& SdrObjGroup::getSdrModelFromSdrObjList() const
{
- SdrObject::NbcSetLayer(nLayer);
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- pOL->GetObj(i)->NbcSetLayer(nLayer);
- }
+ return getSdrModelFromSdrObject();
}
-
-void SdrObjGroup::SetObjList(SdrObjList* pNewObjList)
+void SdrObjGroup::handleContentChange(const SfxHint& rHint)
{
- SdrObject::SetObjList(pNewObjList);
- pSub->SetUpList(pNewObjList);
-}
+ // call parent
+ SdrObjList::handleContentChange(rHint);
+ // needed object updates
+ SetChanged();
-void SdrObjGroup::SetPage(SdrPage* pNewPage)
-{
- SdrObject::SetPage(pNewPage);
- pSub->SetPage(pNewPage);
+ // reset local transformation to allow on-demand recalculation
+ maSdrObjectTransformation.setB2DHomMatrix(basegfx::B2DHomMatrix());
}
+SdrObjList* SdrObjGroup::getChildrenOfSdrObject() const
+{
+ return const_cast< SdrObjGroup* >(this);
+}
-void SdrObjGroup::SetModel(SdrModel* pNewModel)
+void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- if(pNewModel!=pModel)
+ rInfo.mbNoContortion = false;
+ const sal_uInt32 nObjAnz(GetObjCount());
+
+ for(sal_uInt32 i(0); i < nObjAnz; i++)
{
- // #i30648#
- // This method also needs to migrate the used ItemSet
- // when the destination model uses a different pool
- // than the current one. Else it is possible to create
- // SdrObjGroups which reference the old pool which might
- // be destroyed (as the bug shows).
- SdrModel* pOldModel = pModel;
-
- // test for correct pool in ItemSet; move to new pool if necessary
- if(pNewModel && GetObjectItemPool() && GetObjectItemPool() != &pNewModel->GetItemPool())
+ SdrObject* pObj = GetObj(i);
+ SdrObjTransformInfoRec aInfo;
+ pObj->TakeObjInfo(aInfo);
+
+ if(!aInfo.mbMoveAllowed)
{
- MigrateItemPool(GetObjectItemPool(), &pNewModel->GetItemPool(), pNewModel);
+ rInfo.mbMoveAllowed = false;
}
- // call parent
- SdrObject::SetModel(pNewModel);
+ if(!aInfo.mbResizeFreeAllowed)
+ {
+ rInfo.mbResizeFreeAllowed = false;
+ }
- // set new model at content
- pSub->SetModel(pNewModel);
+ if(!aInfo.mbResizePropAllowed)
+ {
+ rInfo.mbResizePropAllowed = false;
+ }
- // modify properties
- GetProperties().SetModel(pOldModel, pNewModel);
- }
-}
+ if(!aInfo.mbRotateFreeAllowed)
+ {
+ rInfo.mbRotateFreeAllowed = false;
+ }
+ if(!aInfo.mbRotate90Allowed)
+ {
+ rInfo.mbRotate90Allowed = false;
+ }
-FASTBOOL SdrObjGroup::HasRefPoint() const
-{
- return bRefPoint;
-}
+ if(!aInfo.mbMirrorFreeAllowed)
+ {
+ rInfo.mbMirrorFreeAllowed = false;
+ }
+ if(!aInfo.mbMirror45Allowed)
+ {
+ rInfo.mbMirror45Allowed = false;
+ }
-Point SdrObjGroup::GetRefPoint() const
-{
- return aRefPoint;
-}
+ if(!aInfo.mbMirror90Allowed)
+ {
+ rInfo.mbMirror90Allowed = false;
+ }
+
+ if(!aInfo.mbShearAllowed)
+ {
+ rInfo.mbShearAllowed = false;
+ }
+ if(!aInfo.mbEdgeRadiusAllowed)
+ {
+ rInfo.mbEdgeRadiusAllowed = false;
+ }
-void SdrObjGroup::SetRefPoint(const Point& rPnt)
-{
- bRefPoint=sal_True;
- aRefPoint=rPnt;
-}
+ if(!aInfo.mbNoOrthoDesired)
+ {
+ rInfo.mbNoOrthoDesired = false;
+ }
+
+ if(aInfo.mbNoContortion)
+ {
+ rInfo.mbNoContortion = true;
+ }
+
+ if(!aInfo.mbCanConvToPath)
+ {
+ rInfo.mbCanConvToPath = false;
+ }
+
+ if(!aInfo.mbCanConvToContour)
+ {
+ rInfo.mbCanConvToContour = false;
+ }
+
+ if(!aInfo.mbCanConvToPoly)
+ {
+ rInfo.mbCanConvToPoly = false;
+ }
+
+ if(!aInfo.mbCanConvToPathLineToArea)
+ {
+ rInfo.mbCanConvToPathLineToArea = false;
+ }
+ if(!aInfo.mbCanConvToPolyLineToArea)
+ {
+ rInfo.mbCanConvToPolyLineToArea = false;
+ }
+ }
+
+ if(!nObjAnz)
+ {
+ rInfo.mbRotateFreeAllowed = false;
+ rInfo.mbRotate90Allowed = false;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbMirror45Allowed = false;
+ rInfo.mbMirror90Allowed = false;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbNoContortion = true;
+ }
+
+ if(1 != nObjAnz)
+ {
+ // only allowed if single object selected
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ }
+}
-SdrObjList* SdrObjGroup::GetSubList() const
+sal_uInt16 SdrObjGroup::GetObjIdentifier() const
{
- return pSub;
+ return sal_uInt16(OBJ_GRUP);
}
-const Rectangle& SdrObjGroup::GetCurrentBoundRect() const
+SdrLayerID SdrObjGroup::GetLayer() const
{
- // --> OD 2007-02-01 #144962#
- // <aOutRect> has to contain the bounding rectangle
- if ( pSub->GetObjCount()!=0 )
+ bool b1st(true);
+ SdrLayerID nLay(SdrObject::GetLayer());
+ const sal_uInt32 nObjAnz(GetObjCount());
+
+ for(sal_uInt32 i(0); i < nObjAnz; i++)
{
- const_cast<SdrObjGroup*>(this)->aOutRect = pSub->GetAllObjBoundRect();
+ SdrLayerID nLay1 = GetObj(i)->GetLayer();
+
+ if(b1st)
+ {
+ nLay = nLay1;
+ b1st = false;
+ }
+ else if(nLay1 != nLay)
+ {
+ return 0;
+ }
}
- return aOutRect;
- // <--
+ return nLay;
}
-const Rectangle& SdrObjGroup::GetSnapRect() const
+void SdrObjGroup::SetLayer(SdrLayerID nLayer)
{
- // --> OD 2007-02-01 #144962#
- // <aOutRect> has to contain the bounding rectangle
- if ( pSub->GetObjCount()!=0 )
- {
- return pSub->GetAllObjSnapRect();
- }
- else
+ SdrObject::SetLayer(nLayer);
+ const sal_uInt32 nObjAnz(GetObjCount());
+
+ for(sal_uInt32 i(0); i < nObjAnz; i++)
{
- return aOutRect;
+ GetObj(i)->SetLayer(nLayer);
}
- // <--
}
-void SdrObjGroup::operator=(const SdrObject& rObj)
+void SdrObjGroup::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
{
- if(rObj.IsGroupObject())
+ if(pOldPage != pNewPage)
{
- // copy SdrObject stuff
- SdrObject::operator=(rObj);
-
- // #i36404#
- // copy SubList, init model and page first
- SdrObjList& rSourceSubList = *rObj.GetSubList();
- pSub->SetPage(rSourceSubList.GetPage());
- pSub->SetModel(rSourceSubList.GetModel());
- pSub->CopyObjects(*rObj.GetSubList());
-
- // copy local paremeters
- nDrehWink =((SdrObjGroup&)rObj).nDrehWink;
- nShearWink =((SdrObjGroup&)rObj).nShearWink;
- aRefPoint =((SdrObjGroup&)rObj).aRefPoint;
- bRefPoint =((SdrObjGroup&)rObj).bRefPoint;
+ // call parent
+ SdrObject::handlePageChange(pOldPage, pNewPage);
+
+ for(sal_uInt32 i(0); i < GetObjCount(); i++)
+ {
+ GetObj(i)->handlePageChange(pOldPage, pNewPage);
+ }
}
}
-
void SdrObjGroup::TakeObjNameSingul(XubString& rName) const
{
- if(!pSub->GetObjCount())
+ if(!GetObjCount())
{
rName = ImpGetResStr(STR_ObjNameSingulGRUPEMPTY);
}
@@ -338,37 +343,34 @@ void SdrObjGroup::TakeObjNameSingul(XubString& rName) const
}
}
-
void SdrObjGroup::TakeObjNamePlural(XubString& rName) const
{
- if (pSub->GetObjCount()==0) {
- rName=ImpGetResStr(STR_ObjNamePluralGRUPEMPTY);
- } else {
- rName=ImpGetResStr(STR_ObjNamePluralGRUP);
+ if(!GetObjCount())
+ {
+ rName = ImpGetResStr(STR_ObjNamePluralGRUPEMPTY);
+ }
+ else
+ {
+ rName = ImpGetResStr(STR_ObjNamePluralGRUP);
}
-}
-
-
-void SdrObjGroup::RecalcSnapRect()
-{
- // nicht erforderlich, da die Rects von der SubList verwendet werden.
}
basegfx::B2DPolyPolygon SdrObjGroup::TakeXorPoly() const
{
basegfx::B2DPolyPolygon aRetval;
- const sal_uInt32 nObjCount(pSub->GetObjCount());
+ const sal_uInt32 nObjCount(GetObjCount());
- for(sal_uInt32 a(0L); a < nObjCount; a++)
+ for(sal_uInt32 a(0); a < nObjCount; a++)
{
- SdrObject* pObj = pSub->GetObj(a);
+ SdrObject* pObj = GetObj(a);
aRetval.append(pObj->TakeXorPoly());
}
if(!aRetval.count())
{
- const basegfx::B2DRange aRange(aOutRect.Left(), aOutRect.Top(), aOutRect.Right(), aOutRect.Bottom());
- aRetval.append(basegfx::tools::createPolygonFromRect(aRange));
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetAllObjSnapRange(getSdrObjectVector()));
+
+ aRetval.append(basegfx::tools::createPolygonFromRect(aSnapRange));
}
return aRetval;
@@ -379,418 +381,129 @@ bool SdrObjGroup::beginSpecialDrag(SdrDragStat& /*rDrag*/) const
return false;
}
-
-FASTBOOL SdrObjGroup::BegCreate(SdrDragStat& /*rStat*/)
-{
- return sal_False;
-}
-
-
-long SdrObjGroup::GetRotateAngle() const
-{
- return nDrehWink;
-}
-
-
-long SdrObjGroup::GetShearAngle(FASTBOOL /*bVertical*/) const
+bool SdrObjGroup::BegCreate(SdrDragStat& /*rStat*/)
{
- return nShearWink;
-}
-
-
-void SdrObjGroup::NbcSetSnapRect(const Rectangle& rRect)
-{
- Rectangle aOld(GetSnapRect());
- long nMulX=rRect.Right()-rRect.Left();
- long nDivX=aOld.Right()-aOld.Left();
- long nMulY=rRect.Bottom()-rRect.Top();
- long nDivY=aOld.Bottom()-aOld.Top();
- if (nDivX==0) { nMulX=1; nDivX=1; }
- if (nDivY==0) { nMulY=1; nDivY=1; }
- if (nMulX!=nDivX || nMulY!=nDivY) {
- Fraction aX(nMulX,nDivX);
- Fraction aY(nMulY,nDivY);
- NbcResize(aOld.TopLeft(),aX,aY);
- }
- if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
- NbcMove(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
- }
-}
-
-
-void SdrObjGroup::NbcSetLogicRect(const Rectangle& rRect)
-{
- NbcSetSnapRect(rRect);
+ // do not construct empty groups interactively
+ return false;
}
-
-void SdrObjGroup::NbcMove(const Size& rSiz)
+const basegfx::B2DHomMatrix& SdrObjGroup::getSdrObjectTransformation() const
{
- MovePoint(aRefPoint,rSiz);
- if (pSub->GetObjCount()!=0) {
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- pObj->NbcMove(rSiz);
- }
- } else {
- MoveRect(aOutRect,rSiz);
- SetRectsDirty();
- }
-}
+ const sal_uInt32 nCount(GetObjCount());
+ if(nCount)
+ {
+ // transformation of the group is it's size (scale) and position (translation)
+ // of all sub-objects combined. To not always create this, use isIdentity() as
+ // hint for recalculation
+ if(maSdrObjectTransformation.getB2DHomMatrix().isIdentity())
+ {
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetAllObjSnapRange(getSdrObjectVector()));
-void SdrObjGroup::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- FASTBOOL bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
- FASTBOOL bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
- if (bXMirr || bYMirr) {
- Point aRef1(GetSnapRect().Center());
- if (bXMirr) {
- Point aRef2(aRef1);
- aRef2.Y()++;
- NbcMirrorGluePoints(aRef1,aRef2);
- }
- if (bYMirr) {
- Point aRef2(aRef1);
- aRef2.X()++;
- NbcMirrorGluePoints(aRef1,aRef2);
+ const_cast< SdrObjGroup* >(this)->maSdrObjectTransformation.setB2DHomMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSnapRange.getRange(),
+ aSnapRange.getMinimum()));
}
}
- ResizePoint(aRefPoint,rRef,xFact,yFact);
- if (pSub->GetObjCount()!=0) {
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- pObj->NbcResize(rRef,xFact,yFact);
- }
- } else {
- ResizeRect(aOutRect,rRef,xFact,yFact);
- SetRectsDirty();
- }
-}
-
-
-void SdrObjGroup::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
-{
- SetGlueReallyAbsolute(sal_True);
- nDrehWink=NormAngle360(nDrehWink+nWink);
- RotatePoint(aRefPoint,rRef,sn,cs);
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- pObj->NbcRotate(rRef,nWink,sn,cs);
- }
- NbcRotateGluePoints(rRef,nWink,sn,cs);
- SetGlueReallyAbsolute(sal_False);
-}
-
-
-void SdrObjGroup::NbcMirror(const Point& rRef1, const Point& rRef2)
-{
- SetGlueReallyAbsolute(sal_True);
- MirrorPoint(aRefPoint,rRef1,rRef2); // fehlende Implementation in SvdEtc !!!
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- pObj->NbcMirror(rRef1,rRef2);
- }
- NbcMirrorGluePoints(rRef1,rRef2);
- SetGlueReallyAbsolute(sal_False);
-}
-
-
-void SdrObjGroup::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
-{
- SetGlueReallyAbsolute(sal_True);
- nShearWink+=nWink;
- ShearPoint(aRefPoint,rRef,tn);
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- pObj->NbcShear(rRef,nWink,tn,bVShear);
- }
- NbcShearGluePoints(rRef,nWink,tn,bVShear);
- SetGlueReallyAbsolute(sal_False);
-}
-
-
-void SdrObjGroup::NbcSetAnchorPos(const Point& rPnt)
-{
- aAnchor=rPnt;
- Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
- MovePoint(aRefPoint,aSiz);
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- pObj->NbcSetAnchorPos(rPnt);
- }
-}
-
-
-void SdrObjGroup::SetSnapRect(const Rectangle& rRect)
-{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- Rectangle aOld(GetSnapRect());
- long nMulX=rRect.Right()-rRect.Left();
- long nDivX=aOld.Right()-aOld.Left();
- long nMulY=rRect.Bottom()-rRect.Top();
- long nDivY=aOld.Bottom()-aOld.Top();
- if (nDivX==0) { nMulX=1; nDivX=1; }
- if (nDivY==0) { nMulY=1; nDivY=1; }
- if (nMulX!=nDivX || nMulY!=nDivY) {
- Fraction aX(nMulX,nDivX);
- Fraction aY(nMulY,nDivY);
- Resize(aOld.TopLeft(),aX,aY);
- }
- if (rRect.Left()!=aOld.Left() || rRect.Top()!=aOld.Top()) {
- Move(Size(rRect.Left()-aOld.Left(),rRect.Top()-aOld.Top()));
+ else
+ {
+ // keep and return the last known transformation when there is no content,
+ // so just do nothing
}
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+ // call parent
+ return SdrObject::getSdrObjectTransformation();
}
-
-void SdrObjGroup::SetLogicRect(const Rectangle& rRect)
+void SdrObjGroup::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- SetSnapRect(rRect);
-}
+ const basegfx::B2DHomMatrix& rCurrent = getSdrObjectTransformation();
+ if(rTransformation != rCurrent)
+ {
+ const sal_uInt32 nCount(GetObjCount());
-void SdrObjGroup::Move(const Size& rSiz)
-{
- if (rSiz.Width()!=0 || rSiz.Height()!=0) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- MovePoint(aRefPoint,rSiz);
- if (pSub->GetObjCount()!=0) {
- // #32383# Erst die Verbinder verschieben, dann den Rest
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- sal_uIntPtr i;
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (pObj->IsEdgeObj()) pObj->Move(rSiz);
- }
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (!pObj->IsEdgeObj()) pObj->Move(rSiz);
+ if(nCount)
+ {
+ // to apply the transformation to sub-objects, remove current transformation
+ // by using it's inverse, then transform by the new transformation. Prepare
+ // inverse combined with transformation
+ basegfx::B2DHomMatrix aTransform(rCurrent);
+
+ aTransform.invert();
+ aTransform = rTransformation * aTransform;
+
+ // apply to all sub-objects
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ SdrObject* pCandidate = GetObj(a);
+ pCandidate->setSdrObjectTransformation(aTransform * pCandidate->getSdrObjectTransformation());
}
- } else {
- // #110094#-14 SendRepaintBroadcast();
- MoveRect(aOutRect,rSiz);
- SetRectsDirty();
- }
-
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
- }
-}
+ // call parent; needed to trigger invalidateObjectRange and others
+ SdrObject::setSdrObjectTransformation(rTransformation);
-void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
- FASTBOOL bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
- FASTBOOL bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
- if (bXMirr || bYMirr) {
- Point aRef1(GetSnapRect().Center());
- if (bXMirr) {
- Point aRef2(aRef1);
- aRef2.Y()++;
- NbcMirrorGluePoints(aRef1,aRef2);
- }
- if (bYMirr) {
- Point aRef2(aRef1);
- aRef2.X()++;
- NbcMirrorGluePoints(aRef1,aRef2);
- }
+ // reset local transformation since it's a sum-up of the content
+ maSdrObjectTransformation.setB2DHomMatrix(basegfx::B2DHomMatrix());
}
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- ResizePoint(aRefPoint,rRef,xFact,yFact);
- if (pSub->GetObjCount()!=0) {
- // #32383# Erst die Verbinder verschieben, dann den Rest
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- sal_uIntPtr i;
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact);
- }
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (!pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact);
- }
- } else {
- // #110094#-14 SendRepaintBroadcast();
- ResizeRect(aOutRect,rRef,xFact,yFact);
- SetRectsDirty();
+ else
+ {
+ // no sub-objects; set directly
+ SdrObject::setSdrObjectTransformation(rTransformation);
}
-
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
}
-
-void SdrObjGroup::Rotate(const Point& rRef, long nWink, double sn, double cs)
+void SdrObjGroup::SetAnchorPos(const basegfx::B2DPoint& rPnt)
{
- if (nWink!=0) {
- SetGlueReallyAbsolute(sal_True);
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- nDrehWink=NormAngle360(nDrehWink+nWink);
- RotatePoint(aRefPoint,rRef,sn,cs);
- // #32383# Erst die Verbinder verschieben, dann den Rest
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- sal_uIntPtr i;
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (pObj->IsEdgeObj()) pObj->Rotate(rRef,nWink,sn,cs);
- }
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (!pObj->IsEdgeObj()) pObj->Rotate(rRef,nWink,sn,cs);
- }
- NbcRotateGluePoints(rRef,nWink,sn,cs);
- SetGlueReallyAbsolute(sal_False);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- }
-}
-
+ SdrObject::SetAnchorPos(rPnt);
-void SdrObjGroup::Mirror(const Point& rRef1, const Point& rRef2)
-{
- SetGlueReallyAbsolute(sal_True);
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- MirrorPoint(aRefPoint,rRef1,rRef2); // fehlende Implementation in SvdEtc !!!
- // #32383# Erst die Verbinder verschieben, dann den Rest
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- sal_uIntPtr i;
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (pObj->IsEdgeObj()) pObj->Mirror(rRef1,rRef2);
- }
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (!pObj->IsEdgeObj()) pObj->Mirror(rRef1,rRef2);
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ GetObj(a)->SetAnchorPos(rPnt);
}
- NbcMirrorGluePoints(rRef1,rRef2);
- SetGlueReallyAbsolute(sal_False);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
-
-void SdrObjGroup::Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+void SdrObjGroup::ReformatText()
{
- if (nWink!=0) {
- SetGlueReallyAbsolute(sal_True);
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- nShearWink+=nWink;
- ShearPoint(aRefPoint,rRef,tn);
- // #32383# Erst die Verbinder verschieben, dann den Rest
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- sal_uIntPtr i;
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (pObj->IsEdgeObj()) pObj->Shear(rRef,nWink,tn,bVShear);
- }
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (!pObj->IsEdgeObj()) pObj->Shear(rRef,nWink,tn,bVShear);
- }
- NbcShearGluePoints(rRef,nWink,tn,bVShear);
- SetGlueReallyAbsolute(sal_False);
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- }
-}
-
+ SdrObject::ReformatText();
-void SdrObjGroup::SetAnchorPos(const Point& rPnt)
-{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- FASTBOOL bChg=aAnchor!=rPnt;
- aAnchor=rPnt;
- Size aSiz(rPnt.X()-aAnchor.X(),rPnt.Y()-aAnchor.Y());
- MovePoint(aRefPoint,aSiz);
- // #32383# Erst die Verbinder verschieben, dann den Rest
- SdrObjList* pOL=pSub;
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- sal_uIntPtr i;
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (pObj->IsEdgeObj()) pObj->SetAnchorPos(rPnt);
- }
- for (i=0; i<nObjAnz; i++) {
- SdrObject* pObj=pOL->GetObj(i);
- if (!pObj->IsEdgeObj()) pObj->SetAnchorPos(rPnt);
- }
- if (bChg) {
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ GetObj(a)->ReformatText();
}
}
-
-
-void SdrObjGroup::NbcSetRelativePos(const Point& rPnt)
+SdrObject* SdrObjGroup::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
- Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
- Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
- NbcMove(aSiz); // Der ruft auch das SetRectsDirty()
-}
+ SdrObjGroup* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
-void SdrObjGroup::SetRelativePos(const Point& rPnt)
-{
- Point aRelPos0(GetSnapRect().TopLeft()-aAnchor);
- Size aSiz(rPnt.X()-aRelPos0.X(),rPnt.Y()-aRelPos0.Y());
- if (aSiz.Width()!=0 || aSiz.Height()!=0) Move(aSiz); // Der ruft auch das SetRectsDirty() und Broadcast, ...
-}
+ for(sal_uInt32 a(0); a < GetObjCount(); a++)
+ {
+ SdrObject* pIterObj = GetObj(a);
+ SdrObject* pResult = pIterObj->DoConvertToPolygonObject(bBezier, bAddText);
-void SdrObjGroup::NbcReformatText()
-{
- pSub->NbcReformatAllTextObjects();
-}
+ // pResult can be NULL e.g. for empty objects
+ if(pResult)
+ {
+ pGroup->InsertObjectToSdrObjList(*pResult);
+ }
+ }
-void SdrObjGroup::ReformatText()
-{
- pSub->ReformatAllTextObjects();
+ return pGroup;
}
-SdrObject* SdrObjGroup::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+void SdrObjGroup::getMergedHierarchyLayerSet(SetOfByte& rSet) const
{
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->SetModel(GetModel());
+ SdrObject::getMergedHierarchyLayerSet(rSet);
+ const sal_uInt32 nObjAnz(GetObjCount());
- for(sal_uInt32 a=0;a<pSub->GetObjCount();a++)
+ for(sal_uInt32 nObjNum(0); nObjNum < nObjAnz; nObjNum++)
{
- SdrObject* pIterObj = pSub->GetObj(a);
- SdrObject* pResult = pIterObj->DoConvertToPolyObj(bBezier, bAddText);
-
- // pResult can be NULL e.g. for empty objects
- if( pResult )
- pGroup->GetSubList()->NbcInsertObject(pResult);
+ GetObj(nObjNum)->getMergedHierarchyLayerSet(rSet);
}
-
- return pGroup;
}
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 554b6b4f85eb..9344837d272d 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -26,7 +26,8 @@
#include <svx/svdomeas.hxx>
#include <math.h>
-#include "svx/svditext.hxx" //
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/xpoly.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdhdl.hxx>
@@ -57,7 +58,6 @@
#include <svx/svdopath.hxx>
#include <svx/svdpage.hxx>
#include <unotools/syslocale.hxx>
-#include "svdoimp.hxx"
#include <svx/sdr/properties/measureproperties.hxx>
#include <svx/sdr/contact/viewcontactofsdrmeasureobj.hxx>
#include <basegfx/point/b2dpoint.hxx>
@@ -71,6 +71,13 @@
SdrMeasureObjGeoData::SdrMeasureObjGeoData() {}
SdrMeasureObjGeoData::~SdrMeasureObjGeoData() {}
+void SdrMeasureObj::SetTextDirty()
+{
+ bTextDirty = true;
+ SetTextSizeDirty();
+ ActionChanged();
+}
+
void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMeasureFieldKind ) const
{
rStr.Erase();
@@ -81,80 +88,69 @@ void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMe
FieldUnit eModUIUnit(FUNIT_NONE);
const SfxItemSet& rSet = GetMergedItemSet();
- bTextRota90 = ((SdrMeasureTextRota90Item&)rSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue();
+ bTextRota90 = ((SdrYesNoItem&)rSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue();
eMeasureUnit = ((SdrMeasureUnitItem&)rSet.Get(SDRATTR_MEASUREUNIT)).GetValue();
- aMeasureScale = ((SdrMeasureScaleItem&)rSet.Get(SDRATTR_MEASURESCALE)).GetValue();
- bShowUnit = ((SdrMeasureShowUnitItem&)rSet.Get(SDRATTR_MEASURESHOWUNIT)).GetValue();
- sal_Int16 nNumDigits = ((SdrMeasureDecimalPlacesItem&)rSet.Get(SDRATTR_MEASUREDECIMALPLACES)).GetValue();
-
- //SdrModel* pModel = rObj.pModel;
+ aMeasureScale = ((SdrScaleItem&)rSet.Get(SDRATTR_MEASURESCALE)).GetValue();
+ bShowUnit = ((SdrYesNoItem&)rSet.Get(SDRATTR_MEASURESHOWUNIT)).GetValue();
+ sal_Int16 nNumDigits = ((SfxInt16Item&)rSet.Get(SDRATTR_MEASUREDECIMALPLACES)).GetValue();
switch(eMeasureFieldKind)
{
case SDRMEASUREFIELD_VALUE:
{
- if(pModel)
+ eModUIUnit = getSdrModelFromSdrObject().GetUIUnit();
+
+ if(eMeasureUnit == FUNIT_NONE)
+ eMeasureUnit = eModUIUnit;
+
+ sal_Int32 nLen(GetLen(aPt2 - aPt1));
+ Fraction aFact(1,1);
+
+ if(eMeasureUnit != eModUIUnit)
{
- eModUIUnit = pModel->GetUIUnit();
+ // Zur Umrechnung der Einheiten
+ aFact *= GetMapFactor(eModUIUnit, eMeasureUnit).X();
+ }
- if(eMeasureUnit == FUNIT_NONE)
- eMeasureUnit = eModUIUnit;
+ if(aMeasureScale.GetNumerator() != aMeasureScale.GetDenominator())
+ {
+ aFact *= aMeasureScale;
+ }
- sal_Int32 nLen(GetLen(aPt2 - aPt1));
- Fraction aFact(1,1);
+ if(aFact.GetNumerator() != aFact.GetDenominator())
+ {
+ // Scaling ueber BigInt, um Ueberlaeufe zu vermeiden
+ nLen = BigMulDiv(nLen, aFact.GetNumerator(), aFact.GetDenominator());
+ }
- if(eMeasureUnit != eModUIUnit)
- {
- // Zur Umrechnung der Einheiten
- aFact *= GetMapFactor(eModUIUnit, eMeasureUnit).X();
- }
+ getSdrModelFromSdrObject().TakeMetricStr(nLen, rStr, true, nNumDigits);
- if(aMeasureScale.GetNumerator() != aMeasureScale.GetDenominator())
- {
- aFact *= aMeasureScale;
- }
+ if(!aFact.IsValid())
+ {
+ rStr = String();
+ rStr += sal_Unicode('?');
+ }
- if(aFact.GetNumerator() != aFact.GetDenominator())
- {
- // Scaling ueber BigInt, um Ueberlaeufe zu vermeiden
- nLen = BigMulDiv(nLen, aFact.GetNumerator(), aFact.GetDenominator());
- }
+ sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0));
- pModel->TakeMetricStr(nLen, rStr, sal_True, nNumDigits);
+ if(rStr.Search(cDec) != STRING_NOTFOUND)
+ {
+ xub_StrLen nLen2(rStr.Len() - 1);
- if(!aFact.IsValid())
+ while(rStr.GetChar(nLen2) == sal_Unicode('0'))
{
- rStr = String();
- rStr += sal_Unicode('?');
+ rStr.Erase(nLen2);
+ nLen2--;
}
- sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep().GetChar(0));
-
- if(rStr.Search(cDec) != STRING_NOTFOUND)
+ if(rStr.GetChar(nLen2) == cDec)
{
- xub_StrLen nLen2(rStr.Len() - 1);
-
- while(rStr.GetChar(nLen2) == sal_Unicode('0'))
- {
- rStr.Erase(nLen2);
- nLen2--;
- }
-
- if(rStr.GetChar(nLen2) == cDec)
- {
- rStr.Erase(nLen2);
- nLen2--;
- }
-
- if(!rStr.Len())
- rStr += sal_Unicode('0');
+ rStr.Erase(nLen2);
+ nLen2--;
}
- }
- else
- {
- // falls kein Model da ... (z.B. Preview im Dialog)
- rStr = String();
- rStr.AppendAscii("4711");
+
+ if(!rStr.Len())
+ rStr += sal_Unicode('0');
}
break;
@@ -163,15 +159,16 @@ void SdrMeasureObj::TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMe
{
if(bShowUnit)
{
- if(pModel)
- {
- eModUIUnit = pModel->GetUIUnit();
+ eModUIUnit = getSdrModelFromSdrObject().GetUIUnit();
- if(eMeasureUnit == FUNIT_NONE)
- eMeasureUnit = eModUIUnit;
+ if(FUNIT_NONE == eMeasureUnit)
+ {
+ eMeasureUnit = eModUIUnit;
+ }
- if(bShowUnit)
- pModel->TakeUnitStr(eMeasureUnit, rStr);
+ if(bShowUnit)
+ {
+ getSdrModelFromSdrObject().TakeUnitStr(eMeasureUnit, rStr);
}
}
@@ -208,50 +205,81 @@ sdr::contact::ViewContact* SdrMeasureObj::CreateObjectSpecificViewContact()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrMeasureObj,SdrTextObj);
+SdrMeasureObj::SdrMeasureObj(
+ SdrModel& rSdrModel,
+ const Point& rPt1,
+ const Point& rPt2)
+: SdrTextObj(rSdrModel),
+ aPt1(rPt1),
+ aPt2(rPt2),
+ bTextDirty(false)
+{
+}
-SdrMeasureObj::SdrMeasureObj():
- bTextDirty(sal_False)
+SdrMeasureObj::~SdrMeasureObj()
{
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
}
-SdrMeasureObj::SdrMeasureObj(const Point& rPt1, const Point& rPt2):
- aPt1(rPt1),
- aPt2(rPt2),
- bTextDirty(sal_False)
+void SdrMeasureObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
+ if(this != &rSource)
+ {
+ const SdrMeasureObj* pSource = dynamic_cast< const SdrMeasureObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrTextObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ aPt1 = pSource->aPt1;
+ aPt2 = pSource->aPt2;
+ bTextDirty = pSource->bTextDirty;
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
}
-SdrMeasureObj::~SdrMeasureObj()
+SdrObject* SdrMeasureObj::CloneSdrObject(SdrModel* pTargetModel) const
{
+ SdrMeasureObj* pClone = new SdrMeasureObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+bool SdrMeasureObj::DoesSupportTextIndentingOnLineWidthChange() const
+{
+ return false;
}
void SdrMeasureObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bSelectAllowed =sal_True;
- rInfo.bMoveAllowed =sal_True;
- rInfo.bResizeFreeAllowed=sal_True;
- rInfo.bResizePropAllowed=sal_True;
- rInfo.bRotateFreeAllowed=sal_True;
- rInfo.bRotate90Allowed =sal_True;
- rInfo.bMirrorFreeAllowed=sal_True;
- rInfo.bMirror45Allowed =sal_True;
- rInfo.bMirror90Allowed =sal_True;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed =sal_True;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bNoOrthoDesired =sal_True;
- rInfo.bNoContortion =sal_False;
- rInfo.bCanConvToPath =sal_False;
- rInfo.bCanConvToPoly =sal_True;
- rInfo.bCanConvToPathLineToArea=sal_False;
- rInfo.bCanConvToPolyLineToArea=sal_False;
- rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
+ rInfo.mbSelectAllowed = true;
+ rInfo.mbMoveAllowed = true;
+ rInfo.mbResizeFreeAllowed = true;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = true;
+ rInfo.mbRotate90Allowed = true;
+ rInfo.mbMirrorFreeAllowed = true;
+ rInfo.mbMirror45Allowed = true;
+ rInfo.mbMirror90Allowed = true;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = true;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbNoOrthoDesired = true;
+ rInfo.mbNoContortion = false;
+ rInfo.mbCanConvToPath = false;
+ rInfo.mbCanConvToPoly = true;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
+ rInfo.mbCanConvToContour = (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
sal_uInt16 SdrMeasureObj::GetObjIdentifier() const
@@ -271,17 +299,17 @@ struct ImpMeasureRec : public SdrDragStatUserData
long nHelplineDist;
long nHelpline1Len;
long nHelpline2Len;
- FASTBOOL bBelowRefEdge;
- FASTBOOL bTextRota90;
- FASTBOOL bTextUpsideDown;
+ bool bBelowRefEdge;
+ bool bTextRota90;
+ bool bTextUpsideDown;
long nMeasureOverhang;
FieldUnit eMeasureUnit;
Fraction aMeasureScale;
- FASTBOOL bShowUnit;
+ bool bShowUnit;
String aFormatString;
- FASTBOOL bTextAutoAngle;
+ bool bTextAutoAngle;
long nTextAutoAngleView;
- FASTBOOL bTextIsFixedAngle;
+ bool bTextIsFixedAngle;
long nTextFixedAngle;
};
@@ -317,11 +345,11 @@ struct ImpMeasurePoly
long nArrow1Wdt; // Breite des 1. Pfeils
long nArrow2Wdt; // Breite des 2. Pfeils
long nShortLineLen; // Linienlaenge, wenn PfeileAussen
- FASTBOOL bArrow1Center; // Pfeil 1 zentriert?
- FASTBOOL bArrow2Center; // Pfeil 2 zentriert?
- FASTBOOL bAutoUpsideDown; // UpsideDown durch Automatik
- FASTBOOL bPfeileAussen;
- FASTBOOL bBreakedLine;
+ bool bArrow1Center; // Pfeil 1 zentriert?
+ bool bArrow2Center; // Pfeil 2 zentriert?
+ bool bAutoUpsideDown; // UpsideDown durch Automatik
+ bool bPfeileAussen;
+ bool bBreakedLine;
};
void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const
@@ -333,23 +361,23 @@ void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const
rRec.eKind =((SdrMeasureKindItem& )rSet.Get(SDRATTR_MEASUREKIND )).GetValue();
rRec.eWantTextHPos =((SdrMeasureTextHPosItem& )rSet.Get(SDRATTR_MEASURETEXTHPOS )).GetValue();
rRec.eWantTextVPos =((SdrMeasureTextVPosItem& )rSet.Get(SDRATTR_MEASURETEXTVPOS )).GetValue();
- rRec.nLineDist =((SdrMeasureLineDistItem& )rSet.Get(SDRATTR_MEASURELINEDIST )).GetValue();
- rRec.nHelplineOverhang=((SdrMeasureHelplineOverhangItem&)rSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue();
- rRec.nHelplineDist =((SdrMeasureHelplineDistItem& )rSet.Get(SDRATTR_MEASUREHELPLINEDIST )).GetValue();
- rRec.nHelpline1Len =((SdrMeasureHelpline1LenItem& )rSet.Get(SDRATTR_MEASUREHELPLINE1LEN )).GetValue();
- rRec.nHelpline2Len =((SdrMeasureHelpline2LenItem& )rSet.Get(SDRATTR_MEASUREHELPLINE2LEN )).GetValue();
- rRec.bBelowRefEdge =((SdrMeasureBelowRefEdgeItem& )rSet.Get(SDRATTR_MEASUREBELOWREFEDGE )).GetValue();
- rRec.bTextRota90 =((SdrMeasureTextRota90Item& )rSet.Get(SDRATTR_MEASURETEXTROTA90 )).GetValue();
- rRec.bTextUpsideDown =((SdrMeasureTextUpsideDownItem& )rSet.Get(SDRATTR_MEASURETEXTUPSIDEDOWN )).GetValue();
- rRec.nMeasureOverhang =((SdrMeasureOverhangItem& )rSet.Get(SDRATTR_MEASUREOVERHANG )).GetValue();
+ rRec.nLineDist = ((SdrMetricItem& )rSet.Get(SDRATTR_MEASURELINEDIST )).GetValue();
+ rRec.nHelplineOverhang = ((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG )).GetValue();
+ rRec.nHelplineDist = ((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREHELPLINEDIST )).GetValue();
+ rRec.nHelpline1Len = ((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREHELPLINE1LEN )).GetValue();
+ rRec.nHelpline2Len = ((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREHELPLINE2LEN )).GetValue();
+ rRec.bBelowRefEdge = ((SdrYesNoItem& )rSet.Get(SDRATTR_MEASUREBELOWREFEDGE )).GetValue();
+ rRec.bTextRota90 = ((SdrYesNoItem& )rSet.Get(SDRATTR_MEASURETEXTROTA90 )).GetValue();
+ rRec.bTextUpsideDown = ((SdrYesNoItem& )rSet.Get(SDRATTR_MEASURETEXTUPSIDEDOWN )).GetValue();
+ rRec.nMeasureOverhang = ((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREOVERHANG )).GetValue();
rRec.eMeasureUnit =((SdrMeasureUnitItem& )rSet.Get(SDRATTR_MEASUREUNIT )).GetValue();
- rRec.aMeasureScale =((SdrMeasureScaleItem& )rSet.Get(SDRATTR_MEASURESCALE )).GetValue();
- rRec.bShowUnit =((SdrMeasureShowUnitItem& )rSet.Get(SDRATTR_MEASURESHOWUNIT )).GetValue();
- rRec.aFormatString =((SdrMeasureFormatStringItem& )rSet.Get(SDRATTR_MEASUREFORMATSTRING )).GetValue();
- rRec.bTextAutoAngle =((SdrMeasureTextAutoAngleItem& )rSet.Get(SDRATTR_MEASURETEXTAUTOANGLE )).GetValue();
- rRec.nTextAutoAngleView=((SdrMeasureTextAutoAngleViewItem&)rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue();
- rRec.bTextIsFixedAngle =((SdrMeasureTextIsFixedAngleItem& )rSet.Get(SDRATTR_MEASURETEXTISFIXEDANGLE )).GetValue();
- rRec.nTextFixedAngle =((SdrMeasureTextFixedAngleItem& )rSet.Get(SDRATTR_MEASURETEXTFIXEDANGLE )).GetValue();
+ rRec.aMeasureScale = ((SdrScaleItem& )rSet.Get(SDRATTR_MEASURESCALE )).GetValue();
+ rRec.bShowUnit = ((SdrYesNoItem& )rSet.Get(SDRATTR_MEASURESHOWUNIT )).GetValue();
+ rRec.aFormatString = ((SfxStringItem& )rSet.Get(SDRATTR_MEASUREFORMATSTRING )).GetValue();
+ rRec.bTextAutoAngle = ((SdrYesNoItem& )rSet.Get(SDRATTR_MEASURETEXTAUTOANGLE )).GetValue();
+ rRec.nTextAutoAngleView= ((SdrAngleItem& )rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue();
+ rRec.bTextIsFixedAngle = ((SdrYesNoItem& )rSet.Get(SDRATTR_MEASURETEXTISFIXEDANGLE )).GetValue();
+ rRec.nTextFixedAngle = ((SdrAngleItem& )rSet.Get(SDRATTR_MEASURETEXTFIXEDANGLE )).GetValue();
}
long impGetLineStartEndDistance(const basegfx::B2DPolyPolygon& rPolyPolygon, long nNewWidth, bool bCenter)
@@ -385,7 +413,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
rPol.nArrow2Wdt=0;
long nArrowNeed=0;
long nShortLen=0;
- FASTBOOL bPfeileAussen=sal_False;
+ bool bPfeileAussen=sal_False;
const SfxItemSet& rSet = GetObjectItemSet();
sal_Int32 nLineWdt = ((XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); // Strichstaerke
@@ -415,7 +443,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
rPol.eUsedTextHPos=rRec.eWantTextHPos;
rPol.eUsedTextVPos=rRec.eWantTextVPos;
if (rPol.eUsedTextVPos==SDRMEASURE_TEXTVAUTO) rPol.eUsedTextVPos=SDRMEASURE_ABOVE;
- FASTBOOL bBrkLine=rPol.eUsedTextVPos==SDRMEASURETEXT_BREAKEDLINE;
+ bool bBrkLine=rPol.eUsedTextVPos==SDRMEASURETEXT_BREAKEDLINE;
if (rPol.eUsedTextVPos==SDRMEASURETEXT_VERTICALCENTERED)
{
OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject();
@@ -426,7 +454,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
}
rPol.bBreakedLine=bBrkLine;
if (rPol.eUsedTextHPos==SDRMEASURE_TEXTHAUTO) { // bei zu breitem Text diesen eventuell nach aussen schieben
- FASTBOOL bOutside=sal_False;
+ bool bOutside=sal_False;
long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height();
if (nNeedSiz>rPol.nLineLen) bOutside=sal_True; // Text passt nicht in die Mitte
if (bBrkLine) {
@@ -577,34 +605,43 @@ basegfx::B2DPolyPolygon SdrMeasureObj::ImpCalcXPoly(const ImpMeasurePoly& rPol)
return aRetval;
}
-FASTBOOL SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
- FASTBOOL bEdit,
- Color*& rpTxtColor, Color*& rpFldColor, XubString& rRet) const
+bool SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, XubString& rRet) const
{
const SvxFieldData* pField=rField.GetField();
- SdrMeasureField* pMeasureField=PTR_CAST(SdrMeasureField,pField);
- if (pMeasureField!=NULL) {
+ const SdrMeasureField* pMeasureField = dynamic_cast< const SdrMeasureField* >( pField);
+
+ if (pMeasureField)
+ {
TakeRepresentation(rRet, pMeasureField->GetMeasureFieldKind());
- if (rpFldColor!=NULL) {
+
+ if(rpFldColor)
+ {
if (!bEdit)
{
delete rpFldColor;
- rpFldColor=NULL;
+
+ rpFldColor = 0;
}
}
- return sal_True;
- } else {
+
+ return true;
+ }
+ else
+ {
return SdrTextObj::CalcFieldValue(rField,nPara,nPos,bEdit,rpTxtColor,rpFldColor,rRet);
}
}
void SdrMeasureObj::UndirtyText() const
{
- if (bTextDirty)
+ if(bTextDirty)
{
- SdrOutliner& rOutliner=ImpGetDrawOutliner();
+ SdrOutliner& rOutliner = ImpGetDrawOutliner();
OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject();
- if(pOutlinerParaObject==NULL)
+ SdrMeasureObj* pThat = const_cast<SdrMeasureObj*>(this);
+
+ if(!pOutlinerParaObject)
{
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD), ESelection(0,0));
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_VALUE), EE_FEATURE_FIELD),ESelection(0,1));
@@ -612,12 +649,15 @@ void SdrMeasureObj::UndirtyText() const
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD),ESelection(0,3));
if(GetStyleSheet())
+ {
rOutliner.SetStyleSheet(0, GetStyleSheet());
+ }
rOutliner.SetParaAttribs(0, GetObjectItemSet());
- // casting auf nonconst
- const_cast<SdrMeasureObj*>(this)->NbcSetOutlinerParaObject( rOutliner.CreateParaObject() );
+ // need to reset bTextDirty first, else loop is triggered
+ pThat->bTextDirty = false;
+ pThat->SetOutlinerParaObject( rOutliner.CreateParaObject() );
}
else
{
@@ -626,117 +666,12 @@ void SdrMeasureObj::UndirtyText() const
rOutliner.SetUpdateMode(sal_True);
rOutliner.UpdateFields();
- Size aSiz(rOutliner.CalcTextSize());
+ pThat->aTextSize = rOutliner.CalcTextSize();
+ pThat->bTextSizeDirty=sal_False;
rOutliner.Clear();
- // 3x casting auf nonconst
- ((SdrMeasureObj*)this)->aTextSize=aSiz;
- ((SdrMeasureObj*)this)->bTextSizeDirty=sal_False;
- ((SdrMeasureObj*)this)->bTextDirty=sal_False;
}
}
-void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
-{
- if (bTextDirty) UndirtyText();
- ImpMeasureRec aRec;
- ImpMeasurePoly aMPol;
- ImpTakeAttr(aRec);
- ImpCalcGeometrics(aRec,aMPol);
-
- // TextSize ermitteln inkl. Textrahmenabstaende
- Size aTextSize2(aMPol.aTextSize);
- if (aTextSize2.Width()<1) aTextSize2.Width()=1;
- if (aTextSize2.Height()<1) aTextSize2.Height()=1;
- aTextSize2.Width()+=GetTextLeftDistance()+GetTextRightDistance();
- aTextSize2.Height()+=GetTextUpperDistance()+GetTextLowerDistance();
-
- Point aPt1b(aMPol.aMainline1.aP1);
- long nLen=aMPol.nLineLen;
- long nLWdt=aMPol.nLineWdt2;
- long nArr1Len=aMPol.nArrow1Len;
- long nArr2Len=aMPol.nArrow2Len;
- if (aMPol.bBreakedLine) {
- // Bei Unterbrochener Linie und Outside muss der Text nicht neben den
- // Pfeil sondern neben die Linie an dem Pfeil plaziert werden
- nArr1Len=aMPol.nShortLineLen+aMPol.nArrow1Wdt/4;
- nArr2Len=aMPol.nShortLineLen+aMPol.nArrow2Wdt/4;
- }
-
- Point aTextPos;
- FASTBOOL bRota90=aRec.bTextRota90;
- FASTBOOL bUpsideDown=aRec.bTextUpsideDown!=aMPol.bAutoUpsideDown;
- FASTBOOL bBelowRefEdge=aRec.bBelowRefEdge;
- SdrMeasureTextHPos eMH=aMPol.eUsedTextHPos;
- SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos;
- if (!bRota90) {
- switch (eMH) {
- case SDRMEASURE_TEXTLEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt; break;
- case SDRMEASURE_TEXTRIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len+nLWdt; break;
- default: aTextPos.X()=aPt1b.X(); aTextSize2.Width()=nLen;
- }
- switch (eMV) {
- case SDRMEASURETEXT_VERTICALCENTERED:
- case SDRMEASURETEXT_BREAKEDLINE: aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()/2; break;
- case SDRMEASURE_BELOW: {
- if (!bUpsideDown) aTextPos.Y()=aPt1b.Y()+nLWdt;
- else aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()-nLWdt;
- } break;
- default: {
- if (!bUpsideDown) aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()-nLWdt;
- else aTextPos.Y()=aPt1b.Y()+nLWdt;
- }
- }
- if (bUpsideDown) {
- aTextPos.X()+=aTextSize2.Width();
- aTextPos.Y()+=aTextSize2.Height();
- }
- } else { // also wenn bTextRota90==TRUE
- switch (eMH) {
- case SDRMEASURE_TEXTLEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Height()-nArr1Len; break;
- case SDRMEASURE_TEXTRIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len; break;
- default: aTextPos.X()=aPt1b.X(); aTextSize2.Height()=nLen;
- }
- switch (eMV) {
- case SDRMEASURETEXT_VERTICALCENTERED:
- case SDRMEASURETEXT_BREAKEDLINE: aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()/2; break;
- case SDRMEASURE_BELOW: {
- if (!bBelowRefEdge) aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()+nLWdt;
- else aTextPos.Y()=aPt1b.Y()-nLWdt;
- } break;
- default: {
- if (!bBelowRefEdge) aTextPos.Y()=aPt1b.Y()-nLWdt;
- else aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()+nLWdt;
- }
- }
- if (bUpsideDown) {
- aTextPos.X()+=aTextSize2.Height();
- aTextPos.Y()-=aTextSize2.Width();
- }
- }
- if (aMPol.nTextWink!=aGeo.nDrehWink) {
- ((SdrMeasureObj*)this)->aGeo.nDrehWink=aMPol.nTextWink;
- ((SdrMeasureObj*)this)->aGeo.RecalcSinCos();
- }
- RotatePoint(aTextPos,aPt1b,aMPol.nLineSin,aMPol.nLineCos);
- aTextSize2.Width()++; aTextSize2.Height()++; // wg. des komischen Verhaltens beim Rect-Ctor
- rRect=Rectangle(aTextPos,aTextSize2);
- rRect.Justify();
- ((SdrMeasureObj*)this)->aRect=rRect;
-
- if (aMPol.nTextWink!=aGeo.nDrehWink) {
- ((SdrMeasureObj*)this)->aGeo.nDrehWink=aMPol.nTextWink;
- ((SdrMeasureObj*)this)->aGeo.RecalcSinCos();
- }
-}
-
-void SdrMeasureObj::operator=(const SdrObject& rObj)
-{
- SdrTextObj::operator=(rObj);
- aPt1=((SdrMeasureObj&)rObj).aPt1;
- aPt2=((SdrMeasureObj&)rObj).aPt2;
- bTextDirty=((SdrMeasureObj&)rObj).bTextDirty;
-}
-
void SdrMeasureObj::TakeObjNameSingul(XubString& rName) const
{
rName=ImpGetResStr(STR_ObjNameSingulMEASURE);
@@ -765,32 +700,31 @@ basegfx::B2DPolyPolygon SdrMeasureObj::TakeXorPoly() const
return ImpCalcXPoly(aMPol);
}
-sal_uInt32 SdrMeasureObj::GetHdlCount() const
-{
- return 6L;
-}
-
-SdrHdl* SdrMeasureObj::GetHdl(sal_uInt32 nHdlNum) const
+void SdrMeasureObj::AddToHdlList(SdrHdlList& rHdlList) const
{
ImpMeasureRec aRec;
ImpMeasurePoly aMPol;
ImpTakeAttr(aRec);
aRec.nHelplineDist=0;
ImpCalcGeometrics(aRec,aMPol);
- Point aPt;
- //SdrHdlKind eHdl=HDL_POLY;
- switch (nHdlNum) {
- case 0: aPt=aMPol.aHelpline1.aP1; break;
- case 1: aPt=aMPol.aHelpline2.aP1; break;
- case 2: aPt=aPt1; break;
- case 3: aPt=aPt2; break;
- case 4: aPt=aMPol.aHelpline1.aP2; break;
- case 5: aPt=aMPol.aHelpline2.aP2; break;
- } // switch
- SdrHdl* pHdl=new ImpMeasureHdl(aPt,HDL_USER);
- pHdl->SetObjHdlNum(nHdlNum);
- pHdl->SetDrehWink(aMPol.nLineWink);
- return pHdl;
+
+ SdrHdl* pHdl = new ImpMeasureHdl(rHdlList, *this, HDL_USER, basegfx::B2DPoint(aMPol.aHelpline1.aP1.X(), aMPol.aHelpline1.aP1.Y()));
+ pHdl->SetObjHdlNum(0);
+
+ pHdl = new ImpMeasureHdl(rHdlList, *this, HDL_USER, basegfx::B2DPoint(aMPol.aHelpline2.aP1.X(), aMPol.aHelpline2.aP1.Y()));
+ pHdl->SetObjHdlNum(1);
+
+ pHdl = new ImpMeasureHdl(rHdlList, *this, HDL_USER, basegfx::B2DPoint(aPt1.X(), aPt1.Y()));
+ pHdl->SetObjHdlNum(2);
+
+ pHdl = new ImpMeasureHdl(rHdlList, *this, HDL_USER, basegfx::B2DPoint(aPt2.X(), aPt2.Y()));
+ pHdl->SetObjHdlNum(3);
+
+ pHdl = new ImpMeasureHdl(rHdlList, *this, HDL_USER, basegfx::B2DPoint(aMPol.aHelpline1.aP2.X(), aMPol.aHelpline1.aP2.Y()));
+ pHdl->SetObjHdlNum(4);
+
+ pHdl = new ImpMeasureHdl(rHdlList, *this, HDL_USER, basegfx::B2DPoint(aMPol.aHelpline1.aP2.X(), aMPol.aHelpline1.aP2.Y()));
+ pHdl->SetObjHdlNum(5);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -802,7 +736,7 @@ bool SdrMeasureObj::hasSpecialDrag() const
bool SdrMeasureObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
if(pHdl)
{
@@ -822,7 +756,7 @@ bool SdrMeasureObj::beginSpecialDrag(SdrDragStat& rDrag) const
bool SdrMeasureObj::applySpecialDrag(SdrDragStat& rDrag)
{
ImpMeasureRec aMeasureRec;
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
const sal_uInt32 nHdlNum(pHdl->GetObjHdlNum());
ImpTakeAttr(aMeasureRec);
@@ -854,12 +788,12 @@ bool SdrMeasureObj::applySpecialDrag(SdrDragStat& rDrag)
if(aMeasureRec.nHelpline1Len != aOrigMeasureRec.nHelpline1Len)
{
- SetObjectItem(SdrMeasureHelpline1LenItem(aMeasureRec.nHelpline1Len));
+ SetObjectItem(SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN, aMeasureRec.nHelpline1Len));
}
if(aMeasureRec.nHelpline2Len != aOrigMeasureRec.nHelpline2Len)
{
- SetObjectItem(SdrMeasureHelpline2LenItem(aMeasureRec.nHelpline2Len));
+ SetObjectItem(SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN, aMeasureRec.nHelpline2Len));
}
break;
@@ -873,19 +807,18 @@ bool SdrMeasureObj::applySpecialDrag(SdrDragStat& rDrag)
if(aMeasureRec.nLineDist != aOrigMeasureRec.nLineDist)
{
- SetObjectItem(SdrMeasureLineDistItem(aMeasureRec.nLineDist));
+ SetObjectItem(SdrMetricItem(SDRATTR_MEASURELINEDIST, aMeasureRec.nLineDist));
}
if(aMeasureRec.bBelowRefEdge != aOrigMeasureRec.bBelowRefEdge)
{
- SetObjectItem(SdrMeasureBelowRefEdgeItem(aMeasureRec.bBelowRefEdge));
+ SetObjectItem(SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE, aMeasureRec.bBelowRefEdge));
}
}
}
}
} // switch
- SetRectsDirty();
SetChanged();
return true;
@@ -904,12 +837,12 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c
double nSin=sin(a);
double nCos=cos(a);
- const SdrHdl* pHdl=rDrag.GetHdl();
+ const SdrHdl* pHdl=rDrag.GetActiveHdl();
sal_uInt32 nHdlNum(pHdl->GetObjHdlNum());
- FASTBOOL bOrtho=rDrag.GetView()!=NULL && rDrag.GetView()->IsOrtho();
- FASTBOOL bBigOrtho=bOrtho && rDrag.GetView()->IsBigOrtho();
- FASTBOOL bBelow=rRec.bBelowRefEdge;
- Point aPt(rDrag.GetNow());
+ bool bOrtho(rDrag.GetSdrViewFromSdrDragStat().IsOrthogonal());
+ bool bBigOrtho(bOrtho && rDrag.GetSdrViewFromSdrDragStat().IsBigOrthogonal());
+ bool bBelow(rRec.bBelowRefEdge);
+ Point aPt(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
switch (nHdlNum) {
case 0: {
@@ -925,22 +858,22 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c
if (bOrtho) rRec.nHelpline1Len=rRec.nHelpline2Len;
} break;
case 2: case 3: {
- FASTBOOL bAnf=nHdlNum==2;
+ bool bAnf=nHdlNum==2;
Point& rMov=bAnf ? rRec.aPt1 : rRec.aPt2;
Point aMov(rMov);
Point aFix(bAnf ? rRec.aPt2 : rRec.aPt1);
if (bOrtho) {
long ndx0=aMov.X()-aFix.X();
long ndy0=aMov.Y()-aFix.Y();
- FASTBOOL bHLin=ndy0==0;
- FASTBOOL bVLin=ndx0==0;
+ bool bHLin=ndy0==0;
+ bool bVLin=ndx0==0;
if (!bHLin || !bVLin) { // sonst ist aPt1==aPt2
long ndx=aPt.X()-aFix.X();
long ndy=aPt.Y()-aFix.Y();
double nXFact=0; if (!bVLin) nXFact=(double)ndx/(double)ndx0;
double nYFact=0; if (!bHLin) nYFact=(double)ndy/(double)ndy0;
- FASTBOOL bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
- FASTBOOL bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
+ bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
+ bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
if (bHor) ndy=long(ndy0*nXFact);
if (bVer) ndx=long(ndx0*nYFact);
aPt=aFix;
@@ -967,40 +900,44 @@ void SdrMeasureObj::ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) c
////////////////////////////////////////////////////////////////////////////////////////////////////
-FASTBOOL SdrMeasureObj::BegCreate(SdrDragStat& rStat)
+bool SdrMeasureObj::BegCreate(SdrDragStat& rStat)
{
rStat.SetOrtho8Possible();
- aPt1=rStat.GetStart();
- aPt2=rStat.GetNow();
+ aPt1=Point(basegfx::fround(rStat.GetStart().getX()), basegfx::fround(rStat.GetStart().getY()));
+ aPt2=Point(basegfx::fround(rStat.GetNow().getX()), basegfx::fround(rStat.GetNow().getY()));
SetTextDirty();
- return sal_True;
+
+ return true;
}
-FASTBOOL SdrMeasureObj::MovCreate(SdrDragStat& rStat)
+bool SdrMeasureObj::MovCreate(SdrDragStat& rStat)
+{
+ SdrView& rView = rStat.GetSdrViewFromSdrDragStat();
+ aPt1=Point(basegfx::fround(rStat.GetStart().getX()), basegfx::fround(rStat.GetStart().getY()));
+ aPt2=Point(basegfx::fround(rStat.GetNow().getX()), basegfx::fround(rStat.GetNow().getY()));
+
+ if (rView.IsCreate1stPointAsCenter())
{
- SdrView* pView=rStat.GetView();
- aPt1=rStat.GetStart();
- aPt2=rStat.GetNow();
- if (pView!=NULL && pView->IsCreate1stPointAsCenter()) {
aPt1+=aPt1;
- aPt1-=rStat.Now();
+ aPt1-=Point(basegfx::fround(rStat.GetNow().getX()), basegfx::fround(rStat.GetNow().getY()));
}
SetTextDirty();
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- return sal_True;
+ ActionChanged();
+
+ return true;
}
-FASTBOOL SdrMeasureObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool SdrMeasureObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
SetTextDirty();
- SetRectsDirty();
+ ActionChanged();
+
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
}
-FASTBOOL SdrMeasureObj::BckCreate(SdrDragStat& /*rStat*/)
+bool SdrMeasureObj::BckCreate(SdrDragStat& /*rStat*/)
{
- return sal_False;
+ return false;
}
void SdrMeasureObj::BrkCreate(SdrDragStat& /*rStat*/)
@@ -1018,117 +955,55 @@ basegfx::B2DPolyPolygon SdrMeasureObj::TakeCreatePoly(const SdrDragStat& /*rDrag
return ImpCalcXPoly(aMPol);
}
-Pointer SdrMeasureObj::GetCreatePointer() const
+Pointer SdrMeasureObj::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
return Pointer(POINTER_CROSS);
}
-void SdrMeasureObj::NbcMove(const Size& rSiz)
-{
- SdrTextObj::NbcMove(rSiz);
- MovePoint(aPt1,rSiz);
- MovePoint(aPt2,rSiz);
-}
-
-void SdrMeasureObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+sal_uInt32 SdrMeasureObj::GetSnapPointCount() const
{
- SdrTextObj::NbcResize(rRef,xFact,yFact);
- ResizePoint(aPt1,rRef,xFact,yFact);
- ResizePoint(aPt2,rRef,xFact,yFact);
- SetTextDirty();
+ return 2L;
}
-void SdrMeasureObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
+basegfx::B2DPoint SdrMeasureObj::GetSnapPoint(sal_uInt32 i) const
{
- SdrTextObj::NbcRotate(rRef,nWink,sn,cs);
- long nLen0=GetLen(aPt2-aPt1);
- RotatePoint(aPt1,rRef,sn,cs);
- RotatePoint(aPt2,rRef,sn,cs);
- long nLen1=GetLen(aPt2-aPt1);
- if (nLen1!=nLen0) { // Aha, Rundungsfehler
- long dx=aPt2.X()-aPt1.X();
- long dy=aPt2.Y()-aPt1.Y();
- dx=BigMulDiv(dx,nLen0,nLen1);
- dy=BigMulDiv(dy,nLen0,nLen1);
- if (rRef==aPt2) {
- aPt1.X()=aPt2.X()-dx;
- aPt1.Y()=aPt2.Y()-dy;
- } else {
- aPt2.X()=aPt1.X()+dx;
- aPt2.Y()=aPt1.Y()+dy;
- }
- }
- SetRectsDirty();
-}
-
-void SdrMeasureObj::NbcMirror(const Point& rRef1, const Point& rRef2)
+ if(!i)
{
- SdrTextObj::NbcMirror(rRef1,rRef2);
- MirrorPoint(aPt1,rRef1,rRef2);
- MirrorPoint(aPt2,rRef1,rRef2);
- SetRectsDirty();
+ return basegfx::B2DPoint(aPt1.X(), aPt1.Y());
}
-
-void SdrMeasureObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+ else
{
- SdrTextObj::NbcShear(rRef,nWink,tn,bVShear);
- ShearPoint(aPt1,rRef,tn,bVShear);
- ShearPoint(aPt2,rRef,tn,bVShear);
- SetRectsDirty();
- SetTextDirty();
+ return basegfx::B2DPoint(aPt2.X(), aPt2.Y());
}
-
-long SdrMeasureObj::GetRotateAngle() const
-{
- return GetAngle(aPt2-aPt1);
}
-void SdrMeasureObj::RecalcSnapRect()
+bool SdrMeasureObj::IsPolygonObject() const
{
- // #94520# Added correct implementation here.
- ImpMeasureRec aRec;
- ImpMeasurePoly aMPol;
- XPolyPolygon aXPP;
-
- ImpTakeAttr(aRec);
- ImpCalcGeometrics(aRec, aMPol);
- aXPP = XPolyPolygon(ImpCalcXPoly(aMPol));
- maSnapRect = aXPP.GetBoundRect();
+ return sal_True;
}
-sal_uInt32 SdrMeasureObj::GetSnapPointCount() const
+sal_uInt32 SdrMeasureObj::GetObjectPointCount() const
{
- return 2L;
+ return 2;
}
-Point SdrMeasureObj::GetSnapPoint(sal_uInt32 i) const
+basegfx::B2DPoint SdrMeasureObj::GetObjectPoint(sal_uInt32 i) const
{
- if (i==0) return aPt1;
- else return aPt2;
+ return (i) ? basegfx::B2DPoint(aPt2.X(), aPt2.Y()) : basegfx::B2DPoint(aPt1.X(), aPt1.Y());
}
-sal_Bool SdrMeasureObj::IsPolyObj() const
+void SdrMeasureObj::SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i)
{
- return sal_True;
-}
-
-sal_uInt32 SdrMeasureObj::GetPointCount() const
+ if(0 == i)
{
- return 2L;
+ aPt1 = Point(basegfx::fround(rPnt.getX()), basegfx::fround(rPnt.getY()));
}
-
-Point SdrMeasureObj::GetPoint(sal_uInt32 i) const
+ else if (1 == i)
{
- return (0L == i) ? aPt1 : aPt2;
+ aPt2 = Point(basegfx::fround(rPnt.getX()), basegfx::fround(rPnt.getY()));
}
-void SdrMeasureObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i)
-{
- if (0L == i)
- aPt1=rPnt;
- if (1L == i)
- aPt2=rPnt;
- SetRectsDirty();
+ ActionChanged();
SetTextDirty();
}
@@ -1154,7 +1029,7 @@ void SdrMeasureObj::RestGeoData(const SdrObjGeoData& rGeo)
SetTextDirty();
}
-SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+SdrObject* SdrMeasureObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
// get XOR Poly as base
XPolyPolygon aTmpPolyPolygon(TakeXorPoly());
@@ -1164,8 +1039,7 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) co
SfxStyleSheet* pStyleSheet = GetStyleSheet();
// prepare group
- SdrObjGroup* pGroup = new SdrObjGroup;
- pGroup->SetModel(GetModel());
+ SdrObjGroup* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
// prepare parameters
basegfx::B2DPolyPolygon aPolyPoly;
@@ -1179,11 +1053,10 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) co
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
- pPath->SetModel(GetModel());
+ pPath = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPoly);
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
- pGroup->GetSubList()->NbcInsertObject(pPath);
+ pGroup->InsertObjectToSdrObjList(*pPath);
aSet.Put(XLineStartWidthItem(0L));
aSet.Put(XLineEndWidthItem(0L));
nLoopStart = 1;
@@ -1192,30 +1065,27 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) co
{
// four lines, middle line with gap, so there are two lines used
// which have one arrow each
- //sal_Int32 nStartWidth = ((const XLineStartWidthItem&)(aSet.Get(XATTR_LINESTARTWIDTH))).GetValue();
sal_Int32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue();
aSet.Put(XLineEndWidthItem(0L));
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
- pPath->SetModel(GetModel());
+ pPath = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPoly);
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
- pGroup->GetSubList()->NbcInsertObject(pPath);
+ pGroup->InsertObjectToSdrObjList(*pPath);
aSet.Put(XLineEndWidthItem(nEndWidth));
aSet.Put(XLineStartWidthItem(0L));
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[1].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
- pPath->SetModel(GetModel());
+ pPath = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPoly);
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
- pGroup->GetSubList()->NbcInsertObject(pPath);
+ pGroup->InsertObjectToSdrObjList(*pPath);
aSet.Put(XLineEndWidthItem(0L));
nLoopStart = 2;
@@ -1223,31 +1093,28 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) co
else if(nCount == 5)
{
// five lines, first two are the outer ones
- //sal_Int32 nStartWidth = ((const XLineStartWidthItem&)(aSet.Get(XATTR_LINESTARTWIDTH))).GetValue();
sal_Int32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue();
aSet.Put(XLineEndWidthItem(0L));
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
- pPath->SetModel(GetModel());
+ pPath = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPoly);
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
- pGroup->GetSubList()->NbcInsertObject(pPath);
+ pGroup->InsertObjectToSdrObjList(*pPath);
aSet.Put(XLineEndWidthItem(nEndWidth));
aSet.Put(XLineStartWidthItem(0L));
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[1].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
- pPath->SetModel(GetModel());
+ pPath = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPoly);
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
- pGroup->GetSubList()->NbcInsertObject(pPath);
+ pGroup->InsertObjectToSdrObjList(*pPath);
aSet.Put(XLineEndWidthItem(0L));
nLoopStart = 2;
@@ -1257,12 +1124,11 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) co
{
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[nLoopStart].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
- pPath->SetModel(GetModel());
+ pPath = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPoly);
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
- pGroup->GetSubList()->NbcInsertObject(pPath);
+ pGroup->InsertObjectToSdrObjList(*pPath);
}
if(bAddText)
@@ -1275,7 +1141,7 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) co
}
}
-sal_Bool SdrMeasureObj::BegTextEdit(SdrOutliner& rOutl)
+bool SdrMeasureObj::BegTextEdit(SdrOutliner& rOutl)
{
UndirtyText();
return SdrTextObj::BegTextEdit(rOutl);
@@ -1283,7 +1149,8 @@ sal_Bool SdrMeasureObj::BegTextEdit(SdrOutliner& rOutl)
const Size& SdrMeasureObj::GetTextSize() const
{
- if (bTextDirty) UndirtyText();
+ if (bTextDirty)
+ UndirtyText();
return SdrTextObj::GetTextSize();
}
@@ -1294,35 +1161,49 @@ OutlinerParaObject* SdrMeasureObj::GetOutlinerParaObject() const
return SdrTextObj::GetOutlinerParaObject();
}
-void SdrMeasureObj::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject)
+void SdrMeasureObj::SetOutlinerParaObject(OutlinerParaObject* pTextObject)
{
- SdrTextObj::NbcSetOutlinerParaObject(pTextObject);
+ SdrTextObj::SetOutlinerParaObject(pTextObject);
+
if(SdrTextObj::GetOutlinerParaObject())
+ {
SetTextDirty(); // Text neu berechnen!
+ }
}
-void SdrMeasureObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText,
- Rectangle* pAnchorRect, sal_Bool bLineWidth ) const
+void SdrMeasureObj::TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const
{
- if (bTextDirty) UndirtyText();
- SdrTextObj::TakeTextRect( rOutliner, rTextRect, bNoEditText, pAnchorRect, bLineWidth );
+ if(bTextDirty)
+ {
+ UndirtyText();
+ }
+
+ SdrTextObj::TakeTextRange(rOutliner, rTextRange, rAnchorRange);
}
-void SdrMeasureObj::TakeTextAnchorRect(Rectangle& rAnchorRect) const
+basegfx::B2DRange SdrMeasureObj::getUnifiedTextRange() const
{
- if (bTextDirty) UndirtyText();
- SdrTextObj::TakeTextAnchorRect(rAnchorRect);
+ if(bTextDirty)
+ {
+ UndirtyText();
+ }
+
+ // call parent
+ return SdrTextObj::getUnifiedTextRange();
}
-void SdrMeasureObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const
+void SdrMeasureObj::TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const
{
- if (bTextDirty) UndirtyText();
+ if (bTextDirty)
+ UndirtyText();
+
SdrTextObj::TakeTextEditArea(pPaperMin,pPaperMax,pViewInit,pViewMin);
}
sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const
{
- if (bTextDirty) UndirtyText();
+ if (bTextDirty)
+ UndirtyText();
ImpMeasureRec aRec;
ImpMeasurePoly aMPol;
ImpTakeAttr(aRec);
@@ -1332,19 +1213,20 @@ sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const
SdrTextVertAdjust eTV=GetTextVerticalAdjust();
SdrMeasureTextHPos eMH=aMPol.eUsedTextHPos;
SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos;
- FASTBOOL bTextRota90=aRec.bTextRota90;
- //int bTextUpsideDown=aRec.bTextUpsideDown;
- FASTBOOL bBelowRefEdge=aRec.bBelowRefEdge;
+ bool bTextRota90=aRec.bTextRota90;
+ bool bBelowRefEdge=aRec.bBelowRefEdge;
- // bTextUpsideDown muss hier noch ausgewertet werden!!!!
- if (!bTextRota90) {
+ if (!bTextRota90)
+ {
if (eMH==SDRMEASURE_TEXTLEFTOUTSIDE) eTH=SDRTEXTHORZADJUST_RIGHT;
if (eMH==SDRMEASURE_TEXTRIGHTOUTSIDE) eTH=SDRTEXTHORZADJUST_LEFT;
// bei eMH==SDRMEASURE_TEXTINSIDE kann horizontal geankert werden.
if (eMV==SDRMEASURE_ABOVE) eTV=SDRTEXTVERTADJUST_BOTTOM;
if (eMV==SDRMEASURE_BELOW) eTV=SDRTEXTVERTADJUST_TOP;
if (eMV==SDRMEASURETEXT_BREAKEDLINE || eMV==SDRMEASURETEXT_VERTICALCENTERED) eTV=SDRTEXTVERTADJUST_CENTER;
- } else {
+ }
+ else
+ {
if (eMH==SDRMEASURE_TEXTLEFTOUTSIDE) eTV=SDRTEXTVERTADJUST_BOTTOM;
if (eMH==SDRMEASURE_TEXTRIGHTOUTSIDE) eTV=SDRTEXTVERTADJUST_TOP;
// bei eMH==SDRMEASURE_TEXTINSIDE kann vertikal geankert werden.
@@ -1376,122 +1258,4 @@ sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const
}
//////////////////////////////////////////////////////////////////////////////
-// #i97878#
-// TRGetBaseGeometry/TRSetBaseGeometry needs to be based on two positions,
-// same as line geometry in SdrPathObj. Thus needs to be overloaded and
-// implemented since currently it is derived from SdrTextObj which uses
-// a functionality based on SnapRect which is not useful here
-
-inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); }
-inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
-
-sal_Bool SdrMeasureObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& /*rPolyPolygon*/) const
-{
- // handle the same as a simple line since the definition is based on two points
- const basegfx::B2DRange aRange(aPt1.X(), aPt1.Y(), aPt2.X(), aPt2.Y());
- basegfx::B2DTuple aScale(aRange.getRange());
- basegfx::B2DTuple aTranslate(aRange.getMinimum());
-
- // position maybe relative to anchorpos, convert
- if( pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
- }
-
- // force MapUnit to 100th mm
- SfxMapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // postion
- aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
- aTranslate.setY(ImplTwipsToMM(aTranslate.getY()));
-
- // size
- aScale.setX(ImplTwipsToMM(aScale.getX()));
- aScale.setY(ImplTwipsToMM(aScale.getY()));
-
- break;
- }
- default:
- {
- DBG_ERROR("TRGetBaseGeometry: Missing unit translation to 100th mm!");
- }
- }
- }
-
- // build return value matrix
- rMatrix = basegfx::tools::createScaleTranslateB2DHomMatrix(aScale, aTranslate);
-
- return sal_True;
-}
-
-void SdrMeasureObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& /*rPolyPolygon*/)
-{
- // use given transformation to derive the two defining points from unit line
- basegfx::B2DPoint aPosA(rMatrix * basegfx::B2DPoint(0.0, 0.0));
- basegfx::B2DPoint aPosB(rMatrix * basegfx::B2DPoint(1.0, 0.0));
-
- // force metric to pool metric
- SfxMapUnit eMapUnit = pModel->GetItemPool().GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // position
- aPosA.setX(ImplMMToTwips(aPosA.getX()));
- aPosA.setY(ImplMMToTwips(aPosA.getY()));
- aPosB.setX(ImplMMToTwips(aPosB.getX()));
- aPosB.setY(ImplMMToTwips(aPosB.getY()));
-
- break;
- }
- default:
- {
- DBG_ERROR("TRSetBaseGeometry: Missing unit translation to PoolMetric!");
- }
- }
- }
-
- if( pModel->IsWriter() )
- {
- // if anchor is used, make position relative to it
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- const basegfx::B2DVector aAnchorOffset(GetAnchorPos().X(), GetAnchorPos().Y());
-
- aPosA += aAnchorOffset;
- aPosB += aAnchorOffset;
- }
- }
-
- // derive new model data
- const Point aNewPt1(basegfx::fround(aPosA.getX()), basegfx::fround(aPosA.getY()));
- const Point aNewPt2(basegfx::fround(aPosB.getX()), basegfx::fround(aPosB.getY()));
-
- if(aNewPt1 != aPt1 || aNewPt2 != aPt2)
- {
- // set model values and broadcast
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
-
- aPt1 = aNewPt1;
- aPt2 = aNewPt2;
-
- SetTextDirty();
- ActionChanged();
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_MOVEONLY,aBoundRect0);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index ea939a0d745e..17cbaf08c1b9 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -31,37 +31,64 @@
#include "svx/svdstr.hrc"
#include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx>
#include <avmedia/mediawindow.hxx>
+#include <svx/svdlegacy.hxx>
// ---------------
// - SdrMediaObj -
// ---------------
-TYPEINIT1( SdrMediaObj, SdrRectObj );
+SdrMediaObj::SdrMediaObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform)
+: SdrRectObj(
+ rSdrModel,
+ rTransform)
+{
+}
// ------------------------------------------------------------------------------
-SdrMediaObj::SdrMediaObj()
+SdrMediaObj::~SdrMediaObj()
{
}
-// ------------------------------------------------------------------------------
+void SdrMediaObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const SdrMediaObj* pSource = dynamic_cast< const SdrMediaObj* >(&rSource);
-SdrMediaObj::SdrMediaObj( const Rectangle& rRect ) :
- SdrRectObj( rRect )
+ if(pSource)
{
-}
+ // call parent
+ SdrRectObj::copyDataFromSdrObject(rSource);
-// ------------------------------------------------------------------------------
+ // copy local data
+ setMediaProperties(pSource->getMediaProperties());
+ setGraphic(pSource->mapGraphic.get());
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
-SdrMediaObj::~SdrMediaObj()
+SdrObject* SdrMediaObj::CloneSdrObject(SdrModel* pTargetModel) const
{
+ SdrMediaObj* pClone = new SdrMediaObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
// ------------------------------------------------------------------------------
-FASTBOOL SdrMediaObj::HasTextEdit() const
+bool SdrMediaObj::HasTextEdit() const
{
- return sal_False;
+ return false;
}
// ------------------------------------------------------------------------------
@@ -75,26 +102,26 @@ sdr::contact::ViewContact* SdrMediaObj::CreateObjectSpecificViewContact()
void SdrMediaObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const
{
- rInfo.bSelectAllowed = true;
- rInfo.bMoveAllowed = true;
- rInfo.bResizeFreeAllowed = true;
- rInfo.bResizePropAllowed = true;
- rInfo.bRotateFreeAllowed = false;
- rInfo.bRotate90Allowed = false;
- rInfo.bMirrorFreeAllowed = false;
- rInfo.bMirror45Allowed = false;
- rInfo.bMirror90Allowed = false;
- rInfo.bTransparenceAllowed = false;
- rInfo.bGradientAllowed = false;
- rInfo.bShearAllowed = false;
- rInfo.bEdgeRadiusAllowed = false;
- rInfo.bNoOrthoDesired = false;
- rInfo.bNoContortion = false;
- rInfo.bCanConvToPath = false;
- rInfo.bCanConvToPoly = false;
- rInfo.bCanConvToContour = false;
- rInfo.bCanConvToPathLineToArea = false;
- rInfo.bCanConvToPolyLineToArea = false;
+ rInfo.mbSelectAllowed = true;
+ rInfo.mbMoveAllowed = true;
+ rInfo.mbResizeFreeAllowed = true;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = false;
+ rInfo.mbRotate90Allowed = false;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbMirror45Allowed = false;
+ rInfo.mbMirror90Allowed = false;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbNoOrthoDesired = false;
+ rInfo.mbNoContortion = false;
+ rInfo.mbCanConvToPath = false;
+ rInfo.mbCanConvToPoly = false;
+ rInfo.mbCanConvToContour = false;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
}
// ------------------------------------------------------------------------------
@@ -130,63 +157,48 @@ void SdrMediaObj::TakeObjNamePlural(XubString& rName) const
// ------------------------------------------------------------------------------
-void SdrMediaObj::operator=(const SdrObject& rObj)
+void SdrMediaObj::AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool bShrinkOnly /* = false */ )
{
- SdrRectObj::operator=( rObj );
+ const Size aLogicSize(Application::GetDefaultDevice()->PixelToLogic(getPreferredSize(), MAP_100TH_MM));
+ basegfx::B2DVector aSize(aLogicSize.Width(), aLogicSize.Height());
+ const basegfx::B2DVector aMaxSize(rMaxRange.getRange());
- if( rObj.ISA( SdrMediaObj ) )
+ if(!aSize.equalZero())
{
- const SdrMediaObj& rMediaObj = static_cast< const SdrMediaObj& >( rObj );
+ basegfx::B2DPoint aPos(rMaxRange.getMinimum());
- setMediaProperties( rMediaObj.getMediaProperties() );
- setGraphic( rMediaObj.mapGraphic.get() );
- }
-}
-
-// ------------------------------------------------------------------------------
-
-void SdrMediaObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly /* = false */ )
-{
- Size aSize( Application::GetDefaultDevice()->PixelToLogic( getPreferredSize(), MAP_100TH_MM ) );
- Size aMaxSize( rMaxRect.GetSize() );
-
- if( aSize.Height() != 0 && aSize.Width() != 0 )
- {
- Point aPos( rMaxRect.TopLeft() );
-
- // Falls Grafik zu gross, wird die Grafik
- // in die Seite eingepasst
- if ( (!bShrinkOnly ||
- ( aSize.Height() > aMaxSize.Height() ) ||
- ( aSize.Width() > aMaxSize.Width() ) )&&
- aSize.Height() && aMaxSize.Height() )
+ if(!bShrinkOnly
+ || basegfx::fTools::more(aSize.getY(), aMaxSize.getY())
+ || basegfx::fTools::more(aSize.getX(), aMaxSize.getX()))
{
- float fGrfWH = (float)aSize.Width() /
- (float)aSize.Height();
- float fWinWH = (float)aMaxSize.Width() /
- (float)aMaxSize.Height();
-
- // Grafik an Pagesize anpassen (skaliert)
- if ( fGrfWH < fWinWH )
+ if(!basegfx::fTools::equalZero(aSize.getX()) && !basegfx::fTools::equalZero(aMaxSize.getY()))
{
- aSize.Width() = (long)(aMaxSize.Height() * fGrfWH);
- aSize.Height()= aMaxSize.Height();
+ const double fScaleGraphic(aSize.getX() / aSize.getY());
+ const double fScaleLimit(aMaxSize.getX() / aMaxSize.getY());
+
+ if(basegfx::fTools::less(fScaleGraphic, fScaleLimit))
+ {
+ aSize.setX(aMaxSize.getY() * fScaleGraphic);
+ aSize.setY(aMaxSize.getY());
+ }
+ else if(basegfx::fTools::more(fScaleGraphic, 0.0))
+ {
+ aSize.setX(aMaxSize.getX());
+ aSize.setY(aMaxSize.getX() / fScaleGraphic);
+ }
+
+ aPos = rMaxRange.getCenter();
}
- else if ( fGrfWH > 0.F )
- {
- aSize.Width() = aMaxSize.Width();
- aSize.Height()= (long)(aMaxSize.Width() / fGrfWH);
- }
-
- aPos = rMaxRect.Center();
}
if( bShrinkOnly )
- aPos = aRect.TopLeft();
+ {
+ aPos = getSdrObjectTranslate();
+ }
+
+ aPos -= aSize * 0.5;
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- SetLogicRect( Rectangle( aPos, aSize ) );
+ sdr::legacy::SetLogicRange(*this, basegfx::B2DRange(aPos, aPos + aSize));
}
}
@@ -279,3 +291,5 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper
if( AVMEDIA_SETMASK_ZOOM & nMaskSet )
maMediaProperties.setZoom( rNewProperties.getZoom() );
}
+
+// eof
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 3093d636a4de..69b1639f77c5 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -39,18 +39,14 @@
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/container/XChild.hpp>
#include "com/sun/star/document/XStorageBasedDocument.hpp"
-
#include <comphelper/processfactory.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <unotools/ucbstreamhelper.hxx>
-
#include <toolkit/helper/vclunohelper.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/convert.hxx>
-
#include <svtools/filter.hxx>
#include <svtools/embedhlp.hxx>
-
#include <sfx2/objsh.hxx>
#include <sfx2/ipclient.hxx>
#include <sfx2/lnkbase.hxx>
@@ -60,17 +56,14 @@
#include <tools/globname.hxx>
#include <vcl/jobset.hxx>
#include <sot/clsids.hxx>
-
#include <sot/formats.hxx>
#include <sfx2/linkmgr.hxx>
#include <svtools/transfer.hxx>
#include <cppuhelper/implbase5.hxx>
-
#include <svl/solar.hrc>
#include <svl/urihelper.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
-
#include <svx/svdpagv.hxx>
#include <svx/svdmodel.hxx>
#include "svx/svdglob.hxx" // Stringcache
@@ -82,12 +75,12 @@
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdograf.hxx>
#include <svx/sdr/properties/oleproperties.hxx>
-
-// #i100710#
#include <svx/xlnclit.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xflbstit.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
// #i118485#
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -189,7 +182,7 @@ Rectangle SdrLightEmbeddedClient_Impl::impl_getScaledRect_nothrow() const
uno::Reference< embed::XVisualObject > xParentVis( mpObj->GetParentXModel(), uno::UNO_QUERY );
if ( xParentVis.is() )
aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) );
- Rectangle aLogicRect( mpObj->GetLogicRect() );
+ Rectangle aLogicRect( sdr::legacy::GetLogicRect(*mpObj) );
// apply scaling to object area and convert to pixels
aLogicRect.SetSize( Size( Fraction( aLogicRect.GetWidth() ) * m_aScaleWidth,
Fraction( aLogicRect.GetHeight() ) * m_aScaleHeight ) );
@@ -263,13 +256,13 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj
}
catch( embed::NoVisualAreaSizeException& )
{
- OSL_ENSURE( sal_False, "No visual area size!\n" );
+ OSL_ENSURE( false, "No visual area size!\n" );
aSz.Width = 5000;
aSz.Height = 5000;
}
catch( uno::Exception& )
{
- OSL_ENSURE( sal_False, "Unexpected exception!\n" );
+ OSL_ENSURE( false, "Unexpected exception!\n" );
aSz.Width = 5000;
aSz.Height = 5000;
}
@@ -278,7 +271,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj
aVisArea = OutputDevice::LogicToLogic( aVisArea, aObjMapUnit, aContainerMapUnit );
Size aScaledSize( static_cast< long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ),
static_cast< long >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) );
- Rectangle aLogicRect( mpObj->GetLogicRect() );
+ Rectangle aLogicRect( sdr::legacy::GetLogicRect(*mpObj) );
// react to the change if the difference is bigger than one pixel
Size aPixelDiff =
@@ -288,15 +281,14 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj
aContainerMapUnit );
if( aPixelDiff.Width() || aPixelDiff.Height() )
{
- mpObj->SetLogicRect( Rectangle( aLogicRect.TopLeft(), aScaledSize ) );
- mpObj->BroadcastObjectChange();
+ sdr::legacy::SetLogicRect(*mpObj, Rectangle( aLogicRect.TopLeft(), aScaledSize ) );
}
else
mpObj->ActionChanged();
}
catch( uno::Exception& )
{
- OSL_ENSURE( sal_False, "Unexpected exception!\n" );
+ OSL_ENSURE( false, "Unexpected exception!\n" );
}
}
}
@@ -325,7 +317,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::saveObject()
xPersist->storeOwn();
if ( xModifiable.is() )
- xModifiable->setModified( sal_True );
+ xModifiable->setModified( true );
}
//--------------------------------------------------------------------
@@ -337,14 +329,13 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::visibilityChanged( sal_Bool /*bVisibl
// TODO/LATER: when writer uses this implementation the code could be shared with SfxInPlaceClient_Impl
if ( mpObj )
{
- Rectangle aLogicRect( mpObj->GetLogicRect() );
+ Rectangle aLogicRect( sdr::legacy::GetLogicRect(*mpObj) );
Size aLogicSize( aLogicRect.GetWidth(), aLogicRect.GetHeight() );
if( mpObj->IsChart() )
{
//charts never should be stretched see #i84323# for example
- mpObj->SetLogicRect( Rectangle( aLogicRect.TopLeft(), aLogicSize ) );
- mpObj->BroadcastObjectChange();
+ sdr::legacy::SetLogicRect(*mpObj, Rectangle( aLogicRect.TopLeft(), aLogicSize ) );
} // if( mpObj->IsChart() )
}
}
@@ -560,7 +551,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl
{
// the calculation of the object area has not changed the object size
// it should be done here then
- //SfxBooleanFlagGuard aGuard( m_bResizeNoScale, sal_True );
+ //SfxBooleanFlagGuard aGuard( m_bResizeNoScale, true );
// new size of the object area without scaling
Size aNewObjSize( Fraction( aNewLogicRect.GetWidth() ) / m_aScaleWidth,
@@ -576,8 +567,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl
aContainerMapUnit );
if( aPixelDiff.Width() || aPixelDiff.Height() )
{
- mpObj->SetLogicRect( Rectangle( aLogicRect.TopLeft(), aNewObjSize ) );
- mpObj->BroadcastObjectChange();
+ sdr::legacy::SetLogicRect(*mpObj, Rectangle( aLogicRect.TopLeft(), aNewObjSize ) );
}
else
mpObj->ActionChanged();
@@ -621,7 +611,7 @@ public:
virtual void DataChanged( const String& rMimeType,
const ::com::sun::star::uno::Any & rValue );
- sal_Bool Connect() { return GetRealObject() != NULL; }
+ bool Connect() { return GetRealObject() != NULL; }
};
// -----------------------------------------------------------------------------
@@ -630,7 +620,7 @@ SdrEmbedObjectLink::SdrEmbedObjectLink(SdrOle2Obj* pObject):
::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SOT_FORMATSTR_ID_SVXB ),
pObj(pObject)
{
- SetSynchron( sal_False );
+ SetSynchron( false );
}
// -----------------------------------------------------------------------------
@@ -694,8 +684,8 @@ public:
// #107645#
// New local var to avoid repeated loading if load of OLE2 fails
- sal_Bool mbLoadingOLEObjectFailed;
- sal_Bool mbConnected;
+ bool mbLoadingOLEObjectFailed;
+ bool mbConnected;
SdrEmbedObjectLink* mpObjectLink;
String maLinkURL;
@@ -704,8 +694,8 @@ public:
: pGraphicObject( NULL )
// #107645#
// init to start situation, loading did not fail
- , mbLoadingOLEObjectFailed( sal_False )
- , mbConnected( sal_False )
+ , mbLoadingOLEObjectFailed( false )
+ , mbConnected( false )
, mpObjectLink( NULL )
{
}
@@ -753,84 +743,39 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
// -----------------------------------------------------------------------------
-TYPEINIT1(SdrOle2Obj,SdrRectObj);
-DBG_NAME(SdrOle2Obj)
-SdrOle2Obj::SdrOle2Obj(FASTBOOL bFrame_) : m_bTypeAsked(false)
-,m_bChart(false)
-{
- DBG_CTOR( SdrOle2Obj,NULL);
- bInDestruction = sal_False;
- mbSuppressSetVisAreaSize = false;
- Init();
- bFrame=bFrame_;
-}
-
-// -----------------------------------------------------------------------------
-SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, FASTBOOL bFrame_)
- : xObjRef( rNewObjRef )
- , m_bTypeAsked(false)
- , m_bChart(false)
-{
- DBG_CTOR( SdrOle2Obj,NULL);
- bInDestruction = sal_False;
- mbSuppressSetVisAreaSize = false;
- Init();
-
- bFrame=bFrame_;
-
- if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
- SetResizeProtect(sal_True);
-
- // #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
-}
-
-// -----------------------------------------------------------------------------
-
-SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubString& rNewObjName, FASTBOOL bFrame_)
- : xObjRef( rNewObjRef )
- , m_bTypeAsked(false)
- , m_bChart(false)
+bool SdrOle2Obj::IsClosedObj() const
{
- DBG_CTOR( SdrOle2Obj,NULL);
- bInDestruction = sal_False;
- mbSuppressSetVisAreaSize = false;
- Init();
-
- mpImpl->aPersistName = rNewObjName;
- bFrame=bFrame_;
-
- if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
- SetResizeProtect(sal_True);
+ if(xObjRef.is() && ImplIsMathObj(xObjRef.GetObject()))
+ {
+ return false;
+ }
- // #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ return SdrRectObj::IsClosedObj();
}
// -----------------------------------------------------------------------------
-SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubString& rNewObjName, const Rectangle& rNewRect, FASTBOOL bFrame_)
- : SdrRectObj(rNewRect)
- , xObjRef( rNewObjRef )
- , m_bTypeAsked(false)
- , m_bChart(false)
-{
- DBG_CTOR( SdrOle2Obj,NULL);
- bInDestruction = sal_False;
+SdrOle2Obj::SdrOle2Obj(
+ SdrModel& rSdrModel,
+ const svt::EmbeddedObjectRef& rNewObjRef,
+ const XubString aNewObjName,
+ const basegfx::B2DHomMatrix& rTransform,
+ bool bFrame_)
+: SdrRectObj(
+ rSdrModel,
+ rTransform),
+ xObjRef( rNewObjRef ),
+ m_bTypeAsked(false),
+ m_bChart(false)
+{
+ bInDestruction = false;
mbSuppressSetVisAreaSize = false;
Init();
-
- mpImpl->aPersistName = rNewObjName;
+ mpImpl->aPersistName = aNewObjName;
bFrame=bFrame_;
if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
- SetResizeProtect(sal_True);
-
- // #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
+ SetResizeProtect(true);
}
// -----------------------------------------------------------------------------
@@ -843,15 +788,14 @@ void SdrOle2Obj::Init()
mpImpl->pGraphicObject=NULL;
mpImpl->pLightClient = 0;
- xObjRef.Lock( sal_True );
+ xObjRef.Lock( true );
}
// -----------------------------------------------------------------------------
SdrOle2Obj::~SdrOle2Obj()
{
- DBG_DTOR( SdrOle2Obj,NULL);
- bInDestruction = sal_True;
+ bInDestruction = true;
if ( mpImpl->mbConnected )
Disconnect();
@@ -885,6 +829,80 @@ void SdrOle2Obj::SetAspect( sal_Int64 nAspect )
xObjRef.SetViewAspect( nAspect );
}
+void SdrOle2Obj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const SdrOle2Obj* pSource = dynamic_cast< const SdrOle2Obj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrRectObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ uno::Reference < util::XCloseable > xClose( xObjRef.GetObject(), uno::UNO_QUERY );
+
+ if( mpImpl->mbConnected )
+ Disconnect();
+
+ mpImpl->aPersistName = pSource->mpImpl->aPersistName;
+ aProgName = pSource->aProgName;
+ bFrame = pSource->bFrame;
+
+ if( pGraphic )
+ {
+ delete pGraphic;
+ delete mpImpl->pGraphicObject;
+ pGraphic = 0;
+ mpImpl->pGraphicObject = 0;
+ }
+
+ if( pSource->pGraphic )
+ {
+ pGraphic = new Graphic( *pSource->pGraphic );
+ mpImpl->pGraphicObject = new GraphicObject( *pGraphic );
+ }
+
+ if( !IsEmptyPresObj() )
+ {
+ ::comphelper::IEmbeddedHelper* pDestPers = getSdrModelFromSdrObject().GetPersist();
+ ::comphelper::IEmbeddedHelper* pSrcPers = pSource->getSdrModelFromSdrObject().GetPersist();
+ if( pDestPers && pSrcPers )
+ {
+ DBG_ASSERT( !xObjRef.is(), "Object already existing!" );
+ comphelper::EmbeddedObjectContainer& rContainer = pSrcPers->getEmbeddedObjectContainer();
+ uno::Reference < embed::XEmbeddedObject > xObj = rContainer.GetEmbeddedObject( mpImpl->aPersistName );
+ if ( xObj.is() )
+ {
+ ::rtl::OUString aTmp;
+ xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject( rContainer, xObj, aTmp ), pSource->GetAspect() );
+ m_bTypeAsked = false;
+ mpImpl->aPersistName = aTmp;
+ CheckFileLink_Impl();
+ }
+
+ Connect();
+ }
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* SdrOle2Obj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SdrOle2Obj* pClone = new SdrOle2Obj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
// -----------------------------------------------------------------------------
bool SdrOle2Obj::isInplaceActive() const
{
@@ -901,6 +919,8 @@ bool SdrOle2Obj::isUiActive() const
void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf)
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
if ( pGraphic )
{
delete pGraphic;
@@ -916,10 +936,6 @@ void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf)
}
SetChanged();
- BroadcastObjectChange();
-
- //if ( ppObjRef->Is() && pGrf )
- // BroadcastObjectChange();
}
void SdrOle2Obj::SetGraphic(const Graphic* pGrf)
@@ -930,7 +946,7 @@ void SdrOle2Obj::SetGraphic(const Graphic* pGrf)
// -----------------------------------------------------------------------------
-FASTBOOL SdrOle2Obj::IsEmpty() const
+bool SdrOle2Obj::IsEmpty() const
{
return !(xObjRef.is());
}
@@ -956,13 +972,13 @@ void SdrOle2Obj::Connect()
// -----------------------------------------------------------------------------
-sal_Bool SdrOle2Obj::UpdateLinkURL_Impl()
+bool SdrOle2Obj::UpdateLinkURL_Impl()
{
- sal_Bool bResult = sal_False;
+ bool bResult = false;
if ( mpImpl->mpObjectLink )
{
- sfx2::LinkManager* pLinkManager = pModel ? pModel->GetLinkManager() : NULL;
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrObject().GetLinkManager();
if ( pLinkManager )
{
String aNewLinkURL;
@@ -987,7 +1003,7 @@ sal_Bool SdrOle2Obj::UpdateLinkURL_Impl()
xPersObj->reload( aArgs, uno::Sequence< beans::PropertyValue >() );
mpImpl->maLinkURL = aNewLinkURL;
- bResult = sal_True;
+ bResult = true;
if ( nCurState != embed::EmbedStates::LOADED )
xObjRef->changeState( nCurState );
@@ -1020,8 +1036,7 @@ sal_Bool SdrOle2Obj::UpdateLinkURL_Impl()
void SdrOle2Obj::BreakFileLink_Impl()
{
uno::Reference<document::XStorageBasedDocument> xDoc;
- if ( pModel )
- xDoc.set( pModel->getUnoModel(),uno::UNO_QUERY);
+ xDoc.set( getSdrModelFromSdrObject().getUnoModel(),uno::UNO_QUERY);
if ( xDoc.is() )
{
@@ -1053,7 +1068,7 @@ void SdrOle2Obj::BreakFileLink_Impl()
void SdrOle2Obj::DisconnectFileLink_Impl()
{
- sfx2::LinkManager* pLinkManager = pModel ? pModel->GetLinkManager() : NULL;
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrObject().GetLinkManager();
if ( pLinkManager && mpImpl->mpObjectLink )
{
pLinkManager->Remove( mpImpl->mpObjectLink );
@@ -1065,7 +1080,7 @@ void SdrOle2Obj::DisconnectFileLink_Impl()
void SdrOle2Obj::CheckFileLink_Impl()
{
- if ( pModel && xObjRef.GetObject().is() && !mpImpl->mpObjectLink )
+ if ( xObjRef.GetObject().is() && !mpImpl->mpObjectLink )
{
try
{
@@ -1076,7 +1091,7 @@ void SdrOle2Obj::CheckFileLink_Impl()
if ( aLinkURL.Len() )
{
// this is a file link so the model link manager should handle it
- sfx2::LinkManager* pLinkManager = pModel->GetLinkManager();
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrObject().GetLinkManager();
if ( pLinkManager )
{
mpImpl->mpObjectLink = new SdrEmbedObjectLink( this );
@@ -1110,11 +1125,11 @@ void SdrOle2Obj::Reconnect_Impl()
void SdrOle2Obj::Connect_Impl()
{
- if( pModel && mpImpl->aPersistName.Len() )
+ if( mpImpl->aPersistName.Len() )
{
try
{
- ::comphelper::IEmbeddedHelper* pPers = pModel->GetPersist();
+ ::comphelper::IEmbeddedHelper* pPers = getSdrModelFromSdrObject().GetPersist();
if ( pPers )
{
comphelper::EmbeddedObjectContainer& rContainer = pPers->getEmbeddedObjectContainer();
@@ -1142,7 +1157,7 @@ void SdrOle2Obj::Connect_Impl()
{
xObjRef.AssignToContainer( &rContainer, mpImpl->aPersistName );
mpImpl->mbConnected = true;
- xObjRef.Lock( sal_True );
+ xObjRef.Lock( true );
}
}
@@ -1165,9 +1180,9 @@ void SdrOle2Obj::Connect_Impl()
uno::Reference< container::XChild > xChild( xObjRef.GetObject(), uno::UNO_QUERY );
if( xChild.is() )
{
- uno::Reference< uno::XInterface > xParent( pModel->getUnoModel());
+ uno::Reference< uno::XInterface > xParent( getSdrModelFromSdrObject().getUnoModel());
if( xParent.is())
- xChild->setParent( pModel->getUnoModel() );
+ xChild->setParent( getSdrModelFromSdrObject().getUnoModel() );
}
}
@@ -1189,12 +1204,12 @@ void SdrOle2Obj::Connect_Impl()
{
//TODO/LATER: needs a new handling for OnPrinterChanged
/*
- if (pModel && pModel->GetRefDevice() &&
- pModel->GetRefDevice()->GetOutDevType() == OUTDEV_PRINTER)
+ if (getSdrModelFromSdrObject().GetReferenceDevice() &&
+ getSdrModelFromSdrObject().GetReferenceDevice()->GetOutDevType() == OUTDEV_PRINTER)
{
// Kein RefDevice oder RefDevice kein Printer
- sal_Bool bModified = (*ppObjRef)->IsModified();
- Printer* pPrinter = (Printer*) pModel->GetRefDevice();
+ bool bModified = (*ppObjRef)->IsModified();
+ Printer* pPrinter = (Printer*) getSdrModelFromSdrObject().GetReferenceDevice();
(*ppObjRef)->OnDocumentPrinterChanged( pPrinter );
(*ppObjRef)->SetModified( bModified );
}*/
@@ -1277,9 +1292,9 @@ void SdrOle2Obj::Disconnect_Impl()
{
try
{
- if ( pModel && mpImpl->aPersistName.Len() )
+ if ( mpImpl->aPersistName.Len() )
{
- if( pModel->IsInDestruction() )
+ if( getSdrModelFromSdrObject().IsInDestruction() )
{
// TODO/LATER: here we must assume that the destruction of the model is enough to make clear that we will not
// remove the object from the container, even if the DrawingObject itself is not destroyed (unfortunately this
@@ -1303,7 +1318,7 @@ void SdrOle2Obj::Disconnect_Impl()
{
try
{
- xClose->close( sal_True );
+ xClose->close( true );
}
catch ( util::CloseVetoException& )
{
@@ -1315,13 +1330,13 @@ void SdrOle2Obj::Disconnect_Impl()
}
else if ( xObjRef.is() )
{
- if ( pModel->getUnoModel().is() )
+ if ( getSdrModelFromSdrObject().getUnoModel().is() )
{
// remove object, but don't close it (that's up to someone else)
comphelper::EmbeddedObjectContainer* pContainer = xObjRef.GetContainer();
if ( pContainer )
{
- pContainer->RemoveEmbeddedObject( xObjRef.GetObject(), sal_False);
+ pContainer->RemoveEmbeddedObject( xObjRef.GetObject(), false);
// TODO/LATER: mpImpl->aPersistName contains outdated information, to have it uptodate
// it should be returned from RemoveEmbeddedObject call. Currently it is no problem,
@@ -1371,15 +1386,10 @@ SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText, bool bUseHCGra
if(pOLEGraphic)
{
// #i118485# allow creating a SdrGrafObj representation
- SdrGrafObj* pClone = new SdrGrafObj(*pOLEGraphic);
- pClone->SetModel(GetModel());
+ SdrGrafObj* pClone = new SdrGrafObj(getSdrModelFromSdrObject(), *pOLEGraphic);
// copy transformation
- basegfx::B2DHomMatrix aMatrix;
- basegfx::B2DPolyPolygon aPolyPolygon;
-
- TRGetBaseGeometry(aMatrix, aPolyPolygon);
- pClone->TRSetBaseGeometry(aMatrix, aPolyPolygon);
+ pClone->setSdrObjectTransformation(getSdrObjectTransformation());
// copy all attributes to support graphic styles for OLEs
pClone->SetStyleSheet(GetStyleSheet(), false);
@@ -1390,9 +1400,9 @@ SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText, bool bUseHCGra
// #i118485# copy text (Caution! Model needed, as guaranteed in aw080)
OutlinerParaObject* pOPO = GetOutlinerParaObject();
- if(pOPO && GetModel())
+ if(pOPO)
{
- pClone->NbcSetOutlinerParaObject(new OutlinerParaObject(*pOPO));
+ pClone->SetOutlinerParaObject(new OutlinerParaObject(*pOPO));
}
}
@@ -1402,8 +1412,7 @@ SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText, bool bUseHCGra
{
// #i100710# pOLEGraphic may be zero (no visualisation available),
// so we need to use the OLE replacement graphic
- SdrRectObj* pClone = new SdrRectObj(GetSnapRect());
- pClone->SetModel(GetModel());
+ SdrRectObj* pClone = new SdrRectObj(getSdrModelFromSdrObject(), getSdrObjectTransformation());
// gray outline
pClone->SetMergedItem(XLineStyleItem(XLINE_SOLID));
@@ -1421,20 +1430,17 @@ SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText, bool bUseHCGra
}
}
-SdrObject* SdrOle2Obj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+SdrObject* SdrOle2Obj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
// #i118485# missing converter added
- if(GetModel())
- {
- SdrObject* pRetval = createSdrGrafObjReplacement(true, false);
+ SdrObject* pRetval = createSdrGrafObjReplacement(true, false);
- if(pRetval)
- {
- SdrObject* pRetval2 = pRetval->DoConvertToPolyObj(bBezier, bAddText);
- SdrObject::Free(pRetval);
+ if(pRetval)
+ {
+ SdrObject* pRetval2 = pRetval->DoConvertToPolygonObject(bBezier, bAddText);
+ deleteSdrObjectSafeAndClearPointer(pRetval);
- return pRetval2;
- }
+ return pRetval2;
}
return 0;
@@ -1442,115 +1448,26 @@ SdrObject* SdrOle2Obj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
// -----------------------------------------------------------------------------
-void SdrOle2Obj::SetModel(SdrModel* pNewModel)
+void SdrOle2Obj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
{
- ::comphelper::IEmbeddedHelper* pDestPers = pNewModel ? pNewModel->GetPersist() : 0;
- ::comphelper::IEmbeddedHelper* pSrcPers = pModel ? pModel->GetPersist() : 0;
-
- if ( pNewModel == pModel )
+ if(pOldPage != pNewPage)
{
- // don't know if this is necessary or if it will ever happen, but who know?!
- SdrRectObj::SetModel( pNewModel );
- return;
- }
+ const bool bRemove(!pNewPage && pOldPage);
+ const bool bInsert(pNewPage && !pOldPage);
- // assignment to model has changed
- DBG_ASSERT( pSrcPers || !mpImpl->mbConnected, "Connected object without a model?!" );
-
- DBG_ASSERT( pDestPers, "The destination model must have a persistence! Please submit an issue!" );
- DBG_ASSERT( pDestPers != pSrcPers, "The source and the destination models should have different persistences! Problems are possible!" );
-
- // this is a bug if the target model has no persistence
- // no error handling is possible so just do nothing in this method
- if ( !pDestPers )
- return;
-
- RemoveListeners_Impl();
-
- if( pDestPers && pSrcPers && !IsEmptyPresObj() )
- {
- try
+ if(bRemove && mpImpl->mbConnected)
{
- // move the objects' storage; ObjectRef remains the same, but PersistName may change
- ::rtl::OUString aTmp;
- comphelper::EmbeddedObjectContainer& rContainer = pSrcPers->getEmbeddedObjectContainer();
- uno::Reference < embed::XEmbeddedObject > xObj = rContainer.GetEmbeddedObject( mpImpl->aPersistName );
- DBG_ASSERT( !xObjRef.is() || xObjRef.GetObject() == xObj, "Wrong object identity!" );
- if ( xObj.is() )
- {
- pDestPers->getEmbeddedObjectContainer().MoveEmbeddedObject( rContainer, xObj, aTmp );
- mpImpl->aPersistName = aTmp;
- xObjRef.AssignToContainer( &pDestPers->getEmbeddedObjectContainer(), aTmp );
- }
- DBG_ASSERT( aTmp.getLength(), "Copying embedded object failed!" );
- }
- catch( ::com::sun::star::uno::Exception& e )
- {
- (void)e;
- DBG_ERROR(
- (OString("SdrOle2Obj::SetModel(), "
- "exception caught: ") +
- rtl::OUStringToOString(
- comphelper::anyToString( cppu::getCaughtException() ),
- RTL_TEXTENCODING_UTF8 )).getStr() );
+ Disconnect();
}
- }
-
- SdrRectObj::SetModel( pNewModel );
-
- // #i43086#
- // #i85304 redo the change for charts for the above bugfix, as #i43086# does not ocur anymore
- //so maybe the ImpSetVisAreaSize call can be removed here completely
- //Nevertheless I leave it in for other objects as I am not sure about the side effects when removing now
- if( pModel && !pModel->isLocked() && !IsChart() )
- ImpSetVisAreaSize();
-
- if( pDestPers && !IsEmptyPresObj() )
- {
- if ( !pSrcPers || IsEmptyPresObj() )
- // object wasn't connected, now it should
- Connect_Impl();
- else
- Reconnect_Impl();
- }
- AddListeners_Impl();
-}
-
-// -----------------------------------------------------------------------------
+ // call parent
+ SdrRectObj::handlePageChange(pOldPage, pNewPage);
-void SdrOle2Obj::SetPage(SdrPage* pNewPage)
-{
- FASTBOOL bRemove=pNewPage==NULL && pPage!=NULL;
- FASTBOOL bInsert=pNewPage!=NULL && pPage==NULL;
-
- if (bRemove && mpImpl->mbConnected )
- Disconnect();
-
- if(!pModel && !GetStyleSheet() && pNewPage->GetModel())
- {
- // #119287# Set default StyleSheet for SdrGrafObj here, it is different from 'Default'. This
- // needs to be done before the style 'Default' is set from the :SetModel() call which is triggered
- // from the following :SetPage().
- // TTTT: Needs to be moved in branch aw080 due to having a SdrModel from the beginning, is at this
- // place for convenience currently (works in both versions, is not in the way)
- SfxStyleSheet* pSheet = pNewPage->GetModel()->GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj();
-
- if(pSheet)
- {
- SetStyleSheet(pSheet, false);
- }
- else
+ if(bInsert && !mpImpl->mbConnected)
{
- SetMergedItem(XFillStyleItem(XFILL_NONE));
- SetMergedItem(XLineStyleItem(XLINE_NONE));
+ Connect();
}
}
-
- SdrRectObj::SetPage(pNewPage);
-
- if (bInsert && !mpImpl->mbConnected )
- Connect();
}
// -----------------------------------------------------------------------------
@@ -1561,10 +1478,12 @@ void SdrOle2Obj::SetObjRef( const com::sun::star::uno::Reference < com::sun::sta
if( rNewObjRef == xObjRef.GetObject() )
return;
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
// MBA: the caller of the method is responsible to control the old object, it will not be closed here
// Otherwise WW8 import crashes because it tranfers control to OLENode by this method
if ( xObjRef.GetObject().is() )
- xObjRef.Lock( sal_False );
+ xObjRef.Lock( false );
// MBA: avoid removal of object in Disconnect! It is definitely a HACK to call SetObjRef(0)!
// This call will try to close the objects; so if anybody else wants to keep it, it must be locked by a CloseListener
@@ -1581,26 +1500,11 @@ void SdrOle2Obj::SetObjRef( const com::sun::star::uno::Reference < com::sun::sta
DELETEZ( pGraphic );
if ( (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
- SetResizeProtect(sal_True);
-
- // #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( rNewObjRef ) )
- SetClosedObj( false );
-
+ SetResizeProtect(true);
Connect();
}
SetChanged();
- BroadcastObjectChange();
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrOle2Obj::SetClosedObj( bool bIsClosed )
-{
- // TODO/LATER: do we still need this hack?
- // #108759# Allow changes to the closed state of OLE objects
- bClosedObj = bIsClosed;
}
// -----------------------------------------------------------------------------
@@ -1647,21 +1551,21 @@ String SdrOle2Obj::GetPersistName() const
void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
// #i118485# Allowing much more attributes for OLEs
- rInfo.bRotateFreeAllowed = true;
- rInfo.bRotate90Allowed = true;
- rInfo.bMirrorFreeAllowed = true;
- rInfo.bMirror45Allowed = true;
- rInfo.bMirror90Allowed = true;
- rInfo.bTransparenceAllowed = true;
- rInfo.bGradientAllowed = true;
- rInfo.bShearAllowed = true;
- rInfo.bEdgeRadiusAllowed = false;
- rInfo.bNoOrthoDesired = false;
- rInfo.bCanConvToPath = true;
- rInfo.bCanConvToPoly = true;
- rInfo.bCanConvToPathLineToArea = false;
- rInfo.bCanConvToPolyLineToArea = false;
- rInfo.bCanConvToContour = true;
+ rInfo.mbRotateFreeAllowed = true;
+ rInfo.mbRotate90Allowed = true;
+ rInfo.mbMirrorFreeAllowed = true;
+ rInfo.mbMirror45Allowed = true;
+ rInfo.mbMirror90Allowed = true;
+ rInfo.mbTransparenceAllowed = true;
+ rInfo.mbGradientAllowed = true;
+ rInfo.mbShearAllowed = true;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbNoOrthoDesired = false;
+ rInfo.mbCanConvToPath = true;
+ rInfo.mbCanConvToPoly = true;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
+ rInfo.mbCanConvToContour = true;
}
// -----------------------------------------------------------------------------
@@ -1696,91 +1600,6 @@ void SdrOle2Obj::TakeObjNamePlural(XubString& rName) const
// -----------------------------------------------------------------------------
-void SdrOle2Obj::operator=(const SdrObject& rObj)
-{
- //TODO/LATER: who takes over control of my old object?!
- if( &rObj != this )
- {
- // #116235#
- // ImpAssign( rObj );
- const SdrOle2Obj& rOle2Obj = static_cast< const SdrOle2Obj& >( rObj );
-
- uno::Reference < util::XCloseable > xClose( xObjRef.GetObject(), uno::UNO_QUERY );
-
- if( pModel && mpImpl->mbConnected )
- Disconnect();
-
- SdrRectObj::operator=( rObj );
-
- // #108867# Manually copying bClosedObj attribute
- SetClosedObj( rObj.IsClosedObj() );
-
- mpImpl->aPersistName = rOle2Obj.mpImpl->aPersistName;
- aProgName = rOle2Obj.aProgName;
- bFrame = rOle2Obj.bFrame;
-
- if( rOle2Obj.pGraphic )
- {
- if( pGraphic )
- {
- delete pGraphic;
- delete mpImpl->pGraphicObject;
- }
-
- pGraphic = new Graphic( *rOle2Obj.pGraphic );
- mpImpl->pGraphicObject = new GraphicObject( *pGraphic );
- }
-
- if( pModel && rObj.GetModel() && !IsEmptyPresObj() )
- {
- ::comphelper::IEmbeddedHelper* pDestPers = pModel->GetPersist();
- ::comphelper::IEmbeddedHelper* pSrcPers = rObj.GetModel()->GetPersist();
- if( pDestPers && pSrcPers )
- {
- DBG_ASSERT( !xObjRef.is(), "Object already existing!" );
- comphelper::EmbeddedObjectContainer& rContainer = pSrcPers->getEmbeddedObjectContainer();
- uno::Reference < embed::XEmbeddedObject > xObj = rContainer.GetEmbeddedObject( mpImpl->aPersistName );
- if ( xObj.is() )
- {
- ::rtl::OUString aTmp;
- xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject( rContainer, xObj, aTmp ), rOle2Obj.GetAspect() );
- m_bTypeAsked = false;
- mpImpl->aPersistName = aTmp;
- CheckFileLink_Impl();
- }
-
- Connect();
-
- /* only needed for MSOLE-Objects, now handled inside implementation of Object
- if ( xObjRef.is() && rOle2Obj.xObjRef.is() && rOle2Obj.GetAspect() != embed::Aspects::MSOLE_ICON )
- {
- try
- {
- awt::Size aVisSize = rOle2Obj.xObjRef->getVisualAreaSize( rOle2Obj.GetAspect() );
- if( rOle2Obj.xObjRef->getMapUnit( rOle2Obj.GetAspect() ) == xObjRef->getMapUnit( GetAspect() ) )
- xObjRef->setVisualAreaSize( GetAspect(), aVisSize );
- }
- catch ( embed::WrongStateException& )
- {
- // setting of VisArea not necessary for objects that don't cache it in loaded state
- }
- catch( embed::NoVisualAreaSizeException& )
- {
- // objects my not have visual areas
- }
- catch( uno::Exception& e )
- {
- (void)e;
- DBG_ERROR( "SdrOle2Obj::operator=(), unexcpected exception caught!" );
- }
- } */
- }
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-
void SdrOle2Obj::ImpSetVisAreaSize()
{
// #i118524# do not again set VisAreaSize when the call comes from OLE client (e.g. ObjectAreaChanged)
@@ -1796,12 +1615,11 @@ void SdrOle2Obj::ImpSetVisAreaSize()
GetObjRef();
if ( xObjRef.is() )
{
- OSL_ASSERT( pModel );
sal_Int64 nMiscStatus = xObjRef->getStatus( GetAspect() );
// the client is required to get access to scaling
- SfxInPlaceClient* pClient = SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), xObjRef.GetObject() );
- sal_Bool bHasOwnClient =
+ SfxInPlaceClient* pClient = SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(getSdrModelFromSdrObject().GetPersist()), xObjRef.GetObject() );
+ bool bHasOwnClient =
( mpImpl->pLightClient
&& xObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) );
@@ -1832,10 +1650,11 @@ void SdrOle2Obj::ImpSetVisAreaSize()
// objects' visual area. The scaling will not change, but it might exist already and must
// be used in calculations
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
- Size aVisSize( (long)( Fraction( aRect.GetWidth() ) / aScaleWidth ),
- (long)( Fraction( aRect.GetHeight() ) / aScaleHeight ) );
+ const Rectangle aCurrRect(sdr::legacy::GetSnapRect(*this));
+ Size aVisSize( (long)( Fraction( aCurrRect.GetWidth() ) / aScaleWidth ),
+ (long)( Fraction( aCurrRect.GetHeight() ) / aScaleHeight ) );
- aVisSize = OutputDevice::LogicToLogic( aVisSize, pModel->GetScaleUnit(), aMapUnit);
+ aVisSize = OutputDevice::LogicToLogic( aVisSize, getSdrModelFromSdrObject().GetExchangeObjectUnit(), aMapUnit);
awt::Size aSz;
aSz.Width = aVisSize.Width();
aSz.Height = aVisSize.Height();
@@ -1856,14 +1675,19 @@ void SdrOle2Obj::ImpSetVisAreaSize()
// server changed VisArea to its liking and the VisArea is different than the suggested one
// store the new value as given by the object
MapUnit aNewMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
- aRect.SetSize(OutputDevice::LogicToLogic( aAcceptedVisArea.GetSize(), aNewMapUnit, pModel->GetScaleUnit()));
+ Rectangle aNewRect(aCurrRect);
+ aNewRect.SetSize(OutputDevice::LogicToLogic( aAcceptedVisArea.GetSize(), aNewMapUnit, getSdrModelFromSdrObject().GetExchangeObjectUnit()));
+ sdr::legacy::SetSnapRect(*this, aNewRect);
}
// make the new object area known to the client
// compared to the "else" branch aRect might have been changed by the object and no additional scaling was applied
// OJ: WHY this -> OSL_ASSERT( pClient );
if( pClient )
- pClient->SetObjArea(aRect);
+ {
+ const Rectangle aNewCurrRect(sdr::legacy::GetSnapRect(*this));
+ pClient->SetObjArea(aNewCurrRect);
+ }
// we need a new replacement image as the object has resized itself
@@ -1884,7 +1708,8 @@ void SdrOle2Obj::ImpSetVisAreaSize()
{
if ( pClient )
{
- Rectangle aScaleRect(aRect.TopLeft(), aObjAreaSize);
+ const Rectangle aCurrRect(sdr::legacy::GetSnapRect(*this));
+ Rectangle aScaleRect(aCurrRect.TopLeft(), aObjAreaSize);
pClient->SetObjAreaAndScale( aScaleRect, aScaleWidth, aScaleHeight);
}
else
@@ -1903,10 +1728,11 @@ void SdrOle2Obj::ImpSetVisAreaSize()
if( xVisualObject.is() )
{
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
- Point aTL( aRect.TopLeft() );
- Point aBR( aRect.BottomRight() );
- Point aTL2( OutputDevice::LogicToLogic( aTL, pModel->GetScaleUnit(), aMapUnit) );
- Point aBR2( OutputDevice::LogicToLogic( aBR, pModel->GetScaleUnit(), aMapUnit) );
+ const Rectangle aCurrRect(sdr::legacy::GetSnapRect(*this));
+ Point aTL( aCurrRect.TopLeft() );
+ Point aBR( aCurrRect.BottomRight() );
+ Point aTL2( OutputDevice::LogicToLogic( aTL, getSdrModelFromSdrObject().GetExchangeObjectUnit(), aMapUnit) );
+ Point aBR2( OutputDevice::LogicToLogic( aBR, getSdrModelFromSdrObject().GetExchangeObjectUnit(), aMapUnit) );
Rectangle aNewRect( aTL2, aBR2 );
xVisualObject->setVisualAreaSize( GetAspect(), awt::Size( aNewRect.GetWidth(), aNewRect.GetHeight() ) );
}
@@ -1916,11 +1742,15 @@ void SdrOle2Obj::ImpSetVisAreaSize()
// -----------------------------------------------------------------------------
-void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo)
{
- if( pModel && !pModel->isLocked() )
+ SdrRectObj::SetGeoData(rGeo);
+
+ if( !getSdrModelFromSdrObject().isLocked() )
{
+ ImpSetVisAreaSize();
GetObjRef();
+
if ( xObjRef.is() && ( xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) )
{
// if the object needs recompose on resize
@@ -1929,51 +1759,10 @@ void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
AddOwnLightClient();
}
}
-
- SdrRectObj::NbcResize(rRef,xFact,yFact);
-
- if( pModel && !pModel->isLocked() )
- ImpSetVisAreaSize();
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo)
-{
- SdrRectObj::SetGeoData(rGeo);
-
- if( pModel && !pModel->isLocked() )
- ImpSetVisAreaSize();
}
// -----------------------------------------------------------------------------
-void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
-{
- SdrRectObj::NbcSetSnapRect(rRect);
-
- if( pModel && !pModel->isLocked() )
- ImpSetVisAreaSize();
-
- if ( xObjRef.is() && IsChart() )
- {
- //#i103460# charts do not necessaryly have an own size within ODF files,
- //for this case they need to use the size settings from the surrounding frame,
- //which is made available with this method as there is no other way
- xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) );
- }
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect)
-{
- SdrRectObj::NbcSetLogicRect(rRect);
-
- if( pModel && !pModel->isLocked() )
- ImpSetVisAreaSize();
-}
-
Graphic* SdrOle2Obj::GetGraphic() const
{
if ( xObjRef.is() )
@@ -1996,41 +1785,67 @@ Size SdrOle2Obj::GetOrigObjSize( MapMode* pTargetMapMode ) const
// -----------------------------------------------------------------------------
-void SdrOle2Obj::NbcMove(const Size& rSize)
+void SdrOle2Obj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- SdrRectObj::NbcMove(rSize);
+ SdrRectObj::setSdrObjectTransformation(rTransformation);
- if( pModel && !pModel->isLocked() )
+ if(!getSdrModelFromSdrObject().isLocked())
+ {
ImpSetVisAreaSize();
+
+ // TTTT:
+ //GetObjRef();
+ //if ( xObjRef.is() && ( xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) )
+ //{
+ // // if the object needs recompose on resize
+ // // the client site should be created before the resize will take place
+ // // check whether there is no client site and create it if necessary
+ // if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(getSdrModelFromSdrObject().GetPersist()), xObjRef.GetObject() )
+ // && !( mpImpl->pLightClient && xObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) ) )
+ // {
+ // AddOwnLightClient();
+ // }
+ //}
+
+ }
+
+ if ( xObjRef.is() && IsChart() )
+ {
+ //#i103460# charts do not necessaryly have an own size within ODF files,
+ //for this case they need to use the size settings from the surrounding frame,
+ //which is made available with this method as there is no other way
+ // TTTT:
+ // xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) );
+ }
}
// -----------------------------------------------------------------------------
-sal_Bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
+bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
{
- sal_Bool bResult = sal_False;
+ bool bResult = false;
sal_Int32 nState = xObj->getCurrentState();
if ( nState == embed::EmbedStates::LOADED )
{
// the object is already unloaded
- bResult = sal_True;
+ bResult = true;
}
else
{
uno::Reference < util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
if ( !xModifiable.is() )
- bResult = sal_True;
+ bResult = true;
else
{
sal_Int64 nMiscStatus = xObj->getStatus( nAspect );
if ( embed::EmbedMisc::MS_EMBED_ALWAYSRUN != ( nMiscStatus & embed::EmbedMisc::MS_EMBED_ALWAYSRUN ) &&
- embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY != ( nMiscStatus & embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY ) &&
- !( xModifiable.is() && xModifiable->isModified() ) &&
- !( nState == embed::EmbedStates::INPLACE_ACTIVE || nState == embed::EmbedStates::UI_ACTIVE || nState == embed::EmbedStates::ACTIVE ) )
+ embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY != ( nMiscStatus & embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY ) &&
+ !( xModifiable.is() && xModifiable->isModified() ) &&
+ !( nState == embed::EmbedStates::INPLACE_ACTIVE || nState == embed::EmbedStates::UI_ACTIVE || nState == embed::EmbedStates::ACTIVE ) )
{
- bResult = sal_True;
+ bResult = true;
}
}
}
@@ -2040,16 +1855,16 @@ sal_Bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbedded
// -----------------------------------------------------------------------------
-sal_Bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
+bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
{
- sal_Bool bResult = sal_False;
+ bool bResult = false;
if ( CanUnloadRunningObj( xObj, nAspect ) )
{
try
{
xObj->changeState( embed::EmbedStates::LOADED );
- bResult = sal_True;
+ bResult = true;
}
catch( ::com::sun::star::uno::Exception& e )
{
@@ -2068,9 +1883,9 @@ sal_Bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xOb
// -----------------------------------------------------------------------------
-sal_Bool SdrOle2Obj::Unload()
+bool SdrOle2Obj::Unload()
{
- sal_Bool bUnloaded = sal_False;
+ bool bUnloaded = false;
if( xObjRef.is() )
{
@@ -2080,13 +1895,13 @@ sal_Bool SdrOle2Obj::Unload()
//sal_uIntPtr nRefCount = (*ppObjRef)->GetRefCount();
// prevent Unload if there are external references
//if( nRefCount > 2 )
- // return sal_False;
+ // return false;
//DBG_ASSERT( nRefCount == 2, "Wrong RefCount for unload" );
}
else
- bUnloaded = sal_True;
+ bUnloaded = true;
- if ( pModel && xObjRef.is() )
+ if ( xObjRef.is() )
{
bUnloaded = Unload( xObjRef.GetObject(), GetAspect() );
}
@@ -2098,13 +1913,13 @@ sal_Bool SdrOle2Obj::Unload()
void SdrOle2Obj::GetObjRef_Impl()
{
- if ( !xObjRef.is() && mpImpl->aPersistName.Len() && pModel && pModel->GetPersist() )
+ if ( !xObjRef.is() && mpImpl->aPersistName.Len() && getSdrModelFromSdrObject().GetPersist() )
{
// #107645#
// Only try loading if it did not went wrong up to now
if(!mpImpl->mbLoadingOLEObjectFailed)
{
- xObjRef.Assign( pModel->GetPersist()->getEmbeddedObjectContainer().GetEmbeddedObject( mpImpl->aPersistName ), GetAspect() );
+ xObjRef.Assign( getSdrModelFromSdrObject().GetPersist()->getEmbeddedObjectContainer().GetEmbeddedObject( mpImpl->aPersistName ), GetAspect() );
m_bTypeAsked = false;
CheckFileLink_Impl();
@@ -2113,12 +1928,8 @@ void SdrOle2Obj::GetObjRef_Impl()
// loop trying to load it again and again.
if( xObjRef.is() )
{
- mpImpl->mbLoadingOLEObjectFailed = sal_True;
+ mpImpl->mbLoadingOLEObjectFailed = true;
}
-
- // #108759# For math objects, set closed state to transparent
- if( ImplIsMathObj( xObjRef.GetObject() ) )
- SetClosedObj( false );
}
if ( xObjRef.is() )
@@ -2126,7 +1937,7 @@ void SdrOle2Obj::GetObjRef_Impl()
if( !IsEmptyPresObj() )
{
// #75637# remember modified status of model
- const sal_Bool bWasChanged(pModel ? pModel->IsChanged() : sal_False);
+ const bool bWasChanged(getSdrModelFromSdrObject().IsChanged());
// perhaps preview not valid anymore
// #75637# This line changes the modified state of the model
@@ -2135,9 +1946,9 @@ void SdrOle2Obj::GetObjRef_Impl()
// #75637# if status was not set before, force it back
// to not set, so that SetGraphic(0L) above does not
// set the modified state of the model.
- if(!bWasChanged && pModel && pModel->IsChanged())
+ if(!bWasChanged && getSdrModelFromSdrObject().IsChanged())
{
- pModel->SetChanged( sal_False );
+ getSdrModelFromSdrObject().SetChanged( false );
}
}
@@ -2146,20 +1957,20 @@ void SdrOle2Obj::GetObjRef_Impl()
//TODO/LATER: wait until ResizeOnPrinterChange is defined
//if ( nMiscStatus & SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE )
{
- if (pModel && pModel->GetRefDevice() &&
- pModel->GetRefDevice()->GetOutDevType() == OUTDEV_PRINTER)
+ if (getSdrModelFromSdrObject().GetReferenceDevice() &&
+ getSdrModelFromSdrObject().GetReferenceDevice()->GetOutDevType() == OUTDEV_PRINTER)
{
if(!bInDestruction)
{
//TODO/LATER: printerchange notification
/*
// prevent SetModified (don't want no update here)
- sal_Bool bWasEnabled = (*ppObjRef)->IsEnableSetModified();
+ bool bWasEnabled = (*ppObjRef)->IsEnableSetModified();
if ( bWasEnabled )
- (*ppObjRef)->EnableSetModified( sal_False );
+ (*ppObjRef)->EnableSetModified( false );
// Kein RefDevice oder RefDevice kein Printer
- Printer* pPrinter = (Printer*) pModel->GetRefDevice();
+ Printer* pPrinter = (Printer*) getSdrModelFromSdrObject().GetReferenceDevice();
(*ppObjRef)->OnDocumentPrinterChanged( pPrinter );
// reset state
@@ -2203,7 +2014,7 @@ uno::Reference< frame::XModel > SdrOle2Obj::getXModel() const
// -----------------------------------------------------------------------------
// #109985#
-sal_Bool SdrOle2Obj::IsChart() const
+bool SdrOle2Obj::IsChart() const
{
if ( !m_bTypeAsked )
{
@@ -2226,7 +2037,7 @@ void SdrOle2Obj::SetGraphicToObj( const uno::Reference< io::XInputStream >& xGrS
}
// -----------------------------------------------------------------------------
-sal_Bool SdrOle2Obj::IsCalc() const
+bool SdrOle2Obj::IsCalc() const
{
if ( !xObjRef.is() )
return false;
@@ -2240,33 +2051,33 @@ sal_Bool SdrOle2Obj::IsCalc() const
|| SvGlobalName(SO3_SC_OLE_EMBED_CLASSID_8) == aObjClsId
|| SvGlobalName(SO3_SC_CLASSID) == aObjClsId )
{
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
uno::Reference< frame::XModel > SdrOle2Obj::GetParentXModel() const
{
uno::Reference< frame::XModel > xDoc;
- if ( pModel )
- xDoc.set( pModel->getUnoModel(),uno::UNO_QUERY);
+ xDoc.set( getSdrModelFromSdrObject().getUnoModel(),uno::UNO_QUERY);
return xDoc;
}
// -----------------------------------------------------------------------------
-sal_Bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize )
+bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize )
{
// TODO/LEAN: to avoid rounding errors scaling always uses the VisArea.
// If we don't cache it for own objects also we must load the object here
- if ( !xObjRef.is() || !pModel )
- return sal_False;
+ if ( !xObjRef.is() )
+ return false;
- MapMode aMapMode( pModel->GetScaleUnit() );
+ MapMode aMapMode( getSdrModelFromSdrObject().GetExchangeObjectUnit() );
aObjAreaSize = xObjRef.GetSize( &aMapMode );
- Size aSize = aRect.GetSize();
+ const Rectangle aCurrRect(sdr::legacy::GetSnapRect(*this));
+ Size aSize = aCurrRect.GetSize();
aScaleWidth = Fraction(aSize.Width(), aObjAreaSize.Width() );
aScaleHeight = Fraction(aSize.Height(), aObjAreaSize.Height() );
@@ -2274,14 +2085,14 @@ sal_Bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScal
Kuerzen(aScaleHeight, 10);
Kuerzen(aScaleWidth, 10);
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------------
-sal_Bool SdrOle2Obj::AddOwnLightClient()
+bool SdrOle2Obj::AddOwnLightClient()
{
// The Own Light Client must be registered in object only using this method!
- if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(pModel->GetPersist()), xObjRef.GetObject() )
+ if ( !SfxInPlaceClient::GetClient( dynamic_cast<SfxObjectShell*>(getSdrModelFromSdrObject().GetPersist()), xObjRef.GetObject() )
&& !( mpImpl->pLightClient && xObjRef->getClientSite() == uno::Reference< embed::XEmbeddedClient >( mpImpl->pLightClient ) ) )
{
Connect();
@@ -2296,17 +2107,17 @@ sal_Bool SdrOle2Obj::AddOwnLightClient()
mpImpl->pLightClient->SetSizeScale( aScaleWidth, aScaleHeight );
try {
xObjRef->setClientSite( mpImpl->pLightClient );
- return sal_True;
+ return true;
} catch( uno::Exception& )
{}
}
}
- return sal_False;
+ return false;
}
- return sal_True;
+ return true;
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx
index 3cdd64116b69..c19249bba244 100644
--- a/svx/source/svdraw/svdopage.cxx
+++ b/svx/source/svdraw/svdopage.cxx
@@ -36,72 +36,91 @@
#include <svtools/colorcfg.hxx>
#include <svl/itemset.hxx>
#include <svx/sdr/properties/pageproperties.hxx>
-
-// #111111#
#include <svx/sdr/contact/viewcontactofpageobj.hxx>
+#include <svl/smplhint.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-// BaseProperties section
sdr::properties::BaseProperties* SdrPageObj::CreateObjectSpecificProperties()
{
return new sdr::properties::PageProperties(*this);
}
-//////////////////////////////////////////////////////////////////////////////
-// DrawContact section
-
sdr::contact::ViewContact* SdrPageObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfPageObj(*this);
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// this method is called form the destructor of the referenced page.
-// do all necessary action to forget the page. It is not necessary to call
-// RemovePageUser(), that is done form the destructor.
-void SdrPageObj::PageInDestruction(const SdrPage& rPage)
+SdrPageObj::SdrPageObj(SdrModel& rSdrModel, const basegfx::B2DHomMatrix& rTransform, SdrPage* pNewPage)
+: SdrObject(rSdrModel, rTransform),
+ mpShownPage(pNewPage)
{
- if(mpShownPage && mpShownPage == &rPage)
+ if(mpShownPage)
{
- // #i58769# Do not call ActionChanged() here, because that would
- // lead to the construction of a view contact object for a page that
- // is being destroyed.
-
- mpShownPage = 0L;
+ mpShownPage->AddListener(*this);
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1(SdrPageObj,SdrObject);
-
-SdrPageObj::SdrPageObj(SdrPage* pNewPage)
-: mpShownPage(pNewPage)
+SdrPageObj::~SdrPageObj()
{
if(mpShownPage)
{
- mpShownPage->AddPageUser(*this);
+ mpShownPage->RemoveListener(*this);
}
}
-SdrPageObj::SdrPageObj(const Rectangle& rRect, SdrPage* pNewPage)
-: mpShownPage(pNewPage)
+void SdrPageObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- if(mpShownPage)
+ if(this != &rSource)
{
- mpShownPage->AddPageUser(*this);
+ const SdrPageObj* pSource = dynamic_cast< const SdrPageObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrObject::copyDataFromSdrObject(rSource);
+
+ // copy SdrPage reference
+ SetReferencedPage(pSource->GetReferencedPage());
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
}
+}
+
+SdrObject* SdrPageObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SdrPageObj* pClone = new SdrPageObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
- aOutRect = rRect;
+ return pClone;
}
-SdrPageObj::~SdrPageObj()
+// derived from SfxListener
+void SdrPageObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- // #111111#
+ // call parent
+ SdrObject::Notify(rBC, rHint);
+
if(mpShownPage)
{
- mpShownPage->RemovePageUser(*this);
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrHint
+ && HINT_SDRPAGEDYING == pSdrHint->GetSdrHintKind()
+ && pSdrHint->GetSdrHintPage()
+ && pSdrHint->GetSdrHintPage() == mpShownPage)
+ {
+ // #i58769# Do not call ActionChanged() here, because that would
+ // lead to the construction of a view contact object for a page that
+ // is being destroyed.
+ mpShownPage = 0;
+ }
}
}
@@ -116,30 +135,24 @@ void SdrPageObj::SetReferencedPage(SdrPage* pNewPage)
{
if(mpShownPage != pNewPage)
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
if(mpShownPage)
{
- mpShownPage->RemovePageUser(*this);
+ mpShownPage->RemoveListener(*this);
}
mpShownPage = pNewPage;
if(mpShownPage)
{
- mpShownPage->AddPageUser(*this);
+ mpShownPage->AddListener(*this);
}
SetChanged();
- BroadcastObjectChange();
}
}
-// #i96598#
-void SdrPageObj::SetBoundRectDirty()
-{
- // avoid resetting aOutRect which in case of this object is model data,
- // not re-creatable view data
-}
-
sal_uInt16 SdrPageObj::GetObjIdentifier() const
{
return sal_uInt16(OBJ_PAGE);
@@ -147,26 +160,20 @@ sal_uInt16 SdrPageObj::GetObjIdentifier() const
void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bRotateFreeAllowed=sal_False;
- rInfo.bRotate90Allowed =sal_False;
- rInfo.bMirrorFreeAllowed=sal_False;
- rInfo.bMirror45Allowed =sal_False;
- rInfo.bMirror90Allowed =sal_False;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed =sal_False;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bNoOrthoDesired =sal_False;
- rInfo.bCanConvToPath =sal_False;
- rInfo.bCanConvToPoly =sal_False;
- rInfo.bCanConvToPathLineToArea=sal_False;
- rInfo.bCanConvToPolyLineToArea=sal_False;
-}
-
-void SdrPageObj::operator=(const SdrObject& rObj)
-{
- SdrObject::operator=(rObj);
- SetReferencedPage(((const SdrPageObj&)rObj).GetReferencedPage());
+ rInfo.mbRotateFreeAllowed = false;
+ rInfo.mbRotate90Allowed = false;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbMirror45Allowed = false;
+ rInfo.mbMirror90Allowed = false;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbNoOrthoDesired = false;
+ rInfo.mbCanConvToPath = false;
+ rInfo.mbCanConvToPoly = false;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
}
void SdrPageObj::TakeObjNameSingul(XubString& rName) const
@@ -188,4 +195,5 @@ void SdrPageObj::TakeObjNamePlural(XubString& rName) const
rName=ImpGetResStr(STR_ObjNamePluralPAGE);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index b62ac517f3c8..f2d36809895e 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -37,8 +37,8 @@
#include <svx/svdpage.hxx>
#include <svx/svdhdl.hxx>
#include <svx/svdview.hxx> // fuer MovCreate bei Freihandlinien
-#include "svx/svdglob.hxx" // Stringcache
-#include "svx/svdstr.hrc" // Objektname
+#include <svx/svdglob.hxx> // Stringcache
+#include <svx/svdstr.hrc> // Objektname
#ifdef _MSC_VER
#pragma optimize ("",off)
@@ -52,17 +52,8 @@
#include <svx/polypolygoneditor.hxx>
#include <svx/xlntrit.hxx>
#include <vcl/salbtype.hxx> // FRound
-#include "svdoimp.hxx"
#include <svx/sdr/contact/viewcontactofsdrpathobj.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-
-// #104018# replace macros above with type-safe methods
-inline sal_Int32 ImplTwipsToMM(sal_Int32 nVal) { return ((nVal * 127 + 36) / 72); }
-inline sal_Int32 ImplMMToTwips(sal_Int32 nVal) { return ((nVal * 72 + 63) / 127); }
-inline sal_Int64 ImplTwipsToMM(sal_Int64 nVal) { return ((nVal * 127 + 36) / 72); }
-inline sal_Int64 ImplMMToTwips(sal_Int64 nVal) { return ((nVal * 72 + 63) / 127); }
-inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); }
-inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -73,21 +64,26 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <svx/svdlegacy.hxx>
using namespace sdr;
-inline sal_uInt16 GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, FASTBOOL bClosed)
+inline sal_uInt16 GetPrevPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed)
{
- if (nPnt>0) {
+ if (nPnt>0)
+ {
nPnt--;
- } else {
+ }
+ else
+ {
nPnt=nPntMax;
if (bClosed) nPnt--;
}
+
return nPnt;
}
-inline sal_uInt16 GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, FASTBOOL bClosed)
+inline sal_uInt16 GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, bool bClosed)
{
nPnt++;
if (nPnt>nPntMax || (bClosed && nPnt>=nPntMax)) nPnt=0;
@@ -97,60 +93,60 @@ inline sal_uInt16 GetNextPnt(sal_uInt16 nPnt, sal_uInt16 nPntMax, FASTBOOL bClos
struct ImpSdrPathDragData : public SdrDragStatUserData
{
XPolygon aXP; // Ausschnitt aud dem Originalpolygon
- FASTBOOL bValid; // sal_False = zu wenig Punkte
- FASTBOOL bClosed; // geschlossenes Objekt?
+ bool bValid; // false = zu wenig Punkte
+ bool bClosed; // geschlossenes Objekt?
sal_uInt16 nPoly; // Nummer des Polygons im PolyPolygon
sal_uInt16 nPnt; // Punktnummer innerhalb des obigen Polygons
sal_uInt16 nPntAnz; // Punktanzahl des Polygons
sal_uInt16 nPntMax; // Maximaler Index
- FASTBOOL bBegPnt; // Gedraggter Punkt ist der Anfangspunkt einer Polyline
- FASTBOOL bEndPnt; // Gedraggter Punkt ist der Endpunkt einer Polyline
+ bool bBegPnt; // Gedraggter Punkt ist der Anfangspunkt einer Polyline
+ bool bEndPnt; // Gedraggter Punkt ist der Endpunkt einer Polyline
sal_uInt16 nPrevPnt; // Index des vorherigen Punkts
sal_uInt16 nNextPnt; // Index des naechsten Punkts
- FASTBOOL bPrevIsBegPnt; // Vorheriger Punkt ist Anfangspunkt einer Polyline
- FASTBOOL bNextIsEndPnt; // Folgepunkt ist Endpunkt einer Polyline
+ bool bPrevIsBegPnt; // Vorheriger Punkt ist Anfangspunkt einer Polyline
+ bool bNextIsEndPnt; // Folgepunkt ist Endpunkt einer Polyline
sal_uInt16 nPrevPrevPnt; // Index des vorvorherigen Punkts
sal_uInt16 nNextNextPnt; // Index des uebernaechsten Punkts
- FASTBOOL bControl; // Punkt ist ein Kontrollpunkt
- FASTBOOL bIsPrevControl; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
- FASTBOOL bIsNextControl; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
- FASTBOOL bPrevIsControl; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
- FASTBOOL bNextIsControl; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
+ bool bControl; // Punkt ist ein Kontrollpunkt
+ bool bIsPrevControl; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
+ bool bIsNextControl; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
+ bool bPrevIsControl; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
+ bool bNextIsControl; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
sal_uInt16 nPrevPrevPnt0;
sal_uInt16 nPrevPnt0;
sal_uInt16 nPnt0;
sal_uInt16 nNextPnt0;
sal_uInt16 nNextNextPnt0;
- FASTBOOL bEliminate; // Punkt loeschen? (wird von MovDrag gesetzt)
+ bool bEliminate; // Punkt loeschen? (wird von MovDrag gesetzt)
// ##
- sal_Bool mbMultiPointDrag;
+ bool mbMultiPointDrag;
const XPolyPolygon maOrig;
XPolyPolygon maMove;
Container maHandles;
public:
- ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl, sal_Bool bMuPoDr, const SdrDragStat& rDrag);
+ ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl, bool bMuPoDr, const SdrDragStat& rDrag);
void ResetPoly(const SdrPathObj& rPO);
- sal_Bool IsMultiPointDrag() const { return mbMultiPointDrag; }
+ bool IsMultiPointDrag() const { return mbMultiPointDrag; }
};
-ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl, sal_Bool bMuPoDr, const SdrDragStat& rDrag)
+ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl, bool bMuPoDr, const SdrDragStat& rDrag)
: aXP(5),
mbMultiPointDrag(bMuPoDr),
- maOrig(rPO.GetPathPoly()),
+ maOrig(rPO.getB2DPolyPolygonInObjectCoordinates()),
maHandles(0)
{
if(mbMultiPointDrag)
{
- const SdrMarkView& rMarkView = *rDrag.GetView();
+ const SdrMarkView& rMarkView = rDrag.GetSdrViewFromSdrDragStat();
const SdrHdlList& rHdlList = rMarkView.GetHdlList();
const sal_uInt32 nHdlCount = rHdlList.GetHdlCount();
- const SdrObject* pInteractionObject(nHdlCount && rHdlList.GetHdl(0) ? rHdlList.GetHdl(0)->GetObj() : 0);
+ const SdrObject* pInteractionObject(nHdlCount && rHdlList.GetHdlByIndex(0) ? rHdlList.GetHdlByIndex(0)->GetObj() : 0);
for(sal_uInt32 a(0); a < nHdlCount; a++)
{
- SdrHdl* pTestHdl = rHdlList.GetHdl(a);
+ SdrHdl* pTestHdl = rHdlList.GetHdlByIndex(a);
if(pTestHdl && pTestHdl->IsSelected() && pTestHdl->GetObj() == pInteractionObject)
{
@@ -159,15 +155,15 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl
}
maMove = maOrig;
- bValid = sal_True;
+ bValid = true;
}
else
{
- bValid=sal_False;
- bClosed=rPO.IsClosed(); // geschlossenes Objekt?
+ bValid = false;
+ bClosed=rPO.isClosed(); // geschlossenes Objekt?
nPoly=(sal_uInt16)rHdl.GetPolyNum(); // Nummer des Polygons im PolyPolygon
nPnt=(sal_uInt16)rHdl.GetPointNum(); // Punktnummer innerhalb des obigen Polygons
- const XPolygon aTmpXP(rPO.GetPathPoly().getB2DPolygon(nPoly));
+ const XPolygon aTmpXP(rPO.getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(nPoly));
nPntAnz=aTmpXP.GetPointCount(); // Punktanzahl des Polygons
if (nPntAnz==0 || (bClosed && nPntAnz==1)) return; // min. 1Pt bei Line, min. 2 bei Polygon
nPntMax=nPntAnz-1; // Maximaler Index
@@ -188,10 +184,10 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl
if (!bPrevIsBegPnt) nPrevPrevPnt=GetPrevPnt(nPrevPnt,nPntMax,bClosed);
if (!bNextIsEndPnt) nNextNextPnt=GetNextPnt(nNextPnt,nPntMax,bClosed);
bControl=rHdl.IsPlusHdl(); // Punkt ist ein Kontrollpunkt
- bIsPrevControl=sal_False; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
- bIsNextControl=sal_False; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
- bPrevIsControl=sal_False; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
- bNextIsControl=sal_False; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
+ bIsPrevControl=false; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
+ bIsNextControl=false; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
+ bPrevIsControl=false; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
+ bNextIsControl=false; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
if (bControl) {
bIsPrevControl=aTmpXP.IsControl(nPrevPnt);
bIsNextControl=!bIsPrevControl;
@@ -209,15 +205,15 @@ ImpSdrPathDragData::ImpSdrPathDragData(const SdrPathObj& rPO, const SdrHdl& rHdl
nPnt=2;
nNextPnt=3;
nNextNextPnt=4;
- bEliminate=sal_False;
+ bEliminate=false;
ResetPoly(rPO);
- bValid=sal_True;
+ bValid=true;
}
}
void ImpSdrPathDragData::ResetPoly(const SdrPathObj& rPO)
{
- const XPolygon aTmpXP(rPO.GetPathPoly().getB2DPolygon(nPoly));
+ const XPolygon aTmpXP(rPO.getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(nPoly));
aXP[0]=aTmpXP[nPrevPrevPnt0]; aXP.SetFlags(0,aTmpXP.GetFlags(nPrevPrevPnt0));
aXP[1]=aTmpXP[nPrevPnt0]; aXP.SetFlags(1,aTmpXP.GetFlags(nPrevPnt0));
aXP[2]=aTmpXP[nPnt0]; aXP.SetFlags(2,aTmpXP.GetFlags(nPnt0));
@@ -234,64 +230,61 @@ struct ImpPathCreateUser : public SdrDragStatUserData
Point aBezCtrl1;
Point aBezCtrl2;
Point aBezEnd;
- Point aCircStart;
- Point aCircEnd;
- Point aCircCenter;
Point aLineStart;
Point aLineEnd;
- Point aRectP1;
- Point aRectP2;
- Point aRectP3;
- long nCircRadius;
- long nCircStWink;
- long nCircRelWink;
- FASTBOOL bBezier;
- FASTBOOL bBezHasCtrl0;
- FASTBOOL bCurve;
- FASTBOOL bCircle;
- FASTBOOL bAngleSnap;
- FASTBOOL bLine;
- FASTBOOL bLine90;
- FASTBOOL bRect;
- FASTBOOL bMixedCreate;
+ bool bBezier;
+ bool bBezHasCtrl0;
+ bool bLine;
+ bool bLine90;
sal_uInt16 nBezierStartPoint;
- SdrObjKind eStartKind;
- SdrObjKind eAktKind;
+ SdrPathObjType meCreatePathType;
+ bool mbCreateFreehandMode;
public:
- ImpPathCreateUser(): nCircRadius(0),nCircStWink(0),nCircRelWink(0),
- bBezier(sal_False),bBezHasCtrl0(sal_False),bCurve(sal_False),bCircle(sal_False),bAngleSnap(sal_False),bLine(sal_False),bLine90(sal_False),bRect(sal_False),
- bMixedCreate(sal_False),nBezierStartPoint(0),eStartKind(OBJ_NONE),eAktKind(OBJ_NONE) { }
+ ImpPathCreateUser(SdrPathObjType eCreatePathType, bool bCreateFreehandMode) :
+ bBezier(false),
+ bBezHasCtrl0(false),
+ bLine(false),
+ bLine90(false),
+ nBezierStartPoint(0),
+ meCreatePathType(eCreatePathType),
+ mbCreateFreehandMode(bCreateFreehandMode)
+ {}
+
+ void ResetFormFlags()
+ {
+ bBezier = false;
+ bLine = false;
+ }
+
+ bool IsFormFlag() const
+ {
+ return
+ bBezier ||
+ bLine;
+ }
+
+ bool IsCreateFreehand() { return mbCreateFreehandMode; }
+ bool IsCreateBezier() { return !IsCreateFreehand() && (PathType_OpenBezier == meCreatePathType || PathType_ClosedBezier == meCreatePathType); }
+ bool IsCreateLine() { return PathType_Line == meCreatePathType; }
- void ResetFormFlags() { bBezier=sal_False; bCurve=sal_False; bCircle=sal_False; bLine=sal_False; bRect=sal_False; }
- FASTBOOL IsFormFlag() const { return bBezier || bCurve || bCircle || bLine || bRect; }
XPolygon GetFormPoly() const;
- FASTBOOL CalcBezier(const Point& rP1, const Point& rP2, const Point& rDir, FASTBOOL bMouseDown);
+ bool CalcBezier(const Point& rP1, const Point& rP2, const Point& rDir, bool bMouseDown);
XPolygon GetBezierPoly() const;
- //int CalcCurve(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView) { return sal_False; }
- XPolygon GetCurvePoly() const { return XPolygon(); }
- FASTBOOL CalcCircle(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView);
- XPolygon GetCirclePoly() const;
- FASTBOOL CalcLine(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView);
+ bool CalcLine(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView);
Point CalcLine(const Point& rCsr, long nDirX, long nDirY, SdrView* pView) const;
XPolygon GetLinePoly() const;
- FASTBOOL CalcRect(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView);
- XPolygon GetRectPoly() const;
};
XPolygon ImpPathCreateUser::GetFormPoly() const
{
if (bBezier) return GetBezierPoly();
- if (bCurve) return GetCurvePoly();
- if (bCircle) return GetCirclePoly();
if (bLine) return GetLinePoly();
- if (bRect) return GetRectPoly();
return XPolygon();
}
-FASTBOOL ImpPathCreateUser::CalcBezier(const Point& rP1, const Point& rP2, const Point& rDir, FASTBOOL bMouseDown)
+bool ImpPathCreateUser::CalcBezier(const Point& rP1, const Point& rP2, const Point& rDir, bool bMouseDown)
{
- FASTBOOL bRet=sal_True;
aBezStart=rP1;
aBezCtrl1=rP1+rDir;
aBezCtrl2=rP2;
@@ -300,8 +293,8 @@ FASTBOOL ImpPathCreateUser::CalcBezier(const Point& rP1, const Point& rP2, const
// Also copy the end point when no end point is set yet
if (!bMouseDown || (0L == aBezEnd.X() && 0L == aBezEnd.Y())) aBezEnd=rP2;
- bBezier=bRet;
- return bRet;
+ bBezier=true; //bRet;
+ return true; //bRet;
}
XPolygon ImpPathCreateUser::GetBezierPoly() const
@@ -314,93 +307,25 @@ XPolygon ImpPathCreateUser::GetBezierPoly() const
return aXP;
}
-FASTBOOL ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView)
-{
- long nTangAngle=GetAngle(rDir);
- aCircStart=rP1;
- aCircEnd=rP2;
- aCircCenter=rP1;
- long dx=rP2.X()-rP1.X();
- long dy=rP2.Y()-rP1.Y();
- long dAngle=GetAngle(Point(dx,dy))-nTangAngle;
- dAngle=NormAngle360(dAngle);
- long nTmpAngle=NormAngle360(9000-dAngle);
- FASTBOOL bRet=nTmpAngle!=9000 && nTmpAngle!=27000;
- long nRad=0;
- if (bRet) {
- double cs=cos(nTmpAngle*nPi180);
- double nR=(double)GetLen(Point(dx,dy))/cs/2;
- nRad=Abs(Round(nR));
- }
- if (dAngle<18000) {
- nCircStWink=NormAngle360(nTangAngle-9000);
- nCircRelWink=NormAngle360(2*dAngle);
- aCircCenter.X()+=Round(nRad*cos((nTangAngle+9000)*nPi180));
- aCircCenter.Y()-=Round(nRad*sin((nTangAngle+9000)*nPi180));
- } else {
- nCircStWink=NormAngle360(nTangAngle+9000);
- nCircRelWink=-NormAngle360(36000-2*dAngle);
- aCircCenter.X()+=Round(nRad*cos((nTangAngle-9000)*nPi180));
- aCircCenter.Y()-=Round(nRad*sin((nTangAngle-9000)*nPi180));
- }
- bAngleSnap=pView!=NULL && pView->IsAngleSnapEnabled();
- if (bAngleSnap) {
- long nSA=pView->GetSnapAngle();
- if (nSA!=0) { // Winkelfang
- FASTBOOL bNeg=nCircRelWink<0;
- if (bNeg) nCircRelWink=-nCircRelWink;
- nCircRelWink+=nSA/2;
- nCircRelWink/=nSA;
- nCircRelWink*=nSA;
- nCircRelWink=NormAngle360(nCircRelWink);
- if (bNeg) nCircRelWink=-nCircRelWink;
- }
- }
- nCircRadius=nRad;
- if (nRad==0 || Abs(nCircRelWink)<5) bRet=sal_False;
- bCircle=bRet;
- return bRet;
-}
-
-XPolygon ImpPathCreateUser::GetCirclePoly() const
-{
- if (nCircRelWink>=0) {
- XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
- sal_uInt16((nCircStWink+5)/10),sal_uInt16((nCircStWink+nCircRelWink+5)/10),sal_False);
- aXP[0]=aCircStart; aXP.SetFlags(0,XPOLY_SMOOTH);
- if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
- return aXP;
- } else {
- XPolygon aXP(aCircCenter,nCircRadius,nCircRadius,
- sal_uInt16(NormAngle360(nCircStWink+nCircRelWink+5)/10),sal_uInt16((nCircStWink+5)/10),sal_False);
- sal_uInt16 nAnz=aXP.GetPointCount();
- for (sal_uInt16 nNum=nAnz/2; nNum>0;) {
- nNum--; // XPoly Punktreihenfolge umkehren
- sal_uInt16 n2=nAnz-nNum-1;
- Point aPt(aXP[nNum]);
- aXP[nNum]=aXP[n2];
- aXP[n2]=aPt;
- }
- aXP[0]=aCircStart; aXP.SetFlags(0,XPOLY_SMOOTH);
- if (!bAngleSnap) aXP[aXP.GetPointCount()-1]=aCircEnd;
- return aXP;
- }
-}
-
Point ImpPathCreateUser::CalcLine(const Point& aCsr, long nDirX, long nDirY, SdrView* pView) const
{
long x=aCsr.X(),x1=x,x2=x;
long y=aCsr.Y(),y1=y,y2=y;
- FASTBOOL bHLin=nDirY==0;
- FASTBOOL bVLin=nDirX==0;
- if (bHLin) y=0;
- else if (bVLin) x=0;
- else {
+ bool bHLin=nDirY==0;
+ bool bVLin=nDirX==0;
+
+ if (bHLin)
+ y=0;
+ else if (bVLin)
+ x=0;
+ else
+ {
x1=BigMulDiv(y,nDirX,nDirY);
y2=BigMulDiv(x,nDirY,nDirX);
long l1=Abs(x1)+Abs(y1);
long l2=Abs(x2)+Abs(y2);
- if ((l1<=l2) != (pView!=NULL && pView->IsBigOrtho())) {
+ if ((l1<=l2) != (pView!=NULL && pView->IsBigOrthogonal()))
+ {
x=x1; y=y1;
} else {
x=x2; y=y2;
@@ -409,26 +334,31 @@ Point ImpPathCreateUser::CalcLine(const Point& aCsr, long nDirX, long nDirY, Sdr
return Point(x,y);
}
-FASTBOOL ImpPathCreateUser::CalcLine(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView)
+bool ImpPathCreateUser::CalcLine(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView)
{
aLineStart=rP1;
aLineEnd=rP2;
- bLine90=sal_False;
- if (rP1==rP2 || (rDir.X()==0 && rDir.Y()==0)) { bLine=sal_False; return sal_False; }
+ bLine90=false;
+ if (rP1==rP2 || (rDir.X()==0 && rDir.Y()==0)) { bLine=false; return false; }
Point aTmpPt(rP2-rP1);
long nDirX=rDir.X();
long nDirY=rDir.Y();
Point aP1(CalcLine(aTmpPt, nDirX, nDirY,pView)); aP1-=aTmpPt; long nQ1=Abs(aP1.X())+Abs(aP1.Y());
Point aP2(CalcLine(aTmpPt, nDirY,-nDirX,pView)); aP2-=aTmpPt; long nQ2=Abs(aP2.X())+Abs(aP2.Y());
- if (pView!=NULL && pView->IsOrtho()) nQ1=0; // Ortho schaltet rechtwinklig aus
+ if (pView && pView->IsOrthogonal()) nQ1=0; // Ortho schaltet rechtwinklig aus
bLine90=nQ1>2*nQ2;
- if (!bLine90) { // glatter Uebergang
+ if (!bLine90)
+ {
+ // glatter Uebergang
aLineEnd+=aP1;
- } else { // rechtwinkliger Uebergang
+ }
+ else
+ {
+ // rechtwinkliger Uebergang
aLineEnd+=aP2;
}
- bLine=sal_True;
- return sal_True;
+ bLine=true;
+ return true;
}
XPolygon ImpPathCreateUser::GetLinePoly() const
@@ -439,80 +369,21 @@ XPolygon ImpPathCreateUser::GetLinePoly() const
return aXP;
}
-FASTBOOL ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point& rDir, SdrView* pView)
-{
- aRectP1=rP1;
- aRectP2=rP1;
- aRectP3=rP2;
- if (rP1==rP2 || (rDir.X()==0 && rDir.Y()==0)) { bRect=sal_False; return sal_False; }
- Point aTmpPt(rP2-rP1);
- long nDirX=rDir.X();
- long nDirY=rDir.Y();
- long x=aTmpPt.X();
- long y=aTmpPt.Y();
- FASTBOOL bHLin=nDirY==0;
- FASTBOOL bVLin=nDirX==0;
- if (bHLin) y=0;
- else if (bVLin) x=0;
- else {
- y=BigMulDiv(x,nDirY,nDirX);
- long nHypLen=aTmpPt.Y()-y;
- long nTangAngle=-GetAngle(rDir);
- // sin=g/h, g=h*sin
- double a=nTangAngle*nPi180;
- double sn=sin(a);
- double cs=cos(a);
- double nGKathLen=nHypLen*sn;
- y+=Round(nGKathLen*sn);
- x+=Round(nGKathLen*cs);
- }
- aRectP2.X()+=x;
- aRectP2.Y()+=y;
- if (pView!=NULL && pView->IsOrtho()) {
- long dx1=aRectP2.X()-aRectP1.X(); long dx1a=Abs(dx1);
- long dy1=aRectP2.Y()-aRectP1.Y(); long dy1a=Abs(dy1);
- long dx2=aRectP3.X()-aRectP2.X(); long dx2a=Abs(dx2);
- long dy2=aRectP3.Y()-aRectP2.Y(); long dy2a=Abs(dy2);
- FASTBOOL b1MoreThan2=dx1a+dy1a>dx2a+dy2a;
- if (b1MoreThan2 != pView->IsBigOrtho()) {
- long xtemp=dy2a-dx1a; if (dx1<0) xtemp=-xtemp;
- long ytemp=dx2a-dy1a; if (dy1<0) ytemp=-ytemp;
- aRectP2.X()+=xtemp;
- aRectP2.Y()+=ytemp;
- aRectP3.X()+=xtemp;
- aRectP3.Y()+=ytemp;
- } else {
- long xtemp=dy1a-dx2a; if (dx2<0) xtemp=-xtemp;
- long ytemp=dx1a-dy2a; if (dy2<0) ytemp=-ytemp;
- aRectP3.X()+=xtemp;
- aRectP3.Y()+=ytemp;
- }
- }
- bRect=sal_True;
- return sal_True;
-}
-
-XPolygon ImpPathCreateUser::GetRectPoly() const
-{
- XPolygon aXP(3);
- aXP[0]=aRectP1; aXP.SetFlags(0,XPOLY_SMOOTH);
- aXP[1]=aRectP2;
- if (aRectP3!=aRectP2) aXP[2]=aRectP3;
- return aXP;
-}
-
/*************************************************************************/
class ImpPathForDragAndCreate
{
- SdrPathObj& mrSdrPathObject;
+ const SdrPathObj& mrSdrPathObject;
XPolyPolygon aPathPolygon;
- SdrObjKind meObjectKind;
+ SdrPathObjType mePathType;
ImpSdrPathDragData* mpSdrPathDragData;
- bool mbCreating;
+
+ /// bitfield
+ bool mbCreating : 1;
+ bool mbFreehandMode : 1;
public:
- ImpPathForDragAndCreate(SdrPathObj& rSdrPathObject);
+ ImpPathForDragAndCreate(const SdrPathObj& rSdrPathObject, SdrPathObjType ePathType, bool bFreehandMode);
~ImpPathForDragAndCreate();
// drag stuff
@@ -524,17 +395,17 @@ public:
basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
// create stuff
- FASTBOOL BegCreate(SdrDragStat& rStat);
- FASTBOOL MovCreate(SdrDragStat& rStat);
- FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
- FASTBOOL BckCreate(SdrDragStat& rStat);
- void BrkCreate(SdrDragStat& rStat);
+ bool BegCreate(SdrDragStat& rDrag);
+ bool MovCreate(SdrDragStat& rDrag);
+ bool EndCreate(SdrDragStat& rDrag, SdrCreateCmd eCmd);
+ bool BckCreate(SdrDragStat& rDrag);
+ void BrkCreate(SdrDragStat& rDrag);
Pointer GetCreatePointer() const;
// helping stuff
- bool IsClosed(SdrObjKind eKind) const { return eKind==OBJ_POLY || eKind==OBJ_PATHPOLY || eKind==OBJ_PATHFILL || eKind==OBJ_FREEFILL || eKind==OBJ_SPLNFILL; }
- bool IsFreeHand(SdrObjKind eKind) const { return eKind==OBJ_FREELINE || eKind==OBJ_FREEFILL; }
- bool IsBezier(SdrObjKind eKind) const { return eKind==OBJ_PATHLINE || eKind==OBJ_PATHFILL; }
+ bool isClosed() const { return PathType_ClosedPolygon == mePathType || PathType_ClosedBezier == mePathType; }
+ bool isLine() const { return PathType_Line == mePathType; }
+ bool isFreeHand() const { return mbFreehandMode; }
bool IsCreating() const { return mbCreating; }
// get the polygon
@@ -543,12 +414,13 @@ public:
basegfx::B2DPolyPolygon getModifiedPolyPolygon() const { return aPathPolygon.getB2DPolyPolygon(); }
};
-ImpPathForDragAndCreate::ImpPathForDragAndCreate(SdrPathObj& rSdrPathObject)
+ImpPathForDragAndCreate::ImpPathForDragAndCreate(const SdrPathObj& rSdrPathObject, SdrPathObjType ePathType, bool bFreehandMode)
: mrSdrPathObject(rSdrPathObject),
- aPathPolygon(rSdrPathObject.GetPathPoly()),
- meObjectKind(mrSdrPathObject.meKind),
+ aPathPolygon(rSdrPathObject.getB2DPolyPolygonInObjectCoordinates()),
+ mePathType(ePathType),
mpSdrPathDragData(0),
- mbCreating(false)
+ mbCreating(false),
+ mbFreehandMode(bFreehandMode)
{
}
@@ -562,26 +434,26 @@ ImpPathForDragAndCreate::~ImpPathForDragAndCreate()
bool ImpPathForDragAndCreate::beginPathDrag( SdrDragStat& rDrag ) const
{
- const SdrHdl* pHdl=rDrag.GetHdl();
+ const SdrHdl* pHdl=rDrag.GetActiveHdl();
if(!pHdl)
- return sal_False;
+ return false;
- sal_Bool bMultiPointDrag(sal_True);
+ bool bMultiPointDrag(true);
if(aPathPolygon[(sal_uInt16)pHdl->GetPolyNum()].IsControl((sal_uInt16)pHdl->GetPointNum()))
- bMultiPointDrag = sal_False;
+ bMultiPointDrag = false;
if(bMultiPointDrag)
{
- const SdrMarkView& rMarkView = *rDrag.GetView();
+ const SdrMarkView& rMarkView = rDrag.GetSdrViewFromSdrDragStat();
const SdrHdlList& rHdlList = rMarkView.GetHdlList();
const sal_uInt32 nHdlCount = rHdlList.GetHdlCount();
- const SdrObject* pInteractionObject(nHdlCount && rHdlList.GetHdl(0) ? rHdlList.GetHdl(0)->GetObj() : 0);
+ const SdrObject* pInteractionObject(nHdlCount && rHdlList.GetHdlByIndex(0) ? rHdlList.GetHdlByIndex(0)->GetObj() : 0);
sal_uInt32 nSelectedPoints(0);
for(sal_uInt32 a(0); a < nHdlCount; a++)
{
- SdrHdl* pTestHdl = rHdlList.GetHdl(a);
+ SdrHdl* pTestHdl = rHdlList.GetHdlByIndex(a);
if(pTestHdl && pTestHdl->IsSelected() && pTestHdl->GetObj() == pInteractionObject)
{
@@ -590,7 +462,7 @@ bool ImpPathForDragAndCreate::beginPathDrag( SdrDragStat& rDrag ) const
}
if(nSelectedPoints <= 1)
- bMultiPointDrag = sal_False;
+ bMultiPointDrag = false;
}
((ImpPathForDragAndCreate*)this)->mpSdrPathDragData = new ImpSdrPathDragData(mrSdrPathObject,*pHdl,bMultiPointDrag,rDrag);
@@ -616,9 +488,9 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
if(mpSdrPathDragData->IsMultiPointDrag())
{
- Point aDelta(rDrag.GetNow() - rDrag.GetStart());
+ const basegfx::B2DVector aDelta(rDrag.GetNow() - rDrag.GetStart());
- if(aDelta.X() || aDelta.Y())
+ if(!aDelta.equalZero())
{
for(sal_uInt32 a(0); a < mpSdrPathDragData->maHandles.Count(); a++)
{
@@ -628,34 +500,35 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
const XPolygon& rOrig = mpSdrPathDragData->maOrig[nPolyIndex];
XPolygon& rMove = mpSdrPathDragData->maMove[nPolyIndex];
const sal_uInt16 nPointCount(rOrig.GetPointCount());
- sal_Bool bClosed(rOrig[0] == rOrig[nPointCount-1]);
+ bool bClosed(rOrig[0] == rOrig[nPointCount-1]);
// move point itself
- rMove[nPointIndex] = rOrig[nPointIndex] + aDelta;
+ const Point aOldDelta(basegfx::fround(aDelta.getX()), basegfx::fround(aDelta.getY()));
+ rMove[nPointIndex] = rOrig[nPointIndex] + aOldDelta;
// when point is first and poly closed, move close point, too.
if(nPointCount > 0 && !nPointIndex && bClosed)
{
- rMove[nPointCount - 1] = rOrig[nPointCount - 1] + aDelta;
+ rMove[nPointCount - 1] = rOrig[nPointCount - 1] + aOldDelta;
// when moving the last point it may be necessary to move the
// control point in front of this one, too.
if(nPointCount > 1 && rOrig.IsControl(nPointCount - 2))
- rMove[nPointCount - 2] = rOrig[nPointCount - 2] + aDelta;
+ rMove[nPointCount - 2] = rOrig[nPointCount - 2] + aOldDelta;
}
// is a control point before this?
if(nPointIndex > 0 && rOrig.IsControl(nPointIndex - 1))
{
// Yes, move it, too
- rMove[nPointIndex - 1] = rOrig[nPointIndex - 1] + aDelta;
+ rMove[nPointIndex - 1] = rOrig[nPointIndex - 1] + aOldDelta;
}
// is a control point after this?
if(nPointIndex + 1 < nPointCount && rOrig.IsControl(nPointIndex + 1))
{
// Yes, move it, too
- rMove[nPointIndex + 1] = rOrig[nPointIndex + 1] + aDelta;
+ rMove[nPointIndex + 1] = rOrig[nPointIndex + 1] + aOldDelta;
}
}
}
@@ -665,52 +538,61 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
mpSdrPathDragData->ResetPoly(mrSdrPathObject);
// Div. Daten lokal Kopieren fuer weniger Code und schnelleren Zugriff
- FASTBOOL bClosed =mpSdrPathDragData->bClosed ; // geschlossenes Objekt?
+ bool bClosed =mpSdrPathDragData->bClosed ; // geschlossenes Objekt?
sal_uInt16 nPnt =mpSdrPathDragData->nPnt ; // Punktnummer innerhalb des obigen Polygons
- FASTBOOL bBegPnt =mpSdrPathDragData->bBegPnt ; // Gedraggter Punkt ist der Anfangspunkt einer Polyline
- FASTBOOL bEndPnt =mpSdrPathDragData->bEndPnt ; // Gedraggter Punkt ist der Endpunkt einer Polyline
+ bool bBegPnt =mpSdrPathDragData->bBegPnt ; // Gedraggter Punkt ist der Anfangspunkt einer Polyline
+ bool bEndPnt =mpSdrPathDragData->bEndPnt ; // Gedraggter Punkt ist der Endpunkt einer Polyline
sal_uInt16 nPrevPnt =mpSdrPathDragData->nPrevPnt ; // Index des vorherigen Punkts
sal_uInt16 nNextPnt =mpSdrPathDragData->nNextPnt ; // Index des naechsten Punkts
- FASTBOOL bPrevIsBegPnt =mpSdrPathDragData->bPrevIsBegPnt ; // Vorheriger Punkt ist Anfangspunkt einer Polyline
- FASTBOOL bNextIsEndPnt =mpSdrPathDragData->bNextIsEndPnt ; // Folgepunkt ist Endpunkt einer Polyline
+ bool bPrevIsBegPnt =mpSdrPathDragData->bPrevIsBegPnt ; // Vorheriger Punkt ist Anfangspunkt einer Polyline
+ bool bNextIsEndPnt =mpSdrPathDragData->bNextIsEndPnt ; // Folgepunkt ist Endpunkt einer Polyline
sal_uInt16 nPrevPrevPnt =mpSdrPathDragData->nPrevPrevPnt ; // Index des vorvorherigen Punkts
sal_uInt16 nNextNextPnt =mpSdrPathDragData->nNextNextPnt ; // Index des uebernaechsten Punkts
- FASTBOOL bControl =mpSdrPathDragData->bControl ; // Punkt ist ein Kontrollpunkt
- //int bIsPrevControl=mpSdrPathDragData->bIsPrevControl; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
- FASTBOOL bIsNextControl=mpSdrPathDragData->bIsNextControl; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
- FASTBOOL bPrevIsControl=mpSdrPathDragData->bPrevIsControl; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
- FASTBOOL bNextIsControl=mpSdrPathDragData->bNextIsControl; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
+ bool bControl =mpSdrPathDragData->bControl ; // Punkt ist ein Kontrollpunkt
+ //bool bIsPrevControl=mpSdrPathDragData->bIsPrevControl; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
+ bool bIsNextControl=mpSdrPathDragData->bIsNextControl; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
+ bool bPrevIsControl=mpSdrPathDragData->bPrevIsControl; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
+ bool bNextIsControl=mpSdrPathDragData->bNextIsControl; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
// Ortho bei Linien/Polygonen = Winkel beibehalten
- if (!bControl && rDrag.GetView()!=NULL && rDrag.GetView()->IsOrtho()) {
- FASTBOOL bBigOrtho=rDrag.GetView()->IsBigOrtho();
- Point aPos(rDrag.GetNow()); // die aktuelle Position
+ if(!bControl && rDrag.GetSdrViewFromSdrDragStat().IsOrthogonal())
+ {
+ bool bBigOrtho(rDrag.GetSdrViewFromSdrDragStat().IsBigOrthogonal());
+ Point aPos(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY())); // die aktuelle Position
Point aPnt(mpSdrPathDragData->aXP[nPnt]); // der gedraggte Punkt
sal_uInt16 nPnt1=0xFFFF,nPnt2=0xFFFF; // seine Nachbarpunkte
Point aNeuPos1,aNeuPos2; // die neuen Alternativen fuer aPos
- FASTBOOL bPnt1=sal_False,bPnt2=sal_False; // die neuen Alternativen gueltig?
- if (!bClosed && mpSdrPathDragData->nPntAnz>=2) { // Mind. 2 Pt bei Linien
+ bool bPnt1=false,bPnt2=false; // die neuen Alternativen gueltig?
+
+ if (!bClosed && mpSdrPathDragData->nPntAnz>=2)
+ {
+ // Mind. 2 Pt bei Linien
if (!bBegPnt) nPnt1=nPrevPnt;
if (!bEndPnt) nPnt2=nNextPnt;
}
- if (bClosed && mpSdrPathDragData->nPntAnz>=3) { // Mind. 3 Pt bei Polygon
+
+ if (bClosed && mpSdrPathDragData->nPntAnz>=3)
+ {
+ // Mind. 3 Pt bei Polygon
nPnt1=nPrevPnt;
nPnt2=nNextPnt;
}
- if (nPnt1!=0xFFFF && !bPrevIsControl) {
+
+ if (nPnt1!=0xFFFF && !bPrevIsControl)
+ {
Point aPnt1=mpSdrPathDragData->aXP[nPnt1];
long ndx0=aPnt.X()-aPnt1.X();
long ndy0=aPnt.Y()-aPnt1.Y();
- FASTBOOL bHLin=ndy0==0;
- FASTBOOL bVLin=ndx0==0;
+ bool bHLin=ndy0==0;
+ bool bVLin=ndx0==0;
if (!bHLin || !bVLin) {
long ndx=aPos.X()-aPnt1.X();
long ndy=aPos.Y()-aPnt1.Y();
- bPnt1=sal_True;
+ bPnt1=true;
double nXFact=0; if (!bVLin) nXFact=(double)ndx/(double)ndx0;
double nYFact=0; if (!bHLin) nYFact=(double)ndy/(double)ndy0;
- FASTBOOL bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
- FASTBOOL bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
+ bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
+ bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
if (bHor) ndy=long(ndy0*nXFact);
if (bVer) ndx=long(ndx0*nYFact);
aNeuPos1=aPnt1;
@@ -718,20 +600,22 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
aNeuPos1.Y()+=ndy;
}
}
- if (nPnt2!=0xFFFF && !bNextIsControl) {
+
+ if (nPnt2!=0xFFFF && !bNextIsControl)
+ {
Point aPnt2=mpSdrPathDragData->aXP[nPnt2];
long ndx0=aPnt.X()-aPnt2.X();
long ndy0=aPnt.Y()-aPnt2.Y();
- FASTBOOL bHLin=ndy0==0;
- FASTBOOL bVLin=ndx0==0;
+ bool bHLin=ndy0==0;
+ bool bVLin=ndx0==0;
if (!bHLin || !bVLin) {
long ndx=aPos.X()-aPnt2.X();
long ndy=aPos.Y()-aPnt2.Y();
- bPnt2=sal_True;
+ bPnt2=true;
double nXFact=0; if (!bVLin) nXFact=(double)ndx/(double)ndx0;
double nYFact=0; if (!bHLin) nYFact=(double)ndy/(double)ndy0;
- FASTBOOL bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
- FASTBOOL bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
+ bool bHor=bHLin || (!bVLin && (nXFact>nYFact) ==bBigOrtho);
+ bool bVer=bVLin || (!bHLin && (nXFact<=nYFact)==bBigOrtho);
if (bHor) ndy=long(ndy0*nXFact);
if (bVer) ndx=long(ndx0*nYFact);
aNeuPos2=aPnt2;
@@ -739,7 +623,10 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
aNeuPos2.Y()+=ndy;
}
}
- if (bPnt1 && bPnt2) { // beide Alternativen vorhanden (Konkurenz)
+
+ if (bPnt1 && bPnt2)
+ {
+ // beide Alternativen vorhanden (Konkurenz)
BigInt nX1(aNeuPos1.X()-aPos.X()); nX1*=nX1;
BigInt nY1(aNeuPos1.Y()-aPos.Y()); nY1*=nY1;
BigInt nX2(aNeuPos2.X()-aPos.X()); nX2*=nX2;
@@ -747,37 +634,45 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
nX1+=nY1; // Korrekturabstand zum Quadrat
nX2+=nY2; // Korrekturabstand zum Quadrat
// Die Alternative mit dem geringeren Korrekturbedarf gewinnt
- if (nX1<nX2) bPnt2=sal_False; else bPnt1=sal_False;
+ if (nX1<nX2) bPnt2=false; else bPnt1=false;
}
- if (bPnt1) rDrag.Now()=aNeuPos1;
- if (bPnt2) rDrag.Now()=aNeuPos2;
+
+ if (bPnt1)
+ rDrag.SetNow(basegfx::B2DPoint(aNeuPos1.X(), aNeuPos1.Y()));
+
+ if (bPnt2)
+ rDrag.SetNow(basegfx::B2DPoint(aNeuPos2.X(), aNeuPos2.Y()));
}
- rDrag.SetActionRect(Rectangle(rDrag.GetNow(),rDrag.GetNow()));
+
+ rDrag.SetActionRange(basegfx::B2DRange(rDrag.GetNow()));
// IBM Special: Punkte eliminieren, wenn die beiden angrenzenden
// Linien eh' fast 180 deg sind.
- if (!bControl && rDrag.GetView()!=NULL && rDrag.GetView()->IsEliminatePolyPoints() &&
+ const Point aOldDragNow(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
+
+ if (!bControl && rDrag.GetSdrViewFromSdrDragStat().IsEliminatePolyPoints() &&
!bBegPnt && !bEndPnt && !bPrevIsControl && !bNextIsControl)
{
Point aPt(mpSdrPathDragData->aXP[nNextPnt]);
- aPt-=rDrag.GetNow();
+ aPt -= aOldDragNow;
long nWink1=GetAngle(aPt);
- aPt=rDrag.GetNow();
+ aPt = aOldDragNow;
aPt-=mpSdrPathDragData->aXP[nPrevPnt];
long nWink2=GetAngle(aPt);
long nDiff=nWink1-nWink2;
nDiff=Abs(nDiff);
- mpSdrPathDragData->bEliminate=nDiff<=rDrag.GetView()->GetEliminatePolyPointLimitAngle();
+ mpSdrPathDragData->bEliminate=nDiff <= rDrag.GetSdrViewFromSdrDragStat().GetEliminatePolyPointLimitAngle();
if (mpSdrPathDragData->bEliminate) { // Position anpassen, damit Smooth an den Enden stimmt
aPt=mpSdrPathDragData->aXP[nNextPnt];
aPt+=mpSdrPathDragData->aXP[nPrevPnt];
aPt/=2;
- rDrag.Now()=aPt;
+ rDrag.SetNow(basegfx::B2DPoint(aPt.X(), aPt.Y()));
}
}
// Um diese Entfernung wurde insgesamt gedraggd
- Point aDiff(rDrag.GetNow()); aDiff-=mpSdrPathDragData->aXP[nPnt];
+ Point aDiff(aOldDragNow);
+ aDiff-=mpSdrPathDragData->aXP[nPnt];
// Insgesamt sind 8 Faelle moeglich:
// X 1. Weder rechts noch links Ctrl.
@@ -795,44 +690,71 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
mpSdrPathDragData->aXP[nPnt]+=aDiff;
// Nun symmetrische PlusHandles etc. checken
- if (bControl) { // Faelle 5,6,7,8
+ if (bControl)
+ {
+ // Faelle 5,6,7,8
sal_uInt16 nSt=nPnt; // der zugehoerige Stuetzpunkt
sal_uInt16 nFix=nPnt; // der gegenueberliegende Kontrollpunkt
- if (bIsNextControl) { // Wenn der naechste ein Kontrollpunkt ist, muss der vorh. der Stuetzpunkt sein
+
+ if (bIsNextControl)
+ {
+ // Wenn der naechste ein Kontrollpunkt ist, muss der vorh. der Stuetzpunkt sein
nSt=nPrevPnt;
nFix=nPrevPrevPnt;
- } else {
+ }
+ else
+ {
nSt=nNextPnt;
nFix=nNextNextPnt;
}
- if (mpSdrPathDragData->aXP.IsSmooth(nSt)) {
+
+ if (mpSdrPathDragData->aXP.IsSmooth(nSt))
+ {
mpSdrPathDragData->aXP.CalcSmoothJoin(nSt,nPnt,nFix);
}
}
- if (!bControl) { // Faelle 1,2,3,4 wobei bei 1 nix passiert und bei 3+4 unten noch mehr folgt
+ if (!bControl)
+ {
+ // Faelle 1,2,3,4 wobei bei 1 nix passiert und bei 3+4 unten noch mehr folgt
// die beiden Kontrollpunkte mit verschieben
- if (bPrevIsControl) mpSdrPathDragData->aXP[nPrevPnt]+=aDiff;
- if (bNextIsControl) mpSdrPathDragData->aXP[nNextPnt]+=aDiff;
+ if (bPrevIsControl)
+ mpSdrPathDragData->aXP[nPrevPnt]+=aDiff;
+
+ if (bNextIsControl)
+ mpSdrPathDragData->aXP[nNextPnt]+=aDiff;
+
// Kontrollpunkt ggf. an Gerade ausrichten
- if (mpSdrPathDragData->aXP.IsSmooth(nPnt)) {
- if (bPrevIsControl && !bNextIsControl && !bEndPnt) { // Fall 3
+ if (mpSdrPathDragData->aXP.IsSmooth(nPnt))
+ {
+ if (bPrevIsControl && !bNextIsControl && !bEndPnt)
+ {
+ // Fall 3
mpSdrPathDragData->aXP.CalcSmoothJoin(nPnt,nNextPnt,nPrevPnt);
}
- if (bNextIsControl && !bPrevIsControl && !bBegPnt) { // Fall 4
+
+ if (bNextIsControl && !bPrevIsControl && !bBegPnt)
+ {
+ // Fall 4
mpSdrPathDragData->aXP.CalcSmoothJoin(nPnt,nPrevPnt,nNextPnt);
}
}
+
// Und nun noch die anderen Enden der Strecken ueberpruefen (nPnt+-1).
// Ist dort eine Kurve (IsControl(nPnt+-2)) mit SmoothJoin (nPnt+-1),
// so muss der entsprechende Kontrollpunkt (nPnt+-2) angepasst werden.
- if (!bBegPnt && !bPrevIsControl && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsSmooth(nPrevPnt)) {
- if (mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) {
+ if (!bBegPnt && !bPrevIsControl && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsSmooth(nPrevPnt))
+ {
+ if (mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt))
+ {
mpSdrPathDragData->aXP.CalcSmoothJoin(nPrevPnt,nPnt,nPrevPrevPnt);
}
}
- if (!bEndPnt && !bNextIsControl && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsSmooth(nNextPnt)) {
- if (mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) {
+
+ if (!bEndPnt && !bNextIsControl && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsSmooth(nNextPnt))
+ {
+ if (mpSdrPathDragData->aXP.IsControl(nNextNextPnt))
+ {
mpSdrPathDragData->aXP.CalcSmoothJoin(nNextPnt,nPnt,nNextNextPnt);
}
}
@@ -844,15 +766,6 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const
bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag)
{
- Point aLinePt1;
- Point aLinePt2;
- bool bLineGlueMirror(OBJ_LINE == meObjectKind);
- if (bLineGlueMirror) { // #40549#
- XPolygon& rXP=aPathPolygon[0];
- aLinePt1=rXP[0];
- aLinePt2=rXP[1];
- }
-
if(!mpSdrPathDragData || !mpSdrPathDragData->bValid)
{
DBG_ERROR("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData ist ungueltig");
@@ -865,7 +778,7 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag)
}
else
{
- const SdrHdl* pHdl=rDrag.GetHdl();
+ const SdrHdl* pHdl=rDrag.GetActiveHdl();
// Referenz auf das Polygon
XPolygon& rXP=aPathPolygon[(sal_uInt16)pHdl->GetPolyNum()];
@@ -885,12 +798,12 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag)
basegfx::B2DPolyPolygon aTempPolyPolygon(aPathPolygon.getB2DPolyPolygon());
sal_uInt32 nPoly,nPnt;
- if(PolyPolygonEditor::GetRelativePolyPoint(aTempPolyPolygon, rDrag.GetHdl()->GetSourceHdlNum(), nPoly, nPnt))
+ if(PolyPolygonEditor::GetRelativePolyPoint(aTempPolyPolygon, rDrag.GetActiveHdl()->GetSourceHdlNum(), nPoly, nPnt))
{
basegfx::B2DPolygon aCandidate(aTempPolyPolygon.getB2DPolygon(nPoly));
aCandidate.remove(nPnt);
- if((IsClosed(meObjectKind) && aCandidate.count() < 3L) || aCandidate.count() < 2L)
+ if((isClosed() && aCandidate.count() < 3L) || aCandidate.count() < 2L)
{
aTempPolyPolygon.remove(nPoly);
}
@@ -902,28 +815,6 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag)
aPathPolygon = XPolyPolygon(aTempPolyPolygon);
}
-
- // Winkel anpassen fuer Text an einfacher Linie
- if (bLineGlueMirror)
- { // #40549#
- Point aLinePt1_(aPathPolygon[0][0]);
- Point aLinePt2_(aPathPolygon[0][1]);
- FASTBOOL bXMirr=(aLinePt1_.X()>aLinePt2_.X())!=(aLinePt1.X()>aLinePt2.X());
- FASTBOOL bYMirr=(aLinePt1_.Y()>aLinePt2_.Y())!=(aLinePt1.Y()>aLinePt2.Y());
- if (bXMirr || bYMirr) {
- Point aRef1(mrSdrPathObject.GetSnapRect().Center());
- if (bXMirr) {
- Point aRef2(aRef1);
- aRef2.Y()++;
- mrSdrPathObject.NbcMirrorGluePoints(aRef1,aRef2);
- }
- if (bYMirr) {
- Point aRef2(aRef1);
- aRef2.X()++;
- mrSdrPathObject.NbcMirrorGluePoints(aRef1,aRef2);
- }
- }
- }
}
delete mpSdrPathDragData;
@@ -932,32 +823,20 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag)
return true;
}
-/*void ImpPathForDragAndCreate::cancelSpecialDrag( SdrDragStat& rDrag ) const
-{
- ImpSdrPathDragData* pID=(ImpSdrPathDragData*)rDrag.GetUser();
- if (pID!=NULL) {
- delete pID;
- rDrag.SetUser(NULL);
- }
-}*/
-
String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag) const
{
XubString aStr;
- const SdrHdl* pHdl = rDrag.GetHdl();
- const bool bCreateComment(rDrag.GetView() && &mrSdrPathObject == rDrag.GetView()->GetCreateObj());
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
+ const bool bCreateComment(&mrSdrPathObject == rDrag.GetSdrViewFromSdrDragStat().GetCreateObj());
if(bCreateComment && rDrag.GetUser())
{
// #i103058# re-add old creation comment mode
ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser();
- const SdrObjKind eKindMerk(meObjectKind);
- mrSdrPathObject.meKind = pU->eAktKind;
- mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewCreateObj, aStr);
- mrSdrPathObject.meKind = eKindMerk;
+ mrSdrPathObject.TakeMarkedDescriptionString(STR_ViewCreateObj, aStr);
- Point aPrev(rDrag.GetPrev());
- Point aNow(rDrag.GetNow());
+ Point aPrev(basegfx::fround(rDrag.GetPrev().getX()), basegfx::fround(rDrag.GetPrev().getY()));
+ Point aNow(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
if(pU->bLine)
aNow = pU->aLineEnd;
@@ -967,43 +846,34 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
XubString aMetr;
- if(pU->bCircle)
- {
- mrSdrPathObject.GetModel()->TakeWinkStr(Abs(pU->nCircRelWink), aMetr);
- aStr += aMetr;
- aStr.AppendAscii(" r=");
- mrSdrPathObject.GetModel()->TakeMetricStr(pU->nCircRadius, aMetr, sal_True);
- aStr += aMetr;
- }
-
aStr.AppendAscii("dx=");
- mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X(), aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(aNow.X(), aMetr, true);
aStr += aMetr;
aStr.AppendAscii(" dy=");
- mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y(), aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(aNow.Y(), aMetr, true);
aStr += aMetr;
- if(!IsFreeHand(meObjectKind))
+ if(!isFreeHand())
{
sal_Int32 nLen(GetLen(aNow));
aStr.AppendAscii(" l=");
- mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(nLen, aMetr, true);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aNow));
aStr += sal_Unicode(' ');
- mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeWinkStr(nWink, aMetr);
aStr += aMetr;
}
aStr += sal_Unicode(')');
}
- else if(!mrSdrPathObject.GetModel() || !pHdl)
+ else if(!pHdl)
{
// #i103058# fallback when no model and/or Handle, both needed
// for else-path
- mrSdrPathObject.ImpTakeDescriptionStr(STR_DragPathObj, aStr);
+ mrSdrPathObject.TakeMarkedDescriptionString(STR_DragPathObj, aStr);
}
else
{
@@ -1026,7 +896,7 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate)
{
// Punkt von ...
- mrSdrPathObject.ImpTakeDescriptionStr(STR_ViewMarkedPoint, aStr);
+ mrSdrPathObject.TakeMarkedDescriptionString(STR_ViewMarkedPoint, aStr);
// %O loeschen
XubString aStr2(ImpGetResStr(STR_EditDelete));
@@ -1041,24 +911,24 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
// dx=0.00 dy=0.00 l=0.00 0.00ø // Anfang oder Ende oder eine Seite Bezier bzw. Hebel
// dx=0.00 dy=0.00 l=0.00 0.00ø / l=0.00 0.00ø // Mittendrin
XubString aMetr;
- Point aBeg(rDrag.GetStart());
- Point aNow(rDrag.GetNow());
+ Point aBeg(basegfx::fround(rDrag.GetStart().getX()), basegfx::fround(rDrag.GetStart().getY()));
+ Point aNow(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
aStr = String();
aStr.AppendAscii("dx=");
- mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X() - aBeg.X(), aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(aNow.X() - aBeg.X(), aMetr, true);
aStr += aMetr;
aStr.AppendAscii(" dy=");
- mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y() - aBeg.Y(), aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(aNow.Y() - aBeg.Y(), aMetr, true);
aStr += aMetr;
if(!pDragData->IsMultiPointDrag())
{
sal_uInt16 nPntNum((sal_uInt16)pHdl->GetPointNum());
- const XPolygon& rXPoly = aPathPolygon[(sal_uInt16)rDrag.GetHdl()->GetPolyNum()];
+ const XPolygon& rXPoly = aPathPolygon[(sal_uInt16)rDrag.GetActiveHdl()->GetPolyNum()];
sal_uInt16 nPntAnz((sal_uInt16)rXPoly.GetPointCount());
- sal_Bool bClose(IsClosed(meObjectKind));
+ bool bClose(isClosed());
if(bClose)
nPntAnz--;
@@ -1077,26 +947,26 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
sal_Int32 nLen(GetLen(aNow));
aStr.AppendAscii(" l=");
- mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(nLen, aMetr, true);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aNow));
aStr += sal_Unicode(' ');
- mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeWinkStr(nWink, aMetr);
aStr += aMetr;
}
else if(nPntAnz > 1)
{
sal_uInt16 nPntMax(nPntAnz - 1);
Point aPt1,aPt2;
- sal_Bool bIsClosed(IsClosed(meObjectKind));
- sal_Bool bPt1(nPntNum > 0);
- sal_Bool bPt2(nPntNum < nPntMax);
+ bool bIsClosed(isClosed());
+ bool bPt1(nPntNum > 0);
+ bool bPt2(nPntNum < nPntMax);
if(bIsClosed && nPntAnz > 2)
{
- bPt1 = sal_True;
- bPt2 = sal_True;
+ bPt1 = true;
+ bPt2 = true;
}
sal_uInt16 nPt1,nPt2;
@@ -1112,10 +982,10 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
nPt2 = 0;
if(bPt1 && rXPoly.IsControl(nPt1))
- bPt1 = sal_False; // Keine Anzeige
+ bPt1 = false; // Keine Anzeige
if(bPt2 && rXPoly.IsControl(nPt2))
- bPt2 = sal_False; // von Bezierdaten
+ bPt2 = false; // von Bezierdaten
if(bPt1)
{
@@ -1124,12 +994,12 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
sal_Int32 nLen(GetLen(aPt));
aStr.AppendAscii(" l=");
- mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(nLen, aMetr, true);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aPt));
aStr += sal_Unicode(' ');
- mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeWinkStr(nWink, aMetr);
aStr += aMetr;
}
@@ -1145,12 +1015,12 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
sal_Int32 nLen(GetLen(aPt));
aStr.AppendAscii("l=");
- mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeMetricStr(nLen, aMetr, true);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aPt));
aStr += sal_Unicode(' ');
- mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
+ mrSdrPathObject.getSdrModelFromSdrObject().TakeWinkStr(nWink, aMetr);
aStr += aMetr;
}
}
@@ -1176,42 +1046,49 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra
}
else
{
- const XPolygon& rXP=aPathPolygon[(sal_uInt16)rDrag.GetHdl()->GetPolyNum()];
+ const XPolygon& rXP=aPathPolygon[(sal_uInt16)rDrag.GetActiveHdl()->GetPolyNum()];
if (rXP.GetPointCount()<=2) { //|| rXPoly.GetFlags(1)==XPOLY_CONTROL && rXPoly.GetPointCount()<=4
XPolygon aXPoly(rXP);
- aXPoly[(sal_uInt16)rDrag.GetHdl()->GetPointNum()]=rDrag.GetNow();
+ aXPoly[(sal_uInt16)rDrag.GetActiveHdl()->GetPointNum()]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
aRetval.Insert(aXPoly);
return aRetval.getB2DPolyPolygon();
}
+
// Div. Daten lokal Kopieren fuer weniger Code und schnelleren Zugriff
- FASTBOOL bClosed =mpSdrPathDragData->bClosed ; // geschlossenes Objekt?
+ bool bClosed =mpSdrPathDragData->bClosed ; // geschlossenes Objekt?
sal_uInt16 nPntAnz =mpSdrPathDragData->nPntAnz ; // Punktanzahl
sal_uInt16 nPnt =mpSdrPathDragData->nPnt ; // Punktnummer innerhalb des Polygons
- FASTBOOL bBegPnt =mpSdrPathDragData->bBegPnt ; // Gedraggter Punkt ist der Anfangspunkt einer Polyline
- FASTBOOL bEndPnt =mpSdrPathDragData->bEndPnt ; // Gedraggter Punkt ist der Endpunkt einer Polyline
+ bool bBegPnt =mpSdrPathDragData->bBegPnt ; // Gedraggter Punkt ist der Anfangspunkt einer Polyline
+ bool bEndPnt =mpSdrPathDragData->bEndPnt ; // Gedraggter Punkt ist der Endpunkt einer Polyline
sal_uInt16 nPrevPnt =mpSdrPathDragData->nPrevPnt ; // Index des vorherigen Punkts
sal_uInt16 nNextPnt =mpSdrPathDragData->nNextPnt ; // Index des naechsten Punkts
- FASTBOOL bPrevIsBegPnt =mpSdrPathDragData->bPrevIsBegPnt ; // Vorheriger Punkt ist Anfangspunkt einer Polyline
- FASTBOOL bNextIsEndPnt =mpSdrPathDragData->bNextIsEndPnt ; // Folgepunkt ist Endpunkt einer Polyline
+ bool bPrevIsBegPnt =mpSdrPathDragData->bPrevIsBegPnt ; // Vorheriger Punkt ist Anfangspunkt einer Polyline
+ bool bNextIsEndPnt =mpSdrPathDragData->bNextIsEndPnt ; // Folgepunkt ist Endpunkt einer Polyline
sal_uInt16 nPrevPrevPnt =mpSdrPathDragData->nPrevPrevPnt ; // Index des vorvorherigen Punkts
sal_uInt16 nNextNextPnt =mpSdrPathDragData->nNextNextPnt ; // Index des uebernaechsten Punkts
- FASTBOOL bControl =mpSdrPathDragData->bControl ; // Punkt ist ein Kontrollpunkt
- //int bIsPrevControl=mpSdrPathDragData->bIsPrevControl; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
- FASTBOOL bIsNextControl=mpSdrPathDragData->bIsNextControl; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
- FASTBOOL bPrevIsControl=mpSdrPathDragData->bPrevIsControl; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
- FASTBOOL bNextIsControl=mpSdrPathDragData->bNextIsControl; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
+ bool bControl =mpSdrPathDragData->bControl ; // Punkt ist ein Kontrollpunkt
+ //bool bIsPrevControl=mpSdrPathDragData->bIsPrevControl; // Punkt ist Kontrollpunkt vor einem Stuetzpunkt
+ bool bIsNextControl=mpSdrPathDragData->bIsNextControl; // Punkt ist Kontrollpunkt hinter einem Stuetzpunkt
+ bool bPrevIsControl=mpSdrPathDragData->bPrevIsControl; // Falls nPnt ein StPnt: Davor ist ein Kontrollpunkt
+ bool bNextIsControl=mpSdrPathDragData->bNextIsControl; // Falls nPnt ein StPnt: Dahinter ist ein Kontrollpunkt
XPolygon aXPoly(mpSdrPathDragData->aXP);
XPolygon aLine1(2);
XPolygon aLine2(2);
XPolygon aLine3(2);
XPolygon aLine4(2);
- if (bControl) {
+
+ if (bControl)
+ {
aLine1[1]=mpSdrPathDragData->aXP[nPnt];
- if (bIsNextControl) { // bin ich Kontrollpunkt hinter der Stuetzstelle?
+ if (bIsNextControl)
+ {
+ // bin ich Kontrollpunkt hinter der Stuetzstelle?
aLine1[0]=mpSdrPathDragData->aXP[nPrevPnt];
aLine2[0]=mpSdrPathDragData->aXP[nNextNextPnt];
aLine2[1]=mpSdrPathDragData->aXP[nNextPnt];
- if (mpSdrPathDragData->aXP.IsSmooth(nPrevPnt) && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) {
+
+ if (mpSdrPathDragData->aXP.IsSmooth(nPrevPnt) && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt))
+ {
aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_CONTROL);
aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPOLY_NORMAL);
// Hebellienien fuer das gegenueberliegende Kurvensegment
@@ -1219,14 +1096,21 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra
aLine3[1]=mpSdrPathDragData->aXP[nPrevPrevPnt];
aLine4[0]=rXP[mpSdrPathDragData->nPrevPrevPnt0-2];
aLine4[1]=rXP[mpSdrPathDragData->nPrevPrevPnt0-1];
- } else {
+ }
+ else
+ {
aXPoly.Remove(0,1);
}
- } else { // ansonsten bin ich Kontrollpunkt vor der Stuetzstelle
+ }
+ else
+ {
+ // ansonsten bin ich Kontrollpunkt vor der Stuetzstelle
aLine1[0]=mpSdrPathDragData->aXP[nNextPnt];
aLine2[0]=mpSdrPathDragData->aXP[nPrevPrevPnt];
aLine2[1]=mpSdrPathDragData->aXP[nPrevPnt];
- if (mpSdrPathDragData->aXP.IsSmooth(nNextPnt) && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) {
+
+ if (mpSdrPathDragData->aXP.IsSmooth(nNextPnt) && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt))
+ {
aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_CONTROL);
aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPOLY_NORMAL);
// Hebellinien fuer das gegenueberliegende Kurvensegment
@@ -1234,32 +1118,52 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra
aLine3[1]=mpSdrPathDragData->aXP[nNextNextPnt];
aLine4[0]=rXP[mpSdrPathDragData->nNextNextPnt0+2];
aLine4[1]=rXP[mpSdrPathDragData->nNextNextPnt0+1];
- } else {
+ }
+ else
+ {
aXPoly.Remove(aXPoly.GetPointCount()-1,1);
}
}
- } else { // ansonsten kein Kontrollpunkt
- if (mpSdrPathDragData->bEliminate) {
+ }
+ else
+ {
+ // ansonsten kein Kontrollpunkt
+ if (mpSdrPathDragData->bEliminate)
+ {
aXPoly.Remove(2,1);
}
- if (bPrevIsControl) aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_NORMAL);
- else if (!bBegPnt && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt)) {
+
+ if (bPrevIsControl)
+ aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_NORMAL);
+ else if (!bBegPnt && !bPrevIsBegPnt && mpSdrPathDragData->aXP.IsControl(nPrevPrevPnt))
+ {
aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-1],XPOLY_CONTROL);
aXPoly.Insert(0,rXP[mpSdrPathDragData->nPrevPrevPnt0-2],XPOLY_NORMAL);
- } else {
+ }
+ else
+ {
aXPoly.Remove(0,1);
if (bBegPnt) aXPoly.Remove(0,1);
}
- if (bNextIsControl) aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_NORMAL);
- else if (!bEndPnt && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt)) {
+
+ if (bNextIsControl)
+ aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_NORMAL);
+ else if (!bEndPnt && !bNextIsEndPnt && mpSdrPathDragData->aXP.IsControl(nNextNextPnt))
+ {
aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+1],XPOLY_CONTROL);
aXPoly.Insert(XPOLY_APPEND,rXP[mpSdrPathDragData->nNextNextPnt0+2],XPOLY_NORMAL);
- } else {
+ }
+ else
+ {
aXPoly.Remove(aXPoly.GetPointCount()-1,1);
if (bEndPnt) aXPoly.Remove(aXPoly.GetPointCount()-1,1);
}
- if (bClosed) { // "Birnenproblem": 2 Linien, 1 Kurve, alles Smooth, Punkt zw. beiden Linien wird gedraggt
- if (aXPoly.GetPointCount()>nPntAnz && aXPoly.IsControl(1)) {
+
+ if (bClosed)
+ {
+ // "Birnenproblem": 2 Linien, 1 Kurve, alles Smooth, Punkt zw. beiden Linien wird gedraggt
+ if (aXPoly.GetPointCount()>nPntAnz && aXPoly.IsControl(1))
+ {
sal_uInt16 a=aXPoly.GetPointCount();
aXPoly[a-2]=aXPoly[2]; aXPoly.SetFlags(a-2,aXPoly.GetFlags(2));
aXPoly[a-1]=aXPoly[3]; aXPoly.SetFlags(a-1,aXPoly.GetFlags(3));
@@ -1267,111 +1171,120 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::getSpecialDragPoly(const SdrDra
}
}
}
+
aRetval.Insert(aXPoly);
- if (aLine1.GetPointCount()>1) aRetval.Insert(aLine1);
- if (aLine2.GetPointCount()>1) aRetval.Insert(aLine2);
- if (aLine3.GetPointCount()>1) aRetval.Insert(aLine3);
- if (aLine4.GetPointCount()>1) aRetval.Insert(aLine4);
+
+ if (aLine1.GetPointCount()>1)
+ aRetval.Insert(aLine1);
+
+ if (aLine2.GetPointCount()>1)
+ aRetval.Insert(aLine2);
+
+ if (aLine3.GetPointCount()>1)
+ aRetval.Insert(aLine3);
+
+ if (aLine4.GetPointCount()>1)
+ aRetval.Insert(aLine4);
}
return aRetval.getB2DPolyPolygon();
}
-FASTBOOL ImpPathForDragAndCreate::BegCreate(SdrDragStat& rStat)
+bool ImpPathForDragAndCreate::BegCreate(SdrDragStat& rDrag)
{
- bool bFreeHand(IsFreeHand(meObjectKind));
- rStat.SetNoSnap(bFreeHand);
- rStat.SetOrtho8Possible();
+ bool bFreeHand(isFreeHand());
+ rDrag.SetNoSnap(bFreeHand);
+ rDrag.SetOrtho8Possible();
aPathPolygon.Clear();
- mbCreating=sal_True;
- FASTBOOL bMakeStartPoint=sal_True;
- SdrView* pView=rStat.GetView();
- if (pView!=NULL && pView->IsUseIncompatiblePathCreateInterface() &&
- (meObjectKind==OBJ_POLY || meObjectKind==OBJ_PLIN || meObjectKind==OBJ_PATHLINE || meObjectKind==OBJ_PATHFILL)) {
- bMakeStartPoint=sal_False;
- }
+ mbCreating=true;
+ bool bMakeStartPoint=true;
aPathPolygon.Insert(XPolygon());
- aPathPolygon[0][0]=rStat.GetStart();
- if (bMakeStartPoint) {
- aPathPolygon[0][1]=rStat.GetNow();
+ aPathPolygon[0][0]=Point(basegfx::fround(rDrag.GetStart().getX()), basegfx::fround(rDrag.GetStart().getY()));
+
+ if (bMakeStartPoint)
+ {
+ aPathPolygon[0][1]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
}
- ImpPathCreateUser* pU=new ImpPathCreateUser;
- pU->eStartKind=meObjectKind;
- pU->eAktKind=meObjectKind;
- rStat.SetUser(pU);
- return sal_True;
+
+ ImpPathCreateUser* pU=new ImpPathCreateUser(mePathType, isFreeHand());
+ rDrag.SetUser(pU);
+
+ return true;
}
-FASTBOOL ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat)
+bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rDrag)
{
- ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser();
- SdrView* pView=rStat.GetView();
+ ImpPathCreateUser* pU=(ImpPathCreateUser*)rDrag.GetUser();
+ SdrView& rView = rDrag.GetSdrViewFromSdrDragStat();
XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1];
- if (pView!=NULL && pView->IsCreateMode()) {
- // ggf. auf anderes CreateTool umschalten
- sal_uInt16 nIdent;
- sal_uInt32 nInvent;
- pView->TakeCurrentObj(nIdent,nInvent);
- if (nInvent==SdrInventor && pU->eAktKind!=(SdrObjKind)nIdent) {
- SdrObjKind eNewKind=(SdrObjKind)nIdent;
- switch (eNewKind) {
- case OBJ_CARC: case OBJ_CIRC: case OBJ_CCUT: case OBJ_SECT: eNewKind=OBJ_CARC;
- case OBJ_RECT:
- case OBJ_LINE: case OBJ_PLIN: case OBJ_POLY:
- case OBJ_PATHLINE: case OBJ_PATHFILL:
- case OBJ_FREELINE: case OBJ_FREEFILL:
- case OBJ_SPLNLINE: case OBJ_SPLNFILL: {
- pU->eAktKind=eNewKind;
- pU->bMixedCreate=sal_True;
- pU->nBezierStartPoint=rXPoly.GetPointCount();
- if (pU->nBezierStartPoint>0) pU->nBezierStartPoint--;
- } break;
- default: break;
- } // switch
- }
- }
sal_uInt16 nActPoint=rXPoly.GetPointCount();
- if (aPathPolygon.Count()>1 && rStat.IsMouseDown() && nActPoint<2) {
- rXPoly[0]=rStat.GetPos0();
- rXPoly[1]=rStat.GetNow();
+
+ if (aPathPolygon.Count()>1 && rDrag.IsMouseDown() && nActPoint<2)
+ {
+ rXPoly[0]=Point(basegfx::fround(rDrag.GetPos0().getX()), basegfx::fround(rDrag.GetPos0().getY()));
+ rXPoly[1]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
nActPoint=2;
}
- if (nActPoint==0) {
- rXPoly[0]=rStat.GetPos0();
- } else nActPoint--;
- FASTBOOL bFreeHand=IsFreeHand(pU->eAktKind);
- rStat.SetNoSnap(bFreeHand /*|| (pU->bMixed && pU->eAktKind==OBJ_LINE)*/);
- rStat.SetOrtho8Possible(pU->eAktKind!=OBJ_CARC && pU->eAktKind!=OBJ_RECT && (!pU->bMixedCreate || pU->eAktKind!=OBJ_LINE));
+
+ if (nActPoint==0)
+ {
+ rXPoly[0]=Point(basegfx::fround(rDrag.GetPos0().getX()), basegfx::fround(rDrag.GetPos0().getY()));
+ }
+ else
+ nActPoint--;
+
+ bool bFreeHand = pU->IsCreateFreehand();
+ rDrag.SetNoSnap(bFreeHand /*|| (pU->bMixed && pU->eAktKind==OBJ_LINE)*/);
+ rDrag.SetOrtho8Possible(true);
Point aActMerk(rXPoly[nActPoint]);
- rXPoly[nActPoint]=rStat.Now();
- if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE && rXPoly.GetPointCount()>=1) {
- Point aPt(rStat.Start());
- if (pView!=NULL && pView->IsCreate1stPointAsCenter()) {
+ rXPoly[nActPoint]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
+
+ if (
+ isLine() && //PathType_Line == mePathType
+ rXPoly.GetPointCount()>=1)
+ {
+ Point aPt(basegfx::fround(rDrag.GetStart().getX()), basegfx::fround(rDrag.GetStart().getY()));
+
+ if (rView.IsCreate1stPointAsCenter())
+ {
aPt+=aPt;
- aPt-=rStat.Now();
+ aPt-=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
}
rXPoly[0]=aPt;
}
- OutputDevice* pOut=pView==NULL ? NULL : pView->GetFirstOutputDevice(); // GetWin(0);
- if (bFreeHand) {
- if (pU->nBezierStartPoint>nActPoint) pU->nBezierStartPoint=nActPoint;
- if (rStat.IsMouseDown() && nActPoint>0) {
+
+ OutputDevice* pOut = rView.GetFirstOutputDevice(); // GetWin(0);
+
+ if (bFreeHand)
+ {
+ if (pU->nBezierStartPoint>nActPoint)
+ pU->nBezierStartPoint=nActPoint;
+
+ if (rDrag.IsMouseDown() && nActPoint>0)
+ {
// keine aufeinanderfolgenden Punkte an zu Nahe gelegenen Positionen zulassen
long nMinDist=1;
- if (pView!=NULL) nMinDist=pView->GetFreeHandMinDistPix();
- if (pOut!=NULL) nMinDist=pOut->PixelToLogic(Size(nMinDist,0)).Width();
- if (nMinDist<1) nMinDist=1;
+ nMinDist = rView.GetFreeHandMinDistPix();
+
+ if (pOut!=NULL)
+ nMinDist=pOut->PixelToLogic(Size(nMinDist,0)).Width();
+
+ if (nMinDist<1)
+ nMinDist=1;
Point aPt0(rXPoly[nActPoint-1]);
- Point aPt1(rStat.Now());
+ Point aPt1(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
long dx=aPt0.X()-aPt1.X(); if (dx<0) dx=-dx;
long dy=aPt0.Y()-aPt1.Y(); if (dy<0) dy=-dy;
- if (dx<nMinDist && dy<nMinDist) return sal_False;
+
+ if (dx<nMinDist && dy<nMinDist)
+ return false;
// folgendes ist aus EndCreate kopiert (nur kleine Modifikationen)
// und sollte dann mal in eine Methode zusammengefasst werden:
- if (nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0) {
+ if (nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0)
+ {
rXPoly.PointsToBezier(nActPoint-3);
rXPoly.SetFlags(nActPoint-1,XPOLY_CONTROL);
rXPoly.SetFlags(nActPoint-2,XPOLY_CONTROL);
@@ -1381,207 +1294,246 @@ FASTBOOL ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat)
rXPoly.SetFlags(nActPoint-3,XPOLY_SMOOTH);
}
}
- rXPoly[nActPoint+1]=rStat.Now();
- rStat.NextPoint();
- } else {
+
+ rXPoly[nActPoint+1]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
+ rDrag.NextPoint();
+ }
+ else
+ {
pU->nBezierStartPoint=nActPoint;
}
}
pU->ResetFormFlags();
- if (IsBezier(pU->eAktKind)) {
- if (nActPoint>=2) {
- pU->CalcBezier(rXPoly[nActPoint-1],rXPoly[nActPoint],rXPoly[nActPoint-1]-rXPoly[nActPoint-2],rStat.IsMouseDown());
- } else if (pU->bBezHasCtrl0) {
- pU->CalcBezier(rXPoly[nActPoint-1],rXPoly[nActPoint],pU->aBezControl0-rXPoly[nActPoint-1],rStat.IsMouseDown());
+
+ if (pU->IsCreateBezier())
+ {
+ if (nActPoint>=2)
+ {
+ pU->CalcBezier(rXPoly[nActPoint-1],rXPoly[nActPoint],rXPoly[nActPoint-1]-rXPoly[nActPoint-2],rDrag.IsMouseDown());
+ }
+ else if (pU->bBezHasCtrl0)
+ {
+ pU->CalcBezier(rXPoly[nActPoint-1],rXPoly[nActPoint],pU->aBezControl0-rXPoly[nActPoint-1],rDrag.IsMouseDown());
}
}
- if (pU->eAktKind==OBJ_CARC && nActPoint>=2) {
- pU->CalcCircle(rXPoly[nActPoint-1],rXPoly[nActPoint],rXPoly[nActPoint-1]-rXPoly[nActPoint-2],pView);
- }
- if (pU->eAktKind==OBJ_LINE && nActPoint>=2) {
- pU->CalcLine(rXPoly[nActPoint-1],rXPoly[nActPoint],rXPoly[nActPoint-1]-rXPoly[nActPoint-2],pView);
- }
- if (pU->eAktKind==OBJ_RECT && nActPoint>=2) {
- pU->CalcRect(rXPoly[nActPoint-1],rXPoly[nActPoint],rXPoly[nActPoint-1]-rXPoly[nActPoint-2],pView);
+ if(pU->IsCreateLine() && nActPoint>=2)
+ {
+ pU->CalcLine(rXPoly[nActPoint-1],rXPoly[nActPoint],rXPoly[nActPoint-1]-rXPoly[nActPoint-2],&rView);
}
- return sal_True;
+ return true;
}
-FASTBOOL ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rDrag, SdrCreateCmd eCmd)
{
- ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser();
- FASTBOOL bRet=sal_False;
- SdrView* pView=rStat.GetView();
- FASTBOOL bIncomp=pView!=NULL && pView->IsUseIncompatiblePathCreateInterface();
+ ImpPathCreateUser* pU=(ImpPathCreateUser*)rDrag.GetUser();
+ bool bRet(false);
XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1];
sal_uInt16 nActPoint=rXPoly.GetPointCount()-1;
Point aAktMerk(rXPoly[nActPoint]);
- rXPoly[nActPoint]=rStat.Now();
- if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE) {
- if (rStat.GetPointAnz()>=2) eCmd=SDRCREATE_FORCEEND;
- bRet=eCmd==SDRCREATE_FORCEEND;
+ rXPoly[nActPoint]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
+
+ if ( isLine() ) //PathType_Line == mePathType )
+ {
+ if (rDrag.GetPointAnz()>=2) eCmd=SDRCREATE_FORCEEND;
+ bRet=(eCmd==SDRCREATE_FORCEEND);
if (bRet) {
- mbCreating=sal_False;
+ mbCreating=false;
delete pU;
- rStat.SetUser(NULL);
+ rDrag.SetUser(NULL);
}
+
return bRet;
}
- if (!pU->bMixedCreate && IsFreeHand(pU->eStartKind)) {
- if (rStat.GetPointAnz()>=2) eCmd=SDRCREATE_FORCEEND;
- bRet=eCmd==SDRCREATE_FORCEEND;
+ if ( pU->IsCreateFreehand() )
+ {
+ if (rDrag.GetPointAnz()>=2) eCmd=SDRCREATE_FORCEEND;
+ bRet=(eCmd==SDRCREATE_FORCEEND);
if (bRet) {
- mbCreating=sal_False;
+ mbCreating=false;
delete pU;
- rStat.SetUser(NULL);
+ rDrag.SetUser(NULL);
}
+
return bRet;
}
- if (eCmd==SDRCREATE_NEXTPOINT || eCmd==SDRCREATE_NEXTOBJECT) {
+
+ if (eCmd==SDRCREATE_NEXTPOINT || eCmd==SDRCREATE_NEXTOBJECT)
+ {
// keine aufeinanderfolgenden Punkte an identischer Position zulassen
- if (nActPoint==0 || rStat.Now()!=rXPoly[nActPoint-1]) {
- if (bIncomp) {
- if (pU->nBezierStartPoint>nActPoint) pU->nBezierStartPoint=nActPoint;
- if (IsBezier(pU->eAktKind) && nActPoint-pU->nBezierStartPoint>=3 && ((nActPoint-pU->nBezierStartPoint)%3)==0) {
- rXPoly.PointsToBezier(nActPoint-3);
- rXPoly.SetFlags(nActPoint-1,XPOLY_CONTROL);
- rXPoly.SetFlags(nActPoint-2,XPOLY_CONTROL);
-
- if (nActPoint>=6 && rXPoly.IsControl(nActPoint-4)) {
- rXPoly.CalcTangent(nActPoint-3,nActPoint-4,nActPoint-2);
- rXPoly.SetFlags(nActPoint-3,XPOLY_SMOOTH);
- }
- }
- } else {
- if (nActPoint==1 && IsBezier(pU->eAktKind) && !pU->bBezHasCtrl0) {
- pU->aBezControl0=rStat.GetNow();;
- pU->bBezHasCtrl0=sal_True;
- nActPoint--;
- }
- if (pU->IsFormFlag()) {
- sal_uInt16 nPtAnz0=rXPoly.GetPointCount();
- rXPoly.Remove(nActPoint-1,2); // die letzten beiden Punkte entfernen und durch die Form ersetzen
- rXPoly.Insert(XPOLY_APPEND,pU->GetFormPoly());
- sal_uInt16 nPtAnz1=rXPoly.GetPointCount();
- for (sal_uInt16 i=nPtAnz0+1; i<nPtAnz1-1; i++) { // Damit BckAction richtig funktioniert
- if (!rXPoly.IsControl(i)) rStat.NextPoint();
- }
- nActPoint=rXPoly.GetPointCount()-1;
+ if (nActPoint==0 || Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()))!=rXPoly[nActPoint-1])
+ {
+ if (nActPoint==1 && pU->IsCreateBezier() && !pU->bBezHasCtrl0)
+ {
+ pU->aBezControl0=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
+ pU->bBezHasCtrl0=true;
+ nActPoint--;
+ }
+
+ if (pU->IsFormFlag())
+ {
+ sal_uInt16 nPtAnz0=rXPoly.GetPointCount();
+ rXPoly.Remove(nActPoint-1,2); // die letzten beiden Punkte entfernen und durch die Form ersetzen
+ rXPoly.Insert(XPOLY_APPEND,pU->GetFormPoly());
+ sal_uInt16 nPtAnz1=rXPoly.GetPointCount();
+
+ for (sal_uInt16 i=nPtAnz0+1; i<nPtAnz1-1; i++)
+ {
+ // Damit BckAction richtig funktioniert
+ if (!rXPoly.IsControl(i)) rDrag.NextPoint();
}
+
+ nActPoint=rXPoly.GetPointCount()-1;
}
+
nActPoint++;
- rXPoly[nActPoint]=rStat.GetNow();
+ rXPoly[nActPoint]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
}
- if (eCmd==SDRCREATE_NEXTOBJECT) {
- if (rXPoly.GetPointCount()>=2) {
- pU->bBezHasCtrl0=sal_False;
+
+ if (eCmd==SDRCREATE_NEXTOBJECT)
+ {
+ if (rXPoly.GetPointCount()>=2)
+ {
+ pU->bBezHasCtrl0=false;
// nur einzelnes Polygon kann offen sein, deshalb schliessen
rXPoly[nActPoint]=rXPoly[0];
XPolygon aXP;
- aXP[0]=rStat.GetNow();
+ aXP[0]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
aPathPolygon.Insert(aXP);
}
}
}
sal_uInt16 nPolyAnz=aPathPolygon.Count();
- if (nPolyAnz!=0) {
+
+ if (nPolyAnz!=0)
+ {
// den letzten Punkt ggf. wieder loeschen
- if (eCmd==SDRCREATE_FORCEEND) {
+ if (eCmd==SDRCREATE_FORCEEND)
+ {
XPolygon& rXP=aPathPolygon[nPolyAnz-1];
sal_uInt16 nPtAnz=rXP.GetPointCount();
- if (nPtAnz>=2) {
- if (!rXP.IsControl(nPtAnz-2)) {
- if (rXP[nPtAnz-1]==rXP[nPtAnz-2]) {
+
+ if (nPtAnz>=2)
+ {
+ if (!rXP.IsControl(nPtAnz-2))
+ {
+ if (rXP[nPtAnz-1]==rXP[nPtAnz-2])
+ {
rXP.Remove(nPtAnz-1,1);
}
- } else {
- if (rXP[nPtAnz-3]==rXP[nPtAnz-2]) {
+ }
+ else
+ {
+ if (rXP[nPtAnz-3]==rXP[nPtAnz-2])
+ {
rXP.Remove(nPtAnz-3,3);
}
}
}
}
- for (sal_uInt16 nPolyNum=nPolyAnz; nPolyNum>0;) {
+
+ for (sal_uInt16 nPolyNum=nPolyAnz; nPolyNum>0;)
+ {
nPolyNum--;
XPolygon& rXP=aPathPolygon[nPolyNum];
sal_uInt16 nPtAnz=rXP.GetPointCount();
+
// Polygone mit zu wenig Punkten werden geloescht
- if (nPolyNum<nPolyAnz-1 || eCmd==SDRCREATE_FORCEEND) {
+ if (nPolyNum<nPolyAnz-1 || eCmd==SDRCREATE_FORCEEND)
+ {
if (nPtAnz<2) aPathPolygon.Remove(nPolyNum);
}
}
}
+
pU->ResetFormFlags();
- bRet=eCmd==SDRCREATE_FORCEEND;
- if (bRet) {
- mbCreating=sal_False;
+ bRet=(eCmd==SDRCREATE_FORCEEND);
+
+ if (bRet)
+ {
+ mbCreating=false;
delete pU;
- rStat.SetUser(NULL);
+ rDrag.SetUser(NULL);
}
+
return bRet;
}
-FASTBOOL ImpPathForDragAndCreate::BckCreate(SdrDragStat& rStat)
+bool ImpPathForDragAndCreate::BckCreate(SdrDragStat& rDrag)
{
- ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser();
- if (aPathPolygon.Count()>0) {
+ ImpPathCreateUser* pU=(ImpPathCreateUser*)rDrag.GetUser();
+
+ if (aPathPolygon.Count()>0)
+ {
XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1];
sal_uInt16 nActPoint=rXPoly.GetPointCount();
- if (nActPoint>0) {
+
+ if (nActPoint>0)
+ {
nActPoint--;
// Das letzte Stueck einer Bezierkurve wird erstmal zu 'ner Linie
rXPoly.Remove(nActPoint,1);
- if (nActPoint>=3 && rXPoly.IsControl(nActPoint-1)) {
+
+ if (nActPoint>=3 && rXPoly.IsControl(nActPoint-1))
+ {
// Beziersegment am Ende sollte zwar nicht vorkommen, aber falls doch ...
rXPoly.Remove(nActPoint-1,1);
if (rXPoly.IsControl(nActPoint-2)) rXPoly.Remove(nActPoint-2,1);
}
}
+
nActPoint=rXPoly.GetPointCount();
- if (nActPoint>=4) { // Kein Beziersegment am Ende
+
+ if (nActPoint>=4)
+ {
+ // Kein Beziersegment am Ende
nActPoint--;
- if (rXPoly.IsControl(nActPoint-1)) {
+
+ if (rXPoly.IsControl(nActPoint-1))
+ {
rXPoly.Remove(nActPoint-1,1);
if (rXPoly.IsControl(nActPoint-2)) rXPoly.Remove(nActPoint-2,1);
}
}
- if (rXPoly.GetPointCount()<2) {
+
+ if (rXPoly.GetPointCount()<2)
+ {
aPathPolygon.Remove(aPathPolygon.Count()-1);
}
- if (aPathPolygon.Count()>0) {
+
+ if (aPathPolygon.Count()>0)
+ {
XPolygon& rLocalXPoly=aPathPolygon[aPathPolygon.Count()-1];
sal_uInt16 nLocalActPoint=rLocalXPoly.GetPointCount();
- if (nLocalActPoint>0) {
+
+ if (nLocalActPoint>0)
+ {
nLocalActPoint--;
- rLocalXPoly[nLocalActPoint]=rStat.Now();
+ rLocalXPoly[nLocalActPoint]=Point(basegfx::fround(rDrag.GetNow().getX()), basegfx::fround(rDrag.GetNow().getY()));
}
}
}
+
pU->ResetFormFlags();
+
return aPathPolygon.Count()!=0;
}
-void ImpPathForDragAndCreate::BrkCreate(SdrDragStat& rStat)
+void ImpPathForDragAndCreate::BrkCreate(SdrDragStat& rDrag)
{
- ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser();
+ ImpPathCreateUser* pU=(ImpPathCreateUser*)rDrag.GetUser();
aPathPolygon.Clear();
- mbCreating=sal_False;
+ mbCreating=false;
delete pU;
- rStat.SetUser(NULL);
+ rDrag.SetUser(NULL);
}
basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeObjectPolyPolygon(const SdrDragStat& rDrag) const
{
basegfx::B2DPolyPolygon aRetval(aPathPolygon.getB2DPolyPolygon());
- SdrView* pView = rDrag.GetView();
-
- if(pView && pView->IsUseIncompatiblePathCreateInterface())
- return aRetval;
-
ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser();
basegfx::B2DPolygon aNewPolygon(aRetval.count() ? aRetval.getB2DPolygon(aRetval.count() - 1L) : basegfx::B2DPolygon());
@@ -1619,11 +1571,6 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeObjectPolyPolygon(const Sdr
basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeDragPolyPolygon(const SdrDragStat& rDrag) const
{
basegfx::B2DPolyPolygon aRetval;
- SdrView* pView = rDrag.GetView();
-
- if(pView && pView->IsUseIncompatiblePathCreateInterface())
- return aRetval;
-
ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser();
if(pU && pU->bBezier && rDrag.IsMouseDown())
@@ -1640,20 +1587,29 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeDragPolyPolygon(const SdrDr
Pointer ImpPathForDragAndCreate::GetCreatePointer() const
{
- switch (meObjectKind) {
- case OBJ_LINE : return Pointer(POINTER_DRAW_LINE);
- case OBJ_POLY : return Pointer(POINTER_DRAW_POLYGON);
- case OBJ_PLIN : return Pointer(POINTER_DRAW_POLYGON);
- case OBJ_PATHLINE: return Pointer(POINTER_DRAW_BEZIER);
- case OBJ_PATHFILL: return Pointer(POINTER_DRAW_BEZIER);
- case OBJ_FREELINE: return Pointer(POINTER_DRAW_FREEHAND);
- case OBJ_FREEFILL: return Pointer(POINTER_DRAW_FREEHAND);
- case OBJ_SPLNLINE: return Pointer(POINTER_DRAW_FREEHAND);
- case OBJ_SPLNFILL: return Pointer(POINTER_DRAW_FREEHAND);
- case OBJ_PATHPOLY: return Pointer(POINTER_DRAW_POLYGON);
- case OBJ_PATHPLIN: return Pointer(POINTER_DRAW_POLYGON);
- default: break;
- } // switch
+ if(isFreeHand())
+ {
+ return Pointer(POINTER_DRAW_FREEHAND);
+ }
+
+ switch(mePathType)
+ {
+ case PathType_Line:
+ {
+ return Pointer(POINTER_DRAW_LINE);
+ }
+ case PathType_OpenPolygon:
+ case PathType_ClosedPolygon:
+ {
+ return Pointer(POINTER_DRAW_POLYGON);
+ }
+ case PathType_OpenBezier:
+ case PathType_ClosedBezier:
+ {
+ return Pointer(POINTER_DRAW_BEZIER);
+ }
+ }
+
return Pointer(POINTER_CROSS);
}
@@ -1670,150 +1626,165 @@ SdrPathObjGeoData::~SdrPathObjGeoData()
//////////////////////////////////////////////////////////////////////////////
// DrawContact section
-sdr::contact::ViewContact* SdrPathObj::CreateObjectSpecificViewContact()
+void SdrPathObj::impAdaptTransformation()
{
- return new sdr::contact::ViewContactOfSdrPathObj(*this);
-}
+ basegfx::B2DHomMatrix aHelpMatrix;
-/*************************************************************************/
+ if(maPathPolygon.count())
+ {
+ if(isLine())
+ {
+ // create unit transformation so that (0,0) is 1st point and (1,0) is 2nd point
+ const basegfx::B2DPoint aPointA(maPathPolygon.getB2DPolygon(0).getB2DPoint(0));
+ const basegfx::B2DPoint aPointB(maPathPolygon.getB2DPolygon(0).getB2DPoint(1));
+ const basegfx::B2DVector aDelta(aPointB - aPointA);
-TYPEINIT1(SdrPathObj,SdrTextObj);
+ aHelpMatrix = basegfx::tools::createScaleRotateTranslateB2DHomMatrix(
+ basegfx::B2DTuple(aDelta.getLength(), 0.0),
+ atan2(aDelta.getY(), aDelta.getX()),
+ aPointA);
+ }
+ else
+ {
+ // get range
+ basegfx::B2DRange aRange(maPathPolygon.getB2DRange());
-SdrPathObj::SdrPathObj(SdrObjKind eNewKind)
-: meKind(eNewKind),
- mpDAC(0L)
-{
- bClosedObj = IsClosed();
-}
+ if(!aRange.isEmpty())
+ {
+ // break up current transformation
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate, fShearX;
+ getSdrObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // to keep mirrorX, mirrorY, rotation and shear, create a transformation
+ // containing those values
+ if(basegfx::fTools::less(aScale.getX(), 0.0))
+ {
+ aHelpMatrix.scale(-1.0, 1.0);
+ aScale.setX(-1.0);
+ }
-SdrPathObj::SdrPathObj(SdrObjKind eNewKind, const basegfx::B2DPolyPolygon& rPathPoly)
-: maPathPolygon(rPathPoly),
- meKind(eNewKind),
- mpDAC(0L)
-{
- bClosedObj = IsClosed();
- ImpForceKind();
-}
+ if(basegfx::fTools::less(aScale.getY(), 0.0))
+ {
+ aHelpMatrix.scale(1.0, -1.0);
+ aScale.setY(-1.0);
+ }
-SdrPathObj::~SdrPathObj()
-{
- impDeleteDAC();
+ if(!basegfx::fTools::equalZero(fShearX))
+ {
+ aHelpMatrix.shearX(fShearX);
+ }
+
+ if(!basegfx::fTools::equalZero(fRotate))
+ {
+ aHelpMatrix.rotate(fRotate);
+ }
+
+ if(!aHelpMatrix.isIdentity())
+ {
+ // create inverse from it and back-transform polygon
+ basegfx::B2DPolyPolygon aBackTransformed(maPathPolygon);
+ basegfx::B2DHomMatrix aInverseHelpMatrix(aHelpMatrix);
+ aInverseHelpMatrix.invert();
+ aBackTransformed.transform(aInverseHelpMatrix);
+
+ // update range
+ aRange = aBackTransformed.getB2DRange();
+
+ // extract scale and translate. Transform topLeft from it back
+ // to transformed state to get original topLeft (rotation center).
+ // Be careful not to delete mirrorings
+ aTranslate = aHelpMatrix * aRange.getMinimum();
+ aScale *= aRange.getRange();
+ }
+ else
+ {
+ // extract translate and scale straightforward
+ aTranslate = aRange.getMinimum();
+ aScale = aRange.getRange();
+ }
+
+ // create new transformation
+ aHelpMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate);
+ }
+ }
+ }
+
+ // set adapted transformation, but do not change the
+ // polygon data; that IS the defining part in this case
+ maSdrObjectTransformation = aHelpMatrix;
}
-sal_Bool ImpIsLine(const basegfx::B2DPolyPolygon& rPolyPolygon)
+sdr::contact::ViewContact* SdrPathObj::CreateObjectSpecificViewContact()
{
- return (1L == rPolyPolygon.count() && 2L == rPolyPolygon.getB2DPolygon(0L).count());
+ return new sdr::contact::ViewContactOfSdrPathObj(*this);
}
-Rectangle ImpGetBoundRect(const basegfx::B2DPolyPolygon& rPolyPolygon)
+SdrPathObj::SdrPathObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DPolyPolygon& rPathPoly)
+: SdrTextObj(rSdrModel),
+ maPathPolygon(rPathPoly),
+ mpDAC(0)
{
- basegfx::B2DRange aRange(basegfx::tools::getRange(rPolyPolygon));
-
- return Rectangle(
- FRound(aRange.getMinX()), FRound(aRange.getMinY()),
- FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
+ impAdaptTransformation();
}
-void SdrPathObj::ImpForceLineWink()
+SdrPathObj::~SdrPathObj()
{
- if(OBJ_LINE == meKind && ImpIsLine(GetPathPoly()))
- {
- const basegfx::B2DPolygon aPoly(GetPathPoly().getB2DPolygon(0L));
- const basegfx::B2DPoint aB2DPoint0(aPoly.getB2DPoint(0L));
- const basegfx::B2DPoint aB2DPoint1(aPoly.getB2DPoint(1L));
- const Point aPoint0(FRound(aB2DPoint0.getX()), FRound(aB2DPoint0.getY()));
- const Point aPoint1(FRound(aB2DPoint1.getX()), FRound(aB2DPoint1.getY()));
- const Point aDelt(aPoint1 - aPoint0);
-
- aGeo.nDrehWink=GetAngle(aDelt);
- aGeo.nShearWink=0;
- aGeo.RecalcSinCos();
- aGeo.RecalcTan();
-
- // #101412# for SdrTextObj, keep aRect up to date
- aRect = Rectangle(aPoint0, aPoint1);
- aRect.Justify();
- }
+ impDeleteDAC();
}
-void SdrPathObj::ImpForceKind()
+void SdrPathObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- if (meKind==OBJ_PATHPLIN) meKind=OBJ_PLIN;
- if (meKind==OBJ_PATHPOLY) meKind=OBJ_POLY;
-
- if(GetPathPoly().areControlPointsUsed())
+ if(this != &rSource)
{
- switch (meKind)
+ const SdrPathObj* pSource = dynamic_cast< const SdrPathObj* >(&rSource);
+
+ if(pSource)
{
- case OBJ_LINE: meKind=OBJ_PATHLINE; break;
- case OBJ_PLIN: meKind=OBJ_PATHLINE; break;
- case OBJ_POLY: meKind=OBJ_PATHFILL; break;
- default: break;
+ // call parent
+ SdrTextObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ maPathPolygon = pSource->getB2DPolyPolygonInObjectCoordinates();
}
- }
- else
- {
- switch (meKind)
+ else
{
- case OBJ_PATHLINE: meKind=OBJ_PLIN; break;
- case OBJ_FREELINE: meKind=OBJ_PLIN; break;
- case OBJ_PATHFILL: meKind=OBJ_POLY; break;
- case OBJ_FREEFILL: meKind=OBJ_POLY; break;
- default: break;
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
}
}
+}
- if (meKind==OBJ_LINE && !ImpIsLine(GetPathPoly())) meKind=OBJ_PLIN;
- if (meKind==OBJ_PLIN && ImpIsLine(GetPathPoly())) meKind=OBJ_LINE;
+SdrObject* SdrPathObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SdrPathObj* pClone = new SdrPathObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
- bClosedObj=IsClosed();
+ return pClone;
+}
- if (meKind==OBJ_LINE)
- {
- ImpForceLineWink();
- }
- else
- {
- // #i10659#, similar to #101412# but for polys with more than 2 points.
- //
- // Here i again need to fix something, because when Path-Polys are Copy-Pasted
- // between Apps with different measurements (e.g. 100TH_MM and TWIPS) there is
- // a scaling loop started from SdrExchangeView::Paste. This is principally nothing
- // wrong, but aRect is wrong here and not even updated by RecalcSnapRect(). If
- // this is the case, some size needs to be set here in aRect to avoid that the cyclus
- // through Rect2Poly - Poly2Rect does something badly wrong since that cycle is
- // BASED on aRect. That cycle is triggered in SdrTextObj::NbcResize() which is called
- // from the local Resize() implementation.
- //
- // Basic problem is that the member aRect in SdrTextObj basically is a unrotated
- // text rectangle for the text object itself and methods at SdrTextObj do handle it
- // in that way. Many draw objects derived from SdrTextObj 'abuse' aRect as SnapRect
- // which is basically wrong. To make the SdrText methods which deal with aRect directly
- // work it is necessary to always keep aRect updated. This e.g. not done after a Clone()
- // command for SdrPathObj. Since adding this update mechanism with #101412# to
- // ImpForceLineWink() for lines was very successful, i add it to where ImpForceLineWink()
- // was called, once here below and once on a 2nd place below.
-
- // #i10659# for SdrTextObj, keep aRect up to date
- if(GetPathPoly().count())
- {
- aRect = ImpGetBoundRect(GetPathPoly());
- }
-
- // #116244# reset rotation
- aGeo.nDrehWink = aGeo.nShearWink = 0;
- aGeo.RecalcSinCos(); aGeo.RecalcTan();
- }
-
- // #i75974# adapt polygon state to object type. This may include a reinterpretation
- // of a closed geometry as open one, but with identical first and last point
+bool SdrPathObj::IsClosedObj() const
+{
+ return isClosed();
+}
+
+void SdrPathObj::ImpSetClosed(bool bClose)
+{
for(sal_uInt32 a(0); a < maPathPolygon.count(); a++)
{
basegfx::B2DPolygon aCandidate(maPathPolygon.getB2DPolygon(a));
- if((bool)IsClosed() != aCandidate.isClosed())
+ if(bClose != aCandidate.isClosed())
{
- // #i80213# really change polygon geometry; else e.g. the last point which
+ // really change polygon geometry; else e.g. the last point which
// needs to be identical with the first one will be missing when opening
// due to OBJ_PATH type
if(aCandidate.isClosed())
@@ -1825,82 +1796,44 @@ void SdrPathObj::ImpForceKind()
basegfx::tools::closeWithGeometryChange(aCandidate);
}
+ // no need to use impAdaptTransformation here,
+ // the geometry gets not changed in it's dimensions
maPathPolygon.setB2DPolygon(a, aCandidate);
}
}
}
-void SdrPathObj::ImpSetClosed(sal_Bool bClose)
-{
- if(bClose)
- {
- switch (meKind)
- {
- case OBJ_LINE : meKind=OBJ_POLY; break;
- case OBJ_PLIN : meKind=OBJ_POLY; break;
- case OBJ_PATHLINE: meKind=OBJ_PATHFILL; break;
- case OBJ_FREELINE: meKind=OBJ_FREEFILL; break;
- case OBJ_SPLNLINE: meKind=OBJ_SPLNFILL; break;
- default: break;
- }
-
- bClosedObj = sal_True;
- }
- else
- {
- switch (meKind)
- {
- case OBJ_POLY : meKind=OBJ_PLIN; break;
- case OBJ_PATHFILL: meKind=OBJ_PATHLINE; break;
- case OBJ_FREEFILL: meKind=OBJ_FREELINE; break;
- case OBJ_SPLNFILL: meKind=OBJ_SPLNLINE; break;
- default: break;
- }
-
- bClosedObj = sal_False;
- }
-
- ImpForceKind();
-}
-
void SdrPathObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bNoContortion=sal_False;
+ rInfo.mbNoContortion=false;
- FASTBOOL bCanConv = !HasText() || ImpCanConvTextToCurve();
- FASTBOOL bIsPath = IsBezier() || IsSpline();
+ const bool bCanConv(!HasText() || ImpCanConvTextToCurve());
+ const bool bIsPath(isBezier());
- rInfo.bEdgeRadiusAllowed = sal_False;
- rInfo.bCanConvToPath = bCanConv && !bIsPath;
- rInfo.bCanConvToPoly = bCanConv && bIsPath;
- rInfo.bCanConvToContour = !IsFontwork() && (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbCanConvToPath = bCanConv && !bIsPath;
+ rInfo.mbCanConvToPoly = bCanConv && bIsPath;
+ rInfo.mbCanConvToContour = !IsFontwork() && (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
sal_uInt16 SdrPathObj::GetObjIdentifier() const
{
- return sal_uInt16(meKind);
-}
-
-void SdrPathObj::operator=(const SdrObject& rObj)
-{
- SdrTextObj::operator=(rObj);
- SdrPathObj& rPath=(SdrPathObj&)rObj;
- maPathPolygon=rPath.GetPathPoly();
+ return sal_uInt16(OBJ_POLY);
}
void SdrPathObj::TakeObjNameSingul(XubString& rName) const
{
- if(OBJ_LINE == meKind)
+ const SdrPathObjType aSdrPathObjType(getSdrPathObjType());
+
+ if(PathType_Line == aSdrPathObjType)
{
sal_uInt16 nId(STR_ObjNameSingulLINE);
- if(ImpIsLine(GetPathPoly()))
+ if(isLine())
{
- const basegfx::B2DPolygon aPoly(GetPathPoly().getB2DPolygon(0L));
+ const basegfx::B2DPolygon aPoly(getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(0L));
const basegfx::B2DPoint aB2DPoint0(aPoly.getB2DPoint(0L));
const basegfx::B2DPoint aB2DPoint1(aPoly.getB2DPoint(1L));
- const Point aPoint0(FRound(aB2DPoint0.getX()), FRound(aB2DPoint0.getY()));
- const Point aPoint1(FRound(aB2DPoint0.getX()), FRound(aB2DPoint0.getY()));
if(aB2DPoint0 != aB2DPoint1)
{
@@ -1927,9 +1860,9 @@ void SdrPathObj::TakeObjNameSingul(XubString& rName) const
rName = ImpGetResStr(nId);
}
- else if(OBJ_PLIN == meKind || OBJ_POLY == meKind)
+ else if(PathType_OpenPolygon == aSdrPathObjType || PathType_ClosedPolygon == aSdrPathObjType)
{
- const sal_Bool bClosed(OBJ_POLY == meKind);
+ const bool bClosed(PathType_ClosedPolygon == aSdrPathObjType);
sal_uInt16 nId(0);
if(mpDAC && mpDAC->IsCreating())
@@ -1947,13 +1880,13 @@ void SdrPathObj::TakeObjNameSingul(XubString& rName) const
}
else
{
- // get point count
- sal_uInt32 nPointCount(0L);
- const sal_uInt32 nPolyCount(GetPathPoly().count());
+ // get absolute point count
+ sal_uInt32 nPointCount(0);
+ const sal_uInt32 nPolyCount(getB2DPolyPolygonInObjectCoordinates().count());
- for(sal_uInt32 a(0L); a < nPolyCount; a++)
+ for(sal_uInt32 a(0); a < nPolyCount; a++)
{
- nPointCount += GetPathPoly().getB2DPolygon(a).count();
+ nPointCount += getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(a).count();
}
if(bClosed)
@@ -1977,14 +1910,19 @@ void SdrPathObj::TakeObjNameSingul(XubString& rName) const
}
else
{
- switch (meKind)
+ switch (aSdrPathObjType)
{
- case OBJ_PATHLINE: rName=ImpGetResStr(STR_ObjNameSingulPATHLINE); break;
- case OBJ_FREELINE: rName=ImpGetResStr(STR_ObjNameSingulFREELINE); break;
- case OBJ_SPLNLINE: rName=ImpGetResStr(STR_ObjNameSingulNATSPLN); break;
- case OBJ_PATHFILL: rName=ImpGetResStr(STR_ObjNameSingulPATHFILL); break;
- case OBJ_FREEFILL: rName=ImpGetResStr(STR_ObjNameSingulFREEFILL); break;
- case OBJ_SPLNFILL: rName=ImpGetResStr(STR_ObjNameSingulPERSPLN); break;
+ case PathType_OpenBezier:
+ {
+ rName = ImpGetResStr(STR_ObjNameSingulPATHLINE);
+ break;
+ }
+ case PathType_ClosedBezier:
+ {
+ rName = ImpGetResStr(STR_ObjNameSingulPATHFILL);
+ break;
+ }
+
default: break;
}
}
@@ -2001,84 +1939,72 @@ void SdrPathObj::TakeObjNameSingul(XubString& rName) const
void SdrPathObj::TakeObjNamePlural(XubString& rName) const
{
- switch(meKind)
- {
- case OBJ_LINE : rName=ImpGetResStr(STR_ObjNamePluralLINE ); break;
- case OBJ_PLIN : rName=ImpGetResStr(STR_ObjNamePluralPLIN ); break;
- case OBJ_POLY : rName=ImpGetResStr(STR_ObjNamePluralPOLY ); break;
- case OBJ_PATHLINE: rName=ImpGetResStr(STR_ObjNamePluralPATHLINE); break;
- case OBJ_FREELINE: rName=ImpGetResStr(STR_ObjNamePluralFREELINE); break;
- case OBJ_SPLNLINE: rName=ImpGetResStr(STR_ObjNamePluralNATSPLN); break;
- case OBJ_PATHFILL: rName=ImpGetResStr(STR_ObjNamePluralPATHFILL); break;
- case OBJ_FREEFILL: rName=ImpGetResStr(STR_ObjNamePluralFREEFILL); break;
- case OBJ_SPLNFILL: rName=ImpGetResStr(STR_ObjNamePluralPERSPLN); break;
- default: break;
- }
-}
-
-basegfx::B2DPolyPolygon SdrPathObj::TakeXorPoly() const
-{
- return GetPathPoly();
-}
-
-sal_uInt32 SdrPathObj::GetHdlCount() const
-{
- sal_uInt32 nRetval(0L);
- const sal_uInt32 nPolyCount(GetPathPoly().count());
+ const SdrPathObjType aSdrPathObjType(getSdrPathObjType());
- for(sal_uInt32 a(0L); a < nPolyCount; a++)
+ switch(aSdrPathObjType)
{
- nRetval += GetPathPoly().getB2DPolygon(a).count();
- }
+ case PathType_Line: // old OBJ_LINE
+ {
+ rName = ImpGetResStr(STR_ObjNamePluralLINE);
+ break;
+ }
+ case PathType_OpenPolygon: // old OBJ_PLIN
+ {
+ rName = ImpGetResStr(STR_ObjNamePluralPLIN);
+ break;
+ }
+ case PathType_ClosedPolygon: // old OBJ_POLY
+ {
+ rName = ImpGetResStr(STR_ObjNamePluralPOLY);
+ break;
+ }
+ case PathType_OpenBezier: // old OBJ_PATHLINE
+ {
+ rName = ImpGetResStr(STR_ObjNamePluralPATHLINE);
+ break;
+ }
+ case PathType_ClosedBezier: // old OBJ_PATHFILL
+ {
+ rName = ImpGetResStr(STR_ObjNamePluralPATHFILL);
+ break;
+ }
- return nRetval;
+ default: break;
+ }
}
-SdrHdl* SdrPathObj::GetHdl(sal_uInt32 nHdlNum) const
+basegfx::B2DPolyPolygon SdrPathObj::TakeXorPoly() const
{
- // #i73248#
- // Warn the user that this is ineffective and show alternatives. Should not be used at all.
- OSL_ENSURE(false, "SdrPathObj::GetHdl(): ineffective, use AddToHdlList instead (!)");
-
- // to have an alternative, get single handle using the ineffective way
- SdrHdl* pRetval = 0;
- SdrHdlList aLocalList(0);
- AddToHdlList(aLocalList);
- const sal_uInt32 nHdlCount(aLocalList.GetHdlCount());
-
- if(nHdlCount && nHdlNum < nHdlCount)
- {
- // remove and remember. The other created handles will be deleted again with the
- // destruction of the local list
- pRetval = aLocalList.RemoveHdl(nHdlNum);
- }
-
- return pRetval;
+ return getB2DPolyPolygonInObjectCoordinates();
}
void SdrPathObj::AddToHdlList(SdrHdlList& rHdlList) const
{
// keep old stuff to be able to keep old SdrHdl stuff, too
- const XPolyPolygon aOldPathPolygon(GetPathPoly());
+ const XPolyPolygon aOldPathPolygon(getB2DPolyPolygonInObjectCoordinates());
sal_uInt16 nPolyCnt=aOldPathPolygon.Count();
- FASTBOOL bClosed=IsClosed();
+ bool bClosed(isClosed());
sal_uInt16 nIdx=0;
- for (sal_uInt16 i=0; i<nPolyCnt; i++) {
+ for (sal_uInt16 i=0; i<nPolyCnt; i++)
+ {
const XPolygon& rXPoly=aOldPathPolygon.GetObject(i);
sal_uInt16 nPntCnt=rXPoly.GetPointCount();
- if (bClosed && nPntCnt>1) nPntCnt--;
- for (sal_uInt16 j=0; j<nPntCnt; j++) {
- if (rXPoly.GetFlags(j)!=XPOLY_CONTROL) {
+ if (bClosed && nPntCnt>1)
+ nPntCnt--;
+
+ for (sal_uInt16 j=0; j<nPntCnt; j++)
+ {
+ if (rXPoly.GetFlags(j)!=XPOLY_CONTROL)
+ {
const Point& rPnt=rXPoly[j];
- SdrHdl* pHdl=new SdrHdl(rPnt,HDL_POLY);
+ SdrHdl* pHdl = new SdrHdl(rHdlList, this, HDL_POLY, basegfx::B2DPoint(rPnt.X(), rPnt.Y()));
pHdl->SetPolyNum(i);
pHdl->SetPointNum(j);
pHdl->Set1PixMore(j==0);
pHdl->SetSourceHdlNum(nIdx);
nIdx++;
- rHdlList.AddHdl(pHdl);
}
}
}
@@ -2087,7 +2013,7 @@ void SdrPathObj::AddToHdlList(SdrHdlList& rHdlList) const
sal_uInt32 SdrPathObj::GetPlusHdlCount(const SdrHdl& rHdl) const
{
// keep old stuff to be able to keep old SdrHdl stuff, too
- const XPolyPolygon aOldPathPolygon(GetPathPoly());
+ const XPolyPolygon aOldPathPolygon(getB2DPolyPolygonInObjectCoordinates());
sal_uInt16 nCnt = 0;
sal_uInt16 nPnt = (sal_uInt16)rHdl.GetPointNum();
sal_uInt16 nPolyNum = (sal_uInt16)rHdl.GetPolyNum();
@@ -2096,6 +2022,7 @@ sal_uInt32 SdrPathObj::GetPlusHdlCount(const SdrHdl& rHdl) const
{
const XPolygon& rXPoly = aOldPathPolygon[nPolyNum];
sal_uInt16 nPntMax = rXPoly.GetPointCount();
+
if (nPntMax>0)
{
nPntMax--;
@@ -2103,10 +2030,17 @@ sal_uInt32 SdrPathObj::GetPlusHdlCount(const SdrHdl& rHdl) const
{
if (rXPoly.GetFlags(nPnt)!=XPOLY_CONTROL)
{
- if (nPnt==0 && IsClosed()) nPnt=nPntMax;
- if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPOLY_CONTROL) nCnt++;
- if (nPnt==nPntMax && IsClosed()) nPnt=0;
- if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==XPOLY_CONTROL) nCnt++;
+ if (nPnt==0 && isClosed())
+ nPnt=nPntMax;
+
+ if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPOLY_CONTROL)
+ nCnt++;
+
+ if (nPnt==nPntMax && isClosed())
+ nPnt=0;
+
+ if (nPnt<nPntMax && rXPoly.GetFlags(nPnt+1)==XPOLY_CONTROL)
+ nCnt++;
}
}
}
@@ -2115,10 +2049,10 @@ sal_uInt32 SdrPathObj::GetPlusHdlCount(const SdrHdl& rHdl) const
return nCnt;
}
-SdrHdl* SdrPathObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlusNum) const
+void SdrPathObj::GetPlusHdl(SdrHdlList& rHdlList, const SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlusNum) const
{
// keep old stuff to be able to keep old SdrHdl stuff, too
- const XPolyPolygon aOldPathPolygon(GetPathPoly());
+ const XPolyPolygon aOldPathPolygon(getB2DPolyPolygonInObjectCoordinates());
SdrHdl* pHdl = 0L;
sal_uInt16 nPnt = (sal_uInt16)rHdl.GetPointNum();
sal_uInt16 nPolyNum = (sal_uInt16)rHdl.GetPolyNum();
@@ -2133,35 +2067,75 @@ SdrHdl* SdrPathObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt32 nPlusNum) const
nPntMax--;
if (nPnt<=nPntMax)
{
- pHdl=new SdrHdlBezWgt(&rHdl);
+ pHdl = new SdrHdlBezWgt(rHdlList, rSdrObject, rHdl);
pHdl->SetPolyNum(rHdl.GetPolyNum());
- if (nPnt==0 && IsClosed()) nPnt=nPntMax;
+ if (nPnt==0 && isClosed())
+ {
+ nPnt=nPntMax;
+ }
+
if (nPnt>0 && rXPoly.GetFlags(nPnt-1)==XPOLY_CONTROL && nPlusNum==0)
{
- pHdl->SetPos(rXPoly[nPnt-1]);
+ pHdl->setPosition(basegfx::B2DPoint(rXPoly[nPnt-1].X(), rXPoly[nPnt-1].Y()));
pHdl->SetPointNum(nPnt-1);
}
else
{
- if (nPnt==nPntMax && IsClosed()) nPnt=0;
+ if (nPnt==nPntMax && isClosed())
+ {
+ nPnt=0;
+ }
+
if (nPnt<rXPoly.GetPointCount()-1 && rXPoly.GetFlags(nPnt+1)==XPOLY_CONTROL)
{
- pHdl->SetPos(rXPoly[nPnt+1]);
+ pHdl->setPosition(basegfx::B2DPoint(rXPoly[nPnt+1].X(), rXPoly[nPnt+1].Y()));
pHdl->SetPointNum(nPnt+1);
}
}
pHdl->SetSourceHdlNum(rHdl.GetSourceHdlNum());
- pHdl->SetPlusHdl(sal_True);
}
}
}
- return pHdl;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
+SdrPathObjType SdrPathObj::getSdrPathObjType() const
+{
+ if(isLine())
+ {
+ return PathType_Line;
+ }
+
+ if(maPathPolygon.isClosed())
+ {
+ if(maPathPolygon.areControlPointsUsed())
+ {
+ return PathType_ClosedBezier;
+ }
+ else
+ {
+ return PathType_ClosedPolygon;
+ }
+ }
+ else
+ {
+ if(maPathPolygon.areControlPointsUsed())
+ {
+ return PathType_OpenBezier;
+ }
+ else
+ {
+ return PathType_OpenPolygon;
+ }
+ }
+
+ // default
+ return PathType_Line;
+}
+
bool SdrPathObj::hasSpecialDrag() const
{
return true;
@@ -2169,14 +2143,14 @@ bool SdrPathObj::hasSpecialDrag() const
bool SdrPathObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this));
+ ImpPathForDragAndCreate aDragAndCreate(*this, getSdrPathObjType(), false);
return aDragAndCreate.beginPathDrag(rDrag);
}
bool SdrPathObj::applySpecialDrag(SdrDragStat& rDrag)
{
- ImpPathForDragAndCreate aDragAndCreate(*this);
+ ImpPathForDragAndCreate aDragAndCreate(*this, getSdrPathObjType(), false);
bool bRetval(aDragAndCreate.beginPathDrag(rDrag));
if(bRetval)
@@ -2191,7 +2165,7 @@ bool SdrPathObj::applySpecialDrag(SdrDragStat& rDrag)
if(bRetval)
{
- NbcSetPathPoly(aDragAndCreate.getModifiedPolyPolygon());
+ setB2DPolyPolygonInObjectCoordinates(aDragAndCreate.getModifiedPolyPolygon());
}
return bRetval;
@@ -2204,7 +2178,7 @@ String SdrPathObj::getSpecialDragComment(const SdrDragStat& rDrag) const
if(mpDAC)
{
// #i103058# also get a comment when in creation
- const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
+ const bool bCreateComment(this == rDrag.GetSdrViewFromSdrDragStat().GetCreateObj());
if(bCreateComment)
{
@@ -2213,7 +2187,7 @@ String SdrPathObj::getSpecialDragComment(const SdrDragStat& rDrag) const
}
else
{
- ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this));
+ ImpPathForDragAndCreate aDragAndCreate(*this, getSdrPathObjType(), false);
bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag));
if(bDidWork)
@@ -2228,7 +2202,7 @@ String SdrPathObj::getSpecialDragComment(const SdrDragStat& rDrag) const
basegfx::B2DPolyPolygon SdrPathObj::getSpecialDragPoly(const SdrDragStat& rDrag) const
{
basegfx::B2DPolyPolygon aRetval;
- ImpPathForDragAndCreate aDragAndCreate(*((SdrPathObj*)this));
+ ImpPathForDragAndCreate aDragAndCreate(*this, getSdrPathObjType(), false);
bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag));
if(bDidWork)
@@ -2241,45 +2215,46 @@ basegfx::B2DPolyPolygon SdrPathObj::getSpecialDragPoly(const SdrDragStat& rDrag)
////////////////////////////////////////////////////////////////////////////////////////////////////
-FASTBOOL SdrPathObj::BegCreate(SdrDragStat& rStat)
+bool SdrPathObj::BegCreate(SdrDragStat& rDrag)
{
impDeleteDAC();
- return impGetDAC().BegCreate(rStat);
+
+ return impGetDAC(rDrag.GetSdrViewFromSdrDragStat()).BegCreate(rDrag);
}
-FASTBOOL SdrPathObj::MovCreate(SdrDragStat& rStat)
+bool SdrPathObj::MovCreate(SdrDragStat& rDrag)
{
- return impGetDAC().MovCreate(rStat);
+ return impGetDAC(rDrag.GetSdrViewFromSdrDragStat()).MovCreate(rDrag);
}
-FASTBOOL SdrPathObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+bool SdrPathObj::EndCreate(SdrDragStat& rDrag, SdrCreateCmd eCmd)
{
- FASTBOOL bRetval(impGetDAC().EndCreate(rStat, eCmd));
+ bool bRetval(impGetDAC(rDrag.GetSdrViewFromSdrDragStat()).EndCreate(rDrag, eCmd));
if(bRetval && mpDAC)
{
- SetPathPoly(mpDAC->getModifiedPolyPolygon());
+ setB2DPolyPolygonInObjectCoordinates(mpDAC->getModifiedPolyPolygon());
// #i75974# Check for AutoClose feature. Moved here from ImpPathForDragAndCreate::EndCreate
// to be able to use the type-changing ImpSetClosed method
if(!IsClosedObj())
{
- SdrView* pView = rStat.GetView();
+ SdrView& rView = rDrag.GetSdrViewFromSdrDragStat();
- if(pView && pView->IsAutoClosePolys() && !pView->IsUseIncompatiblePathCreateInterface())
+ if(rView.IsAutoClosePolys())
{
- OutputDevice* pOut = pView->GetFirstOutputDevice();
+ OutputDevice* pOut = rView.GetFirstOutputDevice();
if(pOut)
{
- if(GetPathPoly().count())
+ if(getB2DPolyPolygonInObjectCoordinates().count())
{
- const basegfx::B2DPolygon aCandidate(GetPathPoly().getB2DPolygon(0));
+ const basegfx::B2DPolygon aCandidate(getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(0));
if(aCandidate.count() > 2)
{
// check distance of first and last point
- const sal_Int32 nCloseDist(pOut->PixelToLogic(Size(pView->GetAutoCloseDistPix(), 0)).Width());
+ const sal_Int32 nCloseDist(pOut->PixelToLogic(Size(rView.GetAutoCloseDistPix(), 0)).Width());
const basegfx::B2DVector aDistVector(aCandidate.getB2DPoint(aCandidate.count() - 1) - aCandidate.getB2DPoint(0));
if(aDistVector.getLength() <= (double)nCloseDist)
@@ -2299,14 +2274,14 @@ FASTBOOL SdrPathObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
return bRetval;
}
-FASTBOOL SdrPathObj::BckCreate(SdrDragStat& rStat)
+bool SdrPathObj::BckCreate(SdrDragStat& rDrag)
{
- return impGetDAC().BckCreate(rStat);
+ return impGetDAC(rDrag.GetSdrViewFromSdrDragStat()).BckCreate(rDrag);
}
-void SdrPathObj::BrkCreate(SdrDragStat& rStat)
+void SdrPathObj::BrkCreate(SdrDragStat& rDrag)
{
- impGetDAC().BrkCreate(rStat);
+ impGetDAC(rDrag.GetSdrViewFromSdrDragStat()).BrkCreate(rDrag);
impDeleteDAC();
}
@@ -2348,211 +2323,86 @@ basegfx::B2DPolyPolygon SdrPathObj::getDragPolyPolygon(const SdrDragStat& rDrag)
return aRetval;
}
-Pointer SdrPathObj::GetCreatePointer() const
-{
- return impGetDAC().GetCreatePointer();
-}
-
-void SdrPathObj::NbcMove(const Size& rSiz)
-{
- maPathPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(rSiz.Width(), rSiz.Height()));
-
- // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
- SdrTextObj::NbcMove(rSiz);
-}
-
-void SdrPathObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-rRef.X(), -rRef.Y()));
- aTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
- double(xFact), double(yFact), rRef.X(), rRef.Y()) * aTrans;
- maPathPolygon.transform(aTrans);
-
- // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
- SdrTextObj::NbcResize(rRef,xFact,yFact);
-}
-
-void SdrPathObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
-{
- // Thank JOE, the angles are defined mirrored to the mathematical meanings
- const basegfx::B2DHomMatrix aTrans(basegfx::tools::createRotateAroundPoint(rRef.X(), rRef.Y(), -nWink * nPi180));
- maPathPolygon.transform(aTrans);
-
- // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
- SdrTextObj::NbcRotate(rRef,nWink,sn,cs);
-}
-
-void SdrPathObj::NbcShear(const Point& rRefPnt, long nAngle, double fTan, FASTBOOL bVShear)
-{
- basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-rRefPnt.X(), -rRefPnt.Y()));
-
- if(bVShear)
- {
- // Thank JOE, the angles are defined mirrored to the mathematical meanings
- aTrans.shearY(-fTan);
- }
- else
- {
- aTrans.shearX(-fTan);
- }
-
- aTrans.translate(rRefPnt.X(), rRefPnt.Y());
- maPathPolygon.transform(aTrans);
-
- // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
- SdrTextObj::NbcShear(rRefPnt,nAngle,fTan,bVShear);
-}
-
-void SdrPathObj::NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2)
-{
- const double fDiffX(rRefPnt2.X() - rRefPnt1.X());
- const double fDiffY(rRefPnt2.Y() - rRefPnt1.Y());
- const double fRot(atan2(fDiffY, fDiffX));
- basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-rRefPnt1.X(), -rRefPnt1.Y()));
- aTrans.rotate(-fRot);
- aTrans.scale(1.0, -1.0);
- aTrans.rotate(fRot);
- aTrans.translate(rRefPnt1.X(), rRefPnt1.Y());
- maPathPolygon.transform(aTrans);
-
- // #97538# Do Joe's special handling for lines when mirroring, too
- ImpForceKind();
-
- // #i19871# first modify locally, then call parent (to get correct SnapRect with GluePoints)
- SdrTextObj::NbcMirror(rRefPnt1,rRefPnt2);
-}
-
-void SdrPathObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
+Pointer SdrPathObj::GetCreatePointer(const SdrView& rSdrView) const
{
- if(!aGeo.nDrehWink)
- {
- rRect = GetSnapRect();
- }
- else
- {
- XPolyPolygon aXPP(GetPathPoly());
- RotateXPoly(aXPP,Point(),-aGeo.nSin,aGeo.nCos);
- rRect=aXPP.GetBoundRect();
- Point aTmp(rRect.TopLeft());
- RotatePoint(aTmp,Point(),aGeo.nSin,aGeo.nCos);
- aTmp-=rRect.TopLeft();
- rRect.Move(aTmp.X(),aTmp.Y());
- }
-}
-
-void SdrPathObj::RecalcSnapRect()
-{
- if(GetPathPoly().count())
- {
- maSnapRect = ImpGetBoundRect(GetPathPoly());
- }
-}
-
-void SdrPathObj::NbcSetSnapRect(const Rectangle& rRect)
-{
- Rectangle aOld(GetSnapRect());
-
- // #95736# Take RECT_EMPTY into account when calculating scale factors
- long nMulX = (RECT_EMPTY == rRect.Right()) ? 0 : rRect.Right() - rRect.Left();
-
- long nDivX = aOld.Right() - aOld.Left();
-
- // #95736# Take RECT_EMPTY into account when calculating scale factors
- long nMulY = (RECT_EMPTY == rRect.Bottom()) ? 0 : rRect.Bottom() - rRect.Top();
-
- long nDivY = aOld.Bottom() - aOld.Top();
- if ( nDivX == 0 ) { nMulX = 1; nDivX = 1; }
- if ( nDivY == 0 ) { nMulY = 1; nDivY = 1; }
- Fraction aX(nMulX,nDivX);
- Fraction aY(nMulY,nDivY);
- NbcResize(aOld.TopLeft(), aX, aY);
- NbcMove(Size(rRect.Left() - aOld.Left(), rRect.Top() - aOld.Top()));
+ return impGetDAC(rSdrView).GetCreatePointer();
}
sal_uInt32 SdrPathObj::GetSnapPointCount() const
{
- return GetHdlCount();
+ return getB2DPolyPolygonInObjectCoordinates().allPointCount();
}
-Point SdrPathObj::GetSnapPoint(sal_uInt32 nSnapPnt) const
+basegfx::B2DPoint SdrPathObj::GetSnapPoint(sal_uInt32 nSnapPnt) const
{
sal_uInt32 nPoly,nPnt;
- if(!PolyPolygonEditor::GetRelativePolyPoint(GetPathPoly(), nSnapPnt, nPoly, nPnt))
+
+ if(!PolyPolygonEditor::GetRelativePolyPoint(getB2DPolyPolygonInObjectCoordinates(), nSnapPnt, nPoly, nPnt))
{
- DBG_ASSERT(sal_False,"SdrPathObj::GetSnapPoint: Punkt nSnapPnt nicht vorhanden!");
+ DBG_ASSERT(false,"SdrPathObj::GetSnapPoint: Punkt nSnapPnt nicht vorhanden!");
}
- const basegfx::B2DPoint aB2DPoint(GetPathPoly().getB2DPolygon(nPoly).getB2DPoint(nPnt));
- return Point(FRound(aB2DPoint.getX()), FRound(aB2DPoint.getY()));
+ return getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(nPoly).getB2DPoint(nPnt);
}
-sal_Bool SdrPathObj::IsPolyObj() const
+bool SdrPathObj::IsPolygonObject() const
{
- return sal_True;
+ return true;
}
-sal_uInt32 SdrPathObj::GetPointCount() const
+sal_uInt32 SdrPathObj::GetObjectPointCount() const
{
- const sal_uInt32 nPolyCount(GetPathPoly().count());
+ const sal_uInt32 nPolyCount(getB2DPolyPolygonInObjectCoordinates().count());
sal_uInt32 nRetval(0L);
for(sal_uInt32 a(0L); a < nPolyCount; a++)
{
- nRetval += GetPathPoly().getB2DPolygon(a).count();
+ nRetval += getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(a).count();
}
return nRetval;
}
-Point SdrPathObj::GetPoint(sal_uInt32 nHdlNum) const
+basegfx::B2DPoint SdrPathObj::GetObjectPoint(sal_uInt32 nHdlNum) const
{
- Point aRetval;
+ basegfx::B2DPoint aRetval;
sal_uInt32 nPoly,nPnt;
- if(PolyPolygonEditor::GetRelativePolyPoint(GetPathPoly(), nHdlNum, nPoly, nPnt))
+ if(PolyPolygonEditor::GetRelativePolyPoint(getB2DPolyPolygonInObjectCoordinates(), nHdlNum, nPoly, nPnt))
{
- const basegfx::B2DPolygon aPoly(GetPathPoly().getB2DPolygon(nPoly));
- const basegfx::B2DPoint aPoint(aPoly.getB2DPoint(nPnt));
- aRetval = Point(FRound(aPoint.getX()), FRound(aPoint.getY()));
+ aRetval = getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(nPoly).getB2DPoint(nPnt);
}
return aRetval;
}
-void SdrPathObj::NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum)
+void SdrPathObj::SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 nHdlNum)
{
sal_uInt32 nPoly,nPnt;
- if(PolyPolygonEditor::GetRelativePolyPoint(GetPathPoly(), nHdlNum, nPoly, nPnt))
+ if(PolyPolygonEditor::GetRelativePolyPoint(getB2DPolyPolygonInObjectCoordinates(), nHdlNum, nPoly, nPnt))
{
- basegfx::B2DPolygon aNewPolygon(GetPathPoly().getB2DPolygon(nPoly));
- aNewPolygon.setB2DPoint(nPnt, basegfx::B2DPoint(rPnt.X(), rPnt.Y()));
+ basegfx::B2DPolygon aNewPolygon(getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(nPoly));
+ const basegfx::B2DRange aRangeBefore(aNewPolygon.getB2DRange());
+ aNewPolygon.setB2DPoint(nPnt, rPnt);
+ const basegfx::B2DRange aRangeAfter(aNewPolygon.getB2DRange());
maPathPolygon.setB2DPolygon(nPoly, aNewPolygon);
- if(meKind==OBJ_LINE)
+ if(aRangeBefore != aRangeAfter)
{
- ImpForceLineWink();
- }
- else
- {
- if(GetPathPoly().count())
- {
- // #i10659# for SdrTextObj, keep aRect up to date
- aRect = ImpGetBoundRect(GetPathPoly()); // fuer SdrTextObj#
- }
+ // need to adapt when geometric size has changed
+ impAdaptTransformation();
}
-
- SetRectsDirty();
}
}
-sal_uInt32 SdrPathObj::NbcInsPointOld(const Point& rPos, sal_Bool bNewObj, sal_Bool bHideHim)
+sal_uInt32 SdrPathObj::InsPointOld(const Point& rPos, sal_Bool bNewObj)
{
sal_uInt32 nNewHdl;
if(bNewObj)
{
- nNewHdl = NbcInsPoint(0L, rPos, sal_True, bHideHim);
+ nNewHdl = InsPoint(rPos, sal_True);
}
else
{
@@ -2561,24 +2411,23 @@ sal_uInt32 SdrPathObj::NbcInsPointOld(const Point& rPos, sal_Bool bNewObj, sal_B
sal_uInt32 nSmallestPolyIndex(0L);
sal_uInt32 nSmallestEdgeIndex(0L);
double fSmallestCut;
- basegfx::tools::getSmallestDistancePointToPolyPolygon(GetPathPoly(), aTestPoint, nSmallestPolyIndex, nSmallestEdgeIndex, fSmallestCut);
+ basegfx::tools::getSmallestDistancePointToPolyPolygon(getB2DPolyPolygonInObjectCoordinates(), aTestPoint, nSmallestPolyIndex, nSmallestEdgeIndex, fSmallestCut);
// create old polygon index from it
sal_uInt32 nPolyIndex(nSmallestEdgeIndex);
for(sal_uInt32 a(0L); a < nSmallestPolyIndex; a++)
{
- nPolyIndex += GetPathPoly().getB2DPolygon(a).count();
+ nPolyIndex += getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(a).count();
}
- nNewHdl = NbcInsPoint(nPolyIndex, rPos, sal_False, bHideHim);
+ nNewHdl = InsPoint(rPos, sal_False);
}
- ImpForceKind();
return nNewHdl;
}
-sal_uInt32 SdrPathObj::NbcInsPoint(sal_uInt32 /*nHdlNum*/, const Point& rPos, sal_Bool bNewObj, sal_Bool /*bHideHim*/)
+sal_uInt32 SdrPathObj::InsPoint(const Point& rPos, sal_Bool bNewObj)
{
sal_uInt32 nNewHdl;
@@ -2587,10 +2436,10 @@ sal_uInt32 SdrPathObj::NbcInsPoint(sal_uInt32 /*nHdlNum*/, const Point& rPos, sa
basegfx::B2DPolygon aNewPoly;
const basegfx::B2DPoint aPoint(rPos.X(), rPos.Y());
aNewPoly.append(aPoint);
- aNewPoly.setClosed(IsClosed());
+ aNewPoly.setClosed(isClosed());
maPathPolygon.append(aNewPoly);
- SetRectsDirty();
- nNewHdl = GetHdlCount();
+ impAdaptTransformation();
+ nNewHdl = getB2DPolyPolygonInObjectCoordinates().allPointCount();
}
else
{
@@ -2599,8 +2448,9 @@ sal_uInt32 SdrPathObj::NbcInsPoint(sal_uInt32 /*nHdlNum*/, const Point& rPos, sa
sal_uInt32 nSmallestPolyIndex(0L);
sal_uInt32 nSmallestEdgeIndex(0L);
double fSmallestCut;
- basegfx::tools::getSmallestDistancePointToPolyPolygon(GetPathPoly(), aTestPoint, nSmallestPolyIndex, nSmallestEdgeIndex, fSmallestCut);
- basegfx::B2DPolygon aCandidate(GetPathPoly().getB2DPolygon(nSmallestPolyIndex));
+ basegfx::tools::getSmallestDistancePointToPolyPolygon(getB2DPolyPolygonInObjectCoordinates(), aTestPoint, nSmallestPolyIndex, nSmallestEdgeIndex, fSmallestCut);
+ basegfx::B2DPolygon aCandidate(getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(nSmallestPolyIndex));
+ const basegfx::B2DRange aRangeBefore(aCandidate.getB2DRange());
const bool bBefore(!aCandidate.isClosed() && 0L == nSmallestEdgeIndex && 0.0 == fSmallestCut);
const bool bAfter(!aCandidate.isClosed() && aCandidate.count() == nSmallestEdgeIndex + 2L && 1.0 == fSmallestCut);
@@ -2680,23 +2530,29 @@ sal_uInt32 SdrPathObj::NbcInsPoint(sal_uInt32 /*nHdlNum*/, const Point& rPos, sa
nNewHdl = nSmallestEdgeIndex + 1L;
}
+ const basegfx::B2DRange aRangeAfter(aCandidate.getB2DRange());
maPathPolygon.setB2DPolygon(nSmallestPolyIndex, aCandidate);
// create old polygon index from it
for(sal_uInt32 a(0L); a < nSmallestPolyIndex; a++)
{
- nNewHdl += GetPathPoly().getB2DPolygon(a).count();
+ nNewHdl += getB2DPolyPolygonInObjectCoordinates().getB2DPolygon(a).count();
+ }
+
+ if(aRangeBefore != aRangeAfter)
+ {
+ // need to adapt when geometric size has changed
+ impAdaptTransformation();
}
}
- ImpForceKind();
return nNewHdl;
}
SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
{
SdrPathObj* pNewObj = 0L;
- const basegfx::B2DPolyPolygon aLocalPolyPolygon(GetPathPoly());
+ const basegfx::B2DPolyPolygon aLocalPolyPolygon(getB2DPolyPolygonInObjectCoordinates());
sal_uInt32 nPoly, nPnt;
if(PolyPolygonEditor::GetRelativePolyPoint(aLocalPolyPolygon, nHdlNum, nPoly, nPnt))
@@ -2708,12 +2564,12 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
if(nPointCount)
{
- if(IsClosed())
+ if(isClosed())
{
// when closed, RipPoint means to open the polygon at the selected point. To
// be able to do that, it is necessary to make the selected point the first one
basegfx::B2DPolygon aNewPolygon(basegfx::tools::makeStartPoint(aCandidate, nPnt));
- SetPathPoly(basegfx::B2DPolyPolygon(aNewPolygon));
+ setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aNewPolygon));
ToggleClosed();
// give back new position of old start point (historical reasons)
@@ -2725,11 +2581,11 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
{
// split in two objects at point nPnt
basegfx::B2DPolygon aSplitPolyA(aCandidate, 0L, nPnt + 1L);
- SetPathPoly(basegfx::B2DPolyPolygon(aSplitPolyA));
+ setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aSplitPolyA));
- pNewObj = (SdrPathObj*)Clone();
+ pNewObj = static_cast< SdrPathObj* >(CloneSdrObject());
basegfx::B2DPolygon aSplitPolyB(aCandidate, nPnt, nPointCount - nPnt);
- pNewObj->SetPathPoly(basegfx::B2DPolyPolygon(aSplitPolyB));
+ pNewObj->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aSplitPolyB));
}
}
}
@@ -2739,7 +2595,7 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
return pNewObj;
}
-SdrObject* SdrPathObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+SdrObject* SdrPathObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
// #i89784# check for FontWork with activated HideContour
const drawinglayer::attribute::SdrTextAttribute aText(
@@ -2749,18 +2605,18 @@ SdrObject* SdrPathObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
SdrObject* pRet = bHideContour ?
0 :
- ImpConvertMakeObj(GetPathPoly(), IsClosed(), bBezier);
+ ImpConvertMakeObj(getB2DPolyPolygonInObjectCoordinates(), isClosed(), bBezier);
- SdrPathObj* pPath = PTR_CAST(SdrPathObj, pRet);
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pRet);
if(pPath)
{
- if(pPath->GetPathPoly().areControlPointsUsed())
+ if(pPath->getB2DPolyPolygonInObjectCoordinates().areControlPointsUsed())
{
if(!bBezier)
{
// reduce all bezier curves
- pPath->SetPathPoly(basegfx::tools::adaptiveSubdivideByAngle(pPath->GetPathPoly()));
+ pPath->setB2DPolyPolygonInObjectCoordinates(basegfx::tools::adaptiveSubdivideByAngle(pPath->getB2DPolyPolygonInObjectCoordinates()));
}
}
else
@@ -2768,7 +2624,7 @@ SdrObject* SdrPathObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
if(bBezier)
{
// create bezier curves
- pPath->SetPathPoly(basegfx::tools::expandToCurve(pPath->GetPathPoly()));
+ pPath->setB2DPolyPolygonInObjectCoordinates(basegfx::tools::expandToCurve(pPath->getB2DPolyPolygonInObjectCoordinates()));
}
}
}
@@ -2790,8 +2646,7 @@ void SdrPathObj::SaveGeoData(SdrObjGeoData& rGeo) const
{
SdrTextObj::SaveGeoData(rGeo);
SdrPathObjGeoData& rPGeo = (SdrPathObjGeoData&) rGeo;
- rPGeo.maPathPolygon=GetPathPoly();
- rPGeo.meKind=meKind;
+ rPGeo.maPathPolygon = getB2DPolyPolygonInObjectCoordinates();
}
void SdrPathObj::RestGeoData(const SdrObjGeoData& rGeo)
@@ -2799,56 +2654,58 @@ void SdrPathObj::RestGeoData(const SdrObjGeoData& rGeo)
SdrTextObj::RestGeoData(rGeo);
SdrPathObjGeoData& rPGeo=(SdrPathObjGeoData&)rGeo;
maPathPolygon=rPGeo.maPathPolygon;
- meKind=rPGeo.meKind;
- ImpForceKind(); // damit u.a. bClosed gesetzt wird
}
-void SdrPathObj::NbcSetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly)
+basegfx::B2DPolyPolygon SdrPathObj::getB2DPolyPolygonInObjectCoordinates() const
{
- if(GetPathPoly() != rPathPoly)
- {
- maPathPolygon=rPathPoly;
- ImpForceKind();
- SetRectsDirty();
- }
+ return maPathPolygon;
}
-void SdrPathObj::SetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly)
+void SdrPathObj::setB2DPolyPolygonInObjectCoordinates(const basegfx::B2DPolyPolygon& rPathPoly)
{
- if(GetPathPoly() != rPathPoly)
+ if(getB2DPolyPolygonInObjectCoordinates() != rPathPoly)
{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- NbcSetPathPoly(rPathPoly);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ maPathPolygon=rPathPoly;
+ impAdaptTransformation();
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
}
-void SdrPathObj::ToggleClosed() // long nOpenDistance)
+basegfx::B2DPolyPolygon SdrPathObj::getB2DPolyPolygonInNormalizedCoordinates() const
{
- Rectangle aBoundRect0;
- if(pUserCall != NULL)
- aBoundRect0 = GetLastBoundRect();
- ImpSetClosed(!IsClosed()); // neuen ObjKind setzen
- ImpForceKind(); // wg. Line->Poly->PolyLine statt Line->Poly->Line
- SetRectsDirty();
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ basegfx::B2DHomMatrix aInverse(getSdrObjectTransformation());
+ basegfx::B2DPolyPolygon aRetval(getB2DPolyPolygonInObjectCoordinates());
+
+ aInverse.invert();
+ aRetval.transform(aInverse);
+
+ return aRetval;
+}
+
+void SdrPathObj::setB2DPolyPolygonInNormalizedCoordinates(const basegfx::B2DPolyPolygon& rPathPoly)
+{
+ basegfx::B2DPolyPolygon aNew(rPathPoly);
+
+ aNew.transform(getSdrObjectTransformation());
+ setB2DPolyPolygonInObjectCoordinates(aNew);
}
-// fuer friend class SdrPolyEditView auf einigen Compilern:
-void SdrPathObj::SetRectsDirty(sal_Bool bNotMyself)
+void SdrPathObj::ToggleClosed()
{
- SdrTextObj::SetRectsDirty(bNotMyself);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ ImpSetClosed(!isClosed()); // neuen ObjKind setzen
+ SetChanged();
}
-ImpPathForDragAndCreate& SdrPathObj::impGetDAC() const
+ImpPathForDragAndCreate& SdrPathObj::impGetDAC(const SdrView& rView) const
{
if(!mpDAC)
{
- ((SdrPathObj*)this)->mpDAC = new ImpPathForDragAndCreate(*((SdrPathObj*)this));
+ const_cast< SdrPathObj* >(this)->mpDAC = new ImpPathForDragAndCreate(
+ *this,
+ rView.getSdrObjectCreationInfo().getSdrPathObjType(),
+ rView.getSdrObjectCreationInfo().getFreehandMode());
}
return *mpDAC;
@@ -2859,262 +2716,57 @@ void SdrPathObj::impDeleteDAC() const
if(mpDAC)
{
delete mpDAC;
- ((SdrPathObj*)this)->mpDAC = 0L;
+ const_cast< SdrPathObj* >(this)->mpDAC = 0;
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// transformation interface for StarOfficeAPI. This implements support for
-// homogen 3x3 matrices containing the transformation of the SdrObject. At the
-// moment it contains a shearX, rotation and translation, but for setting all linear
-// transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
-// with the base geometry and returns TRUE. Otherwise it returns FALSE.
-sal_Bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const
+void SdrPathObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- double fRotate(0.0);
- double fShearX(0.0);
- basegfx::B2DTuple aScale(1.0, 1.0);
- basegfx::B2DTuple aTranslate(0.0, 0.0);
-
- if(GetPathPoly().count())
+ if(isLine())
{
- // copy geometry
- basegfx::B2DHomMatrix aMoveToZeroMatrix;
- rPolyPolygon = GetPathPoly();
-
- if(OBJ_LINE == meKind)
- {
- // ignore shear and rotate, just use scale and translate
- OSL_ENSURE(GetPathPoly().count() > 0L && GetPathPoly().getB2DPolygon(0L).count() > 1L, "OBJ_LINE with too less polygons (!)");
- // #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon
- // itself, else this method will no longer return the full polygon information (curve will
- // be lost)
- const basegfx::B2DRange aPolyRangeNoCurve(basegfx::tools::getRange(rPolyPolygon));
- aScale = aPolyRangeNoCurve.getRange();
- aTranslate = aPolyRangeNoCurve.getMinimum();
+ // call parent
+ SdrTextObj::setSdrObjectTransformation(rTransformation);
- // define matrix for move polygon to zero point
- aMoveToZeroMatrix.translate(-aTranslate.getX(), -aTranslate.getY());
- }
- else
- {
- if(aGeo.nShearWink || aGeo.nDrehWink)
- {
- // get rotate and shear in drawingLayer notation
- fRotate = aGeo.nDrehWink * F_PI18000;
- fShearX = aGeo.nShearWink * F_PI18000;
-
- // build mathematically correct (negative shear and rotate) object transform
- // containing shear and rotate to extract unsheared, unrotated polygon
- basegfx::B2DHomMatrix aObjectMatrix;
- aObjectMatrix.shearX(tan((36000 - aGeo.nShearWink) * F_PI18000));
- aObjectMatrix.rotate((36000 - aGeo.nDrehWink) * F_PI18000);
-
- // create inverse from it and back-transform polygon
- basegfx::B2DHomMatrix aInvObjectMatrix(aObjectMatrix);
- aInvObjectMatrix.invert();
- rPolyPolygon.transform(aInvObjectMatrix);
-
- // get range from unsheared, unrotated polygon and extract scale and translate.
- // transform topLeft from it back to transformed state to get original
- // topLeft (rotation center)
- // #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon
- // itself, else this method will no longer return the full polygon information (curve will
- // be lost)
- const basegfx::B2DRange aCorrectedRangeNoCurve(basegfx::tools::getRange(rPolyPolygon));
- aTranslate = aObjectMatrix * aCorrectedRangeNoCurve.getMinimum();
- aScale = aCorrectedRangeNoCurve.getRange();
-
- // define matrix for move polygon to zero point
- // #i112280# Added missing minus for Y-Translation
- aMoveToZeroMatrix.translate(-aCorrectedRangeNoCurve.getMinX(), -aCorrectedRangeNoCurve.getMinY());
- }
- else
- {
- // get scale and translate from unsheared, unrotated polygon
- // #i72287# use polygon without control points for range calculation. Do not change rPolyPolygon
- // itself, else this method will no longer return the full polygon information (curve will
- // be lost)
- const basegfx::B2DRange aPolyRangeNoCurve(basegfx::tools::getRange(rPolyPolygon));
- aScale = aPolyRangeNoCurve.getRange();
- aTranslate = aPolyRangeNoCurve.getMinimum();
-
- // define matrix for move polygon to zero point
- aMoveToZeroMatrix.translate(-aTranslate.getX(), -aTranslate.getY());
- }
- }
+ // apply new transformation to (0,0) and (1,0) to create the polygon data
+ basegfx::B2DPolygon aLine;
- // move polygon to zero point with pre-defined matrix
- rPolyPolygon.transform(aMoveToZeroMatrix);
+ aLine.append(rTransformation * basegfx::B2DPoint(0.0, 0.0));
+ aLine.append(rTransformation * basegfx::B2DPoint(1.0, 0.0));
+ maPathPolygon = basegfx::B2DPolyPolygon(aLine);
}
-
- // position maybe relative to anchorpos, convert
- if( pModel && pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
- }
-
- // force MapUnit to 100th mm
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ else
{
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // postion
- aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
- aTranslate.setY(ImplTwipsToMM(aTranslate.getY()));
+ // remember current ObjectTransformation
+ basegfx::B2DHomMatrix aOldObjectTransformation(getSdrObjectTransformation());
- // size
- aScale.setX(ImplTwipsToMM(aScale.getX()));
- aScale.setY(ImplTwipsToMM(aScale.getY()));
+ // call parent
+ SdrTextObj::setSdrObjectTransformation(rTransformation);
- // polygon
- basegfx::B2DHomMatrix aTwipsToMM;
- const double fFactorTwipsToMM(127.0 / 72.0);
- aTwipsToMM.scale(fFactorTwipsToMM, fFactorTwipsToMM);
- rPolyPolygon.transform(aTwipsToMM);
+ // need to adapt the object-coordinate representation of maPathPolygon
+ const basegfx::B2DHomMatrix aNewObjectTransformation(getSdrObjectTransformation());
- break;
- }
- default:
- {
- DBG_ERROR("TRGetBaseGeometry: Missing unit translation to 100th mm!");
- }
+ if(aOldObjectTransformation != aNewObjectTransformation)
+ {
+ aOldObjectTransformation.invert();
+ aOldObjectTransformation = aNewObjectTransformation * aOldObjectTransformation;
+ maPathPolygon.transform(aOldObjectTransformation);
}
}
-
- // build return value matrix
- rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aScale,
- basegfx::fTools::equalZero(fShearX) ? 0.0 : tan(fShearX),
- basegfx::fTools::equalZero(fRotate) ? 0.0 : -fRotate,
- aTranslate);
-
- return sal_True;
}
-// sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
-// If it's an SdrPathObj it will use the provided geometry information. The Polygon has
-// to use (0,0) as upper left and will be scaled to the given size in the matrix.
-void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon)
+bool SdrPathObj::isClosed() const
{
- // break up matrix
- basegfx::B2DTuple aScale;
- basegfx::B2DTuple aTranslate;
- double fRotate, fShearX;
- rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
- // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
- if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
- {
- aScale.setX(fabs(aScale.getX()));
- aScale.setY(fabs(aScale.getY()));
- fRotate = fmod(fRotate + F_PI, F_2PI);
- }
-
- // copy poly
- basegfx::B2DPolyPolygon aNewPolyPolygon(rPolyPolygon);
-
- // reset object shear and rotations
- aGeo.nDrehWink = 0;
- aGeo.RecalcSinCos();
- aGeo.nShearWink = 0;
- aGeo.RecalcTan();
-
- // force metric to pool metric
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // position
- aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
- aTranslate.setY(ImplMMToTwips(aTranslate.getY()));
-
- // size
- aScale.setX(ImplMMToTwips(aScale.getX()));
- aScale.setY(ImplMMToTwips(aScale.getY()));
-
- // polygon
- basegfx::B2DHomMatrix aMMToTwips;
- const double fFactorMMToTwips(72.0 / 127.0);
- aMMToTwips.scale(fFactorMMToTwips, fFactorMMToTwips);
- aNewPolyPolygon.transform(aMMToTwips);
-
- break;
- }
- default:
- {
- DBG_ERROR("TRSetBaseGeometry: Missing unit translation to PoolMetric!");
- }
- }
- }
-
- if( pModel && pModel->IsWriter() )
- {
- // if anchor is used, make position relative to it
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
- }
-
- // create transformation for polygon, set values at aGeo direct
- basegfx::B2DHomMatrix aTransform;
-
- // #i75086#
- // Given polygon is already scaled (for historical reasons), but not mirrored yet.
- // Thus, when scale is negative in X or Y, apply the needed mirroring accordingly.
- if(basegfx::fTools::less(aScale.getX(), 0.0) || basegfx::fTools::less(aScale.getY(), 0.0))
- {
- aTransform.scale(
- basegfx::fTools::less(aScale.getX(), 0.0) ? -1.0 : 1.0,
- basegfx::fTools::less(aScale.getY(), 0.0) ? -1.0 : 1.0);
- }
-
- if(!basegfx::fTools::equalZero(fShearX))
- {
- aTransform.shearX(tan(-atan(fShearX)));
- aGeo.nShearWink = FRound(atan(fShearX) / F_PI18000);
- aGeo.RecalcTan();
- }
-
- if(!basegfx::fTools::equalZero(fRotate))
- {
- // #i78696#
- // fRotate is matematically correct for linear transformations, so it's
- // the one to use for the geometry change
- aTransform.rotate(fRotate);
-
- // #i78696#
- // fRotate is matematically correct, but aGeoStat.nDrehWink is
- // mirrored -> mirror value here
- aGeo.nDrehWink = NormAngle360(FRound(-fRotate / F_PI18000));
- aGeo.RecalcSinCos();
- }
+ return maPathPolygon.isClosed();
+}
- if(!aTranslate.equalZero())
- {
- // #i39529# absolute positioning, so get current position (without control points (!))
- const basegfx::B2DRange aCurrentRange(basegfx::tools::getRange(aNewPolyPolygon));
- aTransform.translate(aTranslate.getX() - aCurrentRange.getMinX(), aTranslate.getY() - aCurrentRange.getMinY());
- }
+bool SdrPathObj::isLine() const
+{
+ return (1 == maPathPolygon.count() && 2 == maPathPolygon.getB2DPolygon(0).count());
+}
- // transform polygon and trigger change
- aNewPolyPolygon.transform(aTransform);
- SetPathPoly(aNewPolyPolygon);
+bool SdrPathObj::isBezier() const
+{
+ return maPathPolygon.areControlPointsUsed();
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index 8d21289d593c..0f45eea4ce41 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -46,11 +46,12 @@
#include <svx/xflclit.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnwtit.hxx>
-#include "svdoimp.hxx"
#include <svx/sdr/properties/rectangleproperties.hxx>
#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
//////////////////////////////////////////////////////////////////////////////
// BaseProperties section
@@ -70,165 +71,96 @@ sdr::contact::ViewContact* SdrRectObj::CreateObjectSpecificViewContact()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrRectObj,SdrTextObj);
-
-SdrRectObj::SdrRectObj()
-: mpXPoly(0L)
-{
- bClosedObj=sal_True;
-}
-
-SdrRectObj::SdrRectObj(const Rectangle& rRect)
-: SdrTextObj(rRect),
- mpXPoly(NULL)
-{
- bClosedObj=sal_True;
-}
-
-SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind)
-: SdrTextObj(eNewTextKind),
- mpXPoly(NULL)
-{
- DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT ||
- eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT,
- "SdrRectObj::SdrRectObj(SdrObjKind) ist nur fuer Textrahmen gedacht");
- bClosedObj=sal_True;
-}
-
-SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect)
-: SdrTextObj(eNewTextKind,rRect),
- mpXPoly(NULL)
-{
- DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT ||
- eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT,
- "SdrRectObj::SdrRectObj(SdrObjKind,...) ist nur fuer Textrahmen gedacht");
- bClosedObj=sal_True;
-}
-
-SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat)
-: SdrTextObj(eNewTextKind,rNewRect,rInput,rBaseURL,eFormat),
- mpXPoly(NULL)
+SdrRectObj::SdrRectObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform,
+ SdrObjKind eNewTextKind,
+ bool bIsTextFrame)
+: SdrTextObj(rSdrModel, rTransform, eNewTextKind, bIsTextFrame)
{
- DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT ||
- eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT,
+ DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT,
"SdrRectObj::SdrRectObj(SdrObjKind,...) ist nur fuer Textrahmen gedacht");
- bClosedObj=sal_True;
}
SdrRectObj::~SdrRectObj()
{
- if(mpXPoly)
- {
- delete mpXPoly;
- }
}
-void SdrRectObj::SetXPolyDirty()
+void SdrRectObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- if(mpXPoly)
+ if(this != &rSource)
{
- delete mpXPoly;
- mpXPoly = 0L;
- }
-}
+ const SdrRectObj* pSource = dynamic_cast< const SdrRectObj* >(&rSource);
-FASTBOOL SdrRectObj::PaintNeedsXPoly(long nEckRad) const
-{
- FASTBOOL bNeed=aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 || nEckRad!=0;
- return bNeed;
-}
+ if(pSource)
+ {
+ // call parent
+ SdrTextObj::copyDataFromSdrObject(rSource);
-XPolygon SdrRectObj::ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const
-{
- XPolygon aXPoly(rRect1,nRad1,nRad1);
- const sal_uInt16 nPointAnz(aXPoly.GetPointCount());
- XPolygon aNeuPoly(nPointAnz+1);
- sal_uInt16 nShift=nPointAnz-2;
- if (nRad1!=0) nShift=nPointAnz-5;
- sal_uInt16 j=nShift;
- for (sal_uInt16 i=1; i<nPointAnz; i++) {
- aNeuPoly[i]=aXPoly[j];
- aNeuPoly.SetFlags(i,aXPoly.GetFlags(j));
- j++;
- if (j>=nPointAnz) j=1;
+ // no local data to copy
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
}
- aNeuPoly[0]=rRect1.BottomCenter();
- aNeuPoly[nPointAnz]=aNeuPoly[0];
- aXPoly=aNeuPoly;
-
- // Die Winkelangaben beziehen sich immer auf die linke obere Ecke von !aRect!
- if (aGeo.nShearWink!=0) ShearXPoly(aXPoly,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotateXPoly(aXPoly,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- return aXPoly;
}
-void SdrRectObj::RecalcXPoly()
+SdrObject* SdrRectObj::CloneSdrObject(SdrModel* pTargetModel) const
{
- mpXPoly = new XPolygon(ImpCalcXPoly(aRect,GetEckenradius()));
+ SdrRectObj* pClone = new SdrRectObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
-const XPolygon& SdrRectObj::GetXPoly() const
+bool SdrRectObj::IsClosedObj() const
{
- if(!mpXPoly)
- {
- ((SdrRectObj*)this)->RecalcXPoly();
- }
-
- return *mpXPoly;
+ return true;
}
void SdrRectObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- FASTBOOL bNoTextFrame=!IsTextFrame();
- rInfo.bResizeFreeAllowed=bNoTextFrame || aGeo.nDrehWink%9000==0;
- rInfo.bResizePropAllowed=sal_True;
- rInfo.bRotateFreeAllowed=sal_True;
- rInfo.bRotate90Allowed =sal_True;
- rInfo.bMirrorFreeAllowed=bNoTextFrame;
- rInfo.bMirror45Allowed =bNoTextFrame;
- rInfo.bMirror90Allowed =bNoTextFrame;
+ bool bNoTextFrame = !IsTextFrame();
+ const long aOldRotation(sdr::legacy::GetRotateAngle(*this));
+ rInfo.mbResizeFreeAllowed = bNoTextFrame || aOldRotation%9000==0;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = true;
+ rInfo.mbRotate90Allowed = true;
+ rInfo.mbMirrorFreeAllowed=bNoTextFrame;
+ rInfo.mbMirror45Allowed =bNoTextFrame;
+ rInfo.mbMirror90Allowed = bNoTextFrame;
// allow transparence
- rInfo.bTransparenceAllowed = sal_True;
+ rInfo.mbTransparenceAllowed = true;
// gradient depends on fillstyle
XFillStyle eFillStyle = ((XFillStyleItem&)(GetObjectItem(XATTR_FILLSTYLE))).GetValue();
- rInfo.bGradientAllowed = (eFillStyle == XFILL_GRADIENT);
+ rInfo.mbGradientAllowed = (XFILL_GRADIENT == eFillStyle);
- rInfo.bShearAllowed =bNoTextFrame;
- rInfo.bEdgeRadiusAllowed=sal_True;
+ rInfo.mbShearAllowed = bNoTextFrame;
+ rInfo.mbEdgeRadiusAllowed = true;
- FASTBOOL bCanConv=!HasText() || ImpCanConvTextToCurve();
- if (bCanConv && !bNoTextFrame && !HasText()) {
+ bool bCanConv = !HasText() || ImpCanConvTextToCurve();
+
+ if (bCanConv && !bNoTextFrame && !HasText())
+ {
bCanConv=HasFill() || HasLine();
}
- rInfo.bCanConvToPath =bCanConv;
- rInfo.bCanConvToPoly =bCanConv;
- rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
-}
-sal_uInt16 SdrRectObj::GetObjIdentifier() const
-{
- if (IsTextFrame()) return sal_uInt16(eTextKind);
- else return sal_uInt16(OBJ_RECT);
+ rInfo.mbCanConvToPath = bCanConv;
+ rInfo.mbCanConvToPoly = bCanConv;
+ rInfo.mbCanConvToContour = (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
-void SdrRectObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
+sal_uInt16 SdrRectObj::GetObjIdentifier() const
{
- rRect=aRect;
- if (aGeo.nShearWink!=0) {
- long nDst=Round((aRect.Bottom()-aRect.Top())*aGeo.nTan);
- if (aGeo.nShearWink>0) {
- Point aRef(rRect.TopLeft());
- rRect.Left()-=nDst;
- Point aTmpPt(rRect.TopLeft());
- RotatePoint(aTmpPt,aRef,aGeo.nSin,aGeo.nCos);
- aTmpPt-=rRect.TopLeft();
- rRect.Move(aTmpPt.X(),aTmpPt.Y());
- } else {
- rRect.Right()-=nDst;
- }
- }
+ if(IsTextFrame())
+ return sal_uInt16(eTextKind);
+ else
+ return sal_uInt16(OBJ_RECT);
}
void SdrRectObj::TakeObjNameSingul(XubString& rName) const
@@ -239,18 +171,32 @@ void SdrRectObj::TakeObjNameSingul(XubString& rName) const
}
else
{
- sal_uInt16 nResId=STR_ObjNameSingulRECT;
- if (aGeo.nShearWink!=0) {
+ sal_uInt16 nResId(STR_ObjNameSingulRECT);
+
+ if(!basegfx::fTools::equalZero(getSdrObjectShearX()))
+ {
nResId+=4; // Parallelogramm oder Raute
// Raute ist nicht, weil Shear die vertikalen Kanten verlaengert!
// Wenn Zeit ist, werde ich das mal berechnen.
- } else {
- if (aRect.GetWidth()==aRect.GetHeight()) nResId+=2; // Quadrat
}
- if (GetEckenradius()!=0) nResId+=8; // abgerundet
+ else
+ {
+ const basegfx::B2DVector aObjectScale(absolute(getSdrObjectScale()));
+
+ if(basegfx::fTools::equal(aObjectScale.getX(), aObjectScale.getY()))
+ {
+ nResId += 2; // Quadrat
+ }
+ }
+ if(GetEdgeRadius())
+ {
+ nResId += 8; // abgerundet
+ }
+
rName=ImpGetResStr(nResId);
String aName( GetName() );
+
if(aName.Len())
{
rName += sal_Unicode(' ');
@@ -263,117 +209,102 @@ void SdrRectObj::TakeObjNameSingul(XubString& rName) const
void SdrRectObj::TakeObjNamePlural(XubString& rName) const
{
- if (IsTextFrame()) SdrTextObj::TakeObjNamePlural(rName);
- else {
- sal_uInt16 nResId=STR_ObjNamePluralRECT;
- if (aGeo.nShearWink!=0) {
- nResId+=4; // Parallelogramm oder Raute
- } else {
- if (aRect.GetWidth()==aRect.GetHeight()) nResId+=2; // Quadrat
- }
- if (GetEckenradius()!=0) nResId+=8; // abgerundet
- rName=ImpGetResStr(nResId);
+ if (IsTextFrame())
+ {
+ SdrTextObj::TakeObjNamePlural(rName);
}
-}
+ else
+ {
+ sal_uInt16 nResId(STR_ObjNamePluralRECT);
-void SdrRectObj::operator=(const SdrObject& rObj)
-{
- SdrTextObj::operator=(rObj);
+ if(!basegfx::fTools::equalZero(getSdrObjectShearX()))
+ {
+ nResId += 4; // Parallelogramm oder Raute
+ }
+ else
+ {
+ const basegfx::B2DVector aObjectScale(absolute(getSdrObjectScale()));
+
+ if(basegfx::fTools::equal(aObjectScale.getX(), aObjectScale.getY()))
+ {
+ nResId += 2; // Quadrat
+ }
+ }
+
+ if(GetEdgeRadius())
+ {
+ nResId += 8; // abgerundet
+ }
+
+ rName = ImpGetResStr(nResId);
+ }
}
basegfx::B2DPolyPolygon SdrRectObj::TakeXorPoly() const
{
- XPolyPolygon aXPP;
- aXPP.Insert(ImpCalcXPoly(aRect,GetEckenradius()));
- return aXPP.getB2DPolyPolygon();
-}
+ double fCornerRadiusX(0.0);
+ double fCornerRadiusY(0.0);
-void SdrRectObj::RecalcSnapRect()
-{
- long nEckRad=GetEckenradius();
- if ((aGeo.nDrehWink!=0 || aGeo.nShearWink!=0) && nEckRad!=0) {
- maSnapRect=GetXPoly().GetBoundRect();
- } else {
- SdrTextObj::RecalcSnapRect();
+ if(GetEdgeRadius())
+ {
+ const basegfx::B2DVector aObjectScale(absolute(getSdrObjectScale()));
+
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(
+ GetEdgeRadius(),
+ aObjectScale.getX(),
+ aObjectScale.getY(),
+ fCornerRadiusX,
+ fCornerRadiusY);
}
-}
-void SdrRectObj::NbcSetSnapRect(const Rectangle& rRect)
-{
- SdrTextObj::NbcSetSnapRect(rRect);
- SetXPolyDirty();
-}
+ basegfx::B2DPolygon aUnitOutline(
+ basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange::getUnitB2DRange(),
+ fCornerRadiusX,
+ fCornerRadiusY));
-void SdrRectObj::NbcSetLogicRect(const Rectangle& rRect)
-{
- SdrTextObj::NbcSetLogicRect(rRect);
- SetXPolyDirty();
-}
+ aUnitOutline.transform(getSdrObjectTransformation());
-sal_uInt32 SdrRectObj::GetHdlCount() const
-{
- return IsTextFrame() ? 10 : 9;
+ return basegfx::B2DPolyPolygon(aUnitOutline);
}
-SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const
+void SdrRectObj::AddToHdlList(SdrHdlList& rHdlList) const
{
- SdrHdl* pH = NULL;
- Point aPnt;
- SdrHdlKind eKind = HDL_MOVE;
-
- if(!IsTextFrame())
+ if(IsTextFrame())
{
- nHdlNum++;
+ // add TextFrame handle
+ new ImpTextframeHdl(rHdlList, *this, getSdrObjectTransformation());
}
- switch(nHdlNum)
{
- case 0:
- {
- pH = new ImpTextframeHdl(aRect);
- pH->SetObj((SdrObject*)this);
- pH->SetDrehWink(aGeo.nDrehWink);
- break;
- }
- case 1:
+ // add edge radius control
+ const basegfx::B2DVector aAbsScale(basegfx::absolute(getSdrObjectScale()));
+ double fRadius(std::max(0.0, (double)GetEdgeRadius()));
+ basegfx::B2DPoint aPos;
+
+ if(fRadius < 0.0)
{
- long a = GetEckenradius();
- long b = Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
- if (a>b) a=b;
- if (a<0) a=0;
- aPnt=aRect.TopLeft();
- aPnt.X()+=a;
- eKind = HDL_CIRC;
- break;
+ fRadius = 0.0;
}
- case 2: aPnt=aRect.TopLeft(); eKind = HDL_UPLFT; break; // Oben links
- case 3: aPnt=aRect.TopCenter(); eKind = HDL_UPPER; break; // Oben
- case 4: aPnt=aRect.TopRight(); eKind = HDL_UPRGT; break; // Oben rechts
- case 5: aPnt=aRect.LeftCenter(); eKind = HDL_LEFT ; break; // Links
- case 6: aPnt=aRect.RightCenter(); eKind = HDL_RIGHT; break; // Rechts
- case 7: aPnt=aRect.BottomLeft(); eKind = HDL_LWLFT; break; // Unten links
- case 8: aPnt=aRect.BottomCenter(); eKind = HDL_LOWER; break; // Unten
- case 9: aPnt=aRect.BottomRight(); eKind = HDL_LWRGT; break; // Unten rechts
- }
- if(!pH)
- {
- if(aGeo.nShearWink)
+ if(aAbsScale.getX() > aAbsScale.getY())
{
- ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
+ fRadius /= basegfx::fTools::equalZero(aAbsScale.getX()) ? 1.0 : aAbsScale.getX();
+ fRadius = std::min(0.5, fRadius);
+ aPos = getSdrObjectTransformation() * basegfx::B2DPoint(fRadius, 0.0);
}
-
- if(aGeo.nDrehWink)
+ else
{
- RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
+ fRadius /= basegfx::fTools::equalZero(aAbsScale.getY()) ? 1.0 : aAbsScale.getY();
+ fRadius = std::min(0.5, fRadius);
+ aPos = getSdrObjectTransformation() * basegfx::B2DPoint(0.0, fRadius);
}
- pH = new SdrHdl(aPnt,eKind);
- pH->SetObj((SdrObject*)this);
- pH->SetDrehWink(aGeo.nDrehWink);
+ new SdrHdl(rHdlList, this, HDL_CIRC, aPos);
}
- return pH;
+ // use default eight object handles from parent
+ SdrTextObj::AddToHdlList(rHdlList);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -385,7 +316,7 @@ bool SdrRectObj::hasSpecialDrag() const
bool SdrRectObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bRad(rDrag.GetActiveHdl() && HDL_CIRC == rDrag.GetActiveHdl()->GetKind());
if(bRad)
{
@@ -399,24 +330,31 @@ bool SdrRectObj::beginSpecialDrag(SdrDragStat& rDrag) const
bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag)
{
- const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bRad(rDrag.GetActiveHdl() && HDL_CIRC == rDrag.GetActiveHdl()->GetKind());
if (bRad)
{
- Rectangle aBoundRect0;
- Point aPt(rDrag.GetNow());
-
- if(aGeo.nDrehWink)
- RotatePoint(aPt,aRect.TopLeft(),-aGeo.nSin,aGeo.nCos);
+ basegfx::B2DHomMatrix aInverse(getSdrObjectTransformation());
+ aInverse.invert();
- sal_Int32 nRad(aPt.X() - aRect.Left());
+ const basegfx::B2DPoint aObjectCoor(aInverse * rDrag.GetNow());
+ const basegfx::B2DVector aAbsScale(basegfx::absolute(getSdrObjectScale()));
+ sal_Int32 nRadius(0);
- if (nRad < 0)
- nRad = 0;
+ if(aAbsScale.getX() > aAbsScale.getY())
+ {
+ const double fRadius(aAbsScale.getX() * (std::min(0.5, std::max(0.0, aObjectCoor.getX()))));
+ nRadius = basegfx::fround(fRadius);
+ }
+ else
+ {
+ const double fRadius(aAbsScale.getY() * (std::min(0.5, std::max(0.0, aObjectCoor.getY()))));
+ nRadius = basegfx::fround(fRadius);
+ }
- if(nRad != GetEckenradius())
+ if(nRadius != GetEdgeRadius())
{
- NbcSetEckenradius(nRad);
+ SetEdgeRadius(nRadius);
}
return true;
@@ -429,7 +367,7 @@ bool SdrRectObj::applySpecialDrag(SdrDragStat& rDrag)
String SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const
{
- const bool bCreateComment(rDrag.GetView() && this == rDrag.GetView()->GetCreateObj());
+ const bool bCreateComment(this == rDrag.GetSdrViewFromSdrDragStat().GetCreateObj());
if(bCreateComment)
{
@@ -437,26 +375,50 @@ String SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const
}
else
{
- const bool bRad(rDrag.GetHdl() && HDL_CIRC == rDrag.GetHdl()->GetKind());
+ const bool bRad(rDrag.GetActiveHdl() && HDL_CIRC == rDrag.GetActiveHdl()->GetKind());
if(bRad)
{
- Point aPt(rDrag.GetNow());
+ basegfx::B2DPoint aPoint(rDrag.GetNow());
+ const basegfx::B2DPoint aObjectTopLeft(getSdrObjectTranslate());
+ const double fObjectRotate(getSdrObjectRotate());
+ const double fObjectShearX(getSdrObjectShearX());
+ basegfx::B2DHomMatrix aBackTransform;
+
+ if(!basegfx::fTools::equalZero(fObjectRotate) || !basegfx::fTools::equalZero(fObjectShearX))
+ {
+ aBackTransform.translate(-getSdrObjectTranslate());
+
+ if(!basegfx::fTools::equalZero(fObjectRotate))
+ {
+ aBackTransform.rotate(-fObjectRotate);
+ }
+
+ if(!basegfx::fTools::equalZero(fObjectShearX))
+ {
+ aBackTransform.shearX(-fObjectShearX);
+ }
+
+ aBackTransform.translate(getSdrObjectTranslate());
+ }
- // -sin fuer Umkehrung
- if(aGeo.nDrehWink)
- RotatePoint(aPt, aRect.TopLeft(), -aGeo.nSin, aGeo.nCos);
+ if(!aBackTransform.isIdentity())
+ {
+ aPoint = aBackTransform * aPoint;
+ }
- sal_Int32 nRad(aPt.X() - aRect.Left());
+ double fRad(aPoint.getX() - aObjectTopLeft.getX());
- if(nRad < 0)
- nRad = 0;
+ if(fRad < 0.0)
+ {
+ fRad = 0.0;
+ }
XubString aStr;
- ImpTakeDescriptionStr(STR_DragRectEckRad, aStr);
+ TakeMarkedDescriptionString(STR_DragRectEckRad, aStr);
aStr.AppendAscii(" (");
- aStr += GetMetrStr(nRad);
+ aStr += GetMetrStr(basegfx::fround(fRad));
aStr += sal_Unicode(')');
return aStr;
@@ -472,52 +434,43 @@ String SdrRectObj::getSpecialDragComment(const SdrDragStat& rDrag) const
basegfx::B2DPolyPolygon SdrRectObj::TakeCreatePoly(const SdrDragStat& rDrag) const
{
- Rectangle aRect1;
- rDrag.TakeCreateRect(aRect1);
- aRect1.Justify();
+ const basegfx::B2DRange aRange(rDrag.TakeCreateRange());
+ const basegfx::B2DVector aScale(aRange.getRange());
+ double fCornerRadiusX(0.0);
+ double fCornerRadiusY(0.0);
- basegfx::B2DPolyPolygon aRetval;
- aRetval.append(ImpCalcXPoly(aRect1,GetEckenradius()).getB2DPolygon());
- return aRetval;
-}
-
-Pointer SdrRectObj::GetCreatePointer() const
-{
- if (IsTextFrame()) return Pointer(POINTER_DRAW_TEXT);
- return Pointer(POINTER_DRAW_RECT);
-}
+ if(GetEdgeRadius())
+ {
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(
+ GetEdgeRadius(),
+ aScale.getX(),
+ aScale.getY(),
+ fCornerRadiusX,
+ fCornerRadiusY);
+ }
-void SdrRectObj::NbcMove(const Size& rSiz)
-{
- SdrTextObj::NbcMove(rSiz);
- SetXPolyDirty();
-}
+ basegfx::B2DPolygon aUnitOutline(
+ basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange::getUnitB2DRange(),
+ fCornerRadiusX,
+ fCornerRadiusY));
-void SdrRectObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- SdrTextObj::NbcResize(rRef,xFact,yFact);
- SetXPolyDirty();
-}
+ aUnitOutline.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(aScale, aRange.getMinimum()));
-void SdrRectObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
-{
- SdrTextObj::NbcRotate(rRef,nWink,sn,cs);
- SetXPolyDirty();
+ return basegfx::B2DPolyPolygon(aUnitOutline);
}
-void SdrRectObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+Pointer SdrRectObj::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
- SdrTextObj::NbcShear(rRef,nWink,tn,bVShear);
- SetXPolyDirty();
-}
+ if (IsTextFrame())
+ {
+ return Pointer(POINTER_DRAW_TEXT);
+ }
-void SdrRectObj::NbcMirror(const Point& rRef1, const Point& rRef2)
-{
- SdrTextObj::NbcMirror(rRef1,rRef2);
- SetXPolyDirty();
+ return Pointer(POINTER_DRAW_RECT);
}
-FASTBOOL SdrRectObj::DoMacro(const SdrObjMacroHitRec& rRec)
+bool SdrRectObj::DoMacro(const SdrObjMacroHitRec& rRec)
{
return SdrTextObj::DoMacro(rRec);
}
@@ -527,76 +480,18 @@ XubString SdrRectObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
return SdrTextObj::GetMacroPopupComment(rRec);
}
-SdrGluePoint SdrRectObj::GetVertexGluePoint(sal_uInt16 nPosNum) const
-{
- sal_Int32 nWdt = ImpGetLineWdt(); // #i25616# ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue();
-
- // #i25616#
- if(!LineIsOutsideGeometry())
- {
- nWdt++;
- nWdt /= 2;
- }
-
- Point aPt;
- switch (nPosNum) {
- case 0: aPt=aRect.TopCenter(); aPt.Y()-=nWdt; break;
- case 1: aPt=aRect.RightCenter(); aPt.X()+=nWdt; break;
- case 2: aPt=aRect.BottomCenter(); aPt.Y()+=nWdt; break;
- case 3: aPt=aRect.LeftCenter(); aPt.X()-=nWdt; break;
- }
- if (aGeo.nShearWink!=0) ShearPoint(aPt,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoint(aPt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- aPt-=GetSnapRect().Center();
- SdrGluePoint aGP(aPt);
- aGP.SetPercent(sal_False);
- return aGP;
-}
-
-SdrGluePoint SdrRectObj::GetCornerGluePoint(sal_uInt16 nPosNum) const
+SdrObject* SdrRectObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
- sal_Int32 nWdt = ImpGetLineWdt(); // #i25616# ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue();
-
- // #i25616#
- if(!LineIsOutsideGeometry())
- {
- nWdt++;
- nWdt /= 2;
- }
-
- Point aPt;
- switch (nPosNum) {
- case 0: aPt=aRect.TopLeft(); aPt.X()-=nWdt; aPt.Y()-=nWdt; break;
- case 1: aPt=aRect.TopRight(); aPt.X()+=nWdt; aPt.Y()-=nWdt; break;
- case 2: aPt=aRect.BottomRight(); aPt.X()+=nWdt; aPt.Y()+=nWdt; break;
- case 3: aPt=aRect.BottomLeft(); aPt.X()-=nWdt; aPt.Y()+=nWdt; break;
- }
- if (aGeo.nShearWink!=0) ShearPoint(aPt,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoint(aPt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- aPt-=GetSnapRect().Center();
- SdrGluePoint aGP(aPt);
- aGP.SetPercent(sal_False);
- return aGP;
-}
-
-SdrObject* SdrRectObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
-{
- XPolygon aXP(ImpCalcXPoly(aRect,GetEckenradius()));
- { // #40608# Nur Uebergangsweise bis zum neuen TakeContour()
- aXP.Remove(0,1);
- aXP[aXP.GetPointCount()-1]=aXP[0];
- }
-
- basegfx::B2DPolyPolygon aPolyPolygon(aXP.getB2DPolygon());
+ basegfx::B2DPolyPolygon aPolyPolygon(TakeXorPoly());
aPolyPolygon.removeDoublePoints();
- SdrObject* pRet = 0L;
+ SdrObject* pRet = 0;
// small correction: Do not create something when no fill and no line. To
// be sure to not damage something with non-text frames, do this only
// when used with bAddText==false from other converters
if((bAddText && !IsTextFrame()) || HasFill() || HasLine())
{
- pRet = ImpConvertMakeObj(aPolyPolygon, sal_True, bBezier);
+ pRet = ImpConvertMakeObj(aPolyPolygon, true, bBezier);
}
if(bAddText)
@@ -607,16 +502,5 @@ SdrObject* SdrRectObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
return pRet;
}
-void SdrRectObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
-{
- SdrTextObj::Notify(rBC,rHint);
- SetXPolyDirty(); // wg. Eckenradius
-}
-
-void SdrRectObj::RestGeoData(const SdrObjGeoData& rGeo)
-{
- SdrTextObj::RestGeoData(rGeo);
- SetXPolyDirty();
-}
-
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index e330c993db09..769d0a702bde 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -25,7 +25,8 @@
#include "precompiled_svx.hxx"
#include <svx/svdotext.hxx>
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdpagv.hxx> // fuer Abfrage im Paint, ob das
#include <svx/svdview.hxx> // Objekt gerade editiert wird
#include <svx/svdpage.hxx> // und fuer AnimationHandler (Laufschrift)
@@ -63,29 +64,16 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <vcl/virdev.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/sdrtexthelpers.hxx>
//////////////////////////////////////////////////////////////////////////////
using namespace com::sun::star;
//////////////////////////////////////////////////////////////////////////////
-// #104018# replace macros above with type-safe methods
-inline double ImplTwipsToMM(double fVal) { return (fVal * (127.0 / 72.0)); }
-inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@ @@@@@ @@@@@@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@@ @@ @@ @@ @@@@@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
// BaseProperties section
sdr::properties::BaseProperties* SdrTextObj::CreateObjectSpecificProperties()
@@ -103,261 +91,172 @@ sdr::contact::ViewContact* SdrTextObj::CreateObjectSpecificViewContact()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrTextObj,SdrAttrObj);
-
-SdrTextObj::SdrTextObj()
-: SdrAttrObj(),
- mpText(NULL),
- pEdtOutl(NULL),
- pFormTextBoundRect(NULL),
- eTextKind(OBJ_TEXT)
-{
- bTextSizeDirty=sal_False;
- bTextFrame=sal_False;
- bNoShear=sal_False;
- bNoRotate=sal_False;
- bNoMirror=sal_False;
- bDisableAutoWidthOnDragging=sal_False;
-
- // #101684#
- mbInEditMode = sal_False;
-
- // #111096#
- mbTextHidden = sal_False;
-
- // #111096#
- mbTextAnimationAllowed = sal_True;
-
- // #108784#
- maTextEditOffset = Point(0, 0);
-
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_True;
-}
-
-SdrTextObj::SdrTextObj(const Rectangle& rNewRect)
-: SdrAttrObj(),
- aRect(rNewRect),
- mpText(NULL),
- pEdtOutl(NULL),
- pFormTextBoundRect(NULL)
-{
- bTextSizeDirty=sal_False;
- bTextFrame=sal_False;
- bNoShear=sal_False;
- bNoRotate=sal_False;
- bNoMirror=sal_False;
- bDisableAutoWidthOnDragging=sal_False;
- ImpJustifyRect(aRect);
+SdrTextObj::SdrTextObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform,
+ SdrObjKind eNewTextKind,
+ bool bIsTextFrame)
+: SdrAttrObj(rSdrModel, rTransform),
+ mpText(0),
+ pEdtOutl(0),
+ eTextKind(eNewTextKind),
+ maTextEditOffset()
+{
+ bTextSizeDirty = false;
+ bTextFrame = bIsTextFrame;
+ bNoShear = true;
+ bNoRotate = false;
+ bNoMirror = true;
+ bDisableAutoWidthOnDragging = false;
// #101684#
- mbInEditMode = sal_False;
-
- // #111096#
- mbTextHidden = sal_False;
+ mbInEditMode = false;
// #111096#
mbTextAnimationAllowed = sal_True;
-
- // #108784#
- maTextEditOffset = Point(0, 0);
-
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_True;
}
-SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind)
-: SdrAttrObj(),
- mpText(NULL),
- pEdtOutl(NULL),
- pFormTextBoundRect(NULL),
- eTextKind(eNewTextKind)
+SdrTextObj::~SdrTextObj()
{
- bTextSizeDirty=sal_False;
- bTextFrame=sal_True;
- bNoShear=sal_True;
- bNoRotate=sal_False;
- bNoMirror=sal_True;
- bDisableAutoWidthOnDragging=sal_False;
-
- // #101684#
- mbInEditMode = sal_False;
-
- // #111096#
- mbTextHidden = sal_False;
-
- // #111096#
- mbTextAnimationAllowed = sal_True;
-
- // #108784#
- maTextEditOffset = Point(0, 0);
+ if(mpText)
+ {
+ delete mpText;
+ }
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_True;
+ ImpLinkAbmeldung();
}
-SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect)
-: SdrAttrObj(),
- aRect(rNewRect),
- mpText(NULL),
- pEdtOutl(NULL),
- pFormTextBoundRect(NULL),
- eTextKind(eNewTextKind)
+void SdrTextObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- bTextSizeDirty=sal_False;
- bTextFrame=sal_True;
- bNoShear=sal_True;
- bNoRotate=sal_False;
- bNoMirror=sal_True;
- bDisableAutoWidthOnDragging=sal_False;
- ImpJustifyRect(aRect);
+ if(this != &rSource)
+ {
+ const SdrTextObj* pSource = dynamic_cast< const SdrTextObj* >(&rSource);
- // #101684#
- mbInEditMode = sal_False;
+ if(pSource)
+ {
+ // call parent
+ SdrAttrObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ eTextKind = pSource->eTextKind;
+ bTextFrame = pSource->bTextFrame;
+ aTextSize = pSource->aTextSize;
+ bTextSizeDirty = pSource->bTextSizeDirty;
+ bNoShear = pSource->bNoShear;
+ bNoRotate = pSource->bNoRotate;
+ bNoMirror = pSource->bNoMirror;
+ bDisableAutoWidthOnDragging = pSource->bDisableAutoWidthOnDragging;
+ OutlinerParaObject* pNewOutlinerParaObject = 0;
+ SdrText* pText = getActiveText();
+
+ if(pText && pSource->HasText())
+ {
+ const Outliner* pEO = pSource->pEdtOutl;
- // #111096#
- mbTextHidden = sal_False;
+ if(pEO)
+ {
+ pNewOutlinerParaObject = pEO->CreateParaObject();
+ }
+ else
+ {
+ pNewOutlinerParaObject = new OutlinerParaObject(*pSource->getActiveText()->GetOutlinerParaObject());
+ }
+ }
- // #111096#
- mbTextAnimationAllowed = sal_True;
+ mpText->SetOutlinerParaObject(pNewOutlinerParaObject);
- // #108784#
- maTextEditOffset = Point(0, 0);
+ if(pNewOutlinerParaObject && &rSource.getSdrModelFromSdrObject() != &getSdrModelFromSdrObject())
+ {
+ // It is a clone to another model
+ mpText->ImpModelChange(rSource.getSdrModelFromSdrObject(), getSdrModelFromSdrObject());
+ }
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_True;
+ ImpSetTextStyleSheetListeners();
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
}
-SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat)
-: SdrAttrObj(),
- aRect(rNewRect),
- mpText(NULL),
- pEdtOutl(NULL),
- pFormTextBoundRect(NULL),
- eTextKind(eNewTextKind)
+SdrObject* SdrTextObj::CloneSdrObject(SdrModel* pTargetModel) const
{
- bTextSizeDirty=sal_False;
- bTextFrame=sal_True;
- bNoShear=sal_True;
- bNoRotate=sal_False;
- bNoMirror=sal_True;
- bDisableAutoWidthOnDragging=sal_False;
- ImpJustifyRect(aRect);
-
- NbcSetText(rInput, rBaseURL, eFormat);
-
- // #101684#
- mbInEditMode = sal_False;
-
- // #111096#
- mbTextHidden = sal_False;
-
- // #111096#
- mbTextAnimationAllowed = sal_True;
+ SdrTextObj* pClone = new SdrTextObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
- // #108784#
- maTextEditOffset = Point(0, 0);
-
- // #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_True;
+ return pClone;
}
-SdrTextObj::~SdrTextObj()
+bool SdrTextObj::DoesSupportTextIndentingOnLineWidthChange() const
{
- if( pModel )
- {
- SdrOutliner& rOutl = pModel->GetHitTestOutliner();
- if( rOutl.GetTextObj() == this )
- rOutl.SetTextObj( NULL );
- }
-
- if(mpText!=NULL)
- delete mpText;
-
- if (pFormTextBoundRect!=NULL)
- delete pFormTextBoundRect;
-
- ImpLinkAbmeldung();
+ return true;
}
void SdrTextObj::FitFrameToTextSize()
{
- DBG_ASSERT(pModel!=NULL,"SdrTextObj::FitFrameToTextSize(): pModel=NULL!");
- ImpJustifyRect(aRect);
-
SdrText* pText = getActiveText();
- if( pText!=NULL && pText->GetOutlinerParaObject() && pModel!=NULL)
+
+ if( pText && pText->GetOutlinerParaObject())
{
SdrOutliner& rOutliner=ImpGetDrawOutliner();
- rOutliner.SetPaperSize(Size(aRect.Right()-aRect.Left(),aRect.Bottom()-aRect.Top()));
- rOutliner.SetUpdateMode(sal_True);
+ const Rectangle aLogicRect(sdr::legacy::GetLogicRect(*this));
+
+ rOutliner.SetPaperSize(Size(aLogicRect.Right()-aLogicRect.Left(),aLogicRect.Bottom()-aLogicRect.Top()));
+ rOutliner.SetUpdateMode(true);
rOutliner.SetText(*pText->GetOutlinerParaObject());
- Rectangle aTextRect;
+
Size aNewSize(rOutliner.CalcTextSize());
+
rOutliner.Clear();
aNewSize.Width()++; // wegen evtl. Rundungsfehler
aNewSize.Width()+=GetTextLeftDistance()+GetTextRightDistance();
aNewSize.Height()+=GetTextUpperDistance()+GetTextLowerDistance();
- Rectangle aNewRect(aRect);
+ Rectangle aNewRect(aLogicRect);
aNewRect.SetSize(aNewSize);
- ImpJustifyRect(aNewRect);
- if (aNewRect!=aRect) {
- SetLogicRect(aNewRect);
+
+ if (aNewRect!=aLogicRect)
+ {
+ sdr::legacy::SetLogicRect(*this, aNewRect);
}
}
}
-void SdrTextObj::NbcSetText(const XubString& rStr)
+void SdrTextObj::SetText(const XubString& rStr)
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
SdrOutliner& rOutliner=ImpGetDrawOutliner();
+
rOutliner.SetStyleSheet( 0, GetStyleSheet());
- //OutputDevice* pRef1=rOutliner.GetRefDevice();
- rOutliner.SetUpdateMode(sal_True);
+ rOutliner.SetUpdateMode(true);
rOutliner.SetText(rStr,rOutliner.GetParagraph( 0 ));
+
OutlinerParaObject* pNewText=rOutliner.CreateParaObject();
Size aSiz(rOutliner.CalcTextSize());
- //OutputDevice* pRef2=rOutliner.GetRefDevice();
+
rOutliner.Clear();
- NbcSetOutlinerParaObject(pNewText);
+ SetOutlinerParaObject(pNewText);
aTextSize=aSiz;
- bTextSizeDirty=sal_False;
-}
-
-void SdrTextObj::SetText(const XubString& rStr)
-{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetText(rStr);
+ bTextSizeDirty=false;
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- //if (GetBoundRect()!=aBoundRect0) {
- // SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
- //}
}
-void SdrTextObj::NbcSetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat)
+void SdrTextObj::SetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat)
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
SdrOutliner& rOutliner=ImpGetDrawOutliner();
rOutliner.SetStyleSheet( 0, GetStyleSheet());
rOutliner.Read(rInput,rBaseURL,eFormat);
OutlinerParaObject* pNewText=rOutliner.CreateParaObject();
- rOutliner.SetUpdateMode(sal_True);
+ rOutliner.SetUpdateMode(true);
Size aSiz(rOutliner.CalcTextSize());
rOutliner.Clear();
- NbcSetOutlinerParaObject(pNewText);
+ SetOutlinerParaObject(pNewText);
aTextSize=aSiz;
- bTextSizeDirty=sal_False;
-}
-
-void SdrTextObj::SetText(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat)
-{
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- NbcSetText(rInput,rBaseURL,eFormat);
+ bTextSizeDirty=false;
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
const Size& SdrTextObj::GetTextSize() const
@@ -370,24 +269,25 @@ const Size& SdrTextObj::GetTextSize() const
{
SdrOutliner& rOutliner=ImpGetDrawOutliner();
rOutliner.SetText(*pText->GetOutlinerParaObject());
- rOutliner.SetUpdateMode(sal_True);
+ rOutliner.SetUpdateMode(true);
aSiz=rOutliner.CalcTextSize();
rOutliner.Clear();
}
// 2x casting auf nonconst
((SdrTextObj*)this)->aTextSize=aSiz;
- ((SdrTextObj*)this)->bTextSizeDirty=sal_False;
+ ((SdrTextObj*)this)->bTextSizeDirty=false;
}
+
return aTextSize;
}
-FASTBOOL SdrTextObj::IsAutoGrowHeight() const
+bool SdrTextObj::IsAutoGrowHeight() const
{
if(!bTextFrame)
- return sal_False; // AutoGrow nur bei TextFrames
+ return false; // AutoGrow nur bei TextFrames
const SfxItemSet& rSet = GetObjectItemSet();
- sal_Bool bRet = ((SdrTextAutoGrowHeightItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
+ bool bRet = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
if(bRet)
{
@@ -399,23 +299,24 @@ FASTBOOL SdrTextObj::IsAutoGrowHeight() const
if(eDirection == SDRTEXTANI_UP || eDirection == SDRTEXTANI_DOWN)
{
- bRet = sal_False;
+ bRet = false;
}
}
}
+
return bRet;
}
-FASTBOOL SdrTextObj::IsAutoGrowWidth() const
+bool SdrTextObj::IsAutoGrowWidth() const
{
if(!bTextFrame)
- return sal_False; // AutoGrow nur bei TextFrames
+ return false; // AutoGrow nur bei TextFrames
const SfxItemSet& rSet = GetObjectItemSet();
- sal_Bool bRet = ((SdrTextAutoGrowHeightItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH))).GetValue();
+ bool bRet = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH))).GetValue();
// #101684#
- sal_Bool bInEditMOde = IsInEditMode();
+ bool bInEditMOde = IsInEditMode();
if(!bInEditMOde && bRet)
{
@@ -427,7 +328,7 @@ FASTBOOL SdrTextObj::IsAutoGrowWidth() const
if(eDirection == SDRTEXTANI_LEFT || eDirection == SDRTEXTANI_RIGHT)
{
- bRet = sal_False;
+ bRet = false;
}
}
}
@@ -447,7 +348,7 @@ SdrTextHorzAdjust SdrTextObj::GetTextHorizontalAdjust(const SfxItemSet& rSet) co
SdrTextHorzAdjust eRet = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue();
// #101684#
- sal_Bool bInEditMode = IsInEditMode();
+ bool bInEditMode = IsInEditMode();
if(!bInEditMode && eRet == SDRTEXTHORZADJUST_BLOCK)
{
@@ -479,7 +380,7 @@ SdrTextVertAdjust SdrTextObj::GetTextVerticalAdjust(const SfxItemSet& rSet) cons
// #103516# Take care for vertical text animation here
SdrTextVertAdjust eRet = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue();
- sal_Bool bInEditMode = IsInEditMode();
+ bool bInEditMode = IsInEditMode();
// #103516# Take care for vertical text animation here
if(!bInEditMode && eRet == SDRTEXTVERTADJUST_BLOCK)
@@ -500,48 +401,38 @@ SdrTextVertAdjust SdrTextObj::GetTextVerticalAdjust(const SfxItemSet& rSet) cons
return eRet;
} // defaults: TOP fuer Textrahmen, CENTER fuer beschriftete Grafikobjekte
-void SdrTextObj::ImpJustifyRect(Rectangle& rRect) const
+void SdrTextObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- if (!rRect.IsEmpty()) {
- rRect.Justify();
- if (rRect.Left()==rRect.Right()) rRect.Right()++;
- if (rRect.Top()==rRect.Bottom()) rRect.Bottom()++;
- }
-}
+ bool bNoTextFrame = !IsTextFrame();
+ rInfo.mbResizeFreeAllowed = bNoTextFrame;
-void SdrTextObj::ImpCheckShear()
-{
- if (bNoShear && aGeo.nShearWink!=0) {
- aGeo.nShearWink=0;
- aGeo.nTan=0;
+ if(!rInfo.mbResizeFreeAllowed)
+ {
+ sal_Int32 nAngle(sdr::legacy::GetRotateAngle(*this));
+ rInfo.mbResizeFreeAllowed = (0 == nAngle % 9000);
}
-}
-void SdrTextObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
-{
- FASTBOOL bNoTextFrame=!IsTextFrame();
- rInfo.bResizeFreeAllowed=bNoTextFrame || aGeo.nDrehWink%9000==0;
- rInfo.bResizePropAllowed=sal_True;
- rInfo.bRotateFreeAllowed=sal_True;
- rInfo.bRotate90Allowed =sal_True;
- rInfo.bMirrorFreeAllowed=bNoTextFrame;
- rInfo.bMirror45Allowed =bNoTextFrame;
- rInfo.bMirror90Allowed =bNoTextFrame;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = true;
+ rInfo.mbRotate90Allowed = true;
+ rInfo.mbMirrorFreeAllowed = bNoTextFrame;
+ rInfo.mbMirror45Allowed = bNoTextFrame;
+ rInfo.mbMirror90Allowed = bNoTextFrame;
// allow transparence
- rInfo.bTransparenceAllowed = sal_True;
+ rInfo.mbTransparenceAllowed = true;
// gradient depends on fillstyle
XFillStyle eFillStyle = ((XFillStyleItem&)(GetObjectItem(XATTR_FILLSTYLE))).GetValue();
- rInfo.bGradientAllowed = (eFillStyle == XFILL_GRADIENT);
- rInfo.bShearAllowed =bNoTextFrame;
- rInfo.bEdgeRadiusAllowed=sal_True;
- FASTBOOL bCanConv=ImpCanConvTextToCurve();
- rInfo.bCanConvToPath =bCanConv;
- rInfo.bCanConvToPoly =bCanConv;
- rInfo.bCanConvToPathLineToArea=bCanConv;
- rInfo.bCanConvToPolyLineToArea=bCanConv;
- rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
+ rInfo.mbGradientAllowed = (XFILL_GRADIENT == eFillStyle);
+ rInfo.mbShearAllowed = bNoTextFrame;
+ rInfo.mbEdgeRadiusAllowed = true;
+ bool bCanConv = ImpCanConvTextToCurve();
+ rInfo.mbCanConvToPath = bCanConv;
+ rInfo.mbCanConvToPoly = bCanConv;
+ rInfo.mbCanConvToPathLineToArea = bCanConv;
+ rInfo.mbCanConvToPolyLineToArea = bCanConv;
+ rInfo.mbCanConvToContour = (rInfo.mbCanConvToPoly || LineGeometryUsageIsNecessary());
}
sal_uInt16 SdrTextObj::GetObjIdentifier() const
@@ -549,14 +440,14 @@ sal_uInt16 SdrTextObj::GetObjIdentifier() const
return sal_uInt16(eTextKind);
}
-bool SdrTextObj::HasTextImpl( SdrOutliner* pOutliner )
+bool SdrTextObj::HasTextImpl( const SdrOutliner* pOutliner )
{
bool bRet=false;
if(pOutliner)
{
Paragraph* p1stPara=pOutliner->GetParagraph( 0 );
- sal_uIntPtr nParaAnz=pOutliner->GetParagraphCount();
- if(p1stPara==NULL)
+ sal_uInt32 nParaAnz = pOutliner->GetParagraphCount();
+ if(p1stPara==0)
nParaAnz=0;
if(nParaAnz==1)
@@ -573,367 +464,224 @@ bool SdrTextObj::HasTextImpl( SdrOutliner* pOutliner )
return bRet;
}
-FASTBOOL SdrTextObj::HasEditText() const
+bool SdrTextObj::HasEditText() const
{
return HasTextImpl( pEdtOutl );
}
-void SdrTextObj::SetPage(SdrPage* pNewPage)
-{
- FASTBOOL bRemove=pNewPage==NULL && pPage!=NULL;
- FASTBOOL bInsert=pNewPage!=NULL && pPage==NULL;
- FASTBOOL bLinked=IsLinkedText();
-
- if (bLinked && bRemove) {
- ImpLinkAbmeldung();
- }
-
- SdrAttrObj::SetPage(pNewPage);
-
- if (bLinked && bInsert) {
- ImpLinkAnmeldung();
- }
-}
-
-void SdrTextObj::SetModel(SdrModel* pNewModel)
+void SdrTextObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
{
- SdrModel* pOldModel=pModel;
- bool bLinked=IsLinkedText();
- bool bChg=pNewModel!=pModel;
-
- if (bLinked && bChg)
+ if(pOldPage != pNewPage)
{
- ImpLinkAbmeldung();
- }
+ const bool bRemove(!pNewPage && pOldPage);
+ const bool bInsert(pNewPage && !pOldPage);
+ const bool bLinked(IsLinkedText());
- SdrAttrObj::SetModel(pNewModel);
+ if(bLinked && bRemove)
+ {
+ ImpLinkAbmeldung();
+ }
- if( bChg )
- {
- if( pNewModel != 0 && pOldModel != 0 )
- SetTextSizeDirty();
+ // call parent
+ SdrAttrObj::handlePageChange(pOldPage, pNewPage);
- sal_Int32 nCount = getTextCount();
- for( sal_Int32 nText = 0; nText < nCount; nText++ )
+ if(bLinked && bInsert)
{
- SdrText* pText = getText( nText );
- if( pText )
- pText->SetModel( pNewModel );
+ ImpLinkAnmeldung();
}
}
-
- if (bLinked && bChg)
- {
- ImpLinkAnmeldung();
- }
-}
-
-FASTBOOL SdrTextObj::NbcSetEckenradius(long nRad)
-{
- SetObjectItem(SdrEckenradiusItem(nRad));
- return sal_True;
}
-FASTBOOL SdrTextObj::NbcSetAutoGrowHeight(bool bAuto)
+void SdrTextObj::SetEdgeRadius(sal_Int32 nRad)
{
- if(bTextFrame)
+ if(nRad != GetEdgeRadius())
{
- SetObjectItem(SdrTextAutoGrowHeightItem(bAuto));
- return sal_True;
+ SetObjectItem(SdrMetricItem(SDRATTR_ECKENRADIUS, nRad));
}
- return sal_False;
}
-FASTBOOL SdrTextObj::NbcSetMinTextFrameHeight(long nHgt)
+bool SdrTextObj::SetMinTextFrameHeight(sal_Int32 nHgt)
{
- if( bTextFrame && ( !pModel || !pModel->isLocked() ) ) // SJ: #i44922#
+ if( bTextFrame )
{
- SetObjectItem(SdrTextMinFrameHeightItem(nHgt));
-
- // #84974# use bDisableAutoWidthOnDragging as
- // bDisableAutoHeightOnDragging if vertical.
- if(IsVerticalWriting() && bDisableAutoWidthOnDragging)
+ if( !getSdrModelFromSdrObject().isLocked() )
{
- bDisableAutoWidthOnDragging = sal_False;
- SetObjectItem(SdrTextAutoGrowHeightItem(sal_False));
- }
+ SetObjectItem(SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, nHgt));
- return sal_True;
- }
- return sal_False;
-}
+ // #84974# use bDisableAutoWidthOnDragging as
+ // bDisableAutoHeightOnDragging if vertical.
+ if(IsVerticalWriting() && bDisableAutoWidthOnDragging)
+ {
+ bDisableAutoWidthOnDragging = false;
+ SetObjectItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
+ }
-FASTBOOL SdrTextObj::NbcSetMaxTextFrameHeight(long nHgt)
-{
- if(bTextFrame)
- {
- SetObjectItem(SdrTextMaxFrameHeightItem(nHgt));
- return sal_True;
+ return true;
+ }
}
- return sal_False;
-}
-FASTBOOL SdrTextObj::NbcSetAutoGrowWidth(bool bAuto)
-{
- if(bTextFrame)
- {
- SetObjectItem(SdrTextAutoGrowWidthItem(bAuto));
- return sal_True;
- }
- return sal_False;
+ return false;
}
-FASTBOOL SdrTextObj::NbcSetMinTextFrameWidth(long nWdt)
+bool SdrTextObj::SetMinTextFrameWidth(sal_Int32 nWdt)
{
- if( bTextFrame && ( !pModel || !pModel->isLocked() ) ) // SJ: #i44922#
+ if(bTextFrame)
{
- SetObjectItem(SdrTextMinFrameWidthItem(nWdt));
-
- // #84974# use bDisableAutoWidthOnDragging only
- // when not vertical.
- if(!IsVerticalWriting() && bDisableAutoWidthOnDragging)
+ if( !getSdrModelFromSdrObject().isLocked() )
{
- bDisableAutoWidthOnDragging = sal_False;
- SetObjectItem(SdrTextAutoGrowWidthItem(sal_False));
- }
+ SetObjectItem(SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, nWdt));
- return sal_True;
- }
- return sal_False;
-}
+ // #84974# use bDisableAutoWidthOnDragging only
+ // when not vertical.
+ if(!IsVerticalWriting() && bDisableAutoWidthOnDragging)
+ {
+ bDisableAutoWidthOnDragging = false;
+ SetObjectItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
+ }
-FASTBOOL SdrTextObj::NbcSetMaxTextFrameWidth(long nWdt)
-{
- if(bTextFrame)
- {
- SetObjectItem(SdrTextMaxFrameWidthItem(nWdt));
- return sal_True;
+ return true;
+ }
}
- return sal_False;
-}
-FASTBOOL SdrTextObj::NbcSetFitToSize(SdrFitToSizeType eFit)
-{
- if(bTextFrame)
- {
- SetObjectItem(SdrTextFitToSizeTypeItem(eFit));
- return sal_True;
- }
- return sal_False;
+ return false;
}
-void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAnchorRect, sal_Bool bLineWidth ) const
+basegfx::B2DRange SdrTextObj::getUnifiedTextRange() const
{
- basegfx::B2DPolyPolygon aXorPolyPolygon(TakeXorPoly());
- basegfx::B2DPolyPolygon* pContourPolyPolygon = 0L;
- basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix(
- -rAnchorRect.Left(), -rAnchorRect.Top()));
+ // per default the text range is the whole object range
+ basegfx::B2DRange aRetval(basegfx::B2DRange::getUnitB2DRange());
- if(aGeo.nDrehWink)
- {
- // Unrotate!
- aMatrix.rotate(-aGeo.nDrehWink * nPi180);
- }
-
- aXorPolyPolygon.transform(aMatrix);
+ const sal_Int32 nLeftDist(GetTextLeftDistance());
+ const sal_Int32 nRightDist(GetTextRightDistance());
+ const sal_Int32 nUpperDist(GetTextUpperDistance());
+ const sal_Int32 nLowerDist(GetTextLowerDistance());
- if( bLineWidth )
+ if(nLeftDist || nRightDist || nUpperDist || nLowerDist)
{
- // Strichstaerke beruecksichtigen
- // Beim Hittest muss das unterbleiben (Performance!)
- pContourPolyPolygon = new basegfx::B2DPolyPolygon();
+ const double fAbsInvScaleX(basegfx::fTools::equalZero(getSdrObjectScale().getX()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getX()));
+ const double fAbsInvScaleY(basegfx::fTools::equalZero(getSdrObjectScale().getY()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getY()));
- // #86258# test if shadow needs to be avoided for TakeContour()
- const SfxItemSet& rSet = GetObjectItemSet();
- sal_Bool bShadowOn = ((SdrShadowItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue();
-
- // #i33696#
- // Remember TextObject currently set at the DrawOutliner, it WILL be
- // replaced during calculating the outline since it uses an own paint
- // and that one uses the DrawOutliner, too.
- const SdrTextObj* pLastTextObject = rOutliner.GetTextObj();
-
- if(bShadowOn)
- {
- // #86258# force shadow off
- SdrObject* pCopy = Clone();
- pCopy->SetMergedItem(SdrShadowItem(sal_False));
- *pContourPolyPolygon = pCopy->TakeContour();
- SdrObject::Free( pCopy );
- }
- else
- {
- *pContourPolyPolygon = TakeContour();
- }
-
- // #i33696#
- // restore remembered text object
- if(pLastTextObject != rOutliner.GetTextObj())
- {
- rOutliner.SetTextObj(pLastTextObject);
- }
-
- pContourPolyPolygon->transform(aMatrix);
+ // add/remove the text distances
+ return basegfx::B2DRange(
+ aRetval.getMinX() + (nLeftDist * fAbsInvScaleX),
+ aRetval.getMinY() + (nUpperDist * fAbsInvScaleY),
+ aRetval.getMaxX() - (nRightDist * fAbsInvScaleX),
+ aRetval.getMaxY() - (nLowerDist * fAbsInvScaleY));
}
- rOutliner.SetPolygon(aXorPolyPolygon, pContourPolyPolygon);
-}
-
-void SdrTextObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
-{
- rRect=aRect;
+ return aRetval;
}
-void SdrTextObj::TakeTextAnchorRect(Rectangle& rAnchorRect) const
+void SdrTextObj::TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const
{
- long nLeftDist=GetTextLeftDistance();
- long nRightDist=GetTextRightDistance();
- long nUpperDist=GetTextUpperDistance();
- long nLowerDist=GetTextLowerDistance();
- Rectangle aAnkRect(aRect); // Rect innerhalb dem geankert wird
- FASTBOOL bFrame=IsTextFrame();
- if (!bFrame) {
- TakeUnrotatedSnapRect(aAnkRect);
- }
- Point aRotateRef(aAnkRect.TopLeft());
- aAnkRect.Left()+=nLeftDist;
- aAnkRect.Top()+=nUpperDist;
- aAnkRect.Right()-=nRightDist;
- aAnkRect.Bottom()-=nLowerDist;
-
- // #108816#
- // Since sizes may be bigger than the object bounds it is necessary to
- // justify the rect now.
- ImpJustifyRect(aAnkRect);
-
- if (bFrame) {
- // !!! hier noch etwas verfeinern !!!
- if (aAnkRect.GetWidth()<2) aAnkRect.Right()=aAnkRect.Left()+1; // Mindestgroesse 2
- if (aAnkRect.GetHeight()<2) aAnkRect.Bottom()=aAnkRect.Top()+1; // Mindestgroesse 2
- }
- if (aGeo.nDrehWink!=0) {
- Point aTmpPt(aAnkRect.TopLeft());
- RotatePoint(aTmpPt,aRotateRef,aGeo.nSin,aGeo.nCos);
- aTmpPt-=aAnkRect.TopLeft();
- aAnkRect.Move(aTmpPt.X(),aTmpPt.Y());
- }
- rAnchorRect=aAnkRect;
-}
+ // get TextRange without shear, rotate and mirror, just scaled
+ // and centered in logic coordinates
+ rAnchorRange = getScaledCenteredTextRange(*this);
-void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText,
- Rectangle* pAnchorRect, sal_Bool bLineWidth ) const
-{
- Rectangle aAnkRect; // Rect innerhalb dem geankert wird
- TakeTextAnchorRect(aAnkRect);
+ // Rect innerhalb dem geankert wird
SdrTextVertAdjust eVAdj=GetTextVerticalAdjust();
SdrTextHorzAdjust eHAdj=GetTextHorizontalAdjust();
SdrTextAniKind eAniKind=GetTextAniKind();
SdrTextAniDirection eAniDirection=GetTextAniDirection();
-
SdrFitToSizeType eFit=GetFitToSize();
- FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- FASTBOOL bContourFrame=IsContourTextFrame();
-
- FASTBOOL bFrame=IsTextFrame();
- sal_uIntPtr nStat0=rOutliner.GetControlWord();
+ bool bFitToSize = (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
+ bool bContourFrame = IsContourTextFrame();
+ bool bFrame = IsTextFrame();
+ sal_uInt32 nStat0 = rOutliner.GetControlWord();
Size aNullSize;
+
if (!bContourFrame)
{
rOutliner.SetControlWord(nStat0|EE_CNTRL_AUTOPAGESIZE);
rOutliner.SetMinAutoPaperSize(aNullSize);
rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000));
- }
- if (!bFitToSize && !bContourFrame)
- {
- long nAnkWdt=aAnkRect.GetWidth();
- long nAnkHgt=aAnkRect.GetHeight();
- if (bFrame)
+ if(!bFitToSize)
{
- long nWdt=nAnkWdt;
- long nHgt=nAnkHgt;
+ const sal_Int32 nAnkWdt(basegfx::fround(rAnchorRange.getWidth()));
+ const sal_Int32 nAnkHgt(basegfx::fround(rAnchorRange.getHeight()));
- // #101684#
- sal_Bool bInEditMode = IsInEditMode();
-
- if (!bInEditMode && (eAniKind==SDRTEXTANI_SCROLL || eAniKind==SDRTEXTANI_ALTERNATE || eAniKind==SDRTEXTANI_SLIDE))
+ if (bFrame)
{
- // Grenzenlose Papiergroesse fuer Laufschrift
- if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nWdt=1000000;
- if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nHgt=1000000;
+ sal_Int32 nWdt(nAnkWdt);
+ sal_Int32 nHgt(nAnkHgt);
+
+ // #101684#
+ bool bInEditMode = IsInEditMode();
+
+ if (!bInEditMode && (eAniKind==SDRTEXTANI_SCROLL || eAniKind==SDRTEXTANI_ALTERNATE || eAniKind==SDRTEXTANI_SLIDE))
+ {
+ // Grenzenlose Papiergroesse fuer Laufschrift
+ if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nWdt=1000000;
+ if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nHgt=1000000;
+ }
+
+ // #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
+ if(IsVerticalWriting())
+ {
+ nWdt = 1000000;
+ }
+ else
+ {
+ nHgt = 1000000;
+ }
+
+ rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt));
}
- // #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
- if(IsVerticalWriting())
+ // #103516# New try with _BLOCK for hor and ver after completely
+ // supporting full width for vertical text.
+ if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !IsVerticalWriting())
{
- nWdt = 1000000;
+ rOutliner.SetMinAutoPaperSize(Size(nAnkWdt, 0));
}
- else
+
+ if(SDRTEXTVERTADJUST_BLOCK == eVAdj && IsVerticalWriting())
{
- nHgt = 1000000;
+ rOutliner.SetMinAutoPaperSize(Size(0, nAnkHgt));
}
-
- rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt));
- }
-
- // #103516# New try with _BLOCK for hor and ver after completely
- // supporting full width for vertical text.
- if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !IsVerticalWriting())
- {
- rOutliner.SetMinAutoPaperSize(Size(nAnkWdt, 0));
- }
-
- if(SDRTEXTVERTADJUST_BLOCK == eVAdj && IsVerticalWriting())
- {
- rOutliner.SetMinAutoPaperSize(Size(0, nAnkHgt));
}
}
rOutliner.SetPaperSize(aNullSize);
- if (bContourFrame)
- ImpSetContourPolygon( rOutliner, aAnkRect, bLineWidth );
// put text into the outliner, if available from the edit outliner
SdrText* pText = getActiveText();
OutlinerParaObject* pOutlinerParaObject = pText ? pText->GetOutlinerParaObject() : 0;
- OutlinerParaObject* pPara = (pEdtOutl && !bNoEditText) ? pEdtOutl->CreateParaObject() : pOutlinerParaObject;
+ OutlinerParaObject* pPara = pEdtOutl ? pEdtOutl->CreateParaObject() : pOutlinerParaObject;
if (pPara)
{
- sal_Bool bHitTest = sal_False;
- if( pModel )
- bHitTest = &pModel->GetHitTestOutliner() == &rOutliner;
-
const SdrTextObj* pTestObj = rOutliner.GetTextObj();
- if( !pTestObj || !bHitTest || pTestObj != this ||
- pTestObj->GetOutlinerParaObject() != pOutlinerParaObject )
- {
- if( bHitTest ) // #i33696# take back fix #i27510#
- {
- rOutliner.SetTextObj( this );
- rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
- }
- rOutliner.SetUpdateMode(sal_True);
+ if( !pTestObj || pTestObj != this || pTestObj->GetOutlinerParaObject() != pOutlinerParaObject )
+ {
+ rOutliner.SetTextObj( this );
+ rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+ rOutliner.SetUpdateMode(true);
rOutliner.SetText(*pPara);
}
}
else
{
- rOutliner.SetTextObj( NULL );
+ rOutliner.SetTextObj( 0 );
}
- if (pEdtOutl && !bNoEditText && pPara)
+ if (pEdtOutl && pPara)
+ {
delete pPara;
+ }
- rOutliner.SetUpdateMode(sal_True);
+ rOutliner.SetUpdateMode(true);
rOutliner.SetControlWord(nStat0);
if( pText )
+ {
pText->CheckPortionInfo(rOutliner);
+ }
- Point aTextPos(aAnkRect.TopLeft());
- Size aTextSiz(rOutliner.GetPaperSize()); // GetPaperSize() hat etwas Toleranz drauf, oder?
+ basegfx::B2DPoint aTextPos(rAnchorRange.getMinimum());
+ const basegfx::B2DVector aTextSiz(rOutliner.GetPaperSize().getWidth(), rOutliner.GetPaperSize().getHeight());
// #106653#
// For draw objects containing text correct hor/ver alignment if text is bigger
@@ -941,7 +689,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FAS
// formatted to the left edge (or top edge when vertical) of the draw object.
if(!IsTextFrame())
{
- if(aAnkRect.GetWidth() < aTextSiz.Width() && !IsVerticalWriting())
+ if(rAnchorRange.getWidth() < aTextSiz.getX() && !IsVerticalWriting())
{
// #110129#
// Horizontal case here. Correct only if eHAdj == SDRTEXTHORZADJUST_BLOCK,
@@ -952,7 +700,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FAS
}
}
- if(aAnkRect.GetHeight() < aTextSiz.Height() && IsVerticalWriting())
+ if(rAnchorRange.getHeight() < aTextSiz.getY() && IsVerticalWriting())
{
// #110129#
// Vertical case here. Correct only if eHAdj == SDRTEXTVERTADJUST_BLOCK,
@@ -964,37 +712,51 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FAS
}
}
- if (eHAdj==SDRTEXTHORZADJUST_CENTER || eHAdj==SDRTEXTHORZADJUST_RIGHT)
+ if(SDRTEXTHORZADJUST_CENTER == eHAdj || SDRTEXTHORZADJUST_RIGHT == eHAdj)
{
- long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width();
- if (eHAdj==SDRTEXTHORZADJUST_CENTER)
- aTextPos.X()+=nFreeWdt/2;
- if (eHAdj==SDRTEXTHORZADJUST_RIGHT)
- aTextPos.X()+=nFreeWdt;
+ const double fFreeWdt(rAnchorRange.getWidth() - aTextSiz.getX());
+
+ if(SDRTEXTHORZADJUST_CENTER == eHAdj)
+ {
+ aTextPos.setX(aTextPos.getX() + (fFreeWdt * 0.5));
+ }
+ else if(SDRTEXTHORZADJUST_RIGHT == eHAdj)
+ {
+ aTextPos.setX(aTextPos.getX() + fFreeWdt);
+ }
}
- if (eVAdj==SDRTEXTVERTADJUST_CENTER || eVAdj==SDRTEXTVERTADJUST_BOTTOM)
+
+ if(SDRTEXTVERTADJUST_CENTER == eVAdj || SDRTEXTVERTADJUST_BOTTOM == eVAdj)
{
- long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height();
- if (eVAdj==SDRTEXTVERTADJUST_CENTER)
- aTextPos.Y()+=nFreeHgt/2;
- if (eVAdj==SDRTEXTVERTADJUST_BOTTOM)
- aTextPos.Y()+=nFreeHgt;
- }
- if (aGeo.nDrehWink!=0)
- RotatePoint(aTextPos,aAnkRect.TopLeft(),aGeo.nSin,aGeo.nCos);
+ const double fFreeHgt(rAnchorRange.getHeight() - aTextSiz.getY());
- if (pAnchorRect)
- *pAnchorRect=aAnkRect;
+ if(SDRTEXTVERTADJUST_CENTER == eVAdj)
+ {
+ aTextPos.setY(aTextPos.getY() + (fFreeHgt * 0.5));
+ }
+ else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
+ {
+ aTextPos.setY(aTextPos.getY() + fFreeHgt);
+ }
+ }
- // rTextRect ist bei ContourFrame in einigen Faellen nicht korrekt
- rTextRect=Rectangle(aTextPos,aTextSiz);
- if (bContourFrame)
- rTextRect=aAnkRect;
+ if(bContourFrame)
+ {
+ basegfx::B2DPolyPolygon aContourOutline(getAlignedTextContourPolyPolygon(*this));
+ rTextRange = rAnchorRange = aContourOutline.getB2DRange();
+ aContourOutline.transform(basegfx::tools::createTranslateB2DHomMatrix(-aContourOutline.getB2DRange().getMinimum()));
+ rOutliner.SetPolygon(aContourOutline);
+ }
+ else
+ {
+ rOutliner.ClearPolygon();
+ rTextRange = basegfx::B2DRange(aTextPos, aTextPos + aTextSiz);
+ }
}
OutlinerParaObject* SdrTextObj::GetEditOutlinerParaObject() const
{
- OutlinerParaObject* pPara=NULL;
+ OutlinerParaObject* pPara=0;
if( HasTextImpl( pEdtOutl ) )
{
sal_uInt16 nParaAnz = static_cast< sal_uInt16 >( pEdtOutl->GetParagraphCount() );
@@ -1003,129 +765,18 @@ OutlinerParaObject* SdrTextObj::GetEditOutlinerParaObject() const
return pPara;
}
-void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& rTextRect, const Rectangle& rAnchorRect, Fraction& rFitXKorreg) const
+void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const basegfx::B2DRange& rTextRange, const basegfx::B2DRange& rAnchorRange) const
{
- OutputDevice* pOut = rOutliner.GetRefDevice();
- sal_Bool bNoStretching(sal_False);
-
- if(pOut && pOut->GetOutDevType() == OUTDEV_PRINTER)
- {
- // #35762#: Checken ob CharStretching ueberhaupt moeglich
- GDIMetaFile* pMtf = pOut->GetConnectMetaFile();
- UniString aTestString(sal_Unicode('J'));
-
- if(pMtf && (!pMtf->IsRecord() || pMtf->IsPause()))
- pMtf = NULL;
-
- if(pMtf)
- pMtf->Pause(sal_True);
-
- Font aFontMerk(pOut->GetFont());
- Font aTmpFont( OutputDevice::GetDefaultFont( DEFAULTFONT_SERIF, LANGUAGE_SYSTEM, DEFAULTFONT_FLAGS_ONLYONE ) );
-
- aTmpFont.SetSize(Size(0,100));
- pOut->SetFont(aTmpFont);
- Size aSize1(pOut->GetTextWidth(aTestString), pOut->GetTextHeight());
- aTmpFont.SetSize(Size(800,100));
- pOut->SetFont(aTmpFont);
- Size aSize2(pOut->GetTextWidth(aTestString), pOut->GetTextHeight());
- pOut->SetFont(aFontMerk);
-
- if(pMtf)
- pMtf->Pause(sal_False);
-
- bNoStretching = (aSize1 == aSize2);
-
-#ifdef WNT
- // #35762# Windows vergroessert bei Size(100,500) den Font proportional
- // Und das finden wir nicht so schoen.
- if(aSize2.Height() >= aSize1.Height() * 2)
- {
- bNoStretching = sal_True;
- }
-#endif
- }
- unsigned nLoopCount=0;
- FASTBOOL bNoMoreLoop=sal_False;
- long nXDiff0=0x7FFFFFFF;
- long nWantWdt=rAnchorRect.Right()-rAnchorRect.Left();
- long nIsWdt=rTextRect.Right()-rTextRect.Left();
- if (nIsWdt==0) nIsWdt=1;
-
- long nWantHgt=rAnchorRect.Bottom()-rAnchorRect.Top();
- long nIsHgt=rTextRect.Bottom()-rTextRect.Top();
- if (nIsHgt==0) nIsHgt=1;
-
- long nXTolPl=nWantWdt/100; // Toleranz +1%
- long nXTolMi=nWantWdt/25; // Toleranz -4%
- long nXKorr =nWantWdt/20; // Korrekturmasstab 5%
-
- long nX=(nWantWdt*100) /nIsWdt; // X-Stretching berechnen
- long nY=(nWantHgt*100) /nIsHgt; // Y-Stretching berechnen
- FASTBOOL bChkX=sal_True;
- FASTBOOL bChkY=sal_True;
- if (bNoStretching) { // #35762# evtl. nur proportional moeglich
- if (nX>nY) { nX=nY; bChkX=sal_False; }
- else { nY=nX; bChkY=sal_False; }
- }
-
- while (nLoopCount<5 && !bNoMoreLoop) {
- if (nX<0) nX=-nX;
- if (nX<1) { nX=1; bNoMoreLoop=sal_True; }
- if (nX>65535) { nX=65535; bNoMoreLoop=sal_True; }
-
- if (nY<0) nY=-nY;
- if (nY<1) { nY=1; bNoMoreLoop=sal_True; }
- if (nY>65535) { nY=65535; bNoMoreLoop=sal_True; }
-
- // exception, there is no text yet (horizontal case)
- if(nIsWdt <= 1)
- {
- nX = nY;
- bNoMoreLoop = sal_True;
- }
-
- // #87877# exception, there is no text yet (vertical case)
- if(nIsHgt <= 1)
- {
- nY = nX;
- bNoMoreLoop = sal_True;
- }
-
- rOutliner.SetGlobalCharStretching((sal_uInt16)nX,(sal_uInt16)nY);
- nLoopCount++;
- Size aSiz(rOutliner.CalcTextSize());
- long nXDiff=aSiz.Width()-nWantWdt;
- rFitXKorreg=Fraction(nWantWdt,aSiz.Width());
- if (((nXDiff>=nXTolMi || !bChkX) && nXDiff<=nXTolPl) || nXDiff==nXDiff0/*&& Abs(nYDiff)<=nYTol*/) {
- bNoMoreLoop=sal_True;
- } else {
- // Stretchingfaktoren korregieren
- long nMul=nWantWdt;
- long nDiv=aSiz.Width();
- if (Abs(nXDiff)<=2*nXKorr) {
- if (nMul>nDiv) nDiv+=(nMul-nDiv)/2; // und zwar nur um die haelfte des berechneten
- else nMul+=(nDiv-nMul)/2; // weil die EE ja eh wieder falsch rechnet
- }
- nX=nX*nMul/nDiv;
- if (bNoStretching) nY=nX;
- }
- nXDiff0=nXDiff;
- }
-}
+ const basegfx::B2DVector aOutlinerScale(
+ basegfx::fTools::equalZero(rTextRange.getWidth()) ? 1.0 : rTextRange.getWidth(),
+ basegfx::fTools::equalZero(rTextRange.getHeight()) ? 1.0 : rTextRange.getHeight());
-void SdrTextObj::StartTextAnimation(OutputDevice* /*pOutDev*/, const Point& /*rOffset*/, long /*nExtraData*/)
-{
- // #111096#
- // use new text animation
- SetTextAnimationAllowed(sal_True);
-}
+ // calculate global char stretching scale parameters. Use non-mirrored sizes
+ // to layout without mirroring
+ const double fScaleX(fabs(rAnchorRange.getWidth()) / aOutlinerScale.getX());
+ const double fScaleY(fabs(rAnchorRange.getHeight()) / aOutlinerScale.getY());
-void SdrTextObj::StopTextAnimation(OutputDevice* /*pOutDev*/, long /*nExtraData*/)
-{
- // #111096#
- // use new text animation
- SetTextAnimationAllowed(sal_False);
+ rOutliner.SetGlobalCharStretching((sal_Int16)basegfx::fround(fScaleX * 100.0), (sal_Int16)basegfx::fround(fScaleY * 100.0));
}
void SdrTextObj::TakeObjNameSingul(XubString& rName) const
@@ -1211,98 +862,13 @@ void SdrTextObj::TakeObjNamePlural(XubString& rName) const
} // switch
}
-void SdrTextObj::operator=(const SdrObject& rObj)
-{
- // call parent
- SdrObject::operator=(rObj);
-
- const SdrTextObj* pTextObj = dynamic_cast< const SdrTextObj* >( &rObj );
- if (pTextObj!=NULL)
- {
- aRect =pTextObj->aRect;
- aGeo =pTextObj->aGeo;
- eTextKind =pTextObj->eTextKind;
- bTextFrame=pTextObj->bTextFrame;
- aTextSize=pTextObj->aTextSize;
- bTextSizeDirty=pTextObj->bTextSizeDirty;
-
- // #101776# Not all of the necessary parameters were copied yet.
- bNoShear = pTextObj->bNoShear;
- bNoRotate = pTextObj->bNoRotate;
- bNoMirror = pTextObj->bNoMirror;
- bDisableAutoWidthOnDragging = pTextObj->bDisableAutoWidthOnDragging;
-
- OutlinerParaObject* pNewOutlinerParaObject = 0;
-
- SdrText* pText = getActiveText();
-
- if( pText && pTextObj->HasText() )
- {
- const Outliner* pEO=pTextObj->pEdtOutl;
- if (pEO!=NULL)
- {
- pNewOutlinerParaObject = pEO->CreateParaObject();
- }
- else
- {
- pNewOutlinerParaObject = new OutlinerParaObject(*pTextObj->getActiveText()->GetOutlinerParaObject());
- }
- }
-
- mpText->SetOutlinerParaObject( pNewOutlinerParaObject );
- ImpSetTextStyleSheetListeners();
- }
-}
-
basegfx::B2DPolyPolygon SdrTextObj::TakeXorPoly() const
{
- Polygon aPol(aRect);
- if (aGeo.nShearWink!=0) ShearPoly(aPol,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoly(aPol,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
-
- basegfx::B2DPolyPolygon aRetval;
- aRetval.append(aPol.getB2DPolygon());
- return aRetval;
-}
-
-basegfx::B2DPolyPolygon SdrTextObj::TakeContour() const
-{
- basegfx::B2DPolyPolygon aRetval(SdrAttrObj::TakeContour());
-
- // und nun noch ggf. das BoundRect des Textes dazu
- if ( pModel && GetOutlinerParaObject() && !IsFontwork() && !IsContourTextFrame() )
- {
- // #80328# using Clone()-Paint() strategy inside TakeContour() leaves a destroyed
- // SdrObject as pointer in DrawOutliner. Set *this again in fetching the outliner
- // in every case
- SdrOutliner& rOutliner=ImpGetDrawOutliner();
-
- Rectangle aAnchor2;
- Rectangle aR;
- TakeTextRect(rOutliner,aR,sal_False,&aAnchor2);
- rOutliner.Clear();
- SdrFitToSizeType eFit=GetFitToSize();
- FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- if (bFitToSize) aR=aAnchor2;
- Polygon aPol(aR);
- if (aGeo.nDrehWink!=0) RotatePoly(aPol,aR.TopLeft(),aGeo.nSin,aGeo.nCos);
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
- aRetval.append(aPol.getB2DPolygon());
- }
+ aPolygon.transform(getSdrObjectTransformation());
- return aRetval;
-}
-
-void SdrTextObj::RecalcSnapRect()
-{
- if (aGeo.nDrehWink!=0 || aGeo.nShearWink!=0) {
- Polygon aPol(aRect);
- if (aGeo.nShearWink!=0) ShearPoly(aPol,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoly(aPol,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- maSnapRect=aPol.GetBoundRect();
- } else {
- maSnapRect=aRect;
- }
+ return basegfx::B2DPolyPolygon(aPolygon);
}
sal_uInt32 SdrTextObj::GetSnapPointCount() const
@@ -1310,50 +876,26 @@ sal_uInt32 SdrTextObj::GetSnapPointCount() const
return 4L;
}
-Point SdrTextObj::GetSnapPoint(sal_uInt32 i) const
+basegfx::B2DPoint SdrTextObj::GetSnapPoint(sal_uInt32 i) const
{
- Point aP;
- switch (i) {
- case 0: aP=aRect.TopLeft(); break;
- case 1: aP=aRect.TopRight(); break;
- case 2: aP=aRect.BottomLeft(); break;
- case 3: aP=aRect.BottomRight(); break;
- default: aP=aRect.Center(); break;
- }
- if (aGeo.nShearWink!=0) ShearPoint(aP,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoint(aP,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- return aP;
-}
-
-void SdrTextObj::ImpCheckMasterCachable()
-{
- bNotMasterCachable=sal_False;
+ basegfx::B2DPoint aPoint;
- OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
-
- if(!bNotVisibleAsMaster && pOutlinerParaObject && pOutlinerParaObject->IsEditDoc() )
+ switch (i)
{
- const EditTextObject& rText= pOutlinerParaObject->GetTextObject();
- bNotMasterCachable=rText.HasField(SvxPageField::StaticType());
- if( !bNotMasterCachable )
- {
- bNotMasterCachable=rText.HasField(SvxHeaderField::StaticType());
- if( !bNotMasterCachable )
- {
- bNotMasterCachable=rText.HasField(SvxFooterField::StaticType());
- if( !bNotMasterCachable )
- {
- bNotMasterCachable=rText.HasField(SvxDateTimeField::StaticType());
- }
- }
- }
+ case 0: aPoint = basegfx::B2DPoint(0.0, 0.0); break;
+ case 1: aPoint = basegfx::B2DPoint(1.0, 0.0); break;
+ case 2: aPoint = basegfx::B2DPoint(0.0, 1.0); break;
+ case 3: aPoint = basegfx::B2DPoint(1.0, 1.0); break;
+ default: aPoint = basegfx::B2DPoint(0.5, 0.5); break;
}
+
+ return getSdrObjectTransformation() * aPoint;
}
// #101029#: Extracted from ImpGetDrawOutliner()
void SdrTextObj::ImpInitDrawOutliner( SdrOutliner& rOutl ) const
{
- rOutl.SetUpdateMode(sal_False);
+ rOutl.SetUpdateMode(false);
sal_uInt16 nOutlinerMode = OUTLINERMODE_OUTLINEOBJECT;
if ( !IsOutlText() )
nOutlinerMode = OUTLINERMODE_TEXTOBJECT;
@@ -1373,7 +915,7 @@ void SdrTextObj::ImpInitDrawOutliner( SdrOutliner& rOutl ) const
SdrOutliner& SdrTextObj::ImpGetDrawOutliner() const
{
- SdrOutliner& rOutl=pModel->GetDrawOutliner(this);
+ SdrOutliner& rOutl = getSdrModelFromSdrObject().GetDrawOutliner(this);
// #101029#: Code extracted to ImpInitDrawOutliner()
ImpInitDrawOutliner( rOutl );
@@ -1383,18 +925,18 @@ SdrOutliner& SdrTextObj::ImpGetDrawOutliner() const
boost::shared_ptr< SdrOutliner > SdrTextObj::CreateDrawOutliner()
{
- boost::shared_ptr< SdrOutliner > xDrawOutliner( pModel->CreateDrawOutliner(this) );
+ boost::shared_ptr< SdrOutliner > xDrawOutliner( getSdrModelFromSdrObject().CreateDrawOutliner(this) );
ImpInitDrawOutliner( *(xDrawOutliner.get()) );
return xDrawOutliner;
}
// #101029#: Extracted from Paint()
-void SdrTextObj::ImpSetupDrawOutlinerForPaint( FASTBOOL bContourFrame,
+void SdrTextObj::ImpSetupDrawOutlinerForPaint(
+ bool bContourFrame,
SdrOutliner& rOutliner,
- Rectangle& rTextRect,
- Rectangle& rAnchorRect,
- Rectangle& rPaintRect,
- Fraction& rFitXKorreg ) const
+ basegfx::B2DRange& rTextRange,
+ basegfx::B2DRange& rAnchorRange,
+ basegfx::B2DRange& rPaintRange) const
{
if (!bContourFrame)
{
@@ -1407,9 +949,10 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( FASTBOOL bContourFrame,
rOutliner.SetControlWord(nStat);
}
}
+
rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
- TakeTextRect(rOutliner, rTextRect, sal_False, &rAnchorRect);
- rPaintRect = rTextRect;
+ TakeTextRange(rOutliner, rTextRange, rAnchorRange);
+ rPaintRange = rTextRange;
if (!bContourFrame)
{
@@ -1417,35 +960,30 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( FASTBOOL bContourFrame,
SdrFitToSizeType eFit=GetFitToSize();
if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES)
{
- ImpSetCharStretching(rOutliner,rTextRect,rAnchorRect,rFitXKorreg);
- rPaintRect=rAnchorRect;
+ ImpSetCharStretching(rOutliner, rTextRange, rAnchorRange);
+ rPaintRange = rAnchorRange;
}
}
}
-void SdrTextObj::SetupOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const
+void SdrTextObj::SetupOutlinerFormatting( SdrOutliner& rOutl, basegfx::B2DRange& rPaintRange ) const
{
ImpInitDrawOutliner( rOutl );
- UpdateOutlinerFormatting( rOutl, rPaintRect );
+ UpdateOutlinerFormatting( rOutl, rPaintRange );
}
-void SdrTextObj::UpdateOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const
+void SdrTextObj::UpdateOutlinerFormatting( SdrOutliner& rOutl, basegfx::B2DRange& rPaintRange ) const
{
- Rectangle aTextRect;
- Rectangle aAnchorRect;
- Fraction aFitXKorreg(1,1);
-
- FASTBOOL bContourFrame=IsContourTextFrame();
+ basegfx::B2DRange aTextRange;
+ basegfx::B2DRange aAnchorRange;
+ const bool bContourFrame(IsContourTextFrame());
+ const MapMode aMapMode(
+ getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(0,0),
+ getSdrModelFromSdrObject().GetExchangeObjectScale(),
+ getSdrModelFromSdrObject().GetExchangeObjectScale());
- if( GetModel() )
- {
- MapMode aMapMode(GetModel()->GetScaleUnit(), Point(0,0),
- GetModel()->GetScaleFraction(),
- GetModel()->GetScaleFraction());
rOutl.SetRefMapMode(aMapMode);
- }
-
- ImpSetupDrawOutlinerForPaint( bContourFrame, rOutl, aTextRect, aAnchorRect, rPaintRect, aFitXKorreg );
+ ImpSetupDrawOutlinerForPaint( bContourFrame, rOutl, aTextRange, aAnchorRange, rPaintRange );
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1467,12 +1005,33 @@ bool SdrTextObj::HasOutlinerParaObject() const
return false;
}
-void SdrTextObj::NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject)
+void SdrTextObj::SetOutlinerParaObject(OutlinerParaObject* pTextObject)
{
- NbcSetOutlinerParaObjectForText( pTextObject, getActiveText() );
+ bool bChange(false);
+ OutlinerParaObject* pCurrent = GetOutlinerParaObject();
+
+ // use OutlinerParaObject compare operator
+ if(pCurrent != pTextObject)
+ {
+ bChange = true;
+ }
+
+ // if both exist, check if the difference is in redlining
+ if(!bChange && pTextObject && pCurrent)
+ {
+ bChange = !pTextObject->isWrongListEqual(*pCurrent);
+ }
+
+ if(bChange)
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
+ SetOutlinerParaObjectForText( pTextObject, getActiveText() );
+ SetChanged();
+ }
}
-void SdrTextObj::NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, SdrText* pText )
+void SdrTextObj::SetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, SdrText* pText )
{
if( pText )
pText->SetOutlinerParaObject( pTextObject );
@@ -1488,88 +1047,44 @@ void SdrTextObj::NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObjec
SetTextSizeDirty();
if (IsTextFrame() && (IsAutoGrowHeight() || IsAutoGrowWidth()))
- { // Textrahmen anpassen!
- NbcAdjustTextFrameWidthAndHeight();
- }
- if (!IsTextFrame())
{
- // Das SnapRect behaelt seine Groesse bei
- SetRectsDirty(sal_True);
+ // Textrahmen anpassen!
+ AdjustTextFrameWidthAndHeight();
}
// always invalidate BoundRect on change
- SetBoundRectDirty();
ActionChanged();
ImpSetTextStyleSheetListeners();
- ImpCheckMasterCachable();
}
-void SdrTextObj::NbcReformatText()
+void SdrTextObj::ReformatText()
{
SdrText* pText = getActiveText();
+
if( pText && pText->GetOutlinerParaObject() )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+
pText->ReformatText();
+
if (bTextFrame)
{
- NbcAdjustTextFrameWidthAndHeight();
- }
- else
- {
- // Das SnapRect behaelt seine Groesse bei
- SetBoundRectDirty();
- SetRectsDirty(sal_True);
+ AdjustTextFrameWidthAndHeight();
}
+
SetTextSizeDirty();
- ActionChanged();
+
// FME, AW: i22396
// Necessary here since we have no compare operator at the outliner
// para object which may detect changes regarding the combination
// of outliner para data and configuration (e.g., change of
// formatting of text numerals)
GetViewContact().flushViewObjectContacts(false);
- }
-}
-
-void SdrTextObj::ReformatText()
-{
- if(GetOutlinerParaObject())
- {
- Rectangle aBoundRect0;
- if (pUserCall!=NULL)
- aBoundRect0=GetLastBoundRect();
-
- // #110094#-14 SendRepaintBroadcast();
- NbcReformatText();
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
}
-SdrObjGeoData* SdrTextObj::NewGeoData() const
-{
- return new SdrTextObjGeoData;
-}
-
-void SdrTextObj::SaveGeoData(SdrObjGeoData& rGeo) const
-{
- SdrAttrObj::SaveGeoData(rGeo);
- SdrTextObjGeoData& rTGeo=(SdrTextObjGeoData&)rGeo;
- rTGeo.aRect =aRect;
- rTGeo.aGeo =aGeo;
-}
-
-void SdrTextObj::RestGeoData(const SdrObjGeoData& rGeo)
-{ // RectsDirty wird von SdrObject gerufen
- SdrAttrObj::RestGeoData(rGeo);
- SdrTextObjGeoData& rTGeo=(SdrTextObjGeoData&)rGeo;
- aRect =rTGeo.aRect;
- aGeo =rTGeo.aGeo;
- SetTextSizeDirty();
-}
-
SdrFitToSizeType SdrTextObj::GetFitToSize() const
{
SdrFitToSizeType eType = SDRTEXTFIT_NONE;
@@ -1593,7 +1108,7 @@ void SdrTextObj::ForceOutlinerParaObject()
}
}
-sal_Bool SdrTextObj::IsVerticalWriting() const
+bool SdrTextObj::IsVerticalWriting() const
{
// #89459#
if(pEdtOutl)
@@ -1610,7 +1125,7 @@ sal_Bool SdrTextObj::IsVerticalWriting() const
return sal_False;
}
-void SdrTextObj::SetVerticalWriting(sal_Bool bVertical)
+void SdrTextObj::SetVerticalWriting(bool bVertical)
{
OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
if( !pOutlinerParaObject && bVertical )
@@ -1625,15 +1140,15 @@ void SdrTextObj::SetVerticalWriting(sal_Bool bVertical)
{
// get item settings
const SfxItemSet& rSet = GetObjectItemSet();
- sal_Bool bAutoGrowWidth = ((SdrTextAutoGrowWidthItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue();
- sal_Bool bAutoGrowHeight = ((SdrTextAutoGrowHeightItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue();
+ bool bAutoGrowWidth = ((SdrOnOffItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue();
+ bool bAutoGrowHeight = ((SdrOnOffItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue();
// #103516# Also exchange hor/ver adjust items
SdrTextHorzAdjust eHorz = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue();
SdrTextVertAdjust eVert = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue();
// rescue object size
- Rectangle aObjectRect = GetSnapRect();
+ Rectangle aObjectRect(sdr::legacy::GetSnapRect(*this));
// prepare ItemSet to set exchanged width and height items
SfxItemSet aNewSet(*rSet.GetPool(),
@@ -1644,8 +1159,8 @@ void SdrTextObj::SetVerticalWriting(sal_Bool bVertical)
0, 0);
aNewSet.Put(rSet);
- aNewSet.Put(SdrTextAutoGrowWidthItem(bAutoGrowHeight));
- aNewSet.Put(SdrTextAutoGrowHeightItem(bAutoGrowWidth));
+ aNewSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, bAutoGrowHeight));
+ aNewSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, bAutoGrowWidth));
// #103516# Exchange horz and vert adjusts
switch(eVert)
@@ -1673,172 +1188,11 @@ void SdrTextObj::SetVerticalWriting(sal_Bool bVertical)
}
// restore object size
- SetSnapRect(aObjectRect);
+ sdr::legacy::SetSnapRect(*this, aObjectRect);
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// transformation interface for StarOfficeAPI. This implements support for
-// homogen 3x3 matrices containing the transformation of the SdrObject. At the
-// moment it contains a shearX, rotation and translation, but for setting all linear
-// transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
-// with the base geometry and returns TRUE. Otherwise it returns FALSE.
-sal_Bool SdrTextObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& /*rPolyPolygon*/) const
-{
- // get turn and shear
- double fRotate = (aGeo.nDrehWink / 100.0) * F_PI180;
- double fShearX = (aGeo.nShearWink / 100.0) * F_PI180;
-
- // get aRect, this is the unrotated snaprect
- Rectangle aRectangle(aRect);
-
- // fill other values
- basegfx::B2DTuple aScale(aRectangle.GetWidth(), aRectangle.GetHeight());
- basegfx::B2DTuple aTranslate(aRectangle.Left(), aRectangle.Top());
-
- // position maybe relative to anchorpos, convert
- if( pModel && pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate -= basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
- }
-
- // force MapUnit to 100th mm
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // postion
- aTranslate.setX(ImplTwipsToMM(aTranslate.getX()));
- aTranslate.setY(ImplTwipsToMM(aTranslate.getY()));
-
- // size
- aScale.setX(ImplTwipsToMM(aScale.getX()));
- aScale.setY(ImplTwipsToMM(aScale.getY()));
-
- break;
- }
- default:
- {
- DBG_ERROR("TRGetBaseGeometry: Missing unit translation to 100th mm!");
- }
- }
- }
-
- // build matrix
- rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aScale,
- basegfx::fTools::equalZero(fShearX) ? 0.0 : tan(fShearX),
- basegfx::fTools::equalZero(fRotate) ? 0.0 : -fRotate,
- aTranslate);
-
- return sal_False;
-}
-
-// sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
-// If it's an SdrPathObj it will use the provided geometry information. The Polygon has
-// to use (0,0) as upper left and will be scaled to the given size in the matrix.
-void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& /*rPolyPolygon*/)
-{
- // break up matrix
- basegfx::B2DTuple aScale;
- basegfx::B2DTuple aTranslate;
- double fRotate(0.0);
- double fShearX(0.0);
- rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
-
- // #i75086# Old DrawingLayer (GeoStat and geometry) does not support holding negative scalings
- // in X and Y which equal a 180 degree rotation. Recognize it and react accordingly
- if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
- {
- aScale.setX(fabs(aScale.getX()));
- aScale.setY(fabs(aScale.getY()));
- fRotate = fmod(fRotate + F_PI, F_2PI);
- }
-
- // reset object shear and rotations
- aGeo.nDrehWink = 0;
- aGeo.RecalcSinCos();
- aGeo.nShearWink = 0;
- aGeo.RecalcTan();
-
- // force metric to pool metric
- SfxMapUnit eMapUnit = GetObjectItemSet().GetPool()->GetMetric(0);
- if(eMapUnit != SFX_MAPUNIT_100TH_MM)
- {
- switch(eMapUnit)
- {
- case SFX_MAPUNIT_TWIP :
- {
- // position
- aTranslate.setX(ImplMMToTwips(aTranslate.getX()));
- aTranslate.setY(ImplMMToTwips(aTranslate.getY()));
-
- // size
- aScale.setX(ImplMMToTwips(aScale.getX()));
- aScale.setY(ImplMMToTwips(aScale.getY()));
-
- break;
- }
- default:
- {
- DBG_ERROR("TRSetBaseGeometry: Missing unit translation to PoolMetric!");
- }
- }
- }
-
- // if anchor is used, make position relative to it
- if( pModel && pModel->IsWriter() )
- {
- if(GetAnchorPos().X() || GetAnchorPos().Y())
- {
- aTranslate += basegfx::B2DTuple(GetAnchorPos().X(), GetAnchorPos().Y());
- }
- }
-
- // build and set BaseRect (use scale)
- Point aPoint = Point();
- Size aSize(FRound(aScale.getX()), FRound(aScale.getY()));
- Rectangle aBaseRect(aPoint, aSize);
- SetSnapRect(aBaseRect);
-
- // shear?
- if(!basegfx::fTools::equalZero(fShearX))
- {
- GeoStat aGeoStat;
- aGeoStat.nShearWink = FRound((atan(fShearX) / F_PI180) * 100.0);
- aGeoStat.RecalcTan();
- Shear(Point(), aGeoStat.nShearWink, aGeoStat.nTan, sal_False);
- }
-
- // rotation?
- if(!basegfx::fTools::equalZero(fRotate))
- {
- GeoStat aGeoStat;
-
- // #i78696#
- // fRotate is matematically correct, but aGeoStat.nDrehWink is
- // mirrored -> mirror value here
- aGeoStat.nDrehWink = NormAngle360(FRound(-fRotate / F_PI18000));
- aGeoStat.RecalcSinCos();
- Rotate(Point(), aGeoStat.nDrehWink, aGeoStat.nSin, aGeoStat.nCos);
- }
-
- // translate?
- if(!aTranslate.equalZero())
- {
- Move(Size(FRound(aTranslate.getX()), FRound(aTranslate.getY())));
- }
-}
+/////////////////////////////////////////////////////////////////////////////////////////////////
bool SdrTextObj::IsRealyEdited() const
{
@@ -1848,67 +1202,70 @@ bool SdrTextObj::IsRealyEdited() const
/////////////////////////////////////////////////////////////////////////////////////////////////
// moved inlines here form hxx
-long SdrTextObj::GetEckenradius() const
+sal_Int32 SdrTextObj::GetEdgeRadius() const
{
- return ((SdrEckenradiusItem&)(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS))).GetValue();
}
-long SdrTextObj::GetMinTextFrameHeight() const
+sal_Int32 SdrTextObj::GetMinTextFrameHeight() const
{
- return ((SdrTextMinFrameHeightItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEHEIGHT))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEHEIGHT))).GetValue();
}
-long SdrTextObj::GetMaxTextFrameHeight() const
+sal_Int32 SdrTextObj::GetMaxTextFrameHeight() const
{
- return ((SdrTextMaxFrameHeightItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEHEIGHT))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEHEIGHT))).GetValue();
}
-long SdrTextObj::GetMinTextFrameWidth() const
+sal_Int32 SdrTextObj::GetMinTextFrameWidth() const
{
- return ((SdrTextMinFrameWidthItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH))).GetValue();
}
-long SdrTextObj::GetMaxTextFrameWidth() const
+sal_Int32 SdrTextObj::GetMaxTextFrameWidth() const
{
- return ((SdrTextMaxFrameWidthItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH))).GetValue();
}
-FASTBOOL SdrTextObj::IsFontwork() const
+bool SdrTextObj::IsFontwork() const
{
- return (bTextFrame) ? sal_False // Default ist FALSE
+ return (bTextFrame)
+ ? false // Default ist false
: ((XFormTextStyleItem&)(GetObjectItemSet().Get(XATTR_FORMTXTSTYLE))).GetValue()!=XFT_NONE;
}
-FASTBOOL SdrTextObj::IsHideContour() const
+bool SdrTextObj::IsHideContour() const
{
- return (bTextFrame) ? sal_False // Default ist: Nein, kein HideContour; HideContour nicht bei TextFrames
+ return (bTextFrame)
+ ? false // Default ist: Nein, kein HideContour; HideContour nicht bei TextFrames
: ((XFormTextHideFormItem&)(GetObjectItemSet().Get(XATTR_FORMTXTHIDEFORM))).GetValue();
}
-FASTBOOL SdrTextObj::IsContourTextFrame() const
+bool SdrTextObj::IsContourTextFrame() const
{
- return (bTextFrame) ? sal_False // ContourFrame nicht bei normalen TextFrames
- : ((SdrTextContourFrameItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_CONTOURFRAME))).GetValue();
+ return (bTextFrame)
+ ? false // ContourFrame nicht bei normalen TextFrames
+ : ((SdrOnOffItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_CONTOURFRAME))).GetValue();
}
-long SdrTextObj::GetTextLeftDistance() const
+sal_Int32 SdrTextObj::GetTextLeftDistance() const
{
- return ((SdrTextLeftDistItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST))).GetValue();
}
-long SdrTextObj::GetTextRightDistance() const
+sal_Int32 SdrTextObj::GetTextRightDistance() const
{
- return ((SdrTextRightDistItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST))).GetValue();
}
-long SdrTextObj::GetTextUpperDistance() const
+sal_Int32 SdrTextObj::GetTextUpperDistance() const
{
- return ((SdrTextUpperDistItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST))).GetValue();
}
-long SdrTextObj::GetTextLowerDistance() const
+sal_Int32 SdrTextObj::GetTextLowerDistance() const
{
- return ((SdrTextLowerDistItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST))).GetValue();
+ return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST))).GetValue();
}
SdrTextAniKind SdrTextObj::GetTextAniKind() const
@@ -1922,55 +1279,56 @@ SdrTextAniDirection SdrTextObj::GetTextAniDirection() const
}
// #111096#
-// Access to thext hidden flag
-sal_Bool SdrTextObj::GetTextHidden() const
-{
- return mbTextHidden;
-}
-
-void SdrTextObj::NbcSetTextHidden(sal_Bool bNew)
-{
- if(bNew != mbTextHidden)
- {
- mbTextHidden = bNew;
- }
-}
-
-// #111096#
// Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a
// painting rectangle. Rotation is excluded from the returned values.
-GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
- Rectangle& rScrollRectangle, Rectangle& rPaintRectangle)
+GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRange(basegfx::B2DRange& rScrollRange, basegfx::B2DRange& rPaintRange) const
{
- GDIMetaFile* pRetval = 0L;
+ GDIMetaFile* pRetval = 0;
SdrOutliner& rOutliner = ImpGetDrawOutliner();
- Rectangle aTextRect;
- Rectangle aAnchorRect;
- Rectangle aPaintRect;
- Fraction aFitXKorreg(1,1);
+ basegfx::B2DRange aTextRange;
+ basegfx::B2DRange aAnchorRange;
+ basegfx::B2DRange aPaintRange;
bool bContourFrame(IsContourTextFrame());
// get outliner set up. To avoid getting a somehow rotated MetaFile,
// temporarily disable object rotation.
- sal_Int32 nAngle(aGeo.nDrehWink);
- aGeo.nDrehWink = 0L;
- ImpSetupDrawOutlinerForPaint( bContourFrame, rOutliner, aTextRect, aAnchorRect, aPaintRect, aFitXKorreg );
- aGeo.nDrehWink = nAngle;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
+ double fRotate, fShearX;
+ const basegfx::B2DHomMatrix aOriginalTransformation(getSdrObjectTransformation());
+ aOriginalTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ if(!basegfx::fTools::equalZero(fRotate))
+ {
+ // allow myself to cast, this method will not be necessary for very long anymore
+ const_cast< SdrTextObj* >(this)->maSdrObjectTransformation.setB2DHomMatrix(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale, fShearX, 0.0, aTranslate));
+ }
+
+ ImpSetupDrawOutlinerForPaint(bContourFrame, rOutliner, aTextRange, aAnchorRange, aPaintRange );
- Rectangle aScrollFrameRect(aPaintRect);
+ if(!basegfx::fTools::equalZero(fRotate))
+ {
+ const_cast< SdrTextObj* >(this)->maSdrObjectTransformation.setB2DHomMatrix(aOriginalTransformation);
+ }
+
+ basegfx::B2DRange aScrollFrameRange(aPaintRange);
const SfxItemSet& rSet = GetObjectItemSet();
SdrTextAniDirection eDirection = ((SdrTextAniDirectionItem&)(rSet.Get(SDRATTR_TEXT_ANIDIRECTION))).GetValue();
if(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection)
{
- aScrollFrameRect.Left() = aAnchorRect.Left();
- aScrollFrameRect.Right() = aAnchorRect.Right();
+ aScrollFrameRange = basegfx::B2DRange(
+ aAnchorRange.getMinX(), aScrollFrameRange.getMinY(),
+ aAnchorRange.getMaxX(), aScrollFrameRange.getMaxY());
}
if(SDRTEXTANI_UP == eDirection || SDRTEXTANI_DOWN == eDirection)
{
- aScrollFrameRect.Top() = aAnchorRect.Top();
- aScrollFrameRect.Bottom() = aAnchorRect.Bottom();
+ aScrollFrameRange = basegfx::B2DRange(
+ aScrollFrameRange.getMinX(), aAnchorRange.getMinY(),
+ aScrollFrameRange.getMaxX(), aAnchorRange.getMaxY());
}
// create the MetaFile
@@ -1978,7 +1336,7 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
VirtualDevice aBlackHole;
aBlackHole.EnableOutput(sal_False);
pRetval->Record(&aBlackHole);
- Point aPaintPos = aPaintRect.TopLeft();
+ const Point aPaintPos(basegfx::fround(aPaintRange.getMinX()), basegfx::fround(aPaintRange.getMinY()));
rOutliner.Draw(&aBlackHole, aPaintPos);
@@ -1986,8 +1344,8 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
pRetval->WindStart();
// return PaintRectanglePixel and pRetval;
- rScrollRectangle = aScrollFrameRect;
- rPaintRectangle = aPaintRect;
+ rScrollRange = aScrollFrameRange;
+ rPaintRange = aPaintRange;
return pRetval;
}
@@ -1999,7 +1357,7 @@ bool SdrTextObj::IsTextAnimationAllowed() const
return mbTextAnimationAllowed;
}
-void SdrTextObj::SetTextAnimationAllowed(sal_Bool bNew)
+void SdrTextObj::SetTextAnimationAllowed(bool bNew)
{
if(mbTextAnimationAllowed != bNew)
{
@@ -2062,7 +1420,7 @@ void SdrTextObj::setActiveText( sal_Int32 /*nIndex*/ )
}
/** returns the index of the text that contains the given point or -1 */
-sal_Int32 SdrTextObj::CheckTextHit(const Point& /*rPnt*/) const
+sal_Int32 SdrTextObj::CheckTextHit(const basegfx::B2DPoint& /*rPnt*/) const
{
return 0;
}
@@ -2077,20 +1435,20 @@ void SdrTextObj::SetObjectItemNoBroadcast(const SfxPoolItem& rItem)
// Konzept des TextObjekts:
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute/Varianten:
-// - sal_Bool Textrahmen / beschriftetes Zeichenobjekt
-// - sal_Bool FontWork (wenn nicht Textrahmen und nicht ContourTextFrame)
-// - sal_Bool ContourTextFrame (wenn nicht Textrahmen und nicht Fontwork)
-// - long Drehwinkel (wenn nicht FontWork)
-// - long Textrahmenabstaende (wenn nicht FontWork)
-// - sal_Bool FitToSize (wenn nicht FontWork)
-// - sal_Bool AutoGrowingWidth/Height (wenn nicht FitToSize und nicht FontWork)
-// - long Min/MaxFrameWidth/Height (wenn AutoGrowingWidth/Height)
+// - bool Textrahmen / beschriftetes Zeichenobjekt
+// - bool FontWork (wenn nicht Textrahmen und nicht ContourTextFrame)
+// - bool ContourTextFrame (wenn nicht Textrahmen und nicht Fontwork)
+// - sal_Int32 Drehwinkel (wenn nicht FontWork)
+// - sal_Int32 Textrahmenabstaende (wenn nicht FontWork)
+// - bool FitToSize (wenn nicht FontWork)
+// - bool AutoGrowingWidth/Height (wenn nicht FitToSize und nicht FontWork)
+// - sal_Int32 Min/MaxFrameWidth/Height (wenn AutoGrowingWidth/Height)
// - enum Horizontale Textverankerung Links,Mitte,Rechts,Block,Stretch(ni)
// - enum Vertikale Textverankerung Oben,Mitte,Unten,Block,Stretch(ni)
// - enum Laufschrift (wenn nicht FontWork)
//
-// Jedes abgeleitete Objekt ist entweder ein Textrahmen (bTextFrame=sal_True)
-// oder ein beschriftetes Zeichenobjekt (bTextFrame=sal_False).
+// Jedes abgeleitete Objekt ist entweder ein Textrahmen (bTextFrame=true)
+// oder ein beschriftetes Zeichenobjekt (bTextFrame=false).
//
// Defaultverankerung von Textrahmen:
// SDRTEXTHORZADJUST_BLOCK, SDRTEXTVERTADJUST_TOP
@@ -2111,16 +1469,18 @@ void SdrTextObj::SetObjectItemNoBroadcast(const SfxPoolItem& rItem)
// Textrahmen ist er stets kleiner oder gleich (ausser bei negativen Textrahmen-
// abstaenden).
//
+// TTTT: TakeUnrotatedSnapRect() removed, needed...?
+//
// FitToSize hat Prioritaet vor Textverankerung und AutoGrowHeight/Width. Der
// Ausgabebereich ist bei FitToSize immer genau der Ankerbereich. Weiterhin
// gibt es bei FitToSize keinen automatischen Zeilenumbruch.
//
// ContourTextFrame:
-// - long Drehwinkel
-// - long Textrahmenabstaende spaeter vielleicht
-// - sal_Bool FitToSize spaeter vielleicht
-// - sal_Bool AutoGrowingWidth/Height viel spaeter vielleicht
-// - long Min/MaxFrameWidth/Height viel spaeter vielleicht
+// - sal_Int32 Drehwinkel
+// - sal_Int32 Textrahmenabstaende spaeter vielleicht
+// - bool FitToSize spaeter vielleicht
+// - bool AutoGrowingWidth/Height viel spaeter vielleicht
+// - sal_Int32 Min/MaxFrameWidth/Height viel spaeter vielleicht
// - enum Horizontale Textverankerung spaeter vielleicht, erstmal Links, Absatz zentr.
// - enum Vertikale Textverankerung spaeter vielleicht, erstmal oben
// - enum Laufschrift spaeter vielleicht (evtl. sogar mit korrektem Clipping)
@@ -2136,4 +1496,4 @@ void SdrTextObj::SetObjectItemNoBroadcast(const SfxPoolItem& rItem)
// - uvm...
//
/////////////////////////////////////////////////////////////////////////////////////////////////
-
+// eof
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index ea01474272a9..42b629e2d877 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -53,622 +53,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <editeng/outlobj.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// helpers
-
-namespace
-{
- drawinglayer::primitive2d::Primitive2DSequence impConvertVectorToPrimitive2DSequence(const std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rPrimitiveVector)
- {
- const sal_Int32 nCount(rPrimitiveVector.size());
- drawinglayer::primitive2d::Primitive2DSequence aRetval(nCount);
-
- for(sal_Int32 a(0L); a < nCount; a++)
- {
- aRetval[a] = drawinglayer::primitive2d::Primitive2DReference(rPrimitiveVector[a]);
- }
-
- return aRetval;
- }
-
- class impTextBreakupHandler
- {
- private:
- std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maTextPortionPrimitives;
- std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maLinePrimitives;
- std::vector< drawinglayer::primitive2d::BasePrimitive2D* > maParagraphPrimitives;
-
- SdrOutliner& mrOutliner;
- basegfx::B2DHomMatrix maNewTransformA;
- basegfx::B2DHomMatrix maNewTransformB;
-
- // the visible area for contour text decomposition
- basegfx::B2DVector maScale;
-
- // #SJ# ClipRange for BlockText decomposition; only text portions completely
- // inside are to be accepted, so this is different from geometric clipping
- // (which would allow e.g. upper parts of portions to remain). Only used for
- // BlockText (see there)
- basegfx::B2DRange maClipRange;
-
- DECL_LINK(decomposeContourTextPrimitive, DrawPortionInfo* );
- DECL_LINK(decomposeBlockTextPrimitive, DrawPortionInfo* );
- DECL_LINK(decomposeStretchTextPrimitive, DrawPortionInfo* );
-
- DECL_LINK(decomposeContourBulletPrimitive, DrawBulletInfo* );
- DECL_LINK(decomposeBlockBulletPrimitive, DrawBulletInfo* );
- DECL_LINK(decomposeStretchBulletPrimitive, DrawBulletInfo* );
-
- bool impIsUnderlineAbove(const Font& rFont) const;
- void impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo);
- drawinglayer::primitive2d::BasePrimitive2D* impCheckFieldPrimitive(drawinglayer::primitive2d::BasePrimitive2D* pPrimitive, const DrawPortionInfo& rInfo) const;
- void impFlushTextPortionPrimitivesToLinePrimitives();
- void impFlushLinePrimitivesToParagraphPrimitives();
- void impHandleDrawPortionInfo(const DrawPortionInfo& rInfo);
- void impHandleDrawBulletInfo(const DrawBulletInfo& rInfo);
-
- public:
- impTextBreakupHandler(SdrOutliner& rOutliner)
- : maTextPortionPrimitives(),
- maLinePrimitives(),
- maParagraphPrimitives(),
- mrOutliner(rOutliner),
- maNewTransformA(),
- maNewTransformB(),
- maScale(),
- maClipRange()
- {
- }
-
- void decomposeContourTextPrimitive(const basegfx::B2DHomMatrix& rNewTransformA, const basegfx::B2DHomMatrix& rNewTransformB, const basegfx::B2DVector& rScale)
- {
- maScale = rScale;
- maNewTransformA = rNewTransformA;
- maNewTransformB = rNewTransformB;
- mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeContourTextPrimitive));
- mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeContourBulletPrimitive));
- mrOutliner.StripPortions();
- mrOutliner.SetDrawPortionHdl(Link());
- mrOutliner.SetDrawBulletHdl(Link());
- }
-
- void decomposeBlockTextPrimitive(
- const basegfx::B2DHomMatrix& rNewTransformA,
- const basegfx::B2DHomMatrix& rNewTransformB,
- const basegfx::B2DRange& rClipRange)
- {
- maNewTransformA = rNewTransformA;
- maNewTransformB = rNewTransformB;
- maClipRange = rClipRange;
- mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeBlockTextPrimitive));
- mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeBlockBulletPrimitive));
- mrOutliner.StripPortions();
- mrOutliner.SetDrawPortionHdl(Link());
- mrOutliner.SetDrawBulletHdl(Link());
- }
-
- void decomposeStretchTextPrimitive(const basegfx::B2DHomMatrix& rNewTransformA, const basegfx::B2DHomMatrix& rNewTransformB)
- {
- maNewTransformA = rNewTransformA;
- maNewTransformB = rNewTransformB;
- mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeStretchTextPrimitive));
- mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeStretchBulletPrimitive));
- mrOutliner.StripPortions();
- mrOutliner.SetDrawPortionHdl(Link());
- mrOutliner.SetDrawBulletHdl(Link());
- }
-
- drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequence();
- };
-
- bool impTextBreakupHandler::impIsUnderlineAbove(const Font& rFont) const
- {
- if(!rFont.IsVertical())
- {
- return false;
- }
-
- if((LANGUAGE_JAPANESE == rFont.GetLanguage()) || (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()))
- {
- // the underline is right for Japanese only
- return true;
- }
-
- return false;
- }
-
- void impTextBreakupHandler::impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo)
- {
- if(rInfo.mrText.Len() && rInfo.mnTextLen)
- {
- basegfx::B2DVector aFontScaling;
- drawinglayer::attribute::FontAttribute aFontAttribute(
- drawinglayer::primitive2d::getFontAttributeFromVclFont(
- aFontScaling,
- rInfo.mrFont,
- rInfo.IsRTL(),
- false));
- basegfx::B2DHomMatrix aNewTransform;
-
- // add font scale to new transform
- aNewTransform.scale(aFontScaling.getX(), aFontScaling.getY());
-
- // look for proportional font scaling, evtl scale accordingly
- if(100 != rInfo.mrFont.GetPropr())
- {
- const double fFactor(rInfo.mrFont.GetPropr() / 100.0);
- aNewTransform.scale(fFactor, fFactor);
- }
-
- // apply font rotate
- if(rInfo.mrFont.GetOrientation())
- {
- aNewTransform.rotate(-rInfo.mrFont.GetOrientation() * F_PI1800);
- }
-
- // look for escapement, evtl translate accordingly
- if(rInfo.mrFont.GetEscapement())
- {
- sal_Int16 nEsc(rInfo.mrFont.GetEscapement());
-
- if(DFLT_ESC_AUTO_SUPER == nEsc)
- {
- nEsc = 33;
- }
- else if(DFLT_ESC_AUTO_SUB == nEsc)
- {
- nEsc = -20;
- }
-
- if(nEsc > 100)
- {
- nEsc = 100;
- }
- else if(nEsc < -100)
- {
- nEsc = -100;
- }
-
- const double fEscapement(nEsc / -100.0);
- aNewTransform.translate(0.0, fEscapement * aFontScaling.getY());
- }
-
- // apply transformA
- aNewTransform *= maNewTransformA;
-
- // apply local offset
- aNewTransform.translate(rInfo.mrStartPos.X(), rInfo.mrStartPos.Y());
-
- // also apply embedding object's transform
- aNewTransform *= maNewTransformB;
-
- // prepare DXArray content. To make it independent from font size (and such from
- // the text transformation), scale it to unit coordinates
- ::std::vector< double > aDXArray;
- static bool bDisableTextArray(false);
-
- if(!bDisableTextArray && rInfo.mpDXArray && rInfo.mnTextLen)
- {
- aDXArray.reserve(rInfo.mnTextLen);
-
- for(xub_StrLen a(0); a < rInfo.mnTextLen; a++)
- {
- aDXArray.push_back((double)rInfo.mpDXArray[a]);
- }
- }
-
- // create complex text primitive and append
- const Color aFontColor(rInfo.mrFont.GetColor());
- const basegfx::BColor aBFontColor(aFontColor.getBColor());
-
- // prepare wordLineMode (for underline and strikeout)
- // NOT for bullet texts. It is set (this may be an error by itself), but needs to be suppressed to hinder e.g. '1)'
- // to be splitted which would not look like the original
- const bool bWordLineMode(rInfo.mrFont.IsWordLineMode() && !rInfo.mbEndOfBullet);
-
- // prepare new primitive
- drawinglayer::primitive2d::BasePrimitive2D* pNewPrimitive = 0;
- const bool bDecoratedIsNeeded(
- UNDERLINE_NONE != rInfo.mrFont.GetOverline()
- || UNDERLINE_NONE != rInfo.mrFont.GetUnderline()
- || STRIKEOUT_NONE != rInfo.mrFont.GetStrikeout()
- || EMPHASISMARK_NONE != (rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_STYLE)
- || RELIEF_NONE != rInfo.mrFont.GetRelief()
- || rInfo.mrFont.IsShadow()
- || bWordLineMode);
-
- if(bDecoratedIsNeeded)
- {
- // TextDecoratedPortionPrimitive2D needed, prepare some more data
- // get overline and underline color. If it's on automatic (0xffffffff) use FontColor instead
- const Color aUnderlineColor(rInfo.maTextLineColor);
- const basegfx::BColor aBUnderlineColor((0xffffffff == aUnderlineColor.GetColor()) ? aBFontColor : aUnderlineColor.getBColor());
- const Color aOverlineColor(rInfo.maOverlineColor);
- const basegfx::BColor aBOverlineColor((0xffffffff == aOverlineColor.GetColor()) ? aBFontColor : aOverlineColor.getBColor());
-
- // prepare overline and underline data
- const drawinglayer::primitive2d::TextLine eFontOverline(
- drawinglayer::primitive2d::mapFontUnderlineToTextLine(rInfo.mrFont.GetOverline()));
- const drawinglayer::primitive2d::TextLine eFontUnderline(
- drawinglayer::primitive2d::mapFontUnderlineToTextLine(rInfo.mrFont.GetUnderline()));
-
- // check UndelineAbove
- const bool bUnderlineAbove(
- drawinglayer::primitive2d::TEXT_LINE_NONE != eFontUnderline && impIsUnderlineAbove(rInfo.mrFont));
-
- // prepare strikeout data
- const drawinglayer::primitive2d::TextStrikeout eTextStrikeout(
- drawinglayer::primitive2d::mapFontStrikeoutToTextStrikeout(rInfo.mrFont.GetStrikeout()));
-
- // prepare emphasis mark data
- drawinglayer::primitive2d::TextEmphasisMark eTextEmphasisMark(drawinglayer::primitive2d::TEXT_EMPHASISMARK_NONE);
-
- switch(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_STYLE)
- {
- case EMPHASISMARK_DOT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DOT; break;
- case EMPHASISMARK_CIRCLE : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_CIRCLE; break;
- case EMPHASISMARK_DISC : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_DISC; break;
- case EMPHASISMARK_ACCENT : eTextEmphasisMark = drawinglayer::primitive2d::TEXT_EMPHASISMARK_ACCENT; break;
- }
-
- const bool bEmphasisMarkAbove(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_POS_ABOVE);
- const bool bEmphasisMarkBelow(rInfo.mrFont.GetEmphasisMark() & EMPHASISMARK_POS_BELOW);
-
- // prepare font relief data
- drawinglayer::primitive2d::TextRelief eTextRelief(drawinglayer::primitive2d::TEXT_RELIEF_NONE);
-
- switch(rInfo.mrFont.GetRelief())
- {
- case RELIEF_EMBOSSED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_EMBOSSED; break;
- case RELIEF_ENGRAVED : eTextRelief = drawinglayer::primitive2d::TEXT_RELIEF_ENGRAVED; break;
- default : break; // RELIEF_NONE, FontRelief_FORCE_EQUAL_SIZE
- }
-
- // prepare shadow/outline data
- const bool bShadow(rInfo.mrFont.IsShadow());
-
- // TextDecoratedPortionPrimitive2D is needed, create one
- pNewPrimitive = new drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D(
-
- // attributes for TextSimplePortionPrimitive2D
- aNewTransform,
- rInfo.mrText,
- rInfo.mnTextStart,
- rInfo.mnTextLen,
- aDXArray,
- aFontAttribute,
- rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(),
- aBFontColor,
-
- // attributes for TextDecoratedPortionPrimitive2D
- aBOverlineColor,
- aBUnderlineColor,
- eFontOverline,
- eFontUnderline,
- bUnderlineAbove,
- eTextStrikeout,
- bWordLineMode,
- eTextEmphasisMark,
- bEmphasisMarkAbove,
- bEmphasisMarkBelow,
- eTextRelief,
- bShadow);
- }
- else
- {
- // TextSimplePortionPrimitive2D is enough
- pNewPrimitive = new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aNewTransform,
- rInfo.mrText,
- rInfo.mnTextStart,
- rInfo.mnTextLen,
- aDXArray,
- aFontAttribute,
- rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale(),
- aBFontColor);
- }
-
- if(rInfo.mbEndOfBullet)
- {
- // embed in TextHierarchyBulletPrimitive2D
- const drawinglayer::primitive2d::Primitive2DReference aNewReference(pNewPrimitive);
- const drawinglayer::primitive2d::Primitive2DSequence aNewSequence(&aNewReference, 1);
- pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(aNewSequence);
- }
-
- if(rInfo.mpFieldData)
- {
- pNewPrimitive = impCheckFieldPrimitive(pNewPrimitive, rInfo);
- }
-
- maTextPortionPrimitives.push_back(pNewPrimitive);
-
- // support for WrongSpellVector. Create WrongSpellPrimitives as needed
- if(rInfo.mpWrongSpellVector && !aDXArray.empty())
- {
- const sal_uInt32 nSize(rInfo.mpWrongSpellVector->size());
- const sal_uInt32 nDXCount(aDXArray.size());
- const basegfx::BColor aSpellColor(1.0, 0.0, 0.0); // red, hard coded
-
- for(sal_uInt32 a(0); a < nSize; a++)
- {
- const EEngineData::WrongSpellClass& rCandidate = (*rInfo.mpWrongSpellVector)[a];
-
- if(rCandidate.nStart >= rInfo.mnTextStart && rCandidate.nEnd >= rInfo.mnTextStart && rCandidate.nEnd > rCandidate.nStart)
- {
- const sal_uInt32 nStart(rCandidate.nStart - rInfo.mnTextStart);
- const sal_uInt32 nEnd(rCandidate.nEnd - rInfo.mnTextStart);
- double fStart(0.0);
- double fEnd(0.0);
-
- if(nStart > 0 && nStart - 1 < nDXCount)
- {
- fStart = aDXArray[nStart - 1];
- }
-
- if(nEnd > 0 && nEnd - 1 < nDXCount)
- {
- fEnd = aDXArray[nEnd - 1];
- }
-
- if(!basegfx::fTools::equal(fStart, fEnd))
- {
- if(rInfo.IsRTL())
- {
- // #i98523#
- // When the portion is RTL, mirror the redlining using the
- // full portion width
- const double fTextWidth(aDXArray[aDXArray.size() - 1]);
-
- fStart = fTextWidth - fStart;
- fEnd = fTextWidth - fEnd;
- }
-
- // need to take FontScaling out of values; it's already part of
- // aNewTransform and would be double applied
- const double fFontScaleX(aFontScaling.getX());
-
- if(!basegfx::fTools::equal(fFontScaleX, 1.0)
- && !basegfx::fTools::equalZero(fFontScaleX))
- {
- fStart /= fFontScaleX;
- fEnd /= fFontScaleX;
- }
-
- maTextPortionPrimitives.push_back(new drawinglayer::primitive2d::WrongSpellPrimitive2D(
- aNewTransform,
- fStart,
- fEnd,
- aSpellColor));
- }
- }
- }
- }
- }
- }
-
- drawinglayer::primitive2d::BasePrimitive2D* impTextBreakupHandler::impCheckFieldPrimitive(drawinglayer::primitive2d::BasePrimitive2D* pPrimitive, const DrawPortionInfo& rInfo) const
- {
- if(rInfo.mpFieldData)
- {
- // Support for FIELD_SEQ_BEGIN, FIELD_SEQ_END. If used, create a TextHierarchyFieldPrimitive2D
- // which holds the field type and evtl. the URL
- const SvxURLField* pURLField = dynamic_cast< const SvxURLField* >(rInfo.mpFieldData);
- const SvxPageField* pPageField = dynamic_cast< const SvxPageField* >(rInfo.mpFieldData);
-
- // embed current primitive to a sequence
- drawinglayer::primitive2d::Primitive2DSequence aSequence;
-
- if(pPrimitive)
- {
- aSequence.realloc(1);
- aSequence[0] = drawinglayer::primitive2d::Primitive2DReference(pPrimitive);
- }
-
- if(pURLField)
- {
- pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_URL, pURLField->GetURL());
- }
- else if(pPageField)
- {
- pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_PAGE, String());
- }
- else
- {
- pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_COMMON, String());
- }
- }
-
- return pPrimitive;
- }
-
- void impTextBreakupHandler::impFlushTextPortionPrimitivesToLinePrimitives()
- {
- // only create a line primitive when we had content; there is no need for
- // empty line primitives (contrary to paragraphs, see below).
- if(!maTextPortionPrimitives.empty())
- {
- drawinglayer::primitive2d::Primitive2DSequence aLineSequence(impConvertVectorToPrimitive2DSequence(maTextPortionPrimitives));
- maTextPortionPrimitives.clear();
- maLinePrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyLinePrimitive2D(aLineSequence));
- }
- }
-
- void impTextBreakupHandler::impFlushLinePrimitivesToParagraphPrimitives()
- {
- // ALWAYS create a paragraph primitive, even when no content was added. This is done to
- // have the correct paragraph count even with empty paragraphs. Those paragraphs will
- // have an empty sub-PrimitiveSequence.
- drawinglayer::primitive2d::Primitive2DSequence aParagraphSequence(impConvertVectorToPrimitive2DSequence(maLinePrimitives));
- maLinePrimitives.clear();
- maParagraphPrimitives.push_back(new drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D(aParagraphSequence));
- }
-
- void impTextBreakupHandler::impHandleDrawPortionInfo(const DrawPortionInfo& rInfo)
- {
- impCreateTextPortionPrimitive(rInfo);
-
- if(rInfo.mbEndOfLine || rInfo.mbEndOfParagraph)
- {
- impFlushTextPortionPrimitivesToLinePrimitives();
- }
-
- if(rInfo.mbEndOfParagraph)
- {
- impFlushLinePrimitivesToParagraphPrimitives();
- }
- }
-
- void impTextBreakupHandler::impHandleDrawBulletInfo(const DrawBulletInfo& rInfo)
- {
- basegfx::B2DHomMatrix aNewTransform;
-
- // add size to new transform
- aNewTransform.scale(rInfo.maBulletSize.getWidth(), rInfo.maBulletSize.getHeight());
-
- // apply transformA
- aNewTransform *= maNewTransformA;
-
- // apply local offset
- aNewTransform.translate(rInfo.maBulletPosition.X(), rInfo.maBulletPosition.Y());
-
- // also apply embedding object's transform
- aNewTransform *= maNewTransformB;
-
- // prepare empty GraphicAttr
- const GraphicAttr aGraphicAttr;
-
- // create GraphicPrimitive2D
- const drawinglayer::primitive2d::Primitive2DReference aNewReference(new drawinglayer::primitive2d::GraphicPrimitive2D(
- aNewTransform,
- rInfo.maBulletGraphicObject,
- aGraphicAttr));
-
- // embed in TextHierarchyBulletPrimitive2D
- const drawinglayer::primitive2d::Primitive2DSequence aNewSequence(&aNewReference, 1);
- drawinglayer::primitive2d::BasePrimitive2D* pNewPrimitive = new drawinglayer::primitive2d::TextHierarchyBulletPrimitive2D(aNewSequence);
-
- // add to output
- maTextPortionPrimitives.push_back(pNewPrimitive);
- }
-
- IMPL_LINK(impTextBreakupHandler, decomposeContourTextPrimitive, DrawPortionInfo*, pInfo)
- {
- // for contour text, ignore (clip away) all portions which are below
- // the visible area given by maScale
- if(pInfo && (double)pInfo->mrStartPos.Y() < maScale.getY())
- {
- impHandleDrawPortionInfo(*pInfo);
- }
-
- return 0;
- }
-
- IMPL_LINK(impTextBreakupHandler, decomposeBlockTextPrimitive, DrawPortionInfo*, pInfo)
- {
- if(pInfo)
- {
- // #SJ# Is clipping wanted? This is text clipping; only accept a portion
- // if it's completely in the range
- if(!maClipRange.isEmpty())
- {
- // Test start position first; this allows to not get the text range at
- // all if text is far outside
- const basegfx::B2DPoint aStartPosition(pInfo->mrStartPos.X(), pInfo->mrStartPos.Y());
-
- if(!maClipRange.isInside(aStartPosition))
- {
- return 0;
- }
-
- // Start position is inside. Get TextBoundRect and TopLeft next
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
- aTextLayouterDevice.setFont(pInfo->mrFont);
-
- const basegfx::B2DRange aTextBoundRect(
- aTextLayouterDevice.getTextBoundRect(
- pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextLen));
- const basegfx::B2DPoint aTopLeft(aTextBoundRect.getMinimum() + aStartPosition);
-
- if(!maClipRange.isInside(aTopLeft))
- {
- return 0;
- }
-
- // TopLeft is inside. Get BottomRight and check
- const basegfx::B2DPoint aBottomRight(aTextBoundRect.getMaximum() + aStartPosition);
-
- if(!maClipRange.isInside(aBottomRight))
- {
- return 0;
- }
-
- // all inside, clip was successful
- }
- impHandleDrawPortionInfo(*pInfo);
- }
-
- return 0;
- }
-
- IMPL_LINK(impTextBreakupHandler, decomposeStretchTextPrimitive, DrawPortionInfo*, pInfo)
- {
- if(pInfo)
- {
- impHandleDrawPortionInfo(*pInfo);
- }
-
- return 0;
- }
-
- IMPL_LINK(impTextBreakupHandler, decomposeContourBulletPrimitive, DrawBulletInfo*, pInfo)
- {
- if(pInfo)
- {
- impHandleDrawBulletInfo(*pInfo);
- }
-
- return 0;
- }
-
- IMPL_LINK(impTextBreakupHandler, decomposeBlockBulletPrimitive, DrawBulletInfo*, pInfo)
- {
- if(pInfo)
- {
- impHandleDrawBulletInfo(*pInfo);
- }
-
- return 0;
- }
-
- IMPL_LINK(impTextBreakupHandler, decomposeStretchBulletPrimitive, DrawBulletInfo*, pInfo)
- {
- if(pInfo)
- {
- impHandleDrawBulletInfo(*pInfo);
- }
-
- return 0;
- }
-
- drawinglayer::primitive2d::Primitive2DSequence impTextBreakupHandler::getPrimitive2DSequence()
- {
- if(!maTextPortionPrimitives.empty())
- {
- // collect non-closed lines
- impFlushTextPortionPrimitivesToLinePrimitives();
- }
-
- if(!maLinePrimitives.empty())
- {
- // collect non-closed paragraphs
- impFlushLinePrimitivesToParagraphPrimitives();
- }
-
- return impConvertVectorToPrimitive2DSequence(maParagraphPrimitives);
- }
-} // end of anonymous namespace
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
// primitive decompositions
@@ -679,17 +64,26 @@ void SdrTextObj::impDecomposeContourTextPrimitive(
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
{
// decompose matrix to have position and size of text
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rSdrContourTextPrimitive.getObjectTransform().decompose(aScale, aTranslate, fRotate, fShearX);
+ // remember mirroring
+ const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
+ const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
+
+ // use scale absolute from here
+ aScale = basegfx::absolute(aScale);
+
// prepare contour polygon, force to non-mirrored for layouting
basegfx::B2DPolyPolygon aPolyPolygon(rSdrContourTextPrimitive.getUnitPolyPolygon());
- aPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(fabs(aScale.getX()), fabs(aScale.getY())));
+ aPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(aScale.getX(), aScale.getY()));
// prepare outliner
- SdrOutliner& rOutliner = ImpGetDrawOutliner();
const Size aNullSize;
+ SdrOutliner& rOutliner = ImpGetDrawOutliner();
+
rOutliner.SetPaperSize(aNullSize);
rOutliner.SetPolygon(aPolyPolygon);
rOutliner.SetUpdateMode(true);
@@ -698,29 +92,31 @@ void SdrTextObj::impDecomposeContourTextPrimitive(
// set visualizing page at Outliner; needed e.g. for PageNumberField decomposition
rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage()));
- // prepare matrices to apply to newly created primitives
- basegfx::B2DHomMatrix aNewTransformA;
+ // break up text primitives.
+ rOutliner.getPrimitive2DSequence(rTarget, &aScale);
- // mirroring. We are now in the polygon sizes. When mirroring in X and Y,
- // move the null point which was top left to bottom right.
- const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
- const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
+ if(rTarget.hasElements())
+ {
+ // prepare embedding transformation for new text primitives. Absolute Scale
+ // is already applied, add mirror, shear, rotate and translate
+ const basegfx::B2DHomMatrix aEmbeddingTransform(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0,
+ fShearX,
+ fRotate,
+ aTranslate.getX(), aTranslate.getY()));
- // in-between the translations of the single primitives will take place. Afterwards,
- // the object's transformations need to be applied
- const basegfx::B2DHomMatrix aNewTransformB(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0,
- fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aEmbeddingTransform,
+ rTarget));
- // now break up text primitives.
- impTextBreakupHandler aConverter(rOutliner);
- aConverter.decomposeContourTextPrimitive(aNewTransformA, aNewTransformB, aScale);
+ rTarget = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
+ }
// cleanup outliner
rOutliner.Clear();
rOutliner.setVisualizedPage(0);
-
- rTarget = aConverter.getPrimitive2DSequence();
}
void SdrTextObj::impDecomposeBlockTextPrimitive(
@@ -729,7 +125,8 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
{
// decompose matrix to have position and size of text
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rSdrBlockTextPrimitive.getTextRangeTransform().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -834,7 +231,7 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
// now get back the layouted text size from outliner
const Size aOutlinerTextSiz(rOutliner.GetPaperSize());
const basegfx::B2DVector aOutlinerScale(aOutlinerTextSiz.Width(), aOutlinerTextSiz.Height());
- basegfx::B2DVector aAdjustTranslate(0.0, 0.0);
+ basegfx::B2DPoint aAdjustTranslate(0.0, 0.0);
// For draw objects containing text correct hor/ver alignment if text is bigger
// than the object itself. Without that correction, the text would always be
@@ -901,7 +298,10 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
// corner
const double fStartInX(bVerticalWritintg ? aAdjustTranslate.getX() + aOutlinerScale.getX() : aAdjustTranslate.getX());
const basegfx::B2DTuple aAdjOffset(fStartInX, aAdjustTranslate.getY());
- basegfx::B2DHomMatrix aNewTransformA(basegfx::tools::createTranslateB2DHomMatrix(aAdjOffset.getX(), aAdjOffset.getY()));
+ basegfx::B2DHomMatrix aEmbeddingTransform(
+ basegfx::tools::createTranslateB2DHomMatrix(
+ aAdjOffset.getX(),
+ aAdjOffset.getY()));
// mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y,
// move the null point which was top left to bottom right.
@@ -910,9 +310,11 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
// in-between the translations of the single primitives will take place. Afterwards,
// the object's transformations need to be applied
- const basegfx::B2DHomMatrix aNewTransformB(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aEmbeddingTransform = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0,
- fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ fShearX,
+ fRotate,
+ aTranslate.getX(), aTranslate.getY()) * aEmbeddingTransform;
// #SJ# create ClipRange (if needed)
basegfx::B2DRange aClipRange;
@@ -924,14 +326,21 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
}
// now break up text primitives.
- impTextBreakupHandler aConverter(rOutliner);
- aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB, aClipRange);
+ rOutliner.getPrimitive2DSequence(rTarget, 0, aClipRange.isEmpty() ? 0 : &aClipRange);
+
+ if(rTarget.hasElements())
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aEmbeddingTransform,
+ rTarget));
+
+ rTarget = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
+ }
// cleanup outliner
rOutliner.Clear();
rOutliner.setVisualizedPage(0);
-
- rTarget = aConverter.getPrimitive2DSequence();
}
void SdrTextObj::impDecomposeStretchTextPrimitive(
@@ -940,7 +349,8 @@ void SdrTextObj::impDecomposeStretchTextPrimitive(
const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
{
// decompose matrix to have position and size of text
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aScale;
+ basegfx::B2DPoint aTranslate;
double fRotate, fShearX;
rSdrStretchTextPrimitive.getTextRangeTransform().decompose(aScale, aTranslate, fRotate, fShearX);
@@ -971,23 +381,24 @@ void SdrTextObj::impDecomposeStretchTextPrimitive(
basegfx::fTools::equalZero(aOutlinerTextSiz.Height()) ? 1.0 : aOutlinerTextSiz.Height());
// prepare matrices to apply to newly created primitives
- basegfx::B2DHomMatrix aNewTransformA;
+ basegfx::B2DHomMatrix aEmbeddingTransform;
- // #i101957# Check for vertical text. If used, aNewTransformA
+ // #i101957# Check for vertical text. If used, aEmbeddingTransform
// needs to translate the text initially around object width to orient
// it relative to the topper right instead of the topper left
const bool bVertical(rSdrStretchTextPrimitive.getOutlinerParaObject().IsVertical());
if(bVertical)
{
- aNewTransformA.translate(aScale.getX(), 0.0);
+ aEmbeddingTransform.translate(aScale.getX(), 0.0);
}
// calculate global char stretching scale parameters. Use non-mirrored sizes
// to layout without mirroring
const double fScaleX(fabs(aScale.getX()) / aOutlinerScale.getX());
const double fScaleY(fabs(aScale.getY()) / aOutlinerScale.getY());
- rOutliner.SetGlobalCharStretching((sal_Int16)FRound(fScaleX * 100.0), (sal_Int16)FRound(fScaleY * 100.0));
+
+ rOutliner.SetGlobalCharStretching((sal_Int16)basegfx::fround(fScaleX * 100.0), (sal_Int16)basegfx::fround(fScaleY * 100.0));
// mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y,
// move the null point which was top left to bottom right.
@@ -996,20 +407,29 @@ void SdrTextObj::impDecomposeStretchTextPrimitive(
// in-between the translations of the single primitives will take place. Afterwards,
// the object's transformations need to be applied
- const basegfx::B2DHomMatrix aNewTransformB(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aEmbeddingTransform = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0,
- fShearX, fRotate, aTranslate.getX(), aTranslate.getY()));
+ fShearX,
+ fRotate,
+ aTranslate.getX(), aTranslate.getY()) * aEmbeddingTransform;
// now break up text primitives.
- impTextBreakupHandler aConverter(rOutliner);
- aConverter.decomposeStretchTextPrimitive(aNewTransformA, aNewTransformB);
+ rOutliner.getPrimitive2DSequence(rTarget);
+
+ if(rTarget.hasElements())
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aEmbeddingTransform,
+ rTarget));
+
+ rTarget = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
+ }
// cleanup outliner
rOutliner.SetControlWord(nOriginalControlWord);
rOutliner.Clear();
rOutliner.setVisualizedPage(0);
-
- rTarget = aConverter.getPrimitive2DSequence();
}
//////////////////////////////////////////////////////////////////////////////
@@ -1024,8 +444,8 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi
{
// get values
const SfxItemSet& rSet = GetObjectItemSet();
- const sal_uInt32 nRepeat((sal_uInt32)((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
- bool bVisisbleWhenStopped(((SdrTextAniStopInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
+ const sal_uInt32 nRepeat((sal_uInt32)((SfxUInt16Item&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
+ bool bVisisbleWhenStopped(((SdrYesNoItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
double fDelay((double)((SdrTextAniDelayItem&)rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue());
if(0.0 == fDelay)
@@ -1053,9 +473,9 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi
void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency)
{
- bool bVisisbleWhenStopped(((SdrTextAniStopInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
- bool bVisisbleWhenStarted(((SdrTextAniStartInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue());
- const sal_uInt32 nRepeat(((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
+ bool bVisisbleWhenStopped(((SdrYesNoItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
+ bool bVisisbleWhenStarted(((SdrYesNoItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue());
+ const sal_uInt32 nRepeat(((SfxUInt16Item&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
if(bVisisbleWhenStarted)
{
@@ -1096,9 +516,9 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A
const double fStartPosition(bForward ? fRelativeTextLength : 1.0 - fRelativeTextLength);
const double fEndPosition(bForward ? 1.0 - fRelativeTextLength : fRelativeTextLength);
- bool bVisisbleWhenStopped(((SdrTextAniStopInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
- bool bVisisbleWhenStarted(((SdrTextAniStartInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue());
- const sal_uInt32 nRepeat(((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
+ bool bVisisbleWhenStopped(((SdrYesNoItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
+ bool bVisisbleWhenStarted(((SdrYesNoItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue());
+ const sal_uInt32 nRepeat(((SfxUInt16Item&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
if(!bVisisbleWhenStarted)
{
@@ -1157,7 +577,7 @@ void impCreateSlideTiming(const SfxItemSet& rSet, drawinglayer::animation::Anima
{
// move in from outside, start outside
const double fStartPosition(bForward ? 0.0 : 1.0);
- const sal_uInt32 nRepeat(((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
+ const sal_uInt32 nRepeat(((SfxUInt16Item&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
// move from outside to center
drawinglayer::animation::AnimationEntryLinear aOutIn(fTimeFullPath * 0.5, fFrequency, fStartPosition, 0.5);
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 7fced552cd95..a0c5b8e48d07 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -63,6 +63,7 @@
#include <svx/unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
+#include <editeng/pathtextportion.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -71,149 +72,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::i18n;
//////////////////////////////////////////////////////////////////////////////
-// PathTextPortion helper
-
-namespace
-{
- class impPathTextPortion
- {
- basegfx::B2DVector maOffset;
- String maText;
- xub_StrLen mnTextStart;
- xub_StrLen mnTextLength;
- sal_uInt16 mnParagraph;
- xub_StrLen mnIndex;
- SvxFont maFont;
- ::std::vector< double > maDblDXArray; // double DXArray, font size independent -> unit coordinate system
- ::com::sun::star::lang::Locale maLocale;
-
- // bitfield
- unsigned mbRTL : 1;
-
- public:
- impPathTextPortion(DrawPortionInfo& rInfo)
- : maOffset(rInfo.mrStartPos.X(), rInfo.mrStartPos.Y()),
- maText(rInfo.mrText),
- mnTextStart(rInfo.mnTextStart),
- mnTextLength(rInfo.mnTextLen),
- mnParagraph(rInfo.mnPara),
- mnIndex(rInfo.mnIndex),
- maFont(rInfo.mrFont),
- maDblDXArray(),
- maLocale(rInfo.mpLocale ? *rInfo.mpLocale : ::com::sun::star::lang::Locale()),
- mbRTL(rInfo.mrFont.IsVertical() ? false : rInfo.IsRTL())
- {
- if(mnTextLength && rInfo.mpDXArray)
- {
- maDblDXArray.reserve(mnTextLength);
-
- for(xub_StrLen a(0); a < mnTextLength; a++)
- {
- maDblDXArray.push_back((double)rInfo.mpDXArray[a]);
- }
- }
- }
-
- // for ::std::sort
- bool operator<(const impPathTextPortion& rComp) const
- {
- if(mnParagraph < rComp.mnParagraph)
- {
- return true;
- }
-
- if(maOffset.getX() < rComp.maOffset.getX())
- {
- return true;
- }
-
- return (maOffset.getY() < rComp.maOffset.getY());
- }
-
- const basegfx::B2DVector& getOffset() const { return maOffset; }
- const String& getText() const { return maText; }
- xub_StrLen getTextStart() const { return mnTextStart; }
- xub_StrLen getTextLength() const { return mnTextLength; }
- sal_uInt16 getParagraph() const { return mnParagraph; }
- xub_StrLen getIndex() const { return mnIndex; }
- const SvxFont& getFont() const { return maFont; }
- bool isRTL() const { return mbRTL; }
- const ::std::vector< double >& getDoubleDXArray() const { return maDblDXArray; }
- const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
-
- xub_StrLen getPortionIndex(xub_StrLen nIndex, xub_StrLen nLength) const
- {
- if(mbRTL)
- {
- return (mnTextStart + (mnTextLength - (nIndex + nLength)));
- }
- else
- {
- return (mnTextStart + nIndex);
- }
- }
-
- double getDisplayLength(xub_StrLen nIndex, xub_StrLen nLength) const
- {
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
- double fRetval(0.0);
-
- if(maFont.IsVertical())
- {
- fRetval = aTextLayouter.getTextHeight() * (double)nLength;
- }
- else
- {
- fRetval = aTextLayouter.getTextWidth(maText, getPortionIndex(nIndex, nLength), nLength);
- }
-
- return fRetval;
- }
- };
-} // end of anonymous namespace
-
-//////////////////////////////////////////////////////////////////////////////
-// TextBreakup helper
-
-namespace
-{
- class impTextBreakupHandler
- {
- SdrOutliner& mrOutliner;
- ::std::vector< impPathTextPortion > maPathTextPortions;
-
- DECL_LINK(decompositionPathTextPrimitive, DrawPortionInfo* );
-
- public:
- impTextBreakupHandler(SdrOutliner& rOutliner)
- : mrOutliner(rOutliner)
- {
- }
-
- const ::std::vector< impPathTextPortion >& decompositionPathTextPrimitive()
- {
- // strip portions to maPathTextPortions
- mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decompositionPathTextPrimitive));
- mrOutliner.StripPortions();
-
- if(!maPathTextPortions.empty())
- {
- // sort portions by paragraph, x and y
- ::std::sort(maPathTextPortions.begin(), maPathTextPortions.end());
- }
-
- return maPathTextPortions;
- }
- };
-
- IMPL_LINK(impTextBreakupHandler, decompositionPathTextPrimitive, DrawPortionInfo*, pInfo)
- {
- maPathTextPortions.push_back(impPathTextPortion(*pInfo));
- return 0;
- }
-} // end of anonymous namespace
-
-//////////////////////////////////////////////////////////////////////////////
// TextBreakup one poly and one paragraph helper
namespace
@@ -225,14 +83,14 @@ namespace
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow
Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator
- double getParagraphTextLength(const ::std::vector< const impPathTextPortion* >& rTextPortions)
+ double getParagraphTextLength(const ::std::vector< const PathTextPortion* >& rTextPortions)
{
drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
double fRetval(0.0);
for(sal_uInt32 a(0L); a < rTextPortions.size(); a++)
{
- const impPathTextPortion* pCandidate = rTextPortions[a];
+ const PathTextPortion* pCandidate = rTextPortions[a];
if(pCandidate && pCandidate->getTextLength())
{
@@ -244,7 +102,7 @@ namespace
return fRetval;
}
- xub_StrLen getNextGlyphLen(const impPathTextPortion* pCandidate, xub_StrLen nPosition, const ::com::sun::star::lang::Locale& rFontLocale)
+ xub_StrLen getNextGlyphLen(const PathTextPortion* pCandidate, xub_StrLen nPosition, const ::com::sun::star::lang::Locale& rFontLocale)
{
xub_StrLen nNextGlyphLen(1);
@@ -278,7 +136,7 @@ namespace
}
}
- void HandlePair(const basegfx::B2DPolygon rPolygonCandidate, const ::std::vector< const impPathTextPortion* >& rTextPortions)
+ void HandlePair(const basegfx::B2DPolygon rPolygonCandidate, const ::std::vector< const PathTextPortion* >& rTextPortions)
{
// prepare polygon geometry, take into account as many parameters as possible
basegfx::B2DPolygon aPolygonCandidate(rPolygonCandidate);
@@ -356,7 +214,7 @@ namespace
// handle text portions for this paragraph
for(sal_uInt32 a(0L); a < rTextPortions.size() && fPolyStart < fPolyEnd; a++)
{
- const impPathTextPortion* pCandidate = rTextPortions[a];
+ const PathTextPortion* pCandidate = rTextPortions[a];
basegfx::B2DVector aFontScaling;
const drawinglayer::attribute::FontAttribute aCandidateFontAttribute(
drawinglayer::primitive2d::getFontAttributeFromVclFont(
@@ -390,7 +248,7 @@ namespace
basegfx::B2DPoint aEndPos(aStartPos);
// add font scaling
- aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY());
+ aNewTransformA.scale(aFontScaling);
// prepare scaling of text primitive
if(bAutosizeScale)
@@ -428,7 +286,7 @@ namespace
aEndPos = basegfx::tools::getPositionAbsolute(aPolygonCandidate, fPolyStart + fPortionLength, fPolyLength);
const basegfx::B2DVector aDirection(aEndPos - aStartPos);
aNewTransformB.rotate(atan2(aDirection.getY(), aDirection.getX()));
- aNewTransformB.translate(aStartPos.getX(), aStartPos.getY());
+ aNewTransformB.translate(aStartPos);
break;
}
@@ -471,7 +329,7 @@ namespace
// lead to primitives without width which the renderers will handle
aNewTransformA.scale(fCos, 1.0);
- aNewTransformB.translate(aStartPos.getX(), aStartPos.getY());
+ aNewTransformB.translate(aStartPos);
break;
}
@@ -490,7 +348,7 @@ namespace
const basegfx::B2DVector aPerpendicular(
basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) *
maSdrFormTextAttribute.getFormTextDistance());
- aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
+ aNewTransformB.translate(aPerpendicular);
}
if(pCandidate->getText().Len() && nNextGlyphLen)
@@ -623,7 +481,7 @@ namespace
// get text outlines and their object transformation
pTextCandidate->getTextOutlinesAndTransformation(aB2DPolyPolyVector, aPolygonTransform);
- if(!aB2DPolyPolyVector.empty())
+ if(aB2DPolyPolyVector.size())
{
// create stroke primitives
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aStrokePrimitives;
@@ -705,10 +563,10 @@ void SdrTextObj::impDecomposePathTextPrimitive(
rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage()));
// now break up to text portions
- impTextBreakupHandler aConverter(rOutliner);
- const ::std::vector< impPathTextPortion > rPathTextPortions = aConverter.decompositionPathTextPrimitive();
+ ::std::vector< PathTextPortion > aPathTextPortions;
+ rOutliner.getPathTextPortions(aPathTextPortions);
- if(!rPathTextPortions.empty())
+ if(aPathTextPortions.size())
{
// get FormText and polygon values
const drawinglayer::attribute::SdrFormTextAttribute& rFormTextAttribute = rSdrPathTextPrimitive.getSdrFormTextAttribute();
@@ -736,11 +594,11 @@ void SdrTextObj::impDecomposePathTextPrimitive(
for(a = 0L; a < nLoopCount; a++)
{
// filter text portions for this paragraph
- ::std::vector< const impPathTextPortion* > aParagraphTextPortions;
+ ::std::vector< const PathTextPortion* > aParagraphTextPortions;
- for(sal_uInt32 b(0L); b < rPathTextPortions.size(); b++)
+ for(sal_uInt32 b(0L); b < aPathTextPortions.size(); b++)
{
- const impPathTextPortion& rCandidate = rPathTextPortions[b];
+ const PathTextPortion& rCandidate = aPathTextPortions[b];
if(rCandidate.getParagraph() == a)
{
@@ -749,7 +607,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// handle data pair polygon/ParagraphTextPortions
- if(!aParagraphTextPortions.empty())
+ if(aParagraphTextPortions.size())
{
aPolygonParagraphHandler.HandlePair(rPathPolyPolygon.getB2DPolygon(a), aParagraphTextPortions);
}
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index 386b55f7ba1b..9efb852c4d0e 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -26,19 +26,18 @@
#include <svl/style.hxx>
#include <svx/svdotext.hxx>
-#include "svx/svditext.hxx"
-#include <svx/svdmodel.hxx> // fuer GetMaxObjSize und GetStyleSheetPool
+#include <editeng/editdata.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdoutl.hxx>
-#include <svx/svdorect.hxx> // fuer SetDirty bei NbcAdjustTextFrameWidthAndHeight
-#include <svx/svdocapt.hxx> // fuer SetDirty bei NbcAdjustTextFrameWidthAndHeight
+#include <svx/svdorect.hxx>
+#include <svx/svdocapt.hxx>
#include <svx/svdetc.hxx>
#include <editeng/writingmodeitem.hxx>
#include <editeng/editeng.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
#include <svx/sdtfchim.hxx>
-
-
#include <editeng/editview.hxx>
#include <svl/smplhint.hxx>
#include <svl/whiter.hxx>
@@ -47,7 +46,6 @@
#include <editeng/eeitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/fhgtitem.hxx>
-
#include <editeng/charscaleitem.hxx>
#include <svl/style.hxx>
#include <svl/itemiter.hxx>
@@ -56,201 +54,301 @@
#include <editeng/numitem.hxx>
#include <editeng/editeng.hxx>
#include <editeng/postitem.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@ @@@@@ @@@@@@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@@ @@ @@ @@ @@@@@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
-//
-// Attribute, StyleSheets und AutoGrow
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-FASTBOOL SdrTextObj::AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHgt, FASTBOOL bWdt) const
+basegfx::B2DRange SdrTextObj::AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt, bool bWdt) const
+{
+ if(IsTextFrame() && !rRange.isEmpty())
+ {
+ const SdrFitToSizeType eFit(GetFitToSize());
+ const bool bFitToSize(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit);
+
+ if(!bFitToSize)
+ {
+ return ImpAdjustTextFrameWidthAndHeight(rRange, bHgt, bWdt, true);
+ }
+ }
+
+ return rRange;
+}
+
+basegfx::B2DRange SdrTextObj::ImpAdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt, bool bWdt, bool bCheckAnimation) const
{
- if (bTextFrame && pModel!=NULL && !rR.IsEmpty())
+ bool bWdtGrow(bWdt && IsAutoGrowWidth());
+ bool bHgtGrow(bHgt && IsAutoGrowHeight());
+ basegfx::B2DRange aRetval(rRange);
+
+ if(bWdtGrow || bHgtGrow)
{
- SdrFitToSizeType eFit=GetFitToSize();
- FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- FASTBOOL bWdtGrow=bWdt && IsAutoGrowWidth();
- FASTBOOL bHgtGrow=bHgt && IsAutoGrowHeight();
- SdrTextAniKind eAniKind=GetTextAniKind();
- SdrTextAniDirection eAniDir=GetTextAniDirection();
- FASTBOOL bScroll=eAniKind==SDRTEXTANI_SCROLL || eAniKind==SDRTEXTANI_ALTERNATE || eAniKind==SDRTEXTANI_SLIDE;
- FASTBOOL bHScroll=bScroll && (eAniDir==SDRTEXTANI_LEFT || eAniDir==SDRTEXTANI_RIGHT);
- FASTBOOL bVScroll=bScroll && (eAniDir==SDRTEXTANI_UP || eAniDir==SDRTEXTANI_DOWN);
- if (!bFitToSize && (bWdtGrow || bHgtGrow))
+ basegfx::B2DVector aSize(aRetval.getRange());
+ basegfx::B2DVector aMaxSize(100000.0, 100000.0);
+ double fHeight(0.0), fMinHeight(0.0), fMaxHeight(0.0);
+ double fWidth(0.0), fMinWidth(0.0), fMaxWidth(0.0);
+ const basegfx::B2DPoint aOriginalMinimum(aRetval.getMinimum());
+
+ if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getX()))
+ {
+ aMaxSize.setX(fabs(getSdrModelFromSdrObject().GetMaxObjectScale().getX()));
+ }
+
+ if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getY()))
+ {
+ aMaxSize.setY(fabs(getSdrModelFromSdrObject().GetMaxObjectScale().getY()));
+ }
+
+ if(bWdtGrow)
+ {
+ fMinWidth = GetMinTextFrameWidth();
+ fMaxWidth = GetMaxTextFrameWidth();
+
+ if(basegfx::fTools::equalZero(fMaxWidth) || basegfx::fTools::more(fMaxWidth, aMaxSize.getX()))
+ {
+ fMaxWidth = aMaxSize.getX();
+ }
+
+ if(basegfx::fTools::less(fMinWidth, 1.0))
+ {
+ fMinWidth = 1.0;
+ }
+
+ aSize.setX(fMaxWidth);
+ }
+
+ if(bHgtGrow)
+ {
+ fMinHeight = GetMinTextFrameHeight();
+ fMaxHeight = GetMaxTextFrameHeight();
+
+ if(basegfx::fTools::equalZero(fMaxHeight) || basegfx::fTools::more(fMaxHeight, aMaxSize.getY()))
+ {
+ fMaxHeight = aMaxSize.getY();
+ }
+
+ if(basegfx::fTools::less(fMinHeight, 1.0))
+ {
+ fMinHeight = 1.0;
+ }
+
+ aSize.setY(fMaxHeight);
+ }
+
+ const basegfx::B2DVector aBorders(
+ GetTextLeftDistance() + GetTextRightDistance(),
+ GetTextUpperDistance() + GetTextLowerDistance());
+
+ // substract orders
+ aSize -= aBorders;
+
+ // minimum size is 2.0
+ aSize = basegfx::maximum(basegfx::B2DTuple(2.0, 2.0), aSize);
+
+ if(bCheckAnimation && !IsInEditMode())
{
- Rectangle aR0(rR);
- long nHgt=0,nMinHgt=0,nMaxHgt=0;
- long nWdt=0,nMinWdt=0,nMaxWdt=0;
- Size aSiz(rR.GetSize()); aSiz.Width()--; aSiz.Height()--;
- Size aMaxSiz(100000,100000);
- Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
- if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
- if (bWdtGrow)
+ // do not wrap animated text
+ const SdrTextAniKind eAniKind(GetTextAniKind());
+ const SdrTextAniDirection eAniDir(GetTextAniDirection());
+ const bool bScroll(SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind);
+ const bool bHScroll(bScroll && (SDRTEXTANI_LEFT == eAniDir || SDRTEXTANI_RIGHT == eAniDir));
+ const bool bVScroll(bScroll && (SDRTEXTANI_UP == eAniDir || SDRTEXTANI_DOWN == eAniDir));
+
+ if(bHScroll)
{
- nMinWdt=GetMinTextFrameWidth();
- nMaxWdt=GetMaxTextFrameWidth();
- if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width()) nMaxWdt=aMaxSiz.Width();
- if (nMinWdt<=0) nMinWdt=1;
- aSiz.Width()=nMaxWdt;
+ aSize.setX(268435455.0);
}
- if (bHgtGrow)
+
+ if(bVScroll)
{
- nMinHgt=GetMinTextFrameHeight();
- nMaxHgt=GetMaxTextFrameHeight();
- if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
- if (nMinHgt<=0) nMinHgt=1;
- aSiz.Height()=nMaxHgt;
+ aSize.setY(268435455.0);
}
- long nHDist=GetTextLeftDistance()+GetTextRightDistance();
- long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
- aSiz.Width()-=nHDist;
- aSiz.Height()-=nVDist;
- if (aSiz.Width()<2) aSiz.Width()=2; // Mindestgroesse 2
- if (aSiz.Height()<2) aSiz.Height()=2; // Mindestgroesse 2
+ }
- // #101684#
- sal_Bool bInEditMode = IsInEditMode();
+ if(IsTextEditActive())
+ {
+ GetTextEditOutliner()->SetMaxAutoPaperSize(Size(basegfx::fround(aSize.getX()), basegfx::fround(aSize.getY())));
+
+ if(bWdtGrow)
+ {
+ const Size aSiz2(GetTextEditOutliner()->CalcTextSize());
- if(!bInEditMode)
+ fWidth = aSiz2.Width() + 1; // lieber etwas Tolleranz
+
+ if(bHgtGrow)
+ {
+ fHeight = aSiz2.Height() + 1; // lieber etwas Tolleranz
+ }
+ }
+ else
{
- if (bHScroll) aSiz.Width()=0x0FFFFFFF; // Laufschrift nicht umbrechen
- if (bVScroll) aSiz.Height()=0x0FFFFFFF;
+ fHeight = GetTextEditOutliner()->GetTextHeight() + 1; // lieber etwas Tolleranz
}
+ }
+ else
+ {
+ Outliner& rOutliner = ImpGetDrawOutliner();
+
+ rOutliner.SetPaperSize(Size(basegfx::fround(aSize.getX()), basegfx::fround(aSize.getY())));
+ rOutliner.SetUpdateMode(true);
+ OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
+
+ if(pOutlinerParaObject)
+ {
+ rOutliner.SetText(*pOutlinerParaObject);
+ rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+ }
+
+ if(bWdtGrow)
+ {
+ const Size aSiz2(rOutliner.CalcTextSize());
+
+ fWidth = aSiz2.Width() + 1; // lieber etwas Tolleranz
+
+ if(bHgtGrow)
+ {
+ fHeight = aSiz2.Height() + 1; // lieber etwas Tolleranz
+ }
+ }
+ else
+ {
+ fHeight = rOutliner.GetTextHeight() + 1; // lieber etwas Tolleranz
+ }
+
+ rOutliner.Clear();
+ }
+
+ // fMinWidth < fWidth < fMaxWidth
+ fWidth = std::min(fMaxWidth, std::max(fWidth, fMinWidth));
+ fWidth = std::max(1.0, fWidth += aBorders.getX()); // aBorders.getX() may be negative
+
+ // fMinHeight < fHeight < fMaxHeight
+ fHeight = std::min(fMaxHeight, std::max(fHeight, fMinHeight));
+ fHeight = std::max(1.0, fHeight += aBorders.getY()); // aBorders.getY() may be negative
+
+ // get grow sizes
+ const double fWidthGrow(fWidth - aRetval.getWidth());
+ const double fHeightGrow(fHeight - aRetval.getHeight());
+
+ if(basegfx::fTools::equalZero(fWidthGrow))
+ {
+ bWdtGrow = false;
+ }
+
+ if(basegfx::fTools::equalZero(fHeightGrow))
+ {
+ bHgtGrow = false;
+ }
- if(pEdtOutl)
+ if(bWdtGrow || bHgtGrow)
+ {
+ if(bWdtGrow)
{
- pEdtOutl->SetMaxAutoPaperSize(aSiz);
- if (bWdtGrow) {
- Size aSiz2(pEdtOutl->CalcTextSize());
- nWdt=aSiz2.Width()+1; // lieber etwas Tolleranz
- if (bHgtGrow) nHgt=aSiz2.Height()+1; // lieber etwas Tolleranz
- } else {
- nHgt=pEdtOutl->GetTextHeight()+1; // lieber etwas Tolleranz
+ const SdrTextHorzAdjust eHAdj(GetTextHorizontalAdjust());
+
+ if(SDRTEXTHORZADJUST_LEFT == eHAdj)
+ {
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY(), aRetval.getMaxX() + fWidthGrow, aRetval.getMaxY());
}
- } else {
- Outliner& rOutliner=ImpGetDrawOutliner();
- rOutliner.SetPaperSize(aSiz);
- rOutliner.SetUpdateMode(sal_True);
- // !!! hier sollte ich wohl auch noch mal die Optimierung mit
- // bPortionInfoChecked usw einbauen
- OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
- if ( pOutlinerParaObject != NULL )
+ else if(SDRTEXTHORZADJUST_RIGHT == eHAdj)
{
- rOutliner.SetText(*pOutlinerParaObject);
- rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+ aRetval = basegfx::B2DRange(aRetval.getMinX() - fWidthGrow, aRetval.getMinY(), aRetval.getMaxX(), aRetval.getMaxY());
}
- if (bWdtGrow)
+ else
{
- Size aSiz2(rOutliner.CalcTextSize());
- nWdt=aSiz2.Width()+1; // lieber etwas Tolleranz
- if (bHgtGrow) nHgt=aSiz2.Height()+1; // lieber etwas Tolleranz
- } else {
- nHgt=rOutliner.GetTextHeight()+1; // lieber etwas Tolleranz
+ aRetval = basegfx::B2DRange(aRetval.getMinX() - (fWidthGrow * 0.5), aRetval.getMinY(), aRetval.getMaxX() + (fWidthGrow * 0.5), aRetval.getMaxY());
}
- rOutliner.Clear();
}
- if (nWdt<nMinWdt) nWdt=nMinWdt;
- if (nWdt>nMaxWdt) nWdt=nMaxWdt;
- nWdt+=nHDist;
- if (nWdt<1) nWdt=1; // nHDist kann auch negativ sein
- if (nHgt<nMinHgt) nHgt=nMinHgt;
- if (nHgt>nMaxHgt) nHgt=nMaxHgt;
- nHgt+=nVDist;
- if (nHgt<1) nHgt=1; // nVDist kann auch negativ sein
- long nWdtGrow=nWdt-(rR.Right()-rR.Left());
- long nHgtGrow=nHgt-(rR.Bottom()-rR.Top());
- if (nWdtGrow==0) bWdtGrow=sal_False;
- if (nHgtGrow==0) bHgtGrow=sal_False;
- if (bWdtGrow || bHgtGrow) {
- if (bWdtGrow) {
- SdrTextHorzAdjust eHAdj=GetTextHorizontalAdjust();
- if (eHAdj==SDRTEXTHORZADJUST_LEFT) rR.Right()+=nWdtGrow;
- else if (eHAdj==SDRTEXTHORZADJUST_RIGHT) rR.Left()-=nWdtGrow;
- else {
- long nWdtGrow2=nWdtGrow/2;
- rR.Left()-=nWdtGrow2;
- rR.Right()=rR.Left()+nWdt;
- }
+
+ if(bHgtGrow)
+ {
+ const SdrTextVertAdjust eVAdj(GetTextVerticalAdjust());
+
+ if(SDRTEXTVERTADJUST_TOP == eVAdj)
+ {
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY(), aRetval.getMaxX(), aRetval.getMaxY() + fHeightGrow);
}
- if (bHgtGrow) {
- SdrTextVertAdjust eVAdj=GetTextVerticalAdjust();
- if (eVAdj==SDRTEXTVERTADJUST_TOP) rR.Bottom()+=nHgtGrow;
- else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) rR.Top()-=nHgtGrow;
- else {
- long nHgtGrow2=nHgtGrow/2;
- rR.Top()-=nHgtGrow2;
- rR.Bottom()=rR.Top()+nHgt;
- }
+ else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
+ {
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY() - fHeightGrow, aRetval.getMaxX(), aRetval.getMaxY());
}
- if (aGeo.nDrehWink!=0) {
- Point aD1(rR.TopLeft());
- aD1-=aR0.TopLeft();
- Point aD2(aD1);
- RotatePoint(aD2,Point(),aGeo.nSin,aGeo.nCos);
- aD2-=aD1;
- rR.Move(aD2.X(),aD2.Y());
+ else
+ {
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY() - (fHeightGrow * 0.5), aRetval.getMaxX(), aRetval.getMaxY() + (fHeightGrow * 0.5));
}
- return sal_True;
}
- }
- }
- return sal_False;
-}
-FASTBOOL SdrTextObj::NbcAdjustTextFrameWidthAndHeight(FASTBOOL bHgt, FASTBOOL bWdt)
-{
- FASTBOOL bRet=AdjustTextFrameWidthAndHeight(aRect,bHgt,bWdt);
- if (bRet) {
- SetRectsDirty();
- if (HAS_BASE(SdrRectObj,this)) { // mal wieder 'nen Hack
- ((SdrRectObj*)this)->SetXPolyDirty();
- }
- if (HAS_BASE(SdrCaptionObj,this)) { // mal wieder 'nen Hack
- ((SdrCaptionObj*)this)->ImpRecalcTail();
+ if(!aOriginalMinimum.equal(aRetval.getMinimum()) && isRotatedOrSheared())
+ {
+ basegfx::B2DHomMatrix aCorrector(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ getSdrObjectScale(),
+ basegfx::absolute(getSdrObjectTranslate())));
+
+ aCorrector.invert();
+ aCorrector = getSdrObjectTransformation() * aCorrector;
+
+ const basegfx::B2DPoint aCorrectedTopLeft(aCorrector * aRetval.getMinimum());
+
+ aCorrector.identity();
+ aCorrector.translate(aCorrectedTopLeft - aRetval.getMinimum());
+
+ aRetval.transform(aCorrector);
+
+ // TTTT: Check if the above solution works
+ //
+ //const sal_Int32 aOldRotation(sdr::legacy::GetRotateAngle(*this));
+ //
+ //if (aOldRotation)
+ //{
+ // Point aD1(rR.TopLeft());
+ // aD1-=aOriginalMinimum;
+ // Point aD2(aD1);
+ // RotatePoint(aD2,Point(),sin(aOldRotation*nPi180), cos(aOldRotation*nPi180));
+ // aD2-=aD1;
+ // rR.Move(aD2.X(),aD2.Y());
+ //}
+ }
}
}
- return bRet;
+
+ return aRetval;
}
-FASTBOOL SdrTextObj::AdjustTextFrameWidthAndHeight(FASTBOOL bHgt, FASTBOOL bWdt)
+bool SdrTextObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
- Rectangle aNeuRect(aRect);
- FASTBOOL bRet=AdjustTextFrameWidthAndHeight(aNeuRect,bHgt,bWdt);
- if (bRet) {
- Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- // #110094#-14 SendRepaintBroadcast();
- aRect=aNeuRect;
- SetRectsDirty();
- if (HAS_BASE(SdrRectObj,this)) { // mal wieder 'nen Hack
- ((SdrRectObj*)this)->SetXPolyDirty();
- }
- if (HAS_BASE(SdrCaptionObj,this)) { // mal wieder 'nen Hack
+ const basegfx::B2DRange aOldRange(getSdrObjectTranslate(), getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+ const basegfx::B2DRange aNewRange(AdjustTextFrameWidthAndHeight(aOldRange, bHgt, bWdt));
+
+ if(!aNewRange.equal(aOldRange))
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ sdr::legacy::SetLogicRange(*this, aNewRange);
+
+ if(dynamic_cast< SdrCaptionObj* >(this))
+ {
+ // mal wieder 'nen Hack
((SdrCaptionObj*)this)->ImpRecalcTail();
}
+
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+
+ return true;
}
- return bRet;
+
+ return false;
}
void SdrTextObj::ImpSetTextStyleSheetListeners()
{
- SfxStyleSheetBasePool* pStylePool=pModel!=NULL ? pModel->GetStyleSheetPool() : NULL;
- if (pStylePool!=NULL)
+ SfxStyleSheetBasePool* pStylePool = getSdrModelFromSdrObject().GetStyleSheetPool();
+
+ if (pStylePool!=0)
{
Container aStyles(1024,64,64);
OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
- if (pOutlinerParaObject!=NULL)
+
+ if(pOutlinerParaObject)
{
// Zunaechst werden alle im ParaObject enthaltenen StyleSheets
// im Container aStyles gesammelt. Dazu wird die Family jeweils
@@ -272,7 +370,7 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
aStyleName += sal_Unicode('|');
aStyleName += aFam;
- sal_Bool bFnd(sal_False);
+ bool bFnd(false);
sal_uInt32 nNum(aStyles.Count());
while(!bFnd && nNum > 0)
@@ -292,7 +390,9 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
// nun die Strings im Container durch StyleSheet* ersetzten
sal_uIntPtr nNum=aStyles.Count();
- while (nNum>0) {
+
+ while (nNum>0)
+ {
nNum--;
XubString* pName=(XubString*)aStyles.GetObject(nNum);
@@ -307,51 +407,78 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
SfxStyleFamily eFam=(SfxStyleFamily)nFam;
SfxStyleSheetBase* pStyleBase=pStylePool->Find(*pName,eFam);
- SfxStyleSheet* pStyle=PTR_CAST(SfxStyleSheet,pStyleBase);
+ SfxStyleSheet* pStyle = dynamic_cast< SfxStyleSheet* >( pStyleBase);
delete pName;
- if (pStyle!=NULL && pStyle!=GetStyleSheet()) {
+
+ if (pStyle!=0 && pStyle!=GetStyleSheet())
+ {
aStyles.Replace(pStyle,nNum);
- } else {
+ }
+ else
+ {
aStyles.Remove(nNum);
}
}
+
// jetzt alle ueberfluessigen StyleSheets entfernen
nNum=GetBroadcasterCount();
- while (nNum>0) {
+
+ while (nNum>0)
+ {
nNum--;
SfxBroadcaster* pBroadcast=GetBroadcasterJOE((sal_uInt16)nNum);
- SfxStyleSheet* pStyle=PTR_CAST(SfxStyleSheet,pBroadcast);
- if (pStyle!=NULL && pStyle!=GetStyleSheet()) { // Sonderbehandlung fuer den StyleSheet des Objekts
- if (aStyles.GetPos(pStyle)==CONTAINER_ENTRY_NOTFOUND) {
+ SfxStyleSheet* pStyle = dynamic_cast< SfxStyleSheet* >( pBroadcast);
+ if (pStyle!=0 && pStyle!=GetStyleSheet())
+ {
+ // Sonderbehandlung fuer den StyleSheet des Objekts
+ if (aStyles.GetPos(pStyle)==CONTAINER_ENTRY_NOTFOUND)
+ {
EndListening(*pStyle);
}
}
}
+
// und schliesslich alle in aStyles enthaltenen StyleSheets mit den vorhandenen Broadcastern mergen
nNum=aStyles.Count();
- while (nNum>0) {
+
+ while (nNum>0)
+ {
nNum--;
SfxStyleSheet* pStyle=(SfxStyleSheet*)aStyles.GetObject(nNum);
// StartListening soll selbst nachsehen, ob hier nicht evtl. schon gehorcht wird
- StartListening(*pStyle,sal_True);
+ StartListening(*pStyle,true);
}
}
}
-void SdrTextObj::NbcResizeTextAttributes(const Fraction& xFact, const Fraction& yFact)
+void SdrTextObj::ResizeTextAttributes(const Fraction& xFact, const Fraction& yFact)
{
OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
- if (pOutlinerParaObject!=NULL && xFact.IsValid() && yFact.IsValid())
+
+ if (pOutlinerParaObject!=0 && xFact.IsValid() && yFact.IsValid())
{
Fraction n100(100,1);
- long nX=long(xFact*n100);
- long nY=long(yFact*n100);
- if (nX<0) nX=-nX;
- if (nX<1) nX=1;
- if (nX>0xFFFF) nX=0xFFFF;
- if (nY<0) nY=-nY;
- if (nY<1) nY=1;
- if (nY>0xFFFF) nY=0xFFFF;
+ sal_Int32 nX=long(xFact*n100);
+ sal_Int32 nY=long(yFact*n100);
+
+ if (nX<0)
+ nX=-nX;
+
+ if (nX<1)
+ nX=1;
+
+ if (nX>0xFFFF)
+ nX=0xFFFF;
+
+ if (nY<0)
+ nY=-nY;
+
+ if (nY<1)
+ nY=1;
+
+ if (nY>0xFFFF)
+ nY=0xFFFF;
+
if (nX!=100 || nY!=100)
{
// Rahmenattribute
@@ -360,23 +487,39 @@ void SdrTextObj::NbcResizeTextAttributes(const Fraction& xFact, const Fraction&
const SvxFontHeightItem& rOldHgt=(SvxFontHeightItem&)rSet.Get(EE_CHAR_FONTHEIGHT);
// erstmal die alten Werte holen
- long nRelWdt=rOldWdt.GetValue();
- long nAbsHgt=rOldHgt.GetHeight();
- long nRelHgt=rOldHgt.GetProp();
+ sal_Int32 nRelWdt=rOldWdt.GetValue();
+ sal_Int32 nAbsHgt=rOldHgt.GetHeight();
+ sal_Int32 nRelHgt=rOldHgt.GetProp();
// Relative Breite aendern
nRelWdt*=nX;
nRelWdt/=nY;
- if (nRelWdt<0) nRelWdt=-nRelWdt; // nicht negativ
- if (nRelWdt<=0) nRelWdt=1; // und mind. 1%
- if (nRelWdt>0xFFFF) nRelWdt=0xFFFF;
+
+ // nicht negativ
+ if (nRelWdt<0)
+ nRelWdt=-nRelWdt;
+
+ // und mind. 1%
+ if (nRelWdt<=0)
+ nRelWdt=1;
+
+ if (nRelWdt>0xFFFF)
+ nRelWdt=0xFFFF;
// Absolute Hoehe aendern
nAbsHgt*=nY;
nAbsHgt/=100;
- if (nAbsHgt<0) nAbsHgt=-nAbsHgt; // nicht negativ
- if (nAbsHgt<=0) nAbsHgt=1; // und mind. 1
- if (nAbsHgt>0xFFFF) nAbsHgt=0xFFFF;
+
+ // nicht negativ
+ if (nAbsHgt<0)
+ nAbsHgt=-nAbsHgt;
+
+ // und mind. 1
+ if (nAbsHgt<=0)
+ nAbsHgt=1;
+
+ if (nAbsHgt>0xFFFF)
+ nAbsHgt=0xFFFF;
// und nun attributieren
SetObjectItem(SvxCharScaleWidthItem( (sal_uInt16) nRelWdt, EE_CHAR_FONTWIDTH));
@@ -387,7 +530,7 @@ void SdrTextObj::NbcResizeTextAttributes(const Fraction& xFact, const Fraction&
rOutliner.SetText(*pOutlinerParaObject);
rOutliner.DoStretchChars((sal_uInt16)nX,(sal_uInt16)nY);
OutlinerParaObject* pNewPara=rOutliner.CreateParaObject();
- NbcSetOutlinerParaObject(pNewPara);
+ SetOutlinerParaObject(pNewPara);
rOutliner.Clear();
}
}
@@ -410,8 +553,8 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
{
Outliner* pOutliner = 0;
- if( pEdtOutl || (pText == getActiveText()) )
- pOutliner = pEdtOutl;
+ if( IsTextEditActive() || (pText == getActiveText()) )
+ pOutliner = GetTextEditOutliner();
if(!pOutliner)
{
@@ -426,12 +569,12 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
pOutliner->RemoveAttribs( aSelAll, false, (*aIter++) );
}
- if(!pEdtOutl || (pText != getActiveText()) )
+ if(!IsTextEditActive() || (pText != getActiveText()) )
{
const sal_uInt32 nParaCount = pOutliner->GetParagraphCount();
OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
pOutliner->Clear();
- NbcSetOutlinerParaObjectForText(pTemp, pText);
+ SetOutlinerParaObjectForText(pTemp, pText);
}
}
}
@@ -439,7 +582,7 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
bool SdrTextObj::HasText() const
{
- if( pEdtOutl )
+ if( IsTextEditActive() )
return HasEditText();
OutlinerParaObject* pOPO = GetOutlinerParaObject();
@@ -456,3 +599,5 @@ bool SdrTextObj::HasText() const
return bHasText;
}
+
+// eof
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index ccb6bd0cfbd5..5379c762ab48 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -28,58 +28,15 @@
#include <svx/svdhdl.hxx>
#include <svx/svddrag.hxx>
#include <svx/svdview.hxx>
-#include <svx/svdorect.hxx> // fuer SetXPolyDirty in MovCreate bei SolidDragging
-#include "svx/svdglob.hxx" // Stringcache
-#include "svx/svdstr.hrc" // Objektname
+#include <svx/svdglob.hxx> // Stringcache
+#include <svx/svdstr.hrc> // Objektname
#include <svx/svdoashp.hxx>
#include <tools/bigint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@ @@@@@ @@@@@@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@@ @@ @@ @@ @@@@@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
-//
-// Dragging, Handles, Create
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_uInt32 SdrTextObj::GetHdlCount() const
-{
- return 8L;
-}
-
-SdrHdl* SdrTextObj::GetHdl(sal_uInt32 nHdlNum) const
-{
- SdrHdl* pH=NULL;
- Point aPnt;
- SdrHdlKind eKind=HDL_MOVE;
- switch (nHdlNum) {
- case 0: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links
- case 1: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben
- case 2: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts
- case 3: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links
- case 4: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts
- case 5: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links
- case 6: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten
- case 7: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts
- }
- if (aGeo.nShearWink!=0) ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- if (eKind!=HDL_MOVE) {
- pH=new SdrHdl(aPnt,eKind);
- pH->SetObj((SdrObject*)this);
- pH->SetDrehWink(aGeo.nDrehWink);
- }
- return pH;
-}
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -88,194 +45,64 @@ bool SdrTextObj::hasSpecialDrag() const
return true;
}
-Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const
+String SdrTextObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
{
- Rectangle aTmpRect(aRect);
- const SdrHdl* pHdl=rDrag.GetHdl();
- SdrHdlKind eHdl=pHdl==NULL ? HDL_MOVE : pHdl->GetKind();
- FASTBOOL bEcke=(eHdl==HDL_UPLFT || eHdl==HDL_UPRGT || eHdl==HDL_LWLFT || eHdl==HDL_LWRGT);
- FASTBOOL bOrtho=rDrag.GetView()!=NULL && rDrag.GetView()->IsOrtho();
- FASTBOOL bBigOrtho=bEcke && bOrtho && rDrag.GetView()->IsBigOrtho();
- Point aPos(rDrag.GetNow());
- // Unrotate:
- if (aGeo.nDrehWink!=0) RotatePoint(aPos,aTmpRect.TopLeft(),-aGeo.nSin,aGeo.nCos);
- // Unshear:
- if (aGeo.nShearWink!=0) ShearPoint(aPos,aTmpRect.TopLeft(),-aGeo.nTan);
- //
- FASTBOOL bLft=(eHdl==HDL_UPLFT || eHdl==HDL_LEFT || eHdl==HDL_LWLFT);
- FASTBOOL bRgt=(eHdl==HDL_UPRGT || eHdl==HDL_RIGHT || eHdl==HDL_LWRGT);
- FASTBOOL bTop=(eHdl==HDL_UPRGT || eHdl==HDL_UPPER || eHdl==HDL_UPLFT);
- FASTBOOL bBtm=(eHdl==HDL_LWRGT || eHdl==HDL_LOWER || eHdl==HDL_LWLFT);
- if (bLft) aTmpRect.Left() =aPos.X();
- if (bRgt) aTmpRect.Right() =aPos.X();
- if (bTop) aTmpRect.Top() =aPos.Y();
- if (bBtm) aTmpRect.Bottom()=aPos.Y();
- if (bOrtho) { // Ortho
- long nWdt0=aRect.Right() -aRect.Left();
- long nHgt0=aRect.Bottom()-aRect.Top();
- long nXMul=aTmpRect.Right() -aTmpRect.Left();
- long nYMul=aTmpRect.Bottom()-aTmpRect.Top();
- long nXDiv=nWdt0;
- long nYDiv=nHgt0;
- FASTBOOL bXNeg=(nXMul<0)!=(nXDiv<0);
- FASTBOOL bYNeg=(nYMul<0)!=(nYDiv<0);
- nXMul=Abs(nXMul);
- nYMul=Abs(nYMul);
- nXDiv=Abs(nXDiv);
- nYDiv=Abs(nYDiv);
- Fraction aXFact(nXMul,nXDiv); // Fractions zum kuerzen
- Fraction aYFact(nYMul,nYDiv); // und zum vergleichen
- nXMul=aXFact.GetNumerator();
- nYMul=aYFact.GetNumerator();
- nXDiv=aXFact.GetDenominator();
- nYDiv=aYFact.GetDenominator();
- if (bEcke) { // Eckpunkthandles
- FASTBOOL bUseX=(aXFact<aYFact) != bBigOrtho;
- if (bUseX) {
- long nNeed=long(BigInt(nHgt0)*BigInt(nXMul)/BigInt(nXDiv));
- if (bYNeg) nNeed=-nNeed;
- if (bTop) aTmpRect.Top()=aTmpRect.Bottom()-nNeed;
- if (bBtm) aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
- } else {
- long nNeed=long(BigInt(nWdt0)*BigInt(nYMul)/BigInt(nYDiv));
- if (bXNeg) nNeed=-nNeed;
- if (bLft) aTmpRect.Left()=aTmpRect.Right()-nNeed;
- if (bRgt) aTmpRect.Right()=aTmpRect.Left()+nNeed;
- }
- } else { // Scheitelpunkthandles
- if ((bLft || bRgt) && nXDiv!=0) {
- long nHgt0b=aRect.Bottom()-aRect.Top();
- long nNeed=long(BigInt(nHgt0b)*BigInt(nXMul)/BigInt(nXDiv));
- aTmpRect.Top()-=(nNeed-nHgt0b)/2;
- aTmpRect.Bottom()=aTmpRect.Top()+nNeed;
- }
- if ((bTop || bBtm) && nYDiv!=0) {
- long nWdt0b=aRect.Right()-aRect.Left();
- long nNeed=long(BigInt(nWdt0b)*BigInt(nYMul)/BigInt(nYDiv));
- aTmpRect.Left()-=(nNeed-nWdt0b)/2;
- aTmpRect.Right()=aTmpRect.Left()+nNeed;
- }
- }
- }
- if (!ISA(SdrObjCustomShape)) // not justifying for CustomShapes to be able to detect if a shape has to be mirrored
- ImpJustifyRect(aTmpRect);
- return aTmpRect;
+ XubString aStr;
+ TakeMarkedDescriptionString(STR_DragRectResize,aStr);
+ return aStr;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// drag
-
-bool SdrTextObj::applySpecialDrag(SdrDragStat& rDrag)
+bool SdrTextObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- Rectangle aNewRect(ImpDragCalcRect(rDrag));
+ bool bRetval(SdrAttrObj::EndCreate(rStat, eCmd));
- if(aNewRect.TopLeft() != aRect.TopLeft() && (aGeo.nDrehWink || aGeo.nShearWink))
+ if(bTextFrame)
{
- Point aNewPos(aNewRect.TopLeft());
+ const bool bAutoGrowHeight(IsAutoGrowHeight());
+ const bool bAutoGrowWidth(IsAutoGrowWidth());
- if(aGeo.nShearWink)
- ShearPoint(aNewPos,aRect.TopLeft(),aGeo.nTan);
+ if(bAutoGrowHeight || bAutoGrowWidth)
+ {
+ const basegfx::B2DVector aAbsScale(basegfx::absolute(getSdrObjectScale()));
- if(aGeo.nDrehWink)
- RotatePoint(aNewPos,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
-
- aNewRect.SetPos(aNewPos);
- }
-
- if(aNewRect != aRect)
- {
- NbcSetLogicRect(aNewRect);
- }
-
- return true;
-}
-
-String SdrTextObj::getSpecialDragComment(const SdrDragStat& /*rDrag*/) const
-{
- XubString aStr;
- ImpTakeDescriptionStr(STR_DragRectResize,aStr);
- return aStr;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Create
-
-FASTBOOL SdrTextObj::BegCreate(SdrDragStat& rStat)
-{
- rStat.SetOrtho4Possible();
- Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
- aRect1.Justify();
- rStat.SetActionRect(aRect1);
- aRect = aRect1;
- return sal_True;
-}
+ if(bAutoGrowHeight)
+ {
+ // MinTextHeight
+ SetMinTextFrameHeight(basegfx::fround(aAbsScale.getY()));
+ }
-FASTBOOL SdrTextObj::MovCreate(SdrDragStat& rStat)
-{
- Rectangle aRect1;
- rStat.TakeCreateRect(aRect1);
- ImpJustifyRect(aRect1);
- rStat.SetActionRect(aRect1);
- aRect=aRect1; // fuer ObjName
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- if (HAS_BASE(SdrRectObj,this)) {
- ((SdrRectObj*)this)->SetXPolyDirty();
- }
- return sal_True;
-}
+ if(bAutoGrowWidth)
+ {
+ // MinTextWidth
+ SetMinTextFrameWidth(basegfx::fround(aAbsScale.getX()));
+ }
-FASTBOOL SdrTextObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
-{
- rStat.TakeCreateRect(aRect);
- ImpJustifyRect(aRect);
- if (bTextFrame) {
- if (IsAutoGrowHeight()) {
- // MinTextHeight
- long nHgt=aRect.GetHeight()-1;
- if (nHgt==1) nHgt=0;
- NbcSetMinTextFrameHeight(nHgt);
+ // Textrahmen neu berechnen
+ AdjustTextFrameWidthAndHeight();
+ ActionChanged();
}
- if (IsAutoGrowWidth()) {
- // MinTextWidth
- long nWdt=aRect.GetWidth()-1;
- if (nWdt==1) nWdt=0;
- NbcSetMinTextFrameWidth(nWdt);
- }
- // Textrahmen neu berechnen
- NbcAdjustTextFrameWidthAndHeight();
- }
- SetRectsDirty();
- if (HAS_BASE(SdrRectObj,this)) {
- ((SdrRectObj*)this)->SetXPolyDirty();
}
- return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
+
+ return bRetval;
}
void SdrTextObj::BrkCreate(SdrDragStat& /*rStat*/)
{
}
-FASTBOOL SdrTextObj::BckCreate(SdrDragStat& /*rStat*/)
+bool SdrTextObj::BckCreate(SdrDragStat& /*rStat*/)
{
- return sal_True;
+ return true;
}
-basegfx::B2DPolyPolygon SdrTextObj::TakeCreatePoly(const SdrDragStat& rDrag) const
+Pointer SdrTextObj::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
- Rectangle aRect1;
- rDrag.TakeCreateRect(aRect1);
- aRect1.Justify();
-
- basegfx::B2DPolyPolygon aRetval;
- const basegfx::B2DRange aRange(aRect1.Left(), aRect1.Top(), aRect1.Right(), aRect1.Bottom());
- aRetval.append(basegfx::tools::createPolygonFromRect(aRange));
- return aRetval;
-}
+ if (IsTextFrame())
+ {
+ return Pointer(POINTER_DRAW_TEXT);
+ }
-Pointer SdrTextObj::GetCreatePointer() const
-{
- if (IsTextFrame()) return Pointer(POINTER_DRAW_TEXT);
return Pointer(POINTER_CROSS);
}
+// eof
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index c9184642a7ff..9b9e531275d2 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -25,53 +25,45 @@
#include "precompiled_svx.hxx"
#include <svx/svdotext.hxx>
-#include "svx/svditext.hxx"
-#include <svx/svdmodel.hxx> // fuer GetMaxObjSize
+#include <editeng/editdata.hxx>
+#include <svx/svdmodel.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdoutl.hxx>
#include <editeng/outliner.hxx>
#include <editeng/editstat.hxx>
#include <svl/itemset.hxx>
#include <editeng/eeitem.hxx>
#include <svx/sdtfchim.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
+#include <svx/sdrtexthelpers.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@ @@@@@ @@@@@@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@@ @@ @@ @@ @@@@@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
-//
-// TextEdit
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-FASTBOOL SdrTextObj::HasTextEdit() const
+bool SdrTextObj::HasTextEdit() const
{
// lt. Anweisung von MB duerfen gelinkte Textobjekte nun doch
// geaendert werden (kein automatisches Reload)
- return sal_True;
+ return true;
}
-sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
+bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
{
- if (pEdtOutl!=NULL) return sal_False; // Textedit laeuft evtl. schon an einer anderen View!
+ if (pEdtOutl!=0) return sal_False; // Textedit laeuft evtl. schon an einer anderen View!
pEdtOutl=&rOutl;
// #101684#
- mbInEditMode = sal_True;
+ mbInEditMode = true;
sal_uInt16 nOutlinerMode = OUTLINERMODE_OUTLINEOBJECT;
if ( !IsOutlText() )
nOutlinerMode = OUTLINERMODE_TEXTOBJECT;
rOutl.Init( nOutlinerMode );
- rOutl.SetRefDevice( pModel->GetRefDevice() );
+ rOutl.SetRefDevice( getSdrModelFromSdrObject().GetReferenceDevice() );
SdrFitToSizeType eFit=GetFitToSize();
- FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- FASTBOOL bContourFrame=IsContourTextFrame();
+ bool bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
+ bool bContourFrame=IsContourTextFrame();
ImpSetTextEditParams();
if (!bContourFrame) {
@@ -82,7 +74,7 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
}
OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
- if(pOutlinerParaObject!=NULL)
+ if(pOutlinerParaObject!=0)
{
rOutl.SetText(*GetOutlinerParaObject());
rOutl.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
@@ -110,27 +102,18 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
}
if (bFitToSize)
{
- Rectangle aAnchorRect;
- Rectangle aTextRect;
- TakeTextRect(rOutl, aTextRect, sal_False,
- &aAnchorRect/* #97097# give sal_True here, not sal_False */);
- Fraction aFitXKorreg(1,1);
- ImpSetCharStretching(rOutl,aTextRect,aAnchorRect,aFitXKorreg);
+ basegfx::B2DRange aAnchorRange;
+ basegfx::B2DRange aTextRange;
+
+ TakeTextRange(rOutl, aTextRange, aAnchorRange);
+ ImpSetCharStretching(rOutl, aTextRange, aAnchorRange);
}
if(pOutlinerParaObject)
{
- // #78476# also repaint when animated text is put to edit mode
- // to not make appear the text double
- // #111096# should now repaint automatically.
- // sal_Bool bIsAnimated(pPlusData && pPlusData->pAnimator);
-
- if(aGeo.nDrehWink || IsFontwork() /*|| bIsAnimated*/)
+ if(IsFontwork() || sdr::legacy::GetRotateAngle(*this))
{
- // only repaint here, no real objectchange
-
-// ActionChanged();
- BroadcastObjectChange();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
}
}
@@ -140,28 +123,28 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
return sal_True;
}
-void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const
+void SdrTextObj::TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const
{
- SdrFitToSizeType eFit=GetFitToSize();
- FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- Size aPaperMin,aPaperMax;
- Rectangle aViewInit;
- TakeTextAnchorRect(aViewInit);
- if (aGeo.nDrehWink!=0) {
- Point aCenter(aViewInit.Center());
- aCenter-=aViewInit.TopLeft();
- Point aCenter0(aCenter);
- RotatePoint(aCenter,Point(),aGeo.nSin,aGeo.nCos);
- aCenter-=aCenter0;
- aViewInit.Move(aCenter.X(),aCenter.Y());
+ const SdrFitToSizeType eFit(GetFitToSize());
+ const bool bFitToSize(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit);
+ basegfx::B2DVector aPaperMin;
+ basegfx::B2DVector aPaperMax;
+
+ // get TextRange without shear, rotate and mirror, just scaled
+ // and centered in logic coordinates
+ basegfx::B2DRange aViewInit(getScaledCenteredTextRange(*this));
+
+ basegfx::B2DVector aAnkSiz(aViewInit.getRange());
+ basegfx::B2DVector aMaxSiz(1000000.0, 1000000.0);
+
+ if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getX()))
+ {
+ aMaxSiz.setX(getSdrModelFromSdrObject().GetMaxObjectScale().getX());
}
- Size aAnkSiz(aViewInit.GetSize());
- aAnkSiz.Width()--; aAnkSiz.Height()--; // weil GetSize() ein draufaddiert
- Size aMaxSiz(1000000,1000000);
- if (pModel!=NULL) {
- Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
- if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
+
+ if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getY()))
+ {
+ aMaxSiz.setY(getSdrModelFromSdrObject().GetMaxObjectScale().getY());
}
// #106879#
@@ -171,60 +154,74 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p
if(IsTextFrame())
{
- long nMinWdt=GetMinTextFrameWidth();
- long nMinHgt=GetMinTextFrameHeight();
- long nMaxWdt=GetMaxTextFrameWidth();
- long nMaxHgt=GetMaxTextFrameHeight();
- if (nMinWdt<1) nMinWdt=1;
- if (nMinHgt<1) nMinHgt=1;
- if (!bFitToSize) {
- if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width()) nMaxWdt=aMaxSiz.Width();
- if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
-
- if (!IsAutoGrowWidth() )
+ double fMinWdt(std::max(1.0, (double)GetMinTextFrameWidth()));
+ double fMinHgt(std::max(1.0, (double)GetMinTextFrameHeight()));
+ double fMaxWdt(GetMaxTextFrameWidth());
+ double fMaxHgt(GetMaxTextFrameHeight());
+
+ if(!bFitToSize)
+ {
+ if(basegfx::fTools::equalZero(fMaxWdt) || basegfx::fTools::more(fMaxWdt, aMaxSiz.getX()))
+ {
+ fMaxWdt = aMaxSiz.getX();
+ }
+
+ if(basegfx::fTools::equalZero(fMaxHgt) || basegfx::fTools::more(fMaxHgt, aMaxSiz.getY()))
{
- nMinWdt = aAnkSiz.Width();
- nMaxWdt = nMinWdt;
+ fMaxHgt = aMaxSiz.getY();
}
- if (!IsAutoGrowHeight())
+ if(!IsAutoGrowWidth())
{
- nMinHgt = aAnkSiz.Height();
- nMaxHgt = nMinHgt;
+ fMaxWdt = aAnkSiz.getX();
+ fMinWdt = fMaxWdt;
}
- SdrTextAniKind eAniKind=GetTextAniKind();
- SdrTextAniDirection eAniDirection=GetTextAniDirection();
+ if(!IsAutoGrowHeight())
+ {
+ fMaxHgt = aAnkSiz.getY();
+ fMinHgt = fMaxHgt;
+ }
+ const SdrTextAniKind eAniKind(GetTextAniKind());
// #101684#
- sal_Bool bInEditMode = IsInEditMode();
+ bool bInEditMode = IsInEditMode();
- if (!bInEditMode && (eAniKind==SDRTEXTANI_SCROLL || eAniKind==SDRTEXTANI_ALTERNATE || eAniKind==SDRTEXTANI_SLIDE))
+ if(!bInEditMode && (SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind))
{
+ const SdrTextAniDirection eAniDirection(GetTextAniDirection());
+
// Grenzenlose Papiergroesse fuer Laufschrift
- if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nMaxWdt=1000000;
- if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nMaxHgt=1000000;
+ if(SDRTEXTANI_LEFT == eAniDirection || SDRTEXTANI_RIGHT == eAniDirection)
+ {
+ fMaxWdt = 1000000.0;
+ }
+ else if(SDRTEXTANI_UP == eAniDirection || SDRTEXTANI_DOWN == eAniDirection)
+ {
+ fMaxHgt = 1000000.0;
+ }
}
// #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
if(IsVerticalWriting())
{
- nMaxWdt = 1000000;
+ fMaxWdt = 1000000.0;
}
else
{
- nMaxHgt = 1000000;
+ fMaxHgt = 1000000.0;
}
- aPaperMax.Width()=nMaxWdt;
- aPaperMax.Height()=nMaxHgt;
+ aPaperMax.setX(fMaxWdt);
+ aPaperMax.setY(fMaxHgt);
}
else
{
aPaperMax=aMaxSiz;
}
- aPaperMin.Width()=nMinWdt;
- aPaperMin.Height()=nMinHgt;
+
+ aPaperMin.setX(fMinWdt);
+ aPaperMin.setY(fMinHgt);
}
else
{
@@ -240,47 +237,111 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p
aPaperMax=aMaxSiz;
}
- if (pViewMin!=NULL) {
+ if(pViewMin)
+ {
*pViewMin=aViewInit;
+ const double fXFree(aAnkSiz.getX() - aPaperMin.getX());
+
+ if(SDRTEXTHORZADJUST_LEFT == eHAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY(),
+ pViewMin->getMaxX() - fXFree,
+ pViewMin->getMaxY());
+ }
+ else if(SDRTEXTHORZADJUST_RIGHT == eHAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX() + fXFree,
+ pViewMin->getMinY(),
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY());
+ }
+ else
+ {
+ const double fNewMinX(pViewMin->getMinX() + (fXFree * 0.5));
+ *pViewMin = basegfx::B2DRange(
+ fNewMinX,
+ pViewMin->getMinY(),
+ fNewMinX + aPaperMin.getX(),
+ pViewMin->getMaxY());
+ }
- long nXFree=aAnkSiz.Width()-aPaperMin.Width();
- if (eHAdj==SDRTEXTHORZADJUST_LEFT) pViewMin->Right()-=nXFree;
- else if (eHAdj==SDRTEXTHORZADJUST_RIGHT) pViewMin->Left()+=nXFree;
- else { pViewMin->Left()+=nXFree/2; pViewMin->Right()=pViewMin->Left()+aPaperMin.Width(); }
+ const double fYFree(aAnkSiz.getY() - aPaperMin.getY());
- long nYFree=aAnkSiz.Height()-aPaperMin.Height();
- if (eVAdj==SDRTEXTVERTADJUST_TOP) pViewMin->Bottom()-=nYFree;
- else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) pViewMin->Top()+=nYFree;
- else { pViewMin->Top()+=nYFree/2; pViewMin->Bottom()=pViewMin->Top()+aPaperMin.Height(); }
+ if(SDRTEXTVERTADJUST_TOP == eVAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY(),
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY() - fYFree);
+ }
+ else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
+ {
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY() + fYFree,
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY());
+ }
+ else
+ {
+ const double fNewMinY(pViewMin->getMinY() + (fYFree * 0.5));
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ fNewMinY,
+ pViewMin->getMaxX(),
+ fNewMinY + aPaperMin.getY());
+ }
}
// Die PaperSize soll in den meisten Faellen von selbst wachsen
// #89459#
if(IsVerticalWriting())
- aPaperMin.Width() = 0;
+ {
+ aPaperMin.setX(0.0);
+ }
else
- aPaperMin.Height() = 0; // #33102#
+ {
+ // #33102#
+ aPaperMin.setY(0.0);
+ }
- if(eHAdj!=SDRTEXTHORZADJUST_BLOCK || bFitToSize) {
- aPaperMin.Width()=0;
+ if(SDRTEXTHORZADJUST_BLOCK != eHAdj || bFitToSize)
+ {
+ aPaperMin.setX(0.0);
}
// #103516# For complete ver adjust support, set paper min height to 0, here.
if(SDRTEXTVERTADJUST_BLOCK != eVAdj || bFitToSize)
{
- aPaperMin.Height() = 0;
+ aPaperMin.setY(0.0);
+ }
+
+ if(pPaperMin)
+ {
+ *pPaperMin = aPaperMin;
+ }
+
+ if(pPaperMax)
+ {
+ *pPaperMax = aPaperMax;
+ }
+
+ if(pViewInit)
+ {
+ *pViewInit = aViewInit;
}
- if (pPaperMin!=NULL) *pPaperMin=aPaperMin;
- if (pPaperMax!=NULL) *pPaperMax=aPaperMax;
- if (pViewInit!=NULL) *pViewInit=aViewInit;
}
void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
{
if(rOutl.IsModified())
{
- OutlinerParaObject* pNewText = NULL;
+ OutlinerParaObject* pNewText = 0;
if(HasTextImpl( &rOutl ) )
{
@@ -292,20 +353,20 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
}
// need to end edit mode early since SetOutlinerParaObject already
- // uses GetCurrentBoundRect() which needs to take the text into account
+ // uses getObjectRange() which needs to take the text into account
// to work correct
- mbInEditMode = sal_False;
+ mbInEditMode = false;
SetOutlinerParaObject(pNewText);
}
- pEdtOutl = NULL;
+ pEdtOutl = 0;
rOutl.Clear();
sal_uInt32 nStat = rOutl.GetControlWord();
nStat &= ~EE_CNTRL_AUTOPAGESIZE;
rOutl.SetControlWord(nStat);
// #101684#
- mbInEditMode = sal_False;
+ mbInEditMode = false;
}
sal_uInt16 SdrTextObj::GetOutlinerViewAnchorMode() const
@@ -344,27 +405,42 @@ sal_uInt16 SdrTextObj::GetOutlinerViewAnchorMode() const
void SdrTextObj::ImpSetTextEditParams() const
{
- if (pEdtOutl!=NULL) {
- FASTBOOL bUpdMerk=pEdtOutl->GetUpdateMode();
- if (bUpdMerk) pEdtOutl->SetUpdateMode(sal_False);
- Size aPaperMin;
- Size aPaperMax;
- Rectangle aEditArea;
- TakeTextEditArea(&aPaperMin,&aPaperMax,&aEditArea,NULL);
- //SdrFitToSizeType eFit=GetFitToSize();
- //FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- FASTBOOL bContourFrame=IsContourTextFrame();
- //EVAnchorMode eAM=(EVAnchorMode)GetOutlinerViewAnchorMode();
- //sal_uIntPtr nViewAnz=pEdtOutl->GetViewCount();
- pEdtOutl->SetMinAutoPaperSize(aPaperMin);
- pEdtOutl->SetMaxAutoPaperSize(aPaperMax);
+ if(pEdtOutl)
+ {
+ bool bUpdMerk(pEdtOutl->GetUpdateMode());
+
+ if(bUpdMerk)
+ {
+ pEdtOutl->SetUpdateMode(false);
+ }
+
+ basegfx::B2DVector aPaperMin;
+ basegfx::B2DVector aPaperMax;
+// basegfx::B2DRange aEditArea; // TTTT: aEditArea not used, check if calculation changes when leaving out
+
+// TakeTextEditArea(&aPaperMin, &aPaperMax, &aEditArea, 0);
+ TakeTextEditArea(&aPaperMin, &aPaperMax, 0, 0);
+
+ const Size aOldPaperMin(basegfx::fround(aPaperMin.getX()), basegfx::fround(aPaperMin.getY()));
+ const Size aOldPaperMax(basegfx::fround(aPaperMax.getX()), basegfx::fround(aPaperMax.getY()));
+
+ pEdtOutl->SetMinAutoPaperSize(aOldPaperMin);
+ pEdtOutl->SetMaxAutoPaperSize(aOldPaperMax);
pEdtOutl->SetPaperSize(Size());
- if (bContourFrame) {
- Rectangle aAnchorRect;
- TakeTextAnchorRect(aAnchorRect);
- ImpSetContourPolygon(*pEdtOutl,aAnchorRect, sal_True);
+
+ if(IsContourTextFrame())
+ {
+ basegfx::B2DPolyPolygon aContourOutline(getAlignedTextContourPolyPolygon(*this));
+ aContourOutline.transform(basegfx::tools::createTranslateB2DHomMatrix(-aContourOutline.getB2DRange().getMinimum()));
+ pEdtOutl->SetPolygon(aContourOutline);
+ }
+
+ if(bUpdMerk)
+ {
+ pEdtOutl->ClearPolygon();
+ pEdtOutl->SetUpdateMode(true);
}
- if (bUpdMerk) pEdtOutl->SetUpdateMode(sal_True);
}
}
+// eof
diff --git a/svx/source/svdraw/svdotxfl.cxx b/svx/source/svdraw/svdotxfl.cxx
index 7815dd6ae390..5ed1580c7d36 100644
--- a/svx/source/svdraw/svdotxfl.cxx
+++ b/svx/source/svdraw/svdotxfl.cxx
@@ -29,9 +29,9 @@
#include <svx/svdotext.hxx>
#include <svx/svdfield.hxx>
-static sal_Bool bInit = sal_False;
+static bool bInit = false;
-// Do not remove this, it is still used in src536a!
+// Do not remove this, it is still used in src536a! TTTT: is this used?
void SdrRegisterFieldClasses()
{
if ( !bInit )
@@ -40,15 +40,15 @@ void SdrRegisterFieldClasses()
SvxFieldItem::GetClassManager().SV_CLASS_REGISTER(SvxHeaderField);
SvxFieldItem::GetClassManager().SV_CLASS_REGISTER(SvxFooterField);
SvxFieldItem::GetClassManager().SV_CLASS_REGISTER(SvxDateTimeField);
- bInit = sal_True;
+ bInit = true;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////// */
-FASTBOOL SdrTextObj::CalcFieldValue(const SvxFieldItem& /*rField*/, sal_uInt16 /*nPara*/, sal_uInt16 /*nPos*/,
- FASTBOOL /*bEdit*/, Color*& /*rpTxtColor*/, Color*& /*rpFldColor*/, XubString& /*rRet*/) const
+bool SdrTextObj::CalcFieldValue(const SvxFieldItem& /*rField*/, sal_uInt16 /*nPara*/, sal_uInt16 /*nPos*/,
+ bool /*bEdit*/, Color*& /*rpTxtColor*/, Color*& /*rpFldColor*/, XubString& /*rRet*/) const
{
- return sal_False;
+ return false;
}
diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx
index 0dc2c2a29175..83009caf77a7 100644
--- a/svx/source/svdraw/svdotxln.cxx
+++ b/svx/source/svdraw/svdotxln.cxx
@@ -30,33 +30,16 @@
#include <ucbhelper/contentbroker.hxx>
#include <unotools/datetime.hxx>
#include <svx/svdotext.hxx>
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdmodel.hxx>
#include <editeng/editdata.hxx>
#include <sfx2/lnkbase.hxx>
#include <sfx2/linkmgr.hxx>
#include <tools/urlobj.hxx>
#include <svl/urihelper.hxx>
-
-// #90477#
#include <tools/tenccvt.hxx>
-#ifndef SVX_LIGHT
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@@ @@@@@@ @@@@@@ @@ @@ @@@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@@@ @@ @@ @@ @@@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@@@@ @@ @@ @@ @@ @@@@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@@ @@ @@ @@ @@ @@@ @@ @@
-// @@@@ @@@@@ @@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@ @@ @@ @@
-//
-// ImpSdrObjTextLink zur Verbindung von SdrTextObj und LinkManager
-//
-// Einem solchen Link merke ich mir als SdrObjUserData am Objekt. Im Gegensatz
-// zum Grafik-Link werden die ObjektDaten jedoch kopiert (fuer Paint, etc.).
-// Die Information ob das Objekt ein Link ist besteht genau darin, dass dem
-// Objekt ein entsprechender UserData-Record angehaengt ist oder nicht.
-//
////////////////////////////////////////////////////////////////////////////////////////////////////
class ImpSdrObjTextLink: public ::sfx2::SvBaseLink
@@ -74,7 +57,7 @@ public:
virtual void DataChanged( const String& rMimeType,
const ::com::sun::star::uno::Any & rValue );
- sal_Bool Connect() { return 0 != SvBaseLink::GetRealObject(); }
+ bool Connect() { return 0 != SvBaseLink::GetRealObject(); }
};
ImpSdrObjTextLink::~ImpSdrObjTextLink()
@@ -85,9 +68,9 @@ void ImpSdrObjTextLink::Closed()
{
if (pSdrObj )
{
- // pLink des Objekts auf NULL setzen, da die Link-Instanz ja gerade destruiert wird.
+ // pLink des Objekts auf 0 setzen, da die Link-Instanz ja gerade destruiert wird.
ImpSdrObjTextLinkUserData* pData=pSdrObj->GetLinkUserData();
- if (pData!=NULL) pData->pLink=NULL;
+ if (pData!=0) pData->pLink=0;
pSdrObj->ReleaseTextLink();
}
SvBaseLink::Closed();
@@ -97,8 +80,8 @@ void ImpSdrObjTextLink::Closed()
void ImpSdrObjTextLink::DataChanged( const String& /*rMimeType*/,
const ::com::sun::star::uno::Any & /*rValue */)
{
- FASTBOOL bForceReload=sal_False;
- SdrModel* pModel = pSdrObj ? pSdrObj->GetModel() : 0;
+ bool bForceReload=false;
+ SdrModel* pModel = pSdrObj ? &pSdrObj->getSdrModelFromSdrObject() : 0;
sfx2::LinkManager* pLinkManager= pModel ? pModel->GetLinkManager() : 0;
if( pLinkManager )
{
@@ -115,31 +98,20 @@ void ImpSdrObjTextLink::DataChanged( const String& /*rMimeType*/,
pData->aFileName = aFile;
pData->aFilterName = aFilter;
pSdrObj->SetChanged();
- bForceReload = sal_True;
+ bForceReload = true;
}
}
}
if (pSdrObj )
pSdrObj->ReloadLinkedText( bForceReload );
}
-#endif // SVX_LIGHT
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@ @@ @@ @@ @@ @@ @@ @@@@@ @@@@@@ @@@@@ @@@@@ @@@@ @@@@@@ @@@@
-// @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@@ @@@@ @@ @@ @@@@ @@@@@ @@@@@ @@ @@ @@@@@@ @@ @@@@@@
-// @@ @@ @@ @@@ @@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@ @@ @@ @@ @@ @@@@ @@@@@ @@@@@@ @@ @@ @@@@@ @@ @@ @@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1(ImpSdrObjTextLinkUserData,SdrObjUserData);
ImpSdrObjTextLinkUserData::ImpSdrObjTextLinkUserData(SdrTextObj* pObj1):
- SdrObjUserData(SdrInventor,SDRUSERDATA_OBJTEXTLINK,0),
+ SdrObjUserData(SdrInventor,SDRUSERDATA_OBJTEXTLINK),
pObj(pObj1),
- pLink(NULL),
+ pLink(0),
eCharSet(RTL_TEXTENCODING_DONTKNOW)
{
}
@@ -158,21 +130,11 @@ SdrObjUserData* ImpSdrObjTextLinkUserData::Clone(SdrObject* pObj1) const
pData->aFilterName=aFilterName;
pData->aFileDate0 =aFileDate0;
pData->eCharSet =eCharSet;
- pData->pLink=NULL;
+ pData->pLink=0;
return pData;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@ @@@@@ @@@@@@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@@ @@ @@ @@ @@@@@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrTextObj::SetTextLink(const String& rFileName, const String& rFilterName, rtl_TextEncoding eCharSet)
{
@@ -180,7 +142,7 @@ void SdrTextObj::SetTextLink(const String& rFileName, const String& rFilterName,
eCharSet = gsl_getSystemTextEncoding();
ImpSdrObjTextLinkUserData* pData=GetLinkUserData();
- if (pData!=NULL) {
+ if (pData!=0) {
ReleaseTextLink();
}
pData=new ImpSdrObjTextLinkUserData(this);
@@ -194,30 +156,34 @@ void SdrTextObj::SetTextLink(const String& rFileName, const String& rFilterName,
void SdrTextObj::ReleaseTextLink()
{
ImpLinkAbmeldung();
- sal_uInt16 nAnz=GetUserDataCount();
- for (sal_uInt16 nNum=nAnz; nNum>0;) {
+ const sal_uInt32 nAnz(GetUserDataCount());
+
+ for (sal_uInt32 nNum(nAnz); nNum > 0;)
+ {
nNum--;
SdrObjUserData* pData=GetUserData(nNum);
- if (pData->GetInventor()==SdrInventor && pData->GetId()==SDRUSERDATA_OBJTEXTLINK) {
+
+ if(pData->GetInventor()==SdrInventor && pData->GetId()==SDRUSERDATA_OBJTEXTLINK)
+ {
DeleteUserData(nNum);
}
}
}
-FASTBOOL SdrTextObj::ReloadLinkedText( FASTBOOL bForceLoad)
+bool SdrTextObj::ReloadLinkedText( bool bForceLoad)
{
ImpSdrObjTextLinkUserData* pData = GetLinkUserData();
- FASTBOOL bRet = sal_True;
+ bool bRet = true;
if( pData )
{
::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
DateTime aFileDT;
- sal_Bool bExists = sal_False, bLoad = sal_False;
+ bool bExists = false, bLoad = false;
if( pBroker )
{
- bExists = sal_True;
+ bExists = true;
try
{
@@ -233,14 +199,14 @@ FASTBOOL SdrTextObj::ReloadLinkedText( FASTBOOL bForceLoad)
}
catch( ... )
{
- bExists = sal_False;
+ bExists = false;
}
}
if( bExists )
{
if( bForceLoad )
- bLoad = sal_True;
+ bLoad = true;
else
bLoad = ( aFileDT > pData->aFileDate0 );
@@ -256,10 +222,10 @@ FASTBOOL SdrTextObj::ReloadLinkedText( FASTBOOL bForceLoad)
return bRet;
}
-FASTBOOL SdrTextObj::LoadText(const String& rFileName, const String& /*rFilterName*/, rtl_TextEncoding eCharSet)
+bool SdrTextObj::LoadText(const String& rFileName, const String& /*rFilterName*/, rtl_TextEncoding eCharSet)
{
INetURLObject aFileURL( rFileName );
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if( aFileURL.GetProtocol() == INET_PROT_NOT_VALID )
{
@@ -284,14 +250,14 @@ FASTBOOL SdrTextObj::LoadText(const String& rFileName, const String& /*rFilterNa
cRTF[4] = 0;
pIStm->Read(cRTF, 5);
- sal_Bool bRTF = cRTF[0] == '{' && cRTF[1] == '\\' && cRTF[2] == 'r' && cRTF[3] == 't' && cRTF[4] == 'f';
+ bool bRTF = cRTF[0] == '{' && cRTF[1] == '\\' && cRTF[2] == 'r' && cRTF[3] == 't' && cRTF[4] == 'f';
pIStm->Seek(0);
if( !pIStm->GetError() )
{
SetText( *pIStm, aFileURL.GetMainURL( INetURLObject::NO_DECODE ), sal::static_int_cast< sal_uInt16 >( bRTF ? EE_FORMAT_RTF : EE_FORMAT_TEXT ) );
- bRet = sal_True;
+ bRet = true;
}
delete pIStm;
@@ -302,32 +268,37 @@ FASTBOOL SdrTextObj::LoadText(const String& rFileName, const String& /*rFilterNa
ImpSdrObjTextLinkUserData* SdrTextObj::GetLinkUserData() const
{
- ImpSdrObjTextLinkUserData* pData=NULL;
- sal_uInt16 nAnz=GetUserDataCount();
- for (sal_uInt16 nNum=nAnz; nNum>0 && pData==NULL;) {
+ ImpSdrObjTextLinkUserData* pData=0;
+ const sal_uInt32 nAnz(GetUserDataCount());
+
+ for(sal_uInt32 nNum(nAnz); nNum > 0 && !pData;)
+ {
nNum--;
pData=(ImpSdrObjTextLinkUserData*)GetUserData(nNum);
- if (pData->GetInventor()!=SdrInventor || pData->GetId()!=SDRUSERDATA_OBJTEXTLINK) {
- pData=NULL;
+
+ if(pData->GetInventor()!=SdrInventor || pData->GetId()!=SDRUSERDATA_OBJTEXTLINK)
+ {
+ pData = 0;
}
}
+
return pData;
}
void SdrTextObj::ImpLinkAnmeldung()
{
ImpSdrObjTextLinkUserData* pData=GetLinkUserData();
- sfx2::LinkManager* pLinkManager=pModel!=NULL ? pModel->GetLinkManager() : NULL;
- if (pLinkManager!=NULL && pData!=NULL && pData->pLink==NULL) { // Nicht 2x Anmelden
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrObject().GetLinkManager();
+ if (pLinkManager!=0 && pData!=0 && pData->pLink==0) { // Nicht 2x Anmelden
pData->pLink=new ImpSdrObjTextLink(this);
#ifdef GCC
pLinkManager->InsertFileLink(*pData->pLink,OBJECT_CLIENT_FILE,pData->aFileName,
pData->aFilterName.Len() ?
- &pData->aFilterName : (const String *)NULL,
- (const String *)NULL);
+ &pData->aFilterName : (const String *)0,
+ (const String *)0);
#else
pLinkManager->InsertFileLink(*pData->pLink,OBJECT_CLIENT_FILE,pData->aFileName,
- pData->aFilterName.Len() ? &pData->aFilterName : NULL,NULL);
+ pData->aFilterName.Len() ? &pData->aFilterName : 0,0);
#endif
pData->pLink->Connect();
}
@@ -336,11 +307,11 @@ void SdrTextObj::ImpLinkAnmeldung()
void SdrTextObj::ImpLinkAbmeldung()
{
ImpSdrObjTextLinkUserData* pData=GetLinkUserData();
- sfx2::LinkManager* pLinkManager=pModel!=NULL ? pModel->GetLinkManager() : NULL;
- if (pLinkManager!=NULL && pData!=NULL && pData->pLink!=NULL) { // Nicht 2x Abmelden
+ sfx2::LinkManager* pLinkManager = getSdrModelFromSdrObject().GetLinkManager();
+ if (pLinkManager!=0 && pData!=0 && pData->pLink!=0) { // Nicht 2x Abmelden
// Bei Remove wird *pLink implizit deleted
pLinkManager->Remove( pData->pLink );
- pData->pLink=NULL;
+ pData->pLink=0;
}
}
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index e23bc2f2b012..183865394a69 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -25,7 +25,8 @@
#include "precompiled_svx.hxx"
#include <svx/svdotext.hxx>
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdopath.hxx>
@@ -45,291 +46,72 @@
#include <svx/xlnwtit.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@@ @@@@@ @@ @@ @@@@@@ @@@@ @@@@@ @@@@@@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@@@ @@@ @@ @@ @@ @@@@@ @@
-// @@ @@ @@@@@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@@@ @@@@@ @@@@
-//
-// Transformationen
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrTextObj::NbcSetSnapRect(const Rectangle& rRect)
+void SdrTextObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- if (aGeo.nDrehWink!=0 || aGeo.nShearWink!=0) {
- Rectangle aSR0(GetSnapRect());
- long nWdt0=aSR0.Right()-aSR0.Left();
- long nHgt0=aSR0.Bottom()-aSR0.Top();
- long nWdt1=rRect.Right()-rRect.Left();
- long nHgt1=rRect.Bottom()-rRect.Top();
- SdrTextObj::NbcResize(maSnapRect.TopLeft(),Fraction(nWdt1,nWdt0),Fraction(nHgt1,nHgt0));
- SdrTextObj::NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top()));
- } else {
- long nHDist=GetTextLeftDistance()+GetTextRightDistance();
- long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
- long nTWdt0=aRect.GetWidth ()-1-nHDist; if (nTWdt0<0) nTWdt0=0;
- long nTHgt0=aRect.GetHeight()-1-nVDist; if (nTHgt0<0) nTHgt0=0;
- long nTWdt1=rRect.GetWidth ()-1-nHDist; if (nTWdt1<0) nTWdt1=0;
- long nTHgt1=rRect.GetHeight()-1-nVDist; if (nTHgt1<0) nTHgt1=0;
- aRect=rRect;
- ImpJustifyRect(aRect);
- if (bTextFrame && (pModel==NULL || !pModel->IsPasteResize())) { // #51139#
- if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1);
- if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1);
- if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
- NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
- }
- NbcAdjustTextFrameWidthAndHeight();
- }
- ImpCheckShear();
- SetRectsDirty();
- }
-}
+ // Adapt Width and Height only when text frame (not object with text).
+ // Also do not do it in edit mode, let the object get as small as the
+ // minimum frame width/height without changing these.
+ const bool bTextAdaption(bTextFrame && !IsPasteResize() && !IsInEditMode());
+ basegfx::B2DVector aOldSize;
-const Rectangle& SdrTextObj::GetLogicRect() const
-{
- return aRect;
-}
-
-void SdrTextObj::NbcSetLogicRect(const Rectangle& rRect)
-{
- long nHDist=GetTextLeftDistance()+GetTextRightDistance();
- long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
- long nTWdt0=aRect.GetWidth ()-1-nHDist; if (nTWdt0<0) nTWdt0=0;
- long nTHgt0=aRect.GetHeight()-1-nVDist; if (nTHgt0<0) nTHgt0=0;
- long nTWdt1=rRect.GetWidth ()-1-nHDist; if (nTWdt1<0) nTWdt1=0;
- long nTHgt1=rRect.GetHeight()-1-nVDist; if (nTHgt1<0) nTHgt1=0;
- aRect=rRect;
- ImpJustifyRect(aRect);
- if (bTextFrame) {
- if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1);
- if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1);
- if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
- NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
- }
- NbcAdjustTextFrameWidthAndHeight();
- }
- SetRectsDirty();
-}
-
-long SdrTextObj::GetRotateAngle() const
-{
- return aGeo.nDrehWink;
-}
-
-long SdrTextObj::GetShearAngle(FASTBOOL /*bVertical*/) const
-{
- return aGeo.nShearWink;
-}
-
-void SdrTextObj::NbcMove(const Size& rSiz)
-{
- MoveRect(aRect,rSiz);
- MoveRect(aOutRect,rSiz);
- MoveRect(maSnapRect,rSiz);
- SetRectsDirty(sal_True);
-}
-
-void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- FASTBOOL bNoShearMerk=aGeo.nShearWink==0;
- FASTBOOL bRota90Merk=bNoShearMerk && aGeo.nDrehWink % 9000 ==0;
- long nHDist=GetTextLeftDistance()+GetTextRightDistance();
- long nVDist=GetTextUpperDistance()+GetTextLowerDistance();
- long nTWdt0=aRect.GetWidth ()-1-nHDist; if (nTWdt0<0) nTWdt0=0;
- long nTHgt0=aRect.GetHeight()-1-nVDist; if (nTHgt0<0) nTHgt0=0;
- FASTBOOL bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
- FASTBOOL bYMirr=(yFact.GetNumerator()<0) != (yFact.GetDenominator()<0);
- if (bXMirr || bYMirr) {
- Point aRef1(GetSnapRect().Center());
- if (bXMirr) {
- Point aRef2(aRef1);
- aRef2.Y()++;
- NbcMirrorGluePoints(aRef1,aRef2);
- }
- if (bYMirr) {
- Point aRef2(aRef1);
- aRef2.X()++;
- NbcMirrorGluePoints(aRef1,aRef2);
- }
+ if(bTextAdaption)
+ {
+ aOldSize = basegfx::absolute(getSdrObjectScale());
}
- if (aGeo.nDrehWink==0 && aGeo.nShearWink==0) {
- ResizeRect(aRect,rRef,xFact,yFact);
- if (bYMirr) {
- aRect.Justify();
- aRect.Move(aRect.Right()-aRect.Left(),aRect.Bottom()-aRect.Top());
- aGeo.nDrehWink=18000;
- aGeo.RecalcSinCos();
- }
- }
- else
+ // call parent
+ SdrAttrObj::setSdrObjectTransformation(rTransformation);
+
+ // TTTT: check if the rebuild works
+ //
+ //sal_Int32 nHDist=GetTextLeftDistance()+GetTextRightDistance();
+ //sal_Int32 nVDist=GetTextUpperDistance()+GetTextLowerDistance();
+ //sal_Int32 nTWdt0=aRect.GetWidth ()-1-nHDist; if (nTWdt0<0) nTWdt0=0;
+ //sal_Int32 nTHgt0=aRect.GetHeight()-1-nVDist; if (nTHgt0<0) nTHgt0=0;
+ //sal_Int32 nTWdt1=rRect.GetWidth ()-1-nHDist; if (nTWdt1<0) nTWdt1=0;
+ //sal_Int32 nTHgt1=rRect.GetHeight()-1-nVDist; if (nTHgt1<0) nTHgt1=0;
+ // if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) SetMinTextFrameWidth(nTWdt1);
+ // if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) SetMinTextFrameHeight(nTHgt1);
+ // if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
+ // ResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
+ // }
+ // AdjustTextFrameWidthAndHeight();
+
+ if(bTextAdaption)
{
- // #100663# aRect is NOT initialized for lines (polgon objects with two
- // exceptionally handled points). Thus, after this call the text rotaion is
- // gone. This error must be present since day one of this old drawing layer.
- // It's astonishing that noone discovered it earlier.
- // Polygon aPol(Rect2Poly(aRect,aGeo));
- // Polygon aPol(Rect2Poly(GetSnapRect(), aGeo));
-
- // #101412# go back to old method, side effects are impossible
- // to calculate.
- Polygon aPol(Rect2Poly(aRect,aGeo));
-
- for(sal_uInt16 a(0); a < aPol.GetSize(); a++)
- {
- ResizePoint(aPol[a], rRef, xFact, yFact);
- }
+ basegfx::B2DVector aNewSize(basegfx::absolute(getSdrObjectScale()));
- if(bXMirr != bYMirr)
+ if(!aNewSize.equal(aOldSize))
{
- // Polygon wenden und etwas schieben
- Polygon aPol0(aPol);
-
- aPol[0] = aPol0[1];
- aPol[1] = aPol0[0];
- aPol[2] = aPol0[3];
- aPol[3] = aPol0[2];
- aPol[4] = aPol0[1];
- }
-
- Poly2Rect(aPol, aRect, aGeo);
- }
+ const basegfx::B2DVector aBorders(
+ GetTextLeftDistance() + GetTextRightDistance(),
+ GetTextUpperDistance() + GetTextLowerDistance());
- if (bRota90Merk) {
- FASTBOOL bRota90=aGeo.nDrehWink % 9000 ==0;
- if (!bRota90) { // Scheinbar Rundungsfehler: Korregieren
- long a=NormAngle360(aGeo.nDrehWink);
- if (a<4500) a=0;
- else if (a<13500) a=9000;
- else if (a<22500) a=18000;
- else if (a<31500) a=27000;
- else a=0;
- aGeo.nDrehWink=a;
- aGeo.RecalcSinCos();
- }
- if (bNoShearMerk!=(aGeo.nShearWink==0)) { // Shear ggf. korregieren wg. Rundungsfehler
- aGeo.nShearWink=0;
- aGeo.RecalcTan();
- }
- }
+ aNewSize -= aBorders;
+ aOldSize -= aBorders;
- ImpJustifyRect(aRect);
- long nTWdt1=aRect.GetWidth ()-1-nHDist; if (nTWdt1<0) nTWdt1=0;
- long nTHgt1=aRect.GetHeight()-1-nVDist; if (nTHgt1<0) nTHgt1=0;
- if (bTextFrame && (pModel==NULL || !pModel->IsPasteResize())) { // #51139#
- if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1);
- if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1);
- if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
- NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
- }
- NbcAdjustTextFrameWidthAndHeight();
- }
- ImpCheckShear();
- SetRectsDirty();
-}
-
-void SdrTextObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
-{
- SetGlueReallyAbsolute(sal_True);
- long dx=aRect.Right()-aRect.Left();
- long dy=aRect.Bottom()-aRect.Top();
- Point aP(aRect.TopLeft());
- RotatePoint(aP,rRef,sn,cs);
- aRect.Left()=aP.X();
- aRect.Top()=aP.Y();
- aRect.Right()=aRect.Left()+dx;
- aRect.Bottom()=aRect.Top()+dy;
- if (aGeo.nDrehWink==0) {
- aGeo.nDrehWink=NormAngle360(nWink);
- aGeo.nSin=sn;
- aGeo.nCos=cs;
- } else {
- aGeo.nDrehWink=NormAngle360(aGeo.nDrehWink+nWink);
- aGeo.RecalcSinCos();
- }
- SetRectsDirty();
- NbcRotateGluePoints(rRef,nWink,sn,cs);
- SetGlueReallyAbsolute(sal_False);
-}
+ if(IsAutoGrowWidth() && !basegfx::fTools::equal(aOldSize.getX(), aNewSize.getX()))
+ {
+ SetMinTextFrameWidth(aNewSize.getX());
+ }
-void SdrTextObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
-{
- SetGlueReallyAbsolute(sal_True);
+ if(IsAutoGrowHeight() && !basegfx::fTools::equal(aOldSize.getY(), aNewSize.getY()))
+ {
+ SetMinTextFrameHeight(aNewSize.getY());
+ }
- // #75889# when this is a SdrPathObj aRect maybe not initialized
- Polygon aPol(Rect2Poly(aRect.IsEmpty() ? GetSnapRect() : aRect, aGeo));
+ if(SDRTEXTFIT_RESIZEATTR == GetFitToSize())
+ {
+ const double fFactorX(aNewSize.getX() / (basegfx::fTools::equalZero(aOldSize.getX()) ? 1.0 : aOldSize.getX()));
+ const double fFactorY(aNewSize.getY() / (basegfx::fTools::equalZero(aOldSize.getY()) ? 1.0 : aOldSize.getY()));
- sal_uInt16 nPointCount=aPol.GetSize();
- for (sal_uInt16 i=0; i<nPointCount; i++) {
- ShearPoint(aPol[i],rRef,tn,bVShear);
- }
- Poly2Rect(aPol,aRect,aGeo);
- ImpJustifyRect(aRect);
- if (bTextFrame) {
- NbcAdjustTextFrameWidthAndHeight();
- }
- ImpCheckShear();
- SetRectsDirty();
- NbcShearGluePoints(rRef,nWink,tn,bVShear);
- SetGlueReallyAbsolute(sal_False);
-}
+ ResizeTextAttributes(fFactorX, fFactorY);
+ }
-void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2)
-{
- SetGlueReallyAbsolute(sal_True);
- FASTBOOL bNoShearMerk=aGeo.nShearWink==0;
- FASTBOOL bRota90Merk=sal_False;
- if (bNoShearMerk &&
- (rRef1.X()==rRef2.X() || rRef1.Y()==rRef2.Y() ||
- Abs(rRef1.X()-rRef2.X())==Abs(rRef1.Y()-rRef2.Y()))) {
- bRota90Merk=aGeo.nDrehWink % 9000 ==0;
- }
- Polygon aPol(Rect2Poly(aRect,aGeo));
- sal_uInt16 i;
- sal_uInt16 nPntAnz=aPol.GetSize();
- for (i=0; i<nPntAnz; i++) {
- MirrorPoint(aPol[i],rRef1,rRef2);
- }
- // Polygon wenden und etwas schieben
- Polygon aPol0(aPol);
- aPol[0]=aPol0[1];
- aPol[1]=aPol0[0];
- aPol[2]=aPol0[3];
- aPol[3]=aPol0[2];
- aPol[4]=aPol0[1];
- Poly2Rect(aPol,aRect,aGeo);
-
- if (bRota90Merk) {
- FASTBOOL bRota90=aGeo.nDrehWink % 9000 ==0;
- if (bRota90Merk && !bRota90) { // Scheinbar Rundungsfehler: Korregieren
- long a=NormAngle360(aGeo.nDrehWink);
- if (a<4500) a=0;
- else if (a<13500) a=9000;
- else if (a<22500) a=18000;
- else if (a<31500) a=27000;
- else a=0;
- aGeo.nDrehWink=a;
- aGeo.RecalcSinCos();
+ AdjustTextFrameWidthAndHeight();
}
}
- if (bNoShearMerk!=(aGeo.nShearWink==0)) { // Shear ggf. korregieren wg. Rundungsfehler
- aGeo.nShearWink=0;
- aGeo.RecalcTan();
- }
-
- ImpJustifyRect(aRect);
- if (bTextFrame) {
- NbcAdjustTextFrameWidthAndHeight();
- }
- ImpCheckShear();
- SetRectsDirty();
- NbcMirrorGluePoints(rRef1,rRef2);
- SetGlueReallyAbsolute(sal_False);
}
//////////////////////////////////////////////////////////////////////////////
@@ -363,8 +145,8 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
if(nResultCount)
{
// prepare own target
- SdrObjGroup* pGroup = new SdrObjGroup();
- SdrObjList* pObjectList = pGroup->GetSubList();
+ SdrObjGroup* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
+ SdrObjList* pObjectList = pGroup->getChildrenOfSdrObject();
// process results
for(sal_uInt32 a(0); a < nResultCount; a++)
@@ -395,7 +177,7 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
SdrPathObj* pPathObj = 0;
// always clear objectshadow; this is included in the extraction
- aAttributeSet.Put(SdrShadowItem(false));
+ aAttributeSet.Put(SdrOnOffItem(SDRATTR_SHADOW, false));
if(rCandidate.getIsFilled())
{
@@ -405,7 +187,7 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
aAttributeSet.Put(XFillStyleItem(XFILL_SOLID));
// create filled SdrPathObj
- pPathObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
+ pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPolygon);
}
else
{
@@ -416,34 +198,30 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
aAttributeSet.Put(XFillStyleItem(XFILL_NONE));
// create line SdrPathObj
- pPathObj = new SdrPathObj(OBJ_PATHLINE, aPolyPolygon);
+ pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), aPolyPolygon);
}
// copy basic information from original
- pPathObj->ImpSetAnchorPos(GetAnchorPos());
- pPathObj->NbcSetLayer(GetLayer());
-
- if(GetModel())
- {
- pPathObj->SetModel(GetModel());
- pPathObj->NbcSetStyleSheet(GetStyleSheet(), true);
- }
+ pPathObj->SetAnchorPos(GetAnchorPos());
+ pPathObj->SetLayer(GetLayer());
+ //pPathObj->SetModel(getSdrModelFromSdrObject());
+ pPathObj->SetStyleSheet(GetStyleSheet(), true);
// apply prepared ItemSet and add to target
pPathObj->SetMergedItemSet(aAttributeSet);
- pObjectList->InsertObject(pPathObj);
+ pObjectList->InsertObjectToSdrObjList(*pPathObj);
}
}
// postprocess; if no result and/or only one object, simplify
if(!pObjectList->GetObjCount())
{
- delete pGroup;
+ deleteSdrObjectSafeAndClearPointer(pGroup);
}
else if(1 == pObjectList->GetObjCount())
{
- pRetval = pObjectList->RemoveObject(0);
- delete pGroup;
+ pRetval = pObjectList->RemoveObjectFromSdrObjList(0);
+ deleteSdrObjectSafeAndClearPointer(pGroup);
}
else
{
@@ -457,7 +235,7 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
//////////////////////////////////////////////////////////////////////////////
-SdrObject* SdrTextObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const
+SdrObject* SdrTextObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const
{
if(bAddText)
{
@@ -472,51 +250,43 @@ bool SdrTextObj::ImpCanConvTextToCurve() const
return !IsOutlText();
}
-SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr) const
+SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr) const
{
- SdrObjKind ePathKind = bClosed ? OBJ_PATHFILL : OBJ_PATHLINE;
basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPolygon);
// #i37011#
if(!bBezier)
{
aB2DPolyPolygon = basegfx::tools::adaptiveSubdivideByAngle(aB2DPolyPolygon);
- ePathKind = bClosed ? OBJ_POLY : OBJ_PLIN;
}
- SdrPathObj* pPathObj = new SdrPathObj(ePathKind, aB2DPolyPolygon);
+ SdrPathObj* pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), aB2DPolyPolygon);
if(bBezier)
{
// create bezier curves
- pPathObj->SetPathPoly(basegfx::tools::expandToCurve(pPathObj->GetPathPoly()));
+ pPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::tools::expandToCurve(pPathObj->getB2DPolyPolygonInObjectCoordinates()));
}
if(pPathObj)
{
- pPathObj->ImpSetAnchorPos(aAnchor);
- pPathObj->NbcSetLayer(SdrLayerID(GetLayer()));
+ pPathObj->SetAnchorPos(GetAnchorPos());
+ pPathObj->SetLayer(GetLayer());
- if(pModel)
+ if(!bNoSetAttr)
{
- pPathObj->SetModel(pModel);
-
- if(!bNoSetAttr)
- {
- sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
+ sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
- pPathObj->ClearMergedItem();
- pPathObj->SetMergedItemSet(GetObjectItemSet());
- pPathObj->GetProperties().BroadcastItemChange(aC);
- pPathObj->NbcSetStyleSheet(GetStyleSheet(), sal_True);
- }
+ pPathObj->ClearMergedItem();
+ pPathObj->SetMergedItemSet(GetObjectItemSet());
+ pPathObj->SetStyleSheet(GetStyleSheet(), true);
}
}
return pPathObj;
}
-SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) const
+SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, bool bBezier) const
{
if(!ImpCanConvTextToCurve())
{
@@ -535,21 +305,20 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) cons
return pText;
}
- if(pText->IsGroupObject())
+ if(pText->getChildrenOfSdrObject())
{
// is already group object, add partial shape in front
- SdrObjList* pOL=pText->GetSubList();
- pOL->InsertObject(pObj,0);
+ SdrObjList* pOL = pText->getChildrenOfSdrObject();
+ pOL->InsertObjectToSdrObjList(*pObj, 0);
return pText;
}
else
{
// not yet a group, create one and add partial and new shapes
- SdrObjGroup* pGrp=new SdrObjGroup;
- SdrObjList* pOL=pGrp->GetSubList();
- pOL->InsertObject(pObj);
- pOL->InsertObject(pText);
+ SdrObjGroup* pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
+ pGrp->InsertObjectToSdrObjList(*pObj);
+ pGrp->InsertObjectToSdrObjList(*pText);
return pGrp;
}
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index a3738ea54f88..0f7a1f459ce3 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -48,7 +48,6 @@
#include <svx/svdetc.hxx>
#include <svx/svdview.hxx>
#include <svx/svdorect.hxx>
-#include "svx/svdviter.hxx"
#include <rtl/ref.hxx>
#include <set>
#include <memory>
@@ -56,6 +55,7 @@
#include <svx/sdrpaintwindow.hxx>
#include <tools/diagnose_ex.h>
#include <svx/svdograf.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
using namespace ::sdr::contact;
@@ -158,14 +158,14 @@ namespace
// SdrUnoObj
//************************************************************
-TYPEINIT1(SdrUnoObj, SdrRectObj);
-
-SdrUnoObj::SdrUnoObj(const String& rModelName, sal_Bool _bOwnUnoControlModel)
-: m_pImpl( new SdrUnoObjDataHolder ),
+SdrUnoObj::SdrUnoObj(
+ SdrModel& rSdrModel,
+ const String& rModelName,
+ bool _bOwnUnoControlModel)
+: SdrRectObj(rSdrModel),
+ m_pImpl( new SdrUnoObjDataHolder ),
bOwnUnoControlModel( _bOwnUnoControlModel )
{
- bIsUnoObj = sal_True;
-
m_pImpl->pEventListener = new SdrControlEventListenerImpl(this);
// nur ein owner darf eigenstaendig erzeugen
@@ -173,14 +173,15 @@ SdrUnoObj::SdrUnoObj(const String& rModelName, sal_Bool _bOwnUnoControlModel)
CreateUnoControlModel(rModelName);
}
-SdrUnoObj::SdrUnoObj(const String& rModelName,
+SdrUnoObj::SdrUnoObj(
+ SdrModel& rSdrModel,
+ const String& rModelName,
const uno::Reference< lang::XMultiServiceFactory >& rxSFac,
- sal_Bool _bOwnUnoControlModel)
-: m_pImpl( new SdrUnoObjDataHolder ),
+ bool _bOwnUnoControlModel)
+: SdrRectObj(rSdrModel),
+ m_pImpl( new SdrUnoObjDataHolder ),
bOwnUnoControlModel( _bOwnUnoControlModel )
{
- bIsUnoObj = sal_True;
-
m_pImpl->pEventListener = new SdrControlEventListenerImpl(this);
// nur ein owner darf eigenstaendig erzeugen
@@ -211,33 +212,138 @@ SdrUnoObj::~SdrUnoObj()
delete m_pImpl;
}
-void SdrUnoObj::SetModel(SdrModel* pNewModel)
+void SdrUnoObj::copyDataFromSdrObject(const SdrObject& rSource)
{
- SdrRectObj::SetModel(pNewModel);
+ if(this != &rSource)
+ {
+ const SdrUnoObj* pSource = dynamic_cast< const SdrUnoObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrRectObj::copyDataFromSdrObject(rSource);
+
+ // release the reference to the current control model
+ SetUnoControlModel(uno::Reference< awt::XControlModel >());
+
+ aUnoControlModelTypeName = pSource->aUnoControlModelTypeName;
+ aUnoControlTypeName = pSource->aUnoControlTypeName;
+
+ // copy the uno control model
+ uno::Reference< awt::XControlModel > xCtrl( pSource->GetUnoControlModel(), uno::UNO_QUERY );
+ uno::Reference< util::XCloneable > xClone( xCtrl, uno::UNO_QUERY );
+
+ if ( xClone.is() )
+ {
+ // copy the model by cloning
+ uno::Reference< awt::XControlModel > xNewModel( xClone->createClone(), uno::UNO_QUERY );
+ DBG_ASSERT( xNewModel.is(), "SdrUnoObj::operator =, no control model!");
+ xUnoControlModel = xNewModel;
+ }
+ else
+ {
+ // copy the model by streaming
+ uno::Reference< io::XPersistObject > xObj( xCtrl, uno::UNO_QUERY );
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+
+ if ( xObj.is() && xFactory.is() )
+ {
+ // creating a pipe
+ uno::Reference< io::XOutputStream > xOutPipe(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.Pipe")), uno::UNO_QUERY);
+ uno::Reference< io::XInputStream > xInPipe(xOutPipe, uno::UNO_QUERY);
+
+ // creating the mark streams
+ uno::Reference< io::XInputStream > xMarkIn(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableInputStream")), uno::UNO_QUERY);
+ uno::Reference< io::XActiveDataSink > xMarkSink(xMarkIn, uno::UNO_QUERY);
+
+ uno::Reference< io::XOutputStream > xMarkOut(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableOutputStream")), uno::UNO_QUERY);
+ uno::Reference< io::XActiveDataSource > xMarkSource(xMarkOut, uno::UNO_QUERY);
+
+ // connect mark and sink
+ uno::Reference< io::XActiveDataSink > xSink(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectInputStream")), uno::UNO_QUERY);
+
+ // connect mark and source
+ uno::Reference< io::XActiveDataSource > xSource(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectOutputStream")), uno::UNO_QUERY);
+
+ uno::Reference< io::XObjectOutputStream > xOutStrm(xSource, uno::UNO_QUERY);
+ uno::Reference< io::XObjectInputStream > xInStrm(xSink, uno::UNO_QUERY);
+
+ if (xMarkSink.is() && xMarkSource.is() && xSink.is() && xSource.is())
+ {
+ xMarkSink->setInputStream(xInPipe);
+ xMarkSource->setOutputStream(xOutPipe);
+ xSink->setInputStream(xMarkIn);
+ xSource->setOutputStream(xMarkOut);
+
+ // write the object to source
+ xOutStrm->writeObject(xObj);
+ xOutStrm->closeOutput();
+ // read the object
+ uno::Reference< awt::XControlModel > xModel(xInStrm->readObject(), uno::UNO_QUERY);
+ xInStrm->closeInput();
+
+ DBG_ASSERT(xModel.is(), "SdrUnoObj::operator =, keine Model erzeugt");
+
+ xUnoControlModel = xModel;
+ }
+ }
+ }
+
+ // get service name of the control from the control model
+ uno::Reference< beans::XPropertySet > xSet(xUnoControlModel, uno::UNO_QUERY);
+ if (xSet.is())
+ {
+ uno::Any aValue( xSet->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl")) );
+ ::rtl::OUString aStr;
+
+ if( aValue >>= aStr )
+ aUnoControlTypeName = String(aStr);
+ }
+
+ uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);
+ if (xComp.is())
+ m_pImpl->pEventListener->StartListening(xComp);
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* SdrUnoObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SdrUnoObj* pClone = new SdrUnoObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject(),
+ String());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
}
-void SdrUnoObj::SetPage(SdrPage* pNewPage)
+bool SdrUnoObj::IsSdrUnoObj() const
{
- SdrRectObj::SetPage(pNewPage);
+ return true;
}
void SdrUnoObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bRotateFreeAllowed = sal_False;
- rInfo.bRotate90Allowed = sal_False;
- rInfo.bMirrorFreeAllowed = sal_False;
- rInfo.bMirror45Allowed = sal_False;
- rInfo.bMirror90Allowed = sal_False;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed = sal_False;
- rInfo.bEdgeRadiusAllowed = sal_False;
- rInfo.bNoOrthoDesired = sal_False;
- rInfo.bCanConvToPath = sal_False;
- rInfo.bCanConvToPoly = sal_False;
- rInfo.bCanConvToPathLineToArea = sal_False;
- rInfo.bCanConvToPolyLineToArea = sal_False;
- rInfo.bCanConvToContour = sal_False;
+ rInfo.mbRotateFreeAllowed = false;
+ rInfo.mbRotate90Allowed = false;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbMirror45Allowed = false;
+ rInfo.mbMirror90Allowed = false;
+ rInfo.mbTransparenceAllowed = false;
+ rInfo.mbGradientAllowed = false;
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbNoOrthoDesired = false;
+ rInfo.mbCanConvToPath = false;
+ rInfo.mbCanConvToPoly = false;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
+ rInfo.mbCanConvToContour = false;
}
sal_uInt16 SdrUnoObj::GetObjIdentifier() const
@@ -309,72 +415,6 @@ void SdrUnoObj::TakeObjNamePlural(XubString& rName) const
rName = ImpGetResStr(STR_ObjNamePluralUno);
}
-void SdrUnoObj::operator = (const SdrObject& rObj)
-{
- SdrRectObj::operator = (rObj);
-
- // release the reference to the current control model
- SetUnoControlModel( NULL );
-
- const SdrUnoObj& rUnoObj = dynamic_cast< const SdrUnoObj& >( rObj );
-
- aUnoControlModelTypeName = rUnoObj.aUnoControlModelTypeName;
- aUnoControlTypeName = rUnoObj.aUnoControlTypeName;
-
- // copy the uno control model
- const uno::Reference< awt::XControlModel > xSourceControlModel( rUnoObj.GetUnoControlModel(), uno::UNO_QUERY );
- if ( xSourceControlModel.is() )
- {
- try
- {
- uno::Reference< util::XCloneable > xClone( xSourceControlModel, uno::UNO_QUERY_THROW );
- xUnoControlModel.set( xClone->createClone(), uno::UNO_QUERY_THROW );
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
-
- // get service name of the control from the control model
- uno::Reference< beans::XPropertySet > xSet(xUnoControlModel, uno::UNO_QUERY);
- if (xSet.is())
- {
- uno::Any aValue( xSet->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl")) );
- ::rtl::OUString aStr;
-
- if( aValue >>= aStr )
- aUnoControlTypeName = String(aStr);
- }
-
- uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);
- if (xComp.is())
- m_pImpl->pEventListener->StartListening(xComp);
-}
-
-void SdrUnoObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- SdrRectObj::NbcResize(rRef,xFact,yFact);
-
- if (aGeo.nShearWink!=0 || aGeo.nDrehWink!=0)
- {
- // kleine Korrekturen
- if (aGeo.nDrehWink>=9000 && aGeo.nDrehWink<27000)
- {
- aRect.Move(aRect.Left()-aRect.Right(),aRect.Top()-aRect.Bottom());
- }
-
- aGeo.nDrehWink = 0;
- aGeo.nShearWink = 0;
- aGeo.nSin = 0.0;
- aGeo.nCos = 1.0;
- aGeo.nTan = 0.0;
- SetRectsDirty();
- }
-}
-
-// -----------------------------------------------------------------------------
-
bool SdrUnoObj::hasSpecialDrag() const
{
// no special drag; we have no rounding rect and
@@ -402,7 +442,10 @@ SdrObject* SdrUnoObj::getFullDragClone() const
// special handling for SdrUnoObj (FormControl). Create a SdrGrafObj
// for drag containing the graphical representation. This does not work too
// well, so the default is to simply clone
- pRetval = new SdrGrafObj(SdrDragView::GetObjGraphic(GetModel(), this), GetLogicRect());
+ pRetval = new SdrGrafObj(
+ getSdrModelFromSdrObject(),
+ GetObjGraphic(*this),
+ getSdrObjectTransformation());
}
else
{
@@ -414,74 +457,30 @@ SdrObject* SdrUnoObj::getFullDragClone() const
}
// -----------------------------------------------------------------------------
-void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
+void SdrUnoObj::SetLayer( SdrLayerID _nLayer )
{
- if ( GetLayer() == _nLayer )
- { // redundant call -> not interested in doing anything here
- SdrRectObj::NbcSetLayer( _nLayer );
- return;
- }
-
- // we need some special handling here in case we're moved from an invisible layer
- // to a visible one, or vice versa
- // (relative to a layer. Remember that the visibility of a layer is a view attribute
- // - the same layer can be visible in one view, and invisible in another view, at the
- // same time)
- // 2003-06-03 - #110592# - fs@openoffice.org
-
- // collect all views in which our old layer is visible
- ::std::set< SdrView* > aPreviouslyVisible;
-
+ if(_nLayer != GetLayer())
{
- SdrViewIter aIter( this );
- for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
- aPreviouslyVisible.insert( pView );
- }
-
- SdrRectObj::NbcSetLayer( _nLayer );
+ // call parent
+ SdrRectObj::SetLayer( _nLayer );
- // collect all views in which our new layer is visible
- ::std::set< SdrView* > aNewlyVisible;
+ // check visibility
+ const ::std::set< SdrView* > aViews(getSdrModelFromSdrObject().getSdrViews());
- {
- SdrViewIter aIter( this );
- for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
+ for(::std::set< SdrView* >::const_iterator aLoop(aViews.begin());
+ aLoop != aViews.end(); aLoop++)
{
- ::std::set< SdrView* >::const_iterator aPrevPos = aPreviouslyVisible.find( pView );
- if ( aPreviouslyVisible.end() != aPrevPos )
- { // in pView, we were visible _before_ the layer change, and are
- // visible _after_ the layer change, too
- // -> we're not interested in this view at all
- aPreviouslyVisible.erase( aPrevPos );
- }
- else
+ SdrPageView* pPageView = (*aLoop)->GetSdrPageView();
+
+ if(pPageView)
{
- // in pView, we were visible _before_ the layer change, and are
- // _not_ visible after the layer change
- // => remember this view, as our visibility there changed
- aNewlyVisible.insert( pView );
+ const SetOfByte& rVisibleLayers = pPageView->GetVisibleLayers();
+ const bool bVisible(rVisibleLayers.IsSet(GetLayer()));
+
+ lcl_ensureControlVisibility( *aLoop, this, bVisible );
}
}
}
-
- // now aPreviouslyVisible contains all views where we became invisible
- ::std::set< SdrView* >::const_iterator aLoopViews;
- for ( aLoopViews = aPreviouslyVisible.begin();
- aLoopViews != aPreviouslyVisible.end();
- ++aLoopViews
- )
- {
- lcl_ensureControlVisibility( *aLoopViews, this, false );
- }
-
- // and aNewlyVisible all views where we became visible
- for ( aLoopViews = aNewlyVisible.begin();
- aLoopViews != aNewlyVisible.end();
- ++aLoopViews
- )
- {
- lcl_ensureControlVisibility( *aLoopViews, this, true );
- }
}
void SdrUnoObj::CreateUnoControlModel(const String& rModelName)
@@ -568,8 +567,13 @@ uno::Reference< awt::XControl > SdrUnoObj::GetUnoControl(const SdrView& _rView,
uno::Reference< awt::XControl > xControl;
SdrPageView* pPageView = _rView.GetSdrPageView();
- OSL_ENSURE( GetPage() == pPageView->GetPage(), "SdrUnoObj::GetUnoControl: This object is not displayed in that particular view!" );
- if ( GetPage() != pPageView->GetPage() )
+
+ if(!pPageView)
+ return NULL;
+
+ OSL_ENSURE( getSdrPageFromSdrObject() == &pPageView->getSdrPageFromSdrPageView(),
+ "SdrUnoObj::GetUnoControl: This object is not displayed in that particular view!" );
+ if ( getSdrPageFromSdrObject() != &pPageView->getSdrPageFromSdrPageView() )
return NULL;
SdrPageWindow* pPageWindow = pPageView ? pPageView->FindPageWindow( _rOut ) : NULL;
diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx
index 51476f8d41ac..e7b6561f2d15 100644
--- a/svx/source/svdraw/svdoutl.cxx
+++ b/svx/source/svdraw/svdoutl.cxx
@@ -31,7 +31,6 @@
#include <editeng/eeitem.hxx>
#include <svl/itempool.hxx>
-DBG_NAME(SdrOutliner)
/*************************************************************************
|*
|* Ctor
@@ -39,10 +38,8 @@ DBG_NAME(SdrOutliner)
\************************************************************************/
SdrOutliner::SdrOutliner( SfxItemPool* pItemPool, sal_uInt16 nMode )
: Outliner( pItemPool, nMode ),
- //mpPaintInfoRec( NULL )
mpVisualizedPage(0)
{
- DBG_CTOR(SdrOutliner,NULL);
}
@@ -53,7 +50,6 @@ SdrOutliner::SdrOutliner( SfxItemPool* pItemPool, sal_uInt16 nMode )
\************************************************************************/
SdrOutliner::~SdrOutliner()
{
- DBG_DTOR(SdrOutliner,NULL);
}
@@ -107,7 +103,7 @@ void SdrOutliner::SetTextObjNoInit( const SdrTextObj* pObj )
XubString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
Color*& rpTxtColor, Color*& rpFldColor)
{
- FASTBOOL bOk = sal_False;
+ bool bOk = sal_False;
XubString aRet;
if(mpTextObj.is())
@@ -126,3 +122,5 @@ const SdrTextObj* SdrOutliner::GetTextObj() const
else
return 0;
}
+
+// eof
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 5ed695a292db..bbf1c3fdbfa4 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -25,8 +25,6 @@
#include "precompiled_svx.hxx"
#include <svx/svdpage.hxx>
-
-// HACK
#include <sot/storage.hxx>
#include <sot/clsids.hxx>
#include <sot/storage.hxx>
@@ -36,1032 +34,590 @@
#define _STRING_H
#endif
#include <vcl/svapp.hxx>
-
#include <tools/diagnose_ex.h>
-
#include <svx/svdetc.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdogrp.hxx>
-#include <svx/svdograf.hxx> // fuer SwapInAll()
-#include <svx/svdoedge.hxx> // Zum kopieren der Konnektoren
-#include <svx/svdoole2.hxx> // Sonderbehandlung OLE beim SdrExchangeFormat
-#include "svx/svditer.hxx"
+#include <svx/svdograf.hxx>
+#include <svx/svdoedge.hxx>
+#include <svx/svdoole2.hxx>
+#include <svx/svditer.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdlayer.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdundo.hxx>
#include <svx/fmglob.hxx>
-#include <svx/polysc3d.hxx>
-
#include <svx/fmdpage.hxx>
-
#include <sfx2/objsh.hxx>
-#include <vcl/salbtype.hxx> // FRound
+#include <vcl/salbtype.hxx>
#include <svx/sdr/contact/viewcontactofsdrpage.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <algorithm>
#include <svl/smplhint.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
+#include <svx/svdpool.hxx>
using namespace ::com::sun::star;
-namespace {
-void DumpObjectList (const ::std::vector<SdrObjectWeakRef>& rContainer)
-{
- ::std::vector<SdrObjectWeakRef>::const_iterator iObject (rContainer.begin());
- ::std::vector<SdrObjectWeakRef>::const_iterator iEnd (rContainer.end());
- for (int nIndex=0 ; iObject!=iEnd; ++iObject,++nIndex)
- {
- const SdrObject* pObject = iObject->get();
- OSL_TRACE("%d : %x, %s", nIndex,
- pObject,
- ::rtl::OUStringToOString(pObject->GetName(),RTL_TEXTENCODING_UTF8).getStr());
- }
-}
-}
-
-
-class SdrObjList::WeakSdrObjectContainerType
- : public ::std::vector<SdrObjectWeakRef>
-{
-public:
- WeakSdrObjectContainerType (const sal_Int32 nInitialSize)
- : ::std::vector<SdrObjectWeakRef>(nInitialSize) {};
-};
-
-
-
-static const sal_Int32 InitialObjectContainerCapacity (64);
-DBG_NAME(SdrObjList)
-
-TYPEINIT0(SdrObjList);
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// helper to allow changing ord num at SdrObject, but only from SdrObjList
-SdrObjList::SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage, SdrObjList* pNewUpList):
- maList(),
- mpNavigationOrder(),
- mbIsNavigationOrderDirty(false)
+void SVX_DLLPRIVATE SetOrdNumAtSdrObjectFromSdrObjList(SdrObject& rSdrObject, sal_uInt32 nOrdNum)
{
- DBG_CTOR(SdrObjList,NULL);
- maList.reserve(InitialObjectContainerCapacity);
- pModel=pNewModel;
- pPage=pNewPage;
- pUpList=pNewUpList;
- bObjOrdNumsDirty=sal_False;
- bRectsDirty=sal_False;
- pOwnerObj=NULL;
- eListKind=SDROBJLIST_UNKNOWN;
+ rSdrObject.SetOrdNum(nOrdNum);
}
-SdrObjList::SdrObjList(const SdrObjList& rSrcList):
- maList(),
- mpNavigationOrder(),
- mbIsNavigationOrderDirty(false)
-{
- DBG_CTOR(SdrObjList,NULL);
- maList.reserve(InitialObjectContainerCapacity);
- pModel=NULL;
- pPage=NULL;
- pUpList=NULL;
- bObjOrdNumsDirty=sal_False;
- bRectsDirty=sal_False;
- pOwnerObj=NULL;
- eListKind=SDROBJLIST_UNKNOWN;
- *this=rSrcList;
-}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// helper to allow changing parent at SdrObject, but only from SdrObjList
-SdrObjList::~SdrObjList()
+void SVX_DLLPRIVATE SetParentAtSdrObjectFromSdrObjList(SdrObject& rSdrObject, SdrObjList* pNew)
{
- DBG_DTOR(SdrObjList,NULL);
-
- // #111111#
- // To avoid that the Clear() method will broadcast changes when in destruction
- // which would call virtual methos (not allowed in destructor), the model is set
- // to NULL here.
- pModel = 0L;
-
- Clear(); // Containerinhalt loeschen!
+ rSdrObject.setParentOfSdrObject(pNew);
}
-void SdrObjList::operator=(const SdrObjList& rSrcList)
-{
- Clear();
- eListKind=rSrcList.eListKind;
- CopyObjects(rSrcList);
-}
+//////////////////////////////////////////////////////////////////////////////
-void SdrObjList::CopyObjects(const SdrObjList& rSrcList)
+void SdrObjList::EnsureValidNavigationPositions(sal_uInt32 nFrom)
{
- Clear();
- bObjOrdNumsDirty=sal_False;
- bRectsDirty =sal_False;
- sal_uIntPtr nCloneErrCnt=0;
- sal_uIntPtr nAnz=rSrcList.GetObjCount();
- SdrInsertReason aReason(SDRREASON_COPY);
- sal_uIntPtr no;
- for (no=0; no<nAnz; no++) {
- SdrObject* pSO=rSrcList.GetObj(no);
-
- // #116235#
- //SdrObject* pDO=pSO->Clone(pPage,pModel);
- SdrObject* pDO = pSO->Clone();
- pDO->SetModel(pModel);
- pDO->SetPage(pPage);
-
- if (pDO!=NULL) {
- NbcInsertObject(pDO,CONTAINER_APPEND,&aReason);
- } else {
- nCloneErrCnt++;
- }
- }
- // und nun zu den Konnektoren
- // Die neuen Objekte werden auf die der rSrcList abgebildet
- // und so die Objektverbindungen hergestellt.
- // Aehnliche Implementation an folgenden Stellen:
- // void SdrObjList::CopyObjects(const SdrObjList& rSrcList)
- // SdrModel* SdrExchangeView::GetMarkedObjModel() const
- // FASTBOOL SdrExchangeView::Paste(const SdrModel& rMod,...)
- // void SdrEditView::CopyMarked()
- if (nCloneErrCnt==0) {
- for (no=0; no<nAnz; no++) {
- const SdrObject* pSrcOb=rSrcList.GetObj(no);
- SdrEdgeObj* pSrcEdge=PTR_CAST(SdrEdgeObj,pSrcOb);
- if (pSrcEdge!=NULL) {
- SdrObject* pSrcNode1=pSrcEdge->GetConnectedNode(sal_True);
- SdrObject* pSrcNode2=pSrcEdge->GetConnectedNode(sal_False);
- if (pSrcNode1!=NULL && pSrcNode1->GetObjList()!=pSrcEdge->GetObjList()) pSrcNode1=NULL; // Listenuebergreifend
- if (pSrcNode2!=NULL && pSrcNode2->GetObjList()!=pSrcEdge->GetObjList()) pSrcNode2=NULL; // ist (noch) nicht
- if (pSrcNode1!=NULL || pSrcNode2!=NULL) {
- SdrObject* pEdgeObjTmp=GetObj(no);
- SdrEdgeObj* pDstEdge=PTR_CAST(SdrEdgeObj,pEdgeObjTmp);
- if (pDstEdge!=NULL) {
- if (pSrcNode1!=NULL) {
- sal_uIntPtr nDstNode1=pSrcNode1->GetOrdNum();
- SdrObject* pDstNode1=GetObj(nDstNode1);
- if (pDstNode1!=NULL) { // Sonst grober Fehler!
- pDstEdge->ConnectToNode(sal_True,pDstNode1);
- } else {
- DBG_ERROR("SdrObjList::operator=(): pDstNode1==NULL!");
- }
- }
- if (pSrcNode2!=NULL) {
- sal_uIntPtr nDstNode2=pSrcNode2->GetOrdNum();
- SdrObject* pDstNode2=GetObj(nDstNode2);
- if (pDstNode2!=NULL) { // Node war sonst wohl nicht markiert
- pDstEdge->ConnectToNode(sal_False,pDstNode2);
- } else {
- DBG_ERROR("SdrObjList::operator=(): pDstNode2==NULL!");
- }
- }
- } else {
- DBG_ERROR("SdrObjList::operator=(): pDstEdge==NULL!");
- }
- }
- }
- }
- } else {
-#ifdef DBG_UTIL
- ByteString aStr("SdrObjList::operator=(): Fehler beim Clonen ");
+ if(!maList.empty() && (!nFrom || nFrom < maList.size()))
+ {
+ SdrObjectVector::iterator aCandidate;
+ SdrObjectVector::const_iterator aEnd;
+ sal_uInt32 a(nFrom);
- if(nCloneErrCnt == 1)
+ if(maUserNavigationOrder.empty())
{
- aStr += "eines Zeichenobjekts.";
+ aCandidate = maList.begin() + a;
+ aEnd = maList.end();
}
else
{
- aStr += "von ";
- aStr += ByteString::CreateFromInt32( nCloneErrCnt );
- aStr += " Zeichenobjekten.";
+ aCandidate = maUserNavigationOrder.begin() + a;
+ aEnd = maUserNavigationOrder.end();
}
- aStr += " Objektverbindungen werden nicht mitkopiert.";
-
- DBG_ERROR(aStr.GetBuffer());
-#endif
- }
-}
-
-void SdrObjList::Clear()
-{
- sal_Bool bObjectsRemoved(sal_False);
-
- while( ! maList.empty())
- {
- // remove last object from list
- SdrObject* pObj = maList.back();
- RemoveObjectFromContainer(maList.size()-1);
-
- // flushViewObjectContacts() is done since SdrObject::Free is not guaranteed
- // to delete the object and thus refresh visualisations
- pObj->GetViewContact().flushViewObjectContacts(true);
-
- bObjectsRemoved = sal_True;
-
- // sent remove hint (after removal, see RemoveObject())
- if(pModel)
+ for(;aCandidate != aEnd; a++, aCandidate++)
{
- SdrHint aHint(*pObj);
- aHint.SetKind(HINT_OBJREMOVED);
- aHint.SetPage(pPage);
- pModel->Broadcast(aHint);
- }
-
- // delete the object itself
- SdrObject::Free( pObj );
- }
-
- if(pModel && bObjectsRemoved)
- {
- pModel->SetChanged();
- }
-}
-
-SdrPage* SdrObjList::GetPage() const
-{
- return pPage;
-}
-
-void SdrObjList::SetPage(SdrPage* pNewPage)
-{
- if (pPage!=pNewPage) {
- pPage=pNewPage;
- sal_uIntPtr nAnz=GetObjCount();
- for (sal_uIntPtr no=0; no<nAnz; no++) {
- SdrObject* pObj=GetObj(no);
- pObj->SetPage(pPage);
+ OSL_ENSURE(*aCandidate, "SdrObjList with empty entries (!)");
+ SetOrdNumAtSdrObjectFromSdrObjList(**aCandidate, a);
}
}
}
-SdrModel* SdrObjList::GetModel() const
+SdrObjList::SdrObjList()
+: maList(),
+ maUserNavigationOrder()
{
- return pModel;
}
-void SdrObjList::SetModel(SdrModel* pNewModel)
-{
- if (pModel!=pNewModel) {
- pModel=pNewModel;
- sal_uIntPtr nAnz=GetObjCount();
- for (sal_uIntPtr i=0; i<nAnz; i++) {
- SdrObject* pObj=GetObj(i);
- pObj->SetModel(pModel);
- }
- }
-}
-
-void SdrObjList::RecalcObjOrdNums()
+SdrObjList::~SdrObjList()
{
- sal_uIntPtr nAnz=GetObjCount();
- for (sal_uIntPtr no=0; no<nAnz; no++) {
- SdrObject* pObj=GetObj(no);
- pObj->SetOrdNum(no);
- }
- bObjOrdNumsDirty=sal_False;
+ ClearSdrObjList();
}
-void SdrObjList::RecalcRects()
+SdrObjectVector SdrObjList::getSdrObjectVector() const
{
- aOutRect=Rectangle();
- aSnapRect=aOutRect;
- sal_uIntPtr nAnz=GetObjCount();
- sal_uIntPtr i;
- for (i=0; i<nAnz; i++) {
- SdrObject* pObj=GetObj(i);
- if (i==0) {
- aOutRect=pObj->GetCurrentBoundRect();
- aSnapRect=pObj->GetSnapRect();
- } else {
- aOutRect.Union(pObj->GetCurrentBoundRect());
- aSnapRect.Union(pObj->GetSnapRect());
- }
+ if(maUserNavigationOrder.empty())
+ {
+ return maList;
}
-}
-
-void SdrObjList::SetRectsDirty()
-{
- bRectsDirty=sal_True;
- if (pUpList!=NULL) pUpList->SetRectsDirty();
-}
-
-void SdrObjList::impChildInserted(SdrObject& rChild) const
-{
- sdr::contact::ViewContact* pParent = rChild.GetViewContact().GetParentContact();
-
- if(pParent)
+ else
{
- pParent->ActionChildInserted(rChild.GetViewContact());
+ return maUserNavigationOrder;
}
}
-void SdrObjList::NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos, const SdrInsertReason* /*pReason*/)
+void SdrObjList::copyDataFromSdrObjList(const SdrObjList& rSource)
{
- DBG_ASSERT(pObj!=NULL,"SdrObjList::NbcInsertObject(NULL)");
- if (pObj!=NULL) {
- DBG_ASSERT(!pObj->IsInserted(),"ZObjekt hat bereits Inserted-Status");
- sal_uIntPtr nAnz=GetObjCount();
- if (nPos>nAnz) nPos=nAnz;
- InsertObjectIntoContainer(*pObj,nPos);
-
- if (nPos<nAnz) bObjOrdNumsDirty=sal_True;
- pObj->SetOrdNum(nPos);
- pObj->SetObjList(this);
- pObj->SetPage(pPage);
+ ClearSdrObjList();
+ sal_uInt32 nCloneErrCnt(0);
+ const sal_uInt32 nAnz(rSource.GetObjCount());
+ sal_uInt32 no(0);
- // #110094# Inform the parent about change to allow invalidations at
- // evtl. existing parent visualisations
- impChildInserted(*pObj);
+ for(no = 0; no < nAnz; no++)
+ {
+ SdrObject* pSO = rSource.GetObj(no);
+ SdrObject* pDO = pSO->CloneSdrObject(&getSdrModelFromSdrObjList());
- if (!bRectsDirty) {
- aOutRect.Union(pObj->GetCurrentBoundRect());
- aSnapRect.Union(pObj->GetSnapRect());
+ if(pDO)
+ {
+ InsertObjectToSdrObjList(*pDO);
}
- pObj->SetInserted(sal_True); // Ruft u.a. den UserCall
- }
-}
-
-void SdrObjList::InsertObject(SdrObject* pObj, sal_uIntPtr nPos, const SdrInsertReason* pReason)
-{
- DBG_ASSERT(pObj!=NULL,"SdrObjList::InsertObject(NULL)");
-
- if(pObj)
- {
- // #69055# if anchor is used, reset it before grouping
- if(GetOwnerObj())
+ else
{
- const Point& rAnchorPos = pObj->GetAnchorPos();
- if(rAnchorPos.X() || rAnchorPos.Y())
- pObj->NbcSetAnchorPos(Point());
+ nCloneErrCnt++;
}
+ }
- // do insert to new group
- NbcInsertObject(pObj, nPos, pReason);
+ OSL_ENSURE(0 == nCloneErrCnt, "copyDataFromSdrObjList: copy error (!)");
- // Falls das Objekt in eine Gruppe eingefuegt wird
- // und nicht mit seinen Bruedern ueberlappt, muss es
- // einen eigenen Redraw bekommen
- if(pOwnerObj)
+ // clone evtl. connectors and evtl. connections
+ if(!nCloneErrCnt)
+ {
+ for(no = 0; no < nAnz; no++)
{
- // only repaint here
- pOwnerObj->ActionChanged();
- }
+ const SdrEdgeObj* pSrcEdge = dynamic_cast< SdrEdgeObj* >(rSource.GetObj(no));
- if(pModel)
- {
- // Hier muss ein anderer Broadcast her!
- // Repaint ab Objekt Nummer ... (Achtung: GroupObj)
- if(pObj->GetPage())
+ if(pSrcEdge)
{
- SdrHint aHint(*pObj);
+ SdrObject* pSrcNode1 = pSrcEdge->GetConnectedNode(true);
+ SdrObject* pSrcNode2 = pSrcEdge->GetConnectedNode(false);
- aHint.SetKind(HINT_OBJINSERTED);
- pModel->Broadcast(aHint);
- }
-
- pModel->SetChanged();
- }
- }
-}
+ if(pSrcNode1 && pSrcNode1->getParentOfSdrObject() != pSrcEdge->getParentOfSdrObject())
+ {
+ pSrcNode1 = 0; // Listenuebergreifend
+ }
-SdrObject* SdrObjList::NbcRemoveObject(sal_uIntPtr nObjNum)
-{
- if (nObjNum >= maList.size())
- {
- OSL_ASSERT(nObjNum<maList.size());
- return NULL;
- }
+ if(pSrcNode2 && pSrcNode2->getParentOfSdrObject() != pSrcEdge->getParentOfSdrObject())
+ {
+ pSrcNode2 = 0; // ist (noch) nicht
+ }
- sal_uIntPtr nAnz=GetObjCount();
- SdrObject* pObj=maList[nObjNum];
- RemoveObjectFromContainer(nObjNum);
+ if(pSrcNode1 || pSrcNode2)
+ {
+ SdrEdgeObj* pDstEdge = dynamic_cast< SdrEdgeObj* >(GetObj(no));
+
+ if(pDstEdge)
+ {
+ if(pSrcNode1)
+ {
+ const sal_uInt32 nDstNode1(pSrcNode1->GetNavigationPosition());
+ SdrObject* pDstNode1 = GetObj(nDstNode1);
+
+ if(pDstNode1)
+ {
+ // Sonst grober Fehler!
+ pDstEdge->ConnectToNode(true, pDstNode1);
+ }
+ else
+ {
+ DBG_ERROR("SdrObjList::operator=(): pDstNode1==0!");
+ }
+ }
- // flushViewObjectContacts() clears the VOC's and those invalidate
- pObj->GetViewContact().flushViewObjectContacts(true);
+ if(pSrcNode2)
+ {
+ const sal_uInt32 nDstNode2(pSrcNode2->GetNavigationPosition());
+ SdrObject* pDstNode2 = GetObj(nDstNode2);
- DBG_ASSERT(pObj!=NULL,"Object zum Removen nicht gefunden");
- if (pObj!=NULL) {
- DBG_ASSERT(pObj->IsInserted(),"ZObjekt hat keinen Inserted-Status");
- pObj->SetInserted(sal_False); // Ruft u.a. den UserCall
- pObj->SetObjList(NULL);
- pObj->SetPage(NULL);
- if (!bObjOrdNumsDirty) { // Optimierung fuer den Fall, dass das letzte Obj rausgenommen wird
- if (nObjNum!=sal_uIntPtr(nAnz-1)) {
- bObjOrdNumsDirty=sal_True;
+ if(pDstNode2)
+ {
+ // Node war sonst wohl nicht markiert
+ pDstEdge->ConnectToNode(false, pDstNode2);
+ }
+ else
+ {
+ DBG_ERROR("SdrObjList::operator=(): pDstNode2==0!");
+ }
+ }
+ }
+ else
+ {
+ DBG_ERROR("SdrObjList::operator=(): pDstEdge==0!");
+ }
+ }
}
}
- SetRectsDirty();
}
- return pObj;
}
-SdrObject* SdrObjList::RemoveObject(sal_uIntPtr nObjNum)
+void SdrObjList::ClearSdrObjList()
{
- if (nObjNum >= maList.size())
- {
- OSL_ASSERT(nObjNum<maList.size());
- return NULL;
- }
+ maUserNavigationOrder.clear();
- sal_uIntPtr nAnz=GetObjCount();
- SdrObject* pObj=maList[nObjNum];
- RemoveObjectFromContainer(nObjNum);
-
- DBG_ASSERT(pObj!=NULL,"Object zum Removen nicht gefunden");
- if(pObj)
+ while(!maList.empty())
{
- // flushViewObjectContacts() clears the VOC's and those invalidate
- pObj->GetViewContact().flushViewObjectContacts(true);
+ // remove last object from list
+ SdrObject* pObj = maList.back();
- DBG_ASSERT(pObj->IsInserted(),"ZObjekt hat keinen Inserted-Status");
- if (pModel!=NULL) {
- // Hier muss ein anderer Broadcast her!
- if (pObj->GetPage()!=NULL) {
- SdrHint aHint(*pObj);
- aHint.SetKind(HINT_OBJREMOVED);
- pModel->Broadcast(aHint);
- }
- pModel->SetChanged();
- }
- pObj->SetInserted(sal_False); // Ruft u.a. den UserCall
- pObj->SetObjList(NULL);
- pObj->SetPage(NULL);
- if (!bObjOrdNumsDirty) { // Optimierung fuer den Fall, dass das letzte Obj rausgenommen wird
- if (nObjNum!=sal_uIntPtr(nAnz-1)) {
- bObjOrdNumsDirty=sal_True;
+ if(pObj)
+ {
+ {
+ // broadcast immediately (before removal)
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj, HINT_OBJREMOVED);
}
- }
- SetRectsDirty();
- if(pOwnerObj && !GetObjCount())
+ RemoveObjectFromContainer(maList.size() - 1);
+
+ // flushViewObjectContacts() is done since deleteSdrObjectSafeAndClearPointer is not guaranteed
+ // to delete the object due to UNDO buffer; thus refresh visualisations here
+ pObj->GetViewContact().flushViewObjectContacts(true);
+
+ // delete the object itself (due to UNDO buffer this may not really destroy
+ // the SdrObject)
+ deleteSdrObjectSafeAndClearPointer(pObj);
+ }
+ else
{
- // empty group created; it needs to be repainted since it's
- // visualisation changes
- pOwnerObj->ActionChanged();
+ OSL_ENSURE(false, "Invalid SdrObjList (!)");
}
}
- return pObj;
}
-SdrObject* SdrObjList::NbcReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum)
+SdrPage* SdrObjList::getSdrPageFromSdrObjList() const
{
- if (nObjNum >= maList.size() || pNewObj == NULL)
- {
- OSL_ASSERT(nObjNum<maList.size());
- OSL_ASSERT(pNewObj!=NULL);
- return NULL;
- }
-
- SdrObject* pObj=maList[nObjNum];
- DBG_ASSERT(pObj!=NULL,"SdrObjList::ReplaceObject: Object zum Removen nicht gefunden");
- if (pObj!=NULL) {
- DBG_ASSERT(pObj->IsInserted(),"SdrObjList::ReplaceObject: ZObjekt hat keinen Inserted-Status");
- pObj->SetInserted(sal_False);
- pObj->SetObjList(NULL);
- pObj->SetPage(NULL);
- ReplaceObjectInContainer(*pNewObj,nObjNum);
-
- // flushViewObjectContacts() clears the VOC's and those invalidate
- pObj->GetViewContact().flushViewObjectContacts(true);
-
- pNewObj->SetOrdNum(nObjNum);
- pNewObj->SetObjList(this);
- pNewObj->SetPage(pPage);
+ // default is no page and returns zero
+ return 0;
+}
- // #110094# Inform the parent about change to allow invalidations at
- // evtl. existing parent visualisations
- impChildInserted(*pNewObj);
+SdrObject* SdrObjList::getSdrObjectFromSdrObjList() const
+{
+ // default is no SdrObject (SdrObjGroup)
+ return 0;
+}
- pNewObj->SetInserted(sal_True);
- SetRectsDirty();
- }
- return pObj;
+void SdrObjList::handleContentChange(const SfxHint& /*rHint*/)
+{
+ // default has nothing to do
}
-SdrObject* SdrObjList::ReplaceObject(SdrObject* pNewObj, sal_uIntPtr nObjNum)
+void SdrObjList::InsertObjectToSdrObjList(SdrObject& rObj, sal_uInt32 nPos)
{
- if (nObjNum >= maList.size())
- {
- OSL_ASSERT(nObjNum<maList.size());
- return NULL;
- }
- if (pNewObj == NULL)
+ SdrObject* pOwningGroupObject = getSdrObjectFromSdrObjList();
+
+ // if anchor is used, reset it before grouping (for SW)
+ if(pOwningGroupObject)
{
- OSL_ASSERT(pNewObj!=NULL);
- return NULL;
+ rObj.SetAnchorPos(basegfx::B2DPoint());
}
- SdrObject* pObj=maList[nObjNum];
- DBG_ASSERT(pObj!=NULL,"SdrObjList::ReplaceObject: Object zum Removen nicht gefunden");
- if (pObj!=NULL) {
- DBG_ASSERT(pObj->IsInserted(),"SdrObjList::ReplaceObject: ZObjekt hat keinen Inserted-Status");
- if (pModel!=NULL) {
- // Hier muss ein anderer Broadcast her!
- if (pObj->GetPage()!=NULL) {
- SdrHint aHint(*pObj);
- aHint.SetKind(HINT_OBJREMOVED);
- pModel->Broadcast(aHint);
- }
- }
- pObj->SetInserted(sal_False);
- pObj->SetObjList(NULL);
- pObj->SetPage(NULL);
- ReplaceObjectInContainer(*pNewObj,nObjNum);
-
- // flushViewObjectContacts() clears the VOC's and those invalidate
- pObj->GetViewContact().flushViewObjectContacts(true);
-
- pNewObj->SetOrdNum(nObjNum);
- pNewObj->SetObjList(this);
- pNewObj->SetPage(pPage);
-
- // #110094# Inform the parent about change to allow invalidations at
- // evtl. existing parent visualisations
- impChildInserted(*pNewObj);
-
- pNewObj->SetInserted(sal_True);
- if (pModel!=NULL) {
- // Hier muss ein anderer Broadcast her!
- if (pNewObj->GetPage()!=NULL) {
- SdrHint aHint(*pNewObj);
- aHint.SetKind(HINT_OBJINSERTED);
- pModel->Broadcast(aHint);
- }
- pModel->SetChanged();
- }
- SetRectsDirty();
- }
- return pObj;
-}
+ OSL_ENSURE(!rObj.IsObjectInserted(), "Object already has Inserted-State (!)");
+ InsertObjectIntoContainer(rObj, nPos);
+ SetParentAtSdrObjectFromSdrObjList(rObj, this);
-SdrObject* SdrObjList::NbcSetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum)
-{
- if (nOldObjNum >= maList.size() || nNewObjNum >= maList.size())
{
- OSL_ASSERT(nOldObjNum<maList.size());
- OSL_ASSERT(nNewObjNum<maList.size());
- return NULL;
+ // broadcast after insert
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(rObj, HINT_OBJINSERTED);
}
- SdrObject* pObj=maList[nOldObjNum];
- if (nOldObjNum==nNewObjNum) return pObj;
- DBG_ASSERT(pObj!=NULL,"SdrObjList::NbcSetObjectOrdNum: Object nicht gefunden");
- if (pObj!=NULL) {
- DBG_ASSERT(pObj->IsInserted(),"SdrObjList::NbcSetObjectOrdNum: ZObjekt hat keinen Inserted-Status");
- RemoveObjectFromContainer(nOldObjNum);
-
- InsertObjectIntoContainer(*pObj,nNewObjNum);
+ // inform visible parents
+ sdr::contact::ViewContact* pParent = rObj.GetViewContact().GetParentContact();
- // #110094# No need to delete visualisation data since same object
- // gets inserted again. Also a single ActionChanged is enough
- pObj->ActionChanged();
+ if(pParent)
+ {
+ pParent->ActionChildInserted(rObj.GetViewContact());
+ }
- pObj->SetOrdNum(nNewObjNum);
- bObjOrdNumsDirty=sal_True;
+ if(pOwningGroupObject)
+ {
+ // repaint needed
+ pOwningGroupObject->ActionChanged();
}
- return pObj;
+
+ getSdrModelFromSdrObjList().SetChanged();
}
-SdrObject* SdrObjList::SetObjectOrdNum(sal_uIntPtr nOldObjNum, sal_uIntPtr nNewObjNum)
+SdrObject* SdrObjList::RemoveObjectFromSdrObjList(sal_uInt32 nObjNum)
{
- if (nOldObjNum >= maList.size() || nNewObjNum >= maList.size())
+ if(nObjNum < maList.size())
{
- OSL_ASSERT(nOldObjNum<maList.size());
- OSL_ASSERT(nNewObjNum<maList.size());
- return NULL;
- }
+ SdrObject* pObj = *(maList.begin() + nObjNum);
+
+ if(pObj)
+ {
+ {
+ // broadcast immediately (before removal)
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj, HINT_OBJREMOVED);
+ }
- SdrObject* pObj=maList[nOldObjNum];
- if (nOldObjNum==nNewObjNum) return pObj;
- DBG_ASSERT(pObj!=NULL,"SdrObjList::SetObjectOrdNum: Object nicht gefunden");
- if (pObj!=NULL) {
- DBG_ASSERT(pObj->IsInserted(),"SdrObjList::SetObjectOrdNum: ZObjekt hat keinen Inserted-Status");
- RemoveObjectFromContainer(nOldObjNum);
- InsertObjectIntoContainer(*pObj,nNewObjNum);
+ RemoveObjectFromContainer(nObjNum);
- // #110094#No need to delete visualisation data since same object
- // gets inserted again. Also a single ActionChanged is enough
- pObj->ActionChanged();
+ // flushViewObjectContacts() clears the VOC's and those invalidate
+ pObj->GetViewContact().flushViewObjectContacts(true);
+ OSL_ENSURE(pObj->IsObjectInserted(), "Object has no Inserted-State (!)");
+ getSdrModelFromSdrObjList().SetChanged();
+ SetParentAtSdrObjectFromSdrObjList(*pObj, 0);
+
+ if(!GetObjCount())
+ {
+ SdrObject* pOwningSdrObject = getSdrObjectFromSdrObjList();
- pObj->SetOrdNum(nNewObjNum);
- bObjOrdNumsDirty=sal_True;
- if (pModel!=NULL)
+ // empty group created; it needs to be repainted since it's
+ // visualisation changes
+ if(pOwningSdrObject)
+ {
+ pOwningSdrObject->ActionChanged();
+ }
+ }
+ }
+ else
{
- // Hier muss ein anderer Broadcast her!
- if (pObj->GetPage()!=NULL) pModel->Broadcast(SdrHint(*pObj));
- pModel->SetChanged();
+ OSL_ENSURE(false, "removed non-existent object (!)");
}
- }
- return pObj;
-}
-const Rectangle& SdrObjList::GetAllObjSnapRect() const
-{
- if (bRectsDirty) {
- ((SdrObjList*)this)->RecalcRects();
- ((SdrObjList*)this)->bRectsDirty=sal_False;
+ return pObj;
}
- return aSnapRect;
-}
-
-const Rectangle& SdrObjList::GetAllObjBoundRect() const
-{
- // #i106183# for deep group hierarchies like in chart2, the invalidates
- // through the hierarchy are not correct; use a 2nd hint for the needed
- // recalculation. Future versions will have no bool flag at all, but
- // just aOutRect in empty state to representate an invalid state, thus
- // it's a step in the right direction.
- if (bRectsDirty || aOutRect.IsEmpty())
+ else
{
- ((SdrObjList*)this)->RecalcRects();
- ((SdrObjList*)this)->bRectsDirty=sal_False;
+ OSL_ENSURE(false, "SdrObjList::RemoveObjectFromSdrObjList with invalid index (!)");
+ return 0;
}
- return aOutRect;
}
-void SdrObjList::NbcReformatAllTextObjects()
+SdrObject* SdrObjList::ReplaceObjectInSdrObjList(SdrObject& rNewObj, sal_uInt32 nObjNum)
{
- sal_uIntPtr nAnz=GetObjCount();
- sal_uIntPtr nNum=0;
+ OSL_ENSURE(nObjNum < maList.size(), "SdrObjList::ReplaceObjectInSdrObjList with invalid index (!)");
+ SdrObject* pRetval = RemoveObjectFromSdrObjList(nObjNum);
+ InsertObjectToSdrObjList(rNewObj, nObjNum);
- Printer* pPrinter = NULL;
+ return pRetval;
+}
- if (pModel)
+SdrObject* SdrObjList::SetNavigationPosition(sal_uInt32 nOldObjNum, sal_uInt32 nNewObjNum)
+{
+ if(nOldObjNum < maList.size() && nNewObjNum < maList.size())
{
- if (pModel->GetRefDevice() && pModel->GetRefDevice()->GetOutDevType() == OUTDEV_PRINTER)
- {
- // Kein RefDevice oder RefDevice kein Printer
- pPrinter = (Printer*) pModel->GetRefDevice();
- }
- }
+ SdrObject* pObj = *(maList.begin() + nOldObjNum);
- while (nNum<nAnz)
- {
- SdrObject* pObj = GetObj(nNum);
- if (pPrinter &&
- pObj->GetObjInventor() == SdrInventor &&
- pObj->GetObjIdentifier() == OBJ_OLE2 &&
- !( (SdrOle2Obj*) pObj )->IsEmpty() )
+ if(pObj)
{
- //const SvInPlaceObjectRef& xObjRef = ((SdrOle2Obj*) pObj)->GetObjRef();
- //TODO/LATER: PrinterChangeNotification needed
- //if( xObjRef.Is() && ( xObjRef->GetMiscStatus() & SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE ) )
- // xObjRef->OnDocumentPrinterChanged(pPrinter);
- }
+ if(nOldObjNum == nNewObjNum)
+ {
+ return pObj;
+ }
- pObj->NbcReformatText();
- nAnz=GetObjCount(); // ReformatText may delete an object
- nNum++;
- }
+ OSL_ENSURE(pObj->IsObjectInserted(), "Object has no Inserted-State (!)");
-}
+ {
+ // broadcast immediately (before removal)
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj, HINT_OBJREMOVED);
+ }
-void SdrObjList::ReformatAllTextObjects()
-{
- NbcReformatAllTextObjects();
-}
+ RemoveObjectFromContainer(nOldObjNum);
+ InsertObjectIntoContainer(*pObj, nNewObjNum);
-/** steps over all available objects and reformats all
- edge objects that are connected to other objects so that
- they may reposition itselfs.
- #103122#
-*/
-void SdrObjList::ReformatAllEdgeObjects()
-{
- // #120437# go over whole hierarchy, not only over object level null (seen from grouping)
- SdrObjListIter aIter(*this, IM_DEEPNOGROUPS);
+ {
+ // broadcast after insert
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj, HINT_OBJINSERTED);
+ }
- while(aIter.IsMore())
- {
- SdrEdgeObj* pSdrEdgeObj = dynamic_cast< SdrEdgeObj* >(aIter.Next());
+ // #110094#No need to delete visualisation data since same object
+ // gets inserted again. Also a single ActionChanged is enough
+ pObj->ActionChanged();
+ getSdrModelFromSdrObjList().SetChanged();
- if(pSdrEdgeObj)
+ return pObj;
+ }
+ else
{
- pSdrEdgeObj->Reformat();
+ OSL_ENSURE(false, "SdrObjList::SetNavigationPosition at non-existent object (!)");
}
}
-}
-
-void SdrObjList::BurnInStyleSheetAttributes()
-{
- for(sal_uInt32 a(0L); a < GetObjCount(); a++)
+ else
{
- GetObj(a)->BurnInStyleSheetAttributes();
+ OSL_ENSURE(nOldObjNum < maList.size(), "SdrObjList::SetNavigationPosition with invalid old index (!)");
+ OSL_ENSURE(nNewObjNum < maList.size(), "SdrObjList::SetNavigationPosition with invalid new index (!)");
}
-}
-sal_uIntPtr SdrObjList::GetObjCount() const
-{
- return maList.size();
+ return 0;
}
-
-
-
-SdrObject* SdrObjList::GetObj(sal_uIntPtr nNum) const
+SdrObject* SdrObjList::GetObj(sal_uInt32 nNum) const
{
- if (nNum >= maList.size())
+ if(maUserNavigationOrder.empty())
{
- OSL_ASSERT(nNum<maList.size());
- return NULL;
- }
- else
- return maList[nNum];
-}
-
-
-
-
-FASTBOOL SdrObjList::IsReadOnly() const
-{
- FASTBOOL bRet=sal_False;
- if (pPage!=NULL && pPage!=this) bRet=pPage->IsReadOnly();
- return bRet;
-}
-
-sal_uIntPtr SdrObjList::CountAllObjects() const
-{
- sal_uIntPtr nCnt=GetObjCount();
- sal_uIntPtr nAnz=nCnt;
- for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
- SdrObjList* pSubOL=GetObj(nNum)->GetSubList();
- if (pSubOL!=NULL) {
- nCnt+=pSubOL->CountAllObjects();
+ if(nNum < maList.size())
+ {
+ return *(maList.begin() + nNum);
}
}
- return nCnt;
-}
-
-void SdrObjList::ForceSwapInObjects() const
-{
- sal_uIntPtr nObjAnz=GetObjCount();
- for (sal_uIntPtr nObjNum=nObjAnz; nObjNum>0;) {
- SdrObject* pObj=GetObj(--nObjNum);
- SdrGrafObj* pGrafObj=PTR_CAST(SdrGrafObj,pObj);
- if (pGrafObj!=NULL) {
- pGrafObj->ForceSwapIn();
- }
- SdrObjList* pOL=pObj->GetSubList();
- if (pOL!=NULL) {
- pOL->ForceSwapInObjects();
+ else
+ {
+ if(nNum < maUserNavigationOrder.size())
+ {
+ return *(maUserNavigationOrder.begin() + nNum);
}
}
-}
-void SdrObjList::ForceSwapOutObjects() const
-{
- sal_uIntPtr nObjAnz=GetObjCount();
- for (sal_uIntPtr nObjNum=nObjAnz; nObjNum>0;) {
- SdrObject* pObj=GetObj(--nObjNum);
- SdrGrafObj* pGrafObj=PTR_CAST(SdrGrafObj,pObj);
- if (pGrafObj!=NULL) {
- pGrafObj->ForceSwapOut();
- }
- SdrObjList* pOL=pObj->GetSubList();
- if (pOL!=NULL) {
- pOL->ForceSwapOutObjects();
- }
- }
+ OSL_ENSURE(false, "SdrObjList::GetObj with wrong Index (!)");
+ return 0;
}
void SdrObjList::FlattenGroups()
{
- sal_Int32 nObj = GetObjCount();
- sal_Int32 i;
- for( i=nObj-1; i>=0; --i)
- UnGroupObj(i);
+ for(sal_uInt32 nObjCount(GetObjCount()); nObjCount;)
+ {
+ nObjCount--;
+ UnGroupObj(nObjCount);
+ }
}
-void SdrObjList::UnGroupObj( sal_uIntPtr nObjNum )
+void SdrObjList::UnGroupObj(sal_uInt32 nObjNum)
{
// if the given object is no group, this method is a noop
- SdrObject* pUngroupObj = GetObj( nObjNum );
+ SdrObjGroup* pUngroupObj = dynamic_cast< SdrObjGroup* >(GetObj(nObjNum));
+
if( pUngroupObj )
{
- SdrObjList* pSrcLst = pUngroupObj->GetSubList();
- //sal_Int32 nCount( 0 );
- if( pUngroupObj->ISA( SdrObjGroup ) && pSrcLst )
- {
- SdrObjGroup* pUngroupGroup = static_cast< SdrObjGroup* > (pUngroupObj);
+ // ungroup recursively (has to be head recursion,
+ // otherwise our indices will get trashed when doing it in
+ // the loop)
+ pUngroupObj->FlattenGroups();
- // ungroup recursively (has to be head recursion,
- // otherwise our indices will get trashed when doing it in
- // the loop)
- pSrcLst->FlattenGroups();
-
- // the position at which we insert the members of rUngroupGroup
- sal_Int32 nInsertPos( pUngroupGroup->GetOrdNum() );
-
- SdrObject* pObj;
- sal_Int32 i, nAnz = pSrcLst->GetObjCount();
- for( i=0; i<nAnz; ++i )
- {
- pObj = pSrcLst->RemoveObject(0);
- SdrInsertReason aReason(SDRREASON_VIEWCALL, pUngroupGroup);
- InsertObject(pObj, nInsertPos, &aReason);
- ++nInsertPos;
- }
+ // the position at which we insert the members of rUngroupGroup
+ sal_uInt32 nInsertPos(pUngroupObj->GetNavigationPosition());
+ const sal_uInt32 nAnz(pUngroupObj->GetObjCount());
- RemoveObject(nInsertPos);
+ for(sal_uInt32 i(0); i < nAnz; i++)
+ {
+ SdrObject* pObj = pUngroupObj->RemoveObjectFromSdrObjList(0);
+ InsertObjectToSdrObjList(*pObj, nInsertPos);
+ nInsertPos++;
}
+
+ RemoveObjectFromSdrObjList(nInsertPos);
}
-#ifdef DBG_UTIL
else
- DBG_ERROR("SdrObjList::UnGroupObj: object index invalid");
-#endif
+ {
+ OSL_ENSURE(false, "SdrObjList::UnGroupObj: object index invalid");
+ }
}
-
-
-
-bool SdrObjList::HasObjectNavigationOrder (void) const
+bool SdrObjList::HasUserNavigationOrder(void) const
{
- return mpNavigationOrder.get() != NULL;
+ return !maUserNavigationOrder.empty();
}
-
-
-
-void SdrObjList::SetObjectNavigationPosition (
- SdrObject& rObject,
- const sal_uInt32 nNewPosition)
+void SdrObjList::SetUserNavigationPosition(SdrObject& rObject, const sal_uInt32 nNewPosition)
{
// When the navigation order container has not yet been created then
// create one now. It is initialized with the z-order taken from
// maList.
- if (mpNavigationOrder.get() == NULL)
+ bool bUnchanged(false);
+
+ if(maUserNavigationOrder.empty())
{
- mpNavigationOrder.reset(new WeakSdrObjectContainerType(maList.size()));
- ::std::copy(
- maList.begin(),
- maList.end(),
- mpNavigationOrder->begin());
+ maUserNavigationOrder = maList;
+ bUnchanged = true;
}
- OSL_ASSERT(mpNavigationOrder.get()!=NULL);
- OSL_ASSERT( mpNavigationOrder->size() == maList.size());
- SdrObjectWeakRef aReference (&rObject);
+ OSL_ASSERT(!maUserNavigationOrder.empty());
+ OSL_ASSERT(maUserNavigationOrder.size() == maList.size());
// Look up the object whose navigation position is to be changed.
- WeakSdrObjectContainerType::iterator iObject (::std::find(
- mpNavigationOrder->begin(),
- mpNavigationOrder->end(),
- aReference));
- if (iObject == mpNavigationOrder->end())
+ SdrObjectVector::iterator iObject(::std::find(
+ maUserNavigationOrder.begin(),
+ maUserNavigationOrder.end(),
+ &rObject));
+
+ if(maUserNavigationOrder.end() == iObject)
{
// The given object is not a member of the navigation order.
+ if(bUnchanged)
+ {
+ maUserNavigationOrder.clear();
+ }
+
return;
}
// Move the object to its new position.
- const sal_uInt32 nOldPosition = ::std::distance(mpNavigationOrder->begin(), iObject);
+ const sal_uInt32 nOldPosition(::std::distance(maUserNavigationOrder.begin(), iObject));
+
if (nOldPosition != nNewPosition)
{
- mpNavigationOrder->erase(iObject);
+ maUserNavigationOrder.erase(iObject);
sal_uInt32 nInsertPosition (nNewPosition);
+
// Adapt insertion position for the just erased object.
if (nNewPosition >= nOldPosition)
+ {
nInsertPosition -= 1;
- if (nInsertPosition >= mpNavigationOrder->size())
- mpNavigationOrder->push_back(aReference);
- else
- mpNavigationOrder->insert(mpNavigationOrder->begin()+nInsertPosition, aReference);
-
- mbIsNavigationOrderDirty = true;
-
- // The navigation order is written out to file so mark the model as modified.
- if (pModel != NULL)
- pModel->SetChanged();
- }
-}
-
-
-
+ }
-SdrObject* SdrObjList::GetObjectForNavigationPosition (const sal_uInt32 nNavigationPosition) const
-{
- if (HasObjectNavigationOrder())
- {
- // There is a user defined navigation order. Make sure the object
- // index is correct and look up the object in mpNavigationOrder.
- if (nNavigationPosition >= mpNavigationOrder->size())
+ if(nInsertPosition >= maUserNavigationOrder.size())
{
- OSL_ASSERT(nNavigationPosition < mpNavigationOrder->size());
+ maUserNavigationOrder.push_back(&rObject);
}
else
- return (*mpNavigationOrder)[nNavigationPosition].get();
- }
- else
- {
- // There is no user defined navigation order. Use the z-order
- // instead.
- if (nNavigationPosition >= maList.size())
{
- OSL_ASSERT(nNavigationPosition < maList.size());
+ maUserNavigationOrder.insert(maUserNavigationOrder.begin() + nInsertPosition, &rObject);
}
- else
- return maList[nNavigationPosition];
- }
- return NULL;
-}
+ // re-create OrdNums based on new order
+ EnsureValidNavigationPositions(::std::min(nOldPosition, nNewPosition));
-
-
-void SdrObjList::ClearObjectNavigationOrder (void)
-{
- mpNavigationOrder.reset();
- mbIsNavigationOrderDirty = true;
+ // The navigation order is written out to file so mark the model as modified.
+ getSdrModelFromSdrObjList().SetChanged();
+ }
}
-
-
-
-bool SdrObjList::RecalcNavigationPositions (void)
+void SdrObjList::ClearUserNavigationOrder(void)
{
- bool bUpToDate (false);
-
- if (mbIsNavigationOrderDirty)
+ if(!maUserNavigationOrder.empty())
{
- if (mpNavigationOrder.get() != NULL)
- {
- mbIsNavigationOrderDirty = false;
-
- WeakSdrObjectContainerType::iterator iObject;
- WeakSdrObjectContainerType::const_iterator iEnd (mpNavigationOrder->end());
- sal_uInt32 nIndex (0);
- for (iObject=mpNavigationOrder->begin(); iObject!=iEnd; ++iObject,++nIndex)
- (*iObject)->SetNavigationPosition(nIndex);
-
- bUpToDate = true;
- }
+ maUserNavigationOrder.clear();
+ EnsureValidNavigationPositions();
}
-
- return mpNavigationOrder.get() != NULL;
}
-
-
-
-void SdrObjList::SetNavigationOrder (const uno::Reference<container::XIndexAccess>& rxOrder)
+void SdrObjList::SetUserNavigationOrder(const uno::Reference<container::XIndexAccess>& rxOrder)
{
if (rxOrder.is())
{
- const sal_Int32 nCount = rxOrder->getCount();
+ const sal_Int32 nCount(rxOrder->getCount());
+
if ((sal_uInt32)nCount != maList.size())
+ {
return;
+ }
- if (mpNavigationOrder.get() == NULL)
- mpNavigationOrder.reset(new WeakSdrObjectContainerType(nCount));
+ maUserNavigationOrder.clear();
+ maUserNavigationOrder.reserve(nCount);
- for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex)
+ for(sal_Int32 nIndex(0); nIndex < nCount; nIndex++)
{
uno::Reference<uno::XInterface> xShape (rxOrder->getByIndex(nIndex), uno::UNO_QUERY);
SdrObject* pObject = SdrObject::getSdrObjectFromXShape(xShape);
- if (pObject == NULL)
+
+ if(!pObject)
break;
- (*mpNavigationOrder)[nIndex] = pObject;
+
+ maUserNavigationOrder.push_back(pObject);
}
- mbIsNavigationOrderDirty = true;
+ EnsureValidNavigationPositions();
}
else
- ClearObjectNavigationOrder();
+ {
+ ClearUserNavigationOrder();
+ }
}
-
-
-
-void SdrObjList::InsertObjectIntoContainer (
- SdrObject& rObject,
- const sal_uInt32 nInsertPosition)
+void SdrObjList::InsertObjectIntoContainer(SdrObject& rObject, const sal_uInt32 nInsertPosition)
{
- OSL_ASSERT(nInsertPosition<=maList.size());
+ if(&rObject.getSdrModelFromSdrObject() != &getSdrModelFromSdrObjList())
+ {
+ OSL_ENSURE(false, "InsertObjectToSdrObjList with SdrModel of SdrObject != SdrModel from SdrObjList (!)");
+ deleteSdrObjectSafe(&rObject);
+ return;
+ }
// Update the navigation positions.
- if (HasObjectNavigationOrder())
+ if(!maUserNavigationOrder.empty())
{
// The new object does not have a user defined position so append it
// to the list.
- rObject.SetNavigationPosition(mpNavigationOrder->size());
- mpNavigationOrder->push_back(&rObject);
+ maUserNavigationOrder.push_back(&rObject);
}
- // Insert object into object list. Because the insert() method requires
- // a valid iterator as insertion position, we have to use push_back() to
- // insert at the end of the list.
+ // Insert object into object list
if (nInsertPosition >= maList.size())
+ {
maList.push_back(&rObject);
+ SetOrdNumAtSdrObjectFromSdrObjList(rObject, maList.size() - 1);
+ }
else
+ {
maList.insert(maList.begin()+nInsertPosition, &rObject);
- bObjOrdNumsDirty=sal_True;
+ EnsureValidNavigationPositions();
+ }
}
-
-
-
-void SdrObjList::ReplaceObjectInContainer (
- SdrObject& rNewObject,
- const sal_uInt32 nObjectPosition)
+void SdrObjList::RemoveObjectFromContainer(const sal_uInt32 nObjectPosition)
{
if (nObjectPosition >= maList.size())
{
@@ -1069,107 +625,100 @@ void SdrObjList::ReplaceObjectInContainer (
return;
}
+ SdrObjectVector::iterator aListPosition(maList.begin() + nObjectPosition);
+
// Update the navigation positions.
- if (HasObjectNavigationOrder())
+ if(!maUserNavigationOrder.empty())
{
- // A user defined position of the object that is to be replaced is
- // not transferred to the new object so erase the former and append
- // the later object from/to the navigation order.
- OSL_ASSERT(nObjectPosition < maList.size());
- SdrObjectWeakRef aReference (maList[nObjectPosition]);
- WeakSdrObjectContainerType::iterator iObject (::std::find(
- mpNavigationOrder->begin(),
- mpNavigationOrder->end(),
- aReference));
- if (iObject != mpNavigationOrder->end())
- mpNavigationOrder->erase(iObject);
-
- mpNavigationOrder->push_back(&rNewObject);
+ SdrObjectVector::iterator iObject(::std::find(
+ maUserNavigationOrder.begin(),
+ maUserNavigationOrder.end(),
+ *aListPosition));
- mbIsNavigationOrderDirty = true;
+ if(iObject != maUserNavigationOrder.end())
+ {
+ maUserNavigationOrder.erase(iObject);
+ }
}
- maList[nObjectPosition] = &rNewObject;
- bObjOrdNumsDirty=sal_True;
+ maList.erase(aListPosition);
+ EnsureValidNavigationPositions(nObjectPosition);
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-void SdrObjList::RemoveObjectFromContainer (
- const sal_uInt32 nObjectPosition)
+SdrPageGridFrame::SdrPageGridFrame(const basegfx::B2DRange& rPaper)
+: maPaper(rPaper),
+ maUserArea(rPaper)
{
- if (nObjectPosition >= maList.size())
- {
- OSL_ASSERT(nObjectPosition<maList.size());
- return;
- }
-
- // Update the navigation positions.
- if (HasObjectNavigationOrder())
- {
- SdrObjectWeakRef aReference (maList[nObjectPosition]);
- WeakSdrObjectContainerType::iterator iObject (::std::find(
- mpNavigationOrder->begin(),
- mpNavigationOrder->end(),
- aReference));
- if (iObject != mpNavigationOrder->end())
- mpNavigationOrder->erase(iObject);
- mbIsNavigationOrderDirty = true;
- }
-
- maList.erase(maList.begin()+nObjectPosition);
- bObjOrdNumsDirty=sal_True;
}
-
-
+SdrPageGridFrame::SdrPageGridFrame(const basegfx::B2DRange& rPaper, const basegfx::B2DRange& rUser)
+: maPaper(rPaper),
+ maUserArea(rUser)
+{
+}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrPageGridFrameList::Clear()
+SdrPageGridFrameList::SdrPageGridFrameList()
+: maList()
{
- sal_uInt16 nAnz=GetCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- delete GetObject(i);
- }
- aList.Clear();
}
-//////////////////////////////////////////////////////////////////////////////
-// #111111# PageUser section
-
-void SdrPage::AddPageUser(sdr::PageUser& rNewUser)
+SdrPageGridFrameList::~SdrPageGridFrameList()
{
- maPageUsers.push_back(&rNewUser);
+ Clear();
}
-void SdrPage::RemovePageUser(sdr::PageUser& rOldUser)
+SdrPageGridFrame* SdrPageGridFrameList::GetObject(sal_uInt32 i) const
{
- const ::sdr::PageUserVector::iterator aFindResult = ::std::find(maPageUsers.begin(), maPageUsers.end(), &rOldUser);
- if(aFindResult != maPageUsers.end())
+ if(i < maList.size())
+ {
+ return *(maList.begin() + i);
+ }
+ else
{
- maPageUsers.erase(aFindResult);
+ OSL_ENSURE(false, "SdrPageGridFrameList::GetObject access out of range (!)");
+ return 0;
}
}
-//////////////////////////////////////////////////////////////////////////////
-// #110094# DrawContact section
-
-sdr::contact::ViewContact* SdrPage::CreateObjectSpecificViewContact()
+void SdrPageGridFrameList::Clear()
{
- return new sdr::contact::ViewContactOfSdrPage(*this);
+ for(SdrPageGridFrameContainerType::iterator aCandidate(maList.begin());
+ aCandidate != maList.end(); aCandidate++)
+ {
+ delete *aCandidate;
+ }
+
+ maList.clear();
}
-sdr::contact::ViewContact& SdrPage::GetViewContact() const
+void SdrPageGridFrameList::Insert(const SdrPageGridFrame& rGF, sal_uInt32 nPos)
{
- if(!mpViewContact)
+ if(nPos >= maList.size())
+ {
+ maList.push_back(new SdrPageGridFrame(rGF));
+ }
+ else
{
- const_cast< SdrPage* >(this)->mpViewContact =
- const_cast< SdrPage* >(this)->CreateObjectSpecificViewContact();
+ maList.insert(maList.begin() + nPos, new SdrPageGridFrame(rGF));
}
+}
- return *mpViewContact;
+void SdrPageGridFrameList::Delete(sal_uInt32 nPos)
+{
+ if(nPos < maList.size())
+ {
+ SdrPageGridFrameContainerType::iterator a(maList.begin() + nPos);
+ delete *a;
+ maList.erase(a);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrPageGridFrameList::Delete with wrong index (!)");
+ }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1198,22 +747,18 @@ void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet)
void ImpPageChange(SdrPage& rSdrPage)
{
rSdrPage.ActionChanged();
-
- if(rSdrPage.GetModel())
- {
- rSdrPage.GetModel()->SetChanged(true);
- SdrHint aHint(HINT_PAGEORDERCHG);
- aHint.SetPage(&rSdrPage);
- rSdrPage.GetModel()->Broadcast(aHint);
- }
+ rSdrPage.getSdrModelFromSdrPage().SetChanged(true);
+ rSdrPage.getSdrModelFromSdrPage().Broadcast(SdrBaseHint(rSdrPage, HINT_PAGEORDERCHG));
}
SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage)
: SfxListener(),
mpSdrPage(&rSdrPage),
mpStyleSheet(0),
- mpProperties(new SfxItemSet(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST))
+ mpProperties(0)
{
+ mpProperties = new SfxItemSet(mpSdrPage->getSdrModelFromSdrPage().GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+
if(!rSdrPage.IsMasterPage())
{
mpProperties->Put(XFillStyleItem(XFILL_NONE));
@@ -1296,85 +841,63 @@ SfxStyleSheet* SdrPageProperties::GetStyleSheet() const
////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1(SdrPage,SdrObjList);
-DBG_NAME(SdrPage)
-SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
-: SdrObjList(&rNewModel, this),
- mpViewContact(0L),
- nWdt(10L),
- nHgt(10L),
- nBordLft(0L),
- nBordUpp(0L),
- nBordRgt(0L),
- nBordLwr(0L),
- pLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())),
- mpSdrPageProperties(0),
- mpMasterPageDescriptor(0L),
- nPageNum(0L),
- mbMaster(bMasterPage),
- mbInserted(false),
- mbObjectsNotPersistent(false),
- mbSwappingLocked(false),
- mbPageBorderOnlyLeftRight(false)
+void SdrPage::AddListener(SfxListener& rListener)
{
- DBG_CTOR(SdrPage,NULL);
- aPrefVisiLayers.SetAll();
- eListKind = (bMasterPage) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
-
- mpSdrPageProperties = new SdrPageProperties(*this);
+ rListener.StartListening(*this);
}
-SdrPage::SdrPage(const SdrPage& rSrcPage)
-: SdrObjList(rSrcPage.pModel, this),
- tools::WeakBase< SdrPage >(),
- mpViewContact(0L),
- nWdt(rSrcPage.nWdt),
- nHgt(rSrcPage.nHgt),
- nBordLft(rSrcPage.nBordLft),
- nBordUpp(rSrcPage.nBordUpp),
- nBordRgt(rSrcPage.nBordRgt),
- nBordLwr(rSrcPage.nBordLwr),
- pLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())),
- mpSdrPageProperties(0),
- mpMasterPageDescriptor(0L),
- nPageNum(rSrcPage.nPageNum),
- mbMaster(rSrcPage.mbMaster),
- mbInserted(false),
- mbObjectsNotPersistent(rSrcPage.mbObjectsNotPersistent),
- mbSwappingLocked(rSrcPage.mbSwappingLocked),
- mbPageBorderOnlyLeftRight(rSrcPage.mbPageBorderOnlyLeftRight)
+void SdrPage::RemoveListener(SfxListener& rListener)
{
- DBG_CTOR(SdrPage,NULL);
- aPrefVisiLayers.SetAll();
- eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
-
- // copy things from source
- // Warning: this leads to slicing (see issue 93186) and has to be
- // removed as soon as possible.
- *this = rSrcPage;
- OSL_ENSURE(mpSdrPageProperties,
- "SdrPage::SdrPage: operator= did not create needed SdrPageProperties (!)");
+ rListener.EndListening(*this);
+}
- // be careful and correct eListKind, a member of SdrObjList which
- // will be changed by the SdrOIbjList::operator= before...
- eListKind = (mbMaster) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
+sdr::contact::ViewContact* SdrPage::CreateObjectSpecificViewContact()
+{
+ return new sdr::contact::ViewContactOfSdrPage(*this);
+}
- // The previous assignment to *this may have resulted in a call to
- // createUnoPage at a partially initialized (sliced) SdrPage object.
- // Due to the vtable being not yet fully set-up at this stage,
- // createUnoPage() may have been called at the wrong class.
- // To force a call to the right createUnoPage() at a later time when the
- // new object is full constructed mxUnoPage is disposed now.
- uno::Reference<lang::XComponent> xComponent (mxUnoPage, uno::UNO_QUERY);
- if (xComponent.is())
+sdr::contact::ViewContact& SdrPage::GetViewContact() const
+{
+ if(!mpViewContact)
{
- mxUnoPage = NULL;
- xComponent->dispose();
+ const_cast< SdrPage* >(this)->mpViewContact = const_cast< SdrPage* >(this)->CreateObjectSpecificViewContact();
}
+
+ return *mpViewContact;
+}
+
+SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
+: SdrObjList(),
+ SfxBroadcaster(),
+ tools::WeakBase< SdrPage >(),
+ mrSdrModelFromSdrPage(rNewModel),
+ mpViewContact(0),
+ mpSdrPageProperties(0),
+ maComments(),
+ mnPageNum(0),
+ mpPageLayerAdmin(new SdrLayerAdmin(rNewModel, &rNewModel.GetModelLayerAdmin())),
+ mpMasterPageDescriptor(0),
+ mxUnoPage(),
+ maPageScale(10.0, 10.0),
+ mfLeftPageBorder(0.0),
+ mfTopPageBorder(0.0),
+ mfRightPageBorder(0.0),
+ mfBottomPageBorder(0.0),
+ mbMaster(bMasterPage),
+ mbInserted(false),
+ mbPageBorderOnlyLeftRight(false)
+{
+ // do NOT move this to the member initialisation; it internally will use
+ // stuff from the SdrPage, in this case mbMaster (!)
+ mpSdrPageProperties = new SdrPageProperties(*this);
}
SdrPage::~SdrPage()
{
+ // Broadcast dying hint to registered SdrPageUsers to allow them to
+ // no longer reference this page
+ Broadcast(SdrBaseHint(*this, HINT_SDRPAGEDYING));
+
if( mxUnoPage.is() ) try
{
uno::Reference< lang::XComponent > xPageComponent( mxUnoPage, uno::UNO_QUERY_THROW );
@@ -1386,25 +909,7 @@ SdrPage::~SdrPage()
DBG_UNHANDLED_EXCEPTION();
}
- // #111111#
- // tell all the registered PageUsers that the page is in destruction
- // This causes some (all?) PageUsers to remove themselves from the list
- // of page users. Therefore we have to use a copy of the list for the
- // iteration.
- ::sdr::PageUserVector aListCopy (maPageUsers.begin(), maPageUsers.end());
- for(::sdr::PageUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); aIterator++)
- {
- sdr::PageUser* pPageUser = *aIterator;
- DBG_ASSERT(pPageUser, "SdrPage::~SdrPage: corrupt PageUser list (!)");
- pPageUser->PageInDestruction(*this);
- }
-
- // #111111#
- // Clear the vector. This means that user do not need to call RemovePageUser()
- // when they get called from PageInDestruction().
- maPageUsers.clear();
-
- delete pLayerAdmin;
+ delete mpPageLayerAdmin;
TRG_ClearMasterPage();
@@ -1412,7 +917,7 @@ SdrPage::~SdrPage()
if(mpViewContact)
{
delete mpViewContact;
- mpViewContact = 0L;
+ mpViewContact = 0;
}
{
@@ -1420,53 +925,49 @@ SdrPage::~SdrPage()
mpSdrPageProperties = 0;
}
- DBG_DTOR(SdrPage,NULL);
+ if(GetObjCount())
+ {
+ // cannot be called in SdrObjList::ClearSdrObjList() where it originally was
+ // since there it would be a pure virtual function call. Needs to be called
+ // in all destructors of classes derived from SdrObjList
+ getSdrModelFromSdrObjList().SetChanged();
+ }
}
-void SdrPage::operator=(const SdrPage& rSrcPage)
+void SdrPage::copyDataFromSdrPage(const SdrPage& rSource)
{
- if(mpViewContact)
- {
- delete mpViewContact;
- mpViewContact = 0L;
- }
-
- // Joe also sets some parameters for the class this one
- // is derived from. SdrObjList does the same bad handling of
- // copy constructor and operator=, so i better let it stand here.
- pPage = this;
-
- // copy all the local parameters to make this instance
- // a valid copy od source page before copying and inserting
- // the contained objects
- mbMaster = rSrcPage.mbMaster;
- mbSwappingLocked = rSrcPage.mbSwappingLocked;
- mbPageBorderOnlyLeftRight = rSrcPage.mbPageBorderOnlyLeftRight;
- aPrefVisiLayers = rSrcPage.aPrefVisiLayers;
- nWdt = rSrcPage.nWdt;
- nHgt = rSrcPage.nHgt;
- nBordLft = rSrcPage.nBordLft;
- nBordUpp = rSrcPage.nBordUpp;
- nBordRgt = rSrcPage.nBordRgt;
- nBordLwr = rSrcPage.nBordLwr;
- nPageNum = rSrcPage.nPageNum;
-
- if(rSrcPage.TRG_HasMasterPage())
- {
- TRG_SetMasterPage(rSrcPage.TRG_GetMasterPage());
- TRG_SetMasterPageVisibleLayers(rSrcPage.TRG_GetMasterPageVisibleLayers());
- }
- else
+ if(this != &rSource)
{
- TRG_ClearMasterPage();
- }
- //aMasters = rSrcPage.aMasters;
+ if(mpViewContact)
+ {
+ delete mpViewContact;
+ mpViewContact = 0;
+ }
- mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent;
+ // copy all the local parameters to make this instance
+ // a valid copy od source page before copying and inserting
+ // the contained objects
+ mbMaster = rSource.mbMaster;
+ mbPageBorderOnlyLeftRight = rSource.mbPageBorderOnlyLeftRight;
+ maPageScale = rSource.maPageScale;
+ mfLeftPageBorder = rSource.mfLeftPageBorder;
+ mfTopPageBorder = rSource.mfTopPageBorder;
+ mfRightPageBorder = rSource.mfRightPageBorder;
+ mfBottomPageBorder = rSource.mfBottomPageBorder;
+ mnPageNum = rSource.GetPageNumber();
+
+ if(rSource.TRG_HasMasterPage())
+ {
+ TRG_SetMasterPage(rSource.TRG_GetMasterPage());
+ TRG_SetMasterPageVisibleLayers(rSource.TRG_GetMasterPageVisibleLayers());
+ }
+ else
+ {
+ TRG_ClearMasterPage();
+ }
- {
- // #i111122# delete SdrPageProperties when model is different
- if(mpSdrPageProperties && GetModel() != rSrcPage.GetModel())
+ // delete SdrPageProperties when model is different
+ if(mpSdrPageProperties && &getSdrModelFromSdrPage() != &rSource.getSdrModelFromSdrPage())
{
delete mpSdrPageProperties;
mpSdrPageProperties = 0;
@@ -1483,111 +984,103 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
if(!IsMasterPage())
{
- mpSdrPageProperties->PutItemSet(rSrcPage.getSdrPageProperties().GetItemSet());
+ mpSdrPageProperties->PutItemSet(rSource.getSdrPageProperties().GetItemSet());
}
- mpSdrPageProperties->SetStyleSheet(rSrcPage.getSdrPageProperties().GetStyleSheet());
- }
+ mpSdrPageProperties->SetStyleSheet(rSource.getSdrPageProperties().GetStyleSheet());
- // Now copy the contained obejcts (by cloning them)
- SdrObjList::operator=(rSrcPage);
+ // Now copy the contained obejcts (by cloning them)
+ copyDataFromSdrObjList(rSource);
+ }
}
-SdrPage* SdrPage::Clone() const
+SdrPage* SdrPage::CloneSdrPage(SdrModel* pTargetModel) const
{
- return Clone(NULL);
-}
+ SdrPage* pClone = new SdrPage(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrPage(),
+ IsMasterPage());
+ OSL_ENSURE(pClone, "CloneSdrPage error (!)");
+ pClone->copyDataFromSdrPage(*this);
-SdrPage* SdrPage::Clone(SdrModel* pNewModel) const
-{
- if (pNewModel==NULL) pNewModel=pModel;
- SdrPage* pPage2=new SdrPage(*pNewModel);
- *pPage2=*this;
- return pPage2;
+ return pClone;
}
-void SdrPage::SetSize(const Size& aSiz)
+basegfx::B2DRange SdrPage::GetInnerPageRange() const
{
- bool bChanged(false);
-
- if(aSiz.Width() != nWdt)
- {
- nWdt = aSiz.Width();
- bChanged = true;
- }
-
- if(aSiz.Height() != nHgt)
- {
- nHgt = aSiz.Height();
- bChanged = true;
- }
-
- if(bChanged)
- {
- SetChanged();
- }
+ return basegfx::B2DRange(
+ mfLeftPageBorder,
+ mfTopPageBorder,
+ maPageScale.getX() - mfRightPageBorder,
+ maPageScale.getY() - mfBottomPageBorder);
}
-Size SdrPage::GetSize() const
+basegfx::B2DVector SdrPage::GetInnerPageScale() const
{
- return Size(nWdt,nHgt);
+ return basegfx::B2DVector(
+ maPageScale.getX() - (mfLeftPageBorder + mfRightPageBorder),
+ maPageScale.getY() - (mfTopPageBorder + mfBottomPageBorder));
}
-sal_Int32 SdrPage::GetWdt() const
+void SdrPage::SetPageScale(const basegfx::B2DVector& aNewScale)
{
- return nWdt;
+ if(!aNewScale.equal(maPageScale))
+ {
+ maPageScale = aNewScale;
+ SetChanged();
+ }
}
void SdrPage::SetOrientation(Orientation eOri)
{
- // Quadratisch ist und bleibt immer Portrait
- Size aSiz(GetSize());
- if (aSiz.Width()!=aSiz.Height()) {
- if ((eOri==ORIENTATION_PORTRAIT) == (aSiz.Width()>aSiz.Height())) {
- SetSize(Size(aSiz.Height(),aSiz.Width()));
+ const basegfx::B2DVector aOldPageScale(GetPageScale());
+
+ if(!basegfx::fTools::equal(aOldPageScale.getX(), aOldPageScale.getY()))
+ {
+ if((ORIENTATION_PORTRAIT == eOri) == (aOldPageScale.getX() > aOldPageScale.getY()))
+ {
+ SetPageScale(basegfx::B2DVector(aOldPageScale.getY(), aOldPageScale.getX()));
}
}
}
Orientation SdrPage::GetOrientation() const
{
- // Quadratisch ist Portrait
- Orientation eRet=ORIENTATION_PORTRAIT;
- Size aSiz(GetSize());
- if (aSiz.Width()>aSiz.Height()) eRet=ORIENTATION_LANDSCAPE;
- return eRet;
-}
+ Orientation eRet(ORIENTATION_PORTRAIT);
+ const basegfx::B2DVector& rPageScale(GetPageScale());
-sal_Int32 SdrPage::GetHgt() const
-{
- return nHgt;
+ if(rPageScale.getX() > rPageScale.getY())
+ {
+ eRet = ORIENTATION_LANDSCAPE;
+ }
+
+ return eRet;
}
-void SdrPage::SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 nLwr)
+void SdrPage::SetPageBorder(double fLeft, double fTop, double fRight, double fBottom)
{
bool bChanged(false);
- if(nBordLft != nLft)
+ if(mfLeftPageBorder != fLeft)
{
- nBordLft = nLft;
+ mfLeftPageBorder = fLeft;
bChanged = true;
}
- if(nBordUpp != nUpp)
+ if(mfTopPageBorder != fTop)
{
- nBordUpp = nUpp;
+ mfTopPageBorder = fTop;
bChanged = true;
}
- if(nBordRgt != nRgt)
+ if(mfRightPageBorder != fRight)
{
- nBordRgt = nRgt;
+ mfRightPageBorder = fRight;
bChanged = true;
}
- if(nBordLwr != nLwr)
+ if(mfBottomPageBorder != fBottom)
{
- nBordLwr = nLwr;
+ mfBottomPageBorder = fBottom;
bChanged = true;
}
@@ -1597,163 +1090,126 @@ void SdrPage::SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int
}
}
-void SdrPage::SetLftBorder(sal_Int32 nBorder)
+void SdrPage::SetLeftPageBorder(double fBorder)
{
- if(nBordLft != nBorder)
+ if(mfLeftPageBorder != fBorder)
{
- nBordLft = nBorder;
+ mfLeftPageBorder = fBorder;
SetChanged();
}
}
-void SdrPage::SetUppBorder(sal_Int32 nBorder)
+void SdrPage::SetTopPageBorder(double fBorder)
{
- if(nBordUpp != nBorder)
+ if(mfTopPageBorder != fBorder)
{
- nBordUpp = nBorder;
+ mfTopPageBorder = fBorder;
SetChanged();
}
}
-void SdrPage::SetRgtBorder(sal_Int32 nBorder)
+void SdrPage::SetRightPageBorder(double fBorder)
{
- if(nBordRgt != nBorder)
+ if(mfRightPageBorder != fBorder)
{
- nBordRgt=nBorder;
+ mfRightPageBorder = fBorder;
SetChanged();
}
}
-void SdrPage::SetLwrBorder(sal_Int32 nBorder)
+void SdrPage::SetBottomPageBorder(double fBorder)
{
- if(nBordLwr != nBorder)
+ if(mfBottomPageBorder != fBorder)
{
- nBordLwr=nBorder;
+ mfBottomPageBorder = fBorder;
SetChanged();
}
}
-sal_Int32 SdrPage::GetLftBorder() const
+double SdrPage::GetLeftPageBorder() const
{
- return nBordLft;
+ return mfLeftPageBorder;
}
-sal_Int32 SdrPage::GetUppBorder() const
+double SdrPage::GetTopPageBorder() const
{
- return nBordUpp;
+ return mfTopPageBorder;
}
-sal_Int32 SdrPage::GetRgtBorder() const
+double SdrPage::GetRightPageBorder() const
{
- return nBordRgt;
+ return mfRightPageBorder;
}
-sal_Int32 SdrPage::GetLwrBorder() const
+double SdrPage::GetBottomPageBorder() const
{
- return nBordLwr;
+ return mfBottomPageBorder;
}
-void SdrPage::SetModel(SdrModel* pNewModel)
+SdrModel& SdrPage::getSdrModelFromSdrObjList() const
{
- SdrModel* pOldModel=pModel;
- SdrObjList::SetModel(pNewModel);
- if (pNewModel!=pOldModel)
- {
- if (pNewModel!=NULL) {
- pLayerAdmin->SetParent(&pNewModel->GetLayerAdmin());
- } else {
- pLayerAdmin->SetParent(NULL);
- }
- pLayerAdmin->SetModel(pNewModel);
-
- // create new SdrPageProperties with new model (due to SfxItemSet there)
- // and copy ItemSet and StyleSheet
- SdrPageProperties *pNew = new SdrPageProperties(*this);
-
- if(!IsMasterPage())
- {
- pNew->PutItemSet(getSdrPageProperties().GetItemSet());
- }
-
- pNew->SetStyleSheet(getSdrPageProperties().GetStyleSheet());
-
- delete mpSdrPageProperties;
- mpSdrPageProperties = pNew;
- }
-
- // update listeners at possible api wrapper object
- if( pOldModel != pNewModel )
- {
- if( mxUnoPage.is() )
- {
- SvxDrawPage* pPage2 = SvxDrawPage::getImplementation( mxUnoPage );
- if( pPage2 )
- pPage2->ChangeModel( pNewModel );
- }
- }
+ return getSdrModelFromSdrPage();
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-// #i68775# React on PageNum changes (from Model in most cases)
-void SdrPage::SetPageNum(sal_uInt16 nNew)
+// only called from SetPageNumberAtSdrPageFromSdrModel (see svdmodel.cxx)
+void SdrPage::SetPageNumber(sal_uInt32 nNew)
{
- if(nNew != nPageNum)
+ if(nNew != GetPageNumber())
{
// change
- nPageNum = nNew;
+ mnPageNum = nNew;
// notify visualisations, also notifies e.g. buffered MasterPages
ActionChanged();
}
}
-sal_uInt16 SdrPage::GetPageNum() const
+void SdrPage::SetInserted(bool bInserted)
{
- if (!mbInserted)
- return 0;
+ if(bInserted != IsInserted())
+ {
+ mbInserted = bInserted;
- if (mbMaster) {
- if (pModel && pModel->IsMPgNumsDirty())
- ((SdrModel*)pModel)->RecalcPageNums(sal_True);
- } else {
- if (pModel && pModel->IsPagNumsDirty())
- ((SdrModel*)pModel)->RecalcPageNums(sal_False);
+ // TTTT: Check if the original's travel over OLEs and setting them to connect/disconnect is needed or moved elsewhere
}
- return nPageNum;
}
-void SdrPage::SetChanged()
+sal_uInt32 SdrPage::GetPageNumber() const
{
- // #110094#-11
- // For test purposes, use the new ViewContact for change
- // notification now.
- ActionChanged();
-
- if( pModel )
+ if(!IsInserted())
{
- pModel->SetChanged();
+ return 0;
}
+
+ return mnPageNum;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// MasterPage interface
+void SdrPage::SetChanged()
+{
+ ActionChanged();
+ getSdrModelFromSdrPage().SetChanged();
+}
void SdrPage::TRG_SetMasterPage(SdrPage& rNew)
{
- if(mpMasterPageDescriptor && &(mpMasterPageDescriptor->GetUsedPage()) == &rNew)
+ if(TRG_HasMasterPage() && &(mpMasterPageDescriptor->GetUsedPage()) == &rNew)
+ {
return;
+ }
- if(mpMasterPageDescriptor)
+ if(TRG_HasMasterPage())
+ {
TRG_ClearMasterPage();
+ }
mpMasterPageDescriptor = new ::sdr::MasterPageDescriptor(*this, rNew);
+
GetViewContact().ActionChanged();
}
void SdrPage::TRG_ClearMasterPage()
{
- if(mpMasterPageDescriptor)
+ if(TRG_HasMasterPage())
{
SetChanged();
@@ -1761,36 +1217,35 @@ void SdrPage::TRG_ClearMasterPage()
mpMasterPageDescriptor->GetUsedPage().GetViewContact().flushViewObjectContacts(true);
delete mpMasterPageDescriptor;
- mpMasterPageDescriptor = 0L;
+ mpMasterPageDescriptor = 0;
}
}
SdrPage& SdrPage::TRG_GetMasterPage() const
{
- DBG_ASSERT(mpMasterPageDescriptor != 0L, "TRG_GetMasterPage(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
+ OSL_ENSURE(TRG_HasMasterPage(), "TRG_GetMasterPage(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
return mpMasterPageDescriptor->GetUsedPage();
}
const SetOfByte& SdrPage::TRG_GetMasterPageVisibleLayers() const
{
- DBG_ASSERT(mpMasterPageDescriptor != 0L, "TRG_GetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
+ OSL_ENSURE(TRG_HasMasterPage(), "TRG_GetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
return mpMasterPageDescriptor->GetVisibleLayers();
}
void SdrPage::TRG_SetMasterPageVisibleLayers(const SetOfByte& rNew)
{
- DBG_ASSERT(mpMasterPageDescriptor != 0L, "TRG_SetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
+ OSL_ENSURE(TRG_HasMasterPage(), "TRG_SetMasterPageVisibleLayers(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
mpMasterPageDescriptor->SetVisibleLayers(rNew);
}
sdr::contact::ViewContact& SdrPage::TRG_GetMasterPageDescriptorViewContact() const
{
- DBG_ASSERT(mpMasterPageDescriptor != 0L, "TRG_GetMasterPageDescriptorViewContact(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
+ OSL_ENSURE(TRG_HasMasterPage(), "TRG_GetMasterPageDescriptorViewContact(): No MasterPage available. Use TRG_HasMasterPage() before access (!)");
return mpMasterPageDescriptor->GetViewContact();
}
-// #115423# used from SdrModel::RemoveMasterPage
-void SdrPage::TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage)
+void SdrPage::TRG_MasterPageRemoved(const SdrPage& rRemovedPage)
{
if(TRG_HasMasterPage())
{
@@ -1801,41 +1256,16 @@ void SdrPage::TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage)
}
}
-const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrPageView* /*pPV*/, const Rectangle* /*pRect*/) const
+const SdrPageGridFrameList* SdrPage::GetGridFrameList(const SdrView& /*rSdrView*/, const Rectangle* /*pRect*/) const
{
- return NULL;
+ return 0;
}
XubString SdrPage::GetLayoutName() const
{
- // Die wollte Dieter haben.
return String();
}
-void SdrPage::SetInserted( bool bIns )
-{
- if( mbInserted != bIns )
- {
- mbInserted = bIns;
-
- // #120437# go over whole hierarchy, not only over object level null (seen from grouping)
- SdrObjListIter aIter(*this, IM_DEEPNOGROUPS);
-
- while ( aIter.IsMore() )
- {
- SdrObject* pObj = aIter.Next();
- if ( pObj->ISA(SdrOle2Obj) )
- {
- if( mbInserted )
- ( (SdrOle2Obj*) pObj)->Connect();
- else
- ( (SdrOle2Obj*) pObj)->Disconnect();
- }
- }
- }
-}
-
-
uno::Reference< uno::XInterface > SdrPage::getUnoPage()
{
// try weak reference first
@@ -1850,8 +1280,18 @@ uno::Reference< uno::XInterface > SdrPage::getUnoPage()
uno::Reference< uno::XInterface > SdrPage::createUnoPage()
{
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInt =
- static_cast<cppu::OWeakObject*>( new SvxFmDrawPage( this ) );
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInt;
+
+ if(dynamic_cast< FmFormModel* >(&getSdrModelFromSdrPage()))
+ {
+ // when no model be careful and construct a SvxFmDrawPage
+ xInt = static_cast<cppu::OWeakObject*>( new SvxFmDrawPage( this ) );
+ }
+ else
+ {
+ xInt = static_cast<cppu::OWeakObject*>( new SvxDrawPage( this ) );
+ }
+
return xInt;
}
@@ -1860,17 +1300,6 @@ SfxStyleSheet* SdrPage::GetTextStyleSheetForObject( SdrObject* pObj ) const
return pObj->GetStyleSheet();
}
-FASTBOOL SdrPage::HasTransparentObjects( sal_Bool bCheckForAlphaChannel ) const
-{
- FASTBOOL bRet = sal_False;
-
- for( sal_uIntPtr n = 0, nCount = GetObjCount(); ( n < nCount ) && !bRet; n++ )
- if( GetObj( n )->IsTransparent( bCheckForAlphaChannel ) )
- bRet = sal_True;
-
- return bRet;
-}
-
/** returns an averaged background color of this page */
// #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value
Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay ) const
@@ -1902,13 +1331,6 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay )
return aColor;
}
-/** *deprecated, use GetBackgroundColor with SdrPageView */
-Color SdrPage::GetPageBackgroundColor() const
-// #i75566# GetBackgroundColor -> GetPageBackgroundColor
-{
- return GetPageBackgroundColor( NULL, true );
-}
-
/** this method returns true if the object from the ViewObjectContact should
be visible on this page while rendering.
bEdit selects if visibility test is for an editing view or a final render,
@@ -1936,26 +1358,21 @@ void SdrPage::ActionChanged() const
}
}
-// NYI: Dummy implementations for declarations in svdpage.hxx
-Bitmap SdrPage::GetBitmap(const SetOfByte& /*rVisibleLayers*/, FASTBOOL /*bTrimBorders*/) const
+SdrPage* SdrPage::getSdrPageFromSdrObjList() const
{
- DBG_ASSERT(0, "SdrPage::GetBitmap(): not yet implemented.");
- return Bitmap();
-}
-GDIMetaFile SdrPage::GetMetaFile(const SetOfByte& /*rVisibleLayers*/, FASTBOOL /*bTrimBorders*/)
-{
- DBG_ASSERT(0, "SdrPage::GetMetaFile(): not yet implemented.");
- return GDIMetaFile();
+ return const_cast< SdrPage* >(this);
}
bool SdrPage::isHandoutMasterPage() const
{
- return mbMaster && GetModel() && GetModel()->GetMasterPageCount()
- && GetModel()->GetMasterPage(0) == this;
-}
+ if(IsMasterPage())
+ {
+ return getSdrModelFromSdrPage().GetMasterPageCount()
+ && getSdrModelFromSdrPage().GetMasterPage(0) == this;
+ }
-//////////////////////////////////////////////////////////////////////////////
-// sdr::Comment interface
+ return false;
+}
const sdr::Comment& SdrPage::GetCommentByIndex(sal_uInt32 nIndex)
{
@@ -1993,7 +1410,6 @@ const SdrPageProperties* SdrPage::getCorrectSdrPageProperties() const
}
//////////////////////////////////////////////////////////////////////////////
-// use new redirector instead of pPaintProc
StandardCheckVisisbilityRedirector::StandardCheckVisisbilityRedirector()
: ViewObjectContactRedirector()
@@ -2012,9 +1428,11 @@ drawinglayer::primitive2d::Primitive2DSequence StandardCheckVisisbilityRedirecto
if(pObject)
{
- if(pObject->GetPage())
+ SdrPage* pOwningSdrPage = pObject->getSdrPageFromSdrObject();
+
+ if(pOwningSdrPage)
{
- if(pObject->GetPage()->checkVisibility(rOriginal, rDisplayInfo, false))
+ if(pOwningSdrPage->checkVisibility(rOriginal, rDisplayInfo, false))
{
return ::sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(rOriginal, rDisplayInfo);
}
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index bed1cf507e0b..7fe0a827ba26 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -23,6 +23,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
+
#include <svx/svdpagv.hxx>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -32,7 +33,6 @@
#include <svx/svdouno.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdview.hxx>
-
#include <svx/svdedxv.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdoutl.hxx>
@@ -43,30 +43,23 @@
#include <svx/svdouno.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdview.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdtypes.hxx>
#include <svx/svdoole2.hxx>
-
-// #110094#
#include <svx/sdr/contact/objectcontactofpageview.hxx>
#include <svx/svdogrp.hxx>
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
#include <svx/fmview.hxx>
-
-// for search on vector
+#include <svx/sdrpagewindow.hxx>
+#include <svx/sdrpaintwindow.hxx>
+#include <svx/svdlegacy.hxx>
#include <algorithm>
using namespace ::rtl;
using namespace ::com::sun::star;
-#include <svx/sdrpagewindow.hxx>
-#include <svx/sdrpaintwindow.hxx>
-
-TYPEINIT1(SdrPageView, SfxListener);
-DBG_NAME(SdrPageView);
////////////////////////////////////////////////////////////////////////////////////////////////////
-// interface to SdrPageWindow
SdrPageWindow* SdrPageView::FindPageWindow(SdrPaintWindow& rPaintWindow) const
{
@@ -78,25 +71,23 @@ SdrPageWindow* SdrPageView::FindPageWindow(SdrPaintWindow& rPaintWindow) const
}
}
- return 0L;
+ return 0;
}
const SdrPageWindow* SdrPageView::FindPatchedPageWindow( const OutputDevice& _rOutDev ) const
{
- for ( SdrPageWindowVector::const_iterator loop = maPageWindows.begin();
- loop != maPageWindows.end();
- ++loop
- )
+ for(SdrPageWindowVector::const_iterator loop = maPageWindows.begin(); loop != maPageWindows.end(); ++loop)
{
const SdrPageWindow& rPageWindow( *(*loop) );
const SdrPaintWindow& rPaintWindow( rPageWindow.GetOriginalPaintWindow() ? *rPageWindow.GetOriginalPaintWindow() : rPageWindow.GetPaintWindow() );
+
if ( &rPaintWindow.GetOutputDevice() == &_rOutDev )
{
return &rPageWindow;
}
}
- return NULL;
+ return 0;
}
SdrPageWindow* SdrPageView::FindPageWindow(const OutputDevice& rOutDev) const
@@ -109,23 +100,21 @@ SdrPageWindow* SdrPageView::FindPageWindow(const OutputDevice& rOutDev) const
}
}
- return 0L;
+ return 0;
}
SdrPageWindow* SdrPageView::GetPageWindow(sal_uInt32 nIndex) const
{
- // #126416#
if(nIndex < maPageWindows.size())
{
return maPageWindows[nIndex];
}
- return 0L;
+ return 0;
}
void SdrPageView::ClearPageWindows()
{
- // #126416#
for(SdrPageWindowVector::const_iterator a = maPageWindows.begin(); a != maPageWindows.end(); a++)
{
delete *a;
@@ -141,62 +130,62 @@ void SdrPageView::AppendPageWindow(SdrPageWindow& rNew)
SdrPageWindow* SdrPageView::RemovePageWindow(sal_uInt32 nPos)
{
+ SdrPageWindow* pRetval = 0;
+
if(nPos < maPageWindows.size())
{
- SdrPageWindowVector::iterator aAccess = maPageWindows.begin() + nPos;
- // #114376# remember return value
- SdrPageWindow* pErasedSdrPageWindow = *aAccess;
- maPageWindows.erase(aAccess);
- return pErasedSdrPageWindow;
+ const SdrPageWindowVector::iterator aCandidate(maPageWindows.begin() + nPos);
+
+ pRetval = *aCandidate;
+ maPageWindows.erase(aCandidate);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrPageView::RemovePageWindow with wrong index (!)");
}
- return 0L;
+ return 0;
}
SdrPageWindow* SdrPageView::RemovePageWindow(SdrPageWindow& rOld)
{
const SdrPageWindowVector::iterator aFindResult = ::std::find(maPageWindows.begin(), maPageWindows.end(), &rOld);
+ SdrPageWindow* pRetval = 0;
if(aFindResult != maPageWindows.end())
{
- // #114376# remember return value
- SdrPageWindow* pSdrPageWindow = *aFindResult;
+ pRetval = *aFindResult;
maPageWindows.erase(aFindResult);
- return pSdrPageWindow;
}
- return 0L;
+ return pRetval;
}
-//////////////////////////////////////////////////////////////////////////////
-
-SdrPageView::SdrPageView(SdrPage* pPage1, SdrView& rNewView)
+SdrPageView::SdrPageView(SdrPage& rSdrPageOfSdrPageView, SdrView& rNewView)
: mrView(rNewView),
- // #103911# col_auto color lets the view takes the default SvxColorConfig entry
- maDocumentColor( COL_AUTO ),
+ mrSdrPageOfSdrPageView(rSdrPageOfSdrPageView),
+ maPageOrigin(0.0, 0.0),
+ maVisibleLayerSet(),
+ maLockedLayerSet(),
+ maPrintableLayerSet(),
+ mpCurrentList(0),
+ mpCurrentGroup(0),
+ maHelpLines(),
+ maDocumentColor( COL_AUTO ), // #103911# col_auto color lets the view takes the default SvxColorConfig entry
maBackgroundColor(COL_AUTO ), // #i48367# also react on autocolor
- mpPreparedPageWindow(0) // #i72752#
+ maPageWindows(),
+ mpPreparedPageWindow(0), // #i72752#
+ mbVisible(false)
{
- DBG_CTOR(SdrPageView,NULL);
- mpPage = pPage1;
-
- if(mpPage)
- {
- aPgOrg.X()=mpPage->GetLftBorder();
- aPgOrg.Y()=mpPage->GetUppBorder();
- }
- mbHasMarked = sal_False;
- aLayerVisi.SetAll();
- aLayerPrn.SetAll();
+ maPageOrigin.setX(mrSdrPageOfSdrPageView.GetLeftPageBorder());
+ maPageOrigin.setY(mrSdrPageOfSdrPageView.GetTopPageBorder());
- mbVisible = sal_False;
- pAktList = NULL;
- pAktGroup = NULL;
- SetAktGroupAndList(NULL, mpPage);
+ maVisibleLayerSet.SetAll();
+ maPrintableLayerSet.SetAll();
- StartListening(*rNewView.GetModel());
+ SetCurrentGroupAndObjectList(0, &mrSdrPageOfSdrPageView);
- for(sal_uInt32 a(0L); a < rNewView.PaintWindowCount(); a++)
+ for(sal_uInt32 a(0); a < rNewView.PaintWindowCount(); a++)
{
AddPaintWindowToPageView(*rNewView.GetPaintWindow(a));
}
@@ -204,18 +193,12 @@ SdrPageView::SdrPageView(SdrPage* pPage1, SdrView& rNewView)
SdrPageView::~SdrPageView()
{
- DBG_DTOR(SdrPageView,NULL);
-
// cleanup window vector
ClearPageWindows();
}
SdrPageWindow& SdrPageView::CreateNewPageWindowEntry(SdrPaintWindow& rPaintWindow)
{
- // MIB 3.7.08: Das WinRec muss sofort in die Liste eingetragen werden,
- // weil sich das InsertControlContainer darauf verlaesst
- //SdrPageViewWinRec* pRec = new SdrPageViewWinRec( *this, pOut );
- //pWinList->Insert(pRec);
SdrPageWindow& rWindow = *(new SdrPageWindow(*this, rPaintWindow));
AppendPageWindow(rWindow);
@@ -256,29 +239,27 @@ void SdrPageView::RemovePaintWindowFromPageView(SdrPaintWindow& rPaintWindow)
return xReturn;
}
-void __EXPORT SdrPageView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& /*rHint*/)
-{
- // not really interested in
-}
-
-void SdrPageView::ModelHasChanged()
+void SdrPageView::LazyReactOnObjectChanges()
{
- if (GetAktGroup()!=NULL) CheckAktGroup();
+ if(GetCurrentGroup())
+ {
+ CheckAktGroup();
+ }
}
-sal_Bool SdrPageView::IsReadOnly() const
+bool SdrPageView::IsReadOnly() const
{
- return (0L == GetPage() || GetView().GetModel()->IsReadOnly() || GetPage()->IsReadOnly() || GetObjList()->IsReadOnly());
+ return GetView().getSdrModelFromSdrView().IsReadOnly();
}
void SdrPageView::Show()
{
if(!IsVisible())
{
- mbVisible = sal_True;
+ mbVisible = true;
InvalidateAllWin();
- for(sal_uInt32 a(0L); a < GetView().PaintWindowCount(); a++)
+ for(sal_uInt32 a(0); a < GetView().PaintWindowCount(); a++)
{
AddPaintWindowToPageView(*GetView().GetPaintWindow(a));
}
@@ -290,32 +271,37 @@ void SdrPageView::Hide()
if(IsVisible())
{
InvalidateAllWin();
- mbVisible = sal_False;
+ mbVisible = false;
ClearPageWindows();
}
}
-Rectangle SdrPageView::GetPageRect() const
+basegfx::B2DRange SdrPageView::GetPageRange() const
{
- if (GetPage()==NULL) return Rectangle();
- return Rectangle(Point(),Size(GetPage()->GetWdt()+1,GetPage()->GetHgt()+1));
+ basegfx::B2DRange aRetval;
+
+ aRetval.expand(basegfx::B2DPoint(0.0, 0.0));
+ aRetval.expand(getSdrPageFromSdrPageView().GetPageScale());
+
+ return aRetval;
}
void SdrPageView::InvalidateAllWin()
{
- if(IsVisible() && GetPage())
+ if(IsVisible())
{
- Rectangle aRect(Point(0,0),Size(GetPage()->GetWdt()+1,GetPage()->GetHgt()+1));
- aRect.Union(GetPage()->GetAllObjBoundRect());
- GetView().InvalidateAllWin(aRect);
+ basegfx::B2DRange aAllRange(GetPageRange());
+
+ aAllRange.expand(sdr::legacy::GetAllObjBoundRange(getSdrPageFromSdrPageView().getSdrObjectVector()));
+ GetView().InvalidateAllWin(aAllRange);
}
}
-void SdrPageView::InvalidateAllWin(const Rectangle& rRect, sal_Bool bPlus1Pix)
+void SdrPageView::InvalidateAllWin(const basegfx::B2DRange& rRange, bool bPlus1Pix)
{
if(IsVisible())
{
- GetView().InvalidateAllWin(rRect, bPlus1Pix);
+ GetView().InvalidateAllWin(rRange, bPlus1Pix);
}
}
@@ -353,28 +339,25 @@ void SdrPageView::PostPaint()
void SdrPageView::CompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector) const
{
- if(GetPage())
- {
- SdrPageWindow* pPageWindow = FindPageWindow(rPaintWindow);
- sal_Bool bIsTempTarget(sal_False);
+ SdrPageWindow* pPageWindow = FindPageWindow(rPaintWindow);
+ bool bIsTempTarget(false);
- if(!pPageWindow)
- {
- // create temp PageWindow
- pPageWindow = new SdrPageWindow(*((SdrPageView*)this), rPaintWindow);
- bIsTempTarget = sal_True;
- }
+ if(!pPageWindow)
+ {
+ // create temp PageWindow
+ pPageWindow = new SdrPageWindow(*((SdrPageView*)this), rPaintWindow);
+ bIsTempTarget = true;
+ }
- // do the redraw
- pPageWindow->PrepareRedraw(rReg);
- pPageWindow->RedrawAll(pRedirector);
+ // do the redraw
+ pPageWindow->PrepareRedraw(rReg);
+ pPageWindow->RedrawAll(pRedirector);
- // get rid of temp PageWindow
- if(bIsTempTarget)
- {
- delete pPageWindow;
- pPageWindow = 0L;
- }
+ // get rid of temp PageWindow
+ if(bIsTempTarget)
+ {
+ delete pPageWindow;
+ pPageWindow = 0L;
}
}
@@ -389,104 +372,94 @@ void SdrPageView::setPreparedPageWindow(SdrPageWindow* pKnownTarget)
void SdrPageView::DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector) const
{
- if(GetPage())
+ if(pGivenTarget)
{
- if(pGivenTarget)
+ const SdrPageWindow* pKnownTarget = FindPageWindow(*pGivenTarget);
+
+ if(pKnownTarget)
+ {
+ // paint known target
+ pKnownTarget->RedrawLayer(&nID, pRedirector);
+ }
+ else
{
- const SdrPageWindow* pKnownTarget = FindPageWindow(*pGivenTarget);
+ // #i72752# DrawLayer() uses a OutputDevice different from BeginDrawLayer. This happens
+ // e.g. when SW paints a single text line in text edit mode. Try to use it
+ SdrPageWindow* pPreparedTarget = mpPreparedPageWindow;
- if(pKnownTarget)
+ if(pPreparedTarget)
{
- // paint known target
- pKnownTarget->RedrawLayer(&nID, pRedirector);
+ // if we have a prepared target, do not use a new SdrPageWindow since this
+ // works but is expensive. Just use a temporary PaintWindow
+ SdrPaintWindow aTemporaryPaintWindow(mrView, *pGivenTarget);
+
+ // Copy existing paint region to use the same as prepared in BeginDrawLayer
+ SdrPaintWindow& rExistingPaintWindow = pPreparedTarget->GetPaintWindow();
+ const Region& rExistingRegion = rExistingPaintWindow.GetRedrawRegion();
+ aTemporaryPaintWindow.SetRedrawRegion(rExistingRegion);
+
+ // patch the ExistingPageWindow
+ pPreparedTarget->patchPaintWindow(aTemporaryPaintWindow);
+
+ // redraw the layer
+ pPreparedTarget->RedrawLayer(&nID, pRedirector);
+
+ // restore the ExistingPageWindow
+ pPreparedTarget->unpatchPaintWindow();
}
else
{
- // #i72752# DrawLayer() uses a OutputDevice different from BeginDrawLayer. This happens
- // e.g. when SW paints a single text line in text edit mode. Try to use it
- SdrPageWindow* pPreparedTarget = mpPreparedPageWindow;
-
- if(pPreparedTarget)
+ OSL_ENSURE(false, "SdrPageView::DrawLayer: Creating temporary SdrPageWindow (ObjectContact), this should never be needed (!)");
+
+ // None of the known OutputDevices is the target of this paint, use
+ // a temporary SdrPageWindow for this Redraw.
+ SdrPaintWindow aTemporaryPaintWindow(mrView, *pGivenTarget);
+ SdrPageWindow aTemporaryPageWindow(*((SdrPageView*)this), aTemporaryPaintWindow);
+
+ // #i72752#
+ // Copy existing paint region if other PageWindows exist, this was created by
+ // PrepareRedraw() from BeginDrawLayer(). Needs to be used e.g. when suddenly SW
+ // paints into an unknown device other than the view was created for (e.g. VirtualDevice)
+ if(PageWindowCount())
{
- // if we have a prepared target, do not use a new SdrPageWindow since this
- // works but is expensive. Just use a temporary PaintWindow
- SdrPaintWindow aTemporaryPaintWindow(mrView, *pGivenTarget);
-
- // Copy existing paint region to use the same as prepared in BeginDrawLayer
- SdrPaintWindow& rExistingPaintWindow = pPreparedTarget->GetPaintWindow();
+ SdrPageWindow* pExistingPageWindow = GetPageWindow(0L);
+ SdrPaintWindow& rExistingPaintWindow = pExistingPageWindow->GetPaintWindow();
const Region& rExistingRegion = rExistingPaintWindow.GetRedrawRegion();
aTemporaryPaintWindow.SetRedrawRegion(rExistingRegion);
-
- // patch the ExistingPageWindow
- pPreparedTarget->patchPaintWindow(aTemporaryPaintWindow);
-
- // redraw the layer
- pPreparedTarget->RedrawLayer(&nID, pRedirector);
-
- // restore the ExistingPageWindow
- pPreparedTarget->unpatchPaintWindow();
}
- else
- {
- OSL_ENSURE(false, "SdrPageView::DrawLayer: Creating temporary SdrPageWindow (ObjectContact), this should never be needed (!)");
-
- // None of the known OutputDevices is the target of this paint, use
- // a temporary SdrPageWindow for this Redraw.
- SdrPaintWindow aTemporaryPaintWindow(mrView, *pGivenTarget);
- SdrPageWindow aTemporaryPageWindow(*((SdrPageView*)this), aTemporaryPaintWindow);
-
- // #i72752#
- // Copy existing paint region if other PageWindows exist, this was created by
- // PrepareRedraw() from BeginDrawLayer(). Needs to be used e.g. when suddenly SW
- // paints into an unknown device other than the view was created for (e.g. VirtualDevice)
- if(PageWindowCount())
- {
- SdrPageWindow* pExistingPageWindow = GetPageWindow(0L);
- SdrPaintWindow& rExistingPaintWindow = pExistingPageWindow->GetPaintWindow();
- const Region& rExistingRegion = rExistingPaintWindow.GetRedrawRegion();
- aTemporaryPaintWindow.SetRedrawRegion(rExistingRegion);
- }
- aTemporaryPageWindow.RedrawLayer(&nID, pRedirector);
- }
+ aTemporaryPageWindow.RedrawLayer(&nID, pRedirector);
}
}
- else
+ }
+ else
+ {
+ // paint in all known windows
+ for(sal_uInt32 a(0L); a < PageWindowCount(); a++)
{
- // paint in all known windows
- for(sal_uInt32 a(0L); a < PageWindowCount(); a++)
- {
- SdrPageWindow* pTarget = GetPageWindow(a);
- pTarget->RedrawLayer(&nID, pRedirector);
- }
+ SdrPageWindow* pTarget = GetPageWindow(a);
+ pTarget->RedrawLayer(&nID, pRedirector);
}
}
}
-void SdrPageView::SetDesignMode( bool _bDesignMode ) const
+void SdrPageView::SetDesignMode( bool _bDesignMode )
{
for ( sal_uInt32 i = 0L; i < PageWindowCount(); ++i )
{
- const SdrPageWindow& rPageViewWindow = *GetPageWindow(i);
+ SdrPageWindow& rPageViewWindow = *GetPageWindow(i);
rPageViewWindow.SetDesignMode( _bDesignMode );
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef OS2
-#define RGBCOLOR(r,g,b) ((sal_uIntPtr)(((sal_uInt8)(b) | ((sal_uInt16)(g)<<8)) | (((sal_uIntPtr)(sal_uInt8)(r))<<16)))
-#endif
-
-void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, Color aColor)
+void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const basegfx::B2DRange& rRange, Color aColor)
{
- if (GetPage()==NULL)
- return;
-
- long nx1=GetView().aGridBig.Width();
- long nx2=GetView().aGridFin.Width();
- long ny1=GetView().aGridBig.Height();
- long ny2=GetView().aGridFin.Height();
+ long nx1=GetView().GetGridCoarse().Width();
+ long nx2=GetView().GetGridFine().Width();
+ long ny1=GetView().GetGridCoarse().Height();
+ long ny2=GetView().GetGridFine().Height();
if (nx1==0) nx1=nx2;
if (nx2==0) nx2=nx1;
@@ -528,8 +501,8 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, C
Size aMinDotDist(rOut.PixelToLogic(Size(nMinDotPix,nMinDotPix)));
//Size a3PixSiz(rOut.PixelToLogic(Size(2,2)));
Size aMinLinDist(rOut.PixelToLogic(Size(nMinLinPix,nMinLinPix)));
- FASTBOOL bHoriSolid=nx2<aMinDotDist.Width();
- FASTBOOL bVertSolid=ny2<aMinDotDist.Height();
+ bool bHoriSolid=nx2<aMinDotDist.Width();
+ bool bVertSolid=ny2<aMinDotDist.Height();
// Linienabstand vergroessern (mind. 4 Pixel)
// Vergroesserung: *2 *5 *10 *20 *50 *100 ...
int nTgl=0;
@@ -564,62 +537,73 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, C
//if (nx2<a2PixSiz.Width()) nx2=nx1;
//if (ny2<a2PixSiz.Height()) ny2=ny1;
- FASTBOOL bHoriFine=nx2<nx1;
- FASTBOOL bVertFine=ny2<ny1;
- FASTBOOL bHoriLines=bHoriSolid || bHoriFine || !bVertFine;
- FASTBOOL bVertLines=bVertSolid || bVertFine;
+ bool bHoriFine=nx2<nx1;
+ bool bVertFine=ny2<ny1;
+ bool bHoriLines=bHoriSolid || bHoriFine || !bVertFine;
+ bool bVertLines=bVertSolid || bVertFine;
Color aColorMerk( rOut.GetLineColor() );
rOut.SetLineColor( aColor );
bool bMap0=rOut.IsMapModeEnabled();
- long nWrX=0;//aWriterPageOffset.X();
- long nWrY=0;//aWriterPageOffset.Y();
- Point aOrg(aPgOrg);
- long x1=GetPage()->GetLftBorder()+1+nWrX;
- long x2=GetPage()->GetWdt()-GetPage()->GetRgtBorder()-1+nWrY;
- long y1=GetPage()->GetUppBorder()+1+nWrX;
- long y2=GetPage()->GetHgt()-GetPage()->GetLwrBorder()-1+nWrY;
- const SdrPageGridFrameList* pFrames=GetPage()->GetGridFrameList(this,NULL);
- //sal_uInt16 nBufSiz=1024; // 4k Buffer = max. 512 Punkte
- // #90353# long* pBuf = NULL;
- sal_uInt16 nGridPaintAnz=1;
- if (pFrames!=NULL) nGridPaintAnz=pFrames->GetCount();
- for (sal_uInt16 nGridPaintNum=0; nGridPaintNum<nGridPaintAnz; nGridPaintNum++) {
- if (pFrames!=NULL) {
+ double fWrX(0.0);
+ double fWrY(0.0);
+ basegfx::B2DPoint aOrg(maPageOrigin);
+ const basegfx::B2DRange& rInnerPageRange(getSdrPageFromSdrPageView().GetInnerPageRange());
+ double x1(rInnerPageRange.getMinX());
+ double x2(rInnerPageRange.getMaxX());
+ double y1(rInnerPageRange.getMinY());
+ double y2(rInnerPageRange.getMaxY());
+ const SdrPageGridFrameList* pFrames = getSdrPageFromSdrPageView().GetGridFrameList(GetView(), 0);
+ sal_uInt32 nGridPaintAnz(1);
+
+ if(pFrames)
+ {
+ nGridPaintAnz = pFrames->GetCount();
+ }
+
+ for(sal_uInt32 nGridPaintNum(0); nGridPaintNum < nGridPaintAnz; nGridPaintNum++)
+ {
+ if(pFrames)
+ {
const SdrPageGridFrame& rGF=(*pFrames)[nGridPaintNum];
- nWrX=rGF.GetPaperRect().Left();
- nWrY=rGF.GetPaperRect().Top();
- x1=rGF.GetUserArea().Left();
- x2=rGF.GetUserArea().Right();
- y1=rGF.GetUserArea().Top();
- y2=rGF.GetUserArea().Bottom();
- aOrg=rGF.GetUserArea().TopLeft();
- aOrg-=rGF.GetPaperRect().TopLeft();
+ fWrX = rGF.GetPaperRect().getMinX();
+ fWrY = rGF.GetPaperRect().getMinY();
+ x1 = rGF.GetUserArea().getMinX();
+ x2 = rGF.GetUserArea().getMaxX();
+ y1 = rGF.GetUserArea().getMinY();
+ y2 = rGF.GetUserArea().getMaxY();
+
+ aOrg.setX(rGF.GetUserArea().getMinX() - rGF.GetPaperRect().getMinX());
+ aOrg.setY(rGF.GetUserArea().getMinY() - rGF.GetPaperRect().getMinY());
}
- if (!rRect.IsEmpty()) {
+
+ if(!rRange.isEmpty())
+ {
Size a1PixSiz(rOut.PixelToLogic(Size(1,1)));
long nX1Pix=a1PixSiz.Width(); // 1 Pixel Toleranz drauf
long nY1Pix=a1PixSiz.Height();
- if (x1<rRect.Left() -nX1Pix) x1=rRect.Left() -nX1Pix;
- if (x2>rRect.Right() +nX1Pix) x2=rRect.Right() +nX1Pix;
- if (y1<rRect.Top() -nY1Pix) y1=rRect.Top() -nY1Pix;
- if (y2>rRect.Bottom()+nY1Pix) y2=rRect.Bottom()+nY1Pix;
+
+ if(x1 < rRange.getMinX() - nX1Pix) x1 = rRange.getMinX() - nX1Pix;
+ if(x2 > rRange.getMaxX() + nX1Pix) x2 = rRange.getMaxX() + nX1Pix;
+ if(y1 < rRange.getMinY() - nY1Pix) y1 = rRange.getMinY() - nY1Pix;
+ if(y2 > rRange.getMaxY() + nY1Pix) y2 = rRange.getMaxY() + nY1Pix;
}
- Point aPnt;
- long xBigOrg=aOrg.X()+nWrX;
+ double xBigOrg(aOrg.getX() + fWrX);
while (xBigOrg>=x1) xBigOrg-=nx1;
while (xBigOrg<x1) xBigOrg+=nx1;
- long xFinOrg=xBigOrg;
+
+ double xFinOrg(xBigOrg);
while (xFinOrg>=x1) xFinOrg-=nx2;
while (xFinOrg<x1) xFinOrg+=nx2;
- long yBigOrg=aOrg.Y()+nWrY;
+ double yBigOrg(aOrg.getY() + fWrY);
while (yBigOrg>=y1) yBigOrg-=ny1;
while (yBigOrg<y1) yBigOrg+=ny1;
- long yFinOrg=yBigOrg;
+
+ double yFinOrg(yBigOrg);
while (yFinOrg>=y1) yFinOrg-=ny2;
while (yFinOrg<y1) yFinOrg+=ny2;
@@ -627,21 +611,27 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, C
{
if( bHoriLines )
{
- sal_uIntPtr nGridFlags = ( bHoriSolid ? GRID_HORZLINES : GRID_DOTS );
+ sal_uInt32 nGridFlags = ( bHoriSolid ? GRID_HORZLINES : GRID_DOTS );
sal_uInt16 nSteps = sal_uInt16(nx1 / nx2);
sal_uInt32 nRestPerStepMul1000 = nSteps ? ( ((nx1 * 1000L)/ nSteps) - (nx2 * 1000L) ) : 0;
sal_uInt32 nStepOffset = 0;
sal_uInt16 nPointOffset = 0;
- for(sal_uInt16 a=0;a<nSteps;a++)
+ for(sal_uInt16 a(0); a < nSteps; a++)
{
// Zeichnen
rOut.DrawGrid(
- Rectangle( xFinOrg + (a * nx2) + nPointOffset, yBigOrg, x2, y2 ),
- Size( nx1, ny1 ), nGridFlags );
+ Rectangle(
+ basegfx::fround(xFinOrg) + (a * nx2) + nPointOffset,
+ basegfx::fround(yBigOrg),
+ basegfx::fround(x2),
+ basegfx::fround(y2)),
+ Size(nx1, ny1),
+ nGridFlags);
// Schritt machen
nStepOffset += nRestPerStepMul1000;
+
while(nStepOffset >= 1000)
{
nStepOffset -= 1000;
@@ -652,29 +642,33 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, C
if( bVertLines )
{
- sal_uIntPtr nGridFlags = ( bVertSolid ? GRID_VERTLINES : GRID_DOTS );
+ sal_uInt32 nGridFlags = ( bVertSolid ? GRID_VERTLINES : GRID_DOTS );
sal_uInt16 nSteps = sal_uInt16(ny1 / ny2);
sal_uInt32 nRestPerStepMul1000 = nSteps ? ( ((ny1 * 1000L)/ nSteps) - (ny2 * 1000L) ) : 0;
sal_uInt32 nStepOffset = 0;
sal_uInt16 nPointOffset = 0;
- for(sal_uInt16 a=0;a<nSteps;a++)
+ for(sal_uInt16 a(0); a < nSteps; a++)
{
// Zeichnen
rOut.DrawGrid(
- Rectangle( xBigOrg, yFinOrg + (a * ny2) + nPointOffset, x2, y2 ),
- Size( nx1, ny1 ), nGridFlags );
+ Rectangle(
+ basegfx::fround(xBigOrg),
+ basegfx::fround(yFinOrg) + (a * ny2) + nPointOffset,
+ basegfx::fround(x2),
+ basegfx::fround(y2)),
+ Size(nx1, ny1),
+ nGridFlags);
// Schritt machen
nStepOffset += nRestPerStepMul1000;
+
while(nStepOffset >= 1000)
{
nStepOffset -= 1000;
nPointOffset++;
}
}
-
- // rOut.DrawGrid( Rectangle( xo + xBigOrg, yo + yFinOrg, x2, y2 ), Size( nx1, ny2 ), nGridFlags );
}
}
}
@@ -686,30 +680,24 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, C
void SdrPageView::AdjHdl()
{
- GetView().AdjustMarkHdl();
+ GetView().SetMarkHandles();
}
-void SdrPageView::SetLayer(const XubString& rName, SetOfByte& rBS, sal_Bool bJa)
+void SdrPageView::SetLayer(const XubString& rName, SetOfByte& rBS, bool bJa)
{
- if(!GetPage())
- return;
-
- SdrLayerID nID = GetPage()->GetLayerAdmin().GetLayerID(rName, sal_True);
+ SdrLayerID nID = getSdrPageFromSdrPageView().GetPageLayerAdmin().GetLayerID(rName, true);
if(SDRLAYER_NOTFOUND != nID)
rBS.Set(nID, bJa);
}
-sal_Bool SdrPageView::IsLayer(const XubString& rName, const SetOfByte& rBS) const
+bool SdrPageView::IsLayer(const XubString& rName, const SetOfByte& rBS) const
{
- if(!GetPage())
- return sal_False;
-
- sal_Bool bRet(sal_False);
+ bool bRet(false);
if(rName.Len())
{
- SdrLayerID nId = GetPage()->GetLayerAdmin().GetLayerID(rName, sal_True);
+ SdrLayerID nId = getSdrPageFromSdrPageView().GetPageLayerAdmin().GetLayerID(rName, true);
if(SDRLAYER_NOTFOUND != nId)
{
@@ -720,7 +708,7 @@ sal_Bool SdrPageView::IsLayer(const XubString& rName, const SetOfByte& rBS) cons
return bRet;
}
-void SdrPageView::SetAllLayers(SetOfByte& rB, sal_Bool bJa)
+void SdrPageView::SetAllLayers(SetOfByte& rB, bool bJa)
{
if(bJa)
{
@@ -733,69 +721,69 @@ void SdrPageView::SetAllLayers(SetOfByte& rB, sal_Bool bJa)
}
}
-sal_Bool SdrPageView::IsObjMarkable(SdrObject* pObj) const
+bool SdrPageView::IsObjMarkable(const SdrObject& rObj) const
{
- if(pObj)
+ // Vom Markieren ausgeschlossen?
+ if(rObj.IsMarkProtect())
{
- // Vom Markieren ausgeschlossen?
- if(pObj->IsMarkProtect())
- {
- return sal_False;
- }
+ return false;
+ }
// only visible are markable
- if( !pObj->IsVisible() )
- {
- return sal_False;
- }
+ if( !rObj.IsVisible() )
+ {
+ return false;
+ }
// #112440#
- if(pObj->ISA(SdrObjGroup))
+ if(dynamic_cast< const SdrObjGroup* >(&rObj))
+ {
+ // If object is a Group object, visibility depends evtl. on
+ // multiple layers. If one object is markable, Group is markable.
+ SdrObjList* pObjList = rObj.getChildrenOfSdrObject();
+
+ if(pObjList && pObjList->GetObjCount())
{
- // If object is a Group object, visibility depends evtl. on
- // multiple layers. If one object is markable, Group is markable.
- SdrObjList* pObjList = ((SdrObjGroup*)pObj)->GetSubList();
+ bool bGroupIsMarkable(false);
- if(pObjList && pObjList->GetObjCount())
+ for(sal_uInt32 a(0); !bGroupIsMarkable && a < pObjList->GetObjCount(); a++)
{
- sal_Bool bGroupIsMarkable(sal_False);
+ SdrObject* pCandidate = pObjList->GetObj(a);
- for(sal_uInt32 a(0L); !bGroupIsMarkable && a < pObjList->GetObjCount(); a++)
+ // call recursively
+ if(IsObjMarkable(*pCandidate))
{
- SdrObject* pCandidate = pObjList->GetObj(a);
-
- // call recursively
- if(IsObjMarkable(pCandidate))
- {
- bGroupIsMarkable = sal_True;
- }
+ bGroupIsMarkable = true;
}
-
- return bGroupIsMarkable;
- }
- else
- {
- // #i43302#
- // Allow empty groups to be selected to be able to delete them
- return sal_True;
}
+
+ return bGroupIsMarkable;
}
else
{
- // Der Layer muss sichtbar und darf nicht gesperrt sein
- SdrLayerID nL = pObj->GetLayer();
- return (aLayerVisi.IsSet(sal_uInt8(nL)) && !aLayerLock.IsSet(sal_uInt8(nL)));
+ // #i43302#
+ // Allow empty groups to be selected to be able to delete them
+ return true;
}
}
+ else
+ {
+ // Der Layer muss sichtbar und darf nicht gesperrt sein
+ SdrLayerID nL = rObj.GetLayer();
+ return (maVisibleLayerSet.IsSet(sal_uInt8(nL)) && !maLockedLayerSet.IsSet(sal_uInt8(nL)));
+ }
- return sal_False;
+ return false;
}
-void SdrPageView::SetPageOrigin(const Point& rOrg)
+void SdrPageView::SetPageOrigin(const basegfx::B2DPoint& rOrg)
{
- if (rOrg!=aPgOrg) {
- aPgOrg=rOrg;
- if (GetView().IsGridVisible()) {
+ if(rOrg != GetPageOrigin())
+ {
+ maPageOrigin = rOrg;
+
+ if(GetView().IsGridVisible())
+ {
InvalidateAllWin();
}
}
@@ -803,23 +791,48 @@ void SdrPageView::SetPageOrigin(const Point& rOrg)
void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const
{
- if (GetView().IsHlplVisible() && nNum<aHelpLines.GetCount()) {
- const SdrHelpLine& rHL=aHelpLines[nNum];
+ if(GetView().IsHlplVisible() && nNum < maHelpLines.GetCount())
+ {
+ const SdrHelpLine& rHelpLine = maHelpLines[nNum];
- for(sal_uInt32 a(0L); a < GetView().PaintWindowCount(); a++)
+ for(sal_uInt32 a(0); a < GetView().PaintWindowCount(); a++)
{
SdrPaintWindow* pCandidate = GetView().GetPaintWindow(a);
if(pCandidate->OutputToWindow())
{
OutputDevice& rOutDev = pCandidate->GetOutputDevice();
- Rectangle aR(rHL.GetBoundRect(rOutDev));
- Size aSiz(rOutDev.PixelToLogic(Size(1,1)));
- aR.Left() -= aSiz.Width();
- aR.Right() += aSiz.Width();
- aR.Top() -= aSiz.Height();
- aR.Bottom() += aSiz.Height();
- ((SdrView&)GetView()).InvalidateOneWin((Window&)rOutDev, aR);
+ const basegfx::B2DRange aViewRange(rOutDev.GetLogicRange());
+ const basegfx::B2DVector aLogicPixel(rOutDev.GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0));
+ basegfx::B2DRange aRange;
+
+ switch(rHelpLine.GetKind())
+ {
+ case SDRHELPLINE_VERTICAL :
+ {
+ aRange.expand(basegfx::B2DPoint(rHelpLine.GetPos().getX(), aViewRange.getMinY()));
+ aRange.expand(basegfx::B2DPoint(rHelpLine.GetPos().getX(), aViewRange.getMaxY()));
+ break;
+ }
+ case SDRHELPLINE_HORIZONTAL:
+ {
+ aRange.expand(basegfx::B2DPoint(aViewRange.getMinX(), rHelpLine.GetPos().getY()));
+ aRange.expand(basegfx::B2DPoint(aViewRange.getMaxX(), rHelpLine.GetPos().getY()));
+ break;
+ }
+ default: //case SDRHELPLINE_POINT :
+ {
+ const double fViewFixValue(15.0);
+ const basegfx::B2DVector aGrow(aLogicPixel * fViewFixValue);
+ aRange.expand(rHelpLine.GetPos() - aGrow);
+ aRange.expand(rHelpLine.GetPos() + aGrow);
+ break;
+ }
+ }
+
+ aRange.grow((aLogicPixel.getX() + aLogicPixel.getY()) * 0.5);
+
+ ((SdrView&)GetView()).InvalidateOneWin((Window&)rOutDev, aRange);
}
}
}
@@ -827,69 +840,99 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const
void SdrPageView::SetHelpLines(const SdrHelpLineList& rHLL)
{
- aHelpLines=rHLL;
+ maHelpLines = rHLL;
InvalidateAllWin();
}
-void SdrPageView::SetHelpLine(sal_uInt16 nNum, const SdrHelpLine& rNewHelpLine)
+void SdrPageView::SetHelpLine(sal_uInt32 nNum, const SdrHelpLine& rNewHelpLine)
{
- if (nNum<aHelpLines.GetCount() && aHelpLines[nNum]!=rNewHelpLine) {
- FASTBOOL bNeedRedraw=sal_True;
- if (aHelpLines[nNum].GetKind()==rNewHelpLine.GetKind()) {
- switch (rNewHelpLine.GetKind()) {
- case SDRHELPLINE_VERTICAL : if (aHelpLines[nNum].GetPos().X()==rNewHelpLine.GetPos().X()) bNeedRedraw=sal_False; break;
- case SDRHELPLINE_HORIZONTAL: if (aHelpLines[nNum].GetPos().Y()==rNewHelpLine.GetPos().Y()) bNeedRedraw=sal_False; break;
- default: break;
- } // switch
+ if(nNum < GetHelpLines().GetCount() && GetHelpLines()[nNum] != rNewHelpLine)
+ {
+ bool bNeedRedraw(true);
+
+ if(GetHelpLines()[nNum].GetKind() == rNewHelpLine.GetKind())
+ {
+ switch(rNewHelpLine.GetKind())
+ {
+ case SDRHELPLINE_VERTICAL :
+ {
+ if(basegfx::fTools::equal(GetHelpLines()[nNum].GetPos().getX(), rNewHelpLine.GetPos().getX()))
+ {
+ bNeedRedraw = false;
+ }
+
+ break;
+ }
+ case SDRHELPLINE_HORIZONTAL:
+ {
+ if(basegfx::fTools::equal(GetHelpLines()[nNum].GetPos().getY(), rNewHelpLine.GetPos().getY()))
+ {
+ bNeedRedraw = false;
+ }
+
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ }
+
+ if(bNeedRedraw)
+ {
+ ImpInvalidateHelpLineArea(nNum);
+ }
+
+ maHelpLines[nNum] = rNewHelpLine;
+
+ if(bNeedRedraw)
+ {
+ ImpInvalidateHelpLineArea(nNum);
}
- if (bNeedRedraw) ImpInvalidateHelpLineArea(nNum);
- aHelpLines[nNum]=rNewHelpLine;
- if (bNeedRedraw) ImpInvalidateHelpLineArea(nNum);
}
}
-void SdrPageView::DeleteHelpLine(sal_uInt16 nNum)
+void SdrPageView::DeleteHelpLine(sal_uInt32 nNum)
{
- if (nNum<aHelpLines.GetCount()) {
+ if(nNum < maHelpLines.GetCount())
+ {
ImpInvalidateHelpLineArea(nNum);
- aHelpLines.Delete(nNum);
+ maHelpLines.Delete(nNum);
}
}
-void SdrPageView::InsertHelpLine(const SdrHelpLine& rHL, sal_uInt16 nNum)
+void SdrPageView::InsertHelpLine(const SdrHelpLine& rHL)
{
- if (nNum>aHelpLines.GetCount()) nNum=aHelpLines.GetCount();
- aHelpLines.Insert(rHL,nNum);
- if (GetView().IsHlplVisible()) {
- if (GetView().IsHlplFront()) {
- // Hier optimieren ...
- ImpInvalidateHelpLineArea(nNum);
- } else {
- ImpInvalidateHelpLineArea(nNum);
- }
+ maHelpLines.Insert(rHL);
+
+ if(GetView().IsHlplVisible() && GetHelpLines().GetCount())
+ {
+ ImpInvalidateHelpLineArea(GetHelpLines().GetCount() - 1);
}
}
// Betretene Gruppe und Liste setzen
-void SdrPageView::SetAktGroupAndList(SdrObject* pNewGroup, SdrObjList* pNewList)
+void SdrPageView::SetCurrentGroupAndObjectList(SdrObject* pNewGroup, SdrObjList* pNewList)
{
- if(pAktGroup != pNewGroup)
+ if(mpCurrentGroup != pNewGroup)
{
- pAktGroup = pNewGroup;
+ mpCurrentGroup = pNewGroup;
}
- if(pAktList != pNewList)
+
+ if(mpCurrentList != pNewList)
{
- pAktList = pNewList;
+ mpCurrentList = pNewList;
}
}
-sal_Bool SdrPageView::EnterGroup(SdrObject* pObj)
+bool SdrPageView::EnterGroup(SdrObject* pObj)
{
- sal_Bool bRet(sal_False);
+ bool bRet(false);
- if(pObj && pObj->IsGroupObject())
+ if(pObj && pObj->getChildrenOfSdrObject())
{
- sal_Bool bGlueInvalidate(GetView().ImpIsGlueVisible());
+ bool bGlueInvalidate(GetView().ImpIsGlueVisible());
if(bGlueInvalidate)
{
@@ -900,23 +943,23 @@ sal_Bool SdrPageView::EnterGroup(SdrObject* pObj)
GetView().UnmarkAll();
// set current group and list
- SdrObjList* pNewObjList = pObj->GetSubList();
- SetAktGroupAndList(pObj, pNewObjList);
+ SdrObjList* pNewObjList = pObj->getChildrenOfSdrObject();
+ SetCurrentGroupAndObjectList(pObj, pNewObjList);
// select contained object if only one object is contained,
// else select nothing and let the user decide what to do next
if(pNewObjList && pNewObjList->GetObjCount() == 1)
{
- SdrObject* pFirstObject = pNewObjList->GetObj(0L);
+ SdrObject* pFirstObject = pNewObjList->GetObj(0);
if(GetView().GetSdrPageView())
{
- GetView().MarkObj(pFirstObject, GetView().GetSdrPageView());
+ GetView().MarkObj(*pFirstObject);
}
}
// build new handles
- GetView().AdjustMarkHdl();
+ GetView().SetMarkHandles();
// invalidate only when view wants to visualize group entering
if(GetView().DoVisualizeEnteredGroup())
@@ -929,7 +972,7 @@ sal_Bool SdrPageView::EnterGroup(SdrObject* pObj)
GetView().GlueInvalidate();
}
- bRet = sal_True;
+ bRet = true;
}
return bRet;
@@ -937,129 +980,164 @@ sal_Bool SdrPageView::EnterGroup(SdrObject* pObj)
void SdrPageView::LeaveOneGroup()
{
- if(GetAktGroup())
+ if(GetCurrentGroup())
{
- sal_Bool bGlueInvalidate = (GetView().ImpIsGlueVisible());
+ bool bGlueInvalidate(GetView().ImpIsGlueVisible());
if(bGlueInvalidate)
+ {
GetView().GlueInvalidate();
+ }
- SdrObject* pLastGroup = GetAktGroup();
- SdrObject* pParentGroup = GetAktGroup()->GetUpGroup();
- SdrObjList* pParentList = GetPage();
+ SdrObject* pLastGroup = GetCurrentGroup();
+ SdrObject* pParentGroup = GetCurrentGroup()->GetParentSdrObject();
+ SdrObjList* pParentList = &getSdrPageFromSdrPageView();
if(pParentGroup)
- pParentList = pParentGroup->GetSubList();
+ {
+ pParentList = pParentGroup->getChildrenOfSdrObject();
+ }
// Alles deselektieren
GetView().UnmarkAll();
- // Zuweisungen, pAktGroup und pAktList muessen gesetzt sein
- SetAktGroupAndList(pParentGroup, pParentList);
+ // Zuweisungen, mpCurrentGroup und mpCurrentList muessen gesetzt sein
+ SetCurrentGroupAndObjectList(pParentGroup, pParentList);
// gerade verlassene Gruppe selektieren
if(pLastGroup)
+ {
if(GetView().GetSdrPageView())
- GetView().MarkObj(pLastGroup, GetView().GetSdrPageView());
+ {
+ GetView().MarkObj(*pLastGroup);
+ }
+ }
- GetView().AdjustMarkHdl();
+ GetView().SetMarkHandles();
// invalidate only when view wants to visualize group entering
if(GetView().DoVisualizeEnteredGroup())
+ {
InvalidateAllWin();
+ }
if(bGlueInvalidate)
+ {
GetView().GlueInvalidate();
+ }
}
}
void SdrPageView::LeaveAllGroup()
{
- if(GetAktGroup())
+ if(GetCurrentGroup())
{
- sal_Bool bGlueInvalidate = (GetView().ImpIsGlueVisible());
+ bool bGlueInvalidate(GetView().ImpIsGlueVisible());
if(bGlueInvalidate)
+ {
GetView().GlueInvalidate();
+ }
- SdrObject* pLastGroup = GetAktGroup();
+ SdrObject* pLastGroup = GetCurrentGroup();
// Alles deselektieren
GetView().UnmarkAll();
- // Zuweisungen, pAktGroup und pAktList muessen gesetzt sein
- SetAktGroupAndList(NULL, GetPage());
+ // Zuweisungen, mpCurrentGroup und mpCurrentList muessen gesetzt sein
+ SetCurrentGroupAndObjectList(0, &getSdrPageFromSdrPageView());
// Oberste letzte Gruppe finden und selektieren
if(pLastGroup)
{
- while(pLastGroup->GetUpGroup())
- pLastGroup = pLastGroup->GetUpGroup();
+ while(pLastGroup->GetParentSdrObject())
+ {
+ pLastGroup = pLastGroup->GetParentSdrObject();
+ }
if(GetView().GetSdrPageView())
- GetView().MarkObj(pLastGroup, GetView().GetSdrPageView());
+ {
+ GetView().MarkObj(*pLastGroup);
+ }
}
- GetView().AdjustMarkHdl();
+ GetView().SetMarkHandles();
// invalidate only when view wants to visualize group entering
if(GetView().DoVisualizeEnteredGroup())
+ {
InvalidateAllWin();
+ }
if(bGlueInvalidate)
+ {
GetView().GlueInvalidate();
+ }
}
}
-sal_uInt16 SdrPageView::GetEnteredLevel() const
+sal_uInt32 SdrPageView::GetEnteredLevel() const
{
- sal_uInt16 nAnz=0;
- SdrObject* pGrp=GetAktGroup();
- while (pGrp!=NULL) {
+ sal_uInt32 nAnz(0);
+ SdrObject* pGrp = GetCurrentGroup();
+
+ while(pGrp)
+ {
nAnz++;
- pGrp=pGrp->GetUpGroup();
+ pGrp = pGrp->GetParentSdrObject();
}
+
return nAnz;
}
XubString SdrPageView::GetActualGroupName() const
{
- if(GetAktGroup())
+ if(GetCurrentGroup())
{
- XubString aStr(GetAktGroup()->GetName());
+ XubString aStr(GetCurrentGroup()->GetName());
if(!aStr.Len())
+ {
aStr += sal_Unicode('?');
+ }
return aStr;
}
else
+ {
return String();
+ }
}
XubString SdrPageView::GetActualPathName(sal_Unicode cSep) const
{
XubString aStr;
- sal_Bool bNamFnd(sal_False);
- SdrObject* pGrp = GetAktGroup();
+ bool bNamFnd(false);
+ SdrObject* pGrp = GetCurrentGroup();
while(pGrp)
{
XubString aStr1(pGrp->GetName());
if(!aStr1.Len())
+ {
aStr1 += sal_Unicode('?');
+ }
else
- bNamFnd = sal_True;
+ {
+ bNamFnd = true;
+ }
aStr += aStr1;
- pGrp = pGrp->GetUpGroup();
+ pGrp = pGrp->GetParentSdrObject();
if(pGrp)
+ {
aStr += cSep;
+ }
}
- if(!bNamFnd && GetAktGroup())
+ if(!bNamFnd && GetCurrentGroup())
{
aStr = String();
aStr += sal_Unicode('(');
@@ -1072,15 +1150,24 @@ XubString SdrPageView::GetActualPathName(sal_Unicode cSep) const
void SdrPageView::CheckAktGroup()
{
- SdrObject* pGrp=GetAktGroup();
- while (pGrp!=NULL &&
- (!pGrp->IsInserted() || pGrp->GetObjList()==NULL ||
- pGrp->GetPage()==NULL || pGrp->GetModel()==NULL)) { // irgendwas daneben?
- pGrp=pGrp->GetUpGroup();
+ SdrObject* pGrp = GetCurrentGroup();
+
+ while(pGrp && (!pGrp->IsObjectInserted() || !pGrp->getParentOfSdrObject() || !pGrp->getSdrPageFromSdrObject() ))
+ {
+ // irgendwas daneben?
+ pGrp = pGrp->GetParentSdrObject();
}
- if (pGrp!=GetAktGroup()) {
- if (pGrp!=NULL) EnterGroup(pGrp);
- else LeaveAllGroup();
+
+ if(pGrp != GetCurrentGroup())
+ {
+ if(pGrp)
+ {
+ EnterGroup(pGrp);
+ }
+ else
+ {
+ LeaveAllGroup();
+ }
}
}
@@ -1090,7 +1177,6 @@ void SdrPageView::SetApplicationBackgroundColor(Color aBackgroundColor)
maBackgroundColor = aBackgroundColor;
}
-// #109585#
Color SdrPageView::GetApplicationBackgroundColor() const
{
return maBackgroundColor;
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index e8b62af6cfb4..cfe1e528ede9 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -33,10 +33,10 @@
#ifdef DBG_UTIL
#include <svdibrow.hxx>
#endif
+
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
#include <svl/smplhint.hxx>
-
#include <svx/svdpntv.hxx>
#include <editeng/editdata.hxx>
#include <svx/svdmrkv.hxx>
@@ -50,7 +50,7 @@
#include <svx/svdograf.hxx>
#include <svx/svdattrx.hxx>
#include "svdibrow.hxx"
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/svdouno.hxx>
#include <svx/sdr/overlay/overlayobjectlist.hxx>
#include <svx/sdr/overlay/overlayrollingrectangle.hxx>
@@ -58,7 +58,6 @@
#include <svx/svdglue.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdview.hxx>
-#include <svx/sxlayitm.hxx>
#include <svl/itemiter.hxx>
#include <editeng/eeitem.hxx>
#include <svl/whiter.hxx>
@@ -72,6 +71,8 @@
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/sdr/animation/objectanimator.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/numeric/ftools.hxx>
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -79,65 +80,143 @@ using namespace ::rtl;
using namespace ::com::sun::star;
////////////////////////////////////////////////////////////////////////////////////////////////////
-// #114409#-3 Migrate Encirclement
-class ImplEncirclementOverlay
+// tooling
+
+basegfx::B2DPoint OrthoDistance8(const basegfx::B2DPoint& rReference, const basegfx::B2DPoint& rCandidate, bool bBigOrtho)
{
- // The OverlayObjects
- ::sdr::overlay::OverlayObjectList maObjects;
+ const double fDeltaX(rCandidate.getX() - rReference.getX());
- // The remembered second position in logical coodinates
- basegfx::B2DPoint maSecondPosition;
+ if(basegfx::fTools::equalZero(fDeltaX))
+ {
+ return rCandidate;
+ }
-public:
- ImplEncirclementOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos);
- ~ImplEncirclementOverlay();
+ const double fDeltaY(rCandidate.getY() - rReference.getY());
- void SetSecondPosition(const basegfx::B2DPoint& rNewPosition);
-};
+ if(basegfx::fTools::equalZero(fDeltaY))
+ {
+ return rCandidate;
+ }
-ImplEncirclementOverlay::ImplEncirclementOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos)
-: maSecondPosition(rStartPos)
-{
- for(sal_uInt32 a(0L); a < rView.PaintWindowCount(); a++)
+ const double fAbsDeltaX(fabs(fDeltaX));
+ const double fAbsDeltaY(fabs(fDeltaY));
+
+ if(basegfx::fTools::equal(fAbsDeltaX, fAbsDeltaY))
{
- SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
- ::sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+ return rCandidate;
+ }
- if(pTargetOverlay)
- {
- ::sdr::overlay::OverlayRollingRectangleStriped* aNew = new ::sdr::overlay::OverlayRollingRectangleStriped(
- rStartPos, rStartPos, false);
- pTargetOverlay->add(*aNew);
- maObjects.append(*aNew);
- }
+ if(basegfx::fTools::moreOrEqual(fAbsDeltaX, fAbsDeltaY * 2.0))
+ {
+ return basegfx::B2DPoint(rCandidate.getX(), rReference.getY());
+ }
+
+ if(basegfx::fTools::moreOrEqual(fAbsDeltaY, fAbsDeltaX * 2.0))
+ {
+ return basegfx::B2DPoint(rReference.getX(), rCandidate.getY());
+ }
+
+ if(basegfx::fTools::less(fAbsDeltaX, fAbsDeltaY) != bBigOrtho)
+ {
+ return basegfx::B2DPoint(rCandidate.getX(), rReference.getY() + basegfx::copySign(fAbsDeltaX, fDeltaY));
+ }
+ else
+ {
+ return basegfx::B2DPoint(rReference.getX() + basegfx::copySign(fAbsDeltaY, fDeltaX), rCandidate.getY());
}
}
-ImplEncirclementOverlay::~ImplEncirclementOverlay()
+basegfx::B2DPoint OrthoDistance4(const basegfx::B2DPoint& rReference, const basegfx::B2DPoint& rCandidate, bool bBigOrtho)
{
- // The OverlayObjects are cleared using the destructor of OverlayObjectList.
- // That destructor calls clear() at the list which removes all objects from the
- // OverlayManager and deletes them.
+ const basegfx::B2DVector aDelta(rCandidate - rReference);
+ const basegfx::B2DVector aAbsDelta(absolute(aDelta));
+
+ if(basegfx::fTools::less(aAbsDelta.getX(), aAbsDelta.getY()) != bBigOrtho)
+ {
+ return basegfx::B2DPoint(rCandidate.getX(), rReference.getY() + basegfx::copySign(aAbsDelta.getX(), aDelta.getY()));
+ }
+ else
+ {
+ return basegfx::B2DPoint(rReference.getX() + basegfx::copySign(aAbsDelta.getY(), aDelta.getX()), rCandidate.getY());
+ }
}
-void ImplEncirclementOverlay::SetSecondPosition(const basegfx::B2DPoint& rNewPosition)
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SvxViewHint::SvxViewHint(HintType eHintType)
+: meHintType(eHintType)
{
- if(rNewPosition != maSecondPosition)
+}
+
+SvxViewHint::HintType SvxViewHint::GetHintType (void) const
+{
+ return meHintType;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class LazyObjectChangeReactor : public Timer
+{
+private:
+ // the SdrPaintView this incarnation belongs to
+ SdrPaintView& mrSdrPaintView;
+
+ // derived from Timer
+ virtual void Timeout()
{
- // apply to OverlayObjects
- for(sal_uInt32 a(0L); a < maObjects.count(); a++)
+ mrSdrPaintView.LazyReactOnObjectChanges();
+ }
+
+public:
+ LazyObjectChangeReactor(SdrPaintView& rSdrPaintView)
+ : Timer(),
+ mrSdrPaintView(rSdrPaintView)
+ {}
+
+ void delay()
+ {
+ // trigger a delayed call
+ SetTimeout(1);
+ Start();
+ }
+
+ void force()
+ {
+ if(IsActive())
{
- ::sdr::overlay::OverlayRollingRectangleStriped& rCandidate = (::sdr::overlay::OverlayRollingRectangleStriped&)maObjects.getOverlayObject(a);
- rCandidate.setSecondPosition(rNewPosition);
+ Stop();
+ Timeout();
}
+ }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
- // remember new position
- maSecondPosition = rNewPosition;
+BitmapEx convertMetafileToBitmapEx(
+ const GDIMetaFile& rMtf,
+ const basegfx::B2DRange& rTargetRange,
+ const sal_uInt32 nMaximumQuadraticPixels)
+{
+ BitmapEx aBitmapEx;
+
+ if(rMtf.GetActionCount())
+ {
+ const drawinglayer::primitive2d::Primitive2DReference aMtf(
+ new drawinglayer::primitive2d::MetafilePrimitive2D(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rTargetRange.getRange(),
+ rTargetRange.getMinimum()),
+ rMtf));
+ aBitmapEx = convertPrimitive2DSequenceToBitmapEx(
+ drawinglayer::primitive2d::Primitive2DSequence(&aMtf, 1),
+ rTargetRange,
+ nMaximumQuadraticPixels);
}
+
+ return aBitmapEx;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-// interface to SdrPaintWindow
SdrPaintWindow* SdrPaintView::FindPaintWindow(const OutputDevice& rOut) const
{
@@ -192,140 +271,90 @@ OutputDevice* SdrPaintView::GetFirstOutputDevice() const
return 0L;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1( SvxViewHint, SfxHint );
-
-SvxViewHint::SvxViewHint (HintType eHintType)
- : meHintType(eHintType)
-{
-}
-
-SvxViewHint::HintType SvxViewHint::GetHintType (void) const
-{
- return meHintType;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-BitmapEx convertMetafileToBitmapEx(
- const GDIMetaFile& rMtf,
- const basegfx::B2DRange& rTargetRange,
- const sal_uInt32 nMaximumQuadraticPixels)
-{
- BitmapEx aBitmapEx;
-
- if(rMtf.GetActionCount())
- {
- const drawinglayer::primitive2d::Primitive2DReference aMtf(
- new drawinglayer::primitive2d::MetafilePrimitive2D(
- basegfx::tools::createScaleTranslateB2DHomMatrix(
- rTargetRange.getRange(),
- rTargetRange.getMinimum()),
- rMtf));
- aBitmapEx = convertPrimitive2DSequenceToBitmapEx(
- drawinglayer::primitive2d::Primitive2DSequence(&aMtf, 1),
- rTargetRange,
- nMaximumQuadraticPixels);
- }
-
- return aBitmapEx;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT2(SdrPaintView,SfxListener,SfxRepeatTarget);
-
-DBG_NAME(SdrPaintView);
-
-void SdrPaintView::ImpClearVars()
-{
+SdrPaintView::SdrPaintView(SdrModel& rModel1, OutputDevice* pOut)
+: SfxListener(),
+ SfxRepeatTarget(),
+ SfxBroadcaster(),
+ ::utl::ConfigurationListener(),
+ mpLazyObjectChangeReactor(new LazyObjectChangeReactor(*this)),
+ mrModelFromSdrView(rModel1),
#ifdef DBG_UTIL
- pItemBrowser=NULL;
+ mpItemBrowser(0),
#endif
- bPageVisible=sal_True;
- bPageBorderVisible=sal_True;
- bBordVisible=sal_True;
- bGridVisible=sal_True;
- bGridFront =sal_False;
- bHlplVisible=sal_True;
- bHlplFront =sal_True;
- bGlueVisible=sal_False;
- bGlueVisible2=sal_False;
- bGlueVisible3=sal_False;
- bGlueVisible4=sal_False;
- bSwapAsynchron=sal_False;
- bPrintPreview=sal_False;
- mbPreviewRenderer=sal_False;
-
- eAnimationMode = SDR_ANIMATION_ANIMATE;
- bAnimationPause = sal_False;
-
- nHitTolPix=2;
- nMinMovPix=3;
- nHitTolLog=0;
- nMinMovLog=0;
- pActualOutDev=NULL;
- pDragWin=NULL;
- bRestoreColors=sal_True;
- pDefaultStyleSheet=NULL;
- bSomeObjChgdFlag=sal_False;
- nGraphicManagerDrawMode = GRFMGR_DRAW_STANDARD;
- aComeBackTimer.SetTimeout(1);
- aComeBackTimer.SetTimeoutHdl(LINK(this,SdrPaintView,ImpComeBackHdl));
- String aNam; // System::GetUserName() just return an empty string
-
- if (pMod)
- SetDefaultStyleSheet(pMod->GetDefaultStyleSheet(), sal_True);
-
- aNam.ToUpperAscii();
-
- maGridColor = Color( COL_BLACK );
- BrkEncirclement();
-}
-
-SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut)
-: mpEncirclementOverlay(0L),
- mpPageView(0L),
- aDefaultAttr(pModel1->GetItemPool()),
+ mpActualOutDev(0),
+ mpDefaultStyleSheet(0),
+ maAktLayer(),
+ maMeasureLayer(),
+ mpPageView(0),
+ maPaintWindows(),
+ maGridBig(),
+ maGridFin(),
+ maDragStat(*getAsSdrView()),
+ maMaxWorkArea(),
+ maDefaultAttr(rModel1.GetItemPool()),
+ meAnimationMode(SDR_ANIMATION_ANIMATE),
+ mfHitTolPix(2.0),
+ mfMinMovPix(3.0),
+ maDrawinglayerOpt(),
+ mbPageVisible(true),
+ mbPageBorderVisible(true),
+ mbBordVisible(true),
+ mbGridVisible(true),
+ mbGridFront(false),
+ mbHlplVisible(true),
+ mbHlplFront(true),
+ mbGlueVisible(false),
+ mbGlueVisible2(false),
+ mbGlueVisible3(false),
+ mbGlueVisible4(false),
+ mbSwapAsynchron(false),
+ mbPrintPreview(false),
+ mbVisualizeEnteredGroup(true),
+ mbAnimationPause(false),
mbBufferedOutputAllowed(false),
mbBufferedOverlayAllowed(false),
mbPagePaintingAllowed(true),
+ mbPreviewRenderer(false),
mbHideOle(false),
mbHideChart(false),
mbHideDraw(false),
- mbHideFormControl(false)
+ mbHideFormControl(false),
+ maColorConfig(),
+ maGridColor(COL_BLACK)
{
- DBG_CTOR(SdrPaintView,NULL);
- pMod=pModel1;
- ImpClearVars();
+ SetDefaultStyleSheet(getSdrModelFromSdrView().GetDefaultStyleSheet(), true);
if(pOut)
{
AddWindowToPaintView(pOut);
}
- // Flag zur Visualisierung von Gruppen
- bVisualizeEnteredGroup = sal_True;
-
maColorConfig.AddListener(this);
onChangeColorConfig();
}
SdrPaintView::~SdrPaintView()
{
- DBG_DTOR(SdrPaintView,NULL);
- if (pDefaultStyleSheet)
- EndListening(*pDefaultStyleSheet);
+ if(mpLazyObjectChangeReactor)
+ {
+ delete mpLazyObjectChangeReactor;
+ }
+
+ if (GetDefaultStyleSheet())
+ {
+ EndListening(*GetDefaultStyleSheet());
+ }
maColorConfig.RemoveListener(this);
- ClearPageView();
+
+ // HideSdrPage() gets called in derived destructors (e.g. in SdrView::~SdrView) to have it executed
+ // when the SDrView is still fully valid
+ OSL_ENSURE(!mpPageView, "SdrView destruction: Call HideSdrPage() before deleting SdrView (!)");
#ifdef DBG_UTIL
- if(pItemBrowser)
+ if(GetItemBrowser())
{
- delete pItemBrowser;
+ delete mpItemBrowser;
}
#endif
@@ -335,9 +364,6 @@ SdrPaintView::~SdrPaintView()
delete maPaintWindows.back();
maPaintWindows.pop_back();
}
-
- // #114409#-3 Migrate HelpLine
- BrkEncirclement();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -345,33 +371,42 @@ SdrPaintView::~SdrPaintView()
void __EXPORT SdrPaintView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
//If the stylesheet has been destroyed
- if (&rBC == pDefaultStyleSheet)
+ if (&rBC == GetDefaultStyleSheet())
{
- if (rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
- pDefaultStyleSheet = NULL;
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId())
+ {
+ mpDefaultStyleSheet = 0;
+ }
+
return;
}
- sal_Bool bObjChg=!bSomeObjChgdFlag; // sal_True= auswerten fuer ComeBack-Timer
- if (bObjChg) {
- SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
- if (pSdrHint!=NULL) {
- SdrHintKind eKind=pSdrHint->GetKind();
- if (eKind==HINT_OBJCHG || eKind==HINT_OBJINSERTED || eKind==HINT_OBJREMOVED) {
- if (bObjChg) {
- bSomeObjChgdFlag=sal_True;
- aComeBackTimer.Start();
- }
- }
- if (eKind==HINT_PAGEORDERCHG) {
- const SdrPage* pPg=pSdrHint->GetPage();
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrHint)
+ {
+ const SdrHintKind eKind(pSdrHint->GetSdrHintKind());
+
+ if(HINT_OBJCHG_MOVE == eKind
+ || HINT_OBJCHG_RESIZE == eKind
+ || HINT_OBJCHG_ATTR == eKind
+ || HINT_OBJINSERTED == eKind
+ || HINT_OBJREMOVED == eKind)
+ {
+ mpLazyObjectChangeReactor->delay();
+ }
+
+ if(HINT_PAGEORDERCHG == eKind)
+ {
+ const SdrPage* pPg = pSdrHint->GetSdrHintPage();
- if(pPg && !pPg->IsInserted())
+ if(pPg && !pPg->IsInserted())
+ {
+ if(mpPageView && &mpPageView->getSdrPageFromSdrPageView() == pPg)
{
- if(mpPageView && mpPageView->GetPage() == pPg)
- {
- HideSdrPage();
- }
+ HideSdrPage();
}
}
}
@@ -386,29 +421,15 @@ void SdrPaintView::ConfigurationChanged( ::utl::ConfigurationBroadcaster* , sal_
////////////////////////////////////////////////////////////////////////////////////////////////////
-IMPL_LINK_INLINE_START(SdrPaintView,ImpComeBackHdl,Timer*,EMPTYARG)
+void SdrPaintView::ForceLazyReactOnObjectChanges() const
{
- if (bSomeObjChgdFlag) {
- bSomeObjChgdFlag=sal_False;
- ModelHasChanged();
- }
- return 0;
+ mpLazyObjectChangeReactor->force();
}
-IMPL_LINK_INLINE_END(SdrPaintView,ImpComeBackHdl,Timer*,pTimer)
-void SdrPaintView::FlushComeBackTimer() const
-{
- if (bSomeObjChgdFlag) {
- // casting auf nonconst
- ((SdrPaintView*)this)->ImpComeBackHdl(&((SdrPaintView*)this)->aComeBackTimer);
- ((SdrPaintView*)this)->aComeBackTimer.Stop();
- }
-}
-
-void SdrPaintView::ModelHasChanged()
+void SdrPaintView::LazyReactOnObjectChanges()
{
// Auch alle PageViews benachrichtigen
- if(mpPageView && !mpPageView->GetPage()->IsInserted())
+ if(mpPageView && !mpPageView->getSdrPageFromSdrPageView().IsInserted())
{
HideSdrPage();
}
@@ -416,214 +437,51 @@ void SdrPaintView::ModelHasChanged()
// test mpPageView here again, HideSdrPage() may have invalidated it.
if(mpPageView)
{
- mpPageView->ModelHasChanged();
+ mpPageView->LazyReactOnObjectChanges();
}
#ifdef DBG_UTIL
- if(pItemBrowser)
+ if(GetItemBrowser())
{
- pItemBrowser->SetDirty();
+ mpItemBrowser->SetDirty();
}
#endif
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrPaintView::IsAction() const
-{
- return IsEncirclement();
-}
-
-void SdrPaintView::MovAction(const Point& rPnt)
-{
- if (IsEncirclement())
- {
- MovEncirclement(rPnt);
- }
-}
-
-void SdrPaintView::EndAction()
-{
- if(IsEncirclement())
- {
- EndEncirclement();
- }
-}
-
-void SdrPaintView::BckAction()
-{
- BrkEncirclement();
-}
-
-void SdrPaintView::BrkAction()
-{
- BrkEncirclement();
-}
-
-void SdrPaintView::TakeActionRect(Rectangle& rRect) const
-{
- if(IsEncirclement())
- {
- rRect = Rectangle(aDragStat.GetStart(),aDragStat.GetNow());
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// info about TextEdit. Default is sal_False.
+// info about TextEdit. Default is false.
bool SdrPaintView::IsTextEdit() const
{
return false;
}
-// info about TextEditPageView. Default is 0L.
-SdrPageView* SdrPaintView::GetTextEditPageView() const
-{
- return 0L;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_uInt16 SdrPaintView::ImpGetMinMovLogic(short nMinMov, const OutputDevice* pOut) const
-{
- if (nMinMov>=0) return sal_uInt16(nMinMov);
- if (pOut==NULL)
- {
- pOut = GetFirstOutputDevice();
- }
- if (pOut!=NULL) {
- return short(-pOut->PixelToLogic(Size(nMinMov,0)).Width());
- } else {
- return 0;
- }
-}
-
-sal_uInt16 SdrPaintView::ImpGetHitTolLogic(short nHitTol, const OutputDevice* pOut) const
-{
- if (nHitTol>=0) return sal_uInt16(nHitTol);
- if (pOut==NULL)
- {
- pOut = GetFirstOutputDevice();
- }
- if (pOut!=NULL) {
- return short(-pOut->PixelToLogic(Size(nHitTol,0)).Width());
- } else {
- return 0;
- }
-}
-
-void SdrPaintView::TheresNewMapMode()
-{
- if (pActualOutDev!=NULL) {
- nHitTolLog=(sal_uInt16)((OutputDevice*)pActualOutDev)->PixelToLogic(Size(nHitTolPix,0)).Width();
- nMinMovLog=(sal_uInt16)((OutputDevice*)pActualOutDev)->PixelToLogic(Size(nMinMovPix,0)).Width();
- }
-}
-
-void SdrPaintView::SetActualWin(const OutputDevice* pWin)
-{
- pActualOutDev=pWin;
- TheresNewMapMode();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrPaintView::BegEncirclement(const Point& rPnt)
-{
- BrkAction();
-
- DBG_ASSERT(0L == mpEncirclementOverlay, "SdrSnapView::BegSetPageOrg: There exists a ImplPageOriginOverlay (!)");
- basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
- mpEncirclementOverlay = new ImplEncirclementOverlay(*this, aStartPos);
-
- aDragStat.Reset(rPnt);
- aDragStat.SetMinMove(ImpGetMinMovLogic(-2,0L));
- aDragStat.NextPoint();
-}
-
-void SdrPaintView::MovEncirclement(const Point& rPnt)
-{
- if(IsEncirclement() && aDragStat.CheckMinMoved(rPnt))
- {
- aDragStat.NextMove(rPnt);
-
- DBG_ASSERT(mpEncirclementOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
- basegfx::B2DPoint aNewPos(rPnt.X(), rPnt.Y());
- mpEncirclementOverlay->SetSecondPosition(aNewPos);
- }
-}
-
-Rectangle SdrPaintView::EndEncirclement(sal_Bool bNoJustify)
-{
- Rectangle aRetval;
-
- if(IsEncirclement())
- {
- if(aDragStat.IsMinMoved())
- {
- aRetval = Rectangle(aDragStat.GetStart(), aDragStat.GetNow());
-
- if(!bNoJustify)
- {
- aRetval.Justify();
- }
- }
-
- // cleanup
- BrkEncirclement();
- }
-
- return aRetval;
-}
-
-void SdrPaintView::BrkEncirclement()
-{
- if(IsEncirclement())
- {
- DBG_ASSERT(mpEncirclementOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
- delete mpEncirclementOverlay;
- mpEncirclementOverlay = 0L;
- }
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrPaintView::ClearPageView()
+void SdrPaintView::HideSdrPage()
{
- BrkAction();
-
if(mpPageView)
{
+ // deselect all
+ getAsSdrView()->clearSdrObjectSelection();
+
+ // initiate repaint
InvalidateAllWin();
+
+ // delete SdrPageView
delete mpPageView;
- mpPageView = 0L;
+ mpPageView = 0;
}
}
-SdrPageView* SdrPaintView::ShowSdrPage(SdrPage* pPage)
+void SdrPaintView::ShowSdrPage(SdrPage& rPage)
{
- if(pPage && (!mpPageView || mpPageView->GetPage() != pPage))
+ if(!mpPageView || &mpPageView->getSdrPageFromSdrPageView() != &rPage)
{
- if(mpPageView)
- {
- InvalidateAllWin();
- delete mpPageView;
- }
+ HideSdrPage();
- mpPageView = new SdrPageView(pPage, *((SdrView*)this));
+ mpPageView = new SdrPageView(rPage, *getAsSdrView());
mpPageView->Show();
}
-
- return mpPageView;
-}
-
-void SdrPaintView::HideSdrPage()
-{
- if(mpPageView)
- {
- mpPageView->Hide();
- delete mpPageView;
- mpPageView = 0L;
- }
}
void SdrPaintView::AddWindowToPaintView(OutputDevice* pNewWin)
@@ -638,8 +496,10 @@ void SdrPaintView::AddWindowToPaintView(OutputDevice* pNewWin)
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
- pItemBrowser->ForceParent();
+ if (GetItemBrowser())
+ {
+ mpItemBrowser->ForceParent();
+ }
#endif
}
@@ -660,12 +520,14 @@ void SdrPaintView::DeleteWindowFromPaintView(OutputDevice* pOldWin)
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
- pItemBrowser->ForceParent();
+ if (GetItemBrowser())
+ {
+ mpItemBrowser->ForceParent();
+ }
#endif
}
-void SdrPaintView::SetLayerVisible(const XubString& rName, sal_Bool bShow)
+void SdrPaintView::SetLayerVisible(const XubString& rName, bool bShow)
{
if(mpPageView)
{
@@ -685,7 +547,7 @@ bool SdrPaintView::IsLayerVisible(const XubString& rName) const
return false;
}
-void SdrPaintView::SetAllLayersVisible(sal_Bool bShow)
+void SdrPaintView::SetAllLayersVisible(bool bShow)
{
if(mpPageView)
{
@@ -695,7 +557,7 @@ void SdrPaintView::SetAllLayersVisible(sal_Bool bShow)
InvalidateAllWin();
}
-void SdrPaintView::SetLayerLocked(const XubString& rName, sal_Bool bLock)
+void SdrPaintView::SetLayerLocked(const XubString& rName, bool bLock)
{
if(mpPageView)
{
@@ -713,7 +575,7 @@ bool SdrPaintView::IsLayerLocked(const XubString& rName) const
return false;
}
-void SdrPaintView::SetAllLayersLocked(sal_Bool bLock)
+void SdrPaintView::SetAllLayersLocked(bool bLock)
{
if(mpPageView)
{
@@ -721,7 +583,7 @@ void SdrPaintView::SetAllLayersLocked(sal_Bool bLock)
}
}
-void SdrPaintView::SetLayerPrintable(const XubString& rName, sal_Bool bPrn)
+void SdrPaintView::SetLayerPrintable(const XubString& rName, bool bPrn)
{
if(mpPageView)
{
@@ -739,7 +601,7 @@ bool SdrPaintView::IsLayerPrintable(const XubString& rName) const
return false;
}
-void SdrPaintView::SetAllLayersPrintable(sal_Bool bPrn)
+void SdrPaintView::SetAllLayersPrintable(bool bPrn)
{
if(mpPageView)
{
@@ -1064,9 +926,8 @@ void SdrPaintView::ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const
if(pKnownTarget)
{
- const SdrModel& rModel = *(GetModel());
- const SdrLayerAdmin& rLayerAdmin = rModel.GetLayerAdmin();
- const SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID(rLayerAdmin.GetControlLayerName(), sal_False);
+ const SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrView().GetModelLayerAdmin();
+ const SdrLayerID nControlLayerId = rLayerAdmin.GetLayerID(rLayerAdmin.GetControlLayerName(), false);
// BUFFERED use GetTargetOutputDevice() now, it may be targeted to VDevs, too
// need to set PreparedPageWindow to make DrawLayer use the correct ObjectContact
@@ -1079,32 +940,46 @@ void SdrPaintView::ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrPaintView::KeyInput(const KeyEvent& /*rKEvt*/, Window* /*pWin*/)
+bool SdrPaintView::KeyInput(const KeyEvent& /*rKEvt*/, Window* /*pWin*/)
{
- return sal_False;
+ return false;
}
void SdrPaintView::GlueInvalidate() const
{
const sal_uInt32 nWindowCount(PaintWindowCount());
- for(sal_uInt32 nWinNum(0L); nWinNum < nWindowCount; nWinNum++)
+ for(sal_uInt32 nWinNum(0); nWinNum < nWindowCount; nWinNum++)
{
SdrPaintWindow* pPaintWindow = GetPaintWindow(nWinNum);
if(pPaintWindow->OutputToWindow())
{
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
+ const basegfx::B2DVector aLogicHalfSevenPix(rOutDev.GetInverseViewTransformation() * basegfx::B2DVector(3.5, 3.5));
if(mpPageView)
{
- const SdrObjList* pOL=mpPageView->GetObjList();
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz; nObjNum++) {
+ const SdrObjList* pOL = mpPageView->GetCurrentObjectList();
+ const sal_uInt32 nObjAnz(pOL->GetObjCount());
+
+ for(sal_uInt32 nObjNum(0); nObjNum < nObjAnz; nObjNum++)
+ {
const SdrObject* pObj=pOL->GetObj(nObjNum);
const SdrGluePointList* pGPL=pObj->GetGluePointList();
- if (pGPL!=NULL && pGPL->GetCount()!=0) {
- pGPL->Invalidate((Window&)rOutDev, pObj);
+
+ if(pGPL && pGPL->GetCount())
+ {
+ const basegfx::B2DRange aObjectRange(sdr::legacy::GetSnapRange(*pObj));
+
+ for(sal_uInt32 a(0); a < pGPL->GetCount(); a++)
+ {
+ const SdrGluePoint& rCandidate = (*pGPL)[a];
+ const basegfx::B2DPoint aPos(rCandidate.GetAbsolutePos(aObjectRange));
+ const basegfx::B2DRange aRange(aPos - aLogicHalfSevenPix, aPos + aLogicHalfSevenPix);
+
+ InvalidateOneWin((Window&)rOutDev, aRange);
+ }
}
}
}
@@ -1112,11 +987,11 @@ void SdrPaintView::GlueInvalidate() const
}
}
-void SdrPaintView::InvalidateAllWin()
+void SdrPaintView::InvalidateAllWin() const
{
const sal_uInt32 nWindowCount(PaintWindowCount());
- for(sal_uInt32 a(0L); a < nWindowCount; a++)
+ for(sal_uInt32 a(0); a < nWindowCount; a++)
{
SdrPaintWindow* pPaintWindow = GetPaintWindow(a);
@@ -1127,53 +1002,51 @@ void SdrPaintView::InvalidateAllWin()
}
}
-void SdrPaintView::InvalidateAllWin(const Rectangle& rRect, sal_Bool bPlus1Pix)
+void SdrPaintView::InvalidateAllWin(const basegfx::B2DRange& rRange, bool bPlus1Pix) const
{
const sal_uInt32 nWindowCount(PaintWindowCount());
- for(sal_uInt32 a(0L); a < nWindowCount; a++)
+ for(sal_uInt32 a(0); a < nWindowCount; a++)
{
SdrPaintWindow* pPaintWindow = GetPaintWindow(a);
if(pPaintWindow->OutputToWindow())
{
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
- Rectangle aRect(rRect);
+ basegfx::B2DRange aRange(rRange);
if(bPlus1Pix)
{
- Size aPixSiz(1,1);
- Size aSiz(rOutDev.PixelToLogic(aPixSiz));
- aRect.Left ()-=aSiz.Width();
- aRect.Top ()-=aSiz.Height();
- aRect.Right ()+=aSiz.Width();
- aRect.Bottom()+=aSiz.Height();
+ const basegfx::B2DVector aLogicPixel(rOutDev.GetInverseViewTransformation() * basegfx::B2DVector(1.0, 1.0));
+
+ aRange.grow((aLogicPixel.getX() + aLogicPixel.getY()) * 0.5);
}
- Point aOrg(rOutDev.GetMapMode().GetOrigin());
- aOrg.X()=-aOrg.X(); aOrg.Y()=-aOrg.Y();
- Rectangle aOutRect(aOrg, rOutDev.GetOutputSize());
+ const basegfx::B2DRange aViewRange(rOutDev.GetLogicRange());
- if (aRect.IsOver(aOutRect))
+ if(aRange.overlaps(aViewRange))
{
- InvalidateOneWin((Window&)rOutDev, aRect);
+ InvalidateOneWin((Window&)rOutDev, aRange);
}
}
}
}
-void SdrPaintView::InvalidateOneWin(Window& rWin)
+void SdrPaintView::InvalidateOneWin(Window& rWin) const
{
// #111096#
// do not erase background, that causes flicker (!)
rWin.Invalidate(INVALIDATE_NOERASE);
}
-void SdrPaintView::InvalidateOneWin(Window& rWin, const Rectangle& rRect)
+void SdrPaintView::InvalidateOneWin(Window& rWin, const basegfx::B2DRange& rRange) const
{
- // #111096#
+ const Rectangle aRectangle(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY()));
+
// do not erase background, that causes flicker (!)
- rWin.Invalidate(rRect, INVALIDATE_NOERASE);
+ rWin.Invalidate(aRectangle, INVALIDATE_NOERASE);
}
void SdrPaintView::LeaveOneGroup()
@@ -1196,54 +1069,75 @@ bool SdrPaintView::IsGroupEntered() const
{
if(mpPageView)
{
- return (mpPageView->GetEnteredLevel() != 0);
+ return (0 != mpPageView->GetEnteredLevel());
}
return false;
}
-void SdrPaintView::SetNotPersistDefaultAttr(const SfxItemSet& rAttr, sal_Bool /*bReplaceAll*/)
+void SdrPaintView::SetNotPersistDefaultAttr(const SfxItemSet& rAttr, bool /*bReplaceAll*/)
{
// bReplaceAll hat hier keinerlei Wirkung
- sal_Bool bMeasure=ISA(SdrView) && ((SdrView*)this)->IsMeasureTool();
- const SfxPoolItem *pPoolItem=NULL;
- if (rAttr.GetItemState(SDRATTR_LAYERID,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- SdrLayerID nLayerId=((const SdrLayerIdItem*)pPoolItem)->GetValue();
- const SdrLayer* pLayer=pMod->GetLayerAdmin().GetLayerPerID(nLayerId);
- if (pLayer!=NULL) {
- if (bMeasure) aMeasureLayer=pLayer->GetName();
- else aAktLayer=pLayer->GetName();
+ const bool bMeasure(static_cast< SdrView* >(this)->IsMeasureTool());
+ const SfxPoolItem *pPoolItem = 0;
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_LAYERID, true, &pPoolItem))
+ {
+ const SdrLayerID nLayerId = SdrLayerID(((const SfxUInt16Item*)pPoolItem)->GetValue());
+ const SdrLayer* pLayer = getSdrModelFromSdrView().GetModelLayerAdmin().GetLayerPerID(nLayerId);
+
+ if(pLayer)
+ {
+ if(bMeasure)
+ {
+ maMeasureLayer = pLayer->GetName();
+ }
+ else
+ {
+ SetActiveLayer(pLayer->GetName());
+ }
}
}
- if (rAttr.GetItemState(SDRATTR_LAYERNAME,sal_True,&pPoolItem)==SFX_ITEM_SET) {
- if (bMeasure) aMeasureLayer=((const SdrLayerNameItem*)pPoolItem)->GetValue();
- else aAktLayer=((const SdrLayerNameItem*)pPoolItem)->GetValue();
+
+ if(SFX_ITEM_SET == rAttr.GetItemState(SDRATTR_LAYERNAME, true, &pPoolItem))
+ {
+ if(bMeasure)
+ {
+ maMeasureLayer = ((const SfxStringItem*)pPoolItem)->GetValue();
+ }
+ else
+ {
+ SetActiveLayer(((const SfxStringItem*)pPoolItem)->GetValue());
+ }
}
}
-void SdrPaintView::MergeNotPersistDefaultAttr(SfxItemSet& rAttr, sal_Bool /*bOnlyHardAttr*/) const
+void SdrPaintView::MergeNotPersistDefaultAttr(SfxItemSet& rAttr, bool /*bOnlyHardAttr*/) const
{
// bOnlyHardAttr hat hier keinerlei Wirkung
- sal_Bool bMeasure=ISA(SdrView) && ((SdrView*)this)->IsMeasureTool();
- const XubString& aNam=bMeasure?aMeasureLayer:aAktLayer;
- rAttr.Put(SdrLayerNameItem(aNam));
- SdrLayerID nLayer=pMod->GetLayerAdmin().GetLayerID(aNam,sal_True);
- if (nLayer!=SDRLAYER_NOTFOUND) {
- rAttr.Put(SdrLayerIdItem(nLayer));
+ const bool bMeasure(static_cast< const SdrView* >(this)->IsMeasureTool());
+ const XubString& aNam = bMeasure ? maMeasureLayer : GetActiveLayer();
+
+ rAttr.Put(SfxStringItem(SDRATTR_LAYERNAME, aNam));
+ const SdrLayerID nLayer(getSdrModelFromSdrView().GetModelLayerAdmin().GetLayerID(aNam, true));
+
+ if(SDRLAYER_NOTFOUND != nLayer)
+ {
+ rAttr.Put(SfxUInt16Item(SDRATTR_LAYERID, nLayer));
}
}
-void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
+void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll)
{
#ifdef DBG_UTIL
{
- sal_Bool bHasEEFeatureItems=sal_False;
+ bool bHasEEFeatureItems=false;
SfxItemIter aIter(rAttr);
const SfxPoolItem* pItem=aIter.FirstItem();
while (!bHasEEFeatureItems && pItem!=NULL) {
if (!IsInvalidItem(pItem)) {
sal_uInt16 nW=pItem->Which();
- if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=sal_True;
+ if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=true;
}
pItem=aIter.NextItem();
}
@@ -1256,108 +1150,142 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
}
}
#endif
- if (bReplaceAll) aDefaultAttr.Set(rAttr);
- else aDefaultAttr.Put(rAttr,sal_False); // FALSE= InvalidItems nicht als Default, sondern als "Loecher" betrachten
+ if(bReplaceAll)
+ {
+ maDefaultAttr.Set(rAttr);
+ }
+ else
+ {
+ maDefaultAttr.Put(rAttr, false); // false= InvalidItems nicht als Default, sondern als "Loecher" betrachten
+ }
+
SetNotPersistDefaultAttr(rAttr,bReplaceAll);
+
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
}
-void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
- if (pDefaultStyleSheet)
- EndListening(*pDefaultStyleSheet);
- pDefaultStyleSheet=pStyleSheet;
- if (pDefaultStyleSheet)
- StartListening(*pDefaultStyleSheet);
+ if (GetDefaultStyleSheet())
+ {
+ EndListening(*GetDefaultStyleSheet());
+ }
+
+ mpDefaultStyleSheet = pStyleSheet;
+
+ if (GetDefaultStyleSheet())
+ {
+ StartListening(*GetDefaultStyleSheet());
+ }
- if (pStyleSheet!=NULL && !bDontRemoveHardAttr) {
+ if(pStyleSheet && !bDontRemoveHardAttr)
+ {
SfxWhichIter aIter(pStyleSheet->GetItemSet());
sal_uInt16 nWhich=aIter.FirstWhich();
- while (nWhich!=0) {
- if (pStyleSheet->GetItemSet().GetItemState(nWhich,sal_True)==SFX_ITEM_SET) {
- aDefaultAttr.ClearItem(nWhich);
+
+ while(nWhich)
+ {
+ if(SFX_ITEM_SET == pStyleSheet->GetItemSet().GetItemState(nWhich, true))
+ {
+ maDefaultAttr.ClearItem(nWhich);
}
+
nWhich=aIter.NextWhich();
}
}
+
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
}
/* new interface src537 */
-sal_Bool SdrPaintView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const
+bool SdrPaintView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
{
- if(bOnlyHardAttr || !pDefaultStyleSheet)
+ if(bOnlyHardAttr || !GetDefaultStyleSheet())
{
- rTargetSet.Put(aDefaultAttr, sal_False);
+ rTargetSet.Put(GetDefaultAttr(), false);
}
else
{
// sonst DefStyleSheet dazumergen
- rTargetSet.Put(pDefaultStyleSheet->GetItemSet(), sal_False);
- rTargetSet.Put(aDefaultAttr, sal_False);
+ rTargetSet.Put(GetDefaultStyleSheet()->GetItemSet(), false);
+ rTargetSet.Put(GetDefaultAttr(), false);
}
+
MergeNotPersistDefaultAttr(rTargetSet, bOnlyHardAttr);
- return sal_True;
+
+ return true;
}
-sal_Bool SdrPaintView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll)
+bool SdrPaintView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
SetDefaultAttr(rSet,bReplaceAll);
- return sal_True;
+
+ return true;
}
-SfxStyleSheet* SdrPaintView::GetStyleSheet() const // SfxStyleSheet* SdrPaintView::GetStyleSheet(sal_Bool& rOk) const
+SfxStyleSheet* SdrPaintView::GetStyleSheet() const // SfxStyleSheet* SdrPaintView::GetStyleSheet(bool& rOk) const
{
- //rOk=sal_True;
return GetDefaultStyleSheet();
}
-sal_Bool SdrPaintView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr)
+bool SdrPaintView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr)
{
SetDefaultStyleSheet(pStyleSheet,bDontRemoveHardAttr);
- return sal_True;
+
+ return true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef DBG_UTIL
-void SdrPaintView::ShowItemBrowser(sal_Bool bShow)
+void SdrPaintView::ShowItemBrowser(bool bShow)
{
if (bShow) {
- if (pItemBrowser==NULL) {
- pItemBrowser=new SdrItemBrowser(*(SdrView*)this);
- pItemBrowser->SetFloatingMode(sal_True);
+ if (!GetItemBrowser()) {
+ mpItemBrowser = new SdrItemBrowser(*getAsSdrView());
+ mpItemBrowser->SetFloatingMode(true);
}
- pItemBrowser->Show();
- pItemBrowser->GrabFocus();
+ mpItemBrowser->Show();
+ mpItemBrowser->GrabFocus();
} else {
- if (pItemBrowser!=NULL) {
- pItemBrowser->Hide();
- delete pItemBrowser;
- pItemBrowser=NULL;
+ if (GetItemBrowser()) {
+ mpItemBrowser->Hide();
+ delete mpItemBrowser;
+ mpItemBrowser = 0;
}
}
}
#endif
-void SdrPaintView::MakeVisible(const Rectangle& rRect, Window& rWin)
+void SdrPaintView::MakeVisibleAtView(const basegfx::B2DRange& rRange, Window& rWin)
{
- MapMode aMap(rWin.GetMapMode());
Size aActualSize(rWin.GetOutputSize());
if( aActualSize.Height() > 0 && aActualSize.Width() > 0 )
{
- Size aNewSize(rRect.GetSize());
- sal_Bool bNewScale=sal_False;
- sal_Bool bNeedMoreX=aNewSize.Width()>aActualSize.Width();
- sal_Bool bNeedMoreY=aNewSize.Height()>aActualSize.Height();
- if (bNeedMoreX || bNeedMoreY)
+ const Rectangle aRect(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY()));
+
+ Size aNewSize(aRect.GetSize());
+ MapMode aMap(rWin.GetMapMode());
+
+ const bool bNeedMoreX(aNewSize.Width() > aActualSize.Width());
+ const bool bNeedMoreY(aNewSize.Height() > aActualSize.Height());
+ const bool bNewScale(bNeedMoreX || bNeedMoreY);
+
+ if(bNewScale)
{
- bNewScale=sal_True;
// Neuen MapMode (Size+Org) setzen und dabei alles invalidieren
Fraction aXFact(aNewSize.Width(),aActualSize.Width());
Fraction aYFact(aNewSize.Height(),aActualSize.Height());
@@ -1369,24 +1297,32 @@ void SdrPaintView::MakeVisible(const Rectangle& rRect, Window& rWin)
rWin.SetMapMode(aMap);
aActualSize=rWin.GetOutputSize();
}
+
Point aOrg(aMap.GetOrigin());
long dx=0,dy=0;
long l=-aOrg.X();
long r=-aOrg.X()+aActualSize.Width()-1;
long o=-aOrg.Y();
long u=-aOrg.Y()+aActualSize.Height()-1;
- if (l>rRect.Left()) dx=rRect.Left()-l;
- else if (r<rRect.Right()) dx=rRect.Right()-r;
- if (o>rRect.Top()) dy=rRect.Top()-o;
- else if (u<rRect.Bottom()) dy=rRect.Bottom()-u;
+
+ if (l>aRect.Left()) dx=aRect.Left()-l;
+ else if (r<aRect.Right()) dx=aRect.Right()-r;
+ if (o>aRect.Top()) dy=aRect.Top()-o;
+ else if (u<aRect.Bottom()) dy=aRect.Bottom()-u;
+
aMap.SetOrigin(Point(aOrg.X()-dx,aOrg.Y()-dy));
- if (!bNewScale) {
- if (dx!=0 || dy!=0) {
+
+ if (!bNewScale)
+ {
+ if (dx!=0 || dy!=0)
+ {
rWin.Scroll(-dx,-dy);
rWin.SetMapMode(aMap);
rWin.Update();
}
- } else {
+ }
+ else
+ {
rWin.SetMapMode(aMap);
InvalidateOneWin(rWin);
}
@@ -1397,16 +1333,16 @@ void SdrPaintView::DoConnect(SdrOle2Obj* /*pOleObj*/)
{
}
-void SdrPaintView::SetAnimationEnabled( sal_Bool bEnable )
+void SdrPaintView::SetAnimationEnabled( bool bEnable )
{
SetAnimationMode( bEnable ? SDR_ANIMATION_ANIMATE : SDR_ANIMATION_DISABLE );
}
void SdrPaintView::SetAnimationPause( bool bSet )
{
- if((bool)bAnimationPause != bSet)
+ if(mbAnimationPause != bSet)
{
- bAnimationPause = bSet;
+ mbAnimationPause = bSet;
if(mpPageView)
{
@@ -1427,7 +1363,10 @@ void SdrPaintView::SetAnimationPause( bool bSet )
void SdrPaintView::SetAnimationMode( const SdrAnimationMode eMode )
{
- eAnimationMode = eMode;
+ if(meAnimationMode != eMode)
+ {
+ meAnimationMode = eMode;
+ }
}
void SdrPaintView::VisAreaChanged(const OutputDevice* pOut)
@@ -1440,25 +1379,19 @@ void SdrPaintView::VisAreaChanged(const OutputDevice* pOut)
if(pWindow)
{
- VisAreaChanged(*pWindow);
+ Broadcast(SvxViewHint(SvxViewHint::SVX_HINT_VIEWCHANGED));
}
}
else
{
- for(sal_uInt32 a(0L); a < mpPageView->PageWindowCount(); a++)
+ if(mpPageView->PageWindowCount())
{
- VisAreaChanged(*mpPageView->GetPageWindow(a));
+ Broadcast(SvxViewHint(SvxViewHint::SVX_HINT_VIEWCHANGED));
}
}
}
}
-void SdrPaintView::VisAreaChanged(const SdrPageWindow& /*rWindow*/)
-{
- // notify SfxListener
- Broadcast(SvxViewHint(SvxViewHint::SVX_HINT_VIEWCHANGED));
-}
-
const svtools::ColorConfig& SdrPaintView::getColorConfig() const
{
return maColorConfig;
@@ -1506,7 +1439,7 @@ bool SdrPaintView::IsBufferedOutputAllowed() const
// #114898#
void SdrPaintView::SetBufferedOutputAllowed(bool bNew)
{
- if(bNew != (bool)mbBufferedOutputAllowed)
+ if(bNew != mbBufferedOutputAllowed)
{
mbBufferedOutputAllowed = bNew;
}
@@ -1519,20 +1452,20 @@ bool SdrPaintView::IsBufferedOverlayAllowed() const
void SdrPaintView::SetBufferedOverlayAllowed(bool bNew)
{
- if(bNew != (bool)mbBufferedOverlayAllowed)
+ if(bNew != mbBufferedOverlayAllowed)
{
mbBufferedOverlayAllowed = bNew;
}
}
-sal_Bool SdrPaintView::IsPagePaintingAllowed() const
+bool SdrPaintView::IsPagePaintingAllowed() const
{
return mbPagePaintingAllowed;
}
void SdrPaintView::SetPagePaintingAllowed(bool bNew)
{
- if(bNew != (bool)mbPagePaintingAllowed)
+ if(bNew != mbPagePaintingAllowed)
{
mbPagePaintingAllowed = bNew;
}
@@ -1543,15 +1476,42 @@ void SdrPaintView::SetAnimationTimer(sal_uInt32 nTime)
{
if(mpPageView)
{
- // first, reset all timers at all windows to 0L
- for(sal_uInt32 a(0L); a < mpPageView->PageWindowCount(); a++)
+ // first, reset all timers at all windows to 0
+ for(sal_uInt32 a(0); a < mpPageView->PageWindowCount(); a++)
{
const SdrPageWindow& rPageWindow = *mpPageView->GetPageWindow(a);
sdr::contact::ObjectContact& rObjectContact = rPageWindow.GetObjectContact();
sdr::animation::primitiveAnimator& rAnimator = rObjectContact.getPrimitiveAnimator();
+
rAnimator.SetTime(nTime);
}
}
}
+double SdrPaintView::getHitTolLog() const
+{
+ if(GetActualOutDev())
+ {
+ return basegfx::B2DVector(GetActualOutDev()->GetInverseViewTransformation() * basegfx::B2DVector(mfHitTolPix, 0.0)).getLength();
+ }
+
+ return 0.0;
+}
+
+double SdrPaintView::getMinMovLog() const
+{
+ if(GetActualOutDev())
+ {
+ return basegfx::B2DVector(GetActualOutDev()->GetInverseViewTransformation() * basegfx::B2DVector(mfMinMovPix, 0.0)).getLength();
+ }
+
+ return 0.0;
+}
+
+void SdrPaintView::handleSelectionChange()
+{
+ // nothing to do in base class
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx
index 482f54808d71..761872f74d23 100644
--- a/svx/source/svdraw/svdpoev.cxx
+++ b/svx/source/svdraw/svdpoev.cxx
@@ -36,30 +36,19 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <vcl/salbtype.hxx> // FRound
-
#include <svx/polypolygoneditor.hxx>
using namespace sdr;
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrPolyEditView::ImpResetPolyPossibilityFlags()
-{
- eMarkedPointsSmooth=SDRPATHSMOOTH_DONTCARE;
- eMarkedSegmentsKind=SDRPATHSEGMENT_DONTCARE;
- bSetMarkedPointsSmoothPossible=sal_False;
- bSetMarkedSegmentsKindPossible=sal_False;
-}
-
-void SdrPolyEditView::ImpClearVars()
-{
- ImpResetPolyPossibilityFlags();
-}
-
-SdrPolyEditView::SdrPolyEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrEditView(pModel1,pOut)
+SdrPolyEditView::SdrPolyEditView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrEditView(rModel1, pOut),
+ mbSetMarkedPointsSmoothPossible(false),
+ mbSetMarkedSegmentsKindPossible(false),
+ meMarkedPointsSmooth(SDRPATHSMOOTH_DONTCARE),
+ meMarkedSegmentsKind(SDRPATHSEGMENT_DONTCARE)
{
- ImpClearVars();
}
SdrPolyEditView::~SdrPolyEditView()
@@ -68,10 +57,12 @@ SdrPolyEditView::~SdrPolyEditView()
void SdrPolyEditView::ImpCheckPolyPossibilities()
{
- ImpResetPolyPossibilityFlags();
- const sal_uIntPtr nMarkAnz(GetMarkedObjectCount());
+ mbSetMarkedPointsSmoothPossible = false;
+ mbSetMarkedSegmentsKindPossible = false;
+ meMarkedPointsSmooth = SDRPATHSMOOTH_DONTCARE;
+ meMarkedSegmentsKind = SDRPATHSEGMENT_DONTCARE;
- if(nMarkAnz && !ImpIsFrameHandles())
+ if(areSdrObjectsSelected() && !ImpIsFrameHandles())
{
bool b1stSmooth(true);
bool b1stSegm(true);
@@ -79,106 +70,119 @@ void SdrPolyEditView::ImpCheckPolyPossibilities()
bool bSmoothFuz(false);
bool bSegmFuz(false);
basegfx::B2VectorContinuity eSmooth = basegfx::CONTINUITY_NONE;
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for(sal_uIntPtr nMarkNum(0L); nMarkNum < nMarkAnz; nMarkNum++)
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size(); nMarkNum++)
{
- SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
- CheckPolyPossibilitiesHelper( pM, b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth );
+ const SdrPathObj* pPath = dynamic_cast< const SdrPathObj* >(aSelection[nMarkNum]);
+
+ if(pPath)
+ {
+ const sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*pPath));
+
+ if(aMarkedPoints.size())
+ {
+ CheckPolyPossibilitiesHelper(
+ *pPath,
+ aMarkedPoints,
+ b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth);
+ }
+ }
}
}
}
-void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmooth, bool& b1stSegm, bool& bCurve, bool& bSmoothFuz, bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth )
+void SdrPolyEditView::CheckPolyPossibilitiesHelper(
+ const SdrPathObj& rMarkedSdrPathObj,
+ const sdr::selection::Indices& rMarkedPoints,
+ bool& b1stSmooth, bool& b1stSegm, bool& bCurve,
+ bool& bSmoothFuz, bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth)
{
- SdrObject* pObj = pM->GetMarkedSdrObj();
- SdrUShortCont* pPts = pM->GetMarkedPoints();
- SdrPathObj* pPath = PTR_CAST(SdrPathObj,pObj);
+ const sal_uInt32 nMarkedPntAnz(rMarkedPoints.size());
- if(pPath && pPts)
+ if(nMarkedPntAnz)
{
- const sal_uInt32 nMarkedPntAnz(pPts->GetCount());
+ const bool bClosed(rMarkedSdrPathObj.isClosed());
+ mbSetMarkedPointsSmoothPossible = true;
- if(nMarkedPntAnz)
+ if(bClosed)
{
- bool bClosed(pPath->IsClosed());
- bSetMarkedPointsSmoothPossible = true;
+ mbSetMarkedSegmentsKindPossible = true;
+ }
- if(bClosed)
- {
- bSetMarkedSegmentsKindPossible = true;
- }
+ const basegfx::B2DPolyPolygon aMarkedPolyPolygon(rMarkedSdrPathObj.getB2DPolyPolygonInObjectCoordinates());
- for(sal_uInt32 nMarkedPntNum(0L); nMarkedPntNum < nMarkedPntAnz; nMarkedPntNum++)
+ for(sdr::selection::Indices::iterator aCurrent(rMarkedPoints.begin());
+ aCurrent != rMarkedPoints.end(); aCurrent++)
+ {
+ sal_uInt32 nNum(*aCurrent);
+ sal_uInt32 nPolyNum, nPntNum;
+
+ if(PolyPolygonEditor::GetRelativePolyPoint(aMarkedPolyPolygon, nNum, nPolyNum, nPntNum))
{
- sal_uInt32 nNum(pPts->GetObject(nMarkedPntNum));
- sal_uInt32 nPolyNum, nPntNum;
+ const basegfx::B2DPolygon aLocalPolygon(aMarkedPolyPolygon.getB2DPolygon(nPolyNum));
+ bool bCanSegment(bClosed || nPntNum < aLocalPolygon.count() - 1L);
- if(PolyPolygonEditor::GetRelativePolyPoint(pPath->GetPathPoly(), nNum, nPolyNum, nPntNum))
+ if(!mbSetMarkedSegmentsKindPossible && bCanSegment)
{
- const basegfx::B2DPolygon aLocalPolygon(pPath->GetPathPoly().getB2DPolygon(nPolyNum));
- bool bCanSegment(bClosed || nPntNum < aLocalPolygon.count() - 1L);
+ mbSetMarkedSegmentsKindPossible = true;
+ }
- if(!bSetMarkedSegmentsKindPossible && bCanSegment)
+ if(!bSmoothFuz)
+ {
+ if (b1stSmooth)
{
- bSetMarkedSegmentsKindPossible = true;
+ b1stSmooth = false;
+ eSmooth = basegfx::tools::getContinuityInPoint(aLocalPolygon, nPntNum);
}
+ else
+ {
+ bSmoothFuz = (eSmooth != basegfx::tools::getContinuityInPoint(aLocalPolygon, nPntNum));
+ }
+ }
- if(!bSmoothFuz)
+ if(!bSegmFuz)
+ {
+ if(bCanSegment)
{
- if (b1stSmooth)
+ bool bCrv(aLocalPolygon.isNextControlPointUsed(nPntNum));
+
+ if(b1stSegm)
{
- b1stSmooth = false;
- eSmooth = basegfx::tools::getContinuityInPoint(aLocalPolygon, nPntNum);
+ b1stSegm = false;
+ bCurve = bCrv;
}
else
{
- bSmoothFuz = (eSmooth != basegfx::tools::getContinuityInPoint(aLocalPolygon, nPntNum));
- }
- }
-
- if(!bSegmFuz)
- {
- if(bCanSegment)
- {
- bool bCrv(aLocalPolygon.isNextControlPointUsed(nPntNum));
-
- if(b1stSegm)
- {
- b1stSegm = false;
- bCurve = bCrv;
- }
- else
- {
- bSegmFuz = (bCrv != bCurve);
- }
+ bSegmFuz = (bCrv != bCurve);
}
}
}
}
+ }
- if(!b1stSmooth && !bSmoothFuz)
+ if(!b1stSmooth && !bSmoothFuz)
+ {
+ if(basegfx::CONTINUITY_NONE == eSmooth)
{
- if(basegfx::CONTINUITY_NONE == eSmooth)
- {
- eMarkedPointsSmooth = SDRPATHSMOOTH_ANGULAR;
- }
-
- if(basegfx::CONTINUITY_C1 == eSmooth)
- {
- eMarkedPointsSmooth = SDRPATHSMOOTH_ASYMMETRIC;
- }
+ meMarkedPointsSmooth = SDRPATHSMOOTH_ANGULAR;
+ }
- if(basegfx::CONTINUITY_C2 == eSmooth)
- {
- eMarkedPointsSmooth = SDRPATHSMOOTH_SYMMETRIC;
- }
+ if(basegfx::CONTINUITY_C1 == eSmooth)
+ {
+ meMarkedPointsSmooth = SDRPATHSMOOTH_ASYMMETRIC;
}
- if(!b1stSegm && !bSegmFuz)
+ if(basegfx::CONTINUITY_C2 == eSmooth)
{
- eMarkedSegmentsKind = (bCurve) ? SDRPATHSEGMENT_CURVE : SDRPATHSEGMENT_LINE;
+ meMarkedPointsSmooth = SDRPATHSMOOTH_SYMMETRIC;
}
}
+
+ if(!b1stSegm && !bSegmFuz)
+ {
+ meMarkedSegmentsKind = (bCurve) ? SDRPATHSEGMENT_CURVE : SDRPATHSEGMENT_LINE;
+ }
}
}
@@ -205,34 +209,40 @@ void SdrPolyEditView::SetMarkedPointsSmooth(SdrPathSmoothKind eKind)
if(HasMarkedPoints())
{
- SortMarkedObjects();
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- const bool bUndo = IsUndoEnabled();
if( bUndo )
- BegUndo(ImpGetResStr(STR_EditSetPointsSmooth), GetDescriptionOfMarkedPoints());
- sal_uIntPtr nMarkAnz(GetMarkedObjectCount());
+ {
+ BegUndo(ImpGetResStr(STR_EditSetPointsSmooth), getSelectedPointsDescription());
+ }
- for(sal_uIntPtr nMarkNum(nMarkAnz); nMarkNum > 0L;)
+ for(sal_uInt32 nMarkNum(aSelection.size()); nMarkNum > 0;)
{
nMarkNum--;
- SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
- SdrUShortCont* pPts = pM->GetMarkedPoints();
- SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() );
+ const sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*aSelection[nMarkNum]));
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(aSelection[nMarkNum]);
- if(pPts && pPath)
+ if(aMarkedPoints.size() && pPath)
{
- PolyPolygonEditor aEditor( pPath->GetPathPoly(), pPath->IsClosed() );
- if(aEditor.SetPointsSmooth( eFlags, pPts->getContainer() ) )
+ basegfx::B2DPolyPolygon aPolyPolygon(pPath->getB2DPolyPolygonInObjectCoordinates());
+
+ if(sdr::PolyPolygonEditor::SetPointsSmooth(aPolyPolygon, eFlags, aMarkedPoints))
{
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
- pPath->SetPathPoly(aEditor.GetPolyPolygon());
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
+ }
+
+ pPath->setB2DPolyPolygonInObjectCoordinates(aPolyPolygon);
}
}
}
if( bUndo )
+ {
EndUndo();
+ }
}
}
@@ -240,108 +250,125 @@ void SdrPolyEditView::SetMarkedSegmentsKind(SdrPathSegmentKind eKind)
{
if(HasMarkedPoints())
{
- SortMarkedObjects();
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- const bool bUndo = IsUndoEnabled();
if( bUndo )
- BegUndo(ImpGetResStr(STR_EditSetSegmentsKind), GetDescriptionOfMarkedPoints());
- sal_uIntPtr nMarkAnz(GetMarkedObjectCount());
+ {
+ BegUndo(ImpGetResStr(STR_EditSetSegmentsKind), getSelectedPointsDescription());
+ }
- for(sal_uIntPtr nMarkNum(nMarkAnz); nMarkNum > 0L;)
+ for(sal_uInt32 nMarkNum(aSelection.size()); nMarkNum > 0;)
{
nMarkNum--;
- SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
- SdrUShortCont* pPts = pM->GetMarkedPoints();
- SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() );
+ const sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*aSelection[nMarkNum]));
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(aSelection[nMarkNum]);
- if(pPts && pPath)
+ if(aMarkedPoints.size() && pPath)
{
- PolyPolygonEditor aEditor( pPath->GetPathPoly(), pPath->IsClosed() );
- if(aEditor.SetSegmentsKind( eKind, pPts->getContainer()) )
+ basegfx::B2DPolyPolygon aPolyPolygon(pPath->getB2DPolyPolygonInObjectCoordinates());
+
+ if(sdr::PolyPolygonEditor::SetSegmentsKind(aPolyPolygon, eKind, aMarkedPoints))
{
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
- pPath->SetPathPoly(aEditor.GetPolyPolygon());
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
+ }
+
+ pPath->setB2DPolyPolygonInObjectCoordinates(aPolyPolygon);
}
}
}
if( bUndo )
+ {
EndUndo();
+ }
}
}
-sal_Bool SdrPolyEditView::IsSetMarkedPointsSmoothPossible() const
+bool SdrPolyEditView::IsSetMarkedPointsSmoothPossible() const
{
ForcePossibilities();
- return bSetMarkedPointsSmoothPossible;
+
+ return mbSetMarkedPointsSmoothPossible;
}
SdrPathSmoothKind SdrPolyEditView::GetMarkedPointsSmooth() const
{
ForcePossibilities();
- return eMarkedPointsSmooth;
+
+ return meMarkedPointsSmooth;
}
-sal_Bool SdrPolyEditView::IsSetMarkedSegmentsKindPossible() const
+bool SdrPolyEditView::IsSetMarkedSegmentsKindPossible() const
{
ForcePossibilities();
- return bSetMarkedSegmentsKindPossible;
+
+ return mbSetMarkedSegmentsKindPossible;
}
SdrPathSegmentKind SdrPolyEditView::GetMarkedSegmentsKind() const
{
ForcePossibilities();
- return eMarkedSegmentsKind;
+
+ return meMarkedSegmentsKind;
}
-sal_Bool SdrPolyEditView::IsDeleteMarkedPointsPossible() const
+bool SdrPolyEditView::IsDeleteMarkedPointsPossible() const
{
return HasMarkedPoints();
}
void SdrPolyEditView::DeleteMarkedPoints()
{
- if (HasMarkedPoints())
+ if(HasMarkedPoints() && GetSdrPageView())
{
BrkAction();
- SortMarkedObjects();
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
if( bUndo )
{
// Description
- BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_DELETE);
+ BegUndo(ImpGetResStr(STR_EditDelete), getSelectedPointsDescription(), SDRREPFUNC_OBJ_DELETE);
}
- for (sal_uIntPtr nMarkNum=nMarkAnz; nMarkNum>0;)
+ for(sal_uInt32 nMarkNum(aSelection.size()); nMarkNum > 0;)
{
nMarkNum--;
- SdrMark* pM=GetSdrMarkByIndex(nMarkNum);
- SdrUShortCont* pPts=pM->GetMarkedPoints();
- SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pM->GetMarkedSdrObj() );
+ const sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*aSelection[nMarkNum]));
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(aSelection[nMarkNum]);
- if( pPath && pPts )
+ if(pPath && aMarkedPoints.size())
{
- PolyPolygonEditor aEditor( pPath ->GetPathPoly(), pPath->IsClosed() );
- if( aEditor.DeletePoints( pPts->getContainer() ) )
+ basegfx::B2DPolyPolygon aPolyPolygon(pPath->getB2DPolyPolygonInObjectCoordinates());
+
+ if(sdr::PolyPolygonEditor::DeletePoints(aPolyPolygon, aMarkedPoints))
{
- if( aEditor.GetPolyPolygon().count() )
+ if(aPolyPolygon.count())
{
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPath ));
- pPath->SetPathPoly( aEditor.GetPolyPolygon() );
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
+ }
+
+ pPath->setB2DPolyPolygonInObjectCoordinates(aPolyPolygon);
}
else
{
if( bUndo )
- AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pPath ) );
- pM->GetPageView()->GetObjList()->RemoveObject(pPath->GetOrdNum());
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoDeleteObject(*pPath));
+ }
+
+ GetSdrPageView()->GetCurrentObjectList()->RemoveObjectFromSdrObjList(pPath->GetNavigationPosition());
+
if( !bUndo )
{
SdrObject* pObj = pPath;
- SdrObject::Free(pObj);
+ deleteSdrObjectSafeAndClearPointer(pObj);
}
}
}
@@ -349,67 +376,79 @@ void SdrPolyEditView::DeleteMarkedPoints()
}
if( bUndo )
+ {
EndUndo();
- UnmarkAllPoints();
- MarkListHasChanged();
+ }
+
+ MarkPoints(0, true); // unmarkall
}
}
void SdrPolyEditView::RipUpAtMarkedPoints()
{
- if(HasMarkedPoints())
+ if(HasMarkedPoints() && GetSdrPageView())
{
- SortMarkedObjects();
- sal_uInt32 nMarkAnz(GetMarkedObjectCount());
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- const bool bUndo = IsUndoEnabled();
if( bUndo )
- BegUndo(ImpGetResStr(STR_EditRipUp), GetDescriptionOfMarkedPoints());
+ {
+ BegUndo(ImpGetResStr(STR_EditRipUp), getSelectedPointsDescription());
+ }
- for(sal_uInt32 nMarkNum(nMarkAnz); nMarkNum > 0L;)
+ for(sal_uInt32 nMarkNum(aSelection.size()); nMarkNum > 0;)
{
nMarkNum--;
- SdrMark* pM = GetSdrMarkByIndex(nMarkNum);
- SdrUShortCont* pPts = pM->GetMarkedPoints();
- SdrPathObj* pObj = PTR_CAST(SdrPathObj, pM->GetMarkedSdrObj());
+ sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*aSelection[nMarkNum]));
+ bool bMarkedPointsChanged(false);
+ SdrPathObj* pObj = dynamic_cast< SdrPathObj* >(aSelection[nMarkNum]);
- if(pPts && pObj)
+ if(aMarkedPoints.size() && pObj)
{
- pPts->ForceSort();
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
- sal_Bool bKorregFlag(sal_False);
- sal_Bool bInsAny(sal_False);
- sal_uInt32 nMarkPtsAnz(pPts->GetCount());
- sal_uInt32 nMax(pObj->GetHdlCount());
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ }
- for(sal_uInt32 i(nMarkPtsAnz); i > 0L;)
+ bool bKorregFlag(false);
+ bool bInsAny(false);
+ const sal_uInt32 nMax(pObj->getB2DPolyPolygonInObjectCoordinates().allPointCount());
+
+ for(sdr::selection::Indices::reverse_iterator aCurrent(aMarkedPoints.rbegin());
+ aCurrent != aMarkedPoints.rend(); aCurrent++)
{
- i--;
- sal_uInt32 nNewPt0Idx(0L);
- SdrObject* pNeuObj = pObj->RipPoint(pPts->GetObject(i), nNewPt0Idx);
+ sal_uInt32 nNewPt0Idx(0);
+ SdrObject* pNeuObj = pObj->RipPoint(*aCurrent, nNewPt0Idx);
if(pNeuObj)
{
- bInsAny = sal_True;
- SdrInsertReason aReason(SDRREASON_VIEWCALL, pObj);
- pM->GetPageView()->GetObjList()->InsertObject(pNeuObj, pObj->GetOrdNum() + 1, &aReason);
+ bInsAny = true;
+ GetSdrPageView()->GetCurrentObjectList()->InsertObjectToSdrObjList(
+ *pNeuObj,
+ pObj->GetNavigationPosition() + 1);
+
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNeuObj));
- MarkObj(pNeuObj, pM->GetPageView(), sal_False, sal_True);
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pNeuObj));
+ }
+
+ MarkObj(*pNeuObj, false);
}
if(nNewPt0Idx)
{
// Korrektur notwendig?
- DBG_ASSERT(bKorregFlag==sal_False,"Mehrfache Indexkorrektur bei SdrPolyEditView::RipUp()");
+ DBG_ASSERT(bKorregFlag==false,"Mehrfache Indexkorrektur bei SdrPolyEditView::RipUp()");
+
if(!bKorregFlag)
{
- bKorregFlag = sal_True;
+ bKorregFlag = true;
- for(sal_uInt32 nBla(0L); nBla < nMarkPtsAnz; nBla++)
+ for(sdr::selection::Indices::iterator aCorrect(aMarkedPoints.begin());
+ aCorrect != aMarkedPoints.end();)
{
- sal_uInt32 nPntNum(pPts->GetObject(nBla));
+ sal_uInt32 nPntNum(*aCorrect);
+
nPntNum += nNewPt0Idx;
if(nPntNum >= nMax)
@@ -417,57 +456,74 @@ void SdrPolyEditView::RipUpAtMarkedPoints()
nPntNum -= nMax;
}
- pPts->Replace((sal_uInt16)nPntNum, nBla);
+ sdr::selection::Indices::iterator aNext(aCorrect);
+ aNext++;
+ aMarkedPoints.erase(aCorrect);
+ aMarkedPoints.insert(nPntNum);
+ bMarkedPointsChanged = true;
+ aCorrect = aNext;
}
- i = nMarkPtsAnz; // ... und nochmal von vorn
+ // start again
+ aCurrent = aMarkedPoints.rbegin();
}
}
}
}
+
+ if(bMarkedPointsChanged)
+ {
+ setSelectedPointsForSelectedSdrObject(*aSelection[nMarkNum], aMarkedPoints);
+ }
}
- UnmarkAllPoints();
+ MarkPoints(0, true); // unmarkall
+
if( bUndo )
+ {
EndUndo();
- MarkListHasChanged();
+ }
}
}
bool SdrPolyEditView::IsRipUpAtMarkedPointsPossible() const
{
bool bRetval(false);
- const sal_uInt32 nMarkCount(GetMarkedObjectCount());
- for(sal_uInt32 a(0); a < nMarkCount; a++)
+ if(HasMarkedPoints())
{
- const SdrMark* pMark = GetSdrMarkByIndex(a);
- const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- if(pMarkedPathObject)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- const SdrUShortCont* pSelectedPoints = pMark->GetMarkedPoints();
+ const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(aSelection[a]);
- if(pSelectedPoints && pSelectedPoints->GetCount())
+ if(pMarkedPathObject)
{
- const basegfx::B2DPolyPolygon& rPathPolyPolygon = pMarkedPathObject->GetPathPoly();
+ const sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*pMarkedPathObject));
- if(1 == rPathPolyPolygon.count())
+ if(aMarkedPoints.size())
{
- // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
- // are different and methods need to be changed thoroughly with interaction rework
- const Polygon aPathPolygon(rPathPolyPolygon.getB2DPolygon(0));
- const sal_uInt16 nPointCount(aPathPolygon.GetSize());
+ const basegfx::B2DPolyPolygon aPathPolyPolygon = pMarkedPathObject->getB2DPolyPolygonInObjectCoordinates();
- if(nPointCount >= 3)
+ if(1 == aPathPolyPolygon.count())
{
- bRetval = pMarkedPathObject->IsClosedObj(); // #i76617# aPathPolygon.isClosed();
+ // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
+ // are different and methods need to be changed thoroughly with interaction rework
+ const Polygon aPathPolygon(aPathPolyPolygon.getB2DPolygon(0));
+ const sal_uInt32 nPointCount(aPathPolygon.GetSize());
- for(sal_uInt32 b(0); !bRetval && b < pSelectedPoints->GetCount(); b++)
+ if(nPointCount >= 3)
{
- const sal_uInt16 nMarkedPointNum(pSelectedPoints->GetObject(b));
+ bRetval = pMarkedPathObject->IsClosedObj(); // #i76617# aPathPolygon.isClosed();
- bRetval = (nMarkedPointNum > 0 && nMarkedPointNum < nPointCount - 1);
+ for(sdr::selection::Indices::const_iterator aCurrent(aMarkedPoints.begin());
+ !bRetval && aCurrent != aMarkedPoints.end(); aCurrent++)
+ {
+ const sal_uInt32 nMarkedPointNum(*aCurrent);
+
+ bRetval = (nMarkedPointNum > 0 && nMarkedPointNum < nPointCount - 1);
+ }
}
}
}
@@ -481,26 +537,29 @@ bool SdrPolyEditView::IsRipUpAtMarkedPointsPossible() const
bool SdrPolyEditView::IsOpenCloseMarkedObjectsPossible() const
{
bool bRetval(false);
- const sal_uInt32 nMarkCount(GetMarkedObjectCount());
- for(sal_uInt32 a(0); a < nMarkCount; a++)
+ if(areSdrObjectsSelected())
{
- const SdrMark* pMark = GetSdrMarkByIndex(a);
- const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- if(pMarkedPathObject)
+ for(sal_uInt32 a(0); a < aSelection.size(); a++)
{
- // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
- // are different and methods need to be changed thoroughly with interaction rework
- const PolyPolygon aPathPolyPolygon(pMarkedPathObject->GetPathPoly());
- const sal_uInt16 nPolygonCount(aPathPolyPolygon.Count());
+ const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(aSelection[a]);
- for(sal_uInt16 b(0); !bRetval && b < nPolygonCount; b++)
+ if(pMarkedPathObject)
{
- const Polygon& rPathPolygon = aPathPolyPolygon[b];
- const sal_uInt16 nPointCount(rPathPolygon.GetSize());
+ // #i76617# Do not yet use basegfx::B2DPolygon since curve definitions
+ // are different and methods need to be changed thoroughly with interaction rework
+ const PolyPolygon aPathPolyPolygon(pMarkedPathObject->getB2DPolyPolygonInObjectCoordinates());
+ const sal_uInt16 nPolygonCount(aPathPolyPolygon.Count());
+
+ for(sal_uInt16 b(0); !bRetval && b < nPolygonCount; b++)
+ {
+ const Polygon& rPathPolygon = aPathPolyPolygon[b];
+ const sal_uInt16 nPointCount(rPathPolygon.GetSize());
- bRetval = (nPointCount >= 3);
+ bRetval = (nPointCount >= 3);
+ }
}
}
}
@@ -510,232 +569,197 @@ bool SdrPolyEditView::IsOpenCloseMarkedObjectsPossible() const
SdrObjClosedKind SdrPolyEditView::GetMarkedObjectsClosedState() const
{
- bool bOpen(false);
- bool bClosed(false);
- const sal_uInt32 nMarkCount(GetMarkedObjectCount());
-
- for(sal_uInt32 a(0); !(bOpen && bClosed) && a < nMarkCount; a++)
+ if(areSdrObjectsSelected())
{
- const SdrMark* pMark = GetSdrMarkByIndex(a);
- const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(pMark->GetMarkedSdrObj());
+ bool bOpen(false);
+ bool bClosed(false);
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- if(pMarkedPathObject)
+ for(sal_uInt32 a(0); !(bOpen && bClosed) && a < aSelection.size(); a++)
{
- if(pMarkedPathObject->IsClosedObj())
- {
- bClosed = true;
- }
- else
+ const SdrPathObj* pMarkedPathObject = dynamic_cast< const SdrPathObj* >(aSelection[a]);
+
+ if(pMarkedPathObject)
{
- bOpen = true;
+ if(pMarkedPathObject->IsClosedObj())
+ {
+ bClosed = true;
+ }
+ else
+ {
+ bOpen = true;
+ }
}
}
- }
- if(bOpen && bClosed)
- {
- return SDROBJCLOSED_DONTCARE;
- }
- else if(bOpen)
- {
- return SDROBJCLOSED_OPEN;
+ if(bOpen && bClosed)
+ {
+ return SDROBJCLOSED_DONTCARE;
+ }
+ else if(bOpen)
+ {
+ return SDROBJCLOSED_OPEN;
+ }
+ else
+ {
+ return SDROBJCLOSED_CLOSED;
+ }
}
else
{
- return SDROBJCLOSED_CLOSED;
+ return SDROBJCLOSED_DONTCARE;
}
}
-void SdrPolyEditView::ShutMarkedObjects()
+void SdrPolyEditView::CloseMarkedObjects(bool bToggle, bool bOpen)
{
- CloseMarkedObjects();
-}
-
-void SdrPolyEditView::CloseMarkedObjects(sal_Bool bToggle, sal_Bool bOpen) // , long nOpenDistance)
-{
- if (AreObjectsMarked())
+ if(areSdrObjectsSelected())
{
- const bool bUndo = IsUndoEnabled();
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bChg(false);
+
if( bUndo )
- BegUndo(ImpGetResStr(STR_EditShut),GetDescriptionOfMarkedPoints());
+ {
+ BegUndo(ImpGetResStr(STR_EditShut), getSelectedPointsDescription());
+ }
- bool bChg=false;
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pO=pM->GetMarkedSdrObj();
- sal_Bool bClosed=pO->IsClosedObj();
- if (pO->IsPolyObj() && (bClosed==bOpen) || bToggle)
+ SdrObject* pO = aSelection[nm];
+ const bool bClosed(pO->IsClosedObj());
+
+ if(pO->IsPolygonObject() && (bClosed == bOpen) || bToggle)
{
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
+ }
SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >( pO );
+
if(pPathObj)
+ {
pPathObj->ToggleClosed();
+ }
+
bChg=true;
}
}
if( bUndo )
+ {
EndUndo();
+ }
if (bChg)
{
- UnmarkAllPoints();
- MarkListHasChanged();
+ MarkPoints(0, true); // unmarkall
}
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrPolyEditView::ImpCopyMarkedPoints()
+void SdrPolyEditView::TransformMarkedPoints(
+ const basegfx::B2DHomMatrix& rTransformation,
+ const SdrRepeatFunc aRepFunc,
+ bool bCopy)
{
-}
+ // not yet supported
+ bCopy = false;
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ if(HasMarkedPoints() && !rTransformation.isIdentity())
+ {
+ const bool bUndo(IsUndoEnabled());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ XubString aStr;
-void SdrPolyEditView::ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* p1, const void* p2, const void* p3, const void* p4, const void* p5)
-{
- const bool bUndo = IsUndoEnabled();
+ switch(aRepFunc)
+ {
+ default: //case SDRREPFUNC_OBJ_MOVE:
+ aStr = ImpGetResStr(STR_EditMove);
+ break;
+ case SDRREPFUNC_OBJ_RESIZE:
+ aStr = ImpGetResStr(STR_EditResize);
+ break;
+ case SDRREPFUNC_OBJ_ROTATE:
+ aStr = ImpGetResStr(STR_EditResize); // no own string for rotate ?!?
+ break;
+ }
- sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
- for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++)
- {
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- const SdrUShortCont* pPts=pM->GetMarkedPoints();
- sal_uIntPtr nPtAnz=pPts==NULL ? 0 : pPts->GetCount();
- SdrPathObj* pPath=PTR_CAST(SdrPathObj,pObj);
- if (nPtAnz!=0 && pPath!=NULL)
+ if(bCopy)
{
- if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ aStr += ImpGetResStr(STR_EditWithCopy);
+ }
- basegfx::B2DPolyPolygon aXPP(pPath->GetPathPoly());
+ if(bUndo)
+ {
+ BegUndo(aStr, getSelectedPointsDescription(), aRepFunc);
+ }
+
+ if(bCopy)
+ {
+ // no implementation yet
+ OSL_ENSURE(false, "Missing implementation: Copy selected points (!)");
+ }
- for(sal_uInt32 nPtNum(0L); nPtNum < nPtAnz; nPtNum++)
+ for(sal_uInt32 nm(0); nm < aSelection.size(); nm++)
+ {
+ const sdr::selection::Indices aMarkedPoints(getSelectedPointsForSelectedSdrObject(*aSelection[nm]));
+ SdrPathObj* pPath = dynamic_cast< SdrPathObj* >(aSelection[nm]);
+
+ if(aMarkedPoints.size() && pPath)
{
- sal_uInt32 nPt(pPts->GetObject(nPtNum));
- sal_uInt32 nPolyNum, nPointNum;
+ if( bUndo )
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pPath));
+ }
+
+ basegfx::B2DPolyPolygon aXPP(pPath->getB2DPolyPolygonInObjectCoordinates());
- if(PolyPolygonEditor::GetRelativePolyPoint(aXPP, nPt, nPolyNum, nPointNum))
+ for(sdr::selection::Indices::const_iterator aCurrent(aMarkedPoints.begin());
+ aCurrent != aMarkedPoints.end(); aCurrent++)
{
- //#i83671# used nLocalPointNum (which was the polygon point count)
- // instead of the point index (nPointNum). This of course leaded
- // to a wrong point access to the B2DPolygon.
- basegfx::B2DPolygon aNewXP(aXPP.getB2DPolygon(nPolyNum));
- Point aPos, aC1, aC2;
- bool bC1(false);
- bool bC2(false);
-
- const basegfx::B2DPoint aB2DPos(aNewXP.getB2DPoint(nPointNum));
- aPos = Point(FRound(aB2DPos.getX()), FRound(aB2DPos.getY()));
-
- if(aNewXP.isPrevControlPointUsed(nPointNum))
- {
- const basegfx::B2DPoint aB2DC1(aNewXP.getPrevControlPoint(nPointNum));
- aC1 = Point(FRound(aB2DC1.getX()), FRound(aB2DC1.getY()));
- bC1 = true;
- }
+ const sal_uInt32 nPt(*aCurrent);
+ sal_uInt32 nPolyNum, nPointNum;
- if(aNewXP.isNextControlPointUsed(nPointNum))
+ if(PolyPolygonEditor::GetRelativePolyPoint(aXPP, nPt, nPolyNum, nPointNum))
{
- const basegfx::B2DPoint aB2DC2(aNewXP.getNextControlPoint(nPointNum));
- aC2 = Point(FRound(aB2DC2.getX()), FRound(aB2DC2.getY()));
- bC2 = true;
- }
+ //#i83671# used nLocalPointNum (which was the polygon point count)
+ // instead of the point index (nPointNum). This of course leaded
+ // to a wrong point access to the B2DPolygon.
+ basegfx::B2DPolygon aNewXP(aXPP.getB2DPolygon(nPolyNum));
- (*pTrFunc)(aPos,&aC1,&aC2,p1,p2,p3,p4,p5);
- aNewXP.setB2DPoint(nPointNum, basegfx::B2DPoint(aPos.X(), aPos.Y()));
+ // transform single point
+ aNewXP.setB2DPoint(nPointNum, rTransformation * aNewXP.getB2DPoint(nPointNum));
- if (bC1)
- {
- aNewXP.setPrevControlPoint(nPointNum, basegfx::B2DPoint(aC1.X(), aC1.Y()));
- }
+ if(aNewXP.isPrevControlPointUsed(nPointNum))
+ {
+ // transform control point
+ aNewXP.setPrevControlPoint(nPointNum, rTransformation * aNewXP.getPrevControlPoint(nPointNum));
+ }
- if (bC2)
- {
- aNewXP.setNextControlPoint(nPointNum, basegfx::B2DPoint(aC2.X(), aC2.Y()));
- }
+ if(aNewXP.isNextControlPointUsed(nPointNum))
+ {
+ // transform control point
+ aNewXP.setNextControlPoint(nPointNum, rTransformation * aNewXP.getNextControlPoint(nPointNum));
+ }
- aXPP.setB2DPolygon(nPolyNum, aNewXP);
+ aXPP.setB2DPolygon(nPolyNum, aNewXP);
+ }
}
- }
- pPath->SetPathPoly(aXPP);
+ pPath->setB2DPolyPolygonInObjectCoordinates(aXPP);
+ }
}
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-static void ImpMove(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* /*p2*/, const void* /*p3*/, const void* /*p4*/, const void* /*p5*/)
-{
- MovePoint(rPt,*(const Size*)p1);
- if (pC1!=NULL) MovePoint(*pC1,*(const Size*)p1);
- if (pC2!=NULL) MovePoint(*pC2,*(const Size*)p1);
-}
-
-void SdrPolyEditView::MoveMarkedPoints(const Size& rSiz, bool bCopy)
-{
- bCopy=sal_False; // noch nicht implementiert
- ForceUndirtyMrkPnt();
- XubString aStr(ImpGetResStr(STR_EditMove));
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr,GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_MOVE);
- if (bCopy) ImpCopyMarkedPoints();
- ImpTransformMarkedPoints(ImpMove,&rSiz);
- EndUndo();
- AdjustMarkHdl();
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-static void ImpResize(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* p2, const void* p3, const void* /*p4*/, const void* /*p5*/)
-{
- ResizePoint(rPt,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3);
- if (pC1!=NULL) ResizePoint(*pC1,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3);
- if (pC2!=NULL) ResizePoint(*pC2,*(const Point*)p1,*(const Fraction*)p2,*(const Fraction*)p3);
-}
+ if(bUndo)
+ {
+ EndUndo();
+ }
-void SdrPolyEditView::ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy)
-{
- bCopy=sal_False; // noch nicht implementiert
- ForceUndirtyMrkPnt();
- XubString aStr(ImpGetResStr(STR_EditResize));
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr,GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_RESIZE);
- if (bCopy) ImpCopyMarkedPoints();
- ImpTransformMarkedPoints(ImpResize,&rRef,&xFact,&yFact);
- EndUndo();
- AdjustMarkHdl();
+ SetMarkHandles();
+ }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-
-static void ImpRotate(Point& rPt, Point* pC1, Point* pC2, const void* p1, const void* /*p2*/, const void* p3, const void* p4, const void* /*p5*/)
-{
- RotatePoint(rPt,*(const Point*)p1,*(const double*)p3,*(const double*)p4);
- if (pC1!=NULL) RotatePoint(*pC1,*(const Point*)p1,*(const double*)p3,*(const double*)p4);
- if (pC2!=NULL) RotatePoint(*pC2,*(const Point*)p1,*(const double*)p3,*(const double*)p4);
-}
-
-void SdrPolyEditView::RotateMarkedPoints(const Point& rRef, long nWink, bool bCopy)
-{
- bCopy=sal_False; // noch nicht implementiert
- ForceUndirtyMrkPnt();
- XubString aStr(ImpGetResStr(STR_EditResize));
- if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy);
- BegUndo(aStr,GetDescriptionOfMarkedPoints(),SDRREPFUNC_OBJ_ROTATE);
- if (bCopy) ImpCopyMarkedPoints();
- double nSin=sin(nWink*nPi180);
- double nCos=cos(nWink*nPi180);
- ImpTransformMarkedPoints(ImpRotate,&rRef,&nWink,&nSin,&nCos);
- EndUndo();
- AdjustMarkHdl();
-}
-
// eof
diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx
index 03c699bb055c..1d6db7d5af81 100644
--- a/svx/source/svdraw/svdsnpv.cxx
+++ b/svx/source/svdraw/svdsnpv.cxx
@@ -26,21 +26,21 @@
#include <svx/svdsnpv.hxx>
#include <math.h>
-
#include <svx/svdetc.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdpage.hxx>
-#include "svx/svditer.hxx"
+#include <svx/svditer.hxx>
#include <svx/sdr/overlay/overlayobjectlist.hxx>
#include <svx/sdr/overlay/overlaycrosshair.hxx>
#include <svx/sdr/overlay/overlayhelpline.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/svdlegacy.hxx>
#include <svx/sdrpaintwindow.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-// #114409#-1 Migrate PageOrigin
+
class ImplPageOriginOverlay
{
// The OverlayObjects
@@ -103,7 +103,7 @@ void ImplPageOriginOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition)
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-// #114409#-2 Migrate HelpLine
+
class ImplHelpLineOverlay
{
// The OverlayObjects
@@ -114,25 +114,32 @@ class ImplHelpLineOverlay
// HelpLine specific stuff
SdrPageView* mpPageView;
- sal_uInt16 mnHelpLineNumber;
+ sal_uInt32 mnHelpLineNumber;
SdrHelpLineKind meHelpLineKind;
public:
- ImplHelpLineOverlay(const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos,
- SdrPageView* pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind);
+ ImplHelpLineOverlay(
+ const SdrPaintView& rView,
+ const basegfx::B2DPoint& rStartPos,
+ SdrPageView* pPageView,
+ sal_uInt32 nHelpLineNumber,
+ SdrHelpLineKind eKind);
~ImplHelpLineOverlay();
void SetPosition(const basegfx::B2DPoint& rNewPosition);
// access to HelpLine specific stuff
SdrPageView* GetPageView() const { return mpPageView; }
- sal_uInt16 GetHelpLineNumber() const { return mnHelpLineNumber; }
+ sal_uInt32 GetHelpLineNumber() const { return mnHelpLineNumber; }
SdrHelpLineKind GetHelpLineKind() const { return meHelpLineKind; }
};
ImplHelpLineOverlay::ImplHelpLineOverlay(
- const SdrPaintView& rView, const basegfx::B2DPoint& rStartPos,
- SdrPageView* pPageView, sal_uInt16 nHelpLineNumber, SdrHelpLineKind eKind)
+ const SdrPaintView& rView,
+ const basegfx::B2DPoint& rStartPos,
+ SdrPageView* pPageView,
+ sal_uInt32 nHelpLineNumber,
+ SdrHelpLineKind eKind)
: maPosition(rStartPos),
mpPageView(pPageView),
mnHelpLineNumber(nHelpLineNumber),
@@ -183,363 +190,440 @@ void ImplHelpLineOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition)
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@
-// @@@@ @@@@@@ @@@@@@ @@@@@ @@@@@ @@ @@@@ @@@@@@@
-// @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
-// @@@@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrSnapView::ClearVars()
+SdrSnapView::SdrSnapView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrPaintView(rModel1, pOut),
+ mpPageOriginOverlay(0),
+ mpHelpLineOverlay(0),
+// aMagnSiz(),
+ mfSnapWdtX(0.0),
+ mfSnapWdtY(0.0),
+ mnDiscreteMagneticSnap(4),
+ mnSnapAngle(1500),
+ mnEliminatePolyPointLimitAngle(0),
+ meCrookMode(SDRCROOK_ROTATE),
+ mbSnapEnabled(true),
+ mbGridSnap(true),
+ mbBorderSnap(true),
+ mbHelplineSnap(true),
+ mbOFrameSnap(true),
+ mbOPointSnap(false),
+ mbOConnectorSnap(true),
+ mbMoveSnapOnlyTopLeft(false),
+ mbOrthogonal(false),
+ mbBigOrthogonal(true),
+ mbAngleSnap(false),
+ mbMoveOnlyDragging(false),
+ mbSlantButShear(false),
+ mbCrookNoContortion(false),
+ mbHelplinesFixed(false),
+ mbEliminatePolyPoints(false)
{
- nMagnSizPix=4;
- bSnapEnab=sal_True;
- bGridSnap=sal_True;
- bSnapTo1Pix=sal_True;
- bBordSnap=sal_True;
- bHlplSnap=sal_True;
- bOFrmSnap=sal_True;
- bOPntSnap=sal_False;
- bOConSnap=sal_True;
- bMoveMFrmSnap=sal_True;
- bMoveOFrmSnap=sal_True;
- bMoveOPntSnap=sal_True;
- bMoveOConSnap=sal_True;
- bMoveSnapOnlyTopLeft=sal_False;
- bOrtho=sal_False;
- bBigOrtho=sal_True;
- nSnapAngle=1500;
- bAngleSnapEnab=sal_False;
- bMoveOnlyDragging=sal_False;
- bSlantButShear=sal_False;
- bCrookNoContortion=sal_False;
- eCrookMode=SDRCROOK_ROTATE;
- bHlplFixed=sal_False;
- bEliminatePolyPoints=sal_False;
- nEliminatePolyPointLimitAngle=0;
-
- // #114409#-1 Migrate PageOrigin
BrkSetPageOrg();
-
- // #114409#-2 Migrate HelpLine
BrkDragHelpLine();
}
-SdrSnapView::SdrSnapView(SdrModel* pModel1, OutputDevice* pOut):
- SdrPaintView(pModel1,pOut),
- // #114409#-1 Migrate PageOrigin
- mpPageOriginOverlay(0L),
- // #114409#-2 Migrate HelpLine
- mpHelpLineOverlay(0L)
-{
- ClearVars();
-}
-
-// #114409#-1 Migrate PageOrigin
SdrSnapView::~SdrSnapView()
{
- // #114409#-1 Migrate PageOrigin
BrkSetPageOrg();
-
- // #114409#-2 Migrate HelpLine
BrkDragHelpLine();
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrSnapView::IsAction() const
+bool SdrSnapView::IsAction() const
{
- return IsSetPageOrg() || IsDragHelpLine() || SdrPaintView::IsAction();
+ return IsSetPageOrg() || IsDragHelpLine();
}
-void SdrSnapView::MovAction(const Point& rPnt)
+void SdrSnapView::MovAction(const basegfx::B2DPoint& rPnt)
{
- SdrPaintView::MovAction(rPnt);
- if (IsSetPageOrg()) {
+ if (IsSetPageOrg())
+ {
MovSetPageOrg(rPnt);
}
- if (IsDragHelpLine()) {
+
+ if (IsDragHelpLine())
+ {
MovDragHelpLine(rPnt);
}
}
void SdrSnapView::EndAction()
{
- if (IsSetPageOrg()) {
+ if(IsSetPageOrg())
+ {
EndSetPageOrg();
}
- if (IsDragHelpLine()) {
+
+ if (IsDragHelpLine())
+ {
EndDragHelpLine();
}
- SdrPaintView::EndAction();
}
void SdrSnapView::BckAction()
{
BrkSetPageOrg();
BrkDragHelpLine();
- SdrPaintView::BckAction();
}
void SdrSnapView::BrkAction()
{
BrkSetPageOrg();
BrkDragHelpLine();
- SdrPaintView::BrkAction();
}
-void SdrSnapView::TakeActionRect(Rectangle& rRect) const
+basegfx::B2DRange SdrSnapView::TakeActionRange() const
{
- if (IsSetPageOrg() || IsDragHelpLine()) {
- rRect=Rectangle(aDragStat.GetNow(),aDragStat.GetNow());
- } else {
- SdrPaintView::TakeActionRect(rRect);
+ if(IsSetPageOrg() || IsDragHelpLine())
+ {
+ return basegfx::B2DRange(GetDragStat().GetNow());
}
-}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-Point SdrSnapView::GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const
-{
- Point aPt(rPnt);
- SnapPos(aPt,pPV);
- return aPt;
+ return basegfx::B2DRange();
}
-#define NOT_SNAPPED 0x7FFFFFFF
-sal_uInt16 SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const
+namespace
{
- if (!bSnapEnab) return SDRSNAP_NOTSNAPPED;
- sal_Bool bPVOfs=sal_False;
- long x=rPnt.X();
- long y=rPnt.Y();
- if (pPV==NULL) {
- bPVOfs=sal_True;
- pPV=GetSdrPageView();
- if (pPV==NULL) return SDRSNAP_NOTSNAPPED;
+ basegfx::B2DPoint impCheckNewSnapped(
+ const basegfx::B2DPoint& rPnt,
+ const basegfx::B2DPoint& rSnapped,
+ double& rfSmallestDistanceX,
+ double& rfSmallestDistanceY)
+ {
+ basegfx::B2DPoint aRetval(rPnt);
+ const double fNewDistX(fabs(rSnapped.getX() - rPnt.getX()));
+ const double fNewDistY(fabs(rSnapped.getY() - rPnt.getY()));
+
+ if(fNewDistX < rfSmallestDistanceX)
+ {
+ rfSmallestDistanceX = fNewDistX;
+ aRetval.setX(rSnapped.getX());
+ }
+
+ if(fNewDistY < rfSmallestDistanceY)
+ {
+ rfSmallestDistanceY = fNewDistY;
+ aRetval.setY(rSnapped.getY());
+ }
+
+ return aRetval;
}
- long dx=NOT_SNAPPED;
- long dy=NOT_SNAPPED;
- long dx1,dy1;
- long mx=aMagnSiz.Width();
- long my=aMagnSiz.Height();
- if (bHlplVisible && bHlplSnap && !IsDragHelpLine())
+ basegfx::B2DPoint impSnapPos_Helpline(
+ const basegfx::B2DPoint& rPnt,
+ double& rfSmallestDistanceX,
+ double& rfSmallestDistanceY,
+ const SdrHelpLineList& rHelpLineList,
+ const basegfx::B2DVector &rMagneticSnapLogic)
{
- const SdrHelpLineList& rHLL=pPV->GetHelpLines();
- sal_uInt16 nAnz=rHLL.GetCount();
- for (sal_uInt16 i=nAnz; i>0;) {
- i--;
- const SdrHelpLine& rHL=rHLL[i];
- const Point& rPos=rHL.GetPos();
- switch (rHL.GetKind()) {
- case SDRHELPLINE_VERTICAL: {
- long a=x-rPos.X();
- if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; }
- } break;
- case SDRHELPLINE_HORIZONTAL: {
- long b=y-rPos.Y();
- if (Abs(b)<=my) { dy1=-b; if (Abs(dy1)<Abs(dy)) dy=dy1; }
- } break;
- case SDRHELPLINE_POINT: {
- long a=x-rPos.X();
- long b=y-rPos.Y();
- if (Abs(a)<=mx && Abs(b)<=my) {
- dx1=-a; dy1=-b;
- if (Abs(dx1)<Abs(dx) && Abs(dy1)<Abs(dy)) { dx=dx1; dy=dy1; }
- }
- } break;
- } // switch
+ basegfx::B2DPoint aRetval(rPnt);
+ const sal_uInt32 nAnz(rHelpLineList.GetCount());
+
+ for(sal_uInt32 i(0); i < nAnz; i++)
+ {
+ const SdrHelpLine& rHL = rHelpLineList[i];
+
+ if(SDRHELPLINE_VERTICAL == rHL.GetKind())
+ {
+ if(basegfx::fTools::less(fabs(rHL.GetPos().getX() - rPnt.getX()), rMagneticSnapLogic.getX()))
+ {
+ const basegfx::B2DPoint aSnapped(rHL.GetPos().getX(), rPnt.getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+ }
+ else if(SDRHELPLINE_HORIZONTAL == rHL.GetKind())
+ {
+ if(basegfx::fTools::less(fabs(rHL.GetPos().getY() - rPnt.getY()), rMagneticSnapLogic.getY()))
+ {
+ const basegfx::B2DPoint aSnapped(rPnt.getX(), rHL.GetPos().getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+ }
+ else
+ {
+ const basegfx::B2DVector aDiff(absolute(rPnt - rHL.GetPos()));
+
+ if(basegfx::fTools::less(aDiff.getX(), rMagneticSnapLogic.getX()) && basegfx::fTools::less(aDiff.getY(), rMagneticSnapLogic.getY()))
+ {
+ aRetval = impCheckNewSnapped(rPnt, rHL.GetPos(), rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+ }
}
+
+ return aRetval;
}
- if (bBordVisible && bBordSnap) {
- SdrPage* pPage=pPV->GetPage();
- long xs=pPage->GetWdt();
- long ys=pPage->GetHgt();
- long lft=pPage->GetLftBorder();
- long rgt=pPage->GetRgtBorder();
- long upp=pPage->GetUppBorder();
- long lwr=pPage->GetLwrBorder();
- long a;
- a=x- lft ; if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // linker Rand
- a=x-(xs-rgt); if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // rechter Rand
- a=x ; if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // linke Papierkante
- a=x- xs ; if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // rechte Papierkante
- a=y- upp ; if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // linker Rand
- a=y-(ys-lwr); if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // rechter Rand
- a=y ; if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // linke Papierkante
- a=y- ys ; if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // rechte Papierkante
+
+ basegfx::B2DPoint impSnapPos_PageBounds(
+ const basegfx::B2DPoint& rPnt,
+ double& rfSmallestDistanceX,
+ double& rfSmallestDistanceY,
+ const SdrPage& rPage,
+ const basegfx::B2DVector &rMagneticSnapLogic)
+ {
+ basegfx::B2DPoint aRetval(rPnt);
+ const basegfx::B2DRange aPageRange(basegfx::B2DPoint(0.0, 0.0), rPage.GetPageScale());
+
+ // left border
+ if(basegfx::fTools::less(fabs(aPageRange.getMinX() - rPnt.getX()), rMagneticSnapLogic.getX()))
+ {
+ const basegfx::B2DPoint aSnapped(aPageRange.getMinX(), rPnt.getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // right border
+ if(basegfx::fTools::less(fabs(aPageRange.getMaxX() - rPnt.getX()), rMagneticSnapLogic.getX()))
+ {
+ const basegfx::B2DPoint aSnapped(aPageRange.getMaxX(), rPnt.getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // top border
+ if(basegfx::fTools::less(fabs(aPageRange.getMinY() - rPnt.getY()), rMagneticSnapLogic.getY()))
+ {
+ const basegfx::B2DPoint aSnapped(rPnt.getX(), aPageRange.getMinY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // bottom border
+ if(basegfx::fTools::less(fabs(aPageRange.getMaxY() - rPnt.getY()), rMagneticSnapLogic.getY()))
+ {
+ const basegfx::B2DPoint aSnapped(rPnt.getX(), aPageRange.getMaxY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ const basegfx::B2DRange aInnerPageRange(rPage.GetInnerPageRange());
+
+ if(!aPageRange.equal(aInnerPageRange))
+ {
+ // left border
+ if(basegfx::fTools::less(fabs(aInnerPageRange.getMinX() - rPnt.getX()), rMagneticSnapLogic.getX()))
+ {
+ const basegfx::B2DPoint aSnapped(aInnerPageRange.getMinX(), rPnt.getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // right border
+ if(basegfx::fTools::less(fabs(aInnerPageRange.getMaxX() - rPnt.getX()), rMagneticSnapLogic.getX()))
+ {
+ const basegfx::B2DPoint aSnapped(aInnerPageRange.getMaxX(), rPnt.getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // top border
+ if(basegfx::fTools::less(fabs(aInnerPageRange.getMinY() - rPnt.getY()), rMagneticSnapLogic.getY()))
+ {
+ const basegfx::B2DPoint aSnapped(rPnt.getX(), aInnerPageRange.getMinY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // bottom border
+ if(basegfx::fTools::less(fabs(aInnerPageRange.getMaxY() - rPnt.getY()), rMagneticSnapLogic.getY()))
+ {
+ const basegfx::B2DPoint aSnapped(rPnt.getX(), aInnerPageRange.getMaxY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+ }
+
+ return aRetval;
}
- if (bOFrmSnap || bOPntSnap /*|| (bConnVisible && bOConSnap)*/) {
- sal_uIntPtr nMaxPointSnapCount=200;
- sal_uIntPtr nMaxFrameSnapCount=200;
-
- // #97981# go back to IM_DEEPNOGROUPS runthrough for snap to object comparisons
- SdrObjListIter aIter(*pPV->GetPage(),/*IM_FLAT*/IM_DEEPNOGROUPS,sal_True);
-
- while (aIter.IsMore() && (nMaxPointSnapCount>0 || nMaxFrameSnapCount>0)) {
- SdrObject* pO=aIter.Next();
- Rectangle aRect(pO->GetCurrentBoundRect());
- aRect.Left ()-=mx;
- aRect.Right ()+=mx;
- aRect.Top ()-=my;
- aRect.Bottom()+=my;
- if (aRect.IsInside(rPnt)) {
- if (bOPntSnap && nMaxPointSnapCount>0)
+
+ basegfx::B2DPoint impSnapPos_ObjectFrame(
+ const basegfx::B2DPoint& rPnt,
+ double& rfSmallestDistanceX,
+ double& rfSmallestDistanceY,
+ const SdrPage& rPage,
+ const basegfx::B2DVector &rMagneticSnapLogic,
+ bool bOFrameSnap,
+ bool bOPointSnap,
+ const SdrView* pSdrView)
+ {
+ basegfx::B2DPoint aRetval(rPnt);
+ SdrObjListIter aIter(rPage, IM_DEEPNOGROUPS, true);
+
+ while(aIter.IsMore())
+ {
+ const SdrObject* pCandidate = aIter.Next();
+ const basegfx::B2DRange& rCandidateRange = pCandidate->getObjectRange(pSdrView);
+
+ if(!rCandidateRange.isInside(aRetval))
+ {
+ basegfx::B2DRange aCandidateRange(rCandidateRange);
+
+ aCandidateRange.expand(aCandidateRange.getMinimum() - rMagneticSnapLogic);
+ aCandidateRange.expand(aCandidateRange.getMaximum() + rMagneticSnapLogic);
+
+ if(!aCandidateRange.isInside(aRetval))
+ {
+ continue;
+ }
+ }
+
+ if(bOPointSnap)
+ {
+ const sal_uInt32 nAnz(pCandidate->GetSnapPointCount());
+
+ for(sal_uInt32 i(0); i < nAnz; i++)
{
- sal_uInt32 nAnz(pO->GetSnapPointCount());
- for (sal_uInt32 i(0L); i < nAnz && nMaxPointSnapCount > 0L; i++)
+ const basegfx::B2DPoint aTestPoint(pCandidate->GetSnapPoint(i));
+ const basegfx::B2DVector aDiff(absolute(rPnt - aTestPoint));
+
+ if(basegfx::fTools::less(aDiff.getX(), rMagneticSnapLogic.getX()) && basegfx::fTools::less(aDiff.getY(), rMagneticSnapLogic.getY()))
{
- Point aP(pO->GetSnapPoint(i));
- dx1=x-aP.X();
- dy1=y-aP.Y();
- if (Abs(dx1)<=mx && Abs(dy1)<=my && Abs(dx1)<Abs(dx) && Abs(dy1)<Abs(dy)) {
- dx=-dx1;
- dy=-dy1;
- }
- nMaxPointSnapCount--;
+ aRetval = impCheckNewSnapped(rPnt, aTestPoint, rfSmallestDistanceX, rfSmallestDistanceY);
}
}
- if (bOFrmSnap && nMaxFrameSnapCount>0) {
- Rectangle aLog(pO->GetSnapRect());
- Rectangle aR1(aLog);
- aR1.Left ()-=mx;
- aR1.Right ()+=mx;
- aR1.Top ()-=my;
- aR1.Bottom()+=my;
- if (aR1.IsInside(rPnt)) {
- if (Abs(x-aLog.Left ())<=mx) { dx1=-(x-aLog.Left ()); if (Abs(dx1)<Abs(dx)) dx=dx1; }
- if (Abs(x-aLog.Right ())<=mx) { dx1=-(x-aLog.Right ()); if (Abs(dx1)<Abs(dx)) dx=dx1; }
- if (Abs(y-aLog.Top ())<=my) { dy1=-(y-aLog.Top ()); if (Abs(dy1)<Abs(dy)) dy=dy1; }
- if (Abs(y-aLog.Bottom())<=my) { dy1=-(y-aLog.Bottom()); if (Abs(dy1)<Abs(dy)) dy=dy1; }
+ }
+
+ if(bOFrameSnap)
+ {
+ const basegfx::B2DRange aCandidateRange(sdr::legacy::GetSnapRange(*pCandidate));
+ bool bInside(aCandidateRange.isInside(rPnt));
+
+ if(!bInside)
+ {
+ basegfx::B2DRange aGrownCandidateRange(aCandidateRange);
+
+ aGrownCandidateRange.expand(aGrownCandidateRange.getMinimum() - rMagneticSnapLogic);
+ aGrownCandidateRange.expand(aGrownCandidateRange.getMaximum() + rMagneticSnapLogic);
+
+ bInside = aGrownCandidateRange.isInside(rPnt);
+ }
+
+ if(bInside)
+ {
+ // left border
+ if(basegfx::fTools::less(fabs(aCandidateRange.getMinX() - rPnt.getX()), rMagneticSnapLogic.getX()))
+ {
+ const basegfx::B2DPoint aSnapped(aCandidateRange.getMinX(), rPnt.getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // right border
+ if(basegfx::fTools::less(fabs(aCandidateRange.getMaxX() - rPnt.getX()), rMagneticSnapLogic.getX()))
+ {
+ const basegfx::B2DPoint aSnapped(aCandidateRange.getMaxX(), rPnt.getY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // top border
+ if(basegfx::fTools::less(fabs(aCandidateRange.getMinY() - rPnt.getY()), rMagneticSnapLogic.getY()))
+ {
+ const basegfx::B2DPoint aSnapped(rPnt.getX(), aCandidateRange.getMinY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
+ }
+
+ // bottom border
+ if(basegfx::fTools::less(fabs(aCandidateRange.getMaxY() - rPnt.getY()), rMagneticSnapLogic.getY()))
+ {
+ const basegfx::B2DPoint aSnapped(rPnt.getX(), aCandidateRange.getMaxY());
+ aRetval = impCheckNewSnapped(rPnt, aSnapped, rfSmallestDistanceX, rfSmallestDistanceY);
}
- nMaxFrameSnapCount--;
}
}
}
+
+ return aRetval;
}
- if(bGridSnap)
+} // end of anonymous namespace
+
+basegfx::B2DPoint SdrSnapView::GetSnapPos(const basegfx::B2DPoint& rPnt, sal_uInt16* pSnapFlags) const
+{
+ basegfx::B2DPoint aSnapPoint(rPnt);
+ bool bSnappedX(false);
+ bool bSnappedY(false);
+
+ if(GetSdrPageView() && IsSnapEnabled())
{
- double fSnapWidth = aSnapWdtX;
- if(dx == NOT_SNAPPED && fSnapWidth != 0.0)
+ const basegfx::B2DVector aMagneticSnapDiscrete(GetDiscreteMagneticSnap(), GetDiscreteMagneticSnap());
+ const basegfx::B2DVector aMagneticSnapLogic(GetFirstOutputDevice()
+ ? GetFirstOutputDevice()->GetInverseViewTransformation() * aMagneticSnapDiscrete
+ : basegfx::B2DVector(0.0, 0.0));
+ double fSmallestDistanceX(DBL_MAX);
+ double fSmallestDistanceY(DBL_MAX);
+ const SdrHelpLineList& rHelpLineList = GetSdrPageView()->GetHelpLines();
+
+ if(rHelpLineList.GetCount() && IsHlplVisible() && IsHelplineSnap() && !IsDragHelpLine())
{
- double fx = (double)x;
+ aSnapPoint = impSnapPos_Helpline(rPnt, fSmallestDistanceX, fSmallestDistanceY, GetSdrPageView()->GetHelpLines(), aMagneticSnapLogic);
+ }
- // round statt trunc
- if(fx - (double)pPV->GetPageOrigin().X() >= 0.0)
- fx += fSnapWidth / 2.0;
- else
- fx -= fSnapWidth / 2.0;
+ const SdrPage& rPage = GetSdrPageView()->getSdrPageFromSdrPageView();
- x = (long)((fx - (double)pPV->GetPageOrigin().X()) / fSnapWidth);
- x = (long)((double)x * fSnapWidth + (double)pPV->GetPageOrigin().X());
- dx = 0;
+ if(IsBordVisible() && IsBorderSnap())
+ {
+ aSnapPoint = impSnapPos_PageBounds(rPnt, fSmallestDistanceX, fSmallestDistanceY, rPage, aMagneticSnapLogic);
}
- fSnapWidth = aSnapWdtY;
- if(dy == NOT_SNAPPED && fSnapWidth)
+
+ if(IsOFrameSnap() || IsOPointSnap())
{
- double fy = (double)y;
+ aSnapPoint = impSnapPos_ObjectFrame(
+ rPnt,
+ fSmallestDistanceX,
+ fSmallestDistanceY,
+ rPage,
+ aMagneticSnapLogic,
+ IsOFrameSnap(),
+ IsOPointSnap(),
+ getAsSdrView());
+ }
- // round statt trunc
- if(fy - (double)pPV->GetPageOrigin().Y() >= 0.0)
- fy += fSnapWidth / 2.0;
- else
- fy -= fSnapWidth / 2.0;
+ bSnappedX = (DBL_MAX != fSmallestDistanceX);
+ bSnappedY = (DBL_MAX != fSmallestDistanceY);
+
+ if(IsGridSnap() && (!bSnappedX || !bSnappedY))
+ {
+ const basegfx::B2DPoint aUnsnappedGridPos(rPnt - GetSdrPageView()->GetPageOrigin());
+ const basegfx::B2DPoint aSnappedGridPos(
+ bSnappedX ? aUnsnappedGridPos.getX() : basegfx::snapToNearestMultiple(aUnsnappedGridPos.getX(), GetSnapGridWidthX()),
+ bSnappedY ? aUnsnappedGridPos.getY() : basegfx::snapToNearestMultiple(aUnsnappedGridPos.getY(), GetSnapGridWidthY()));
- y = (long)((fy - (double)pPV->GetPageOrigin().Y()) / fSnapWidth);
- y = (long)((double)y * fSnapWidth + (double)pPV->GetPageOrigin().Y());
- dy = 0;
+ aSnapPoint = aSnappedGridPos + GetSdrPageView()->GetPageOrigin();
+ bSnappedX = bSnappedY = true;
}
}
- sal_Bool bRet=SDRSNAP_NOTSNAPPED;
- if (dx==NOT_SNAPPED) dx=0; else bRet|=SDRSNAP_XSNAPPED;
- if (dy==NOT_SNAPPED) dy=0; else bRet|=SDRSNAP_YSNAPPED;
- rPnt.X()=x+dx;
- rPnt.Y()=y+dy;
- return bRet;
-}
-void SdrSnapView::CheckSnap(const Point& rPt, const SdrPageView* pPV, long& nBestXSnap, long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const
-{
- Point aPt(rPt);
- sal_uInt16 nRet=SnapPos(aPt,pPV);
- aPt-=rPt;
- if ((nRet & SDRSNAP_XSNAPPED) !=0) {
- if (bXSnapped) {
- if (Abs(aPt.X())<Abs(nBestXSnap)) {
- nBestXSnap=aPt.X();
- }
- } else {
- nBestXSnap=aPt.X();
- bXSnapped=sal_True;
+ if(pSnapFlags)
+ {
+ *pSnapFlags = SDRSNAP_NOTSNAPPED;
+
+ if(bSnappedX)
+ {
+ *pSnapFlags |= SDRSNAP_XSNAPPED;
}
- }
- if ((nRet & SDRSNAP_YSNAPPED) !=0) {
- if (bYSnapped) {
- if (Abs(aPt.Y())<Abs(nBestYSnap)) {
- nBestYSnap=aPt.Y();
- }
- } else {
- nBestYSnap=aPt.Y();
- bYSnapped=sal_True;
+
+ if(bSnappedY)
+ {
+ *pSnapFlags |= SDRSNAP_YSNAPPED;
}
}
-}
-sal_uInt16 SdrSnapView::SnapRect(const Rectangle& rRect, const SdrPageView* pPV, long& rDX, long& rDY) const
-{
- long nBestXSnap=0;
- long nBestYSnap=0;
- bool bXSnapped=sal_False;
- bool bYSnapped=sal_False;
- CheckSnap(rRect.TopLeft() ,pPV,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
- if (!bMoveSnapOnlyTopLeft) {
- CheckSnap(rRect.TopRight() ,pPV,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
- CheckSnap(rRect.BottomLeft() ,pPV,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
- CheckSnap(rRect.BottomRight(),pPV,nBestXSnap,nBestYSnap,bXSnapped,bYSnapped);
- }
- rDX=nBestXSnap;
- rDY=nBestYSnap;
- sal_uInt16 nRet=0;
- if (bXSnapped) nRet+=SDRSNAP_XSNAPPED;
- if (bYSnapped) nRet+=SDRSNAP_YSNAPPED;
- return nRet;
+ return aSnapPoint;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrSnapView::BegSetPageOrg(const Point& rPnt)
+bool SdrSnapView::BegSetPageOrg(const basegfx::B2DPoint& rPnt)
{
BrkAction();
DBG_ASSERT(0L == mpPageOriginOverlay, "SdrSnapView::BegSetPageOrg: There exists a ImplPageOriginOverlay (!)");
- basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
- mpPageOriginOverlay = new ImplPageOriginOverlay(*this, aStartPos);
- aDragStat.Reset(GetSnapPos(rPnt,NULL));
+ mpPageOriginOverlay = new ImplPageOriginOverlay(*this, rPnt);
+ GetDragStat().Reset(GetSnapPos(rPnt));
- return sal_True;
+ return true;
}
-void SdrSnapView::MovSetPageOrg(const Point& rPnt)
+void SdrSnapView::MovSetPageOrg(const basegfx::B2DPoint& rPnt)
{
if(IsSetPageOrg())
{
- aDragStat.NextMove(GetSnapPos(rPnt,NULL));
+ GetDragStat().NextMove(GetSnapPos(rPnt));
DBG_ASSERT(mpPageOriginOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
- basegfx::B2DPoint aNewPos(aDragStat.GetNow().X(), aDragStat.GetNow().Y());
- mpPageOriginOverlay->SetPosition(aNewPos);
+ mpPageOriginOverlay->SetPosition(GetDragStat().GetNow());
}
}
-sal_Bool SdrSnapView::EndSetPageOrg()
+bool SdrSnapView::EndSetPageOrg()
{
- sal_Bool bRet(sal_False);
+ bool bRet(false);
if(IsSetPageOrg())
{
@@ -547,9 +631,8 @@ sal_Bool SdrSnapView::EndSetPageOrg()
if(pPV)
{
- Point aPnt(aDragStat.GetNow());
- pPV->SetPageOrigin(aPnt);
- bRet = sal_True;
+ pPV->SetPageOrigin(GetDragStat().GetNow());
+ bRet = true;
}
// cleanup
@@ -563,56 +646,54 @@ void SdrSnapView::BrkSetPageOrg()
{
if(IsSetPageOrg())
{
- DBG_ASSERT(mpPageOriginOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
+ DBG_ASSERT(mpPageOriginOverlay, "SdrSnapView::BrkSetPageOrg: no ImplPageOriginOverlay (!)");
delete mpPageOriginOverlay;
- mpPageOriginOverlay = 0L;
+ mpPageOriginOverlay = 0;
}
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-sal_Bool SdrSnapView::PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const
+bool SdrSnapView::PickHelpLine(const basegfx::B2DPoint& rPnt, double fTol, sal_uInt32& rnHelpLineNum) const
{
- rpPV=NULL;
- nTol=ImpGetHitTolLogic(nTol,&rOut);
- SdrPageView* pPV = GetSdrPageView();
-
- if(pPV)
+ if(GetSdrPageView())
{
- Point aPnt(rPnt);
- sal_uInt16 nIndex=pPV->GetHelpLines().HitTest(aPnt,sal_uInt16(nTol),rOut);
- if (nIndex!=SDRHELPLINE_NOTFOUND) {
- rpPV=pPV;
+ const sal_uInt32 nIndex(GetSdrPageView()->GetHelpLines().HLHitTest(rPnt, fTol));
+
+ if(SDRHELPLINE_NOTFOUND != nIndex)
+ {
rnHelpLineNum=nIndex;
- return sal_True;
+
+ return true;
}
}
- return sal_False;
+
+ return false;
}
// start HelpLine drag for new HelpLine
-sal_Bool SdrSnapView::BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV)
+bool SdrSnapView::BegDragHelpLine(sal_uInt16 nHelpLineNum)
{
- sal_Bool bRet(sal_False);
+ bool bRet(false);
- if(!bHlplFixed)
+ if(!AreHelplinesFixed())
{
BrkAction();
- if(pPV && nHelpLineNum < pPV->GetHelpLines().GetCount())
+ if(GetSdrPageView() && nHelpLineNum < GetSdrPageView()->GetHelpLines().GetCount())
{
- const SdrHelpLineList& rHelpLines = pPV->GetHelpLines();
+ const SdrHelpLineList& rHelpLines = GetSdrPageView()->GetHelpLines();
const SdrHelpLine& rHelpLine = rHelpLines[nHelpLineNum];
- Point aHelpLinePos = rHelpLine.GetPos(); // + pPV->GetOffset();
- basegfx::B2DPoint aStartPos(aHelpLinePos.X(), aHelpLinePos.Y());
+ basegfx::B2DPoint aHelpLinePos(rHelpLine.GetPos()); // + GetSdrPageView()->GetOffset();
- DBG_ASSERT(0L == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists a ImplHelpLineOverlay (!)");
- mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, pPV, nHelpLineNum, rHelpLine.GetKind());
+ DBG_ASSERT(0 == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists a ImplHelpLineOverlay (!)");
+ mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aHelpLinePos, GetSdrPageView(), nHelpLineNum, rHelpLine.GetKind());
- aDragStat.Reset(GetSnapPos(aHelpLinePos, pPV));
- aDragStat.SetMinMove(ImpGetMinMovLogic(-3, 0L));
+ GetDragStat().Reset(GetSnapPos(aHelpLinePos));
+ const double fTolerance(GetFirstOutputDevice()
+ ? basegfx::B2DVector(GetFirstOutputDevice()->GetInverseViewTransformation() * basegfx::B2DVector(3.0, 0.0)).getLength()
+ : 0.0);
+ GetDragStat().SetMinMove(fTolerance);
- bRet = sal_True;
+ bRet = true;
}
}
@@ -620,19 +701,18 @@ sal_Bool SdrSnapView::BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV)
}
// start HelpLine drag with existing HelpLine
-sal_Bool SdrSnapView::BegDragHelpLine(const Point& rPnt, SdrHelpLineKind eNewKind)
+bool SdrSnapView::BegDragHelpLine(const basegfx::B2DPoint& rPnt, SdrHelpLineKind eNewKind)
{
- sal_Bool bRet(sal_False);
+ bool bRet(false);
BrkAction();
if(GetSdrPageView())
{
DBG_ASSERT(0L == mpHelpLineOverlay, "SdrSnapView::BegDragHelpLine: There exists a ImplHelpLineOverlay (!)");
- basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
- mpHelpLineOverlay = new ImplHelpLineOverlay(*this, aStartPos, 0L, 0, eNewKind);
- aDragStat.Reset(GetSnapPos(rPnt, 0L));
- bRet = sal_True;
+ mpHelpLineOverlay = new ImplHelpLineOverlay(*this, rPnt, 0, 0, eNewKind);
+ GetDragStat().Reset(GetSnapPos(rPnt));
+ bRet = true;
}
return bRet;
@@ -644,51 +724,52 @@ Pointer SdrSnapView::GetDraggedHelpLinePointer() const
{
switch(mpHelpLineOverlay->GetHelpLineKind())
{
- case SDRHELPLINE_VERTICAL : return Pointer(POINTER_ESIZE);
- case SDRHELPLINE_HORIZONTAL: return Pointer(POINTER_SSIZE);
- default : return Pointer(POINTER_MOVE);
+ case SDRHELPLINE_VERTICAL :
+ return Pointer(POINTER_ESIZE);
+ case SDRHELPLINE_HORIZONTAL :
+ return Pointer(POINTER_SSIZE);
+ default :
+ return Pointer(POINTER_MOVE);
}
}
return Pointer(POINTER_MOVE);
}
-void SdrSnapView::MovDragHelpLine(const Point& rPnt)
+void SdrSnapView::MovDragHelpLine(const basegfx::B2DPoint& rPnt)
{
- if(IsDragHelpLine() && aDragStat.CheckMinMoved(rPnt))
+ if(IsDragHelpLine() && GetDragStat().CheckMinMoved(rPnt))
{
- Point aPnt(GetSnapPos(rPnt, 0L));
+ const basegfx::B2DPoint aPnt(GetSnapPos(rPnt));
- if(aPnt != aDragStat.GetNow())
+ if(!aPnt.equal(GetDragStat().GetNow()))
{
- aDragStat.NextMove(aPnt);
+ GetDragStat().NextMove(aPnt);
DBG_ASSERT(mpHelpLineOverlay, "SdrSnapView::MovDragHelpLine: no ImplHelpLineOverlay (!)");
- basegfx::B2DPoint aNewPos(aDragStat.GetNow().X(), aDragStat.GetNow().Y());
- mpHelpLineOverlay->SetPosition(aNewPos);
+ mpHelpLineOverlay->SetPosition(GetDragStat().GetNow());
}
}
}
-sal_Bool SdrSnapView::EndDragHelpLine()
+bool SdrSnapView::EndDragHelpLine()
{
- sal_Bool bRet(sal_False);
+ bool bRet(false);
if(IsDragHelpLine())
{
- if(aDragStat.IsMinMoved())
+ if(GetDragStat().IsMinMoved())
{
SdrPageView* pPageView = mpHelpLineOverlay->GetPageView();
if(pPageView)
{
// moved existing one
- Point aPnt(aDragStat.GetNow());
const SdrHelpLineList& rHelpLines = pPageView->GetHelpLines();
SdrHelpLine aChangedHelpLine = rHelpLines[mpHelpLineOverlay->GetHelpLineNumber()];
- aChangedHelpLine.SetPos(aPnt);
+ aChangedHelpLine.SetPos(GetDragStat().GetNow());
pPageView->SetHelpLine(mpHelpLineOverlay->GetHelpLineNumber(), aChangedHelpLine);
- bRet = sal_True;
+ bRet = true;
}
else
{
@@ -697,11 +778,10 @@ sal_Bool SdrSnapView::EndDragHelpLine()
if(pPageView)
{
- Point aPnt(aDragStat.GetNow());
- SdrHelpLine aNewHelpLine(mpHelpLineOverlay->GetHelpLineKind(), aPnt);
+ SdrHelpLine aNewHelpLine(mpHelpLineOverlay->GetHelpLineKind(), GetDragStat().GetNow());
pPageView->InsertHelpLine(aNewHelpLine);
- bRet = sal_True;
+ bRet = true;
}
}
}
@@ -723,4 +803,5 @@ void SdrSnapView::BrkDragHelpLine()
}
}
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdsob.cxx b/svx/source/svdraw/svdsob.cxx
new file mode 100644
index 000000000000..5d13c0f8547c
--- /dev/null
+++ b/svx/source/svdraw/svdsob.cxx
@@ -0,0 +1,208 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <com/sun/star/uno/Sequence.hxx>
+#include <svx/svdsob.hxx>
+//#include "svdglob.hxx" // StringCache
+//#include "svdstr.hrc" // Namen aus der Resource
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SetOfByte
+
+bool SetOfByte::IsEmpty() const
+{
+ for(sal_uInt16 i(0); i < 32; i++)
+ {
+ if(aData[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SetOfByte::IsFull() const
+{
+ for(sal_uInt16 i(0); i < 32; i++)
+ {
+ if(aData[i] != 0xFF)
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+sal_uInt16 SetOfByte::GetSetCount() const
+{
+ sal_uInt16 nRet(0);
+
+ for(sal_uInt16 i(0); i < 32; i++)
+ {
+ sal_uInt8 a(aData[i]);
+
+ if(a)
+ {
+ if(a & 0x80) nRet++;
+ if(a & 0x40) nRet++;
+ if(a & 0x20) nRet++;
+ if(a & 0x10) nRet++;
+ if(a & 0x08) nRet++;
+ if(a & 0x04) nRet++;
+ if(a & 0x02) nRet++;
+ if(a & 0x01) nRet++;
+ }
+ }
+
+ return nRet;
+}
+
+sal_uInt8 SetOfByte::GetSetBit(sal_uInt16 nNum) const
+{
+ nNum++;
+ sal_uInt16 i(0), j(0);
+ sal_uInt16 nRet(0);
+
+ while(j < nNum && i < 256)
+ {
+ if(IsSet(sal_uInt8(i)))
+ {
+ j++;
+ }
+
+ i++;
+ }
+
+ if(j == nNum)
+ {
+ nRet = i - 1;
+ }
+
+ return sal_uInt8(nRet);
+}
+
+sal_uInt16 SetOfByte::GetClearCount() const
+{
+ return sal_uInt16(256 - GetSetCount());
+}
+
+sal_uInt8 SetOfByte::GetClearBit(sal_uInt16 nNum) const
+{
+ nNum++;
+ sal_uInt16 i(0), j(0);
+ sal_uInt16 nRet(0);
+
+ while(j < nNum && i < 256)
+ {
+ if(!IsSet(sal_uInt8(i)))
+ {
+ j++;
+ }
+
+ i++;
+ }
+
+ if(j == nNum)
+ {
+ nRet = i - 1;
+ }
+
+ return sal_uInt8(nRet);
+}
+
+void SetOfByte::operator&=(const SetOfByte& r2ndSet)
+{
+ for(sal_uInt16 i(0); i < 32; i++)
+ {
+ aData[i] &= r2ndSet.aData[i];
+ }
+}
+
+void SetOfByte::operator|=(const SetOfByte& r2ndSet)
+{
+ for(sal_uInt16 i(0); i < 32; i++)
+ {
+ aData[i] |= r2ndSet.aData[i];
+ }
+}
+
+/** initialize this set with a uno sequence of sal_Int8
+*/
+void SetOfByte::PutValue( const com::sun::star::uno::Any & rAny )
+{
+ com::sun::star::uno::Sequence< sal_Int8 > aSeq;
+
+ if( rAny >>= aSeq )
+ {
+ sal_Int16 nCount = (sal_Int16)aSeq.getLength();
+
+ if( nCount > 32 )
+ {
+ nCount = 32;
+ }
+
+ sal_Int16 nIndex;
+
+ for( nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ aData[nIndex] = static_cast< sal_uInt8 >(aSeq[nIndex]);
+ }
+
+ for( ; nIndex < 32; nIndex++ )
+ {
+ aData[nIndex] = 0;
+ }
+ }
+}
+
+/** returns a uno sequence of sal_Int8
+*/
+void SetOfByte::QueryValue( com::sun::star::uno::Any & rAny ) const
+{
+ sal_Int16 nNumBytesSet = 0;
+ sal_Int16 nIndex;
+
+ for( nIndex = 31; nIndex >= 00; nIndex-- )
+ {
+ if( 0 != aData[nIndex] )
+ {
+ nNumBytesSet = nIndex + 1;
+ break;
+ }
+ }
+
+ com::sun::star::uno::Sequence< sal_Int8 > aSeq( nNumBytesSet );
+
+ for( nIndex = 0; nIndex < nNumBytesSet; nIndex++ )
+ {
+ aSeq[nIndex] = static_cast<sal_Int8>(aData[nIndex]);
+ }
+
+ rAny <<= aSeq;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src
index 368fa4082520..d94a8c05c197 100644
--- a/svx/source/svdraw/svdstr.src
+++ b/svx/source/svdraw/svdstr.src
@@ -245,18 +245,6 @@ String STR_ObjNameSingulFREELINE
{
Text [ en-US ] = "Freeform Line" ;
};
-String STR_ObjNamePluralFREELINE
-{
- Text [ en-US ] = "Freeform Lines" ;
-};
-String STR_ObjNameSingulFREEFILL
-{
- Text [ en-US ] = "Freeform Line" ;
-};
-String STR_ObjNamePluralFREEFILL
-{
- Text [ en-US ] = "Freeform Lines" ;
-};
String STR_ObjNameSingulCOMBLINE
{
Text [ en-US ] = "Curve" ;
@@ -273,24 +261,6 @@ String STR_ObjNamePluralCOMBFILL
{
Text [ en-US ] = "Curve objects" ;
};
- ////////////////////////////////////////////////////////////////////////////////////////////////////
-String STR_ObjNameSingulNATSPLN
-{
- Text [ en-US ] = "Natural Spline" ;
-};
-String STR_ObjNamePluralNATSPLN
-{
- Text [ en-US ] = "Natural Splines" ;
-};
-String STR_ObjNameSingulPERSPLN
-{
- Text [ en-US ] = "Periodic Spline" ;
-};
-String STR_ObjNamePluralPERSPLN
-{
- Text [ en-US ] = "Periodic Splines" ;
-};
- ////////////////////////////////////////////////////////////////////////////////////////////////////
String STR_ObjNameSingulTEXT
{
Text [ en-US ] = "Text Frame" ;
@@ -1130,10 +1100,10 @@ String STR_UndoDelLayer
{
Text [ en-US ] = "Delete layer" ;
};
-String STR_UndoMovLayer
-{
- Text [ en-US ] = "Change order of layers" ;
-};
+//String STR_UndoMovLayer
+//{
+// Text [ en-US ] = "Change order of layers" ;
+//};
// --> OD 2009-07-09 #i73249#
String STR_UndoObjName
{
diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx
index 9089310bb66d..67149a863910 100644
--- a/svx/source/svdraw/svdtext.cxx
+++ b/svx/source/svdraw/svdtext.cxx
@@ -34,11 +34,11 @@
#include "editeng/fhgtitem.hxx"
#include <editeng/eeitem.hxx>
#include <svl/itemset.hxx>
+#include <svx/svdtrans.hxx>
SdrText::SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject /* = 0 */ )
: mpOutlinerParaObject( pOutlinerParaObject )
, mrObject( rObject )
-, mpModel( rObject.GetModel() )
, mbPortionInfoChecked( false )
{
OSL_ENSURE(&mrObject, "SdrText created without SdrTextObj (!)");
@@ -54,14 +54,10 @@ void SdrText::CheckPortionInfo( SdrOutliner& rOutliner )
{
if(!mbPortionInfoChecked)
{
- // #i102062# no action when the Outliner is the HitTestOutliner,
- // this will remove WrongList info at the OPO
- if(mpModel && &rOutliner == &mpModel->GetHitTestOutliner())
- return;
-
// Optimierung: ggf. BigTextObject erzeugen
mbPortionInfoChecked=true;
- if(mpOutlinerParaObject!=NULL && rOutliner.ShouldCreateBigTextObject())
+
+ if(mpOutlinerParaObject && rOutliner.ShouldCreateBigTextObject())
{
// #i102062# MemoryLeak closed
delete mpOutlinerParaObject;
@@ -72,7 +68,7 @@ void SdrText::CheckPortionInfo( SdrOutliner& rOutliner )
void SdrText::ReformatText()
{
- mbPortionInfoChecked=sal_False;
+ mbPortionInfoChecked = false;
mpOutlinerParaObject->ClearPortionInfo();
}
@@ -85,16 +81,10 @@ void SdrText::SetOutlinerParaObject( OutlinerParaObject* pTextObject )
{
if( mpOutlinerParaObject != pTextObject )
{
- if( mpModel )
- {
- // Update HitTestOutliner
- const SdrTextObj* pTestObj = mpModel->GetHitTestOutliner().GetTextObj();
- if( pTestObj && pTestObj->GetOutlinerParaObject() == mpOutlinerParaObject )
- mpModel->GetHitTestOutliner().SetTextObj( 0 );
- }
-
if( mpOutlinerParaObject )
+ {
delete mpOutlinerParaObject;
+ }
mpOutlinerParaObject = pTextObject;
@@ -110,14 +100,6 @@ OutlinerParaObject* SdrText::GetOutlinerParaObject() const
/** returns the current OutlinerParaObject and removes it from this instance */
OutlinerParaObject* SdrText::RemoveOutlinerParaObject()
{
- if( mpModel )
- {
- // Update HitTestOutliner
- const SdrTextObj* pTestObj = mpModel->GetHitTestOutliner().GetTextObj();
- if( pTestObj && pTestObj->GetOutlinerParaObject() == mpOutlinerParaObject )
- mpModel->GetHitTestOutliner().SetTextObj( 0 );
- }
-
OutlinerParaObject* pOPO = mpOutlinerParaObject;
mpOutlinerParaObject = 0;
@@ -126,44 +108,77 @@ OutlinerParaObject* SdrText::RemoveOutlinerParaObject()
return pOPO;
}
-void SdrText::SetModel( SdrModel* pNewModel )
+void SdrText::ForceOutlinerParaObject( sal_uInt16 nOutlMode )
{
- if( pNewModel == mpModel )
- return;
+ if( !mpOutlinerParaObject )
+ {
+ Outliner* pOutliner = SdrMakeOutliner( nOutlMode, &mrObject.getSdrModelFromSdrObject() );
+ if( pOutliner )
+ {
+ Outliner& aDrawOutliner = mrObject.getSdrModelFromSdrObject().GetDrawOutliner();
+ pOutliner->SetCalcFieldValueHdl( aDrawOutliner.GetCalcFieldValueHdl() );
+
+ pOutliner->SetStyleSheet( 0, GetStyleSheet());
+ OutlinerParaObject* pOutlinerParaObject = pOutliner->CreateParaObject();
+ SetOutlinerParaObject( pOutlinerParaObject );
- SdrModel* pOldModel = mpModel;
- mpModel = pNewModel;
+ delete pOutliner;
+ }
+ }
+}
+
+const SfxItemSet& SdrText::GetObjectItemSet()
+{
+ return mrObject.GetObjectItemSet();
+}
+
+void SdrText::SetObjectItem(const SfxPoolItem& rItem)
+{
+ mrObject.SetObjectItem( rItem );
+}
+
+SfxStyleSheet* SdrText::GetStyleSheet() const
+{
+ return mrObject.GetStyleSheet();
+}
- if( mpOutlinerParaObject && pOldModel!=NULL && pNewModel!=NULL)
+void SdrText::ImpModelChange(SdrModel& rSourceModel, SdrModel& rTargetModel)
+{
+ if(mpOutlinerParaObject && &rSourceModel != &rTargetModel)
{
- bool bHgtSet = GetObjectItemSet().GetItemState(EE_CHAR_FONTHEIGHT, sal_True) == SFX_ITEM_SET;
+ const bool bHgtSet(SFX_ITEM_SET == GetObjectItemSet().GetItemState(EE_CHAR_FONTHEIGHT, true));
+ const MapUnit aOldUnit(rSourceModel.GetExchangeObjectUnit());
+ const MapUnit aNewUnit(rTargetModel.GetExchangeObjectUnit());
+ const bool bScaleUnitChanged(aNewUnit != aOldUnit);
- MapUnit aOldUnit(pOldModel->GetScaleUnit());
- MapUnit aNewUnit(pNewModel->GetScaleUnit());
- FASTBOOL bScaleUnitChanged=aNewUnit!=aOldUnit;
// und nun dem OutlinerParaObject einen neuen Pool verpassen
// !!! Hier muss noch DefTab und RefDevice der beiden Models
// !!! verglichen werden und dann ggf. AutoGrow zuschlagen !!!
// !!! fehlende Implementation !!!
- sal_uIntPtr nOldFontHgt=pOldModel->GetDefaultFontHeight();
- sal_uIntPtr nNewFontHgt=pNewModel->GetDefaultFontHeight();
- sal_Bool bDefHgtChanged=nNewFontHgt!=nOldFontHgt;
- sal_Bool bSetHgtItem=bDefHgtChanged && !bHgtSet;
- if (bSetHgtItem)
- { // #32665#
+ const sal_uInt32 nOldFontHgt(rSourceModel.GetDefaultFontHeight());
+ const sal_uInt32 nNewFontHgt(rTargetModel.GetDefaultFontHeight());
+ const bool bDefHgtChanged(nNewFontHgt != nOldFontHgt);
+ const bool bSetHgtItem(bDefHgtChanged && !bHgtSet);
+
+ if(bSetHgtItem)
+ {
+ // #32665#
// zunaechst das HeightItem festklopfen, damit
// 1. Es eben bestehen bleibt und
// 2. DoStretchChars vom richtigen Wert ausgeht
SetObjectItem(SvxFontHeightItem(nOldFontHgt, 100, EE_CHAR_FONTHEIGHT));
}
+
// erst jetzt den Outliner holen, etc. damit obiges SetAttr auch wirkt
SdrOutliner& rOutliner = mrObject.ImpGetDrawOutliner();
+
rOutliner.SetText(*mpOutlinerParaObject);
delete mpOutlinerParaObject;
- mpOutlinerParaObject=0;
- if (bScaleUnitChanged)
+ mpOutlinerParaObject = 0;
+
+ if(bScaleUnitChanged)
{
- Fraction aMetricFactor=GetMapFactor(aOldUnit,aNewUnit).X();
+ Fraction aMetricFactor(GetMapFactor(aOldUnit, aNewUnit).X());
// Funktioniert nicht richtig:
// Geht am Outliner leider nur in %
@@ -171,50 +186,20 @@ void SdrText::SetModel( SdrModel* pNewModel )
// sal_uInt16 nPerc=(sal_uInt16)nPercFloat;
// rOutliner.DoStretchChars(100,nPerc);
- if (bSetHgtItem)
+ if(bSetHgtItem)
{
// Und nun noch das Rahmenattribut korregieren
- nOldFontHgt=BigMulDiv(nOldFontHgt,aMetricFactor.GetNumerator(),aMetricFactor.GetDenominator());
- SetObjectItem(SvxFontHeightItem(nOldFontHgt, 100, EE_CHAR_FONTHEIGHT));
+ const sal_uInt32 nAdaptedFontHgt(BigMulDiv(nOldFontHgt,aMetricFactor.GetNumerator(),aMetricFactor.GetDenominator()));
+
+ SetObjectItem(SvxFontHeightItem(nAdaptedFontHgt, 100, EE_CHAR_FONTHEIGHT));
}
}
+
SetOutlinerParaObject(rOutliner.CreateParaObject()); // #34494#
mpOutlinerParaObject->ClearPortionInfo();
- mbPortionInfoChecked=sal_False;
+ mbPortionInfoChecked = false;
rOutliner.Clear();
}
}
-void SdrText::ForceOutlinerParaObject( sal_uInt16 nOutlMode )
-{
- if( mpModel && !mpOutlinerParaObject )
- {
- Outliner* pOutliner = SdrMakeOutliner( nOutlMode, mpModel );
- if( pOutliner )
- {
- Outliner& aDrawOutliner = mpModel->GetDrawOutliner();
- pOutliner->SetCalcFieldValueHdl( aDrawOutliner.GetCalcFieldValueHdl() );
-
- pOutliner->SetStyleSheet( 0, GetStyleSheet());
- OutlinerParaObject* pOutlinerParaObject = pOutliner->CreateParaObject();
- SetOutlinerParaObject( pOutlinerParaObject );
-
- delete pOutliner;
- }
- }
-}
-
-const SfxItemSet& SdrText::GetObjectItemSet()
-{
- return mrObject.GetObjectItemSet();
-}
-
-void SdrText::SetObjectItem(const SfxPoolItem& rItem)
-{
- mrObject.SetObjectItem( rItem );
-}
-
-SfxStyleSheet* SdrText::GetStyleSheet() const
-{
- return mrObject.GetStyleSheet();
-}
+// eof \ No newline at end of file
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index f96066189de7..6aa62f532bbc 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -27,97 +27,11 @@
#include <svx/svdtrans.hxx>
#include <math.h>
#include <svx/xpoly.hxx>
-
#include <vcl/virdev.hxx>
#include <tools/bigint.hxx>
#include <tools/debug.hxx>
#include <unotools/syslocale.hxx>
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void MoveXPoly(XPolygon& rPoly, const Size& S)
-{
- rPoly.Move(S.Width(),S.Height());
-}
-
-void MoveXPoly(XPolyPolygon& rPoly, const Size& S)
-{
- rPoly.Move(S.Width(),S.Height());
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void ResizeRect(Rectangle& rRect, const Point& rRef, const Fraction& rxFact, const Fraction& ryFact, FASTBOOL bNoJustify)
-{
- Fraction xFact(rxFact);
- Fraction yFact(ryFact);
- //long nHgt=rRect.Bottom()-rRect.Top();
-
- {
- if (xFact.GetDenominator()==0) {
- long nWdt=rRect.Right()-rRect.Left();
- if (xFact.GetNumerator()>=0) { // DivZero abfangen
- xFact=Fraction(xFact.GetNumerator(),1);
- if (nWdt==0) rRect.Right()++;
- } else {
- xFact=Fraction(xFact.GetNumerator(),-1);
- if (nWdt==0) rRect.Left()--;
- }
- }
- rRect.Left() =rRef.X()+Round(((double)(rRect.Left() -rRef.X())*xFact.GetNumerator())/xFact.GetDenominator());
- rRect.Right() =rRef.X()+Round(((double)(rRect.Right() -rRef.X())*xFact.GetNumerator())/xFact.GetDenominator());
- }
- {
- if (yFact.GetDenominator()==0) {
- long nHgt=rRect.Bottom()-rRect.Top();
- if (yFact.GetNumerator()>=0) { // DivZero abfangen
- yFact=Fraction(yFact.GetNumerator(),1);
- if (nHgt==0) rRect.Bottom()++;
- } else {
- yFact=Fraction(yFact.GetNumerator(),-1);
- if (nHgt==0) rRect.Top()--;
- }
-
- yFact=Fraction(yFact.GetNumerator(),1); // DivZero abfangen
- }
- rRect.Top() =rRef.Y()+Round(((double)(rRect.Top() -rRef.Y())*yFact.GetNumerator())/yFact.GetDenominator());
- rRect.Bottom()=rRef.Y()+Round(((double)(rRect.Bottom()-rRef.Y())*yFact.GetNumerator())/yFact.GetDenominator());
- }
- if (!bNoJustify) rRect.Justify();
-}
-
-
-void ResizePoly(Polygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- sal_uInt16 nAnz=rPoly.GetSize();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- ResizePoint(rPoly[i],rRef,xFact,yFact);
- }
-}
-
-void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- sal_uInt16 nAnz=rPoly.GetPointCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- ResizePoint(rPoly[i],rRef,xFact,yFact);
- }
-}
-
-void ResizePoly(PolyPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- sal_uInt16 nAnz=rPoly.Count();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- ResizePoly(rPoly[i],rRef,xFact,yFact);
- }
-}
-
-void ResizeXPoly(XPolyPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- sal_uInt16 nAnz=rPoly.Count();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- ResizeXPoly(rPoly[i],rRef,xFact,yFact);
- }
-}
+#include <basegfx/polygon/b2dpolygon.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -129,14 +43,6 @@ void RotatePoly(Polygon& rPoly, const Point& rRef, double sn, double cs)
}
}
-void RotateXPoly(XPolygon& rPoly, const Point& rRef, double sn, double cs)
-{
- sal_uInt16 nAnz=rPoly.GetPointCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- RotatePoint(rPoly[i],rRef,sn,cs);
- }
-}
-
void RotatePoly(PolyPolygon& rPoly, const Point& rRef, double sn, double cs)
{
sal_uInt16 nAnz=rPoly.Count();
@@ -145,22 +51,8 @@ void RotatePoly(PolyPolygon& rPoly, const Point& rRef, double sn, double cs)
}
}
-void RotateXPoly(XPolyPolygon& rPoly, const Point& rRef, double sn, double cs)
-{
- sal_uInt16 nAnz=rPoly.Count();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- RotateXPoly(rPoly[i],rRef,sn,cs);
- }
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
-void MirrorRect(Rectangle& rRect, const Point& /*rRef1*/, const Point& /*rRef2*/, FASTBOOL bNoJustify)
-{
- // !!! fehlende Implementation !!!
- if (!bNoJustify) rRect.Justify();
-}
-
void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2)
{
long mx=rRef2.X()-rRef1.X();
@@ -189,48 +81,16 @@ void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2)
long nPntWink=GetAngle(rPnt);
long nWink=2*(nRefWink-nPntWink);
double a=nWink*nPi180;
- double nSin=sin(a);
- double nCos=cos(a);
- RotatePoint(rPnt,Point(),nSin,nCos);
+ double fSin=sin(a);
+ double fCos=cos(a);
+ RotatePoint(rPnt,Point(),fSin,fCos);
rPnt+=rRef1;
}
}
-void MirrorPoly(Polygon& rPoly, const Point& rRef1, const Point& rRef2)
-{
- sal_uInt16 nAnz=rPoly.GetSize();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- MirrorPoint(rPoly[i],rRef1,rRef2);
- }
-}
-
-void MirrorXPoly(XPolygon& rPoly, const Point& rRef1, const Point& rRef2)
-{
- sal_uInt16 nAnz=rPoly.GetPointCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- MirrorPoint(rPoly[i],rRef1,rRef2);
- }
-}
-
-void MirrorPoly(PolyPolygon& rPoly, const Point& rRef1, const Point& rRef2)
-{
- sal_uInt16 nAnz=rPoly.Count();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- MirrorPoly(rPoly[i],rRef1,rRef2);
- }
-}
-
-void MirrorXPoly(XPolyPolygon& rPoly, const Point& rRef1, const Point& rRef2)
-{
- sal_uInt16 nAnz=rPoly.Count();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- MirrorXPoly(rPoly[i],rRef1,rRef2);
- }
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
-void ShearPoly(Polygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear)
+void ShearPoly(Polygon& rPoly, const Point& rRef, double tn, bool bVShear)
{
sal_uInt16 nAnz=rPoly.GetSize();
for (sal_uInt16 i=0; i<nAnz; i++) {
@@ -238,15 +98,7 @@ void ShearPoly(Polygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear)
}
}
-void ShearXPoly(XPolygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear)
-{
- sal_uInt16 nAnz=rPoly.GetPointCount();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- ShearPoint(rPoly[i],rRef,tn,bVShear);
- }
-}
-
-void ShearPoly(PolyPolygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear)
+void ShearPoly(PolyPolygon& rPoly, const Point& rRef, double tn, bool bVShear)
{
sal_uInt16 nAnz=rPoly.Count();
for (sal_uInt16 i=0; i<nAnz; i++) {
@@ -254,252 +106,325 @@ void ShearPoly(PolyPolygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShea
}
}
-void ShearXPoly(XPolyPolygon& rPoly, const Point& rRef, double tn, FASTBOOL bVShear)
-{
- sal_uInt16 nAnz=rPoly.Count();
- for (sal_uInt16 i=0; i<nAnz; i++) {
- ShearXPoly(rPoly[i],rRef,tn,bVShear);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@ @@@@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@ @@ @@ @@ @@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@ @@ @@@@ @@@@ @@ @@
-//
////////////////////////////////////////////////////////////////////////////////////////////////////
-double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter,
- const Point& rRad, double& rSin, double& rCos, FASTBOOL bVert)
+double CrookRotateXPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2, const basegfx::B2DPoint& rCenter,
+ const basegfx::B2DPoint& rRad, double& rSin, double& rCos, bool bVert)
{
- FASTBOOL bC1=pC1!=NULL;
- FASTBOOL bC2=pC2!=NULL;
- long x0=rPnt.X();
- long y0=rPnt.Y();
- long cx=rCenter.X();
- long cy=rCenter.Y();
- double nWink=GetCrookAngle(rPnt,rCenter,rRad,bVert);
- double sn=sin(nWink);
- double cs=cos(nWink);
- RotatePoint(rPnt,rCenter,sn,cs);
- if (bC1) {
- if (bVert) {
+ basegfx::B2DPoint aPoint(rPnt);
+ basegfx::B2DPoint aCenter(rCenter);
+ double nWink(GetCrookAngle(rPnt, rCenter, rRad, bVert));
+ double sn(sin(nWink));
+ double cs(cos(nWink));
+
+ RotateB2DPointAroundRef(rPnt, rCenter, sn, cs);
+
+ if(pC1)
+ {
+ if(bVert)
+ {
// Richtung Zentrum verschieben, als Ausgangsposition fuer Rotate
- pC1->Y()-=y0;
+ pC1->setY(pC1->getY() - aPoint.getY());
+
// Resize, entsprechend der Entfernung vom Zentrum
- pC1->Y()=Round(((double)pC1->Y()) /rRad.X()*(cx-pC1->X()));
- pC1->Y()+=cy;
- } else {
+ pC1->setY((pC1->getY() / rRad.getX() * (aCenter.getX() - pC1->getX())) + aCenter.getY());
+ }
+ else
+ {
// Richtung Zentrum verschieben, als Ausgangsposition fuer Rotate
- pC1->X()-=x0;
+ pC1->setX(pC1->getX() - aPoint.getX());
+
// Resize, entsprechend der Entfernung vom Zentrum
- long nPntRad=cy-pC1->Y();
- double nFact=(double)nPntRad/(double)rRad.Y();
- pC1->X()=Round((double)pC1->X()*nFact);
- pC1->X()+=cx;
+ const double fPntRad(aCenter.getY() - pC1->getY());
+ const double fFact(fPntRad / rRad.getY());
+
+ pC1->setX((pC1->getX() * fFact) + aCenter.getX());
}
- RotatePoint(*pC1,rCenter,sn,cs);
+
+ RotateB2DPointAroundRef(*pC1, rCenter, sn, cs);
}
- if (bC2) {
- if (bVert) {
+
+ if(pC2)
+ {
+ if(bVert)
+ {
// Richtung Zentrum verschieben, als Ausgangsposition fuer Rotate
- pC2->Y()-=y0;
+ pC2->setY(pC2->getY() - aPoint.getY());
+
// Resize, entsprechend der Entfernung vom Zentrum
- pC2->Y()=Round(((double)pC2->Y()) /rRad.X()*(rCenter.X()-pC2->X()));
- pC2->Y()+=cy;
- } else {
+ pC2->setY((pC2->getY() / rRad.getX() * (rCenter.getX() - pC2->getX())) + aCenter.getY());
+ }
+ else
+ {
// Richtung Zentrum verschieben, als Ausgangsposition fuer Rotate
- pC2->X()-=x0;
+ pC2->setX(pC2->getX() - aPoint.getX());
+
// Resize, entsprechend der Entfernung vom Zentrum
- long nPntRad=rCenter.Y()-pC2->Y();
- double nFact=(double)nPntRad/(double)rRad.Y();
- pC2->X()=Round((double)pC2->X()*nFact);
- pC2->X()+=cx;
+ const double fPntRad(rCenter.getY() - pC2->getY());
+ const double fFact(fPntRad / rRad.getY());
+
+ pC2->setX((pC2->getX() * fFact) + aCenter.getX());
}
- RotatePoint(*pC2,rCenter,sn,cs);
+
+ RotateB2DPointAroundRef(*pC2, rCenter, sn, cs);
}
- rSin=sn;
- rCos=cs;
+
+ rSin = sn;
+ rCos = cs;
+
return nWink;
}
-double CrookSlantXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter,
- const Point& rRad, double& rSin, double& rCos, FASTBOOL bVert)
+double CrookSlantXPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2, const basegfx::B2DPoint& rCenter,
+ const basegfx::B2DPoint& rRad, double& rSin, double& rCos, bool bVert)
{
- FASTBOOL bC1=pC1!=NULL;
- FASTBOOL bC2=pC2!=NULL;
- long x0=rPnt.X();
- long y0=rPnt.Y();
- long dx1=0,dy1=0;
- long dxC1=0,dyC1=0;
- long dxC2=0,dyC2=0;
- if (bVert) {
- long nStart=rCenter.X()-rRad.X();
- dx1=rPnt.X()-nStart;
- rPnt.X()=nStart;
- if (bC1) {
- dxC1=pC1->X()-nStart;
- pC1->X()=nStart;
+ basegfx::B2DPoint aPoint(rPnt);
+ basegfx::B2DPoint aDelta1(0.0, 0.0);
+ basegfx::B2DPoint aDeltaC1(0.0, 0.0);
+ basegfx::B2DPoint aDeltaC2(0.0, 0.0);
+
+ if(bVert)
+ {
+ const double fStart(rCenter.getX() - rRad.getX());
+
+ aDelta1.setX(rPnt.getX() - fStart);
+ rPnt.setX(fStart);
+
+ if(pC1)
+ {
+ aDeltaC1.setX(pC1->getX() - fStart);
+ pC1->setX(fStart);
}
- if (bC2) {
- dxC2=pC2->X()-nStart;
- pC2->X()=nStart;
+
+ if(pC2)
+ {
+ aDeltaC2.setX(pC2->getX() - fStart);
+ pC2->setX(fStart);
}
- } else {
- long nStart=rCenter.Y()-rRad.Y();
- dy1=rPnt.Y()-nStart;
- rPnt.Y()=nStart;
- if (bC1) {
- dyC1=pC1->Y()-nStart;
- pC1->Y()=nStart;
+ }
+ else
+ {
+ const double fStart(rCenter.getY() - rRad.getY());
+
+ aDelta1.setY(rPnt.getY() - fStart);
+ rPnt.setY(fStart);
+
+ if(pC1)
+ {
+ aDeltaC1.setY(pC1->getY() - fStart);
+ pC1->setY(fStart);
}
- if (bC2) {
- dyC2=pC2->Y()-nStart;
- pC2->Y()=nStart;
+
+ if(pC2)
+ {
+ aDeltaC2.setY(pC2->getY() - fStart);
+ pC2->setY(fStart);
}
}
- double nWink=GetCrookAngle(rPnt,rCenter,rRad,bVert);
- double sn=sin(nWink);
- double cs=cos(nWink);
- RotatePoint(rPnt,rCenter,sn,cs);
- if (bC1) { if (bVert) pC1->Y()-=y0-rCenter.Y(); else pC1->X()-=x0-rCenter.X(); RotatePoint(*pC1,rCenter,sn,cs); }
- if (bC2) { if (bVert) pC2->Y()-=y0-rCenter.Y(); else pC2->X()-=x0-rCenter.X(); RotatePoint(*pC2,rCenter,sn,cs); }
- if (bVert) {
- rPnt.X()+=dx1;
- if (bC1) pC1->X()+=dxC1;
- if (bC2) pC2->X()+=dxC2;
- } else {
- rPnt.Y()+=dy1;
- if (bC1) pC1->Y()+=dyC1;
- if (bC2) pC2->Y()+=dyC2;
+
+ double nWink(GetCrookAngle(rPnt, rCenter, rRad, bVert));
+ double sn(sin(nWink));
+ double cs(cos(nWink));
+
+ RotateB2DPointAroundRef(rPnt, rCenter, sn, cs);
+
+ if(pC1)
+ {
+ if(bVert)
+ {
+ pC1->setY(pC1->getY() - (aPoint.getY() - rCenter.getY()));
+ }
+ else
+ {
+ pC1->setX(pC1->getX() - (aPoint.getX() - rCenter.getX()));
+ }
+
+ RotateB2DPointAroundRef(*pC1, rCenter, sn, cs);
+ }
+
+ if(pC2)
+ {
+ if(bVert)
+ {
+ pC2->setY(pC2->getY() - (aPoint.getY() - rCenter.getY()));
+ }
+ else
+ {
+ pC2->setX(pC2->getX() - (aPoint.getX() - rCenter.getX()));
+ }
+
+ RotateB2DPointAroundRef(*pC2, rCenter, sn, cs);
}
+
+ if(bVert)
+ {
+ rPnt.setX(rPnt.getX() + aDelta1.getX());
+
+ if(pC1)
+ {
+ pC1->setX(pC1->getX() + aDeltaC1.getX());
+ }
+
+ if(pC2)
+ {
+ pC2->setX(pC2->getX() + aDeltaC2.getX());
+ }
+ }
+ else
+ {
+ rPnt.setY(rPnt.getY() + aDelta1.getY());
+
+ if(pC1)
+ {
+ pC1->setY(pC1->getY() + aDeltaC1.getY());
+ }
+
+ if(pC2)
+ {
+ pC2->setY(pC2->getY() + aDeltaC2.getY());
+ }
+ }
+
rSin=sn;
rCos=cs;
+
return nWink;
}
-double CrookStretchXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter,
- const Point& rRad, double& rSin, double& rCos, FASTBOOL bVert,
- const Rectangle rRefRect)
+double CrookStretchXPoint(basegfx::B2DPoint& rPnt, basegfx::B2DPoint* pC1, basegfx::B2DPoint* pC2, const basegfx::B2DPoint& rCenter,
+ const basegfx::B2DPoint& rRad, double& rSin, double& rCos, bool bVert,
+ const basegfx::B2DRange& rRefRange)
{
- //FASTBOOL bC1=pC1!=NULL;
- //FASTBOOL bC2=pC2!=NULL;
- //long x0=rPnt.X();
- long y0=rPnt.Y();
+ const double y0(rPnt.getY());
+
CrookSlantXPoint(rPnt,pC1,pC2,rCenter,rRad,rSin,rCos,bVert);
- if (bVert) {
- } else {
- //long nBase=rCenter.Y()-rRad.Y();
- long nTop=rRefRect.Top();
- long nBtm=rRefRect.Bottom();
- long nHgt=nBtm-nTop;
- long dy=rPnt.Y()-y0;
- //FASTBOOL bOben=rRad.Y()<0;
- double a=((double)(y0-nTop))/nHgt;
- a*=dy;
- rPnt.Y()=y0+Round(a);
- } return 0.0;
+
+ if(!bVert)
+ {
+ const double fTop(rRefRange.getMinY());
+ const double fBtm(rRefRange.getMaxY());
+ const double fHgt(fBtm - fTop);
+ const double dy(rPnt.getY() - y0);
+ const double a(((y0 - fTop) / fHgt) * dy);
+
+ rPnt.setY(y0 + a);
+ }
+
+ return 0.0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void CrookRotatePoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert)
+void CrookRotatePoly(basegfx::B2DPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert)
{
- double nSin,nCos;
- sal_uInt16 nPointAnz=rPoly.GetPointCount();
- sal_uInt16 i=0;
- while (i<nPointAnz) {
- Point* pPnt=&rPoly[i];
- Point* pC1=NULL;
- Point* pC2=NULL;
- if (i+1<nPointAnz && rPoly.IsControl(i)) { // Kontrollpunkt links
- pC1=pPnt;
- i++;
- pPnt=&rPoly[i];
+ double fSin(0.0);
+ double fCos(0.0);
+
+ for(sal_uInt32 a(0); a < rPoly.count(); a++)
+ {
+ basegfx::B2DPoint aPoint(rPoly.getB2DPoint(a));
+
+ if(rPoly.areControlPointsUsed() && (rPoly.isPrevControlPointUsed(a) || rPoly.isNextControlPointUsed(a)))
+ {
+ basegfx::B2DPoint aPrev(rPoly.getPrevControlPoint(a));
+ basegfx::B2DPoint aNext(rPoly.getNextControlPoint(a));
+
+ CrookRotateXPoint(aPoint, &aPrev, &aNext, rCenter, rRad, fSin, fCos, bVert);
+ rPoly.setB2DPoint(a, aPoint);
+ rPoly.setControlPoints(a, aPrev, aNext);
}
- i++;
- if (i<nPointAnz && rPoly.IsControl(i)) { // Kontrollpunkt rechts
- pC2=&rPoly[i];
- i++;
+ else
+ {
+ CrookRotateXPoint(aPoint, 0, 0, rCenter, rRad, fSin, fCos, bVert);
+ rPoly.setB2DPoint(a, aPoint);
}
- CrookRotateXPoint(*pPnt,pC1,pC2,rCenter,rRad,nSin,nCos,bVert);
}
}
-void CrookSlantPoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert)
+void CrookSlantPoly(basegfx::B2DPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert)
{
- double nSin,nCos;
- sal_uInt16 nPointAnz=rPoly.GetPointCount();
- sal_uInt16 i=0;
- while (i<nPointAnz) {
- Point* pPnt=&rPoly[i];
- Point* pC1=NULL;
- Point* pC2=NULL;
- if (i+1<nPointAnz && rPoly.IsControl(i)) { // Kontrollpunkt links
- pC1=pPnt;
- i++;
- pPnt=&rPoly[i];
+ double fSin(0.0);
+ double fCos(0.0);
+
+ for(sal_uInt32 a(0); a < rPoly.count(); a++)
+ {
+ basegfx::B2DPoint aPoint(rPoly.getB2DPoint(a));
+
+ if(rPoly.areControlPointsUsed() && (rPoly.isPrevControlPointUsed(a) || rPoly.isNextControlPointUsed(a)))
+ {
+ basegfx::B2DPoint aPrev(rPoly.getPrevControlPoint(a));
+ basegfx::B2DPoint aNext(rPoly.getNextControlPoint(a));
+
+ CrookSlantXPoint(aPoint, &aPrev, &aNext, rCenter, rRad, fSin, fCos, bVert);
+ rPoly.setB2DPoint(a, aPoint);
+ rPoly.setControlPoints(a, aPrev, aNext);
}
- i++;
- if (i<nPointAnz && rPoly.IsControl(i)) { // Kontrollpunkt rechts
- pC2=&rPoly[i];
- i++;
+ else
+ {
+ CrookSlantXPoint(aPoint, 0, 0, rCenter, rRad, fSin, fCos, bVert);
+ rPoly.setB2DPoint(a, aPoint);
}
- CrookSlantXPoint(*pPnt,pC1,pC2,rCenter,rRad,nSin,nCos,bVert);
}
}
-void CrookStretchPoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert, const Rectangle rRefRect)
+void CrookStretchPoly(basegfx::B2DPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert, const basegfx::B2DRange& rRefRange)
{
- double nSin,nCos;
- sal_uInt16 nPointAnz=rPoly.GetPointCount();
- sal_uInt16 i=0;
- while (i<nPointAnz) {
- Point* pPnt=&rPoly[i];
- Point* pC1=NULL;
- Point* pC2=NULL;
- if (i+1<nPointAnz && rPoly.IsControl(i)) { // Kontrollpunkt links
- pC1=pPnt;
- i++;
- pPnt=&rPoly[i];
+ double fSin(0.0);
+ double fCos(0.0);
+
+ for(sal_uInt32 a(0); a < rPoly.count(); a++)
+ {
+ basegfx::B2DPoint aPoint(rPoly.getB2DPoint(a));
+
+ if(rPoly.areControlPointsUsed() && (rPoly.isPrevControlPointUsed(a) || rPoly.isNextControlPointUsed(a)))
+ {
+ basegfx::B2DPoint aPrev(rPoly.getPrevControlPoint(a));
+ basegfx::B2DPoint aNext(rPoly.getNextControlPoint(a));
+
+ CrookStretchXPoint(aPoint, &aPrev, &aNext, rCenter, rRad, fSin, fCos, bVert, rRefRange);
+ rPoly.setB2DPoint(a, aPoint);
+ rPoly.setControlPoints(a, aPrev, aNext);
}
- i++;
- if (i<nPointAnz && rPoly.IsControl(i)) { // Kontrollpunkt rechts
- pC2=&rPoly[i];
- i++;
+ else
+ {
+ CrookStretchXPoint(aPoint, 0, 0, rCenter, rRad, fSin, fCos, bVert, rRefRange);
+ rPoly.setB2DPoint(a, aPoint);
}
- CrookStretchXPoint(*pPnt,pC1,pC2,rCenter,rRad,nSin,nCos,bVert,rRefRect);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-void CrookRotatePoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert)
+void CrookRotatePoly(basegfx::B2DPolyPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert)
{
- sal_uInt16 nPolyAnz=rPoly.Count();
- for (sal_uInt16 nPolyNum=0; nPolyNum<nPolyAnz; nPolyNum++) {
- CrookRotatePoly(rPoly[nPolyNum],rCenter,rRad,bVert);
+ for(sal_uInt32 a(0); a < rPoly.count(); a++)
+ {
+ basegfx::B2DPolygon aCandidate(rPoly.getB2DPolygon(a));
+
+ CrookRotatePoly(aCandidate, rCenter, rRad, bVert);
+ rPoly.setB2DPolygon(a, aCandidate);
}
}
-void CrookSlantPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert)
+void CrookSlantPoly(basegfx::B2DPolyPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert)
{
- sal_uInt16 nPolyAnz=rPoly.Count();
- for (sal_uInt16 nPolyNum=0; nPolyNum<nPolyAnz; nPolyNum++) {
- CrookSlantPoly(rPoly[nPolyNum],rCenter,rRad,bVert);
+ for(sal_uInt32 a(0); a < rPoly.count(); a++)
+ {
+ basegfx::B2DPolygon aCandidate(rPoly.getB2DPolygon(a));
+
+ CrookSlantPoly(aCandidate, rCenter, rRad, bVert);
+ rPoly.setB2DPolygon(a, aCandidate);
}
}
-void CrookStretchPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, FASTBOOL bVert, const Rectangle rRefRect)
+void CrookStretchPoly(basegfx::B2DPolyPolygon& rPoly, const basegfx::B2DPoint& rCenter, const basegfx::B2DPoint& rRad, bool bVert, const basegfx::B2DRange& rRefRange)
{
- sal_uInt16 nPolyAnz=rPoly.Count();
- for (sal_uInt16 nPolyNum=0; nPolyNum<nPolyAnz; nPolyNum++) {
- CrookStretchPoly(rPoly[nPolyNum],rCenter,rRad,bVert,rRefRect);
+ for(sal_uInt32 a(0); a < rPoly.count(); a++)
+ {
+ basegfx::B2DPolygon aCandidate(rPoly.getB2DPolygon(a));
+
+ CrookStretchPoly(aCandidate, rCenter, rRad, bVert, rRefRange);
+ rPoly.setB2DPolygon(a, aCandidate);
}
}
@@ -570,129 +495,6 @@ long GetLen(const Point& rPnt)
////////////////////////////////////////////////////////////////////////////////////////////////////
-void GeoStat::RecalcSinCos()
-{
- if (nDrehWink==0) {
- nSin=0.0;
- nCos=1.0;
- } else {
- double a=nDrehWink*nPi180;
- nSin=sin(a);
- nCos=cos(a);
- }
-}
-
-void GeoStat::RecalcTan()
-{
- if (nShearWink==0) {
- nTan=0.0;
- } else {
- double a=nShearWink*nPi180;
- nTan=tan(a);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-Polygon Rect2Poly(const Rectangle& rRect, const GeoStat& rGeo)
-{
- Polygon aPol(5);
- aPol[0]=rRect.TopLeft();
- aPol[1]=rRect.TopRight();
- aPol[2]=rRect.BottomRight();
- aPol[3]=rRect.BottomLeft();
- aPol[4]=rRect.TopLeft();
- if (rGeo.nShearWink!=0) ShearPoly(aPol,rRect.TopLeft(),rGeo.nTan);
- if (rGeo.nDrehWink!=0) RotatePoly(aPol,rRect.TopLeft(),rGeo.nSin,rGeo.nCos);
- return aPol;
-}
-
-void Poly2Rect(const Polygon& rPol, Rectangle& rRect, GeoStat& rGeo)
-{
- rGeo.nDrehWink=GetAngle(rPol[1]-rPol[0]);
- rGeo.nDrehWink=NormAngle360(rGeo.nDrehWink);
- // Drehung ist damit im Kasten
- rGeo.RecalcSinCos();
-
- Point aPt1(rPol[1]-rPol[0]);
- if (rGeo.nDrehWink!=0) RotatePoint(aPt1,Point(0,0),-rGeo.nSin,rGeo.nCos); // -Sin fuer Rueckdrehung
- long nWdt=aPt1.X();
-
- Point aPt0(rPol[0]);
- Point aPt3(rPol[3]-rPol[0]);
- if (rGeo.nDrehWink!=0) RotatePoint(aPt3,Point(0,0),-rGeo.nSin,rGeo.nCos); // -Sin fuer Rueckdrehung
- long nHgt=aPt3.Y();
-
- if(aPt3.X())
- {
- // #i74358# the axes are not orthogonal, so for getting the correct height,
- // calculate the length of aPt3
-
- // #i74358# this change was wrong, in the field of the old geometry stuff
- // it is not an error. The new height always is the same as before; shear
- // does not change object height at all. This is different from the interactions,
- // but obviously wanted in the old versions.
- //
- // nHgt = static_cast< long >(sqrt(static_cast< double >(aPt3.X() * aPt3.X() + aPt3.Y() * aPt3.Y())));
- }
-
- long nShW=GetAngle(aPt3);
- nShW-=27000; // ShearWink wird zur Senkrechten gemessen
- nShW=-nShW; // Negieren, denn '+' ist Rechtskursivierung
-
- FASTBOOL bMirr=aPt3.Y()<0;
- if (bMirr) { // "Punktetausch" bei Spiegelung
- nHgt=-nHgt;
- nShW+=18000;
- aPt0=rPol[3];
- }
- nShW=NormAngle180(nShW);
- if (nShW<-9000 || nShW>9000) {
- nShW=NormAngle180(nShW+18000);
- }
- if (nShW<-SDRMAXSHEAR) nShW=-SDRMAXSHEAR; // ShearWinkel begrenzen auf +/- 89.00 deg
- if (nShW>SDRMAXSHEAR) nShW=SDRMAXSHEAR;
- rGeo.nShearWink=nShW;
- rGeo.RecalcTan();
- Point aRU(aPt0);
- aRU.X()+=nWdt;
- aRU.Y()+=nHgt;
- rRect=Rectangle(aPt0,aRU);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void OrthoDistance8(const Point& rPt0, Point& rPt, FASTBOOL bBigOrtho)
-{
- long dx=rPt.X()-rPt0.X();
- long dy=rPt.Y()-rPt0.Y();
- long dxa=Abs(dx);
- long dya=Abs(dy);
- if (dx==0 || dy==0 || dxa==dya) return;
- if (dxa>=dya*2) { rPt.Y()=rPt0.Y(); return; }
- if (dya>=dxa*2) { rPt.X()=rPt0.X(); return; }
- if ((dxa<dya) != bBigOrtho) {
- rPt.Y()=rPt0.Y()+(dxa* (dy>=0 ? 1 : -1) );
- } else {
- rPt.X()=rPt0.X()+(dya* (dx>=0 ? 1 : -1) );
- }
-}
-
-void OrthoDistance4(const Point& rPt0, Point& rPt, FASTBOOL bBigOrtho)
-{
- long dx=rPt.X()-rPt0.X();
- long dy=rPt.Y()-rPt0.Y();
- long dxa=Abs(dx);
- long dya=Abs(dy);
- if ((dxa<dya) != bBigOrtho) {
- rPt.Y()=rPt0.Y()+(dxa* (dy>=0 ? 1 : -1) );
- } else {
- rPt.X()=rPt0.X()+(dya* (dx>=0 ? 1 : -1) );
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
long BigMulDiv(long nVal, long nMul, long nDiv)
{
BigInt aVal(nVal);
@@ -714,7 +516,7 @@ void Kuerzen(Fraction& rF, unsigned nDigits)
{
sal_Int32 nMul=rF.GetNumerator();
sal_Int32 nDiv=rF.GetDenominator();
- FASTBOOL bNeg=sal_False;
+ bool bNeg=sal_False;
if (nMul<0) { nMul=-nMul; bNeg=!bNeg; }
if (nDiv<0) { nDiv=-nDiv; bNeg=!bNeg; }
if (nMul==0 || nDiv==0) return;
@@ -805,8 +607,8 @@ FrPair GetMapFactor(MapUnit eS, MapUnit eD)
if (eS==eD) return FrPair(1,1,1,1);
FrPair aS(GetInchOrMM(eS));
FrPair aD(GetInchOrMM(eD));
- FASTBOOL bSInch=IsInch(eS);
- FASTBOOL bDInch=IsInch(eD);
+ bool bSInch=IsInch(eS);
+ bool bDInch=IsInch(eD);
FrPair aRet(aD.X()/aS.X(),aD.Y()/aS.Y());
if (bSInch && !bDInch) { aRet.X()*=Fraction(127,5); aRet.Y()*=Fraction(127,5); }
if (!bSInch && bDInch) { aRet.X()*=Fraction(5,127); aRet.Y()*=Fraction(5,127); }
@@ -817,8 +619,8 @@ FrPair GetMapFactor(MapUnit eS, FieldUnit eD)
{
FrPair aS(GetInchOrMM(eS));
FrPair aD(GetInchOrMM(eD));
- FASTBOOL bSInch=IsInch(eS);
- FASTBOOL bDInch=IsInch(eD);
+ bool bSInch=IsInch(eS);
+ bool bDInch=IsInch(eD);
FrPair aRet(aD.X()/aS.X(),aD.Y()/aS.Y());
if (bSInch && !bDInch) { aRet.X()*=Fraction(127,5); aRet.Y()*=Fraction(127,5); }
if (!bSInch && bDInch) { aRet.X()*=Fraction(5,127); aRet.Y()*=Fraction(5,127); }
@@ -829,8 +631,8 @@ FrPair GetMapFactor(FieldUnit eS, MapUnit eD)
{
FrPair aS(GetInchOrMM(eS));
FrPair aD(GetInchOrMM(eD));
- FASTBOOL bSInch=IsInch(eS);
- FASTBOOL bDInch=IsInch(eD);
+ bool bSInch=IsInch(eS);
+ bool bDInch=IsInch(eD);
FrPair aRet(aD.X()/aS.X(),aD.Y()/aS.Y());
if (bSInch && !bDInch) { aRet.X()*=Fraction(127,5); aRet.Y()*=Fraction(127,5); }
if (!bSInch && bDInch) { aRet.X()*=Fraction(5,127); aRet.Y()*=Fraction(5,127); }
@@ -842,8 +644,8 @@ FrPair GetMapFactor(FieldUnit eS, FieldUnit eD)
if (eS==eD) return FrPair(1,1,1,1);
FrPair aS(GetInchOrMM(eS));
FrPair aD(GetInchOrMM(eD));
- FASTBOOL bSInch=IsInch(eS);
- FASTBOOL bDInch=IsInch(eD);
+ bool bSInch=IsInch(eS);
+ bool bDInch=IsInch(eD);
FrPair aRet(aD.X()/aS.X(),aD.Y()/aS.Y());
if (bSInch && !bDInch) { aRet.X()*=Fraction(127,5); aRet.Y()*=Fraction(127,5); }
if (!bSInch && bDInch) { aRet.X()*=Fraction(5,127); aRet.Y()*=Fraction(5,127); }
@@ -859,24 +661,24 @@ FrPair GetMapFactor(FieldUnit eS, FieldUnit eD)
// 1 yd = 3 ft = 36" = 914,4mm
// 1 ft = 12 " = 1" = 304,8mm
-void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, int& rbMetr, int& rbInch)
+void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, bool& rbMetr, bool& rbInch)
{
rnMul=1; rnDiv=1;
short nKomma=0;
- FASTBOOL bMetr=sal_False,bInch=sal_False;
+ bool bMetr=false,bInch=false;
switch (eMU) {
// Metrisch
- case MAP_100TH_MM : bMetr=sal_True; nKomma=5; break;
- case MAP_10TH_MM : bMetr=sal_True; nKomma=4; break;
- case MAP_MM : bMetr=sal_True; nKomma=3; break;
- case MAP_CM : bMetr=sal_True; nKomma=2; break;
+ case MAP_100TH_MM : bMetr=true; nKomma=5; break;
+ case MAP_10TH_MM : bMetr=true; nKomma=4; break;
+ case MAP_MM : bMetr=true; nKomma=3; break;
+ case MAP_CM : bMetr=true; nKomma=2; break;
// Inch
- case MAP_1000TH_INCH: bInch=sal_True; nKomma=3; break;
- case MAP_100TH_INCH : bInch=sal_True; nKomma=2; break;
- case MAP_10TH_INCH : bInch=sal_True; nKomma=1; break;
- case MAP_INCH : bInch=sal_True; nKomma=0; break;
- case MAP_POINT : bInch=sal_True; rnDiv=72; break; // 1Pt = 1/72"
- case MAP_TWIP : bInch=sal_True; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
+ case MAP_1000TH_INCH: bInch=true; nKomma=3; break;
+ case MAP_100TH_INCH : bInch=true; nKomma=2; break;
+ case MAP_10TH_INCH : bInch=true; nKomma=1; break;
+ case MAP_INCH : bInch=true; nKomma=0; break;
+ case MAP_POINT : bInch=true; rnDiv=72; break; // 1Pt = 1/72"
+ case MAP_TWIP : bInch=true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
// Sonstiges
case MAP_PIXEL : break;
case MAP_SYSFONT : break;
@@ -889,26 +691,26 @@ void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, int&
rbInch=bInch;
}
-void GetMeterOrInch(FieldUnit eFU, short& rnKomma, long& rnMul, long& rnDiv, int& rbMetr, int& rbInch)
+void GetMeterOrInch(FieldUnit eFU, short& rnKomma, long& rnMul, long& rnDiv, bool& rbMetr, bool& rbInch)
{
rnMul=1; rnDiv=1;
short nKomma=0;
- FASTBOOL bMetr=sal_False,bInch=sal_False;
+ bool bMetr=false,bInch=false;
switch (eFU) {
case FUNIT_NONE : break;
// Metrisch
- case FUNIT_100TH_MM : bMetr=sal_True; nKomma=5; break;
- case FUNIT_MM : bMetr=sal_True; nKomma=3; break;
- case FUNIT_CM : bMetr=sal_True; nKomma=2; break;
- case FUNIT_M : bMetr=sal_True; nKomma=0; break;
- case FUNIT_KM : bMetr=sal_True; nKomma=-3; break;
+ case FUNIT_100TH_MM : bMetr=true; nKomma=5; break;
+ case FUNIT_MM : bMetr=true; nKomma=3; break;
+ case FUNIT_CM : bMetr=true; nKomma=2; break;
+ case FUNIT_M : bMetr=true; nKomma=0; break;
+ case FUNIT_KM : bMetr=true; nKomma=-3; break;
// Inch
- case FUNIT_TWIP : bInch=sal_True; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
- case FUNIT_POINT : bInch=sal_True; rnDiv=72; break; // 1Pt = 1/72"
- case FUNIT_PICA : bInch=sal_True; rnDiv=6; break; // 1Pica = 1/6" ?
- case FUNIT_INCH : bInch=sal_True; break; // 1" = 1"
- case FUNIT_FOOT : bInch=sal_True; rnMul=12; break; // 1Ft = 12"
- case FUNIT_MILE : bInch=sal_True; rnMul=6336; nKomma=-1; break; // 1mile = 63360"
+ case FUNIT_TWIP : bInch=true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440"
+ case FUNIT_POINT : bInch=true; rnDiv=72; break; // 1Pt = 1/72"
+ case FUNIT_PICA : bInch=true; rnDiv=6; break; // 1Pica = 1/6" ?
+ case FUNIT_INCH : bInch=true; break; // 1" = 1"
+ case FUNIT_FOOT : bInch=true; rnMul=12; break; // 1Ft = 12"
+ case FUNIT_MILE : bInch=true; rnMul=6336; nKomma=-1; break; // 1mile = 63360"
// sonstiges
case FUNIT_CUSTOM : break;
case FUNIT_PERCENT : nKomma=2; break;
@@ -921,20 +723,29 @@ void GetMeterOrInch(FieldUnit eFU, short& rnKomma, long& rnMul, long& rnDiv, int
void SdrFormatter::Undirty()
{
if (aScale.GetNumerator()==0 || aScale.GetDenominator()==0) aScale=Fraction(1,1);
- FASTBOOL bSrcMetr,bSrcInch,bDstMetr,bDstInch;
+ bool bSrcMetr,bSrcInch,bDstMetr,bDstInch;
long nMul1,nDiv1,nMul2,nDiv2;
short nKomma1,nKomma2;
+
// Zunaechst normalisieren auf m bzw. "
- if (!bSrcFU) {
+ if (!bSrcFU)
+ {
GetMeterOrInch(eSrcMU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch);
- } else {
+ }
+ else
+ {
GetMeterOrInch(eSrcFU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch);
}
- if (!bDstFU) {
+
+ if (!bDstFU)
+ {
GetMeterOrInch(eDstMU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch);
- } else {
+ }
+ else
+ {
GetMeterOrInch(eDstFU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch);
}
+
nMul1*=nDiv2;
nDiv1*=nMul2;
nKomma1=nKomma1-nKomma2;
@@ -1138,5 +949,4 @@ void SdrFormatter::TakeUnitStr(FieldUnit eUnit, XubString& rStr)
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
+// eof
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 5c40dda1cefe..eab25b0852fc 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -25,7 +25,8 @@
#include "precompiled_svx.hxx"
#include <svx/svdundo.hxx>
-#include "svx/svditext.hxx"
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdpage.hxx>
@@ -42,49 +43,49 @@
#include <svx/svdocapt.hxx>
#include <svl/whiter.hxx>
#include <svx/e3dsceneupdater.hxx>
-
-#include "svx/svdviter.hxx"
+#include <svx/svdlegacy.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-// iterates over all views and unmarks this SdrObject if it is marked
-static void ImplUnmarkObject( SdrObject* pObj )
+sal_Bool SdrUndoAction::CanRepeat(SfxRepeatTarget& rView) const
{
- SdrViewIter aIter( pObj );
- for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
+ SdrView* pV = dynamic_cast< SdrView* >(&rView);
+
+ if(pV)
{
- pView->MarkObj( pObj, pView->GetSdrPageView(), sal_True );
+ return CanSdrRepeat(*pV);
}
-}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1(SdrUndoAction,SfxUndoAction);
-
-sal_Bool SdrUndoAction::CanRepeat(SfxRepeatTarget& rView) const
-{
- SdrView* pV=PTR_CAST(SdrView,&rView);
- if (pV!=NULL) return CanSdrRepeat(*pV);
- return sal_False;
+ return false;
}
void SdrUndoAction::Repeat(SfxRepeatTarget& rView)
{
- SdrView* pV=PTR_CAST(SdrView,&rView);
- if (pV!=NULL) SdrRepeat(*pV);
- DBG_ASSERT(pV!=NULL,"Repeat: Uebergebenes SfxRepeatTarget ist keine SdrView");
+ SdrView* pV = dynamic_cast< SdrView* >(&rView);
+
+ if(pV)
+ {
+ SdrRepeat(*pV);
+ }
+
+ DBG_ASSERT(pV, "Repeat: Uebergebenes SfxRepeatTarget ist keine SdrView");
}
XubString SdrUndoAction::GetRepeatComment(SfxRepeatTarget& rView) const
{
- SdrView* pV=PTR_CAST(SdrView,&rView);
- if (pV!=NULL) return GetSdrRepeatComment(*pV);
+ SdrView* pV = dynamic_cast< SdrView* >(&rView);
+
+ if(pV)
+ {
+ return GetSdrRepeatComment(*pV);
+ }
+
return String();
}
bool SdrUndoAction::CanSdrRepeat(SdrView& /*rView*/) const
{
- return sal_False;
+ return false;
}
void SdrUndoAction::SdrRepeat(SdrView& /*rView*/)
@@ -100,80 +101,99 @@ XubString SdrUndoAction::GetSdrRepeatComment(SdrView& /*rView*/) const
SdrUndoGroup::SdrUndoGroup(SdrModel& rNewMod)
: SdrUndoAction(rNewMod),
- aBuf(1024,32,32),
- eFunction(SDRREPFUNC_OBJ_NONE) /*#72642#*/
-{}
+ maList(),
+ meFunction(SDRREPFUNC_OBJ_NONE)
+{
+}
SdrUndoGroup::SdrUndoGroup(SdrModel& rNewMod,const String& rStr)
: SdrUndoAction(rNewMod),
- aBuf(1024,32,32),
- aComment(rStr),
- eFunction(SDRREPFUNC_OBJ_NONE)
-{}
+ maList(),
+ maComment(rStr),
+ meFunction(SDRREPFUNC_OBJ_NONE)
+{
+}
SdrUndoGroup::~SdrUndoGroup()
{
Clear();
}
+SdrUndoAction* SdrUndoGroup::GetAction(sal_uInt32 nNum) const
+{
+ if(nNum < maList.size())
+ {
+ return *(maList.begin() + nNum);
+ }
+ else
+ {
+ OSL_ENSURE(false, "SdrUndoGroup::GetAction access out of range (!)");
+ return 0;
+ }
+}
+
void SdrUndoGroup::Clear()
{
- for (sal_uIntPtr nu=0; nu<GetActionCount(); nu++) {
- SdrUndoAction* pAct=GetAction(nu);
- delete pAct;
+ for(SdrUndoActionContainerType::iterator aCandidate(maList.begin());
+ aCandidate != maList.end(); aCandidate++)
+ {
+ delete *aCandidate;
}
- aBuf.Clear();
+
+ maList.clear();
}
void SdrUndoGroup::AddAction(SdrUndoAction* pAct)
{
- aBuf.Insert(pAct,CONTAINER_APPEND);
+ maList.push_back(pAct);
}
void SdrUndoGroup::push_front( SdrUndoAction* pAct )
{
- aBuf.Insert(pAct, (sal_uIntPtr)0 );
+ maList.insert(maList.begin(), pAct);
}
void SdrUndoGroup::Undo()
{
- for (sal_uIntPtr nu=GetActionCount(); nu>0;) {
- nu--;
- SdrUndoAction* pAct=GetAction(nu);
- pAct->Undo();
+ for(SdrUndoActionContainerType::reverse_iterator aCandidate(maList.rbegin());
+ aCandidate != maList.rend(); aCandidate++)
+ {
+ (*aCandidate)->Undo();
}
}
void SdrUndoGroup::Redo()
{
- for (sal_uIntPtr nu=0; nu<GetActionCount(); nu++) {
- SdrUndoAction* pAct=GetAction(nu);
- pAct->Redo();
+ for(SdrUndoActionContainerType::iterator aCandidate(maList.begin());
+ aCandidate != maList.end(); aCandidate++)
+ {
+ (*aCandidate)->Redo();
}
}
XubString SdrUndoGroup::GetComment() const
{
- XubString aRet(aComment);
- sal_Char aSearchText[] = "%1";
- String aSearchString(aSearchText, sizeof(aSearchText)-1);
+ XubString aRet(maComment);
+ const sal_Char aSearchText[] = "%1";
+ const String aSearchString(aSearchText, sizeof(aSearchText - 1));
- aRet.SearchAndReplace(aSearchString, aObjDescription);
+ aRet.SearchAndReplace(aSearchString, maObjDescription);
return aRet;
}
bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const
{
- switch (eFunction) {
- case SDRREPFUNC_OBJ_NONE : return sal_False;
- case SDRREPFUNC_OBJ_DELETE : return rView.AreObjectsMarked();
- case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: return rView.IsCombinePossible(sal_False);
- case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : return rView.IsCombinePossible(sal_True);
- case SDRREPFUNC_OBJ_DISMANTLE_POLYS : return rView.IsDismantlePossible(sal_False);
- case SDRREPFUNC_OBJ_DISMANTLE_LINES : return rView.IsDismantlePossible(sal_True);
- case SDRREPFUNC_OBJ_CONVERTTOPOLY : return rView.IsConvertToPolyObjPossible(sal_False);
- case SDRREPFUNC_OBJ_CONVERTTOPATH : return rView.IsConvertToPathObjPossible(sal_False);
+ switch(meFunction)
+ {
+ case SDRREPFUNC_OBJ_NONE : return false;
+ case SDRREPFUNC_OBJ_DELETE : return rView.areSdrObjectsSelected();
+ case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: return rView.IsCombinePossible(false);
+ case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : return rView.IsCombinePossible(true);
+ case SDRREPFUNC_OBJ_DISMANTLE_POLYS : return rView.IsDismantlePossible(false);
+ case SDRREPFUNC_OBJ_DISMANTLE_LINES : return rView.IsDismantlePossible(true);
+ case SDRREPFUNC_OBJ_CONVERTTOPOLY : return rView.IsConvertToPolyObjPossible(false);
+ case SDRREPFUNC_OBJ_CONVERTTOPATH : return rView.IsConvertToPathObjPossible(false);
case SDRREPFUNC_OBJ_GROUP : return rView.IsGroupPossible();
case SDRREPFUNC_OBJ_UNGROUP : return rView.IsUnGroupPossible();
case SDRREPFUNC_OBJ_PUTTOTOP : return rView.IsToTopPossible();
@@ -183,21 +203,23 @@ bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const
case SDRREPFUNC_OBJ_REVORDER : return rView.IsReverseOrderPossible();
case SDRREPFUNC_OBJ_IMPORTMTF : return rView.IsImportMtfPossible();
default: break;
- } // switch
- return sal_False;
+ }
+
+ return false;
}
void SdrUndoGroup::SdrRepeat(SdrView& rView)
{
- switch (eFunction) {
+ switch(meFunction)
+ {
case SDRREPFUNC_OBJ_NONE : break;
case SDRREPFUNC_OBJ_DELETE : rView.DeleteMarked(); break;
- case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: rView.CombineMarkedObjects(sal_False); break;
- case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : rView.CombineMarkedObjects(sal_True); break;
- case SDRREPFUNC_OBJ_DISMANTLE_POLYS : rView.DismantleMarkedObjects(sal_False); break;
- case SDRREPFUNC_OBJ_DISMANTLE_LINES : rView.DismantleMarkedObjects(sal_True); break;
- case SDRREPFUNC_OBJ_CONVERTTOPOLY : rView.ConvertMarkedToPolyObj(sal_False); break;
- case SDRREPFUNC_OBJ_CONVERTTOPATH : rView.ConvertMarkedToPathObj(sal_False); break;
+ case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: rView.CombineMarkedObjects(false); break;
+ case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : rView.CombineMarkedObjects(true); break;
+ case SDRREPFUNC_OBJ_DISMANTLE_POLYS : rView.DismantleMarkedObjects(false); break;
+ case SDRREPFUNC_OBJ_DISMANTLE_LINES : rView.DismantleMarkedObjects(true); break;
+ case SDRREPFUNC_OBJ_CONVERTTOPOLY : rView.ConvertMarkedToPolyObj(false); break;
+ case SDRREPFUNC_OBJ_CONVERTTOPATH : rView.ConvertMarkedToPathObj(false); break;
case SDRREPFUNC_OBJ_GROUP : rView.GroupMarked(); break;
case SDRREPFUNC_OBJ_UNGROUP : rView.UnGroupMarked(); break;
case SDRREPFUNC_OBJ_PUTTOTOP : rView.PutMarkedToTop(); break;
@@ -207,14 +229,14 @@ void SdrUndoGroup::SdrRepeat(SdrView& rView)
case SDRREPFUNC_OBJ_REVORDER : rView.ReverseOrderOfMarked(); break;
case SDRREPFUNC_OBJ_IMPORTMTF : rView.DoImportMarkedMtf(); break;
default: break;
- } // switch
+ }
}
XubString SdrUndoGroup::GetSdrRepeatComment(SdrView& /*rView*/) const
{
- XubString aRet(aComment);
- sal_Char aSearchText[] = "%1";
- String aSearchString(aSearchText, sizeof(aSearchText)-1);
+ XubString aRet(maComment);
+ const sal_Char aSearchText[] = "%1";
+ const String aSearchString(aSearchText, sizeof(aSearchText - 1));
aRet.SearchAndReplace(aSearchString, ImpGetResStr(STR_ObjNameSingulPlural));
@@ -222,34 +244,21 @@ XubString SdrUndoGroup::GetSdrRepeatComment(SdrView& /*rView*/) const
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@@@@ @@ @@@@ @@ @@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@ @@@@@ @@@@ @@@@@ @@@@ @@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrUndoObj::SdrUndoObj(SdrObject& rNewObj):
- SdrUndoAction(*rNewObj.GetModel()),
- pObj(&rNewObj)
+SdrUndoObj::SdrUndoObj(SdrObject& rNewObj)
+: SdrUndoAction(rNewObj.getSdrModelFromSdrObject()),
+ mrSdrObject(rNewObj)
{
}
-void SdrUndoObj::GetDescriptionStringForObject( const SdrObject& _rForObject, sal_uInt16 nStrCacheID, String& rStr, FASTBOOL bRepeat )
+void SdrUndoObj::GetDescriptionStringForObject(const SdrObject& _rForObject, sal_uInt16 nStrCacheID, String& rStr, bool bRepeat)
{
rStr = ImpGetResStr(nStrCacheID);
- sal_Char aSearchText[] = "%1";
- String aSearchString(aSearchText, sizeof(aSearchText)-1);
+ const sal_Char aSearchText[] = "%1";
+ const String aSearchString(aSearchText, sizeof(aSearchText - 1));
+ const xub_StrLen nPos(rStr.Search(aSearchString));
- xub_StrLen nPos = rStr.Search(aSearchString);
-
- if(nPos != STRING_NOTFOUND)
+ if(STRING_NOTFOUND != nPos)
{
rStr.Erase(nPos, 2);
@@ -267,24 +276,18 @@ void SdrUndoObj::GetDescriptionStringForObject( const SdrObject& _rForObject, sa
}
}
-void SdrUndoObj::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, FASTBOOL bRepeat) const
+void SdrUndoObj::TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, XubString& rStr, bool bRepeat) const
{
- if ( pObj )
- GetDescriptionStringForObject( *pObj, nStrCacheID, rStr, bRepeat );
+ GetDescriptionStringForObject( mrSdrObject, nStrCacheID, rStr, bRepeat );
}
-// #94278# common call method for evtl. page change when UNDO/REDO
-// is triggered
+// #94278# common call method for evtl. page change when UNDO/REDO is triggered
void SdrUndoObj::ImpShowPageOfThisObject()
{
- if(pObj && pObj->IsInserted() && pObj->GetPage() && pObj->GetModel())
+ if(mrSdrObject.IsObjectInserted()
+ && mrSdrObject.getSdrPageFromSdrObject())
{
- SdrHint aHint(HINT_SWITCHTOPAGE);
-
- aHint.SetObject(pObj);
- aHint.SetPage(pObj->GetPage());
-
- pObj->GetModel()->Broadcast(aHint);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(mrSdrObject, HINT_SWITCHTOPAGE);
}
}
@@ -306,130 +309,152 @@ void SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rSt
}
}
-SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, FASTBOOL bStyleSheet1, FASTBOOL bSaveText)
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSaveText)
: SdrUndoObj(rNewObj),
- pUndoSet(NULL),
- pRedoSet(NULL),
- pRepeatSet(NULL),
+ mpUndoItemSet(0),
+ mpRedoItemSet(0),
+ mpRepeatItemSet(0),
mxUndoStyleSheet(),
mxRedoStyleSheet(),
- bHaveToTakeRedoSet(sal_True),
- pTextUndo(NULL),
-
- // #i8508#
- pTextRedo(NULL),
-
- pUndoGroup(NULL)
+ mpTextUndoOPO(0),
+ mpTextRedoOPO(0),
+ mpUndoGroup(0),
+ mbStyleSheet(bStyleSheet1),
+ mbHaveToTakeRedoSet(true)
{
- bStyleSheet = bStyleSheet1;
-
- SdrObjList* pOL = rNewObj.GetSubList();
- sal_Bool bIsGroup(pOL!=NULL && pOL->GetObjCount());
- sal_Bool bIs3DScene(bIsGroup && pObj->ISA(E3dScene));
+ SdrObjList* pOL = rNewObj.getChildrenOfSdrObject();
+ const bool bIsGroup(pOL && pOL->GetObjCount());
+ const bool bIs3DScene(bIsGroup && dynamic_cast< E3dScene* >(&mrSdrObject));
if(bIsGroup)
{
- // Aha, Gruppenobjekt
- pUndoGroup = new SdrUndoGroup(*pObj->GetModel());
+ mpUndoGroup = new SdrUndoGroup(mrModel);
sal_uInt32 nObjAnz(pOL->GetObjCount());
for(sal_uInt32 nObjNum(0); nObjNum < nObjAnz; nObjNum++)
{
- pUndoGroup->AddAction(
- new SdrUndoAttrObj(*pOL->GetObj(nObjNum), bStyleSheet1));
+ mpUndoGroup->AddAction(new SdrUndoAttrObj(*pOL->GetObj(nObjNum), bStyleSheet1));
}
}
if(!bIsGroup || bIs3DScene)
{
- if(pUndoSet)
+ if(mpUndoItemSet)
{
- delete pUndoSet;
+ delete mpUndoItemSet;
}
- pUndoSet = new SfxItemSet(pObj->GetMergedItemSet());
+ mpUndoItemSet = new SfxItemSet(mrSdrObject.GetMergedItemSet());
- if(bStyleSheet)
- mxUndoStyleSheet = pObj->GetStyleSheet();
+ if(mbStyleSheet)
+ {
+ mxUndoStyleSheet = mrSdrObject.GetStyleSheet();
+ }
if(bSaveText)
{
- pTextUndo = pObj->GetOutlinerParaObject();
- if(pTextUndo)
- pTextUndo = new OutlinerParaObject(*pTextUndo);
+ mpTextUndoOPO = mrSdrObject.GetOutlinerParaObject();
+
+ if(mpTextUndoOPO)
+ {
+ mpTextUndoOPO = new OutlinerParaObject(*mpTextUndoOPO);
+ }
}
}
}
SdrUndoAttrObj::~SdrUndoAttrObj()
{
- if(pUndoSet)
- delete pUndoSet;
- if(pRedoSet)
- delete pRedoSet;
- if(pRepeatSet)
- delete pRepeatSet;
- if(pUndoGroup)
- delete pUndoGroup;
- if(pTextUndo)
- delete pTextUndo;
+ if(mpUndoItemSet)
+ {
+ delete mpUndoItemSet;
+ }
+
+ if(mpRedoItemSet)
+ {
+ delete mpRedoItemSet;
+ }
+
+ if(mpRepeatItemSet)
+ {
+ delete mpRepeatItemSet;
+ }
+
+ if(mpUndoGroup)
+ {
+ delete mpUndoGroup;
+ }
- // #i8508#
- if(pTextRedo)
- delete pTextRedo;
+ if(mpTextUndoOPO)
+ {
+ delete mpTextUndoOPO;
+ }
+
+ if(mpTextRedoOPO)
+ {
+ delete mpTextRedoOPO;
+ }
}
void SdrUndoAttrObj::SetRepeatAttr(const SfxItemSet& rSet)
{
- if(pRepeatSet)
- delete pRepeatSet;
+ if(mpRepeatItemSet)
+ {
+ delete mpRepeatItemSet;
+ }
- pRepeatSet = new SfxItemSet(rSet);
+ mpRepeatItemSet = new SfxItemSet(rSet);
}
void SdrUndoAttrObj::Undo()
{
- E3DModifySceneSnapRectUpdater aUpdater(pObj);
- sal_Bool bIs3DScene(pObj && pObj->ISA(E3dScene));
+ E3DModifySceneSnapRectUpdater aUpdater(&mrSdrObject);
+ const bool bIs3DScene(dynamic_cast< E3dScene* >(&mrSdrObject));
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
- if(!pUndoGroup || bIs3DScene)
+ if(!mpUndoGroup || bIs3DScene)
{
- if(bHaveToTakeRedoSet)
+ if(mbHaveToTakeRedoSet)
{
- bHaveToTakeRedoSet = sal_False;
+ mbHaveToTakeRedoSet = false;
- if(pRedoSet)
+ if(mpRedoItemSet)
{
- delete pRedoSet;
+ delete mpRedoItemSet;
}
- pRedoSet = new SfxItemSet(pObj->GetMergedItemSet());
+ mpRedoItemSet = new SfxItemSet(mrSdrObject.GetMergedItemSet());
- if(bStyleSheet)
- mxRedoStyleSheet = pObj->GetStyleSheet();
+ if(mbStyleSheet)
+ {
+ mxRedoStyleSheet = mrSdrObject.GetStyleSheet();
+ }
- if(pTextUndo)
+ if(mpTextUndoOPO)
{
// #i8508#
- pTextRedo = pObj->GetOutlinerParaObject();
+ mpTextRedoOPO = mrSdrObject.GetOutlinerParaObject();
- if(pTextRedo)
- pTextRedo = new OutlinerParaObject(*pTextRedo);
+ if(mpTextRedoOPO)
+ {
+ mpTextRedoOPO = new OutlinerParaObject(*mpTextRedoOPO);
+ }
}
}
- if(bStyleSheet)
+ if(mbStyleSheet)
{
- mxRedoStyleSheet = pObj->GetStyleSheet();
+ mxRedoStyleSheet = mrSdrObject.GetStyleSheet();
SfxStyleSheet* pSheet = dynamic_cast< SfxStyleSheet* >(mxUndoStyleSheet.get());
- if(pSheet && pObj->GetModel() && pObj->GetModel()->GetStyleSheetPool())
+ if(pSheet && mrSdrObject.getSdrModelFromSdrObject().GetStyleSheetPool())
{
- ensureStyleSheetInStyleSheetPool(*pObj->GetModel()->GetStyleSheetPool(), *pSheet);
- pObj->SetStyleSheet(pSheet, sal_True);
+ ensureStyleSheetInStyleSheetPool(*mrSdrObject.getSdrModelFromSdrObject().GetStyleSheetPool(), *pSheet);
+ mrSdrObject.SetStyleSheet(pSheet, true);
}
else
{
@@ -437,7 +462,7 @@ void SdrUndoAttrObj::Undo()
}
}
- sdr::properties::ItemChangeBroadcaster aItemChange(*pObj);
+ sdr::properties::ItemChangeBroadcaster aItemChange(mrSdrObject);
// #105122# Since ClearItem sets back everything to normal
// it also sets fit-to-size text to non-fit-to-size text and
@@ -445,26 +470,26 @@ void SdrUndoAttrObj::Undo()
// loosing the geometry size info for the object when it is
// re-layouted from AdjustTextFrameWidthAndHeight(). This makes
// rescuing the size of the object necessary.
- const Rectangle aSnapRect = pObj->GetSnapRect();
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(mrSdrObject));
- if(pUndoSet)
+ if(mpUndoItemSet)
{
// #109587#
- if(pObj->ISA(SdrCaptionObj))
+ if(dynamic_cast< SdrCaptionObj* >(&mrSdrObject))
{
// do a more smooth item deletion here, else the text
// rect will be reformatted, especially when information regarding
// vertical text is changed. When clearing only set items it's
// slower, but safer regarding such information (it's not changed
// usually)
- SfxWhichIter aIter(*pUndoSet);
+ SfxWhichIter aIter(*mpUndoItemSet);
sal_uInt16 nWhich(aIter.FirstWhich());
while(nWhich)
{
- if(SFX_ITEM_SET != pUndoSet->GetItemState(nWhich, sal_False))
+ if(SFX_ITEM_SET != mpUndoItemSet->GetItemState(nWhich, false))
{
- pObj->ClearMergedItem(nWhich);
+ mrSdrObject.ClearMergedItem(nWhich);
}
nWhich = aIter.NextWhich();
@@ -472,48 +497,46 @@ void SdrUndoAttrObj::Undo()
}
else
{
- pObj->ClearMergedItem();
+ mrSdrObject.ClearMergedItem();
}
- pObj->SetMergedItemSet(*pUndoSet);
+ mrSdrObject.SetMergedItemSet(*mpUndoItemSet);
}
// #105122# Restore prev size here when it was changed.
- if(aSnapRect != pObj->GetSnapRect())
+ if(aSnapRange != sdr::legacy::GetSnapRange(mrSdrObject))
{
- pObj->NbcSetSnapRect(aSnapRect);
+ sdr::legacy::SetSnapRange(mrSdrObject, aSnapRange);
}
- pObj->GetProperties().BroadcastItemChange(aItemChange);
-
- if(pTextUndo)
+ if(mpTextUndoOPO)
{
- pObj->SetOutlinerParaObject(new OutlinerParaObject(*pTextUndo));
+ mrSdrObject.SetOutlinerParaObject(new OutlinerParaObject(*mpTextUndoOPO));
}
}
- if(pUndoGroup)
+ if(mpUndoGroup)
{
- pUndoGroup->Undo();
+ mpUndoGroup->Undo();
}
}
void SdrUndoAttrObj::Redo()
{
- E3DModifySceneSnapRectUpdater aUpdater(pObj);
- sal_Bool bIs3DScene(pObj && pObj->ISA(E3dScene));
+ E3DModifySceneSnapRectUpdater aUpdater(&mrSdrObject);
+ const bool bIs3DScene(dynamic_cast< E3dScene* >(&mrSdrObject));
- if(!pUndoGroup || bIs3DScene)
+ if(!mpUndoGroup || bIs3DScene)
{
- if(bStyleSheet)
+ if(mbStyleSheet)
{
- mxUndoStyleSheet = pObj->GetStyleSheet();
+ mxUndoStyleSheet = mrSdrObject.GetStyleSheet();
SfxStyleSheet* pSheet = dynamic_cast< SfxStyleSheet* >(mxRedoStyleSheet.get());
- if(pSheet && pObj->GetModel() && pObj->GetModel()->GetStyleSheetPool())
+ if(pSheet && mrSdrObject.getSdrModelFromSdrObject().GetStyleSheetPool())
{
- ensureStyleSheetInStyleSheetPool(*pObj->GetModel()->GetStyleSheetPool(), *pSheet);
- pObj->SetStyleSheet(pSheet, sal_True);
+ ensureStyleSheetInStyleSheetPool(*mrSdrObject.getSdrModelFromSdrObject().GetStyleSheetPool(), *pSheet);
+ mrSdrObject.SetStyleSheet(pSheet, true);
}
else
{
@@ -521,29 +544,29 @@ void SdrUndoAttrObj::Redo()
}
}
- sdr::properties::ItemChangeBroadcaster aItemChange(*pObj);
+ sdr::properties::ItemChangeBroadcaster aItemChange(mrSdrObject);
// #105122#
- const Rectangle aSnapRect = pObj->GetSnapRect();
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(mrSdrObject));
- if(pRedoSet)
+ if(mpRedoItemSet)
{
// #109587#
- if(pObj->ISA(SdrCaptionObj))
+ if(dynamic_cast< SdrCaptionObj* >(&mrSdrObject))
{
// do a more smooth item deletion here, else the text
// rect will be reformatted, especially when information regarding
// vertical text is changed. When clearing only set items it's
// slower, but safer regarding such information (it's not changed
// usually)
- SfxWhichIter aIter(*pRedoSet);
+ SfxWhichIter aIter(*mpRedoItemSet);
sal_uInt16 nWhich(aIter.FirstWhich());
while(nWhich)
{
- if(SFX_ITEM_SET != pRedoSet->GetItemState(nWhich, sal_False))
+ if(SFX_ITEM_SET != mpRedoItemSet->GetItemState(nWhich, false))
{
- pObj->ClearMergedItem(nWhich);
+ mrSdrObject.ClearMergedItem(nWhich);
}
nWhich = aIter.NextWhich();
@@ -551,30 +574,28 @@ void SdrUndoAttrObj::Redo()
}
else
{
- pObj->ClearMergedItem();
+ mrSdrObject.ClearMergedItem();
}
- pObj->SetMergedItemSet(*pRedoSet);
+ mrSdrObject.SetMergedItemSet(*mpRedoItemSet);
}
// #105122# Restore prev size here when it was changed.
- if(aSnapRect != pObj->GetSnapRect())
+ if(aSnapRange != sdr::legacy::GetSnapRange(mrSdrObject))
{
- pObj->NbcSetSnapRect(aSnapRect);
+ sdr::legacy::SetSnapRange(mrSdrObject, aSnapRange);
}
- pObj->GetProperties().BroadcastItemChange(aItemChange);
-
// #i8508#
- if(pTextRedo)
+ if(mpTextRedoOPO)
{
- pObj->SetOutlinerParaObject(new OutlinerParaObject(*pTextRedo));
+ mrSdrObject.SetOutlinerParaObject(new OutlinerParaObject(*mpTextRedoOPO));
}
}
- if(pUndoGroup)
+ if(mpUndoGroup)
{
- pUndoGroup->Redo();
+ mpUndoGroup->Redo();
}
// #94278# Trigger PageChangeCall
@@ -585,13 +606,13 @@ XubString SdrUndoAttrObj::GetComment() const
{
XubString aStr;
- if(bStyleSheet)
+ if(mbStyleSheet)
{
- ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr);
+ TakeMarkedDescriptionString(STR_EditSetStylesheet, aStr);
}
else
{
- ImpTakeDescriptionStr(STR_EditSetAttributes, aStr);
+ TakeMarkedDescriptionString(STR_EditSetAttributes, aStr);
}
return aStr;
@@ -599,28 +620,28 @@ XubString SdrUndoAttrObj::GetComment() const
void SdrUndoAttrObj::SdrRepeat(SdrView& rView)
{
- if(pRepeatSet)
+ if(mpRepeatItemSet)
{
- rView.SetAttrToMarked(*pRepeatSet, sal_False);
+ rView.SetAttrToMarked(*mpRepeatItemSet, false);
}
}
bool SdrUndoAttrObj::CanSdrRepeat(SdrView& rView) const
{
- return (pRepeatSet!=0L && rView.AreObjectsMarked());
+ return (mpRepeatItemSet && rView.areSdrObjectsSelected());
}
XubString SdrUndoAttrObj::GetSdrRepeatComment(SdrView& /*rView*/) const
{
XubString aStr;
- if(bStyleSheet)
+ if(mbStyleSheet)
{
- ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr, sal_True);
+ TakeMarkedDescriptionString(STR_EditSetStylesheet, aStr, true);
}
else
{
- ImpTakeDescriptionStr(STR_EditSetAttributes, aStr, sal_True);
+ TakeMarkedDescriptionString(STR_EditSetAttributes, aStr, true);
}
return aStr;
@@ -628,74 +649,47 @@ XubString SdrUndoAttrObj::GetSdrRepeatComment(SdrView& /*rView*/) const
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrUndoMoveObj::Undo()
-{
- // #94278# Trigger PageChangeCall
- ImpShowPageOfThisObject();
-
- pObj->Move(Size(-aDistance.Width(),-aDistance.Height()));
-}
-
-void SdrUndoMoveObj::Redo()
-{
- pObj->Move(Size(aDistance.Width(),aDistance.Height()));
-
- // #94278# Trigger PageChangeCall
- ImpShowPageOfThisObject();
-}
-
-XubString SdrUndoMoveObj::GetComment() const
-{
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditMove,aStr);
- return aStr;
-}
-
-void SdrUndoMoveObj::SdrRepeat(SdrView& rView)
-{
- rView.MoveMarkedObj(aDistance);
-}
-
-bool SdrUndoMoveObj::CanSdrRepeat(SdrView& rView) const
-{
- return rView.AreObjectsMarked();
-}
-
-XubString SdrUndoMoveObj::GetSdrRepeatComment(SdrView& /*rView*/) const
+SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj):
+ SdrUndoObj(rNewObj),
+ mpUndoSdrObjGeoData(0),
+ mpRedoSdrObjGeoData(0),
+ mpUndoGroup(0)
{
- XubString aStr;
- ImpTakeDescriptionStr(STR_EditMove,aStr,sal_True);
- return aStr;
-}
+ SdrObjList* pOL = rNewObj.getChildrenOfSdrObject();
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ if(pOL && pOL->GetObjCount() && !dynamic_cast< E3dScene* >(&rNewObj))
+ {
+ // Aha, Gruppenobjekt, aber keine 3D-Szene, dann nur fuer die Szene selbst den Undo anlegen
+ mpUndoGroup = new SdrUndoGroup(mrModel);
+ const sal_uInt32 nObjAnz(pOL->GetObjCount());
-SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj):
- SdrUndoObj(rNewObj),
- pUndoGeo(NULL),
- pRedoGeo(NULL),
- pUndoGroup(NULL)
-{
- SdrObjList* pOL=rNewObj.GetSubList();
- if (pOL!=NULL && pOL->GetObjCount() && !rNewObj.ISA(E3dScene))
- {
- // Aha, Gruppenobjekt
- // AW: Aber keine 3D-Szene, dann nur fuer die Szene selbst den Undo anlegen
- pUndoGroup=new SdrUndoGroup(*pObj->GetModel());
- sal_uIntPtr nObjAnz=pOL->GetObjCount();
- for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz; nObjNum++) {
- pUndoGroup->AddAction(new SdrUndoGeoObj(*pOL->GetObj(nObjNum)));
+ for(sal_uInt32 nObjNum(0); nObjNum < nObjAnz; nObjNum++)
+ {
+ mpUndoGroup->AddAction(new SdrUndoGeoObj(*pOL->GetObj(nObjNum)));
}
- } else {
- pUndoGeo=pObj->GetGeoData();
+ }
+ else
+ {
+ mpUndoSdrObjGeoData = mrSdrObject.GetGeoData();
}
}
SdrUndoGeoObj::~SdrUndoGeoObj()
{
- if (pUndoGeo!=NULL) delete pUndoGeo;
- if (pRedoGeo!=NULL) delete pRedoGeo;
- if (pUndoGroup!=NULL) delete pUndoGroup;
+ if(mpUndoSdrObjGeoData)
+ {
+ delete mpUndoSdrObjGeoData;
+ }
+
+ if(mpRedoSdrObjGeoData)
+ {
+ delete mpRedoSdrObjGeoData;
+ }
+
+ if(mpUndoGroup)
+ {
+ delete mpUndoGroup;
+ }
}
void SdrUndoGeoObj::Undo()
@@ -703,37 +697,45 @@ void SdrUndoGeoObj::Undo()
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
- if(pUndoGroup)
+ if(mpUndoGroup)
{
- pUndoGroup->Undo();
+ mpUndoGroup->Undo();
// #97172#
// only repaint, no objectchange
- pObj->ActionChanged();
+ mrSdrObject.ActionChanged();
}
else
{
- if (pRedoGeo!=NULL) delete pRedoGeo;
- pRedoGeo=pObj->GetGeoData();
- pObj->SetGeoData(*pUndoGeo);
+ if(mpRedoSdrObjGeoData)
+ {
+ delete mpRedoSdrObjGeoData;
+ }
+
+ mpRedoSdrObjGeoData = mrSdrObject.GetGeoData();
+ mrSdrObject.SetGeoData(*mpUndoSdrObjGeoData);
}
}
void SdrUndoGeoObj::Redo()
{
- if(pUndoGroup)
+ if(mpUndoGroup)
{
- pUndoGroup->Redo();
+ mpUndoGroup->Redo();
// #97172#
// only repaint, no objectchange
- pObj->ActionChanged();
+ mrSdrObject.ActionChanged();
}
else
{
- if (pUndoGeo!=NULL) delete pUndoGeo;
- pUndoGeo=pObj->GetGeoData();
- pObj->SetGeoData(*pRedoGeo);
+ if(mpUndoSdrObjGeoData)
+ {
+ delete mpUndoSdrObjGeoData;
+ }
+
+ mpUndoSdrObjGeoData = mrSdrObject.GetGeoData();
+ mrSdrObject.SetGeoData(*mpRedoSdrObjGeoData);
}
// #94278# Trigger PageChangeCall
@@ -743,41 +745,38 @@ void SdrUndoGeoObj::Redo()
XubString SdrUndoGeoObj::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_DragMethObjOwn,aStr);
+ TakeMarkedDescriptionString(STR_DragMethObjOwn,aStr);
return aStr;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect)
+SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj)
: SdrUndoObj(rNewObj),
- bOwner(sal_False),
- pView(NULL),
- pPageView(NULL)
+ mpObjList(0),
+ mnOrdNum(0),
+ mbOwner(false)
{
- pObjList=pObj->GetObjList();
- if (bOrdNumDirect) {
- nOrdNum=pObj->GetOrdNumDirect();
- } else {
- nOrdNum=pObj->GetOrdNum();
- }
+ mpObjList = mrSdrObject.getParentOfSdrObject();
+ mnOrdNum = mrSdrObject.GetNavigationPosition();
}
SdrUndoObjList::~SdrUndoObjList()
{
- if (pObj!=NULL && IsOwner())
+ if(IsOwner())
{
// Attribute muessen wieder in den regulaeren Pool
- SetOwner(sal_False);
+ SetOwner(false);
// nun loeschen
- SdrObject::Free( pObj );
+ SdrObject* pPointer(&mrSdrObject);
+ deleteSdrObjectSafeAndClearPointer( pPointer );
}
}
void SdrUndoObjList::SetOwner(bool bNew)
{
- bOwner = bNew;
+ mbOwner = bNew;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -787,41 +786,44 @@ void SdrUndoRemoveObj::Undo()
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
- DBG_ASSERT(!pObj->IsInserted(),"UndoRemoveObj: pObj ist bereits Inserted");
- if (!pObj->IsInserted())
+ DBG_ASSERT(!mrSdrObject.IsObjectInserted(),"UndoRemoveObj: mrSdrObject ist bereits Inserted");
+
+ if(!mrSdrObject.IsObjectInserted())
{
// #i11426#
// For UNDOs in Calc/Writer it is necessary to adapt the anchor
// pos of the target object.
- Point aOwnerAnchorPos(0, 0);
+ basegfx::B2DPoint aOwnerAnchorPos(0.0, 0.0);
- if(pObjList
- && pObjList->GetOwnerObj()
- && pObjList->GetOwnerObj()->ISA(SdrObjGroup))
+ if(mpObjList)
{
- aOwnerAnchorPos = pObjList->GetOwnerObj()->GetAnchorPos();
+ SdrObject* pOwner = mpObjList->getSdrObjectFromSdrObjList();
+
+ if(pOwner)
+ {
+ aOwnerAnchorPos = pOwner->GetAnchorPos();
}
- E3DModifySceneSnapRectUpdater aUpdater(pObjList->GetOwnerObj());
- SdrInsertReason aReason(SDRREASON_UNDO);
- pObjList->InsertObject(pObj,nOrdNum,&aReason);
+ E3DModifySceneSnapRectUpdater aUpdater(pOwner);
+ mpObjList->InsertObjectToSdrObjList(mrSdrObject, mnOrdNum);
+ }
// #i11426#
- if(aOwnerAnchorPos.X() || aOwnerAnchorPos.Y())
+ if(!aOwnerAnchorPos.equalZero())
{
- pObj->NbcSetAnchorPos(aOwnerAnchorPos);
+ mrSdrObject.SetAnchorPos(aOwnerAnchorPos);
}
}
}
void SdrUndoRemoveObj::Redo()
{
- DBG_ASSERT(pObj->IsInserted(),"RedoRemoveObj: pObj ist nicht Inserted");
- if (pObj->IsInserted())
+ DBG_ASSERT(mrSdrObject.IsObjectInserted(),"RedoRemoveObj: mrSdrObject ist nicht Inserted");
+
+ if (mrSdrObject.IsObjectInserted())
{
- ImplUnmarkObject( pObj );
- E3DModifySceneSnapRectUpdater aUpdater(pObj);
- pObjList->RemoveObject(nOrdNum);
+ E3DModifySceneSnapRectUpdater aUpdater(&mrSdrObject);
+ mpObjList->RemoveObjectFromSdrObjList(mnOrdNum);
}
// #94278# Trigger PageChangeCall
@@ -835,45 +837,44 @@ void SdrUndoInsertObj::Undo()
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
- DBG_ASSERT(pObj->IsInserted(),"UndoInsertObj: pObj ist nicht Inserted");
- if (pObj->IsInserted())
- {
- ImplUnmarkObject( pObj );
+ DBG_ASSERT(mrSdrObject.IsObjectInserted(),"UndoInsertObj: mrSdrObject ist nicht Inserted");
+ if (mrSdrObject.IsObjectInserted())
+ {
#ifdef DBG_UTIL
SdrObject* pChkObj=
#endif
- pObjList->RemoveObject(nOrdNum);
- DBG_ASSERT(pChkObj==pObj,"UndoInsertObj: RemoveObjNum!=pObj");
+ mpObjList->RemoveObjectFromSdrObjList(mnOrdNum);
+
+ DBG_ASSERT(pChkObj == &mrSdrObject,"UndoInsertObj: RemoveObjNum!=mrSdrObject");
}
}
void SdrUndoInsertObj::Redo()
{
- DBG_ASSERT(!pObj->IsInserted(),"RedoInsertObj: pObj ist bereits Inserted");
- if (!pObj->IsInserted())
+ DBG_ASSERT(!mrSdrObject.IsObjectInserted(),"RedoInsertObj: mrSdrObject ist bereits Inserted");
+
+ if (!mrSdrObject.IsObjectInserted())
{
- // --> OD 2005-05-10 #i45952# - restore anchor position of an object,
+ // OD 2005-05-10 #i45952# - restore anchor position of an object,
// which becomes a member of a group, because its cleared in method
- // <InsertObject(..)>. Needed for correct ReDo in Writer.
- Point aAnchorPos( 0, 0 );
- if ( pObjList &&
- pObjList->GetOwnerObj() &&
- pObjList->GetOwnerObj()->ISA(SdrObjGroup) )
+ // <InsertObjectToSdrObjList(..)>. Needed for correct ReDo in Writer.
+ basegfx::B2DPoint aAnchorPos( 0.0, 0.0 );
+
+ if( mpObjList )
{
- aAnchorPos = pObj->GetAnchorPos();
- }
- // <--
+ if(mpObjList->getSdrObjectFromSdrObjList())
+ {
+ aAnchorPos = mrSdrObject.GetAnchorPos();
+ }
- SdrInsertReason aReason(SDRREASON_UNDO);
- pObjList->InsertObject(pObj,nOrdNum,&aReason);
+ mpObjList->InsertObjectToSdrObjList(mrSdrObject, mnOrdNum);
+ }
- // --> OD 2005-05-10 #i45952#
- if ( aAnchorPos.X() || aAnchorPos.Y() )
+ if ( !aAnchorPos.equalZero() )
{
- pObj->NbcSetAnchorPos( aAnchorPos );
+ mrSdrObject.SetAnchorPos( aAnchorPos );
}
- // <--
}
// #94278# Trigger PageChangeCall
@@ -885,21 +886,21 @@ void SdrUndoInsertObj::Redo()
void SdrUndoDelObj::Undo()
{
SdrUndoRemoveObj::Undo();
- DBG_ASSERT(IsOwner(),"UndoDeleteObj: pObj gehoert nicht der UndoAction");
- SetOwner(sal_False);
+ DBG_ASSERT(IsOwner(),"UndoDeleteObj: mrSdrObject gehoert nicht der UndoAction");
+ SetOwner(false);
}
void SdrUndoDelObj::Redo()
{
SdrUndoRemoveObj::Redo();
- DBG_ASSERT(!IsOwner(),"RedoDeleteObj: pObj gehoert bereits der UndoAction");
- SetOwner(sal_True);
+ DBG_ASSERT(!IsOwner(),"RedoDeleteObj: mrSdrObject gehoert bereits der UndoAction");
+ SetOwner(true);
}
XubString SdrUndoDelObj::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_EditDelete,aStr);
+ TakeMarkedDescriptionString(STR_EditDelete,aStr);
return aStr;
}
@@ -910,13 +911,13 @@ void SdrUndoDelObj::SdrRepeat(SdrView& rView)
bool SdrUndoDelObj::CanSdrRepeat(SdrView& rView) const
{
- return rView.AreObjectsMarked();
+ return rView.areSdrObjectsSelected();
}
XubString SdrUndoDelObj::GetSdrRepeatComment(SdrView& /*rView*/) const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_EditDelete,aStr,sal_True);
+ TakeMarkedDescriptionString(STR_EditDelete,aStr,true);
return aStr;
}
@@ -925,15 +926,15 @@ XubString SdrUndoDelObj::GetSdrRepeatComment(SdrView& /*rView*/) const
void SdrUndoNewObj::Undo()
{
SdrUndoInsertObj::Undo();
- DBG_ASSERT(!IsOwner(),"RedoNewObj: pObj gehoert bereits der UndoAction");
- SetOwner(sal_True);
+ DBG_ASSERT(!IsOwner(),"RedoNewObj: mrSdrObject gehoert bereits der UndoAction");
+ SetOwner(true);
}
void SdrUndoNewObj::Redo()
{
SdrUndoInsertObj::Redo();
- DBG_ASSERT(IsOwner(),"RedoNewObj: pObj gehoert nicht der UndoAction");
- SetOwner(sal_False);
+ DBG_ASSERT(IsOwner(),"RedoNewObj: mrSdrObject gehoert nicht der UndoAction");
+ SetOwner(false);
}
String SdrUndoNewObj::GetComment( const SdrObject& _rForObject )
@@ -946,43 +947,44 @@ String SdrUndoNewObj::GetComment( const SdrObject& _rForObject )
XubString SdrUndoNewObj::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoInsertObj,aStr);
+ TakeMarkedDescriptionString(STR_UndoInsertObj,aStr);
return aStr;
}
-SdrUndoReplaceObj::SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1, bool bOrdNumDirect)
+SdrUndoReplaceObj::SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1)
: SdrUndoObj(rOldObj1),
- bOldOwner(sal_False),
- bNewOwner(sal_False),
- pNewObj(&rNewObj1)
+ mpObjList(0),
+ mnOrdNum(0),
+ mrNewSdrObject(rNewObj1),
+ mbOldOwner(false),
+ mbNewOwner(false)
{
- SetOldOwner(sal_True);
+ SetOldOwner(true);
- pObjList=pObj->GetObjList();
- if (bOrdNumDirect) {
- nOrdNum=pObj->GetOrdNumDirect();
- } else {
- nOrdNum=pObj->GetOrdNum();
- }
+ mpObjList = mrSdrObject.getParentOfSdrObject();
+ mnOrdNum = mrSdrObject.GetNavigationPosition();
}
SdrUndoReplaceObj::~SdrUndoReplaceObj()
{
- if (pObj!=NULL && IsOldOwner())
+ if (IsOldOwner())
{
// Attribute muessen wieder in den regulaeren Pool
- SetOldOwner(sal_False);
+ SetOldOwner(false);
// nun loeschen
- SdrObject::Free( pObj );
+ SdrObject* pPointer(&mrSdrObject);
+ deleteSdrObjectSafeAndClearPointer( pPointer );
}
- if (pNewObj!=NULL && IsNewOwner())
+
+ if (IsNewOwner())
{
// Attribute muessen wieder in den regulaeren Pool
- SetNewOwner(sal_False);
+ SetNewOwner(false);
// nun loeschen
- SdrObject::Free( pNewObj );
+ SdrObject* pPointer(&mrNewSdrObject);
+ deleteSdrObjectSafeAndClearPointer( pPointer );
}
}
@@ -993,13 +995,13 @@ void SdrUndoReplaceObj::Undo()
if (IsOldOwner() && !IsNewOwner())
{
- DBG_ASSERT(!pObj->IsInserted(),"SdrUndoReplaceObj::Undo(): Altes Objekt ist bereits inserted!");
- DBG_ASSERT(pNewObj->IsInserted(),"SdrUndoReplaceObj::Undo(): Neues Objekt ist nicht inserted!");
- SetOldOwner(sal_False);
- SetNewOwner(sal_True);
+ DBG_ASSERT(!mrSdrObject.IsObjectInserted(),"SdrUndoReplaceObj::Undo(): Altes Objekt ist bereits inserted!");
+ DBG_ASSERT(mrNewSdrObject.IsObjectInserted(),"SdrUndoReplaceObj::Undo(): Neues Objekt ist nicht inserted!");
- ImplUnmarkObject( pNewObj );
- pObjList->ReplaceObject(pObj,nOrdNum);
+ SetOldOwner(false);
+ SetNewOwner(true);
+
+ mpObjList->ReplaceObjectInSdrObjList(mrSdrObject, mnOrdNum);
}
else
{
@@ -1011,14 +1013,13 @@ void SdrUndoReplaceObj::Redo()
{
if (!IsOldOwner() && IsNewOwner())
{
- DBG_ASSERT(!pNewObj->IsInserted(),"SdrUndoReplaceObj::Redo(): Neues Objekt ist bereits inserted!");
- DBG_ASSERT(pObj->IsInserted(),"SdrUndoReplaceObj::Redo(): Altes Objekt ist nicht inserted!");
- SetOldOwner(sal_True);
- SetNewOwner(sal_False);
+ DBG_ASSERT(!mrNewSdrObject.IsObjectInserted(),"SdrUndoReplaceObj::Redo(): Neues Objekt ist bereits inserted!");
+ DBG_ASSERT(mrSdrObject.IsObjectInserted(),"SdrUndoReplaceObj::Redo(): Altes Objekt ist nicht inserted!");
- ImplUnmarkObject( pObj );
- pObjList->ReplaceObject(pNewObj,nOrdNum);
+ SetOldOwner(true);
+ SetNewOwner(false);
+ mpObjList->ReplaceObjectInSdrObjList(mrNewSdrObject,mnOrdNum);
}
else
{
@@ -1031,12 +1032,12 @@ void SdrUndoReplaceObj::Redo()
void SdrUndoReplaceObj::SetNewOwner(bool bNew)
{
- bNewOwner = bNew;
+ mbNewOwner = bNew;
}
void SdrUndoReplaceObj::SetOldOwner(bool bNew)
{
- bOldOwner = bNew;
+ mbOldOwner = bNew;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1044,7 +1045,7 @@ void SdrUndoReplaceObj::SetOldOwner(bool bNew)
XubString SdrUndoCopyObj::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoCopyObj,aStr);
+ TakeMarkedDescriptionString(STR_UndoCopyObj,aStr);
return aStr;
}
@@ -1061,21 +1062,21 @@ SdrUndoObjectLayerChange::SdrUndoObjectLayerChange(SdrObject& rObj, SdrLayerID a
void SdrUndoObjectLayerChange::Undo()
{
ImpShowPageOfThisObject();
- pObj->SetLayer(maOldLayer);
+ mrSdrObject.SetLayer(maOldLayer);
}
void SdrUndoObjectLayerChange::Redo()
{
- pObj->SetLayer(maNewLayer);
+ mrSdrObject.SetLayer(maNewLayer);
ImpShowPageOfThisObject();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1):
- SdrUndoObj(rNewObj),
- nOldOrdNum(nOldOrdNum1),
- nNewOrdNum(nNewOrdNum1)
+SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
+: SdrUndoObj(rNewObj),
+ mnOldOrdNum(nOldOrdNum1),
+ mnNewOrdNum(nNewOrdNum1)
{
}
@@ -1084,22 +1085,28 @@ void SdrUndoObjOrdNum::Undo()
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
- SdrObjList* pOL=pObj->GetObjList();
- if (pOL==NULL) {
- DBG_ERROR("UndoObjOrdNum: pObj hat keine ObjList");
+ SdrObjList* pOL = mrSdrObject.getParentOfSdrObject();
+
+ if(!pOL)
+ {
+ DBG_ERROR("UndoObjOrdNum: mrSdrObject hat keine ObjList");
return;
}
- pOL->SetObjectOrdNum(nNewOrdNum,nOldOrdNum);
+
+ pOL->SetNavigationPosition(mnNewOrdNum, mnOldOrdNum);
}
void SdrUndoObjOrdNum::Redo()
{
- SdrObjList* pOL=pObj->GetObjList();
- if (pOL==NULL) {
- DBG_ERROR("RedoObjOrdNum: pObj hat keine ObjList");
+ SdrObjList* pOL = mrSdrObject.getParentOfSdrObject();
+
+ if(!pOL)
+ {
+ DBG_ERROR("RedoObjOrdNum: mrSdrObject hat keine ObjList");
return;
}
- pOL->SetObjectOrdNum(nOldOrdNum,nNewOrdNum);
+
+ pOL->SetNavigationPosition(mnOldOrdNum, mnNewOrdNum);
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
@@ -1108,43 +1115,55 @@ void SdrUndoObjOrdNum::Redo()
XubString SdrUndoObjOrdNum::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoObjOrdNum,aStr);
+ TakeMarkedDescriptionString(STR_UndoObjOrdNum,aStr);
return aStr;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrUndoObjSetText::SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText)
-: SdrUndoObj(rNewObj)
-, pOldText(NULL)
-, pNewText(NULL)
-, bNewTextAvailable(sal_False)
-, bEmptyPresObj(sal_False)
-, mnText(nText)
+: SdrUndoObj(rNewObj),
+ mpOldText(0),
+ mpNewText(0),
+ mnText(nText),
+ mbNewTextAvailable(false),
+ mbEmptyPresObj(false)
{
SdrText* pText = static_cast< SdrTextObj*>( &rNewObj )->getText(mnText);
+
if( pText && pText->GetOutlinerParaObject() )
- pOldText = new OutlinerParaObject(*pText->GetOutlinerParaObject());
+ {
+ mpOldText = new OutlinerParaObject(*pText->GetOutlinerParaObject());
+ }
- bEmptyPresObj = rNewObj.IsEmptyPresObj();
+ mbEmptyPresObj = rNewObj.IsEmptyPresObj();
}
SdrUndoObjSetText::~SdrUndoObjSetText()
{
- if ( pOldText )
- delete pOldText;
- if ( pNewText )
- delete pNewText;
+ if ( mpOldText )
+ {
+ delete mpOldText;
+ }
+
+ if ( mpNewText )
+ {
+ delete mpNewText;
+ }
}
void SdrUndoObjSetText::AfterSetText()
{
- if (!bNewTextAvailable)
+ if (!mbNewTextAvailable)
{
- SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
+ SdrText* pText = static_cast< SdrTextObj*>( &mrSdrObject )->getText(mnText);
+
if( pText && pText->GetOutlinerParaObject() )
- pNewText = new OutlinerParaObject(*pText->GetOutlinerParaObject());
- bNewTextAvailable=sal_True;
+ {
+ mpNewText = new OutlinerParaObject(*pText->GetOutlinerParaObject());
+ }
+
+ mbNewTextAvailable = true;
}
}
@@ -1154,35 +1173,48 @@ void SdrUndoObjSetText::Undo()
ImpShowPageOfThisObject();
// alten Text sichern fuer Redo
- if (!bNewTextAvailable)
+ if (!mbNewTextAvailable)
+ {
AfterSetText();
+ }
// Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung
- OutlinerParaObject* pText1 = pOldText;
+ OutlinerParaObject* pText1 = mpOldText;
+
if(pText1)
+ {
pText1 = new OutlinerParaObject(*pText1);
+ }
+
+ SdrText* pText = static_cast< SdrTextObj*>( &mrSdrObject )->getText(mnText);
- SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
if( pText )
+ {
pText->SetOutlinerParaObject(pText1);
+ }
- pObj->SetEmptyPresObj( bEmptyPresObj );
- pObj->ActionChanged();
+ mrSdrObject.SetEmptyPresObj( mbEmptyPresObj );
+ mrSdrObject.ActionChanged();
}
void SdrUndoObjSetText::Redo()
{
// Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung
- OutlinerParaObject* pText1 = pNewText;
+ OutlinerParaObject* pText1 = mpNewText;
if(pText1)
+ {
pText1 = new OutlinerParaObject(*pText1);
+ }
+
+ SdrText* pText = static_cast< SdrTextObj*>( &mrSdrObject )->getText(mnText);
- SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
if( pText )
- static_cast< SdrTextObj* >( pObj )->NbcSetOutlinerParaObjectForText( pText1, pText );
+ {
+ static_cast< SdrTextObj* >( &mrSdrObject )->SetOutlinerParaObjectForText( pText1, pText );
+ }
- pObj->ActionChanged();
+ mrSdrObject.ActionChanged();
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
@@ -1191,67 +1223,77 @@ void SdrUndoObjSetText::Redo()
XubString SdrUndoObjSetText::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoObjSetText,aStr);
+ TakeMarkedDescriptionString(STR_UndoObjSetText,aStr);
return aStr;
}
XubString SdrUndoObjSetText::GetSdrRepeatComment(SdrView& /*rView*/) const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoObjSetText,aStr);
+ TakeMarkedDescriptionString(STR_UndoObjSetText,aStr);
return aStr;
}
void SdrUndoObjSetText::SdrRepeat(SdrView& rView)
{
- if (bNewTextAvailable && rView.AreObjectsMarked())
+ if (mbNewTextAvailable && rView.areSdrObjectsSelected())
{
- const SdrMarkList& rML=rView.GetMarkedObjectList();
+ const bool bUndo(rView.IsUndoEnabled());
- const bool bUndo = rView.IsUndoEnabled();
if( bUndo )
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoObjSetText,aStr);
+ TakeMarkedDescriptionString(STR_UndoObjSetText,aStr);
rView.BegUndo(aStr);
}
- sal_uIntPtr nAnz=rML.GetMarkCount();
- for (sal_uIntPtr nm=0; nm<nAnz; nm++)
+ if(rView.areSdrObjectsSelected())
{
- SdrObject* pObj2=rML.GetMark(nm)->GetMarkedSdrObj();
- SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pObj2);
- if (pTextObj!=NULL)
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 nm(0); nm < aSelection.size(); nm++)
{
- if( bUndo )
- rView.AddUndo(new SdrUndoObjSetText(*pTextObj,0));
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(aSelection[nm]);
+
+ if (pTextObj)
+ {
+ if( bUndo )
+ {
+ rView.AddUndo(new SdrUndoObjSetText(*pTextObj,0));
+ }
- OutlinerParaObject* pText1=pNewText;
- if (pText1!=NULL)
- pText1 = new OutlinerParaObject(*pText1);
- pTextObj->SetOutlinerParaObject(pText1);
+ OutlinerParaObject* pText1 = mpNewText;
+
+ if (pText1)
+ {
+ pText1 = new OutlinerParaObject(*pText1);
+ }
+
+ pTextObj->SetOutlinerParaObject(pText1);
+ }
}
}
if( bUndo )
+ {
rView.EndUndo();
+ }
}
}
bool SdrUndoObjSetText::CanSdrRepeat(SdrView& rView) const
{
- bool bOk=sal_False;
- if (bNewTextAvailable && rView.AreObjectsMarked()) {
- bOk=sal_True;
+ bool bOk(false);
+
+ if(mbNewTextAvailable && rView.areSdrObjectsSelected())
+ {
+ bOk = true;
}
+
return bOk;
}
-// --> OD 2009-07-09 #i73249#
-SdrUndoObjStrAttr::SdrUndoObjStrAttr( SdrObject& rNewObj,
- const ObjStrAttrType eObjStrAttr,
- const String& sOldStr,
- const String& sNewStr)
+SdrUndoObjStrAttr::SdrUndoObjStrAttr(SdrObject& rNewObj, const ObjStrAttrType eObjStrAttr, const String& sOldStr, const String& sNewStr)
: SdrUndoObj( rNewObj ),
meObjStrAttr( eObjStrAttr ),
msOldStr( sOldStr ),
@@ -1267,19 +1309,19 @@ void SdrUndoObjStrAttr::Undo()
{
case OBJ_NAME:
{
- pObj->SetName( msOldStr );
+ mrSdrObject.SetName( msOldStr );
+ break;
}
- break;
case OBJ_TITLE:
{
- pObj->SetTitle( msOldStr );
+ mrSdrObject.SetTitle( msOldStr );
+ break;
}
- break;
case OBJ_DESCRIPTION:
{
- pObj->SetDescription( msOldStr );
+ mrSdrObject.SetDescription( msOldStr );
+ break;
}
- break;
}
}
@@ -1289,19 +1331,19 @@ void SdrUndoObjStrAttr::Redo()
{
case OBJ_NAME:
{
- pObj->SetName( msNewStr );
+ mrSdrObject.SetName( msNewStr );
+ break;
}
- break;
case OBJ_TITLE:
{
- pObj->SetTitle( msNewStr );
+ mrSdrObject.SetTitle( msNewStr );
+ break;
}
- break;
case OBJ_DESCRIPTION:
{
- pObj->SetDescription( msNewStr );
+ mrSdrObject.SetDescription( msNewStr );
+ break;
}
- break;
}
ImpShowPageOfThisObject();
@@ -1310,59 +1352,49 @@ void SdrUndoObjStrAttr::Redo()
String SdrUndoObjStrAttr::GetComment() const
{
String aStr;
+
switch ( meObjStrAttr )
{
case OBJ_NAME:
{
- ImpTakeDescriptionStr( STR_UndoObjName, aStr );
+ TakeMarkedDescriptionString( STR_UndoObjName, aStr );
aStr += sal_Unicode(' ');
aStr += sal_Unicode('\'');
aStr += msNewStr;
aStr += sal_Unicode('\'');
+ break;
}
- break;
case OBJ_TITLE:
{
- ImpTakeDescriptionStr( STR_UndoObjTitle, aStr );
+ TakeMarkedDescriptionString( STR_UndoObjTitle, aStr );
+ break;
}
- break;
case OBJ_DESCRIPTION:
{
- ImpTakeDescriptionStr( STR_UndoObjDescription, aStr );
+ TakeMarkedDescriptionString( STR_UndoObjDescription, aStr );
+ break;
}
- break;
}
return aStr;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@@@ @@ @@ @@@@@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@@@@@ @@@@ @@@@ @@@@@
-// @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@ @@ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel):
- SdrUndoAction(rNewModel),
- pLayer(rNewLayerAdmin.GetLayer(nLayerNum)),
- pLayerAdmin(&rNewLayerAdmin),
- nNum(nLayerNum),
- bItsMine(sal_False)
+SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
+: SdrUndoAction(rNewModel),
+ mpLayer(rNewLayerAdmin.GetLayer(nLayerNum)),
+ mrLayerAdmin(rNewLayerAdmin),
+ mnLayerNum(nLayerNum),
+ mbItsMine(false)
{
}
SdrUndoLayer::~SdrUndoLayer()
{
- if (bItsMine) {
- delete pLayer;
+ if (mbItsMine)
+ {
+ delete mpLayer;
}
}
@@ -1370,20 +1402,23 @@ SdrUndoLayer::~SdrUndoLayer()
void SdrUndoNewLayer::Undo()
{
- DBG_ASSERT(!bItsMine,"SdrUndoNewLayer::Undo(): Layer gehoert bereits der UndoAction");
- bItsMine=sal_True;
+ DBG_ASSERT(!mbItsMine,"SdrUndoNewLayer::Undo(): Layer gehoert bereits der UndoAction");
+
+ mbItsMine = true;
+
#ifdef DBG_UTIL
SdrLayer* pCmpLayer=
#endif
- pLayerAdmin->RemoveLayer(nNum);
- DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoNewLayer::Undo(): Removter Layer ist != pLayer");
+ mrLayerAdmin.RemoveLayer(mnLayerNum);
+
+ DBG_ASSERT(pCmpLayer == mpLayer,"SdrUndoNewLayer::Undo(): Removter Layer ist != mpLayer");
}
void SdrUndoNewLayer::Redo()
{
- DBG_ASSERT(bItsMine,"SdrUndoNewLayer::Undo(): Layer gehoert nicht der UndoAction");
- bItsMine=sal_False;
- pLayerAdmin->InsertLayer(pLayer,nNum);
+ DBG_ASSERT(mbItsMine,"SdrUndoNewLayer::Undo(): Layer gehoert nicht der UndoAction");
+ mbItsMine = false;
+ mrLayerAdmin.InsertLayerFromUndoRedo(mpLayer, mnLayerNum);
}
XubString SdrUndoNewLayer::GetComment() const
@@ -1395,129 +1430,111 @@ XubString SdrUndoNewLayer::GetComment() const
void SdrUndoDelLayer::Undo()
{
- DBG_ASSERT(bItsMine,"SdrUndoDelLayer::Undo(): Layer gehoert nicht der UndoAction");
- bItsMine=sal_False;
- pLayerAdmin->InsertLayer(pLayer,nNum);
+ DBG_ASSERT(mbItsMine,"SdrUndoDelLayer::Undo(): Layer gehoert nicht der UndoAction");
+ mbItsMine = false;
+ mrLayerAdmin.InsertLayerFromUndoRedo(mpLayer, mnLayerNum);
}
void SdrUndoDelLayer::Redo()
{
- DBG_ASSERT(!bItsMine,"SdrUndoDelLayer::Undo(): Layer gehoert bereits der UndoAction");
- bItsMine=sal_True;
-#ifdef DBG_UTIL
- SdrLayer* pCmpLayer=
-#endif
- pLayerAdmin->RemoveLayer(nNum);
- DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoDelLayer::Redo(): Removter Layer ist != pLayer");
-}
-
-XubString SdrUndoDelLayer::GetComment() const
-{
- return ImpGetResStr(STR_UndoDelLayer);
-}
+ DBG_ASSERT(!mbItsMine,"SdrUndoDelLayer::Undo(): Layer gehoert bereits der UndoAction");
-////////////////////////////////////////////////////////////////////////////////////////////////////
+ mbItsMine = true;
-void SdrUndoMoveLayer::Undo()
-{
#ifdef DBG_UTIL
SdrLayer* pCmpLayer=
#endif
- pLayerAdmin->RemoveLayer(nNeuPos);
- DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoMoveLayer::Undo(): Removter Layer ist != pLayer");
- pLayerAdmin->InsertLayer(pLayer,nNum);
-}
+ mrLayerAdmin.RemoveLayer(mnLayerNum);
-void SdrUndoMoveLayer::Redo()
-{
-#ifdef DBG_UTIL
- SdrLayer* pCmpLayer=
-#endif
- pLayerAdmin->RemoveLayer(nNum);
- DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoMoveLayer::Redo(): Removter Layer ist != pLayer");
- pLayerAdmin->InsertLayer(pLayer,nNeuPos);
+ DBG_ASSERT(pCmpLayer==mpLayer,"SdrUndoDelLayer::Redo(): Removter Layer ist != mpLayer");
}
-XubString SdrUndoMoveLayer::GetComment() const
+XubString SdrUndoDelLayer::GetComment() const
{
- return ImpGetResStr(STR_UndoMovLayer);
+ return ImpGetResStr(STR_UndoDelLayer);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@@@@ @@@@ @@@@ @@@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@
-// @@@@@ @@@@@@ @@ @@@ @@@@ @@@@
-// @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@@@@ @@@@@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
SdrUndoPage::SdrUndoPage(SdrPage& rNewPg)
-: SdrUndoAction(*rNewPg.GetModel()),
+: SdrUndoAction(rNewPg.getSdrModelFromSdrPage()),
mrPage(rNewPg)
{
}
-void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum)
+void SdrUndoPage::ImpInsertPage(sal_uInt32 nNum)
{
DBG_ASSERT(!mrPage.IsInserted(),"SdrUndoPage::ImpInsertPage(): mrPage ist bereits Inserted");
- if (!mrPage.IsInserted()) {
- if (mrPage.IsMasterPage()) {
- rMod.InsertMasterPage(&mrPage,nNum);
- } else {
- rMod.InsertPage(&mrPage,nNum);
+
+ if(!mrPage.IsInserted())
+ {
+ if(mrPage.IsMasterPage())
+ {
+ mrModel.InsertMasterPage(&mrPage, nNum);
+ }
+ else
+ {
+ mrModel.InsertPage(&mrPage, nNum);
}
}
}
-void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum)
+void SdrUndoPage::ImpRemovePage(sal_uInt32 nNum)
{
DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpRemovePage(): mrPage ist nicht Inserted");
- if (mrPage.IsInserted()) {
- SdrPage* pChkPg=NULL;
- if (mrPage.IsMasterPage()) {
- pChkPg=rMod.RemoveMasterPage(nNum);
- } else {
- pChkPg=rMod.RemovePage(nNum);
+
+ if (mrPage.IsInserted())
+ {
+ SdrPage* pChkPg = 0;
+
+ if(mrPage.IsMasterPage())
+ {
+ pChkPg = mrModel.RemoveMasterPage(nNum);
+ }
+ else
+ {
+ pChkPg = mrModel.RemovePage(nNum);
}
+
DBG_ASSERT(pChkPg==&mrPage,"SdrUndoPage::ImpRemovePage(): RemovePage!=&mrPage");
}
}
-void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum)
+void SdrUndoPage::ImpMovePage(sal_uInt32 nOldNum, sal_uInt32 nNewNum)
{
DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpMovePage(): mrPage ist nicht Inserted");
- if (mrPage.IsInserted()) {
- if (mrPage.IsMasterPage()) {
- rMod.MoveMasterPage(nOldNum,nNewNum);
- } else {
- rMod.MovePage(nOldNum,nNewNum);
+
+ if (mrPage.IsInserted())
+ {
+ if (mrPage.IsMasterPage())
+ {
+ mrModel.MoveMasterPage(nOldNum,nNewNum);
+ }
+ else
+ {
+ mrModel.MovePage(nOldNum,nNewNum);
}
}
}
-void SdrUndoPage::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 /*n*/, FASTBOOL /*bRepeat*/) const
+void SdrUndoPage::TakeMarkedDescriptionString(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 /*n*/, bool /*bRepeat*/) const
{
rStr=ImpGetResStr(nStrCacheID);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrUndoPageList::SdrUndoPageList(SdrPage& rNewPg):
- SdrUndoPage(rNewPg),
- bItsMine(sal_False)
+SdrUndoPageList::SdrUndoPageList(SdrPage& rNewPg)
+: SdrUndoPage(rNewPg),
+ mnPageNum(0),
+ mbItsMine(false)
{
- nPageNum=rNewPg.GetPageNum();
+ mnPageNum = rNewPg.GetPageNumber();
}
SdrUndoPageList::~SdrUndoPageList()
{
- if(bItsMine)
+ if(mbItsMine)
{
delete (&mrPage);
}
@@ -1527,18 +1544,18 @@ SdrUndoPageList::~SdrUndoPageList()
SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg):
SdrUndoPageList(rNewPg),
- pUndoGroup(NULL)
+ mpUndoGroup(0)
{
- bItsMine = sal_True;
+ mbItsMine = true;
// Und nun ggf. die MasterPage-Beziehungen merken
if(mrPage.IsMasterPage())
{
- sal_uInt16 nPageAnz(rMod.GetPageCount());
+ sal_uInt32 nPageAnz(mrModel.GetPageCount());
- for(sal_uInt16 nPageNum2(0); nPageNum2 < nPageAnz; nPageNum2++)
+ for(sal_uInt32 nPageNum2(0); nPageNum2 < nPageAnz; nPageNum2++)
{
- SdrPage* pDrawPage = rMod.GetPage(nPageNum2);
+ SdrPage* pDrawPage = mrModel.GetPage(nPageNum2);
if(pDrawPage->TRG_HasMasterPage())
{
@@ -1546,12 +1563,12 @@ SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg):
if(&mrPage == &rMasterPage)
{
- if(!pUndoGroup)
+ if(!mpUndoGroup)
{
- pUndoGroup = new SdrUndoGroup(rMod);
+ mpUndoGroup = new SdrUndoGroup(mrModel);
}
- pUndoGroup->AddAction(rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage));
+ mpUndoGroup->AddAction(mrModel.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage));
}
}
}
@@ -1560,40 +1577,47 @@ SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg):
SdrUndoDelPage::~SdrUndoDelPage()
{
- if (pUndoGroup!=NULL) {
- delete pUndoGroup;
+ if (mpUndoGroup)
+ {
+ delete mpUndoGroup;
}
}
void SdrUndoDelPage::Undo()
{
- ImpInsertPage(nPageNum);
- if (pUndoGroup!=NULL) { // MasterPage-Beziehungen wiederherstellen
- pUndoGroup->Undo();
+ ImpInsertPage(mnPageNum);
+
+ if (mpUndoGroup)
+ {
+ // MasterPage-Beziehungen wiederherstellen
+ mpUndoGroup->Undo();
}
- DBG_ASSERT(bItsMine,"UndoDeletePage: mrPage gehoert nicht der UndoAction");
- bItsMine=sal_False;
+
+ DBG_ASSERT(mbItsMine,"UndoDeletePage: mrPage gehoert nicht der UndoAction");
+ mbItsMine = false;
}
void SdrUndoDelPage::Redo()
{
- ImpRemovePage(nPageNum);
+ ImpRemovePage(mnPageNum);
+
// Die MasterPage-Beziehungen werden ggf. von selbst geloesst
- DBG_ASSERT(!bItsMine,"RedoDeletePage: mrPage gehoert bereits der UndoAction");
- bItsMine=sal_True;
+ DBG_ASSERT(!mbItsMine,"RedoDeletePage: mrPage gehoert bereits der UndoAction");
+
+ mbItsMine = true;
}
XubString SdrUndoDelPage::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoDelPage,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoDelPage,aStr,0,false);
return aStr;
}
XubString SdrUndoDelPage::GetSdrRepeatComment(SdrView& /*rView*/) const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoDelPage,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoDelPage,aStr,0,false);
return aStr;
}
@@ -1603,29 +1627,29 @@ void SdrUndoDelPage::SdrRepeat(SdrView& /*rView*/)
bool SdrUndoDelPage::CanSdrRepeat(SdrView& /*rView*/) const
{
- return sal_False;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrUndoNewPage::Undo()
{
- ImpRemovePage(nPageNum);
- DBG_ASSERT(!bItsMine,"UndoNewPage: mrPage gehoert bereits der UndoAction");
- bItsMine=sal_True;
+ ImpRemovePage(mnPageNum);
+ DBG_ASSERT(!mbItsMine,"UndoNewPage: mrPage gehoert bereits der UndoAction");
+ mbItsMine=true;
}
void SdrUndoNewPage::Redo()
{
- ImpInsertPage(nPageNum);
- DBG_ASSERT(bItsMine,"RedoNewPage: mrPage gehoert nicht der UndoAction");
- bItsMine=sal_False;
+ ImpInsertPage(mnPageNum);
+ DBG_ASSERT(mbItsMine,"RedoNewPage: mrPage gehoert nicht der UndoAction");
+ mbItsMine=false;
}
XubString SdrUndoNewPage::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoNewPage,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoNewPage,aStr,0,false);
return aStr;
}
@@ -1634,14 +1658,14 @@ XubString SdrUndoNewPage::GetComment() const
XubString SdrUndoCopyPage::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoCopPage,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoCopPage,aStr,0,false);
return aStr;
}
XubString SdrUndoCopyPage::GetSdrRepeatComment(SdrView& /*rView*/) const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoCopPage,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoCopPage,aStr,0,false);
return aStr;
}
@@ -1652,49 +1676,40 @@ void SdrUndoCopyPage::SdrRepeat(SdrView& /*rView*/)
bool SdrUndoCopyPage::CanSdrRepeat(SdrView& /*rView*/) const
{
- return sal_False;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void SdrUndoSetPageNum::Undo()
{
- ImpMovePage(nNewPageNum,nOldPageNum);
+ ImpMovePage(mnNewPageNum, mnOldPageNum);
}
void SdrUndoSetPageNum::Redo()
{
- ImpMovePage(nOldPageNum,nNewPageNum);
+ ImpMovePage(mnOldPageNum, mnNewPageNum);
}
XubString SdrUndoSetPageNum::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoMovPage,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoMovPage,aStr,0,false);
return aStr;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@ @@@@ @@@@ @@@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@
-// @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@@@@@@ @@@@@@ @@@@ @@ @@@@ @@@@@ @@@@@ @@@@@@ @@ @@@ @@@@ @@@@
-// @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@@@ @@ @@@@@ @@ @@ @@ @@ @@ @@@@@ @@@@@ @@@@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
SdrUndoPageMasterPage::SdrUndoPageMasterPage(SdrPage& rChangedPage)
: SdrUndoPage(rChangedPage),
+ maOldSet(),
+ maOldMasterPageNumber(0),
mbOldHadMasterPage(mrPage.TRG_HasMasterPage())
{
- // get current state from page
if(mbOldHadMasterPage)
{
maOldSet = mrPage.TRG_GetMasterPageVisibleLayers();
- maOldMasterPageNumber = mrPage.TRG_GetMasterPage().GetPageNum();
+ maOldMasterPageNumber = mrPage.TRG_GetMasterPage().GetPageNumber();
}
}
@@ -1713,7 +1728,7 @@ void SdrUndoPageRemoveMasterPage::Undo()
{
if(mbOldHadMasterPage)
{
- mrPage.TRG_SetMasterPage(*mrPage.GetModel()->GetMasterPage(maOldMasterPageNumber));
+ mrPage.TRG_SetMasterPage(*mrModel.GetMasterPage(maOldMasterPageNumber));
mrPage.TRG_SetMasterPageVisibleLayers(maOldSet);
}
}
@@ -1726,7 +1741,7 @@ void SdrUndoPageRemoveMasterPage::Redo()
XubString SdrUndoPageRemoveMasterPage::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoDelPageMasterDscr,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoDelPageMasterDscr,aStr,0,false);
return aStr;
}
@@ -1734,7 +1749,9 @@ XubString SdrUndoPageRemoveMasterPage::GetComment() const
SdrUndoPageChangeMasterPage::SdrUndoPageChangeMasterPage(SdrPage& rChangedPage)
: SdrUndoPageMasterPage(rChangedPage),
- mbNewHadMasterPage(sal_False)
+ maNewSet(),
+ maNewMasterPageNumber(0),
+ mbNewHadMasterPage(false)
{
}
@@ -1743,16 +1760,16 @@ void SdrUndoPageChangeMasterPage::Undo()
// remember values from new page
if(mrPage.TRG_HasMasterPage())
{
- mbNewHadMasterPage = sal_True;
+ mbNewHadMasterPage = true;
maNewSet = mrPage.TRG_GetMasterPageVisibleLayers();
- maNewMasterPageNumber = mrPage.TRG_GetMasterPage().GetPageNum();
+ maNewMasterPageNumber = mrPage.TRG_GetMasterPage().GetPageNumber();
}
// restore old values
if(mbOldHadMasterPage)
{
mrPage.TRG_ClearMasterPage();
- mrPage.TRG_SetMasterPage(*mrPage.GetModel()->GetMasterPage(maOldMasterPageNumber));
+ mrPage.TRG_SetMasterPage(*mrModel.GetMasterPage(maOldMasterPageNumber));
mrPage.TRG_SetMasterPageVisibleLayers(maOldSet);
}
}
@@ -1763,7 +1780,7 @@ void SdrUndoPageChangeMasterPage::Redo()
if(mbNewHadMasterPage)
{
mrPage.TRG_ClearMasterPage();
- mrPage.TRG_SetMasterPage(*mrPage.GetModel()->GetMasterPage(maNewMasterPageNumber));
+ mrPage.TRG_SetMasterPage(*mrModel.GetMasterPage(maNewMasterPageNumber));
mrPage.TRG_SetMasterPageVisibleLayers(maNewSet);
}
}
@@ -1771,21 +1788,14 @@ void SdrUndoPageChangeMasterPage::Redo()
XubString SdrUndoPageChangeMasterPage::GetComment() const
{
XubString aStr;
- ImpTakeDescriptionStr(STR_UndoChgPageMasterDscr,aStr,0,sal_False);
+ TakeMarkedDescriptionString(STR_UndoChgPageMasterDscr,aStr,0,false);
return aStr;
}
///////////////////////////////////////////////////////////////////////
-SdrUndoFactory::~SdrUndoFactory(){}
-// shapes
-SdrUndoAction* SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject )
-{
- return new SdrUndoMoveObj( rObject );
-}
-SdrUndoAction* SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
+SdrUndoFactory::~SdrUndoFactory()
{
- return new SdrUndoMoveObj( rObject, rDist );
}
SdrUndoAction* SdrUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
@@ -1795,32 +1805,32 @@ SdrUndoAction* SdrUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
SdrUndoAction* SdrUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText )
{
- return new SdrUndoAttrObj( rObject, bStyleSheet1 ? sal_True : sal_False, bSaveText ? sal_True : sal_False );
+ return new SdrUndoAttrObj( rObject, bStyleSheet1 ? true : false, bSaveText ? true : false );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* SdrUndoFactory::CreateUndoRemoveObject( SdrObject& rObject )
{
- return new SdrUndoRemoveObj( rObject, bOrdNumDirect ? sal_True : sal_False );
+ return new SdrUndoRemoveObj( rObject );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* SdrUndoFactory::CreateUndoInsertObject( SdrObject& rObject )
{
- return new SdrUndoInsertObj( rObject, bOrdNumDirect ? sal_True : sal_False );
+ return new SdrUndoInsertObj( rObject );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* SdrUndoFactory::CreateUndoDeleteObject( SdrObject& rObject )
{
- return new SdrUndoDelObj( rObject, bOrdNumDirect ? sal_True : sal_False );
+ return new SdrUndoDelObj( rObject );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* SdrUndoFactory::CreateUndoNewObject( SdrObject& rObject )
{
- return new SdrUndoNewObj( rObject, bOrdNumDirect ? sal_True : sal_False );
+ return new SdrUndoNewObj( rObject );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect )
+SdrUndoAction* SdrUndoFactory::CreateUndoCopyObject( SdrObject& rObject )
{
- return new SdrUndoCopyObj( rObject, bOrdNumDirect ? sal_True : sal_False );
+ return new SdrUndoCopyObj( rObject );
}
SdrUndoAction* SdrUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
@@ -1828,9 +1838,9 @@ SdrUndoAction* SdrUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_u
return new SdrUndoObjOrdNum( rObject, nOldOrdNum1, nNewOrdNum1 );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect )
+SdrUndoAction* SdrUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject )
{
- return new SdrUndoReplaceObj( rOldObject, rNewObject, bOrdNumDirect ? sal_True : sal_False );
+ return new SdrUndoReplaceObj( rOldObject, rNewObject );
}
SdrUndoAction* SdrUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer )
@@ -1843,15 +1853,11 @@ SdrUndoAction* SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_
return new SdrUndoObjSetText( rNewObj, nText );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject,
- SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
- String sOldStr,
- String sNewStr )
+SdrUndoAction* SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject, SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, String sOldStr, String sNewStr )
{
return new SdrUndoObjStrAttr( rObject, eObjStrAttrType, sOldStr, sNewStr );
}
-
// layer
SdrUndoAction* SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
{
@@ -1863,11 +1869,6 @@ SdrUndoAction* SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLa
return new SdrUndoDelLayer( nLayerNum, rNewLayerAdmin, rNewModel );
}
-SdrUndoAction* SdrUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
-{
- return new SdrUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNeuPos1 );
-}
-
// page
SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
{
@@ -1899,4 +1900,5 @@ SdrUndoAction* SdrUndoFactory::CreateUndoPageChangeMasterPage(SdrPage& rChangedP
return new SdrUndoPageChangeMasterPage(rChangedPage);
}
+//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index b649f1b8c5a0..a31511746518 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -54,38 +54,41 @@
#include <svx/sdrpaintwindow.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/sdrhittesthelper.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
+#include <editeng/outlobj.hxx>
+#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrViewEvent::SdrViewEvent()
-: pHdl(NULL),
- pObj(NULL),
- pRootObj(NULL),
- pPV(NULL),
- pURLField(NULL),
- eHit(SDRHIT_NONE),
- eEvent(SDREVENT_NONE),
- eHdlKind(HDL_MOVE),
- eEndCreateCmd(SDRCREATE_NEXTPOINT),
- nMouseClicks(0),
- nMouseMode(0),
- nMouseCode(0),
- nHlplIdx(0),
- nGlueId(0),
- bMouseDown(sal_False),
- bMouseUp(sal_False),
- bDoubleHdlSize(sal_False),
- bIsAction(sal_False),
- bIsTextEdit(sal_False),
- bTextEditHit(sal_False),
- bAddMark(sal_False),
- bUnmark(sal_False),
- bPrevNextMark(sal_False),
- bMarkPrev(sal_False),
- bInsPointNewObj(sal_False),
- bDragWithCopy(sal_False),
- bCaptureMouse(sal_False),
- bReleaseMouse(sal_False)
+: mpHdl(0),
+ mpObj(0),
+ mpRootObj(0),
+ maURLField(),
+ maTargetFrame(),
+ maLogicPos(0.0, 0.0),
+ meHit(SDRHIT_NONE),
+ meEvent(SDREVENT_NONE),
+ meEndCreateCmd(SDRCREATE_NEXTPOINT),
+ mnMouseClicks(0),
+ mnMouseMode(0),
+ mnMouseCode(0),
+ mnHlplIdx(0),
+ mnGlueId(0),
+ mbMouseDown(false),
+ mbMouseUp(false),
+ mbIsAction(false),
+ mbIsTextEdit(false),
+ mbTextEditHit(false),
+ mbAddMark(false),
+ mbUnmark(false),
+ mbPrevNextMark(false),
+ mbMarkPrev(false),
+ mbInsPointNewObj(false),
+ mbDragWithCopy(false),
+ mbCaptureMouse(false),
+ mbReleaseMouse(false)
{
}
@@ -154,162 +157,231 @@ SdrDropMarkerOverlay::~SdrDropMarkerOverlay()
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-// @@ @@ @@ @@@@@ @@ @@
-// @@ @@ @@ @@ @@ @@
-// @@ @@ @@ @@ @@ @ @@
-// @@@@@ @@ @@@@ @@@@@@@
-// @@@ @@ @@ @@@@@@@
-// @@@ @@ @@ @@@ @@@
-// @ @@ @@@@@ @@ @@
-//
-////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-TYPEINIT1(SdrView,SdrCreateView);
-SdrView::SdrView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrCreateView(pModel1,pOut),
- bNoExtendedMouseDispatcher(sal_False),
- bNoExtendedKeyDispatcher(sal_False),
- bNoExtendedCommandDispatcher(sal_False),
- mbMasterPagePaintCaching(sal_False)
+SdrView::SdrView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrCreateView(rModel1, pOut),
+ mbNoExtendedMouseDispatcher(false),
+ mbNoExtendedKeyDispatcher(false),
+ mbNoExtendedCommandDispatcher(false),
+ mbMasterPagePaintCaching(false),
+ maAccessibilityOptions()
{
- bTextEditOnObjectsWithoutTextIfTextTool=sal_False;
-
maAccessibilityOptions.AddListener(this);
-
onAccessibilityOptionsChanged();
}
SdrView::~SdrView()
{
+ // call here when still set due to it's virtual nature
+ if(GetSdrPageView())
+ {
+ HideSdrPage();
+ }
+
maAccessibilityOptions.RemoveListener(this);
}
-sal_Bool SdrView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
+bool SdrView::KeyInput(const KeyEvent& rKEvt, Window* pWin)
{
- SetActualWin(pWin);
- sal_Bool bRet=SdrCreateView::KeyInput(rKEvt,pWin);
- if (!bRet && !IsExtendedKeyInputDispatcherEnabled()) {
- bRet=sal_True;
- switch (rKEvt.GetKeyCode().GetFullFunction()) {
- case KEYFUNC_CUT : Cut(); break;
- case KEYFUNC_COPY : Yank(); break;
- case KEYFUNC_PASTE : Paste(pWin); break;
- case KEYFUNC_DELETE: DeleteMarked(); break;
- case KEYFUNC_UNDO: pMod->Undo(); break;
- case KEYFUNC_REDO: pMod->Redo(); break;
- case KEYFUNC_REPEAT: pMod->Repeat(*this); break;
- default: {
- switch (rKEvt.GetKeyCode().GetFullCode()) {
- case KEY_ESCAPE: {
- if (IsTextEdit()) SdrEndTextEdit();
- if (IsAction()) BrkAction();
- if (pWin!=NULL) pWin->ReleaseMouse();
- } break;
- case KEY_DELETE: DeleteMarked(); break;
- case KEY_CUT: case KEY_DELETE+KEY_SHIFT: Cut(); break;
- case KEY_COPY: case KEY_INSERT+KEY_MOD1: Yank(); break;
- case KEY_PASTE: case KEY_INSERT+KEY_SHIFT: Paste(pWin); break;
- case KEY_UNDO: case KEY_BACKSPACE+KEY_MOD2: pMod->Undo(); break;
- case KEY_BACKSPACE+KEY_MOD2+KEY_SHIFT: pMod->Redo(); break;
- case KEY_REPEAT: case KEY_BACKSPACE+KEY_MOD2+KEY_MOD1: pMod->Repeat(*this); break;
- case KEY_MOD1+KEY_A: MarkAll(); break;
- default: bRet=sal_False;
- } // switch
- }
- } // switch
- if (bRet && pWin!=NULL) {
- pWin->SetPointer(GetPreferedPointer(
- pWin->PixelToLogic(pWin->ScreenToOutputPixel( pWin->GetPointerPosPixel() ) ),
+ SetActualOutDev(pWin);
+ bool bRetval(SdrCreateView::KeyInput(rKEvt, pWin));
+
+ if(!bRetval && !IsExtendedKeyInputDispatcherEnabled())
+ {
+ bRetval = true;
+
+ switch(rKEvt.GetKeyCode().GetFullFunction())
+ {
+ case KEYFUNC_CUT :
+ Cut();
+ break;
+ case KEYFUNC_COPY :
+ Yank();
+ break;
+ case KEYFUNC_PASTE :
+ Paste(pWin);
+ break;
+ case KEYFUNC_DELETE:
+ DeleteMarked();
+ break;
+ case KEYFUNC_UNDO:
+ getSdrModelFromSdrView().Undo();
+ break;
+ case KEYFUNC_REDO:
+ getSdrModelFromSdrView().Redo();
+ break;
+ case KEYFUNC_REPEAT:
+ getSdrModelFromSdrView().Repeat(*this);
+ break;
+ default:
+ {
+ switch(rKEvt.GetKeyCode().GetFullCode())
+ {
+ case KEY_ESCAPE:
+ {
+ if (IsTextEdit())
+ SdrEndTextEdit();
+ if (IsAction())
+ BrkAction();
+ if (pWin)
+ pWin->ReleaseMouse();
+ break;
+ }
+ case KEY_DELETE:
+ DeleteMarked();
+ break;
+ case KEY_CUT:
+ case KEY_DELETE+KEY_SHIFT:
+ Cut();
+ break;
+ case KEY_COPY:
+ case KEY_INSERT+KEY_MOD1:
+ Yank();
+ break;
+ case KEY_PASTE:
+ case KEY_INSERT+KEY_SHIFT:
+ Paste(pWin);
+ break;
+ case KEY_UNDO:
+ case KEY_BACKSPACE+KEY_MOD2:
+ getSdrModelFromSdrView().Undo();
+ break;
+ case KEY_BACKSPACE+KEY_MOD2+KEY_SHIFT:
+ getSdrModelFromSdrView().Redo();
+ break;
+ case KEY_REPEAT:
+ case KEY_BACKSPACE+KEY_MOD2+KEY_MOD1:
+ getSdrModelFromSdrView().Repeat(*this);
+ break;
+ case KEY_MOD1+KEY_A:
+ MarkAll();
+ break;
+ default:
+ bRetval = false;
+ break;
+ }
+ }
+ }
+
+ if(bRetval && pWin)
+ {
+ const Point aOldPos(pWin->ScreenToOutputPixel(pWin->GetPointerPosPixel()));
+ const basegfx::B2DPoint aLogPos(pWin->GetInverseViewTransformation() * basegfx::B2DPoint(aOldPos.X(), aOldPos.Y()));
+
+ pWin->SetPointer(
+ GetPreferedPointer(
+ aLogPos,
pWin,
rKEvt.GetKeyCode().GetModifier()));
}
}
- return bRet;
+
+ return bRetval;
}
-sal_Bool SdrView::MouseButtonDown(const MouseEvent& rMEvt, Window* pWin)
+bool SdrView::MouseButtonDown(const MouseEvent& rMEvt, Window* pWin)
{
- SetActualWin(pWin);
- if (rMEvt.IsLeft()) aDragStat.SetMouseDown(sal_True);
- sal_Bool bRet=SdrCreateView::MouseButtonDown(rMEvt,pWin);
- if (!bRet && !IsExtendedMouseEventDispatcherEnabled()) {
+ SetActualOutDev(pWin);
+
+ if(rMEvt.IsLeft())
+ {
+ GetDragStat().SetMouseDown(true);
+ }
+
+ bool bRetval(SdrCreateView::MouseButtonDown(rMEvt, pWin));
+
+ if(!bRetval && !IsExtendedMouseEventDispatcherEnabled())
+ {
SdrViewEvent aVEvt;
+
PickAnything(rMEvt,SDRMOUSEBUTTONDOWN,aVEvt);
- bRet=DoMouseEvent(aVEvt);
+ bRetval = DoMouseEvent(aVEvt);
}
- return bRet;
+
+ return bRetval;
}
-sal_Bool SdrView::MouseButtonUp(const MouseEvent& rMEvt, Window* pWin)
+bool SdrView::MouseButtonUp(const MouseEvent& rMEvt, Window* pWin)
{
- SetActualWin(pWin);
- if (rMEvt.IsLeft()) aDragStat.SetMouseDown(sal_False);
- sal_Bool bAction=IsAction();
- sal_Bool bRet=!bAction && SdrCreateView::MouseButtonUp(rMEvt,pWin);
- if (!bRet && !IsExtendedMouseEventDispatcherEnabled()) {
+ SetActualOutDev(pWin);
+
+ if(rMEvt.IsLeft())
+ {
+ GetDragStat().SetMouseDown(false);
+ }
+
+ const bool bAction(IsAction());
+ bool bRetval(!bAction && SdrCreateView::MouseButtonUp(rMEvt, pWin));
+
+ if(!bRetval && !IsExtendedMouseEventDispatcherEnabled())
+ {
SdrViewEvent aVEvt;
+
PickAnything(rMEvt,SDRMOUSEBUTTONUP,aVEvt);
- bRet=DoMouseEvent(aVEvt);
+ bRetval = DoMouseEvent(aVEvt);
}
- return bRet;
+
+ return bRetval;
}
-sal_Bool SdrView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
+bool SdrView::MouseMove(const MouseEvent& rMEvt, Window* pWin)
{
- SetActualWin(pWin);
- aDragStat.SetMouseDown(rMEvt.IsLeft());
- sal_Bool bRet=SdrCreateView::MouseMove(rMEvt,pWin);
- if (!IsExtendedMouseEventDispatcherEnabled() && !IsTextEditInSelectionMode()) {
+ SetActualOutDev(pWin);
+ GetDragStat().SetMouseDown(rMEvt.IsLeft());
+
+ bool bRetval(SdrCreateView::MouseMove(rMEvt, pWin));
+
+ if(!IsExtendedMouseEventDispatcherEnabled() && !IsTextEditInSelectionMode())
+ {
SdrViewEvent aVEvt;
+
PickAnything(rMEvt,SDRMOUSEMOVE,aVEvt);
- if (DoMouseEvent(aVEvt)) bRet=sal_True;
+ bRetval = DoMouseEvent(aVEvt);
}
- // #87792# Removed code which did let the mouse snap on object
- // points
-
- return bRet;
+ return bRetval;
}
-sal_Bool SdrView::Command(const CommandEvent& rCEvt, Window* pWin)
+bool SdrView::Command(const CommandEvent& rCEvt, Window* pWin)
{
- SetActualWin(pWin);
- sal_Bool bRet=SdrCreateView::Command(rCEvt,pWin);
- return bRet;
+ SetActualOutDev(pWin);
+
+ return SdrCreateView::Command(rCEvt, pWin);
}
-/* new interface src537 */
-sal_Bool SdrView::GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const
+bool SdrView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const
{
return SdrCreateView::GetAttributes(rTargetSet, bOnlyHardAttr);
}
SfxStyleSheet* SdrView::GetStyleSheet() const
{
- //sal_Bool bOk=sal_False;
- return SdrCreateView::GetStyleSheet(); //bOk);
+ return SdrCreateView::GetStyleSheet();
}
SdrHitKind SdrView::PickAnything(const MouseEvent& rMEvt, sal_uInt16 nEventKind, SdrViewEvent& rVEvt) const
{
- rVEvt.bMouseDown=nEventKind==SDRMOUSEBUTTONDOWN;
- rVEvt.bMouseUp=nEventKind==SDRMOUSEBUTTONUP;
- rVEvt.nMouseClicks=rMEvt.GetClicks();
- rVEvt.nMouseMode=rMEvt.GetMode();
- rVEvt.nMouseCode=rMEvt.GetButtons() | rMEvt.GetModifier();
- const OutputDevice* pOut=pActualOutDev;
- if (pOut==NULL)
+ rVEvt.mbMouseDown = SDRMOUSEBUTTONDOWN == nEventKind;
+ rVEvt.mbMouseUp = SDRMOUSEBUTTONUP == nEventKind;
+ rVEvt.mnMouseClicks = rMEvt.GetClicks();
+ rVEvt.mnMouseMode = rMEvt.GetMode();
+ rVEvt.mnMouseCode = rMEvt.GetButtons() | rMEvt.GetModifier();
+ const OutputDevice* pOut = GetActualOutDev();
+
+ if(!pOut)
{
pOut = GetFirstOutputDevice();
- //pOut=GetWin(0);
}
- Point aPnt(rMEvt.GetPosPixel());
- if (pOut!=NULL) aPnt=pOut->PixelToLogic(aPnt);
- rVEvt.aLogicPos=aPnt;
+
+ basegfx::B2DPoint aPnt(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+
+ if(pOut)
+ {
+ aPnt = pOut->GetInverseViewTransformation() * aPnt;
+ }
+
+ rVEvt.maLogicPos = aPnt;
+
return PickAnything(aPnt,rVEvt);
}
@@ -322,76 +394,76 @@ SdrHitKind SdrView::PickAnything(const MouseEvent& rMEvt, sal_uInt16 nEventKind,
// da sich beides meisst gegenseitig ausschliesst. Einzig Shear (das beim
// Verzerren, nicht dass beim Drehen) beruecksichtigt beides gleichzeitig.
// Dass muss der Anwender erstmal noch umschiffen (z.B. mit einer Hilfslinie).
-#define MODKEY_NoSnap bCtrl /* Fang temporaer aus */
-#define MODKEY_Ortho bShift /* na eben ortho */
-#define MODKEY_Center bAlt /* Zentrisch erzeugen/resizen */
-#define MODKEY_AngleSnap bShift
-#define MODKEY_CopyDrag bCtrl /* Draggen mit kopieren */
+#define MODKEY_NoSnap bModKeyCtrl /* Fang temporaer aus */
+#define MODKEY_Ortho bModKeyShift /* na eben ortho */
+#define MODKEY_Center bModKeyAlt /* Zentrisch erzeugen/resizen */
+#define MODKEY_AngleSnap bModKeyShift
+#define MODKEY_CopyDrag bModKeyCtrl /* Draggen mit kopieren */
// irgendwo hinklicken (MouseDown)
-#define MODKEY_PolyPoly bAlt /* Neues Poly bei InsPt und bei Create */
-#define MODKEY_MultiMark bShift /* MarkObj ohne vorher UnmarkAll */
-#define MODKEY_Unmark bAlt /* Unmark durch Rahmenaufziehen */
-#define MODKEY_ForceMark bCtrl /* Rahmenaufziehen erzwingen, auch wenn Obj an MausPos */
-#define MODKEY_DeepMark bAlt /* MarkNextObj */
-#define MODKEY_DeepBackw bShift /* MarkNextObj rueckwaerts */
-
-SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const
+#define MODKEY_PolyPoly bModKeyAlt /* Neues Poly bei InsPt und bei Create */
+#define MODKEY_MultiMark bModKeyShift /* MarkObj ohne vorher UnmarkAll */
+#define MODKEY_Unmark bModKeyAlt /* Unmark durch Rahmenaufziehen */
+#define MODKEY_ForceMark bModKeyCtrl /* Rahmenaufziehen erzwingen, auch wenn Obj an MausPos */
+#define MODKEY_DeepMark bModKeyAlt /* MarkNextObj */
+#define MODKEY_DeepBackw bModKeyShift /* MarkNextObj rueckwaerts */
+
+SdrHitKind SdrView::PickAnything(const basegfx::B2DPoint& rLogicPos, SdrViewEvent& rVEvt) const
{
- const OutputDevice* pOut=pActualOutDev;
- if (pOut==NULL)
+ const OutputDevice* pOut = GetActualOutDev();
+
+ if(!pOut)
{
pOut = GetFirstOutputDevice();
- //pOut=GetWin(0);
- }
-
- // #i73628# Use a non-changeable copy of he logic pos
- const Point aLocalLogicPosition(rLogicPos);
-
- sal_Bool bEditMode=IsEditMode();
- sal_Bool bPointMode=bEditMode && HasMarkablePoints();
- sal_Bool bGluePointMode=IsGluePointEditMode();
- sal_Bool bInsPolyPt=bPointMode && IsInsObjPointMode() && IsInsObjPointPossible();
- sal_Bool bInsGluePt=bGluePointMode && IsInsGluePointMode() && IsInsGluePointPossible();
- sal_Bool bIsTextEdit=IsTextEdit();
- sal_Bool bTextEditHit=IsTextEditHit(aLocalLogicPosition,0/*nHitTolLog*/);
- sal_Bool bTextEditSel=IsTextEditInSelectionMode();
- sal_Bool bShift=(rVEvt.nMouseCode & KEY_SHIFT) !=0;
- sal_Bool bCtrl=(rVEvt.nMouseCode & KEY_MOD1) !=0;
- sal_Bool bAlt=(rVEvt.nMouseCode & KEY_MOD2) !=0;
- SdrHitKind eHit=SDRHIT_NONE;
- SdrHdl* pHdl=pOut!=NULL && !bTextEditSel ? PickHandle(aLocalLogicPosition) : NULL;
- SdrPageView* pPV=NULL;
- SdrObject* pObj=NULL;
- SdrObject* pHitObj=NULL;
- sal_uInt16 nHitPassNum=0;
- sal_uInt16 nHlplIdx=0;
- sal_uInt16 nGlueId=0;
- sal_Bool bUnmarkedObjHit=sal_False;
+ }
+
+ const basegfx::B2DPoint aLocalLogicPosition(rLogicPos);
+ const bool bEditMode(IsEditMode());
+ const bool bPointMode(bEditMode && HasMarkablePoints());
+ const bool bGluePointMode(IsGluePointEditMode());
+ const bool bInsPolyPt(bPointMode && IsInsObjPointMode() && IsInsObjPointPossible());
+ const bool bInsGluePt(bGluePointMode && IsInsGluePointMode() && IsInsGluePointPossible());
+ const bool bIsTextEdit(IsTextEdit());
+ const bool bTextEditSel(IsTextEditInSelectionMode());
+ bool bTextEditHit(IsTextEditHit(aLocalLogicPosition, 0.0));
+ SdrHitKind eHit(SDRHIT_NONE);
+ const SdrHdl* pHdl = pOut && !bTextEditSel ? PickHandle(aLocalLogicPosition) : 0;
+ SdrObject* pObj = 0;
+ SdrObject* pHitObj = 0;
+ sal_uInt16 nHitPassNum(0);
+ sal_uInt32 nHlplIdx(0);
+ sal_uInt32 nGlueId(0);
+
+ const bool bModKeyShift(rVEvt.mnMouseCode & KEY_SHIFT);
+ const bool bModKeyCtrl(rVEvt.mnMouseCode & KEY_MOD1);
+ const bool bModKeyAlt(rVEvt.mnMouseCode & KEY_MOD2);
+
if (bTextEditHit || bTextEditSel)
{
eHit=SDRHIT_TEXTEDIT;
- bTextEditHit=sal_True;
+ bTextEditHit = true;
}
- else if (pHdl!=NULL)
+ else if(pHdl)
{
eHit=SDRHIT_HANDLE; // Handle getroffen hat hoechste Prioritaet
}
- else if (bEditMode && IsHlplVisible() && IsHlplFront() && pOut!=NULL && PickHelpLine(aLocalLogicPosition,nHitTolLog,*pOut,nHlplIdx,pPV))
+ else if(bEditMode && IsHlplVisible() && IsHlplFront() && pOut && PickHelpLine(aLocalLogicPosition, getHitTolLog(), nHlplIdx))
{
eHit=SDRHIT_HELPLINE; // Hilfslinie im Vordergrund getroffen zum verschieben
}
- else if (bGluePointMode && PickGluePoint(aLocalLogicPosition,pObj,nGlueId,pPV))
+ else if(bGluePointMode && PickGluePoint(aLocalLogicPosition, pObj, nGlueId))
{
eHit=SDRHIT_GLUEPOINT; // nichtmarkierter Klebepunkt getroffen
}
- else if (PickObj(aLocalLogicPosition,nHitTolLog,pHitObj,pPV,SDRSEARCH_DEEP|SDRSEARCH_MARKED,&pObj,NULL,&nHitPassNum))
+ else if(PickObj(aLocalLogicPosition, getHitTolLog(), pHitObj, SDRSEARCH_DEEP|SDRSEARCH_MARKED, &pObj, 0, &nHitPassNum))
{
eHit=SDRHIT_MARKEDOBJECT;
::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( pObj );
+
if( pTableObj )
{
sal_Int32 nX = 0, nY = 0;
+
switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, 0 ) )
{
case sdr::table::SDRTABLEHIT_CELL:
@@ -405,14 +477,16 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
}
}
}
- else if (PickObj(aLocalLogicPosition,nHitTolLog,pHitObj,pPV,SDRSEARCH_DEEP|/*SDRSEARCH_TESTMARKABLE|*/SDRSEARCH_ALSOONMASTER|SDRSEARCH_WHOLEPAGE,&pObj,NULL,&nHitPassNum))
+ else if(PickObj(aLocalLogicPosition, getHitTolLog(), pHitObj, SDRSEARCH_DEEP|SDRSEARCH_ALSOONMASTER|SDRSEARCH_WHOLEPAGE, &pObj, 0, &nHitPassNum))
{
// MasterPages und WholePage fuer Macro und URL
eHit=SDRHIT_UNMARKEDOBJECT;
::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( pObj );
+
if( pTableObj )
{
sal_Int32 nX = 0, nY = 0;
+
switch( pTableObj->CheckTableHit( aLocalLogicPosition, nX, nY, 0 ) )
{
case sdr::table::SDRTABLEHIT_CELL:
@@ -425,101 +499,124 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
break;
}
}
- bUnmarkedObjHit=sal_True;
}
- else if (bEditMode && IsHlplVisible() && !IsHlplFront() && pOut!=NULL && PickHelpLine(aLocalLogicPosition,nHitTolLog,*pOut,nHlplIdx,pPV))
+ else if(bEditMode && IsHlplVisible() && !IsHlplFront() && pOut && PickHelpLine(aLocalLogicPosition, getHitTolLog(), nHlplIdx))
{
eHit=SDRHIT_HELPLINE; // Hilfslinie im Vordergrund getroffen zum verschieben
}
- if (IsMacroMode() && eHit==SDRHIT_UNMARKEDOBJECT)
+
+ if(SDRHIT_UNMARKEDOBJECT == eHit)
{
- bool bRoot=pObj->HasMacro();
- sal_Bool bDeep=pObj!=pHitObj && pHitObj->HasMacro();
- sal_Bool bMid=sal_False; // Gruppierte Gruppe mit Macro getroffen?
- SdrObject* pMidObj=NULL;
+ bool bRoot(pObj->HasMacro());
+ bool bDeep(pObj != pHitObj && pHitObj->HasMacro());
+ bool bMid(false); // Gruppierte Gruppe mit Macro getroffen?
+ SdrObject* pMidObj = 0;
+
if (pObj!=pHitObj)
{
- SdrObject* pObjTmp=NULL;
- pObjTmp=pHitObj->GetUpGroup();
- if (pObjTmp==pObj) pObjTmp=NULL;
- while (pObjTmp!=NULL)
+ SdrObject* pObjTmp = pHitObj->GetParentSdrObject();
+
+ if(pObjTmp == pObj)
+ {
+ pObjTmp = 0;
+ }
+
+ while(pObjTmp)
{
if (pObjTmp->HasMacro())
{
- bMid=sal_True;
+ bMid = true;
pMidObj=pObjTmp;
}
- pObjTmp=pObjTmp->GetUpGroup();
- if (pObjTmp==pObj) pObjTmp=NULL;
+
+ pObjTmp = pObjTmp->GetParentSdrObject();
+
+ if(pObjTmp == pObj)
+ {
+ pObjTmp = 0;
+ }
}
}
if (bDeep || bMid || bRoot)
{
SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=aLocalLogicPosition;
- aHitRec.aDownPos=aLocalLogicPosition;
- aHitRec.nTol=nHitTolLog;
- aHitRec.pVisiLayer=&pPV->GetVisibleLayers();
- aHitRec.pPageView=pPV;
- if (bDeep) bDeep=pHitObj->IsMacroHit(aHitRec);
- if (bMid ) bMid =pMidObj->IsMacroHit(aHitRec);
- if (bRoot) bRoot=pObj->IsMacroHit(aHitRec);
+
+ aHitRec.maPos = aLocalLogicPosition;
+ aHitRec.maDownPos = aLocalLogicPosition;
+ aHitRec.mfTol = getHitTolLog();
+ aHitRec.mpSdrView = this;
+
+ if(bDeep)
+ {
+ bDeep = pHitObj->IsMacroHit(aHitRec);
+ }
+
+ if(bMid)
+ {
+ bMid = pMidObj->IsMacroHit(aHitRec);
+ }
+
+ if(bRoot)
+ {
+ bRoot = pObj->IsMacroHit(aHitRec);
+ }
+
if (bRoot || bMid || bDeep)
{
// Prio: 1.Root, 2.Mid, 3.Deep
- rVEvt.pRootObj=pObj;
- if (!bRoot) pObj=pMidObj;
- if (!bRoot && !bMid) pObj=pHitObj;
+ rVEvt.mpRootObj = pObj;
+
+ if(!bRoot)
+ {
+ pObj = pMidObj;
+ }
+
+ if(!bRoot && !bMid)
+ {
+ pObj = pHitObj;
+ }
+
eHit=SDRHIT_MACRO;
}
}
}
+
// auf URL-Field checken
- if (IsMacroMode() && eHit==SDRHIT_UNMARKEDOBJECT)
+ if(SDRHIT_UNMARKEDOBJECT == eHit)
{
- SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pHitObj);
- if (pTextObj!=NULL && pTextObj->HasText())
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(pHitObj);
+
+ if(pTextObj && pTextObj->HasText() && GetSdrPageView())
{
- bool bTEHit(pPV &&
- SdrObjectPrimitiveHit(*pTextObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true));
+ drawinglayer::primitive2d::Primitive2DSequence aRecordFields;
+ const bool bTEHit(SdrObjectPrimitiveHit(
+ *pTextObj, aLocalLogicPosition, 0.0, *this, true, &aRecordFields));
- if (bTEHit)
+ if(bTEHit && aRecordFields.hasElements())
{
- Rectangle aTextRect;
- Rectangle aAnchor;
- SdrOutliner* pOutliner = &pTextObj->ImpGetDrawOutliner();
- if( pTextObj->GetModel() )
- pOutliner = &pTextObj->GetModel()->GetHitTestOutliner();
+ const sal_Int32 nCount(aRecordFields.getLength());
+ bool bDone(false);
- pTextObj->TakeTextRect( *pOutliner, aTextRect, sal_False, &aAnchor, sal_False );
+ for(sal_Int32 a(0); a < nCount; a++)
+ {
+ // get reference
+ const drawinglayer::primitive2d::Primitive2DReference xReference(aRecordFields[a]);
- // #i73628# Use a text-relative position for hit test in hit test outliner
- Point aTemporaryTextRelativePosition(aLocalLogicPosition - aTextRect.TopLeft());
+ if(xReference.is())
+ {
+ // try to cast to TextHierarchyFieldPrimitive2D implementation
+ const drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D* pFieldPrimitive =
+ dynamic_cast< const drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D* >(xReference.get());
- // FitToSize berueksichtigen
- SdrFitToSizeType eFit=pTextObj->GetFitToSize();
- sal_Bool bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
- if (bFitToSize) {
- Fraction aX(aTextRect.GetWidth()-1,aAnchor.GetWidth()-1);
- Fraction aY(aTextRect.GetHeight()-1,aAnchor.GetHeight()-1);
- ResizePoint(aTemporaryTextRelativePosition,Point(),aX,aY);
- }
- // Drehung berueksichtigen
- const GeoStat& rGeo=pTextObj->GetGeoStat();
- if (rGeo.nDrehWink!=0) RotatePoint(aTemporaryTextRelativePosition,Point(),-rGeo.nSin,rGeo.nCos); // -sin fuer Unrotate
- // Laufschrift berueksichtigen fehlt noch ...
- if(pActualOutDev && pActualOutDev->GetOutDevType() == OUTDEV_WINDOW)
- {
- OutlinerView aOLV(pOutliner, (Window*)pActualOutDev);
- const EditView& aEV=aOLV.GetEditView();
- const SvxFieldItem* pItem=aEV.GetField(aTemporaryTextRelativePosition);
- if (pItem!=NULL) {
- const SvxFieldData* pFld=pItem->GetField();
- const SvxURLField* pURL=PTR_CAST(SvxURLField,pFld);
- if (pURL!=NULL) {
+ if(pFieldPrimitive
+ && drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D::FIELD_TYPE_URL == pFieldPrimitive->getType())
+ {
+ OSL_ENSURE(!bDone, "OOps, more than one URLField hit by HitTest (!)");
eHit=SDRHIT_URLFIELD;
- rVEvt.pURLField=pURL;
+ rVEvt.maURLField = pFieldPrimitive->getStringA();
+ rVEvt.maTargetFrame = pFieldPrimitive->getStringB();
+ bDone = true;
}
}
}
@@ -527,98 +624,120 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
}
}
- if (nHitPassNum==SDRSEARCHPASS_DIRECT &&
- (eHit==SDRHIT_MARKEDOBJECT || eHit==SDRHIT_UNMARKEDOBJECT) &&
+ if(SDRSEARCHPASS_DIRECT == nHitPassNum &&
+ (SDRHIT_MARKEDOBJECT == eHit || SDRHIT_UNMARKEDOBJECT == eHit) &&
(IsTextTool() || (IsEditMode() && IsQuickTextEditMode())) && pHitObj->HasTextEdit())
{
// Ringsum die TextEditArea ein Rand zum Selektieren ohne Textedit
- Rectangle aBoundRect(pHitObj->GetCurrentBoundRect());
+ basegfx::B2DRange aBoundRange(pHitObj->getObjectRange(this));
// #105130# Force to SnapRect when Fontwork
- if(pHitObj->ISA(SdrTextObj) && ((SdrTextObj*)pHitObj)->IsFontwork())
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pHitObj);
+
+ if(pSdrTextObj && pSdrTextObj->IsFontwork())
{
- aBoundRect = pHitObj->GetSnapRect();
+ aBoundRange = sdr::legacy::GetSnapRange(*pHitObj);
}
// #105130# Old test for hit on BoundRect is completely wrong
// and never worked, doing it new here.
- sal_Int32 nTolerance(nHitTolLog);
- sal_Bool bBoundRectHit(sal_False);
+ double fTolerance(getHitTolLog());
+ bool bBoundRectHit(false);
if(pOut)
{
- nTolerance = pOut->PixelToLogic(Size(2, 0)).Width();
+ fTolerance = basegfx::B2DVector(pOut->GetInverseViewTransformation() * basegfx::B2DVector(2.0, 0.0)).getLength();
}
- if( (aLocalLogicPosition.X() >= aBoundRect.Left() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Left() + nTolerance)
- || (aLocalLogicPosition.X() >= aBoundRect.Right() - nTolerance && aLocalLogicPosition.X() <= aBoundRect.Right() + nTolerance)
- || (aLocalLogicPosition.Y() >= aBoundRect.Top() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Top() + nTolerance)
- || (aLocalLogicPosition.Y() >= aBoundRect.Bottom() - nTolerance && aLocalLogicPosition.Y() <= aBoundRect.Bottom() + nTolerance))
+ basegfx::B2DRange aOuterBound(aBoundRange);
+ aOuterBound.grow(fTolerance);
+
+ if(aOuterBound.isInside(aLocalLogicPosition))
{
- bBoundRectHit = sal_True;
+ basegfx::B2DRange aInnerBound(aBoundRange);
+ aInnerBound.grow(-fTolerance);
+
+ if(!aInnerBound.isInside(aLocalLogicPosition))
+ {
+ bBoundRectHit = true;
+ }
}
if(!bBoundRectHit)
{
- bool bTEHit(pPV &&
- SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, 0, *pPV, &pPV->GetVisibleLayers(), true));
+ bool bTEHit(SdrObjectPrimitiveHit(*pHitObj, aLocalLogicPosition, 0.0, *this, true, 0));
// TextEdit an Objekten im gesperrten Layer
- if (pPV->GetLockedLayers().IsSet(pHitObj->GetLayer()))
+ if(GetSdrPageView() && GetSdrPageView()->GetLockedLayers().IsSet(pHitObj->GetLayer()))
{
- bTEHit=sal_False;
+ bTEHit = false;
}
if (bTEHit)
{
- rVEvt.pRootObj=pObj;
+ rVEvt.mpRootObj = pObj;
pObj=pHitObj;
eHit=SDRHIT_TEXTEDITOBJ;
}
}
}
- if (nHitPassNum!=SDRSEARCHPASS_DIRECT && eHit==SDRHIT_UNMARKEDOBJECT) {
+
+ if(SDRSEARCHPASS_DIRECT != nHitPassNum && SDRHIT_UNMARKEDOBJECT == eHit)
+ {
eHit=SDRHIT_NONE;
- pObj=NULL;
- pPV=NULL;
+ pObj = 0;
}
- sal_Bool bMouseLeft=(rVEvt.nMouseCode&MOUSE_LEFT)!=0;
- sal_Bool bMouseRight=(rVEvt.nMouseCode&MOUSE_RIGHT)!=0;
- sal_Bool bMouseDown=rVEvt.bMouseDown;
- sal_Bool bMouseUp=rVEvt.bMouseUp;
- SdrEventKind eEvent=SDREVENT_NONE;
- sal_Bool bIsAction=IsAction();
+
+ const bool bMouseLeft(rVEvt.mnMouseCode & MOUSE_LEFT);
+ const bool bMouseRight(rVEvt.mnMouseCode & MOUSE_RIGHT);
+ const bool bMouseDown(rVEvt.mbMouseDown);
+ const bool bMouseUp(rVEvt.mbMouseUp);
+ SdrEventKind eEvent(SDREVENT_NONE);
+ const bool bIsAction(IsAction());
if (bIsAction)
{
if (bMouseDown)
{
- if (bMouseRight) eEvent=SDREVENT_BCKACTION;
+ if(bMouseRight)
+ {
+ eEvent = SDREVENT_BCKACTION;
+ }
}
else if (bMouseUp)
{
if (bMouseLeft)
{
eEvent=SDREVENT_ENDACTION;
+
if (IsDragObj())
{
eEvent=SDREVENT_ENDDRAG;
- rVEvt.bDragWithCopy=MODKEY_CopyDrag;
+ rVEvt.mbDragWithCopy = MODKEY_CopyDrag;
}
- else if (IsCreateObj() || IsInsObjPoint())
+ else if(GetCreateObj() || IsInsObjPoint())
{
- eEvent=IsCreateObj() ? SDREVENT_ENDCREATE : SDREVENT_ENDINSOBJPOINT;
- rVEvt.eEndCreateCmd=SDRCREATE_NEXTPOINT;
- if (MODKEY_PolyPoly) rVEvt.eEndCreateCmd=SDRCREATE_NEXTOBJECT;
- if (rVEvt.nMouseClicks>1) rVEvt.eEndCreateCmd=SDRCREATE_FORCEEND;
+ eEvent = GetCreateObj() ? SDREVENT_ENDCREATE : SDREVENT_ENDINSOBJPOINT;
+ rVEvt.meEndCreateCmd = SDRCREATE_NEXTPOINT;
+
+ if(MODKEY_PolyPoly)
+ {
+ rVEvt.meEndCreateCmd = SDRCREATE_NEXTOBJECT;
+ }
+
+ if(rVEvt.mnMouseClicks > 1)
+ {
+ rVEvt.meEndCreateCmd = SDRCREATE_FORCEEND;
+ }
}
else if (IsMarking())
{
eEvent=SDREVENT_ENDMARK;
- if (!aDragStat.IsMinMoved())
+
+ if(!GetDragStat().IsMinMoved())
{
eEvent=SDREVENT_BRKMARK;
- rVEvt.bAddMark=MODKEY_MultiMark;
+ rVEvt.mbAddMark = MODKEY_MultiMark;
}
}
}
@@ -628,54 +747,57 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
eEvent=SDREVENT_MOVACTION;
}
}
- else if (eHit==SDRHIT_TEXTEDIT)
+ else if(SDRHIT_TEXTEDIT == eHit)
{
eEvent=SDREVENT_TEXTEDIT;
}
else if (bMouseDown && bMouseLeft)
{
- if (rVEvt.nMouseClicks==2 && rVEvt.nMouseCode==MOUSE_LEFT && pObj!=NULL && pHitObj!=NULL && pHitObj->HasTextEdit() && eHit==SDRHIT_MARKEDOBJECT)
+ if(2 == rVEvt.mnMouseClicks && MOUSE_LEFT == rVEvt.mnMouseCode && pObj && pHitObj && pHitObj->HasTextEdit() && SDRHIT_MARKEDOBJECT == eHit)
{
- rVEvt.pRootObj=pObj;
+ rVEvt.mpRootObj = pObj;
pObj=pHitObj;
eEvent=SDREVENT_BEGTEXTEDIT;
}
- else if (MODKEY_ForceMark && eHit!=SDRHIT_URLFIELD)
+ else if(MODKEY_ForceMark && SDRHIT_URLFIELD != eHit)
{
eEvent=SDREVENT_BEGMARK; // AddMark,Unmark */
}
- else if (eHit==SDRHIT_HELPLINE)
+ else if(SDRHIT_HELPLINE == eHit)
{
eEvent=SDREVENT_BEGDRAGHELPLINE; // nix weiter
}
- else if (eHit==SDRHIT_GLUEPOINT)
+ else if(SDRHIT_GLUEPOINT == eHit)
{
eEvent=SDREVENT_MARKGLUEPOINT; // AddMark+Drag
- rVEvt.bAddMark=MODKEY_MultiMark || MODKEY_DeepMark; // falls bei Deep nicht getroffen
+ rVEvt.mbAddMark = MODKEY_MultiMark || MODKEY_DeepMark; // falls bei Deep nicht getroffen
}
- else if (eHit==SDRHIT_HANDLE)
+ else if(SDRHIT_HANDLE == eHit)
{
eEvent=SDREVENT_BEGDRAGOBJ; // Mark+Drag,AddMark+Drag,DeepMark+Drag,Unmark
- sal_Bool bGlue=pHdl->GetKind()==HDL_GLUE;
- sal_Bool bPoly=!bGlue && IsPointMarkable(*pHdl);
- sal_Bool bMarked=bGlue || bPoly && pHdl->IsSelected();
+ const bool bGlue(HDL_GLUE == pHdl->GetKind());
+ const bool bPoly(!bGlue && IsPointMarkable(*pHdl));
+ const bool bMarked(bGlue || bPoly && pHdl->IsSelected());
+
if (bGlue || bPoly)
{
eEvent=bGlue ? SDREVENT_MARKGLUEPOINT : SDREVENT_MARKPOINT;
+
if (MODKEY_DeepMark)
{
- rVEvt.bAddMark=sal_True;
- rVEvt.bPrevNextMark=sal_True;
- rVEvt.bMarkPrev=MODKEY_DeepBackw;
+ rVEvt.mbAddMark = true;
+ rVEvt.mbPrevNextMark = true;
+ rVEvt.mbMarkPrev = MODKEY_DeepBackw;
}
else if (MODKEY_MultiMark)
{
- rVEvt.bAddMark=sal_True;
- rVEvt.bUnmark=bMarked; // Toggle
+ rVEvt.mbAddMark = true;
+ rVEvt.mbUnmark = bMarked; // Toggle
+
if (bGlue)
{
- pObj=pHdl->GetObj();
- nGlueId=(sal_uInt16)pHdl->GetObjHdlNum();
+ pObj = const_cast< SdrObject* >(pHdl->GetObj());
+ nGlueId = pHdl->GetObjHdlNum();
}
}
else if (bMarked)
@@ -687,37 +809,40 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
else if (bInsPolyPt && (MODKEY_PolyPoly || (!MODKEY_MultiMark && !MODKEY_DeepMark)))
{
eEvent=SDREVENT_BEGINSOBJPOINT;
- rVEvt.bInsPointNewObj=MODKEY_PolyPoly;
+ rVEvt.mbInsPointNewObj = MODKEY_PolyPoly;
}
else if (bInsGluePt && !MODKEY_MultiMark && !MODKEY_DeepMark)
{
eEvent=SDREVENT_BEGINSGLUEPOINT;
}
- else if (eHit==SDRHIT_TEXTEDITOBJ)
+ else if(SDRHIT_TEXTEDITOBJ == eHit)
{
eEvent=SDREVENT_BEGTEXTEDIT; // AddMark+Drag,DeepMark+Drag,Unmark
+
if (MODKEY_MultiMark || MODKEY_DeepMark)
{ // falls bei Deep nicht getroffen
eEvent=SDREVENT_MARKOBJ;
}
}
- else if (eHit==SDRHIT_MACRO)
+ else if(SDRHIT_MACRO == eHit)
{
eEvent=SDREVENT_BEGMACROOBJ; // AddMark+Drag
+
if (MODKEY_MultiMark || MODKEY_DeepMark)
{ // falls bei Deep nicht getroffen
eEvent=SDREVENT_MARKOBJ;
}
}
- else if (eHit==SDRHIT_URLFIELD)
+ else if(SDRHIT_URLFIELD == eHit)
{
eEvent=SDREVENT_EXECUTEURL; // AddMark+Drag
+
if (MODKEY_MultiMark || MODKEY_DeepMark)
{ // falls bei Deep nicht getroffen
eEvent=SDREVENT_MARKOBJ;
}
}
- else if (eHit==SDRHIT_MARKEDOBJECT)
+ else if(SDRHIT_MARKEDOBJECT == eHit)
{
eEvent=SDREVENT_BEGDRAGOBJ; // DeepMark+Drag,Unmark
@@ -730,7 +855,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
{
eEvent=SDREVENT_BEGCREATEOBJ; // Nix weiter
}
- else if (eHit==SDRHIT_UNMARKEDOBJECT)
+ else if(SDRHIT_UNMARKEDOBJECT == eHit)
{
eEvent=SDREVENT_MARKOBJ; // AddMark+Drag
}
@@ -739,72 +864,82 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
eEvent=SDREVENT_BEGMARK;
}
- if (eEvent==SDREVENT_MARKOBJ)
+ if(SDREVENT_MARKOBJ == eEvent)
{
- rVEvt.bAddMark=MODKEY_MultiMark || MODKEY_DeepMark; // falls bei Deep nicht getroffen
- rVEvt.bPrevNextMark=MODKEY_DeepMark;
- rVEvt.bMarkPrev=MODKEY_DeepMark && MODKEY_DeepBackw;
+ rVEvt.mbAddMark= MODKEY_MultiMark || MODKEY_DeepMark; // falls bei Deep nicht getroffen
+ rVEvt.mbPrevNextMark = MODKEY_DeepMark;
+ rVEvt.mbMarkPrev = MODKEY_DeepMark && MODKEY_DeepBackw;
}
- if (eEvent==SDREVENT_BEGMARK)
+
+ if(SDREVENT_BEGMARK == eEvent)
{
- rVEvt.bAddMark=MODKEY_MultiMark;
- rVEvt.bUnmark=MODKEY_Unmark;
+ rVEvt.mbAddMark = MODKEY_MultiMark;
+ rVEvt.mbUnmark = MODKEY_Unmark;
}
}
- rVEvt.bIsAction=bIsAction;
- rVEvt.bIsTextEdit=bIsTextEdit;
- rVEvt.bTextEditHit=bTextEditHit;
- rVEvt.aLogicPos=aLocalLogicPosition;
- rVEvt.pHdl=pHdl;
- rVEvt.pObj=pObj;
- if(rVEvt.pRootObj==NULL)
- rVEvt.pRootObj=pObj;
- rVEvt.pPV=pPV;
- rVEvt.nHlplIdx=nHlplIdx;
- rVEvt.nGlueId=nGlueId;
- rVEvt.eHit=eHit;
- rVEvt.eEvent=eEvent;
- rVEvt.bCaptureMouse=bMouseLeft && bMouseDown && eEvent!=SDREVENT_NONE;
- rVEvt.bReleaseMouse=bMouseLeft && bMouseUp;
-#ifdef DGB_UTIL
- if (rVEvt.pRootObj!=NULL) {
- if (rVEvt.pRootObj->GetObjList()!=rVEvt.pPV->GetObjList()) {
- DBG_ERROR("SdrView::PickAnything(): pRootObj->GetObjList()!=pPV->GetObjList() !");
- }
+
+ rVEvt.mbIsAction = bIsAction;
+ rVEvt.mbIsTextEdit = bIsTextEdit;
+ rVEvt.mbTextEditHit = bTextEditHit;
+ rVEvt.maLogicPos = aLocalLogicPosition;
+ rVEvt.mpHdl = pHdl;
+ rVEvt.mpObj = pObj;
+
+ if(!rVEvt.mpRootObj)
+ {
+ rVEvt.mpRootObj = pObj;
}
-#endif
+
+ rVEvt.mnHlplIdx = nHlplIdx;
+ rVEvt.mnGlueId = nGlueId;
+ rVEvt.meHit = eHit;
+ rVEvt.meEvent = eEvent;
+ rVEvt.mbCaptureMouse = bMouseLeft && bMouseDown && SDREVENT_NONE != eEvent;
+ rVEvt.mbReleaseMouse = bMouseLeft && bMouseUp;
+
return eHit;
}
-sal_Bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
+bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
{
- sal_Bool bRet=sal_False;
- SdrHitKind eHit=rVEvt.eHit;
- Point aLogicPos(rVEvt.aLogicPos);
-
- sal_Bool bShift=(rVEvt.nMouseCode & KEY_SHIFT) !=0;
- sal_Bool bCtrl=(rVEvt.nMouseCode & KEY_MOD1) !=0;
- sal_Bool bAlt=(rVEvt.nMouseCode & KEY_MOD2) !=0;
- sal_Bool bMouseLeft=(rVEvt.nMouseCode&MOUSE_LEFT)!=0;
- //sal_Bool bMouseRight=(rVEvt.nMouseCode&MOUSE_RIGHT)!=0;
- sal_Bool bMouseDown=rVEvt.bMouseDown;
- sal_Bool bMouseUp=rVEvt.bMouseUp;
- if (bMouseDown) {
- if (bMouseLeft) aDragStat.SetMouseDown(sal_True);
- } else if (bMouseUp) {
- if (bMouseLeft) aDragStat.SetMouseDown(sal_False);
- } else { // ansonsten MoueMove
- aDragStat.SetMouseDown(bMouseLeft);
+ bool bRetval(false);
+ SdrHitKind eHit(rVEvt.meHit);
+
+ const bool bModKeyShift(rVEvt.mnMouseCode & KEY_SHIFT);
+ const bool bModKeyCtrl(rVEvt.mnMouseCode & KEY_MOD1);
+ const bool bModKeyAlt(rVEvt.mnMouseCode & KEY_MOD2);
+
+ bool bMouseLeft(rVEvt.mnMouseCode & MOUSE_LEFT);
+ bool bMouseDown(rVEvt.mbMouseDown);
+ bool bMouseUp(rVEvt.mbMouseUp);
+
+ if(bMouseDown)
+ {
+ if(bMouseLeft)
+ {
+ GetDragStat().SetMouseDown(true);
+ }
+ }
+ else if(bMouseUp)
+ {
+ if(bMouseLeft)
+ {
+ GetDragStat().SetMouseDown(false);
+ }
+ }
+ else
+ { // ansonsten MoueMove
+ GetDragStat().SetMouseDown(bMouseLeft);
}
#ifdef MODKEY_NoSnap
SetSnapEnabled(!MODKEY_NoSnap);
#endif
#ifdef MODKEY_Ortho
- SetOrtho(MODKEY_Ortho!=IsOrthoDesired());
+ SetOrthogonal(MODKEY_Ortho!=IsOrthoDesired());
#endif
#ifdef MODKEY_BigOrtho
- SetBigOrtho(MODKEY_BigOrtho);
+ SetBigOrthogonal(MODKEY_BigOrtho);
#endif
#ifdef MODKEY_AngleSnap
SetAngleSnapEnabled(MODKEY_AngleSnap);
@@ -817,224 +952,422 @@ sal_Bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
SetResizeAtCenter(MODKEY_Center);
SetCrookAtCenter(MODKEY_Center);
#endif
- if (bMouseLeft && bMouseDown && rVEvt.bIsTextEdit && (eHit==SDRHIT_UNMARKEDOBJECT || eHit==SDRHIT_NONE)) {
+
+ if(bMouseLeft && bMouseDown && rVEvt.mbIsTextEdit && (SDRHIT_UNMARKEDOBJECT == eHit || SDRHIT_NONE == eHit))
+ {
SdrEndTextEdit(); // Danebengeklickt, Ende mit Edit
// pHdl ist dann ungueltig. Sollte aber egal sein, wein pHdl==NULL
// sein muesste (wg. eHit).
}
- switch (rVEvt.eEvent) {
- case SDREVENT_NONE: bRet=sal_False; break;
- case SDREVENT_TEXTEDIT: bRet=sal_False; break; // Events an die OutlinerView werden hier nicht beruecksichtigt
- case SDREVENT_MOVACTION: MovAction(aLogicPos); bRet=sal_True; break;
- case SDREVENT_ENDACTION: EndAction(); bRet=sal_True; break;
- case SDREVENT_BCKACTION: BckAction(); bRet=sal_True; break;
- case SDREVENT_BRKACTION: BrkAction(); bRet=sal_True; break;
- case SDREVENT_ENDMARK : EndAction(); bRet=sal_True; break;
- case SDREVENT_BRKMARK : {
+
+ switch(rVEvt.meEvent)
+ {
+ case SDREVENT_NONE:
+ bRetval = false;
+ break;
+
+ case SDREVENT_TEXTEDIT: // Events an die OutlinerView werden hier nicht beruecksichtigt
+ bRetval = false;
+ break;
+
+ case SDREVENT_MOVACTION:
+ MovAction(rVEvt.maLogicPos);
+ bRetval = true;
+ break;
+
+ case SDREVENT_ENDACTION:
+ EndAction();
+ bRetval = true;
+ break;
+
+ case SDREVENT_BCKACTION:
+ BckAction();
+ bRetval = true;
+ break;
+
+ case SDREVENT_BRKACTION:
+ BrkAction();
+ bRetval = true;
+ break;
+
+ case SDREVENT_ENDMARK :
+ EndAction();
+ bRetval = true;
+ break;
+
+ case SDREVENT_BRKMARK :
+ {
BrkAction();
- if (!MarkObj(aLogicPos,nHitTolLog,rVEvt.bAddMark)) {
+
+ if(!MarkObj(rVEvt.maLogicPos, getHitTolLog(), rVEvt.mbAddMark))
+ {
// Kein Obj getroffen. Dann werden zuerst
// - Markierte Klebepunkte deselektiert
// - dann ggf. selektierte Polygonpunkte
// - und ansonsten Objekte
- if (!rVEvt.bAddMark) UnmarkAll();
- }
- bRet=sal_True;
- } break;
- case SDREVENT_ENDCREATE: { // ggf. MarkObj
- SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT;
- if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT;
- if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND;
- if (!EndCreateObj(eCmd)) { // Event fuer Create nicht ausgewerten? -> Markieren
- if (eHit==SDRHIT_UNMARKEDOBJECT || eHit==SDRHIT_TEXTEDIT) {
- MarkObj(rVEvt.pRootObj,rVEvt.pPV);
- if (eHit==SDRHIT_TEXTEDIT)
+ if(!rVEvt.mbAddMark)
+ {
+ UnmarkAll();
+ }
+ }
+
+ bRetval = true;
+ break;
+ }
+
+ case SDREVENT_ENDCREATE:
+ {
+ // ggf. MarkObj
+ SdrCreateCmd eCmd(SDRCREATE_NEXTPOINT);
+
+ if(MODKEY_PolyPoly)
+ {
+ eCmd = SDRCREATE_NEXTOBJECT;
+ }
+
+ if(rVEvt.mnMouseClicks > 1)
+ {
+ eCmd = SDRCREATE_FORCEEND;
+ }
+
+ if(!EndCreateObj(eCmd))
+ { // Event fuer Create nicht ausgewerten? -> Markieren
+ if(SDRHIT_UNMARKEDOBJECT == eHit || SDRHIT_TEXTEDIT == eHit)
+ {
+ MarkObj(*rVEvt.mpRootObj);
+
+ if(SDRHIT_TEXTEDIT == eHit)
{
- sal_Bool bRet2(pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType() &&
- SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, (Window*)pActualOutDev, sal_False, (SdrOutliner*)0L));
+ bool bRet2(GetActualOutDev() && OUTDEV_WINDOW == GetActualOutDev()->GetOutDevType() &&
+ SdrBeginTextEdit(rVEvt.mpObj, (Window*)GetActualOutDev(), false, (SdrOutliner*)0L));
if(bRet2)
{
- MouseEvent aMEvt(pActualOutDev->LogicToPixel(aLogicPos),
- 1,rVEvt.nMouseMode,rVEvt.nMouseCode,rVEvt.nMouseCode);
-
OutlinerView* pOLV=GetTextEditOutlinerView();
- if (pOLV!=NULL) {
+
+ if(pOLV)
+ {
+ const basegfx::B2DPoint aPixelPos(GetActualOutDev()->GetViewTransformation() * rVEvt.maLogicPos);
+ const Point aPixelPnt(basegfx::fround(aPixelPos.getX()), basegfx::fround(aPixelPos.getY()));
+ MouseEvent aMEvt(aPixelPnt, 1, rVEvt.mnMouseMode, rVEvt.mnMouseCode, rVEvt.mnMouseCode);
+
pOLV->MouseButtonDown(aMEvt); // Event an den Outliner, aber ohne Doppelklick
pOLV->MouseButtonUp(aMEvt); // Event an den Outliner, aber ohne Doppelklick
}
}
}
- bRet=sal_True; // Obj markiert und ggf. TextEdit gestartet
- } else bRet=sal_False; // Create abgebrochen, sonst nix weiter.
- } else bRet=sal_True; // EndCreate mit sal_True returniert
- } break;
- case SDREVENT_ENDDRAG: {
- bRet=EndDragObj(IsDragWithCopy());
- ForceMarkedObjToAnotherPage(); // Undo+Klammerung fehlt noch !!!
- } break;
- case SDREVENT_MARKOBJ: { // + ggf. BegDrag
- if (!rVEvt.bAddMark) UnmarkAllObj();
- sal_Bool bUnmark=rVEvt.bUnmark;
- if (rVEvt.bPrevNextMark) {
- bRet=MarkNextObj(aLogicPos,nHitTolLog,rVEvt.bMarkPrev);
- } else {
- SortMarkedObjects();
- sal_uIntPtr nAnz0=GetMarkedObjectCount();
- bRet=MarkObj(aLogicPos,nHitTolLog,rVEvt.bAddMark);
- SortMarkedObjects();
- sal_uIntPtr nAnz1=GetMarkedObjectCount();
- bUnmark=nAnz1<nAnz0;
- }
- if (!bUnmark) {
- BegDragObj(aLogicPos,NULL,(SdrHdl*)NULL,nMinMovLog);
- bRet=sal_True;
- }
- } break;
- case SDREVENT_MARKPOINT: { // + ggf. BegDrag
- if (!rVEvt.bAddMark) UnmarkAllPoints();
- if (rVEvt.bPrevNextMark) {
- bRet=MarkNextPoint(aLogicPos,rVEvt.bMarkPrev);
- } else {
- bRet=MarkPoint(*rVEvt.pHdl,rVEvt.bUnmark);
- }
- if (!rVEvt.bUnmark && !rVEvt.bPrevNextMark) {
- BegDragObj(aLogicPos,NULL,rVEvt.pHdl,nMinMovLog);
- bRet=sal_True;
- }
- } break;
- case SDREVENT_MARKGLUEPOINT: { // + ggf. BegDrag
- if (!rVEvt.bAddMark) UnmarkAllGluePoints();
- if (rVEvt.bPrevNextMark) {
- bRet=MarkNextGluePoint(aLogicPos,rVEvt.bMarkPrev);
- } else {
- bRet=MarkGluePoint(rVEvt.pObj,rVEvt.nGlueId,rVEvt.pPV,rVEvt.bUnmark);
- }
- if (!rVEvt.bUnmark && !rVEvt.bPrevNextMark) {
- SdrHdl* pHdl=GetGluePointHdl(rVEvt.pObj,rVEvt.nGlueId);
- BegDragObj(aLogicPos,NULL,pHdl,nMinMovLog);
- bRet=sal_True;
- }
- } break;
- case SDREVENT_BEGMARK: bRet=BegMark(aLogicPos,rVEvt.bAddMark,rVEvt.bUnmark); break;
- case SDREVENT_BEGINSOBJPOINT: bRet = BegInsObjPoint(aLogicPos, MODKEY_PolyPoly); break;
- case SDREVENT_ENDINSOBJPOINT: {
- SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT;
- if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT;
- if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND;
+
+ bRetval = true; // Obj markiert und ggf. TextEdit gestartet
+ }
+ else
+ {
+ bRetval = false; // Create abgebrochen, sonst nix weiter.
+ }
+ }
+ else
+ {
+ bRetval=true; // EndCreate mit true returniert
+ }
+
+ break;
+ }
+
+ case SDREVENT_ENDDRAG:
+ {
+ bRetval = EndDragObj(IsDragWithCopy());
+// ForceMarkedObjToAnotherPage(); // Undo+Klammerung fehlt noch !!!
+ break;
+ }
+
+ case SDREVENT_MARKOBJ:
+ { // + ggf. BegDrag
+ if(!rVEvt.mbAddMark)
+ {
+ UnmarkAllObj();
+ }
+
+ bool bUnmark(rVEvt.mbUnmark);
+
+ if(rVEvt.mbPrevNextMark)
+ {
+ bRetval = MarkNextObj(rVEvt.maLogicPos, getHitTolLog(), rVEvt.mbMarkPrev);
+ }
+ else
+ {
+ const sal_uInt32 nAnz0(getSelectedSdrObjectCount());
+
+ // 3rd parameter is bToggle, so indeed the number of selected before and
+ // after has to be checked
+ bRetval = MarkObj(rVEvt.maLogicPos, getHitTolLog(), rVEvt.mbAddMark);
+
+ const sal_uInt32 nAnz1(getSelectedSdrObjectCount());
+
+ bUnmark = nAnz1 < nAnz0;
+ }
+
+ if(!bUnmark)
+ {
+ BegDragObj(rVEvt.maLogicPos, (SdrHdl*)0, getMinMovLog());
+ bRetval = true;
+ }
+
+ break;
+ }
+
+ case SDREVENT_MARKPOINT:
+ { // + ggf. BegDrag
+ if(!rVEvt.mbAddMark)
+ {
+ MarkPoints(0, true); // unmarkall
+ }
+
+ if(rVEvt.mbPrevNextMark)
+ {
+ bRetval = false; // MarkNextPoint(rVEvt.maLogicPos, rVEvt.mbMarkPrev);
+ }
+ else
+ {
+ bRetval = MarkPoint(const_cast< SdrHdl& >(*rVEvt.mpHdl), rVEvt.mbUnmark);
+ }
+
+ if(!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark)
+ {
+ BegDragObj(rVEvt.maLogicPos, rVEvt.mpHdl, getMinMovLog());
+ bRetval = true;
+ }
+
+ break;
+ }
+
+ case SDREVENT_MARKGLUEPOINT:
+ { // + ggf. BegDrag
+ if(!rVEvt.mbAddMark)
+ {
+ MarkGluePoints(0, true);
+ }
+
+ if(rVEvt.mbPrevNextMark)
+ {
+ bRetval = false; // MarkNextGluePoint(rVEvt.maLogicPos, rVEvt.mbMarkPrev);
+ }
+ else
+ {
+ bRetval=MarkGluePoint(rVEvt.mpObj, rVEvt.mnGlueId, rVEvt.mbUnmark);
+ }
+
+ if(!rVEvt.mbUnmark && !rVEvt.mbPrevNextMark)
+ {
+ SdrHdl* pHdl = GetGluePointHdl(rVEvt.mpObj, rVEvt.mnGlueId);
+
+ BegDragObj(rVEvt.maLogicPos, pHdl, getMinMovLog());
+ bRetval = true;
+ }
+
+ break;
+ }
+
+ case SDREVENT_BEGMARK:
+ bRetval = BegMark(rVEvt.maLogicPos, rVEvt.mbAddMark, rVEvt.mbUnmark);
+ break;
+
+ case SDREVENT_BEGINSOBJPOINT:
+ bRetval = BegInsObjPoint(rVEvt.maLogicPos, MODKEY_PolyPoly);
+ break;
+
+ case SDREVENT_ENDINSOBJPOINT:
+ {
+ SdrCreateCmd eCmd(SDRCREATE_NEXTPOINT);
+
+ if(MODKEY_PolyPoly)
+ {
+ eCmd = SDRCREATE_NEXTOBJECT;
+ }
+
+ if(rVEvt.mnMouseClicks > 1)
+ {
+ eCmd = SDRCREATE_FORCEEND;
+ }
+
EndInsObjPoint(eCmd);
- bRet=sal_True;
- } break;
- case SDREVENT_BEGINSGLUEPOINT: bRet=BegInsGluePoint(aLogicPos); break;
- case SDREVENT_BEGDRAGHELPLINE: bRet=BegDragHelpLine(rVEvt.nHlplIdx,rVEvt.pPV); break;
- case SDREVENT_BEGDRAGOBJ: bRet=BegDragObj(aLogicPos,NULL,rVEvt.pHdl,nMinMovLog); break;
- case SDREVENT_BEGCREATEOBJ: {
- if (nAktInvent==SdrInventor && nAktIdent==OBJ_CAPTION) {
- long nHgt=SdrEngineDefaults::GetFontHeight();
- bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt));
- } else bRet=BegCreateObj(aLogicPos);
- } break;
- case SDREVENT_BEGMACROOBJ: bRet=BegMacroObj(aLogicPos,nHitTolLog,rVEvt.pObj,rVEvt.pPV,(Window*)pActualOutDev); break;
- case SDREVENT_BEGTEXTEDIT: {
- if (!IsObjMarked(rVEvt.pObj)) {
+ bRetval = true;
+ break;
+ }
+
+ case SDREVENT_BEGINSGLUEPOINT:
+ bRetval = BegInsGluePoint(rVEvt.maLogicPos);
+ break;
+
+ case SDREVENT_BEGDRAGHELPLINE:
+ bRetval = BegDragHelpLine(rVEvt.mnHlplIdx);
+ break;
+
+ case SDREVENT_BEGDRAGOBJ:
+ bRetval = BegDragObj(rVEvt.maLogicPos, rVEvt.mpHdl, getMinMovLog());
+ break;
+
+ case SDREVENT_BEGCREATEOBJ:
+ {
+ if(SdrInventor == getSdrObjectCreationInfo().getInvent() && OBJ_CAPTION == getSdrObjectCreationInfo().getIdent())
+ {
+ const sal_Int32 nHgt(SdrEngineDefaults::GetFontHeight());
+
+ bRetval = BegCreateCaptionObj(rVEvt.maLogicPos, basegfx::B2DVector(5.0 * nHgt, 2.0 * nHgt));
+ }
+ else
+ {
+ bRetval = BegCreateObj(rVEvt.maLogicPos);
+ }
+ break;
+ }
+
+ case SDREVENT_BEGMACROOBJ:
+ bRetval = BegMacroObj(rVEvt.maLogicPos, getHitTolLog(), rVEvt.mpObj, (Window*)GetActualOutDev());
+ break;
+
+ case SDREVENT_BEGTEXTEDIT:
+ {
+ if(!IsObjMarked(*rVEvt.mpObj))
+ {
UnmarkAllObj();
- MarkObj(rVEvt.pRootObj,rVEvt.pPV);
- }
-
- bRet = pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType()&&
- SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, (Window*)pActualOutDev, sal_False, (SdrOutliner*)0L);
-
- if(bRet)
- {
- MouseEvent aMEvt(pActualOutDev->LogicToPixel(aLogicPos),
- 1,rVEvt.nMouseMode,rVEvt.nMouseCode,rVEvt.nMouseCode);
- OutlinerView* pOLV=GetTextEditOutlinerView();
- if (pOLV!=NULL) pOLV->MouseButtonDown(aMEvt); // Event an den Outliner, aber ohne Doppelklick
- }
- } break;
- default: break;
- } // switch
- if (bRet && pActualOutDev!=NULL && pActualOutDev->GetOutDevType()==OUTDEV_WINDOW) {
- Window* pWin=(Window*)pActualOutDev;
- // Maus links gedrueckt?
- sal_Bool bLeftDown=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && rVEvt.bMouseDown;
- // Maus links losgelassen?
- sal_Bool bLeftUp=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && rVEvt.bMouseUp;
- // Maus links gedrueckt oder gehalten?
- sal_Bool bLeftDown1=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && !rVEvt.bMouseUp;
- pWin->SetPointer(GetPreferedPointer(rVEvt.aLogicPos,pWin,
- rVEvt.nMouseCode & (KEY_SHIFT|KEY_MOD1|KEY_MOD2),bLeftDown1));
- sal_Bool bAction=IsAction();
- if (bLeftDown && bAction) pWin->CaptureMouse();
- else if (bLeftUp || (rVEvt.bIsAction && !bAction)) pWin->ReleaseMouse();
- }
- return bRet;
+ MarkObj(*rVEvt.mpRootObj);
+ }
+
+ bRetval = GetActualOutDev() && OUTDEV_WINDOW == GetActualOutDev()->GetOutDevType() &&
+ SdrBeginTextEdit(rVEvt.mpObj, (Window*)GetActualOutDev(), false, (SdrOutliner*)0);
+
+ if(bRetval)
+ {
+ OutlinerView* pOLV = GetTextEditOutlinerView();
+
+ if(pOLV)
+ {
+ const basegfx::B2DPoint aPixelPos(GetActualOutDev()->GetViewTransformation() * rVEvt.maLogicPos);
+ const Point aPixelPnt(basegfx::fround(aPixelPos.getX()), basegfx::fround(aPixelPos.getY()));
+ MouseEvent aMEvt(aPixelPnt, 1, rVEvt.mnMouseMode, rVEvt.mnMouseCode, rVEvt.mnMouseCode);
+
+ pOLV->MouseButtonDown(aMEvt); // Event an den Outliner, aber ohne Doppelklick
+ }
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ if(bRetval && GetActualOutDev() && OUTDEV_WINDOW == GetActualOutDev()->GetOutDevType())
+ {
+ Window* pWin = (Window*)GetActualOutDev();
+ const bool bLeftDown((rVEvt.mnMouseCode & MOUSE_LEFT) && rVEvt.mbMouseDown);
+ const bool bLeftUp((rVEvt.mnMouseCode & MOUSE_LEFT) && rVEvt.mbMouseUp);
+ const bool bLeftDown1((rVEvt.mnMouseCode & MOUSE_LEFT) && !rVEvt.mbMouseUp);
+
+ pWin->SetPointer(GetPreferedPointer(rVEvt.maLogicPos, pWin, rVEvt.mnMouseCode & (KEY_SHIFT|KEY_MOD1|KEY_MOD2), bLeftDown1));
+
+ const bool bAction(IsAction());
+
+ if(bLeftDown && bAction)
+ {
+ pWin->CaptureMouse();
+ }
+ else if(bLeftUp || (rVEvt.mbIsAction && !bAction))
+ {
+ pWin->ReleaseMouse();
+ }
+ }
+
+ return bRetval;
}
-#include <editeng/outlobj.hxx>
-Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier, sal_Bool bLeftDown) const
+Pointer SdrView::GetPreferedPointer(const basegfx::B2DPoint& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier, bool bLeftDown) const
{
- // Actions
- if (IsCreateObj())
+ if(GetCreateObj())
{
- return pAktCreate->GetCreatePointer();
+ return GetCreateObj()->GetCreatePointer(*this);
}
- if (mpCurrentSdrDragMethod)
- {
- if ((IsDraggingPoints() || IsDraggingGluePoints()) && IsMouseHideWhileDraggingPoints())
- return Pointer(POINTER_NULL);
+ if(mpCurrentSdrDragMethod)
+ {
return mpCurrentSdrDragMethod->GetSdrDragPointer();
}
- if (IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsEncirclement() || IsSetPageOrg()) return Pointer(POINTER_ARROW);
- if (IsDragHelpLine()) return GetDraggedHelpLinePointer();
- if (IsMacroObj()) {
+
+ if(IsMarkObj() || IsMarkPoints() || IsMarkGluePoints() || IsSetPageOrg())
+ {
+ return Pointer(POINTER_ARROW);
+ }
+
+ if(IsDragHelpLine())
+ {
+ return GetDraggedHelpLinePointer();
+ }
+
+ if(IsMacroObj())
+ {
SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=pOut->LogicToPixel(rMousePos);
- aHitRec.aDownPos=aMacroDownPos;
- aHitRec.nTol=nMacroTol;
- aHitRec.pVisiLayer=&pMacroPV->GetVisibleLayers();
- aHitRec.pPageView=pMacroPV;
- aHitRec.pOut=pMacroWin;
- aHitRec.bDown=bMacroDown;
- return pMacroObj->GetMacroPointer(aHitRec);
- }
- //sal_uInt16 nTol=nHitTolLog;
+
+ aHitRec.maPos = pOut->GetViewTransformation() * rMousePos;
+ aHitRec.maDownPos = maMacroDownPos;
+ aHitRec.mfTol = mnMacroTol;
+ aHitRec.mpSdrView = this;
+ aHitRec.mpOut = mpMacroWin;
+ aHitRec.mbDown = mbMacroDown;
+
+ return mpMacroObj->GetMacroPointer(aHitRec);
+ }
+
// TextEdit, ObjEdit, Macro
- if (IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos,0/*nTol*/)))
+ if(IsTextEdit() && (IsTextEditInSelectionMode() || IsTextEditHit(rMousePos, 0.0)))
{
if(!pOut || IsTextEditInSelectionMode())
{
- if(pTextEditOutliner->IsVertical())
+ if(GetTextEditOutliner()->IsVertical())
+ {
return Pointer(POINTER_TEXT_VERTICAL);
+ }
else
+ {
return Pointer(POINTER_TEXT);
+ }
}
+
// hier muss besser der Outliner was liefern:
- Point aPos(pOut->LogicToPixel(rMousePos));
- Pointer aPointer(pTextEditOutlinerView->GetPointer(aPos));
- if (aPointer==POINTER_ARROW)
+ const basegfx::B2DPoint aB2DPixelPos(pOut->GetViewTransformation() * rMousePos);
+ const Point aPixelPos(basegfx::fround(aB2DPixelPos.getX()), basegfx::fround(aB2DPixelPos.getY()));
+ Pointer aPointer(const_cast< SdrView* >(this)->GetTextEditOutlinerView()->GetPointer(aPixelPos));
+
+ if(POINTER_ARROW == aPointer.GetStyle())
{
- if(pTextEditOutliner->IsVertical())
+ if(GetTextEditOutliner()->IsVertical())
+ {
aPointer = POINTER_TEXT_VERTICAL;
+ }
else
+ {
aPointer = POINTER_TEXT;
+ }
}
+
return aPointer;
}
SdrViewEvent aVEvt;
- aVEvt.nMouseCode=(nModifier&(KEY_SHIFT|KEY_MOD1|KEY_MOD2))|MOUSE_LEFT; // um zu sehen, was bei MouseLeftDown passieren wuerde
- aVEvt.bMouseDown=!bLeftDown; // Was waere wenn ...
- aVEvt.bMouseUp=bLeftDown; // Was waere wenn ...
- if (pOut!=NULL)
- ((SdrView*)this)->SetActualWin(pOut);
- SdrHitKind eHit=PickAnything(rMousePos,aVEvt);
- SdrEventKind eEvent=aVEvt.eEvent;
+
+ aVEvt.mnMouseCode = (nModifier & (KEY_SHIFT|KEY_MOD1|KEY_MOD2)) | MOUSE_LEFT; // um zu sehen, was bei MouseLeftDown passieren wuerde
+ aVEvt.mbMouseDown = !bLeftDown; // Was waere wenn ...
+ aVEvt.mbMouseUp = bLeftDown; // Was waere wenn ...
+
+ if(!pOut)
+ {
+ getAsSdrView()->SetActualOutDev(pOut);
+ }
+
+ SdrHitKind eHit(PickAnything(rMousePos, aVEvt));
+ SdrEventKind eEvent(aVEvt.meEvent);
+
switch (eEvent)
{
case SDREVENT_BEGCREATEOBJ:
- return aAktCreatePointer;
+ return getCreatePointer();
case SDREVENT_MARKOBJ:
case SDREVENT_BEGMARK:
return Pointer(POINTER_ARROW);
@@ -1049,113 +1382,207 @@ Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice*
case SDREVENT_BEGMACROOBJ:
{
SdrObjMacroHitRec aHitRec;
- aHitRec.aPos=aVEvt.aLogicPos;
- aHitRec.aDownPos=aHitRec.aPos;
- aHitRec.nTol=nHitTolLog;
- aHitRec.pVisiLayer=&aVEvt.pPV->GetVisibleLayers();
- aHitRec.pPageView=aVEvt.pPV;
- aHitRec.pOut=(OutputDevice*)pOut;
- return aVEvt.pObj->GetMacroPointer(aHitRec);
+
+ aHitRec.maPos = aVEvt.maLogicPos;
+ aHitRec.maDownPos = aHitRec.maPos;
+ aHitRec.mfTol = getHitTolLog();
+ aHitRec.mpSdrView = this;
+ aHitRec.mpOut = (OutputDevice*)pOut;
+
+ return aVEvt.mpObj->GetMacroPointer(aHitRec);
}
- default: break;
- } // switch
+ default:
+ break;
+ }
switch(eHit)
{
case SDRHIT_CELL:
return Pointer(POINTER_ARROW);
case SDRHIT_HELPLINE :
- return aVEvt.pPV->GetHelpLines()[aVEvt.nHlplIdx].GetPointer();
+ if(GetSdrPageView())
+ {
+ return GetSdrPageView()->GetHelpLines()[aVEvt.mnHlplIdx].GetPointer();
+ }
case SDRHIT_GLUEPOINT:
return Pointer(POINTER_MOVEPOINT);
case SDRHIT_TEXTEDIT :
case SDRHIT_TEXTEDITOBJ:
{
- SdrTextObj* pText = dynamic_cast< SdrTextObj* >( aVEvt.pObj );
+ SdrTextObj* pText = dynamic_cast< SdrTextObj* >( aVEvt.mpObj );
+
if(pText && pText->HasText())
{
OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject();
+
if(pParaObj && pParaObj->IsVertical())
+ {
return Pointer(POINTER_TEXT_VERTICAL);
+ }
}
+
return Pointer(POINTER_TEXT);
}
- default: break;
+
+ default:
+ break;
}
- sal_Bool bMarkHit=eHit==SDRHIT_MARKEDOBJECT;
- SdrHdl* pHdl=aVEvt.pHdl;
+ const bool bMarkHit(SDRHIT_MARKEDOBJECT == eHit);
+ const SdrHdl* pHdl = aVEvt.mpHdl;
+ const bool bHandleFound(0 != pHdl); // remember pointer from handle, handle may be destroyed before used below
+
// Nun die Pointer fuer Dragging checken
- if (pHdl!=NULL || bMarkHit) {
- SdrHdlKind eHdl= pHdl!=NULL ? pHdl->GetKind() : HDL_MOVE;
- sal_Bool bCorner=pHdl!=NULL && pHdl->IsCornerHdl();
- sal_Bool bVertex=pHdl!=NULL && pHdl->IsVertexHdl();
- sal_Bool bMov=eHdl==HDL_MOVE;
- if (bMov && (eDragMode==SDRDRAG_MOVE || eDragMode==SDRDRAG_RESIZE || bMarkedHitMovesAlways)) {
- if (!IsMoveAllowed()) return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich
+ if(pHdl || bMarkHit)
+ {
+ const SdrHdlKind eHdl(pHdl ? pHdl->GetKind() : HDL_MOVE);
+ const bool bCorner(pHdl && pHdl->IsCornerHdl());
+ const bool bVertex(pHdl && pHdl->IsVertexHdl());
+ const bool bMov(HDL_MOVE == eHdl);
+ const Pointer aHdlPointer(pHdl ? pHdl->GetPointer() : Pointer(POINTER_ARROW));
+
+ if(bMov && (SDRDRAG_MOVE == GetDragMode() || SDRDRAG_RESIZE == GetDragMode() || IsMarkedHitMovesAlways()))
+ {
+ if(!IsMoveAllowed())
+ {
+ return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich
+ }
+
return Pointer(POINTER_MOVE);
}
- switch (eDragMode) {
- case SDRDRAG_ROTATE: {
- if ((bCorner || bMov) && !IsRotateAllowed(sal_True))
+
+ switch(GetDragMode())
+ {
+ case SDRDRAG_ROTATE:
+ {
+ if((bCorner || bMov) && !IsRotateAllowed(true))
+ {
return Pointer(POINTER_NOTALLOWED);
+ }
// Sind 3D-Objekte selektiert?
- sal_Bool b3DObjSelected = sal_False;
-#ifndef SVX_LIGHT
- for (sal_uInt32 a=0; !b3DObjSelected && a<GetMarkedObjectCount(); a++) {
- SdrObject* pObj = GetMarkedObjectByIndex(a);
- if(pObj && pObj->ISA(E3dObject))
- b3DObjSelected = sal_True;
+ bool b3DObjSelected(false);
+
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); !b3DObjSelected && a < aSelection.size(); a++)
+ {
+ if(dynamic_cast< E3dObject* >(aSelection[a]))
+ {
+ b3DObjSelected = true;
+ }
+ }
}
-#endif
+
// Falls es um ein 3D-Objekt geht, muss trotz !IsShearAllowed
// weitergemacht werden, da es sich um eine Rotation statt um
// einen Shear handelt
if (bVertex && !IsShearAllowed() && !b3DObjSelected)
+ {
return Pointer(POINTER_NOTALLOWED);
+ }
+
if (bMov)
+ {
return Pointer(POINTER_ROTATE);
- } break;
- case SDRDRAG_SHEAR: case SDRDRAG_DISTORT: {
- if (bCorner) {
- if (!IsDistortAllowed(sal_True) && !IsDistortAllowed(sal_False)) return Pointer(POINTER_NOTALLOWED);
- else return Pointer(POINTER_REFHAND);
}
- if (bVertex && !IsShearAllowed()) return Pointer(POINTER_NOTALLOWED);
- if (bMov) {
- if (!IsMoveAllowed()) return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich
- return Pointer(POINTER_MOVE);
+
+ break;
+ }
+
+ case SDRDRAG_SHEAR:
+ case SDRDRAG_DISTORT:
+ {
+ if(bCorner)
+ {
+ if(!IsDistortAllowed(true) && !IsDistortAllowed(false))
+ {
+ return Pointer(POINTER_NOTALLOWED);
+ }
+ else
+ {
+ return Pointer(POINTER_REFHAND);
+ }
+ }
+
+ if(bVertex && !IsShearAllowed())
+ {
+ return Pointer(POINTER_NOTALLOWED);
}
- } break;
- case SDRDRAG_MIRROR: {
- if (bCorner || bVertex || bMov) {
- SdrHdl* pH1=aHdl.GetHdl(HDL_REF1);
- SdrHdl* pH2=aHdl.GetHdl(HDL_REF2);
- sal_Bool b90=sal_False;
- sal_Bool b45=sal_False;
- Point aDif;
- if (pH1!=NULL && pH2!=NULL) {
- aDif=pH2->GetPos()-pH1->GetPos();
- b90=(aDif.X()==0) || aDif.Y()==0;
- b45=b90 || (Abs(aDif.X())==Abs(aDif.Y()));
+
+ if(bMov)
+ {
+ if(!IsMoveAllowed())
+ {
+ return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich
}
- sal_Bool bNo=sal_False;
- if (!IsMirrorAllowed(sal_True,sal_True)) bNo=sal_True; // Spiegeln ueberhaupt nicht erlaubt
- if (!IsMirrorAllowed(sal_False,sal_False) && !b45) bNo=sal_True; // freies Spiegeln nicht erlaubt
- if (!IsMirrorAllowed(sal_True,sal_False) && !b90) bNo=sal_True; // Spiegeln hor/ver erlaubt
- if (bNo) return Pointer(POINTER_NOTALLOWED);
- if (b90) {
+ else
+ {
+ return Pointer(POINTER_MOVE);
+ }
+ }
+
+ break;
+ }
+
+ case SDRDRAG_MIRROR:
+ {
+ if(bCorner || bVertex || bMov)
+ {
+ SdrHdl* pH1 = maViewHandleList.GetHdlByKind(HDL_REF1);
+ SdrHdl* pH2 = maViewHandleList.GetHdlByKind(HDL_REF2);
+ bool b90(false);
+ bool b45(false);
+ basegfx::B2DPoint aDif(0.0, 0.0);
+
+ if(pH1 && pH2)
+ {
+ aDif = pH2->getPosition() - pH1->getPosition();
+ b90 = basegfx::fTools::equalZero(aDif.getX()) || basegfx::fTools::equalZero(aDif.getY());
+ b45 = b90 || basegfx::fTools::equal(fabs(aDif.getX()), fabs(aDif.getY()));
+ }
+
+ bool bNo(false);
+
+ if(!IsMirrorAllowed(true, true))
+ {
+ bNo = true; // Spiegeln ueberhaupt nicht erlaubt
+ }
+
+ if(!IsMirrorAllowed(false, false) && !b45)
+ {
+ bNo = true; // freies Spiegeln nicht erlaubt
+ }
+
+ if(!IsMirrorAllowed(true, false) && !b90)
+ {
+ bNo = true; // Spiegeln hor/ver erlaubt
+ }
+
+ if(bNo)
+ {
+ return Pointer(POINTER_NOTALLOWED);
+ }
+
+ if(b90)
+ {
return Pointer(POINTER_MIRROR);
}
+
return Pointer(POINTER_MIRROR);
}
- } break;
+
+ break;
+ }
case SDRDRAG_TRANSPARENCE:
{
if(!IsTransparenceAllowed())
+ {
return Pointer(POINTER_NOTALLOWED);
+ }
return Pointer(POINTER_REFHAND);
}
@@ -1163,15 +1590,25 @@ Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice*
case SDRDRAG_GRADIENT:
{
if(!IsGradientAllowed())
+ {
return Pointer(POINTER_NOTALLOWED);
+ }
return Pointer(POINTER_REFHAND);
}
- case SDRDRAG_CROOK: {
- if (bCorner || bVertex || bMov) {
- if (!IsCrookAllowed(sal_True) && !IsCrookAllowed(sal_False)) return Pointer(POINTER_NOTALLOWED);
- return Pointer(POINTER_CROOK);
+ case SDRDRAG_CROOK:
+ {
+ if(bCorner || bVertex || bMov)
+ {
+ if(!IsCrookAllowed(true) && !IsCrookAllowed(false))
+ {
+ return Pointer(POINTER_NOTALLOWED);
+ }
+ else
+ {
+ return Pointer(POINTER_CROOK);
+ }
}
}
@@ -1180,17 +1617,36 @@ Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice*
return Pointer(POINTER_CROP);
}
- default: {
- if ((bCorner || bVertex) && !IsResizeAllowed(sal_True)) return Pointer(POINTER_NOTALLOWED);
+ default:
+ {
+ if((bCorner || bVertex) && !IsResizeAllowed(true))
+ {
+ return Pointer(POINTER_NOTALLOWED);
+ }
}
}
- if (pHdl!=NULL) return pHdl->GetPointer();
- if (bMov) {
- if (!IsMoveAllowed()) return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich
+
+ if(bHandleFound)
+ {
+ return aHdlPointer;
+ }
+
+ if(bMov)
+ {
+ if(!IsMoveAllowed())
+ {
+ return Pointer(POINTER_ARROW); // weil Doppelklick oder Drag&Drop moeglich
+ }
+
return Pointer(POINTER_MOVE);
}
}
- if (eEditMode==SDREDITMODE_CREATE) return aAktCreatePointer;
+
+ if(SDREDITMODE_CREATE == GetViewEditMode())
+ {
+ return getCreatePointer();
+ }
+
return Pointer(POINTER_ARROW);
}
@@ -1201,25 +1657,25 @@ XubString SdrView::GetStatusText()
aStr.AppendAscii("nix");
- if (pAktCreate!=NULL)
+ if(GetCreateObj())
{
- aStr=pAktCreate->getSpecialDragComment(aDragStat);
+ aStr = GetCreateObj()->getSpecialDragComment(GetDragStat());
if(!aStr.Len())
{
- pAktCreate->TakeObjNameSingul(aName);
+ GetCreateObj()->TakeObjNameSingul(aName);
aStr = ImpGetResStr(STR_ViewCreateObj);
}
}
else if (mpCurrentSdrDragMethod)
{
- if (bInsPolyPoint || IsInsertGluePoint())
+ if(mbInsPolyPoint || IsInsertGluePoint())
{
- aStr=aInsPointUndoStr;
+ aStr = maInsPointUndoStr;
}
else
{
- if (aDragStat.IsMinMoved())
+ if(GetDragStat().IsMinMoved())
{
OSL_TRACE("SdrView::GetStatusText(%lx) %lx\n", this, mpCurrentSdrDragMethod);
mpCurrentSdrDragMethod->TakeSdrDragComment(aStr);
@@ -1228,7 +1684,7 @@ XubString SdrView::GetStatusText()
}
else if(IsMarkObj())
{
- if(AreObjectsMarked())
+ if(areSdrObjectsSelected())
{
aStr = ImpGetResStr(STR_ViewMarkMoreObjs);
}
@@ -1247,9 +1703,10 @@ XubString SdrView::GetStatusText()
{
aStr = ImpGetResStr(STR_ViewMarkPoints);
}
- } else if (IsMarkGluePoints())
+ }
+ else if (IsMarkGluePoints())
{
- if(HasMarkedGluePoints())
+ if(areGluesSelected())
{
aStr = ImpGetResStr(STR_ViewMarkMoreGluePoints);
}
@@ -1258,31 +1715,48 @@ XubString SdrView::GetStatusText()
aStr = ImpGetResStr(STR_ViewMarkGluePoints);
}
}
- else if (IsTextEdit() && pTextEditOutlinerView!=NULL) {
+ else if(IsTextEdit() && GetTextEditOutlinerView())
+ {
aStr=ImpGetResStr(STR_ViewTextEdit); // "TextEdit - Zeile y Spalte x";
- ESelection aSel(pTextEditOutlinerView->GetSelection());
- long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos;
- if (aSel.nEndPara>0) {
- for (sal_uInt16 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
- nLin+=pTextEditOutliner->GetLineCount(nParaNum);
+ ESelection aSel(GetTextEditOutlinerView()->GetSelection());
+ sal_Int32 nPar = aSel.nEndPara, nLin = 0, nCol = aSel.nEndPos;
+
+ if(aSel.nEndPara > 0)
+ {
+ for(sal_uInt16 nParaNum = 0; nParaNum < aSel.nEndPara; nParaNum++)
+ {
+ nLin += GetTextEditOutliner()->GetLineCount(nParaNum);
}
}
+
// Noch 'ne kleine Unschoenheit:
// Am Ende einer Zeile eines mehrzeiligen Absatzes wird die Position
// der naechsten Zeile des selben Absatzes angezeigt, so es eine solche
// gibt.
- sal_uInt16 nParaLine=0;
- sal_uIntPtr nParaLineAnz=pTextEditOutliner->GetLineCount(aSel.nEndPara);
- sal_Bool bBrk=sal_False;
- while (!bBrk) {
- sal_uInt16 nLen=pTextEditOutliner->GetLineLen(aSel.nEndPara,nParaLine);
- sal_Bool bLastLine=(nParaLine==nParaLineAnz-1);
- if (nCol>nLen || (!bLastLine && nCol==nLen)) {
+ sal_uInt16 nParaLine(0);
+ sal_uInt32 nParaLineAnz(GetTextEditOutliner()->GetLineCount(aSel.nEndPara));
+ bool bBrk(false);
+
+ while(!bBrk)
+ {
+ sal_uInt16 nLen(GetTextEditOutliner()->GetLineLen(aSel.nEndPara,nParaLine));
+ bool bLastLine(nParaLine == nParaLineAnz-1);
+
+ if(nCol>nLen || (!bLastLine && nCol == nLen))
+ {
nCol-=nLen;
nLin++;
nParaLine++;
- } else bBrk=sal_True;
- if (nLen==0) bBrk=sal_True; // Sicherheitshalber
+ }
+ else
+ {
+ bBrk = true;
+ }
+
+ if(!nLen)
+ {
+ bBrk = true; // Sicherheitshalber
+ }
}
aStr.SearchAndReplaceAscii("%1", UniString::CreateFromInt32(nPar + 1));
@@ -1291,24 +1765,27 @@ XubString SdrView::GetStatusText()
#ifdef DBG_UTIL
aStr += UniString( RTL_CONSTASCII_USTRINGPARAM( ", Level " ) );
- aStr += UniString::CreateFromInt32( pTextEditOutliner->GetDepth( aSel.nEndPara ) );
+ aStr += UniString::CreateFromInt32( GetTextEditOutliner()->GetDepth( aSel.nEndPara ) );
#endif
}
if(aStr.EqualsAscii("nix"))
{
- if (AreObjectsMarked()) {
- ImpTakeDescriptionStr(STR_ViewMarked,aStr);
- if (IsGluePointEditMode()) {
- if (HasMarkedGluePoints()) {
- ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,IMPSDR_GLUEPOINTSDESCRIPTION);
- }
- } else {
- if (HasMarkedPoints()) {
- ImpTakeDescriptionStr(STR_ViewMarked,aStr,0,IMPSDR_POINTSDESCRIPTION);
- }
+ if(areSdrObjectsSelected())
+ {
+ TakeMarkedDescriptionString(STR_ViewMarked, aStr);
+
+ if(IsGluePointEditMode() && areGluesSelected())
+ {
+ TakeMarkedDescriptionString(STR_ViewMarked,aStr,0,IMPSDR_GLUEPOINTSDESCRIPTION);
+ }
+ else if(HasMarkedPoints())
+ {
+ TakeMarkedDescriptionString(STR_ViewMarked,aStr,0,IMPSDR_POINTSDESCRIPTION);
}
- } else {
+ }
+ else
+ {
aStr.Erase();
}
}
@@ -1324,55 +1801,79 @@ XubString SdrView::GetStatusText()
aTmpStr.ToUpperAscii();
aStr.Replace(0, 1, aTmpStr);
}
+
return aStr;
}
SdrViewContext SdrView::GetContext() const
{
if( IsGluePointEditMode() )
+ {
return SDRCONTEXT_GLUEPOINTEDIT;
-
- const sal_uIntPtr nMarkAnz = GetMarkedObjectCount();
+ }
if( HasMarkablePoints() && !IsFrameHandles() )
{
- sal_Bool bPath=sal_True;
- for( sal_uIntPtr nMarkNum = 0; nMarkNum < nMarkAnz && bPath; nMarkNum++ )
- if (!GetMarkedObjectByIndex(nMarkNum)->ISA(SdrPathObj))
- bPath=sal_False;
+ bool bPath(true);
+
+ if(areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size() && bPath; nMarkNum++)
+ {
+ if(!dynamic_cast< const SdrPathObj* >(aSelection[nMarkNum]))
+ {
+ bPath = false;
+ }
+ }
+ }
if( bPath )
+ {
return SDRCONTEXT_POINTEDIT;
+ }
}
- if( GetMarkedObjectCount() )
+ if(areSdrObjectsSelected())
{
- sal_Bool bGraf = sal_True, bMedia = sal_True, bTable = sal_True;
+ bool bGraf(true);
+ bool bMedia(true);
+ bool bTable(true);
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
- for( sal_uIntPtr nMarkNum = 0; nMarkNum < nMarkAnz && ( bGraf || bMedia ); nMarkNum++ )
+ for(sal_uInt32 nMarkNum(0); nMarkNum < aSelection.size() && ( bGraf || bMedia ); nMarkNum++)
{
- const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum );
- DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" );
-
- if( !pMarkObj )
- continue;
+ const SdrObject* pMarkObj = aSelection[nMarkNum];
- if( !pMarkObj->ISA( SdrGrafObj ) )
- bGraf = sal_False;
+ if(!dynamic_cast< const SdrGrafObj* >(pMarkObj))
+ {
+ bGraf = false;
+ }
- if( !pMarkObj->ISA( SdrMediaObj ) )
- bMedia = sal_False;
+ if(!dynamic_cast< const SdrMediaObj* >(pMarkObj))
+ {
+ bMedia = false;
+ }
- if( !pMarkObj->ISA( ::sdr::table::SdrTableObj ) )
- bTable = sal_False;
+ if(!dynamic_cast< const ::sdr::table::SdrTableObj* >(pMarkObj))
+ {
+ bTable = false;
+ }
}
if( bGraf )
+ {
return SDRCONTEXT_GRAPHIC;
+ }
else if( bMedia )
+ {
return SDRCONTEXT_MEDIA;
+ }
else if( bTable )
+ {
return SDRCONTEXT_TABLE;
+ }
}
return SDRCONTEXT_STANDARD;
@@ -1380,53 +1881,92 @@ SdrViewContext SdrView::GetContext() const
void SdrView::MarkAll()
{
- if (IsTextEdit()) {
+ if(IsTextEdit())
+ {
GetTextEditOutlinerView()->SetSelection(ESelection(0,0,0xFFFF,0xFFFF));
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
- } else if (IsGluePointEditMode()) MarkAllGluePoints();
- else if (HasMarkablePoints()) MarkAllPoints();
- else MarkAllObj();
+ }
+ else if(IsGluePointEditMode())
+ {
+ MarkGluePoints(0, false);
+ }
+ else if(HasMarkablePoints())
+ {
+ MarkPoints(0, false); // markall
+ }
+ else
+ {
+ MarkAllObj();
+ }
}
void SdrView::UnmarkAll()
{
- if (IsTextEdit()) {
- ESelection eSel=GetTextEditOutlinerView()->GetSelection();
+ if(IsTextEdit())
+ {
+ ESelection eSel(GetTextEditOutlinerView()->GetSelection());
+
eSel.nStartPara=eSel.nEndPara;
eSel.nStartPos=eSel.nEndPos;
+
GetTextEditOutlinerView()->SetSelection(eSel);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if(GetItemBrowser())
+ {
+ mpItemBrowser->SetDirty();
+ }
#endif
- } else if (HasMarkedGluePoints()) UnmarkAllGluePoints();
- else if (HasMarkedPoints()) UnmarkAllPoints(); // ! Marked statt Markable !
- else UnmarkAllObj();
+ }
+ else if(areGluesSelected())
+ {
+ MarkGluePoints(0, true);
+ }
+ else if(HasMarkedPoints())
+ {
+ MarkPoints(0, true); // unmarkall
+ }
+ else
+ {
+ UnmarkAllObj();
+ }
}
-sal_Bool SdrView::IsAllMarked() const
+bool SdrView::IsAllMarked() const
{
- if (IsTextEdit()) {
+ if(IsTextEdit())
+ {
return ImpIsTextEditAllSelected();
}
- if (IsGluePointEditMode()) {
- sal_uIntPtr nAnz=GetMarkableGluePointCount();
- return nAnz!=0 && nAnz==GetMarkedGluePointCount();
+
+ if(IsGluePointEditMode())
+ {
+ const sal_uInt32 nAnz(GetMarkableGluePointCount());
+
+ return nAnz && nAnz == GetMarkedGluePointCount();
}
- if (HasMarkedPoints()) {
- sal_uIntPtr nAnz=GetMarkablePointCount();
- return nAnz!=0 && nAnz==GetMarkedPointCount();
+
+ if(HasMarkedPoints())
+ {
+ const sal_uInt32 nAnz(GetMarkablePointCount());
+
+ return nAnz && nAnz == GetMarkedPointCount();
}
- sal_uIntPtr nAnz=GetMarkableObjCount();
- return nAnz!=0 && nAnz == GetMarkedObjectCount();
+
+ const sal_uInt32 nAnz(GetMarkableObjCount());
+
+ return nAnz && nAnz == getSelectedSdrObjectCount();
}
-sal_Bool SdrView::IsMarkPossible() const
+bool SdrView::IsMarkPossible() const
{
if(IsTextEdit())
{
- return SdrTextObj::HasTextImpl( pTextEditOutliner );
+ return SdrTextObj::HasTextImpl(const_cast< SdrView* >(this)->GetTextEditOutliner());
}
if(IsGluePointEditMode())
@@ -1442,73 +1982,71 @@ sal_Bool SdrView::IsMarkPossible() const
return HasMarkableObj();
}
-sal_Bool SdrView::IsAllMarkPrevNextPossible() const
+bool SdrView::IsAllMarkPrevNextPossible() const
{
- if (IsTextEdit()) {
- return sal_False;
+ if(IsTextEdit())
+ {
+ return false;
}
- if (IsGluePointEditMode()) {
+
+ if(IsGluePointEditMode())
+ {
return HasMarkableGluePoints();
}
- if (HasMarkedPoints()) {
+
+ if(HasMarkedPoints())
+ {
return HasMarkablePoints();
}
+
return HasMarkableObj();
}
-sal_Bool SdrView::MarkNext(sal_Bool bPrev)
+bool SdrView::MarkNext(bool bPrev)
{
- if (IsTextEdit()) {
- return sal_False;
+ if(IsTextEdit())
+ {
+ return false;
}
- if (IsGluePointEditMode() && HasMarkedGluePoints()) {
- return MarkNextGluePoint(bPrev);
+
+ if(IsGluePointEditMode() && areGluesSelected())
+ {
+ return false; // MarkNextGluePoint(bPrev);
}
- if (HasMarkedPoints()) {
- return MarkNextPoint(bPrev);
+
+ if(HasMarkedPoints())
+ {
+ return false; // MarkNextPoint(bPrev);
}
+
return MarkNextObj(bPrev);
}
-sal_Bool SdrView::MarkNext(const Point& rPnt, sal_Bool bPrev)
+bool SdrView::MarkNext(const basegfx::B2DPoint& rPnt, bool bPrev)
{
- if (IsTextEdit()) {
- return sal_False;
- }
- if (IsGluePointEditMode() && HasMarkedGluePoints()) {
- //return MarkNextGluePoint(rPnt,bPrev); fehlende Implementation !!!
- }
- if (HasMarkedPoints()) {
- //return MarkNextPoint(rPnt,bPrev); fehlende Implementation !!!
+ if(IsTextEdit())
+ {
+ return false;
}
- return MarkNextObj(rPnt,-2,bPrev);
-}
-const Rectangle& SdrView::GetMarkedRect() const
-{
- if (IsGluePointEditMode() && HasMarkedGluePoints()) {
- return GetMarkedGluePointsRect();
- }
- if (HasMarkedPoints()) {
- return GetMarkedPointsRect();
- }
- return GetMarkedObjRect();
-}
+// if(IsGluePointEditMode() && areGluesSelected())
+// {
+// //return MarkNextGluePoint(rPnt,bPrev); fehlende Implementation !!!
+// }
-void SdrView::SetMarkedRect(const Rectangle& rRect)
-{
- if (IsGluePointEditMode() && HasMarkedGluePoints()) {
- //SetMarkedGluePointsRect(rRect); fehlende Implementation !!!
- } else if (HasMarkedPoints()) {
- //SetMarkedPointsRect(rRect); fehlende Implementation !!!
- } else SetMarkedObjRect(rRect);
+// if(HasMarkedPoints())
+// {
+// //return MarkNextPoint(rPnt,bPrev); fehlende Implementation !!!
+// }
+
+ return MarkNextObj(rPnt, 2.0, bPrev);
}
void SdrView::DeleteMarked()
{
if (IsTextEdit())
{
- SdrObjEditView::KeyInput(KeyEvent(0,KeyCode(KEYFUNC_DELETE)),pTextEditWin);
+ SdrObjEditView::KeyInput(KeyEvent(0, KeyCode(KEYFUNC_DELETE)), GetTextEditWin());
}
else
{
@@ -1516,11 +2054,11 @@ void SdrView::DeleteMarked()
{
// action already performed by current selection controller, do nothing
}
- else if (IsGluePointEditMode() && HasMarkedGluePoints())
+ else if(IsGluePointEditMode() && areGluesSelected())
{
DeleteMarkedGluePoints();
}
- else if (GetContext()==SDRCONTEXT_POINTEDIT && HasMarkedPoints())
+ else if(SDRCONTEXT_POINTEDIT == GetContext() && HasMarkedPoints())
{
DeleteMarkedPoints();
}
@@ -1531,27 +2069,64 @@ void SdrView::DeleteMarked()
}
}
-sal_Bool SdrView::BegMark(const Point& rPnt, sal_Bool bAddMark, sal_Bool bUnmark)
+bool SdrView::BegMark(const basegfx::B2DPoint& rPnt, bool bAddMark, bool bUnmark)
{
- if (bUnmark) bAddMark=sal_True;
- if (IsGluePointEditMode()) {
- if (!bAddMark) UnmarkAllGluePoints();
+ if(bUnmark)
+ {
+ bAddMark = true;
+ }
+
+ if(IsGluePointEditMode())
+ {
+ if(!bAddMark)
+ {
+ MarkGluePoints(0, true);
+ }
+
return BegMarkGluePoints(rPnt,bUnmark);
- } else if (HasMarkablePoints()) {
- if (!bAddMark) UnmarkAllPoints();
+ }
+ else if(HasMarkablePoints())
+ {
+ if(!bAddMark)
+ {
+ MarkPoints(0, true); // unmarkall
+ }
+
return BegMarkPoints(rPnt,bUnmark);
- } else {
- if (!bAddMark) UnmarkAllObj();
+ }
+ else
+ {
+ if(!bAddMark)
+ {
+ UnmarkAllObj();
+ }
+
return BegMarkObj(rPnt,bUnmark);
}
}
-sal_Bool SdrView::IsDeleteMarkedPossible() const
+bool SdrView::IsDeleteMarkedPossible() const
+{
+ if(IsReadOnly())
+ {
+ return false;
+ }
+
+ if(IsTextEdit())
+ {
+ return true;
+ }
+
+ if(IsGluePointEditMode() && areGluesSelected())
{
- if (IsReadOnly()) return sal_False;
- if (IsTextEdit()) return sal_True;
- if (IsGluePointEditMode() && HasMarkedGluePoints()) return sal_True;
- if (HasMarkedPoints()) return sal_True;
+ return true;
+ }
+
+ if(HasMarkedPoints())
+ {
+ return true;
+ }
+
return IsDeleteMarkedObjPossible();
}
@@ -1571,7 +2146,7 @@ void SdrView::onAccessibilityOptionsChanged()
{
}
-void SdrView::SetMasterPagePaintCaching(sal_Bool bOn)
+void SdrView::SetMasterPagePaintCaching(bool bOn)
{
if(mbMasterPagePaintCaching != bOn)
{
@@ -1582,7 +2157,7 @@ void SdrView::SetMasterPagePaintCaching(sal_Bool bOn)
if(pPageView)
{
- for(sal_uInt32 b(0L); b < pPageView->PageWindowCount(); b++)
+ for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
{
SdrPageWindow* pPageWindow = pPageView->GetPageWindow(b);
DBG_ASSERT(pPageWindow, "SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)");
@@ -1597,4 +2172,6 @@ void SdrView::SetMasterPagePaintCaching(sal_Bool bOn)
}
}
}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 219423a8e270..b5a93f06321f 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -30,6 +30,8 @@
#include <svx/xflclit.hxx>
#include <svx/svdxcgv.hxx>
#include <svx/svdoutl.hxx>
+#include <editeng/editdata.hxx>
+#include <svx/svditext.hxx>
#include <svx/svditext.hxx>
#include <svx/svdetc.hxx>
#include <svx/svdundo.hxx>
@@ -52,354 +54,427 @@
#include <clonelist.hxx>
#include <vcl/virdev.hxx>
#include <svl/style.hxx>
+#include "fmobj.hxx"
+#include <svx/svdlegacy.hxx>
#include <fmobj.hxx>
#include <vcl/svgdata.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
-SdrExchangeView::SdrExchangeView(SdrModel* pModel1, OutputDevice* pOut):
- SdrObjEditView(pModel1,pOut)
+SdrExchangeView::SdrExchangeView(SdrModel& rModel1, OutputDevice* pOut)
+: SdrObjEditView(rModel1, pOut)
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-Point SdrExchangeView::GetViewCenter(const OutputDevice* pOut) const
+basegfx::B2DPoint SdrExchangeView::GetViewCenter(const OutputDevice* pOut) const
{
- Point aCenter;
- if (pOut==NULL)
+ basegfx::B2DPoint aCenter;
+
+ if(!pOut)
{
pOut = GetFirstOutputDevice();
}
- if (pOut!=NULL) {
- Point aOfs=pOut->GetMapMode().GetOrigin();
- Size aOutSiz=pOut->GetOutputSize();
- aOutSiz.Width()/=2;
- aOutSiz.Height()/=2;
- aCenter.X()=aOutSiz.Width() -aOfs.X();
- aCenter.Y()=aOutSiz.Height()-aOfs.Y();
+
+ if(pOut)
+ {
+ aCenter = pOut->GetLogicRange().getCenter();
}
+
return aCenter;
}
-Point SdrExchangeView::GetPastePos(SdrObjList* pLst, OutputDevice* pOut)
+basegfx::B2DPoint SdrExchangeView::GetPastePos(SdrObjList* pLst, OutputDevice* pOut) const
{
- Point aP(GetViewCenter(pOut));
- SdrPage* pPg=NULL;
- if (pLst!=NULL) pPg=pLst->GetPage();
- if (pPg!=NULL) {
- Size aSiz(pPg->GetSize());
- aP.X()=aSiz.Width()/2;
- aP.Y()=aSiz.Height()/2;
- }
- return aP;
-}
+ SdrPage* pSdrPage = 0;
-sal_Bool SdrExchangeView::ImpLimitToWorkArea(Point& rPt) const
-{
- sal_Bool bRet(sal_False);
+ if(pLst)
+ {
+ pSdrPage = pLst->getSdrPageFromSdrObjList();
+ }
- if(!aMaxWorkArea.IsEmpty())
+ if(pSdrPage)
{
- if(rPt.X()<aMaxWorkArea.Left())
- {
- rPt.X() = aMaxWorkArea.Left();
- bRet = sal_True;
- }
+ return pSdrPage->GetPageScale() * 0.5;
+ }
- if(rPt.X()>aMaxWorkArea.Right())
- {
- rPt.X() = aMaxWorkArea.Right();
- bRet = sal_True;
- }
+ return GetViewCenter(pOut);
+}
- if(rPt.Y()<aMaxWorkArea.Top())
- {
- rPt.Y() = aMaxWorkArea.Top();
- bRet = sal_True;
- }
+basegfx::B2DPoint SdrExchangeView::ImpLimitToWorkArea(const basegfx::B2DPoint& rPt) const
+{
+ const basegfx::B2DRange& rWorkArea = GetWorkArea();
- if(rPt.Y()>aMaxWorkArea.Bottom())
- {
- rPt.Y() = aMaxWorkArea.Bottom();
- bRet = sal_True;
- }
+ if(rWorkArea.isEmpty())
+ {
+ return rPt;
}
- return bRet;
+
+ return rWorkArea.clamp(rPt);
}
-void SdrExchangeView::ImpGetPasteObjList(Point& /*rPos*/, SdrObjList*& rpLst)
+void SdrExchangeView::ImpGetPasteObjList(SdrObjList*& rpLst)
{
- if (rpLst==NULL)
+ if(!rpLst)
{
SdrPageView* pPV = GetSdrPageView();
- if (pPV!=NULL) {
- rpLst=pPV->GetObjList();
+ if(pPV)
+ {
+ rpLst = pPV->GetCurrentObjectList();
}
}
}
-sal_Bool SdrExchangeView::ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const
+bool SdrExchangeView::ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const
{
- sal_Bool bRet=sal_False;
+ bool bRet(false);
rLayer=0;
- if (pObjList!=NULL) {
- const SdrPage* pPg=pObjList->GetPage();
- if (pPg!=NULL) {
- rLayer=pPg->GetLayerAdmin().GetLayerID(aAktLayer,sal_True);
- if (rLayer==SDRLAYER_NOTFOUND) rLayer=0;
+
+ if(pObjList)
+ {
+ const SdrPage* pPg = pObjList->getSdrPageFromSdrObjList();
+
+ if(pPg)
+ {
+ rLayer = pPg->GetPageLayerAdmin().GetLayerID(GetActiveLayer(), true);
+
+ if(SDRLAYER_NOTFOUND == rLayer)
+ {
+ rLayer = 0;
+ }
+
SdrPageView* pPV = GetSdrPageView();
- if (pPV!=NULL) {
+
+ if(pPV)
+ {
bRet=!pPV->GetLockedLayers().IsSet(rLayer) && pPV->GetVisibleLayers().IsSet(rLayer);
}
}
}
+
return bRet;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
-sal_Bool SdrExchangeView::Paste(const GDIMetaFile& rMtf, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool SdrExchangeView::Paste(const GDIMetaFile& rMtf, const basegfx::B2DPoint& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
{
- Point aPos(rPos);
- ImpGetPasteObjList(aPos,pLst);
- ImpLimitToWorkArea( aPos );
- if (pLst==NULL) return sal_False;
+ ImpGetPasteObjList(pLst);
+
+ if(!pLst)
+ {
+ return false;
+ }
+
SdrLayerID nLayer;
- if (!ImpGetPasteLayer(pLst,nLayer)) return sal_False;
- sal_Bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit();
- if (bUnmark) UnmarkAllObj();
- SdrGrafObj* pObj=new SdrGrafObj(Graphic(rMtf));
+
+ if(!ImpGetPasteLayer(pLst, nLayer))
+ {
+ return false;
+ }
+
+ const bool bUnmark(0 == (nOptions & (SDRINSERT_DONTMARK|SDRINSERT_ADDMARK)) && !IsTextEdit());
+
+ if(bUnmark)
+ {
+ UnmarkAllObj();
+ }
+
+ const basegfx::B2DPoint aPos(ImpLimitToWorkArea(rPos));
+ SdrGrafObj* pObj = new SdrGrafObj(getSdrModelFromSdrView(), Graphic(rMtf));
+
pObj->SetLayer(nLayer);
- ImpPasteObject(pObj,*pLst,aPos,rMtf.GetPrefSize(),rMtf.GetPrefMapMode(),nOptions);
- return sal_True;
+ ImpPasteObject(pObj, *pLst, aPos, basegfx::B2DVector(rMtf.GetPrefSize().getWidth(), rMtf.GetPrefSize().getHeight()), rMtf.GetPrefMapMode(), nOptions);
+
+ return true;
}
-sal_Bool SdrExchangeView::Paste(const Bitmap& rBmp, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool SdrExchangeView::Paste(const Bitmap& rBmp, const basegfx::B2DPoint& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
{
- Point aPos(rPos);
- ImpGetPasteObjList(aPos,pLst);
- ImpLimitToWorkArea( aPos );
- if (pLst==NULL) return sal_False;
+ ImpGetPasteObjList(pLst);
+
+ if(!pLst)
+ {
+ return false;
+ }
+
SdrLayerID nLayer;
- if (!ImpGetPasteLayer(pLst,nLayer)) return sal_False;
- sal_Bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit();
- if (bUnmark) UnmarkAllObj();
- SdrGrafObj* pObj=new SdrGrafObj(Graphic(rBmp));
+
+ if(!ImpGetPasteLayer(pLst, nLayer))
+ {
+ return false;
+ }
+
+ const bool bUnmark(0 == (nOptions & (SDRINSERT_DONTMARK|SDRINSERT_ADDMARK)) && !IsTextEdit());
+
+ if(bUnmark)
+ {
+ UnmarkAllObj();
+ }
+
+ const basegfx::B2DPoint aPos(ImpLimitToWorkArea(rPos));
+ SdrGrafObj* pObj = new SdrGrafObj(getSdrModelFromSdrView(), Graphic(rBmp));
+
pObj->SetLayer(nLayer);
- ImpPasteObject(pObj,*pLst,aPos,rBmp.GetSizePixel(),MapMode(MAP_PIXEL),nOptions);
- return sal_True;
+ ImpPasteObject(pObj, *pLst, aPos, basegfx::B2DVector(rBmp.GetSizePixel().getWidth(), rBmp.GetSizePixel().getHeight()), MapMode(MAP_PIXEL), nOptions);
+
+ return true;
}
-sal_Bool SdrExchangeView::Paste(const XubString& rStr, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool SdrExchangeView::Paste(const XubString& rStr, const basegfx::B2DPoint& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
{
if(!rStr.Len())
- return sal_False;
+ {
+ return false;
+ }
+
+ ImpGetPasteObjList(pLst);
+
+ if(!pLst)
+ {
+ return false;
+ }
- Point aPos(rPos);
- ImpGetPasteObjList(aPos,pLst);
- ImpLimitToWorkArea( aPos );
- if (pLst==NULL) return sal_False;
SdrLayerID nLayer;
- if (!ImpGetPasteLayer(pLst,nLayer)) return sal_False;
- sal_Bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit();
- if (bUnmark) UnmarkAllObj();
- Rectangle aTextRect(0,0,500,500);
- SdrPage* pPage=pLst->GetPage();
- if (pPage!=NULL) {
- aTextRect.SetSize(pPage->GetSize());
- }
- SdrRectObj* pObj=new SdrRectObj(OBJ_TEXT,aTextRect);
- pObj->SetModel(pMod);
+
+ if(!ImpGetPasteLayer(pLst, nLayer))
+ {
+ return false;
+ }
+
+ const bool bUnmark(0 == (nOptions & (SDRINSERT_DONTMARK|SDRINSERT_ADDMARK)) && !IsTextEdit());
+
+ if(bUnmark)
+ {
+ UnmarkAllObj();
+ }
+
+ basegfx::B2DVector aTextScale(500.0, 500.0);
+ SdrPage* pPage = pLst->getSdrPageFromSdrObjList();
+
+ if(pPage)
+ {
+ aTextScale = pPage->GetPageScale();
+ }
+
+ SdrRectObj* pObj = new SdrRectObj(
+ getSdrModelFromSdrView(),
+ basegfx::tools::createScaleB2DHomMatrix(aTextScale),
+ OBJ_TEXT,
+ true);
+
pObj->SetLayer(nLayer);
- pObj->NbcSetText(rStr); // #32424# SetText vor SetAttr, weil SetAttr sonst unwirksam!
- if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet, sal_False);
+ pObj->SetText(rStr); // #32424# SetText vor SetAttr, weil SetAttr sonst unwirksam!
- pObj->SetMergedItemSet(aDefaultAttr);
+ if(GetDefaultStyleSheet())
+ {
+ pObj->SetStyleSheet(GetDefaultStyleSheet(), false);
+ }
+
+ pObj->SetMergedItemSet(GetDefaultAttr());
+
+ SfxItemSet aTempAttr(pObj->GetObjectItemPool()); // Keine Fuellung oder Linie
- SfxItemSet aTempAttr(pMod->GetItemPool()); // Keine Fuellung oder Linie
aTempAttr.Put(XLineStyleItem(XLINE_NONE));
aTempAttr.Put(XFillStyleItem(XFILL_NONE));
-
pObj->SetMergedItemSet(aTempAttr);
pObj->FitFrameToTextSize();
- Size aSiz(pObj->GetLogicRect().GetSize());
- MapUnit eMap=pMod->GetScaleUnit();
- Fraction aMap=pMod->GetScaleFraction();
- ImpPasteObject(pObj,*pLst,aPos,aSiz,MapMode(eMap,Point(0,0),aMap,aMap),nOptions);
- return sal_True;
+
+ const basegfx::B2DVector aObjectSize(basegfx::absolute(pObj->getSdrObjectScale()));
+ const MapUnit eMap(getSdrModelFromSdrView().GetExchangeObjectUnit());
+ const Fraction aMap(getSdrModelFromSdrView().GetExchangeObjectScale());
+ const basegfx::B2DPoint aPos(ImpLimitToWorkArea(rPos));
+
+ ImpPasteObject(pObj, *pLst, aPos, aObjectSize, MapMode(eMap, Point(0,0), aMap, aMap), nOptions);
+
+ return true;
}
-sal_Bool SdrExchangeView::Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool SdrExchangeView::Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, const basegfx::B2DPoint& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
{
- Point aPos(rPos);
- ImpGetPasteObjList(aPos,pLst);
- ImpLimitToWorkArea( aPos );
- if (pLst==NULL) return sal_False;
+ ImpGetPasteObjList(pLst);
+
+ if(!pLst)
+ {
+ return false;
+ }
+
SdrLayerID nLayer;
- if (!ImpGetPasteLayer(pLst,nLayer)) return sal_False;
- sal_Bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit();
- if (bUnmark) UnmarkAllObj();
- Rectangle aTextRect(0,0,500,500);
- SdrPage* pPage=pLst->GetPage();
- if (pPage!=NULL) {
- aTextRect.SetSize(pPage->GetSize());
- }
- SdrRectObj* pObj=new SdrRectObj(OBJ_TEXT,aTextRect);
- pObj->SetModel(pMod);
+
+ if(!ImpGetPasteLayer(pLst, nLayer))
+ {
+ return false;
+ }
+
+ const bool bUnmark(0 == (nOptions & (SDRINSERT_DONTMARK|SDRINSERT_ADDMARK)) && !IsTextEdit());
+
+ if(bUnmark)
+ {
+ UnmarkAllObj();
+ }
+
+ basegfx::B2DVector aTextScale(500.0, 500.0);
+ SdrPage* pPage = pLst->getSdrPageFromSdrObjList();
+
+ if(pPage)
+ {
+ aTextScale = pPage->GetPageScale();
+ }
+
+ SdrRectObj* pObj = new SdrRectObj(
+ getSdrModelFromSdrView(),
+ basegfx::tools::createScaleB2DHomMatrix(aTextScale),
+ OBJ_TEXT,
+ true);
+
pObj->SetLayer(nLayer);
- if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet, sal_False);
- pObj->SetMergedItemSet(aDefaultAttr);
+ if(GetDefaultStyleSheet())
+ {
+ pObj->SetStyleSheet(GetDefaultStyleSheet(), false);
+ }
+
+ pObj->SetMergedItemSet(GetDefaultAttr());
+
+ SfxItemSet aTempAttr(pObj->GetObjectItemPool()); // Keine Fuellung oder Linie
- SfxItemSet aTempAttr(pMod->GetItemPool()); // Keine Fuellung oder Linie
aTempAttr.Put(XLineStyleItem(XLINE_NONE));
aTempAttr.Put(XFillStyleItem(XFILL_NONE));
-
pObj->SetMergedItemSet(aTempAttr);
- pObj->NbcSetText(rInput,rBaseURL,eFormat);
+ pObj->SetText(rInput, rBaseURL, eFormat);
pObj->FitFrameToTextSize();
- Size aSiz(pObj->GetLogicRect().GetSize());
- MapUnit eMap=pMod->GetScaleUnit();
- Fraction aMap=pMod->GetScaleFraction();
- ImpPasteObject(pObj,*pLst,aPos,aSiz,MapMode(eMap,Point(0,0),aMap,aMap),nOptions);
- // b4967543
- if(pObj && pObj->GetModel() && pObj->GetOutlinerParaObject())
- {
- SdrOutliner& rOutliner = pObj->GetModel()->GetHitTestOutliner();
- rOutliner.SetText(*pObj->GetOutlinerParaObject());
+ const basegfx::B2DVector aObjectSize(basegfx::absolute(pObj->getSdrObjectScale()));
+ const MapUnit eMap(getSdrModelFromSdrView().GetExchangeObjectUnit());
+ const Fraction aMap(getSdrModelFromSdrView().GetExchangeObjectScale());
+ const basegfx::B2DPoint aPos(ImpLimitToWorkArea(rPos));
- if(1L == rOutliner.GetParagraphCount())
- {
- SfxStyleSheet* pCandidate = rOutliner.GetStyleSheet(0L);
+ ImpPasteObject(pObj, *pLst, aPos, aObjectSize, MapMode(eMap, Point(0, 0), aMap, aMap), nOptions);
- if(pCandidate)
- {
- if(pObj->GetModel()->GetStyleSheetPool() == &pCandidate->GetPool())
- {
- pObj->NbcSetStyleSheet(pCandidate, sal_True);
- }
- }
- }
+ // TTTT: Shold already be done in ImpPasteObject/onModelChange ?!?
+ if(pObj && GetDefaultStyleSheet())
+ {
+ pObj->SetStyleSheet(GetDefaultStyleSheet(), true);
}
- return sal_True;
+ return true;
}
-sal_Bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool SdrExchangeView::Paste(const SdrModel& rMod, const basegfx::B2DPoint& rPos, SdrObjList* pDstLst, sal_uInt32 nOptions)
{
const SdrModel* pSrcMod=&rMod;
- if (pSrcMod==pMod)
- return sal_False; // na so geht's ja nun nicht
- const bool bUndo = IsUndoEnabled();
+ if(pSrcMod == &getSdrModelFromSdrView())
+ {
+ return false; // na so geht's ja nun nicht
+ }
+
+ const bool bUndo(IsUndoEnabled());
if( bUndo )
+ {
BegUndo(ImpGetResStr(STR_ExchangePaste));
+ }
if( mxSelectionController.is() && mxSelectionController->PasteObjModel( rMod ) )
{
if( bUndo )
+ {
EndUndo();
- return sal_True;
+ }
+
+ return true;
}
- Point aPos(rPos);
- ImpGetPasteObjList(aPos,pLst);
- SdrPageView* pMarkPV=NULL;
- SdrPageView* pPV = GetSdrPageView();
+ ImpGetPasteObjList(pDstLst);
- if(pPV)
+ if(!pDstLst)
{
- if ( pPV->GetObjList() == pLst )
- pMarkPV=pPV;
+ return false;
}
- ImpLimitToWorkArea( aPos );
- if (pLst==NULL)
- return sal_False;
+ const bool bUnmark(0 == (nOptions & (SDRINSERT_DONTMARK|SDRINSERT_ADDMARK)) && !IsTextEdit());
- sal_Bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit();
if (bUnmark)
+ {
UnmarkAllObj();
+ }
+
+ const basegfx::B2DPoint aPos(ImpLimitToWorkArea(rPos));
// evtl. umskalieren bei unterschiedlicher MapUnit am Model
// Dafuer erstmal die Faktoren berechnen
- MapUnit eSrcUnit=pSrcMod->GetScaleUnit();
- MapUnit eDstUnit=pMod->GetScaleUnit();
- sal_Bool bResize=eSrcUnit!=eDstUnit;
- Fraction xResize,yResize;
- Point aPt0;
+ const MapUnit eSrcUnit(pSrcMod->GetExchangeObjectUnit());
+ const MapUnit eDstUnit(getSdrModelFromSdrView().GetExchangeObjectUnit());
+ const bool bResize(eSrcUnit != eDstUnit);
+ basegfx::B2DVector aResize(1.0, 1.0);
+
if (bResize)
{
- FrPair aResize(GetMapFactor(eSrcUnit,eDstUnit));
- xResize=aResize.X();
- yResize=aResize.Y();
+ const FrPair aResizeFract(GetMapFactor(eSrcUnit, eDstUnit));
+
+ aResize = basegfx::B2DVector(aResizeFract.X(), aResizeFract.Y());
}
- SdrObjList* pDstLst=pLst;
- sal_uInt16 nPg,nPgAnz=pSrcMod->GetPageCount();
- for (nPg=0; nPg<nPgAnz; nPg++)
+
+ const sal_uInt16 nPgAnz(pSrcMod->GetPageCount());
+ sal_uInt16 nPg(0);
+
+ for(; nPg < nPgAnz; nPg++)
{
const SdrPage* pSrcPg=pSrcMod->GetPage(nPg);
-
- // #104148# Use SnapRect, not BoundRect here
- Rectangle aR=pSrcPg->GetAllObjSnapRect();
+ basegfx::B2DPoint aRangeCenter(sdr::legacy::GetAllObjSnapRange(pSrcPg->getSdrObjectVector()).getCenter());
if (bResize)
- ResizeRect(aR,aPt0,xResize,yResize);
- Point aDist(aPos-aR.Center());
- Size aSiz(aDist.X(),aDist.Y());
- //sal_uIntPtr nDstObjAnz0=pDstLst->GetObjCount();
- sal_uIntPtr nCloneErrCnt=0;
- sal_uIntPtr nOb,nObAnz=pSrcPg->GetObjCount();
- sal_Bool bMark=pMarkPV!=NULL && !IsTextEdit() && (nOptions&SDRINSERT_DONTMARK)==0;
+ {
+ aRangeCenter *= aResize;
+ }
- // #i13033#
- // New mechanism to re-create the connections of cloned connectors
+ const basegfx::B2DPoint aOffset(aPos - aRangeCenter);
+ sal_uInt32 nCloneErrCnt(0);
+ sal_uInt32 nOb(0);
+ const sal_uInt32 nObAnz(pSrcPg->GetObjCount());
+ const bool bMark(!IsTextEdit() && 0 == (nOptions & SDRINSERT_DONTMARK));
+
+ // #i13033# New mechanism to re-create the connections of cloned connectors
CloneList aCloneList;
- for (nOb=0; nOb<nObAnz; nOb++)
+ for(; nOb < nObAnz; nOb++)
{
const SdrObject* pSrcOb=pSrcPg->GetObj(nOb);
+ SdrObject* pNeuObj = pSrcOb->CloneSdrObject(&pDstLst->getSdrModelFromSdrObjList());
- // #116235#
- SdrObject* pNeuObj = pSrcOb->Clone();
-
- if (pNeuObj!=NULL)
+ if(pNeuObj)
{
if(bResize)
{
- pNeuObj->GetModel()->SetPasteResize(sal_True); // #51139#
- pNeuObj->NbcResize(aPt0,xResize,yResize);
- pNeuObj->GetModel()->SetPasteResize(sal_False); // #51139#
+ pNeuObj->SetPasteResize(true); // #51139#
+ sdr::legacy::transformSdrObject(*pNeuObj, basegfx::tools::createScaleB2DHomMatrix(aResize));
+ pNeuObj->SetPasteResize(false); // #51139#
}
// #i39861#
- pNeuObj->SetModel(pDstLst->GetModel());
- pNeuObj->SetPage(pDstLst->GetPage());
-
- pNeuObj->NbcMove(aSiz);
+ sdr::legacy::transformSdrObject(*pNeuObj, basegfx::tools::createTranslateB2DHomMatrix(aOffset));
- const SdrPage* pPg = pDstLst->GetPage();
+ const SdrPage* pPg = pDstLst->getSdrPageFromSdrObjList();
if(pPg)
{
// #i72535#
- const SdrLayerAdmin& rAd = pPg->GetLayerAdmin();
+ const SdrLayerAdmin& rAd = pPg->GetPageLayerAdmin();
SdrLayerID nLayer(0);
- if(pNeuObj->ISA(FmFormObj))
+ if(dynamic_cast< FmFormObj* >(pNeuObj))
{
// for FormControls, force to form layer
nLayer = rAd.GetLayerID(rAd.GetControlLayerName(), true);
}
else
{
- nLayer = rAd.GetLayerID(aAktLayer, sal_True);
+ nLayer = rAd.GetLayerID(GetActiveLayer(), true);
}
if(SDRLAYER_NOTFOUND == nLayer)
@@ -410,16 +485,18 @@ sal_Bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjL
pNeuObj->SetLayer(nLayer);
}
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- pDstLst->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason);
+ pDstLst->InsertObjectToSdrObjList(*pNeuObj);
if( bUndo )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNeuObj));
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pNeuObj));
+ }
- if (bMark) {
+ if (bMark)
+ {
// Markhandles noch nicht sofort setzen!
- // Das erledigt das ModelHasChanged der MarkView.
- MarkObj(pNeuObj,pMarkPV,sal_False,sal_True);
+ // Das erledigt das LazyReactOnObjectChanges der MarkView.
+ MarkObj(*pNeuObj, false );
}
// #i13033#
@@ -459,12 +536,14 @@ sal_Bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjL
}
if( bUndo )
+ {
EndUndo();
+ }
- return sal_True;
+ return true;
}
-sal_Bool SdrExchangeView::IsExchangeFormatSupported(sal_uIntPtr nFormat) const
+bool SdrExchangeView::IsExchangeFormatSupported(sal_uInt32 nFormat) const
{
return( FORMAT_PRIVATE == nFormat ||
FORMAT_GDIMETAFILE == nFormat ||
@@ -475,50 +554,35 @@ sal_Bool SdrExchangeView::IsExchangeFormatSupported(sal_uIntPtr nFormat) const
SOT_FORMATSTR_ID_EDITENGINE == nFormat );
}
-void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, sal_uInt32 nOptions)
+void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const basegfx::B2DPoint& rCenter, const basegfx::B2DVector& rScale, const MapMode& rMap, sal_uInt32 nOptions)
{
- BigInt nSizX(rSiz.Width());
- BigInt nSizY(rSiz.Height());
- MapUnit eSrcMU=rMap.GetMapUnit();
- MapUnit eDstMU=pMod->GetScaleUnit();
- FrPair aMapFact(GetMapFactor(eSrcMU,eDstMU));
- Fraction aDstFr(pMod->GetScaleFraction());
- nSizX*=aMapFact.X().GetNumerator();
- nSizX*=rMap.GetScaleX().GetNumerator();
- nSizX*=aDstFr.GetDenominator();
- nSizX/=aMapFact.X().GetDenominator();
- nSizX/=rMap.GetScaleX().GetDenominator();
- nSizX/=aDstFr.GetNumerator();
- nSizY*=aMapFact.Y().GetNumerator();
- nSizY*=rMap.GetScaleY().GetNumerator();
- nSizX*=aDstFr.GetDenominator();
- nSizY/=aMapFact.Y().GetDenominator();
- nSizY/=rMap.GetScaleY().GetDenominator();
- nSizY/=aDstFr.GetNumerator();
- long xs=nSizX;
- long ys=nSizY;
- Point aPos(rCenter.X()-xs/2,rCenter.Y()-ys/2);
- Rectangle aR(aPos.X(),aPos.Y(),aPos.X()+xs,aPos.Y()+ys);
- pObj->SetLogicRect(aR);
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- rLst.InsertObject(pObj,CONTAINER_APPEND,&aReason);
-
- if( IsUndoEnabled() )
- AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
-
- SdrPageView* pMarkPV=NULL;
- SdrPageView* pPV = GetSdrPageView();
-
- if(pPV)
- {
- if (pPV->GetObjList()==&rLst)
- pMarkPV=pPV;
- }
-
- sal_Bool bMark=pMarkPV!=NULL && !IsTextEdit() && (nOptions&SDRINSERT_DONTMARK)==0;
+ const MapUnit eSrcMU(rMap.GetMapUnit());
+ const MapUnit eDstMU(getSdrModelFromSdrView().GetExchangeObjectUnit());
+ const FrPair aMapFact(GetMapFactor(eSrcMU, eDstMU));
+ const Fraction aDstFr(getSdrModelFromSdrView().GetExchangeObjectScale());
+
+ basegfx::B2DVector aScale(rScale);
+ aScale *= basegfx::B2DVector(aMapFact.X(), aMapFact.Y());
+ aScale *= basegfx::B2DVector(rMap.GetScaleX(), rMap.GetScaleY());
+ aScale *= aDstFr;
+
+ pObj->setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aScale,
+ rCenter - (aScale * 0.5)));
+
+ rLst.InsertObjectToSdrObjList(*pObj);
+
+ if(IsUndoEnabled())
+ {
+ AddUndo(getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoNewObject(*pObj));
+ }
+
+ const bool bMark(!IsTextEdit() && 0 == (nOptions & SDRINSERT_DONTMARK));
+
if (bMark)
- { // Obj in der ersten gefundenen PageView markieren
- MarkObj(pObj,pMarkPV);
+ {
+ MarkObj(*pObj);
}
}
@@ -526,41 +590,33 @@ BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked) const
{
BitmapEx aBmp;
- if( AreObjectsMarked() )
+ if(areSdrObjectsSelected())
{
- if(1 == GetMarkedObjectCount())
+ if( bNoVDevIfOneBmpMarked )
{
- if(bNoVDevIfOneBmpMarked)
- {
- SdrObject* pGrafObjTmp = GetMarkedObjectByIndex( 0 );
- SdrGrafObj* pGrafObj = ( GetMarkedObjectCount() == 1 ) ? PTR_CAST( SdrGrafObj, pGrafObjTmp ) : NULL;
+ SdrGrafObj* pSdrGrafObj(dynamic_cast< SdrGrafObj* >(getSelectedIfSingle()));
- if( pGrafObj && ( pGrafObj->GetGraphicType() == GRAPHIC_BITMAP ) )
- {
- aBmp = pGrafObj->GetTransformedGraphic().GetBitmapEx();
- }
- }
- else
+ if(pSdrGrafObj && (GRAPHIC_BITMAP == pSdrGrafObj->GetGraphicType()))
{
- const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(GetMarkedObjectByIndex(0));
-
- if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg())
+ if(pSdrGrafObj->isEmbeddedSvg())
{
aBmp = pSdrGrafObj->GetGraphic().getSvgData()->getReplacement();
}
+ else
+ {
+ aBmp = pSdrGrafObj->GetTransformedGraphic().GetBitmap();
+ }
}
}
if( !aBmp )
{
const GDIMetaFile aGDIMetaFile(GetMarkedObjMetaFile(bNoVDevIfOneBmpMarked));
- const Rectangle aBound(GetMarkedObjBoundRect());
+ const basegfx::B2DRange aAllObjRange(sdr::legacy::GetAllObjBoundRange(getSelectedSdrObjectVectorFromSdrMarkView()));
aBmp = convertMetafileToBitmapEx(
aGDIMetaFile,
- basegfx::B2DRange(
- aBound.Left(), aBound.Top(),
- aBound.Right(), aBound.Bottom()));
+ aAllObjRange);
}
}
@@ -573,20 +629,19 @@ GDIMetaFile SdrExchangeView::GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked) co
{
GDIMetaFile aMtf;
- if( AreObjectsMarked() )
+ if(areSdrObjectsSelected())
{
- Rectangle aBound( GetMarkedObjBoundRect() );
- Size aBoundSize( aBound.GetWidth(), aBound.GetHeight() );
- MapMode aMap( pMod->GetScaleUnit(), Point(), pMod->GetScaleFraction(), pMod->GetScaleFraction() );
+ const Rectangle aBound(sdr::legacy::GetAllObjBoundRect(getSelectedSdrObjectVectorFromSdrMarkView()));
+ const Size aBoundSize(aBound.GetWidth(), aBound.GetHeight());
+ const MapMode aMap(getSdrModelFromSdrView().GetExchangeObjectUnit(), Point(), getSdrModelFromSdrView().GetExchangeObjectScale(), getSdrModelFromSdrView().GetExchangeObjectScale());
if( bNoVDevIfOneMtfMarked )
{
- SdrObject* pGrafObjTmp = GetMarkedObjectByIndex( 0 );
- SdrGrafObj* pGrafObj = ( GetMarkedObjectCount() ==1 ) ? PTR_CAST( SdrGrafObj, pGrafObjTmp ) : NULL;
+ SdrGrafObj* pSdrGrafObj(dynamic_cast< SdrGrafObj* >(getSelectedIfSingle()));
- if( pGrafObj )
+ if( pSdrGrafObj )
{
- Graphic aGraphic( pGrafObj->GetTransformedGraphic() );
+ Graphic aGraphic( pSdrGrafObj->GetTransformedGraphic() );
// #119735# just use GetGDIMetaFile, it will create a bufferd version of contained bitmap now automatically
aMtf = aGraphic.GetGDIMetaFile();
@@ -598,9 +653,9 @@ GDIMetaFile SdrExchangeView::GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked) co
VirtualDevice aOut;
const Size aDummySize(2, 2);
- aOut.SetOutputSizePixel(aDummySize);
+ aOut.SetOutputSizePixel( aDummySize );
aOut.EnableOutput(false);
- aOut.SetMapMode(aMap);
+ aOut.SetMapMode( aMap );
aMtf.Clear();
aMtf.Record(&aOut);
@@ -635,12 +690,18 @@ Graphic SdrExchangeView::GetAllMarkedGraphic() const
{
Graphic aRet;
- if( AreObjectsMarked() )
+ if(areSdrObjectsSelected())
{
- if( ( 1 == GetMarkedObjectCount() ) && GetSdrMarkByIndex( 0 ) )
- aRet = SdrExchangeView::GetObjGraphic( pMod, GetMarkedObjectByIndex( 0 ) );
+ const SdrObject* pSingleSelected = getSelectedIfSingle();
+
+ if(pSingleSelected)
+ {
+ aRet = GetObjGraphic(*pSingleSelected);
+ }
else
+ {
aRet = GetMarkedObjMetaFile(false);
+ }
}
return aRet;
@@ -648,104 +709,109 @@ Graphic SdrExchangeView::GetAllMarkedGraphic() const
// -----------------------------------------------------------------------------
-Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject* pObj )
+Graphic GetObjGraphic(const SdrObject& rObj)
{
Graphic aRet;
- if( pModel && pObj )
- {
- // try to get a graphic from the object first
- const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pObj);
- const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObj);
+ // try to get a graphic from the object first
+ const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(&rObj);
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&rObj);
- if(pSdrGrafObj)
+ if(pSdrGrafObj)
+ {
+ if(pSdrGrafObj->isEmbeddedSvg())
{
- if(pSdrGrafObj->isEmbeddedSvg())
- {
- // get Metafile for Svg content
- aRet = pSdrGrafObj->getMetafileFromEmbeddedSvg();
- }
- else
- {
- // #110981# Make behaviour coherent with metafile
- // recording below (which of course also takes
- // view-transformed objects)
- aRet = pSdrGrafObj->GetTransformedGraphic();
- }
+ // get Metafile for Svg content
+ aRet = pSdrGrafObj->getMetafileFromEmbeddedSvg();
}
- else if(pSdrOle2Obj)
+ else
{
- if ( pSdrOle2Obj->GetGraphic() )
- aRet = *pSdrOle2Obj->GetGraphic();
+ // #110981# Make behaviour coherent with metafile
+ // recording below (which of course also takes
+ // view-transformed objects)
+ aRet = pSdrGrafObj->GetTransformedGraphic();
}
+ }
+ else if(pSdrOle2Obj)
+ {
+ if ( pSdrOle2Obj->GetGraphic() )
+ {
+ aRet = *pSdrOle2Obj->GetGraphic();
+ }
+ }
// if graphic could not be retrieved => go the hard way and create a MetaFile
- if( ( GRAPHIC_NONE == aRet.GetType() ) || ( GRAPHIC_DEFAULT == aRet.GetType() ) )
+ if(GRAPHIC_NONE == aRet.GetType() || GRAPHIC_DEFAULT == aRet.GetType())
+ {
+ const SdrModel& rSdrModel = rObj.getSdrModelFromSdrObject();
+ const MapMode aMap(
+ rSdrModel.GetExchangeObjectUnit(),
+ Point(),
+ rSdrModel.GetExchangeObjectScale(),
+ rSdrModel.GetExchangeObjectScale());
+ VirtualDevice aOut;
+ GDIMetaFile aMtf;
+
+ aOut.EnableOutput(false);
+ aOut.SetMapMode(aMap);
+ aMtf.Record(&aOut);
+ rObj.SingleObjectPainter(aOut);
+ aMtf.Stop();
+ aMtf.WindStart();
+
+ if(aMtf.GetActionCount())
{
- VirtualDevice aOut;
- GDIMetaFile aMtf;
- const Rectangle aBoundRect( pObj->GetCurrentBoundRect() );
- const MapMode aMap( pModel->GetScaleUnit(),
- Point(),
- pModel->GetScaleFraction(),
- pModel->GetScaleFraction() );
-
- aOut.EnableOutput( sal_False );
- aOut.SetMapMode( aMap );
- aMtf.Record( &aOut );
- pObj->SingleObjectPainter( aOut ); // #110094#-17
- aMtf.Stop();
- aMtf.WindStart();
-
// #i99268# replace the original offset from using XOutDev's SetOffset
// NOT (as tried with #i92760#) with another MapMode which gets recorded
// by the Metafile itself (what always leads to problems), but by
- // moving the result directly
- aMtf.Move(-aBoundRect.Left(), -aBoundRect.Top());
-
- aMtf.SetPrefMapMode( aMap );
- aMtf.SetPrefSize( aBoundRect.GetSize() );
+ // translating the result the hard way
+ const basegfx::B2DRange aBoundRange(rObj.getObjectRange(0));
+ aMtf.Move(-basegfx::fround(aBoundRange.getMinX()), -basegfx::fround(aBoundRange.getMinY()));
- if( aMtf.GetActionCount() )
- aRet = aMtf;
+ aMtf.SetPrefMapMode(aMap);
+ aMtf.SetPrefSize(Size(basegfx::fround(aBoundRange.getWidth()), basegfx::fround(aBoundRange.getHeight())));
+ aRet = aMtf;
}
- }
+ }
- return aRet;
+ return aRet;
}
// -----------------------------------------------------------------------------
void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const
{
- SortMarkedObjects();
-
- ::std::vector< ::std::vector< SdrMark* > > aObjVectors( 2 );
- ::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ];
- ::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ];
- const SdrLayerAdmin& rLayerAdmin = pMod->GetLayerAdmin();
- const sal_uInt32 nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), sal_False );
- sal_uInt32 n, nCount;
-
- for( n = 0, nCount = GetMarkedObjectCount(); n < nCount; n++ )
+ if(areSdrObjectsSelected())
{
- SdrMark* pMark = GetSdrMarkByIndex( n );
-
- // paint objects on control layer on top of all otherobjects
- if( nControlLayerId == pMark->GetMarkedSdrObj()->GetLayer() )
- rObjVector2.push_back( pMark );
- else
- rObjVector1.push_back( pMark );
- }
-
- for( n = 0, nCount = aObjVectors.size(); n < nCount; n++ )
- {
- ::std::vector< SdrMark* >& rObjVector = aObjVectors[ n ];
+ ::std::vector< SdrObjectVector > aObjVectors(2);
+ SdrObjectVector& rObjVector1 = aObjVectors[ 0 ];
+ SdrObjectVector& rObjVector2 = aObjVectors[ 1 ];
+ const SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrView().GetModelLayerAdmin();
+ const sal_uInt32 nControlLayerId(rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), false));
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt32 n, nCount;
+
+ for(n = 0, nCount = aSelection.size(); n < nCount; n++)
+ {
+ // paint objects on control layer on top of all otherobjects
+ if(nControlLayerId == aSelection[n]->GetLayer())
+ {
+ rObjVector2.push_back( aSelection[n] );
+ }
+ else
+ {
+ rObjVector1.push_back( aSelection[n] );
+ }
+ }
- for( sal_uInt32 i = 0; i < rObjVector.size(); i++ )
+ for( n = 0, nCount = aObjVectors.size(); n < nCount; n++ )
{
- SdrMark* pMark = rObjVector[ i ];
- pMark->GetMarkedSdrObj()->SingleObjectPainter( rOut ); // #110094#-17
+ SdrObjectVector& rObjVector = aObjVectors[ n ];
+
+ for( sal_uInt32 i = 0; i < rObjVector.size(); i++ )
+ {
+ rObjVector[ i ]->SingleObjectPainter(rOut);
+ }
}
}
}
@@ -756,29 +822,31 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
{
// Wenn das sortieren der MarkList mal stoeren sollte,
// werde ich sie mir wohl kopieren muessen.
- SortMarkedObjects();
- SdrModel* pNeuMod=pMod->AllocModel();
- SdrPage* pNeuPag=pNeuMod->AllocPage(sal_False);
+ SdrModel* pNeuMod = getSdrModelFromSdrView().AllocModel();
+ SdrPage* pNeuPag = pNeuMod->AllocPage(false);
pNeuMod->InsertPage(pNeuPag);
if( !mxSelectionController.is() || !mxSelectionController->GetMarkedObjModel( pNeuPag ) )
{
- ::std::vector< ::std::vector< SdrMark* > > aObjVectors( 2 );
- ::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ];
- ::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ];
- const SdrLayerAdmin& rLayerAdmin = pMod->GetLayerAdmin();
- const sal_uInt32 nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), sal_False );
+ ::std::vector< SdrObjectVector > aObjVectors(2);
+ SdrObjectVector& rObjVector1 = aObjVectors[ 0 ];
+ SdrObjectVector& rObjVector2 = aObjVectors[ 1 ];
+ const SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrView().GetModelLayerAdmin();
+ const sal_uInt32 nControlLayerId(rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), false));
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
sal_uInt32 n, nCount, nCloneErrCnt = 0;
- for( n = 0, nCount = GetMarkedObjectCount(); n < nCount; n++ )
+ for(n = 0, nCount = aSelection.size(); n < nCount; n++)
{
- SdrMark* pMark = GetSdrMarkByIndex( n );
-
// paint objects on control layer on top of all otherobjects
- if( nControlLayerId == pMark->GetMarkedSdrObj()->GetLayer() )
- rObjVector2.push_back( pMark );
+ if(nControlLayerId == aSelection[n]->GetLayer())
+ {
+ rObjVector2.push_back( aSelection[n] );
+ }
else
- rObjVector1.push_back( pMark );
+ {
+ rObjVector1.push_back( aSelection[n] );
+ }
}
// #i13033#
@@ -787,41 +855,39 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
for( n = 0, nCount = aObjVectors.size(); n < nCount; n++ )
{
- ::std::vector< SdrMark* >& rObjVector = aObjVectors[ n ];
+ SdrObjectVector& rObjVector = aObjVectors[ n ];
for( sal_uInt32 i = 0; i < rObjVector.size(); i++ )
{
- const SdrMark* pMark = rObjVector[ i ];
- const SdrObject* pObj = pMark->GetMarkedSdrObj();
+ const SdrObject* pObj = rObjVector[ i ];
SdrObject* pNeuObj;
- if( pObj->ISA( SdrPageObj ) )
+ if(dynamic_cast< const SdrPageObj* >(pObj))
{
// convert SdrPageObj's to a graphic representation, because
// virtual connection to referenced page gets lost in new model
- pNeuObj = new SdrGrafObj( GetObjGraphic( pMod, pObj ), pObj->GetLogicRect() );
- pNeuObj->SetPage( pNeuPag );
- pNeuObj->SetModel( pNeuMod );
+ pNeuObj = new SdrGrafObj(
+ *pNeuMod,
+ GetObjGraphic(*pObj),
+ pObj->getSdrObjectTransformation());
}
else
{
// #116235#
- // pNeuObj = pObj->Clone( pNeuPag, pNeuMod );
- pNeuObj = pObj->Clone();
- pNeuObj->SetPage( pNeuPag );
- pNeuObj->SetModel( pNeuMod );
+ pNeuObj = pObj->CloneSdrObject(pNeuMod);
}
if( pNeuObj )
{
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- pNeuPag->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason);
+ pNeuPag->InsertObjectToSdrObjList(*pNeuObj);
// #i13033#
aCloneList.AddPair(pObj, pNeuObj);
}
else
+ {
nCloneErrCnt++;
+ }
}
}
@@ -829,7 +895,7 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
// New mechanism to re-create the connections of cloned connectors
aCloneList.CopyConnections();
- if(0L != nCloneErrCnt)
+ if(nCloneErrCnt)
{
#ifdef DBG_UTIL
ByteString aStr("SdrExchangeView::GetMarkedObjModel(): Fehler beim Clonen ");
@@ -851,45 +917,47 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
#endif
}
}
+
return pNeuMod;
}
// -----------------------------------------------------------------------------
-sal_Bool SdrExchangeView::Cut( sal_uIntPtr /*nFormat */)
+bool SdrExchangeView::Cut( sal_uInt32 /*nFormat */)
{
DBG_ERROR( "SdrExchangeView::Cut: Not supported anymore" );
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
-void SdrExchangeView::CutMarked( sal_uIntPtr /*nFormat */)
+void SdrExchangeView::CutMarked( sal_uInt32 /*nFormat */)
{
DBG_ERROR( "SdrExchangeView::CutMarked: Not supported anymore" );
}
// -----------------------------------------------------------------------------
-sal_Bool SdrExchangeView::Yank(sal_uIntPtr /*nFormat*/)
+bool SdrExchangeView::Yank(sal_uInt32 /*nFormat*/)
{
DBG_ERROR( "SdrExchangeView::Yank: Not supported anymore" );
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
-void SdrExchangeView::YankMarked(sal_uIntPtr /*nFormat*/)
+void SdrExchangeView::YankMarked(sal_uInt32 /*nFormat*/)
{
DBG_ERROR( "YankMarked: Not supported anymore" );
}
// -----------------------------------------------------------------------------
-sal_Bool SdrExchangeView::Paste(Window* /*pWin*/, sal_uIntPtr /*nFormat*/)
+bool SdrExchangeView::Paste(Window* /*pWin*/, sal_uInt32 /*nFormat*/)
{
DBG_ERROR( "SdrExchangeView::Paste: Not supported anymore" );
- return sal_False;
+ return false;
}
+////////////////////////////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx
index 6fbb084e03c6..d32468308f53 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -88,7 +88,7 @@ void AccessibleCell::Init (void)
if( pOutlinerParaObject )
{
// non-empty text -> use full-fledged edit source right away
- ::std::auto_ptr<SvxEditSource> pEditSource( new SvxTextEditSource( mxCell->GetObject(), mxCell.get(), *pView, *pWindow) );
+ ::std::auto_ptr<SvxEditSource> pEditSource( new SvxTextEditSource( mxCell->getSdrTextObj(), mxCell.get(), *pView, *pWindow) );
mpText = new AccessibleTextHelper( pEditSource );
mpText->SetEventSource(this);
}
@@ -437,7 +437,7 @@ sal_Int32 SAL_CALL AccessibleCell::getBackground (void) throw (RuntimeException)
::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL AccessibleCell::getFont (void) throw (::com::sun::star::uno::RuntimeException)
{
-//todo
+ //todo
return AccessibleComponentBase::getFont();
}
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index f14a23e110dd..91b42a1fa127 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -28,14 +28,11 @@
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/table/TableBorder.hpp>
-
#include <cppuhelper/typeprovider.hxx>
#include <svl/style.hxx>
#include <svl/itemset.hxx>
-
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
-
#include "svx/sdr/properties/textproperties.hxx"
#include "editeng/outlobj.hxx"
#include "editeng/writingmodeitem.hxx"
@@ -43,7 +40,6 @@
#include "svx/svdoutl.hxx"
#include "svx/unoshtxt.hxx"
#include "svx/svdmodel.hxx"
-
#include "tableundo.hxx"
#include "cell.hxx"
#include "svx/svdotable.hxx"
@@ -56,6 +52,8 @@
#include "svx/xflbstit.hxx"
#include "svx/xflbmtit.hxx"
#include <svx/svdpool.hxx>
+#include <svx/xit.hxx>
+#include <svx/globaldrawitempool.hxx>
// -----------------------------------------------------------------------------
@@ -101,7 +99,7 @@ static const SvxItemPropertySet* ImplGetSvxCellPropertySet()
{0,0,0,0,0,0}
};
- static SvxItemPropertySet aSvxCellPropertySet( aSvxCellPropertyMap, SdrObject::GetGlobalDrawObjectItemPool() );
+ static SvxItemPropertySet aSvxCellPropertySet( aSvxCellPropertyMap, GetGlobalDrawObjectItemPool() );
return &aSvxCellPropertySet;
}
@@ -255,7 +253,7 @@ namespace sdr
{
if(pNewItem && (SDRATTR_TEXTDIRECTION == nWhich))
{
- sal_Bool bVertical(com::sun::star::text::WritingMode_TB_RL == ((SvxWritingModeItem*)pNewItem)->GetValue());
+ const bool bVertical(com::sun::star::text::WritingMode_TB_RL == ((SvxWritingModeItem*)pNewItem)->GetValue());
sdr::table::SdrTableObj& rObj = (sdr::table::SdrTableObj&)GetSdrObject();
if( rObj.IsVerticalWriting() != bVertical )
@@ -315,8 +313,6 @@ Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) th
, mnColSpan( 1 )
, mxTable( rTableObj.getTable() )
{
- if( rTableObj.GetModel() )
- SetModel( rTableObj.GetModel() );
}
// -----------------------------------------------------------------------------
@@ -354,37 +350,6 @@ void Cell::dispose()
// -----------------------------------------------------------------------------
-void Cell::SetModel(SdrModel* pNewModel)
-{
- SvxTextEditSource* pTextEditSource = dynamic_cast< SvxTextEditSource* >( GetEditSource() );
- if( (GetModel() != pNewModel) || ( pNewModel && !pTextEditSource) )
- {
- if( mpProperties )
- {
- SfxItemPool* pItemPool = mpProperties->GetObjectItemSet().GetPool();
-
- // test for correct pool in ItemSet; move to new pool if necessary
- if( pNewModel && pItemPool && pItemPool != &pNewModel->GetItemPool())
- mpProperties->MoveToItemPool(pItemPool, &pNewModel->GetItemPool(), pNewModel);
- }
-
- if( pTextEditSource )
- {
- pTextEditSource->ChangeModel( pNewModel );
- }
- else
- {
- SetEditSource( new SvxTextEditSource( &GetObject(), this, static_cast< XWeak * >( this ) ) );
- }
-
- SetStyleSheet( 0, sal_True );
- SdrText::SetModel( pNewModel );
- ForceOutlinerParaObject( OUTLINERMODE_TEXTOBJECT );
- }
-}
-
-// -----------------------------------------------------------------------------
-
void Cell::merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan )
{
if( (mnColSpan != nColumnSpan) || (mnRowSpan != nRowSpan) || (mbMerged != sal_False) )
@@ -400,7 +365,7 @@ void Cell::merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan )
void Cell::mergeContent( const CellRef& xSourceCell )
{
- SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
+ SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( getSdrTextObj() );
if( xSourceCell->hasText() )
{
@@ -421,7 +386,7 @@ void Cell::mergeContent( const CellRef& xSourceCell )
rOutliner.Clear();
xSourceCell->SetOutlinerParaObject(rOutliner.CreateParaObject());
rOutliner.Clear();
- SetStyleSheet( GetStyleSheet(), sal_True );
+ SetStyleSheet( GetStyleSheet(), true);
}
}
@@ -454,12 +419,12 @@ void Cell::replaceContentAndFormating( const CellRef& xSourceCell )
mpProperties->SetMergedItemSet( xSourceCell->GetObjectItemSet() );
SetOutlinerParaObject( new OutlinerParaObject(*xSourceCell->GetOutlinerParaObject()) );
- SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
- SdrTableObj& rSourceTableObj = dynamic_cast< SdrTableObj& >( xSourceCell->GetObject() );
+ SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( getSdrTextObj() );
+ SdrTableObj& rSourceTableObj = dynamic_cast< SdrTableObj& >( xSourceCell->getSdrTextObj() );
- if(rSourceTableObj.GetModel() != rTableObj.GetModel())
+ if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
{
- SetStyleSheet( 0, sal_True );
+ SetStyleSheet( 0, true);
}
}
}
@@ -490,7 +455,7 @@ void Cell::notifyModified()
bool Cell::IsTextEditActive()
{
bool isActive = false;
- SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
+ SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( getSdrTextObj() );
if(rTableObj.getActiveCell().get() == this )
{
OutlinerParaObject* pParaObj = rTableObj.GetEditOutlinerParaObject();
@@ -529,7 +494,7 @@ bool Cell::hasText() const
OutlinerParaObject* Cell::GetEditOutlinerParaObject() const
{
- SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
+ SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( getSdrTextObj() );
if( rTableObj.getActiveCell().get() == this )
return rTableObj.GetEditOutlinerParaObject();
return 0;
@@ -560,7 +525,7 @@ const SfxItemSet& Cell::GetObjectItemSet()
else
{
DBG_ERROR("Cell::GetObjectItemSet(), called without properties!");
- return GetObject().GetObjectItemSet();
+ return getSdrTextObj().GetObjectItemSet();
}
}
@@ -605,7 +570,7 @@ const Rectangle& Cell::GetCurrentBoundRect() const
// -----------------------------------------------------------------------------
-void Cell::TakeTextAnchorRect(Rectangle& rAnchorRect) const
+void Cell::TakeCellsTextAnchorRect(Rectangle& rAnchorRect) const
{
rAnchorRect.nLeft = maCellRect.nLeft + GetTextLeftDistance();
rAnchorRect.nRight = maCellRect.nRight - GetTextRightDistance();
@@ -622,7 +587,7 @@ const SfxItemSet& Cell::GetItemSet() const
// -----------------------------------------------------------------------------
-void Cell::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems)
+void Cell::SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems)
{
if( mpProperties )
{
@@ -645,11 +610,11 @@ sal_Int32 Cell::getMinimumHeight()
if( !mpProperties )
return 0;
- SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() );
+ SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( getSdrTextObj() );
sal_Int32 nMinimumHeight = 0;
Rectangle aTextRect;
- TakeTextAnchorRect( aTextRect );
+ TakeCellsTextAnchorRect( aTextRect );
Size aSize( aTextRect.GetSize() );
aSize.Height()=0x0FFFFFFF;
@@ -682,28 +647,28 @@ sal_Int32 Cell::getMinimumHeight()
long Cell::GetTextLeftDistance() const
{
- return ((SdrTextLeftDistItem&)(GetItemSet().Get(SDRATTR_TEXT_LEFTDIST))).GetValue();
+ return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_LEFTDIST))).GetValue();
}
// -----------------------------------------------------------------------------
long Cell::GetTextRightDistance() const
{
- return ((SdrTextRightDistItem&)(GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST))).GetValue();
+ return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST))).GetValue();
}
// -----------------------------------------------------------------------------
long Cell::GetTextUpperDistance() const
{
- return ((SdrTextUpperDistItem&)(GetItemSet().Get(SDRATTR_TEXT_UPPERDIST))).GetValue();
+ return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_UPPERDIST))).GetValue();
}
// -----------------------------------------------------------------------------
long Cell::GetTextLowerDistance() const
{
- return ((SdrTextLowerDistItem&)(GetItemSet().Get(SDRATTR_TEXT_LOWERDIST))).GetValue();
+ return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_LOWERDIST))).GetValue();
}
// -----------------------------------------------------------------------------
@@ -735,11 +700,14 @@ void Cell::SetOutlinerParaObject( OutlinerParaObject* pTextObject )
void Cell::AddUndo()
{
- SdrObject& rObj = GetObject();
- if( rObj.IsInserted() && GetModel() && GetModel()->IsUndoEnabled() )
+ SdrObject& rObj = getSdrTextObj();
+ if( rObj.IsObjectInserted())
{
- CellRef xCell( this );
- GetModel()->AddUndo( new CellUndo( &rObj, xCell ) );
+ if(getSdrTextObj().getSdrModelFromSdrObject().IsUndoEnabled() )
+ {
+ CellRef xCell( this );
+ getSdrTextObj().getSdrModelFromSdrObject().AddUndo( new CellUndo( &rObj, xCell ) );
+ }
}
}
@@ -1000,7 +968,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any&
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(rPropertyName);
@@ -1011,129 +979,129 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any&
switch( pMap->nWID )
{
- case OWN_ATTR_STYLE:
- {
- Reference< XStyle > xStyle;
- if( !( rValue >>= xStyle ) )
- throw IllegalArgumentException();
+ case OWN_ATTR_STYLE:
+ {
+ Reference< XStyle > xStyle;
+ if( !( rValue >>= xStyle ) )
+ throw IllegalArgumentException();
- SfxUnoStyleSheet* pStyle = SfxUnoStyleSheet::getUnoStyleSheet(xStyle);
- SetStyleSheet( pStyle, sal_True );
- return;
- }
- case OWN_ATTR_TABLEBORDER:
- {
- if(rValue.getValueType() != ::getCppuType((const TableBorder*)0) )
- break;
+ SfxUnoStyleSheet* pStyle = SfxUnoStyleSheet::getUnoStyleSheet(xStyle);
+ SetStyleSheet( pStyle, true);
+ return;
+ }
+ case OWN_ATTR_TABLEBORDER:
+ {
+ if(rValue.getValueType() != ::getCppuType((const TableBorder*)0) )
+ break;
- const TableBorder* pBorder = (const TableBorder* )rValue.getValue();
- if( pBorder == NULL )
- break;
+ const TableBorder* pBorder = (const TableBorder* )rValue.getValue();
+ if( pBorder == NULL )
+ break;
- SvxBoxItem aBox( SDRATTR_TABLE_BORDER );
- SvxBoxInfoItem aBoxInfo( SDRATTR_TABLE_BORDER_INNER );
- SvxBorderLine aLine;
+ SvxBoxItem aBox( SDRATTR_TABLE_BORDER );
+ SvxBoxInfoItem aBoxInfo( SDRATTR_TABLE_BORDER_INNER );
+ SvxBorderLine aLine;
- sal_Bool bSet = SvxBoxItem::LineToSvxLine(pBorder->TopLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_TOP);
- aBoxInfo.SetValid(VALID_TOP, pBorder->IsTopLineValid);
+ sal_Bool bSet = SvxBoxItem::LineToSvxLine(pBorder->TopLine, aLine, false);
+ aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_TOP);
+ aBoxInfo.SetValid(VALID_TOP, pBorder->IsTopLineValid);
- bSet = SvxBoxItem::LineToSvxLine(pBorder->BottomLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_BOTTOM);
- aBoxInfo.SetValid(VALID_BOTTOM, pBorder->IsBottomLineValid);
+ bSet = SvxBoxItem::LineToSvxLine(pBorder->BottomLine, aLine, false);
+ aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_BOTTOM);
+ aBoxInfo.SetValid(VALID_BOTTOM, pBorder->IsBottomLineValid);
- bSet = SvxBoxItem::LineToSvxLine(pBorder->LeftLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_LEFT);
- aBoxInfo.SetValid(VALID_LEFT, pBorder->IsLeftLineValid);
+ bSet = SvxBoxItem::LineToSvxLine(pBorder->LeftLine, aLine, false);
+ aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_LEFT);
+ aBoxInfo.SetValid(VALID_LEFT, pBorder->IsLeftLineValid);
- bSet = SvxBoxItem::LineToSvxLine(pBorder->RightLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_RIGHT);
- aBoxInfo.SetValid(VALID_RIGHT, pBorder->IsRightLineValid);
+ bSet = SvxBoxItem::LineToSvxLine(pBorder->RightLine, aLine, false);
+ aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_RIGHT);
+ aBoxInfo.SetValid(VALID_RIGHT, pBorder->IsRightLineValid);
- bSet = SvxBoxItem::LineToSvxLine(pBorder->HorizontalLine, aLine, false);
- aBoxInfo.SetLine(bSet ? &aLine : 0, BOXINFO_LINE_HORI);
- aBoxInfo.SetValid(VALID_HORI, pBorder->IsHorizontalLineValid);
+ bSet = SvxBoxItem::LineToSvxLine(pBorder->HorizontalLine, aLine, false);
+ aBoxInfo.SetLine(bSet ? &aLine : 0, BOXINFO_LINE_HORI);
+ aBoxInfo.SetValid(VALID_HORI, pBorder->IsHorizontalLineValid);
- bSet = SvxBoxItem::LineToSvxLine(pBorder->VerticalLine, aLine, false);
- aBoxInfo.SetLine(bSet ? &aLine : 0, BOXINFO_LINE_VERT);
- aBoxInfo.SetValid(VALID_VERT, pBorder->IsVerticalLineValid);
+ bSet = SvxBoxItem::LineToSvxLine(pBorder->VerticalLine, aLine, false);
+ aBoxInfo.SetLine(bSet ? &aLine : 0, BOXINFO_LINE_VERT);
+ aBoxInfo.SetValid(VALID_VERT, pBorder->IsVerticalLineValid);
- aBox.SetDistance(pBorder->Distance, false);
- aBoxInfo.SetValid(VALID_DISTANCE, pBorder->IsDistanceValid);
+ aBox.SetDistance(pBorder->Distance, false);
+ aBoxInfo.SetValid(VALID_DISTANCE, pBorder->IsDistanceValid);
- mpProperties->SetObjectItem(aBox);
- mpProperties->SetObjectItem(aBoxInfo);
- return;
- }
- case OWN_ATTR_FILLBMP_MODE:
- {
- BitmapMode eMode;
- if(!(rValue >>= eMode) )
+ mpProperties->SetObjectItem(aBox);
+ mpProperties->SetObjectItem(aBoxInfo);
+ return;
+ }
+ case OWN_ATTR_FILLBMP_MODE:
{
- sal_Int32 nMode = 0;
- if(!(rValue >>= nMode))
- throw IllegalArgumentException();
+ BitmapMode eMode;
+ if(!(rValue >>= eMode) )
+ {
+ sal_Int32 nMode = 0;
+ if(!(rValue >>= nMode))
+ throw IllegalArgumentException();
eMode = (BitmapMode)nMode;
- }
+ }
- mpProperties->SetObjectItem( XFillBmpStretchItem( eMode == BitmapMode_STRETCH ) );
- mpProperties->SetObjectItem( XFillBmpTileItem( eMode == BitmapMode_REPEAT ) );
- return;
- }
- default:
- {
- SfxItemSet aSet( GetModel()->GetItemPool(), pMap->nWID, pMap->nWID);
- aSet.Put(mpProperties->GetItem(pMap->nWID));
+ mpProperties->SetObjectItem( XFillBmpStretchItem( eMode == BitmapMode_STRETCH ) );
+ mpProperties->SetObjectItem( XFillBmpTileItem( eMode == BitmapMode_REPEAT ) );
+ return;
+ }
+ default:
+ {
+ SfxItemSet aSet( getSdrTextObj().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
+ aSet.Put(mpProperties->GetItem(pMap->nWID));
- bool bSpecial = false;
+ bool bSpecial = false;
- switch( pMap->nWID )
- {
- case XATTR_FILLBITMAP:
- case XATTR_FILLGRADIENT:
- case XATTR_FILLHATCH:
- case XATTR_FILLFLOATTRANSPARENCE:
- case XATTR_LINEEND:
- case XATTR_LINESTART:
- case XATTR_LINEDASH:
+ switch( pMap->nWID )
{
- if( pMap->nMemberId == MID_NAME )
+ case XATTR_FILLBITMAP:
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_FILLFLOATTRANSPARENCE:
+ case XATTR_LINEEND:
+ case XATTR_LINESTART:
+ case XATTR_LINEDASH:
{
- OUString aApiName;
- if( rValue >>= aApiName )
+ if( pMap->nMemberId == MID_NAME )
{
- if( SvxShape::SetFillAttribute( pMap->nWID, aApiName, aSet, GetModel() ) )
- bSpecial = true;
+ OUString aApiName;
+ if( rValue >>= aApiName )
+ {
+ if( SvxShape::SetFillAttribute( pMap->nWID, aApiName, aSet, &getSdrTextObj().getSdrModelFromSdrObject() ) )
+ bSpecial = true;
+ }
}
}
+ break;
}
- break;
- }
-
- if( !bSpecial )
- {
- if( !SvxUnoTextRangeBase::SetPropertyValueHelper( aSet, pMap, rValue, aSet ))
+ if( !bSpecial )
{
- if( aSet.GetItemState( pMap->nWID ) != SFX_ITEM_SET )
- {
- // Default aus ItemPool holen
- if(GetModel()->GetItemPool().IsWhich(pMap->nWID))
- aSet.Put(GetModel()->GetItemPool().GetDefaultItem(pMap->nWID));
- }
- if( aSet.GetItemState( pMap->nWID ) == SFX_ITEM_SET )
+ if( !SvxUnoTextRangeBase::SetPropertyValueHelper( aSet, pMap, rValue, aSet ))
{
- SvxItemPropertySet_setPropertyValue( *mpPropSet, pMap, rValue, aSet );
+ if( aSet.GetItemState( pMap->nWID ) != SFX_ITEM_SET )
+ {
+ // Default aus ItemPool holen
+ if(getSdrTextObj().getSdrModelFromSdrObject().GetItemPool().IsWhich(pMap->nWID))
+ aSet.Put(getSdrTextObj().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
+ }
+
+ if( aSet.GetItemState( pMap->nWID ) == SFX_ITEM_SET )
+ {
+ SvxItemPropertySet_setPropertyValue( *mpPropSet, pMap, rValue, aSet );
+ }
}
}
- }
- GetModel()->SetChanged();
- mpProperties->SetMergedItemSetAndBroadcast( aSet );
- return;
- }
+ getSdrTextObj().getSdrModelFromSdrObject().SetChanged();
+ mpProperties->SetMergedItemSetAndBroadcast( aSet );
+ return;
+ }
}
}
throw UnknownPropertyException();
@@ -1145,7 +1113,7 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName ) throw(Unknow
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
@@ -1154,76 +1122,75 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName ) throw(Unknow
switch( pMap->nWID )
{
/*
- case OWN_ATTR_HASLEVELS:
- {
- return Any( hasLevels() );
- }
-*/
- case OWN_ATTR_STYLE:
- {
- return Any( Reference< XStyle >( dynamic_cast< SfxUnoStyleSheet* >( GetStyleSheet() ) ) );
- }
- case OWN_ATTR_TABLEBORDER:
- {
- const SvxBoxInfoItem& rBoxInfoItem = static_cast<const SvxBoxInfoItem&>(mpProperties->GetItem(SDRATTR_TABLE_BORDER_INNER));
- const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(mpProperties->GetItem(SDRATTR_TABLE_BORDER));
-
- TableBorder aTableBorder;
- aTableBorder.TopLine = SvxBoxItem::SvxLineToLine(rBox.GetTop(), false);
- aTableBorder.IsTopLineValid = rBoxInfoItem.IsValid(VALID_TOP);
- aTableBorder.BottomLine = SvxBoxItem::SvxLineToLine(rBox.GetBottom(), false);
- aTableBorder.IsBottomLineValid = rBoxInfoItem.IsValid(VALID_BOTTOM);
- aTableBorder.LeftLine = SvxBoxItem::SvxLineToLine(rBox.GetLeft(), false);
- aTableBorder.IsLeftLineValid = rBoxInfoItem.IsValid(VALID_LEFT);
- aTableBorder.RightLine = SvxBoxItem::SvxLineToLine(rBox.GetRight(), false);
- aTableBorder.IsRightLineValid = rBoxInfoItem.IsValid(VALID_RIGHT );
- aTableBorder.HorizontalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetHori(), false);
- aTableBorder.IsHorizontalLineValid = rBoxInfoItem.IsValid(VALID_HORI);
- aTableBorder.VerticalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetVert(), false);
- aTableBorder.IsVerticalLineValid = rBoxInfoItem.IsValid(VALID_VERT);
- aTableBorder.Distance = rBox.GetDistance();
- aTableBorder.IsDistanceValid = rBoxInfoItem.IsValid(VALID_DISTANCE);
-
- return Any( aTableBorder );
- }
- case OWN_ATTR_FILLBMP_MODE:
- {
- const XFillBmpStretchItem& rStretchItem = static_cast<const XFillBmpStretchItem&>(mpProperties->GetItem(XATTR_FILLBMP_STRETCH));
- const XFillBmpTileItem& rTileItem = static_cast<const XFillBmpTileItem&>(mpProperties->GetItem(XATTR_FILLBMP_TILE));
- if( rTileItem.GetValue() )
+ case OWN_ATTR_HASLEVELS:
{
- return Any( BitmapMode_REPEAT );
+ return Any( hasLevels() );
}
- else if( rStretchItem.GetValue() )
+*/
+ case OWN_ATTR_STYLE:
{
- return Any( BitmapMode_STRETCH );
+ return Any( Reference< XStyle >( dynamic_cast< SfxUnoStyleSheet* >( GetStyleSheet() ) ) );
}
- else
+ case OWN_ATTR_TABLEBORDER:
{
- return Any( BitmapMode_NO_REPEAT );
+ const SvxBoxInfoItem& rBoxInfoItem = static_cast<const SvxBoxInfoItem&>(mpProperties->GetItem(SDRATTR_TABLE_BORDER_INNER));
+ const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(mpProperties->GetItem(SDRATTR_TABLE_BORDER));
+
+ TableBorder aTableBorder;
+ aTableBorder.TopLine = SvxBoxItem::SvxLineToLine(rBox.GetTop(), false);
+ aTableBorder.IsTopLineValid = rBoxInfoItem.IsValid(VALID_TOP);
+ aTableBorder.BottomLine = SvxBoxItem::SvxLineToLine(rBox.GetBottom(), false);
+ aTableBorder.IsBottomLineValid = rBoxInfoItem.IsValid(VALID_BOTTOM);
+ aTableBorder.LeftLine = SvxBoxItem::SvxLineToLine(rBox.GetLeft(), false);
+ aTableBorder.IsLeftLineValid = rBoxInfoItem.IsValid(VALID_LEFT);
+ aTableBorder.RightLine = SvxBoxItem::SvxLineToLine(rBox.GetRight(), false);
+ aTableBorder.IsRightLineValid = rBoxInfoItem.IsValid(VALID_RIGHT );
+ aTableBorder.HorizontalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetHori(), false);
+ aTableBorder.IsHorizontalLineValid = rBoxInfoItem.IsValid(VALID_HORI);
+ aTableBorder.VerticalLine = SvxBoxItem::SvxLineToLine(rBoxInfoItem.GetVert(), false);
+ aTableBorder.IsVerticalLineValid = rBoxInfoItem.IsValid(VALID_VERT);
+ aTableBorder.Distance = rBox.GetDistance();
+ aTableBorder.IsDistanceValid = rBoxInfoItem.IsValid(VALID_DISTANCE);
+
+ return Any( aTableBorder );
}
- }
- default:
- {
- SfxItemSet aSet( GetModel()->GetItemPool(), pMap->nWID, pMap->nWID);
- aSet.Put(mpProperties->GetItem(pMap->nWID));
-
- Any aAny;
- if(!SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
+ case OWN_ATTR_FILLBMP_MODE:
{
- if(!aSet.Count())
+ const XFillBmpStretchItem& rStretchItem = static_cast<const XFillBmpStretchItem&>(mpProperties->GetItem(XATTR_FILLBMP_STRETCH));
+ const XFillBmpTileItem& rTileItem = static_cast<const XFillBmpTileItem&>(mpProperties->GetItem(XATTR_FILLBMP_TILE));
+ if( rTileItem.GetValue() )
{
- // Default aus ItemPool holen
- if(GetModel()->GetItemPool().IsWhich(pMap->nWID))
- aSet.Put(GetModel()->GetItemPool().GetDefaultItem(pMap->nWID));
+ return Any( BitmapMode_REPEAT );
+ }
+ else if( rStretchItem.GetValue() )
+ {
+ return Any( BitmapMode_STRETCH );
+ }
+ else
+ {
+ return Any( BitmapMode_NO_REPEAT );
}
-
- if( aSet.Count() )
- aAny = GetAnyForItem( aSet, pMap );
}
+ default:
+ {
+ SfxItemSet aSet( getSdrTextObj().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
+ aSet.Put(mpProperties->GetItem(pMap->nWID));
- return aAny;
- }
+ Any aAny;
+ if(!SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
+ {
+ if(!aSet.Count())
+ {
+ // Default aus ItemPool holen
+ if(getSdrTextObj().getSdrModelFromSdrObject().GetItemPool().IsWhich(pMap->nWID))
+ aSet.Put(getSdrTextObj().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
+ }
+
+ if( aSet.Count() )
+ aAny = GetAnyForItem( aSet, pMap );
+ }
+ return aAny;
+ }
}
}
throw UnknownPropertyException();
@@ -1261,11 +1228,10 @@ void SAL_CALL Cell::setPropertyValues( const Sequence< OUString >& aPropertyName
{
OGuard aSolarGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const sal_Int32 nCount = aPropertyNames.getLength();
-
const OUString* pNames = aPropertyNames.getConstArray();
const Any* pValues = aValues.getConstArray();
@@ -1292,7 +1258,7 @@ Sequence< Any > SAL_CALL Cell::getPropertyValues( const Sequence< OUString >& aP
{
OGuard aSolarGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const sal_Int32 nCount = aPropertyNames.getLength();
@@ -1346,7 +1312,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
@@ -1356,97 +1322,97 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th
PropertyState eState;
switch( pMap->nWID )
{
- case OWN_ATTR_FILLBMP_MODE:
- {
- const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
-
- const bool bStretch = rSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SFX_ITEM_SET;
- const bool bTile = rSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SFX_ITEM_SET;
- if( bStretch || bTile )
+ case OWN_ATTR_FILLBMP_MODE:
{
- eState = PropertyState_DIRECT_VALUE;
+ const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
+
+ const bool bStretch = rSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SFX_ITEM_SET;
+ const bool bTile = rSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SFX_ITEM_SET;
+ if( bStretch || bTile )
+ {
+ eState = PropertyState_DIRECT_VALUE;
+ }
+ else
+ {
+ eState = PropertyState_DEFAULT_VALUE;
+ }
}
- else
+/*
+ case OWN_ATTR_HASLEVELS:
{
- eState = PropertyState_DEFAULT_VALUE;
+ return PropertyState_DIRECT_VALUE;
}
- }
-/*
- case OWN_ATTR_HASLEVELS:
- {
- return PropertyState_DIRECT_VALUE;
- }
*/
- case OWN_ATTR_STYLE:
- {
- return PropertyState_DIRECT_VALUE;
- }
- case OWN_ATTR_TABLEBORDER:
- {
- const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
- if( (rSet.GetItemState( SDRATTR_TABLE_BORDER_INNER, sal_False ) == SFX_ITEM_DEFAULT) && (rSet.GetItemState( SDRATTR_TABLE_BORDER, sal_False ) == SFX_ITEM_DEFAULT) )
- return PropertyState_DEFAULT_VALUE;
-
- return PropertyState_DIRECT_VALUE;
- }
- default:
- {
- const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
-
- switch( rSet.GetItemState( pMap->nWID, sal_False ) )
+ case OWN_ATTR_STYLE:
{
- case SFX_ITEM_READONLY:
- case SFX_ITEM_SET:
- eState = PropertyState_DIRECT_VALUE;
- break;
- case SFX_ITEM_DEFAULT:
- eState = PropertyState_DEFAULT_VALUE;
- break;
- // case SFX_ITEM_UNKNOWN:
- // case SFX_ITEM_DONTCARE:
- // case SFX_ITEM_DISABLED:
- default:
- eState = PropertyState_AMBIGUOUS_VALUE;
- break;
+ return PropertyState_DIRECT_VALUE;
}
+ case OWN_ATTR_TABLEBORDER:
+ {
+ const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
+ if( (rSet.GetItemState( SDRATTR_TABLE_BORDER_INNER, sal_False ) == SFX_ITEM_DEFAULT) && (rSet.GetItemState( SDRATTR_TABLE_BORDER, sal_False ) == SFX_ITEM_DEFAULT) )
+ return PropertyState_DEFAULT_VALUE;
- // if a item is set, this doesn't mean we want it :)
- if( ( PropertyState_DIRECT_VALUE == eState ) )
+ return PropertyState_DIRECT_VALUE;
+ }
+ default:
{
- switch( pMap->nWID )
+ const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
+
+ switch( rSet.GetItemState( pMap->nWID, sal_False ) )
{
- // the following items are disabled by changing the
- // fill style or the line style. so there is no need
- // to export items without names which should be empty
- case XATTR_FILLBITMAP:
- case XATTR_FILLGRADIENT:
- case XATTR_FILLHATCH:
- case XATTR_LINEDASH:
- {
- NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
- if( ( pItem == NULL ) || ( pItem->GetName().Len() == 0) )
- eState = PropertyState_DEFAULT_VALUE;
- }
+ case SFX_ITEM_READONLY:
+ case SFX_ITEM_SET:
+ eState = PropertyState_DIRECT_VALUE;
break;
+ case SFX_ITEM_DEFAULT:
+ eState = PropertyState_DEFAULT_VALUE;
+ break;
+ // case SFX_ITEM_UNKNOWN:
+ // case SFX_ITEM_DONTCARE:
+ // case SFX_ITEM_DISABLED:
+ default:
+ eState = PropertyState_AMBIGUOUS_VALUE;
+ break;
+ }
- // #i36115#
- // If e.g. the LineStart is on NONE and thus the string has length 0, it still
- // may be a hard attribute covering the set LineStart of the parent (Style).
- // #i37644#
- // same is for fill float transparency
- case XATTR_LINEEND:
- case XATTR_LINESTART:
- case XATTR_FILLFLOATTRANSPARENCE:
+ // if a item is set, this doesn't mean we want it :)
+ if( ( PropertyState_DIRECT_VALUE == eState ) )
+ {
+ switch( pMap->nWID )
{
- NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
- if( ( pItem == NULL ) )
- eState = PropertyState_DEFAULT_VALUE;
+ // the following items are disabled by changing the
+ // fill style or the line style. so there is no need
+ // to export items without names which should be empty
+ case XATTR_FILLBITMAP:
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_LINEDASH:
+ {
+ NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
+ if( ( pItem == NULL ) || ( pItem->GetName().Len() == 0) )
+ eState = PropertyState_DEFAULT_VALUE;
+ }
+ break;
+
+ // #i36115#
+ // If e.g. the LineStart is on NONE and thus the string has length 0, it still
+ // may be a hard attribute covering the set LineStart of the parent (Style).
+ // #i37644#
+ // same is for fill float transparency
+ case XATTR_LINEEND:
+ case XATTR_LINESTART:
+ case XATTR_FILLFLOATTRANSPARENCE:
+ {
+ NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
+ if( ( pItem == NULL ) )
+ eState = PropertyState_DEFAULT_VALUE;
+ }
+ break;
}
- break;
}
}
}
- }
return eState;
}
throw UnknownPropertyException();
@@ -1458,7 +1424,7 @@ Sequence< PropertyState > SAL_CALL Cell::getPropertyStates( const Sequence< OUSt
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const sal_Int32 nCount = aPropertyName.getLength();
@@ -1489,7 +1455,7 @@ void SAL_CALL Cell::setPropertyToDefault( const OUString& PropertyName ) throw(U
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName);
@@ -1497,30 +1463,30 @@ void SAL_CALL Cell::setPropertyToDefault( const OUString& PropertyName ) throw(U
{
switch( pMap->nWID )
{
- case OWN_ATTR_FILLBMP_MODE:
- {
- mpProperties->ClearObjectItem( XATTR_FILLBMP_STRETCH );
- mpProperties->ClearObjectItem( XATTR_FILLBMP_TILE );
- break;
- }
-// case OWN_ATTR_HASLEVELS:
- case OWN_ATTR_STYLE:
- break;
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ mpProperties->ClearObjectItem( XATTR_FILLBMP_STRETCH );
+ mpProperties->ClearObjectItem( XATTR_FILLBMP_TILE );
+ break;
+ }
+ // case OWN_ATTR_HASLEVELS:
+ case OWN_ATTR_STYLE:
+ break;
- case OWN_ATTR_TABLEBORDER:
- {
- mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER_INNER );
- mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER );
- break;
- }
+ case OWN_ATTR_TABLEBORDER:
+ {
+ mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER_INNER );
+ mpProperties->ClearObjectItem( SDRATTR_TABLE_BORDER );
+ break;
+ }
- default:
- {
- mpProperties->ClearObjectItem( pMap->nWID );
- }
+ default:
+ {
+ mpProperties->ClearObjectItem( pMap->nWID );
+ }
}
- GetModel()->SetChanged();
+ getSdrTextObj().getSdrModelFromSdrObject().SetChanged();
return;
}
throw UnknownPropertyException();
@@ -1532,7 +1498,7 @@ Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName ) throw(Unk
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpProperties == 0) || (GetModel() == 0) )
+ if( !mpProperties )
throw DisposedException();
const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(aPropertyName);
@@ -1540,35 +1506,35 @@ Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName ) throw(Unk
{
switch( pMap->nWID )
{
- case OWN_ATTR_FILLBMP_MODE:
- return Any( BitmapMode_NO_REPEAT );
+ case OWN_ATTR_FILLBMP_MODE:
+ return Any( BitmapMode_NO_REPEAT );
/*
- case OWN_ATTR_HASLEVELS:
- return Any( sal_False );
+ case OWN_ATTR_HASLEVELS:
+ return Any( sal_False );
*/
- case OWN_ATTR_STYLE:
- {
- Reference< XStyle > xStyle;
- return Any( xStyle );
- }
+ case OWN_ATTR_STYLE:
+ {
+ Reference< XStyle > xStyle;
+ return Any( xStyle );
+ }
- case OWN_ATTR_TABLEBORDER:
- {
- TableBorder aBorder;
- return Any( aBorder );
- }
+ case OWN_ATTR_TABLEBORDER:
+ {
+ TableBorder aBorder;
+ return Any( aBorder );
+ }
- default:
- {
- if( GetModel()->GetItemPool().IsWhich(pMap->nWID) )
+ default:
{
- SfxItemSet aSet( GetModel()->GetItemPool(), pMap->nWID, pMap->nWID);
- aSet.Put(GetModel()->GetItemPool().GetDefaultItem(pMap->nWID));
- return GetAnyForItem( aSet, pMap );
+ if( getSdrTextObj().getSdrModelFromSdrObject().GetItemPool().IsWhich(pMap->nWID) )
+ {
+ SfxItemSet aSet( getSdrTextObj().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
+ aSet.Put(getSdrTextObj().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
+ return GetAnyForItem( aSet, pMap );
+ }
}
}
- }
}
throw UnknownPropertyException();
}
@@ -1581,9 +1547,9 @@ void SAL_CALL Cell::setAllPropertiesToDefault( ) throw (RuntimeException)
{
if( mpProperties )
delete mpProperties;
- mpProperties = new sdr::properties::CellProperties( static_cast< SdrTableObj& >( GetObject() ), this );
+ mpProperties = new sdr::properties::CellProperties( static_cast< SdrTableObj& >( getSdrTextObj() ), this );
- SdrOutliner& rOutliner = GetObject().ImpGetDrawOutliner();
+ SdrOutliner& rOutliner = getSdrTextObj().ImpGetDrawOutliner();
OutlinerParaObject* pParaObj = GetOutlinerParaObject();
if( pParaObj )
diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx
index a0101b99de1b..e1bd90ee3197 100644
--- a/svx/source/table/cell.hxx
+++ b/svx/source/table/cell.hxx
@@ -82,10 +82,10 @@ public:
SVX_DLLPRIVATE virtual SfxStyleSheet* GetStyleSheet() const;
SfxStyleSheetPool* GetStyleSheetPool() const;
SVX_DLLPRIVATE virtual const Rectangle& GetCurrentBoundRect() const;
- SVX_DLLPRIVATE virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
+ SVX_DLLPRIVATE void TakeCellsTextAnchorRect(Rectangle& rAnchorRect) const;
SVX_DLLPRIVATE virtual const SfxItemSet& GetItemSet() const;
- SVX_DLLPRIVATE void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, sal_Bool bClearAllItems);
+ SVX_DLLPRIVATE void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems);
void SetMergedItem(const SfxPoolItem& rItem);
SVX_DLLPRIVATE sal_Int32 getMinimumWidth();
@@ -99,8 +99,6 @@ public:
SVX_DLLPRIVATE SdrTextVertAdjust GetTextVerticalAdjust() const;
SdrTextHorzAdjust GetTextHorizontalAdjust() const;
- SVX_DLLPRIVATE virtual void SetModel(SdrModel* pNewModel);
-
SVX_DLLPRIVATE void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan );
SVX_DLLPRIVATE void mergeContent( const CellRef& xSourceCell );
SVX_DLLPRIVATE void replaceContentAndFormating( const CellRef& xSourceCell );
diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx
index d5b76a9ee173..b0f822215cff 100644
--- a/svx/source/table/cellcursor.cxx
+++ b/svx/source/table/cellcursor.cxx
@@ -261,11 +261,11 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
if( !mxTable.is() || (mxTable->getSdrTableObj() == 0) )
throw DisposedException();
- SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
- const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+ SdrModel& rModel = mxTable->getSdrTableObj()->getSdrModelFromSdrObject();
+ const bool bUndo = mxTable->getSdrTableObj()->IsObjectInserted() && rModel.IsUndoEnabled();
if( bUndo )
- pModel->BegUndo( ImpGetResStr(STR_TABLE_MERGE) );
+ rModel.BegUndo( ImpGetResStr(STR_TABLE_MERGE) );
try
{
@@ -279,10 +279,9 @@ void SAL_CALL CellCursor::merge( ) throw (NoSupportException, RuntimeException)
}
if( bUndo )
- pModel->EndUndo();
+ rModel.EndUndo();
- if( pModel )
- pModel->SetChanged();
+ rModel.SetChanged();
}
// -----------------------------------------------------------------------------
@@ -527,10 +526,10 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
if( !mxTable.is() || (mxTable->getSdrTableObj() == 0) )
throw DisposedException();
- SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
- const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+ SdrModel& rModel = mxTable->getSdrTableObj()->getSdrModelFromSdrObject();
+ const bool bUndo = mxTable->getSdrTableObj()->IsObjectInserted() && rModel.IsUndoEnabled();
if( bUndo )
- pModel->BegUndo( ImpGetResStr(STR_TABLE_SPLIT) );
+ rModel.BegUndo( ImpGetResStr(STR_TABLE_SPLIT) );
try
{
@@ -550,10 +549,9 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
}
if( bUndo )
- pModel->EndUndo();
+ rModel.EndUndo();
- if( pModel )
- pModel->SetChanged();
+ rModel.SetChanged();
}
// -----------------------------------------------------------------------------
diff --git a/svx/source/table/celleditsource.cxx b/svx/source/table/celleditsource.cxx
index c067a42dd290..e272563c49bc 100644
--- a/svx/source/table/celleditsource.cxx
+++ b/svx/source/table/celleditsource.cxx
@@ -156,8 +156,6 @@ public:
Point PixelToLogic( const Point&, const MapMode& rMapMode );
DECL_LINK( NotifyHdl, EENotify* );
-
- void ChangeModel( SdrModel* pNewModel );
};
//------------------------------------------------------------------------
@@ -256,50 +254,12 @@ void SAL_CALL CellEditSourceImpl::release()
delete this;
}
-void CellEditSourceImpl::ChangeModel( SdrModel* pNewModel )
-{
- if( mpModel != pNewModel )
- {
- if( mpOutliner )
- {
- if( mpModel )
- mpModel->disposeOutliner( mpOutliner );
- else
- delete mpOutliner;
- mpOutliner = 0;
- }
-
- if( mpView )
- {
- EndListening( *mpView );
- mpView = 0;
- }
-
- mpWindow = 0;
- mxLinguServiceManager.clear();
-
- mpModel = pNewModel;
-
- if( mpTextForwarder )
- {
- delete mpTextForwarder;
- mpTextForwarder = 0;
- }
-
- if( mpViewForwarder )
- {
- delete mpViewForwarder;
- mpViewForwarder = 0;
- }
- }
-}
-
//------------------------------------------------------------------------
void CellEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+ const SvxViewHint* pViewHint = dynamic_cast< const SvxViewHint* >(&rHint);
if( pViewHint )
{
@@ -312,9 +272,11 @@ void CellEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else if( pSdrHint )
{
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
- case HINT_OBJCHG:
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
+ case HINT_OBJCHG_ATTR:
{
mbDataValid = sal_False; // Text muss neu geholt werden
@@ -322,7 +284,7 @@ void CellEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// #104157# Update maTextOffset, object has changed
// #105196#, #105203#: Cannot call that // here,
- // since TakeTextRect() (called from there) //
+ // since TakeTextRange() (called from there) //
// changes outliner content.
// UpdateOutliner();
@@ -335,7 +297,7 @@ void CellEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
case HINT_BEGEDIT:
/* todo
- if( mpObject == pSdrHint->GetObject() )
+ if( mpObject == pSdrHint->GetSdrHintObject() )
{
// invalidate old forwarder
if( !mbForwarderIsEditMode )
@@ -358,7 +320,7 @@ void CellEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
case HINT_ENDEDIT:
/* todo
- if( mpObject == pSdrHint->GetObject() )
+ if( mpObject == pSdrHint->GetSdrHintObject() )
{
Broadcast( *pSdrHint );
@@ -447,11 +409,11 @@ void CellEditSourceImpl::SetupOutliner()
/* todo
if( mpObject && mpOutliner )
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
Rectangle aPaintRect;
if( pTextObj )
{
- Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() );
+ Rectangle aBoundRect( sdr::legacy::GetBoundRect(*pTextObj) );
pTextObj->SetupOutlinerFormatting( *mpOutliner, aPaintRect );
// #101029# calc text offset from shape anchor
@@ -472,11 +434,11 @@ void CellEditSourceImpl::UpdateOutliner()
/* todo
if( mpObject && mpOutliner )
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
Rectangle aPaintRect;
if( pTextObj )
{
- Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() );
+ Rectangle aBoundRect( sdr::legacy::GetBoundRect(*pTextObj) );
pTextObj->UpdateOutlinerFormatting( *mpOutliner, aPaintRect );
// #101029# calc text offset from shape anchor
@@ -716,7 +678,7 @@ SvxEditViewForwarder* CellEditSourceImpl::GetEditViewForwarder( sal_Bool bCreate
mpView->SdrEndTextEdit();
/* todo
- if(mpView->SdrBeginTextEdit(mpObject, 0L, 0L, sal_False, (SdrOutliner*)0L, 0L, sal_False, sal_False))
+ if(mpView->SdrBeginTextEdit(mpObject, 0L, sal_False, (SdrOutliner*)0L, 0L, sal_False, sal_False))
{
if( mxCell->IsTextEditActive() )
{
@@ -815,7 +777,7 @@ Rectangle CellEditSourceImpl::GetVisArea()
// offset vis area by edit engine left-top position
Rectangle aAnchorRect;
- mxCell->TakeTextAnchorRect( aAnchorRect );
+ mxCell->TakeCellsTextAnchorRect( aAnchorRect );
aVisArea.Move( -aAnchorRect.Left(), -aAnchorRect.Top() );
MapMode aMapMode(mpWindow->GetMapMode());
@@ -849,7 +811,7 @@ Point CellEditSourceImpl::LogicToPixel( const Point& rPoint, const MapMode& rMap
aPoint1.Y() += maTextOffset.Y();
Point aPoint2( OutputDevice::LogicToLogic( aPoint1, rMapMode,
- MapMode(mpModel->GetScaleUnit()) ) );
+ MapMode(mpModel->GetExchangeObjectUnit()) ) );
MapMode aMapMode(mpWindow->GetMapMode());
aMapMode.SetOrigin(Point());
return mpWindow->LogicToPixel( aPoint2, aMapMode );
@@ -879,7 +841,7 @@ Point CellEditSourceImpl::PixelToLogic( const Point& rPoint, const MapMode& rMap
aMapMode.SetOrigin(Point());
Point aPoint1( mpWindow->PixelToLogic( rPoint, aMapMode ) );
Point aPoint2( OutputDevice::LogicToLogic( aPoint1,
- MapMode(mpModel->GetScaleUnit()),
+ MapMode(mpModel->GetExchangeObjectUnit()),
rMapMode ) );
// #101029#
aPoint2.X() -= maTextOffset.X();
@@ -1042,11 +1004,4 @@ const SvxUnoTextRangeBaseList& CellEditSource::getRanges() const
//------------------------------------------------------------------------
-void CellEditSource::ChangeModel( SdrModel* pNewModel )
-{
- mpImpl->ChangeModel( pNewModel );
-}
-
-//------------------------------------------------------------------------
-
} }
diff --git a/svx/source/table/celleditsource.hxx b/svx/source/table/celleditsource.hxx
index 154996931bfc..a62cc64a3df6 100644
--- a/svx/source/table/celleditsource.hxx
+++ b/svx/source/table/celleditsource.hxx
@@ -72,8 +72,6 @@ public:
virtual Point LogicToPixel( const Point&, const MapMode& ) const;
virtual Point PixelToLogic( const Point&, const MapMode& ) const;
- void ChangeModel( SdrModel* pNewModel );
-
private:
CellEditSource( CellEditSourceImpl* pImpl );
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 525d754fbeb4..2f6f2ee1e900 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -66,6 +66,7 @@
#include "svx/xflhtit.hxx"
#include "svx/xflftrit.hxx"
#include "svx/xfltrit.hxx"
+#include <svx/svdlegacy.hxx>
// -----------------------------------------------------------------------------
@@ -160,12 +161,6 @@ SfxItemSet& TableProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
0, 0));
}
-class TableObjectGeoData : public SdrTextObjGeoData
-{
-public:
- Rectangle maLogicRect;
-};
-
//------------------------------------------------------------------------
// TableStyleSettings
//------------------------------------------------------------------------
@@ -220,12 +215,9 @@ public:
TableStyleSettings maTableStyle;
Reference< XIndexAccess > mxTableStyle;
bool mbModifyPending;
-// sal_Int32 mnSavedEditRowHeight;
-
- void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
CellRef getCell( const CellPos& rPos ) const;
- void LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHeight );
+ void LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight );
bool ApplyCellStyles();
void UpdateCells( Rectangle& rArea );
@@ -242,7 +234,6 @@ public:
void DragEdge( bool mbHorizontal, int nEdge, sal_Int32 nOffset );
const SfxPoolItem* GetCellItem( const CellPos& rPos, sal_uInt16 nWhich ) const;
-// void GetBorderLines( const CellPos& rPos, const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop, const SvxBorderLine** ppRight, const SvxBorderLine** ppBottom ) const;
void operator=( const SdrTableObjImpl& rSource );
@@ -286,8 +277,12 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n
Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) );
mxTable->addModifyListener( xListener );
UpdateWritingMode();
- LayoutTable( mpTableObj->aRect, true, true );
- mpTableObj->maLogicRect = mpTableObj->aRect;
+
+ basegfx::B2DRange aObjectRange(
+ mpTableObj->getSdrObjectTranslate(),
+ mpTableObj->getSdrObjectTranslate() + basegfx::absolute(mpTableObj->getSdrObjectScale()));
+
+ LayoutTable( aObjectRange, true, true );
}
// -----------------------------------------------------------------------------
@@ -317,48 +312,12 @@ void SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
mxTableStyle = rSource.mxTableStyle;
UpdateWritingMode();
ApplyCellStyles();
- mpTableObj->aRect = mpTableObj->maLogicRect;
- LayoutTable( mpTableObj->aRect, false, false );
-}
-
-// -----------------------------------------------------------------------------
-
-void SdrTableObjImpl::SetModel(SdrModel* /*pOldModel*/, SdrModel* pNewModel)
-{
- // try to find new table style
- disconnectTableStyle();
-
- Reference< XIndexAccess > xNewTableStyle;
- if( mxTableStyle.is() ) try
- {
- const OUString sStyleName( Reference< XNamed >( mxTableStyle, UNO_QUERY_THROW )->getName() );
-
- Reference< XStyleFamiliesSupplier > xSFS( pNewModel->getUnoModel(), UNO_QUERY_THROW );
- Reference< XNameAccess > xFamilyNameAccess( xSFS->getStyleFamilies(), UNO_QUERY_THROW );
- const rtl::OUString sFamilyName( RTL_CONSTASCII_USTRINGPARAM( "table" ) );
- Reference< XNameAccess > xTableFamilyAccess( xFamilyNameAccess->getByName( sFamilyName ), UNO_QUERY_THROW );
-
- if( xTableFamilyAccess->hasByName( sStyleName ) )
- {
- // found table style with the same name
- xTableFamilyAccess->getByName( sStyleName ) >>= xNewTableStyle;
- }
- else
- {
- // copy or?
- Reference< XIndexAccess > xIndexAccess( xTableFamilyAccess, UNO_QUERY_THROW );
- xIndexAccess->getByIndex( 0 ) >>= xNewTableStyle;
- }
- }
- catch( Exception& )
- {
- DBG_ERROR("svx::SdrTableObjImpl::SetModel(), exception caught!");
- }
- mxTableStyle = xNewTableStyle;
+ basegfx::B2DRange aObjectRange(
+ mpTableObj->getSdrObjectTranslate(),
+ mpTableObj->getSdrObjectTranslate() + basegfx::absolute(mpTableObj->getSdrObjectScale()));
- connectTableStyle();
- update();
+ LayoutTable( aObjectRange, false, false );
}
// -----------------------------------------------------------------------------
@@ -449,7 +408,7 @@ bool SdrTableObjImpl::ApplyCellStyles()
if( xCell.is() && ( xCell->GetStyleSheet() != pStyle ) )
{
bChanges = true;
- xCell->SetStyleSheet( pStyle, sal_True );
+ xCell->SetStyleSheet( pStyle, true);
}
}
}
@@ -539,6 +498,8 @@ void SdrTableObjImpl::update()
TableModelNotifyGuard aGuard( mxTable.get() );
if( mpTableObj )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*mpTableObj);
+
if( (maEditPos.mnRow >= getRowCount()) || (maEditPos.mnCol >= getColumnCount()) || (getCell( maEditPos ) != mxActiveCell) )
{
if(maEditPos.mnRow >= getRowCount())
@@ -552,12 +513,11 @@ void SdrTableObjImpl::update()
ApplyCellStyles();
- mpTableObj->aRect = mpTableObj->maLogicRect;
- LayoutTable( mpTableObj->aRect, false, false );
+ basegfx::B2DRange aObjectRange(
+ mpTableObj->getSdrObjectTranslate(),
+ mpTableObj->getSdrObjectTranslate() + basegfx::absolute(mpTableObj->getSdrObjectScale()));
- mpTableObj->SetRectsDirty();
- mpTableObj->ActionChanged();
- mpTableObj->BroadcastObjectChange();
+ LayoutTable( aObjectRange, false, false );
}
}
@@ -595,7 +555,7 @@ void SdrTableObjImpl::disconnectTableStyle()
bool SdrTableObjImpl::isInUse()
{
- return mpTableObj && mpTableObj->IsInserted();
+ return mpTableObj && mpTableObj->IsObjectInserted();
}
// -----------------------------------------------------------------------------
@@ -646,12 +606,13 @@ sal_Int32 SdrTableObjImpl::getRowCount() const
// -----------------------------------------------------------------------------
-void SdrTableObjImpl::LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHeight )
+void SdrTableObjImpl::LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight )
{
- if( mpLayouter && mpTableObj->GetModel() )
+ if( mpTableObj && mpLayouter )
{
TableModelNotifyGuard aGuard( mxTable.get() );
- mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
+
+ mpLayouter->LayoutTable( o_aArea, bFitWidth, bFitHeight );
}
}
@@ -723,24 +684,13 @@ sdr::contact::ViewContact* SdrTableObj::CreateObjectSpecificViewContact()
// --------------------------------------------------------------------
-TYPEINIT1(SdrTableObj,SdrTextObj);
-
-// --------------------------------------------------------------------
-
-SdrTableObj::SdrTableObj(SdrModel* _pModel)
-{
- pModel = _pModel;
- init( 1, 1 );
-}
-
-// --------------------------------------------------------------------
-
-SdrTableObj::SdrTableObj(SdrModel* _pModel, const ::Rectangle& rNewRect, sal_Int32 nColumns, sal_Int32 nRows)
-: SdrTextObj( rNewRect )
-, maLogicRect( rNewRect )
+SdrTableObj::SdrTableObj(
+ SdrModel& rSdrModel,
+ const basegfx::B2DHomMatrix& rTransform,
+ sal_Int32 nColumns,
+ sal_Int32 nRows)
+: SdrTextObj(rSdrModel, rTransform)
{
- pModel = _pModel;
-
if( nColumns <= 0 )
nColumns = 1;
@@ -754,8 +704,6 @@ SdrTableObj::SdrTableObj(SdrModel* _pModel, const ::Rectangle& rNewRect, sal_Int
void SdrTableObj::init( sal_Int32 nColumns, sal_Int32 nRows )
{
- bClosedObj = sal_True;
-
mpImpl = new SdrTableObjImpl;
mpImpl->acquire();
mpImpl->init( this, nColumns, nRows );
@@ -769,6 +717,56 @@ SdrTableObj::~SdrTableObj()
mpImpl->release();
}
+void SdrTableObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const SdrTableObj* pSource = dynamic_cast< const SdrTableObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrTextObj::copyDataFromSdrObject(rSource);
+
+ // copy local data
+ TableModelNotifyGuard aGuard( mpImpl ? mpImpl->mxTable.get() : 0 );
+
+ eTextKind = pSource->eTextKind;
+ bTextFrame = pSource->bTextFrame;
+ aTextSize = pSource->aTextSize;
+ bTextSizeDirty = pSource->bTextSizeDirty;
+ bNoShear = pSource->bNoShear;
+ bNoRotate = pSource->bNoRotate;
+ bNoMirror = pSource->bNoMirror;
+ bDisableAutoWidthOnDragging = pSource->bDisableAutoWidthOnDragging;
+
+ if( pSource->mpImpl )
+ {
+ *mpImpl = *pSource->mpImpl;
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* SdrTableObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SdrTableObj* pClone = new SdrTableObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+bool SdrTableObj::IsClosedObj() const
+{
+ return true;
+}
+
// --------------------------------------------------------------------
// table stuff
// --------------------------------------------------------------------
@@ -1040,7 +1038,7 @@ void SdrTableObj::setTableStyleSettings( const TableStyleSettings& rStyle )
// --------------------------------------------------------------------
-TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_Int32& rnY, int nTol ) const
+TableHitKind SdrTableObj::CheckTableHit( const basegfx::B2DPoint& rPos, sal_Int32& rnX, sal_Int32& rnY, int nTol ) const
{
if( !mpImpl || !mpImpl->mxTable.is() )
return SDRTABLEHIT_NONE;
@@ -1051,10 +1049,11 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_
const sal_Int32 nColCount = mpImpl->getColumnCount();
const sal_Int32 nRowCount = mpImpl->getRowCount();
- sal_Int32 nX = rPos.X() + nTol - aRect.nLeft;
- sal_Int32 nY = rPos.Y() + nTol - aRect.nTop;
+ const Rectangle aOldObjLogicRect(sdr::legacy::GetLogicRect(*this));
+ sal_Int32 nX = basegfx::fround(rPos.getX()) + nTol - aOldObjLogicRect.nLeft;
+ sal_Int32 nY = basegfx::fround(rPos.getY()) + nTol - aOldObjLogicRect.nTop;
- if( (nX < 0) || (nX > (aRect.GetWidth() + nTol)) || (nY < 0) || (nY > (aRect.GetHeight() + nTol) ) )
+ if( (nX < 0) || (nX > (aOldObjLogicRect.GetWidth() + nTol)) || (nY < 0) || (nY > (aOldObjLogicRect.GetHeight() + nTol) ) )
return SDRTABLEHIT_NONE;
// get vertical edge number and check for a hit
@@ -1309,7 +1308,7 @@ void SdrTableObj::setActiveText( sal_Int32 nIndex )
// --------------------------------------------------------------------
/** returns the index of the text that contains the given point or -1 */
-sal_Int32 SdrTableObj::CheckTextHit(const Point& rPnt) const
+sal_Int32 SdrTableObj::CheckTextHit(const basegfx::B2DPoint& rPnt) const
{
if( mpImpl && mpImpl->mxTable.is() )
{
@@ -1349,16 +1348,16 @@ void SdrTableObj::FitFrameToTextSize()
// --------------------------------------------------------------------
-FASTBOOL SdrTableObj::IsAutoGrowHeight() const
+bool SdrTableObj::IsAutoGrowHeight() const
{
- return sal_True;
+ return true;
}
// --------------------------------------------------------------------
-FASTBOOL SdrTableObj::IsAutoGrowWidth() const
+bool SdrTableObj::IsAutoGrowWidth() const
{
- return sal_True;
+ return true;
}
// --------------------------------------------------------------------
@@ -1381,15 +1380,12 @@ void SdrTableObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
{
if( (pEditStatus->GetStatusWord() & EE_STAT_TEXTHEIGHTCHANGED) && mpImpl && mpImpl->mpLayouter )
{
- Rectangle aRect0( aRect );
- aRect = maLogicRect;
-// mpImpl->mpLayouter->setRowHeight( mpImpl->maEditPos.mnRow, mpImpl->mnSavedEditRowHeight );
- mpImpl->LayoutTable( aRect, false, false );
- SetRectsDirty();
- ActionChanged();
- BroadcastObjectChange();
- if( aRect0 != aRect )
- SendUserCall(SDRUSERCALL_RESIZE,aRect0);
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ basegfx::B2DRange aObjectRange(
+ getSdrObjectTranslate(),
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+
+ mpImpl->LayoutTable( aObjectRange, false, false );
}
}
@@ -1397,27 +1393,27 @@ void SdrTableObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
void SdrTableObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rInfo.bResizeFreeAllowed=sal_True;
- rInfo.bResizePropAllowed=sal_True;
- rInfo.bRotateFreeAllowed=sal_False;
- rInfo.bRotate90Allowed =sal_False;
- rInfo.bMirrorFreeAllowed=sal_False;
- rInfo.bMirror45Allowed =sal_False;
- rInfo.bMirror90Allowed =sal_False;
+ rInfo.mbResizeFreeAllowed = true;
+ rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = false;
+ rInfo.mbRotate90Allowed = false;
+ rInfo.mbMirrorFreeAllowed = false;
+ rInfo.mbMirror45Allowed = false;
+ rInfo.mbMirror90Allowed = false;
// allow transparence
- rInfo.bTransparenceAllowed = sal_True;
+ rInfo.mbTransparenceAllowed = true;
// gradient depends on fillstyle
XFillStyle eFillStyle = ((XFillStyleItem&)(GetObjectItem(XATTR_FILLSTYLE))).GetValue();
- rInfo.bGradientAllowed = (eFillStyle == XFILL_GRADIENT);
- rInfo.bShearAllowed =sal_False;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bCanConvToPath =sal_False;
- rInfo.bCanConvToPoly =sal_False;
- rInfo.bCanConvToPathLineToArea=sal_False;
- rInfo.bCanConvToPolyLineToArea=sal_False;
- rInfo.bCanConvToContour = sal_False;
+ rInfo.mbGradientAllowed = (XFILL_GRADIENT == eFillStyle);
+ rInfo.mbShearAllowed = false;
+ rInfo.mbEdgeRadiusAllowed = false;
+ rInfo.mbCanConvToPath = false;
+ rInfo.mbCanConvToPoly = false;
+ rInfo.mbCanConvToPathLineToArea = false;
+ rInfo.mbCanConvToPolyLineToArea = false;
+ rInfo.mbCanConvToContour = false;
}
// --------------------------------------------------------------------
@@ -1427,46 +1423,17 @@ sal_uInt16 SdrTableObj::GetObjIdentifier() const
return static_cast<sal_uInt16>(OBJ_TABLE);
}
-// --------------------------------------------------------------------
-
-void SdrTableObj::SetPage(SdrPage* pNewPage)
-{
- SdrTextObj::SetPage(pNewPage);
-}
-
-// --------------------------------------------------------------------
-
-void SdrTableObj::SetModel(SdrModel* pNewModel)
+void SdrTableObj::TakeTextRange(SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const
{
- SdrModel* pOldModel = GetModel();
- if( pNewModel != pOldModel )
+ if( mpImpl )
{
- SdrTextObj::SetModel(pNewModel);
-
- if( mpImpl )
- {
- mpImpl->SetModel( pOldModel, pNewModel );
-
- if( !maLogicRect.IsEmpty() )
- {
- aRect = maLogicRect;
- mpImpl->LayoutTable( aRect, false, false );
- }
- }
+ TakeTextRange(mpImpl->maEditPos, rOutliner, rTextRange, rAnchorRange);
}
}
// --------------------------------------------------------------------
-void SdrTableObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText, Rectangle* pAnchorRect, sal_Bool bLineWidth ) const
-{
- if( mpImpl )
- TakeTextRect( mpImpl->maEditPos, rOutliner, rTextRect, bNoEditText, pAnchorRect, bLineWidth );
-}
-
-// --------------------------------------------------------------------
-
-void SdrTableObj::TakeTextRect( const CellPos& rPos, SdrOutliner& rOutliner, Rectangle& rTextRect, FASTBOOL bNoEditText, Rectangle* pAnchorRect, sal_Bool /*bLineWidth*/ ) const
+void SdrTableObj::TakeTextRange(const CellPos& rPos, SdrOutliner& rOutliner, basegfx::B2DRange& rTextRange, basegfx::B2DRange& rAnchorRange) const
{
if( !mpImpl )
return;
@@ -1475,49 +1442,39 @@ void SdrTableObj::TakeTextRect( const CellPos& rPos, SdrOutliner& rOutliner, Rec
if( !xCell.is() )
return;
- Rectangle aAnkRect;
- TakeTextAnchorRect( rPos, aAnkRect );
+ TakeTextAnchorRangeFromCell( rPos, rAnchorRange );
SdrTextVertAdjust eVAdj=xCell->GetTextVerticalAdjust();
-// SdrTextHorzAdjust eHAdj=xCell->GetTextHorizontalAdjust();
sal_uIntPtr nStat0=rOutliner.GetControlWord();
Size aNullSize;
+ const Size aIntAnchorSize(basegfx::fround(rAnchorRange.getWidth()), basegfx::fround(rAnchorRange.getHeight()));
nStat0 |= EE_CNTRL_AUTOPAGESIZE;
rOutliner.SetControlWord(nStat0);
rOutliner.SetMinAutoPaperSize(aNullSize);
- rOutliner.SetMaxAutoPaperSize(aAnkRect.GetSize());
- rOutliner.SetPaperSize(aAnkRect.GetSize());
+ rOutliner.SetMaxAutoPaperSize(aIntAnchorSize);
+ rOutliner.SetPaperSize(aIntAnchorSize);
// #103516# New try with _BLOCK for hor and ver after completely
// supporting full width for vertical text.
-// if( SDRTEXTHORZADJUST_BLOCK == eHAdj && !IsVerticalWriting())
-// {
- rOutliner.SetMinAutoPaperSize(Size(aAnkRect.GetWidth(), 0));
-// }
-// else if(SDRTEXTVERTADJUST_BLOCK == eVAdj && IsVerticalWriting())
-// {
-// rOutliner.SetMinAutoPaperSize(Size(0, aAnkRect.GetHeight()));
-// }
-
- // ---
+ rOutliner.SetMinAutoPaperSize(Size(aIntAnchorSize.getWidth(), 0));
// set text at outliner, maybe from edit outliner
OutlinerParaObject* pPara= xCell->GetOutlinerParaObject();
- if (pEdtOutl && !bNoEditText && mpImpl->mxActiveCell == xCell )
- pPara=pEdtOutl->CreateParaObject();
- if (pPara)
+ if (pEdtOutl && mpImpl->mxActiveCell == xCell )
{
- const bool bHitTest = pModel && (&pModel->GetHitTestOutliner() == &rOutliner);
+ pPara = pEdtOutl->CreateParaObject();
+ }
+ if (pPara)
+ {
const SdrTextObj* pTestObj = rOutliner.GetTextObj();
- if( !pTestObj || !bHitTest || (pTestObj != this) || (pTestObj->GetOutlinerParaObject() != xCell->GetOutlinerParaObject()) )
- {
- if( bHitTest ) // #i33696# take back fix #i27510#
- rOutliner.SetTextObj( this );
- rOutliner.SetUpdateMode(sal_True);
+ if( !pTestObj || (pTestObj != this) || (pTestObj->GetOutlinerParaObject() != xCell->GetOutlinerParaObject()) )
+ {
+ rOutliner.SetTextObj( this );
+ rOutliner.SetUpdateMode(true);
rOutliner.SetText(*pPara);
}
}
@@ -1526,37 +1483,32 @@ void SdrTableObj::TakeTextRect( const CellPos& rPos, SdrOutliner& rOutliner, Rec
rOutliner.SetTextObj( NULL );
}
- if (pEdtOutl && !bNoEditText && pPara && mpImpl->mxActiveCell == xCell )
+ if (pEdtOutl && pPara && mpImpl->mxActiveCell == xCell )
+ {
delete pPara;
+ }
- rOutliner.SetUpdateMode(sal_True);
+ rOutliner.SetUpdateMode(true);
rOutliner.SetControlWord(nStat0);
- Point aTextPos(aAnkRect.TopLeft());
- Size aTextSiz(rOutliner.GetPaperSize());
-/*
- if (eHAdj==SDRTEXTHORZADJUST_CENTER || eHAdj==SDRTEXTHORZADJUST_RIGHT)
- {
- long nFreeWdt=aAnkRect.GetWidth()-aTextSiz.Width();
- if (eHAdj==SDRTEXTHORZADJUST_CENTER)
- aTextPos.X()+=nFreeWdt/2;
- if (eHAdj==SDRTEXTHORZADJUST_RIGHT)
- aTextPos.X()+=nFreeWdt;
- }
-*/
- if (eVAdj==SDRTEXTVERTADJUST_CENTER || eVAdj==SDRTEXTVERTADJUST_BOTTOM)
+ basegfx::B2DPoint aTextPos(rAnchorRange.getMinimum());
+ const basegfx::B2DVector aTextSiz(rOutliner.GetPaperSize().getWidth(), rOutliner.GetPaperSize().getHeight());
+
+ if(SDRTEXTVERTADJUST_CENTER == eVAdj || SDRTEXTVERTADJUST_BOTTOM == eVAdj)
{
- long nFreeHgt=aAnkRect.GetHeight()-aTextSiz.Height();
- if (eVAdj==SDRTEXTVERTADJUST_CENTER)
- aTextPos.Y()+=nFreeHgt/2;
- if (eVAdj==SDRTEXTVERTADJUST_BOTTOM)
- aTextPos.Y()+=nFreeHgt;
- }
+ const double fFreeHgt(rAnchorRange.getHeight() - aTextSiz.getY());
- if (pAnchorRect)
- *pAnchorRect=aAnkRect;
+ if(SDRTEXTVERTADJUST_CENTER == eVAdj)
+ {
+ aTextPos.setY(aTextPos.getY() + (fFreeHgt * 0.5));
+ }
+ else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
+ {
+ aTextPos.setY(aTextPos.getY() + fFreeHgt);
+ }
+ }
- rTextRect=Rectangle(aTextPos,aTextSiz);
+ rTextRange = basegfx::B2DRange(aTextPos, aTextPos + aTextSiz);
}
// --------------------------------------------------------------------
@@ -1639,111 +1591,145 @@ void SdrTableObj::getCellBounds( const CellPos& rPos, ::Rectangle& rCellRect )
// --------------------------------------------------------------------
-void SdrTableObj::TakeTextAnchorRect(Rectangle& rAnchorRect) const
+basegfx::B2DRange SdrTableObj::getUnifiedTextRange() const
{
- if( mpImpl )
- TakeTextAnchorRect( mpImpl->maEditPos, rAnchorRect );
+ // per default the text range is the whole object range
+ basegfx::B2DRange aRetval(basegfx::B2DRange::getUnitB2DRange());
+
+ if(mpImpl)
+ {
+ basegfx::B2DRange aRange;
+
+ // get the absolute range
+ TakeTextAnchorRangeFromCell(mpImpl->maEditPos, aRange);
+
+ // scale back to unit range, could also be done by using an inverse of object
+ // transformation's simplified scale and translate
+ const double fAbsInvScaleX(basegfx::fTools::equalZero(getSdrObjectScale().getX()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getX()));
+ const double fAbsInvScaleY(basegfx::fTools::equalZero(getSdrObjectScale().getY()) ? 1.0 : 1.0 / fabs(getSdrObjectScale().getY()));
+ const basegfx::B2DPoint aTopLeft(aRange.getMinimum() - getSdrObjectTranslate());
+ const basegfx::B2DPoint aUnitTopLeft(aTopLeft.getX() * fAbsInvScaleX, aTopLeft.getY() * fAbsInvScaleY);
+
+ aRetval = basegfx::B2DRange(
+ aUnitTopLeft,
+ aUnitTopLeft + basegfx::B2DVector(
+ aRange.getWidth() * fAbsInvScaleX,
+ aRange.getHeight() * fAbsInvScaleY));
+ }
+
+ return aRetval;
}
// --------------------------------------------------------------------
-void SdrTableObj::TakeTextAnchorRect( const CellPos& rPos, Rectangle& rAnchorRect ) const
+void SdrTableObj::TakeTextAnchorRangeFromCell( const CellPos& rPos, basegfx::B2DRange& rAnchorRange ) const
{
- Rectangle aAnkRect(aRect);
+ basegfx::B2DRange aAnkRange(sdr::legacy::GetLogicRange(*this));
if( mpImpl )
{
CellRef xCell( mpImpl->getCell( rPos ) );
if( xCell.is() )
- xCell->TakeTextAnchorRect( aAnkRect );
+ {
+ Rectangle aTemp;
+ xCell->TakeCellsTextAnchorRect(aTemp);
+ aAnkRange = basegfx::B2DRange(aTemp.Left(), aTemp.Top(), aTemp.Right(), aTemp.Bottom());
+ }
}
- ImpJustifyRect(aAnkRect);
- rAnchorRect=aAnkRect;
+ rAnchorRange = aAnkRange;
}
// --------------------------------------------------------------------
-void SdrTableObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const
+void SdrTableObj::TakeTextEditArea(basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const
{
- if( mpImpl )
- TakeTextEditArea( mpImpl->maEditPos, pPaperMin, pPaperMax, pViewInit, pViewMin );
+ if(mpImpl)
+ {
+ TakeTextEditArea(mpImpl->maEditPos, pPaperMin, pPaperMax, pViewInit, pViewMin);
+ }
}
// --------------------------------------------------------------------
-void SdrTableObj::TakeTextEditArea( const CellPos& rPos, Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin ) const
+void SdrTableObj::TakeTextEditArea(const CellPos& rPos, basegfx::B2DVector* pPaperMin, basegfx::B2DVector* pPaperMax, basegfx::B2DRange* pViewInit, basegfx::B2DRange* pViewMin) const
{
- Size aPaperMin,aPaperMax;
- Rectangle aViewInit;
- TakeTextAnchorRect( rPos, aViewInit );
+ basegfx::B2DVector aPaperMin;
+ basegfx::B2DVector aPaperMax;
+ basegfx::B2DRange aViewInit;
+
+ TakeTextAnchorRangeFromCell(rPos, aViewInit);
- Size aAnkSiz(aViewInit.GetSize());
- aAnkSiz.Width()--; aAnkSiz.Height()--; // weil GetSize() ein draufaddiert
+ basegfx::B2DVector aAnkSiz(aViewInit.getRange());
+ basegfx::B2DVector aMaxSiz(aAnkSiz.getX(), 1000000.0);
- Size aMaxSiz(aAnkSiz.Width(),1000000);
- if (pModel!=NULL)
+ if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getY()))
{
- Size aTmpSiz(pModel->GetMaxObjSize());
- if (aTmpSiz.Height()!=0)
- aMaxSiz.Height()=aTmpSiz.Height();
+ aMaxSiz.setY(getSdrModelFromSdrObject().GetMaxObjectScale().getY());
}
CellRef xCell( mpImpl->getCell( rPos ) );
SdrTextVertAdjust eVAdj = xCell.is() ? xCell->GetTextVerticalAdjust() : SDRTEXTVERTADJUST_TOP;
-// SdrTextHorzAdjust eHAdj = xCell.is() ? xCell->GetTextHorizontalAdjust() : SDRTEXTHORZADJUST_LEFT;
- aPaperMax=aMaxSiz;
+ aPaperMax = aMaxSiz;
+ aPaperMin.setX(aAnkSiz.getX());
-// if((SDRTEXTHORZADJUST_BLOCK == eHAdj && !IsVerticalWriting()) || (SDRTEXTVERTADJUST_BLOCK == eVAdj && IsVerticalWriting()))
- aPaperMin.Width() = aAnkSiz.Width();
-
- if (pViewMin!=NULL)
+ if(pViewMin)
{
- *pViewMin=aViewInit;
-/*
- long nXFree=aAnkSiz.Width()-aPaperMin.Width();
-
- if (eHAdj==SDRTEXTHORZADJUST_LEFT)
- {
- pViewMin->Right()-=nXFree;
- }
- else if (eHAdj==SDRTEXTHORZADJUST_RIGHT)
- {
- pViewMin->Left()+=nXFree;
- }
- else
- {
- pViewMin->Left()+=nXFree/2;
- pViewMin->Right()=pViewMin->Left()+aPaperMin.Width();
- }
-*/
- long nYFree=aAnkSiz.Height()-aPaperMin.Height();
+ *pViewMin = aViewInit;
+ const double fYFree(aAnkSiz.getY() - aPaperMin.getY());
- if (eVAdj==SDRTEXTVERTADJUST_TOP)
+ if(SDRTEXTVERTADJUST_TOP == eVAdj)
{
- pViewMin->Bottom()-=nYFree;
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY(),
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY() - fYFree);
}
- else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM)
+ else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
{
- pViewMin->Top()+=nYFree;
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ pViewMin->getMinY() + fYFree,
+ pViewMin->getMaxX(),
+ pViewMin->getMaxY());
}
else
{
- pViewMin->Top()+=nYFree/2;
- pViewMin->Bottom()=pViewMin->Top()+aPaperMin.Height();
+ const double fNewMinY(pViewMin->getMinY() + (fYFree * 0.5));
+ *pViewMin = basegfx::B2DRange(
+ pViewMin->getMinX(),
+ fNewMinY,
+ pViewMin->getMaxX(),
+ fNewMinY + aPaperMin.getY());
}
}
if(IsVerticalWriting())
- aPaperMin.Width() = 0;
+ {
+ aPaperMin.setX(0.0);
+ }
else
- aPaperMin.Height() = 0;
+ {
+ aPaperMin.setY(0.0);
+ }
- if (pPaperMin!=NULL) *pPaperMin=aPaperMin;
- if (pPaperMax!=NULL) *pPaperMax=aPaperMax;
- if (pViewInit!=NULL) *pViewInit=aViewInit;
+ if(pPaperMin)
+ {
+ *pPaperMin = aPaperMin;
+ }
+
+ if(pPaperMax)
+ {
+ *pPaperMax = aPaperMax;
+ }
+
+ if(pViewInit)
+ {
+ *pViewInit = aViewInit;
+ }
}
// --------------------------------------------------------------------
@@ -1836,12 +1822,12 @@ struct ImplTableShadowPaintInfo
ImplTableShadowPaintInfo( const SfxItemSet& rSet )
{
- const SdrShadowColorItem& rShadColItem = ((const SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR)));
+ const XColorItem& rShadColItem = ((const XColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR)));
maShadowColor = rShadColItem.GetColorValue();
- mnShadowTransparence = ((const SdrShadowTransparenceItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue();
+ mnShadowTransparence = ((const SdrPercentItem&)(rSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue();
- mnXDistance = ((SdrShadowXDistItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue();
- mnYDistance = ((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue();
+ mnXDistance = ((SdrMetricItem&)(rSet.Get(SDRATTR_SHADOWXDIST))).GetValue();
+ mnYDistance = ((SdrMetricItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue();
}
};
@@ -1948,35 +1934,6 @@ void SdrTableObj::TakeObjNamePlural(XubString& rName) const
// --------------------------------------------------------------------
-void SdrTableObj::operator=(const SdrObject& rObj)
-{
- // call parent
- SdrObject::operator=(rObj);
-
- const SdrTableObj* pTableObj = dynamic_cast< const SdrTableObj* >( &rObj );
- if (pTableObj!=NULL)
- {
- TableModelNotifyGuard aGuard( mpImpl ? mpImpl->mxTable.get() : 0 );
-
- maLogicRect = pTableObj->maLogicRect;
- aRect = pTableObj->aRect;
- aGeo = pTableObj->aGeo;
- eTextKind = pTableObj->eTextKind;
- bTextFrame = pTableObj->bTextFrame;
- aTextSize = pTableObj->aTextSize;
- bTextSizeDirty = pTableObj->bTextSizeDirty;
- bNoShear = pTableObj->bNoShear;
- bNoRotate = pTableObj->bNoRotate;
- bNoMirror = pTableObj->bNoMirror;
- bDisableAutoWidthOnDragging = pTableObj->bDisableAutoWidthOnDragging;
-
- if( pTableObj->mpImpl )
- *mpImpl = *pTableObj->mpImpl;
- }
-}
-
-// --------------------------------------------------------------------
-
basegfx::B2DPolyPolygon SdrTableObj::TakeXorPoly() const
{
return SdrTextObj::TakeXorPoly();
@@ -1984,99 +1941,77 @@ basegfx::B2DPolyPolygon SdrTableObj::TakeXorPoly() const
// --------------------------------------------------------------------
-basegfx::B2DPolyPolygon SdrTableObj::TakeContour() const
-{
- return SdrTextObj::TakeContour();
-}
-
-// --------------------------------------------------------------------
-
-const Rectangle& SdrTableObj::GetSnapRect() const
+sal_uInt32 SdrTableObj::GetSnapPointCount() const
{
- return aRect;
+ return SdrTextObj::GetSnapPointCount();
}
// --------------------------------------------------------------------
-void SdrTableObj::NbcSetSnapRect(const Rectangle& rRect)
-{
- NbcSetLogicRect( rRect );
-}
-
-// --------------------------------------------------------------------
-const Rectangle& SdrTableObj::GetLogicRect() const
+basegfx::B2DPoint SdrTableObj::GetSnapPoint(sal_uInt32 i) const
{
- return maLogicRect;
+ return SdrTextObj::GetSnapPoint(i);
}
// --------------------------------------------------------------------
-void SdrTableObj::RecalcSnapRect()
+bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl)
{
-}
+ if( pEdtOutl != NULL )
+ return sal_False;
-// --------------------------------------------------------------------
+ pEdtOutl = &rOutl;
+ mbInEditMode = true;
-sal_uInt32 SdrTableObj::GetSnapPointCount() const
-{
- return SdrTextObj::GetSnapPointCount();
-}
+ rOutl.Init( OUTLINERMODE_TEXTOBJECT );
+ rOutl.SetRefDevice( getSdrModelFromSdrObject().GetReferenceDevice() );
-// --------------------------------------------------------------------
+ {
+ const bool bUpdMerk(rOutl.GetUpdateMode());
+ if(bUpdMerk)
+ {
+ rOutl.SetUpdateMode(false);
+ }
-Point SdrTableObj::GetSnapPoint(sal_uInt32 i) const
-{
- return SdrTextObj::GetSnapPoint(i);
-}
+ basegfx::B2DVector aPaperMin;
+ basegfx::B2DVector aPaperMax;
+// basegfx::B2DRange aEditArea; // TTTT: unused, check if calculation changes when removing
-// --------------------------------------------------------------------
+// TakeTextEditArea(&aPaperMin, &aPaperMax, &aEditArea, 0);
+ TakeTextEditArea(&aPaperMin, &aPaperMax, 0, 0);
-sal_Bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl)
-{
- if( pEdtOutl != NULL )
- return sal_False;
+ const Size aPaperMinSize(basegfx::fround(aPaperMin.getX()), basegfx::fround(aPaperMin.getY()));
+ const Size aPaperMaxSize(basegfx::fround(aPaperMax.getX()), basegfx::fround(aPaperMax.getY()));
- pEdtOutl=&rOutl;
+ rOutl.SetMinAutoPaperSize(aPaperMinSize);
+ rOutl.SetMaxAutoPaperSize(aPaperMaxSize);
+ rOutl.SetPaperSize(aPaperMaxSize);
-// ForceOutlinerParaObject();
+ if(bUpdMerk)
+ {
+ rOutl.SetUpdateMode(true);
+ }
+ }
- mbInEditMode = sal_True;
+ sal_uIntPtr nStat(rOutl.GetControlWord());
+// nStat &= ~EE_CNTRL_AUTOPAGESIZE;
+ nStat |= EE_CNTRL_AUTOPAGESIZE;
+ nStat &= ~EE_CNTRL_STRETCHING;
- rOutl.Init( OUTLINERMODE_TEXTOBJECT );
- rOutl.SetRefDevice( pModel->GetRefDevice() );
-
-// --
- FASTBOOL bUpdMerk=rOutl.GetUpdateMode();
- if (bUpdMerk) rOutl.SetUpdateMode(sal_False);
- Size aPaperMin;
- Size aPaperMax;
- Rectangle aEditArea;
- TakeTextEditArea(&aPaperMin,&aPaperMax,&aEditArea,NULL);
-
- rOutl.SetMinAutoPaperSize(aPaperMin);
- rOutl.SetMaxAutoPaperSize(aPaperMax);
- rOutl.SetPaperSize(aPaperMax);
-
- if (bUpdMerk) rOutl.SetUpdateMode(sal_True);
-//---
-
- sal_uIntPtr nStat=rOutl.GetControlWord();
-// nStat &= ~EE_CNTRL_AUTOPAGESIZE;
- nStat |= EE_CNTRL_AUTOPAGESIZE;
- nStat &=~EE_CNTRL_STRETCHING;
rOutl.SetControlWord(nStat);
OutlinerParaObject* pPara = GetOutlinerParaObject();
+
if(pPara)
+ {
rOutl.SetText(*pPara);
+ }
rOutl.UpdateFields();
rOutl.ClearModifyFlag();
-// mpImpl->mnSavedEditRowHeight = mpImpl->mpLayouter->getRowHeight( mpImpl->maEditPos.mnRow );
-
return sal_True;
}
@@ -2086,8 +2021,10 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
{
if(rOutl.IsModified())
{
- if( GetModel() && GetModel()->IsUndoEnabled() )
- GetModel()->AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*this) );
+ if( getSdrModelFromSdrObject().IsUndoEnabled() )
+ {
+ getSdrModelFromSdrObject().AddUndo( getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoGeoObject(*this) );
+ }
OutlinerParaObject* pNewText = 0;
Paragraph* p1stPara = rOutl.GetParagraph( 0 );
@@ -2125,7 +2062,7 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
nStat &= ~EE_CNTRL_AUTOPAGESIZE;
rOutl.SetControlWord(nStat);
- mbInEditMode = sal_False;
+ mbInEditMode = false;
}
// --------------------------------------------------------------------
@@ -2141,137 +2078,106 @@ OutlinerParaObject* SdrTableObj::GetOutlinerParaObject() const
// --------------------------------------------------------------------
-void SdrTableObj::NbcSetOutlinerParaObject( OutlinerParaObject* pTextObject)
+void SdrTableObj::SetOutlinerParaObject( OutlinerParaObject* pTextObject)
{
CellRef xCell( getActiveCell() );
if( xCell.is() )
{
- if( pModel )
- {
- // Update HitTestOutliner
- const SdrTextObj* pTestObj = pModel->GetHitTestOutliner().GetTextObj();
- if( pTestObj && pTestObj->GetOutlinerParaObject() == xCell->GetOutlinerParaObject() )
- pModel->GetHitTestOutliner().SetTextObj( NULL );
- }
-
xCell->SetOutlinerParaObject( pTextObject );
-
SetTextSizeDirty();
- NbcAdjustTextFrameWidthAndHeight();
-// ImpSetTextStyleSheetListeners();
-// ImpCheckMasterCachable();
+ AdjustTextFrameWidthAndHeight();
}
}
// --------------------------------------------------------------------
-void SdrTableObj::NbcSetLogicRect(const Rectangle& rRect)
+void SdrTableObj::AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool /* bShrinkOnly = false */ )
{
- maLogicRect=rRect;
- ImpJustifyRect(maLogicRect);
- const bool bWidth = maLogicRect.getWidth() != aRect.getWidth();
- const bool bHeight = maLogicRect.getHeight() != aRect.getHeight();
- aRect=maLogicRect;
- NbcAdjustTextFrameWidthAndHeight( !bHeight, !bWidth );
- SetRectsDirty();
-}
-
-
-// --------------------------------------------------------------------
+ const double fMyHeight(fabs(getSdrObjectScale().getY()));
+ const basegfx::B2DRange aAdjustRange(
+ rMaxRange.getMinX(),
+ rMaxRange.getMinY(),
+ rMaxRange.getMaxX(),
+ rMaxRange.getMinY() + fMyHeight);
-void SdrTableObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool /* bShrinkOnly = false */ )
-{
- Rectangle aAdjustRect( rMaxRect );
- aAdjustRect.setHeight( GetLogicRect().getHeight() );
- SetLogicRect( aAdjustRect );
+ sdr::legacy::SetLogicRange(*this, aAdjustRange);
}
// --------------------------------------------------------------------
-void SdrTableObj::NbcMove(const Size& rSiz)
+void SdrTableObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- MoveRect(maLogicRect,rSiz);
- SdrTextObj::NbcMove( rSiz );
- if( mpImpl )
- mpImpl->UpdateCells( aRect );
-}
+ // remember original scaling
+ const basegfx::B2DVector aScaleBefore(basegfx::absolute(getSdrObjectScale()));
-// --------------------------------------------------------------------
+ // call parent
+ SdrTextObj::setSdrObjectTransformation(rTransformation);
-void SdrTableObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
-{
- Rectangle aOldRect( maLogicRect );
- ResizeRect(maLogicRect,rRef,xFact,yFact);
+ // get new scaling
+ const basegfx::B2DVector aNewSize(basegfx::absolute(getSdrObjectScale()));
- aRect = maLogicRect;
- NbcAdjustTextFrameWidthAndHeight( maLogicRect.GetHeight() == aOldRect.GetHeight(), maLogicRect.GetWidth() == aOldRect.GetWidth() );
- SetRectsDirty();
+ if(!aScaleBefore.equal(aNewSize))
+ {
+ // react on scale change
+ AdjustTextFrameWidthAndHeight(
+ basegfx::fTools::equal(aScaleBefore.getY(), aNewSize.getY()),
+ basegfx::fTools::equal(aScaleBefore.getX(), aNewSize.getX()));
+ }
+
+ if( mpImpl )
+ {
+ Rectangle aRectangle(sdr::legacy::GetLogicRect(*this));
+ mpImpl->UpdateCells( aRectangle );
+ }
}
// --------------------------------------------------------------------
-FASTBOOL SdrTableObj::AdjustTextFrameWidthAndHeight(FASTBOOL bHgt, FASTBOOL bWdt)
+bool SdrTableObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
- Rectangle aNeuRect(maLogicRect);
- FASTBOOL bRet=AdjustTextFrameWidthAndHeight(aNeuRect,bHgt,bWdt);
- if (bRet)
+ const basegfx::B2DRange aOldRange(getSdrObjectTranslate(), getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+ const basegfx::B2DRange aNewRange(AdjustTextFrameWidthAndHeight(aOldRange, bHgt, bWdt));
+
+ if(!aOldRange.equal(aNewRange))
{
- Rectangle aBoundRect0;
- if (pUserCall!=NULL)
- aBoundRect0=GetLastBoundRect();
- aRect=aNeuRect;
- SetRectsDirty();
- SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
+ sdr::legacy::SetLogicRange(*this, aNewRange);
+
+ return true;
}
- return bRet;
+
+ return false;
}
// --------------------------------------------------------------------
-FASTBOOL SdrTableObj::AdjustTextFrameWidthAndHeight(Rectangle& rR, FASTBOOL bHeight, FASTBOOL bWidth) const
+basegfx::B2DRange SdrTableObj::AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHeight, bool bWidth) const
{
- if((pModel == NULL) || rR.IsEmpty() || !mpImpl || !mpImpl->mxTable.is() )
- return sal_False;
-
- Rectangle aRectangle( rR );
- mpImpl->LayoutTable( aRectangle, !bWidth, !bHeight );
-
- if( aRectangle != rR )
+ if(rRange.isEmpty() || !mpImpl || !mpImpl->mxTable.is())
{
- rR = aRectangle;
- return sal_True;
+ // no change
+ return rRange;
}
else
{
- return sal_False;
- }
-}
-
-// --------------------------------------------------------------------
+ basegfx::B2DRange aNewRange(rRange);
-void SdrTableObj::NbcReformatText()
-{
- NbcAdjustTextFrameWidthAndHeight();
+ mpImpl->LayoutTable(aNewRange, !bWidth, !bHeight);
+ return aNewRange;
+ }
}
// --------------------------------------------------------------------
void SdrTableObj::ReformatText()
{
- Rectangle aBoundRect0;
- if (pUserCall!=NULL)
- aBoundRect0=GetLastBoundRect();
- NbcReformatText();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ AdjustTextFrameWidthAndHeight();
SetChanged();
- BroadcastObjectChange();
- SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}
// --------------------------------------------------------------------
-sal_Bool SdrTableObj::IsVerticalWriting() const
+bool SdrTableObj::IsVerticalWriting() const
{
const SvxWritingModeItem* pModeItem = dynamic_cast< const SvxWritingModeItem* >( &GetObjectItem( SDRATTR_TEXTDIRECTION ) );
return pModeItem && pModeItem->GetValue() == com::sun::star::text::WritingMode_TB_RL;
@@ -2279,7 +2185,7 @@ sal_Bool SdrTableObj::IsVerticalWriting() const
// --------------------------------------------------------------------
-void SdrTableObj::SetVerticalWriting(sal_Bool bVertical )
+void SdrTableObj::SetVerticalWriting(bool bVertical )
{
if( bVertical != IsVerticalWriting() )
{
@@ -2300,25 +2206,6 @@ WritingMode SdrTableObj::GetWritingMode() const
// --------------------------------------------------------------------
-// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
-// with the base geometry and returns TRUE. Otherwise it returns FALSE.
-sal_Bool SdrTableObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon ) const
-{
- return SdrTextObj::TRGetBaseGeometry( rMatrix, rPolyPolygon );
-}
-
-// --------------------------------------------------------------------
-
-// sets the base geometry of the object using infos contained in the homogen 3x3 matrix.
-// If it's an SdrPathObj it will use the provided geometry information. The Polygon has
-// to use (0,0) as upper left and will be scaled to the given size in the matrix.
-void SdrTableObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon )
-{
- SdrTextObj::TRSetBaseGeometry( rMatrix, rPolyPolygon );
-}
-
-// --------------------------------------------------------------------
-
bool SdrTableObj::IsRealyEdited() const
{
return pEdtOutl && pEdtOutl->IsModified();
@@ -2326,23 +2213,9 @@ bool SdrTableObj::IsRealyEdited() const
// --------------------------------------------------------------------
-FASTBOOL SdrTableObj::IsFontwork() const
-{
- return sal_False;
-}
-
-// --------------------------------------------------------------------
-
-sal_uInt32 SdrTableObj::GetHdlCount() const
+bool SdrTableObj::IsFontwork() const
{
- sal_uInt32 nCount = SdrTextObj::GetHdlCount();
- const sal_Int32 nRowCount = mpImpl->getRowCount();
- const sal_Int32 nColCount = mpImpl->getColumnCount();
-
- if( nRowCount && nColCount )
- nCount += nRowCount + nColCount + 2 + 1;
-
- return nCount;
+ return false;
}
// --------------------------------------------------------------------
@@ -2362,12 +2235,11 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
nEdgeMin -= nEdge;
nEdgeMax -= nEdge;
- Point aPoint( aRect.TopLeft() );
- aPoint.Y() += nEdge;
+ basegfx::B2DPoint aObjectTopLeft(getSdrObjectTranslate());
+ aObjectTopLeft.setY(aObjectTopLeft.getY() + nEdge);
- TableEdgeHdl* pHdl= new TableEdgeHdl(aPoint,true,nEdgeMin,nEdgeMax,nColCount+1);
+ TableEdgeHdl* pHdl = new TableEdgeHdl(rHdlList, *this, aObjectTopLeft, true, nEdgeMin, nEdgeMax, nColCount + 1);
pHdl->SetPointNum( nRow );
- rHdlList.AddHdl( pHdl );
aRowEdges[nRow] = pHdl;
}
@@ -2381,12 +2253,11 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
nEdgeMin -= nEdge;
nEdgeMax -= nEdge;
- Point aPoint( aRect.TopLeft() );
- aPoint.X() += nEdge;
+ basegfx::B2DPoint aObjectTopLeft(getSdrObjectTranslate());
+ aObjectTopLeft.setX(aObjectTopLeft.getX() + nEdge);
- TableEdgeHdl* pHdl = new TableEdgeHdl(aPoint,false,nEdgeMin,nEdgeMax, nRowCount+1);
+ TableEdgeHdl* pHdl = new TableEdgeHdl(rHdlList, *this, aObjectTopLeft, false, nEdgeMin, nEdgeMax, nRowCount + 1);
pHdl->SetPointNum( nCol );
- rHdlList.AddHdl( pHdl );
aColEdges[nCol] = pHdl;
}
@@ -2425,45 +2296,18 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
}
}
- // add remaining handles
- SdrHdl* pH=0;
- rHdlList.AddHdl( pH = new TableBorderHdl( aRect ) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.TopLeft(),HDL_UPLFT) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.TopCenter(),HDL_UPPER) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.TopRight(),HDL_UPRGT) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.LeftCenter(),HDL_LEFT) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.RightCenter(),HDL_RIGHT) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.BottomLeft(),HDL_LWLFT) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.BottomCenter(),HDL_LOWER) ); pH->SetMoveOutside( true );
- rHdlList.AddHdl( pH = new SdrHdl(aRect.BottomRight(),HDL_LWRGT) ); pH->SetMoveOutside( true );
-
- sal_uIntPtr nHdlCount = rHdlList.GetHdlCount();
- for( sal_uIntPtr nHdl = 0; nHdl < nHdlCount; nHdl++ )
- rHdlList.GetHdl(nHdl)->SetObj((SdrObject*)this);
-}
-
-// --------------------------------------------------------------------
-
-SdrHdl* SdrTableObj::GetHdl(sal_uInt32 nHdlNum) const
-{
- // #i73248#
- // Warn the user that this is ineffective and show alternatives. Should not be used at all.
- OSL_ENSURE(false, "SdrTableObj::GetHdl(): ineffective, use AddToHdlList instead (!)");
-
- // to have an alternative, get single handle using the ineffective way
- SdrHdl* pRetval = 0;
- SdrHdlList aLocalList(0);
- AddToHdlList(aLocalList);
- const sal_uInt32 nHdlCount(aLocalList.GetHdlCount());
+ // add standard object handles from SdrTextObj
+ // add handles from parent and remember their range
+ const sal_uInt32 nStartMoveOutside(rHdlList.GetHdlCount());
+ SdrTextObj::AddToHdlList(rHdlList);
+ const sal_uInt32 nHdlCount(rHdlList.GetHdlCount());
- if(nHdlCount && nHdlNum < nHdlCount)
+ for(sal_uInt32 a(nStartMoveOutside); a < nHdlCount; a++)
{
- // remove and remember. The other created handles will be deleted again with the
- // destruction of the local list
- pRetval = aLocalList.RemoveHdl(nHdlNum);
+ // extend information at handles
+ SdrHdl* pCandidate = rHdlList.GetHdlByIndex(a);
+ pCandidate->SetMoveOutside( true );
}
-
- return pRetval;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -2476,7 +2320,7 @@ bool SdrTableObj::hasSpecialDrag() const
bool SdrTableObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
const SdrHdlKind eHdl((pHdl == NULL) ? HDL_MOVE : pHdl->GetKind());
switch( eHdl )
@@ -2513,7 +2357,7 @@ bool SdrTableObj::beginSpecialDrag(SdrDragStat& rDrag) const
bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag)
{
bool bRet(true);
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
const SdrHdlKind eHdl((pHdl == NULL) ? HDL_MOVE : pHdl->GetKind());
switch( eHdl )
@@ -2527,19 +2371,13 @@ bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag)
case HDL_LOWER:
case HDL_LWRGT:
{
- const Rectangle aNewRectangle(ImpDragCalcRect(rDrag));
-
- if(aNewRectangle != aRect)
- {
- NbcSetLogicRect(aNewRectangle);
- }
-
+ bRet = SdrTextObj::applySpecialDrag(rDrag);
break;
}
case HDL_MOVE:
{
- NbcMove( Size( rDrag.GetDX(), rDrag.GetDY() ) );
+ sdr::legacy::MoveSdrObject(*this, Size( rDrag.GetDX(), rDrag.GetDY() ) );
break;
}
@@ -2551,7 +2389,7 @@ bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag)
if( pEdgeHdl )
{
- if( GetModel() && IsInserted() )
+ if( IsObjectInserted() )
{
rDrag.SetEndDragChangesAttributes(true);
}
@@ -2578,7 +2416,7 @@ String SdrTableObj::getSpecialDragComment(const SdrDragStat& rDrag) const
basegfx::B2DPolyPolygon SdrTableObj::getSpecialDragPoly(const SdrDragStat& rDrag) const
{
basegfx::B2DPolyPolygon aRetval;
- const SdrHdl* pHdl = rDrag.GetHdl();
+ const SdrHdl* pHdl = rDrag.GetActiveHdl();
if( pHdl && (HDL_USER == pHdl->GetKind()) )
{
@@ -2593,71 +2431,20 @@ basegfx::B2DPolyPolygon SdrTableObj::getSpecialDragPoly(const SdrDragStat& rDrag
return aRetval;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Create
-// --------------------------------------------------------------------
-
-FASTBOOL SdrTableObj::BegCreate(SdrDragStat& rStat)
-{
- rStat.SetOrtho4Possible();
- Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
- aRect1.Justify();
- rStat.SetActionRect(aRect1);
- aRect = aRect1;
- return sal_True;
-}
-
-// --------------------------------------------------------------------
-
-FASTBOOL SdrTableObj::MovCreate(SdrDragStat& rStat)
-{
- Rectangle aRect1;
- rStat.TakeCreateRect(aRect1);
- ImpJustifyRect(aRect1);
- rStat.SetActionRect(aRect1);
- aRect=aRect1; // fuer ObjName
- SetBoundRectDirty();
- bSnapRectDirty=sal_True;
- return sal_True;
-}
-
-// --------------------------------------------------------------------
-
-FASTBOOL SdrTableObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
-{
- rStat.TakeCreateRect(aRect);
- ImpJustifyRect(aRect);
- return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2);
-}
-
void SdrTableObj::BrkCreate(SdrDragStat& /*rStat*/)
{
}
// --------------------------------------------------------------------
-FASTBOOL SdrTableObj::BckCreate(SdrDragStat& /*rStat*/)
-{
- return sal_True;
-}
-
-// --------------------------------------------------------------------
-
-basegfx::B2DPolyPolygon SdrTableObj::TakeCreatePoly(const SdrDragStat& rDrag) const
+bool SdrTableObj::BckCreate(SdrDragStat& /*rStat*/)
{
- Rectangle aRect1;
- rDrag.TakeCreateRect(aRect1);
- aRect1.Justify();
-
- basegfx::B2DPolyPolygon aRetval;
- const basegfx::B2DRange aRange(aRect1.Left(), aRect1.Top(), aRect1.Right(), aRect1.Bottom());
- aRetval.append(basegfx::tools::createPolygonFromRect(aRange));
- return aRetval;
+ return true;
}
// --------------------------------------------------------------------
-Pointer SdrTableObj::GetCreatePointer() const
+Pointer SdrTableObj::GetCreatePointer(const SdrView& /*rSdrView*/) const
{
return Pointer(POINTER_CROSS);
}
@@ -2671,44 +2458,16 @@ void SdrTableObj::createCell( CellRef& xNewCell )
// --------------------------------------------------------------------
-SdrObjGeoData *SdrTableObj::NewGeoData() const
-{
- return new TableObjectGeoData;
-}
-
-// --------------------------------------------------------------------
-
-void SdrTableObj::SaveGeoData(SdrObjGeoData& rGeo) const
-{
- DBG_ASSERT( dynamic_cast< TableObjectGeoData* >( &rGeo ), "svx::SdrTableObj::SaveGeoData(), illegal geo data!" );
- SdrTextObj::SaveGeoData (rGeo);
-
- ((TableObjectGeoData &) rGeo).maLogicRect = maLogicRect;
-}
-
-// --------------------------------------------------------------------
-
-void SdrTableObj::RestGeoData(const SdrObjGeoData& rGeo)
-{
- DBG_ASSERT( dynamic_cast< const TableObjectGeoData* >( &rGeo ), "svx::SdrTableObj::SaveGeoData(), illegal geo data!" );
-
- maLogicRect = ((TableObjectGeoData &) rGeo).maLogicRect;
-
- SdrTextObj::RestGeoData (rGeo);
-
- if( mpImpl )
- mpImpl->LayoutTable( aRect, false, false );
- ActionChanged();
-}
-
-// --------------------------------------------------------------------
-
SdrTableObj* SdrTableObj::CloneRange( const CellPos& rStart, const CellPos& rEnd )
{
const sal_Int32 nColumns = rEnd.mnCol - rStart.mnCol + 1;
const sal_Int32 nRows = rEnd.mnRow - rStart.mnRow + 1;
- SdrTableObj* pNewTableObj = new SdrTableObj( GetModel(), GetCurrentBoundRect(), nColumns, nRows);
+ SdrTableObj* pNewTableObj = new SdrTableObj(
+ getSdrModelFromSdrObject(),
+ getSdrObjectTransformation(),
+ nColumns,
+ nRows);
pNewTableObj->setTableStyleSettings( getTableStyleSettings() );
pNewTableObj->setTableStyle( getTableStyle() );
@@ -2754,8 +2513,10 @@ SdrTableObj* SdrTableObj::CloneRange( const CellPos& rStart, const CellPos& rEnd
xNewSet->setPropertyValue( sWidth, Any( mpImpl->mpLayouter->getColumnWidth( rStart.mnCol + nCol ) ) );
}
- pNewTableObj->NbcReformatText();
- pNewTableObj->SetLogicRect( pNewTableObj->GetCurrentBoundRect() );
+ pNewTableObj->ReformatText();
+
+ // TTTT: Needed? Check...
+ sdr::legacy::SetLogicRange(*pNewTableObj, pNewTableObj->getObjectRange(0) );
return pNewTableObj;
}
@@ -2767,7 +2528,11 @@ void SdrTableObj::DistributeColumns( sal_Int32 nFirstColumn, sal_Int32 nLastColu
if( mpImpl && mpImpl->mpLayouter )
{
TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
- mpImpl->mpLayouter->DistributeColumns( aRect, nFirstColumn, nLastColumn );
+ basegfx::B2DRange aObjectRange(
+ getSdrObjectTranslate(),
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+
+ mpImpl->mpLayouter->DistributeColumns( aObjectRange, nFirstColumn, nLastColumn );
}
}
@@ -2778,7 +2543,11 @@ void SdrTableObj::DistributeRows( sal_Int32 nFirstRow, sal_Int32 nLastRow )
if( mpImpl && mpImpl->mpLayouter )
{
TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
- mpImpl->mpLayouter->DistributeRows( aRect, nFirstRow, nLastRow );
+ basegfx::B2DRange aObjectRange(
+ getSdrObjectTranslate(),
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+
+ mpImpl->mpLayouter->DistributeRows( aObjectRange, nFirstRow, nLastRow );
}
}
@@ -2789,7 +2558,13 @@ void SdrTableObj::SetChanged()
if( mpImpl )
{
if( mpImpl->UpdateWritingMode() )
- mpImpl->LayoutTable( aRect, false, false );
+ {
+ basegfx::B2DRange aObjectRange(
+ getSdrObjectTranslate(),
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+
+ mpImpl->LayoutTable( aObjectRange, false, false );
+ }
}
::SdrTextObj::SetChanged();
diff --git a/svx/source/table/tablecolumn.cxx b/svx/source/table/tablecolumn.cxx
index ce1085fea752..13fe29ef49df 100644
--- a/svx/source/table/tablecolumn.cxx
+++ b/svx/source/table/tablecolumn.cxx
@@ -153,11 +153,10 @@ void SAL_CALL TableColumn::setFastPropertyValue( sal_Int32 nHandle, const Any& a
{
bool bOk = false;
bool bChange = false;
-
- SdrModel* pModel = mxTableModel->getSdrTableObj()->GetModel();
+ SdrModel& rModel = mxTableModel->getSdrTableObj()->getSdrModelFromSdrObject();
TableColumnUndo* pUndo = 0;
- if( mxTableModel.is() && mxTableModel->getSdrTableObj() && mxTableModel->getSdrTableObj()->IsInserted() && pModel && pModel->IsUndoEnabled() )
+ if( mxTableModel.is() && mxTableModel->getSdrTableObj() && mxTableModel->getSdrTableObj()->IsObjectInserted() && rModel.IsUndoEnabled() )
{
TableColumnRef xThis( this );
pUndo = new TableColumnUndo( xThis );
@@ -223,7 +222,7 @@ void SAL_CALL TableColumn::setFastPropertyValue( sal_Int32 nHandle, const Any& a
{
if( pUndo )
{
- pModel->AddUndo( pUndo );
+ rModel.AddUndo( pUndo );
pUndo = 0;
}
mxTableModel->setModified(sal_True);
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 19b2ecc8adcb..4dae11e839a7 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -152,7 +152,7 @@ SvxTableController::SvxTableController( SdrObjEditView* pView, const SdrObject*
, mnUpdateEvent( 0 )
{
if( pObj )
- mpModel = pObj->GetModel();
+ mpModel = &pObj->getSdrModelFromSdrObject();
if( mxTableObj.is() )
{
@@ -258,7 +258,8 @@ bool SvxTableController::onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin
if( !rMEvt.IsRight() && mpView->PickAnything(rMEvt,SDRMOUSEBUTTONDOWN, aVEvt) == SDRHIT_HANDLE )
return false;
- TableHitKind eHit = static_cast< SdrTableObj* >(mxTableObj.get())->CheckTableHit( pWindow->PixelToLogic(rMEvt.GetPosPixel()), maMouseDownPos.mnCol, maMouseDownPos.mnRow, 0 );
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+ TableHitKind eHit = static_cast< SdrTableObj* >(mxTableObj.get())->CheckTableHit( aLogicPos, maMouseDownPos.mnCol, maMouseDownPos.mnRow, 0 );
mbLeftButtonDown = (rMEvt.GetClicks() == 1) && rMEvt.IsLeft();
@@ -276,10 +277,8 @@ bool SvxTableController::onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin
{
RemoveSelection();
- Point aPnt(rMEvt.GetPosPixel());
- if (pWindow!=NULL)
- aPnt=pWindow->PixelToLogic(aPnt);
-
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aPnt(pWindow ? pWindow->GetInverseViewTransformation() * aPixelPos : aPixelPos);
SdrHdl* pHdl = mpView->PickHandle(aPnt);
if( pHdl )
@@ -330,7 +329,9 @@ bool SvxTableController::onMouseMove(const MouseEvent& rMEvt, Window* pWindow )
SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >( mxTableObj.get() );
CellPos aPos;
- if( mbLeftButtonDown && pTableObj && pTableObj->CheckTableHit( pWindow->PixelToLogic(rMEvt.GetPosPixel()), aPos.mnCol, aPos.mnRow, 0 ) != SDRTABLEHIT_NONE )
+ const basegfx::B2DPoint aLogicPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y()));
+
+ if( mbLeftButtonDown && pTableObj && pTableObj->CheckTableHit( aLogicPos, aPos.mnCol, aPos.mnRow, 0 ) != SDRTABLEHIT_NONE )
{
if(aPos != maMouseDownPos)
{
@@ -358,8 +359,8 @@ bool SvxTableController::onMouseMove(const MouseEvent& rMEvt, Window* pWindow )
void SvxTableController::onSelectionHasChanged()
{
bool bSelected = false;
-
SdrTableObj* pTableObj = dynamic_cast< SdrTableObj* >( mxTableObj.get() );
+
if( pTableObj && pTableObj->IsTextEditActive() )
{
pTableObj->getActiveCellPos( maCursorFirstPos );
@@ -368,9 +369,7 @@ void SvxTableController::onSelectionHasChanged()
}
else
{
- const SdrMarkList& rMarkList= mpView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
- bSelected = mxTableObj.get() == rMarkList.GetMark(0)->GetMarkedSdrObj();
+ bSelected = (mxTableObj.get() == dynamic_cast< SdrTableObj* >(mpView->getSelectedIfSingle()));
}
if( bSelected )
@@ -387,7 +386,7 @@ void SvxTableController::onSelectionHasChanged()
void SvxTableController::GetState( SfxItemSet& rSet )
{
- if( !mxTable.is() || !mxTableObj.is() || !mxTableObj->GetModel() )
+ if( !mxTable.is() || !mxTableObj.is() )
return;
SfxItemSet* pSet = 0;
@@ -405,7 +404,7 @@ void SvxTableController::GetState( SfxItemSet& rSet )
case SID_TABLE_VERT_CENTER:
case SID_TABLE_VERT_NONE:
{
- if( !mxTable.is() || !mxTableObj->GetModel() )
+ if( !mxTable.is() )
{
rSet.DisableItem(nWhich);
}
@@ -413,7 +412,7 @@ void SvxTableController::GetState( SfxItemSet& rSet )
{
if( !pSet )
{
- pSet = new SfxItemSet( mxTableObj->GetModel()->GetItemPool() );
+ pSet = new SfxItemSet( mxTableObj->getSdrModelFromSdrObject().GetItemPool() );
MergeAttrFromSelectedCells(*pSet, sal_False);
}
@@ -715,21 +714,21 @@ void SvxTableController::onFormatTable( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
- if( !pArgs && pTableObj->GetModel() )
+ if( !pArgs )
{
- SfxItemSet aNewAttr( pTableObj->GetModel()->GetItemPool() );
+ SfxItemSet aNewAttr( pTableObj->getSdrModelFromSdrObject().GetItemPool() );
MergeAttrFromSelectedCells(aNewAttr, sal_False);
// merge drawing layer text distance items into SvxBoxItem used by the dialog
SvxBoxItem aBoxItem( static_cast< const SvxBoxItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER ) ) );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrTextLeftDistItem&)(aNewAttr.Get(SDRATTR_TEXT_LEFTDIST))).GetValue()), BOX_LINE_LEFT );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrTextRightDistItem&)(aNewAttr.Get(SDRATTR_TEXT_RIGHTDIST))).GetValue()), BOX_LINE_RIGHT );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrTextUpperDistItem&)(aNewAttr.Get(SDRATTR_TEXT_UPPERDIST))).GetValue()), BOX_LINE_TOP );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrTextLowerDistItem&)(aNewAttr.Get(SDRATTR_TEXT_LOWERDIST))).GetValue()), BOX_LINE_BOTTOM );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_LEFTDIST))).GetValue()), BOX_LINE_LEFT );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_RIGHTDIST))).GetValue()), BOX_LINE_RIGHT );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_UPPERDIST))).GetValue()), BOX_LINE_TOP );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_LOWERDIST))).GetValue()), BOX_LINE_BOTTOM );
aNewAttr.Put( aBoxItem );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::auto_ptr< SfxAbstractTabDialog > pDlg( pFact ? pFact->CreateSvxFormatCellsDialog( NULL, &aNewAttr, pTableObj->GetModel(), pTableObj) : 0 );
+ std::auto_ptr< SfxAbstractTabDialog > pDlg( pFact ? pFact->CreateSvxFormatCellsDialog( NULL, &aNewAttr, &pTableObj->getSdrModelFromSdrObject(), pTableObj) : 0 );
if( pDlg.get() && pDlg->Execute() )
{
SfxItemSet aNewSet( *(pDlg->GetOutputItemSet ()) );
@@ -737,16 +736,16 @@ void SvxTableController::onFormatTable( SfxRequest& rReq )
SvxBoxItem aNewBoxItem( static_cast< const SvxBoxItem& >( aNewSet.Get( SDRATTR_TABLE_BORDER ) ) );
if( aNewBoxItem.GetDistance( BOX_LINE_LEFT ) != aBoxItem.GetDistance( BOX_LINE_LEFT ) )
- aNewSet.Put(SdrTextLeftDistItem( aNewBoxItem.GetDistance( BOX_LINE_LEFT ) ) );
+ aNewSet.Put(SdrMetricItem(SDRATTR_TEXT_LEFTDIST, aNewBoxItem.GetDistance( BOX_LINE_LEFT ) ) );
if( aNewBoxItem.GetDistance( BOX_LINE_RIGHT ) != aBoxItem.GetDistance( BOX_LINE_RIGHT ) )
- aNewSet.Put(SdrTextRightDistItem( aNewBoxItem.GetDistance( BOX_LINE_RIGHT ) ) );
+ aNewSet.Put(SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, aNewBoxItem.GetDistance( BOX_LINE_RIGHT ) ) );
if( aNewBoxItem.GetDistance( BOX_LINE_TOP ) != aBoxItem.GetDistance( BOX_LINE_TOP ) )
- aNewSet.Put(SdrTextUpperDistItem( aNewBoxItem.GetDistance( BOX_LINE_TOP ) ) );
+ aNewSet.Put(SdrMetricItem(SDRATTR_TEXT_UPPERDIST, aNewBoxItem.GetDistance( BOX_LINE_TOP ) ) );
if( aNewBoxItem.GetDistance( BOX_LINE_BOTTOM ) != aBoxItem.GetDistance( BOX_LINE_BOTTOM ) )
- aNewSet.Put(SdrTextLowerDistItem( aNewBoxItem.GetDistance( BOX_LINE_BOTTOM ) ) );
+ aNewSet.Put(SdrMetricItem(SDRATTR_TEXT_LOWERDIST, aNewBoxItem.GetDistance( BOX_LINE_BOTTOM ) ) );
SetAttrToSelectedCells(aNewSet, sal_False);
}
@@ -837,7 +836,7 @@ void SvxTableController::Execute( SfxRequest& rReq )
void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
{
SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
- SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0;
+ SdrModel* pModel = pTableObj ? &pTableObj->getSdrModelFromSdrObject() : 0;
if( !pTableObj || !pModel || !pArgs || (SFX_ITEM_SET != pArgs->GetItemState(SID_TABLE_STYLE, sal_False)) )
return;
@@ -917,7 +916,7 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
void SvxTableController::SetTableStyleSettings( const SfxItemSet* pArgs )
{
SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
- SdrModel* pModel = pTableObj ? pTableObj->GetModel() : 0;
+ SdrModel* pModel = pTableObj ? &pTableObj->getSdrModelFromSdrObject() : 0;
if( !pTableObj || !pModel )
return;
@@ -1664,9 +1663,9 @@ void SvxTableController::findMergeOrigin( CellPos& rPos )
void SvxTableController::EditCell( const CellPos& rPos, ::Window* pWindow, const awt::MouseEvent* pMouseEvent /*= 0*/, sal_uInt16 nAction /*= ACTION_NONE */ )
{
SdrPageView* pPV = mpView->GetSdrPageView();
-
::sdr::table::SdrTableObj* pTableObj = dynamic_cast< ::sdr::table::SdrTableObj* >( mxTableObj.get() );
- if( pTableObj && pTableObj->GetPage() == pPV->GetPage() )
+
+ if( pTableObj && pPV && pTableObj->getSdrPageFromSdrObject() == &pPV->getSdrPageFromSdrPageView() )
{
bool bEmptyOutliner = false;
@@ -1701,7 +1700,7 @@ void SvxTableController::EditCell( const CellPos& rPos, ::Window* pWindow, const
if( pTableObj->IsVerticalWriting() )
pOutl->SetVertical( sal_True );
- if(mpView->SdrBeginTextEdit(pTableObj, pPV, pWindow, sal_True, pOutl))
+ if(mpView->SdrBeginTextEdit(pTableObj, pWindow, sal_True, pOutl))
{
maCursorLastPos = maCursorFirstPos = rPos;
@@ -1759,8 +1758,8 @@ bool SvxTableController::StopTextEdit()
if(mpView->IsTextEdit())
{
mpView->SdrEndTextEdit();
- mpView->SetCurrentObj(OBJ_TABLE);
- mpView->SetEditMode(SDREDITMODE_EDIT);
+ mpView->setSdrObjectCreationInfo(SdrObjectCreationInfo(static_cast< sal_uInt16 >(OBJ_TABLE)));
+ mpView->SetViewEditMode(SDREDITMODE_EDIT);
return true;
}
else
@@ -1867,7 +1866,6 @@ void SvxTableController::StartSelection( const CellPos& rPos )
StopTextEdit();
mbCellSelectionMode = true;
maCursorLastPos = maCursorFirstPos = rPos;
- mpView->MarkListHasChanged();
}
// --------------------------------------------------------------------
@@ -1885,7 +1883,6 @@ void SvxTableController::setSelectedCells( const CellPos& rStart, const CellPos&
void SvxTableController::UpdateSelection( const CellPos& rPos )
{
maCursorLastPos = rPos;
- mpView->MarkListHasChanged();
}
// --------------------------------------------------------------------
@@ -1916,7 +1913,6 @@ void SvxTableController::RemoveSelection()
if( mbCellSelectionMode )
{
mbCellSelectionMode = false;
- mpView->MarkListHasChanged();
}
}
@@ -2301,8 +2297,8 @@ void SvxTableController::UpdateTableShape()
SdrObject* pTableObj = mxTableObj.get();
if( pTableObj )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pTableObj);
pTableObj->ActionChanged();
- pTableObj->BroadcastObjectChange();
}
updateSelectionOverlay();
}
@@ -2415,11 +2411,7 @@ bool SvxTableController::GetMarkedObjModel( SdrPage* pNewPage )
SdrTableObj* pNewTableObj = rTableObj.CloneRange( aStart, aEnd );
- pNewTableObj->SetPage( pNewPage );
- pNewTableObj->SetModel( pNewPage->GetModel() );
-
- SdrInsertReason aReason(SDRREASON_VIEWCALL);
- pNewPage->InsertObject(pNewTableObj,CONTAINER_APPEND,&aReason);
+ pNewPage->InsertObjectToSdrObjList(*pNewTableObj);
return true;
}
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index cf67e0520dc9..4cce790c1b15 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -65,8 +65,15 @@ public:
// --------------------------------------------------------------------
-TableEdgeHdl::TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges )
-: SdrHdl( rPnt, HDL_USER )
+TableEdgeHdl::TableEdgeHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DPoint& rPnt,
+ bool bHorizontal,
+ sal_Int32 nMin,
+ sal_Int32 nMax,
+ sal_Int32 nEdges )
+: SdrHdl( rHdlList, &rSdrHdlObject, HDL_USER, rPnt)
, mbHorizontal( bHorizontal )
, mnMin( nMin )
, mnMax( nMax )
@@ -74,6 +81,10 @@ TableEdgeHdl::TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin,
{
}
+TableEdgeHdl::~TableEdgeHdl()
+{
+}
+
void TableEdgeHdl::SetEdge( sal_Int32 nEdge, sal_Int32 nStart, sal_Int32 nEnd, TableEdgeState eState )
{
if( (nEdge >= 0) && (nEdge <= sal::static_int_cast<sal_Int32>(maEdges.size())) )
@@ -117,26 +128,39 @@ void TableEdgeHdl::getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2
{
// changed method to create visible and invisible partial polygons in one run in
// separate PolyPolygons; both kinds are used
- basegfx::B2DPoint aOffset(aPos.X(), aPos.Y());
+ basegfx::B2DPoint aOffset(getPosition());
rVisible.clear();
rInvisible.clear();
if( pDrag )
{
- int n = mbHorizontal ? 1 : 0;
- aOffset[n] = aOffset[n] + GetValidDragOffset( *pDrag );
+ if(mbHorizontal)
+ {
+ aOffset.setX(aOffset.getX() + GetValidDragOffset( *pDrag ));
+ }
+ else
+ {
+ aOffset.setY(aOffset.getY() + GetValidDragOffset( *pDrag ));
+ }
}
basegfx::B2DPoint aStart(aOffset), aEnd(aOffset);
- int nPos = mbHorizontal ? 0 : 1;
TableEdgeVector::const_iterator aIter( maEdges.begin() );
while( aIter != maEdges.end() )
{
TableEdge aEdge(*aIter++);
- aStart[nPos] = aOffset[nPos] + aEdge.mnStart;
- aEnd[nPos] = aOffset[nPos] + aEdge.mnEnd;
+ if(mbHorizontal)
+ {
+ aStart.setX(aOffset.getX() + aEdge.mnStart);
+ aEnd.setX(aOffset.getX() + aEdge.mnEnd);
+ }
+ else
+ {
+ aStart.setY(aOffset.getY() + aEdge.mnStart);
+ aEnd.setY(aOffset.getY() + aEdge.mnEnd);
+ }
basegfx::B2DPolygon aPolygon;
aPolygon.append( aStart );
@@ -153,54 +177,32 @@ void TableEdgeHdl::getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2
}
}
-void TableEdgeHdl::CreateB2dIAObject()
+void TableEdgeHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
{
- GetRidOfIAObject();
+ basegfx::B2DPolyPolygon aVisible;
+ basegfx::B2DPolyPolygon aInvisible;
+
+ // get visible and invisible parts
+ getPolyPolygon(aVisible, aInvisible, 0);
- if(pHdlList && pHdlList->GetView() && !pHdlList->GetView()->areMarkHandlesHidden())
+ if(aVisible.count() || aInvisible.count())
{
- SdrMarkView* pView = pHdlList->GetView();
- SdrPageView* pPageView = pView->GetSdrPageView();
+ if(aVisible.count())
+ {
+ // create overlay object for visible parts
+ sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aVisible, true);
+ rOverlayManager.add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
+ }
- if(pPageView)
+ if(aInvisible.count())
{
- basegfx::B2DPolyPolygon aVisible;
- basegfx::B2DPolyPolygon aInvisible;
-
- // get visible and invisible parts
- getPolyPolygon(aVisible, aInvisible, 0);
-
- if(aVisible.count() || aInvisible.count())
- {
- for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- if(aVisible.count())
- {
- // create overlay object for visible parts
- sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aVisible, true);
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
- maOverlayGroup.append(*pOverlayObject);
- }
-
- if(aInvisible.count())
- {
- // also create overlay object vor invisible parts to allow
- // a standard HitTest using the primitives from that overlay object
- // (see OverlayTableEdge implementation)
- sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aInvisible, false);
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
- maOverlayGroup.append(*pOverlayObject);
- }
- }
- }
- }
- }
+ // also create overlay object vor invisible parts to allow
+ // a standard HitTest using the primitives from that overlay object
+ // (see OverlayTableEdge implementation)
+ sdr::overlay::OverlayObject* pOverlayObject = new OverlayTableEdge(aInvisible, false);
+ rOverlayManager.add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
}
}
}
@@ -252,56 +254,42 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb
// ====================================================================
-TableBorderHdl::TableBorderHdl( const Rectangle& rRect )
-: SdrHdl( rRect.TopLeft(), HDL_MOVE )
-, maRectangle( rRect )
+TableBorderHdl::TableBorderHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DRange& rRange )
+: SdrHdl( rHdlList, &rSdrHdlObject, HDL_MOVE, rRange.getMinimum() )
+, maRange( rRange )
{
}
+TableBorderHdl::~TableBorderHdl()
+{
+}
+
Pointer TableBorderHdl::GetPointer() const
{
return POINTER_MOVE;
}
// create marker for this kind
-void TableBorderHdl::CreateB2dIAObject()
+void TableBorderHdl::CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager)
{
- GetRidOfIAObject();
-
- if(pHdlList && pHdlList->GetView() && !pHdlList->GetView()->areMarkHandlesHidden())
- {
- SdrMarkView* pView = pHdlList->GetView();
- SdrPageView* pPageView = pView->GetSdrPageView();
-
- if(pPageView)
- {
- for(sal_uInt32 nWindow = 0; nWindow < pPageView->PageWindowCount(); nWindow++)
- {
- // const SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(nWindow);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- if(rPageWindow.GetOverlayManager())
- {
- const basegfx::B2DRange aRange(vcl::unotools::b2DRectangleFromRectangle(maRectangle));
- sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayHatchRect(
- aRange.getMinimum(),
- aRange.getMaximum(),
- Color(0x80, 0x80, 0x80),
- 6.0,
- 0.0,
- 45 * F_PI180,
- 0.0);
-
- rPageWindow.GetOverlayManager()->add(*pOverlayObject);
- maOverlayGroup.append(*pOverlayObject);
- }
- }
- }
- }
- }
+ const basegfx::B2DHomMatrix aTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ maRange.getRange(),
+ maRange.getMinimum()));
+
+ sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayHatchRect(
+ aTransformation,
+ Color(0x80, 0x80, 0x80),
+ 6.0,
+ 0.0,
+ 45 * F_PI180);
+
+ rOverlayManager.add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/table/tablehandles.hxx b/svx/source/table/tablehandles.hxx
index 8ffd175e67ee..6acdd5f4b7e8 100644
--- a/svx/source/table/tablehandles.hxx
+++ b/svx/source/table/tablehandles.hxx
@@ -48,7 +48,14 @@ typedef std::vector< TableEdge > TableEdgeVector;
class TableEdgeHdl : public SdrHdl
{
public:
- TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges );
+ TableEdgeHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DPoint& rPnt,
+ bool bHorizontal,
+ sal_Int32 nMin,
+ sal_Int32 nMax,
+ sal_Int32 nEdges );
sal_Int32 GetValidDragOffset( const SdrDragStat& rDrag ) const;
@@ -63,7 +70,9 @@ public:
protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+
+ virtual ~TableEdgeHdl();
private:
bool mbHorizontal;
@@ -74,16 +83,21 @@ private:
class TableBorderHdl : public SdrHdl
{
public:
- TableBorderHdl( const Rectangle& rRect );
+ TableBorderHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DRange& rRange );
virtual Pointer GetPointer() const;
protected:
// create marker for this kind
- virtual void CreateB2dIAObject();
+ virtual void CreateB2dIAObject(::sdr::overlay::OverlayManager& rOverlayManager);
+
+ virtual ~TableBorderHdl();
private:
- Rectangle maRectangle;
+ basegfx::B2DRange maRange;
};
} // end of namespace table
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index abc962b398a7..5ba15040fa01 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -839,7 +839,7 @@ void TableLayouter::LayoutTableHeight( Rectangle& rArea, bool bFit )
/** try to fit the table into the given rectangle.
If the rectangle is to small, it will be grown to fit the table. */
-void TableLayouter::LayoutTable( Rectangle& rRectangle, bool bFitWidth, bool bFitHeight )
+void TableLayouter::LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight )
{
if( !mxTable.is() )
return;
@@ -863,8 +863,19 @@ void TableLayouter::LayoutTable( Rectangle& rRectangle, bool bFitWidth, bool bFi
maColumns[nCol].clear();
}
- LayoutTableWidth( rRectangle, bFitWidth );
- LayoutTableHeight( rRectangle, bFitHeight );
+ // here TableLayout could be changed to double precision,
+ // but for now this will not be needed
+ Rectangle aTableArea(
+ basegfx::fround(o_aArea.getMinX()), basegfx::fround(o_aArea.getMinY()),
+ basegfx::fround(o_aArea.getMaxX()), basegfx::fround(o_aArea.getMaxY()));
+
+ // layout with integer
+ LayoutTableWidth( aTableArea, bFitWidth );
+ LayoutTableHeight( aTableArea, bFitHeight );
+
+ // copy back evtl. changed area
+ o_aArea = basegfx::B2DRange(aTableArea.Left(), aTableArea.Top(), aTableArea.Right(), aTableArea.Bottom());
+
UpdateBorderLayout();
}
@@ -1109,7 +1120,7 @@ void TableLayouter::SetLayoutToModel()
*/
// -----------------------------------------------------------------------------
-void TableLayouter::DistributeColumns( ::Rectangle& rArea, sal_Int32 nFirstCol, sal_Int32 nLastCol )
+void TableLayouter::DistributeColumns( basegfx::B2DRange& o_aArea, sal_Int32 nFirstCol, sal_Int32 nLastCol )
{
if( mxTable.is() ) try
{
@@ -1137,7 +1148,7 @@ void TableLayouter::DistributeColumns( ::Rectangle& rArea, sal_Int32 nFirstCol,
nAllWidth -= nWidth;
}
- LayoutTable( rArea, true, false );
+ LayoutTable( o_aArea, true, false );
}
catch( Exception& e )
{
@@ -1148,7 +1159,7 @@ void TableLayouter::DistributeColumns( ::Rectangle& rArea, sal_Int32 nFirstCol,
// -----------------------------------------------------------------------------
-void TableLayouter::DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal_Int32 nLastRow )
+void TableLayouter::DistributeRows( basegfx::B2DRange& o_aArea, sal_Int32 nFirstRow, sal_Int32 nLastRow )
{
if( mxTable.is() ) try
{
@@ -1172,7 +1183,13 @@ void TableLayouter::DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal
if( nHeight < nMinHeight )
{
sal_Int32 nNeededHeight = nRows * nMinHeight;
- rArea.nBottom += nNeededHeight - nAllHeight;
+
+ o_aArea = basegfx::B2DRange(
+ o_aArea.getMinX(),
+ o_aArea.getMinY(),
+ o_aArea.getMaxX(),
+ o_aArea.getMinY() + (nNeededHeight - nAllHeight));
+
nHeight = nMinHeight;
nAllHeight = nRows * nMinHeight;
}
@@ -1189,7 +1206,7 @@ void TableLayouter::DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal
nAllHeight -= nHeight;
}
- LayoutTable( rArea, false, true );
+ LayoutTable( o_aArea, false, true );
}
catch( Exception& e )
{
diff --git a/svx/source/table/tablelayouter.hxx b/svx/source/table/tablelayouter.hxx
index 26ea299f8a78..6f432a822de4 100644
--- a/svx/source/table/tablelayouter.hxx
+++ b/svx/source/table/tablelayouter.hxx
@@ -76,7 +76,7 @@ public:
if bFitWidth or bFitHeight is set, the model is changed.
*/
- void LayoutTable( ::Rectangle& rRectangle, bool bFitWidth, bool bFitHeight );
+ void LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight );
/** after a call to LayoutTable, this method can be used to set the new
column and row sizes back to the model. */
@@ -119,8 +119,8 @@ public:
sal_Int32 getHorizontalEdge( int nEdgeY, sal_Int32* pnMin = 0, sal_Int32* pnMax = 0 );
sal_Int32 getVerticalEdge( int nEdgeX , sal_Int32* pnMin = 0, sal_Int32* pnMax = 0);
- void DistributeColumns( ::Rectangle& rArea, sal_Int32 nFirstCol, sal_Int32 nLastCol );
- void DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal_Int32 nLastRow );
+ void DistributeColumns( basegfx::B2DRange& o_aArea, sal_Int32 nFirstCol, sal_Int32 nLastCol );
+ void DistributeRows( basegfx::B2DRange& o_aArea, sal_Int32 nFirstRow, sal_Int32 nLastRow );
com::sun::star::text::WritingMode GetWritingMode() const { return meWritingMode; }
void SetWritingMode( com::sun::star::text::WritingMode eWritingMode );
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index d37e1ae89d6e..ec3d6784e6d9 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -617,7 +617,7 @@ void TableModel::unlockBroadcasts() throw (RuntimeException)
void TableModel::notifyModification()
{
::osl::MutexGuard guard( m_aMutex );
- if( (mnNotifyLock == 0) && mpTableObj && mpTableObj->GetModel() )
+ if( (mnNotifyLock == 0) && mpTableObj )
{
mbNotifyPending = false;
@@ -635,47 +635,47 @@ void TableModel::notifyModification()
}
#ifdef PLEASE_DEBUG_THE_TABLES
- FILE* file = fopen( "c:\\table.xml","w" );
+ FILE* file = fopen( "c:\\table.xml","w" );
- const sal_Int32 nColCount = getColumnCountImpl();
- const sal_Int32 nRowCount = getRowCountImpl();
+ const sal_Int32 nColCount = getColumnCountImpl();
+ const sal_Int32 nRowCount = getRowCountImpl();
- fprintf( file, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\r" );
- fprintf( file, "<table columns=\"%ld\" rows=\"%ld\" updated=\"%s\">\n\r", nColCount, nRowCount, mbNotifyPending ? "false" : "true");
+ fprintf( file, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\r" );
+ fprintf( file, "<table columns=\"%ld\" rows=\"%ld\" updated=\"%s\">\n\r", nColCount, nRowCount, mbNotifyPending ? "false" : "true");
+ for( sal_Int32 nCol = 0; nCol < nColCount; ++nCol )
+ {
+ fprintf( file, "<column this=\"%lx\"/>\n\r", maColumns[nCol].get() );
+ }
+
+ // first check merged cells before and inside the removed rows
+ for( sal_Int32 nRow = 0; nRow < nRowCount; ++nRow )
+ {
+ fprintf( file, "<row this=\"%lx\">\n\r", maRows[nRow].get() );
for( sal_Int32 nCol = 0; nCol < nColCount; ++nCol )
{
- fprintf( file, "<column this=\"%lx\"/>\n\r", maColumns[nCol].get() );
- }
+ CellRef xCell( getCell( nCol, nRow ) );
+ fprintf( file, "<cell this=\"%lx\"", xCell.get() );
- // first check merged cells before and inside the removed rows
- for( sal_Int32 nRow = 0; nRow < nRowCount; ++nRow )
- {
- fprintf( file, "<row this=\"%lx\">\n\r", maRows[nRow].get() );
- for( sal_Int32 nCol = 0; nCol < nColCount; ++nCol )
- {
- CellRef xCell( getCell( nCol, nRow ) );
- fprintf( file, "<cell this=\"%lx\"", xCell.get() );
-
- sal_Int32 nRowSpan = xCell->getRowSpan();
- sal_Int32 nColSpan = xCell->getColumnSpan();
- sal_Bool bMerged = xCell->isMerged();
+ sal_Int32 nRowSpan = xCell->getRowSpan();
+ sal_Int32 nColSpan = xCell->getColumnSpan();
+ sal_Bool bMerged = xCell->isMerged();
- if( nColSpan != 1 )
- fprintf( file, " column-span=\"%ld\"", nColSpan );
- if( nRowSpan != 1 )
- fprintf( file, " row-span=\"%ld\"", nRowSpan );
+ if( nColSpan != 1 )
+ fprintf( file, " column-span=\"%ld\"", nColSpan );
+ if( nRowSpan != 1 )
+ fprintf( file, " row-span=\"%ld\"", nRowSpan );
- if( bMerged )
- fprintf( file, " merged=\"true\"" );
+ if( bMerged )
+ fprintf( file, " merged=\"true\"" );
- fprintf( file, "/>" );
- }
- fprintf( file, "\n\r</row>\n\r" );
+ fprintf( file, "/>" );
}
+ fprintf( file, "\n\r</row>\n\r" );
+ }
- fprintf( file, "</table>\n\r" );
- fclose( file );
+ fprintf( file, "</table>\n\r" );
+ fclose( file );
#endif
}
@@ -695,26 +695,6 @@ CellRef TableModel::getCell( sal_Int32 nCol, sal_Int32 nRow ) const
}
// -----------------------------------------------------------------------------
-/*
-bool TableModel::getCellPos( const CellRef& xCell, ::sal_Int32& rnCol, ::sal_Int32& rnRow ) const
-{
- const sal_Int32 nRowCount = getRowCount();
- const sal_Int32 nColCount = getColumnCount();
- for( rnRow = 0; rnRow < nRowCount; rnRow++ )
- {
- for( rnCol = 0; rnCol < nColCount; rnCol++ )
- {
- if( maRows[rnRow]->maCells[rnCol] == xCell )
- {
- return true;
- }
- }
- }
- return false;
-}
-*/
-
-// -----------------------------------------------------------------------------
CellRef TableModel::createCell()
{
@@ -732,8 +712,7 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
{
try
{
- SdrModel* pModel = mpTableObj->GetModel();
-
+ SdrModel& rModel = mpTableObj->getSdrModelFromSdrObject();
TableModelNotifyGuard aGuard( this );
nIndex = insert_range<ColumnVector,ColumnVector::iterator,TableColumnRef>( maColumns, nIndex, nCount );
@@ -749,11 +728,11 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
aNewColumns[nOffset] = xNewCol;
}
- const bool bUndo = pModel && mpTableObj->IsInserted() && pModel->IsUndoEnabled();
+ const bool bUndo = mpTableObj->IsObjectInserted() && rModel.IsUndoEnabled();
if( bUndo )
{
- pModel->BegUndo( ImpGetResStr(STR_TABLE_INSCOL) );
- pModel->AddUndo( pModel->GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
+ rModel.BegUndo( ImpGetResStr(STR_TABLE_INSCOL) );
+ rModel.AddUndo( rModel.GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
TableModelRef xThis( this );
@@ -768,7 +747,7 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
(*aCellIter++) = getCell( nIndex + nOffset, nRow );
}
- pModel->AddUndo( new InsertColUndo( xThis, nIndex, aNewColumns, aNewCells ) );
+ rModel.AddUndo( new InsertColUndo( xThis, nIndex, aNewColumns, aNewCells ) );
}
const sal_Int32 nRowCount = getRowCountImpl();
@@ -790,10 +769,9 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
}
if( bUndo )
- pModel->EndUndo();
+ rModel.EndUndo();
- if( pModel )
- pModel->SetChanged();
+ rModel.SetChanged();
}
catch( Exception& )
@@ -822,14 +800,13 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
nCount = nColCount - nIndex;
sal_Int32 nRows = getRowCountImpl();
+ SdrModel& rModel = mpTableObj->getSdrModelFromSdrObject();
- SdrModel* pModel = mpTableObj->GetModel();
-
- const bool bUndo = pModel && mpTableObj->IsInserted() && pModel->IsUndoEnabled();
+ const bool bUndo = mpTableObj->IsObjectInserted() && rModel.IsUndoEnabled();
if( bUndo )
{
- pModel->BegUndo( ImpGetResStr(STR_UNDO_COL_DELETE) );
- pModel->AddUndo( pModel->GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
+ rModel.BegUndo( ImpGetResStr(STR_UNDO_COL_DELETE) );
+ rModel.AddUndo( rModel.GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
TableModelRef xThis( this );
ColumnVector aRemovedCols( nCount );
@@ -847,7 +824,7 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
(*aCellIter++) = getCell( nIndex + nOffset, nRow );
}
- pModel->AddUndo( new RemoveColUndo( xThis, nIndex, aRemovedCols, aRemovedCells ) );
+ rModel.AddUndo( new RemoveColUndo( xThis, nIndex, aRemovedCols, aRemovedCells ) );
}
// only rows before and inside the removed rows are considered
@@ -900,10 +877,9 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
maRows[nRows]->removeColumns( nIndex, nCount );
if( bUndo )
- pModel->EndUndo();
+ rModel.EndUndo();
- if( pModel )
- pModel->SetChanged();
+ rModel.SetChanged();
}
catch( Exception& )
{
@@ -921,8 +897,9 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
{
if( nCount && mpTableObj )
{
- SdrModel* pModel = mpTableObj->GetModel();
- const bool bUndo = pModel && mpTableObj->IsInserted() && pModel->IsUndoEnabled();
+ SdrModel& rModel = mpTableObj->getSdrModelFromSdrObject();
+ const bool bUndo = mpTableObj->IsObjectInserted() && rModel.IsUndoEnabled();
+
try
{
TableModelNotifyGuard aGuard( this );
@@ -940,10 +917,10 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
if( bUndo )
{
- pModel->BegUndo( ImpGetResStr(STR_TABLE_INSROW) );
- pModel->AddUndo( pModel->GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
+ rModel.BegUndo( ImpGetResStr(STR_TABLE_INSROW) );
+ rModel.AddUndo( rModel.GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
TableModelRef xThis( this );
- pModel->AddUndo( new InsertRowUndo( xThis, nIndex, aNewRows ) );
+ rModel.AddUndo( new InsertRowUndo( xThis, nIndex, aNewRows ) );
}
// check if cells merge over new columns
@@ -968,10 +945,9 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
DBG_ERROR("sdr::table::TableModel::insertRows(), exception caught!");
}
if( bUndo )
- pModel->EndUndo();
+ rModel.EndUndo();
- if( pModel )
- pModel->SetChanged();
+ rModel.SetChanged();
updateRows();
setModified(sal_True);
@@ -986,8 +962,8 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
if( mpTableObj && nCount && (nIndex >= 0) && (nIndex < nRowCount) )
{
- SdrModel* pModel = mpTableObj->GetModel();
- const bool bUndo = pModel && mpTableObj->IsInserted()&& pModel->IsUndoEnabled();
+ SdrModel& rModel = mpTableObj->getSdrModelFromSdrObject();
+ const bool bUndo = mpTableObj->IsObjectInserted()&& rModel.IsUndoEnabled();
try
{
@@ -999,8 +975,8 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
if( bUndo )
{
- pModel->BegUndo( ImpGetResStr(STR_UNDO_ROW_DELETE) );
- pModel->AddUndo( pModel->GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
+ rModel.BegUndo( ImpGetResStr(STR_UNDO_ROW_DELETE) );
+ rModel.AddUndo( rModel.GetSdrUndoFactory().CreateUndoGeoObject(*mpTableObj) );
TableModelRef xThis( this );
@@ -1008,7 +984,7 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
for( sal_Int32 nOffset = 0; nOffset < nCount; ++nOffset )
aRemovedRows[nOffset] = maRows[nIndex+nOffset];
- pModel->AddUndo( new RemoveRowUndo( xThis, nIndex, aRemovedRows ) );
+ rModel.AddUndo( new RemoveRowUndo( xThis, nIndex, aRemovedRows ) );
}
// only rows before and inside the removed rows are considered
@@ -1059,10 +1035,9 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
remove_range<RowVector,RowVector::iterator>( maRows, nIndex, nCount );
if( bUndo )
- pModel->EndUndo();
+ rModel.EndUndo();
- if( pModel )
- pModel->SetChanged();
+ rModel.SetChanged();
}
catch( Exception& )
{
@@ -1187,10 +1162,8 @@ void TableModel::optimize()
void TableModel::merge( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan )
{
- SdrModel* pModel = mpTableObj->GetModel();
-
- const bool bUndo = pModel && mpTableObj->IsInserted() && pModel->IsUndoEnabled();
-
+ SdrModel& rModel = mpTableObj->getSdrModelFromSdrObject();
+ const bool bUndo = mpTableObj->IsObjectInserted() && rModel.IsUndoEnabled();
const sal_Int32 nLastRow = nRow + nRowSpan;
const sal_Int32 nLastCol = nCol + nColSpan;
diff --git a/svx/source/table/tablerow.cxx b/svx/source/table/tablerow.cxx
index 452a78cbe378..49d5ccc8ac7a 100644
--- a/svx/source/table/tablerow.cxx
+++ b/svx/source/table/tablerow.cxx
@@ -224,12 +224,9 @@ void SAL_CALL TableRow::setFastPropertyValue( sal_Int32 nHandle, const Any& aVal
{
bool bOk = false;
bool bChange = false;
-
TableRowUndo* pUndo = 0;
-
- SdrModel* pModel = mxTableModel->getSdrTableObj()->GetModel();
-
- const bool bUndo = mxTableModel.is() && mxTableModel->getSdrTableObj() && mxTableModel->getSdrTableObj()->IsInserted() && pModel && pModel->IsUndoEnabled();
+ SdrModel& rModel = mxTableModel->getSdrTableObj()->getSdrModelFromSdrObject();
+ const bool bUndo = mxTableModel.is() && mxTableModel->getSdrTableObj() && mxTableModel->getSdrTableObj()->IsObjectInserted() && rModel.IsUndoEnabled();
if( bUndo )
{
@@ -298,7 +295,7 @@ void SAL_CALL TableRow::setFastPropertyValue( sal_Int32 nHandle, const Any& aVal
{
if( pUndo )
{
- pModel->AddUndo( pUndo );
+ rModel.AddUndo( pUndo );
pUndo = 0;
}
mxTableModel->setModified(sal_True);
diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx
index 29c1890128a4..1e6f3acb4e7f 100644
--- a/svx/source/table/tablertfimporter.cxx
+++ b/svx/source/table/tablertfimporter.cxx
@@ -45,6 +45,7 @@
#include "editeng/editdata.hxx"
#include "svx/svdmodel.hxx"
#include "editeng/svxrtf.hxx"
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star::uno;
@@ -134,8 +135,8 @@ private:
SdrTableRTFParser::SdrTableRTFParser( SdrTableObj& rTableObj )
: mrTableObj( rTableObj )
-, mpOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, rTableObj.GetModel() ) )
-, mrItemPool( rTableObj.GetModel()->GetItemPool() )
+, mpOutliner( SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, &rTableObj.getSdrModelFromSdrObject() ) )
+, mrItemPool( rTableObj.GetObjectItemPool() )
, mnLastToken( 0 )
, mnLastWidth( 0 )
, mbNewDef( false )
@@ -186,8 +187,8 @@ IMPL_LINK( SdrTableRTFParser, RTFImportHdl, ImportInfo*, pInfo )
pParser->SetAttrPool( &mrItemPool );
RTFPardAttrMapIds& rMap = pParser->GetPardMap();
rMap.nBox = SDRATTR_TABLE_BORDER;
- }
break;
+ }
case RTFIMP_END:
if ( pInfo->aSelection.nEndPos )
{
@@ -289,16 +290,16 @@ void SdrTableRTFParser::FillTable()
SdrOutliner& rOutliner=mrTableObj.ImpGetDrawOutliner();
rOutliner.SetUpdateMode(sal_True);
rOutliner.SetText( *pTextObject );
- mrTableObj.NbcSetOutlinerParaObjectForText( rOutliner.CreateParaObject(), xCell.get() );
+ mrTableObj.SetOutlinerParaObjectForText( rOutliner.CreateParaObject(), xCell.get() );
delete pTextObject;
}
}
}
}
- Rectangle aRect( mrTableObj.GetSnapRect() );
+ Rectangle aRect( sdr::legacy::GetSnapRect(mrTableObj) );
aRect.nRight = aRect.nLeft + nLastEdge;
- mrTableObj.NbcSetSnapRect( aRect );
+ sdr::legacy::SetSnapRect(mrTableObj, aRect );
}
catch( Exception& e )
diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx
index fe9eae587460..42aebdf24666 100644
--- a/svx/source/table/tableundo.cxx
+++ b/svx/source/table/tableundo.cxx
@@ -26,13 +26,12 @@
#include "svx/sdr/properties/textproperties.hxx"
#include "editeng/outlobj.hxx"
-
#include "cell.hxx"
#include "tableundo.hxx"
#include "svx/svdotable.hxx"
#include "tablerow.hxx"
#include "tablecolumn.hxx"
-
+#include <svx/svdmodel.hxx>
// -----------------------------------------------------------------------------
@@ -45,7 +44,8 @@ using namespace ::com::sun::star::table;
namespace sdr { namespace table {
CellUndo::CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell )
-: SdrUndoAction( *xCell->GetModel() )
+: SdrUndoAction( xCell->getSdrTextObj().getSdrModelFromSdrObject() )
+, SfxListener()
, mxObjRef( xObjRef )
, mxCell( xCell )
, mbUndo( true )
@@ -53,14 +53,17 @@ CellUndo::CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell )
if( mxCell.is() && mxObjRef.is() )
{
getDataFromCell( maUndoData );
- mxObjRef->AddObjectUser( *this );
+ StartListening(*mxObjRef.get());
}
}
CellUndo::~CellUndo()
{
if( mxObjRef.is() )
- mxObjRef->RemoveObjectUser( *this );
+ {
+ EndListening(*mxObjRef.get());
+ }
+
dispose();
}
@@ -77,10 +80,16 @@ void CellUndo::dispose()
maRedoData.mpOutlinerParaObject = 0;
}
-void CellUndo::ObjectInDestruction(const SdrObject& )
+// derived from SfxListener
+void CellUndo::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrHint && HINT_SDROBJECTDYING == pSdrHint->GetSdrHintKind())
{
dispose();
}
+}
void CellUndo::Undo()
{
@@ -177,7 +186,7 @@ static void Dispose( RowVector& rRows )
// -----------------------------------------------------------------------------
InsertRowUndo::InsertRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aNewRows )
-: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() )
+: SdrUndoAction( xTable->getSdrTableObj()->getSdrModelFromSdrObject() )
, mxTable( xTable )
, mnIndex( nIndex )
, mbUndo( true )
@@ -220,7 +229,7 @@ void InsertRowUndo::Redo()
// -----------------------------------------------------------------------------
RemoveRowUndo::RemoveRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aRemovedRows )
-: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() )
+: SdrUndoAction( xTable->getSdrTableObj()->getSdrModelFromSdrObject() )
, mxTable( xTable )
, mnIndex( nIndex )
, mbUndo( true )
@@ -281,7 +290,7 @@ static void Dispose( CellVector& rCells )
// -----------------------------------------------------------------------------
InsertColUndo::InsertColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells )
-: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() )
+: SdrUndoAction( xTable->getSdrTableObj()->getSdrModelFromSdrObject() )
, mxTable( xTable )
, mnIndex( nIndex )
, mbUndo( true )
@@ -328,7 +337,7 @@ void InsertColUndo::Redo()
// -----------------------------------------------------------------------------
RemoveColUndo::RemoveColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells )
-: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() )
+: SdrUndoAction( xTable->getSdrTableObj()->getSdrModelFromSdrObject() )
, mxTable( xTable )
, mnIndex( nIndex )
, mbUndo( true )
@@ -375,7 +384,7 @@ void RemoveColUndo::Redo()
// -----------------------------------------------------------------------------
TableColumnUndo::TableColumnUndo( const TableColumnRef& xCol )
-: SdrUndoAction( *xCol->mxTableModel->getSdrTableObj()->GetModel() )
+: SdrUndoAction( xCol->mxTableModel->getSdrTableObj()->getSdrModelFromSdrObject() )
, mxCol( xCol )
, mbHasRedoData( false )
{
@@ -444,7 +453,7 @@ void TableColumnUndo::getData( Data& rData )
// -----------------------------------------------------------------------------
TableRowUndo::TableRowUndo( const TableRowRef& xRow )
-: SdrUndoAction( *xRow->mxTableModel->getSdrTableObj()->GetModel() )
+: SdrUndoAction( xRow->mxTableModel->getSdrTableObj()->getSdrModelFromSdrObject() )
, mxRow( xRow )
, mbHasRedoData( false )
{
@@ -511,7 +520,7 @@ void TableRowUndo::getData( Data& rData )
// -----------------------------------------------------------------------------
TableStyleUndo::TableStyleUndo( const SdrTableObj& rTableObj )
-: SdrUndoAction( *rTableObj.GetModel() )
+: SdrUndoAction( rTableObj.getSdrModelFromSdrObject() )
, mxObjRef( const_cast< sdr::table::SdrTableObj*>( &rTableObj ) )
{
getData( maUndoData );
diff --git a/svx/source/table/tableundo.hxx b/svx/source/table/tableundo.hxx
index 2661e3b80c2e..b4d4dac57e0f 100644
--- a/svx/source/table/tableundo.hxx
+++ b/svx/source/table/tableundo.hxx
@@ -43,7 +43,7 @@ class OutlinerParaObject;
namespace sdr { namespace table {
-class CellUndo : public SdrUndoAction, public sdr::ObjectUser
+class CellUndo : public SdrUndoAction, public SfxListener
{
public:
CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell );
@@ -54,7 +54,9 @@ public:
virtual sal_Bool Merge( SfxUndoAction *pNextAction );
void dispose();
- virtual void ObjectInDestruction(const SdrObject& rObject);
+
+ // derived from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
private:
struct Data
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index a3c61116f158..dd5018e7d8c9 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -44,6 +44,7 @@
#include <drawinglayer/attribute/sdrshadowattribute.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include "cell.hxx"
#include "tablelayouter.hxx"
@@ -82,9 +83,6 @@ namespace drawinglayer
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
const attribute::SdrFillTextAttribute& getSdrFTAttribute() const { return maSdrFTAttribute; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
@@ -132,19 +130,6 @@ namespace drawinglayer
return aRetval;
}
- bool SdrCellPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrCellPrimitive2D& rCompare = (SdrCellPrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getSdrFTAttribute() == rCompare.getSdrFTAttribute());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrCellPrimitive2D, PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D)
@@ -167,11 +152,11 @@ namespace drawinglayer
SvxBorderLine maTopLine;
// bitfield
- unsigned mbLeftIsOutside : 1;
- unsigned mbBottomIsOutside : 1;
- unsigned mbRightIsOutside : 1;
- unsigned mbTopIsOutside : 1;
- unsigned mbInTwips : 1;
+ bool mbLeftIsOutside : 1;
+ bool mbBottomIsOutside : 1;
+ bool mbRightIsOutside : 1;
+ bool mbTopIsOutside : 1;
+ bool mbInTwips : 1;
protected:
// local decomposition.
@@ -216,9 +201,6 @@ namespace drawinglayer
bool getTopIsOutside() const { return mbTopIsOutside; }
bool getInTwips() const { return mbInTwips; }
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// provide unique ID
DeclPrimitrive2DIDBlock()
};
@@ -462,27 +444,6 @@ namespace drawinglayer
return xRetval;
}
- bool SdrBorderlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SdrBorderlinePrimitive2D& rCompare = (SdrBorderlinePrimitive2D&)rPrimitive;
-
- return (getTransform() == rCompare.getTransform()
- && getLeftLine() == rCompare.getLeftLine()
- && getBottomLine() == rCompare.getBottomLine()
- && getRightLine() == rCompare.getRightLine()
- && getTopLine() == rCompare.getTopLine()
- && getLeftIsOutside() == rCompare.getLeftIsOutside()
- && getBottomIsOutside() == rCompare.getBottomIsOutside()
- && getRightIsOutside() == rCompare.getRightIsOutside()
- && getTopIsOutside() == rCompare.getTopIsOutside()
- && getInTwips() == rCompare.getInTwips());
- }
-
- return false;
- }
-
// provide unique ID
ImplPrimitrive2DIDBlock(SdrBorderlinePrimitive2D, PRIMITIVE2D_ID_SDRBORDERLINEPRIMITIVE2D)
@@ -560,11 +521,6 @@ namespace sdr
sdr::table::CellRef xCurrentCell;
basegfx::B2IRectangle aCellArea;
- // create range using the model data directly. This is in SdrTextObj::aRect which i will access using
- // GetGeoRect() to not trigger any calculations. It's the unrotated geometry.
- const Rectangle& rObjectRectangle(rTableObj.GetGeoRect());
- const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
-
// for each cell we need potentially a cell primitive and a border primitive
// (e.g. single cell). Prepare sequences and input counters
drawinglayer::primitive2d::Primitive2DSequence xCellSequence(nAllCount);
@@ -593,8 +549,8 @@ namespace sdr
basegfx::B2DHomMatrix aCellMatrix;
aCellMatrix.set(0, 0, (double)aCellArea.getWidth());
aCellMatrix.set(1, 1, (double)aCellArea.getHeight());
- aCellMatrix.set(0, 2, (double)aCellArea.getMinX() + aObjectRange.getMinX());
- aCellMatrix.set(1, 2, (double)aCellArea.getMinY() + aObjectRange.getMinY());
+ aCellMatrix.set(0, 2, (double)aCellArea.getMinX());
+ aCellMatrix.set(1, 2, (double)aCellArea.getMinY());
// handle cell fillings and text
const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();
@@ -674,6 +630,20 @@ namespace sdr
// append to target. We want fillings and text first
xRetval = xCellSequence;
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, xBorderSequence);
+
+ // embed whole visualisation into oebjct matrix, but without scale which is already
+ // included into the single cell and border objects
+ const basegfx::B2DHomMatrix aObjNoScale(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ rTableObj.getSdrObjectShearX(),
+ rTableObj.getSdrObjectRotate(),
+ rTableObj.getSdrObjectTranslate()));
+ const drawinglayer::primitive2d::Primitive2DReference xTransRef(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aObjNoScale,
+ xRetval));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xTransRef, 1);
}
if(xRetval.hasElements())
@@ -693,25 +663,14 @@ namespace sdr
}
else
{
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = rTableObj.GetGeoRect();
- const basegfx::B2DRange aObjectRange(
- rRectangle.Left(), rRectangle.Top(),
- rRectangle.Right(), rRectangle.Bottom());
-
- // create object matrix
- const GeoStat& rGeoStat(rTableObj.GetGeoStat());
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // get object transformation
+ const basegfx::B2DHomMatrix& rObjectMatrix(rTableObj.getSdrObjectTransformation());
// credate an invisible outline for the cases where no visible content exists
const drawinglayer::primitive2d::Primitive2DReference xReference(
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
false,
- aObjectMatrix));
+ rObjectMatrix));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 24b5e3de21eb..394d82a480da 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -354,9 +354,9 @@ SvxColorDockingWindow::~SvxColorDockingWindow()
void SvxColorDockingWindow::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- const SfxPoolItemHint *pPoolItemHint = PTR_CAST(SfxPoolItemHint, &rHint);
- if ( pPoolItemHint
- && ( pPoolItemHint->GetObject()->ISA( SvxColorTableItem ) ) )
+ const SfxPoolItemHint *pPoolItemHint = dynamic_cast< const SfxPoolItemHint* >( &rHint);
+
+ if ( pPoolItemHint && ( dynamic_cast< SvxColorTableItem* >(pPoolItemHint->GetObject()) ) )
{
// Die Liste der Farben hat sich geaendert
pColorTable = ( (SvxColorTableItem*) pPoolItemHint->GetObject() )->GetColorTable();
@@ -537,7 +537,7 @@ IMPL_LINK( SvxColorDockingWindow, SelectHdl, void *, EMPTYARG )
SdrView* pView = pViewSh->GetDrawView();
if ( pView )
{
- SfxItemSet aAttrSet( pView->GetModel()->GetItemPool() );
+ SfxItemSet aAttrSet( pView->getSdrModelFromSdrView().GetItemPool() );
pView->GetAttributes( aAttrSet );
if ( aAttrSet.GetItemState( XATTR_LINESTYLE ) != SFX_ITEM_DONTCARE )
{
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index c641b223978e..16ec2b3528c0 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -1035,7 +1035,7 @@ void ExtrusionColorControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SvxColorItem* pItem = 0;
if( SFX_ITEM_DONTCARE != eState )
- pItem = PTR_CAST( SvxColorItem, pState );
+ pItem = dynamic_cast< const SvxColorItem* >( pState );
if ( pItem )
mpBtnUpdater->Update( pItem->GetValue());
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 5a116a01d1b9..7e8919700b19 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -449,32 +449,28 @@ void SvxFillToolBoxControl::Update( const SfxPoolItem* pState )
XFillStyle eXFS = (XFillStyle) pStyleItem->GetValue();
// Die Listen haben sich geaendert ?
- if( pState->ISA( SvxColorTableItem ) &&
- eXFS == XFILL_SOLID )
+ if( dynamic_cast< const SvxColorTableItem* >(pState) && eXFS == XFILL_SOLID )
{
::Color aTmpColor( pFillAttrLB->GetSelectEntryColor() );
pFillAttrLB->Clear();
pFillAttrLB->Fill( ( (SvxColorTableItem*)pState )->GetColorTable() );
pFillAttrLB->SelectEntry( aTmpColor );
}
- if( pState->ISA( SvxGradientListItem ) &&
- eXFS == XFILL_GRADIENT )
+ if( dynamic_cast< const SvxGradientListItem* >(pState) && eXFS == XFILL_GRADIENT )
{
String aString( pFillAttrLB->GetSelectEntry() );
pFillAttrLB->Clear();
pFillAttrLB->Fill( ( (SvxGradientListItem*)pState )->GetGradientList() );
pFillAttrLB->SelectEntry( aString );
}
- if( pState->ISA( SvxHatchListItem ) &&
- eXFS == XFILL_HATCH )
+ if( dynamic_cast< const SvxHatchListItem* >(pState) && eXFS == XFILL_HATCH )
{
String aString( pFillAttrLB->GetSelectEntry() );
pFillAttrLB->Clear();
pFillAttrLB->Fill( ( (SvxHatchListItem*)pState )->GetHatchList() );
pFillAttrLB->SelectEntry( aString );
}
- if( pState->ISA( SvxBitmapListItem ) &&
- eXFS == XFILL_BITMAP )
+ if( dynamic_cast< const SvxBitmapListItem* >(pState) && eXFS == XFILL_BITMAP )
{
String aString( pFillAttrLB->GetSelectEntry() );
pFillAttrLB->Clear();
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 3b65f4f26c99..27ae06176ead 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -25,21 +25,15 @@
#include "precompiled_svx.hxx"
#include <com/sun/star/text/WritingMode.hpp>
-
#include <vcl/toolbox.hxx>
-
#include <svl/itempool.hxx>
-
#include <svtools/toolbarmenu.hxx>
#include <svtools/popupwindowcontroller.hxx>
#include <svtools/popupmenucontrollerbase.hxx>
-
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
-
#include <editeng/eeitem.hxx>
#include <editeng/frmdiritem.hxx>
-
#include <svx/fmmodel.hxx>
#include <svx/svxids.hrc>
#include <svx/dialmgr.hxx>
@@ -48,16 +42,13 @@
#include <svx/svdobj.hxx>
#include <svx/svdview.hxx>
#include <svx/svdoutl.hxx>
-
-#include "svx/gallery.hxx"
+#include <svx/gallery.hxx>
#include <svx/dlgutil.hxx>
-
#include <svx/fontworkgallery.hxx>
-#include "fontworkgallery.hrc"
-
+#include <fontworkgallery.hrc>
#include <algorithm>
-
-#include "helpid.hrc"
+#include <helpid.hrc>
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
using ::svtools::ToolbarMenu;
@@ -77,19 +68,21 @@ const int nLineCount = 4;
/*************************************************************************
|* Svx3DWin - FloatingWindow
\************************************************************************/
-FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, Window* pParent, sal_uInt16 /*nSID*/ ) :
- ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_GALLERY ) ),
- maFLFavorites ( this, SVX_RES( FL_FAVORITES ) ),
- maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ),
- maOKButton ( this, SVX_RES( BTN_OK ) ),
- maCancelButton ( this, SVX_RES( BTN_CANCEL ) ),
- maHelpButton ( this, SVX_RES( BTN_HELP ) ),
- mnThemeId ( 0xffff ),
- mpSdrView ( pSdrView ),
- mpModel ( (FmFormModel*)pSdrView->GetModel() ),
- maStrClickToAddText ( SVX_RES( STR_CLICK_TO_ADD_TEXT ) ),
- mppSdrObject ( NULL ),
- mpDestModel ( NULL )
+FontWorkGalleryDialog::FontWorkGalleryDialog(
+ SdrView& rSdrView,
+ Window* pParent,
+ SdrObject** ppSdrObject)
+: ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_GALLERY ) ),
+ maFLFavorites ( this, SVX_RES( FL_FAVORITES ) ),
+ maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ),
+ maOKButton ( this, SVX_RES( BTN_OK ) ),
+ maCancelButton ( this, SVX_RES( BTN_CANCEL ) ),
+ maHelpButton ( this, SVX_RES( BTN_HELP ) ),
+ mnThemeId ( 0xffff ),
+ mrSdrView ( rSdrView ),
+ mrModel ( dynamic_cast< FmFormModel& >(rSdrView.getSdrModelFromSdrView()) ),
+ maStrClickToAddText ( SVX_RES( STR_CLICK_TO_ADD_TEXT ) ),
+ mppSdrObject ( ppSdrObject )
{
FreeResource();
@@ -191,7 +184,7 @@ void FontWorkGalleryDialog::changeText( SdrTextObj* pObj )
{
if( pObj )
{
- SdrOutliner& rOutl = mpModel->GetDrawOutliner(pObj);
+ SdrOutliner& rOutl = mrModel.GetDrawOutliner(pObj);
sal_uInt16 nOutlMode = rOutl.GetMode();
Size aPaperSize = rOutl.GetPaperSize();
@@ -206,7 +199,7 @@ void FontWorkGalleryDialog::changeText( SdrTextObj* pObj )
// to inside this method to work even when outliner is fetched here.
rOutl.SetStyleSheet(0, pObj->GetStyleSheet());
- rOutl.SetPaperSize( pObj->GetLogicRect().GetSize() );
+ rOutl.SetPaperSize( sdr::legacy::GetLogicRect(*pObj).GetSize() );
rOutl.SetText( maStrClickToAddText, rOutl.GetParagraph( 0 ) );
pObj->SetOutlinerParaObject( rOutl.CreateParaObject() );
@@ -220,12 +213,6 @@ void FontWorkGalleryDialog::changeText( SdrTextObj* pObj )
}
}
-void FontWorkGalleryDialog::SetSdrObjectRef( SdrObject** ppSdrObject, SdrModel* pModel )
-{
- mppSdrObject = ppSdrObject;
- mpDestModel = pModel;
-}
-
void FontWorkGalleryDialog::insertSelectedFontwork()
{
sal_uInt16 nItemId = maCtlFavorites.GetSelectItemId();
@@ -238,41 +225,39 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
if( GalleryExplorer::GetSdrObj( mnThemeId, nItemId-1, pModel ) )
{
SdrPage* pPage = pModel->GetPage(0);
+
if( pPage && pPage->GetObjCount() )
{
- SdrObject* pNewObject = pPage->GetObj(0)->Clone();
+ SdrObject* pNewObject = pPage->GetObj(0)->CloneSdrObject(&mrModel);
// center shape on current view
- OutputDevice* pOutDev = mpSdrView->GetFirstOutputDevice();
+ OutputDevice* pOutDev = mrSdrView.GetFirstOutputDevice();
+
if( pOutDev )
{
- Rectangle aObjRect( pNewObject->GetLogicRect() );
- Rectangle aVisArea = pOutDev->PixelToLogic(Rectangle(Point(0,0), pOutDev->GetOutputSizePixel()));
-/*
- sal_Int32 nObjHeight = aObjRect.GetHeight();
- VirtualDevice aVirDev( 1 ); // calculating the optimal textwidth
- Font aFont;
- aFont.SetHeight( nObjHeight );
- aVirDev.SetMapMode( MAP_100TH_MM );
- aVirDev.SetFont( aFont );
- aObjRect.SetSize( Size( aVirDev.GetTextWidth( maStrClickToAddText ), nObjHeight ) );
-*/
- Point aPagePos = aVisArea.Center();
- aPagePos.X() -= aObjRect.GetWidth() / 2;
- aPagePos.Y() -= aObjRect.GetHeight() / 2;
- Rectangle aNewObjectRectangle(aPagePos, aObjRect.GetSize());
- SdrPageView* pPV = mpSdrView->GetSdrPageView();
+ const basegfx::B2DVector aHalfObjectScale(sdr::legacy::GetLogicRange(*pNewObject).getRange() * 0.5);
+ const basegfx::B2DPoint aVisibleCenter(pOutDev->GetLogicRange().getCenter());
+
+ sdr::legacy::SetLogicRange(*pNewObject,
+ basegfx::B2DRange(
+ aVisibleCenter - aHalfObjectScale,
+ aVisibleCenter + aHalfObjectScale));
- pNewObject->SetLogicRect(aNewObjectRectangle);
if ( mppSdrObject )
{
+ // if handle is given register SdrObject there. Ownership change!
*mppSdrObject = pNewObject;
- (*mppSdrObject)->SetModel( mpDestModel );
}
- else if( pPV )
+ else if( mrSdrView.GetSdrPageView() )
+ {
+ // if a SdrPage is given instert SdrObject there. Ownership change!
+ mrSdrView.InsertObjectAtView( *pNewObject );
+ }
+ else
{
- mpSdrView->InsertObjectAtView( pNewObject, *pPV );
- // changeText( PTR_CAST( SdrTextObj, pNewObject ) );
+ // no target for created SdrObject (!)
+ OSL_ENSURE(false, "FontWorkGalleryDialog: No target for created SDrObject (!)");
+ deleteSdrObjectSafeAndClearPointer(pNewObject);
}
}
}
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index af026ef86bb6..110ac1f0aa8b 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -45,14 +45,12 @@
#include <sfx2/basedlgs.hxx>
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
-
#include <svx/svxids.hrc>
#include "grafctrl.hrc"
#include <svx/dialogs.hrc>
#include <editeng/brshitem.hxx>
#include <editeng/sizeitem.hxx>
#include <svx/sdgcpitm.hxx>
-//CHINA001 #include "../dialog/grfpage.hxx"
#include <svx/itemwin.hxx>
#include <svx/dialmgr.hxx>
#include <svx/svdview.hxx>
@@ -60,8 +58,9 @@
#include <svx/svdograf.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdtrans.hxx>
-#include "svx/grafctrl.hxx"
-#include "svx/tbxcolor.hxx"
+#include <svx/svdlegacy.hxx>
+#include <svx/grafctrl.hxx>
+#include <svx/tbxcolor.hxx>
// namespaces
using ::rtl::OUString;
@@ -84,10 +83,6 @@ using namespace ::com::sun::star::lang;
// - TbxImageItem -
// ----------------
-TYPEINIT1_AUTOFACTORY( TbxImageItem, SfxUInt16Item );
-
-//---------------------------------------------------------
-
TbxImageItem::TbxImageItem( sal_uInt16 _nWhich, sal_uInt16 nImage ) :
SfxUInt16Item( _nWhich, nImage )
{
@@ -502,109 +497,6 @@ void ImplGrafModeControl::Update( const SfxPoolItem* pItem )
SetNoSelection();
}
-// -----------------------
-// - ImplGrafFilterPopup -
-// -----------------------
-/*
-CD!!!
-class ImplGrafFilterPopup : public SfxPopupWindow
-{
-private:
-
- SvxGrafFilterToolBoxControl* mpParent;
- Reference< XConfigurableUIElement > m_xToolBar;
-// SfxToolBoxManager maTbxMgr;
- ResId maResIdWin;
- ResId maResIdTbx;
- WindowAlign meTbxAlign;
- Link maSelectHdl;
-
- DECL_LINK( TbxSelectHdl, void* );
-
-public:
- ImplGrafFilterPopup( sal_uInt16 nId, SvxGrafFilterToolBoxControl* pParent,
- WindowAlign eAlign,
- const ResId& rResIdWin, const ResId& rResIdTbx,
- SfxBindings& rBindings );
- ~ImplGrafFilterPopup();
-
- virtual SfxPopupWindow* Clone() const;
- virtual void PopupModeEnd();
-
- void StartSelection() { maTbxMgr.GetToolBox().StartSelection(); }
- void Update();
-};
-
-// -----------------------------------------------------------------------------
-
-ImplGrafFilterPopup::ImplGrafFilterPopup( sal_uInt16 nId, SvxGrafFilterToolBoxControl* pParent,
- WindowAlign eAlign,
- const ResId& rResIdWin, const ResId& rResIdTbx ) :
- SfxPopupWindow ( nId, rResIdWin ),
- mpParent ( pParent ),
- maTbxMgr ( this, GetBindings(), rResIdTbx ),
- maResIdWin ( rResIdWin ),
- maResIdTbx ( rResIdTbx ),
- meTbxAlign ( eAlign )
-{
- maTbxMgr.UseDefault();
-
- maSelectHdl = maTbxMgr.GetToolBox().GetSelectHdl();
- maTbxMgr.GetToolBox().SetSelectHdl( LINK( this, ImplGrafFilterPopup, TbxSelectHdl ) );
-
- FreeResource();
-
- const Size aSize( maTbxMgr.CalcWindowSizePixel() );
- maTbxMgr.SetPosSizePixel( Point(), aSize );
- SetOutputSizePixel( aSize );
-}
-
-// -----------------------------------------------------------------------------
-
-ImplGrafFilterPopup::~ImplGrafFilterPopup()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-SfxPopupWindow* ImplGrafFilterPopup::Clone() const
-{
- return( new ImplGrafFilterPopup( GetId(), mpParent, meTbxAlign,
- maResIdWin, maResIdTbx,
- (SfxBindings&) GetBindings() ) );
-}
-
-// -----------------------------------------------------------------------------
-
-void ImplGrafFilterPopup::Update()
-{
- ToolBox* pBox = &maTbxMgr.GetToolBox();
- maTbxMgr.Activate( pBox );
- maTbxMgr.Deactivate( pBox );
-}
-
-// -----------------------------------------------------------------------------
-
-void ImplGrafFilterPopup::PopupModeEnd()
-{
- maTbxMgr.GetToolBox().EndSelection();
- SfxPopupWindow::PopupModeEnd();
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( ImplGrafFilterPopup, TbxSelectHdl, void*, EMPTYARG )
-{
- const sal_uInt16 nSlotId = maTbxMgr.GetToolBox().GetCurItemId();
-
- if( IsInPopupMode() )
- EndPopupMode();
-
- GetBindings().GetDispatcher()->Execute( nSlotId, SFX_CALLMODE_ASYNCHRON );
-
- return 0;
-}
-*/
// -------------------------------
// - SvxGrafFilterToolBoxControl -
// -------------------------------
@@ -850,14 +742,20 @@ Window* SvxGrafModeToolBoxControl::CreateItemWindow( Window *pParent )
void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
{
- SfxItemPool& rPool = rView.GetModel()->GetItemPool();
+ if(!rView.areSdrObjectsSelected())
+ {
+ return;
+ }
+
+ SfxItemPool& rPool = rView.getSdrModelFromSdrView().GetItemPool();
SfxItemSet aSet( rPool, SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST );
String aUndoStr;
const bool bUndo = rView.IsUndoEnabled();
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
if( bUndo )
{
- aUndoStr = rView.GetDescriptionOfMarkedObjects();
+ aUndoStr = getSelectionDescription(aSelection);
aUndoStr.Append( sal_Unicode(' ') );
}
@@ -960,144 +858,146 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
case( SID_ATTR_GRAF_CROP ):
{
- const SdrMarkList& rMarkList = rView.GetMarkedObjectList();
+ SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >(rView.getSelectedIfSingle());
- if( 0 < rMarkList.GetMarkCount() )
+ if(pObj && GRAPHIC_NONE != pObj->GetGraphicType() && GRAPHIC_DEFAULT != pObj->GetGraphicType())
{
- SdrGrafObj* pObj = (SdrGrafObj*) rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-
- if( pObj && pObj->ISA( SdrGrafObj ) &&
- ( pObj->GetGraphicType() != GRAPHIC_NONE ) &&
- ( pObj->GetGraphicType() != GRAPHIC_DEFAULT ) )
+ SfxItemSet aGrfAttr( rPool, SDRATTR_GRAFCROP, SDRATTR_GRAFCROP, 0 );
+ const SfxMapUnit eOldMetric(rPool.GetMetric(0));
+ const MapMode aMap100( MAP_100TH_MM );
+ const MapMode aMapTwip( MAP_TWIP );
+
+ aGrfAttr.Put(pObj->GetMergedItemSet());
+ rPool.SetDefaultMetric( SFX_MAPUNIT_TWIP );
+
+ SfxItemSet aCropDlgAttr( rPool,
+ SDRATTR_GRAFCROP, SDRATTR_GRAFCROP,
+ SID_ATTR_GRAF_GRAPHIC, SID_ATTR_GRAF_GRAPHIC,
+ SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
+ SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_FRMSIZE,
+ SID_ATTR_GRAF_CROP, SID_ATTR_GRAF_CROP, 0 );
+
+ aCropDlgAttr.Put( SvxBrushItem( pObj->GetGraphic(), GPOS_MM, SID_ATTR_GRAF_GRAPHIC ) );
+ aCropDlgAttr.Put( SvxSizeItem( SID_ATTR_PAGE_SIZE,
+ Size( OutputDevice::LogicToLogic(Size( 200000, 200000 ), aMap100, aMapTwip ) ) ) );
+ const basegfx::B2DVector& rObjScale(pObj->getSdrObjectScale());
+ const Size aOldObjSize(basegfx::fround(fabs(rObjScale.getX())), basegfx::fround(fabs(rObjScale.getY())));
+ aCropDlgAttr.Put( SvxSizeItem( SID_ATTR_GRAF_FRMSIZE, OutputDevice::LogicToLogic( aOldObjSize, aMap100, aMapTwip ) ) );
+ const SdrGrafCropItem& rCrop = (const SdrGrafCropItem&) aGrfAttr.Get( SDRATTR_GRAFCROP );
+ Size aLTSize( OutputDevice::LogicToLogic( Size( rCrop.GetLeft(), rCrop.GetTop() ), aMap100, aMapTwip ) );
+ Size aRBSize( OutputDevice::LogicToLogic( Size( rCrop.GetRight(), rCrop.GetBottom() ), aMap100, aMapTwip ) );
+ aCropDlgAttr.Put( SdrGrafCropItem( aLTSize.Width(), aLTSize.Height(), aRBSize.Width(), aRBSize.Height() ) );
+ SfxSingleTabDialog aCropDialog( SfxViewShell::Current() ? SfxViewShell::Current()->GetWindow() : NULL, aCropDlgAttr, 950 );
+ const String aCropStr = SVX_RESSTR( RID_SVXSTR_GRAFCROP );
+
+ //CHINA001 SfxTabPage* pTabPage = SvxGrfCropPage::Create( &aCropDialog, aCropDlgAttr );
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+ DBG_ASSERT(pFact, "Dialogdiet error!");//CHINA001
+ ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_GRFCROP );
+ DBG_ASSERT(fnCreatePage, "Dialogdiet error!");//CHINA001
+ SfxTabPage* pTabPage = (*fnCreatePage)( &aCropDialog, aCropDlgAttr );
+ //CHINA001 end
+
+ pTabPage->SetText( aCropStr );
+ aCropDialog.SetTabPage( pTabPage );
+
+ if( aCropDialog.Execute() == RET_OK )
{
- SfxItemSet aGrfAttr( rPool, SDRATTR_GRAFCROP, SDRATTR_GRAFCROP, 0 );
- const SfxMapUnit eOldMetric = rPool.GetMetric( 0 );
- const MapMode aMap100( MAP_100TH_MM );
- const MapMode aMapTwip( MAP_TWIP );
-
- aGrfAttr.Put(pObj->GetMergedItemSet());
- rPool.SetDefaultMetric( SFX_MAPUNIT_TWIP );
-
- SfxItemSet aCropDlgAttr( rPool,
- SDRATTR_GRAFCROP, SDRATTR_GRAFCROP,
- SID_ATTR_GRAF_GRAPHIC, SID_ATTR_GRAF_GRAPHIC,
- SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
- SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_FRMSIZE,
- SID_ATTR_GRAF_CROP, SID_ATTR_GRAF_CROP, 0 );
-
- aCropDlgAttr.Put( SvxBrushItem( pObj->GetGraphic(), GPOS_MM, SID_ATTR_GRAF_GRAPHIC ) );
- aCropDlgAttr.Put( SvxSizeItem( SID_ATTR_PAGE_SIZE,
- Size( OutputDevice::LogicToLogic(
- Size( 200000, 200000 ), aMap100, aMapTwip ) ) ) );
- aCropDlgAttr.Put( SvxSizeItem( SID_ATTR_GRAF_FRMSIZE, OutputDevice::LogicToLogic(
- pObj->GetLogicRect().GetSize(), aMap100, aMapTwip ) ) );
-
- const SdrGrafCropItem& rCrop = (const SdrGrafCropItem&) aGrfAttr.Get( SDRATTR_GRAFCROP );
- Size aLTSize( OutputDevice::LogicToLogic(
- Size( rCrop.GetLeft(), rCrop.GetTop() ), aMap100, aMapTwip ) );
- Size aRBSize( OutputDevice::LogicToLogic(
- Size( rCrop.GetRight(), rCrop.GetBottom() ), aMap100, aMapTwip ) );
-
- aCropDlgAttr.Put( SdrGrafCropItem( aLTSize.Width(), aLTSize.Height(),
- aRBSize.Width(), aRBSize.Height() ) );
-
- SfxSingleTabDialog aCropDialog( SfxViewShell::Current() ? SfxViewShell::Current()->GetWindow() : NULL,
- aCropDlgAttr, 950 );
- const String aCropStr = SVX_RESSTR( RID_SVXSTR_GRAFCROP );
- //CHINA001 SfxTabPage* pTabPage = SvxGrfCropPage::Create( &aCropDialog, aCropDlgAttr );
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet error!");//CHINA001
- ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_GRFCROP );
- DBG_ASSERT(fnCreatePage, "Dialogdiet error!");//CHINA001
- SfxTabPage* pTabPage = (*fnCreatePage)( &aCropDialog, aCropDlgAttr );
- //CHINA001 end
- pTabPage->SetText( aCropStr );
- aCropDialog.SetTabPage( pTabPage );
-
- if( aCropDialog.Execute() == RET_OK )
+ const SfxItemSet* pOutAttr = aCropDialog.GetOutputItemSet();
+
+ if( pOutAttr )
{
- const SfxItemSet* pOutAttr = aCropDialog.GetOutputItemSet();
+ aUndoStr.Append( String( SVX_RESSTR( RID_SVXSTR_UNDO_GRAFCROP ) ) );
+ bool bSetAttributes(false);
+ bool bSetTransformation(false);
+ basegfx::B2DHomMatrix aNewTransform;
- if( pOutAttr )
+ if( SFX_ITEM_SET <= pOutAttr->GetItemState( SDRATTR_GRAFCROP ) )
{
- aUndoStr.Append( String( SVX_RESSTR( RID_SVXSTR_UNDO_GRAFCROP ) ) );
+ const SdrGrafCropItem& rNewCrop = (const SdrGrafCropItem&) pOutAttr->Get( SDRATTR_GRAFCROP );
- // set crop attributes
- if( SFX_ITEM_SET <= pOutAttr->GetItemState( SDRATTR_GRAFCROP ) )
- {
- const SdrGrafCropItem& rNewCrop = (const SdrGrafCropItem&) pOutAttr->Get( SDRATTR_GRAFCROP );
+ aLTSize = OutputDevice::LogicToLogic( Size( rNewCrop.GetLeft(), rNewCrop.GetTop() ), aMapTwip, aMap100 );
+ aRBSize = OutputDevice::LogicToLogic( Size( rNewCrop.GetRight(), rNewCrop.GetBottom() ), aMapTwip, aMap100 );
+ aSet.Put( SdrGrafCropItem( aLTSize.Width(), aLTSize.Height(), aRBSize.Width(), aRBSize.Height() ) );
+ bSetAttributes = true;
+ }
+
+ if( SFX_ITEM_SET <= pOutAttr->GetItemState( SID_ATTR_GRAF_FRMSIZE ) )
+ {
+ const Size& rGrfSize = ( (const SvxSizeItem&) pOutAttr->Get( SID_ATTR_GRAF_FRMSIZE ) ).GetSize();
+ const Size aNewGrfSize( OutputDevice::LogicToLogic( rGrfSize, aMapTwip, aMap100 ) );
+ basegfx::B2DVector aNewScale(aNewGrfSize.getWidth(), aNewGrfSize.getHeight());
- aLTSize = OutputDevice::LogicToLogic( Size( rNewCrop.GetLeft(), rNewCrop.GetTop() ), aMapTwip, aMap100 );
- aRBSize = OutputDevice::LogicToLogic( Size( rNewCrop.GetRight(), rNewCrop.GetBottom() ), aMapTwip, aMap100 );
- aSet.Put( SdrGrafCropItem( aLTSize.Width(), aLTSize.Height(), aRBSize.Width(), aRBSize.Height() ) );
+ if(rObjScale.getX() < 0.0)
+ {
+ aNewScale.setX(-aNewScale.getX());
}
- // set new logic rect
- if( SFX_ITEM_SET <= pOutAttr->GetItemState( SID_ATTR_GRAF_FRMSIZE ) )
+ if(rObjScale.getY() < 0.0)
{
- Point aNewOrigin( pObj->GetLogicRect().TopLeft() );
- const Size& rGrfSize = ( (const SvxSizeItem&) pOutAttr->Get( SID_ATTR_GRAF_FRMSIZE ) ).GetSize();
- Size aNewGrfSize( OutputDevice::LogicToLogic( rGrfSize, aMapTwip, aMap100 ) );
- Size aOldGrfSize( pObj->GetLogicRect().GetSize() );
+ aNewScale.setY(-aNewScale.getY());
+ }
- Rectangle aNewRect( aNewOrigin, aNewGrfSize );
- Point aOffset( (aNewGrfSize.Width() - aOldGrfSize.Width()) >> 1,
- (aNewGrfSize.Height() - aOldGrfSize.Height()) >> 1 );
+ if(!aNewScale.equal(rObjScale))
+ {
+ // back to only scaled object
+ const basegfx::B2DPoint& rObjTranslate(pObj->getSdrObjectTranslate());
+ aNewTransform.translate(-rObjTranslate);
+ aNewTransform.rotate(-pObj->getSdrObjectRotate());
+ aNewTransform.shearX(-pObj->getSdrObjectShearX());
+
+ // adapt scale
+ aNewTransform.scale(
+ aNewScale.getX() / (basegfx::fTools::equalZero(rObjScale.getX()) ? 1.0 : rObjScale.getX()),
+ aNewScale.getY() / (basegfx::fTools::equalZero(rObjScale.getY()) ? 1.0 : rObjScale.getY()));
+
+ // add offset
+ const basegfx::B2DVector aOffset((aNewScale - rObjScale) * 0.5);
+ aNewTransform.translate(aOffset);
+
+ // re-apply rest of transformation
+ aNewTransform.shearX(pObj->getSdrObjectShearX());
+ aNewTransform.rotate(pObj->getSdrObjectRotate());
+ aNewTransform.translate(rObjTranslate);
+
+ bSetTransformation = true;
+ }
+ }
- // #106181# rotate snap rect before setting it
- const GeoStat& aGeo = pObj->GetGeoStat();
+ if(bSetAttributes || bSetTransformation)
+ {
+ if( bUndo )
+ {
+ rView.BegUndo( aUndoStr );
+ }
- if (aGeo.nDrehWink!=0 || aGeo.nShearWink!=0)
- {
- Polygon aPol(aNewRect);
-
- // also transform origin offset
- if (aGeo.nShearWink!=0)
- {
- ShearPoly(aPol,
- aNewRect.TopLeft(),
- aGeo.nTan);
- ShearPoint(aOffset, Point(0,0), aGeo.nTan);
- }
- if (aGeo.nDrehWink!=0)
- {
- RotatePoly(aPol,
- aNewRect.TopLeft(),
- aGeo.nSin,aGeo.nCos);
- RotatePoint(aOffset, Point(0,0), aGeo.nSin,aGeo.nCos);
- }
-
- // apply offset
- aPol.Move( -aOffset.X(), -aOffset.Y() );
- aNewRect=aPol.GetBoundRect();
- }
- else
+ if(bSetTransformation)
+ {
+ if(bUndo)
{
- aNewRect.Move( -aOffset.X(), -aOffset.Y() );
+ rView.AddUndo( rView.getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
}
- if( !aSet.Count() )
- rView.SetMarkedObjRect( aNewRect );
- else
- {
- if( bUndo )
- {
- rView.BegUndo( aUndoStr );
- rView.AddUndo( rView.GetModel()->GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
- }
- pObj->SetSnapRect( aNewRect );
- rView.SetAttributes( aSet );
-
- if( bUndo )
- rView.EndUndo();
- aSet.ClearItem();
- }
+ pObj->setSdrObjectTransformation(aNewTransform);
+ }
+
+ if(bSetAttributes)
+ {
+ rView.SetAttributes( aSet );
+ }
+
+ if( bUndo )
+ {
+ rView.EndUndo();
}
+
+ // guess: should only clear SID_ATTR_GRAF_CROP..?
+ aSet.ClearItem();
}
}
-
- rPool.SetDefaultMetric( eOldMetric );
}
+
+ rPool.SetDefaultMetric( eOldMetric );
}
}
break;
@@ -1130,18 +1030,18 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView )
{
- SfxItemPool& rPool = rView.GetModel()->GetItemPool();
+ SfxItemPool& rPool = rView.getSdrModelFromSdrView().GetItemPool();
SfxItemSet aAttrSet( rPool );
SfxWhichIter aIter( rSet );
- sal_uInt16 nWhich = aIter.FirstWhich();
- const SdrMarkList& rMarkList = rView.GetMarkedObjectList();
- bool bEnableColors = true;
- bool bEnableTransparency = true;
- bool bEnableCrop = ( 1 == rMarkList.GetMarkCount() );
+ sal_uInt16 nWhich(aIter.FirstWhich());
+ const SdrObjectVector aSelection(rView.getSelectedSdrObjectVectorFromSdrMarkView());
+ bool bEnableColors(true);
+ bool bEnableTransparency(true);
+ bool bEnableCrop(1 == aSelection.size());
- for( int i = 0, nCount = rMarkList.GetMarkCount(); i < nCount; ++i )
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( i )->GetMarkedSdrObj() );
+ SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( aSelection[i] );
if( !pGrafObj ||
( pGrafObj->GetGraphicType() == GRAPHIC_NONE ) ||
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index 722704c67c8d..595517ea17d4 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -819,7 +819,7 @@ SfxPopupWindow* SvxTableToolBoxControl::CreatePopupWindowCascading()
void SvxTableToolBoxControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState )
{
- if ( pState && pState->ISA(SfxUInt16Item) )
+ if ( pState && dynamic_cast< const SfxUInt16Item* >(pState) )
{
sal_Int16 nValue = static_cast< const SfxUInt16Item* >( pState )->GetValue();
bEnabled = ( nValue != 0 );
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 9b80fc642fc0..90841ac391dd 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -286,7 +286,7 @@ void SvxUndoRedoControl::StateChanged(
ToolBox& rBox = GetToolBox();
rBox.SetQuickHelpText( GetId(), aDefaultText );
}
- else if ( pState && pState->ISA( SfxStringItem ) )
+ else if ( pState && dynamic_cast< const SfxStringItem* >(pState) )
{
SfxStringItem& rItem = *(SfxStringItem *)pState;
ToolBox& rBox = GetToolBox();
@@ -299,7 +299,7 @@ void SvxUndoRedoControl::StateChanged(
{
aUndoRedoList.clear();
- if ( pState && pState->ISA( SfxStringListItem ) )
+ if ( pState && dynamic_cast< const SfxStringListItem* >(pState) )
{
SfxStringListItem &rItem = *(SfxStringListItem *)pState;
const List* pLst = rItem.GetList();
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index ec47f8d3c6e9..01043d0cf2d1 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -56,23 +56,6 @@ using namespace ::com::sun::star::lang;
// STATIC DATA -----------------------------------------------------------
-#define RESIZE_VALUE_POPUP(value_set) \
-{ \
- Size aSize = GetOutputSizePixel(); \
- aSize.Width() -= 4; \
- aSize.Height() -= 4; \
- (value_set).SetPosSizePixel( Point(2,2), aSize ); \
-}
-
-#define CALCSIZE_VALUE_POPUP(value_set,item_size) \
-{ \
- Size aSize = (value_set).CalcWindowSizePixel( (item_size) ); \
- aSize.Width() += 4; \
- aSize.Height() += 4; \
- SetOutputSizePixel( aSize ); \
-}
-
-
SFX_IMPL_TOOLBOX_CONTROL( SvxLineStyleToolBoxControl, XLineStyleItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxLineWidthToolBoxControl, XLineWidthItem );
SFX_IMPL_TOOLBOX_CONTROL( SvxLineColorToolBoxControl, XLineColorItem );
@@ -199,7 +182,7 @@ void SvxLineStyleToolBoxControl::Update( const SfxPoolItem* pState )
}
}
- if ( pState && ( pState->ISA( SvxDashListItem ) ) )
+ if ( pState && ( dynamic_cast< const SvxDashListItem* >(pState) ) )
{
// Die Liste der Linienstile hat sich geaendert
SvxLineBox* pBox = (SvxLineBox*)GetToolBox().GetItemWindow( GetId() );
@@ -266,7 +249,7 @@ void SvxLineWidthToolBoxControl::StateChanged(
if ( eState == SFX_ITEM_AVAILABLE )
{
- DBG_ASSERT( pState->ISA(XLineWidthItem), "falscher ItemType" );
+ DBG_ASSERT( dynamic_cast< const XLineWidthItem* >(pState), "falscher ItemType" );
// Core-Unit an MetricField uebergeben
// Darf nicht in CreateItemWin() geschehen!
@@ -330,7 +313,7 @@ void SvxLineColorToolBoxControl::StateChanged(
if ( eState == SFX_ITEM_AVAILABLE )
{
- DBG_ASSERT( pState->ISA(XLineColorItem), "falscher ItemTyoe" );
+ DBG_ASSERT( dynamic_cast< const XLineColorItem* >(pState), "falscher ItemTyoe" );
pBox->Update( (const XLineColorItem*) pState );
}
else
@@ -345,7 +328,7 @@ void SvxLineColorToolBoxControl::StateChanged(
void SvxLineColorToolBoxControl::Update( const SfxPoolItem* pState )
{
- if ( pState && ( pState->ISA( SvxColorTableItem ) ) )
+ if ( pState && ( dynamic_cast< const SvxColorTableItem* >(pState) ) )
{
SvxColorBox* pBox = (SvxColorBox*)GetToolBox().GetItemWindow( GetId() );
@@ -663,7 +646,7 @@ void SvxLineEndWindow::StateChanged(
if ( nSID == SID_LINEEND_LIST )
{
// Die Liste der LinienEnden (LineEndList) hat sich geaendert:
- if ( pState && pState->ISA( SvxLineEndListItem ))
+ if ( pState && dynamic_cast< const SvxLineEndListItem* >(pState))
{
pLineEndList = ((SvxLineEndListItem*)pState)->GetLineEndList();
DBG_ASSERT( pLineEndList, "LineEndList nicht gefunden" );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index b9703c6975e1..b6c0b18d0b33 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1012,7 +1012,7 @@ void SvxColorWindow_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eState, co
{
if (( SFX_ITEM_DISABLED != eState ) && pState )
{
- if (( nSID == SID_COLOR_TABLE ) && ( pState->ISA( SvxColorTableItem )))
+ if (( nSID == SID_COLOR_TABLE ) && ( dynamic_cast< const SvxColorTableItem* >(pState)))
{
XColorTable* pColorTable = pState ? ((SvxColorTableItem *)pState)->GetColorTable() : NULL;
@@ -1278,7 +1278,7 @@ void SvxFrameWindow_Impl::StateChanged(
{
if ( pState && nSID == SID_BORDER_REDUCED_MODE)
{
- const SfxBoolItem* pItem = PTR_CAST( SfxBoolItem, pState );
+ const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >( pState );
if ( pItem )
{
@@ -1723,8 +1723,7 @@ void SfxStyleControllerItem_Impl::StateChanged(
if ( SFX_ITEM_AVAILABLE == eState )
{
- const SfxTemplateItem* pStateItem =
- PTR_CAST( SfxTemplateItem, pState );
+ const SfxTemplateItem* pStateItem = dynamic_cast< const SfxTemplateItem* >( pState );
DBG_ASSERT( pStateItem != NULL, "SfxTemplateItem expected" );
rControl.SetFamilyState( nIdx, pStateItem );
}
@@ -2373,7 +2372,7 @@ void SvxFontColorToolBoxControl::StateChanged(
const SvxColorItem* pItem = 0;
if ( SFX_ITEM_DONTCARE != eState )
- pItem = PTR_CAST( SvxColorItem, pState );
+ pItem = dynamic_cast< const SvxColorItem* >( pState );
if ( pItem )
pBtnUpdater->Update( pItem->GetValue());
@@ -2441,7 +2440,7 @@ void SvxColorToolBoxControl::StateChanged(
{
const SvxColorItem* pItem = 0;
if ( SFX_ITEM_DONTCARE != eState )
- pItem = PTR_CAST( SvxColorItem, pState );
+ pItem = dynamic_cast< const SvxColorItem* >( pState );
if ( pItem )
pBtnUpdater->Update( pItem->GetValue() );
@@ -2528,7 +2527,7 @@ void SvxFontColorExtToolBoxControl::StateChanged(
{
if ( SFX_ITEM_DONTCARE != eState )
{
- const SfxBoolItem* pBool = PTR_CAST( SfxBoolItem, pState );
+ const SfxBoolItem* pBool = dynamic_cast< const SfxBoolItem* >( pState );
rTbx.CheckItem( nId, pBool && pBool->GetValue());
}
rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
@@ -2536,7 +2535,7 @@ void SvxFontColorExtToolBoxControl::StateChanged(
else
{
if ( SFX_ITEM_DONTCARE != eState )
- pItem = PTR_CAST( SvxColorItem, pState );
+ pItem = dynamic_cast< const SvxColorItem* >( pState );
if ( pItem )
pBtnUpdater->Update( pItem->GetValue() );
@@ -2728,7 +2727,7 @@ void SvxFrameLineColorToolBoxControl::StateChanged(
const SvxColorItem* pItem = 0;
if ( SFX_ITEM_DONTCARE != eState )
{
- pItem = PTR_CAST( SvxColorItem, pState );
+ pItem = dynamic_cast< const SvxColorItem* >( pState );
if ( pItem )
pBtnUpdater->Update( pItem->GetValue());
}
@@ -2776,7 +2775,7 @@ SvxReloadControllerItem::~SvxReloadControllerItem()
void SvxReloadControllerItem::StateChanged(
sal_uInt16 , SfxItemState eState, const SfxPoolItem* pState )
{
- SfxBoolItem* pItem = PTR_CAST( SfxBoolItem, pState );
+ const SfxBoolItem* pItem = dynamic_cast< const SfxBoolItem* >( pState );
ToolBox& rBox = GetToolBox();
if( pItem )
{
@@ -2807,7 +2806,7 @@ SvxSimpleUndoRedoController::~SvxSimpleUndoRedoController()
void SvxSimpleUndoRedoController::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState )
{
- SfxStringItem* pItem = PTR_CAST( SfxStringItem, pState );
+ const SfxStringItem* pItem = dynamic_cast< const SfxStringItem* >( pState );
ToolBox& rBox = GetToolBox();
if ( pItem && eState != SFX_ITEM_DISABLED )
{
@@ -2843,7 +2842,7 @@ void lcl_CalcSizeValueSet( Window &rWin, ValueSet &rValueSet, const Size &aItemS
sal_Bool lcl_FontChangedHint( const SfxHint &rHint )
{
- SfxPoolItemHint *pItemHint = PTR_CAST(SfxPoolItemHint, &rHint);
+ const SfxPoolItemHint *pItemHint = dynamic_cast< const SfxPoolItemHint* >( &rHint);
if ( pItemHint )
{
SfxPoolItem *pItem = pItemHint->GetObject();
@@ -2851,7 +2850,7 @@ sal_Bool lcl_FontChangedHint( const SfxHint &rHint )
}
else
{
- SfxSimpleHint* pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >( &rHint);
return pSimpleHint && ( SFX_HINT_DATACHANGED ==
( pSimpleHint->GetId() & SFX_HINT_DATACHANGED ) );
}
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index 1c8070fcadae..4e4ab403fd8f 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -78,9 +78,6 @@ SFX_IMPL_INTERFACE(ExtrusionBar, SfxShell, SVX_RES(RID_SVX_EXTRUSION_BAR))
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT, SVX_RES(RID_SVX_EXTRUSION_BAR) );
}
-TYPEINIT1( ExtrusionBar, SfxShell );
-
-
/*************************************************************************
|*
|* Standard-Konstruktor
@@ -333,8 +330,8 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_3D_COLOR ) == SFX_ITEM_SET)
{
Color aColor( ((const SvxColorItem&)rReq.GetArgs()->Get(SID_EXTRUSION_3D_COLOR)).GetValue() );
-
const bool bAuto = aColor == COL_AUTO;
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
com::sun::star::beans::PropertyValue aPropValue;
aPropValue.Name = sExtrusionColor;
@@ -349,7 +346,6 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
{
pObj->SetMergedItem( XSecondaryFillColorItem( String(), aColor ) );
}
- pObj->BroadcastObjectChange();
}
}
break;
@@ -570,34 +566,32 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB
} // PASSTROUGH
case SID_EXTRUSION_LIGHTING_DIRECTION:
{
+ if(pSdrView->areSdrObjectsSelected())
+ {
if ( !nStrResId )
nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_LIGHTING;
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
- for(i=0; i<nCount; i++)
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
if( bUndo )
{
String aStr( SVX_RES( nStrResId ) );
pSdrView->BegUndo( aStr );
- pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ pSdrView->AddUndo( pSdrView->getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
}
SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
impl_execute( pSdrView, rReq, aGeometryItem, pObj );
pObj->SetMergedItem( aGeometryItem );
- pObj->BroadcastObjectChange();
if( bUndo )
pSdrView->EndUndo();
-
- // simulate a context change:
- // force SelectionHasChanged() being called
- // so that extrusion bar will be visible/hidden
- pSdrView->MarkListHasChanged();
+ }
}
}
}
@@ -651,24 +645,24 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB
void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
+ double fFinalSkewAngle = -1;
+ bool bHasCustomShape = false;
+ if(pSdrView->areSdrObjectsSelected())
+ {
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
static const rtl::OUString sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
static const rtl::OUString sOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) );
static const rtl::OUString sSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) );
static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
-
com::sun::star::uno::Any* pAny;
- double fFinalSkewAngle = -1;
- bool bHasCustomShape = false;
-
- for(i=0;i<nCount; i++)
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
{
SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
@@ -793,6 +787,7 @@ void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet )
break;
}
}
+ }
if( bHasCustomShape )
rSet.Put( SfxInt32Item( SID_EXTRUSION_DIRECTION, (sal_Int32)fFinalSkewAngle ) );
@@ -802,50 +797,51 @@ void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet )
void getExtrusionProjectionState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
- static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
-
- com::sun::star::uno::Any* pAny;
-
sal_Int32 nFinalProjection = -1;
bool bHasCustomShape = false;
- for(i=0;i<nCount; i++)
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+ static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
+ com::sun::star::uno::Any* pAny;
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- // see if this is an extruded customshape
- if( !bHasCustomShape )
- {
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
- if( pAny_ )
- *pAny_ >>= bHasCustomShape;
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+ if( pObj )
+ {
+ // see if this is an extruded customshape
if( !bHasCustomShape )
- continue;
- }
+ {
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+ if( pAny_ )
+ *pAny_ >>= bHasCustomShape;
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ if( !bHasCustomShape )
+ continue;
+ }
- sal_Bool bParallel = sal_True;
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sProjectionMode );
- ProjectionMode eProjectionMode;
- if( pAny && ( *pAny >>= eProjectionMode ) )
- bParallel = eProjectionMode == ProjectionMode_PARALLEL;
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- if( nFinalProjection == -1 )
- {
- nFinalProjection = bParallel;
- }
- else if( nFinalProjection != bParallel )
- {
- nFinalProjection = -1;
- break;
+ sal_Bool bParallel = sal_True;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sProjectionMode );
+ ProjectionMode eProjectionMode;
+ if( pAny && ( *pAny >>= eProjectionMode ) )
+ bParallel = eProjectionMode == ProjectionMode_PARALLEL;
+
+ if( nFinalProjection == -1 )
+ {
+ nFinalProjection = bParallel;
+ }
+ else if( nFinalProjection != bParallel )
+ {
+ nFinalProjection = -1;
+ break;
+ }
}
}
}
@@ -858,83 +854,84 @@ void getExtrusionProjectionState( SdrView* pSdrView, SfxItemSet& rSet )
void getExtrusionSurfaceState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
- static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- static const rtl::OUString sShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) );
- static const rtl::OUString sSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
- static const rtl::OUString sDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
- static const rtl::OUString sMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
-
- com::sun::star::uno::Any* pAny;
-
sal_Int32 nFinalSurface = -1;
bool bHasCustomShape = false;
- for(i=0;i<nCount; i++)
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+ static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ static const rtl::OUString sShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) );
+ static const rtl::OUString sSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
+ static const rtl::OUString sDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
+ static const rtl::OUString sMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
+ com::sun::star::uno::Any* pAny;
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
- // see if this is an extruded customshape
- if( !bHasCustomShape )
+ if( pObj )
{
- Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
- if( pAny_ )
- *pAny_ >>= bHasCustomShape;
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ // see if this is an extruded customshape
if( !bHasCustomShape )
- continue;
- }
+ {
+ Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+ if( pAny_ )
+ *pAny_ >>= bHasCustomShape;
- sal_Int32 nSurface = 0; // wire frame
+ if( !bHasCustomShape )
+ continue;
+ }
- ShadeMode eShadeMode( ShadeMode_FLAT );
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sShadeMode );
- if( pAny )
- *pAny >>= eShadeMode;
+ sal_Int32 nSurface = 0; // wire frame
- if( eShadeMode == ShadeMode_FLAT )
- {
- sal_Bool bMetal = sal_False;
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sMetal );
+ ShadeMode eShadeMode( ShadeMode_FLAT );
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sShadeMode );
if( pAny )
- *pAny >>= bMetal;
+ *pAny >>= eShadeMode;
- if( bMetal )
- {
- nSurface = 3; // metal
- }
- else
+ if( eShadeMode == ShadeMode_FLAT )
{
- double fSpecularity = 0;
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sSpecularity );
+ sal_Bool bMetal = sal_False;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sMetal );
if( pAny )
- *pAny >>= fSpecularity;
+ *pAny >>= bMetal;
- const double e = 0.0001;
- if( (fSpecularity > -e) && (fSpecularity < e) )
+ if( bMetal )
{
- nSurface = 1; // matte
+ nSurface = 3; // metal
}
else
{
- nSurface = 2; // plastic
+ double fSpecularity = 0;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sSpecularity );
+ if( pAny )
+ *pAny >>= fSpecularity;
+
+ const double e = 0.0001;
+ if( (fSpecularity > -e) && (fSpecularity < e) )
+ {
+ nSurface = 1; // matte
+ }
+ else
+ {
+ nSurface = 2; // plastic
+ }
}
}
- }
- if( nFinalSurface == -1 )
- {
- nFinalSurface = nSurface;
- }
- else if( nFinalSurface != nSurface )
- {
- nFinalSurface = -1;
- break;
+ if( nFinalSurface == -1 )
+ {
+ nFinalSurface = nSurface;
+ }
+ else if( nFinalSurface != nSurface )
+ {
+ nFinalSurface = -1;
+ break;
+ }
}
}
}
@@ -947,61 +944,59 @@ void getExtrusionSurfaceState( SdrView* pSdrView, SfxItemSet& rSet )
void getExtrusionDepthState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
- static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- static const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
-
- com::sun::star::uno::Any* pAny;
-
double fFinalDepth = -1;
bool bHasCustomShape = false;
- for(i=0;i<nCount; i++)
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+ static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ static const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
+ com::sun::star::uno::Any* pAny;
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
- // see if this is an extruded customshape
- if( !bHasCustomShape )
+ if( pObj )
{
- Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
- if( pAny_ )
- *pAny_ >>= bHasCustomShape;
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ // see if this is an extruded customshape
if( !bHasCustomShape )
- continue;
- }
+ {
+ Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+ if( pAny_ )
+ *pAny_ >>= bHasCustomShape;
- double fDepth = 1270.0;
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sDepth );
- if( pAny )
- {
- EnhancedCustomShapeParameterPair aDepthPropPair;
- if ( *pAny >>= aDepthPropPair )
- aDepthPropPair.First.Value >>= fDepth;
- }
+ if( !bHasCustomShape )
+ continue;
+ }
- if( fFinalDepth == -1 )
- {
- fFinalDepth = fDepth;
- }
- else if( fFinalDepth != fDepth )
- {
- fFinalDepth = -1;
- break;
+ double fDepth = 1270.0;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sDepth );
+ if( pAny )
+ {
+ EnhancedCustomShapeParameterPair aDepthPropPair;
+ if ( *pAny >>= aDepthPropPair )
+ aDepthPropPair.First.Value >>= fDepth;
+ }
+
+ if( fFinalDepth == -1 )
+ {
+ fFinalDepth = fDepth;
+ }
+ else if( fFinalDepth != fDepth )
+ {
+ fFinalDepth = -1;
+ break;
+ }
}
}
}
- if( pSdrView->GetModel() )
- {
- FieldUnit eUnit = pSdrView->GetModel()->GetUIUnit();
+ FieldUnit eUnit = pSdrView->getSdrModelFromSdrView().GetUIUnit();
rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)eUnit ) );
- }
if( bHasCustomShape )
rSet.Put( SvxDoubleItem( fFinalDepth, SID_EXTRUSION_DEPTH ) );
@@ -1027,76 +1022,75 @@ static bool compare_direction( const Direction3D& d1, const Direction3D& d2 )
void getExtrusionLightingDirectionState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
- static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- static const rtl::OUString sFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
- static const rtl::OUString sSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
-
- const Direction3D * pLighting1Defaults;
- const Direction3D * pLighting2Defaults;
-
- getLightingDirectionDefaults( &pLighting1Defaults, &pLighting2Defaults );
-
- com::sun::star::uno::Any* pAny;
-
int nFinalDirection = -1;
bool bHasCustomShape = false;
- for(i=0;i<nCount; i++)
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+ static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ static const rtl::OUString sFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
+ static const rtl::OUString sSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
+ const Direction3D * pLighting1Defaults;
+ const Direction3D * pLighting2Defaults;
+ getLightingDirectionDefaults( &pLighting1Defaults, &pLighting2Defaults );
+ com::sun::star::uno::Any* pAny;
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
- // see if this is an extruded customshape
- if( !bHasCustomShape )
+ if( pObj )
{
- Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
- if( pAny_ )
- *pAny_ >>= bHasCustomShape;
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ // see if this is an extruded customshape
if( !bHasCustomShape )
- continue;
- }
+ {
+ Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+ if( pAny_ )
+ *pAny_ >>= bHasCustomShape;
- Direction3D aFirstLightDirection( 50000, 0, 10000 );
- Direction3D aSecondLightDirection( -50000, 0, 10000 );
+ if( !bHasCustomShape )
+ continue;
+ }
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sFirstLightDirection );
- if( pAny )
- *pAny >>= aFirstLightDirection;
+ Direction3D aFirstLightDirection( 50000, 0, 10000 );
+ Direction3D aSecondLightDirection( -50000, 0, 10000 );
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sSecondLightDirection );
- if( pAny )
- *pAny >>= aSecondLightDirection;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sFirstLightDirection );
+ if( pAny )
+ *pAny >>= aFirstLightDirection;
- int nDirection = -1;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sSecondLightDirection );
+ if( pAny )
+ *pAny >>= aSecondLightDirection;
- int j;
- for( j = 0; j < 9; j++ )
- {
- if( compare_direction( aFirstLightDirection, pLighting1Defaults[j] ) &&
- compare_direction( aSecondLightDirection, pLighting2Defaults[j] ))
+ int nDirection = -1;
+
+ int j;
+ for( j = 0; j < 9; j++ )
{
- nDirection = j;
- break;
+ if( compare_direction( aFirstLightDirection, pLighting1Defaults[j] ) &&
+ compare_direction( aSecondLightDirection, pLighting2Defaults[j] ))
+ {
+ nDirection = j;
+ break;
+ }
}
- }
- if( nFinalDirection == -1 )
- {
- nFinalDirection = nDirection;
- }
- else if( nDirection != nFinalDirection )
- {
- nFinalDirection = -1;
- }
+ if( nFinalDirection == -1 )
+ {
+ nFinalDirection = nDirection;
+ }
+ else if( nDirection != nFinalDirection )
+ {
+ nFinalDirection = -1;
+ }
- if( nFinalDirection == -1 )
- break;
+ if( nFinalDirection == -1 )
+ break;
+ }
}
}
@@ -1108,62 +1102,63 @@ void getExtrusionLightingDirectionState( SdrView* pSdrView, SfxItemSet& rSet )
void getExtrusionLightingIntensityState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
- static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- static const rtl::OUString sBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
-
- com::sun::star::uno::Any* pAny;
-
int nFinalLevel = -1;
bool bHasCustomShape = false;
- for(i=0;i<nCount; i++)
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+ static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ static const rtl::OUString sBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
+ com::sun::star::uno::Any* pAny;
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
- // see if this is an extruded customshape
- if( !bHasCustomShape )
+ if( pObj )
{
- Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
- if( pAny_ )
- *pAny_ >>= bHasCustomShape;
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ // see if this is an extruded customshape
if( !bHasCustomShape )
- continue;
- }
+ {
+ Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+ if( pAny_ )
+ *pAny_ >>= bHasCustomShape;
- double fBrightness = 22178.0 / 655.36;
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sBrightness );
- if( pAny )
- *pAny >>= fBrightness;
+ if( !bHasCustomShape )
+ continue;
+ }
- int nLevel;
- if( fBrightness >= 30.0 )
- {
- nLevel = 0; // Bright
- }
- else if( fBrightness >= 10.0 )
- {
- nLevel = 1; // Noraml;
- }
- else
- {
- nLevel = 2; // Dim
- }
+ double fBrightness = 22178.0 / 655.36;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sBrightness );
+ if( pAny )
+ *pAny >>= fBrightness;
- if( nFinalLevel == -1 )
- {
- nFinalLevel = nLevel;
- }
- else if( nFinalLevel != nLevel )
- {
- nFinalLevel = -1;
- break;
+ int nLevel;
+ if( fBrightness >= 30.0 )
+ {
+ nLevel = 0; // Bright
+ }
+ else if( fBrightness >= 10.0 )
+ {
+ nLevel = 1; // Noraml;
+ }
+ else
+ {
+ nLevel = 2; // Dim
+ }
+
+ if( nFinalLevel == -1 )
+ {
+ nFinalLevel = nLevel;
+ }
+ else if( nFinalLevel != nLevel )
+ {
+ nFinalLevel = -1;
+ break;
+ }
}
}
}
@@ -1176,63 +1171,64 @@ void getExtrusionLightingIntensityState( SdrView* pSdrView, SfxItemSet& rSet )
void getExtrusionColorState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
- static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
- static const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
-
- com::sun::star::uno::Any* pAny;
-
- bool bInit = false;
bool bAmbigius = false;
Color aFinalColor;
bool bHasCustomShape = false;
- for(i=0;i<nCount; i++)
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+ static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
+ static const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
+ com::sun::star::uno::Any* pAny;
+ bool bInit = false;
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
- // see if this is an extruded customshape
- if( !bHasCustomShape )
+ if( pObj )
{
- Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
- if( pAny_ )
- *pAny_ >>= bHasCustomShape;
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ // see if this is an extruded customshape
if( !bHasCustomShape )
- continue;
- }
+ {
+ Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+ if( pAny_ )
+ *pAny_ >>= bHasCustomShape;
- Color aColor;
+ if( !bHasCustomShape )
+ continue;
+ }
- bool bUseColor = false;
- pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusionColor );
- if( pAny )
- *pAny >>= bUseColor;
+ Color aColor;
- if( bUseColor )
- {
- const XSecondaryFillColorItem& rItem = *(XSecondaryFillColorItem*)&(pObj->GetMergedItem( XATTR_SECONDARYFILLCOLOR ));
- aColor = rItem.GetColorValue();
- }
- else
- {
- aColor = COL_AUTO;
- }
+ bool bUseColor = false;
+ pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusionColor );
+ if( pAny )
+ *pAny >>= bUseColor;
- if( !bInit )
- {
- aFinalColor = aColor;
- bInit = true;
- }
- else if( aFinalColor != aColor )
- {
- bAmbigius = true;
- break;
+ if( bUseColor )
+ {
+ const XSecondaryFillColorItem& rItem = *(XSecondaryFillColorItem*)&(pObj->GetMergedItem( XATTR_SECONDARYFILLCOLOR ));
+ aColor = rItem.GetColorValue();
+ }
+ else
+ {
+ aColor = COL_AUTO;
+ }
+
+ if( !bInit )
+ {
+ aFinalColor = aColor;
+ bInit = true;
+ }
+ else if( aFinalColor != aColor )
+ {
+ bAmbigius = true;
+ break;
+ }
}
}
}
@@ -1250,26 +1246,29 @@ namespace svx {
bool checkForSelectedCustomShapes( SdrView* pSdrView, bool bOnlyExtruded )
{
static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
-
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
bool bFound = false;
- for(i=0;(i<nCount) && !bFound ; i++)
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); ( i < aSelection.size()) && !bFound ; i++)
{
- if( bOnlyExtruded )
- {
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- Any* pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
- if( pAny )
- *pAny >>= bFound;
- }
- else
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
{
- bFound = true;
+ if( bOnlyExtruded )
+ {
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ Any* pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+ if( pAny )
+ *pAny >>= bFound;
+ }
+ else
+ {
+ bFound = true;
+ }
}
}
}
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index 9937091de561..6a1614339ebb 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -60,118 +60,137 @@ using namespace ::com::sun::star::uno;
void SetAlignmentState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
sal_Int32 nAlignment = -1;
- for( i = 0; i < nCount; i++ )
+
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- sal_Int32 nOldAlignment = nAlignment;
- SdrTextHorzAdjustItem& rTextHorzAdjustItem = (SdrTextHorzAdjustItem&)pObj->GetMergedItem( SDRATTR_TEXT_HORZADJUST );
- SdrTextFitToSizeTypeItem& rTextFitToSizeTypeItem = (SdrTextFitToSizeTypeItem&)pObj->GetMergedItem( SDRATTR_TEXT_FITTOSIZE );
- switch ( rTextHorzAdjustItem.GetValue() )
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
{
- case SDRTEXTHORZADJUST_LEFT : nAlignment = 0; break;
- case SDRTEXTHORZADJUST_CENTER : nAlignment = 1; break;
- case SDRTEXTHORZADJUST_RIGHT : nAlignment = 2; break;
- case SDRTEXTHORZADJUST_BLOCK :
+ sal_Int32 nOldAlignment = nAlignment;
+ SdrTextHorzAdjustItem& rTextHorzAdjustItem = (SdrTextHorzAdjustItem&)pObj->GetMergedItem( SDRATTR_TEXT_HORZADJUST );
+ SdrTextFitToSizeTypeItem& rTextFitToSizeTypeItem = (SdrTextFitToSizeTypeItem&)pObj->GetMergedItem( SDRATTR_TEXT_FITTOSIZE );
+ switch ( rTextHorzAdjustItem.GetValue() )
+ {
+ case SDRTEXTHORZADJUST_LEFT : nAlignment = 0; break;
+ case SDRTEXTHORZADJUST_CENTER : nAlignment = 1; break;
+ case SDRTEXTHORZADJUST_RIGHT : nAlignment = 2; break;
+ case SDRTEXTHORZADJUST_BLOCK :
+ {
+ if ( rTextFitToSizeTypeItem.GetValue() == SDRTEXTFIT_NONE )
+ nAlignment = 3;
+ else if ( rTextFitToSizeTypeItem.GetValue() == SDRTEXTFIT_ALLLINES )
+ nAlignment = 4;
+ }
+ }
+ if ( ( nOldAlignment != -1 ) && ( nOldAlignment != nAlignment ) )
{
- if ( rTextFitToSizeTypeItem.GetValue() == SDRTEXTFIT_NONE )
- nAlignment = 3;
- else if ( rTextFitToSizeTypeItem.GetValue() == SDRTEXTFIT_ALLLINES )
- nAlignment = 4;
+ nAlignment = -1;
+ break;
}
}
- if ( ( nOldAlignment != -1 ) && ( nOldAlignment != nAlignment ) )
- {
- nAlignment = -1;
- break;
- }
}
}
+
rSet.Put( SfxInt32Item( SID_FONTWORK_ALIGNMENT, nAlignment ) );
}
void SetCharacterSpacingState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
sal_Int32 nCharacterSpacing = -1;
- for( i = 0; i < nCount; i++ )
+
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- sal_Int32 nOldCharacterSpacing = nCharacterSpacing;
- SvxCharScaleWidthItem& rCharScaleWidthItem = (SvxCharScaleWidthItem&)pObj->GetMergedItem( EE_CHAR_FONTWIDTH );
- nCharacterSpacing = rCharScaleWidthItem.GetValue();
- if ( ( nOldCharacterSpacing != -1 ) && ( nOldCharacterSpacing != nCharacterSpacing ) )
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
{
- nCharacterSpacing = -1;
- break;
+ sal_Int32 nOldCharacterSpacing = nCharacterSpacing;
+ SvxCharScaleWidthItem& rCharScaleWidthItem = (SvxCharScaleWidthItem&)pObj->GetMergedItem( EE_CHAR_FONTWIDTH );
+ nCharacterSpacing = rCharScaleWidthItem.GetValue();
+ if ( ( nOldCharacterSpacing != -1 ) && ( nOldCharacterSpacing != nCharacterSpacing ) )
+ {
+ nCharacterSpacing = -1;
+ break;
+ }
}
}
}
+
rSet.Put( SfxInt32Item( SID_FONTWORK_CHARACTER_SPACING, nCharacterSpacing ) );
}
void SetKernCharacterPairsState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
sal_Bool bChecked = sal_False;
- for( i = 0; i < nCount; i++ )
+
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- SvxKerningItem& rKerningItem = (SvxKerningItem&)pObj->GetMergedItem( EE_CHAR_KERNING );
- if ( rKerningItem.GetValue() )
- bChecked = sal_True;
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
+ {
+ SvxKerningItem& rKerningItem = (SvxKerningItem&)pObj->GetMergedItem( EE_CHAR_KERNING );
+ if ( rKerningItem.GetValue() )
+ bChecked = sal_True;
+ }
}
}
+
rSet.Put( SfxBoolItem( SID_FONTWORK_KERN_CHARACTER_PAIRS, bChecked ) );
}
void SetFontWorkShapeTypeState( SdrView* pSdrView, SfxItemSet& rSet )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
-
rtl::OUString aFontWorkShapeType;
- for( i = 0; i < nCount; i++ )
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- if( pObj->ISA( SdrObjCustomShape ) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- Any* pAny = aGeometryItem.GetPropertyValueByName( sType );
- if( pAny )
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
{
- rtl::OUString aType;
- if ( *pAny >>= aType )
+ const rtl::OUString sType( RTL_CONSTASCII_USTRINGPARAM ( "Type" ) );
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ Any* pAny = aGeometryItem.GetPropertyValueByName( sType );
+ if( pAny )
{
- if ( aFontWorkShapeType.getLength() )
+ rtl::OUString aType;
+ if ( *pAny >>= aType )
{
- if ( !aFontWorkShapeType.equals( aType ) ) // different FontWorkShapeTypes selected ?
+ if ( aFontWorkShapeType.getLength() )
{
- aFontWorkShapeType = rtl::OUString();
- break;
+ if ( !aFontWorkShapeType.equals( aType ) ) // different FontWorkShapeTypes selected ?
+ {
+ aFontWorkShapeType = rtl::OUString();
+ break;
+ }
}
+ aFontWorkShapeType = aType;
}
- aFontWorkShapeType = aType;
}
}
}
}
+
rSet.Put( SfxStringItem( SID_FONTWORK_SHAPE_TYPE, aFontWorkShapeType ) );
}
@@ -194,9 +213,6 @@ SFX_IMPL_INTERFACE(FontworkBar, SfxShell, SVX_RES(RID_SVX_FONTWORK_BAR))
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT, SVX_RES(RID_SVX_FONTWORK_BAR) );
}
-TYPEINIT1( FontworkBar, SfxShell );
-
-
/*************************************************************************
|*
|* Standard-Konstruktor
@@ -252,21 +268,26 @@ bool checkForSelectedFontWork( SdrView* pSdrView, sal_uInt32& nCheckStatus )
return ( nCheckStatus & 1 ) != 0;
static const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
-
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
sal_Bool bFound = sal_False;
- for(i=0;(i<nCount) && !bFound ; i++)
+
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- Any* pAny = aGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
- if( pAny )
- *pAny >>= bFound;
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
+ {
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ Any* pAny = aGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
+ if( pAny )
+ *pAny >>= bFound;
+ }
}
}
+
if ( bFound )
nCheckStatus |= 1;
nCheckStatus |= 2;
@@ -302,6 +323,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
sal_Int32 nValue = ((const SfxInt32Item*)rReq.GetArgs()->GetItem(SID_FONTWORK_ALIGNMENT))->GetValue();
if ( ( nValue >= 0 ) && ( nValue < 5 ) )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
SdrFitToSizeType eFTS = SDRTEXTFIT_NONE;
SdrTextHorzAdjust eHorzAdjust;
switch ( nValue )
@@ -315,7 +337,6 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
}
pObj->SetMergedItem( SdrTextHorzAdjustItem( eHorzAdjust ) );
pObj->SetMergedItem( SdrTextFitToSizeTypeItem( eFTS ) );
- pObj->BroadcastObjectChange();
}
}
}
@@ -325,9 +346,9 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
{
if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SFX_ITEM_SET ) )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
sal_Int32 nCharSpacing = ((const SfxInt32Item*)rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue();
pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) );
- pObj->BroadcastObjectChange();
}
}
break;
@@ -336,9 +357,9 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem
{
if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_KERN_CHARACTER_PAIRS ) == SFX_ITEM_SET ) )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
// sal_Bool bKernCharacterPairs = ((const SfxBoolItem*)rReq.GetArgs()->GetItem(SID_FONTWORK_KERN_CHARACTER_PAIRS))->GetValue();
//TODO: pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) );
- pObj->BroadcastObjectChange();
}
}
break;
@@ -462,8 +483,15 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
{
case SID_FONTWORK_GALLERY_FLOATER:
{
- FontWorkGalleryDialog aDlg( pSdrView, ImpGetViewWin(pSdrView), nSID );
- aDlg.Execute();
+ if(pSdrView)
+ {
+ FontWorkGalleryDialog aDlg( *pSdrView, ImpGetViewWin(pSdrView) );
+ aDlg.Execute();
+ }
+ else
+ {
+ OSL_ENSURE(false, "No SDrView for FontWorkGalleryDialog (!)");
+ }
}
break;
@@ -478,38 +506,43 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
}
if ( aCustomShape.getLength() )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uInt32 nCount = rMarkList.GetMarkCount(), i;
- for( i = 0; i < nCount; i++ )
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- const bool bUndo = pSdrView->IsUndoEnabled();
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
- if( bUndo )
+ if( pObj )
{
- String aStr( SVX_RES( RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE ) );
- pSdrView->BegUndo( aStr );
- pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
- }
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- GetGeometryForCustomShape( aGeometryItem, aCustomShape );
- pObj->SetMergedItem( aGeometryItem );
+ const bool bUndo = pSdrView->IsUndoEnabled();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
- Reference< drawing::XShape > aXShape = GetXShapeForSdrObject( (SdrObjCustomShape*)pObj );
- if ( aXShape.is() )
- {
- Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( aXShape, UNO_QUERY );
- if( xDefaulter.is() )
- xDefaulter->createCustomShapeDefaults( aCustomShape );
- }
+ if( bUndo )
+ {
+ String aStr( SVX_RES( RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE ) );
+ pSdrView->BegUndo( aStr );
+ pSdrView->AddUndo( pSdrView->getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ }
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ GetGeometryForCustomShape( aGeometryItem, aCustomShape );
+ pObj->SetMergedItem( aGeometryItem );
- pObj->BroadcastObjectChange();
- if( bUndo )
- pSdrView->EndUndo();
- pSdrView->AdjustMarkHdl(); //HMH sal_True );
- rBindings.Invalidate( SID_FONTWORK_SHAPE_TYPE );
+ Reference< drawing::XShape > aXShape = GetXShapeForSdrObject( pObj );
+ if ( aXShape.is() )
+ {
+ Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( aXShape, UNO_QUERY );
+ if( xDefaulter.is() )
+ xDefaulter->createCustomShapeDefaults( aCustomShape );
+ }
+
+ if( bUndo )
+ pSdrView->EndUndo();
+
+ pSdrView->SetMarkHandles();
+ rBindings.Invalidate( SID_FONTWORK_SHAPE_TYPE );
+ }
}
}
}
@@ -554,26 +587,32 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
if ( !nStrResId )
nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT;
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
- for( i = 0; i < nCount; i++ )
+ if(pSdrView->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
- if( pObj->ISA(SdrObjCustomShape) )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++ )
{
- const bool bUndo = pSdrView->IsUndoEnabled();
- if( bUndo )
+ SdrObjCustomShape* pObj = dynamic_cast< SdrObjCustomShape* >(aSelection[i]);
+
+ if( pObj )
{
- String aStr( SVX_RES( nStrResId ) );
- pSdrView->BegUndo( aStr );
- pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ const bool bUndo = pSdrView->IsUndoEnabled();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
+
+ if( bUndo )
+ {
+ String aStr( SVX_RES( nStrResId ) );
+ pSdrView->BegUndo( aStr );
+ pSdrView->AddUndo( pSdrView->getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
+ }
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ impl_execute( pSdrView, rReq, aGeometryItem, pObj );
+ pObj->SetMergedItem( aGeometryItem );
+
+ if( bUndo )
+ pSdrView->EndUndo();
}
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- impl_execute( pSdrView, rReq, aGeometryItem, pObj );
- pObj->SetMergedItem( aGeometryItem );
- pObj->BroadcastObjectChange();
- if( bUndo )
- pSdrView->EndUndo();
}
}
}
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 4b0e531ad935..a68267e45d88 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -100,6 +100,7 @@ using namespace ::com::sun::star::task;
// #i102251#
#include <editeng/editstat.hxx>
+#include <svx/svdlegacy.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -144,8 +145,8 @@ namespace svx
{
if( pDoc )
{
- maScaleX = pDoc->GetScaleFraction();
- maScaleY = pDoc->GetScaleFraction();
+ maScaleX = pDoc->GetExchangeObjectScale();
+ maScaleY = pDoc->GetExchangeObjectScale();
}
}
@@ -217,7 +218,7 @@ namespace svx
/** creates a bitmap that is optionaly transparent from a metafile
*/
- BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, sal_Bool bTransparent, const Size* pSize )
+ BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, bool bTransparent, const Size& rSize)
{
BitmapEx aBmpEx;
@@ -226,29 +227,18 @@ namespace svx
// use new primitive conversion tooling
basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0));
- if(pSize)
- {
- // use 100th mm for primitive bitmap converter tool, input is pixel
- // use a real OutDev to get the correct DPI, the static LogicToLogic assumes 72dpi which is wrong (!)
- const Size aSize100th(Application::GetDefaultDevice()->PixelToLogic(*pSize, MapMode(MAP_100TH_MM)));
-
- aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height()));
- }
- else
- {
- // use 100th mm for primitive bitmap converter tool
- const Size aSize100th(Application::GetDefaultDevice()->LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MAP_100TH_MM)));
-
- aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height()));
- }
+ // use 100th mm for primitive bitmap converter tool, input is pixel
+ // use a real OutDev to get the correct DPI, the static LogicToLogic assumes 72dpi which is wrong (!)
+ const Size aSize100th(Application::GetDefaultDevice()->PixelToLogic(rSize, MapMode(MAP_100TH_MM)));
+ aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height()));
aBmpEx = convertMetafileToBitmapEx(rMtf, aRange);
}
else
{
const SvtOptionsDrawinglayer aDrawinglayerOpt;
const GraphicConversionParameters aParameters(
- pSize ? *pSize : Size(0, 0),
+ rSize,
true, // allow unlimited size
aDrawinglayerOpt.IsAntiAliasing(),
aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete());
@@ -262,11 +252,8 @@ namespace svx
return aBmpEx;
}
- Size* CalcSize( sal_Int32 nWidth, sal_Int32 nHeight, const Size& aBoundSize, Size& aOutSize )
+ Size CalcSize( sal_Int32 nWidth, sal_Int32 nHeight, const Size& aBoundSize)
{
- if( (nWidth == 0) && (nHeight == 0) )
- return NULL;
-
if( (nWidth == 0) && (nHeight != 0) && (aBoundSize.Height() != 0) )
{
nWidth = ( nHeight * aBoundSize.Width() ) / aBoundSize.Height();
@@ -276,10 +263,7 @@ namespace svx
nHeight = ( nWidth * aBoundSize.Height() ) / aBoundSize.Width();
}
- aOutSize.Width() = nWidth;
- aOutSize.Height() = nHeight;
-
- return &aOutSize;
+ return Size(nWidth, nHeight);
}
}
@@ -315,8 +299,11 @@ drawinglayer::primitive2d::Primitive2DSequence ImplExportCheckVisisbilityRedirec
if(pObject)
{
SdrPage* pPage = mpCurrentPage;
- if( pPage == 0 )
- pPage = pObject->GetPage();
+
+ if( !pPage )
+ {
+ pPage = pObject->getSdrPageFromSdrObject();
+ }
if( (pPage == 0) || pPage->checkVisibility(rOriginal, rDisplayInfo, false) )
{
@@ -353,8 +340,9 @@ IMPL_LINK(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo)
}
else if( mnPageNumber != -1 )
{
- const SvxFieldData* pField = pInfo->GetField().GetField();
- if( pField && pField->ISA( SvxPageField ) )
+ const SvxPageField* pField = dynamic_cast< const SvxPageField* >(pInfo->GetField().GetField());
+
+ if( pField )
{
String aPageNumValue;
sal_Bool bUpper = sal_False;
@@ -405,7 +393,7 @@ VirtualDevice* GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWid
MapMode aMM( MAP_100TH_MM );
Point aPoint( 0, 0 );
- Size aPageSize(pPage->GetSize());
+ const Size aPageSize(basegfx::fround(pPage->GetPageScale().getX()), basegfx::fround(pPage->GetPageScale().getY()));
// use scaling?
if( nWidthPixel )
@@ -435,13 +423,13 @@ VirtualDevice* GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWid
pVDev->SetOutputSize(aPageSize);
DBG_ASSERT(!bAbort, "virt. Device nicht korrekt erzeugt");
- SdrView* pView = new SdrView(mpDoc, pVDev);
- pView->SetPageVisible( sal_False );
- pView->SetBordVisible( sal_False );
- pView->SetGridVisible( sal_False );
- pView->SetHlplVisible( sal_False );
- pView->SetGlueVisible( sal_False );
- pView->ShowSdrPage(pPage);
+ SdrView* pView = new SdrView(*mpDoc, pVDev);
+ pView->SetPageVisible(false);
+ pView->SetBordVisible(false);
+ pView->SetGridVisible(false);
+ pView->SetHlplVisible(false);
+ pView->SetGlueVisible(false);
+ pView->ShowSdrPage(*pPage);
Region aRegion (Rectangle( aPoint, aPageSize ) );
ImplExportCheckVisisbilityRedirector aRedirector( mpCurrentPage );
@@ -622,7 +610,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
return false;
VirtualDevice aVDev;
- const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY );
+ const MapMode aMap( mpDoc->GetExchangeObjectUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY );
SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
maOldCalcFieldValueHdl = rOutl.GetCalcFieldValueHdl();
@@ -635,7 +623,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
rOutl.SetControlWord(nCntrl);
SdrObject* pTempBackgroundShape = 0;
- std::vector< SdrObject* > aShapes;
+ SdrObjectVector aShapes;
bool bRet = true;
// export complete page?
@@ -647,16 +635,20 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if(pCorrectProperties)
{
- pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize()));
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
+ pTempBackgroundShape = new SdrRectObj(
+ *mpDoc,
+ basegfx::tools::createScaleB2DHomMatrix(rPageScale));
pTempBackgroundShape->SetMergedItemSet(pCorrectProperties->GetItemSet());
pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE));
- pTempBackgroundShape->NbcSetStyleSheet(pCorrectProperties->GetStyleSheet(), true);
+ pTempBackgroundShape->SetStyleSheet(pCorrectProperties->GetStyleSheet(), true);
aShapes.push_back(pTempBackgroundShape);
}
}
else
{
- const Size aSize( pPage->GetSize() );
+ const basegfx::B2DVector& rPageScale = pPage->GetPageScale();
+ const Size aSize(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY()));
// generate a bitmap to convert it to a pixel format.
// For gif pictures there can also be a vector format used (bTranslucent)
@@ -699,13 +691,13 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
}
boost::scoped_ptr< SdrView > pLocalView;
- if( PTR_CAST( FmFormModel, mpDoc ) )
+ if( dynamic_cast< FmFormModel* >( mpDoc ) )
{
- pLocalView.reset( new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev ) );
+ pLocalView.reset( new FmFormView( dynamic_cast< FmFormModel& >( *mpDoc ), &aVDev ) );
}
else
{
- pLocalView.reset( new SdrView( mpDoc, &aVDev ) );
+ pLocalView.reset( new SdrView( *mpDoc, &aVDev ) );
}
@@ -734,28 +726,28 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
// create a view
SdrView* pView;
- if( PTR_CAST( FmFormModel, mpDoc ) )
+ if( dynamic_cast< FmFormModel* >( mpDoc ) )
{
- pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev );
+ pView = new FmFormView( dynamic_cast< FmFormModel& >( *mpDoc ), &aVDev );
}
else
{
- pView = new SdrView( mpDoc, &aVDev );
+ pView = new SdrView( *mpDoc, &aVDev );
}
pView->SetBordVisible( sal_False );
pView->SetPageVisible( sal_False );
- pView->ShowSdrPage( pPage );
+ pView->ShowSdrPage( *pPage );
if ( pView && pPage )
{
pView->SetBordVisible( sal_False );
pView->SetPageVisible( sal_False );
- pView->ShowSdrPage( pPage );
+ pView->ShowSdrPage( *pPage );
- const Point aNewOrg( pPage->GetLftBorder(), pPage->GetUppBorder() );
- aNewSize = Size( aSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder(),
- aSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder() );
+ const Point aNewOrg( pPage->GetLeftPageBorder(), pPage->GetTopPageBorder() );
+ aNewSize = Size( aSize.Width() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder(),
+ aSize.Height() - pPage->GetTopPageBorder() - pPage->GetBottomPageBorder() );
const Rectangle aClipRect( aNewOrg, aNewSize );
MapMode aVMap( aMap );
@@ -789,14 +781,15 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if ( pView )
{
- pView->HideSdrPage();
delete pView;
}
if( rSettings.mbTranslucent )
{
- Size aOutSize;
- aGraphic = GetBitmapFromMetaFile( aGraphic.GetGDIMetaFile(), sal_True, CalcSize( rSettings.mnWidth, rSettings.mnHeight, aNewSize, aOutSize ) );
+ aGraphic = GetBitmapFromMetaFile(
+ aGraphic.GetGDIMetaFile(),
+ true,
+ CalcSize(rSettings.mnWidth, rSettings.mnHeight, aNewSize));
}
}
}
@@ -840,10 +833,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
{
if( !bVectorType )
{
- SdrObject* pObj = aShapes.front();
- if( pObj && pObj->ISA( SdrGrafObj ) && !( (SdrGrafObj*) pObj )->HasText() )
+ const SdrGrafObj* pObj = dynamic_cast< const SdrGrafObj* >(aShapes.front());
+
+ if( pObj && !pObj->HasText() )
{
- aGraphic = ( (SdrGrafObj*) pObj )->GetTransformedGraphic();
+ aGraphic = pObj->GetTransformedGraphic();
+
if ( aGraphic.GetType() == GRAPHIC_BITMAP )
{
Size aSizePixel( aGraphic.GetSizePixel() );
@@ -865,16 +860,24 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
}
else if( rSettings.mbScrollText )
{
- SdrObject* pObj = aShapes.front();
- if( pObj && pObj->ISA( SdrTextObj )
- && ( (SdrTextObj*) pObj )->HasText() )
+ const SdrTextObj* pObj = dynamic_cast< const SdrTextObj* >(aShapes.front());
+
+ if( pObj && pObj->HasText() )
{
- Rectangle aScrollRectangle;
- Rectangle aPaintRectangle;
+ basegfx::B2DRange aScrollRange;
+ basegfx::B2DRange aPaintRange;
const boost::scoped_ptr< GDIMetaFile > pMtf(
- ( (SdrTextObj*) pObj )->GetTextScrollMetaFileAndRectangle(
- aScrollRectangle, aPaintRectangle ) );
+ pObj->GetTextScrollMetaFileAndRange(
+ aScrollRange,
+ aPaintRange));
+
+ const Rectangle aScrollRectangle(
+ (sal_Int32)floor(aScrollRange.getMinX()), (sal_Int32)floor(aScrollRange.getMinY()),
+ (sal_Int32)ceil(aScrollRange.getMaxX()), (sal_Int32)ceil(aScrollRange.getMaxY()));
+ const Rectangle aPaintRectangle(
+ (sal_Int32)floor(aPaintRange.getMinX()), (sal_Int32)floor(aPaintRange.getMinY()),
+ (sal_Int32)ceil(aPaintRange.getMaxX()), (sal_Int32)ceil(aPaintRange.getMaxY()));
// take the larger one of the two rectangles (that
// should be the bound rect of the retrieved
@@ -916,41 +919,31 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if( !bSingleGraphic )
{
// create a metafile for all shapes
- VirtualDevice aOut;
+ VirtualDevice aOut;
+ GDIMetaFile aMtf;
+ MapMode aOutMap(aMap);
+ const basegfx::B2DRange aRange(sdr::legacy::GetAllObjBoundRange(aShapes));
+ const Size aBoundSize(basegfx::fround(aRange.getWidth()), basegfx::fround(aRange.getHeight()));
+ sdr::contact::DisplayInfo aDisplayInfo;
- // calculate bound rect for all shapes
- Rectangle aBound;
+ aOut.EnableOutput( sal_False );
+ aOut.SetMapMode( aMap );
+ if(rSettings.mbUseHighContrast)
{
- std::vector< SdrObject* >::iterator aIter = aShapes.begin();
- const std::vector< SdrObject* >::iterator aEnd = aShapes.end();
-
- while( aIter != aEnd )
- {
- SdrObject* pObj = (*aIter++);
- Rectangle aR1(pObj->GetCurrentBoundRect());
- if (aBound.IsEmpty())
- aBound=aR1;
- else
- aBound.Union(aR1);
- }
+ aOut.SetDrawMode(
+ aVDev.GetDrawMode() |
+ DRAWMODE_SETTINGSLINE |
+ DRAWMODE_SETTINGSFILL |
+ DRAWMODE_SETTINGSTEXT |
+ DRAWMODE_SETTINGSGRADIENT);
}
- aOut.EnableOutput( sal_False );
- aOut.SetMapMode( aMap );
- if( rSettings.mbUseHighContrast )
- aOut.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
-
- GDIMetaFile aMtf;
aMtf.Clear();
aMtf.Record( &aOut );
-
- MapMode aOutMap( aMap );
- aOutMap.SetOrigin( Point( -aBound.TopLeft().X(), -aBound.TopLeft().Y() ) );
+ aOutMap.SetOrigin(Point(-basegfx::fround(aRange.getMinX()), -basegfx::fround(aRange.getMinY())));
aOut.SetRelativeMapMode( aOutMap );
- sdr::contact::DisplayInfo aDisplayInfo;
-
if(mpCurrentPage)
{
if(mpCurrentPage->TRG_HasMasterPage() && pPage->IsMasterPage())
@@ -963,29 +956,25 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if(!aShapes.empty())
{
- // more effective way to paint a vector of SdrObjects. Hand over the processed page
- // to have it in the
+ // more effective way to paint a vector of SdrObjects
sdr::contact::ObjectContactOfObjListPainter aMultiObjectPainter(aOut, aShapes, mpCurrentPage);
ImplExportCheckVisisbilityRedirector aCheckVisibilityRedirector(mpCurrentPage);
- aMultiObjectPainter.SetViewObjectContactRedirector(&aCheckVisibilityRedirector);
+ aMultiObjectPainter.SetViewObjectContactRedirector(&aCheckVisibilityRedirector);
aMultiObjectPainter.ProcessDisplay(aDisplayInfo);
}
aMtf.Stop();
aMtf.WindStart();
-
- const Size aExtSize( aOut.PixelToLogic( Size( 0, 0 ) ) );
- Size aBoundSize( aBound.GetWidth() + ( aExtSize.Width() ),
- aBound.GetHeight() + ( aExtSize.Height() ) );
-
- aMtf.SetPrefMapMode( aMap );
- aMtf.SetPrefSize( aBoundSize );
+ aMtf.SetPrefMapMode(aMap);
+ aMtf.SetPrefSize(aBoundSize);
if( !bVectorType )
{
- Size aOutSize;
- aGraphic = GetBitmapFromMetaFile( aMtf, rSettings.mbTranslucent, CalcSize( rSettings.mnWidth, rSettings.mnHeight, aBoundSize, aOutSize ) );
+ aGraphic = GetBitmapFromMetaFile(
+ aMtf,
+ rSettings.mbTranslucent,
+ CalcSize(rSettings.mnWidth, rSettings.mnHeight, aBoundSize));
}
else
{
@@ -996,7 +985,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if(pTempBackgroundShape)
{
- SdrObject::Free(pTempBackgroundShape);
+ deleteSdrObjectSafeAndClearPointer(pTempBackgroundShape);
}
rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl );
@@ -1164,7 +1153,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon
if( NULL == mpUnoPage || NULL == mpUnoPage->GetSdrPage() )
break;
- mpDoc = mpUnoPage->GetSdrPage()->GetModel();
+ mpDoc = &mpUnoPage->GetSdrPage()->getSdrModelFromSdrPage();
// Step 4: If we got a generic XShapes test all contained shapes
// if they belong to the same XDrawPage
@@ -1185,7 +1174,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon
{
mxShapes->getByIndex( nIndex ) >>= xShape;
pObj = GetSdrObjectFromXShape( xShape );
- bOk = pObj && pObj->GetPage() == pPage;
+ bOk = pObj && pObj->getSdrPageFromSdrObject() == pPage;
}
if( !bOk )
@@ -1283,7 +1272,7 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
rtl::Reference< GraphicExporter > xExporter( new GraphicExporter() );
Reference< XComponent > xComp( rShape.getUnoShape(), UNO_QUERY_THROW );
xExporter->setSourceDocument( xComp );
- ExportSettings aSettings( rShape.GetModel() );
+ ExportSettings aSettings( &rShape.getSdrModelFromSdrObject() );
xExporter->GetGraphic( aSettings, aGraphic, bVector );
}
catch( Exception& )
diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx
index 34ffdf0da831..11138a11a7af 100644
--- a/svx/source/unodraw/UnoNameItemTable.cxx
+++ b/svx/source/unodraw/UnoNameItemTable.cxx
@@ -78,9 +78,9 @@ void SvxUnoNameItemTable::dispose()
void SvxUnoNameItemTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
- if( pSdrHint && HINT_MODELCLEARED == pSdrHint->GetKind() )
+ if( pSdrHint && HINT_MODELCLEARED == pSdrHint->GetSdrHintKind() )
dispose();
}
diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx
index 8f4a9e5ad54b..0cea2768d00e 100644
--- a/svx/source/unodraw/XPropertyTable.cxx
+++ b/svx/source/unodraw/XPropertyTable.cxx
@@ -33,14 +33,13 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
-
#include <cppuhelper/implbase2.hxx>
#include "unopolyhelper.hxx"
#include <svx/xdef.hxx>
-
-#include "svx/unoapi.hxx"
+#include <svx/unoapi.hxx>
#include <editeng/unoprnms.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
using namespace com::sun::star;
using namespace ::cppu;
@@ -379,7 +378,7 @@ uno::Any SvxUnoXLineEndTable::getAny( const XPropertyEntry* pEntry ) const throw
uno::Any aAny;
drawing::PolyPolygonBezierCoords aBezier;
- SvxConvertB2DPolyPolygonToPolyPolygonBezier( ((XLineEndEntry*)pEntry)->GetLineEnd(), aBezier );
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(((XLineEndEntry*)pEntry)->GetLineEnd(), aBezier);
aAny <<= aBezier;
return aAny;
}
@@ -392,8 +391,8 @@ XPropertyEntry* SvxUnoXLineEndTable::getEntry( const OUString& rName, const uno:
basegfx::B2DPolyPolygon aPolyPolygon;
drawing::PolyPolygonBezierCoords* pCoords = (drawing::PolyPolygonBezierCoords*)rAny.getValue();
- if( pCoords->Coordinates.getLength() > 0 )
- aPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon( pCoords );
+ if(pCoords && pCoords->Coordinates.getLength() > 0)
+ aPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*pCoords);
// #86265# make sure polygon is closed
aPolyPolygon.setClosed(true);
diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx
index 66b451605750..7d68c3fe877a 100644
--- a/svx/source/unodraw/gluepts.cxx
+++ b/svx/source/unodraw/gluepts.cxx
@@ -83,8 +83,8 @@ public:
static void convert( const SdrGluePoint& rSdrGlue, drawing::GluePoint2& rUnoGlue ) throw()
{
- rUnoGlue.Position.X = rSdrGlue.GetPos().X();
- rUnoGlue.Position.Y = rSdrGlue.GetPos().Y();
+ rUnoGlue.Position.X = basegfx::fround(rSdrGlue.GetPos().getX());
+ rUnoGlue.Position.Y = basegfx::fround(rSdrGlue.GetPos().getY());
rUnoGlue.IsRelative = rSdrGlue.IsPercent();
switch( rSdrGlue.GetAlign() )
@@ -148,7 +148,7 @@ static void convert( const SdrGluePoint& rSdrGlue, drawing::GluePoint2& rUnoGlue
static void convert( const drawing::GluePoint2& rUnoGlue, SdrGluePoint& rSdrGlue ) throw()
{
- rSdrGlue.SetPos( Point( rUnoGlue.Position.X, rUnoGlue.Position.Y ) );
+ rSdrGlue.SetPos( basegfx::B2DPoint( rUnoGlue.Position.X, rUnoGlue.Position.Y ) );
rSdrGlue.SetPercent( rUnoGlue.IsRelative );
switch( rUnoGlue.PositionAlignment )
@@ -237,7 +237,6 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) thr
// only repaint, no objectchange
mpObject->ActionChanged();
- // mpObject->BroadcastObjectChange();
return (sal_Int32)((*pList)[nId].GetId() + NON_USER_DEFINED_GLUE_POINTS) - 1;
}
@@ -267,7 +266,6 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier )
// only repaint, no objectchange
mpObject->ActionChanged();
- // mpObject->BroadcastObjectChange();
return;
}
@@ -280,7 +278,7 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier )
// XIdentifierReplace
void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, const uno::Any& aElement ) throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject.is() && mpObject->IsNode() )
+ if(mpObject.is())
{
struct drawing::GluePoint2 aGluePoint;
if( (Identifier < NON_USER_DEFINED_GLUE_POINTS) || !(aElement >>= aGluePoint))
@@ -301,7 +299,6 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, c
// only repaint, no objectchange
mpObject->ActionChanged();
- // mpObject->BroadcastObjectChange();
return;
}
@@ -314,13 +311,13 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, c
// XIdentifierAccess
uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( mpObject.is() && mpObject->IsNode() )
+ if(mpObject.is())
{
struct drawing::GluePoint2 aGluePoint;
if( Identifier < NON_USER_DEFINED_GLUE_POINTS ) // default glue point?
{
- SdrGluePoint aTempPoint = mpObject->GetVertexGluePoint( (sal_uInt16)Identifier );
+ SdrGluePoint aTempPoint = mpObject->GetVertexGluePoint( Identifier );
aGluePoint.IsUserDefined = sal_False;
convert( aTempPoint, aGluePoint );
return uno::makeAny( aGluePoint );
@@ -401,7 +398,6 @@ void SAL_CALL SvxUnoGluePointAccess::insertByIndex( sal_Int32, const uno::Any& E
// only repaint, no objectchange
mpObject->ActionChanged();
- // mpObject->BroadcastObjectChange();
return;
}
@@ -422,13 +418,12 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIndex( sal_Int32 Index )
if( pList )
{
Index -= 4;
- if( Index >= 0 && Index < pList->GetCount() )
+ if( Index >= 0 && Index < (sal_Int32)pList->GetCount() )
{
- pList->Delete( (sal_uInt16)Index );
+ pList->Delete( (sal_uInt32)Index );
// only repaint, no objectchange
mpObject->ActionChanged();
- // mpObject->BroadcastObjectChange();
return;
}
@@ -451,14 +446,13 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIndex( sal_Int32 Index, const uno:
if( mpObject.is() && Index >= 0 )
{
SdrGluePointList* pList = const_cast< SdrGluePointList* >( mpObject->GetGluePointList() );
- if( pList && Index < pList->GetCount() )
+ if( pList && Index < (sal_Int32)pList->GetCount() )
{
- SdrGluePoint& rGlue = (*pList)[(sal_uInt16)Index];
+ SdrGluePoint& rGlue = (*pList)[(sal_uInt32)Index];
convert( aUnoGlue, rGlue );
// only repaint, no objectchange
mpObject->ActionChanged();
- // mpObject->BroadcastObjectChange();
}
}
@@ -474,15 +468,12 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
{
// each node has a default of 4 glue points
// and any number of user defined glue points
- if( mpObject->IsNode() )
- {
nCount += 4;
const SdrGluePointList* pList = mpObject->GetGluePointList();
if( pList )
nCount += pList->GetCount();
}
- }
return nCount;
}
@@ -490,13 +481,13 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::getCount()
uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index )
throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
- if( Index >= 0 && mpObject.is() && mpObject->IsNode() )
+ if(Index >= 0 && mpObject.is())
{
struct drawing::GluePoint2 aGluePoint;
if( Index < 4 ) // default glue point?
{
- SdrGluePoint aTempPoint = mpObject->GetVertexGluePoint( (sal_uInt16)Index );
+ SdrGluePoint aTempPoint = mpObject->GetVertexGluePoint( (sal_uInt32)Index );
aGluePoint.IsUserDefined = sal_False;
convert( aTempPoint, aGluePoint );
uno::Any aAny;
@@ -507,9 +498,9 @@ uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index )
{
Index -= 4;
const SdrGluePointList* pList = mpObject->GetGluePointList();
- if( pList && Index < pList->GetCount() )
+ if( pList && Index < (sal_Int32)pList->GetCount() )
{
- const SdrGluePoint& rTempPoint = (*pList)[(sal_uInt16)Index];
+ const SdrGluePoint& rTempPoint = (*pList)[(sal_uInt32)Index];
aGluePoint.IsUserDefined = sal_True;
convert( rTempPoint, aGluePoint );
uno::Any aAny;
@@ -532,7 +523,7 @@ uno::Type SAL_CALL SvxUnoGluePointAccess::getElementType()
sal_Bool SAL_CALL SvxUnoGluePointAccess::hasElements()
throw( uno::RuntimeException)
{
- return mpObject.is() && mpObject->IsNode();
+ return mpObject.is();
}
/**
diff --git a/svx/source/unodraw/tableshape.cxx b/svx/source/unodraw/tableshape.cxx
index 29c778d36da2..179366211d28 100644
--- a/svx/source/unodraw/tableshape.cxx
+++ b/svx/source/unodraw/tableshape.cxx
@@ -28,11 +28,11 @@
#include "svx/unoshprp.hxx"
#include "svx/svdotable.hxx"
#include <svx/svdpool.hxx>
+#include <svx/globaldrawitempool.hxx>
///////////////////////////////////////////////////////////////////////
using ::rtl::OUString;
-
using namespace ::osl;
using namespace ::cppu;
using namespace ::sdr::table;
@@ -43,7 +43,7 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
SvxTableShape::SvxTableShape( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_TABLE), aSvxMapProvider.GetPropertySet(SVXMAP_TABLE, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_TABLE), aSvxMapProvider.GetPropertySet(SVXMAP_TABLE, GetGlobalDrawObjectItemPool()) )
{
SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.TableShape" ) ) );
}
@@ -63,48 +63,48 @@ bool SvxTableShape::setPropertyValueImpl(
{
switch( pProperty->nWID )
{
- case OWN_ATTR_TABLETEMPLATE:
- {
- Reference< XIndexAccess > xTemplate;
+ case OWN_ATTR_TABLETEMPLATE:
+ {
+ Reference< XIndexAccess > xTemplate;
- if( !(rValue >>= xTemplate) )
- throw IllegalArgumentException();
+ if( !(rValue >>= xTemplate) )
+ throw IllegalArgumentException();
- if( mpObj.is() )
- static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->setTableStyle(xTemplate);
+ if( mpObj.is() )
+ static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->setTableStyle(xTemplate);
- return true;
- }
- case OWN_ATTR_TABLETEMPLATE_FIRSTROW:
- case OWN_ATTR_TABLETEMPLATE_LASTROW:
- case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN:
- case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN:
- case OWN_ATTR_TABLETEMPLATE_BANDINGROWS:
- case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS:
- {
- if( mpObj.is() )
+ return true;
+ }
+ case OWN_ATTR_TABLETEMPLATE_FIRSTROW:
+ case OWN_ATTR_TABLETEMPLATE_LASTROW:
+ case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN:
+ case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN:
+ case OWN_ATTR_TABLETEMPLATE_BANDINGROWS:
+ case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS:
{
- TableStyleSettings aSettings( static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTableStyleSettings() );
-
- switch( pProperty->nWID )
+ if( mpObj.is() )
{
- case OWN_ATTR_TABLETEMPLATE_FIRSTROW: rValue >>= aSettings.mbUseFirstRow; break;
- case OWN_ATTR_TABLETEMPLATE_LASTROW: rValue >>= aSettings.mbUseLastRow; break;
- case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN: rValue >>= aSettings.mbUseFirstColumn; break;
- case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN: rValue >>= aSettings.mbUseLastColumn; break;
- case OWN_ATTR_TABLETEMPLATE_BANDINGROWS: rValue >>= aSettings.mbUseRowBanding; break;
- case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS: rValue >>= aSettings.mbUseColumnBanding; break;
+ TableStyleSettings aSettings( static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTableStyleSettings() );
+
+ switch( pProperty->nWID )
+ {
+ case OWN_ATTR_TABLETEMPLATE_FIRSTROW: rValue >>= aSettings.mbUseFirstRow; break;
+ case OWN_ATTR_TABLETEMPLATE_LASTROW: rValue >>= aSettings.mbUseLastRow; break;
+ case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN: rValue >>= aSettings.mbUseFirstColumn; break;
+ case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN: rValue >>= aSettings.mbUseLastColumn; break;
+ case OWN_ATTR_TABLETEMPLATE_BANDINGROWS: rValue >>= aSettings.mbUseRowBanding; break;
+ case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS: rValue >>= aSettings.mbUseColumnBanding; break;
+ }
+
+ static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->setTableStyleSettings(aSettings);
}
- static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->setTableStyleSettings(aSettings);
+ return true;
+ }
+ default:
+ {
+ return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
}
-
- return true;
- }
- default:
- {
- return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
- }
}
}
@@ -118,59 +118,59 @@ bool SvxTableShape::getPropertyValueImpl(
{
switch( pProperty->nWID )
{
- case OWN_ATTR_OLEMODEL:
- {
- if( mpObj.is() )
+ case OWN_ATTR_OLEMODEL:
{
- rValue <<= static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTable();
+ if( mpObj.is() )
+ {
+ rValue <<= static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTable();
+ }
+ return true;
}
- return true;
- }
- case OWN_ATTR_TABLETEMPLATE:
- {
- if( mpObj.is() )
+ case OWN_ATTR_TABLETEMPLATE:
{
- rValue <<= static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTableStyle();
+ if( mpObj.is() )
+ {
+ rValue <<= static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTableStyle();
+ }
+ return true;
}
- return true;
- }
- case OWN_ATTR_BITMAP:
- {
- if( mpObj.is() )
+ case OWN_ATTR_BITMAP:
{
- Graphic aGraphic( SvxGetGraphicForShape( *mpObj.get(), true ) );
- rValue <<= aGraphic.GetXGraphic();
+ if( mpObj.is() )
+ {
+ Graphic aGraphic( SvxGetGraphicForShape( *mpObj.get(), true ) );
+ rValue <<= aGraphic.GetXGraphic();
+ }
+ return true;
}
- return true;
- }
- case OWN_ATTR_TABLETEMPLATE_FIRSTROW:
- case OWN_ATTR_TABLETEMPLATE_LASTROW:
- case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN:
- case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN:
- case OWN_ATTR_TABLETEMPLATE_BANDINGROWS:
- case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS:
- {
- if( mpObj.is() )
+ case OWN_ATTR_TABLETEMPLATE_FIRSTROW:
+ case OWN_ATTR_TABLETEMPLATE_LASTROW:
+ case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN:
+ case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN:
+ case OWN_ATTR_TABLETEMPLATE_BANDINGROWS:
+ case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS:
{
- TableStyleSettings aSettings( static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTableStyleSettings() );
-
- switch( pProperty->nWID )
+ if( mpObj.is() )
{
- case OWN_ATTR_TABLETEMPLATE_FIRSTROW: rValue <<= aSettings.mbUseFirstRow; break;
- case OWN_ATTR_TABLETEMPLATE_LASTROW: rValue <<= aSettings.mbUseLastRow; break;
- case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN: rValue <<= aSettings.mbUseFirstColumn; break;
- case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN: rValue <<= aSettings.mbUseLastColumn; break;
- case OWN_ATTR_TABLETEMPLATE_BANDINGROWS: rValue <<= aSettings.mbUseRowBanding; break;
- case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS: rValue <<= aSettings.mbUseColumnBanding; break;
+ TableStyleSettings aSettings( static_cast< sdr::table::SdrTableObj* >( mpObj.get() )->getTableStyleSettings() );
+
+ switch( pProperty->nWID )
+ {
+ case OWN_ATTR_TABLETEMPLATE_FIRSTROW: rValue <<= aSettings.mbUseFirstRow; break;
+ case OWN_ATTR_TABLETEMPLATE_LASTROW: rValue <<= aSettings.mbUseLastRow; break;
+ case OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN: rValue <<= aSettings.mbUseFirstColumn; break;
+ case OWN_ATTR_TABLETEMPLATE_LASTCOLUMN: rValue <<= aSettings.mbUseLastColumn; break;
+ case OWN_ATTR_TABLETEMPLATE_BANDINGROWS: rValue <<= aSettings.mbUseRowBanding; break;
+ case OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS: rValue <<= aSettings.mbUseColumnBanding; break;
+ }
}
- }
- return true;
- }
- default:
- {
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
- }
+ return true;
+ }
+ default:
+ {
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+ }
}
}
diff --git a/svx/source/unodraw/unomlstr.cxx b/svx/source/unodraw/unomlstr.cxx
index f2e6d8e65904..34fc1e79c004 100644
--- a/svx/source/unodraw/unomlstr.cxx
+++ b/svx/source/unodraw/unomlstr.cxx
@@ -48,8 +48,8 @@ void SAL_CALL SvxUnoShapeModifyListener::modified(const lang::EventObject& ) thr
::vos::OGuard aGuard( Application::GetSolarMutex() );
if( mpObj )
{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*mpObj);
mpObj->SetChanged();
- mpObj->BroadcastObjectChange();
}
}
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 05515c16121b..d7785850bf34 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -58,8 +58,6 @@
#include <svx/svdpage.hxx>
#include <svx/unoshape.hxx>
-extern UHashMapEntry pSdrShapeIdentifierMap[];
-
//-////////////////////////////////////////////////////////////////////
using namespace ::rtl;
@@ -125,17 +123,17 @@ const SvEventDescription* ImplGetSupportedMacroItems()
//-////////////////////////////////////////////////////////////////////
-/** fills the given EventObject from the given SdrHint.
+/** fills the given EventObject from the given SdrBaseHint.
@returns
- true if the SdrHint could be translated to an EventObject<br>
+ true if the SdrBaseHint could be translated to an EventObject<br>
false if not
*/
-sal_Bool SvxUnoDrawMSFactory::createEvent( const SdrModel* pDoc, const SdrHint* pSdrHint, ::com::sun::star::document::EventObject& aEvent )
+sal_Bool SvxUnoDrawMSFactory::createEvent( const SdrModel* pDoc, const SdrBaseHint* pSdrHint, ::com::sun::star::document::EventObject& aEvent )
{
const SdrObject* pObj = NULL;
const SdrPage* pPage = NULL;
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
// case HINT_LAYERCHG: // Layerdefinition geaendert
// case HINT_LAYERORDERCHG: // Layerreihenfolge geaendert (Insert/Remove/ChangePos)
@@ -145,23 +143,26 @@ sal_Bool SvxUnoDrawMSFactory::createEvent( const SdrModel* pDoc, const SdrHint*
// #115423#
// case HINT_PAGECHG: // Page geaendert
// aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageModified" ) );
-// pPage = pSdrHint->GetPage();
+// pPage = pSdrHint->GetSdrHintPage();
// break;
case HINT_PAGEORDERCHG: // Reihenfolge der Seiten (Zeichenseiten oder Masterpages) geaendert (Insert/Remove/ChangePos)
aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageOrderModified" ) );
- pPage = pSdrHint->GetPage();
+ pPage = pSdrHint->GetSdrHintPage();
break;
- case HINT_OBJCHG: // Objekt geaendert
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
+ case HINT_OBJCHG_ATTR:
+ // Objekt geaendert
aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ShapeModified" ) );
- pObj = pSdrHint->GetObject();
+ pObj = pSdrHint->GetSdrHintObject();
break;
case HINT_OBJINSERTED: // Neues Zeichenobjekt eingefuegt
aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ShapeInserted" ) );
- pObj = pSdrHint->GetObject();
+ pObj = pSdrHint->GetSdrHintObject();
break;
case HINT_OBJREMOVED: // Zeichenobjekt aus Liste entfernt
aEvent.EventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ShapeRemoved" ) );
- pObj = pSdrHint->GetObject();
+ pObj = pSdrHint->GetSdrHintObject();
break;
// HINT_DEFAULTTABCHG, // Default Tabulatorweite geaendert
// HINT_DEFFONTHGTCHG, // Default FontHeight geaendert
@@ -188,17 +189,16 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance(
if( ServiceSpecifier.compareTo( aDrawingPrefix, aDrawingPrefix.getLength() ) == 0 )
{
- sal_uInt32 nType = aSdrShapeIdentifierMap.getId( ServiceSpecifier );
- if( nType != UHASHMAP_NOTFOUND )
- {
- sal_uInt16 nT = (sal_uInt16)(nType & ~E3D_INVENTOR_FLAG);
- sal_uInt32 nI = (nType & E3D_INVENTOR_FLAG)?E3dInventor:SdrInventor;
+ SvxShapeKind aSvxShapeKind(getSvxShapeKindFromTypeName(ServiceSpecifier));
- return uno::Reference< uno::XInterface >( (drawing::XShape*) SvxDrawPage::CreateShapeByTypeAndInventor( nT, nI ) );
+ if(SvxShapeKind_None != aSvxShapeKind)
+ {
+ return uno::Reference< uno::XInterface >(static_cast< drawing::XShape* >(SvxDrawPage::CreateShapeBySvxShapeKind(aSvxShapeKind)));
}
}
uno::Reference< uno::XInterface > xRet( createTextField( ServiceSpecifier ) );
+
if( !xRet.is() )
throw lang::ServiceNotRegisteredException();
@@ -219,25 +219,18 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstanceWi
uno::Sequence< OUString > SAL_CALL SvxUnoDrawMSFactory::getAvailableServiceNames()
throw( uno::RuntimeException )
{
- UHashMapEntry* pMap = pSdrShapeIdentifierMap;
+ const std::vector< rtl::OUString > aAllNames(getAllSvxShapeTypeNames());
+ const sal_uInt32 nCount(aAllNames.size());
+ uno::Sequence< OUString > aSeq(nCount);
- sal_uInt32 nCount = 0;
- while (pMap->aIdentifier.getLength())
+ if(nCount)
{
- pMap++;
- nCount++;
- }
+ OUString* pStrings = aSeq.getArray();
- uno::Sequence< OUString > aSeq( nCount );
- OUString* pStrings = aSeq.getArray();
-
- pMap = pSdrShapeIdentifierMap;
- sal_uInt32 nIdx = 0;
- while(pMap->aIdentifier.getLength())
- {
- pStrings[nIdx] = pMap->aIdentifier;
- pMap++;
- nIdx++;
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ pStrings[a] = aAllNames[a];
+ }
}
return aSeq;
@@ -270,6 +263,11 @@ uno::Sequence< OUString > SvxUnoDrawMSFactory::concatServiceNames( uno::Sequence
#ifndef SVX_LIGHT
///
+SdrModel* SvxUnoDrawingModel::getSdrModel() const
+{
+ return mpDoc;
+}
+
SvxUnoDrawingModel::SvxUnoDrawingModel( SdrModel* pDoc ) throw()
: mpDoc( pDoc )
{
@@ -449,72 +447,72 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c
if( aType.EqualsAscii( "com.sun.star.presentation.", 0, 26 ) )
{
SvxShape* pShape = NULL;
+ SvxShapeKind aSvxShapeKind(SvxShapeKind_Text);
- sal_uInt16 nType = OBJ_TEXT;
// create a shape wrapper
if( aType.EqualsAscii( "TitleTextShape", 26, 14 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "OutlinerShape", 26, 13 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "SubtitleShape", 26, 13 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "GraphicObjectShape", 26, 18 ) )
{
- nType = OBJ_GRAF;
+ aSvxShapeKind = SvxShapeKind_Graphic;
}
else if( aType.EqualsAscii( "PageShape", 26, 9 ) )
{
- nType = OBJ_PAGE;
+ aSvxShapeKind = SvxShapeKind_Page;
}
else if( aType.EqualsAscii( "OLE2Shape", 26, 9 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "ChartShape", 26, 10 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "TableShape", 26, 10 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "OrgChartShape", 26, 13 ) )
{
- nType = OBJ_OLE2;
+ aSvxShapeKind = SvxShapeKind_OLE2;
}
else if( aType.EqualsAscii( "NotesShape", 26, 10 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "HandoutShape", 26, 12 ) )
{
- nType = OBJ_PAGE;
+ aSvxShapeKind = SvxShapeKind_Page;
}
else if( aType.EqualsAscii( "FooterShape", 26, 12 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "HeaderShape", 26, 12 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "SlideNumberShape", 26, 17 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "DateTimeShape", 26, 17 ) )
{
- nType = OBJ_TEXT;
+ aSvxShapeKind = SvxShapeKind_Text;
}
else if( aType.EqualsAscii( "TableShape", 26, 10 ) )
{
- nType = OBJ_TABLE;
+ aSvxShapeKind = SvxShapeKind_Table;
}
else
{
@@ -522,7 +520,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c
}
// create the API wrapper
- pShape = CreateSvxShapeByTypeAndInventor( nType, SdrInventor );
+ pShape = SvxDrawPage::CreateShapeBySvxShapeKind(aSvxShapeKind);
// set shape type
if( pShape )
@@ -638,23 +636,28 @@ uno::Any SAL_CALL SvxUnoDrawPagesAccess::getByIndex( sal_Int32 Index )
if( mrModel.mpDoc )
{
- if( (Index < 0) || (Index >= mrModel.mpDoc->GetPageCount() ) )
+ if( (Index < 0) || (Index >= (sal_Int32)mrModel.mpDoc->GetPageCount() ) )
throw lang::IndexOutOfBoundsException();
SdrPage* pPage = mrModel.mpDoc->GetPage( (sal_uInt16)Index );
if( pPage )
{
- uno::Reference< uno::XInterface > xPage( pPage->mxUnoPage );
-
- if( !xPage.is() )
- {
- if( PTR_CAST( FmFormModel, mrModel.mpDoc ) )
- xPage = (drawing::XDrawPage*)new SvxFmDrawPage( pPage );
- else
- xPage = (drawing::XDrawPage*)new SvxDrawPage( pPage );
-
- pPage->mxUnoPage = xPage;
- }
+ uno::Reference< uno::XInterface > xPage( pPage->getUnoPage() );
+
+// by using pPage->getUnoPage() instead of pPage->mxUnoPage there is alraedy code used
+// to create a needed page there when no one exists. Only missing feature there is the
+// model casting, so added there (it always created a SvxFmDrawPage)
+//
+// if( !xPage.is() )
+// {
+// xPage = pPage->createUnoPage();
+// if( dynamic_cast< FmFormModel* >( mrModel.mpDoc ) )
+// xPage = (drawing::XDrawPage*)new SvxFmDrawPage( pPage );
+// else
+// xPage = (drawing::XDrawPage*)new SvxDrawPage( pPage );
+//
+// pPage->mxUnoPage = xPage;
+// }
aAny <<= xPage;
}
@@ -692,7 +695,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SvxUnoDrawPagesAccess::insertNewBy
{
SdrPage* pPage;
- if( PTR_CAST( FmFormModel, mrModel.mpDoc ) )
+ if( dynamic_cast< FmFormModel* >( mrModel.mpDoc ) )
pPage = new FmFormPage(*(FmFormModel*)mrModel.mpDoc, NULL);
else
pPage = new SdrPage(*mrModel.mpDoc);
@@ -719,7 +722,7 @@ void SAL_CALL SvxUnoDrawPagesAccess::remove( const uno::Reference< drawing::XDra
SdrPage* pPage = pSvxPage->GetSdrPage();
if(pPage)
{
- sal_uInt16 nPage = pPage->GetPageNum();
+ sal_uInt32 nPage = pPage->GetPageNumber();
mrModel.mpDoc->DeletePage( nPage );
}
}
diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx
index cdff8b983d6e..cd8d77c63a65 100644
--- a/svx/source/unodraw/unomtabl.cxx
+++ b/svx/source/unodraw/unomtabl.cxx
@@ -130,9 +130,9 @@ void SvxUnoMarkerTable::dispose()
// SfxListener
void SvxUnoMarkerTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
- if( pSdrHint && HINT_MODELCLEARED == pSdrHint->GetKind() )
+ if( pSdrHint && HINT_MODELCLEARED == pSdrHint->GetSdrHintKind() )
dispose();
}
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 2e7aa2dd8061..eb7ee793cd46 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -32,7 +32,6 @@
#include <sfx2/dispatch.hxx>
#include <sot/clsids.hxx>
#include <comphelper/serviceinfohelper.hxx>
-
#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <sfx2/objsh.hxx>
@@ -45,8 +44,7 @@
#include <svx/svdpagv.hxx>
#include <svx/unopage.hxx>
#include "shapeimpl.hxx"
-#include "svx/globl3d.hxx"
-#include <svx/polysc3d.hxx>
+#include <svx/globl3d.hxx>
#include <svx/unoprov.hxx>
#include <svx/svdopath.hxx>
#include "svx/unoapi.hxx"
@@ -54,6 +52,9 @@
#include <svx/extrud3d.hxx>
#include <svx/lathe3d.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/scene3d.hxx>
+#include <svx/globaldrawitempool.hxx>
#include <tools/diagnose_ex.h>
using ::rtl::OUString;
@@ -80,24 +81,25 @@ DECLARE_LIST( SvxDrawPageList, SvxDrawPage * )
**********************************************************************/
UNO3_GETIMPLEMENTATION_IMPL( SvxDrawPage );
-DBG_NAME(SvxDrawPage)
SvxDrawPage::SvxDrawPage( SdrPage* pInPage ) throw()
: mrBHelper( getMutex() )
, mpPage( pInPage )
, mpModel( 0 )
{
- DBG_CTOR(SvxDrawPage,NULL);
// Am Broadcaster anmelden
if( mpPage )
- mpModel = mpPage->GetModel();
+ mpModel = &mpPage->getSdrModelFromSdrPage();
+
if( mpModel )
StartListening( *mpModel );
// Erzeugen der (hidden) ::com::sun::star::sdbcx::View
- mpView = new SdrView( mpModel );
+ if(mpModel)
+ mpView = new SdrView( *mpModel );
+
if( mpView )
- mpView->SetDesignMode(sal_True);
+ mpView->SetDesignMode(true);
}
//----------------------------------------------------------------------
@@ -109,7 +111,6 @@ SvxDrawPage::SvxDrawPage() throw()
, mpModel( NULL )
, mpView( NULL )
{
- DBG_CTOR(SvxDrawPage,NULL);
}
//----------------------------------------------------------------------
@@ -121,7 +122,6 @@ SvxDrawPage::~SvxDrawPage() throw()
acquire();
dispose();
}
- DBG_DTOR(SvxDrawPage,NULL);
}
//----------------------------------------------------------------------
@@ -278,10 +278,11 @@ void SvxDrawPage::Notify( SfxBroadcaster&, const SfxHint& /*rHint*/ )
/*
if( mpModel )
{
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
if( pSdrHint )
{
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
case HINT_MODELCLEARED:
dispose();
@@ -318,10 +319,9 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
pObj = CreateSdrObject( xShape );
ENSURE_OR_RETURN_VOID( pObj != NULL, "SvxDrawPage::add: no SdrObject was created!" );
}
- else if ( !pObj->IsInserted() )
+ else if ( !pObj->IsObjectInserted() )
{
- pObj->SetModel(mpModel);
- mpPage->InsertObject( pObj );
+ mpPage->InsertObjectToSdrObjList(*pObj);
}
pShape->Create( pObj, this );
@@ -352,8 +352,8 @@ void SAL_CALL SvxDrawPage::remove( const Reference< drawing::XShape >& xShape )
{
if(mpPage->GetObj(nNum) == pObj)
{
- OSL_VERIFY( mpPage->RemoveObject( nNum ) == pObj );
- SdrObject::Free( pObj );
+ OSL_VERIFY( mpPage->RemoveObjectFromSdrObjList( nNum ) == pObj );
+ deleteSdrObjectSafeAndClearPointer( pObj );
break;
}
}
@@ -424,7 +424,7 @@ sal_Bool SAL_CALL SvxDrawPage::hasElements()
namespace
{
- void lcl_markSdrObjectOfShape( const Reference< drawing::XShape >& _rxShape, SdrView& _rView, SdrPageView& _rPageView )
+ void lcl_markSdrObjectOfShape( const Reference< drawing::XShape >& _rxShape, SdrView& _rView )
{
SvxShape* pShape = SvxShape::getImplementation( _rxShape );
if ( !pShape )
@@ -434,7 +434,7 @@ namespace
if ( !pObj )
return;
- _rView.MarkObj( pObj, &_rPageView );
+ _rView.MarkObj( *pObj );
}
}
@@ -442,14 +442,13 @@ namespace
// ACHTUNG: _SelectObjectsInView selektiert die ::com::sun::star::drawing::Shapes nur in der angegebennen
// SdrPageView. Dies muß nicht die sichtbare SdrPageView sein.
//----------------------------------------------------------------------
-void SvxDrawPage::_SelectObjectsInView( const Reference< drawing::XShapes > & aShapes, SdrPageView* pPageView ) throw ()
+void SvxDrawPage::_SelectObjectsInView( const Reference< drawing::XShapes > & aShapes ) throw ()
{
- DBG_ASSERT(pPageView,"SdrPageView ist NULL! [CL]");
DBG_ASSERT(mpView, "SdrView ist NULL! [CL]");
- if(pPageView!=NULL && mpView!=NULL)
+ if(mpView!=NULL)
{
- mpView->UnmarkAllObj( pPageView );
+ mpView->UnmarkAllObj();
long nCount = aShapes->getCount();
for( long i = 0; i < nCount; i++ )
@@ -457,7 +456,7 @@ void SvxDrawPage::_SelectObjectsInView( const Reference< drawing::XShapes > & aS
uno::Any aAny( aShapes->getByIndex(i) );
Reference< drawing::XShape > xShape;
if( aAny >>= xShape )
- lcl_markSdrObjectOfShape( xShape, *mpView, *pPageView );
+ lcl_markSdrObjectOfShape( xShape, *mpView );
}
}
}
@@ -466,15 +465,14 @@ void SvxDrawPage::_SelectObjectsInView( const Reference< drawing::XShapes > & aS
// ACHTUNG: _SelectObjectInView selektiert das Shape *nur* in der angegebennen
// SdrPageView. Dies muß nicht die sichtbare SdrPageView sein.
//----------------------------------------------------------------------
-void SvxDrawPage::_SelectObjectInView( const Reference< drawing::XShape > & xShape, SdrPageView* pPageView ) throw()
+void SvxDrawPage::_SelectObjectInView( const Reference< drawing::XShape > & xShape ) throw()
{
- DBG_ASSERT(pPageView,"SdrPageView ist NULL! [CL]");
DBG_ASSERT(mpView, "SdrView ist NULL! [CL]");
- if(pPageView!=NULL && mpView != NULL)
+ if(mpView != NULL)
{
- mpView->UnmarkAllObj( pPageView );
- lcl_markSdrObjectOfShape( xShape, *mpView, *pPageView );
+ mpView->UnmarkAllObj();
+ lcl_markSdrObjectOfShape( xShape, *mpView );
}
}
@@ -494,20 +492,14 @@ Reference< drawing::XShapeGroup > SAL_CALL SvxDrawPage::group( const Reference<
if(mpPage==NULL||mpView==NULL||!xShapes.is())
return xShapeGroup;
- SdrPageView* pPageView = mpView->ShowSdrPage( mpPage );
-
- _SelectObjectsInView( xShapes, pPageView );
-
+ mpView->ShowSdrPage( *mpPage );
+ _SelectObjectsInView( xShapes );
mpView->GroupMarked();
+ mpView->SetMarkHandles();
- mpView->AdjustMarkHdl();
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
- {
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ SdrObject* pObj = mpView->getSelectedIfSingle();
if( pObj )
xShapeGroup = Reference< drawing::XShapeGroup >::query( pObj->getUnoShape() );
- }
mpView->HideSdrPage();
@@ -532,10 +524,9 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr
if(mpPage==NULL||mpView==NULL||!aGroup.is())
return;
- SdrPageView* pPageView = mpView->ShowSdrPage( mpPage );
-
+ mpView->ShowSdrPage( *mpPage );
Reference< drawing::XShape > xShape( aGroup, UNO_QUERY );
- _SelectObjectInView( xShape, pPageView );
+ _SelectObjectInView( xShape );
mpView->UnGroupMarked();
mpView->HideSdrPage();
@@ -547,93 +538,107 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr
//----------------------------------------------------------------------
SdrObject *SvxDrawPage::_CreateSdrObject( const Reference< drawing::XShape > & xShape ) throw()
{
- sal_uInt16 nType;
- sal_uInt32 nInventor;
-
- GetTypeAndInventor( nType, nInventor, xShape->getShapeType() );
SdrObject* pNewObj = 0;
- if( nType != 0 )
+ if(mpModel)
{
- awt::Size aSize = xShape->getSize();
- aSize.Width += 1;
- aSize.Height += 1;
- awt::Point aPos = xShape->getPosition();
- Rectangle aRect( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) );
+ const SvxShapeKind aSvxShapeKind(getSvxShapeKind(xShape->getShapeType()));
- // special cases
- if( nInventor == SdrInventor )
+ if(SvxShapeKind_None != aSvxShapeKind)
{
- switch( nType )
+ const awt::Size aSize(xShape->getSize());
+ const awt::Point aPos(xShape->getPosition());
+ bool bSetTransform(true);
+
+ // special cases
+ if(SvxShapeKind_Measure == aSvxShapeKind)
+ {
+ // create measure direct point-based
+ pNewObj = new SdrMeasureObj(
+ *mpModel,
+ Point(aPos.X, aPos.Y),
+ Point(aPos.X + aSize.Width, aPos.Y + aSize.Height));
+ bSetTransform = false;
+ }
+ else if(SvxShapeKind_Path == aSvxShapeKind)
+ {
+ // create polygon object with some initial data to have a size
+ basegfx::B2DPolygon aPoly;
+
+ aPoly.append(basegfx::B2DPoint(aPos.X, aPos.Y));
+ aPoly.append(basegfx::B2DPoint(aPos.X + 100.0, aPos.Y));
+ pNewObj = new SdrPathObj(*mpModel, basegfx::B2DPolyPolygon(aPoly));
+ bSetTransform = false;
+ }
+
+ if(!pNewObj)
+ {
+ sal_uInt16 nIdent(OBJ_NONE);
+ sal_uInt32 nInvent(SdrInventor);
+
+ SvxShapeKindToSdrObjectCreatorInventor(aSvxShapeKind, nIdent, nInvent);
+ pNewObj = SdrObjFactory::MakeNewObject(*mpModel, SdrObjectCreationInfo(nIdent, nInvent));
+ }
+
+ if(pNewObj)
{
- case OBJ_MEASURE:
+ E3dScene* pE3dScene = dynamic_cast< E3dScene* >(pNewObj);
+ E3dExtrudeObj* pE3dExtrudeObj = dynamic_cast< E3dExtrudeObj* >(pNewObj);
+ E3dLatheObj* pE3dLatheObj = dynamic_cast< E3dLatheObj* >(pNewObj);
+
+ if( pE3dScene )
{
- pNewObj = new SdrMeasureObj( aRect.TopLeft(), aRect.BottomRight() );
- break;
+ // init scene
+ const double fW(aSize.Width);
+ const double fH(aSize.Height);
+ Camera3D aCam(pE3dScene->GetCamera());
+
+ aCam.SetAutoAdjustProjection(sal_False);
+ aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
+
+ basegfx::B3DPoint aLookAt;
+ basegfx::B3DPoint aCamPos(0.0, 0.0, 10000.0);
+
+ aCam.SetPosAndLookAt(aCamPos, aLookAt);
+ aCam.SetFocalLength(100.0);
+ aCam.SetDefaults(aCamPos, aLookAt, 10000.0);
+ pE3dScene->SetCamera(aCam);
+ pE3dScene->ActionChanged();
}
- case OBJ_LINE:
+ else if(pE3dExtrudeObj)
{
- basegfx::B2DPolygon aPoly;
- aPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Top()));
- aPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom()));
- pNewObj = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
- break;
+ // init extrude to some defaults
+ basegfx::B2DPolygon aNewPolygon;
+
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 1.0));
+ aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+ aNewPolygon.setClosed(true);
+ pE3dExtrudeObj->SetExtrudePolygon(basegfx::B2DPolyPolygon(aNewPolygon));
+
+ pE3dExtrudeObj->SetMergedItem(Svx3DCharacterModeItem(sal_True));
}
- }
- }
+ else if(pE3dLatheObj)
+ {
+ // init lathe to some defaults
+ basegfx::B2DPolygon aNewPolygon;
- if( pNewObj == NULL )
- pNewObj = SdrObjFactory::MakeNewObject( nInventor, nType, mpPage );
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 1.0));
+ aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+ aNewPolygon.setClosed(true);
+ pE3dLatheObj->SetPolyPoly2D(basegfx::B2DPolyPolygon(aNewPolygon));
- if(pNewObj)
- {
- pNewObj->SetSnapRect(aRect);
+ pE3dLatheObj->SetMergedItem(Svx3DCharacterModeItem(sal_True));
+ }
- if( pNewObj->ISA(E3dPolyScene))
- {
- // Szene initialisieren
- E3dScene* pScene = (E3dScene*)pNewObj;
-
- double fW = (double)aSize.Width;
- double fH = (double)aSize.Height;
-
- Camera3D aCam(pScene->GetCamera());
- aCam.SetAutoAdjustProjection(sal_False);
- aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
- basegfx::B3DPoint aLookAt;
- basegfx::B3DPoint aCamPos(0.0, 0.0, 10000.0);
- aCam.SetPosAndLookAt(aCamPos, aLookAt);
- aCam.SetFocalLength(100.0);
- aCam.SetDefaults(aCamPos, aLookAt, 10000.0);
- pScene->SetCamera(aCam);
-
- pScene->SetRectsDirty();
- }
- else if(pNewObj->ISA(E3dExtrudeObj))
- {
- E3dExtrudeObj* pObj = (E3dExtrudeObj*)pNewObj;
- basegfx::B2DPolygon aNewPolygon;
- aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
- aNewPolygon.append(basegfx::B2DPoint(0.0, 1.0));
- aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
- aNewPolygon.setClosed(true);
- pObj->SetExtrudePolygon(basegfx::B2DPolyPolygon(aNewPolygon));
-
- // #107245# pObj->SetExtrudeCharacterMode(sal_True);
- pObj->SetMergedItem(Svx3DCharacterModeItem(sal_True));
- }
- else if(pNewObj->ISA(E3dLatheObj))
- {
- E3dLatheObj* pObj = (E3dLatheObj*)pNewObj;
- basegfx::B2DPolygon aNewPolygon;
- aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
- aNewPolygon.append(basegfx::B2DPoint(0.0, 1.0));
- aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
- aNewPolygon.setClosed(true);
- pObj->SetPolyPoly2D(basegfx::B2DPolyPolygon(aNewPolygon));
-
- // #107245# pObj->SetLatheCharacterMode(sal_True);
- pObj->SetMergedItem(Svx3DCharacterModeItem(sal_True));
+ if(bSetTransform)
+ {
+ pNewObj->setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize.Width, aSize.Height,
+ aPos.X, aPos.Y));
+ }
}
}
}
@@ -642,261 +647,229 @@ SdrObject *SvxDrawPage::_CreateSdrObject( const Reference< drawing::XShape > & x
}
//----------------------------------------------------------------------
-void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor, const OUString& aName ) const throw()
+SvxShapeKind SvxDrawPage::getSvxShapeKind( const ::rtl::OUString& aName ) const throw()
{
- sal_uInt32 nTempType = aSdrShapeIdentifierMap.getId( aName );
+ SvxShapeKind aSvxShapeKind(getSvxShapeKindFromTypeName(aName));
- if( nTempType == UHASHMAP_NOTFOUND )
+ if(SvxShapeKind_None != aSvxShapeKind)
{
- if( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape")) ||
- aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.TableShape")) )
- {
- rInventor = SdrInventor;
- rType = OBJ_TABLE;
- }
- else if( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.MediaShape" )) )
+ switch(aSvxShapeKind)
{
- rInventor = SdrInventor;
- rType = OBJ_MEDIA;
+ case SvxShapeKind_Frame:
+ case SvxShapeKind_Plugin:
+ case SvxShapeKind_Applet:
+ {
+ aSvxShapeKind = SvxShapeKind_OLE2;
+ break;
+ }
}
}
- else if(nTempType & E3D_INVENTOR_FLAG)
- {
- rInventor = E3dInventor;
- rType = (sal_uInt16)(nTempType & ~E3D_INVENTOR_FLAG);
- }
else
{
- rInventor = SdrInventor;
- rType = (sal_uInt16)nTempType;
-
- switch( rType )
+ if(aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape")) || aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.TableShape")))
{
- case OBJ_FRAME:
- case OBJ_OLE2_PLUGIN:
- case OBJ_OLE2_APPLET:
- rType = OBJ_OLE2;
- break;
+ aSvxShapeKind = SvxShapeKind_Table;
+ }
+ else if(aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.presentation.MediaShape")))
+ {
+ aSvxShapeKind = SvxShapeKind_Media;
}
}
+
+ return aSvxShapeKind;
}
//----------------------------------------------------------------------
-SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor, SdrObject *pObj, SvxDrawPage *mpPage ) throw()
+SvxShape* SvxDrawPage::CreateShapeBySvxShapeKind(
+ SvxShapeKind aSvxShapeKind,
+ SdrObject *pObj,
+ SvxDrawPage *mpPage ) throw()
{
- SvxShape* pRet = NULL;
- switch( nInventor )
+ SvxShape* pRet = 0;
+
+ switch(aSvxShapeKind)
{
- case E3dInventor:
+ // 3D shapes
+ case SvxShapeKind_3DScene:
{
- switch( nType )
- {
- case E3D_SCENE_ID :
- case E3D_POLYSCENE_ID :
- pRet = new Svx3DSceneObject( pObj, mpPage );
- break;
- case E3D_CUBEOBJ_ID :
- pRet = new Svx3DCubeObject( pObj );
- break;
- case E3D_SPHEREOBJ_ID :
- pRet = new Svx3DSphereObject( pObj );
- break;
- case E3D_LATHEOBJ_ID :
- pRet = new Svx3DLatheObject( pObj );
- break;
- case E3D_EXTRUDEOBJ_ID :
- pRet = new Svx3DExtrudeObject( pObj );
- break;
- case E3D_POLYGONOBJ_ID :
- pRet = new Svx3DPolygonObject( pObj );
- break;
- default: // unbekanntes 3D-Objekt auf der Page
- pRet = new SvxShape( pObj );
- break;
- }
+ pRet = new Svx3DSceneObject( pObj, mpPage );
+ break;
+ }
+ case SvxShapeKind_3DCube:
+ {
+ pRet = new Svx3DCubeObject( pObj );
+ break;
+ }
+ case SvxShapeKind_3DSphere:
+ {
+ pRet = new Svx3DSphereObject( pObj );
+ break;
+ }
+ case SvxShapeKind_3DExtrude:
+ {
+ pRet = new Svx3DExtrudeObject( pObj );
+ break;
+ }
+ case SvxShapeKind_3DLathe:
+ {
+ pRet = new Svx3DLatheObject( pObj );
+ break;
+ }
+ case SvxShapeKind_3DPolygon:
+ {
+ pRet = new Svx3DPolygonObject( pObj );
+ break;
+ }
+
+ // Svx shapes
+ case SvxShapeKind_Group:
+ {
+ pRet = new SvxShapeGroup( pObj, mpPage );
+ break;
+ }
+ case SvxShapeKind_Rectangle:
+ {
+ pRet = new SvxShapeRect( pObj );
+ break;
+ }
+ case SvxShapeKind_Circle:
+ {
+ pRet = new SvxShapeCircle( pObj );
+ break;
+ }
+ case SvxShapeKind_Path:
+ {
+ pRet = new SvxShapePolyPolygon( pObj );
+ break;
+ }
+ case SvxShapeKind_Text:
+ {
+ pRet = new SvxShapeText( pObj );
+ break;
+ }
+ case SvxShapeKind_Graphic:
+ {
+ pRet = new SvxGraphicObject( pObj );
break;
}
- case SdrInventor:
+ case SvxShapeKind_OLE2:
{
- switch( nType )
+ if( pObj && !pObj->IsEmptyPresObj() && mpPage )
{
-// case OBJ_NONE:
-// break;
- case OBJ_GRUP:
- pRet = new SvxShapeGroup( pObj, mpPage );
- break;
- case OBJ_LINE:
- pRet = new SvxShapePolyPolygon( pObj , PolygonKind_LINE );
- break;
- case OBJ_RECT:
- pRet = new SvxShapeRect( pObj );
- break;
- case OBJ_CIRC:
- case OBJ_SECT:
- case OBJ_CARC:
- case OBJ_CCUT:
- pRet = new SvxShapeCircle( pObj );
- break;
- case OBJ_POLY:
- pRet = new SvxShapePolyPolygon( pObj , PolygonKind_POLY );
- break;
- case OBJ_PLIN:
- pRet = new SvxShapePolyPolygon( pObj , PolygonKind_PLIN );
- break;
- case OBJ_SPLNLINE:
- case OBJ_PATHLINE:
- pRet = new SvxShapePolyPolygonBezier( pObj , PolygonKind_PATHLINE );
- break;
- case OBJ_SPLNFILL:
- case OBJ_PATHFILL:
- pRet = new SvxShapePolyPolygonBezier( pObj , PolygonKind_PATHFILL );
- break;
- case OBJ_FREELINE:
- pRet = new SvxShapePolyPolygonBezier( pObj , PolygonKind_FREELINE );
- break;
- case OBJ_FREEFILL:
- pRet = new SvxShapePolyPolygonBezier( pObj , PolygonKind_FREEFILL );
- break;
- case OBJ_CAPTION:
- pRet = new SvxShapeCaption( pObj );
- break;
- case OBJ_TITLETEXT:
- case OBJ_OUTLINETEXT:
- case OBJ_TEXT:
- pRet = new SvxShapeText( pObj );
- break;
- case OBJ_GRAF:
- pRet = new SvxGraphicObject( pObj );
- break;
- case OBJ_FRAME:
- pRet = new SvxFrameShape( pObj );
- break;
- case OBJ_OLE2_APPLET:
- pRet = new SvxAppletShape( pObj );
- break;
- case OBJ_OLE2_PLUGIN:
- pRet = new SvxPluginShape( pObj );
- break;
- case OBJ_OLE2:
- {
- if( pObj && !pObj->IsEmptyPresObj() && mpPage )
+ SdrPage* pSdrPage = mpPage->GetSdrPage();
+
+ if( pSdrPage )
+ {
+ ::comphelper::IEmbeddedHelper *pPersist = pSdrPage->getSdrModelFromSdrPage().GetPersist();
+ if( pPersist )
+ {
+ uno::Reference < embed::XEmbeddedObject > xObject = pPersist->getEmbeddedObjectContainer().
+ GetEmbeddedObject( static_cast< SdrOle2Obj* >( pObj )->GetPersistName() );
+
+ // TODO CL->KA: Why is this not working anymore?
+ if( xObject.is() )
{
- SdrPage* pSdrPage = mpPage->GetSdrPage();
- if( pSdrPage )
+ SvGlobalName aClassId( xObject->getClassID() );
+
+ const SvGlobalName aAppletClassId( SO3_APPLET_CLASSID );
+ const SvGlobalName aPluginClassId( SO3_PLUGIN_CLASSID );
+ const SvGlobalName aIFrameClassId( SO3_IFRAME_CLASSID );
+
+ if( aPluginClassId == aClassId )
{
- SdrModel* pSdrModel = pSdrPage->GetModel();
- if( pSdrModel )
- {
- ::comphelper::IEmbeddedHelper *pPersist = pSdrModel->GetPersist();
- if( pPersist )
- {
- uno::Reference < embed::XEmbeddedObject > xObject = pPersist->getEmbeddedObjectContainer().
- GetEmbeddedObject( static_cast< SdrOle2Obj* >( pObj )->GetPersistName() );
-
- // TODO CL->KA: Why is this not working anymore?
- if( xObject.is() )
- {
- SvGlobalName aClassId( xObject->getClassID() );
-
- const SvGlobalName aAppletClassId( SO3_APPLET_CLASSID );
- const SvGlobalName aPluginClassId( SO3_PLUGIN_CLASSID );
- const SvGlobalName aIFrameClassId( SO3_IFRAME_CLASSID );
-
- if( aPluginClassId == aClassId )
- {
- pRet = new SvxPluginShape( pObj );
- nType = OBJ_OLE2_PLUGIN;
- }
- else if( aAppletClassId == aClassId )
- {
- pRet = new SvxAppletShape( pObj );
- nType = OBJ_OLE2_APPLET;
- }
- else if( aIFrameClassId == aClassId )
- {
- pRet = new SvxFrameShape( pObj );
- nType = OBJ_FRAME;
- }
- }
- }
- }
+ pRet = new SvxPluginShape( pObj );
+ aSvxShapeKind = SvxShapeKind_Plugin;
+ }
+ else if( aAppletClassId == aClassId )
+ {
+ pRet = new SvxAppletShape( pObj );
+ aSvxShapeKind = SvxShapeKind_Applet;
+ }
+ else if( aIFrameClassId == aClassId )
+ {
+ pRet = new SvxFrameShape( pObj );
+ aSvxShapeKind = SvxShapeKind_Frame;
}
}
- if( pRet == NULL )
- {
- pRet = new SvxOle2Shape( pObj, aSvxMapProvider.GetMap(SVXMAP_OLE2), aSvxMapProvider.GetPropertySet(SVXMAP_OLE2, SdrObject::GetGlobalDrawObjectItemPool()) );
- }
- }
- break;
- case OBJ_EDGE:
- pRet = new SvxShapeConnector( pObj );
- break;
- case OBJ_PATHPOLY:
- pRet = new SvxShapePolyPolygon( pObj , PolygonKind_PATHPOLY );
- break;
- case OBJ_PATHPLIN:
- pRet = new SvxShapePolyPolygon( pObj , PolygonKind_PATHPLIN );
- break;
- case OBJ_PAGE:
- pRet = new SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_PAGE), aSvxMapProvider.GetPropertySet(SVXMAP_PAGE, SdrObject::GetGlobalDrawObjectItemPool()) );
- break;
- case OBJ_MEASURE:
- pRet = new SvxShapeDimensioning( pObj );
- break;
-// case OBJ_DUMMY:
-// break;
- case OBJ_UNO:
- pRet = new SvxShapeControl( pObj );
- break;
- case OBJ_CUSTOMSHAPE:
- pRet = new SvxCustomShape( pObj );
- break;
- case OBJ_MEDIA:
- pRet = new SvxMediaShape( pObj );
- break;
- case OBJ_TABLE:
- pRet = new SvxTableShape( pObj );
- break;
- default: // unbekanntes 2D-Objekt auf der Page
- DBG_ERROR("Nicht implementierter Starone-Shape erzeugt! [CL]");
- pRet = new SvxShapeText( pObj );
- break;
+ }
+ }
+ }
+
+ if( !pRet )
+ {
+ pRet = new SvxOle2Shape( pObj, aSvxMapProvider.GetMap(SVXMAP_OLE2), aSvxMapProvider.GetPropertySet(SVXMAP_OLE2, GetGlobalDrawObjectItemPool()) );
}
+
break;
}
- default: // Unbekannter Inventor
+ case SvxShapeKind_Connector:
{
- DBG_ERROR("AW: Unknown Inventor in SvxDrawPage::_CreateShape()");
+ pRet = new SvxShapeConnector( pObj );
break;
}
- }
-
- if(pRet)
- {
- sal_uInt32 nObjId = nType;
-
- if( nInventor == E3dInventor )
- nObjId |= E3D_INVENTOR_FLAG;
-
- switch(nObjId)
+ case SvxShapeKind_Caption:
{
- case OBJ_CCUT: // Kreisabschnitt
- case OBJ_CARC: // Kreisbogen
- case OBJ_SECT: // Kreissektor
- nObjId = OBJ_CIRC;
+ pRet = new SvxShapeCaption( pObj );
break;
-
- case E3D_SCENE_ID | E3D_INVENTOR_FLAG:
- nObjId = E3D_POLYSCENE_ID | E3D_INVENTOR_FLAG;
+ }
+ case SvxShapeKind_Page:
+ {
+ pRet = new SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_PAGE), aSvxMapProvider.GetPropertySet(SVXMAP_PAGE, GetGlobalDrawObjectItemPool()) );
+ break;
+ }
+ case SvxShapeKind_Measure:
+ {
+ pRet = new SvxShapeDimensioning( pObj );
+ break;
+ }
+ case SvxShapeKind_Frame:
+ {
+ pRet = new SvxFrameShape( pObj );
break;
+ }
+ case SvxShapeKind_Control:
+ {
+ pRet = new SvxShapeControl( pObj );
+ break;
+ }
+ case SvxShapeKind_Customshape:
+ {
+ pRet = new SvxCustomShape( pObj );
+ break;
+ }
+ case SvxShapeKind_Media:
+ {
+ pRet = new SvxMediaShape( pObj );
+ break;
+ }
+ case SvxShapeKind_Table:
+ {
+ pRet = new SvxTableShape( pObj );
+ break;
+ }
- case OBJ_TITLETEXT:
- case OBJ_OUTLINETEXT:
- nObjId = OBJ_TEXT;
+ // objects not directly associated with SdrObjKind
+ case SvxShapeKind_Applet:
+ {
+ pRet = new SvxAppletShape( pObj );
+ break;
+ }
+ case SvxShapeKind_Plugin:
+ {
+ pRet = new SvxPluginShape( pObj );
+ break;
+ }
+ default: // unknown Object on Page
+ {
+ DBG_ERROR("Not implemented Shape created (!)");
+ pRet = new SvxShapeText( pObj );
break;
}
+ }
- pRet->setShapeKind(nObjId);
+ if(pRet)
+ {
+ pRet->setSvxShapeKind(aSvxShapeKind);
}
return pRet;
@@ -905,10 +878,11 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt3
//----------------------------------------------------------------------
Reference< drawing::XShape > SvxDrawPage::_CreateShape( SdrObject *pObj ) const throw()
{
- Reference< drawing::XShape > xShape( CreateShapeByTypeAndInventor(pObj->GetObjIdentifier(),
- pObj->GetObjInventor(),
- pObj,
- (SvxDrawPage*)this));
+ Reference< drawing::XShape > xShape(
+ CreateShapeBySvxShapeKind(
+ SdrObjectCreatorInventorToSvxShapeKind(pObj->GetObjIdentifier(), pObj->GetObjInventor()),
+ pObj,
+ const_cast< SvxDrawPage* >(static_cast< const SvxDrawPage* >(this))));
return xShape;
}
@@ -916,8 +890,8 @@ Reference< drawing::XShape > SvxDrawPage::_CreateShape( SdrObject *pObj ) const
SdrObject *SvxDrawPage::CreateSdrObject( const Reference< drawing::XShape > & xShape ) throw()
{
SdrObject* pObj = _CreateSdrObject( xShape );
- if( pObj && !pObj->IsInserted() )
- mpPage->InsertObject( pObj );
+ if( pObj && !pObj->IsObjectInserted() )
+ mpPage->InsertObjectToSdrObjList(*pObj);
return pObj;
}
@@ -943,33 +917,6 @@ uno::Sequence< OUString > SAL_CALL SvxDrawPage::getSupportedServiceNames() throw
return aSeq;
}
-SvxShape* CreateSvxShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor ) throw()
-{
- return SvxDrawPage::CreateShapeByTypeAndInventor( nType, nInventor );
-}
-
-void SvxDrawPage::ChangeModel( SdrModel* pNewModel )
-{
- if( pNewModel != mpModel )
- {
- if( mpModel )
- EndListening( *mpModel );
-
- if( pNewModel )
- StartListening( *pNewModel );
-
- mpModel = pNewModel;
-
- if( mpView )
- {
- delete mpView;
- mpView = new SdrView( mpModel );
- if( mpView )
- mpView->SetDesignMode(sal_True);
- }
- }
-}
-
/** returns a StarOffice API wrapper for the given SdrPage */
uno::Reference< drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) throw ()
{
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index ffae616904fa..be2f2d2ae440 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -49,6 +49,8 @@
#include <svx/dialogs.hrc>
#include <svx/svdpool.hxx>
#include <svx/svdobj.hxx>
+#include <hash_map>
+#include <svx/unoshape.hxx>
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -829,85 +831,125 @@ comphelper::PropertyMapEntry* ImplGetAdditionalWriterDrawingDefaultsPropertyMap(
}
// ---------------------------------------------------------------------
-
SvxUnoPropertyMapProvider aSvxMapProvider;
-UHashMapEntry pSdrShapeIdentifierMap[] =
-{
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.RectangleShape"), OBJ_RECT ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.EllipseShape"), OBJ_CIRC ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ControlShape"), OBJ_UNO ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ConnectorShape"), OBJ_EDGE ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MeasureShape"), OBJ_MEASURE ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.LineShape"), OBJ_LINE ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonShape"), OBJ_POLY ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLineShape"), OBJ_PLIN ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenBezierShape"), OBJ_PATHLINE ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedBezierShape"), OBJ_PATHFILL ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenFreeHandShape"), OBJ_FREELINE ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedFreeHandShape"), OBJ_FREEFILL ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonPathShape"), OBJ_PATHPOLY ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLinePathShape"), OBJ_PATHPLIN ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GraphicObjectShape"), OBJ_GRAF ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GroupShape"), OBJ_GRUP ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TextShape"), OBJ_TEXT ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OLE2Shape"), OBJ_OLE2 ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PageShape"), OBJ_PAGE ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CaptionShape"), OBJ_CAPTION ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.FrameShape"), OBJ_FRAME ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PluginShape"), OBJ_OLE2_PLUGIN ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.AppletShape"), OBJ_OLE2_APPLET ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CustomShape"), OBJ_CUSTOMSHAPE ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MediaShape"), OBJ_MEDIA ),
-
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSceneObject"), E3D_POLYSCENE_ID | E3D_INVENTOR_FLAG ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DCubeObject"), E3D_CUBEOBJ_ID | E3D_INVENTOR_FLAG ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSphereObject"), E3D_SPHEREOBJ_ID | E3D_INVENTOR_FLAG ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DLatheObject"), E3D_LATHEOBJ_ID | E3D_INVENTOR_FLAG ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject"), E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DPolygonObject"), E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG ),
- UHashMapEntry (RTL_CONSTASCII_STRINGPARAM(""), 0 )
-};
-
// ---------------------------------------------------------------------
+static rtl::OUString aComSunStarDrawing(rtl::OUString::createFromAscii("com.sun.star.drawing."));
+typedef std::hash_map< rtl::OUString, SvxShapeKind, rtl::OUStringHash > TypeNameToSvxShapeKindMapper;
+typedef std::pair< rtl::OUString, SvxShapeKind > TypeNameToSvxShapeKindType;
+static TypeNameToSvxShapeKindMapper aTypeNameToSvxShapeKindMapper;
-UHashMap aSdrShapeIdentifierMap( pSdrShapeIdentifierMap );
-
-/***********************************************************************
-* class UHashMap *
-***********************************************************************/
+void initTokenMapper()
+{
+ if(aTypeNameToSvxShapeKindMapper.empty())
+ {
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("RectangleShape"), SvxShapeKind_Rectangle));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("EllipseShape"), SvxShapeKind_Circle));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("ControlShape"), SvxShapeKind_Control));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("ConnectorShape"), SvxShapeKind_Connector));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("MeasureShape"), SvxShapeKind_Measure));
+
+ // all polygon shapes are handled as single path object
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("LineShape"), SvxShapeKind_Path));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("PolyPolygonShape"), SvxShapeKind_Path));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("PolyLineShape"), SvxShapeKind_Path));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("OpenBezierShape"), SvxShapeKind_Path));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("ClosedBezierShape"), SvxShapeKind_Path));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("OpenFreeHandShape"), SvxShapeKind_Path)); // freehands are only created interactively, should not happen
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("ClosedFreeHandShape"), SvxShapeKind_Path)); // freehands are only created interactively, should not happen
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("PolyPolygonPathShape"), SvxShapeKind_Path)); // closed filled PolyPolygon, no difference to ClosedBezierShape
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("PolyLinePathShape"), SvxShapeKind_Path)); // open PolyPolygon, no difference to OpenBezierShape
+
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("GraphicObjectShape"), SvxShapeKind_Graphic));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("GroupShape"), SvxShapeKind_Group));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("TextShape"), SvxShapeKind_Text));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("OLE2Shape"), SvxShapeKind_OLE2));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("PageShape"), SvxShapeKind_Page));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("CaptionShape"), SvxShapeKind_Caption));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("FrameShape"), SvxShapeKind_Frame));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("PluginShape"), SvxShapeKind_Plugin));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("AppletShape"), SvxShapeKind_Applet));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("CustomShape"), SvxShapeKind_Customshape));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("MediaShape"), SvxShapeKind_Media));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("Shape3DSceneObject"), SvxShapeKind_3DScene));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("Shape3DCubeObject"), SvxShapeKind_3DCube));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("Shape3DSphereObject"), SvxShapeKind_3DSphere));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("Shape3DLatheObject"), SvxShapeKind_3DLathe));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("Shape3DExtrudeObject"), SvxShapeKind_3DExtrude));
+ aTypeNameToSvxShapeKindMapper.insert(TypeNameToSvxShapeKindType(rtl::OUString::createFromAscii("Shape3DPolygonObject"), SvxShapeKind_3DPolygon));
+ }
+}
-UHashMap::UHashMap( UHashMapEntry* pMap )
+std::vector< OUString > getAllSvxShapeTypeNames()
{
- while( pMap->aIdentifier.getLength() )
+ static std::vector< OUString > aRetval;
+
+ initTokenMapper();
+
+ if(!aTypeNameToSvxShapeKindMapper.empty() && !aRetval.size())
{
- OUString aStr( pMap->aIdentifier );
- size_t nHash = aStr.hashCode() & (HASHARRAYSIZE-1);
+ for(TypeNameToSvxShapeKindMapper::iterator a(aTypeNameToSvxShapeKindMapper.begin()); a != aTypeNameToSvxShapeKindMapper.end(); a++)
+ {
+ OUString aNew(a->first);
- m_aHashList[nHash].Insert(pMap);
- pMap++;
+ if(aNew.getLength())
+ {
+ const OUString aNewName(aComSunStarDrawing + aNew);
+
+ aRetval.push_back(aNewName);
+ }
+ }
}
+
+ return aRetval;
}
-// ---------------------------------------------------------------------
+bool getNameForSvxShapeType(rtl::OUString& rName, SvxShapeKind eSvxShapeKind)
+{
+ initTokenMapper();
+
+ if(!aTypeNameToSvxShapeKindMapper.empty())
+ {
+ for(TypeNameToSvxShapeKindMapper::iterator a(aTypeNameToSvxShapeKindMapper.begin()); a != aTypeNameToSvxShapeKindMapper.end(); a++)
+ {
+ if(a->second == eSvxShapeKind)
+ {
+ rName = aComSunStarDrawing + a->first;
+ return true;
+ }
+ }
+ }
-sal_uInt32 UHashMap::getId( const OUString& rCompareString )
+ return false;
+}
+
+SvxShapeKind getSvxShapeKindFromTypeName(const OUString& rTypeName)
{
- size_t nHash = rCompareString.hashCode() & (HASHARRAYSIZE-1);
+ if(rTypeName.getLength() <= aComSunStarDrawing.getLength())
+ {
+ return SvxShapeKind_None;
+ }
- UHashMapEntryList& rList = m_aHashList[nHash];
+ const OUString aCompare(rTypeName.copy(aComSunStarDrawing.getLength()));
- UHashMapEntry * pMap = rList.First();
+ if(!aCompare.getLength())
+ {
+ return SvxShapeKind_None;
+ }
+
+ initTokenMapper();
- while(pMap)
+ if(!aTypeNameToSvxShapeKindMapper.empty())
{
- if( rCompareString == pMap->aIdentifier )
- return pMap->nId;
+ const TypeNameToSvxShapeKindMapper::iterator aResult(aTypeNameToSvxShapeKindMapper.find(aCompare));
- pMap = rList.Next();
+ if(aResult != aTypeNameToSvxShapeKindMapper.end())
+ {
+ return aResult->second;
+ }
}
- return UHASHMAP_NOTFOUND;
+ return SvxShapeKind_None;
}
/***********************************************************************
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 36144e6cc0d5..cc91cdcd7bc3 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -41,13 +41,11 @@
#include <vos/mutex.hxx>
#include <svtools/fltcall.hxx>
#include <svtools/filter.hxx>
-
#include <boost/scoped_ptr.hpp>
#include <svx/svdpool.hxx>
#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <tools/urlobj.hxx>
-
#include <editeng/unoprnms.hxx>
#include <svx/unoshape.hxx>
#include <svx/unopage.hxx>
@@ -59,14 +57,30 @@
#include "svx/unoshprp.hxx"
#include <svx/svdoashp.hxx>
#include "unopolyhelper.hxx"
-
-// #i29181#
-#include "svx/svdviter.hxx"
#include <svx/svdview.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/svdopath.hxx>
+#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+#include <com/sun/star/drawing/FlagSequence.hpp>
+#include <com/sun/star/awt/XBitmap.hpp>
+#include <vcl/cvtgrf.hxx>
+#include <svx/svdograf.hxx>
+#ifndef SVX_LIGHT
+#ifndef _SFXDOCFILE_HXX
+#include <sfx2/docfile.hxx>
+#endif
+#include <sfx2/app.hxx>
+#include <sfx2/fcontnr.hxx>
+#endif
+#include "toolkit/unohlp.hxx"
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdtrans.hxx>
+#include <svx/globaldrawitempool.hxx>
using ::rtl::OUString;
using namespace ::osl;
@@ -94,7 +108,7 @@ sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetSt
***********************************************************************/
SvxShapeGroup::SvxShapeGroup( SdrObject* pObj, SvxDrawPage* pDrawPage ) throw() :
- SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_GROUP), aSvxMapProvider.GetPropertySet(SVXMAP_GROUP, SdrObject::GetGlobalDrawObjectItemPool()) ),
+ SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_GROUP), aSvxMapProvider.GetPropertySet(SVXMAP_GROUP, GetGlobalDrawObjectItemPool()) ),
mxPage( pDrawPage )
{
}
@@ -227,11 +241,10 @@ void SAL_CALL SvxShapeGroup::add( const uno::Reference< drawing::XShape >& xShap
if( pSdrShape == NULL )
pSdrShape = mxPage->_CreateSdrObject( xShape );
- if( pSdrShape->IsInserted() )
- pSdrShape->GetObjList()->RemoveObject( pSdrShape->GetOrdNum() );
+ if( pSdrShape->IsObjectInserted() )
+ pSdrShape->getParentOfSdrObject()->RemoveObjectFromSdrObjList( pSdrShape->GetNavigationPosition() );
- mpObj->GetSubList()->InsertObject( pSdrShape );
- pSdrShape->SetModel(mpObj->GetModel());
+ mpObj->getChildrenOfSdrObject()->InsertObjectToSdrObjList(*pSdrShape);
// #85922# It makes no sense to set the layer asked
// from the group object since these is an iteration
@@ -268,10 +281,10 @@ void SAL_CALL SvxShapeGroup::remove( const uno::Reference< drawing::XShape >& xS
if( pShape )
pSdrShape = pShape->GetSdrObject();
- if( !mpObj.is() || pSdrShape == NULL || pSdrShape->GetObjList()->GetOwnerObj() != mpObj.get() )
+ if( !mpObj.is() || pSdrShape == NULL || pSdrShape->getParentOfSdrObject()->getSdrObjectFromSdrObjList() != mpObj.get() )
throw uno::RuntimeException();
- SdrObjList& rList = *pSdrShape->GetObjList();
+ SdrObjList& rList = *pSdrShape->getParentOfSdrObject();
const sal_uInt32 nObjCount = rList.GetObjCount();
sal_uInt32 nObjNum = 0;
@@ -287,18 +300,16 @@ void SAL_CALL SvxShapeGroup::remove( const uno::Reference< drawing::XShape >& xS
// #i29181#
// If the SdrObject which is about to be deleted is in any selection,
// deselect it first.
- SdrViewIter aIter( pSdrShape );
+ const ::std::set< SdrView* > aAllSdrViews(pSdrShape->getSdrModelFromSdrObject().getSdrViews());
- for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
- {
- if(CONTAINER_ENTRY_NOTFOUND != pView->TryToFindMarkedObject(pSdrShape))
+ for(::std::set< SdrView* >::const_iterator aLoopViews(aAllSdrViews.begin());
+ aLoopViews != aAllSdrViews.end(); aLoopViews++)
{
- pView->MarkObj(pSdrShape, pView->GetSdrPageView(), sal_True, sal_False);
- }
+ (*aLoopViews)->MarkObj(*pSdrShape, true);
}
- SdrObject* pObject = rList.NbcRemoveObject( nObjNum );
- SdrObject::Free( pObject );
+ SdrObject* pObject = rList.RemoveObjectFromSdrObjList( nObjNum );
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
else
{
@@ -318,8 +329,8 @@ sal_Int32 SAL_CALL SvxShapeGroup::getCount() throw( uno::RuntimeException )
sal_Int32 nRetval = 0;
- if(mpObj.is() && mpObj->GetSubList())
- nRetval = mpObj->GetSubList()->GetObjCount();
+ if(mpObj.is() && mpObj->getChildrenOfSdrObject())
+ nRetval = mpObj->getChildrenOfSdrObject()->GetObjCount();
else
throw uno::RuntimeException();
@@ -332,13 +343,13 @@ uno::Any SAL_CALL SvxShapeGroup::getByIndex( sal_Int32 Index )
{
OGuard aGuard( Application::GetSolarMutex() );
- if( !mpObj.is() || mpObj->GetSubList() == NULL )
+ if( !mpObj.is() || mpObj->getChildrenOfSdrObject() == NULL )
throw uno::RuntimeException();
- if( mpObj->GetSubList()->GetObjCount() <= (sal_uInt32)Index )
+ if( mpObj->getChildrenOfSdrObject()->GetObjCount() <= (sal_uInt32)Index )
throw lang::IndexOutOfBoundsException();
- SdrObject* pDestObj = mpObj->GetSubList()->GetObj( Index );
+ SdrObject* pDestObj = mpObj->getChildrenOfSdrObject()->GetObj( Index );
if(pDestObj == NULL)
throw lang::IndexOutOfBoundsException();
@@ -360,7 +371,7 @@ sal_Bool SAL_CALL SvxShapeGroup::hasElements() throw( uno::RuntimeException )
{
OGuard aGuard( Application::GetSolarMutex() );
- return mpObj.is() && mpObj->GetSubList() && (mpObj->GetSubList()->GetObjCount() > 0);
+ return mpObj.is() && mpObj->getChildrenOfSdrObject() && (mpObj->getChildrenOfSdrObject()->GetObjCount() > 0);
}
//----------------------------------------------------------------------
@@ -377,7 +388,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapeGroup::getSupportedServiceNames()
***********************************************************************/
SvxShapeConnector::SvxShapeConnector( SdrObject* pObj ) throw() :
- SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CONNECTOR), aSvxMapProvider.GetPropertySet(SVXMAP_CONNECTOR, SdrObject::GetGlobalDrawObjectItemPool()) )
+ SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CONNECTOR), aSvxMapProvider.GetPropertySet(SVXMAP_CONNECTOR, GetGlobalDrawObjectItemPool()) )
{
}
@@ -481,8 +492,12 @@ void SAL_CALL SvxShapeConnector::connectStart( const uno::Reference< drawing::XC
Reference< drawing::XShape > xRef( xShape, UNO_QUERY );
SvxShape* pShape = SvxShape::getImplementation( xRef );
- if( pShape )
- mpObj->ConnectToNode( sal_True, pShape->mpObj.get() );
+ if( mpObj.is() && pShape )
+ {
+ SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get());
+ OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)");
+ pEdge->ConnectToNode( sal_True, pShape->mpObj.get() );
+ }
if( mpModel )
mpModel->SetChanged();
@@ -498,7 +513,11 @@ void SAL_CALL SvxShapeConnector::connectEnd( const uno::Reference< drawing::XCon
SvxShape* pShape = SvxShape::getImplementation( xRef );
if( mpObj.is() && pShape )
- mpObj->ConnectToNode( sal_False, pShape->mpObj.get() );
+ {
+ SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get());
+ OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)");
+ pEdge->ConnectToNode( sal_False, pShape->mpObj.get() );
+ }
if( mpModel )
mpModel->SetChanged();
@@ -511,7 +530,11 @@ void SAL_CALL SvxShapeConnector::disconnectBegin( const uno::Reference< drawing:
OGuard aGuard( Application::GetSolarMutex() );
if(mpObj.is())
- mpObj->DisconnectFromNode( sal_True );
+ {
+ SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get());
+ OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)");
+ pEdge->DisconnectFromNode( sal_True );
+ }
if( mpModel )
mpModel->SetChanged();
@@ -524,7 +547,11 @@ void SAL_CALL SvxShapeConnector::disconnectEnd( const uno::Reference< drawing::X
OGuard aGuard( Application::GetSolarMutex() );
if(mpObj.is())
- mpObj->DisconnectFromNode( sal_False );
+ {
+ SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get());
+ OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)");
+ pEdge->DisconnectFromNode( sal_False );
+ }
if( mpModel )
mpModel->SetChanged();
@@ -541,19 +568,15 @@ uno::Sequence< OUString > SAL_CALL SvxShapeConnector::getSupportedServiceNames()
/***********************************************************************
* class SvxShapeControl *
***********************************************************************/
-DBG_NAME(SvxShapeControl)
-
SvxShapeControl::SvxShapeControl( SdrObject* pObj ) throw() :
- SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CONTROL), aSvxMapProvider.GetPropertySet(SVXMAP_CONTROL, SdrObject::GetGlobalDrawObjectItemPool()) )
+ SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CONTROL), aSvxMapProvider.GetPropertySet(SVXMAP_CONTROL, GetGlobalDrawObjectItemPool()) )
{
- DBG_CTOR(SvxShapeControl,NULL);
- setShapeKind( OBJ_UNO );
+ setSvxShapeKind(SvxShapeKind_Control);
}
//----------------------------------------------------------------------
SvxShapeControl::~SvxShapeControl() throw()
{
- DBG_DTOR(SvxShapeControl,NULL);
}
//----------------------------------------------------------------------
@@ -1010,7 +1033,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const ::rtl::OUString& aP
//----------------------------------------------------------------------
SvxShapeDimensioning::SvxShapeDimensioning( SdrObject* pObj ) throw()
-: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_DIMENSIONING), aSvxMapProvider.GetPropertySet(SVXMAP_DIMENSIONING, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_DIMENSIONING), aSvxMapProvider.GetPropertySet(SVXMAP_DIMENSIONING, GetGlobalDrawObjectItemPool()) )
{
}
@@ -1031,7 +1054,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapeDimensioning::getSupportedServiceName
//----------------------------------------------------------------------
SvxShapeCircle::SvxShapeCircle( SdrObject* pObj ) throw()
-: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CIRCLE), aSvxMapProvider.GetPropertySet(SVXMAP_CIRCLE, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CIRCLE), aSvxMapProvider.GetPropertySet(SVXMAP_CIRCLE, GetGlobalDrawObjectItemPool()) )
{
}
@@ -1051,13 +1074,26 @@ uno::Sequence< OUString > SAL_CALL SvxShapeCircle::getSupportedServiceNames() th
* *
***********************************************************************/
-#include <svx/svdopath.hxx>
+//----------------------------------------------------------------------
+bool SvxShapePolyPolygon::isBezierBased() const
+{
+ if(mpObj.is())
+ {
+ const SdrPathObjType aSdrPathObjType(((SdrPathObj*)mpObj.get())->getSdrPathObjType());
+
+ if(PathType_OpenBezier == aSdrPathObjType || PathType_ClosedBezier == aSdrPathObjType)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
//----------------------------------------------------------------------
-SvxShapePolyPolygon::SvxShapePolyPolygon( SdrObject* pObj , drawing::PolygonKind eNew )
+SvxShapePolyPolygon::SvxShapePolyPolygon( SdrObject* pObj )
throw( com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException)
-: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGON), aSvxMapProvider.GetPropertySet(SVXMAP_POLYPOLYGON, SdrObject::GetGlobalDrawObjectItemPool()) )
-, mePolygonKind( eNew )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGON), aSvxMapProvider.GetPropertySet(SVXMAP_POLYPOLYGON, GetGlobalDrawObjectItemPool()) )
{
}
@@ -1066,539 +1102,453 @@ SvxShapePolyPolygon::~SvxShapePolyPolygon() throw()
{
}
-basegfx::B2DPolyPolygon SAL_CALL ImplSvxPointSequenceSequenceToB2DPolyPolygon( const drawing::PointSequenceSequence* pOuterSequence) throw()
-{
- basegfx::B2DPolyPolygon aRetval;
-
- // Zeiger auf innere sequences holen
- const drawing::PointSequence* pInnerSequence = pOuterSequence->getConstArray();
- const drawing::PointSequence* pInnerSeqEnd = pInnerSequence + pOuterSequence->getLength();
+//----------------------------------------------------------------------
+// depends on polygon type, need to solve this dynamically
- for(;pInnerSequence != pInnerSeqEnd; ++pInnerSequence)
+const SfxItemPropertyMapEntry* SvxShapePolyPolygon::getPropertyMapEntries() const
+{
+ // the PropertyMap of this object depends on it's content and thus can change during it's
+ // lifetime. It depends on if it's using beziers or not. Thus, return the corresponding type
+ // dynamically
+ if(isBezierBased())
{
- // Neues Polygon vorbereiten
- basegfx::B2DPolygon aNewPolygon;
-
- // Zeiger auf Arrays holen
- const awt::Point* pArray = pInnerSequence->getConstArray();
- const awt::Point* pArrayEnd = pArray + pInnerSequence->getLength();
-
- for(;pArray != pArrayEnd;++pArray)
- {
- aNewPolygon.append(basegfx::B2DPoint(pArray->X, pArray->Y));
- }
-
- // check for closed state flag
- basegfx::tools::checkClosed(aNewPolygon);
-
- // Neues Teilpolygon einfuegen
- aRetval.append(aNewPolygon);
+ // return bezier-based PropertyMap
+ return aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGONBEZIER);
+ }
+ else
+ {
+ // call parent, use SVXMAP_POLYPOLYGON as used in the constructor
+ return SvxShapeText::getPropertyMapEntries();
}
-
- return aRetval;
}
//----------------------------------------------------------------------
bool SvxShapePolyPolygon::setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
{
+ // the type of xShape depends on the content of this object, thus allow all
+ // possible geometry set methods; e.g. someone may construct a bezier-based
+ // xShape, but as long as no data is set, the type would be non-bezier and the
+ // interface suppotred would be PolyPolygonDescriptor. To not conflict and to
+ // allow setting bezier-based data at that newly created object, allow all
+ // data types from PolyPolygonDescriptor and PolyPolygonBezierDescriptor.
+ // Especially 'Geometry' is double in these definitions, thus decide based
+ // on the data type, but allow both possible ones
switch( pProperty->nWID )
{
- case OWN_ATTR_VALUE_POLYPOLYGON:
- {
- if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0) ) )
+ case OWN_ATTR_VALUE_POLYPOLYGONBEZIER:
{
- basegfx::B2DPolyPolygon aNewPolyPolygon(ImplSvxPointSequenceSequenceToB2DPolyPolygon( (drawing::PointSequenceSequence*)rValue.getValue()));
- SetPolygon(aNewPolyPolygon);
- return true;
- }
- break;
- }
- case OWN_ATTR_BASE_GEOMETRY:
- {
- if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0)))
- {
- if( mpObj.is() )
+ if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0) ) )
{
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
+ if( mpObj.is() )
+ {
+ // get polygpon data
+ basegfx::B2DPolyPolygon aNewPolyPolygon(
+ basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+ *(const drawing::PolyPolygonBezierCoords*)rValue.getValue()));
+
+ if(aNewPolyPolygon.count())
+ {
+ // migrate to pool metric
+ ForceMetricToItemPoolMetric(aNewPolyPolygon);
+
+ // position relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
+ }
+ }
- mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
- aNewPolyPolygon = ImplSvxPointSequenceSequenceToB2DPolyPolygon((drawing::PointSequenceSequence*)rValue.getValue());
- mpObj->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
+ // set at object
+ SetPolygon(aNewPolyPolygon);
+ }
+ return true;
}
- return true;
+ break;
}
- break;
- }
- case OWN_ATTR_VALUE_POLYGON:
- {
- if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0) ))
+ case OWN_ATTR_VALUE_POLYPOLYGON:
{
- drawing::PointSequence* pSequence = (drawing::PointSequence*)rValue.getValue();
-
- // Neues Polygon vorbereiten
- basegfx::B2DPolygon aNewPolygon;
+ if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0) ) )
+ {
+ if( mpObj.is() )
+ {
+ // get polygpon data
+ basegfx::B2DPolyPolygon aNewPolyPolygon(
+ basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(
+ *(const drawing::PointSequenceSequence*)rValue.getValue()));
- // Zeiger auf Arrays holen
- // Zeiger auf Arrays holen
- const awt::Point* pArray = pSequence->getConstArray();
- const awt::Point* pArrayEnd = pArray + pSequence->getLength();
+ if(aNewPolyPolygon.count())
+ {
+ // migrate to pool metric
+ ForceMetricToItemPoolMetric(aNewPolyPolygon);
+
+ // position relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
+ }
+ }
- for(;pArray != pArrayEnd;++pArray)
+ // set at object
+ SetPolygon(aNewPolyPolygon);
+ }
+ return true;
+ }
+ break;
+ }
+ case OWN_ATTR_BASE_GEOMETRY:
+ {
+ if( rValue.getValue() )
{
- aNewPolygon.append(basegfx::B2DPoint(pArray->X, pArray->Y));
+ if( rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0))
+ {
+ if( mpObj.is() )
+ {
+ // get polygpon data
+ basegfx::B2DPolyPolygon aNewPolyPolygon(
+ basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(
+ *(const drawing::PointSequenceSequence*)rValue.getValue()));
+
+ if(aNewPolyPolygon.count())
+ {
+ // migrate to pool metric
+ ForceMetricToItemPoolMetric(aNewPolyPolygon);
+
+ // BaseGeometry means the polygon is just scaled, but has no position, mirroring, shear
+ // or rotation. Apply these current values from the object
+ const basegfx::B2DHomMatrix aNoScaleTrans(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ basegfx::B2DVector(mpObj->isMirroredX() ? -1.0 : 1.0, mpObj->isMirroredY() ? -1.0 : 1.0),
+ mpObj->getSdrObjectShearX(),
+ mpObj->getSdrObjectRotate(),
+ mpObj->getSdrObjectTranslate()));
+
+ aNewPolyPolygon.transform(aNoScaleTrans);
+
+ // position relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
+ }
+ }
+
+ // set at object
+ SetPolygon(aNewPolyPolygon);
+ }
+ return true;
+ }
+ else if( rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0))
+ {
+ if( mpObj.is() )
+ {
+ // get polygpon data
+ basegfx::B2DPolyPolygon aNewPolyPolygon(
+ basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+ *(const drawing::PolyPolygonBezierCoords*)rValue.getValue()));
+
+ if(aNewPolyPolygon.count())
+ {
+ // migrate to pool metric
+ ForceMetricToItemPoolMetric(aNewPolyPolygon);
+
+ // BaseGeometry means the polygon is just scaled, but has no position, shear
+ // or rotation. Apply these current values from the object
+ const basegfx::B2DHomMatrix aNoScaleTrans(
+ basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ mpObj->getSdrObjectShearX(),
+ mpObj->getSdrObjectRotate(),
+ mpObj->getSdrObjectTranslate()));
+
+ aNewPolyPolygon.transform(aNoScaleTrans);
+
+ // position relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
+ }
+ }
+
+ // set at object
+ SetPolygon(aNewPolyPolygon);
+ }
+ return true;
+ }
}
-
- // check for closed state flag
- basegfx::tools::checkClosed(aNewPolygon);
-
- // Polygon setzen
- SetPolygon(basegfx::B2DPolyPolygon(aNewPolygon));
- return true;
+ break;
}
- break;
- }
- default:
- return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
- }
-
- throw lang::IllegalArgumentException();
-}
-
-void SAL_CALL B2DPolyPolygonToSvxPointSequenceSequence( const basegfx::B2DPolyPolygon& rPolyPoly, drawing::PointSequenceSequence& rRetval )
-{
- if( (sal_uInt32)rRetval.getLength() != rPolyPoly.count() )
- rRetval.realloc( rPolyPoly.count() );
-
- // Zeiger auf aeussere Arrays holen
- drawing::PointSequence* pOuterSequence = rRetval.getArray();
-
- for(sal_uInt32 a(0L); a < rPolyPoly.count(); a++)
- {
- // Einzelpolygon holen
- const basegfx::B2DPolygon aPoly(rPolyPoly.getB2DPolygon(a));
-
- // #i75974# take closed stae into account, the API polygon still uses the old closed definition
- // with last/first point are identical (cannot hold information about open polygons with identical
- // first and last point, though)
- const sal_uInt32 nPointCount(aPoly.count());
- const bool bIsClosed(aPoly.isClosed());
-
- // Platz in Arrays schaffen
- pOuterSequence->realloc(bIsClosed ? nPointCount + 1 : nPointCount);
+ case OWN_ATTR_VALUE_POLYGON:
+ {
+ if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequence*)0) ))
+ {
+ if( mpObj.is() )
+ {
+ // get polygpon data
+ basegfx::B2DPolyPolygon aNewPolyPolygon(
+ basegfx::tools::UnoPointSequenceToB2DPolygon(
+ *(const drawing::PointSequence*)rValue.getValue()));
- // Pointer auf arrays holen
- awt::Point* pInnerSequence = pOuterSequence->getArray();
+ if(aNewPolyPolygon.count())
+ {
+ // migrate to pool metric
+ ForceMetricToItemPoolMetric(aNewPolyPolygon);
+
+ // position relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
+ }
+ }
- for(sal_uInt32 b(0L); b < nPointCount; b++)
- {
- const basegfx::B2DPoint aPoint(aPoly.getB2DPoint(b));
- *pInnerSequence = awt::Point( basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()) );
- pInnerSequence++;
+ // set at object
+ SetPolygon(aNewPolyPolygon);
+ }
+ return true;
+ }
+ break;
}
-
- // #i75974# copy first point
- if(bIsClosed)
+ default:
{
- *pInnerSequence = *pOuterSequence->getArray();
+ return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
}
-
- pOuterSequence++;
}
+
+ throw lang::IllegalArgumentException();
}
//----------------------------------------------------------------------
bool SvxShapePolyPolygon::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
{
+ // the data reader should be based on getting the data type first, thus be more strict
+ // with what is allowed or not based on being a bezier type or not
switch( pProperty->nWID )
{
- case OWN_ATTR_VALUE_POLYPOLYGON:
- {
- // PolyPolygon in eine struct PolyPolygon packen
- const basegfx::B2DPolyPolygon& rPolyPoly = GetPolygon();
- drawing::PointSequenceSequence aRetval( rPolyPoly.count() );
-
- B2DPolyPolygonToSvxPointSequenceSequence( rPolyPoly, aRetval );
-
- rValue <<= aRetval;
- break;
- }
- case OWN_ATTR_BASE_GEOMETRY:
- {
- // pack a PolyPolygon in struct PolyPolygon
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
-
- if(mpObj.is())
- mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
-
- drawing::PointSequenceSequence aRetval(aNewPolyPolygon.count());
- B2DPolyPolygonToSvxPointSequenceSequence(aNewPolyPolygon, aRetval);
- rValue <<= aRetval;
- break;
- }
- case OWN_ATTR_VALUE_POLYGON:
- {
- // PolyPolygon in eine struct PolyPolygon packen
- const basegfx::B2DPolyPolygon& rPolyPoly = GetPolygon();
-
- sal_Int32 nCount = 0;
- if( rPolyPoly.count() > 0 )
- nCount = rPolyPoly.getB2DPolygon(0L).count();
+ case OWN_ATTR_VALUE_POLYPOLYGONBEZIER:
+ {
+ if(isBezierBased())
+ {
+ drawing::PolyPolygonBezierCoords aRetval;
+ basegfx::B2DPolyPolygon aPolyPolygon(GetPolygon());
- drawing::PointSequence aRetval( nCount );
+ if(aPolyPolygon.count())
+ {
+ // make pos relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpObj->GetAnchorPos()));
+ }
- if( nCount > 0 )
- {
- // Einzelpolygon holen
- const basegfx::B2DPolygon aPoly(rPolyPoly.getB2DPolygon(0L));
+ // migrtate to 1/100th mm
+ ForceMetricTo100th_mm(aPolyPolygon);
- // Pointer auf arrays holen
- awt::Point* pSequence = aRetval.getArray();
+ // convert Polygon to needed data representation
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(aPolyPolygon, aRetval);
+ }
- for(sal_Int32 b=0;b<nCount;b++)
+ rValue <<= aRetval;
+ }
+ else
{
- const basegfx::B2DPoint aPoint(aPoly.getB2DPoint(b));
- *pSequence++ = awt::Point( basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()) );
+ // not allowed to get a PolyPolygon with bezier when bezier is not used
+ throw lang::IllegalArgumentException();
}
+ break;
}
+ case OWN_ATTR_VALUE_POLYPOLYGON:
+ {
+ if(isBezierBased())
+ {
+ // not allowed to get a PolyPolygon when bezier is used
+ throw lang::IllegalArgumentException();
+ }
+ else
+ {
+ drawing::PointSequenceSequence aRetval;
+ basegfx::B2DPolyPolygon aPolyPolygon(GetPolygon());
- rValue <<= aRetval;
- break;
- }
- case OWN_ATTR_VALUE_POLYGONKIND:
- {
- rValue <<= GetPolygonKind();
- break;
- }
- default:
- return SvxShapeText::getPropertyValueImpl( rName, pProperty, rValue );
- }
-
- return true;
-}
-
-//----------------------------------------------------------------------
-drawing::PolygonKind SvxShapePolyPolygon::GetPolygonKind() const throw()
-{
- return mePolygonKind;
-}
-
-//----------------------------------------------------------------------
-void SvxShapePolyPolygon::SetPolygon(const basegfx::B2DPolyPolygon& rNew) throw()
-{
- OGuard aGuard( Application::GetSolarMutex() );
-
- if(mpObj.is())
- ((SdrPathObj*)mpObj.get())->SetPathPoly(rNew);
-}
-
-//----------------------------------------------------------------------
-basegfx::B2DPolyPolygon SvxShapePolyPolygon::GetPolygon() const throw()
-{
- OGuard aGuard( Application::GetSolarMutex() );
-
- if(mpObj.is())
- {
- return ((SdrPathObj*)mpObj.get())->GetPathPoly();
- }
- else
- {
- return basegfx::B2DPolyPolygon();
- }
-}
-
-// ::com::sun::star::lang::XServiceInfo
-uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygon::getSupportedServiceNames() throw( uno::RuntimeException )
-{
- return SvxShapeText::getSupportedServiceNames();
-}
-
-/***********************************************************************
-* class SvxShapePolyPolygonBezier *
-***********************************************************************/
-#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include <com/sun/star/drawing/FlagSequence.hpp>
-//----------------------------------------------------------------------
-SvxShapePolyPolygonBezier::SvxShapePolyPolygonBezier( SdrObject* pObj , drawing::PolygonKind eNew ) throw()
-: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGONBEZIER), aSvxMapProvider.GetPropertySet(SVXMAP_POLYPOLYGONBEZIER, SdrObject::GetGlobalDrawObjectItemPool()) )
-, mePolygonKind( eNew )
-{
-}
-
-//----------------------------------------------------------------------
-SvxShapePolyPolygonBezier::~SvxShapePolyPolygonBezier() throw()
-{
-}
-
-basegfx::B2DPolyPolygon SvxConvertPolyPolygonBezierToB2DPolyPolygon(const drawing::PolyPolygonBezierCoords* pSourcePolyPolygon)
- throw( IllegalArgumentException )
-{
- const sal_Int32 nOuterSequenceCount(pSourcePolyPolygon->Coordinates.getLength());
- basegfx::B2DPolyPolygon aNewPolyPolygon;
-
- if(pSourcePolyPolygon->Flags.getLength() != nOuterSequenceCount)
- {
- throw IllegalArgumentException();
- }
+ if(aPolyPolygon.count())
+ {
+ // make pos relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpObj->GetAnchorPos()));
+ }
- // get pointers to inner sequence
- const drawing::PointSequence* pInnerSequence = pSourcePolyPolygon->Coordinates.getConstArray();
- const drawing::FlagSequence* pInnerSequenceFlags = pSourcePolyPolygon->Flags.getConstArray();
+ // migrtate to 1/100th mm
+ ForceMetricTo100th_mm(aPolyPolygon);
- for(sal_Int32 a(0); a < nOuterSequenceCount; a++)
- {
- const sal_Int32 nInnerSequenceCount(pInnerSequence->getLength());
+ // convert Polygon to needed data representation
+ basegfx::tools::B2DPolyPolygonToUnoPointSequenceSequence(aPolyPolygon, aRetval);
+ }
- if(pInnerSequenceFlags->getLength() != nInnerSequenceCount)
- {
- throw IllegalArgumentException();
+ rValue <<= aRetval;
+ }
+ break;
}
+ case OWN_ATTR_BASE_GEOMETRY:
+ {
+ basegfx::B2DPolyPolygon aPolyPolygon(GetPolygon());
- // prepare new polygon
- basegfx::B2DPolygon aNewPolygon;
- const awt::Point* pArray = pInnerSequence->getConstArray();
- const drawing::PolygonFlags* pArrayFlags = pInnerSequenceFlags->getConstArray();
+ if(aPolyPolygon.count())
+ {
+ // make pos relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpObj->GetAnchorPos()));
+ }
- // get first point and flag
- basegfx::B2DPoint aNewCoordinatePair(pArray->X, pArray->Y); pArray++;
- XPolyFlags ePolyFlag((XPolyFlags)((sal_uInt16)*pArrayFlags)); pArrayFlags++;
- basegfx::B2DPoint aControlA;
- basegfx::B2DPoint aControlB;
+ // migrtate to 1/100th mm
+ ForceMetricTo100th_mm(aPolyPolygon);
- // first point is not allowed to be a control point
- if(XPOLY_CONTROL == ePolyFlag)
- {
- throw IllegalArgumentException();
- }
+ // BaseGeometry means to get only the scaled and unmirrored polygon, so transform
+ // the polygon to only contain object scale
+ // get object transform
+ basegfx::B2DHomMatrix aOnlyScaleTransform(mpObj->getSdrObjectTransformation());
- // add first point as start point
- aNewPolygon.append(aNewCoordinatePair);
+ // extract the scale
+ const basegfx::B2DVector aScale(basegfx::absolute(mpObj->getSdrObjectScale()));
- for(sal_Int32 b(1); b < nInnerSequenceCount;)
- {
- // prepare loop
- bool bControlA(false);
- bool bControlB(false);
+ // get transformation to unit coordinates
+ aOnlyScaleTransform.invert();
- // get next point and flag
- aNewCoordinatePair = basegfx::B2DPoint(pArray->X, pArray->Y);
- ePolyFlag = XPolyFlags((XPolyFlags)((sal_uInt16)*pArrayFlags));
- pArray++; pArrayFlags++; b++;
+ // add scale again
+ aOnlyScaleTransform.scale(aScale);
- if(b < nInnerSequenceCount && XPOLY_CONTROL == ePolyFlag)
- {
- aControlA = aNewCoordinatePair;
- bControlA = true;
+ // transform the polygon
+ aPolyPolygon.transform(aOnlyScaleTransform);
- // get next point and flag
- aNewCoordinatePair = basegfx::B2DPoint(pArray->X, pArray->Y);
- ePolyFlag = XPolyFlags((XPolyFlags)((sal_uInt16)*pArrayFlags));
- pArray++; pArrayFlags++; b++;
- }
+ if(aPolyPolygon.areControlPointsUsed())
+ {
+ // convert Polygon to needed data representation
+ drawing::PolyPolygonBezierCoords aRetval;
- if(b < nInnerSequenceCount && XPOLY_CONTROL == ePolyFlag)
- {
- aControlB = aNewCoordinatePair;
- bControlB = true;
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(aPolyPolygon, aRetval);
+ rValue <<= aRetval;
+ }
+ else
+ {
+ // convert Polygon to needed data representation
+ drawing::PointSequenceSequence aRetval;
- // get next point and flag
- aNewCoordinatePair = basegfx::B2DPoint(pArray->X, pArray->Y);
- ePolyFlag = XPolyFlags((XPolyFlags)((sal_uInt16)*pArrayFlags));
- pArray++; pArrayFlags++; b++;
+ basegfx::tools::B2DPolyPolygonToUnoPointSequenceSequence(aPolyPolygon, aRetval);
+ rValue <<= aRetval;
+ }
}
-
- // two or no control points are consumed, another one would be an error.
- // It's also an error if only one control point was read
- if(XPOLY_CONTROL == ePolyFlag || bControlA != bControlB)
+ else
{
- throw IllegalArgumentException();
- }
+ // empty PolyPolygon
+ drawing::PolyPolygonBezierCoords aRetval;
- // the previous writes used the B2DPolyPoygon -> PolyPolygon converter
- // which did not create minimal PolyPolygons, but created all control points
- // as null vectors (identical points). Because of the former P(CA)(CB)-norm of
- // B2DPolygon and it's unused sign of being the zero-vector and CA and CB being
- // relative to P, an empty edge was exported as P == CA == CB. Luckily, the new
- // export format can be read without errors by the old OOo-versions, so we need only
- // to correct here at read and do not need to export a wrong but compatible version
- // for the future.
- if(bControlA
- && aControlA.equal(aControlB)
- && aControlA.equal(aNewPolygon.getB2DPoint(aNewPolygon.count() - 1)))
- {
- bControlA = bControlB = false;
+ rValue <<= aRetval;
}
- if(bControlA)
+ break;
+ }
+ case OWN_ATTR_VALUE_POLYGON:
+ {
+ if(isBezierBased())
{
- // add bezier edge
- aNewPolygon.appendBezierSegment(aControlA, aControlB, aNewCoordinatePair);
+ // not allowed to get a PolyPolygon when bezier is used
+ throw lang::IllegalArgumentException();
}
else
{
- // add edge
- aNewPolygon.append(aNewCoordinatePair);
- }
- }
-
- // next sequence
- pInnerSequence++;
- pInnerSequenceFlags++;
-
- // #i72807# API import uses old line start/end-equal definition for closed,
- // so we need to correct this to closed state here
- basegfx::tools::checkClosed(aNewPolygon);
+ drawing::PointSequence aRetval;
+ basegfx::B2DPolyPolygon aPolyPolygon(GetPolygon());
- // add new subpolygon
- aNewPolyPolygon.append(aNewPolygon);
- }
+ if(aPolyPolygon.count())
+ {
+ // make pos relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpObj->GetAnchorPos()));
+ }
- return aNewPolyPolygon;
-}
+ // migrtate to 1/100th mm
+ ForceMetricTo100th_mm(aPolyPolygon);
-//----------------------------------------------------------------------
+ // convert Polygon to needed data representation
+ basegfx::tools::B2DPolygonToUnoPointSequence(aPolyPolygon.getB2DPolygon(0), aRetval);
+ }
-bool SvxShapePolyPolygonBezier::setPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
-{
- switch( pProperty->nWID )
- {
- case OWN_ATTR_VALUE_POLYPOLYGONBEZIER:
- {
- if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0) ) )
+ rValue <<= aRetval;
+ }
+ break;
+ }
+ case OWN_ATTR_VALUE_POLYGONKIND:
{
- basegfx::B2DPolyPolygon aNewPolyPolygon(SvxConvertPolyPolygonBezierToB2DPolyPolygon( (drawing::PolyPolygonBezierCoords*)rValue.getValue()));
- SetPolygon(aNewPolyPolygon);
- return true;
+ rValue <<= GetPolygonKind();
+ break;
}
- break;
- }
- case OWN_ATTR_BASE_GEOMETRY:
- {
- if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0)) )
+ default:
{
- if( mpObj.is() )
- {
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
-
- mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
- aNewPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon((drawing::PolyPolygonBezierCoords*)rValue.getValue());
- mpObj->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
- }
- return true;
+ return SvxShapeText::getPropertyValueImpl( rName, pProperty, rValue );
}
- break;
- }
- default:
- return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
}
- throw IllegalArgumentException();
+ return true;
}
-void SvxConvertB2DPolyPolygonToPolyPolygonBezier( const basegfx::B2DPolyPolygon& rPolyPoly, drawing::PolyPolygonBezierCoords& rRetval )
+//----------------------------------------------------------------------
+drawing::PolygonKind SvxShapePolyPolygon::GetPolygonKind() const throw()
{
- // use PolyPolygon converter as base. Since PolyPolygonBezierCoords uses
- // integer coordinates, this is no precision loss at all.
- const PolyPolygon aPolyPoly(rPolyPoly);
-
- // Polygone innerhalb vrobereiten
- rRetval.Coordinates.realloc((sal_Int32)aPolyPoly.Count());
- rRetval.Flags.realloc((sal_Int32)aPolyPoly.Count());
-
- // Zeiger auf aeussere Arrays holen
- drawing::PointSequence* pOuterSequence = rRetval.Coordinates.getArray();
- drawing::FlagSequence* pOuterFlags = rRetval.Flags.getArray();
+ OGuard aGuard( Application::GetSolarMutex() );
+ drawing::PolygonKind aRetval(drawing::PolygonKind_LINE);
- for(sal_uInt16 a=0;a<aPolyPoly.Count();a++)
+ if(mpObj.is())
{
- // Einzelpolygon holen
- const Polygon& rPoly = aPolyPoly[a];
+ const SdrPathObjType aSdrPathObjType(((SdrPathObj*)mpObj.get())->getSdrPathObjType());
- // Platz in Arrays schaffen
- pOuterSequence->realloc((sal_Int32)rPoly.GetSize());
- pOuterFlags->realloc((sal_Int32)rPoly.GetSize());
-
- // Pointer auf arrays holen
- awt::Point* pInnerSequence = pOuterSequence->getArray();
- drawing::PolygonFlags* pInnerFlags = pOuterFlags->getArray();
-
- for(sal_uInt16 b=0;b<rPoly.GetSize();b++)
+ switch(aSdrPathObjType)
{
- *pInnerSequence++ = awt::Point( rPoly[b].X(), rPoly[b].Y() );
- *pInnerFlags++ = (drawing::PolygonFlags)((sal_uInt16)rPoly.GetFlags(b));
+ case PathType_Line:
+ {
+ aRetval = drawing::PolygonKind_LINE;
+ break;
+ }
+ case PathType_OpenPolygon:
+ {
+ aRetval = drawing::PolygonKind_PLIN;
+ break;
+ }
+ case PathType_ClosedPolygon:
+ {
+ aRetval = drawing::PolygonKind_POLY;
+ break;
+ }
+ case PathType_OpenBezier:
+ {
+ aRetval = drawing::PolygonKind_PATHLINE;
+ break;
+ }
+ case PathType_ClosedBezier:
+ {
+ aRetval = drawing::PolygonKind_PATHFILL;
+ break;
+ }
}
-
- pOuterSequence++;
- pOuterFlags++;
- }
-}
-
-//----------------------------------------------------------------------
-
-bool SvxShapePolyPolygonBezier::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
-{
- switch( pProperty->nWID )
- {
- case OWN_ATTR_VALUE_POLYPOLYGONBEZIER:
- {
- // PolyPolygon in eine struct PolyPolygon packen
- const basegfx::B2DPolyPolygon& rPolyPoly = GetPolygon();
- drawing::PolyPolygonBezierCoords aRetval;
- SvxConvertB2DPolyPolygonToPolyPolygonBezier(rPolyPoly, aRetval );
-
- rValue <<= aRetval;
- break;
}
- case OWN_ATTR_BASE_GEOMETRY:
- {
- // PolyPolygon in eine struct PolyPolygon packen
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
- mpObj.get()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
- drawing::PolyPolygonBezierCoords aRetval;
- SvxConvertB2DPolyPolygonToPolyPolygonBezier(aNewPolyPolygon, aRetval);
-
- rValue <<= aRetval;
- break;
- }
- case OWN_ATTR_VALUE_POLYGONKIND:
- {
- rValue <<= mePolygonKind;
- break;
- }
- default:
- return SvxShapeText::getPropertyValueImpl( rName, pProperty, rValue );
- }
- return true;
-}
-//----------------------------------------------------------------------
-drawing::PolygonKind SvxShapePolyPolygonBezier::GetPolygonKind() const throw()
-{
- return mePolygonKind;
+ return aRetval;
}
//----------------------------------------------------------------------
-void SvxShapePolyPolygonBezier::SetPolygon(const basegfx::B2DPolyPolygon& rNew) throw()
+void SvxShapePolyPolygon::SetPolygon(const basegfx::B2DPolyPolygon& rNew) throw()
{
OGuard aGuard( Application::GetSolarMutex() );
if(mpObj.is())
- static_cast<SdrPathObj*>(mpObj.get())->SetPathPoly(rNew);
+ ((SdrPathObj*)mpObj.get())->setB2DPolyPolygonInObjectCoordinates(rNew);
}
//----------------------------------------------------------------------
-basegfx::B2DPolyPolygon SvxShapePolyPolygonBezier::GetPolygon() const throw()
+basegfx::B2DPolyPolygon SvxShapePolyPolygon::GetPolygon() const throw()
{
OGuard aGuard( Application::GetSolarMutex() );
if(mpObj.is())
{
- return static_cast<SdrPathObj*>(mpObj.get())->GetPathPoly();
+ return ((SdrPathObj*)mpObj.get())->getB2DPolyPolygonInObjectCoordinates();
}
else
{
@@ -1606,9 +1556,8 @@ basegfx::B2DPolyPolygon SvxShapePolyPolygonBezier::GetPolygon() const throw()
}
}
-
// ::com::sun::star::lang::XServiceInfo
-uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygonBezier::getSupportedServiceNames() throw( uno::RuntimeException )
+uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygon::getSupportedServiceNames() throw( uno::RuntimeException )
{
return SvxShapeText::getSupportedServiceNames();
}
@@ -1616,22 +1565,10 @@ uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygonBezier::getSupportedServic
/***********************************************************************
* class SvxGraphicObject *
***********************************************************************/
-#include <com/sun/star/awt/XBitmap.hpp>
-#include <vcl/cvtgrf.hxx>
-#include <svx/svdograf.hxx>
-#ifndef SVX_LIGHT
-#ifndef _SFXDOCFILE_HXX
-#include <sfx2/docfile.hxx>
-#endif
-#include <sfx2/app.hxx>
-#include <sfx2/fcontnr.hxx>
-#endif
-
-#include "toolkit/unohlp.hxx"
//----------------------------------------------------------------------
SvxGraphicObject::SvxGraphicObject( SdrObject* pObj ) throw()
-: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_GRAPHICOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_GRAPHICOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_GRAPHICOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_GRAPHICOBJECT, GetGlobalDrawObjectItemPool()) )
{
}
@@ -1647,143 +1584,145 @@ bool SvxGraphicObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
bool bOk = false;
switch( pProperty->nWID )
{
- case OWN_ATTR_VALUE_FILLBITMAP:
- {
- if( rValue.getValue() )
+ case OWN_ATTR_VALUE_FILLBITMAP:
{
- if( rValue.getValueType() == ::getCppuType(( const uno::Sequence< sal_Int8 >*)0) )
+ if( rValue.getValue() )
{
- uno::Sequence<sal_Int8>* pSeq( (uno::Sequence<sal_Int8>*)rValue.getValue() );
- SvMemoryStream aMemStm;
- Graphic aGraphic;
+ if( rValue.getValueType() == ::getCppuType(( const uno::Sequence< sal_Int8 >*)0) )
+ {
+ uno::Sequence<sal_Int8>* pSeq( (uno::Sequence<sal_Int8>*)rValue.getValue() );
+ SvMemoryStream aMemStm;
+ Graphic aGraphic;
- aMemStm.SetBuffer( (char*)pSeq->getConstArray(), pSeq->getLength(), sal_False, pSeq->getLength() );
+ aMemStm.SetBuffer( (char*)pSeq->getConstArray(), pSeq->getLength(), sal_False, pSeq->getLength() );
- if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE )
- {
- static_cast<SdrGrafObj*>(mpObj.get())->SetGraphic(aGraphic);
- bOk = true;
+ if( GraphicConverter::Import( aMemStm, aGraphic ) == ERRCODE_NONE )
+ {
+ static_cast<SdrGrafObj*>(mpObj.get())->SetGraphic(aGraphic);
+ bOk = true;
+ }
}
}
- }
- else if( (rValue.getValueType() == awt::XBitmap::static_type()) || (rValue.getValueType() == graphic::XGraphic::static_type()))
- {
- Reference< graphic::XGraphic> xGraphic( rValue, UNO_QUERY );
- if( xGraphic.is() )
+ else if( (rValue.getValueType() == awt::XBitmap::static_type()) || (rValue.getValueType() == graphic::XGraphic::static_type()))
{
- ((SdrGrafObj*)mpObj.get())->SetGraphic(Graphic(xGraphic));
- bOk = true;
- }
- else
- {
- // Bitmap in das Objekt packen
- Reference< awt::XBitmap > xBmp( rValue, UNO_QUERY );
- if( xBmp.is() )
+ Reference< graphic::XGraphic> xGraphic( rValue, UNO_QUERY );
+ if( xGraphic.is() )
{
- // Bitmap einsetzen
- Graphic aGraphic(VCLUnoHelper::GetBitmap( xBmp ));
- ((SdrGrafObj*)mpObj.get())->SetGraphic(aGraphic);
+ ((SdrGrafObj*)mpObj.get())->SetGraphic(Graphic(xGraphic));
bOk = true;
}
+ else
+ {
+ // Bitmap in das Objekt packen
+ Reference< awt::XBitmap > xBmp( rValue, UNO_QUERY );
+ if( xBmp.is() )
+ {
+ // Bitmap einsetzen
+ Graphic aGraphic(VCLUnoHelper::GetBitmap( xBmp ));
+ ((SdrGrafObj*)mpObj.get())->SetGraphic(aGraphic);
+ bOk = true;
+ }
+ }
}
+ break;
}
- break;
- }
- case OWN_ATTR_GRAFURL:
- {
- OUString aURL;
- if( rValue >>= aURL )
+ case OWN_ATTR_GRAFURL:
{
- if( aURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 )
+ OUString aURL;
+ if( rValue >>= aURL )
{
- // graphic manager url
- aURL = aURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
- String aTmpStr(aURL);
- ByteString aUniqueID( aTmpStr, RTL_TEXTENCODING_UTF8 );
- GraphicObject aGrafObj( aUniqueID );
-
- // #101808# since loading a graphic can cause a reschedule of the office
- // it is possible that our shape is removed while where in this
- // method.
- if( mpObj.is() )
+ if( aURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPREFIX ) ) == 0 )
{
- static_cast<SdrGrafObj*>(mpObj.get())->ReleaseGraphicLink();
- static_cast<SdrGrafObj*>(mpObj.get())->SetGraphicObject( aGrafObj );
+ // graphic manager url
+ aURL = aURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
+ String aTmpStr(aURL);
+ ByteString aUniqueID( aTmpStr, RTL_TEXTENCODING_UTF8 );
+ GraphicObject aGrafObj( aUniqueID );
+
+ // #101808# since loading a graphic can cause a reschedule of the office
+ // it is possible that our shape is removed while where in this
+ // method.
+ if( mpObj.is() )
+ {
+ static_cast<SdrGrafObj*>(mpObj.get())->ReleaseGraphicLink();
+ static_cast<SdrGrafObj*>(mpObj.get())->SetGraphicObject( aGrafObj );
+ }
}
- }
- else if( aURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPKGPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) ) != 0 )
- {
- // normal link
- String aFilterName;
- const SfxFilter* pSfxFilter = NULL;
- SfxMedium aSfxMedium( aURL, STREAM_READ | STREAM_SHARE_DENYNONE, sal_False );
-
- SFX_APP()->GetFilterMatcher().GuessFilter( aSfxMedium, &pSfxFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
-
- if( !pSfxFilter )
+ else if( aURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPKGPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) ) != 0 )
{
- INetURLObject aURLObj( aURL );
+ // normal link
+ String aFilterName;
+ const SfxFilter* pSfxFilter = NULL;
+ SfxMedium aSfxMedium( aURL, STREAM_READ | STREAM_SHARE_DENYNONE, sal_False );
- if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID )
+ SFX_APP()->GetFilterMatcher().GuessFilter( aSfxMedium, &pSfxFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
+
+ if( !pSfxFilter )
{
- String aValidURL;
+ INetURLObject aURLObj( aURL );
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aURL, aValidURL ) )
- aURLObj = INetURLObject( aValidURL );
- }
+ if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID )
+ {
+ String aValidURL;
- if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID )
- {
- GraphicFilter* pGrfFilter = GraphicFilter::GetGraphicFilter();
- aFilterName = pGrfFilter->GetImportFormatName( pGrfFilter->GetImportFormatNumberForShortName( aURLObj.getExtension() ) );
+ if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aURL, aValidURL ) )
+ aURLObj = INetURLObject( aValidURL );
+ }
+
+ if( aURLObj.GetProtocol() != INET_PROT_NOT_VALID )
+ {
+ GraphicFilter* pGrfFilter = GraphicFilter::GetGraphicFilter();
+ aFilterName = pGrfFilter->GetImportFormatName( pGrfFilter->GetImportFormatNumberForShortName( aURLObj.getExtension() ) );
+ }
}
- }
- else
- aFilterName = pSfxFilter->GetFilterName();
+ else
+ aFilterName = pSfxFilter->GetFilterName();
- // #101808# since loading a graphic can cause a reschedule of the office
- // it is possible that our shape is removed while where in this
- // method.
- if( mpObj.is() )
- static_cast<SdrGrafObj*>(mpObj.get())->SetGraphicLink( aURL, aFilterName );
+ // #101808# since loading a graphic can cause a reschedule of the office
+ // it is possible that our shape is removed while where in this
+ // method.
+ if( mpObj.is() )
+ static_cast<SdrGrafObj*>(mpObj.get())->SetGraphicLink( aURL, aFilterName );
+ }
+ bOk = true;
}
- bOk = true;
+ break;
}
- break;
- }
- case OWN_ATTR_GRAFSTREAMURL:
- {
- OUString aStreamURL;
-
- if( rValue >>= aStreamURL )
+ case OWN_ATTR_GRAFSTREAMURL:
{
- if( aStreamURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPKGPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) ) != 0 )
- aStreamURL = OUString();
+ OUString aStreamURL;
- if( mpObj.is() )
+ if( rValue >>= aStreamURL )
{
- static_cast<SdrGrafObj*>(mpObj.get())->SetGrafStreamURL( aStreamURL );
- static_cast<SdrGrafObj*>(mpObj.get())->ForceSwapOut();
+ if( aStreamURL.compareToAscii( UNO_NAME_GRAPHOBJ_URLPKGPREFIX, RTL_CONSTASCII_LENGTH( UNO_NAME_GRAPHOBJ_URLPKGPREFIX ) ) != 0 )
+ aStreamURL = OUString();
+
+ if( mpObj.is() )
+ {
+ static_cast<SdrGrafObj*>(mpObj.get())->SetGrafStreamURL( aStreamURL );
+ static_cast<SdrGrafObj*>(mpObj.get())->ForceSwapOut();
+ }
+ bOk = true;
}
- bOk = true;
+ break;
}
- break;
- }
- case OWN_ATTR_VALUE_GRAPHIC:
- {
- Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
- if( xGraphic.is() )
+ case OWN_ATTR_VALUE_GRAPHIC:
+ {
+ Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
+ if( xGraphic.is() )
+ {
+ static_cast< SdrGrafObj*>( mpObj.get() )->SetGraphic( xGraphic );
+ bOk = true;
+ }
+ break;
+ }
+ default:
{
- static_cast< SdrGrafObj*>( mpObj.get() )->SetGraphic( xGraphic );
- bOk = true;
+ return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
}
- break;
- }
- default:
- return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
}
if( !bOk )
@@ -1801,90 +1740,92 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const
{
switch( pProperty->nWID )
{
- case OWN_ATTR_VALUE_FILLBITMAP:
- {
- sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut();
- const Graphic& rGraphic = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphic();
+ case OWN_ATTR_VALUE_FILLBITMAP:
+ {
+ sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut();
+ const Graphic& rGraphic = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphic();
+
+ if(rGraphic.GetType() != GRAPHIC_GDIMETAFILE)
+ {
+ // Objekt in eine Bitmap packen
+ Reference< ::com::sun::star::awt::XBitmap > xBitmap( VCLUnoHelper::CreateBitmap(static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphic().GetBitmapEx()) );
+ rValue <<= xBitmap;
+ }
+ else
+ {
+ SvMemoryStream aDestStrm( 65535, 65535 );
+
+ ConvertGDIMetaFileToWMF( rGraphic.GetGDIMetaFile(), aDestStrm, NULL, sal_False );
+ const uno::Sequence<sal_Int8> aSeq(
+ static_cast< const sal_Int8* >(aDestStrm.GetData()),
+ aDestStrm.GetEndOfData());
+ rValue <<= aSeq;
+ }
+ if ( bSwapped )
+ static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut();
+ break;
+ }
- if(rGraphic.GetType() != GRAPHIC_GDIMETAFILE)
+ case OWN_ATTR_GRAFURL:
{
- // Objekt in eine Bitmap packen
- Reference< ::com::sun::star::awt::XBitmap > xBitmap( VCLUnoHelper::CreateBitmap(static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphic().GetBitmapEx()) );
- rValue <<= xBitmap;
+ if( static_cast< SdrGrafObj*>( mpObj.get() )->IsLinkedGraphic() )
+ {
+ rValue <<= OUString( static_cast< SdrGrafObj*>( mpObj.get() )->GetFileName() );
+ }
+ else
+ {
+ sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut();
+ const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(true);
+ OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
+ aURL += OUString::createFromAscii( rGrafObj.GetUniqueID().GetBuffer() );
+ rValue <<= aURL;
+ if ( bSwapped )
+ static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut();
+ }
+ break;
}
- else
+
+ case OWN_ATTR_REPLACEMENTGRAFURL:
{
- SvMemoryStream aDestStrm( 65535, 65535 );
+ const GraphicObject* pGrafObj = static_cast< SdrGrafObj* >(mpObj.get())->GetReplacementGraphicObject();
+
+ if(pGrafObj)
+ {
+ OUString aURL(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
+ aURL += OUString::createFromAscii(pGrafObj->GetUniqueID().GetBuffer());
+ rValue <<= aURL;
+ }
- ConvertGDIMetaFileToWMF( rGraphic.GetGDIMetaFile(), aDestStrm, NULL, sal_False );
- const uno::Sequence<sal_Int8> aSeq(
- static_cast< const sal_Int8* >(aDestStrm.GetData()),
- aDestStrm.GetEndOfData());
- rValue <<= aSeq;
+ break;
}
- if ( bSwapped )
- static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut();
- break;
- }
- case OWN_ATTR_GRAFURL:
- {
- if( static_cast< SdrGrafObj*>( mpObj.get() )->IsLinkedGraphic() )
+ case OWN_ATTR_GRAFSTREAMURL:
{
- rValue <<= OUString( static_cast< SdrGrafObj*>( mpObj.get() )->GetFileName() );
+ const OUString aStreamURL( ( (SdrGrafObj*) mpObj.get() )->GetGrafStreamURL() );
+ if( aStreamURL.getLength() )
+ rValue <<= aStreamURL;
+ break;
}
- else
+
+ case OWN_ATTR_VALUE_GRAPHIC:
{
sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut();
- const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(true);
- OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
- aURL += OUString::createFromAscii( rGrafObj.GetUniqueID().GetBuffer() );
- rValue <<= aURL;
+ Reference< graphic::XGraphic > xGraphic( static_cast< SdrGrafObj* >( mpObj.get() )->GetGraphic().GetXGraphic() );
+ rValue <<= xGraphic;
if ( bSwapped )
static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut();
+ break;
}
- break;
- }
- case OWN_ATTR_REPLACEMENTGRAFURL:
- {
- const GraphicObject* pGrafObj = static_cast< SdrGrafObj* >(mpObj.get())->GetReplacementGraphicObject();
-
- if(pGrafObj)
+ case OWN_ATTR_GRAPHIC_STREAM:
{
- OUString aURL(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
- aURL += OUString::createFromAscii(pGrafObj->GetUniqueID().GetBuffer());
- rValue <<= aURL;
+ rValue <<= static_cast< SdrGrafObj* >( mpObj.get() )->getInputStream();
+ break;
+ }
+ default:
+ {
+ return SvxShapeText::getPropertyValueImpl(rName, pProperty,rValue);
}
-
- break;
- }
-
- case OWN_ATTR_GRAFSTREAMURL:
- {
- const OUString aStreamURL( ( (SdrGrafObj*) mpObj.get() )->GetGrafStreamURL() );
- if( aStreamURL.getLength() )
- rValue <<= aStreamURL;
- break;
- }
-
- case OWN_ATTR_VALUE_GRAPHIC:
- {
- sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut();
- Reference< graphic::XGraphic > xGraphic( static_cast< SdrGrafObj* >( mpObj.get() )->GetGraphic().GetXGraphic() );
- rValue <<= xGraphic;
- if ( bSwapped )
- static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut();
- break;
- }
-
- case OWN_ATTR_GRAPHIC_STREAM:
- {
- rValue <<= static_cast< SdrGrafObj* >( mpObj.get() )->getInputStream();
- break;
- }
- default:
- return SvxShapeText::getPropertyValueImpl(rName, pProperty,rValue);
}
return true;
@@ -1893,7 +1834,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const
///////////////////////////////////////////////////////////////////////
SvxShapeCaption::SvxShapeCaption( SdrObject* pObj ) throw()
-: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CAPTION), aSvxMapProvider.GetPropertySet(SVXMAP_CAPTION, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CAPTION), aSvxMapProvider.GetPropertySet(SVXMAP_CAPTION, GetGlobalDrawObjectItemPool()) )
{
}
@@ -1906,7 +1847,7 @@ SvxShapeCaption::~SvxShapeCaption() throw()
***********************************************************************/
SvxCustomShape::SvxCustomShape( SdrObject* pObj ) throw() :
- SvxShapeText( pObj, aSvxMapProvider.GetMap( SVXMAP_CUSTOMSHAPE ), aSvxMapProvider.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool()) )
+ SvxShapeText( pObj, aSvxMapProvider.GetMap( SVXMAP_CUSTOMSHAPE ), aSvxMapProvider.GetPropertySet(SVXMAP_CUSTOMSHAPE, GetGlobalDrawObjectItemPool()) )
{
}
@@ -1979,85 +1920,171 @@ OUString SAL_CALL SvxCustomShape::getShapeType()
}
//------------------------------------------------------------------1----
-awt::Point SAL_CALL SvxCustomShape::getPosition() throw(uno::RuntimeException)
-{
- OGuard aGuard( Application::GetSolarMutex() );
- if ( mpModel && mpObj.is() )
- {
- SdrAShapeObjGeoData aCustomShapeGeoData;
- ((SdrObjCustomShape*)mpObj.get())->SaveGeoData( aCustomShapeGeoData );
-
- sal_Bool bMirroredX = sal_False;
- sal_Bool bMirroredY = sal_False;
- if ( mpObj.is() )
- {
- bMirroredX = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredX() );
- bMirroredY = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredY() );
- }
- // get aRect, this is the unrotated snaprect
- Rectangle aRect(((SdrObjCustomShape*)mpObj.get())->GetLogicRect());
- Rectangle aRectangle( aRect );
-
- if ( bMirroredX || bMirroredY )
- { // we have to retrieve the unmirrored rect
-
- GeoStat aNewGeo( aCustomShapeGeoData.aGeo );
- if ( bMirroredX )
- {
- Polygon aPol( Rect2Poly( aRect, aNewGeo ) );
- Rectangle aBoundRect( aPol.GetBoundRect() );
-
- Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
- Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
- sal_uInt16 i;
- sal_uInt16 nPntAnz=aPol.GetSize();
- for (i=0; i<nPntAnz; i++)
- {
- MirrorPoint(aPol[i],aRef1,aRef2);
- }
- // Polygon wenden und etwas schieben
- Polygon aPol0(aPol);
- aPol[0]=aPol0[1];
- aPol[1]=aPol0[0];
- aPol[2]=aPol0[3];
- aPol[3]=aPol0[2];
- aPol[4]=aPol0[1];
- Poly2Rect(aPol,aRectangle,aNewGeo);
- }
- if ( bMirroredY )
- {
- Polygon aPol( Rect2Poly( aRectangle, aNewGeo ) );
- Rectangle aBoundRect( aPol.GetBoundRect() );
-
- Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1 );
- Point aRef2( aRef1.X() + 1000, aRef1.Y() );
- sal_uInt16 i;
- sal_uInt16 nPntAnz=aPol.GetSize();
- for (i=0; i<nPntAnz; i++)
- {
- MirrorPoint(aPol[i],aRef1,aRef2);
- }
- // Polygon wenden und etwas schieben
- Polygon aPol0(aPol);
- aPol[0]=aPol0[1];
- aPol[1]=aPol0[0];
- aPol[2]=aPol0[3];
- aPol[3]=aPol0[2];
- aPol[4]=aPol0[1];
- Poly2Rect( aPol, aRectangle, aNewGeo );
- }
- }
- Point aPt( aRectangle.TopLeft() );
+// TTTT: Not needed
+//Polygon Rect2Poly(const Rectangle& rRect, long aOldRotation, long aOldShear) // TTTT needed?
+//{
+// Polygon aPol(5);
+// aPol[0]=rRect.TopLeft();
+// aPol[1]=rRect.TopRight();
+// aPol[2]=rRect.BottomRight();
+// aPol[3]=rRect.BottomLeft();
+// aPol[4]=rRect.TopLeft();
+//
+// if (aOldShear)
+// ShearPoly(aPol,rRect.TopLeft(),tan(aOldShear*nPi180));
+//
+// if (aOldRotation)
+// RotatePoly(aPol,rRect.TopLeft(),sin(aOldRotation*nPi180), cos(aOldRotation*nPi180));
+//
+// return aPol;
+//}
+//
+//void Poly2Rect(const Polygon& rPol, Rectangle& rRect, long& rRotation, long& rShear) // TTTT needed?
+//{
+// rRotation=GetAngle(rPol[1]-rPol[0]);
+// rShear=NormAngle360(rRotation);
+// // Drehung ist damit im Kasten
+//
+// Point aPt1(rPol[1]-rPol[0]);
+// if (rRotation) RotatePoint(aPt1,Point(0,0),-sin(rRotation*nPi180), cos(rRotation*nPi180)); // -Sin fuer Rueckdrehung
+// long nWdt=aPt1.X();
+//
+// Point aPt0(rPol[0]);
+// Point aPt3(rPol[3]-rPol[0]);
+// if (rRotation) RotatePoint(aPt3,Point(0,0),-sin(rRotation*nPi180), cos(rRotation*nPi180)); // -Sin fuer Rueckdrehung
+// long nHgt=aPt3.Y();
+//
+// if(aPt3.X())
+// {
+// // #i74358# the axes are not orthogonal, so for getting the correct height,
+// // calculate the length of aPt3
+//
+// // #i74358# this change was wrong, in the field of the old geometry stuff
+// // it is not an error. The new height always is the same as before; shear
+// // does not change object height at all. This is different from the interactions,
+// // but obviously wanted in the old versions.
+// //
+// // nHgt = static_cast< long >(sqrt(static_cast< double >(aPt3.X() * aPt3.X() + aPt3.Y() * aPt3.Y())));
+// }
+//
+// long nShW=GetAngle(aPt3);
+// nShW-=27000; // ShearWink wird zur Senkrechten gemessen
+// nShW=-nShW; // Negieren, denn '+' ist Rechtskursivierung
+//
+// bool bMirr=aPt3.Y()<0;
+// if (bMirr) { // "Punktetausch" bei Spiegelung
+// nHgt=-nHgt;
+// nShW+=18000;
+// aPt0=rPol[3];
+// }
+// nShW=NormAngle180(nShW);
+// if (nShW<-9000 || nShW>9000) {
+// nShW=NormAngle180(nShW+18000);
+// }
+// const long SDRMAXSHEAR(8900);
+// if (nShW<-SDRMAXSHEAR) nShW=-SDRMAXSHEAR; // ShearWinkel begrenzen auf +/- 89.00 deg
+// if (nShW>SDRMAXSHEAR) nShW=SDRMAXSHEAR;
+// rShear=nShW;
+// Point aRU(aPt0);
+// aRU.X()+=nWdt;
+// aRU.Y()+=nHgt;
+// rRect=Rectangle(aPt0,aRU);
+//}
- if( mpModel->IsWriter() )
- aPt -= mpObj->GetAnchorPos();
+awt::Point SAL_CALL SvxCustomShape::getPosition() throw(uno::RuntimeException)
+{
+ // TTTT: All exceptions because of mirroring should be obsolete
+ return SvxShape::getPosition();
- ForceMetricTo100th_mm(aPt);
- return ::com::sun::star::awt::Point( aPt.X(), aPt.Y() );
- }
- else
- return SvxShape::getPosition();
+ //OGuard aGuard( Application::GetSolarMutex() );
+ //if ( mpModel && mpObj.is() )
+ //{
+ // sal_Bool bMirroredX = sal_False;
+ // sal_Bool bMirroredY = sal_False;
+ //
+ // if ( mpObj.is() )
+ // {
+ // const SdrObjCustomShape* pSdrObjCustomShape = dynamic_cast< const SdrObjCustomShape* >(mpObj.get());
+ //
+ // if(pSdrObjCustomShape)
+ // {
+ // bMirroredX = isMirroredX();
+ // bMirroredY = isMirroredY();
+ // }
+ // // TTTT:
+ // //bMirroredX = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredX() );
+ // //bMirroredY = ( ((SdrObjCustomShape*)mpObj.get())->IsMirroredY() );
+ // }
+ // // get aRect, this is the unrotated snaprect
+ // Rectangle aRect(sdr::legacy::GetLogicRect(*((SdrObjCustomShape*)mpObj.get())));
+ // Rectangle aRectangle( aRect );
+ //
+ // if ( bMirroredX || bMirroredY )
+ // {
+ // // we have to retrieve the unmirrored rect
+ // long aRotation(sdr::legacy::GetRotateAngle(*mpObj.get()));
+ // long aShear(sdr::legacy::GetShearAngleX(*mpObj.get()));
+ //
+ // if ( bMirroredX )
+ // {
+ // Polygon aPol( Rect2Poly( aRect, aRotation, aShear ) );
+ // Rectangle aBoundRect( aPol.GetBoundRect() );
+ //
+ // Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() );
+ // Point aRef2( aRef1.X(), aRef1.Y() + 1000 );
+ // sal_uInt16 i;
+ // sal_uInt16 nPntAnz=aPol.GetSize();
+ // for (i=0; i<nPntAnz; i++)
+ // {
+ // MirrorPoint(aPol[i],aRef1,aRef2);
+ // }
+ // // Polygon wenden und etwas schieben
+ // Polygon aPol0(aPol);
+ // aPol[0]=aPol0[1];
+ // aPol[1]=aPol0[0];
+ // aPol[2]=aPol0[3];
+ // aPol[3]=aPol0[2];
+ // aPol[4]=aPol0[1];
+ // Poly2Rect(aPol,aRectangle,aRotation, aShear);
+ // }
+ // if ( bMirroredY )
+ // {
+ // Polygon aPol( Rect2Poly( aRectangle, aRotation, aShear ) );
+ // Rectangle aBoundRect( aPol.GetBoundRect() );
+ //
+ // Point aRef1( aBoundRect.Left(), ( aBoundRect.Top() + aBoundRect.Bottom() ) >> 1 );
+ // Point aRef2( aRef1.X() + 1000, aRef1.Y() );
+ // sal_uInt16 i;
+ // sal_uInt16 nPntAnz=aPol.GetSize();
+ // for (i=0; i<nPntAnz; i++)
+ // {
+ // MirrorPoint(aPol[i],aRef1,aRef2);
+ // }
+ // // Polygon wenden und etwas schieben
+ // Polygon aPol0(aPol);
+ // aPol[0]=aPol0[1];
+ // aPol[1]=aPol0[0];
+ // aPol[2]=aPol0[3];
+ // aPol[3]=aPol0[2];
+ // aPol[4]=aPol0[1];
+ // Poly2Rect( aPol, aRectangle, aRotation, aShear );
+ // }
+ // }
+ //
+ // basegfx::B2DPoint aPt( aRectangle.Left(), aRectangle.Top() );
+ //
+ // if(isWriterAnchorUsed())
+ // {
+ // aPt -= mpObj->GetAnchorPos();
+ // }
+ //
+ // ForceMetricTo100th_mm(aPt);
+ //
+ // return ::com::sun::star::awt::Point( basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY()) );
+ //}
+ //else
+ // return SvxShape::getPosition();
}
//----------------------------------------------------------------------
@@ -2086,85 +2113,92 @@ void SAL_CALL SvxCustomShape::setSize( const awt::Size& rSize )
void SAL_CALL SvxCustomShape::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException)
{
- OGuard aGuard( Application::GetSolarMutex() );
- SdrObject* pObject = mpObj.get();
-
- sal_Bool bCustomShapeGeometry = pObject && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CustomShapeGeometry" ) );
-
- sal_Bool bMirroredX = sal_False;
- sal_Bool bMirroredY = sal_False;
-
- if ( bCustomShapeGeometry )
- {
- bMirroredX = ( ((SdrObjCustomShape*)pObject)->IsMirroredX() );
- bMirroredY = ( ((SdrObjCustomShape*)pObject)->IsMirroredY() );
- }
-
+ // TTTT: All exceptions because of mirroring should be obsolete
SvxShape::setPropertyValue( aPropertyName, aValue );
- if ( bCustomShapeGeometry )
- {
- ((SdrObjCustomShape*)pObject)->MergeDefaultAttributes(0);
- Rectangle aRect( pObject->GetSnapRect() );
-
- // #i38892#
- bool bNeedsMirrorX = ((SdrObjCustomShape*)pObject)->IsMirroredX() != bMirroredX;
- bool bNeedsMirrorY = ((SdrObjCustomShape*)pObject)->IsMirroredY() != bMirroredY;
-
- boost::scoped_ptr< SdrGluePointList > pListCopy;
- if( bNeedsMirrorX || bNeedsMirrorY )
- {
- const SdrGluePointList* pList = pObject->GetGluePointList();
- if( pList )
- pListCopy.reset( new SdrGluePointList(*pList) );
- }
-
- if ( bNeedsMirrorX )
- {
- Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
- Point aBottom( aTop.X(), aTop.Y() + 1000 );
- pObject->NbcMirror( aTop, aBottom );
- // NbcMirroring is flipping the current mirror state,
- // so we have to set the correct state again
- ((SdrObjCustomShape*)pObject)->SetMirroredX( bMirroredX ? sal_False : sal_True );
- }
- if ( bNeedsMirrorY )
- {
- Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
- Point aRight( aLeft.X() + 1000, aLeft.Y() );
- pObject->NbcMirror( aLeft, aRight );
- // NbcMirroring is flipping the current mirror state,
- // so we have to set the correct state again
- ((SdrObjCustomShape*)pObject)->SetMirroredY( bMirroredY ? sal_False : sal_True );
- }
-
- if( pListCopy )
- {
- SdrGluePointList* pNewList = const_cast< SdrGluePointList* >( pObject->GetGluePointList() );
- if(pNewList)
- *pNewList = *pListCopy;
- }
- }
-}
-
-bool SvxCustomShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
-{
- switch( pProperty->nWID )
- {
- case SDRATTR_ROTATEANGLE:
- {
- double fAngle = static_cast<SdrObjCustomShape*>(mpObj.get())->GetObjectRotation();
- fAngle *= 100;
- rValue <<= (sal_Int32)fAngle;
- return true;
- }
- default:
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
- }
-}
+ //OGuard aGuard( Application::GetSolarMutex() );
+ //SdrObject* pObject = mpObj.get();
+ //
+ //const bool bCustomShapeGeometry(pObject && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CustomShapeGeometry" ) ));
+ //bool bMirroredX = false;
+ //bool bMirroredY = false;
+ //
+ //if ( bCustomShapeGeometry )
+ //{
+ // bMirroredX = ( ((SdrObjCustomShape*)pObject)->IsMirroredX() );
+ // bMirroredY = ( ((SdrObjCustomShape*)pObject)->IsMirroredY() );
+ //}
+ //
+ //SvxShape::setPropertyValue( aPropertyName, aValue );
+ //
+ //if ( bCustomShapeGeometry )
+ //{
+ // ((SdrObjCustomShape*)pObject)->MergeDefaultAttributes(0);
+ // const Rectangle aRect( sdr::legacy::GetSnapRect(*pObject) );
+ //
+ // // #i38892#
+ // const bool bNeedsMirrorX(((SdrObjCustomShape*)pObject)->IsMirroredX() != bMirroredX);
+ // const bool bNeedsMirrorY(((SdrObjCustomShape*)pObject)->IsMirroredY() != bMirroredY);
+ // boost::scoped_ptr< SdrGluePointList > pListCopy;
+ //
+ // if( bNeedsMirrorX || bNeedsMirrorY )
+ // {
+ // const SdrGluePointList* pList = pObject->GetGluePointList();
+ // if( pList )
+ // pListCopy.reset( new SdrGluePointList(*pList) );
+ // }
+ //
+ // if ( bNeedsMirrorX )
+ // {
+ // Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
+ // Point aBottom( aTop.X(), aTop.Y() + 1000 );
+ // sdr::legacy::MirrorSdrObject(*pObject, aTop, aBottom );
+ // // NbcMirroring is flipping the current mirror state,
+ // // so we have to set the correct state again
+ // ((SdrObjCustomShape*)pObject)->SetMirroredX( bMirroredX ? sal_False : sal_True );
+ // }
+ // if ( bNeedsMirrorY )
+ // {
+ // Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
+ // Point aRight( aLeft.X() + 1000, aLeft.Y() );
+ // sdr::legacy::MirrorSdrObject(*pObject, aLeft, aRight );
+ // // NbcMirroring is flipping the current mirror state,
+ // // so we have to set the correct state again
+ // ((SdrObjCustomShape*)pObject)->SetMirroredY( bMirroredY ? sal_False : sal_True );
+ // }
+ //
+ // if( pListCopy )
+ // {
+ // SdrGluePointList* pNewList = const_cast< SdrGluePointList* >( pObject->GetGluePointList() );
+ // if(pNewList)
+ // *pNewList = *pListCopy;
+ // }
+ //}
+}
+
+// TTTT:
+//bool SvxCustomShape::getPropertyValueImpl( const ::rtl::OUString& rName, const SfxItemPropertySimpleEntry* pProperty, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+//{
+// switch( pProperty->nWID )
+// {
+// case SDRATTR_ROTATEANGLE:
+// {
+// double fAngle = static_cast<SdrObjCustomShape*>(mpObj.get())->GetObjectRotation();
+// fAngle *= 100;
+// rValue <<= (sal_Int32)fAngle;
+// return true;
+// }
+// default:
+// {
+// return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+// }
+// }
+//}
//----------------------------------------------------------------------
void SvxCustomShape::createCustomShapeDefaults( const rtl::OUString& rValueType ) throw (::com::sun::star::uno::RuntimeException)
{
((SdrObjCustomShape*)mpObj.get())->MergeDefaultAttributes( &rValueType );
}
+
+// EOF
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 70eb6f93f100..822b8c76be1e 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -33,15 +33,13 @@
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <comphelper/serviceinfohelper.hxx>
-
#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <svx/svdpool.hxx>
#include <svx/unoshape.hxx>
#include <svx/unopage.hxx>
#include <editeng/unoprnms.hxx>
-#include <svx/polysc3d.hxx>
-#include "svx/globl3d.hxx"
+#include <svx/globl3d.hxx>
#include <svx/cube3d.hxx>
#include <svx/sphere3d.hxx>
#include <svx/lathe3d.hxx>
@@ -53,6 +51,12 @@
#include <basegfx/polygon/b3dpolygontools.hxx>
#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b3dpolypolygontools.hxx>
+#include <basegfx/matrix/b3dhommatrixtools.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svditer.hxx>
+#include <svx/scene3d.hxx>
+#include <svx/globaldrawitempool.hxx>
using ::rtl::OUString;
using namespace ::vos;
@@ -75,7 +79,7 @@ using namespace ::com::sun::star::container;
//----------------------------------------------------------------------
Svx3DSceneObject::Svx3DSceneObject( SdrObject* pObj, SvxDrawPage* pDrawPage ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DSCENEOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DSCENEOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DSCENEOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DSCENEOBJECT, GetGlobalDrawObjectItemPool()) )
, mxPage( pDrawPage )
{
}
@@ -153,17 +157,19 @@ void SAL_CALL Svx3DSceneObject::add( const Reference< drawing::XShape >& xShape
if(!mpObj.is() || !mxPage.is() || pShape == NULL || NULL != pShape->GetSdrObject() )
throw uno::RuntimeException();
- SdrObject* pSdrShape = mxPage->_CreateSdrObject( xShape );
- if( pSdrShape->ISA(E3dObject) )
+ SdrObject* pSdrObject = dynamic_cast< SdrObject* >(mxPage->_CreateSdrObject( xShape ));
+ E3dScene* pSdrShape = dynamic_cast< E3dScene* >(pSdrObject);
+
+ if( pSdrShape && pSdrShape->getChildrenOfSdrObject() )
{
- mpObj->GetSubList()->NbcInsertObject( pSdrShape );
+ mpObj->getChildrenOfSdrObject()->InsertObjectToSdrObjList(*pSdrShape);
if(pShape)
pShape->Create( pSdrShape, mxPage.get() );
}
else
{
- SdrObject::Free( pSdrShape );
+ deleteSdrObjectSafeAndClearPointer( pSdrObject );
throw uno::RuntimeException();
}
@@ -183,13 +189,13 @@ void SAL_CALL Svx3DSceneObject::remove( const Reference< drawing::XShape >& xSha
throw uno::RuntimeException();
SdrObject* pSdrShape = pShape->GetSdrObject();
- if(pSdrShape == NULL || pSdrShape->GetObjList()->GetOwnerObj() != mpObj.get())
+ if(pSdrShape == NULL || pSdrShape->getParentOfSdrObject()->getSdrObjectFromSdrObjList() != mpObj.get())
{
throw uno::RuntimeException();
}
else
{
- SdrObjList& rList = *pSdrShape->GetObjList();
+ SdrObjList& rList = *pSdrShape->getParentOfSdrObject();
const sal_uInt32 nObjCount = rList.GetObjCount();
sal_uInt32 nObjNum = 0;
@@ -202,8 +208,8 @@ void SAL_CALL Svx3DSceneObject::remove( const Reference< drawing::XShape >& xSha
if( nObjNum < nObjCount )
{
- SdrObject* pObject = rList.NbcRemoveObject( nObjNum );
- SdrObject::Free( pObject );
+ SdrObject* pObject = rList.RemoveObjectFromSdrObjList( nObjNum );
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
else
{
@@ -219,9 +225,13 @@ sal_Int32 SAL_CALL Svx3DSceneObject::getCount()
OGuard aGuard( Application::GetSolarMutex() );
sal_Int32 nRetval = 0;
+ E3dScene* pE3dScene = dynamic_cast< E3dScene* >(mpObj.get());
+
+ if(pE3dScene && pE3dScene->getChildrenOfSdrObject())
+ {
+ nRetval = pE3dScene->getChildrenOfSdrObject()->GetObjCount();
+ }
- if(mpObj.is() && mpObj->ISA(E3dPolyScene) && mpObj->GetSubList())
- nRetval = mpObj->GetSubList()->GetObjCount();
return nRetval;
}
@@ -232,13 +242,13 @@ uno::Any SAL_CALL Svx3DSceneObject::getByIndex( sal_Int32 Index )
{
OGuard aGuard( Application::GetSolarMutex() );
- if( !mpObj.is() || mpObj->GetSubList() == NULL )
+ if( !mpObj.is() || mpObj->getChildrenOfSdrObject() == NULL )
throw uno::RuntimeException();
- if( mpObj->GetSubList()->GetObjCount() <= (sal_uInt32)Index )
+ if( mpObj->getChildrenOfSdrObject()->GetObjCount() <= (sal_uInt32)Index )
throw lang::IndexOutOfBoundsException();
- SdrObject* pDestObj = mpObj->GetSubList()->GetObj( Index );
+ SdrObject* pDestObj = mpObj->getChildrenOfSdrObject()->GetObj( Index );
if(pDestObj == NULL)
throw lang::IndexOutOfBoundsException();
@@ -263,34 +273,17 @@ sal_Bool SAL_CALL Svx3DSceneObject::hasElements()
{
OGuard aGuard( Application::GetSolarMutex() );
- return mpObj.is() && mpObj->GetSubList() && (mpObj->GetSubList()->GetObjCount() > 0);
+ return mpObj.is() && mpObj->getChildrenOfSdrObject() && (mpObj->getChildrenOfSdrObject()->GetObjCount() > 0);
}
//----------------------------------------------------------------------
static bool ConvertHomogenMatrixToObject( E3dObject* pObject, const Any& rValue )
{
- drawing::HomogenMatrix m;
- if( rValue >>= m )
+ drawing::HomogenMatrix aMat;
+ if( rValue >>= aMat )
{
- basegfx::B3DHomMatrix aMat;
- aMat.set(0, 0, m.Line1.Column1);
- aMat.set(0, 1, m.Line1.Column2);
- aMat.set(0, 2, m.Line1.Column3);
- aMat.set(0, 3, m.Line1.Column4);
- aMat.set(1, 0, m.Line2.Column1);
- aMat.set(1, 1, m.Line2.Column2);
- aMat.set(1, 2, m.Line2.Column3);
- aMat.set(1, 3, m.Line2.Column4);
- aMat.set(2, 0, m.Line3.Column1);
- aMat.set(2, 1, m.Line3.Column2);
- aMat.set(2, 2, m.Line3.Column3);
- aMat.set(2, 3, m.Line3.Column4);
- aMat.set(3, 0, m.Line4.Column1);
- aMat.set(3, 1, m.Line4.Column2);
- aMat.set(3, 2, m.Line4.Column3);
- aMat.set(3, 3, m.Line4.Column4);
- pObject->SetTransform(aMat);
+ pObject->SetB3DTransform(basegfx::tools::UnoHomogenMatrixToB3DHomMatrix(aMat));
return true;
}
return false;
@@ -299,28 +292,12 @@ static bool ConvertHomogenMatrixToObject( E3dObject* pObject, const Any& rValue
static void ConvertObjectToHomogenMatric( E3dObject* pObject, Any& rValue )
{
drawing::HomogenMatrix aHomMat;
- const basegfx::B3DHomMatrix& rMat = pObject->GetTransform();
- aHomMat.Line1.Column1 = rMat.get(0, 0);
- aHomMat.Line1.Column2 = rMat.get(0, 1);
- aHomMat.Line1.Column3 = rMat.get(0, 2);
- aHomMat.Line1.Column4 = rMat.get(0, 3);
- aHomMat.Line2.Column1 = rMat.get(1, 0);
- aHomMat.Line2.Column2 = rMat.get(1, 1);
- aHomMat.Line2.Column3 = rMat.get(1, 2);
- aHomMat.Line2.Column4 = rMat.get(1, 3);
- aHomMat.Line3.Column1 = rMat.get(2, 0);
- aHomMat.Line3.Column2 = rMat.get(2, 1);
- aHomMat.Line3.Column3 = rMat.get(2, 2);
- aHomMat.Line3.Column4 = rMat.get(2, 3);
- aHomMat.Line4.Column1 = rMat.get(3, 0);
- aHomMat.Line4.Column2 = rMat.get(3, 1);
- aHomMat.Line4.Column3 = rMat.get(3, 2);
- aHomMat.Line4.Column4 = rMat.get(3, 3);
+ const basegfx::B3DHomMatrix& rMat = pObject->GetB3DTransform();
+ basegfx::tools::B3DHomMatrixToUnoHomogenMatrix(rMat, aHomMat);
rValue <<= aHomMat;
}
//----------------------------------------------------------------------
-#include <svx/svditer.hxx>
struct ImpRememberTransAndRect
{
@@ -332,107 +309,107 @@ bool Svx3DSceneObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformationsmatrix in das Objekt packen
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
- return true;
- break;
- }
- case OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY:
- {
- // set CameraGeometry at scene
- E3dScene* pScene = static_cast< E3dScene* >( mpObj.get() );
- drawing::CameraGeometry aCamGeo;
-
- if(rValue >>= aCamGeo)
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
- basegfx::B3DPoint aVRP(aCamGeo.vrp.PositionX, aCamGeo.vrp.PositionY, aCamGeo.vrp.PositionZ);
- basegfx::B3DVector aVPN(aCamGeo.vpn.DirectionX, aCamGeo.vpn.DirectionY, aCamGeo.vpn.DirectionZ);
- basegfx::B3DVector aVUP(aCamGeo.vup.DirectionX, aCamGeo.vup.DirectionY, aCamGeo.vup.DirectionZ);
-
- // rescue scene transformation
- ImpRememberTransAndRect aSceneTAR;
- aSceneTAR.maMat = pScene->GetTransform();
- aSceneTAR.maRect = pScene->GetSnapRect();
-
- // rescue object transformations
- SdrObjListIter aIter(*pScene->GetSubList(), IM_DEEPWITHGROUPS);
- List aObjTrans;
- while(aIter.IsMore())
- {
- E3dObject* p3DObj = (E3dObject*)aIter.Next();
- basegfx::B3DHomMatrix* pNew = new basegfx::B3DHomMatrix;
- *pNew = p3DObj->GetTransform();
- aObjTrans.Insert(pNew, LIST_APPEND);
- }
-
- // reset object transformations
- aIter.Reset();
- while(aIter.IsMore())
- {
- E3dObject* p3DObj = (E3dObject*)aIter.Next();
- p3DObj->NbcSetTransform(basegfx::B3DHomMatrix());
- }
-
- // reset scene transformation and make a complete recalc
- pScene->NbcSetTransform(basegfx::B3DHomMatrix());
-
- // fill old camera from new parameters
- Camera3D aCam(pScene->GetCamera());
- const basegfx::B3DRange& rVolume = pScene->GetBoundVolume();
- double fW = rVolume.getWidth();
- double fH = rVolume.getHeight();
-
- const SfxItemSet& rSceneSet = pScene->GetMergedItemSet();
- double fCamPosZ =
- (double)((const SfxUInt32Item&)rSceneSet.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
- double fCamFocal =
- (double)((const SfxUInt32Item&)rSceneSet.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
-
- aCam.SetAutoAdjustProjection(sal_False);
- aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
- basegfx::B3DPoint aLookAt;
- basegfx::B3DPoint aCamPos(0.0, 0.0, fCamPosZ);
- aCam.SetPosAndLookAt(aCamPos, aLookAt);
- aCam.SetFocalLength(fCamFocal / 100.0);
- aCam.SetDefaults(basegfx::B3DPoint(0.0, 0.0, fCamPosZ), aLookAt, fCamFocal / 100.0);
- aCam.SetDeviceWindow(Rectangle(0, 0, (long)fW, (long)fH));
-
- // set at scene
- pScene->SetCamera(aCam);
-
- // #91047# use imported VRP, VPN and VUP (if used)
- sal_Bool bVRPUsed(!aVRP.equal(basegfx::B3DPoint(0.0, 0.0, 1.0)));
- sal_Bool bVPNUsed(!aVPN.equal(basegfx::B3DVector(0.0, 0.0, 1.0)));
- sal_Bool bVUPUsed(!aVUP.equal(basegfx::B3DVector(0.0, 1.0, 0.0)));
-
- if(bVRPUsed || bVPNUsed || bVUPUsed)
- {
- pScene->GetCameraSet().SetViewportValues(aVRP, aVPN, aVUP);
- }
+ // Transformationsmatrix in das Objekt packen
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ return true;
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY:
+ {
+ // set CameraGeometry at scene
+ E3dScene* pScene = static_cast< E3dScene* >( mpObj.get() );
+ drawing::CameraGeometry aCamGeo;
- // set object transformations again at objects
- aIter.Reset();
- sal_uInt32 nIndex(0L);
- while(aIter.IsMore())
+ if(rValue >>= aCamGeo)
{
- E3dObject* p3DObj = (E3dObject*)aIter.Next();
- basegfx::B3DHomMatrix* pMat = (basegfx::B3DHomMatrix*)aObjTrans.GetObject(nIndex++);
- p3DObj->NbcSetTransform(*pMat);
- delete pMat;
+ basegfx::B3DPoint aVRP(aCamGeo.vrp.PositionX, aCamGeo.vrp.PositionY, aCamGeo.vrp.PositionZ);
+ basegfx::B3DVector aVPN(aCamGeo.vpn.DirectionX, aCamGeo.vpn.DirectionY, aCamGeo.vpn.DirectionZ);
+ basegfx::B3DVector aVUP(aCamGeo.vup.DirectionX, aCamGeo.vup.DirectionY, aCamGeo.vup.DirectionZ);
+
+ // rescue scene transformation
+ ImpRememberTransAndRect aSceneTAR;
+ aSceneTAR.maMat = pScene->GetB3DTransform();
+ aSceneTAR.maRect = sdr::legacy::GetSnapRect(*pScene);
+
+ // rescue object transformations
+ SdrObjListIter aIter(*pScene->getChildrenOfSdrObject(), IM_DEEPWITHGROUPS);
+ List aObjTrans;
+ while(aIter.IsMore())
+ {
+ E3dObject* p3DObj = (E3dObject*)aIter.Next();
+ basegfx::B3DHomMatrix* pNew = new basegfx::B3DHomMatrix;
+ *pNew = p3DObj->GetB3DTransform();
+ aObjTrans.Insert(pNew, LIST_APPEND);
+ }
+
+ // reset object transformations
+ aIter.Reset();
+ while(aIter.IsMore())
+ {
+ E3dObject* p3DObj = (E3dObject*)aIter.Next();
+ p3DObj->SetB3DTransform(basegfx::B3DHomMatrix());
+ }
+
+ // reset scene transformation and make a complete recalc
+ pScene->SetB3DTransform(basegfx::B3DHomMatrix());
+
+ // fill old camera from new parameters
+ Camera3D aCam(pScene->GetCamera());
+ const basegfx::B3DRange& rVolume = pScene->GetBoundVolume();
+ double fW = rVolume.getWidth();
+ double fH = rVolume.getHeight();
+
+ const SfxItemSet& rSceneSet = pScene->GetMergedItemSet();
+ double fCamPosZ =
+ (double)((const SfxUInt32Item&)rSceneSet.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
+ double fCamFocal =
+ (double)((const SfxUInt32Item&)rSceneSet.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
+
+ aCam.SetAutoAdjustProjection(sal_False);
+ aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH);
+ basegfx::B3DPoint aLookAt;
+ basegfx::B3DPoint aCamPos(0.0, 0.0, fCamPosZ);
+ aCam.SetPosAndLookAt(aCamPos, aLookAt);
+ aCam.SetFocalLength(fCamFocal / 100.0);
+ aCam.SetDefaults(basegfx::B3DPoint(0.0, 0.0, fCamPosZ), aLookAt, fCamFocal / 100.0);
+ aCam.SetDeviceWindow(Rectangle(0, 0, (long)fW, (long)fH));
+
+ // set at scene
+ pScene->SetCamera(aCam);
+
+ // #91047# use imported VRP, VPN and VUP (if used)
+ sal_Bool bVRPUsed(!aVRP.equal(basegfx::B3DPoint(0.0, 0.0, 1.0)));
+ sal_Bool bVPNUsed(!aVPN.equal(basegfx::B3DVector(0.0, 0.0, 1.0)));
+ sal_Bool bVUPUsed(!aVUP.equal(basegfx::B3DVector(0.0, 1.0, 0.0)));
+
+ if(bVRPUsed || bVPNUsed || bVUPUsed)
+ {
+ pScene->GetCameraSet().SetViewportValues(aVRP, aVPN, aVUP);
+ }
+
+ // set object transformations again at objects
+ aIter.Reset();
+ sal_uInt32 nIndex(0L);
+ while(aIter.IsMore())
+ {
+ E3dObject* p3DObj = (E3dObject*)aIter.Next();
+ basegfx::B3DHomMatrix* pMat = (basegfx::B3DHomMatrix*)aObjTrans.GetObject(nIndex++);
+ p3DObj->SetB3DTransform(*pMat);
+ delete pMat;
+ }
+
+ // set scene transformation again at scene
+ pScene->SetB3DTransform(aSceneTAR.maMat);
+ sdr::legacy::SetSnapRect(*pScene, aSceneTAR.maRect);
+
+ return true;
}
-
- // set scene transformation again at scene
- pScene->NbcSetTransform(aSceneTAR.maMat);
- pScene->NbcSetSnapRect(aSceneTAR.maRect);
-
- return true;
+ break;
}
- break;
- }
- default:
- return SvxShape::setPropertyValueImpl(rName, pProperty, rValue);
+ default:
+ return SvxShape::setPropertyValueImpl(rName, pProperty, rValue);
}
throw IllegalArgumentException();
@@ -444,40 +421,40 @@ bool Svx3DSceneObject::getPropertyValueImpl( const ::rtl::OUString& rName, const
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Objekt in eine homogene 4x4 Matrix packen
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
- break;
- }
- case OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY:
- {
- // get CameraGeometry from scene
- E3dScene* pScene = static_cast< E3dScene* >( mpObj.get() );
- drawing::CameraGeometry aCamGeo;
-
- // fill Vectors from scene camera
- B3dCamera& aCameraSet = pScene->GetCameraSet();
- basegfx::B3DPoint aVRP(aCameraSet.GetVRP());
- basegfx::B3DVector aVPN(aCameraSet.GetVPN());
- basegfx::B3DVector aVUP(aCameraSet.GetVUV());
-
- // transfer to structure
- aCamGeo.vrp.PositionX = aVRP.getX();
- aCamGeo.vrp.PositionY = aVRP.getY();
- aCamGeo.vrp.PositionZ = aVRP.getZ();
- aCamGeo.vpn.DirectionX = aVPN.getX();
- aCamGeo.vpn.DirectionY = aVPN.getY();
- aCamGeo.vpn.DirectionZ = aVPN.getZ();
- aCamGeo.vup.DirectionX = aVUP.getX();
- aCamGeo.vup.DirectionY = aVUP.getY();
- aCamGeo.vup.DirectionZ = aVUP.getZ();
-
- rValue <<= aCamGeo;
- break;
- }
- default:
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ // Objekt in eine homogene 4x4 Matrix packen
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY:
+ {
+ // get CameraGeometry from scene
+ E3dScene* pScene = static_cast< E3dScene* >( mpObj.get() );
+ drawing::CameraGeometry aCamGeo;
+
+ // fill Vectors from scene camera
+ B3dCamera& aCameraSet = pScene->GetCameraSet();
+ basegfx::B3DPoint aVRP(aCameraSet.GetVRP());
+ basegfx::B3DVector aVPN(aCameraSet.GetVPN());
+ basegfx::B3DVector aVUP(aCameraSet.GetVUV());
+
+ // transfer to structure
+ aCamGeo.vrp.PositionX = aVRP.getX();
+ aCamGeo.vrp.PositionY = aVRP.getY();
+ aCamGeo.vrp.PositionZ = aVRP.getZ();
+ aCamGeo.vpn.DirectionX = aVPN.getX();
+ aCamGeo.vpn.DirectionY = aVPN.getY();
+ aCamGeo.vpn.DirectionZ = aVPN.getZ();
+ aCamGeo.vup.DirectionX = aVUP.getX();
+ aCamGeo.vup.DirectionY = aVUP.getY();
+ aCamGeo.vup.DirectionZ = aVUP.getZ();
+
+ rValue <<= aCamGeo;
+ break;
+ }
+ default:
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
}
return true;
@@ -498,7 +475,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DSceneObject::getSupportedServiceNames()
//----------------------------------------------------------------------
Svx3DCubeObject::Svx3DCubeObject( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DCUBEOBJEKT), aSvxMapProvider.GetPropertySet(SVXMAP_3DCUBEOBJEKT, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DCUBEOBJEKT), aSvxMapProvider.GetPropertySet(SVXMAP_3DCUBEOBJEKT, GetGlobalDrawObjectItemPool()) )
{
}
@@ -514,50 +491,50 @@ bool Svx3DCubeObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformationsmatrix in das Objekt packen
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
- return true;
- break;
- }
- case OWN_ATTR_3D_VALUE_POSITION:
- {
- // Position in das Objekt packen
- drawing::Position3D aUnoPos;
- if( rValue >>= aUnoPos )
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
- basegfx::B3DPoint aPos(aUnoPos.PositionX, aUnoPos.PositionY, aUnoPos.PositionZ);
- static_cast< E3dCubeObj* >( mpObj.get() )->SetCubePos(aPos);
- return true;
+ // Transformationsmatrix in das Objekt packen
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ return true;
+ break;
}
- break;
- }
- case OWN_ATTR_3D_VALUE_SIZE:
- {
- // Groesse in das Objekt packen
- drawing::Direction3D aDirection;
- if( rValue >>= aDirection )
+ case OWN_ATTR_3D_VALUE_POSITION:
{
- basegfx::B3DVector aSize(aDirection.DirectionX, aDirection.DirectionY, aDirection.DirectionZ);
- static_cast< E3dCubeObj* >( mpObj.get() )->SetCubeSize(aSize);
- return true;
+ // Position in das Objekt packen
+ drawing::Position3D aUnoPos;
+ if( rValue >>= aUnoPos )
+ {
+ basegfx::B3DPoint aPos(aUnoPos.PositionX, aUnoPos.PositionY, aUnoPos.PositionZ);
+ static_cast< E3dCubeObj* >( mpObj.get() )->SetCubePos(aPos);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_3D_VALUE_POS_IS_CENTER:
- {
- sal_Bool bNew = sal_False;
- // sal_Bool bPosIsCenter in das Objekt packen
- if( rValue >>= bNew )
+ case OWN_ATTR_3D_VALUE_SIZE:
{
- static_cast< E3dCubeObj* >( mpObj.get() )->SetPosIsCenter(bNew);
- return true;
+ // Groesse in das Objekt packen
+ drawing::Direction3D aDirection;
+ if( rValue >>= aDirection )
+ {
+ basegfx::B3DVector aSize(aDirection.DirectionX, aDirection.DirectionY, aDirection.DirectionZ);
+ static_cast< E3dCubeObj* >( mpObj.get() )->SetCubeSize(aSize);
+ return true;
+ }
+ break;
}
- break;
- }
- default:
- return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
+ case OWN_ATTR_3D_VALUE_POS_IS_CENTER:
+ {
+ sal_Bool bNew = sal_False;
+ // sal_Bool bPosIsCenter in das Objekt packen
+ if( rValue >>= bNew )
+ {
+ static_cast< E3dCubeObj* >( mpObj.get() )->SetPosIsCenter(bNew);
+ return true;
+ }
+ break;
+ }
+ default:
+ return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
}
throw IllegalArgumentException();
@@ -569,45 +546,45 @@ bool Svx3DCubeObject::getPropertyValueImpl( const ::rtl::OUString& rName, const
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformation in eine homogene Matrix packen
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
- break;
- }
- case OWN_ATTR_3D_VALUE_POSITION:
- {
- // Position packen
- const basegfx::B3DPoint& rPos = ((E3dCubeObj*)mpObj.get())->GetCubePos();
- drawing::Position3D aPos;
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ // Transformation in eine homogene Matrix packen
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_POSITION:
+ {
+ // Position packen
+ const basegfx::B3DPoint& rPos = ((E3dCubeObj*)mpObj.get())->GetCubePos();
+ drawing::Position3D aPos;
- aPos.PositionX = rPos.getX();
- aPos.PositionY = rPos.getY();
- aPos.PositionZ = rPos.getZ();
+ aPos.PositionX = rPos.getX();
+ aPos.PositionY = rPos.getY();
+ aPos.PositionZ = rPos.getZ();
- rValue <<= aPos;
- break;
- }
- case OWN_ATTR_3D_VALUE_SIZE:
- {
- // Groesse packen
- const basegfx::B3DVector& rSize = static_cast<E3dCubeObj*>(mpObj.get())->GetCubeSize();
- drawing::Direction3D aDir;
+ rValue <<= aPos;
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_SIZE:
+ {
+ // Groesse packen
+ const basegfx::B3DVector& rSize = static_cast<E3dCubeObj*>(mpObj.get())->GetCubeSize();
+ drawing::Direction3D aDir;
- aDir.DirectionX = rSize.getX();
- aDir.DirectionY = rSize.getY();
- aDir.DirectionZ = rSize.getZ();
+ aDir.DirectionX = rSize.getX();
+ aDir.DirectionY = rSize.getY();
+ aDir.DirectionZ = rSize.getZ();
- rValue <<= aDir;
- break;
- }
- case OWN_ATTR_3D_VALUE_POS_IS_CENTER:
- {
- rValue <<= static_cast<E3dCubeObj*>(mpObj.get())->GetPosIsCenter();
- break;
- }
- default:
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+ rValue <<= aDir;
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_POS_IS_CENTER:
+ {
+ rValue <<= static_cast<E3dCubeObj*>(mpObj.get())->GetPosIsCenter();
+ break;
+ }
+ default:
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
}
return true;
@@ -629,7 +606,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DCubeObject::getSupportedServiceNames()
//----------------------------------------------------------------------
Svx3DSphereObject::Svx3DSphereObject( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DSPHEREOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DSPHEREOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DSPHEREOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DSPHEREOBJECT, GetGlobalDrawObjectItemPool()) )
{
}
@@ -644,41 +621,41 @@ bool Svx3DSphereObject::setPropertyValueImpl( const ::rtl::OUString& rName, cons
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformationsmatrix in das Objekt packen
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
- return true;
- break;
- }
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ // Transformationsmatrix in das Objekt packen
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ return true;
+ break;
+ }
- case OWN_ATTR_3D_VALUE_POSITION:
- {
- // Position in das Objekt packen
- drawing::Position3D aUnoPos;
- if( rValue >>= aUnoPos )
+ case OWN_ATTR_3D_VALUE_POSITION:
{
- basegfx::B3DPoint aPos(aUnoPos.PositionX, aUnoPos.PositionY, aUnoPos.PositionZ);
- static_cast<E3dSphereObj*>(mpObj.get())->SetCenter(aPos);
- return true;
+ // Position in das Objekt packen
+ drawing::Position3D aUnoPos;
+ if( rValue >>= aUnoPos )
+ {
+ basegfx::B3DPoint aPos(aUnoPos.PositionX, aUnoPos.PositionY, aUnoPos.PositionZ);
+ static_cast<E3dSphereObj*>(mpObj.get())->SetCenter(aPos);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_3D_VALUE_SIZE:
- {
- // Groesse in das Objekt packen
- drawing::Direction3D aDir;
- if( rValue >>= aDir )
+ case OWN_ATTR_3D_VALUE_SIZE:
{
- basegfx::B3DVector aPos(aDir.DirectionX, aDir.DirectionY, aDir.DirectionZ);
- static_cast<E3dSphereObj*>(mpObj.get())->SetSize(aPos);
- return true;
+ // Groesse in das Objekt packen
+ drawing::Direction3D aDir;
+ if( rValue >>= aDir )
+ {
+ basegfx::B3DVector aPos(aDir.DirectionX, aDir.DirectionY, aDir.DirectionZ);
+ static_cast<E3dSphereObj*>(mpObj.get())->SetSize(aPos);
+ return true;
+ }
+ break;
}
- break;
- }
- default:
- return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
+ default:
+ return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
}
throw IllegalArgumentException();
@@ -690,40 +667,40 @@ bool Svx3DSphereObject::getPropertyValueImpl( const ::rtl::OUString& rName, cons
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformation in eine homogene Matrix packen
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
- break;
- }
- case OWN_ATTR_3D_VALUE_POSITION:
- {
- // Position packen
- const basegfx::B3DPoint& rPos = ((E3dSphereObj*)mpObj.get())->Center();
- drawing::Position3D aPos;
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ // Transformation in eine homogene Matrix packen
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_POSITION:
+ {
+ // Position packen
+ const basegfx::B3DPoint& rPos = ((E3dSphereObj*)mpObj.get())->Center();
+ drawing::Position3D aPos;
- aPos.PositionX = rPos.getX();
- aPos.PositionY = rPos.getY();
- aPos.PositionZ = rPos.getZ();
+ aPos.PositionX = rPos.getX();
+ aPos.PositionY = rPos.getY();
+ aPos.PositionZ = rPos.getZ();
- rValue <<= aPos;
- break;
- }
- case OWN_ATTR_3D_VALUE_SIZE:
- {
- // Groesse packen
- const basegfx::B3DVector& rSize = ((E3dSphereObj*)mpObj.get())->Size();
- drawing::Direction3D aDir;
+ rValue <<= aPos;
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_SIZE:
+ {
+ // Groesse packen
+ const basegfx::B3DVector& rSize = ((E3dSphereObj*)mpObj.get())->Size();
+ drawing::Direction3D aDir;
- aDir.DirectionX = rSize.getX();
- aDir.DirectionY = rSize.getY();
- aDir.DirectionZ = rSize.getZ();
+ aDir.DirectionX = rSize.getX();
+ aDir.DirectionY = rSize.getY();
+ aDir.DirectionZ = rSize.getZ();
- rValue <<= aDir;
- break;
- }
- default:
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+ rValue <<= aDir;
+ break;
+ }
+ default:
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
}
return true;
@@ -745,7 +722,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DSphereObject::getSupportedServiceNames()
//----------------------------------------------------------------------
Svx3DLatheObject::Svx3DLatheObject( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DLATHEOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DLATHEOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DLATHEOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DLATHEOBJECT, GetGlobalDrawObjectItemPool()) )
{
}
@@ -763,82 +740,14 @@ bool PolyPolygonShape3D_to_B3dPolyPolygon(
if( !(rValue >>= aSourcePolyPolygon) )
return false;
- sal_Int32 nOuterSequenceCount = aSourcePolyPolygon.SequenceX.getLength();
- if(nOuterSequenceCount != aSourcePolyPolygon.SequenceY.getLength() || nOuterSequenceCount != aSourcePolyPolygon.SequenceZ.getLength())
- return false;
-
- drawing::DoubleSequence* pInnerSequenceX = aSourcePolyPolygon.SequenceX.getArray();
- drawing::DoubleSequence* pInnerSequenceY = aSourcePolyPolygon.SequenceY.getArray();
- drawing::DoubleSequence* pInnerSequenceZ = aSourcePolyPolygon.SequenceZ.getArray();
- for(sal_Int32 a(0L);a<nOuterSequenceCount;a++)
- {
- sal_Int32 nInnerSequenceCount = pInnerSequenceX->getLength();
- if(nInnerSequenceCount != pInnerSequenceY->getLength() || nInnerSequenceCount != pInnerSequenceZ->getLength())
- {
- return false;
- }
- basegfx::B3DPolygon aNewPolygon;
- double* pArrayX = pInnerSequenceX->getArray();
- double* pArrayY = pInnerSequenceY->getArray();
- double* pArrayZ = pInnerSequenceZ->getArray();
- for(sal_Int32 b(0L);b<nInnerSequenceCount;b++)
- {
- aNewPolygon.append(basegfx::B3DPoint(*pArrayX++,*pArrayY++,*pArrayZ++));
- }
- pInnerSequenceX++;
- pInnerSequenceY++;
- pInnerSequenceZ++;
-
- // #i101520# correction is needed for imported polygons of old format,
- // see callers
- if(bCorrectPolygon)
- {
- basegfx::tools::checkClosed(aNewPolygon);
- }
-
- rResultPolygon.append(aNewPolygon);
- }
+ rResultPolygon = basegfx::tools::UnoPolyPolygonShape3DToB3DPolyPolygon(aSourcePolyPolygon, bCorrectPolygon);
return true;
}
-static void B3dPolyPolygon_to_PolyPolygonShape3D( const basegfx::B3DPolyPolygon& rSourcePolyPolygon, Any& rValue )
+void B3dPolyPolygon_to_PolyPolygonShape3D( const basegfx::B3DPolyPolygon& rSourcePolyPolygon, Any& rValue )
{
drawing::PolyPolygonShape3D aRetval;
- aRetval.SequenceX.realloc(rSourcePolyPolygon.count());
- aRetval.SequenceY.realloc(rSourcePolyPolygon.count());
- aRetval.SequenceZ.realloc(rSourcePolyPolygon.count());
- drawing::DoubleSequence* pOuterSequenceX = aRetval.SequenceX.getArray();
- drawing::DoubleSequence* pOuterSequenceY = aRetval.SequenceY.getArray();
- drawing::DoubleSequence* pOuterSequenceZ = aRetval.SequenceZ.getArray();
- for(sal_uInt32 a(0L);a<rSourcePolyPolygon.count();a++)
- {
- const basegfx::B3DPolygon aPoly(rSourcePolyPolygon.getB3DPolygon(a));
- sal_Int32 nPointCount(aPoly.count());
- if(aPoly.isClosed()) nPointCount++;
- pOuterSequenceX->realloc(nPointCount);
- pOuterSequenceY->realloc(nPointCount);
- pOuterSequenceZ->realloc(nPointCount);
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
- for(sal_uInt32 b(0L);b<aPoly.count();b++)
- {
- const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(b));
- *pInnerSequenceX++ = aPoint.getX();
- *pInnerSequenceY++ = aPoint.getY();
- *pInnerSequenceZ++ = aPoint.getZ();
- }
- if(aPoly.isClosed())
- {
- const basegfx::B3DPoint aPoint(aPoly.getB3DPoint(0L));
- *pInnerSequenceX++ = aPoint.getX();
- *pInnerSequenceY++ = aPoint.getY();
- *pInnerSequenceZ++ = aPoint.getZ();
- }
- pOuterSequenceX++;
- pOuterSequenceY++;
- pOuterSequenceZ++;
- }
+ basegfx::tools::B3DPolyPolygonToUnoPolyPolygonShape3D(rSourcePolyPolygon, aRetval);
rValue <<= aRetval;
}
@@ -848,43 +757,43 @@ bool Svx3DLatheObject::setPropertyValueImpl( const ::rtl::OUString& rName, const
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformationsmatrix in das Objekt packen
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
- return true;
- break;
- }
- case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
- {
- // Polygondefinition in das Objekt packen
- basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
-
- // #i101520# Probably imported
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
- // #105127# SetPolyPoly3D sets the Svx3DVerticalSegmentsItem to the number
- // of points of the polygon. Thus, value gets lost. To avoid this, rescue
- // item here and re-set after setting the polygon.
- const sal_uInt32 nPrevVerticalSegs(static_cast<E3dLatheObj*>(mpObj.get())->GetVerticalSegments());
-
- // Polygon setzen
- const basegfx::B3DHomMatrix aIdentity;
- const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
- static_cast<E3dLatheObj*>(mpObj.get())->SetPolyPoly2D(aB2DPolyPolygon);
- const sal_uInt32 nPostVerticalSegs(static_cast<E3dLatheObj*>(mpObj.get())->GetVerticalSegments());
-
- if(nPrevVerticalSegs != nPostVerticalSegs)
+ // Transformationsmatrix in das Objekt packen
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ return true;
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
+ {
+ // Polygondefinition in das Objekt packen
+ basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
+
+ // #i101520# Probably imported
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
{
- // restore the vertical segment count
- static_cast<E3dLatheObj*>(mpObj.get())->SetMergedItem(Svx3DVerticalSegmentsItem(nPrevVerticalSegs));
+ // #105127# SetPolyPoly3D sets the 3DVerticalSegments to the number
+ // of points of the polygon. Thus, value gets lost. To avoid this, rescue
+ // item here and re-set after setting the polygon.
+ const sal_uInt32 nPrevVerticalSegs(static_cast<E3dLatheObj*>(mpObj.get())->GetVerticalSegments());
+
+ // Polygon setzen
+ const basegfx::B3DHomMatrix aIdentity;
+ const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
+ static_cast<E3dLatheObj*>(mpObj.get())->SetPolyPoly2D(aB2DPolyPolygon);
+ const sal_uInt32 nPostVerticalSegs(static_cast<E3dLatheObj*>(mpObj.get())->GetVerticalSegments());
+
+ if(nPrevVerticalSegs != nPostVerticalSegs)
+ {
+ // restore the vertical segment count
+ static_cast<E3dLatheObj*>(mpObj.get())->SetMergedItem(SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nPrevVerticalSegs));
+ }
+ return true;
}
- return true;
+ break;
}
- break;
- }
- default:
- return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
+ default:
+ return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
}
throw IllegalArgumentException();
@@ -895,43 +804,25 @@ bool Svx3DLatheObject::getPropertyValueImpl( const ::rtl::OUString& rName, const
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformation in eine homogene Matrix packen
- drawing::HomogenMatrix aHomMat;
- basegfx::B3DHomMatrix aMat = static_cast<E3dObject*>(mpObj.get())->GetTransform();
-
- // pack evtl. transformed matrix to output
- aHomMat.Line1.Column1 = aMat.get(0, 0);
- aHomMat.Line1.Column2 = aMat.get(0, 1);
- aHomMat.Line1.Column3 = aMat.get(0, 2);
- aHomMat.Line1.Column4 = aMat.get(0, 3);
- aHomMat.Line2.Column1 = aMat.get(1, 0);
- aHomMat.Line2.Column2 = aMat.get(1, 1);
- aHomMat.Line2.Column3 = aMat.get(1, 2);
- aHomMat.Line2.Column4 = aMat.get(1, 3);
- aHomMat.Line3.Column1 = aMat.get(2, 0);
- aHomMat.Line3.Column2 = aMat.get(2, 1);
- aHomMat.Line3.Column3 = aMat.get(2, 2);
- aHomMat.Line3.Column4 = aMat.get(2, 3);
- aHomMat.Line4.Column1 = aMat.get(3, 0);
- aHomMat.Line4.Column2 = aMat.get(3, 1);
- aHomMat.Line4.Column3 = aMat.get(3, 2);
- aHomMat.Line4.Column4 = aMat.get(3, 3);
-
- rValue <<= aHomMat;
- break;
- }
- case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
- {
- const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dLatheObj*>(mpObj.get())->GetPolyPoly2D();
- const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ // pack Transformation to a homogen Matrix
+ drawing::HomogenMatrix aHomMat;
+ basegfx::B3DHomMatrix aMat = static_cast<E3dObject*>(mpObj.get())->GetB3DTransform();
+ basegfx::tools::B3DHomMatrixToUnoHomogenMatrix(aMat, aHomMat);
+ rValue <<= aHomMat;
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
+ {
+ const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dLatheObj*>(mpObj.get())->GetPolyPoly2D();
+ const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
- B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon, rValue);
- break;
- }
- default:
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+ B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon, rValue);
+ break;
+ }
+ default:
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
}
return true;
@@ -952,7 +843,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DLatheObject::getSupportedServiceNames()
***********************************************************************/
Svx3DExtrudeObject::Svx3DExtrudeObject( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DEXTRUDEOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DEXTRUDEOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DEXTRUDEOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DEXTRUDEOBJECT, GetGlobalDrawObjectItemPool()) )
{
}
@@ -967,32 +858,32 @@ bool Svx3DExtrudeObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformationsmatrix in das Objekt packen
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
- return true;
- break;
- }
-
- case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
- {
- // Polygondefinition in das Objekt packen
- basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ // Transformationsmatrix in das Objekt packen
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ return true;
+ break;
+ }
- // #i101520# Probably imported
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
+ case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
{
- // Polygon setzen
- const basegfx::B3DHomMatrix aIdentity;
- const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
- static_cast<E3dExtrudeObj*>(mpObj.get())->SetExtrudePolygon(aB2DPolyPolygon);
- return true;
+ // Polygondefinition in das Objekt packen
+ basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
+
+ // #i101520# Probably imported
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, true ) )
+ {
+ // Polygon setzen
+ const basegfx::B3DHomMatrix aIdentity;
+ const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
+ static_cast<E3dExtrudeObj*>(mpObj.get())->SetExtrudePolygon(aB2DPolyPolygon);
+ return true;
+ }
+ break;
}
- break;
- }
- default:
- return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
+ default:
+ return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
}
throw IllegalArgumentException();
@@ -1004,45 +895,27 @@ bool Svx3DExtrudeObject::getPropertyValueImpl( const ::rtl::OUString& rName, con
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformation in eine homogene Matrix packen
- drawing::HomogenMatrix aHomMat;
- basegfx::B3DHomMatrix aMat = ((E3dObject*)mpObj.get())->GetTransform();
-
- // pack evtl. transformed matrix to output
- aHomMat.Line1.Column1 = aMat.get(0, 0);
- aHomMat.Line1.Column2 = aMat.get(0, 1);
- aHomMat.Line1.Column3 = aMat.get(0, 2);
- aHomMat.Line1.Column4 = aMat.get(0, 3);
- aHomMat.Line2.Column1 = aMat.get(1, 0);
- aHomMat.Line2.Column2 = aMat.get(1, 1);
- aHomMat.Line2.Column3 = aMat.get(1, 2);
- aHomMat.Line2.Column4 = aMat.get(1, 3);
- aHomMat.Line3.Column1 = aMat.get(2, 0);
- aHomMat.Line3.Column2 = aMat.get(2, 1);
- aHomMat.Line3.Column3 = aMat.get(2, 2);
- aHomMat.Line3.Column4 = aMat.get(2, 3);
- aHomMat.Line4.Column1 = aMat.get(3, 0);
- aHomMat.Line4.Column2 = aMat.get(3, 1);
- aHomMat.Line4.Column3 = aMat.get(3, 2);
- aHomMat.Line4.Column4 = aMat.get(3, 3);
-
- rValue <<= aHomMat;
- break;
- }
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ // pack Transformation to a homogen Matrix
+ drawing::HomogenMatrix aHomMat;
+ basegfx::B3DHomMatrix aMat = ((E3dObject*)mpObj.get())->GetB3DTransform();
+ basegfx::tools::B3DHomMatrixToUnoHomogenMatrix(aMat, aHomMat);
+ rValue <<= aHomMat;
+ break;
+ }
- case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
- {
- // Polygondefinition packen
- const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dExtrudeObj*>(mpObj.get())->GetExtrudePolygon();
- const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
+ case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
+ {
+ // Polygondefinition packen
+ const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dExtrudeObj*>(mpObj.get())->GetExtrudePolygon();
+ const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
- B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon, rValue);
- break;
- }
- default:
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+ B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon, rValue);
+ break;
+ }
+ default:
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
}
return true;
@@ -1064,7 +937,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DExtrudeObject::getSupportedServiceNames(
//----------------------------------------------------------------------
Svx3DPolygonObject::Svx3DPolygonObject( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DPOLYGONOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DPOLYGONOBJECT, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_3DPOLYGONOBJECT), aSvxMapProvider.GetPropertySet(SVXMAP_3DPOLYGONOBJECT, GetGlobalDrawObjectItemPool()) )
{
}
@@ -1078,70 +951,70 @@ bool Svx3DPolygonObject::setPropertyValueImpl( const ::rtl::OUString& rName, con
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- // Transformationsmatrix in das Objekt packen
- if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
- return true;
- break;
- }
-
- case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
- {
- // Polygondefinition in das Objekt packen
- basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
-
- // #i101520# Direct API data (e.g. from chart)
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
{
- // Polygon setzen
- static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyPolygon3D(aNewB3DPolyPolygon);
- return true;
+ // Transformationsmatrix in das Objekt packen
+ if( ConvertHomogenMatrixToObject( static_cast< E3dObject* >( mpObj.get() ), rValue ) )
+ return true;
+ break;
}
- break;
- }
- case OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D:
- {
- // Normalendefinition in das Objekt packen
- basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- // #i101520# Direct API data (e.g. from chart)
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
+ case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
{
- // Polygon setzen
- static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyNormals3D(aNewB3DPolyPolygon);
- return true;
+ // Polygondefinition in das Objekt packen
+ basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
+ {
+ // Polygon setzen
+ static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyPolygon3D(aNewB3DPolyPolygon);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D:
- {
- // Texturdefinition in das Objekt packen
- basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
+ case OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D:
+ {
+ // Normalendefinition in das Objekt packen
+ basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
- // #i101520# Direct API data (e.g. from chart)
- if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
+ {
+ // Polygon setzen
+ static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyNormals3D(aNewB3DPolyPolygon);
+ return true;
+ }
+ break;
+ }
+ case OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D:
{
- // Polygon setzen
- const basegfx::B3DHomMatrix aIdentity;
- const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
- static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyTexture2D(aB2DPolyPolygon);
- return true;
+ // Texturdefinition in das Objekt packen
+ basegfx::B3DPolyPolygon aNewB3DPolyPolygon;
+
+ // #i101520# Direct API data (e.g. from chart)
+ if( PolyPolygonShape3D_to_B3dPolyPolygon( rValue, aNewB3DPolyPolygon, false ) )
+ {
+ // Polygon setzen
+ const basegfx::B3DHomMatrix aIdentity;
+ const basegfx::B2DPolyPolygon aB2DPolyPolygon(basegfx::tools::createB2DPolyPolygonFromB3DPolyPolygon(aNewB3DPolyPolygon, aIdentity));
+ static_cast<E3dPolygonObj*>(mpObj.get())->SetPolyTexture2D(aB2DPolyPolygon);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_3D_VALUE_LINEONLY:
- {
- sal_Bool bNew = sal_False;
- if( rValue >>= bNew )
+ case OWN_ATTR_3D_VALUE_LINEONLY:
{
- static_cast<E3dPolygonObj*>(mpObj.get())->SetLineOnly(bNew);
- return true;
+ sal_Bool bNew = sal_False;
+ if( rValue >>= bNew )
+ {
+ static_cast<E3dPolygonObj*>(mpObj.get())->SetLineOnly(bNew);
+ return true;
+ }
+ break;
}
- break;
- }
- default:
- return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
+ default:
+ return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
}
throw IllegalArgumentException();
@@ -1152,42 +1025,42 @@ bool Svx3DPolygonObject::getPropertyValueImpl( const ::rtl::OUString& rName, con
{
switch( pProperty->nWID )
{
- case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
- {
- ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
- break;
- }
+ case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX:
+ {
+ ConvertObjectToHomogenMatric( static_cast< E3dObject* >( mpObj.get() ), rValue );
+ break;
+ }
- case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
- {
- B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyPolygon3D(),rValue);
- break;
- }
+ case OWN_ATTR_3D_VALUE_POLYPOLYGON3D:
+ {
+ B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyPolygon3D(),rValue);
+ break;
+ }
- case OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D:
- {
- B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyNormals3D(),rValue);
- break;
- }
+ case OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D:
+ {
+ B3dPolyPolygon_to_PolyPolygonShape3D(static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyNormals3D(),rValue);
+ break;
+ }
- case OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D:
- {
- // Texturdefinition packen
- const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyTexture2D();
- const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
+ case OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D:
+ {
+ // Texturdefinition packen
+ const basegfx::B2DPolyPolygon& rPolyPoly = static_cast<E3dPolygonObj*>(mpObj.get())->GetPolyTexture2D();
+ const basegfx::B3DPolyPolygon aB3DPolyPolygon(basegfx::tools::createB3DPolyPolygonFromB2DPolyPolygon(rPolyPoly));
- B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon,rValue);
- break;
- }
+ B3dPolyPolygon_to_PolyPolygonShape3D(aB3DPolyPolygon,rValue);
+ break;
+ }
- case OWN_ATTR_3D_VALUE_LINEONLY:
- {
- rValue <<= (sal_Bool)static_cast<E3dPolygonObj*>(mpObj.get())->GetLineOnly();
- break;
- }
+ case OWN_ATTR_3D_VALUE_LINEONLY:
+ {
+ rValue <<= (sal_Bool)static_cast<E3dPolygonObj*>(mpObj.get())->GetLineOnly();
+ break;
+ }
- default:
- return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
+ default:
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
}
return true;
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 48918c8ca7f7..6827985fcb52 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -27,9 +27,7 @@
#include <com/sun/star/embed/XLinkageSupport.hpp>
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
-
#define _SVX_USE_UNOGLOBALS_
-
#include <vcl/virdev.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdomedia.hxx>
@@ -42,25 +40,22 @@
#endif
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
-
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
-
#include <sot/storage.hxx>
#include <sot/exchange.hxx>
#include <svtools/FilterConfigItem.hxx>
-
#include <svx/svdmodel.hxx>
#include "shapeimpl.hxx"
-
#include <svx/unoshprp.hxx>
-
-#include "svx/unoapi.hxx"
+#include <svx/unoapi.hxx>
#include "svx/svdpagv.hxx"
#include "svx/svdview.hxx"
-#include "svx/svdglob.hxx"
-#include "svx/svdstr.hrc"
+#include <svx/svdlegacy.hxx>
+#include <svx/globaldrawitempool.hxx>
+#include <svx/svdglob.hxx>
+#include <svx/svdstr.hrc>
///////////////////////////////////////////////////////////////////////
@@ -80,7 +75,7 @@ using namespace ::com::sun::star::beans;
///////////////////////////////////////////////////////////////////////
SvxOle2Shape::SvxOle2Shape( SdrObject* pObject ) throw()
-: SvxShapeText( pObject, aSvxMapProvider.GetMap(SVXMAP_OLE2), aSvxMapProvider.GetPropertySet(SVXMAP_OLE2, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShapeText( pObject, aSvxMapProvider.GetMap(SVXMAP_OLE2), aSvxMapProvider.GetPropertySet(SVXMAP_OLE2, GetGlobalDrawObjectItemPool()) )
{
}
@@ -103,152 +98,113 @@ bool SvxOle2Shape::setPropertyValueImpl( const ::rtl::OUString& rName, const Sfx
{
switch( pProperty->nWID )
{
-/*
- case OWN_ATTR_CLSID:
- {
- OUString aCLSID;
- if( rValue >>= aCLSID )
+ case OWN_ATTR_OLE_VISAREA:
{
- // init an ole object with a global name
- SdrOle2Obj* pOle2 = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
- if( pOle2 )
+ // TODO/LATER: seems to make no sence for iconified object
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(mpObj.get());
+
+ if(pSdrOle2Obj)
{
- uno::Reference < embed::XEmbeddedObject > xObj = pOle2->GetObjRef();
- if ( !xObj.is() )
+ awt::Rectangle aVisArea;
+
+ if(rValue >>= aVisArea)
{
- SvGlobalName aClassName;
- if( aClassName.MakeId( aCLSID ) )
+ Size aTmp( aVisArea.X + aVisArea.Width, aVisArea.Y + aVisArea.Height );
+ uno::Reference < embed::XEmbeddedObject > xObj = pSdrOle2Obj->GetObjRef();
+ if( xObj.is() )
{
- SfxObjectShell* pPersist = mpModel->GetPersist();
- ::rtl::OUString aPersistName;
- Any aAny( getPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ) ) );
- aAny >>= aPersistName;
-
- //TODO/LATER: how to cope with creation failure?!
- xObj = pPersist->GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aPersistName );
- if( xObj.is() )
+ try
+ {
+ MapUnit aMapUnit( MAP_100TH_MM ); // the API handles with MAP_100TH_MM map mode
+ MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( embed::Aspects::MSOLE_CONTENT ) );
+ aTmp = OutputDevice::LogicToLogic( aTmp, aMapUnit, aObjUnit );
+ xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.Width(), aTmp.Height() ) );
+ }
+ catch( uno::Exception& )
{
- aAny <<= aPersistName;
- setPropertyValue( OUString::createFromAscii( UNO_NAME_OLE2_PERSISTNAME ), aAny );
- pOle2->SetObjRef( xObj );
-
- Rectangle aRect = pOle2->GetLogicRect();
- awt::Size aSz;
- Size aSize( pOle2->GetLogicRect().GetSize() );
- aSz.Width = aSize.Width();
- aSz.Height = aSize.Height();
- xObj->setVisualAreaSize( pOle2->GetAspect(), aSz );
+ OSL_ENSURE( sal_False, "Couldn't set the visual area for the object!\n" );
}
}
+
+ return true;
}
}
- return true;
+ break;
}
- break;
- }
-*/
- case OWN_ATTR_OLE_VISAREA:
- {
- // TODO/LATER: seems to make no sence for iconified object
-
- awt::Rectangle aVisArea;
- if( (rValue >>= aVisArea) && mpObj->ISA(SdrOle2Obj))
+ case OWN_ATTR_OLE_ASPECT:
{
- Size aTmp( aVisArea.X + aVisArea.Width, aVisArea.Y + aVisArea.Height );
- uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)mpObj.get())->GetObjRef();
- if( xObj.is() )
+ sal_Int64 nAspect = 0;
+ if( rValue >>= nAspect )
{
- try
- {
- MapUnit aMapUnit( MAP_100TH_MM ); // the API handles with MAP_100TH_MM map mode
- MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( embed::Aspects::MSOLE_CONTENT ) );
- aTmp = OutputDevice::LogicToLogic( aTmp, aMapUnit, aObjUnit );
- xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.Width(), aTmp.Height() ) );
- }
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Couldn't set the visual area for the object!\n" );
- }
+ static_cast<SdrOle2Obj*>(mpObj.get())->SetAspect( nAspect );
+ return true;
}
-
- return true;
+ break;
}
- break;
- }
- case OWN_ATTR_OLE_ASPECT:
- {
- sal_Int64 nAspect = 0;
- if( rValue >>= nAspect )
+ case OWN_ATTR_CLSID:
{
- static_cast<SdrOle2Obj*>(mpObj.get())->SetAspect( nAspect );
- return true;
- }
- break;
- }
- case OWN_ATTR_CLSID:
- {
- OUString aCLSID;
- if( rValue >>= aCLSID )
- {
- // init a ole object with a global name
- SvGlobalName aClassName;
- if( aClassName.MakeId( aCLSID ) )
+ OUString aCLSID;
+ if( rValue >>= aCLSID )
{
- if( createObject( aClassName ) )
- return true;
+ // init a ole object with a global name
+ SvGlobalName aClassName;
+ if( aClassName.MakeId( aCLSID ) )
+ {
+ if( createObject( aClassName ) )
+ return true;
+ }
}
+ break;
}
- break;
- }
- case OWN_ATTR_THUMBNAIL:
- {
- OUString aURL;
- if( rValue >>= aURL )
+ case OWN_ATTR_THUMBNAIL:
{
- GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
- static_cast<SdrOle2Obj*>(mpObj.get())->SetGraphic( &aGrafObj.GetGraphic() );
- return true;
+ OUString aURL;
+ if( rValue >>= aURL )
+ {
+ GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
+ static_cast<SdrOle2Obj*>(mpObj.get())->SetGraphic( &aGrafObj.GetGraphic() );
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_VALUE_GRAPHIC:
- {
- uno::Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
- if( xGraphic.is() )
+ case OWN_ATTR_VALUE_GRAPHIC:
{
- SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
- if( pOle )
+ uno::Reference< graphic::XGraphic > xGraphic( rValue, uno::UNO_QUERY );
+ if( xGraphic.is() )
{
- GraphicObject aGrafObj( xGraphic );
- const Graphic aGraphic( aGrafObj.GetGraphic() );
- pOle->SetGraphicToObj( aGraphic, rtl::OUString() );
+ SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
+ if( pOle )
+ {
+ GraphicObject aGrafObj( xGraphic );
+ const Graphic aGraphic( aGrafObj.GetGraphic() );
+ pOle->SetGraphicToObj( aGraphic, rtl::OUString() );
+ }
+ return true;
}
- return true;
+ break;
}
- break;
- }
- case OWN_ATTR_PERSISTNAME:
- {
- OUString aPersistName;
- if( rValue >>= aPersistName )
+ case OWN_ATTR_PERSISTNAME:
{
- static_cast<SdrOle2Obj*>(mpObj.get())->SetPersistName( aPersistName );
- return true;
+ OUString aPersistName;
+ if( rValue >>= aPersistName )
+ {
+ static_cast<SdrOle2Obj*>(mpObj.get())->SetPersistName( aPersistName );
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_OLE_LINKURL:
- {
- OUString aLinkURL;
- if( rValue >>= aLinkURL )
+ case OWN_ATTR_OLE_LINKURL:
{
- createLink( aLinkURL );
- return true;
+ OUString aLinkURL;
+ if( rValue >>= aLinkURL )
+ {
+ createLink( aLinkURL );
+ return true;
+ }
+ break;
}
- break;
- }
- default:
- return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue );
+ default:
+ return SvxShape::setPropertyValueImpl( rName, pProperty, rValue );
}
throw IllegalArgumentException();
@@ -258,188 +214,185 @@ bool SvxOle2Shape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sfx
{
switch( pProperty->nWID )
{
- case OWN_ATTR_CLSID:
- {
- OUString aCLSID;
- SvGlobalName aClassName = GetClassName_Impl(aCLSID);
- rValue <<= aCLSID;
- break;
- }
+ case OWN_ATTR_CLSID:
+ {
+ OUString aCLSID;
+ SvGlobalName aClassName = GetClassName_Impl(aCLSID);
+ rValue <<= aCLSID;
+ break;
+ }
- case OWN_ATTR_INTERNAL_OLE:
- {
- rtl::OUString sCLSID;
- rValue <<= SotExchange::IsInternal( GetClassName_Impl(sCLSID) );
- break;
- }
+ case OWN_ATTR_INTERNAL_OLE:
+ {
+ rtl::OUString sCLSID;
+ rValue <<= SotExchange::IsInternal( GetClassName_Impl(sCLSID) );
+ break;
+ }
- case OWN_ATTR_METAFILE:
- {
- SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(mpObj.get());
- if( pObj )
+ case OWN_ATTR_METAFILE:
{
- Graphic* pGraphic = pObj->GetGraphic();
- if( pGraphic )
+ SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(mpObj.get());
+ if( pObj )
{
- sal_Bool bIsWMF = sal_False;
- if ( pGraphic->IsLink() )
+ Graphic* pGraphic = pObj->GetGraphic();
+ if( pGraphic )
{
- GfxLink aLnk = pGraphic->GetLink();
- if ( aLnk.GetType() == GFX_LINK_TYPE_NATIVE_WMF )
+ sal_Bool bIsWMF = sal_False;
+ if ( pGraphic->IsLink() )
{
- bIsWMF = sal_True;
- uno::Sequence<sal_Int8> aSeq((sal_Int8*)aLnk.GetData(), (sal_Int32) aLnk.GetDataSize());
+ GfxLink aLnk = pGraphic->GetLink();
+ if ( aLnk.GetType() == GFX_LINK_TYPE_NATIVE_WMF )
+ {
+ bIsWMF = sal_True;
+ uno::Sequence<sal_Int8> aSeq((sal_Int8*)aLnk.GetData(), (sal_Int32) aLnk.GetDataSize());
+ rValue <<= aSeq;
+ }
+ }
+ if ( !bIsWMF )
+ {
+ // #119735# just use GetGDIMetaFile, it will create a bufferd version of contained bitmap now automatically
+ GDIMetaFile aMtf(pObj->GetGraphic()->GetGDIMetaFile());
+ SvMemoryStream aDestStrm( 65535, 65535 );
+ ConvertGDIMetaFileToWMF( aMtf, aDestStrm, NULL, sal_False );
+ const uno::Sequence<sal_Int8> aSeq(
+ static_cast< const sal_Int8* >(aDestStrm.GetData()),
+ aDestStrm.GetEndOfData());
rValue <<= aSeq;
}
}
- if ( !bIsWMF )
- {
- // #119735# just use GetGDIMetaFile, it will create a bufferd version of contained bitmap now automatically
- GDIMetaFile aMtf(pObj->GetGraphic()->GetGDIMetaFile());
- SvMemoryStream aDestStrm( 65535, 65535 );
- ConvertGDIMetaFileToWMF( aMtf, aDestStrm, NULL, sal_False );
- const uno::Sequence<sal_Int8> aSeq(
- static_cast< const sal_Int8* >(aDestStrm.GetData()),
- aDestStrm.GetEndOfData());
- rValue <<= aSeq;
- }
}
+ else
+ {
+ rValue = GetBitmap( sal_True );
+ }
+ break;
}
- else
+
+ case OWN_ATTR_OLE_VISAREA:
{
- rValue = GetBitmap( sal_True );
+ awt::Rectangle aVisArea;
+ SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(mpObj.get());
+
+ if( pSdrOle2Obj )
+ {
+ MapMode aMapMode( MAP_100TH_MM ); // the API uses this map mode
+ Size aTmp = pSdrOle2Obj->GetOrigObjSize( &aMapMode ); // get the size in the requested map mode
+ aVisArea = awt::Rectangle( 0, 0, aTmp.Width(), aTmp.Height() );
+ }
+
+ rValue <<= aVisArea;
+ break;
}
- break;
- }
- case OWN_ATTR_OLE_VISAREA:
- {
- awt::Rectangle aVisArea;
- if( mpObj->ISA(SdrOle2Obj))
+ case OWN_ATTR_OLESIZE:
{
- MapMode aMapMode( MAP_100TH_MM ); // the API uses this map mode
- Size aTmp = ((SdrOle2Obj*)mpObj.get())->GetOrigObjSize( &aMapMode ); // get the size in the requested map mode
- aVisArea = awt::Rectangle( 0, 0, aTmp.Width(), aTmp.Height() );
+ Size aTmp( static_cast<SdrOle2Obj*>(mpObj.get())->GetOrigObjSize() );
+ rValue <<= awt::Size( aTmp.Width(), aTmp.Height() );
+ break;
}
- rValue <<= aVisArea;
- break;
- }
-
- case OWN_ATTR_OLESIZE:
- {
- Size aTmp( static_cast<SdrOle2Obj*>(mpObj.get())->GetOrigObjSize() );
- rValue <<= awt::Size( aTmp.Width(), aTmp.Height() );
- break;
- }
-
- case OWN_ATTR_OLE_ASPECT:
- {
- rValue <<= static_cast<SdrOle2Obj*>(mpObj.get())->GetAspect();
- break;
- }
+ case OWN_ATTR_OLE_ASPECT:
+ {
+ rValue <<= static_cast<SdrOle2Obj*>(mpObj.get())->GetAspect();
+ break;
+ }
- case OWN_ATTR_OLEMODEL:
- case OWN_ATTR_OLE_EMBEDDED_OBJECT:
- case OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT:
- {
- SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>( mpObj.get() );
- if( pObj )
+ case OWN_ATTR_OLEMODEL:
+ case OWN_ATTR_OLE_EMBEDDED_OBJECT:
+ case OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT:
{
- uno::Reference < embed::XEmbeddedObject > xObj( pObj->GetObjRef() );
- if ( xObj.is()
- && ( pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT || svt::EmbeddedObjectRef::TryRunningState( xObj ) ) )
+ SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>( mpObj.get() );
+ if( pObj )
{
- // Discussed with CL fue to the before GetPaintingPageView
- // usage. Removed it, former fallback is used now
- if ( pProperty->nWID == OWN_ATTR_OLEMODEL || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT )
+ uno::Reference < embed::XEmbeddedObject > xObj( pObj->GetObjRef() );
+ if ( xObj.is()
+ && ( pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT || svt::EmbeddedObjectRef::TryRunningState( xObj ) ) )
{
+ // Discussed with CL fue to the before GetPaintingPageView
+ // usage. Removed it, former fallback is used now
+ if ( pProperty->nWID == OWN_ATTR_OLEMODEL || pProperty->nWID == OWN_ATTR_OLE_EMBEDDED_OBJECT )
+ {
#ifdef DBG_UTIL
- const sal_Bool bSuccess(pObj->AddOwnLightClient());
- OSL_ENSURE( bSuccess, "An object without client is provided!" );
+ const sal_Bool bSuccess(pObj->AddOwnLightClient());
+ OSL_ENSURE( bSuccess, "An object without client is provided!" );
#else
- pObj->AddOwnLightClient();
+ pObj->AddOwnLightClient();
#endif
- }
+ }
- if ( pProperty->nWID == OWN_ATTR_OLEMODEL )
- rValue <<= pObj->GetObjRef()->getComponent();
- else
- rValue <<= xObj;
+ if ( pProperty->nWID == OWN_ATTR_OLEMODEL )
+ rValue <<= pObj->GetObjRef()->getComponent();
+ else
+ rValue <<= xObj;
+ }
}
+ break;
}
- break;
- }
-
- case OWN_ATTR_VALUE_GRAPHIC:
- {
- uno::Reference< graphic::XGraphic > xGraphic;
- Graphic* pGraphic = static_cast<SdrOle2Obj*>( mpObj.get() )->GetGraphic();
- if( pGraphic )
- xGraphic = pGraphic->GetXGraphic();
- rValue <<= xGraphic;
- break;
- }
- case OWN_ATTR_THUMBNAIL:
- {
- OUString aURL;
- SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
- if( pOle )
+ case OWN_ATTR_VALUE_GRAPHIC:
{
- Graphic* pGraphic = pOle->GetGraphic();
-
- // if there isn't already a preview graphic set, check if we need to generate
- // one if model says so
- if( pGraphic == NULL && !pOle->IsEmptyPresObj() && mpModel->IsSaveOLEPreview() )
- pGraphic = pOle->GetGraphic();
-
+ uno::Reference< graphic::XGraphic > xGraphic;
+ Graphic* pGraphic = static_cast<SdrOle2Obj*>( mpObj.get() )->GetGraphic();
if( pGraphic )
- {
- GraphicObject aObj( *pGraphic );
- aURL = OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
- aURL += OUString::createFromAscii( aObj.GetUniqueID().GetBuffer() );
- }
+ xGraphic = pGraphic->GetXGraphic();
+ rValue <<= xGraphic;
+ break;
}
- rValue <<= aURL;
- break;
- }
- case OWN_ATTR_PERSISTNAME:
- {
- OUString aPersistName;
- SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
- if( pOle )
+ case OWN_ATTR_THUMBNAIL:
{
- aPersistName = pOle->GetPersistName();
- if( aPersistName.getLength() )
+ OUString aURL;
+ SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
+ if( pOle )
{
- ::comphelper::IEmbeddedHelper *pPersist = mpObj->GetModel()->GetPersist();
- if( (NULL == pPersist) || !pPersist->getEmbeddedObjectContainer().HasEmbeddedObject( pOle->GetPersistName() ) )
- aPersistName = OUString();
+ Graphic* pGraphic = pOle->GetGraphic();
+
+ if( pGraphic )
+ {
+ GraphicObject aObj( *pGraphic );
+ aURL = OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX));
+ aURL += OUString::createFromAscii( aObj.GetUniqueID().GetBuffer() );
+ }
}
+ rValue <<= aURL;
+ break;
}
+ case OWN_ATTR_PERSISTNAME:
+ {
+ OUString aPersistName;
+ SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
- rValue <<= aPersistName;
- break;
- }
- case OWN_ATTR_OLE_LINKURL:
- {
- OUString aLinkURL;
- SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
+ if( pOle )
+ {
+ aPersistName = pOle->GetPersistName();
+ if( aPersistName.getLength() )
+ {
+ ::comphelper::IEmbeddedHelper *pPersist = mpObj->getSdrModelFromSdrObject().GetPersist();
+ if( (NULL == pPersist) || !pPersist->getEmbeddedObjectContainer().HasEmbeddedObject( pOle->GetPersistName() ) )
+ aPersistName = OUString();
+ }
+ }
- if( pOle )
- {
- uno::Reference< embed::XLinkageSupport > xLink( pOle->GetObjRef(), uno::UNO_QUERY );
- if ( xLink.is() && xLink->isLink() )
- aLinkURL = xLink->getLinkURL();
+ rValue <<= aPersistName;
+ break;
}
+ case OWN_ATTR_OLE_LINKURL:
+ {
+ OUString aLinkURL;
+ SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( mpObj.get() );
- rValue <<= aLinkURL;
- break;
- }
- default:
- return SvxShapeText::getPropertyValueImpl( rName, pProperty, rValue );
+ if( pOle )
+ {
+ uno::Reference< embed::XLinkageSupport > xLink( pOle->GetObjRef(), uno::UNO_QUERY );
+ if ( xLink.is() && xLink->isLink() )
+ aLinkURL = xLink->getLinkURL();
+ }
+
+ rValue <<= aLinkURL;
+ break;
+ }
+ default:
+ return SvxShape::getPropertyValueImpl( rName, pProperty, rValue );
}
return true;
@@ -464,7 +417,7 @@ sal_Bool SvxOle2Shape::createObject( const SvGlobalName &aClassName )
uno::Reference < embed::XEmbeddedObject > xObj( pPersist->getEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aPersistName ) );
if( xObj.is() )
{
- Rectangle aRect = pOle2Obj->GetLogicRect();
+ Rectangle aRect = sdr::legacy::GetLogicRect(*pOle2Obj);
if ( aRect.GetWidth() == 100 && aRect.GetHeight() == 100 )
{
// TODO/LATER: is it possible that this method is used to create an iconified object?
@@ -476,12 +429,12 @@ sal_Bool SvxOle2Shape::createObject( const SvGlobalName &aClassName )
}
catch( embed::NoVisualAreaSizeException& )
{}
- pOle2Obj->SetLogicRect( aRect );
+ sdr::legacy::SetLogicRect(*pOle2Obj, aRect );
}
else
{
awt::Size aSz;
- Size aSize = pOle2Obj->GetLogicRect().GetSize();
+ Size aSize = sdr::legacy::GetLogicRect(*pOle2Obj).GetSize();
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( pOle2Obj->GetAspect(), aSz );
@@ -528,7 +481,7 @@ sal_Bool SvxOle2Shape::createLink( const ::rtl::OUString& aLinkURL )
if( xObj.is() )
{
- Rectangle aRect = pOle2Obj->GetLogicRect();
+ Rectangle aRect = sdr::legacy::GetLogicRect(*pOle2Obj);
if ( aRect.GetWidth() == 100 && aRect.GetHeight() == 100 )
{
// default size
@@ -539,12 +492,12 @@ sal_Bool SvxOle2Shape::createLink( const ::rtl::OUString& aLinkURL )
}
catch( embed::NoVisualAreaSizeException& )
{}
- pOle2Obj->SetLogicRect( aRect );
+ sdr::legacy::SetLogicRect(*pOle2Obj, aRect );
}
else
{
awt::Size aSz;
- Size aSize = pOle2Obj->GetLogicRect().GetSize();
+ Size aSize = sdr::legacy::GetLogicRect(*pOle2Obj).GetSize();
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( pOle2Obj->GetAspect(), aSz );
@@ -619,7 +572,7 @@ const SvGlobalName SvxOle2Shape::GetClassName_Impl(rtl::OUString& rHexCLSID)
///////////////////////////////////////////////////////////////////////
SvxAppletShape::SvxAppletShape( SdrObject* pObject ) throw()
-: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_APPLET), aSvxMapProvider.GetPropertySet(SVXMAP_APPLET, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_APPLET), aSvxMapProvider.GetPropertySet(SVXMAP_APPLET, GetGlobalDrawObjectItemPool()) )
{
SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.AppletShape" ) ) );
}
@@ -692,7 +645,7 @@ bool SvxAppletShape::getPropertyValueImpl( const ::rtl::OUString& rName, const S
///////////////////////////////////////////////////////////////////////
SvxPluginShape::SvxPluginShape( SdrObject* pObject ) throw()
-: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_PLUGIN), aSvxMapProvider.GetPropertySet(SVXMAP_PLUGIN, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_PLUGIN), aSvxMapProvider.GetPropertySet(SVXMAP_PLUGIN, GetGlobalDrawObjectItemPool()) )
{
SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.PluginShape" ) ) );
}
@@ -765,7 +718,7 @@ bool SvxPluginShape::getPropertyValueImpl( const ::rtl::OUString& rName, const S
///////////////////////////////////////////////////////////////////////
SvxFrameShape::SvxFrameShape( SdrObject* pObject ) throw()
-: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_FRAME), aSvxMapProvider.GetPropertySet(SVXMAP_FRAME, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxOle2Shape( pObject, aSvxMapProvider.GetMap(SVXMAP_FRAME), aSvxMapProvider.GetPropertySet(SVXMAP_FRAME, GetGlobalDrawObjectItemPool()) )
{
SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.FrameShape" ) ) );
}
@@ -840,7 +793,7 @@ bool SvxFrameShape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sf
***********************************************************************/
SvxMediaShape::SvxMediaShape( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_MEDIA), aSvxMapProvider.GetPropertySet(SVXMAP_MEDIA, SdrObject::GetGlobalDrawObjectItemPool()) )
+: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_MEDIA), aSvxMapProvider.GetPropertySet(SVXMAP_MEDIA, GetGlobalDrawObjectItemPool()) )
{
SetShapeType( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MediaShape" ) ) );
}
@@ -862,67 +815,67 @@ bool SvxMediaShape::setPropertyValueImpl( const ::rtl::OUString& rName, const Sf
switch( pProperty->nWID )
{
- case OWN_ATTR_MEDIA_URL:
- {
- OUString aURL;
- if( rValue >>= aURL )
+ case OWN_ATTR_MEDIA_URL:
{
- bOk = true;
- aItem.setURL( aURL );
+ OUString aURL;
+ if( rValue >>= aURL )
+ {
+ bOk = true;
+ aItem.setURL( aURL );
+ }
}
- }
- break;
-
- case( OWN_ATTR_MEDIA_LOOP ):
- {
- sal_Bool bLoop = sal_Bool();
+ break;
- if( rValue >>= bLoop )
+ case( OWN_ATTR_MEDIA_LOOP ):
{
- bOk = true;
- aItem.setLoop( bLoop );
- }
- }
- break;
+ sal_Bool bLoop = sal_Bool();
- case( OWN_ATTR_MEDIA_MUTE ):
- {
- sal_Bool bMute = sal_Bool();
+ if( rValue >>= bLoop )
+ {
+ bOk = true;
+ aItem.setLoop( bLoop );
+ }
+ }
+ break;
- if( rValue >>= bMute )
+ case( OWN_ATTR_MEDIA_MUTE ):
{
- bOk = true;
- aItem.setMute( bMute );
- }
- }
- break;
+ sal_Bool bMute = sal_Bool();
- case( OWN_ATTR_MEDIA_VOLUMEDB ):
- {
- sal_Int16 nVolumeDB = sal_Int16();
+ if( rValue >>= bMute )
+ {
+ bOk = true;
+ aItem.setMute( bMute );
+ }
+ }
+ break;
- if( rValue >>= nVolumeDB )
+ case( OWN_ATTR_MEDIA_VOLUMEDB ):
{
- bOk = true;
- aItem.setVolumeDB( nVolumeDB );
- }
- }
- break;
+ sal_Int16 nVolumeDB = sal_Int16();
- case( OWN_ATTR_MEDIA_ZOOM ):
- {
- ::com::sun::star::media::ZoomLevel eLevel;
+ if( rValue >>= nVolumeDB )
+ {
+ bOk = true;
+ aItem.setVolumeDB( nVolumeDB );
+ }
+ }
+ break;
- if( rValue >>= eLevel )
+ case( OWN_ATTR_MEDIA_ZOOM ):
{
- bOk = true;
- aItem.setZoom( eLevel );
+ ::com::sun::star::media::ZoomLevel eLevel;
+
+ if( rValue >>= eLevel )
+ {
+ bOk = true;
+ aItem.setZoom( eLevel );
+ }
}
- }
- break;
+ break;
- default:
- DBG_ERROR("SvxMediaShape::setPropertyValueImpl(), unknown argument!");
+ default:
+ DBG_ERROR("SvxMediaShape::setPropertyValueImpl(), unknown argument!");
}
if( bOk )
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index ea7eaab3bf26..9d057f6937ec 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -66,7 +66,6 @@
#include "svx/unoshtxt.hxx"
#include "svx/svdpage.hxx"
#include "svx/unoshprp.hxx"
-#include "svx/sxciaitm.hxx" // todo: remove
#include "svx/svdograf.hxx"
#include "svx/unoapi.hxx"
#include "svx/svdomeas.hxx"
@@ -92,16 +91,16 @@
#include <editeng/outlobj.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
-
#include <vector>
-
-// #i68523#
#include "svx/lathe3d.hxx"
#include "svx/extrud3d.hxx"
#include "unopolyhelper.hxx"
-
#include <comphelper/scopeguard.hxx>
#include <boost/bind.hpp>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/svdocirc.hxx>
+#include <svx/globaldrawitempool.hxx>
using ::rtl::OUString;
using namespace ::osl;
@@ -133,7 +132,7 @@ struct SvxShapeImpl
{
SvxShape& mrAntiImpl;
SfxItemSet* mpItemSet;
- sal_uInt32 mnObjId;
+ SvxShapeKind meSvxShapeKind;
SvxShapeMaster* mpMaster;
bool mbHasSdrObjectOwnership;
bool mbDisposing;
@@ -152,7 +151,7 @@ struct SvxShapeImpl
SvxShapeImpl( SvxShape& _rAntiImpl, ::osl::Mutex& _rMutex )
:mrAntiImpl( _rAntiImpl )
,mpItemSet( NULL )
- ,mnObjId( 0 )
+ ,meSvxShapeKind(SvxShapeKind_None)
,mpMaster( NULL )
,mbHasSdrObjectOwnership( false )
,mbDisposing( false )
@@ -195,23 +194,107 @@ protected:
}
};
+SvxShapeKind SdrObjectCreatorInventorToSvxShapeKind(sal_uInt16 nIdent, sal_uInt32 nInvent)
+{
+ switch(nInvent)
+ {
+ case FmFormInventor:
+ {
+ // forms are all OBJ_UNO
+ return SvxShapeKind_Control;
+ }
+ case E3dInventor:
+ {
+ // map 3D
+ switch(nIdent)
+ {
+ case E3D_SCENE_ID: return SvxShapeKind_3DScene;
+ case E3D_CUBEOBJ_ID: return SvxShapeKind_3DCube;
+ case E3D_SPHEREOBJ_ID: return SvxShapeKind_3DSphere;
+ case E3D_EXTRUDEOBJ_ID: return SvxShapeKind_3DExtrude;
+ case E3D_LATHEOBJ_ID: return SvxShapeKind_3DLathe;
+ case E3D_POLYGONOBJ_ID: return SvxShapeKind_3DPolygon;
+ }
+ }
+ case SdrInventor:
+ {
+ switch(nIdent)
+ {
+ // SdrObject, map
+ case OBJ_GRUP: return SvxShapeKind_Group;
+ case OBJ_RECT: return SvxShapeKind_Rectangle;
+ case OBJ_CIRC: return SvxShapeKind_Circle;
+ case OBJ_POLY: return SvxShapeKind_Path;
+ case OBJ_TEXT:
+ case OBJ_TITLETEXT:
+ case OBJ_OUTLINETEXT:
+ return SvxShapeKind_Text;
+ case OBJ_GRAF: return SvxShapeKind_Graphic;
+ case OBJ_OLE2: return SvxShapeKind_OLE2;
+ case OBJ_EDGE: return SvxShapeKind_Connector;
+ case OBJ_CAPTION: return SvxShapeKind_Caption;
+ case OBJ_PAGE: return SvxShapeKind_Page;
+ case OBJ_MEASURE: return SvxShapeKind_Measure;
+ case OBJ_FRAME: return SvxShapeKind_Frame;
+ case OBJ_UNO: return SvxShapeKind_Control;
+ case OBJ_CUSTOMSHAPE: return SvxShapeKind_Customshape;
+ case OBJ_MEDIA: return SvxShapeKind_Media;
+ case OBJ_TABLE: return SvxShapeKind_Table;
+ }
+ }
+ }
+
+ return SvxShapeKind_None;
+}
+
+void SvxShapeKindToSdrObjectCreatorInventor(SvxShapeKind aSvxShapeKind, sal_uInt16& nIdent, sal_uInt32& nInvent)
+{
+ switch(aSvxShapeKind)
+ {
+ case SvxShapeKind_None: nIdent = OBJ_NONE; nInvent = SdrInventor; break; // OBJ_NONE
+ case SvxShapeKind_Group: nIdent = OBJ_GRUP; nInvent = SdrInventor; break; // OBJ_GRUP
+ case SvxShapeKind_Rectangle: nIdent = OBJ_RECT; nInvent = SdrInventor; break; // OBJ_RECT
+ case SvxShapeKind_Circle: nIdent = OBJ_CIRC; nInvent = SdrInventor; break; // OBJ_CIRC
+ case SvxShapeKind_Path: nIdent = OBJ_POLY; nInvent = SdrInventor; break; // OBJ_POLY and removed old ones (OBJ_LINE, OBJ_PLIN, OBJ_PATHLINE, OBJ_PATHFILL, OBJ_FREELINE, OBJ_FREEFILL, OBJ_PATHPOLY, OBJ_PATHPLIN)
+ case SvxShapeKind_Text: nIdent = OBJ_TEXT; nInvent = SdrInventor; break; // OBJ_TEXT, OBJ_TITLETEXT, OBJ_OUTLINETEXT
+ case SvxShapeKind_Graphic: nIdent = OBJ_GRAF; nInvent = SdrInventor; break; // OBJ_GRAF
+ case SvxShapeKind_OLE2: nIdent = OBJ_OLE2; nInvent = SdrInventor; break; // OBJ_OLE2
+ case SvxShapeKind_Connector: nIdent = OBJ_EDGE; nInvent = SdrInventor; break; // OBJ_EDGE
+ case SvxShapeKind_Caption: nIdent = OBJ_CAPTION; nInvent = SdrInventor; break; // OBJ_CAPTION
+ case SvxShapeKind_Page: nIdent = OBJ_PAGE; nInvent = SdrInventor; break; // OBJ_PAGE
+ case SvxShapeKind_Measure: nIdent = OBJ_MEASURE; nInvent = SdrInventor; break; // OBJ_MEASURE
+ case SvxShapeKind_Frame: nIdent = OBJ_FRAME; nInvent = SdrInventor; break; // OBJ_FRAME
+ case SvxShapeKind_Control: nIdent = OBJ_UNO; nInvent = FmFormInventor; break; // OBJ_UNO
+ case SvxShapeKind_Customshape: nIdent = OBJ_CUSTOMSHAPE; nInvent = SdrInventor; break; // OBJ_CUSTOMSHAPE
+ case SvxShapeKind_Media: nIdent = OBJ_MEDIA; nInvent = SdrInventor; break; // OBJ_MEDIA
+ case SvxShapeKind_Table: nIdent = OBJ_TABLE; nInvent = SdrInventor; break; // OBJ_TABLE
+
+ case SvxShapeKind_Applet: nIdent = OBJ_OLE2; nInvent = SdrInventor; break; // OBJ_OLE2_APPLET but special SvxAppletShape
+ case SvxShapeKind_Plugin: nIdent = OBJ_OLE2; nInvent = SdrInventor; break; // OBJ_OLE2_PLUGIN but special SvxPluginShape
+
+ case SvxShapeKind_3DScene: nIdent = E3D_SCENE_ID; nInvent = E3dInventor; break; // E3D_SCENE_ID
+ case SvxShapeKind_3DCube: nIdent = E3D_CUBEOBJ_ID; nInvent = E3dInventor; break; // E3D_CUBEOBJ_ID
+ case SvxShapeKind_3DSphere: nIdent = E3D_SPHEREOBJ_ID; nInvent = E3dInventor; break; // E3D_SPHEREOBJ_ID
+ case SvxShapeKind_3DExtrude: nIdent = E3D_EXTRUDEOBJ_ID; nInvent = E3dInventor; break; // E3D_EXTRUDEOBJ_ID
+ case SvxShapeKind_3DLathe: nIdent = E3D_LATHEOBJ_ID; nInvent = E3dInventor; break; // E3D_LATHEOBJ_ID
+ case SvxShapeKind_3DPolygon: nIdent = E3D_POLYGONOBJ_ID; nInvent = E3dInventor; break; // E3D_POLYGONOBJ_ID
+ }
+}
+
/***********************************************************************
* class SvxShape *
***********************************************************************/
-DBG_NAME(SvxShape)
-
SvxShape::SvxShape( SdrObject* pObject ) throw()
: maSize(100,100)
, mpImpl( new SvxShapeImpl( *this, maMutex ) )
, mbIsMultiPropertyCall(false)
-, mpPropSet(aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE, SdrObject::GetGlobalDrawObjectItemPool()))
+, mpPropSet(aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE, GetGlobalDrawObjectItemPool()))
, maPropMapEntries(aSvxMapProvider.GetMap(SVXMAP_SHAPE))
, mpObj(pObject)
, mpModel(NULL)
, mnLockCount(0)
{
- DBG_CTOR(SvxShape,NULL);
impl_construct();
}
@@ -226,7 +309,6 @@ SvxShape::SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries,
, mpModel(NULL)
, mnLockCount(0)
{
- DBG_CTOR(SvxShape,NULL);
impl_construct();
}
@@ -235,13 +317,12 @@ SvxShape::SvxShape() throw()
: maSize(100,100)
, mpImpl( new SvxShapeImpl( *this, maMutex ) )
, mbIsMultiPropertyCall(false)
-, mpPropSet(aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE, SdrObject::GetGlobalDrawObjectItemPool()))
+, mpPropSet(aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE, GetGlobalDrawObjectItemPool()))
, maPropMapEntries(aSvxMapProvider.GetMap(SVXMAP_SHAPE))
, mpObj(NULL)
, mpModel(NULL)
, mnLockCount(0)
{
- DBG_CTOR(SvxShape,NULL);
impl_construct();
}
@@ -259,18 +340,18 @@ SvxShape::~SvxShape() throw()
mpImpl->mpMaster->dispose();
if ( mpObj.is() )
- mpObj->setUnoShape( NULL, SdrObject::GrantXShapeAccess() );
+ {
+ SetUnoShapeAtSdrObjectFromSvxShape(*mpObj.get(), 0);
+ }
if( HasSdrObjectOwnership() && mpObj.is() )
{
mpImpl->mbHasSdrObjectOwnership = false;
SdrObject* pObject = mpObj.get();
- SdrObject::Free( pObject );
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
delete mpImpl, mpImpl = NULL;
-
- DBG_DTOR(SvxShape,NULL);
}
//----------------------------------------------------------------------
@@ -293,16 +374,16 @@ bool SvxShape::HasSdrObjectOwnership() const
//----------------------------------------------------------------------
-void SvxShape::setShapeKind( sal_uInt32 nKind )
+void SvxShape::setSvxShapeKind(SvxShapeKind eKind)
{
- mpImpl->mnObjId = nKind;
+ mpImpl->meSvxShapeKind = eKind;
}
//----------------------------------------------------------------------
-sal_uInt32 SvxShape::getShapeKind() const
+SvxShapeKind SvxShape::getSvxShapeKind() const
{
- return mpImpl->mnObjId;
+ return mpImpl->meSvxShapeKind;
}
//----------------------------------------------------------------------
@@ -410,11 +491,11 @@ void SvxShape::impl_initFromSdrObject()
osl_incrementInterlockedCount( &m_refCount );
{
- mpObj->setUnoShape( *this, SdrObject::GrantXShapeAccess() );
+ SetUnoShapeAtSdrObjectFromSvxShape(*mpObj.get(), *this);
}
osl_decrementInterlockedCount( &m_refCount );
- mpModel = mpObj->GetModel();
+ mpModel = &mpObj->getSdrModelFromSdrObject();
// #i40944#
// Do not simply return when no model but do the type corrections
@@ -427,32 +508,7 @@ void SvxShape::impl_initFromSdrObject()
const sal_uInt32 nInventor = mpObj->GetObjInventor();
// is it one of ours (svx) ?
- if( nInventor == SdrInventor || nInventor == E3dInventor || nInventor == FmFormInventor )
- {
- if(nInventor == FmFormInventor)
- {
- mpImpl->mnObjId = OBJ_UNO;
- }
- else
- {
- mpImpl->mnObjId = mpObj->GetObjIdentifier();
- if( nInventor == E3dInventor )
- mpImpl->mnObjId |= E3D_INVENTOR_FLAG;
- }
-
- switch(mpImpl->mnObjId)
- {
- case OBJ_CCUT: // Kreisabschnitt
- case OBJ_CARC: // Kreisbogen
- case OBJ_SECT: // Kreissektor
- mpImpl->mnObjId = OBJ_CIRC;
- break;
-
- case E3D_SCENE_ID | E3D_INVENTOR_FLAG:
- mpImpl->mnObjId = E3D_POLYSCENE_ID | E3D_INVENTOR_FLAG;
- break;
- }
- }
+ mpImpl->meSvxShapeKind = SdrObjectCreatorInventorToSvxShapeKind(mpObj->GetObjIdentifier(), mpObj->GetObjInventor());
}
//----------------------------------------------------------------------
@@ -472,14 +528,13 @@ void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ )
if ( pCreatedObj != pNewObj )
// <--
{
- DBG_ASSERT( pNewObj->GetModel(), "no model for SdrObject?" );
// --> CL, OD 2005-07-19 #i52126#
mpImpl->mpCreatedObj = pNewObj;
// <--
- if( mpObj.is() && mpObj->GetModel() )
+ if( mpObj.is() )
{
- EndListening( *mpObj->GetModel() );
+ EndListening( mpObj->getSdrModelFromSdrObject() );
}
mpObj.reset( pNewObj );
@@ -492,15 +547,41 @@ void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ )
ObtainSettingsFromPropertySet( *mpPropSet );
- // save user call
- SdrObjUserCall* pUser = mpObj->GetUserCall();
- mpObj->SetUserCall(NULL);
+ // here the UserCall was rescured, resetted and restored after the calls
+ // to setPosition/setSize. This was done to suppress UserCall handling,
+ // thus this can be emulated by removing them temporarily
+ ::std::vector< SfxListener* > aOriginalListeners;
+
+ if(mpObj->HasListeners())
+ {
+ const sal_uInt16 nCount(mpObj->GetListenerCount());
+
+ for(sal_uInt16 a(0); a < nCount; a++)
+ {
+ SfxListener* pCandidate = mpObj->GetListener(a);
+
+ if(pCandidate)
+ {
+ aOriginalListeners.push_back(pCandidate);
+ }
+ }
+
+ for(sal_uInt32 b(0); b < aOriginalListeners.size(); b++)
+ {
+ aOriginalListeners[b]->EndListening(*mpObj.get());
+ }
+ }
setPosition( maPosition );
setSize( maSize );
- // restore user call after we set the initial size
- mpObj->SetUserCall( pUser );
+ if(aOriginalListeners.size())
+ {
+ for(sal_uInt32 b(0); b < aOriginalListeners.size(); b++)
+ {
+ aOriginalListeners[b]->StartListening(*mpObj.get());
+ }
+ }
// if this shape was already named, use this name
if( maShapeName.getLength() )
@@ -513,60 +594,52 @@ void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ )
//----------------------------------------------------------------------
-void SvxShape::ChangeModel( SdrModel* pNewModel )
+void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPoint& rPoint) const throw()
{
DBG_TESTSOLARMUTEX();
- if( mpObj.is() && mpObj->GetModel() )
+ if(mpModel)
{
- if( mpObj->GetModel() != pNewModel )
+ SfxMapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
{
- EndListening( *mpObj->GetModel() );
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ rPoint.setX( MM_TO_TWIPS( rPoint.getX() ) );
+ rPoint.setY( MM_TO_TWIPS( rPoint.getY() ) );
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("AW: Missing unit translation to PoolMetric!");
+ }
+ }
}
}
-
- // --> CL, OD 2005-07-19 #i52126# - always listen to new model
- if( pNewModel )
- {
- StartListening( *pNewModel );
- }
- // <--
-
- // HACK #i53696# ChangeModel should be virtual, but it isn't. can't change that for 2.0.1
- SvxShapeText* pShapeText = dynamic_cast< SvxShapeText* >( this );
- if( pShapeText )
- {
- SvxTextEditSource* pTextEditSource = dynamic_cast< SvxTextEditSource* >( pShapeText->GetEditSource() );
- if( pTextEditSource )
- pTextEditSource->ChangeModel( pNewModel );
- }
-
- mpModel = pNewModel;
-
- if( mpImpl->mpMaster )
- mpImpl->mpMaster->modelChanged( pNewModel );
}
//----------------------------------------------------------------------
-
-void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw()
+void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPoint& rPoint) const throw()
{
DBG_TESTSOLARMUTEX();
+ SfxMapUnit eMapUnit = SFX_MAPUNIT_100TH_MM;
if(mpModel)
{
- SfxMapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ eMapUnit = mpModel->GetItemPool().GetMetric(0);
if(eMapUnit != SFX_MAPUNIT_100TH_MM)
{
switch(eMapUnit)
{
case SFX_MAPUNIT_TWIP :
{
- rPoint.A() = MM_TO_TWIPS(rPoint.A());
- rPoint.B() = MM_TO_TWIPS(rPoint.B());
+ rPoint.setX( TWIPS_TO_MM( rPoint.getX() ) );
+ rPoint.setY( TWIPS_TO_MM( rPoint.getY() ) );
break;
}
default:
{
- DBG_ERROR("AW: Missing unit translation to PoolMetric!");
+ DBG_ERROR("AW: Missing unit translation to 100th mm!");
}
}
}
@@ -574,8 +647,8 @@ void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
-// --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
-void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+
+void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rMatrix) const throw()
{
DBG_TESTSOLARMUTEX();
if(mpModel)
@@ -587,25 +660,34 @@ void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon
{
case SFX_MAPUNIT_TWIP :
{
- basegfx::B2DHomMatrix aTransform;
- const double fMMToTWIPS(72.0 / 127.0);
-
- aTransform.scale(fMMToTWIPS, fMMToTWIPS);
- rPolyPolygon.transform(aTransform);
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate, fShearX;
+
+ rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ aScale.setX(MM_TO_TWIPS(aScale.getX()));
+ aScale.setY(MM_TO_TWIPS(aScale.getY()));
+ aTranslate.setX(MM_TO_TWIPS(aTranslate.getX()));
+ aTranslate.setY(MM_TO_TWIPS(aTranslate.getY()));
+
+ rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate);
break;
}
default:
{
- DBG_ERROR("Missing unit translation to PoolMetric!");
+ DBG_ERROR("AW: Missing unit translation to PoolMetric!");
}
}
}
}
}
-// <--
-//----------------------------------------------------------------------
-void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
+void SvxShape::ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rMatrix) const throw()
{
DBG_TESTSOLARMUTEX();
SfxMapUnit eMapUnit = SFX_MAPUNIT_100TH_MM;
@@ -618,8 +700,22 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
{
case SFX_MAPUNIT_TWIP :
{
- rPoint.A() = TWIPS_TO_MM(rPoint.A());
- rPoint.B() = TWIPS_TO_MM(rPoint.B());
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate, fShearX;
+
+ rMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ aScale.setX(TWIPS_TO_MM(aScale.getX()));
+ aScale.setY(TWIPS_TO_MM(aScale.getY()));
+ aTranslate.setX(TWIPS_TO_MM(aTranslate.getX()));
+ aTranslate.setY(TWIPS_TO_MM(aTranslate.getY()));
+
+ rMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aScale,
+ fShearX,
+ fRotate,
+ aTranslate);
break;
}
default:
@@ -632,12 +728,37 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
-// --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+
+void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+{
+ DBG_TESTSOLARMUTEX();
+ if(mpModel && rPolyPolygon.count())
+ {
+ SfxMapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ const double fFactorMmToTwips(72.0 / 127.0);
+ rPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(fFactorMmToTwips, fFactorMmToTwips));
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("AW: Missing unit translation to PoolMetric!");
+ }
+ }
+ }
+ }
+}
+
void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
{
DBG_TESTSOLARMUTEX();
SfxMapUnit eMapUnit = SFX_MAPUNIT_100TH_MM;
- if(mpModel)
+ if(mpModel && rPolyPolygon.count())
{
eMapUnit = mpModel->GetItemPool().GetMetric(0);
if(eMapUnit != SFX_MAPUNIT_100TH_MM)
@@ -646,23 +767,28 @@ void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) cons
{
case SFX_MAPUNIT_TWIP :
{
- basegfx::B2DHomMatrix aTransform;
- const double fTWIPSToMM(127.0 / 72.0);
- aTransform.scale(fTWIPSToMM, fTWIPSToMM);
- rPolyPolygon.transform(aTransform);
+ const double fFactorTwipsToMm(127.0 / 72.0);
+ rPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(fFactorTwipsToMm, fFactorTwipsToMm));
break;
}
default:
{
- DBG_ERROR("Missing unit translation to 100th mm!");
+ DBG_ERROR("AW: Missing unit translation to 100th mm!");
}
}
}
}
}
-// <--
+
//----------------------------------------------------------------------
+bool SvxShape::isWriterAnchorUsed() const
+{
+ return (mpModel
+ && mpObj.is()
+ && mpModel->IsWriter()
+ && !mpObj->GetAnchorPos().equalZero());
+}
//----------------------------------------------------------------------
void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet,
@@ -732,27 +858,21 @@ uno::Any SvxShape::GetBitmap( sal_Bool bMetaFile /* = sal_False */ ) const throw
DBG_TESTSOLARMUTEX();
uno::Any aAny;
- if( !mpObj.is() || mpModel == NULL || !mpObj->IsInserted() || NULL == mpObj->GetPage() )
+ if( !mpObj.is() || mpModel == NULL || !mpObj->IsObjectInserted() || NULL == mpObj->getSdrPageFromSdrObject() )
return aAny;
VirtualDevice aVDev;
aVDev.SetMapMode(MapMode(MAP_100TH_MM));
- SdrModel* pModel = mpObj->GetModel();
- SdrPage* pPage = mpObj->GetPage();
+ SdrPage* pPage = mpObj->getSdrPageFromSdrObject();
- E3dView* pView = new E3dView( pModel, &aVDev );
- pView->hideMarkHandles();
- SdrPageView* pPageView = pView->ShowSdrPage(pPage);
+ E3dView* pView = new E3dView( mpObj->getSdrModelFromSdrObject(), &aVDev );
SdrObject *pTempObj = mpObj.get();
- pView->MarkObj(pTempObj,pPageView);
-
- Rectangle aRect(pTempObj->GetCurrentBoundRect());
- aRect.Justify();
- Size aSize(aRect.GetSize());
+ pView->MarkObj(*pTempObj);
GDIMetaFile aMtf( pView->GetMarkedObjMetaFile() );
+
if( bMetaFile )
{
SvMemoryStream aDestStrm( 65535, 65535 );
@@ -764,8 +884,10 @@ uno::Any SvxShape::GetBitmap( sal_Bool bMetaFile /* = sal_False */ ) const throw
}
else
{
+ const basegfx::B2DVector aObjectScale(basegfx::absolute(pTempObj->getSdrObjectScale()));
Graphic aGraph(aMtf);
- aGraph.SetPrefSize(aSize);
+
+ aGraph.SetPrefSize(Size(basegfx::fround(aObjectScale.getX()), basegfx::fround(aObjectScale.getY())));
aGraph.SetPrefMapMode(MAP_100TH_MM);
Reference< awt::XBitmap > xBmp( aGraph.GetXGraphic(), UNO_QUERY );
@@ -798,19 +920,19 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::getTypes()
uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes()
throw(uno::RuntimeException)
{
- switch( mpImpl->mnObjId )
- {
- // shapes without text
- case OBJ_PAGE:
- case OBJ_FRAME:
- case OBJ_OLE2_PLUGIN:
- case OBJ_OLE2_APPLET:
- case E3D_CUBEOBJ_ID|E3D_INVENTOR_FLAG:
- case E3D_SPHEREOBJ_ID|E3D_INVENTOR_FLAG:
- case E3D_LATHEOBJ_ID|E3D_INVENTOR_FLAG:
- case E3D_EXTRUDEOBJ_ID|E3D_INVENTOR_FLAG:
- case E3D_POLYGONOBJ_ID|E3D_INVENTOR_FLAG:
- case OBJ_MEDIA:
+ switch(mpImpl->meSvxShapeKind)
+ {
+ // shapes without text
+ case SvxShapeKind_Page:
+ case SvxShapeKind_Frame:
+ case SvxShapeKind_Plugin:
+ case SvxShapeKind_Applet:
+ case SvxShapeKind_3DCube:
+ case SvxShapeKind_3DSphere:
+ case SvxShapeKind_3DLathe:
+ case SvxShapeKind_3DExtrude:
+ case SvxShapeKind_3DPolygon:
+ case SvxShapeKind_Media:
{
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > aTypeSequence;
@@ -842,8 +964,8 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes()
}
return aTypeSequence;
}
- // group shape
- case OBJ_GRUP:
+ // group shape
+ case SvxShapeKind_Group:
{
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > aTypeSequence;
@@ -877,8 +999,8 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes()
}
return aTypeSequence;
}
- // connector shape
- case OBJ_EDGE:
+ // connector shape
+ case SvxShapeKind_Connector:
{
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > aTypeSequence;
@@ -916,8 +1038,8 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes()
}
return aTypeSequence;
}
- // control shape
- case OBJ_UNO:
+ // control shape
+ case SvxShapeKind_Control:
{
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > aTypeSequence;
@@ -950,8 +1072,8 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes()
}
return aTypeSequence;
}
- // 3d scene shape
- case E3D_POLYSCENE_ID|E3D_INVENTOR_FLAG:
+ // 3d scene shape
+ case SvxShapeKind_3DScene:
{
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > aTypeSequence;
@@ -984,7 +1106,7 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes()
}
return aTypeSequence;
}
- case OBJ_CUSTOMSHAPE:
+ case SvxShapeKind_Customshape:
{
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > aTypeSequence;
@@ -1021,25 +1143,17 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes()
}
return aTypeSequence;
}
- // shapes with text
- case OBJ_RECT:
- case OBJ_CIRC:
- case OBJ_MEASURE:
- case OBJ_LINE:
- case OBJ_POLY:
- case OBJ_PLIN:
- case OBJ_PATHLINE:
- case OBJ_PATHFILL:
- case OBJ_FREELINE:
- case OBJ_FREEFILL:
- case OBJ_PATHPOLY:
- case OBJ_PATHPLIN:
- case OBJ_GRAF:
- case OBJ_TEXT:
- case OBJ_CAPTION:
- case OBJ_TABLE:
- case OBJ_OLE2: // #i118485# Moved to shapes with text, was at (shapes without text) before, see above
- default:
+ // shapes with text
+ case SvxShapeKind_Rectangle:
+ case SvxShapeKind_Circle:
+ case SvxShapeKind_Measure:
+ case SvxShapeKind_Path:
+ case SvxShapeKind_Graphic:
+ case SvxShapeKind_Text:
+ case SvxShapeKind_Caption:
+ case SvxShapeKind_Table:
+ case SvxShapeKind_OLE2: // #i118485# Moved to shapes with text, was at (shapes without text) before, see above
+ default:
{
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > aTypeSequence;
@@ -1112,13 +1226,6 @@ Reference< uno::XInterface > SvxShape_NewInstance()
}
//----------------------------------------------------------------------
-
-void SvxShape::onUserCall(SdrUserCallType /*_eUserCall*/, const Rectangle& /*_rNewBoundRect*/ )
-{
- // obsolete, not called anymore
-}
-
-//----------------------------------------------------------------------
// SfxListener
//----------------------------------------------------------------------
@@ -1128,14 +1235,24 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
if( !mpObj.is() )
return;
- // #i55919# HINT_OBJCHG is only interesting if it's for this object
+ // #i55919# HINT_OBJCHG_* is only interesting if it's for this object
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if (!pSdrHint)
+ return;
+
+ if(HINT_MODELCLEARED != pSdrHint->GetSdrHintKind())
+ {
+ if(pSdrHint->GetSdrHintObject() != mpObj.get())
+ return;
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- if (!pSdrHint || ( /* (pSdrHint->GetKind() != HINT_OBJREMOVED) && */
- (pSdrHint->GetKind() != HINT_MODELCLEARED) &&
- // #110094#-9 (pSdrHint->GetKind() != HINT_OBJLISTCLEAR) &&
- ((pSdrHint->GetKind() != HINT_OBJCHG || pSdrHint->GetObject() != mpObj.get() ))))
+ if(HINT_OBJCHG_MOVE != pSdrHint->GetSdrHintKind()
+ && HINT_OBJCHG_RESIZE != pSdrHint->GetSdrHintKind()
+ && HINT_OBJCHG_ATTR != pSdrHint->GetSdrHintKind())
+ {
return;
+ }
+ }
uno::Reference< uno::XInterface > xSelf( mpObj->getWeakUnoShape() );
if( !xSelf.is() )
@@ -1146,13 +1263,8 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
sal_Bool bClearMe = sal_False;
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
- case HINT_OBJCHG:
- {
- updateShapeKind();
- break;
- }
case HINT_MODELCLEARED:
{
bClearMe = sal_True;
@@ -1180,27 +1292,17 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw()
// Prefixing with 'svx' and marking static to make sure name collisions
// do not occur.
-static sal_Bool svx_needLogicRectHack( SdrObject* pObj )
+static bool svx_needLogicRangeHack( SdrObject* pObj )
{
if( pObj->GetObjInventor() == SdrInventor)
{
switch(pObj->GetObjIdentifier())
{
- case OBJ_GRUP:
- case OBJ_LINE:
- case OBJ_POLY:
- case OBJ_PLIN:
- case OBJ_PATHLINE:
- case OBJ_PATHFILL:
- case OBJ_FREELINE:
- case OBJ_FREEFILL:
- case OBJ_SPLNLINE:
- case OBJ_SPLNFILL:
- case OBJ_EDGE:
- case OBJ_PATHPOLY:
- case OBJ_PATHPLIN:
- case OBJ_MEASURE:
- return sal_True;
+ case OBJ_GRUP:
+ case OBJ_POLY:
+ case OBJ_EDGE:
+ case OBJ_MEASURE:
+ return sal_True;
}
}
return sal_False;
@@ -1208,29 +1310,29 @@ static sal_Bool svx_needLogicRectHack( SdrObject* pObj )
//----------------------------------------------------------------------
-static Rectangle svx_getLogicRectHack( SdrObject* pObj )
+static basegfx::B2DRange svx_getLogicRangeHack( SdrObject* pObj )
{
- if(svx_needLogicRectHack(pObj))
+ if(svx_needLogicRangeHack(pObj))
{
- return pObj->GetSnapRect();
+ return sdr::legacy::GetSnapRange(*pObj);
}
else
{
- return pObj->GetLogicRect();
+ return sdr::legacy::GetLogicRange(*pObj);
}
}
//----------------------------------------------------------------------
-static void svx_setLogicRectHack( SdrObject* pObj, const Rectangle& rRect )
+static void svx_setLogicRangeHack( SdrObject* pObj, const basegfx::B2DRange& rRange ) // TTTT needed?
{
- if(svx_needLogicRectHack(pObj))
+ if(svx_needLogicRangeHack(pObj))
{
- pObj->SetSnapRect( rRect );
+ sdr::legacy::SetSnapRange(*pObj, rRange );
}
else
{
- pObj->SetLogicRect( rRect );
+ sdr::legacy::SetLogicRange(*pObj, rRange );
}
}
@@ -1242,15 +1344,17 @@ awt::Point SAL_CALL SvxShape::getPosition() throw(uno::RuntimeException)
if( mpObj.is() && mpModel)
{
- Rectangle aRect( svx_getLogicRectHack(mpObj.get()) );
- Point aPt( aRect.Left(), aRect.Top() );
+ const basegfx::B2DRange aRange( svx_getLogicRangeHack(mpObj.get()) );
+ basegfx::B2DPoint aPt( aRange.getMinimum() );
// Position is relativ to anchor, so recalc to absolut position
- if( mpModel->IsWriter() )
+ if(isWriterAnchorUsed())
+ {
aPt -= mpObj->GetAnchorPos();
+ }
ForceMetricTo100th_mm(aPt);
- return ::com::sun::star::awt::Point( aPt.X(), aPt.Y() );
+ return ::com::sun::star::awt::Point( basegfx::fround(aPt.getX()), basegfx::fround(aPt.getY()) );
}
else
{
@@ -1267,20 +1371,19 @@ void SAL_CALL SvxShape::setPosition( const awt::Point& Position ) throw(uno::Run
{
// do NOT move 3D objects, this would change the homogen
// transformation matrix
- if(!mpObj->ISA(E3dCompoundObject))
+ if(!dynamic_cast< E3dCompoundObject* >(mpObj.get()))
{
- Rectangle aRect( svx_getLogicRectHack(mpObj.get()) );
- Point aLocalPos( Position.X, Position.Y );
+ const basegfx::B2DRange aRange( svx_getLogicRangeHack(mpObj.get()) );
+ basegfx::B2DPoint aLocalPos( Position.X, Position.Y );
ForceMetricToItemPoolMetric(aLocalPos);
// Position ist absolut, relativ zum Anker stellen
- if( mpModel->IsWriter() )
+ if(isWriterAnchorUsed())
+ {
aLocalPos += mpObj->GetAnchorPos();
+ }
- long nDX = aLocalPos.X() - aRect.Left();
- long nDY = aLocalPos.Y() - aRect.Top();
-
- mpObj->Move( Size( nDX, nDY ) );
+ sdr::legacy::transformSdrObject(*mpObj.get(), basegfx::tools::createTranslateB2DHomMatrix(aLocalPos - aRange.getMinimum()));
mpModel->SetChanged();
}
}
@@ -1295,10 +1398,10 @@ awt::Size SAL_CALL SvxShape::getSize() throw(uno::RuntimeException)
if( mpObj.is() && mpModel)
{
- Rectangle aRect( svx_getLogicRectHack(mpObj.get()) );
- Size aObjSize( aRect.getWidth(), aRect.getHeight() );
+ const basegfx::B2DRange aRange( svx_getLogicRangeHack(mpObj.get()) );
+ basegfx::B2DPoint aObjSize( aRange.getRange() );
ForceMetricTo100th_mm(aObjSize);
- return ::com::sun::star::awt::Size( aObjSize.getWidth(), aObjSize.getHeight() );
+ return ::com::sun::star::awt::Size( basegfx::fround(aObjSize.getX()), basegfx::fround(aObjSize.getY()) );
}
else
return maSize;
@@ -1312,34 +1415,30 @@ void SAL_CALL SvxShape::setSize( const awt::Size& rSize )
if( mpObj.is() && mpModel)
{
- Rectangle aRect( svx_getLogicRectHack(mpObj.get()) );
- Size aLocalSize( rSize.Width, rSize.Height );
+ basegfx::B2DRange aRange( svx_getLogicRangeHack(mpObj.get()) );
+ basegfx::B2DPoint aLocalSize( rSize.Width, rSize.Height );
ForceMetricToItemPoolMetric(aLocalSize);
- if(mpObj->GetObjInventor() == SdrInventor && mpObj->GetObjIdentifier() == OBJ_MEASURE )
+ if(SdrInventor == mpObj->GetObjInventor() && OBJ_MEASURE == mpObj->GetObjIdentifier())
{
- Fraction aWdt(aLocalSize.Width(),aRect.Right()-aRect.Left());
- Fraction aHgt(aLocalSize.Height(),aRect.Bottom()-aRect.Top());
- Point aPt = mpObj->GetSnapRect().TopLeft();
- mpObj->Resize(aPt,aWdt,aHgt);
+ const basegfx::B2DVector aFactor(aLocalSize.getX() / aRange.getWidth(), aLocalSize.getY() / aRange.getHeight());
+ const basegfx::B2DPoint aPt(sdr::legacy::GetSnapRange(*mpObj.get()).getMinimum());
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aPt);
+ aTransform.scale(aFactor);
+ aTransform.translate(aPt);
+
+ sdr::legacy::transformSdrObject(*mpObj.get(), aTransform);
}
else
{
- //aRect.SetSize(aLocalSize); // this call substract 1 // http://www.openoffice.org/issues/show_bug.cgi?id=83193
- if ( !aLocalSize.Width() )
- {
- aRect.Right() = RECT_EMPTY;
- }
- else
- aRect.setWidth(aLocalSize.Width());
- if ( !aLocalSize.Height() )
- {
- aRect.Bottom() = RECT_EMPTY;
- }
- else
- aRect.setHeight(aLocalSize.Height());
+ //aRange.SetSize(aLocalSize); // this call substract 1 // http://www.openoffice.org/issues/show_bug.cgi?id=83193
+ aRange = basegfx::B2DRange(
+ aRange.getMinX(), aRange.getMinY(),
+ aRange.getMinX() + aLocalSize.getX(), aRange.getMinY() + aLocalSize.getY());
- svx_setLogicRectHack( mpObj.get(), aRect );
+ svx_setLogicRangeHack( mpObj.get(), aRange );
}
mpModel->SetChanged();
@@ -1383,19 +1482,17 @@ void SAL_CALL SvxShape::setName( const ::rtl::OUString& aName ) throw(::com::sun
//----------------------------------------------------------------------
OUString SAL_CALL SvxShape::getShapeType() throw(uno::RuntimeException)
{
- if( 0 == maShapeType.getLength() )
+ if(!maShapeType.getLength())
{
- UHashMapEntry* pMap = pSdrShapeIdentifierMap;
- while ( ( pMap->nId != mpImpl->mnObjId ) && pMap->aIdentifier.getLength() )
- ++pMap;
+ OUString aName;
- if ( pMap->aIdentifier.getLength() )
+ if(getNameForSvxShapeType(aName, mpImpl->meSvxShapeKind))
{
- return pMap->aIdentifier;
+ return aName;
}
else
{
- DBG_ERROR("[CL] unknown SdrObjekt identifier");
+ DBG_ERROR("unknown SdrObject identifier (!)");
}
}
@@ -1423,27 +1520,27 @@ void SAL_CALL SvxShape::dispose() throw(uno::RuntimeException)
{
bool bFreeSdrObject = false;
- if ( mpObj->IsInserted() && mpObj->GetPage() )
+ if ( mpObj->IsObjectInserted() && mpObj->getSdrPageFromSdrObject() )
{
OSL_ENSURE( HasSdrObjectOwnership(), "SvxShape::dispose: is the below code correct?" );
// normally, we are allowed to free the SdrObject only if we have its ownership.
// Why isn't this checked here?
- SdrPage* pPage = mpObj->GetPage();
+ SdrPage* pPage = mpObj->getSdrPageFromSdrObject();
// SdrObject aus der Page loeschen
sal_uInt32 nCount = pPage->GetObjCount();
for ( sal_uInt32 nNum = 0; nNum < nCount; ++nNum )
{
if ( pPage->GetObj( nNum ) == mpObj.get() )
{
- OSL_VERIFY( pPage->RemoveObject( nNum ) == mpObj.get() );
+ OSL_VERIFY( pPage->RemoveObjectFromSdrObjList( nNum ) == mpObj.get() );
bFreeSdrObject = true;
break;
}
}
}
- mpObj->setUnoShape( NULL, SdrObject::GrantXShapeAccess() );
+ SetUnoShapeAtSdrObjectFromSvxShape(*mpObj.get(), 0);
if ( bFreeSdrObject )
{
@@ -1451,7 +1548,7 @@ void SAL_CALL SvxShape::dispose() throw(uno::RuntimeException)
// would do nothing. So ensure the ownership is reset.
mpImpl->mbHasSdrObjectOwnership = false;
SdrObject* pObject = mpObj.get();
- SdrObject::Free( pObject );
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
}
@@ -1534,19 +1631,19 @@ void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& , const Re
sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName )
{
- SfxItemSet aSet( mpModel->GetItemPool(), (sal_uInt16)nWID, (sal_uInt16)nWID );
-
- if( SetFillAttribute( nWID, rName, aSet, mpModel ) )
+ if(mpModel)
{
- //mpObj->SetItemSetAndBroadcast(aSet);
- mpObj->SetMergedItemSetAndBroadcast(aSet);
+ SfxItemSet aSet( mpModel->GetItemPool(), (sal_uInt16)nWID, (sal_uInt16)nWID );
- return sal_True;
- }
- else
- {
- return sal_False;
+ if( SetFillAttribute( nWID, rName, aSet, mpModel ) )
+ {
+ mpObj->SetMergedItemSetAndBroadcast(aSet);
+
+ return sal_True;
+ }
}
+
+ return sal_False;
}
//----------------------------------------------------------------------
@@ -1565,116 +1662,118 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const ::rtl::OUStr
switch( nWID )
{
- case XATTR_FILLBITMAP:
- {
- XBitmapList* pBitmapList = pModel->GetBitmapList();
+ case XATTR_FILLBITMAP:
+ {
+ XBitmapList* pBitmapList = pModel->GetBitmapList();
- if( !pBitmapList )
- return sal_False;
+ if( !pBitmapList )
+ return sal_False;
- long nPos = ((XPropertyList*)pBitmapList)->Get(aStrName);
- if( nPos == -1 )
- return sal_False;
+ long nPos = ((XPropertyList*)pBitmapList)->Get(aStrName);
+ if( nPos == -1 )
+ return sal_False;
- XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
- XFillBitmapItem aBmpItem;
- aBmpItem.SetWhich( XATTR_FILLBITMAP );
- aBmpItem.SetName( rName );
- aBmpItem.SetGraphicObject(pEntry->GetGraphicObject());
- rSet.Put( aBmpItem );
- break;
- }
- case XATTR_FILLGRADIENT:
- {
- XGradientList* pGradientList = pModel->GetGradientList();
+ XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos );
+ XFillBitmapItem aBmpItem;
+ aBmpItem.SetWhich( XATTR_FILLBITMAP );
+ aBmpItem.SetName( rName );
+ aBmpItem.SetGraphicObject(pEntry->GetGraphicObject());
+ rSet.Put( aBmpItem );
+ break;
+ }
+ case XATTR_FILLGRADIENT:
+ {
+ XGradientList* pGradientList = pModel->GetGradientList();
- if( !pGradientList )
- return sal_False;
+ if( !pGradientList )
+ return sal_False;
- long nPos = ((XPropertyList*)pGradientList)->Get(aStrName);
- if( nPos == -1 )
- return sal_False;
+ long nPos = ((XPropertyList*)pGradientList)->Get(aStrName);
+ if( nPos == -1 )
+ return sal_False;
- XGradientEntry* pEntry = pGradientList->GetGradient( nPos );
- XFillGradientItem aGrdItem;
- aGrdItem.SetWhich( XATTR_FILLGRADIENT );
- aGrdItem.SetName( rName );
- aGrdItem.SetGradientValue( pEntry->GetGradient() );
- rSet.Put( aGrdItem );
- break;
- }
- case XATTR_FILLHATCH:
- {
- XHatchList* pHatchList = pModel->GetHatchList();
+ XGradientEntry* pEntry = pGradientList->GetGradient( nPos );
+ XFillGradientItem aGrdItem;
+ aGrdItem.SetWhich( XATTR_FILLGRADIENT );
+ aGrdItem.SetName( rName );
+ aGrdItem.SetGradientValue( pEntry->GetGradient() );
+ rSet.Put( aGrdItem );
+ break;
+ }
+ case XATTR_FILLHATCH:
+ {
+ XHatchList* pHatchList = pModel->GetHatchList();
- if( !pHatchList )
- return sal_False;
+ if( !pHatchList )
+ return sal_False;
- long nPos = ((XPropertyList*)pHatchList)->Get(aStrName);
- if( nPos == -1 )
- return sal_False;
+ long nPos = ((XPropertyList*)pHatchList)->Get(aStrName);
+ if( nPos == -1 )
+ return sal_False;
- XHatchEntry* pEntry = pHatchList->GetHatch( nPos );
- XFillHatchItem aHatchItem;
- aHatchItem.SetWhich( XATTR_FILLHATCH );
- aHatchItem.SetName( rName );
- aHatchItem.SetHatchValue( pEntry->GetHatch() );
- rSet.Put( aHatchItem );
- break;
- }
- case XATTR_LINEEND:
- case XATTR_LINESTART:
- {
- XLineEndList* pLineEndList = pModel->GetLineEndList();
+ XHatchEntry* pEntry = pHatchList->GetHatch( nPos );
+ XFillHatchItem aHatchItem;
+ aHatchItem.SetWhich( XATTR_FILLHATCH );
+ aHatchItem.SetName( rName );
+ aHatchItem.SetHatchValue( pEntry->GetHatch() );
+ rSet.Put( aHatchItem );
+ break;
+ }
+ case XATTR_LINEEND:
+ case XATTR_LINESTART:
+ {
+ XLineEndList* pLineEndList = pModel->GetLineEndList();
- if( !pLineEndList )
- return sal_False;
+ if( !pLineEndList )
+ return sal_False;
- long nPos = ((XPropertyList*)pLineEndList)->Get(aStrName);
- if( nPos == -1 )
- return sal_False;
+ long nPos = ((XPropertyList*)pLineEndList)->Get(aStrName);
+ if( nPos == -1 )
+ return sal_False;
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
- if( XATTR_LINEEND == nWID )
- {
- XLineEndItem aLEItem;
- aLEItem.SetWhich( XATTR_LINEEND );
- aLEItem.SetName( rName );
- aLEItem.SetLineEndValue( pEntry->GetLineEnd() );
- rSet.Put( aLEItem );
+ XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos );
+ if( XATTR_LINEEND == nWID )
+ {
+ XLineEndItem aLEItem;
+ aLEItem.SetWhich( XATTR_LINEEND );
+ aLEItem.SetName( rName );
+ aLEItem.SetLineEndValue( pEntry->GetLineEnd() );
+ rSet.Put( aLEItem );
+ }
+ else
+ {
+ XLineStartItem aLSItem;
+ aLSItem.SetWhich( XATTR_LINESTART );
+ aLSItem.SetName( rName );
+ aLSItem.SetLineStartValue( pEntry->GetLineEnd() );
+ rSet.Put( aLSItem );
+ }
+
+ break;
}
- else
+ case XATTR_LINEDASH:
{
- XLineStartItem aLSItem;
- aLSItem.SetWhich( XATTR_LINESTART );
- aLSItem.SetName( rName );
- aLSItem.SetLineStartValue( pEntry->GetLineEnd() );
- rSet.Put( aLSItem );
- }
+ XDashList* pDashList = pModel->GetDashList();
- break;
- }
- case XATTR_LINEDASH:
- {
- XDashList* pDashList = pModel->GetDashList();
+ if( !pDashList )
+ return sal_False;
- if( !pDashList )
- return sal_False;
+ long nPos = ((XPropertyList*)pDashList)->Get(aStrName);
+ if( nPos == -1 )
+ return sal_False;
- long nPos = ((XPropertyList*)pDashList)->Get(aStrName);
- if( nPos == -1 )
+ XDashEntry* pEntry = pDashList->GetDash( nPos );
+ XLineDashItem aDashItem;
+ aDashItem.SetWhich( XATTR_LINEDASH );
+ aDashItem.SetName( rName );
+ aDashItem.SetDashValue( pEntry->GetDash() );
+ rSet.Put( aDashItem );
+ break;
+ }
+ default:
+ {
return sal_False;
-
- XDashEntry* pEntry = pDashList->GetDash( nPos );
- XLineDashItem aDashItem;
- aDashItem.SetWhich( XATTR_LINEDASH );
- aDashItem.SetName( rName );
- aDashItem.SetDashValue( pEntry->GetDash() );
- rSet.Put( aDashItem );
- break;
- }
- default:
- return sal_False;
+ }
}
}
@@ -1692,8 +1791,8 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN
{
switch( nWID )
{
- case XATTR_LINEEND:
- case XATTR_LINESTART:
+ case XATTR_LINEEND:
+ case XATTR_LINESTART:
{
const String aEmpty;
const basegfx::B2DPolyPolygon aEmptyPoly;
@@ -1704,7 +1803,7 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN
return sal_True;
}
- case XATTR_FILLFLOATTRANSPARENCE:
+ case XATTR_FILLFLOATTRANSPARENCE:
{
// #85953# Set a disabled XFillFloatTransparenceItem
rSet.Put(XFillFloatTransparenceItem());
@@ -1717,7 +1816,6 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN
}
const SfxItemPool* pPool = rSet.GetPool();
-
const String aSearchName( aName );
const sal_uInt32 nCount = pPool->GetItemCount2((sal_uInt16)nWID);
const NameOrIndex* pItem;
@@ -1996,6 +2094,13 @@ void SAL_CALL SvxShape::setPropertyValues( const ::com::sun::star::uno::Sequence
//----------------------------------------------------------------------
+const SfxItemPropertyMapEntry* SvxShape::getPropertyMapEntries() const
+{
+ return maPropMapEntries;
+}
+
+//----------------------------------------------------------------------
+
void SvxShape::endSetPropertyValues()
{
mbIsMultiPropertyCall = sal_False;
@@ -2068,77 +2173,23 @@ void SAL_CALL SvxShape::firePropertiesChangeEvent( const ::com::sun::star::uno::
uno::Any SvxShape::GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertySimpleEntry* pMap ) const
{
DBG_TESTSOLARMUTEX();
- uno::Any aAny;
-
- switch(pMap->nWID)
- {
- case SDRATTR_CIRCSTARTANGLE:
- {
- const SfxPoolItem* pPoolItem=NULL;
- if(aSet.GetItemState(SDRATTR_CIRCSTARTANGLE,sal_False,&pPoolItem)==SFX_ITEM_SET)
- {
- sal_Int32 nAngle = ((SdrCircStartAngleItem*)pPoolItem)->GetValue();
- aAny <<= nAngle;
- }
- break;
- }
- case SDRATTR_CIRCENDANGLE:
- {
- const SfxPoolItem* pPoolItem=NULL;
- if (aSet.GetItemState(SDRATTR_CIRCENDANGLE,sal_False,&pPoolItem)==SFX_ITEM_SET)
- {
- sal_Int32 nAngle = ((SdrCircEndAngleItem*)pPoolItem)->GetValue();
- aAny <<= nAngle;
- }
- break;
- }
+ // Hole Wert aus ItemSet
+ uno::Any aAny = SvxItemPropertySet_getPropertyValue( *mpPropSet, pMap, aSet );
- case SDRATTR_CIRCKIND:
+ if( *pMap->pType != aAny.getValueType() )
{
- if( mpObj->GetObjInventor() == SdrInventor)
+ // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
+ if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) )
{
- drawing::CircleKind eKind;
- switch(mpObj->GetObjIdentifier())
- {
- case OBJ_CIRC: // Kreis, Ellipse
- eKind = drawing::CircleKind_FULL;
- break;
- case OBJ_CCUT: // Kreisabschnitt
- eKind = drawing::CircleKind_CUT;
- break;
- case OBJ_CARC: // Kreisbogen
- eKind = drawing::CircleKind_ARC;
- break;
- case OBJ_SECT: // Kreissektor
- eKind = drawing::CircleKind_SECTION;
- break;
- }
- aAny <<= eKind;
+ sal_Int32 nValue = 0;
+ aAny >>= nValue;
+ aAny <<= (sal_Int16)nValue;
}
- break;
- }
- default:
- {
- // Hole Wert aus ItemSet
- aAny = SvxItemPropertySet_getPropertyValue( *mpPropSet, pMap, aSet );
-
- if( *pMap->pType != aAny.getValueType() )
+ else
{
- // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
- if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) )
- {
- sal_Int32 nValue = 0;
- aAny >>= nValue;
- aAny <<= (sal_Int16)nValue;
- }
- else
- {
- DBG_ERROR("SvxShape::GetAnyForItem() Returnvalue has wrong Type!" );
- }
+ DBG_ERROR("SvxShape::GetAnyForItem() Returnvalue has wrong Type!" );
}
-
- }
}
return aAny;
@@ -2177,19 +2228,19 @@ beans::PropertyState SAL_CALL SvxShape::_getPropertyState( const OUString& Prope
switch( rSet.GetItemState( pMap->nWID, sal_False ) )
{
- case SFX_ITEM_READONLY:
- case SFX_ITEM_SET:
- eState = beans::PropertyState_DIRECT_VALUE;
- break;
- case SFX_ITEM_DEFAULT:
- eState = beans::PropertyState_DEFAULT_VALUE;
- break;
-// case SFX_ITEM_UNKNOWN:
-// case SFX_ITEM_DONTCARE:
-// case SFX_ITEM_DISABLED:
- default:
- eState = beans::PropertyState_AMBIGUOUS_VALUE;
- break;
+ case SFX_ITEM_READONLY:
+ case SFX_ITEM_SET:
+ eState = beans::PropertyState_DIRECT_VALUE;
+ break;
+ case SFX_ITEM_DEFAULT:
+ eState = beans::PropertyState_DEFAULT_VALUE;
+ break;
+ // case SFX_ITEM_UNKNOWN:
+ // case SFX_ITEM_DONTCARE:
+ // case SFX_ITEM_DISABLED:
+ default:
+ eState = beans::PropertyState_AMBIGUOUS_VALUE;
+ break;
}
// if a item is set, this doesn't mean we want it :)
@@ -2197,13 +2248,13 @@ beans::PropertyState SAL_CALL SvxShape::_getPropertyState( const OUString& Prope
{
switch( pMap->nWID )
{
- // the following items are disabled by changing the
- // fill style or the line style. so there is no need
- // to export items without names which should be empty
- case XATTR_FILLBITMAP:
- case XATTR_FILLGRADIENT:
- case XATTR_FILLHATCH:
- case XATTR_LINEDASH:
+ // the following items are disabled by changing the
+ // fill style or the line style. so there is no need
+ // to export items without names which should be empty
+ case XATTR_FILLBITMAP:
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_LINEDASH:
{
NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
if( ( pItem == NULL ) || ( pItem->GetName().Len() == 0) )
@@ -2211,14 +2262,14 @@ beans::PropertyState SAL_CALL SvxShape::_getPropertyState( const OUString& Prope
}
break;
- // #i36115#
- // If e.g. the LineStart is on NONE and thus the string has length 0, it still
- // may be a hard attribute covering the set LineStart of the parent (Style).
- // #i37644#
- // same is for fill float transparency
- case XATTR_LINEEND:
- case XATTR_LINESTART:
- case XATTR_FILLFLOATTRANSPARENCE:
+ // #i36115#
+ // If e.g. the LineStart is on NONE and thus the string has length 0, it still
+ // may be a hard attribute covering the set LineStart of the parent (Style).
+ // #i37644#
+ // same is for fill float transparency
+ case XATTR_LINEEND:
+ case XATTR_LINESTART:
+ case XATTR_FILLFLOATTRANSPARENCE:
{
NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID);
if( ( pItem == NULL ) )
@@ -2237,217 +2288,219 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
{
switch( pProperty->nWID )
{
- case OWN_ATTR_CAPTION_POINT:
- {
- awt::Point aPnt;
- if( rValue >>= aPnt )
+ case OWN_ATTR_CAPTION_POINT:
{
- Point aVclPoint( aPnt.X, aPnt.Y );
+ awt::Point aPnt;
+ if( rValue >>= aPnt )
+ {
+ // prepare geometry data
+ basegfx::B2DPoint aVclPoint( aPnt.X, aPnt.Y );
- // #90763# position is relative to top left, make it absolute
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
- mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
+ // #88657# metric of pool maybe twips (writer)
+ ForceMetricToItemPoolMetric(aVclPoint);
- aVclPoint.X() += basegfx::fround(aNewHomogenMatrix.get(0, 2));
- aVclPoint.Y() += basegfx::fround(aNewHomogenMatrix.get(1, 2));
+ // #88491# position relative to anchor
+ // Not needed anymore, pos is already relative to object's
+ // TopLeft, anchor is not relevant for relative position
+ //if(isWriterAnchorUsed())
+ //{
+ // aVclPoint += sdr::legacy::GetAnchorPos(*mpObj.get());
+ //}
- // #88657# metric of pool maybe twips (writer)
- ForceMetricToItemPoolMetric(aVclPoint);
+ // #90763# position is relative to top left, make it absolute
+ aVclPoint += mpObj->getSdrObjectTranslate();
+// const basegfx::B2DHomMatrix aObjectMatrix(mpObj->getSdrObjectTransformation());
+// aVclPoint.X() += basegfx::fround(aObjectMatrix.get(0, 2));
+// aVclPoint.Y() += basegfx::fround(aObjectMatrix.get(1, 2));
- // #88491# position relative to anchor
- if( mpModel->IsWriter() )
- {
- aVclPoint += mpObj->GetAnchorPos();
- }
+ dynamic_cast< SdrCaptionObj* >(mpObj.get())->SetTailPos(aVclPoint);
- ((SdrCaptionObj*)mpObj.get())->SetTailPos(aVclPoint);
-
- return true;
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_TRANSFORMATION:
- {
- drawing::HomogenMatrix3 aMatrix;
- if(rValue >>= aMatrix)
+ case OWN_ATTR_TRANSFORMATION:
{
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
-
- mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
-
- aNewHomogenMatrix.set(0, 0, aMatrix.Line1.Column1);
- aNewHomogenMatrix.set(0, 1, aMatrix.Line1.Column2);
- aNewHomogenMatrix.set(0, 2, aMatrix.Line1.Column3);
- aNewHomogenMatrix.set(1, 0, aMatrix.Line2.Column1);
- aNewHomogenMatrix.set(1, 1, aMatrix.Line2.Column2);
- aNewHomogenMatrix.set(1, 2, aMatrix.Line2.Column3);
- aNewHomogenMatrix.set(2, 0, aMatrix.Line3.Column1);
- aNewHomogenMatrix.set(2, 1, aMatrix.Line3.Column2);
- aNewHomogenMatrix.set(2, 2, aMatrix.Line3.Column3);
-
- mpObj->TRSetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
- return true;
+ drawing::HomogenMatrix3 aMatrix;
+ if(rValue >>= aMatrix)
+ {
+ basegfx::B2DHomMatrix aNewObjectMatrix(basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix));
+
+ // metric of pool maybe twips (writer)
+ ForceMetricToItemPoolMetric(aNewObjectMatrix);
+
+ // position relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aNewObjectMatrix.translate(mpObj->GetAnchorPos());
+ }
+
+ mpObj->setSdrObjectTransformation(aNewObjectMatrix);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_ZORDER:
- {
- sal_Int32 nNewOrdNum = 0;
- if(rValue >>= nNewOrdNum)
+ case OWN_ATTR_ZORDER:
{
- SdrObjList* pObjList = mpObj->GetObjList();
- if( pObjList )
+ sal_Int32 nNewOrdNum = 0;
+ if(rValue >>= nNewOrdNum)
{
+ SdrObjList* pObjList = mpObj->getParentOfSdrObject();
+ if( pObjList )
+ {
#ifdef DBG_UTIL
- SdrObject* pCheck =
+ SdrObject* pCheck =
#endif
- pObjList->SetObjectOrdNum( mpObj->GetOrdNum(), (sal_uIntPtr)nNewOrdNum );
- DBG_ASSERT( pCheck == mpObj.get(), "GetOrdNum() failed!" );
+ pObjList->SetNavigationPosition( mpObj->GetNavigationPosition(), (sal_uInt32)nNewOrdNum );
+ DBG_ASSERT( pCheck == mpObj.get(), "GetNavigationPosition() failed!" );
+ }
+ return true;
}
- return true;
+ break;
}
- break;
- }
- case OWN_ATTR_FRAMERECT:
- {
- awt::Rectangle aUnoRect;
- if(rValue >>= aUnoRect)
+ case OWN_ATTR_FRAMERECT:
{
- Point aTopLeft( aUnoRect.X, aUnoRect.Y );
- Size aObjSize( aUnoRect.Width, aUnoRect.Height );
- ForceMetricToItemPoolMetric(aTopLeft);
- ForceMetricToItemPoolMetric(aObjSize);
- Rectangle aRect;
- aRect.SetPos(aTopLeft);
- aRect.SetSize(aObjSize);
- mpObj->SetSnapRect(aRect);
- return true;
+ awt::Rectangle aUnoRect;
+ if(rValue >>= aUnoRect)
+ {
+ basegfx::B2DPoint aTopLeft( aUnoRect.X, aUnoRect.Y );
+ basegfx::B2DPoint aObjSize( aUnoRect.Width, aUnoRect.Height );
+
+ ForceMetricToItemPoolMetric(aTopLeft);
+ ForceMetricToItemPoolMetric(aObjSize);
+
+ basegfx::B2DRange aRange(aTopLeft, aTopLeft + aObjSize);
+
+ sdr::legacy::SetSnapRange(*mpObj.get(), aRange);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_MIRRORED:
- {
- sal_Bool bMirror = sal_Bool();
- if(rValue >>= bMirror )
+ case OWN_ATTR_MIRRORED:
{
- SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >( mpObj.get() );
- if( pObj )
- pObj->SetMirrored(bMirror);
- return true;
+ sal_Bool bMirror = sal_Bool();
+ if(rValue >>= bMirror )
+ {
+ SdrGrafObj* pObj = dynamic_cast< SdrGrafObj* >( mpObj.get() );
+ if( pObj )
+ pObj->SetMirrored(bMirror);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_EDGE_START_OBJ:
- case OWN_ATTR_EDGE_END_OBJ:
- case OWN_ATTR_GLUEID_HEAD:
- case OWN_ATTR_GLUEID_TAIL:
- case OWN_ATTR_EDGE_START_POS:
- case OWN_ATTR_EDGE_END_POS:
- case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
- {
- SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >(mpObj.get());
- if(pEdgeObj)
+ case OWN_ATTR_EDGE_START_OBJ:
+ case OWN_ATTR_EDGE_END_OBJ:
+ case OWN_ATTR_GLUEID_HEAD:
+ case OWN_ATTR_GLUEID_TAIL:
+ case OWN_ATTR_EDGE_START_POS:
+ case OWN_ATTR_EDGE_END_POS:
+ case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
{
- switch(pProperty->nWID)
+ SdrEdgeObj* pEdgeObj = dynamic_cast< SdrEdgeObj* >(mpObj.get());
+ if(pEdgeObj)
{
- case OWN_ATTR_EDGE_START_OBJ:
- case OWN_ATTR_EDGE_END_OBJ:
+ switch(pProperty->nWID)
{
- Reference< drawing::XShape > xShape;
- if( rValue >>= xShape )
+ case OWN_ATTR_EDGE_START_OBJ:
+ case OWN_ATTR_EDGE_END_OBJ:
{
- SdrObject* pNode = GetSdrObjectFromXShape( xShape );
- if( pNode )
+ Reference< drawing::XShape > xShape;
+ if( rValue >>= xShape )
{
- pEdgeObj->ConnectToNode( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, pNode );
- pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, -1 );
- return true;
+ SdrObject* pNode = GetSdrObjectFromXShape( xShape );
+ if( pNode )
+ {
+ pEdgeObj->ConnectToNode( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, pNode );
+ pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, -1 );
+ return true;
+ }
}
+ break;
}
- break;
- }
- case OWN_ATTR_EDGE_START_POS:
- case OWN_ATTR_EDGE_END_POS:
- {
- awt::Point aUnoPoint;
- if( rValue >>= aUnoPoint )
+ case OWN_ATTR_EDGE_START_POS:
+ case OWN_ATTR_EDGE_END_POS:
{
- Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+ awt::Point aUnoPoint;
+ if( rValue >>= aUnoPoint )
+ {
+ basegfx::B2DPoint aPoint( aUnoPoint.X, aUnoPoint.Y );
- // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
- // perform metric change before applying anchor position,
- // because the anchor position is in pool metric.
- ForceMetricToItemPoolMetric( aPoint );
- // <--
- if( mpModel->IsWriter() )
- aPoint += mpObj->GetAnchorPos();
+ ForceMetricToItemPoolMetric( aPoint );
- pEdgeObj->SetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS, aPoint );
- return true;
+ if(isWriterAnchorUsed())
+ {
+ aPoint += mpObj->GetAnchorPos();
+ }
+
+ pEdgeObj->SetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS, aPoint );
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_GLUEID_HEAD:
- case OWN_ATTR_GLUEID_TAIL:
- {
- sal_Int32 nId = 0;
- if( rValue >>= nId )
+ case OWN_ATTR_GLUEID_HEAD:
+ case OWN_ATTR_GLUEID_TAIL:
{
- pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD, nId );
- return true;
+ sal_Int32 nId = 0;
+ if( rValue >>= nId )
+ {
+ pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD, nId );
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
- {
- drawing::PolyPolygonBezierCoords aPolyPoly;
- if ( rValue >>= aPolyPoly )
+ case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
{
- basegfx::B2DPolyPolygon aNewPolyPolygon( SvxConvertPolyPolygonBezierToB2DPolyPolygon( &aPolyPoly ) );
- // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
- ForceMetricToItemPoolMetric( aNewPolyPolygon );
- // <--
- if( mpModel->IsWriter() )
+ drawing::PolyPolygonBezierCoords aPolyPoly;
+ if ( rValue >>= aPolyPoly )
{
- Point aPoint( mpObj->GetAnchorPos() );
- aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(aPoint.X(), aPoint.Y()));
+ basegfx::B2DPolyPolygon aNewPolyPolygon(basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(aPolyPoly));
+ ForceMetricToItemPoolMetric( aNewPolyPolygon );
+
+ if(isWriterAnchorUsed())
+ {
+ aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
+ }
+
+ if(aNewPolyPolygon.count())
+ {
+ OSL_ENSURE(1 == aNewPolyPolygon.count(), "Connectors support only single polygon, taking first one (!)");
+ pEdgeObj->SetEdgeTrackPath( aNewPolyPolygon.getB2DPolygon(0) );
+ }
+
+ return true;
}
- pEdgeObj->SetEdgeTrackPath( aNewPolyPolygon );
- return true;
}
}
}
+ break;
}
- break;
- }
- case OWN_ATTR_MEASURE_START_POS:
- case OWN_ATTR_MEASURE_END_POS:
- {
- SdrMeasureObj* pMeasureObj = dynamic_cast< SdrMeasureObj* >(mpObj.get());
- awt::Point aUnoPoint;
- if(pMeasureObj && ( rValue >>= aUnoPoint ) )
+ case OWN_ATTR_MEASURE_START_POS:
+ case OWN_ATTR_MEASURE_END_POS:
{
- Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+ SdrMeasureObj* pMeasureObj = dynamic_cast< SdrMeasureObj* >(mpObj.get());
+ awt::Point aUnoPoint;
- // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
- ForceMetricToItemPoolMetric( aPoint );
- // <--
- if( mpModel->IsWriter() )
- aPoint += mpObj->GetAnchorPos();
+ if(pMeasureObj && ( rValue >>= aUnoPoint ) )
+ {
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pMeasureObj);
+ basegfx::B2DPoint aPoint( aUnoPoint.X, aUnoPoint.Y );
+ ForceMetricToItemPoolMetric( aPoint );
- pMeasureObj->NbcSetPoint( aPoint, pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0L : 1L );
- pMeasureObj->SetChanged();
- pMeasureObj->BroadcastObjectChange();
- return true;
+ if(isWriterAnchorUsed())
+ {
+ aPoint += mpObj->GetAnchorPos();
+ }
+
+ pMeasureObj->SetObjectPoint( aPoint, pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0L : 1L );
+ pMeasureObj->SetChanged();
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_FILLBMP_MODE:
+ case OWN_ATTR_FILLBMP_MODE:
{
drawing::BitmapMode eMode;
if(!(rValue >>= eMode) )
@@ -2463,200 +2516,266 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
return true;
}
- case SDRATTR_LAYERID:
- {
- sal_Int16 nLayerId = sal_Int16();
- if( rValue >>= nLayerId )
+ case SDRATTR_LAYERID:
{
- SdrLayer* pLayer = mpModel->GetLayerAdmin().GetLayerPerID((unsigned char)nLayerId);
- if( pLayer )
+ sal_Int16 nLayerId = sal_Int16();
+ if( rValue >>= nLayerId )
{
- mpObj->SetLayer((unsigned char)nLayerId);
- return true;
+ SdrLayer* pLayer = mpModel->GetModelLayerAdmin().GetLayerPerID((unsigned char)nLayerId);
+ if( pLayer )
+ {
+ mpObj->SetLayer((unsigned char)nLayerId);
+ return true;
+ }
}
+ break;
}
- break;
- }
- case SDRATTR_LAYERNAME:
- {
- OUString aLayerName;
- if( rValue >>= aLayerName )
+ case SDRATTR_LAYERNAME:
{
- const SdrLayer* pLayer=mpModel->GetLayerAdmin().GetLayer(aLayerName, sal_True);
- if( pLayer != NULL )
+ OUString aLayerName;
+ if( rValue >>= aLayerName )
{
- mpObj->SetLayer( pLayer->GetID() );
- return true;
+ const SdrLayer* pLayer=mpModel->GetModelLayerAdmin().GetLayer(aLayerName, true);
+ if( pLayer != NULL )
+ {
+ mpObj->SetLayer( pLayer->GetID() );
+ return true;
+ }
}
+ break;
}
- break;
- }
- case SDRATTR_ROTATEANGLE:
- {
- sal_Int32 nAngle = 0;
- if( rValue >>= nAngle )
+ case SDRATTR_ROTATEANGLE:
{
- Point aRef1(mpObj->GetSnapRect().Center());
- nAngle -= mpObj->GetRotateAngle();
- if (nAngle!=0)
+ sal_Int32 nAngle = 0;
+ if( rValue >>= nAngle )
{
- double nSin=sin(nAngle*nPi180);
- double nCos=cos(nAngle*nPi180);
- mpObj->Rotate(aRef1,nAngle,nSin,nCos);
+ const long aOldRotation(sdr::legacy::GetRotateAngle(*mpObj.get()));
+ nAngle -= aOldRotation;
+ if (nAngle!=0)
+ {
+ const Point aRef1(sdr::legacy::GetSnapRect(*mpObj.get()).Center());
+ sdr::legacy::RotateSdrObject(*mpObj.get(), aRef1, nAngle);
+ }
+ return true;
}
- return true;
+
+ break;
}
- break;
- }
+ case SDRATTR_SHEARANGLE:
+ {
+ sal_Int32 nShear = 0;
+ if( rValue >>= nShear )
+ {
+ const long aOldShear(sdr::legacy::GetShearAngleX(*mpObj.get()));
+ nShear -= aOldShear;
+ if(nShear != 0 )
+ {
+ Point aRef1(sdr::legacy::GetSnapRect(*mpObj.get()).Center());
+ sdr::legacy::ShearSdrObject(*mpObj.get(), aRef1, nShear, false);
+ return true;
+ }
+ }
- case SDRATTR_SHEARANGLE:
- {
- sal_Int32 nShear = 0;
- if( rValue >>= nShear )
+ break;
+ }
+
+ case SDRATTR_OBJMOVEPROTECT:
{
- nShear -= mpObj->GetShearAngle();
- if(nShear != 0 )
+ sal_Bool bMoveProtect = sal_Bool();
+ if( rValue >>= bMoveProtect )
{
- Point aRef1(mpObj->GetSnapRect().Center());
- double nTan=tan(nShear*nPi180);
- mpObj->Shear(aRef1,nShear,nTan,sal_False);
+ mpObj->SetMoveProtect(bMoveProtect);
return true;
}
+ break;
+ }
+ case SDRATTR_OBJECTNAME:
+ {
+ OUString aName;
+ if( rValue >>= aName )
+ {
+ mpObj->SetName( aName );
+ return true;
+ }
+ break;
}
- break;
- }
-
- case SDRATTR_OBJMOVEPROTECT:
- {
- sal_Bool bMoveProtect = sal_Bool();
- if( rValue >>= bMoveProtect )
+ // #i68101#
+ case OWN_ATTR_MISC_OBJ_TITLE:
{
- mpObj->SetMoveProtect(bMoveProtect);
- return true;
+ OUString aTitle;
+ if( rValue >>= aTitle )
+ {
+ mpObj->SetTitle( aTitle );
+ return true;
+ }
+ break;
}
- break;
- }
- case SDRATTR_OBJECTNAME:
- {
- OUString aName;
- if( rValue >>= aName )
+ case OWN_ATTR_MISC_OBJ_DESCRIPTION:
{
- mpObj->SetName( aName );
- return true;
+ OUString aDescription;
+ if( rValue >>= aDescription )
+ {
+ mpObj->SetDescription( aDescription );
+ return true;
+ }
+ break;
}
- break;
- }
- // #i68101#
- case OWN_ATTR_MISC_OBJ_TITLE:
- {
- OUString aTitle;
- if( rValue >>= aTitle )
+ case SDRATTR_OBJPRINTABLE:
{
- mpObj->SetTitle( aTitle );
- return true;
+ sal_Bool bPrintable = sal_Bool();
+ if( rValue >>= bPrintable )
+ {
+ mpObj->SetPrintable(bPrintable);
+ return true;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_MISC_OBJ_DESCRIPTION:
- {
- OUString aDescription;
- if( rValue >>= aDescription )
+ case SDRATTR_OBJVISIBLE:
{
- mpObj->SetDescription( aDescription );
- return true;
+ sal_Bool bVisible = sal_Bool();
+ if( rValue >>= bVisible )
+ {
+ mpObj->SetVisible(bVisible);
+ return true;
+ }
+ break;
}
- break;
- }
-
- case SDRATTR_OBJPRINTABLE:
- {
- sal_Bool bPrintable = sal_Bool();
- if( rValue >>= bPrintable )
+ case SDRATTR_OBJSIZEPROTECT:
{
- mpObj->SetPrintable(bPrintable);
- return true;
+ sal_Bool bResizeProtect = sal_Bool();
+ if( rValue >>= bResizeProtect )
+ {
+ mpObj->SetResizeProtect(bResizeProtect);
+ return true;
+ }
+ break;
}
- break;
- }
- case SDRATTR_OBJVISIBLE:
- {
- sal_Bool bVisible = sal_Bool();
- if( rValue >>= bVisible )
+ case OWN_ATTR_PAGE_NUMBER:
{
- mpObj->SetVisible(bVisible);
- return true;
+ sal_Int32 nPageNum = 0;
+ if( (rValue >>= nPageNum) && ( nPageNum >= 0 ) && ( nPageNum <= 0xffff ) )
+ {
+ SdrPageObj* pPageObj = dynamic_cast< SdrPageObj* >(mpObj.get());
+ if( pPageObj )
+ {
+ SdrPage* pNewPage = 0;
+ const sal_uInt16 nDestinationPageNum((sal_uInt16)((nPageNum << 1L) - 1L));
+
+ if(nDestinationPageNum < pPageObj->getSdrModelFromSdrObject().GetPageCount())
+ {
+ pNewPage = pPageObj->getSdrModelFromSdrObject().GetPage(nDestinationPageNum);
+ }
+
+ pPageObj->SetReferencedPage(pNewPage);
+ }
+
+ return true;
+ }
+ break;
}
- break;
- }
- case SDRATTR_OBJSIZEPROTECT:
- {
- sal_Bool bResizeProtect = sal_Bool();
- if( rValue >>= bResizeProtect )
+ case XATTR_FILLBITMAP:
+ case XATTR_FILLGRADIENT:
+ case XATTR_FILLHATCH:
+ case XATTR_FILLFLOATTRANSPARENCE:
+ case XATTR_LINEEND:
+ case XATTR_LINESTART:
+ case XATTR_LINEDASH:
{
- mpObj->SetResizeProtect(bResizeProtect);
- return true;
+ if( pProperty->nMemberId == MID_NAME )
+ {
+ OUString aApiName;
+ if( rValue >>= aApiName )
+ {
+ if( SetFillAttribute( pProperty->nWID, aApiName ) )
+ return true;
+ }
+ break;
+ }
+ else
+ {
+ return false;
+ }
}
- break;
- }
- case OWN_ATTR_PAGE_NUMBER:
- {
- sal_Int32 nPageNum = 0;
- if( (rValue >>= nPageNum) && ( nPageNum >= 0 ) && ( nPageNum <= 0xffff ) )
+ case OWN_ATTR_CIRCSTARTANGLE:
+ case OWN_ATTR_CIRCENDANGLE:
{
- SdrPageObj* pPageObj = dynamic_cast< SdrPageObj* >(mpObj.get());
- if( pPageObj )
+ sal_Int32 nOldAngle(0);
+
+ if(rValue >>= nOldAngle)
{
- SdrModel* pModel = pPageObj->GetModel();
- SdrPage* pNewPage = 0L;
- const sal_uInt16 nDestinationPageNum((sal_uInt16)((nPageNum << 1L) - 1L));
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(mpObj.get());
- if(pModel)
+ if(pSdrCircObj)
{
- if(nDestinationPageNum < pModel->GetPageCount())
+ const double fAngle(((36000 - (nOldAngle % 36000)) * F_PI) / 18000.0);
+
+ if(OWN_ATTR_CIRCSTARTANGLE == pProperty->nWID)
{
- pNewPage = pModel->GetPage(nDestinationPageNum);
+ pSdrCircObj->SetStartAngle(fAngle);
+ }
+ else
+ {
+ pSdrCircObj->SetEndAngle(fAngle);
}
- }
- pPageObj->SetReferencedPage(pNewPage);
+ return true;
+ }
}
- return true;
+ break;
}
- break;
- }
- case XATTR_FILLBITMAP:
- case XATTR_FILLGRADIENT:
- case XATTR_FILLHATCH:
- case XATTR_FILLFLOATTRANSPARENCE:
- case XATTR_LINEEND:
- case XATTR_LINESTART:
- case XATTR_LINEDASH:
- {
- if( pProperty->nMemberId == MID_NAME )
+ case OWN_ATTR_CIRCKIND:
{
- OUString aApiName;
- if( rValue >>= aApiName )
+ drawing::CircleKind eKind(drawing::CircleKind_FULL);
+
+ if(rValue >>= eKind)
{
- if( SetFillAttribute( pProperty->nWID, aApiName ) )
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(mpObj.get());
+
+ if(pSdrCircObj)
+ {
+ SdrCircleObjType eSdrCircleObjType(CircleType_Circle);
+
+ switch(eKind)
+ {
+ default : // case drawing::CircleKind_FULL:
+ {
+ eSdrCircleObjType = CircleType_Circle;
+ break;
+ }
+ case drawing::CircleKind_CUT:
+ {
+ eSdrCircleObjType = CircleType_Segment;
+ break;
+ }
+ case drawing::CircleKind_ARC:
+ {
+ eSdrCircleObjType = CircleType_Arc;
+ break;
+ }
+ case drawing::CircleKind_SECTION:
+ {
+ eSdrCircleObjType = CircleType_Sector;
+ break;
+ }
+ }
+
+ pSdrCircObj->SetSdrCircleObjType(eSdrCircleObjType);
return true;
+ }
}
+
break;
}
- else
+ default:
{
return false;
}
}
- default:
- {
- return false;
- }
- }
throw lang::IllegalArgumentException();
}
@@ -2673,383 +2792,469 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
break;
}
*/
- case OWN_ATTR_CAPTION_POINT:
- {
- Point aVclPoint = ((SdrCaptionObj*)mpObj.get())->GetTailPos();
-
- // #88491# make pos relative to anchor
- if( mpModel->IsWriter() )
+ case OWN_ATTR_CAPTION_POINT:
{
- aVclPoint -= mpObj->GetAnchorPos();
+ awt::Point aPnt(0, 0);
+
+ if(mpObj.is())
+ {
+ // get base geometry
+ basegfx::B2DPoint aVclPoint(((SdrCaptionObj*)mpObj.get())->GetTailPos());
+
+ // #90763# pos is absolute, make it relative to top left
+ aVclPoint -= mpObj->getSdrObjectTranslate();
+// const basegfx::B2DHomMatrix aObjectMatrix(mpObj->getSdrObjectTransformation());
+// aVclPoint.X() -= basegfx::fround(aObjectMatrix.get(0, 2));
+// aVclPoint.Y() -= basegfx::fround(aObjectMatrix.get(1, 2));
+
+ // #88491# make pos relative to anchor
+ // Not needed anymore, pos is already relative to object's
+ // TopLeft, anchor is not relevant for relative position
+ //if(isWriterAnchorUsed())
+ //{
+ // aVclPoint -= sdr::legacy::GetAnchorPos(*mpObj.get());
+ //}
+
+ // #88657# metric of pool maybe twips (writer)
+ ForceMetricTo100th_mm(aVclPoint);
+
+ // convert to needed data format
+ aPnt.X = basegfx::fround(aVclPoint.getX());
+ aPnt.Y = basegfx::fround(aVclPoint.getY());
+ }
+
+ rValue <<= aPnt;
+ break;
}
- // #88657# metric of pool maybe twips (writer)
- ForceMetricTo100th_mm(aVclPoint);
+ case OWN_ATTR_TRANSFORMATION:
+ {
+ drawing::HomogenMatrix3 aMatrix;
- // #90763# pos is absolute, make it relative to top left
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
- mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
+ if(mpObj.is())
+ {
+ // get base geometry
+ basegfx::B2DHomMatrix aObjectMatrix(mpObj->getSdrObjectTransformation());
- aVclPoint.X() -= basegfx::fround(aNewHomogenMatrix.get(0, 2));
- aVclPoint.Y() -= basegfx::fround(aNewHomogenMatrix.get(1, 2));
+ // make pos relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aObjectMatrix.translate(-mpObj->GetAnchorPos());
+ }
- awt::Point aPnt( aVclPoint.X(), aVclPoint.Y() );
- rValue <<= aPnt;
- break;
- }
+ // #88657# metric of pool maybe twips (writer)
+ ForceMetricTo100th_mm(aObjectMatrix);
- case OWN_ATTR_TRANSFORMATION:
- {
- basegfx::B2DPolyPolygon aNewPolyPolygon;
- basegfx::B2DHomMatrix aNewHomogenMatrix;
- mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
- drawing::HomogenMatrix3 aMatrix;
-
- aMatrix.Line1.Column1 = aNewHomogenMatrix.get(0, 0);
- aMatrix.Line1.Column2 = aNewHomogenMatrix.get(0, 1);
- aMatrix.Line1.Column3 = aNewHomogenMatrix.get(0, 2);
- aMatrix.Line2.Column1 = aNewHomogenMatrix.get(1, 0);
- aMatrix.Line2.Column2 = aNewHomogenMatrix.get(1, 1);
- aMatrix.Line2.Column3 = aNewHomogenMatrix.get(1, 2);
- aMatrix.Line3.Column1 = aNewHomogenMatrix.get(2, 0);
- aMatrix.Line3.Column2 = aNewHomogenMatrix.get(2, 1);
- aMatrix.Line3.Column3 = aNewHomogenMatrix.get(2, 2);
-
- rValue <<= aMatrix;
+ // convert to needed data format
+ basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(aObjectMatrix, aMatrix);
+ }
- break;
- }
+ rValue <<= aMatrix;
+ break;
+ }
- case OWN_ATTR_ZORDER:
- {
- rValue <<= (sal_Int32)mpObj->GetOrdNum();
- break;
- }
+ case OWN_ATTR_ZORDER:
+ {
+ rValue <<= (sal_Int32)mpObj->GetNavigationPosition();
+ break;
+ }
- case OWN_ATTR_BITMAP:
- {
- rValue = GetBitmap();
- if(!rValue.hasValue())
- throw uno::RuntimeException();
+ case OWN_ATTR_BITMAP:
+ {
+ rValue = GetBitmap();
+ if(!rValue.hasValue())
+ throw uno::RuntimeException();
- break;
- }
+ break;
+ }
- case OWN_ATTR_ISFONTWORK:
- {
- rValue <<= (sal_Bool)(mpObj->ISA(SdrTextObj) && ((SdrTextObj*)mpObj.get())->IsFontwork());
- break;
- }
+ case OWN_ATTR_ISFONTWORK:
+ {
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(mpObj.get());
+ rValue <<= pSdrTextObj ? (sal_Bool)pSdrTextObj->IsFontwork() : sal_False;
+ break;
+ }
- case OWN_ATTR_FRAMERECT:
- {
- Rectangle aRect( mpObj->GetSnapRect() );
- Point aTopLeft( aRect.TopLeft() );
- Size aObjSize( aRect.GetWidth(), aRect.GetHeight() );
- ForceMetricTo100th_mm(aTopLeft);
- ForceMetricTo100th_mm(aObjSize);
- ::com::sun::star::awt::Rectangle aUnoRect(
- aTopLeft.X(), aTopLeft.Y(),
- aObjSize.getWidth(), aObjSize.getHeight() );
- rValue <<= aUnoRect;
- break;
- }
+ case OWN_ATTR_FRAMERECT:
+ {
+ const basegfx::B2DRange aRange( sdr::legacy::GetSnapRange(*mpObj.get()) );
+ basegfx::B2DPoint aTopLeft( aRange.getMinimum() );
+ basegfx::B2DPoint aObjSize( aRange.getRange() );
- case OWN_ATTR_BOUNDRECT:
- {
- Rectangle aRect( mpObj->GetCurrentBoundRect() );
- Point aTopLeft( aRect.TopLeft() );
- Size aObjSize( aRect.GetWidth(), aRect.GetHeight() );
- ForceMetricTo100th_mm(aTopLeft);
- ForceMetricTo100th_mm(aObjSize);
- ::com::sun::star::awt::Rectangle aUnoRect(
- aTopLeft.X(), aTopLeft.Y(),
- aObjSize.getWidth(), aObjSize.getHeight() );
- rValue <<= aUnoRect;
- break;
- }
+ ForceMetricTo100th_mm(aTopLeft);
+ ForceMetricTo100th_mm(aObjSize);
- case OWN_ATTR_LDNAME:
- {
- OUString aName( mpObj->GetName() );
- rValue <<= aName;
- break;
- }
+ ::com::sun::star::awt::Rectangle aUnoRect(
+ basegfx::fround(aTopLeft.getX()),
+ basegfx::fround(aTopLeft.getY()),
+ basegfx::fround(aObjSize.getX()),
+ basegfx::fround(aObjSize.getY()) );
- case OWN_ATTR_LDBITMAP:
- {
- sal_uInt16 nId;
- if( mpObj->GetObjInventor() == SdrInventor && mpObj->GetObjIdentifier() == OBJ_OLE2 )
- {
- nId = RID_UNODRAW_OLE2;
+ rValue <<= aUnoRect;
+ break;
}
- else if( mpObj->GetObjInventor() == SdrInventor && mpObj->GetObjIdentifier() == OBJ_GRAF )
+
+ case OWN_ATTR_BOUNDRECT:
{
- nId = RID_UNODRAW_GRAPHICS;
+ const basegfx::B2DRange aRange( mpObj->getObjectRange(0) );
+ basegfx::B2DPoint aTopLeft( aRange.getMinimum() );
+ basegfx::B2DPoint aObjSize( aRange.getRange() );
+
+ ForceMetricTo100th_mm(aTopLeft);
+ ForceMetricTo100th_mm(aObjSize);
+
+ ::com::sun::star::awt::Rectangle aUnoRect(
+ basegfx::fround(aTopLeft.getX()),
+ basegfx::fround(aTopLeft.getY()),
+ basegfx::fround(aObjSize.getX()),
+ basegfx::fround(aObjSize.getY()) );
+
+ rValue <<= aUnoRect;
+ break;
}
- else
+
+ case OWN_ATTR_LDNAME:
{
- nId = RID_UNODRAW_OBJECTS;
+ OUString aName( mpObj->GetName() );
+ rValue <<= aName;
+ break;
}
- BitmapEx aBmp( SVX_RES(nId) );
- Reference< awt::XBitmap > xBmp( VCLUnoHelper::CreateBitmap( aBmp ) );
+ case OWN_ATTR_LDBITMAP:
+ {
+ sal_uInt16 nId;
+ if( mpObj->GetObjInventor() == SdrInventor && mpObj->GetObjIdentifier() == OBJ_OLE2 )
+ {
+ nId = RID_UNODRAW_OLE2;
+ }
+ else if( mpObj->GetObjInventor() == SdrInventor && mpObj->GetObjIdentifier() == OBJ_GRAF )
+ {
+ nId = RID_UNODRAW_GRAPHICS;
+ }
+ else
+ {
+ nId = RID_UNODRAW_OBJECTS;
+ }
- rValue <<= xBmp;
- break;
- }
+ BitmapEx aBmp( SVX_RES(nId) );
+ Reference< awt::XBitmap > xBmp( VCLUnoHelper::CreateBitmap( aBmp ) );
- case OWN_ATTR_MIRRORED:
- {
- sal_Bool bMirror = sal_False;
- if( mpObj.is() && mpObj->ISA(SdrGrafObj) )
- bMirror = ((SdrGrafObj*)mpObj.get())->IsMirrored();
+ rValue <<= xBmp;
+ break;
+ }
- rValue <<= bMirror;
- }
+ case OWN_ATTR_MIRRORED:
+ {
+ SdrGrafObj* pSdrGrafObj = dynamic_cast< SdrGrafObj* >(mpObj.get());
+ rValue <<= pSdrGrafObj ? (sal_Bool)pSdrGrafObj->IsMirrored() : sal_False;
+ }
- case OWN_ATTR_EDGE_START_OBJ:
- case OWN_ATTR_EDGE_START_POS:
- case OWN_ATTR_EDGE_END_POS:
- case OWN_ATTR_EDGE_END_OBJ:
- case OWN_ATTR_GLUEID_HEAD:
- case OWN_ATTR_GLUEID_TAIL:
- case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
- {
- SdrEdgeObj* pEdgeObj = dynamic_cast<SdrEdgeObj*>(mpObj.get());
- if(pEdgeObj)
+ case OWN_ATTR_EDGE_START_OBJ:
+ case OWN_ATTR_EDGE_START_POS:
+ case OWN_ATTR_EDGE_END_POS:
+ case OWN_ATTR_EDGE_END_OBJ:
+ case OWN_ATTR_GLUEID_HEAD:
+ case OWN_ATTR_GLUEID_TAIL:
+ case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
{
- switch(pProperty->nWID)
+ SdrEdgeObj* pEdgeObj = dynamic_cast<SdrEdgeObj*>(mpObj.get());
+ if(pEdgeObj)
{
- case OWN_ATTR_EDGE_START_OBJ:
- case OWN_ATTR_EDGE_END_OBJ:
+ switch(pProperty->nWID)
{
- SdrObject* pNode = pEdgeObj->GetConnectedNode(pProperty->nWID == OWN_ATTR_EDGE_START_OBJ);
- if(pNode)
+ case OWN_ATTR_EDGE_START_OBJ:
+ case OWN_ATTR_EDGE_END_OBJ:
{
- Reference< drawing::XShape > xShape( GetXShapeForSdrObject( pNode ) );
- if(xShape.is())
- rValue <<= xShape;
+ SdrObject* pNode = pEdgeObj->GetConnectedNode(pProperty->nWID == OWN_ATTR_EDGE_START_OBJ);
+ if(pNode)
+ {
+ Reference< drawing::XShape > xShape( GetXShapeForSdrObject( pNode ) );
+ if(xShape.is())
+ rValue <<= xShape;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_EDGE_START_POS:
- case OWN_ATTR_EDGE_END_POS:
- {
- Point aPoint( pEdgeObj->GetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS ) );
- if( mpModel->IsWriter() )
- aPoint -= mpObj->GetAnchorPos();
+ case OWN_ATTR_EDGE_START_POS:
+ case OWN_ATTR_EDGE_END_POS:
+ {
+ basegfx::B2DPoint aPoint(pEdgeObj->GetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS ));
- ForceMetricTo100th_mm( aPoint );
- awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
+ if(isWriterAnchorUsed())
+ {
+ aPoint -= mpObj->GetAnchorPos();
+ }
- rValue <<= aUnoPoint;
- break;
- }
- case OWN_ATTR_GLUEID_HEAD:
- case OWN_ATTR_GLUEID_TAIL:
- {
- rValue <<= pEdgeObj->getGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD );
- break;
- }
- case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
- {
- basegfx::B2DPolyPolygon aPolyPoly( pEdgeObj->GetEdgeTrackPath() );
- if( mpModel->IsWriter() )
+ ForceMetricTo100th_mm( aPoint );
+
+ awt::Point aUnoPoint( basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()) );
+
+ rValue <<= aUnoPoint;
+ break;
+ }
+ case OWN_ATTR_GLUEID_HEAD:
+ case OWN_ATTR_GLUEID_TAIL:
{
- Point aPoint( mpObj->GetAnchorPos() );
- aPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aPoint.X(), -aPoint.Y()));
+ rValue <<= pEdgeObj->getGluePointIndex( pProperty->nWID == OWN_ATTR_GLUEID_HEAD );
+ break;
+ }
+ case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
+ {
+ basegfx::B2DPolyPolygon aPolyPoly( pEdgeObj->GetEdgeTrackPath() );
+
+ if(isWriterAnchorUsed())
+ {
+ aPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpObj->GetAnchorPos()));
+ }
+
+ ForceMetricTo100th_mm( aPolyPoly );
+
+ drawing::PolyPolygonBezierCoords aRetval;
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(aPolyPoly, aRetval);
+ rValue <<= aRetval;
+ break;
}
- // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue 59051
- ForceMetricTo100th_mm( aPolyPoly );
- // <--
- drawing::PolyPolygonBezierCoords aRetval;
- SvxConvertB2DPolyPolygonToPolyPolygonBezier( aPolyPoly, aRetval);
- rValue <<= aRetval;
- break;
}
}
+ break;
}
- break;
- }
- case OWN_ATTR_MEASURE_START_POS:
- case OWN_ATTR_MEASURE_END_POS:
- {
- SdrMeasureObj* pMeasureObj = dynamic_cast<SdrMeasureObj*>(mpObj.get());
- if(pMeasureObj)
+ case OWN_ATTR_MEASURE_START_POS:
+ case OWN_ATTR_MEASURE_END_POS:
{
- Point aPoint( pMeasureObj->GetPoint( pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0 : 1 ) );
- if( mpModel->IsWriter() )
- aPoint -= mpObj->GetAnchorPos();
+ SdrMeasureObj* pMeasureObj = dynamic_cast<SdrMeasureObj*>(mpObj.get());
+ if(pMeasureObj)
+ {
+ basegfx::B2DPoint aPoint( pMeasureObj->GetObjectPoint( pProperty->nWID == OWN_ATTR_MEASURE_START_POS ? 0 : 1 ) );
+
+ if(isWriterAnchorUsed())
+ {
+ aPoint -= mpObj->GetAnchorPos();
+ }
- // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue 59051
- ForceMetricTo100th_mm( aPoint );
- // <--
- awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
+ ForceMetricTo100th_mm( aPoint );
- rValue <<= aUnoPoint;
+ awt::Point aUnoPoint( basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()) );
+
+ rValue <<= aUnoPoint;
+ break;
+ }
break;
}
- break;
- }
- case OWN_ATTR_FILLBMP_MODE:
- {
- const SfxItemSet& rObjItemSet = mpObj->GetMergedItemSet();
+ case OWN_ATTR_FILLBMP_MODE:
+ {
+ const SfxItemSet& rObjItemSet = mpObj->GetMergedItemSet();
- XFillBmpStretchItem* pStretchItem = (XFillBmpStretchItem*)&rObjItemSet.Get(XATTR_FILLBMP_STRETCH);
- XFillBmpTileItem* pTileItem = (XFillBmpTileItem*)&rObjItemSet.Get(XATTR_FILLBMP_TILE);
+ XFillBmpStretchItem* pStretchItem = (XFillBmpStretchItem*)&rObjItemSet.Get(XATTR_FILLBMP_STRETCH);
+ XFillBmpTileItem* pTileItem = (XFillBmpTileItem*)&rObjItemSet.Get(XATTR_FILLBMP_TILE);
- if( pTileItem && pTileItem->GetValue() )
- {
- rValue <<= drawing::BitmapMode_REPEAT;
+ if( pTileItem && pTileItem->GetValue() )
+ {
+ rValue <<= drawing::BitmapMode_REPEAT;
+ }
+ else if( pStretchItem && pStretchItem->GetValue() )
+ {
+ rValue <<= drawing::BitmapMode_STRETCH;
+ }
+ else
+ {
+ rValue <<= drawing::BitmapMode_NO_REPEAT;
+ }
+ break;
}
- else if( pStretchItem && pStretchItem->GetValue() )
+ case SDRATTR_LAYERID:
+ rValue <<= (sal_Int16)mpObj->GetLayer();
+ break;
+
+ case SDRATTR_LAYERNAME:
{
- rValue <<= drawing::BitmapMode_STRETCH;
+ SdrLayer* pLayer = mpModel->GetModelLayerAdmin().GetLayerPerID(mpObj->GetLayer());
+ if( pLayer )
+ {
+ OUString aName( pLayer->GetName() );
+ rValue <<= aName;
+ }
+ break;
}
- else
+
+ case SDRATTR_ROTATEANGLE:
{
- rValue <<= drawing::BitmapMode_NO_REPEAT;
+ const long aOldRotation(sdr::legacy::GetRotateAngle(*mpObj.get()));
+ rValue <<= aOldRotation;
+ break;
}
- break;
- }
- case SDRATTR_LAYERID:
- rValue <<= (sal_Int16)mpObj->GetLayer();
- break;
- case SDRATTR_LAYERNAME:
- {
- SdrLayer* pLayer = mpModel->GetLayerAdmin().GetLayerPerID(mpObj->GetLayer());
- if( pLayer )
+ case SDRATTR_SHEARANGLE:
{
- OUString aName( pLayer->GetName() );
- rValue <<= aName;
+ const long aOldShear(sdr::legacy::GetShearAngleX(*mpObj.get()));
+ rValue <<= aOldShear;
+ break;
}
- break;
- }
- case SDRATTR_ROTATEANGLE:
- rValue <<= mpObj->GetRotateAngle();
- break;
-
- case SDRATTR_SHEARANGLE:
- rValue <<= mpObj->GetShearAngle();
- break;
-
- case SDRATTR_OBJMOVEPROTECT:
- rValue = uno::makeAny( (sal_Bool) mpObj->IsMoveProtect() );
- break;
+ case SDRATTR_OBJMOVEPROTECT:
+ rValue = uno::makeAny( (sal_Bool) mpObj->IsMoveProtect() );
+ break;
- case SDRATTR_OBJECTNAME:
- {
- OUString aName( mpObj->GetName() );
- rValue <<= aName;
- break;
- }
+ case SDRATTR_OBJECTNAME:
+ {
+ OUString aName( mpObj->GetName() );
+ rValue <<= aName;
+ break;
+ }
- // #i68101#
- case OWN_ATTR_MISC_OBJ_TITLE:
- {
- OUString aTitle( mpObj->GetTitle() );
- rValue <<= aTitle;
- break;
- }
+ // #i68101#
+ case OWN_ATTR_MISC_OBJ_TITLE:
+ {
+ OUString aTitle( mpObj->GetTitle() );
+ rValue <<= aTitle;
+ break;
+ }
- case OWN_ATTR_MISC_OBJ_DESCRIPTION:
- {
- OUString aDescription( mpObj->GetDescription() );
- rValue <<= aDescription;
- break;
- }
+ case OWN_ATTR_MISC_OBJ_DESCRIPTION:
+ {
+ OUString aDescription( mpObj->GetDescription() );
+ rValue <<= aDescription;
+ break;
+ }
- case SDRATTR_OBJPRINTABLE:
- rValue <<= static_cast<sal_Bool>( mpObj->IsPrintable() );
- break;
+ case SDRATTR_OBJPRINTABLE:
+ rValue = uno::makeAny( (sal_Bool) mpObj->IsPrintable() );
+ break;
- case SDRATTR_OBJVISIBLE:
- rValue <<= static_cast<sal_Bool>( mpObj->IsVisible() );
- break;
+ case SDRATTR_OBJVISIBLE:
+ rValue <<= static_cast<sal_Bool>( mpObj->IsVisible() );
+ break;
- case SDRATTR_OBJSIZEPROTECT:
- rValue <<= static_cast<sal_Bool>( mpObj->IsResizeProtect() );
- break;
+ case SDRATTR_OBJSIZEPROTECT:
+ rValue = uno::makeAny( (sal_Bool)mpObj->IsResizeProtect() );
+ break;
- case OWN_ATTR_PAGE_NUMBER:
- {
- SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>(mpObj.get());
- if(pPageObj)
+ case OWN_ATTR_PAGE_NUMBER:
{
- SdrPage* pPage = pPageObj->GetReferencedPage();
- sal_Int32 nPageNumber = (pPage) ? pPage->GetPageNum() : 0L;
- nPageNumber++;
- nPageNumber >>= 1;
- rValue <<= nPageNumber;
+ SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>(mpObj.get());
+ if(pPageObj)
+ {
+ SdrPage* pPage = pPageObj->GetReferencedPage();
+ sal_Int32 nPageNumber = (pPage) ? pPage->GetPageNumber() : 0;
+ nPageNumber++;
+ nPageNumber >>= 1;
+ rValue <<= nPageNumber;
+ }
+ break;
}
- break;
- }
- case OWN_ATTR_UINAME_SINGULAR:
- {
- String aTmp;
- mpObj->TakeObjNameSingul( aTmp );
- rValue <<= OUString( aTmp );
- break;
- }
+ case OWN_ATTR_UINAME_SINGULAR:
+ {
+ String aTmp;
+ mpObj->TakeObjNameSingul( aTmp );
+ rValue <<= OUString( aTmp );
+ break;
+ }
- case OWN_ATTR_UINAME_PLURAL:
- {
- String aTmp;
- mpObj->TakeObjNamePlural( aTmp );
- rValue <<= OUString( aTmp );
- break;
- }
- case OWN_ATTR_METAFILE:
- {
- SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(mpObj.get());
- if( pObj )
+ case OWN_ATTR_UINAME_PLURAL:
+ {
+ String aTmp;
+ mpObj->TakeObjNamePlural( aTmp );
+ rValue <<= OUString( aTmp );
+ break;
+ }
+ case OWN_ATTR_METAFILE:
{
- Graphic* pGraphic = pObj->GetGraphic();
- if( pGraphic )
+ SdrOle2Obj* pObj = dynamic_cast<SdrOle2Obj*>(mpObj.get());
+ if( pObj )
{
- sal_Bool bIsWMF = sal_False;
- if ( pGraphic->IsLink() )
+ Graphic* pGraphic = pObj->GetGraphic();
+ if( pGraphic )
{
- GfxLink aLnk = pGraphic->GetLink();
- if ( aLnk.GetType() == GFX_LINK_TYPE_NATIVE_WMF )
+ bool bIsWMF = false;
+ if ( pGraphic->IsLink() )
{
- bIsWMF = sal_True;
- uno::Sequence<sal_Int8> aSeq((sal_Int8*)aLnk.GetData(), (sal_Int32) aLnk.GetDataSize());
+ GfxLink aLnk = pGraphic->GetLink();
+ if ( aLnk.GetType() == GFX_LINK_TYPE_NATIVE_WMF )
+ {
+ bIsWMF = true;
+ uno::Sequence<sal_Int8> aSeq((sal_Int8*)aLnk.GetData(), (sal_Int32) aLnk.GetDataSize());
+ rValue <<= aSeq;
+ }
+ }
+ if ( !bIsWMF )
+ {
+ // #119735# just use GetGDIMetaFile, it will create a bufferd version of contained bitmap now automatically
+ GDIMetaFile aMtf(pObj->GetGraphic()->GetGDIMetaFile());
+ SvMemoryStream aDestStrm( 65535, 65535 );
+ ConvertGDIMetaFileToWMF( aMtf, aDestStrm, NULL, sal_False );
+ const uno::Sequence<sal_Int8> aSeq(
+ static_cast< const sal_Int8* >(aDestStrm.GetData()),
+ aDestStrm.GetEndOfData());
rValue <<= aSeq;
}
}
- if ( !bIsWMF )
- {
- // #119735# just use GetGDIMetaFile, it will create a bufferd version of contained bitmap now automatically
- GDIMetaFile aMtf(pObj->GetGraphic()->GetGDIMetaFile());
- SvMemoryStream aDestStrm( 65535, 65535 );
- ConvertGDIMetaFileToWMF( aMtf, aDestStrm, NULL, sal_False );
- const uno::Sequence<sal_Int8> aSeq(
- static_cast< const sal_Int8* >(aDestStrm.GetData()),
- aDestStrm.GetEndOfData());
- rValue <<= aSeq;
- }
}
+ else
+ {
+ rValue = GetBitmap( sal_True );
+ }
+ break;
}
- else
+
+ case OWN_ATTR_CIRCSTARTANGLE:
+ case OWN_ATTR_CIRCENDANGLE:
{
- rValue = GetBitmap( sal_True );
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(mpObj.get());
+
+ if(pSdrCircObj && CircleType_Circle != pSdrCircObj->GetSdrCircleObjType())
+ {
+ const double fAngle(OWN_ATTR_CIRCSTARTANGLE == pProperty->nWID ? pSdrCircObj->GetStartAngle() : pSdrCircObj->GetEndAngle());
+ const sal_Int32 nOldAngle(basegfx::fround(((F_2PI - fAngle) * 18000.0) / F_PI) % 36000);
+
+ rValue <<= nOldAngle;
+ }
+
+ break;
}
- break;
- }
+ case OWN_ATTR_CIRCKIND:
+ {
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(mpObj.get());
+ if(pSdrCircObj)
+ {
+ drawing::CircleKind eKind;
- default:
- return false;
+ switch(pSdrCircObj->GetSdrCircleObjType())
+ {
+ case CircleType_Circle:
+ {
+ eKind = drawing::CircleKind_FULL;
+ break;
+ }
+ case CircleType_Sector:
+ {
+ eKind = drawing::CircleKind_CUT;
+ break;
+ }
+ case CircleType_Arc:
+ {
+ eKind = drawing::CircleKind_ARC;
+ break;
+ }
+ case CircleType_Segment:
+ {
+ eKind = drawing::CircleKind_SECTION;
+ break;
+ }
+ }
+
+ rValue <<= eKind;
+ }
+ break;
+ }
+
+ default:
+ {
+ return false;
+ }
}
return true;
}
@@ -3121,7 +3326,6 @@ uno::Sequence< beans::PropertyState > SAL_CALL SvxShape::getPropertyStates( cons
{
for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ )
pState[nIdx] = getPropertyState( pNames[nIdx] );
-
}
else
{
@@ -3215,7 +3419,7 @@ void SvxShape::setAllPropertiesToDefault() throw (uno::RuntimeException)
throw lang::DisposedException();
mpObj->ClearMergedItem(); // nWhich == 0 => all
- if(mpObj->ISA(SdrGrafObj))
+ if(dynamic_cast< SdrGrafObj* >(mpObj.get()))
{
// defaults for graphic objects have changed:
mpObj->SetMergedItem( XFillStyleItem( XFILL_NONE ) );
@@ -3227,7 +3431,7 @@ void SvxShape::setAllPropertiesToDefault() throw (uno::RuntimeException)
// does not load lathe or extrude objects, it is possible to set the items
// here.
// For other solution possibilities, see task description.
- if(mpObj->ISA(E3dLatheObj) || mpObj->ISA(E3dExtrudeObj))
+ if(dynamic_cast< E3dLatheObj* >(mpObj.get()) || dynamic_cast< E3dExtrudeObj* >(mpObj.get()))
{
mpObj->SetMergedItem(Svx3DCharacterModeItem(true));
}
@@ -3331,19 +3535,18 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
{
OGuard aGuard( Application::GetSolarMutex() );
- if( mpObj.is() && mpObj->GetObjInventor() == SdrInventor)
+ if(mpObj.is())
{
- const sal_uInt16 nIdent = mpObj->GetObjIdentifier();
-
- switch(nIdent)
+ if(SdrInventor == mpObj->GetObjInventor())
{
- case OBJ_GRUP:
+ const sal_uInt16 nIdent = mpObj->GetObjIdentifier();
+
+ switch(nIdent)
{
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_GRUP:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_GroupServices;
@@ -3353,17 +3556,13 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_GroupServices;
}
- }
- return *pSeq;
- }
- case OBJ_CUSTOMSHAPE:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ return *pSeq;
+ }
+ case OBJ_CUSTOMSHAPE:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_CustomShapeServices;
@@ -3385,24 +3584,26 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
sUNO_service_drawing_RotationDescriptor);
pSeq = &SvxShape_CustomShapeServices;
}
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_LINE:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_POLY:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
- static uno::Sequence< OUString > SvxShape_LineServices;
+ // line
+ static uno::Sequence< OUString > SvxShape_AllPolyPolygonServices;
- comphelper::ServiceInfoHelper::addToSequence( SvxShape_LineServices,14,
- sUNO_service_drawing_LineShape,
+ comphelper::ServiceInfoHelper::addToSequence( SvxShape_AllPolyPolygonServices,20,
+ sUNO_service_drawing_LineShape, // drawing.LineShape
+ sUNO_service_drawing_PolyLineShape, // drawing.PolyLineShape // pathplin, plin
+ sUNO_service_drawing_PolyPolygonShape, // drawing.PolyPolygonShape // pathpoly, poly
+ sUNO_service_drawing_OpenBezierShape, // drawing.OpenBezierShape // freeline, pathline
+ sUNO_service_drawing_ClosedBezierShape, // drawing.ClosedBezierShape // freefill, pathfill
sUNO_service_drawing_Shape,
sUNO_service_drawing_LineProperties,
+ sUNO_service_drawing_FillProperties, // pathpoly, poly, freeline, pathline, freefill, pathfill
sUNO_service_drawing_Text,
sUNO_service_drawing_TextProperties,
@@ -3414,22 +3615,20 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
sUNO_service_style_CharacterPropertiesAsian,
sUNO_service_drawing_PolyPolygonDescriptor,
+ sUNO_service_drawing_PolyPolygonBezierDescriptor, // freeline, pathline, freefill, pathfill
+
sUNO_service_drawing_ShadowProperties,
sUNO_service_drawing_RotationDescriptor);
- pSeq = &SvxShape_LineServices;
+ pSeq = &SvxShape_AllPolyPolygonServices;
}
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_RECT:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_RECT:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_RectServices;
@@ -3452,21 +3651,13 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
sUNO_service_drawing_RotationDescriptor);
pSeq = &SvxShape_RectServices;
}
-
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_CIRC:
- case OBJ_SECT:
- case OBJ_CARC:
- case OBJ_CCUT:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_CIRC:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_CircServices;
@@ -3491,168 +3682,16 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_CircServices;
}
- }
-
- return *pSeq;
- }
-
- case OBJ_PATHPLIN:
- case OBJ_PLIN:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
- {
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
- {
- static uno::Sequence< OUString > SvxShape_PathServices;
- comphelper::ServiceInfoHelper::addToSequence( SvxShape_PathServices,14,
- sUNO_service_drawing_PolyLineShape,
-
- sUNO_service_drawing_Shape,
- sUNO_service_drawing_LineProperties,
-
- sUNO_service_drawing_PolyPolygonDescriptor,
-
- sUNO_service_drawing_Text,
- sUNO_service_drawing_TextProperties,
- sUNO_service_style_ParagraphProperties,
- sUNO_service_style_ParagraphPropertiesComplex,
- sUNO_service_style_ParagraphPropertiesAsian,
- sUNO_service_style_CharacterProperties,
- sUNO_service_style_CharacterPropertiesComplex,
- sUNO_service_style_CharacterPropertiesAsian,
-
- sUNO_service_drawing_ShadowProperties,
- sUNO_service_drawing_RotationDescriptor);
- pSeq = &SvxShape_PathServices;
- }
- }
- return *pSeq;
- }
-
- case OBJ_PATHPOLY:
- case OBJ_POLY:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
- {
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
- {
- static uno::Sequence< OUString > SvxShape_PolyServices;
- comphelper::ServiceInfoHelper::addToSequence( SvxShape_PolyServices,15,
- sUNO_service_drawing_PolyPolygonShape,
-
- sUNO_service_drawing_Shape,
- sUNO_service_drawing_LineProperties,
- sUNO_service_drawing_FillProperties,
-
- sUNO_service_drawing_PolyPolygonDescriptor,
-
- sUNO_service_drawing_Text,
- sUNO_service_drawing_TextProperties,
- sUNO_service_style_ParagraphProperties,
- sUNO_service_style_ParagraphPropertiesComplex,
- sUNO_service_style_ParagraphPropertiesAsian,
- sUNO_service_style_CharacterProperties,
- sUNO_service_style_CharacterPropertiesComplex,
- sUNO_service_style_CharacterPropertiesAsian,
-
- sUNO_service_drawing_ShadowProperties,
- sUNO_service_drawing_RotationDescriptor);
-
- pSeq = &SvxShape_PolyServices;
- }
- }
- return *pSeq;
- }
-
- case OBJ_FREELINE:
- case OBJ_PATHLINE:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
- {
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
- {
- static uno::Sequence< OUString > SvxShape_FreeLineServices;
-
- comphelper::ServiceInfoHelper::addToSequence( SvxShape_FreeLineServices,15,
- sUNO_service_drawing_OpenBezierShape,
-
- sUNO_service_drawing_Shape,
- sUNO_service_drawing_LineProperties,
- sUNO_service_drawing_FillProperties,
-
- sUNO_service_drawing_PolyPolygonBezierDescriptor,
-
- sUNO_service_drawing_Text,
- sUNO_service_drawing_TextProperties,
- sUNO_service_style_ParagraphProperties,
- sUNO_service_style_ParagraphPropertiesComplex,
- sUNO_service_style_ParagraphPropertiesAsian,
- sUNO_service_style_CharacterProperties,
- sUNO_service_style_CharacterPropertiesComplex,
- sUNO_service_style_CharacterPropertiesAsian,
-
- sUNO_service_drawing_ShadowProperties,
- sUNO_service_drawing_RotationDescriptor);
- pSeq = &SvxShape_FreeLineServices;
- }
+ return *pSeq;
}
- return *pSeq;
- }
-
- case OBJ_FREEFILL:
- case OBJ_PATHFILL:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_OUTLINETEXT:
+ case OBJ_TITLETEXT:
+ case OBJ_TEXT:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
- {
- static uno::Sequence< OUString > SvxShape_FreeFillServices;
- comphelper::ServiceInfoHelper::addToSequence( SvxShape_FreeFillServices,15,
- sUNO_service_drawing_ClosedBezierShape,
-
- sUNO_service_drawing_Shape,
- sUNO_service_drawing_LineProperties,
- sUNO_service_drawing_FillProperties,
-
- sUNO_service_drawing_PolyPolygonBezierDescriptor,
-
- sUNO_service_drawing_Text,
- sUNO_service_drawing_TextProperties,
- sUNO_service_style_ParagraphProperties,
- sUNO_service_style_ParagraphPropertiesComplex,
- sUNO_service_style_ParagraphPropertiesAsian,
- sUNO_service_style_CharacterProperties,
- sUNO_service_style_CharacterPropertiesComplex,
- sUNO_service_style_CharacterPropertiesAsian,
-
- sUNO_service_drawing_ShadowProperties,
- sUNO_service_drawing_RotationDescriptor);
-
- pSeq = &SvxShape_FreeFillServices;
- }
- }
- return *pSeq;
- }
-
- case OBJ_OUTLINETEXT:
- case OBJ_TITLETEXT:
- case OBJ_TEXT:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
- {
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_TextServices;
comphelper::ServiceInfoHelper::addToSequence( SvxShape_TextServices,14,
@@ -3676,17 +3715,13 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_TextServices;
}
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_GRAF:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_GRAF:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_GrafServices;
comphelper::ServiceInfoHelper::addToSequence( SvxShape_GrafServices, 12,
@@ -3708,17 +3743,13 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_GrafServices;
}
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_OLE2:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_OLE2:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_Ole2Services;
@@ -3741,17 +3772,13 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_Ole2Services;
}
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_CAPTION:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_CAPTION:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_CaptionServices;
@@ -3776,18 +3803,14 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_CaptionServices;
}
- }
- return *pSeq;
- }
+ return *pSeq;
+ }
- case OBJ_PAGE:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_PAGE:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_PageServices;
@@ -3797,18 +3820,14 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_PageServices;
}
- }
- return *pSeq;
- }
+ return *pSeq;
+ }
- case OBJ_MEASURE:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_MEASURE:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_MeasureServices;
comphelper::ServiceInfoHelper::addToSequence( SvxShape_MeasureServices,15,
@@ -3834,18 +3853,14 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_MeasureServices;
}
- }
- return *pSeq;
- }
+ return *pSeq;
+ }
- case OBJ_FRAME:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_FRAME:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_FrameServices;
@@ -3855,18 +3870,14 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_FrameServices;
}
- }
- return *pSeq;
- }
+ return *pSeq;
+ }
- case OBJ_UNO:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_UNO:
{
-// OGuard _aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_UnoServices;
comphelper::ServiceInfoHelper::addToSequence( SvxShape_UnoServices, 2,
@@ -3875,17 +3886,13 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_UnoServices;
}
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_EDGE:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_EDGE:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_EdgeServices;
@@ -3911,16 +3918,12 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_EdgeServices;
}
+ return *pSeq;
}
- return *pSeq;
- }
- case OBJ_MEDIA:
- {
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
+ case OBJ_MEDIA:
{
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_MediaServices;
@@ -3930,22 +3933,18 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_MediaServices;
}
+ return *pSeq;
}
- return *pSeq;
}
}
- }
- else if( mpObj.is() && mpObj->GetObjInventor() == FmFormInventor)
- {
+ else if(FmFormInventor == mpObj->GetObjInventor())
+ {
#if OSL_DEBUG_LEVEL > 0
- const sal_uInt16 nIdent = mpObj->GetObjIdentifier();
- OSL_ENSURE( nIdent == OBJ_UNO, "SvxShape::_getSupportedServiceNames: FmFormInventor, but no UNO object?" );
+ const sal_uInt16 nIdent = mpObj->GetObjIdentifier();
+ OSL_ENSURE( nIdent == OBJ_UNO, "SvxShape::_getSupportedServiceNames: FmFormInventor, but no UNO object?" );
#endif
- static uno::Sequence< OUString > *pSeq = 0;
- if( 0 == pSeq )
- {
-// OGuard aGuard( Application::GetSolarMutex() );
-// if( 0 == pSeq )
+ static uno::Sequence< OUString > *pSeq = 0;
+ if( 0 == pSeq )
{
static uno::Sequence< OUString > SvxShape_UnoServices;
comphelper::ServiceInfoHelper::addToSequence( SvxShape_UnoServices, 2,
@@ -3954,9 +3953,10 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames()
pSeq = &SvxShape_UnoServices;
}
+ return *pSeq;
}
- return *pSeq;
}
+
OSL_ENSURE( false, "SvxShape::_getSupportedServiceNames: could not determine object type!" );
uno::Sequence< OUString > aSeq;
return aSeq;
@@ -4001,24 +4001,23 @@ uno::Reference< uno::XInterface > SAL_CALL SvxShape::getParent( )
{
OGuard aGuard( Application::GetSolarMutex() );
- if( mpObj.is() && mpObj->GetObjList() )
+ if( mpObj.is() && mpObj->getParentOfSdrObject() )
{
- SdrObjList* pObjList = mpObj->GetObjList();
+ SdrObjList* pObjList = mpObj->getParentOfSdrObject();
+ SdrPage* pPage = dynamic_cast< SdrPage* >(pObjList);
- switch( pObjList->GetListKind() )
+ if(pPage)
{
- case SDROBJLIST_GROUPOBJ:
- if( pObjList->GetOwnerObj()->ISA( SdrObjGroup ) )
- return PTR_CAST( SdrObjGroup, pObjList->GetOwnerObj())->getUnoShape();
- else if( pObjList->GetOwnerObj()->ISA( E3dScene ) )
- return PTR_CAST( E3dScene, pObjList->GetOwnerObj())->getUnoShape();
- break;
- case SDROBJLIST_DRAWPAGE:
- case SDROBJLIST_MASTERPAGE:
- return PTR_CAST( SdrPage, pObjList )->getUnoPage();
- default:
- DBG_ERROR( "SvxShape::getParent( ): unexpected SdrObjListKind" );
- break;
+ return pPage->getUnoPage();
+ }
+
+ if(pObjList->getSdrObjectFromSdrObjList())
+ {
+ return pObjList->getSdrObjectFromSdrObjList()->getUnoShape();
+ }
+
+ {
+ DBG_ERROR( "SvxShape::getParent( ): unexpected SdrObjList" );
}
}
@@ -4114,52 +4113,19 @@ sal_Int16 SAL_CALL SvxShape::resetActionLocks( ) throw (::com::sun::star::uno::
return nOldLocks;
}
-//----------------------------------------------------------------------
-
-/** since polygon shapes can change theire kind during editing, we have
- to recheck it here.
- Circle shapes also change theire kind, but theire all treated equal
- so no update is necessary.
-*/
-void SvxShape::updateShapeKind()
-{
- switch( mpImpl->mnObjId )
- {
- case OBJ_LINE:
- case OBJ_POLY:
- case OBJ_PLIN:
- case OBJ_PATHLINE:
- case OBJ_PATHFILL:
- case OBJ_FREELINE:
- case OBJ_FREEFILL:
- case OBJ_PATHPOLY:
- case OBJ_PATHPLIN:
- {
- const sal_uInt32 nId = mpObj->GetObjIdentifier();
-
- if( nId != mpImpl->mnObjId )
- {
- mpImpl->mnObjId = nId;
-
- }
- break;
- }
- };
-}
-
/***********************************************************************
* class SvxShapeText *
***********************************************************************/
SvxShapeText::SvxShapeText() throw ()
-: SvxShape(NULL, aSvxMapProvider.GetMap(SVXMAP_TEXT), aSvxMapProvider.GetPropertySet(SVXMAP_TEXT, SdrObject::GetGlobalDrawObjectItemPool()) ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
+: SvxShape(NULL, aSvxMapProvider.GetMap(SVXMAP_TEXT), aSvxMapProvider.GetPropertySet(SVXMAP_TEXT, GetGlobalDrawObjectItemPool()) ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
{
}
//----------------------------------------------------------------------
SvxShapeText::SvxShapeText( SdrObject* pObject ) throw ()
-: SvxShape( pObject, aSvxMapProvider.GetMap(SVXMAP_TEXT), aSvxMapProvider.GetPropertySet(SVXMAP_TEXT, SdrObject::GetGlobalDrawObjectItemPool()) ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
+: SvxShape( pObject, aSvxMapProvider.GetMap(SVXMAP_TEXT), aSvxMapProvider.GetPropertySet(SVXMAP_TEXT, GetGlobalDrawObjectItemPool()) ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
{
- if( pObject && pObject->GetModel() )
+ if( pObject )
SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< uno::XWeak * >( this ) ) );
}
@@ -4167,7 +4133,7 @@ SvxShapeText::SvxShapeText( SdrObject* pObject ) throw ()
SvxShapeText::SvxShapeText( SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet ) throw ()
: SvxShape( pObject, pPropertyMap, pPropertySet ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() )
{
- if( pObject && pObject->GetModel() )
+ if( pObject )
SetEditSource( new SvxTextEditSource( pObject, 0, static_cast< uno::XWeak * >( this ) ) );
}
@@ -4392,16 +4358,13 @@ bool SvxShapeText::setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* p
/***********************************************************************
* class SvxShapeRect *
***********************************************************************/
-DBG_NAME(SvxShapeRect)
SvxShapeRect::SvxShapeRect( SdrObject* pObj ) throw()
-: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_SHAPE), aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE, SdrObject::GetGlobalDrawObjectItemPool()))
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_SHAPE), aSvxMapProvider.GetPropertySet(SVXMAP_SHAPE, GetGlobalDrawObjectItemPool()))
{
- DBG_CTOR(SvxShapeRect,NULL);
}
SvxShapeRect::~SvxShapeRect() throw()
{
- DBG_DTOR(SvxShapeRect,NULL);
}
uno::Any SAL_CALL SvxShapeRect::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index a74f1ddb1117..d3e81084e01a 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -51,7 +51,9 @@
#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
#include <comphelper/processfactory.hxx>
#include <vos/mutex.hxx>
+#include <svx/svdlegacy.hxx>
#include <svx/sdrpaintwindow.hxx>
+#include <svx/sdrtexthelpers.hxx>
using namespace ::osl;
using namespace ::vos;
@@ -86,7 +88,7 @@ namespace css = ::com::sun::star;
reflected on the screen. If the object leaves edit mode, the old
behaviour is restored.</p>
*/
-class SvxTextEditSourceImpl : public SfxListener, public SfxBroadcaster, public sdr::ObjectUser
+class SvxTextEditSourceImpl : public SfxListener, public SfxBroadcaster
{
private:
oslInterlockedCount maRefCount;
@@ -100,7 +102,7 @@ private:
SvxOutlinerForwarder* mpTextForwarder;
SvxDrawOutlinerViewForwarder* mpViewForwarder; // if non-NULL, use GetViewModeTextForwarder text forwarder
css::uno::Reference< css::linguistic2::XLinguServiceManager > m_xLinguServiceManager;
- Point maTextOffset;
+ basegfx::B2DVector maTextOffset;
sal_Bool mbDataValid;
sal_Bool mbDestroyed;
sal_Bool mbIsLocked;
@@ -122,7 +124,7 @@ private:
sal_Bool HasView() const { return mpView ? sal_True : sal_False; }
sal_Bool IsEditMode() const
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
return mbShapeIsEditMode && pTextObj && pTextObj->IsTextEditActive() ? sal_True : sal_False;
}
@@ -160,10 +162,6 @@ public:
DECL_LINK( NotifyHdl, EENotify* );
- virtual void ObjectInDestruction(const SdrObject& rObject);
-
- void ChangeModel( SdrModel* pNewModel );
-
void UpdateOutliner();
};
@@ -175,7 +173,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText
mpText ( pText ),
mpView ( NULL ),
mpWindow ( NULL ),
- mpModel ( pObject ? pObject->GetModel() : NULL ),
+ mpModel ( &pObject->getSdrModelFromSdrObject() ),
mpOutliner ( NULL ),
mpTextForwarder ( NULL ),
mpViewForwarder ( NULL ),
@@ -199,10 +197,14 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText
}
if( mpModel )
+ {
StartListening( *mpModel );
+ }
if( mpObject )
- mpObject->AddObjectUser( *this );
+ {
+ StartListening(*mpObject);
+ }
}
//------------------------------------------------------------------------
@@ -213,7 +215,7 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrText* pText
mpText ( pText ),
mpView ( &rView ),
mpWindow ( &rWindow ),
- mpModel ( rObject.GetModel() ),
+ mpModel ( &rObject.getSdrModelFromSdrObject() ),
mpOutliner ( NULL ),
mpTextForwarder ( NULL ),
mpViewForwarder ( NULL ),
@@ -235,11 +237,19 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrText* pText
}
if( mpModel )
+ {
StartListening( *mpModel );
+ }
+
if( mpView )
+ {
StartListening( *mpView );
+ }
+
if( mpObject )
- mpObject->AddObjectUser( *this );
+ {
+ StartListening(*mpObject);
+ }
// #104157# Init edit mode state from shape info (IsTextEditActive())
mbShapeIsEditMode = IsEditMode();
@@ -250,8 +260,11 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& rObject, SdrText* pText
SvxTextEditSourceImpl::~SvxTextEditSourceImpl()
{
DBG_ASSERT( mbIsLocked == sal_False, "text edit source was not unlocked before dispose!" );
+
if( mpObject )
- mpObject->RemoveObjectUser( *this );
+ {
+ EndListening(*mpObject);
+ }
dispose();
}
@@ -295,60 +308,14 @@ void SAL_CALL SvxTextEditSourceImpl::release()
delete this;
}
-void SvxTextEditSourceImpl::ChangeModel( SdrModel* pNewModel )
-{
- if( mpModel != pNewModel )
- {
- if( mpModel )
- EndListening( *mpModel );
-
- if( mpOutliner )
- {
- if( mpModel )
- mpModel->disposeOutliner( mpOutliner );
- else
- delete mpOutliner;
- mpOutliner = 0;
- }
-
- if( mpView )
- {
- EndListening( *mpView );
- mpView = 0;
- }
-
- mpWindow = 0;
- m_xLinguServiceManager.clear();
- mpOwner = 0;
-
- mpModel = pNewModel;
-
- if( mpTextForwarder )
- {
- delete mpTextForwarder;
- mpTextForwarder = 0;
- }
-
- if( mpViewForwarder )
- {
- delete mpViewForwarder;
- mpViewForwarder = 0;
- }
-
- if( mpModel )
- StartListening( *mpModel );
- }
-}
-
//------------------------------------------------------------------------
void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// #i105988 keep reference to this object
rtl::Reference< SvxTextEditSourceImpl > xThis( this );
-
- const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+ const SvxViewHint* pViewHint = dynamic_cast< const SvxViewHint* >(&rHint);
if( pViewHint )
{
@@ -361,9 +328,11 @@ void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else if( pSdrHint )
{
- switch( pSdrHint->GetKind() )
+ switch( pSdrHint->GetSdrHintKind() )
{
- case HINT_OBJCHG:
+ case HINT_OBJCHG_MOVE:
+ case HINT_OBJCHG_RESIZE:
+ case HINT_OBJCHG_ATTR:
{
mbDataValid = sal_False; // Text muss neu geholt werden
@@ -371,7 +340,7 @@ void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// #104157# Update maTextOffset, object has changed
// #105196#, #105203#: Cannot call that // here,
- // since TakeTextRect() (called from there) //
+ // since TakeTextRange() (called from there) //
// changes outliner content.
// UpdateOutliner();
@@ -381,9 +350,9 @@ void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
break;
}
-
case HINT_BEGEDIT:
- if( mpObject == pSdrHint->GetObject() )
+ {
+ if( mpObject == pSdrHint->GetSdrHintObject() )
{
// invalidate old forwarder
if( !mbForwarderIsEditMode )
@@ -402,9 +371,10 @@ void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
Broadcast( *pSdrHint );
}
break;
-
+ }
case HINT_ENDEDIT:
- if( mpObject == pSdrHint->GetObject() )
+ {
+ if( mpObject == pSdrHint->GetSdrHintObject() )
{
Broadcast( *pSdrHint );
@@ -433,24 +403,30 @@ void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
break;
-
+ }
case HINT_MODELCLEARED:
+ {
dispose();
break;
+ }
+ case HINT_SDROBJECTDYING:
+ {
+ if(mpObject && pSdrHint->GetSdrHintObject() && pSdrHint->GetSdrHintObject() == mpObject)
+ {
+ mpObject = 0;
+ dispose();
+ Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
+ }
+ break;
+ }
default:
+ {
break;
+ }
}
}
}
-/* this is a callback from the attached SdrObject when it is actually deleted */
-void SvxTextEditSourceImpl::ObjectInDestruction(const SdrObject&)
-{
- mpObject = 0;
- dispose();
- Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
-}
-
/* unregister at all objects and set all references to 0 */
void SvxTextEditSourceImpl::dispose()
{
@@ -493,7 +469,7 @@ void SvxTextEditSourceImpl::dispose()
if( mpObject )
{
- mpObject->RemoveObjectUser( *this );
+ EndListening(*mpObject);
mpObject = 0;
}
mpWindow = 0;
@@ -509,15 +485,15 @@ void SvxTextEditSourceImpl::SetupOutliner()
// layout
if( mpObject && mpOutliner )
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
- Rectangle aPaintRect;
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
if( pTextObj )
{
- Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() );
- pTextObj->SetupOutlinerFormatting( *mpOutliner, aPaintRect );
+ basegfx::B2DRange aBoundRange(pTextObj->getObjectRange(0));
+ basegfx::B2DRange aPaintRange;
+ pTextObj->SetupOutlinerFormatting( *mpOutliner, aPaintRange );
// #101029# calc text offset from shape anchor
- maTextOffset = aPaintRect.TopLeft() - aBoundRect.TopLeft();
+ maTextOffset = aPaintRange.getMinimum() - aBoundRange.getMinimum();
}
}
}
@@ -532,15 +508,15 @@ void SvxTextEditSourceImpl::UpdateOutliner()
// layout
if( mpObject && mpOutliner )
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
- Rectangle aPaintRect;
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
if( pTextObj )
{
- Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() );
- pTextObj->UpdateOutlinerFormatting( *mpOutliner, aPaintRect );
+ basegfx::B2DRange aBoundRange(pTextObj->getObjectRange(0));
+ basegfx::B2DRange aPaintRange;
+ pTextObj->UpdateOutlinerFormatting( *mpOutliner, aPaintRange );
// #101029# calc text offset from shape anchor
- maTextOffset = aPaintRect.TopLeft() - aBoundRect.TopLeft();
+ maTextOffset = aPaintRange.getMinimum() - aBoundRange.getMinimum();
}
}
}
@@ -560,7 +536,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
{
if( mpOutliner == NULL )
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
sal_uInt16 nOutlMode = OUTLINERMODE_TEXTOBJECT;
if( pTextObj && pTextObj->IsTextFrame() && pTextObj->GetTextKind() == OBJ_OUTLINETEXT )
nOutlMode = OUTLINERMODE_OUTLINEOBJECT;
@@ -612,12 +588,12 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
mbForwarderIsEditMode = sal_False;
}
- if( mpObject && mpText && !mbDataValid && mpObject->IsInserted() && mpObject->GetPage() )
+ if( mpObject && mpText && !mbDataValid && mpObject->IsObjectInserted() && mpObject->getSdrPageFromSdrObject() )
{
mpTextForwarder->flushCache();
OutlinerParaObject* pOutlinerParaObject = NULL;
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
if( pTextObj && pTextObj->getActiveText() == mpText )
pOutlinerParaObject = pTextObj->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
bool bOwnParaObj(false);
@@ -627,17 +603,17 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
else
pOutlinerParaObject = mpText->GetOutlinerParaObject();
- if( pOutlinerParaObject && ( bOwnParaObj || !mpObject->IsEmptyPresObj() || mpObject->GetPage()->IsMasterPage() ) )
+ if( pOutlinerParaObject && ( bOwnParaObj || !mpObject->IsEmptyPresObj() || mpObject->getSdrPageFromSdrObject()->IsMasterPage() ) )
{
mpOutliner->SetText( *pOutlinerParaObject );
// #91254# put text to object and set EmptyPresObj to FALSE
if( mpText && bOwnParaObj && pOutlinerParaObject && mpObject->IsEmptyPresObj() && pTextObj->IsRealyEdited() )
{
- mpObject->SetEmptyPresObj( sal_False );
- static_cast< SdrTextObj* >( mpObject)->NbcSetOutlinerParaObjectForText( pOutlinerParaObject, mpText );
+ mpObject->SetEmptyPresObj( false );
+ static_cast< SdrTextObj* >( mpObject)->SetOutlinerParaObjectForText( pOutlinerParaObject, mpText );
- // #i103982# Here, due to mpObject->NbcSetOutlinerParaObjectForText, we LOSE ownership of the
+ // #i103982# Here, due to mpObject->SetOutlinerParaObjectForText, we LOSE ownership of the
// OPO, so do NOT delete it when leaving this method (!)
bOwnParaObj = false;
}
@@ -647,11 +623,11 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
sal_Bool bVertical = pOutlinerParaObject ? pOutlinerParaObject->IsVertical() : sal_False;
// set objects style sheet on empty outliner
- SfxStyleSheetPool* pPool = (SfxStyleSheetPool*)mpObject->GetModel()->GetStyleSheetPool();
+ SfxStyleSheetPool* pPool = static_cast< SfxStyleSheetPool* >(mpObject->getSdrModelFromSdrObject().GetStyleSheetPool());
if( pPool )
mpOutliner->SetStyleSheetPool( pPool );
- SfxStyleSheet* pStyleSheet = mpObject->GetPage()->GetTextStyleSheetForObject( mpObject );
+ SfxStyleSheet* pStyleSheet = mpObject->getSdrPageFromSdrObject()->GetTextStyleSheetForObject( mpObject );
if( pStyleSheet )
mpOutliner->SetStyleSheet( 0, pStyleSheet );
@@ -719,11 +695,8 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetTextForwarder()
if( mbDestroyed || mpObject == NULL )
return NULL;
- if( mpModel == NULL )
- mpModel = mpObject->GetModel();
-
- if( mpModel == NULL )
- return NULL;
+ if( !mpModel )
+ mpModel = &mpObject->getSdrModelFromSdrObject();
// distinguish the cases
// a) connected to view, maybe edit mode is active, can work directly on the EditOutliner
@@ -755,13 +728,15 @@ SvxDrawOutlinerViewForwarder* SvxTextEditSourceImpl::CreateViewForwarder()
// register as listener - need to broadcast state change messages
mpView->GetTextEditOutliner()->SetNotifyHdl( LINK(this, SvxTextEditSourceImpl, NotifyHdl) );
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
if( pTextObj )
{
- Rectangle aBoundRect( pTextObj->GetCurrentBoundRect() );
+ const basegfx::B2DRange aRange(pTextObj->getObjectRange(mpView));
OutlinerView& rOutlView = *mpView->GetTextEditOutlinerView();
- return new SvxDrawOutlinerViewForwarder( rOutlView, aBoundRect.TopLeft() );
+ return new SvxDrawOutlinerViewForwarder(
+ rOutlView,
+ Point(basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY())));
}
}
@@ -773,11 +748,8 @@ SvxEditViewForwarder* SvxTextEditSourceImpl::GetEditViewForwarder( sal_Bool bCre
if( mbDestroyed || mpObject == NULL )
return NULL;
- if( mpModel == NULL )
- mpModel = mpObject->GetModel();
-
- if( mpModel == NULL )
- return NULL;
+ if( !mpModel )
+ mpModel = &mpObject->getSdrModelFromSdrObject();
// shall we delete?
if( mpViewForwarder )
@@ -809,9 +781,9 @@ SvxEditViewForwarder* SvxTextEditSourceImpl::GetEditViewForwarder( sal_Bool bCre
// enter edit mode
mpView->SdrEndTextEdit();
- if(mpView->SdrBeginTextEdit(mpObject, 0L, 0L, sal_False, (SdrOutliner*)0L, 0L, sal_False, sal_False))
+ if(mpView->SdrBeginTextEdit(mpObject, 0L, sal_False, (SdrOutliner*)0L, 0L, sal_False, sal_False))
{
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
if( pTextObj->IsTextEditActive() )
{
// create new view forwarder
@@ -865,11 +837,11 @@ void SvxTextEditSourceImpl::UpdateData()
}
}
- pTextObj->NbcSetOutlinerParaObjectForText( mpOutliner->CreateParaObject(), mpText );
+ pTextObj->SetOutlinerParaObjectForText( mpOutliner->CreateParaObject(), mpText );
}
else
{
- pTextObj->NbcSetOutlinerParaObjectForText( NULL,mpText );
+ pTextObj->SetOutlinerParaObjectForText( NULL,mpText );
}
}
@@ -926,12 +898,16 @@ Rectangle SvxTextEditSourceImpl::GetVisArea()
}
// offset vis area by edit engine left-top position
- SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, mpObject );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
if( pTextObj )
{
- Rectangle aAnchorRect;
- pTextObj->TakeTextAnchorRect( aAnchorRect );
- aVisArea.Move( -aAnchorRect.Left(), -aAnchorRect.Top() );
+ // get TextRange without shear, rotate and mirror, just scaled
+ // and centered in logic coordinates
+ basegfx::B2DRange aTextRange(getScaledCenteredTextRange(*pTextObj));
+
+ aVisArea.Move(
+ basegfx::fround(-aTextRange.getMinX()),
+ basegfx::fround(-aTextRange.getMinY()));
MapMode aMapMode(mpWindow->GetMapMode());
aMapMode.SetOrigin(Point());
@@ -961,11 +937,11 @@ Point SvxTextEditSourceImpl::LogicToPixel( const Point& rPoint, const MapMode& r
{
// #101029#
Point aPoint1( rPoint );
- aPoint1.X() += maTextOffset.X();
- aPoint1.Y() += maTextOffset.Y();
+ aPoint1.X() += basegfx::fround(maTextOffset.getX());
+ aPoint1.Y() += basegfx::fround(maTextOffset.getY());
Point aPoint2( OutputDevice::LogicToLogic( aPoint1, rMapMode,
- MapMode(mpModel->GetScaleUnit()) ) );
+ MapMode(mpModel->GetExchangeObjectUnit()) ) );
MapMode aMapMode(mpWindow->GetMapMode());
aMapMode.SetOrigin(Point());
return mpWindow->LogicToPixel( aPoint2, aMapMode );
@@ -995,11 +971,11 @@ Point SvxTextEditSourceImpl::PixelToLogic( const Point& rPoint, const MapMode& r
aMapMode.SetOrigin(Point());
Point aPoint1( mpWindow->PixelToLogic( rPoint, aMapMode ) );
Point aPoint2( OutputDevice::LogicToLogic( aPoint1,
- MapMode(mpModel->GetScaleUnit()),
+ MapMode(mpModel->GetExchangeObjectUnit()),
rMapMode ) );
// #101029#
- aPoint2.X() -= maTextOffset.X();
- aPoint2.Y() -= maTextOffset.Y();
+ aPoint2.X() -= basegfx::fround(maTextOffset.getX());
+ aPoint2.Y() -= basegfx::fround(maTextOffset.getY());
return aPoint2;
}
@@ -1140,11 +1116,6 @@ const SvxUnoTextRangeBaseList& SvxTextEditSource::getRanges() const
return mpImpl->getRanges();
}
-void SvxTextEditSource::ChangeModel( SdrModel* pNewModel )
-{
- mpImpl->ChangeModel( pNewModel );
-}
-
void SvxTextEditSource::UpdateOutliner()
{
mpImpl->UpdateOutliner();
diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx
index 986d06123b5a..4fdc99d3a0e4 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -313,46 +313,25 @@ void SAL_CALL GalleryTheme::update( )
throw (lang::WrappedTargetException, uno::RuntimeException)
{
const ::vos::OGuard aGuard( Application::GetSolarMutex() );
- sal_Int32 nRet = -1;
+ sal_Int32 nRet = -1;
if( mpTheme )
{
GalleryDrawingModel* pModel = GalleryDrawingModel::getImplementation( Drawing );
- if( pModel && pModel->GetDoc() && pModel->GetDoc()->ISA( FmFormModel ) )
+ if( pModel )
{
- nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) );
+ FmFormModel* pFmFormModel = dynamic_cast< FmFormModel* >(pModel->GetDoc());
- if( mpTheme->InsertModel( *static_cast< FmFormModel* >( pModel->GetDoc() ), nIndex ) )
- nRet = nIndex;
- }
- else if (!pModel)
- {
- try
+ if( pFmFormModel )
{
- uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( Drawing, uno::UNO_QUERY_THROW );
- uno::Reference< drawing::XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), uno::UNO_QUERY_THROW );
- uno::Reference< drawing::XDrawPage > xPage( xDrawPages->getByIndex( 0 ), uno::UNO_QUERY_THROW );
- SvxDrawPage* pUnoPage = xPage.is() ? SvxDrawPage::getImplementation( xPage ) : NULL;
- SdrModel* pOrigModel = pUnoPage ? pUnoPage->GetSdrPage()->GetModel() : NULL;
- SdrPage* pOrigPage = pUnoPage ? pUnoPage->GetSdrPage() : NULL;
-
- if (pOrigPage && pOrigModel)
- {
- FmFormModel* pTmpModel = new FmFormModel(&pOrigModel->GetItemPool());
- SdrPage* pNewPage = pOrigPage->Clone();
- pTmpModel->InsertPage(pNewPage, 0);
-
- uno::Reference< lang::XComponent > xDrawing( new GalleryDrawingModel( pTmpModel ) );
- pTmpModel->setUnoModel( uno::Reference< uno::XInterface >::query( xDrawing ) );
+ nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) );
- nRet = insertDrawingByIndex( xDrawing, nIndex );
- return nRet;
+ if( mpTheme->InsertModel( *pFmFormModel, nIndex ) )
+ {
+ nRet = nIndex;
}
}
- catch (...)
- {
- }
}
}
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index 32f5eb572c8b..b16249e5d51f 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -155,7 +155,6 @@ struct OUStringLess
// -----------------------------
// - SvXMLEmbeddedObjectHelper -
// -----------------------------
-DBG_NAME(SvXMLEmbeddedObjectHelper)
SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper() :
WeakComponentImplHelper2< XEmbeddedObjectResolver, XNameAccess >( maMutex ),
maReplacementGraphicsContainerStorageName( RTL_CONSTASCII_USTRINGPARAM(XML_CONTAINERSTORAGE_NAME) ),
@@ -164,7 +163,6 @@ SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper() :
meCreateMode( EMBEDDEDOBJECTHELPER_MODE_READ ),
mpStreamMap( 0 )
{
- DBG_CTOR(SvXMLEmbeddedObjectHelper,NULL);
}
SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper( ::comphelper::IEmbeddedHelper& rDocPersist, SvXMLEmbeddedObjectHelperMode eCreateMode ) :
@@ -175,7 +173,6 @@ SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper( ::comphelper::IEmbeddedHel
meCreateMode( EMBEDDEDOBJECTHELPER_MODE_READ ),
mpStreamMap( 0 )
{
- DBG_CTOR(SvXMLEmbeddedObjectHelper,NULL);
Init( 0, rDocPersist, eCreateMode );
}
@@ -184,7 +181,6 @@ SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper( ::comphelper::IEmbeddedHel
SvXMLEmbeddedObjectHelper::~SvXMLEmbeddedObjectHelper()
{
- DBG_DTOR(SvXMLEmbeddedObjectHelper,NULL);
if( mpStreamMap )
{
SvXMLEmbeddedObjectHelper_Impl::iterator aIter = mpStreamMap->begin();
@@ -304,8 +300,6 @@ sal_Bool SvXMLEmbeddedObjectHelper::ImplGetStorageNames(
if( pGraphicRepl )
*pGraphicRepl = sal_True;
}
-
-
}
else
{
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 5fde2dc578b3..20bd458e4f9d 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -577,8 +577,8 @@ Bitmap XOutBitmap::DetectEdges( const Bitmap& rBmp, const sal_uInt8 cThreshold )
const long nHeight = aSize.Height();
const long nHeight2 = nHeight - 2L;
const long lThres2 = (long) cThreshold * cThreshold;
- const sal_uInt8 nWhitePalIdx = pWriteAcc->GetBestPaletteIndex( Color( COL_WHITE ) );
- const sal_uInt8 nBlackPalIdx = pWriteAcc->GetBestPaletteIndex( Color( COL_BLACK ) );
+ const sal_uInt8 nWhitePalIdx = static_cast< sal_uInt8 >(pWriteAcc->GetBestPaletteIndex( Color( COL_WHITE ) ));
+ const sal_uInt8 nBlackPalIdx = static_cast< sal_uInt8 >(pWriteAcc->GetBestPaletteIndex( Color( COL_BLACK ) ));
long nSum1;
long nSum2;
long lGray;
diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx
index 563fe3083f87..b69ac32788dc 100644
--- a/svx/source/xoutdev/_xpoly.cxx
+++ b/svx/source/xoutdev/_xpoly.cxx
@@ -40,9 +40,6 @@
#define GLOBALOVERFLOW
-DBG_NAME(XPolygon);
-DBG_NAME(XPolyPolygon);
-
/*************************************************************************
|*
|* ImpXPolygon::ImpXPolygon()
@@ -279,7 +276,6 @@ void ImpXPolygon::Remove( sal_uInt16 nPos, sal_uInt16 nCount )
XPolygon::XPolygon( sal_uInt16 nSize, sal_uInt16 nResize )
{
- DBG_CTOR(XPolygon,NULL);
pImpXPolygon = new ImpXPolygon( nSize, nResize );
}
@@ -295,7 +291,6 @@ XPolygon::XPolygon( sal_uInt16 nSize, sal_uInt16 nResize )
XPolygon::XPolygon( const XPolygon& rXPoly )
{
- DBG_CTOR(XPolygon,NULL);
pImpXPolygon = rXPoly.pImpXPolygon;
pImpXPolygon->nRefCount++;
}
@@ -312,8 +307,6 @@ XPolygon::XPolygon( const XPolygon& rXPoly )
XPolygon::XPolygon( const Polygon& rPoly )
{
- DBG_CTOR(XPolygon,NULL);
-
sal_uInt16 nSize = rPoly.GetSize();
pImpXPolygon = new ImpXPolygon( nSize );
pImpXPolygon->nPoints = nSize;
@@ -337,7 +330,6 @@ XPolygon::XPolygon( const Polygon& rPoly )
XPolygon::XPolygon(const Rectangle& rRect, long nRx, long nRy)
{
- DBG_CTOR(XPolygon,NULL);
pImpXPolygon = new ImpXPolygon(17);
long nWh = (rRect.GetWidth() - 1) / 2;
long nHh = (rRect.GetHeight() - 1) / 2;
@@ -408,7 +400,6 @@ XPolygon::XPolygon(const Rectangle& rRect, long nRx, long nRy)
XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy,
sal_uInt16 nStartAngle, sal_uInt16 nEndAngle, sal_Bool bClose)
{
- DBG_CTOR(XPolygon,NULL);
pImpXPolygon = new ImpXPolygon(17);
nStartAngle %= 3600;
@@ -458,7 +449,6 @@ XPolygon::XPolygon(const Point& rCenter, long nRx, long nRy,
XPolygon::~XPolygon()
{
- DBG_DTOR(XPolygon,NULL);
if( pImpXPolygon->nRefCount > 1 )
pImpXPolygon->nRefCount--;
else
@@ -1480,8 +1470,6 @@ XPolygon::XPolygon(const basegfx::B2DPolygon& rPolygon)
// #i74631# use tools Polygon class for conversion to not have the code doubled
// here. This needs one more conversion but avoids different convertors in
// the long run
- DBG_CTOR(XPolygon,NULL);
-
const Polygon aSource(rPolygon);
sal_uInt16 nSize = aSource.GetSize();
pImpXPolygon = new ImpXPolygon( nSize );
@@ -1578,7 +1566,6 @@ bool ImpXPolyPolygon::operator==(const ImpXPolyPolygon& rImpXPolyPoly) const
XPolyPolygon::XPolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
{
- DBG_CTOR(XPolyPolygon,NULL);
pImpXPolyPolygon = new ImpXPolyPolygon( nInitSize, nResize );
}
@@ -1595,7 +1582,6 @@ XPolyPolygon::XPolyPolygon( sal_uInt16 nInitSize, sal_uInt16 nResize )
XPolyPolygon::XPolyPolygon( const XPolygon& rXPoly )
{
- DBG_CTOR(XPolyPolygon,NULL);
pImpXPolyPolygon = new ImpXPolyPolygon;
pImpXPolyPolygon->aXPolyList.Insert( new XPolygon( rXPoly ) );
}
@@ -1612,7 +1598,6 @@ XPolyPolygon::XPolyPolygon( const XPolygon& rXPoly )
XPolyPolygon::XPolyPolygon( const XPolyPolygon& rXPolyPoly )
{
- DBG_CTOR(XPolyPolygon,NULL);
pImpXPolyPolygon = rXPolyPoly.pImpXPolyPolygon;
pImpXPolyPolygon->nRefCount++;
}
@@ -1629,7 +1614,6 @@ XPolyPolygon::XPolyPolygon( const XPolyPolygon& rXPolyPoly )
XPolyPolygon::XPolyPolygon( const PolyPolygon& rPolyPoly )
{
- DBG_CTOR(XPolyPolygon,NULL);
pImpXPolyPolygon = new ImpXPolyPolygon;
for (sal_uInt16 i = 0; i < rPolyPoly.Count(); i++)
@@ -1649,7 +1633,6 @@ XPolyPolygon::XPolyPolygon( const PolyPolygon& rPolyPoly )
XPolyPolygon::~XPolyPolygon()
{
- DBG_DTOR(XPolyPolygon,NULL);
if( pImpXPolyPolygon->nRefCount > 1 )
pImpXPolyPolygon->nRefCount--;
else
@@ -2117,7 +2100,6 @@ basegfx::B2DPolyPolygon XPolyPolygon::getB2DPolyPolygon() const
XPolyPolygon::XPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon)
{
- DBG_CTOR(XPolyPolygon,NULL);
pImpXPolyPolygon = new ImpXPolyPolygon( 16, 16 );
for(sal_uInt32 a(0L); a < rPolyPolygon.count(); a++)
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 2c58aad9b34f..c2ed996e935c 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -39,11 +39,9 @@
#include <svl/itempool.hxx>
#include <editeng/memberids.hrc>
#include <tools/stream.hxx>
-
-#include "svx/unoapi.hxx"
+#include <svx/unoapi.hxx>
#include <svl/style.hxx>
#include "unopolyhelper.hxx"
-
#include <tools/bigint.hxx>
#include <svl/itemset.hxx>
#include <svx/dialogs.hrc>
@@ -58,8 +56,8 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dvector.hxx>
-
#include <stdio.h>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -77,8 +75,6 @@ using namespace ::com::sun::star;
XubString aNameOrIndexEmptyString;
-TYPEINIT1_AUTOFACTORY(NameOrIndex, SfxStringItem);
-
/*************************************************************************
|*
|*
@@ -364,7 +360,6 @@ String NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uIn
// -------------------
// class XColorItem
// -------------------
-TYPEINIT1_AUTOFACTORY(XColorItem, NameOrIndex);
/*************************************************************************
|*
@@ -507,7 +502,8 @@ sal_Bool XColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8
//---------------------
// class XLineStyleItem
//---------------------
-TYPEINIT1_AUTOFACTORY(XLineStyleItem, SfxEnumItem);
+
+IMPL_POOLITEM_FACTORY(XLineStyleItem)
/*************************************************************************
|*
@@ -879,7 +875,8 @@ double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double
// -------------------
// class XLineDashItem
// -------------------
-TYPEINIT1_AUTOFACTORY(XLineDashItem, NameOrIndex);
+
+IMPL_POOLITEM_FACTORY(XLineDashItem)
/*************************************************************************
|*
@@ -1089,19 +1086,18 @@ SfxItemPresentation XLineDashItem::GetPresentation
//------------------------------------------------------------------------
-FASTBOOL XLineDashItem::HasMetrics() const
+bool XLineDashItem::HasMetrics() const
{
- return sal_True;
+ return true;
}
//------------------------------------------------------------------------
-FASTBOOL XLineDashItem::ScaleMetrics(long nMul, long nDiv)
+void XLineDashItem::ScaleMetrics(long nMul, long nDiv)
{
aDash.SetDotLen( ScaleMetricValue( aDash.GetDotLen(), nMul, nDiv ) );
aDash.SetDashLen( ScaleMetricValue( aDash.GetDashLen(), nMul, nDiv ) );
aDash.SetDistance( ScaleMetricValue( aDash.GetDistance(), nMul, nDiv ) );
- return sal_True;
}
sal_Bool XLineDashItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
@@ -1384,7 +1380,8 @@ XLineDashItem* XLineDashItem::checkForUniqueItem( SdrModel* pModel ) const
// -------------------
// class XLineWidthItem
// -------------------
-TYPEINIT1_AUTOFACTORY(XLineWidthItem, SfxMetricItem);
+
+IMPL_POOLITEM_FACTORY(XLineWidthItem)
/*************************************************************************
|*
@@ -1496,7 +1493,8 @@ sal_Bool XLineWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u
// -------------------
// class XLineColorItem
// -------------------
-TYPEINIT1_AUTOFACTORY(XLineColorItem, XColorItem);
+
+IMPL_POOLITEM_FACTORY(XLineColorItem)
/*************************************************************************
|*
@@ -1614,7 +1612,7 @@ sal_Bool XLineColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u
}
//////////////////////////////////////////////////////////////////////////////
-// tooling for simple spooling B2DPolygon to file and back
+// tooling for simple spooling B2DPolygon to file and back TTTT used where..?
namespace
{
@@ -1715,7 +1713,8 @@ namespace
// -----------------------
// class XLineStartItem
// -----------------------
-TYPEINIT1_AUTOFACTORY(XLineStartItem, NameOrIndex);
+
+IMPL_POOLITEM_FACTORY(XLineStartItem)
/*************************************************************************
|*
@@ -1926,7 +1925,7 @@ sal_Bool XLineStartItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8
else
{
com::sun::star::drawing::PolyPolygonBezierCoords aBezier;
- SvxConvertB2DPolyPolygonToPolyPolygonBezier( maPolyPolygon, aBezier );
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(maPolyPolygon, aBezier);
rVal <<= aBezier;
}
@@ -1951,9 +1950,9 @@ sal_Bool XLineStartItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u
return sal_False;
com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue();
- if( pCoords->Coordinates.getLength() > 0 )
+ if(pCoords && pCoords->Coordinates.getLength() > 0)
{
- maPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon( pCoords );
+ maPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*pCoords);
// #i72807# close line start/end polygons hard
// maPolyPolygon.setClosed(true);
}
@@ -2187,7 +2186,8 @@ XLineStartItem* XLineStartItem::checkForUniqueItem( SdrModel* pModel ) const
// ---------------------
// class XLineEndItem
// ---------------------
-TYPEINIT1_AUTOFACTORY(XLineEndItem, NameOrIndex);
+
+IMPL_POOLITEM_FACTORY(XLineEndItem)
/*************************************************************************
|*
@@ -2620,7 +2620,7 @@ sal_Bool XLineEndItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 n
else
{
com::sun::star::drawing::PolyPolygonBezierCoords aBezier;
- SvxConvertB2DPolyPolygonToPolyPolygonBezier( maPolyPolygon, aBezier );
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(maPolyPolygon, aBezier);
rVal <<= aBezier;
}
return sal_True;
@@ -2644,9 +2644,9 @@ sal_Bool XLineEndItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uIn
return sal_False;
com::sun::star::drawing::PolyPolygonBezierCoords* pCoords = (com::sun::star::drawing::PolyPolygonBezierCoords*)rVal.getValue();
- if( pCoords->Coordinates.getLength() > 0 )
+ if(pCoords && pCoords->Coordinates.getLength() > 0)
{
- maPolyPolygon = SvxConvertPolyPolygonBezierToB2DPolyPolygon( pCoords );
+ maPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*pCoords);
// #i72807# close line start/end polygons hard
// maPolyPolygon.setClosed(true);
}
@@ -2659,7 +2659,6 @@ sal_Bool XLineEndItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uIn
// ----------------------------
// class XLineStartWidthItem
// ----------------------------
-TYPEINIT1_AUTOFACTORY(XLineStartWidthItem, SfxMetricItem);
/*************************************************************************
|*
@@ -2767,7 +2766,6 @@ sal_Bool XLineStartWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal,
// --------------------------
// class XLineEndWidthItem
// --------------------------
-TYPEINIT1_AUTOFACTORY(XLineEndWidthItem, SfxMetricItem);
/*************************************************************************
|*
@@ -2873,7 +2871,6 @@ sal_Bool XLineEndWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sa
// -----------------------------
// class XLineStartCenterItem
// -----------------------------
-TYPEINIT1_AUTOFACTORY(XLineStartCenterItem, SfxBoolItem);
/*************************************************************************
|*
@@ -2981,7 +2978,6 @@ sal_Bool XLineStartCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal,
// ---------------------------
// class XLineEndCenterItem
// ---------------------------
-TYPEINIT1_AUTOFACTORY(XLineEndCenterItem, SfxBoolItem);
/*************************************************************************
|*
@@ -3093,7 +3089,8 @@ sal_Bool XLineEndCenterItem::PutValue( const ::com::sun::star::uno::Any& rVal, s
// --------------------
// class XFillStyleItem
// --------------------
-TYPEINIT1_AUTOFACTORY(XFillStyleItem, SfxEnumItem);
+
+IMPL_POOLITEM_FACTORY(XFillStyleItem)
/*************************************************************************
|*
@@ -3244,7 +3241,8 @@ sal_Bool XFillStyleItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u
// -------------------
// class XFillColorItem
// -------------------
-TYPEINIT1_AUTOFACTORY(XFillColorItem, XColorItem);
+
+IMPL_POOLITEM_FACTORY(XFillColorItem)
/*************************************************************************
|*
@@ -3369,7 +3367,6 @@ sal_Bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u
// -----------------------------
// class XSecondaryFillColorItem
// -----------------------------
-TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem);
XSecondaryFillColorItem::XSecondaryFillColorItem(sal_Int32 nIndex, const Color& rTheColor) :
XColorItem(XATTR_SECONDARYFILLCOLOR, nIndex, rTheColor)
@@ -3505,7 +3502,8 @@ bool XGradient::operator==(const XGradient& rGradient) const
// -----------------------
// class XFillGradientItem
// -----------------------
-TYPEINIT1_AUTOFACTORY(XFillGradientItem, NameOrIndex);
+
+IMPL_POOLITEM_FACTORY(XFillGradientItem)
/*************************************************************************
|*
@@ -4029,7 +4027,6 @@ XFillGradientItem* XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) con
// class XFillFloatTransparenceItem -
// ----------------------------------
-TYPEINIT1_AUTOFACTORY( XFillFloatTransparenceItem, XFillGradientItem );
// -----------------------------------------------------------------------------
@@ -4066,15 +4063,6 @@ XFillFloatTransparenceItem::XFillFloatTransparenceItem( const XFillFloatTranspar
SetWhich( XATTR_FILLFLOATTRANSPARENCE );
}
-//------------------------------------------------------------------------
-
-//XFillFloatTransparenceItem::XFillFloatTransparenceItem( SvStream& rIn, sal_uInt16 nVer ) :
-// XFillGradientItem ( rIn, nVer )
-//{
-// SetWhich( XATTR_FILLFLOATTRANSPARENCE );
-// rIn >> bEnabled;
-//}
-
//*************************************************************************
XFillFloatTransparenceItem::XFillFloatTransparenceItem(SfxItemPool* /*pPool*/, const XGradient& rTheGradient, sal_Bool bEnable )
@@ -4109,22 +4097,6 @@ SfxPoolItem* XFillFloatTransparenceItem::Clone( SfxItemPool* /*pPool*/) const
//------------------------------------------------------------------------
-//SfxPoolItem* XFillFloatTransparenceItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
-//{
-// return( ( 0 == nVer ) ? Clone( NULL ) : new XFillFloatTransparenceItem( rIn, nVer ) );
-//}
-
-//------------------------------------------------------------------------
-
-//SvStream& XFillFloatTransparenceItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
-//{
-// XFillGradientItem::Store( rOut, nItemVersion );
-// rOut << bEnabled;
-// return rOut;
-//}
-
-//------------------------------------------------------------------------
-
sal_uInt16 XFillFloatTransparenceItem::GetVersion( sal_uInt16 nFileFormatVersion ) const
{
// !!! if version number of this object must be increased, please !!!
@@ -4241,7 +4213,8 @@ bool XHatch::operator==(const XHatch& rHatch) const
// -----------------------
// class XFillHatchItem
// -----------------------
-TYPEINIT1_AUTOFACTORY(XFillHatchItem, NameOrIndex);
+
+IMPL_POOLITEM_FACTORY(XFillHatchItem)
/*************************************************************************
|*
@@ -4465,17 +4438,16 @@ SfxItemPresentation XFillHatchItem::GetPresentation
//------------------------------------------------------------------------
-FASTBOOL XFillHatchItem::HasMetrics() const
+bool XFillHatchItem::HasMetrics() const
{
- return sal_True;
+ return true;
}
//------------------------------------------------------------------------
-FASTBOOL XFillHatchItem::ScaleMetrics(long nMul, long nDiv)
+void XFillHatchItem::ScaleMetrics(long nMul, long nDiv)
{
aHatch.SetDistance( ScaleMetricValue( aHatch.GetDistance(), nMul, nDiv ) );
- return sal_True;
}
// -----------------------------------------------------------------------
@@ -4673,7 +4645,8 @@ XFillHatchItem* XFillHatchItem::checkForUniqueItem( SdrModel* pModel ) const
//-------------------------
// class XFormTextStyleItem
//-------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextStyleItem, SfxEnumItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextStyleItem)
/*************************************************************************
|*
@@ -4778,7 +4751,8 @@ sal_Bool XFormTextStyleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMember
//-------------------------
// class XFormTextAdjustItem
//-------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextAdjustItem, SfxEnumItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextAdjustItem)
/*************************************************************************
|*
@@ -4883,7 +4857,8 @@ sal_Bool XFormTextAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMembe
//----------------------------
// class XFormTextDistanceItem
//----------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextDistanceItem, SfxMetricItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextDistanceItem)
/*************************************************************************
|*
@@ -4948,7 +4923,8 @@ SfxPoolItem* XFormTextDistanceItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) c
//-------------------------
// class XFormTextStartItem
//-------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextStartItem, SfxMetricItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextStartItem)
/*************************************************************************
|*
@@ -5013,7 +4989,8 @@ SfxPoolItem* XFormTextStartItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) cons
// -------------------------
// class XFormTextMirrorItem
// -------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextMirrorItem, SfxBoolItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextMirrorItem)
/*************************************************************************
|*
@@ -5076,7 +5053,8 @@ SfxPoolItem* XFormTextMirrorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) con
// --------------------------
// class XFormTextOutlineItem
// --------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextOutlineItem, SfxBoolItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextOutlineItem)
/*************************************************************************
|*
@@ -5138,7 +5116,8 @@ SfxPoolItem* XFormTextOutlineItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) co
//--------------------------
// class XFormTextShadowItem
//--------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextShadowItem, SfxEnumItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextShadowItem)
/*************************************************************************
|*
@@ -5245,7 +5224,8 @@ sal_Bool XFormTextShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMembe
// -------------------------------
// class XFormTextShadowColorItem
// -------------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextShadowColorItem, XColorItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextShadowColorItem)
/*************************************************************************
|*
@@ -5327,7 +5307,8 @@ SfxPoolItem* XFormTextShadowColorItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/
//------------------------------
// class XFormTextShadowXValItem
//------------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextShadowXValItem, SfxMetricItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextShadowXValItem)
/*************************************************************************
|*
@@ -5392,7 +5373,8 @@ SfxPoolItem* XFormTextShadowXValItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/)
//------------------------------
// class XFormTextShadowYValItem
//------------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextShadowYValItem, SfxMetricItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextShadowYValItem)
/*************************************************************************
|*
@@ -5457,7 +5439,8 @@ SfxPoolItem* XFormTextShadowYValItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/)
//---------------------------
// class XFormTextStdFormItem
//---------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextStdFormItem, SfxEnumItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextStdFormItem)
/*************************************************************************
|*
@@ -5564,7 +5547,8 @@ sal_Bool XFormTextStdFormItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemb
// --------------------------
// class XFormTextHideFormItem
// --------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextHideFormItem, SfxBoolItem);
+
+IMPL_POOLITEM_FACTORY(XFormTextHideFormItem)
/*************************************************************************
|*
@@ -5629,8 +5613,6 @@ SfxPoolItem* XFormTextHideFormItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) c
// SetItems
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPEINIT1(XLineAttrSetItem, SfxSetItem);
-
/*************************************************************************
|*
|* Konstruktoren fuer Linienattribute-SetItem
@@ -5702,8 +5684,6 @@ SvStream& XLineAttrSetItem::Store( SvStream& rStream, sal_uInt16 nItemVersion )
}
-TYPEINIT1(XFillAttrSetItem, SfxSetItem);
-
/*************************************************************************
|*
|* Konstruktoren fuer Fuellattribute-SetItem
diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx
index 69a4b7fbc556..732988fdaef2 100644
--- a/svx/source/xoutdev/xattr2.cxx
+++ b/svx/source/xoutdev/xattr2.cxx
@@ -45,8 +45,6 @@
//------------------------------
// class XLineTransparenceItem
//------------------------------
-TYPEINIT1_AUTOFACTORY(XLineTransparenceItem, SfxUInt16Item);
-
/*************************************************************************
|*
|* XLineTransparenceItem::XLineTransparenceItem(sal_uInt16)
@@ -139,10 +137,6 @@ SfxItemPresentation XLineTransparenceItem::GetPresentation
// class XLineJointItem -
//-----------------------
-TYPEINIT1_AUTOFACTORY(XLineJointItem, SfxEnumItem);
-
-// -----------------------------------------------------------------------------
-
XLineJointItem::XLineJointItem( XLineJoint eLineJoint ) :
SfxEnumItem(XATTR_LINEJOINT, sal::static_int_cast< sal_uInt16 >(eLineJoint))
{
@@ -314,10 +308,6 @@ sal_uInt16 XLineJointItem::GetValueCount() const
// class XLineCapItem -
//-----------------------
-TYPEINIT1_AUTOFACTORY(XLineCapItem, SfxEnumItem);
-
-// -----------------------------------------------------------------------------
-
XLineCapItem::XLineCapItem(com::sun::star::drawing::LineCap eLineCap)
: SfxEnumItem(XATTR_LINECAP, sal::static_int_cast< sal_uInt16 >(eLineCap))
{
@@ -457,8 +447,6 @@ com::sun::star::drawing::LineCap XLineCapItem::GetValue() const
//------------------------------
// class XFillTransparenceItem
//------------------------------
-TYPEINIT1_AUTOFACTORY(XFillTransparenceItem, SfxUInt16Item);
-
/*************************************************************************
|*
|* XFillTransparenceItem::XFillTransparenceItem(sal_uInt16)
@@ -550,8 +538,6 @@ SfxItemPresentation XFillTransparenceItem::GetPresentation
//------------------------------
// class XFormTextShadowTranspItem
//------------------------------
-TYPEINIT1_AUTOFACTORY(XFormTextShadowTranspItem, SfxUInt16Item);
-
/*************************************************************************
|*
|* XFormTextShadowTranspItem::XFormTextShadowTranspItem(sal_uInt16)
@@ -616,8 +602,6 @@ SfxPoolItem* XFormTextShadowTranspItem::Create(SvStream& rIn, sal_uInt16 /*nVer*
//------------------------------
// class XFillGradientStepCountItem
//------------------------------
-TYPEINIT1_AUTOFACTORY(XGradientStepCountItem, SfxUInt16Item);
-
/*************************************************************************
|*
|* XGradientStepCountItem::XGradientStepCountItem( sal_uInt16 )
@@ -709,8 +693,6 @@ SfxItemPresentation XGradientStepCountItem::GetPresentation
//------------------------------
// class XFillBmpTileItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpTileItem, SfxBoolItem );
-
/*************************************************************************
|*
|*
@@ -811,8 +793,6 @@ SfxItemPresentation XFillBmpTileItem::GetPresentation
//------------------------------
// class XFillBmpTilePosItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpPosItem, SfxEnumItem );
-
/*************************************************************************
|*
|*
@@ -924,8 +904,6 @@ sal_uInt16 XFillBmpPosItem::GetValueCount() const
//------------------------------
// class XFillBmpTileSizeXItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpSizeXItem, SfxMetricItem );
-
/*************************************************************************
|*
|*
@@ -1031,7 +1009,7 @@ SfxItemPresentation XFillBmpSizeXItem::GetPresentation
|*
\*************************************************************************/
-FASTBOOL XFillBmpSizeXItem::HasMetrics() const
+bool XFillBmpSizeXItem::HasMetrics() const
{
return GetValue() > 0L;
}
@@ -1040,8 +1018,6 @@ FASTBOOL XFillBmpSizeXItem::HasMetrics() const
//------------------------------
// class XFillBmpTileSizeYItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpSizeYItem, SfxMetricItem );
-
/*************************************************************************
|*
|*
@@ -1147,7 +1123,7 @@ SfxItemPresentation XFillBmpSizeYItem::GetPresentation
|*
\*************************************************************************/
-FASTBOOL XFillBmpSizeYItem::HasMetrics() const
+bool XFillBmpSizeYItem::HasMetrics() const
{
return GetValue() > 0L;
}
@@ -1156,8 +1132,6 @@ FASTBOOL XFillBmpSizeYItem::HasMetrics() const
//------------------------------
// class XFillBmpTileLogItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpSizeLogItem, SfxBoolItem );
-
/*************************************************************************
|*
|*
@@ -1258,8 +1232,6 @@ SfxItemPresentation XFillBmpSizeLogItem::GetPresentation
//------------------------------
// class XFillBmpTileOffXItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpTileOffsetXItem, SfxUInt16Item );
-
/*************************************************************************
|*
|*
@@ -1360,8 +1332,6 @@ SfxItemPresentation XFillBmpTileOffsetXItem::GetPresentation
//------------------------------
// class XFillBmpTileOffYItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpTileOffsetYItem, SfxUInt16Item );
-
/*************************************************************************
|*
|*
@@ -1462,8 +1432,6 @@ SfxItemPresentation XFillBmpTileOffsetYItem::GetPresentation
//------------------------------
// class XFillBmpStretchItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpStretchItem, SfxBoolItem );
-
/*************************************************************************
|*
|*
@@ -1564,8 +1532,6 @@ SfxItemPresentation XFillBmpStretchItem::GetPresentation
//------------------------------
// class XFillBmpTileOffPosXItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpPosOffsetXItem, SfxUInt16Item );
-
/*************************************************************************
|*
|*
@@ -1666,8 +1632,6 @@ SfxItemPresentation XFillBmpPosOffsetXItem::GetPresentation
//------------------------------
// class XFillBmpTileOffPosYItem
//------------------------------
-TYPEINIT1_AUTOFACTORY( XFillBmpPosOffsetYItem, SfxUInt16Item );
-
/*************************************************************************
|*
|*
@@ -1767,8 +1731,6 @@ SfxItemPresentation XFillBmpPosOffsetYItem::GetPresentation
//--------------------------
// class XFillBackgroundItem
//--------------------------
-TYPEINIT1_AUTOFACTORY(XFillBackgroundItem, SfxBoolItem);
-
/*************************************************************************
|*
|* XFillBackgroundItem::XFillBackgroundItem( sal_Bool )
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 9606a963771b..07c047b50f4b 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -45,10 +45,10 @@
using namespace ::com::sun::star;
-// -----------------------
+//////////////////////////////////////////////////////////////////////////////
// class XFillBitmapItem
-// -----------------------
-TYPEINIT1_AUTOFACTORY(XFillBitmapItem, NameOrIndex);
+
+IMPL_POOLITEM_FACTORY(XFillBitmapItem)
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/xoutdev/xexch.cxx b/svx/source/xoutdev/xexch.cxx
index 8cdc9d735d66..1c6b19943f2d 100644
--- a/svx/source/xoutdev/xexch.cxx
+++ b/svx/source/xoutdev/xexch.cxx
@@ -42,9 +42,6 @@
#include "svx/xexch.hxx"
-TYPEINIT1_AUTOFACTORY( XFillExchangeData, SvDataCopyStream );
-
-
/*************************************************************************
|*
|* Default-Ctor (Fuer Assign())
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index 84f52f7291b4..3f1296a72e0c 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -173,8 +173,8 @@ public:
~impXDashList()
{
delete mpVirtualDevice;
- SdrObject::Free(mpBackgroundObject);
- SdrObject::Free(mpLineObject);
+ deleteSdrObjectSafeAndClearPointer(mpBackgroundObject);
+ deleteSdrObjectSafeAndClearPointer(mpLineObject);
delete mpSdrModel;
}
@@ -187,7 +187,6 @@ void XDashList::impCreate()
{
if(!mpData)
{
- const Point aZero(0, 0);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
VirtualDevice* pVirDev = new VirtualDevice;
@@ -203,10 +202,11 @@ void XDashList::impCreate()
OSL_ENSURE(0 != pSdrModel, "XDashList: no SdrModel created!" );
pSdrModel->GetItemPool().FreezeIdRanges();
- const Rectangle aBackgroundSize(aZero, aSize);
- SdrObject* pBackgroundObject = new SdrRectObj(aBackgroundSize);
+ SdrObject* pBackgroundObject = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleB2DHomMatrix(aSize.getWidth(), aSize.getHeight()));
OSL_ENSURE(0 != pBackgroundObject, "XDashList: no BackgroundObject created!" );
- pBackgroundObject->SetModel(pSdrModel);
+ //pBackgroundObject->SetModel(pSdrModel);
pBackgroundObject->SetMergedItem(XFillStyleItem(XFILL_SOLID));
pBackgroundObject->SetMergedItem(XLineStyleItem(XLINE_NONE));
pBackgroundObject->SetMergedItem(XFillColorItem(String(), rStyleSettings.GetFieldColor()));
@@ -216,9 +216,11 @@ void XDashList::impCreate()
basegfx::B2DPolygon aPolygon;
aPolygon.append(aStart);
aPolygon.append(aEnd);
- SdrObject* pLineObject = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPolygon));
+ SdrObject* pLineObject = new SdrPathObj(
+ *pSdrModel,
+ basegfx::B2DPolyPolygon(aPolygon));
OSL_ENSURE(0 != pLineObject, "XDashList: no LineObject created!" );
- pLineObject->SetModel(pSdrModel);
+ //pLineObject->SetModel(pSdrModel);
pLineObject->SetMergedItem(XLineStyleItem(XLINE_DASH));
pLineObject->SetMergedItem(XLineColorItem(String(), rStyleSettings.GetFieldTextColor()));
pLineObject->SetMergedItem(XLineWidthItem(30));
@@ -351,7 +353,7 @@ Bitmap* XDashList::CreateBitmapForUI( long nIndex, sal_Bool bDelete )
pLine->SetMergedItem(XLineStyleItem(XLINE_DASH));
pLine->SetMergedItem(XLineDashItem(String(), GetDash(nIndex)->GetDash()));
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(mpData->getBackgroundObject());
aObjectVector.push_back(pLine);
sdr::contact::ObjectContactOfObjListPainter aPainter(*pVD, aObjectVector, 0);
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index 692c0f25cd1c..312a97432ba5 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -168,7 +168,7 @@ public:
~impXGradientList()
{
delete mpVirtualDevice;
- SdrObject::Free(mpBackgroundObject);
+ deleteSdrObjectSafeAndClearPointer(mpBackgroundObject);
delete mpSdrModel;
}
@@ -180,7 +180,6 @@ void XGradientList::impCreate()
{
if(!mpData)
{
- const Point aZero(0, 0);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
VirtualDevice* pVirDev = new VirtualDevice;
@@ -196,11 +195,10 @@ void XGradientList::impCreate()
OSL_ENSURE(0 != pSdrModel, "XGradientList: no SdrModel created!" );
pSdrModel->GetItemPool().FreezeIdRanges();
- const Size aSinglePixel(pVirDev->PixelToLogic(Size(1, 1)));
- const Rectangle aBackgroundSize(aZero, Size(aSize.getWidth() - aSinglePixel.getWidth(), aSize.getHeight() - aSinglePixel.getHeight()));
- SdrObject* pBackgroundObject = new SdrRectObj(aBackgroundSize);
+ SdrObject* pBackgroundObject = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleB2DHomMatrix(aSize.getWidth(), aSize.getHeight()));
OSL_ENSURE(0 != pBackgroundObject, "XGradientList: no BackgroundObject created!" );
- pBackgroundObject->SetModel(pSdrModel);
pBackgroundObject->SetMergedItem(XFillStyleItem(XFILL_GRADIENT));
pBackgroundObject->SetMergedItem(XLineStyleItem(XLINE_SOLID));
pBackgroundObject->SetMergedItem(XLineColorItem(String(), Color(COL_BLACK)));
@@ -346,7 +344,7 @@ Bitmap* XGradientList::CreateBitmapForUI( long nIndex, sal_Bool bDelete )
pBackgroundObject->SetMergedItem(XFillStyleItem(XFILL_GRADIENT));
pBackgroundObject->SetMergedItem(XFillGradientItem(rItemSet.GetPool(), GetGradient(nIndex)->GetGradient()));
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(pBackgroundObject);
sdr::contact::ObjectContactOfObjListPainter aPainter(*pVD, aObjectVector, 0);
sdr::contact::DisplayInfo aDisplayInfo;
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index a5454144795f..1c5834b7cccc 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -169,8 +169,8 @@ public:
~impXHatchList()
{
delete mpVirtualDevice;
- SdrObject::Free(mpBackgroundObject);
- SdrObject::Free(mpHatchObject);
+ deleteSdrObjectSafeAndClearPointer(mpBackgroundObject);
+ deleteSdrObjectSafeAndClearPointer(mpHatchObject);
delete mpSdrModel;
}
@@ -183,7 +183,6 @@ void XHatchList::impCreate()
{
if(!mpData)
{
- const Point aZero(0, 0);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
VirtualDevice* pVirDev = new VirtualDevice;
@@ -199,19 +198,19 @@ void XHatchList::impCreate()
OSL_ENSURE(0 != pSdrModel, "XDashList: no SdrModel created!" );
pSdrModel->GetItemPool().FreezeIdRanges();
- const Size aSinglePixel(pVirDev->PixelToLogic(Size(1, 1)));
- const Rectangle aBackgroundSize(aZero, Size(aSize.getWidth() - aSinglePixel.getWidth(), aSize.getHeight() - aSinglePixel.getHeight()));
- SdrObject* pBackgroundObject = new SdrRectObj(aBackgroundSize);
+ SdrObject* pBackgroundObject = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleB2DHomMatrix(aSize.getWidth(), aSize.getHeight()));
OSL_ENSURE(0 != pBackgroundObject, "XDashList: no BackgroundObject created!" );
- pBackgroundObject->SetModel(pSdrModel);
pBackgroundObject->SetMergedItem(XFillStyleItem(XFILL_SOLID));
pBackgroundObject->SetMergedItem(XFillColorItem(String(), rStyleSettings.GetFieldColor()));
pBackgroundObject->SetMergedItem(XLineStyleItem(XLINE_SOLID));
pBackgroundObject->SetMergedItem(XLineColorItem(String(), Color(COL_BLACK)));
- SdrObject* pHatchObject = new SdrRectObj(aBackgroundSize);
+ SdrObject* pHatchObject = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleB2DHomMatrix(aSize.getWidth(), aSize.getHeight()));
OSL_ENSURE(0 != pHatchObject, "XDashList: no HatchObject created!" );
- pHatchObject->SetModel(pSdrModel);
pHatchObject->SetMergedItem(XFillStyleItem(XFILL_HATCH));
pHatchObject->SetMergedItem(XLineStyleItem(XLINE_NONE));
@@ -347,7 +346,7 @@ Bitmap* XHatchList::CreateBitmapForUI( long nIndex, sal_Bool bDelete )
pHatchObject->SetMergedItem(XFillStyleItem(XFILL_HATCH));
pHatchObject->SetMergedItem(XFillHatchItem(String(), GetHatch(nIndex)->GetHatch()));
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(mpData->getBackgroundObject());
aObjectVector.push_back(pHatchObject);
sdr::contact::ObjectContactOfObjListPainter aPainter(*pVD, aObjectVector, 0);
diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx
index be150004a373..87b5486c2fc7 100644
--- a/svx/source/xoutdev/xtablend.cxx
+++ b/svx/source/xoutdev/xtablend.cxx
@@ -182,8 +182,8 @@ public:
~impXLineEndList()
{
delete mpVirtualDevice;
- SdrObject::Free(mpBackgroundObject);
- SdrObject::Free(mpLineObject);
+ deleteSdrObjectSafeAndClearPointer(mpBackgroundObject);
+ deleteSdrObjectSafeAndClearPointer(mpLineObject);
delete mpSdrModel;
}
@@ -196,7 +196,6 @@ void XLineEndList::impCreate()
{
if(!mpData)
{
- const Point aZero(0, 0);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
VirtualDevice* pVirDev = new VirtualDevice;
@@ -212,10 +211,11 @@ void XLineEndList::impCreate()
OSL_ENSURE(0 != pSdrModel, "XLineEndList: no SdrModel created!" );
pSdrModel->GetItemPool().FreezeIdRanges();
- const Rectangle aBackgroundSize(aZero, aSize);
- SdrObject* pBackgroundObject = new SdrRectObj(aBackgroundSize);
+ SdrObject* pBackgroundObject = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleB2DHomMatrix(aSize.getWidth(), aSize.getHeight()));
OSL_ENSURE(0 != pBackgroundObject, "XLineEndList: no BackgroundObject created!" );
- pBackgroundObject->SetModel(pSdrModel);
+ //pBackgroundObject->SetModel(pSdrModel);
pBackgroundObject->SetMergedItem(XFillStyleItem(XFILL_SOLID));
pBackgroundObject->SetMergedItem(XLineStyleItem(XLINE_NONE));
pBackgroundObject->SetMergedItem(XFillColorItem(String(), rStyleSettings.GetFieldColor()));
@@ -225,9 +225,11 @@ void XLineEndList::impCreate()
basegfx::B2DPolygon aPolygon;
aPolygon.append(aStart);
aPolygon.append(aEnd);
- SdrObject* pLineObject = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPolygon));
+ SdrObject* pLineObject = new SdrPathObj(
+ *pSdrModel,
+ basegfx::B2DPolyPolygon(aPolygon));
OSL_ENSURE(0 != pLineObject, "XLineEndList: no LineObject created!" );
- pLineObject->SetModel(pSdrModel);
+ //pLineObject->SetModel(pSdrModel);
pLineObject->SetMergedItem(XLineStartWidthItem(aSize.Height()));
pLineObject->SetMergedItem(XLineEndWidthItem(aSize.Height()));
pLineObject->SetMergedItem(XLineColorItem(String(), rStyleSettings.GetFieldTextColor()));
@@ -368,7 +370,7 @@ Bitmap* XLineEndList::CreateBitmapForUI( long nIndex, sal_Bool bDelete )
pLine->SetMergedItem(XLineStartItem(String(), GetLineEnd(nIndex)->GetLineEnd()));
pLine->SetMergedItem(XLineEndItem(String(), GetLineEnd(nIndex)->GetLineEnd()));
- sdr::contact::SdrObjectVector aObjectVector;
+ SdrObjectVector aObjectVector;
aObjectVector.push_back(mpData->getBackgroundObject());
aObjectVector.push_back(pLine);
sdr::contact::ObjectContactOfObjListPainter aPainter(*pVD, aObjectVector, 0);
diff --git a/svx/workben/edittest.cxx b/svx/workben/edittest.cxx
index 2303f794ed8b..16f5b5964da7 100644
--- a/svx/workben/edittest.cxx
+++ b/svx/workben/edittest.cxx
@@ -203,9 +203,11 @@ XubString __EXPORT MyEditEngine::CalcFieldValue( const SvxFieldItem& rField, USH
if ( !pField )
return String( RTL_CONSTASCII_USTRINGPARAM( "<Empty>" ) );
- if ( pField->ISA( SvxDateField ) )
+ if ( dynamic_cast< SvxDateField* >(pField) )
+ {
return ((const SvxDateField*)pField)->GetFormatted( LANGUAGE_SYSTEM, LANGUAGE_SYSTEM );
- else if ( pField->ISA( SvxURLField ) )
+ }
+ else if ( dynamic_cast< SvxURLField* >(pField) )
{
const SvxURLField* pURL = (const SvxURLField*)pField;
if ( !bURLClicked )
@@ -234,7 +236,7 @@ void __EXPORT MyEditEngine::FieldClicked( const SvxFieldItem& rField, USHORT nPa
if ( !pField )
return;
- if ( pField->ISA( SvxURLField ) )
+ if ( dynamic_cast< SvxURLField* >(pField) )
{
bURLClicked = TRUE;
UpdateFields();
@@ -799,7 +801,7 @@ IMPL_LINK( EditMainWindow, TBSelect, ToolBox *, p )
case TB_IDLE: pEditEngine->EnableIdleFormatter( !pEditEngine->IsIdleFormatterEnabled() );
break;
case TB_INSFLD: {
- static BYTE nFld = 0;
+ static sal_uInt8 nFld = 0;
if ( nFld > 2 )
nFld = 0;
if ( nFld == 0 )
diff --git a/sw/inc/IDocumentDrawModelAccess.hxx b/sw/inc/IDocumentDrawModelAccess.hxx
index dd673fc90f54..902f3be5f950 100644
--- a/sw/inc/IDocumentDrawModelAccess.hxx
+++ b/sw/inc/IDocumentDrawModelAccess.hxx
@@ -26,7 +26,7 @@
#include <svx/svdtypes.hxx>
-class SdrModel;
+class FmFormModel;
class SdrPageView;
/** IDocumentDrawModelAccess
@@ -37,10 +37,10 @@ public:
/** Draw Model and id accessors
*/
- virtual const SdrModel* GetDrawModel() const = 0;
- virtual SdrModel* GetDrawModel() = 0;
- virtual SdrModel* _MakeDrawModel() = 0;
- virtual SdrModel* GetOrCreateDrawModel() = 0;
+ virtual const FmFormModel* GetDrawModel() const = 0;
+ virtual FmFormModel* GetDrawModel() = 0;
+ virtual FmFormModel* _MakeDrawModel() = 0;
+ virtual FmFormModel* GetOrCreateDrawModel() = 0;
virtual SdrLayerID GetHeavenId() const = 0;
virtual SdrLayerID GetHellId() const = 0;
virtual SdrLayerID GetControlsId() const = 0;
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index 8635a988d20a..b1f3d0562d3b 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -240,9 +240,6 @@ class IDocumentMarkAccess
// Returns the MarkType used to create the mark
static MarkType SAL_DLLPUBLIC_EXPORT GetType(const ::sw::mark::IMark& rMark);
-
- static const ::rtl::OUString SAL_DLLPUBLIC_EXPORT & GetCrossRefHeadingBookmarkNamePrefix();
- static const bool SAL_DLLPUBLIC_EXPORT IsLegalPaMForCrossRefHeadingBookmark( const SwPaM& rPaM );
protected:
virtual ~IDocumentMarkAccess() {};
};
diff --git a/sw/inc/anchoreddrawobject.hxx b/sw/inc/anchoreddrawobject.hxx
index d5ea9598879c..45fafd52b2df 100644
--- a/sw/inc/anchoreddrawobject.hxx
+++ b/sw/inc/anchoreddrawobject.hxx
@@ -40,8 +40,7 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject
bool mbValidPos;
// rectangle, keeping the last object rectangle after the postioning
- // --> OD 2004-09-29 #i34748# - change <maLastObjRect> to a pointer
- Rectangle* mpLastObjRect;
+ Rectangle maLastObjRect;
// boolean, indicating that anchored drawing object hasn't been attached
// to a anchor frame yet. Once, it is attached to a anchor frame the
@@ -137,8 +136,6 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject
virtual const SwRect GetObjBoundRect() const;
// <--
public:
- TYPEINFO();
-
SwAnchoredDrawObject();
virtual ~SwAnchoredDrawObject();
@@ -156,13 +153,8 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject
// accessors to the object area and its position
virtual const SwRect GetObjRect() const;
- // --> OD 2004-09-29 #i34748# - change return type to a pointer.
- // Return value can be NULL.
- const Rectangle* GetLastObjRect() const;
- // <--
- // --> OD 2004-09-29 #i34748# - change method
- void SetLastObjRect( const Rectangle& _rNewObjRect );
- // <--
+ const Rectangle& GetLastObjRect() const;
+ void SetLastObjRect(const Rectangle& _rNewObjRect);
/** adjust positioning and alignment attributes for new anchor frame
diff --git a/sw/inc/anchoredobject.hxx b/sw/inc/anchoredobject.hxx
index 39e92e48dd61..7967a8de8184 100644
--- a/sw/inc/anchoredobject.hxx
+++ b/sw/inc/anchoredobject.hxx
@@ -23,7 +23,6 @@
#ifndef _ANCHOREDOBJECT_HXX
#define _ANCHOREDOBJECT_HXX
-#include <tools/rtti.hxx>
#include <swtypes.hxx>
#include <swrect.hxx>
@@ -238,8 +237,6 @@ class SW_DLLPUBLIC SwAnchoredObject
virtual const SwRect GetObjBoundRect() const = 0;
// <--
public:
- TYPEINFO();
-
virtual ~SwAnchoredObject();
// accessors to member <mpDrawObj>
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 5368d4191216..e07e1516178f 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -24,9 +24,10 @@
#ifndef _CALBCK_HXX
#define _CALBCK_HXX
-#include <tools/rtti.hxx>
+#include <tools/solar.h>
#include "swdllapi.h"
-#include <boost/noncopyable.hpp>
+#include <typeinfo>
+#include <boost/utility.hpp>
class SwModify;
class SwClientIter;
@@ -109,10 +110,6 @@ public:
const SwModify* GetRegisteredIn() const { return pRegisteredIn; }
bool IsLast() const { return !pLeft && !pRight; }
- // needed for class SwClientIter
- TYPEINFO();
-
- // get information about attribute
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
};
@@ -147,7 +144,10 @@ public:
// the same, but without setting bModifyLocked or checking for any of the flags
// mba: it would be interesting to know why this is necessary
// also allows to limit callback to certain type (HACK)
- void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType = TYPE(SwClient) );
+ void ModifyBroadcast(
+ const SfxPoolItem *pOldValue,
+ const SfxPoolItem *pNewValue,
+ bool (*pIsValidSwClient)(const SwClient&) = 0);
// a more universal broadcasting mechanism
void CallSwClientNotify( const SfxHint& rHint ) const;
@@ -205,6 +205,7 @@ protected:
class SwClientIter
{
+private:
friend SwClient* SwModify::Remove(SwClient *); // for pointer adjustments
friend void SwModify::Add(SwClient *pDepend); // for pointer adjustments
@@ -223,34 +224,17 @@ class SwClientIter
// from its SwModify
SwClientIter *pNxtIter;
- // iterator can be limited to return only SwClient objects of a certain type
- TypeId aSrchId;
-
public:
SW_DLLPUBLIC SwClientIter( const SwModify& );
SW_DLLPUBLIC ~SwClientIter();
- const SwModify& GetModify() const { return rRoot; }
-
- SwClient* operator++();
- SwClient* GoStart();
- SwClient* GoEnd();
-
- // returns the current SwClient object;
- // in case this was already removed, the object marked down to become
- // the next current one is returned
- SwClient* operator()() const
- { return pDelNext == pAct ? pAct : pDelNext; }
-
// return "true" if an object was removed from a client chain in iteration
// adding objects to a client chain in iteration is forbidden
// SwModify::Add() asserts this
bool IsChanged() const { return pDelNext != pAct; }
- SW_DLLPUBLIC SwClient* First( TypeId nType );
- SW_DLLPUBLIC SwClient* Next();
- SW_DLLPUBLIC SwClient* Last( TypeId nType );
- SW_DLLPUBLIC SwClient* Previous();
+ SW_DLLPUBLIC SwClient* SwClientIter_First();
+ SW_DLLPUBLIC SwClient* SwClientIter_Next();
};
#endif
diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx
index a4901f219023..5ed705cc25f0 100644
--- a/sw/inc/ccoll.hxx
+++ b/sw/inc/ccoll.hxx
@@ -80,8 +80,6 @@ public:
SwCondCollItem(sal_uInt16 nWhich = FN_COND_COLL);
~SwCondCollItem();
- TYPEINFO();
-
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual int operator==( const SfxPoolItem& ) const;
diff --git a/sw/inc/charfmt.hxx b/sw/inc/charfmt.hxx
index 61944fafa10f..2bd4c557d75c 100644
--- a/sw/inc/charfmt.hxx
+++ b/sw/inc/charfmt.hxx
@@ -41,7 +41,6 @@ class SwCharFmt : public SwFmt
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
};
namespace CharFmt
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index d734766b54ee..0bd9571ec5ce 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -27,8 +27,6 @@
#include <tools/string.hxx>
#include <tools/link.hxx>
-#include <tools/rtti.hxx>
-
#include <IShellCursorSupplier.hxx>
#include "swdllapi.h"
#include <swtypes.hxx> // fuer SWPOSDOC
@@ -327,7 +325,6 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
- TYPEINFO();
SwCrsrShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 );
// verkleideter Copy-Constructor
SwCrsrShell( SwCrsrShell& rShell, Window *pWin );
@@ -673,7 +670,7 @@ public:
const SwShellCrsr* getShellCrsr( bool bBlock ) const
{ return (const_cast<SwCrsrShell*>(this))->getShellCrsr( bBlock ); }
- FASTBOOL IsBlockMode() const { return 0 != pBlockCrsr; }
+ bool IsBlockMode() const { return 0 != pBlockCrsr; }
const IBlockCursor* GetBlockCrsr() const { return pBlockCrsr; }
IBlockCursor* GetBlockCrsr() { return pBlockCrsr; }
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index d720eef76175..10c2458c0e6b 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -24,7 +24,6 @@
#define _DCONTACT_HXX
#include <svx/svdobj.hxx>
-#include <svx/svdovirt.hxx>
#include <swtypes.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
@@ -70,15 +69,19 @@ void ClrContourCache( const SdrObject *pObj );
SwRect GetBoundRectOfAnchoredObj( const SdrObject* pObj );
// <--
-//Liefert den UserCall ggf. vom Gruppenobjekt
-// OD 2004-03-31 #i26791# - change return type
-SwContact* GetUserCall( const SdrObject* );
+// try to find the SwContact connected to the SdrObject
+SwContact* findConnectionToSdrObjectDirect(const SdrObject* pSdrObject);
+SwContact* findConnectionToSdrObject(const SdrObject* pSdrObject);
+
+// set/reset connection between SdrObject and SwContact
+void establishConnectionToSdrObject(SdrObject* pSdrObject, SwContact* pSwContact);
+void resetConnectionToSdrObject(SdrObject* pSdrObject);
// liefert sal_True falls das SrdObject ein Marquee-Object (Lauftext) ist
sal_Bool IsMarqueeTextObj( const SdrObject& rObj );
//Basisklasse fuer die folgenden KontaktObjekte (Rahmen+Zeichenobjekte)
-class SwContact : public SdrObjUserCall, public SwClient
+class SwContact : public SfxListener, public SwClient
{
// OD 05.09.2003 #112039# - boolean, indicating destruction of contact object
// important note: boolean has to be set at the beginning of each destructor
@@ -95,7 +98,7 @@ class SwContact : public SdrObjUserCall, public SwClient
For group object the members are individually moved to the corresponding
layer, because <SdrObjGroup::GetLayer()> does return 0, if members
aren't on the same layer as the group object, and
- <SdrObjGroup::SetLayer(..)|NbcSetLayer(..)> sets also the layer of
+ <SdrObjGroup::SetLayer(..)> sets also the layer of
the members.
OD 2004-01-15 #110582# - moved from subclass <SwDrawContact>
@@ -117,8 +120,6 @@ protected:
void SetInDTOR();
public:
- TYPEINFO();
-
//Fuer den Reader, es wir nur die Verbindung hergestellt.
SwContact( SwFrmFmt *pToRegisterIn );
virtual ~SwContact();
@@ -222,7 +223,7 @@ public:
};
//KontactObjekt fuer die Verbindung zwischen Rahmen bzw. deren Formaten
-//im StarWriter (SwClient) und den Zeichenobjekten des Drawing (SdrObjUserCall)
+//im StarWriter (SwClient) und den Zeichenobjekten des Drawing (SfxBroadcaster/Listener/Notify)
class SW_DLLPUBLIC SwFlyDrawContact : public SwContact
{
@@ -235,10 +236,8 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
public:
- TYPEINFO();
-
//Legt das DrawObjekt an und meldet es beim Model an.
- SwFlyDrawContact( SwFlyFrmFmt* pToRegisterIn, SdrModel* pMod );
+ SwFlyDrawContact( SwFlyFrmFmt* pToRegisterIn, SdrModel& rTargetModel );
virtual ~SwFlyDrawContact();
// OD 2004-03-29 #i26791#
@@ -267,103 +266,122 @@ public:
// OD 16.05.2003 #108784# - new class for re-direct methods calls at a 'virtual'
// drawing object to its referenced object.
-class SwDrawVirtObj : public SdrVirtObj
+class SwDrawVirtObj : public SdrObject
{
- private:
- // data for connection to writer layout
- // OD 2004-03-25 #i26791# - anchored drawing object instance for the
- // 'virtual' drawing object
- SwAnchoredDrawObject maAnchoredDrawObj;
-
- // writer-drawing contact object the 'virtual' drawing object is controlled by.
- // This object is also the <UserCall> of the drawing object, if it's
- // inserted into the drawing layer.
- SwDrawContact& mrDrawContact;
+private:
+ // data for connection to writer layout
+ // OD 2004-03-25 #i26791# - anchored drawing object instance for the
+ // 'virtual' drawing object
+ SwAnchoredDrawObject maAnchoredDrawObj;
- using SdrVirtObj::GetPlusHdl;
+ // writer-drawing contact object the 'virtual' drawing object is controlled by.
+ // This object is also the <UserCall> of the drawing object, if it's
+ // inserted into the drawing layer.
+ SwDrawContact& mrDrawContact;
- protected:
- // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
- // not used but something own (top left of new SnapRect minus top left
- // of original SnapRect)
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+protected:
+ // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
+ // not used but something own (top left of new SnapRect minus top left
+ // of original SnapRect)
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
- public:
- TYPEINFO();
+ // original Notify from SdrVirtObj
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- SwDrawVirtObj( SdrObject& _rNewObj,
- SwDrawContact& _rDrawContact );
- virtual ~SwDrawVirtObj();
+ // members which were missing from SdrVirtObj
+ SdrObject& rRefObj;
+ Rectangle aSnapRect;
- // access to offset
- // OD 30.06.2003 #108784# - virtual!!!
- virtual const Point GetOffset() const;
+ virtual ~SwDrawVirtObj();
- virtual SdrObject* Clone() const;
- virtual void operator=( const SdrObject& rObj );
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
- // connection to writer layout
- // OD 2004-03-29 #i26791#
- const SwAnchoredObject* GetAnchoredObj() const;
- SwAnchoredObject* AnchoredObj();
- const SwFrm* GetAnchorFrm() const;
- SwFrm* AnchorFrm();
- void RemoveFromWriterLayout();
+public:
+ SwDrawVirtObj(SdrObject& _rNewObj, SwDrawContact& _rDrawContact);
- // connection to drawing layer
- void AddToDrawingPage();
- void RemoveFromDrawingPage();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
- // is 'virtual' drawing object connected to writer layout and
- // to drawing layer.
- bool IsConnected() const;
+ virtual bool IsClosedObj() const;
- virtual void NbcSetAnchorPos(const Point& rPnt);
+ // access to offset
+ // OD 30.06.2003 #108784# - virtual!!!
+ virtual const basegfx::B2DPoint GetOffset() const;
- // #108784#
- // All overloaded methods which need to use the offset
- virtual void RecalcBoundRect();
- virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual ::basegfx::B2DPolyPolygon TakeContour() const;
- virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
- virtual SdrHdl* GetPlusHdl(const SdrHdl& rHdl, sal_uInt16 nPlNum) const;
- virtual void NbcMove(const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
- virtual void NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual void Move(const Size& rSiz);
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
- virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
- virtual void Mirror(const Point& rRef1, const Point& rRef2);
- virtual void Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear);
- virtual void RecalcSnapRect();
- virtual const Rectangle& GetSnapRect() const;
- virtual void SetSnapRect(const Rectangle& rRect);
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual const Rectangle& GetLogicRect() const;
- virtual void SetLogicRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
- virtual Point GetSnapPoint(sal_uInt32 i) const;
- virtual Point GetPoint(sal_uInt32 i) const;
- virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
+ // connection to writer layout
+ // OD 2004-03-29 #i26791#
+ const SwAnchoredObject* GetAnchoredObj() const;
+ SwAnchoredObject* AnchoredObj();
+ const SwFrm* GetAnchorFrm() const;
+ SwFrm* AnchorFrm();
+ void RemoveFromWriterLayout();
+
+ // connection to drawing layer
+ void AddToDrawingPage();
+ void RemoveFromDrawingPage();
+
+ // is 'virtual' drawing object connected to writer layout and
+ // to drawing layer.
+ bool IsConnected() const;
+
+ // #108784#
+ // All overloaded methods which need to use the offset
+ virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+ virtual void GetPlusHdl(SdrHdlList& rHdlList, SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
+ virtual basegfx::B2DPoint GetObjectPoint(sal_uInt32 i) const;
+ virtual void SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i);
// #108784#
- virtual FASTBOOL HasTextEdit() const;
-
- // OD 17.06.2003 #108784# - overload 'layer' methods
- virtual SdrLayerID GetLayer() const;
- virtual void NbcSetLayer(SdrLayerID nLayer);
- virtual void SetLayer(SdrLayerID nLayer);
-
- // FullDrag support
- virtual bool supportsFullDrag() const;
- virtual SdrObject* getFullDragClone() const;
-
- // #i97197#
- virtual void SetBoundRectDirty();
- virtual const Rectangle& GetCurrentBoundRect() const;
- virtual const Rectangle& GetLastBoundRect() const;
+ virtual bool HasTextEdit() const;
+
+ // OD 17.06.2003 #108784# - overload 'layer' methods
+ virtual SdrLayerID GetLayer() const;
+ //virtual void NbcSetLayer(SdrLayerID nLayer);
+ virtual void SetLayer(SdrLayerID nLayer);
+
+ // FullDrag support
+ virtual bool supportsFullDrag() const;
+ virtual SdrObject* getFullDragClone() const;
+
+ //////////////////////////////////////////////////////////////////////////
+ // methods which were missing from SdrVirtObj which do something
+ SdrObject& ReferencedObj();
+ const SdrObject& GetReferencedObj() const;
+
+ virtual sdr::properties::BaseProperties& GetProperties() const;
+ virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
+ virtual sal_uInt32 GetObjInventor() const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrObjList* getChildrenOfSdrObject() const;
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+ virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+ virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual bool IsPolygonObject() const;
+ virtual sal_uInt32 GetObjectPointCount() const;
+ virtual SdrObjGeoData* GetGeoData() const;
+ virtual void SetGeoData(const SdrObjGeoData& rGeo);
+ virtual void ReformatText();
+ virtual bool HasMacro() const;
+ virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
+ virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
+ virtual void PaintMacro (OutputDevice& rOut, const SdrObjMacroHitRec& rRec) const;
+ virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
+ virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
};
// OD 26.06.2003 #108784#
@@ -371,7 +389,7 @@ bool CheckControlLayer( const SdrObject *pObj );
//KontactObjekt fuer die Verbindung von Formaten als Repraesentanten der
//Zeichenobjekte im StarWriter (SwClient) und den Objekten selbst im Drawing
-//(SdrObjUserCall).
+//(SfxBroadcaster/Listener/Notify).
// --> OD 2006-01-18 #129959#
class NestedUserCallHdl;
@@ -397,12 +415,13 @@ class SwDrawContact : public SwContact
bool mbDisconnectInProgress : 1;
// --> OD 2006-01-18 #129959#
- // Needed data for handling of nested <SdrObjUserCall> events in
+ // Needed data for handling of nested <SfxBroadcaster/Listener/Notify> events in
// method <_Changed(..)>
- bool mbUserCallActive : 1;
+ bool mbNotifyActive : 1;
+
// event type, which is handled for <mpSdrObjHandledByCurrentUserCall>.
- // Note: value only valid, if <mbUserCallActive> is sal_True.
- SdrUserCallType meEventTypeOfCurrentUserCall;
+ // Note: value only valid, if <mbNotifyActive> is true.
+ SdrHintKind meEventTypeOfCurrentUserCall;
friend class NestedUserCallHdl;
// <--
@@ -454,8 +473,6 @@ class SwDrawContact : public SwContact
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
public:
- TYPEINFO();
-
SwDrawContact( SwFrmFmt *pToRegisterIn, SdrObject *pObj );
virtual ~SwDrawContact();
@@ -515,12 +532,18 @@ class SwDrawContact : public SwContact
// by frame.
SdrObject* GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm );
- // virtuelle Methoden von SdrObjUserCall
- virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
+ // new central SdrObject change handler, called from Notify
+ void HandleChanged(const SdrObject& rObj, SdrHintKind eHint);
+
+ // virtual method from SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
- // wird von Changed() und auch vom UndoDraw benutzt, uebernimmt
+ // wird von Notify() und auch vom UndoDraw benutzt, uebernimmt
// das Notifien von Absaetzen, die ausweichen muessen
- void _Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle* pOldBoundRect);
+ void _Changed(
+ const SdrObject& rObj,
+ SdrHintKind eHint,
+ bool bGroupHierarchy);
//Moved alle SW-Verbindungen zu dem neuen Master.
void ChangeMasterObject( SdrObject *pNewMaster );
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 8eeaf36faa96..b9c0de2404f3 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -88,6 +88,7 @@ class SwList;
#include <memory>
#include <boost/scoped_ptr.hpp>
+#include <svx/svdobj.hxx>
#include <boost/shared_ptr.hpp>
#include <flypos.hxx>
@@ -190,7 +191,6 @@ class _SetGetExpFld;
class SwDrawContact;
class SwLayouter;
class SdrView;
-class SdrMarkList;
class SwAuthEntry;
class SwLayoutCache;
class IStyleAccess;
@@ -327,7 +327,7 @@ class SW_DLLPUBLIC SwDoc :
ViewShell *pCurrentView; // SwDoc should get a new member pCurrentView//swmod 071225
boost::shared_ptr<SwRootFrm> pLayoutPtr;
- SdrModel *pDrawModel; // StarView Drawing
+ FmFormModel* pDrawModel; // StarView Drawing
SwDocUpdtFld *pUpdtFlds; // Struktur zum Field-Update
SwFldTypes *pFldTypes; // Feldtypen
@@ -946,8 +946,8 @@ public:
/** IDocumentDrawModelAccess
*/
- virtual const SdrModel* GetDrawModel() const;
- virtual SdrModel* GetDrawModel();
+ virtual const FmFormModel* GetDrawModel() const;
+ virtual FmFormModel* GetDrawModel();
virtual SdrLayerID GetHeavenId() const;
virtual SdrLayerID GetHellId() const;
virtual SdrLayerID GetControlsId() const;
@@ -958,8 +958,8 @@ public:
virtual bool IsVisibleLayerId( const SdrLayerID& _nLayerId ) const;
virtual SdrLayerID GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId );
virtual SdrLayerID GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId );
- virtual SdrModel* _MakeDrawModel();
- virtual SdrModel* GetOrCreateDrawModel();
+ virtual FmFormModel* _MakeDrawModel();
+ virtual FmFormModel* GetOrCreateDrawModel();
/** IDocumentLayoutAccess
*/
@@ -1934,7 +1934,7 @@ public:
// -------------------- FeShell - Schnittstellen -----------------------
// !!!!! diese gehen immer davon aus, das ein Layout existiert !!!!
- sal_Bool ChgAnchor( const SdrMarkList& _rMrkList,
+ sal_Bool ChgAnchor( const SdrObjectVector& rSdrObjectVector,
RndStdIds _eAnchorType,
const sal_Bool _bSameOnly,
const sal_Bool _bPosCorr );
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 4a7f94ac1545..48ad72fef1dc 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -141,7 +141,6 @@ public:
// aber selbst implementieren
SFX_DECL_INTERFACE(SW_DOCSHELL)
SFX_DECL_OBJECTFACTORY()
- TYPEINFO();
static SfxInterface *_GetInterface() { return GetStaticInterface(); }
diff --git a/sw/inc/dpage.hxx b/sw/inc/dpage.hxx
index 35b02b5a333f..617f49c85198 100644
--- a/sw/inc/dpage.hxx
+++ b/sw/inc/dpage.hxx
@@ -32,21 +32,26 @@ class SdrPageGridFrameList;
class SwDrawDocument;
class SwDoc;
-class SwDPage : public FmFormPage, public SdrObjUserCall
+class SwDPage : public FmFormPage
{
+private:
SdrPageGridFrameList* pGridLst;
SwDoc& rDoc;
+protected:
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrPage(const SdrPage& rSource);
+
public:
- SwDPage(SwDrawDocument& rNewModel, sal_Bool bMasterPage=sal_False);
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrPage* CloneSdrPage(SdrModel* pTargetModel = 0) const;
+
+ SwDPage(SwDrawDocument& rNewModel, bool bMasterPage = false);
~SwDPage();
- // #i3694#
- // This GetOffset() method is not needed anymore, it even leads to errors.
- // virtual Point GetOffset() const;
- virtual SdrObject* ReplaceObject( SdrObject* pNewObj, sal_uLong nObjNum );
+ virtual SdrObject* ReplaceObjectInSdrObjList( SdrObject& rNewObj, sal_uInt32 nObjNum );
- virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV,
+ virtual const SdrPageGridFrameList* GetGridFrameList(const SdrView& rSdrView,
const Rectangle *pRect) const;
sal_Bool RequestHelp( Window* pWindow, SdrView* pView, const HelpEvent& rEvt );
diff --git a/sw/inc/drawdoc.hxx b/sw/inc/drawdoc.hxx
index 41f679a35b62..876054b0b7ed 100644
--- a/sw/inc/drawdoc.hxx
+++ b/sw/inc/drawdoc.hxx
@@ -42,7 +42,7 @@ public:
const SwDoc& GetDoc() const { return *pDoc; }
SwDoc& GetDoc() { return *pDoc; }
- virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual SdrPage* AllocPage(bool bMasterPage);
// fuers "load on demand" von Grafiken im DrawingLayer
virtual SvStream* GetDocumentStream( SdrDocumentStreamInfo& rInfo ) const;
@@ -50,6 +50,8 @@ public:
// fuers Speicher von Rechtecken als Control-Ersatz fuker Versionen < 5.0
virtual SdrLayerID GetControlExportLayerId( const SdrObject & ) const;
+ virtual bool IsWriter() const;
+
protected:
// --> OD 2006-03-01 #b6382898#
// overload of <SdrModel::createUnoModel()> is needed to provide corresponding uno model.
diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx
index a3b920179580..5f611ae00304 100644
--- a/sw/inc/fchrfmt.hxx
+++ b/sw/inc/fchrfmt.hxx
@@ -57,8 +57,6 @@ private:
SwFmtCharFmt & operator= (const SwFmtCharFmt &);
public:
- TYPEINFO();
-
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 7be9502aaa96..aef64ebc19fd 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -26,16 +26,13 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/embed/XClassifiedObject.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
-
#include <svx/svdobj.hxx>
#include "swdllapi.h"
#include <editsh.hxx>
#include <flyenum.hxx>
-
-// OD 25.06.2003 #108784#
#include <svx/svdtypes.hxx>
-
#include <svtools/embedhlp.hxx>
+#include <svx/sdrobjectfactory.hxx>
#ifndef INCLUDED_VECTOR
#include <vector>
@@ -58,7 +55,6 @@ class Outliner;
class SotDataObject;
class SwFrmFmt;
struct SwSortOptions;
-class SdrMarkList;
namespace svx
{
@@ -192,6 +188,7 @@ class SW_DLLPUBLIC SwFEShell : public SwEditShell
SW_DLLPRIVATE void EndAllActionAndCall();
SW_DLLPRIVATE void ScrollTo( const Point &rPt );
+ SW_DLLPRIVATE void ScrollTo( const basegfx::B2DPoint &rPt ); // TTTT: remove wrapper later
// OD 25.06.2003 #108784# - correct type of 1st parameter
SW_DLLPRIVATE void ChangeOpaque( SdrLayerID nLayerId );
@@ -216,10 +213,6 @@ class SW_DLLPUBLIC SwFEShell : public SwEditShell
const Point& rInsPt, sal_Bool bIsMove,
sal_Bool bSelectInsert );
- // get list of marked SdrObjects;
- // helper method for GetSelFrmType, IsSelContainsControl
- SW_DLLPRIVATE const SdrMarkList* _GetMarkList() const;
-
SW_DLLPRIVATE sal_Bool CheckHeadline( bool bRepeat ) const;
using SwEditShell::Copy;
@@ -228,7 +221,6 @@ public:
using SwEditShell::Insert;
- TYPEINFO();
SwFEShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 );
SwFEShell( SwEditShell& rShell, Window *pWin );
virtual ~SwFEShell();
@@ -250,7 +242,8 @@ public:
//SS fuer DrawObjekte und Rahmen-----------------------------
//Wenn ein Objekt angegeben wurde, so wird genau diese Markiert (anstatt
- //ueber die Position zu suchen.
+ //ueber die Position zu suchen. // TTTT: remove wrapper later
+ sal_Bool SelectObj( const basegfx::B2DPoint& rSelPt, sal_uInt8 nFlag = 0, SdrObject *pObj = 0 );
sal_Bool SelectObj( const Point& rSelPt, sal_uInt8 nFlag = 0, SdrObject *pObj = 0 );
void DelSelectedObj();
@@ -265,9 +258,10 @@ public:
void SelectionToHell(); //Unter dem Dokument
// folgende zwei Methoden returnen den enum SdrHdlKind, um sich ein
- // includen von SVDRAW.HXX zu ersparen als int deklariert.
+ // includen von SVDRAW.HXX zu ersparen als int deklariert. // TTTT: remove wrapper later
bool IsObjSelectable( const Point& rPt );
- int IsInsideSelectedObj( const Point& rPt ); //!! returns enum values
+ bool IsObjSelectable( const basegfx::B2DPoint& rPt );
+ int IsInsideSelectedObj( const basegfx::B2DPoint& rPt ); //!! returns enum values
// #107513#
// Test if there is a draw object at that position and if it should be selected.
@@ -479,8 +473,8 @@ public:
//Setzen vom DragMode (z.B. Rotate), tut nix bei Rahmenselektion.
void SetDragMode( sal_uInt16 eSdrDragMode );
- sal_uInt16 IsObjSelected() const; //Liefert gleich die Anzahl der Objekte,
- //zaehlt aber nicht die Objekte in Gruppen.
+ sal_uInt32 GetNumberOfSelectedObjects() const; //Liefert gleich die Anzahl der Objekte, zaehlt aber nicht die Objekte in Gruppen.
+ sal_Bool IsObjSelected() const;
sal_Bool IsObjSelected( const SdrObject& rObj ) const;
void EndTextEdit(); //Loescht ggf. das Objekt.
@@ -496,18 +490,17 @@ public:
//selektiert.
//Mit BreakCreate wird der Vorgang abgebrochen, dann ist kein Objekt
//mehr selektiert.
- sal_Bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos );
- sal_Bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sal_uInt32 eObjInventor, const Point &);
- void MoveCreate ( const Point &rPos );
- sal_Bool EndCreate ( sal_uInt16 eSdrCreateCmd );
+ bool BeginCreate(const SdrObjectCreationInfo& rSdrObjectCreationInfo, const basegfx::B2DPoint& rPos );
+ void MoveCreate( const basegfx::B2DPoint &rPos );
+ bool EndCreate( sal_uInt16 eSdrCreateCmd );
void BreakCreate();
- sal_Bool IsDrawCreate() const;
- void CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect, sal_uInt16 nSlotId);
+ bool IsDrawCreate() const;
+ void CreateDefaultShape(const SdrObjectCreationInfo& rSdrObjectCreationInfo, const Rectangle& rRect, sal_uInt16 nSlotId);
// Funktionen f�r Rubberbox, um Draw-Objekte zu selektieren
- sal_Bool BeginMark( const Point &rPos );
- void MoveMark ( const Point &rPos );
- sal_Bool EndMark ();
+ bool BeginMark( const basegfx::B2DPoint& rPos );
+ void MoveMark( const basegfx::B2DPoint& rPos );
+ bool EndMark();
void BreakMark();
//Gruppe erzeugen, aufloesen, nix bei Rahmenselektion.
@@ -597,8 +590,9 @@ public:
//Seitennummer der Seite in der der Point liegt, 0 wenn keine
//getroffen ist.
- sal_uInt16 GetPageNumber( const Point &rPoint ) const;
- sal_Bool GetPageNumber( long nYPos, sal_Bool bAtCrsrPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, String &rDisplay ) const;
+ sal_uInt32 GetPageNumber( const Point &rPoint ) const;
+ sal_uInt32 GetPageNumber( const basegfx::B2DPoint &rPoint ) const; // TTTT: remove wrapper later
+ bool GetPageNumber( long nYPos, bool bAtCrsrPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, String &rDisplay ) const;
SwFlyFrmFmt* InsertObject( const svt::EmbeddedObjectRef&,
const SfxItemSet* pFlyAttrSet = 0,
diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx
index c544f4a9c860..09fc12145c18 100644
--- a/sw/inc/fmtautofmt.hxx
+++ b/sw/inc/fmtautofmt.hxx
@@ -48,8 +48,6 @@ private:
SwFmtAutoFmt & operator= (const SwFmtAutoFmt &);
public:
- TYPEINFO();
-
// "pure virtual methods" of SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index f25e9e66d6d2..ed9b1ce93d6a 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -98,8 +98,6 @@ protected:
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
inline void SetNextTxtFmtColl(SwTxtFmtColl& rNext);
SwTxtFmtColl& GetNextTxtFmtColl() const { return *pNextTxtFmtColl; }
@@ -187,7 +185,6 @@ protected:
{}
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
};
typedef SwGrfFmtColl* SwGrfFmtCollPtr;
@@ -225,9 +222,6 @@ class SW_DLLPUBLIC SwCollCondition : public SwClient
} aSubCondition;
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
-
SwCollCondition( SwTxtFmtColl* pColl, sal_uLong nMasterCond,
sal_uLong nSubCond = 0 );
SwCollCondition( SwTxtFmtColl* pColl, sal_uLong nMasterCond,
@@ -275,8 +269,6 @@ protected:
{}
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
virtual ~SwConditionTxtFmtColl();
const SwCollCondition* HasCondition( const SwCollCondition& rCond ) const;
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index 19c0d08615df..ea02a35101a4 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -56,8 +56,6 @@ protected:
virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
public:
- TYPEINFO();
-
// single argument constructors shall be explicit.
explicit SwFmtFld( const SwField &rFld );
@@ -112,7 +110,6 @@ public:
, pView(pV)
{}
- TYPEINFO();
const SwFmtFld* GetField() const { return pFld; }
sal_Int16 Which() const { return nWhich; }
const SwView* GetView() const { return pView; }
diff --git a/sw/inc/fmtfollowtextflow.hxx b/sw/inc/fmtfollowtextflow.hxx
index 10e9ab203e1c..dc9b78b719ea 100644
--- a/sw/inc/fmtfollowtextflow.hxx
+++ b/sw/inc/fmtfollowtextflow.hxx
@@ -37,8 +37,6 @@ public:
SwFmtFollowTextFlow( sal_Bool bFlag = sal_False )
: SfxBoolItem( RES_FOLLOW_TEXT_FLOW, bFlag ) {}
- TYPEINFO();
-
// "pure virtual Methoden" vom SfxPoolItem
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
diff --git a/sw/inc/fmtftntx.hxx b/sw/inc/fmtftntx.hxx
index 1743b426fde3..1e49cfdbd322 100644
--- a/sw/inc/fmtftntx.hxx
+++ b/sw/inc/fmtftntx.hxx
@@ -58,7 +58,7 @@ protected:
public:
virtual sal_uInt16 GetValueCount() const;
-
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
virtual int operator==( const SfxPoolItem& ) const;
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx
index 462f90bc091a..0eaa7d9ff360 100644
--- a/sw/inc/fmthdft.hxx
+++ b/sw/inc/fmthdft.hxx
@@ -46,8 +46,6 @@ public:
~SwFmtHeader();
SwFmtHeader& operator=( const SwFmtHeader &rCpy );
- TYPEINFO();
-
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
@@ -80,8 +78,6 @@ public:
~SwFmtFooter();
SwFmtFooter& operator=( const SwFmtFooter &rCpy );
- TYPEINFO();
-
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/sw/inc/fmtinfmt.hxx b/sw/inc/fmtinfmt.hxx
index 276f8dfef7a0..a3163b5f829c 100644
--- a/sw/inc/fmtinfmt.hxx
+++ b/sw/inc/fmtinfmt.hxx
@@ -48,13 +48,12 @@ class SW_DLLPUBLIC SwFmtINetFmt: public SfxPoolItem
sal_uInt16 nINetId;
sal_uInt16 nVisitedId;
public:
+ POOLITEM_FACTORY()
SwFmtINetFmt( const String& rURL, const String& rTarget );
SwFmtINetFmt( const SwFmtINetFmt& rAttr );
SwFmtINetFmt(); // for TypeInfo
virtual ~SwFmtINetFmt();
- TYPEINFO();
-
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/sw/inc/fmtline.hxx b/sw/inc/fmtline.hxx
index 0b774d90a807..24fde6251638 100644
--- a/sw/inc/fmtline.hxx
+++ b/sw/inc/fmtline.hxx
@@ -37,11 +37,10 @@ class SW_DLLPUBLIC SwFmtLineNumber: public SfxPoolItem
sal_uLong bCountLines :1; //Zeilen des Absatzes sollen mitgezaehlt werden.
public:
+ POOLITEM_FACTORY()
SwFmtLineNumber();
~SwFmtLineNumber();
- TYPEINFO();
-
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx
index 4f7d14887f6a..4b899ae14532 100644
--- a/sw/inc/fmtornt.hxx
+++ b/sw/inc/fmtornt.hxx
@@ -43,7 +43,6 @@ class SW_DLLPUBLIC SwFmtVertOrient: public SfxPoolItem
sal_Int16 eOrient;
sal_Int16 eRelation;
public:
- TYPEINFO();
SwFmtVertOrient( SwTwips nY = 0, sal_Int16 eVert = com::sun::star::text::VertOrientation::NONE,
sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA );
inline SwFmtVertOrient &operator=( const SwFmtVertOrient &rCpy );
@@ -81,7 +80,6 @@ class SW_DLLPUBLIC SwFmtHoriOrient: public SfxPoolItem
sal_Int16 eRelation;
sal_Bool bPosToggle : 1; // auf geraden Seiten Position spiegeln
public:
- TYPEINFO();
SwFmtHoriOrient( SwTwips nX = 0, sal_Int16 eHori = com::sun::star::text::HoriOrientation::NONE,
sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA, sal_Bool bPos = sal_False );
inline SwFmtHoriOrient &operator=( const SwFmtHoriOrient &rCpy );
diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx
index 6c1453d8bf09..6d561122682b 100644
--- a/sw/inc/fmtpdsc.hxx
+++ b/sw/inc/fmtpdsc.hxx
@@ -62,8 +62,6 @@ public:
SwFmtPageDesc &operator=( const SwFmtPageDesc &rCpy );
~SwFmtPageDesc();
- TYPEINFO();
-
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
diff --git a/sw/inc/fmtwrapinfluenceonobjpos.hxx b/sw/inc/fmtwrapinfluenceonobjpos.hxx
index 5e6691b21edd..855c04910674 100644
--- a/sw/inc/fmtwrapinfluenceonobjpos.hxx
+++ b/sw/inc/fmtwrapinfluenceonobjpos.hxx
@@ -34,8 +34,6 @@ private:
sal_Int16 mnWrapInfluenceOnPosition;
public:
- TYPEINFO();
-
// --> OD 2004-10-18 #i35017# - constant name has changed
SwFmtWrapInfluenceOnObjPos(
sal_Int16 _nWrapInfluenceOnPosition =
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index eeb4ee02a02e..f5ebbc728699 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -66,8 +66,6 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
virtual ~SwFmt();
SwFmt &operator=(const SwFmt&);
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index f38bbe84b2a8..5becae28b4a8 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -65,9 +65,7 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
- //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt).
+ //Vernichtet alle Frms in aDepend (Frms werden per RTTI erkannt).
virtual void DelFrms();
//Erzeugt die Ansichten
@@ -89,7 +87,7 @@ public:
const Point* pPoint = 0,
const sal_Bool bCalcFrm = sal_False ) const;
- // Sucht das SdrObject. Der SdrObjUserCall ist Client vom Format.
+ // Sucht das SdrObject. Der SwDrawContact ist Client vom Format.
// Der UserCall kennt sein SdrObject.
SwContact *FindContactObj();
const SwContact *FindContactObj() const
@@ -167,7 +165,6 @@ protected:
{}
public:
- TYPEINFO();
~SwFlyFrmFmt();
//Erzeugt die Ansichten
@@ -280,7 +277,6 @@ protected:
{}
public:
- TYPEINFO();
~SwDrawFrmFmt();
//DrawObjecte werden aus den Arrays am Layout entfernt. Die DrawObjecte
diff --git a/sw/inc/globdoc.hxx b/sw/inc/globdoc.hxx
index fe377c545776..6b497b20d159 100644
--- a/sw/inc/globdoc.hxx
+++ b/sw/inc/globdoc.hxx
@@ -31,7 +31,6 @@ class SwGlobalDocShell : public SwDocShell
public:
SFX_DECL_OBJECTFACTORY();
- TYPEINFO();
SwGlobalDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED);
~SwGlobalDocShell();
diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx
index 94bac8a37c42..87de5b10758d 100644
--- a/sw/inc/grfatr.hxx
+++ b/sw/inc/grfatr.hxx
@@ -95,7 +95,6 @@ public:
class SW_DLLPUBLIC SwCropGrf : public SvxGrfCrop
{
public:
- TYPEINFO();
SwCropGrf();
SwCropGrf( sal_Int32 nLeft, sal_Int32 nRight,
sal_Int32 nTop, sal_Int32 nBottom );
@@ -173,6 +172,7 @@ protected:
public:
// pure virtual-Methiden from SfxInt16Item
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
@@ -209,7 +209,6 @@ class SW_DLLPUBLIC SwGammaGrf : public SfxPoolItem
{
double nValue;
public:
- TYPEINFO();
SwGammaGrf() : SfxPoolItem( RES_GRFATR_GAMMA ), nValue( 1.0 )
{}
diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx
index 677fd629a56f..663f3132fdeb 100644
--- a/sw/inc/index.hxx
+++ b/sw/inc/index.hxx
@@ -25,7 +25,6 @@
#include <limits.h>
#include <tools/solar.h>
-#include <tools/rtti.hxx> // for RTTI of SwIndexReg
#include <tools/string.hxx> // for xub_StrLen
#include <swdllapi.h>
@@ -138,7 +137,6 @@ public:
// rtti, abgeleitete moegens gleichtun oder nicht. Wenn sie es gleichtun
// kann ueber das SwIndexReg typsicher gecastet werden.
- TYPEINFO();
void MoveTo( SwIndexReg& rArr );
};
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 46d4128a3fe5..faf53c95ddc0 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -798,8 +798,6 @@ public:
bool IsHidden() const;
// <--
- TYPEINFO(); // fuer rtti
-
// override SwIndexReg
virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
const bool bNegative = false, const bool bDelete = false );
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index e71abcbcf60f..39b134305cfa 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -396,8 +396,6 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
// MakeFrm will be called for a certain layout
// pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent)
virtual SwCntntFrm *MakeFrm( SwFrm* pSib ) = 0;
diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index 78e91644e236..74bf7cda3b8f 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -56,8 +56,7 @@ class SW_DLLPUBLIC SwFmtDrop: public SfxPoolItem, public SwClient
sal_uInt8 nChars; // Number of characters
sal_Bool bWholeWord; // Erstes Wort als Initialen
public:
- TYPEINFO(); //Bereits in der Basisklasse SwClient
-
+ POOLITEM_FACTORY()
SwFmtDrop();
virtual ~SwFmtDrop();
@@ -110,8 +109,6 @@ public:
class SwRegisterItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
inline SwRegisterItem( const sal_Bool bRegister = sal_False );
// @@@ public copy assignment, but no copy ctor?
@@ -140,8 +137,6 @@ inline SwRegisterItem& SwRegisterItem::operator=(
class SW_DLLPUBLIC SwNumRuleItem : public SfxStringItem
{
public:
- TYPEINFO();
-
// --> OD 2008-03-04 #refactorlists# - removed <pDefinedIn>
SwNumRuleItem()
: SfxStringItem( RES_PARATR_NUMRULE, aEmptyStr ) {}
@@ -172,8 +167,6 @@ public:
class SwParaConnectBorderItem : public SfxBoolItem
{
public:
- TYPEINFO();
-
inline SwParaConnectBorderItem( const sal_Bool bConnect = sal_True );
// @@@ public copy assignment, but no copy ctor?
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index 92f7a6a664b8..91d22a703b98 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -790,9 +790,7 @@
#include "svx/sdr/contact/viewcontactofsdrmediaobj.hxx"
#include "svx/sdr/properties/defaultproperties.hxx"
#include "svx/sdtaaitm.hxx"
-#include "svx/sdtacitm.hxx"
#include "svx/sdtaditm.hxx"
-#include "svx/sdtagitm.hxx"
#include "svx/sdtaitm.hxx"
#include "svx/sdtakitm.hxx"
#include "svx/simptabl.hxx"
@@ -859,7 +857,6 @@
#include "tools/resary.hxx"
#include "tools/resid.hxx"
#include "tools/resmgr.hxx"
-#include "tools/rtti.hxx"
#include "tools/shl.hxx"
#include "tools/solar.h"
#include "tools/stream.hxx"
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index b69e66546886..92b11651a459 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -300,7 +300,6 @@ public:
, pView(pV)
{}
- TYPEINFO();
const SwRedline* GetRedline() const { return pRedline; }
sal_Int16 Which() const { return nWhich; }
const SwView* GetView() const { return pView; }
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 17d84d4b7cae..2526a533917a 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -28,7 +28,6 @@
#include <com/sun/star/uno/Sequence.h>
-#include <tools/rtti.hxx>
#include <tools/ref.hxx>
#include <svl/svarray.hxx>
// --> OD #i117863#
@@ -179,8 +178,6 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
public:
- TYPEINFO(); // rtti
-
SwSection(SectionType const eType, String const& rName,
SwSectionFmt & rFormat);
virtual ~SwSection();
@@ -323,10 +320,9 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
~SwSectionFmt();
- //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt).
+ //Vernichtet alle Frms in aDepend (Frms werden per RTTI erkannt).
virtual void DelFrms();
//Erzeugt die Ansichten
@@ -390,7 +386,7 @@ inline SwSectionFmt* SwSectionFmt::GetParent() const
{
SwSectionFmt* pRet = 0;
if( GetRegisteredIn() )
- pRet = PTR_CAST( SwSectionFmt, GetRegisteredIn() );
+ pRet = const_cast< SwSectionFmt* >(dynamic_cast< const SwSectionFmt* >( GetRegisteredIn() ));
return pRet;
}
diff --git a/sw/inc/swacorr.hxx b/sw/inc/swacorr.hxx
index a2ed10e1deb3..61654c96ed23 100644
--- a/sw/inc/swacorr.hxx
+++ b/sw/inc/swacorr.hxx
@@ -44,8 +44,6 @@ protected:
String& );
public:
- TYPEINFO();
-
SwAutoCorrect( const SvxAutoCorrect& rACorr );
virtual ~SwAutoCorrect();
};
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 9c07f5d181db..7929699eaa61 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -183,7 +183,7 @@ public:
SwAttrSet( SwAttrPool&, const sal_uInt16* nWhichPairTable );
SwAttrSet( const SwAttrSet& );
- virtual SfxItemSet* Clone(sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0) const;
+ virtual SfxItemSet* Clone(bool bItems = true, SfxItemPool *pToPool = 0) const;
int Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew );
int Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew );
diff --git a/sw/inc/swbaslnk.hxx b/sw/inc/swbaslnk.hxx
index 779344c3d51d..f84d94b03c1e 100644
--- a/sw/inc/swbaslnk.hxx
+++ b/sw/inc/swbaslnk.hxx
@@ -51,8 +51,6 @@ protected:
{}
public:
- TYPEINFO();
-
SwBaseLink( sal_uInt16 nMode, sal_uInt16 nFormat, SwCntntNode* pNode = 0 )
: ::sfx2::SvBaseLink( nMode, nFormat ), pCntntNode( pNode ),
bSwapIn( sal_False ), bNoDataFlag( sal_False ), bIgnoreDataChanged( sal_False ),
diff --git a/sw/inc/swddetbl.hxx b/sw/inc/swddetbl.hxx
index c8eb25439920..09231bb3b767 100644
--- a/sw/inc/swddetbl.hxx
+++ b/sw/inc/swddetbl.hxx
@@ -31,7 +31,6 @@ class SwDDETable : public SwTable
{
SwDepend aDepend;
public:
- TYPEINFO();
// Constructor movet alle Lines/Boxen aus der SwTable zu sich.
// Die SwTable ist danach Leer und muss geloescht werden.
SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
diff --git a/sw/inc/swerror.h b/sw/inc/swerror.h
index 7fff7e4fdd09..1994f5cb82ed 100644
--- a/sw/inc/swerror.h
+++ b/sw/inc/swerror.h
@@ -91,12 +91,12 @@
#ifndef __RSC
-inline FASTBOOL IsWarning( sal_uLong nErr )
+inline bool IsWarning( sal_uLong nErr )
{
return 0 != ( nErr & ERRCODE_WARNING_MASK & nErr );
}
-inline FASTBOOL IsError( sal_uLong nErr )
+inline bool IsError( sal_uLong nErr )
{
return nErr && 0 == ( ERRCODE_WARNING_MASK & nErr );
}
diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx
index b8721a6b348f..a23833498d40 100644
--- a/sw/inc/switerator.hxx
+++ b/sw/inc/switerator.hxx
@@ -29,15 +29,62 @@
template< class TElementType, class TSource > class SwIterator
{
SwClientIter aClientIter;
+
public:
+ SwIterator( const TSource& rSrc )
+ : aClientIter(rSrc)
+ {
+ DBG_ASSERT( 0 != dynamic_cast< const SwClient* >(&rSrc), "Incompatible types!" );
+ }
+
+ TElementType* First()
+ {
+ SwClient* t = aClientIter.SwClientIter_First();
+ TElementType* p = dynamic_cast< TElementType* >(t);
+
+ while(!p && t)
+ {
+ t = aClientIter.SwClientIter_Next();
+ p = dynamic_cast< TElementType* >(t);
+ }
+
+ return p;
+ }
+
+ TElementType* Next()
+ {
+ SwClient* t = aClientIter.SwClientIter_Next();
+ TElementType* p = dynamic_cast< TElementType* >(t);
+
+ while(!p && t)
+ {
+ t = aClientIter.SwClientIter_Next();
+ p = dynamic_cast< TElementType* >(t);
+ }
+
+ return p;
+ }
+
+ static TElementType* FirstElement(const TSource& rMod)
+ {
+ SwClientIter aIter(rMod);
+ SwClient* t = aIter.SwClientIter_First();
+ TElementType* p = dynamic_cast< TElementType* >(t);
+
+ while(!p && t)
+ {
+ t = aIter.SwClientIter_Next();
+ p = dynamic_cast< TElementType* >(t);
+ }
+
+ return p;
+ }
- SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { DBG_ASSERT( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); }
- TElementType* First() { SwClient* p = aClientIter.First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
- TElementType* Last() { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); }
- TElementType* Next() { SwClient* p = aClientIter.Next(); return PTR_CAST(TElementType,p); }
- TElementType* Previous() { SwClient* p = aClientIter.Previous(); return PTR_CAST(TElementType,p); }
- static TElementType* FirstElement( const TSource& rMod ) { SwClient* p = SwClientIter(rMod).First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
- bool IsChanged() { return aClientIter.IsChanged(); }
+ bool IsChanged()
+ {
+ return aClientIter.IsChanged();
+ }
};
#endif
+// eof
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index ec3f9e2f1516..5d983f1c6d51 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -131,7 +131,6 @@ public:
// public Data - used for internal Clipboard / Drag & Drop / XSelection
SwTransferable *pDragDrop, *pXSelection;
- TYPEINFO();
SFX_DECL_INTERFACE(SW_INTERFACE_MODULE)
// dieser Ctor nur fuer SW-Dll
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index cbd1d42434b8..4340e541a591 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -105,9 +105,6 @@ protected:
sal_Bool bModifyLocked :1;
sal_Bool bNewModel :1; // sal_False: old SubTableModel; sal_True: new RowSpanModel
-#ifdef DBG_UTIL
- bool bDontChangeModel; // This is set by functions (like Merge()) to forbid a laet model change
-#endif
sal_Bool IsModifyLocked(){ return bModifyLocked;}
@@ -121,8 +118,6 @@ public:
SEARCH_COL // column selection
};
- TYPEINFO();
-
// single argument ctors shall be explicit.
explicit SwTable( SwTableFmt* );
virtual ~SwTable();
@@ -205,18 +200,12 @@ public:
sal_Bool Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes, const SwSelBoxes& rMerged,
SwTableBox* pMergeBox, SwUndoTblMerge* pUndo = 0 )
{
-#ifdef DBG_UTIL
- bDontChangeModel = true;
-#endif
return bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pMergeBox, pUndo ) :
OldMerge( pDoc, rBoxes, pMergeBox, pUndo );
}
sal_Bool SplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt=1,
sal_Bool bSameHeight = sal_False )
{
-#ifdef DBG_UTIL
- bDontChangeModel = true;
-#endif
return bNewModel ? NewSplitRow( pDoc, rBoxes, nCnt, bSameHeight ) :
OldSplitRow( pDoc, rBoxes, nCnt, bSameHeight );
}
@@ -330,8 +319,6 @@ class SW_DLLPUBLIC SwTableLine: public SwClient // Client vom FrmFmt
SwTableBox *pUpper;
public:
- TYPEINFO();
-
SwTableLine() : pUpper(0) {}
SwTableLine( SwTableLineFmt*, sal_uInt16 nBoxes, SwTableBox *pUp );
@@ -384,8 +371,6 @@ class SW_DLLPUBLIC SwTableBox: public SwClient //Client vom FrmFmt
SwTableBoxFmt* CheckBoxFmt( SwTableBoxFmt* );
public:
- TYPEINFO();
-
SwTableBox() : pSttNd(0), pUpper(0), pImpl(0) {}
SwTableBox( SwTableBoxFmt*, sal_uInt16 nLines, SwTableLine *pUp = 0 );
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index fe27009d3d9c..5a4807b5814e 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -43,8 +43,6 @@ protected:
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt)
};
@@ -63,8 +61,6 @@ protected:
{}
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt)
};
@@ -86,7 +82,6 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt)
};
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index 8955935434a4..07237e3f338e 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -92,8 +92,6 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
public:
- TYPEINFO(); // rtti
-
// single argument ctors shall be explicit.
explicit SwTOXMark( const SwTOXType* pTyp );
virtual ~SwTOXMark();
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index d1d405bd95d1..ea0199960dbd 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -98,7 +98,6 @@ protected:
public:
SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtRuby();
- TYPEINFO();
virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx
index 2ce5774aa631..c557f4f89c4a 100644
--- a/sw/inc/txtinet.hxx
+++ b/sw/inc/txtinet.hxx
@@ -44,7 +44,6 @@ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwTxtINetFmt( SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtINetFmt();
- TYPEINFO();
virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 2b53b5f08fc4..0fef4821c732 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -29,6 +29,8 @@
#include <com/sun/star/text/XTextContent.hpp>
// --> OD 2009-01-13 #i59051#
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <com/sun/star/drawing/PointSequence.hpp>
// <--
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -43,15 +45,14 @@
// <--
#include <svl/itemprop.hxx>
-class SdrMarkList;
class SdrView;
class SwDoc;
+
/******************************************************************************
*
******************************************************************************/
class SwFmDrawPage : public SvxFmDrawPage
{
- SdrPageView* pPageView;
protected:
// Erzeugen eines SdrObjects anhand einer Description. Kann von
@@ -63,13 +64,11 @@ public:
SwFmDrawPage( SdrPage* pPage );
virtual ~SwFmDrawPage() throw ();
- const SdrMarkList& PreGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > & xShapes);
+ const SdrObjectVector PreGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > & xShapes);
void PreUnGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > xShapeGroup);
// void PostGroup(); ?? wird es noch gebraucht ??
SdrView* GetDrawView() {return mpView;}
- SdrPageView* GetPageView();
- void RemovePageView();
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetInterface( SdrObject* pObj );
// Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt
@@ -240,6 +239,12 @@ class SwXShape : public SwXShapeBaseClass,
::com::sun::star::drawing::PolyPolygonBezierCoords _ConvertPolyPolygonBezierToLayoutDir(
const ::com::sun::star::drawing::PolyPolygonBezierCoords& aPath );
+ ::com::sun::star::drawing::PointSequenceSequence _ConvertPointSequenceSequenceToLayoutDir(
+ const ::com::sun::star::drawing::PointSequenceSequence& aPath);
+
+ ::com::sun::star::drawing::PointSequence _ConvertPointSequenceToLayoutDir(
+ const ::com::sun::star::drawing::PointSequence& aPath);
+
/** method to get property from aggregation object
OD 2004-10-28 #i36248#
@@ -260,7 +265,6 @@ public:
SwXShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape);
- TYPEINFO();
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/sw/inc/unofield.hxx b/sw/inc/unofield.hxx
index 866cac325cdd..ec5df3778335 100644
--- a/sw/inc/unofield.hxx
+++ b/sw/inc/unofield.hxx
@@ -82,8 +82,6 @@ public:
SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc);
- TYPEINFO();
-
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
//XUnoTunnel
@@ -154,8 +152,6 @@ public:
SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc);
- TYPEINFO();
-
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
//XUnoTunnel
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index b9894c1769ff..47d16cb68880 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -95,8 +95,6 @@ public:
//XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- TYPEINFO();
-
//XNamed
virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException );
@@ -143,7 +141,7 @@ public:
SwFrmFmt* GetFrmFmt() const
{
- return PTR_CAST ( SwFrmFmt, GetRegisteredIn() );
+ return const_cast< SwFrmFmt* >(dynamic_cast< const SwFrmFmt* >( GetRegisteredIn() ));
}
FlyCntType GetFlyCntType()const {return eType;}
@@ -348,7 +346,6 @@ class SwXOLEListener : public cppu::WeakImplHelper1
public:
SwXOLEListener(SwFmt& rOLEFmt, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xOLE);
~SwXOLEListener();
- TYPEINFO();
// ::com::sun::star::lang::XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/sw/inc/unoredline.hxx b/sw/inc/unoredline.hxx
index 65d4d9676291..c88b42ebf37c 100644
--- a/sw/inc/unoredline.hxx
+++ b/sw/inc/unoredline.hxx
@@ -115,8 +115,6 @@ public:
SwXRedline(SwRedline& rRedline, SwDoc& rDoc);
~SwXRedline();
- TYPEINFO();
-
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();}
virtual void SAL_CALL release( ) throw(){OWeakObject::release();}
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 0739a34dbb14..0d5f560b56a6 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -216,8 +216,6 @@ public:
//const SfxItemPropertyMap* _pMap);
~SwXStyle();
- TYPEINFO();
-
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
//XUnoTunnel
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 56d0aeae663d..2e248bfd9644 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -119,8 +119,6 @@ public:
SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface
- TYPEINFO();
-
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
//XUnoTunnel
@@ -197,8 +195,6 @@ public:
SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLine);
- TYPEINFO();
-
//XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
@@ -338,8 +334,6 @@ public:
//XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- TYPEINFO();
-
//XTextTable
virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::table::XTableRows > SAL_CALL getRows( ) throw(::com::sun::star::uno::RuntimeException);
@@ -449,8 +443,6 @@ public:
SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt, SwRangeDescriptor& rDesc);
~SwXCellRange();
- TYPEINFO();
-
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
//XUnoTunnel
@@ -533,8 +525,6 @@ public:
SwXTableRows(SwFrmFmt& rFrmFmt);
- TYPEINFO();
-
// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException );
@@ -582,7 +572,6 @@ public:
SwXTableColumns(SwFrmFmt& rFrmFmt);
- TYPEINFO();
// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 29051ebb5b95..c09c7895121d 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -246,6 +246,9 @@ class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass,
using SfxBaseModel::removeEventListener;
protected:
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModel() const;
+
virtual ~SwXTextDocument();
public:
SwXTextDocument(SwDocShell* pShell);
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 1d22a67a2465..34bb47a3510c 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -25,7 +25,6 @@
#include <com/sun/star/embed/XClassifiedObject.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <tools/rtti.hxx>
#include <svl/svarray.hxx>
#include "swdllapi.h"
#include <swtypes.hxx>
@@ -200,8 +199,6 @@ protected:
sal_uInt16 nLockPaint; //ist != 0 wenn das Paint gelocked ist.
public:
- TYPEINFO();
-
SwViewImp *Imp() { return pImp; }
const SwViewImp *Imp() const { return pImp; }
@@ -264,6 +261,7 @@ public:
//Es wird, wenn notwendig, soweit gescrollt, dass das
//uebergebene Rect im sichtbaren Ausschnitt liegt.
void MakeVisible( const SwRect & );
+ void MakeVisible( const basegfx::B2DRange& );
//Bei naechster Gelegenheit die neue Dokuemntgroesse an das UI weiterreichen.
void SizeChgNotify();
diff --git a/sw/inc/wdocsh.hxx b/sw/inc/wdocsh.hxx
index b074972f3616..d5c4916b9a26 100644
--- a/sw/inc/wdocsh.hxx
+++ b/sw/inc/wdocsh.hxx
@@ -37,7 +37,6 @@ public:
// aber selbst implementieren
SFX_DECL_INTERFACE(SW_WEBDOCSHELL)
SFX_DECL_OBJECTFACTORY();
- TYPEINFO();
SwWebDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED);
~SwWebDocShell();
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index 02c11d701f0d..c70a5146e3b0 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -65,9 +65,10 @@ sal_Bool SwAccessibleCell::IsSelected()
DBG_ASSERT( GetMap(), "no map?" );
const ViewShell *pVSh = GetMap()->GetShell();
DBG_ASSERT( pVSh, "no shell?" );
- if( pVSh->ISA( SwCrsrShell ) )
+ const SwCrsrShell *pCSh = dynamic_cast< const SwCrsrShell * >( pVSh );
+
+ if( pCSh )
{
- const SwCrsrShell *pCSh = static_cast< const SwCrsrShell * >( pVSh );
if( pCSh->IsTableMode() )
{
const SwCellFrm *pCFrm =
@@ -88,7 +89,7 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
// SELECTABLE
const ViewShell *pVSh = GetMap()->GetShell();
DBG_ASSERT( pVSh, "no shell?" );
- if( pVSh->ISA( SwCrsrShell ) )
+ if( dynamic_cast< const SwCrsrShell* >(pVSh) )
rStateSet.AddState( AccessibleStateType::SELECTABLE );
// SELECTED
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index cfa70d423aba..a4a0399747f7 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -135,29 +135,19 @@ Window *SwAccessibleContext::GetWindow()
// get ViewShell from accessibility map, and cast to cursor shell
SwCrsrShell* SwAccessibleContext::GetCrsrShell()
{
- SwCrsrShell* pCrsrShell;
ViewShell* pViewShell = GetMap() ? GetMap()->GetShell() : 0;
ASSERT( pViewShell, "no view shell" );
- if( pViewShell && pViewShell->ISA( SwCrsrShell ) )
- pCrsrShell = static_cast<SwCrsrShell*>( pViewShell );
- else
- pCrsrShell = NULL;
- return pCrsrShell;
+ return dynamic_cast< SwCrsrShell* >(pViewShell);
}
const SwCrsrShell* SwAccessibleContext::GetCrsrShell() const
{
// just like non-const GetCrsrShell
- const SwCrsrShell* pCrsrShell;
const ViewShell* pViewShell = GetMap() ? GetMap()->GetShell() : 0;
ASSERT( pViewShell, "no view shell" );
- if( pViewShell && pViewShell->ISA( SwCrsrShell ) )
- pCrsrShell = static_cast<const SwCrsrShell*>( pViewShell );
- else
- pCrsrShell = NULL;
- return pCrsrShell;
+ return dynamic_cast< const SwCrsrShell* >(pViewShell);
}
@@ -1409,9 +1399,8 @@ sal_Bool SwAccessibleContext::Select( SwPaM *pPaM, SdrObject *pObj,
if( !pCrsrShell )
return sal_False;
- SwFEShell* pFEShell = pCrsrShell->ISA( SwFEShell )
- ? static_cast<SwFEShell*>( pCrsrShell )
- : 0;
+ SwFEShell* pFEShell = dynamic_cast< SwFEShell* >(pCrsrShell);
+
// Get rid of activated OLE object
if( pFEShell )
pFEShell->FinishOLEObj();
@@ -1421,9 +1410,8 @@ sal_Bool SwAccessibleContext::Select( SwPaM *pPaM, SdrObject *pObj,
{
if( pFEShell )
{
- Point aDummy;
sal_uInt8 nFlags = bAdd ? SW_ADD_SELECT : 0;
- pFEShell->SelectObj( aDummy, nFlags, pObj );
+ pFEShell->SelectObj( basegfx::B2DPoint(), nFlags, pObj );
bRet = sal_True;
}
}
@@ -1435,8 +1423,7 @@ sal_Bool SwAccessibleContext::Select( SwPaM *pPaM, SdrObject *pObj,
if( pFEShell && (pFEShell->IsFrmSelected() ||
pFEShell->IsObjSelected()) )
{
- Point aPt( LONG_MIN, LONG_MIN );
- pFEShell->SelectObj( aPt, 0 );
+ pFEShell->SelectObj( basegfx::B2DPoint(LONG_MIN, LONG_MIN), 0 );
bCallShowCrsr = sal_True;
}
pCrsrShell->KillPams();
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 29685bf50702..83db96973a2d 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -345,10 +345,11 @@ void SwAccessibleDocument::Dispose( sal_Bool bRecursive )
IMPL_LINK( SwAccessibleDocument, WindowChildEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ VclWindowEvent *pVclEvent = dynamic_cast< VclWindowEvent * >( pEvent );
+ DBG_ASSERT( pVclEvent, "Unknown WindowEvent!" );
+
+ if ( pVclEvent )
{
- VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent );
DBG_ASSERT( pVclEvent->GetWindow(), "Window???" );
switch ( pVclEvent->GetId() )
{
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index d3941a70ac78..e2ce6ad6e89b 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -53,9 +53,10 @@ sal_Bool SwAccessibleFrameBase::IsSelected()
DBG_ASSERT( GetMap(), "no map?" );
const ViewShell *pVSh = GetMap()->GetShell();
DBG_ASSERT( pVSh, "no shell?" );
- if( pVSh->ISA( SwFEShell ) )
+ const SwFEShell *pFESh = dynamic_cast< const SwFEShell * >( pVSh );
+
+ if( pFESh )
{
- const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh );
const SwFrm *pFlyFrm = pFESh->GetCurrFlyFrm();
if( pFlyFrm == GetFrm() )
bRet = sal_True;
@@ -71,7 +72,7 @@ void SwAccessibleFrameBase::GetStates(
const ViewShell *pVSh = GetMap()->GetShell();
DBG_ASSERT( pVSh, "no shell?" );
- sal_Bool bSelectable = pVSh->ISA( SwFEShell );
+ const bool bSelectable(dynamic_cast< const SwFEShell* >(pVSh));
// SELECTABLE
if( bSelectable )
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx
index 3f1a3e8748b9..53ca64a50c7b 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -39,8 +39,8 @@
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <dcontact.hxx>
-
#include <vcl/window.hxx>
+#include <svx/svdlegacy.hxx>
namespace css = ::com::sun::star;
@@ -103,18 +103,16 @@ SwAccessibleChild::SwAccessibleChild( const SwFrm* pFrm,
void SwAccessibleChild::Init( const SdrObject* pDrawObj )
{
mpDrawObj = pDrawObj;
- mpFrm = mpDrawObj && mpDrawObj->ISA(SwVirtFlyDrawObj)
- ? static_cast < const SwVirtFlyDrawObj * >( mpDrawObj )->GetFlyFrm()
- : 0;
+ const SwVirtFlyDrawObj* pSwVirtFlyDrawObj = dynamic_cast< const SwVirtFlyDrawObj* >(mpDrawObj);
+ mpFrm = pSwVirtFlyDrawObj ? pSwVirtFlyDrawObj->GetFlyFrm() : 0;
mpWindow = 0;
}
void SwAccessibleChild::Init( const SwFrm* pFrm )
{
mpFrm = pFrm;
- mpDrawObj = mpFrm && mpFrm->IsFlyFrm()
- ? static_cast < const SwFlyFrm * >( mpFrm )->GetVirtDrawObj()
- : 0;
+ const SwFlyFrm* pSwFlyFrm = dynamic_cast< const SwFlyFrm* >(mpFrm);
+ mpDrawObj = pSwFlyFrm ? pSwFlyFrm->GetVirtDrawObj() : 0;
mpWindow = 0;
}
@@ -279,7 +277,7 @@ SwRect SwAccessibleChild::GetBox( const SwAccessibleMap& rAccMap ) const
}
else if( mpDrawObj )
{
- aBox = SwRect( mpDrawObj->GetCurrentBoundRect() );
+ aBox = SwRect( sdr::legacy::GetBoundRect(*mpDrawObj) );
}
else if ( mpWindow )
{
@@ -367,8 +365,8 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
}
else if( mpDrawObj )
{
- const SwDrawContact *pContact =
- static_cast< const SwDrawContact* >( GetUserCall( mpDrawObj ) );
+ // replace formally used 'GetUserCall()' by new notify/listener mechanism
+ const SwDrawContact* pContact = static_cast< const SwDrawContact* >(findConnectionToSdrObject(mpDrawObj));
ASSERT( pContact, "sdr contact is missing" );
if( pContact )
{
diff --git a/sw/source/core/access/accfrmobjmap.cxx b/sw/source/core/access/accfrmobjmap.cxx
index 677c28351bce..4fc284ae9fb2 100644
--- a/sw/source/core/access/accfrmobjmap.cxx
+++ b/sw/source/core/access/accfrmobjmap.cxx
@@ -150,7 +150,7 @@ SwAccessibleChildMap::SwAccessibleChildMap( const SwRect& rVisArea,
: ( (nControlsId == nLayer)
? SwAccessibleChildMapKey::CONTROLS
: SwAccessibleChildMapKey::HEAVEN );
- SwAccessibleChildMapKey aKey( eLayerId, pObj->GetOrdNum() );
+ SwAccessibleChildMapKey aKey( eLayerId, pObj->GetNavigationPosition() );
value_type aEntry( aKey, rLower );
return _SwAccessibleChildMap::insert( aEntry );
}
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index da6f8ac729e0..8be7f772f90d 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -69,6 +69,7 @@
#include <ndtxt.hxx>
#include <dflyobj.hxx>
#include <prevwpage.hxx>
+#include <svx/fmmodel.hxx>
#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -155,12 +156,13 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
// notifications for writer fly frames.
// OD 01.07.2003 #110554# - do not broadcast notifications for plane
// <SdrObject>objects
- const SdrHint *pSdrHint = PTR_CAST( SdrHint, &rHint );
+ const SdrBaseHint* pSdrHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
if ( !pSdrHint ||
- ( pSdrHint->GetObject() &&
- ( pSdrHint->GetObject()->ISA(SwFlyDrawObj) ||
- pSdrHint->GetObject()->ISA(SwVirtFlyDrawObj) ||
- IS_TYPE(SdrObject,pSdrHint->GetObject()) ) ) )
+ ( pSdrHint->GetSdrHintObject() &&
+ ( dynamic_cast< const SwFlyDrawObj* >(pSdrHint->GetSdrHintObject()) ||
+ dynamic_cast< const SwVirtFlyDrawObj* >(pSdrHint->GetSdrHintObject()) ||
+ typeid(*pSdrHint->GetSdrHintObject()) == typeid(SdrObject)))) // IS_TYPE(SdrObject,pSdrHint->GetSdrHintObject()) ) ) )
{
return;
}
@@ -261,7 +263,7 @@ SwAccessibleObjShape_Impl
SwAccessibleObjShape_Impl *pShapes = 0;
SwAccessibleObjShape_Impl *pSelShape = 0;
- sal_uInt16 nSelShapes = pFESh ? pFESh->IsObjSelected() : 0;
+ sal_uInt32 nSelShapes = pFESh ? pFESh->GetNumberOfSelectedObjects() : 0;
rSize = size();
if( rSize > 0 )
@@ -1050,9 +1052,8 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
size_t nShapes = 0;
const ViewShell *pVSh = GetShell();
- const SwFEShell *pFESh = pVSh->ISA( SwFEShell ) ?
- static_cast< const SwFEShell * >( pVSh ) : 0;
- sal_uInt16 nSelShapes = pFESh ? pFESh->IsObjSelected() : 0;
+ const SwFEShell *pFESh = dynamic_cast< const SwFEShell * >( pVSh );
+ sal_uInt32 nSelShapes = pFESh ? pFESh->GetNumberOfSelectedObjects() : 0;
{
vos::OGuard aGuard( maMutex );
@@ -1137,9 +1138,8 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
void SwAccessibleMap::DoInvalidateShapeFocus()
{
const ViewShell *pVSh = GetShell();
- const SwFEShell *pFESh = pVSh->ISA( SwFEShell ) ?
- static_cast< const SwFEShell * >( pVSh ) : 0;
- sal_uInt16 nSelShapes = pFESh ? pFESh->IsObjSelected() : 0;
+ const SwFEShell *pFESh = dynamic_cast< const SwFEShell * >( pVSh );
+ sal_uInt32 nSelShapes = pFESh ? pFESh->GetNumberOfSelectedObjects() : 0;
if( nSelShapes != 1 )
return;
@@ -1967,18 +1967,21 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
SwAccessibleChild aFrmOrObj( pFrm );
sal_Bool bShapeSelected = sal_False;
const ViewShell *pVSh = GetShell();
- if( pVSh->ISA( SwCrsrShell ) )
+ const SwCrsrShell *pCSh = dynamic_cast< const SwCrsrShell * >( pVSh );
+
+ if( pCSh )
{
- const SwCrsrShell *pCSh = static_cast< const SwCrsrShell * >( pVSh );
if( pCSh->IsTableMode() )
{
while( aFrmOrObj.GetSwFrm() && !aFrmOrObj.GetSwFrm()->IsCellFrm() )
aFrmOrObj = aFrmOrObj.GetSwFrm()->GetUpper();
}
- else if( pVSh->ISA( SwFEShell ) )
+ else
+ {
+ const SwFEShell *pFESh = dynamic_cast< const SwFEShell * >( pVSh );
+
+ if( pFESh )
{
- sal_uInt16 nObjCount;
- const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh );
const SwFrm *pFlyFrm = pFESh->GetCurrFlyFrm();
if( pFlyFrm )
{
@@ -1986,13 +1989,14 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
"cursor is not contained in fly frame" );
aFrmOrObj = pFlyFrm;
}
- else if( (nObjCount = pFESh->IsObjSelected()) > 0 )
+ else if( pFESh->IsObjSelected() )
{
bShapeSelected = sal_True;
aFrmOrObj = static_cast<const SwFrm *>( 0 );
}
}
}
+ }
ASSERT( bShapeSelected || aFrmOrObj.IsAccessible(GetShell()->IsPreView()),
"frame is not accessible" );
@@ -2681,7 +2685,7 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
SwFEShell* pFEShell = dynamic_cast<SwFEShell*>(pCrsrShell);
if ( !pFEShell ||
( !pFEShell->IsFrmSelected() &&
- pFEShell->IsObjSelected() == 0 ) )
+ !pFEShell->IsObjSelected() ) )
{
// get cursor without updating an existing table cursor.
pCrsr = pCrsrShell->GetCrsr( sal_False );
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 55718d5ab89f..6c4b5e1b3999 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -319,10 +319,9 @@ SwPaM* SwAccessibleParagraph::GetCursor( const bool _bForSelection )
( _bForSelection || !pCrsrShell->IsTableMode() ) )
// <--
{
- SwFEShell *pFESh = pCrsrShell->ISA( SwFEShell )
- ? static_cast< SwFEShell * >( pCrsrShell ) : 0;
+ SwFEShell *pFESh = dynamic_cast< SwFEShell * >( pCrsrShell );
if( !pFESh ||
- !(pFESh->IsFrmSelected() || pFESh->IsObjSelected() > 0) )
+ !(pFESh->IsFrmSelected() || pFESh->IsObjSelected() ) )
{
// get the selection, and test whether it affects our text node
pCrsr = pCrsrShell->GetCrsr( sal_False /* ??? */ );
@@ -846,7 +845,7 @@ lang::Locale SAL_CALL SwAccessibleParagraph::getLocale (void)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- SwTxtFrm *pTxtFrm = PTR_CAST( SwTxtFrm, GetFrm() );
+ const SwTxtFrm *pTxtFrm = dynamic_cast< const SwTxtFrm* >( GetFrm() );
if( !pTxtFrm )
{
THROW_RUNTIME_EXCEPTION( XAccessibleContext, "internal error (no text frame)" );
diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx
index 4cc4bcdca700..0a651f3b5d42 100644
--- a/sw/source/core/access/accselectionhelper.cxx
+++ b/sw/source/core/access/accselectionhelper.cxx
@@ -64,13 +64,7 @@ SwFEShell* SwAccessibleSelectionHelper::GetFEShell()
DBG_ASSERT( pViewShell != NULL,
"No view shell? Then what are you looking at?" );
- SwFEShell* pFEShell = NULL;
- if( pViewShell->ISA( SwFEShell ) )
- {
- pFEShell = static_cast<SwFEShell*>( pViewShell );
- }
-
- return pFEShell;
+ return dynamic_cast< SwFEShell* >( pViewShell );
}
void SwAccessibleSelectionHelper::throwIndexOutOfBoundsException()
@@ -208,7 +202,7 @@ sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
}
else
{
- sal_uInt16 nSelObjs = pFEShell->IsObjSelected();
+ const sal_uInt32 nSelObjs = pFEShell->GetNumberOfSelectedObjects();
if( nSelObjs > 0 )
{
::std::list< SwAccessibleChild > aChildren;
@@ -264,7 +258,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
}
else
{
- sal_uInt16 nSelObjs = pFEShell->IsObjSelected();
+ const sal_uInt32 nSelObjs = pFEShell->GetNumberOfSelectedObjects();
if( 0 == nSelObjs || nSelectedChildIndex >= nSelObjs )
throwIndexOutOfBoundsException();
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 06df3ae1739d..cb6c439d7903 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -32,8 +32,6 @@
static SwClientIter* pClientIters = 0;
-TYPEINIT0(SwClient);
-
/*************************************************************************/
SwClient::SwClient(SwModify *pToRegisterIn)
: pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ), mbIsAllowedToBeRemovedInModifyCall(false)
@@ -134,11 +132,11 @@ SwModify::~SwModify()
// if document gets destroyed anyway, just tell clients to forget me
// so that they don't try to get removed from my list later when they also get destroyed
SwClientIter aIter( *this );
- SwClient* p = aIter.GoStart();
+ SwClient* p = aIter.SwClientIter_First();
while ( p )
{
p->pRegisteredIn = 0;
- p = ++aIter;
+ p = aIter.SwClientIter_Next();
}
}
else
@@ -211,11 +209,11 @@ sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
if( pRoot )
{
SwClientIter aIter( *(SwModify*)this );
+ SwClient* pLast = aIter.SwClientIter_First();
- SwClient* pLast = aIter.GoStart();
if( pLast )
while( 0 != ( bRet = pLast->GetInfo( rInfo )) &&
- 0 != ( pLast = ++aIter ) )
+ 0 != ( pLast = aIter.SwClientIter_Next() ) )
;
}
@@ -233,7 +231,7 @@ void SwModify::Add(SwClient *pDepend)
SwClientIter* pTmp = pClientIters;
while( pTmp )
{
- ASSERT( &pTmp->GetModify() != pRoot, "Client added to active ClientIter" );
+ ASSERT( &pTmp->rRoot != pRoot, "Client added to active ClientIter" );
pTmp = pTmp->pNxtIter;
}
#endif
@@ -313,12 +311,12 @@ int SwModify::GetClientCount() const
{
int nRet=0;
SwClientIter aIter( *this );
- SwClient *pLast = aIter.GoStart();
+ SwClient *pLast = aIter.SwClientIter_First();
if( pLast )
do
{
++nRet;
- } while( 0 != ( pLast = ++aIter ));
+ } while( 0 != ( pLast = aIter.SwClientIter_Next() ));
return nRet;
}
@@ -355,22 +353,30 @@ void SwModify::CheckCaching( const sal_uInt16 nWhich )
void SwModify::CallSwClientNotify( const SfxHint& rHint ) const
{
SwClientIter aIter(*this);
- SwClient * pClient = aIter.GoStart();
+ SwClient * pClient = aIter.SwClientIter_First();
while (pClient)
{
pClient->SwClientNotify( *this, rHint );
- pClient = ++aIter;
+ pClient = aIter.SwClientIter_Next();
}
}
-void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType )
+void SwModify::ModifyBroadcast(
+ const SfxPoolItem *pOldValue,
+ const SfxPoolItem *pNewValue,
+ bool (*pIsValidSwClient)(const SwClient&))
{
SwClientIter aIter(*this);
- SwClient * pClient = aIter.First( nType );
+ SwClient* pClient = aIter.SwClientIter_First();
+
while (pClient)
{
- pClient->Modify( pOldValue, pNewValue );
- pClient = aIter.Next();
+ if(!pIsValidSwClient || pIsValidSwClient(*pClient))
+ {
+ pClient->Modify( pOldValue, pNewValue );
+ }
+
+ pClient = aIter.SwClientIter_Next();
}
}
@@ -428,8 +434,6 @@ SwClientIter::SwClientIter( const SwModify& rModify )
pDelNext = pAct;
}
-
-
SwClientIter::~SwClientIter()
{
if( pClientIters )
@@ -451,20 +455,7 @@ SwClientIter::~SwClientIter()
}
}
-
-SwClient* SwClientIter::operator++()
-{
- if( pDelNext == pAct )
- {
- pAct = pAct->pRight;
- pDelNext = pAct;
- }
- else
- pAct = pDelNext;
- return pAct;
-}
-
-SwClient* SwClientIter::GoStart()
+SwClient* SwClientIter::SwClientIter_First()
{
pAct = const_cast<SwClient*>(rRoot.GetDepends());
if( pAct )
@@ -474,87 +465,17 @@ SwClient* SwClientIter::GoStart()
return pAct;
}
-SwClient* SwClientIter::GoEnd()
+SwClient* SwClientIter::SwClientIter_Next()
{
- pAct = pDelNext;
- if( !pAct )
- pAct = const_cast<SwClient*>(rRoot.GetDepends());
- if( pAct )
- while( pAct->pRight )
- pAct = pAct->pRight;
- pDelNext = pAct;
- return pAct;
-}
-
-SwClient* SwClientIter::First( TypeId nType )
-{
- aSrchId = nType;
- GoStart();
- if( pAct )
- do {
- if( pAct->IsA( aSrchId ) )
- break;
-
- if( pDelNext == pAct )
- {
- pAct = pAct->pRight;
- pDelNext = pAct;
- }
- else
- pAct = pDelNext;
-
- } while( pAct );
- return pAct;
-}
-
-SwClient* SwClientIter::Next()
-{
- do {
- if( pDelNext == pAct )
- {
- pAct = pAct->pRight;
- pDelNext = pAct;
- }
- else
- pAct = pDelNext;
-
- if( pAct && pAct->IsA( aSrchId ) )
- break;
- } while( pAct );
- return pAct;
-}
-
-SwClient* SwClientIter::Last( TypeId nType )
-{
- aSrchId = nType;
- GoEnd();
- if( pAct )
- do {
- if( pAct->IsA( aSrchId ) )
- break;
-
- if( pDelNext == pAct )
- pAct = pAct->pLeft;
- else
- pAct = pDelNext->pLeft;
- pDelNext = pAct;
-
- } while( pAct );
- return pAct;
-}
-
-SwClient* SwClientIter::Previous()
-{
- do {
- if( pDelNext == pAct )
- pAct = pAct->pLeft;
- else
- pAct = pDelNext->pLeft;
+ if( pDelNext == pAct )
+ {
+ pAct = pAct->pRight;
pDelNext = pAct;
+ }
+ else
+ pAct = pDelNext;
- if( pAct && pAct->IsA( aSrchId ) )
- break;
- } while( pAct );
return pAct;
}
+// eof
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index 45b954f8b4cb..958954331282 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -37,9 +37,6 @@
#include <rolbck.hxx>
#include <switerator.hxx>
-
-//TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
-
/*************************************************************************
|*
*************************************************************************/
diff --git a/sw/source/core/attr/fmtfollowtextflow.cxx b/sw/source/core/attr/fmtfollowtextflow.cxx
index 98555f1bbca5..06c8973069cc 100644
--- a/sw/source/core/attr/fmtfollowtextflow.cxx
+++ b/sw/source/core/attr/fmtfollowtextflow.cxx
@@ -25,8 +25,6 @@
#include "precompiled_sw.hxx"
#include <fmtfollowtextflow.hxx>
-TYPEINIT1(SwFmtFollowTextFlow, SfxBoolItem);
-
SfxPoolItem* SwFmtFollowTextFlow::Clone( SfxItemPool * ) const
{
return new SwFmtFollowTextFlow(*this);
diff --git a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
index 0a45a33e50fa..83a4e7dbd581 100644
--- a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
+++ b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
@@ -32,8 +32,6 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-TYPEINIT1(SwFmtWrapInfluenceOnObjPos, SfxPoolItem);
-
SwFmtWrapInfluenceOnObjPos::SwFmtWrapInfluenceOnObjPos(
sal_Int16 _nWrapInfluenceOnPosition )
: SfxPoolItem( RES_WRAP_INFLUENCE_ON_OBJPOS ),
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index eee33d497d5b..56eb9f0522df 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -34,8 +34,6 @@
#include <swcache.hxx>
#include <fmtcolfunc.hxx>
-TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
-
/*************************************************************************
|* SwFmt::SwFmt
*************************************************************************/
@@ -278,6 +276,10 @@ SwFmt::~SwFmt()
|* Letzte Aenderung JP 05.08.94
*************************************************************************/
+namespace
+{
+ bool ImpCheck(const SwClient& rClient) { return 0 != dynamic_cast< const SwFmt* >(&rClient); }
+}
void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
@@ -352,7 +354,7 @@ void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
// mba: here we don't use the additional stuff from NotifyClients().
// should we?!
// mba: move the code that ignores this event to the clients
- ModifyBroadcast( pOldValue, pNewValue, TYPE(SwFmt) );
+ ModifyBroadcast( pOldValue, pNewValue, &ImpCheck);
bWeiter = sal_False;
}
break;
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 8b122060ecd9..8feaede3ac4b 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -86,7 +86,7 @@ SwAttrSet::SwAttrSet( const SwAttrSet& rSet )
{
}
-SfxItemSet* SwAttrSet::Clone( sal_Bool bItems, SfxItemPool *pToPool ) const
+SfxItemSet* SwAttrSet::Clone( bool bItems, SfxItemPool *pToPool ) const
{
if ( pToPool && pToPool != GetPool() )
{
@@ -238,8 +238,8 @@ bool SwAttrSet::SetModifyAtAttr( const SwModify* pModify )
void SwAttrSet::CopyToModify( SwModify& rMod ) const
{
// kopiere die Attribute ggfs. ueber Dokumentgrenzen
- SwCntntNode* pCNd = PTR_CAST( SwCntntNode, &rMod );
- SwFmt* pFmt = PTR_CAST( SwFmt, &rMod );
+ SwCntntNode* pCNd = dynamic_cast< SwCntntNode* >( &rMod );
+ SwFmt* pFmt = dynamic_cast< SwFmt* >( &rMod );
if( pCNd || pFmt )
{
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index 12437c51824d..e8335c394b1a 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -37,9 +37,6 @@ int SwIndex::nSerial = 0;
#endif
-TYPEINIT0(SwIndexReg); // rtti
-
-
#ifdef CHK
#define IDX_CHK_ARRAY pArray->ChhkArr();
diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx
index f0be0825f8b5..75d760b81e83 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -24,7 +24,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <IDocumentMarkAccess.hxx>
#include <crossrefbookmark.hxx>
#include <ndtxt.hxx>
@@ -39,9 +38,12 @@ namespace sw { namespace mark
const OUString& rPrefix)
: Bookmark(rPaM, rCode, rName, rShortName)
{
- OSL_ENSURE( IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( rPaM ),
- "<CrossRefBookmark::CrossRefBookmark(..)>"
- "- creation of cross-reference bookmark with an illegal PaM that does not expand over exactly one whole paragraph.");
+ if(rPaM.HasMark())
+ OSL_ENSURE((rPaM.GetMark()->nNode == rPaM.GetPoint()->nNode &&
+ rPaM.Start()->nContent.GetIndex() == 0 &&
+ rPaM.End()->nContent.GetIndex() == rPaM.GetPoint()->nNode.GetNode().GetTxtNode()->Len()),
+ "<CrossRefBookmark::CrossRefBookmark(..)>"
+ "- creation of cross-reference bookmark with an expanded PaM that does not expand over exactly one whole paragraph.");
SetMarkPos(*rPaM.Start());
if(!rName.getLength())
m_aName = MarkBase::GenerateNewName(rPrefix);
@@ -70,12 +72,14 @@ namespace sw { namespace mark
const KeyCode& rCode,
const OUString& rName,
const OUString& rShortName)
- : CrossRefBookmark(rPaM, rCode, rName, rShortName, IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix())
+ : CrossRefBookmark(rPaM, rCode, rName, rShortName, our_sNamePrefix)
{ }
+ const ::rtl::OUString CrossRefHeadingBookmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__RefHeading__");
+
bool CrossRefHeadingBookmark::IsLegalName(const ::rtl::OUString& rName)
{
- return rName.match(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix());
+ return rName.match(our_sNamePrefix);
}
CrossRefNumItemBookmark::CrossRefNumItemBookmark(const SwPaM& rPaM,
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 75c3d21be903..872d6569c819 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -71,9 +71,6 @@
using namespace com::sun::star;
using namespace util;
-TYPEINIT2(SwCrsrShell,ViewShell,SwModify);
-
-
// Funktion loescht, alle ueberlappenden Cursor aus einem Cursor-Ring
void CheckRange( SwCursor* );
@@ -1549,8 +1546,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
( !pDoc->GetDocShell() ||
!pDoc->GetDocShell()->IsReadOnly() || bAllProtect )) ) )
{
- if( !FindValidCntntNode( !HasDrawView() ||
- 0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()))
+ if( !FindValidCntntNode( !HasDrawView() || !Imp()->GetDrawView()->areSdrObjectsSelected()))
{
// alles ist geschuetzt / versteckt -> besonderer Mode
if( bAllProtect && !IsReadOnlyAvailable() &&
@@ -1648,14 +1644,13 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
// im geschuetzten Fly? aber bei Rahmenselektion ignorieren
if( !IsReadOnlyAvailable() && pFrm->IsProtected() &&
( !Imp()->GetDrawView() ||
- !Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ) &&
+ !Imp()->GetDrawView()->areSdrObjectsSelected() ) &&
(!pDoc->GetDocShell() ||
!pDoc->GetDocShell()->IsReadOnly() || bAllProtect ) )
{
// dann suche eine gueltige Position
sal_Bool bChgState = sal_True;
- if( !FindValidCntntNode(!HasDrawView() ||
- 0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()))
+ if( !FindValidCntntNode(!HasDrawView() || !Imp()->GetDrawView()->areSdrObjectsSelected()))
{
// alles ist geschuetzt / versteckt -> besonderer Mode
if( bAllProtect )
@@ -2545,9 +2540,9 @@ void SwCrsrShell::ParkCrsr( const SwNodeIndex &rIdx )
//Alle Shells wollen etwas davon haben.
ViewShell *pTmp = this;
do {
- if( pTmp->IsA( TYPE( SwCrsrShell )))
+ SwCrsrShell* pSh = dynamic_cast< SwCrsrShell* >(pTmp);
+ if( pSh )
{
- SwCrsrShell* pSh = (SwCrsrShell*)pTmp;
if( pSh->pCrsrStk )
pSh->_ParkPams( pNew, &pSh->pCrsrStk );
@@ -2704,7 +2699,7 @@ sal_Bool SwCrsrShell::ShouldWait() const
if ( IsTableMode() || GetCrsrCnt() > 1 )
return sal_True;
- if( HasDrawView() && GetDrawView()->GetMarkedObjectList().GetMarkCount() )
+ if( HasDrawView() && GetDrawView()->areSdrObjectsSelected() )
return sal_True;
SwPaM* pPam = GetCrsr();
@@ -2961,7 +2956,7 @@ sal_Bool SwCrsrShell::IsCrsrReadonly() const
(pFly = pFrm->FindFlyFrm())->GetFmt()->GetEditInReadonly().GetValue() &&
pFly->Lower() &&
!pFly->Lower()->IsNoTxtFrm() &&
- !GetDrawView()->GetMarkedObjectList().GetMarkCount() )
+ !GetDrawView()->areSdrObjectsSelected() )
{
return sal_False;
}
@@ -2985,7 +2980,7 @@ void SwCrsrShell::SetReadOnlyAvailable( sal_Bool bFlag )
{
// im GlobalDoc darf NIE umgeschaltet werden
if( (!GetDoc()->GetDocShell() ||
- !GetDoc()->GetDocShell()->IsA( SwGlobalDocShell::StaticType() )) &&
+ !dynamic_cast< SwGlobalDocShell* >(GetDoc()->GetDocShell())) &&
bFlag != bSetCrsrInReadOnly )
{
// wenn das Flag ausgeschaltet wird, dann muessen erstmal alle
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 18f534dc83f7..ecc5307b417c 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -68,6 +68,7 @@
#include <fmturl.hxx>
#include "txtfrm.hxx"
#include <wrong.hxx>
+#include <svx/svdlegacy.hxx>
#include <switerator.hxx>
#include <vcl/window.hxx>
#include <docufld.hxx> // OD 2008-06-19 #i90516#
@@ -415,8 +416,8 @@ sal_Bool SwCrsrShell::GotoTOXMarkBase()
for( SwTOXBase* pTOX = aIter.First(); pTOX; pTOX = aIter.Next() )
{
- if( pTOX->ISA( SwTOXBaseSection ) &&
- 0 != ( pSectFmt = ((SwTOXBaseSection*)pTOX)->GetFmt() ) &&
+ if( dynamic_cast< SwTOXBaseSection* >(pTOX) &&
+ 0 != ( pSectFmt = static_cast< SwTOXBaseSection* >(pTOX)->GetFmt() ) &&
0 != ( pSectNd = pSectFmt->GetSectionNode() ))
{
SwNodeIndex aIdx( *pSectNd, 1 );
@@ -1616,6 +1617,7 @@ bool SwContentAtPos::IsInRTLText()const
bRet = pTmpFrm->IsRightToLeft();
break;
}
+
pTmpFrm = aIter.Next();
}
}
@@ -2188,7 +2190,7 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
else if( RES_DRAWFRMFMT == pFndFmt->Which() )
{
const SdrObject* pSObj = pFndFmt->FindSdrObject();
- ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
+ ((SwFEShell*)this)->SelectObj(pSObj->getObjectRange(0).getCenter() );
MakeSelVisible();
bRet = sal_True;
}
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 3fbea69f9af5..055ec1fcce71 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -914,9 +914,9 @@ sal_Bool SwCrsrShell::EndAllTblBoxEdit()
sal_Bool bRet = sal_False;
ViewShell *pSh = this;
do {
- if( pSh->IsA( TYPE( SwCrsrShell ) ) )
- bRet |= ((SwCrsrShell*)pSh)->CheckTblBoxCntnt(
- ((SwCrsrShell*)pSh)->pCurCrsr->GetPoint() );
+ SwCrsrShell* pSwCrsrShell = dynamic_cast< SwCrsrShell* >(pSh);
+ if( pSwCrsrShell )
+ bRet |= pSwCrsrShell->CheckTblBoxCntnt(pSwCrsrShell->pCurCrsr->GetPoint() );
} while( this != (pSh = (ViewShell *)pSh->GetNext()) );
return bRet;
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 25d00238ec55..8e03a8385e30 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -360,7 +360,7 @@ void SwVisCrsr::Show()
}
}
#else
- _SetPosAndShow();
+ _SetPosAndShow();
#endif
}
}
@@ -863,7 +863,7 @@ sal_Bool SwShellCrsr::IsAtValidPos( sal_Bool bPoint ) const
if( GetShell() && ( GetShell()->IsAllProtect() ||
GetShell()->GetViewOptions()->IsReadonly() ||
( GetShell()->Imp()->GetDrawView() &&
- GetShell()->Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )))
+ GetShell()->Imp()->GetDrawView()->areSdrObjectsSelected() )))
return sal_True;
return SwCursor::IsAtValidPos( bPoint );
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 35c8891dc736..019f74688fe5 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -134,6 +134,7 @@
// --> OD 2005-08-29 #125370#
#include <layouter.hxx>
// <--
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -504,7 +505,7 @@ void SwDoc::setPrinter(/*[in]*/ SfxPrinter *pP,/*[in]*/ bool bDeleteOld,/*[in]*/
}
if ( pDrawModel && !get( IDocumentSettingAccess::USE_VIRTUAL_DEVICE ) )
- pDrawModel->SetRefDevice( pPrt );
+ pDrawModel->SetReferenceDevice( pPrt );
}
if ( bCallPrtDataChanged &&
@@ -535,7 +536,7 @@ void SwDoc::setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOl
pVirDev = pVd;
if ( pDrawModel && get( IDocumentSettingAccess::USE_VIRTUAL_DEVICE ) )
- pDrawModel->SetRefDevice( pVirDev );
+ pDrawModel->SetReferenceDevice( pVirDev );
}
}
@@ -573,7 +574,7 @@ void SwDoc::setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewH
pMyVirDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
if( pDrawModel )
- pDrawModel->SetRefDevice( pMyVirDev );
+ pDrawModel->SetReferenceDevice( pMyVirDev );
}
else
{
@@ -586,7 +587,7 @@ void SwDoc::setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewH
SfxPrinter* pPrinter = getPrinter( true );
// <--
if( pDrawModel )
- pDrawModel->SetRefDevice( pPrinter );
+ pDrawModel->SetReferenceDevice( pPrinter );
}
set(IDocumentSettingAccess::USE_VIRTUAL_DEVICE, bNewVirtual );
@@ -2367,11 +2368,21 @@ bool SwDoc::RemoveInvisibleContent()
-----------------------------------------------------------------------*/
bool SwDoc::HasInvisibleContent() const
{
- sal_Bool bRet = sal_False;
-
+ bool bRet(false);
SwClientIter aIter( *GetSysFldType( RES_HIDDENPARAFLD ) );
- if( aIter.First( TYPE( SwFmtFld ) ) )
- bRet = sal_True;
+ SwClient* t = aIter.SwClientIter_First();
+ SwFmtFld* pSwFmtFld = dynamic_cast< SwFmtFld* >(t);
+
+ while(!pSwFmtFld && t)
+ {
+ t = aIter.SwClientIter_Next();
+ pSwFmtFld = dynamic_cast< SwFmtFld* >(t);
+ }
+
+ if(pSwFmtFld)
+ {
+ bRet = true;
+ }
//
// Search for any hidden paragraph (hidden text attribute)
@@ -2386,7 +2397,7 @@ bool SwDoc::HasInvisibleContent() const
SwPaM aPam( *pTxtNd, 0, *pTxtNd, pTxtNd->GetTxt().Len() );
if( pTxtNd->HasHiddenCharAttribute( true ) || ( pTxtNd->HasHiddenCharAttribute( false ) ) )
{
- bRet = sal_True;
+ bRet = true;
}
}
}
@@ -2405,9 +2416,10 @@ bool SwDoc::HasInvisibleContent() const
continue;
SwSection* pSect = pSectFmt->GetSection();
if( pSect->IsHidden() )
- bRet = sal_True;
+ bRet = true;
}
}
+
return bRet;
}
@@ -2544,7 +2556,7 @@ bool SwDoc::LinksUpdated() const
if( pLnk &&
( OBJECT_CLIENT_GRF == pLnk->GetObjType() ||
OBJECT_CLIENT_FILE == pLnk->GetObjType() ) &&
- pLnk->ISA( SwBaseLink ) )
+ dynamic_cast< SwBaseLink* >(pLnk) )
{
::sfx2::SvBaseLinkRef xLink = pLnk;
@@ -2645,10 +2657,12 @@ void SwDoc::ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew)
rTOX = rNew;
- if (rTOX.ISA(SwTOXBaseSection))
+ SwTOXBaseSection* pSwTOXBaseSection = dynamic_cast< SwTOXBaseSection* >(&rTOX);
+
+ if (pSwTOXBaseSection)
{
- static_cast<SwTOXBaseSection &>(rTOX).Update();
- static_cast<SwTOXBaseSection &>(rTOX).UpdatePageNum();
+ pSwTOXBaseSection->Update();
+ pSwTOXBaseSection->UpdatePageNum();
}
}
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 5f70b4ccae99..79cfac307a25 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -268,23 +268,23 @@ namespace
IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const IMark& rBkmk)
{
- const std::type_info* const pMarkTypeInfo = &typeid(rBkmk);
+ const std::type_info& rMarkTypeInfo = typeid(rBkmk);
// not using dynamic_cast<> here for performance
- if(*pMarkTypeInfo == typeid(UnoMark))
+ if(rMarkTypeInfo == typeid(UnoMark))
return UNO_BOOKMARK;
- else if(*pMarkTypeInfo == typeid(DdeBookmark))
+ else if(rMarkTypeInfo == typeid(DdeBookmark))
return DDE_BOOKMARK;
- else if(*pMarkTypeInfo == typeid(Bookmark))
+ else if(rMarkTypeInfo == typeid(Bookmark))
return BOOKMARK;
- else if(*pMarkTypeInfo == typeid(CrossRefHeadingBookmark))
+ else if(rMarkTypeInfo == typeid(CrossRefHeadingBookmark))
return CROSSREF_HEADING_BOOKMARK;
- else if(*pMarkTypeInfo == typeid(CrossRefNumItemBookmark))
+ else if(rMarkTypeInfo == typeid(CrossRefNumItemBookmark))
return CROSSREF_NUMITEM_BOOKMARK;
- else if(*pMarkTypeInfo == typeid(TextFieldmark))
+ else if(rMarkTypeInfo == typeid(TextFieldmark))
return TEXT_FIELDMARK;
- else if(*pMarkTypeInfo == typeid(CheckboxFieldmark))
+ else if(rMarkTypeInfo == typeid(CheckboxFieldmark))
return CHECKBOX_FIELDMARK;
- else if(*pMarkTypeInfo == typeid(NavigatorReminder))
+ else if(rMarkTypeInfo == typeid(NavigatorReminder))
return NAVIGATOR_REMINDER;
else
{
@@ -295,26 +295,6 @@ IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const IMark& rBkmk)
}
}
-const ::rtl::OUString& IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()
-{
- static const ::rtl::OUString CrossRefHeadingBookmarkNamePrefix = ::rtl::OUString::createFromAscii("__RefHeading__");
-
- return CrossRefHeadingBookmarkNamePrefix;
-}
-
-const bool SAL_DLLPUBLIC_EXPORT IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( const SwPaM& rPaM )
-{
- bool bRet( false );
-
- bRet = rPaM.Start()->nNode.GetNode().IsTxtNode() &&
- rPaM.Start()->nContent.GetIndex() == 0 &&
- ( !rPaM.HasMark() ||
- ( rPaM.GetMark()->nNode == rPaM.GetPoint()->nNode &&
- rPaM.End()->nContent.GetIndex() == rPaM.End()->nNode.GetNode().GetTxtNode()->Len() ) );
-
- return bRet;
-}
-
namespace sw { namespace mark
{
MarkManager::MarkManager(SwDoc& rDoc)
@@ -870,7 +850,8 @@ namespace sw { namespace mark
{\
ViewShell *_pStartShell = pEShell; \
do { \
- if( _pStartShell->IsA( TYPE( SwCrsrShell )) ) \
+ SwCrsrShell* pSwCrsrShell = dynamic_cast< SwCrsrShell* >(_pStartShell); \
+ if( pSwCrsrShell ) \
{
#define FOREACHSHELL_END( pEShell ) \
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 730134638922..7315edcf5508 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -47,7 +47,8 @@
{\
ViewShell *_pStartShell = pEShell; \
do { \
- if( _pStartShell->IsA( TYPE( SwCrsrShell )) ) \
+ SwCrsrShell* pSwCrsrShell = dynamic_cast< SwCrsrShell* >(_pStartShell); \
+ if( pSwCrsrShell ) \
{
#define FOREACHSHELL_END( pEShell ) \
@@ -348,8 +349,9 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
// wir suchen uns eine EditShell, falls diese existiert
do {
- if( pSh->IsA( TYPE( SwEditShell ) ) )
- return (SwEditShell*)pSh;
+ SwEditShell* pSwEditShell = dynamic_cast< SwEditShell* >(pSh);
+ if( pSwEditShell )
+ return pSwEditShell;
} while( pVSh != ( pSh = (ViewShell*)pSh->GetNext() ));
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index d2b60c080029..b72184208da0 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -71,6 +71,7 @@
#include <SwUndoPageDesc.hxx>
#include <pagedeschint.hxx>
#include <tgrditem.hxx>
+#include <svx/fmmodel.hxx>
using namespace com::sun::star;
@@ -191,6 +192,10 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() );
}
+namespace
+{
+ bool ImpCheck(const SwClient& rClient) { return 0 != dynamic_cast< const SwFrm* >(&rClient); }
+}
void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
{
@@ -410,11 +415,13 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
{
pDesc->SetFtnInfo( rChged.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
+
{
- pDesc->GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
+ pDesc->GetMaster().ModifyBroadcast( &aInfo, 0, &ImpCheck );
}
+
{
- pDesc->GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
+ pDesc->GetLeft().ModifyBroadcast( &aInfo, 0, &ImpCheck );
}
}
SetModified();
@@ -640,7 +647,7 @@ void SwDoc::PrtDataChanged()
if( pDrawModel )
{
pDrawModel->SetAddExtLeading( get(IDocumentSettingAccess::ADD_EXT_LEADING) );
- pDrawModel->SetRefDevice( getReferenceDevice( false ) );
+ pDrawModel->SetReferenceDevice( getReferenceDevice( false ) );
}
pFntCache->Flush();
@@ -662,13 +669,13 @@ void SwDoc::PrtDataChanged()
} //swmod 080218
if ( bDraw && pDrawModel )
{
- const sal_Bool bTmpAddExtLeading = get(IDocumentSettingAccess::ADD_EXT_LEADING);
+ const bool bTmpAddExtLeading = get(IDocumentSettingAccess::ADD_EXT_LEADING);
if ( bTmpAddExtLeading != pDrawModel->IsAddExtLeading() )
pDrawModel->SetAddExtLeading( bTmpAddExtLeading );
OutputDevice* pOutDev = getReferenceDevice( false );
- if ( pOutDev != pDrawModel->GetRefDevice() )
- pDrawModel->SetRefDevice( pOutDev );
+ if ( pOutDev != pDrawModel->GetReferenceDevice() )
+ pDrawModel->SetReferenceDevice( pOutDev );
}
PrtOLENotify( sal_True );
@@ -691,15 +698,14 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
if ( GetCurrentViewShell() )
{
ViewShell *pSh = GetCurrentViewShell();
- if ( !pSh->ISA(SwFEShell) )
+ if ( !dynamic_cast< SwFEShell* >(pSh) )
do
{ pSh = (ViewShell*)pSh->GetNext();
- } while ( !pSh->ISA(SwFEShell) &&
+ } while ( !dynamic_cast< SwFEShell* >(pSh) &&
pSh != GetCurrentViewShell() );
- if ( pSh->ISA(SwFEShell) )
- pShell = (SwFEShell*)pSh;
- } //swmod 071107//swmod 071225
+ pShell = dynamic_cast< SwFEShell* >(pSh);
+ }
if ( !pShell )
{
//Das hat ohne Shell und damit ohne Client keinen Sinn, weil nur darueber
@@ -717,8 +723,8 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
bAll = sal_True;
mbOLEPrtNotifyPending = mbAllOLENotify = sal_False;
-
SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), !bAll );
+
if ( pNodes )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
@@ -791,8 +797,8 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
if( pSh )
{
mbOLEPrtNotifyPending = mbAllOLENotify = sal_False;
-
SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), true );
+
if( pNodes )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index b72b2b206adb..890d2a3b4130 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -69,6 +69,7 @@
#include <fmtornt.hxx>
#include <svx/svditer.hxx>
#include <vector>
+#include <svx/svdlegacy.hxx>
#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -92,7 +93,7 @@ SV_IMPL_VARARR_SORT( _ZSortFlys, _ZSortFly )
void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
const SdrObject& _rSdrObj )
{
- const SwContact* pContact = GetUserCall( &_rSdrObj );
+ const SwContact* pContact = findConnectionToSdrObject( &_rSdrObj );
ASSERT( pContact, "<lcl_AdjustPositioningAttr(..)> - missing contact object." );
// determine position of new group object relative to its anchor frame position
@@ -120,7 +121,7 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
else
{
// --> OD 2005-05-10 #i45952#
- aAnchorPos = _rSdrObj.GetAnchorPos();
+ aAnchorPos = sdr::legacy::GetAnchorPos(_rSdrObj);
// <--
// If no anchor frame exist - e.g. because no layout exists - the
// default layout direction is taken.
@@ -163,7 +164,7 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
}
// use geometry of drawing object
- const SwRect aObjRect = _rSdrObj.GetSnapRect();
+ const SwRect aObjRect(sdr::legacy::GetSnapRect(_rSdrObj));
if ( bVert )
{
@@ -200,13 +201,12 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
// to adjust the positioning attributes - see <SwDrawContact::_Changed(..)>.
{
const SwAnchoredObject* pAnchoredObj = pContact->GetAnchoredObj( &_rSdrObj );
- if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
+ const SwAnchoredDrawObject* pAnchoredDrawObj = dynamic_cast< const SwAnchoredDrawObject* >(pAnchoredObj);
+
+ if ( pAnchoredDrawObj )
{
- const SwAnchoredDrawObject* pAnchoredDrawObj =
- static_cast<const SwAnchoredDrawObject*>(pAnchoredObj);
- const SwRect aObjRect = _rSdrObj.GetSnapRect();
- const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
- ->SetLastObjRect( aObjRect.SVRect() );
+ const Rectangle aObjRect(sdr::legacy::GetSnapRect(_rSdrObj));
+ const_cast< SwAnchoredDrawObject* >(pAnchoredDrawObj)->SetLastObjRect(aObjRect);
}
}
// <--
@@ -214,109 +214,111 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
{
- // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
- // the corresponding 'master' drawing objects.
- SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
-
- const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
- SwDrawFrmFmt *pFmt = 0L;
- SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- sal_Bool bNoGroup = ( 0 == pObj->GetUpGroup() );
SwDrawContact* pNewContact = 0;
- if( bNoGroup )
- {
- //Ankerattribut aufheben.
- SwDrawContact *pMyContact = (SwDrawContact*)GetUserCall(pObj);
- const SwFmtAnchor aAnch( pMyContact->GetFmt()->GetAnchor() );
- SwUndoDrawGroup *const pUndo = (!GetIDocumentUndoRedo().DoesUndo())
- ? 0
- : new SwUndoDrawGroup( (sal_uInt16)rMrkList.GetMarkCount() );
-
- // --> OD 2005-08-16 #i53320#
- bool bGroupMembersNotPositioned( false );
- {
- SwAnchoredDrawObject* pAnchoredDrawObj =
- static_cast<SwAnchoredDrawObject*>(pMyContact->GetAnchoredObj( pObj ));
- bGroupMembersNotPositioned = pAnchoredDrawObj->NotYetPositioned();
- }
- // <--
- //ContactObjekte und Formate vernichten.
- for( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ if(rDrawView.areSdrObjectsSelected())
+ {
+ // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
+ // the corresponding 'master' drawing objects.
+ SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
+
+ const SdrObjectVector aSelection(rDrawView.getSelectedSdrObjectVectorFromSdrMarkView());
+ SwDrawFrmFmt *pFmt = 0L;
+ SdrObject *pObj = aSelection[0];
+ sal_Bool bNoGroup = ( 0 == pObj->GetParentSdrObject() );
+ if( bNoGroup )
{
- pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ //Ankerattribut aufheben.
+ SwDrawContact *pMyContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
+ const SwFmtAnchor aAnch( pMyContact->GetFmt()->GetAnchor() );
+
+ SwUndoDrawGroup *const pUndo = (!GetIDocumentUndoRedo().DoesUndo())
+ ? 0
+ : new SwUndoDrawGroup( (sal_uInt16)aSelection.size() );
// --> OD 2005-08-16 #i53320#
+ bool bGroupMembersNotPositioned( false );
+ {
+ SwAnchoredDrawObject* pAnchoredDrawObj =
+ static_cast<SwAnchoredDrawObject*>(pMyContact->GetAnchoredObj( pObj ));
+ bGroupMembersNotPositioned = pAnchoredDrawObj->NotYetPositioned();
+ }
+ // <--
+ //ContactObjekte und Formate vernichten.
+ for( sal_uInt32 i(0); i < aSelection.size(); ++i )
+ {
+ pObj = aSelection[i];
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
+
+ // --> OD 2005-08-16 #i53320#
#ifdef DBG_UTIL
- SwAnchoredDrawObject* pAnchoredDrawObj =
- static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( pObj ));
- ASSERT( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(),
- "<SwDoc::GroupSelection(..)> - group members have different positioning status!" );
+ SwAnchoredDrawObject* pAnchoredDrawObj =
+ static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( pObj ));
+ ASSERT( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(),
+ "<SwDoc::GroupSelection(..)> - group members have different positioning status!" );
#endif
- // <--
+ // <--
- pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
- //loescht sich selbst!
- pContact->Changed(*pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
- pObj->SetUserCall( 0 );
+ pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
+ //loescht sich selbst!
+ pContact->HandleChanged(*pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObj);
- if( pUndo )
- pUndo->AddObj( i, pFmt, pObj );
- else
- DelFrmFmt( pFmt );
-
- // --> OD 2005-05-10 #i45952# - re-introduce position
- // normalization of group member objects, because its anchor position
- // is cleared, when they are grouped.
- Point aAnchorPos( pObj->GetAnchorPos() );
- pObj->NbcSetAnchorPos( Point( 0, 0 ) );
- pObj->NbcMove( Size( aAnchorPos.X(), aAnchorPos.Y() ) );
- // <--
- }
+ if( pUndo )
+ pUndo->AddObj( i, pFmt, pObj );
+ else
+ DelFrmFmt( pFmt );
+
+ // --> OD 2005-05-10 #i45952# - re-introduce position
+ // normalization of group member objects, because its anchor position
+ // is cleared, when they are grouped.
+ // AW: NbcMove no longer needed, just reset anchor
+ pObj->SetAnchorPos( basegfx::B2DPoint() );
+ }
- pFmt = MakeDrawFrmFmt( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "DrawObject" )),
- GetDfltFrmFmt() );
- pFmt->SetFmtAttr( aAnch );
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
- pFmt->SetPositionLayoutDir(
- text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
+ pFmt = MakeDrawFrmFmt( String::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM( "DrawObject" )),
+ GetDfltFrmFmt() );
+ pFmt->SetFmtAttr( aAnch );
+ // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ pFmt->SetPositionLayoutDir(
+ text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
+ // <--
- rDrawView.GroupMarked();
- ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
+ rDrawView.GroupMarked();
+ SdrObject* pNewGroupObj = rDrawView.getSelectedIfSingle();
+ ASSERT( pNewGroupObj, "GroupMarked more or none groups." );
- SdrObject* pNewGroupObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- pNewContact = new SwDrawContact( pFmt, pNewGroupObj );
- // --> OD 2004-11-22 #i35635#
- pNewContact->MoveObjToVisibleLayer( pNewGroupObj );
- // <--
- pNewContact->ConnectToLayout();
- // --> OD 2005-08-16 #i53320# - No adjustment of the positioning and
- // alignment attributes, if group members aren't positioned yet.
- if ( !bGroupMembersNotPositioned )
- {
- // OD 2004-04-01 #i26791# - Adjust positioning and alignment attributes.
- lcl_AdjustPositioningAttr( pFmt, *pNewGroupObj );
- }
- // <--
+ pNewContact = new SwDrawContact( pFmt, pNewGroupObj );
+ // --> OD 2004-11-22 #i35635#
+ pNewContact->MoveObjToVisibleLayer( pNewGroupObj );
+ // <--
+ pNewContact->ConnectToLayout();
+ // --> OD 2005-08-16 #i53320# - No adjustment of the positioning and
+ // alignment attributes, if group members aren't positioned yet.
+ if ( !bGroupMembersNotPositioned )
+ {
+ // OD 2004-04-01 #i26791# - Adjust positioning and alignment attributes.
+ lcl_AdjustPositioningAttr( pFmt, *pNewGroupObj );
+ }
+ // <--
- if( pUndo )
- {
- pUndo->SetGroupFmt( pFmt );
- GetIDocumentUndoRedo().AppendUndo( pUndo );
+ if( pUndo )
+ {
+ pUndo->SetGroupFmt( pFmt );
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
}
- }
- else
- {
- if (GetIDocumentUndoRedo().DoesUndo())
+ else
{
- GetIDocumentUndoRedo().ClearRedo();
- }
+ if (GetIDocumentUndoRedo().DoesUndo())
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ }
- rDrawView.GroupMarked();
- ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
+ rDrawView.GroupMarked();
+ ASSERT( rDrawView.getSelectedIfSingle(), "GroupMarked more or none groups." );
+ }
}
return pNewContact;
@@ -325,111 +327,113 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
void SwDoc::UnGroupSelection( SdrView& rDrawView )
{
- bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
- if( bUndo )
+ if(rDrawView.areSdrObjectsSelected())
{
- GetIDocumentUndoRedo().ClearRedo();
- }
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
+ if( bUndo )
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ }
- // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
- // the corresponding 'master' drawing objects.
- SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
+ // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
+ // the corresponding 'master' drawing objects.
+ SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
- const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
- // --> OD 2006-11-01 #130889#
- std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >* pFmtsAndObjs( 0L );
- const sal_uInt32 nMarkCount( rMrkList.GetMarkCount() );
- // <--
- if ( nMarkCount )
- {
+ const SdrObjectVector aSelection(rDrawView.getSelectedSdrObjectVectorFromSdrMarkView());
// --> OD 2006-11-01 #130889#
- pFmtsAndObjs = new std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >[nMarkCount];
+ std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >* pFmtsAndObjs( 0L );
// <--
- SdrObject *pMyObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- if( !pMyObj->GetUpGroup() )
+ if ( aSelection.size() )
{
- String sDrwFmtNm( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM("DrawObject" )));
- for ( sal_uInt16 i = 0; i < nMarkCount; ++i )
+ // --> OD 2006-11-01 #130889#
+ pFmtsAndObjs = new std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >[aSelection.size()];
+ // <--
+ SdrObject *pMyObj = aSelection[0];
+ if( !pMyObj->GetParentSdrObject() )
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if ( pObj->IsA( TYPE(SdrObjGroup) ) )
+ String sDrwFmtNm( String::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM("DrawObject" )));
+ for ( sal_uInt32 i = 0; i < aSelection.size(); ++i )
{
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
- SwFmtAnchor aAnch( pContact->GetFmt()->GetAnchor() );
- SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
-
- SwUndoDrawUnGroup* pUndo = 0;
- if( bUndo )
+ SdrObjGroup* pObj = dynamic_cast< SdrObjGroup* >(aSelection[i]);
+ if ( pObj )
{
- pUndo = new SwUndoDrawUnGroup( (SdrObjGroup*)pObj );
- GetIDocumentUndoRedo().AppendUndo(pUndo);
- }
-
- for ( sal_uInt16 i2 = 0; i2 < pLst->GetObjCount(); ++i2 )
- {
- SdrObject* pSubObj = pLst->GetObj( i2 );
- SwDrawFrmFmt *pFmt = MakeDrawFrmFmt( sDrwFmtNm,
- GetDfltFrmFmt() );
- pFmt->SetFmtAttr( aAnch );
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
- pFmt->SetPositionLayoutDir(
- text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
- // --> OD 2006-11-01 #130889#
- // creation of <SwDrawContact> instances for the group
- // members and its connection to the Writer layout is
- // done after intrinsic ungrouping.
-// SwDrawContact* pContact = new SwDrawContact( pFmt, pSubObj );
-// // --> OD 2004-11-22 #i35635#
-// pContact->MoveObjToVisibleLayer( pSubObj );
-// // <--
-// pContact->ConnectToLayout();
-// // OD 2004-04-07 #i26791# - Adjust positioning and
-// // alignment attributes.
-// lcl_AdjustPositioningAttr( pFmt, *pSubObj );
- pFmtsAndObjs[i].push_back( std::pair< SwDrawFrmFmt*, SdrObject* >( pFmt, pSubObj ) );
- // <--
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
+ SwFmtAnchor aAnch( pContact->GetFmt()->GetAnchor() );
+ SdrObjList *pLst = pObj->getChildrenOfSdrObject();
+ SwUndoDrawUnGroup* pUndo = 0;
if( bUndo )
- pUndo->AddObj( i2, pFmt );
+ {
+ pUndo = new SwUndoDrawUnGroup( (SdrObjGroup*)pObj );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
+
+ for ( sal_uInt16 i2 = 0; i2 < pLst->GetObjCount(); ++i2 )
+ {
+ SdrObject* pSubObj = pLst->GetObj( i2 );
+ SwDrawFrmFmt *pFmt = MakeDrawFrmFmt( sDrwFmtNm,
+ GetDfltFrmFmt() );
+ pFmt->SetFmtAttr( aAnch );
+ // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ pFmt->SetPositionLayoutDir(
+ text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
+ // <--
+ // --> OD 2006-11-01 #130889#
+ // creation of <SwDrawContact> instances for the group
+ // members and its connection to the Writer layout is
+ // done after intrinsic ungrouping.
+ // SwDrawContact* pContact = new SwDrawContact( pFmt, pSubObj );
+ // // --> OD 2004-11-22 #i35635#
+ // pContact->MoveObjToVisibleLayer( pSubObj );
+ // // <--
+ // pContact->ConnectToLayout();
+ // // OD 2004-04-07 #i26791# - Adjust positioning and
+ // // alignment attributes.
+ // lcl_AdjustPositioningAttr( pFmt, *pSubObj );
+ pFmtsAndObjs[i].push_back( std::pair< SwDrawFrmFmt*, SdrObject* >( pFmt, pSubObj ) );
+ // <--
+
+ if( bUndo )
+ pUndo->AddObj( i2, pFmt );
+ }
}
}
}
}
- }
- rDrawView.UnGroupMarked();
- // --> OD 2006-11-01 #130889#
- // creation of <SwDrawContact> instances for the former group members and
- // its connection to the Writer layout.
- for ( sal_uInt32 i = 0; i < nMarkCount; ++i )
- {
- SwUndoDrawUnGroupConnectToLayout* pUndo = 0;
- if( bUndo )
+ rDrawView.UnGroupMarked();
+ // --> OD 2006-11-01 #130889#
+ // creation of <SwDrawContact> instances for the former group members and
+ // its connection to the Writer layout.
+ for ( sal_uInt32 i = 0; i < aSelection.size(); ++i )
{
- pUndo = new SwUndoDrawUnGroupConnectToLayout();
- GetIDocumentUndoRedo().AppendUndo(pUndo);
- }
+ SwUndoDrawUnGroupConnectToLayout* pUndo = 0;
+ if( bUndo )
+ {
+ pUndo = new SwUndoDrawUnGroupConnectToLayout();
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
+ }
- while ( pFmtsAndObjs[i].size() > 0 )
- {
- SwDrawFrmFmt* pFmt( pFmtsAndObjs[i].back().first );
- SdrObject* pObj( pFmtsAndObjs[i].back().second );
- pFmtsAndObjs[i].pop_back();
+ while ( pFmtsAndObjs[i].size() > 0 )
+ {
+ SwDrawFrmFmt* pFmt( pFmtsAndObjs[i].back().first );
+ SdrObject* pObj( pFmtsAndObjs[i].back().second );
+ pFmtsAndObjs[i].pop_back();
- SwDrawContact* pContact = new SwDrawContact( pFmt, pObj );
- pContact->MoveObjToVisibleLayer( pObj );
- pContact->ConnectToLayout();
- lcl_AdjustPositioningAttr( pFmt, *pObj );
+ SwDrawContact* pContact = new SwDrawContact( pFmt, pObj );
+ pContact->MoveObjToVisibleLayer( pObj );
+ pContact->ConnectToLayout();
+ lcl_AdjustPositioningAttr( pFmt, *pObj );
- if ( bUndo )
- {
- pUndo->AddFmtAndObj( pFmt, pObj );
+ if ( bUndo )
+ {
+ pUndo->AddFmtAndObj( pFmt, pObj );
+ }
}
}
+ delete [] pFmtsAndObjs;
+ // <--
}
- delete [] pFmtsAndObjs;
- // <--
}
/*************************************************************************
@@ -444,94 +448,94 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
{
sal_Bool bCallBase = sal_False;
- const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
- if( rMrkList.GetMarkCount() )
+
+ if(rDrawView.areSdrObjectsSelected())
{
- GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
- sal_uInt16 i;
- sal_Bool bDelMarked = sal_True;
+ const SdrObjectVector aSelection(rDrawView.getSelectedSdrObjectVectorFromSdrMarkView());
- if( 1 == rMrkList.GetMarkCount() )
+ if( aSelection.size() )
{
- SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj->ISA(SwVirtFlyDrawObj) )
+ GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
+ sal_uInt16 i;
+ sal_Bool bDelMarked = sal_True;
+
+ if( 1 == aSelection.size() )
{
- SwFlyFrmFmt* pFrmFmt = (SwFlyFrmFmt*)
- ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetFmt();
- if( pFrmFmt )
+ SwVirtFlyDrawObj* pObj = dynamic_cast< SwVirtFlyDrawObj* >(aSelection[0]);
+ if( pObj )
{
- DelLayoutFmt( pFrmFmt );
- bDelMarked = sal_False;
+ SwFlyFrmFmt* pFrmFmt = (SwFlyFrmFmt*)pObj->GetFlyFrm()->GetFmt();
+ if( pFrmFmt )
+ {
+ DelLayoutFmt( pFrmFmt );
+ bDelMarked = sal_False;
+ }
}
}
- }
- for( i = 0; i < rMrkList.GetMarkCount(); ++i )
- {
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if( !pObj->ISA(SwVirtFlyDrawObj) )
+ for( i = 0; i < aSelection.size(); ++i )
{
- SwDrawContact *pC = (SwDrawContact*)GetUserCall(pObj);
- SwDrawFrmFmt *pFrmFmt = (SwDrawFrmFmt*)pC->GetFmt();
- if( pFrmFmt &&
- FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() )
+ SdrObject *pObj = aSelection[i];
+ if( !dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
- rDrawView.MarkObj( pObj, rDrawView.Imp().GetPageView(), sal_True );
- --i;
- DelLayoutFmt( pFrmFmt );
+ SwDrawContact *pC = (SwDrawContact*)findConnectionToSdrObject(pObj);
+ SwDrawFrmFmt *pFrmFmt = (SwDrawFrmFmt*)pC->GetFmt();
+ if( pFrmFmt &&
+ FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() )
+ {
+ rDrawView.MarkObj( *pObj, true);
+ --i;
+ DelLayoutFmt( pFrmFmt );
+ }
}
}
- }
- if( rMrkList.GetMarkCount() && bDelMarked )
- {
- SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- if( !pObj->GetUpGroup() )
+ if( aSelection.size() && bDelMarked )
{
- SwUndoDrawDelete *const pUndo =
- (!GetIDocumentUndoRedo().DoesUndo())
- ? 0
- : new SwUndoDrawDelete( (sal_uInt16)rMrkList.GetMarkCount() );
-
- //ContactObjekte vernichten, Formate sicherstellen.
- for( i = 0; i < rMrkList.GetMarkCount(); ++i )
+ SdrObject *pObj = aSelection[0];
+ if( !pObj->GetParentSdrObject() )
{
- const SdrMark& rMark = *rMrkList.GetMark( i );
- pObj = rMark.GetMarkedSdrObj();
- SwDrawContact *pContact = (SwDrawContact*)pObj->GetUserCall();
- if( pContact ) // natuerlich nicht bei gruppierten Objekten
+ SwUndoDrawDelete *const pUndo =
+ (!GetIDocumentUndoRedo().DoesUndo()) ? 0 : new SwUndoDrawDelete( (sal_uInt16)aSelection.size() );
+
+ //ContactObjekte vernichten, Formate sicherstellen.
+ for( i = 0; i < aSelection.size(); ++i )
{
- SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
- // OD 18.06.2003 #108784# - before delete of selection
- // is performed, marked <SwDrawVirtObj>-objects have to
- // be replaced by its reference objects.
- // Thus, assert, if a <SwDrawVirt>-object is found in the mark list.
- if ( pObj->ISA(SwDrawVirtObj) )
+ pObj = aSelection[i];
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObjectDirect(pObj);
+ if( pContact ) // natuerlich nicht bei gruppierten Objekten
{
- ASSERT( false,
- "<SwDrawVirtObj> is still marked for delete. application will crash!" );
+ SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
+ // OD 18.06.2003 #108784# - before delete of selection
+ // is performed, marked <SwDrawVirtObj>-objects have to
+ // be replaced by its reference objects.
+ // Thus, assert, if a <SwDrawVirt>-object is found in the mark list.
+ if ( dynamic_cast< SwDrawVirtObj* >(pObj) )
+ {
+ ASSERT( false, "<SwDrawVirtObj> is still marked for delete. application will crash!" );
+ }
+ //loescht sich selbst!
+ pContact->HandleChanged(*pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObj);
+
+ if( pUndo )
+ pUndo->AddObj( i, pFmt, *aSelection[i] );
+ else
+ DelFrmFmt( pFmt );
}
- //loescht sich selbst!
- pContact->Changed(*pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
- pObj->SetUserCall( 0 );
-
- if( pUndo )
- pUndo->AddObj( i, pFmt, rMark );
- else
- DelFrmFmt( pFmt );
}
- }
- if( pUndo )
- {
- GetIDocumentUndoRedo().AppendUndo( pUndo );
+ if( pUndo )
+ {
+ GetIDocumentUndoRedo().AppendUndo( pUndo );
+ }
}
+ bCallBase = sal_True;
}
- bCallBase = sal_True;
- }
- SetModified();
+ SetModified();
- GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
+ GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
+ }
}
return bCallBase;
@@ -560,14 +564,14 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
// Schauen, ob es ein SdrObject dafuer gibt
SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *pFrmFmt );
if( pFly )
- nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
+ nOrdNum = pFly->GetVirtDrawObj()->GetNavigationPosition();
}
else
{
// Schauen, ob es ein SdrObject dafuer gibt
SwFlyDrawContact* pContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *pFrmFmt );
if( pContact )
- nOrdNum = pContact->GetMaster()->GetOrdNum();
+ nOrdNum = pContact->GetMaster()->GetNavigationPosition();
}
}
else if( RES_DRAWFRMFMT == pFmt->Which() )
@@ -575,9 +579,10 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
// Schauen, ob es ein SdrObject dafuer gibt
SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFrmFmt );
if( pContact )
- nOrdNum = pContact->GetMaster()->GetOrdNum();
+ nOrdNum = pContact->GetMaster()->GetNavigationPosition();
}
- else {
+ else
+ {
ASSERT( !this, "was ist das fuer ein Format?" );
}
}
@@ -617,8 +622,8 @@ void SwDoc::InitDrawModel()
// #i33700#
// Set shadow distance defaults as PoolDefaultItems. Details see bug.
- pSdrPool->SetPoolDefaultItem(SdrShadowXDistItem((300 * 72) / 127));
- pSdrPool->SetPoolDefaultItem(SdrShadowYDistItem((300 * 72) / 127));
+ pSdrPool->SetPoolDefaultItem(SdrMetricItem(SDRATTR_SHADOWXDIST, (300 * 72) / 127));
+ pSdrPool->SetPoolDefaultItem(SdrMetricItem(SDRATTR_SHADOWYDIST, (300 * 72) / 127));
}
SfxItemPool *pEEgPool = EditEngine::CreatePool( sal_False );
pSdrPool->SetSecondaryPool( pEEgPool );
@@ -639,28 +644,28 @@ void SwDoc::InitDrawModel()
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Hell" ));
- nHell = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
+ nHell = pDrawModel->GetModelLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Heaven" ));
- nHeaven = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
+ nHeaven = pDrawModel->GetModelLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Controls" ));
- nControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
+ nControls = pDrawModel->GetModelLayerAdmin().NewLayer( sLayerNm )->GetID();
// OD 25.06.2003 #108784# - add invisible layers corresponding to the
// visible ones.
{
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
- nInvisibleHell = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
+ nInvisibleHell = pDrawModel->GetModelLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHeaven" ));
- nInvisibleHeaven = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
+ nInvisibleHeaven = pDrawModel->GetModelLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleControls" ));
- nInvisibleControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
+ nInvisibleControls = pDrawModel->GetModelLayerAdmin().NewLayer( sLayerNm )->GetID();
}
- SdrPage* pMasterPage = pDrawModel->AllocPage( sal_False );
+ SdrPage* pMasterPage = pDrawModel->AllocPage( false );
pDrawModel->InsertPage( pMasterPage );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create DrawDocument" );
@@ -673,7 +678,6 @@ void SwDoc::InitDrawModel()
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create Spellchecker/Hyphenator" );
SetCalcFieldValueHdl(&rOutliner);
- SetCalcFieldValueHdl(&pDrawModel->GetHitTestOutliner());
//JP 16.07.98: Bug 50193 - Linkmanager am Model setzen, damit
// dort ggfs. verlinkte Grafiken eingefuegt werden koennen
@@ -683,7 +687,7 @@ void SwDoc::InitDrawModel()
OutputDevice* pRefDev = getReferenceDevice( false );
if ( pRefDev )
- pDrawModel->SetRefDevice( pRefDev );
+ pDrawModel->SetReferenceDevice( pRefDev );
pDrawModel->SetNotifyUndoActionHdl( LINK( this, SwDoc, AddDrawUndo ));
if ( pCurrentView )
@@ -700,7 +704,8 @@ void SwDoc::InitDrawModel()
// pDrawModel->InsertPage( pDrawPage );
SdrPage* pDrawPage = pMasterPage;
pRoot->SetDrawPage( pDrawPage );
- pDrawPage->SetSize( pRoot->Frm().SSize() );
+ const basegfx::B2DVector aNewPageScale(pRoot->Frm().SSize().Width(), pRoot->Frm().SSize().Height());
+ pDrawPage->SetPageScale(aNewPageScale);
}
pViewSh = (ViewShell*)pViewSh->GetNext();
}while( pViewSh != pCurrentView );
@@ -867,7 +872,7 @@ void SwDoc::ReleaseDrawModel()
/*************************************************************************/
-SdrModel* SwDoc::_MakeDrawModel()
+FmFormModel* SwDoc::_MakeDrawModel()
{
ASSERT( !pDrawModel, "_MakeDrawModel: Why?" );
InitDrawModel();
@@ -921,7 +926,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
const SvxFieldItem& rField = pInfo->GetField();
const SvxFieldData* pField = rField.GetField();
- if (pField && pField->ISA(SvxDateField))
+ if (pField && dynamic_cast< const SvxDateField* >(pField))
{
/******************************************************************
* Date-Field
@@ -930,7 +935,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
((const SvxDateField*) pField)->GetFormatted(
*GetNumberFormatter( sal_True ), LANGUAGE_SYSTEM) );
}
- else if (pField && pField->ISA(SvxURLField))
+ else if (pField && dynamic_cast< const SvxURLField* >(pField))
{
/******************************************************************
* URL-Field
@@ -969,14 +974,14 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
pInfo->SetTxtColor(aColor);
}
- else if (pField && pField->ISA(SdrMeasureField))
+ else if (pField && dynamic_cast< const SdrMeasureField* >(pField))
{
/******************************************************************
* Measure-Field
******************************************************************/
pInfo->ClearFldColor();
}
- else if ( pField && pField->ISA(SvxExtTimeField))
+ else if ( pField && dynamic_cast< const SvxExtTimeField* >(pField))
{
/******************************************************************
* Time-Field
@@ -997,15 +1002,15 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
/* TFFDI: The functions formerly declared 'inline'
*/
-const SdrModel* SwDoc::GetDrawModel() const { return pDrawModel; }
-SdrModel* SwDoc::GetDrawModel() { return pDrawModel; }
+const FmFormModel* SwDoc::GetDrawModel() const { return pDrawModel; }
+FmFormModel* SwDoc::GetDrawModel() { return pDrawModel; }
SdrLayerID SwDoc::GetHeavenId() const { return nHeaven; }
SdrLayerID SwDoc::GetHellId() const { return nHell; }
SdrLayerID SwDoc::GetControlsId() const { return nControls; }
SdrLayerID SwDoc::GetInvisibleHeavenId() const { return nInvisibleHeaven; }
SdrLayerID SwDoc::GetInvisibleHellId() const { return nInvisibleHell; }
SdrLayerID SwDoc::GetInvisibleControlsId() const { return nInvisibleControls; }
-SdrModel* SwDoc::GetOrCreateDrawModel() { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); }
+FmFormModel* SwDoc::GetOrCreateDrawModel() { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); }
// --> OD 2006-03-14 #i62875#
namespace docfunc
@@ -1052,7 +1057,7 @@ namespace docfunc
!dynamic_cast<SwFlyDrawObj*>(pObj) )
{
SwDrawContact* pDrawContact =
- dynamic_cast<SwDrawContact*>(::GetUserCall( pObj ));
+ dynamic_cast<SwDrawContact*>(::findConnectionToSdrObject( pObj ));
if ( pDrawContact )
{
SwAnchoredDrawObject* pAnchoredDrawObj =
@@ -1109,6 +1114,8 @@ void SwDoc::UpdateDrawDefaults()
{
// drawing layer defaults that are set for new documents (if InitNew was called)
if ( pDrawModel && mbSetDrawDefaults )
+ {
pDrawModel->SetDrawingLayerPoolDefaults();
+ }
}
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 7b08eca328ee..5923143cb1e1 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -761,6 +761,11 @@ void SwDoc::SetModified(SwPaM &rPaM)
* SwDoc::Overwrite()
************************************************************************/
+namespace
+{
+ bool ImpCheck(const SwClient& rClient) { return 0 != dynamic_cast< const SwCrsrShell* >(&rClient); }
+}
+
bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
{
SwPosition& rPt = *(SwPosition*)rRg.GetPoint();
@@ -842,7 +847,8 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
if( nOldAttrCnt != nNewAttrCnt )
{
SwUpdateAttr aHint( 0, 0, 0 );
- pNode->ModifyBroadcast( 0, &aHint, TYPE( SwCrsrShell ) );
+
+ pNode->ModifyBroadcast( 0, &aHint, &ImpCheck);
}
if (!GetIDocumentUndoRedo().DoesUndo() &&
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 1fe81790a381..4cecdb72a36d 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -524,12 +524,8 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( pFldType )
{
SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
- for( SwFmtFld* pFmtFld = aIter.Last(); pFmtFld; pFmtFld = aIter.Previous() )
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
- // start calculation at the end
- // new fields are inserted at the beginning of the modify chain
- // that gives faster calculation on import
- // mba: do we really need this "optimization"? Is it still valid?
SwTblField* pFld;
if( !pFmtFld->GetTxtFld() || (nsSwExtendedSubType::SUB_CMD &
(pFld = (SwTblField*)pFmtFld->GetFld())->GetSubType() ))
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 895c114040c9..de9776e6cd91 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -30,7 +30,6 @@
#include <svx/svdpage.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdocapt.hxx>
-#include <svx/svdmark.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
@@ -604,15 +603,15 @@ void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
pGrfNd->GetFileFilterNms( pGrfName, pFltName );
}
-sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
+sal_Bool SwDoc::ChgAnchor( const SdrObjectVector& rSdrObjectVector,
RndStdIds _eAnchorType,
const sal_Bool _bSameOnly,
const sal_Bool _bPosCorr )
{
ASSERT( GetCurrentLayout(), "Ohne Layout geht gar nichts" ); //swmod 080218
- if ( !_rMrkList.GetMarkCount() ||
- _rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
+ if ( !rSdrObjectVector.size() ||
+ rSdrObjectVector[0]->GetParentSdrObject() )
{
return false;
}
@@ -620,12 +619,13 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
GetIDocumentUndoRedo().StartUndo( UNDO_INSATTR, NULL );
sal_Bool bUnmark = sal_False;
- for ( sal_uInt16 i = 0; i < _rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt32 i = 0; i < rSdrObjectVector.size(); ++i )
{
- SdrObject* pObj = _rMrkList.GetMark( i )->GetMarkedSdrObj();
- if ( !pObj->ISA(SwVirtFlyDrawObj) )
+ const SdrObject* pObj = rSdrObjectVector[i];
+
+ if ( !dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
{
- SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
+ SwDrawContact* pContact = static_cast<SwDrawContact*>(findConnectionToSdrObject(pObj));
// OD 27.06.2003 #108784# - consider, that drawing object has
// no user call. E.g.: a 'virtual' drawing object is disconnected by
@@ -635,8 +635,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
{
#ifdef DBG_UTIL
bool bNoUserCallExcepted =
- pObj->ISA(SwDrawVirtObj) &&
- !static_cast<SwDrawVirtObj*>(pObj)->IsConnected();
+ dynamic_cast< const SwDrawVirtObj* >(pObj) &&
+ !static_cast< const SwDrawVirtObj* >(pObj)->IsConnected();
ASSERT( bNoUserCallExcepted, "SwDoc::ChgAnchor(..) - no contact at selected drawing object" );
#endif
continue;
@@ -807,8 +807,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
{
// --> OD 2004-08-24 #i33313# - consider not connected
// 'virtual' drawing objects
- if ( pObj->ISA(SwDrawVirtObj) &&
- !static_cast<SwDrawVirtObj*>(pObj)->IsConnected() )
+ if ( dynamic_cast< const SwDrawVirtObj* >(pObj)
+ && !static_cast< const SwDrawVirtObj* >(pObj)->IsConnected() )
{
SwRect aNewObjRect( aObjRect );
static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( 0L ))
@@ -818,8 +818,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
else
{
- static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( pObj ))
- ->AdjustPositioningAttr( pNewAnchorFrm );
+ const SwAnchoredDrawObject* pAnchoredDrawObject = static_cast< const SwAnchoredDrawObject* >(pContact->GetAnchoredObj( pObj ));
+ const_cast< SwAnchoredDrawObject* >(pAnchoredDrawObject)->AdjustPositioningAttr( pNewAnchorFrm );
}
}
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 32614a94e567..f674ab056c81 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1435,7 +1435,7 @@ void SwDoc::DelCharFmt( SwCharFmt *pFmt, sal_Bool bBroadcast )
void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
{
- if( pFmt->ISA( SwTableBoxFmt ) || pFmt->ISA( SwTableLineFmt ))
+ if( dynamic_cast< SwTableBoxFmt* >(pFmt) || dynamic_cast< SwTableLineFmt* >(pFmt))
{
ASSERT( !this, "Format steht nicht mehr im DocArray, "
"kann per delete geloescht werden" );
@@ -2174,6 +2174,11 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader,
delete pNewItem;
}
+namespace
+{
+ bool ImpCheck(const SwClient& rClient) { return 0 != dynamic_cast< const SwFrm* >(&rClient); }
+}
+
void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
sal_Bool bCopyPoolIds )
{
@@ -2254,11 +2259,13 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
{
rDstDesc.SetFtnInfo( rSrcDesc.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
+
{
- rDstDesc.GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
+ rDstDesc.GetMaster().ModifyBroadcast( &aInfo, 0, &ImpCheck);
}
+
{
- rDstDesc.GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
+ rDstDesc.GetLeft().ModifyBroadcast( &aInfo, 0, &ImpCheck);
}
}
}
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 5a4d7a4ce63c..1363bd83534c 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -44,6 +44,7 @@
#include <svx/svdouno.hxx>
#include <svx/fmpage.hxx>
#include <editeng/frmdiritem.hxx>
+#include <svx/svdlegacy.hxx>
#include <swmodule.hxx>
#include <modcfg.hxx>
@@ -105,6 +106,7 @@
// --> OD 2004-07-26 #i32089#
#include <vector>
// <--
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -511,8 +513,8 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
// --> OD 2005-05-23 #i49730# - notify draw frame format
// that position attributes are already set, if the position attributes
// are already set at the source draw frame format.
- if ( pDest->ISA(SwDrawFrmFmt) &&
- rSource.ISA(SwDrawFrmFmt) &&
+ if (dynamic_cast< SwDrawFrmFmt* >(pDest) &&
+ dynamic_cast< const SwDrawFrmFmt* >(&rSource) &&
static_cast<const SwDrawFrmFmt&>(rSource).IsPosAttrSet() )
{
static_cast<SwDrawFrmFmt*>(pDest)->PosAttrSet();
@@ -559,11 +561,11 @@ SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
// <--
if( !pPg )
{
- pPg = GetDrawModel()->AllocPage( sal_False );
+ pPg = GetDrawModel()->AllocPage( false );
GetDrawModel()->InsertPage( pPg );
}
- SdrObject *pObj = rObj.Clone();
+ SdrObject *pObj = rObj.CloneSdrObject(GetDrawModel());
if( bMoveWithinDoc && FmFormInventor == pObj->GetObjInventor() )
{
// bei Controls muss der Name erhalten bleiben
@@ -574,19 +576,19 @@ SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
if( xSet.is() )
aVal = xSet->getPropertyValue( sName );
if( bInsInPage )
- pPg->InsertObject( pObj );
+ pPg->InsertObjectToSdrObjList(*pObj);
if( xSet.is() )
xSet->setPropertyValue( sName, aVal );
}
else if( bInsInPage )
- pPg->InsertObject( pObj );
+ pPg->InsertObjectToSdrObjList(*pObj);
// OD 02.07.2003 #108784# - for drawing objects: set layer of cloned object
// to invisible layer
SdrLayerID nLayerIdForClone = rObj.GetLayer();
- if ( !pObj->ISA(SwFlyDrawObj) &&
- !pObj->ISA(SwVirtFlyDrawObj) &&
- !IS_TYPE(SdrObject,pObj) )
+ if ( !dynamic_cast< SwFlyDrawObj* >(pObj) &&
+ !dynamic_cast< SwVirtFlyDrawObj* >(pObj) &&
+ typeid(*pObj) != typeid(SdrObject)) // IS_TYPE(SdrObject,pObj) )
{
if ( IsVisibleLayerId( nLayerIdForClone ) )
{
@@ -981,8 +983,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
aAnch.SetAnchor( rRg.GetPoint() );
if ( FLY_AT_PAGE == eAnchorId )
{
- eAnchorId = rDrawObj.ISA( SdrUnoObj )
- ? FLY_AS_CHAR : FLY_AT_PARA;
+ eAnchorId = dynamic_cast< SdrUnoObj* >(&rDrawObj) ? FLY_AS_CHAR : FLY_AT_PARA;
aAnch.SetType( eAnchorId );
}
}
@@ -1128,7 +1129,7 @@ SwPosFlyFrms SwDoc::GetAllFlyFmts( const SwPaM* pCmpRange, sal_Bool bDrawAlso )
for( sal_uInt16 i = 0; i < rObjs.Count(); ++i)
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
pFly = &(pAnchoredObj->GetFrmFmt());
else if ( bDrawAlso )
pFly = &(pAnchoredObj->GetFrmFmt());
@@ -1679,7 +1680,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
pNewSet->Put( pOldFmt->GetAnchor() );
//In der Hoehe soll der neue Varabel sein!
- Size aSz( rSdrObj.GetCurrentBoundRect().GetSize() );
+ Size aSz( sdr::legacy::GetBoundRect(rSdrObj).GetSize() );
SwFmtFrmSize aFrmSize( ATT_MIN_SIZE, aSz.Width(), aSz.Height() );
pNewSet->Put( aFrmSize );
@@ -1840,8 +1841,8 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel(
String const& rCharacterStyle,
SdrObject& rSdrObj )
{
- SwDrawContact *const pContact =
- static_cast<SwDrawContact*>(GetUserCall( &rSdrObj ));
+ // replace formally used 'GetUserCall()' by new notify/listener mechanism
+ const SwDrawContact* pContact = static_cast< const SwDrawContact* >(findConnectionToSdrObject(&rSdrObj));
OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
"InsertDrawLabel(): not a DrawFrmFmt" );
if (!pContact)
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 3e7418bee23d..f5229baa2c6a 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -841,7 +841,7 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
// ((SwNumRuleItem*)pItem)->GetValue().Len() &&
// ((SwNumRuleItem*)pItem)->GetValue() == rName )
// {
-// if( pMod->IsA( TYPE( SwFmt )) )
+// if( dynamic_cast< SwFmt* >(pMod) )
// pMod->GetInfo( *this );
// else
// {
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 75778371bb59..5a8501f3df4c 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -51,8 +51,6 @@
using namespace com::sun::star;
-TYPEINIT1(SwRedlineHint, SfxHint);
-
#ifndef DBG_UTIL
#define _CHECK_REDLINE( pDoc )
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index a023ad715802..12f98950ef21 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -82,8 +82,6 @@ const sal_Char __FAR_DATA sPageDeli[] = ", ";
SV_IMPL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr)
-TYPEINIT2( SwTOXBaseSection, SwTOXBase, SwSection ); // fuers RTTI
-
struct LinkStruct
{
SwFmtINetFmt aINetFmt;
@@ -463,8 +461,7 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
SectionType eT = pSectNd->GetSection().GetType();
if( TOX_CONTENT_SECTION == eT )
{
- ASSERT( pSectNd->GetSection().ISA( SwTOXBaseSection ),
- "keine TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&pSectNd->GetSection()), "keine TOXBaseSection!" );
SwTOXBaseSection& rTOXSect = (SwTOXBaseSection&)
pSectNd->GetSection();
return &rTOXSect;
@@ -476,7 +473,7 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&rTOXBase), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
SwSectionFmt* pFmt = rTOXSect.GetFmt();
ASSERT( pFmt, "invalid TOXBaseSection!" );
@@ -532,7 +529,7 @@ sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
{
// its only delete the TOX, not the nodes
sal_Bool bRet = sal_False;
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&rTOXBase), "keine TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
SwSectionFmt* pFmt = rTOXSect.GetFmt();
@@ -705,8 +702,7 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ),
- "keine TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&rTOXBase), "keine TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOXBase;
String sTmp = GetUniqueTOXBaseName(*rTOXBase.GetTOXType(), &rName);
@@ -2397,7 +2393,7 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
sal_Bool SwTOXBase::IsTOXBaseInReadonly() const
{
- const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
+ const SwTOXBaseSection *pSect = dynamic_cast< const SwTOXBaseSection* >( this);
sal_Bool bRet = sal_False;
const SwSectionNode* pSectNode;
if(pSect && pSect->GetFmt() &&
@@ -2415,7 +2411,7 @@ sal_Bool SwTOXBase::IsTOXBaseInReadonly() const
const SfxItemSet* SwTOXBase::GetAttrSet() const
{
- const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
+ const SwTOXBaseSection *pSect = dynamic_cast< const SwTOXBaseSection* >( this);
if(pSect && pSect->GetFmt())
return &pSect->GetFmt()->GetAttrSet();
return 0;
@@ -2423,7 +2419,7 @@ const SfxItemSet* SwTOXBase::GetAttrSet() const
void SwTOXBase::SetAttrSet( const SfxItemSet& rSet )
{
- SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
+ SwTOXBaseSection *pSect = dynamic_cast< SwTOXBaseSection* >( this);
if( pSect && pSect->GetFmt() )
pSect->GetFmt()->SetFmtAttr( rSet );
}
@@ -2434,7 +2430,7 @@ sal_Bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
{
case RES_CONTENT_VISIBLE:
{
- SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
+ SwTOXBaseSection *pSect = const_cast< SwTOXBaseSection* >(dynamic_cast< const SwTOXBaseSection* >(this));
if( pSect && pSect->GetFmt() )
pSect->GetFmt()->GetInfo( rInfo );
}
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 76855b349e9e..3f37cde57c76 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -39,11 +39,6 @@
#include <switerator.hxx>
#include <svl/intitem.hxx>
-TYPEINIT1( SwTxtFmtColl, SwFmtColl );
-TYPEINIT1( SwGrfFmtColl, SwFmtColl );
-TYPEINIT1( SwConditionTxtFmtColl, SwTxtFmtColl );
-TYPEINIT1( SwCollCondition, SwClient );
-
SV_IMPL_PTRARR( SwFmtCollConditions, SwCollConditionPtr );
// --> OD 2008-03-04 #refactorlists#
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 247530c502cc..7b2b3ff078a9 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1011,8 +1011,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
pShell->GetWin();
// <--
- if( bAnimate &&
- FindFlyFrm() != ::GetFlyFromMarked( 0, pShell ))
+ if( bAnimate && FindFlyFrm() != ::GetFlyFromMarked( pShell ))
{
OutputDevice* pVout;
if( pOut == pShell->GetOut() && SwRootFrm::FlushVout() )
@@ -1182,13 +1181,21 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if( bDummyJobSetup )
delete pJobSetup; // ... und raeumen wieder auf.
- sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
- if ( !bPrn && pShell->ISA( SwCrsrShell ) &&
- nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
+ if ( !bPrn )
{
- const SwFlyFrm *pFly = FindFlyFrm();
- ASSERT( pFly, "OLE not in FlyFrm" );
- ((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm());
+ SwFEShell* pSwFEShell = dynamic_cast< SwFEShell* >(pShell);
+
+ if(pSwFEShell)
+ {
+ const sal_Int64 nMiscStatus(pOLENd->GetOLEObj().GetOleRef()->getStatus(pOLENd->GetAspect()));
+
+ if(nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE)
+ {
+ const SwFlyFrm *pFly = FindFlyFrm();
+ ASSERT( pFly, "OLE not in FlyFrm" );
+ pSwFEShell->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm());
+ }
+ }
}
}
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 25b23de22aaa..06693ebb8913 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -442,7 +442,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
// GetDefinedIn()) &&
// ((SwNumRuleItem*)pItem)->GetValue() == rRuleNm )
// {
-// if( pMod->IsA( TYPE( SwFmt )) )
+// if( dynamic_cast< SwFmt* >(pMod) )
// {
// SwNumRuleInfo aInfo( rRuleNm );
// pMod->GetInfo( aInfo );
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index c22eba112c29..48de0e3b5572 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -2383,7 +2383,7 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
// ((SwNumRuleItem*)pItem)->GetValue().Len() &&
// ((SwNumRuleItem*)pItem)->GetValue() == rRule.GetName() )
// {
-// if( pMod->IsA( TYPE( SwFmt )) )
+// if( dynamic_cast< SwFmt* >(pMod) )
// {
// bUsed = !pMod->GetInfo( aGetHt );
// if( bUsed )
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index bcedfcd5a1d7..efc0da87517a 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -264,19 +264,22 @@ if( !pChkLnk )
for( sal_uInt16 n = rLnks.Count(); n; )
{
const ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
- if( pLnk && OBJECT_CLIENT_GRF != pLnk->GetObjType() &&
- pLnk->ISA( SwBaseLink ) &&
- !((SwBaseLink*)pLnk)->IsNoDataFlag() &&
- ((SwBaseLink*)pLnk)->IsInRange( nSttNd, nEndNd, nStt, nEnd ))
+ if( pLnk && OBJECT_CLIENT_GRF != pLnk->GetObjType())
+ {
+ const SwBaseLink* pSwBaseLink = dynamic_cast< const SwBaseLink* >(pLnk);
+
+ if(pSwBaseLink &&
+ !pSwBaseLink->IsNoDataFlag() &&
+ pSwBaseLink->IsInRange( nSttNd, nEndNd, nStt, nEnd ))
{
if( pChkLnk )
{
- if( pLnk == pChkLnk ||
- ((SwBaseLink*)pLnk)->IsRecursion( pChkLnk ) )
+ if( pLnk == pChkLnk || pSwBaseLink->IsRecursion( pChkLnk ) )
return sal_True;
}
- else if( ((SwBaseLink*)pLnk)->IsRecursion( (SwBaseLink*)pLnk ) )
- ((SwBaseLink*)pLnk)->SetNoDataFlag();
+ else if( pSwBaseLink->IsRecursion( (SwBaseLink*)pLnk ) )
+ const_cast< SwBaseLink* >(pSwBaseLink)->SetNoDataFlag();
+ }
}
}
if( !pChkLnk )
@@ -345,13 +348,17 @@ SwDataChanged::~SwDataChanged()
{
::sfx2::SvLinkSourceRef refObj( rServers[ --nCnt ] );
// noch jemand am Object interessiert ?
- if( refObj->HasDataLinks() && refObj->ISA( SwServerObject ))
+ if( refObj->HasDataLinks() )
{
- SwServerObject& rObj = *(SwServerObject*)&refObj;
- if( pPos )
- rObj.SendDataChanged( *pPos );
- else
- rObj.SendDataChanged( *pPam );
+ SwServerObject* pObj = dynamic_cast< SwServerObject* >(&refObj);
+
+ if(pObj)
+ {
+ if( pPos )
+ pObj->SendDataChanged( *pPos );
+ else
+ pObj->SendDataChanged( *pPam );
+ }
}
// sollte jetzt gar keine Verbindung mehr bestehen
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 35c7836da8f9..edff760c9cd8 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2263,7 +2263,7 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
pTblNd->GetTable().SetRowsToRepeat( GetRowsToRepeat() );
- if( IS_TYPE( SwDDETable, this ))
+ if( typeid(SwDDETable) == typeid(*this) ) // IS_TYPE( SwDDETable, this ))
{
// es wird eine DDE-Tabelle kopiert
// ist im neuen Dokument ueberhaupt der FeldTyp vorhanden ?
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index ea8490eeee15..99eb3e3d2b79 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -50,7 +50,7 @@ SwURLStateChanged::~SwURLStateChanged()
void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if( rHint.ISA( INetURLHistoryHint ) && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
+ if( dynamic_cast< const INetURLHistoryHint* >(&rHint) && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
// diese URL wurde veraendert:
const INetURLObject* pIURL = ((INetURLHistoryHint&)rHint).GetObject();
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 1cad72b522dc..4d686d095ece 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -467,7 +467,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
rTbl.SetTableModel( GetTable().IsNewModel() );
SwDDEFieldType* pDDEType = 0;
- if( IS_TYPE( SwDDETable, &GetTable() ))
+ if( typeid(SwDDETable) == typeid(GetTable()) ) // IS_TYPE( SwDDETable, &GetTable() ))
{
// es wird eine DDE-Tabelle kopiert
// ist im neuen Dokument ueberhaupt der FeldTyp vorhanden ?
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 53ebcaba487a..013270526e69 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1271,7 +1271,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
::std::auto_ptr<SwTOXBase> pTOXBase;
if (TOX_CONTENT_SECTION == GetSection().GetType())
{
- ASSERT( GetSection().ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&GetSection()), "no TOXBaseSection!" );
SwTOXBaseSection const& rTBS(
dynamic_cast<SwTOXBaseSection const&>(GetSection()));
pTOXBase.reset( new SwTOXBase(rTBS, pDoc) );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 2cd9f878bb43..7ffcd33f0b53 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1758,7 +1758,7 @@ sal_Bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool b
return sal_False;
SwTable& rTbl = pTblNd->GetTable();
- if( rTbl.ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(&rTbl))
return sal_False;
#ifdef DEL_TABLE_REDLINES
@@ -1825,7 +1825,7 @@ sal_Bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool b
return sal_False;
SwTable& rTbl = pTblNd->GetTable();
- if( rTbl.ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(&rTbl))
return sal_False;
#ifdef DEL_TABLE_REDLINES
@@ -1890,7 +1890,7 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor )
{
SwTableNode* pTblNd = rCursor.GetNode()->FindTableNode();
- if( pTblNd->GetTable().ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(&pTblNd->GetTable()))
return sal_False;
// suche alle Boxen / Lines
@@ -2017,7 +2017,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
if( !pTblNd )
return sal_False;
- if( pTblNd->GetTable().ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(&pTblNd->GetTable()))
return sal_False;
::ClearFEShellTabCols();
@@ -2237,7 +2237,7 @@ sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 n
return sal_False;
SwTable& rTbl = pTblNd->GetTable();
- if( rTbl.ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(&rTbl))
return sal_False;
#ifdef DEL_TABLE_REDLINES
@@ -2309,7 +2309,7 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam )
if( !pTblNd )
return TBLMERGE_NOSELECTION;
SwTable& rTable = pTblNd->GetTable();
- if( rTable.ISA(SwDDETable) )
+ if( dynamic_cast< SwDDETable* >(&rTable) )
return TBLMERGE_NOSELECTION;
sal_uInt16 nRet = TBLMERGE_NOSELECTION;
if( !rTable.IsNewModel() )
@@ -2523,7 +2523,6 @@ void SwTableNode::DelFrms()
while ( pFrm )
{
sal_Bool bAgain = sal_False;
- {
if ( !pFrm->IsFollow() )
{
while ( pFrm->HasFollow() )
@@ -2548,7 +2547,6 @@ void SwTableNode::DelFrms()
delete pFrm;
bAgain = sal_True;
}
- }
pFrm = bAgain ? aIter.First() : aIter.Next();
}
}
@@ -3217,7 +3215,7 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode,
if( !pTNd || pNd->IsTableNode() )
return 0;
- if( pTNd->GetTable().ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(&pTNd->GetTable()))
return sal_False;
SwTable& rTbl = pTNd->GetTable();
@@ -3581,8 +3579,8 @@ sal_Bool SwDoc::MergeTable( const SwPosition& rPos, sal_Bool bWithPrev, sal_uInt
if( !pDelTblNd )
return sal_False;
- if( pTblNd->GetTable().ISA( SwDDETable ) ||
- pDelTblNd->GetTable().ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(&pTblNd->GetTable()) ||
+ dynamic_cast< SwDDETable* >(&pDelTblNd->GetTable()))
return sal_False;
// MIB 9.7.97: HTML-Layout loeschen
@@ -4037,7 +4035,7 @@ sal_Bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
SwTableNode* pTblNd = (SwTableNode*)rAktBox.GetSttNd()->FindTableNode();
SwUndo* pUndo = 0;
- if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType && pTblNd->GetTable().ISA( SwDDETable ))
+ if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType && dynamic_cast< SwDDETable* >(&pTblNd->GetTable()))
return sal_False;
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 6c32c3926cad..efc4e6ff12d2 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -71,8 +71,6 @@
using namespace ::com::sun::star::i18n;
-TYPEINIT2( SwCntntNode, SwModify, SwIndexReg )
-
/*
* Some local helper functions for the attribute set handle of a content node.
* Since the attribute set of a content node may not be modified directly,
@@ -737,9 +735,9 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
((SwFmtPageDesc*)pItem)->GetDefinedIn() )
{
const SwModify* pMod = ((SwFmtPageDesc*)pItem)->GetDefinedIn();
- if( pMod->ISA( SwCntntNode ) )
+ if( dynamic_cast< const SwCntntNode* >(pMod) )
aInfo.CheckNode( *(SwCntntNode*)pMod );
- else if( pMod->ISA( SwFmt ))
+ else if( dynamic_cast< const SwFmt* >(pMod))
((SwFmt*)pMod)->GetInfo( aInfo );
}
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 1150d509a380..c1f07068d3bf 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -648,7 +648,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
}
}
- if( pTblNd->GetTable().IsA( TYPE( SwDDETable ) ))
+ if( dynamic_cast< SwDDETable* >(&pTblNd->GetTable()))
{
SwDDEFieldType* pTyp = ((SwDDETable&)pTblNd->
GetTable()).GetDDEFldType();
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 6cf91af3fe75..a74e1e34fc00 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -100,9 +100,6 @@ public:
};
-TYPEINIT1(SwSectionFmt,SwFrmFmt );
-TYPEINIT1(SwSection,SwClient );
-
typedef SwSection* SwSectionPtr;
SV_IMPL_PTRARR( SwSections, SwSection*)
@@ -634,7 +631,7 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd )
{
::sfx2::SvBaseLink* pBLnk = &(*rLnks[ --n ]);
if( pBLnk && !pBLnk->IsVisible() &&
- pBLnk->ISA( SwBaseLink ) &&
+ dynamic_cast< SwBaseLink* >(pBLnk) &&
0 != ( pNd = ((SwBaseLink*)pBLnk)->GetAnchor() ) )
{
pNd = pNd->StartOfSectionNode(); // falls SectionNode ist!
@@ -656,7 +653,7 @@ const SwTOXBase* SwSection::GetTOXBase() const
{
const SwTOXBase* pRet = 0;
if( TOX_CONTENT_SECTION == GetType() )
- pRet = PTR_CAST( SwTOXBaseSection, this );
+ pRet = dynamic_cast< const SwTOXBaseSection* >( this );
return pRet;
}
@@ -720,7 +717,7 @@ SwSection * SwSectionFmt::GetSection() const
extern void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd );
-//Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt).
+//Vernichtet alle Frms in aDepend (Frms werden per RTTI erkannt).
void SwSectionFmt::DelFrms()
{
SwSectionNode* pSectNd;
@@ -872,7 +869,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
case RES_FMT_CHG:
if( !GetDoc()->IsInDtor() &&
((SwFmtChg*)pNew)->pChangedFmt == (void*)GetRegisteredIn() &&
- ((SwFmtChg*)pNew)->pChangedFmt->IsA( TYPE( SwSectionFmt )) )
+ dynamic_cast< SwSectionFmt* >(((SwFmtChg*)pNew)->pChangedFmt) )
{
// mein Parent wird veraendert, muss mich aktualisieren
SwFrmFmt::Modify( pOld, pNew ); // erst umhaengen !!!
@@ -1031,10 +1028,10 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
bool bIsHidden = false;
SwClientIter aIter( *this ); // TODO
- ::SwClient * pLast = aIter.GoStart();
+ ::SwClient * pLast = aIter.SwClientIter_First();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
- if( pLast->IsA( TYPE(SwSectionFmt) ) )
+ if( dynamic_cast< SwSectionFmt* >(pLast) )
{
if( !pSection )
{
@@ -1081,8 +1078,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
pLast->ModifyNotification( &aMsgItem, &aMsgItem );
}
}
- else if( !pSection &&
- pLast->IsA( TYPE(SwSection) ) )
+ else if( !pSection && dynamic_cast< SwSection* >(pLast) )
{
pSection = (SwSectionPtr)pLast;
if( GetRegisteredIn() )
@@ -1103,7 +1099,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
bIsHidden = pSection->IsHidden();
}
}
- } while( 0 != ( pLast = ++aIter ));
+ } while( 0 != ( pLast = aIter.SwClientIter_Next() ));
}
@@ -1230,7 +1226,7 @@ void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && pLnk != &rUpdLnk &&
OBJECT_CLIENT_FILE == pLnk->GetObjType() &&
- pLnk->ISA( SwBaseLink ) &&
+ dynamic_cast< SwBaseLink* >(pLnk) &&
( pBLink = (SwBaseLink*)pLnk )->IsInRange( rSectNd.GetIndex(),
rSectNd.EndOfSectionIndex() ) )
{
@@ -1283,15 +1279,13 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
// erstmal nur ueber die DocumentShells laufen und die mit dem
// Namen heraussuchen:
- TypeId aType( TYPE(SwDocShell) );
-
SfxObjectShell* pShell = pDestSh;
sal_Bool bFirst = 0 != pShell;
if( !bFirst )
// keine DocShell uebergeben, also beginne mit der ersten aus der
// DocShell Liste
- pShell = SfxObjectShell::GetFirst( &aType );
+ pShell = SfxObjectShell::GetFirst( _IsObjectShell< SwDocShell > );
while( pShell )
{
@@ -1314,10 +1308,10 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
if( bFirst )
{
bFirst = sal_False;
- pShell = SfxObjectShell::GetFirst( &aType );
+ pShell = SfxObjectShell::GetFirst( _IsObjectShell< SwDocShell > );
}
else
- pShell = SfxObjectShell::GetNext( *pShell, &aType );
+ pShell = SfxObjectShell::GetNext( *pShell, _IsObjectShell< SwDocShell > );
}
// 2. selbst die Date oeffnen
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 20aaa53c0aec..1802d010d901 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -64,8 +64,6 @@ using namespace com::sun::star;
sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd );
-TYPEINIT1( SwBaseLink, ::sfx2::SvBaseLink );
-
SV_IMPL_REF( SwServerObject )
void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
@@ -79,13 +77,13 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
SwClientIter aIter( rGrfNd ); // TODO
for( int n = 0; n < 2; ++n )
{
- SwClient * pLast = aIter.GoStart();
+ SwClient * pLast = aIter.SwClientIter_First();
if( pLast ) // konnte zum Anfang gesprungen werden ??
{
do {
- if( (0 == n) ^ ( 0 != pLast->ISA( SwCntntFrm )) )
+ if( (0 == n) ^ ( 0 != dynamic_cast< SwCntntFrm* >(pLast)) )
pLast->ModifyNotification( &rItem, &rItem );
- } while( 0 != ( pLast = ++aIter ));
+ } while( 0 != ( pLast = aIter.SwClientIter_Next() ));
}
}
rGrfNd.UnlockModify();
@@ -250,7 +248,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
{
::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() &&
- pLnk->ISA( SwBaseLink ) && pLnk->GetObj() == GetObj() )
+ dynamic_cast< SwBaseLink* >(pLnk) && pLnk->GetObj() == GetObj() )
{
SwBaseLink* pBLink = (SwBaseLink*)pLnk;
SwGrfNode* pGrfNd = (SwGrfNode*)pBLink->pCntntNode;
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index f55d0317d9ca..5c0931969d75 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -35,7 +35,6 @@
#include <svx/svdotext.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdpagv.hxx>
-#include <svx/svdviter.hxx>
#include <svx/svdview.hxx>
#include <svx/shapepropertynotifier.hxx>
#include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
@@ -64,20 +63,21 @@
#include <sortedobjs.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
-#include <svx/sdr/contact/viewcontactofvirtobj.hxx>
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
#include <com/sun/star/text/WritingMode2.hpp>
+#include <svx/svdograf.hxx>
+#include <svx/svddrgv.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
+#include <svx/svdetc.hxx>
#include <switerator.hxx>
#include <algorithm>
using namespace ::com::sun::star;
-TYPEINIT1( SwContact, SwClient )
-TYPEINIT1( SwFlyDrawContact, SwContact )
-TYPEINIT1( SwDrawContact, SwContact )
-
void setContextWritingMode( SdrObject* pObj, SwFrm* pAnchor )
{
if( pObj && pAnchor )
@@ -105,13 +105,13 @@ SwFrmFmt *FindFrmFmt( SdrObject *pObj )
{
SwFrmFmt* pRetval = 0L;
- if ( pObj->ISA(SwVirtFlyDrawObj) )
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
pRetval = ((SwVirtFlyDrawObj*)pObj)->GetFmt();
}
else
{
- SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall( pObj ));
+ SwDrawContact* pContact = static_cast<SwDrawContact*>(findConnectionToSdrObject( pObj ));
if ( pContact )
{
pRetval = pContact->GetFmt();
@@ -150,9 +150,9 @@ sal_Bool HasWrap( const SdrObject* pObj )
SwRect GetBoundRectOfAnchoredObj( const SdrObject* pObj )
// <--
{
- SwRect aRet( pObj->GetCurrentBoundRect() );
+ SwRect aRet( sdr::legacy::GetBoundRect(*pObj) );
// --> OD 2006-08-10 #i68520# - call cache of <SwAnchoredObject>
- SwContact* pContact( GetUserCall( pObj ) );
+ SwContact* pContact( findConnectionToSdrObject( pObj ) );
if ( pContact )
{
const SwAnchoredObject* pAnchoredObj( pContact->GetAnchoredObj( pObj ) );
@@ -165,16 +165,91 @@ SwRect GetBoundRectOfAnchoredObj( const SdrObject* pObj )
return aRet;
}
-//Liefert den UserCall ggf. vom Gruppenobjekt
-// OD 2004-03-31 #i26791# - change return type
-SwContact* GetUserCall( const SdrObject* pObj )
+//////////////////////////////////////////////////////////////////////////////
+// detect and hand back the connected SwContact for a SdrObject
+
+SwContact* findConnectionToSdrObjectDirect(const SdrObject* pSdrObject)
+{
+ if(pSdrObject)
+ {
+ if(pSdrObject->HasListeners())
+ {
+ const sal_uInt16 nListenerCount(pSdrObject->GetListenerCount());
+
+ for(sal_uInt16 a(0); a < nListenerCount; a++)
+ {
+ SfxListener* pCandidate = pSdrObject->GetListener(a);
+
+ if(pCandidate) // not all slots in a broadcaster have to be used
+ {
+ SwContact* pRetval = dynamic_cast< SwContact* >(pCandidate);
+
+ if(pRetval)
+ {
+ return pRetval;
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// same as findConnectionToSdrObjectDirect, but with traveling up the object hierarchy
+// to get the connection for the outmost containing GroupObject
+
+SwContact* findConnectionToSdrObject( const SdrObject* pObj )
+{
+ while(pObj)
+ {
+ SwContact* pRetval = findConnectionToSdrObjectDirect(pObj);
+
+ if(pRetval)
+ {
+ return pRetval;
+ }
+
+ pObj = pObj->GetParentSdrObject();
+ }
+
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// connect to given SdrObject. All existing connections are deleted, a single
+// new one gets established
+
+void establishConnectionToSdrObject(SdrObject* pSdrObject, SwContact* pSwContact)
+{
+ if(pSdrObject)
+ {
+ // remove all SwContacts
+ resetConnectionToSdrObject(pSdrObject);
+
+ if(pSwContact)
+ {
+ pSwContact->StartListening(*pSdrObject);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// all connections (should be a single one) to the SdrObject are removed
+
+void resetConnectionToSdrObject(SdrObject* pSdrObject)
{
- SdrObject *pTmp;
- while ( !pObj->GetUserCall() && 0 != (pTmp = pObj->GetUpGroup()) )
- pObj = pTmp;
- ASSERT( !pObj->GetUserCall() || pObj->GetUserCall()->ISA(SwContact),
- "<::GetUserCall(..)> - wrong type of found object user call." );
- return static_cast<SwContact*>(pObj->GetUserCall());
+ if(pSdrObject)
+ {
+ SwContact* pFound = findConnectionToSdrObjectDirect(pSdrObject);
+
+ while(pFound)
+ {
+ pFound->EndListening(*pSdrObject);
+ pFound = findConnectionToSdrObjectDirect(pSdrObject);
+ }
+ }
}
// liefert sal_True falls das SrdObject ein Marquee-Object (Lauftext) ist
@@ -332,7 +407,7 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
SdrLayerID nFromControlLayerId =
_bToVisible ? pIDDMA->GetInvisibleControlsId() : pIDDMA->GetControlsId();
- if ( _pDrawObj->ISA( SdrObjGroup ) )
+ if ( dynamic_cast< SdrObjGroup* >(_pDrawObj) )
{
// determine layer for group object
{
@@ -353,16 +428,15 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
}
// set layer at group object, but do *not* broadcast and
// no propagation to the members.
- // Thus, call <NbcSetLayer(..)> at super class
- _pDrawObj->SdrObject::NbcSetLayer( nNewLayerId );
+ // Thus, call <SetLayer(..)> at super class
+ _pDrawObj->SdrObject::SetLayer( nNewLayerId );
}
// call method recursively for group object members
- const SdrObjList* pLst =
- static_cast<SdrObjGroup*>(_pDrawObj)->GetSubList();
+ const SdrObjList* pLst = _pDrawObj->getChildrenOfSdrObject();
if ( pLst )
{
- for ( sal_uInt16 i = 0; i < pLst->GetObjCount(); ++i )
+ for ( sal_uInt32 i = 0; i < pLst->GetObjCount(); ++i )
{
_MoveObjToLayer( _bToVisible, pLst->GetObj( i ) );
}
@@ -410,7 +484,7 @@ sal_uInt32 SwContact::GetMinOrdNum() const
while ( !aObjs.empty() )
{
- sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetOrdNum();
+ sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetNavigationPosition();
if ( nTmpOrdNum < nMinOrdNum )
{
@@ -440,7 +514,7 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
while ( !aObjs.empty() )
{
- sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetOrdNum();
+ sal_uInt32 nTmpOrdNum = aObjs.back()->GetDrawObj()->GetNavigationPosition();
if ( nTmpOrdNum > nMaxOrdNum )
{
@@ -463,24 +537,24 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
|*
|*************************************************************************/
-SwFlyDrawContact::SwFlyDrawContact( SwFlyFrmFmt *pToRegisterIn, SdrModel * ) :
+SwFlyDrawContact::SwFlyDrawContact( SwFlyFrmFmt *pToRegisterIn, SdrModel& rTargetModel ) :
SwContact( pToRegisterIn )
{
// OD 2004-04-01 #i26791# - class <SwFlyDrawContact> contains the 'master'
// drawing object of type <SwFlyDrawObj> on its own.
- mpMasterObj = new SwFlyDrawObj;
- mpMasterObj->SetOrdNum( 0xFFFFFFFE );
- mpMasterObj->SetUserCall( this );
+ mpMasterObj = new SwFlyDrawObj(rTargetModel);
+ // TTTT: makes no sense, object is not added to a SdrObjList: mpMasterObj->SetOrdNum( 0xFFFFFFFE );
+ establishConnectionToSdrObject(mpMasterObj, this);
}
SwFlyDrawContact::~SwFlyDrawContact()
{
if ( mpMasterObj )
{
- mpMasterObj->SetUserCall( 0 );
- if ( mpMasterObj->GetPage() )
- mpMasterObj->GetPage()->RemoveObject( mpMasterObj->GetOrdNum() );
- delete mpMasterObj;
+ resetConnectionToSdrObject(mpMasterObj);
+ if ( mpMasterObj->getParentOfSdrObject() )
+ mpMasterObj->getParentOfSdrObject()->RemoveObjectFromSdrObjList( mpMasterObj->GetNavigationPosition() );
+ deleteSdrObjectSafeAndClearPointer(mpMasterObj);
}
}
@@ -489,14 +563,14 @@ const SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( const SdrObject* _pSdr
{
ASSERT( _pSdrObj,
"<SwFlyDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwVirtFlyDrawObj),
+ ASSERT( dynamic_cast< const SwVirtFlyDrawObj* >(_pSdrObj),
"<SwFlyDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
- ASSERT( GetUserCall( _pSdrObj ) == const_cast<SwFlyDrawContact*>(this),
+ ASSERT( findConnectionToSdrObject( _pSdrObj ) == const_cast<SwFlyDrawContact*>(this),
"<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
const SwAnchoredObject* pRetAnchoredObj = 0L;
- if ( _pSdrObj && _pSdrObj->ISA(SwVirtFlyDrawObj) )
+ if ( _pSdrObj && dynamic_cast< const SwVirtFlyDrawObj* >(_pSdrObj) )
{
pRetAnchoredObj = static_cast<const SwVirtFlyDrawObj*>(_pSdrObj)->GetFlyFrm();
}
@@ -508,14 +582,14 @@ SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( SdrObject* _pSdrObj )
{
ASSERT( _pSdrObj,
"<SwFlyDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwVirtFlyDrawObj),
+ ASSERT( dynamic_cast< SwVirtFlyDrawObj* >(_pSdrObj),
"<SwFlyDrawContact::GetAnchoredObj(..)> - wrong object type provided" );
- ASSERT( GetUserCall( _pSdrObj ) == this,
+ ASSERT( findConnectionToSdrObject( _pSdrObj ) == this,
"<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
SwAnchoredObject* pRetAnchoredObj = 0L;
- if ( _pSdrObj && _pSdrObj->ISA(SwVirtFlyDrawObj) )
+ if ( _pSdrObj && dynamic_cast< SwVirtFlyDrawObj* >(_pSdrObj) )
{
pRetAnchoredObj = static_cast<SwVirtFlyDrawObj*>(_pSdrObj)->GetFlyFrm();
}
@@ -535,7 +609,7 @@ SdrObject* SwFlyDrawContact::GetMaster()
void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
{
- ASSERT( _pNewMaster->ISA(SwFlyDrawObj),
+ ASSERT( dynamic_cast< SwFlyDrawObj* >(_pNewMaster),
"<SwFlyDrawContact::SetMaster(..)> - wrong type of new master object" );
mpMasterObj = static_cast<SwFlyDrawObj *>(_pNewMaster);
}
@@ -558,7 +632,7 @@ void SwFlyDrawContact::Modify( const SfxPoolItem*, const SfxPoolItem * )
// Writer fly frame are also made visible.
void SwFlyDrawContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
{
- ASSERT( _pDrawObj->ISA(SwVirtFlyDrawObj),
+ ASSERT( dynamic_cast< SwVirtFlyDrawObj* >(_pDrawObj),
"<SwFlyDrawContact::MoveObjToVisibleLayer(..)> - wrong SdrObject type -> crash" );
if ( GetFmt()->getIDocumentDrawModelAccess()->IsVisibleLayerId( _pDrawObj->GetLayer() ) )
@@ -583,7 +657,7 @@ void SwFlyDrawContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
{
// --> OD 2004-07-01 #i28701# - consider type of objects in sorted object list.
SdrObject* pObj = (*pFlyFrm->GetDrawObjs())[i]->DrawObj();
- SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
+ SwContact* pContact = static_cast<SwContact*>(findConnectionToSdrObjectDirect(pObj));
pContact->MoveObjToVisibleLayer( pObj );
}
}
@@ -597,7 +671,7 @@ void SwFlyDrawContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
// Writer fly frame are also made invisible.
void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
{
- ASSERT( _pDrawObj->ISA(SwVirtFlyDrawObj),
+ ASSERT( dynamic_cast< SwVirtFlyDrawObj* >(_pDrawObj),
"<SwFlyDrawContact::MoveObjToInvisibleLayer(..)> - wrong SdrObject type -> crash" );
if ( !GetFmt()->getIDocumentDrawModelAccess()->IsVisibleLayerId( _pDrawObj->GetLayer() ) )
@@ -616,7 +690,7 @@ void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
{
// --> OD 2004-07-01 #i28701# - consider type of objects in sorted object list.
SdrObject* pObj = (*pFlyFrm->GetDrawObjs())[i]->DrawObj();
- SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
+ SwContact* pContact = static_cast<SwContact*>(findConnectionToSdrObjectDirect(pObj));
pContact->MoveObjToInvisibleLayer( pObj );
}
}
@@ -649,10 +723,10 @@ bool CheckControlLayer( const SdrObject *pObj )
{
if ( FmFormInventor == pObj->GetObjInventor() )
return true;
- if ( pObj->ISA( SdrObjGroup ) )
+ if ( dynamic_cast< const SdrObjGroup* >(pObj) )
{
- const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
- for ( sal_uInt16 i = 0; i < pLst->GetObjCount(); ++i )
+ const SdrObjList *pLst = pObj->getChildrenOfSdrObject();
+ for ( sal_uInt32 i = 0; i < pLst->GetObjCount(); ++i )
{
if ( ::CheckControlLayer( pLst->GetObj( i ) ) )
{
@@ -668,24 +742,19 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
SwContact( pToRegisterIn ),
maAnchoredDrawObj(),
mbMasterObjCleared( false ),
- // OD 10.10.2003 #112299#
mbDisconnectInProgress( false ),
- // --> OD 2006-01-18 #129959#
- mbUserCallActive( false ),
- // Note: value of <meEventTypeOfCurrentUserCall> isn't of relevance, because
- // <mbUserCallActive> is sal_False.
- meEventTypeOfCurrentUserCall( SDRUSERCALL_MOVEONLY )
- // <--
+ mbNotifyActive( false ),
+ meEventTypeOfCurrentUserCall(HINT_OBJCHG_MOVE)
{
// clear list containing 'virtual' drawing objects.
maDrawVirtObjs.clear();
// --> OD 2004-09-22 #i33909# - assure, that drawing object is inserted
// in the drawing page.
- if ( !pObj->IsInserted() )
+ if ( !pObj->IsObjectInserted() )
{
pToRegisterIn->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
- InsertObject( pObj, pObj->GetOrdNumDirect() );
+ InsertObjectToSdrObjList(*pObj, pObj->GetNavigationPosition() );
}
// <--
@@ -698,7 +767,7 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
}
// OD 2004-03-29 #i26791#
- pObj->SetUserCall( this );
+ establishConnectionToSdrObject(pObj, this);
maAnchoredDrawObj.SetDrawObj( *pObj );
// if there already exists an SwXShape for the object, ensure it knows about us, and the SdrObject
@@ -722,7 +791,7 @@ SwDrawContact::~SwDrawContact()
if ( !mbMasterObjCleared )
{
SdrObject* pObject = const_cast< SdrObject* >( maAnchoredDrawObj.GetDrawObj() );
- SdrObject::Free( pObject );
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
}
@@ -731,33 +800,34 @@ void SwDrawContact::GetTextObjectsFromFmt( std::list<SdrTextObj*>& rTextObjects,
for( sal_Int32 n=0; n<pDoc->GetSpzFrmFmts()->Count(); n++ )
{
SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[n];
- if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
+ if( dynamic_cast< SwDrawFrmFmt* >(pFly) )
{
- std::list<SdrTextObj*> aTextObjs;
SwDrawContact* pContact = SwIterator<SwDrawContact,SwFrmFmt>::FirstElement(*pFly);
if( pContact )
{
SdrObject* pSdrO = pContact->GetMaster();
+
if ( pSdrO )
{
- if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pSdrO);
+
+ if ( pSdrO->getChildrenOfSdrObject() )
{
- SdrObjListIter aListIter( *pSdrO, IM_DEEPNOGROUPS );
+ SdrObjListIter aListIter( *pSdrO->getChildrenOfSdrObject(), IM_DEEPNOGROUPS );
//iterate inside of a grouped object
while( aListIter.IsMore() )
{
- SdrObject* pSdrOElement = aListIter.Next();
- if( pSdrOElement && pSdrOElement->IsA( TYPE(SdrTextObj) ) &&
- static_cast<SdrTextObj*>( pSdrOElement)->HasText() )
+ SdrTextObj* pSdrOElement = dynamic_cast< SdrTextObj* >(aListIter.Next());
+
+ if( pSdrOElement && pSdrOElement->HasText() )
{
- rTextObjects.push_back((SdrTextObj*) pSdrOElement);
+ rTextObjects.push_back(pSdrOElement);
}
}
}
- else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
- static_cast<SdrTextObj*>( pSdrO )->HasText() )
+ else if( pSdrTextObj && pSdrTextObj->HasText() )
{
- rTextObjects.push_back((SdrTextObj*) pSdrO);
+ rTextObjects.push_back(pSdrTextObj);
}
}
}
@@ -776,10 +846,7 @@ const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj
ASSERT( _pSdrObj,
"<SwDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwDrawVirtObj) ||
- ( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) ),
- "<SwDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
- ASSERT( GetUserCall( _pSdrObj ) == const_cast<SwDrawContact*>(this) ||
+ ASSERT( findConnectionToSdrObject( _pSdrObj ) == const_cast<SwDrawContact*>(this) ||
_pSdrObj == GetMaster(),
"<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
@@ -787,11 +854,11 @@ const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj
if ( _pSdrObj )
{
- if ( _pSdrObj->ISA(SwDrawVirtObj) )
+ if ( dynamic_cast< const SwDrawVirtObj* >(_pSdrObj) )
{
pRetAnchoredObj = static_cast<const SwDrawVirtObj*>(_pSdrObj)->GetAnchoredObj();
}
- else if ( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) )
+ else
{
pRetAnchoredObj = &maAnchoredDrawObj;
}
@@ -810,21 +877,18 @@ SwAnchoredObject* SwDrawContact::GetAnchoredObj( SdrObject* _pSdrObj )
ASSERT( _pSdrObj,
"<SwDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwDrawVirtObj) ||
- ( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) ),
- "<SwDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
- ASSERT( GetUserCall( _pSdrObj ) == this || _pSdrObj == GetMaster(),
+ ASSERT( findConnectionToSdrObject( _pSdrObj ) == this || _pSdrObj == GetMaster(),
"<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
SwAnchoredObject* pRetAnchoredObj = 0L;
if ( _pSdrObj )
{
- if ( _pSdrObj->ISA(SwDrawVirtObj) )
+ if ( dynamic_cast< SwDrawVirtObj* >(_pSdrObj) )
{
pRetAnchoredObj = static_cast<SwDrawVirtObj*>(_pSdrObj)->AnchoredObj();
}
- else if ( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) )
+ else
{
pRetAnchoredObj = &maAnchoredDrawObj;
}
@@ -872,12 +936,12 @@ const SwFrm* SwDrawContact::GetAnchorFrm( const SdrObject* _pDrawObj ) const
const SwFrm* pAnchorFrm = 0L;
if ( !_pDrawObj ||
_pDrawObj == GetMaster() ||
- ( !_pDrawObj->GetUserCall() &&
- GetUserCall( _pDrawObj ) == static_cast<const SwContact* const>(this) ) )
+ ( !findConnectionToSdrObjectDirect(_pDrawObj) &&
+ findConnectionToSdrObject( _pDrawObj ) == static_cast<const SwContact* const>(this) ) )
{
pAnchorFrm = maAnchoredDrawObj.GetAnchorFrm();
}
- else if ( _pDrawObj->ISA(SwDrawVirtObj) )
+ else if ( dynamic_cast< const SwDrawVirtObj* >(_pDrawObj) )
{
pAnchorFrm = static_cast<const SwDrawVirtObj*>(_pDrawObj)->GetAnchorFrm();
}
@@ -894,14 +958,14 @@ SwFrm* SwDrawContact::GetAnchorFrm( SdrObject* _pDrawObj )
SwFrm* pAnchorFrm = 0L;
if ( !_pDrawObj ||
_pDrawObj == GetMaster() ||
- ( !_pDrawObj->GetUserCall() &&
- GetUserCall( _pDrawObj ) == this ) )
+ ( !findConnectionToSdrObjectDirect(_pDrawObj) &&
+ findConnectionToSdrObject( _pDrawObj ) == this ) )
{
pAnchorFrm = maAnchoredDrawObj.AnchorFrm();
}
else
{
- ASSERT( _pDrawObj->ISA(SwDrawVirtObj),
+ ASSERT( dynamic_cast< SwDrawVirtObj* >(_pDrawObj),
"<SwDrawContact::GetAnchorFrm(..)> - unknown drawing object." )
pAnchorFrm = static_cast<SwDrawVirtObj*>(_pDrawObj)->AnchorFrm();
}
@@ -931,8 +995,7 @@ void SwDrawContact::DestroyVirtObj( SwDrawVirtObj* _pVirtObj )
{
if ( _pVirtObj )
{
- delete _pVirtObj;
- _pVirtObj = 0;
+ deleteSdrObjectSafeAndClearPointer(_pVirtObj);
}
}
@@ -1063,8 +1126,6 @@ SdrObject* SwDrawContact::GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm )
/*************************************************************************
|*
-|* SwDrawContact::Changed
-|*
|* Ersterstellung MA 09. Jan. 95
|* Letzte Aenderung MA 29. May. 96
|*
@@ -1086,7 +1147,8 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
if( pOldBoundRect && pPage )
{
SwRect aOldRect( *pOldBoundRect );
- aOldRect.Pos() += pDrawVirtObj->GetOffset();
+ const Point aPointOffset(basegfx::fround(pDrawVirtObj->GetOffset().getX()), basegfx::fround(pDrawVirtObj->GetOffset().getX()));
+ aOldRect.Pos() += aPointOffset;
if( aOldRect.HasArea() )
::Notify_Background( pDrawVirtObj, pPage,
aOldRect, PREP_FLY_LEAVE,sal_True);
@@ -1147,9 +1209,9 @@ void lcl_NotifyBackgroundOfObj( SwDrawContact& _rDrawContact,
}
}
-void SwDrawContact::Changed( const SdrObject& rObj,
- SdrUserCallType eType,
- const Rectangle& rOldBoundRect )
+void SwDrawContact::HandleChanged(
+ const SdrObject& rObj,
+ SdrHintKind eHint)
{
// OD 2004-06-01 #i26791# - no event handling, if existing <ViewShell>
// is in contruction
@@ -1162,8 +1224,8 @@ void SwDrawContact::Changed( const SdrObject& rObj,
// --> OD 2005-03-08 #i44339#
// no event handling, if document is in destruction.
- // Exception: It's the SDRUSERCALL_DELETE event
- if ( pDoc->IsInDtor() && eType != SDRUSERCALL_DELETE )
+ // Exception: It's the HINT_SDROBJECTDYING event
+ if ( pDoc->IsInDtor() && eHint != HINT_SDROBJECTDYING )
{
return;
}
@@ -1188,31 +1250,75 @@ void SwDrawContact::Changed( const SdrObject& rObj,
if ( pSh )
pTmpRoot->StartAllAction();
}
- SdrObjUserCall::Changed( rObj, eType, rOldBoundRect );
- _Changed( rObj, eType, &rOldBoundRect ); //Achtung, ggf. Suizid!
+
+ const SdrObjGroup* pGroup = 0;
+
+ if(rObj.getParentOfSdrObject())
+ {
+ pGroup = dynamic_cast< const SdrObjGroup* >(rObj.getParentOfSdrObject()->getSdrObjectFromSdrObjList());
+ }
+
+ _Changed( rObj, eHint, false ); //Achtung, ggf. Suizid!
+
+ while(pGroup)
+ {
+ if(findConnectionToSdrObjectDirect(pGroup) && findConnectionToSdrObjectDirect(pGroup) == this)
+ {
+ _Changed( *pGroup, eHint, true );
+ }
+
+ SdrObjGroup* pUpGroup = 0;
+
+ if(pGroup->getParentOfSdrObject())
+ {
+ pUpGroup = dynamic_cast< SdrObjGroup* >(pGroup->getParentOfSdrObject()->getSdrObjectFromSdrObjList());
+
+ if(pGroup == pUpGroup)
+ {
+ pUpGroup = 0;
+ }
+ }
+
+ pGroup = pUpGroup;
+ }
if ( pSh )
pTmpRoot->EndAllAction();
}
+void SwDrawContact::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+ const SdrBaseHint* pSdrBaseHint = dynamic_cast< const SdrBaseHint* >(&rHint);
+
+ if(pSdrBaseHint)
+ {
+ const SdrObject* pObj = pSdrBaseHint->GetSdrHintObject();
+
+ if(pObj)
+ {
+ HandleChanged(*pObj, pSdrBaseHint->GetSdrHintKind());
+ }
+ }
+}
+
// --> OD 2006-01-18 #129959#
// helper class for method <SwDrawContact::_Changed(..)> for handling nested
-// <SdrObjUserCall> events
+// <SfxBroadcaster/Listener/Notify> events
class NestedUserCallHdl
{
private:
SwDrawContact* mpDrawContact;
bool mbParentUserCallActive;
- SdrUserCallType meParentUserCallEventType;
+ SdrHintKind meParentUserCallEventType;
public:
NestedUserCallHdl( SwDrawContact* _pDrawContact,
- SdrUserCallType _eEventType )
+ SdrHintKind _eEventType )
: mpDrawContact( _pDrawContact ),
- mbParentUserCallActive( _pDrawContact->mbUserCallActive ),
+ mbParentUserCallActive( _pDrawContact->mbNotifyActive ),
meParentUserCallEventType( _pDrawContact->meEventTypeOfCurrentUserCall )
{
- mpDrawContact->mbUserCallActive = true;
+ mpDrawContact->mbNotifyActive = true;
mpDrawContact->meEventTypeOfCurrentUserCall = _eEventType;
}
@@ -1220,7 +1326,7 @@ class NestedUserCallHdl
{
if ( mpDrawContact )
{
- mpDrawContact->mbUserCallActive = mbParentUserCallActive;
+ mpDrawContact->mbNotifyActive = mbParentUserCallActive;
mpDrawContact->meEventTypeOfCurrentUserCall = meParentUserCallEventType;
}
}
@@ -1240,21 +1346,14 @@ class NestedUserCallHdl
if ( IsNestedUserCall() )
{
bool bTmpAssert( true );
- // Currently its known, that a nested event SDRUSERCALL_RESIZE
- // could occur during parent user call SDRUSERCALL_INSERTED,
- // SDRUSERCALL_DELETE and SDRUSERCALL_RESIZE for edge objects.
- // Also possible are nested SDRUSERCALL_CHILD_RESIZE events for
- // edge objects
+ // Currently its known, that a nested event HINT_OBJCHG_RESIZE
+ // could occur during parent user call HINT_OBJINSERTED,
+ // HINT_SDROBJECTDYING and HINT_OBJCHG_RESIZE for edge objects.
// Thus, assert all other combinations
- if ( ( meParentUserCallEventType == SDRUSERCALL_INSERTED ||
- meParentUserCallEventType == SDRUSERCALL_DELETE ||
- meParentUserCallEventType == SDRUSERCALL_RESIZE ) &&
- mpDrawContact->meEventTypeOfCurrentUserCall == SDRUSERCALL_RESIZE )
- {
- bTmpAssert = false;
- }
- else if ( meParentUserCallEventType == SDRUSERCALL_CHILD_RESIZE &&
- mpDrawContact->meEventTypeOfCurrentUserCall == SDRUSERCALL_CHILD_RESIZE )
+ if ( ( meParentUserCallEventType == HINT_OBJINSERTED ||
+ meParentUserCallEventType == HINT_SDROBJECTDYING ||
+ meParentUserCallEventType == HINT_OBJCHG_RESIZE) &&
+ mpDrawContact->meEventTypeOfCurrentUserCall == HINT_OBJCHG_RESIZE)
{
bTmpAssert = false;
}
@@ -1272,13 +1371,14 @@ class NestedUserCallHdl
//
// !!!ACHTUNG!!! The object may commit suicide!!!
//
-void SwDrawContact::_Changed( const SdrObject& rObj,
- SdrUserCallType eType,
- const Rectangle* pOldBoundRect )
+void SwDrawContact::_Changed(
+ const SdrObject& rObj,
+ SdrHintKind eHint,
+ bool bGroupHierarchy)
{
// --> OD 2006-01-18 #129959#
- // suppress handling of nested <SdrObjUserCall> events
- NestedUserCallHdl aNestedUserCallHdl( this, eType );
+ // suppress handling of nested <SfxBroadcaster/Listener/Notify> events
+ NestedUserCallHdl aNestedUserCallHdl( this, eHint );
if ( aNestedUserCallHdl.IsNestedUserCall() )
{
aNestedUserCallHdl.AssertNestedUserCall();
@@ -1295,17 +1395,149 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
const bool bNotify = !(GetFmt()->GetDoc()->IsInDtor()) &&
( SURROUND_THROUGHT != GetFmt()->GetSurround().GetSurround() ) &&
!bAnchoredAsChar;
- // <--
- switch( eType )
+ const SwAnchoredDrawObject* pAnchoredDrawObj =
+ static_cast<const SwAnchoredDrawObject*>( GetAnchoredObj( &rObj ) );
+ const Rectangle aOldObjRect = pAnchoredDrawObj ? pAnchoredDrawObj->GetLastObjRect() : Rectangle();
+
+ if(bGroupHierarchy
+ || HINT_OBJCHG_MOVE == eHint
+ || HINT_OBJCHG_RESIZE == eHint)
+ {
+ // OD 2004-04-06 #i26791# - adjust positioning and alignment attributes,
+ // if positioning of drawing object isn't in progress.
+ // --> OD 2005-08-15 #i53320# - no adjust of positioning attributes,
+ // if drawing object isn't positioned.
+ if ( !pAnchoredDrawObj->IsPositioningInProgress() &&
+ !pAnchoredDrawObj->NotYetPositioned() )
+ // <--
+ {
+ // --> OD 2008-02-18 #i79400#
+ // always invalidate object rectangle inclusive spaces
+ pAnchoredDrawObj->InvalidateObjRectWithSpaces();
+ // <--
+ // --> OD 2005-01-28 #i41324# - notify background before
+ // adjusting position
+ if ( bNotify )
+ {
+ // --> OD 2004-07-20 #i31573# - correction: Only invalidate
+ // background of given drawing object.
+ lcl_NotifyBackgroundOfObj( *this, rObj, &aOldObjRect );
+ }
+ // <--
+ // --> OD 2004-08-04 #i31698# - determine layout direction
+ // via draw frame format.
+ SwFrmFmt::tLayoutDir eLayoutDir =
+ pAnchoredDrawObj->GetFrmFmt().GetLayoutDir();
+ // <--
+ // use geometry of drawing object
+ Rectangle aObjRect(sdr::legacy::GetSnapRect(rObj));
+ // If drawing object is a member of a group, the adjustment
+ // of the positioning and the alignment attributes has to
+ // be done for the top group object.
+ if ( rObj.GetParentSdrObject() )
+ {
+ const SdrObject* pGroupObj = rObj.GetParentSdrObject();
+ while ( pGroupObj->GetParentSdrObject() )
+ {
+ pGroupObj = pGroupObj->GetParentSdrObject();
+ }
+ // use geometry of drawing object
+ aObjRect = sdr::legacy::GetSnapRect(*pGroupObj);
+ }
+ SwTwips nXPosDiff(0L);
+ SwTwips nYPosDiff(0L);
+ switch ( eLayoutDir )
+ {
+ case SwFrmFmt::HORI_L2R:
+ {
+ nXPosDiff = aObjRect.Left() - aOldObjRect.Left();
+ nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
+ }
+ break;
+ case SwFrmFmt::HORI_R2L:
+ {
+ nXPosDiff = aOldObjRect.Right() - aObjRect.Right();
+ nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
+ }
+ break;
+ case SwFrmFmt::VERT_R2L:
+ {
+ nXPosDiff = aObjRect.Top() - aOldObjRect.Top();
+ nYPosDiff = aOldObjRect.Right() - aObjRect.Right();
+ }
+ break;
+ default:
+ {
+ ASSERT( false,
+ "<SwDrawContact::_Changed(..)> - unsupported layout direction" );
+ }
+ }
+ SfxItemSet aSet( GetFmt()->GetDoc()->GetAttrPool(),
+ RES_VERT_ORIENT, RES_HORI_ORIENT, 0 );
+ const SwFmtVertOrient& rVert = GetFmt()->GetVertOrient();
+ if ( nYPosDiff != 0 )
+ {
+
+ if ( rVert.GetRelationOrient() == text::RelOrientation::CHAR ||
+ rVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
+ {
+ nYPosDiff = -nYPosDiff;
+ }
+ aSet.Put( SwFmtVertOrient( rVert.GetPos()+nYPosDiff,
+ text::VertOrientation::NONE,
+ rVert.GetRelationOrient() ) );
+ }
+
+ const SwFmtHoriOrient& rHori = GetFmt()->GetHoriOrient();
+ if ( !bAnchoredAsChar && nXPosDiff != 0 )
+ {
+ aSet.Put( SwFmtHoriOrient( rHori.GetPos()+nXPosDiff,
+ text::HoriOrientation::NONE,
+ rHori.GetRelationOrient() ) );
+ }
+
+ if ( nYPosDiff ||
+ ( !bAnchoredAsChar && nXPosDiff != 0 ) )
+ {
+ GetFmt()->GetDoc()->SetFlyFrmAttr( *(GetFmt()), aSet );
+ // keep new object rectangle, to avoid multiple
+ // changes of the attributes by multiple event from
+ // the drawing layer - e.g. group objects and its members
+ // --> OD 2004-09-29 #i34748# - use new method
+ // <SwAnchoredDrawObject::SetLastObjRect(..)>.
+ const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)->SetLastObjRect(aObjRect);
+ }
+ else if(aObjRect.GetSize() != aOldObjRect.GetSize())
+ {
+ _InvalidateObjs();
+ // --> OD 2004-11-11 #i35007# - notify anchor frame
+ // of as-character anchored object
+ {
+ //-->Modified for i119654,2012.6.8
+ SwFrm* pAnchorFrame = pAnchoredDrawObj
+ ? const_cast<SwAnchoredDrawObject*>( pAnchoredDrawObj )->AnchorFrm()
+ : NULL;
+ if ( pAnchorFrame )
+ {
+ pAnchorFrame->Prepare( PREP_FLY_ATTR_CHG, GetFmt() );
+ }
+ //<--
+ }
+ }
+ }
+ }
+ else
{
- case SDRUSERCALL_DELETE:
+ switch(eHint)
+ {
+ case HINT_SDROBJECTDYING:
{
if ( bNotify )
{
- lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
+ lcl_NotifyBackgroundOfObj( *this, rObj, &aOldObjRect );
// --> OD 2004-10-27 #i36181# - background of 'virtual'
// drawing objects have also been notified.
- NotifyBackgrdOfAllVirtObjs( pOldBoundRect );
+ NotifyBackgrdOfAllVirtObjs( &aOldObjRect );
// <--
}
DisconnectFromLayout( false );
@@ -1316,7 +1548,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
// <--
break;
}
- case SDRUSERCALL_INSERTED:
+ case HINT_OBJINSERTED:
{
// OD 10.10.2003 #112299#
if ( mbDisconnectInProgress )
@@ -1329,221 +1561,31 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
ConnectToLayout();
if ( bNotify )
{
- lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
+ lcl_NotifyBackgroundOfObj( *this, rObj, &aOldObjRect);
}
}
break;
}
- case SDRUSERCALL_REMOVED:
+ case HINT_OBJREMOVED:
{
if ( bNotify )
{
- lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
+ lcl_NotifyBackgroundOfObj(*this, rObj, &aOldObjRect);
}
DisconnectFromLayout( false );
break;
}
- case SDRUSERCALL_CHILD_INSERTED :
- case SDRUSERCALL_CHILD_REMOVED :
- {
- // --> AW, OD 2010-09-13 #i113730#
- // force layer of controls for group objects containing control objects
- if(dynamic_cast< SdrObjGroup* >(maAnchoredDrawObj.DrawObj()))
+ case HINT_OBJCHG_ATTR:
{
- if(::CheckControlLayer(maAnchoredDrawObj.DrawObj()))
- {
- const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
- const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer());
- const SdrLayerID aControlLayerID(pIDDMA->GetControlsId());
- const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId());
-
- if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID)
- {
- if ( aCurrentLayer == pIDDMA->GetInvisibleHellId() ||
- aCurrentLayer == pIDDMA->GetInvisibleHeavenId() )
- {
- maAnchoredDrawObj.DrawObj()->SetLayer(aInvisibleControlLayerID);
- }
- else
- {
- maAnchoredDrawObj.DrawObj()->SetLayer(aControlLayerID);
- }
- }
- }
- }
- // fallthrough intended here
- // <--
- }
- case SDRUSERCALL_MOVEONLY:
- case SDRUSERCALL_RESIZE:
- case SDRUSERCALL_CHILD_MOVEONLY :
- case SDRUSERCALL_CHILD_RESIZE :
- case SDRUSERCALL_CHILD_CHGATTR :
- case SDRUSERCALL_CHILD_DELETE :
- case SDRUSERCALL_CHILD_COPY :
- {
- // --> OD 2004-08-04 #i31698# - improvement:
- // get instance <SwAnchoredDrawObject> only once
- const SwAnchoredDrawObject* pAnchoredDrawObj =
- static_cast<const SwAnchoredDrawObject*>( GetAnchoredObj( &rObj ) );
- // <--
- // OD 2004-04-06 #i26791# - adjust positioning and alignment attributes,
- // if positioning of drawing object isn't in progress.
- // --> OD 2005-08-15 #i53320# - no adjust of positioning attributes,
- // if drawing object isn't positioned.
- if ( !pAnchoredDrawObj->IsPositioningInProgress() &&
- !pAnchoredDrawObj->NotYetPositioned() )
- // <--
- {
- // --> OD 2004-09-29 #i34748# - If no last object rectangle is
- // provided by the anchored object, use parameter <pOldBoundRect>.
- const Rectangle& aOldObjRect = pAnchoredDrawObj->GetLastObjRect()
- ? *(pAnchoredDrawObj->GetLastObjRect())
- : *(pOldBoundRect);
- // <--
- // --> OD 2008-02-18 #i79400#
- // always invalidate object rectangle inclusive spaces
- pAnchoredDrawObj->InvalidateObjRectWithSpaces();
- // <--
- // --> OD 2005-01-28 #i41324# - notify background before
- // adjusting position
if ( bNotify )
{
- // --> OD 2004-07-20 #i31573# - correction: Only invalidate
- // background of given drawing object.
- lcl_NotifyBackgroundOfObj( *this, rObj, &aOldObjRect );
- }
- // <--
- // --> OD 2004-08-04 #i31698# - determine layout direction
- // via draw frame format.
- SwFrmFmt::tLayoutDir eLayoutDir =
- pAnchoredDrawObj->GetFrmFmt().GetLayoutDir();
- // <--
- // use geometry of drawing object
- SwRect aObjRect( rObj.GetSnapRect() );
- // If drawing object is a member of a group, the adjustment
- // of the positioning and the alignment attributes has to
- // be done for the top group object.
- if ( rObj.GetUpGroup() )
- {
- const SdrObject* pGroupObj = rObj.GetUpGroup();
- while ( pGroupObj->GetUpGroup() )
- {
- pGroupObj = pGroupObj->GetUpGroup();
- }
- // use geometry of drawing object
- aObjRect = pGroupObj->GetSnapRect();
- }
- SwTwips nXPosDiff(0L);
- SwTwips nYPosDiff(0L);
- switch ( eLayoutDir )
- {
- case SwFrmFmt::HORI_L2R:
- {
- nXPosDiff = aObjRect.Left() - aOldObjRect.Left();
- nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
- }
- break;
- case SwFrmFmt::HORI_R2L:
- {
- nXPosDiff = aOldObjRect.Right() - aObjRect.Right();
- nYPosDiff = aObjRect.Top() - aOldObjRect.Top();
- }
- break;
- case SwFrmFmt::VERT_R2L:
- {
- nXPosDiff = aObjRect.Top() - aOldObjRect.Top();
- nYPosDiff = aOldObjRect.Right() - aObjRect.Right();
- }
- break;
- default:
- {
- ASSERT( false,
- "<SwDrawContact::_Changed(..)> - unsupported layout direction" );
- }
- }
- SfxItemSet aSet( GetFmt()->GetDoc()->GetAttrPool(),
- RES_VERT_ORIENT, RES_HORI_ORIENT, 0 );
- const SwFmtVertOrient& rVert = GetFmt()->GetVertOrient();
- if ( nYPosDiff != 0 )
- {
-
- if ( rVert.GetRelationOrient() == text::RelOrientation::CHAR ||
- rVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
- {
- nYPosDiff = -nYPosDiff;
- }
- aSet.Put( SwFmtVertOrient( rVert.GetPos()+nYPosDiff,
- text::VertOrientation::NONE,
- rVert.GetRelationOrient() ) );
- }
-
- const SwFmtHoriOrient& rHori = GetFmt()->GetHoriOrient();
- if ( !bAnchoredAsChar && nXPosDiff != 0 )
- {
- aSet.Put( SwFmtHoriOrient( rHori.GetPos()+nXPosDiff,
- text::HoriOrientation::NONE,
- rHori.GetRelationOrient() ) );
- }
-
- if ( nYPosDiff ||
- ( !bAnchoredAsChar && nXPosDiff != 0 ) )
- {
- GetFmt()->GetDoc()->SetFlyFrmAttr( *(GetFmt()), aSet );
- // keep new object rectangle, to avoid multiple
- // changes of the attributes by multiple event from
- // the drawing layer - e.g. group objects and its members
- // --> OD 2004-09-29 #i34748# - use new method
- // <SwAnchoredDrawObject::SetLastObjRect(..)>.
- const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
- ->SetLastObjRect( aObjRect.SVRect() );
- }
- else if ( aObjRect.SSize() != aOldObjRect.GetSize() )
- {
- _InvalidateObjs();
- // --> OD 2004-11-11 #i35007# - notify anchor frame
- // of as-character anchored object
- if ( bAnchoredAsChar )
- {
- //-->Modified for i119654,2012.6.8
- SwFrm* pAnchorFrame = pAnchoredDrawObj
- ? const_cast<SwAnchoredDrawObject*>( pAnchoredDrawObj )->AnchorFrm()
- : NULL;
- if ( pAnchorFrame )
- {
- pAnchorFrame->Prepare( PREP_FLY_ATTR_CHG, GetFmt() );
- }
- //<--
- }
- // <--
+ lcl_NotifyBackgroundOfObj(*this, rObj, &aOldObjRect);
}
+ break;
}
- // --> OD 2006-01-18 #129959#
- // It reveals that the following code causes several defects -
- // on copying or on ungrouping a group shape containing edge objects.
- // Testing fix for #i53320# also reveal that the following code
- // isn't necessary.
-// // --> OD 2005-08-15 #i53320# - reset positioning attributes,
-// // if anchored drawing object isn't yet positioned.
-// else if ( pAnchoredDrawObj->NotYetPositioned() &&
-// static_cast<const SwDrawFrmFmt&>(pAnchoredDrawObj->GetFrmFmt()).IsPosAttrSet() )
-// {
-// const_cast<SwDrawFrmFmt&>(
-// static_cast<const SwDrawFrmFmt&>(pAnchoredDrawObj->GetFrmFmt()))
-// .ResetPosAttr();
-// }
-// // <--
- // <--
+ default:
+ break;
}
- break;
- case SDRUSERCALL_CHGATTR:
- if ( bNotify )
- {
- lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
- }
- break;
- default:
- break;
}
}
@@ -1631,7 +1673,7 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
// --> OD 2006-03-17 #i62875# - revised fix for issue #124157#
// no further notification, if not connected to Writer layout
else if ( maAnchoredDrawObj.GetAnchorFrm() &&
- maAnchoredDrawObj.GetDrawObj()->GetUserCall() )
+ findConnectionToSdrObjectDirect(maAnchoredDrawObj.GetDrawObj()) )
{
// --> OD 2004-07-01 #i28701# - on change of wrapping style, hell|heaven layer,
// or wrapping style influence an update of the <SwSortedObjs> list,
@@ -1775,13 +1817,14 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
maAnchoredDrawObj.AnchorFrm()->RemoveDrawObj( maAnchoredDrawObj );
}
- if ( _bMoveMasterToInvisibleLayer && GetMaster() && GetMaster()->IsInserted() )
+ if ( _bMoveMasterToInvisibleLayer && GetMaster() && GetMaster()->IsObjectInserted() )
{
- SdrViewIter aIter( GetMaster() );
- for( SdrView* pView = aIter.FirstView(); pView;
- pView = aIter.NextView() )
+ const ::std::set< SdrView* > aAllSdrViews(GetMaster()->getSdrModelFromSdrObject().getSdrViews());
+
+ for(::std::set< SdrView* >::const_iterator aLoopViews(aAllSdrViews.begin());
+ aLoopViews != aAllSdrViews.end(); aLoopViews++)
{
- pView->MarkObj( GetMaster(), pView->GetSdrPageView(), sal_True );
+ (*aLoopViews)->MarkObj(*GetMaster(), true);
}
// OD 25.06.2003 #108784# - Instead of removing 'master' object from
@@ -1806,11 +1849,12 @@ void SwDrawContact::RemoveMasterFromDrawPage()
{
if ( GetMaster() )
{
- GetMaster()->SetUserCall( 0 );
- if ( GetMaster()->IsInserted() )
+ resetConnectionToSdrObject(GetMaster());
+
+ if ( GetMaster()->IsObjectInserted() )
{
((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
- RemoveObject( GetMaster()->GetOrdNum() );
+ RemoveObjectFromSdrObjList( GetMaster()->GetNavigationPosition() );
}
}
}
@@ -1824,7 +1868,7 @@ void SwDrawContact::RemoveMasterFromDrawPage()
// also working.
void SwDrawContact::DisconnectObjFromLayout( SdrObject* _pDrawObj )
{
- if ( _pDrawObj->ISA(SwDrawVirtObj) )
+ if ( dynamic_cast< SwDrawVirtObj* >(_pDrawObj) )
{
SwDrawVirtObj* pDrawVirtObj = static_cast<SwDrawVirtObj*>(_pDrawObj);
pDrawVirtObj->RemoveFromWriterLayout();
@@ -1894,7 +1938,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
// --> OD 2004-09-22 #i33909# - *no* connect to layout, if 'master' drawing
// object isn't inserted in the drawing page
- if ( !GetMaster()->IsInserted() )
+ if ( !GetMaster()->IsObjectInserted() )
{
ASSERT( false, "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted -> no connect to layout. Please inform od@openoffice.org" );
return;
@@ -2071,12 +2115,13 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
// OD 27.06.2003 #108784# - insert 'master' drawing object into drawing page
void SwDrawContact::InsertMasterIntoDrawPage()
{
- if ( !GetMaster()->IsInserted() )
+ if ( !GetMaster()->IsObjectInserted() )
{
GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)
- ->InsertObject( GetMaster(), GetMaster()->GetOrdNumDirect() );
+ ->InsertObjectToSdrObjList(*GetMaster(), GetMaster()->GetNavigationPosition() );
}
- GetMaster()->SetUserCall( this );
+
+ establishConnectionToSdrObject(GetMaster(), this);
}
/*************************************************************************
@@ -2113,7 +2158,7 @@ void SwDrawContact::ChkPage()
SwPageFrm* pPg = ( maAnchoredDrawObj.GetAnchorFrm() &&
maAnchoredDrawObj.GetAnchorFrm()->IsPageFrm() )
? GetPageFrm()
- : FindPage( GetMaster()->GetCurrentBoundRect() );
+ : FindPage( sdr::legacy::GetBoundRect(*GetMaster()) );
if ( GetPageFrm() != pPg )
{
// OD 27.06.2003 #108784# - if drawing object is anchor in header/footer
@@ -2144,8 +2189,8 @@ void SwDrawContact::ChkPage()
|*
|*************************************************************************/
// OD 10.07.2003 #110742# - Important note:
-// method is called by method <SwDPage::ReplaceObject(..)>, which called its
-// corresponding superclass method <FmFormPage::ReplaceObject(..)>.
+// method is called by method <SwDPage::ReplaceObjectInSdrObjList(..)>, which called its
+// corresponding superclass method <FmFormPage::ReplaceObjectInSdrObjList(..)>.
// Note: 'master' drawing object *has* to be connected to layout triggered
// by the caller of this, if method is called.
void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster )
@@ -2154,9 +2199,9 @@ void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster )
// OD 10.07.2003 #110742# - consider 'virtual' drawing objects
RemoveAllVirtObjs();
- GetMaster()->SetUserCall( 0 );
+ resetConnectionToSdrObject(GetMaster());
SetMaster( pNewMaster );
- GetMaster()->SetUserCall( this );
+ establishConnectionToSdrObject(GetMaster(), this);
_InvalidateObjs();
}
@@ -2181,9 +2226,7 @@ void SwDrawContact::GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredOb
//////////////////////////////////////////////////////////////////////////////////////
// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed
-// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj.
-// For paint, that offset is used by setting at the OutputDevice; for primitives this is
-// not possible since we have no OutputDevice, but define the geometry itself.
+// since offset is defined different
namespace sdr
{
@@ -2208,7 +2251,7 @@ namespace sdr
virtual ~VOCOfDrawVirtObj();
};
- class VCOfDrawVirtObj : public ViewContactOfVirtObj
+ class VCOfDrawVirtObj : public ViewContactOfSdrObj
{
protected:
// Create a Object-Specific ViewObjectContact, set ViewContact and
@@ -2219,7 +2262,7 @@ namespace sdr
public:
// basic constructor, used from SdrObject.
VCOfDrawVirtObj(SwDrawVirtObj& rObj)
- : ViewContactOfVirtObj(rObj)
+ : ViewContactOfSdrObj(rObj)
{
}
virtual ~VCOfDrawVirtObj();
@@ -2238,7 +2281,11 @@ namespace sdr
namespace contact
{
// recursively collect primitive data from given VOC with given offset
- void impAddPrimitivesFromGroup(const ViewObjectContact& rVOC, const basegfx::B2DHomMatrix& rOffsetMatrix, const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DSequence& rxTarget)
+ void impAddPrimitivesFromGroup(
+ const ViewObjectContact& rVOC,
+ const basegfx::B2DHomMatrix& rOriginalToVirtual,
+ const DisplayInfo& rDisplayInfo,
+ drawinglayer::primitive2d::Primitive2DSequence& rxTarget)
{
const sal_uInt32 nSubHierarchyCount(rVOC.GetViewContact().GetObjectCount());
@@ -2249,7 +2296,7 @@ namespace sdr
if(rCandidate.GetViewContact().GetObjectCount())
{
// is a group object itself, call resursively
- impAddPrimitivesFromGroup(rCandidate, rOffsetMatrix, rDisplayInfo, rxTarget);
+ impAddPrimitivesFromGroup(rCandidate, rOriginalToVirtual, rDisplayInfo, rxTarget);
}
else
{
@@ -2263,10 +2310,10 @@ namespace sdr
// get ranges
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(rCandidate.GetObjectContact().getViewInformation2D());
const basegfx::B2DRange aViewRange(rViewInformation2D.getViewport());
- basegfx::B2DRange aObjectRange(rCandidate.getObjectRange());
+ basegfx::B2DRange aObjectRange(rCandidate.getViewDependentRange());
// correct with virtual object's offset
- aObjectRange.transform(rOffsetMatrix);
+ aObjectRange.transform(rOriginalToVirtual);
// check geometrical visibility (with offset)
if(!aViewRange.overlaps(aObjectRange))
@@ -2287,52 +2334,26 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence VOCOfDrawVirtObj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
{
-#ifdef DBG_UTIL
- // #i101734#
- static bool bCheckOtherThanTranslate(false);
- static double fShearX(0.0);
- static double fRotation(0.0);
- static double fScaleX(0.0);
- static double fScaleY(0.0);
-#endif
-
const VCOfDrawVirtObj& rVC = static_cast< const VCOfDrawVirtObj& >(GetViewContact());
const SdrObject& rReferencedObject = rVC.GetSwDrawVirtObj().GetReferencedObj();
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- // create offset transformation
- basegfx::B2DHomMatrix aOffsetMatrix;
- const Point aLocalOffset(rVC.GetSwDrawVirtObj().GetOffset());
+ // create transformation to map original object to virtual transformation. To do
+ // so, apply inverse original and virtual
+ basegfx::B2DHomMatrix aOriginalToVirtual(rReferencedObject.getSdrObjectTransformation());
+ aOriginalToVirtual.invert();
+ aOriginalToVirtual = rVC.GetSwDrawVirtObj().getSdrObjectTransformation() * aOriginalToVirtual;
- if(aLocalOffset.X() || aLocalOffset.Y())
- {
-#ifdef DBG_UTIL
- // #i101734# added debug code to check more complex transformations
- // than just a translation
- if(bCheckOtherThanTranslate)
- {
- aOffsetMatrix.scale(fScaleX, fScaleY);
- aOffsetMatrix.shearX(tan(fShearX * F_PI180));
- aOffsetMatrix.rotate(fRotation * F_PI180);
- }
-#endif
-
- aOffsetMatrix.set(0, 2, aLocalOffset.X());
- aOffsetMatrix.set(1, 2, aLocalOffset.Y());
-
- }
-
- if(rReferencedObject.ISA(SdrObjGroup))
+ if(dynamic_cast< const SdrObjGroup* >(&rReferencedObject))
{
// group object. Since the VOC/OC/VC hierarchy does not represent the
// hierarchy virtual objects when they have group objects
- // (ViewContactOfVirtObj::GetObjectCount() returns null for that purpose)
// to avoid multiple usages of VOCs (which would not work), the primitives
// for the sub-hierarchy need to be collected here
// Get the VOC of the referenced object (the Group) and fetch primitives from it
const ViewObjectContact& rVOCOfRefObj = rReferencedObject.GetViewContact().GetViewObjectContact(GetObjectContact());
- impAddPrimitivesFromGroup(rVOCOfRefObj, aOffsetMatrix, rDisplayInfo, xRetval);
+ impAddPrimitivesFromGroup(rVOCOfRefObj, aOriginalToVirtual, rDisplayInfo, xRetval);
}
else
{
@@ -2343,7 +2364,11 @@ namespace sdr
if(xRetval.hasElements())
{
// create transform primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::TransformPrimitive2D(aOffsetMatrix, xRetval));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aOriginalToVirtual,
+ xRetval));
+
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
@@ -2375,50 +2400,71 @@ namespace sdr
@author OD
*/
-TYPEINIT1(SwDrawVirtObj,SdrVirtObj);
-
sdr::contact::ViewContact* SwDrawVirtObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::VCOfDrawVirtObj(*this);
}
+void SwDrawVirtObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& /*rHint*/)
+{
+// mbClosedObject = rRefObj.IsClosedObj();
+ ActionChanged();
+}
+
// #108784#
// implemetation of SwDrawVirtObj
-SwDrawVirtObj::SwDrawVirtObj( SdrObject& _rNewObj,
+SwDrawVirtObj::SwDrawVirtObj(
+ SdrObject& _rNewObj,
SwDrawContact& _rDrawContact )
- : SdrVirtObj( _rNewObj ),
- // OD 2004-03-29 #i26791# - init new member <maAnchoredDrawObj>
+: SdrObject(_rNewObj.getSdrModelFromSdrObject()),
maAnchoredDrawObj(),
- mrDrawContact( _rDrawContact )
+ mrDrawContact( _rDrawContact ),
+ rRefObj(_rNewObj),
+ aSnapRect()
{
- // OD 2004-03-29 #i26791#
maAnchoredDrawObj.SetDrawObj( *this );
- // --> OD 2004-11-17 #i35635# - set initial position out of sight
- NbcMove( Size( -RECT_EMPTY, -RECT_EMPTY ) );
- // <--
+ sdr::legacy::transformSdrObject(*this, basegfx::tools::createTranslateB2DHomMatrix(-RECT_EMPTY, -RECT_EMPTY));
+ StartListening(rRefObj);
}
SwDrawVirtObj::~SwDrawVirtObj()
-{}
-
-void SwDrawVirtObj::operator=( const SdrObject& rObj )
{
- SdrVirtObj::operator=(rObj);
- // Note: Members <maAnchoredDrawObj> and <mrDrawContact>
- // haven't to be considered.
+ EndListening(rRefObj);
}
-SdrObject* SwDrawVirtObj::Clone() const
+void SwDrawVirtObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
{
- SwDrawVirtObj* pObj = new SwDrawVirtObj( rRefObj, mrDrawContact );
+ const SwDrawVirtObj* pSource = dynamic_cast< const SwDrawVirtObj* >(&rSource);
- if ( pObj )
+ if(pSource)
+ {
+ // call parent
+ SdrObject::copyDataFromSdrObject(rSource);
+
+ // copy AnchorPos
+ SetAnchorPos(pSource->GetAnchorPos());
+ }
+ else
{
- pObj->operator=(static_cast<const SdrObject&>(*this));
- // Note: Member <maAnchoredDrawObj> hasn't to be considered.
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
}
+ }
+
+SdrObject* SwDrawVirtObj::CloneSdrObject(SdrModel* /*pTargetModel*/) const
+{
+ SwDrawVirtObj* pClone = new SwDrawVirtObj(rRefObj, mrDrawContact);
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
- return pObj;
+bool SwDrawVirtObj::IsClosedObj() const
+{
+ return rRefObj.IsClosedObj();
}
// --------------------------------------------------------------------
@@ -2468,34 +2514,40 @@ void SwDrawVirtObj::AddToDrawingPage()
// insert 'virtual' drawing object into page, set layer and user call.
SdrPage* pDrawPg;
// --> OD 2004-08-16 #i27030# - apply order number of referenced object
- if ( 0 != ( pDrawPg = pOrgMasterSdrObj->GetPage() ) )
+ if ( 0 != ( pDrawPg = pOrgMasterSdrObj->getSdrPageFromSdrObject() ) )
{
// --> OD 2004-08-16 #i27030# - apply order number of referenced object
- pDrawPg->InsertObject( this, GetReferencedObj().GetOrdNum() );
+ pDrawPg->InsertObjectToSdrObjList(*this, GetReferencedObj().GetNavigationPosition() );
}
else
{
- pDrawPg = GetPage();
- if ( pDrawPg )
+ if ( getParentOfSdrObject() )
{
- pDrawPg->SetObjectOrdNum( GetOrdNumDirect(),
- GetReferencedObj().GetOrdNum() );
+ getParentOfSdrObject()->SetNavigationPosition( GetNavigationPosition(),
+ GetReferencedObj().GetNavigationPosition() );
}
else
{
- SetOrdNum( GetReferencedObj().GetOrdNum() );
+ // TTTT: object should always be inserted into an ObjectList, thus this should not
+ // happen. Even if it happens, there is no use in setting an OrdNum since an object
+ // which is not member of an SdrObjLsit by definition has an OrdNum of 0 since it
+ // is not member of a Z-Order (see SdrObject::GetNavigationPosition())
+ OSL_ENSURE(false, "SwDrawVirtObj::AddToDrawingPage try to set OrdNum for non-inserted SdrObject (!)");
+ // former code: SetOrdNum( GetReferencedObj().GetNavigationPosition() );
}
}
// <--
- SetUserCall( &mrDrawContact );
+
+ establishConnectionToSdrObject(this, &mrDrawContact);
}
void SwDrawVirtObj::RemoveFromDrawingPage()
{
- SetUserCall( 0 );
- if ( GetPage() )
+ resetConnectionToSdrObject(this);
+
+ if ( getParentOfSdrObject() )
{
- GetPage()->RemoveObject( GetOrdNum() );
+ getParentOfSdrObject()->RemoveObjectFromSdrObjList( GetNavigationPosition() );
}
}
@@ -2503,294 +2555,325 @@ void SwDrawVirtObj::RemoveFromDrawingPage()
bool SwDrawVirtObj::IsConnected() const
{
bool bRetVal = GetAnchorFrm() &&
- ( GetPage() && GetUserCall() );
+ ( getSdrPageFromSdrObject() && findConnectionToSdrObjectDirect(this) );
return bRetVal;
}
-void SwDrawVirtObj::NbcSetAnchorPos(const Point& rPnt)
-{
- SdrObject::NbcSetAnchorPos( rPnt );
-}
+//void SwDrawVirtObj::NbcSetAnchorPos(const Point& rPnt)
+//{
+// SdrObject::NbcSetAnchorPos( rPnt );
+//}
//////////////////////////////////////////////////////////////////////////////
// #i97197#
// the methods relevant for positioning
-const Rectangle& SwDrawVirtObj::GetCurrentBoundRect() const
+const basegfx::B2DPoint SwDrawVirtObj::GetOffset() const
{
- if(aOutRect.IsEmpty())
- {
- const_cast<SwDrawVirtObj*>(this)->RecalcBoundRect();
- }
+ const basegfx::B2DPoint aLocalTranslate(getSdrObjectTranslate());
+ const basegfx::B2DPoint aRefTranslate(GetReferencedObj().getSdrObjectTranslate());
- return aOutRect;
+ return aLocalTranslate - aRefTranslate;
}
-const Rectangle& SwDrawVirtObj::GetLastBoundRect() const
+basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const
{
- return aOutRect;
+ basegfx::B2DPolyPolygon aRetval(rRefObj.TakeXorPoly());
+ aRetval.transform(basegfx::tools::createTranslateB2DHomMatrix(GetOffset()));
+
+ return aRetval;
}
-const Point SwDrawVirtObj::GetOffset() const
-{
- // do NOT use IsEmpty() here, there is already a useful offset
- // in the position
- if(aOutRect == Rectangle())
+void SwDrawVirtObj::GetPlusHdl(SdrHdlList& rHdlList, SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlNum) const
{
- return Point();
+ rRefObj.GetPlusHdl(rHdlList, rSdrObject, rHdl, nPlNum);
+ OSL_ENSURE(rHdlList.GetHdlCount(), "No PlusHdl added (!)");
+ SdrHdl* pHdl = rHdlList.GetHdlByIndex(rHdlList.GetHdlCount() - 1);
+ pHdl->setPosition(pHdl->getPosition() + GetOffset());
}
- else
+
+basegfx::B2DPoint SwDrawVirtObj::GetSnapPoint(sal_uInt32 i) const
{
- return aOutRect.TopLeft() - GetReferencedObj().GetCurrentBoundRect().TopLeft();
- }
+ return rRefObj.GetSnapPoint(i) + GetOffset();
}
-void SwDrawVirtObj::SetBoundRectDirty()
+basegfx::B2DPoint SwDrawVirtObj::GetObjectPoint(sal_uInt32 i) const
{
- // do nothing to not lose model information in aOutRect
+ return rRefObj.GetObjectPoint(i) + GetOffset();
}
-void SwDrawVirtObj::RecalcBoundRect()
+void SwDrawVirtObj::SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i)
{
- // OD 2004-04-05 #i26791# - switch order of calling <GetOffset()> and
- // <ReferencedObj().GetCurrentBoundRect()>, because <GetOffset()> calculates
- // its value by the 'BoundRect' of the referenced object.
- //aOutRect = rRefObj.GetCurrentBoundRect();
- //aOutRect += GetOffset();
-
- const Point aOffset(GetOffset());
- aOutRect = ReferencedObj().GetCurrentBoundRect() + aOffset;
+ const basegfx::B2DPoint aP(rPnt - GetOffset());
+ rRefObj.SetObjectPoint(aP, i);
+ ActionChanged();
}
-basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const
+// #108784#
+bool SwDrawVirtObj::HasTextEdit() const
{
- basegfx::B2DPolyPolygon aRetval(rRefObj.TakeXorPoly());
- aRetval.transform(basegfx::tools::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y()));
+ return rRefObj.HasTextEdit();
+}
- return aRetval;
+// OD 18.06.2003 #108784# - overloaded 'layer' methods for 'virtual' drawing
+// object to assure, that layer of 'virtual' object is the layer of the referenced
+// object.
+SdrLayerID SwDrawVirtObj::GetLayer() const
+{
+ return GetReferencedObj().GetLayer();
}
-basegfx::B2DPolyPolygon SwDrawVirtObj::TakeContour() const
+//void SwDrawVirtObj::NbcSetLayer(SdrLayerID nLayer)
+//{
+// ReferencedObj().NbcSetLayer( nLayer );
+// SdrObject::NbcSetLayer( ReferencedObj().GetLayer() );
+//}
+
+void SwDrawVirtObj::SetLayer(SdrLayerID nLayer)
{
- basegfx::B2DPolyPolygon aRetval(rRefObj.TakeContour());
- aRetval.transform(basegfx::tools::createTranslateB2DHomMatrix(GetOffset().X(), GetOffset().Y()));
+ ReferencedObj().SetLayer(nLayer);
+ SdrObject::SetLayer(ReferencedObj().GetLayer());
+}
- return aRetval;
+bool SwDrawVirtObj::supportsFullDrag() const
+{
+ return false;
}
-SdrHdl* SwDrawVirtObj::GetHdl(sal_uInt32 nHdlNum) const
+SdrObject* SwDrawVirtObj::getFullDragClone() const
{
- SdrHdl* pHdl = rRefObj.GetHdl(nHdlNum);
- Point aP(pHdl->GetPos() + GetOffset());
- pHdl->SetPos(aP);
+ SdrObject& rReferencedObject = const_cast< SdrObject& >(GetReferencedObj());
- return pHdl;
+ return new SdrGrafObj(
+ getSdrModelFromSdrObject(),
+ GetObjGraphic(rReferencedObject),
+ getSdrObjectTransformation());
}
-SdrHdl* SwDrawVirtObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt16 nPlNum) const
-{
- SdrHdl* pHdl = rRefObj.GetPlusHdl(rHdl, nPlNum);
- pHdl->SetPos(pHdl->GetPos() + GetOffset());
+//////////////////////////////////////////////////////////////////////////
+// methods which were missing from SdrVirtObj which do something
- return pHdl;
+SdrObject& SwDrawVirtObj::ReferencedObj()
+{
+ return rRefObj;
}
-void SwDrawVirtObj::NbcMove(const Size& rSiz)
+const SdrObject& SwDrawVirtObj::GetReferencedObj() const
{
- SdrObject::NbcMove( rSiz );
+ return rRefObj;
}
-void SwDrawVirtObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+sdr::properties::BaseProperties& SwDrawVirtObj::GetProperties() const
{
- rRefObj.NbcResize(rRef - GetOffset(), xFact, yFact);
- SetRectsDirty();
+ return rRefObj.GetProperties();
}
-void SwDrawVirtObj::NbcRotate(const Point& rRef, long nWink, double sn, double cs)
+//void SwDrawVirtObj::SetModel(SdrModel* pNewModel)
+//{
+// SdrObject::SetModel(pNewModel);
+// rRefObj.SetModel(pNewModel);
+//}
+
+void SwDrawVirtObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{
- rRefObj.NbcRotate(rRef - GetOffset(), nWink, sn, cs);
- SetRectsDirty();
+ rRefObj.TakeObjInfo(rInfo);
}
-void SwDrawVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2)
+sal_uInt32 SwDrawVirtObj::GetObjInventor() const
{
- rRefObj.NbcMirror(rRef1 - GetOffset(), rRef2 - GetOffset());
- SetRectsDirty();
+ return rRefObj.GetObjInventor();
}
-void SwDrawVirtObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+sal_uInt16 SwDrawVirtObj::GetObjIdentifier() const
{
- rRefObj.NbcShear(rRef - GetOffset(), nWink, tn, bVShear);
- SetRectsDirty();
+ return rRefObj.GetObjIdentifier();
}
-void SwDrawVirtObj::Move(const Size& rSiz)
+SdrObjList* SwDrawVirtObj::getChildrenOfSdrObject() const
{
- SdrObject::Move( rSiz );
-// Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
-// rRefObj.Move( rSiz );
-// SetRectsDirty();
-// SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ return rRefObj.getChildrenOfSdrObject();
}
-void SwDrawVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+void SwDrawVirtObj::TakeObjNameSingul(XubString& rName) const
{
- if(xFact.GetNumerator() != xFact.GetDenominator() || yFact.GetNumerator() != yFact.GetDenominator())
+ rRefObj.TakeObjNameSingul(rName);
+ rName.Insert(sal_Unicode('['), 0);
+ rName += sal_Unicode(']');
+
+ String aName( GetName() );
+ if(aName.Len())
+ {
+ rName += sal_Unicode(' ');
+ rName += sal_Unicode('\'');
+ rName += aName;
+ rName += sal_Unicode('\'');
+ }
+}
+
+void SwDrawVirtObj::TakeObjNamePlural(XubString& rName) const
{
- Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
- rRefObj.Resize(rRef - GetOffset(), xFact, yFact);
- SetRectsDirty();
- SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ rRefObj.TakeObjNamePlural(rName);
+ rName.Insert(sal_Unicode('['), 0);
+ rName += sal_Unicode(']');
}
+
+sal_uInt32 SwDrawVirtObj::GetPlusHdlCount(const SdrHdl& rHdl) const
+{
+ return rRefObj.GetPlusHdlCount(rHdl);
}
-void SwDrawVirtObj::Rotate(const Point& rRef, long nWink, double sn, double cs)
+void SwDrawVirtObj::AddToHdlList(SdrHdlList& rHdlList) const
+{
+ // #i73248#
+ // SdrObject::AddToHdlList(rHdlList) is not a good thing to call
+ // since at SdrPathObj, only AddToHdlList may be used and the call
+ // will instead use the standard implementation which uses GetHdlCount()
+ // and GetHdl instead. This is not wrong, but may be much less effective
+ // and may not be prepared to GetHdl returning NULL
+
+ // add handles from refObj to list and transform them
+ const sal_uInt32 nStart(rHdlList.GetHdlCount());
+ rRefObj.AddToHdlList(rHdlList);
+ const sal_uInt32 nEnd(rHdlList.GetHdlCount());
+
+ if(nEnd > nStart)
{
- if(nWink)
+ const basegfx::B2DPoint aOffset(GetOffset());
+
+ for(sal_uInt32 a(nStart); a < nEnd; a++)
{
- Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
- rRefObj.Rotate(rRef - GetOffset(), nWink, sn, cs);
- SetRectsDirty();
- SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ SdrHdl* pCandidate = rHdlList.GetHdlByIndex(a);
+
+ pCandidate->setPosition(pCandidate->getPosition() + aOffset);
+ }
}
}
-void SwDrawVirtObj::Mirror(const Point& rRef1, const Point& rRef2)
+bool SwDrawVirtObj::hasSpecialDrag() const
{
- Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
- rRefObj.Mirror(rRef1 - GetOffset(), rRef2 - GetOffset());
- SetRectsDirty();
- SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ return rRefObj.hasSpecialDrag();
}
-void SwDrawVirtObj::Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+bool SwDrawVirtObj::beginSpecialDrag(SdrDragStat& rDrag) const
{
- if(nWink)
+ return rRefObj.beginSpecialDrag(rDrag);
+}
+
+bool SwDrawVirtObj::applySpecialDrag(SdrDragStat& rDrag)
{
- Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
- rRefObj.Shear(rRef - GetOffset(), nWink, tn, bVShear);
- SetRectsDirty();
- SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ return rRefObj.applySpecialDrag(rDrag);
}
+
+String SwDrawVirtObj::getSpecialDragComment(const SdrDragStat& rDrag) const
+{
+ return rRefObj.getSpecialDragComment(rDrag);
}
-void SwDrawVirtObj::RecalcSnapRect()
+basegfx::B2DPolyPolygon SwDrawVirtObj::getSpecialDragPoly(const SdrDragStat& rDrag) const
{
- aSnapRect = rRefObj.GetSnapRect();
- aSnapRect += GetOffset();
+ return rRefObj.getSpecialDragPoly(rDrag);
+ // Offset handlen !!!!!! fehlt noch !!!!!!!
}
-const Rectangle& SwDrawVirtObj::GetSnapRect() const
+bool SwDrawVirtObj::BegCreate(SdrDragStat& rStat)
{
- ((SwDrawVirtObj*)this)->aSnapRect = rRefObj.GetSnapRect();
- ((SwDrawVirtObj*)this)->aSnapRect += GetOffset();
+ return rRefObj.BegCreate(rStat);
+}
- return aSnapRect;
+bool SwDrawVirtObj::MovCreate(SdrDragStat& rStat)
+{
+ return rRefObj.MovCreate(rStat);
}
-void SwDrawVirtObj::SetSnapRect(const Rectangle& rRect)
+bool SwDrawVirtObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
{
- Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
- Rectangle aR(rRect);
- aR -= GetOffset();
- rRefObj.SetSnapRect(aR);
- SetRectsDirty();
- SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ return rRefObj.EndCreate(rStat,eCmd);
}
-void SwDrawVirtObj::NbcSetSnapRect(const Rectangle& rRect)
+bool SwDrawVirtObj::BckCreate(SdrDragStat& rStat)
{
- Rectangle aR(rRect);
- aR -= GetOffset();
- SetRectsDirty();
- rRefObj.NbcSetSnapRect(aR);
+ return rRefObj.BckCreate(rStat);
}
-const Rectangle& SwDrawVirtObj::GetLogicRect() const
+void SwDrawVirtObj::BrkCreate(SdrDragStat& rStat)
{
- ((SwDrawVirtObj*)this)->aSnapRect = rRefObj.GetLogicRect();
- ((SwDrawVirtObj*)this)->aSnapRect += GetOffset();
+ rRefObj.BrkCreate(rStat);
+}
- return aSnapRect;
+basegfx::B2DPolyPolygon SwDrawVirtObj::TakeCreatePoly(const SdrDragStat& rDrag) const
+{
+ return rRefObj.TakeCreatePoly(rDrag);
+ // Offset handlen !!!!!! fehlt noch !!!!!!!
}
-void SwDrawVirtObj::SetLogicRect(const Rectangle& rRect)
+sal_uInt32 SwDrawVirtObj::GetSnapPointCount() const
{
- Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
- Rectangle aR(rRect);
- aR -= GetOffset();
- rRefObj.SetLogicRect(aR);
- SetRectsDirty();
- SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
+ return rRefObj.GetSnapPointCount();
}
-void SwDrawVirtObj::NbcSetLogicRect(const Rectangle& rRect)
+bool SwDrawVirtObj::IsPolygonObject() const
{
- Rectangle aR(rRect);
- aR -= GetOffset();
- rRefObj.NbcSetLogicRect(aR);
- SetRectsDirty();
+ return rRefObj.IsPolygonObject();
}
-Point SwDrawVirtObj::GetSnapPoint(sal_uInt32 i) const
+sal_uInt32 SwDrawVirtObj::GetObjectPointCount() const
{
- Point aP(rRefObj.GetSnapPoint(i));
- aP += GetOffset();
+ return rRefObj.GetObjectPointCount();
+}
- return aP;
+SdrObjGeoData* SwDrawVirtObj::GetGeoData() const
+{
+ return rRefObj.GetGeoData();
}
-Point SwDrawVirtObj::GetPoint(sal_uInt32 i) const
+void SwDrawVirtObj::SetGeoData(const SdrObjGeoData& rGeo)
{
- return Point(rRefObj.GetPoint(i) + GetOffset());
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ rRefObj.SetGeoData(rGeo);
+ ActionChanged();
}
-void SwDrawVirtObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i)
+//void SwDrawVirtObj::NbcReformatText()
+//{
+// rRefObj.NbcReformatText();
+//}
+
+void SwDrawVirtObj::ReformatText()
{
- Point aP(rPnt);
- aP -= GetOffset();
- rRefObj.SetPoint(aP, i);
- SetRectsDirty();
+ rRefObj.ReformatText();
}
-// #108784#
-FASTBOOL SwDrawVirtObj::HasTextEdit() const
+bool SwDrawVirtObj::HasMacro() const
{
- return rRefObj.HasTextEdit();
+ return rRefObj.HasMacro();
}
-// OD 18.06.2003 #108784# - overloaded 'layer' methods for 'virtual' drawing
-// object to assure, that layer of 'virtual' object is the layer of the referenced
-// object.
-SdrLayerID SwDrawVirtObj::GetLayer() const
+SdrObject* SwDrawVirtObj::CheckMacroHit(const SdrObjMacroHitRec& rRec) const
{
- return GetReferencedObj().GetLayer();
+ return rRefObj.CheckMacroHit(rRec); // Todo: Positionsversatz
}
-void SwDrawVirtObj::NbcSetLayer(SdrLayerID nLayer)
+Pointer SwDrawVirtObj::GetMacroPointer(const SdrObjMacroHitRec& rRec) const
{
- ReferencedObj().NbcSetLayer( nLayer );
- SdrVirtObj::NbcSetLayer( ReferencedObj().GetLayer() );
+ return rRefObj.GetMacroPointer(rRec); // Todo: Positionsversatz
}
-void SwDrawVirtObj::SetLayer(SdrLayerID nLayer)
+void SwDrawVirtObj::PaintMacro(OutputDevice& rOut, const SdrObjMacroHitRec& rRec) const
{
- ReferencedObj().SetLayer( nLayer );
- SdrVirtObj::NbcSetLayer( ReferencedObj().GetLayer() );
+ rRefObj.PaintMacro(rOut,rRec); // Todo: Positionsversatz
}
-bool SwDrawVirtObj::supportsFullDrag() const
+bool SwDrawVirtObj::DoMacro(const SdrObjMacroHitRec& rRec)
{
- // call parent
- return SdrVirtObj::supportsFullDrag();
+ return rRefObj.DoMacro(rRec); // Todo: Positionsversatz
}
-SdrObject* SwDrawVirtObj::getFullDragClone() const
+XubString SwDrawVirtObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
{
- // call parent
- return SdrVirtObj::getFullDragClone();
+ return rRefObj.GetMacroPopupComment(rRec); // Todo: Positionsversatz
}
+//////////////////////////////////////////////////////////////////////////
// eof
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index dad11fff1d51..07ccd1df04fc 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -28,8 +28,8 @@
#include <editeng/protitem.hxx>
#include <editeng/opaqitem.hxx>
#include <svx/svdpage.hxx>
-
-
+#include <svx/svdograf.hxx>
+#include <svx/svddrgv.hxx>
#include <fmtclds.hxx>
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
@@ -52,30 +52,25 @@
#include "pagefrm.hxx"
#include "rootfrm.hxx"
-
using namespace ::com::sun::star;
-
-
// --> OD 2004-11-22 #117958#
+
#include <svx/sdr/properties/defaultproperties.hxx>
-// <--
#include <basegfx/range/b2drange.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-
-// AW: For VCOfDrawVirtObj and stuff
-#include <svx/sdr/contact/viewcontactofvirtobj.hxx>
+#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <sw_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <svx/svdlegacy.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdetc.hxx>
using namespace ::com::sun::star;
static sal_Bool bInResize = sal_False;
-TYPEINIT1( SwFlyDrawObj, SdrObject )
-TYPEINIT1( SwVirtFlyDrawObj, SdrVirtObj )
-
/*************************************************************************
|*
|* SwFlyDrawObj::Ctor
@@ -92,7 +87,7 @@ namespace sdr
namespace contact
{
// #i95264# currently needed since createViewIndependentPrimitive2DSequence()
- // is called when RecalcBoundRect() is used. There should currently no VOCs being
+ // is called when the view independent range of the object is used. There should currently no VOCs being
// constructed since it gets not visualized (instead the corresponding SwVirtFlyDrawObj's
// referencing this one are visualized).
class VCOfSwFlyDrawObj : public ViewContactOfSdrObj
@@ -135,11 +130,12 @@ sdr::properties::BaseProperties* SwFlyDrawObj::CreateObjectSpecificProperties()
sdr::contact::ViewContact* SwFlyDrawObj::CreateObjectSpecificViewContact()
{
// #i95264# needs an own VC since createViewIndependentPrimitive2DSequence()
- // is called when RecalcBoundRect() is used
+ // is called when the view independent range of the object is used
return new sdr::contact::VCOfSwFlyDrawObj(*this);
}
-SwFlyDrawObj::SwFlyDrawObj()
+SwFlyDrawObj::SwFlyDrawObj(SdrModel& rSdrModel)
+: SdrObject(rSdrModel)
{
}
@@ -147,6 +143,36 @@ SwFlyDrawObj::~SwFlyDrawObj()
{
}
+void SwFlyDrawObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const SwFlyDrawObj* pSource = dynamic_cast< const SwFlyDrawObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrObject::copyDataFromSdrObject(rSource);
+
+ // nothing to do on own data
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* SwFlyDrawObj::CloneSdrObject(SdrModel* pTargetModel) const
+{
+ SwFlyDrawObj* pClone = new SwFlyDrawObj(
+ pTargetModel ? *pTargetModel : getSdrModelFromSdrObject());
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
/*************************************************************************
|*
|* SwFlyDrawObj::Factory-Methoden
@@ -209,9 +235,6 @@ namespace drawinglayer
{
}
- // compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
// get range
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
@@ -255,19 +278,6 @@ namespace drawinglayer
return aRetval;
}
- bool SwVirtFlyDrawObjPrimitive::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const SwVirtFlyDrawObjPrimitive& rCompare = (SwVirtFlyDrawObjPrimitive&)rPrimitive;
-
- return (&getSwVirtFlyDrawObj() == &rCompare.getSwVirtFlyDrawObj()
- && getOuterRange() == rCompare.getOuterRange());
- }
-
- return false;
- }
-
basegfx::B2DRange SwVirtFlyDrawObjPrimitive::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
return getOuterRange();
@@ -294,7 +304,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////////////
// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed
-// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj.
+// since offset is defined different
// For paint, that offset is used by setting at the OutputDevice; for primitives this is
// not possible since we have no OutputDevice, but define the geometry itself.
@@ -302,7 +312,7 @@ namespace sdr
{
namespace contact
{
- class VCOfSwVirtFlyDrawObj : public ViewContactOfVirtObj
+ class VCOfSwVirtFlyDrawObj : public ViewContactOfSdrObj
{
protected:
// This method is responsible for creating the graphical visualisation data
@@ -312,7 +322,7 @@ namespace sdr
public:
// basic constructor, used from SdrObject.
VCOfSwVirtFlyDrawObj(SwVirtFlyDrawObj& rObj)
- : ViewContactOfVirtObj(rObj)
+ : ViewContactOfSdrObj(rObj)
{
}
virtual ~VCOfSwVirtFlyDrawObj();
@@ -335,7 +345,7 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SdrObject& rReferencedObject = GetSwVirtFlyDrawObj().GetReferencedObj();
- if(rReferencedObject.ISA(SwFlyDrawObj))
+ if(dynamic_cast< const SwFlyDrawObj* >(&rReferencedObject))
{
// create an own specialized primitive which is used as repaint callpoint and HitTest
// for HitTest processor (see primitive implementation above)
@@ -368,7 +378,7 @@ basegfx::B2DRange SwVirtFlyDrawObj::getOuterBound() const
basegfx::B2DRange aOuterRange;
const SdrObject& rReferencedObject = GetReferencedObj();
- if(rReferencedObject.ISA(SwFlyDrawObj))
+ if(dynamic_cast< const SwFlyDrawObj* >(&rReferencedObject))
{
const SwFlyFrm* pFlyFrame = GetFlyFrm();
@@ -394,7 +404,7 @@ basegfx::B2DRange SwVirtFlyDrawObj::getInnerBound() const
basegfx::B2DRange aInnerRange;
const SdrObject& rReferencedObject = GetReferencedObj();
- if(rReferencedObject.ISA(SwFlyDrawObj))
+ if(dynamic_cast< const SwFlyDrawObj* >(&rReferencedObject))
{
const SwFlyFrm* pFlyFrame = GetFlyFrm();
@@ -422,22 +432,71 @@ sdr::contact::ViewContact* SwVirtFlyDrawObj::CreateObjectSpecificViewContact()
return new sdr::contact::VCOfSwVirtFlyDrawObj(*this);
}
-SwVirtFlyDrawObj::SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly) :
- SdrVirtObj( rNew ),
- pFlyFrm( pFly )
+void SwVirtFlyDrawObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& /*rHint*/)
+{
+// mbClosedObject = rRefObj.IsClosedObj();
+ ActionChanged();
+}
+
+SwVirtFlyDrawObj::SwVirtFlyDrawObj(
+ SdrObject& rNew,
+ SwFlyFrm* pFly)
+: SdrObject(rNew.getSdrModelFromSdrObject()),
+ pFlyFrm(pFly),
+ rRefObj(rNew)
{
- //#110094#-1
- // bNotPersistent = bNeedColorRestore = bWriterFlyFrame = sal_True;
const SvxProtectItem &rP = pFlyFrm->GetFmt()->GetProtect();
- bMovProt = rP.IsPosProtected();
- bSizProt = rP.IsSizeProtected();
+ mbMoveProtect = rP.IsPosProtected();
+ mbSizeProtect = rP.IsSizeProtected();
+
+ StartListening(rRefObj);
+// mbClosedObject = rRefObj.IsClosedObj();
}
__EXPORT SwVirtFlyDrawObj::~SwVirtFlyDrawObj()
{
- if ( GetPage() ) //Der SdrPage die Verantwortung entziehen.
- GetPage()->RemoveObject( GetOrdNum() );
+ EndListening(rRefObj);
+
+ if ( getParentOfSdrObject() ) //Der SdrPage die Verantwortung entziehen.
+ getParentOfSdrObject()->RemoveObjectFromSdrObjList( GetNavigationPosition() );
+}
+
+void SwVirtFlyDrawObj::copyDataFromSdrObject(const SdrObject& rSource)
+{
+ if(this != &rSource)
+ {
+ const SwVirtFlyDrawObj* pSource = dynamic_cast< const SwVirtFlyDrawObj* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ SdrObject::copyDataFromSdrObject(rSource);
+
+ // copy AnchorPos
+ SetAnchorPos(pSource->GetAnchorPos());
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrObject* SwVirtFlyDrawObj::CloneSdrObject(SdrModel* /*pTargetModel*/) const
+{
+ SwVirtFlyDrawObj* pClone = new SwVirtFlyDrawObj(
+ const_cast< SdrObject& >(GetReferencedObj()),
+ const_cast< SwFlyFrm* >(GetFlyFrm()));
+ OSL_ENSURE(pClone, "CloneSdrObject error (!)");
+ pClone->copyDataFromSdrObject(*this);
+
+ return pClone;
+}
+
+bool SwVirtFlyDrawObj::IsClosedObj() const
+{
+ return rRefObj.IsClosedObj();
}
/*************************************************************************
@@ -563,14 +622,10 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const
void __EXPORT SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const
{
- rInfo.bSelectAllowed = rInfo.bMoveAllowed =
- rInfo.bResizeFreeAllowed = rInfo.bResizePropAllowed = sal_True;
-
- rInfo.bRotateFreeAllowed = rInfo.bRotate90Allowed =
- rInfo.bMirrorFreeAllowed = rInfo.bMirror45Allowed =
- rInfo.bMirror90Allowed = rInfo.bShearAllowed =
- rInfo.bCanConvToPath = rInfo.bCanConvToPoly =
- rInfo.bCanConvToPathLineToArea = rInfo.bCanConvToPolyLineToArea = sal_False;
+ rInfo.mbSelectAllowed = rInfo.mbMoveAllowed = rInfo.mbResizeFreeAllowed = rInfo.mbResizePropAllowed = true;
+ rInfo.mbRotateFreeAllowed = rInfo.mbRotate90Allowed = rInfo.mbMirrorFreeAllowed = rInfo.mbMirror45Allowed =
+ rInfo.mbMirror90Allowed = rInfo.mbShearAllowed = rInfo.mbCanConvToPath = rInfo.mbCanConvToPoly =
+ rInfo.mbCanConvToPathLineToArea = rInfo.mbCanConvToPolyLineToArea = false;
}
@@ -586,82 +641,26 @@ void __EXPORT SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) con
void SwVirtFlyDrawObj::SetRect() const
{
if ( GetFlyFrm()->Frm().HasArea() )
- ((SwVirtFlyDrawObj*)this)->aOutRect = GetFlyFrm()->Frm().SVRect();
- else
- ((SwVirtFlyDrawObj*)this)->aOutRect = Rectangle();
-}
-
-
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetCurrentBoundRect() const
-{
- SetRect();
- return aOutRect;
-}
-
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLastBoundRect() const
-{
- return GetCurrentBoundRect();
-}
-
-
-void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect()
-{
- SetRect();
-}
-
-
-void __EXPORT SwVirtFlyDrawObj::RecalcSnapRect()
-{
- SetRect();
-}
-
-
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetSnapRect() const
-{
- SetRect();
- return aOutRect;
-}
-
-
-void __EXPORT SwVirtFlyDrawObj::SetSnapRect(const Rectangle& )
-{
- Rectangle aTmp( GetLastBoundRect() );
- SetRect();
- SetChanged();
- BroadcastObjectChange();
- if (pUserCall!=NULL)
- pUserCall->Changed(*this, SDRUSERCALL_RESIZE, aTmp);
-}
-
-
-void __EXPORT SwVirtFlyDrawObj::NbcSetSnapRect(const Rectangle& )
-{
- SetRect();
-}
-
+ {
+ const Rectangle aFrameRect(GetFlyFrm()->Frm().SVRect());
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLogicRect() const
-{
- SetRect();
- return aOutRect;
+ ((SwVirtFlyDrawObj*)this)->setSdrObjectTransformation(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aFrameRect.GetWidth(), aFrameRect.GetHeight(),
+ aFrameRect.Left(), aFrameRect.Top()));
+ }
+ else
+ {
+ ((SwVirtFlyDrawObj*)this)->setSdrObjectTransformation(basegfx::B2DHomMatrix());
+ }
}
-void __EXPORT SwVirtFlyDrawObj::SetLogicRect(const Rectangle& )
-{
- Rectangle aTmp( GetLastBoundRect() );
- SetRect();
- SetChanged();
- BroadcastObjectChange();
- if (pUserCall!=NULL)
- pUserCall->Changed(*this, SDRUSERCALL_RESIZE, aTmp);
-}
-
-
-void __EXPORT SwVirtFlyDrawObj::NbcSetLogicRect(const Rectangle& )
-{
- SetRect();
-}
+//void __EXPORT SwVirtFlyDrawObj::recalculateObjectRange()
+//{
+// SetRect();
+// maObjectRange = getSdrObjectTransformation() * basegfx::B2DRange::getUnitB2DRange();
+//}
::basegfx::B2DPolyPolygon SwVirtFlyDrawObj::TakeXorPoly() const
@@ -684,12 +683,19 @@ void __EXPORT SwVirtFlyDrawObj::NbcSetLogicRect(const Rectangle& )
|*
*************************************************************************/
-void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
+void __EXPORT SwVirtFlyDrawObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- MoveRect( aOutRect, rSiz );
+ SdrObject::setSdrObjectTransformation(rTransformation);
+
+ impReactOnGeometryChange();
+}
+
+void SwVirtFlyDrawObj::impReactOnGeometryChange()
+{
+ const basegfx::B2DPoint aCurrentTopLeft(getSdrObjectTransformation() * basegfx::B2DPoint(0.0, 0.0));
const Point aOldPos( GetFlyFrm()->Frm().Pos() );
- const Point aNewPos( aOutRect.TopLeft() );
- const SwRect aFlyRect( aOutRect );
+ const Point aNewPos(basegfx::fround(aCurrentTopLeft.getX()), basegfx::fround(aCurrentTopLeft.getY()));
+ const SwRect aFlyRect( sdr::legacy::GetSnapRect(*this) );
//Wenn der Fly eine automatische Ausrichtung hat (rechts oder oben),
//so soll die Automatik erhalten bleiben
@@ -831,131 +837,6 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
}
-void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
- const Fraction& xFact, const Fraction& yFact)
-{
- ResizeRect( aOutRect, rRef, xFact, yFact );
-
- const SwFrm* pTmpFrm = GetFlyFrm()->GetAnchorFrm();
- if( !pTmpFrm )
- pTmpFrm = GetFlyFrm();
- const bool bVertX = pTmpFrm->IsVertical();
-
- const sal_Bool bRTL = pTmpFrm->IsRightToLeft();
-
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- const bool bVertL2RX = pTmpFrm->IsVertLR();
- const Point aNewPos( ( bVertX && !bVertL2RX ) || bRTL ?
- aOutRect.Right() + 1 :
- aOutRect.Left(),
- aOutRect.Top() );
-
- Size aSz( aOutRect.Right() - aOutRect.Left() + 1,
- aOutRect.Bottom()- aOutRect.Top() + 1 );
- if( aSz != GetFlyFrm()->Frm().SSize() )
- {
- //Die Breite darf bei Spalten nicht zu schmal werden
- if ( GetFlyFrm()->Lower() && GetFlyFrm()->Lower()->IsColumnFrm() )
- {
- SwBorderAttrAccess aAccess( SwFrm::GetCache(), GetFlyFrm() );
- const SwBorderAttrs &rAttrs = *aAccess.Get();
- long nMin = rAttrs.CalcLeftLine()+rAttrs.CalcRightLine();
- const SwFmtCol& rCol = rAttrs.GetAttrSet().GetCol();
- if ( rCol.GetColumns().Count() > 1 )
- {
- for ( sal_uInt16 i = 0; i < rCol.GetColumns().Count(); ++i )
- {
- nMin += rCol.GetColumns()[i]->GetLeft() +
- rCol.GetColumns()[i]->GetRight() +
- MINFLY;
- }
- nMin -= MINFLY;
- }
- aSz.Width() = Max( aSz.Width(), nMin );
- }
-
- SwFrmFmt *pFmt = GetFmt();
- const SwFmtFrmSize aOldFrmSz( pFmt->GetFrmSize() );
- GetFlyFrm()->ChgSize( aSz );
- SwFmtFrmSize aFrmSz( pFmt->GetFrmSize() );
- if ( aFrmSz.GetWidthPercent() || aFrmSz.GetHeightPercent() )
- {
- long nRelWidth, nRelHeight;
- const SwFrm *pRel = GetFlyFrm()->IsFlyLayFrm() ?
- GetFlyFrm()->GetAnchorFrm() :
- GetFlyFrm()->GetAnchorFrm()->GetUpper();
- const ViewShell *pSh = GetFlyFrm()->getRootFrm()->GetCurrShell();
- if ( pSh && pRel->IsBodyFrm() &&
- pSh->GetViewOptions()->getBrowseMode() &&
- pSh->VisArea().HasArea() )
- {
- nRelWidth = pSh->GetBrowseWidth();
- nRelHeight = pSh->VisArea().Height();
- const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
- nRelHeight -= 2*aBorder.Height();
- }
- else
- {
- nRelWidth = pRel->Prt().Width();
- nRelHeight = pRel->Prt().Height();
- }
- if ( aFrmSz.GetWidthPercent() && aFrmSz.GetWidthPercent() != 0xFF &&
- aOldFrmSz.GetWidth() != aFrmSz.GetWidth() )
- aFrmSz.SetWidthPercent( sal_uInt8(aSz.Width() * 100L / nRelWidth + 0.5) );
- if ( aFrmSz.GetHeightPercent() && aFrmSz.GetHeightPercent() != 0xFF &&
- aOldFrmSz.GetHeight() != aFrmSz.GetHeight() )
- aFrmSz.SetHeightPercent( sal_uInt8(aSz.Height() * 100L / nRelHeight + 0.5) );
- pFmt->GetDoc()->SetAttr( aFrmSz, *pFmt );
- }
- }
-
- //Position kann auch veraendert sein!
- const Point aOldPos( ( bVertX && !bVertL2RX ) || bRTL ?
- GetFlyFrm()->Frm().TopRight() :
- GetFlyFrm()->Frm().Pos() );
- if ( aNewPos != aOldPos )
- {
- //Kann sich durch das ChgSize veraendert haben!
- if( bVertX || bRTL )
- {
- if( aOutRect.TopRight() != aNewPos )
- {
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- SwTwips nDeltaX;
- if ( bVertL2RX )
- nDeltaX = aNewPos.X() - aOutRect.Left();
- else
- nDeltaX = aNewPos.X() - aOutRect.Right();
- SwTwips nDeltaY = aNewPos.Y() - aOutRect.Top();
- MoveRect( aOutRect, Size( nDeltaX, nDeltaY ) );
- }
- }
- else if ( aOutRect.TopLeft() != aNewPos )
- aOutRect.SetPos( aNewPos );
- bInResize = sal_True;
- NbcMove( Size( 0, 0 ) );
- bInResize = sal_False;
- }
-}
-
-
-void __EXPORT SwVirtFlyDrawObj::Move(const Size& rSiz)
-{
- NbcMove( rSiz );
- SetChanged();
- GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
-}
-
-
-void __EXPORT SwVirtFlyDrawObj::Resize(const Point& rRef,
- const Fraction& xFact, const Fraction& yFact)
-{
- NbcResize( rRef, xFact, yFact );
- SetChanged();
- GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
-}
-
-
Pointer __EXPORT SwVirtFlyDrawObj::GetMacroPointer(
const SdrObjMacroHitRec& ) const
{
@@ -963,7 +844,7 @@ Pointer __EXPORT SwVirtFlyDrawObj::GetMacroPointer(
}
-FASTBOOL __EXPORT SwVirtFlyDrawObj::HasMacro() const
+bool __EXPORT SwVirtFlyDrawObj::HasMacro() const
{
const SwFmtURL &rURL = pFlyFrm->GetFmt()->GetURL();
return rURL.GetMap() || rURL.GetURL().Len();
@@ -984,19 +865,22 @@ SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) cons
else
aRect = pFlyFrm->Frm();
- if( aRect.IsInside( rRec.aPos ) )
+ const Point aHitRecPos(basegfx::fround(rRec.maPos.getX()), basegfx::fround(rRec.maPos.getY()));
+
+ if( aRect.IsInside( aHitRecPos ) )
{
SwRect aActRect( aRect );
Size aActSz( aRect.SSize() );
- aRect.Pos().X() += rRec.nTol;
- aRect.Pos().Y() += rRec.nTol;
- aRect.SSize().Height()-= 2 * rRec.nTol;
- aRect.SSize().Width() -= 2 * rRec.nTol;
+ const long nRecTol(basegfx::fround(rRec.mfTol));
+ aRect.Pos().X() += nRecTol;
+ aRect.Pos().Y() += nRecTol;
+ aRect.SSize().Height()-= 2 * nRecTol;
+ aRect.SSize().Width() -= 2 * nRecTol;
- if( aRect.IsInside( rRec.aPos ) )
+ if( aRect.IsInside( aHitRecPos ) )
{
if( !rURL.GetMap() ||
- pFlyFrm->GetFmt()->GetIMapObject( rRec.aPos, pFlyFrm ))
+ pFlyFrm->GetFmt()->GetIMapObject( aHitRecPos, pFlyFrm ))
return (SdrObject*)this;
return 0;
@@ -1008,14 +892,245 @@ SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) cons
bool SwVirtFlyDrawObj::supportsFullDrag() const
{
- // call parent
- return SdrVirtObj::supportsFullDrag();
+ return false;
}
SdrObject* SwVirtFlyDrawObj::getFullDragClone() const
{
- // call parent
- return SdrVirtObj::getFullDragClone();
+ SdrObject& rReferencedObject = const_cast< SdrObject& >(GetReferencedObj());
+
+ return new SdrGrafObj(
+ getSdrModelFromSdrObject(),
+ GetObjGraphic(rReferencedObject),
+ getSdrObjectTransformation());
+}
+
+//////////////////////////////////////////////////////////////////////////
+// methods which were missing from SdrVirtObj which do something
+
+SdrObject& SwVirtFlyDrawObj::ReferencedObj()
+{
+ return rRefObj;
+}
+
+const SdrObject& SwVirtFlyDrawObj::GetReferencedObj() const
+{
+ return rRefObj;
+}
+
+sdr::properties::BaseProperties& SwVirtFlyDrawObj::GetProperties() const
+{
+ return rRefObj.GetProperties();
+}
+
+sal_uInt32 SwVirtFlyDrawObj::GetObjInventor() const
+{
+ return rRefObj.GetObjInventor();
+}
+
+sal_uInt16 SwVirtFlyDrawObj::GetObjIdentifier() const
+{
+ return rRefObj.GetObjIdentifier();
+}
+
+SdrObjList* SwVirtFlyDrawObj::getChildrenOfSdrObject() const
+{
+ return rRefObj.getChildrenOfSdrObject();
+}
+
+void SwVirtFlyDrawObj::SetChanged()
+{
+ SdrObject::SetChanged();
+}
+
+void SwVirtFlyDrawObj::TakeObjNameSingul(XubString& rName) const
+{
+ rRefObj.TakeObjNameSingul(rName);
+ rName.Insert(sal_Unicode('['), 0);
+ rName += sal_Unicode(']');
+
+ String aName( GetName() );
+ if(aName.Len())
+ {
+ rName += sal_Unicode(' ');
+ rName += sal_Unicode('\'');
+ rName += aName;
+ rName += sal_Unicode('\'');
+ }
+}
+
+void SwVirtFlyDrawObj::TakeObjNamePlural(XubString& rName) const
+{
+ rRefObj.TakeObjNamePlural(rName);
+ rName.Insert(sal_Unicode('['), 0);
+ rName += sal_Unicode(']');
+}
+
+sal_uInt32 SwVirtFlyDrawObj::GetPlusHdlCount(const SdrHdl& rHdl) const
+{
+ return rRefObj.GetPlusHdlCount(rHdl);
+}
+
+void SwVirtFlyDrawObj::GetPlusHdl(SdrHdlList& rHdlList, SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlNum) const
+{
+ rRefObj.GetPlusHdl(rHdlList, rSdrObject, rHdl, nPlNum);
+ OSL_ENSURE(rHdlList.GetHdlCount(), "No PlusHdl added (!)");
+ SdrHdl* pHdl = rHdlList.GetHdlByIndex(rHdlList.GetHdlCount() - 1);
+ pHdl->setPosition(pHdl->getPosition() + GetAnchorPos());
+}
+
+void SwVirtFlyDrawObj::AddToHdlList(SdrHdlList& rHdlList) const
+{
+ // #i73248#
+ // SdrObject::AddToHdlList(rHdlList) is not a good thing to call
+ // since at SdrPathObj, only AddToHdlList may be used and the call
+ // will instead use the standard implementation which uses GetHdlCount()
+ // and GetHdl instead. This is not wrong, but may be much less effective
+ // and may not be prepared to GetHdl returning NULL
+
+ // add handles from refObj to list and transform them
+ const sal_uInt32 nStart(rHdlList.GetHdlCount());
+ rRefObj.AddToHdlList(rHdlList);
+ const sal_uInt32 nEnd(rHdlList.GetHdlCount());
+
+ if(nEnd > nStart)
+ {
+ const basegfx::B2DPoint aOffset(GetOffset().X(), GetOffset().Y());
+
+ for(sal_uInt32 a(nStart); a < nEnd; a++)
+ {
+ SdrHdl* pCandidate = rHdlList.GetHdlByIndex(a);
+
+ pCandidate->setPosition(pCandidate->getPosition() + aOffset);
+ }
+ }
+}
+
+bool SwVirtFlyDrawObj::hasSpecialDrag() const
+{
+ return rRefObj.hasSpecialDrag();
+}
+
+bool SwVirtFlyDrawObj::beginSpecialDrag(SdrDragStat& rDrag) const
+{
+ return rRefObj.beginSpecialDrag(rDrag);
+}
+
+bool SwVirtFlyDrawObj::applySpecialDrag(SdrDragStat& rDrag)
+{
+ return rRefObj.applySpecialDrag(rDrag);
+}
+
+String SwVirtFlyDrawObj::getSpecialDragComment(const SdrDragStat& rDrag) const
+{
+ return rRefObj.getSpecialDragComment(rDrag);
+}
+
+basegfx::B2DPolyPolygon SwVirtFlyDrawObj::getSpecialDragPoly(const SdrDragStat& rDrag) const
+{
+ return rRefObj.getSpecialDragPoly(rDrag);
+ // Offset handlen !!!!!! fehlt noch !!!!!!!
+}
+
+bool SwVirtFlyDrawObj::BegCreate(SdrDragStat& rStat)
+{
+ return rRefObj.BegCreate(rStat);
+}
+
+bool SwVirtFlyDrawObj::MovCreate(SdrDragStat& rStat)
+{
+ return rRefObj.MovCreate(rStat);
+}
+
+bool SwVirtFlyDrawObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+{
+ return rRefObj.EndCreate(rStat,eCmd);
+}
+
+bool SwVirtFlyDrawObj::BckCreate(SdrDragStat& rStat)
+{
+ return rRefObj.BckCreate(rStat);
+}
+
+void SwVirtFlyDrawObj::BrkCreate(SdrDragStat& rStat)
+{
+ rRefObj.BrkCreate(rStat);
+}
+
+basegfx::B2DPolyPolygon SwVirtFlyDrawObj::TakeCreatePoly(const SdrDragStat& rDrag) const
+{
+ return rRefObj.TakeCreatePoly(rDrag);
+ // Offset handlen !!!!!! fehlt noch !!!!!!!
+}
+
+sal_uInt32 SwVirtFlyDrawObj::GetSnapPointCount() const
+{
+ return rRefObj.GetSnapPointCount();
+}
+
+basegfx::B2DPoint SwVirtFlyDrawObj::GetSnapPoint(sal_uInt32 i) const
+{
+ return rRefObj.GetSnapPoint(i) + GetAnchorPos();
+}
+
+bool SwVirtFlyDrawObj::IsPolygonObject() const
+{
+ return rRefObj.IsPolygonObject();
+}
+
+sal_uInt32 SwVirtFlyDrawObj::GetObjectPointCount() const
+{
+ return rRefObj.GetObjectPointCount();
+}
+
+basegfx::B2DPoint SwVirtFlyDrawObj::GetObjectPoint(sal_uInt32 i) const
+{
+ return rRefObj.GetObjectPoint(i) + GetAnchorPos();
+}
+
+void SwVirtFlyDrawObj::SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i)
+{
+ const basegfx::B2DPoint aP(rPnt - GetAnchorPos());
+ rRefObj.SetObjectPoint(aP,i);
+ ActionChanged();
+}
+
+SdrObjGeoData* SwVirtFlyDrawObj::GetGeoData() const
+{
+ return rRefObj.GetGeoData();
+}
+
+void SwVirtFlyDrawObj::SetGeoData(const SdrObjGeoData& rGeo)
+{
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
+ rRefObj.SetGeoData(rGeo);
+ ActionChanged();
+}
+
+void SwVirtFlyDrawObj::ReformatText()
+{
+ rRefObj.ReformatText();
+}
+
+void SwVirtFlyDrawObj::PaintMacro(OutputDevice& rOut, const SdrObjMacroHitRec& rRec) const
+{
+ rRefObj.PaintMacro(rOut,rRec); // Todo: Positionsversatz
+}
+
+bool SwVirtFlyDrawObj::DoMacro(const SdrObjMacroHitRec& rRec)
+{
+ return rRefObj.DoMacro(rRec); // Todo: Positionsversatz
+}
+
+XubString SwVirtFlyDrawObj::GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const
+{
+ return rRefObj.GetMacroPopupComment(rRec); // Todo: Positionsversatz
+}
+
+const Point SwVirtFlyDrawObj::GetOffset() const
+{
+ // #i73248# default offset of SdrVirtObj is maObjectAnchor
+ return sdr::legacy::GetAnchorPos(*this);
}
// eof
diff --git a/sw/source/core/draw/dobjfac.cxx b/sw/source/core/draw/dobjfac.cxx
index 75e490530d86..85b22e2647ee 100644
--- a/sw/source/core/draw/dobjfac.cxx
+++ b/sw/source/core/draw/dobjfac.cxx
@@ -19,16 +19,14 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <errhdl.hxx>
#include <dpage.hxx>
#include <dobjfac.hxx>
#include <dflyobj.hxx>
+#include <svx/sdrobjectfactory.hxx>
SwObjectFactory aSwObjectFactory;
@@ -40,12 +38,12 @@ SwObjectFactory aSwObjectFactory;
IMPL_LINK( SwObjectFactory, MakeObject, SdrObjFactory*, pObjFactory )
{
- if ( pObjFactory->nInventor == SWGInventor )
+ if ( SWGInventor == pObjFactory->getSdrObjectCreationInfo().getInvent() )
{
//Kein switch, derzeit gibt es nur einen.
- ASSERT( pObjFactory->nIdentifier == SwFlyDrawObjIdentifier,
- "Falscher Inventor oder identifier." );
- pObjFactory->pNewObj = new SwFlyDrawObj();
+ ASSERT( SwFlyDrawObjIdentifier == pObjFactory->getSdrObjectCreationInfo().getIdent(), "Falscher Inventor oder identifier." );
+ pObjFactory->setNewSdrObject(
+ new SwFlyDrawObj(pObjFactory->getTargetModel()));
}
return 0;
}
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 525ebac01a15..8ec1a493119d 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -54,12 +54,13 @@
#include <ndnotxt.hxx>
#include <grfatr.hxx>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <dview.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::frame;
-SwDPage::SwDPage(SwDrawDocument& rNewModel, sal_Bool bMasterPage) :
+SwDPage::SwDPage(SwDrawDocument& rNewModel, bool bMasterPage) :
FmFormPage(rNewModel, 0, bMasterPage),
pGridLst( 0 ),
rDoc(rNewModel.GetDoc())
@@ -72,24 +73,59 @@ SwDPage::~SwDPage()
delete pGridLst;
}
+void SwDPage::copyDataFromSdrPage(const SdrPage& rSource)
+{
+ if(this != &rSource)
+ {
+ const SwDPage* pSource = dynamic_cast< const SwDPage* >(&rSource);
+
+ if(pSource)
+ {
+ // call parent
+ FmFormPage::copyDataFromSdrPage(rSource);
+
+ // no local data to copy
+ }
+ else
+ {
+ OSL_ENSURE(false, "copyDataFromSdrObject with ObjectType of Source different from Target (!)");
+ }
+ }
+}
+
+SdrPage* SwDPage::CloneSdrPage(SdrModel* pTargetModel) const
+{
+ SwDrawDocument* pSwDrawDocument = static_cast< SwDrawDocument* >(pTargetModel ? pTargetModel : &getSdrModelFromSdrPage());
+ OSL_ENSURE(dynamic_cast< SwDrawDocument* >(pSwDrawDocument), "Wrong SdrModel type in SwDPage clone (!)");
+ SwDPage* pClone = new SwDPage(
+ *pSwDrawDocument,
+ IsMasterPage());
+ OSL_ENSURE(pClone, "CloneSdrPage error (!)");
+ pClone->copyDataFromSdrPage(*this);
+
+ return pClone;
+}
+
/*************************************************************************
|*
-|* SwDPage::ReplaceObject()
+|* SwDPage::ReplaceObjectInSdrObjList()
|*
|* Ersterstellung MA 07. Aug. 95
|* Letzte Aenderung MA 07. Aug. 95
|*
*************************************************************************/
-SdrObject* SwDPage::ReplaceObject( SdrObject* pNewObj, sal_uLong nObjNum )
+SdrObject* SwDPage::ReplaceObjectInSdrObjList( SdrObject& rNewObj, sal_uInt32 nObjNum )
{
SdrObject *pOld = GetObj( nObjNum );
ASSERT( pOld, "Oups, Object not replaced" );
- SdrObjUserCall* pContact;
- if ( 0 != ( pContact = GetUserCall(pOld) ) &&
- RES_DRAWFRMFMT == ((SwContact*)pContact)->GetFmt()->Which())
- ((SwDrawContact*)pContact)->ChangeMasterObject( pNewObj );
- return FmFormPage::ReplaceObject( pNewObj, nObjNum );
+ SwContact* pContact;
+ if ( 0 != ( pContact = findConnectionToSdrObject(pOld) ) &&
+ RES_DRAWFRMFMT == pContact->GetFmt()->Which())
+ ((SwDrawContact*)pContact)->ChangeMasterObject( &rNewObj );
+
+ // call parent
+ return FmFormPage::ReplaceObjectInSdrObjList( rNewObj, nObjNum );
}
/*************************************************************************
@@ -107,17 +143,20 @@ void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg )
aPrt += pPg->Frm().Pos();
const Rectangle aUser( aPrt.SVRect() );
const Rectangle aPaper( pPg->Frm().SVRect() );
- pLst->Insert( SdrPageGridFrame( aPaper, aUser ) );
+ pLst->Insert(
+ SdrPageGridFrame(
+ basegfx::B2DRange(aPaper.Left(), aPaper.Top(), aPaper.Right(), aPaper.Bottom()),
+ basegfx::B2DRange(aUser.Left(), aUser.Top(), aUser.Right(), aUser.Bottom())));
}
const SdrPageGridFrameList* SwDPage::GetGridFrameList(
- const SdrPageView* pPV, const Rectangle *pRect ) const
+ const SdrView& rSdrView, const Rectangle *pRect ) const
{
- ViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetCurrentViewShell(); //swmod 071108//swmod 071225
+ ViewShell *pSh = ((SwDrawDocument&)getSdrModelFromSdrPage()).GetDoc().GetCurrentViewShell(); //swmod 071108//swmod 071225
if ( pSh )
{
- while ( pSh->Imp()->GetPageView() != pPV )
+ while ( pSh->Imp()->GetDrawView() != &rSdrView )
pSh = (ViewShell*)pSh->GetNext();
if ( pSh )
{
@@ -159,14 +198,13 @@ sal_Bool SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
if( rEvt.GetMode() & ( HELPMODE_QUICK | HELPMODE_BALLOON ))
{
- Point aPos( rEvt.GetMousePosPixel() );
- aPos = pWindow->ScreenToOutputPixel( aPos );
- aPos = pWindow->PixelToLogic( aPos );
+ const Point aOutputPixel(pWindow->ScreenToOutputPixel(rEvt.GetMousePosPixel()));
+ const basegfx::B2DPoint aB2DPos(pWindow->GetInverseViewTransformation() * basegfx::B2DPoint(aOutputPixel.X(), aOutputPixel.Y()));
+ const Point aPos(basegfx::fround(aB2DPos.getX()), basegfx::fround(aB2DPos.getY()));
- SdrPageView* pPV;
SdrObject* pObj;
- if( pView->PickObj( aPos, 0, pObj, pPV, SDRSEARCH_PICKMACRO ) &&
- pObj->ISA(SwVirtFlyDrawObj) )
+ if( pView->PickObj( aB2DPos, 0, pObj, SDRSEARCH_PICKMACRO ) &&
+ dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
const SwFmtURL &rURL = pFly->GetFmt()->GetURL();
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 32f50ee4471d..18ffe218b888 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -67,8 +67,8 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
pD->GetDocShell(), sal_True ),
pDoc( pD )
{
- SetScaleUnit( MAP_TWIP );
- SetSwapGraphics( sal_True );
+ SetExchangeObjectUnit( MAP_TWIP );
+ SetSwapGraphics( true );
SwDocShell* pDocSh = pDoc->GetDocShell();
if ( pDocSh )
@@ -139,11 +139,10 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SwDrawDocument::~SwDrawDocument()
{
- Broadcast(SdrHint(HINT_MODELCLEARED));
+ Broadcast(SdrBaseHint(HINT_MODELCLEARED));
// #116168#
- ClearModel(sal_True);
- //Clear();
+ ClearModel(true);
}
/*************************************************************************
@@ -156,7 +155,7 @@ SwDrawDocument::~SwDrawDocument()
\************************************************************************/
-SdrPage* SwDrawDocument::AllocPage(FASTBOOL bMasterPage)
+SdrPage* SwDrawDocument::AllocPage(bool bMasterPage)
{
SwDPage* pPage = new SwDPage(*this, 0 != bMasterPage);
pPage->SetName( String::CreateFromAscii(
@@ -192,7 +191,7 @@ SvStream* SwDrawDocument::GetDocumentStream( SdrDocumentStreamInfo& rInfo ) cons
pRet = utl::UcbStreamHelper::CreateStream( xStream );
if( pRet )
{
- rInfo.mbDeleteAfterUse = sal_True;
+ rInfo.mbDeleteAfterUse = true;
rInfo.mxStorageRef = xPictureStorage;
}
}
@@ -233,4 +232,9 @@ uno::Reference< uno::XInterface > SwDrawDocument::createUnoModel()
return xModel;
}
+bool SwDrawDocument::IsWriter() const
+{
+ return true;
+}
+
// <--
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 96e1d7ea4755..dae35d73de67 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -50,32 +50,55 @@
#include <fmtanchr.hxx>
#include "shellres.hxx"
#include <IDocumentUndoRedo.hxx>
+#include <editeng/outliner.hxx>
+#include <com/sun/star/embed/EmbedMisc.hpp>
#include <vector>
#include <sortedobjs.hxx>
#include <flyfrms.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
#include <UndoManager.hxx>
using namespace com::sun::star;
class SwSdrHdl : public SdrHdl
{
+protected:
+ virtual ~SwSdrHdl();
+
public:
- SwSdrHdl(const Point& rPnt, bool bTopRight ) :
- SdrHdl( rPnt, bTopRight ? HDL_ANCHOR_TR : HDL_ANCHOR ) {}
- virtual sal_Bool IsFocusHdl() const;
+ SwSdrHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DPoint& rPnt,
+ bool bTopRight );
+
+ virtual bool IsFocusHdl() const;
};
-sal_Bool SwSdrHdl::IsFocusHdl() const
+SwSdrHdl::SwSdrHdl(
+ SdrHdlList& rHdlList,
+ const SdrObject& rSdrHdlObject,
+ const basegfx::B2DPoint& rPnt,
+ bool bTopRight )
+: SdrHdl( rHdlList, &rSdrHdlObject, bTopRight ? HDL_ANCHOR_TR : HDL_ANCHOR, rPnt )
{
- if( HDL_ANCHOR == eKind || HDL_ANCHOR_TR == eKind )
- return sal_True;
+}
+
+SwSdrHdl::~SwSdrHdl()
+{
+}
+
+bool SwSdrHdl::IsFocusHdl() const
+{
+ if( HDL_ANCHOR == GetKind() || HDL_ANCHOR_TR == GetKind() )
+ return true;
return SdrHdl::IsFocusHdl();
}
const SwFrm *lcl_FindAnchor( const SdrObject *pObj, sal_Bool bAll )
{
- const SwVirtFlyDrawObj *pVirt = pObj->ISA(SwVirtFlyDrawObj) ?
- (SwVirtFlyDrawObj*)pObj : 0;
+ const SwVirtFlyDrawObj* pVirt = dynamic_cast< const SwVirtFlyDrawObj*>(pObj);
if ( pVirt )
{
if ( bAll || !pVirt->GetFlyFrm()->IsFlyInCntFrm() )
@@ -83,7 +106,7 @@ const SwFrm *lcl_FindAnchor( const SdrObject *pObj, sal_Bool bAll )
}
else
{
- const SwDrawContact *pCont = (const SwDrawContact*)GetUserCall(pObj);
+ const SwDrawContact *pCont = (const SwDrawContact*)findConnectionToSdrObject(pObj);
if ( pCont )
return pCont->GetAnchorFrm( pObj );
}
@@ -101,18 +124,18 @@ const SwFrm *lcl_FindAnchor( const SdrObject *pObj, sal_Bool bAll )
-SwDrawView::SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice *pOutDev) :
- FmFormView( (FmFormModel*)pMd, pOutDev ),
+SwDrawView::SwDrawView( SwViewImp &rI, FmFormModel& rModel, OutputDevice *pOutDev)
+: FmFormView( rModel, pOutDev ),
rImp( rI )
{
- SetPageVisible( sal_False );
- SetBordVisible( sal_False );
- SetGridVisible( sal_False );
- SetHlplVisible( sal_False );
- SetGlueVisible( sal_False );
- SetFrameDragSingles( sal_True );
- SetVirtualObjectBundling( sal_True );
- SetSwapAsynchron( sal_True );
+ SetPageVisible( false );
+ SetBordVisible( false );
+ SetGridVisible( false );
+ SetHlplVisible( false );
+ SetGlueVisible( false );
+ SetFrameHandles(true);
+ SetVirtualObjectBundling( true );
+ SetSwapAsynchron(true);
EnableExtendedKeyInputDispatcher( sal_False );
EnableExtendedMouseEventDispatcher( sal_False );
@@ -138,12 +161,13 @@ sal_Bool SwDrawView::IsAntiAliasing() const
//////////////////////////////////////////////////////////////////////////////
-SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList)
+SdrObject* impLocalHitCorrection(SdrObject* pRetval, const basegfx::B2DPoint& rPnt, double fTol,
+ const SdrObjectVector& rSelection)
{
- if(!nTol)
+ if(basegfx::fTools::equalZero(fTol))
{
- // the old method forced back to outer bounds test when nTol == 0, so
- // do not try to correct when nTol is not set (used from HelpContent)
+ // the old method forced back to outer bounds test when fTol == 0.0, so
+ // do not try to correct when fTol is not set (used from HelpContent)
}
else
{
@@ -165,12 +189,11 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt
else
{
// check if the object is selected in this view
- const sal_uInt32 nMarkCount(rMrkList.GetMarkCount());
bool bSelected(false);
- for(sal_uInt32 a(0); !bSelected && a < nMarkCount; a++)
+ for(sal_uInt32 a(0); !bSelected && a < rSelection.size(); a++)
{
- if(pSwVirtFlyDrawObj == rMrkList.GetMark(a)->GetMarkedSdrObj())
+ if(pSwVirtFlyDrawObj == rSelection[a])
{
bSelected = true;
}
@@ -182,9 +205,9 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt
// inner range. Get and shrink inner range
basegfx::B2DRange aInnerBound(pSwVirtFlyDrawObj->getInnerBound());
- aInnerBound.grow(-1.0 * nTol);
+ aInnerBound.grow(fTol);
- if(aInnerBound.isInside(basegfx::B2DPoint(rPnt.X(), rPnt.Y())))
+ if(aInnerBound.isInside(rPnt))
{
// exclude this hit
pRetval = 0;
@@ -197,15 +220,16 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt
return pRetval;
}
-SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const
+SdrObject* SwDrawView::CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, sal_uInt32 nOptions, const SetOfByte* pMVisLay) const
{
// call parent
- SdrObject* pRetval = FmFormView::CheckSingleSdrObjectHit(rPnt, nTol, pObj, pPV, nOptions, pMVisLay);
+ SdrObject* pRetval = FmFormView::CheckSingleSdrObjectHit(rPnt, fTol, pObj, nOptions, pMVisLay);
if(pRetval)
{
// overloaded to allow extra handling when picking SwVirtFlyDrawObj's
- pRetval = impLocalHitCorrection(pRetval, rPnt, nTol, GetMarkedObjectList());
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+ pRetval = impLocalHitCorrection(pRetval, rPnt, fTol, aSelection);
}
return pRetval;
@@ -224,12 +248,11 @@ SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTo
void SwDrawView::AddCustomHdl()
{
- const SdrMarkList &rMrkList = GetMarkedObjectList();
+ SdrObject *pObj = getSelectedIfSingle();
- if(rMrkList.GetMarkCount() != 1 || !GetUserCall(rMrkList.GetMark( 0 )->GetMarkedSdrObj()))
+ if(!pObj || !findConnectionToSdrObject(pObj))
return;
- SdrObject *pObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
// --> OD 2006-11-06 #130889# - make code robust
// const SwFmtAnchor &rAnchor = ::FindFrmFmt(pObj)->GetAnchor();
SwFrmFmt* pFrmFmt( ::FindFrmFmt( pObj ) );
@@ -254,7 +277,7 @@ void SwDrawView::AddCustomHdl()
{
// --> OD 2004-06-24 #i28701# - use last character rectangle saved at object
// in order to avoid a format of the anchor frame
- SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
+ SwAnchoredObject* pAnchoredObj = ::findConnectionToSdrObject( pObj )->GetAnchoredObj( pObj );
SwRect aAutoPos = pAnchoredObj->GetLastCharRect();
if ( aAutoPos.Height() )
{
@@ -264,8 +287,11 @@ void SwDrawView::AddCustomHdl()
// add anchor handle:
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- aHdl.AddHdl( new SwSdrHdl( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
- pAnch->IsRightToLeft() ) );
+ new SwSdrHdl(
+ maViewHandleList,
+ *pObj,
+ basegfx::B2DPoint(aPos.X(),aPos.Y()),
+ ( pAnch->IsVertical() && !pAnch->IsVertLR() ) || pAnch->IsRightToLeft());
}
/*************************************************************************
@@ -280,7 +306,7 @@ void SwDrawView::AddCustomHdl()
SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
{
- if ( GetUserCall(pObj) )
+ if ( findConnectionToSdrObject(pObj) )
{
const SwFrm *pAnch = ::lcl_FindAnchor( pObj, sal_False );
if ( pAnch )
@@ -299,18 +325,18 @@ SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
const SdrObject *pO =
(*pPage->GetSortedObjs())[i]->GetDrawObj();
- if ( pO->GetOrdNumDirect() > nOrdNum )
+ if ( pO->GetNavigationPosition() > nOrdNum )
{
const SwFrm *pTmpAnch = ::lcl_FindAnchor( pO, sal_False );
if ( pFly->IsAnLower( pTmpAnch ) )
{
- nOrdNum = pO->GetOrdNumDirect();
+ nOrdNum = pO->GetNavigationPosition();
}
}
}
if ( nOrdNum )
{
- SdrPage *pTmpPage = GetModel()->GetPage( 0 );
+ SdrPage *pTmpPage = getSdrModelFromSdrView().GetPage( 0 );
++nOrdNum;
if ( nOrdNum < pTmpPage->GetObjCount() )
{
@@ -336,7 +362,7 @@ SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
SdrObject* SwDrawView::GetMaxToBtmObj(SdrObject* pObj) const
{
- if ( GetUserCall(pObj) )
+ if ( findConnectionToSdrObject(pObj) )
{
const SwFrm *pAnch = ::lcl_FindAnchor( pObj, sal_False );
if ( pAnch )
@@ -364,7 +390,7 @@ SdrObject* SwDrawView::GetMaxToBtmObj(SdrObject* pObj) const
inline sal_Bool lcl_IsChild( SdrObject *pParent, SdrObject *pChild )
{
- if ( pParent->ISA(SwVirtFlyDrawObj) )
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pParent) )
{
const SwFrm *pAnch = lcl_FindAnchor( pChild, sal_False );
if ( pAnch && ((SwVirtFlyDrawObj*)pParent)->GetFlyFrm()->IsAnLower( pAnch ))
@@ -392,14 +418,14 @@ inline SdrObject *lcl_FindParent( SdrObject *pObj )
sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
const SdrObject* _pExclChildObj ) const
{
- sal_uInt32 nMaxChildOrdNum = _rParentObj.GetDrawObj()->GetOrdNum();
+ sal_uInt32 nMaxChildOrdNum = _rParentObj.GetDrawObj()->GetNavigationPosition();
- const SdrPage* pDrawPage = _rParentObj.GetDrawObj()->GetPage();
+ const SdrPage* pDrawPage = _rParentObj.GetDrawObj()->getSdrPageFromSdrObject();
ASSERT( pDrawPage,
"<SwDrawView::_GetMaxChildOrdNum(..) - missing drawing page at parent object - crash!" );
sal_uInt32 nObjCount = pDrawPage->GetObjCount();
- for ( sal_uInt32 i = nObjCount-1; i > _rParentObj.GetDrawObj()->GetOrdNum() ; --i )
+ for ( sal_uInt32 i = nObjCount-1; i > _rParentObj.GetDrawObj()->GetNavigationPosition() ; --i )
{
const SdrObject* pObj = pDrawPage->GetObj( i );
@@ -409,10 +435,10 @@ sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
continue;
}
- if ( pObj->GetOrdNum() > nMaxChildOrdNum &&
+ if ( pObj->GetNavigationPosition() > nMaxChildOrdNum &&
_rParentObj.IsAnLower( lcl_FindAnchor( pObj, sal_True ) ) )
{
- nMaxChildOrdNum = pObj->GetOrdNum();
+ nMaxChildOrdNum = pObj->GetNavigationPosition();
break;
}
}
@@ -428,12 +454,12 @@ sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
@author OD
*/
void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
- const std::vector<SdrObject*>& _rMovedChildObjs ) const
+ const SdrObjectVector& _rMovedChildObjs ) const
{
// determine 'repeated' objects of already moved object <_rMovedAnchoredObj>
std::list<SwAnchoredObject*> aAnchoredObjs;
{
- const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
+ const SwContact* pContact = ::findConnectionToSdrObject( _rMovedAnchoredObj.GetDrawObj() );
ASSERT( pContact,
"SwDrawView::_MoveRepeatedObjs(..) - missing contact object -> crash." );
pContact->GetAnchoredObjs( aAnchoredObjs );
@@ -442,22 +468,22 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
// check, if 'repeated' objects exists.
if ( aAnchoredObjs.size() > 1 )
{
- SdrPage* pDrawPage = GetModel()->GetPage( 0 );
+ SdrPage* pDrawPage = getSdrModelFromSdrView().GetPage( 0 );
// move 'repeated' ones to the same order number as the already moved one.
- sal_uInt32 nNewPos = _rMovedAnchoredObj.GetDrawObj()->GetOrdNum();
+ sal_uInt32 nNewPos = _rMovedAnchoredObj.GetDrawObj()->GetNavigationPosition();
while ( !aAnchoredObjs.empty() )
{
SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
if ( pAnchoredObj != &_rMovedAnchoredObj )
{
- pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
+ pDrawPage->SetNavigationPosition( pAnchoredObj->GetDrawObj()->GetNavigationPosition(),
nNewPos );
- pDrawPage->RecalcObjOrdNums();
// adjustments for accessibility API
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ const SwFlyFrm *pTmpFlyFrm = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pTmpFlyFrm )
{
- const SwFlyFrm *pTmpFlyFrm = static_cast<SwFlyFrm*>(pAnchoredObj);
rImp.DisposeAccessibleFrm( pTmpFlyFrm );
rImp.AddAccessibleFrm( pTmpFlyFrm );
}
@@ -471,30 +497,30 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
}
// move 'repeated' ones of 'child' objects
- for ( std::vector<SdrObject*>::const_iterator aObjIter = _rMovedChildObjs.begin();
+ for ( SdrObjectVector::const_iterator aObjIter = _rMovedChildObjs.begin();
aObjIter != _rMovedChildObjs.end(); ++aObjIter )
{
SdrObject* pChildObj = (*aObjIter);
{
- const SwContact* pContact = ::GetUserCall( pChildObj );
+ const SwContact* pContact = ::findConnectionToSdrObject( pChildObj );
ASSERT( pContact,
"SwDrawView::_MoveRepeatedObjs(..) - missing contact object -> crash." );
pContact->GetAnchoredObjs( aAnchoredObjs );
}
// move 'repeated' ones to the same order number as the already moved one.
- const sal_uInt32 nTmpNewPos = pChildObj->GetOrdNum();
+ const sal_uInt32 nTmpNewPos = pChildObj->GetNavigationPosition();
while ( !aAnchoredObjs.empty() )
{
SwAnchoredObject* pAnchoredObj = aAnchoredObjs.back();
if ( pAnchoredObj->GetDrawObj() != pChildObj )
{
- pDrawPage->SetObjectOrdNum( pAnchoredObj->GetDrawObj()->GetOrdNum(),
+ pDrawPage->SetNavigationPosition( pAnchoredObj->GetDrawObj()->GetNavigationPosition(),
nTmpNewPos );
- pDrawPage->RecalcObjOrdNums();
// adjustments for accessibility API
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ const SwFlyFrm *pTmpFlyFrm = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pTmpFlyFrm )
{
- const SwFlyFrm *pTmpFlyFrm = static_cast<SwFlyFrm*>(pAnchoredObj);
rImp.DisposeAccessibleFrm( pTmpFlyFrm );
rImp.AddAccessibleFrm( pTmpFlyFrm );
}
@@ -511,24 +537,21 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
}
// --> OD 2004-08-20 #110810# - adjustment and re-factoring of method
-void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
- sal_uLong nNewPos )
+void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uInt32 nOldPos, sal_uInt32 nNewPos )
{
// --> OD 2004-08-17 #110810# - nothing to do for group members
- if ( pObj->GetUpGroup() )
+ if ( pObj->GetParentSdrObject() )
{
return;
}
// <--
// determine drawing page and assure that the order numbers are correct.
- SdrPage* pDrawPage = GetModel()->GetPage( 0 );
- if ( pDrawPage->IsObjOrdNumsDirty() )
- pDrawPage->RecalcObjOrdNums();
+ SdrPage* pDrawPage = getSdrModelFromSdrView().GetPage( 0 );
const sal_uInt32 nObjCount = pDrawPage->GetObjCount();
SwAnchoredObject* pMovedAnchoredObj =
- ::GetUserCall( pObj )->GetAnchoredObj( pObj );
+ ::findConnectionToSdrObject( pObj )->GetAnchoredObj( pObj );
const SwFlyFrm* pParentAnchoredObj =
pMovedAnchoredObj->GetAnchorFrm()->FindFlyFrm();
@@ -544,22 +567,20 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
if ( nNewPos > nMaxChildOrdNumWithoutMoved+1 )
{
// set position to the top of the 'child' object group
- pDrawPage->SetObjectOrdNum( nNewPos, nMaxChildOrdNumWithoutMoved+1 );
+ pDrawPage->SetNavigationPosition( nNewPos, nMaxChildOrdNumWithoutMoved+1 );
nNewPos = nMaxChildOrdNumWithoutMoved+1;
}
}
else
{
- const sal_uInt32 nParentOrdNum = pParentAnchoredObj->GetDrawObj()->GetOrdNum();
+ const sal_uInt32 nParentOrdNum = pParentAnchoredObj->GetDrawObj()->GetNavigationPosition();
if ( nNewPos < nParentOrdNum )
{
// set position to the bottom of the 'child' object group
- pDrawPage->SetObjectOrdNum( nNewPos, nParentOrdNum );
+ pDrawPage->SetNavigationPosition( nNewPos, nParentOrdNum );
nNewPos = nParentOrdNum;
}
}
- if ( pDrawPage->IsObjOrdNumsDirty() )
- pDrawPage->RecalcObjOrdNums();
}
// Assure, that object isn't positioned between 'repeated' ones
@@ -575,7 +596,7 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
{
// move before the top 'repeated' object
const sal_uInt32 nTmpMaxOrdNum =
- ::GetUserCall( pTmpObj )->GetMaxOrdNum();
+ ::findConnectionToSdrObject( pTmpObj )->GetMaxOrdNum();
if ( nTmpMaxOrdNum > nNewPos )
nTmpNewPos = nTmpMaxOrdNum;
}
@@ -583,23 +604,21 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
{
// move behind the bottom 'repeated' object
const sal_uInt32 nTmpMinOrdNum =
- ::GetUserCall( pTmpObj )->GetMinOrdNum();
+ ::findConnectionToSdrObject( pTmpObj )->GetMinOrdNum();
if ( nTmpMinOrdNum < nNewPos )
nTmpNewPos = nTmpMinOrdNum;
}
if ( nTmpNewPos != nNewPos )
{
- pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
+ pDrawPage->SetNavigationPosition( nNewPos, nTmpNewPos );
nNewPos = nTmpNewPos;
- pDrawPage->RecalcObjOrdNums();
}
}
}
// On move forward, assure that object is moved before its own childs.
// Only Writer fly frames can have childs.
- if ( pMovedAnchoredObj->ISA(SwFlyFrm) &&
- bMovedForward && nNewPos < nObjCount - 1 )
+ if ( dynamic_cast< SwFlyFrm* >(pMovedAnchoredObj) && bMovedForward && nNewPos < nObjCount - 1 )
{
sal_uInt32 nMaxChildOrdNum =
_GetMaxChildOrdNum( *(static_cast<const SwFlyFrm*>(pMovedAnchoredObj)) );
@@ -607,18 +626,17 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
{
// determine position before the object before its top 'child' object
const SdrObject* pTmpObj = pDrawPage->GetObj( nMaxChildOrdNum );
- sal_uInt32 nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum() + 1;
+ sal_uInt32 nTmpNewPos = ::findConnectionToSdrObject( pTmpObj )->GetMaxOrdNum() + 1;
if ( nTmpNewPos >= nObjCount )
{
--nTmpNewPos;
}
// assure, that determined position isn't between 'repeated' objects
pTmpObj = pDrawPage->GetObj( nTmpNewPos );
- nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
+ nTmpNewPos = ::findConnectionToSdrObject( pTmpObj )->GetMaxOrdNum();
// apply new position
- pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
+ pDrawPage->SetNavigationPosition( nNewPos, nTmpNewPos );
nNewPos = nTmpNewPos;
- pDrawPage->RecalcObjOrdNums();
}
}
@@ -645,12 +663,12 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
{
if ( bMovedForward )
{
- nTmpNewPos = ::GetUserCall( pTmpObj )->GetMaxOrdNum();
+ nTmpNewPos = ::findConnectionToSdrObject( pTmpObj )->GetMaxOrdNum();
pTmpObj = pDrawPage->GetObj( nTmpNewPos + 1 );
}
else
{
- nTmpNewPos = ::GetUserCall( pTmpParentObj->GetDrawObj() )
+ nTmpNewPos = ::findConnectionToSdrObject( pTmpParentObj->GetDrawObj() )
->GetMinOrdNum();
pTmpObj = pTmpParentObj->GetDrawObj();
}
@@ -660,20 +678,19 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
}
if ( nTmpNewPos != nNewPos )
{
- pDrawPage->SetObjectOrdNum( nNewPos, nTmpNewPos );
+ pDrawPage->SetNavigationPosition( nNewPos, nTmpNewPos );
nNewPos = nTmpNewPos;
- pDrawPage->RecalcObjOrdNums();
}
}
// setup collection of moved 'child' objects to move its 'repeated' objects.
- std::vector< SdrObject* > aMovedChildObjs;
+ SdrObjectVector aMovedChildObjs;
// move 'childs' accordingly
- if ( pMovedAnchoredObj->ISA(SwFlyFrm) )
- {
- const SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pMovedAnchoredObj);
+ const SwFlyFrm* pFlyFrm = dynamic_cast<SwFlyFrm*>(pMovedAnchoredObj);
+ if ( pFlyFrm )
+ {
// adjustments for accessibility API
rImp.DisposeAccessibleFrm( pFlyFrm );
rImp.AddAccessibleFrm( pFlyFrm );
@@ -699,12 +716,11 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
( pFlyFrm->IsUpperOf( *pTmpParentObj ) ) ) )
{
// move child object.,
- pDrawPage->SetObjectOrdNum( i, nChildNewPos );
- pDrawPage->RecalcObjOrdNums();
+ pDrawPage->SetNavigationPosition( i, nChildNewPos );
// collect 'child' object
aMovedChildObjs.push_back( pTmpObj );
// adjustments for accessibility API
- if ( pTmpObj->ISA(SwVirtFlyDrawObj) )
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pTmpObj) )
{
const SwFlyFrm *pTmpFlyFrm =
static_cast<SwVirtFlyDrawObj*>(pTmpObj)->GetFlyFrm();
@@ -750,21 +766,30 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
*************************************************************************/
-sal_Bool SwDrawView::TakeDragLimit( SdrDragMode eMode,
- Rectangle& rRect ) const
+bool SwDrawView::TakeDragLimit( SdrDragMode eMode, basegfx::B2DRange& rRange ) const
{
- const SdrMarkList &rMrkList = GetMarkedObjectList();
- sal_Bool bRet = sal_False;
- if( 1 == rMrkList.GetMarkCount() )
+ const SdrObject* pObj = getSelectedIfSingle();
+ bool bRet(false);
+
+ if(pObj)
{
- const SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- SwRect aRect;
- if( ::CalcClipRect( pObj, aRect, eMode == SDRDRAG_MOVE ) )
+ SwRect aSwRect;
+
+ if(::CalcClipRect(pObj, aSwRect, SDRDRAG_MOVE == eMode))
{
- rRect = aRect.SVRect();
- bRet = sal_True;
+ if(aSwRect.IsEmpty())
+ {
+ rRange = basegfx::B2DRange();
+ }
+ else
+ {
+ rRange = basegfx::B2DRange(aSwRect.Left(), aSwRect.Top(), aSwRect.Right(), aSwRect.Bottom());
+ }
+
+ bRet = true;
}
}
+
return bRet;
}
@@ -780,17 +805,16 @@ sal_Bool SwDrawView::TakeDragLimit( SdrDragMode eMode,
const SwFrm* SwDrawView::CalcAnchor()
{
- const SdrMarkList &rMrkList = GetMarkedObjectList();
- if ( rMrkList.GetMarkCount() != 1 )
- return NULL;
+ SdrObject* pObj = getSelectedIfSingle();
- SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
+ if ( !pObj )
+ return NULL;
//Fuer Absatzgebundene Objekte suchen, andernfalls einfach nur
//der aktuelle Anker. Nur suchen wenn wir gerade draggen.
const SwFrm* pAnch;
Rectangle aMyRect;
- const sal_Bool bFly = pObj->ISA(SwVirtFlyDrawObj);
+ const bool bFly(dynamic_cast< SwVirtFlyDrawObj* >(pObj));
if ( bFly )
{
pAnch = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetAnchorFrm();
@@ -798,7 +822,7 @@ const SwFrm* SwDrawView::CalcAnchor()
}
else
{
- SwDrawContact *pC = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pC = (SwDrawContact*)findConnectionToSdrObject(pObj);
// OD 17.06.2003 #108784# - determine correct anchor position for
// 'virtual' drawing objects.
// OD 2004-03-25 #i26791#
@@ -811,7 +835,7 @@ const SwFrm* SwDrawView::CalcAnchor()
// OD 2004-03-25 #i26791#
pAnch = pC->GetAnchorFrm( pObj );
}
- aMyRect = pObj->GetSnapRect();
+ aMyRect = sdr::legacy::GetSnapRect(*pObj);
}
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
@@ -823,12 +847,14 @@ const SwFrm* SwDrawView::CalcAnchor()
Point aPt;
if ( IsAction() )
{
- if ( !TakeDragObjAnchorPos( aPt, bTopRight ) )
+ basegfx::B2DPoint aB2DPt;
+ if ( !TakeDragObjAnchorPos( aB2DPt, bTopRight ) )
return NULL;
+ aPt = Point(basegfx::fround(aB2DPt.getX()), basegfx::fround(aB2DPt.getY()));
}
else
{
- Rectangle aRect = pObj->GetSnapRect();
+ const Rectangle aRect(sdr::legacy::GetSnapRect(*pObj));
aPt = bTopRight ? aRect.TopRight() : aRect.TopLeft();
}
@@ -845,7 +871,7 @@ const SwFrm* SwDrawView::CalcAnchor()
{
const SwRect aRect( aPt.X(), aPt.Y(), 1, 1 );
- SwDrawContact* pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact* pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
if ( pContact->GetAnchorFrm( pObj ) &&
pContact->GetAnchorFrm( pObj )->IsPageFrm() )
pAnch = pContact->GetPageFrm();
@@ -872,21 +898,20 @@ const SwFrm* SwDrawView::CalcAnchor()
void SwDrawView::ShowDragAnchor()
{
- SdrHdl* pHdl = aHdl.GetHdl(HDL_ANCHOR);
+ SdrHdl* pHdl = maViewHandleList.GetHdlByKind(HDL_ANCHOR);
if ( ! pHdl )
- pHdl = aHdl.GetHdl(HDL_ANCHOR_TR);
+ pHdl = maViewHandleList.GetHdlByKind(HDL_ANCHOR_TR);
if(pHdl)
{
CalcAnchor();
- pHdl->SetPos(aAnchorPoint);
- //OLMRefreshAllIAOManagers();
+ pHdl->setPosition(basegfx::B2DPoint(aAnchorPoint.X(), aAnchorPoint.Y()));
}
}
/*************************************************************************
|*
-|* SwDrawView::MarkListHasChanged()
+|* SwDrawView::handleSelectionChange()
|*
|* Ersterstellung OM 02. Feb. 95
|* Letzte Aenderung OM 07. Jul. 95
@@ -894,16 +919,19 @@ void SwDrawView::ShowDragAnchor()
*************************************************************************/
-void SwDrawView::MarkListHasChanged()
+void SwDrawView::handleSelectionChange()
{
+ // call parent
+ FmFormView::handleSelectionChange();
+
+ // local reactions
Imp().GetShell()->DrawSelChanged();
- FmFormView::MarkListHasChanged();
}
// #i7672#
-void SwDrawView::ModelHasChanged()
+void SwDrawView::LazyReactOnObjectChanges()
{
- // The ModelHasChanged() call in DrawingLayer also updates
+ // The LazyReactOnObjectChanges() call in DrawingLayer also updates
// a eventually active text edit view (OutlinerView). This also leads
// to newly setting the background color for that edit view. Thus,
// this method rescues the current background color if a OutlinerView
@@ -920,7 +948,7 @@ void SwDrawView::ModelHasChanged()
}
// call parent
- FmFormView::ModelHasChanged();
+ FmFormView::LazyReactOnObjectChanges();
if(bColorWasSaved)
{
@@ -933,10 +961,9 @@ void SwDrawView::ModelHasChanged()
}
}
-void SwDrawView::MakeVisible( const Rectangle &rRect, Window & )
+void SwDrawView::MakeVisibleAtView( const basegfx::B2DRange& rRange, Window & )
{
- ASSERT( rImp.GetShell()->GetWin(), "MakeVisible, unknown Window");
- rImp.GetShell()->MakeVisible( SwRect( rRect ) );
+ rImp.GetShell()->MakeVisible( rRange );
}
void SwDrawView::CheckPossibilities()
@@ -949,74 +976,79 @@ void SwDrawView::CheckPossibilities()
//Objekte, die in Rahmen verankert sind, muessen genau dann geschuetzt
//sein, wenn der Inhalt des Rahmens geschuetzt ist.
//OLE-Objekte konnen selbst einen Resize-Schutz wuenschen (StarMath)
+ bool bProtect(false);
+ bool bSzProtect(false);
- const SdrMarkList &rMrkList = GetMarkedObjectList();
- sal_Bool bProtect = sal_False,
- bSzProtect = sal_False;
- for ( sal_uInt16 i = 0; !bProtect && i < rMrkList.GetMarkCount(); ++i )
+ if(areSdrObjectsSelected())
{
- const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- const SwFrm *pFrm = NULL;
- if ( pObj->ISA(SwVirtFlyDrawObj) )
+ const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i = 0; !bProtect && i < aSelection.size(); ++i )
{
- const SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
- if ( pFly )
+ const SdrObject *pObj = aSelection[i];
+ const SwFrm *pFrm = NULL;
+ if ( dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
{
- pFrm = pFly->GetAnchorFrm();
- if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
+ const SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
+ if ( pFly )
{
- SwOLENode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode();
- if ( pNd )
+ pFrm = pFly->GetAnchorFrm();
+ if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
{
- uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef();
- if ( xObj.is() )
+ SwOLENode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode();
+ if ( pNd )
{
- // --> OD 2004-08-16 #110810# - improvement for
- // the future, when more than one Writer fly frame
- // can be selected.
-
- // TODO/LATER: retrieve Aspect - from where?!
- bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) ? sal_True : sal_False;
-
- // <--
-
- // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated
- SwDoc* pDoc = Imp().GetShell()->GetDoc();
- const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
- && FLY_AS_CHAR == pFly->GetFmt()->GetAnchor().GetAnchorId()
- && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
- if (bProtectMathPos)
- bMoveProtect = true;
+ uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef();
+ if ( xObj.is() )
+ {
+ // --> OD 2004-08-16 #110810# - improvement for
+ // the future, when more than one Writer fly frame
+ // can be selected.
+
+ // TODO/LATER: retrieve Aspect - from where?!
+ bSzProtect |= bool(embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ));
+
+ // <--
+
+ // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated
+ SwDoc* pDoc = Imp().GetShell()->GetDoc();
+ const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
+ && FLY_AS_CHAR == pFly->GetFmt()->GetAnchor().GetAnchorId()
+ && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
+ if (bProtectMathPos)
+ mbMoveProtect = true;
+ }
}
}
}
}
- }
- else
- {
- SwDrawContact *pC = (SwDrawContact*)GetUserCall(pObj);
- if ( pC )
- pFrm = pC->GetAnchorFrm( pObj );
- }
- if ( pFrm )
- bProtect = pFrm->IsProtected(); //Rahmen, Bereiche usw.
- {
- SwFrmFmt* pFrmFmt( ::FindFrmFmt( const_cast<SdrObject*>(pObj) ) );
- if ( !pFrmFmt )
+ else
{
- ASSERT( false,
- "<SwDrawView::CheckPossibilities()> - missing frame format" );
- bProtect = sal_True;
+ SwDrawContact *pC = (SwDrawContact*)findConnectionToSdrObject(pObj);
+ if ( pC )
+ pFrm = pC->GetAnchorFrm( pObj );
}
- else if ((FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId()) &&
- rMrkList.GetMarkCount() > 1 )
+ if ( pFrm )
+ bProtect = pFrm->IsProtected(); //Rahmen, Bereiche usw.
+
{
- bProtect = sal_True;
+ SwFrmFmt* pFrmFmt( ::FindFrmFmt( const_cast<SdrObject*>(pObj) ) );
+ if ( !pFrmFmt )
+ {
+ ASSERT( false,
+ "<SwDrawView::CheckPossibilities()> - missing frame format" );
+ bProtect = true;
+ }
+ else if ((FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId()) && aSelection.size() > 1 )
+ {
+ bProtect = true;
+ }
}
}
}
- bMoveProtect |= bProtect;
- bResizeProtect |= bProtect | bSzProtect;
+
+ mbMoveProtect |= bProtect;
+ mbResizeProtect |= bProtect | bSzProtect;
}
/** replace marked <SwDrawVirtObj>-objects by its reference object for delete
@@ -1028,42 +1060,35 @@ void SwDrawView::CheckPossibilities()
*/
void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView )
{
- SdrPageView* pDrawPageView = _rMarkView.GetSdrPageView();
- const SdrMarkList& rMarkList = _rMarkView.GetMarkedObjectList();
-
- if( rMarkList.GetMarkCount() )
+ if(_rMarkView.areSdrObjectsSelected())
{
// collect marked objects in a local data structure
- std::vector<SdrObject*> aMarkedObjs;
- for( sal_uInt32 i = 0; i < rMarkList.GetMarkCount(); ++i )
- {
- SdrObject* pMarkedObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
- aMarkedObjs.push_back( pMarkedObj );
- }
+ const SdrObjectVector aSelection(_rMarkView.getSelectedSdrObjectVectorFromSdrMarkView());
+
// unmark all objects
_rMarkView.UnmarkAllObj();
+
// re-mark objects, but for marked <SwDrawVirtObj>-objects marked its
// reference object.
- while ( !aMarkedObjs.empty() )
+ for(sal_uInt32 a(aSelection.size()); a;)
{
- SdrObject* pMarkObj = aMarkedObjs.back();
- if ( pMarkObj->ISA(SwDrawVirtObj) )
+ a--;
+ SdrObject* pMarkObj = aSelection[a];
+
+ if ( dynamic_cast< SwDrawVirtObj* >(pMarkObj) )
{
SdrObject* pRefObj = &(static_cast<SwDrawVirtObj*>(pMarkObj)->ReferencedObj());
- if ( !_rMarkView.IsObjMarked( pRefObj ) )
+
+ if ( !_rMarkView.IsObjMarked( *pRefObj ) )
{
- _rMarkView.MarkObj( pRefObj, pDrawPageView );
+ _rMarkView.MarkObj( *pRefObj );
}
}
else
{
- _rMarkView.MarkObj( pMarkObj, pDrawPageView );
+ _rMarkView.MarkObj( *pMarkObj );
}
-
- aMarkedObjs.pop_back();
}
- // sort marked list in order to assure consistent state in drawing layer
- _rMarkView.SortMarkedObjects();
}
}
@@ -1077,10 +1102,10 @@ void SwDrawView::DeleteMarked()
// OD 18.06.2003 #108784# - replace marked <SwDrawVirtObj>-objects by its
// reference objects.
{
- SdrPageView* pDrawPageView = rImp.GetPageView();
- if ( pDrawPageView )
+ SdrView* pDrawView = rImp.GetDrawView();
+ if ( pDrawView )
{
- SdrMarkView* pMarkView = PTR_CAST( SdrMarkView, &(pDrawPageView->GetView()) );
+ SdrMarkView* pMarkView = dynamic_cast< SdrMarkView* >( pDrawView );
if ( pMarkView )
{
ReplaceMarkedDrawVirtObjs( *pMarkView );
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index b4c1d180f780..840730ae5259 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -199,7 +199,7 @@ void SwEditShell::FieldToText( SwFieldType* pType )
SwFieldHint aHint( pPaM );
SwClientIter aIter( *pType );
- for ( SwClient* pClient = aIter.GoStart(); pClient; pClient = ++aIter )
+ for ( SwClient* pClient = aIter.SwClientIter_First(); pClient; pClient = aIter.SwClientIter_Next() )
{
pPaM->DeleteMark();
pClient->SwClientNotifyCall( *pType, aHint );
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx
index aeaa6237a35b..f671aa3acd94 100644
--- a/sw/source/core/edit/edglbldc.cxx
+++ b/sw/source/core/edit/edglbldc.cxx
@@ -82,7 +82,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
{
case TOX_HEADER_SECTION: break; // ignore
case TOX_CONTENT_SECTION:
- ASSERT( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(pSect), "keine TOXBaseSection!" );
pNew = new SwGlblDocContent( (SwTOXBaseSection*)pSect );
break;
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index 4e73db63c612..f9c863c14ce4 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -478,14 +478,14 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv )
sal_Bool bRet = sal_False;
const SwPaM *pCrsr = GetCrsr();
const SwTableNode* pTblNd = pCrsr->GetNode()->FindTableNode();
- if( pTblNd && !pTblNd->GetTable().ISA( SwDDETable ))
+ if( pTblNd && !dynamic_cast< const SwDDETable* >(&pTblNd->GetTable()))
{
sal_Bool bNew = pTblNd->GetTable().IsNewModel();
const SwNodes& rNds = GetDoc()->GetNodes();
if( pChkNxtPrv )
{
const SwTableNode* pChkNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode();
- if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) &&
+ if( pChkNd && !dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) &&
bNew == pChkNd->GetTable().IsNewModel() &&
// --> FME 2004-09-17 #117418# Consider table in table case
pChkNd->EndOfSectionIndex() == pTblNd->GetIndex() - 1 )
@@ -494,7 +494,7 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv )
else
{
pChkNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode();
- if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) &&
+ if( pChkNd && !dynamic_cast< const SwDDETable* >(&pChkNd->GetTable()) &&
bNew == pChkNd->GetTable().IsNewModel() )
*pChkNxtPrv = sal_False, bRet = sal_True; // mit Next ist moeglich
}
@@ -514,7 +514,7 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv )
else
pTmpTblNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode();
- bRet = pTmpTblNd && !pTmpTblNd->GetTable().ISA( SwDDETable ) &&
+ bRet = pTmpTblNd && !dynamic_cast< const SwDDETable* >(&pTmpTblNd->GetTable()) &&
bNew == pTmpTblNd->GetTable().IsNewModel();
}
}
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 550cfdda0283..5771a33f910b 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -119,7 +119,7 @@ sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const
--------------------------------------------------*/
sal_Bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&rTOXBase), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
return rTOXSect.IsProtect();
}
@@ -128,7 +128,7 @@ sal_Bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const
--------------------------------------------------*/
void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, sal_Bool bReadonly)
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&rTOXBase), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
((SwTOXBase&)rTOXBase).SetProtected(bReadonly);
ASSERT( rTOXSect.SwSection::GetType() == TOX_CONTENT_SECTION, "not a TOXContentSection" );
@@ -193,7 +193,7 @@ sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pS
{
sal_Bool bRet = sal_False;
- ASSERT( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(&rTOX), "keine TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOX;
ASSERT(pTOX, "Keine aktuelles Verzeichnis");
const SwSectionNode* pSectNd;
@@ -291,7 +291,7 @@ const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const
pSect->GetFmt()->GetSectionNode() &&
nCnt++ == nPos )
{
- ASSERT( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ ASSERT( dynamic_cast< const SwTOXBaseSection* >(pSect), "keine TOXBaseSection!" );
return (SwTOXBaseSection*)pSect;
}
}
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index ce2f5d698f3b..71a034828c94 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -37,13 +37,13 @@
#include <flyfrm.hxx>
#include <frmfmt.hxx>
#include <viewimp.hxx>
+#include <svx/svdlegacy.hxx>
#include <docsh.hxx>
-/** helper function to select all objects in an SdrMarkList;
+/** helper function to select all objects in an SdrObject vector with selectedobjects;
* implementation: see below */
-void lcl_SelectSdrMarkList( SwEditShell* pShell,
- const SdrMarkList* pSdrMarkList );
+void lcl_SelectSdrMarkList( SwEditShell* pShell, const SdrObjectVector& rSdrObjectVector );
bool SwEditShell::CursorsLocked() const
{
@@ -61,16 +61,15 @@ SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext)
}
SwFrmFmt * pSelFmt(0);
- SdrMarkList * pMarkList(0);
- rContext.GetSelections(pSelFmt, pMarkList);
+ SdrObjectVector aSdrObjectVector;
+ rContext.GetSelections(pSelFmt, aSdrObjectVector);
if (pSelFmt) // select frame
{
if (RES_DRAWFRMFMT == pSelFmt->Which())
{
SdrObject* pSObj = pSelFmt->FindSdrObject();
- static_cast<SwFEShell*>(this)->SelectObj(
- pSObj->GetCurrentBoundRect().Center() );
+ static_cast<SwFEShell*>(this)->SelectObj(pSObj->getObjectRange(0).getCenter());
}
else
{
@@ -83,9 +82,9 @@ SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext)
}
}
}
- else if (pMarkList)
+ else if (aSdrObjectVector.size())
{
- lcl_SelectSdrMarkList( this, pMarkList );
+ lcl_SelectSdrMarkList( this, aSdrObjectVector );
}
else if (GetCrsr()->GetNext() != GetCrsr())
{
@@ -225,19 +224,18 @@ bool SwEditShell::Repeat(sal_uInt16 const nCount)
}
-void lcl_SelectSdrMarkList( SwEditShell* pShell,
- const SdrMarkList* pSdrMarkList )
+void lcl_SelectSdrMarkList( SwEditShell* pShell, const SdrObjectVector& rSdrObjectVector )
{
ASSERT( pShell != NULL, "need shell!" );
- ASSERT( pSdrMarkList != NULL, "need mark list" );
+ SwFEShell* pFEShell = dynamic_cast< SwFEShell* >( pShell );
- if( pShell->ISA( SwFEShell ) )
+ if( pFEShell )
{
SwFEShell* pFEShell = static_cast<SwFEShell*>( pShell );
bool bFirst = true;
- for( sal_uInt16 i = 0; i < pSdrMarkList->GetMarkCount(); ++i )
+ for( sal_uInt32 i = 0; i < rSdrObjectVector.size(); ++i )
{
- SdrObject *pObj = pSdrMarkList->GetMark( i )->GetMarkedSdrObj();
+ SdrObject *pObj = rSdrObjectVector[i];
if( pObj )
{
pFEShell->SelectObj( Point(), bFirst ? 0 : SW_ADD_SELECT, pObj );
@@ -248,7 +246,7 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell,
// the old implementation would always unselect
// objects, even if no new ones were selected. If this
// is a problem, we need to re-work this a little.
- ASSERT( pSdrMarkList->GetMarkCount() != 0, "empty mark list" );
+ ASSERT( rSdrObjectVector.size() != 0, "empty mark list" );
}
}
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 79ed7c5f2028..eadb2b582b5d 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -105,8 +105,9 @@ void SwEditShell::StartAllAction()
{
ViewShell *pSh = this;
do {
- if( pSh->IsA( TYPE( SwEditShell ) ) )
- ((SwEditShell*)pSh)->StartAction();
+ SwEditShell* pSwEditShell = dynamic_cast< SwEditShell* >(pSh);
+ if( pSwEditShell )
+ pSwEditShell->StartAction();
else
pSh->StartAction();
pSh = (ViewShell *)pSh->GetNext();
@@ -121,8 +122,9 @@ void SwEditShell::EndAllAction()
{
ViewShell *pSh = this;
do {
- if( pSh->IsA( TYPE( SwEditShell ) ) )
- ((SwEditShell*)pSh)->EndAction();
+ SwEditShell* pSwEditShell = dynamic_cast< SwEditShell* >(pSh);
+ if( pSwEditShell )
+ pSwEditShell->EndAction();
else
pSh->EndAction();
pSh = (ViewShell *)pSh->GetNext();
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index f97f1eb2f946..f06092a7f746 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -119,12 +119,11 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
rFldType.LockModify();
SwClientIter aIter( rFldType ); // TODO
- SwClient * pLast = aIter.GoStart();
+ SwClient * pLast = aIter.SwClientIter_First();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
// eine DDE-Tabelle oder ein DDE-FeldAttribut im Text
- if( !pLast->IsA( TYPE( SwFmtFld ) ) ||
- ((SwFmtFld*)pLast)->GetTxtFld() )
+ if( !dynamic_cast< SwFmtFld* >(pLast) || ((SwFmtFld*)pLast)->GetTxtFld() )
{
if( !bCallModify )
{
@@ -136,7 +135,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
pLast->ModifyNotification( 0, &aUpdateDDE );
bCallModify = sal_True;
}
- } while( 0 != ( pLast = ++aIter ));
+ } while( 0 != ( pLast = aIter.SwClientIter_Next() ));
rFldType.UnlockModify();
@@ -181,11 +180,11 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const
// hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
const SwNode* pNd = 0;
SwClientIter aIter( rFldType ); // TODO
- SwClient * pLast = aIter.GoStart();
+ SwClient * pLast = aIter.SwClientIter_First();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
// eine DDE-Tabelle oder ein DDE-FeldAttribut im Text
- if( !pLast->IsA( TYPE( SwFmtFld ) ))
+ if( !dynamic_cast< SwFmtFld* >(pLast))
{
SwDepend* pDep = (SwDepend*)pLast;
SwDDETable* pDDETbl = (SwDDETable*)pDep->GetToTell();
@@ -197,7 +196,7 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const
if( pNd && &rFldType.GetDoc()->GetNodes() == &pNd->GetNodes() )
break;
pNd = 0;
- } while( 0 != ( pLast = ++aIter ));
+ } while( 0 != ( pLast = aIter.SwClientIter_Next() ));
return pNd;
}
@@ -208,11 +207,11 @@ sal_Bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
// hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
SwNodes* pNds = &rFldType.GetDoc()->GetNodes();
SwClientIter aIter( rFldType ); // TODO
- SwClient * pLast = aIter.GoStart();
+ SwClient * pLast = aIter.SwClientIter_First();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
// eine DDE-Tabelle oder ein DDE-FeldAttribut im Text
- if( !pLast->IsA( TYPE( SwFmtFld ) ))
+ if( !dynamic_cast< SwFmtFld* >(pLast))
{
SwDepend* pDep = (SwDepend*)pLast;
SwDDETable* pDDETbl = (SwDDETable*)pDep->GetToTell();
@@ -236,7 +235,7 @@ sal_Bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
return sal_True;
}
}
- } while( 0 != ( pLast = ++aIter ));
+ } while( 0 != ( pLast = aIter.SwClientIter_Next() ));
return sal_False;
}
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index fb95379d943d..a639f5f3bf16 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -37,8 +37,6 @@
#include <swtblfmt.hxx>
#include <fieldhint.hxx>
-TYPEINIT1( SwDDETable, SwTable );
-
// Constructor movet alle Lines/Boxen aus der SwTable zu sich.
// Die SwTable ist danach Leer und muss geloescht werden.
SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 311401415e7f..dce1358f632e 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -170,16 +170,18 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage,
const SwFmtPageDesc *pDesc;
sal_uInt32 nMaxItems = rPool.GetItemCount2( RES_PAGEDESC );
for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+ {
if( 0 != (pDesc = (SwFmtPageDesc*)rPool.GetItem2( RES_PAGEDESC, n ) )
&& pDesc->GetNumOffset() && pDesc->GetDefinedIn() )
{
- SwCntntNode* pNd = PTR_CAST( SwCntntNode, pDesc->GetDefinedIn() );
- if( pNd )
+ const SwCntntNode* pSwCntntNode = dynamic_cast< const SwCntntNode* >(pDesc->GetDefinedIn());
+
+ if(pSwCntntNode)
{
- if ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*pNd) )
+ if ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*pSwCntntNode) )
bVirtuell = sal_True;
}
- else if( pDesc->GetDefinedIn()->ISA( SwFmt ))
+ else if( dynamic_cast< const SwFmt* >(pDesc->GetDefinedIn()))
{
SwAutoFmtGetDocNode aGetHt( &pDoc->GetNodes() );
bVirtuell = !pDesc->GetDefinedIn()->GetInfo( aGetHt );
@@ -188,6 +190,7 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage,
}
}
}
+}
/*--------------------------------------------------------------------
Beschreibung: SwPageNumberField
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index ac499dbd8198..bd7e9e34ab8d 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -83,6 +83,7 @@
#include <pagedesc.hxx>
#include <mvsave.hxx>
#include <vcl/virdev.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -193,13 +194,14 @@ sal_Bool SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
else if ( IsObjSelected() )
{
SwPosition aPos( aSttIdx, SwIndex( pTxtNd, 0 ));
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ SdrObject *pObj = aSelection[i];
if( Imp()->GetDrawView()->IsGroupEntered() ||
- ( !pObj->GetUserCall() && pObj->GetUpGroup()) )
+ ( !findConnectionToSdrObjectDirect(pObj) && pObj->GetParentSdrObject()) )
{
SfxItemSet aSet( pClpDoc->GetAttrPool(), aFrmFmtSetRange );
@@ -215,7 +217,7 @@ sal_Bool SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
}
else
{
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall( pObj );
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject( pObj );
SwFrmFmt *pFmt = pContact->GetFmt();
SwFmtAnchor aAnchor( pFmt->GetAnchor() );
if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
@@ -297,28 +299,28 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
{
sal_Bool bRet = sal_True;
+ if(Imp()->GetDrawView()->areSdrObjectsSelected())
+ {
//Die Liste muss kopiert werden, weil unten die neuen Objekte
//selektiert werden.
- const SdrMarkList aMrkList( Imp()->GetDrawView()->GetMarkedObjectList() );
- sal_uLong nMarkCount = aMrkList.GetMarkCount();
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
if( !pDestShell->Imp()->GetDrawView() )
// sollte mal eine erzeugt werden
pDestShell->MakeDrawView();
else if( bSelectInsert )
pDestShell->Imp()->GetDrawView()->UnmarkAll();
- SdrPageView *pDestPgView = pDestShell->Imp()->GetPageView(),
- *pSrcPgView = Imp()->GetPageView();
SwDrawView *pDestDrwView = pDestShell->Imp()->GetDrawView(),
*pSrcDrwView = Imp()->GetDrawView();
SwDoc* pDestDoc = pDestShell->GetDoc();
-
Size aSiz( rInsPt.X() - rSttPt.X(), rInsPt.Y() - rSttPt.Y() );
- for( sal_uInt16 i = 0; i < nMarkCount; ++i )
+
+ for( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject *pObj = aMrkList.GetMark( i )->GetMarkedSdrObj();
+ SdrObject *pObj = aSelection[i];
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall( pObj );
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject( pObj );
SwFrmFmt *pFmt = pContact->GetFmt();
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
@@ -332,10 +334,9 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
(FLY_AS_CHAR != rAnchor.GetAnchorId()) )
{
- SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove &&
- GetDoc() == pDestDoc, sal_False );
- pNew->NbcMove( aSiz );
- pDestDrwView->InsertObjectAtView( pNew, *pDestPgView );
+ SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove && GetDoc() == pDestDoc, false);
+ sdr::legacy::transformSdrObject(*pNew, basegfx::tools::createTranslateB2DHomMatrix(aSiz.Width(), aSiz.Height()));
+ pDestDrwView->InsertObjectAtView( *pNew );
bInsWithFmt = sal_False;
}
}
@@ -356,7 +357,7 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
//uebergebenen DokumentPosition
SwPosition aPos( *GetCrsr()->GetPoint() );
Point aPt( rInsPt );
- aPt -= rSttPt - pObj->GetSnapRect().TopLeft();
+ aPt -= rSttPt - sdr::legacy::GetSnapRect(*pObj).TopLeft();
SwCrsrMoveState aState( MV_SETONLYTEXT );
GetLayout()->GetCrsrOfst( &aPos, aPt, &aState );
const SwNode *pNd;
@@ -390,7 +391,7 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
if( bRet )
{
if( pSrcDrwView->IsGroupEntered() ||
- ( !pObj->GetUserCall() && pObj->GetUpGroup()) )
+ ( !findConnectionToSdrObjectDirect(pObj) && pObj->GetParentSdrObject()) )
{
SfxItemSet aSet( pDestDoc->GetAttrPool(),aFrmFmtSetRange);
aSet.Put( aAnchor );
@@ -410,21 +411,21 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
{
Point aPos( rInsPt );
aPos -= aNewAnch;
- aPos -= rSttPt - pObj->GetSnapRect().TopLeft();
+ aPos -= rSttPt - sdr::legacy::GetSnapRect(*pObj).TopLeft();
// OD 2004-04-05 #i26791# - change attributes instead of
// direct positioning
pFmt->SetFmtAttr( SwFmtHoriOrient( aPos.X(), text::HoriOrientation::NONE, text::RelOrientation::FRAME ) );
pFmt->SetFmtAttr( SwFmtVertOrient( aPos.Y(), text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
// --> OD 2005-04-15 #i47455# - notify draw frame format
// that position attributes are already set.
- if ( pFmt->ISA(SwDrawFrmFmt) )
+ if ( dynamic_cast< SwDrawFrmFmt* >(pFmt) )
{
static_cast<SwDrawFrmFmt*>(pFmt)->PosAttrSet();
}
// <--
}
if( bSelectInsert )
- pDestDrwView->MarkObj( pNew, pDestPgView );
+ pDestDrwView->MarkObj( *pNew );
}
}
}
@@ -434,27 +435,31 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
{
if( pDestShell == this )
{
- const SdrMarkList aList( pSrcDrwView->GetMarkedObjectList() );
+ const SdrObjectVector aList(pSrcDrwView->getSelectedSdrObjectVectorFromSdrMarkView());
+ sal_uInt32 i(0);
+
pSrcDrwView->UnmarkAll();
- sal_uLong nMrkCnt = aMrkList.GetMarkCount();
- sal_uInt16 i;
- for ( i = 0; i < nMrkCnt; ++i )
+ for ( i = 0; i < aSelection.size(); ++i )
{
- SdrObject *pObj = aMrkList.GetMark( i )->GetMarkedSdrObj();
- pSrcDrwView->MarkObj( pObj, pSrcPgView );
+ SdrObject *pObj = aSelection[i];
+ pSrcDrwView->MarkObj( *pObj );
}
+
DelSelectedObj();
- nMrkCnt = aList.GetMarkCount();
- for ( i = 0; i < nMrkCnt; ++i )
+
+ for ( i = 0; i < aList.size(); ++i )
{
- SdrObject *pObj = aList.GetMark( i )->GetMarkedSdrObj();
- pSrcDrwView->MarkObj( pObj, pSrcPgView );
+ SdrObject *pObj = aList[i];
+ pSrcDrwView->MarkObj( *pObj );
}
}
else
+ {
DelSelectedObj();
}
+ }
+ }
return bRet;
}
@@ -580,9 +585,6 @@ sal_Bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
pDestShell->SelectFlyFrm( *pFlyFrm, sal_True );
}
}
-
- if( this != pDestShell && !pDestShell->HasShFcs() )
- pDestShell->Imp()->GetDrawView()->hideMarkHandles();
}
}
else if ( IsObjSelected() )
@@ -933,34 +935,41 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
// Therefore we calculate the absolute position here
// and after the insert the anchor of the object
// is set to the anchor of the group object.
- Rectangle aSnapRect = pNew->GetSnapRect();
- if( pNew->GetAnchorPos().X() || pNew->GetAnchorPos().Y() )
+ Rectangle aSnapRect(sdr::legacy::GetSnapRect(*pNew));
+ if( !pNew->GetAnchorPos().equalZero() )
{
- const Point aPoint( 0, 0 );
// OD 2004-04-05 #i26791# - direct drawing object
// positioning for group members
- pNew->NbcSetAnchorPos( aPoint );
- pNew->NbcSetSnapRect( aSnapRect );
+ pNew->SetAnchorPos( basegfx::B2DPoint() );
+ sdr::legacy::SetSnapRect(*pNew, aSnapRect);
}
- Imp()->GetDrawView()->InsertObjectAtView( pNew, *Imp()->GetPageView() );
+ Imp()->GetDrawView()->InsertObjectAtView( *pNew );
- Point aGrpAnchor( 0, 0 );
- SdrObjList* pList = pNew->GetObjList();
+ basegfx::B2DPoint aGrpAnchor( 0.0, 0.0 );
+ SdrObjList* pList = pNew->getParentOfSdrObject();
if ( pList )
{
- SdrObject* pOwner = pList->GetOwnerObj();
+ SdrObject* pOwner = pList->getSdrObjectFromSdrObjList();
if ( pOwner )
{
- SdrObjGroup* pThisGroup = PTR_CAST(SdrObjGroup, pOwner);
+ SdrObjGroup* pThisGroup = dynamic_cast< SdrObjGroup* >( pOwner);
+
+ if(pThisGroup)
+ {
aGrpAnchor = pThisGroup->GetAnchorPos();
}
+ else
+ {
+ OSL_ENSURE(false, "Not only SdrObjGroup can be parent of SdrObject(s)");
+ }
+ }
}
// OD 2004-04-05 #i26791# - direct drawing object
// positioning for group members
- pNew->NbcSetAnchorPos( aGrpAnchor );
- pNew->SetSnapRect( aSnapRect );
+ pNew->SetAnchorPos(aGrpAnchor);
+ sdr::legacy::SetSnapRect(*pNew, aSnapRect);
bInsWithFmt = sal_False;
}
@@ -1021,10 +1030,10 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
// <--
SdrObject *pObj = pNew->FindSdrObject();
SwDrawView *pDV = Imp()->GetDrawView();
- pDV->MarkObj( pObj, pDV->GetSdrPageView() );
+ pDV->MarkObj( *pObj );
// --> OD 2005-04-15 #i47455# - notify draw frame format
// that position attributes are already set.
- if ( pNew->ISA(SwDrawFrmFmt) )
+ if ( dynamic_cast< SwDrawFrmFmt* >(pNew) )
{
static_cast<SwDrawFrmFmt*>(pNew)->PosAttrSet();
}
@@ -1223,12 +1232,13 @@ sal_Bool SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_u
sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
{
ASSERT( Imp()->HasDrawView(), "GetDrawObjGraphic without DrawView?" );
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
sal_Bool bConvert = sal_True;
- if( rMrkList.GetMarkCount() )
+
+ if(Imp()->GetDrawView()->areSdrObjectsSelected())
{
- if( rMrkList.GetMarkCount() == 1 &&
- rMrkList.GetMark( 0 )->GetMarkedSdrObj()->ISA(SwVirtFlyDrawObj) )
+ const SwVirtFlyDrawObj* pSingleSelected = dynamic_cast< SwVirtFlyDrawObj* >(Imp()->GetDrawView()->getSelectedIfSingle());
+
+ if(pSingleSelected)
{
// Rahmen selektiert
if( CNT_GRF == GetCntType() )
@@ -1298,10 +1308,15 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
}
}
else if( SOT_FORMAT_GDIMETAFILE == nFmt )
+ {
rGrf = Imp()->GetDrawView()->GetMarkedObjMetaFile();
+ }
else if( SOT_FORMAT_BITMAP == nFmt )
+ {
rGrf = Imp()->GetDrawView()->GetMarkedObjBitmapEx();
+ }
}
+
return bConvert;
}
@@ -1321,7 +1336,7 @@ void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SdrModel* _pModel )
if( pOle2Obj )
{
// found an ole2 shape
- SdrObjList* pObjList = pOle2Obj->GetObjList();
+ SdrObjList* pObjList = pOle2Obj->getParentOfSdrObject();
// get its graphic
Graphic aGraphic;
@@ -1332,13 +1347,18 @@ void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SdrModel* _pModel )
pOle2Obj->Disconnect();
// create new graphic shape with the ole graphic and shape size
- SdrGrafObj* pGraphicObj = new SdrGrafObj( aGraphic, pOle2Obj->GetCurrentBoundRect() );
+ SdrGrafObj* pGraphicObj = new SdrGrafObj(
+ *_pModel,
+ aGraphic,
+ pOle2Obj->getSdrObjectTransformation());
+
// apply layer of ole2 shape at graphic shape
pGraphicObj->SetLayer( pOle2Obj->GetLayer() );
// replace ole2 shape with the new graphic object and delete the ol2 shape
- SdrObject* pRemovedObject = pObjList->ReplaceObject( pGraphicObj, pOle2Obj->GetOrdNum() );
- SdrObject::Free( pRemovedObject );
+ SdrObject* pRemovedObject = pObjList->ReplaceObjectInSdrObjList(
+ *pGraphicObj, pOle2Obj->GetNavigationPosition() );
+ deleteSdrObjectSafeAndClearPointer( pRemovedObject );
}
}
}
@@ -1367,18 +1387,17 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
SdrView *pView = Imp()->GetDrawView();
//Drop auf bestehendes Objekt: Objekt ersetzen oder neu Attributieren.
+ SdrObject* pOldObj = pView->getSelectedIfSingle();
if( pModel->GetPageCount() > 0 &&
1 == pModel->GetPage(0)->GetObjCount() &&
- 1 == pView->GetMarkedObjectList().GetMarkCount() )
+ pOldObj )
{
// OD 10.07.2003 #110742# - replace a marked 'virtual' drawing object
// by its corresponding 'master' drawing object in the mark list.
SwDrawView::ReplaceMarkedDrawVirtObjs( *pView );
-
SdrObject* pClpObj = pModel->GetPage(0)->GetObj(0);
- SdrObject* pOldObj = pView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj();
- if( SW_PASTESDR_SETATTR == nAction && pOldObj->ISA(SwVirtFlyDrawObj) )
+ if( SW_PASTESDR_SETATTR == nAction && dynamic_cast< SwVirtFlyDrawObj* >(pOldObj) )
nAction = SW_PASTESDR_REPLACE;
switch( nAction )
@@ -1387,7 +1406,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
{
const SwFrmFmt* pFmt(0);
const SwFrm* pAnchor(0);
- if( pOldObj->ISA(SwVirtFlyDrawObj) )
+ if( dynamic_cast< SwVirtFlyDrawObj* >(pOldObj) )
{
pFmt = FindFrmFmt( pOldObj );
@@ -1404,34 +1423,31 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
}
}
- SdrObject* pNewObj = pClpObj->Clone();
- Rectangle aOldObjRect( pOldObj->GetCurrentBoundRect() );
- Size aOldObjSize( aOldObjRect.GetSize() );
- Rectangle aNewRect( pNewObj->GetCurrentBoundRect() );
- Size aNewSize( aNewRect.GetSize() );
-
- Fraction aScaleWidth( aOldObjSize.Width(), aNewSize.Width() );
- Fraction aScaleHeight( aOldObjSize.Height(), aNewSize.Height());
- pNewObj->NbcResize( aNewRect.TopLeft(), aScaleWidth, aScaleHeight);
+ SdrObject* pNewObj = pClpObj->CloneSdrObject(&pView->getSdrModelFromSdrView());
- Point aVec = aOldObjRect.TopLeft() - aNewRect.TopLeft();
- pNewObj->NbcMove(Size(aVec.X(), aVec.Y()));
+ // copy transformation
+ pNewObj->setSdrObjectTransformation(pOldObj->getSdrObjectTransformation());
- if( pNewObj->ISA( SdrUnoObj ) )
+ if( dynamic_cast< SdrUnoObj* >(pNewObj) )
+ {
pNewObj->SetLayer( GetDoc()->GetControlsId() );
- else if( pOldObj->ISA( SdrUnoObj ) )
+ }
+ else if( dynamic_cast< SdrUnoObj* >(pOldObj) )
+ {
pNewObj->SetLayer( GetDoc()->GetHeavenId() );
+ }
else
+ {
pNewObj->SetLayer( pOldObj->GetLayer() );
+ }
- if( pOldObj->ISA(SwVirtFlyDrawObj) )
+ if( dynamic_cast< SwVirtFlyDrawObj* >(pOldObj) )
{
// Attribute sichern und dam SdrObject setzen
SfxItemSet aFrmSet( pDoc->GetAttrPool(),
RES_SURROUND, RES_ANCHOR );
aFrmSet.Set( pFmt->GetAttrSet() );
- Point aNullPt;
if( pAnchor->IsTxtFrm() && ((SwTxtFrm*)pAnchor)->IsFollow() )
{
const SwTxtFrm* pTmp = (SwTxtFrm*)pAnchor;
@@ -1441,25 +1457,21 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
} while( pTmp->IsFollow() );
pAnchor = pTmp;
}
- if( pOldObj->ISA( SdrCaptionObj ))
- aNullPt = ((SdrCaptionObj*)pOldObj)->GetTailPos();
- else
- aNullPt = aOldObjRect.TopLeft();
- Point aNewAnchor = pAnchor->GetFrmAnchorPos( ::HasWrap( pOldObj ) );
+ const Point aNewAnchor = pAnchor->GetFrmAnchorPos( ::HasWrap( pOldObj ) );
// OD 2004-04-05 #i26791# - direct positioning of Writer
// fly frame object for <SwDoc::Insert(..)>
- pNewObj->NbcSetRelativePos( aNullPt - aNewAnchor );
- pNewObj->NbcSetAnchorPos( aNewAnchor );
-
- pOldObj->GetOrdNum();
+ // #i108739#
+ pNewObj->SetAnchorPos( basegfx::B2DPoint( aNewAnchor.X(), aNewAnchor.Y() ) );
DelSelectedObj();
pFmt = GetDoc()->Insert( *GetCrsr(), *pNewObj, &aFrmSet, NULL );
}
else
- pView->ReplaceObjectAtView( pOldObj, *Imp()->GetPageView(), pNewObj, sal_True );
+ {
+ pView->ReplaceObjectAtView( *pOldObj, *pNewObj, true);
+ }
}
break;
@@ -1483,44 +1495,44 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
{
::sw::DrawUndoGuard drawUndoGuard(GetDoc()->GetIDocumentUndoRedo());
- sal_Bool bDesignMode = pView->IsDesignMode();
+ bool bDesignMode = pView->IsDesignMode();
if( !bDesignMode )
- pView->SetDesignMode( sal_True );
+ pView->SetDesignMode( true );
// --> OD 2005-08-03 #i50824#
// --> OD 2006-03-01 #b6382898#
// method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel );
// <--
- pView->Paste( *pModel, aPos );
+ pView->Paste( *pModel, basegfx::B2DPoint(aPos.X(),aPos.Y()) );
- sal_uLong nCnt = pView->GetMarkedObjectList().GetMarkCount();
- if( nCnt )
+ if( pView->areSdrObjectsSelected() )
{
- const Point aNull( 0, 0 );
- for( sal_uLong i=0; i < nCnt; ++i )
+ const SdrObjectVector aSelection(pView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for( sal_uInt32 i=0; i < aSelection.size(); ++i )
{
- SdrObject *pObj = pView->GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj();
- pObj->ImpSetAnchorPos( aNull );
+ SdrObject *pObj = aSelection[i];
+ pObj->SetAnchorPos( basegfx::B2DPoint() );
}
- pView->SetCurrentObj( OBJ_GRUP, SdrInventor );
- if ( nCnt > 1 )
+ pView->setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_GRUP));
+
+ if ( aSelection.size() > 1 )
pView->GroupMarked();
- SdrObject *pObj = pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- if( pObj->ISA( SdrUnoObj ) )
+ SdrObject *pObj = aSelection[0];
+ if( dynamic_cast< SdrUnoObj* >(pObj) )
{
pObj->SetLayer( GetDoc()->GetControlsId() );
- bDesignMode = sal_True;
+ bDesignMode = true;
}
else
pObj->SetLayer( GetDoc()->GetHeavenId() );
- const Rectangle &rSnap = pObj->GetSnapRect();
- const Size aDiff( rSnap.GetWidth()/2, rSnap.GetHeight()/2 );
- pView->MoveMarkedObj( aDiff );
+ const basegfx::B2DRange aSnapRange(sdr::legacy::GetSnapRange(*pObj));
+ pView->MoveMarkedObj(aSnapRange.getRange() * 0.5);
ImpEndCreate();
if( !bDesignMode )
- pView->SetDesignMode( sal_False );
+ pView->SetDesignMode( false );
}
}
EndUndo();
@@ -1531,12 +1543,12 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
sal_Bool SwFEShell::Paste( const Graphic &rGrf )
{
SET_CURR_SHELL( this );
- SdrObject* pObj;
SdrView *pView = Imp()->GetDrawView();
+ SdrObject* pSingleSelected = pView->getSelectedIfSingle();
- sal_Bool bRet = 1 == pView->GetMarkedObjectList().GetMarkCount() &&
- (pObj = pView->GetMarkedObjectList().GetMark( 0 )->GetMarkedSdrObj())->IsClosedObj() &&
- !pObj->ISA( SdrOle2Obj );
+ sal_Bool bRet = pSingleSelected &&
+ pSingleSelected->IsClosedObj() &&
+ !dynamic_cast< SdrOle2Obj* >(pSingleSelected);
if( bRet )
{
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 488eee34fe16..720539c5a4a9 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -80,6 +80,7 @@
#include <fmtsrnd.hxx>
#include <editeng/opaqitem.hxx>
// <--
+#include <svx/svdlegacy.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -242,7 +243,7 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
// Der Rahmen darf nicht per Dokumentposition selektiert werden, weil er
// auf jedenfall selektiert sein muss!
SwViewImp *pImpl = Imp();
- if( GetWin() && (bNew || !pImpl->GetDrawView()->AreObjectsMarked()) )
+ if( GetWin() && (bNew || !pImpl->GetDrawView()->areSdrObjectsSelected()) )
{
ASSERT( rFrm.IsFlyFrm(), "SelectFlyFrm will einen Fly" );
@@ -262,11 +263,10 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
// if( !rFrm.GetAnchorFrm()->IsInFly() )
// rFrm.Calc();
- if( pImpl->GetDrawView()->AreObjectsMarked() )
+ if( pImpl->GetDrawView()->areSdrObjectsSelected() )
pImpl->GetDrawView()->UnmarkAll();
- pImpl->GetDrawView()->MarkObj( rFrm.GetVirtDrawObj(),
- pImpl->GetPageView(), sal_False, sal_False );
+ pImpl->GetDrawView()->MarkObj( *rFrm.GetVirtDrawObj(), false );
KillPams();
ClearMark();
SelFlyGrabCrsr();
@@ -288,13 +288,14 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const
if ( Imp()->HasDrawView() )
{
// Ein Fly ist genau dann erreichbar, wenn er selektiert ist.
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- if( rMrkList.GetMarkCount() != 1 )
- return 0;
+ SwVirtFlyDrawObj* pCandidate = dynamic_cast< SwVirtFlyDrawObj* >(Imp()->GetDrawView()->getSelectedIfSingle());
- SdrObject *pO = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- return ( pO && pO->ISA(SwVirtFlyDrawObj) ) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0;
+ if(pCandidate)
+ {
+ return pCandidate->GetFlyFrm();
+ }
}
+
return 0;
}
@@ -316,8 +317,23 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
if ( !Imp()->HasDrawView() )
return NULL;
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- if ( !rMrkList.GetMarkCount() )
+ SdrObject *pObj = 0;
+
+ if(Imp()->GetDrawView()->areSdrObjectsSelected())
+ {
+ pObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if(!pObj)
+ {
+ return 0;
+ }
+
+ if(!findConnectionToSdrObject(pObj))
+ {
+ return 0;
+ }
+ }
+ else
{
SwCntntFrm *pCntnt = GetCurrFrm( sal_False );
if( !pCntnt )
@@ -327,24 +343,21 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
return NULL;
return pFly->GetFmt();
}
- else if ( rMrkList.GetMarkCount() != 1 ||
- !GetUserCall(rMrkList.GetMark( 0 )->GetMarkedSdrObj()) )
- return NULL;
- SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
SwFrmFmt *pFmt = FindFrmFmt( pObj );
if( pFmt && FLY_AT_FLY == pFmt->GetAnchor().GetAnchorId() )
{
- const SwFrm* pFly = pObj->ISA(SwVirtFlyDrawObj) ?
+ const SwFrm* pFly = dynamic_cast< SwVirtFlyDrawObj* >(pObj) ?
((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetAnchorFrm() :
- ((SwDrawContact*)GetUserCall(pObj))->GetAnchorFrm( pObj );
+ ((SwDrawContact*)findConnectionToSdrObject(pObj))->GetAnchorFrm( pObj );
ASSERT( pFly, "IsFlyInFly: Where's my anchor?" );
ASSERT( pFly->IsFlyFrm(), "IsFlyInFly: Funny anchor!" );
return ((SwFlyFrm*)pFly)->GetFmt();
}
- Point aTmpPos = pObj->GetCurrentBoundRect().TopLeft();
+ const basegfx::B2DPoint aTopLeft(pObj->getObjectRange(Imp()->GetDrawView()).getMinimum());
+ Point aTmpPos(basegfx::fround(aTopLeft.getX()), basegfx::fround(aTopLeft.getY()));
SwFrm *pTxtFrm;
{
@@ -432,21 +445,22 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
if ( !Imp()->HasDrawView() )
return aRet;
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- if ( rMrkList.GetMarkCount() != 1 ||
- !GetUserCall(rMrkList.GetMark( 0 )->GetMarkedSdrObj()) )
+ SdrObject* pObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if(!pObj || !findConnectionToSdrObject(pObj))
+ {
return aRet;
+ }
- SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
// --> OD 2004-07-16 #i28701#
- SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
+ SwAnchoredObject* pAnchoredObj = ::findConnectionToSdrObject( pObj )->GetAnchoredObj( pObj );
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
RndStdIds nAnchorId = rFmt.GetAnchor().GetAnchorId();
if ( FLY_AS_CHAR == nAnchorId )
return aRet;
- sal_Bool bFlyFrame = pObj->ISA(SwVirtFlyDrawObj);
+ const bool bFlyFrame(dynamic_cast< SwVirtFlyDrawObj* >(pObj));
SwFlyFrm* pFly = 0L;
const SwFrm* pOldAnch;
@@ -943,14 +957,25 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
const SwFrm* pFrm = aPam.GetCntntNode()->getLayoutFrm( GetLayout(), 0, 0, sal_False );
const Point aRelPos( rInsertPosition.X() - pFrm->Frm().Left(),
rInsertPosition.Y() - pFrm->Frm().Top() );
- rDrawObj.SetRelativePos( aRelPos );
+
+ // #i108739#
+ // rDrawObj.SetRelativePos( aRelPos );
+ {
+ const basegfx::B2DPoint aTopLeft(sdr::legacy::GetSnapRange(rDrawObj).getMinimum());
+ const basegfx::B2DPoint aAnchorPos(rDrawObj.GetAnchorPos());
+ const basegfx::B2DPoint aRelativePos(aRelPos.X(), aRelPos.Y());
+ sdr::legacy::transformSdrObject(
+ rDrawObj, basegfx::tools::createTranslateB2DHomMatrix(
+ aRelativePos - aTopLeft + aAnchorPos));
+ }
+
::lcl_FindAnchorPos( *GetDoc(), rInsertPosition, *pFrm, rFlyAttrSet );
}
// insert drawing object into the document creating a new <SwDrawFrmFmt> instance
SwDrawFrmFmt* pFmt = GetDoc()->Insert( aPam, rDrawObj, &rFlyAttrSet, 0 );
// move object to visible layer
- SwContact* pContact = static_cast<SwContact*>(rDrawObj.GetUserCall());
+ SwContact* pContact = findConnectionToSdrObjectDirect(&rDrawObj);
if ( pContact )
{
pContact->MoveObjToVisibleLayer( &rDrawObj );
@@ -959,8 +984,7 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
if ( pFmt )
{
// select drawing object
- Imp()->GetDrawView()->MarkObj( &rDrawObj, Imp()->GetPageView(),
- sal_False, sal_False );
+ Imp()->GetDrawView()->MarkObj( rDrawObj, false );
}
else
{
@@ -1171,12 +1195,14 @@ sal_Bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
!Imp()->HasDrawView() )
return bRet;
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- if ( rMrkList.GetMarkCount() != 1 )
+ SdrObject *pObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if(!pObj)
+ {
return bRet;
+ }
StartUndo();
- SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
SwFrmFmt *pFmt = FindFrmFmt( pObj );
StartAllAction();
if( SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, sal_False ))
@@ -1194,8 +1220,7 @@ sal_Bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
if( GetDoc()->SetFlyFrmAttr( *pFmt, rSet ))
{
bRet = sal_True;
- Point aTmp;
- SelectObj( aTmp, 0, pObj );
+ SelectObj( basegfx::B2DPoint(0.0, 0.0), 0, pObj );
}
EndAllActionAndCall();
EndUndo();
@@ -1288,7 +1313,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocP
{
const SwFrmFmt* pFmt = GetFmtFromObj( *pDocPos );
- if(PTR_CAST(SwFlyFrmFmt, pFmt))
+ if(dynamic_cast< const SwFlyFrmFmt* >( pFmt))
pFly = ((SwFlyFrmFmt*)pFmt)->GetFrm();
}
else
@@ -1396,19 +1421,30 @@ SwRect SwFEShell::GetFlyRect() const
SwRect SwFEShell::GetObjRect() const
{
if( Imp()->HasDrawView() )
- return Imp()->GetDrawView()->GetAllMarkedRect();
- else
{
- SwRect aRect;
- return aRect;
+ const basegfx::B2DRange aAllRange(Imp()->GetDrawView()->getMarkedObjectSnapRange());
+
+ if(!aAllRange.isEmpty())
+ {
+ return Rectangle(
+ (sal_Int32)floor(aAllRange.getMinX()), (sal_Int32)floor(aAllRange.getMinY()),
+ (sal_Int32)ceil(aAllRange.getMaxX()), (sal_Int32)ceil(aAllRange.getMaxY()));
+ }
}
+
+ return SwRect();
}
void SwFEShell::SetObjRect( const SwRect& rRect )
{
if ( Imp()->HasDrawView() )
{
- Imp()->GetDrawView()->SetAllMarkedRect( rRect.SVRect() );
+ const Rectangle aRectangle(rRect.SVRect());
+
+ Imp()->GetDrawView()->SetMarkedObjSnapRange(
+ basegfx::B2DRange(
+ aRectangle.Left(), aRectangle.Top(),
+ aRectangle.Right(), aRectangle.Bottom()));
CallChgLnk(); // rufe das AttrChangeNotify auf der UI-Seite.
}
}
@@ -1632,15 +1668,14 @@ const SwFrmFmt* SwFEShell::IsURLGrfAtPos( const Point& rPt, String* pURL,
return 0;
SdrObject* pObj;
- SdrPageView* pPV;
const SwFrmFmt* pRet = 0;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
sal_uInt16 nOld = pDView->GetHitTolerancePixel();
pDView->SetHitTolerancePixel( 2 );
- if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV,SDRSEARCH_PICKMACRO ) &&
- pObj->ISA(SwVirtFlyDrawObj) )
+ if( pDView->PickObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), pDView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO ) &&
+ dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
const SwFmtURL &rURL = pFly->GetFmt()->GetURL();
@@ -1704,10 +1739,9 @@ const Graphic *SwFEShell::GetGrfAtPos( const Point &rPt,
return 0;
SdrObject* pObj;
- SdrPageView* pPV;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
- if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV ) && pObj->ISA(SwVirtFlyDrawObj) )
+ if( pDView->PickObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), pDView->getHitTolLog(), pObj ) && dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
@@ -1743,23 +1777,28 @@ const SwFrmFmt* SwFEShell::GetFmtFromObj( const Point& rPt, SwRect** pRectToFill
if( Imp()->HasDrawView() )
{
SdrObject* pObj;
- SdrPageView* pPView;
-
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
- sal_uInt16 nOld = pDView->GetHitTolerancePixel();
+ const sal_uInt16 nOld(pDView->GetHitTolerancePixel());
// Tattergrenze fuer Drawing-SS
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
- if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) )
+ if( pDView->PickObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), pDView->getHitTolLog(), pObj, SDRSEARCH_PICKMARKABLE ) )
{
// dann teste mal was es ist:
- if ( pObj->ISA(SwVirtFlyDrawObj) )
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
+ {
pRet = ((SwVirtFlyDrawObj*)pObj)->GetFmt();
- else if ( pObj->GetUserCall() ) //nicht fuer Gruppenobjekte
- pRet = ((SwDrawContact*)pObj->GetUserCall())->GetFmt();
+ }
+ else if ( findConnectionToSdrObjectDirect(pObj) ) //nicht fuer Gruppenobjekte
+ {
+ pRet = ((SwDrawContact*)findConnectionToSdrObjectDirect(pObj))->GetFmt();
+ }
+
if(pRet && pRectToFill)
- **pRectToFill = pObj->GetCurrentBoundRect();
+ {
+ **pRectToFill = sdr::legacy::GetBoundRect(*pObj);
+ }
}
pDView->SetHitTolerancePixel( nOld );
}
@@ -1789,9 +1828,10 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
// OD 23.06.2003 #108784# - investigate 'master' drawing object, if method
// is called for a 'virtual' drawing object.
const SdrObject* pInvestigatedObj;
- if ( rObj.ISA(SwDrawVirtObj) )
+ const SwDrawVirtObj* pDrawVirtObj = dynamic_cast< const SwDrawVirtObj* >(&rObj);
+
+ if ( pDrawVirtObj )
{
- const SwDrawVirtObj* pDrawVirtObj = static_cast<const SwDrawVirtObj*>(&rObj);
pInvestigatedObj = &(pDrawVirtObj->GetReferencedObj());
}
else
@@ -1820,7 +1860,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
}
}
}
- else if( pInvestigatedObj->ISA(SwVirtFlyDrawObj) )
+ else if( dynamic_cast< const SwVirtFlyDrawObj* >(pInvestigatedObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj&)(*pInvestigatedObj)).GetFlyFrm();
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
@@ -1833,9 +1873,9 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
else
eType = OBJCNT_FLY;
}
- else if ( pInvestigatedObj->ISA( SdrObjGroup ) )
+ else if ( dynamic_cast< const SdrObjGroup* >(pInvestigatedObj) )
{
- SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(GetUserCall( pInvestigatedObj ) ) );
+ SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(findConnectionToSdrObject( pInvestigatedObj ) ) );
if ( !pDrawContact )
{
ASSERT( false,
@@ -1869,15 +1909,13 @@ ObjCntType SwFEShell::GetObjCntType( const Point &rPt, SdrObject *&rpObj ) const
if( Imp()->HasDrawView() )
{
SdrObject* pObj;
- SdrPageView* pPView;
-
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
sal_uInt16 nOld = pDView->GetHitTolerancePixel();
// Tattergrenze fuer Drawing-SS
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
- if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) )
+ if( pDView->PickObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), pDView->getHitTolLog(), pObj, SDRSEARCH_PICKMARKABLE ) )
eType = GetObjCntType( *(rpObj = pObj) );
pDView->SetHitTolerancePixel( nOld );
@@ -1889,14 +1927,13 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const
{
ObjCntType eType = OBJCNT_NONE;
- if( Imp()->HasDrawView() )
+ if( Imp()->HasDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected())
{
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for( sal_uInt32 i = 0, nE = rMrkList.GetMarkCount(); i < nE; ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if( !pObj )
- continue;
+ SdrObject* pObj = aSelection[i];
ObjCntType eTmp = GetObjCntType( *pObj );
if( !i )
{
@@ -1919,13 +1956,11 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
const Graphic* pGrf )
{
SET_CURR_SHELL( this );
-
sal_Bool bRet = sal_False;
- const SdrMarkList *pMrkList;
- if( Imp()->HasDrawView() && 1 ==
- ( pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList())->GetMarkCount() )
+ SdrObject* pObj = Imp()->HasDrawView() ? Imp()->GetDrawView()->getSelectedIfSingle() : 0;
+
+ if(pObj)
{
- SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
SwFrmFmt *pFmt = FindFrmFmt( pObj );
// Attribute sichern und dann an der Grafik setzen
@@ -1934,14 +1969,14 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
aFrmSet.Set( pFmt->GetAttrSet() );
// Groesse und Position setzen ??
- if( !pObj->ISA(SwVirtFlyDrawObj) )
+ if( !dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
// dann mal los:
- const Rectangle &rBound = pObj->GetSnapRect();
- Point aRelPos( pObj->GetRelativePos() );
+ const Rectangle aBound(sdr::legacy::GetSnapRect(*pObj));
+ const Point aRelPos(aBound.TopLeft() - sdr::legacy::GetAnchorPos(*pObj));
- const long nWidth = rBound.Right() - rBound.Left();
- const long nHeight= rBound.Bottom() - rBound.Top();
+ const long nWidth = aBound.Right() - aBound.Left();
+ const long nHeight= aBound.Bottom() - aBound.Top();
aFrmSet.Put( SwFmtFrmSize( ATT_MIN_SIZE,
Max( nWidth, long(MINFLY) ),
Max( nHeight, long(MINFLY) )));
@@ -1954,8 +1989,6 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
}
- pObj->GetOrdNum();
-
StartAllAction();
StartUndo();
@@ -2100,10 +2133,10 @@ const String SwFEShell::GetObjTitle() const
if ( Imp()->HasDrawView() )
{
- const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
- if ( pMrkList->GetMarkCount() == 1 )
+ const SdrObject* pObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if ( pObj )
{
- const SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
const SwFrmFmt* pFmt = FindFrmFmt( pObj );
if ( pFmt->Which() == RES_FLYFRMFMT )
{
@@ -2123,10 +2156,10 @@ void SwFEShell::SetObjTitle( const String& rTitle )
{
if ( Imp()->HasDrawView() )
{
- const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
- if ( pMrkList->GetMarkCount() == 1 )
+ SdrObject* pObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if ( pObj )
{
- SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
SwFrmFmt* pFmt = FindFrmFmt( pObj );
if ( pFmt->Which() == RES_FLYFRMFMT )
{
@@ -2147,10 +2180,10 @@ const String SwFEShell::GetObjDescription() const
if ( Imp()->HasDrawView() )
{
- const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
- if ( pMrkList->GetMarkCount() == 1 )
+ const SdrObject* pObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if ( pObj )
{
- const SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
const SwFrmFmt* pFmt = FindFrmFmt( pObj );
if ( pFmt->Which() == RES_FLYFRMFMT )
{
@@ -2170,10 +2203,10 @@ void SwFEShell::SetObjDescription( const String& rDescription )
{
if ( Imp()->HasDrawView() )
{
- const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
- if ( pMrkList->GetMarkCount() == 1 )
+ SdrObject* pObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if ( pObj )
{
- SdrObject* pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
SwFrmFmt* pFmt = FindFrmFmt( pObj );
if ( pFmt->Which() == RES_FLYFRMFMT )
{
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 5c9b7b5ec49e..61f7deec6bcf 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -36,7 +36,6 @@
#include <svx/svdogrp.hxx>
#include <svx/svdocirc.hxx>
#include <svx/svdopath.hxx>
-#include <svx/sxciaitm.hxx>
#include <svx/xfillit.hxx>
#include <svx/svdocapt.hxx>
#include <sfx2/app.hxx>
@@ -85,6 +84,9 @@
#include <sortedobjs.hxx>
#include <HandleAnchorNodeChg.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
+#include <svx/svdview.hxx>
#include <switerator.hxx>
#define SCROLLVAL 75
@@ -94,17 +96,16 @@ using namespace com::sun::star;
//Tattergrenze fuer Drawing-SS
#define MINMOVE ((sal_uInt16)GetOut()->PixelToLogic(Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width())
-SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh )
+SwFlyFrm *GetFlyFromMarked( ViewShell *pSh )
{
- if ( !pLst )
- pLst = pSh->HasDrawView() ? &pSh->Imp()->GetDrawView()->GetMarkedObjectList():0;
+ SwVirtFlyDrawObj* pSwVirtFlyDrawObj = dynamic_cast< SwVirtFlyDrawObj* >(
+ pSh->GetDrawView() ? pSh->Imp()->GetDrawView()->getSelectedIfSingle() : 0);
- if ( pLst && pLst->GetMarkCount() == 1 )
+ if(pSwVirtFlyDrawObj)
{
- SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
- if ( pO && pO->ISA(SwVirtFlyDrawObj) )
- return ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
+ return pSwVirtFlyDrawObj->GetFlyFrm();
}
+
return 0;
}
@@ -130,7 +131,10 @@ extern sal_Bool bNoInterrupt; // in swapp.cxx
pSh->KillPams();
pSh->ClearMark();
// <--
- pSh->SetCrsr( pSh->Imp()->GetDrawView()->GetAllMarkedRect().TopLeft(), sal_True);
+
+ const basegfx::B2DRange aAllRange(pSh->Imp()->GetDrawView()->getMarkedObjectSnapRange());
+
+ pSh->SetCrsr(Point(basegfx::fround(aAllRange.getMinX()), basegfx::fround(aAllRange.getMinY())), true);
}
}
@@ -139,6 +143,11 @@ extern sal_Bool bNoInterrupt; // in swapp.cxx
|* SwFEShell::SelectObj()
*************************************************************************/
+sal_Bool SwFEShell::SelectObj( const basegfx::B2DPoint& rPt, sal_uInt8 nFlag, SdrObject *pObj )
+{
+ return SelectObj(Point(basegfx::fround(rPt.getX()), basegfx::fround(rPt.getY())), nFlag, pObj);
+}
+
sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
{
SwDrawView *pDView = Imp()->GetDrawView();
@@ -149,22 +158,21 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
//AttrChgdNotify (etwa durch Unmark->MarkListHasChgd)
//durchkommen
- const SdrMarkList &rMrkList = pDView->GetMarkedObjectList();
- const sal_Bool bHadSelection = rMrkList.GetMarkCount() ? sal_True : sal_False;
+ const sal_Bool bHadSelection(pDView ? pDView->areSdrObjectsSelected() : sal_False);
const sal_Bool bAddSelect = 0 != (SW_ADD_SELECT & nFlag);
const sal_Bool bEnterGroup = 0 != (SW_ENTER_GROUP & nFlag);
SwFlyFrm* pOldSelFly = 0;
- const Point aOldPos( pDView->GetAllMarkedRect().TopLeft() );
+ const basegfx::B2DRange aAllRange(pDView->getMarkedObjectSnapRange());
+ const Point aOldPos(Point(basegfx::fround(aAllRange.getMinX()), basegfx::fround(aAllRange.getMinY())));
if( bHadSelection )
{
//Unmark rufen wenn !bAddSelect oder wenn ein Fly selektiert ist.
sal_Bool bUnmark = !bAddSelect;
- if ( rMrkList.GetMarkCount() == 1 )
- {
//Wenn ein Fly selektiert ist, so muss er erst deselektiert werden.
- pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
+ pOldSelFly = ::GetFlyFromMarked( this );
+
if ( pOldSelFly )
{
const sal_uInt16 nType = GetCntType();
@@ -192,7 +200,6 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
}
bUnmark = sal_True;
}
- }
if ( bUnmark )
pDView->UnmarkAll();
}
@@ -205,27 +212,29 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
if ( pObj )
{
ASSERT( !bEnterGroup, "SW_ENTER_GROUP is not supported" );
- pDView->MarkObj( pObj, Imp()->GetPageView() );
+ pDView->MarkObj( *pObj );
}
else
{
- pDView->MarkObj( rPt, MINMOVE, bAddSelect, bEnterGroup );
+ pDView->MarkObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), MINMOVE, bAddSelect, bEnterGroup );
}
- const sal_Bool bRet = 0 != rMrkList.GetMarkCount();
+ const sal_Bool bRet(pDView ? pDView->areSdrObjectsSelected() : sal_False);
- if ( rMrkList.GetMarkCount() > 1 )
+ if ( bRet )
{
//Ganz dumm ist es, wenn Zeichenobjekte Selektiert waren und
//nun ein Fly hinzuselektiert wird.
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(pDView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject *pTmpObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- sal_Bool bForget = pTmpObj->ISA(SwVirtFlyDrawObj);
- if( bForget )
+ SwVirtFlyDrawObj* pSwVirtFlyDrawObj = dynamic_cast< SwVirtFlyDrawObj* >(aSelection[i]);
+
+ if(pSwVirtFlyDrawObj)
{
pDView->UnmarkAll();
- pDView->MarkObj( pTmpObj, Imp()->GetPageView(), bAddSelect, bEnterGroup );
+ pDView->MarkObj( *pSwVirtFlyDrawObj, bAddSelect );
break;
}
}
@@ -236,7 +245,7 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
::lcl_GrabCursor(this, pOldSelFly);
if ( GetCntType() & CNT_GRF )
{
- const SwFlyFrm *pTmp = GetFlyFromMarked( &rMrkList, this );
+ const SwFlyFrm *pTmp = GetFlyFromMarked( this );
ASSERT( pTmp, "Graphic without Fly" );
if ( ((SwNoTxtFrm*)pTmp->Lower())->HasAnimation() )
((SwNoTxtFrm*)pTmp->Lower())->StopAnimation( GetOut() );
@@ -283,27 +292,29 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
{
- const SdrMarkList* pMrkList;
- if( !Imp()->GetDrawView() ||
- 0 == (pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList()) ||
- 1 != pMrkList->GetMarkCount())
+ SdrObject* pObj = Imp()->GetDrawView() ? Imp()->GetDrawView()->getSelectedIfSingle() : 0;
+
+ if(!pObj)
+ {
return sal_False;
+ }
+
SwFrm* pOld;
SwFlyFrm* pFly = NULL;
- SdrObject *pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
- if( pObj->ISA(SwVirtFlyDrawObj) )
+
+ if( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
pOld = pFly->AnchorFrm();
}
else
- pOld = ((SwDrawContact*)GetUserCall(pObj))->GetAnchorFrm( pObj );
+ pOld = ((SwDrawContact*)findConnectionToSdrObject(pObj))->GetAnchorFrm( pObj );
sal_Bool bRet = sal_False;
if( pOld )
{
SwFrm* pNew = pOld;
// --> OD 2004-07-16 #i28701#
- SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
+ SwAnchoredObject* pAnchoredObj = ::findConnectionToSdrObject( pObj )->GetAnchoredObj( pObj );
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
SwFmtAnchor aAnch( rFmt.GetAnchor() );
RndStdIds nAnchorId = aAnch.GetAnchorId();
@@ -418,11 +429,11 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
Point aBest;
for( i = 0; (sal_uInt16)i<pPage->GetSortedObjs()->Count(); ++i )
{
- SwAnchoredObject* pAnchObj =
- (*pPage->GetSortedObjs())[i];
- if( pAnchObj->ISA(SwFlyFrm) )
+ SwAnchoredObject* pAnchObj = (*pPage->GetSortedObjs())[i];
+ SwFlyFrm* pTmp = dynamic_cast< SwFlyFrm* >(pAnchObj);
+
+ if( pTmp )
{
- SwFlyFrm* pTmp = static_cast<SwFlyFrm*>(pAnchObj);
if( pTmp == pOld )
bOld = sal_True;
else
@@ -532,27 +543,17 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
|*
*************************************************************************/
-const SdrMarkList* SwFEShell::_GetMarkList() const
-{
- const SdrMarkList* pMarkList = NULL;
- if( Imp()->GetDrawView() != NULL )
- pMarkList = &Imp()->GetDrawView()->GetMarkedObjectList();
- return pMarkList;
-}
-
sal_uInt16 SwFEShell::GetSelFrmType() const
{
- sal_uInt16 eType;
+ sal_uInt16 eType(FRMTYPE_NONE);
// get marked frame list, and check if anything is selected
- const SdrMarkList* pMarkList = _GetMarkList();
- if( pMarkList == NULL || pMarkList->GetMarkCount() == 0 )
- eType = FRMTYPE_NONE;
- else
+ if(Imp()->GetDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected())
{
// obtain marked item as fly frame; if no fly frame, it must
// be a draw object
- const SwFlyFrm* pFly = ::GetFlyFromMarked(pMarkList, (ViewShell*)this);
+ const SwFlyFrm* pFly = ::GetFlyFromMarked((ViewShell*)this);
+
if ( pFly != NULL )
{
if( pFly->IsFlyLayFrm() )
@@ -566,8 +567,10 @@ sal_uInt16 SwFEShell::GetSelFrmType() const
}
}
else
+ {
eType = FRMTYPE_DRAWOBJ;
}
+ }
return eType;
}
@@ -579,14 +582,15 @@ bool SwFEShell::IsSelContainsControl() const
// basically, copy the mechanism from GetSelFrmType(), but call
// CheckControl... if you get a drawing object
- const SdrMarkList* pMarkList = _GetMarkList();
- if( pMarkList != NULL && pMarkList->GetMarkCount() == 1 )
+ const SdrObject* pSingleSelected = Imp()->GetDrawView() ? Imp()->GetDrawView()->getSelectedIfSingle() : 0;
+
+ if(pSingleSelected)
{
// if we have one marked object, get the SdrObject and check
// whether it contains a control
- const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
- bRet = pSdrObject && ::CheckControlLayer( pSdrObject );
+ bRet = ::CheckControlLayer( pSingleSelected );
}
+
return bRet;
}
@@ -596,11 +600,16 @@ bool SwFEShell::IsSelContainsControl() const
|*
*************************************************************************/
+void SwFEShell::ScrollTo( const basegfx::B2DPoint &rPt )
+{
+ ScrollTo(Point(basegfx::fround(rPt.getX()), basegfx::fround(rPt.getY())));
+}
+
void SwFEShell::ScrollTo( const Point &rPt )
{
const SwRect aRect( rPt, rPt );
if ( IsScrollMDI( this, aRect ) &&
- (!Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ||
+ (!Imp()->GetDrawView()->areSdrObjectsSelected() ||
Imp()->IsDragPossible( rPt )) )
{
//SwSaveHdl aSave( Imp() );
@@ -629,11 +638,12 @@ void SwFEShell::SetDragMode( sal_uInt16 eDragMode )
long SwFEShell::BeginDrag( const Point* pPt, sal_Bool )
{
SdrView *pView = Imp()->GetDrawView();
- if ( pView && pView->AreObjectsMarked() )
+ if ( pView && pView->areSdrObjectsSelected() )
{
delete pChainFrom; delete pChainTo; pChainFrom = pChainTo = 0;
- SdrHdl* pHdl = pView->PickHandle( *pPt );
- pView->BegDragObj( *pPt, 0 /*GetWin()*/, pHdl );
+ const basegfx::B2DPoint aB2DPt(pPt->X(), pPt->Y());
+ SdrHdl* pHdl = pView->PickHandle(aB2DPt);
+ pView->BegDragObj( aB2DPt, pHdl );
::FrameNotify( this, FLY_DRAG );
return 1;
}
@@ -651,7 +661,8 @@ long SwFEShell::Drag( const Point *pPt, sal_Bool )
if ( Imp()->GetDrawView()->IsDragObj() )
{
ScrollTo( *pPt );
- Imp()->GetDrawView()->MovDragObj( *pPt );
+ const basegfx::B2DPoint aB2DPt(pPt->X(), pPt->Y());
+ Imp()->GetDrawView()->MovDragObj(aB2DPt);
Imp()->GetDrawView()->ShowDragAnchor();
::FrameNotify( this, FLY_DRAG );
return 1;
@@ -698,8 +709,9 @@ long SwFEShell::EndDrag( const Point *, sal_Bool )
do {
pSh->EndAction();
- if( pSh->IsA( TYPE( SwCrsrShell ) ) )
- ((SwCrsrShell*)pSh)->CallChgLnk();
+ SwCrsrShell* pSwCrsrShell = dynamic_cast< SwCrsrShell* >(pSh);
+ if( pSwCrsrShell )
+ pSwCrsrShell->CallChgLnk();
} while ( this != (pSh = (ViewShell*)pSh->GetNext()) );
GetDoc()->SetModified();
@@ -733,13 +745,15 @@ void SwFEShell::BreakDrag()
const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
{
- if ( Imp()->HasDrawView() )
- {
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
+ SwFlyFrm *pFly = ::GetFlyFromMarked( this );
if( pFly )
{
+ // --> OD 2004-06-11 #i28701# - no format here
+// pFly->GetAnchorFrm()->Calc();
+ SwCntntFrm *pCFrm = pFly->ContainsCntnt();
+ if ( pCFrm )
+ {
SwCntntFrm *pCFrm = pFly->ContainsCntnt();
if ( pCFrm )
{
@@ -761,7 +775,9 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
}
return pFly->GetFmt();
}
+ return pFly->GetFmt();
}
+
return 0;
}
@@ -774,8 +790,11 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
|*
*************************************************************************/
-void lcl_NotifyNeighbours( const SdrMarkList *pLst )
+void lcl_NotifyNeighbours( ViewShell *pSh )
{
+ if(pSh->HasDrawView())
+ {
+ const SdrObjectVector aSelection(pSh->Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
//Die Regeln fuer die Ausweichmanoever haben sich veraendert.
//1. Die Umgebung des Fly und aller innenliegenden muss benachrichtigt
// werden.
@@ -783,14 +802,15 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
//3. Rahmen die dem Rahmen ausweichen bzw. wichen muessen benachrichtigt werden.
//4. Auch Zeichenobjekte koennen Rahmen verdraengen
- for( sal_uInt16 j = 0; j < pLst->GetMarkCount(); ++j )
+ for( sal_uInt32 j(0); j < aSelection.size(); ++j )
{
SwPageFrm *pPage;
sal_Bool bCheckNeighbours = sal_False;
sal_Int16 aHori = text::HoriOrientation::NONE;
SwRect aRect;
- SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
- if ( pO->ISA(SwVirtFlyDrawObj) )
+ SdrObject *pO = aSelection[j]; // TTTT: Changed from always getting the 0th element, couldn't have been correct ?!?
+
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pO) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
@@ -809,7 +829,7 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
}
else
{
- SwFrm* pAnch = ( (SwDrawContact*)GetUserCall(pO) )->GetAnchorFrm( pO );
+ SwFrm* pAnch = ( (SwDrawContact*)findConnectionToSdrObject(pO) )->GetAnchorFrm( pO );
if( !pAnch )
continue;
pPage = pAnch->FindPageFrm();
@@ -822,7 +842,7 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
for ( sal_uInt32 i = 0; i < nCount; ++i )
{
SwAnchoredObject* pAnchoredObj = (*pPage->GetSortedObjs())[i];
- if ( !pAnchoredObj->ISA(SwFlyFrm) )
+ if ( !dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
continue;
SwFlyFrm* pAct = static_cast<SwFlyFrm*>(pAnchoredObj);
@@ -854,14 +874,11 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
}
}
}
+}
void SwFEShell::SelectionToTop( sal_Bool bTop )
{
- ASSERT( Imp()->HasDrawView(), "SelectionToTop without DrawView?" );
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- ASSERT( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
-
- SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
+ SwFlyFrm *pFly = ::GetFlyFromMarked( this );
if ( pFly && pFly->IsFlyInCntFrm() )
return;
@@ -870,18 +887,14 @@ void SwFEShell::SelectionToTop( sal_Bool bTop )
Imp()->GetDrawView()->PutMarkedToTop();
else
Imp()->GetDrawView()->MovMarkedToTop();
- ::lcl_NotifyNeighbours( &rMrkList );
+ ::lcl_NotifyNeighbours( this );
GetDoc()->SetModified();
EndAllAction();
}
void SwFEShell::SelectionToBottom( sal_Bool bBottom )
{
- ASSERT( Imp()->HasDrawView(), "SelectionToBottom without DrawView?" );
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- ASSERT( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
-
- SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
+ SwFlyFrm *pFly = ::GetFlyFromMarked( this );
if ( pFly && pFly->IsFlyInCntFrm() )
return;
@@ -890,7 +903,7 @@ void SwFEShell::SelectionToBottom( sal_Bool bBottom )
Imp()->GetDrawView()->PutMarkedToBtm();
else
Imp()->GetDrawView()->MovMarkedToBtm();
- ::lcl_NotifyNeighbours( &rMrkList );
+ ::lcl_NotifyNeighbours( this );
GetDoc()->SetModified();
EndAllAction();
}
@@ -906,14 +919,13 @@ void SwFEShell::SelectionToBottom( sal_Bool bBottom )
short SwFEShell::GetLayerId() const
{
short nRet = SHRT_MAX;
- if ( Imp()->HasDrawView() )
+ if ( Imp()->HasDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected() )
{
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if( !pObj )
- continue;
+ const SdrObject *pObj = aSelection[i];
if ( nRet == SHRT_MAX )
nRet = pObj->GetLayer();
else if ( nRet != pObj->GetLayer() )
@@ -941,21 +953,20 @@ short SwFEShell::GetLayerId() const
// If <SwFEShell> exists, layout exists!!
void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
{
- if ( Imp()->HasDrawView() )
+ if ( Imp()->HasDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected() )
{
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess();
+
// OD 25.06.2003 #108784# - correct type of <nControls>
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if( !pObj )
- continue;
+ SdrObject* pObj = aSelection[i];
// OD 21.08.2003 #i18447# - no change of layer for controls
// or group objects containing controls.
// --> OD 2010-09-14 #i113730#
// consider that a member of a drawing group has been selected.
- const SwContact* pContact = ::GetUserCall( pObj );
+ const SwContact* pContact = dynamic_cast< SwDrawContact* >(findConnectionToSdrObject(pObj));
ASSERT( pContact && pContact->GetMaster(), "<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
const bool bControlObj = ( pContact && pContact->GetMaster() )
? ::CheckControlLayer( pContact->GetMaster() )
@@ -964,8 +975,8 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
if ( !bControlObj && pObj->GetLayer() != nLayerId )
{
pObj->SetLayer( nLayerId );
- InvalidateWindows( SwRect( pObj->GetCurrentBoundRect() ) );
- if ( pObj->ISA(SwVirtFlyDrawObj) )
+ InvalidateWindows( SwRect( sdr::legacy::GetBoundRect(*pObj) ) );
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
SwFmt *pFmt = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetFmt();
SvxOpaqueItem aOpa( pFmt->GetOpaque() );
@@ -994,21 +1005,25 @@ void SwFEShell::SelectionToHell()
|*
*************************************************************************/
-sal_uInt16 SwFEShell::IsObjSelected() const
+sal_uInt32 SwFEShell::GetNumberOfSelectedObjects() const
{
if ( IsFrmSelected() || !Imp()->HasDrawView() )
return 0;
else
- return sal_uInt16( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() );
+ return Imp()->GetDrawView()->getSelectedSdrObjectCount();
}
-sal_Bool SwFEShell::IsFrmSelected() const
+sal_Bool SwFEShell::IsObjSelected() const
{
- if ( !Imp()->HasDrawView() )
+ if ( IsFrmSelected() || !Imp()->HasDrawView() )
return sal_False;
else
- return 0 != ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(),
- (ViewShell*)this );
+ return Imp()->GetDrawView()->areSdrObjectsSelected();
+}
+
+sal_Bool SwFEShell::IsFrmSelected() const
+{
+ return 0 != ::GetFlyFromMarked( (ViewShell*)this );
}
sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
@@ -1016,8 +1031,7 @@ sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
if ( IsFrmSelected() || !Imp()->HasDrawView() )
return sal_False;
else
- return Imp()->GetDrawView()
- ->IsObjMarked( const_cast< SdrObject * >( &rObj ) );
+ return Imp()->GetDrawView()->IsObjMarked(rObj);
}
/*************************************************************************
@@ -1038,41 +1052,50 @@ void SwFEShell::EndTextEdit()
StartAllAction();
SdrView *pView = Imp()->GetDrawView();
SdrObject *pObj = pView->GetTextEditObject();
- SdrObjUserCall* pUserCall;
- if( 0 != ( pUserCall = GetUserCall(pObj) ) )
+ SwDrawContact* pSwDrawContact;
+ if( 0 != ( pSwDrawContact = dynamic_cast< SwDrawContact* >(findConnectionToSdrObject(pObj)) ) )
{
- SdrObject *pTmp = ((SwContact*)pUserCall)->GetMaster();
+ SdrObject *pTmp = pSwDrawContact->GetMaster();
if( !pTmp )
pTmp = pObj;
- pUserCall->Changed( *pTmp, SDRUSERCALL_RESIZE, pTmp->GetLastBoundRect() );
+ pSwDrawContact->HandleChanged(*pTmp, HINT_OBJCHG_RESIZE);
}
- if ( !pObj->GetUpGroup() )
+ if ( !pObj->GetParentSdrObject() )
{
if ( SDRENDTEXTEDIT_SHOULDBEDELETED == pView->SdrEndTextEdit(sal_True) )
{
- if ( pView->GetMarkedObjectList().GetMarkCount() > 1 )
+ if ( pView->getSelectedSdrObjectCount() > 1 )
{
+ SdrObjectVector aSave(pView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 a(0); a < aSave.size(); a++)
{
- SdrMarkList aSave( pView->GetMarkedObjectList() );
- aSave.DeleteMark( aSave.FindObject( pObj ) );
- if ( aSave.GetMarkCount() )
+ if(aSave[a] == pObj)
+ {
+ aSave.erase(aSave.begin() + a);
+ break;
+ }
+ }
+
+ if ( aSave.size() )
{
pView->UnmarkAll();
- pView->MarkObj( pObj, Imp()->GetPageView() );
+ pView->MarkObj( *pObj );
}
+
DelSelectedObj();
- if ( aSave.GetMarkCount() )
+
+ for ( sal_uInt32 i = 0; i < aSave.size(); ++i )
{
- for ( sal_uInt16 i = 0; i < aSave.GetMarkCount(); ++i )
- pView->MarkObj( aSave.GetMark( i )->GetMarkedSdrObj(),
- Imp()->GetPageView() );
- }
+ pView->MarkObj( *aSave[i] );
}
}
else
+ {
DelSelectedObj();
}
}
+ }
else
pView->SdrEndTextEdit();
EndAllAction();
@@ -1084,18 +1107,18 @@ void SwFEShell::EndTextEdit()
|*
*************************************************************************/
-int SwFEShell::IsInsideSelectedObj( const Point &rPt )
+int SwFEShell::IsInsideSelectedObj( const basegfx::B2DPoint &rPt )
{
if( Imp()->HasDrawView() )
{
SwDrawView *pDView = Imp()->GetDrawView();
- if( pDView->GetMarkedObjectList().GetMarkCount() &&
- pDView->IsMarkedObjHit( rPt ) )
+ if( pDView->areSdrObjectsSelected() && pDView->IsMarkedObjHit( rPt ) )
{
return SDRHIT_OBJECT;
}
}
+
return SDRHIT_NONE;
}
@@ -1105,12 +1128,20 @@ int SwFEShell::IsInsideSelectedObj( const Point &rPt )
|*
*************************************************************************/
+bool SwFEShell::IsObjSelectable( const basegfx::B2DPoint& rPt )
+{
+ return IsObjSelectable(Point(basegfx::fround(rPt.getX()), basegfx::fround(rPt.getY())));
+}
+
bool SwFEShell::IsObjSelectable( const Point& rPt )
{
SET_CURR_SHELL(this);
#ifdef OLD
if( Imp()->HasDrawView() )
- return Imp()->GetDrawView()->PickSomething( rPt, MINMOVE );
+ {
+ return Imp()->GetDrawView()->PickSomething( basegfx::B2DPoint(rPt.X(), rPt.Y()), MINMOVE );
+ }
+
return 0;
#else
SwDrawView *pDView = Imp()->GetDrawView();
@@ -1118,12 +1149,11 @@ bool SwFEShell::IsObjSelectable( const Point& rPt )
if( pDView )
{
SdrObject* pObj;
- SdrPageView* pPV;
- sal_uInt16 nOld = pDView->GetHitTolerancePixel();
+ const double fOld(pDView->GetHitTolerancePixel());
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
- bRet = 0 != pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMARKABLE );
- pDView->SetHitTolerancePixel( nOld );
+ bRet = 0 != pDView->PickObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), pDView->getHitTolLog(), pObj, SDRSEARCH_PICKMARKABLE );
+ pDView->SetHitTolerancePixel(fOld);
}
return bRet;
#endif
@@ -1140,12 +1170,11 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
if(pDrawView)
{
SdrObject* pObj;
- SdrPageView* pPV;
- sal_uInt16 nOld(pDrawView->GetHitTolerancePixel());
+ const double fOld(pDrawView->GetHitTolerancePixel());
pDrawView->SetHitTolerancePixel(pDrawView->GetMarkHdlSizePixel()/2);
- bRet = pDrawView->PickObj(rPt, pDrawView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMARKABLE);
- pDrawView->SetHitTolerancePixel(nOld);
+ bRet = pDrawView->PickObj(basegfx::B2DPoint(rPt.X(), rPt.Y()), pDrawView->getHitTolLog(), pObj, SDRSEARCH_PICKMARKABLE);
+ pDrawView->SetHitTolerancePixel(fOld);
if ( bRet && pObj )
{
@@ -1157,7 +1186,7 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
{
if ( pObj->GetLayer() == pIDDMA->GetHellId() )
{
- const SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
+ const SwAnchoredObject* pAnchoredObj = ::findConnectionToSdrObject( pObj )->GetAnchoredObj( pObj );
const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
const SwFmtSurround& rSurround = rFmt.GetSurround();
if ( rSurround.GetSurround() == SURROUND_THROUGHT )
@@ -1188,7 +1217,7 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
SwRect aCursorCharRect;
if ( pTxtFrm->GetCharRect( aCursorCharRect, *pPos ) )
{
- if ( aCursorCharRect.IsOver( SwRect( pObj->GetLastBoundRect() ) ) )
+ if ( aCursorCharRect.IsOver( SwRect( sdr::legacy::GetBoundRect(*pObj) ) ) )
{
bRet = sal_False;
}
@@ -1211,12 +1240,12 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
if ( bRet )
{
const SdrPage* pPage = pIDDMA->GetDrawModel()->GetPage(0);
- for(sal_uInt32 a(pObj->GetOrdNum() + 1); bRet && a < pPage->GetObjCount(); a++)
+ for(sal_uInt32 a(pObj->GetNavigationPosition() + 1); bRet && a < pPage->GetObjCount(); a++)
{
SdrObject *pCandidate = pPage->GetObj(a);
- if (pCandidate->ISA(SwVirtFlyDrawObj) &&
- ( (SwVirtFlyDrawObj*)pCandidate)->GetCurrentBoundRect().IsInside(rPt) )
+ if (dynamic_cast< SwVirtFlyDrawObj* >(pCandidate) &&
+ sdr::legacy::GetBoundRect(*( (SwVirtFlyDrawObj*)pCandidate)).IsInside(rPt) )
{
bRet = sal_False;
}
@@ -1243,13 +1272,13 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
sal_Bool lcl_IsControlGroup( const SdrObject *pObj )
{
sal_Bool bRet = sal_False;
- if(pObj->ISA(SdrUnoObj))
+ if(dynamic_cast< const SdrUnoObj* >(pObj))
bRet = sal_True;
- else if( pObj->ISA( SdrObjGroup ) )
+ else if( dynamic_cast< const SdrObjGroup* >(pObj) )
{
bRet = sal_True;
- const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
- for ( sal_uInt16 i = 0; i < pLst->GetObjCount(); ++i )
+ const SdrObjList *pLst = pObj->getChildrenOfSdrObject();
+ for ( sal_uInt32 i = 0; i < pLst->GetObjCount(); ++i )
if( !::lcl_IsControlGroup( pLst->GetObj( i ) ) )
return sal_False;
}
@@ -1268,7 +1297,7 @@ namespace
virtual bool includeObject( const SdrObject& i_rObject ) const
{
- return m_pPV && m_pPV->GetView().IsObjMarkable( const_cast< SdrObject* >( &i_rObject ), m_pPV );
+ return m_pPV && m_pPV->GetView().IsObjMarkable( i_rObject );
}
private:
@@ -1298,38 +1327,39 @@ const SdrObject* SwFEShell::GetBestObject( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_
if( pFly )
pBest = pFly->GetVirtDrawObj();
}
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- SdrPageView* pPV = Imp()->GetDrawView()->GetSdrPageView();
+ SdrPageView* pPV = Imp()->GetDrawView()->GetSdrPageView();
MarkableObjectsOnly aDefaultFilter( pPV );
if ( !pFilter )
pFilter = &aDefaultFilter;
- if( !pBest || rMrkList.GetMarkCount() == 1 )
+ const SdrObject* pStartObj = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if( !pBest || pStartObj)
{
// Ausgangspunkt bestimmen.
SdrObjList* pList = NULL;
- if ( rMrkList.GetMarkCount() )
+
+ if ( pStartObj )
{
- const SdrObject* pStartObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
- if( pStartObj->ISA(SwVirtFlyDrawObj) )
+ if( dynamic_cast< const SwVirtFlyDrawObj* >(pStartObj) )
aPos = ((SwVirtFlyDrawObj*)pStartObj)->GetFlyFrm()->Frm().Pos();
else
- aPos = pStartObj->GetSnapRect().TopLeft();
+ aPos = sdr::legacy::GetSnapRect(*pStartObj).TopLeft();
// If an object inside a group is selected, we want to
// iterate over the group members.
- if ( ! pStartObj->GetUserCall() )
- pList = pStartObj->GetObjList();
+ if ( ! findConnectionToSdrObjectDirect(pStartObj) )
+ pList = pStartObj->getParentOfSdrObject();
}
else
{
// If no object is selected, we check if we just entered a group.
// In this case we want to iterate over the group members.
aPos = GetCharRect().Center();
- const SdrObject* pStartObj = pPV ? pPV->GetAktGroup() : 0;
- if ( pStartObj && pStartObj->ISA( SdrObjGroup ) )
- pList = pStartObj->GetSubList();
+ const SdrObject* pStartObj = pPV ? pPV->GetCurrentGroup() : 0;
+ if ( pStartObj && dynamic_cast< const SdrObjGroup* >(pStartObj) )
+ pList = pStartObj->getChildrenOfSdrObject();
}
if ( ! pList )
@@ -1340,14 +1370,13 @@ const SdrObject* SwFEShell::GetBestObject( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_
pList = getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 );
}
-
ASSERT( pList, "No object list to iterate" )
SdrObjListIter aObjIter( *pList, bFlat ? IM_FLAT : IM_DEEPNOGROUPS );
while ( aObjIter.IsMore() )
{
SdrObject* pObj = aObjIter.Next();
- sal_Bool bFlyFrm = pObj->ISA(SwVirtFlyDrawObj);
+ bool bFlyFrm(dynamic_cast< SwVirtFlyDrawObj* >(pObj));
if( ( bNoFly && bFlyFrm ) ||
( bNoDraw && !bFlyFrm ) ||
( eType == GOTOOBJ_DRAW_SIMPLE && lcl_IsControlGroup( pObj ) ) ||
@@ -1383,7 +1412,7 @@ const SdrObject* SwFEShell::GetBestObject( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_
aCurPos = pFly->Frm().Pos();
}
else
- aCurPos = pObj->GetCurrentBoundRect().TopLeft();
+ aCurPos = sdr::legacy::GetBoundRect(*pObj).TopLeft();
// Sonderfall wenn ein anderes Obj auf selber Y steht.
if( aCurPos != aPos && // nur wenn ich es nicht selber bin
@@ -1396,7 +1425,7 @@ const SdrObject* SwFEShell::GetBestObject( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_
while ( aTmpIter.IsMore() )
{
SdrObject* pTmpObj = aTmpIter.Next();
- bFlyFrm = pTmpObj->ISA(SwVirtFlyDrawObj);
+ bFlyFrm = dynamic_cast< SwVirtFlyDrawObj* >(pTmpObj);
if( ( bNoFly && bFlyFrm ) || ( bNoDraw && !bFlyFrm ) )
continue;
if( bFlyFrm )
@@ -1405,7 +1434,7 @@ const SdrObject* SwFEShell::GetBestObject( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_
aCurPos = pO->GetFlyFrm()->Frm().Pos();
}
else
- aCurPos = pTmpObj->GetCurrentBoundRect().TopLeft();
+ aCurPos = sdr::legacy::GetBoundRect(*pTmpObj).TopLeft();
if( aCurPos != aPos && aCurPos.Y() == aPos.Y() &&
(bNext? (aCurPos.X() > aPos.X()) : // liegt neben mir
@@ -1460,7 +1489,7 @@ sal_Bool SwFEShell::GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
if ( !pBest )
return sal_False;
- sal_Bool bFlyFrm = pBest->ISA(SwVirtFlyDrawObj);
+ const bool bFlyFrm(dynamic_cast< const SwVirtFlyDrawObj* >(pBest));
if( bFlyFrm )
{
SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pBest;
@@ -1471,9 +1500,9 @@ sal_Bool SwFEShell::GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
}
else
{
- SelectObj( Point(), 0, (SdrObject*)pBest );
+ SelectObj( basegfx::B2DPoint(0.0, 0.0), 0, (SdrObject*)pBest );
if( !ActionPend() )
- MakeVisible( pBest->GetCurrentBoundRect() );
+ MakeVisible(pBest->getObjectRange(Imp()->GetDrawView()));
}
CallChgLnk();
return sal_True;
@@ -1485,45 +1514,33 @@ sal_Bool SwFEShell::GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
|*
*************************************************************************/
-sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos )
+bool SwFEShell::BeginCreate(const SdrObjectCreationInfo& rSdrObjectCreationInfo, const basegfx::B2DPoint& rPos )
{
- sal_Bool bRet = sal_False;
+ bool bRet(false);
if ( !Imp()->HasDrawView() )
Imp()->MakeDrawView();
if ( GetPageNumber( rPos ) )
{
- Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind );
- if ( eSdrObjectKind == OBJ_CAPTION )
+ Imp()->GetDrawView()->setSdrObjectCreationInfo(rSdrObjectCreationInfo);
+
+ if(OBJ_CAPTION == rSdrObjectCreationInfo.getIdent())
+ {
bRet = Imp()->GetDrawView()->BegCreateCaptionObj(
- rPos, Size( lMinBorder - MINFLY, lMinBorder - MINFLY ),
- GetOut() );
+ rPos,
+ basegfx::B2DVector(lMinBorder - MINFLY, lMinBorder - MINFLY));
+ }
else
- bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
+ {
+ bRet = Imp()->GetDrawView()->BegCreateObj( rPos );
+ }
}
if ( bRet )
{
::FrameNotify( this, FLY_DRAG_START );
}
- return bRet;
-}
-
-sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sal_uInt32 eObjInventor,
- const Point &rPos )
-{
- sal_Bool bRet = sal_False;
- if ( !Imp()->HasDrawView() )
- Imp()->MakeDrawView();
-
- if ( GetPageNumber( rPos ) )
- {
- Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind, eObjInventor );
- bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
- }
- if ( bRet )
- ::FrameNotify( this, FLY_DRAG_START );
return bRet;
}
@@ -1533,12 +1550,14 @@ sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sa
|*
*************************************************************************/
-void SwFEShell::MoveCreate( const Point &rPos )
+void SwFEShell::MoveCreate( const basegfx::B2DPoint &rPos )
{
ASSERT( Imp()->HasDrawView(), "MoveCreate without DrawView?" );
+
if ( GetPageNumber( rPos ) )
{
- ScrollTo( rPos );
+ const Point aOldPos(basegfx::fround(rPos.getX()), basegfx::fround(rPos.getY()));
+ ScrollTo( aOldPos );
Imp()->GetDrawView()->MovCreateObj( rPos );
::FrameNotify( this, FLY_DRAG );
}
@@ -1550,7 +1569,7 @@ void SwFEShell::MoveCreate( const Point &rPos )
|*
*************************************************************************/
-sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
+bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
{
// Damit das Undo-Object aus der DrawEngine nicht bei uns
// gespeichert wird, (wir erzeugen ein eigenes Undo-Object!) hier kurz
@@ -1581,12 +1600,10 @@ sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
sal_Bool SwFEShell::ImpEndCreate()
{
- ASSERT( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1,
- "Neues Object nicht selektiert." );
-
- SdrObject& rSdrObj = *Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
+ SdrObject* pSdrObj = Imp()->GetDrawView()->getSelectedIfSingle();
+ OSL_ENSURE( pSdrObj, "Neues Object nicht selektiert." );
- if( rSdrObj.GetSnapRect().IsEmpty() )
+ if( sdr::legacy::GetSnapRect(*pSdrObj).IsEmpty() )
{
// das Object vergessen wir lieber, fuerht nur
// zu Problemen
@@ -1596,13 +1613,15 @@ sal_Bool SwFEShell::ImpEndCreate()
return sal_False;
}
- if( rSdrObj.GetUpGroup() )
+ if( pSdrObj->GetParentSdrObject() )
{
- Point aTmpPos( rSdrObj.GetSnapRect().TopLeft() );
- Point aNewAnchor( rSdrObj.GetUpGroup()->GetAnchorPos() );
+ Point aTmpPos( sdr::legacy::GetSnapRect(*pSdrObj).TopLeft() );
+ const basegfx::B2DPoint& rNewAnchor( pSdrObj->GetParentSdrObject()->GetAnchorPos() );
// OD 2004-04-05 #i26791# - direct object positioning for group members
- rSdrObj.NbcSetRelativePos( aTmpPos - aNewAnchor );
- rSdrObj.NbcSetAnchorPos( aNewAnchor );
+
+ // #i108739#
+ pSdrObj->SetAnchorPos(rNewAnchor);
+
::FrameNotify( this, FLY_DRAG );
return sal_True;
}
@@ -1612,20 +1631,20 @@ sal_Bool SwFEShell::ImpEndCreate()
Imp()->GetDrawView()->UnmarkAll();
- const Rectangle &rBound = rSdrObj.GetSnapRect();
+ const Rectangle rBound(sdr::legacy::GetSnapRect(*pSdrObj));
Point aPt( rBound.TopRight() );
//Fremde Identifier sollen in den Default laufen.
//Ueberschneidungen sind moeglich!!
- sal_uInt16 nIdent = SdrInventor == rSdrObj.GetObjInventor()
- ? rSdrObj.GetObjIdentifier()
+ sal_uInt16 nIdent = SdrInventor == pSdrObj->GetObjInventor()
+ ? pSdrObj->GetObjIdentifier()
: 0xFFFF;
//Default fuer Controls ist Zeichengebunden, Absatzgebunden sonst.
SwFmtAnchor aAnch;
const SwFrm *pAnch = 0;
sal_Bool bCharBound = sal_False;
- if( rSdrObj.ISA( SdrUnoObj ) )
+ if( dynamic_cast< SdrUnoObj* >(pSdrObj) )
{
SwPosition aPos( GetDoc()->GetNodes() );
SwCrsrMoveState aState( MV_SETONLYTEXT );
@@ -1795,12 +1814,11 @@ sal_Bool SwFEShell::ImpEndCreate()
if( !pPg )
{
SdrModel* pTmpSdrModel = getIDocumentDrawModelAccess()->GetDrawModel();
- pPg = pTmpSdrModel->AllocPage( sal_False );
+ pPg = pTmpSdrModel->AllocPage( false );
pTmpSdrModel->InsertPage( pPg );
}
- pPg->RecalcObjOrdNums();
- SdrObject* pRemovedObject = pPg->RemoveObject( rSdrObj.GetOrdNumDirect() );
- SdrObject::Free( pRemovedObject );
+ SdrObject* pRemovedObject = pPg->RemoveObjectFromSdrObjList( pSdrObj->GetNavigationPosition() );
+ deleteSdrObjectSafeAndClearPointer( pRemovedObject );
GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
SwFlyFrm* pFlyFrm;
@@ -1836,12 +1854,6 @@ sal_Bool SwFEShell::ImpEndCreate()
}
else
{
- Point aRelNullPt;
- if( OBJ_CAPTION == nIdent )
- aRelNullPt = ((SdrCaptionObj&)rSdrObj).GetTailPos();
- else
- aRelNullPt = rBound.TopLeft();
-
aSet.Put( aAnch );
aSet.Put( SwFmtSurround( SURROUND_THROUGHT ) );
// OD 2004-03-30 #i26791# - set horizontal position
@@ -1869,9 +1881,9 @@ sal_Bool SwFEShell::ImpEndCreate()
pFmt->PosAttrSet();
// <--
- SwDrawContact *pContact = new SwDrawContact( pFmt, &rSdrObj );
+ SwDrawContact *pContact = new SwDrawContact( pFmt, pSdrObj );
// --> OD 2004-11-22 #i35635#
- pContact->MoveObjToVisibleLayer( &rSdrObj );
+ pContact->MoveObjToVisibleLayer( pSdrObj );
// <--
if( bCharBound )
{
@@ -1901,13 +1913,11 @@ sal_Bool SwFEShell::ImpEndCreate()
SdrObject* pMarkObj = pContact->GetDrawObjectByAnchorFrm( *pAnch );
if ( pMarkObj )
{
- Imp()->GetDrawView()->MarkObj( pMarkObj, Imp()->GetPageView(),
- sal_False, sal_False );
+ Imp()->GetDrawView()->MarkObj( *pMarkObj, false );
}
else
{
- Imp()->GetDrawView()->MarkObj( &rSdrObj, Imp()->GetPageView(),
- sal_False, sal_False );
+ Imp()->GetDrawView()->MarkObj( *pSdrObj, false );
}
}
}
@@ -1940,9 +1950,9 @@ void SwFEShell::BreakCreate()
|*
*************************************************************************/
-sal_Bool SwFEShell::IsDrawCreate() const
+bool SwFEShell::IsDrawCreate() const
{
- return Imp()->HasDrawView() ? Imp()->GetDrawView()->IsCreateObj() : sal_False;
+ return Imp()->HasDrawView() ? 0 != Imp()->GetDrawView()->GetCreateObj() : sal_False;
}
/*************************************************************************
@@ -1951,22 +1961,30 @@ sal_Bool SwFEShell::IsDrawCreate() const
|*
*************************************************************************/
-sal_Bool SwFEShell::BeginMark( const Point &rPos )
+bool SwFEShell::BeginMark(const basegfx::B2DPoint& rPos)
{
if ( !Imp()->HasDrawView() )
+ {
Imp()->MakeDrawView();
+ }
if ( GetPageNumber( rPos ) )
{
SwDrawView* pDView = Imp()->GetDrawView();
if (pDView->HasMarkablePoints())
+ {
return pDView->BegMarkPoints( rPos );
+ }
else
+ {
return pDView->BegMarkObj( rPos );
}
+ }
else
- return sal_False;
+ {
+ return false;
+ }
}
/*************************************************************************
@@ -1975,7 +1993,7 @@ sal_Bool SwFEShell::BeginMark( const Point &rPos )
|*
*************************************************************************/
-void SwFEShell::MoveMark( const Point &rPos )
+void SwFEShell::MoveMark( const basegfx::B2DPoint& rPos )
{
ASSERT( Imp()->HasDrawView(), "MoveMark without DrawView?" );
@@ -1983,14 +2001,19 @@ void SwFEShell::MoveMark( const Point &rPos )
{
ScrollTo( rPos );
SwDrawView* pDView = Imp()->GetDrawView();
-// Imp()->GetDrawView()->MovMarkObj( rPos );
if (pDView->IsInsObjPoint())
+ {
pDView->MovInsObjPoint( rPos );
+ }
else if (pDView->IsMarkPoints())
+ {
pDView->MovMarkPoints( rPos );
+ }
else
+ {
pDView->MovAction( rPos );
+ }
}
}
@@ -2000,7 +2023,7 @@ void SwFEShell::MoveMark( const Point &rPos )
|*
*************************************************************************/
-sal_Bool SwFEShell::EndMark()
+bool SwFEShell::EndMark()
{
sal_Bool bRet = sal_False;
ASSERT( Imp()->HasDrawView(), "EndMark without DrawView?" );
@@ -2011,37 +2034,28 @@ sal_Bool SwFEShell::EndMark()
if ( bRet )
{
- sal_Bool bShowHdl = sal_False;
SwDrawView* pDView = Imp()->GetDrawView();
//Rahmen werden auf diese Art nicht Selektiert, es sein denn es
//ist nur ein Rahmen.
- SdrMarkList &rMrkList = (SdrMarkList&)pDView->GetMarkedObjectList();
- SwFlyFrm* pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
+ SwFlyFrm* pOldSelFly = ::GetFlyFromMarked( this );
- if ( rMrkList.GetMarkCount() > 1 )
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ if ( pDView->getSelectedSdrObjectCount() > 1 )
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if( pObj->ISA(SwVirtFlyDrawObj) )
+ const SdrObjectVector aSelection(pDView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- if ( !bShowHdl )
+ SdrObject *pObj = aSelection[i];
+
+ if( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
- //HMHpDView->HideMarkHdl();
- bShowHdl = sal_True;
+ // deselect SwVirtFlyDrawObj's
+ pDView->MarkObj(*pObj, true);
}
- rMrkList.DeleteMark( i );
- --i; //keinen auslassen.
}
}
- if( bShowHdl )
- {
- pDView->MarkListHasChanged();
- pDView->AdjustMarkHdl();
- //HMHpDView->ShowMarkHdl();
- }
-
- if ( rMrkList.GetMarkCount() )
+ if ( pDView->areSdrObjectsSelected() )
::lcl_GrabCursor(this, pOldSelFly);
else
bRet = sal_False;
@@ -2080,18 +2094,19 @@ void SwFEShell::BreakMark()
short SwFEShell::GetAnchorId() const
{
short nRet = SHRT_MAX;
- if ( Imp()->HasDrawView() )
+ if ( Imp()->HasDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected() )
{
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if ( pObj->ISA(SwVirtFlyDrawObj) )
+ SdrObject *pObj = aSelection[i];
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
nRet = -1;
break;
}
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
short nId = static_cast<short>(pContact->GetFmt()->GetAnchor().GetAnchorId());
if ( nRet == SHRT_MAX )
nRet = nId;
@@ -2116,13 +2131,13 @@ short SwFEShell::GetAnchorId() const
void SwFEShell::ChgAnchor( int eAnchorId, sal_Bool bSameOnly, sal_Bool bPosCorr )
{
ASSERT( Imp()->HasDrawView(), "ChgAnchor without DrawView?" );
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- if( rMrkList.GetMarkCount() &&
- !rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
+ const SdrObjectVector aSdrObjectVector = Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView();
+ if( aSdrObjectVector.size() &&
+ !aSdrObjectVector[0]->GetParentSdrObject() )
{
StartAllAction();
- if( GetDoc()->ChgAnchor( rMrkList, (RndStdIds)eAnchorId, bSameOnly, bPosCorr ))
+ if( GetDoc()->ChgAnchor( aSdrObjectVector, (RndStdIds)eAnchorId, bSameOnly, bPosCorr ))
Imp()->GetDrawView()->UnmarkAll();
EndAllAction();
@@ -2160,29 +2175,39 @@ void SwFEShell::DelSelectedObj()
Size SwFEShell::GetObjSize() const
{
- Rectangle aRect;
+ basegfx::B2DRange aObjectRange;
+
if ( Imp()->HasDrawView() )
{
if ( Imp()->GetDrawView()->IsAction() )
- Imp()->GetDrawView()->TakeActionRect( aRect );
+ {
+ aObjectRange = Imp()->GetDrawView()->TakeActionRange();
+ }
else
- aRect = Imp()->GetDrawView()->GetAllMarkedRect();
+ {
+ aObjectRange = Imp()->GetDrawView()->getMarkedObjectSnapRange();
+ }
}
- return aRect.GetSize();
+
+ return Size(basegfx::fround(aObjectRange.getWidth()), basegfx::fround(aObjectRange.getHeight()));
}
Point SwFEShell::GetAnchorObjDiff() const
{
const SdrView *pView = Imp()->GetDrawView();
ASSERT( pView, "GetAnchorObjDiff without DrawView?" );
+ basegfx::B2DRange aObjectRange;
- Rectangle aRect;
if ( Imp()->GetDrawView()->IsAction() )
- Imp()->GetDrawView()->TakeActionRect( aRect );
+ {
+ aObjectRange = Imp()->GetDrawView()->TakeActionRange();
+ }
else
- aRect = Imp()->GetDrawView()->GetAllMarkedRect();
+ {
+ aObjectRange = Imp()->GetDrawView()->getMarkedObjectSnapRange();
+ }
- Point aRet( aRect.TopLeft() );
+ Point aRet(basegfx::fround(aObjectRange.getMinX()), basegfx::fround(aObjectRange.getMinY()));
if ( IsFrmSelected() )
{
@@ -2191,10 +2216,9 @@ Point SwFEShell::GetAnchorObjDiff() const
}
else
{
- const SdrObject *pObj = pView->GetMarkedObjectList().GetMarkCount() == 1 ?
- pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() : 0;
+ const SdrObject *pObj = pView->getSelectedIfSingle();
if ( pObj )
- aRet -= pObj->GetAnchorPos();
+ aRet -= sdr::legacy::GetAnchorPos(*pObj);
}
return aRet;
@@ -2203,7 +2227,8 @@ Point SwFEShell::GetAnchorObjDiff() const
Point SwFEShell::GetObjAbsPos() const
{
ASSERT( Imp()->GetDrawView(), "GetObjAbsPos() without DrawView?" );
- return Imp()->GetDrawView()->GetDragStat().GetActionRect().TopLeft();
+ const basegfx::B2DRange aActionRange(Imp()->GetDrawView()->GetDragStat().GetActionRange());
+ return Point(basegfx::fround(aActionRange.getMinX()), basegfx::fround(aActionRange.getMinY()));
}
@@ -2216,19 +2241,20 @@ Point SwFEShell::GetObjAbsPos() const
sal_Bool SwFEShell::IsGroupSelected()
{
- if ( IsObjSelected() )
+ if ( Imp()->GetDrawView() && IsObjSelected() && Imp()->GetDrawView()->areSdrObjectsSelected() )
{
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ SdrObject* pObj = aSelection[i];
// OD 30.06.2003 #108784# - consider 'virtual' drawing objects.
// Thus, use corresponding method instead of checking type.
- if ( pObj->IsGroupObject() &&
+ if ( pObj->getChildrenOfSdrObject() &&
// --> FME 2004-12-08 #i38505# No ungroup allowed for 3d objects
- !pObj->Is3DObj() &&
+ !pObj->IsE3dObject() &&
// <--
- FLY_AS_CHAR != ((SwDrawContact*)GetUserCall(pObj))->
+ FLY_AS_CHAR != ((SwDrawContact*)findConnectionToSdrObject(pObj))->
GetFmt()->GetAnchor().GetAnchorId() )
{
return sal_True;
@@ -2245,19 +2271,21 @@ sal_Bool SwFEShell::IsGroupSelected()
bool SwFEShell::IsGroupAllowed() const
{
bool bIsGroupAllowed = false;
- if ( IsObjSelected() > 1 )
+
+ if ( Imp()->GetDrawView() && Imp()->GetDrawView()->getSelectedSdrObjectCount() > 1 )
{
bIsGroupAllowed = true;
const SdrObject* pUpGroup = 0L;
const SwFrm* pHeaderFooterFrm = 0L;
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; bIsGroupAllowed && i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); bIsGroupAllowed && i < aSelection.size(); ++i )
{
- const SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ const SdrObject* pObj = aSelection[i];
if ( i )
- bIsGroupAllowed = pObj->GetUpGroup() == pUpGroup;
+ bIsGroupAllowed = pObj->GetParentSdrObject() == pUpGroup;
else
- pUpGroup = pObj->GetUpGroup();
+ pUpGroup = pObj->GetParentSdrObject();
if ( bIsGroupAllowed )
{
@@ -2279,7 +2307,7 @@ bool SwFEShell::IsGroupAllowed() const
if ( bIsGroupAllowed )
{
const SwFrm* pAnchorFrm = 0L;
- if ( pObj->ISA(SwVirtFlyDrawObj) )
+ if ( dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
{
const SwFlyFrm* pFlyFrm =
static_cast<const SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
@@ -2290,7 +2318,7 @@ bool SwFEShell::IsGroupAllowed() const
}
else
{
- SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(GetUserCall( pObj ));
+ SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(findConnectionToSdrObject( pObj ));
if ( pDrawContact )
{
pAnchorFrm = pDrawContact->GetAnchorFrm( pObj );
@@ -2374,9 +2402,9 @@ void SwFEShell::MirrorSelection( sal_Bool bHorizontal )
if ( IsObjSelected() && pView->IsMirrorAllowed() )
{
if ( bHorizontal )
- pView->MirrorAllMarkedHorizontal();
+ pView->MirrorMarkedObjHorizontal();
else
- pView->MirrorAllMarkedVertical();
+ pView->MirrorMarkedObjVertical();
}
}
@@ -2447,9 +2475,9 @@ const SwFrmFmt* SwFEShell::GetFlyNum(sal_uInt16 nIdx, FlyCntType eType ) const
void SwFEShell::MakeSelVisible()
{
if( Imp()->HasDrawView() &&
- Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )
+ Imp()->GetDrawView()->areSdrObjectsSelected())
{
- MakeVisible( Imp()->GetDrawView()->GetAllMarkedRect() );
+ MakeVisible( Imp()->GetDrawView()->getMarkedObjectSnapRange() );
}
else
SwCrsrShell::MakeSelVisible();
@@ -2461,18 +2489,21 @@ sal_uInt8 SwFEShell::IsSelObjProtected( sal_uInt16 eType ) const
{
int nChk = 0;
const bool bParent = (eType & FLYPROTECT_PARENT);
- if( Imp()->HasDrawView() )
+
+ if( Imp()->HasDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected() )
{
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for( sal_uLong i = rMrkList.GetMarkCount(); i; )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for( sal_uInt32 i = aSelection.size(); i; )
{
- SdrObject *pObj = rMrkList.GetMark( --i )->GetMarkedSdrObj();
+ SdrObject *pObj = aSelection[--i];
+
if( !bParent )
{
nChk |= ( pObj->IsMoveProtect() ? FLYPROTECT_POS : 0 ) |
( pObj->IsResizeProtect()? FLYPROTECT_SIZE : 0 );
- if( pObj->ISA(SwVirtFlyDrawObj) )
+ if( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
if ( (FLYPROTECT_CONTENT & eType) && pFly->GetFmt()->GetProtect().IsCntntProtected() )
@@ -2506,30 +2537,32 @@ sal_uInt8 SwFEShell::IsSelObjProtected( sal_uInt16 eType ) const
return static_cast<sal_uInt8>(eType);
}
const SwFrm* pAnch;
- if( pObj->ISA(SwVirtFlyDrawObj) )
+ if( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
pAnch = ( (SwVirtFlyDrawObj*)pObj )->GetFlyFrm()->GetAnchorFrm();
else
{
- SwDrawContact* pTmp = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact* pTmp = (SwDrawContact*)findConnectionToSdrObject(pObj);
pAnch = pTmp ? pTmp->GetAnchorFrm( pObj ) : NULL;
}
if( pAnch && pAnch->IsProtected() )
return static_cast<sal_uInt8>(eType);
}
}
+
return static_cast<sal_uInt8>(nChk);
}
sal_Bool SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
{
- if ( !IsObjSelected() )
+ if ( !IsObjSelected() || !Imp()->GetDrawView() )
return sal_False;
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SdrObject *pObj = aSelection[i];
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
// --> OD 2007-07-24 #143008# - make code robust
ASSERT( pContact, "<SwFEShell::GetObjAttr(..)> - missing <pContact> - please inform OD." );
if ( pContact )
@@ -2548,19 +2581,21 @@ sal_Bool SwFEShell::SetObjAttr( const SfxItemSet& rSet )
{
SET_CURR_SHELL( this );
- if ( !rSet.Count() )
- { ASSERT( !this, "SetObjAttr, empty set." );
+ if ( !rSet.Count() || !Imp()->GetDrawView() || !Imp()->GetDrawView()->areSdrObjectsSelected())
+ {
+ ASSERT( !this, "SetObjAttr, empty set." );
return sal_False;
}
StartAllAction();
StartUndo( UNDO_INSATTR );
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SdrObject *pObj = aSelection[i];
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
GetDoc()->SetAttr( rSet, *pContact->GetFmt() );
}
@@ -2572,14 +2607,14 @@ sal_Bool SwFEShell::SetObjAttr( const SfxItemSet& rSet )
sal_Bool SwFEShell::IsAlignPossible() const
{
- sal_uInt16 nCnt;
- if ( 0 < (nCnt = IsObjSelected()) )
+ if(Imp()->GetDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected())
{
sal_Bool bRet = sal_True;
- if ( nCnt == 1 )
+ SdrObject *pO = Imp()->GetDrawView()->getSelectedIfSingle();
+
+ if ( pO )
{
- SdrObject *pO = Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- SwDrawContact *pC = (SwDrawContact*)GetUserCall(pO);
+ SwDrawContact *pC = (SwDrawContact*)findConnectionToSdrObject(pO);
//only as character bound drawings can be aligned
bRet = (pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AS_CHAR);
}
@@ -2595,69 +2630,65 @@ void SwFEShell::CheckUnboundObjects()
{
SET_CURR_SHELL( this );
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
+ if(Imp()->GetDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected())
{
- SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- if ( !GetUserCall(pObj) )
- {
- const Rectangle &rBound = pObj->GetSnapRect();
- const Point aPt( rBound.TopLeft() );
- const SwFrm *pPage = GetLayout()->Lower();
- const SwFrm *pLast = pPage;
- while ( pPage && !pPage->Frm().IsInside( aPt ) )
- {
- if ( aPt.Y() > pPage->Frm().Bottom() )
- pLast = pPage;
- pPage = pPage->GetNext();
- }
- if ( !pPage )
- pPage = pLast;
- ASSERT( pPage, "Page not found." );
-
- //Fremde Identifier sollen in den Default laufen.
- //Ueberschneidungen sind moeglich!!
- sal_uInt16 nIdent =
- Imp()->GetDrawView()->GetCurrentObjInventor() == SdrInventor ?
- Imp()->GetDrawView()->GetCurrentObjIdentifier() : 0xFFFF;
-
- SwFmtAnchor aAnch;
- const SwFrm *pAnch = 0;
- {
- pAnch = ::FindAnchor( pPage, aPt, sal_True );
- SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() );
- aAnch.SetType( FLY_AT_PARA );
- aAnch.SetAnchor( &aPos );
- ((SwRect&)GetCharRect()).Pos() = aPt;
- }
+ const SdrObjectVector aSelection(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
- //Erst hier die Action, damit das GetCharRect aktuelle Werte liefert.
- StartAllAction();
+ for ( sal_uInt32 i(0); i < aSelection.size(); ++i )
+ {
+ SdrObject *pObj = aSelection[i];
- SfxItemSet aSet( GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE,
- RES_SURROUND, RES_ANCHOR, 0 );
- aSet.Put( aAnch );
+ if ( !findConnectionToSdrObject(pObj) )
+ {
+ const Rectangle rBound(sdr::legacy::GetSnapRect(*pObj));
+ const Point aPt( rBound.TopLeft() );
+ const SwFrm *pPage = GetLayout()->Lower();
+ const SwFrm *pLast = pPage;
+ while ( pPage && !pPage->Frm().IsInside( aPt ) )
+ {
+ if ( aPt.Y() > pPage->Frm().Bottom() )
+ pLast = pPage;
+ pPage = pPage->GetNext();
+ }
+ if ( !pPage )
+ pPage = pLast;
+ ASSERT( pPage, "Page not found." );
+
+ //Fremde Identifier sollen in den Default laufen.
+ //Ueberschneidungen sind moeglich!!
+ //sal_uInt16 nIdent =
+ // Imp()->GetDrawView()->GetCurrentObjInventor() == SdrInventor ?
+ // Imp()->GetDrawView()->GetCurrentObjIdentifier() : 0xFFFF;
+
+ SwFmtAnchor aAnch;
+ const SwFrm *pAnch = 0;
+ {
+ pAnch = ::FindAnchor( pPage, aPt, sal_True );
+ SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() );
+ aAnch.SetType( FLY_AT_PARA );
+ aAnch.SetAnchor( &aPos );
+ ((SwRect&)GetCharRect()).Pos() = aPt;
+ }
- Point aRelNullPt;
+ //Erst hier die Action, damit das GetCharRect aktuelle Werte liefert.
+ StartAllAction();
- if( OBJ_CAPTION == nIdent )
- aRelNullPt = ((SdrCaptionObj*)pObj)->GetTailPos();
- else
- aRelNullPt = rBound.TopLeft();
+ SfxItemSet aSet( GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE,
+ RES_SURROUND, RES_ANCHOR, 0 );
+ aSet.Put( aAnch );
+ aSet.Put( SwFmtSurround( SURROUND_THROUGHT ) );
+ SwFrmFmt* pFmt = getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet );
- aSet.Put( aAnch );
- aSet.Put( SwFmtSurround( SURROUND_THROUGHT ) );
- SwFrmFmt* pFmt = getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet );
+ SwDrawContact *pContact = new SwDrawContact(
+ (SwDrawFrmFmt*)pFmt, pObj );
- SwDrawContact *pContact = new SwDrawContact(
- (SwDrawFrmFmt*)pFmt, pObj );
-
- // --> OD 2004-11-22 #i35635#
- pContact->MoveObjToVisibleLayer( pObj );
- // <--
- pContact->ConnectToLayout();
+ // --> OD 2004-11-22 #i35635#
+ pContact->MoveObjToVisibleLayer( pObj );
+ // <--
+ pContact->ConnectToLayout();
- EndAllAction();
+ EndAllAction();
+ }
}
}
}
@@ -2682,12 +2713,11 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
if( Imp()->HasDrawView() )
{
SdrObject* pObj;
- SdrPageView* pPView;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
- const sal_uInt16 nOld = pDView->GetHitTolerancePixel();
+ const double fOld(pDView->GetHitTolerancePixel());
pDView->SetHitTolerancePixel( 0 );
- if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) &&
- pObj->ISA(SwVirtFlyDrawObj) )
+ if( pDView->PickObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), pDView->getHitTolLog(), pObj, SDRSEARCH_PICKMARKABLE ) &&
+ dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
rRect = pFly->Frm();
@@ -2697,7 +2727,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
SwFrmFmt *pFmt = pFly->GetFmt();
return GetDoc()->Chainable(rSource, *pFmt);
}
- pDView->SetHitTolerancePixel( nOld );
+ pDView->SetHitTolerancePixel(fOld);
}
return SW_CHAIN_NOT_FOUND;
}
@@ -2715,12 +2745,11 @@ int SwFEShell::Chain( SwFrmFmt &rSource, const Point &rPt )
{
StartAllAction();
SdrObject* pObj;
- SdrPageView* pPView;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
- const sal_uInt16 nOld = pDView->GetHitTolerancePixel();
+ const double fOld(pDView->GetHitTolerancePixel());
pDView->SetHitTolerancePixel( 0 );
- pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE );
- pDView->SetHitTolerancePixel( nOld );
+ pDView->PickObj( basegfx::B2DPoint(rPt.X(), rPt.Y()), pDView->getHitTolLog(), pObj, SDRSEARCH_PICKMARKABLE );
+ pDView->SetHitTolerancePixel(fOld);
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)pFly->GetFmt();
@@ -2828,19 +2857,23 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
return 0;
}
-void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
- sal_uInt16 nSlotId)
+void SwFEShell::CreateDefaultShape(const SdrObjectCreationInfo& rSdrObjectCreationInfo, const Rectangle& rRect, sal_uInt16 nSlotId)
{
SdrView* pDrawView = GetDrawView();
- SdrModel* pDrawModel = pDrawView->GetModel();
- SdrObject* pObj = SdrObjFactory::MakeNewObject(
- SdrInventor, eSdrObjectKind,
- 0L, pDrawModel);
+ SdrObject* pObj = 0;
+
+ if(pDrawView)
+ {
+ pObj = SdrObjFactory::MakeNewObject(pDrawView->getSdrModelFromSdrView(), rSdrObjectCreationInfo);
+ }
if(pObj)
{
Rectangle aRect(rRect);
- if(OBJ_CARC == eSdrObjectKind || OBJ_CCUT == eSdrObjectKind)
+
+ if(OBJ_CIRC == rSdrObjectCreationInfo.getIdent()
+ && (CircleType_Arc == rSdrObjectCreationInfo.getSdrCircleObjType()
+ || CircleType_Segment == rSdrObjectCreationInfo.getSdrCircleObjType()))
{
// force quadratic
if(aRect.GetWidth() > aRect.GetHeight())
@@ -2856,66 +2889,72 @@ void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind,
Size(aRect.GetWidth(), aRect.GetWidth()));
}
}
- pObj->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRect(*pObj, aRect);
+
+ SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(pObj);
+ SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj);
+ SdrCaptionObj* pSdrCaptionObj = dynamic_cast< SdrCaptionObj* >(pObj);
+ SdrTextObj* pSdrTextObj = dynamic_cast< SdrTextObj* >(pObj);
- if(pObj->ISA(SdrCircObj))
+ if(pSdrCircObj)
{
- SfxItemSet aAttr(pDrawModel->GetItemPool());
- aAttr.Put(SdrCircStartAngleItem(9000));
- aAttr.Put(SdrCircEndAngleItem(0));
- pObj->SetMergedItemSet(aAttr);
+ pSdrCircObj->SetStartAngle(F_PI2); // TTTT formally 9000, needs check (mirror?)
+ pSdrCircObj->SetEndAngle(0.0);
}
- else if(pObj->ISA(SdrPathObj))
+ else if(pSdrPathObj)
{
basegfx::B2DPolyPolygon aPoly;
- switch(eSdrObjectKind)
+ switch(pSdrPathObj->getSdrPathObjType())
{
- case OBJ_PATHLINE:
+ case PathType_OpenBezier:
+ case PathType_ClosedBezier:
{
- basegfx::B2DPolygon aInnerPoly;
+ if(rSdrObjectCreationInfo.getFreehandMode())
+ {
+ basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
- const basegfx::B2DPoint aCenterBottom(aRect.Center().X(), aRect.Bottom());
- aInnerPoly.appendBezierSegment(
- aCenterBottom,
- aCenterBottom,
- basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
+ aInnerPoly.appendBezierSegment(
+ basegfx::B2DPoint(aRect.Left(), aRect.Top()),
+ basegfx::B2DPoint(aRect.Center().X(), aRect.Top()),
+ basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
- const basegfx::B2DPoint aCenterTop(aRect.Center().X(), aRect.Top());
- aInnerPoly.appendBezierSegment(
- aCenterTop,
- aCenterTop,
- basegfx::B2DPoint(aRect.Right(), aRect.Top()));
+ aInnerPoly.appendBezierSegment(
+ basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()),
+ basegfx::B2DPoint(aRect.Right(), aRect.Bottom()),
+ basegfx::B2DPoint(aRect.Right(), aRect.Top()));
- aInnerPoly.setClosed(true);
- aPoly.append(aInnerPoly);
- }
- break;
- case OBJ_FREELINE:
- {
- basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom()));
+ aInnerPoly.setClosed(true);
+ aPoly.append(aInnerPoly);
+ }
+ else
+ {
+ basegfx::B2DPolygon aInnerPoly;
- aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
+ aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
- aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint(aRect.Left(), aRect.Top()),
- basegfx::B2DPoint(aRect.Center().X(), aRect.Top()),
- basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
+ const basegfx::B2DPoint aCenterBottom(aRect.Center().X(), aRect.Bottom());
+ aInnerPoly.appendBezierSegment(
+ aCenterBottom,
+ aCenterBottom,
+ basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
- aInnerPoly.appendBezierSegment(
- basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()),
- basegfx::B2DPoint(aRect.Right(), aRect.Bottom()),
- basegfx::B2DPoint(aRect.Right(), aRect.Top()));
+ const basegfx::B2DPoint aCenterTop(aRect.Center().X(), aRect.Top());
+ aInnerPoly.appendBezierSegment(
+ aCenterTop,
+ aCenterTop,
+ basegfx::B2DPoint(aRect.Right(), aRect.Top()));
- aInnerPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom()));
- aInnerPoly.setClosed(true);
- aPoly.append(aInnerPoly);
+ aInnerPoly.setClosed(true);
+ aPoly.append(aInnerPoly);
+ }
}
break;
- case OBJ_POLY:
- case OBJ_PLIN:
+ case PathType_ClosedPolygon:
+ case PathType_OpenPolygon:
{
basegfx::B2DPolygon aInnerPoly;
sal_Int32 nWdt(aRect.GetWidth());
@@ -2930,7 +2969,7 @@ void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind,
aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 80) / 100, aRect.Top() + (nHgt * 75) / 100));
aInnerPoly.append(basegfx::B2DPoint(aRect.Bottom(), aRect.Right()));
- if(OBJ_PLIN == eSdrObjectKind)
+ if(PathType_OpenPolygon == pSdrPathObj->getSdrPathObjType())
{
aInnerPoly.append(basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()));
}
@@ -2942,7 +2981,7 @@ void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind,
aPoly.append(aInnerPoly);
}
break;
- case OBJ_LINE :
+ case PathType_Line:
{
sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
basegfx::B2DPolygon aTempPoly;
@@ -2953,59 +2992,59 @@ void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind,
break;
}
- ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly);
}
- else if(pObj->ISA(SdrCaptionObj))
+ else if(pSdrCaptionObj)
{
- sal_Bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
- SID_DRAW_CAPTION_VERTICAL == nSlotId );
- ((SdrTextObj*)pObj)->SetVerticalWriting(bVerticalText);
+ sal_Bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId || SID_DRAW_CAPTION_VERTICAL == nSlotId );
+ pSdrCaptionObj->SetVerticalWriting(bVerticalText);
+
if(bVerticalText)
{
- SfxItemSet aSet(pObj->GetMergedItemSet());
+ SfxItemSet aSet(pSdrCaptionObj->GetMergedItemSet());
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
- pObj->SetMergedItemSet(aSet);
+ pSdrCaptionObj->SetMergedItemSet(aSet);
}
- ((SdrCaptionObj*)pObj)->SetLogicRect(aRect);
- ((SdrCaptionObj*)pObj)->SetTailPos(
- aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
+ sdr::legacy::SetLogicRect(*pSdrCaptionObj, aRect);
+
+ const Point aTailPos(aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
+ pSdrCaptionObj->SetTailPos(basegfx::B2DPoint(aTailPos.X(), aTailPos.Y()));
}
- else if(pObj->ISA(SdrTextObj))
+ else if(pSdrTextObj)
{
- SdrTextObj* pText = (SdrTextObj*)pObj;
- pText->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRect(*pSdrTextObj, aRect);
sal_Bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
sal_Bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nSlotId);
- pText->SetVerticalWriting(bVertical);
+ pSdrTextObj->SetVerticalWriting(bVertical);
if(bVertical)
{
- SfxItemSet aSet(pDrawModel->GetItemPool());
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ SfxItemSet aSet(pSdrTextObj->GetObjectItemPool());
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
- pText->SetMergedItemSet(aSet);
+ pSdrTextObj->SetMergedItemSet(aSet);
}
if(bMarquee)
{
- SfxItemSet aSet(pDrawModel->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
- aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ SfxItemSet aSet(pObj->GetObjectItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false) );
aSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
aSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
- aSet.Put( SdrTextAniCountItem( 1 ) );
+ aSet.Put( SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, 1 ) );
aSet.Put( SdrTextAniAmountItem( (sal_Int16)GetWin()->PixelToLogic(Size(2,1)).Width()) );
pObj->SetMergedItemSetAndBroadcast(aSet);
}
}
- SdrPageView* pPageView = pDrawView->GetSdrPageView();
- pDrawView->InsertObjectAtView(pObj, *pPageView);
+
+ pDrawView->InsertObjectAtView(*pObj);
}
ImpEndCreate();
}
@@ -3029,23 +3068,17 @@ const Color SwFEShell::GetShapeBackgrd() const
// check, if a draw view exists
ASSERT( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
- if( Imp()->GetDrawView() )
- {
- // determine list of selected objects
- const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
- // check, if exactly one object is selected.
- ASSERT( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
- if ( pMrkList->GetMarkCount() == 1)
+ const SdrObject *pSdrObj = Imp()->GetDrawView() ? Imp()->GetDrawView()->getSelectedIfSingle() : 0;
+
+ if( pSdrObj )
{
- // get selected object
- const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
// check, if selected object is a shape (drawing object)
- ASSERT( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
- if ( !pSdrObj->ISA(SwVirtFlyDrawObj) )
+ ASSERT( !dynamic_cast< const SwVirtFlyDrawObj* >(pSdrObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
+ if ( !dynamic_cast< const SwVirtFlyDrawObj* >(pSdrObj) )
{
// determine page frame of the frame the shape is anchored.
const SwFrm* pAnchorFrm =
- static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrm( pSdrObj );
+ static_cast<SwDrawContact*>(findConnectionToSdrObject(pSdrObj))->GetAnchorFrm( pSdrObj );
ASSERT( pAnchorFrm, "inconsistent modell - no anchor at shape!");
if ( pAnchorFrm )
{
@@ -3058,7 +3091,6 @@ const Color SwFEShell::GetShapeBackgrd() const
}
}
}
- }
return aRetColor;
}
@@ -3081,23 +3113,17 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const
// check, if a draw view exists
ASSERT( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
- if( Imp()->GetDrawView() )
- {
- // determine list of selected objects
- const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
- // check, if exactly one object is selected.
- ASSERT( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
- if ( pMrkList->GetMarkCount() == 1)
+ const SdrObject* pSdrObj = Imp()->GetDrawView() ? Imp()->GetDrawView()->getSelectedIfSingle() : 0;
+
+ if(pSdrObj)
{
- // get selected object
- const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
// check, if selected object is a shape (drawing object)
- ASSERT( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
- if ( !pSdrObj->ISA(SwVirtFlyDrawObj) )
+ ASSERT( !dynamic_cast< const SwVirtFlyDrawObj* >(pSdrObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
+ if ( !dynamic_cast< const SwVirtFlyDrawObj* >(pSdrObj) )
{
// determine page frame of the frame the shape is anchored.
const SwFrm* pAnchorFrm =
- static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrm( pSdrObj );
+ static_cast<SwDrawContact*>(findConnectionToSdrObject(pSdrObj))->GetAnchorFrm( pSdrObj );
ASSERT( pAnchorFrm, "inconsistent modell - no anchor at shape!");
if ( pAnchorFrm )
{
@@ -3109,7 +3135,6 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const
}
}
}
- }
}
return bRet;
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 04b1074cadba..f7e095de56c2 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -208,7 +208,7 @@ sal_Bool SwFEShell::InsertRow( sal_uInt16 nCnt, sal_Bool bBehind )
if( !pFrm || !pFrm->IsInTab() )
return sal_False;
- if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(pFrm->ImplFindTabFrm()->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
@@ -239,7 +239,7 @@ sal_Bool SwFEShell::InsertCol( sal_uInt16 nCnt, sal_Bool bBehind )
if( !pFrm || !pFrm->IsInTab() )
return sal_False;
- if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(pFrm->ImplFindTabFrm()->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
@@ -303,7 +303,7 @@ sal_Bool SwFEShell::DeleteCol()
if( !pFrm || !pFrm->IsInTab() )
return sal_False;
- if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(pFrm->ImplFindTabFrm()->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
@@ -349,7 +349,7 @@ sal_Bool SwFEShell::DeleteRow()
if( !pFrm || !pFrm->IsInTab() )
return sal_False;
- if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(pFrm->ImplFindTabFrm()->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
@@ -478,7 +478,7 @@ sal_uInt16 SwFEShell::MergeTab()
{
SwShellTableCrsr* pTableCrsr = GetTableCrsr();
const SwTableNode* pTblNd = pTableCrsr->GetNode()->FindTableNode();
- if( pTblNd->GetTable().ISA( SwDDETable ))
+ if( dynamic_cast< const SwDDETable* >(&pTblNd->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
@@ -508,7 +508,7 @@ sal_Bool SwFEShell::SplitTab( sal_Bool bVert, sal_uInt16 nCnt, sal_Bool bSameHei
if( !pFrm || !pFrm->IsInTab() )
return sal_False;
- if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(pFrm->ImplFindTabFrm()->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
@@ -1012,19 +1012,19 @@ sal_Bool SwFEShell::HasBoxSelection() const
pPam->GetMark()->nNode.GetIndex() + 1 ==
pNd->EndOfSectionIndex())
{
- SwNodeIndex aIdx( *pNd->EndOfSectionNode(), -1 );
- SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
- if( !pCNd )
- {
- pCNd = GetDoc()->GetNodes().GoPrevious( &aIdx );
- ASSERT( pCNd, "kein ContentNode in der Box ??" );
- }
- if( pPam->GetMark()->nContent == pCNd->Len() )
- {
- if( bChg )
- pPam->Exchange();
- return sal_True;
- }
+ SwNodeIndex aIdx( *pNd->EndOfSectionNode(), -1 );
+ SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
+ if( !pCNd )
+ {
+ pCNd = GetDoc()->GetNodes().GoPrevious( &aIdx );
+ ASSERT( pCNd, "kein ContentNode in der Box ??" );
+ }
+ if( pPam->GetMark()->nContent == pCNd->Len() )
+ {
+ if( bChg )
+ pPam->Exchange();
+ return sal_True;
+ }
}
if( bChg )
pPam->Exchange();
@@ -1392,7 +1392,7 @@ sal_Bool SwFEShell::DeleteTblSel()
if( !pFrm || !pFrm->IsInTab() )
return sal_False;
- if( pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
+ if( dynamic_cast< SwDDETable* >(pFrm->ImplFindTabFrm()->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
@@ -1755,7 +1755,7 @@ const SwFrm* SwFEShell::GetBox( const Point &rPt, bool* pbRow, bool* pbCol ) con
for ( sal_uInt16 i = 0; !pFrm && i < pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
- if ( pObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pObj) )
{
pFrm = lcl_FindFrm( static_cast<SwFlyFrm*>(pObj),
rPt, nFuzzy, pbRow, pbCol );
@@ -2311,7 +2311,7 @@ sal_Bool SwFEShell::SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff )
return sal_False;
if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType &&
- pFrm->ImplFindTabFrm()->GetTable()->ISA( SwDDETable ))
+ dynamic_cast< SwDDETable* >(pFrm->ImplFindTabFrm()->GetTable()))
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 43c8c6c5f441..3b722a96b6c2 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -64,8 +64,6 @@
using namespace com::sun::star;
-TYPEINIT1(SwFEShell,SwEditShell)
-
/***********************************************************************
#* Class : SwFEShell
#* Methode : EndAllActionAndCall()
@@ -78,7 +76,7 @@ void SwFEShell::EndAllActionAndCall()
{
ViewShell *pTmp = this;
do {
- if( pTmp->IsA( TYPE(SwCrsrShell) ) )
+ if( dynamic_cast< SwCrsrShell* >(pTmp) )
{
((SwFEShell*)pTmp)->EndAction();
((SwFEShell*)pTmp)->CallChgLnk();
@@ -107,10 +105,7 @@ Point SwFEShell::GetCntntPos( const Point& rPoint, sal_Bool bNext ) const
const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
const uno::Reference < embed::XEmbeddedObject >& xObj ) const
{
- const SwFrm *pFrm = Imp()->HasDrawView()
- ? ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(),
- (ViewShell*)this)
- : 0;
+ const SwFrm *pFrm = ::GetFlyFromMarked((ViewShell*)this);
if( !pFrm )
{
@@ -187,7 +182,12 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
}
-sal_uInt16 SwFEShell::GetPageNumber( const Point &rPoint ) const
+sal_uInt32 SwFEShell::GetPageNumber( const basegfx::B2DPoint &rPoint ) const
+{
+ return GetPageNumber(Point(basegfx::fround(rPoint.getX()), basegfx::fround(rPoint.getY())));
+}
+
+sal_uInt32 SwFEShell::GetPageNumber( const Point &rPoint ) const
{
const SwFrm *pPage = GetLayout()->Lower();
while ( pPage && !pPage->Frm().IsInside( rPoint ) )
@@ -199,7 +199,7 @@ sal_uInt16 SwFEShell::GetPageNumber( const Point &rPoint ) const
}
-sal_Bool SwFEShell::GetPageNumber( long nYPos, sal_Bool bAtCrsrPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, String &rDisplay) const
+bool SwFEShell::GetPageNumber( long nYPos, bool bAtCrsrPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, String &rDisplay) const
{
const SwFrm *pPage;
@@ -340,8 +340,7 @@ void SwFEShell::ShGetFcs( sal_Bool bUpdate )
if ( HasDrawView() )
{
- Imp()->GetDrawView()->showMarkHandles();
- if ( Imp()->GetDrawView()->AreObjectsMarked() )
+ if ( Imp()->GetDrawView()->areSdrObjectsSelected() )
FrameNotify( this, FLY_DRAG_START );
}
}
@@ -350,9 +349,8 @@ void SwFEShell::ShLooseFcs()
{
SwCrsrShell::ShLooseFcs();
- if ( HasDrawView() && Imp()->GetDrawView()->AreObjectsMarked() )
+ if ( HasDrawView() && Imp()->GetDrawView()->areSdrObjectsSelected() )
{
- Imp()->GetDrawView()->hideMarkHandles();
FrameNotify( this, FLY_DRAG_END );
}
// ::ResetShell();
@@ -513,27 +511,18 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
case LTYPE_DRAW:
if( Imp()->GetDrawView() )
{
- SwDrawView *pDView = Imp()->GetDrawView();
- const SdrMarkList& rMrkList = pDView->GetMarkedObjectList();
StartUndo();
// OD 27.11.2003 #112045# - copy marked drawing objects to
// local list to perform the corresponding action for each object
- std::vector<SdrObject*> aDrawObjs;
- {
- for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
- {
- SdrObject* pDrawObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
- if( pDrawObj )
- aDrawObjs.push_back( pDrawObj );
- }
- }
+ SdrObjectVector aDrawObjs(Imp()->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
// loop on marked drawing objects
while ( !aDrawObjs.empty() )
{
SdrObject* pDrawObj = aDrawObjs.back();
- if ( !pDrawObj->ISA(SwVirtFlyDrawObj) &&
- !pDrawObj->ISA(SwFlyDrawObj) )
+ if ( !dynamic_cast< SwVirtFlyDrawObj* >(pDrawObj) &&
+ !dynamic_cast< SwFlyDrawObj* >(pDrawObj) )
{
SwFlyFrmFmt *pFmt =
GetDoc()->InsertDrawLabel( rTxt, rSeparator, rNumberSeparator, nId, rCharacterStyle, *pDrawObj );
@@ -1340,21 +1329,17 @@ sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, s
if ( Imp()->HasDrawView() )
{
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- if( rMrkList.GetMarkCount() != 1 )
- return bVert;
+ SdrObject* pObj = Imp()->GetDrawView()->getSelectedIfSingle();
- SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- // --> OD 2006-01-06 #123831# - make code robust:
+ // only continue if a single and only a single object is selected
if ( !pObj )
{
- ASSERT( false,
- "<SwFEShell::IsFrmVertical(..)> - missing SdrObject instance in marked object list -> This is a serious situation, please inform OD" );
return bVert;
}
+
// <--
// OD 2004-03-29 #i26791#
- SwContact* pContact = static_cast<SwContact*>(GetUserCall( pObj ));
+ SwContact* pContact = static_cast<SwContact*>(findConnectionToSdrObject( pObj ));
// --> OD 2006-01-06 #123831# - make code robust:
if ( !pContact )
{
@@ -1373,7 +1358,7 @@ sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, s
}
// <--
- if ( pObj->ISA(SwVirtFlyDrawObj) && !bEnvironment )
+ if ( dynamic_cast< SwVirtFlyDrawObj* >(pObj) && !bEnvironment )
pRef = static_cast<const SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
bVert = pRef->IsVertical();
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index 2d6d11e3fa11..67513c392a42 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -52,9 +52,6 @@
using namespace ::com::sun::star;
-TYPEINIT1_AUTOFACTORY(SwCropGrf, SfxPoolItem)
-TYPEINIT1_AUTOFACTORY(SwGammaGrf, SfxPoolItem)
-
/******************************************************************************
* Implementierung class SwMirrorGrf
******************************************************************************/
@@ -294,7 +291,7 @@ SfxPoolItem* SwTransparencyGrf::Clone( SfxItemPool * ) const
sal_Bool SwTransparencyGrf::QueryValue( uno::Any& rVal,
sal_uInt8 ) const
{
- DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
+ DBG_ASSERT(dynamic_cast< const SfxByteItem* >(this),"Put/QueryValue should be removed!");
sal_Int16 nRet = GetValue();
DBG_ASSERT( 0 <= nRet && nRet <= 100, "value out of range" );
rVal <<= nRet;
@@ -305,7 +302,7 @@ sal_Bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
sal_uInt8 )
{
//temporary conversion until this is a SfxInt16Item!
- DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
+ DBG_ASSERT(dynamic_cast< SfxByteItem* >(this),"Put/QueryValue should be removed!");
sal_Int16 nVal = 0;
if(!(rVal >>= nVal) || nVal < -100 || nVal > 100)
return sal_False;
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index b96e13f1f8ea..a059075a1101 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -1138,7 +1138,7 @@ void DelAllGrfCacheEntries( SwDoc* pDoc )
::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]);
if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() &&
rLnkMgr.GetDisplayNames( pLnk, 0, &sFileNm ) &&
- pLnk->ISA( SwBaseLink ) && 0 != ( pGrfNd =
+ dynamic_cast< SwBaseLink* >(pLnk) && 0 != ( pGrfNd =
((SwBaseLink*)pLnk)->GetCntntNode()->GetGrfNode()) )
{
pGrfNd->ReleaseGraphicFromCache();
@@ -1222,7 +1222,7 @@ sal_Bool SwGrfNode::IsSelected() const
const SwNode* pN = this;
const ViewShell* pV = pESh;
do {
- if( pV->ISA( SwEditShell ) && pN == &((SwCrsrShell*)pV)
+ if( dynamic_cast< const SwEditShell* >(pV) && pN == &((SwCrsrShell*)pV)
->GetCrsr()->GetPoint()->nNode.GetNode() )
{
bRet = sal_True;
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index ccf41f552e25..fa607c7f98b2 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -25,14 +25,12 @@
#define SW_UNDOCORE_HXX
#include <undobj.hxx>
-
#include <calbck.hxx>
-
+#include <svx/svdobj.hxx>
class SfxItemSet;
class SwFmtColl;
class SwFmtAnchor;
-class SdrMarkList;
class SwUndoDelete;
class SwRedlineSaveData;
class SwFrm;
@@ -58,29 +56,34 @@ public:
: m_rDoc(rDoc)
, m_rCursorSupplier(rCursorSupplier)
, m_pSelFmt(0)
- , m_pMarkList(0)
+ , m_aMarkList()
{ }
SwDoc & GetDoc() const { return m_rDoc; }
IShellCursorSupplier & GetCursorSupplier() { return m_rCursorSupplier; }
- void SetSelections(SwFrmFmt *const pSelFmt, SdrMarkList *const pMarkList)
+ void SetSelections(SwFrmFmt* const pSelFmt, const SdrObjectVector& rSdrObjectVector)
+ {
+ m_pSelFmt = pSelFmt;
+ m_aMarkList = rSdrObjectVector;
+ }
+ void SetSelections(SwFrmFmt* const pSelFmt)
{
m_pSelFmt = pSelFmt;
- m_pMarkList = pMarkList;
+ m_aMarkList.clear();
}
- void GetSelections(SwFrmFmt *& o_rpSelFmt, SdrMarkList *& o_rpMarkList)
+ void GetSelections(SwFrmFmt *& o_rpSelFmt, SdrObjectVector& o_raSdrObjectVector)
{
o_rpSelFmt = m_pSelFmt;
- o_rpMarkList = m_pMarkList;
+ o_raSdrObjectVector = m_aMarkList;
}
private:
SwDoc & m_rDoc;
IShellCursorSupplier & m_rCursorSupplier;
SwFrmFmt * m_pSelFmt;
- SdrMarkList * m_pMarkList;
+ SdrObjectVector m_aMarkList;
};
class SW_DLLPRIVATE RepeatContext
diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx
index 8462a14d848d..8fab0fa04120 100644
--- a/sw/source/core/inc/UndoDraw.hxx
+++ b/sw/source/core/inc/UndoDraw.hxx
@@ -25,13 +25,11 @@
#define SW_UNDO_DRAW_HXX
#include <undobj.hxx>
-
#include <svx/svdundo.hxx>
-
+#include <svx/svdobj.hxx>
struct SwUndoGroupObjImpl;
class SdrMark;
-class SdrMarkList;
class SdrObject;
class SdrObjGroup;
class SdrUndoAction;
@@ -45,9 +43,10 @@ class SwDrawFrmFmt;
class SwSdrUndo : public SwUndo
{
SdrUndoAction* pSdrUndo;
- SdrMarkList* pMarkList; // MarkList for all selected SdrObjects
+ SdrObjectVector maSelectedSdrObjectVector; // all selected SdrObjects
+
public:
- SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList );
+ SwSdrUndo( SdrUndoAction* , const SdrObjectVector& rSelectedSdrObjectVector );
virtual ~SwSdrUndo();
@@ -60,18 +59,18 @@ public:
class SwUndoDrawGroup : public SwUndo
{
SwUndoGroupObjImpl* pObjArr;
- sal_uInt16 nSize;
- sal_Bool bDelFmt;
+ sal_uInt32 nSize;
+ bool bDelFmt;
public:
- SwUndoDrawGroup( sal_uInt16 nCnt );
+ SwUndoDrawGroup( sal_uInt32 nCnt );
virtual ~SwUndoDrawGroup();
virtual void UndoImpl( ::sw::UndoRedoContext & );
virtual void RedoImpl( ::sw::UndoRedoContext & );
- void AddObj( sal_uInt16 nPos, SwDrawFrmFmt*, SdrObject* );
+ void AddObj( sal_uInt32 nPos, SwDrawFrmFmt*, SdrObject* );
void SetGroupFmt( SwDrawFrmFmt* );
};
@@ -90,8 +89,8 @@ public:
class SwUndoDrawUnGroup : public SwUndo
{
SwUndoGroupObjImpl* pObjArr;
- sal_uInt16 nSize;
- sal_Bool bDelFmt;
+ sal_uInt32 nSize;
+ bool bDelFmt;
public:
SwUndoDrawUnGroup( SdrObjGroup* );
@@ -101,7 +100,7 @@ public:
virtual void UndoImpl( ::sw::UndoRedoContext & );
virtual void RedoImpl( ::sw::UndoRedoContext & );
- void AddObj( sal_uInt16 nPos, SwDrawFrmFmt* );
+ void AddObj( sal_uInt32 nPos, SwDrawFrmFmt* );
};
// --> OD 2006-11-01 #130889#
@@ -127,19 +126,19 @@ class SwUndoDrawUnGroupConnectToLayout : public SwUndo
class SwUndoDrawDelete : public SwUndo
{
SwUndoGroupObjImpl* pObjArr;
- SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects
- sal_uInt16 nSize;
- sal_Bool bDelFmt;
+ SdrObjectVector maSdrObjectVector; // MarkList for all selected SdrObjects
+ sal_uInt32 nSize;
+ bool bDelFmt;
public:
- SwUndoDrawDelete( sal_uInt16 nCnt );
+ SwUndoDrawDelete( sal_uInt32 nCnt );
virtual ~SwUndoDrawDelete();
virtual void UndoImpl( ::sw::UndoRedoContext & );
virtual void RedoImpl( ::sw::UndoRedoContext & );
- void AddObj( sal_uInt16 nPos, SwDrawFrmFmt*, const SdrMark& );
+ void AddObj( sal_uInt32 nPos, SwDrawFrmFmt*, const SdrObject& );
};
#endif // SW_UNDO_DRAW_HXX
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index d3ace06bca53..932c4b296af8 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -68,7 +68,6 @@ protected:
public:
virtual ~SwCntntFrm();
- TYPEINFO(); //bereits in Basisklassen drin
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
diff --git a/sw/source/core/inc/crossrefbookmark.hxx b/sw/source/core/inc/crossrefbookmark.hxx
index dd5ef00d2b7c..c303c6b8cb81 100644
--- a/sw/source/core/inc/crossrefbookmark.hxx
+++ b/sw/source/core/inc/crossrefbookmark.hxx
@@ -75,6 +75,7 @@ namespace sw { namespace mark
const ::rtl::OUString& rShortName);
static ::rtl::OUString GenerateNewName();
static bool IsLegalName(const ::rtl::OUString& rName);
+ static const ::rtl::OUString our_sNamePrefix;
};
class CrossRefNumItemBookmark
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index 3718dac61f03..9a662b6eb75b 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -22,7 +22,8 @@
#ifndef _DFLYOBJ_HXX
#define _DFLYOBJ_HXX
-#include <svx/svdovirt.hxx>
+
+#include <svx/svdobj.hxx>
class SwFlyFrm;
class SwFrmFmt;
@@ -45,14 +46,19 @@ private:
protected:
// #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence()
- // is called when RecalcBoundRect() is used
+ // is called when the view independent range of the object is used
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ ~SwFlyDrawObj();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
public:
- TYPEINFO();
+ SwFlyDrawObj(SdrModel& rSdrModel);
- SwFlyDrawObj();
- ~SwFlyDrawObj();
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
//Damit eine Instanz dieser Klasse beim laden erzeugt werden kann
//(per Factory).
@@ -66,17 +72,31 @@ public:
//Flys werden immer mit virtuellen Objekten angezeigt. Nur so koennen sie
//ggf. mehrfach angezeigt werden (Kopf-/Fusszeilen).
-class SwVirtFlyDrawObj : public SdrVirtObj
+class SwVirtFlyDrawObj : public SdrObject
{
private:
SwFlyFrm *pFlyFrm;
+ //////////////////////////////////////////////////////////////////////////
+ // members which were missing from SdrVirtObj
+ SdrObject& rRefObj;
+
protected:
// AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
// not used but something own (top left of new SnapRect minus top left
// of original SnapRect)
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ // original Notify from SdrVirtObj
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ void impReactOnGeometryChange();
+
+ /// method to copy all data from given source
+ virtual void copyDataFromSdrObject(const SdrObject& rSource);
+
+ ~SwVirtFlyDrawObj();
+
public:
// for paints triggered form ExecutePrimitive
void wrap_DoPaintObject() const;
@@ -85,33 +105,16 @@ public:
basegfx::B2DRange getOuterBound() const;
basegfx::B2DRange getInnerBound() const;
-public:
- TYPEINFO();
-
SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly);
- ~SwVirtFlyDrawObj();
- //Ueberladene Methoden der Basisklasse SdrVirtObj
- virtual void TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const;
+ /// create a copy, evtl. with a different target model (if given)
+ virtual SdrObject* CloneSdrObject(SdrModel* pTargetModel = 0) const;
+
+ virtual bool IsClosedObj() const;
- //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand.
- virtual const Rectangle& GetCurrentBoundRect() const;
- virtual const Rectangle& GetLastBoundRect() const;
- virtual void RecalcBoundRect();
- virtual void RecalcSnapRect();
- virtual const Rectangle& GetSnapRect() const;
- virtual void SetSnapRect(const Rectangle& rRect);
- virtual void NbcSetSnapRect(const Rectangle& rRect);
- virtual const Rectangle& GetLogicRect() const;
- virtual void SetLogicRect(const Rectangle& rRect);
- virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual void TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const;
+// virtual void recalculateObjectRange();
virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
- virtual void NbcMove (const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact,
- const Fraction& yFact);
- virtual void Move (const Size& rSiz);
- virtual void Resize(const Point& rRef, const Fraction& xFact,
- const Fraction& yFact);
const SwFrmFmt *GetFmt() const;
SwFrmFmt *GetFmt();
@@ -123,13 +126,58 @@ public:
void SetRect() const;
// ist eine URL an einer Grafik gesetzt, dann ist das ein Makro-Object
- virtual FASTBOOL HasMacro() const;
+ virtual bool HasMacro() const;
virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
// FullDrag support
virtual bool supportsFullDrag() const;
virtual SdrObject* getFullDragClone() const;
+
+ //////////////////////////////////////////////////////////////////////////
+ // methods which were missing from SdrVirtObj which do something
+ SdrObject& ReferencedObj();
+ const SdrObject& GetReferencedObj() const;
+
+ virtual sdr::properties::BaseProperties& GetProperties() const;
+ //virtual void SetModel(SdrModel* pNewModel);
+ virtual sal_uInt32 GetObjInventor() const;
+ virtual sal_uInt16 GetObjIdentifier() const;
+ virtual SdrObjList* getChildrenOfSdrObject() const;
+ //virtual SdrObjList* GetSubList() const;
+ virtual void SetChanged();
+ virtual void TakeObjNameSingul(String& rName) const;
+ virtual void TakeObjNamePlural(String& rName) const;
+ virtual sal_uInt32 GetPlusHdlCount(const SdrHdl& rHdl) const;
+ virtual void GetPlusHdl(SdrHdlList& rHdlList, SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
+ virtual void AddToHdlList(SdrHdlList& rHdlList) const;
+ virtual bool hasSpecialDrag() const;
+ virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
+ virtual bool applySpecialDrag(SdrDragStat& rDrag);
+ virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
+ virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
+ virtual bool BegCreate(SdrDragStat& rStat);
+ virtual bool MovCreate(SdrDragStat& rStat);
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+ virtual bool BckCreate(SdrDragStat& rStat);
+ virtual void BrkCreate(SdrDragStat& rStat);
+ virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
+ virtual sal_uInt32 GetSnapPointCount() const;
+ virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
+ virtual bool IsPolygonObject() const;
+ virtual sal_uInt32 GetObjectPointCount() const;
+ virtual basegfx::B2DPoint GetObjectPoint(sal_uInt32 i) const;
+ virtual void SetObjectPoint(const basegfx::B2DPoint& rPnt, sal_uInt32 i);
+ virtual SdrObjGeoData* GetGeoData() const;
+ virtual void SetGeoData(const SdrObjGeoData& rGeo);
+ //virtual void NbcReformatText();
+ virtual void ReformatText();
+ virtual void PaintMacro (OutputDevice& rOut, const SdrObjMacroHitRec& rRec) const;
+ virtual bool DoMacro (const SdrObjMacroHitRec& rRec);
+ virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const;
+ virtual const Point GetOffset() const;
+
+ virtual void setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation);
};
diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx
index a5eb1b45f913..6cc70f26606d 100644
--- a/sw/source/core/inc/doctxm.hxx
+++ b/sw/source/core/inc/doctxm.hxx
@@ -101,7 +101,6 @@ public:
void Update( const SfxItemSet* pAttr = 0,
const bool _bNewTOX = false ); // Formatieren
void UpdatePageNum(); // Seitennummern einfuegen
- TYPEINFO(); // fuers rtti
sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const;
};
diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx
index 1a2017ce3482..1a8be03420b6 100644
--- a/sw/source/core/inc/dview.hxx
+++ b/sw/source/core/inc/dview.hxx
@@ -78,7 +78,7 @@ class SwDrawView : public FmFormView
@author OD
*/
void _MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
- const std::vector<SdrObject*>& _rMovedChildObjs ) const;
+ const SdrObjectVector& _rMovedChildObjs ) const;
protected:
// add custom handles (used by other apps, e.g. AnchorPos)
@@ -86,27 +86,26 @@ protected:
// overloaded to allow extra handling when picking SwVirtFlyDrawObj's
using FmFormView::CheckSingleSdrObjectHit;
- virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const;
+ virtual SdrObject* CheckSingleSdrObjectHit(const basegfx::B2DPoint& rPnt, double fTol, SdrObject* pObj, sal_uInt32 nOptions, const SetOfByte* pMVisLay) const;
// support enhanced text edit for draw objects
virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const;
public:
- SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice* pOutDev=NULL );
+ SwDrawView( SwViewImp &rI, FmFormModel& rModel, OutputDevice* pOutDev = NULL );
//aus der Basisklasse
virtual SdrObject* GetMaxToTopObj(SdrObject* pObj) const;
virtual SdrObject* GetMaxToBtmObj(SdrObject* pObj) const;
- virtual void MarkListHasChanged();
+ virtual void handleSelectionChange();
// #i7672#
// Overload to resue edit background color in active text edit view (OutlinerView)
- virtual void ModelHasChanged();
+ virtual void LazyReactOnObjectChanges();
- virtual void ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
- sal_uLong nNewPos );
- virtual sal_Bool TakeDragLimit(SdrDragMode eMode, Rectangle& rRect) const;
- virtual void MakeVisible( const Rectangle&, Window &rWin );
+ virtual void ObjOrderChanged( SdrObject* pObj, sal_uInt32 nOldPos, sal_uInt32 nNewPos );
+ virtual bool TakeDragLimit(SdrDragMode eMode, basegfx::B2DRange& rRange) const;
+ virtual void MakeVisibleAtView( const basegfx::B2DRange& rRange, Window &rWin );
virtual void CheckPossibilities();
const SwViewImp &Imp() const { return rImp; }
@@ -118,7 +117,7 @@ public:
virtual void DeleteMarked();
//JP 06.10.98: 2. Versuch
- inline void ValidateMarkList() { FlushComeBackTimer(); }
+ inline void ValidateMarkList() { ForceLazyReactOnObjectChanges(); }
// --> OD 2009-03-05 #i99665#
sal_Bool IsAntiAliasing() const;
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index f778636f2f32..f4440eefe921 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -154,8 +154,6 @@ public:
sal_Bool IsPageNumberingFrm();
//Bug 120881(End)
// OD 2004-03-23 #i26791#
- TYPEINFO();
-
virtual ~SwFlyFrm();
// erfrage vom Client Informationen
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 611e906f32e8..f00e5a3569a6 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -68,8 +68,6 @@ protected:
public:
// --> OD 2004-06-29 #i28701#
- TYPEINFO();
-
virtual ~SwFlyFreeFrm();
virtual void MakeAll();
@@ -124,8 +122,6 @@ class SwFlyLayFrm : public SwFlyFreeFrm
{
public:
// --> OD 2004-06-29 #i28701#
- TYPEINFO();
-
SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
SwFlyLayFrm( SwFlyLayFrm& );
protected:
@@ -153,8 +149,6 @@ protected:
public:
// --> OD 2004-06-29 #i28701#
- TYPEINFO();
-
SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
void SetAbsPos( const Point &rNew );
@@ -191,8 +185,6 @@ protected:
public:
// --> OD 2004-06-29 #i28701#
- TYPEINFO();
-
SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
virtual ~SwFlyInCntFrm();
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 49b4047a806e..0c6867391d7b 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -492,8 +492,6 @@ protected:
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
-
sal_uInt16 GetType() const { return 0x1 << nType; }
static SwCache &GetCache() { return *pCache; }
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 1ad75c4173e1..c7c095539a9e 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -39,7 +39,6 @@ class SwAttrSet;
class SdrObject;
class BigInt;
class SvxBrushItem;
-class SdrMarkList;
class SwNodeIndex;
class OutputDevice;
class SwPageDesc;
@@ -78,7 +77,7 @@ void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
//Fly besorgen, wenn keine List hineingereicht wird, wir die der aktuellen
//Shell benutzt.
//Implementierung in feshview.cxx
-SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh );
+SwFlyFrm *GetFlyFromMarked( ViewShell *pSh );
//Nicht gleich die math.lib anziehen.
sal_uLong MA_FASTCALL SqRt( BigInt nX );
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index a0bb7a779d6c..5608d8acb490 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -63,8 +63,6 @@ protected:
public:
// --> OD 2004-06-29 #i28701#
- TYPEINFO();
-
void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
void RefreshLaySubsidiary( const SwPageFrm*, const SwRect& ) const;
void RefreshExtraData( const SwRect & ) const;
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index a255abf1bd08..2898b1f6898d 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -377,7 +377,6 @@ public:
SwTwips HangingMargin() const;
// RTTI
- TYPEINFO();
DECL_FIXEDMEMPOOL_NEWDEL(SwTxtFrm)
// Locking
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 7ba287a588ef..6f3edf5854ce 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -76,7 +76,6 @@ class SwViewImp
//Rueckwaertsverkettung.
SwDrawView *pDrawView; //Unsere DrawView
- SdrPageView *pSdrPageView; //Genau eine Seite fuer unsere DrawView
SwPageFrm *pFirstVisPage;//Zeigt immer auf die erste sichtbare Seite.
SwRegionRects *pRegion; //Sammler fuer Paintrects aus der LayAction.
@@ -93,10 +92,6 @@ class SwViewImp
sal_Bool bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig?
- //sal_Bool bResetXorVisibility:1; //StartAction/EndAction
- //HMHBOOL bShowHdlPaint :1; //LockPaint/UnlockPaint
- sal_Bool bResetHdlHiddenPaint:1;// -- "" --
-
sal_Bool bSmoothUpdate :1; //Meber fuer SmoothScroll
sal_Bool bStopSmooth :1;
sal_Bool bStopPrt :1; // Stop Printing
@@ -203,8 +198,6 @@ public:
inline sal_Bool HasDrawView() const { return 0 != pDrawView; }
SwDrawView* GetDrawView() { return pDrawView; }
const SwDrawView* GetDrawView() const { return pDrawView; }
- SdrPageView*GetPageView() { return pSdrPageView; }
- const SdrPageView*GetPageView() const { return pSdrPageView; }
void MakeDrawView();
// OD 29.08.2002 #102450#
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 612b3d332306..bd989365512f 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -48,6 +48,7 @@
// --> OD 2005-03-09 #i44559#
#include <ndtxt.hxx>
// <--
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -219,14 +220,11 @@ bool SwObjPosOscillationControl::OscillationDetected()
// ============================================================================
// implementation of class <SwAnchoredDrawObject>
// ============================================================================
-TYPEINIT1(SwAnchoredDrawObject,SwAnchoredObject);
SwAnchoredDrawObject::SwAnchoredDrawObject() :
SwAnchoredObject(),
mbValidPos( false ),
- // --> OD 2004-09-29 #i34748#
- mpLastObjRect( 0L ),
- // <--
+ maLastObjRect(),
mbNotYetAttachedToAnchorFrame( true ),
// --> OD 2004-08-09 #i28749#
mbNotYetPositioned( true ),
@@ -239,9 +237,6 @@ SwAnchoredDrawObject::SwAnchoredDrawObject() :
SwAnchoredDrawObject::~SwAnchoredDrawObject()
{
- // --> OD 2004-11-03 - follow-up of #i34748#
- delete mpLastObjRect;
- // <--
}
// --> OD 2006-03-17 #i62875#
@@ -305,7 +300,7 @@ void SwAnchoredDrawObject::MakeObjPos()
}
SwDrawContact* pDrawContact =
- static_cast<SwDrawContact*>(::GetUserCall( GetDrawObj() ));
+ static_cast<SwDrawContact*>(::findConnectionToSdrObject( GetDrawObj() ));
// --> OD 2004-08-09 #i28749# - if anchored drawing object hasn't been yet
// positioned, convert its positioning attributes, if its positioning
@@ -325,7 +320,7 @@ void SwAnchoredDrawObject::MakeObjPos()
// attributes only for 'master' drawing objects
// --> OD 2005-03-11 #i44334#, #i44681# - check, if positioning
// attributes already have been set.
- if ( !GetDrawObj()->ISA(SwDrawVirtObj) &&
+ if ( !dynamic_cast< const SwDrawVirtObj* >(GetDrawObj()) &&
!static_cast<SwDrawFrmFmt&>(GetFrmFmt()).IsPosAttrSet() )
{
_SetPositioningAttr();
@@ -384,7 +379,7 @@ void SwAnchoredDrawObject::MakeObjPos()
// Assure for 'master' drawing object, that it's registered at the correct page.
// Perform check not for as-character anchored drawing objects and only if
// the anchor frame is valid.
- if ( !GetDrawObj()->ISA(SwDrawVirtObj) &&
+ if ( !dynamic_cast< const SwDrawVirtObj* >(GetDrawObj()) &&
!pDrawContact->ObjAnchoredAsChar() &&
GetAnchorFrm()->IsValid() )
{
@@ -401,14 +396,14 @@ void SwAnchoredDrawObject::MakeObjPos()
if ( aObjRect.Right() >= aPageRect.Right() + 10 )
{
Size aSize( aPageRect.Right() - aObjRect.Right(), 0 );
- DrawObj()->Move( aSize );
+ sdr::legacy::transformSdrObject(*DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(aSize.Width(), aSize.Height()));
aObjRect = GetObjRect();
}
if ( aObjRect.Left() + 10 <= aPageRect.Left() )
{
Size aSize( aPageRect.Left() - aObjRect.Left(), 0 );
- DrawObj()->Move( aSize );
+ sdr::legacy::transformSdrObject(*DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(aSize.Width(), aSize.Height()));
}
mbCaptureAfterLayoutDirChange = false;
@@ -541,7 +536,16 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtLayout()
{
const Point aNewAnchorPos =
GetAnchorFrm()->GetFrmAnchorPos( ::HasWrap( GetDrawObj() ) );
- DrawObj()->SetAnchorPos( aNewAnchorPos );
+
+ // #i108739#
+ {
+ const Point aCurrentAnchor(sdr::legacy::GetAnchorPos(*DrawObj()));
+ sdr::legacy::transformSdrObject(*DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(
+ aNewAnchorPos.X() - aCurrentAnchor.X(),
+ aNewAnchorPos.Y() - aCurrentAnchor.Y()));
+ DrawObj()->SetAnchorPos( basegfx::B2DPoint( aNewAnchorPos.X(), aNewAnchorPos.Y() ) );
+ }
+
// --> OD 2006-10-05 #i70122# - missing invalidation
InvalidateObjRectWithSpaces();
// <--
@@ -562,16 +566,14 @@ void SwAnchoredDrawObject::_SetDrawObjAnchor()
// --> OD 2004-07-29 #i31698# -
Point aNewAnchorPos =
GetAnchorFrm()->GetFrmAnchorPos( ::HasWrap( GetDrawObj() ) );
- Point aCurrAnchorPos = GetDrawObj()->GetAnchorPos();
+ const Point aCurrAnchorPos(sdr::legacy::GetAnchorPos(*GetDrawObj()));
if ( aNewAnchorPos != aCurrAnchorPos )
{
- // determine movement to be applied after setting the new anchor position
- Size aMove( aCurrAnchorPos.X() - aNewAnchorPos.X(),
- aCurrAnchorPos.Y() - aNewAnchorPos.Y() );
- // set new anchor position
- DrawObj()->SetAnchorPos( aNewAnchorPos );
- // correct object position, caused by setting new anchor position
- DrawObj()->Move( aMove );
+ // #i108739#
+ {
+ DrawObj()->SetAnchorPos( basegfx::B2DPoint( aNewAnchorPos.X(), aNewAnchorPos.Y() ) );
+ }
+
// --> OD 2006-10-05 #i70122# - missing invalidation
InvalidateObjRectWithSpaces();
// <--
@@ -633,7 +635,7 @@ void SwAnchoredDrawObject::InvalidateObjPos()
// anchored object, because its positioned by the format of its anchor frame.
// --> OD 2005-03-09 #i44559# - assure, that text hint is already
// existing in the text frame
- if ( GetAnchorFrm()->ISA(SwTxtFrm) &&
+ if ( dynamic_cast< const SwTxtFrm* >(GetAnchorFrm()) &&
(GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR) )
{
SwTxtFrm* pAnchorTxtFrm( static_cast<SwTxtFrm*>(AnchorFrm()) );
@@ -675,28 +677,27 @@ void SwAnchoredDrawObject::InvalidateObjPos()
SwFrmFmt& SwAnchoredDrawObject::GetFrmFmt()
{
- ASSERT( static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt(),
+ ASSERT( static_cast<SwDrawContact*>(findConnectionToSdrObject(GetDrawObj()))->GetFmt(),
"<SwAnchoredDrawObject::GetFrmFmt()> - missing frame format -> crash." );
- return *(static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt());
+ return *(static_cast<SwDrawContact*>(findConnectionToSdrObject(GetDrawObj()))->GetFmt());
}
const SwFrmFmt& SwAnchoredDrawObject::GetFrmFmt() const
{
- ASSERT( static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt(),
+ ASSERT( static_cast<SwDrawContact*>(findConnectionToSdrObject(GetDrawObj()))->GetFmt(),
"<SwAnchoredDrawObject::GetFrmFmt()> - missing frame format -> crash." );
- return *(static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt());
+ return *(static_cast<SwDrawContact*>(findConnectionToSdrObject(GetDrawObj()))->GetFmt());
}
const SwRect SwAnchoredDrawObject::GetObjRect() const
{
// use geometry of drawing object
- //return GetDrawObj()->GetCurrentBoundRect();
- return GetDrawObj()->GetSnapRect();
+ return sdr::legacy::GetSnapRect(*GetDrawObj());
}
// --> OD 2006-10-05 #i70122#
const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
{
- return GetDrawObj()->GetCurrentBoundRect();
+ return sdr::legacy::GetBoundRect(*GetDrawObj());
}
// <--
@@ -704,14 +705,14 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
bool SwAnchoredDrawObject::_SetObjTop( const SwTwips _nTop )
{
SwTwips nDiff = _nTop - GetObjRect().Top();
- DrawObj()->Move( Size( 0, nDiff ) );
+ sdr::legacy::transformSdrObject(*DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(0.0, nDiff));
return nDiff != 0;
}
bool SwAnchoredDrawObject::_SetObjLeft( const SwTwips _nLeft )
{
SwTwips nDiff = _nLeft - GetObjRect().Left();
- DrawObj()->Move( Size( nDiff, 0 ) );
+ sdr::legacy::transformSdrObject(*DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(nDiff, 0.0));
return nDiff != 0;
}
@@ -754,24 +755,22 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrm* _pNewAnchorFrm,
GetFrmFmt().SetFmtAttr( SwFmtVertOrient( nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
}
-// --> OD 2004-09-29 #i34748# - change return type
-const Rectangle* SwAnchoredDrawObject::GetLastObjRect() const
+const Rectangle& SwAnchoredDrawObject::GetLastObjRect() const
{
- return mpLastObjRect;
+ return maLastObjRect;
}
-// <--
-// --> OD 2004-09-29 #i34748# - change return type.
-// If member <mpLastObjRect> is NULL, create one.
-void SwAnchoredDrawObject::SetLastObjRect( const Rectangle& _rNewLastRect )
+void SwAnchoredDrawObject::SetLastObjRect(const Rectangle& _rNewLastRect)
{
- if ( !mpLastObjRect )
+ if(maLastObjRect.IsEmpty())
{
- mpLastObjRect = new Rectangle;
+ maLastObjRect = _rNewLastRect;
+ }
+ else if(maLastObjRect != _rNewLastRect)
+ {
+ maLastObjRect = _rNewLastRect;
}
- *(mpLastObjRect) = _rNewLastRect;
}
-// <--
void SwAnchoredDrawObject::ObjectAttachedToAnchorFrame()
{
@@ -799,7 +798,7 @@ void SwAnchoredDrawObject::ObjectAttachedToAnchorFrame()
void SwAnchoredDrawObject::_SetPositioningAttr()
{
SwDrawContact* pDrawContact =
- static_cast<SwDrawContact*>(GetUserCall( GetDrawObj() ));
+ static_cast<SwDrawContact*>(findConnectionToSdrObject( GetDrawObj() ));
if ( !pDrawContact->ObjAnchoredAsChar() )
{
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index 5296625ec343..2972bc7a9891 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -62,7 +62,7 @@ SwObjPositioningInProgress::SwObjPositioningInProgress( SdrObject& _rSdrObj ) :
mbOldObjPositioningInProgress( false )
// <--
{
- mpAnchoredObj = ::GetUserCall( &_rSdrObj )->GetAnchoredObj( &_rSdrObj );
+ mpAnchoredObj = ::findConnectionToSdrObject( &_rSdrObj )->GetAnchoredObj( &_rSdrObj );
// --> OD 2005-08-09 #i52904#
mbOldObjPositioningInProgress = mpAnchoredObj->IsPositioningInProgress();
// <--
@@ -92,8 +92,6 @@ SwObjPositioningInProgress::~SwObjPositioningInProgress()
// ============================================================================
-TYPEINIT0(SwAnchoredObject);
-
SwAnchoredObject::SwAnchoredObject() :
mpDrawObj( 0L ),
mpAnchorFrm( 0L ),
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 3df42989dbad..05d4039c7366 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -112,13 +112,6 @@ using ::rtl::OUString;
SV_IMPL_PTRARR(SwColumns,SwColumn*)
-TYPEINIT1(SwFmtVertOrient, SfxPoolItem);
-TYPEINIT1(SwFmtHoriOrient, SfxPoolItem);
-TYPEINIT2(SwFmtHeader, SfxPoolItem, SwClient );
-TYPEINIT2(SwFmtFooter, SfxPoolItem, SwClient );
-TYPEINIT2(SwFmtPageDesc, SfxPoolItem, SwClient );
-TYPEINIT1_AUTOFACTORY(SwFmtLineNumber, SfxPoolItem);
-
/* -----------------19.05.98 09:26-------------------
* Umwandlung fuer QueryValue
* --------------------------------------------------*/
@@ -182,12 +175,12 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
// Klammer, weil im DTOR SwClientIter das Flag bTreeChg zurueck
// gesetzt wird. Unguenstig, wenn das Format vorher zerstoert wird.
SwClientIter aIter( *pFmt ); // TODO
- SwClient *pLast = aIter.GoStart();
+ SwClient *pLast = aIter.SwClientIter_First();
if( pLast )
do {
- bDel = pLast->IsA( TYPE(SwFrm) )
+ bDel = dynamic_cast< SwFrm* >(pLast)
|| SwXHeadFootText::IsXHeadFootText(pLast);
- } while( bDel && 0 != ( pLast = ++aIter ));
+ } while( bDel && 0 != ( pLast = aIter.SwClientIter_Next() ));
}
if ( bDel )
@@ -675,10 +668,14 @@ void SwFmtPageDesc::SwClientNotify( const SwModify&, const SfxHint& rHint )
const SwModify* pMod = GetDefinedIn();
if ( pMod )
{
- if( pMod->ISA( SwCntntNode ) )
+ if( dynamic_cast< const SwCntntNode* >(pMod) )
+ {
((SwCntntNode*)pMod)->SetAttr( aDfltDesc );
- else if( pMod->ISA( SwFmt ))
+ }
+ else if( dynamic_cast< const SwFmt* >(pMod))
+ {
((SwFmt*)pMod)->SetFmtAttr( aDfltDesc );
+ }
else
{
DBG_ERROR( "What kind of SwModify is this?" );
@@ -686,10 +683,12 @@ void SwFmtPageDesc::SwClientNotify( const SwModify&, const SfxHint& rHint )
}
}
else
+ {
// there could be an Undo-copy
RegisterToPageDesc( *pDesc );
}
}
+}
void SwFmtPageDesc::RegisterToPageDesc( SwPageDesc& rDesc )
{
@@ -708,7 +707,7 @@ void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
//Der Pagedesc, bei dem ich angemeldet bin stirbt, ich trage
//mich also bei meinem Format aus.
//Dabei werden ich Deletet!!!
- if( IS_TYPE( SwFmt, pDefinedIn ))
+ if( typeid(SwFmt) == typeid(*pDefinedIn) ) // IS_TYPE( SwFmt, pDefinedIn ))
#ifdef DBG_UTIL
{
sal_Bool bDel = ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC );
@@ -717,7 +716,7 @@ void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
#else
((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC );
#endif
- else if( IS_TYPE( SwCntntNode, pDefinedIn ))
+ else if( typeid(SwCntntNode) == typeid(*pDefinedIn) ) // IS_TYPE( SwCntntNode, pDefinedIn ))
#ifdef DBG_UTIL
{
sal_Bool bDel = ((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC );
@@ -1880,6 +1879,10 @@ SfxPoolItem* SwFmtNoBalancedColumns::Clone( SfxItemPool* ) const
}
// class SwFmtFtnEndAtTxtEnd
+SfxPoolItem* SwFmtFtnEndAtTxtEnd::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SwFmtFtnEndAtTxtEnd(*this);
+}
sal_uInt16 SwFmtFtnEndAtTxtEnd::GetValueCount() const
{
@@ -2101,6 +2104,7 @@ sal_Bool SwFmtChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
//class SwFmtLineNumber
+IMPL_POOLITEM_FACTORY(SwFmtLineNumber)
SwFmtLineNumber::SwFmtLineNumber() :
SfxPoolItem( RES_LINENUMBER )
@@ -2474,7 +2478,6 @@ SfxPoolItem* SwHeaderAndFooterEatSpacingItem::Clone( SfxItemPool* ) const
// class SwFrmFmt
// Implementierung teilweise inline im hxx
-TYPEINIT1( SwFrmFmt, SwFmt );
IMPL_FIXEDMEMPOOL_NEWDEL_DLL( SwFrmFmt, 20, 20 )
void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
@@ -2549,7 +2552,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
{
SwRect aRet;
SwFrm *pFrm = 0;
- if( ISA( SwSectionFmt ) )
+ if( dynamic_cast< const SwSectionFmt* >(this) )
{
// dann den frame::Frame per Node2Layout besorgen
SwSectionNode* pSectNd = ((SwSectionFmt*)this)->GetSectionNode();
@@ -2705,7 +2708,6 @@ String SwFrmFmt::GetDescription() const
// class SwFlyFrmFmt
// Implementierung teilweise inline im hxx
-TYPEINIT1( SwFlyFrmFmt, SwFrmFmt );
IMPL_FIXEDMEMPOOL_NEWDEL( SwFlyFrmFmt, 10, 10 )
SwFlyFrmFmt::~SwFlyFrmFmt()
@@ -2868,7 +2870,7 @@ void SwFlyFrmFmt::MakeFrms()
// --> OD 2004-07-01 #i28701# - consider changed type of
// <SwSortedObjs> entries.
SwAnchoredObject* pObj = rObjs[i];
- if( pObj->ISA(SwFlyFrm) &&
+ if( dynamic_cast< SwFlyFrm* >(pObj) &&
(&pObj->GetFrmFmt()) == this )
{
bAdd = sal_False;
@@ -3148,7 +3150,6 @@ SwHandleAnchorNodeChg::~SwHandleAnchorNodeChg()
// class SwDrawFrmFmt
// Implementierung teilweise inline im hxx
-TYPEINIT1( SwDrawFrmFmt, SwFrmFmt );
IMPL_FIXEDMEMPOOL_NEWDEL( SwDrawFrmFmt, 10, 10 )
SwDrawFrmFmt::~SwDrawFrmFmt()
@@ -3216,7 +3217,7 @@ String SwDrawFrmFmt::GetDescription() const
{
if (pSdrObj != pSdrObjCached)
{
- SdrObject * pSdrObjCopy = pSdrObj->Clone();
+ SdrObject * pSdrObjCopy = pSdrObj->CloneSdrObject();
SdrUndoNewObj * pSdrUndo = new SdrUndoNewObj(*pSdrObjCopy);
sSdrObjCachedComment = pSdrUndo->GetComment();
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 808dc9df3f0e..b9f3cf81734f 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -682,9 +682,10 @@ void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot )
// entries.
SwAnchoredObject* pObj = (*pSortedObjs)[i];
long nTmp = 0;
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm *pFly = dynamic_cast<SwFlyFrm*>(pObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pObj);
if( pFly->Frm().Top() != WEIT_WECH &&
( pFrm->IsPageFrm() ? pFly->IsFlyLayFrm() :
( pFly->IsFlyAtCntFrm() &&
@@ -1003,13 +1004,13 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
//geben kann (RootFrm::ImplCalcBrowseWidth())
long nMinWidth = 0;
- for (sal_uInt16 i = 0; GetDrawObjs() && i < GetDrawObjs()->Count();++i)
+ for (sal_uInt32 i = 0; GetDrawObjs() && i < GetDrawObjs()->Count();++i)
{
// --> OD 2004-07-01 #i28701# - consider changed type of
// <SwSortedObjs> entries
SwAnchoredObject* pObj = (*GetDrawObjs())[i];
const SwFrmFmt& rFmt = pObj->GetFrmFmt();
- const sal_Bool bFly = pObj->ISA(SwFlyFrm);
+ const bool bFly = dynamic_cast< SwFlyFrm* >(pObj);
if ((bFly && (WEIT_WECH == pObj->GetObjRect().Width()))
|| rFmt.GetFrmSize().GetWidthPercent())
{
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 9b5e0f0f54db..71f0dc482065 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -769,7 +769,7 @@ void SwImplProtocol::SnapShot( const SwFrm* pFrm, sal_uLong nFlags )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
- if ( pObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pObj) )
SnapShot( static_cast<SwFlyFrm*>(pObj), nFlags );
}
if( aLayer.Len() > 1 )
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 5c02a18d2114..9ef274e32323 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -338,7 +338,7 @@ sal_uInt8 SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRe
if( rThis.IsLayoutFrm() && //Fly Lower von This?
Is_Lower_Of( &rThis, pObj->GetDrawObj() ) )
continue;
- if( pObj->ISA(SwFlyFrm) )
+ if( dynamic_cast< SwFlyFrm* >(pObj) )
{
const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pObj);
if ( pFly->IsAnLower( &rThis ) )//This Lower vom Fly?
@@ -2531,7 +2531,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
}
pIndNext = pIndNext->GetIndNext();
}
- ASSERT( !pIndNext || pIndNext->ISA(SwTxtFrm),
+ ASSERT( !pIndNext || dynamic_cast< SwTxtFrm* >(pIndNext),
"<SwFlowFrm::MovedBwd(..)> - incorrect next found." );
if ( pIndNext && pIndNext->IsFlowFrm() &&
SwFlowFrm::CastFlowFrm(pIndNext)->IsJoinLocked() )
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index feb36e123ca5..8881eb6c4990 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -84,14 +84,12 @@
#include "sectfrm.hxx"
#include <vcl/svapp.hxx>
#include <vcl/salbtype.hxx> // FRound
+#include <svx/fmmodel.hxx>
#include "switerator.hxx"
using namespace ::com::sun::star;
-// OD 2004-03-23 #i26791
-TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject);
-
/*************************************************************************
|*
|* SwFlyFrm::SwFlyFrm()
@@ -350,22 +348,23 @@ void SwFlyFrm::DeleteCnt()
while ( pFrm->GetDrawObjs() && pFrm->GetDrawObjs()->Count() )
{
SwAnchoredObject *pAnchoredObj = (*pFrm->GetDrawObjs())[0];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
delete pAnchoredObj;
- else if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pAnchoredObj) )
{
// OD 23.06.2003 #108784# - consider 'virtual' drawing objects
SdrObject* pObj = pAnchoredObj->DrawObj();
- if ( pObj->ISA(SwDrawVirtObj) )
+ SwDrawVirtObj* pDrawVirtObj = dynamic_cast<SwDrawVirtObj*>(pObj);
+
+ if ( pDrawVirtObj )
{
- SwDrawVirtObj* pDrawVirtObj = static_cast<SwDrawVirtObj*>(pObj);
pDrawVirtObj->RemoveFromWriterLayout();
pDrawVirtObj->RemoveFromDrawingPage();
}
else
{
SwDrawContact* pContact =
- static_cast<SwDrawContact*>(::GetUserCall( pObj ));
+ static_cast<SwDrawContact*>(::findConnectionToSdrObject( pObj ));
if ( pContact )
{
pContact->DisconnectFromLayout();
@@ -409,16 +408,12 @@ sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact )
if ( pFlyFrm )
{
// another Writer fly frame found. Take its order number
- nOrdNum = pFlyFrm->GetVirtDrawObj()->GetOrdNum();
+ nOrdNum = pFlyFrm->GetVirtDrawObj()->GetNavigationPosition();
}
else
{
// no other Writer fly frame found. Take order number of 'master' object
- // --> OD 2004-11-11 #i35748# - use method <GetOrdNumDirect()> instead
- // of method <GetOrdNum()> to avoid a recalculation of the order number,
- // which isn't intended.
- nOrdNum = pContact->GetMaster()->GetOrdNumDirect();
- // <--
+ nOrdNum = pContact->GetMaster()->GetNavigationPosition();
}
return nOrdNum;
@@ -427,25 +422,24 @@ sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact )
SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact )
{
SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *pContact->GetMaster(), this );
- pDrawObj->SetModel( pContact->GetMaster()->GetModel() );
- pDrawObj->SetUserCall( pContact );
+ establishConnectionToSdrObject(pDrawObj, pContact);
//Der Reader erzeugt die Master und setzt diese, um die Z-Order zu
//transportieren, in die Page ein. Beim erzeugen der ersten Referenz werden
//die Master aus der Liste entfernt und fuehren von da an ein
//Schattendasein.
- SdrPage* pPg( 0L );
- if ( 0 != ( pPg = pContact->GetMaster()->GetPage() ) )
+ SdrPage* pPg( 0 );
+ if ( 0 != ( pPg = pContact->GetMaster()->getSdrPageFromSdrObject() ) )
{
- const sal_uInt32 nOrdNum = pContact->GetMaster()->GetOrdNum();
- pPg->ReplaceObject( pDrawObj, nOrdNum );
+ const sal_uInt32 nOrdNum = pContact->GetMaster()->GetNavigationPosition();
+ pPg->ReplaceObjectInSdrObjList( *pDrawObj, nOrdNum );
}
// --> OD 2004-08-16 #i27030# - insert new <SwVirtFlyDrawObj> instance
// into drawing page with correct order number
else
{
pContact->GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )->
- InsertObject( pDrawObj, _GetOrdNumForNewRef( pContact ) );
+ InsertObjectToSdrObjList(*pDrawObj, _GetOrdNumForNewRef( pContact ) );
}
// <--
// --> OD 2004-12-13 #i38889# - assure, that new <SwVirtFlyDrawObj> instance
@@ -469,7 +463,7 @@ void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
{
// --> OD 2005-08-08 #i52858# - method name changed
pContact = new SwFlyDrawContact( (SwFlyFrmFmt*)GetFmt(),
- pIDDMA->GetOrCreateDrawModel() );
+ *pIDDMA->GetOrCreateDrawModel() );
// <--
}
ASSERT( pContact, "InitDrawObj failed" );
@@ -546,10 +540,14 @@ void SwFlyFrm::FinitDrawObj()
// Writer fly frame again.
if ( pMyContact )
{
- pMyContact->GetMaster()->SetUserCall( 0 );
+ resetConnectionToSdrObject(pMyContact->GetMaster());
}
- GetVirtDrawObj()->SetUserCall( 0 ); //Ruft sonst Delete des ContactObj
- delete GetVirtDrawObj(); //Meldet sich selbst beim Master ab.
+
+ SwVirtFlyDrawObj* pSwVirtFlyDrawObj = GetVirtDrawObj();
+
+ resetConnectionToSdrObject(pSwVirtFlyDrawObj);
+ deleteSdrObjectSafeAndClearPointer(pSwVirtFlyDrawObj); //Meldet sich selbst beim Master ab.
+
if ( pMyContact )
delete pMyContact; //zerstoert den Master selbst.
}
@@ -1456,9 +1454,10 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
for ( sal_uInt16 i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
// OD 06.11.2003 #i22305# - consider
// only Writer fly frames, which follow the text flow.
if ( pFly->IsFlyLayFrm() &&
@@ -2328,19 +2327,19 @@ void SwFrm::RemoveFly( SwFlyFrm *pToRemove )
|*************************************************************************/
void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
{
- if ( !_rNewObj.ISA(SwAnchoredDrawObject) )
+ if ( !dynamic_cast< SwAnchoredDrawObject* >(&_rNewObj) )
{
ASSERT( false,
"SwFrm::AppendDrawObj(..) - anchored object of unexcepted type -> object not appended" );
return;
}
- if ( !_rNewObj.GetDrawObj()->ISA(SwDrawVirtObj) &&
+ if ( !dynamic_cast< const SwDrawVirtObj* >(_rNewObj.GetDrawObj()) &&
_rNewObj.GetAnchorFrm() && _rNewObj.GetAnchorFrm() != this )
{
// perform disconnect from layout, if 'master' drawing object is appended
// to a new frame.
- static_cast<SwDrawContact*>(::GetUserCall( _rNewObj.GetDrawObj() ))->
+ static_cast<SwDrawContact*>(::findConnectionToSdrObject( _rNewObj.GetDrawObj() ))->
DisconnectFromLayout( false );
}
@@ -2487,9 +2486,10 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
}
// <--
// distinguish between writer fly frames and drawing objects
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast<SwFlyFrm*>(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
pFly->_Invalidate();
pFly->_InvalidatePos();
if ( !_bInvaPosOnly )
@@ -2533,10 +2533,10 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
// text frame is taken.
const SwFrm* pAnchorFrm = pObj->GetAnchorFrmContainingAnchPos();
// <--
- if ( pObj->ISA(SwFlyFrm) )
- {
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pObj);
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pObj);
+ if ( pFly )
+ {
if ( pFly->Frm().Left() == WEIT_WECH )
continue;
@@ -2567,7 +2567,7 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
}
else
{
- ASSERT( pObj->ISA(SwAnchoredDrawObject),
+ ASSERT( dynamic_cast< SwAnchoredDrawObject* >(pObj),
"<SwLayoutFrm::NotifyFlys() - anchored object of unexcepted type" );
// --> OD 2004-10-08 #i26945# - use <pAnchorFrm> to check, if
// fly frame is lower of layout frame resp. if fly frame is
@@ -2601,10 +2601,9 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
void SwFlyFrm::NotifyDrawObj()
{
SwVirtFlyDrawObj* pObj = GetVirtDrawObj();
+ const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*pObj);
pObj->SetRect();
- pObj->SetRectsDirty();
pObj->SetChanged();
- pObj->BroadcastObjectChange();
if ( GetFmt()->GetSurround().IsContour() )
ClrContourCache( pObj );
}
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 74c5301b214a..2f86c798d0d6 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -87,9 +87,6 @@ SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
bAutoPosition = (FLY_AT_CHAR == pFmt->GetAnchor().GetAnchorId());
}
-// --> OD 2004-06-29 #i28701#
-TYPEINIT1(SwFlyAtCntFrm,SwFlyFreeFrm);
-// <--
/*************************************************************************
|*
|* SwFlyAtCntFrm::Modify()
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 9096ff27e67c..d8551ffdb9c2 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -72,9 +72,6 @@ SwFlyInCntFrm::~SwFlyInCntFrm()
}
}
-// --> OD 2004-06-29 #i28701#
-TYPEINIT1(SwFlyInCntFrm,SwFlyFrm);
-// <--
/*************************************************************************
|*
|* SwFlyInCntFrm::SetRefPoint(),
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 8173438becfd..9cc7390f9855 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -56,6 +56,7 @@
#include <sortedobjs.hxx>
#include <viewsh.hxx>
#include <viewimp.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -109,9 +110,6 @@ SwFlyFreeFrm::~SwFlyFreeFrm()
}
}
-// --> OD 2004-06-29 #i28701#
-TYPEINIT1(SwFlyFreeFrm,SwFlyFrm);
-// <--
/*************************************************************************
|*
|* SwFlyFreeFrm::NotifyBackground()
@@ -550,9 +548,6 @@ SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
bLayout = sal_True;
}
-// --> OD 2004-06-29 #i28701#
-TYPEINIT1(SwFlyLayFrm,SwFlyFreeFrm);
-// <--
/*************************************************************************
|*
|* SwFlyLayFrm::Modify()
@@ -648,10 +643,10 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
{
- if ( !pNew->GetVirtDrawObj()->IsInserted() )
- getRootFrm()->GetDrawPage()->InsertObject(
- (SdrObject*)pNew->GetVirtDrawObj(),
- pNew->GetVirtDrawObj()->GetReferencedObj().GetOrdNumDirect() );
+ if ( !pNew->GetVirtDrawObj()->IsObjectInserted() )
+ getRootFrm()->GetDrawPage()->InsertObjectToSdrObjList(
+ *pNew->GetVirtDrawObj(),
+ pNew->GetVirtDrawObj()->GetReferencedObj().GetNavigationPosition() );
InvalidateSpelling();
InvalidateSmartTags(); // SMARTTAGS
@@ -666,15 +661,26 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
SdrObject* pObj = pNew->GetVirtDrawObj();
ASSERT( pNew->GetAnchorFrm(), "Fly without Anchor" );
- SwFlyFrm* pFly = (SwFlyFrm*)pNew->GetAnchorFrm()->FindFlyFrm();
- if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() )
+ const SwFlyFrm* pFly = pNew->GetAnchorFrm()->FindFlyFrm();
+
+ if ( pFly && pObj->GetNavigationPosition() < pFly->GetVirtDrawObj()->GetNavigationPosition() )
{
//#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
- sal_uInt32 nNewNum = pObj->GetOrdNumDirect();
- if ( pObj->GetPage() )
- pObj->GetPage()->SetObjectOrdNum( pFly->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum );
+ sal_uInt32 nNewNum = pFly->GetVirtDrawObj()->GetNavigationPosition();
+
+ if ( pObj->getParentOfSdrObject() )
+ {
+ pObj->getParentOfSdrObject()->SetNavigationPosition( pFly->GetVirtDrawObj()->GetNavigationPosition(), nNewNum);
+ }
else
- pFly->GetVirtDrawObj()->SetOrdNum( nNewNum );
+ {
+ // TTTT: object should always be inserted into an ObjectList, thus this should not
+ // happen. Even if it happens, there is no use in setting an OrdNum since an object
+ // which is not member of an SdrObjLsit by definition has an OrdNum of 0 since it
+ // is not member of a Z-Order (see SdrObject::GetNavigationPosition())
+ OSL_ENSURE(false, "SwPageFrm::AppendFlyToPage tried to set OrdNum for non-inserted SdrObject (!)");
+ // former code: pFly->GetVirtDrawObj()->SetOrdNum( nNewNum );
+ }
}
//Flys die im Cntnt sitzen beachten wir nicht weiter.
@@ -725,14 +731,15 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pTmpObj = rObjs[i];
- if ( pTmpObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pTmpFly = dynamic_cast< SwFlyFrm* >(pTmpObj);
+
+ if ( pTmpFly )
{
- SwFlyFrm* pTmpFly = static_cast<SwFlyFrm*>(pTmpObj);
// --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
if ( pTmpFly->IsFlyFreeFrm() && !pTmpFly->GetPageFrm() )
AppendFlyToPage( pTmpFly );
}
- else if ( pTmpObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pTmpObj) )
{
// --> OD 2008-04-22 #i87493#
// AppendDrawObjToPage( *pTmpObj );
@@ -761,9 +768,14 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
{
- const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
- getRootFrm()->GetDrawPage()->RemoveObject( nOrdNum );
- pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum );
+ const sal_uInt32 nOrdNum = pToRemove->GetVirtDrawObj()->GetNavigationPosition();
+ getRootFrm()->GetDrawPage()->RemoveObjectFromSdrObjList( nOrdNum );
+
+ SdrObject& rRefObj = pToRemove->GetVirtDrawObj()->ReferencedObj();
+ if(rRefObj.getParentOfSdrObject())
+ {
+ rRefObj.getParentOfSdrObject()->SetNavigationPosition(rRefObj.GetNavigationPosition(), nOrdNum );
+ }
if ( GetUpper() )
{
@@ -893,9 +905,10 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
for ( sal_uInt32 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pObj);
if ( pFly->IsFlyFreeFrm() )
{
// --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
@@ -906,7 +919,7 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
pDest->AppendFlyToPage( pFly );
}
}
- else if ( pObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pObj) )
{
RemoveDrawObjFromPage( *pObj );
pDest->AppendDrawObjToPage( *pObj );
@@ -924,7 +937,7 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
|*************************************************************************/
void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
{
- if ( !_rNewObj.ISA(SwAnchoredDrawObject) )
+ if ( !dynamic_cast< SwAnchoredDrawObject* >(&_rNewObj) )
{
ASSERT( false,
"SwPageFrm::AppendDrawObjToPage(..) - anchored object of unexcepted type -> object not appended" );
@@ -939,14 +952,24 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
ASSERT( _rNewObj.GetAnchorFrm(), "anchored draw object without anchor" );
SwFlyFrm* pFlyFrm = (SwFlyFrm*)_rNewObj.GetAnchorFrm()->FindFlyFrm();
if ( pFlyFrm &&
- _rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrm->GetVirtDrawObj()->GetOrdNum() )
+ _rNewObj.GetDrawObj()->GetNavigationPosition() < pFlyFrm->GetVirtDrawObj()->GetNavigationPosition() )
{
//#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
- sal_uInt32 nNewNum = _rNewObj.GetDrawObj()->GetOrdNumDirect();
- if ( _rNewObj.GetDrawObj()->GetPage() )
- _rNewObj.DrawObj()->GetPage()->SetObjectOrdNum( pFlyFrm->GetVirtDrawObj()->GetOrdNumDirect(), nNewNum );
+ sal_uInt32 nNewNum = pFlyFrm->GetVirtDrawObj()->GetNavigationPosition();
+
+ if ( _rNewObj.GetDrawObj()->getParentOfSdrObject() )
+ {
+ _rNewObj.DrawObj()->getParentOfSdrObject()->SetNavigationPosition(pFlyFrm->GetVirtDrawObj()->GetNavigationPosition(), nNewNum);
+ }
else
- pFlyFrm->GetVirtDrawObj()->SetOrdNum( nNewNum );
+ {
+ // TTTT: object should always be inserted into an ObjectList, thus this should not
+ // happen. Even if it happens, there is no use in setting an OrdNum since an object
+ // which is not member of an SdrObjLsit by definition has an OrdNum of 0 since it
+ // is not member of a Z-Order (see SdrObject::GetNavigationPosition())
+ OSL_ENSURE(false, "SwPageFrm::AppendDrawObjToPage try to set OrdNum for non-inserted SdrObject (!)");
+ // former code: pFlyFrm->GetVirtDrawObj()->SetOrdNum( nNewNum );
+ }
}
if ( FLY_AS_CHAR == _rNewObj.GetFrmFmt().GetAnchor().GetAnchorId() )
@@ -977,7 +1000,7 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
void SwPageFrm::RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj )
{
- if ( !_rToRemoveObj.ISA(SwAnchoredDrawObject) )
+ if ( !dynamic_cast< SwAnchoredDrawObject* >(&_rToRemoveObj) )
{
ASSERT( false,
"SwPageFrm::RemoveDrawObjFromPage(..) - anchored object of unexcepted type -> object not removed" );
@@ -1063,7 +1086,7 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
{
sal_Bool bRet = sal_True;
- if ( pSdrObj->ISA(SwVirtFlyDrawObj) )
+ if ( dynamic_cast< const SwVirtFlyDrawObj* >(pSdrObj) )
{
const SwFlyFrm* pFly = ((const SwVirtFlyDrawObj*)pSdrObj)->GetFlyFrm();
const bool bFollowTextFlow = pFly->GetFmt()->GetFollowTextFlow().GetValue();
@@ -1300,7 +1323,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
long nHeight = (9*(rRect.*fnRect->fnGetHeight)())/10;
long nTop;
- const SwFmt *pFmt = ((SwContact*)GetUserCall(pSdrObj))->GetFmt();
+ const SwFmt *pFmt = ((SwContact*)findConnectionToSdrObject(pSdrObj))->GetFmt();
const SvxULSpaceItem &rUL = pFmt->GetULSpace();
if( bMove )
{
@@ -1325,7 +1348,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
else
{
- const SwDrawContact *pC = (const SwDrawContact*)GetUserCall(pSdrObj);
+ const SwDrawContact *pC = (const SwDrawContact*)findConnectionToSdrObject(pSdrObj);
const SwFrmFmt *pFmt = (const SwFrmFmt*)pC->GetFmt();
const SwFmtAnchor &rAnch = pFmt->GetAnchor();
if ( FLY_AS_CHAR == rAnch.GetAnchorId() )
@@ -1344,23 +1367,21 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
long nHeight = (9*(rRect.*fnRect->fnGetHeight)())/10;
long nTop;
const SvxULSpaceItem &rUL = pFmt->GetULSpace();
- SwRect aSnapRect( pSdrObj->GetSnapRect() );
+ SwRect aSnapRect( sdr::legacy::GetSnapRect(*pSdrObj) );
long nTmpH = 0;
if( bMove )
{
- nTop = (*fnRect->fnYInc)( bVert ? pSdrObj->GetAnchorPos().X() :
- pSdrObj->GetAnchorPos().Y(), -nHeight );
+ const Point aObjAnchor(sdr::legacy::GetAnchorPos(*pSdrObj));
+ nTop = (*fnRect->fnYInc)( bVert ? aObjAnchor.X() : aObjAnchor.Y(), -nHeight );
long nWidth = (aSnapRect.*fnRect->fnGetWidth)();
- (rRect.*fnRect->fnSetLeftAndWidth)( bVert ?
- pSdrObj->GetAnchorPos().Y() :
- pSdrObj->GetAnchorPos().X(), nWidth );
+ (rRect.*fnRect->fnSetLeftAndWidth)( bVert ? aObjAnchor.Y() : aObjAnchor.X(), nWidth );
}
else
{
// OD 2004-04-13 #i26791# - value of <nTmpH> is needed to
// calculate value of <nTop>.
- nTmpH = bVert ? pSdrObj->GetCurrentBoundRect().GetWidth() :
- pSdrObj->GetCurrentBoundRect().GetHeight();
+ nTmpH = bVert ? sdr::legacy::GetBoundRect(*pSdrObj).GetWidth() :
+ sdr::legacy::GetBoundRect(*pSdrObj).GetHeight();
nTop = (*fnRect->fnYInc)( (aSnapRect.*fnRect->fnGetTop)(),
rUL.GetLower() + nTmpH - nHeight );
}
diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx
index 4cf41bd4c50f..36a2aeb0c5ee 100644
--- a/sw/source/core/layout/flypos.cxx
+++ b/sw/source/core/layout/flypos.cxx
@@ -65,7 +65,7 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(*pFmt);
if( pFly )
{
- nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
+ nOrdNum = pFly->GetVirtDrawObj()->GetNavigationPosition();
bFnd = true;
}
}
@@ -75,7 +75,7 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement(*pFmt);
if( pContact )
{
- nOrdNum = pContact->GetMaster()->GetOrdNum();
+ nOrdNum = pContact->GetMaster()->GetNavigationPosition();
bFnd = true;
}
}
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 4d7d0ecfe72a..576876cd07fe 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -35,6 +35,7 @@
#include <editeng/boxitem.hxx>
#include <sfx2/printer.hxx>
#include <editeng/lspcitem.hxx>
+#include <svx/svdlegacy.hxx>
#include <fmtornt.hxx>
#include <fmtanchr.hxx>
@@ -79,6 +80,8 @@
#include <paratr.hxx>
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
+// <--
+#include <svx/fmmodel.hxx>
#include <switerator.hxx>
// ftnfrm.cxx:
@@ -267,7 +270,7 @@ SwFrmNotify::~SwFrmNotify()
bool bNotify = false;
bool bNotifySize = false;
SwAnchoredObject* pObj = rObjs[i];
- SwContact* pContact = ::GetUserCall( pObj->GetDrawObj() );
+ SwContact* pContact = ::findConnectionToSdrObject( pObj->GetDrawObj() );
// --> OD 2004-12-08 #115759#
const bool bAnchoredAsChar = pContact->ObjAnchoredAsChar();
if ( !bAnchoredAsChar )
@@ -286,11 +289,13 @@ SwFrmNotify::~SwFrmNotify()
// assure that to-fly anchored Writer fly frames are
// registered at the correct page frame, if frame
// position has changed.
- if ( bAbsP && pContact->ObjAnchoredAtFly() &&
- pObj->ISA(SwFlyFrm) )
+ if ( bAbsP && pContact->ObjAnchoredAtFly())
{
// determine to-fly anchored Writer fly frame
- SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
+ SwFlyFrm* pFlyFrm = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if( pFlyFrm )
+ {
// determine page frame of to-fly anchored
// Writer fly frame
SwPageFrm* pFlyPageFrm = pFlyFrm->FindPageFrm();
@@ -309,6 +314,7 @@ SwFrmNotify::~SwFrmNotify()
}
}
}
+ }
// otherwise the objects are notified in dependence to
// its positioning and alignment
else
@@ -347,9 +353,10 @@ SwFrmNotify::~SwFrmNotify()
// perform notification via the corresponding invalidations
if ( bNotify )
{
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFlyFrm = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if ( pFlyFrm )
{
- SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
if ( bNotifySize )
pFlyFrm->_InvalidateSize();
// --> OD 2004-12-08 #115759# - no invalidation of
@@ -361,7 +368,7 @@ SwFrmNotify::~SwFrmNotify()
// <--
pFlyFrm->_Invalidate();
}
- else if ( pObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pObj) )
{
// --> OD 2004-12-08 #115759# - no invalidation of
// position for as-character anchored objects.
@@ -416,7 +423,7 @@ SwFrmNotify::~SwFrmNotify()
// --> OD 2005-07-29 #i50668#, #i50998# - invalidation of position
// of as-character anchored fly frames not needed and can cause
// layout loops
- if ( !pFly->ISA(SwFlyInCntFrm) )
+ if ( !dynamic_cast< SwFlyInCntFrm* >(pFly) )
{
pFly->InvalidatePos();
}
@@ -733,7 +740,7 @@ SwFlyNotify::~SwFlyNotify()
// --> OD 2005-03-21 #i45180# - no adjustment of layout process flags and
// further notifications/invalidations, if format is called by grow/shrink
if ( pFly->ConsiderObjWrapInfluenceOnObjPos() &&
- ( !pFly->ISA(SwFlyFreeFrm) ||
+ ( !dynamic_cast< SwFlyFreeFrm* >(pFly) ||
!static_cast<SwFlyFreeFrm*>(pFly)->IsNoMoveOnCheckClip() ) )
// <--
{
@@ -897,7 +904,7 @@ SwCntntNotify::~SwCntntNotify()
SwFEShell *pFESh = 0;
ViewShell *pTmp = pSh;
do
- { if ( pTmp->ISA( SwCrsrShell ) )
+ { if ( dynamic_cast< SwCrsrShell* >(pTmp) )
{
pFESh = (SwFEShell*)pTmp;
// #108369#: Here used to be the condition if (!bFirst).
@@ -1073,14 +1080,14 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
}
if ( pSdrObj )
{
- if ( !pSdrObj->GetPage() )
+ if ( !pSdrObj->getSdrPageFromSdrObject() )
{
pFmt->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
- InsertObject(pSdrObj, pSdrObj->GetOrdNumDirect());
+ InsertObjectToSdrObjList(*pSdrObj, pSdrObj->GetNavigationPosition());
}
SwDrawContact* pNew =
- static_cast<SwDrawContact*>(GetUserCall( pSdrObj ));
+ static_cast<SwDrawContact*>(findConnectionToSdrObject( pSdrObj ));
if ( !pNew->GetAnchorFrm() )
{
pFrm->AppendDrawObj( *(pNew->GetAnchoredObj( 0L )) );
@@ -2261,13 +2268,12 @@ const SdrObject *SwOrderIter::Top()
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
- if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
+ if ( bFlysOnly && !dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
continue;
- sal_uInt32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetNavigationPosition();
if ( nTmp >= nTopOrd )
{
nTopOrd = nTmp;
@@ -2290,13 +2296,12 @@ const SdrObject *SwOrderIter::Bottom()
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
- if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
+ if ( bFlysOnly && !dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
continue;
- sal_uInt32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetNavigationPosition();
if ( nTmp < nBotOrd )
{
nBotOrd = nTmp;
@@ -2312,7 +2317,7 @@ const SdrObject *SwOrderIter::Bottom()
const SdrObject *SwOrderIter::Next()
{
- const sal_uInt32 nCurOrd = pCurrent ? pCurrent->GetOrdNumDirect() : 0;
+ const sal_uInt32 nCurOrd = pCurrent ? pCurrent->GetNavigationPosition() : 0;
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
@@ -2320,13 +2325,12 @@ const SdrObject *SwOrderIter::Next()
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
- if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
+ if ( bFlysOnly && !dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
continue;
- sal_uInt32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetNavigationPosition();
if ( nTmp > nCurOrd && nTmp < nOrd )
{
nOrd = nTmp;
@@ -2342,7 +2346,7 @@ const SdrObject *SwOrderIter::Next()
const SdrObject *SwOrderIter::Prev()
{
- const sal_uInt32 nCurOrd = pCurrent ? pCurrent->GetOrdNumDirect() : 0;
+ const sal_uInt32 nCurOrd = pCurrent ? pCurrent->GetNavigationPosition() : 0;
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
@@ -2350,13 +2354,12 @@ const SdrObject *SwOrderIter::Prev()
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
- if ( bFlysOnly && !pObj->ISA(SwVirtFlyDrawObj) )
+ if ( bFlysOnly && !dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
continue;
- sal_uInt32 nTmp = pObj->GetOrdNumDirect();
+ sal_uInt32 nTmp = pObj->GetNavigationPosition();
if ( nTmp < nCurOrd && nTmp >= nOrd )
{
nOrd = nTmp;
@@ -2401,10 +2404,10 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
// <--
// --> OD 2004-11-29 #115759# - remove also lower objects of as-character
// anchored Writer fly frames from page
- if ( pObj->ISA(SwFlyFrm) )
- {
- SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
+ SwFlyFrm* pFlyFrm = dynamic_cast< SwFlyFrm* >(pObj);
+ if ( pFlyFrm )
+ {
// --> OD 2004-11-29 #115759# - remove also direct lowers of Writer
// fly frame from page
if ( pFlyFrm->GetDrawObjs() )
@@ -2428,7 +2431,7 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
}
// <--
// --> OD 2004-11-29 #115759# - remove also drawing objects from page
- else if ( pObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pObj) )
{
if (pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_AS_CHAR)
{
@@ -2567,10 +2570,11 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
// <--
// --> OD 2004-11-29 #115759# - add also lower objects of as-character
// anchored Writer fly frames from page
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFlyFrm = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if ( pFlyFrm )
{
- SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
- if ( pObj->ISA(SwFlyFreeFrm) )
+ if ( dynamic_cast< SwFlyFreeFrm* >(pObj) )
{
_pPage->AppendFlyToPage( pFlyFrm );
}
@@ -2596,7 +2600,7 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
}
// <--
// --> OD 2004-11-29 #115759# - remove also drawing objects from page
- else if ( pObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pObj) )
{
if (pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_AS_CHAR)
{
@@ -2770,20 +2774,21 @@ void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
SwAnchoredObject* pObj = (*pObjs)[i];
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm *pSwFlyFrm = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if ( pSwFlyFrm )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pObj);
//Ggf. ummelden, nicht anmelden wenn bereits bekannt.
// --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
- SwPageFrm *pPg = pFly->IsFlyFreeFrm()
- ? pFly->GetPageFrm() : pFly->FindPageFrm();
+ SwPageFrm *pPg = pSwFlyFrm->IsFlyFreeFrm()
+ ? pSwFlyFrm->GetPageFrm() : pSwFlyFrm->FindPageFrm();
if ( pPg != pPage )
{
if ( pPg )
- pPg->RemoveFlyFromPage( pFly );
- pPage->AppendFlyToPage( pFly );
+ pPg->RemoveFlyFromPage( pSwFlyFrm );
+ pPage->AppendFlyToPage( pSwFlyFrm );
}
- ::RegistFlys( pPage, pFly );
+ ::RegistFlys( pPage, pSwFlyFrm );
}
else
{
@@ -2801,12 +2806,13 @@ void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
const SwFlyFrm* pFly = pAnch->FindFlyFrm();
if ( pFly &&
- pObj->GetDrawObj()->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() &&
- pObj->GetDrawObj()->GetPage() )
+ pObj->GetDrawObj()->GetNavigationPosition() < pFly->GetVirtDrawObj()->GetNavigationPosition() &&
+ pObj->GetDrawObj()->getSdrPageFromSdrObject() )
{
//#i119945# set pFly's OrdNum to pObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
- pObj->DrawObj()->GetPage()->SetObjectOrdNum( pFly->GetVirtDrawObj()->GetOrdNumDirect(),
- pObj->GetDrawObj()->GetOrdNumDirect() );
+ pObj->DrawObj()->getSdrPageFromSdrObject()->SetNavigationPosition(
+ pFly->GetVirtDrawObj()->GetNavigationPosition(),
+ pObj->GetDrawObj()->GetNavigationPosition() );
}
}
}
@@ -2961,9 +2967,10 @@ void MA_FASTCALL lcl_NotifyCntnt( const SdrObject *pThis, SwCntntFrm *pCnt,
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pObj);
if ( pFly->IsFlyInCntFrm() )
{
SwCntntFrm *pCntnt = pFly->ContainsCntnt();
@@ -2994,7 +3001,7 @@ void Notify_Background( const SdrObject* pObj,
SwLayoutFrm* pArea;
SwFlyFrm *pFlyFrm = 0;
SwFrm* pAnchor;
- if( pObj->ISA(SwVirtFlyDrawObj) )
+ if( dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
{
pFlyFrm = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
pAnchor = pFlyFrm->AnchorFrm();
@@ -3003,7 +3010,7 @@ void Notify_Background( const SdrObject* pObj,
{
pFlyFrm = NULL;
pAnchor = const_cast<SwFrm*>(
- GetUserCall(pObj)->GetAnchoredObj( pObj )->GetAnchorFrm() );
+ findConnectionToSdrObject(pObj)->GetAnchoredObj( pObj )->GetAnchorFrm() );
}
if( PREP_FLY_LEAVE != eHint && pAnchor->IsInFly() )
pArea = pAnchor->FindFlyFrm();
@@ -3040,13 +3047,7 @@ void Notify_Background( const SdrObject* pObj,
if ( pCnt->IsInTab() )
{
SwLayoutFrm* pCell = pCnt->GetUpper();
- // --> OD 2005-01-14 #i40606# - use <GetLastBoundRect()>
- // instead of <GetCurrentBoundRect()>, because a recalculation
- // of the bounding rectangle isn't intended here.
- if ( pCell->IsCellFrm() &&
- ( pCell->Frm().IsOver( pObj->GetLastBoundRect() ) ||
- pCell->Frm().IsOver( rRect ) ) )
- // <--
+ if ( pCell->IsCellFrm() && ( pCell->Frm().IsOver( sdr::legacy::GetBoundRect(*pObj) ) || pCell->Frm().IsOver( rRect ) ) )
{
const SwFmtVertOrient &rOri = pCell->GetFmt()->GetVertOrient();
if ( text::VertOrientation::NONE != rOri.GetVertOrient() )
@@ -3056,12 +3057,7 @@ void Notify_Background( const SdrObject* pObj,
if ( pTab != pLastTab )
{
pLastTab = pTab;
- // --> OD 2005-01-14 #i40606# - use <GetLastBoundRect()>
- // instead of <GetCurrentBoundRect()>, because a recalculation
- // of the bounding rectangle isn't intended here.
- if ( pTab->Frm().IsOver( pObj->GetLastBoundRect() ) ||
- pTab->Frm().IsOver( rRect ) )
- // <--
+ if ( pTab->Frm().IsOver( sdr::legacy::GetBoundRect(*pObj) ) || pTab->Frm().IsOver( rRect ) )
{
if ( !pFlyFrm || !pFlyFrm->IsLowerOf( pTab ) )
pTab->InvalidatePrt();
@@ -3086,12 +3082,11 @@ void Notify_Background( const SdrObject* pObj,
if ( pPage && pPage->GetSortedObjs() )
// <--
{
- pObj->GetOrdNum();
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
{
if( pAnchoredObj->GetDrawObj() == pObj )
continue;
@@ -3101,7 +3096,7 @@ void Notify_Background( const SdrObject* pObj,
if ( !pFlyFrm ||
(!pFly->IsLowerOf( pFlyFrm ) &&
- pFly->GetVirtDrawObj()->GetOrdNumDirect() < pObj->GetOrdNumDirect()))
+ pFly->GetVirtDrawObj()->GetNavigationPosition() < pObj->GetNavigationPosition()))
{
pCnt = pFly->ContainsCntnt();
while ( pCnt )
@@ -3127,8 +3122,8 @@ void Notify_Background( const SdrObject* pObj,
//gerade geaendert haben kann und eben deshalb
//umformatiert wurde.
else if ( pFly->IsFlyAtCntFrm() &&
- pObj->GetOrdNumDirect() <
- pFly->GetVirtDrawObj()->GetOrdNumDirect() &&
+ pObj->GetNavigationPosition() <
+ pFly->GetVirtDrawObj()->GetNavigationPosition() &&
pFlyFrm && !pFly->IsLowerOf( pFlyFrm ) )
{
const SwFmtHoriOrient &rH = pFly->GetFmt()->GetHoriOrient();
@@ -3201,7 +3196,7 @@ sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
{
Point aPos;
const SwFrm* pFrm;
- if( pObj->ISA(SwVirtFlyDrawObj) )
+ if( dynamic_cast< const SwVirtFlyDrawObj* >(pObj) )
{
const SwFlyFrm* pFly = ( (SwVirtFlyDrawObj*)pObj )->GetFlyFrm();
pFrm = pFly->GetAnchorFrm();
@@ -3209,8 +3204,11 @@ sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
}
else
{
- pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm(pObj);
- aPos = pObj->GetCurrentBoundRect().TopLeft();
+ // replace formally used 'GetUserCall()' by new notify/listener mechanism
+ const SwDrawContact* pContact = static_cast< const SwDrawContact* >(findConnectionToSdrObject(pObj));
+ pFrm = pContact ? pContact->GetAnchorFrm(pObj) : 0;
+ const basegfx::B2DPoint& rTopLeft = pObj->getSdrObjectTranslate();
+ aPos = Point(basegfx::fround(rTopLeft.getX()), basegfx::fround(rTopLeft.getY()));
}
ASSERT( pFrm, "8-( Fly is lost in Space." );
pFrm = GetVirtualUpper( pFrm, aPos );
@@ -3374,12 +3372,16 @@ void SwFrmHolder::Reset()
void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
+ {
+ if ( SFX_HINT_DYING == pSfxSimpleHint->GetId() && &rBC == pFrm )
{
- if ( ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DYING && &rBC == pFrm )
pFrm = 0;
}
}
+}
SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt16 const nFrmType,
const Point* pPoint, const SwPosition *pPos, const sal_Bool bCalcFrm )
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 16aba835642b..9556a9852d13 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -686,9 +686,10 @@ void DelFlys( SwLayoutFrm *pFrm, SwPageFrm *pPage )
i < (int)pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFlyFrm = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if ( pFlyFrm )
{
- SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
if ( pFrm->IsAnLower( pFlyFrm ) )
{
delete pFlyFrm;
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 84dc4841fcb9..575e2f9e6ecc 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -228,7 +228,7 @@ sal_Bool SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwCntntFrm *p
for ( i = 0; i < rObjs.Count() && aTmp.Count(); ++i )
{
SdrObject *pO = rObjs[i]->DrawObj();
- if ( !pO->ISA(SwVirtFlyDrawObj) )
+ if ( !dynamic_cast< SwVirtFlyDrawObj* >(pO) )
continue;
// OD 2004-01-15 #110582# - do not consider invisible objects
@@ -254,7 +254,7 @@ sal_Bool SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwCntntFrm *p
const SdrObject *pTmp = pSelfFly->GetVirtDrawObj();
if ( pO->GetLayer() == pTmp->GetLayer() )
{
- if ( pO->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
+ if ( pO->GetNavigationPosition() < pTmp->GetNavigationPosition() )
//Im gleichen Layer werden nur obenliegende beachtet.
continue;
}
@@ -1123,9 +1123,10 @@ static const SwFrm *lcl_FindFirstInvaCntnt( const SwLayoutFrm *pLay, long nBotto
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
const SwAnchoredObject* pObj = rObjs[i];
- if ( pObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pObj);
+
+ if ( pFly )
{
- const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pObj);
if ( pFly->IsFlyInCntFrm() )
{
if ( ((SwFlyInCntFrm*)pFly)->IsInvalid() ||
@@ -1159,9 +1160,10 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
for ( sal_uInt16 i = 0; i < _pPage->GetSortedObjs()->Count(); ++i )
{
const SwAnchoredObject* pObj = (*_pPage->GetSortedObjs())[i];
- if ( pObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pObj);
+
+ if ( pFly )
{
- const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pObj);
if ( pFly->Frm().Top() <= _nBottom )
{
if ( pFly->IsInvalid() || pFly->IsCompletePaint() )
@@ -1173,7 +1175,7 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
return pFly;
}
}
- else if ( pObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< const SwAnchoredDrawObject* >(pObj) )
{
if ( !static_cast<const SwAnchoredDrawObject*>(pObj)->IsValidPos() )
{
@@ -2177,7 +2179,7 @@ sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
if( STRING_LEN == nTxtPos )
{
--nTxtPos;
- if( pSh->ISA(SwCrsrShell) && !((SwCrsrShell*)pSh)->IsTableMode() )
+ if( dynamic_cast< SwCrsrShell* >(pSh) && !((SwCrsrShell*)pSh)->IsTableMode() )
{
SwPaM *pCrsr = ((SwCrsrShell*)pSh)->GetCrsr();
if( !pCrsr->HasMark() && pCrsr == pCrsr->GetNext() )
@@ -2238,9 +2240,10 @@ sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
- if ( pObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pObj);
if ( pFly->IsFlyInCntFrm() )
{
const SwCntntFrm *pC = pFly->ContainsCntnt();
@@ -2317,9 +2320,10 @@ sal_Bool SwLayIdle::DoIdleJob( IdleJobType eJob, sal_Bool bVisAreaOnly )
i < pPage->GetSortedObjs()->Count(); ++i )
{
const SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
- if ( pObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pObj);
+
+ if ( pFly )
{
- const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pObj);
const SwCntntFrm *pC = pFly->ContainsCntnt();
while( pC )
{
@@ -2431,7 +2435,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
do
{ ++pSh->nStartAction;
sal_Bool bVis = sal_False;
- if ( pSh->ISA(SwCrsrShell) )
+ if ( dynamic_cast< SwCrsrShell* >(pSh) )
{
#ifdef SW_CRSR_TIMER
((SwCrsrShell*)pSh)->ChgCrsrTimerFlag( sal_False );
@@ -2471,7 +2475,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
// aBools[ i ] is true, if the i-th shell is a cursor shell (!!!)
// and the cursor is visible.
bActions |= aTmp != pSh->VisArea();
- if ( aTmp == pSh->VisArea() && pSh->ISA(SwCrsrShell) )
+ if ( aTmp == pSh->VisArea() && dynamic_cast< SwCrsrShell* >(pSh) )
{
bActions |= aBools[nBoolIdx] !=
static_cast<SwCrsrShell*>(pSh)->GetCharRect().IsOver( pSh->VisArea() );
@@ -2489,10 +2493,10 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
nBoolIdx = 0;
do
{
- sal_Bool bCrsrShell = pSh->IsA( TYPE(SwCrsrShell) );
+ SwCrsrShell* pSwCrsrShell = dynamic_cast< SwCrsrShell* >(pSh);
- if ( bCrsrShell )
- ((SwCrsrShell*)pSh)->SttCrsrMove();
+ if ( pSwCrsrShell )
+ pSwCrsrShell->SttCrsrMove();
// else
// pSh->StartAction();
@@ -2511,24 +2515,24 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
bUnlock = sal_True;
}
- if ( bCrsrShell )
+ if ( pSwCrsrShell )
//Wenn der Crsr sichbar war wieder sichbar machen, sonst
//EndCrsrMove mit sal_True fuer IdleEnd.
- ((SwCrsrShell*)pSh)->EndCrsrMove( sal_True^aBools[nBoolIdx] );
+ pSwCrsrShell->EndCrsrMove( sal_True^aBools[nBoolIdx] );
// else
// pSh->EndAction();
if( bUnlock )
{
- if( bCrsrShell )
+ if( pSwCrsrShell )
{
// UnlockPaint overwrite the selection from the
// CrsrShell and calls the virtual method paint
// to fill the virtual device. This fill dont have
// paint the selection! -> Set the focus flag at
// CrsrShell and it dont paint the selection.
- ((SwCrsrShell*)pSh)->ShLooseFcs();
+ pSwCrsrShell->ShLooseFcs();
pSh->UnlockPaint( sal_True );
- ((SwCrsrShell*)pSh)->ShGetFcs( sal_False );
+ pSwCrsrShell->ShGetFcs( sal_False );
}
else
pSh->UnlockPaint( sal_True );
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 6f903bb168c5..b865bb634f55 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -307,17 +307,18 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
if( pFly->Frm().Left() != WEIT_WECH &&
!pFly->GetAnchorFrm()->FindFooterOrHeader() )
{
const SwContact *pC =
- ::GetUserCall(pAnchoredObj->GetDrawObj());
+ ::findConnectionToSdrObject(pAnchoredObj->GetDrawObj());
if( pC )
{
- sal_uInt32 nOrdNum = pAnchoredObj->GetDrawObj()->GetOrdNum();
+ sal_uInt32 nOrdNum = pAnchoredObj->GetDrawObj()->GetNavigationPosition();
sal_uInt16 nPageNum = pPage->GetPhyPageNum();
/* Open Fly Record */
aIo.OpenRec( SW_LAYCACHE_IO_REC_FLY );
@@ -997,7 +998,7 @@ struct SdrObjectCompare
{
bool operator()( const SdrObject* pF1, const SdrObject* pF2 ) const
{
- return pF1->GetOrdNum() < pF2->GetOrdNum();
+ return pF1->GetNavigationPosition() < pF2->GetNavigationPosition();
}
};
@@ -1041,16 +1042,16 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i ) // check objects
{
SdrObject *pO = rObjs[i];
- if ( pO->ISA(SwVirtFlyDrawObj) ) // a text frame?
+ SwFlyFrm *pFly = dynamic_cast< SwVirtFlyDrawObj* >(pO)->GetFlyFrm();
+ if ( pFly ) // a text frame?
{
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
if( pFly->Frm().Left() == WEIT_WECH && pFly->GetAnchor() &&
!pFly->GetAnchor()->FindFooterOrHeader() )
{ // Only frame with default position and not in header/footer
- const SwContact *pC = (SwContact*)GetUserCall(pO);
+ const SwContact *pC = (SwContact*)findConnectionToSdrObject(pO);
if( pC )
{
- sal_uLong nOrdNum = pO->GetOrdNum(); // the Id
+ sal_uLong nOrdNum = pO->GetNavigationPosition(); // the Id
SwFlyCache* pFlyC;
while( nFlyIdx < nFlyCount && ( pFlyC = pImpl->
GetFlyCache(nFlyIdx) )->nPageNum < nPgNum)
@@ -1106,13 +1107,14 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) ) // a text frame?
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly ) // a text frame?
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
if( pFly->GetAnchorFrm() &&
!pFly->GetAnchorFrm()->FindFooterOrHeader() )
{
- const SwContact *pC = ::GetUserCall( pAnchoredObj->GetDrawObj() );
+ const SwContact *pC = ::findConnectionToSdrObject( pAnchoredObj->GetDrawObj() );
if( pC )
{
aFlySet.insert( pAnchoredObj->GetDrawObj() );
@@ -1177,7 +1179,7 @@ sal_Bool SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
sal_uInt16 nPgNum = rpPage->GetPhyPageNum();
sal_uInt16 nIdx = 0;
sal_uInt16 nCnt = pCache->GetFlyCount();
- sal_uLong nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
+ sal_uLong nOrdNum = pFly->GetVirtDrawObj()->GetNavigationPosition();
SwFlyCache* pFlyC = 0;
// skip fly frames from pages before the current page
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index aecf27b073bf..3a0d5dd9454d 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -51,6 +51,7 @@
#include "IDocumentDrawModelAccess.hxx"
#include <hints.hxx>
#include <viewopt.hxx>
+#include <svx/fmmodel.hxx>
SwLayVout *SwRootFrm::pVout = 0;
sal_Bool SwRootFrm::bInPaint = sal_False;
@@ -354,9 +355,6 @@ SwRectFn fnRectVL2R = &aVerticalRightToLeft;
sal_uInt32 SwFrm::mnLastFrmId=0;
// <--
-TYPEINIT1(SwFrm,SwClient); //rtti fuer SwFrm
-TYPEINIT1(SwCntntFrm,SwFrm); //rtti fuer SwCntntFrm
-
void _FrmInit()
{
@@ -518,12 +516,8 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
if ( pMd )
{
- // Disable "multiple layout"
- pDrawPage = pMd->GetPage(0); //pMd->AllocPage( FALSE );
- //pMd->InsertPage( pDrawPage );
- // end of disabling
-
- pDrawPage->SetSize( Frm().SSize() );
+ pDrawPage = pMd->GetPage( 0 );
+ pDrawPage->SetPageScale( basegfx::B2DVector( Frm().SSize().Width(), Frm().SSize().Height() ) );
}
//Initialisierung des Layouts: Seiten erzeugen. Inhalt mit cntnt verbinden
@@ -641,8 +635,8 @@ void SwRootFrm::RemoveMasterObjs( SdrPage *pPg )
for( sal_uLong i = pPg ? pPg->GetObjCount() : 0; i; )
{
SdrObject* pObj = pPg->GetObj( --i );
- if( pObj->ISA(SwFlyDrawObj ) )
- pPg->RemoveObject( i );
+ if( dynamic_cast< SwFlyDrawObj* >(pObj) )
+ pPg->RemoveObjectFromSdrObjList( i );
}
}
diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx
index 871232ef5f18..1da505a4b797 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -287,7 +287,7 @@ void SwObjectFormatter::_FormatLayout( SwLayoutFrm& _rLayoutFrm )
*/
void SwObjectFormatter::_FormatObjCntnt( SwAnchoredObject& _rAnchoredObj )
{
- if ( !_rAnchoredObj.ISA(SwFlyFrm) )
+ if ( !dynamic_cast< SwFlyFrm* >(&_rAnchoredObj) )
{
// only Writer fly frames have content
return;
@@ -342,13 +342,14 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
mpPgNumAndTypeOfAnchors->Collect( _rAnchoredObj );
}
- if ( _rAnchoredObj.ISA(SwFlyFrm) )
+ SwFlyFrm* pFlyFrm = dynamic_cast< SwFlyFrm* >(&_rAnchoredObj);
+
+ if ( pFlyFrm )
{
- SwFlyFrm& rFlyFrm = static_cast<SwFlyFrm&>(_rAnchoredObj);
// --> OD 2004-11-15 #i34753# - reset flag, which prevents a positioning
- if ( rFlyFrm.IsFlyLayFrm() )
+ if ( pFlyFrm->IsFlyLayFrm() )
{
- static_cast<SwFlyLayFrm&>(rFlyFrm).SetNoMakePos( false );
+ static_cast<SwFlyLayFrm*>(pFlyFrm)->SetNoMakePos( false );
}
// <--
@@ -359,7 +360,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
do {
if ( mpLayAction )
{
- mpLayAction->FormatLayoutFly( &rFlyFrm );
+ mpLayAction->FormatLayoutFly( pFlyFrm );
// --> OD 2005-07-13 #124218# - consider, if the layout action
// has to be restarted due to a delete of a page frame.
if ( mpLayAction->IsAgain() )
@@ -370,24 +371,24 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
}
else
{
- _FormatLayout( rFlyFrm );
+ _FormatLayout( *pFlyFrm );
}
// --> OD 2004-11-15 #i34753# - prevent further positioning, if
// to-page|to-fly anchored Writer fly frame is already clipped.
- if ( rFlyFrm.IsFlyLayFrm() && rFlyFrm.IsClipped() )
+ if ( pFlyFrm->IsFlyLayFrm() && pFlyFrm->IsClipped() )
{
- static_cast<SwFlyLayFrm&>(rFlyFrm).SetNoMakePos( true );
+ static_cast<SwFlyLayFrm*>(pFlyFrm)->SetNoMakePos( true );
}
// <--
// --> OD 2004-11-02 #i23129#, #i36347# - pass correct page frame
// to the object formatter
- SwObjectFormatter::FormatObjsAtFrm( rFlyFrm,
- *(rFlyFrm.FindPageFrm()),
+ SwObjectFormatter::FormatObjsAtFrm( *pFlyFrm,
+ *(pFlyFrm->FindPageFrm()),
mpLayAction );
// <--
if ( mpLayAction )
{
- mpLayAction->_FormatFlyCntnt( &rFlyFrm );
+ mpLayAction->_FormatFlyCntnt( pFlyFrm );
// --> OD 2005-07-13 #124218# - consider, if the layout action
// has to be restarted due to a delete of a page frame.
if ( mpLayAction->IsAgain() )
@@ -398,7 +399,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
}
else
{
- _FormatObjCntnt( rFlyFrm );
+ _FormatObjCntnt( *pFlyFrm );
}
if ( ++nLoopControlRuns >= nLoopControlMax )
@@ -406,18 +407,18 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
#if OSL_DEBUG_LEVEL > 1
ASSERT( false, "LoopControl in SwObjectFormatter::_FormatObj: Stage 3!!!" );
#endif
- rFlyFrm.ValidateThisAndAllLowers( 2 );
+ pFlyFrm->ValidateThisAndAllLowers( 2 );
nLoopControlRuns = 0;
}
// --> OD 2006-02-02 #i57917#
// stop formatting of anchored object, if restart of layout process is requested.
- } while ( !rFlyFrm.IsValid() &&
+ } while ( !pFlyFrm->IsValid() &&
!_rAnchoredObj.RestartLayoutProcess() &&
- rFlyFrm.GetAnchorFrm() == &GetAnchorFrm() );
+ pFlyFrm->GetAnchorFrm() == &GetAnchorFrm() );
// <--
}
- else if ( _rAnchoredObj.ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(&_rAnchoredObj) )
{
_rAnchoredObj.MakeObjPos();
}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 96a90fd77203..dbdb0c7dd373 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -74,6 +74,7 @@
#include <sortedobjs.hxx>
#include <switerator.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -448,11 +449,11 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
if ( bSdrObj )
{
// OD 23.06.2003 #108784# - consider 'virtual' drawing objects
- SwDrawContact *pContact =
- static_cast<SwDrawContact*>(::GetUserCall(pSdrObj));
- if ( pSdrObj->ISA(SwDrawVirtObj) )
+ SwDrawContact *pContact = static_cast<SwDrawContact*>(::findConnectionToSdrObject(pSdrObj));
+ SwDrawVirtObj* pDrawVirtObj = dynamic_cast< SwDrawVirtObj* >(pSdrObj);
+
+ if ( pDrawVirtObj )
{
- SwDrawVirtObj* pDrawVirtObj = static_cast<SwDrawVirtObj*>(pSdrObj);
if ( pContact )
{
pDrawVirtObj->RemoveFromWriterLayout();
@@ -907,10 +908,10 @@ void SwPageFrm::Cut()
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
+ SwFlyAtCntFrm* pFly = dynamic_cast< SwFlyAtCntFrm* >(pAnchoredObj);
- if ( pAnchoredObj->ISA(SwFlyAtCntFrm) )
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyAtCntFrm*>(pAnchoredObj);
SwPageFrm *pAnchPage = pFly->GetAnchorFrm() ?
pFly->AnchorFrm()->FindPageFrm() : 0;
if ( pAnchPage && (pAnchPage != this) )
@@ -1022,9 +1023,10 @@ void lcl_PrepFlyInCntRegister( SwCntntFrm *pFrm )
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyInCntFrm) )
+ SwFlyInCntFrm* pFly = dynamic_cast< SwFlyInCntFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyInCntFrm*>(pAnchoredObj);
SwCntntFrm *pCnt = pFly->ContainsCntnt();
while ( pCnt )
{
@@ -1053,9 +1055,10 @@ void SwPageFrm::PrepareRegisterChg()
{
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
pFrm = pFly->ContainsCntnt();
while ( pFrm )
{
@@ -1842,7 +1845,7 @@ void SwRootFrm::ImplCalcBrowseWidth()
// --> OD 2004-06-29 #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
- const sal_Bool bFly = pAnchoredObj->ISA(SwFlyFrm);
+ const bool bFly(dynamic_cast< SwFlyFrm* >(pAnchoredObj));
if ((bFly && (WEIT_WECH == pAnchoredObj->GetObjRect().Width()))
|| rFmt.GetFrmSize().GetWidthPercent())
{
@@ -1886,7 +1889,7 @@ void SwRootFrm::ImplCalcBrowseWidth()
//weil sie keine Attribute haben, also durch ihre
//aktuelle Groesse bestimmt werden.
nWidth = pAnchoredObj->GetObjRect().Right() -
- pAnchoredObj->GetDrawObj()->GetAnchorPos().X();
+ basegfx::fround(pAnchoredObj->GetDrawObj()->GetAnchorPos().getX());
// <--
}
break;
@@ -1913,7 +1916,7 @@ void SwRootFrm::StartAllAction()
ViewShell *pSh = GetCurrShell();
if ( pSh )
do
- { if ( pSh->ISA( SwCrsrShell ) )
+ { if ( dynamic_cast< SwCrsrShell* >(pSh) )
((SwCrsrShell*)pSh)->StartAction();
else
pSh->StartAction();
@@ -1930,11 +1933,14 @@ void SwRootFrm::EndAllAction( sal_Bool bVirDev )
{
const sal_Bool bOldEndActionByVirDev = pSh->IsEndActionByVirDev();
pSh->SetEndActionByVirDev( bVirDev );
- if ( pSh->ISA( SwCrsrShell ) )
+ SwCrsrShell* pSwCrsrShell = dynamic_cast< SwCrsrShell* >(pSh);
+
+ if ( pSwCrsrShell )
{
- ((SwCrsrShell*)pSh)->EndAction();
- ((SwCrsrShell*)pSh)->CallChgLnk();
- if ( pSh->ISA( SwFEShell ) )
+ pSwCrsrShell->EndAction();
+ pSwCrsrShell->CallChgLnk();
+
+ if ( dynamic_cast< SwFEShell* >(pSh) )
((SwFEShell*)pSh)->SetChainMarker();
}
else
@@ -1957,8 +1963,8 @@ void SwRootFrm::UnoRemoveAllActions()
if ( !pSh->IsInEndAction() )
{
DBG_ASSERT(!pSh->GetRestoreActions(), "Restore action count is already set!");
- sal_Bool bCrsr = pSh->ISA( SwCrsrShell );
- sal_Bool bFE = pSh->ISA( SwFEShell );
+ const bool bCrsr(dynamic_cast< SwCrsrShell* >(pSh));
+ const bool bFE(dynamic_cast< SwFEShell* >(pSh));
sal_uInt16 nRestore = 0;
while( pSh->ActionCount() )
{
@@ -1991,7 +1997,7 @@ void SwRootFrm::UnoRestoreAllActions()
sal_uInt16 nActions = pSh->GetRestoreActions();
while( nActions-- )
{
- if ( pSh->ISA( SwCrsrShell ) )
+ if ( dynamic_cast< SwCrsrShell* >(pSh) )
((SwCrsrShell*)pSh)->StartAction();
else
pSh->StartAction();
@@ -2031,9 +2037,10 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
SwObjPositioningInProgress aPosInProgress( *pAnchoredObj );
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFlyFrm = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFlyFrm )
{
- SwFlyFrm* pFlyFrm( static_cast<SwFlyFrm*>(pAnchoredObj) );
lcl_MoveAllLowers( pFlyFrm, rOffset );
pFlyFrm->NotifyDrawObj();
// --> let the active embedded object be moved
@@ -2067,18 +2074,24 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
}
// <--
}
- else if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
+ else
{
- SwAnchoredDrawObject* pAnchoredDrawObj( static_cast<SwAnchoredDrawObject*>(pAnchoredObj) );
+ SwAnchoredDrawObject* pAnchoredDrawObj = dynamic_cast< SwAnchoredDrawObject* >(pAnchoredObj);
+ if ( pAnchoredDrawObj )
+ {
// don't touch objects that are not yet positioned:
const bool bNotYetPositioned = pAnchoredDrawObj->NotYetPositioned();
if ( bNotYetPositioned )
continue;
- const Point aCurrAnchorPos = pAnchoredDrawObj->GetDrawObj()->GetAnchorPos();
- const Point aNewAnchorPos( ( aCurrAnchorPos + rOffset ) );
- pAnchoredDrawObj->DrawObj()->SetAnchorPos( aNewAnchorPos );
+ // #i108739#
+ {
+ sdr::legacy::transformSdrObject(*pAnchoredDrawObj->DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(rOffset.X(), rOffset.Y()));
+ pAnchoredDrawObj->DrawObj()->SetAnchorPos(
+ pAnchoredDrawObj->GetDrawObj()->GetAnchorPos() + basegfx::B2DTuple( rOffset.X(), rOffset.Y() ));
+ }
+
pAnchoredDrawObj->SetLastObjRect( pAnchoredDrawObj->GetObjRect().SVRect() );
// clear contour cache if contour wrapping is enabled #i100684#
@@ -2091,6 +2104,7 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
// <--
}
}
+}
void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset )
{
@@ -2114,7 +2128,7 @@ void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset )
lcl_MoveAllLowerObjs( pFrm, rOffset );
// finally, for layout frames we have to call this function recursively:
- if ( pFrm->ISA(SwLayoutFrm) )
+ if ( dynamic_cast< SwLayoutFrm* >(pFrm) )
{
SwFrm* pLowerFrm = pFrm->GetLower();
while ( pLowerFrm )
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index fa36609a3272..33be8ae9e98e 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -42,6 +42,7 @@
#include <svx/svdpagv.hxx>
#include <hintids.hxx>
#include <tgrditem.hxx>
+#include <svx/svdlegacy.hxx>
#include <switerator.hxx>
#include <fmtsrnd.hxx>
#include <fmtclds.hxx>
@@ -99,6 +100,9 @@
#define COL_NOTES_SIDEPANE_BORDER RGB_COLORDATA(200,200,200)
#define COL_NOTES_SIDEPANE_SCROLLAREA RGB_COLORDATA(230,230,220)
+#include <vcl/svapp.hxx>
+#include <svx/fmmodel.hxx>
+
using namespace ::com::sun::star;
#define GETOBJSHELL() ((SfxObjectShell*)rSh.GetDoc()->GetDocShell())
@@ -1317,7 +1321,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
if ( !pPage->GetFmt()->GetDoc()->IsVisibleLayerId( pSdrObj->GetLayer() ) )
continue;
- if ( !pAnchoredObj->ISA(SwFlyFrm) )
+ if ( !dynamic_cast< const SwFlyFrm* >(pAnchoredObj) )
continue;
const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
@@ -1351,7 +1355,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
if ( pSelfFly && bLowerOfSelf )
{
ASSERT( pFly->IsFlyInCntFrm() ||
- pSdrObj->GetOrdNumDirect() > pSelfFly->GetVirtDrawObj()->GetOrdNumDirect(),
+ pSdrObj->GetNavigationPosition() > pSelfFly->GetVirtDrawObj()->GetNavigationPosition(),
"Fly with wrong z-Order" );
}
#endif
@@ -1362,7 +1366,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
const SdrObject *pTmp = pSelfFly->GetVirtDrawObj();
if ( pSdrObj->GetLayer() == pTmp->GetLayer() )
{
- if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
+ if ( pSdrObj->GetNavigationPosition() < pTmp->GetNavigationPosition() )
//Im gleichen Layer werden nur obenliegende beachtet.
continue;
}
@@ -1380,7 +1384,7 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
const SdrObject *pTmp = pRetoucheFly->GetVirtDrawObj();
if ( pSdrObj->GetLayer() == pTmp->GetLayer() )
{
- if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
+ if ( pSdrObj->GetNavigationPosition() < pTmp->GetNavigationPosition() )
//Im gleichen Layer werden nur obenliegende beachtet.
continue;
}
@@ -3003,7 +3007,12 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
{
SdrPaintView* pPaintView = pSh->Imp()->GetDrawView();
SdrPageView* pPageView = pPaintView->GetSdrPageView();
- pPageView->DrawPageViewGrid(*pSh->GetOut(), aPaintRect.SVRect(), SwViewOption::GetTextGridColor() );
+
+ if(pPageView)
+ {
+ const Rectangle aOldRect(aPaintRect.SVRect());
+ pPageView->DrawPageViewGrid(*pSh->GetOut(), basegfx::B2DRange(aOldRect.Left(), aOldRect.Top(), aOldRect.Right(), aOldRect.Bottom()), SwViewOption::GetTextGridColor());
+ }
}
// #i68597#
@@ -3403,14 +3412,13 @@ sal_Bool SwFlyFrm::IsShadowTransparent() const
sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
{
- SdrObjUserCall *pUserCall;
+ SwContact *pSwContact;
- if ( 0 == ( pUserCall = GetUserCall(pObj) ) )
+ if ( 0 == ( pSwContact = findConnectionToSdrObject(pObj) ) )
return sal_True;
//Attributabhaengig nicht fuer Drucker oder PreView painten
- sal_Bool bPaint = pFlyOnlyDraw ||
- ((SwContact*)pUserCall)->GetFmt()->GetPrint().GetValue();
+ sal_Bool bPaint = pFlyOnlyDraw || pSwContact->GetFmt()->GetPrint().GetValue();
if ( !bPaint )
bPaint = pSh->GetWin() && !pSh->IsPreView();
@@ -3419,12 +3427,12 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
//Das Paint kann evtl. von von uebergeordneten Flys verhindert werden.
SwFrm *pAnch = 0;
// --> OD #i117962#
- if ( pObj->ISA(SwFlyDrawObj) )
+ if ( dynamic_cast< SwFlyDrawObj* >(pObj) )
{
bPaint = false;
}
// <--
- else if ( pObj->ISA(SwVirtFlyDrawObj) )
+ else if ( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
if ( pFlyOnlyDraw && pFlyOnlyDraw == pFly )
@@ -3456,7 +3464,7 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
{
// OD 13.10.2003 #i19919# - consider 'virtual' drawing objects
// OD 2004-03-29 #i26791#
- pAnch = ((SwDrawContact*)pUserCall)->GetAnchorFrm( pObj );
+ pAnch = ((SwDrawContact*)pSwContact)->GetAnchorFrm( pObj );
if ( pAnch )
{
if ( !pAnch->GetValidPosFlag() )
@@ -3471,14 +3479,14 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
//Position her gerade schweben.
const SwPageFrm *pPage = pAnch->FindPageFrm();
if ( !bTableHack &&
- !pPage->Frm().IsOver( pObj->GetCurrentBoundRect() ) )
+ !pPage->Frm().IsOver( sdr::legacy::GetBoundRect(*pObj) ) )
pAnch = 0;
}
}
else
{
// OD 02.07.2003 #108784# - debug assert
- if ( !pObj->ISA(SdrObjGroup) )
+ if ( !dynamic_cast< SdrObjGroup* >(pObj) )
{
ASSERT( false, "<SwFlyFrm::IsPaint(..)> - paint of drawing object without anchor frame!?" );
}
@@ -5992,7 +6000,7 @@ void SwLayoutFrm::RefreshLaySubsidiary( const SwPageFrm *pPage,
const SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pPage->GetFmt()->GetDoc()->IsVisibleLayerId(
pAnchoredObj->GetDrawObj()->GetLayer() ) &&
- pAnchoredObj->ISA(SwFlyFrm) )
+ dynamic_cast< const SwFlyFrm* >(pAnchoredObj) )
{
const SwFlyFrm *pFly =
static_cast<const SwFlyFrm*>(pAnchoredObj);
@@ -6068,7 +6076,7 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
aIter.Current( pMyFly->GetVirtDrawObj() );
while ( 0 != (pMyFly = pMyFly->GetAnchorFrm()->FindFlyFrm()) )
{
- if ( aIter()->GetOrdNum() > pMyFly->GetVirtDrawObj()->GetOrdNum() )
+ if ( aIter()->GetNavigationPosition() > pMyFly->GetVirtDrawObj()->GetNavigationPosition() )
aIter.Current( pMyFly->GetVirtDrawObj() );
}
}
@@ -6100,9 +6108,9 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
}
//Sitzt das Obj auf der Linie
- const Rectangle &rBound = pObj->GetCurrentBoundRect();
- const Point aDrPt( rBound.TopLeft() );
- const Size aDrSz( rBound.GetSize() );
+ const Rectangle aBound = sdr::legacy::GetBoundRect(*pObj);
+ const Point aDrPt( aBound.TopLeft() );
+ const Size aDrSz( aBound.GetSize() );
if ( rP1.*pOthPt >= aDrPt.*pOthPt &&
rP1.*pOthPt <= (aDrPt.*pOthPt + aDrSz.*pOthSz) )
{
@@ -6318,9 +6326,10 @@ void SwPageFrm::RefreshExtraData( const SwRect &rRect ) const
for ( sal_uInt16 i = 0; i < GetSortedObjs()->Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
if ( pFly->Frm().Top() <= aRect.Bottom() &&
pFly->Frm().Bottom() >= aRect.Top() )
pFly->RefreshExtraData( aRect );
@@ -6353,9 +6362,10 @@ void SwLayoutFrm::RefreshExtraData( const SwRect &rRect ) const
for ( sal_uInt32 i = 0; i < pCnt->GetDrawObjs()->Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = (*pCnt->GetDrawObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
if ( pFly->IsFlyInCntFrm() &&
pFly->Frm().Top() <= rRect.Bottom() &&
pFly->Frm().Bottom() >= rRect.Top() )
@@ -6770,11 +6780,10 @@ Graphic SwDrawFrmFmt::MakeGraphic( ImageMap* )
if ( pMod )
{
SdrObject *pObj = FindSdrObject();
- SdrView *pView = new SdrView( pMod );
- SdrPageView *pPgView = pView->ShowSdrPage(pView->GetModel()->GetPage(0));
- pView->MarkObj( pObj, pPgView );
+ SdrView *pView = new SdrView( *pMod );
+ pView->ShowSdrPage(*pView->getSdrModelFromSdrView().GetPage(0));
+ pView->MarkObj( *pObj );
aRet = pView->GetMarkedObjBitmapEx();
- pView->HideSdrPage();
delete pView;
}
return aRet;
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 341b20f6b033..0308dc6b7cdc 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -846,7 +846,7 @@ const SwSectionFmt* SwSectionFrm::_GetEndSectFmt() const
const SwSectionFmt *pFmt = pSection->GetFmt();
while( !pFmt->GetEndAtTxtEnd().IsAtEnd() )
{
- if( pFmt->GetRegisteredIn()->ISA( SwSectionFmt ) )
+ if( dynamic_cast< const SwSectionFmt* >(pFmt->GetRegisteredIn()) )
pFmt = (SwSectionFmt*)pFmt->GetRegisteredIn();
else
return NULL;
@@ -2379,7 +2379,7 @@ sal_Bool SwSectionFrm::IsDescendantFrom( const SwSectionFmt* pFmt ) const
const SwSectionFmt *pMyFmt = pSection->GetFmt();
while( pFmt != pMyFmt )
{
- if( pMyFmt->GetRegisteredIn()->ISA( SwSectionFmt ) )
+ if( dynamic_cast< const SwSectionFmt* >(pMyFmt->GetRegisteredIn()) )
pMyFmt = (SwSectionFmt*)pMyFmt->GetRegisteredIn();
else
return sal_False;
@@ -2396,7 +2396,7 @@ void SwSectionFrm::CalcFtnAtEndFlag()
FTNEND_ATTXTEND_OWNNUMANDFMT == nVal;
while( !bFtnAtEnd && !bOwnFtnNum )
{
- if( pFmt->GetRegisteredIn()->ISA( SwSectionFmt ) )
+ if( dynamic_cast< const SwSectionFmt * >(pFmt->GetRegisteredIn()) )
pFmt = (SwSectionFmt*)pFmt->GetRegisteredIn();
else
break;
@@ -2421,7 +2421,7 @@ void SwSectionFrm::CalcEndAtEndFlag()
bEndnAtEnd = pFmt->GetEndAtTxtEnd( sal_False ).IsAtEnd();
while( !bEndnAtEnd )
{
- if( pFmt->GetRegisteredIn()->ISA( SwSectionFmt ) )
+ if( dynamic_cast< const SwSectionFmt* >(pFmt->GetRegisteredIn()) )
pFmt = (SwSectionFmt*)pFmt->GetRegisteredIn();
else
break;
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 56e97919312c..ce6251ac2a8d 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -291,8 +291,10 @@ void SwFrm::CheckDirChange()
for ( sal_uInt32 i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
- if( pAnchoredObj->ISA(SwFlyFrm) )
+ if( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
+ {
static_cast<SwFlyFrm*>(pAnchoredObj)->CheckDirChange();
+ }
else
{
// OD 2004-04-06 #i26791# - direct object
@@ -383,13 +385,15 @@ SwFrm::~SwFrm()
for ( sal_uInt32 i = pDrawObjs->Count(); i; )
{
SwAnchoredObject* pAnchoredObj = (*pDrawObjs)[--i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
+ {
delete pAnchoredObj;
+ }
else
{
SdrObject* pSdrObj = pAnchoredObj->DrawObj();
SwDrawContact* pContact =
- static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
+ static_cast<SwDrawContact*>(findConnectionToSdrObjectDirect(pSdrObj));
ASSERT( pContact,
"<SwFrm::~SwFrm> - missing contact for drawing object" );
if ( pContact )
@@ -453,8 +457,8 @@ SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt, SwFrm* pSib ) :
|*************************************************************************/
SwCntntFrm::~SwCntntFrm()
{
- SwCntntNode* pCNd;
- if( 0 != ( pCNd = PTR_CAST( SwCntntNode, GetRegisteredIn() )) &&
+ const SwCntntNode* pCNd;
+ if( 0 != ( pCNd = dynamic_cast< const SwCntntNode* >(GetRegisteredIn())) &&
!pCNd->GetDoc()->IsInDtor() )
{
//Bei der Root abmelden wenn ich dort noch im Turbo stehe.
@@ -577,13 +581,15 @@ SwLayoutFrm::~SwLayoutFrm()
nCnt = pFrm->GetDrawObjs()->Count();
// --> OD 2004-06-30 #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[0];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
+ {
delete pAnchoredObj;
+ }
else
{
SdrObject* pSdrObj = pAnchoredObj->DrawObj();
SwDrawContact* pContact =
- static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
+ static_cast<SwDrawContact*>(findConnectionToSdrObjectDirect(pSdrObj));
ASSERT( pContact,
"<SwFrm::~SwFrm> - missing contact for drawing object" );
if ( pContact )
@@ -610,13 +616,15 @@ SwLayoutFrm::~SwLayoutFrm()
// --> OD 2004-06-30 #i28701#
SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[0];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
+ {
delete pAnchoredObj;
+ }
else
{
SdrObject* pSdrObj = pAnchoredObj->DrawObj();
SwDrawContact* pContact =
- static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
+ static_cast<SwDrawContact*>(findConnectionToSdrObjectDirect(pSdrObj));
ASSERT( pContact,
"<SwFrm::~SwFrm> - missing contact for drawing object" );
if ( pContact )
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 615b4f7c0208..7ffd245f41bd 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -69,6 +69,8 @@
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
#include <layouter.hxx>
+// <--
+#include <svx/svdlegacy.hxx>
#include <switerator.hxx>
extern void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
@@ -309,6 +311,8 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
pAnchoredObj->UnlockPosition();
pAnchoredObj->InvalidateObjPos();
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
// move anchored object 'out of range'
if ( _bMoveObjsOutOfRange )
{
@@ -330,18 +334,15 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
&(pAnchoredObj->GetFrmFmt()) );
}
// <--
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
- pFly->GetVirtDrawObj()->SetRectsDirty();
pFly->GetVirtDrawObj()->SetChanged();
}
}
// If anchored object is a fly frame, invalidate its lower objects
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
::lcl_InvalidateLowerObjs( *pFly, _bMoveObjsOutOfRange, _pPageFrm );
}
}
@@ -2794,9 +2795,10 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
for ( sal_uInt16 i = 0; i < pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pPage->GetSortedObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
const SwRect aFlyRect = pFly->GetObjRectWithSpaces();
// --> OD 2004-10-07 #i26945# - correction of conditions,
// if Writer fly frame has to be considered:
@@ -5003,10 +5005,11 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
default: break;
}
}
- if ( pAnchoredObj->ISA(SwFlyFrm) )
- {
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
+ {
// OD 2004-05-18 #i28701# - no direct move of objects,
// which are anchored to-paragraph/to-character, if
// the wrapping style influence has to be considered
@@ -5022,7 +5025,6 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
{
(pFly->Frm().*fnRect->fnSubTop)( -lDiff );
(pFly->Frm().*fnRect->fnAddBottom)( lDiff );
- pFly->GetVirtDrawObj()->SetRectsDirty();
// --> OD 2004-08-17 - also notify view of <SdrObject>
// instance, which represents the Writer fly frame in
// the drawing layer
@@ -5094,7 +5096,7 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
pFly->SetCompletePaint();
}
}
- else if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pAnchoredObj) )
{
// --> OD 2004-11-05 #i26945#
const SwTabFrm* pTabFrm = pLay->FindTabFrm();
@@ -5131,11 +5133,11 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
SwObjPositioningInProgress aObjPosInProgress( *pAnchoredObj );
if ( bVert )
{
- pAnchoredObj->DrawObj()->Move( Size( lDiff, 0 ) );
+ sdr::legacy::transformSdrObject(*pAnchoredObj->DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(lDiff, 0.0));
}
else
{
- pAnchoredObj->DrawObj()->Move( Size( 0, lDiff ) );
+ sdr::legacy::transformSdrObject(*pAnchoredObj->DrawObj(), basegfx::tools::createTranslateB2DHomMatrix(0.0, lDiff));
}
// --> OD 2006-10-13 #i58280#
pAnchoredObj->InvalidateObjRectWithSpaces();
@@ -5380,10 +5382,10 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
if ( SURROUND_THROUGHT != rSur.GetSurround() )
{
// frames, which the cell is a lower of, aren't relevant
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- const SwFlyFrm *pFly =
- static_cast<const SwFlyFrm*>(pAnchoredObj);
if ( pFly->IsAnLower( this ) )
continue;
}
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index b768315d07d3..9a59a3d0c01a 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -255,9 +255,11 @@ bool SwPageFrm::FillSelection( SwSelectionList& rList, const SwRect& rRect ) con
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = rObjs[i];
- if( !pAnchoredObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pAnchoredObj);
+
+ if( !pFly )
continue;
- const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
+
if( pFly->FillSelection( rList, rRect ) )
bRet = true;
}
@@ -2600,9 +2602,11 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( !pAnchoredObj->ISA(SwFlyFrm) )
+ const SwFlyFrm* pFly = dynamic_cast< const SwFlyFrm* >(pAnchoredObj);
+
+ if ( !pFly )
continue;
- const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
+
const SwVirtFlyDrawObj* pObj = pFly->GetVirtDrawObj();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
if ( !pFly->IsAnLower( pStartFrm ) &&
@@ -2613,14 +2617,14 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
continue;
sal_Bool bSub = sal_True;
- const sal_uInt32 nPos = pObj->GetOrdNum();
+ const sal_uInt32 nPos = pObj->GetNavigationPosition();
for ( sal_uInt16 k = 0; bSub && k < aSortObjs.Count(); ++k )
{
- ASSERT( aSortObjs[k]->ISA(SwFlyFrm),
+ ASSERT( dynamic_cast< SwFlyFrm* >(aSortObjs[k]),
"<SwRootFrm::CalcFrmRects(..)> - object in <aSortObjs> of unexcepted type" );
const SwFlyFrm* pTmp = static_cast<SwFlyFrm*>(aSortObjs[k]);
do
- { if ( nPos < pTmp->GetVirtDrawObj()->GetOrdNumDirect() )
+ { if ( nPos < pTmp->GetVirtDrawObj()->GetNavigationPosition() )
bSub = sal_False;
else
pTmp = pTmp->GetAnchorFrm()->FindFlyFrm();
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 8a022ec27a96..6ba2cce31cc6 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -1676,9 +1676,10 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
ASSERT( !pFly->IsFlyInCntFrm(), "FlyInCnt at Page?" );
const SwFmtVertOrient &rVert =
pFly->GetFmt()->GetVertOrient();
@@ -1859,7 +1860,7 @@ void SwFrm::ValidateThisAndAllLowers( const sal_uInt16 nStage )
const bool bOnlyObject = 1 == nStage;
const bool bIncludeObjects = 1 <= nStage;
- if ( !bOnlyObject || ISA(SwFlyFrm) )
+ if ( !bOnlyObject || dynamic_cast< SwFlyFrm* >(this) )
{
bValidSize = sal_True;
bValidPrtArea = sal_True;
@@ -1875,9 +1876,9 @@ void SwFrm::ValidateThisAndAllLowers( const sal_uInt16 nStage )
for ( sal_uInt32 i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchObj = (*pObjs)[i];
- if ( pAnchObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchObj) )
static_cast<SwFlyFrm*>(pAnchObj)->ValidateThisAndAllLowers( 2 );
- else if ( pAnchObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pAnchObj) )
static_cast<SwAnchoredDrawObject*>(pAnchObj)->ValidateThis();
}
}
@@ -2382,9 +2383,6 @@ SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt, SwFrm* pSib ):
bFixSize = sal_True;
}
-// --> OD 2004-06-29 #i28701#
-TYPEINIT1(SwLayoutFrm,SwFrm);
-// <--
/*-----------------10.06.99 09:42-------------------
* SwLayoutFrm::InnerHeight()
* --------------------------------------------------*/
@@ -3288,9 +3286,10 @@ static void InvaPercentFlys( SwFrm *pFrm, SwTwips nDiff )
for ( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
const SwFmtFrmSize &rSz = pFly->GetFmt()->GetFrmSize();
if ( rSz.GetWidthPercent() || rSz.GetHeightPercent() )
{
@@ -3427,9 +3426,10 @@ sal_Bool lcl_IsFlyHeightClipped( SwLayoutFrm *pLay )
for ( sal_uInt16 i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
if ( pFly->IsHeightClipped() &&
( !pFly->IsFlyFreeFrm() || pFly->GetPageFrm() ) )
return sal_True;
@@ -3932,9 +3932,10 @@ void lcl_InvalidateAllCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm *pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
if ( pFly->IsFlyInCntFrm() )
{
::lcl_InvalidateCntnt( pFly->ContainsCntnt(), nInv );
@@ -3964,9 +3965,10 @@ void SwRootFrm::InvalidateAllCntnt( sal_uInt8 nInv )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
::lcl_InvalidateCntnt( pFly->ContainsCntnt(), nInv );
if ( nInv & INV_DIRECTION )
pFly->CheckDirChange();
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 6eba4436e944..5ef4f9f4ca61 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -67,10 +67,11 @@ SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj )
#if OSL_DEBUG_LEVEL > 1
// assert, if object isn't of excepted type
const bool bObjOfExceptedType =
- mrDrawObj.ISA(SwVirtFlyDrawObj) || // object representing fly frame
- mrDrawObj.ISA(SwDrawVirtObj) || // 'virtual' drawing object
- ( !mrDrawObj.ISA(SdrVirtObj) && // 'master' drawing object
- !mrDrawObj.ISA(SwFlyDrawObj) ); // - indirectly checked
+ dynamic_cast< SwVirtFlyDrawObj* >(&mrDrawObj) || // object representing fly frame
+ dynamic_cast< SwDrawVirtObj* >(&mrDrawObj) || // 'virtual' drawing object
+ ( !dynamic_cast< SwVirtFlyDrawObj* >(&mrDrawObj) && // 'master' drawing object
+ !dynamic_cast< SwDrawVirtObj* >(&mrDrawObj) &&
+ !dynamic_cast< SwFlyDrawObj* >(&mrDrawObj) ); // - indirectly checked
(void) bObjOfExceptedType;
ASSERT( bObjOfExceptedType,
"SwAnchoredObjectPosition(..) - object of unexcepted type!" );
@@ -91,12 +92,12 @@ void SwAnchoredObjectPosition::_GetInfoAboutObj()
{
// determine, if object represents a fly frame
{
- mbIsObjFly = mrDrawObj.ISA(SwVirtFlyDrawObj);
+ mbIsObjFly = dynamic_cast< SwVirtFlyDrawObj* >(&mrDrawObj);
}
// determine contact object
{
- mpContact = static_cast<SwContact*>(GetUserCall( &mrDrawObj ));
+ mpContact = static_cast<SwContact*>(findConnectionToSdrObject( &mrDrawObj ));
ASSERT( mpContact,
"SwAnchoredObjectPosition::_GetInfoAboutObj() - missing SwContact-object." );
}
@@ -901,7 +902,7 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX(
// it is horizontal positioned left or right, but not relative to character,
// it has to be drawn aside another object, which have the same horizontal
// position and lay below it.
- if ( GetAnchoredObj().ISA(SwFlyFrm) &&
+ if ( dynamic_cast< SwFlyFrm* >(&GetAnchoredObj()) &&
( GetContact().ObjAnchoredAtPara() || GetContact().ObjAnchoredAtChar() ) &&
( eHoriOrient == text::HoriOrientation::LEFT || eHoriOrient == text::HoriOrientation::RIGHT ) &&
eRelOrient != text::RelOrientation::CHAR )
@@ -940,8 +941,8 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(
) const
{
// OD 2004-03-23 #i26791#
- if ( !GetAnchorFrm().ISA(SwTxtFrm) ||
- !GetAnchoredObj().ISA(SwFlyAtCntFrm) )
+ if ( !dynamic_cast< SwTxtFrm* >(&GetAnchorFrm()) ||
+ !dynamic_cast< SwFlyAtCntFrm* >(&GetAnchoredObj()) )
{
ASSERT( false,
"<SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(..) - usage for wrong anchor type" );
@@ -971,13 +972,13 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(
}
SwRect aTmpObjRect( aTmpPos, aObjBoundRect.SSize() );
- const sal_uInt32 nObjOrdNum = GetObject().GetOrdNum();
+ const sal_uInt32 nObjOrdNum = GetObject().GetNavigationPosition();
const SwPageFrm* pObjPage = rFlyAtCntFrm.FindPageFrm();
const SwFrm* pObjContext = ::FindKontext( &rAnchorTxtFrm, FRM_COLUMN );
sal_uLong nObjIndex = rAnchorTxtFrm.GetTxtNode()->GetIndex();
SwOrderIter aIter( pObjPage, sal_True );
const SwFlyFrm* pFly = ((SwVirtFlyDrawObj*)aIter.Bottom())->GetFlyFrm();
- while ( pFly && nObjOrdNum > pFly->GetVirtDrawObj()->GetOrdNumDirect() )
+ while ( pFly && nObjOrdNum > pFly->GetVirtDrawObj()->GetNavigationPosition() )
{
if ( _DrawAsideFly( pFly, aTmpObjRect, pObjContext, nObjIndex,
_bEvenPage, _eHoriOrient, _eRelOrient ) )
diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
index caf1d0a77744..d3db49472f86 100644
--- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
@@ -38,7 +38,7 @@
#include <fmtornt.hxx>
#include <com/sun/star/text/HoriOrientation.hpp>
-
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
using namespace objectpositioning;
@@ -81,7 +81,7 @@ SwAsCharAnchoredObjectPosition::~SwAsCharAnchoredObjectPosition()
*/
const SwTxtFrm& SwAsCharAnchoredObjectPosition::GetAnchorTxtFrm() const
{
- ASSERT( GetAnchorFrm().ISA(SwTxtFrm),
+ ASSERT( dynamic_cast< SwTxtFrm* >(&GetAnchorFrm()),
"SwAsCharAnchoredObjectPosition::GetAnchorTxtFrm() - wrong anchor frame type" );
return static_cast<const SwTxtFrm&>(GetAnchorFrm());
@@ -160,7 +160,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
// left difference is only considered, if requested.
if( !IsObjFly() )
{
- SwRect aSnapRect = GetObject().GetSnapRect();
+ SwRect aSnapRect( sdr::legacy::GetSnapRect(GetObject()) );
if ( rAnchorFrm.IsVertical() )
{
rAnchorFrm.SwitchVerticalToHorizontal( aSnapRect );
@@ -253,11 +253,18 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
// set proposed anchor position at the drawing object.
// OD 2004-04-06 #i26791# - distinction between 'master' drawing
// object and 'virtual' drawing object no longer needed.
- GetObject().SetAnchorPos( aAbsAnchorPos );
+
+ // #i108739#
+ {
+ const basegfx::B2DPoint aTempAnchorPos(GetObject().GetAnchorPos());
+ const basegfx::B2DPoint aB2DAbsAnchorPos(aAbsAnchorPos.X(), aAbsAnchorPos.Y());
+ sdr::legacy::transformSdrObject(GetObject(), basegfx::tools::createTranslateB2DHomMatrix(aB2DAbsAnchorPos - aTempAnchorPos));
+ GetObject().SetAnchorPos(aB2DAbsAnchorPos);
+ }
// move drawing object to set its correct relative position.
{
- SwRect aSnapRect = GetObject().GetSnapRect();
+ SwRect aSnapRect( sdr::legacy::GetSnapRect(GetObject()) );
if ( rAnchorFrm.IsVertical() )
rAnchorFrm.SwitchVerticalToHorizontal( aSnapRect );
@@ -272,7 +279,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
// OD 2004-04-06 #i26791# - distinction between 'master' drawing
// object and 'virtual' drawing object no longer needed.
- GetObject().Move( Size( aDiff.X(), aDiff.Y() ) );
+ sdr::legacy::transformSdrObject(GetObject(), basegfx::tools::createTranslateB2DHomMatrix(aDiff.X(), aDiff.Y()));
}
}
@@ -286,7 +293,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
rAnchorFrm.SwitchHorizontalToVertical( aAnchorPos );
// --> OD 2005-03-09 #i44347# - keep last object rectangle at anchored object
- ASSERT ( GetAnchoredObj().ISA(SwAnchoredDrawObject),
+ ASSERT ( dynamic_cast< SwAnchoredDrawObject* >(&GetAnchoredObj()),
"<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong type of anchored object." );
SwAnchoredDrawObject& rAnchoredDrawObj =
static_cast<SwAnchoredDrawObject&>( GetAnchoredObj() );
@@ -314,7 +321,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
aRelAttr = Point( 0, nRelPos );
// OD 2004-03-23 #i26791#
- ASSERT( GetAnchoredObj().ISA(SwFlyInCntFrm),
+ ASSERT( dynamic_cast< SwFlyInCntFrm* >(&GetAnchoredObj()),
"<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong anchored object." );
const SwFlyInCntFrm& rFlyInCntFrm =
static_cast<const SwFlyInCntFrm&>(GetAnchoredObj());
diff --git a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
index b91b18c0a1ad..8d27019644f3 100644
--- a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
+++ b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
@@ -70,7 +70,7 @@ const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(
}
}
- ASSERT( pHoriEnvironmentLayFrm->ISA(SwLayoutFrm),
+ ASSERT( dynamic_cast< const SwLayoutFrm* >(pHoriEnvironmentLayFrm),
"SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(..) - found frame isn't a layout frame" );
return static_cast<const SwLayoutFrm&>(*pHoriEnvironmentLayFrm);
@@ -110,7 +110,7 @@ const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(
}
}
- ASSERT( pVertEnvironmentLayFrm->ISA(SwLayoutFrm),
+ ASSERT( dynamic_cast< const SwLayoutFrm* >(pVertEnvironmentLayFrm),
"SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(..) - found frame isn't a layout frame" );
return static_cast<const SwLayoutFrm&>(*pVertEnvironmentLayFrm);
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index c3538449c2e7..9af5120e5bfb 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -92,7 +92,7 @@ SwTwips SwToCntntAnchoredObjectPosition::ToCharTopOfLine() const
SwTxtFrm& SwToCntntAnchoredObjectPosition::GetAnchorTxtFrm() const
{
- ASSERT( GetAnchorFrm().ISA(SwTxtFrm),
+ ASSERT( dynamic_cast< SwTxtFrm* >(&GetAnchorFrm()),
"SwToCntntAnchoredObjectPosition::GetAnchorTxtFrm() - wrong anchor frame type" );
return static_cast<SwTxtFrm&>(GetAnchorFrm());
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index 5b8c9d6cb48f..d8669b353bb3 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -50,18 +50,13 @@
using namespace ::com::sun::star;
-TYPEINIT2_AUTOFACTORY( SwFmtDrop, SfxPoolItem, SwClient);
-TYPEINIT1_AUTOFACTORY( SwRegisterItem, SfxBoolItem);
-TYPEINIT1_AUTOFACTORY( SwNumRuleItem, SfxStringItem);
-TYPEINIT1_AUTOFACTORY( SwParaConnectBorderItem, SfxBoolItem);
-
/*************************************************************************
|* Beschreibung Methoden von SwFmtDrop
|* Ersterstellung MS 19.02.91
|* Letzte Aenderung JP 08.08.94
*************************************************************************/
-
+IMPL_POOLITEM_FACTORY(SwFmtDrop)
SwFmtDrop::SwFmtDrop()
: SfxPoolItem( RES_PARATR_DROP ),
@@ -113,7 +108,7 @@ void SwFmtDrop::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
if( pDefinedIn )
{
- if( !pDefinedIn->ISA( SwFmt ))
+ if( !dynamic_cast< SwFmt* >(pDefinedIn))
pDefinedIn->ModifyNotification( this, this );
else if( pDefinedIn->GetDepends() &&
!pDefinedIn->IsModifyLocked() )
diff --git a/sw/source/core/sw3io/swacorr.cxx b/sw/source/core/sw3io/swacorr.cxx
index 625b7b37f5fd..1a4ee42afd92 100644
--- a/sw/source/core/sw3io/swacorr.cxx
+++ b/sw/source/core/sw3io/swacorr.cxx
@@ -41,9 +41,6 @@
using namespace ::com::sun::star;
-TYPEINIT1( SwAutoCorrect, SvxAutoCorrect );
-
-
// - return den Ersetzungstext (nur fuer SWG-Format, alle anderen
// koennen aus der Wortliste herausgeholt werden!)
// rShort ist der Stream-Name - gecryptet!
@@ -68,7 +65,7 @@ sal_Bool SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& r
sal_Bool SwAutoCorrect::PutText( const uno::Reference < embed::XStorage >& rStg, const String& rFileName, const String& rShort,
SfxObjectShell& rObjSh, String& rLong )
{
- if( !rObjSh.IsA( TYPE(SwDocShell) ) )
+ if( !dynamic_cast< SwDocShell* >(&rObjSh) )
return sal_False;
SwDocShell& rDShell = (SwDocShell&)rObjSh;
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 295a342d9c36..b6e1feb2caa1 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -76,13 +76,6 @@
using namespace com::sun::star;
-TYPEINIT1( SwTable, SwClient );
-TYPEINIT1( SwTableBox, SwClient );
-TYPEINIT1( SwTableLine, SwClient );
-TYPEINIT1( SwTableFmt, SwFrmFmt );
-TYPEINIT1( SwTableBoxFmt, SwFrmFmt );
-TYPEINIT1( SwTableLineFmt, SwFrmFmt );
-
SV_IMPL_PTRARR(SwTableLines,SwTableLine*);
SV_IMPL_PTRARR(SwTableBoxes,SwTableBox*);
SV_IMPL_PTRARR_SORT(SwTableSortBoxes,SwTableBoxPtr);
@@ -456,7 +449,7 @@ void lcl_RefreshHidden( SwTabCols &rToFill, sal_uInt16 nPos )
void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
const SwFrmFmt *pTabFmt, const sal_Bool bHidden,
- const FASTBOOL bRefreshHidden )
+ const bool bRefreshHidden )
{
const long nWish = pTabFmt->GetFrmSize().GetWidth();
const long nAct = rToFill.GetRight() - rToFill.GetLeft(); // +1 why?
@@ -559,7 +552,7 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
}
void lcl_ProcessBoxGet( const SwTableBox *pBox, SwTabCols &rToFill,
- const SwFrmFmt *pTabFmt, FASTBOOL bRefreshHidden )
+ const SwFrmFmt *pTabFmt, bool bRefreshHidden )
{
if ( pBox->GetTabLines().Count() )
{
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index a86d8bb74979..8dc03a482042 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -279,8 +279,7 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo,
mpFrmInfo( pFrmInfo ),
mpPorInfo( pPorInfo )
{
- mpPDFExtOutDevData =
- PTR_CAST( vcl::PDFExtOutDevData, rOut.GetExtOutDevData() );
+ mpPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >( rOut.GetExtOutDevData() );
if ( mpPDFExtOutDevData && mpPDFExtOutDevData->GetIsExportTaggedPDF() )
{
@@ -1494,7 +1493,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
*/
bool SwTaggedPDFHelper::IsExportTaggedPDF( const OutputDevice& rOut )
{
- vcl::PDFExtOutDevData* pPDFExtOutDevData = PTR_CAST( vcl::PDFExtOutDevData, rOut.GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >( rOut.GetExtOutDevData() );
return pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportTaggedPDF();
}
@@ -1548,8 +1547,7 @@ SwEnhancedPDFExportHelper::~SwEnhancedPDFExportHelper()
*/
void SwEnhancedPDFExportHelper::EnhancedPDFExport()
{
- vcl::PDFExtOutDevData* pPDFExtOutDevData =
- PTR_CAST( vcl::PDFExtOutDevData, mrOut.GetExtOutDevData() );
+ vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >( mrOut.GetExtOutDevData() );
if ( !pPDFExtOutDevData )
return;
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 241f53629ee4..0de6585c476e 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -58,6 +58,7 @@
#include <breakit.hxx>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/ScriptType.hdl>
+#include <svx/svdlegacy.hxx>
#include <editeng/lrspitem.hxx>
#include <switerator.hxx>
@@ -509,7 +510,7 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs )
{
const SdrObject* pSObj = rpNd->FindSdrObject();
if( pSObj )
- nMin = pSObj->GetCurrentBoundRect().GetWidth();
+ nMin = sdr::legacy::GetBoundRect(*pSObj).GetWidth();
else
nMin = 0;
@@ -728,7 +729,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
{
const SdrObject* pSObj = pFrmFmt->FindSdrObject();
if( pSObj )
- nAktWidth = pSObj->GetCurrentBoundRect().GetWidth();
+ nAktWidth = sdr::legacy::GetBoundRect(*pSObj).GetWidth();
else
nAktWidth = 0;
}
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 5c5e6eb93ea6..ef9d193ac64d 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1870,7 +1870,7 @@ bool SwTxtFrm::FillSelection( SwSelectionList& rSelList, const SwRect& rRect ) c
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = rObjs[i];
- if( !pAnchoredObj->ISA(SwFlyFrm) )
+ if( !dynamic_cast< const SwFlyFrm* >(pAnchoredObj) )
continue;
const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
if( pFly->IsFlyInCntFrm() && pFly->FillSelection( rSelList, rRect ) )
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 54809d1cefe0..a22fd77e1aaf 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -177,12 +177,12 @@ void SwTxtFrm::MoveFlyInCnt( SwTxtFrm *pNew, xub_StrLen nStart, xub_StrLen nEnd
xub_StrLen nIdx = pPos->nContent.GetIndex();
if ( nIdx >= nStart && nEnd > nIdx )
{
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ if ( dynamic_cast< SwFlyFrm* >(pAnchoredObj) )
{
RemoveFly( static_cast<SwFlyFrm*>(pAnchoredObj) );
pNew->AppendFly( static_cast<SwFlyFrm*>(pAnchoredObj) );
}
- else if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
+ else if ( dynamic_cast< SwAnchoredDrawObject* >(pAnchoredObj) )
{
RemoveDrawObj( *pAnchoredObj );
pNew->AppendDrawObj( *pAnchoredObj );
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 8b421bbcd260..2c4e317aecb4 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -75,6 +75,8 @@
#include <editeng/ulspitem.hxx>
#include <editeng/lspcitem.hxx>
#include <svx/svdoedge.hxx>
+#include <drawinglayer/processor2d/contourextractor2d.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
#include "doc.hxx"
#ifdef DBG_UTIL
@@ -949,7 +951,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
sal_Bool bOpaque = sal_False;
// --> OD 2006-08-15 #i68520#
const sal_uInt32 nCurrOrd = mpCurrAnchoredObj
- ? mpCurrAnchoredObj->GetDrawObj()->GetOrdNum()
+ ? mpCurrAnchoredObj->GetDrawObj()->GetNavigationPosition()
: SAL_MAX_UINT32;
// <--
ASSERT( !bTopRule, "DrawTextOpaque: Wrong TopRule" );
@@ -992,7 +994,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
) &&
// --> OD 2006-08-15 #i68520#
pTmpAnchoredObj->GetDrawObj()->GetLayer() != nHellId &&
- nCurrOrd < pTmpAnchoredObj->GetDrawObj()->GetOrdNum()
+ nCurrOrd < pTmpAnchoredObj->GetDrawObj()->GetNavigationPosition()
// <--
)
{
@@ -1141,10 +1143,11 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
const SdrObject* pNew = _pAnchoredObj->GetDrawObj();
// <--
// #102344# Ignore connectors which have one or more connections
- if(pNew && pNew->ISA(SdrEdgeObj))
+ const SdrEdgeObj* pSdrEdgeObj = dynamic_cast< const SdrEdgeObj* >(pNew);
+
+ if(pSdrEdgeObj)
{
- if(((SdrEdgeObj*)pNew)->GetConnectedNode(sal_True)
- || ((SdrEdgeObj*)pNew)->GetConnectedNode(sal_False))
+ if(pSdrEdgeObj->GetConnectedNode(true) || pSdrEdgeObj->GetConnectedNode(false))
{
return sal_False;
}
@@ -1250,7 +1253,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// ausgewichen und ausserdem braucht nur bei Ueberlappung
// ausgewichen werden.
// --> OD 2006-08-15 #i68520#
- bEvade &= ( mpCurrAnchoredObj->GetDrawObj()->GetOrdNum() < pNew->GetOrdNum() );
+ bEvade &= ( mpCurrAnchoredObj->GetDrawObj()->GetNavigationPosition() < pNew->GetNavigationPosition() );
// <--
if( bEvade )
{
@@ -1721,7 +1724,7 @@ const SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj
SwRect aRet;
const SwFrmFmt* pFmt = &(pAnchoredObj->GetFrmFmt());
if( pFmt->GetSurround().IsContour() &&
- ( !pAnchoredObj->ISA(SwFlyFrm) ||
+ ( !dynamic_cast< const SwFlyFrm* >(pAnchoredObj) ||
( static_cast<const SwFlyFrm*>(pAnchoredObj)->Lower() &&
static_cast<const SwFlyFrm*>(pAnchoredObj)->Lower()->IsNoTxtFrm() ) ) )
{
@@ -1763,27 +1766,56 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
}
::basegfx::B2DPolyPolygon aPolyPolygon;
::basegfx::B2DPolyPolygon* pPolyPolygon = 0L;
+ const SwVirtFlyDrawObj* pSwVirtFlyDrawObj = dynamic_cast< const SwVirtFlyDrawObj* >(pObj);
- if ( pObj->ISA(SwVirtFlyDrawObj) )
+ if ( pSwVirtFlyDrawObj )
{
// Vorsicht #37347: Das GetContour() fuehrt zum Laden der Grafik,
// diese aendert dadurch ggf. ihre Groesse, ruft deshalb ein
// ClrObject() auf.
PolyPolygon aPoly;
- if( !((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetContour( aPoly ) )
- aPoly = PolyPolygon( ((SwVirtFlyDrawObj*)pObj)->
- GetFlyFrm()->Frm().SVRect() );
+ if( !pSwVirtFlyDrawObj->GetFlyFrm()->GetContour( aPoly ) )
+ aPoly = PolyPolygon( pSwVirtFlyDrawObj->GetFlyFrm()->Frm().SVRect() );
aPolyPolygon.clear();
aPolyPolygon.append(aPoly.getB2DPolyPolygon());
}
else
{
- if( !pObj->ISA( E3dObject ) )
+ if( !dynamic_cast< const E3dObject* >(pObj) )
{
aPolyPolygon = pObj->TakeXorPoly();
}
- ::basegfx::B2DPolyPolygon aContourPoly(pObj->TakeContour());
+ // get primitive sequence
+ ::basegfx::B2DPolyPolygon aContourPoly;
+ const sdr::contact::ViewContact& rVC(pObj->GetViewContact());
+ const drawinglayer::primitive2d::Primitive2DSequence xSequence(rVC.getViewIndependentPrimitive2DSequence());
+
+ if(xSequence.hasElements())
+ {
+ // use neutral ViewInformation
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+
+ // create extractor, process and get result
+ ::drawinglayer::processor2d::ContourExtractor2D aExtractor(aViewInformation2D, false);
+ aExtractor.process(xSequence);
+ const std::vector< basegfx::B2DPolyPolygon >& rResult(aExtractor.getExtractedContour());
+ const sal_uInt32 nSize(rResult.size());
+
+ // when count is one, it is implied that the object has only it's normal
+ // contour anyways and TakeCountour() is to return an empty PolyPolygon
+ // (see old implementation for historical reasons)
+ if(nSize > 1)
+ {
+ // the topology for contour is correctly a vector of PolyPolygons; for
+ // historical reasons cut it back to a single PolyPolygon here
+ for(sal_uInt32 a(0); a < nSize; a++)
+ {
+ aContourPoly.append(rResult[a]);
+ }
+ }
+ }
+
pPolyPolygon = new ::basegfx::B2DPolyPolygon(aContourPoly);
}
const SvxLRSpaceItem &rLRSpace = pFmt->GetLRSpace();
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 8e5dd6637d75..a58fceebc55f 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -86,9 +86,6 @@
extern const sal_Char *GetPrepName( const enum PrepareHint ePrep );
#endif
-
-TYPEINIT1( SwTxtFrm, SwCntntFrm );
-
// Switches width and height of the text frame
void SwTxtFrm::SwapWidthAndHeight()
{
@@ -586,7 +583,7 @@ void SwTxtFrm::HideAndShowObjects()
for ( sal_uInt32 i = 0; i < GetDrawObjs()->Count(); ++i )
{
SdrObject* pObj = (*GetDrawObjs())[i]->DrawObj();
- SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
+ SwContact* pContact = findConnectionToSdrObjectDirect(pObj);
// --> OD 2005-03-30 #120729# - hotfix: do not hide object
// under certain conditions
const RndStdIds eAnchorType( pContact->GetAnchorId() );
@@ -615,7 +612,7 @@ void SwTxtFrm::HideAndShowObjects()
for ( sal_uInt32 i = 0; i < GetDrawObjs()->Count(); ++i )
{
SdrObject* pObj = (*GetDrawObjs())[i]->DrawObj();
- SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
+ SwContact* pContact = findConnectionToSdrObjectDirect(pObj);
// --> OD 2005-03-30 #120729# - determine anchor type only once
const RndStdIds eAnchorType( pContact->GetAnchorId() );
// <--
@@ -1216,9 +1213,10 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
for ( int i = 0; GetDrawObjs() && i < int(pObjs->Count()); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pObjs)[MSHORT(i)];
- if ( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if ( pFly )
{
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
if( !pFly->IsFlyInCntFrm() )
{
const SvxBrushItem &rBack =
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index c8de1d50eef7..f5efb7d57460 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -263,7 +263,7 @@ SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower )
SwAnchoredObject* pAnchoredObj = rObjs[i];
SwRect aRect( pAnchoredObj->GetObjRect() );
- if ( !pAnchoredObj->ISA(SwFlyFrm) ||
+ if ( !dynamic_cast< SwFlyFrm* >(pAnchoredObj) ||
static_cast<SwFlyFrm*>(pAnchoredObj)->IsValid() )
{
const SwTwips nBottom = (aRect.*fnRect->fnGetBottom)();
diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx
index 232d4d5754b1..d7430808330d 100644
--- a/sw/source/core/text/txtio.cxx
+++ b/sw/source/core/text/txtio.cxx
@@ -170,14 +170,15 @@ void lcl_OutFrame( SvFileStream& rStr, const SwFrm* pFrm, ByteString& rSp, sal_B
// --> OD 2004-07-07 #i28701# - consider changed type of
// <SwSortedObjs> entries
SwAnchoredObject* pAnchoredObj = (*pSorted)[ i ];
- if( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
lcl_OutFrame( rStr, pFly, rSp, sal_False );
}
else
{
- aTmp = pAnchoredObj->GetDrawObj()->IsUnoObj() ? "UNO" : "Drw";
+ aTmp = pAnchoredObj->GetDrawObj()->IsSdrUnoObj() ? "UNO" : "Drw";
rStr << aTmp;
}
// <--
@@ -196,14 +197,15 @@ void lcl_OutFrame( SvFileStream& rStr, const SwFrm* pFrm, ByteString& rSp, sal_B
// --> OD 2004-07-07 #i28701# - consider changed type of
// <SwSortedObjs> entries
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[ i ];
- if( pAnchoredObj->ISA(SwFlyFrm) )
+ SwFlyFrm* pFly = dynamic_cast< SwFlyFrm* >(pAnchoredObj);
+
+ if( pFly )
{
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
lcl_OutFrame( rStr, pFly, rSp, sal_False );
}
else
{
- aTmp = pAnchoredObj->GetDrawObj()->IsUnoObj() ? "UNO" : "Drw";
+ aTmp = pAnchoredObj->GetDrawObj()->IsSdrUnoObj() ? "UNO" : "Drw";
rStr << aTmp;
}
if( i < nCnt - 1 )
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 48bebd582361..abd205963c99 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -68,8 +68,6 @@ sal_uInt8 SwForm::nFormAuthLen = 5;
SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*)
-TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti
-
struct PatternIni
{
sal_uInt16 n1;
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index dcaf7fecc434..75823ee0ad27 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -42,9 +42,6 @@
#include <fieldhint.hxx>
#include <svl/smplhint.hxx>
-TYPEINIT3( SwFmtFld, SfxPoolItem, SwClient,SfxBroadcaster)
-TYPEINIT1(SwFmtFldHint, SfxHint);
-
/****************************************************************************
*
* class SwFmtFld
diff --git a/sw/source/core/txtnode/chrfmt.cxx b/sw/source/core/txtnode/chrfmt.cxx
index 7480d360873b..e0e68b0ca282 100644
--- a/sw/source/core/txtnode/chrfmt.cxx
+++ b/sw/source/core/txtnode/chrfmt.cxx
@@ -26,9 +26,3 @@
#include <charfmt.hxx>
-
-
-TYPEINIT1( SwCharFmt, SwFmt ); //rtti fuer SwCharFmt
-
-
-
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 273fe5330b0f..7da3ce9e1159 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -60,9 +60,6 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-TYPEINIT1_AUTOFACTORY(SwFmtINetFmt, SfxPoolItem);
-TYPEINIT1_AUTOFACTORY(SwFmtAutoFmt, SfxPoolItem);
-
/*************************************************************************
|*
|* class SwFmtCharFmt
@@ -192,6 +189,7 @@ sal_Bool SwFmtAutoFmt::PutValue( const uno::Any& , sal_uInt8 )
|* Letzte Aenderung AMA 02.08.96
|*
*************************************************************************/
+IMPL_POOLITEM_FACTORY(SwFmtINetFmt)
SwFmtINetFmt::SwFmtINetFmt()
: SfxPoolItem( RES_TXTATR_INETFMT ),
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 129facb7eae6..a7b02ac6f8ff 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -96,9 +96,6 @@ using namespace ::com::sun::star;
SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 )
-
-TYPEINIT1( SwTxtNode, SwCntntNode )
-
SV_DECL_PTRARR(SwpHts,SwTxtAttr*,1,1)
// Leider ist das SwpHints nicht ganz wasserdicht:
@@ -3721,8 +3718,7 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewVal
SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
{
ASSERT( pNewColl,"ChgFmtColl: Collectionpointer ist 0." );
- ASSERT( HAS_BASE( SwTxtFmtColl, pNewColl ),
- "ChgFmtColl: ist kein Text-Collectionpointer." );
+ ASSERT( dynamic_cast< SwTxtFmtColl* >( pNewColl ), "ChgFmtColl: ist kein Text-Collectionpointer." );
SwTxtFmtColl *pOldColl = GetTxtColl();
if( pNewColl != pOldColl )
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 04cb58a5c4d2..6c8af1bbd604 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -41,10 +41,6 @@
#include <fmtmeta.hxx>
-TYPEINIT1(SwTxtINetFmt,SwClient);
-TYPEINIT1(SwTxtRuby,SwClient);
-
-
/*************************************************************************
* class SwTxtCharFmt
*************************************************************************/
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index 669709413ee5..c67b44c1bdd8 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -23,9 +23,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <tools/rtti.hxx>
-
#include <SwUndoField.hxx>
#include <swundo.hxx>
#include <doc.hxx>
diff --git a/sw/source/core/undo/SwUndoTOXChange.cxx b/sw/source/core/undo/SwUndoTOXChange.cxx
index 35ee16b4b80c..88dbf60b96a1 100644
--- a/sw/source/core/undo/SwUndoTOXChange.cxx
+++ b/sw/source/core/undo/SwUndoTOXChange.cxx
@@ -39,9 +39,10 @@ SwUndoTOXChange::~SwUndoTOXChange()
void SwUndoTOXChange::UpdateTOXBaseSection()
{
- if (pTOX->ISA(SwTOXBaseSection))
+ SwTOXBaseSection* pTOXBase = dynamic_cast< SwTOXBaseSection * >(pTOX);
+
+ if (pTOXBase)
{
- SwTOXBaseSection * pTOXBase = static_cast<SwTOXBaseSection *>(pTOX);
pTOXBase->Update();
pTOXBase->UpdatePageNum();
}
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index f2731fb3b3d9..9f21a7fdf1cf 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -25,13 +25,9 @@
#include "precompiled_sw.hxx"
#include <UndoManager.hxx>
-
#include <unotools/undoopt.hxx>
-
#include <vcl/wrkwin.hxx>
-
#include <svx/svdmodel.hxx>
-
#include <swmodule.hxx>
#include <doc.hxx>
#include <ndarr.hxx>
@@ -41,6 +37,7 @@
#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <undo.hrc>
+#include <svx/fmmodel.hxx>
#include <editsh.hxx>
#include <unobaseclass.hxx>
#include <limits>
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index f2f94437487e..c277432fb06b 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1491,12 +1491,12 @@ void SwRegHistory::_MakeSetWhichIds()
if( GetRegisteredIn() )
{
const SfxItemSet* pSet = 0;
- if( GetRegisteredIn()->ISA( SwCntntNode ) )
+ if( dynamic_cast< const SwCntntNode* >(GetRegisteredIn()) )
{
pSet = static_cast<SwCntntNode*>(
const_cast<SwModify*>(GetRegisteredIn()))->GetpSwAttrSet();
}
- else if ( GetRegisteredIn()->ISA( SwFmt ) )
+ else if ( dynamic_cast< const SwFmt* >(GetRegisteredIn()) )
{
pSet = &static_cast<SwFmt*>(
const_cast<SwModify*>(GetRegisteredIn()))->GetAttrSet();
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index f66e46ccc630..a72c536b65be 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -62,9 +62,10 @@
#include <redline.hxx>
#include <section.hxx>
#include <charfmt.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
#include <switerator.hxx>
-
// -----------------------------------------------------
SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt )
@@ -239,7 +240,7 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext)
if ( RES_FLYFRMFMT == m_nFmtWhich || RES_DRAWFRMFMT == m_nFmtWhich )
{
- rContext.SetSelections(static_cast<SwFrmFmt*>(m_pFmt), 0);
+ rContext.SetSelections(static_cast<SwFrmFmt*>(m_pFmt));
}
}
}
@@ -430,17 +431,12 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
{
if ( RES_DRAWFRMFMT == m_pFmt->Which() )
{
- Point aPt( static_cast<SwFrmFmt*>(m_pFmt)->FindSdrObject()
- ->GetRelativePos() );
+ const SdrObject* pSdrObject = static_cast<SwFrmFmt*>(m_pFmt)->FindSdrObject();
+ const Point aPt(sdr::legacy::GetSnapRect(*pSdrObject).TopLeft() - sdr::legacy::GetAnchorPos(*pSdrObject));
// store old value as attribute, to keep SwUndoFmtAttr small
m_pOldSet->Put( SwFmtFrmSize( ATT_VAR_SIZE, aPt.X(), aPt.Y() ) );
}
-/* else
- {
- pOldSet->Put( pFmt->GetVertOrient() );
- pOldSet->Put( pFmt->GetHoriOrient() );
}
-*/ }
const SwFmtAnchor& rAnchor =
static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, sal_False ) );
@@ -524,7 +520,8 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
m_pOldSet->ClearItem( RES_FRM_SIZE );
// den akt. wieder zwischenspeichern
- aDrawOldPt = pFrmFmt->FindSdrObject()->GetRelativePos();
+ const SdrObject* pSdrObject = pFrmFmt->FindSdrObject();
+ aDrawOldPt = sdr::legacy::GetSnapRect(*pSdrObject).TopLeft() - sdr::legacy::GetAnchorPos(*pSdrObject);
//JP 08.10.97: ist laut AMA/MA nicht mehr noetig
// pCont->DisconnectFromLayout();
}
@@ -589,12 +586,20 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
// pCont->ConnectToLayout();
SdrObject* pObj = pCont->GetMaster();
- if( pCont->GetAnchorFrm() && !pObj->IsInserted() )
+ if( pCont->GetAnchorFrm() && !pObj->IsObjectInserted() )
{
ASSERT( pDoc->GetDrawModel(), "RestoreFlyAnchor without DrawModel" );
- pDoc->GetDrawModel()->GetPage( 0 )->InsertObject( pObj );
+ pDoc->GetDrawModel()->GetPage(0)->InsertObjectToSdrObjList(*pObj);
+ }
+
+ // #i108739#
+ {
+ const Point aTopLeft(sdr::legacy::GetSnapRect(*pObj).TopLeft());
+ const Point aAnchorPos(sdr::legacy::GetAnchorPos(*pObj));
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(
+ aDrawSavePt.X() - aTopLeft.X() + aAnchorPos.X(),
+ aDrawSavePt.Y() - aTopLeft.Y() + aAnchorPos.Y()));
}
- pObj->SetRelativePos( aDrawSavePt );
// den alten Wert wieder zwischenspeichern.
m_pOldSet->Put(
@@ -614,7 +619,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
if( RES_DRAWFRMFMT != pFrmFmt->Which() )
pFrmFmt->MakeFrms();
- rContext.SetSelections(pFrmFmt, 0);
+ rContext.SetSelections(pFrmFmt);
// --> OD 2004-10-26 #i35443# - anchor attribute restored.
return true;
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 74ed6497084b..63605e28b36f 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -130,7 +130,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
if( bShowSelFrm )
{
- rContext.SetSelections(pFrmFmt, 0);
+ rContext.SetSelections(pFrmFmt);
}
if( GetHistory() )
@@ -346,7 +346,7 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true );
(void) pFlyFmt;
//FIXME nobody ever did anything with this selection:
-// rContext.SetSelections(pFlyFmt, 0);
+// rContext.SetSelections(pFlyFmt);
}
// #111827#
@@ -622,7 +622,7 @@ void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext)
pFrmFmt->MakeFrms();
}
- rContext.SetSelections(pFrmFmt, 0);
+ rContext.SetSelections(pFrmFmt);
}
}
@@ -645,7 +645,7 @@ void SwUndoSetFlyFmt::RedoImpl(::sw::UndoRedoContext & rContext)
else
rDoc.SetFrmFmtToFly( *pFrmFmt, *pNewFmt, 0 );
- rContext.SetSelections(pFrmFmt, 0);
+ rContext.SetSelections(pFrmFmt);
}
}
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 7af2639d9181..8d541528c528 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -33,8 +33,6 @@
#include <svx/svdogrp.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdpage.hxx>
-#include <svx/svdmark.hxx>
-
#include <hintids.hxx>
#include <hints.hxx>
#include <fmtanchr.hxx>
@@ -76,43 +74,43 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
if (GetIDocumentUndoRedo().DoesUndo() &&
GetIDocumentUndoRedo().DoesDrawUndo())
{
- const SdrMarkList* pMarkList = 0;
+ SdrObjectVector aSelection;
ViewShell* pSh = GetCurrentViewShell();
if( pSh && pSh->HasDrawView() )
- pMarkList = &pSh->GetDrawView()->GetMarkedObjectList();
+ {
+ aSelection = pSh->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView();
+ }
- GetIDocumentUndoRedo().AppendUndo( new SwSdrUndo(pUndo, pMarkList) );
+ GetIDocumentUndoRedo().AppendUndo( new SwSdrUndo(pUndo, aSelection) );
}
else
delete pUndo;
return 0;
}
-SwSdrUndo::SwSdrUndo( SdrUndoAction* pUndo, const SdrMarkList* pMrkLst )
- : SwUndo( UNDO_DRAWUNDO ), pSdrUndo( pUndo )
+SwSdrUndo::SwSdrUndo( SdrUndoAction* pUndo, const SdrObjectVector& rSelectedSdrObjectVector )
+: SwUndo(UNDO_DRAWUNDO),
+ pSdrUndo(pUndo),
+ maSelectedSdrObjectVector(rSelectedSdrObjectVector)
{
- if( pMrkLst && pMrkLst->GetMarkCount() )
- pMarkList = new SdrMarkList( *pMrkLst );
- else
- pMarkList = 0;
}
SwSdrUndo::~SwSdrUndo()
{
delete pSdrUndo;
- delete pMarkList;
+ maSelectedSdrObjectVector.clear();
}
void SwSdrUndo::UndoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Undo();
- rContext.SetSelections(0, pMarkList);
+ rContext.SetSelections(0, maSelectedSdrObjectVector);
}
void SwSdrUndo::RedoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Redo();
- rContext.SetSelections(0, pMarkList);
+ rContext.SetSelections(0, maSelectedSdrObjectVector);
}
String SwSdrUndo::GetComment() const
@@ -199,8 +197,8 @@ void lcl_RestoreAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos )
}
}
-SwUndoDrawGroup::SwUndoDrawGroup( sal_uInt16 nCnt )
- : SwUndo( UNDO_DRAWGROUP ), nSize( nCnt + 1 ), bDelFmt( sal_True )
+SwUndoDrawGroup::SwUndoDrawGroup( sal_uInt32 nCnt )
+ : SwUndo( UNDO_DRAWGROUP ), nSize( nCnt + 1 ), bDelFmt( true )
{
pObjArr = new SwUndoGroupObjImpl[ nSize ];
}
@@ -210,7 +208,7 @@ SwUndoDrawGroup::~SwUndoDrawGroup()
if( bDelFmt )
{
SwUndoGroupObjImpl* pTmp = pObjArr + 1;
- for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp )
+ for( sal_uInt32 n = 1; n < nSize; ++n, ++pTmp )
delete pTmp->pFmt;
}
else
@@ -221,7 +219,7 @@ SwUndoDrawGroup::~SwUndoDrawGroup()
void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
{
- bDelFmt = sal_False;
+ bDelFmt = false;
// save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
@@ -230,8 +228,8 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
pObjArr->pObj = pObj;
// object will destroy itself
- pDrawContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
- pObj->SetUserCall( 0 );
+ pDrawContact->HandleChanged(*pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObj);
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
@@ -243,7 +241,7 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
- for( sal_uInt16 n = 1; n < nSize; ++n )
+ for( sal_uInt32 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -257,9 +255,9 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
// #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj );
// #i45952# - notify that position attributes are already set
- ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
+ ASSERT( dynamic_cast< SwDrawFrmFmt* >(rSave.pFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
- if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
+ if ( dynamic_cast< SwDrawFrmFmt* >(rSave.pFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
@@ -268,24 +266,24 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
{
- bDelFmt = sal_True;
+ bDelFmt = true;
// remove from array
SwDoc* pDoc = pObjArr->pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
SdrObject* pObj;
- for( sal_uInt16 n = 1; n < nSize; ++n )
+ for( sal_uInt32 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
pObj = rSave.pObj;
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
// object will destroy itself
- pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
- pObj->SetUserCall( 0 );
+ pContact->HandleChanged(*pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObj);
::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx );
@@ -305,15 +303,15 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
// #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj );
// #i45952# - notify that position attributes are already set
- ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
+ ASSERT( dynamic_cast< SwDrawFrmFmt* >(pObjArr->pFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
- if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
+ if ( dynamic_cast< SwDrawFrmFmt* >(pObjArr->pFmt) )
{
static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet();
}
}
-void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj )
+void SwUndoDrawGroup::AddObj( sal_uInt32 nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + nPos + 1 );
rSave.pObj = pObj;
@@ -338,20 +336,20 @@ void SwUndoDrawGroup::SetGroupFmt( SwDrawFrmFmt* pFmt )
// ------------------------------
SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj )
- : SwUndo( UNDO_DRAWUNGROUP ), bDelFmt( sal_False )
+ : SwUndo( UNDO_DRAWUNGROUP ), bDelFmt( false )
{
- nSize = (sal_uInt16)pObj->GetSubList()->GetObjCount() + 1;
+ nSize = pObj->getChildrenOfSdrObject()->GetObjCount() + 1;
pObjArr = new SwUndoGroupObjImpl[ nSize ];
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
SwDrawFrmFmt* pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
pObjArr->pObj = pObj;
pObjArr->pFmt = pFmt;
// object will destroy itself
- pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
- pObj->SetUserCall( 0 );
+ pContact->HandleChanged(*pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObj);
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
@@ -368,7 +366,7 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup()
if( bDelFmt )
{
SwUndoGroupObjImpl* pTmp = pObjArr + 1;
- for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp )
+ for( sal_uInt32 n = 1; n < nSize; ++n, ++pTmp )
delete pTmp->pFmt;
}
else
@@ -379,13 +377,13 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup()
void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
{
- bDelFmt = sal_True;
+ bDelFmt = true;
SwDoc *const pDoc = & rContext.GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
// remove from array
- for( sal_uInt16 n = 1; n < nSize; ++n )
+ for( sal_uInt32 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -406,9 +404,9 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
// #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj );
// #i45952# - notify that position attributes are already set
- ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
+ ASSERT( dynamic_cast< SwDrawFrmFmt* >(pObjArr->pFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
- if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
+ if ( dynamic_cast< SwDrawFrmFmt* >(pObjArr->pFmt) )
{
static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet();
}
@@ -416,16 +414,15 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
{
- bDelFmt = sal_False;
+ bDelFmt = false;
// save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
SwDrawContact* pContact = (SwDrawContact*)pFmt->FindContactObj();
// object will destroy itself
- pContact->Changed( *pObjArr->pObj, SDRUSERCALL_DELETE,
- pObjArr->pObj->GetLastBoundRect() );
- pObjArr->pObj->SetUserCall( 0 );
+ pContact->HandleChanged(*pObjArr->pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObjArr->pObj);
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
@@ -437,7 +434,7 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
- for( sal_uInt16 n = 1; n < nSize; ++n )
+ for( sal_uInt32 n = 1; n < nSize; ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
@@ -445,16 +442,16 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
rFlyFmts.Insert( rSave.pFmt, rFlyFmts.Count() );
// #i45952# - notify that position attributes are already set
- ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
+ ASSERT( dynamic_cast< SwDrawFrmFmt* >(rSave.pFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
- if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
+ if ( dynamic_cast< SwDrawFrmFmt* >(rSave.pFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
}
}
-void SwUndoDrawUnGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt )
+void SwUndoDrawUnGroup::AddObj( sal_uInt32 nPos, SwDrawFrmFmt* pFmt )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + nPos + 1 );
rSave.pFmt = pFmt;
@@ -473,19 +470,18 @@ SwUndoDrawUnGroupConnectToLayout::~SwUndoDrawUnGroupConnectToLayout()
void
SwUndoDrawUnGroupConnectToLayout::UndoImpl(::sw::UndoRedoContext &)
{
- for ( std::vector< SdrObject >::size_type i = 0;
- i < aDrawFmtsAndObjs.size(); ++i )
+ for ( SdrObjectVector::size_type i = 0; i < aDrawFmtsAndObjs.size(); ++i )
{
SdrObject* pObj( aDrawFmtsAndObjs[i].second );
- SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(pObj->GetUserCall()) );
+ SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(findConnectionToSdrObjectDirect(pObj)) );
ASSERT( pDrawContact,
"<SwUndoDrawUnGroupConnectToLayout::Undo(..)> -- missing SwDrawContact instance" );
if ( pDrawContact )
{
// deletion of instance <pDrawContact> and thus disconnection from
// the Writer layout.
- pDrawContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
- pObj->SetUserCall( 0 );
+ pDrawContact->HandleChanged(*pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObj);
}
}
}
@@ -513,11 +509,14 @@ void SwUndoDrawUnGroupConnectToLayout::AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
//-------------------------------------
-SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt16 nCnt )
- : SwUndo( UNDO_DRAWDELETE ), nSize( nCnt ), bDelFmt( sal_True )
+SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt32 nCnt )
+: SwUndo( UNDO_DRAWDELETE ),
+ pObjArr(0),
+ maSdrObjectVector(),
+ nSize( nCnt ),
+ bDelFmt( true )
{
pObjArr = new SwUndoGroupObjImpl[ nSize ];
- pMarkLst = new SdrMarkList();
}
SwUndoDrawDelete::~SwUndoDrawDelete()
@@ -525,53 +524,52 @@ SwUndoDrawDelete::~SwUndoDrawDelete()
if( bDelFmt )
{
SwUndoGroupObjImpl* pTmp = pObjArr;
- for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp )
+ for( sal_uInt32 n = 0; n < maSdrObjectVector.size(); ++n, ++pTmp )
delete pTmp->pFmt;
}
delete [] pObjArr;
- delete pMarkLst;
+ maSdrObjectVector.clear();
}
void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
- bDelFmt = sal_False;
+ bDelFmt = false;
SwSpzFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts();
- for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n )
+ for( sal_uInt32 n = 0; n < maSdrObjectVector.size(); ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx );
rFlyFmts.Insert( rSave.pFmt, rFlyFmts.Count() );
SdrObject *pObj = rSave.pObj;
SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj );
- pContact->_Changed( *pObj, SDRUSERCALL_INSERTED, NULL );
+ pContact->_Changed( *pObj, HINT_OBJCHG_RESIZE, false );
// #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj );
// #i45952# - notify that position attributes are already set
- ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
+ ASSERT( dynamic_cast< SwDrawFrmFmt* >(rSave.pFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
- if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
+ if ( dynamic_cast< SwDrawFrmFmt* >(rSave.pFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
// <--
}
- rContext.SetSelections(0, pMarkLst);
+ rContext.SetSelections(0, maSdrObjectVector);
}
void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext)
{
- bDelFmt = sal_True;
+ bDelFmt = true;
SwSpzFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts();
- for( sal_uInt16 n = 0; n < pMarkLst->GetMarkCount(); ++n )
+ for( sal_uInt32 n = 0; n < maSdrObjectVector.size(); ++n )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
SdrObject *pObj = rSave.pObj;
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pContact = (SwDrawContact*)findConnectionToSdrObject(pObj);
SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
-
// object will destroy itself
- pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
- pObj->SetUserCall( 0 );
+ pContact->HandleChanged(*pObj, HINT_SDROBJECTDYING);
+ resetConnectionToSdrObject(pObj);
// notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
@@ -581,11 +579,10 @@ void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext)
}
}
-void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrmFmt* pFmt,
- const SdrMark& rMark )
+void SwUndoDrawDelete::AddObj( sal_uInt32 , SwDrawFrmFmt* pFmt, const SdrObject& rSdrObject )
{
- SwUndoGroupObjImpl& rSave = *( pObjArr + pMarkLst->GetMarkCount() );
- rSave.pObj = rMark.GetMarkedSdrObj();
+ SwUndoGroupObjImpl& rSave = *( pObjArr + maSdrObjectVector.size() );
+ rSave.pObj = const_cast< SdrObject* >(&rSdrObject);
rSave.pFmt = pFmt;
::lcl_SaveAnchor( pFmt, rSave.nNodeIdx );
@@ -597,6 +594,6 @@ void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrmFmt* pFmt,
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
- pMarkLst->InsertEntry( rMark );
+ maSdrObjectVector.push_back( const_cast< SdrObject* >(&rSdrObject) );
}
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 69159d810d55..0bf31e2ebb53 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -829,7 +829,7 @@ void SwUndoReRead::SetAndSave(::sw::UndoRedoContext & rContext)
if( RES_MIRROR_GRAPH_DONT != nOldMirr )
pGrfNd->SetAttr( SwMirrorGrf() );
- rContext.SetSelections(pGrfNd->GetFlyFmt(), 0);
+ rContext.SetSelections(pGrfNd->GetFlyFmt());
}
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 1011371e044c..f26886621b17 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -310,7 +310,7 @@ SwUndoDelSection::SwUndoDelSection(
SwNodeIndex const*const pIndex)
: SwUndo( UNDO_DELSECTION )
, m_pSectionData( new SwSectionData(rSection) )
- , m_pTOXBase( rSection.ISA( SwTOXBaseSection )
+ , m_pTOXBase( dynamic_cast< const SwTOXBaseSection* >(&rSection)
? new SwTOXBase(static_cast<SwTOXBaseSection const&>(rSection))
: 0 )
, m_pAttrSet( ::lcl_GetAttrSet(rSection) )
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 52e6cda8d66d..4d186961ab59 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -308,7 +308,7 @@ void SwUndoInsTbl::UndoImpl(::sw::UndoRedoContext & rContext)
sTblNm = pTblNd->GetTable().GetFrmFmt()->GetName();
- if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) )
+ if( dynamic_cast< SwDDETable* >(&pTblNd->GetTable()))
pDDEFldType = (SwDDEFieldType*)((SwDDETable&)pTblNd->GetTable()).
GetDDEFldType()->Copy();
@@ -434,7 +434,7 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh )
pTblSave = new _SaveTable( rTbl );
pBoxSaves = new SwTblToTxtSaves( (sal_uInt8)rTbl.GetTabSortBoxes().Count() );
- if( rTbl.IsA( TYPE( SwDDETable ) ) )
+ if( dynamic_cast< const SwDDETable* >(&rTbl) )
pDDEFldType = (SwDDEFieldType*)((SwDDETable&)rTbl).GetDDEFldType()->Copy();
bCheckNumFmt = rTbl.GetFrmFmt()->GetDoc()->IsInsTblFormatNum();
@@ -669,7 +669,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
SwTableNode* pTblNd = pPam->GetNode()->GetTableNode();
ASSERT( pTblNd, "keinen TableNode gefunden" );
- if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) )
+ if( dynamic_cast< SwDDETable* >(&pTblNd->GetTable()) )
pDDEFldType = (SwDDEFieldType*)((SwDDETable&)pTblNd->GetTable()).
GetDDEFldType()->Copy();
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 1ac63b5e8c40..03c2a184f8fa 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -241,8 +241,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
eType = IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK;
}
else if ((eType == IDocumentMarkAccess::BOOKMARK) &&
- ::sw::mark::CrossRefHeadingBookmark::IsLegalName(m_pImpl->m_sMarkName) &&
- IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( aPam ) )
+ ::sw::mark::CrossRefHeadingBookmark::IsLegalName(m_pImpl->m_sMarkName))
{
eType = IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK;
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 5f5b155b0f5b..3695b061c20a 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -82,6 +82,10 @@
#include <vcl/svapp.hxx>
#include <slist>
#include <iterator>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
#include <switerator.hxx>
using ::rtl::OUString;
@@ -277,40 +281,37 @@ public:
****************************************************************************/
SwFmDrawPage::SwFmDrawPage( SdrPage* pPage ) :
- SvxFmDrawPage( pPage ), pPageView(0)
+ SvxFmDrawPage( pPage )
{
}
SwFmDrawPage::~SwFmDrawPage() throw ()
{
- RemovePageView();
+ if(mpView)
+ mpView->HideSdrPage();
}
-const SdrMarkList& SwFmDrawPage::PreGroup(const uno::Reference< drawing::XShapes > & xShapes)
+const SdrObjectVector SwFmDrawPage::PreGroup(const uno::Reference< drawing::XShapes > & xShapes)
+{
+ if(mpView)
{
- _SelectObjectsInView( xShapes, GetPageView() );
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- return rMarkList;
+ mpView->ShowSdrPage( *mpPage );
}
-void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup > xShapeGroup)
-{
- uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY);
- _SelectObjectInView( xShape, GetPageView() );
+ _SelectObjectsInView( xShapes );
+
+ return mpView->getSelectedSdrObjectVectorFromSdrMarkView();
}
-SdrPageView* SwFmDrawPage::GetPageView()
+void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup > xShapeGroup)
+{
+ if(mpView)
{
- if(!pPageView)
- pPageView = mpView->ShowSdrPage( mpPage );
- return pPageView;
+ mpView->ShowSdrPage( *mpPage );
}
-void SwFmDrawPage::RemovePageView()
-{
- if(pPageView && mpView)
- mpView->HideSdrPage();
- pPageView = 0;
+ uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY);
+ _SelectObjectInView( xShape );
}
uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj )
@@ -339,9 +340,9 @@ SdrObject* SwFmDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape
uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) const throw ()
{
uno::Reference< drawing::XShape > xRet;
- if(pObj->ISA(SwVirtFlyDrawObj) || pObj->GetObjInventor() == SWGInventor)
+ if(dynamic_cast< SwVirtFlyDrawObj* >(pObj) || pObj->GetObjInventor() == SWGInventor)
{
- SwFlyDrawContact* pFlyContact = (SwFlyDrawContact*)pObj->GetUserCall();
+ SwFlyDrawContact* pFlyContact = (SwFlyDrawContact*)findConnectionToSdrObjectDirect(pObj);
if(pFlyContact)
{
FlyCntType eType = FLYCNTTYPE_ALL;
@@ -390,7 +391,7 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj )
uno::Reference< uno::XInterface > xCreate(xRet, uno::UNO_QUERY);
xRet = 0;
uno::Reference< beans::XPropertySet > xPrSet;
- if ( pObj->IsGroupObject() && (!pObj->Is3DObj() || ( PTR_CAST(E3dScene,pObj ) != NULL ) ) )
+ if ( pObj->getChildrenOfSdrObject() )
xPrSet = new SwXGroupShape( xCreate );
else
xPrSet = new SwXShape( xCreate );
@@ -626,7 +627,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
// --> OD, HB
if ( pSvxShape->GetSdrObject() )
{
- if ( pSvxShape->GetSdrObject()->IsInserted() )
+ if ( pSvxShape->GetSdrObject()->IsObjectInserted() )
{
return;
}
@@ -791,13 +792,14 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
if(pPage)//kann das auch Null sein?
{
//markieren und MarkList zurueckgeben
- const SdrMarkList& rMarkList = pPage->PreGroup(xShapes);
- if ( rMarkList.GetMarkCount() > 1 )
+ const SdrObjectVector aMarkList(pPage->PreGroup(xShapes));
+
+ if ( aMarkList.size() > 1 )
{
sal_Bool bFlyInCnt = sal_False;
- for ( sal_uInt16 i = 0; !bFlyInCnt && i < rMarkList.GetMarkCount(); ++i )
+ for ( sal_uInt16 i = 0; !bFlyInCnt && i < aMarkList.size(); ++i )
{
- const SdrObject *pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
+ const SdrObject *pObj = aMarkList[i];
if (FLY_AS_CHAR == ::FindFrmFmt(const_cast<SdrObject*>(
pObj))->GetAnchor().GetAnchorId())
{
@@ -812,8 +814,9 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwDrawContact* pContact = pDoc->GroupSelection( *pPage->GetDrawView() );
+ const SdrObjectVector aSdrObjectVector = pPage->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView();
pDoc->ChgAnchor(
- pPage->GetDrawView()->GetMarkedObjectList(),
+ aSdrObjectVector,
FLY_AT_PARA/*int eAnchorId*/,
sal_True, sal_False );
@@ -826,7 +829,11 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
}
- pPage->RemovePageView();
+
+ if(pPage->GetDrawView())
+ {
+ pPage->GetDrawView()->HideSdrPage();
+ }
}
}
return xRet;
@@ -847,12 +854,17 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG
pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
pDoc->UnGroupSelection( *pPage->GetDrawView() );
- pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(),
+ const SdrObjectVector aSdrObjectVector = pPage->GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView();
+ pDoc->ChgAnchor( aSdrObjectVector,
FLY_AT_PARA/*int eAnchorId*/,
sal_True, sal_False );
pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
- pPage->RemovePageView();
+
+ if(pPage->GetDrawView())
+ {
+ pPage->GetDrawView()->HideSdrPage();
+ }
}
}
@@ -890,7 +902,6 @@ void SwXDrawPage::InvalidateSwDoc()
/****************************************************************************
****************************************************************************/
-TYPEINIT1(SwXShape, SwClient);
const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
{
@@ -1280,12 +1291,11 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId)
{
SdrObject* pObj = pFmt->FindSdrObject();
- SdrMarkList aList;
- SdrMark aMark(pObj);
- aList.InsertEntry(aMark);
+ SdrObjectVector aSdrObjectVector;
+ aSdrObjectVector.push_back(pObj);
sal_Int32 nAnchor = 0;
cppu::enum2int( nAnchor, aValue );
- pDoc->ChgAnchor( aList, (RndStdIds)nAnchor,
+ pDoc->ChgAnchor( aSdrObjectVector, (RndStdIds)nAnchor,
sal_False, sal_True );
}
else
@@ -1342,7 +1352,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
if( pDoc->GetCurrentLayout() )
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
- Point aTmp( pObj->GetSnapRect().TopLeft() );
+ Point aTmp( sdr::legacy::GetSnapRect(*pObj).TopLeft() );
pDoc->GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState );
}
else
@@ -1529,7 +1539,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
if(pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
- Point aPt = pObj->GetAnchorPos();
+ const Point aPt(sdr::legacy::GetAnchorPos(*pObj));
awt::Point aPoint( TWIP_TO_MM100( aPt.X() ),
TWIP_TO_MM100( aPt.Y() ) );
aRet.setValue(&aPoint, ::getCppuType( (awt::Point*)0 ));
@@ -1718,6 +1728,41 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
// <--
}
// <--
+ else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PolyPolygon"))) )
+ {
+ // support OWN_ATTR_VALUE_POLYPOLYGON
+ drawing::PointSequenceSequence aPath;
+ aRet >>= aPath;
+ aRet <<= _ConvertPointSequenceSequenceToLayoutDir( aPath );
+ }
+ /* Not needed; this path is relative to the obejct's transformation, thus an
+ adaption is not necessary
+ else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry"))) )
+ {
+ // support OWN_ATTR_BASE_GEOMETRY
+ drawing::PointSequenceSequence aPath;
+ aRet >>= aPath;
+ aRet <<= _ConvertPointSequenceSequenceToLayoutDir( aPath );
+ }
+ */
+ else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Polygon"))) )
+ {
+ // support OWN_ATTR_VALUE_POLYGON
+ drawing::PointSequence aPath;
+ aRet >>= aPath;
+ aRet <<= _ConvertPointSequenceToLayoutDir( aPath );
+ }
+ /* Not needed; historically the CaptionPoint was written relative to the object's
+ position. For a relative position the anchor is no longer relevant
+ else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CaptionPoint"))) )
+ {
+ // needed since else the relative, but relative to the normal object transformation
+ // position will be created in SvxShape::getPropertyValueImpl in case OWN_ATTR_CAPTION_POINT
+ awt::Point aEndPos;
+ aRet >>= aEndPos;
+ aRet <<= _ConvertStartOrEndPosToLayoutDir( aEndPos );
+ }
+ */
}
}
return aRet;
@@ -1770,7 +1815,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
SdrObject* pObject = pSvxShape->GetSdrObject();
if(pObject)
{
- bGroupMember = pObject->GetUpGroup() != 0;
+ bGroupMember = pObject->GetParentSdrObject() != 0;
bFormControl = pObject->GetObjInventor() == FmFormInventor;
}
const rtl::OUString* pNames = aPropertyNames.getConstArray();
@@ -2113,8 +2158,8 @@ void SwXShape::dispose(void) throw( uno::RuntimeException )
// OD 25.08.2003 #111713# - refine assertion for safety reason.
// --> OD 2005-02-02 #119236# - correct assertion and refine it.
ASSERT( !pObj ||
- pObj->ISA(SwDrawVirtObj) ||
- pObj->GetUpGroup() ||
+ dynamic_cast< SwDrawVirtObj* >(pObj) ||
+ pObj->GetParentSdrObject() ||
pObj == pFmt->FindSdrObject(),
"<SwXShape::dispose(..) - different 'master' drawing objects!!" );
// <--
@@ -2123,9 +2168,9 @@ void SwXShape::dispose(void) throw( uno::RuntimeException )
// --> OD 2005-02-02 #119236# - no delete of draw format for members
// of a group
if ( pObj &&
- !pObj->ISA(SwDrawVirtObj) &&
- !pObj->GetUpGroup() &&
- pObj->IsInserted() )
+ !dynamic_cast< SwDrawVirtObj* >(pObj) &&
+ !pObj->GetParentSdrObject() &&
+ pObj->IsObjectInserted() )
// <--
{
if (pFmt->GetAnchor().GetAnchorId() == FLY_AS_CHAR)
@@ -2241,8 +2286,8 @@ awt::Point SAL_CALL SwXShape::getPosition() throw ( uno::RuntimeException )
// to the determined attribute position
// --> OD 2004-10-01 #i34750# - correction:
// consider the layout direction
- const Rectangle aMemberObjRect = GetSvxShape()->GetSdrObject()->GetSnapRect();
- const Rectangle aGroupObjRect = pTopGroupObj->GetSnapRect();
+ const Rectangle aMemberObjRect(sdr::legacy::GetSnapRect(*GetSvxShape()->GetSdrObject()));
+ const Rectangle aGroupObjRect(sdr::legacy::GetSnapRect(*pTopGroupObj));
// --> OD 2005-08-16 #i53320# - relative position of group member and
// top group object is always given in horizontal left-to-right layout.
// const SwFrmFmt::tLayoutDir eLayoutDir = GetFrmFmt()
@@ -2305,13 +2350,12 @@ void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition )
if ( pSvxShape )
{
const SdrObject* pObj = pSvxShape->GetSdrObject();
- if ( pObj &&
- pObj->GetAnchorPos().X() == 0 &&
- pObj->GetAnchorPos().Y() == 0 )
+ if ( pObj && pObj->GetAnchorPos().equalZero() )
{
bApplyPosAtDrawObj = true;
- if ( pObj->GetUserCall() &&
- pObj->GetUserCall()->ISA(SwDrawContact) )
+ SwDrawContact* pSwDrawContact = dynamic_cast< SwDrawContact* >(findConnectionToSdrObjectDirect(pObj));
+
+ if ( pSwDrawContact )
{
bNoAdjustOfPosProp = true;
}
@@ -2423,12 +2467,12 @@ SdrObject* SwXShape::_GetTopGroupObj( SvxShape* _pSvxShape )
if ( pSvxShape )
{
SdrObject* pSdrObj = pSvxShape->GetSdrObject();
- if ( pSdrObj && pSdrObj->GetUpGroup() )
+ if ( pSdrObj && pSdrObj->GetParentSdrObject() )
{
- pTopGroupObj = pSdrObj->GetUpGroup();
- while ( pTopGroupObj->GetUpGroup() )
+ pTopGroupObj = pSdrObj->GetParentSdrObject();
+ while ( pTopGroupObj->GetParentSdrObject() )
{
- pTopGroupObj = pTopGroupObj->GetUpGroup();
+ pTopGroupObj = pTopGroupObj->GetParentSdrObject();
}
}
}
@@ -2456,12 +2500,9 @@ awt::Point SwXShape::_GetAttrPosition()
if ( pSvxShape )
{
const SdrObject* pObj = pSvxShape->GetSdrObject();
- if ( pObj &&
- pObj->GetAnchorPos().X() == 0 &&
- pObj->GetAnchorPos().Y() == 0 &&
- aAttrPos.X == 0 && aAttrPos.Y == 0 )
+ if ( pObj && pObj->GetAnchorPos().equalZero() && aAttrPos.X == 0 && aAttrPos.Y == 0 )
{
- const Rectangle aObjRect = pObj->GetSnapRect();
+ const Rectangle aObjRect(sdr::legacy::GetSnapRect(*pObj));
aAttrPos.X = TWIP_TO_MM100(aObjRect.Left());
aAttrPos.Y = TWIP_TO_MM100(aObjRect.Top());
}
@@ -2556,10 +2597,11 @@ drawing::HomogenMatrix3 SwXShape::_ConvertTransformationToLayoutDir(
// get position of object in Writer coordinate system.
awt::Point aPos( getPosition() );
// get position of object in Drawing layer coordinate system
- const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
+ const Point aTmpObjPos( sdr::legacy::GetSnapRect(*pObj).TopLeft() );
+ const Point aTmpObjAnch( sdr::legacy::GetAnchorPos(*pObj) );
const awt::Point aObjPos(
- TWIP_TO_MM100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
- TWIP_TO_MM100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
+ TWIP_TO_MM100( aTmpObjPos.X() - aTmpObjAnch.X() ),
+ TWIP_TO_MM100( aTmpObjPos.Y() - aTmpObjAnch.Y() ) );
// determine difference between these positions according to the
// Writer coordinate system
const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
@@ -2567,33 +2609,9 @@ drawing::HomogenMatrix3 SwXShape::_ConvertTransformationToLayoutDir(
// apply translation difference to transformation matrix.
if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
{
- // --> OD 2007-01-03 #i73079# - use correct matrix type
- ::basegfx::B2DHomMatrix aTempMatrix;
- // <--
-
- aTempMatrix.set(0, 0, aMatrix.Line1.Column1 );
- aTempMatrix.set(0, 1, aMatrix.Line1.Column2 );
- aTempMatrix.set(0, 2, aMatrix.Line1.Column3 );
- aTempMatrix.set(1, 0, aMatrix.Line2.Column1 );
- aTempMatrix.set(1, 1, aMatrix.Line2.Column2 );
- aTempMatrix.set(1, 2, aMatrix.Line2.Column3 );
- aTempMatrix.set(2, 0, aMatrix.Line3.Column1 );
- aTempMatrix.set(2, 1, aMatrix.Line3.Column2 );
- aTempMatrix.set(2, 2, aMatrix.Line3.Column3 );
-
- // --> OD 2007-01-03 #i73079#
+ basegfx::B2DHomMatrix aTempMatrix(basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix));
aTempMatrix.translate( aTranslateDiff.X, aTranslateDiff.Y );
- // <--
-
- aMatrix.Line1.Column1 = aTempMatrix.get(0, 0);
- aMatrix.Line1.Column2 = aTempMatrix.get(0, 1);
- aMatrix.Line1.Column3 = aTempMatrix.get(0, 2);
- aMatrix.Line2.Column1 = aTempMatrix.get(1, 0);
- aMatrix.Line2.Column2 = aTempMatrix.get(1, 1);
- aMatrix.Line2.Column3 = aTempMatrix.get(1, 2);
- aMatrix.Line3.Column1 = aTempMatrix.get(2, 0);
- aMatrix.Line3.Column2 = aTempMatrix.get(2, 1);
- aMatrix.Line3.Column3 = aTempMatrix.get(2, 2);
+ basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(aTempMatrix, aMatrix);
}
}
}
@@ -2707,10 +2725,11 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
// get position of object in Writer coordinate system.
awt::Point aPos( getPosition() );
// get position of object in Drawing layer coordinate system
- const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
+ const Point aTmpObjPos( sdr::legacy::GetSnapRect(*pObj).TopLeft() );
+ const Point aTmpObjAnch( sdr::legacy::GetAnchorPos(*pObj) );
const awt::Point aObjPos(
- TWIP_TO_MM100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
- TWIP_TO_MM100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
+ TWIP_TO_MM100( aTmpObjPos.X() - aTmpObjAnch.X() ),
+ TWIP_TO_MM100( aTmpObjPos.Y() - aTmpObjAnch.Y() ) );
// determine difference between these positions according to the
// Writer coordinate system
const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
@@ -2734,21 +2753,23 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
SvxShape* pSvxShape = GetSvxShape();
ASSERT( pSvxShape,
- "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!")
+ "<SwXShape::__ConvertPolyPolygonBezierToLayoutDir(..)> - no SvxShape found!")
if ( pSvxShape )
{
const SdrObject* pObj = pSvxShape->GetSdrObject();
ASSERT( pObj,
- "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!")
+ "<SwXShape::_ConvertPolyPolygonBezierToLayoutDir(..)> - no SdrObject found!")
if ( pObj )
{
// get position of object in Writer coordinate system.
awt::Point aPos( getPosition() );
// get position of object in Drawing layer coordinate system
- const Point aTmpObjPos( pObj->GetSnapRect().TopLeft() );
+ const basegfx::B2DPoint aCurrentTopLeft(pObj->getSdrObjectTransformation() * basegfx::B2DPoint(0.0, 0.0));
+ const Point aTmpObjPos(basegfx::fround(aCurrentTopLeft.getX()), basegfx::fround(aCurrentTopLeft.getY()));
+ const Point aTmpObjAnch( sdr::legacy::GetAnchorPos(*pObj) );
const awt::Point aObjPos(
- TWIP_TO_MM100( aTmpObjPos.X() - pObj->GetAnchorPos().X() ),
- TWIP_TO_MM100( aTmpObjPos.Y() - pObj->GetAnchorPos().Y() ) );
+ TWIP_TO_MM100( aTmpObjPos.X() - aTmpObjAnch.X() ),
+ TWIP_TO_MM100( aTmpObjPos.Y() - aTmpObjAnch.Y() ) );
// determine difference between these positions according to the
// Writer coordinate system
const awt::Point aTranslateDiff( aPos.X - aObjPos.X,
@@ -2756,25 +2777,103 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
// apply translation difference to PolyPolygonBezier.
if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
{
- const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix(
+ basegfx::B2DPolyPolygon aPolyPolygon(
+ basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(aConvertedPath));
+
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(
aTranslateDiff.X, aTranslateDiff.Y));
+ basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(
+ aPolyPolygon, aConvertedPath);
+ }
+ }
+ }
- const sal_Int32 nOuterSequenceCount(aConvertedPath.Coordinates.getLength());
- drawing::PointSequence* pInnerSequence = aConvertedPath.Coordinates.getArray();
- for(sal_Int32 a(0); a < nOuterSequenceCount; a++)
- {
- const sal_Int32 nInnerSequenceCount(pInnerSequence->getLength());
- awt::Point* pArray = pInnerSequence->getArray();
+ return aConvertedPath;
+}
- for(sal_Int32 b(0); b < nInnerSequenceCount; b++)
- {
- basegfx::B2DPoint aNewCoordinatePair(pArray->X, pArray->Y);
- aNewCoordinatePair *= aMatrix;
- pArray->X = basegfx::fround(aNewCoordinatePair.getX());
- pArray->Y = basegfx::fround(aNewCoordinatePair.getY());
- pArray++;
+::com::sun::star::drawing::PointSequenceSequence SwXShape::_ConvertPointSequenceSequenceToLayoutDir(
+ const ::com::sun::star::drawing::PointSequenceSequence& aPath)
+{
+ drawing::PointSequenceSequence aConvertedPath(aPath);
+ SvxShape* pSvxShape = GetSvxShape();
+ OSL_ENSURE(pSvxShape, "<SwXShape::_ConvertPointSequenceSequenceToLayoutDir(..)> - no SvxShape found!");
+
+ if(pSvxShape)
+ {
+ const SdrObject* pObj = pSvxShape->GetSdrObject();
+ OSL_ENSURE(pObj, "<SwXShape::_ConvertPointSequenceSequenceToLayoutDir(..)> - no SdrObject found!");
+
+ if(pObj)
+ {
+ // get position of object in Writer coordinate system.
+ const awt::Point aPos(getPosition());
+
+ // get position of object in Drawing layer coordinate system
+ const Point aTmpObjPos(sdr::legacy::GetSnapRect(*pObj).TopLeft());
+ const Point aTmpObjAnch( sdr::legacy::GetAnchorPos(*pObj) );
+ const awt::Point aObjPos(
+ TWIP_TO_MM100(aTmpObjPos.X() - aTmpObjAnch.X()),
+ TWIP_TO_MM100(aTmpObjPos.Y() - aTmpObjAnch.Y()));
+
+ // determine difference between these positions according to the
+ // Writer coordinate system
+ const awt::Point aTranslateDiff(aPos.X - aObjPos.X, aPos.Y - aObjPos.Y);
+
+ // apply translation difference to PolyPolygonBezier.
+ if(aTranslateDiff.X || aTranslateDiff.Y)
+ {
+ basegfx::B2DPolyPolygon aPolyPolygon(
+ basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(aConvertedPath));
+
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(
+ aTranslateDiff.X, aTranslateDiff.Y));
+ basegfx::tools::B2DPolyPolygonToUnoPointSequenceSequence(
+ aPolyPolygon, aConvertedPath);
+ }
}
}
+
+ return aConvertedPath;
+}
+
+::com::sun::star::drawing::PointSequence SwXShape::_ConvertPointSequenceToLayoutDir(
+ const ::com::sun::star::drawing::PointSequence& aPath)
+{
+ drawing::PointSequence aConvertedPath(aPath);
+ SvxShape* pSvxShape = GetSvxShape();
+ OSL_ENSURE(pSvxShape, "<SwXShape::__ConvertPointSequenceToLayoutDir(..)> - no SvxShape found!");
+
+ if(pSvxShape)
+ {
+ const SdrObject* pObj = pSvxShape->GetSdrObject();
+ OSL_ENSURE(pObj, "<SwXShape::_ConvertPointSequenceToLayoutDir(..)> - no SdrObject found!");
+
+ if(pObj)
+ {
+ // get position of object in Writer coordinate system.
+ const awt::Point aPos(getPosition());
+
+ // get position of object in Drawing layer coordinate system
+ const Point aTmpObjPos(sdr::legacy::GetSnapRect(*pObj).TopLeft());
+ const Point aTmpObjAnch( sdr::legacy::GetAnchorPos(*pObj) );
+ const awt::Point aObjPos(
+ TWIP_TO_MM100(aTmpObjPos.X() - aTmpObjAnch.X()),
+ TWIP_TO_MM100(aTmpObjPos.Y() - aTmpObjAnch.Y()));
+
+ // determine difference between these positions according to the
+ // Writer coordinate system
+ const awt::Point aTranslateDiff(aPos.X - aObjPos.X, aPos.Y - aObjPos.Y);
+
+ // apply translation difference to PolyPolygonBezier.
+ if(aTranslateDiff.X || aTranslateDiff.Y)
+ {
+ basegfx::B2DPolygon aPolygon(
+ basegfx::tools::UnoPointSequenceToB2DPolygon(aConvertedPath));
+
+ aPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(
+ aTranslateDiff.X, aTranslateDiff.Y));
+ basegfx::tools::B2DPolygonToUnoPointSequence(
+ aPolygon, aConvertedPath);
}
}
}
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 2dc0852cef09..bbbb8964ca34 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -388,7 +388,6 @@ sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
/******************************************************************
* SwXFieldMaster
******************************************************************/
-TYPEINIT1(SwXFieldMaster, SwClient);
const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId()
{
@@ -1066,8 +1065,6 @@ struct SwFieldProperties_Impl
};
-TYPEINIT1(SwXTextField, SwClient);
-
const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
@@ -2730,6 +2727,7 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
for(sal_uInt16 nType = 0; nType < nCount; ++nType)
{
const SwFieldType *pCurType = pFldTypes->GetObject(nType);
+
SwIterator<SwFmtFld,SwFieldType> aIter( *pCurType );
const SwFmtFld* pCurFldFmt = aIter.First();
while (pCurFldFmt)
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 18d488220c54..59263cf095ca 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -117,6 +117,7 @@
#include <fmtfollowtextflow.hxx>
#include <fmtwrapinfluenceonobjpos.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <svx/fmmodel.hxx>
#include <switerator.hxx>
// from fefly1.cxx
@@ -754,8 +755,6 @@ sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& r
return 0;
}
-TYPEINIT1(SwXFrame, SwClient);
-
OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFrame");
@@ -930,8 +929,7 @@ SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt )
// --> OD 2005-08-08 #i52858# - method name changed
SdrModel *pDrawModel = pDoc->GetOrCreateDrawModel();
// <--
- SwFlyDrawContact* pContactObject
- = new SwFlyDrawContact( pFmt, pDrawModel );
+ SwFlyDrawContact* pContactObject = new SwFlyDrawContact( pFmt, *pDrawModel );
pObject = pContactObject->GetMaster();
const :: SwFmtSurround& rSurround = pFmt->GetSurround();
@@ -940,7 +938,7 @@ SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt )
!pFmt->GetOpaque().GetValue() ) ? pDoc->GetHellId()
: pDoc->GetHeavenId() );
- pDrawModel->GetPage(0)->InsertObject( pObject );
+ pDrawModel->GetPage(0)->InsertObjectToSdrObjList(*pObject);
}
return pObject;
@@ -1104,7 +1102,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
SwFlyFrm *pFly = 0;
{
const :: SwFrmFmt* pFmtXX = pFmt;
- if (PTR_CAST(SwFlyFrmFmt, pFmtXX))
+ if (dynamic_cast< const SwFlyFrmFmt* >( pFmtXX))
pFly = ((SwFlyFrmFmt*)pFmtXX)->GetFrm();
}
if ( pFly )
@@ -1303,7 +1301,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
GetOrCreateSdrObject( (SwFlyFrmFmt*)pFmt );
SdrModel *pDrawModel = pDoc->GetDrawModel();
pDrawModel->GetPage(0)->
- SetObjectOrdNum(pObject->GetOrdNum(), nZOrder);
+ SetNavigationPosition(pObject->GetNavigationPosition(), nZOrder);
}
}
else if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == pEntry->nMemberId)
@@ -1382,7 +1380,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
{
// see SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
SwFlyFrm *pFly = 0;
- if (PTR_CAST(SwFlyFrmFmt, pFmt))
+ if (dynamic_cast< SwFlyFrmFmt* >( pFmt))
pFly = ((SwFlyFrmFmt*)pFmt)->GetFrm();
if (pFly)
{
@@ -1652,7 +1650,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
const SdrObject* pObj = pFmt->FindRealSdrObject();
if( pObj )
{
- aAny <<= (sal_Int32)pObj->GetOrdNum();
+ aAny <<= (sal_Int32)pObj->GetNavigationPosition();
}
}
else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_MODEL == pEntry->nWID||
@@ -2004,9 +2002,9 @@ void SwXFrame::dispose(void) throw( uno::RuntimeException )
// format/anchor sign, not only if the object is inserted, but also
// if a contact object is registered, which isn't in the destruction.
if ( pObj &&
- ( pObj->IsInserted() ||
- ( pObj->GetUserCall() &&
- !static_cast<SwContact*>(pObj->GetUserCall())->IsInDTOR() ) ) )
+ ( pObj->IsObjectInserted() ||
+ ( findConnectionToSdrObjectDirect(pObj) &&
+ !findConnectionToSdrObjectDirect(pObj)->IsInDTOR() ) ) )
{
if (pFmt->GetAnchor().GetAnchorId() == FLY_AS_CHAR)
{
@@ -3172,7 +3170,6 @@ uno::Reference<container::XNameReplace> SAL_CALL
/******************************************************************
*
******************************************************************/
-TYPEINIT1(SwXOLEListener, SwClient);
SwXOLEListener::SwXOLEListener( SwFmt& rOLEFmt, uno::Reference< XModel > xOLE) :
SwClient(&rOLEFmt),
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 09677b3482ae..6439fea8a707 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -410,7 +410,6 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
return aRet;
}
-TYPEINIT1(SwXRedline, SwClient);
SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) :
SwXText(&rDoc, CURSOR_REDLINE),
pDoc(&rDoc),
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 8deff0e26627..455a14b07b35 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -1178,8 +1178,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
if (pEnclosingSection)
{
// convert section to TOXBase and get SwXDocumentIndex
- SwTOXBaseSection *const pTOXBaseSect =
- PTR_CAST(SwTOXBaseSection, pEnclosingSection);
+ const SwTOXBaseSection*pTOXBaseSect = dynamic_cast< const SwTOXBaseSection* >( pEnclosingSection);
const uno::Reference<text::XDocumentIndex> xIndex =
SwXDocumentIndex::CreateXDocumentIndex(
*pTOXBaseSect->GetFmt()->GetDoc(), *pTOXBaseSect);
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index f126cdbb74db..1d1e78efb116 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1115,7 +1115,7 @@ void SAL_CALL SwXStyleFamily::removeVetoableChangeListener( const ::rtl::OUStrin
-----------------------------------------------------------------------*/
void SwXStyleFamily::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- SfxSimpleHint *pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint *pHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
if( pHint && ( pHint->GetId() & SFX_HINT_DYING ) )
{
pBasePool = 0;
@@ -1288,7 +1288,6 @@ sal_Int64 SAL_CALL SwXStyle::getSomething( const uno::Sequence< sal_Int8 >& rId
return 0;
}
-TYPEINIT1(SwXStyle, SfxListener);
/* -----------------------------06.04.00 11:24--------------------------------
---------------------------------------------------------------------------*/
@@ -3120,7 +3119,7 @@ uno::Any SwXStyle::getPropertyDefault(const OUString& rPropertyName)
* --------------------------------------------------*/
void SwXStyle::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- SfxSimpleHint *pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const SfxSimpleHint *pHint = dynamic_cast< const SfxSimpleHint* >( &rHint );
if( pHint )
{
if(( pHint->GetId() & SFX_HINT_DYING ) || ( pHint->GetId() & SFX_STYLESHEET_ERASED))
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 128e896f093d..c353f71ce283 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -747,7 +747,6 @@ void lcl_setValue( SwXCell &rCell, double nVal )
/******************************************************************
* SwXCell
******************************************************************/
-TYPEINIT1(SwXCell, SwClient);
SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) :
SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT),
@@ -1273,7 +1272,6 @@ uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw(
pArray[0] = C2U("com.sun.star.text.TextTableRow");
return aRet;
}
-TYPEINIT1(SwXTextTableRow, SwClient);
SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) :
SwClient(pFmt),
@@ -2095,9 +2093,6 @@ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >&
return 0;
}
-TYPEINIT1(SwXTextTable, SwClient)
-
-
SwXTextTable::SwXTextTable() :
aLstnrCntnr( (text::XTextTable*)this),
aChartLstnrCntnr( (text::XTextTable*)this),
@@ -3577,8 +3572,6 @@ sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >&
return 0;
}
-TYPEINIT1(SwXCellRange, SwClient);
-
OUString SwXCellRange::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCellRange");
@@ -4562,7 +4555,6 @@ uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( un
pArray[0] = C2U("com.sun.star.text.TableRows");
return aRet;
}
-TYPEINIT1(SwXTableRows, SwClient);
SwXTableRows::SwXTableRows(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
@@ -4779,7 +4771,6 @@ uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw(
pArray[0] = C2U("com.sun.star.text.TableColumns");
return aRet;
}
-TYPEINIT1(SwXTableColumns, SwClient);
SwXTableColumns::SwXTableColumns(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 638e88da1972..a4dbef4f18a5 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -150,8 +150,7 @@ void SwRenderData::MakeSwPrtOptions(
return;
// get default print options
- const TypeId aSwWebDocShellTypeId = TYPE(SwWebDocShell);
- sal_Bool bWeb = pDocShell->IsA( aSwWebDocShellTypeId );
+ const bool bWeb(dynamic_cast< const SwWebDocShell* >(pDocShell));
::sw::InitPrintOptionsFromApplication(rOptions, bWeb);
// get print options to use from provided properties
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index d9dbeaa2a065..ac80cf40d4df 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -25,7 +25,7 @@
#include "precompiled_sw.hxx"
-#include <svx/svdmodel.hxx>
+#include <svx/fmmodel.hxx>
#include <svx/svdpage.hxx>
#include <tools/shl.hxx>
#include <swmodule.hxx>
@@ -33,6 +33,7 @@
#include <svx/svdpagv.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
+#include <svx/svdlegacy.hxx>
/// OD 29.08.2002 #102450#
/// include <svx/svdoutl.hxx>
@@ -100,10 +101,8 @@ void SwViewImp::StartAction()
if ( HasDrawView() )
{
SET_CURR_SHELL( GetShell() );
- if ( pSh->ISA(SwFEShell) )
+ if ( dynamic_cast< SwFEShell* >(pSh) )
((SwFEShell*)pSh)->HideChainMarker(); //Kann sich geaendert haben
- //bResetXorVisibility = GetDrawView()->IsShownXorVisible( GetShell()->GetOut());
- //GetDrawView()->HideShownXor( GetShell()->GetOut() );
}
}
@@ -114,9 +113,7 @@ void SwViewImp::EndAction()
if ( HasDrawView() )
{
SET_CURR_SHELL( GetShell() );
- //if ( bResetXorVisibility )
- // GetDrawView()->ShowShownXor( GetShell()->GetOut() );
- if ( pSh->ISA(SwFEShell) )
+ if ( dynamic_cast< SwFEShell* >(pSh) )
((SwFEShell*)pSh)->SetChainMarker(); //Kann sich geaendert haben
}
}
@@ -133,29 +130,12 @@ void SwViewImp::EndAction()
void SwViewImp::LockPaint()
{
- if ( HasDrawView() )
- {
- //HMHbShowHdlPaint = GetDrawView()->IsMarkHdlShown();
- //HMHif ( bShowHdlPaint )
- //HMH GetDrawView()->HideMarkHdl();
- bResetHdlHiddenPaint = !GetDrawView()->areMarkHandlesHidden();
- GetDrawView()->hideMarkHandles();
- }
- else
- {
- //HMHbShowHdlPaint = sal_False;
- bResetHdlHiddenPaint = sal_False;
- }
}
void SwViewImp::UnlockPaint()
{
- if ( bResetHdlHiddenPaint )
- GetDrawView()->showMarkHandles();
- //HMHif ( bShowHdlPaint )
- //HMH GetDrawView()->ShowMarkHdl();
}
@@ -211,25 +191,34 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
if ( _pPageBackgrdColor )
{
aOldOutlinerBackgrdColor =
- GetDrawView()->GetModel()->GetDrawOutliner().GetBackgroundColor();
- GetDrawView()->GetModel()->GetDrawOutliner().SetBackgroundColor( *_pPageBackgrdColor );
+ GetDrawView()->getSdrModelFromSdrView().GetDrawOutliner().GetBackgroundColor();
+ GetDrawView()->getSdrModelFromSdrView().GetDrawOutliner().SetBackgroundColor( *_pPageBackgrdColor );
}
aOldEEHoriTextDir =
- GetDrawView()->GetModel()->GetDrawOutliner().GetDefaultHorizontalTextDirection();
+ GetDrawView()->getSdrModelFromSdrView().GetDrawOutliner().GetDefaultHorizontalTextDirection();
EEHorizontalTextDirection aEEHoriTextDirOfPage =
_bIsPageRightToLeft ? EE_HTEXTDIR_R2L : EE_HTEXTDIR_L2R;
- GetDrawView()->GetModel()->GetDrawOutliner().SetDefaultHorizontalTextDirection( aEEHoriTextDirOfPage );
+ GetDrawView()->getSdrModelFromSdrView().GetDrawOutliner().SetDefaultHorizontalTextDirection( aEEHoriTextDirOfPage );
}
pOutDev->Push( PUSH_LINECOLOR ); // #114231#
if (pPrintData)
{
// hide drawings but not form controls (form controls are handled elsewhere)
- SdrView &rSdrView = const_cast< SdrView & >(GetPageView()->GetView());
- rSdrView.setHideDraw( !pPrintData->IsPrintDraw() );
+ SwDrawView* pSdrView = const_cast< SwDrawView* >(GetDrawView());
+ pSdrView->setHideDraw( !pPrintData->IsPrintDraw() );
+ }
+
+ if(GetDrawView()->GetSdrPageView())
+ {
+ GetDrawView()->GetSdrPageView()->DrawLayer( _nLayerID, pOutDev, pRedirector );
+ }
+ else
+ {
+ OSL_ENSURE(false, "Missing SdrPageView, use ShowSdrPage() first (!)");
}
- GetPageView()->DrawLayer( _nLayerID, pOutDev, pRedirector );
+
pOutDev->Pop();
// OD 29.08.2002 #102450#
@@ -238,8 +227,8 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
if ( (_nLayerID == pIDDMA->GetHellId()) ||
(_nLayerID == pIDDMA->GetHeavenId()) )
{
- GetDrawView()->GetModel()->GetDrawOutliner().SetBackgroundColor( aOldOutlinerBackgrdColor );
- GetDrawView()->GetModel()->GetDrawOutliner().SetDefaultHorizontalTextDirection( aOldEEHoriTextDir );
+ GetDrawView()->getSdrModelFromSdrView().GetDrawOutliner().SetBackgroundColor( aOldOutlinerBackgrdColor );
+ GetDrawView()->getSdrModelFromSdrView().GetDrawOutliner().SetDefaultHorizontalTextDirection( aOldEEHoriTextDir );
}
pOutDev->SetDrawMode( nOldDrawMode );
@@ -258,15 +247,11 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
{
- if ( !HasDrawView() )
- return sal_False;
-
- const SdrMarkList &rMrkList = GetDrawView()->GetMarkedObjectList();
-
- if( !rMrkList.GetMarkCount() )
+ if ( !HasDrawView() || !GetDrawView()->areSdrObjectsSelected() )
return sal_False;
- SdrObject *pO = rMrkList.GetMark(rMrkList.GetMarkCount()-1)->GetMarkedSdrObj();
+ const SdrObjectVector aSelection(GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+ SdrObject *pO = aSelection[aSelection.size() - 1];
SwRect aRect;
if( pO && ::CalcClipRect( pO, aRect, sal_False ) )
@@ -282,6 +267,7 @@ sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
aRect.Bottom( aRect.Bottom() + WIEDUWILLST );
aRect.Left( aRect.Left() - WIEDUWILLST );
aRect.Right( aRect.Right() + WIEDUWILLST );
+
return aRect.IsInside( rPoint );
}
@@ -299,18 +285,21 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
if ( !HasDrawView() )
return;
- if ( GetPageView() )
- GetPageView()->GetPage()->SetSize( rNewSz );
+ if ( GetDrawView() && GetDrawView()->GetSdrPageView() )
+ GetDrawView()->GetSdrPageView()->getSdrPageFromSdrPageView().SetPageScale( basegfx::B2DVector(rNewSz.Width(), rNewSz.Height()) );
//Begrenzung des Arbeitsbereiches.
- const Rectangle aRect( Point( DOCUMENTBORDER, DOCUMENTBORDER ), rNewSz );
- const Rectangle &rOldWork = GetDrawView()->GetWorkArea();
- sal_Bool bCheckDrawObjs = sal_False;
- if ( aRect != rOldWork )
+ const basegfx::B2DRange aRange(
+ DOCUMENTBORDER, DOCUMENTBORDER,
+ DOCUMENTBORDER + rNewSz.getWidth(), DOCUMENTBORDER + rNewSz.getHeight());
+ const basegfx::B2DRange& rOldWork = GetDrawView()->GetWorkArea();
+ bool bCheckDrawObjs(false);
+
+ if(!aRange.equal(rOldWork))
{
- if ( rOldWork.Bottom() > aRect.Bottom() || rOldWork.Right() > aRect.Right())
- bCheckDrawObjs = sal_True;
- GetDrawView()->SetWorkArea( aRect );
+ if ( rOldWork.getMaxY() > aRange.getMaxY() || rOldWork.getMaxX() > aRange.getMaxX())
+ bCheckDrawObjs = true;
+ GetDrawView()->SetWorkArea( aRange );
}
if ( !bCheckDrawObjs )
return;
@@ -321,16 +310,16 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
for( sal_uLong nObj = 0; nObj < nObjs; ++nObj )
{
SdrObject *pObj = pPage->GetObj( nObj );
- if( !pObj->ISA(SwVirtFlyDrawObj) )
+ if( !dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
{
//Teilfix(26793): Objekte, die in Rahmen verankert sind, brauchen
//nicht angepasst werden.
- const SwContact *pCont = (SwContact*)GetUserCall(pObj);
+ const SwContact *pCont = (SwContact*)findConnectionToSdrObject(pObj);
//JP - 16.3.00 Bug 73920: this function might be called by the
// InsertDocument, when a PageDesc-Attribute is
// set on a node. Then the SdrObject must not have
// an UserCall.
- if( !pCont || !pCont->ISA(SwDrawContact) )
+ if( !pCont || !dynamic_cast< const SwDrawContact* >(pCont) )
continue;
const SwFrm *pAnchor = ((SwDrawContact*)pCont)->GetAnchorFrm();
@@ -347,25 +336,40 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
continue;
}
- const Rectangle aBound( pObj->GetCurrentBoundRect() );
- if ( !aRect.IsInside( aBound ) )
+ const basegfx::B2DRange& rBound(pObj->getObjectRange(GetDrawView()));
+
+ if ( !aRange.isInside( rBound ) )
+ {
+ basegfx::B2DPoint aMove(0.0, 0.0);
+
+ if(rBound.getMinX() > aRange.getMaxX())
+ {
+ aMove.setX((aRange.getMaxX() - rBound.getMinX()) - MINFLY);
+ }
+ if(rBound.getMinY() > aRange.getMaxY())
+ {
+ aMove.setY((aRange.getMaxY() - rBound.getMinY()) - MINFLY);
+ }
+ if(!aMove.equalZero())
{
- Size aSz;
- if ( aBound.Left() > aRect.Right() )
- aSz.Width() = (aRect.Right() - aBound.Left()) - MINFLY;
- if ( aBound.Top() > aRect.Bottom() )
- aSz.Height() = (aRect.Bottom() - aBound.Top()) - MINFLY;
- if ( aSz.Width() || aSz.Height() )
- pObj->Move( aSz );
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(aMove));
+ }
//Notanker: Grosse Objekte nicht nach oben verschwinden lassen.
- aSz.Width() = aSz.Height() = 0;
- if ( aBound.Bottom() < aRect.Top() )
- aSz.Width() = (aBound.Bottom() - aRect.Top()) - MINFLY;
- if ( aBound.Right() < aRect.Left() )
- aSz.Height() = (aBound.Right() - aRect.Left()) - MINFLY;
- if ( aSz.Width() || aSz.Height() )
- pObj->Move( aSz );
+ aMove = basegfx::B2DPoint(0.0, 0.0);
+
+ if(rBound.getMaxY() < aRange.getMinY())
+ {
+ aMove.setX((rBound.getMaxY() - aRange.getMinY()) - MINFLY);
+ }
+ if(rBound.getMaxX() < aRange.getMinX())
+ {
+ aMove.setY((rBound.getMaxX() - aRange.getMinX()) - MINFLY);
+ }
+ if(!aMove.equalZero())
+ {
+ sdr::legacy::transformSdrObject(*pObj, basegfx::tools::createTranslateB2DHomMatrix(aMove));
+ }
}
}
}
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 1c2e00bd3abc..323b0a75fbe8 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -51,6 +51,7 @@
#include <IDocumentDrawModelAccess.hxx>
#include <IDocumentDeviceAccess.hxx>
#include <IDocumentSettingAccess.hxx>
+#include <svx/fmmodel.hxx>
/*************************************************************************
|*
@@ -66,19 +67,27 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
ASSERT( pDrawView, "SwViewImp::Init without DrawView" );
//Jetzt die PageView erzeugen wenn sie noch nicht existiert.
SwRootFrm *pRoot = pSh->GetLayout(); //swmod 071108//swmod 071225
- if ( !pSdrPageView )
+ if ( !pDrawView->GetSdrPageView() )
{
IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
if ( !pRoot->GetDrawPage() )
pRoot->SetDrawPage( pIDDMA->GetDrawModel()->GetPage( 0 ) );
- if ( pRoot->GetDrawPage()->GetSize() != pRoot->Frm().SSize() )
- pRoot->GetDrawPage()->SetSize( pRoot->Frm().SSize() );
+ const basegfx::B2DVector aFrameScale(pRoot->Frm().SSize().Width(), pRoot->Frm().SSize().Height());
+ if ( !pRoot->GetDrawPage()->GetPageScale().equal(aFrameScale) )
+ pRoot->GetDrawPage()->SetPageScale( aFrameScale );
- pSdrPageView = pDrawView->ShowSdrPage( pRoot->GetDrawPage());
+ pDrawView->ShowSdrPage( *pRoot->GetDrawPage());
// OD 26.06.2003 #108784# - notify drawing page view about invisible
// layers.
- pIDDMA->NotifyInvisibleLayers( *pSdrPageView );
+ if(pDrawView->GetSdrPageView())
+ {
+ pIDDMA->NotifyInvisibleLayers( *pDrawView->GetSdrPageView() );
+ }
+ else
+ {
+ OSL_ENSURE(false, "NoSdrPageView after ShowSdrPage (!)");
+ }
}
pDrawView->SetDragStripes( pNewOpt->IsCrossHair() );
pDrawView->SetGridSnap( pNewOpt->IsSnap() );
@@ -89,17 +98,19 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
( rSz.Width() ? rSz.Width() /Max(short(1),pNewOpt->GetDivisionX()):0,
rSz.Height()? rSz.Height()/Max(short(1),pNewOpt->GetDivisionY()):0);
pDrawView->SetGridFine( aFSize );
- Fraction aSnGrWdtX(rSz.Width(), pNewOpt->GetDivisionX() + 1);
- Fraction aSnGrWdtY(rSz.Height(), pNewOpt->GetDivisionY() + 1);
- pDrawView->SetSnapGridWidth( aSnGrWdtX, aSnGrWdtY );
+ const Fraction aSnGrWdtX(rSz.Width(), pNewOpt->GetDivisionX() + 1);
+ const Fraction aSnGrWdtY(rSz.Height(), pNewOpt->GetDivisionY() + 1);
+ pDrawView->SetSnapGridWidth( double(aSnGrWdtX), double(aSnGrWdtY) );
if ( pRoot->Frm().HasArea() )
- pDrawView->SetWorkArea( pRoot->Frm().SVRect() );
+ {
+ const Rectangle aWorkRect(pRoot->Frm().SVRect());
+ pDrawView->SetWorkArea(basegfx::B2DRange(aWorkRect.Left(), aWorkRect.Top(), aWorkRect.Right(), aWorkRect.Bottom()));
+ }
if ( GetShell()->IsPreView() )
pDrawView->SetAnimationEnabled( sal_False );
- pDrawView->SetUseIncompatiblePathCreateInterface( sal_False );
pDrawView->SetSolidMarkHdl(pNewOpt->IsSolidMarkHdl());
// it's a JOE interface !
@@ -118,7 +129,6 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
SwViewImp::SwViewImp( ViewShell *pParent ) :
pSh( pParent ),
pDrawView( 0 ),
- pSdrPageView( 0 ),
pFirstVisPage( 0 ),
pRegion( 0 ),
pLayAct( 0 ),
@@ -129,9 +139,6 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
// OD 12.12.2002 #103492#
mpPgPrevwLayout( 0 )
{
- //bResetXorVisibility =
- //HMHbShowHdlPaint =
- bResetHdlHiddenPaint =
bSmoothUpdate = bStopSmooth = bStopPrt = sal_False;
bFirstPageInvalid = sal_True;
}
@@ -148,14 +155,7 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
SwViewImp::~SwViewImp()
{
delete pAccMap;
-
- // OD 12.12.2002 #103492#
delete mpPgPrevwLayout;
-
- //JP 29.03.96: nach ShowSdrPage muss auch HideSdrPage gemacht werden!!!
- if( pDrawView )
- pDrawView->HideSdrPage();
-
delete pDrawView;
DelRegion();
@@ -334,7 +334,7 @@ void SwViewImp::MakeDrawView()
pOutDevForDrawView = GetShell()->GetOut();
}
- pDrawView = new SwDrawView( *this, pIDDMA->GetDrawModel(), pOutDevForDrawView);
+ pDrawView = new SwDrawView( *this, *pIDDMA->GetDrawModel(), pOutDevForDrawView);
}
GetDrawView()->SetActiveLayer( XubString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Heaven" ) ) );
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index c8db1db6d8d3..e4a5b7b53483 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -90,6 +90,7 @@
// #i74769#
#include <svx/sdrpaintwindow.hxx>
+#include <svx/fmmodel.hxx>
sal_Bool ViewShell::bLstAct = sal_False;
ShellResource *ViewShell::pShellRes = 0;
@@ -101,8 +102,6 @@ sal_Bool bInSizeNotify = sal_False;
DBG_NAME(LayoutIdle)
-TYPEINIT0(ViewShell);
-
using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////////////
@@ -208,7 +207,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
const bool bIsShellForCheckViewLayout = ( this == GetLayout()->GetCurrShell() );
SET_CURR_SHELL( this );
- if ( Imp()->HasDrawView() && !Imp()->GetDrawView()->areMarkHandlesHidden() )
+ if ( Imp()->HasDrawView() )
Imp()->StartAction();
if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
@@ -258,7 +257,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
// Mitte eine Selektion und mit einem anderen Cursor an linken
// rechten Rand springen. Ohne ShowCrsr verschwindet die
// Selektion
- sal_Bool bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) );
+ sal_Bool bShowCrsr = pRegion && dynamic_cast< SwCrsrShell* >(this);
if( bShowCrsr )
((SwCrsrShell*)this)->HideCrsrs();
@@ -574,6 +573,15 @@ void ViewShell::InvalidateWindows( const SwRect &rRect )
|*
******************************************************************************/
+void ViewShell::MakeVisible( const basegfx::B2DRange& rRange )
+{
+ const Rectangle aRect(
+ (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
+ (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY()));
+
+ MakeVisible( SwRect( aRect ) );
+}
+
void ViewShell::MakeVisible( const SwRect &rRect )
{
if ( !VisArea().IsInside( rRect ) || IsScrollMDI( this, rRect ) || GetCareWin(*this) )
@@ -678,7 +686,7 @@ void ViewShell::UpdateFlds(sal_Bool bCloseDB)
{
SET_CURR_SHELL( this );
- sal_Bool bCrsr = ISA(SwCrsrShell);
+ sal_Bool bCrsr = (0 != dynamic_cast< SwCrsrShell* >(this));
if ( bCrsr )
((SwCrsrShell*)this)->StartAction();
else
@@ -780,7 +788,7 @@ void ViewShell::LayoutIdle()
void lcl_InvalidateAllCntnt( ViewShell& rSh, sal_uInt8 nInv )
{
- sal_Bool bCrsr = rSh.ISA(SwCrsrShell);
+ sal_Bool bCrsr = (0 != dynamic_cast< SwCrsrShell* >(&rSh));
if ( bCrsr )
((SwCrsrShell&)rSh).StartAction();
else
@@ -804,7 +812,7 @@ void lcl_InvalidateAllCntnt( ViewShell& rSh, sal_uInt8 nInv )
*/
void lcl_InvalidateAllObjPos( ViewShell &_rSh )
{
- const bool bIsCrsrShell = _rSh.ISA(SwCrsrShell);
+ const bool bIsCrsrShell = dynamic_cast< SwCrsrShell* >(&_rSh);
if ( bIsCrsrShell )
static_cast<SwCrsrShell&>(_rSh).StartAction();
else
@@ -1098,7 +1106,7 @@ void ViewShell::SizeChgNotify()
{
bDocSizeChgd = sal_True;
- if ( !Imp()->IsCalcLayoutProgress() && ISA( SwCrsrShell ) )
+ if ( !Imp()->IsCalcLayoutProgress() && dynamic_cast< SwCrsrShell* >(this) )
{
const SwFrm *pCnt = ((SwCrsrShell*)this)->GetCurrFrm( sal_False );
const SwPageFrm *pPage;
@@ -1294,7 +1302,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
if ( HasDrawView() )
{
Imp()->GetDrawView()->VisAreaChanged( GetWin() );
- Imp()->GetDrawView()->SetActualWin( GetWin() );
+ Imp()->GetDrawView()->SetActualOutDev( GetWin() );
}
GetWin()->Update();
@@ -1356,7 +1364,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
const bool bSmoothScrollAllowed(bOnlyYScroll && bEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
#endif
// <-
- const bool bIAmCursorShell(ISA(SwCrsrShell));
+ const bool bIAmCursorShell(dynamic_cast< SwCrsrShell* >(this));
(void) bIAmCursorShell;
// #i75172# with selection on overlay, smooth scroll should be allowed with it
@@ -2325,13 +2333,13 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
MakeDrawView();
SwDrawView *pDView = Imp()->GetDrawView();
- if ( pDView->IsDragStripes() != rOpt.IsCrossHair() )
+ if ( pDView->IsDragStripes() != (bool)rOpt.IsCrossHair() )
pDView->SetDragStripes( rOpt.IsCrossHair() );
- if ( pDView->IsGridSnap() != rOpt.IsSnap() )
+ if ( pDView->IsGridSnap() != (bool)rOpt.IsSnap() )
pDView->SetGridSnap( rOpt.IsSnap() );
- if ( pDView->IsGridVisible() != rOpt.IsGridVisible() )
+ if ( pDView->IsGridVisible() != (bool)rOpt.IsGridVisible() )
pDView->SetGridVisible( rOpt.IsGridVisible() );
const Size &rSz = rOpt.GetSnapSize();
@@ -2341,9 +2349,9 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
( rSz.Width() ? rSz.Width() / (rOpt.GetDivisionX()+1) : 0,
rSz.Height()? rSz.Height()/ (rOpt.GetDivisionY()+1) : 0);
pDView->SetGridFine( aFSize );
- Fraction aSnGrWdtX(rSz.Width(), rOpt.GetDivisionX() + 1);
- Fraction aSnGrWdtY(rSz.Height(), rOpt.GetDivisionY() + 1);
- pDView->SetSnapGridWidth( aSnGrWdtX, aSnGrWdtY );
+ const Fraction aSnGrWdtX(rSz.Width(), rOpt.GetDivisionX() + 1);
+ const Fraction aSnGrWdtY(rSz.Height(), rOpt.GetDivisionY() + 1);
+ pDView->SetSnapGridWidth( double(aSnGrWdtX), double(aSnGrWdtY) );
if ( pOpt->IsSolidMarkHdl() != rOpt.IsSolidMarkHdl() )
pDView->SetSolidMarkHdl( rOpt.IsSolidMarkHdl() );
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 7ef47e04c128..58547fc7b3f8 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -199,7 +199,7 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::SwViewShell" );
// OD 2004-06-01 #i26791# - in order to suppress event handling in
- // <SwDrawContact::Changed> during contruction of <ViewShell> instance
+ // <SwDrawContact::Notify> during contruction of <ViewShell> instance
mbInConstructor = true;
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
@@ -278,7 +278,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::SwViewShell" );
// OD 2004-06-01 #i26791# - in order to suppress event handling in
- // <SwDrawContact::Changed> during contruction of <ViewShell> instance
+ // <SwDrawContact::Notify> during contruction of <ViewShell> instance
mbInConstructor = true;
bPaintWorks = bEnableSmooth = sal_True;
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 19a5dbdf3466..475c1d8ae18a 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -368,7 +368,7 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
{
- ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only");
+ ASSERT( dynamic_cast< SwFEShell* >(this),"ViewShell::Prt for FEShell only");
SwFEShell* pFESh = (SwFEShell*)this;
// Wir bauen uns ein neues Dokument
// SwDoc *pPrtDoc = new SwDoc;
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index a334fc7fefdc..5b4a6aae6e6b 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -96,6 +96,7 @@
#include <IDocumentStylePoolAccess.hxx>
#include <numrule.hxx>
+#include <svx/svdlegacy.hxx>
/*
* um nicht immer wieder nach einem Update festzustellen, das irgendwelche
@@ -2161,7 +2162,8 @@ void SwHTMLWriter::OutCSS1_FrmFmtOptions( const SwFrmFmt& rFrmFmt,
ASSERT( pSdrObj, "Wo ist das SdrObject" );
if( pSdrObj )
{
- Point aPos( pSdrObj->GetRelativePos() );
+ // RGNFPoint aPos( pSdrObj->GetRelativePos() );
+ const Point aPos(sdr::legacy::GetSnapRect(*pSdrObj).TopLeft() - sdr::legacy::GetAnchorPos(*pSdrObj));
nXPos = aPos.A();
nYPos = aPos.B();
}
@@ -2228,7 +2230,7 @@ void SwHTMLWriter::OutCSS1_FrmFmtOptions( const SwFrmFmt& rFrmFmt,
ASSERT( pSdrObj, "Wo ist das SdrObject" );
if( pSdrObj )
{
- Size aTwipSz( pSdrObj->GetLogicRect().GetSize() );
+ Size aTwipSz( sdr::legacy::GetLogicRect(*pSdrObj).GetSize() );
if( nFrmOpts & HTML_FRMOPT_S_WIDTH )
{
if( nFrmOpts & HTML_FRMOPT_S_PIXSIZE )
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 2a5a86a2ea60..493149fe0e43 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -294,7 +294,7 @@ void SwHTMLWriter::OutBasic()
SbxArray *pModules = pBasic->GetModules();
for( sal_uInt16 j=0; j<pModules->Count(); j++ )
{
- const SbModule *pModule = PTR_CAST( SbModule, pModules->Get(j) );
+ const SbModule *pModule = dynamic_cast< const SbModule* >( pModules->Get(j) );
ASSERT( pModule, "Wo ist das Modul?" );
String sLang(
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx
index b3544260249b..1cdaac0b473d 100644
--- a/sw/source/filter/html/htmldraw.cxx
+++ b/sw/source/filter/html/htmldraw.cxx
@@ -19,12 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include "hintids.hxx"
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
@@ -33,7 +30,6 @@
#include <svx/svdobj.hxx>
#include <svx/svdotext.hxx>
#include <editeng/eeitem.hxx>
-
#ifndef _OUTLINER_HXX //autogen
#define _EEITEMID_HXX
#include <editeng/outliner.hxx>
@@ -49,8 +45,6 @@
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
#include <svx/svdpool.hxx>
-
-
#include "charatr.hxx"
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
@@ -62,10 +56,12 @@
#include "swcss1.hxx"
#include "swhtml.hxx"
#include "wrthtml.hxx"
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
+#include <svx/sdrobjectfactory.hxx>
using namespace ::com::sun::star;
-
const sal_uInt32 HTML_FRMOPTS_MARQUEE =
HTML_FRMOPT_ALIGN |
HTML_FRMOPT_SPACE;
@@ -192,8 +188,17 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj,
aAnchor.SetType( FLY_AT_PAGE );
}
// OD 2004-04-13 #i26791# - direct positioning for <SwDoc::Insert(..)>
- pNewDrawObj->SetRelativePos( Point(rCSS1PropInfo.nLeft + nLeftSpace,
- rCSS1PropInfo.nTop + nUpperSpace) );
+
+ // #i108739#
+ {
+ const Point aRelativePos(rCSS1PropInfo.nLeft + nLeftSpace, rCSS1PropInfo.nTop + nUpperSpace);
+ const Point aTopLeft(sdr::legacy::GetSnapRect(*pNewDrawObj).TopLeft());
+ const Point aAnchorPos(sdr::legacy::GetAnchorPos(*pNewDrawObj));
+ sdr::legacy::transformSdrObject(*pNewDrawObj, basegfx::tools::createTranslateB2DHomMatrix(
+ aRelativePos.X() - aTopLeft.X() + aAnchorPos.X(),
+ aRelativePos.Y() - aTopLeft.Y() + aAnchorPos.Y()));
+ }
+
aFrmSet.Put( SwFmtSurround(SURROUND_THROUGHT) );
}
else if( SVX_ADJUST_LEFT == rCSS1PropInfo.eFloat ||
@@ -203,7 +208,15 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj,
aFrmSet.Put( SwFmtSurround(bHidden ? SURROUND_THROUGHT
: SURROUND_RIGHT) );
// OD 2004-04-13 #i26791# - direct positioning for <SwDoc::Insert(..)>
- pNewDrawObj->SetRelativePos( Point(nLeftSpace, nUpperSpace) );
+ // #i108739#
+ {
+ const Point aRelativePos(nLeftSpace, nUpperSpace);
+ const Point aTopLeft(sdr::legacy::GetSnapRect(*pNewDrawObj).TopLeft());
+ const Point aAnchorPos(sdr::legacy::GetAnchorPos(*pNewDrawObj));
+ sdr::legacy::transformSdrObject(*pNewDrawObj, basegfx::tools::createTranslateB2DHomMatrix(
+ aRelativePos.X() - aTopLeft.X() + aAnchorPos.X(),
+ aRelativePos.Y() - aTopLeft.Y() + aAnchorPos.Y()));
+ }
}
else if( text::VertOrientation::NONE != eVertOri )
{
@@ -386,12 +399,11 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
SdrModel* pModel = pDoc->GetOrCreateDrawModel();
// <--
SdrPage* pPg = pModel->GetPage( 0 );
- pMarquee = SdrObjFactory::MakeNewObject( SdrInventor,
- OBJ_TEXT, pPg, pModel );
+ pMarquee = SdrObjFactory::MakeNewObject( *pModel, SdrObjectCreationInfo(OBJ_TEXT, SdrInventor));
if( !pMarquee )
return;
- pPg->InsertObject( pMarquee );
+ pPg->InsertObjectToSdrObjList(*pMarquee);
if( aId.Len() )
InsertBookmark( aId );
@@ -405,19 +417,19 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
EE_CHAR_START, EE_CHAR_END,
0 };
- SfxItemSet aItemSet( pModel->GetItemPool(), aWhichMap );
- aItemSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aItemSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
+ SfxItemSet aItemSet( pMarquee->GetObjectItemPool(), aWhichMap );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, sal_False ) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_True ) );
aItemSet.Put( SdrTextAniKindItem( eAniKind ) );
aItemSet.Put( SdrTextAniDirectionItem( eAniDir ) );
- aItemSet.Put( SdrTextAniCountItem( nCount ) );
+ aItemSet.Put( SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, nCount ) );
aItemSet.Put( SdrTextAniDelayItem( nDelay ) );
aItemSet.Put( SdrTextAniAmountItem( nAmount ) );
if( SDRTEXTANI_ALTERNATE==eAniKind )
{
// (Nur) Alternate startet und stoppt per default Inside
- aItemSet.Put( SdrTextAniStartInsideItem(sal_True) );
- aItemSet.Put( SdrTextAniStopInsideItem(sal_True) );
+ aItemSet.Put( SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE, sal_True) );
+ aItemSet.Put( SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE, sal_True) );
if( SDRTEXTANI_LEFT==eAniDir )
aItemSet.Put( SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT) );
}
@@ -540,13 +552,13 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
// Die Hoehe ist nur eine Mindest-Hoehe
if( aTwipSz.Height() < MINFLY )
aTwipSz.Height() = MINFLY;
- aItemSet.Put( SdrTextMinFrameHeightItem( aTwipSz.Height() ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, aTwipSz.Height() ) );
pMarquee->SetMergedItemSetAndBroadcast(aItemSet);
if( aTwipSz.Width() < MINFLY )
aTwipSz.Width() = MINFLY;
- pMarquee->SetLogicRect( Rectangle( 0, 0, aTwipSz.Width(), aTwipSz.Height() ) );
+ sdr::legacy::SetLogicRect(*pMarquee, Rectangle( 0, 0, aTwipSz.Width(), aTwipSz.Height() ) );
// und das Objekt in das Dok einfuegen
InsertDrawObject( pMarquee, aSpace, eVertOri, eHoriOri, aStyleItemSet,
@@ -571,9 +583,8 @@ void SwHTMLParser::EndMarquee()
{
// Da es keine fixe Hoehe gibt, das Text-Objekt erstmal breiter
// als den Text machen, damit nicht umgebrochen wird.
- const Rectangle& rOldRect = pMarquee->GetLogicRect();
- pMarquee->SetLogicRect( Rectangle( rOldRect.TopLeft(),
- Size( USHRT_MAX, 240 ) ) );
+ const Rectangle aOldRect(sdr::legacy::GetLogicRect(*pMarquee));
+ sdr::legacy::SetLogicRect(*pMarquee, Rectangle( aOldRect.TopLeft(), Size( USHRT_MAX, 240 ) ) );
}
// den gesammelten Text einfuegen
@@ -608,9 +619,9 @@ void SwHTMLParser::ResizeDrawObject( SdrObject* pObj, SwTwips nWidth )
return;
// die alte Groesse
- const Rectangle& rOldRect = pObj->GetLogicRect();
- Size aNewSz( nWidth, rOldRect.GetSize().Height() );
- pObj->SetLogicRect( Rectangle( rOldRect.TopLeft(), aNewSz ) );
+ const Rectangle aOldRect(sdr::legacy::GetLogicRect(*pObj));
+ Size aNewSz( nWidth, aOldRect.GetSize().Height() );
+ sdr::legacy::SetLogicRect(*pObj, Rectangle( aOldRect.TopLeft(), aNewSz ) );
}
/* */
@@ -739,7 +750,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt,
// LOOP
sal_Int32 nCount =
- ((const SdrTextAniCountItem&)rItemSet.Get( SDRATTR_TEXT_ANICOUNT ))
+ ((const SfxUInt16Item&)rItemSet.Get( SDRATTR_TEXT_ANICOUNT ))
.GetValue();
if( 0==nCount )
nCount = SDRTEXTANI_SLIDE==eAniKind ? 1 : -1;
@@ -771,7 +782,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt,
(((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_scrollamount) += '=')
+= ByteString::CreateFromInt32( nAmount );
- Size aTwipSz( pTextObj->GetLogicRect().GetSize() );
+ Size aTwipSz( sdr::legacy::GetLogicRect(*pTextObj).GetSize() );
if( pTextObj->IsAutoGrowWidth() )
aTwipSz.Width() = 0;
// Die Hoehe ist bei MS eine Mindesthoehe, also geben wir auch die
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 41b83cf376ba..6459b3ff0ebe 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -721,7 +721,7 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha
if ( pDocSh->GetMedium() )
{
// if there is no hidden property in the MediaDescriptor it should be removed after loading
- SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN );
bRemoveHidden = ( pHiddenItem == NULL || !pHiddenItem->GetValue() );
}
@@ -750,7 +750,7 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha
const SdrView* pDrawView = pVSh ? pVSh->GetDrawView() : 0;
- SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, pObj );
+ const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( pObj );
uno::Reference< awt::XControl > xControl;
if ( pDrawView && pVSh->GetWin() )
xControl = pFormObj->GetUnoControl( *pDrawView, *pVSh->GetWin() );
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index dc6f3ec56abe..4196b9ecd75c 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -67,6 +67,7 @@
#include "wrthtml.hxx"
#include "htmlfly.hxx"
#include "htmlform.hxx"
+#include <svx/svdlegacy.hxx>
#include "frmfmt.hxx"
using namespace ::com::sun::star;
@@ -689,7 +690,7 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const SwDrawFrmFmt& rFmt )
if( !pObj || FmFormInventor != pObj->GetObjInventor() )
return 0;
- SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, pObj );
+ const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( pObj );
uno::Reference< awt::XControlModel > xControlModel =
pFormObj->GetUnoControlModel();
@@ -721,7 +722,7 @@ static void GetControlSize( const SdrObject& rSdrObj, Size& rSz,
if( !pVSh )
return;
- SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, &rSdrObj );
+ const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( &rSdrObj );
uno::Reference< awt::XControl > xControl;
SdrView* pDrawView = pVSh->GetDrawView();
ASSERT( pDrawView && pVSh->GetWin(), "no DrawView or window!" );
@@ -745,7 +746,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, &rSdrObject );
+ const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( &rSdrObject );
uno::Reference< awt::XControlModel > xControlModel =
pFormObj->GetUnoControlModel();
@@ -1030,7 +1031,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
sOut = '\"';
}
- Size aTwipSz( rSdrObject.GetLogicRect().GetSize() );
+ Size aTwipSz( sdr::legacy::GetLogicRect(rSdrObject).GetSize() );
Size aPixelSz( 0, 0 );
if( (aTwipSz.Width() || aTwipSz.Height()) &&
Application::GetDefaultDevice() )
@@ -1350,7 +1351,7 @@ static void AddControl( HTMLControls& rControls,
const SdrObject *pSdrObj,
sal_uInt32 nNodeIdx )
{
- SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, pSdrObj );
+ const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( pSdrObj );
ASSERT( pFormObj, "Doch kein FormObj" );
uno::Reference< awt::XControlModel > xControlModel =
pFormObj->GetUnoControlModel();
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 0cb1cbffff9a..2f9c6c8d5f35 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -780,7 +780,7 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
pCNd->EndOfSectionIndex() && !bHasFlysOrMarks )
{
ViewShell *pVSh = CheckActionViewShell();
- SwCrsrShell *pCrsrSh = pVSh && pVSh->ISA(SwCrsrShell)
+ SwCrsrShell *pCrsrSh = pVSh && dynamic_cast< SwCrsrShell* >(pVSh)
? static_cast < SwCrsrShell * >( pVSh )
: 0;
if( pCrsrSh &&
@@ -2481,7 +2481,7 @@ ViewShell *SwHTMLParser::CallStartAction( ViewShell *pVSh, sal_Bool bChkPtr )
if( pActionViewShell )
{
- if( pActionViewShell->ISA( SwEditShell ) )
+ if( dynamic_cast< SwEditShell* >(pActionViewShell) )
((SwEditShell*)pActionViewShell)->StartAction();
else
pActionViewShell->StartAction();
@@ -2514,14 +2514,15 @@ ViewShell *SwHTMLParser::CallEndAction( sal_Bool bChkAction, sal_Bool bChkPtr )
// an allen CrsrEditShells die Cursor auf den Doc-Anfang setzen
ViewShell *pSh = pActionViewShell;
do {
- if( pSh->IsA( TYPE( SwCrsrShell ) ) )
- ((SwCrsrShell*)pSh)->SttEndDoc(sal_True);
+ SwCrsrShell* pSwCrsrShell = dynamic_cast< SwCrsrShell* >(pSh);
+ if( pSwCrsrShell )
+ pSwCrsrShell->SttEndDoc(sal_True);
pSh = (ViewShell *)pSh->GetNext();
} while( pSh != pActionViewShell );
bSetCrsr = sal_False;
}
- if( pActionViewShell->ISA( SwEditShell ) )
+ if( dynamic_cast< SwEditShell* >(pActionViewShell) )
{
//Schon gescrollt?, dann dafuer sorgen, dass die View sich nicht bewegt!
const sal_Bool bOldLock = pActionViewShell->IsViewLocked();
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 0044413163ef..f2afb37ad68e 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -237,32 +237,28 @@ public:
class SW_DLLPUBLIC SwFltBookmark : public SfxPoolItem
{
-private:
friend class SwFltShell; // darf aName und aVal uebersetzen
-
- long mnHandle;
- String maName;
- String maVal;
- bool mbIsTOCBookmark;
-
+ long nHandle;
+ String aName;
+ String aVal;
+ sal_Bool bOnlyRef; // "FRAGE"-Feld, Ref/Seitenrf oder nichts
+ sal_Bool bRef;
+ sal_Bool bPgRef;
public:
- SwFltBookmark( const String& rNa,
- const String& rVa,
- long nHand,
- const bool bIsTOCBookmark = false );
+ SwFltBookmark( const String& rNa, const String& rVa,
+ long nHand, sal_Bool bOnlyR );
SwFltBookmark( const SwFltBookmark& );
-
// "pure virtual Methoden" vom SfxPoolItem
virtual int operator==(const SfxPoolItem&) const;
virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
-
- long GetHandle() const { return mnHandle; }
- const String& GetName() const { return maName; }
- const String& GetValSys() const { return maVal; }
- const bool IsTOCBookmark() const
- {
- return mbIsTOCBookmark;
- }
+ const String& GetName() const { return aName; }
+ const String& GetValSys() const { return aVal; }
+ sal_Bool IsOnlyRef() const { return bOnlyRef; }
+ sal_Bool IsRef() const { return bRef; }
+ void SetRef(sal_Bool b = sal_True) { bRef = b; }
+ sal_Bool IsPgRef() const { return bPgRef; }
+ void SetPgRef(sal_Bool b = sal_True) { bPgRef = b; }
+ long GetHandle() const { return nHandle; }
};
class SW_DLLPUBLIC SwFltTOX : public SfxPoolItem
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 0c44dbb0aa51..57cfd289da86 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -69,6 +69,8 @@
// --> OD, FLR 2006-02-16 #131205#
#include "dcontact.hxx"
// <--
+#include <svx/svdpage.hxx>
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
@@ -507,9 +509,14 @@ void SwRTFParser::SetFlysInDoc()
// in order to set the order number.
// The order number is assumed to be the order of the text flow.
SwFlyDrawContact* pContact =
- new SwFlyDrawContact( pFmt,
- pFmt->GetDoc()->GetOrCreateDrawModel() );
- pContact->GetMaster()->SetOrdNum( n );
+ new SwFlyDrawContact(
+ pFmt,
+ *pFmt->GetDoc()->GetOrCreateDrawModel() );
+ SdrObjList* pObjList = pContact->GetMaster()->getParentOfSdrObject();
+ if(pObjList)
+ {
+ pObjList->SetNavigationPosition(pContact->GetMaster()->GetNavigationPosition(), n);
+ }
// <--
delete pFlySave;
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 29b7d0f89936..a6a1cb57a4ba 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -109,6 +109,8 @@
#include <vcl/salbtype.hxx> // FRound
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
@@ -1236,18 +1238,13 @@ void SwRTFParser::ReadDrawingObject()
}
}
SkipToken(-1);
- /*
- const Point aPointC1( 0, 0 );
- const Point aPointC2( 100, 200 );
- const Point aPointC3( 300, 400 );
- XPolygon aPolygonC(3);
- aPolygonC[0] = aPointC1;
- aPolygonC[1] = aPointC2;
- aPolygonC[2] = aPointC3;
- */
+
if(bPolygonActive && aPolygon.count())
{
- SdrPathObj* pStroke = new SdrPathObj(OBJ_PLIN, ::basegfx::B2DPolyPolygon(aPolygon));
+ SdrModel* pDrawModel = pDoc->GetOrCreateDrawModel();
+ SdrPathObj* pStroke = new SdrPathObj(
+ *pDrawModel,
+ ::basegfx::B2DPolyPolygon(aPolygon));
SfxItemSet aFlySet(pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1);
SwFmtSurround aSur( SURROUND_PARALLEL );
aSur.SetContour( false );
@@ -1304,12 +1301,10 @@ void SwRTFParser::ReadDrawingObject()
SwFmtVertOrient aVert( 0, text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME );
aFlySet.Put( aVert );
- pDoc->GetOrCreateDrawModel();
- SdrModel* pDrawModel = pDoc->GetDrawModel();
SdrPage* pDrawPg = pDrawModel->GetPage(0);
- pDrawPg->InsertObject(pStroke, 0);
+ pDrawPg->InsertObjectToSdrObjList(*pStroke, 0);
- pStroke->SetSnapRect(aRect);
+ sdr::legacy::SetSnapRect(*pStroke, aRect);
/* SwFrmFmt* pRetFrmFmt = */pDoc->Insert(*pPam, *pStroke, &aFlySet, NULL);
}
@@ -1341,8 +1336,8 @@ void SwRTFParser::InsertShpObject(SdrObject* pStroke, int _nZOrder)
pDoc->GetOrCreateDrawModel();
SdrModel* pDrawModel = pDoc->GetDrawModel();
SdrPage* pDrawPg = pDrawModel->GetPage(0);
- pDrawPg->InsertObject(pStroke);
- pDrawPg->SetObjectOrdNum(pStroke->GetOrdNum(), _nZOrder);
+ pDrawPg->InsertObjectToSdrObjList(*pStroke);
+ pDrawPg->SetNavigationPosition(pStroke->GetNavigationPosition(), _nZOrder);
/* SwFrmFmt* pRetFrmFmt = */pDoc->Insert(*pPam, *pStroke, &aFlySet, NULL);
}
@@ -1480,11 +1475,13 @@ void SwRTFParser::ReadShapeObject()
aRange.expand(b);
}
- const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
- SdrRectObj* pStroke = new SdrRectObj(aRect);
+ SdrRectObj* pStroke = new SdrRectObj(
+ *pDoc->GetOrCreateDrawModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRange.getRange(),
+ aRange.getMinimum()));
+
pSdrObject = pStroke;
- pStroke->SetSnapRect(aRect);
- pDoc->GetOrCreateDrawModel(); // create model
InsertShpObject(pStroke, this->nZOrder++);
SfxItemSet aSet(pStroke->GetMergedItemSet());
if (fFilled)
@@ -1510,14 +1507,13 @@ void SwRTFParser::ReadShapeObject()
SvMemoryStream aStream((sal_Char*)bs.GetBuffer(), bs.Len(), STREAM_READ);
rOutliner.Read(aStream, String::CreateFromAscii(""), EE_FORMAT_RTF);
OutlinerParaObject* pParaObject=rOutliner.CreateParaObject();
- pStroke->NbcSetOutlinerParaObject(pParaObject);
+ pStroke->SetOutlinerParaObject(pParaObject);
//delete pParaObject;
rOutliner.Clear();
}
if (txflTextFlow==2) {
long nAngle = 90;
- double a = nAngle*100*nPi180;
- pStroke->Rotate(pStroke->GetCurrentBoundRect().Center(), nAngle*100, sin(a), cos(a) );
+ sdr::legacy::RotateSdrObject(*pStroke, sdr::legacy::GetBoundRect(*pStroke).Center(), nAngle*100 );
}
@@ -1529,9 +1525,10 @@ void SwRTFParser::ReadShapeObject()
aLine.append(aPointLeftTop);
aLine.append(aPointRightBottom);
- SdrPathObj* pStroke = new SdrPathObj(OBJ_PLIN, ::basegfx::B2DPolyPolygon(aLine));
+ SdrPathObj* pStroke = new SdrPathObj(
+ *pDoc->GetOrCreateDrawModel(),
+ ::basegfx::B2DPolyPolygon(aLine));
pSdrObject = pStroke;
- //pStroke->SetSnapRect(aRect);
InsertShpObject(pStroke, this->nZOrder++);
SfxItemSet aSet(pStroke->GetMergedItemSet());
@@ -1550,9 +1547,11 @@ void SwRTFParser::ReadShapeObject()
aRange.expand(aPointRightBottom);
const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
- SdrRectObj* pStroke = new SdrGrafObj(aGrf);
+ SdrRectObj* pStroke = new SdrGrafObj(
+ *pDoc->GetOrCreateDrawModel(),
+ aGrf);
+ sdr::legacy::SetSnapRect(*pStroke, aRect);
pSdrObject = pStroke;
- pStroke->SetSnapRect(aRect);
InsertShpObject(pStroke, this->nZOrder++);
}
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index dd0b66b2cdcb..08371198e34c 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -539,36 +539,40 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
break;
case RES_FLTR_NUMRULE_NUM:
break;
- case RES_FLTR_BOOKMARK:
+ case RES_FLTR_BOOKMARK: // eigentlich nur fuer den Ende-Stack
{
SwFltBookmark* pB = (SwFltBookmark*)pEntry->pAttr;
const String& rName = ((SwFltBookmark*)pEntry->pAttr)->GetName();
if (IsFlagSet(BOOK_TO_VAR_REF))
{
- SwFieldType* pFT = pDoc->GetFldType(RES_SETEXPFLD, rName, false);
- if (!pFT)
+ if (pB->IsPgRef() && !pB->IsRef())
{
- SwSetExpFieldType aS(pDoc, rName, nsSwGetSetExpType::GSE_STRING);
- pFT = pDoc->InsertFldType(aS);
+ // XRefs und Bookmarks sind bereits geUpcased
+ MakeBookRegionOrPoint(pEntry, pDoc, aRegion, sal_True);
+ pDoc->InsertPoolItem(aRegion, SwFmtRefMark(rName), 0);
+ }
+ else if( !pB->IsOnlyRef() )
+ {
+ SwFieldType* pFT = pDoc->GetFldType(RES_SETEXPFLD, rName, false);
+ if (!pFT)
+ { // FieldType anlegen
+ SwSetExpFieldType aS(pDoc, rName, nsSwGetSetExpType::GSE_STRING);
+ pFT = pDoc->InsertFldType(aS);
+ }
+ SwSetExpField aFld((SwSetExpFieldType*)pFT,
+ pB->GetValSys());
+ aFld.SetSubType( nsSwExtendedSubType::SUB_INVISIBLE );
+ MakePoint(pEntry, pDoc, aRegion);
+ pDoc->InsertPoolItem(aRegion, SwFmtFld(aFld), 0);
+ MoveAttrs( *(aRegion.GetPoint()) );
}
- SwSetExpField aFld((SwSetExpFieldType*)pFT, pB->GetValSys());
- aFld.SetSubType( nsSwExtendedSubType::SUB_INVISIBLE );
- MakePoint(pEntry, pDoc, aRegion);
- pDoc->InsertPoolItem(aRegion, SwFmtFld(aFld), 0);
- MoveAttrs( *(aRegion.GetPoint()) );
}
- if ( ( !IsFlagSet(HYPO) || IsFlagSet(BOOK_AND_REF) ) &&
- !pEntry->bConsumedByField )
+ if( !pB->IsOnlyRef() &&
+ ( !IsFlagSet(HYPO) || IsFlagSet(BOOK_AND_REF) ) && !pEntry->bConsumedByField)
{
MakeBookRegionOrPoint(pEntry, pDoc, aRegion, sal_True);
- // #120879# - create a cross reference heading bookmark if appropriate.
- const IDocumentMarkAccess::MarkType eBookmarkType =
- ( pB->IsTOCBookmark() &&
- IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( aRegion ) )
- ? IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK
- : IDocumentMarkAccess::BOOKMARK;
- pDoc->getIDocumentMarkAccess()->makeMark( aRegion, rName, eBookmarkType );
+ pDoc->getIDocumentMarkAccess()->makeMark( aRegion, rName, IDocumentMarkAccess::BOOKMARK);
}
}
break;
@@ -912,39 +916,32 @@ SfxPoolItem* SwFltRedline::Clone( SfxItemPool* ) const
//------ hier stehen die Methoden von SwFltBookmark -----------
SwFltBookmark::SwFltBookmark( const String& rNa, const String& rVa,
- long nHand, const bool bIsTOCBookmark )
- : SfxPoolItem( RES_FLTR_BOOKMARK )
- , mnHandle( nHand )
- , maName( rNa )
- , maVal( rVa )
- , mbIsTOCBookmark( bIsTOCBookmark )
-{
- // eSrc: CHARSET_DONTKNOW fuer keine UEbersetzung bei operator <<
- // Upcase wird immer gemacht.
- // bei XXXStack.NewAttr(...) wird nie eine UEbersetzung vorgenommen.
- // ansonsten: uebergebener Src-Charset fuer aName
- // im Filter eingestellter Src-Charset fuer aVal ( Text )
-
- if ( IsTOCBookmark() )
- {
- maName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
- maName += rNa;
- }
+ long nHand, sal_Bool bOnlyR )
+ : SfxPoolItem(RES_FLTR_BOOKMARK), nHandle(nHand), aName(rNa), aVal(rVa),
+ bOnlyRef(bOnlyR), bRef(sal_False), bPgRef(sal_False)
+{
+ // eSrc: CHARSET_DONTKNOW fuer keine UEbersetzung bei operator <<
+ // Upcase wird immer gemacht.
+ // bei XXXStack.NewAttr(...) wird nie eine UEbersetzung vorgenommen.
+ // ansonsten: uebergebener Src-Charset fuer aName
+ // im Filter eingestellter Src-Charset fuer aVal ( Text )
}
SwFltBookmark::SwFltBookmark(const SwFltBookmark& rCpy)
- : SfxPoolItem( RES_FLTR_BOOKMARK )
- , mnHandle( rCpy.mnHandle )
- , maName( rCpy.maName )
- , maVal( rCpy.maVal )
- , mbIsTOCBookmark( rCpy.mbIsTOCBookmark )
+ : SfxPoolItem(RES_FLTR_BOOKMARK),
+ nHandle(rCpy.nHandle),
+ aName(rCpy.aName),
+ aVal(rCpy.aVal),
+ bOnlyRef(rCpy.bOnlyRef),
+ bRef(rCpy.bRef),
+ bPgRef(rCpy.bPgRef)
{
}
int SwFltBookmark::operator==(const SfxPoolItem& rItem) const
{
- return ( maName == ((SwFltBookmark&)rItem).maName)
- && (mnHandle == ((SwFltBookmark&)rItem).mnHandle);
+ return (aName == ((SwFltBookmark&)rItem).aName)
+ && (nHandle == ((SwFltBookmark&)rItem).nHandle);
}
SfxPoolItem* SwFltBookmark::Clone(SfxItemPool*) const
@@ -1252,8 +1249,8 @@ SwFltShell& SwFltShell::SetStyle( sal_uInt16 nStyle )
SwFltShell& SwFltShell::operator << (SwFltBookmark& aBook)
{
- ConvertUStr( aBook.maName );
- aBook.maVal = QuoteStr(aBook.maVal);
+ ConvertUStr( aBook.aName );
+ aBook.aVal = QuoteStr(aBook.aVal);
aEndStack.NewAttr(*pPaM->GetPoint(), aBook);
return *this;
}
diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx
index 6bbbfdda0edb..63115f95b05a 100644
--- a/sw/source/filter/ww1/w1filter.cxx
+++ b/sw/source/filter/ww1/w1filter.cxx
@@ -351,7 +351,7 @@ void Ww1Bookmarks::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16)
String aVal( rMan.GetText().GetText( Where(), nLen ) );
// in 2 Schritten, da OS/2 zu doof ist
- SwFltBookmark aBook( rName, aVal, GetHandle() );
+ SwFltBookmark aBook( rName, aVal, GetHandle(), sal_False );
rOut << aBook;
}
diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx
index c36de52b90ec..e0002f0924b8 100644
--- a/sw/source/filter/ww8/escher.hxx
+++ b/sw/source/filter/ww8/escher.hxx
@@ -29,6 +29,7 @@
#ifndef _ESCHEREX_HXX
#include <filter/msfilter/escherex.hxx>
#endif
+#include <svx/svdtrans.hxx>
const sal_uInt32 nInlineHack = 0x00010001;
class SwFrmFmt;
@@ -172,8 +173,9 @@ public:
virtual void WriteFrmExtraData(const SwFrmFmt& rFmt);
- EscherExHostAppData* StartShape(const com::sun::star::uno::Reference<
- com::sun::star::drawing::XShape > &, const Rectangle*) {return &aHostData;}
+ virtual EscherExHostAppData* StartShape(
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShape > &,
+ const basegfx::B2DRange* pObjectRange);
private:
//No copying
SwEscherEx(const SwEscherEx&);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index f7c7ccd5a4ba..4153b32d7451 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1497,18 +1497,19 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
const SdrObject* pSdrObj = rFrame.GetFrmFmt().FindRealSdrObject();
if ( pSdrObj )
{
- bool bSwapInPage = false;
- if ( !pSdrObj->GetPage() )
- {
- if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() )
- {
- if ( SdrPage *pPage = pModel->GetPage( 0 ) )
- {
- bSwapInPage = true;
- const_cast< SdrObject* >( pSdrObj )->SetPage( pPage );
- }
- }
- }
+ //bool bSwapInPage = false;
+ //if ( !pSdrObj->getSdrPageFromSdrObject() )
+ //{
+ // if ( SdrModel* pModel = m_rExport.pDoc->GetDrawModel() )
+ // {
+ // if ( SdrPage *pPage = pModel->GetPage( 0 ) )
+ // {
+ // bSwapInPage = true;
+ // //const_cast< SdrObject* >( pSdrObj )->SetPage( pPage );
+ // }
+ // }
+ //}
+ // TTTT: Check if this can be really removed...
m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{");
m_aRunText.append(OOO_STRING_SVTOOLS_RTF_IGNORE);
@@ -1521,8 +1522,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
m_aRunText.append('}');
m_aRunText.append('}');
- if ( bSwapInPage )
- const_cast< SdrObject* >( pSdrObj )->SetPage( 0 );
+ //if ( bSwapInPage )
+ // const_cast< SdrObject* >( pSdrObj )->SetPage( 0 );
}
}
break;
@@ -1536,7 +1537,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
if (pObject && pObject->GetObjInventor() == FmFormInventor)
{
- if (SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObject))
+ if (const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( pObject))
{
uno::Reference< awt::XControlModel > xControlModel =
pFormObj->GetUnoControlModel();
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 224c01b571b1..b756bae5271b 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -475,7 +475,7 @@ sal_Int32 RtfSdrExport::StartShape()
lcl_AppendSP(m_rAttrOutput.RunText(), "wzName", RtfExport::OutString( m_pSdrObject->GetTitle(), m_rExport.eCurrentEncoding));
// now check if we have some text
- const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject);
+ const SdrTextObj* pTxtObj = dynamic_cast< const SdrTextObj* >( m_pSdrObject);
if (pTxtObj)
{
const OutlinerParaObject* pParaObj = 0;
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index b24e724f4be7..067599f74395 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -69,6 +69,7 @@
# endif
# include <unotools/localfilehelper.hxx>
#endif
+#include <svx/svdlegacy.hxx>
using namespace com::sun::star;
using namespace nsSwGetPoolIdFromName;
@@ -247,7 +248,7 @@ namespace sw
meWriterType = eFormControl;
else
meWriterType = eDrawing;
- maSize = pObj->GetSnapRect().GetSize();
+ maSize = sdr::legacy::GetSnapRect(*pObj).GetSize();
}
else
{
diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index 544e73f45abe..2376b549ae00 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -242,7 +242,7 @@ namespace sw
template<class T> const T & item_cast(const SfxPoolItem &rItem)
throw(std::bad_cast)
{
- if (!rItem.IsA(STATICTYPE(T)))
+ if (!dynamic_cast< const T* >(&rItem))
throw std::bad_cast();
return static_cast<const T &>(rItem);
}
@@ -267,7 +267,7 @@ namespace sw
*/
template<class T> const T * item_cast(const SfxPoolItem *pItem)
{
- if (pItem && !pItem->IsA(STATICTYPE(T)))
+ if (pItem && !dynamic_cast< const T* >(pItem))
pItem = 0;
return static_cast<const T *>(pItem);
}
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 3349df196227..ca5d8dc44af9 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -102,6 +102,8 @@
#include <ndtxt.hxx>
// <--
#include "WW8FFData.hxx"
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
#include <editeng/shaditem.hxx>
using namespace com::sun::star;
@@ -119,7 +121,7 @@ bool WW8Export::MiserableFormFieldExportHack(const SwFrmFmt& rFrmFmt)
const SdrObject *pObject = rFrmFmt.FindRealSdrObject();
if (pObject && pObject->GetObjInventor() == FmFormInventor)
{
- if (SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObject))
+ if (const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( pObject))
{
uno::Reference< awt::XControlModel > xControlModel =
pFormObj->GetUnoControlModel();
@@ -517,7 +519,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
ASSERT(pObj, "wo ist das SDR-Object?");
if (pObj)
{
- aRect = pObj->GetSnapRect();
+ aRect = sdr::legacy::GetSnapRect(*pObj);
}
}
@@ -759,7 +761,7 @@ sal_uInt32 WW8Export::GetSdrOrdNum( const SwFrmFmt& rFmt ) const
sal_uInt32 nOrdNum;
const SdrObject* pObj = rFmt.FindRealSdrObject();
if( pObj )
- nOrdNum = pObj->GetOrdNum();
+ nOrdNum = pObj->GetNavigationPosition();
else
{
// no Layout for this format, then recalc the ordnum
@@ -931,15 +933,15 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt)
{
const SvxFieldItem &rField = (const SvxFieldItem &)rHt;
- const SvxFieldData *pFld = rField.GetField();
- if (pFld && pFld->ISA(SvxURLField))
+ const SvxURLField* pFld = dynamic_cast< const SvxURLField* >(rField.GetField());
+
+ if (pFld)
{
sal_uInt8 nOldTxtTyp = m_rExport.nTxtTyp;
m_rExport.nTxtTyp = mnTyp;
- const SvxURLField *pURL = (const SvxURLField *)pFld;
- m_rExport.AttrOutput().StartURL( pURL->GetURL(), pURL->GetTargetFrame() );
+ m_rExport.AttrOutput().StartURL( pFld->GetURL(), pFld->GetTargetFrame() );
- const String &rStr = pURL->GetRepresentation();
+ const String &rStr = pFld->GetRepresentation();
m_rExport.AttrOutput().RawText( rStr, true, GetNodeCharSet() ); // FIXME kendy: is the 'true' actually correct here? It was here before, but... ;-)
m_rExport.AttrOutput().EndURL();
@@ -1106,7 +1108,7 @@ void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr)
void WW8Export::WriteSdrTextObj(const SdrObject& rObj, sal_uInt8 nTyp)
{
- const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, &rObj);
+ const SdrTextObj* pTxtObj = dynamic_cast< const SdrTextObj* >( &rObj);
ASSERT(pTxtObj, "That is no SdrTextObj!");
if (!pTxtObj)
return;
@@ -1267,6 +1269,13 @@ void WW8Export::WriteEscher()
}
}
+EscherExHostAppData* SwEscherEx::StartShape(
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShape > &,
+ const basegfx::B2DRange* /*pObjectRange*/)
+{
+ return &aHostData;
+}
+
void SwEscherEx::WritePictures()
{
if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() )
@@ -1398,25 +1407,26 @@ sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nSh
if ( aUniqueId.Len() )
{
- const MapMode aMap100mm( MAP_100TH_MM );
- Size aSize( aGraphic.GetPrefSize() );
+ basegfx::B2DVector aScale(aGraphic.GetPrefSize().Width(), aGraphic.GetPrefSize().Height());
if ( MAP_PIXEL == aGraphic.GetPrefMapMode().GetMapUnit() )
{
- aSize = Application::GetDefaultDevice()->PixelToLogic(
- aSize, aMap100mm );
+ aScale = Application::GetDefaultDevice()->GetInverseViewTransformation(MapMode(MAP_100TH_MM)) * aScale;
}
else
{
- aSize = OutputDevice::LogicToLogic( aSize,
- aGraphic.GetPrefMapMode(), aMap100mm );
+ aScale *= OutputDevice::GetFactorLogicToLogic(aGraphic.GetPrefMapMode().GetMapUnit(), MAP_100TH_MM);
}
- Point aEmptyPoint = Point();
- Rectangle aRect( aEmptyPoint, aSize );
+ const basegfx::B2DRange aRange(0.0, 0.0, aScale.getX(), aScale.getY());
+
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID(
+ *QueryPictureStream(),
+ aUniqueId,
+ aRange,
+ NULL,
+ 0 );
- sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
- aUniqueId, aRect, NULL, 0 );
if (nBlibId)
aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
}
@@ -1608,24 +1618,26 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush,
if (aUniqueId.Len())
{
const Graphic &rGraphic = pGraphicObject->GetGraphic();
- Size aSize(rGraphic.GetPrefSize());
- const MapMode aMap100mm(MAP_100TH_MM);
+ basegfx::B2DVector aScale(rGraphic.GetPrefSize().Width(), rGraphic.GetPrefSize().Height());
+
if (MAP_PIXEL == rGraphic.GetPrefMapMode().GetMapUnit())
{
- aSize = Application::GetDefaultDevice()->PixelToLogic(
- aSize, aMap100mm);
+ aScale = Application::GetDefaultDevice()->GetInverseViewTransformation(MapMode(MAP_100TH_MM)) * aScale;
}
else
{
- aSize = OutputDevice::LogicToLogic(aSize,
- rGraphic.GetPrefMapMode(), aMap100mm);
+ aScale *= OutputDevice::GetFactorLogicToLogic(rGraphic.GetPrefMapMode().GetMapUnit(), MAP_100TH_MM);
}
- Point aEmptyPoint = Point();
- Rectangle aRect(aEmptyPoint, aSize);
+ const basegfx::B2DRange aRange(0.0, 0.0, aScale.getX(), aScale.getY());
+
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID(
+ *QueryPictureStream(),
+ aUniqueId,
+ aRange,
+ NULL,
+ 0);
- sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
- aUniqueId, aRect, NULL, 0);
if (nBlibId)
rPropOpt.AddOpt(ESCHER_Prop_fillBlip,nBlibId,sal_True);
}
@@ -1895,7 +1907,7 @@ void SwBasicEscherEx::Init()
{
// PPT arbeitet nur mit Einheiten zu 576DPI
// WW hingegen verwendet twips, dh. 1440DPI.
- eMap = pModel->GetScaleUnit();
+ eMap = pModel->GetExchangeObjectUnit();
}
// MS-DFF-Properties sind grossteils in EMU (English Metric Units) angegeben
@@ -2011,23 +2023,23 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
const SdrObject* pSdrObj = rFmt.FindRealSdrObject();
if (pSdrObj)
{
- bool bSwapInPage = false;
- if (!pSdrObj->GetPage())
- {
- if (SdrModel* pModel = rWrt.pDoc->GetDrawModel())
- {
- if (SdrPage *pPage = pModel->GetPage(0))
- {
- bSwapInPage = true;
- (const_cast<SdrObject*>(pSdrObj))->SetPage(pPage);
- }
- }
- }
+// bool bSwapInPage = false;
+// if (!pSdrObj->getSdrPageFromSdrObject())
+// {
+// if (SdrModel* pModel = rWrt.pDoc->GetDrawModel())
+// {
+// if (SdrPage *pPage = pModel->GetPage(0))
+// {
+// bSwapInPage = true;
+// (const_cast<SdrObject*>(pSdrObj))->SetPage(pPage);
+// }
+// }
+// }
nShapeId = AddSdrObject(*pSdrObj);
- if (bSwapInPage)
- (const_cast<SdrObject*>(pSdrObj))->SetPage(0);
+ // if (bSwapInPage)
+ // (const_cast<SdrObject*>(pSdrObj))->SetPage(0);
}
#ifdef DBG_UTIL
else
@@ -2745,12 +2757,18 @@ void SwBasicEscherEx::WriteOLEPicture(EscherPropertyContainer &rPropOpt,
ByteString aId = aGraphicObject.GetUniqueID();
if (aId.Len())
{
- Rectangle aRect = rObj.GetLogicRect();
- aRect.SetPos(Point(0,0));
- aRect.Right() = DrawModelToEmu(aRect.Right());
- aRect.Bottom() = DrawModelToEmu(aRect.Bottom());
- sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
- aId, aRect, pVisArea, 0); // SJ: the fourth parameter (VisArea) should be set..
+ const basegfx::B2DRange aRange(
+ 0.0, 0.0,
+ DrawModelToEmu(basegfx::fround(fabs(rObj.getSdrObjectScale().getX()))),
+ DrawModelToEmu(basegfx::fround(fabs(rObj.getSdrObjectScale().getY()))));
+
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID(
+ *QueryPictureStream(),
+ aId,
+ aRange,
+ pVisArea,
+ 0); // SJ: the fifth parameter (VisArea) should be set..
+
if (nBlibId)
rPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
}
@@ -2764,16 +2782,7 @@ void SwEscherEx::WriteOCXControl( const SwFrmFmt& rFmt, sal_uInt32 nShapeId )
if (const SdrObject* pSdrObj = rFmt.FindRealSdrObject())
{
OpenContainer( ESCHER_SpContainer );
-
- SdrModel *pModel = rWrt.pDoc->GetDrawModel();
- OutputDevice *pDevice = Application::GetDefaultDevice();
- ASSERT(pModel && pDevice, "no model or device");
-
- // #i71538# use complete SdrViews
- // SdrExchangeView aExchange(pModel, pDevice);
- SdrView aExchange(pModel, pDevice);
-
- Graphic aGraphic(aExchange.GetObjGraphic(pModel, pSdrObj));
+ Graphic aGraphic(GetObjGraphic(*pSdrObj));
EscherPropertyContainer aPropOpt;
WriteOLEPicture(aPropOpt, 0xa00 | SHAPEFLAG_OLESHAPE, aGraphic,
@@ -2864,7 +2873,7 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb
if (!rWW8Wrt.bWrtWW8)
return false;
- SdrUnoObj *pFormObj = PTR_CAST(SdrUnoObj,pObj);
+ const SdrUnoObj *pFormObj = dynamic_cast< const SdrUnoObj* >( pObj);
uno::Reference< awt::XControlModel > xControlModel =
pFormObj->GetUnoControlModel();
@@ -2872,7 +2881,7 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb
//I think I painted myself into a little bit of a
//corner by trying to use the uno interface for
//controls export
- Rectangle aRect = pFormObj->GetLogicRect();
+ Rectangle aRect(sdr::legacy::GetLogicRect(*pFormObj));
aRect.SetPos(Point(0,0));
awt::Size aSize;
aSize.Width = TWIPS_TO_MM(aRect.Right());
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 3b80ef9e105c..ec5baafb89b7 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1330,13 +1330,13 @@ short MSWordExportBase::GetDefaultFrameDirection( ) const
{
nDir = TrueFrameDirection( *( const SwFrmFmt * ) pOutFmtNode );
}
- else if ( pOutFmtNode->ISA( SwCntntNode ) ) //pagagraph
+ else if ( dynamic_cast< const SwCntntNode* >(pOutFmtNode) ) //pagagraph
{
const SwCntntNode *pNd = ( const SwCntntNode * ) pOutFmtNode;
SwPosition aPos( *pNd );
nDir = pDoc->GetTextDirection( aPos );
}
- else if ( pOutFmtNode->ISA( SwTxtFmtColl ) )
+ else if ( dynamic_cast< const SwTxtFmtColl* >(pOutFmtNode) )
nDir = FRMDIR_HORI_LEFT_TOP; //what else can we do :-(
}
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index dbaca51a8236..923bb9ed3964 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2016,8 +2016,10 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
rWrt.GetOCXExp().ExportControl(rWrt,&rObj);
rWrt.nTxtTyp = nOldTyp;
}
- else if( rObj.ISA( SdrTextObj ) )
+ else if( dynamic_cast< const SdrTextObj* >(&rObj) )
+ {
rWrt.WriteSdrTextObj(rObj, nTTyp);
+ }
else
{
const SwFrmFmt* pFmt = ::FindFrmFmt( &rObj );
@@ -2200,7 +2202,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp,
// is it an writer or sdr - textbox?
const SdrObject* pObj = (SdrObject*)aCntnt[ i ];
sal_Int32 nCnt = 1;
- if (pObj && !pObj->ISA( SdrTextObj ) )
+ if ( pObj && !dynamic_cast< const SdrTextObj* >(pObj) )
{
// find the "highest" SdrObject of this
const SwFrmFmt& rFmt = *::FindFrmFmt( pObj );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index d072ce7416c8..49630d3fba6e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1917,14 +1917,14 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa
}
}
-static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, const sal_uInt32 nRowSpan)
+static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, long nRowSpan)
{
sal_uInt16 nFlags = 0;
if (nRowSpan > 1)
nFlags |= (3 << 5);
- //else if (nRowSpan < 0)
- // nFlags |= (1 << 5);
+ else if (nRowSpan < 0)
+ nFlags |= (1 << 5);
if (pBox != NULL)
{
@@ -3036,11 +3036,6 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
GatherChapterFields();
CollectOutlineBookmarks(*pDoc);
-
- // make unique OrdNums (Z-Order) for all drawing-/fly Objects
- if ( pDoc->GetDrawModel() )
- pDoc->GetDrawModel()->GetPage( 0 )->RecalcObjOrdNums();
-
ExportDocument_Impl();
if ( mnRedlineMode != pDoc->GetRedlineMode() )
@@ -3053,7 +3048,7 @@ bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec
if ( mpMedium )
{
- SFX_ITEMSET_ARG( mpMedium->GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ SFX_ITEMSET_ARG( mpMedium->GetItemSet(), pEncryptionDataItem, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if ( pEncryptionDataItem && ( pEncryptionDataItem->GetValue() >>= aEncryptionData ) && !rCodec.InitCodec( aEncryptionData ) )
{
OSL_ENSURE( false, "Unexpected EncryptionData!" );
@@ -3063,7 +3058,7 @@ bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec
if ( !aEncryptionData.getLength() )
{
// try to generate the encryption data based on password
- SFX_ITEMSET_ARG( mpMedium->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SFX_ITEMSET_ARG( mpMedium->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD );
if ( pPasswordItem && pPasswordItem->GetValue().Len() && pPasswordItem->GetValue().Len() <= 15 )
{
// Generate random number with a seed of time as salt.
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index c7d1190d91b5..3fa693f777af 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -63,6 +63,7 @@
#include <fmtornt.hxx>
#include <writerfilter/doctok/sprmids.hxx>
+#include <svx/fmmodel.hxx>
#include <doc.hxx>
#include "writerhelper.hxx"
@@ -154,17 +155,24 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
{
// bGraphicNeeded set to true is right / fixes #i51670#.
bGraphicNeeded = true;
- Point aTmpPoint;
- Rectangle aRect( aTmpPoint, Size( nX, nY ) );
Graphic aGraph(aWMF);
ErrCode nErr = ERRCODE_NONE;
- Rectangle aVisArea;
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
if ( pOLENd )
nAspect = pOLENd->GetAspect();
SdrOle2Obj *pRet = SvxMSDffManager::CreateSdrOLEFromStorage(
- rStorageName,xObjStg,pDoc->GetDocStorage(),aGraph,aRect,aVisArea,0,nErr,0,nAspect);
+ *pDoc->GetOrCreateDrawModel(),
+ rStorageName,
+ xObjStg,
+ pDoc->GetDocStorage(),
+ aGraph,
+ basegfx::B2DRange(0.0, 0.0, nX, nY),
+ basegfx::B2DRange(),
+ 0,
+ nErr,
+ 0,
+ nAspect);
if (pRet)
{
@@ -209,7 +217,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
delete pGraphicStream;
}
- delete pRet;
+ deleteSdrObjectSafeAndClearPointer(pRet);
}
}
else
@@ -422,7 +430,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
bool bVert = false;
//The default for word in vertical text mode is to center,
//otherwise a sub/super script hack is employed
- if (pOutFmtNode && pOutFmtNode->ISA(SwCntntNode) )
+ if (pOutFmtNode && dynamic_cast< const SwCntntNode* >(pOutFmtNode) )
{
const SwTxtNode* pTxtNd = (const SwTxtNode*)pOutFmtNode;
SwPosition aPos(*pTxtNd);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index cabe0aed8ff8..2e7fb5a2aa88 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3045,7 +3045,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
void AttributeOutputBase::TextFlyContent( const SwFmtFlyCnt& rFlyContent )
{
- if ( GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwCntntNode ) )
+ if ( GetExport().pOutFmtNode && dynamic_cast< const SwCntntNode* >(GetExport().pOutFmtNode) )
{
SwTxtNode* pTxtNd = (SwTxtNode*)GetExport().pOutFmtNode;
@@ -3385,7 +3385,7 @@ void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
++nNumId;
if ( GetExport().pOutFmtNode )
{
- if ( GetExport().pOutFmtNode->ISA( SwCntntNode ) )
+ if ( dynamic_cast< const SwCntntNode* >(GetExport().pOutFmtNode) )
{
pTxtNd = (SwTxtNode*)GetExport().pOutFmtNode;
@@ -3410,7 +3410,7 @@ void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
nNumId = 0;
}
}
- else if ( GetExport().pOutFmtNode->ISA( SwTxtFmtColl ) )
+ else if ( dynamic_cast< const SwTxtFmtColl* >(GetExport().pOutFmtNode) )
{
const SwTxtFmtColl* pC = (SwTxtFmtColl*)GetExport().pOutFmtNode;
if ( pC && pC->IsAssignedToListLevelOfOutlineStyle() )
@@ -3619,7 +3619,7 @@ void WW8AttributeOutput::TableRowEnd(sal_uInt32 nDepth)
void AttributeOutputBase::FormatPageDescription( const SwFmtPageDesc& rPageDesc )
{
- if ( GetExport().bStyDef && GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwTxtFmtColl ) )
+ if ( GetExport().bStyDef && GetExport().pOutFmtNode && dynamic_cast< const SwTxtFmtColl* >(GetExport().pOutFmtNode) )
{
const SwTxtFmtColl* pC = (SwTxtFmtColl*)GetExport().pOutFmtNode;
if ( (SFX_ITEM_SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.KnowsPageDesc() )
@@ -4560,12 +4560,12 @@ void AttributeOutputBase::ParaLineSpacing( const SvxLineSpacingItem& rSpacing )
sal_uInt16 nScript =
i18n::ScriptType::LATIN;
const SwAttrSet *pSet = 0;
- if ( GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwFmt ) )
+ if ( GetExport().pOutFmtNode && dynamic_cast< const SwFmt* >(GetExport().pOutFmtNode) )
{
const SwFmt *pFmt = (const SwFmt*)( GetExport().pOutFmtNode );
pSet = &pFmt->GetAttrSet();
}
- else if ( GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwTxtNode ) )
+ else if ( GetExport().pOutFmtNode && dynamic_cast< const SwTxtNode* >(GetExport().pOutFmtNode) )
{
const SwTxtNode* pNd = (const SwTxtNode*)GetExport().pOutFmtNode;
pSet = &pNd->GetSwAttrSet();
@@ -4644,12 +4644,12 @@ void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
if ( m_rWW8Export.pOutFmtNode )
{
short nDirection = FRMDIR_HORI_LEFT_TOP;
- if ( m_rWW8Export.pOutFmtNode->ISA( SwTxtNode ) )
+ if ( dynamic_cast< const SwTxtNode* >(m_rWW8Export.pOutFmtNode) )
{
SwPosition aPos(*(const SwCntntNode*)m_rWW8Export.pOutFmtNode);
nDirection = m_rWW8Export.pDoc->GetTextDirection(aPos);
}
- else if ( m_rWW8Export.pOutFmtNode->ISA( SwTxtFmtColl ) )
+ else if ( dynamic_cast< const SwTxtFmtColl* >(m_rWW8Export.pOutFmtNode) )
{
const SwTxtFmtColl* pC =
(const SwTxtFmtColl*)m_rWW8Export.pOutFmtNode;
@@ -4697,14 +4697,14 @@ void WW8AttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDir
nDir = m_rWW8Export.TrueFrameDirection(
*(const SwFrmFmt*)m_rWW8Export.pOutFmtNode );
}
- else if ( m_rWW8Export.pOutFmtNode->ISA( SwCntntNode ) ) //pagagraph
+ else if ( dynamic_cast< const SwCntntNode* >(m_rWW8Export.pOutFmtNode) ) //pagagraph
{
const SwCntntNode* pNd =
(const SwCntntNode*)m_rWW8Export.pOutFmtNode;
SwPosition aPos( *pNd );
nDir = m_rWW8Export.pDoc->GetTextDirection( aPos );
}
- else if ( m_rWW8Export.pOutFmtNode->ISA( SwTxtFmtColl ) )
+ else if ( dynamic_cast< const SwTxtFmtColl* >(m_rWW8Export.pOutFmtNode) )
nDir = FRMDIR_HORI_LEFT_TOP; //what else can we do :-(
}
@@ -4892,9 +4892,8 @@ void SwWW8WrTabu::PutAll(WW8Export& rWrt)
}
-static void ParaTabStopAdd( WW8Export& rWrt,
- const SvxTabStopItem& rTStops,
- const long nLParaMgn )
+static void ParaTabStopAdd( WW8Export& rWrt, const SvxTabStopItem& rTStops,
+ long nLParaMgn )
{
SwWW8WrTabu aTab( 0, rTStops.Count());
@@ -4919,11 +4918,8 @@ bool lcl_IsEqual(long nOneLeft, const SvxTabStop &rOne,
);
}
-static void ParaTabStopDelAdd( WW8Export& rWrt,
- const SvxTabStopItem& rTStyle,
- const long nLStypeMgn,
- const SvxTabStopItem& rTNew,
- const long nLParaMgn )
+static void ParaTabStopDelAdd( WW8Export& rWrt, const SvxTabStopItem& rTStyle,
+ long nLStypeMgn, const SvxTabStopItem& rTNew, long nLParaMgn )
{
SwWW8WrTabu aTab(rTStyle.Count(), rTNew.Count());
@@ -4999,15 +4995,15 @@ static void ParaTabStopDelAdd( WW8Export& rWrt,
void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
{
- const bool bTabsRelativeToIndex = m_rWW8Export.pCurPam->GetDoc()->get( IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT );
-
+ bool bTabsRelativeToIndex = m_rWW8Export.pCurPam->GetDoc()->get( IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT );
long nCurrentLeft = 0;
+
if ( bTabsRelativeToIndex )
{
const SfxPoolItem* pLR = m_rWW8Export.HasItem( RES_LR_SPACE );
if ( pLR != NULL )
- nCurrentLeft = static_cast<const SvxLRSpaceItem*>(pLR)->GetTxtLeft();
+ nCurrentLeft = ((const SvxLRSpaceItem*)pLR)->GetTxtLeft();
}
// --> FLR 2009-03-17 #i100264#
@@ -5015,51 +5011,42 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
m_rWW8Export.pCurrentStyle != NULL &&
m_rWW8Export.pCurrentStyle->DerivedFrom() != NULL )
{
- SvxTabStopItem aParentTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
+ SvxTabStopItem aTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
const SwFmt *pParentStyle = m_rWW8Export.pCurrentStyle->DerivedFrom();
+ const SvxTabStopItem* pParentTabs = HasItem<SvxTabStopItem>( pParentStyle->GetAttrSet(), RES_PARATR_TABSTOP );
+ if ( pParentTabs )
{
- const SvxTabStopItem* pParentTabs = HasItem<SvxTabStopItem>( pParentStyle->GetAttrSet(), RES_PARATR_TABSTOP );
- if ( pParentTabs )
- {
- aParentTabs.Insert( pParentTabs );
- }
- }
-
- // #120938# - consider left indentation of style and its parent style
- long nParentLeft = 0;
- if ( bTabsRelativeToIndex )
- {
- const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>( pParentStyle->GetAttrSet(), RES_LR_SPACE );
- nParentLeft = rStyleLR.GetTxtLeft();
+ aTabs.Insert( pParentTabs );
}
- ParaTabStopDelAdd( m_rWW8Export, aParentTabs, nParentLeft, rTabStops, nCurrentLeft );
+ ParaTabStopDelAdd( m_rWW8Export, aTabs, 0, rTabStops, 0 );
return;
}
// <--
+ // StyleDef -> "einfach" eintragen || keine Style-Attrs -> dito
const SvxTabStopItem* pStyleTabs = 0;
if ( !m_rWW8Export.bStyDef && m_rWW8Export.pStyAttr )
{
- pStyleTabs = HasItem<SvxTabStopItem>( *m_rWW8Export.pStyAttr, RES_PARATR_TABSTOP );
+ pStyleTabs =
+ HasItem<SvxTabStopItem>( *m_rWW8Export.pStyAttr, RES_PARATR_TABSTOP );
}
if ( !pStyleTabs )
- {
ParaTabStopAdd(m_rWW8Export, rTabStops, nCurrentLeft);
- }
else
{
long nStyleLeft = 0;
- if ( bTabsRelativeToIndex )
+
+ if (bTabsRelativeToIndex)
{
- const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>(*m_rWW8Export.pStyAttr, RES_LR_SPACE);
+ const SvxLRSpaceItem &rStyleLR =
+ ItemGet<SvxLRSpaceItem>(*m_rWW8Export.pStyAttr, RES_LR_SPACE);
nStyleLeft = rStyleLR.GetTxtLeft();
}
- ParaTabStopDelAdd( m_rWW8Export,
- *pStyleTabs, nStyleLeft,
- rTabStops, nCurrentLeft);
+ ParaTabStopDelAdd(m_rWW8Export, *pStyleTabs, nStyleLeft, rTabStops,
+ nCurrentLeft);
}
}
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 7db272710fd5..961c221267d9 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -96,6 +96,8 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <editeng/editobj.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
#include <math.h>
@@ -236,9 +238,9 @@ static void SetStdAttr( SfxItemSet& rSet, WW8_DP_LINETYPE& rL,
}
}
if( SVBT16ToShort( rSh.shdwpi ) ){ // Schatten
- rSet.Put(SdrShadowItem(true));
- rSet.Put( SdrShadowXDistItem( SVBT16ToShort( rSh.xaOffset ) ) );
- rSet.Put( SdrShadowYDistItem( SVBT16ToShort( rSh.yaOffset ) ) );
+ rSet.Put(SdrOnOffItem(SDRATTR_SHADOW, true));
+ rSet.Put( SdrMetricItem(SDRATTR_SHADOWXDIST, SVBT16ToShort( rSh.xaOffset ) ) );
+ rSet.Put( SdrMetricItem(SDRATTR_SHADOWYDIST, SVBT16ToShort( rSh.yaOffset ) ) );
}
}
@@ -344,7 +346,9 @@ SdrObject* SwWW8ImplReader::ReadLine( WW8_DPHEAD* pHd, const WW8_DO* pDo,
::basegfx::B2DPolygon aPolygon;
aPolygon.append(::basegfx::B2DPoint(aP[0].X(), aP[0].Y()));
aPolygon.append(::basegfx::B2DPoint(aP[1].X(), aP[1].Y()));
- SdrObject* pObj = new SdrPathObj(OBJ_LINE, ::basegfx::B2DPolyPolygon(aPolygon));
+ SdrObject* pObj = new SdrPathObj(
+ *pDrawModel,
+ ::basegfx::B2DPolyPolygon(aPolygon));
SetStdAttr( rSet, aLine.aLnt, aLine.aShd );
SetLineEndAttr( rSet, aLine.aEpp, aLine.aLnt );
@@ -366,7 +370,11 @@ SdrObject* SwWW8ImplReader::ReadRect( WW8_DPHEAD* pHd, const WW8_DO* pDo,
aP1.X() += (sal_Int16)SVBT16ToShort( pHd->dxa );
aP1.Y() += (sal_Int16)SVBT16ToShort( pHd->dya );
- SdrObject* pObj = new SdrRectObj( Rectangle( aP0, aP1 ) );
+ SdrObject* pObj = new SdrRectObj(
+ *pDrawModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aP1.X() - aP0.X(), aP1.Y() - aP0.Y(),
+ aP0.X(), aP0.Y()));
SetStdAttr( rSet, aRect.aLnt, aRect.aShd );
SetFill( rSet, aRect.aFill );
@@ -388,7 +396,12 @@ SdrObject* SwWW8ImplReader::ReadElipse( WW8_DPHEAD* pHd, const WW8_DO* pDo,
aP1.X() += (sal_Int16)SVBT16ToShort( pHd->dxa );
aP1.Y() += (sal_Int16)SVBT16ToShort( pHd->dya );
- SdrObject* pObj = new SdrCircObj( OBJ_CIRC, Rectangle( aP0, aP1 ) );
+ SdrObject* pObj = new SdrCircObj(
+ *pDrawModel,
+ CircleType_Circle,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aP1.X() - aP0.X(), aP1.Y() - aP0.Y(),
+ aP0.X(), aP0.Y()));
SetStdAttr( rSet, aElipse.aLnt, aElipse.aShd );
SetFill( rSet, aElipse.aFill );
@@ -422,8 +435,19 @@ SdrObject* SwWW8ImplReader::ReadArc( WW8_DPHEAD* pHd, const WW8_DO* pDo,
aP1.X() -= (sal_Int16)SVBT16ToShort( pHd->dxa );
}
- SdrObject* pObj = new SdrCircObj( OBJ_SECT, Rectangle( aP0, aP1 ),
- nW * 9000, ( ( nW + 1 ) & 3 ) * 9000 );
+ const sal_Int32 nOldStart(nW * 9000);
+ const sal_Int32 nOldEnd(( ( nW + 1 ) & 3 ) * 9000);
+ const double fStart((((36000 - nOldStart) % 36000) * F_PI) / 18000.0);
+ const double fEnd((((36000 - nOldEnd) % 36000) * F_PI) / 18000.0);
+
+ SdrObject* pObj = new SdrCircObj(
+ *pDrawModel,
+ CircleType_Sector,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aP1.X() - aP0.X(), aP1.Y() - aP0.Y(),
+ aP0.X(), aP0.Y()),
+ fStart, // TTTT angles have to be tested
+ fEnd);
SetStdAttr( rSet, aArc.aLnt, aArc.aShd );
SetFill( rSet, aArc.aFill );
@@ -455,7 +479,9 @@ SdrObject* SwWW8ImplReader::ReadPolyLine( WW8_DPHEAD* pHd, const WW8_DO* pDo,
}
delete[] pP;
- SdrObject* pObj = new SdrPathObj(( SVBT16ToShort( aPoly.aBits1 ) & 0x1 ) ? OBJ_POLY : OBJ_PLIN, ::basegfx::B2DPolyPolygon(aP.getB2DPolygon()));
+ SdrObject* pObj = new SdrPathObj(
+ *pDrawModel,
+ ::basegfx::B2DPolyPolygon(aP.getB2DPolygon()));
SetStdAttr( rSet, aPoly.aLnt, aPoly.aShd );
SetFill( rSet, aPoly.aFill );
@@ -1067,7 +1093,7 @@ SwFrmFmt* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
if( bObj )
{
if( bMakeSdrGrafObj && pTextObj &&
- pTextObj->GetUpGroup() )
+ pTextObj->GetParentSdrObject() )
{
// SdrOleObj/SdrGrafObj anstatt des
// SdrTextObj in dessen Gruppe einsetzen
@@ -1077,18 +1103,20 @@ SwFrmFmt* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
if( !pNew )
{
- pNew = new SdrGrafObj;
- ((SdrGrafObj*)pNew)->SetGraphic(aGraph);
+ pNew = new SdrGrafObj(
+ *pDrawModel,
+ aGraph);
+// ((SdrGrafObj*)pNew)->SetGraphic(aGraph);
}
GrafikCtor();
- pNew->SetModel( pDrawModel );
- pNew->SetLogicRect( pTextObj->GetCurrentBoundRect() );
+ // copy transformation and layer
+ pNew->setSdrObjectTransformation(pTextObj->getSdrObjectTransformation());
pNew->SetLayer( pTextObj->GetLayer() );
- pTextObj->GetUpGroup()->GetSubList()->
- ReplaceObject(pNew, pTextObj->GetOrdNum());
+ pTextObj->GetParentSdrObject()->getChildrenOfSdrObject()->ReplaceObjectInSdrObjList(
+ *pNew, pTextObj->GetNavigationPosition());
}
else
pFlyFmt = ImportOle();
@@ -1163,7 +1191,7 @@ SwFrmFmt* SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
pOp->SetOutlinerMode( OUTLINERMODE_TEXTOBJECT );
pOp->SetVertical( bVertical );
delete pTemporaryText;
- pTextObj->NbcSetOutlinerParaObject( pOp );
+ pTextObj->SetOutlinerParaObject( pOp );
pTextObj->SetVerticalWriting(bVertical);
// Fuer die naechste Textbox noch die alten Absatz-Attribute
@@ -1209,27 +1237,33 @@ SdrObject* SwWW8ImplReader::ReadTxtBox( WW8_DPHEAD* pHd, const WW8_DO* pDo,
aP1.X() += (sal_Int16)SVBT16ToShort( pHd->dxa );
aP1.Y() += (sal_Int16)SVBT16ToShort( pHd->dya );
- SdrObject* pObj = new SdrRectObj( OBJ_TEXT, Rectangle( aP0, aP1 ) );
- pObj->SetModel( pDrawModel );
- pObj->NbcSetSnapRect(Rectangle(aP0, aP1));
+ SdrObject* pObj = new SdrRectObj(
+ *pDrawModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aP1.X() - aP0.X(), aP1.Y() - aP0.Y(),
+ aP0.X(), aP0.Y()),
+ OBJ_TEXT,
+ true);
+
+ sdr::legacy::SetSnapRect(*pObj, Rectangle(aP0, aP1));
Size aSize( (sal_Int16)SVBT16ToShort( pHd->dxa ) ,
(sal_Int16)SVBT16ToShort( pHd->dya ) );
long nStartCpFly,nEndCpFly;
bool bContainsGraphics;
- InsertTxbxText(PTR_CAST(SdrTextObj,pObj), &aSize, 0, 0, 0, 0, false,
+ InsertTxbxText(dynamic_cast< SdrTextObj* >( pObj), &aSize, 0, 0, 0, 0, false,
bDummy,0,&nStartCpFly,&nEndCpFly,&bContainsGraphics);
SetStdAttr( rSet, aTxtB.aLnt, aTxtB.aShd );
SetFill( rSet, aTxtB.aFill );
rSet.Put( SdrTextFitToSizeTypeItem( SDRTEXTFIT_NONE ) );
- rSet.Put( SdrTextAutoGrowWidthItem(false));
- rSet.Put( SdrTextAutoGrowHeightItem(false));
- rSet.Put( SdrTextLeftDistItem( MIN_BORDER_DIST*2 ) );
- rSet.Put( SdrTextRightDistItem( MIN_BORDER_DIST*2 ) );
- rSet.Put( SdrTextUpperDistItem( MIN_BORDER_DIST ) );
- rSet.Put( SdrTextLowerDistItem( MIN_BORDER_DIST ) );
+ rSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
+ rSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, MIN_BORDER_DIST*2 ) );
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, MIN_BORDER_DIST*2 ) );
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, MIN_BORDER_DIST ) );
+ rSet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, MIN_BORDER_DIST ) );
return pObj;
}
@@ -1259,7 +1293,7 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox( WW8_DPHEAD* pHd, const WW8_DO* pDo,
Point aP1( aP0 );
aP1.X() += (sal_Int16)SVBT16ToShort( aCallB.dpheadTxbx.dxa );
aP1.Y() += (sal_Int16)SVBT16ToShort( aCallB.dpheadTxbx.dya );
- Point aP2( (sal_Int16)SVBT16ToShort( pHd->xa )
+ const basegfx::B2DPoint aP2( (sal_Int16)SVBT16ToShort( pHd->xa )
+ (sal_Int16)SVBT16ToShort( aCallB.dpheadPolyLine.xa )
+ nDrawXOfs2 + (sal_Int16)SVBT16ToShort( pP[0] ),
(sal_Int16)SVBT16ToShort( pHd->ya )
@@ -1267,9 +1301,15 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox( WW8_DPHEAD* pHd, const WW8_DO* pDo,
+ nDrawYOfs2 + (sal_Int16)SVBT16ToShort( pP[1] ) );
delete[] pP;
- SdrCaptionObj* pObj = new SdrCaptionObj( Rectangle( aP0, aP1 ), aP2 );
- pObj->SetModel( pDrawModel );
- pObj->NbcSetSnapRect(Rectangle(aP0, aP1));
+ SdrCaptionObj* pObj = new SdrCaptionObj(
+ *pDrawModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aP1.X() - aP0.X(), aP1.Y() - aP0.Y(),
+ aP0.X(), aP0.Y()),
+ &aP2 );
+
+ //pObj->SetModel( pDrawModel );
+ sdr::legacy::SetSnapRect(*pObj, Rectangle(aP0, aP1));
Size aSize( (sal_Int16)SVBT16ToShort( aCallB.dpheadTxbx.dxa ),
(sal_Int16)SVBT16ToShort( aCallB.dpheadTxbx.dya ) );
bool bEraseThisObject;
@@ -1302,20 +1342,17 @@ SdrObject *SwWW8ImplReader::ReadGroup( WW8_DPHEAD* pHd, const WW8_DO* pDo,
nDrawXOfs = nDrawXOfs + (sal_Int16)SVBT16ToShort( pHd->xa );
nDrawYOfs = nDrawYOfs + (sal_Int16)SVBT16ToShort( pHd->ya );
- SdrObject* pObj = new SdrObjGroup;
-
+ SdrObjGroup* pSdrObjGroup = new SdrObjGroup(*pDrawModel);
short nLeft = (sal_Int16)SVBT16ToShort( pHd->cb ) - sizeof( WW8_DPHEAD );
+
for (int i = 0; i < nGrouped; i++)
{
- SfxAllItemSet aSet(pDrawModel->GetItemPool());
+ SfxAllItemSet aSet(pSdrObjGroup->GetObjectItemPool());
+
if (SdrObject *pObject = ReadGrafPrimitive(nLeft, pDo, aSet))
{
- // #116150#
// first add and then set ItemSet
- SdrObjList *pSubGroup = pObj->GetSubList();
- ASSERT(pSubGroup, "Why no sublist available?");
- if (pSubGroup)
- pSubGroup->InsertObject(pObject, 0);
+ pSdrObjGroup->InsertObjectToSdrObjList(*pObject, 0);
pObject->SetMergedItemSetAndBroadcast(aSet);
}
}
@@ -1323,7 +1360,7 @@ SdrObject *SwWW8ImplReader::ReadGroup( WW8_DPHEAD* pHd, const WW8_DO* pDo,
nDrawXOfs = nDrawXOfs - (sal_Int16)SVBT16ToShort( pHd->xa );
nDrawYOfs = nDrawYOfs - (sal_Int16)SVBT16ToShort( pHd->ya );
- return pObj;
+ return pSdrObjGroup;
}
SdrObject* SwWW8ImplReader::ReadGrafPrimitive( short& rLeft, const WW8_DO* pDo,
@@ -1398,9 +1435,11 @@ void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp )
pStrm->Read( &aDo, sizeof( WW8_DO ) );
short nLeft = SVBT16ToShort( aDo.cb ) - sizeof( WW8_DO );
+
while (nLeft > static_cast<short>(sizeof(WW8_DPHEAD)))
{
- SfxAllItemSet aSet( pDrawModel->GetItemPool() );
+ SfxAllItemSet aSet(GetDoc().GetOrCreateDrawModel()->GetItemPool());
+
if (SdrObject *pObject = ReadGrafPrimitive( nLeft, &aDo, aSet ))
{
pWWZOrder->InsertDrawingObject(pObject, SVBT16ToShort(aDo.dhgt));
@@ -1783,18 +1822,17 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
if( 0 < rInnerDist.Bottom() )
aBox.SetDistance( (sal_uInt16)rInnerDist.Bottom(), BOX_LINE_BOTTOM );
- bool bFixSize = !(WW8ITEMVALUE(rOldSet, SDRATTR_TEXT_AUTOGROWHEIGHT,
- SdrTextAutoGrowHeightItem));
+ bool bFixSize = !(WW8ITEMVALUE(rOldSet, SDRATTR_TEXT_AUTOGROWHEIGHT, SdrOnOffItem));
// Size: SwFmtFrmSize
if( SFX_ITEM_SET != rFlySet.GetItemState(RES_FRM_SIZE, false) )
{
- const Rectangle& rSnapRect = pSdrObj->GetSnapRect();
+ const Rectangle aSnapRect(sdr::legacy::GetSnapRect(*pSdrObj));
// if necessary adapt width and position of the framework: The
// recorded interior is to remain equally large despite thick edges.
rFlySet.Put( SwFmtFrmSize(bFixSize ? ATT_FIX_SIZE : ATT_VAR_SIZE,
- rSnapRect.GetWidth() + 2*nOutside,
- rSnapRect.GetHeight() + 2*nOutside) );
+ aSnapRect.GetWidth() + 2*nOutside,
+ aSnapRect.GetHeight() + 2*nOutside) );
}
else //If a size is set, adjust it to consider border thickness
{
@@ -1826,18 +1864,16 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
rFlySet.Put( aBox );
// Schattenwurf der Box: SvxShadowItem
- if( WW8ITEMVALUE(rOldSet, SDRATTR_SHADOW, SdrShadowItem) )
+ if( WW8ITEMVALUE(rOldSet, SDRATTR_SHADOW, SdrOnOffItem) )
{
SvxShadowItem aShadow( RES_SHADOW );
- const Color aShdColor = static_cast< SdrShadowColorItem const & >(
+ const Color aShdColor = static_cast< XColorItem const & >(
rOldSet.Get(SDRATTR_SHADOWCOLOR)).GetColorValue();
const sal_Int32 nShdDistX = WW8ITEMVALUE(rOldSet, SDRATTR_SHADOWXDIST,
- SdrShadowXDistItem);
+ SdrMetricItem);
const sal_Int32 nShdDistY = WW8ITEMVALUE(rOldSet, SDRATTR_SHADOWYDIST,
- SdrShadowYDistItem);
- //const sal_uInt16 nShdTrans= WW8ITEMVALUE(rOldSet,
- // SDRATTR_SHADOWTRANSPARENCE, SdrShadowTransparenceItem);
+ SdrMetricItem);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
@@ -2203,11 +2239,11 @@ SdrObject* SwWW8ImplReader::CreateContactObject(SwFrmFmt* pFlyFmt)
SdrObject* pNewObject = mbNewDoc ? 0 : pFlyFmt->FindRealSdrObject();
if (!pNewObject)
pNewObject = pFlyFmt->FindSdrObject();
- if (!pNewObject && pFlyFmt->ISA(SwFlyFrmFmt))
+ if (!pNewObject && dynamic_cast< SwFlyFrmFmt* >(pFlyFmt))
{
- SwFlyDrawContact* pContactObject
- = new SwFlyDrawContact(static_cast<SwFlyFrmFmt*>(pFlyFmt),
- pDrawModel);
+ SwFlyDrawContact* pContactObject = new SwFlyDrawContact(
+ static_cast<SwFlyFrmFmt*>(pFlyFmt),
+ *pDrawModel);
pNewObject = pContactObject->GetMaster();
}
return pNewObject;
@@ -2573,8 +2609,8 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
pMSDffManager->SetModel(pDrawModel, 1440);
- Rectangle aRect(pF->nXaLeft, pF->nYaTop, pF->nXaRight, pF->nYaBottom);
- SvxMSDffImportData aData( aRect );
+ const basegfx::B2DRange aRange(pF->nXaLeft, pF->nYaTop, pF->nXaRight, pF->nYaBottom);
+ SvxMSDffImportData aData( aRange );
/*
#i20540#
@@ -2821,7 +2857,7 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
}
// --> OD 2005-03-11 #i44344#, #i44681# - positioning attributes already set
- if ( pRetFrmFmt /*#i52825# */ && pRetFrmFmt->ISA(SwDrawFrmFmt) )
+ if ( pRetFrmFmt /*#i52825# */ && dynamic_cast< SwDrawFrmFmt* >(pRetFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(pRetFrmFmt)->PosAttrSet();
}
@@ -2865,43 +2901,44 @@ SwFrmFmt* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject,
SdrTextObj* pSdrTextObj;
// Pruefen, ob Gruppenobjekt (z.B. zwei Klammern) vorliegt
- if (SdrObjGroup* pThisGroup = PTR_CAST(SdrObjGroup, pRecord->pObj))
+ if (SdrObjGroup* pThisGroup = dynamic_cast< SdrObjGroup* >( pRecord->pObj))
{
// Gruppenobjekte haben keinen Text. Fuege ein Textobjekt in die
// Gruppe ein, um den Text zu halten.
- pSdrTextObj = new SdrRectObj( OBJ_TEXT, pThisGroup->GetCurrentBoundRect());
+ pSdrTextObj = new SdrRectObj(
+ *pDrawModel,
+ pThisGroup->getSdrObjectTransformation(),
+ OBJ_TEXT,
+ true);
- SfxItemSet aSet(pDrawModel->GetItemPool());
+ SfxItemSet aSet(pSdrTextObj->GetObjectItemPool());
aSet.Put(XFillStyleItem(XFILL_NONE));
aSet.Put(XLineStyleItem(XLINE_NONE));
aSet.Put(SdrTextFitToSizeTypeItem( SDRTEXTFIT_NONE ));
- aSet.Put(SdrTextAutoGrowHeightItem(false));
- aSet.Put(SdrTextAutoGrowWidthItem(false));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false));
pSdrTextObj->SetMergedItemSet(aSet);
long nAngle = pRecord->nTextRotationAngle;
if ( nAngle )
{
- double a = nAngle*nPi180;
- pSdrTextObj->NbcRotate(pSdrTextObj->GetCurrentBoundRect().Center(), nAngle,
- sin(a), cos(a) );
+ sdr::legacy::RotateSdrObject(*pSdrTextObj, sdr::legacy::GetBoundRect(*pSdrTextObj).Center(), nAngle);
}
- pSdrTextObj->NbcSetLayer( pThisGroup->GetLayer() );
- pThisGroup->GetSubList()->NbcInsertObject(pSdrTextObj);
+ pSdrTextObj->SetLayer(pThisGroup->GetLayer());
+ pThisGroup->InsertObjectToSdrObjList(*pSdrTextObj);
}
else
- pSdrTextObj = PTR_CAST(SdrTextObj, pRecord->pObj);
+ pSdrTextObj = dynamic_cast< SdrTextObj* >( pRecord->pObj);
if( pSdrTextObj )
{
- Size aObjSize(pSdrTextObj->GetSnapRect().GetWidth(),
- pSdrTextObj->GetSnapRect().GetHeight());
+ Size aObjSize(sdr::legacy::GetSnapRect(*pSdrTextObj).GetSize());
// Objekt ist Bestandteil einer Gruppe?
- SdrObject* pGroupObject = pSdrTextObj->GetUpGroup();
+ SdrObjGroup* pGroupObject = dynamic_cast< SdrObjGroup* >(pSdrTextObj->GetParentSdrObject());
- sal_uInt32 nOrdNum = pSdrTextObj->GetOrdNum();
+ sal_uInt32 nOrdNum = pSdrTextObj->GetNavigationPosition();
bool bEraseThisObject;
InsertTxbxText( pSdrTextObj, &aObjSize, pRecord->aTextId.nTxBxS,
pRecord->aTextId.nSequence, nGrafAnchorCp, pRetFrmFmt,
@@ -2917,13 +2954,13 @@ SwFrmFmt* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject,
// durch ein neues SdrGrafObj ersetzt.
SdrObject* pNewObj = pGroupObject ?
- pGroupObject->GetSubList()->GetObj(nOrdNum) : pTrueObject;
+ pGroupObject->GetObj(nOrdNum) : pTrueObject;
if (pSdrTextObj != pNewObj)
{
// Objekt in der Z-Order-Liste ersetzen
pMSDffManager->ExchangeInShapeOrder(pSdrTextObj, 0,0, pNewObj);
// Objekt jetzt noch loeschen
- SdrObject::Free( pRecord->pObj );
+ deleteSdrObjectSafeAndClearPointer( pRecord->pObj );
// und das neue Objekt merken.
pRecord->pObj = pNewObj;
}
@@ -2933,8 +2970,8 @@ SwFrmFmt* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject,
// Objekt aus der Z-Order-Liste loeschen
pMSDffManager->RemoveFromShapeOrder( pSdrTextObj );
// Objekt aus der Drawing-Page rausnehmen
- if( pSdrTextObj->GetPage() )
- pDrawPg->RemoveObject( pSdrTextObj->GetOrdNum() );
+ if( pSdrTextObj->getSdrPageFromSdrObject() )
+ pDrawPg->RemoveObjectFromSdrObjList( pSdrTextObj->GetNavigationPosition() );
// und FrameFormat entfernen, da durch Grafik ersetzt (dies
// loescht auch das Objekt)
rDoc.DelFrmFmt( pRetFrmFmt );
@@ -2946,12 +2983,12 @@ SwFrmFmt* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject,
else
{
// ww8-default Randabstand einsetzen
- SfxItemSet aItemSet(pDrawModel->GetItemPool(),
+ SfxItemSet aItemSet(pSdrTextObj->GetObjectItemPool(),
SDRATTR_TEXT_LEFTDIST, SDRATTR_TEXT_LOWERDIST);
- aItemSet.Put( SdrTextLeftDistItem( pRecord->nDxTextLeft ) );
- aItemSet.Put( SdrTextRightDistItem( pRecord->nDxTextRight ) );
- aItemSet.Put( SdrTextUpperDistItem( pRecord->nDyTextTop ) );
- aItemSet.Put( SdrTextLowerDistItem( pRecord->nDyTextBottom ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, pRecord->nDxTextLeft ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, pRecord->nDxTextRight ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, pRecord->nDyTextTop ) );
+ aItemSet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, pRecord->nDyTextBottom ) );
pSdrTextObj->SetMergedItemSetAndBroadcast(aItemSet);
}
}
@@ -2989,7 +3026,7 @@ SwFlyFrmFmt* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject,
pRecord->eShapeType, aInnerDist );
- SdrTextObj *pSdrTextObj = PTR_CAST(SdrTextObj, rpObject);
+ SdrTextObj *pSdrTextObj = dynamic_cast< SdrTextObj* >( rpObject);
if (pSdrTextObj && pSdrTextObj->IsVerticalWriting())
rFlySet.Put(SvxFrameDirectionItem(FRMDIR_VERT_TOP_RIGHT, RES_FRAMEDIR));
@@ -3005,7 +3042,7 @@ SwFlyFrmFmt* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject,
pMSDffManager->RemoveFromShapeOrder( rpObject );
// und das Objekt loeschen
- SdrObject::Free( rpObject );
+ deleteSdrObjectSafeAndClearPointer( rpObject );
/*
Achtung: ab jetzt nur noch pOrgShapeObject
abfragen!
@@ -3032,7 +3069,7 @@ SwFlyFrmFmt* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject,
// Das Kontakt-Objekt MUSS in die Draw-Page gesetzt werden, damit
// in SwWW8ImplReader::LoadDoc1() die Z-Order festgelegt werden
// kann !!!
- if (!rpOurNewObject->IsInserted())
+ if (!rpOurNewObject->IsObjectInserted())
{
// --> OD 2004-12-13 #117915# - pass information, if object
// is in page header|footer to method.
@@ -3166,11 +3203,11 @@ SwFlyFrmFmt* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObject,
// altes Objekt aus der Z-Order-Liste entfernen
pMSDffManager->RemoveFromShapeOrder( rpObject );
// aus der Drawing-Page rausnehmen
- if( rpObject->GetPage() )
- pDrawPg->RemoveObject( rpObject->GetOrdNum() );
+ if( rpObject->getSdrPageFromSdrObject() )
+ pDrawPg->RemoveObjectFromSdrObjList( rpObject->GetNavigationPosition() );
// und das Objekt loeschen
- SdrObject::Free( rpObject );
+ deleteSdrObjectSafeAndClearPointer( rpObject );
/*
Achtung: ab jetzt nur noch pOrgShapeObject abfragen!
*/
@@ -3183,7 +3220,7 @@ SwFlyFrmFmt* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObject,
// Das Kontakt-Objekt MUSS in die Draw-Page gesetzt werden, damit in
// SwWW8ImplReader::LoadDoc1() die Z-Order festgelegt werden kann !!!
- if (!rpOurNewObject->IsInserted())
+ if (!rpOurNewObject->IsObjectInserted())
{
// --> OD 2004-12-13 #117915# - pass information, if object
// is in page header|footer to method.
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 7a308d32d9cb..9e22ad284a38 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -54,6 +54,7 @@
#include "ww8par2.hxx" // struct WWFlyPara
#include "ww8graf.hxx"
#include <svtools/filter.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
using namespace sw::types;
@@ -239,9 +240,9 @@ sal_uLong wwZOrderer::GetDrawingObjectPos(short nWwHeight)
bool wwZOrderer::InsertObject(SdrObject* pObject, sal_uLong nPos)
{
- if (!pObject->IsInserted())
+ if (!pObject->IsObjectInserted())
{
- mpDrawPg->InsertObject(pObject, nPos);
+ mpDrawPg->InsertObjectToSdrObjList(*pObject, nPos);
return true;
}
return false;
@@ -360,16 +361,17 @@ void SwWW8ImplReader::ReplaceObj(const SdrObject &rReplaceObj,
SdrObject &rSubObj)
{
// SdrGrafObj anstatt des SdrTextObj in dessen Gruppe einsetzen
- if (SdrObject* pGroupObject = rReplaceObj.GetUpGroup())
+ if (SdrObject* pGroupObject = rReplaceObj.GetParentSdrObject())
{
- SdrObjList* pObjectList = pGroupObject->GetSubList();
+ SdrObjList* pObjectList = pGroupObject->getChildrenOfSdrObject();
- rSubObj.SetLogicRect(rReplaceObj.GetCurrentBoundRect());
+ // copy transformation and layer
+ rSubObj.setSdrObjectTransformation(rReplaceObj.getSdrObjectTransformation());
rSubObj.SetLayer(rReplaceObj.GetLayer());
// altes Objekt raus aus Gruppen-Liste und neues rein
// (dies tauscht es ebenfalls in der Drawing-Page aus)
- pObjectList->ReplaceObject(&rSubObj, rReplaceObj.GetOrdNum());
+ pObjectList->ReplaceObjectInSdrObjList(rSubObj, rReplaceObj.GetNavigationPosition());
}
else
{
@@ -586,10 +588,10 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
pDataStream->SeekRel( nNameLen );
}
- Rectangle aChildRect;
- Rectangle aClientRect( 0,0, aPD.nWidth, aPD.nHeight);
- SvxMSDffImportData aData( aClientRect );
- pObject = pMSDffManager->ImportObj(*pDataStream, &aData, aClientRect, aChildRect );
+ const basegfx::B2DRange aChildRange;
+ basegfx::B2DRange aClientRange(0.0, 0.0, aPD.nWidth, aPD.nHeight);
+ SvxMSDffImportData aData(aClientRange);
+ pObject = pMSDffManager->ImportObj(*pDataStream, &aData, aClientRange, aChildRange);
if (pObject)
{
// fuer den Rahmen
@@ -667,7 +669,7 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
}
bool bTextObjWasGrouped = false;
- if (pOldFlyFmt && pTextObj && pTextObj->GetUpGroup())
+ if (pOldFlyFmt && pTextObj && pTextObj->GetParentSdrObject())
bTextObjWasGrouped = true;
if (bTextObjWasGrouped)
@@ -681,13 +683,13 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
}
else
{
- if (SdrGrafObj* pGraphObject = PTR_CAST(SdrGrafObj, pObject))
+ if (SdrGrafObj* pGraphObject = dynamic_cast< SdrGrafObj* >( pObject))
{
// Nun den Link bzw. die Grafik ins Doc stopfen
const Graphic& rGraph = pGraphObject->GetGraphic();
if (nObjLocFc) // is it a OLE-Object?
- pRet = ImportOle(&rGraph, &aAttrSet, &aGrSet, pObject->GetBLIPSizeRectangle());
+ pRet = ImportOle(&rGraph, &aAttrSet, &aGrSet, pObject->GetBLIPSizeRange());
if (!pRet)
{
@@ -723,9 +725,10 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
// altes SdrGrafObj aus der Page loeschen und
// zerstoeren
- if (pObject->GetPage())
- pDrawPg->RemoveObject(pObject->GetOrdNum());
- SdrObject::Free( pObject );
+ if (pObject->getSdrPageFromSdrObject())
+ pDrawPg->RemoveObjectFromSdrObjList(pObject->GetNavigationPosition());
+
+ deleteSdrObjectSafeAndClearPointer( pObject );
}
}
else
@@ -735,8 +738,8 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
pMSDffManager->RemoveFromShapeOrder( pObject );
// auch das ggfs. Page loeschen, falls nicht gruppiert,
- if (pTextObj && !bTextObjWasGrouped && pTextObj->GetPage())
- pDrawPg->RemoveObject( pTextObj->GetOrdNum() );
+ if (pTextObj && !bTextObjWasGrouped && pTextObj->getSdrPageFromSdrObject())
+ pDrawPg->RemoveObjectFromSdrObjList( pTextObj->GetNavigationPosition() );
}
pMSDffManager->EnableFallbackStream();
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 5437513799f6..eb3dc03ebfa4 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -33,7 +33,6 @@
#include <tools/solar.h>
#include <rtl/tencinfo.h>
#include <rtl/random.h>
-
#include <sot/storage.hxx>
#include <sfx2/docinf.hxx>
#include <sfx2/docfile.hxx>
@@ -42,10 +41,8 @@
#include <tools/urlobj.hxx>
#include <unotools/tempfile.hxx>
#include <svtools/sfxecode.hxx>
-
#include <comphelper/docpasswordrequest.hxx>
#include <hintids.hxx>
-
#include <editeng/tstpitem.hxx>
#include <editeng/cscoitem.hxx>
#include <svx/svdobj.hxx>
@@ -66,7 +63,6 @@
#include <svx/svdmodel.hxx>
#include <svx/svdogrp.hxx>
#include <svx/xflclit.hxx>
-
#include <unotools/fltrcfg.hxx>
#include <fmtfld.hxx>
#include <fmturl.hxx>
@@ -100,35 +96,26 @@
#include <swunodef.hxx>
#include <unodraw.hxx>
#include <swtable.hxx> // class SwTableLines, ...
-// #i18732#
#include <fmtfollowtextflow.hxx>
#include <fchrfmt.hxx>
#include <charfmt.hxx>
-
-
#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
#include <comphelper/extract.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <fltini.hxx>
-
#include <algorithm>
#include <functional>
#include "writerhelper.hxx"
#include "writerwordglue.hxx"
-
-
#include "ww8par2.hxx" // class WW8RStyle, class WW8AnchorPara
-
#include <frmatr.hxx>
-
#include <math.h>
#include <com/sun/star/beans/XPropertyContainer.hpp>
-
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <svl/itemiter.hxx> //SfxItemIter
-
+#include <svx/svdlegacy.hxx>
#include <stdio.h>
#ifdef DEBUG
@@ -184,8 +171,8 @@ sal_uInt32 SwMSDffManager::GetFilterFlags()
// #i32596# - consider new parameter <_nCalledByGroup>
SdrObject* SwMSDffManager::ImportOLE( long nOLEId,
const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
const int _nCalledByGroup,
sal_Int64 nAspect ) const
{
@@ -215,8 +202,18 @@ SdrObject* SwMSDffManager::ImportOLE( long nOLEId,
else
{
ErrCode nError = ERRCODE_NONE;
- pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg,
- rGrf, rBoundRect, rVisArea, pStData, nError, nSvxMSDffOLEConvFlags, nAspect );
+ pRet = CreateSdrOLEFromStorage(
+ *GetModel(),
+ sStorageName,
+ xSrcStg,
+ xDstStg,
+ rGrf,
+ rBoundRect,
+ rVisArea,
+ pStData,
+ nError,
+ nSvxMSDffOLEConvFlags,
+ nAspect );
}
}
return pRet;
@@ -266,11 +263,11 @@ void SwWW8ImplReader::SetToggleBiDiAttrFlags(sal_uInt16 nFlags)
SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
DffObjData& rObjData,
void* pData,
- Rectangle& rTextRect,
+ basegfx::B2DRange& rTextRange,
SdrObject* pObj
)
{
- if( !rTextRect.IsEmpty() )
+ if( !rTextRange.isEmpty() )
{
SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
@@ -401,9 +398,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
{
case 9000:
{
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
+ rTextRange = basegfx::B2DRange(
+ rTextRange.getMinX(), rTextRange.getMinY(),
+ rTextRange.getMinX() + rTextRange.getHeight(), rTextRange.getMinY() + rTextRange.getWidth());
sal_Int32 nOldTextLeft = nTextLeft;
sal_Int32 nOldTextRight = nTextRight;
@@ -418,9 +415,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
break;
case 27000:
{
- long nWidth = rTextRect.GetWidth();
- rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
- rTextRect.Bottom() = rTextRect.Top() + nWidth;
+ rTextRange = basegfx::B2DRange(
+ rTextRange.getMinX(), rTextRange.getMinY(),
+ rTextRange.getMinX() + rTextRange.getHeight(), rTextRange.getMinY() + rTextRange.getWidth());
sal_Int32 nOldTextLeft = nTextLeft;
sal_Int32 nOldTextRight = nTextRight;
@@ -440,15 +437,23 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
if (bIsSimpleDrawingTextBox)
{
- SdrObject::Free( pObj );
- pObj = new SdrRectObj(OBJ_TEXT, rTextRect);
+ deleteSdrObjectSafeAndClearPointer( pObj );
+ pObj = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rTextRange.getRange(),
+ rTextRange.getMinimum()),
+ OBJ_TEXT,
+ true);
}
// Die vertikalen Absatzeinrueckungen sind im BoundRect mit drin,
// hier rausrechnen
- Rectangle aNewRect(rTextRect);
- aNewRect.Bottom() -= nTextTop + nTextBottom;
- aNewRect.Right() -= nTextLeft + nTextRight;
+ const Rectangle aNewRect(
+ basegfx::fround(rTextRange.getMinX()),
+ basegfx::fround(rTextRange.getMinY()),
+ basegfx::fround(rTextRange.getMaxX()) - nTextLeft + nTextRight,
+ basegfx::fround(rTextRange.getMaxY()) - nTextTop + nTextBottom);
// Nur falls es eine einfache Textbox ist, darf der Writer
// das Objekt durch einen Rahmen ersetzen, ansonsten
@@ -472,38 +477,36 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
bool bFitText = false;
if (GetPropertyValue(DFF_Prop_FitTextToShape) & 2)
{
- aSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
- aSet.Put( SdrTextMinFrameHeightItem(
- aNewRect.Bottom() - aNewRect.Top() ) );
- aSet.Put( SdrTextMinFrameWidthItem(
- aNewRect.Right() - aNewRect.Left() ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, true) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, aNewRect.Bottom() - aNewRect.Top() ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, aNewRect.Right() - aNewRect.Left() ) );
bFitText = true;
}
else
{
- aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
- aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false) );
}
switch ( (MSO_WrapMode)
GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) )
{
case mso_wrapNone :
- aSet.Put( SdrTextAutoGrowWidthItem( sal_True ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true) );
pImpRec->bAutoWidth = true;
break;
case mso_wrapByPoints :
- aSet.Put( SdrTextContourFrameItem( sal_True ) );
+ aSet.Put( SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, true) );
break;
default:
;
}
// Abstaende an den Raendern der Textbox setzen
- aSet.Put( SdrTextLeftDistItem( nTextLeft ) );
- aSet.Put( SdrTextRightDistItem( nTextRight ) );
- aSet.Put( SdrTextUpperDistItem( nTextTop ) );
- aSet.Put( SdrTextLowerDistItem( nTextBottom ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_LEFTDIST, nTextLeft ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, nTextRight ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_UPPERDIST, nTextTop ) );
+ aSet.Put( SdrMetricItem(SDRATTR_TEXT_LOWERDIST, nTextBottom ) );
pImpRec->nDxTextLeft = nTextLeft;
pImpRec->nDyTextTop = nTextTop;
pImpRec->nDxTextRight = nTextRight;
@@ -575,7 +578,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
if (pObj != NULL)
{
pObj->SetMergedItemSet(aSet);
- pObj->SetModel(pSdrModel);
+ //pObj->SetModel(pSdrModel);
if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) )
dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True);
@@ -584,14 +587,15 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
{
if ( nTextRotationAngle )
{
- long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
- rTextRect.GetWidth() : rTextRect.GetHeight();
- nMinWH /= 2;
- Point aPivot(rTextRect.TopLeft());
- aPivot.X() += nMinWH;
- aPivot.Y() += nMinWH;
- double a = nTextRotationAngle * nPi180;
- pObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
+ const double fDist(std::min(rTextRange.getWidth(), rTextRange.getHeight()) * 0.5);
+ const basegfx::B2DPoint aPivot(rTextRange.getMinimum() + basegfx::B2DPoint(fDist, fDist));
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aPivot);
+ aTransform.rotate((-nTextRotationAngle * F_PI) / 18000.0);
+ aTransform.translate(aPivot);
+
+ sdr::legacy::transformSdrObject(*pObj, aTransform);
}
}
@@ -624,9 +628,14 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
else if ( mnFix16Angle )
{
// rotate text with shape ?
- double a = mnFix16Angle * nPi180;
- pObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
- sin( a ), cos( a ) );
+ const basegfx::B2DPoint aCenter(rObjData.aBoundRect.getCenter());
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.translate(-aCenter);
+ aTransform.rotate((-mnFix16Angle * F_PI) / 18000.0);
+ aTransform.translate(aCenter);
+
+ sdr::legacy::transformSdrObject(*pObj, aTransform);
}
}
}
@@ -635,9 +644,14 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
// simple rectangular objects are ignored by ImportObj() :-(
// this is OK for Draw but not for Calc and Writer
// cause here these objects have a default border
- pObj = new SdrRectObj(rTextRect);
- pObj->SetModel( pSdrModel );
- SfxItemSet aSet( pSdrModel->GetItemPool() );
+ pObj = new SdrRectObj(
+ *pSdrModel,
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rTextRange.getRange(),
+ rTextRange.getMinimum()));
+
+ //pObj->SetModel( pSdrModel );
+ SfxItemSet aSet( pObj->GetObjectItemPool() );
ApplyAttributes( rSt, aSet, rObjData );
const SfxPoolItem* pPoolItem=NULL;
@@ -926,41 +940,6 @@ bool SwWW8FltControlStack::CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd)
return rReader.IsParaEndInCPs(nStart,nEnd);
}
//End
-
-void SwWW8ReferencedFltEndStack::SetAttrInDoc( const SwPosition& rTmpPos,
- SwFltStackEntry* pEntry )
-{
- switch( pEntry->pAttr->Which() )
- {
- case RES_FLTR_BOOKMARK:
- {
- // suppress insertion of bookmark, which is recognized as an internal bookmark used for table-of-content
- // and which is not referenced.
- bool bInsertBookmarkIntoDoc = true;
-
- SwFltBookmark* pFltBookmark = dynamic_cast<SwFltBookmark*>(pEntry->pAttr);
- if ( pFltBookmark != 0 && pFltBookmark->IsTOCBookmark() )
- {
- const String& rName = pFltBookmark->GetName();
- ::std::set< String, SwWW8::ltstr >::const_iterator aResult = aReferencedTOCBookmarks.find(rName);
- if ( aResult == aReferencedTOCBookmarks.end() )
- {
- bInsertBookmarkIntoDoc = false;
- }
- }
- if ( bInsertBookmarkIntoDoc )
- {
- SwFltEndStack::SetAttrInDoc( rTmpPos, pEntry );
- }
- break;
- }
- default:
- SwFltEndStack::SetAttrInDoc( rTmpPos, pEntry );
- break;
- }
-
-}
-
void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
SwFltStackEntry* pEntry)
{
@@ -1749,9 +1728,9 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(long nStart, long nLen,
SdrObject* pFrmObj = CreateContactObject( pFrame );
ASSERT( pFrmObj,
"<SwWW8ImplReader::Read_HdFtTextAsHackedFrame(..)> - missing SdrObject instance" );
- if ( pFrmObj )
+ if ( pFrmObj && pFrmObj->getParentOfSdrObject() )
{
- pFrmObj->SetOrdNum( 0L );
+ pFrmObj->getParentOfSdrObject()->SetNavigationPosition(pFrmObj->GetNavigationPosition(), 0);
}
MoveInsideFly(pFrame);
@@ -3516,8 +3495,7 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection,
if (mrReader.pWDop->fUseBackGroundInAllmodes && mrReader.pMSDffManager)
{
- Rectangle aRect(0, 0, 100, 100); //A dummy, we don't care about the size
- SvxMSDffImportData aData(aRect);
+ SvxMSDffImportData aData(basegfx::B2DRange(0.0, 0.0, 100.0, 100.0)); //A dummy, we don't care about the size
SdrObject* pObject = 0;
if (mrReader.pMSDffManager->GetShape(0x401, pObject, aData))
{
@@ -3527,8 +3505,9 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection,
if ((pRec->nFlags & 0x400) != 0)
{
SfxItemSet aSet(rFmt.GetAttrSet());
+ Rectangle aRectangle(0, 0, 100, 100);
mrReader.MatchSdrItemsIntoFlySet(pObject, aSet, mso_lineSimple,
- mso_sptRectangle, aRect);
+ mso_sptRectangle, aRectangle);
rFmt.SetFmtAttr(aSet.Get(RES_BACKGROUND));
}
}
@@ -4017,7 +3996,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
RefFldStck: Keeps track of bookmarks which may be inserted as
variables intstead.
*/
- pReffedStck = new SwWW8ReferencedFltEndStack(&rDoc, nFieldFlags);
+ pReffedStck = new SwFltEndStack(&rDoc, nFieldFlags);
pReffingStck = new SwWW8FltRefStack(&rDoc, nFieldFlags);
pAnchorStck = new SwWW8FltAnchorStack(&rDoc, nFieldFlags);
@@ -4532,7 +4511,7 @@ namespace
uno::Sequence< beans::NamedValue > InitXorWord95Codec( ::msfilter::MSCodec_XorWord95& rCodec, SfxMedium& rMedium, WW8Fib* pWwFib )
{
uno::Sequence< beans::NamedValue > aEncryptionData;
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionData, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionData, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if ( pEncryptionData && ( pEncryptionData->GetValue() >>= aEncryptionData ) && !rCodec.InitCodec( aEncryptionData ) )
aEncryptionData.realloc( 0 );
@@ -4590,7 +4569,7 @@ namespace
uno::Sequence< beans::NamedValue > InitStd97Codec( ::msfilter::MSCodec_Std97& rCodec, sal_uInt8 pDocId[16], SfxMedium& rMedium )
{
uno::Sequence< beans::NamedValue > aEncryptionData;
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionData, SfxUnoAnyItem, SID_ENCRYPTIONDATA, sal_False );
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pEncryptionData, SfxUnoAnyItem, SID_ENCRYPTIONDATA );
if ( pEncryptionData && ( pEncryptionData->GetValue() >>= aEncryptionData ) && !rCodec.InitCodec( aEncryptionData ) )
aEncryptionData.realloc( 0 );
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 034b3e6d8b49..ac75d75ed8ea 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -313,46 +313,25 @@ private:
Position& operator=(const Position&);
};
-namespace SwWW8
-{
- struct ltstr
- {
- bool operator()(const String &r1, const String &r2) const
- {
- return r1.CompareIgnoreCaseToAscii(r2) == COMPARE_LESS;
- }
- };
-};
-
-class SwWW8ReferencedFltEndStack : public SwFltEndStack
-{
-public:
- SwWW8ReferencedFltEndStack( SwDoc* pDo, sal_uLong nFieldFl )
- : SwFltEndStack( pDo, nFieldFl )
- , aReferencedTOCBookmarks()
- {}
-
- // Keep track of referenced TOC bookmarks in order to suppress the import
- // of unreferenced ones.
- std::set<String, SwWW8::ltstr> aReferencedTOCBookmarks;
-protected:
- virtual void SetAttrInDoc( const SwPosition& rTmpPos,
- SwFltStackEntry* pEntry );
-};
-
class SwWW8FltRefStack : public SwFltEndStack
{
public:
SwWW8FltRefStack(SwDoc* pDo, sal_uLong nFieldFl)
: SwFltEndStack( pDo, nFieldFl )
- , aFieldVarNames()
{}
bool IsFtnEdnBkmField(const SwFmtFld& rFmtFld, sal_uInt16& rBkmNo);
+ struct ltstr
+ {
+ bool operator()(const String &r1, const String &r2) const
+ {
+ return r1.CompareIgnoreCaseToAscii(r2) == COMPARE_LESS;
+ }
+ };
//Keep track of variable names created with fields, and the bookmark
//mapped to their position, hopefully the same, but very possibly
//an additional pseudo bookmark
- std::map<String, String, SwWW8::ltstr> aFieldVarNames;
+ std::map<String, String, ltstr> aFieldVarNames;
protected:
SwFltStackEntry *RefToVar(const SwField* pFld,SwFltStackEntry *pEntry);
virtual void SetAttrInDoc(const SwPosition& rTmpPos,
@@ -598,8 +577,8 @@ private:
// indicates, if the OLE object is imported inside a group object
virtual SdrObject* ImportOLE( long nOLEId,
const Graphic& rGrf,
- const Rectangle& rBoundRect,
- const Rectangle& rVisArea,
+ const basegfx::B2DRange& rBoundRect,
+ const basegfx::B2DRange& rVisArea,
const int _nCalledByGroup,
sal_Int64 nAspect ) const;
// <--
@@ -615,7 +594,7 @@ public:
void DisableFallbackStream();
void EnableFallbackStream();
protected:
- virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, Rectangle& rTextRect, SdrObject* pObj );
+ virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, basegfx::B2DRange& rTextRect, SdrObject* pObj );
};
@@ -864,11 +843,11 @@ private:
sw::util::RedlineStack *mpRedlineStack;
/*
- This stack is for fields that get referenced later, e.g. BookMarks and TOX.
+ This stack is for fields that get referneced later, e.g. BookMarks and TOX.
They get inserted at the end of the document, it is the same stack for
headers/footers/main text/textboxes/tables etc...
*/
- SwWW8ReferencedFltEndStack *pReffedStck;
+ SwFltEndStack *pReffedStck;
/*
This stack is for fields whose true conversion cannot be determined until
@@ -1288,10 +1267,10 @@ private:
SwFrmFmt* ImportGraf(SdrTextObj* pTextObj = 0, SwFrmFmt* pFlyFmt = 0);
SdrObject* ImportOleBase( Graphic& rGraph, const Graphic* pGrf=0,
- const SfxItemSet* pFlySet=0, const Rectangle& aVisArea = Rectangle() );
+ const SfxItemSet* pFlySet=0, const basegfx::B2DRange& aVisArea = basegfx::B2DRange() );
SwFrmFmt* ImportOle( const Graphic* = 0, const SfxItemSet* pFlySet = 0,
- const SfxItemSet* pGrfSet = 0, const Rectangle& aVisArea = Rectangle() );
+ const SfxItemSet* pGrfSet = 0, const basegfx::B2DRange& aVisArea = basegfx::B2DRange() );
SwFlyFrmFmt* InsertOle(SdrOle2Obj &rObject, const SfxItemSet &rFlySet,
const SfxItemSet &rGrfSet);
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 68e01eb019d6..a96fb387bccf 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -27,7 +27,6 @@
#include <doc.hxx>
#include "writerhelper.hxx"
#include <com/sun/star/embed/XClassifiedObject.hpp>
-
#include <algorithm>
#include <functional>
#include <osl/endian.h>
@@ -38,7 +37,6 @@
#include <filter/msfilter/msdffimp.hxx>
#include <svx/unoapi.hxx>
#include <filter/msfilter/msocximex.hxx>
-
#include <sot/exchange.hxx>
#include <swtypes.hxx>
#include <fmtanchr.hxx>
@@ -51,11 +49,11 @@
#include <mdiexp.hxx> // Progress
#include <redline.hxx>
#include <fltshell.hxx>
-#include <unodraw.hxx>
#include <shellio.hxx>
#include <ndole.hxx>
-
#include <svtools/filter.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
#include "ww8scan.hxx"
#include "ww8par.hxx"
@@ -260,7 +258,7 @@ SwFlyFrmFmt* SwWW8ImplReader::InsertOle(SdrOle2Obj &rObject,
}
SwFrmFmt* SwWW8ImplReader::ImportOle(const Graphic* pGrf,
- const SfxItemSet* pFlySet, const SfxItemSet *pGrfSet, const Rectangle& aVisArea )
+ const SfxItemSet* pFlySet, const SfxItemSet *pGrfSet, const basegfx::B2DRange& aVisArea )
{
::SetProgressState(nProgress, mpDocShell); // Update
SwFrmFmt* pFmt = 0;
@@ -304,10 +302,10 @@ SwFrmFmt* SwWW8ImplReader::ImportOle(const Graphic* pGrf,
if (pRet) // Ole-Object wurde eingefuegt
{
- if (pRet->ISA(SdrOle2Obj))
+ if (dynamic_cast< SdrOle2Obj* >(pRet))
{
pFmt = InsertOle(*((SdrOle2Obj*)pRet), *pFlySet, *pGrfSet);
- SdrObject::Free( pRet ); // das brauchen wir nicht mehr
+ deleteSdrObjectSafeAndClearPointer( pRet ); // das brauchen wir nicht mehr
}
else
pFmt = rDoc.Insert(*pPaM, *pRet, pFlySet, NULL);
@@ -350,7 +348,7 @@ bool SwWW8ImplReader::ImportOleWMF(SvStorageRef xSrc1,GDIMetaFile &rWMF,
}
SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
- const Graphic* pGrf, const SfxItemSet* pFlySet, const Rectangle& aVisArea )
+ const Graphic* pGrf, const SfxItemSet* pFlySet, const basegfx::B2DRange& aVisArea )
{
SdrObject* pRet = 0;
ASSERT( pStg, "ohne storage geht hier fast gar nichts!" );
@@ -396,14 +394,16 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
} // StorageStreams wieder zu
- Rectangle aRect(0, 0, nX, nY);
+ basegfx::B2DRange aRange(0.0, 0.0, nX, nY);
if (pFlySet)
{
if (const SwFmtFrmSize* pSize =
(const SwFmtFrmSize*)pFlySet->GetItem(RES_FRM_SIZE, false))
{
- aRect.SetSize(pSize->GetSize());
+ aRange = basegfx::B2DRange(
+ aRange.getMinX(), aRange.getMinY(),
+ aRange.getMinX() + pSize->GetSize().Width(), aRange.getMinY() + pSize->GetSize().Height());
}
}
@@ -417,7 +417,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
pRet = GetSdrObjectFromXShape(xRef);
ASSERT(pRet, "Impossible");
if (pRet)
- pRet->SetLogicRect(aRect);
+ sdr::legacy::SetLogicRange(*pRet, aRange);
return pRet;
}
}
@@ -454,8 +454,17 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
ErrCode nError = ERRCODE_NONE;
pRet = SvxMSDffManager::CreateSdrOLEFromStorage(
- aSrcStgName, xSrc0, mpDocShell->GetStorage(), rGraph, aRect, aVisArea, pTmpData, nError,
- SwMSDffManager::GetFilterFlags(), nAspect );
+ *rDoc.GetOrCreateDrawModel(),
+ aSrcStgName,
+ xSrc0,
+ mpDocShell->GetStorage(),
+ rGraph,
+ aRange,
+ aVisArea,
+ pTmpData,
+ nError,
+ SwMSDffManager::GetFilterFlags(),
+ nAspect );
pDataStream->Seek( nOldPos );
}
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index d6c1278a25df..a3d7155dfe69 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -294,17 +294,6 @@ bool _ReadFieldParams::GetTokenSttFromTo(sal_uInt16* pFrom, sal_uInt16* pTo, sal
// Bookmarks
//----------------------------------------
-namespace
-{
- // #120879# - helper method to identify a bookmark name to match the internal TOC bookmark naming convention
- bool IsTOCBookmarkName( const ::rtl::OUString& rName )
- {
- static const ::rtl::OUString cTOCBookmarkNamePrefix = ::rtl::OUString::createFromAscii("_Toc");
-
- return rName.match(cTOCBookmarkNamePrefix);
- }
-}
-
long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
{
// muesste auch ueber pRes.nCo2OrIdx gehen
@@ -415,9 +404,8 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
aStart = rTest.maStartPos;
}
- const String sOrigName = BookmarkToWriter(*pName);
- pReffedStck->NewAttr( aStart,
- SwFltBookmark( sOrigName, aVal, pB->GetHandle(), IsTOCBookmarkName( sOrigName ) ));
+ pReffedStck->NewAttr(aStart, SwFltBookmark(BookmarkToWriter(*pName), aVal,
+ pB->GetHandle(), 0));
return 0;
}
@@ -1326,7 +1314,7 @@ long SwWW8ImplReader::MapBookmarkVariables(const WW8FieldDesc* pF,
nNo += pPlcxMan->GetBook()->GetIMax();
}
pReffedStck->NewAttr(*pPaM->GetPoint(),
- SwFltBookmark( BookmarkToWriter(sName), rData, nNo ));
+ SwFltBookmark(BookmarkToWriter(sName), rData, nNo, 0));
pReffingStck->aFieldVarNames[rOrigName] = sName;
return nNo;
}
@@ -1349,7 +1337,7 @@ SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pFld,
{
//Get the name of the ref field, and see if actually a variable
const String &rName = pFld->GetPar1();
- ::std::map<String,String,SwWW8::ltstr>::const_iterator
+ ::std::map<String,String,SwWW8FltRefStack::ltstr>::const_iterator
aResult = aFieldVarNames.find(rName);
if (aResult != aFieldVarNames.end())
@@ -1373,7 +1361,7 @@ String SwWW8ImplReader::GetMappedBookmark(const String &rOrigName)
//See if there has been a variable set with this name, if so get
//the pseudo bookmark name that was set with it.
- ::std::map<String,String,SwWW8::ltstr>::const_iterator aResult =
+ ::std::map<String,String,SwWW8FltRefStack::ltstr>::const_iterator aResult =
pReffingStck->aFieldVarNames.find(sName);
const String &rBkmName = (aResult == pReffingStck->aFieldVarNames.end())
@@ -2168,32 +2156,18 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, String& rStr )
}
}
- const String sName(GetMappedBookmark(sOrigName));
+ String sName(GetMappedBookmark(sOrigName));
- // loading page reference field in TOC
+ //loading page reference field in TOC
if (mbLoadingTOCCache )
{
- // insert page ref representation as plain text --> return FLD_TEXT
- // if there is no hyperlink settings for current toc and referenced bookmark is available,
- // assign link to current ref area
- if ( !mbLoadingTOCHyperlink && sName.Len() > 0 )
+ //Step 1. Insert page ref representation as plain text
+ //Step 2. If there is no hyperlink settings for current toc, assign link to current ref area
+ if ( !mbLoadingTOCHyperlink)
{
- // #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
- String sBookmarkName;
- if ( IsTOCBookmarkName( sName ) )
- {
- sBookmarkName = String( IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix() );
- sBookmarkName += sName;
- // track <sBookmarkName> as referenced TOC bookmark.
- pReffedStck->aReferencedTOCBookmarks.insert( sBookmarkName );
- }
- else
- {
- sBookmarkName = sName;
- }
- String sURL = INET_MARK_TOKEN;
- sURL += sBookmarkName;
- const String sTarget;
+ String sURL,sTarget;
+ if( sName.Len() )
+ ( sURL += INET_MARK_TOKEN ) += sName;
SwFmtINetFmt aURL( sURL, sTarget );
String sLinkStyle = String::CreateFromAscii("Index Link");
sal_uInt16 nPoolId =
@@ -2207,23 +2181,11 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, String& rStr )
return FLD_TEXT;
}
- // #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
- String sPageRefBookmarkName;
- if ( IsTOCBookmarkName( sName ) )
- {
- sPageRefBookmarkName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
- sPageRefBookmarkName += sName;
- // track <sPageRefBookmarkName> as referenced TOC bookmark.
- pReffedStck->aReferencedTOCBookmarks.insert( sPageRefBookmarkName );
- }
- else
- {
- sPageRefBookmarkName = sName;
- }
- SwGetRefField aFld( (SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ),
- sPageRefBookmarkName, REF_BOOKMARK, 0, REF_PAGE );
- rDoc.InsertPoolItem( *pPaM, SwFmtFld( aFld ), 0 );
+ SwGetRefField aFld(
+ (SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName,
+ REF_BOOKMARK, 0, REF_PAGE );
+ rDoc.InsertPoolItem( *pPaM, SwFmtFld( aFld ), 0 );
return FLD_OK;
}
//helper function
@@ -3610,19 +3572,8 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
if( -2 == nRet )
{
sMark = aReadParam.GetResult();
- if( sMark.Len() > 0 && '"' == sMark.GetChar( sMark.Len()-1 ) )
- {
+ if( sMark.Len() && '"' == sMark.GetChar( sMark.Len()-1 ))
sMark.Erase( sMark.Len() - 1 );
- }
- // #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
- if ( IsTOCBookmarkName( sMark ) )
- {
- String sTmp = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
- sTmp += sMark;
- sMark = sTmp;
- // track <sMark> as referenced TOC bookmark.
- pReffedStck->aReferencedTOCBookmarks.insert( sMark );
- }
if (mbLoadingTOCCache)
{
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index 83f78f561e9b..7591e04ea758 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -29,6 +29,7 @@
#include <osl/endian.h>
#include <tools/string.hxx>
#include <sal/config.h>
+#include <memory.h>
#if defined OSL_BIGENDIAN || SAL_TYPES_ALIGNMENT4 > 2 || defined UNX
# define __WW8_NEEDS_COPY
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 85a5352d438d..d9dba00051e0 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -68,6 +68,7 @@
#include <unotextrange.hxx>
#include <swmodule.hxx>
#include <SwXMLSectionList.hxx>
+#include <svx/svdlegacy.hxx>
#include <statstr.hrc>
@@ -94,6 +95,7 @@
#define LOGFILE_AUTHOR "mb93740"
#include <sfx2/DocumentMetadataAccess.hxx>
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
@@ -506,7 +508,7 @@ void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SwDoc& _rDoc )
if( pOle2Obj )
{
// found an ole2 shape
- SdrObjList* pObjList = pOle2Obj->GetObjList();
+ SdrObjList* pObjList = pOle2Obj->getParentOfSdrObject();
// get its graphic
Graphic aGraphic;
@@ -517,13 +519,18 @@ void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SwDoc& _rDoc )
pOle2Obj->Disconnect();
// create new graphic shape with the ole graphic and shape size
- SdrGrafObj* pGraphicObj = new SdrGrafObj( aGraphic, pOle2Obj->GetCurrentBoundRect() );
+ SdrGrafObj* pGraphicObj = new SdrGrafObj(
+ pOle2Obj->getSdrModelFromSdrObject(),
+ aGraphic,
+ pOle2Obj->getSdrObjectTransformation());
+
// apply layer of ole2 shape at graphic shape
pGraphicObj->SetLayer( pOle2Obj->GetLayer() );
// replace ole2 shape with the new graphic object and delete the ol2 shape
- SdrObject* pReplaced = pObjList->ReplaceObject( pGraphicObj, pOle2Obj->GetOrdNum() );
- SdrObject::Free( pReplaced );
+ SdrObject* pReplaced = pObjList->ReplaceObjectInSdrObjList(
+ *pGraphicObj, pOle2Obj->GetNavigationPosition() );
+ deleteSdrObjectSafeAndClearPointer( pReplaced );
}
}
}
diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx
index 46aa7666f607..a71818beea12 100644
--- a/sw/source/filter/xml/xmlbrsh.cxx
+++ b/sw/source/filter/xml/xmlbrsh.cxx
@@ -76,8 +76,6 @@ static __FAR_DATA SvXMLTokenMapEntry aBGImgAttributesAttrTokenMap[] =
XML_TOKEN_MAP_END
};
-TYPEINIT1( SwXMLBrushItemImportContext, SvXMLImportContext );
-
void SwXMLBrushItemImportContext::ProcessAttrs(
const uno::Reference< xml::sax::XAttributeList >& xAttrList,
const SvXMLUnitConverter& rUnitConv )
diff --git a/sw/source/filter/xml/xmlbrshi.hxx b/sw/source/filter/xml/xmlbrshi.hxx
index 40deebacbb5c..033cf296bd10 100644
--- a/sw/source/filter/xml/xmlbrshi.hxx
+++ b/sw/source/filter/xml/xmlbrshi.hxx
@@ -49,8 +49,6 @@ private:
const SvXMLUnitConverter& rUnitConv );
public:
- TYPEINFO();
-
SwXMLBrushItemImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 2f44153e160d..e323c558cc46 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -246,8 +246,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
{
if( 0 != (pItem = rPool.GetItem2( nWhichId , i ) ) )
{
- const SvXMLAttrContainerItem *pUnknown =
- PTR_CAST( SvXMLAttrContainerItem, pItem );
+ const SvXMLAttrContainerItem *pUnknown = dynamic_cast< const SvXMLAttrContainerItem* >( pItem );
ASSERT( pUnknown, "illegal attribute container item" );
if( pUnknown && (pUnknown->GetAttrCount() > 0) )
{
@@ -326,14 +325,6 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
}
}
- if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 )
- {
- //Auf die Korrektheit der OrdNums sind wir schon angewiesen.
- SdrModel* pModel = pDoc->GetDrawModel();
- if( pModel )
- pModel->GetPage( 0 )->RecalcObjOrdNums();
- }
-
// adjust document class (eClass)
if (pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT))
{
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index f0eb75a04c9e..ff97f66ae4e4 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -130,7 +130,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
{
if( 0 != (rEntry.nMemberId & MID_SW_FLAG_SPECIAL_ITEM_EXPORT) )
{
- if( rItem.ISA( SwFmtRowSplit ) )
+ if( dynamic_cast< const SwFmtRowSplit* >(&rItem) )
{
OUString aValue;
bool bAddAttribute = true;
@@ -147,7 +147,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
else
{
OUStringBuffer aOut;
- const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
+ const SfxBoolItem* pSplit = dynamic_cast< const SfxBoolItem* >( &rItem);
DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
sal_uInt16 eEnum = pSplit->GetValue() ? 1 : 0;
rUnitConverter.convertEnum( aOut, eEnum, aXML_KeepTogetherType );
@@ -160,13 +160,12 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
rAttrList.AddAttribute( sName, aValue );
}
}
- if( rItem.ISA( SvXMLAttrContainerItem ) )
+ if( dynamic_cast< const SvXMLAttrContainerItem* >(&rItem) )
{
SvXMLNamespaceMap *pNewNamespaceMap = 0;
const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap;
- const SvXMLAttrContainerItem *pUnknown =
- PTR_CAST( SvXMLAttrContainerItem, &rItem );
+ const SvXMLAttrContainerItem *pUnknown = dynamic_cast< const SvXMLAttrContainerItem* >( &rItem );
sal_uInt16 nCount = pUnknown->GetAttrCount();
OUStringBuffer sName;
@@ -381,7 +380,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_LR_SPACE:
{
- const SvxLRSpaceItem* pLRSpace = PTR_CAST(SvxLRSpaceItem, &rItem);
+ const SvxLRSpaceItem* pLRSpace = dynamic_cast< const SvxLRSpaceItem* >( &rItem);
DBG_ASSERT( pLRSpace != NULL, "Wrong Which-ID!" );
bOk = sal_True;
@@ -431,7 +430,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_UL_SPACE:
{
- const SvxULSpaceItem* pULSpace = PTR_CAST(SvxULSpaceItem, &rItem);
+ const SvxULSpaceItem* pULSpace = dynamic_cast< const SvxULSpaceItem* >( &rItem);
DBG_ASSERT( pULSpace != NULL, "Wrong Which-ID!" );
switch( nMemberId )
@@ -460,7 +459,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_SHADOW:
{
- const SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem);
+ const SvxShadowItem* pShadow = dynamic_cast< const SvxShadowItem* >( &rItem);
DBG_ASSERT( pShadow != NULL, "Wrong Which-ID" );
sal_Int32 nX = 1, nY = 1;
@@ -499,7 +498,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BOX:
{
- SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem);
+ const SvxBoxItem* pBox = dynamic_cast< const SvxBoxItem* >( &rItem);
DBG_ASSERT( pBox != NULL, "Wrong WHich-ID" );
/**
@@ -747,7 +746,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BREAK:
{
- const SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem);
+ const SvxFmtBreakItem* pFmtBreak = dynamic_cast< const SvxFmtBreakItem* >( &rItem);
DBG_ASSERT( pFmtBreak != NULL, "Wrong Which-ID" );
sal_uInt16 eEnum = 0;
@@ -794,7 +793,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_KEEP:
{
- SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem);
+ const SvxFmtKeepItem* pFmtKeep = dynamic_cast< const SvxFmtKeepItem* >( &rItem);
DBG_ASSERT( pFmtKeep != NULL, "Wrong Which-ID" );
aOut.append( pFmtKeep->GetValue()
@@ -806,7 +805,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BACKGROUND:
{
- SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem);
+ const SvxBrushItem* pBrush = dynamic_cast< const SvxBrushItem* >( &rItem);
DBG_ASSERT( pBrush != NULL, "Wrong Which-ID" );
// note: the graphic is only exported if nMemberId equals
@@ -917,7 +916,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_PAGEDESC:
{
- const SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem);
+ const SwFmtPageDesc* pPageDesc = dynamic_cast< const SwFmtPageDesc* >( &rItem);
DBG_ASSERT( pPageDesc != NULL, "Wrong Which-ID" );
if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId )
@@ -939,7 +938,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_LAYOUT_SPLIT:
case RES_ROW_SPLIT:
{
- const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
+ const SfxBoolItem* pSplit = dynamic_cast< const SfxBoolItem* >( &rItem);
DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
rUnitConverter.convertBool( aOut, pSplit->GetValue() );
@@ -949,7 +948,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_HORI_ORIENT:
{
- SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem);
+ const SwFmtHoriOrient* pHoriOrient = dynamic_cast< const SwFmtHoriOrient* >( &rItem);
DBG_ASSERT( pHoriOrient != NULL, "Wrong Which-ID" );
rUnitConverter.convertEnum( aOut, pHoriOrient->GetHoriOrient(),
@@ -960,7 +959,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_VERT_ORIENT:
{
- SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem);
+ const SwFmtVertOrient* pVertOrient = dynamic_cast< const SwFmtVertOrient* >( &rItem);
DBG_ASSERT( pVertOrient != NULL, "Wrong Which-ID" );
rUnitConverter.convertEnum( aOut, pVertOrient->GetVertOrient(),
@@ -971,7 +970,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_FRM_SIZE:
{
- SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem);
+ const SwFmtFrmSize* pFrmSize = dynamic_cast< const SwFmtFrmSize* >( &rItem);
DBG_ASSERT( pFrmSize != NULL, "Wrong Which-ID" );
sal_Bool bOutHeight = sal_False;
@@ -1024,7 +1023,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_COLLAPSING_BORDERS:
{
- const SfxBoolItem* pBorders = PTR_CAST(SfxBoolItem, &rItem);
+ const SfxBoolItem* pBorders = dynamic_cast< const SfxBoolItem* >( &rItem);
DBG_ASSERT( pBorders != NULL, "Wrong RES-ID" );
aOut.append( pBorders->GetValue()
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 3fa7e9d325b8..ad91efae3b13 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -221,8 +221,6 @@ public:
const uno::Reference< xml::sax::XAttributeList > & xAttrList );
virtual ~SwXMLConditionContext_Impl();
- TYPEINFO();
-
sal_Bool IsValid() const { return 0 != nCondition; }
sal_uInt32 GetCondition() const { return nCondition; }
@@ -272,8 +270,6 @@ SwXMLConditionContext_Impl::~SwXMLConditionContext_Impl()
{
}
-TYPEINIT1( SwXMLConditionContext_Impl, XMLTextStyleContext );
-
// ---------------------------------------------------------------------
typedef SwXMLConditionContext_Impl *SwXMLConditionContextPtr;
@@ -289,8 +285,6 @@ protected:
public:
- TYPEINFO();
-
SwXMLTextStyleContext_Impl( SwXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList > & xAttrList,
@@ -306,8 +300,6 @@ public:
virtual void Finish( sal_Bool bOverwrite );
};
-TYPEINIT1( SwXMLTextStyleContext_Impl, XMLTextStyleContext );
-
uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create()
{
uno::Reference < style::XStyle > xNewStyle;
@@ -473,8 +465,6 @@ protected:
public:
- TYPEINFO();
-
SwXMLItemSetStyleContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -577,8 +567,6 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateItemSetContext(
return pContext;
}
-TYPEINIT1( SwXMLItemSetStyleContext_Impl, SvXMLStyleContext );
-
SwXMLItemSetStyleContext_Impl::SwXMLItemSetStyleContext_Impl( SwXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList > & xAttrList,
@@ -765,8 +753,6 @@ protected:
public:
- TYPEINFO();
-
SwXMLStylesContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName ,
@@ -779,12 +765,10 @@ public:
virtual void EndElement();
};
-TYPEINIT1( SwXMLStylesContext_Impl, SvXMLStylesContext );
-
inline SwXMLItemSetStyleContext_Impl *SwXMLStylesContext_Impl::GetSwStyle(
sal_uInt16 i ) const
{
- return PTR_CAST( SwXMLItemSetStyleContext_Impl, GetStyle( i ) );
+ return const_cast< SwXMLItemSetStyleContext_Impl* >( dynamic_cast< const SwXMLItemSetStyleContext_Impl* >( GetStyle( i ) ) );
}
SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleStyleChildContext(
@@ -965,8 +949,6 @@ protected:
public:
- TYPEINFO();
-
SwXMLMasterStylesContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName ,
@@ -975,8 +957,6 @@ public:
virtual void EndElement();
};
-TYPEINIT1( SwXMLMasterStylesContext_Impl, XMLTextMasterStylesContext );
-
SwXMLMasterStylesContext_Impl::SwXMLMasterStylesContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName ,
@@ -1098,10 +1078,7 @@ sal_Bool SwXMLImport::FindAutomaticStyle(
SwXMLItemSetStyleContext_Impl *pStyle = 0;
if( GetAutoStyles() )
{
- pStyle = PTR_CAST( SwXMLItemSetStyleContext_Impl,
- GetAutoStyles()->
- FindStyleChildContext( nFamily, rName,
- sal_True ) );
+ pStyle = const_cast< SwXMLItemSetStyleContext_Impl* >( dynamic_cast< const SwXMLItemSetStyleContext_Impl* >( GetAutoStyles()->FindStyleChildContext( nFamily, rName, sal_True ) ) );
if( pStyle )
{
if( ppItemSet )
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 2be65cd82cc0..b356122573f3 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -69,6 +69,7 @@
#include <xmloff/xmlmetai.hxx>
#include <xmloff/xformsimport.hxx>
+#include <svx/fmmodel.hxx>
using ::rtl::OUString;
@@ -138,8 +139,6 @@ public:
const Reference< xml::sax::XAttributeList > & xAttrList );
virtual ~SwXMLBodyContext_Impl();
- TYPEINFO();
-
virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList );
@@ -156,8 +155,6 @@ SwXMLBodyContext_Impl::~SwXMLBodyContext_Impl()
{
}
-TYPEINIT1( SwXMLBodyContext_Impl, SvXMLImportContext );
-
SvXMLImportContext *SwXMLBodyContext_Impl::CreateChildContext(
sal_uInt16 /*nPrefix*/,
const OUString& rLocalName,
@@ -188,8 +185,6 @@ public:
const Reference< xml::sax::XAttributeList > & xAttrList );
virtual ~SwXMLDocContext_Impl();
- TYPEINFO();
-
virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
const Reference< xml::sax::XAttributeList > & xAttrList );
@@ -206,8 +201,6 @@ SwXMLDocContext_Impl::~SwXMLDocContext_Impl()
{
}
-TYPEINIT1( SwXMLDocContext_Impl, SvXMLImportContext );
-
SvXMLImportContext *SwXMLDocContext_Impl::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
@@ -284,8 +277,6 @@ public:
const Reference< xml::sax::XDocumentHandler >& xDocBuilder);
virtual ~SwXMLOfficeDocContext_Impl();
- TYPEINFO();
-
virtual SvXMLImportContext *CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
@@ -309,8 +300,6 @@ SwXMLOfficeDocContext_Impl::~SwXMLOfficeDocContext_Impl()
{
}
-TYPEINIT1( SwXMLOfficeDocContext_Impl, SwXMLDocContext_Impl );
-
SvXMLImportContext* SwXMLOfficeDocContext_Impl::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
@@ -351,8 +340,6 @@ public:
const Reference< xml::sax::XAttributeList > & xAttrList );
virtual ~SwXMLDocStylesContext_Impl();
- TYPEINFO();
-
virtual void EndElement();
};
@@ -370,8 +357,6 @@ SwXMLDocStylesContext_Impl::~SwXMLDocStylesContext_Impl()
{
}
-TYPEINIT1( SwXMLDocStylesContext_Impl, SwXMLDocContext_Impl );
-
void SwXMLDocStylesContext_Impl::EndElement()
{
// assign paragraph styles to list levels of outline style after all styles
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 4d0204854a1a..2dc79a7c53e2 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -167,7 +167,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
&pItem ) )
{
SfxPoolItem *pNew = pItem->Clone();
- pUnknownItem = PTR_CAST( SvXMLAttrContainerItem, pNew );
+ pUnknownItem = dynamic_cast< SvXMLAttrContainerItem* >( pNew );
DBG_ASSERT( pUnknownItem,
"SvXMLAttrContainerItem expected" );
if( !pUnknownItem )
@@ -245,7 +245,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
{
case RES_LR_SPACE:
{
- SvxLRSpaceItem* pLRSpace = PTR_CAST(SvxLRSpaceItem, &rItem);
+ SvxLRSpaceItem* pLRSpace = dynamic_cast< SvxLRSpaceItem* >( &rItem);
DBG_ASSERT( pLRSpace != NULL, "Wrong Which-ID!" );
switch( nMemberId )
@@ -306,7 +306,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_UL_SPACE:
{
- SvxULSpaceItem* pULSpace = PTR_CAST(SvxULSpaceItem, &rItem);
+ SvxULSpaceItem* pULSpace = dynamic_cast< SvxULSpaceItem* >( &rItem);
DBG_ASSERT( pULSpace != NULL, "Wrong Which-ID!" );
sal_Int32 nProp = 100;
@@ -333,7 +333,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_SHADOW:
{
- SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem);
+ SvxShadowItem* pShadow = dynamic_cast< SvxShadowItem* >( &rItem);
DBG_ASSERT( pShadow != NULL, "Wrong Which-ID" );
sal_Bool bColorFound = sal_False;
@@ -412,7 +412,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_BOX:
{
- SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem);
+ SvxBoxItem* pBox = dynamic_cast< SvxBoxItem* >( &rItem);
DBG_ASSERT( pBox != NULL, "Wrong WHich-ID" );
/** copy SvxBorderLines */
@@ -583,7 +583,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_BREAK:
{
- SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem);
+ SvxFmtBreakItem* pFmtBreak = dynamic_cast< SvxFmtBreakItem* >( &rItem);
DBG_ASSERT( pFmtBreak != NULL, "Wrong Which-ID" );
sal_uInt16 eEnum;
@@ -618,7 +618,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_KEEP:
{
- SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem);
+ SvxFmtKeepItem* pFmtKeep = dynamic_cast< SvxFmtKeepItem* >( &rItem);
DBG_ASSERT( pFmtKeep != NULL, "Wrong Which-ID" );
if( IsXMLToken( rValue, XML_ALWAYS ) ||
@@ -638,7 +638,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_BACKGROUND:
{
- SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem);
+ SvxBrushItem* pBrush = dynamic_cast< SvxBrushItem* >( &rItem);
DBG_ASSERT( pBrush != NULL, "Wrong Which-ID" );
Color aTempColor;
@@ -780,7 +780,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_PAGEDESC:
{
- SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem);
+ SwFmtPageDesc* pPageDesc = dynamic_cast< SwFmtPageDesc* >( &rItem);
DBG_ASSERT( pPageDesc != NULL, "Wrong Which-ID" );
if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId )
@@ -796,7 +796,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_LAYOUT_SPLIT:
case RES_ROW_SPLIT:
{
- SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
+ SfxBoolItem* pSplit = dynamic_cast< SfxBoolItem* >( &rItem);
DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
if( IsXMLToken( rValue, XML_AUTO ) ||
@@ -816,7 +816,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_HORI_ORIENT:
{
- SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem);
+ SwFmtHoriOrient* pHoriOrient = dynamic_cast< SwFmtHoriOrient* >( &rItem);
DBG_ASSERT( pHoriOrient != NULL, "Wrong Which-ID" );
sal_uInt16 nValue;
@@ -829,7 +829,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_VERT_ORIENT:
{
- SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem);
+ SwFmtVertOrient* pVertOrient = dynamic_cast< SwFmtVertOrient* >( &rItem);
DBG_ASSERT( pVertOrient != NULL, "Wrong Which-ID" );
sal_uInt16 nValue;
@@ -848,7 +848,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_FRM_SIZE:
{
- SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem);
+ SwFmtFrmSize* pFrmSize = dynamic_cast< SwFmtFrmSize* >( &rItem);
DBG_ASSERT( pFrmSize != NULL, "Wrong Which-ID" );
sal_Bool bSetHeight = sal_False;
@@ -952,7 +952,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_COLLAPSING_BORDERS:
{
- SfxBoolItem* pBorders = PTR_CAST(SfxBoolItem, &rItem);
+ SfxBoolItem* pBorders = dynamic_cast< SfxBoolItem* >( &rItem);
DBG_ASSERT( pBorders != NULL, "Wrong Which-ID" );
if( IsXMLToken( rValue, XML_COLLAPSING ) )
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index b962b434ed9c..7a32d172b430 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -1155,7 +1155,7 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd )
sal_True, sal_True );
// export DDE source (if this is a DDE table)
- if ( rTbl.ISA(SwDDETable) )
+ if ( dynamic_cast< const SwDDETable* >(&rTbl) )
{
// get DDE Field Type (contains the DDE connection)
const SwDDEFieldType* pDDEFldType =
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 1421b77db3e6..1f647c7c07db 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1060,8 +1060,6 @@ class SwXMLDDETableContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
SwXMLDDETableContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName);
@@ -1077,8 +1075,6 @@ public:
sal_Bool GetIsAutomaticUpdate() { return bIsAutomaticUpdate; }
};
-TYPEINIT1( SwXMLDDETableContext_Impl, SvXMLImportContext );
-
SwXMLDDETableContext_Impl::SwXMLDDETableContext_Impl(
SwXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName) :
SvXMLImportContext(rImport, nPrfx, rLName),
@@ -1282,8 +1278,6 @@ SwXMLTableCell_Impl *SwXMLTableContext::GetCell( sal_uInt32 nRow,
return (*pRows)[(sal_uInt16)nRow]->GetCell( (sal_uInt16)nCol );
}
-TYPEINIT1( SwXMLTableContext, XMLTextTableContext );
-
SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
sal_uInt16 nPrfx,
const OUString& rLName,
diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx
index 079a14a18e39..7c594759ff0d 100644
--- a/sw/source/filter/xml/xmltbli.hxx
+++ b/sw/source/filter/xml/xmltbli.hxx
@@ -137,8 +137,6 @@ class SwXMLTableContext : public XMLTextTableContext
public:
- TYPEINFO();
-
SwXMLTableContext( SwXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 34b3b4bcd476..afbe3ae66d89 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -237,7 +237,7 @@ static sal_uInt16 nTitleNo = 0;
SfxAbstractTabDialog * pDlg=NULL;
short nMode = ENV_INSERT;
- SFX_REQUEST_ARG( rReq, pItem, SwEnvItem, FN_ENVELOP, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SwEnvItem, FN_ENVELOP );
if ( !pItem )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
@@ -249,7 +249,7 @@ static sal_uInt16 nTitleNo = 0;
}
else
{
- SFX_REQUEST_ARG( rReq, pBoolItem, SfxBoolItem, FN_PARAM_1, sal_False );
+ SFX_REQUEST_ARG( rReq, pBoolItem, SfxBoolItem, FN_PARAM_1 );
if ( pBoolItem && pBoolItem->GetValue() )
nMode = ENV_NEWDOC;
}
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 47b9667dba33..7571a7028e17 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -155,7 +155,7 @@ void SwModule::StateOther(SfxItemSet &rSet)
sal_uInt16 nWhich = aIter.FirstWhich();
SwView* pActView = ::GetActiveView();
- sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pActView);
+ sal_Bool bWebView = 0 != dynamic_cast< SwWebView* >( pActView);
while(nWhich)
{
@@ -167,7 +167,7 @@ void SwModule::StateOther(SfxItemSet &rSet)
{
sal_Bool bDisable = sal_False;
SfxViewShell* pCurrView = SfxViewShell::Current();
- if( !pCurrView || (pCurrView && !pCurrView->ISA(SwView)) )
+ if( !pCurrView || (pCurrView && !dynamic_cast< SwView* >(pCurrView)) )
bDisable = sal_True;
SwDocShell *pDocSh = (SwDocShell*) SfxObjectShell::Current();
if ( bDisable ||
@@ -230,9 +230,9 @@ SwView* lcl_LoadDoc(SwView* pView, const String& rURL)
SfxViewShell* pViewShell = pShell->GetViewShell();
if(pViewShell)
{
- if( pViewShell->ISA(SwView) )
+ pNewView = dynamic_cast< SwView* >(pViewShell);
+ if( pNewView )
{
- pNewView = PTR_CAST(SwView,pViewShell);
pNewView->GetViewFrame()->GetFrame().Appear();
}
else
@@ -250,7 +250,7 @@ SwView* lcl_LoadDoc(SwView* pView, const String& rURL)
SFX_CALLMODE_SYNCHRON, &aFactory, 0L);
SfxFrame* pFrm = pItem ? pItem->GetFrame() : 0;
SfxViewFrame* pFrame = pFrm ? pFrm->GetCurrentViewFrame() : 0;
- pNewView = pFrame ? PTR_CAST(SwView, pFrame->GetViewShell()) : 0;
+ pNewView = pFrame ? dynamic_cast< SwView* >( pFrame->GetViewShell()) : 0;
}
return pNewView;
@@ -645,7 +645,7 @@ void SwModule::ExecOther(SfxRequest& rReq)
case FUNIT_POINT:
{
SwView* pActView = ::GetActiveView();
- sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pActView);
+ sal_Bool bWebView = 0 != dynamic_cast< SwWebView* >( pActView);
::SetDfltMetric(eUnit, bWebView);
}
break;
@@ -656,7 +656,7 @@ void SwModule::ExecOther(SfxRequest& rReq)
case FN_SET_MODOPT_TBLNUMFMT:
{
- sal_Bool bWebView = 0 != PTR_CAST(SwWebView, ::GetActiveView() ),
+ sal_Bool bWebView = 0 != dynamic_cast< SwWebView* >( ::GetActiveView() ),
bSet;
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(
@@ -685,14 +685,16 @@ void SwModule::ExecOther(SfxRequest& rReq)
// Hint abfangen fuer DocInfo
void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( rHint.ISA( SfxEventHint ) )
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if( pSfxEventHint )
{
- SfxEventHint& rEvHint = (SfxEventHint&) rHint;
- SwDocShell* pDocSh = PTR_CAST( SwDocShell, rEvHint.GetObjShell() );
+ SwDocShell* pDocSh = dynamic_cast< SwDocShell* >(pSfxEventHint->GetObjShell());
+
if( pDocSh )
{
SwWrtShell* pWrtSh = pDocSh ? pDocSh->GetWrtShell() : 0;
- switch( rEvHint.GetEventId() )
+ switch( pSfxEventHint->GetEventId() )
{
case SFX_EVENT_LOADFINISHED:
OSL_ASSERT(!pWrtSh);
@@ -700,9 +702,7 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
// update fixed fields
if (pDocSh->GetMedium())
{
- SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(),
- pTemplateItem, SfxBoolItem,
- SID_TEMPLATE, sal_False);
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE);
if (pTemplateItem && pTemplateItem->GetValue())
{
pDocSh->GetDoc()->SetFixFields(false, 0);
@@ -712,7 +712,7 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SFX_EVENT_CREATEDOC:
if( pWrtSh )
{
- SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE );
sal_Bool bUpdateFields = sal_True;
if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
bUpdateFields = sal_False;
@@ -736,9 +736,13 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
}
- else if(rHint.ISA(SfxItemSetHint))
+ else
{
- if( SFX_ITEM_SET == ((SfxItemSetHint&)rHint).GetItemSet().GetItemState(SID_ATTR_PATHNAME))
+ const SfxItemSetHint* pSfxItemSetHint = dynamic_cast< const SfxItemSetHint* >(&rHint);
+
+ if(pSfxItemSetHint)
+ {
+ if( SFX_ITEM_SET == pSfxItemSetHint->GetItemSet().GetItemState(SID_ATTR_PATHNAME))
{
::GetGlossaries()->UpdateGlosPath( sal_False );
SwGlossaryList* pList = ::GetGlossaryList();
@@ -746,9 +750,13 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
pList->Update();
}
}
- else if(rHint.ISA(SfxSimpleHint))
+ else
+ {
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint)
{
- sal_uInt16 nHintId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uInt16 nHintId = pSfxSimpleHint->GetId();
if(SFX_HINT_DEINITIALIZING == nHintId)
{
DELETEZ(pWebUsrPref);
@@ -791,6 +799,8 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
}
}
+ }
+}
void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal_uInt32 )
{
@@ -803,14 +813,11 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal
sal_Int32 const nNew = GetUndoOptions().GetUndoCount();
bool const bUndo = (nNew != 0);
// switch Undo for all DocShells
- TypeId aType(TYPE(SwDocShell));
- SwDocShell * pDocShell =
- static_cast<SwDocShell *>(SfxObjectShell::GetFirst(&aType));
+ SwDocShell * pDocShell = static_cast< SwDocShell* >(SfxObjectShell::GetFirst(_IsObjectShell< SwDocShell >));
while (pDocShell)
{
pDocShell->GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo);
- pDocShell = static_cast<SwDocShell *>(
- SfxObjectShell::GetNext(*pDocShell, &aType));
+ pDocShell = static_cast< SwDocShell* >(SfxObjectShell::GetNext(*pDocShell, _IsObjectShell< SwDocShell >));
}
}
else if ( pBrdCst == pColorConfig || pBrdCst == pAccessibilityOptions )
@@ -822,24 +829,22 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal
bAccessibility = sal_True;
//invalidate all edit windows
- const TypeId aSwViewTypeId = TYPE(SwView);
- const TypeId aSwPreViewTypeId = TYPE(SwPagePreView);
- const TypeId aSwSrcViewTypeId = TYPE(SwSrcView);
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while(pViewShell)
{
if(pViewShell->GetWindow())
{
- if((pViewShell->IsA(aSwViewTypeId) ||
- pViewShell->IsA(aSwPreViewTypeId) ||
- pViewShell->IsA(aSwSrcViewTypeId)))
+ SwView* pSwView = dynamic_cast< SwView* >(this);
+ SwPagePreView* pSwPagePreView = dynamic_cast< SwPagePreView* >(this);
+
+ if(pSwView || pSwPagePreView || dynamic_cast< SwSrcView* >(this))
{
if(bAccessibility)
{
- if(pViewShell->IsA(aSwViewTypeId))
- ((SwView*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions);
- else if(pViewShell->IsA(aSwPreViewTypeId))
- ((SwPagePreView*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions);
+ if(pSwView)
+ pSwView->ApplyAccessiblityOptions(*pAccessibilityOptions);
+ else if(pSwPagePreView)
+ pSwPagePreView->ApplyAccessiblityOptions(*pAccessibilityOptions);
}
pViewShell->GetWindow()->Invalidate();
}
@@ -852,7 +857,7 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal
const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
while( pObjSh )
{
- if( pObjSh->IsA(TYPE(SwDocShell)) )
+ if( dynamic_cast< const SwDocShell* >(pObjSh) )
{
const SwDoc* pDoc = ((SwDocShell*)pObjSh)->GetDoc();
ViewShell* pVSh = 0;
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx
index c757efd5ac0b..e8bf2d66ccb8 100644
--- a/sw/source/ui/app/appopt.cxx
+++ b/sw/source/ui/app/appopt.cxx
@@ -96,7 +96,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
if(pAppView)
{
// wenn Text dann nicht WebView und umgekehrt
- sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView);
+ sal_Bool bWebView = 0 != dynamic_cast< SwWebView* >( pAppView);
if( (bWebView && !bTextDialog) ||(!bWebView && bTextDialog))
{
aViewOpt = *pAppView->GetWrtShell().GetViewOptions();
@@ -191,7 +191,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
}
if(bTextDialog)
pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig()));
- if( PTR_CAST( SwPagePreView, SfxViewShell::Current())!=0)
+ if( dynamic_cast< SwPagePreView* >( SfxViewShell::Current())!=0)
{
SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, sal_True));
pRet->Put(aBool);
@@ -297,7 +297,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
if(pAppView)
{
// the text dialog mustn't apply data to the web view and vice versa
- sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView);
+ sal_Bool bWebView = 0 != dynamic_cast< SwWebView* >( pAppView);
if( (bWebView == bTextDialog))
pAppView = 0; //
}
@@ -405,7 +405,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
- if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
+ if( (bool)aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
Size aSize = Size( pGridItem->GetFldDrawX() ,
pGridItem->GetFldDrawY() );
@@ -563,7 +563,7 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI
if(pCurrView)
{
// wenn Text dann nicht WebView und umgekehrt
- sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pCurrView);
+ sal_Bool bWebView = 0 != dynamic_cast< SwWebView* >( pCurrView);
if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
(!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
{
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 1a7e34fae09e..82c3fda71d3b 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -130,8 +130,6 @@ SFX_IMPL_INTERFACE( SwDocShell, SfxObjectShell, SW_RES(0) )
SFX_CHILDWINDOW_REGISTRATION( SID_HYPERLINK_INSERT );
}
-TYPEINIT2(SwDocShell, SfxObjectShell, SfxListener);
-
//-------------------------------------------------------------------------
SFX_IMPL_OBJECTFACTORY(SwDocShell, SvGlobalName(SO3_SW_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter" )
@@ -205,7 +203,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
}
// #i30171# set the UpdateDocMode at the SwDocShell
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE );
nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
if( pFlt->GetDefaultTemplate().Len() )
@@ -248,7 +246,7 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium )
SW_MOD()->SetEmbeddedLoadSave(
SFX_CREATE_MODE_EMBEDDED == GetCreateMode() );
- pRdr->GetDoc()->set(IDocumentSettingAccess::HTML_MODE, ISA(SwWebDocShell));
+ pRdr->GetDoc()->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this));
/* #106748# Restore the pool default if reading a saved document. */
pDoc->RemoveAllFmtLanguageDependencies();
@@ -453,7 +451,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
uno::Reference < embed::XStorage > xStor = rMedium.GetOutputStorage();
if( SfxObjectShell::SaveAs( rMedium ) )
{
- if( GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) && !ISA( SwGlobalDocShell ) )
+ if( GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) && !dynamic_cast< SwGlobalDocShell* >(this) )
{
// This is to set the correct class id if SaveAs is
// called from SwDoc::SplitDoc to save a normal doc as
@@ -534,7 +532,7 @@ SwSrcView* lcl_GetSourceView( SwDocShell* pSh )
// sind wir in der SourceView?
SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( pSh );
SfxViewShell* pViewShell = pVFrame ? pVFrame->GetViewShell() : 0;
- return PTR_CAST( SwSrcView, pViewShell);
+ return dynamic_cast< SwSrcView* >( pViewShell);
}
sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
@@ -639,9 +637,9 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
{
// eigenen Typ ermitteln
sal_uInt8 nMyType = 0;
- if( ISA( SwWebDocShell) )
+ if( dynamic_cast< SwWebDocShell* >(this) )
nMyType = 1;
- else if( ISA( SwGlobalDocShell) )
+ else if( dynamic_cast< SwGlobalDocShell* >(this) )
nMyType = 2;
// gewuenschten Typ ermitteln
@@ -855,7 +853,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
pDev->SetFillColor();
pDev->SetLineColor();
pDev->SetBackground();
- sal_Bool bWeb = 0 != PTR_CAST(SwWebDocShell, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebDocShell* >( this);
SwPrintData aOpts;
ViewShell::PrtOle2( pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect );
pDev->Pop();
@@ -991,7 +989,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this);
while (pTmpFrm) // Preview suchen
{
- if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) &&
+ if ( dynamic_cast< SwView* >(pTmpFrm->GetViewShell()) &&
((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
{
bDisable = sal_True;
@@ -1005,9 +1003,9 @@ void SwDocShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( SID_PRINTPREVIEW );
else
{
- SfxBoolItem aBool( SID_PRINTPREVIEW, sal_False );
- if( PTR_CAST( SwPagePreView, SfxViewShell::Current()) )
- aBool.SetValue( sal_True );
+ SfxBoolItem aBool( SID_PRINTPREVIEW, false);
+ if( dynamic_cast< SwPagePreView* >( SfxViewShell::Current()) )
+ aBool.SetValue( true );
rSet.Put( aBool );
}
}
@@ -1016,7 +1014,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
{
SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView()
: SfxViewShell::Current();
- sal_Bool bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView);
+ sal_Bool bSourceView = 0 != dynamic_cast< SwSrcView* >( pCurrView);
rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView));
}
break;
@@ -1050,12 +1048,12 @@ void SwDocShell::GetState(SfxItemSet& rSet)
break;
case FN_NEW_GLOBAL_DOC:
- if ( ISA(SwGlobalDocShell) )
+ if ( dynamic_cast< SwGlobalDocShell* >(this) )
rSet.DisableItem( nWhich );
break;
case FN_NEW_HTML_DOC:
- if( ISA( SwWebDocShell ) )
+ if( dynamic_cast< SwWebDocShell* >(this) )
rSet.DisableItem( nWhich );
break;
@@ -1174,7 +1172,7 @@ void SwDocShell::LoadingFinished()
if(pVFrame)
{
SfxViewShell* pShell = pVFrame->GetViewShell();
- if(PTR_CAST(SwSrcView, pShell))
+ if(dynamic_cast< SwSrcView* >( pShell))
((SwSrcView*)pShell)->Load(this);
}
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 4a85efb51c9b..337d95e53a0a 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -144,7 +144,7 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
{
//Nicht fuer SourceView.
SfxViewShell *pVSh = SfxViewShell::Current();
- if ( pVSh && !pVSh->ISA(SwSrcView) )
+ if ( pVSh && !dynamic_cast< SwSrcView* >(pVSh) )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
@@ -219,10 +219,12 @@ void SwDocShell::DoFlushDocInfo()
void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventProcessor >& xVbaEvents, const SfxHint& rHint )
{
using namespace com::sun::star::script::vba::VBAEventId;
- if ( rHint.ISA( SfxEventHint ) )
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if(pSfxEventHint)
{
uno::Sequence< uno::Any > aArgs;
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = pSfxEventHint->GetEventId();
switch( nEventId )
{
case SFX_EVENT_CREATEDOC:
@@ -256,10 +258,12 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
#endif
sal_uInt16 nAction = 0;
- if( rHint.ISA(SfxSimpleHint) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if( pSfxSimpleHint )
{
// swithc for more actions
- switch( ((SfxSimpleHint&) rHint).GetId() )
+ switch( pSfxSimpleHint->GetId() )
{
case SFX_HINT_TITLECHANGED:
if( GetMedium() )
@@ -267,13 +271,17 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
break;
}
}
- else if( rHint.ISA(SfxEventHint) &&
- ((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_LOADFINISHED )
+ else
+ {
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if( pSfxEventHint && SFX_EVENT_LOADFINISHED == pSfxEventHint->GetEventId() )
{
// --> OD 2004-12-03 #i38126# - own action id
nAction = 3;
// <--
}
+ }
if( nAction )
{
@@ -444,7 +452,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource,
rtl::Reference< SwDocStyleSheet > xNewSheet( new SwDocStyleSheet( (SwDocStyleSheet&)pMyPool
->Make(rOldName, eOldFamily, pHisSheet->GetMask() ) ) );
- if( SFX_STYLE_FAMILY_PAGE == eOldFamily && rSource.ISA(SwDocShell) )
+ if( SFX_STYLE_FAMILY_PAGE == eOldFamily && dynamic_cast< SwDocShell* >(&rSource) )
{
// gesondert behandeln!!
SwPageDesc* pDestDsc = (SwPageDesc*)xNewSheet->GetPageDesc();
@@ -712,10 +720,9 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
// call on all Docs the idle formatter to start
// the collection of Words
- TypeId aType = TYPE(SwDocShell);
- for( SwDocShell *pDocSh = (SwDocShell*)SfxObjectShell::GetFirst(&aType);
+ for( SwDocShell *pDocSh = (SwDocShell*)SfxObjectShell::GetFirst( _IsObjectShell< SwDocShell > );
pDocSh;
- pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) )
+ pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, _IsObjectShell< SwDocShell > ) )
{
SwDoc* pTmp = pDocSh->GetDoc();
if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225
@@ -731,17 +738,20 @@ void SwDocShell::Execute(SfxRequest& rReq)
SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this);
SfxViewShell* pViewShell = SfxViewShell::Current();
SwView* pCurrView = dynamic_cast< SwView *> ( pViewShell );
- sal_Bool bCurrent = IS_TYPE( SwPagePreView, pViewShell );
+ sal_Bool bCurrent = pViewShell && typeid(SwPagePreView) == typeid(*pViewShell); // IS_TYPE( SwPagePreView, pViewShell );
while( pTmpFrm ) // search PreView
{
- if( IS_TYPE( SwView, pTmpFrm->GetViewShell()) )
+ if(pTmpFrm->GetViewShell())
+ {
+ if( typeid(SwView) == typeid(*pTmpFrm->GetViewShell()) ) // IS_TYPE( SwView, pTmpFrm->GetViewShell()) )
bOnly = sal_False;
- else if( IS_TYPE( SwPagePreView, pTmpFrm->GetViewShell()))
+ else if( typeid(SwPagePreView) == typeid(*pTmpFrm->GetViewShell()) ) // IS_TYPE( SwPagePreView, pTmpFrm->GetViewShell()))
{
pTmpFrm->GetFrame().Appear();
bFound = sal_True;
}
+ }
if( bFound && !bOnly )
break;
pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this);
@@ -763,7 +773,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
//JP 23.8.2001: Bug 91360 - PagePreView in the WebDocShell
// is found under Id ViewShell2.
- if( ISA(SwWebDocShell) && SID_VIEWSHELL1 == nSlotId )
+ if( dynamic_cast< SwWebDocShell* >(this) && SID_VIEWSHELL1 == nSlotId )
nSlotId = SID_VIEWSHELL2;
if( pCurrView && pCurrView->GetDocShell() == this )
@@ -799,11 +809,11 @@ void SwDocShell::Execute(SfxRequest& rReq)
if ( pArgs )
{
- SFX_REQUEST_ARG( rReq, pTemplateItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pTemplateItem, SfxStringItem, SID_TEMPLATE_NAME );
if ( pTemplateItem )
{
aFileName = pTemplateItem->GetValue();
- SFX_REQUEST_ARG( rReq, pFlagsItem, SfxInt32Item, SID_TEMPLATE_LOAD, sal_False );
+ SFX_REQUEST_ARG( rReq, pFlagsItem, SfxInt32Item, SID_TEMPLATE_LOAD );
if ( pFlagsItem )
nFlags = (sal_uInt16) pFlagsItem->GetValue();
}
@@ -1217,7 +1227,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich, sal_False, &pItem ) )
{
aFileName = ((const SfxStringItem*)pItem)->GetValue();
- SFX_ITEMSET_ARG( pArgs, pTemplItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False );
+ SFX_ITEMSET_ARG( pArgs, pTemplItem, SfxStringItem, SID_TEMPLATE_NAME );
if ( pTemplItem )
aTemplateName = pTemplItem->GetValue();
}
@@ -1508,7 +1518,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
case SID_ATTR_YEAR2000:
if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pItem ))
{
- DBG_ASSERT(pItem->ISA(SfxUInt16Item), "falsches Item");
+ DBG_ASSERT(dynamic_cast< const SfxUInt16Item* >(pItem), "falsches Item");
sal_uInt16 nYear2K = ((SfxUInt16Item*)pItem)->GetValue();
//ueber Views iterieren und den State an den FormShells setzen
diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx
index bcd76273aad5..e0aebb9047a4 100644
--- a/sw/source/ui/app/docshdrw.cxx
+++ b/sw/source/ui/app/docshdrw.cxx
@@ -48,6 +48,7 @@
#include <docsh.hxx>
#endif
#include <doc.hxx>
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index d27396e6ac07..ecb5ed14442e 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -122,10 +122,10 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
{
AddLink(); // pDoc / pIo ggf. anlegen
- sal_Bool bWeb = ISA( SwWebDocShell );
+ const bool bWeb(dynamic_cast< SwWebDocShell* >(this));
if ( bWeb )
bHTMLTemplSet = SetHTMLTemplate( *GetDoc() );//Styles aus HTML.vor
- else if( ISA( SwGlobalDocShell ) )
+ else if( dynamic_cast< SwGlobalDocShell* >(this) )
GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); // Globaldokument
@@ -477,7 +477,7 @@ void SwDocShell::AddLink()
SwDocFac aFactory;
pDoc = aFactory.GetDoc();
pDoc->acquire();
- pDoc->set(IDocumentSettingAccess::HTML_MODE, ISA(SwWebDocShell) );
+ pDoc->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this) );
}
else
pDoc->acquire();
@@ -574,7 +574,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() );
if(GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
{
- SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE );
nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
}
@@ -624,12 +624,12 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium )
// If a XML document is loaded, the global doc/web doc
// flags have to be set, because they aren't loaded
// by this formats.
- if( ISA( SwWebDocShell ) )
+ if( dynamic_cast< SwWebDocShell* >(this) )
{
if( !pDoc->get(IDocumentSettingAccess::HTML_MODE) )
pDoc->set(IDocumentSettingAccess::HTML_MODE, true);
}
- if( ISA( SwGlobalDocShell ) )
+ if( dynamic_cast< SwGlobalDocShell* >(this) )
{
if( !pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
@@ -752,7 +752,7 @@ void SwDocShell::SubInitNew()
pDoc->setLinkUpdateMode( GLOBALSETTING );
pDoc->setFieldUpdateFlags( AUTOUPD_GLOBALSETTING );
- sal_Bool bWeb = ISA(SwWebDocShell);
+ const bool bWeb(dynamic_cast< SwWebDocShell* >(this));
sal_uInt16 nRange[] = {
RES_PARATR_ADJUST, RES_PARATR_ADJUST,
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 93f0b3f50577..d8df0a4916a8 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -311,8 +311,8 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
else
{
// convert internal StyleName to DisplayName (slot implementation uses the latter)
- SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE, sal_False );
- SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE );
+ SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME );
if ( pFamilyItem && pNameItem )
{
uno::Reference< style::XStyleFamiliesSupplier > xModel(GetModel(), uno::UNO_QUERY);
@@ -1256,7 +1256,7 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent
// ist die Source unser Document, dann uebernehmen wir das
// abpruefen selbst (wesentlich schneller und laeuft nicht ueber
// die Kruecke SfxStylePool
- if( rSource.ISA( SwDocShell ))
+ if( dynamic_cast< SwDocShell* >(&rSource))
{
//JP 28.05.99: damit die Kopf-/Fusszeilen nicht den fixen Inhalt
// der Vorlage erhalten, einmal alle FixFelder der
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 6571453f808a..a8856d3aaa04 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -2883,10 +2883,11 @@ void SwStyleSheetIterator::AppendStyleList(const SvStringsDtor& rList,
void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
// suchen und aus der Anzeige-Liste entfernen !!
- if( rHint.ISA( SfxStyleSheetHint ) &&
- SFX_STYLESHEET_ERASED == ((SfxStyleSheetHint&) rHint).GetHint() )
+ const SfxStyleSheetHint* pSfxStyleSheetHint = dynamic_cast< const SfxStyleSheetHint* >(&rHint);
+
+ if( pSfxStyleSheetHint && SFX_STYLESHEET_ERASED == pSfxStyleSheetHint->GetHint() )
{
- SfxStyleSheetBase* pStyle = ((SfxStyleSheetHint&)rHint).GetStyleSheet();
+ SfxStyleSheetBase* pStyle = pSfxStyleSheetHint->GetStyleSheet();
if (pStyle)
{
diff --git a/sw/source/ui/app/swdll.cxx b/sw/source/ui/app/swdll.cxx
index 34eb1714cfdb..b73cbe624a33 100644
--- a/sw/source/ui/app/swdll.cxx
+++ b/sw/source/ui/app/swdll.cxx
@@ -19,22 +19,13 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <svx/svdobj.hxx>
#include <rtl/logfile.hxx>
-
-#ifndef _GLOBDOC_HRC
#include "globdoc.hrc"
-#endif
-
-#ifndef _SWDLL_HXX
#include <swdll.hxx>
-#endif
#include <wdocsh.hxx>
#include <globdoc.hxx>
#include <initui.hxx>
@@ -43,17 +34,12 @@
#include <init.hxx>
#include <dobjfac.hxx>
#include <cfgid.h>
-
#include <unotools/moduleoptions.hxx>
-
-#ifndef _FM_FMOBJFAC_HXX
#include <svx/fmobjfac.hxx>
-#endif
#include <svx/svdfield.hxx>
#include <svx/objfac3d.hxx>
-
#include <unomid.h>
-
+#include <svx/sdrobjectfactory.hxx>
/*************************************************************************
|*
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index a58133637f31..eae8bc938ec0 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -137,7 +137,7 @@ SwWrtShell* GetActiveWrtShell()
SwView* GetActiveView()
{
SfxViewShell* pView = SfxViewShell::Current();
- return PTR_CAST( SwView, pView );
+ return dynamic_cast< SwView* >( pView );
}
/*--------------------------------------------------------------------
Beschreibung: Ueber Views iterieren - static
@@ -146,17 +146,15 @@ SwView* GetActiveView()
SwView* SwModule::GetFirstView()
{
// liefert nur sichtbare SwViews
- const TypeId aTypeId = TYPE(SwView);
- SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
+ SwView* pView = (SwView*)SfxViewShell::GetFirst( _IsSfxViewShell< SwView >);
return pView;
}
SwView* SwModule::GetNextView(SwView* pView)
{
- DBG_ASSERT(PTR_CAST(SwView, pView),"keine SwView uebergeben");
- const TypeId aTypeId = TYPE(SwView);
- SwView* pNView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId, sal_True);
+ DBG_ASSERT(dynamic_cast< SwView* >( pView),"keine SwView uebergeben");
+ SwView* pNView = (SwView*)SfxViewShell::GetNext(*pView, _IsSfxViewShell< SwView >, sal_True);
return pNView;
}
@@ -175,13 +173,13 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
SwMasterUsrPref* pPref = (SwMasterUsrPref*)GetUsrPref( static_cast< sal_Bool >(
VIEWOPT_DEST_WEB == nDest ? sal_True :
VIEWOPT_DEST_TEXT== nDest ? sal_False :
- pCurrView && pCurrView->ISA(SwWebView) ));
+ pCurrView && dynamic_cast< SwWebView* >(pCurrView) ));
//per Uno soll nur die sdbcx::View, aber nicht das Module veraendert werden
sal_Bool bViewOnly = VIEWOPT_DEST_VIEW_ONLY == nDest;
//PreView abfruehstuecken
SwPagePreView* pPPView;
- if( !pCurrView && 0 != (pPPView = PTR_CAST( SwPagePreView, SfxViewShell::Current())) )
+ if( !pCurrView && 0 != (pPPView = dynamic_cast< SwPagePreView* >( SfxViewShell::Current())) )
{
if(!bViewOnly)
pPref->SetUIOptions( rUsrPref );
@@ -265,7 +263,7 @@ void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb )
// fuer alle MDI-Fenster das Lineal umschalten
while(pTmpView)
{
- if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView)))
+ if(bWeb == (0 != dynamic_cast< SwWebView* >( pTmpView)))
{
pTmpView->ChangeVLinealMetric(eVScrollMetric);
pTmpView->ChangeTabMetric(eHScrollMetric);
@@ -650,10 +648,9 @@ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling,
sal_Bool bInvalid = bOnlyWrong || bIsSpellAllAgain;
if( bOnlineSpelling || bInvalid )
{
- TypeId aType = TYPE(SwDocShell);
- for( SwDocShell *pDocSh = (SwDocShell*)SfxObjectShell::GetFirst(&aType);
+ for( SwDocShell *pDocSh = (SwDocShell*)SfxObjectShell::GetFirst( _IsObjectShell< SwDocShell > );
pDocSh;
- pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) )
+ pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, _IsObjectShell< SwDocShell > ) )
{
SwDoc* pTmp = pDocSh->GetDoc();
if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 2d61f849945d..ccf8b24fbad3 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -169,10 +169,6 @@ sal_Bool bNoInterrupt = sal_False;
#include <unomid.h>
using namespace com::sun::star;
-
-
-TYPEINIT1( SwModule, SfxModule );
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/sw/source/ui/chrdlg/ccoll.cxx b/sw/source/ui/chrdlg/ccoll.cxx
index 3751284c8657..4e6478f93f28 100644
--- a/sw/source/ui/chrdlg/ccoll.cxx
+++ b/sw/source/ui/chrdlg/ccoll.cxx
@@ -144,9 +144,6 @@ CommandStruct SwCondCollItem::aCmds[] =
{ PARA_IN_LIST, 9 }
};
-
-TYPEINIT1_AUTOFACTORY(SwCondCollItem, SfxPoolItem)
-
/****************************************************************************
Item fuer den Transport der Bedingungstabelle
****************************************************************************/
diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx
index 63b4fe798906..9c1571ecd99b 100644
--- a/sw/source/ui/config/cfgitems.cxx
+++ b/sw/source/ui/config/cfgitems.cxx
@@ -42,14 +42,6 @@
#include "cfgitems.hxx"
#include "crstate.hxx"
-
-
-TYPEINIT1_AUTOFACTORY(SwDocDisplayItem, SfxPoolItem)
-TYPEINIT1_AUTOFACTORY(SwElemItem, SfxPoolItem)
-TYPEINIT1_AUTOFACTORY(SwAddPrinterItem, SfxPoolItem)
-TYPEINIT1_AUTOFACTORY(SwShadowCursorItem, SfxPoolItem)
-
-
SwDocDisplayItem::SwDocDisplayItem( sal_uInt16 _nWhich ) :
SfxPoolItem(_nWhich),
aIndexBackgrndCol(COL_GRAY)
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index a7ffa61312c1..bcc968f4f49f 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -579,9 +579,9 @@ IMPL_LINK_INLINE_END( SwAddPrinterTabPage, SelectHdl, ListBox *, EMPTYARG )
void SwAddPrinterTabPage::PageCreated (SfxAllItemSet aSet)
{
- //SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_FAX_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pListItem,SfxBoolItem,SID_FAX_LIST,sal_False);
- SFX_ITEMSET_ARG (&aSet,pPreviewItem,SfxBoolItem,SID_PREVIEWFLAG_TYPE,sal_False);
+ //SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_FAX_LIST);
+ SFX_ITEMSET_ARG (&aSet,pListItem,SfxBoolItem,SID_FAX_LIST);
+ SFX_ITEMSET_ARG (&aSet,pPreviewItem,SfxBoolItem,SID_PREVIEWFLAG_TYPE);
if (pPreviewItem)
{
SetPreview(pPreviewItem->GetValue());
@@ -1211,7 +1211,7 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox )
void SwStdFontTabPage::PageCreated (SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt16Item, SID_FONTMODE_TYPE, sal_False);
+ SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt16Item, SID_FONTMODE_TYPE );
if (pFlagItem)
SetFontMode(sal::static_int_cast< sal_uInt8, sal_uInt16>( pFlagItem->GetValue()));
}
@@ -1484,7 +1484,7 @@ IMPL_LINK(SwTableOptionsTabPage, CheckBoxHdl, CheckBox*, EMPTYARG)
void SwTableOptionsTabPage::PageCreated (SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL);
if (pWrtSh)
SetWrtShell(pWrtSh->GetValue());
}
@@ -1577,7 +1577,7 @@ SfxTabPage* SwShdwCrsrOptionsTabPage::Create( Window* pParent, const SfxItemSet&
void SwShdwCrsrOptionsTabPage::PageCreated( SfxAllItemSet aSet )
{
- SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL);
if (pWrtSh)
SetWrtShell(pWrtSh->GetValue());
}
@@ -2092,13 +2092,12 @@ sal_Bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet& )
nOldMarkMode != pOpt->GetMarkAlignMode())
{
// Alle Dokumente aktualisieren
- TypeId aType(TYPE(SwDocShell));
- SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType);
+ SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst( _IsObjectShell< SwDocShell > );
while( pDocShell )
{
pDocShell->GetWrtShell()->UpdateRedlineAttr();
- pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
+ pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, _IsObjectShell< SwDocShell > );
}
}
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index 26e9b8bb0d21..aa38b7c0684b 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -380,7 +380,7 @@ AuthorCharAttr::AuthorCharAttr() :
sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
{
sal_uInt16 nRet = 0;
- if(!pShell || PTR_CAST(SwWebDocShell, pShell))
+ if(!pShell || dynamic_cast< const SwWebDocShell* >( pShell))
{
nRet = HTMLMODE_ON;
SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 1aa19a04264a..0f1ad79f61e0 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -3060,8 +3060,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
(bSynchronizedDoc && (nStartRow != nEndRow)? ExistsNextRecord() : ToNextMergeRecord()));
//deselect all, go out of the frame and go to the beginning of the document
- Point aPt(LONG_MIN, LONG_MIN);
- pTargetShell->SelectObj(aPt, SW_LEAVE_FRAME);
+ pTargetShell->SelectObj(basegfx::B2DPoint(LONG_MIN, LONG_MIN), SW_LEAVE_FRAME);
if (pTargetShell->IsSelFrmMode())
{
pTargetShell->UnSelectFrm();
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 26b0935fd33e..2468d12dd2e4 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1522,9 +1522,9 @@ AddressMultiLineEdit::~AddressMultiLineEdit()
-----------------------------------------------------------------------*/
void AddressMultiLineEdit::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if(rHint.ISA(TextHint) &&
- static_cast<const TextHint&>(rHint).GetId() == TEXT_HINT_VIEWSELECTIONCHANGED &&
- m_aSelectionLink.IsSet())
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if(pTextHint && TEXT_HINT_VIEWSELECTIONCHANGED == pTextHint->GetId() && m_aSelectionLink.IsSet())
{
m_aSelectionLink.Call(this);
}
diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx
index ebc9b13371f5..b0a43931742b 100644
--- a/sw/source/ui/dbui/mmconfigitem.cxx
+++ b/sw/source/ui/dbui/mmconfigitem.cxx
@@ -1875,14 +1875,13 @@ sal_uInt32 SwMailMergeConfigItem::GetMergedDocumentCount() const
-----------------------------------------------------------------------*/
SwView* lcl_ExistsView(SwView* pView)
{
- const TypeId aType(TYPE(SwView));
- SfxViewShell* pViewShell = SfxViewShell::GetFirst( &aType, sal_False );
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst( _IsSfxViewShell< SwView >, sal_False );
while(pViewShell)
{
if(pViewShell == pView)
return pView;
- pViewShell = SfxViewShell::GetNext( *pViewShell, &aType, sal_False );
+ pViewShell = SfxViewShell::GetNext( *pViewShell, _IsSfxViewShell< SwView >, sal_False );
}
return 0;
}
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index e49e10ff4905..e0f8f50594c8 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -54,7 +54,8 @@
#include <unotextrange.hxx>
#include <dialog.hrc>
#include <cmdid.h>
-
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -148,9 +149,8 @@ void lcl_LeaveDrawText(SwWrtShell& rSh)
if(rSh.GetDrawView())
{
rSh.GetDrawView()->SdrEndTextEdit( sal_True );
- Point aPt(LONG_MIN, LONG_MIN);
//go out of the frame
- rSh.SelectObj(aPt, SW_LEAVE_FRAME);
+ rSh.SelectObj(basegfx::B2DPoint(LONG_MIN, LONG_MIN), SW_LEAVE_FRAME);
rSh.EnterStdMode();
rSh.GetView().AttrChangedNotify(&rSh);
}
@@ -271,7 +271,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
{
SdrView* pSdrView = pWrtShell->GetDrawView();
m_pSpellState->m_SpellStartPosition = SPELL_START_DRAWTEXT;
- m_pSpellState->m_pStartDrawing = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
+ m_pSpellState->m_pStartDrawing = pSdrView->getSelectedIfSingle();
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
// start checking at the top of the drawing object
pOLV->SetSelection( ESelection() );
@@ -688,12 +688,15 @@ SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl()
sal_uInt16 nShellIdx = 0;
SfxShell* pShell;
while(0 != (pShell = pDispatch->GetShell(nShellIdx++)))
- if(pShell->ISA(SwView))
{
- pView = static_cast<SwView* >(pShell);
+ pView = dynamic_cast< SwView* >(pShell);
+
+ if(pView)
+ {
break;
}
}
+ }
return pView ? pView->GetWrtShellPtr(): 0;
}
@@ -743,7 +746,7 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM
else if ( rShell.HasSelection() || rView.IsDrawMode() )
{
SdrView *pSdrView = rShell.GetDrawView();
- if(pSdrView && pSdrView->AreObjectsMarked() &&
+ if(pSdrView && pSdrView->areSdrObjectsSelected() &&
pSdrView->GetHdlList().GetFocusHdl())
{
((SdrHdlList&)pSdrView->GetHdlList()).ResetFocusHdl();
@@ -751,9 +754,8 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM
else
{
rView.LeaveDrawCreate();
- Point aPt(LONG_MIN, LONG_MIN);
//go out of the frame
- rShell.SelectObj(aPt, SW_LEAVE_FRAME);
+ rShell.SelectObj(basegfx::B2DPoint(LONG_MIN, LONG_MIN), SW_LEAVE_FRAME);
SfxBindings& rBind = rView.GetViewFrame()->GetBindings();
rBind.Invalidate( SID_ATTR_SIZE );
rShell.EnterStdMode();
@@ -777,15 +779,10 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
return bNextDoc;
SwView& rView = rSh.GetView();
SwDoc* pDoc = rView.GetDocShell()->GetDoc();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
+
//start at the current draw object - if there is any selected
- SdrTextObj* pCurrentTextObj = 0;
- if ( rMarkList.GetMarkCount() == 1 )
- {
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if( pObj && pObj->ISA(SdrTextObj) )
- pCurrentTextObj = static_cast<SdrTextObj*>(pObj);
- }
+ SdrTextObj* pCurrentTextObj = dynamic_cast< SdrTextObj* >(pDrView->getSelectedIfSingle());
+
//at first fill the list of drawing objects
if(!m_pSpellState->m_bTextObjectsCollected )
{
@@ -819,7 +816,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
aTmpOutliner.SetRefDevice( pDoc->getPrinter( false ) );
MapMode aMapMode (MAP_TWIP);
aTmpOutliner.SetRefMapMode(aMapMode);
- aTmpOutliner.SetPaperSize( pTextObj->GetLogicRect().GetSize() );
+ aTmpOutliner.SetPaperSize( sdr::legacy::GetLogicRect(*pTextObj).GetSize() );
aTmpOutliner.SetSpeller( xSpell );
OutlinerView* pOutlView = new OutlinerView( &aTmpOutliner, &(rView.GetEditWin()) );
@@ -841,11 +838,10 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
if(pCurrentTextObj)
pDrView->SdrEndTextEdit( sal_True );
//and the found one should be activated
- rSh.MakeVisible(pTextObj->GetLogicRect());
+ rSh.MakeVisible(sdr::legacy::GetLogicRect(*pTextObj));
Point aTmp( 0,0 );
rSh.SelectObj( aTmp, 0, pTextObj );
- SdrPageView* pPV = pDrView->GetSdrPageView();
- rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), sal_False, sal_True );
+ rView.BeginTextEdit( pTextObj, &rView.GetEditWin(), sal_False, sal_True );
rView.AttrChangedNotify(&rSh);
bNextDoc = true;
}
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index eb2d51aab5e3..76c55498c9f7 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -159,9 +159,9 @@ void SwDocStatPage::Update()
{
SfxViewShell *pVSh = SfxViewShell::Current();
ViewShell *pSh = 0;
- if ( pVSh->ISA(SwView) )
+ if ( dynamic_cast< SwView* >(pVSh) )
pSh = ((SwView*)pVSh)->GetWrtShellPtr();
- else if ( pVSh->ISA(SwPagePreView) )
+ else if ( dynamic_cast< SwPagePreView* >(pVSh) )
pSh = ((SwPagePreView*)pVSh)->GetViewShell();
ASSERT( pSh, "Shell not found" );
diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx
index e406c97c7aed..28c4de80865f 100644
--- a/sw/source/ui/dialog/regionsw.cxx
+++ b/sw/source/ui/dialog/regionsw.cxx
@@ -245,7 +245,7 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq)
AbstractEditRegionDlg* pEditRegionDlg = pFact->CreateEditRegionDlg( MD_EDIT_REGION,
pParentWin, rWrtShell);
DBG_ASSERT(pEditRegionDlg, "Dialogdiet fail!");
- if(pItem && pItem->ISA(SfxStringItem))
+ if(pItem && dynamic_cast< const SfxStringItem* >(pItem))
{
pEditRegionDlg->SelectSection(((const SfxStringItem*)pItem)->GetValue());
}
diff --git a/sw/source/ui/dialog/swwrtshitem.cxx b/sw/source/ui/dialog/swwrtshitem.cxx
index b2ff6303f9a6..9b015f0290f0 100644
--- a/sw/source/ui/dialog/swwrtshitem.cxx
+++ b/sw/source/ui/dialog/swwrtshitem.cxx
@@ -24,7 +24,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include "swwrtshitem.hxx"
-TYPEINIT1(SwWrtShellItem,SfxPoolItem);
+
SwWrtShellItem::SwWrtShellItem( sal_uInt16 _nWhich, SwWrtShell* pSh )
: SfxPoolItem( _nWhich ), pWrtSh( pSh )
{
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index b6b767a9b916..beb0c3398ad1 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -401,7 +401,7 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
{
FreeResource();
- bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
+ bWeb = 0 != dynamic_cast< SwWebDocShell* >( rSh.GetView().GetDocShell() );
aTree.SetSelectHdl ( LINK( this, SwEditRegionDlg, GetFirstEntryHdl));
aTree.SetDeselectHdl ( LINK( this, SwEditRegionDlg, DeselectHdl));
@@ -1595,7 +1595,7 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog(
SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
long nHtmlMode = pHtmlOpt->GetExportMode();
- sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebDocShell* >( rSh.GetView().GetDocShell() );
if(bWeb)
{
RemoveTabPage(TP_SECTION_FTNENDNOTES);
@@ -1751,7 +1751,7 @@ void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh)
{
m_pWrtSh = &rSh;
- sal_Bool bWeb = 0 != PTR_CAST(SwWebDocShell, m_pWrtSh->GetView().GetDocShell());
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebDocShell* >( m_pWrtSh->GetView().GetDocShell());
if(bWeb)
{
aHideCB .Hide();
@@ -2330,7 +2330,7 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
long nHtmlMode = pHtmlOpt->GetExportMode();
- sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebDocShell* >( rSh.GetView().GetDocShell() );
if(bWeb)
{
RemoveTabPage(TP_SECTION_FTNENDNOTES);
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index ab4c410bbf17..a5ab38287676 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -1559,7 +1559,7 @@ sal_uInt16 SwTransferable::GetSotDestination( const SwWrtShell& rSh,
break;
case OBJCNT_FLY:
- if( rSh.GetView().GetDocShell()->ISA(SwWebDocShell) )
+ if( dynamic_cast< const SwWebDocShell* >(rSh.GetView().GetDocShell()) )
nRet = EXCHG_DEST_DOC_TEXTFRAME_WEB;
else
nRet = EXCHG_DEST_DOC_TEXTFRAME;
@@ -1587,7 +1587,7 @@ JP 13.07.98: Bug 52637: es wird ein URL-Feld erkannt also werden nur die
nRet = EXCHG_DEST_DOC_URLFIELD;
else
*/
- if( rSh.GetView().GetDocShell()->ISA(SwWebDocShell) )
+ if( dynamic_cast< const SwWebDocShell* >(rSh.GetView().GetDocShell()) )
nRet = EXCHG_DEST_SWDOC_FREE_AREA_WEB;
else
nRet = EXCHG_DEST_SWDOC_FREE_AREA;
@@ -2309,7 +2309,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
if( nRet )
{
String sURL;
- if( rSh.GetView().GetDocShell()->ISA(SwWebDocShell) )
+ if( dynamic_cast< SwWebDocShell* >(rSh.GetView().GetDocShell()) )
sURL = aBkmk.GetURL();
switch( nAction )
@@ -2506,7 +2506,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
const SfxFilter* pFlt = SW_PASTESDR_SETATTR == nAction
? 0 : SwIoSystem::GetFileFilter(
sFileURL, aEmptyStr );
- if( pFlt && !rSh.GetView().GetDocShell()->ISA(SwWebDocShell)
+ if( pFlt && !dynamic_cast< SwWebDocShell* >(rSh.GetView().GetDocShell())
/*
JP 02.07.98: warum nur fuer die Formate ??
&& ( pFlt->GetUserData() == FILTER_SW5 ||
@@ -2595,7 +2595,7 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData,
{
SdrObject* pObj;
rSh.MakeDrawView();
- FmFormView* pFmView = PTR_CAST( FmFormView, rSh.GetDrawView() );
+ FmFormView* pFmView = dynamic_cast< FmFormView* >( rSh.GetDrawView() );
if(pFmView) {
const OXFormsDescriptor &rDesc = OXFormsTransferable::extractDescriptor(rData);
if(0 != (pObj = pFmView->CreateXFormsControl(rDesc)))
@@ -2658,7 +2658,7 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData,
{
SdrObject* pObj;
rSh.MakeDrawView();
- FmFormView* pFmView = PTR_CAST( FmFormView, rSh.GetDrawView() );
+ FmFormView* pFmView = dynamic_cast< FmFormView* >( rSh.GetDrawView() );
if (pFmView && bHaveColumnDescriptor)
{
if ( 0 != (pObj = pFmView->CreateFieldControl( OColumnTransferable::extractColumnDescriptor(rData) ) ) )
@@ -3331,7 +3331,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
//Nicht in Selektionen oder selektierten Rahmen
if( rSh.ChgCurrPam( rDragPt ) ||
- ( rSh.IsSelFrmMode() && rSh.IsInsideSelectedObj( rDragPt )) )
+ ( rSh.IsSelFrmMode() && rSh.IsInsideSelectedObj(basegfx::B2DPoint(rDragPt.X(), rDragPt.Y()) )) )
return 0;
if( rSrcSh.IsTableMode() )
@@ -3807,8 +3807,7 @@ void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise )
sal_Bool SwTrnsfrDdeLink::FindDocShell()
{
- TypeId aType( TYPE( SwDocShell ) );
- SfxObjectShell* pTmpSh = SfxObjectShell::GetFirst( &aType );
+ SfxObjectShell* pTmpSh = SfxObjectShell::GetFirst( _IsObjectShell< SwDocShell > );
while( pTmpSh )
{
if( pTmpSh == pDocShell ) // die wollen wir haben
@@ -3817,7 +3816,7 @@ sal_Bool SwTrnsfrDdeLink::FindDocShell()
return sal_True;
break; // das Doc ist nicht mehr vorhanden, also raus!
}
- pTmpSh = SfxObjectShell::GetNext( *pTmpSh, &aType );
+ pTmpSh = SfxObjectShell::GetNext( *pTmpSh, _IsObjectShell< SwDocShell > );
}
pDocShell = 0;
diff --git a/sw/source/ui/docvw/AnchorOverlayObject.cxx b/sw/source/ui/docvw/AnchorOverlayObject.cxx
index 2d97e1d14678..b45af72d0d66 100644
--- a/sw/source/ui/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/ui/docvw/AnchorOverlayObject.cxx
@@ -94,8 +94,6 @@ public:
bool getShadow() const { return mbShadow; }
bool getLineSolid() const { return mbLineSolid; }
- virtual bool operator==( const drawinglayer::primitive2d::BasePrimitive2D& rPrimitive ) const;
-
DeclPrimitrive2DIDBlock()
};
@@ -218,25 +216,6 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorPrimitive::create2DDecompos
return aRetval;
}
-bool AnchorPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive2D& rPrimitive ) const
-{
- if(drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const AnchorPrimitive& rCompare = static_cast< const AnchorPrimitive& >(rPrimitive);
-
- return (getTriangle() == rCompare.getTriangle()
- && getLine() == rCompare.getLine()
- && getLineTop() == rCompare.getLineTop()
- && getAnchorState() == rCompare.getAnchorState()
- && getColor() == rCompare.getColor()
- && getLogicLineWidth() == rCompare.getLogicLineWidth()
- && getShadow() == rCompare.getShadow()
- && getLineSolid() == rCompare.getLineSolid());
- }
-
- return false;
-}
-
ImplPrimitrive2DIDBlock(AnchorPrimitive, PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE)
/****** AnchorOverlayObject ***********************************************************/
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index e257b05c0879..77f6c60cdb44 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -114,7 +114,7 @@ bool comp_pos(const SwSidebarItem* a, const SwSidebarItem* b)
//// if two notes are at the same position, sort by logical node position
// return (a->maLayoutInfo.mPosition.Bottom() == b->maLayoutInfo.mPosition.Bottom())
// ? ( ( (a->maLayoutInfo.mPosition.Left() == b->maLayoutInfo.mPosition.Left()) &&
-// (a->GetBroadCaster()->ISA(SwFmtFld) && b->GetBroadCaster()->ISA(SwFmtFld)) )
+// (dynamic_cast< SwFmtFld* >(a->GetBroadCaster()) && dynamic_cast< SwFmtFld* >(b->GetBroadCaster())) )
// ? *(static_cast<SwFmtFld*>(a->GetBroadCaster())->GetTxtFld()->GetStart()) <
// *(static_cast<SwFmtFld*>(b->GetBroadCaster())->GetTxtFld()->GetStart())
// : a->maLayoutInfo.mPosition.Left() < b->maLayoutInfo.mPosition.Left() )
@@ -225,14 +225,14 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b
}
}
mbLayout = bFocus;
- if (pItem->ISA(SwFmtFld))
+ if (dynamic_cast< SwFmtFld* >(pItem))
mvPostItFlds.push_back(new SwAnnotationItem(static_cast<SwFmtFld*>(pItem), true, bFocus) );
/*
else
- if (pItem->ISA(SwRedline))
+ if (dynamic_cast< SwRedline* >(pItem))
mvPostItFlds.push_back(new SwRedCommentItem( static_cast<SwRedline*>(pItem), true, bFocus)) ;
*/
- DBG_ASSERT(pItem->ISA(SwFmtFld) /*|| pItem->ISA(SwRedline)*/,"Mgr::InsertItem: seems like new stuff was added");
+ DBG_ASSERT(dynamic_cast< SwFmtFld* >(pItem) /*|| dynamic_cast< SwRedline* >(pItem)*/,"Mgr::InsertItem: seems like new stuff was added");
StartListening(*pItem);
}
@@ -258,9 +258,11 @@ void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast )
void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.IsA(TYPE(SfxEventHint) ) )
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if ( pSfxEventHint )
{
- sal_uInt32 nId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uInt32 nId = pSfxEventHint->GetEventId();
if ( nId == SW_EVENT_LAYOUT_FINISHED )
{
if ( !mbWaitingForCalcRects && !mvPostItFlds.empty())
@@ -270,9 +272,13 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
- else if ( rHint.IsA(TYPE(SfxSimpleHint) ) )
+ else
{
- sal_uInt32 nId = ((SfxSimpleHint&)rHint).GetId();
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
+ {
+ sal_uInt32 nId = pSfxSimpleHint->GetId();
switch ( nId )
{
case SFX_HINT_MODECHANGED:
@@ -344,11 +350,14 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
*/
- else if ( rHint.IsA(TYPE(SwFmtFldHint) ) )
+ else
{
- const SwFmtFldHint& rFmtHint = static_cast<const SwFmtFldHint&>(rHint);
- SwFmtFld* pFld = const_cast <SwFmtFld*>( rFmtHint.GetField() );
- switch ( rFmtHint.Which() )
+ const SwFmtFldHint* pSwFmtFldHint = dynamic_cast< const SwFmtFldHint* >(&rHint);
+
+ if ( pSwFmtFldHint )
+ {
+ SwFmtFld* pFld = const_cast <SwFmtFld*>( pSwFmtFldHint->GetField() );
+ switch ( pSwFmtFldHint->Which() )
{
case SWFMTFLD_INSERTED :
{
@@ -386,7 +395,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
case SWFMTFLD_FOCUS:
{
- if (rFmtHint.GetView()== mpView)
+ if (pSwFmtFldHint->GetView()== mpView)
Focus(rBC);
break;
}
@@ -434,6 +443,8 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
+ }
+ }
}
void SwPostItMgr::Focus(SfxBroadcaster& rBC)
diff --git a/sw/source/ui/docvw/ShadowOverlayObject.cxx b/sw/source/ui/docvw/ShadowOverlayObject.cxx
index a9c3bf72d590..4a5750a2fe57 100644
--- a/sw/source/ui/docvw/ShadowOverlayObject.cxx
+++ b/sw/source/ui/docvw/ShadowOverlayObject.cxx
@@ -72,8 +72,6 @@ public:
const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; }
ShadowState getShadowState() const { return maShadowState; }
- virtual bool operator==( const drawinglayer::primitive2d::BasePrimitive2D& rPrimitive ) const;
-
DeclPrimitrive2DIDBlock()
};
@@ -158,20 +156,6 @@ drawinglayer::primitive2d::Primitive2DSequence ShadowPrimitive::create2DDecompos
return xRetval;
}
-bool ShadowPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive2D& rPrimitive ) const
-{
- if(drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const ShadowPrimitive& rCompare = static_cast< const ShadowPrimitive& >(rPrimitive);
-
- return (getBasePosition() == rCompare.getBasePosition()
- && getSecondPosition() == rCompare.getSecondPosition()
- && getShadowState() == rCompare.getShadowState());
- }
-
- return false;
-}
-
ImplPrimitrive2DIDBlock(ShadowPrimitive, PRIMITIVE2D_ID_SWSIDEBARSHADOWPRIMITIVE)
/****** ShadowOverlayObject **************************************************/
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx
index f0e5174ff76e..78159193ec71 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx
@@ -246,7 +246,7 @@ void SidebarTxtControl::MouseMove( const MouseEvent& rMEvt )
if ( pItem )
{
const SvxFieldData* pFld = pItem->GetField();
- const SvxURLField* pURL = PTR_CAST( SvxURLField, pFld );
+ const SvxURLField* pURL = dynamic_cast< const SvxURLField* >( pFld );
if ( pURL )
{
String sURL( pURL->GetURL() );
@@ -276,7 +276,7 @@ void SidebarTxtControl::MouseButtonDown( const MouseEvent& rMEvt )
if ( pItem )
{
const SvxFieldData* pFld = pItem->GetField();
- const SvxURLField* pURL = PTR_CAST( SvxURLField, pFld );
+ const SvxURLField* pURL = dynamic_cast< const SvxURLField* >( pFld );
if ( pURL )
{
GetTextView()->MouseButtonDown( rMEvt );
diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx
index 3ead4227a30b..ed2c44cc87e2 100644
--- a/sw/source/ui/docvw/edtdd.cxx
+++ b/sw/source/ui/docvw/edtdd.cxx
@@ -24,20 +24,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-
-
#include <svx/svdview.hxx>
#include <editeng/outliner.hxx>
-//#ifndef _SVDVMARK_HXX //autogen
-//#include <svx/svdvmark.hxx>
-//#endif
#include <svx/svdobj.hxx>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <sfx2/bindings.hxx>
-
#include <sfx2/viewfrm.hxx>
#include <fmturl.hxx>
#include <frmfmt.hxx>
@@ -54,6 +47,7 @@
#endif
#include <wdocsh.hxx>
#include <swundo.hxx>
+#include <svx/svdlegacy.hxx>
using namespace ::com::sun::star;
@@ -106,7 +100,7 @@ void SwEditWin::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel )
//Selektion
bStart = sal_True;
else if ( !bFrmDrag && rSh.IsSelFrmMode() &&
- rSh.IsInsideSelectedObj( aDocPos ) )
+ rSh.IsInsideSelectedObj( basegfx::B2DPoint(aDocPos.X(), aDocPos.Y()) ) )
{
//Wir sind nicht am internen Draggen und stehen auf
//einem Objekt (Rahmen, Zeichenobjekt)
@@ -223,7 +217,7 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt )
if( pObj && 0 != ( pOLV = rSh.GetDrawView()->GetTextEditOutlinerView() ))
{
Rectangle aRect( pOLV->GetOutputArea() );
- aRect.Union( pObj->GetLogicRect() );
+ aRect.Union( sdr::legacy::GetLogicRect(*pObj) );
const Point aPos = pOLV->GetWindow()->PixelToLogic(rEvt.maPosPixel);
if ( aRect.IsInside(aPos) )
{
@@ -285,7 +279,7 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO
if ( pOLV )
{
Rectangle aRect( pOLV->GetOutputArea() );
- aRect.Union( pObj->GetLogicRect() );
+ aRect.Union( sdr::legacy::GetLogicRect(*pObj) );
const Point aPos = pOLV->GetWindow()->PixelToLogic( rPixPnt );
if( aRect.IsInside( aPos ) )
return 0;
@@ -317,7 +311,7 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO
}
break;
case OBJCNT_FLY:
- if( rSh.GetView().GetDocShell()->ISA(SwWebDocShell) )
+ if( dynamic_cast< SwWebDocShell* >(rSh.GetView().GetDocShell()) )
nDropDestination = EXCHG_DEST_DOC_TEXTFRAME_WEB;
else
nDropDestination = EXCHG_DEST_DOC_TEXTFRAME;
@@ -333,7 +327,7 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO
}
if ( !nDropDestination )
{
- if( rSh.GetView().GetDocShell()->ISA(SwWebDocShell) )
+ if( dynamic_cast< SwWebDocShell* >(rSh.GetView().GetDocShell()) )
nDropDestination = EXCHG_DEST_SWDOC_FREE_AREA_WEB;
else
nDropDestination = EXCHG_DEST_SWDOC_FREE_AREA;
@@ -459,7 +453,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt )
EXCHG_IN_ACTION_LINK == m_nDropAction) ||
SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE == m_nDropFormat )
{
- SdrMarkView* pMView = PTR_CAST( SdrMarkView, rSh.GetDrawView() );
+ SdrMarkView* pMView = dynamic_cast< SdrMarkView* >( rSh.GetDrawView() );
if( pMView && !pMView->IsDesignMode() )
return DND_ACTION_NONE;
}
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 7f048ba00503..f86390f4321d 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -24,7 +24,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <tools/list.hxx>
#include <swtypes.hxx>
#include <hintids.hxx>
@@ -33,9 +32,7 @@
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
-
#include <com/sun/star/i18n/UnicodeScript.hpp>
-
#include <vcl/help.hxx>
#include <vcl/graph.hxx>
#include <vcl/msgbox.hxx>
@@ -71,7 +68,6 @@
#include <editeng/postitem.hxx>
#include <editeng/protitem.hxx>
#include <unotools/charclass.hxx>
-
#include <editeng/acorrcfg.hxx>
#include <SwSmartTagMgr.hxx>
#include <edtwin.hxx>
@@ -113,7 +109,6 @@
#include <crsskip.hxx>
#include <breakit.hxx>
#include <checkit.hxx>
-
#include <helpid.h>
#include <cmdid.h>
#ifndef _DOCVW_HRC
@@ -130,17 +125,11 @@
#include "formatclipboard.hxx"
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
-
#include <IMark.hxx>
#include <doc.hxx>
#include <xmloff/odffields.hxx>
-
#include <PostItMgr.hxx>
-
-//JP 11.10.2001: enable test code for bug fix 91313
-#if defined(DBG_UTIL) && (OSL_DEBUG_LEVEL > 1)
-//#define TEST_FOR_BUG91313
-#endif
+#include <svx/svdlegacy.hxx>
using namespace sw::mark;
using namespace ::com::sun::star;
@@ -180,56 +169,49 @@ sal_Bool SwEditWin::bTransparentBackColor = sal_False; // Hintergrund nicht t
extern sal_Bool bExecuteDrag;
-SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType );
+SfxShell* lcl_GetShellFromDispatcher( SwView& rView, const std::type_info& rType );
DBG_NAME(edithdl)
class SwAnchorMarker
{
- SdrHdl* pHdl;
- Point aHdlPos;
- Point aLastPos;
+ SdrHdl* mpHdl;
+ basegfx::B2DPoint maHdlPos;
+ basegfx::B2DPoint maLastPos;
// --> OD 2010-09-16 #i114522#
bool bTopRightHandle;
// <--
public:
SwAnchorMarker( SdrHdl* pH )
- : pHdl( pH )
- , aHdlPos( pH->GetPos() )
- , aLastPos( pH->GetPos() )
- // --> OD 2010-09-16 #i114522#
- , bTopRightHandle( pH->GetKind() == HDL_ANCHOR_TR )
- // <--
- {}
- const Point& GetLastPos() const { return aLastPos; }
- void SetLastPos( const Point& rNew ) { aLastPos = rNew; }
- void SetPos( const Point& rNew ) { pHdl->SetPos( rNew ); }
- const Point& GetPos() { return pHdl->GetPos(); }
- const Point& GetHdlPos() { return aHdlPos; }
- void ChgHdl( SdrHdl* pNew )
+ : mpHdl( pH ),
+ maHdlPos( pH->getPosition() ),
+ maLastPos( pH->getPosition() ),
+ bTopRightHandle( HDL_ANCHOR_TR == pH->GetKind() )
{
- pHdl = pNew;
- // --> OD 2010-09-16 #i114522#
- if ( pHdl )
- {
- bTopRightHandle = (pHdl->GetKind() == HDL_ANCHOR_TR);
- }
- // <--
}
+
+ const basegfx::B2DPoint& GetLastPos() const { return maLastPos; }
+ void SetLastPos( const basegfx::B2DPoint& rNew ) { maLastPos = rNew; }
+ void SetPos( const basegfx::B2DPoint& rNew ) { mpHdl->setPosition( rNew ); }
+ const basegfx::B2DPoint& GetPos() { return mpHdl->getPosition(); }
+ const basegfx::B2DPoint& GetHdlPos() { return maHdlPos; }
+ void ChgHdl( SdrHdl* pNew ) { mpHdl = pNew; }
+
// --> OD 2010-09-16 #i114522#
- const Point GetPosForHitTest( const OutputDevice& rOut )
+ const basegfx::B2DPoint GetPosForHitTest( const OutputDevice& rOut )
{
- Point aHitTestPos( GetPos() );
- aHitTestPos = rOut.LogicToPixel( aHitTestPos );
+ basegfx::B2DPoint aHitTestPos(rOut.GetViewTransformation() * GetPos());
+
if ( bTopRightHandle )
{
- aHitTestPos += Point( -1, 1 );
+ aHitTestPos += basegfx::B2DPoint( -1.0, 1.0 );
}
else
{
- aHitTestPos += Point( 1, 1 );
+ aHitTestPos += basegfx::B2DPoint( 1.0, 1.0 );
}
- aHitTestPos = rOut.PixelToLogic( aHitTestPos );
+
+ aHitTestPos = rOut.GetInverseViewTransformation() * aHitTestPos;
return aHitTestPos;
}
@@ -311,6 +293,7 @@ inline sal_Bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt )
void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
{
+ const basegfx::B2DPoint aB2DLPt(rLPt.X(), rLPt.Y());
SwWrtShell &rSh = rView.GetWrtShell();
if( pApplyTempl )
{
@@ -339,7 +322,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
if( bFrameIsValidTarget &&
0 !=(pFmt = rSh.GetFmtFromObj( rLPt, &pRect )) &&
- PTR_CAST(SwFlyFrmFmt, pFmt))
+ dynamic_cast< const SwFlyFrmFmt* >( pFmt))
{
//Highlight fuer Rahmen anwerfen
Rectangle aTmp( pRect->SVRect() );
@@ -418,14 +401,14 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
PointerStyle eStyle = POINTER_TEXT;
if ( !pSdrView )
bCntAtPos = sal_True;
- else if ( sal_True == (bHitHandle = pSdrView->PickHandle( rLPt ) != 0) )
+ else if ( sal_True == (bHitHandle = pSdrView->PickHandle( aB2DLPt ) != 0) )
{
aActHitType = SDRHIT_OBJECT;
bPrefSdrPointer = sal_True;
}
else
{
- const sal_Bool bNotInSelObj = !rSh.IsInsideSelectedObj( rLPt );
+ const sal_Bool bNotInSelObj = !rSh.IsInsideSelectedObj( aB2DLPt );
if ( rView.GetDrawFuncPtr() && !bInsDraw && bNotInSelObj )
{
aActHitType = SDRHIT_OBJECT;
@@ -439,11 +422,11 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
SdrObject* pObj; SdrPageView* pPV;
pSdrView->SetHitTolerancePixel( HIT_PIX );
if ( bNotInSelObj && bExecHyperlinks &&
- pSdrView->PickObj( rLPt, pSdrView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO ))
+ pSdrView->PickObj( aB2DLPt, pSdrView->getHitTolLog(), pObj, SDRSEARCH_PICKMACRO ))
{
SdrObjMacroHitRec aTmp;
- aTmp.aPos = rLPt;
- aTmp.pPageView = pPV;
+ aTmp.maPos = aB2DLPt;
+ aTmp.mpSdrView = pSdrView;
SetPointer( pObj->GetMacroPointer( aTmp ) );
return;
}
@@ -462,7 +445,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
else
{
SdrViewEvent aVEvt;
- SdrHitKind eHit = pSdrView->PickAnything(rLPt, aVEvt);
+ SdrHitKind eHit = pSdrView->PickAnything(aB2DLPt, aVEvt);
if (eHit == SDRHIT_URLFIELD && bExecHyperlinks)
{
@@ -523,7 +506,9 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
if (rView.GetDrawFuncPtr() && rView.GetDrawFuncPtr()->IsInsertForm() && !bHitHandle)
SetPointer( POINTER_DRAW_RECT );
else
- SetPointer( pSdrView->GetPreferedPointer( rLPt, rSh.GetOut() ) );
+ {
+ SetPointer( pSdrView->GetPreferedPointer( aB2DLPt, rSh.GetOut() ) );
+ }
}
}
else
@@ -676,7 +661,7 @@ void SwEditWin::InsFrm(sal_uInt16 nCols)
void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect )
{
- SetSdrDrawMode( eSdrObjectKind );
+ setSdrObjectCreationInfo(SdrObjectCreationInfo(eSdrObjectKind));
/* if (GetDrawFuncPtr())
GetDrawFuncPtr()->Deactivate();*/
@@ -687,7 +672,7 @@ void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect )
rView.SetDrawFuncPtr(new SwDrawBase( &rView.GetWrtShell(), this, &rView ));
rView.SetSelDrawSlot();
- SetSdrDrawMode( eSdrObjectKind );
+ setSdrObjectCreationInfo(SdrObjectCreationInfo(eSdrObjectKind));
if (bObjSelect)
rView.GetDrawFuncPtr()->Activate( SID_OBJECT_SELECT );
else
@@ -860,7 +845,7 @@ void SwEditWin::FlushInBuffer()
if ( xRecorder.is() )
{
//Shell ermitteln
- SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, TYPE(SwTextShell) );
+ SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, typeid(SwTextShell) );
// Request generieren und recorden
if (pSfxShell)
{
@@ -1259,7 +1244,7 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
if ( bMoveAllowed )
{
// <--
- pSdrView->MoveAllMarked(Size(nX, nY));
+ pSdrView->MoveMarkedObj(basegfx::B2DVector(nX, nY));
rSh.SetModified();
}
}
@@ -1280,23 +1265,23 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
else if(0 == (nProtect&FLYPROTECT_SIZE))
{
// now move the Handle (nX, nY)
- Point aStartPoint(pHdl->GetPos());
- Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
+ const basegfx::B2DPoint aStartPoint(pHdl->getPosition());
+ const basegfx::B2DPoint aEndPoint(aStartPoint + basegfx::B2DPoint(nX, nY));
const SdrDragStat& rDragStat = pSdrView->GetDragStat();
// start dragging
- pSdrView->BegDragObj(aStartPoint, 0, pHdl, 0);
+ pSdrView->BegDragObj(aStartPoint, pHdl, 0.0);
if(pSdrView->IsDragObj())
{
- sal_Bool bWasNoSnap = static_cast< sal_Bool >(rDragStat.IsNoSnap());
- sal_Bool bWasSnapEnabled = pSdrView->IsSnapEnabled();
+ const bool bWasNoSnap(rDragStat.IsNoSnap());
+ const bool bWasSnapEnabled(pSdrView->IsSnapEnabled());
// switch snapping off
if(!bWasNoSnap)
- ((SdrDragStat&)rDragStat).SetNoSnap(sal_True);
+ ((SdrDragStat&)rDragStat).SetNoSnap(true);
if(bWasSnapEnabled)
- pSdrView->SetSnapEnabled(sal_False);
+ pSdrView->SetSnapEnabled(false);
pSdrView->MovAction(aEndPoint);
pSdrView->EndDragObj();
@@ -1480,12 +1465,12 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
(0 != (nLclSelectionType = rSh.GetSelectionType()) &&
((nLclSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_GRF)) ||
((nLclSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) &&
- rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1))))
+ 0 != rSh.GetDrawView()->getSelectedIfSingle()))))
{
SdrHdlList& rHdlList = (SdrHdlList&)rSh.GetDrawView()->GetHdlList();
- SdrHdl* pAnchor = rHdlList.GetHdl(HDL_ANCHOR);
+ SdrHdl* pAnchor = rHdlList.GetHdlByKind(HDL_ANCHOR);
if ( ! pAnchor )
- pAnchor = rHdlList.GetHdl(HDL_ANCHOR_TR);
+ pAnchor = rHdlList.GetHdlByKind(HDL_ANCHOR_TR);
if(pAnchor)
rHdlList.SetFocusHdl(pAnchor);
return;
@@ -1706,7 +1691,7 @@ KEYINPUT_CHECKTABLE:
{
if(!pFlyFmt && KS_KeyToView != eFlyState &&
(rSh.GetSelectionType() & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) &&
- rSh.GetDrawView()->AreObjectsMarked())
+ rSh.GetDrawView()->areSdrObjectsSelected())
eKeyState = KS_Draw_Change;
}
@@ -1787,7 +1772,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
if(KS_KeyToView != eFlyState)
{
if((nSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) &&
- rSh.GetDrawView()->AreObjectsMarked())
+ rSh.GetDrawView()->areSdrObjectsSelected())
eKeyState = KS_Draw_Change;
else if(nSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF))
eKeyState = KS_Fly_Change;
@@ -1840,7 +1825,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
eKeyState = KS_GoIntoFly;
else if((nSelectionType & nsSelectionType::SEL_DRW) &&
0 == (nSelectionType & nsSelectionType::SEL_DRW_TXT) &&
- rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1)
+ 0 != rSh.GetDrawView()->getSelectedIfSingle())
eKeyState = KS_GoIntoDrawing;
else if( aTmpQHD.HasCntnt() && !rSh.HasSelection() &&
aTmpQHD.bIsAutoText )
@@ -2106,7 +2091,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
else if((rSh.GetSelectionType() &
(nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM|
nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF)) &&
- rSh.GetDrawView()->AreObjectsMarked())
+ rSh.GetDrawView()->areSdrObjectsSelected())
eKeyState = KS_EnterDrawHandleMode;
else
{
@@ -2126,7 +2111,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
else if((rSh.GetSelectionType() & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM|
nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF)) &&
- rSh.GetDrawView()->AreObjectsMarked())
+ rSh.GetDrawView()->areSdrObjectsSelected())
eKeyState = KS_EnterDrawHandleMode;
break;
case KEY_F2 :
@@ -2239,19 +2224,17 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( !bIsDocReadOnly && bNormalChar )
{
const int nSelectionType = rSh.GetSelectionType();
+ SdrObject* pObj = rSh.GetDrawView()->getSelectedIfSingle();
+
if((nSelectionType & nsSelectionType::SEL_DRW) &&
0 == (nSelectionType & nsSelectionType::SEL_DRW_TXT) &&
- rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1)
+ pObj)
{
- SdrObject* pObj = rSh.GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- if(pObj)
- {
- EnterDrawTextMode(pObj->GetLogicRect().Center());
- if ( rView.GetCurShell()->ISA(SwDrawTextShell) )
+ EnterDrawTextMode(sdr::legacy::GetLogicRange(*pObj).getCenter());
+ if ( dynamic_cast< SwDrawTextShell* >(rView.GetCurShell()) )
((SwDrawTextShell*)rView.GetCurShell())->Init();
rSh.GetDrawView()->KeyInput( rKEvt, this );
}
- }
else if(nSelectionType & nsSelectionType::SEL_FRM)
{
rSh.UnSelectFrm();
@@ -2282,11 +2265,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KS_GoIntoDrawing :
{
- SdrObject* pObj = rSh.GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
+ SdrObject* pObj = rSh.GetDrawView()->getSelectedIfSingle();
if(pObj)
{
- EnterDrawTextMode(pObj->GetLogicRect().Center());
- if ( rView.GetCurShell()->ISA(SwDrawTextShell) )
+ EnterDrawTextMode(sdr::legacy::GetLogicRange(*pObj).getCenter());
+ if ( dynamic_cast< SwDrawTextShell* >(rView.GetCurShell()) )
((SwDrawTextShell*)rView.GetCurShell())->Init();
}
eKeyState = KS_Ende;
@@ -2302,7 +2285,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
break;
case KS_InsTab:
- if( rView.ISA( SwWebView )) //Kein Tabulator fuer Web!
+ if( dynamic_cast< const SwWebView* >(&rView)) //Kein Tabulator fuer Web!
{
// Bug 56196 - dann sollte der weiter gereicht werden.
Window::KeyInput( aKeyEvent );
@@ -2616,7 +2599,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
if(rHdlList.GetFocusHdl())
ChangeDrawing( nDir );
else
- ChangeFly( nDir, rView.ISA( SwWebView ) );
+ ChangeFly( nDir, 0 != dynamic_cast< const SwWebView* >(&rView) );
}
break;
case KS_Draw_Change :
@@ -2719,6 +2702,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
delete pShadCrsr, pShadCrsr = 0;
const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) );
+ const basegfx::B2DPoint aB2DDocPos(aDocPos.X(), aDocPos.Y());
if ( IsChainMode() )
{
@@ -2767,7 +2751,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
rMEvt.GetClicks() == 1 && MOUSE_LEFT == rMEvt.GetButtons();
if ( bTmp &&
0 != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) &&
- !rSh.IsObjSelectable( aDocPos ) )
+ !rSh.IsObjSelectable(aB2DDocPos) )
{
// --> FME 2004-07-30 #i32329# Enhanced table selection
if ( SW_TABSEL_HORI <= nMouseTabCol && SW_TABCOLSEL_VERT >= nMouseTabCol )
@@ -2877,7 +2861,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SdrHdl* pHdl;
if( !bIsDocReadOnly &&
!pAnchorMarker &&
- 0 != ( pHdl = pSdrView->PickHandle(aDocPos) ) &&
+ 0 != ( pHdl = pSdrView->PickHandle(aB2DDocPos) ) &&
( pHdl->GetKind() == HDL_ANCHOR ||
pHdl->GetKind() == HDL_ANCHOR_TR ) )
{
@@ -2902,11 +2886,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
{
if ( rSh.IsSelFrmMode())
{
- SdrHdl* pHdl = rSh.GetDrawView()->PickHandle(aDocPos);
+ SdrHdl* pHdl = rSh.GetDrawView()->PickHandle(aB2DDocPos);
sal_Bool bHitHandle = pHdl && pHdl->GetKind() != HDL_ANCHOR &&
pHdl->GetKind() != HDL_ANCHOR_TR;
- if ((rSh.IsInsideSelectedObj(aDocPos) || bHitHandle) &&
+ if ((rSh.IsInsideSelectedObj(aB2DDocPos) || bHitHandle) &&
!(rMEvt.GetModifier() == KEY_SHIFT && !bHitHandle))
{
rSh.EnterSelFrmMode( &aDocPos );
@@ -2965,7 +2949,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SdrViewEvent aVEvt;
pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- if (aVEvt.eEvent == SDREVENT_EXECUTEURL)
+ if (aVEvt.meEvent == SDREVENT_EXECUTEURL)
bExecDrawTextLink = sal_True;
}
@@ -3015,7 +2999,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
return;
}
else
- bOnlyText = static_cast< sal_Bool >(rSh.IsObjSelectable( aDocPos ));
+ bOnlyText = rSh.IsObjSelectable(aB2DDocPos);
if (!rView.GetDrawFuncPtr())
rSh.ShowCrsr();
@@ -3025,12 +3009,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
else if ( rSh.IsSelFrmMode() &&
(aActHitType == SDRHIT_NONE ||
- !rSh.IsInsideSelectedObj( aDocPos )))
+ !rSh.IsInsideSelectedObj( aB2DDocPos )))
{
rView.NoRotate();
SdrHdl *pHdl;
if( !bIsDocReadOnly && !pAnchorMarker && 0 !=
- ( pHdl = pSdrView->PickHandle(aDocPos) ) &&
+ ( pHdl = pSdrView->PickHandle(aB2DDocPos) ) &&
( pHdl->GetKind() == HDL_ANCHOR ||
pHdl->GetKind() == HDL_ANCHOR_TR ) )
{
@@ -3093,7 +3077,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
case 2:
{
bFrmDrag = sal_False;
- if ( !bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) &&
+ if ( !bIsDocReadOnly && rSh.IsInsideSelectedObj(aB2DDocPos) &&
0 == rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) )
/* SJ: 01.03.2005: this is no good, on the one hand GetSelectionType is used as flag field (take a look into the GetSelectionType method)
@@ -3125,8 +3109,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
case nsSelectionType::SEL_DRW:
RstMBDownFlags();
- EnterDrawTextMode(aDocPos);
- if ( rView.GetCurShell()->ISA(SwDrawTextShell) )
+ EnterDrawTextMode(aB2DDocPos);
+ if ( dynamic_cast< SwDrawTextShell* >(rView.GetCurShell()) )
((SwDrawTextShell*)rView.GetCurShell())->Init();
return;
}
@@ -3258,7 +3242,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
}
else if( rSh.IsSelFrmMode() &&
- rSh.GetDrawView()->PickHandle( aDocPos ))
+ rSh.GetDrawView()->PickHandle( aB2DDocPos ))
{
bFrmDrag = sal_True;
bNoInterrupt = sal_False;
@@ -3287,7 +3271,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
}
else if( rSh.IsSelFrmMode() &&
- rSh.GetDrawView()->PickHandle( aDocPos ))
+ rSh.GetDrawView()->PickHandle( aB2DDocPos ))
{
bFrmDrag = sal_True;
bNoInterrupt = sal_False;
@@ -3335,8 +3319,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
{
rSh.SelectObj(aDocPos, SW_ADD_SELECT);
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if (rMarkList.GetMark(0) == NULL)
+ if(!pSdrView->areSdrObjectsSelected())
{
rSh.LeaveSelFrmMode();
rView.AttrChangedNotify(&rSh);
@@ -3357,7 +3340,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
else
{
if ( rSh.IsSelFrmMode() &&
- rSh.IsInsideSelectedObj( aDocPos ) )
+ rSh.IsInsideSelectedObj(aB2DDocPos) )
{
rSh.EnterSelFrmMode( &aDocPos );
SwEditWin::nDDStartPosY = aDocPos.Y();
@@ -3468,7 +3451,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
// Thus, also text fly frames in background become selectable via Ctrl-Click.
if ( nSelType & nsSelectionType::SEL_OLE ||
nSelType & nsSelectionType::SEL_GRF ||
- rSh.IsObjSelectable( aDocPos ) )
+ rSh.IsObjSelectable(aB2DDocPos) )
// <--
{
MV_KONTEXT( &rSh );
@@ -3526,6 +3509,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
//aDocPt == Point in Twips, Dokumentkoordinaten
const Point aPixPt( rMEvt.GetPosPixel() );
const Point aDocPt( PixelToLogic( aPixPt ) );
+ const basegfx::B2DPoint aB2DDocPt(aDocPt.X(), aDocPt.Y());
if ( IsChainMode() )
{
@@ -3605,7 +3589,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
Point aRelPos = rSh.GetRelativePagePosition(aDocPt);
if(aRelPos.X() >= 0)
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
const SfxPointItem aTmp1( SID_ATTR_POSITION, aRelPos );
rBnd.SetState( aTmp1 );
@@ -3624,7 +3608,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if( !bIsDocReadOnly && bInsWin && !pApplyTempl && !rSh.IsInSelect() )
{
if ( SW_TABCOL_NONE != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPt ) ) &&
- !rSh.IsObjSelectable( aDocPt ) )
+ !rSh.IsObjSelectable(aB2DDocPt) )
{
sal_uInt16 nPointer = USHRT_MAX;
bool bChkTblSel = false;
@@ -3707,8 +3691,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
// the old one, it will find it with position aOld, if this one
// is destroyed, it will find a new one at position GetHdlPos().
// --> OD 2010-09-16 #i114522#
-// const Point aOld = pAnchorMarker->GetPos();
- const Point aOld = pAnchorMarker->GetPosForHitTest( *(rSh.GetOut()) );
+ const basegfx::B2DPoint aOld(pAnchorMarker->GetPosForHitTest(*(rSh.GetOut())));
// <--
Point aNew = rSh.FindAnchorPos( aDocPt );
SdrHdl* pHdl;
@@ -3720,9 +3703,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
pAnchorMarker->ChgHdl( pHdl );
if( aNew.X() || aNew.Y() )
{
- pAnchorMarker->SetPos( aNew );
- pAnchorMarker->SetLastPos( aDocPt );
- //OLMpSdrView->RefreshAllIAOManagers();
+ pAnchorMarker->SetPos( basegfx::B2DPoint(aNew.X(), aNew.Y()) );
+ pAnchorMarker->SetLastPos( aB2DDocPt );
}
}
else
@@ -3743,7 +3725,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
EnterArea();
if ( rView.GetDrawFuncPtr() )
{
- pSdrView->SetOrtho(sal_False);
+ pSdrView->SetOrthogonal(false);
rView.GetDrawFuncPtr()->MouseMove( rMEvt );
}
bIsInMove = sal_True;
@@ -3763,7 +3745,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if ( bIsInMove || IsMinMove( aStartPos, aPixPt ) )
{
// Event-Verarbeitung fuers Resizen
- if( pSdrView->AreObjectsMarked() )
+ if( pSdrView->areSdrObjectsSelected() )
{
const SwFrmFmt* pFlyFmt;
const SvxMacro* pMacro;
@@ -3773,7 +3755,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
// geht es los?
if( HDL_USER == eSdrMoveHdl )
{
- SdrHdl* pHdl = pSdrView->PickHandle( aSttPt );
+ SdrHdl* pHdl = pSdrView->PickHandle( basegfx::B2DPoint(aSttPt.X(), aSttPt.Y()) );
eSdrMoveHdl = pHdl ? pHdl->GetKind() : HDL_MOVE;
}
@@ -3828,13 +3810,13 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if ( rMEvt.IsShift() )
{
- pSdrView->SetOrtho(sal_True);
- pSdrView->SetAngleSnapEnabled(sal_True);
+ pSdrView->SetOrthogonal(true);
+ pSdrView->SetAngleSnapEnabled(true);
}
else
{
- pSdrView->SetOrtho(sal_False);
- pSdrView->SetAngleSnapEnabled(sal_False);
+ pSdrView->SetOrthogonal(false);
+ pSdrView->SetAngleSnapEnabled(false);
}
(rSh.*rSh.fnDrag)( &aDocPt, rMEvt.IsShift() );
@@ -3860,9 +3842,9 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if ( pSdrView )
{
if ( rMEvt.IsShift() )
- pSdrView->SetOrtho(sal_True);
+ pSdrView->SetOrthogonal(true);
else
- pSdrView->SetOrtho(sal_False);
+ pSdrView->SetOrthogonal(false);
}
if ( !bInsWin )
{
@@ -4033,7 +4015,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
SdrView *pSdrView = rSh.GetDrawView();
if ( pSdrView )
{
- pSdrView->SetOrtho(sal_False);
+ pSdrView->SetOrthogonal(false);
if ( pSdrView->MouseButtonUp( rMEvt,this ) )
{
@@ -4069,8 +4051,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if( pAnchorMarker )
{
- Point aPnt( pAnchorMarker->GetLastPos() );
- //OLMpSdrView->RefreshAllIAOManagers();
+ Point aPnt(basegfx::fround(pAnchorMarker->GetLastPos().getX()), basegfx::fround(pAnchorMarker->GetLastPos().getY()));
DELETEZ( pAnchorMarker );
if( aPnt.X() || aPnt.Y() )
rSh.FindAnchorPos( aPnt, sal_True );
@@ -4145,26 +4126,30 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if ( rMEvt.IsMod1() ) //Kopieren und nicht moven.
{
//Drag abbrechen, statt dessen internes Copy verwenden
- Rectangle aRect;
- rSh.GetDrawView()->TakeActionRect( aRect );
- if (!aRect.IsEmpty())
+ basegfx::B2DRange aActionRange(rSh.GetDrawView()->TakeActionRange());
+
+ if (!aActionRange.isEmpty())
{
rSh.BreakDrag();
- Point aEndPt, aSttPt;
+ basegfx::B2DPoint aEndPt, aSttPt;
+
if ( rSh.GetSelFrmType() & FRMTYPE_FLY_ATCNT )
{
- aEndPt = aRect.TopLeft();
- aSttPt = rSh.GetDrawView()->GetAllMarkedRect().TopLeft();
+ aEndPt = aActionRange.getMinimum();
+ aSttPt = rSh.GetDrawView()->getMarkedObjectSnapRange().getMinimum();
}
else
{
- aEndPt = aRect.Center();
- aSttPt = rSh.GetDrawView()->GetAllMarkedRect().Center();
+ aEndPt = aActionRange.getCenter();
+ aSttPt = rSh.GetDrawView()->getMarkedObjectSnapRange().getCenter();
}
- if ( aSttPt != aEndPt )
+
+ if(!aSttPt.equal(aEndPt))
{
rSh.StartUndo( UNDO_UI_DRAG_AND_COPY );
- rSh.Copy(&rSh, aSttPt, aEndPt, sal_False);
+ const Point aOldA(basegfx::fround(aSttPt.getX()), basegfx::fround(aSttPt.getY()));
+ const Point aOldB(basegfx::fround(aEndPt.getX()), basegfx::fround(aEndPt.getY()));
+ rSh.Copy(&rSh, aOldA, aOldB, sal_False);
rSh.EndUndo( UNDO_UI_DRAG_AND_COPY );
}
}
@@ -4352,14 +4337,13 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if (pSdrView)
pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
- if (pSdrView && aVEvt.eEvent == SDREVENT_EXECUTEURL)
+ if (pSdrView && aVEvt.meEvent == SDREVENT_EXECUTEURL)
{
// URL-Feld getroffen
- const SvxURLField *pField = aVEvt.pURLField;
- if (pField)
+ if(aVEvt.maURLField.Len())
{
- String sURL(pField->GetURL());
- String sTarget(pField->GetTargetFrame());
+ const String sURL(aVEvt.maURLField);
+ const String sTarget(aVEvt.maTargetFrame);
::LoadURL( sURL, &rSh, nFilter, &sTarget);
}
bCallShadowCrsr = sal_False;
@@ -4512,7 +4496,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
case SFX_STYLE_FAMILY_FRAME :
{
const SwFrmFmt* pFmt = rSh.GetFmtFromObj( aDocPt );
- if(PTR_CAST(SwFlyFrmFmt, pFmt))
+ if(dynamic_cast< const SwFlyFrmFmt* >( pFmt))
{
rSh.SetFrmFmt( pApplyTempl->aColl.pFrmFmt, sal_False, &aDocPt );
pApplyTempl->bUndo = sal_True;
@@ -4549,7 +4533,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
rView.GetViewFrame()->GetBindings().GetRecorder();
if ( aStyleName.Len() && xRecorder.is() )
{
- SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, TYPE(SwTextShell) );
+ SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, typeid(SwTextShell) );
if ( pSfxShell )
{
SfxRequest aReq( rView.GetViewFrame(), SID_STYLE_APPLY );
@@ -4657,7 +4641,7 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView):
m_nDropDestination( 0 ),
nInsFrmColCount( 1 ),
- eDrawMode(OBJ_NONE),
+ meSdrObjectCreationInfo(),
bLockInput(sal_False),
bObjectSelect( sal_False ),
@@ -4727,16 +4711,17 @@ SwEditWin::~SwEditWin()
******************************************************************************/
-void SwEditWin::EnterDrawTextMode( const Point& aDocPos )
+void SwEditWin::EnterDrawTextMode( const basegfx::B2DPoint& aDocPos )
{
- if ( rView.EnterDrawTextMode(aDocPos) == sal_True )
+ if(rView.EnterDrawTextMode(aDocPos))
{
if (rView.GetDrawFuncPtr())
{
rView.GetDrawFuncPtr()->Deactivate();
- rView.SetDrawFuncPtr(NULL);
+ rView.SetDrawFuncPtr(0);
rView.LeaveDrawCreate();
}
+
rView.NoRotate();
rView.AttrChangedNotify( &rView.GetWrtShell() );
}
@@ -4795,7 +4780,6 @@ sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos)
sal_Bool SwEditWin::IsDrawSelMode()
{
-// return (IsFrmAction() == sal_False && GetSdrDrawMode() == OBJ_NONE);
return IsObjectSelect();
}
@@ -5091,7 +5075,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
if ( xRecorder.is() )
{
//Shell ermitteln
- SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, TYPE(SwTextShell) );
+ SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, typeid(SwTextShell) );
// Request generieren und recorden
if (pSfxShell)
{
@@ -5293,8 +5277,9 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
{
sal_Bool bRet = sal_False;
const Point aDocPos( PixelToLogic( rMousePos ) );
+ const basegfx::B2DPoint aB2DDocPos(aDocPos.X(), aDocPos.Y());
// --> OD 2005-02-17 #i42258#
- const bool bIsInsideSelectedObj( rSh.IsInsideSelectedObj( aDocPos ) );
+ const bool bIsInsideSelectedObj( rSh.IsInsideSelectedObj( aB2DDocPos ) );
// <--
//create a synthetic mouse event out of the coordinates
MouseEvent aMEvt(rMousePos);
@@ -5512,7 +5497,7 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
return bRet;
}
-SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType )
+SfxShell* lcl_GetShellFromDispatcher( SwView& rView, const std::type_info& rType )
{
//Shell ermitteln
SfxShell* pShell;
@@ -5520,7 +5505,7 @@ SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType )
for(sal_uInt16 i = 0; sal_True; ++i )
{
pShell = pDispatcher->GetShell( i );
- if( !pShell || pShell->IsA( nType ) )
+ if( !pShell || typeid(*pShell) == rType )
break;
}
return pShell;
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 3ab1580c648c..f5cd0a3ae993 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -25,12 +25,10 @@
#include "precompiled_sw.hxx"
#include <tools/ref.hxx>
#include <hintids.hxx>
-
#include <doc.hxx>
#ifdef DBG_UTIL
#include <stdio.h>
#endif
-
#include <vcl/help.hxx>
#include <svl/stritem.hxx>
#include <unotools/securityoptions.hxx>
@@ -67,14 +65,11 @@
#include <viewopt.hxx>
#include <docvw.hrc>
#include <utlui.hrc>
-
#include <PostItMgr.hxx>
#include <fmtfld.hxx>
-
-// --> OD 2009-08-18 #i104300#
#include <IDocumentMarkAccess.hxx>
#include <ndtxt.hxx>
-// <--
+#include <svx/svdlegacy.hxx>
/*--------------------------------------------------------------------
Beschreibung: KeyEvents
@@ -123,7 +118,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( pSdrView )
{
SdrPageView* pPV = pSdrView->GetSdrPageView();
- SwDPage* pPage = pPV ? ((SwDPage*)pPV->GetPage()) : 0;
+ SwDPage* pPage = pPV ? ((SwDPage*)&pPV->getSdrPageFromSdrPageView()) : 0;
bWeiter = pPage && pPage->RequestHelp(this, pSdrView, rEvt);
}
}
@@ -463,36 +458,27 @@ aktuelle Zeichenvorlage anzeigen?
if( bWeiter && pSdrView && bQuickBalloon)
{
SdrViewEvent aVEvt;
- SdrHitKind eHit = pSdrView->PickAnything(aPos, aVEvt);
+ SdrHitKind eHit = pSdrView->PickAnything(basegfx::B2DPoint(aPos.X(), aPos.Y()), aVEvt);
const SvxURLField *pField;
SdrObject* pObj = NULL;
- if ((pField = aVEvt.pURLField) != 0)
+ if(aVEvt.maURLField.Len())
{
- // URL-Feld getroffen
- if (pField)
- {
- pObj = aVEvt.pObj;
- sTxt = pField->GetURL();
+ // URLField hit
+ pObj = aVEvt.mpObj;
+ sTxt = aVEvt.maURLField;
bWeiter = sal_False;
}
- }
if (bWeiter && eHit == SDRHIT_TEXTEDIT)
{
// URL-Feld in zum Editieren ge?ffneten DrawText-Objekt suchen
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
const SvxFieldItem* pFieldItem;
- if (pSdrView->AreObjectsMarked())
- {
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- }
+ pObj = pSdrView->getSelectedIfSingle();
- if (pObj && pObj->ISA(SdrTextObj) && pOLV &&
+ if (pObj && dynamic_cast< SdrTextObj* >(pObj) && pOLV &&
(pFieldItem = pOLV->GetFieldUnderMousePointer()) != 0)
{
pField = dynamic_cast<const SvxURLField*>(pFieldItem->GetField());
@@ -509,7 +495,7 @@ aktuelle Zeichenvorlage anzeigen?
sTxt = URIHelper::removePassword( sTxt, INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_UNAMBIGUOUS);
- Rectangle aLogicPix = LogicToPixel(pObj->GetLogicRect());
+ Rectangle aLogicPix = LogicToPixel(sdr::legacy::GetLogicRect(*pObj));
Rectangle aScreenRect(OutputToScreenPixel(aLogicPix.TopLeft()),
OutputToScreenPixel(aLogicPix.BottomRight()));
diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx
index 61592f803264..2f8b144badc9 100644
--- a/sw/source/ui/docvw/edtwin3.cxx
+++ b/sw/source/ui/docvw/edtwin3.cxx
@@ -55,7 +55,7 @@ void ScrollMDI( ViewShell* pVwSh, const SwRect &rRect,
sal_uInt16 nRangeX, sal_uInt16 nRangeY)
{
SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell();
- if (pSfxVwSh && pSfxVwSh->ISA(SwView))
+ if (pSfxVwSh && dynamic_cast< SwView* >(pSfxVwSh))
((SwView *)pSfxVwSh)->Scroll( rRect.SVRect(), nRangeX, nRangeY );
}
@@ -68,7 +68,7 @@ void ScrollMDI( ViewShell* pVwSh, const SwRect &rRect,
sal_Bool IsScrollMDI( ViewShell* pVwSh, const SwRect &rRect )
{
SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell();
- if (pSfxVwSh && pSfxVwSh->ISA(SwView))
+ if (pSfxVwSh && dynamic_cast< SwView* >(pSfxVwSh))
return (((SwView *)pSfxVwSh)->IsScroll(rRect.SVRect()));
return sal_False;
}
@@ -84,9 +84,9 @@ void SizeNotify(ViewShell* pVwSh, const Size &rSize)
SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell();
if (pSfxVwSh)
{
- if (pSfxVwSh->ISA(SwView))
+ if (dynamic_cast< SwView* >(pSfxVwSh))
((SwView *)pSfxVwSh)->DocSzChgd(rSize);
- else if (pSfxVwSh->ISA(SwPagePreView))
+ else if (dynamic_cast< SwPagePreView* >(pSfxVwSh))
((SwPagePreView *)pSfxVwSh)->DocSzChgd( rSize );
}
}
@@ -101,7 +101,7 @@ void PageNumNotify( ViewShell* pVwSh, sal_uInt16 nPhyNum, sal_uInt16 nVirtNum,
const String& rPgStr)
{
SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell();
- if ( pSfxVwSh && pSfxVwSh->ISA(SwView) &&
+ if ( pSfxVwSh && dynamic_cast< SwView* >(pSfxVwSh) &&
((SwView*)pSfxVwSh)->GetCurShell() )
((SwView *)pSfxVwSh)->UpdatePageNums(nPhyNum, nVirtNum, rPgStr);
}
@@ -117,7 +117,7 @@ void PageNumNotify( ViewShell* pVwSh, sal_uInt16 nPhyNum, sal_uInt16 nVirtNum,
void FrameNotify( ViewShell* pVwSh, FlyMode eMode )
{
- if ( pVwSh->ISA(SwCrsrShell) )
+ if ( dynamic_cast< SwCrsrShell* >(pVwSh) )
SwBaseShell::SetFrmMode( eMode, (SwWrtShell*)pVwSh );
}
@@ -157,14 +157,14 @@ TblChgMode GetTblChgDefaultMode()
void RepaintPagePreview( ViewShell* pVwSh, const SwRect& rRect )
{
SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell();
- if (pSfxVwSh && pSfxVwSh->ISA( SwPagePreView ))
+ if (pSfxVwSh && dynamic_cast< SwPagePreView* >(pSfxVwSh))
((SwPagePreView *)pSfxVwSh)->RepaintCoreRect( rRect );
}
sal_Bool JumpToSwMark( ViewShell* pVwSh, const String& rMark )
{
SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell();
- if( pSfxVwSh && pSfxVwSh->ISA( SwView ) )
+ if( pSfxVwSh && dynamic_cast< SwView* >(pSfxVwSh) )
return ((SwView *)pSfxVwSh)->JumpToSwMark( rMark );
return sal_False;
}
diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx
index 48a0d4052b36..571b9e439b15 100644
--- a/sw/source/ui/docvw/romenu.cxx
+++ b/sw/source/ui/docvw/romenu.cxx
@@ -95,8 +95,8 @@ void SwReadOnlyPopup::Check( sal_uInt16 nMID, sal_uInt16 nSID, SfxDispatcher &rD
EnableItem( nMID, sal_True );
if (_pItem)
{
- CheckItem ( nMID, !_pItem->ISA(SfxVoidItem) &&
- _pItem->ISA(SfxBoolItem) &&
+ CheckItem ( nMID, !dynamic_cast< SfxVoidItem* >(_pItem) &&
+ dynamic_cast< SfxBoolItem* >(_pItem) &&
((SfxBoolItem*)_pItem)->GetValue());
//remove full screen entry when not in full screen mode
if(SID_WIN_FULLSCREEN == nSID && !IsItemChecked(SID_WIN_FULLSCREEN) )
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index dd604dd6344f..8b775cc7a0ad 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -538,7 +538,7 @@ void SwSrcEditWindow::CreateTextEngine()
pTextEngine->EnableUndo( sal_True );
pTextEngine->SetUpdateMode( sal_True );
- pTextView->ShowCursor( sal_True, sal_True );
+ pTextView->ShowCursor( true, true );
InitScrollBars();
StartListening( *pTextEngine );
@@ -596,14 +596,14 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll)
{
long nDiff = pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos();
GetTextView()->Scroll( 0, nDiff );
- pTextView->ShowCursor( sal_False, sal_True );
+ pTextView->ShowCursor( false, true );
pScroll->SetThumbPos( pTextView->GetStartDocPos().Y() );
}
else
{
long nDiff = pTextView->GetStartDocPos().X() - pScroll->GetThumbPos();
GetTextView()->Scroll( nDiff, 0 );
- pTextView->ShowCursor( sal_False, sal_True );
+ pTextView->ShowCursor( false, true );
pScroll->SetThumbPos( pTextView->GetStartDocPos().X() );
}
GetSrcView()->GetViewFrame()->GetBindings().Invalidate( SID_TABLE_CELL );
@@ -673,7 +673,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )
pTextEngine->SetActiveView(0);
// pTextEngine->SetUpdateMode( sal_True );
pTextEngine->SetActiveView(pTmp);
- pTextView->ShowCursor(sal_False, sal_False);
+ pTextView->ShowCursor(false, false);
*/
if(aSyntaxLineTable.Count() && !pTimer->IsActive())
@@ -712,7 +712,7 @@ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara )
pTextEngine->SetActiveView(pTmp);
// Bug 72887 show the cursor
pTmp->SetAutoScroll(sal_True);
- pTmp->ShowCursor( sal_False/*pTmp->IsAutoScroll()*/ );
+ pTmp->ShowCursor( false/*pTmp->IsAutoScroll()*/ );
if(!bTempModified)
ClearModifyFlag();
@@ -810,25 +810,26 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff
void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if ( rHint.ISA( TextHint ) )
+ const TextHint* pTextHint = dynamic_cast< const TextHint* >(&rHint);
+
+ if ( pTextHint )
{
- const TextHint& rTextHint = (const TextHint&)rHint;
- if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
+ if( pTextHint->GetId() == TEXT_HINT_VIEWSCROLLED )
{
pHScrollbar->SetThumbPos( pTextView->GetStartDocPos().X() );
pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() );
}
- else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
+ else if( pTextHint->GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
{
if ( (long)pTextEngine->GetTextHeight() < pOutWin->GetOutputSizePixel().Height() )
pTextView->Scroll( 0, pTextView->GetStartDocPos().Y() );
pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() );
SetScrollBarRanges();
}
- else if( ( rTextHint.GetId() == TEXT_HINT_PARAINSERTED ) ||
- ( rTextHint.GetId() == TEXT_HINT_PARACONTENTCHANGED ) )
+ else if( ( pTextHint->GetId() == TEXT_HINT_PARAINSERTED ) ||
+ ( pTextHint->GetId() == TEXT_HINT_PARACONTENTCHANGED ) )
{
- DoDelayedSyntaxHighlight( (sal_uInt16)rTextHint.GetValue() );
+ DoDelayedSyntaxHighlight( (sal_uInt16)pTextHint->GetValue() );
}
}
}
diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx
index c149bfa50a16..e35ba7c6c70f 100644
--- a/sw/source/ui/envelp/envimg.cxx
+++ b/sw/source/ui/envelp/envimg.cxx
@@ -57,9 +57,6 @@ using namespace utl;
using namespace rtl;
using namespace ::com::sun::star::uno;
-
-TYPEINIT1_AUTOFACTORY( SwEnvItem, SfxPoolItem );
-
// --------------------------------------------------------------------------
SW_DLLPUBLIC String MakeSender()
{
@@ -104,6 +101,8 @@ SW_DLLPUBLIC String MakeSender()
return sRet;
}
// --------------------------------------------------------------------------
+IMPL_POOLITEM_FACTORY(SwEnvItem)
+
SwEnvItem::SwEnvItem() :
SfxPoolItem(FN_ENVELOP)
{
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 301ff6fa7e80..da34739c2587 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -94,7 +94,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
//enable 'active' language selection
aFormatLB.SetShowLanguageControl(sal_True);
- SFX_ITEMSET_ARG( &rCoreSet, pItem, SfxUnoAnyItem, SID_DOCINFO, sal_False );
+ SFX_ITEMSET_ARG( &rCoreSet, pItem, SfxUnoAnyItem, SID_DOCINFO );
if ( pItem )
pItem->GetValue() >>= xCustomPropertySet;
}
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 8310cce8a7e3..cbed50189146 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -367,11 +367,10 @@ void SwFldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0;
if(pViewFrame)
{
- const TypeId aSwViewTypeId = TYPE(SwView);
- SfxViewShell* pViewShell = SfxViewShell::GetFirst( &aSwViewTypeId );
+ SfxViewShell* pViewShell = SfxViewShell::GetFirst( _IsSfxViewShell< SwView > );
while(pViewShell && pViewShell->GetViewFrame() != pViewFrame)
{
- pViewShell = SfxViewShell::GetNext( *pViewShell, &aSwViewTypeId );
+ pViewShell = SfxViewShell::GetNext( *pViewShell, _IsSfxViewShell< SwView > );
}
if(pViewShell)
static_cast<SwFldDBPage&>(rPage).SetWrtShell(static_cast<SwView*>(pViewShell)->GetWrtShell());
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 3bc4fda74f9d..f5301f195511 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -593,7 +593,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
}
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
@@ -604,7 +604,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
case RID_SVXPAGE_NUM_POSITION:
{
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
diff --git a/sw/source/ui/globdoc/globdoc.cxx b/sw/source/ui/globdoc/globdoc.cxx
index 632b132556ad..94bc87b4455c 100644
--- a/sw/source/ui/globdoc/globdoc.cxx
+++ b/sw/source/ui/globdoc/globdoc.cxx
@@ -42,9 +42,6 @@
Beschreibung: Alle Filter registrieren
--------------------------------------------------------------------*/
-TYPEINIT1(SwGlobalDocShell, SwDocShell);
-
-//-------------------------------------------------------------------------
SFX_IMPL_OBJECTFACTORY( SwGlobalDocShell, SvGlobalName(SO3_SWGLOB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/GlobalDocument" )
SwGlobalDocShell::SwGlobalDocShell(SfxObjectCreateMode eMode ) :
diff --git a/sw/source/ui/inc/annotsh.hxx b/sw/source/ui/inc/annotsh.hxx
index 39f794a32300..084ea179644f 100644
--- a/sw/source/ui/inc/annotsh.hxx
+++ b/sw/source/ui/inc/annotsh.hxx
@@ -34,7 +34,6 @@ class SwAnnotationShell: public SfxShell
public:
SFX_DECL_INTERFACE(SW_ANNOTATIONSHELL)
- TYPEINFO();
SwAnnotationShell(SwView&);
virtual ~SwAnnotationShell();
diff --git a/sw/source/ui/inc/basesh.hxx b/sw/source/ui/inc/basesh.hxx
index b92277ea8535..36103bd5921b 100644
--- a/sw/source/ui/inc/basesh.hxx
+++ b/sw/source/ui/inc/basesh.hxx
@@ -77,7 +77,6 @@ public:
virtual ~SwBaseShell();
SFX_DECL_INTERFACE(SW_BASESHELL)
- TYPEINFO();
void ExecDelete(SfxRequest &);
diff --git a/sw/source/ui/inc/beziersh.hxx b/sw/source/ui/inc/beziersh.hxx
index 4120426595e0..cacbeb26c9b6 100644
--- a/sw/source/ui/inc/beziersh.hxx
+++ b/sw/source/ui/inc/beziersh.hxx
@@ -29,7 +29,6 @@ class SwBezierShell: public SwBaseShell
{
public:
SFX_DECL_INTERFACE(SW_BEZIERSHELL)
- TYPEINFO();
SwBezierShell(SwView &rView);
diff --git a/sw/source/ui/inc/cfgitems.hxx b/sw/source/ui/inc/cfgitems.hxx
index f67d83fba671..1bb946227d86 100644
--- a/sw/source/ui/inc/cfgitems.hxx
+++ b/sw/source/ui/inc/cfgitems.hxx
@@ -70,7 +70,6 @@ class SW_DLLPUBLIC SwDocDisplayItem : public SfxPoolItem
public:
- TYPEINFO();
SwDocDisplayItem( sal_uInt16 nWhich = FN_PARAM_DOCDISP );
SwDocDisplayItem(
const SwDocDisplayItem& rSwDocDisplayItem );
@@ -110,7 +109,6 @@ class SW_DLLPUBLIC SwElemItem : public SfxPoolItem
friend class SwContentOptPage;
public:
- TYPEINFO();
SwElemItem( sal_uInt16 nWhich = FN_PARAM_ELEM );
SwElemItem(const SwElemItem& rElemItem);
SwElemItem(const SwViewOption& rVOpt, sal_uInt16 nWhich);
@@ -134,7 +132,6 @@ class SW_DLLPUBLIC SwAddPrinterItem : public SfxPoolItem, public SwPrintData
using SwPrintData::operator ==;
public:
- TYPEINFO();
SwAddPrinterItem( sal_uInt16 nWhich = FN_PARAM_ADDPRINTER );
SwAddPrinterItem( sal_uInt16 nWhich, const SwPrintData& rPrtData );
SwAddPrinterItem( const SwAddPrinterItem& rAddPrinterItem);
@@ -181,7 +178,6 @@ class SW_DLLPUBLIC SwShadowCursorItem : public SfxPoolItem
sal_uInt8 eMode;
sal_Bool bOn;
public:
- TYPEINFO();
SwShadowCursorItem( sal_uInt16 nWhich = FN_PARAM_SHADOWCURSOR );
SwShadowCursorItem( const SwShadowCursorItem& rElemItem );
SwShadowCursorItem( const SwViewOption& rVOpt, sal_uInt16 nWhich );
diff --git a/sw/source/ui/inc/drawbase.hxx b/sw/source/ui/inc/drawbase.hxx
index af459499d21b..bf7601dd46bf 100644
--- a/sw/source/ui/inc/drawbase.hxx
+++ b/sw/source/ui/inc/drawbase.hxx
@@ -45,8 +45,8 @@ protected:
SwView* m_pView;
SwWrtShell* m_pSh;
SwEditWin* m_pWin;
- Point m_aStartPos; // Position von BeginCreate
- Point m_aMDPos; // Position von MouseButtonDown
+ basegfx::B2DPoint m_aStartPos; // Position von BeginCreate
+ basegfx::B2DPoint m_aMDPos; // Position von MouseButtonDown
sal_uInt16 m_nSlotId;
sal_Bool m_bCreateObj :1;
sal_Bool m_bInsForm :1;
diff --git a/sw/source/ui/inc/drawsh.hxx b/sw/source/ui/inc/drawsh.hxx
index 5fc67a789d4f..32cf37624bc3 100644
--- a/sw/source/ui/inc/drawsh.hxx
+++ b/sw/source/ui/inc/drawsh.hxx
@@ -31,7 +31,6 @@ class SwDrawShell: public SwDrawBaseShell
{
public:
SFX_DECL_INTERFACE(SW_DRAWSHELL)
- TYPEINFO();
SwDrawShell(SwView &rView);
diff --git a/sw/source/ui/inc/drformsh.hxx b/sw/source/ui/inc/drformsh.hxx
index ab266cd086a4..70bb06f246e9 100644
--- a/sw/source/ui/inc/drformsh.hxx
+++ b/sw/source/ui/inc/drformsh.hxx
@@ -31,7 +31,6 @@ class SwDrawFormShell: public SwDrawBaseShell
{
public:
SFX_DECL_INTERFACE(SW_DRAWFORMSHELL)
- TYPEINFO();
SwDrawFormShell(SwView &rView);
virtual ~SwDrawFormShell();
diff --git a/sw/source/ui/inc/drwbassh.hxx b/sw/source/ui/inc/drwbassh.hxx
index 9bd33bb05101..9d4acfeba93d 100644
--- a/sw/source/ui/inc/drwbassh.hxx
+++ b/sw/source/ui/inc/drwbassh.hxx
@@ -45,7 +45,6 @@ public:
virtual ~SwDrawBaseShell();
SFX_DECL_INTERFACE(SW_DRAWBASESHELL)
- TYPEINFO();
void Execute(SfxRequest &);
void GetState(SfxItemSet &);
diff --git a/sw/source/ui/inc/drwtxtsh.hxx b/sw/source/ui/inc/drwtxtsh.hxx
index 8d0c68d60ca6..182b60f74aea 100644
--- a/sw/source/ui/inc/drwtxtsh.hxx
+++ b/sw/source/ui/inc/drwtxtsh.hxx
@@ -45,7 +45,6 @@ class SwDrawTextShell: public SfxShell
sal_Bool IsTextEdit();
public:
SFX_DECL_INTERFACE(SW_DRWTXTSHELL)
- TYPEINFO();
SwView &GetView() { return rView; }
SwWrtShell &GetShell();
diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx
index f63b5d4691d4..6facd20b49bb 100644
--- a/sw/source/ui/inc/edtwin.hxx
+++ b/sw/source/ui/inc/edtwin.hxx
@@ -29,9 +29,9 @@
#include <vcl/window.hxx>
#include <svtools/transfer.hxx>
#include <swevent.hxx>
-
#define _SVSTDARR_STRINGSISORTDTOR
#include <svl/svstdarr.hxx>
+#include <svx/sdrobjectfactory.hxx>
class SwWrtShell;
class SwView;
@@ -115,7 +115,7 @@ friend void PageNumNotify( ViewShell* pVwSh,
sal_uInt16 eBezierMode;
sal_uInt16 nInsFrmColCount; //Spaltenzahl fuer interaktiven Rahmen
- SdrObjKind eDrawMode;
+ SdrObjectCreationInfo meSdrObjectCreationInfo;
sal_Bool bLinkRemoved : 1,
bMBPressed : 1,
bInsDraw : 1,
@@ -222,14 +222,14 @@ public:
void SetObjectSelect( sal_Bool bVal ) { bObjectSelect = bVal; }
sal_Bool IsObjectSelect() const { return bObjectSelect; }
- inline SdrObjKind GetSdrDrawMode(/*sal_Bool bBuf = sal_False*/) const { return eDrawMode; }
- inline void SetSdrDrawMode( SdrObjKind eSdrObjectKind ) { eDrawMode = eSdrObjectKind; SetObjectSelect( sal_False ); }
+ inline const SdrObjectCreationInfo& getSdrObjectCreationInfo() const { return meSdrObjectCreationInfo; }
+ inline void setSdrObjectCreationInfo(const SdrObjectCreationInfo& eSdrObjectCreationInfo) { meSdrObjectCreationInfo = eSdrObjectCreationInfo; SetObjectSelect( sal_False ); }
void StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect );
sal_Bool IsFrmAction() { return (bInsFrm); }
inline sal_uInt16 GetBezierMode() { return eBezierMode; }
void SetBezierMode(sal_uInt16 eBezMode) { eBezierMode = eBezMode; }
- void EnterDrawTextMode(const Point& aDocPos); // DrawTextEditMode einschalten
+ void EnterDrawTextMode(const basegfx::B2DPoint& aDocPos); // DrawTextEditMode einschalten
void InsFrm(sal_uInt16 nCols);
void StopInsFrm();
sal_uInt16 GetFrmColCount() const {return nInsFrmColCount;} //Spaltenzahl fuer interaktiven Rahmen
diff --git a/sw/source/ui/inc/envimg.hxx b/sw/source/ui/inc/envimg.hxx
index 5a2cecdcaded..61d8e971fe4a 100644
--- a/sw/source/ui/inc/envimg.hxx
+++ b/sw/source/ui/inc/envimg.hxx
@@ -63,11 +63,10 @@ public:
sal_Int32 lShiftRight; // Verschiebung nach rechts (twips)
sal_Int32 lShiftDown; // Verschiebung nach unten (twips)
+ POOLITEM_FACTORY()
SwEnvItem();
SwEnvItem(const SwEnvItem& rItem);
- TYPEINFO();
-
SwEnvItem& operator =(const SwEnvItem& rItem);
virtual int operator ==(const SfxPoolItem& rItem) const;
diff --git a/sw/source/ui/inc/glshell.hxx b/sw/source/ui/inc/glshell.hxx
index f9a13f010e12..1214a844dd01 100644
--- a/sw/source/ui/inc/glshell.hxx
+++ b/sw/source/ui/inc/glshell.hxx
@@ -38,7 +38,6 @@ protected:
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SW_GLOSDOCSHELL)
SwGlosDocShell( sal_Bool bNewShow = sal_True);
@@ -69,7 +68,6 @@ protected:
public:
- TYPEINFO();
SFX_DECL_INTERFACE(SW_WEBGLOSDOCSHELL)
SwWebGlosDocShell();
diff --git a/sw/source/ui/inc/listsh.hxx b/sw/source/ui/inc/listsh.hxx
index 8e38e08a033d..2f1d59b72b78 100644
--- a/sw/source/ui/inc/listsh.hxx
+++ b/sw/source/ui/inc/listsh.hxx
@@ -29,7 +29,6 @@ class SwListShell: public SwBaseShell
{
public:
SFX_DECL_INTERFACE(SW_LISTSHELL)
- TYPEINFO();
SwListShell(SwView &rView);
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index b7acc581247d..a06e08285da5 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -248,7 +248,6 @@ protected:
public:
SFX_DECL_VIEWFACTORY(SwPagePreView);
SFX_DECL_INTERFACE(SW_PAGEPREVIEW)
- TYPEINFO();
inline Window* GetFrameWindow() const { return &(GetViewFrame())->GetWindow(); }
inline ViewShell* GetViewShell() const { return aViewWin.GetViewShell(); }
diff --git a/sw/source/ui/inc/srcview.hxx b/sw/source/ui/inc/srcview.hxx
index 57d516246549..b284bb915458 100644
--- a/sw/source/ui/inc/srcview.hxx
+++ b/sw/source/ui/inc/srcview.hxx
@@ -63,8 +63,6 @@ public:
SFX_DECL_VIEWFACTORY(SwSrcView);
SFX_DECL_INTERFACE(SW_SRC_VIEWSHELL)
- TYPEINFO();
-
SwSrcView(SfxViewFrame* pFrame, SfxViewShell*);
diff --git a/sw/source/ui/inc/swwrtshitem.hxx b/sw/source/ui/inc/swwrtshitem.hxx
index 2d87c9fac066..2f86f2b2f09b 100644
--- a/sw/source/ui/inc/swwrtshitem.hxx
+++ b/sw/source/ui/inc/swwrtshitem.hxx
@@ -32,7 +32,6 @@ class SW_DLLPUBLIC SwWrtShellItem: public SfxPoolItem
SwWrtShell* pWrtSh;
public:
- TYPEINFO();
SwWrtShellItem();
SwWrtShellItem( sal_uInt16 nWhich , SwWrtShell* pWrtSh);
SwWrtShellItem( const SwWrtShellItem& );
diff --git a/sw/source/ui/inc/tabsh.hxx b/sw/source/ui/inc/tabsh.hxx
index 482215fc2fbc..3efef22016ae 100644
--- a/sw/source/ui/inc/tabsh.hxx
+++ b/sw/source/ui/inc/tabsh.hxx
@@ -38,7 +38,6 @@ class SwTableShell: public SwBaseShell
{
public:
SFX_DECL_INTERFACE(SW_TABSHELL)
- TYPEINFO();
void Execute(SfxRequest &);
void GetState(SfxItemSet &);
diff --git a/sw/source/ui/inc/textsh.hxx b/sw/source/ui/inc/textsh.hxx
index cee32496f375..8ade873d5e07 100644
--- a/sw/source/ui/inc/textsh.hxx
+++ b/sw/source/ui/inc/textsh.hxx
@@ -41,7 +41,6 @@ class SwTextShell: public SwBaseShell
public:
SFX_DECL_INTERFACE(SW_TEXTSHELL)
- TYPEINFO();
//CHINA001 DECL_LINK( PostItNextHdl, Button * );
//CHINA001 DECL_LINK( PostItPrevHdl, Button * );
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 1236b8cf3a7b..f35cc0fe7d9d 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -408,14 +408,13 @@ public:
SFX_DECL_VIEWFACTORY(SwView);
SFX_DECL_INTERFACE(SW_VIEWSHELL)
- TYPEINFO();
SfxDispatcher &GetDispatcher();
void GotFocus() const;
virtual SdrView* GetDrawView() const;
virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
- virtual void ShowCursor( FASTBOOL bOn = sal_True );
+ virtual void ShowCursor( bool bOn = true );
virtual ErrCode DoVerb( long nVerb );
virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
@@ -566,7 +565,7 @@ public:
void SetSelDrawSlot();
inline void FlipDrawSelMode() { bDrawSelMode = !bDrawSelMode; }
void NoRotate(); // Rotate-Mode abschalten
- sal_Bool EnterDrawTextMode(const Point& aDocPos);
+ sal_Bool EnterDrawTextMode(const basegfx::B2DPoint& aDocPos);
void LeaveDrawCreate() { nDrawSfxId = nFormSfxId = USHRT_MAX; sDrawCustom.Erase();}
sal_Bool IsDrawMode() { return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
sal_Bool IsFormMode() const;
@@ -574,8 +573,7 @@ public:
sal_Bool AreOnlyFormsSelected() const;
sal_Bool HasDrwObj(SdrObject *pSdrObj) const;
sal_Bool HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
- sal_Bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL,
- Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
+ sal_Bool BeginTextEdit( SdrObject* pObj, Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
void StateTabWin(SfxItemSet&);
diff --git a/sw/source/ui/inc/wformsh.hxx b/sw/source/ui/inc/wformsh.hxx
index e90dc063aa2b..e52aa47e1f91 100644
--- a/sw/source/ui/inc/wformsh.hxx
+++ b/sw/source/ui/inc/wformsh.hxx
@@ -32,7 +32,6 @@ public:
virtual ~SwWebDrawFormShell();
SFX_DECL_INTERFACE(SW_WEBDRAWFORMSHELL)
- TYPEINFO();
};
diff --git a/sw/source/ui/inc/wfrmsh.hxx b/sw/source/ui/inc/wfrmsh.hxx
index e5535aa353b2..e3da55e31449 100644
--- a/sw/source/ui/inc/wfrmsh.hxx
+++ b/sw/source/ui/inc/wfrmsh.hxx
@@ -32,7 +32,6 @@ class SwWebFrameShell: public SwFrameShell
public:
SFX_DECL_INTERFACE(SW_WEBFRAMESHELL)
- TYPEINFO();
SwWebFrameShell(SwView &rView);
virtual ~SwWebFrameShell();
diff --git a/sw/source/ui/inc/wgrfsh.hxx b/sw/source/ui/inc/wgrfsh.hxx
index 10dceae25b04..699d9d10a6b6 100644
--- a/sw/source/ui/inc/wgrfsh.hxx
+++ b/sw/source/ui/inc/wgrfsh.hxx
@@ -32,7 +32,6 @@ public:
virtual ~SwWebGrfShell();
SFX_DECL_INTERFACE(SW_WEBGRFSHELL)
- TYPEINFO();
};
diff --git a/sw/source/ui/inc/wlistsh.hxx b/sw/source/ui/inc/wlistsh.hxx
index 9caa864d8d04..1774f3c7bcfd 100644
--- a/sw/source/ui/inc/wlistsh.hxx
+++ b/sw/source/ui/inc/wlistsh.hxx
@@ -29,7 +29,6 @@ class SwWebListShell: public SwListShell
{
public:
SFX_DECL_INTERFACE(SW_WEBLISTSHELL)
- TYPEINFO();
virtual ~SwWebListShell();
SwWebListShell(SwView &rView);
diff --git a/sw/source/ui/inc/wtabsh.hxx b/sw/source/ui/inc/wtabsh.hxx
index 25ad074a06a5..f469d8db1178 100644
--- a/sw/source/ui/inc/wtabsh.hxx
+++ b/sw/source/ui/inc/wtabsh.hxx
@@ -29,7 +29,6 @@ class SwWebTableShell: public SwTableShell
{
public:
SFX_DECL_INTERFACE(SW_WEBTABSHELL)
- TYPEINFO();
virtual ~SwWebTableShell();
SwWebTableShell(SwView &rView);
diff --git a/sw/source/ui/inc/wtextsh.hxx b/sw/source/ui/inc/wtextsh.hxx
index 69be236b4b79..1b09b5a87ab6 100644
--- a/sw/source/ui/inc/wtextsh.hxx
+++ b/sw/source/ui/inc/wtextsh.hxx
@@ -32,7 +32,6 @@ class SwWebTextShell: public SwTextShell
public:
SFX_DECL_INTERFACE(SW_WEBTEXTSHELL)
- TYPEINFO();
SwWebTextShell(SwView &rView);
virtual ~SwWebTextShell();
diff --git a/sw/source/ui/inc/wview.hxx b/sw/source/ui/inc/wview.hxx
index 327f394edc15..e89078eaafc6 100644
--- a/sw/source/ui/inc/wview.hxx
+++ b/sw/source/ui/inc/wview.hxx
@@ -38,7 +38,6 @@ public:
SFX_DECL_VIEWFACTORY(SwWebView);
SFX_DECL_INTERFACE(SW_WEBVIEWSHELL)
- TYPEINFO();
SwWebView(SfxViewFrame* pFrame, SfxViewShell*);
~SwWebView();
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 0f170e2d6fae..2ff5d5563edd 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3495,7 +3495,7 @@ void SwTokenWindow::InsertAtSelection(
pButton->SetText(sTmp.Copy(0, 2));
}
- Size aEditSize(GetOutputSizePixel());
+ Size aEditSize(GetOutputSizePixel());
aEditSize.Width() = pButton->GetTextWidth(rText) + 5;
pButton->SetSizePixel(aEditSize);
pButton->Check(sal_True);
@@ -3802,14 +3802,11 @@ sal_Bool SwTokenWindow::CreateQuickHelp(Control* pCtrl,
---------------------------------------------------------------------------*/
void SwTokenWindow::Resize()
{
- Size aCompleteSize(GetOutputSizePixel());
-
- Point aRightPos(aRightScrollWin.GetPosPixel());
- Size aRightSize(aRightScrollWin.GetSizePixel());
-
- Size aMiddleSize(aCtrlParentWin.GetSizePixel());
-
- long nMove = aCompleteSize.Width() - aRightSize.Width() - aRightPos.X();
+ const Size aCompleteSize(GetOutputSizePixel());
+ Point aRightPos(aRightScrollWin.GetPosPixel());
+ const Size aRightSize(aRightScrollWin.GetSizePixel());
+ Size aMiddleSize(aCtrlParentWin.GetSizePixel());
+ long nMove(aCompleteSize.Width() - aRightSize.Width() - aRightPos.X());
aRightPos.X() += nMove;
aRightScrollWin.SetPosPixel(aRightPos);
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index 0110d41635cd..d111cef9f10f 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -51,6 +51,8 @@
#include <doc.hxx> // " " "
#include <docary.hxx>
#include <edtwin.hxx>
+#include <svx/svdlegacy.hxx>
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -151,7 +153,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
if ( pParaObj )
{
- SetPaperSize( pTextObj->GetLogicRect().GetSize() );
+ SetPaperSize( sdr::legacy::GetLogicRect(*pTextObj).GetSize() );
SetText( *pParaObj );
ClearModifyFlag();
@@ -166,15 +168,14 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
{
SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
- SdrPageView* pPV = pSdrView->GetSdrPageView();
nDocIndex = n;
bNextDoc = sal_True;
pOutlView->SetOutputArea( Rectangle( Point(), Size(1,1)));
- SetPaperSize( pTextObj->GetLogicRect().GetSize() );
+ SetPaperSize( sdr::legacy::GetLogicRect(*pTextObj).GetSize() );
SetUpdateMode(sal_True);
- pView->GetWrtShell().MakeVisible(pTextObj->GetLogicRect());
+ pView->GetWrtShell().MakeVisible(sdr::legacy::GetLogicRange(*pTextObj));
- pSdrView->SdrBeginTextEdit(pTextObj, pPV, &pView->GetEditWin(), sal_False, this, pOutlView, sal_True, sal_True);
+ pSdrView->SdrBeginTextEdit(pTextObj, &pView->GetEditWin(), sal_False, this, pOutlView, sal_True, sal_True);
}
else
SetUpdateMode(sal_False);
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 3767c45004f0..c846307022d0 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -164,7 +164,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
SfxObjectShell * pDocSh = SfxObjectShell::Current();
sal_uInt16 i;
- if(PTR_CAST(SwWebDocShell, pDocSh))
+ if(dynamic_cast< SwWebDocShell* >( pDocSh))
{
aParaTemplLbl .Hide();
aParaTemplBox .Hide();
diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx
index fa83762ebcb4..a736b6762232 100644
--- a/sw/source/ui/misc/glshell.cxx
+++ b/sw/source/ui/misc/glshell.cxx
@@ -69,11 +69,6 @@ SFX_IMPL_INTERFACE( SwWebGlosDocShell, SwWebDocShell, SW_RES(0) )
{
}
-
-TYPEINIT1( SwGlosDocShell, SwDocShell );
-TYPEINIT1( SwWebGlosDocShell, SwWebDocShell );
-
-
void lcl_Execute( SwDocShell& rSh, SfxRequest& rReq )
{
if ( rReq.GetSlot() == SID_SAVEDOC )
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index c7e47a7b357c..8fa8adc5ece4 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -172,8 +172,8 @@ IMPL_LINK( SwInsFootNoteDlg, NumberExtCharHdl, Button *, EMPTYARG )
rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
if (RET_OK == pDlg->Execute())
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT );
if ( pItem )
{
String sExtChars(pItem->GetValue());
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index d7975731ef08..316de6eb4a4c 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -644,7 +644,7 @@ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh)
const SwRect& rPrtRect = pWrtSh->GetAnyCurRect(RECT_PAGE);
aPreviewWIN.SetPageWidth(rPrtRect.Width());
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &pWrtSh->GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &pWrtSh->GetView()));
if(eMetric == FUNIT_MM)
{
aDistBorderMF .SetDecimalDigits(1);
@@ -1136,7 +1136,7 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
}
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric) ) );
rPage.PageCreated(aSet);
for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
@@ -1147,7 +1147,7 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
case RID_SVXPAGE_NUM_POSITION:
{
SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell));
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)) );
rPage.PageCreated(aSet);
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index c2d459ec40f9..87f44ad9dc84 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -425,7 +425,7 @@ IMPL_LINK( SwSortDlg, DelimCharHdl, PushButton*, EMPTYARG )
rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
if( RET_OK == pMap->Execute() )
{
- SFX_ITEMSET_ARG( pMap->GetOutputItemSet(), pItem, SfxInt32Item, SID_ATTR_CHAR, sal_False );
+ SFX_ITEMSET_ARG( pMap->GetOutputItemSet(), pItem, SfxInt32Item, SID_ATTR_CHAR );
if ( pItem )
aDelimEdt.SetText( sal_Unicode ( pItem->GetValue() ) );
}
diff --git a/sw/source/ui/ribbar/conarc.cxx b/sw/source/ui/ribbar/conarc.cxx
index d769bb1fbe52..c5fa8f3ab929 100644
--- a/sw/source/ui/ribbar/conarc.cxx
+++ b/sw/source/ui/ribbar/conarc.cxx
@@ -102,11 +102,6 @@ sal_Bool ConstArc::MouseButtonUp( const MouseEvent& rMEvt )
m_pSh->EndCreate(SDRCREATE_NEXTPOINT);
}
}
-/* else if ( pView->IsCreateObj() && rMEvt.IsRight() )
- {
- pView->EndCreateObj( SDRCREATE_FORCEEND );
- bReturn = sal_True;
- }*/
return (bReturn);
}
@@ -121,22 +116,28 @@ sal_Bool ConstArc::MouseButtonUp( const MouseEvent& rMEvt )
void ConstArc::Activate(const sal_uInt16 nSlotId)
{
+ SdrObjectCreationInfo aSdrObjectCreationInfo;
+
switch (nSlotId)
{
case SID_DRAW_ARC:
- m_pWin->SetSdrDrawMode(OBJ_CARC);
+ aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
+ aSdrObjectCreationInfo.setSdrCircleObjType(CircleType_Arc);
break;
case SID_DRAW_PIE:
- m_pWin->SetSdrDrawMode(OBJ_SECT);
+ aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
+ aSdrObjectCreationInfo.setSdrCircleObjType(CircleType_Sector);
break;
case SID_DRAW_CIRCLECUT:
- m_pWin->SetSdrDrawMode(OBJ_CCUT);
+ aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
+ aSdrObjectCreationInfo.setSdrCircleObjType(CircleType_Segment);
break;
default:
- m_pWin->SetSdrDrawMode(OBJ_NONE);
break;
}
+ m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
+
SwDrawBase::Activate(nSlotId);
}
diff --git a/sw/source/ui/ribbar/concustomshape.cxx b/sw/source/ui/ribbar/concustomshape.cxx
index d487583bd1d0..bb179a8c34e6 100644
--- a/sw/source/ui/ribbar/concustomshape.cxx
+++ b/sw/source/ui/ribbar/concustomshape.cxx
@@ -27,9 +27,7 @@
#include <sfx2/bindings.hxx>
#include <svx/htmlmode.hxx>
-#include <svx/sdtacitm.hxx>
#include <svx/svdobj.hxx>
-#include <svx/sdtagitm.hxx>
#include <svx/sdtakitm.hxx>
#include <svx/sdtaditm.hxx>
#include <svx/sdtaaitm.hxx>
@@ -58,6 +56,7 @@
#include <svx/svdpage.hxx>
#include <svx/svdoashp.hxx>
#include <editeng/adjitem.hxx>
+#include <svx/svdlegacy.hxx>
#include <math.h>
@@ -149,7 +148,7 @@ sal_Bool ConstCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
void ConstCustomShape::Activate(const sal_uInt16 nSlotId)
{
- m_pWin->SetSdrDrawMode( OBJ_CUSTOMSHAPE );
+ m_pWin->setSdrObjectCreationInfo(SdrObjectCreationInfo(OBJ_CUSTOMSHAPE));
SwDrawBase::Activate(nSlotId);
}
@@ -183,7 +182,7 @@ void ConstCustomShape::SetAttributes( SdrObject* pObj )
if( pSourceObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
- SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
+ SfxItemSet aDest( pObj->GetObjectItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
@@ -199,11 +198,11 @@ void ConstCustomShape::SetAttributes( SdrObject* pObj )
0, 0);
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
- sal_Int32 nAngle = pSourceObj->GetRotateAngle();
- if ( nAngle )
+
+ const long aOldRotation(sdr::legacy::GetRotateAngle(*pSourceObj));
+ if ( aOldRotation )
{
- double a = nAngle * F_PI18000;
- pObj->NbcRotate( pObj->GetSnapRect().Center(), nAngle, sin( a ), cos( a ) );
+ sdr::legacy::RotateSdrObject(*pObj, sdr::legacy::GetSnapRect(*pObj).Center(), aOldRotation);
}
bAttributesAppliedFromGallery = sal_True;
}
@@ -218,7 +217,7 @@ void ConstCustomShape::SetAttributes( SdrObject* pObj )
pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) );
pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
- pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ pObj->SetMergedItem( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, sal_False ) );
((SdrObjCustomShape*)pObj)->MergeDefaultAttributes( &aCustomShape );
}
}
@@ -229,15 +228,12 @@ void ConstCustomShape::CreateDefaultObject()
SdrView *pSdrView = m_pSh->GetDrawView();
if ( pSdrView )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if ( rMarkList.GetMarkCount() == 1 )
- {
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
- if ( pObj && pObj->ISA( SdrObjCustomShape ) )
+ SdrObject* pObj = pSdrView->getSelectedIfSingle();
+
+ if ( pObj && dynamic_cast< SdrObjCustomShape* >(pObj) )
SetAttributes( pObj );
}
}
-}
// #i33136#
bool ConstCustomShape::doConstructOrthogonal() const
diff --git a/sw/source/ui/ribbar/conform.cxx b/sw/source/ui/ribbar/conform.cxx
index 359dfc7ec52f..f8be5da02f79 100644
--- a/sw/source/ui/ribbar/conform.cxx
+++ b/sw/source/ui/ribbar/conform.cxx
@@ -63,7 +63,7 @@ sal_Bool ConstFormControl::MouseButtonDown(const MouseEvent& rMEvt)
SdrView *pSdrView = m_pSh->GetDrawView();
- pSdrView->SetOrtho(rMEvt.IsShift());
+ pSdrView->SetOrthogonal(rMEvt.IsShift());
pSdrView->SetAngleSnapEnabled(rMEvt.IsShift());
if (rMEvt.IsMod2())
@@ -89,8 +89,10 @@ sal_Bool ConstFormControl::MouseButtonDown(const MouseEvent& rMEvt)
m_pWin->SetPointer(Pointer(POINTER_DRAW_RECT));
- m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel());
- bReturn = m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), FmFormInventor, m_aStartPos);
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ m_aStartPos = m_pWin->GetInverseViewTransformation() * aPixelPos;
+
+ bReturn = m_pSh->BeginCreate(m_pWin->getSdrObjectCreationInfo(), m_aStartPos);
if (bReturn)
m_pWin->SetDrawAction(sal_True);
@@ -110,9 +112,11 @@ sal_Bool ConstFormControl::MouseButtonDown(const MouseEvent& rMEvt)
void ConstFormControl::Activate(const sal_uInt16 nSlotId)
{
- m_pWin->SetSdrDrawMode( static_cast<SdrObjKind>(nSlotId) );
+ const SdrObjectCreationInfo aSdrObjectCreationInfo(nSlotId);
+
+ m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
SwDrawBase::Activate(nSlotId);
- m_pSh->GetDrawView()->SetCurrentObj(nSlotId);
+ m_pSh->GetDrawView()->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
m_pWin->SetPointer(Pointer(POINTER_DRAW_RECT));
}
@@ -121,19 +125,17 @@ void ConstFormControl::Activate(const sal_uInt16 nSlotId)
---------------------------------------------------------------------------*/
void ConstFormControl::CreateDefaultObject()
{
- Point aStartPos(GetDefaultCenterPos());
- Point aEndPos(aStartPos);
- aStartPos.X() -= 2 * MM50;
- aStartPos.Y() -= MM50;
- aEndPos.X() += 2 * MM50;
- aEndPos.Y() += MM50;
+ const basegfx::B2DPoint aCenterPos(GetDefaultCenterPos().X(), GetDefaultCenterPos().Y());
+ const basegfx::B2DPoint aStartPos(aCenterPos - basegfx::B2DPoint(2.0 * MM50, MM50));
+ const basegfx::B2DPoint aEndPos(aCenterPos + basegfx::B2DPoint(2.0 * MM50, MM50));
if(!m_pSh->HasDrawView())
m_pSh->MakeDrawView();
SdrView *pSdrView = m_pSh->GetDrawView();
- pSdrView->SetDesignMode(sal_True);
- m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), FmFormInventor, aStartPos);
+ pSdrView->SetDesignMode(true);
+
+ m_pSh->BeginCreate(m_pWin->getSdrObjectCreationInfo(), aStartPos);
m_pSh->MoveCreate(aEndPos);
m_pSh->EndCreate(SDRCREATE_FORCEEND);
}
diff --git a/sw/source/ui/ribbar/conpoly.cxx b/sw/source/ui/ribbar/conpoly.cxx
index e5667d865537..74dfe052440a 100644
--- a/sw/source/ui/ribbar/conpoly.cxx
+++ b/sw/source/ui/ribbar/conpoly.cxx
@@ -24,8 +24,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <svx/svdmark.hxx>
#include <svx/svdview.hxx>
#include <svx/svdopath.hxx>
@@ -98,8 +96,9 @@ sal_Bool ConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
if (m_pSh->IsDrawCreate())
{
- if (rMEvt.IsLeft() && rMEvt.GetClicks() == 1 &&
- m_pWin->GetSdrDrawMode() != OBJ_FREELINE)
+ if (rMEvt.IsLeft()
+ && rMEvt.GetClicks() == 1
+ && !(OBJ_POLY == m_pWin->getSdrObjectCreationInfo().getIdent() && m_pWin->getSdrObjectCreationInfo().getFreehandMode()))
{
if (!m_pSh->EndCreate(SDRCREATE_NEXTPOINT))
{
@@ -112,10 +111,6 @@ sal_Bool ConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
{
Point aPnt(m_pWin->PixelToLogic(rMEvt.GetPosPixel()));
bReturn = SwDrawBase::MouseButtonUp(rMEvt);
-
- // #i85045# removed double mechanism to check for AutoClose polygon
- // after construction; the method here did not check for already closed and
- // also worked only for a single polygon. Removing.
}
}
else
@@ -134,24 +129,36 @@ sal_Bool ConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
void ConstPolygon::Activate(const sal_uInt16 nSlotId)
{
+ SdrObjectCreationInfo aSdrObjectCreationInfo;
+ bool bSet(false);
+
switch (nSlotId)
{
case SID_DRAW_POLYGON_NOFILL:
- m_pWin->SetSdrDrawMode(OBJ_PLIN);
+ aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenPolygon);
break;
case SID_DRAW_BEZIER_NOFILL:
- m_pWin->SetSdrDrawMode(OBJ_PATHLINE);
+ aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenBezier);
break;
case SID_DRAW_FREELINE_NOFILL:
- m_pWin->SetSdrDrawMode(OBJ_FREELINE);
+ aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_OpenBezier);
+ aSdrObjectCreationInfo.setFreehandMode(true);
break;
default:
break;
}
+ if(bSet)
+ {
+ m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
+ }
+
SwDrawBase::Activate(nSlotId);
}
diff --git a/sw/source/ui/ribbar/conrect.cxx b/sw/source/ui/ribbar/conrect.cxx
index a06f865955a5..c38aeb33a4bd 100644
--- a/sw/source/ui/ribbar/conrect.cxx
+++ b/sw/source/ui/ribbar/conrect.cxx
@@ -27,9 +27,7 @@
#include <sfx2/bindings.hxx>
#include <svx/htmlmode.hxx>
-#include <svx/sdtacitm.hxx>
#include <svx/svdobj.hxx>
-#include <svx/sdtagitm.hxx>
#include <svx/sdtakitm.hxx>
#include <svx/sdtaditm.hxx>
#include <svx/sdtaaitm.hxx>
@@ -70,14 +68,13 @@ sal_Bool ConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
{
sal_Bool bReturn;
- if ((bReturn = SwDrawBase::MouseButtonDown(rMEvt)) == sal_True
- && m_pWin->GetSdrDrawMode() == OBJ_CAPTION)
+ if ((bReturn = SwDrawBase::MouseButtonDown(rMEvt)) == sal_True && OBJ_CAPTION == m_pWin->getSdrObjectCreationInfo().getIdent())
{
m_pView->NoRotate();
if (m_pView->IsDrawSelMode())
{
m_pView->FlipDrawSelMode();
- m_pSh->GetDrawView()->SetFrameDragSingles(m_pView->IsDrawSelMode());
+ m_pSh->GetDrawView()->SetFrameHandles(m_pView->IsDrawSelMode());
}
}
return (bReturn);
@@ -97,10 +94,9 @@ sal_Bool ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
if( bRet )
{
SdrView *pSdrView = m_pSh->GetDrawView();
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- SdrObject* pObj = rMarkList.GetMark(0) ? rMarkList.GetMark(0)->GetMarkedSdrObj()
- : 0;
- switch( m_pWin->GetSdrDrawMode() )
+ SdrObject* pObj = pSdrView->getSelectedIfSingle();
+
+ switch( m_pWin->getSdrObjectCreationInfo().getIdent() )
{
case OBJ_TEXT:
if( bMarquee )
@@ -110,39 +106,43 @@ sal_Bool ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
if( pObj )
{
// die fuer das Scrollen benoetigten Attribute setzen
- SfxItemSet aItemSet( pSdrView->GetModel()->GetItemPool(),
+ SfxItemSet aItemSet( pObj->GetObjectItemPool(),
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
- aItemSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
- aItemSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, false) );
+ aItemSet.Put( SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false) );
aItemSet.Put( SdrTextAniKindItem( SDRTEXTANI_SCROLL ) );
aItemSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
- aItemSet.Put( SdrTextAniCountItem( 0 ) );
+ aItemSet.Put( SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, 0 ) );
aItemSet.Put( SdrTextAniAmountItem(
(sal_Int16)m_pWin->PixelToLogic(Size(2,1)).Width()) );
pObj->SetMergedItemSetAndBroadcast(aItemSet);
}
}
- else if(mbVertical && pObj && pObj->ISA(SdrTextObj))
+ else if(mbVertical)
+ {
+ SdrTextObj* pText = dynamic_cast< SdrTextObj* >(pObj);
+
+ if(pText)
{
// #93382#
- SdrTextObj* pText = (SdrTextObj*)pObj;
- SfxItemSet aSet(pSdrView->GetModel()->GetItemPool());
+ SfxItemSet aSet(pText->GetObjectItemPool());
- pText->SetVerticalWriting(sal_True);
+ pText->SetVerticalWriting(true);
- aSet.Put(SdrTextAutoGrowWidthItem(sal_True));
- aSet.Put(SdrTextAutoGrowHeightItem(sal_False));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
+ aSet.Put(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, false));
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
pText->SetMergedItemSet(aSet);
}
+ }
+
if( pObj )
{
- SdrPageView* pPV = pSdrView->GetSdrPageView();
- m_pView->BeginTextEdit( pObj, pPV, m_pWin, sal_True );
+ m_pView->BeginTextEdit( pObj, m_pWin, sal_True );
}
m_pView->LeaveDrawCreate(); // In Selektionsmode wechseln
m_pSh->GetView().GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW);
@@ -176,48 +176,50 @@ void ConstRectangle::Activate(const sal_uInt16 nSlotId)
{
bMarquee = bCapVertical = sal_False;
mbVertical = sal_False;
+ SdrObjectCreationInfo aSdrObjectCreationInfo;
switch (nSlotId)
{
case SID_DRAW_LINE:
- m_pWin->SetSdrDrawMode(OBJ_LINE);
+ aSdrObjectCreationInfo.setIdent(OBJ_POLY);
+ aSdrObjectCreationInfo.setSdrPathObjType(PathType_Line);
break;
case SID_DRAW_RECT:
- m_pWin->SetSdrDrawMode(OBJ_RECT);
+ aSdrObjectCreationInfo.setIdent(OBJ_RECT);
break;
case SID_DRAW_ELLIPSE:
- m_pWin->SetSdrDrawMode(OBJ_CIRC);
+ aSdrObjectCreationInfo.setIdent(OBJ_CIRC);
break;
case SID_DRAW_TEXT_MARQUEE:
bMarquee = sal_True;
- m_pWin->SetSdrDrawMode(OBJ_TEXT);
+ aSdrObjectCreationInfo.setIdent(OBJ_TEXT);
break;
case SID_DRAW_TEXT_VERTICAL:
// #93382#
mbVertical = sal_True;
- m_pWin->SetSdrDrawMode(OBJ_TEXT);
+ aSdrObjectCreationInfo.setIdent(OBJ_TEXT);
break;
case SID_DRAW_TEXT:
- m_pWin->SetSdrDrawMode(OBJ_TEXT);
+ aSdrObjectCreationInfo.setIdent(OBJ_TEXT);
break;
case SID_DRAW_CAPTION_VERTICAL:
bCapVertical = sal_True;
// no break
case SID_DRAW_CAPTION:
- m_pWin->SetSdrDrawMode(OBJ_CAPTION);
+ aSdrObjectCreationInfo.setIdent(OBJ_CAPTION);
break;
default:
- m_pWin->SetSdrDrawMode(OBJ_NONE);
break;
}
+ m_pWin->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
SwDrawBase::Activate(nSlotId);
}
diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx
index 02be6a6c309a..e70e026608e7 100644
--- a/sw/source/ui/ribbar/drawbase.cxx
+++ b/sw/source/ui/ribbar/drawbase.cxx
@@ -80,7 +80,7 @@ SwDrawBase::SwDrawBase(SwWrtShell* pSwWrtShell, SwEditWin* pWindow, SwView* pSwV
__EXPORT SwDrawBase::~SwDrawBase()
{
if (m_pView->GetWrtShellPtr()) // Im view-Dtor koennte die wrtsh bereits geloescht worden sein...
- m_pSh->GetDrawView()->SetEditMode(sal_True);
+ m_pSh->GetDrawView()->SetViewEditMode(SDREDITMODE_EDIT);
}
/*************************************************************************
@@ -96,9 +96,7 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
SdrView *pSdrView = m_pSh->GetDrawView();
- // #i33136#
- // pSdrView->SetOrtho(rMEvt.IsShift());
- pSdrView->SetOrtho(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift());
+ pSdrView->SetOrthogonal(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift());
pSdrView->SetAngleSnapEnabled(rMEvt.IsShift());
if (rMEvt.IsMod2())
@@ -123,9 +121,10 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
bNoInterrupt = sal_True;
m_pWin->CaptureMouse();
- m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ m_aStartPos = m_pWin->GetInverseViewTransformation() * aPixelPos;
- bReturn = m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), m_aStartPos);
+ bReturn = m_pSh->BeginCreate(m_pWin->getSdrObjectCreationInfo(), m_aStartPos);
SetDrawPointer();
@@ -138,16 +137,17 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
* BEZIER-EDITOR
**********************************************************************/
m_pWin->CaptureMouse();
- m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel());
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ m_aStartPos = m_pWin->GetInverseViewTransformation() * aPixelPos;
sal_uInt16 nEditMode = m_pWin->GetBezierMode();
- if (eHit == SDRHIT_HANDLE && aVEvt.pHdl->GetKind() == HDL_BWGT)
+ if (eHit == SDRHIT_HANDLE && aVEvt.mpHdl->GetKind() == HDL_BWGT)
{
/******************************************************************
* Handle draggen
******************************************************************/
bNoInterrupt = sal_True;
- bReturn = pSdrView->BegDragObj(m_aStartPos, (OutputDevice*) NULL, aVEvt.pHdl);
+ bReturn = pSdrView->BegDragObj(m_aStartPos, aVEvt.mpHdl);
m_pWin->SetDrawAction(sal_True);
}
else if (eHit == SDRHIT_MARKEDOBJECT && nEditMode == SID_BEZIER_INSERT)
@@ -165,7 +165,7 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
* Klebepunkt selektieren
******************************************************************/
if (!rMEvt.IsShift())
- pSdrView->UnmarkAllPoints();
+ pSdrView->MarkPoints(0, true); // unmarkall
bReturn = pSdrView->BegMarkPoints(m_aStartPos);
m_pWin->SetDrawAction(sal_True);
@@ -182,20 +182,20 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
/******************************************************************
* Klebepunkt selektieren
******************************************************************/
- if (pSdrView->HasMarkablePoints() && (!pSdrView->IsPointMarked(*aVEvt.pHdl) || rMEvt.IsShift()))
+ if (pSdrView->HasMarkablePoints() && (!pSdrView->IsPointMarked(*aVEvt.mpHdl) || rMEvt.IsShift()))
{
SdrHdl* pHdl = NULL;
if (!rMEvt.IsShift())
{
- pSdrView->UnmarkAllPoints();
+ pSdrView->MarkPoints(0, true); // unmarkall
pHdl = pSdrView->PickHandle(m_aStartPos);
}
else
{
- if (pSdrView->IsPointMarked(*aVEvt.pHdl))
+ if (pSdrView->IsPointMarked(*aVEvt.mpHdl))
{
- bReturn = pSdrView->UnmarkPoint(*aVEvt.pHdl);
+ bReturn = pSdrView->MarkPoint(*(const_cast< SdrHdl* >(aVEvt.mpHdl)), true); // unmark
pHdl = NULL;
}
else
@@ -208,7 +208,7 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
{
bNoInterrupt = sal_True;
pSdrView->MarkPoint(*pHdl);
-// bReturn = pSdrView->BegDragObj(m_aStartPos, (OutputDevice*) NULL, pHdl);
+// bReturn = pSdrView->BegDragObj(m_aStartPos, pHdl);
// m_pWin->SetDrawAction(sal_True);
}
}
@@ -221,7 +221,7 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
if (m_pSh->IsObjSelectable(m_aStartPos) && eHit == SDRHIT_UNMARKEDOBJECT)
{
if (pSdrView->HasMarkablePoints())
- pSdrView->UnmarkAllPoints();
+ pSdrView->MarkPoints(0, true); // unmarkall
bNoInterrupt = sal_False;
// Drag im edtwin verwenden
@@ -240,12 +240,12 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
// cursor into the visible area
sal_Bool bUnlockView = !m_pSh->IsViewLocked();
m_pSh->LockView( sal_True ); //lock visible section
- m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); // Alles deselektieren
+ m_pSh->SelectObj(basegfx::B2DPoint(LONG_MAX, LONG_MAX)); // Alles deselektieren
if( bUnlockView )
m_pSh->LockView( sal_False );
}
else
- pSdrView->UnmarkAllPoints();
+ pSdrView->MarkPoints(0, true); // unmarkall
}
}
if (!m_pSh->IsSelFrmMode())
@@ -271,14 +271,14 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
sal_Bool SwDrawBase::MouseMove(const MouseEvent& rMEvt)
{
SdrView *pSdrView = m_pSh->GetDrawView();
- Point aPnt(m_pWin->PixelToLogic(rMEvt.GetPosPixel()));
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aPnt(m_pWin->GetInverseViewTransformation() * aPixelPos);
sal_Bool bRet = sal_False;
- if (IsCreateObj() && !m_pWin->IsDrawSelMode() && pSdrView->IsCreateObj())
+ if (IsCreateObj() && !m_pWin->IsDrawSelMode() && pSdrView->GetCreateObj())
{
// #i33136#
- // pSdrView->SetOrtho(rMEvt.IsShift());
- pSdrView->SetOrtho(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift());
+ pSdrView->SetOrthogonal(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift());
pSdrView->SetAngleSnapEnabled(rMEvt.IsShift());
m_pSh->MoveCreate(aPnt);
@@ -306,23 +306,24 @@ sal_Bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
sal_Bool bCheckShell = sal_False;
sal_Bool bAutoCap = sal_False;
- Point aPnt(m_pWin->PixelToLogic(rMEvt.GetPosPixel()));
+ const basegfx::B2DPoint aPixelPos(rMEvt.GetPosPixel().X(), rMEvt.GetPosPixel().Y());
+ const basegfx::B2DPoint aPnt(m_pWin->GetInverseViewTransformation() * aPixelPos);
if (IsCreateObj() && m_pSh->IsDrawCreate() && !m_pWin->IsDrawSelMode())
{
- const SdrObjKind nDrawMode = m_pWin->GetSdrDrawMode();
+ const SdrObjectCreationInfo& rSdrObjectCreationInfo = m_pWin->getSdrObjectCreationInfo();
+
//objects with multiple point may end at the start position
- sal_Bool bMultiPoint = OBJ_PLIN == nDrawMode ||
- OBJ_PATHLINE == nDrawMode ||
- OBJ_FREELINE == nDrawMode;
- if(rMEvt.IsRight() || (aPnt == m_aStartPos && !bMultiPoint))
+ const bool bMultiPoint(OBJ_POLY == rSdrObjectCreationInfo.getIdent() && PathType_Line != rSdrObjectCreationInfo.getSdrPathObjType());
+
+ if(rMEvt.IsRight() || (aPnt.equal(m_aStartPos) && !bMultiPoint))
{
m_pSh->BreakCreate();
m_pView->LeaveDrawCreate();
}
else
{
- if (OBJ_NONE == nDrawMode)
+ if(OBJ_NONE == rSdrObjectCreationInfo.getIdent())
{
SwRewriter aRewriter;
@@ -331,7 +332,8 @@ sal_Bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
}
m_pSh->EndCreate(SDRCREATE_FORCEEND);
- if (OBJ_NONE == nDrawMode) // Textrahmen eingefuegt
+
+ if(OBJ_NONE == rSdrObjectCreationInfo.getIdent()) // Textrahmen eingefuegt
{
uno::Reference< frame::XDispatchRecorder > xRecorder =
m_pSh->GetView().GetViewFrame()->GetBindings().GetRecorder();
@@ -359,7 +361,8 @@ sal_Bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
m_pSh->SetFlyFrmAttr( aSet );
}
}
- if (m_pWin->GetSdrDrawMode() == OBJ_NONE)
+
+ if(OBJ_NONE == m_pWin->getSdrObjectCreationInfo().getIdent())
{
m_pSh->EndUndo();
}
@@ -385,7 +388,7 @@ sal_Bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
m_pWin->SetDrawAction(sal_False);
- if (aPnt == m_aStartPos && m_pSh->IsObjSelectable(aPnt))
+ if (aPnt.equal(m_aStartPos) && m_pSh->IsObjSelectable(aPnt))
{
m_pSh->SelectObj(aPnt, ( rMEvt.IsShift() &&
m_pSh->IsSelFrmMode()) ? SW_ADD_SELECT : 0);
@@ -438,14 +441,14 @@ sal_Bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
}
m_pWin->SetDrawAction(sal_False);
- if (aPnt == m_aStartPos)
+ if (aPnt.equal(m_aStartPos))
{
if (!m_pSh->IsObjSelectable(aPnt))
- m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX));
+ m_pSh->SelectObj(basegfx::B2DPoint(LONG_MAX, LONG_MAX));
else if (!bReturn)
{
if (!rMEvt.IsShift())
- pSdrView->UnmarkAllPoints();
+ pSdrView->MarkPoints(0, true); // unmarkall
m_pSh->SelectObj(aPnt, (rMEvt.IsShift() &&
m_pSh->IsSelFrmMode()) ? SW_ADD_SELECT :0);
}
@@ -501,8 +504,8 @@ void SwDrawBase::Activate(const sal_uInt16 nSlot)
SetSlotId(nSlot);
SdrView *pSdrView = m_pSh->GetDrawView();
- pSdrView->SetCurrentObj( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()) );
- pSdrView->SetEditMode(sal_False);
+ pSdrView->setSdrObjectCreationInfo(m_pWin->getSdrObjectCreationInfo());
+ pSdrView->SetViewEditMode(SDREDITMODE_CREATE);
SetDrawPointer();
m_pSh->NoEdit();
@@ -518,8 +521,8 @@ void SwDrawBase::Activate(const sal_uInt16 nSlot)
void __EXPORT SwDrawBase::Deactivate()
{
SdrView *pSdrView = m_pSh->GetDrawView();
- pSdrView->SetOrtho(sal_False);
- pSdrView->SetAngleSnapEnabled(sal_False);
+ pSdrView->SetOrthogonal(false);
+ pSdrView->SetAngleSnapEnabled(false);
if (m_pWin->IsDrawAction() && m_pSh->IsDrawCreate())
m_pSh->BreakCreate();
@@ -529,9 +532,6 @@ void __EXPORT SwDrawBase::Deactivate()
m_pWin->ReleaseMouse();
bNoInterrupt = sal_False;
-// if(!m_pSh->IsObjSelected())
-// m_pSh->Edit();
-
if(m_pWin->GetApplyTemplate())
m_pWin->SetApplyTemplate(SwApplyTemplate());
m_pSh->GetView().GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW);
@@ -582,40 +582,35 @@ sal_Bool SwDrawBase::KeyInput(const KeyEvent& rKEvt)
if (!pSdrView->IsTextEdit())
{
- long nX = 0;
- long nY = 0;
+ basegfx::B2DVector aMove(0.0, 0.0);
if (nCode == KEY_UP)
{
// Scroll nach oben
- nX = 0;
- nY =-1;
+ aMove.setY(-1.0);
}
else if (nCode == KEY_DOWN)
{
// Scroll nach unten
- nX = 0;
- nY = 1;
+ aMove.setY(1.0);
}
else if (nCode == KEY_LEFT)
{
// Scroll nach links
- nX =-1;
- nY = 0;
+ aMove.setY(-1.0);
+ aMove.setX(-1.0);
}
else if (nCode == KEY_RIGHT)
{
// Scroll nach rechts
- nX = 1;
- nY = 0;
+ aMove.setX(1.0);
}
- if (pSdrView->AreObjectsMarked() && rKEvt.GetKeyCode().IsMod2())
+ if (pSdrView->areSdrObjectsSelected() && rKEvt.GetKeyCode().IsMod2())
{
// Objekte verschieben
- nX *= 100;
- nY *= 100;
- pSdrView->MoveAllMarked(Size(nX, nY));
+ aMove *= 100.0;
+ pSdrView->MoveMarkedObj(aMove);
}
bReturn = sal_True;
@@ -657,12 +652,10 @@ void SwDrawBase::BreakCreate()
void SwDrawBase::SetDrawPointer()
{
- SdrView *pSdrView = m_pSh->GetDrawView();
- Point aPnt(m_pWin->OutputToScreenPixel(m_pWin->GetPointerPosPixel()));
- aPnt = m_pWin->PixelToLogic(m_pWin->ScreenToOutputPixel(aPnt));
- const Pointer aPointTyp = pSdrView->GetPreferedPointer(aPnt, m_pSh->GetOut());
- const Pointer aDrawPt(aPointTyp);
- m_pWin->SetPointer(aDrawPt);
+ /// TTTT: ScreenToOutputPixel/OutputToScreenPixel needed ?!?
+ const Point aPnt(m_pWin->PixelToLogic(m_pWin->ScreenToOutputPixel(m_pWin->OutputToScreenPixel(m_pWin->GetPointerPosPixel()))));
+
+ m_pWin->SetPointer(m_pSh->GetDrawView()->GetPreferedPointer(basegfx::B2DPoint(aPnt.X(), aPnt.Y()), m_pSh->GetOut()));
}
/*************************************************************************
@@ -710,7 +703,7 @@ void SwDrawBase::CreateDefaultObject()
aEndPos.X() += 8 * MM50;
aEndPos.Y() += 4 * MM50;
Rectangle aRect(aStartPos, aEndPos);
- m_pSh->CreateDefaultShape( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), aRect, m_nSlotId);
+ m_pSh->CreateDefaultShape(m_pWin->getSdrObjectCreationInfo(), aRect, m_nSlotId);
}
/* -----------------25.10.2002 14:14-----------------
*
diff --git a/sw/source/ui/ribbar/dselect.cxx b/sw/source/ui/ribbar/dselect.cxx
index 15f2fbb4a25e..87d197549ee1 100644
--- a/sw/source/ui/ribbar/dselect.cxx
+++ b/sw/source/ui/ribbar/dselect.cxx
@@ -88,7 +88,7 @@ sal_Bool DrawSelection::KeyInput(const KeyEvent& rKEvt)
void DrawSelection::Activate(const sal_uInt16 nSlotId)
{
- m_pWin->SetSdrDrawMode(OBJ_NONE);
+ m_pWin->setSdrObjectCreationInfo(SdrObjectCreationInfo());
m_pWin->SetObjectSelect( sal_True );
SwDrawBase::Activate(nSlotId);
diff --git a/sw/source/ui/ribbar/tbxanchr.cxx b/sw/source/ui/ribbar/tbxanchr.cxx
index a8aa35444f0c..46b9355c0c8a 100644
--- a/sw/source/ui/ribbar/tbxanchr.cxx
+++ b/sw/source/ui/ribbar/tbxanchr.cxx
@@ -82,7 +82,7 @@ void SwTbxAnchor::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const
if( eState == SFX_ITEM_AVAILABLE )
{
- const SfxUInt16Item* pItem = PTR_CAST( SfxUInt16Item, pState );
+ const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >( pState );
if(pItem)
nActAnchorId = pItem->GetValue();
}
@@ -123,8 +123,7 @@ void SwTbxAnchor::Click()
SwView* pActiveView = 0;
if(pViewFrame)
{
- const TypeId aTypeId = TYPE(SwView);
- SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
+ SwView* pView = (SwView*)SfxViewShell::GetFirst( _IsSfxViewShell< SwView > );
while( pView )
{
if(pView->GetViewFrame() == pViewFrame)
@@ -132,7 +131,7 @@ void SwTbxAnchor::Click()
pActiveView = pView;
break;
}
- pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
+ pView = (SwView*)SfxViewShell::GetNext(*pView, _IsSfxViewShell< SwView > );
}
}
if(!pActiveView)
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index b20c06b88b86..6f626ec31f19 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -129,7 +129,7 @@ void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/,
if( eState == SFX_ITEM_AVAILABLE )
{
- const SfxImageItem* pItem = PTR_CAST( SfxImageItem, pState );
+ const SfxImageItem* pItem = dynamic_cast< const SfxImageItem* >( pState );
if(pItem)
{
nLastSlotId = pItem->GetValue();
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index d9c8a247bd70..1d9653a4651d 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -144,8 +144,6 @@ SFX_IMPL_INTERFACE(SwAnnotationShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT))
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_ANNOTATION_POPUPMENU));
}
-TYPEINIT1(SwAnnotationShell,SfxShell)
-
SwAnnotationShell::SwAnnotationShell( SwView& r )
: rView(r)
{
@@ -314,7 +312,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
- if (pFieldItem && pFieldItem->GetField()->ISA(SvxURLField))
+ if (pFieldItem && dynamic_cast< const SvxURLField* >(pFieldItem->GetField()))
{
// Feld selektieren, so dass es beim Insert geloescht wird
ESelection aSel = pOLV->GetSelection();
@@ -434,7 +432,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
{
/* mod
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( pView));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
*/
SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
@@ -472,7 +470,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
{
/* mod todo ???
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( pView));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
*/
SfxItemSet aDlgAttr(GetPool(),
@@ -838,7 +836,7 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq)
sal_uLong nFormat = 0;
const SfxPoolItem* pItem;
if ( rReq.GetArgs() && rReq.GetArgs()->GetItemState(nSlot, sal_True, &pItem) == SFX_ITEM_SET &&
- pItem->ISA(SfxUInt32Item) )
+ dynamic_cast< const SfxUInt32Item* >(pItem) )
{
nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
}
@@ -960,13 +958,13 @@ void SwAnnotationShell::StateInsert(SfxItemSet &rSet)
if (pFieldItem)
{
- const SvxFieldData* pField = pFieldItem->GetField();
+ const SvxURLField* pField = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
- if (pField->ISA(SvxURLField))
+ if (pField)
{
- aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
- aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
- aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
+ aHLinkItem.SetName(pField->GetRepresentation());
+ aHLinkItem.SetURL(pField->GetURL());
+ aHLinkItem.SetTargetFrame(pField->GetTargetFrame());
}
}
else
@@ -1014,7 +1012,7 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
break;
case FN_DELETE_NOTE_AUTHOR:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot );
if ( pItem )
pPostItMgr->Delete( pItem->GetValue() );
break;
@@ -1035,7 +1033,7 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
break;
case FN_HIDE_NOTE_AUTHOR:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot, sal_False);
+ SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot );
if ( pItem )
pPostItMgr->Hide( pItem->GetValue() );
}
@@ -1131,7 +1129,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
case SID_THES:
{
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -1559,7 +1557,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
sSym = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast< const SfxStringItem* >( pFtItem );
if ( pFontItem )
sFontName = pFontItem->GetValue();
}
@@ -1603,8 +1601,8 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
sal_uInt16 nResult = pDlg->Execute();
if( nResult == RET_OK )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT );
if ( pFontItem )
{
aFont.SetName( pFontItem->GetFamilyName() );
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 713b22370ae8..e5fe63662a3f 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -155,8 +155,6 @@ SFX_IMPL_INTERFACE(SwBaseShell, SfxShell, SW_RES(0))
SFX_CHILDWINDOW_REGISTRATION(SvxContourDlgChildWindow::GetChildWindowId());
}
-TYPEINIT1(SwBaseShell,SfxShell)
-
/*--------------------------------------------------------------------
Beschreibung: statics
--------------------------------------------------------------------*/
@@ -1172,7 +1170,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
if( pArgs != NULL
&& pArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET
&& pItem != NULL
- && pItem->ISA( SfxBoolItem ) )
+ && dynamic_cast< const SfxBoolItem* >(pItem) )
{
sal_Bool bDesignMode =
static_cast<const SfxBoolItem*>( pItem )->GetValue();
@@ -1605,7 +1603,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
case FN_TOOL_ANKER_AT_CHAR:
case FN_TOOL_ANKER_FRAME:
{
- sal_Bool bObj = 0 != rSh.IsObjSelected();
+ sal_Bool bObj(rSh.IsObjSelected());
sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
if( !bParentCntProt && (bObj || rSh.IsFrmSelected()))
@@ -1678,7 +1676,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
case FN_FRAME_WRAP_LEFT:
case FN_FRAME_WRAP_RIGHT:
{
- sal_Bool bObj = 0 != rSh.IsObjSelected();
+ sal_Bool bObj(rSh.IsObjSelected());
sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
if( !bParentCntProt && (bObj || rSh.IsFrmSelected()))
@@ -1867,7 +1865,7 @@ void SwBaseShell::StateStyle( SfxItemSet &rSet )
void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
{
SwWrtShell &rSh = GetShell();
- sal_Bool bObj = 0 != rSh.IsObjSelected();
+ sal_Bool bObj(rSh.IsObjSelected());
if( bObj || rSh.IsFrmSelected())
{
SfxItemSet aSet(GetPool(), RES_OPAQUE, RES_SURROUND);
@@ -2195,13 +2193,15 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet )
if(RES_CHRATR_FONT == nWhich)
{
Font aFont;
- if(pI && pI->ISA(SvxFontItem))
+ const SvxFontItem* pSvxFontItem = dynamic_cast< const SvxFontItem* >(pI);
+
+ if(pSvxFontItem)
{
- aFont.SetName( ((const SvxFontItem*)pI)->GetFamilyName());
- aFont.SetStyleName(((const SvxFontItem*)pI)->GetStyleName());
- aFont.SetFamily(((const SvxFontItem*)pI)->GetFamily());
- aFont.SetPitch(((const SvxFontItem*)pI)->GetPitch());
- aFont.SetCharSet(((const SvxFontItem*)pI)->GetCharSet());
+ aFont.SetName( pSvxFontItem->GetFamilyName());
+ aFont.SetStyleName(pSvxFontItem->GetStyleName());
+ aFont.SetFamily(pSvxFontItem->GetFamily());
+ aFont.SetPitch(pSvxFontItem->GetPitch());
+ aFont.SetCharSet(pSvxFontItem->GetCharSet());
}
sal_Bool bVertical = rSh.IsInVerticalText();
@@ -2664,11 +2664,11 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
if( pArgs && pArgs->Count() >= 2 )
{
- SFX_REQUEST_ARG( _rRequest, pName, SfxStringItem, FN_INSERT_TABLE, sal_False );
- SFX_REQUEST_ARG( _rRequest, pCols, SfxUInt16Item, SID_ATTR_TABLE_COLUMN, sal_False );
- SFX_REQUEST_ARG( _rRequest, pRows, SfxUInt16Item, SID_ATTR_TABLE_ROW, sal_False );
- SFX_REQUEST_ARG( _rRequest, pFlags, SfxInt32Item, FN_PARAM_1, sal_False );
- SFX_REQUEST_ARG( _rRequest, pAuto, SfxStringItem, FN_PARAM_2, sal_False );
+ SFX_REQUEST_ARG( _rRequest, pName, SfxStringItem, FN_INSERT_TABLE );
+ SFX_REQUEST_ARG( _rRequest, pCols, SfxUInt16Item, SID_ATTR_TABLE_COLUMN );
+ SFX_REQUEST_ARG( _rRequest, pRows, SfxUInt16Item, SID_ATTR_TABLE_ROW );
+ SFX_REQUEST_ARG( _rRequest, pFlags, SfxInt32Item, FN_PARAM_1 );
+ SFX_REQUEST_ARG( _rRequest, pAuto, SfxStringItem, FN_PARAM_2 );
if ( pName )
aTableName = pName->GetValue();
diff --git a/sw/source/ui/shells/beziersh.cxx b/sw/source/ui/shells/beziersh.cxx
index b4f639232a3b..5e09a0b988e5 100644
--- a/sw/source/ui/shells/beziersh.cxx
+++ b/sw/source/ui/shells/beziersh.cxx
@@ -57,8 +57,6 @@ SFX_IMPL_INTERFACE(SwBezierShell, SwBaseShell, SW_RES(STR_SHELLNAME_BEZIER))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_BEZIER_TOOLBOX));
}
-TYPEINIT1(SwBezierShell,SwBaseShell)
-
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
@@ -86,8 +84,8 @@ void SwBezierShell::Execute(SfxRequest &rReq)
SdrView* pSdrView = pSh->GetDrawView();
const SfxItemSet *pArgs = rReq.GetArgs();
sal_uInt16 nSlotId = rReq.GetSlot();
- sal_Bool bChanged = pSdrView->GetModel()->IsChanged();
- pSdrView->GetModel()->SetChanged(sal_False);
+ bool bChanged = pSdrView->getSdrModelFromSdrView().IsChanged();
+ pSdrView->getSdrModelFromSdrView().SetChanged(false);
const SfxPoolItem* pItem;
if(pArgs)
pArgs->GetItemState(nSlotId, sal_False, &pItem);
@@ -115,7 +113,7 @@ void SwBezierShell::Execute(SfxRequest &rReq)
case FN_ESCAPE:
if (pSdrView->HasMarkedPoints())
- pSdrView->UnmarkAllPoints();
+ pSdrView->MarkPoints(0, true); // unmarkall
else
{
if ( pSh->IsDrawCreate() )
@@ -155,9 +153,7 @@ void SwBezierShell::Execute(SfxRequest &rReq)
case SID_BEZIER_CLOSE:
case SID_BEZIER_ELIMINATE_POINTS:
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
-
- if (rMarkList.GetMark(0) && !pSdrView->IsAction())
+ if (pSdrView->areSdrObjectsSelected() && !pSdrView->IsAction())
{
switch (nSlotId)
{
@@ -210,10 +206,13 @@ void SwBezierShell::Execute(SfxRequest &rReq)
case SID_BEZIER_CLOSE:
{
- SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj();
- pSdrView->UnmarkAllPoints();
- // Size aDist(GetView().GetEditWin().PixelToLogic(Size(8,8)));
- pPathObj->ToggleClosed(); // aDist.Width());
+ SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >(pSdrView->getSelectedIfSingle());
+
+ if(pPathObj)
+ {
+ pSdrView->MarkPoints(0, true); // unmarkall
+ pPathObj->ToggleClosed();
+ }
break;
}
@@ -229,10 +228,10 @@ void SwBezierShell::Execute(SfxRequest &rReq)
break;
}
- if (pSdrView->GetModel()->IsChanged())
+ if (pSdrView->getSdrModelFromSdrView().IsChanged())
GetShell().SetModified();
else if (bChanged)
- pSdrView->GetModel()->SetChanged(sal_True);
+ pSdrView->getSdrModelFromSdrView().SetChanged(true);
}
/*--------------------------------------------------------------------
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index fa190755b778..47c433ee6fa9 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -60,11 +60,10 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
{
SwWrtShell* pSh = &GetShell();
SdrView* pView = pSh->GetDrawView();
- SdrModel* pDoc = pView->GetModel();
- sal_Bool bChanged = pDoc->IsChanged();
- pDoc->SetChanged(sal_False);
+ bool bChanged = pView->getSdrModelFromSdrView().IsChanged();
+ pView->getSdrModelFromSdrView().SetChanged(false);
- SfxItemSet aNewAttr( pDoc->GetItemPool() );
+ SfxItemSet aNewAttr( pView->getSdrModelFromSdrView().GetItemPool() );
pView->GetAttributes( aNewAttr );
GetView().NoRotate();
@@ -81,7 +80,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
if (nResult == RET_OK)
{
- if (pView->AreObjectsMarked())
+ if (pView->areSdrObjectsSelected())
{
pSh->StartAction();
pView->SetAttributes(*pDlg->GetOutputItemSet());
@@ -97,14 +96,12 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
case SID_ATTRIBUTES_AREA:
{
- sal_Bool bHasMarked = pView->AreObjectsMarked();
+ sal_Bool bHasMarked = pView->areSdrObjectsSelected();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( NULL,
- &aNewAttr,
- pDoc,
- pView);
+ &aNewAttr, &pView->getSdrModelFromSdrView(), pView);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
const SvxColorTableItem* pColorItem = (const SvxColorTableItem*)
GetView().GetDocShell()->GetItem(SID_COLOR_TABLE);
@@ -134,20 +131,13 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
case SID_ATTRIBUTES_LINE:
{
- sal_Bool bHasMarked = pView->AreObjectsMarked();
-
- const SdrObject* pObj = NULL;
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ sal_Bool bHasMarked = pView->areSdrObjectsSelected();
+ const SdrObject* pObj = pView->getSelectedIfSingle();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( NULL,
- &aNewAttr,
- pDoc,
- pObj,
- bHasMarked);
+ &aNewAttr, &pView->getSdrModelFromSdrView(), pObj, bHasMarked);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if (pDlg->Execute() == RET_OK)
{
@@ -175,11 +165,11 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
}
- if (pDoc->IsChanged())
+ if (pView->getSdrModelFromSdrView().IsChanged())
GetShell().SetModified();
else
if (bChanged)
- pDoc->SetChanged(sal_True);
+ pView->getSdrModelFromSdrView().SetChanged(true);
}
/*--------------------------------------------------------------------
@@ -192,14 +182,14 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest& rReq)
SwWrtShell* pSh = &GetShell();
SdrView* pView = pSh->GetDrawView();
const SfxItemSet* pArgs = rReq.GetArgs();
- sal_Bool bChanged = pView->GetModel()->IsChanged();
- pView->GetModel()->SetChanged(sal_False);
+ bool bChanged = pView->getSdrModelFromSdrView().IsChanged();
+ pView->getSdrModelFromSdrView().SetChanged(false);
GetView().NoRotate();
if (pArgs)
{
- if(pView->AreObjectsMarked())
+ if(pView->areSdrObjectsSelected())
pView->SetAttrToMarked(*rReq.GetArgs(), sal_False);
else
pView->SetDefaultAttr(*rReq.GetArgs(), sal_False);
@@ -224,11 +214,11 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest& rReq)
break;
}
}
- if (pView->GetModel()->IsChanged())
+ if (pView->getSdrModelFromSdrView().IsChanged())
GetShell().SetModified();
else
if (bChanged)
- pView->GetModel()->SetChanged(sal_True);
+ pView->getSdrModelFromSdrView().SetChanged(true);
}
/*--------------------------------------------------------------------
@@ -240,7 +230,7 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
{
SdrView* pSdrView = GetShell().GetDrawView();
- if (pSdrView->AreObjectsMarked())
+ if (pSdrView->areSdrObjectsSelected())
{
sal_Bool bDisable = Disable( rSet );
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index a320e72cbe56..e97af6bae6a0 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -77,8 +77,6 @@ SFX_IMPL_INTERFACE(SwDrawShell, SwDrawBaseShell, SW_RES(STR_SHELLNAME_DRAW))
SFX_CHILDWINDOW_REGISTRATION(SvxFontWorkChildWindow::GetChildWindowId());
}
-TYPEINIT1(SwDrawShell,SwDrawBaseShell)
-
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
@@ -91,9 +89,9 @@ void SwDrawShell::Execute(SfxRequest &rReq)
const SfxItemSet *pArgs = rReq.GetArgs();
SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
sal_uInt16 nSlotId = rReq.GetSlot();
- sal_Bool bChanged = pSdrView->GetModel()->IsChanged();
+ bool bChanged = pSdrView->getSdrModelFromSdrView().IsChanged();
- pSdrView->GetModel()->SetChanged(sal_False);
+ pSdrView->getSdrModelFromSdrView().SetChanged(false);
const SfxPoolItem* pItem;
if(pArgs)
@@ -122,7 +120,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
GetView().FlipDrawRotate();
}
GetView().FlipDrawSelMode();
- pSdrView->SetFrameDragSingles(GetView().IsDrawSelMode());
+ pSdrView->SetFrameHandles(GetView().IsDrawSelMode());
GetView().AttrChangedNotify(&rSh); // Shellwechsel...
break;
@@ -177,7 +175,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
case SID_FONTWORK:
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &rSh.GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxViewFrame* pVFrame = GetView().GetViewFrame();
if (pArgs)
@@ -288,10 +286,10 @@ void SwDrawShell::Execute(SfxRequest &rReq)
DBG_ASSERT(!this, "falscher Dispatcher");
return;
}
- if (pSdrView->GetModel()->IsChanged())
+ if (pSdrView->getSdrModelFromSdrView().IsChanged())
rSh.SetModified();
else if (bChanged)
- pSdrView->GetModel()->SetChanged(sal_True);
+ pSdrView->getSdrModelFromSdrView().SetChanged(true);
}
/*--------------------------------------------------------------------
@@ -398,12 +396,11 @@ void SwDrawShell::ExecFormText(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
SdrView* pDrView = rSh.GetDrawView();
- sal_Bool bChanged = pDrView->GetModel()->IsChanged();
- pDrView->GetModel()->SetChanged(sal_False);
-
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
+ bool bChanged = pDrView->getSdrModelFromSdrView().IsChanged();
+ pDrView->getSdrModelFromSdrView().SetChanged(false);
+ SdrObject* pSingleSelected = pDrView->getSelectedIfSingle();
- if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() )
+ if ( pSingleSelected && rReq.GetArgs() )
{
const SfxItemSet& rSet = *rReq.GetArgs();
const SfxPoolItem* pItem;
@@ -424,8 +421,8 @@ void SwDrawShell::ExecFormText(SfxRequest& rReq)
SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*)(GetView().GetViewFrame()->
GetChildWindow(nId)->GetWindow());
- pDlg->CreateStdFormObj(*pDrView, *pDrView->GetSdrPageView(),
- rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
+ pDlg->CreateStdFormObj(*pDrView,
+ rSet, *pSingleSelected,
((const XFormTextStdFormItem*) pItem)->
GetValue());
@@ -433,11 +430,11 @@ void SwDrawShell::ExecFormText(SfxRequest& rReq)
else
pDrView->SetAttributes(rSet);
}
- if (pDrView->GetModel()->IsChanged())
+ if (pDrView->getSdrModelFromSdrView().IsChanged())
rSh.SetModified();
else
if (bChanged)
- pDrView->GetModel()->SetChanged(sal_True);
+ pDrView->getSdrModelFromSdrView().SetChanged(true);
}
/*************************************************************************
@@ -452,20 +449,15 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
SdrView* pDrView = rSh.GetDrawView();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- const SdrObject* pObj = NULL;
+ const SdrObject* pObj = pDrView->getSelectedIfSingle();
SvxFontWorkDialog* pDlg = NULL;
-
const sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
SfxViewFrame* pVFrame = GetView().GetViewFrame();
if ( pVFrame->HasChildWindow(nId) )
pDlg = (SvxFontWorkDialog*)(pVFrame->GetChildWindow(nId)->GetWindow());
- if ( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
+ if ( pObj == NULL || !dynamic_cast< const SdrTextObj* >(pObj) ||
!((SdrTextObj*) pObj)->HasText() )
{
#define XATTR_ANZ 12
diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx
index 5e73121bf3be..16908f565858 100644
--- a/sw/source/ui/shells/drformsh.cxx
+++ b/sw/source/ui/shells/drformsh.cxx
@@ -73,10 +73,6 @@ SFX_IMPL_INTERFACE(SwDrawFormShell, SwDrawBaseShell, SW_RES(STR_SHELLNAME_DRAWFO
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TEXT_TOOLBOX));
}
-
-TYPEINIT1(SwDrawFormShell, SwDrawBaseShell)
-
-
void SwDrawFormShell::Execute(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -95,10 +91,10 @@ void SwDrawFormShell::Execute(SfxRequest &rReq)
const SvxHyperlinkItem& rHLinkItem = *(const SvxHyperlinkItem *)pItem;
bool bConvertToText = rHLinkItem.GetInsertMode() == HLINK_DEFAULT ||
rHLinkItem.GetInsertMode() == HLINK_FIELD;
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if (rMarkList.GetMark(0))
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >(pSdrView->getSelectedIfSingle());
+
+ if (pUnoCtrl)
{
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
if(bConvertToText)
@@ -183,11 +179,11 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet)
case SID_HYPERLINK_GETLINK:
{
SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >(pSdrView->getSelectedIfSingle());
SvxHyperlinkItem aHLinkItem;
- if (rMarkList.GetMark(0))
+
+ if (pUnoCtrl)
{
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index c3cd2c3de007..7cef3e782d59 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -72,6 +72,7 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include <IDocumentDrawModelAccess.hxx>
+#include <svx/fmmodel.hxx>
using namespace ::com::sun::star;
@@ -79,8 +80,6 @@ SFX_IMPL_INTERFACE(SwDrawBaseShell, SwBaseShell, SW_RES(0))
{
}
-TYPEINIT1(SwDrawBaseShell,SwBaseShell)
-
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
@@ -124,8 +123,8 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
SdrView* pSdrView = pSh->GetDrawView();
const SfxItemSet *pArgs = rReq.GetArgs();
sal_uInt16 nSlotId = rReq.GetSlot();
- sal_Bool bChanged = pSdrView->GetModel()->IsChanged();
- pSdrView->GetModel()->SetChanged(sal_False);
+ bool bChanged = pSdrView->getSdrModelFromSdrView().IsChanged();
+ pSdrView->getSdrModelFromSdrView().SetChanged(false);
const SfxPoolItem* pItem = 0;
if(pArgs)
pArgs->GetItemState(nSlotId, sal_False, &pItem);
@@ -133,7 +132,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
//Sonderfall Align per Menue
if(pItem && nSlotId == SID_OBJECT_ALIGN)
{
- DBG_ASSERT(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem erwartet");
+ DBG_ASSERT(dynamic_cast< const SfxEnumItem* >( pItem),"SfxEnumItem erwartet");
nSlotId = nSlotId + ((const SfxEnumItem*)pItem)->GetValue();
nSlotId++;
}
@@ -149,12 +148,11 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
{
case FN_DRAW_WRAP_DLG:
{
- if(pSdrView->AreObjectsMarked())
+ if(pSdrView->areSdrObjectsSelected())
{
if(!pArgs)
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if( rMarkList.GetMark(0) != 0 )
+ if(pSdrView->areSdrObjectsSelected())
{
SfxItemSet aSet(GetPool(), RES_SURROUND, RES_SURROUND,
RES_ANCHOR, RES_ANCHOR,
@@ -199,14 +197,15 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
case SID_ATTR_TRANSFORM:
{
- if(pSdrView->AreObjectsMarked())
+ if(pSdrView->areSdrObjectsSelected())
{
if(!pArgs)
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if( rMarkList.GetMark(0) != 0 )
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+ SdrObject* pObj = aSelection[0];
+
+ if( pObj )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
SfxAbstractTabDialog *pDlg=NULL;
sal_Bool bCaption = sal_False;
@@ -306,7 +305,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
SfxItemSet aFrmAttrSet(GetPool(), RES_FRMATR_BEGIN, RES_FRMATR_END - 1);
- bool bSingleSelection = rMarkList.GetMarkCount() == 1;
+ const bool bSingleSelection(1 == aSelection.size());
const SfxPoolItem* pAnchorItem;
if(SFX_ITEM_SET == pOutSet->GetItemState(
@@ -425,7 +424,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
break;
case SID_GROUP:
- if (pSh->IsObjSelected() > 1 && pSh->IsGroupAllowed())
+ if (pSh->GetNumberOfSelectedObjects() > 1 && pSh->IsGroupAllowed())
{
pSh->GroupSelection(); // Objekt gruppieren
rBind.Invalidate(SID_UNGROUP);
@@ -466,10 +465,11 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
{
if ( bAlignPossible )
{
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 && bAlignPossible )
- { // Objekte nicht aneinander ausrichten
+ SdrObject* pObj = pSdrView->getSelectedIfSingle();
+ if( pObj )
+ {
+ // Objekte nicht aneinander ausrichten
sal_uInt16 nAnchor = pSh->GetAnchorId();
if (nAnchor == FLY_AS_CHAR)
{
@@ -492,7 +492,6 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
if (nVertOrient != -1)
{
pSh->StartAction();
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
SwFrmFmt* pFrmFmt = FindFrmFmt( pObj );
SwFmtVertOrient aVOrient((SwFmtVertOrient&)pFrmFmt->GetFmtAttr(RES_VERT_ORIENT));
aVOrient.SetVertOrient( nVertOrient );
@@ -549,12 +548,11 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
case FN_NAME_SHAPE:
{
bDone = sal_True;
+ SdrObject* pSelected = pSdrView->getSelectedIfSingle();
- if(1L == pSdrView->GetMarkedObjectCount())
+ if(pSelected)
{
// #i68101#
- SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0L);
- OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
String aName(pSelected->GetName());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -581,11 +579,10 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
case FN_TITLE_DESCRIPTION_SHAPE:
{
bDone = sal_True;
+ SdrObject* pSelected = pSdrView->getSelectedIfSingle();
- if(1L == pSdrView->GetMarkedObjectCount())
+ if(pSelected)
{
- SdrObject* pSelected = pSdrView->GetMarkedObjectByIndex(0L);
- OSL_ENSURE(pSelected, "DrawViewShell::FuTemp03: nMarkCount, but no object (!)");
String aTitle(pSelected->GetTitle());
String aDescription(pSelected->GetDescription());
@@ -619,10 +616,10 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
{
if(nSlotId >= SID_OBJECT_ALIGN_LEFT && nSlotId <= SID_OBJECT_ALIGN_DOWN)
rBind.Invalidate(SID_ATTR_LONG_LRSPACE);
- if (pSdrView->GetModel()->IsChanged())
+ if (pSdrView->getSdrModelFromSdrView().IsChanged())
pSh->SetModified();
else if (bChanged)
- pSdrView->GetModel()->SetChanged(sal_True);
+ pSdrView->getSdrModelFromSdrView().SetChanged(true);
// 40220: Nach dem Loeschen von DrawObjekten ueber die API GPF durch Selbstzerstoerung
if(bNotify)
GetView().AttrChangedNotify(pSh); // ggf Shellwechsel...
@@ -635,9 +632,8 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
{
SwWrtShell &rSh = GetShell();
SdrView *pSdrView = rSh.GetDrawView();
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- DBG_ASSERT(rMarkList.GetMarkCount() == 1, "wrong draw selection");
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ SdrObject* pObj = pSdrView->getSelectedIfSingle();
+ OSL_ENSURE(pObj, "wrong draw selection");
const String sCurrentName = pObj->GetName();
String sNewName;
pNameDialog->GetName(sNewName);
@@ -655,7 +651,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
// for( sal_uInt32 i=0; i< nCount; i++ )
// {
// SdrObject* pTemp = pPage->GetObj(i);
-// if(pObj != pTemp && pTemp->ISA(SdrObjGroup) && pTemp->GetName() == sNewName)
+// if(pObj != pTemp && dynamic_cast< SdrObjGroup* >(pTemp) && pTemp->GetName() == sNewName)
// {
// nRet = 0;
// break;
@@ -705,7 +701,7 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( nWhich );
break;
case SID_GROUP:
- if ( rSh.IsObjSelected() < 2 || bProtected || !rSh.IsGroupAllowed() )
+ if ( rSh.GetNumberOfSelectedObjects() < 2 || bProtected || !rSh.IsGroupAllowed() )
rSet.DisableItem( nWhich );
break;
case SID_UNGROUP:
@@ -732,10 +728,9 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet)
else
{
SfxAllEnumItem aEnumItem(nWhich, USHRT_MAX);
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
//if only one object is selected it can only be vertically
// aligned because it is character bound
- if( rMarkList.GetMarkCount() == 1 )
+ if( pSdrView->getSelectedIfSingle() )
{
aEnumItem.DisableValue(SID_OBJECT_ALIGN_LEFT);
aEnumItem.DisableValue(SID_OBJECT_ALIGN_CENTER);
@@ -747,7 +742,9 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet)
case FN_NAME_SHAPE :
{
- if(1L != pSdrView->GetMarkedObjectCount())
+ const SdrObject* pSelected = pSdrView->getSelectedIfSingle();
+
+ if(!pSelected)
{
rSet.DisableItem( nWhich );
}
@@ -758,8 +755,9 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet)
case FN_TITLE_DESCRIPTION_SHAPE:
{
const bool bIsWebView(NULL != dynamic_cast<SwWebView*>(&GetView()));
+ const SdrObject* pSelected = pSdrView->getSelectedIfSingle();
- if(!bIsWebView && 1L != pSdrView->GetMarkedObjectCount())
+ if(!bIsWebView && !pSelected)
{
rSet.DisableItem( nWhich );
}
@@ -814,10 +812,10 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation
const RndStdIds eAnchorType = static_cast<RndStdIds >(pValidation->nAnchorType);
const SwPosition* pCntntPos = 0;
SdrView* pSdrView = pSh->GetDrawView();
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if( rMarkList.GetMarkCount() == 1 )
+ SdrObject* pObj = pSdrView->getSelectedIfSingle();
+
+ if( pObj )
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
SwFrmFmt* pFrmFmt = FindFrmFmt( pObj );
pCntntPos = pFrmFmt->GetAnchor().GetCntntAnchor();
}
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index b4a713f72e3e..e672fb78fa2e 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -170,7 +170,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
case SID_THES:
{
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -303,7 +303,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( pView));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
@@ -398,7 +398,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
if (!pArgs)
{
SwView* pView = &GetView();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( pView));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxItemSet aDlgAttr(GetPool(),
EE_ITEMS_START, EE_ITEMS_END,
@@ -471,7 +471,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
- if (pFieldItem && pFieldItem->GetField()->ISA(SvxURLField))
+ if (pFieldItem && dynamic_cast< const SvxURLField* >(pFieldItem->GetField()))
{
// Feld selektieren, so dass es beim Insert geloescht wird
ESelection aSel = pOLV->GetSelection();
@@ -487,8 +487,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
// Shellwechsel!
{
- SdrObject* pTmpObj = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- SdrPageView* pTmpPV = pSdrView->GetSdrPageView();
+ SdrObject* pTmpObj = pSdrView->getSelectedIfSingle();
SdrView* pTmpView = pSdrView;
pSdrView->SdrEndTextEdit(sal_True);
@@ -503,7 +502,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
: text::WritingMode_TB_RL, SDRATTR_TEXTDIRECTION ) );
pTmpView->SetAttributes( aAttr );
- rSh.GetView().BeginTextEdit( pTmpObj, pTmpPV, &rSh.GetView().GetEditWin(), sal_False);
+ rSh.GetView().BeginTextEdit( pTmpObj, &rSh.GetView().GetEditWin(), sal_False);
rSh.GetView().AttrChangedNotify( &rSh );
}
return;
@@ -511,8 +510,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
case SID_ATTR_PARA_LEFT_TO_RIGHT:
case SID_ATTR_PARA_RIGHT_TO_LEFT:
{
- SdrObject* pTmpObj = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- SdrPageView* pTmpPV = pSdrView->GetSdrPageView();
+ SdrObject* pTmpObj = pSdrView->getSelectedIfSingle();
SdrView* pTmpView = pSdrView;
pSdrView->SdrEndTextEdit(sal_True);
@@ -546,7 +544,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
aAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
}
pTmpView->SetAttributes( aAttr );
- rSh.GetView().BeginTextEdit( pTmpObj, pTmpPV, &rSh.GetView().GetEditWin(), sal_False );
+ rSh.GetView().BeginTextEdit( pTmpObj, &rSh.GetView().GetEditWin(), sal_False );
rSh.GetView().AttrChangedNotify( &rSh );
}
return;
@@ -977,13 +975,13 @@ void SwDrawTextShell::StateInsert(SfxItemSet &rSet)
if (pFieldItem)
{
- const SvxFieldData* pField = pFieldItem->GetField();
+ const SvxURLField* pField = dynamic_cast< const SvxURLField* >(pFieldItem->GetField());
- if (pField->ISA(SvxURLField))
+ if (pField )
{
- aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
- aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
- aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
+ aHLinkItem.SetName(pField->GetRepresentation());
+ aHLinkItem.SetURL(pField->GetURL());
+ aHLinkItem.SetTargetFrame(pField->GetTargetFrame());
}
}
else
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 0a6d601c30ba..66f30cd0a887 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -106,8 +106,6 @@ SFX_IMPL_INTERFACE(SwDrawTextShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT))
SFX_CHILDWINDOW_REGISTRATION(SvxFontWorkChildWindow::GetChildWindowId());
}
-TYPEINIT1(SwDrawTextShell,SfxShell)
-
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
@@ -249,7 +247,7 @@ sal_Bool SwDrawTextShell::IsTextEdit()
void SwDrawTextShell::ExecFontWork(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &rSh.GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
SfxViewFrame* pVFrame = GetView().GetViewFrame();
if ( rReq.GetArgs() )
@@ -288,10 +286,9 @@ void SwDrawTextShell::ExecFormText(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
SdrView* pDrView = rSh.GetDrawView();
+ SdrObject* pSingleSelected = pDrView->getSelectedIfSingle();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
-
- if ( rMarkList.GetMarkCount() == 1 && rReq.GetArgs() )
+ if ( pSingleSelected && rReq.GetArgs() )
{
const SfxItemSet& rSet = *rReq.GetArgs();
const SfxPoolItem* pItem;
@@ -317,8 +314,8 @@ void SwDrawTextShell::ExecFormText(SfxRequest& rReq)
SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*)(
pVFrame->GetChildWindow(nId)->GetWindow());
- pDlg->CreateStdFormObj(*pDrView, *pDrView->GetSdrPageView(),
- rSet, *rMarkList.GetMark(0)->GetMarkedSdrObj(),
+ pDlg->CreateStdFormObj(*pDrView,
+ rSet, *pSingleSelected,
((const XFormTextStdFormItem*) pItem)->
GetValue());
}
@@ -340,8 +337,7 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
SdrView* pDrView = rSh.GetDrawView();
- const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- const SdrObject* pObj = NULL;
+ const SdrObject* pObj = pDrView->getSelectedIfSingle();
SvxFontWorkDialog* pDlg = NULL;
const sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
@@ -350,10 +346,7 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
if ( pVFrame->HasChildWindow(nId) )
pDlg = (SvxFontWorkDialog*)(pVFrame->GetChildWindow(nId)->GetWindow());
- if ( rMarkList.GetMarkCount() == 1 )
- pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-
- if ( pObj == NULL || !pObj->ISA(SdrTextObj) ||
+ if ( pObj == NULL || !dynamic_cast< const SdrTextObj* >(pObj) ||
!((SdrTextObj*) pObj)->HasText() )
{
#define XATTR_ANZ 12
@@ -385,7 +378,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- if( rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() )
+ if( rSh.GetDrawView()->areSdrObjectsSelected() )
{
switch(rReq.GetSlot())
{
@@ -560,7 +553,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
break;
case FN_DRAWTEXT_ATTR_DLG:
{
- SfxItemSet aNewAttr( pSdrView->GetModel()->GetItemPool() );
+ SfxItemSet aNewAttr( pSdrView->getSdrModelFromSdrView().GetItemPool() );
pSdrView->GetAttributes( aNewAttr );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
@@ -572,7 +565,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
if (nResult == RET_OK)
{
- if (pSdrView->AreObjectsMarked())
+ if (pSdrView->areSdrObjectsSelected())
{
pSdrView->SetAttributes(*pDlg->GetOutputItemSet());
rReq.Done(*(pDlg->GetOutputItemSet()));
@@ -777,7 +770,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
sSym = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast< const SfxStringItem* >( pFtItem );
if ( pFontItem )
sFontName = pFontItem->GetValue();
}
@@ -819,8 +812,8 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
sal_uInt16 nResult = pDlg->Execute();
if( nResult == RET_OK )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT );
if ( pFontItem )
{
aFont.SetName( pFontItem->GetFamilyName() );
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 83e1be9ce32e..7b3dd5bb6fa5 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -453,7 +453,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
nDefPage = ((SfxUInt16Item *)pItem)->GetValue();
aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame()));
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) ));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
@@ -606,8 +606,9 @@ void SwFrameShell::Execute(SfxRequest &rReq)
{
bUpdateMgr = sal_False;
SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
- if ( pSdrView &&
- pSdrView->GetMarkedObjectCount() == 1 )
+ const SdrObject* pSelected = pSdrView ? pSdrView->getSelectedIfSingle() : 0;
+
+ if ( pSelected )
{
String aDescription(rSh.GetObjDescription());
String aTitle(rSh.GetObjTitle());
@@ -874,8 +875,9 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
{
SwWrtShell &rWrtSh = GetShell();
SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList();
- if ( !pSdrView ||
- pSdrView->GetMarkedObjectCount() != 1 )
+ const SdrObject* pSelected = pSdrView ? pSdrView->getSelectedIfSingle() : 0;
+
+ if ( !pSdrView || !pSelected )
{
rSet.DisableItem( nWhich );
}
diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx
index bfcfd109f5cc..2bd91838b3a2 100644
--- a/sw/source/ui/shells/grfshex.cxx
+++ b/sw/source/ui/shells/grfshex.cxx
@@ -58,6 +58,8 @@
#include <svl/stritem.hxx>
#include <avmedia/mediawindow.hxx>
#include <vcl/svapp.hxx>
+#include <doc.hxx>
+#include <svx/fmmodel.hxx>
// -> #111827#
#include <SwRewriter.hxx>
@@ -78,7 +80,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
if( pReqArgs )
{
- const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, &pReqArgs->Get( rReq.GetSlot() ) );
+ const SfxStringItem* pStringItem = dynamic_cast< const SfxStringItem* >( &pReqArgs->Get( rReq.GetSlot() ) );
if( pStringItem )
{
@@ -130,7 +132,11 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
else
aSize = Size( 2835, 2835 );
- SdrMediaObj* pObj = new SdrMediaObj( Rectangle( aPos, aSize ) );
+ SdrMediaObj* pObj = new SdrMediaObj(
+ *rSh.SwFEShell::GetDoc()->GetOrCreateDrawModel(),
+ basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aSize.getWidth(), aSize.getHeight(),
+ aPos.X(), aPos.Y()));
pObj->setURL( aURL );
rSh.EnterStdMode();
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index d2513992d042..b178666e004b 100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -118,7 +118,7 @@ namespace SwLangHelper
// get the language
String aNewLangTxt;
- SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_LANGUAGE_STATUS , sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_LANGUAGE_STATUS );
if (pItem)
aNewLangTxt = pItem->GetValue();
diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx
index 6173337f8550..58068080dd2d 100644
--- a/sw/source/ui/shells/listsh.cxx
+++ b/sw/source/ui/shells/listsh.cxx
@@ -69,8 +69,6 @@ SFX_IMPL_INTERFACE(SwListShell, SwBaseShell, SW_RES(STR_SHELLNAME_LIST))
}
-TYPEINIT1(SwListShell,SwBaseShell)
-
// --> FME 2005-01-04 #i35572# Functionality of Numbering/Bullet toolbar
// for outline numbered paragraphs should match the functions for outlines
// available in the navigator. Therefore the code in the following
diff --git a/sw/source/ui/shells/mediash.cxx b/sw/source/ui/shells/mediash.cxx
index 17077e860a03..a8b74ff2ff06 100644
--- a/sw/source/ui/shells/mediash.cxx
+++ b/sw/source/ui/shells/mediash.cxx
@@ -101,9 +101,9 @@ void SwMediaShell::ExecMedia(SfxRequest &rReq)
{
const SfxItemSet* pArgs = rReq.GetArgs();
sal_uInt16 nSlotId = rReq.GetSlot();
- sal_Bool bChanged = pSdrView->GetModel()->IsChanged();
+ bool bChanged = pSdrView->getSdrModelFromSdrView().IsChanged();
- pSdrView->GetModel()->SetChanged( sal_False );
+ pSdrView->getSdrModelFromSdrView().SetChanged(false);
switch( nSlotId )
{
@@ -133,20 +133,18 @@ void SwMediaShell::ExecMedia(SfxRequest &rReq)
if( pItem )
{
- SdrMarkList* pMarkList = new SdrMarkList( pSdrView->GetMarkedObjectList() );
+ const SdrObjectVector rSdrObjectVector = pSdrView->getSelectedSdrObjectVectorFromSdrMarkView();
- if( 1 == pMarkList->GetMarkCount() )
+ if( 1 == rSdrObjectVector.size() )
{
- SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
+ const SdrObject* pObj = rSdrObjectVector[0];
- if( pObj && pObj->ISA( SdrMediaObj ) )
+ if( pObj && dynamic_cast< const SdrMediaObj* >(pObj) )
{
static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem(
static_cast< const ::avmedia::MediaItem& >( *pItem ) );
}
}
-
- delete pMarkList;
}
}
}
@@ -156,10 +154,10 @@ void SwMediaShell::ExecMedia(SfxRequest &rReq)
break;
}
- if( pSdrView->GetModel()->IsChanged() )
+ if( pSdrView->getSdrModelFromSdrView().IsChanged() )
GetShell().SetModified();
else if( bChanged )
- pSdrView->GetModel()->SetChanged(sal_True);
+ pSdrView->getSdrModelFromSdrView().SetChanged(true);
}
}
@@ -180,13 +178,13 @@ void SwMediaShell::GetMediaState(SfxItemSet &rSet)
if( pView )
{
- SdrMarkList* pMarkList = new SdrMarkList( pView->GetMarkedObjectList() );
+ const SdrObjectVector rSdrObjectVector = pView->getSelectedSdrObjectVectorFromSdrMarkView();
- if( 1 == pMarkList->GetMarkCount() )
+ if( 1 == rSdrObjectVector.size() )
{
- SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
+ const SdrObject* pObj = rSdrObjectVector[0];
- if( pObj && pObj->ISA( SdrMediaObj ) )
+ if( pObj && dynamic_cast< const SdrMediaObj* >(pObj) )
{
::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX );
@@ -198,8 +196,6 @@ void SwMediaShell::GetMediaState(SfxItemSet &rSet)
if( bDisable )
rSet.DisableItem( SID_AVMEDIA_TOOLBOX );
-
- delete pMarkList;
}
}
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index ce02f9ae4079..b7ac70e37ef4 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -126,8 +126,6 @@ SFX_IMPL_INTERFACE(SwTableShell, SwBaseShell, SW_RES(STR_SHELLNAME_TABLE))
}
-TYPEINIT1(SwTableShell,SwBaseShell)
-
/************************************************************************/
const sal_uInt16 __FAR_DATA aUITableAttrRange[] =
@@ -638,7 +636,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SfxBindings& rBindings = GetView().GetViewFrame()->GetBindings();
SfxItemSet aCoreSet( GetPool(), aUITableAttrRange);
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &rSh.GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SwTableRep* pTblRep = ::lcl_TableParamToItemSet( aCoreSet, rSh );
SfxAbstractTabDialog * pDlg = NULL;
@@ -690,7 +688,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
SwView* pView = GetActiveView();
if(pView)
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( pView));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
SfxItemSet aCoreSet( GetPool(),
@@ -978,11 +976,11 @@ void SwTableShell::Execute(SfxRequest &rReq)
case FN_TABLE_SPLIT_CELLS:
{
long nCount=0;
- sal_Bool bHorizontal=sal_True;
- sal_Bool bProportional = sal_False;
- SFX_REQUEST_ARG( rReq, pSplit, SfxInt32Item, FN_TABLE_SPLIT_CELLS, sal_False );
- SFX_REQUEST_ARG( rReq, pHor, SfxBoolItem, FN_PARAM_1, sal_False );
- SFX_REQUEST_ARG( rReq, pProp, SfxBoolItem, FN_PARAM_2, sal_False );
+ bool bHorizontal(true);
+ bool bProportional(false);
+ SFX_REQUEST_ARG( rReq, pSplit, SfxInt32Item, FN_TABLE_SPLIT_CELLS );
+ SFX_REQUEST_ARG( rReq, pHor, SfxBoolItem, FN_PARAM_1 );
+ SFX_REQUEST_ARG( rReq, pProp, SfxBoolItem, FN_PARAM_2 );
if ( pSplit )
{
nCount = pSplit->GetValue();
@@ -1023,7 +1021,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
case FN_TABLE_SPLIT_TABLE:
{
- SFX_REQUEST_ARG( rReq, pType, SfxUInt16Item, FN_PARAM_1, sal_False );
+ SFX_REQUEST_ARG( rReq, pType, SfxUInt16Item, FN_PARAM_1 );
if( pType )
{
switch( pType->GetValue() )
diff --git a/sw/source/ui/shells/textdrw.cxx b/sw/source/ui/shells/textdrw.cxx
index ab69787e66b7..2495598097b4 100644
--- a/sw/source/ui/shells/textdrw.cxx
+++ b/sw/source/ui/shells/textdrw.cxx
@@ -65,27 +65,30 @@ void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, con
SdrView *pSdrView = rSh.GetDrawView();
// OBJ_FM_BUTTON
- pSdrView->SetDesignMode(sal_True);
- pSdrView->SetCurrentObj(OBJ_FM_BUTTON);
- pSdrView->SetEditMode(sal_False);
+ const SdrObjectCreationInfo aSdrObjectCreationInfo(OBJ_FM_BUTTON, FmFormInventor);
+ pSdrView->SetDesignMode(true);
+ pSdrView->setSdrObjectCreationInfo(aSdrObjectCreationInfo);
+ pSdrView->SetViewEditMode(SDREDITMODE_CREATE);
- Point aStartPos(rSh.GetCharRect().Pos() + Point(0, 1));
+ const basegfx::B2DPoint aStartPos(rSh.GetCharRect().Pos().X(), rSh.GetCharRect().Pos().Y() + 1.0);
rSh.StartAction();
rSh.StartUndo( UNDO_UI_INSERT_URLBTN );
- if (rSh.BeginCreate(OBJ_FM_BUTTON, FmFormInventor, aStartPos))
+
+ if (rSh.BeginCreate(aSdrObjectCreationInfo, aStartPos))
{
- pSdrView->SetOrtho(sal_False);
- Size aSz(GetView().GetEditWin().PixelToLogic(Size(140, 20)));
- Point aEndPos(aSz.Width(), aSz.Height());
+ pSdrView->SetOrthogonal(false);
+ const basegfx::B2DVector aObjSize(
+ GetView().GetEditWin().GetInverseViewTransformation() *
+ basegfx::B2DVector(140.0, 20.0));
- rSh.MoveCreate(aStartPos + aEndPos);
+ rSh.MoveCreate(aStartPos + aObjSize);
rSh.EndCreate(SDRCREATE_FORCEEND);
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- if (rMarkList.GetMark(0))
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >(pSdrView->getSelectedIfSingle());
+
+ if (pUnoCtrl)
{
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
ASSERT( xControlModel.is(), "UNO-Control ohne Model" );
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 915695dfe041..109059199589 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -323,7 +323,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
break;
case FN_DELETE_NOTE_AUTHOR:
{
- SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, sal_False);
+ SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot );
if ( pNoteItem && GetView().GetPostItMgr() )
GetView().GetPostItMgr()->Delete( pNoteItem->GetValue() );
}
@@ -341,7 +341,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
break;
case FN_HIDE_NOTE_AUTHOR:
{
- SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, sal_False);
+ SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot );
if ( pNoteItem && GetView().GetPostItMgr() )
GetView().GetPostItMgr()->Hide( pNoteItem->GetValue() );
}
@@ -507,8 +507,8 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if ( pItem )
{
aText = ((SfxStringItem*)pItem)->GetValue();
- SFX_REQUEST_ARG( rReq, pType, SfxStringItem, FN_PARAM_2 , sal_False );
- SFX_REQUEST_ARG( rReq, pIsUrl, SfxBoolItem, FN_PARAM_1 , sal_False );
+ SFX_REQUEST_ARG( rReq, pType, SfxStringItem, FN_PARAM_2 );
+ SFX_REQUEST_ARG( rReq, pIsUrl, SfxBoolItem, FN_PARAM_1 );
if ( pType )
aType = pType->GetValue();
if ( pIsUrl )
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index ae6cb9a0cdaa..23e75780f162 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -140,12 +140,6 @@ SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT))
SFX_CHILDWINDOW_REGISTRATION(SID_RUBY_DIALOG);
}
-
-
-TYPEINIT1(SwTextShell,SwBaseShell)
-
-
-
void SwTextShell::ExecInsert(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
@@ -270,7 +264,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
case SID_INSERT_OBJECT:
case SID_INSERT_PLUGIN:
{
- SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT );
SvGlobalName *pName = NULL;
SvGlobalName aName;
if ( pNameItem )
@@ -279,8 +273,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
pName = &aName;
}
- SFX_REQUEST_ARG( rReq, pClassLocationItem, SfxStringItem, FN_PARAM_2, sal_False );
- SFX_REQUEST_ARG( rReq, pCommandsItem, SfxStringItem, FN_PARAM_3, sal_False );
+ SFX_REQUEST_ARG( rReq, pClassLocationItem, SfxStringItem, FN_PARAM_2 );
+ SFX_REQUEST_ARG( rReq, pCommandsItem, SfxStringItem, FN_PARAM_3 );
//TODO/LATER: recording currently not working, need code for Commandlist
svt::EmbeddedObjectRef xObj;
if( nSlot == SID_INSERT_PLUGIN && ( pClassLocationItem || pCommandsItem ) )
@@ -341,11 +335,11 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
case SID_INSERT_FLOATINGFRAME:
{
svt::EmbeddedObjectRef xObj;
- SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, FN_PARAM_1, sal_False );
- SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, FN_PARAM_2, sal_False );
- SFX_REQUEST_ARG( rReq, pMarginItem, SvxSizeItem, FN_PARAM_3, sal_False );
- SFX_REQUEST_ARG( rReq, pScrollingItem, SfxByteItem, FN_PARAM_4, sal_False );
- SFX_REQUEST_ARG( rReq, pBorderItem, SfxBoolItem, FN_PARAM_5, sal_False );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, FN_PARAM_1 );
+ SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, FN_PARAM_2 );
+ SFX_REQUEST_ARG( rReq, pMarginItem, SvxSizeItem, FN_PARAM_3 );
+ SFX_REQUEST_ARG( rReq, pScrollingItem, SfxByteItem, FN_PARAM_4 );
+ SFX_REQUEST_ARG( rReq, pBorderItem, SfxBoolItem, FN_PARAM_5 );
if(pURLItem) // URL is a _must_
{
@@ -605,7 +599,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
aBoxInfo.SetDefDist(rBox.GetDistance(BOX_LINE_LEFT));
aSet.Put(aBoxInfo);
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, GetView().GetDocShell()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( GetView().GetDocShell()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
@@ -667,7 +661,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
if ( pItem )
{
sPath = ((SfxStringItem*)pItem)->GetValue();
- SFX_REQUEST_ARG( rReq, pSimple, SfxBoolItem, FN_PARAM_1 , sal_False );
+ SFX_REQUEST_ARG( rReq, pSimple, SfxBoolItem, FN_PARAM_1 );
if ( pSimple )
bSimpleLine = pSimple->GetValue();
}
@@ -1054,7 +1048,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
aChars = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
- const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ const SfxStringItem* pFontItem = dynamic_cast< const SfxStringItem* >( pFtItem );
if ( pFontItem )
aFontName = pFontItem->GetValue();
}
@@ -1101,8 +1095,8 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
if( RET_OK == pDlg->Execute() )
{
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, sal_False );
- SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT );
if ( pFontItem )
{
aNewFont.SetName( pFontItem->GetFamilyName() );
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 485e999e6e5a..43f4efb8c849 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -131,7 +131,7 @@ using namespace ::com::sun::star;
void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq )
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rWrtSh.GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &rWrtSh.GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
@@ -298,7 +298,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
// get the language
String aNewLangTxt;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_LANGUAGE_STATUS , sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_LANGUAGE_STATUS );
if (pItem2)
aNewLangTxt = pItem2->GetValue();
@@ -402,7 +402,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
// replace word/selection with text from selected sub menu entry
String aReplaceText;
- SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES , sal_False );
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES );
if (pItem2)
aReplaceText = pItem2->GetValue();
if (aReplaceText.Len() > 0)
@@ -424,9 +424,9 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_INSERT_ENDNOTE:
{
String aStr;
- SFX_REQUEST_ARG( rReq, pFont, SfxStringItem, FN_PARAM_1 , sal_False );
-// SFX_REQUEST_ARG( rReq, pCharset, SfxInt16Item, FN_PARAM_2 , sal_False );
- SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, nSlot , sal_False );
+ SFX_REQUEST_ARG( rReq, pFont, SfxStringItem, FN_PARAM_1 );
+// SFX_REQUEST_ARG( rReq, pCharset, SfxInt16Item, FN_PARAM_2 );
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, nSlot );
if ( pNameItem )
aStr = pNameItem->GetValue();
sal_Bool bFont = pFont && pFont->GetValue().Len();
@@ -532,8 +532,8 @@ void SwTextShell::Execute(SfxRequest &rReq)
if ( pItem )
{
nKind = ((SfxInt16Item*)pItem)->GetValue();
- SFX_REQUEST_ARG( rReq, pTemplate, SfxStringItem, FN_PARAM_1 , sal_False );
- SFX_REQUEST_ARG( rReq, pNumber, SfxUInt16Item, FN_PARAM_2 , sal_False );
+ SFX_REQUEST_ARG( rReq, pTemplate, SfxStringItem, FN_PARAM_1 );
+ SFX_REQUEST_ARG( rReq, pNumber, SfxUInt16Item, FN_PARAM_2 );
if ( pTemplate )
aTemplateName = pTemplate->GetValue();
if ( pNumber )
@@ -871,7 +871,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
case SID_PARA_DLG:
{
- FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
+ FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SfxItemSet aCoreSet( GetPool(),
RES_PARATR_BEGIN, RES_PARATR_END - 1,
diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx
index 13a44cac34a7..45462d65e7fd 100644
--- a/sw/source/ui/shells/txtnum.cxx
+++ b/sw/source/ui/shells/txtnum.cxx
@@ -54,7 +54,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
{
case FN_NUM_NUMBERING_ON:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FN_PARAM_1 , sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FN_PARAM_1 );
sal_Bool bMode = !GetShell().HasNumber(); // #i29560#
if ( pItem )
bMode = pItem->GetValue();
@@ -73,7 +73,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
break;
case FN_NUM_BULLET_ON:
{
- SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FN_PARAM_1 , sal_False );
+ SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FN_PARAM_1 );
sal_Bool bMode = !GetShell().HasBullet(); // #i29560#
if ( pItem )
bMode = pItem->GetValue();
@@ -101,7 +101,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
0 );
SwDocShell* pDocSh = GetView().GetDocShell();
- sal_Bool bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh);
+ sal_Bool bHtml = 0 != dynamic_cast< SwWebDocShell* >( pDocSh);
const SwNumRule* pCurRule = GetShell().GetCurNumRule();
if( pCurRule )
{
diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx
index 9ba670cd019d..d6514cdbcf0e 100644
--- a/sw/source/ui/table/colwd.cxx
+++ b/sw/source/ui/table/colwd.cxx
@@ -85,10 +85,9 @@ SwTableWidthDlg::SwTableWidthDlg(Window *pParent, SwTableFUNC &rTableFnc ) :
{
FreeResource();
- sal_Bool bIsWeb = rTableFnc.GetShell()
- ? static_cast< sal_Bool >(0 != PTR_CAST( SwWebDocShell,
- rTableFnc.GetShell()->GetView().GetDocShell()) )
- : sal_False;
+ bool bIsWeb = rTableFnc.GetShell()
+ ? dynamic_cast< SwWebDocShell* >( rTableFnc.GetShell()->GetView().GetDocShell())
+ : false;
FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( bIsWeb )->GetMetric();
::SetFieldUnit(aWidthEdit, eFieldUnit );
diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx
index 134e3bd79d40..9403bc030e6c 100644
--- a/sw/source/ui/table/rowht.cxx
+++ b/sw/source/ui/table/rowht.cxx
@@ -93,8 +93,7 @@ SwTableHeightDlg::SwTableHeightDlg( Window *pParent, SwWrtShell &rS ) :
{
FreeResource();
- FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( 0 != PTR_CAST( SwWebDocShell,
- rSh.GetView().GetDocShell() ) )->GetMetric();
+ FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( 0 != dynamic_cast< SwWebDocShell* >( rSh.GetView().GetDocShell() ) )->GetMetric();
::SetFieldUnit( aHeightEdit, eFieldUnit );
aHeightEdit.SetMin(MINLAY, FUNIT_TWIP);
diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx
index 25d91c5b1b87..0e3d0d735855 100644
--- a/sw/source/ui/table/tablemgr.cxx
+++ b/sw/source/ui/table/tablemgr.cxx
@@ -31,7 +31,6 @@
#include <sot/storage.hxx>
#include <sot/clsids.hxx>
-#include <svx/charthelper.hxx>
#include "edtwin.hxx"
#include "errhdl.hxx"
@@ -279,9 +278,6 @@ uno::Reference< frame::XModel > SwTableFUNC::InsertChart(
//DoVerb in der SfxViewShell
ErrCode nErr = pClient->DoVerb( SVVERB_SHOW );
(void) nErr;
-
- // #121334#
- ChartHelper::AdaptDefaultsForChart( xObj );
}
uno::Reference< chart2::data::XDataReceiver > xDataReceiver( xChartModel, uno::UNO_QUERY );
diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx
index 78e2fa2b305c..cef5e2dc9820 100644
--- a/sw/source/ui/uiview/formatclipboard.cxx
+++ b/sw/source/ui/uiview/formatclipboard.cxx
@@ -412,7 +412,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
if(pDrawView)
{
sal_Bool bOnlyHardAttr = sal_True;
- if( pDrawView->AreObjectsMarked() )
+ if( pDrawView->areSdrObjectsSelected() )
{
pItemSet = new SfxItemSet( pDrawView->GetAttrFromMarked(bOnlyHardAttr) );
//remove attributes defining the type/data of custom shapes
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 554f700c2296..b22d9c15ea3d 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -104,8 +104,6 @@ SFX_IMPL_INTERFACE(SwPagePreView, SfxViewShell, SW_RES(RID_PVIEW_TOOLBOX))
}
-TYPEINIT1(SwPagePreView,SfxViewShell)
-
#define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT|SFX_VIEW_HAS_PRINTOPTIONS )
#define MIN_PREVIEW_ZOOM 25
@@ -1326,11 +1324,11 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
ViewShell *pVS, *pNew;
- if( pOldSh && pOldSh->IsA( TYPE( SwPagePreView ) ) )
+ if( pOldSh && dynamic_cast< SwPagePreView* >(pOldSh) )
pVS = ((SwPagePreView*)pOldSh)->GetViewShell();
else
{
- if( pOldSh && pOldSh->IsA( TYPE( SwView ) ) )
+ if( pOldSh && dynamic_cast< SwView* >(pOldSh) )
{
pVS = ((SwView*)pOldSh)->GetWrtShellPtr();
// save the current ViewData of the previous SwView
@@ -1404,7 +1402,7 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
SwDocShell* SwPagePreView::GetDocShell()
{
- return PTR_CAST(SwDocShell, GetViewFrame()->GetObjectShell());
+ return dynamic_cast< SwDocShell* >( GetViewFrame()->GetObjectShell());
}
/*--------------------------------------------------------------------
@@ -1979,30 +1977,6 @@ Size SwPagePreView::GetOptimalSizePixel() const
{
ASSERT( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" )
return Size( -1, -1 );
-/*
- //JP 09.06.99: was wird hier errechnet ?????
-// ALT:
-// SfxApplicationWindow* pWin = SFX_APPWINDOW ;
-// Rectangle aRect = pWin->GetClientAreaPixel();
-
- Window& rWin = GetViewFrame()->GetWindow();
- Rectangle aRect( Point(0, 0), rWin.GetOutputSizePixel() );
- Size aMaxSize( aRect.GetWidth(), aRect.GetHeight() );
- Size aInSize = rWin.GetOutputSizePixel();
- Size aOutSize = rWin.GetSizePixel();
- sal_uInt16 nXBorder = sal_uInt16(aOutSize.Width() - aInSize.Width());
- sal_uInt16 nYBorder = sal_uInt16(aOutSize.Height() - aInSize.Height());
- aMaxSize.Width() -= nXBorder;
- //'auf Verdacht' etwas vom Border abziehen (Menue)
- nYBorder -= (nYBorder - nXBorder) / 2;
- aMaxSize.Height() -= nYBorder;
- //mit der max. moeglichen Outputsize guenstigstes Verhaeltnis ausrechnen
- aViewWin.GetOptimalSize(aMaxSize);
- // Border wieder dazuzaehlen
- aMaxSize.Height() += nYBorder;
- aMaxSize.Width() += nXBorder;
- return aMaxSize;
-*/
}
/*--------------------------------------------------------------------
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index 67daaecf7e3e..83e031543010 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -131,8 +131,6 @@ SFX_IMPL_INTERFACE( SwSrcView, SfxViewShell, SW_RES(0) )
SFX_CHILDWINDOW_REGISTRATION(SvxSearchDialogWrapper::GetChildWindowId());
}
-TYPEINIT1(SwSrcView, SfxViewShell)
-
/*-----------------18.11.96 08.05-------------------
--------------------------------------------------*/
@@ -255,7 +253,7 @@ SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) :
SwSrcView::~SwSrcView()
{
SwDocShell* pDocShell = GetDocShell();
- DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
+ DBG_ASSERT(dynamic_cast< SwWebDocShell* >( pDocShell), "Wieso keine WebDocShell?");
const TextSelection& rSel = aEditWin.GetTextView()->GetSelection();
((SwWebDocShell*)pDocShell)->SetSourcePara( static_cast< sal_uInt16 >( rSel.GetStart().GetPara() ) );
@@ -313,7 +311,7 @@ void SwSrcView::Init()
SwDocShell* SwSrcView::GetDocShell()
{
SfxObjectShell* pObjShell = GetViewFrame()->GetObjectShell();
- return PTR_CAST(SwDocShell, pObjShell);
+ return dynamic_cast< SwDocShell* >( pObjShell);
}
/*--------------------------------------------------------------------
@@ -835,15 +833,12 @@ sal_Int32 SwSrcView::PrintSource(
void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( rHint.ISA(SfxSimpleHint) &&
- (
- ((SfxSimpleHint&) rHint).GetId() == SFX_HINT_MODECHANGED ||
- (
- ((SfxSimpleHint&) rHint).GetId() == SFX_HINT_TITLECHANGED &&
- !GetDocShell()->IsReadOnly() && aEditWin.IsReadonly()
- )
- )
- )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint
+ && (pSfxSimpleHint->GetId() == SFX_HINT_MODECHANGED
+ || ( pSfxSimpleHint->GetId() == SFX_HINT_TITLECHANGED
+ && !GetDocShell()->IsReadOnly() && aEditWin.IsReadonly())))
{
// Broadcast kommt nur einmal!
const SwDocShell* pDocSh = GetDocShell();
@@ -941,7 +936,7 @@ void SwSrcView::Load(SwDocShell* pDocShell)
pDocShell->SetModified();// das Flag wird zwischendurch zurueckgesetzt
// AutoLoad abschalten
pDocShell->SetAutoLoad(INetURLObject(), 0, sal_False);
- DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?");
+ DBG_ASSERT(dynamic_cast< SwWebDocShell* >( pDocShell), "Wieso keine WebDocShell?");
sal_uInt16 nLine = ((SwWebDocShell*)pDocShell)->GetSourcePara();
aEditWin.SetStartLine(nLine);
aEditWin.GetTextEngine()->ResetUndo();
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index af451f4b7e9e..7d30dbd7a04d 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -195,7 +195,7 @@ void SwView::GotFocus() const
// the top then)
const SfxDispatcher& rDispatcher = const_cast< SwView* >( this )->GetDispatcher();
SfxShell* pTopShell = rDispatcher.GetShell( 0 );
- FmFormShell* pAsFormShell = PTR_CAST( FmFormShell, pTopShell );
+ FmFormShell* pAsFormShell = dynamic_cast< FmFormShell* >( pTopShell );
if ( pAsFormShell )
{
pAsFormShell->ForgetActiveControl();
@@ -203,7 +203,7 @@ void SwView::GotFocus() const
}
else if ( mpPostItMgr )
{
- SwAnnotationShell* pAsAnnotationShell = PTR_CAST( SwAnnotationShell, pTopShell );
+ SwAnnotationShell* pAsAnnotationShell = dynamic_cast< SwAnnotationShell* >( pTopShell );
if ( pAsAnnotationShell )
{
mpPostItMgr->SetActiveSidebarWin(0);
@@ -232,7 +232,7 @@ IMPL_LINK( SwView, FormControlActivated, FmFormShell*, EMPTYARG )
// of the dispatcher stack, then we need to activate it
const SfxDispatcher& rDispatcher = GetDispatcher();
const SfxShell* pTopShell = rDispatcher.GetShell( 0 );
- const FmFormShell* pAsFormShell = PTR_CAST( FmFormShell, pTopShell );
+ const FmFormShell* pAsFormShell = dynamic_cast< const FmFormShell* >( pTopShell );
if ( !pAsFormShell )
{
// if we're editing text currently, cancel this
@@ -300,16 +300,16 @@ void SwView::SelectShell()
for ( sal_uInt16 i = 0; sal_True; ++i )
{
pSfxShell = rDispatcher.GetShell( i );
- if ( pSfxShell->ISA( SwBaseShell )
- || pSfxShell->ISA( SwDrawTextShell )
- || pSfxShell->ISA( svx::ExtrusionBar )
- || pSfxShell->ISA( svx::FontworkBar )
- || pSfxShell->ISA( SwAnnotationShell )
+ if ( dynamic_cast< SwBaseShell* >(pSfxShell)
+ || dynamic_cast< SwDrawTextShell* >(pSfxShell)
+ || dynamic_cast< svx::ExtrusionBar* >(pSfxShell)
+ || dynamic_cast< svx::FontworkBar* >(pSfxShell)
+ || dynamic_cast< SwAnnotationShell* >(pSfxShell)
)
{
rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_DELETE );
}
- else if ( pSfxShell->ISA( FmFormShell ) )
+ else if ( dynamic_cast< FmFormShell* >(pSfxShell) )
{
rDispatcher.Pop( *pSfxShell );
}
@@ -466,7 +466,7 @@ void SwView::SelectShell()
SdrView* pDView = GetWrtShell().GetDrawView();
if ( bInitFormShell && pDView )
- pFormShell->SetView(PTR_CAST(FmFormView, pDView));
+ pFormShell->SetView(dynamic_cast< FmFormView* >( pDView));
}
//Guenstiger Zeitpunkt fuer die Kommunikation mit OLE-Objekten?
@@ -691,7 +691,7 @@ void SwView::_CheckReadonlySelection()
if( pWrtShell->HasReadonlySel() &&
( !pWrtShell->GetDrawView() ||
- !pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount() ))
+ !pWrtShell->GetDrawView()->areSdrObjectsSelected() ))
nDisableFlags |= SW_DISABLE_ON_PROTECTED_CURSOR;
if( (SW_DISABLE_ON_PROTECTED_CURSOR & nDisableFlags ) !=
@@ -811,12 +811,12 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
aTimer.SetTimeout( 120 );
- SwDocShell* pDocSh = PTR_CAST( SwDocShell, _pFrame->GetObjectShell() );
+ SwDocShell* pDocSh = dynamic_cast< SwDocShell* >( _pFrame->GetObjectShell() );
sal_Bool bOldModifyFlag = pDocSh->IsEnableSetModified();
if(bOldModifyFlag)
pDocSh->EnableSetModified( sal_False );
ASSERT( pDocSh, "View ohne DocShell." );
- SwWebDocShell* pWebDShell = PTR_CAST( SwWebDocShell, pDocSh );
+ SwWebDocShell* pWebDShell = dynamic_cast< SwWebDocShell* >( pDocSh );
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != pWebDShell);
SwViewOption aUsrPref( *pUsrPref);
@@ -835,20 +835,24 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
{
pExistingSh = pOldSh;
// determine type of existing view
- if( pExistingSh->IsA( TYPE( SwPagePreView ) ) )
+ SwPagePreView* pSwPagePreView = dynamic_cast< SwPagePreView* >(pExistingSh);
+
+ if( pSwPagePreView )
{
- sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData();
- sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
- nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
+ sSwViewData = pSwPagePreView->GetPrevSwViewData();
+ sNewCrsrPos = pSwPagePreView->GetNewCrsrPos();
+ nNewPage = pSwPagePreView->GetNewPage();
bOldShellWasPagePreView = sal_True;
- bIsPreviewDoubleClick = sNewCrsrPos.Len() > 0 || nNewPage != USHRT_MAX;
+ bIsPreviewDoubleClick = sNewCrsrPos.Len() > 0 || nNewPage != USHRT_MAX; // TTTT: Check for sal_uInt32
}
- else if( pExistingSh->IsA( TYPE( SwSrcView ) ) )
+ else if( dynamic_cast< SwSrcView* >(pExistingSh) )
+ {
bOldShellWasSrcView = sal_True;
}
+ }
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create WrtShell" );
- if(PTR_CAST( SwView, pExistingSh))
+ if(dynamic_cast< SwView* >( pExistingSh))
{
pWrtShell = new SwWrtShell( *((SwView*)pExistingSh)->pWrtShell,
pEditWin, *this);
@@ -1029,8 +1033,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
bNoInterrupt = bOld;
// wird ein GlobalDoc neu angelegt, soll auch der Navigator erzeugt werden
- if( pDocSh->IsA(SwGlobalDocShell::StaticType()) &&
- !pVFrame->GetChildWindow( SID_NAVIGATOR ))
+ if( dynamic_cast< SwGlobalDocShell* >(pDocSh) && !pVFrame->GetChildWindow( SID_NAVIGATOR ))
{
SfxBoolItem aNavi(SID_NAVIGATOR, sal_True);
GetDispatcher().Execute(SID_NAVIGATOR, SFX_CALLMODE_ASYNCHRON, &aNavi, 0L);
@@ -1112,7 +1115,7 @@ SwView::~SwView()
SwDocShell* SwView::GetDocShell()
{
SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell();
- return PTR_CAST(SwDocShell, pDocShell);
+ return dynamic_cast< SwDocShell* >( pDocShell);
}
/*--------------------------------------------------------------------
@@ -1564,7 +1567,7 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe
-void SwView::ShowCursor( FASTBOOL bOn )
+void SwView::ShowCursor( bool bOn )
{
//JP 10.10.2001: Bug 90461 - don't scroll the cursor into the visible area
sal_Bool bUnlockView = !pWrtShell->IsViewLocked();
@@ -1649,9 +1652,11 @@ SwGlossaryHdl* SwView::GetGlosHdl()
void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
sal_Bool bCallBase = sal_True;
- if ( rHint.ISA(SfxSimpleHint) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if ( pSfxSimpleHint )
{
- sal_uInt32 nId = ((SfxSimpleHint&)rHint).GetId();
+ sal_uInt32 nId = pSfxSimpleHint->GetId();
switch ( nId )
{
// --> OD 2005-03-03 #i43775# - sub shells will be destroyed by the
@@ -1711,8 +1716,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
bCallBase = sal_False;
if ( GetFormShell() )
{
- GetFormShell()->SetView(
- PTR_CAST(FmFormView, GetWrtShell().GetDrawView()) );
+ GetFormShell()->SetView(dynamic_cast< FmFormView* >( GetWrtShell().GetDrawView()) );
SfxBoolItem aItem( SID_FM_DESIGN_MODE, !GetDocShell()->IsReadOnly());
GetDispatcher().Execute( SID_FM_DESIGN_MODE, SFX_CALLMODE_SYNCHRON,
&aItem, 0L );
@@ -1721,9 +1725,13 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
break;
}
}
- else if(rHint.ISA(FmDesignModeChangedHint))
+ else
+ {
+ const FmDesignModeChangedHint* pFmDesignModeChangedHint = dynamic_cast< const FmDesignModeChangedHint* >(&rHint);
+
+ if(pFmDesignModeChangedHint)
{
- sal_Bool bDesignMode = ((FmDesignModeChangedHint&)rHint).GetDesignMode();
+ sal_Bool bDesignMode = pFmDesignModeChangedHint->GetDesignMode();
if (!bDesignMode && GetDrawFuncPtr())
{
GetDrawFuncPtr()->Deactivate();
@@ -1732,6 +1740,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
AttrChangedNotify(pWrtShell);
}
}
+ }
if ( bCallBase )
SfxViewShell::Notify(rBC, rHint);
diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx
index 667c002a7117..193b5dc66c84 100644
--- a/sw/source/ui/uiview/view0.cxx
+++ b/sw/source/ui/uiview/view0.cxx
@@ -125,8 +125,6 @@ SFX_IMPL_INTERFACE( SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) )
SW_RES(RID_TOOLS_TOOLBOX) );
}
-TYPEINIT1(SwView,SfxViewShell)
-
/*-----------------13.12.97 11:06-------------------
--------------------------------------------------*/
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 88cf635f78c4..5755f42c36d4 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -323,7 +323,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
DBG_ERROR("control acces failed");
}
- SFX_REQUEST_ARG( rReq, pName, SfxStringItem, SID_INSERT_GRAPHIC , sal_False );
+ SFX_REQUEST_ARG( rReq, pName, SfxStringItem, SID_INSERT_GRAPHIC );
sal_Bool bShowError = !pName;
if( pName || ERRCODE_NONE == pFileDlg->Execute() )
{
@@ -332,7 +332,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
if ( pName )
{
aFileName = pName->GetValue();
- SFX_REQUEST_ARG( rReq, pFilter, SfxStringItem, FN_PARAM_FILTER , sal_False );
+ SFX_REQUEST_ARG( rReq, pFilter, SfxStringItem, FN_PARAM_FILTER );
if ( pFilter )
aFilterName = pFilter->GetValue();
}
@@ -368,8 +368,8 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
}
- SFX_REQUEST_ARG( rReq, pAsLink, SfxBoolItem, FN_PARAM_1 , sal_False );
- SFX_REQUEST_ARG( rReq, pStyle, SfxStringItem, FN_PARAM_2 , sal_False );
+ SFX_REQUEST_ARG( rReq, pAsLink, SfxBoolItem, FN_PARAM_1 );
+ SFX_REQUEST_ARG( rReq, pStyle, SfxStringItem, FN_PARAM_2 );
sal_Bool bAsLink = sal_False;
if( nHtmlMode & HTMLMODE_ON )
@@ -713,7 +713,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
else if ( pWrtShell->HasSelection() || IsDrawMode() )
{
SdrView *pSdrView = pWrtShell->HasDrawView() ? pWrtShell->GetDrawView() : 0;
- if(pSdrView && pSdrView->AreObjectsMarked() &&
+ if(pSdrView && pSdrView->areSdrObjectsSelected() &&
pSdrView->GetHdlList().GetFocusHdl())
{
((SdrHdlList&)pSdrView->GetHdlList()).ResetFocusHdl();
@@ -897,7 +897,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
{
case FN_INSERT_CTRL:
{
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
if(bWeb)
SwView::nWebInsertCtrlState = nValue;
else
@@ -1185,18 +1185,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
switch( nWhich )
{
case FN_STAT_PAGE:
-/*
-//JP 07.01.00: is a nice feature - show the selektion of DrawObjects
- if( rShell.IsObjSelected()
-//??? || rShell.IsFrmSelected()
- )
{
- String sDisplay( rShell.GetDrawView()->GetMarkedObjectList().
- GetDescriptionOfMarkedObjects() );
- rSet.Put( SfxStringItem( FN_STAT_PAGE, sDisplay ));
- }
- else
-*/ {
// Anzahl der Seiten, log. SeitenNr. SeitenNr ermitteln
sal_uInt16 nPage, nLogPage;
String sDisplay;
@@ -1809,7 +1798,7 @@ void SwView::InsFrmMode(sal_uInt16 nCols)
void SwView::EditLinkDlg()
{
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( &GetViewFrame()->GetWindow(), &GetWrtShell().GetLinkManager(), bWeb );
if ( pDlg )
diff --git a/sw/source/ui/uiview/viewdlg2.cxx b/sw/source/ui/uiview/viewdlg2.cxx
index 513ca45212e6..b382060c0829 100644
--- a/sw/source/ui/uiview/viewdlg2.cxx
+++ b/sw/source/ui/uiview/viewdlg2.cxx
@@ -105,7 +105,7 @@ void SwView::AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId)
{
SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
if (pModOpt->IsInsWithCaption(bWeb))
{
const InsCaptionOpt *pOpt = pModOpt->GetCapOption(bWeb, (SwCapObjType)nType, pOleId);
diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx
index e8188dd4d936..842893d1638e 100644
--- a/sw/source/ui/uiview/viewdraw.cxx
+++ b/sw/source/ui/uiview/viewdraw.cxx
@@ -53,6 +53,7 @@
#include <svx/fmglob.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svdoutl.hxx>
+#include <svx/svdlegacy.hxx>
#include "view.hxx"
#include "wrtsh.hxx"
@@ -124,7 +125,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
}
else if (nSlotId == SID_FM_CREATE_CONTROL)
{
- SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER, sal_False );
+ SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER );
if( pIdentifierItem )
{
sal_uInt16 nNewId = pIdentifierItem->GetValue();
@@ -137,10 +138,10 @@ void SwView::ExecDraw(SfxRequest& rReq)
}
else if( nSlotId == SID_FM_CREATE_FIELDCONTROL)
{
- FmFormView* pFormView = PTR_CAST( FmFormView, pSdrView );
+ FmFormView* pFormView = dynamic_cast< FmFormView* >( pSdrView );
if ( pFormView )
{
- SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False );
+ SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR );
DBG_ASSERT( pDescriptorItem, "SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid request args!" );
if( pDescriptorItem )
{
@@ -151,18 +152,24 @@ void SwView::ExecDraw(SfxRequest& rReq)
{
Size aDocSize(pWrtShell->GetDocSize());
const SwRect& rVisArea = pWrtShell->VisArea();
- Point aStartPos = rVisArea.Center();
+ Point aStartPos(rVisArea.Center());
+
if(rVisArea.Width() > aDocSize.Width())
+ {
aStartPos.X() = aDocSize.Width() / 2 + rVisArea.Left();
+ }
+
if(rVisArea.Height() > aDocSize.Height())
+ {
aStartPos.Y() = aDocSize.Height() / 2 + rVisArea.Top();
+ }
//determine the size of the object
- if(pObj->IsGroupObject())
+ if(pObj->getChildrenOfSdrObject())
{
- const Rectangle& rBoundRect = ((SdrObjGroup*)pObj)->GetCurrentBoundRect();
- aStartPos.X() -= rBoundRect.GetWidth()/2;
- aStartPos.Y() -= rBoundRect.GetHeight()/2;
+ const basegfx::B2DRange aRange(pObj->getObjectRange(pSdrView));
+ aStartPos.X() -= basegfx::fround(aRange.getWidth() * 0.5);
+ aStartPos.Y() -= basegfx::fround(aRange.getHeight() * 0.5);
}
// TODO: unmark all other
@@ -186,8 +193,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
if ( pSdrView )
{
SdrObject* pObj = NULL;
- svx::FontWorkGalleryDialog aDlg( pSdrView, pWin, nSlotId );
- aDlg.SetSdrObjectRef( &pObj, pSdrView->GetModel() );
+ svx::FontWorkGalleryDialog aDlg( *pSdrView, pWin, &pObj );
aDlg.Execute();
if ( pObj )
{
@@ -195,7 +201,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
const SwRect& rVisArea = pWrtShell->VisArea();
Point aPos( rVisArea.Center() );
Size aSize;
- Size aPrefSize( pObj->GetSnapRect().GetSize() );
+ Size aPrefSize( sdr::legacy::GetSnapRect(*pObj).GetSize() );
if( rVisArea.Width() > aDocSize.Width())
aPos.X() = aDocSize.Width() / 2 + rVisArea.Left();
@@ -306,7 +312,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_FM_CREATE_CONTROL:
{
- SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER, sal_False );
+ SFX_REQUEST_ARG( rReq, pIdentifierItem, SfxUInt16Item, SID_FM_CONTROL_IDENTIFIER );
if( pIdentifierItem )
nSlotId = pIdentifierItem->GetValue();
pFuncPtr = new ConstFormControl(pWrtShell, pEditWin, this);
@@ -379,12 +385,12 @@ void SwView::ExecDraw(SfxRequest& rReq)
LeaveDrawCreate();
pWrtShell->EnterStdMode();
SdrView *pTmpSdrView = pWrtShell->GetDrawView();
- const SdrMarkList& rMarkList = pTmpSdrView->GetMarkedObjectList();
- if(rMarkList.GetMarkCount() == 1 &&
+ SdrObject* pObj = pTmpSdrView->getSelectedIfSingle();
+
+ if(pObj &&
(SID_DRAW_TEXT == nSlotId || SID_DRAW_TEXT_VERTICAL == nSlotId ||
SID_DRAW_TEXT_MARQUEE == nSlotId ))
{
- SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
BeginTextEdit(pObj);
bEndTextEdit = sal_False;
}
@@ -427,10 +433,10 @@ void SwView::ExitDraw()
if(pTest == pShell &&
// don't call LeaveSelFrmMode() etc. for the below,
// because objects may still be selected:
- !pShell->ISA(SwDrawBaseShell) &&
- !pShell->ISA(SwBezierShell) &&
- !pShell->ISA(svx::ExtrusionBar) &&
- !pShell->ISA(svx::FontworkBar))
+ !dynamic_cast< SwDrawBaseShell* >(pShell) &&
+ !dynamic_cast< SwBezierShell* >(pShell) &&
+ !dynamic_cast< svx::ExtrusionBar* >(pShell) &&
+ !dynamic_cast< svx::FontworkBar* >(pShell))
{
SdrView *pSdrView = pWrtShell->GetDrawView();
@@ -479,10 +485,9 @@ void SwView::NoRotate()
* Beschreibung: DrawTextEditMode einschalten
******************************************************************************/
-sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
+sal_Bool SwView::EnterDrawTextMode(const basegfx::B2DPoint& aDocPos)
{
SdrObject* pObj;
- SdrPageView* pPV;
SwWrtShell *pSh = &GetWrtShell();
SdrView *pSdrView = pSh->GetDrawView();
ASSERT( pSdrView, "EnterDrawTextMode without DrawView?" );
@@ -492,20 +497,20 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
sal_uInt16 nOld = pSdrView->GetHitTolerancePixel();
pSdrView->SetHitTolerancePixel( 2 );
- if( pSdrView->IsMarkedHit( aDocPos ) &&
+ if( pSdrView->IsMarkedObjHit( aDocPos ) &&
!pSdrView->PickHandle( aDocPos ) && IsTextTool() &&
- pSdrView->PickObj( aDocPos, pSdrView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKTEXTEDIT ) &&
+ pSdrView->PickObj( aDocPos, pSdrView->getHitTolLog(), pObj, SDRSEARCH_PICKTEXTEDIT ) &&
// #108784#
// To allow SwDrawVirtObj text objects to be activated, allow their type, too.
- //pObj->ISA( SdrTextObj ) &&
- ( pObj->ISA( SdrTextObj ) ||
- ( pObj->ISA(SwDrawVirtObj) &&
- ((SwDrawVirtObj*)pObj)->GetReferencedObj().ISA(SdrTextObj) ) ) &&
+ //dynamic_cast< SdrTextObj* >(pObj) &&
+ ( dynamic_cast< SdrTextObj* >(pObj) ||
+ ( dynamic_cast< SwDrawVirtObj* >(pObj) &&
+ dynamic_cast< const SdrTextObj* >(&((SwDrawVirtObj*)pObj)->GetReferencedObj()) ) ) &&
!pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT))
{
- bReturn = BeginTextEdit( pObj, pPV, pEditWin, sal_False );
+ bReturn = BeginTextEdit( pObj, pEditWin, sal_False );
}
pSdrView->SetHitTolerancePixel( nOld );
@@ -516,12 +521,11 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
/******************************************************************************
* Beschreibung: DrawTextEditMode einschalten
******************************************************************************/
-sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
- bool bIsNewObj, bool bSetSelectionToStart)
+sal_Bool SwView::BeginTextEdit(SdrObject* pObj, Window* pWin, bool bIsNewObj, bool bSetSelectionToStart)
{
SwWrtShell *pSh = &GetWrtShell();
SdrView *pSdrView = pSh->GetDrawView();
- SdrOutliner* pOutliner = ::SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, pSdrView->GetModel());
+ SdrOutliner* pOutliner = ::SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, &pSdrView->getSdrModelFromSdrView());
uno::Reference< linguistic2::XSpellChecker1 > xSpell( ::GetSpellChecker() );
if (pOutliner)
{
@@ -576,11 +580,11 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
// where the VirtObj is positioned, on demand a occurring offset is set at
// the TextEdit object. That offset is used for creating and managing the
// OutlinerView.
- Point aNewTextEditOffset(0, 0);
+ basegfx::B2DPoint aNewTextEditOffset(0.0, 0.0);
+ SwDrawVirtObj* pVirtObj = dynamic_cast< SwDrawVirtObj* >(pObj);
- if(pObj->ISA(SwDrawVirtObj))
+ if(pVirtObj)
{
- SwDrawVirtObj* pVirtObj = (SwDrawVirtObj*)pObj;
pToBeActivated = &((SdrObject&)pVirtObj->GetReferencedObj());
aNewTextEditOffset = pVirtObj->GetOffset();
}
@@ -588,7 +592,7 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
// set in each case, thus it will be correct for all objects
((SdrTextObj*)pToBeActivated)->SetTextEditOffset(aNewTextEditOffset);
- sal_Bool bRet(pSdrView->SdrBeginTextEdit( pToBeActivated, pPV, pWin, sal_True, pOutliner, 0, sal_False, sal_False, sal_False ));
+ sal_Bool bRet(pSdrView->SdrBeginTextEdit( pToBeActivated, pWin, sal_True, pOutliner, 0, sal_False, sal_False, sal_False ));
// #i7672#
// Since SdrBeginTextEdit actually creates the OutlinerView and thus also
@@ -622,16 +626,13 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
sal_Bool SwView::IsTextTool() const
{
- sal_uInt16 nId;
- sal_uInt32 nInvent;
SdrView *pSdrView = GetWrtShell().GetDrawView();
ASSERT( pSdrView, "IsTextTool without DrawView?" );
if (pSdrView->IsCreateMode())
- pSdrView->SetCreateMode(sal_False);
+ pSdrView->SetViewEditMode(SDREDITMODE_EDIT);
- pSdrView->TakeCurrentObj(nId,nInvent);
- return (nInvent==SdrInventor);
+ return (SdrInventor == pSdrView->getSdrObjectCreationInfo().getInvent());
}
/*--------------------------------------------------------------------
@@ -703,18 +704,16 @@ sal_Bool SwView::AreOnlyFormsSelected() const
return sal_False;
sal_Bool bForm = sal_True;
-
SdrView* pSdrView = GetWrtShell().GetDrawView();
- const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
- sal_uInt32 nCount = rMarkList.GetMarkCount();
-
- if (nCount)
+ if (pSdrView->areSdrObjectsSelected())
{
- for (sal_uInt32 i = 0; i < nCount; i++)
+ const SdrObjectVector aSelection(pSdrView->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for (sal_uInt32 i(0); i < aSelection.size(); i++)
{
// Sind ausser Controls noch normale Draw-Objekte selektiert?
- SdrObject *pSdrObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ SdrObject *pSdrObj = aSelection[i];
if (!HasOnlyObj(pSdrObj, FmFormInventor))
{
@@ -737,16 +736,16 @@ sal_Bool SwView::HasDrwObj(SdrObject *pSdrObj) const
{
sal_Bool bRet = sal_False;
- if (pSdrObj->IsGroupObject())
+ if (pSdrObj->getChildrenOfSdrObject())
{
- SdrObjList* pList = pSdrObj->GetSubList();
+ SdrObjList* pList = pSdrObj->getChildrenOfSdrObject();
sal_uInt32 nCnt = pList->GetObjCount();
for (sal_uInt32 i = 0; i < nCnt; i++)
if ((bRet = HasDrwObj(pList->GetObj(i))) == sal_True)
break;
}
- else if (SdrInventor == pSdrObj->GetObjInventor() || pSdrObj->Is3DObj())
+ else if (SdrInventor == pSdrObj->GetObjInventor() || pSdrObj->IsE3dObject())
return sal_True;
return bRet;
@@ -760,9 +759,9 @@ sal_Bool SwView::HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const
{
sal_Bool bRet = sal_False;
- if (pSdrObj->IsGroupObject())
+ if (pSdrObj->getChildrenOfSdrObject())
{
- SdrObjList* pList = pSdrObj->GetSubList();
+ SdrObjList* pList = pSdrObj->getChildrenOfSdrObject();
sal_uInt32 nCnt = pList->GetObjCount();
for (sal_uInt32 i = 0; i < nCnt; i++)
@@ -814,7 +813,7 @@ sal_Bool SwView::IsDrawTextHyphenate()
SdrView *pSdrView = pWrtShell->GetDrawView();
sal_Bool bHyphenate = sal_False;
- SfxItemSet aNewAttr( pSdrView->GetModel()->GetItemPool(),
+ SfxItemSet aNewAttr( pSdrView->getSdrModelFromSdrView().GetItemPool(),
EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
if( pSdrView->GetAttributes( aNewAttr ) &&
aNewAttr.GetItemState( EE_PARA_HYPHENATE ) >= SFX_ITEM_AVAILABLE )
diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx
index 6a3d476db3b4..375409273674 100644
--- a/sw/source/ui/uiview/viewmdi.cxx
+++ b/sw/source/ui/uiview/viewmdi.cxx
@@ -105,7 +105,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType,
long nFac = nFactor;
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
const SwPageDesc &rDesc = pWrtShell->GetPageDesc( pWrtShell->GetCurPageDesc() );
@@ -258,7 +258,7 @@ void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewO
if ( !GetViewFrame()->GetFrame().IsInPlace() && !bViewOnly )
{
- const sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ const sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
//MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen
@@ -681,12 +681,11 @@ void SwView::SetMoveType(sal_uInt16 nSet)
if(bNewPage != bLastPage)
{
Color aColor(bNewPage ? COL_BLACK : VIEW_IMAGECOLOR);
- const TypeId aTypeId = TYPE(SwView);
- SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
+ SwView* pView = (SwView*)SfxViewShell::GetFirst( _IsSfxViewShell< SwView > );
while( pView )
{
pView->SetImageButtonColor(aColor);
- pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
+ pView = (SwView*)SfxViewShell::GetNext(*pView, _IsSfxViewShell< SwView > );
}
}
}
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index f25796a3ed79..42d012aec75d 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -1070,7 +1070,7 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize )
*pHScrollbar, pPageUpBtn, pPageDownBtn,
pNaviBtn,
*pScrollFill, pVRuler, pHRuler,
- 0 != PTR_CAST(SwWebView, this),
+ 0 != dynamic_cast< SwWebView* >( this),
pWrtShell->GetViewOptions()->IsVRulerRight());
if ( bShowAtResize )
ShowAtResize();
@@ -1178,7 +1178,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
*pHScrollbar, pPageUpBtn, pPageDownBtn,
pNaviBtn,
*pScrollFill, pVRuler, pHRuler,
- 0 != PTR_CAST(SwWebView, this),
+ 0 != dynamic_cast< SwWebView* >( this),
pWrtShell->GetViewOptions()->IsVRulerRight() );
if ( bShowAtResize )
ShowAtResize();
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index 65e0a0e78532..c8e15fd1eb77 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -100,7 +100,7 @@ SfxPrinter* __EXPORT SwView::GetPrinter( sal_Bool bCreate )
SfxPrinter *pPrt = pIDDA->getPrinter( bCreate );
if ( pOld != pPrt )
{
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
::SetAppPrintOptions( &GetWrtShell(), bWeb );
}
return pPrt;
@@ -144,7 +144,7 @@ sal_uInt16 __EXPORT SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags,
if ( nDiffFlags & SFX_PRINTER_PRINTER )
rSh.SetModified();
}
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
if ( nDiffFlags & SFX_PRINTER_OPTIONS )
::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, bWeb );
@@ -183,7 +183,7 @@ SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent,
void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
{
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
::SetAppPrintOptions( &GetWrtShell(), bWeb );
switch (rReq.GetSlot())
{
@@ -218,9 +218,9 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
case SID_PRINTDOCDIRECT:
{
SwWrtShell* pSh = &GetWrtShell();
- SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False);
+ SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT );
sal_Bool bSilent = pSilentItem ? pSilentItem->GetValue() : sal_False;
- SFX_REQUEST_ARG(rReq, pPrintFromMergeItem, SfxBoolItem, FN_QRY_MERGE, sal_False);
+ SFX_REQUEST_ARG(rReq, pPrintFromMergeItem, SfxBoolItem, FN_QRY_MERGE );
if(pPrintFromMergeItem)
rReq.RemoveItem(FN_QRY_MERGE);
sal_Bool bFromMerge = pPrintFromMergeItem ? pPrintFromMergeItem->GetValue() : sal_False;
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index 43e2547974c8..5bfa03f763f2 100644
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -75,7 +75,7 @@ void SwView::GetState(SfxItemSet &rSet)
sal_uInt16 nWhich = aIter.FirstWhich();
sal_uInt16 eFrmType = FRMTYPE_NONE;
int bGetFrmType = sal_False;
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
while(nWhich)
{
@@ -330,7 +330,7 @@ void SwView::GetState(SfxItemSet &rSet)
case SID_DOCUMENT_COMPARE:
case SID_DOCUMENT_MERGE:
- if( GetDocShell()->IsA( SwGlobalDocShell::StaticType() ) ||
+ if( dynamic_cast< SwGlobalDocShell* >(GetDocShell()) ||
// pWrtShell->IsAnySectionInDoc( sal_True, sal_True, sal_True )||
(SID_DOCUMENT_MERGE == nWhich && pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength()))
rSet.DisableItem(nWhich);
@@ -440,7 +440,7 @@ void SwView::GetState(SfxItemSet &rSet)
void SwView::GetDrawState(SfxItemSet &rSet)
{
SfxWhichIter aIter(rSet);
- sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
+ sal_Bool bWeb = 0 != dynamic_cast< SwWebView* >( this);
for( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich;
nWhich = aIter.NextWhich() )
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index 9c267016962f..a6ba96cfa0df 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -1074,7 +1074,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_ATTR_TABSTOP_VERTICAL :
case RES_PARATR_TABSTOP:
{
- if ( ISA( SwWebView ) ||
+ if ( dynamic_cast< SwWebView* >(this) ||
IsTabColFromDoc() ||
IsTabRowFromDoc() ||
( nSelType & nsSelectionType::SEL_GRF) ||
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index 79e559b0ab2e..bf98640e9c9c 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -176,7 +176,7 @@ SwFilterDetect::~SwFilterDetect()
SfxApplication* pApp = SFX_APP();
SfxAllItemSet *pSet = new SfxAllItemSet( pApp->GetPool() );
TransformParameters( SID_OPENDOC, lDescriptor, *pSet );
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_DOC_READONLY );
bWasReadOnly = pItem && pItem->GetValue();
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index ba2dbe947d85..1356cdf0a3f2 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -929,9 +929,11 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
{
if ( &_rBC == &xDocSh )
{ // it's our document
- if ( _rHint.ISA( SfxSimpleHint ) )
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&_rHint);
+
+ if ( pSfxSimpleHint )
{
- if ( SFX_HINT_DEINITIALIZING == static_cast< const SfxSimpleHint& >( _rHint ).GetId() )
+ if ( SFX_HINT_DEINITIALIZING == pSfxSimpleHint->GetId() )
{
// our document is dying (possibly because we're shuting down, and the document was notified
// earlier than we are?)
@@ -941,9 +943,13 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
xDocSh.Clear();
}
}
- else if(_rHint.ISA(SfxEventHint))
+ else
{
- if(SFX_EVENT_PREPARECLOSEDOC == static_cast< const SfxEventHint& >( _rHint ).GetEventId())
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&_rHint);
+
+ if(pSfxEventHint)
+ {
+ if(SFX_EVENT_PREPARECLOSEDOC == pSfxEventHint->GetEventId())
{
implFlushDocument( sal_False );
xBodyText = 0;
@@ -952,6 +958,7 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint )
}
}
}
+}
void SwXAutoTextEntry::GetBodyText ()
{
diff --git a/sw/source/ui/uno/unodefaults.cxx b/sw/source/ui/uno/unodefaults.cxx
index 199133d7c37c..da4913d9acd9 100644
--- a/sw/source/ui/uno/unodefaults.cxx
+++ b/sw/source/ui/uno/unodefaults.cxx
@@ -29,6 +29,7 @@
#include <svx/svdmodel.hxx>
#include <svx/unoprov.hxx>
#include <doc.hxx>
+#include <svx/fmmodel.hxx>
/* -----------------------------13.03.01 14:16--------------------------------
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index fa5fdf3c72d8..77740e822081 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -622,7 +622,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
}
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( xCurDocSh, sal_False);
- SwView *pView = PTR_CAST( SwView, pFrame->GetViewShell() );
+ SwView *pView = dynamic_cast< SwView* >( pFrame->GetViewShell() );
if (!pView)
throw RuntimeException();
SwWrtShell &rSh = *pView->GetWrtShellPtr();
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 6fa578a55c25..218823cccb97 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -403,6 +403,13 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) :
// <--
{
}
+
+SdrModel* SwXTextDocument::getSdrModel() const
+{
+ OSL_ENSURE(pDocShell->GetDoc()->GetOrCreateDrawModel(), "No SdrModel in SwDoc, should not happen");
+ return pDocShell->GetDoc()->GetOrCreateDrawModel();
+}
+
/*-- 18.12.98 11:53:00---------------------------------------------------
-----------------------------------------------------------------------*/
@@ -554,12 +561,10 @@ Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeEx
Reference< XInterface > xRef;
if(IsValid())
{
-
- const TypeId aTypeId = TYPE(SwView);
- SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
+ SwView* pView = (SwView*)SfxViewShell::GetFirst( _IsSfxViewShell< SwView > );
while(pView && pView->GetObjectShell() != pDocShell)
{
- pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
+ pView = (SwView*)SfxViewShell::GetNext(*pView, _IsSfxViewShell< SwView >);
}
if(pView)
{
@@ -1915,8 +1920,8 @@ sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( R
)
return sal_True;
- sal_Bool bWebDoc = (0 != PTR_CAST(SwWebDocShell, pDocShell));
- sal_Bool bGlobalDoc = (0 != PTR_CAST(SwGlobalDocShell, pDocShell));
+ sal_Bool bWebDoc = (0 != dynamic_cast< SwWebDocShell* >( pDocShell));
+ sal_Bool bGlobalDoc = (0 != dynamic_cast< SwGlobalDocShell* >( pDocShell));
sal_Bool bTextDoc = (!bWebDoc && !bGlobalDoc);
return (
@@ -1930,8 +1935,8 @@ sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( R
* --------------------------------------------------*/
Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( RuntimeException )
{
- sal_Bool bWebDoc = (0 != PTR_CAST(SwWebDocShell, pDocShell));
- sal_Bool bGlobalDoc = (0 != PTR_CAST(SwGlobalDocShell, pDocShell));
+ sal_Bool bWebDoc = (0 != dynamic_cast< SwWebDocShell* >( pDocShell));
+ sal_Bool bGlobalDoc = (0 != dynamic_cast< SwGlobalDocShell* >( pDocShell));
sal_Bool bTextDoc = (!bWebDoc && !bGlobalDoc);
Sequence< OUString > aRet (3);
@@ -2596,10 +2601,11 @@ SwDoc * SwXTextDocument::GetRenderDoc(
// the view shell should be SwView for documents PDF export.
// for the page preview no selection should be possible
// (the export dialog does not allow for this option)
- const TypeId aSwViewTypeId = TYPE(SwView);
- if (rpView && rpView->IsA(aSwViewTypeId))
+ SwView* pSwView = dynamic_cast< SwView* >(rpView);
+
+ if (pSwView)
{
- SfxObjectShellLock xDocSh(((SwView*)rpView)->GetOrCreateTmpSelectionDoc());
+ SfxObjectShellLock xDocSh(pSwView->GetOrCreateTmpSelectionDoc());
if (xDocSh.Is())
{
pDoc = ((SwDocShell*)&xDocSh)->GetDoc();
@@ -2690,7 +2696,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
// TODO/mba: we really need a generic way to get the ViewShell!
ViewShell* pViewShell = 0;
- SwView* pSwView = PTR_CAST(SwView, pView);
+ SwView* pSwView = dynamic_cast< SwView* >(pView);
+
if ( pSwView )
{
pViewShell = pSwView->GetWrtShellPtr();
@@ -2862,7 +2869,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
// TODO/mba: we really need a generic way to get the ViewShell!
ViewShell* pVwSh = 0;
- SwView* pSwView = PTR_CAST(SwView, pView);
+ SwView* pSwView = dynamic_cast< SwView* >(pView);
if ( pSwView )
pVwSh = pSwView->GetWrtShellPtr();
else
@@ -3150,15 +3157,16 @@ void SAL_CALL SwXTextDocument::render(
// or SwPagePreView for PDF export of the page preview
//!! (check for SwView first as in GuessViewShell) !!
DBG_ASSERT( pView, "!! view missing !!" );
- const TypeId aSwViewTypeId = TYPE(SwView);
- ViewShell* pVwSh = 0;
- if (pView)
- {
// TODO/mba: we really need a generic way to get the ViewShell!
- SwView* pSwView = PTR_CAST(SwView, pView);
+ SwView* pSwView = dynamic_cast< SwView* >(pView);
+ ViewShell* pVwSh = 0;
+
if ( pSwView )
+ {
pVwSh = pSwView->GetWrtShellPtr();
+ }
else
+ {
pVwSh = ((SwPagePreView*)pView)->GetViewShell();
}
@@ -3171,8 +3179,8 @@ void SAL_CALL SwXTextDocument::render(
const bool bFirstPage = m_pPrintUIOptions->getBoolValue( "IsFirstPage", sal_False );
bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
- DBG_ASSERT(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust())
- || (!pView->IsA(aSwViewTypeId) && !m_pRenderData->IsViewOptionAdjust()),
+ DBG_ASSERT(( pSwView && m_pRenderData->IsViewOptionAdjust())
+ || (!pSwView && !m_pRenderData->IsViewOptionAdjust()),
"SwView / SwViewOptionAdjust_Impl availability mismatch" );
// since printing now also use the API for PDF export this option
@@ -3185,9 +3193,7 @@ void SAL_CALL SwXTextDocument::render(
// During this process, additional information required for tagging
// the pdf file are collected, which are evaulated during painting.
//
- SwWrtShell* pWrtShell = pView->IsA(aSwViewTypeId) ?
- ((SwView*)pView)->GetWrtShellPtr() :
- 0;
+ SwWrtShell* pWrtShell = pSwView ? pSwView->GetWrtShellPtr() : 0;
if (bIsPDFExport && bFirstPage && pWrtShell)
{
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 0667e66fb64b..45067beacac5 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -434,11 +434,11 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
{
SdrView* pDrawView = rSh.GetDrawView();
SdrPageView* pPV = pDrawView->GetSdrPageView();
- if ( pPV && pObj->GetPage() == pPV->GetPage() )
+ if ( pPV && pObj->getSdrPageFromSdrObject() == &pPV->getSdrPageFromSdrPageView() )
{
pDrawView->SdrEndTextEdit();
pDrawView->UnmarkAll();
- pDrawView->MarkObj( pObj, pPV );
+ pDrawView->MarkObj( *pObj );
}
return sal_True;
}
@@ -474,9 +474,9 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
{
// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj );
SdrPageView* pPV = pDrawView->GetSdrPageView();
- if ( pPV && pObj->GetPage() == pPV->GetPage() )
+ if ( pPV && pObj->getSdrPageFromSdrObject() == &pPV->getSdrPageFromSdrPageView() )
{
- pDrawView->MarkObj( pObj, pPV );
+ pDrawView->MarkObj( *pObj );
return sal_True;
}
}
@@ -508,9 +508,9 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj );
pPV = pDrawView->GetSdrPageView();
}
- if ( pPV && pObj->GetPage() == pPV->GetPage() )
+ if ( pPV && pObj->getSdrPageFromSdrObject() == &pPV->getSdrPageFromSdrPageView() )
{
- pDrawView->MarkObj( pObj, pPV );
+ pDrawView->MarkObj( *pObj );
bSelected = sal_True;
}
}
@@ -612,14 +612,19 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
SwFmDrawPage* pSvxDrawPage = pTextDoc->GetDrawPage()->GetSvxPage();
uno::Reference< drawing::XShapes > xShCol = new SvxShapeCollection();
- const SdrMarkList& rMarkList = rSh.GetDrawView()->GetMarkedObjectList();
- for(sal_uInt16 i = 0; i < rMarkList.GetMarkCount(); i++)
+ if(rSh.GetDrawView() && rSh.GetDrawView()->areSdrObjectsSelected())
{
- SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ const SdrObjectVector aSelection(rSh.GetDrawView()->getSelectedSdrObjectVectorFromSdrMarkView());
+
+ for(sal_uInt32 i(0); i < aSelection.size(); i++)
+ {
+ SdrObject* pObj = aSelection[i];
uno::Reference< uno::XInterface > xInt = pSvxDrawPage->GetInterface( pObj );
uno::Reference< drawing::XShape > xShape(xInt, uno::UNO_QUERY);;
xShCol->add(xShape);
}
+ }
+
aRef = uno::Reference< uno::XInterface >(xShCol, uno::UNO_QUERY);
}
break;
diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx
index 9ec96946d3d6..5c208998bf7a 100644
--- a/sw/source/ui/utlui/attrdesc.cxx
+++ b/sw/source/ui/utlui/attrdesc.cxx
@@ -66,8 +66,6 @@
using namespace com::sun::star;
-TYPEINIT2(SwFmtCharFmt,SfxPoolItem,SwClient);
-
// erfrage die Attribut-Beschreibung
void SwAttrSet::GetPresentation(
SfxItemPresentation ePres,
@@ -1183,6 +1181,11 @@ SfxItemPresentation SwContrastGrf::GetPresentation(
return ePres;
}
+SfxPoolItem* SwChannelGrf::Clone(SfxItemPool* /*pPool*/) const
+{
+ return new SwChannelGrf( *this );
+}
+
SfxItemPresentation SwChannelGrf::GetPresentation(
SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
String &rText, const IntlWrapper* /*pIntl*/) const
diff --git a/sw/source/ui/utlui/bookctrl.cxx b/sw/source/ui/utlui/bookctrl.cxx
index 81361ccf628e..736cd226bb52 100644
--- a/sw/source/ui/utlui/bookctrl.cxx
+++ b/sw/source/ui/utlui/bookctrl.cxx
@@ -102,9 +102,9 @@ SwBookmarkControl::~SwBookmarkControl()
void SwBookmarkControl::StateChanged(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
- if( eState != SFX_ITEM_AVAILABLE || pState->ISA( SfxVoidItem ) )
+ if( eState != SFX_ITEM_AVAILABLE || dynamic_cast< const SfxVoidItem* >(pState) )
GetStatusBar().SetItemText( GetId(), String() );
- else if ( pState->ISA( SfxStringItem ) )
+ else if ( dynamic_cast< const SfxStringItem* >(pState) )
{
sPageNumber = ((SfxStringItem*)pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sPageNumber );
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 1d63aee3d3a3..c825951eea56 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -93,6 +93,7 @@
#include "swabstdlg.hxx"
#include "globals.hrc"
#include <unomid.h>
+#include <svx/fmmodel.hxx>
#define CTYPE_CNT 0
@@ -410,7 +411,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
{
for(SwPostItMgr::const_iterator i = aMgr->begin(); i != aMgr->end(); ++i)
{
- if ( (*i)->GetBroadCaster()->ISA(SwFmtFld)) // SwPostit
+ if ( dynamic_cast< SwFmtFld* >((*i)->GetBroadCaster())) // SwPostit
{
SwFmtFld* aFmtFld = static_cast<SwFmtFld*>((*i)->GetBroadCaster());
if (aFmtFld->GetTxtFld() && aFmtFld->IsFldInDoc() &&
@@ -467,7 +468,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
{
SdrObject* pTemp = pPage->GetObj(i);
// --> OD 2006-03-09 #i51726# - all drawing objects can be named now
-// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName().Len())
+// if(dynamic_cast< SdrObjGroup* >(pTemp) && pTemp->GetName().Len())
if ( pTemp->GetName().Len() )
// <--
nMemberCount++;
@@ -777,7 +778,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
{
for(SwPostItMgr::const_iterator i = aMgr->begin(); i != aMgr->end(); ++i)
{
- if ( (*i)->GetBroadCaster()->ISA(SwFmtFld)) // SwPostit
+ if ( dynamic_cast< SwFmtFld* >((*i)->GetBroadCaster())) // SwPostit
{
SwFmtFld* aFmtFld = static_cast<SwFmtFld*>((*i)->GetBroadCaster());
if (aFmtFld->GetTxtFld() && aFmtFld->IsFldInDoc() &&
@@ -835,11 +836,11 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged)
{
SdrObject* pTemp = pPage->GetObj(i);
// --> OD 2006-03-09 #i51726# - all drawing objects can be named now
-// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName().Len())
+// if(dynamic_cast< SdrObjGroup* >(pTemp) && pTemp->GetName().Len())
if ( pTemp->GetName().Len() )
// <--
{
- SwContact* pContact = (SwContact*)pTemp->GetUserCall();
+ SwContact* pContact = findConnectionToSdrObjectDirect(pTemp);
long nYPos = 0;
const Point aNullPt;
if(pContact && pContact->GetFmt())
@@ -3099,15 +3100,11 @@ void SwContentTree::GotoContent(SwContent* pCnt)
{
SdrObject* pTemp = pPage->GetObj(i);
// --> OD 2006-03-09 #i51726# - all drawing objects can be named now
-// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName() == pCnt->GetName())
+// if(dynamic_cast< SdrObjGroup* >(pTemp) && pTemp->GetName() == pCnt->GetName())
if ( pTemp->GetName() == pCnt->GetName() )
// <--
{
- SdrPageView* pPV = pDrawView->GetSdrPageView();
- if( pPV )
- {
- pDrawView->MarkObj( pTemp, pPV );
- }
+ pDrawView->MarkObj( *pTemp );
}
}
}
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index fa2174362c3b..60fb6eddf1c1 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -166,8 +166,9 @@ public:
---------------------------------------------------------------------------*/
void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
- if( rHint.ISA(SfxSimpleHint) &&
- (((SfxSimpleHint&) rHint).GetId() == SFX_HINT_DYING))
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if( pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
bValid = sal_False;
}
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index 8e0d414bfee5..66ef2d1b6768 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -1116,21 +1116,24 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
{
if(&rBrdc == pCreateView)
{
- if(rHint.ISA(SfxSimpleHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
+ const SfxSimpleHint* pSfxSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSfxSimpleHint && SFX_HINT_DYING == pSfxSimpleHint->GetId() )
{
pCreateView = 0;
}
}
else
{
- if(rHint.ISA(SfxEventHint))
+ const SfxEventHint* pSfxEventHint = dynamic_cast< const SfxEventHint* >(&rHint);
+
+ if(pSfxEventHint)
{
- if( pxObjectShell &&
- ((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_CLOSEAPP)
+ if( pxObjectShell && SFX_EVENT_CLOSEAPP == pSfxEventHint->GetEventId() )
{
DELETEZ(pxObjectShell);
}
- else if(((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_OPENDOC)
+ else if( SFX_EVENT_OPENDOC == pSfxEventHint->GetEventId() )
{
SwView *pActView = GetCreateView();
@@ -1255,14 +1258,14 @@ void SwNavigationPI::UpdateListBox()
IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem)
{
- const SfxViewFrameItem* pFrameItem = PTR_CAST(SfxViewFrameItem, pItem );
+ const SfxViewFrameItem* pFrameItem = dynamic_cast< const SfxViewFrameItem* >( pItem );
if( pFrameItem )
{
SfxViewFrame* pFrame = pFrameItem->GetFrame();
if(pFrame)
{
aContentTree.Clear();
- pContentView = PTR_CAST(SwView, pFrame->GetViewShell());
+ pContentView = dynamic_cast< SwView* >( pFrame->GetViewShell());
DBG_ASSERT(pContentView, "keine SwView");
if(pContentView)
pContentWrtShell = pContentView->GetWrtShellPtr();
diff --git a/sw/source/ui/utlui/tmplctrl.cxx b/sw/source/ui/utlui/tmplctrl.cxx
index eefa29a2416c..852c5389be92 100644
--- a/sw/source/ui/utlui/tmplctrl.cxx
+++ b/sw/source/ui/utlui/tmplctrl.cxx
@@ -100,9 +100,9 @@ SwTemplateControl::~SwTemplateControl()
void SwTemplateControl::StateChanged(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
- if( eState != SFX_ITEM_AVAILABLE || pState->ISA( SfxVoidItem ) )
+ if( eState != SFX_ITEM_AVAILABLE || dynamic_cast< const SfxVoidItem* >(pState) )
GetStatusBar().SetItemText( GetId(), String() );
- else if ( pState->ISA( SfxStringItem ) )
+ else if ( dynamic_cast< const SfxStringItem* >(pState) )
{
sTemplate = ((SfxStringItem*)pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sTemplate );
diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx
index 9fa41d44a024..17bbb07d5feb 100644
--- a/sw/source/ui/utlui/viewlayoutctrl.cxx
+++ b/sw/source/ui/utlui/viewlayoutctrl.cxx
@@ -91,11 +91,11 @@ SwViewLayoutControl::~SwViewLayoutControl()
void SwViewLayoutControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
- if ( SFX_ITEM_AVAILABLE != eState || pState->ISA( SfxVoidItem ) )
+ if ( SFX_ITEM_AVAILABLE != eState || dynamic_cast< const SfxVoidItem* >(pState) )
GetStatusBar().SetItemText( GetId(), String() );
else
{
- DBG_ASSERT( pState->ISA( SvxViewLayoutItem ), "invalid item type" );
+ DBG_ASSERT( dynamic_cast< const SvxViewLayoutItem* >(pState), "invalid item type" );
const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem*>( pState )->GetValue();
const bool bBookMode = static_cast<const SvxViewLayoutItem*>( pState )->IsBookMode();
diff --git a/sw/source/ui/utlui/zoomctrl.cxx b/sw/source/ui/utlui/zoomctrl.cxx
index f8fe2d37a93e..014acd443bbc 100644
--- a/sw/source/ui/utlui/zoomctrl.cxx
+++ b/sw/source/ui/utlui/zoomctrl.cxx
@@ -60,7 +60,7 @@ SwZoomControl::~SwZoomControl()
void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState )
{
- if(SFX_ITEM_AVAILABLE == eState && pState->ISA( SfxStringItem ))
+ if(SFX_ITEM_AVAILABLE == eState && dynamic_cast< const SfxStringItem* >(pState))
{
sPreviewZoom = ((const SfxStringItem*)pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sPreviewZoom );
diff --git a/sw/source/ui/web/wdocsh.cxx b/sw/source/ui/web/wdocsh.cxx
index 49a03998fef1..0d08c5c93f88 100644
--- a/sw/source/ui/web/wdocsh.cxx
+++ b/sw/source/ui/web/wdocsh.cxx
@@ -56,8 +56,6 @@ SFX_IMPL_INTERFACE( SwWebDocShell, SfxObjectShell, SW_RES(0) )
{
}
-TYPEINIT1(SwWebDocShell, SwDocShell);
-
SFX_IMPL_OBJECTFACTORY(SwWebDocShell, SvGlobalName(SO3_SWWEB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/web" )
/*-----------------22.01.97 09.29-------------------
diff --git a/sw/source/ui/web/wformsh.cxx b/sw/source/ui/web/wformsh.cxx
index b0c10d138ab4..6a0b74e8f359 100644
--- a/sw/source/ui/web/wformsh.cxx
+++ b/sw/source/ui/web/wformsh.cxx
@@ -53,8 +53,6 @@ SFX_IMPL_INTERFACE(SwWebDrawFormShell, SwDrawFormShell, SW_RES(0))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TEXT_TOOLBOX));
}
-TYPEINIT1(SwWebDrawFormShell, SwDrawFormShell)
-
SwWebDrawFormShell::SwWebDrawFormShell(SwView& rVw) :
SwDrawFormShell(rVw)
{
diff --git a/sw/source/ui/web/wfrmsh.cxx b/sw/source/ui/web/wfrmsh.cxx
index f70d5dd23a20..259ba81e7825 100644
--- a/sw/source/ui/web/wfrmsh.cxx
+++ b/sw/source/ui/web/wfrmsh.cxx
@@ -59,8 +59,6 @@ SFX_IMPL_INTERFACE(SwWebFrameShell, SwFrameShell, SW_RES(STR_SHELLNAME_WEBFRAME)
-TYPEINIT1(SwWebFrameShell, SwFrameShell)
-
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
diff --git a/sw/source/ui/web/wgrfsh.cxx b/sw/source/ui/web/wgrfsh.cxx
index 670bb444228d..f8291d380665 100644
--- a/sw/source/ui/web/wgrfsh.cxx
+++ b/sw/source/ui/web/wgrfsh.cxx
@@ -52,8 +52,6 @@ SFX_IMPL_INTERFACE(SwWebGrfShell, SwGrfShell, SW_RES(STR_SHELLNAME_GRAPHIC))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_WEBGRAPHIC_TOOLBOX));
}
-TYPEINIT1(SwWebGrfShell,SwGrfShell)
-
SwWebGrfShell::SwWebGrfShell(SwView &_rView) :
SwGrfShell(_rView)
diff --git a/sw/source/ui/web/wlistsh.cxx b/sw/source/ui/web/wlistsh.cxx
index 452ae50fe4ff..6616fd05dc0b 100644
--- a/sw/source/ui/web/wlistsh.cxx
+++ b/sw/source/ui/web/wlistsh.cxx
@@ -47,8 +47,6 @@ SFX_IMPL_INTERFACE(SwWebListShell, SwListShell, SW_RES(STR_SHELLNAME_LIST))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_NUM_TOOLBOX));
}
-TYPEINIT1(SwWebListShell,SwListShell)
-
SwWebListShell::SwWebListShell(SwView &_rView) :
SwListShell(_rView)
{
diff --git a/sw/source/ui/web/wtabsh.cxx b/sw/source/ui/web/wtabsh.cxx
index 8f0c642b7842..4579d121600d 100644
--- a/sw/source/ui/web/wtabsh.cxx
+++ b/sw/source/ui/web/wtabsh.cxx
@@ -54,8 +54,6 @@ SFX_IMPL_INTERFACE(SwWebTableShell, SwTableShell, SW_RES(STR_SHELLNAME_TABLE))
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TABLE_TOOLBOX));
}
-TYPEINIT1(SwWebTableShell,SwTableShell)
-
SwWebTableShell::SwWebTableShell(SwView &_rView) :
SwTableShell(_rView)
{
diff --git a/sw/source/ui/web/wtextsh.cxx b/sw/source/ui/web/wtextsh.cxx
index 4ab64a733413..4650147132d9 100644
--- a/sw/source/ui/web/wtextsh.cxx
+++ b/sw/source/ui/web/wtextsh.cxx
@@ -70,8 +70,6 @@ SFX_IMPL_INTERFACE(SwWebTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_WEBTEXT))
SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_FIELD);
}
-TYPEINIT1(SwWebTextShell, SwTextShell)
-
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
diff --git a/sw/source/ui/web/wview.cxx b/sw/source/ui/web/wview.cxx
index da0c87875d25..e2abbfd8e840 100644
--- a/sw/source/ui/web/wview.cxx
+++ b/sw/source/ui/web/wview.cxx
@@ -97,8 +97,6 @@ SFX_IMPL_INTERFACE( SwWebView, SwView, SW_RES(RID_WEBTOOLS_TOOLBOX) )
SW_RES(RID_WEBTOOLS_TOOLBOX) );
}
-TYPEINIT1(SwWebView,SwView)
-
/*-----------------22.01.97 14.27-------------------
--------------------------------------------------*/
@@ -167,8 +165,8 @@ void SwWebView::SelectShell()
for ( i = 0; sal_True; ++i )
{
pSfxShell = rDispatcher.GetShell( i );
- if ( !( pSfxShell->ISA( SwBaseShell ) ||
- pSfxShell->ISA( SwDrawTextShell ) || pSfxShell->ISA( SwAnnotationShell ) ) )
+ if ( !( dynamic_cast< SwBaseShell* >(pSfxShell) ||
+ dynamic_cast< SwDrawTextShell* >(pSfxShell) || dynamic_cast< SwAnnotationShell* >(pSfxShell) ) )
break;
}
pSfxShell = rDispatcher.GetShell( --i );
@@ -305,8 +303,7 @@ void SwWebView::SelectShell()
GetEditWin().UpdatePointer(aPnt);
if ( bInitFormShell && GetWrtShell().GetDrawView() )
- GetFormShell()->SetView( PTR_CAST( FmFormView,
- GetWrtShell().GetDrawView()));
+ GetFormShell()->SetView( dynamic_cast< FmFormView* >( GetWrtShell().GetDrawView()));
}
diff --git a/sw/source/ui/wrtsh/move.cxx b/sw/source/ui/wrtsh/move.cxx
index bb1dedb8db48..0f5c35d8b420 100644
--- a/sw/source/ui/wrtsh/move.cxx
+++ b/sw/source/ui/wrtsh/move.cxx
@@ -497,7 +497,7 @@ sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect)
EndSelect();
bIsFrmSel = IsFrmSelected();
- bIsObjSel = 0 != IsObjSelected();
+ bIsObjSel = IsObjSelected();
// Rahmenselektion aufheben
if( bIsFrmSel || bIsObjSel )
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index f13c750ec667..7b4216c091d0 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -328,8 +328,7 @@ long SwWrtShell::SetCrsrKillSel(const Point *pPt, sal_Bool bTextOnly )
void SwWrtShell::UnSelectFrm()
{
// Rahmenselektion aufheben mit garantiert ungueltiger Position
- Point aPt(LONG_MIN, LONG_MIN);
- SelectObj(aPt, 0);
+ SelectObj(basegfx::B2DPoint(LONG_MIN, LONG_MIN), 0);
SwTransferable::ClearSelection( *this );
}
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 771c53c165b3..aaa0c5c1bfcc 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -1355,7 +1355,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
: 0;
GetDoc()->RemoveLeadingWhiteSpace( *GetCrsr()->GetPoint() );
- const bool bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh);
+ const bool bHtml = 0 != dynamic_cast< SwWebDocShell* >( pDocSh);
const bool bRightToLeft = IsInRightToLeftText();
for( sal_uInt8 nLvl = 0; nLvl < MAXLEVEL; ++nLvl )
{
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 99efaec239d0..f911bb7468f6 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -385,7 +385,7 @@ void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter,
// die Shell kann auch 0 sein !!!!!
SwWrtShell *pSh = 0;
- if ( pVSh && pVSh->ISA(SwCrsrShell) )
+ if ( pVSh && dynamic_cast< SwCrsrShell* >(pVSh) )
{
//Eine CrsrShell ist auch immer eine WrtShell
pSh = (SwWrtShell*)pVSh;
diff --git a/sw/source/ui/wrtsh/wrtsh3.cxx b/sw/source/ui/wrtsh/wrtsh3.cxx
index 1a3d54265d13..fc9f72d917fe 100644
--- a/sw/source/ui/wrtsh/wrtsh3.cxx
+++ b/sw/source/ui/wrtsh/wrtsh3.cxx
@@ -31,7 +31,6 @@
#include <sfx2/app.hxx>
#include <sfx2/childwin.hxx>
#include <sfx2/bindings.hxx>
-#include <svx/svdmark.hxx>
#include <svx/svdview.hxx>
#include <svx/fmglob.hxx>
#include <svx/svdouno.hxx>
@@ -192,11 +191,8 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const
if( pDView )
{
// Ein Fly ist genau dann erreichbar, wenn er selektiert ist.
- const SdrMarkList &rMarkList = pDView->GetMarkedObjectList();
+ SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >(pDView->getSelectedIfSingle());
- if (rMarkList.GetMark(0))
- {
- SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel();
@@ -236,7 +232,6 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const
}
}
}
- }
}
return bRet;
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 8464a56bc73d..dc2f19c1fd8e 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -130,13 +130,13 @@ IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclSimpleEvent*, pEvent
{
DBG_CHKTHIS(VCLXAccessibleComponent,0);
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
+ DBG_ASSERT( pEvent && dynamic_cast< VclWindowEvent* >(pEvent), "Unknown WindowEvent!" );
/* Ignore VCLEVENT_WINDOW_ENDPOPUPMODE, because the UNO accessibility wrapper
* might have been destroyed by the previous VCLEventListener (if no AT tool
* is running), e.g. sub-toolbars in impress.
*/
- if ( pEvent && pEvent->ISA( VclWindowEvent ) && mxWindow.is() /* #122218# */ && (pEvent->GetId() != VCLEVENT_WINDOW_ENDPOPUPMODE) )
+ if ( pEvent && dynamic_cast< VclWindowEvent* >(pEvent) && mxWindow.is() /* #122218# */ && (pEvent->GetId() != VCLEVENT_WINDOW_ENDPOPUPMODE) )
{
DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "Window???" );
if( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
@@ -151,8 +151,8 @@ IMPL_LINK( VCLXAccessibleComponent, WindowChildEventListener, VclSimpleEvent*, p
{
DBG_CHKTHIS(VCLXAccessibleComponent,0);
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) && mxWindow.is() /* #i68079# */ )
+ DBG_ASSERT( pEvent && dynamic_cast< VclWindowEvent* >(pEvent), "Unknown WindowEvent!" );
+ if ( pEvent && dynamic_cast< VclWindowEvent* >(pEvent) && mxWindow.is() /* #i68079# */ )
{
DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "Window???" );
if( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() )
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 3703f874976c..e8aa33fffd7f 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -124,8 +124,8 @@ void VCLXMenu::ImplCreateMenu( sal_Bool bPopup )
IMPL_LINK( VCLXMenu, MenuEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclMenuEvent ), "Unknown Event!" );
- if ( pEvent && pEvent->ISA( VclMenuEvent ) )
+ DBG_ASSERT( pEvent && dynamic_cast< VclMenuEvent* >(pEvent), "Unknown Event!" );
+ if ( pEvent && dynamic_cast< VclMenuEvent* >(pEvent) )
{
DBG_ASSERT( ((VclMenuEvent*)pEvent)->GetMenu() && mpMenu, "Menu???" );
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 039e7102a564..3a2d9d8876a9 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -452,8 +452,8 @@ IMPL_LINK( VCLXWindow, WindowEventListener, VclSimpleEvent*, pEvent )
if ( mpImpl->mnListenerLockLevel )
return 0L;
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
- if ( pEvent && pEvent->ISA( VclWindowEvent ) )
+ DBG_ASSERT( pEvent && dynamic_cast< VclWindowEvent* >(pEvent), "Unknown WindowEvent!" );
+ if ( pEvent && dynamic_cast< VclWindowEvent* >(pEvent) )
{
DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow() && GetWindow(), "Window???" );
ProcessWindowEvent( *(VclWindowEvent*)pEvent );
diff --git a/toolkit/workben/layout/zoom.cxx b/toolkit/workben/layout/zoom.cxx
index d64f98dea5fb..0f676cb29af0 100644
--- a/toolkit/workben/layout/zoom.cxx
+++ b/toolkit/workben/layout/zoom.cxx
@@ -341,13 +341,13 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
SetFactor( nZoom );
#else /* !TEST_LAYOUT */
const SfxPoolItem& rItem = rSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
+ const SvxZoomItem* pZoomItem = dynamic_cast< const SvxZoomItem *>(&rItem);
- if ( rItem.ISA(SvxZoomItem) )
+ if ( pZoomItem )
{
- const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem;
- const USHORT nZoom = rZoomItem.GetValue();
- const SvxZoomType eType = rZoomItem.GetType();
- const USHORT nValSet = rZoomItem.GetValueSet();
+ const USHORT nZoom = pZoomItem->GetValue();
+ const SvxZoomType eType = pZoomItem->GetType();
+ const USHORT nValSet = pZoomItem->GetValueSet();
USHORT nBtnId = 0;
switch ( eType )
diff --git a/tools/Package_inc.mk b/tools/Package_inc.mk
index 7e053522a7f9..70bd425fb743 100644
--- a/tools/Package_inc.mk
+++ b/tools/Package_inc.mk
@@ -76,7 +76,6 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/ref.hxx,tools/ref.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/resary.hxx,tools/resary.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/resid.hxx,tools/resid.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/resmgr.hxx,tools/resmgr.hxx))
-$(eval $(call gb_Package_add_file,tools_inc,inc/tools/rtti.hxx,tools/rtti.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/shl.hxx,tools/shl.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/simplerm.hxx,tools/simplerm.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/solar.h,tools/solar.h))
diff --git a/tools/StaticLibrary_ooopathutils.mk b/tools/StaticLibrary_ooopathutils.mk
index cac5f3190742..a47b7e1fdf0e 100755..100644
--- a/tools/StaticLibrary_ooopathutils.mk
+++ b/tools/StaticLibrary_ooopathutils.mk
@@ -26,7 +26,7 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,ooopathutils))
$(eval $(call gb_StaticLibrary_add_package_headers,ooopathutils,tools_inc))
$(eval $(call gb_StaticLibrary_add_exception_objects,ooopathutils,\
- tools/source/misc/pathutils \
+ tools/source/misc/pathutils \
))
@@ -38,7 +38,7 @@ $(call gb_StaticLibrary_get_target,ooopathutils) : $(OUTDIR)/lib/$(1)
$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,tools/source/misc/pathutils)))
$(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,tools/source/misc/pathutils)
- $$(call gb_Deliver_deliver,$$<,$$@)
+ $$(call gb_Deliver_deliver,$$<,$$@)
endef
diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index ecc5e9d5a3d4..dade27f144b3 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -27,6 +27,7 @@
#include <stdio.h>
//#include "bootstrp/sstring.hxx"
#include <vos/mutex.hxx>
+#include <string.h>
#include <tools/stream.hxx>
#include <tools/geninfo.hxx>
diff --git a/tools/inc/tools/b3dtrans.hxx b/tools/inc/tools/b3dtrans.hxx
index 4cd67a5fa4ff..2de2d91e50fe 100644
--- a/tools/inc/tools/b3dtrans.hxx
+++ b/tools/inc/tools/b3dtrans.hxx
@@ -183,8 +183,8 @@ public:
double GetBackClippingPlane() { return mfFarBound; }
void SetPerspective(sal_Bool bNew);
sal_Bool GetPerspective() { return mbPerspective; }
- void SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible);
- void SetViewportRectangle(Rectangle& rRect) { SetViewportRectangle(rRect, rRect); }
+ void SetViewportRectangle(const Rectangle& rRect, const Rectangle& rVisible);
+ void SetViewportRectangle(const Rectangle& rRect) { SetViewportRectangle(rRect, rRect); }
const Rectangle& GetViewportRectangle() { return maViewportRectangle; }
void CalcViewport();
diff --git a/tools/inc/tools/errinf.hxx b/tools/inc/tools/errinf.hxx
index f7d1113c7164..31775bdce2ab 100644
--- a/tools/inc/tools/errinf.hxx
+++ b/tools/inc/tools/errinf.hxx
@@ -27,7 +27,6 @@
#define _EINF_HXX
#include <limits.h>
-#include <tools/rtti.hxx>
#include <tools/errcode.hxx>
#include <tools/string.hxx>
#include "tools/toolsdllapi.h"
@@ -46,8 +45,6 @@ private:
sal_uIntPtr lUserId;
public:
- TYPEINFO();
-
ErrorInfo( sal_uIntPtr lArgUserId ) :
lUserId( lArgUserId ){}
virtual ~ErrorInfo(){}
@@ -70,8 +67,6 @@ private:
EDcr_Impl* pImpl;
public:
- TYPEINFO();
-
DynamicErrorInfo(sal_uIntPtr lUserId, sal_uInt16 nMask);
virtual ~DynamicErrorInfo();
@@ -90,8 +85,6 @@ private:
sal_uIntPtr lExtId;
public:
- TYPEINFO();
-
StandardErrorInfo( sal_uIntPtr lUserId, sal_uIntPtr lExtId,
sal_uInt16 nFlags = 0);
sal_uIntPtr GetExtendedErrorCode() const { return lExtId; }
@@ -109,8 +102,6 @@ private:
String aString;
public:
- TYPEINFO();
-
StringErrorInfo( sal_uIntPtr lUserId,
const String& aStringP,
sal_uInt16 nFlags = 0);
@@ -125,8 +116,6 @@ private:
String aArg2;
public:
- TYPEINFO();
-
TwoStringErrorInfo(sal_uIntPtr nUserID, const String & rTheArg1,
const String & rTheArg2, sal_uInt16 nFlags = 0):
DynamicErrorInfo(nUserID, nFlags), aArg1(rTheArg1), aArg2(rTheArg2) {}
@@ -144,7 +133,6 @@ class TOOLS_DLLPUBLIC MessageInfo : public DynamicErrorInfo
{
public:
- TYPEINFO();
MessageInfo(sal_uIntPtr UserId, sal_uInt16 nFlags = 0) :
DynamicErrorInfo(UserId, nFlags){}
MessageInfo(sal_uIntPtr UserId, const String &rArg,
diff --git a/tools/inc/tools/geninfo.hxx b/tools/inc/tools/geninfo.hxx
index 139fb21248e1..2c0712c061ed 100644
--- a/tools/inc/tools/geninfo.hxx
+++ b/tools/inc/tools/geninfo.hxx
@@ -169,7 +169,6 @@ GenericLockInformation( const ByteString &rKey, const ByteString &rValue,
return NULL;
return GenericInformation::GetSubInfo(rKey, bSearchByPath, bCreatePath); }
- // TYPEINFO();
private:
LockState aLockState;
diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index f6b78c97a0f0..d58826018094 100644
--- a/tools/inc/tools/pstm.hxx
+++ b/tools/inc/tools/pstm.hxx
@@ -34,7 +34,6 @@
#include <tools/unqidx.hxx>
#endif
#include <tools/ref.hxx>
-#include <tools/rtti.hxx>
#include <tools/stream.hxx>
#define ERRCODE_IO_NOFACTORY ERRCODE_IO_WRONGFORMAT
@@ -60,13 +59,11 @@ public:
class TOOLS_DLLPUBLIC SvRttiBase : public SvRefBase
{
public:
- TYPEINFO();
};
SV_DECL_IMPL_REF(SvRttiBase)
/*************************************************************************/
#define SV_DECL_PERSIST( Class, CLASS_ID ) \
- TYPEINFO(); \
static sal_uInt16 StaticClassId() { return CLASS_ID; } \
static void * CreateInstance( SvPersistBase ** ppBase ); \
friend SvPersistStream& operator >> ( SvPersistStream & rStm, \
@@ -91,16 +88,14 @@ SV_DECL_IMPL_REF(SvRttiBase)
{ \
SvPersistBase * pObj; \
rStm >> pObj; \
- rpObj = PTR_CAST( Class, pObj ); \
+ rpObj = dynamic_cast< Class* >( pObj ); \
return rStm; \
}
#define SV_IMPL_PERSIST( Class ) \
- TYPEINIT0( Class ) \
PRV_SV_IMPL_PERSIST( Class )
#define SV_IMPL_PERSIST1( Class, Super1 ) \
- TYPEINIT1( Class, Super1 ) \
PRV_SV_IMPL_PERSIST( Class )
/*************************************************************************/
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index 6f688c86d646..6e99f43c8530 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -47,7 +47,6 @@ typedef sal_uIntPtr sal_uLong; /* Replaces type ULONG */
/*** misc. macros to leverage platform and compiler differences ********/
-typedef int FASTBOOL;
#define DELETEZ( p ) ( delete p,p = 0 )
#define __FAR_DATA
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 9466b261f592..42416c61e893 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -30,7 +30,6 @@
#include <tools/errinf.hxx>
#endif
#include <tools/ref.hxx>
-#include <tools/rtti.hxx>
class FileCopier;
class StreamData;
@@ -136,8 +135,6 @@ protected:
void close();
public:
- TYPEINFO();
-
SvLockBytes(): m_pStream(0), m_bOwner(sal_False), m_bSync(sal_False) {}
SvLockBytes(SvStream * pTheStream, sal_Bool bTheOwner = sal_False):
@@ -177,8 +174,6 @@ SV_DECL_IMPL_REF(SvLockBytes);
class TOOLS_DLLPUBLIC SvOpenLockBytes: public SvLockBytes
{
public:
- TYPEINFO();
-
SvOpenLockBytes(): SvLockBytes(0, sal_False) {}
SvOpenLockBytes(SvStream * pStream, sal_Bool bOwner):
@@ -206,8 +201,6 @@ class SvAsyncLockBytes: public SvOpenLockBytes
sal_Bool m_bTerminated;
public:
- TYPEINFO();
-
SvAsyncLockBytes(SvStream * pStream, sal_Bool bOwner):
SvOpenLockBytes(pStream, bOwner), m_nSize(0), m_bTerminated(sal_False) {}
@@ -853,7 +846,6 @@ public:
/*-----------------MM 30.04.96 11:01-----------------
mehrfaches Aufrufen von Load und Assign erlaubt
--------------------------------------------------*/
- TYPEINFO();
virtual ~SvDataCopyStream(){}
virtual void Load( SvStream & ) = 0;
virtual void Save( SvStream & ) = 0;
diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx
index 814ff8deaf06..07dcb387b874 100644
--- a/tools/source/generic/b3dtrans.cxx
+++ b/tools/source/generic/b3dtrans.cxx
@@ -43,7 +43,7 @@ B3dTransformationSet::~B3dTransformationSet()
void B3dTransformationSet::Orientation(basegfx::B3DHomMatrix& rTarget, basegfx::B3DPoint aVRP, basegfx::B3DVector aVPN, basegfx::B3DVector aVUP)
{
- rTarget.translate( -aVRP.getX(), -aVRP.getY(), -aVRP.getZ());
+ rTarget.translate(-aVRP);
aVUP.normalize();
aVPN.normalize();
basegfx::B3DVector aRx(aVUP);
@@ -517,7 +517,7 @@ void B3dTransformationSet::SetPerspective(sal_Bool bNew)
}
}
-void B3dTransformationSet::SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible)
+void B3dTransformationSet::SetViewportRectangle(const Rectangle& rRect, const Rectangle& rVisible)
{
if(rRect != maViewportRectangle || rVisible != maVisibleRectangle)
{
@@ -609,9 +609,9 @@ basegfx::B3DHomMatrix B3dTransformationSet::GetMatFromObjectToView()
basegfx::B3DHomMatrix aFromObjectToView = GetObjectToDevice();
const basegfx::B3DVector& rScale(GetScale());
- aFromObjectToView.scale(rScale.getX(), rScale.getY(), rScale.getZ());
+ aFromObjectToView.scale(rScale);
const basegfx::B3DVector& rTranslate(GetTranslate());
- aFromObjectToView.translate(rTranslate.getX(), rTranslate.getY(), rTranslate.getZ());
+ aFromObjectToView.translate(rTranslate);
return aFromObjectToView;
}
@@ -621,9 +621,9 @@ void B3dTransformationSet::CalcMatFromWorldToView()
maMatFromWorldToView = maOrientation;
maMatFromWorldToView *= GetProjection();
const basegfx::B3DVector& rScale(GetScale());
- maMatFromWorldToView.scale(rScale.getX(), rScale.getY(), rScale.getZ());
+ maMatFromWorldToView.scale(rScale);
const basegfx::B3DVector& rTranslate(GetTranslate());
- maMatFromWorldToView.translate(rTranslate.getX(), rTranslate.getY(), rTranslate.getZ());
+ maMatFromWorldToView.translate(rTranslate);
maInvMatFromWorldToView = maMatFromWorldToView;
maInvMatFromWorldToView.invert();
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index d4041a8747b5..e9c68ddb8c64 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -40,6 +40,7 @@
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <memory.h>
// ---------------
// - PolyPolygon -
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 7f96aa418a6b..f9bfbdfadc1c 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -410,7 +410,7 @@ INetMessageOStream::~INetMessageOStream (void)
if (pTargetMsg)
{
SvOpenLockBytes *pLB =
- PTR_CAST (SvOpenLockBytes, pTargetMsg->GetDocumentLB());
+ dynamic_cast< SvOpenLockBytes* >( pTargetMsg->GetDocumentLB());
if (pLB)
{
pLB->Flush();
@@ -555,7 +555,7 @@ int INetMessageOStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
else
{
SvOpenLockBytes *pLB =
- PTR_CAST(SvOpenLockBytes, pTargetMsg->GetDocumentLB());
+ dynamic_cast< SvOpenLockBytes* >( pTargetMsg->GetDocumentLB());
if (pLB == NULL)
return INETSTREAM_STATUS_WOULDBLOCK;
@@ -866,7 +866,7 @@ int INetMessageDecodeQPStream_Impl::PutMsgLine (
INetMessage *pMsg = GetTargetMessage();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
- SvOpenLockBytes * pLB = PTR_CAST(SvOpenLockBytes, pMsg->GetDocumentLB());
+ SvOpenLockBytes * pLB = dynamic_cast< SvOpenLockBytes* >( pMsg->GetDocumentLB());
if (pLB == NULL) return INETSTREAM_STATUS_WOULDBLOCK;
const sal_Char *pStop = pData + nSize;
@@ -1196,7 +1196,7 @@ int INetMessageDecode64Stream_Impl::PutMsgLine (
INetMessage *pMsg = GetTargetMessage ();
if (pMsg == NULL) return INETSTREAM_STATUS_ERROR;
- SvOpenLockBytes * pLB = PTR_CAST(SvOpenLockBytes, pMsg->GetDocumentLB());
+ SvOpenLockBytes * pLB = dynamic_cast< SvOpenLockBytes* >( pMsg->GetDocumentLB());
if (pLB == NULL) return INETSTREAM_STATUS_WOULDBLOCK;
const sal_Char *pStop = (pData + nSize);
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 6fdceb4a9b0d..61999c86dce2 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -130,14 +130,6 @@ void EDcr_Impl::UnRegisterEDcr(DynamicErrorInfo *pDcr)
ppDcr[lIdx]=0;
}
-TYPEINIT0(ErrorInfo);
-TYPEINIT1(DynamicErrorInfo, ErrorInfo);
-TYPEINIT1(StandardErrorInfo, DynamicErrorInfo);
-TYPEINIT1(StringErrorInfo, DynamicErrorInfo);
-TYPEINIT1(TwoStringErrorInfo, DynamicErrorInfo);
-TYPEINIT1(MessageInfo, DynamicErrorInfo);
-
-
ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
{
if(lId & ERRCODE_DYNAMIC_MASK)
@@ -319,7 +311,7 @@ sal_uInt16 ErrorHandler::HandleError_Impl(
else
nErrFlags |= ERRCODE_MSG_ERROR;
- DynamicErrorInfo* pDynPtr=PTR_CAST(DynamicErrorInfo,pInfo);
+ DynamicErrorInfo* pDynPtr=dynamic_cast< DynamicErrorInfo* >( pInfo);
if(pDynPtr)
{
sal_uInt16 nDynFlags = pDynPtr->GetDialogMask();
@@ -435,13 +427,13 @@ sal_Bool SimpleErrorHandler::CreateString(
aStr+="\nErrorArea: ";
aStr+=ByteString::CreateFromInt32((nId & ERRCODE_ERROR_MASK &
~((1 << ERRCODE_AREA_SHIFT ) -1 ) ) >> ERRCODE_AREA_SHIFT);
- DynamicErrorInfo *pDyn=PTR_CAST(DynamicErrorInfo,pInfo);
+ const DynamicErrorInfo *pDyn = dynamic_cast< const DynamicErrorInfo* >( pInfo);
if(pDyn)
{
aStr+="\nDId ";
aStr+=ByteString::CreateFromInt32((sal_uIntPtr)*pDyn);
}
- StandardErrorInfo *pStd=PTR_CAST(StandardErrorInfo,pInfo);
+ const StandardErrorInfo *pStd = dynamic_cast< const StandardErrorInfo* >( pInfo);
if(pStd)
{
aStr+="\nXId ";
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index affb6856e845..4082dcf0d744 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -52,9 +52,6 @@ SvCreateInstancePersist SvClassManager::Get( sal_uInt16 nClassId )
return i == aAssocTable.end() ? 0 : i->second;
}
-/****************** SvRttiBase *******************************************/
-TYPEINIT0( SvRttiBase );
-
/****************** SvPersistBaseMemberList ******************************/
SvPersistBaseMemberList::SvPersistBaseMemberList(){}
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 93897942fd70..8ce2393e0809 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -160,9 +160,6 @@ void SvLockBytes::close()
}
//============================================================================
-TYPEINIT0(SvLockBytes);
-
-//============================================================================
// virtual
ErrCode SvLockBytes::ReadAt(sal_Size nPos, void * pBuffer, sal_Size nCount,
sal_Size * pRead) const
@@ -265,16 +262,12 @@ ErrCode SvLockBytes::Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const
//
//============================================================================
-TYPEINIT1(SvOpenLockBytes, SvLockBytes);
-
//============================================================================
//
// class SvAsyncLockBytes
//
//============================================================================
-TYPEINIT1(SvAsyncLockBytes, SvOpenLockBytes);
-
//============================================================================
// virtual
ErrCode SvAsyncLockBytes::ReadAt(sal_Size nPos, void * pBuffer, sal_Size nCount,
@@ -2868,8 +2861,6 @@ void SvMemoryStream::SetSize( sal_Size nNewSize )
ReAllocateMemory( nDiff );
}
-TYPEINIT0 ( SvDataCopyStream )
-
void SvDataCopyStream::Assign( const SvDataCopyStream& )
{
}
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 668cb301f486..a0ad68e700ba 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -65,6 +65,7 @@
#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/content.hxx>
+#include <memory.h>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk
index 72e9b124d0a3..ff3ffdc165a5 100755..100644
--- a/vcl/StaticLibrary_vclmain.mk
+++ b/vcl/StaticLibrary_vclmain.mk
@@ -24,17 +24,17 @@
$(eval $(call gb_StaticLibrary_StaticLibrary,vclmain))
$(eval $(call gb_StaticLibrary_set_include,vclmain,\
- $$(INCLUDE) \
- -I$(SRCDIR)/vcl/inc \
- -I$(SRCDIR)/vcl/inc/pch \
- -I$(SRCDIR)/solenv/inc \
- -I$(OUTDIR)/inc/offuh \
- -I$(OUTDIR)/inc/stl \
- -I$(OUTDIR)/inc \
+ $$(INCLUDE) \
+ -I$(SRCDIR)/vcl/inc \
+ -I$(SRCDIR)/vcl/inc/pch \
+ -I$(SRCDIR)/solenv/inc \
+ -I$(OUTDIR)/inc/offuh \
+ -I$(OUTDIR)/inc/stl \
+ -I$(OUTDIR)/inc \
))
$(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\
- vcl/source/salmain/salmain \
+ vcl/source/salmain/salmain \
))
# HACK for now
@@ -45,7 +45,7 @@ $(call gb_StaticLibrary_get_target,vclmain) : $(OUTDIR)/lib/$(1)
$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain)))
$(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,vcl/source/salmain/salmain)
- $$(call gb_Deliver_deliver,$$<,$$@)
+ $$(call gb_Deliver_deliver,$$<,$$@)
endef
diff --git a/vcl/inc/vcl/apptypes.hxx b/vcl/inc/vcl/apptypes.hxx
index 6765b9c1c445..a19bb68113f0 100644
--- a/vcl/inc/vcl/apptypes.hxx
+++ b/vcl/inc/vcl/apptypes.hxx
@@ -26,7 +26,6 @@
#include <vcl/sv.h>
#include <vcl/dllapi.h>
-#include <tools/rtti.hxx>
// ---------------------
// - Application-Types -
@@ -46,8 +45,7 @@
class VCL_DLLPUBLIC ApplicationProperty
{
public:
-
- TYPEINFO();
+ virtual ~ApplicationProperty();
};
#define INPUT_MOUSE 0x0001
diff --git a/vcl/inc/vcl/extoutdevdata.hxx b/vcl/inc/vcl/extoutdevdata.hxx
index 6129ee06b0ef..4b4ae83d5495 100644
--- a/vcl/inc/vcl/extoutdevdata.hxx
+++ b/vcl/inc/vcl/extoutdevdata.hxx
@@ -24,7 +24,6 @@
#ifndef _VCL_EXTOUTDEVDATA_HXX
#define _VCL_EXTOUTDEVDATA_HXX
-#include <tools/rtti.hxx>
#include <vcl/dllapi.h>
namespace vcl
@@ -33,8 +32,6 @@ namespace vcl
class VCL_DLLPUBLIC ExtOutDevData
{
public:
-
- TYPEINFO();
virtual ~ExtOutDevData();
};
diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx
index a69e54cee834..ed9e4557e384 100644
--- a/vcl/inc/vcl/graph.hxx
+++ b/vcl/inc/vcl/graph.hxx
@@ -97,9 +97,6 @@ public:
//#endif
public:
-
- TYPEINFO();
-
Graphic();
Graphic( const Graphic& rGraphic );
Graphic( const Bitmap& rBmp );
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 8c4e9b2c3720..7f83ac1308fa 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -939,13 +939,30 @@ public:
const Point& GetRefPoint() const { return maRefPoint; }
sal_Bool IsRefPoint() const { return mbRefPoint; }
- // #i75163#
+ // Get the MapMode (which actually is the ViewTransformation) as
+ // basegfx::B2DHomMatrix for better and more precise processing.
basegfx::B2DHomMatrix GetViewTransformation() const;
basegfx::B2DHomMatrix GetInverseViewTransformation() const;
+ // Same as above, but do not use the current MapMode, but the given
+ // one. Unfortunately this cannot be static since some other aspects
+ // of the OutDev have to be used (the DPI and OutOffOrigX).
basegfx::B2DHomMatrix GetViewTransformation( const MapMode& rMapMode ) const;
basegfx::B2DHomMatrix GetInverseViewTransformation( const MapMode& rMapMode ) const;
+ // Convenience method which creates the full transform from
+ // source to dest MapMode
+ basegfx::B2DHomMatrix GetTransformLogicToLogic(const MapMode& rMapModeSource, const MapMode& rMapModeDest) const;
+
+ // Convenience method to just get the scaling between the given MapUnits
+ static double GetFactorLogicToLogic(MapUnit eUnitSource, MapUnit eUnitDest);
+
+ // Get the discrete (pixel) and logic range/vector of this OutDev.
+ // getMinimum() of the discrete range will always be (0,0)
+ basegfx::B2DRange GetLogicRange() const;
+ basegfx::B2DVector GetLogicVector() const;
+ basegfx::B2DRange GetDiscreteRange() const;
+ basegfx::B2DVector GetDiscreteVector() const;
/** Set an offset in pixel
diff --git a/vcl/inc/vcl/pdfextoutdevdata.hxx b/vcl/inc/vcl/pdfextoutdevdata.hxx
index 6fc380be4369..62dd305d198e 100644
--- a/vcl/inc/vcl/pdfextoutdevdata.hxx
+++ b/vcl/inc/vcl/pdfextoutdevdata.hxx
@@ -30,7 +30,6 @@
#include <vcl/extoutdevdata.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/mapmod.hxx>
-#include <tools/rtti.hxx>
#include <vector>
#include <deque>
@@ -98,8 +97,6 @@ class VCL_DLLPUBLIC PDFExtOutDevData : public ExtOutDevData
std::vector< PDFExtOutDevBookmarkEntry > maBookmarks;
public :
-
- TYPEINFO();
PDFExtOutDevData( const OutputDevice& rOutDev );
virtual ~PDFExtOutDevData();
diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx
index ec0dd8e06257..1c35e8658fc1 100644
--- a/vcl/inc/vcl/vclevent.hxx
+++ b/vcl/inc/vcl/vclevent.hxx
@@ -25,7 +25,6 @@
#define _VCL_VCLEVENT_HXX
#include "tools/link.hxx"
-#include "tools/rtti.hxx"
#include "vcl/dllapi.h"
#include "vcl/impdel.hxx"
@@ -197,7 +196,7 @@ private:
public:
VclSimpleEvent( sal_uLong n ) { nId = n; }
- TYPEINFO();
+ virtual ~VclSimpleEvent();
sal_uLong GetId() const { return nId; }
};
@@ -210,7 +209,7 @@ private:
public:
VclWindowEvent( Window* pWin, sal_uLong n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
- TYPEINFO();
+ virtual ~VclWindowEvent();
Window* GetWindow() const { return pWindow; }
void* GetData() const { return pData; }
@@ -224,7 +223,6 @@ private:
public:
VclMouseEvent( Window* pWin, sal_uLong n, const MouseEvent& rEvent ) : VclWindowEvent( pWin, n ), aEvent(rEvent) { ; }
- TYPEINFO();
const MouseEvent& GetEvent() const { return aEvent; }
};
@@ -238,7 +236,7 @@ private:
public:
VclMenuEvent( Menu* pM, sal_uLong n, sal_uInt16 nPos ) : VclSimpleEvent(n) { pMenu = pM; mnPos = nPos; }
- TYPEINFO();
+ virtual ~VclMenuEvent();
Menu* GetMenu() const { return pMenu; }
sal_uInt16 GetItemPos() const { return mnPos; }
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6ea5efb76486..33dd296a08fd 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -34,10 +34,17 @@
#include <salbmp.hxx>
#include <salobj.hxx>
#include <salmenu.hxx>
+#include <vcl/apptypes.hxx>
// this file contains the virtual destructors of the sal interface
// compilers ususally put their vtables where the destructor is
+ApplicationProperty::~ApplicationProperty()
+{
+}
+
+// -----------------------------------------------------------------------
+
SalFrame::~SalFrame()
{
}
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 62e344c5c3db..e0e1a6826fb2 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -2076,10 +2076,6 @@ sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled )
// MT: AppProperty, AppEvent was in oldsv.cxx, but is still needed...
// ------------------------------------------------------------------------
-TYPEINIT0(ApplicationProperty)
-
-// ------------------------------------------------------------------------
-
static PropertyHandler* pHandler=NULL;
void Application::Property( ApplicationProperty& rProp )
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index 856d15be8462..be54b40f032e 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -33,9 +33,9 @@
using ::com::sun::star::uno::Reference;
using ::com::sun::star::accessibility::XAccessible;
-TYPEINIT0(VclSimpleEvent);
-TYPEINIT1(VclWindowEvent, VclSimpleEvent);
-TYPEINIT1(VclMenuEvent, VclSimpleEvent);
+VclSimpleEvent::~VclSimpleEvent() {}
+VclWindowEvent::~VclWindowEvent() {}
+VclMenuEvent::~VclMenuEvent() {}
VclAccessibleEvent::VclAccessibleEvent( sal_uLong n, const Reference<XAccessible>& rxAccessible ) :
VclSimpleEvent(n),
@@ -57,7 +57,7 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
// Copy the list, because this can be destroyed when calling a Link...
std::list<Link> aCopy( *this );
std::list<Link>::iterator aIter( aCopy.begin() );
- if( pEvent->IsA( VclWindowEvent::StaticType() ) )
+ if( dynamic_cast< VclWindowEvent* >(pEvent) )
{
VclWindowEvent* pWinEvent = static_cast<VclWindowEvent*>(pEvent);
ImplDelData aDel( pWinEvent->GetWindow() );
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index aca65054412c..23f948bf26f6 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -24,28 +24,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
#include <tools/debug.hxx>
-
#include <tools/rc.h>
-
#include <vcl/svapp.hxx>
#include <vcl/sound.hxx>
#include <vcl/event.hxx>
#include <vcl/field.hxx>
#include <vcl/unohelp.hxx>
-
#include <svdata.hxx>
-
#include <i18npool/mslangid.hxx>
-
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/i18n/XCharacterClassification.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
-
-
#include <unotools/localedatawrapper.hxx>
#include <unotools/calendarwrapper.hxx>
#include <unotools/charclass.hxx>
#include <unotools/misccfg.hxx>
+#include <memory.h>
using namespace ::com::sun::star;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 614ea854162f..e5633e5d4929 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -996,7 +996,7 @@ IMPL_LINK( TabControl, ImplListBoxSelectHdl, ListBox*, EMPTYARG )
IMPL_LINK( TabControl, ImplWindowEventListener, VclSimpleEvent*, pEvent )
{
- if ( pEvent && pEvent->ISA( VclWindowEvent ) && (pEvent->GetId() == VCLEVENT_WINDOW_KEYINPUT) )
+ if ( pEvent && dynamic_cast< VclWindowEvent* >(pEvent) && (pEvent->GetId() == VCLEVENT_WINDOW_KEYINPUT) )
{
VclWindowEvent* pWindowEvent = static_cast< VclWindowEvent* >(pEvent);
// Do not handle events from TabControl or it's children, which is done in Notify(), where the events can be consumed.
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index aa8d6192a4db..027c016a004b 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -90,8 +90,14 @@ const Bitmap& AlphaMask::ImplGetBitmap() const
void AlphaMask::ImplSetBitmap( const Bitmap& rBitmap )
{
- DBG_ASSERT( ( 8 == rBitmap.GetBitCount() ) && rBitmap.HasGreyPalette(), "AlphaMask::ImplSetBitmap: invalid bitmap" );
*(Bitmap*) this = rBitmap;
+
+#ifdef DBG_UTIL
+ if((8 != rBitmap.GetBitCount()) || !rBitmap.HasGreyPalette())
+ {
+ OSL_ENSURE(false, "AlphaMask::ImplSetBitmap: invalid bitmap");
+ }
+#endif
}
// -----------------------------------------------------------------------------
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index dcc11a8878b5..9698e53d12f6 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -906,13 +906,10 @@ sal_Bool Bitmap::ImplConvertGhosted()
sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
{
- bool bRetval(false);
-
#ifdef DBG_UTIL
// #121233# allow to test the different scalers in debug build with source
// level debugger (change nNumber to desired action)
static sal_uInt16 nNumber(0);
- const sal_uInt16 nStartCount(GetBitCount());
switch(nNumber)
{
@@ -932,7 +929,7 @@ sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong
if(basegfx::fTools::equalZero(rScaleX) && basegfx::fTools::equalZero(rScaleY))
{
// no scale
- bRetval = true;
+ return true;
}
else
{
@@ -952,17 +949,17 @@ sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong
default:
case BMP_SCALE_NONE :
{
- bRetval = false;
+ return false;
break;
}
case BMP_SCALE_FAST :
{
- bRetval = ImplScaleFast( rScaleX, rScaleY );
+ return ImplScaleFast( rScaleX, rScaleY );
break;
}
case BMP_SCALE_INTERPOLATE :
{
- bRetval = ImplScaleInterpolate( rScaleX, rScaleY );
+ return ImplScaleInterpolate( rScaleX, rScaleY );
break;
}
case BMP_SCALE_SUPER :
@@ -970,12 +967,12 @@ sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong
if(GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
{
// fallback to ImplScaleFast
- bRetval = ImplScaleFast( rScaleX, rScaleY );
+ return ImplScaleFast( rScaleX, rScaleY );
}
else
{
// #121233# use method from symphony
- bRetval = ImplScaleSuper( rScaleX, rScaleY );
+ return ImplScaleSuper( rScaleX, rScaleY );
}
break;
}
@@ -983,41 +980,35 @@ sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong
{
const Lanczos3Kernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel);
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel);
break;
}
case BMP_SCALE_BICUBIC :
{
const BicubicKernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel );
break;
}
case BMP_SCALE_BILINEAR :
{
const BilinearKernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel );
break;
}
case BMP_SCALE_BOX :
{
const BoxKernel kernel;
- bRetval = ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel );
break;
}
}
}
-#ifdef DBG_UTIL
- if(bRetval && nStartCount != GetBitCount())
- {
- OSL_ENSURE(false, "Bitmap::Scale has changed the ColorDepth, this should *not* happen (!)");
- }
-#endif
-
- return bRetval;
+ // should not happen
+ return false;
}
// ------------------------------------------------------------------------
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 1a518dbd09f2..dbc4a557194c 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -160,11 +160,19 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
aMask.Scale(rBmp.GetSizePixel());
}
+ if( !!aMask && aMask.GetBitCount() > 8 )
+ {
+ OSL_TRACE("BitmapEx: forced alpha to 8bit grey");
+ aMask.Convert(BMP_CONVERSION_8BIT_GREYS);
+ }
+
// #i75531# the workaround below can go when
// X11SalGraphics::drawAlphaBitmap()'s render acceleration
// can handle the bitmap depth mismatch directly
if( aBitmap.GetBitCount() < aMask.GetBitCount() )
+ {
aBitmap.Convert( BMP_CONVERSION_24BIT );
+ }
}
// ------------------------------------------------------------------
diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 5cd4bcfa2e0f..64ec186536d4 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -677,8 +677,12 @@ bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer,
const BitmapBuffer& rMskBuffer )
{
- //DBG_ASSERT( rMskBuffer.mnFormat == MSKFMT, "FastBmp BlendImage: wrong MSKFMT" );
- DBG_ASSERT( rMskBuffer.mnFormat == BMP_FORMAT_8BIT_PAL, "FastBmp BlendImage: unusual MSKFMT" );
+#ifdef DBG_UTIL
+ if(rMskBuffer.mnFormat != BMP_FORMAT_8BIT_PAL && rMskBuffer.mnFormat != BMP_FORMAT_8BIT_TC_MASK)
+ {
+ OSL_ENSURE(false, "FastBmp BlendImage: unusual MSKFMT");
+ }
+#endif
const int nSrcLinestep = rSrcBuffer.mnScanlineSize;
int nMskLinestep = rMskBuffer.mnScanlineSize;
diff --git a/vcl/source/gdi/extoutdevdata.cxx b/vcl/source/gdi/extoutdevdata.cxx
index f2ec859eaa05..08f0b46c4d42 100644
--- a/vcl/source/gdi/extoutdevdata.cxx
+++ b/vcl/source/gdi/extoutdevdata.cxx
@@ -24,12 +24,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
#include <vcl/extoutdevdata.hxx>
-#include <tools/rtti.hxx>
namespace vcl
{
-TYPEINIT0(ExtOutDevData);
ExtOutDevData::~ExtOutDevData()
{
}
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index ed3a68669ecf..d4a6d2774f39 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -35,6 +35,7 @@
#include <vcl/gfxlink.hxx>
#include <vcl/cvtgrf.hxx>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <memory.h>
// -----------
// - GfxLink -
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 55477d3b4b89..8e6b0be676ad 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -203,10 +203,6 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const UniString* pText,
// - Graphic -
// -----------
-TYPEINIT1_AUTOFACTORY( Graphic, SvDataCopyStream );
-
-// ------------------------------------------------------------------------
-
Graphic::Graphic()
{
mpImpGraphic = new ImpGraphic;
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index c33e1e7447ad..7850828cc9bb 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -19,19 +19,14 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
#include <tools/debug.hxx>
#include <tools/stream.hxx>
-
#include <rtl/alloc.h>
-
#include <vcl/jobset.hxx>
-
#include <jobset.h>
+#include <memory.h>
// =======================================================================
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index a57da0cde9ca..baf1e4b03923 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -2023,9 +2023,12 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
BitmapReadAccess* pP = ( (Bitmap&) rBmp ).AcquireReadAccess();
BitmapReadAccess* pA = ( (AlphaMask&) rAlpha ).AcquireReadAccess();
- DBG_ASSERT( pA->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ||
- pA->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK,
- "OutputDevice::ImplDrawAlpha(): non-8bit alpha no longer supported!" );
+#ifdef DBG_UTIL
+ if(pA->GetScanlineFormat() != BMP_FORMAT_8BIT_PAL && pA->GetScanlineFormat() != BMP_FORMAT_8BIT_TC_MASK)
+ {
+ OSL_ENSURE(false, "OutputDevice::ImplDrawAlpha(): non-8bit alpha no longer supported!");
+ }
+#endif
// #i38887# reading from screen may sometimes fail
if( aBmp.ImplGetImpBitmap() )
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index f8b329549aad..457210a07296 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -2248,10 +2248,29 @@ long* OutputDevice::LogicToLogic( long* pX, sal_uInt16 nCount,
// -----------------------------------------------------------------------
+#ifdef DBG_UTIL
+void CheckMapUnitsForStatic(MapUnit aMapA, MapUnit aMapB)
+{
+ if(aMapA != aMapB)
+ {
+ if((MAP_PIXEL == aMapA && MAP_PIXEL != aMapB) || (MAP_PIXEL != aMapA && MAP_PIXEL == aMapB))
+ {
+ OSL_ENSURE(false, \
+ "Caution: When using the static LogicToLogic methods to convert between pixels and logic sizes,/n\
+ not the correct system DPI is used, but a DPI of 75 is guessed. To use the correct DPI, use e.g./n\
+ the OutputDevice from Application::GetDefaultDevice() (!)");
+ }
+ }
+}
+#endif
+
Point OutputDevice::LogicToLogic( const Point& rPtSource,
const MapMode& rMapModeSource,
const MapMode& rMapModeDest )
{
+#ifdef DBG_UTIL
+ CheckMapUnitsForStatic(rMapModeSource.GetMapUnit(), rMapModeDest.GetMapUnit());
+#endif
if ( rMapModeSource == rMapModeDest )
return rPtSource;
@@ -2288,6 +2307,9 @@ Size OutputDevice::LogicToLogic( const Size& rSzSource,
const MapMode& rMapModeSource,
const MapMode& rMapModeDest )
{
+#ifdef DBG_UTIL
+ CheckMapUnitsForStatic(rMapModeSource.GetMapUnit(), rMapModeDest.GetMapUnit());
+#endif
if ( rMapModeSource == rMapModeDest )
return rSzSource;
@@ -2322,6 +2344,9 @@ basegfx::B2DPolygon OutputDevice::LogicToLogic( const basegfx::B2DPolygon& rPoly
const MapMode& rMapModeSource,
const MapMode& rMapModeDest )
{
+#ifdef DBG_UTIL
+ CheckMapUnitsForStatic(rMapModeSource.GetMapUnit(), rMapModeDest.GetMapUnit());
+#endif
if ( rMapModeSource == rMapModeDest )
return rPolySource;
@@ -2367,6 +2392,9 @@ basegfx::B2DPolyPolygon OutputDevice::LogicToLogic( const basegfx::B2DPolyPolygo
const MapMode& rMapModeSource,
const MapMode& rMapModeDest )
{
+#ifdef DBG_UTIL
+ CheckMapUnitsForStatic(rMapModeSource.GetMapUnit(), rMapModeDest.GetMapUnit());
+#endif
if ( rMapModeSource == rMapModeDest )
return rPolySource;
@@ -2412,6 +2440,9 @@ Rectangle OutputDevice::LogicToLogic( const Rectangle& rRectSource,
const MapMode& rMapModeSource,
const MapMode& rMapModeDest )
{
+#ifdef DBG_UTIL
+ CheckMapUnitsForStatic(rMapModeSource.GetMapUnit(), rMapModeDest.GetMapUnit());
+#endif
if ( rMapModeSource == rMapModeDest )
return rRectSource;
@@ -2460,6 +2491,9 @@ long OutputDevice::LogicToLogic( long nLongSource,
if ( eUnitSource == eUnitDest )
return nLongSource;
+#ifdef DBG_UTIL
+ CheckMapUnitsForStatic(eUnitSource, eUnitDest);
+#endif
ENTER2( eUnitSource, eUnitDest );
ENTER3( eUnitSource, eUnitDest );
@@ -2468,6 +2502,68 @@ long OutputDevice::LogicToLogic( long nLongSource,
// -----------------------------------------------------------------------
+basegfx::B2DHomMatrix OutputDevice::GetTransformLogicToLogic(const MapMode& rMapModeSource, const MapMode& rMapModeDest) const
+{
+ basegfx::B2DHomMatrix aRetval;
+
+ if(rMapModeSource != rMapModeDest)
+ {
+ // GetViewTransformation converts from unit to pixel, thus it's [inv(rMapModeDest) * rMapModeSource]
+ // read right to left
+ aRetval = GetViewTransformation(rMapModeDest);
+ aRetval.invert();
+ aRetval = aRetval * GetViewTransformation(rMapModeSource);
+ }
+
+ return aRetval;
+}
+
+// -----------------------------------------------------------------------
+
+double OutputDevice::GetFactorLogicToLogic(MapUnit eUnitSource, MapUnit eUnitDest)
+{
+#ifdef DBG_UTIL
+ CheckMapUnitsForStatic(eUnitSource, eUnitDest);
+#endif
+ if ( eUnitSource == eUnitDest )
+ return 1.0;
+
+ ENTER2( eUnitSource, eUnitDest );
+ ENTER3( eUnitSource, eUnitDest );
+
+ return (double)nNumerator / (double)nDenominator;
+}
+
+// -----------------------------------------------------------------------
+
+basegfx::B2DRange OutputDevice::GetLogicRange() const
+{
+ return GetInverseViewTransformation() * GetDiscreteRange();
+}
+
+// -----------------------------------------------------------------------
+
+basegfx::B2DVector OutputDevice::GetLogicVector() const
+{
+ return GetInverseViewTransformation() * GetDiscreteVector();
+}
+
+// -----------------------------------------------------------------------
+
+basegfx::B2DRange OutputDevice::GetDiscreteRange() const
+{
+ return basegfx::B2DRange(0.0, 0.0, GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
+}
+
+// -----------------------------------------------------------------------
+
+basegfx::B2DVector OutputDevice::GetDiscreteVector() const
+{
+ return basegfx::B2DVector(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
+}
+
+// -----------------------------------------------------------------------
+
void OutputDevice::SetPixelOffset( const Size& rOffset )
{
mnOutOffOrigX = rOffset.Width();
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index bef4a306a82d..4bda8d4d5b60 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -501,7 +501,6 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
return bRet;
}
-TYPEINIT1(PDFExtOutDevData,ExtOutDevData);
PDFExtOutDevData::PDFExtOutDevData( const OutputDevice& rOutDev ) :
mrOutDev ( rOutDev ),
mbTaggedPDF ( sal_False ),
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 0209becd2710..d9d3efd45ad5 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -19,15 +19,11 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
#include <tools/debug.hxx>
-
#include <unotools/localedatawrapper.hxx>
-
#include <vcl/i18nhelp.hxx>
#include <vcl/unohelp.hxx>
#include <vcl/timer.hxx>
@@ -54,6 +50,7 @@
#include <brdwin.hxx>
#include <salgdi.hxx>
#include <dndlcon.hxx>
+#include <memory.h>
#include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
#include <com/sun/star/awt/MouseEvent.hpp>
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index e390a24ddd4a..921b19fb9608 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -26,10 +26,9 @@
#include "vcl/jobdata.hxx"
#include "vcl/printerinfomanager.hxx"
-
#include "tools/stream.hxx"
-
#include "sal/alloca.h"
+#include <memory.h>
using namespace psp;
using namespace rtl;
diff --git a/xmloff/inc/EnhancedCustomShapeToken.hxx b/xmloff/inc/EnhancedCustomShapeToken.hxx
index 716bf0f86861..9ad6e238d331 100644
--- a/xmloff/inc/EnhancedCustomShapeToken.hxx
+++ b/xmloff/inc/EnhancedCustomShapeToken.hxx
@@ -92,8 +92,11 @@ namespace xmloff { namespace EnhancedCustomShapeToken {
EAS_CustomShapeEngine,
EAS_CustomShapeData,
EAS_Type,
+
+ // TTTT: MirrorX/Y removed, but still used at import and for EnhancedCustomShapeHandle
EAS_MirroredX,
EAS_MirroredY,
+
EAS_ViewBox,
EAS_TextRotateAngle,
EAS_ExtrusionAllowed,
diff --git a/xmloff/inc/PageMasterImportContext.hxx b/xmloff/inc/PageMasterImportContext.hxx
index a18d39a3d542..092fdaa90b79 100644
--- a/xmloff/inc/PageMasterImportContext.hxx
+++ b/xmloff/inc/PageMasterImportContext.hxx
@@ -38,8 +38,6 @@ protected:
public:
- TYPEINFO();
-
PageStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
diff --git a/xmloff/inc/XMLBackgroundImageContext.hxx b/xmloff/inc/XMLBackgroundImageContext.hxx
index e8f726a6f03a..46f80d43236f 100644
--- a/xmloff/inc/XMLBackgroundImageContext.hxx
+++ b/xmloff/inc/XMLBackgroundImageContext.hxx
@@ -50,8 +50,6 @@ private:
::com::sun::star::xml::sax::XAttributeList > & xAttrList );
public:
- TYPEINFO();
-
XMLBackgroundImageContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/XMLChartStyleContext.hxx b/xmloff/inc/XMLChartStyleContext.hxx
index 22185041ca46..93b089defca2 100644
--- a/xmloff/inc/XMLChartStyleContext.hxx
+++ b/xmloff/inc/XMLChartStyleContext.hxx
@@ -39,8 +39,6 @@ protected:
const ::rtl::OUString& rValue );
public:
- TYPEINFO();
-
XMLChartStyleContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
diff --git a/xmloff/inc/XMLElementPropertyContext.hxx b/xmloff/inc/XMLElementPropertyContext.hxx
index 9dc9967fd394..91b68d1492db 100644
--- a/xmloff/inc/XMLElementPropertyContext.hxx
+++ b/xmloff/inc/XMLElementPropertyContext.hxx
@@ -47,8 +47,6 @@ protected:
void SetInsert( sal_Bool bIns ) { bInsert = bIns; }
public:
- TYPEINFO();
-
XMLElementPropertyContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const XMLPropertyState& rProp,
diff --git a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx
index 74087c685b66..2b5f853bf129 100644
--- a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx
+++ b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx
@@ -42,8 +42,6 @@ class XMLEmbeddedObjectImportContext : public SvXMLImportContext
::rtl::OUString sCLSID;
public:
- TYPEINFO();
-
const ::rtl::OUString& GetFilterServiceName() const { return sFilterService; }
// #100592#
const ::rtl::OUString& GetFilterCLSID() const { return sCLSID; }
diff --git a/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx
index 97ab879bb6f7..cec3274b43a5 100644
--- a/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx
+++ b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx
@@ -70,8 +70,6 @@ class XMLFootnoteConfigurationImportContext : public SvXMLStyleContext
public:
- TYPEINFO();
-
XMLFootnoteConfigurationImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/XMLImageMapContext.hxx b/xmloff/inc/XMLImageMapContext.hxx
index 330883578b48..a263ea52c65b 100644
--- a/xmloff/inc/XMLImageMapContext.hxx
+++ b/xmloff/inc/XMLImageMapContext.hxx
@@ -49,8 +49,6 @@ class XMLImageMapContext : public SvXMLImportContext
::com::sun::star::beans::XPropertySet> xPropertySet;
public:
- TYPEINFO();
-
XMLImageMapContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx b/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx
index 99edc7cb94fd..48b25a20fd2f 100644
--- a/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx
+++ b/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx
@@ -69,8 +69,6 @@ class XMLIndexBibliographyConfigurationContext : public SvXMLStyleContext
public:
- TYPEINFO();
-
XMLIndexBibliographyConfigurationContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/XMLLineNumberingImportContext.hxx b/xmloff/inc/XMLLineNumberingImportContext.hxx
index 818b99c31466..f955be708245 100644
--- a/xmloff/inc/XMLLineNumberingImportContext.hxx
+++ b/xmloff/inc/XMLLineNumberingImportContext.hxx
@@ -81,8 +81,6 @@ class XMLLineNumberingImportContext : public SvXMLStyleContext
public:
- TYPEINFO();
-
XMLLineNumberingImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/XMLNumberStylesImport.hxx b/xmloff/inc/XMLNumberStylesImport.hxx
index c7ba42536653..78e026505189 100644
--- a/xmloff/inc/XMLNumberStylesImport.hxx
+++ b/xmloff/inc/XMLNumberStylesImport.hxx
@@ -53,8 +53,6 @@ protected:
void add( rtl::OUString& rNumberStyle, sal_Bool bLong, sal_Bool bTextual, sal_Bool bDecimal02, rtl::OUString& rText );
public:
- TYPEINFO();
-
SdXMLNumberFormatImportContext( SdXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
diff --git a/xmloff/inc/XMLReplacementImageContext.hxx b/xmloff/inc/XMLReplacementImageContext.hxx
index 7608da74bdd3..6fcc310a06f0 100644
--- a/xmloff/inc/XMLReplacementImageContext.hxx
+++ b/xmloff/inc/XMLReplacementImageContext.hxx
@@ -44,8 +44,6 @@ class XMLReplacementImageContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLReplacementImageContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
diff --git a/xmloff/inc/XMLShapePropertySetContext.hxx b/xmloff/inc/XMLShapePropertySetContext.hxx
index f9b4f48a46be..b65a4fe4497f 100644
--- a/xmloff/inc/XMLShapePropertySetContext.hxx
+++ b/xmloff/inc/XMLShapePropertySetContext.hxx
@@ -33,8 +33,6 @@ class XMLShapePropertySetContext : public SvXMLPropertySetContext
public:
- TYPEINFO();
-
XMLShapePropertySetContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/XMLStringBufferImportContext.hxx b/xmloff/inc/XMLStringBufferImportContext.hxx
index ed325e126580..fa9513a8ffef 100644
--- a/xmloff/inc/XMLStringBufferImportContext.hxx
+++ b/xmloff/inc/XMLStringBufferImportContext.hxx
@@ -42,8 +42,6 @@ class XMLStringBufferImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLStringBufferImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/inc/XMLTextColumnsContext.hxx b/xmloff/inc/XMLTextColumnsContext.hxx
index 39e5936818fc..8461a43651dc 100644
--- a/xmloff/inc/XMLTextColumnsContext.hxx
+++ b/xmloff/inc/XMLTextColumnsContext.hxx
@@ -52,8 +52,6 @@ class XMLTextColumnsContext :public XMLElementPropertyContext
sal_Int32 nAutomaticDistance;
public:
- TYPEINFO();
-
XMLTextColumnsContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
diff --git a/xmloff/inc/XMLTextHeaderFooterContext.hxx b/xmloff/inc/XMLTextHeaderFooterContext.hxx
index a1cd7410d74f..f72cd14806a6 100644
--- a/xmloff/inc/XMLTextHeaderFooterContext.hxx
+++ b/xmloff/inc/XMLTextHeaderFooterContext.hxx
@@ -49,8 +49,6 @@ class XMLTextHeaderFooterContext: public SvXMLImportContext
sal_Bool bLeft : 1;
public:
- TYPEINFO();
-
XMLTextHeaderFooterContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/animationimport.hxx b/xmloff/inc/animationimport.hxx
index 783ac6ff5a05..8d7bff49d81b 100644
--- a/xmloff/inc/animationimport.hxx
+++ b/xmloff/inc/animationimport.hxx
@@ -43,8 +43,6 @@ class AnimationNodeContext : public SvXMLImportContext
void init_node( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
public:
- TYPEINFO();
-
AnimationNodeContext(
const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xParentNode,
SvXMLImport& rImport,
diff --git a/xmloff/inc/animimp.hxx b/xmloff/inc/animimp.hxx
index 6721cf1c0cf3..cd2219b7b17d 100644
--- a/xmloff/inc/animimp.hxx
+++ b/xmloff/inc/animimp.hxx
@@ -37,8 +37,6 @@ class XMLAnimationsContext : public SvXMLImportContext
AnimImpImpl* mpImpl;
public:
- TYPEINFO();
-
XMLAnimationsContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
diff --git a/xmloff/inc/pch/precompiled_xmloff.hxx b/xmloff/inc/pch/precompiled_xmloff.hxx
index e8baac07b071..9a5b93c02371 100644
--- a/xmloff/inc/pch/precompiled_xmloff.hxx
+++ b/xmloff/inc/pch/precompiled_xmloff.hxx
@@ -448,7 +448,6 @@
#include "tools/inetdef.hxx"
#include "tools/list.hxx"
#include "tools/ref.hxx"
-#include "tools/rtti.hxx"
#include "tools/solar.h"
#include "tools/string.hxx"
#include "tools/time.hxx"
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 9da410f4b225..569dcc5ecfd4 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -146,8 +146,6 @@ protected:
public:
- TYPEINFO();
-
XMLTextFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -229,8 +227,6 @@ protected:
public:
- TYPEINFO();
-
XMLSenderFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -268,8 +264,6 @@ class XMLAuthorFieldImportContext : public XMLSenderFieldImportContext
public:
- TYPEINFO();
-
XMLAuthorFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -307,8 +301,6 @@ class XMLPlaceholderFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLPlaceholderFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -352,8 +344,6 @@ protected:
public:
- TYPEINFO();
-
XMLTimeFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -378,8 +368,6 @@ class XMLDateFieldImportContext : public XMLTimeFieldImportContext
public:
- TYPEINFO();
-
XMLDateFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -406,8 +394,6 @@ class XMLPageContinuationImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLPageContinuationImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -442,8 +428,6 @@ class XMLPageNumberImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLPageNumberImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -498,8 +482,6 @@ protected:
public:
-TYPEINFO();
-
/// process attribute values
virtual void ProcessAttribute( sal_uInt16 nAttrToken,
const ::rtl::OUString& sAttrValue );
@@ -522,8 +504,6 @@ class XMLDatabaseNameImportContext : public XMLDatabaseFieldImportContext
{
public:
- TYPEINFO();
-
XMLDatabaseNameImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -554,8 +534,6 @@ protected:
public:
- TYPEINFO();
-
XMLDatabaseNextImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -582,8 +560,6 @@ class XMLDatabaseSelectImportContext : public XMLDatabaseNextImportContext
public:
- TYPEINFO();
-
XMLDatabaseSelectImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -612,8 +588,6 @@ class XMLDatabaseNumberImportContext : public XMLDatabaseFieldImportContext
public:
- TYPEINFO();
-
XMLDatabaseNumberImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -645,8 +619,6 @@ protected:
public:
- TYPEINFO();
-
XMLSimpleDocInfoImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -686,8 +658,6 @@ class XMLDateTimeDocInfoImportContext : public XMLSimpleDocInfoImportContext
public:
- TYPEINFO();
-
XMLDateTimeDocInfoImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -715,8 +685,6 @@ class XMLRevisionDocInfoImportContext : public XMLSimpleDocInfoImportContext
public:
- TYPEINFO();
-
XMLRevisionDocInfoImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -746,8 +714,6 @@ class XMLUserDocInfoImportContext : public XMLSimpleDocInfoImportContext
public:
- TYPEINFO();
-
XMLUserDocInfoImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -777,8 +743,6 @@ class XMLHiddenParagraphImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLHiddenParagraphImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -818,8 +782,6 @@ class XMLConditionalTextImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLConditionalTextImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -855,8 +817,6 @@ class XMLHiddenTextImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLHiddenTextImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -888,8 +848,6 @@ class XMLFileNameImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLFileNameImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -918,8 +876,6 @@ class XMLTemplateNameImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLTemplateNameImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -949,8 +905,6 @@ class XMLChapterImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLChapterImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -982,8 +936,6 @@ class XMLCountFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLCountFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1017,8 +969,6 @@ class XMLPageVarGetFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLPageVarGetFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1048,8 +998,6 @@ class XMLPageVarSetFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLPageVarSetFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1087,8 +1035,6 @@ class XMLMacroFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLMacroFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1135,8 +1081,6 @@ class XMLReferenceFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLReferenceFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nToken,
@@ -1170,8 +1114,6 @@ class XMLDdeFieldDeclsImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLDdeFieldDeclsImportContext(SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& sLocalName);
@@ -1200,8 +1142,6 @@ class XMLDdeFieldDeclImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLDdeFieldDeclImportContext(SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& sLocalName,
@@ -1222,8 +1162,6 @@ class XMLDdeFieldImportContext : public XMLTextFieldImportContext
::rtl::OUString sPropertyContent;
public:
- TYPEINFO();
-
XMLDdeFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1252,8 +1190,6 @@ class XMLSheetNameImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLSheetNameImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1285,8 +1221,6 @@ class XMLUrlFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLUrlFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1314,8 +1248,6 @@ class XMLBibliographyFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLBibliographyFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1360,8 +1292,6 @@ class XMLAnnotationImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLAnnotationImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1403,8 +1333,6 @@ class XMLScriptImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLScriptImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1428,8 +1356,6 @@ class XMLMeasureFieldImportContext : public XMLTextFieldImportContext
sal_Int16 mnKind;
public:
- TYPEINFO();
-
XMLMeasureFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1467,8 +1393,6 @@ class XMLDropDownFieldImportContext : public XMLTextFieldImportContext
const rtl::OUString sPropertyToolTip;
public:
- TYPEINFO();
-
XMLDropDownFieldImportContext(SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
@@ -1495,8 +1419,6 @@ protected:
class XMLHeaderFieldImportContext : public XMLTextFieldImportContext
{
public:
- TYPEINFO();
-
XMLHeaderFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -1517,8 +1439,6 @@ public:
class XMLFooterFieldImportContext : public XMLTextFieldImportContext
{
public:
- TYPEINFO();
-
XMLFooterFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -1539,8 +1459,6 @@ public:
class XMLDateTimeFieldImportContext : public XMLTextFieldImportContext
{
public:
- TYPEINFO();
-
XMLDateTimeFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -1566,8 +1484,6 @@ class XMLCustomPropertyFieldImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLCustomPropertyFieldImportContext (SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/txtvfldi.hxx b/xmloff/inc/txtvfldi.hxx
index 3a8f2bcfd154..05f737773b75 100644
--- a/xmloff/inc/txtvfldi.hxx
+++ b/xmloff/inc/txtvfldi.hxx
@@ -176,8 +176,6 @@ private:
public:
- TYPEINFO();
-
XMLVarFieldImportContext(
// for XMLTextFieldImportContext:
SvXMLImport& rImport, /// XML Import
@@ -227,8 +225,6 @@ class XMLVariableGetFieldImportContext : public XMLVarFieldImportContext
public:
- TYPEINFO();
-
XMLVariableGetFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -252,8 +248,6 @@ class XMLExpressionFieldImportContext : public XMLVarFieldImportContext
public:
- TYPEINFO();
-
XMLExpressionFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -273,8 +267,6 @@ class XMLTextInputFieldImportContext : public XMLVarFieldImportContext
public:
- TYPEINFO();
-
XMLTextInputFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -302,8 +294,6 @@ class XMLSetVarFieldImportContext : public XMLVarFieldImportContext
public:
- TYPEINFO();
-
XMLSetVarFieldImportContext(
// for XMLTextFieldImportContext:
SvXMLImport& rImport, /// see XMLTextFieldImportContext
@@ -348,8 +338,6 @@ class XMLVariableSetFieldImportContext : public XMLSetVarFieldImportContext
public:
- TYPEINFO();
-
XMLVariableSetFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -373,8 +361,6 @@ class XMLVariableInputFieldImportContext : public XMLSetVarFieldImportContext
public:
- TYPEINFO();
-
XMLVariableInputFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -397,8 +383,6 @@ class XMLUserFieldImportContext : public XMLSetVarFieldImportContext
public:
- TYPEINFO();
-
XMLUserFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -412,8 +396,6 @@ class XMLUserFieldInputImportContext : public XMLVarFieldImportContext
public:
- TYPEINFO();
-
XMLUserFieldInputImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -442,8 +424,6 @@ class XMLSequenceFieldImportContext : public XMLSetVarFieldImportContext
public:
- TYPEINFO();
-
XMLSequenceFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -478,8 +458,6 @@ class XMLVariableDeclsImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLVariableDeclsImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// text import helper
@@ -513,8 +491,6 @@ class XMLVariableDeclImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLVariableDeclImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// text import helper
@@ -552,8 +528,6 @@ class XMLTableFormulaImportContext : public XMLTextFieldImportContext
public:
- TYPEINFO();
-
XMLTableFormulaImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// text import helper
@@ -593,8 +567,6 @@ class XMLDatabaseDisplayImportContext : public XMLDatabaseFieldImportContext
public:
- TYPEINFO();
-
XMLDatabaseDisplayImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// text import helper
diff --git a/xmloff/inc/xexptran.hxx b/xmloff/inc/xexptran.hxx
index b3998f206104..b1ac0307a5b9 100644
--- a/xmloff/inc/xexptran.hxx
+++ b/xmloff/inc/xexptran.hxx
@@ -144,13 +144,13 @@ public:
const SdXMLImExViewBox& rViewBox,
const com::sun::star::awt::Point& rObjectPos,
const com::sun::star::awt::Size& rObjectSize,
- // #96328#
- const bool bClosed = true);
+ const bool bClosed);
SdXMLImExPointsElement(const rtl::OUString& rNew,
const SdXMLImExViewBox& rViewBox,
const com::sun::star::awt::Point& rObjectPos,
const com::sun::star::awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv);
+ const SvXMLUnitConverter& rConv,
+ const bool bClosed);
const rtl::OUString& GetExportString() const { return msString; }
const com::sun::star::drawing::PointSequenceSequence& GetPointSequenceSequence() const { return maPoly; }
diff --git a/xmloff/inc/xmloff/XMLBase64ImportContext.hxx b/xmloff/inc/xmloff/XMLBase64ImportContext.hxx
index 15dc31fc4e24..9d0cb6f99342 100644
--- a/xmloff/inc/xmloff/XMLBase64ImportContext.hxx
+++ b/xmloff/inc/xmloff/XMLBase64ImportContext.hxx
@@ -39,8 +39,6 @@ class XMLOFF_DLLPUBLIC XMLBase64ImportContext : public SvXMLImportContext
::rtl::OUString sBase64CharsLeft;
public:
- TYPEINFO();
-
XMLBase64ImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/XMLCharContext.hxx b/xmloff/inc/xmloff/XMLCharContext.hxx
index e6e49342f6d9..a17987ebd51d 100644
--- a/xmloff/inc/xmloff/XMLCharContext.hxx
+++ b/xmloff/inc/xmloff/XMLCharContext.hxx
@@ -37,8 +37,6 @@ protected:
sal_Unicode m_c;
public:
- TYPEINFO();
-
XMLCharContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/xmloff/XMLEventsImportContext.hxx b/xmloff/inc/xmloff/XMLEventsImportContext.hxx
index 55e173b948d8..400bce12efd1 100644
--- a/xmloff/inc/xmloff/XMLEventsImportContext.hxx
+++ b/xmloff/inc/xmloff/XMLEventsImportContext.hxx
@@ -69,8 +69,6 @@ protected:
public:
- TYPEINFO();
-
XMLEventsImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/xmloff/XMLFontStylesContext.hxx b/xmloff/inc/xmloff/XMLFontStylesContext.hxx
index 2fe13471d0e5..77e06d046914 100644
--- a/xmloff/inc/xmloff/XMLFontStylesContext.hxx
+++ b/xmloff/inc/xmloff/XMLFontStylesContext.hxx
@@ -61,8 +61,6 @@ protected:
public:
- TYPEINFO();
-
XMLFontStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx b/xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx
index b31574ade69b..bcd8da698979 100644
--- a/xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx
+++ b/xmloff/inc/xmloff/XMLGraphicsDefaultStyle.hxx
@@ -36,8 +36,6 @@ namespace com { namespace sun { namespace star { namespace container
class XMLOFF_DLLPUBLIC XMLGraphicsDefaultStyle : public XMLPropStyleContext
{
public:
- TYPEINFO();
-
XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/XMLShapeStyleContext.hxx b/xmloff/inc/xmloff/XMLShapeStyleContext.hxx
index c29f65ba0212..6265d8ff3cdf 100644
--- a/xmloff/inc/xmloff/XMLShapeStyleContext.hxx
+++ b/xmloff/inc/xmloff/XMLShapeStyleContext.hxx
@@ -46,8 +46,6 @@ protected:
const ::rtl::OUString& rLocalName,
const ::rtl::OUString& rValue );
public:
- TYPEINFO();
-
XMLShapeStyleContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/inc/xmloff/XMLTextMasterPageContext.hxx b/xmloff/inc/xmloff/XMLTextMasterPageContext.hxx
index 63585a455346..df0f4d5e8545 100644
--- a/xmloff/inc/xmloff/XMLTextMasterPageContext.hxx
+++ b/xmloff/inc/xmloff/XMLTextMasterPageContext.hxx
@@ -61,8 +61,6 @@ protected:
::com::sun::star::style::XStyle > GetStyle() { return xStyle; }
public:
- TYPEINFO();
-
XMLTextMasterPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx b/xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx
index 812dc8f8d148..fd8920271df9 100644
--- a/xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx
+++ b/xmloff/inc/xmloff/XMLTextMasterStylesContext.hxx
@@ -44,8 +44,6 @@ protected:
virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const;
public:
- TYPEINFO();
-
XMLTextMasterStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx b/xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx
index 0b5dbb11bba3..c3b328f93fb2 100644
--- a/xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx
+++ b/xmloff/inc/xmloff/XMLTextShapeStyleContext.hxx
@@ -43,8 +43,6 @@ protected:
public:
- TYPEINFO();
-
XMLTextShapeStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/XMLTextTableContext.hxx b/xmloff/inc/xmloff/XMLTextTableContext.hxx
index df3330c67181..93814cdd3c68 100644
--- a/xmloff/inc/xmloff/XMLTextTableContext.hxx
+++ b/xmloff/inc/xmloff/XMLTextTableContext.hxx
@@ -41,8 +41,6 @@ class XMLOFF_DLLPUBLIC XMLTextTableContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLTextTableContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& rLName );
diff --git a/xmloff/inc/xmloff/formsimp.hxx b/xmloff/inc/xmloff/formsimp.hxx
index 2c32b5ef19cb..3c5ea03a5d36 100644
--- a/xmloff/inc/xmloff/formsimp.hxx
+++ b/xmloff/inc/xmloff/formsimp.hxx
@@ -32,8 +32,6 @@
class XMLFormsContext : public SvXMLImportContext
{
public:
- TYPEINFO();
-
XMLFormsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName);
virtual ~XMLFormsContext();
diff --git a/xmloff/inc/xmloff/prstylei.hxx b/xmloff/inc/xmloff/prstylei.hxx
index c592110256c7..ce4321644d24 100644
--- a/xmloff/inc/xmloff/prstylei.hxx
+++ b/xmloff/inc/xmloff/prstylei.hxx
@@ -68,8 +68,6 @@ protected:
public:
- TYPEINFO();
-
XMLPropStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
diff --git a/xmloff/inc/xmloff/shapeimport.hxx b/xmloff/inc/xmloff/shapeimport.hxx
index 8ac1c04dc094..5a783ec25ac8 100644
--- a/xmloff/inc/xmloff/shapeimport.hxx
+++ b/xmloff/inc/xmloff/shapeimport.hxx
@@ -260,8 +260,6 @@ public:
SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {}
- TYPEINFO();
-
const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; }
void setHyperlink( const ::rtl::OUString& rHyperlink );
diff --git a/xmloff/inc/xmloff/txtstyli.hxx b/xmloff/inc/xmloff/txtstyli.hxx
index a770b8692059..dda55e5120ce 100644
--- a/xmloff/inc/xmloff/txtstyli.hxx
+++ b/xmloff/inc/xmloff/txtstyli.hxx
@@ -69,8 +69,6 @@ protected:
public:
- TYPEINFO();
-
XMLTextStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/xmlcnitm.hxx b/xmloff/inc/xmloff/xmlcnitm.hxx
index d34f026411d2..dcaadeecd022 100644
--- a/xmloff/inc/xmloff/xmlcnitm.hxx
+++ b/xmloff/inc/xmloff/xmlcnitm.hxx
@@ -38,8 +38,6 @@ class SvXMLAttrContainerItem: public SfxPoolItem
SvXMLAttrContainerItem_Impl *pImpl;
public:
- TYPEINFO();
-
SvXMLAttrContainerItem( sal_uInt16 nWhich = 0 );
SvXMLAttrContainerItem( const SvXMLAttrContainerItem& );
virtual ~SvXMLAttrContainerItem();
diff --git a/xmloff/inc/xmloff/xmlictxt.hxx b/xmloff/inc/xmloff/xmlictxt.hxx
index 37a2a4e0567d..70c27891201a 100644
--- a/xmloff/inc/xmloff/xmlictxt.hxx
+++ b/xmloff/inc/xmloff/xmlictxt.hxx
@@ -31,7 +31,6 @@
#include <tools/solar.h>
#include <tools/ref.hxx>
#include <rtl/ustring.hxx>
-#include <tools/rtti.hxx>
class SvXMLNamespaceMap;
class SvXMLImport;
@@ -57,8 +56,6 @@ protected:
const SvXMLImport& GetImport() const { return mrImport; }
public:
- TYPEINFO();
-
sal_uInt16 GetPrefix() const { return mnPrefix; }
const ::rtl::OUString& GetLocalName() const { return maLocalName; }
diff --git a/xmloff/inc/xmloff/xmlmultiimagehelper.hxx b/xmloff/inc/xmloff/xmlmultiimagehelper.hxx
index ea5edc92fe1b..c7ce4bae7570 100644
--- a/xmloff/inc/xmloff/xmlmultiimagehelper.hxx
+++ b/xmloff/inc/xmloff/xmlmultiimagehelper.hxx
@@ -43,9 +43,8 @@ public:
~multiImageImportHelper();
/// solve multiple imported images. The most valuable one is choosen,
- /// see imlementation for evtl. changing weights and/or adding filetypes.
- /// returns the winner of the contest (which can be 0 when no candidates)
- const SvXMLImportContext* solveMultipleImages();
+ /// see imlementation for evtl. changing weights and/or adding filetypes
+ void solveMultipleImages();
/// add a content to the remembered image import contexts
void addContent(const SvXMLImportContext& rSvXMLImportContext);
diff --git a/xmloff/inc/xmloff/xmlnumi.hxx b/xmloff/inc/xmloff/xmlnumi.hxx
index 6fd2cb203bbb..a79ac3184cb7 100644
--- a/xmloff/inc/xmloff/xmlnumi.hxx
+++ b/xmloff/inc/xmloff/xmlnumi.hxx
@@ -57,8 +57,6 @@ protected:
public:
- TYPEINFO();
-
SvxXMLListStyleContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
diff --git a/xmloff/inc/xmloff/xmlstyle.hxx b/xmloff/inc/xmloff/xmlstyle.hxx
index 4a3d0a963c4a..dc60f9afeb11 100644
--- a/xmloff/inc/xmloff/xmlstyle.hxx
+++ b/xmloff/inc/xmloff/xmlstyle.hxx
@@ -28,7 +28,6 @@
#include "xmloff/dllapi.h"
#include "sal/types.h"
#include <rsc/rscsfx.hxx>
-#include <tools/rtti.hxx>
#include <xmloff/uniref.hxx>
#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmlictxt.hxx>
@@ -93,8 +92,6 @@ protected:
public:
- TYPEINFO();
-
SvXMLStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -214,8 +211,6 @@ protected:
virtual sal_Bool InsertStyleFamily( sal_uInt16 nFamily ) const;
public:
- TYPEINFO();
-
SvXMLStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 677438411171..057753e7c683 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -2243,8 +2243,9 @@ namespace xmloff { namespace token {
XML_ENGINE,
XML_ENHANCED_GEOMETRY,
XML_TEXT_ROTATE_ANGLE,
- XML_MIRROR_VERTICAL,
- XML_MIRROR_HORIZONTAL,
+ // TTTT: MirrorX/Y removed
+ //XML_MIRROR_VERTICAL,
+ //XML_MIRROR_HORIZONTAL,
XML_EXTRUSION_ALLOWED,
XML_TEXT_PATH_ALLOWED,
XML_CONCENTRIC_GRADIENT_FILL_ALLOWED,
diff --git a/xmloff/inc/xmltabi.hxx b/xmloff/inc/xmltabi.hxx
index 7716846e820e..ae86012fd2c3 100644
--- a/xmloff/inc/xmltabi.hxx
+++ b/xmloff/inc/xmltabi.hxx
@@ -40,8 +40,6 @@ private:
SvxXMLTabStopArray_Impl* mpTabStops;
public:
- TYPEINFO();
-
SvxXMLTabStopImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const XMLPropertyState& rProp,
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
index af15593582fd..f6efacc630d8 100644
--- a/xmloff/source/chart/SchXMLAxisContext.cxx
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -250,7 +250,7 @@ void SchXMLAxisContext::CreateGrid( OUString sAutoStyleName, bool bIsMajor )
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
m_rImportHelper.GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext* >(pStyle))
(( XMLPropStyleContext* )pStyle )->FillPropertySet( xGridProp );
}
}
@@ -498,7 +498,7 @@ void SchXMLAxisContext::CreateAxis()
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
m_rImportHelper.GetChartFamilyID(), m_aAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext* >(pStyle))
{
// note: SvXMLStyleContext::FillPropertySet is not const
XMLPropStyleContext * pPropStyleContext = const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle ));
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index eee2123d5a77..771f4d31688d 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -382,7 +382,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
mrImportHelper.GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext* >(pStyle))
(( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
}
}
@@ -1229,7 +1229,7 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
mrImportHelper.GetChartFamilyID(), msAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext* >(pStyle))
(( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
}
}
diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx
index bffc83b2470d..d5c94e62ca7d 100755
--- a/xmloff/source/chart/SchXMLLegendContext.cxx
+++ b/xmloff/source/chart/SchXMLLegendContext.cxx
@@ -215,7 +215,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
mrImportHelper.GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext* >(pStyle))
(( XMLPropStyleContext* )pStyle )->FillPropertySet( xLegendProps );
}
}
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 665b52bfdd9f..abe4ffc322dc 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -899,7 +899,7 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
mrImportHelper.GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext* >(pStyle))
(( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
}
}
@@ -971,7 +971,7 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
mrImportHelper.GetChartFamilyID(), sAutoStyleName );
- if( pStyle && pStyle->ISA( XMLPropStyleContext ))
+ if( pStyle && dynamic_cast< const XMLPropStyleContext* >(pStyle))
(( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
}
}
diff --git a/xmloff/source/chart/XMLChartPropertyContext.cxx b/xmloff/source/chart/XMLChartPropertyContext.cxx
index 6127cf2c4f76..ccedca59d391 100644
--- a/xmloff/source/chart/XMLChartPropertyContext.cxx
+++ b/xmloff/source/chart/XMLChartPropertyContext.cxx
@@ -29,8 +29,6 @@
#include "XMLSymbolImageContext.hxx"
#include "XMLLabelSeparatorContext.hxx"
-TYPEINIT1( XMLChartPropertyContext, SvXMLImportContext );
-
using namespace ::com::sun::star;
XMLChartPropertyContext::XMLChartPropertyContext(
diff --git a/xmloff/source/chart/XMLChartPropertyContext.hxx b/xmloff/source/chart/XMLChartPropertyContext.hxx
index bb001d1b0228..993075a3a6de 100644
--- a/xmloff/source/chart/XMLChartPropertyContext.hxx
+++ b/xmloff/source/chart/XMLChartPropertyContext.hxx
@@ -28,8 +28,6 @@
class XMLChartPropertyContext : public SvXMLPropertySetContext
{
public:
- TYPEINFO();
-
XMLChartPropertyContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
diff --git a/xmloff/source/chart/XMLChartStyleContext.cxx b/xmloff/source/chart/XMLChartStyleContext.cxx
index f1ac846443a2..7925e3b6672e 100644
--- a/xmloff/source/chart/XMLChartStyleContext.cxx
+++ b/xmloff/source/chart/XMLChartStyleContext.cxx
@@ -41,8 +41,6 @@ using ::xmloff::token::XML_GRAPHIC_PROPERTIES;
using ::xmloff::token::XML_CHART_PROPERTIES;
-TYPEINIT1( XMLChartStyleContext, XMLPropStyleContext );
-
// protected
void XMLChartStyleContext::SetAttribute(
diff --git a/xmloff/source/chart/XMLLabelSeparatorContext.cxx b/xmloff/source/chart/XMLLabelSeparatorContext.cxx
index 388256f3aeaa..5ce172fc3d70 100644
--- a/xmloff/source/chart/XMLLabelSeparatorContext.cxx
+++ b/xmloff/source/chart/XMLLabelSeparatorContext.cxx
@@ -32,8 +32,6 @@
#include <xmloff/xmlimp.hxx>
#include <xmloff/nmspmap.hxx>
-TYPEINIT1( XMLLabelSeparatorContext, XMLElementPropertyContext );
-
using namespace ::com::sun::star;
XMLLabelSeparatorContext::XMLLabelSeparatorContext(
diff --git a/xmloff/source/chart/XMLLabelSeparatorContext.hxx b/xmloff/source/chart/XMLLabelSeparatorContext.hxx
index 2e48ae1a3f99..a312d7e3444a 100644
--- a/xmloff/source/chart/XMLLabelSeparatorContext.hxx
+++ b/xmloff/source/chart/XMLLabelSeparatorContext.hxx
@@ -28,8 +28,6 @@
class XMLLabelSeparatorContext : public XMLElementPropertyContext
{
public:
- TYPEINFO();
-
XMLLabelSeparatorContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const XMLPropertyState& rProp,
diff --git a/xmloff/source/chart/XMLSymbolImageContext.cxx b/xmloff/source/chart/XMLSymbolImageContext.cxx
index 3a495de15a43..abbacf9e2f0e 100644
--- a/xmloff/source/chart/XMLSymbolImageContext.cxx
+++ b/xmloff/source/chart/XMLSymbolImageContext.cxx
@@ -32,8 +32,6 @@
#include <xmloff/XMLBase64ImportContext.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
-TYPEINIT1( XMLSymbolImageContext, XMLElementPropertyContext );
-
using namespace ::com::sun::star;
enum SvXMLTokenMapAttrs
diff --git a/xmloff/source/chart/XMLSymbolImageContext.hxx b/xmloff/source/chart/XMLSymbolImageContext.hxx
index 21329cb42c3c..160e025331ce 100644
--- a/xmloff/source/chart/XMLSymbolImageContext.hxx
+++ b/xmloff/source/chart/XMLSymbolImageContext.hxx
@@ -32,8 +32,6 @@ namespace com { namespace sun { namespace star {
class XMLSymbolImageContext : public XMLElementPropertyContext
{
public:
- TYPEINFO();
-
XMLSymbolImageContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const XMLPropertyState& rProp,
diff --git a/xmloff/source/chart/contexts.cxx b/xmloff/source/chart/contexts.cxx
index 1d509f017661..ec7a664b8610 100644
--- a/xmloff/source/chart/contexts.cxx
+++ b/xmloff/source/chart/contexts.cxx
@@ -97,8 +97,6 @@ SchXMLDocContext::SchXMLDocContext( SchXMLImportHelper& rImpHelper,
SchXMLDocContext::~SchXMLDocContext()
{}
-TYPEINIT1( SchXMLDocContext, SvXMLImportContext );
-
SvXMLImportContext* SchXMLDocContext::CreateChildContext(
sal_uInt16 nPrefix,
const ::rtl::OUString& rLocalName,
diff --git a/xmloff/source/chart/contexts.hxx b/xmloff/source/chart/contexts.hxx
index 1812c178f126..6fa0347155f8 100644
--- a/xmloff/source/chart/contexts.hxx
+++ b/xmloff/source/chart/contexts.hxx
@@ -55,8 +55,6 @@ public:
const rtl::OUString& rLName );
virtual ~SchXMLDocContext();
- TYPEINFO();
-
virtual SvXMLImportContext* CreateChildContext(
sal_uInt16 nPrefix,
const ::rtl::OUString& rLocalName,
diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx
index 46c1b3de26a0..c6da35f41e58 100644
--- a/xmloff/source/core/XMLBase64ImportContext.cxx
+++ b/xmloff/source/core/XMLBase64ImportContext.cxx
@@ -37,9 +37,6 @@ using namespace ::com::sun::star::io;
//-----------------------------------------------------------------------------
-TYPEINIT1( XMLBase64ImportContext, SvXMLImportContext );
-
-
XMLBase64ImportContext::XMLBase64ImportContext(
SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName,
const Reference< XAttributeList >&,
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index 5112b4c52beb..659a20242b77 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -86,8 +86,6 @@ class XMLEmbeddedObjectImportContext_Impl : public SvXMLImportContext
::com::sun::star::xml::sax::XDocumentHandler > xHandler;
public:
- TYPEINFO();
-
XMLEmbeddedObjectImportContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -106,8 +104,6 @@ public:
virtual void Characters( const ::rtl::OUString& rChars );
};
-TYPEINIT1( XMLEmbeddedObjectImportContext_Impl, SvXMLImportContext );
-
XMLEmbeddedObjectImportContext_Impl::XMLEmbeddedObjectImportContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -152,8 +148,6 @@ void XMLEmbeddedObjectImportContext_Impl::Characters( const OUString& rChars )
//-----------------------------------------------------------------------------
-TYPEINIT1( XMLEmbeddedObjectImportContext, SvXMLImportContext );
-
sal_Bool XMLEmbeddedObjectImportContext::SetComponent(
Reference< XComponent >& rComp )
{
diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx
index c35a134ea314..07c031d922fc 100644
--- a/xmloff/source/core/xmlictxt.cxx
+++ b/xmloff/source/core/xmlictxt.cxx
@@ -40,7 +40,6 @@ using ::rtl::OUStringBuffer;
using namespace ::com::sun::star;
DBG_NAME(SvXMLImportContext)
-TYPEINIT0( SvXMLImportContext );
SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
const OUString& rLName ) :
mrImport( rImp ),
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 34de3939969e..01cc7db3c490 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -807,7 +807,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
pContext = CreateContext( nPrefix, aLocalName, xAttrList );
if( (nPrefix & XML_NAMESPACE_UNKNOWN_FLAG) != 0 &&
- IS_TYPE( SvXMLImportContext, pContext ) )
+ ( pContext && typeid(SvXMLImportContext) == typeid(*pContext) )) // IS_TYPE( SvXMLImportContext, pContext ) )
{
OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "Root element unknown" ) );
Reference<xml::sax::XLocator> xDummyLocator;
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx b/xmloff/source/core/xmlmultiimagehelper.cxx
index 9accd4984575..9047ac9d125c 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -94,57 +94,44 @@ multiImageImportHelper::~multiImageImportHelper()
}
}
-const SvXMLImportContext* multiImageImportHelper::solveMultipleImages()
+void multiImageImportHelper::solveMultipleImages()
{
- const SvXMLImportContext* pRetval = 0;
-
- if(maImplContextVector.size())
+ if(maImplContextVector.size() > 1)
{
- if(maImplContextVector.size() > 1)
+ // multiple child contexts were imported, decide which is the most valuable one
+ // and remove the rest
+ sal_uInt32 nIndexOfPreferred(maImplContextVector.size());
+ sal_uInt32 nBestQuality(0), a(0);
+
+ for(a = 0; a < maImplContextVector.size(); a++)
{
- // multiple child contexts were imported, decide which is the most valuable one
- // and remove the rest
- sal_uInt32 nIndexOfPreferred(maImplContextVector.size());
- sal_uInt32 nBestQuality(0), a(0);
+ const rtl::OUString aStreamURL(getGraphicURLFromImportContext(**maImplContextVector[a]));
+ const sal_uInt32 nNewQuality(getQualityIndex(aStreamURL));
- for(a = 0; a < maImplContextVector.size(); a++)
+ if(nNewQuality > nBestQuality)
{
- const rtl::OUString aStreamURL(getGraphicURLFromImportContext(**maImplContextVector[a]));
- const sal_uInt32 nNewQuality(getQualityIndex(aStreamURL));
-
- if(nNewQuality > nBestQuality)
- {
- nBestQuality = nNewQuality;
- nIndexOfPreferred = a;
- }
+ nBestQuality = nNewQuality;
+ nIndexOfPreferred = a;
}
+ }
- // correct if needed, default is to use the last entry
- if(nIndexOfPreferred >= maImplContextVector.size())
- {
- nIndexOfPreferred = maImplContextVector.size() - 1;
- }
+ // correct if needed, default is to use the last entry
+ if(nIndexOfPreferred >= maImplContextVector.size())
+ {
+ nIndexOfPreferred = maImplContextVector.size() - 1;
+ }
- // get the winner
- pRetval = *maImplContextVector[nIndexOfPreferred];
+ // Take out the most valuable one
+ const std::vector< SvXMLImportContextRef* >::iterator aRemove(maImplContextVector.begin() + nIndexOfPreferred);
+ delete *aRemove;
+ maImplContextVector.erase(aRemove);
- // remove the rest from parent
- for(a = 0; a < maImplContextVector.size(); a++)
- {
- if(a != nIndexOfPreferred)
- {
- removeGraphicFromImportContext(**maImplContextVector[a]);
- }
- }
- }
- else
+ // remove the rest from parent
+ for(a = 0; a < maImplContextVector.size(); a++)
{
- // only one, winner is implicit
- pRetval = *maImplContextVector[0];
+ removeGraphicFromImportContext(**maImplContextVector[a]);
}
}
-
- return pRetval;
}
void multiImageImportHelper::addContent(const SvXMLImportContext& rSvXMLImportContext)
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 0a75ac531af5..6ca9a3d3d1bb 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -2254,8 +2254,9 @@ namespace xmloff { namespace token {
TOKEN( "engine" , XML_ENGINE ),
TOKEN( "enhanced-geometry" , XML_ENHANCED_GEOMETRY ),
TOKEN( "text-rotate-angle" , XML_TEXT_ROTATE_ANGLE ),
- TOKEN( "mirror-vertical" , XML_MIRROR_VERTICAL ),
- TOKEN( "mirror-horizontal" , XML_MIRROR_HORIZONTAL ),
+ // TTTT: MirrorX/Y removed
+ //TOKEN( "mirror-vertical" , XML_MIRROR_VERTICAL ),
+ //TOKEN( "mirror-horizontal" , XML_MIRROR_HORIZONTAL ),
TOKEN( "extrusion-allowed" , XML_EXTRUSION_ALLOWED ),
TOKEN( "text-path-allowed" , XML_TEXT_PATH_ALLOWED ),
TOKEN( "concentric-gradient-fill-allowed" , XML_CONCENTRIC_GRADIENT_FILL_ALLOWED ),
diff --git a/xmloff/source/draw/EnhancedCustomShapeToken.cxx b/xmloff/source/draw/EnhancedCustomShapeToken.cxx
index e816f37dd671..121a7e136866 100644
--- a/xmloff/source/draw/EnhancedCustomShapeToken.cxx
+++ b/xmloff/source/draw/EnhancedCustomShapeToken.cxx
@@ -115,8 +115,11 @@ static const TokenTable pTokenTableArray[] =
{ "CustomShapeEngine", EAS_CustomShapeEngine },
{ "CustomShapeData", EAS_CustomShapeData },
{ "Type", EAS_Type },
+
+ // TTTT: MirrorX/Y removed, but still used at import and for EnhancedCustomShapeHandle
{ "MirroredX", EAS_MirroredX },
{ "MirroredY", EAS_MirroredY },
+
{ "ViewBox", EAS_ViewBox },
{ "TextRotateAngle", EAS_TextRotateAngle },
{ "ExtrusionAllowed", EAS_ExtrusionAllowed },
@@ -185,7 +188,7 @@ EnhancedCustomShapeTokenEnum EASGet( const rtl::OUString& rShapeType )
if ( !pHashMap )
{
TypeNameHashMap* pH = new TypeNameHashMap;
- const TokenTable* pPtr = pTokenTableArray;
+ const TokenTable* pPtr = pTokenTableArray; // TTTT: MirrorX/Y removed; when used here reactivate above in the table
const TokenTable* pEnd = pPtr + ( sizeof( pTokenTableArray ) / sizeof( TokenTable ) );
for ( ; pPtr < pEnd; pPtr++ )
(*pH)[ pPtr->pS ] = pPtr->pE;
diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
index 02209f0b933b..df46cbcde8b3 100644
--- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
+++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx
@@ -52,8 +52,6 @@ using ::xmloff::token::XML_PARAGRAPH_PROPERTIES;
// ---------------------------------------------------------------------
-TYPEINIT1( XMLGraphicsDefaultStyle, XMLPropStyleContext );
-
XMLGraphicsDefaultStyle::XMLGraphicsDefaultStyle( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList >& xAttrList, SvXMLStylesContext& rStyles )
: XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XML_STYLE_FAMILY_SD_GRAPHICS_ID, sal_True )
{
diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx
index 0304f0520608..bd304e17a587 100644
--- a/xmloff/source/draw/XMLImageMapContext.cxx
+++ b/xmloff/source/draw/XMLImageMapContext.cxx
@@ -139,8 +139,6 @@ protected:
sal_Bool bValid;
public:
- TYPEINFO();
-
XMLImageMapObjectContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -173,8 +171,6 @@ protected:
};
-TYPEINIT1( XMLImageMapObjectContext, SvXMLImportContext );
-
XMLImageMapObjectContext::XMLImageMapObjectContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -333,8 +329,6 @@ class XMLImageMapRectangleContext : public XMLImageMapObjectContext
sal_Bool bHeightOK;
public:
- TYPEINFO();
-
XMLImageMapRectangleContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -356,8 +350,6 @@ protected:
-TYPEINIT1(XMLImageMapRectangleContext, XMLImageMapObjectContext);
-
XMLImageMapRectangleContext::XMLImageMapRectangleContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -443,8 +435,6 @@ class XMLImageMapPolygonContext : public XMLImageMapObjectContext
sal_Bool bPointsOK;
public:
- TYPEINFO();
-
XMLImageMapPolygonContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -466,8 +456,6 @@ protected:
-TYPEINIT1(XMLImageMapPolygonContext, XMLImageMapObjectContext);
-
XMLImageMapPolygonContext::XMLImageMapPolygonContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -516,8 +504,7 @@ void XMLImageMapPolygonContext::Prepare(
// get polygon sequence
awt::Point aPoint(aViewBox.GetX(), aViewBox.GetY());
awt::Size aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
- SdXMLImExPointsElement aPoints( sPointsString, aViewBox, aPoint, aSize,
- GetImport().GetMM100UnitConverter() );
+ SdXMLImExPointsElement aPoints( sPointsString, aViewBox, aPoint, aSize, GetImport().GetMM100UnitConverter(), true );
PointSequenceSequence aPointSeqSeq = aPoints.GetPointSequenceSequence();
// only use first element of sequence-sequence
@@ -544,8 +531,6 @@ class XMLImageMapCircleContext : public XMLImageMapObjectContext
sal_Bool bRadiusOK;
public:
- TYPEINFO();
-
XMLImageMapCircleContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -565,8 +550,6 @@ protected:
::com::sun::star::beans::XPropertySet> & rPropertySet);
};
-TYPEINIT1(XMLImageMapCircleContext, XMLImageMapObjectContext);
-
XMLImageMapCircleContext::XMLImageMapCircleContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -647,8 +630,6 @@ void XMLImageMapCircleContext::Prepare(
-TYPEINIT1(XMLImageMapContext, SvXMLImportContext);
-
XMLImageMapContext::XMLImageMapContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx
index 9e30252d3104..67cc8f9adf27 100644
--- a/xmloff/source/draw/XMLImageMapExport.cxx
+++ b/xmloff/source/draw/XMLImageMapExport.cxx
@@ -376,7 +376,7 @@ void XMLImageMapExport::ExportPolygon(
// export point sequence
awt::Point aPoint(0, 0);
awt::Size aSize(nWidth, nHeight);
- SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize );
+ SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize, true);
mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS,
aPoints.GetExportString());
}
diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx
index 5d5684f5faf4..bd05c4b6f280 100644
--- a/xmloff/source/draw/XMLNumberStyles.cxx
+++ b/xmloff/source/draw/XMLNumberStyles.cxx
@@ -505,8 +505,6 @@ private:
boost::shared_ptr< SvXMLImportContext > mpSlaveContext;
public:
- TYPEINFO();
-
SdXMLNumberFormatMemberImportContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
@@ -526,8 +524,6 @@ public:
virtual void Characters( const ::rtl::OUString& rChars );
};
-TYPEINIT1( SdXMLNumberFormatMemberImportContext, SvXMLImportContext );
-
SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, SdXMLNumberFormatImportContext* pParent, SvXMLImportContext* pSlaveContext )
: SvXMLImportContext(rImport, nPrfx, rLocalName),
mpParent( pParent ),
@@ -595,9 +591,6 @@ void SdXMLNumberFormatMemberImportContext::Characters( const ::rtl::OUString& rC
maText += rChars;
}
-TYPEINIT1( SdXMLNumberFormatImportContext, SvXMLImportContext );
-
-
SdXMLNumberFormatImportContext::SdXMLNumberFormatImportContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, SvXMLNumImpData* pNewData, sal_uInt16 nNewType, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, SvXMLStylesContext& rStyles)
: SvXMLNumFormatContext(rImport, nPrfx, rLocalName, pNewData, nNewType, xAttrList, rStyles),
mrImport( rImport ),
diff --git a/xmloff/source/draw/XMLReplacementImageContext.cxx b/xmloff/source/draw/XMLReplacementImageContext.cxx
index 0cc4dcb96440..b72fd93141a2 100644
--- a/xmloff/source/draw/XMLReplacementImageContext.cxx
+++ b/xmloff/source/draw/XMLReplacementImageContext.cxx
@@ -39,8 +39,6 @@ using ::com::sun::star::uno::makeAny;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::beans;
-TYPEINIT1( XMLReplacementImageContext, SvXMLImportContext );
-
XMLReplacementImageContext::XMLReplacementImageContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
diff --git a/xmloff/source/draw/XMLShapePropertySetContext.cxx b/xmloff/source/draw/XMLShapePropertySetContext.cxx
index 9a67cf3732b1..a882efb63efd 100644
--- a/xmloff/source/draw/XMLShapePropertySetContext.cxx
+++ b/xmloff/source/draw/XMLShapePropertySetContext.cxx
@@ -42,8 +42,6 @@ using namespace ::com::sun::star::uno;
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLShapePropertySetContext, SvXMLPropertySetContext );
-
XMLShapePropertySetContext::XMLShapePropertySetContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx
index 811276a69113..86366a2933f4 100644
--- a/xmloff/source/draw/XMLShapeStyleContext.cxx
+++ b/xmloff/source/draw/XMLShapeStyleContext.cxx
@@ -53,8 +53,6 @@ using ::xmloff::token::XML_PARAGRAPH_PROPERTIES;
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLShapeStyleContext, XMLPropStyleContext );
-
XMLShapeStyleContext::XMLShapeStyleContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 293c10ca648b..d37aebc8fed8 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -672,8 +672,6 @@ Any AnimationsImportHelperImpl::convertPath( const OUString& rValue )
///////////////////////////////////////////////////////////////////////
-TYPEINIT1( AnimationNodeContext, SvXMLImportContext );
-
AnimationNodeContext::AnimationNodeContext(
const Reference< XAnimationNode >& xParentNode,
SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx
index 1f632170e4fa..7508f919adc6 100644
--- a/xmloff/source/draw/animimp.cxx
+++ b/xmloff/source/draw/animimp.cxx
@@ -397,8 +397,6 @@ public:
OUString maPathShapeId;
public:
- TYPEINFO();
-
XMLAnimationsEffectContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const OUString& rLocalName,
@@ -417,14 +415,10 @@ class XMLAnimationsSoundContext : public SvXMLImportContext
XMLAnimationsEffectContext* mpParent;
public:
- TYPEINFO();
-
XMLAnimationsSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, XMLAnimationsEffectContext* pParent );
virtual ~XMLAnimationsSoundContext();
};
-TYPEINIT1( XMLAnimationsSoundContext, SvXMLImportContext );
-
XMLAnimationsSoundContext::XMLAnimationsSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, XMLAnimationsEffectContext* pParent )
: SvXMLImportContext( rImport, nPrfx, rLocalName ), mpParent( pParent )
{
@@ -461,8 +455,6 @@ XMLAnimationsSoundContext::~XMLAnimationsSoundContext()
}
-TYPEINIT1( XMLAnimationsEffectContext, SvXMLImportContext );
-
XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, AnimImpImpl* pImpl )
: SvXMLImportContext(rImport, nPrfx, rLocalName),
mpImpl( pImpl ),
@@ -669,8 +661,6 @@ void XMLAnimationsEffectContext::EndElement()
///////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLAnimationsContext, SvXMLImportContext );
-
XMLAnimationsContext::XMLAnimationsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& )
: SvXMLImportContext(rImport, nPrfx, rLocalName)
diff --git a/xmloff/source/draw/descriptionimp.cxx b/xmloff/source/draw/descriptionimp.cxx
index f3ca22a01581..b4e642ab31a2 100644
--- a/xmloff/source/draw/descriptionimp.cxx
+++ b/xmloff/source/draw/descriptionimp.cxx
@@ -49,8 +49,6 @@ using namespace ::xmloff::token;
///////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLDescriptionContext, SvXMLImportContext );
-
SdXMLDescriptionContext::SdXMLDescriptionContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,
const Reference< XAttributeList>&, const Reference< XShape >& rxShape)
: SvXMLImportContext(rImport, nPrfx, rLocalName), mxShape( rxShape )
diff --git a/xmloff/source/draw/descriptionimp.hxx b/xmloff/source/draw/descriptionimp.hxx
index a109c7c47fc6..7d297d6d62f3 100644
--- a/xmloff/source/draw/descriptionimp.hxx
+++ b/xmloff/source/draw/descriptionimp.hxx
@@ -36,8 +36,6 @@ private:
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
::rtl::OUString msText;
public:
- TYPEINFO();
-
SdXMLDescriptionContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx
index e825ad832d52..aaeba1449c90 100644
--- a/xmloff/source/draw/eventimp.cxx
+++ b/xmloff/source/draw/eventimp.cxx
@@ -87,8 +87,6 @@ private:
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
public:
- TYPEINFO();
-
SdXMLEventContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList, const Reference< XShape >& rxShape );
virtual ~SdXMLEventContext();
@@ -123,14 +121,10 @@ class XMLEventSoundContext : public SvXMLImportContext
SdXMLEventContext* mpParent;
public:
- TYPEINFO();
-
XMLEventSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, SdXMLEventContext* pParent );
virtual ~XMLEventSoundContext();
};
-TYPEINIT1( XMLEventSoundContext, SvXMLImportContext );
-
XMLEventSoundContext::XMLEventSoundContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, SdXMLEventContext* pParent )
: SvXMLImportContext( rImp, nPrfx, rLocalName ), mpParent( pParent )
{
@@ -168,8 +162,6 @@ XMLEventSoundContext::~XMLEventSoundContext()
///////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
-
SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape )
: SvXMLImportContext(rImp, nPrfx, rLocalName),
#ifdef ISSUE66550_HLINK_FOR_SHAPES
@@ -552,8 +544,6 @@ void SdXMLEventContext::EndElement()
///////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLEventsContext, SvXMLImportContext );
-
SdXMLEventsContext::SdXMLEventsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,
const Reference< XAttributeList>&, const Reference< XShape >& rxShape)
: SvXMLImportContext(rImport, nPrfx, rLocalName), mxShape( rxShape )
diff --git a/xmloff/source/draw/eventimp.hxx b/xmloff/source/draw/eventimp.hxx
index fd1a44955804..b8d3dfb48736 100644
--- a/xmloff/source/draw/eventimp.hxx
+++ b/xmloff/source/draw/eventimp.hxx
@@ -36,8 +36,6 @@ private:
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
public:
- TYPEINFO();
-
SdXMLEventsContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
diff --git a/xmloff/source/draw/layerimp.cxx b/xmloff/source/draw/layerimp.cxx
index 24f38c910e00..4dc1783e3a3b 100644
--- a/xmloff/source/draw/layerimp.cxx
+++ b/xmloff/source/draw/layerimp.cxx
@@ -153,8 +153,6 @@ void SdXMLLayerContext::EndElement()
}
-TYPEINIT1( SdXMLLayerSetContext, SvXMLImportContext );
-
SdXMLLayerSetContext::SdXMLLayerSetContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>&)
: SvXMLImportContext(rImport, nPrfx, rLocalName)
diff --git a/xmloff/source/draw/layerimp.hxx b/xmloff/source/draw/layerimp.hxx
index 4e36607aca5e..01daf873ffbb 100644
--- a/xmloff/source/draw/layerimp.hxx
+++ b/xmloff/source/draw/layerimp.hxx
@@ -38,8 +38,6 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxLayerManager;
public:
- TYPEINFO();
-
SdXMLLayerSetContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 87279e385f8a..7f5188a1282a 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -127,8 +127,6 @@ public:
const uno::Reference<xml::sax::XAttributeList>& xAttrList);
virtual ~SdXMLDocContext_Impl();
- TYPEINFO();
-
virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
const OUString& rLocalName,
const uno::Reference<xml::sax::XAttributeList>& xAttrList);
@@ -151,8 +149,6 @@ SdXMLDocContext_Impl::~SdXMLDocContext_Impl()
{
}
-TYPEINIT1( SdXMLDocContext_Impl, SvXMLImportContext );
-
//////////////////////////////////////////////////////////////////////////////
SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index ded603f7801c..e80d933e892a 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -35,10 +35,7 @@
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <com/sun/star/media/ZoomLevel.hpp>
#include "anim.hxx"
-
-#ifndef _XMLOFF_SHAPEEXPORT_HXX
#include <xmloff/shapeexport.hxx>
-#endif
#include "sdpropls.hxx"
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
@@ -50,10 +47,11 @@
#include <tools/gen.hxx> // FRound
#include <xmloff/xmltoken.hxx>
#include <xmloff/nmspmap.hxx>
-
-#include "xmloff/xmlnmspe.hxx"
+#include <xmloff/xmlnmspe.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <basegfx/point/b2dpoint.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -109,16 +107,7 @@ void XMLShapeExport::ImpExportNewTrans_GetB2DHomMatrix(::basegfx::B2DHomMatrix&
// <--
drawing::HomogenMatrix3 aMatrix;
aAny >>= aMatrix;
-
- rMatrix.set(0, 0, aMatrix.Line1.Column1);
- rMatrix.set(0, 1, aMatrix.Line1.Column2);
- rMatrix.set(0, 2, aMatrix.Line1.Column3);
- rMatrix.set(1, 0, aMatrix.Line2.Column1);
- rMatrix.set(1, 1, aMatrix.Line2.Column2);
- rMatrix.set(1, 2, aMatrix.Line2.Column3);
- rMatrix.set(2, 0, aMatrix.Line3.Column1);
- rMatrix.set(2, 1, aMatrix.Line3.Column2);
- rMatrix.set(2, 2, aMatrix.Line3.Column3);
+ rMatrix = basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix);
}
void XMLShapeExport::ImpExportNewTrans_DecomposeAndRefPoint(const ::basegfx::B2DHomMatrix& rMatrix, ::basegfx::B2DTuple& rTRScale,
@@ -148,13 +137,6 @@ void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTR
{
aTRScale.setX(1.0);
}
- else
- {
- if( aTRScale.getX() > 0.0 )
- aTRScale.setX(aTRScale.getX() - 1.0);
- else if( aTRScale.getX() < 0.0 )
- aTRScale.setX(aTRScale.getX() + 1.0);
- }
mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.getX()));
aStr = sStringBuffer.makeStringAndClear();
@@ -165,13 +147,6 @@ void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTR
{
aTRScale.setY(1.0);
}
- else
- {
- if( aTRScale.getY() > 0.0 )
- aTRScale.setY(aTRScale.getY() - 1.0);
- else if( aTRScale.getY() < 0.0 )
- aTRScale.setY(aTRScale.getY() + 1.0);
- }
mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.getY()));
aStr = sStringBuffer.makeStringAndClear();
@@ -185,7 +160,8 @@ void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTR
// write transformation, but WITHOUT scale which is exported as size above
SdXMLImExTransform2D aTransform;
- aTransform.AddSkewX(atan(fTRShear));
+ // Export Shear mirrored to stay compatible to ODF1.3
+ aTransform.AddSkewX(atan(-fTRShear));
// #i78696#
// fTRRotate is mathematically correct, but due to the error
@@ -810,60 +786,25 @@ void XMLShapeExport::ImpExportLineShape(
{
OUString aStr;
OUStringBuffer sStringBuffer;
- awt::Point aStart(0,0);
- awt::Point aEnd(1,1);
-
- // #85920# use 'Geometry' to get the points of the line
- // since this slot take anchor pos into account.
// get matrix
- ::basegfx::B2DHomMatrix aMatrix;
+ basegfx::B2DHomMatrix aMatrix;
ImpExportNewTrans_GetB2DHomMatrix(aMatrix, xPropSet);
- // decompose and correct about pRefPoint
- ::basegfx::B2DTuple aTRScale;
- double fTRShear(0.0);
- double fTRRotate(0.0);
- ::basegfx::B2DTuple aTRTranslate;
- ImpExportNewTrans_DecomposeAndRefPoint(aMatrix, aTRScale, fTRShear, fTRRotate, aTRTranslate, pRefPoint);
-
- // create base position
- awt::Point aBasePosition(FRound(aTRTranslate.getX()), FRound(aTRTranslate.getY()));
+ // Create the two points directy using the transformation
+ basegfx::B2DPoint aB2DStart(aMatrix * basegfx::B2DPoint(0.0, 0.0));
+ basegfx::B2DPoint aB2DEnd(aMatrix * basegfx::B2DPoint(1.0, 0.0));
- // get the two points
- uno::Any aAny(xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry"))));
- drawing::PointSequenceSequence* pSourcePolyPolygon = (drawing::PointSequenceSequence*)aAny.getValue();
-
- if(pSourcePolyPolygon)
+ if(pRefPoint)
{
- drawing::PointSequence* pOuterSequence = pSourcePolyPolygon->getArray();
- if(pOuterSequence)
- {
- drawing::PointSequence* pInnerSequence = pOuterSequence++;
- if(pInnerSequence)
- {
- awt::Point* pArray = pInnerSequence->getArray();
- if(pArray)
- {
- if(pInnerSequence->getLength() > 0)
- {
- aStart = awt::Point(
- pArray->X + aBasePosition.X,
- pArray->Y + aBasePosition.Y);
- pArray++;
- }
-
- if(pInnerSequence->getLength() > 1)
- {
- aEnd = awt::Point(
- pArray->X + aBasePosition.X,
- pArray->Y + aBasePosition.Y);
- }
- }
- }
- }
+ const basegfx::B2DPoint aRefPoint(pRefPoint->X, pRefPoint->Y);
+ aB2DStart -= aRefPoint;
+ aB2DEnd -= aRefPoint;
}
+ awt::Point aStart(basegfx::fround(aB2DStart.getX()), basegfx::fround(aB2DStart.getY()));
+ awt::Point aEnd(basegfx::fround(aB2DEnd.getX()), basegfx::fround(aB2DEnd.getY()));
+
if( nFeatures & SEF_EXPORT_X )
{
// svg: x1
@@ -1073,9 +1014,7 @@ void XMLShapeExport::ImpExportPolygonShape(
drawing::PointSequence* pSequence = pSourcePolyPolygon->getArray();
if(pSequence)
{
- SdXMLImExPointsElement aPoints(pSequence, aViewBox, aPoint, aSize,
- // #96328#
- bClosed);
+ SdXMLImExPointsElement aPoints(pSequence, aViewBox, aPoint, aSize, bClosed);
// write point array
mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_POINTS, aPoints.GetExportString());
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index 386ba277bb84..648af5508d4d 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -487,22 +487,23 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean
rGeoProp.Value >>= aCustomShapeType;
}
break;
- case EAS_MirroredX :
- {
- sal_Bool bMirroredX = sal_Bool();
- if ( rGeoProp.Value >>= bMirroredX )
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_HORIZONTAL,
- bMirroredX ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
- }
- break;
- case EAS_MirroredY :
- {
- sal_Bool bMirroredY = sal_Bool();
- if ( rGeoProp.Value >>= bMirroredY )
- rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_VERTICAL,
- bMirroredY ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
- }
- break;
+ // TTTT: MirrorX/Y removed, no longer exported
+ //case EAS_MirroredX :
+ //{
+ // sal_Bool bMirroredX = sal_Bool();
+ // if ( rGeoProp.Value >>= bMirroredX )
+ // rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_HORIZONTAL,
+ // bMirroredX ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
+ //}
+ //break;
+ //case EAS_MirroredY :
+ //{
+ // sal_Bool bMirroredY = sal_Bool();
+ // if ( rGeoProp.Value >>= bMirroredY )
+ // rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIRROR_VERTICAL,
+ // bMirroredY ? GetXMLToken( XML_TRUE ) : GetXMLToken( XML_FALSE ) );
+ //}
+ //break;
case EAS_ViewBox :
{
awt::Rectangle aRect;
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index afdd7046dad5..caa90145cd42 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -1012,7 +1012,7 @@ SvXMLImportContext *XMLShapeImportHelper::CreateFrameChildContext(
{
SvXMLImportContext * pContext = NULL;
- SdXMLFrameShapeContext *pFrameContext = PTR_CAST( SdXMLFrameShapeContext, pThisContext );
+ SdXMLFrameShapeContext *pFrameContext = dynamic_cast< SdXMLFrameShapeContext* >( pThisContext );
if( pFrameContext )
pContext = pFrameContext->CreateChildContext( nPrefix, rLocalName, xAttrList );
diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx
index fa4f283db892..96ecaf4243b9 100644
--- a/xmloff/source/draw/xexptran.cxx
+++ b/xmloff/source/draw/xexptran.cxx
@@ -33,6 +33,7 @@
#include <basegfx/tuple/b3dtuple.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <tools/string.hxx>
+#include <basegfx/matrix/b3dhommatrixtools.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -673,23 +674,25 @@ void SdXMLImExTransform2D::GetFullTransform(::basegfx::B2DHomMatrix& rFullTrans)
case IMP_SDXMLEXP_TRANSOBJ2D_SCALE :
{
const ::basegfx::B2DTuple& rScale = ((ImpSdXMLExpTransObj2DScale*)pObj)->maScale;
- rFullTrans.scale(rScale.getX(), rScale.getY());
+ rFullTrans.scale(rScale);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE :
{
const ::basegfx::B2DTuple& rTranslate = ((ImpSdXMLExpTransObj2DTranslate*)pObj)->maTranslate;
- rFullTrans.translate(rTranslate.getX(), rTranslate.getY());
+ rFullTrans.translate(rTranslate);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWX :
{
- rFullTrans.shearX(tan(((ImpSdXMLExpTransObj2DSkewX*)pObj)->mfSkewX));
+ // correct shear by mirroring; ODF 1.3 uses mirrored values
+ rFullTrans.shearX(tan(((ImpSdXMLExpTransObj2DSkewX*)pObj)->mfSkewX * -1.0));
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWY :
{
- rFullTrans.shearY(tan(((ImpSdXMLExpTransObj2DSkewY*)pObj)->mfSkewY));
+ // correct shear by mirroring; ODF 1.3 uses mirrored values
+ rFullTrans.shearY(tan(((ImpSdXMLExpTransObj2DSkewY*)pObj)->mfSkewY * -1.0));
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_MATRIX :
@@ -862,22 +865,7 @@ void SdXMLImExTransform3D::AddMatrix(const ::basegfx::B3DHomMatrix& rNew)
void SdXMLImExTransform3D::AddHomogenMatrix(const drawing::HomogenMatrix& xHomMat)
{
- ::basegfx::B3DHomMatrix aExportMatrix;
-
- aExportMatrix.set(0, 0, xHomMat.Line1.Column1);
- aExportMatrix.set(0, 1, xHomMat.Line1.Column2);
- aExportMatrix.set(0, 2, xHomMat.Line1.Column3);
- aExportMatrix.set(0, 3, xHomMat.Line1.Column4);
- aExportMatrix.set(1, 0, xHomMat.Line2.Column1);
- aExportMatrix.set(1, 1, xHomMat.Line2.Column2);
- aExportMatrix.set(1, 2, xHomMat.Line2.Column3);
- aExportMatrix.set(1, 3, xHomMat.Line2.Column4);
- aExportMatrix.set(2, 0, xHomMat.Line3.Column1);
- aExportMatrix.set(2, 1, xHomMat.Line3.Column2);
- aExportMatrix.set(2, 2, xHomMat.Line3.Column3);
- aExportMatrix.set(2, 3, xHomMat.Line3.Column4);
-
- AddMatrix(aExportMatrix);
+ AddMatrix(basegfx::tools::UnoHomogenMatrixToB3DHomMatrix(xHomMat));
}
//////////////////////////////////////////////////////////////////////////////
@@ -1188,31 +1176,12 @@ void SdXMLImExTransform3D::SetString(const OUString& rNew, const SvXMLUnitConver
bool SdXMLImExTransform3D::GetFullHomogenTransform(com::sun::star::drawing::HomogenMatrix& xHomMat)
{
- ::basegfx::B3DHomMatrix aFullTransform;
+ basegfx::B3DHomMatrix aFullTransform;
GetFullTransform(aFullTransform);
if(!aFullTransform.isIdentity())
{
- xHomMat.Line1.Column1 = aFullTransform.get(0, 0);
- xHomMat.Line1.Column2 = aFullTransform.get(0, 1);
- xHomMat.Line1.Column3 = aFullTransform.get(0, 2);
- xHomMat.Line1.Column4 = aFullTransform.get(0, 3);
-
- xHomMat.Line2.Column1 = aFullTransform.get(1, 0);
- xHomMat.Line2.Column2 = aFullTransform.get(1, 1);
- xHomMat.Line2.Column3 = aFullTransform.get(1, 2);
- xHomMat.Line2.Column4 = aFullTransform.get(1, 3);
-
- xHomMat.Line3.Column1 = aFullTransform.get(2, 0);
- xHomMat.Line3.Column2 = aFullTransform.get(2, 1);
- xHomMat.Line3.Column3 = aFullTransform.get(2, 2);
- xHomMat.Line3.Column4 = aFullTransform.get(2, 3);
-
- xHomMat.Line4.Column1 = aFullTransform.get(3, 0);
- xHomMat.Line4.Column2 = aFullTransform.get(3, 1);
- xHomMat.Line4.Column3 = aFullTransform.get(3, 2);
- xHomMat.Line4.Column4 = aFullTransform.get(3, 3);
-
+ basegfx::tools::B3DHomMatrixToUnoHomogenMatrix(aFullTransform, xHomMat);
return true;
}
@@ -1247,13 +1216,13 @@ void SdXMLImExTransform3D::GetFullTransform(::basegfx::B3DHomMatrix& rFullTrans)
case IMP_SDXMLEXP_TRANSOBJ3D_SCALE :
{
const ::basegfx::B3DTuple& rScale = ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale;
- rFullTrans.scale(rScale.getX(), rScale.getY(), rScale.getZ());
+ rFullTrans.scale(rScale);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE :
{
const ::basegfx::B3DTuple& rTranslate = ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate;
- rFullTrans.translate(rTranslate.getX(), rTranslate.getY(), rTranslate.getZ());
+ rFullTrans.translate(rTranslate);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_MATRIX :
@@ -1350,7 +1319,6 @@ SdXMLImExPointsElement::SdXMLImExPointsElement(drawing::PointSequence* pPoints,
const SdXMLImExViewBox& rViewBox,
const awt::Point& rObjectPos,
const awt::Size& rObjectSize,
- // #96328#
const bool bClosed)
: maPoly( 0L )
{
@@ -1416,7 +1384,8 @@ SdXMLImExPointsElement::SdXMLImExPointsElement(const OUString& rNew,
const SdXMLImExViewBox& rViewBox,
const awt::Point& rObjectPos,
const awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv)
+ const SvXMLUnitConverter& rConv,
+ const bool bClosed)
: msString( rNew ),
maPoly( 0L )
{
@@ -1454,7 +1423,7 @@ SdXMLImExPointsElement::SdXMLImExPointsElement(const OUString& rNew,
nPos = 0;
maPoly.realloc(1);
drawing::PointSequence* pOuterSequence = maPoly.getArray();
- pOuterSequence->realloc(nNumPoints);
+ pOuterSequence->realloc(nNumPoints + (bClosed ? 1 : 0));
awt::Point* pInnerSequence = pOuterSequence->getArray();
// object size and ViewBox size different?
@@ -1503,6 +1472,11 @@ SdXMLImExPointsElement::SdXMLImExPointsElement(const OUString& rNew,
*pInnerSequence = awt::Point( nX, nY );
pInnerSequence++;
}
+
+ if(bClosed)
+ {
+ *pInnerSequence = *pOuterSequence->getArray();
+ }
}
}
diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx
index 2bee7cf5c241..d4a17da6b37f 100644
--- a/xmloff/source/draw/ximp3dobject.cxx
+++ b/xmloff/source/draw/ximp3dobject.cxx
@@ -46,8 +46,6 @@ using namespace ::com::sun::star;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXML3DObjectContext, SdXMLShapeContext );
-
SdXML3DObjectContext::SdXML3DObjectContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -154,7 +152,7 @@ void SdXML3DObjectContext::SetStyle()
pStyle = GetImport().GetShapeImport()->GetStylesContext()->
FindStyleChildContext(XML_STYLE_FAMILY_SD_GRAPHICS_ID, maDrawStyleName);
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
+ if(pStyle && dynamic_cast< XMLShapeStyleContext* >(pStyle))
{
uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
if(xPropSet.is())
@@ -182,8 +180,6 @@ void SdXML3DObjectContext::SetStyle()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXML3DCubeObjectShapeContext, SdXML3DObjectContext);
-
SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -293,8 +289,6 @@ void SdXML3DCubeObjectShapeContext::EndElement()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXML3DSphereObjectShapeContext, SdXML3DObjectContext);
-
SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -401,8 +395,6 @@ void SdXML3DSphereObjectShapeContext::EndElement()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXML3DPolygonBasedShapeContext, SdXML3DObjectContext );
-
SdXML3DPolygonBasedShapeContext::SdXML3DPolygonBasedShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -522,8 +514,6 @@ void SdXML3DPolygonBasedShapeContext::EndElement()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXML3DLatheObjectShapeContext, SdXML3DPolygonBasedShapeContext);
-
SdXML3DLatheObjectShapeContext::SdXML3DLatheObjectShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -566,8 +556,6 @@ void SdXML3DLatheObjectShapeContext::EndElement()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXML3DExtrudeObjectShapeContext, SdXML3DPolygonBasedShapeContext);
-
SdXML3DExtrudeObjectShapeContext::SdXML3DExtrudeObjectShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/draw/ximp3dobject.hxx b/xmloff/source/draw/ximp3dobject.hxx
index 0d0ce99d3537..6dc2c6f875ea 100644
--- a/xmloff/source/draw/ximp3dobject.hxx
+++ b/xmloff/source/draw/ximp3dobject.hxx
@@ -28,7 +28,6 @@
#include "sdxmlimp_impl.hxx"
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
-#include <tools/rtti.hxx>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
@@ -50,8 +49,6 @@ protected:
void AddShape(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape);
*/
public:
- TYPEINFO();
-
SdXML3DObjectContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
@@ -75,8 +72,6 @@ class SdXML3DCubeObjectShapeContext : public SdXML3DObjectContext
sal_Bool mbMaxEdgeUsed;
public:
- TYPEINFO();
-
SdXML3DCubeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -99,8 +94,6 @@ class SdXML3DSphereObjectShapeContext : public SdXML3DObjectContext
sal_Bool mbSizeUsed;
public:
- TYPEINFO();
-
SdXML3DSphereObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -121,8 +114,6 @@ class SdXML3DPolygonBasedShapeContext : public SdXML3DObjectContext
rtl::OUString maViewBox;
public:
- TYPEINFO();
-
SdXML3DPolygonBasedShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -140,8 +131,6 @@ public:
class SdXML3DLatheObjectShapeContext : public SdXML3DPolygonBasedShapeContext
{
public:
- TYPEINFO();
-
SdXML3DLatheObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -159,8 +148,6 @@ public:
class SdXML3DExtrudeObjectShapeContext : public SdXML3DPolygonBasedShapeContext
{
public:
- TYPEINFO();
-
SdXML3DExtrudeObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx
index fe56e01430b7..a9b150a24f59 100644
--- a/xmloff/source/draw/ximp3dscene.cxx
+++ b/xmloff/source/draw/ximp3dscene.cxx
@@ -95,8 +95,6 @@ SdXML3DLightContext::~SdXML3DLightContext()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXML3DSceneShapeContext, SdXMLShapeContext );
-
SdXML3DSceneShapeContext::SdXML3DSceneShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/draw/ximp3dscene.hxx b/xmloff/source/draw/ximp3dscene.hxx
index 56e18407ed32..3d49f2ec210c 100644
--- a/xmloff/source/draw/ximp3dscene.hxx
+++ b/xmloff/source/draw/ximp3dscene.hxx
@@ -28,7 +28,6 @@
#include "sdxmlimp_impl.hxx"
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
-#include <tools/rtti.hxx>
#include <tools/color.hxx>
#include <ximpshap.hxx>
@@ -49,8 +48,6 @@ protected:
{ mxChilds = rNew; }
public:
- TYPEINFO();
-
SdXML3DSceneShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index 7855efd0c360..457d6e4de81f 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -52,14 +52,14 @@
#include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <hash_map>
using namespace ::com::sun::star;
using namespace ::xmloff::token;
using namespace ::xmloff::EnhancedCustomShapeToken;
-TYPEINIT1( XMLEnhancedCustomShapeContext, SvXMLImportContext );
-
XMLEnhancedCustomShapeContext::XMLEnhancedCustomShapeContext( SvXMLImport& rImport,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
@@ -67,7 +67,9 @@ XMLEnhancedCustomShapeContext::XMLEnhancedCustomShapeContext( SvXMLImport& rImpo
SvXMLImportContext( rImport, nPrefix, rLocalName ),
mrUnitConverter( rImport.GetMM100UnitConverter() ),
mrxShape( rxShape ),
- mrCustomShapeGeometry( rCustomShapeGeometry )
+ mrCustomShapeGeometry( rCustomShapeGeometry ),
+ mbCompatibilityMirroredX(false),
+ mbCompatibilityMirroredY(false)
{
}
@@ -829,12 +831,29 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax
case EAS_type :
GetString( mrCustomShapeGeometry, rValue, EAS_Type );
break;
+
+ // TTTT: MirrorX/Y removed, need to replace at import
case EAS_mirror_horizontal :
- GetBool( mrCustomShapeGeometry, rValue, EAS_MirroredX );
- break;
+ {
+ sal_Bool bAttrBool(sal_False);
+
+ if(SvXMLUnitConverter::convertBool(bAttrBool, rValue))
+ {
+ mbCompatibilityMirroredX = bAttrBool;
+ }
+ break;
+ }
case EAS_mirror_vertical :
- GetBool( mrCustomShapeGeometry, rValue, EAS_MirroredY );
- break;
+ {
+ sal_Bool bAttrBool(sal_False);
+
+ if(SvXMLUnitConverter::convertBool(bAttrBool, rValue))
+ {
+ mbCompatibilityMirroredY = bAttrBool;
+ }
+ break;
+ }
+
case EAS_viewBox :
{
SdXMLImExViewBox aViewBox( rValue, GetImport().GetMM100UnitConverter() );
@@ -1280,6 +1299,49 @@ void XMLEnhancedCustomShapeContext::EndElement()
SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry, maEquations, EASGet( EAS_Equations ) );
if ( !maHandles.empty() )
SdXMLCustomShapePropertyMerge( mrCustomShapeGeometry, maHandles, EASGet( EAS_Handles ) );
+
+ if(mbCompatibilityMirroredX || mbCompatibilityMirroredY)
+ {
+ // when saved, this EnhancedCustomShapeGeometry was mirrored in X and/or Y. This
+ // will now be expressed in the transformation of the EnhancedCustomShape itself,
+ // so apply it to the already transformed object
+ uno::Reference< beans::XPropertySet > xPropSet(mrxShape, uno::UNO_QUERY);
+
+ if(xPropSet.is())
+ {
+ uno::Any aAny;
+ drawing::HomogenMatrix3 aMatrix;
+ basegfx::B2DHomMatrix aB2DMatrix;
+ const rtl::OUString aTrans(RTL_CONSTASCII_USTRINGPARAM("Transformation"));
+
+ // get UNO API Matrix from xShape
+ aAny = xPropSet->getPropertyValue(aTrans);
+ aAny >>= aMatrix;
+
+ // pre-apply mirrorings
+ aB2DMatrix.translate(-0.5, -0.5);
+
+ if(mbCompatibilityMirroredX)
+ {
+ aB2DMatrix.scale(-1.0, 1.0);
+ }
+
+ if(mbCompatibilityMirroredY)
+ {
+ aB2DMatrix.scale(1.0, -1.0);
+ }
+
+ aB2DMatrix.translate(0.5, 0.5);
+
+ // apply already valid transformation
+ aB2DMatrix = basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix) * aB2DMatrix;
+
+ // transform back to UNO API matrix and set at xShape
+ basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(aB2DMatrix, aMatrix);
+ aAny <<= aMatrix;
+ xPropSet->setPropertyValue(aTrans, aAny);
+ }
+ }
}
SvXMLImportContext* XMLEnhancedCustomShapeContext::CreateChildContext( sal_uInt16 nPrefix,const rtl::OUString& rLocalName,
diff --git a/xmloff/source/draw/ximpcustomshape.hxx b/xmloff/source/draw/ximpcustomshape.hxx
index a1bae177d1f8..5bbb8552db4c 100644
--- a/xmloff/source/draw/ximpcustomshape.hxx
+++ b/xmloff/source/draw/ximpcustomshape.hxx
@@ -56,9 +56,11 @@ class XMLEnhancedCustomShapeContext : public SvXMLImportContext
std::vector< rtl::OUString > maEquations;
std::vector< rtl::OUString > maEquationNames;
-public:
+ /// bitfield
+ bool mbCompatibilityMirroredX : 1;
+ bool mbCompatibilityMirroredY : 1;
- TYPEINFO();
+public:
XMLEnhancedCustomShapeContext( SvXMLImport& rImport, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &, sal_uInt16 nPrefix,
const ::rtl::OUString& rLocalName, std::vector< com::sun::star::beans::PropertyValue >& rCustomShapeGeometry );
diff --git a/xmloff/source/draw/ximpgrp.cxx b/xmloff/source/draw/ximpgrp.cxx
index 9ef70f7c6e7a..5a9d988b6c43 100644
--- a/xmloff/source/draw/ximpgrp.cxx
+++ b/xmloff/source/draw/ximpgrp.cxx
@@ -38,8 +38,6 @@ using namespace ::xmloff::token;
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLGroupShapeContext, SvXMLImportContext );
-
SdXMLGroupShapeContext::SdXMLGroupShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLocalName,
diff --git a/xmloff/source/draw/ximpgrp.hxx b/xmloff/source/draw/ximpgrp.hxx
index 53f77abfab7f..f08dcbcc03d0 100644
--- a/xmloff/source/draw/ximpgrp.hxx
+++ b/xmloff/source/draw/ximpgrp.hxx
@@ -28,7 +28,6 @@
#include "sdxmlimp_impl.hxx"
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
-#include <tools/rtti.hxx>
#include "ximpshap.hxx"
//////////////////////////////////////////////////////////////////////////////
@@ -44,8 +43,6 @@ protected:
{ mxShapes = rNew; }
public:
- TYPEINFO();
-
SdXMLGroupShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
diff --git a/xmloff/source/draw/ximplink.cxx b/xmloff/source/draw/ximplink.cxx
index fb4d44c061d4..6ea3ae20be55 100644
--- a/xmloff/source/draw/ximplink.cxx
+++ b/xmloff/source/draw/ximplink.cxx
@@ -35,8 +35,6 @@ using namespace ::xmloff::token;
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLShapeLinkContext, SvXMLImportContext );
-
SdXMLShapeLinkContext::SdXMLShapeLinkContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes)
: SvXMLShapeContext( rImport, nPrfx, rLocalName, false )
, mxParent( rShapes )
diff --git a/xmloff/source/draw/ximplink.hxx b/xmloff/source/draw/ximplink.hxx
index f22af367ee5a..8c6b0cf6398e 100644
--- a/xmloff/source/draw/ximplink.hxx
+++ b/xmloff/source/draw/ximplink.hxx
@@ -28,7 +28,6 @@
#include "sdxmlimp_impl.hxx"
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
-#include <tools/rtti.hxx>
#include "ximpshap.hxx"
//////////////////////////////////////////////////////////////////////////////
@@ -44,8 +43,6 @@ class SdXMLShapeLinkContext : public SvXMLShapeContext
rtl::OUString msHyperlink;
public:
- TYPEINFO();
-
SdXMLShapeLinkContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 5e8bb21e2478..288b4218e3b4 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -206,8 +206,6 @@ void DrawAnnotationContext::EndElement()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLGenericPageContext, SvXMLImportContext );
-
SdXMLGenericPageContext::SdXMLGenericPageContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLocalName,
@@ -335,8 +333,11 @@ void SdXMLGenericPageContext::EndElement()
else if( aDateTimeFormat.getLength() )
{
const SdXMLStylesContext* pStyles = dynamic_cast< const SdXMLStylesContext* >( GetSdImport().GetShapeImport()->GetStylesContext() );
+
if( !pStyles )
+ {
pStyles = dynamic_cast< const SdXMLStylesContext* >( GetSdImport().GetShapeImport()->GetAutoStylesContext() );
+ }
if( pStyles )
{
@@ -360,7 +361,7 @@ void SdXMLGenericPageContext::EndElement()
}
}
- SetNavigationOrder();
+ SetUserNavigationOrder();
}
void SdXMLGenericPageContext::SetStyle( rtl::OUString& rStyleName )
@@ -370,52 +371,47 @@ void SdXMLGenericPageContext::SetStyle( rtl::OUString& rStyleName )
{
try
{
- const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetAutoStylesContext();
+ const SdXMLStylesContext* pStyles = dynamic_cast< const SdXMLStylesContext*>(
+ GetSdImport().GetShapeImport()->GetAutoStylesContext());
- if( pContext && pContext->ISA( SvXMLStyleContext ) )
+ if(pStyles)
{
- const SdXMLStylesContext* pStyles = (SdXMLStylesContext*)pContext;
- if(pStyles)
- {
- const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext(
- XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, rStyleName);
+ const XMLPropStyleContext* pPropStyle = dynamic_cast< const XMLPropStyleContext* >(
+ pStyles->FindStyleChildContext(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, rStyleName));
- if(pStyle && pStyle->ISA(XMLPropStyleContext))
+ if(pPropStyle)
+ {
+ Reference <beans::XPropertySet> xPropSet1(mxShapes, uno::UNO_QUERY);
+ if(xPropSet1.is())
{
- XMLPropStyleContext* pPropStyle = (XMLPropStyleContext*)pStyle;
+ Reference< beans::XPropertySet > xPropSet( xPropSet1 );
+ Reference< beans::XPropertySet > xBackgroundSet;
- Reference <beans::XPropertySet> xPropSet1(mxShapes, uno::UNO_QUERY);
- if(xPropSet1.is())
+ const OUString aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
+ if( xPropSet1->getPropertySetInfo()->hasPropertyByName( aBackground ) )
{
- Reference< beans::XPropertySet > xPropSet( xPropSet1 );
- Reference< beans::XPropertySet > xBackgroundSet;
-
- const OUString aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
- if( xPropSet1->getPropertySetInfo()->hasPropertyByName( aBackground ) )
+ Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
+ if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
{
- Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
- if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
+ Reference< lang::XMultiServiceFactory > xServiceFact(GetSdImport().GetModel(), uno::UNO_QUERY);
+ if(xServiceFact.is())
{
- Reference< lang::XMultiServiceFactory > xServiceFact(GetSdImport().GetModel(), uno::UNO_QUERY);
- if(xServiceFact.is())
- {
- xBackgroundSet = Reference< beans::XPropertySet >::query(
- xServiceFact->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Background"))));
- }
+ xBackgroundSet = Reference< beans::XPropertySet >::query(
+ xServiceFact->createInstance(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Background"))));
}
-
- if( xBackgroundSet.is() )
- xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xBackgroundSet );
}
- if(xPropSet.is())
- {
- pPropStyle->FillPropertySet(xPropSet);
+ if( xBackgroundSet.is() )
+ xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xBackgroundSet );
+ }
- if( xBackgroundSet.is() )
- xPropSet1->setPropertyValue( aBackground, uno::makeAny( xBackgroundSet ) );
- }
+ if(xPropSet.is())
+ {
+ const_cast< XMLPropStyleContext* >(pPropStyle)->FillPropertySet(xPropSet);
+
+ if( xBackgroundSet.is() )
+ xPropSet1->setPropertyValue( aBackground, uno::makeAny( xBackgroundSet ) );
}
}
}
@@ -437,21 +433,23 @@ void SdXMLGenericPageContext::SetLayout()
const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext();
- if( pContext && pContext->ISA( SvXMLStyleContext ) )
+ if(pContext)
{
- const SdXMLStylesContext* pStyles = (SdXMLStylesContext*)pContext;
+ const SdXMLStylesContext* pStyles = dynamic_cast< const SdXMLStylesContext*>(pContext);
+
if(pStyles)
{
- const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName);
+ const SdXMLPresentationPageLayoutContext* pLayout = dynamic_cast< const SdXMLPresentationPageLayoutContext* >(
+ pStyles->FindStyleChildContext( XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName));
- if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext))
+ if(pLayout)
{
- SdXMLPresentationPageLayoutContext* pLayout = (SdXMLPresentationPageLayoutContext*)pStyle;
nType = pLayout->GetTypeId();
}
}
}
+
if( -1 == nType )
{
Reference< container::XNameAccess > xPageLayouts( GetSdImport().getPageLayouts() );
@@ -503,12 +501,11 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
// #80012# GetStylesContext() replaced with GetAutoStylesContext()
const SvXMLStylesContext* pAutoStyles = GetSdImport().GetShapeImport()->GetAutoStylesContext();
+ const SdXMLPageMasterContext* pPageMaster = dynamic_cast< const SdXMLPageMasterContext* >(
+ pAutoStyles ? pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID, rsPageMasterName) : 0);
- const SvXMLStyleContext* pStyle = pAutoStyles ? pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID, rsPageMasterName) : NULL;
-
- if(pStyle && pStyle->ISA(SdXMLPageMasterContext))
+ if(pPageMaster)
{
- const SdXMLPageMasterContext* pPageMaster = (SdXMLPageMasterContext*)pStyle;
const SdXMLPageMasterStyleContext* pPageMasterContext = pPageMaster->GetPageMasterStyle();
if(pPageMasterContext)
@@ -604,7 +601,7 @@ sal_Bool SAL_CALL NavigationOrderAccess::hasElements( ) throw (RuntimeException
return maShapes.empty() ? sal_False : sal_True;
}
-void SdXMLGenericPageContext::SetNavigationOrder()
+void SdXMLGenericPageContext::SetUserNavigationOrder()
{
if( msNavOrder.getLength() != 0 ) try
{
@@ -627,7 +624,7 @@ void SdXMLGenericPageContext::SetNavigationOrder()
{
if( !aShapes[nIndex].is() )
{
- DBG_ERROR("xmloff::SdXMLGenericPageContext::SetNavigationOrder(), draw:nav-order attribute incomplete!");
+ DBG_ERROR("xmloff::SdXMLGenericPageContext::SetUserNavigationOrder(), draw:nav-order attribute incomplete!");
// todo: warning?
return;
}
@@ -638,6 +635,6 @@ void SdXMLGenericPageContext::SetNavigationOrder()
}
catch( uno::Exception& )
{
- DBG_ERROR("xmloff::SdXMLGenericPageContext::SetNavigationOrder(), unexpected exception cought while importing shape navigation order!");
+ DBG_ERROR("xmloff::SdXMLGenericPageContext::SetUserNavigationOrder(), unexpected exception cought while importing shape navigation order!");
}
}
diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx
index 97f967a50898..5aadec2ce2e1 100644
--- a/xmloff/source/draw/ximppage.hxx
+++ b/xmloff/source/draw/ximppage.hxx
@@ -29,7 +29,6 @@
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/office/XAnnotationAccess.hpp>
-#include <tools/rtti.hxx>
#include "ximpshap.hxx"
//////////////////////////////////////////////////////////////////////////////
@@ -66,11 +65,9 @@ protected:
/** sets the properties from a page master style with the given name on this contexts page */
void SetPageMaster( rtl::OUString& rsPageMasterName );
- void SetNavigationOrder();
+ void SetUserNavigationOrder();
public:
- TYPEINFO();
-
SdXMLGenericPageContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes);
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 25fdcc070653..dbc3a73ca0f9 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -19,6 +19,8 @@
*
*************************************************************/
+
+
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
@@ -77,8 +79,11 @@
#include <tools/string.hxx>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
-#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <basegfx/point/b2dpoint.hxx>
+#include <memory.h>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -135,9 +140,6 @@ static bool ImpIsEmptyURL( const ::rtl::OUString& rURL )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SvXMLShapeContext, SvXMLImportContext );
-TYPEINIT1( SdXMLShapeContext, SvXMLShapeContext );
-
SdXMLShapeContext::SdXMLShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -156,7 +158,6 @@ SdXMLShapeContext::SdXMLShapeContext(
, mnZOrder(-1)
, maSize(1, 1)
, maPosition(0, 0)
-, maUsedTransformation()
, mbVisible(true)
, mbPrintable(true)
{
@@ -459,16 +460,8 @@ void SdXMLShapeContext::AddShape(uno::Reference< drawing::XShape >& xShape)
if( maShapeId.getLength() )
{
- const SdXMLGraphicObjectShapeContext* pGSC = dynamic_cast< const SdXMLGraphicObjectShapeContext* >(this);
-
- /* avoid registering when LateRegister is needed. E.g. MultiImage support where in-between multiple
- xShapes with the same ID would be registered. Registration is done after deciding which image
- to keep, see calls to solveMultipleImages */
- if(!pGSC || !pGSC->getLateAddToIdentifierMapper())
- {
- uno::Reference< uno::XInterface > xRef( xShape, uno::UNO_QUERY );
- GetImport().getInterfaceToIdentifierMapper().registerReference( maShapeId, xRef );
- }
+ uno::Reference< uno::XInterface > xRef( xShape, uno::UNO_QUERY );
+ GetImport().getInterfaceToIdentifierMapper().registerReference( maShapeId, xRef );
}
// #91065# count only if counting for shape import is enabled
@@ -534,7 +527,7 @@ void SdXMLShapeContext::SetTransformation()
uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
if(xPropSet.is())
{
- maUsedTransformation.identity();
+ ::basegfx::B2DHomMatrix aTransformation;
if(maSize.Width != 1 || maSize.Height != 1)
{
@@ -545,13 +538,13 @@ void SdXMLShapeContext::SetTransformation()
maSize.Height = 1;
// set global size. This should always be used.
- maUsedTransformation.scale(maSize.Width, maSize.Height);
+ aTransformation.scale(maSize.Width, maSize.Height);
}
if(maPosition.X != 0 || maPosition.Y != 0)
{
// if global position is used, add it to transformation
- maUsedTransformation.translate(maPosition.X, maPosition.Y);
+ aTransformation.translate(maPosition.X, maPosition.Y);
}
if(mnTransform.NeedsAction())
@@ -565,25 +558,13 @@ void SdXMLShapeContext::SetTransformation()
mnTransform.GetFullTransform(aMat);
// now add to transformation
- maUsedTransformation *= aMat;
+ aTransformation *= aMat;
}
// now set transformation for this object
uno::Any aAny;
drawing::HomogenMatrix3 aMatrix;
-
- aMatrix.Line1.Column1 = maUsedTransformation.get(0, 0);
- aMatrix.Line1.Column2 = maUsedTransformation.get(0, 1);
- aMatrix.Line1.Column3 = maUsedTransformation.get(0, 2);
-
- aMatrix.Line2.Column1 = maUsedTransformation.get(1, 0);
- aMatrix.Line2.Column2 = maUsedTransformation.get(1, 1);
- aMatrix.Line2.Column3 = maUsedTransformation.get(1, 2);
-
- aMatrix.Line3.Column1 = maUsedTransformation.get(2, 0);
- aMatrix.Line3.Column2 = maUsedTransformation.get(2, 1);
- aMatrix.Line3.Column3 = maUsedTransformation.get(2, 2);
-
+ basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(aTransformation, aMatrix);
aAny <<= aMatrix;
xPropSet->setPropertyValue(
@@ -625,9 +606,9 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
OUString aStyleName = maDrawStyleName;
uno::Reference< style::XStyle > xStyle;
- if( pStyle && pStyle->ISA(XMLShapeStyleContext) )
+ if( pStyle && dynamic_cast< const XMLShapeStyleContext* >(pStyle) )
{
- pDocStyle = PTR_CAST( XMLShapeStyleContext, pStyle );
+ pDocStyle = dynamic_cast< XMLShapeStyleContext* >( const_cast< SvXMLStyleContext* >( pStyle ) );
if( pDocStyle->GetStyle().is() )
{
@@ -723,7 +704,8 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
break;
const SvXMLStyleContext* pTempStyle = GetImport().GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(XML_STYLE_FAMILY_TEXT_PARAGRAPH, maTextStyleName);
- XMLPropStyleContext* pStyle = PTR_CAST( XMLPropStyleContext, pTempStyle ); // use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice
+ // use temp var, RTTI is a bad macro, FindStyleChildContext will be called twice
+ XMLPropStyleContext* pStyle = dynamic_cast< XMLPropStyleContext* >( const_cast< SvXMLStyleContext* >( pTempStyle ) );
if( pStyle == NULL )
break;
@@ -862,18 +844,10 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr
else if( IsXMLToken( rLocalName, XML_WIDTH ) )
{
GetImport().GetMM100UnitConverter().convertMeasure(maSize.Width, rValue);
- if( maSize.Width > 0 )
- maSize.Width += 1;
- else if( maSize.Width < 0 )
- maSize.Width -= 1;
}
else if( IsXMLToken( rLocalName, XML_HEIGHT ) )
{
GetImport().GetMM100UnitConverter().convertMeasure(maSize.Height, rValue);
- if( maSize.Height > 0 )
- maSize.Height += 1;
- else if( maSize.Height < 0 )
- maSize.Height -= 1;
}
else if( IsXMLToken( rLocalName, XML_TRANSFORM ) )
{
@@ -924,8 +898,6 @@ sal_Bool SdXMLShapeContext::isPresentationShape() const
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLRectShapeContext, SdXMLShapeContext );
-
SdXMLRectShapeContext::SdXMLRectShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -998,8 +970,6 @@ void SdXMLRectShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////3////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLLineShapeContext, SdXMLShapeContext );
-
SdXMLLineShapeContext::SdXMLLineShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1069,49 +1039,46 @@ void SdXMLLineShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib
SetStyle();
SetLayer();
- // get sizes and offsets
- awt::Point aTopLeft(mnX1, mnY1);
- awt::Point aBottomRight(mnX2, mnY2);
-
- if(mnX1 > mnX2)
- {
- aTopLeft.X = mnX2;
- aBottomRight.X = mnX1;
- }
-
- if(mnY1 > mnY2)
- {
- aTopLeft.Y = mnY2;
- aBottomRight.Y = mnY1;
- }
-
- // set local parameters on shape
+ // Set Line data by setting both given points as Polygon data. It is also possible
+ // to use the transformation, but this would require to set any two points first
+ // so that the xSpahe is recognized and handled as line shape, so it is more safe
+ // to set the points directly (and needs to be called anyways)
uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
+
if(xPropSet.is())
{
- drawing::PointSequenceSequence aPolyPoly(1L);
+ drawing::PointSequenceSequence aPolyPoly(1);
drawing::PointSequence* pOuterSequence = aPolyPoly.getArray();
- pOuterSequence->realloc(2L);
+ pOuterSequence->realloc(2);
awt::Point* pInnerSequence = pOuterSequence->getArray();
uno::Any aAny;
- *pInnerSequence = awt::Point( mnX1 - aTopLeft.X, mnY1 - aTopLeft.Y);
+ *pInnerSequence = awt::Point(mnX1, mnY1);
pInnerSequence++;
- *pInnerSequence = awt::Point( mnX2 - aTopLeft.X, mnY2 - aTopLeft.Y);
+ *pInnerSequence = awt::Point(mnX2, mnY2);
aAny <<= aPolyPoly;
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny);
- }
+ xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny);
- // set sizes for transformation
- maSize.Width = aBottomRight.X - aTopLeft.X;
- maSize.Height = aBottomRight.Y - aTopLeft.Y;
- maPosition.X = aTopLeft.X;
- maPosition.Y = aTopLeft.Y;
+ if(mnTransform.NeedsAction())
+ {
+ // transformation is used, apply to object. To do so, get the
+ // current transformation, apply mnTransform and set
+ drawing::HomogenMatrix3 aMatrix;
- // set pos, size, shear and rotate and get copy of matrix
- SetTransformation();
+ aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")));
+ aAny >>= aMatrix;
+ basegfx::B2DHomMatrix aB2DMatrix(basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix));
+
+ basegfx::B2DHomMatrix aMat;
+ mnTransform.GetFullTransform(aMat);
+ aB2DMatrix *= aMat;
+
+ basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(aB2DMatrix, aMatrix);
+ aAny <<= aMatrix;
+ xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")), aAny);
+ }
+ }
SdXMLShapeContext::StartElement(xAttrList);
}
@@ -1120,8 +1087,6 @@ void SdXMLLineShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLEllipseShapeContext, SdXMLShapeContext );
-
SdXMLEllipseShapeContext::SdXMLEllipseShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1250,8 +1215,6 @@ void SdXMLEllipseShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLPolygonShapeContext, SdXMLShapeContext );
-
SdXMLPolygonShapeContext::SdXMLPolygonShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1324,7 +1287,7 @@ void SdXMLPolygonShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
}
awt::Point aPosition(aViewBox.GetX(), aViewBox.GetY());
SdXMLImExPointsElement aPoints(maPoints, aViewBox,
- aPosition, aSize, GetImport().GetMM100UnitConverter());
+ aPosition, aSize, GetImport().GetMM100UnitConverter(), mbClosed);
uno::Any aAny;
aAny <<= aPoints.GetPointSequenceSequence();
@@ -1343,8 +1306,6 @@ void SdXMLPolygonShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLPathShapeContext, SdXMLShapeContext );
-
SdXMLPathShapeContext::SdXMLPathShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1478,8 +1439,6 @@ void SdXMLPathShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLTextBoxShapeContext, SdXMLShapeContext );
-
SdXMLTextBoxShapeContext::SdXMLTextBoxShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1652,8 +1611,6 @@ void SdXMLTextBoxShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLControlShapeContext, SdXMLShapeContext );
-
SdXMLControlShapeContext::SdXMLControlShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1726,8 +1683,6 @@ void SdXMLControlShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLConnectorShapeContext, SdXMLShapeContext );
-
SdXMLConnectorShapeContext::SdXMLConnectorShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1962,8 +1917,6 @@ void SdXMLConnectorShapeContext::StartElement(const uno::Reference< xml::sax::XA
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLMeasureShapeContext, SdXMLShapeContext );
-
SdXMLMeasureShapeContext::SdXMLMeasureShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -2077,8 +2030,6 @@ void SdXMLMeasureShapeContext::EndElement()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLPageShapeContext, SdXMLShapeContext );
-
SdXMLPageShapeContext::SdXMLPageShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -2174,8 +2125,6 @@ void SdXMLPageShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLCaptionShapeContext, SdXMLShapeContext );
-
SdXMLCaptionShapeContext::SdXMLCaptionShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -2279,8 +2228,6 @@ void SdXMLCaptionShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLGraphicObjectShapeContext, SdXMLShapeContext );
-
SdXMLGraphicObjectShapeContext::SdXMLGraphicObjectShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -2289,8 +2236,7 @@ SdXMLGraphicObjectShapeContext::SdXMLGraphicObjectShapeContext(
uno::Reference< drawing::XShapes >& rShapes,
sal_Bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
- maURL(),
- mbLateAddToIdentifierMapper(false)
+ maURL()
{
}
@@ -2458,8 +2404,6 @@ SdXMLGraphicObjectShapeContext::~SdXMLGraphicObjectShapeContext()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLChartShapeContext, SdXMLShapeContext );
-
SdXMLChartShapeContext::SdXMLChartShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -2570,8 +2514,6 @@ SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPre
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLObjectShapeContext, SdXMLShapeContext );
-
SdXMLObjectShapeContext::SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -2789,8 +2731,6 @@ SvXMLImportContext* SdXMLObjectShapeContext::CreateChildContext(
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLAppletShapeContext, SdXMLShapeContext );
-
SdXMLAppletShapeContext::SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -2954,8 +2894,6 @@ SvXMLImportContext * SdXMLAppletShapeContext::CreateChildContext( sal_uInt16 p_n
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLPluginShapeContext, SdXMLShapeContext );
-
SdXMLPluginShapeContext::SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -3226,8 +3164,6 @@ SvXMLImportContext * SdXMLPluginShapeContext::CreateChildContext( sal_uInt16 p_n
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLFloatingFrameShapeContext, SdXMLShapeContext );
-
SdXMLFloatingFrameShapeContext::SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -3323,8 +3259,6 @@ void SdXMLFloatingFrameShapeContext::EndElement()
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLFrameShapeContext, SdXMLShapeContext );
-
SdXMLFrameShapeContext::SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -3430,16 +3364,9 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
mbSupportsReplacement = IsXMLToken(rLocalName, XML_OBJECT ) || IsXMLToken(rLocalName, XML_OBJECT_OLE);
setSupportsMultipleContents(IsXMLToken(rLocalName, XML_IMAGE));
- if(getSupportsMultipleContents())
+ if(getSupportsMultipleContents() && dynamic_cast< SdXMLGraphicObjectShapeContext* >(pContext))
{
- SdXMLGraphicObjectShapeContext* pGSC = dynamic_cast< SdXMLGraphicObjectShapeContext* >(pContext);
-
- if(pGSC)
- {
- // mark context as LateAdd to avoid conflicts with multiple objects registering with the same ID
- pGSC->setLateAddToIdentifierMapper(true);
- addContent(*mxImplContext);
- }
+ addContent(*mxImplContext);
}
}
else if(getSupportsMultipleContents() && XML_NAMESPACE_DRAW == nPrefix && IsXMLToken(rLocalName, XML_IMAGE))
@@ -3449,12 +3376,8 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList);
mxImplContext = pContext;
- SdXMLGraphicObjectShapeContext* pGSC = dynamic_cast< SdXMLGraphicObjectShapeContext* >(pContext);
-
- if(pGSC)
+ if(dynamic_cast< SdXMLGraphicObjectShapeContext* >(pContext))
{
- // mark context as LateAdd to avoid conflicts with multiple objects registering with the same ID
- pGSC->setLateAddToIdentifierMapper(true);
addContent(*mxImplContext);
}
}
@@ -3465,7 +3388,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
// read replacement image
SvXMLImportContext *pImplContext = &mxImplContext;
SdXMLShapeContext *pSContext =
- PTR_CAST( SdXMLShapeContext, pImplContext );
+ dynamic_cast< SdXMLShapeContext* >( pImplContext );
if( pSContext )
{
uno::Reference < beans::XPropertySet > xPropSet(
@@ -3486,7 +3409,7 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
IsXMLToken( rLocalName, XML_THUMBNAIL ) ) ) )
{
SvXMLImportContext *pImplContext = &mxImplContext;
- pContext = PTR_CAST( SdXMLShapeContext, pImplContext )->CreateChildContext( nPrefix,
+ pContext = dynamic_cast< SdXMLShapeContext* >( pImplContext )->CreateChildContext( nPrefix,
rLocalName, xAttrList );
}
else if ( (XML_NAMESPACE_DRAW == nPrefix) && IsXMLToken( rLocalName, XML_IMAGE_MAP ) )
@@ -3517,15 +3440,7 @@ void SdXMLFrameShapeContext::StartElement(const uno::Reference< xml::sax::XAttri
void SdXMLFrameShapeContext::EndElement()
{
/// solve if multiple image child contexts were imported
- const SvXMLImportContext* pWinner = solveMultipleImages();
- const SdXMLGraphicObjectShapeContext* pGSCWinner = dynamic_cast< const SdXMLGraphicObjectShapeContext* >(pWinner);
-
- /// if we have a winner and it's on LateAdd, add it now
- if(pGSCWinner && pGSCWinner->getLateAddToIdentifierMapper() && pGSCWinner->getShapeId().getLength())
- {
- uno::Reference< uno::XInterface > xRef( pGSCWinner->getShape(), uno::UNO_QUERY );
- GetImport().getInterfaceToIdentifierMapper().registerReference( pGSCWinner->getShapeId(), xRef );
- }
+ solveMultipleImages();
if( !mxImplContext.Is() )
{
@@ -3592,8 +3507,6 @@ void SdXMLFrameShapeContext::processAttribute( sal_uInt16,
// ignore
}
-TYPEINIT1( SdXMLCustomShapeContext, SdXMLShapeContext );
-
SdXMLCustomShapeContext::SdXMLCustomShapeContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -3644,9 +3557,6 @@ void SdXMLCustomShapeContext::StartElement( const uno::Reference< xml::sax::XAtt
SetStyle();
SetLayer();
- // set pos, size, shear and rotate
- SetTransformation();
-
try
{
uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
@@ -3670,54 +3580,19 @@ void SdXMLCustomShapeContext::StartElement( const uno::Reference< xml::sax::XAtt
{
DBG_ERROR( "could not set enhanced customshape geometry" );
}
+
+ // Set transformation AFTER setting CustomShape data, else
+ // evtl. already applied actions, e.g. mirror, will be lost. If
+ // e.g. a negative scale in X and/or Y gets loaded, this needs to be
+ // applied as needed
+ SetTransformation();
+
SdXMLShapeContext::StartElement(xAttrList);
}
}
void SdXMLCustomShapeContext::EndElement()
{
- // for backward compatibility, the above SetTransformation() may alraedy have
- // applied a call to SetMirroredX/SetMirroredY. This is not yet added to the
- // beans::PropertyValues in maCustomShapeGeometry. When applying these now, this
- // would be lost again.
- // TTTT: Remove again after aw080
- if(!maUsedTransformation.isIdentity())
- {
- basegfx::B2DVector aScale, aTranslate;
- double fRotate, fShearX;
-
- maUsedTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
-
- bool bFlippedX(aScale.getX() < 0.0);
- bool bFlippedY(aScale.getY() < 0.0);
-
- if(bFlippedX && bFlippedY)
- {
- // when both are used it is the same as 180 degree rotation; reset
- bFlippedX = bFlippedY = false;
- }
-
- if(bFlippedX || bFlippedY)
- {
- beans::PropertyValue aNewPoroperty;
-
- if(bFlippedX)
- {
- aNewPoroperty.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MirroredX"));
- }
- else
- {
- aNewPoroperty.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MirroredY"));
- }
-
- aNewPoroperty.Handle = -1;
- aNewPoroperty.Value <<= sal_True;
- aNewPoroperty.State = beans::PropertyState_DIRECT_VALUE;
-
- maCustomShapeGeometry.push_back(aNewPoroperty);
- }
- }
-
if ( !maCustomShapeGeometry.empty() )
{
const rtl::OUString sCustomShapeGeometry ( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) );
@@ -3789,8 +3664,6 @@ SvXMLImportContext* SdXMLCustomShapeContext::CreateChildContext(
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLTableShapeContext, SdXMLShapeContext );
-
SdXMLTableShapeContext::SdXMLTableShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes )
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, sal_False )
{
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index 94239026991d..76bb00d3886b 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -19,6 +19,8 @@
*
*************************************************************/
+
+
#ifndef _XIMPSHAPE_HXX
#define _XIMPSHAPE_HXX
@@ -31,12 +33,11 @@
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/awt/Point.hpp>
-#include <tools/rtti.hxx>
#include "xexptran.hxx"
+
#include <vector>
#include <xmloff/shapeimport.hxx>
#include <xmloff/xmlmultiimagehelper.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
// common shape context
@@ -77,7 +78,6 @@ protected:
SdXMLImExTransform2D mnTransform;
com::sun::star::awt::Size maSize;
com::sun::star::awt::Point maPosition;
- basegfx::B2DHomMatrix maUsedTransformation;
bool mbVisible;
bool mbPrintable;
@@ -99,8 +99,6 @@ protected:
sal_Bool isPresentationShape() const;
public:
- TYPEINFO();
-
SdXMLShapeContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
@@ -117,9 +115,6 @@ public:
// this is called from the parent group for each unparsed attribute in the attribute list
virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-
- /// access to ShapeId for evtl. late adding
- const rtl::OUString& getShapeId() const { return maShapeId; }
};
//////////////////////////////////////////////////////////////////////////////
@@ -130,8 +125,6 @@ class SdXMLRectShapeContext : public SdXMLShapeContext
sal_Int32 mnRadius;
public:
- TYPEINFO();
-
SdXMLRectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -155,8 +148,6 @@ class SdXMLLineShapeContext : public SdXMLShapeContext
sal_Int32 mnY2;
public:
- TYPEINFO();
-
SdXMLLineShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -183,8 +174,6 @@ class SdXMLEllipseShapeContext : public SdXMLShapeContext
sal_Int32 mnStartAngle;
sal_Int32 mnEndAngle;
public:
- TYPEINFO();
-
SdXMLEllipseShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -207,8 +196,6 @@ class SdXMLPolygonShapeContext : public SdXMLShapeContext
sal_Bool mbClosed;
public:
- TYPEINFO();
-
SdXMLPolygonShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -230,8 +217,6 @@ class SdXMLPathShapeContext : public SdXMLShapeContext
sal_Bool mbClosed;
public:
- TYPEINFO();
-
SdXMLPathShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -252,8 +237,6 @@ class SdXMLTextBoxShapeContext : public SdXMLShapeContext
sal_Int32 mnRadius;
public:
- TYPEINFO();
-
SdXMLTextBoxShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -275,8 +258,6 @@ private:
rtl::OUString maFormId;
public:
- TYPEINFO();
-
SdXMLControlShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -312,8 +293,6 @@ private:
com::sun::star::uno::Any maPath;
public:
- TYPEINFO();
-
SdXMLConnectorShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -336,8 +315,6 @@ private:
::com::sun::star::awt::Point maEnd;
public:
- TYPEINFO();
-
SdXMLMeasureShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -359,8 +336,6 @@ class SdXMLPageShapeContext : public SdXMLShapeContext
private:
sal_Int32 mnPageNumber;
public:
- TYPEINFO();
-
SdXMLPageShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -383,8 +358,6 @@ private:
sal_Int32 mnRadius;
public:
- TYPEINFO();
-
SdXMLCaptionShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -406,12 +379,7 @@ private:
::rtl::OUString maURL;
::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
- /// bitfield
- bool mbLateAddToIdentifierMapper : 1;
-
public:
- TYPEINFO();
-
SdXMLGraphicObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -426,10 +394,6 @@ public:
// this is called from the parent group for each unparsed attribute in the attribute list
virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue );
-
- /// support for LateAddToIdentifierMapper
- bool getLateAddToIdentifierMapper() const { return mbLateAddToIdentifierMapper; }
- void setLateAddToIdentifierMapper(bool bNew) { mbLateAddToIdentifierMapper = bNew; }
};
//////////////////////////////////////////////////////////////////////////////
@@ -440,8 +404,6 @@ class SdXMLChartShapeContext : public SdXMLShapeContext
SvXMLImportContext* mpChartContext;
public:
- TYPEINFO();
-
SdXMLChartShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -469,8 +431,6 @@ private:
::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
public:
- TYPEINFO();
-
SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -503,8 +463,6 @@ private:
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
public:
- TYPEINFO();
-
SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -535,8 +493,6 @@ private:
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maParams;
public:
- TYPEINFO();
-
SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -564,8 +520,6 @@ private:
rtl::OUString maHref;
public:
- TYPEINFO();
-
SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -596,8 +550,6 @@ protected:
virtual void removeGraphicFromImportContext(const SvXMLImportContext& rContext) const;
public:
- TYPEINFO();
-
SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
@@ -626,8 +578,6 @@ protected :
public:
- TYPEINFO();
-
SdXMLCustomShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
@@ -650,8 +600,6 @@ public:
class SdXMLTableShapeContext : public SdXMLShapeContext
{
public:
- TYPEINFO();
-
SdXMLTableShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx
index 839212f76b6a..1bb733b0d1bd 100644
--- a/xmloff/source/draw/ximpshow.cxx
+++ b/xmloff/source/draw/ximpshow.cxx
@@ -76,8 +76,6 @@ public:
///////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLShowsContext, SvXMLImportContext );
-
SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList )
: SvXMLImportContext(rImport, nPrfx, rLocalName)
{
diff --git a/xmloff/source/draw/ximpshow.hxx b/xmloff/source/draw/ximpshow.hxx
index fb0508df4d72..583a9e3bbc1f 100644
--- a/xmloff/source/draw/ximpshow.hxx
+++ b/xmloff/source/draw/ximpshow.hxx
@@ -37,8 +37,6 @@ class SdXMLShowsContext : public SvXMLImportContext
ShowsImpImpl* mpImpl;
public:
- TYPEINFO();
-
SdXMLShowsContext( SdXMLImport& rImport,
sal_uInt16 nPrfx,
const rtl::OUString& rLocalName,
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index e3cde0d578f9..cdbc35099d7a 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -67,8 +67,6 @@ class SdXMLDrawingPagePropertySetContext : public SvXMLPropertySetContext
{
public:
- TYPEINFO();
-
SdXMLDrawingPagePropertySetContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -86,8 +84,6 @@ public:
const XMLPropertyState& rProp);
};
-TYPEINIT1( SdXMLDrawingPagePropertySetContext, SvXMLPropertySetContext );
-
SdXMLDrawingPagePropertySetContext::SdXMLDrawingPagePropertySetContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -146,8 +142,6 @@ SvXMLImportContext *SdXMLDrawingPagePropertySetContext::CreateChildContext(
class SdXMLDrawingPageStyleContext : public XMLPropStyleContext
{
public:
- TYPEINFO();
-
SdXMLDrawingPageStyleContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -170,8 +164,6 @@ public:
::com::sun::star::beans::XPropertySet > & rPropSet );
};
-TYPEINIT1( SdXMLDrawingPageStyleContext, XMLPropStyleContext );
-
SdXMLDrawingPageStyleContext::SdXMLDrawingPageStyleContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -238,8 +230,9 @@ void SdXMLDrawingPageStyleContext::Finish( sal_Bool bOverwrite )
sal_Int32 nStyle = 0;
SdXMLNumberFormatImportContext* pSdNumStyle =
- PTR_CAST( SdXMLNumberFormatImportContext,
- GetStyles()->FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, sStyleName, sal_True ) );
+ dynamic_cast< SdXMLNumberFormatImportContext* >(
+ const_cast< SvXMLStyleContext* >(
+ GetStyles()->FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, sStyleName, sal_True )));
if( pSdNumStyle )
nStyle = pSdNumStyle->GetDrawKey();
@@ -315,8 +308,6 @@ void SdXMLDrawingPageStyleContext::FillPropertySet(
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLPageMasterStyleContext, SvXMLStyleContext );
-
SdXMLPageMasterStyleContext::SdXMLPageMasterStyleContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -396,8 +387,6 @@ SdXMLPageMasterStyleContext::~SdXMLPageMasterStyleContext()
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLPageMasterContext, SvXMLStyleContext );
-
SdXMLPageMasterContext::SdXMLPageMasterContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -473,8 +462,6 @@ SvXMLImportContext *SdXMLPageMasterContext::CreateChildContext(
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLPresentationPageLayoutContext, SvXMLStyleContext );
-
SdXMLPresentationPageLayoutContext::SdXMLPresentationPageLayoutContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -821,8 +808,6 @@ SdXMLPresentationPlaceholderContext::~SdXMLPresentationPlaceholderContext()
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLMasterPageContext, SdXMLGenericPageContext );
-
SdXMLMasterPageContext::SdXMLMasterPageContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -926,11 +911,14 @@ SdXMLMasterPageContext::~SdXMLMasterPageContext()
void SdXMLMasterPageContext::EndElement()
{
// set styles on master-page
- if(msName.getLength() && GetSdImport().GetShapeImport()->GetStylesContext())
+ if(msName.getLength())
{
- SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext();
- if( pContext && pContext->ISA( SvXMLStyleContext ) )
- ((SdXMLStylesContext*)pContext)->SetMasterPageStyles(*this);
+ SdXMLStylesContext* pContext = dynamic_cast< SdXMLStylesContext* >(GetSdImport().GetShapeImport()->GetStylesContext());
+
+ if( pContext )
+ {
+ pContext->SetMasterPageStyles(*this);
+ }
}
SdXMLGenericPageContext::EndElement();
@@ -1002,8 +990,6 @@ SvXMLImportContext* SdXMLMasterPageContext::CreateChildContext(
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( SdXMLStylesContext, SvXMLStyleContext );
-
SdXMLStylesContext::SdXMLStylesContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1255,23 +1241,23 @@ void SdXMLStylesContext::EndElement()
// associate AutoStyles with styles in preparation to setting Styles on shapes
for(sal_uInt32 a(0L); a < GetStyleCount(); a++)
{
- const SvXMLStyleContext* pStyle = GetStyle(a);
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
+ const XMLShapeStyleContext* pDocStyle = dynamic_cast< const XMLShapeStyleContext* >(GetStyle(a));
+
+ if(pDocStyle)
{
- XMLShapeStyleContext* pDocStyle = (XMLShapeStyleContext*)pStyle;
// pDocStyle->Filter();
+ const SvXMLStylesContext* pStylesContext = GetSdImport().GetShapeImport()->GetStylesContext();
- SvXMLStylesContext* pStylesContext = GetSdImport().GetShapeImport()->GetStylesContext();
if( pStylesContext )
{
- pStyle = pStylesContext->FindStyleChildContext(pStyle->GetFamily(), pStyle->GetParentName());
+ const XMLShapeStyleContext* pParentStyle = dynamic_cast< const XMLShapeStyleContext* >(
+ pStylesContext->FindStyleChildContext(pDocStyle->GetFamily(), pDocStyle->GetParentName()));
- if(pStyle && pStyle->ISA(XMLShapeStyleContext))
+ if(pParentStyle)
{
- XMLShapeStyleContext* pParentStyle = (XMLShapeStyleContext*)pStyle;
if(pParentStyle->GetStyle().is())
{
- pDocStyle->SetStyle(pParentStyle->GetStyle());
+ const_cast< XMLShapeStyleContext* >(pDocStyle)->SetStyle(pParentStyle->GetStyle());
}
}
}
@@ -1521,11 +1507,11 @@ uno::Reference< container::XNameAccess > SdXMLStylesContext::getPageLayouts() co
for(sal_uInt32 a(0L); a < GetStyleCount(); a++)
{
- const SvXMLStyleContext* pStyle = GetStyle(a);
- if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext))
+ const SdXMLPresentationPageLayoutContext* pStyle = dynamic_cast< const SdXMLPresentationPageLayoutContext* >(GetStyle(a));
+
+ if(pStyle)
{
- xLayouts->insertByName( pStyle->GetName(), uno::makeAny(
- (sal_Int32)((SdXMLPresentationPageLayoutContext*)pStyle)->GetTypeId() ) );
+ xLayouts->insertByName( pStyle->GetName(), uno::makeAny( (sal_Int32)pStyle->GetTypeId() ) );
}
}
@@ -1535,8 +1521,6 @@ uno::Reference< container::XNameAccess > SdXMLStylesContext::getPageLayouts() co
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
-TYPEINIT1( SdXMLMasterStylesContext, SvXMLImportContext );
-
SdXMLMasterStylesContext::SdXMLMasterStylesContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1667,6 +1651,7 @@ sal_Bool SdXMLHeaderFooterDeclContext::IsTransient() const
void SdXMLHeaderFooterDeclContext::EndElement()
{
SdXMLImport& rImport = *dynamic_cast< SdXMLImport* >( &GetImport() );
+
if( IsXMLToken( GetLocalName(), XML_HEADER_DECL ) )
{
rImport.AddHeaderDecl( maStrName, maStrText );
diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx
index 36cf4f260136..eb2466132664 100644
--- a/xmloff/source/draw/ximpstyl.hxx
+++ b/xmloff/source/draw/ximpstyl.hxx
@@ -50,8 +50,6 @@ class SdXMLPageMasterStyleContext: public SvXMLStyleContext
SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
public:
- TYPEINFO();
-
SdXMLPageMasterStyleContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -80,8 +78,6 @@ class SdXMLPageMasterContext: public SvXMLStyleContext
SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
public:
- TYPEINFO();
-
SdXMLPageMasterContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -108,8 +104,6 @@ class SdXMLMasterPageContext: public SdXMLGenericPageContext
rtl::OUString msStyleName;
public:
- TYPEINFO();
-
SdXMLMasterPageContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -174,8 +168,6 @@ class SdXMLPresentationPageLayoutContext: public SvXMLStyleContext
SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
public:
- TYPEINFO();
-
SdXMLPresentationPageLayoutContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -227,8 +219,6 @@ protected:
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList > & xAttrList );
public:
- TYPEINFO();
-
SdXMLStylesContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -257,8 +247,6 @@ class SdXMLMasterStylesContext : public SvXMLImportContext
SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
public:
- TYPEINFO();
-
SdXMLMasterStylesContext(
SdXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index d02824c63eb2..f13ed31db6a1 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -618,7 +618,7 @@ namespace xmloff
const SvXMLStyleContext* pStyleContext = m_rContext.getStyleElement( _rValue );
OSL_ENSURE( pStyleContext, "OElementImport::handleAttribute: do not know the style!" );
// remember the element for later usage.
- m_pStyleElement = PTR_CAST( XMLTextStyleContext, pStyleContext );
+ m_pStyleElement = dynamic_cast< const XMLTextStyleContext* >( pStyleContext );
return true;
}
diff --git a/xmloff/source/forms/formsimp.cxx b/xmloff/source/forms/formsimp.cxx
index fc69d68aad8a..eaf87af9d908 100644
--- a/xmloff/source/forms/formsimp.cxx
+++ b/xmloff/source/forms/formsimp.cxx
@@ -36,8 +36,6 @@ using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-TYPEINIT1( XMLFormsContext, SvXMLImportContext );
-
XMLFormsContext::XMLFormsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName )
: SvXMLImportContext(rImport, nPrfx, rLocalName)
{
diff --git a/xmloff/source/forms/officeforms.cxx b/xmloff/source/forms/officeforms.cxx
index 32657ce85c88..11dc35039070 100644
--- a/xmloff/source/forms/officeforms.cxx
+++ b/xmloff/source/forms/officeforms.cxx
@@ -48,8 +48,6 @@ namespace xmloff
//=========================================================================
//= OFormsRootImport
//=========================================================================
- TYPEINIT1(OFormsRootImport, SvXMLImportContext);
- //-------------------------------------------------------------------------
OFormsRootImport::OFormsRootImport( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName )
:SvXMLImportContext(rImport, nPrfx, rLocalName)
{
diff --git a/xmloff/source/forms/officeforms.hxx b/xmloff/source/forms/officeforms.hxx
index 2772e64e8af0..93d74b0e69e6 100644
--- a/xmloff/source/forms/officeforms.hxx
+++ b/xmloff/source/forms/officeforms.hxx
@@ -44,8 +44,6 @@ namespace xmloff
,public OStackedLogging
{
public:
- TYPEINFO();
-
OFormsRootImport( SvXMLImport& _rImport, sal_uInt16 _nPrfx, const rtl::OUString& _rLocalName);
virtual ~OFormsRootImport();
diff --git a/xmloff/source/script/XMLEventsImportContext.cxx b/xmloff/source/script/XMLEventsImportContext.cxx
index 6f50c0b14fa4..154eab95ba35 100644
--- a/xmloff/source/script/XMLEventsImportContext.cxx
+++ b/xmloff/source/script/XMLEventsImportContext.cxx
@@ -49,9 +49,6 @@ using ::com::sun::star::container::XNameReplace;
using ::com::sun::star::document::XEventsSupplier;
using ::com::sun::star::lang::IllegalArgumentException;
-TYPEINIT1(XMLEventsImportContext, SvXMLImportContext);
-
-
XMLEventsImportContext::XMLEventsImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx
index 71edd0938bde..e23f53cb9873 100644
--- a/xmloff/source/style/FillStyleContext.cxx
+++ b/xmloff/source/style/FillStyleContext.cxx
@@ -45,8 +45,6 @@ using ::rtl::OUStringBuffer;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLGradientStyleContext, SvXMLStyleContext );
-
XMLGradientStyleContext::XMLGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
@@ -94,8 +92,6 @@ sal_Bool XMLGradientStyleContext::IsTransient() const
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLHatchStyleContext, SvXMLStyleContext );
-
XMLHatchStyleContext::XMLHatchStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
@@ -140,8 +136,6 @@ sal_Bool XMLHatchStyleContext::IsTransient() const
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLBitmapStyleContext, SvXMLStyleContext );
-
XMLBitmapStyleContext::XMLBitmapStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
@@ -221,8 +215,6 @@ sal_Bool XMLBitmapStyleContext::IsTransient() const
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLTransGradientStyleContext, SvXMLStyleContext );
-
XMLTransGradientStyleContext::XMLTransGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
@@ -267,8 +259,6 @@ sal_Bool XMLTransGradientStyleContext::IsTransient() const
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLMarkerStyleContext, SvXMLStyleContext );
-
XMLMarkerStyleContext::XMLMarkerStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
@@ -313,8 +303,6 @@ sal_Bool XMLMarkerStyleContext::IsTransient() const
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
-TYPEINIT1( XMLDashStyleContext, SvXMLStyleContext );
-
XMLDashStyleContext::XMLDashStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
diff --git a/xmloff/source/style/FillStyleContext.hxx b/xmloff/source/style/FillStyleContext.hxx
index 8ed35d0b0b3a..35fc09f0ce31 100644
--- a/xmloff/source/style/FillStyleContext.hxx
+++ b/xmloff/source/style/FillStyleContext.hxx
@@ -38,8 +38,6 @@ private:
rtl::OUString maStrName;
public:
- TYPEINFO();
-
XMLGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual ~XMLGradientStyleContext();
@@ -59,8 +57,6 @@ private:
rtl::OUString maStrName;
public:
- TYPEINFO();
-
XMLHatchStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual ~XMLHatchStyleContext();
@@ -81,8 +77,6 @@ private:
::com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > mxBase64Stream;
public:
- TYPEINFO();
-
XMLBitmapStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual ~XMLBitmapStyleContext();
@@ -107,8 +101,6 @@ private:
rtl::OUString maStrName;
public:
- TYPEINFO();
-
XMLTransGradientStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual ~XMLTransGradientStyleContext();
@@ -128,8 +120,6 @@ private:
rtl::OUString maStrName;
public:
- TYPEINFO();
-
XMLMarkerStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual ~XMLMarkerStyleContext();
@@ -149,8 +139,6 @@ private:
rtl::OUString maStrName;
public:
- TYPEINFO();
-
XMLDashStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual ~XMLDashStyleContext();
diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx
index 3902d32d8661..2d553e973d1e 100644
--- a/xmloff/source/style/PageMasterImportContext.cxx
+++ b/xmloff/source/style/PageMasterImportContext.cxx
@@ -62,8 +62,6 @@ void PageStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
}
}
-TYPEINIT1( PageStyleContext, XMLPropStyleContext );
-
PageStyleContext::PageStyleContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const rtl::OUString& rLName,
const uno::Reference< xml::sax::XAttributeList > & xAttrList,
diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx
index 22f37a2aa1a2..100b0007497b 100644
--- a/xmloff/source/style/XMLBackgroundImageContext.cxx
+++ b/xmloff/source/style/XMLBackgroundImageContext.cxx
@@ -169,8 +169,6 @@ void lcl_xmlbic_MergeVertPos( GraphicLocation& ePos,
}
}
-TYPEINIT1( XMLBackgroundImageContext, XMLElementPropertyContext );
-
void XMLBackgroundImageContext::ProcessAttrs(
const Reference< xml::sax::XAttributeList >& xAttrList )
{
diff --git a/xmloff/source/style/XMLElementPropertyContext.cxx b/xmloff/source/style/XMLElementPropertyContext.cxx
index baecfbdf4881..ccae924f68d7 100644
--- a/xmloff/source/style/XMLElementPropertyContext.cxx
+++ b/xmloff/source/style/XMLElementPropertyContext.cxx
@@ -29,8 +29,6 @@
using ::rtl::OUString;
-TYPEINIT1( XMLElementPropertyContext , SvXMLImportContext );
-
XMLElementPropertyContext::XMLElementPropertyContext (
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx
index e922f9bdea68..d5f3a7e89d8f 100644
--- a/xmloff/source/style/XMLFontStylesContext.cxx
+++ b/xmloff/source/style/XMLFontStylesContext.cxx
@@ -101,8 +101,6 @@ class XMLFontStyleContext_Impl : public SvXMLStyleContext
public:
- TYPEINFO();
-
XMLFontStyleContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -122,8 +120,6 @@ public:
};
-TYPEINIT1( XMLFontStyleContext_Impl, SvXMLStyleContext );
-
XMLFontStyleContext_Impl::XMLFontStyleContext_Impl( SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const Reference< XAttributeList > & xAttrList,
@@ -239,8 +235,6 @@ SvXMLStyleContext *XMLFontStylesContext::CreateStyleChildContext(
return pStyle;
}
-TYPEINIT1( XMLFontStylesContext, SvXMLStylesContext );
-
XMLFontStylesContext::XMLFontStylesContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const Reference< XAttributeList > & xAttrList,
@@ -273,7 +267,7 @@ sal_Bool XMLFontStylesContext::FillProperties( const OUString& rName,
sal_Int32 nCharsetIdx ) const
{
const SvXMLStyleContext* pStyle = FindStyleChildContext( XML_STYLE_FAMILY_FONT, rName, sal_True );
- const XMLFontStyleContext_Impl *pFontStyle = PTR_CAST( XMLFontStyleContext_Impl,pStyle);// use temp var, PTR_CAST is a bad macro, FindStyleChildContext will be called twice
+ const XMLFontStyleContext_Impl *pFontStyle = dynamic_cast< const XMLFontStyleContext_Impl* >( pStyle);// use temp var, RTTI is a bad macro, FindStyleChildContext will be called twice
if( pFontStyle )
pFontStyle->FillProperties( rProps, nFamilyNameIdx, nStyleNameIdx,
nFamilyIdx, nPitchIdx, nCharsetIdx );
diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
index 8203d470a31b..8ac277b735f9 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
@@ -58,9 +58,6 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1(XMLFootnoteSeparatorImport, SvXMLImportContext);
-
-
XMLFootnoteSeparatorImport::XMLFootnoteSeparatorImport(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.hxx b/xmloff/source/style/XMLFootnoteSeparatorImport.hxx
index 108c389676cb..cd2905d43bff 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorImport.hxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorImport.hxx
@@ -53,8 +53,6 @@ class XMLFootnoteSeparatorImport : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLFootnoteSeparatorImport(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index c8a0dfff0832..274010432412 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -74,8 +74,6 @@ void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
}
}
-TYPEINIT1( XMLPropStyleContext, SvXMLStyleContext );
-
XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const Reference< XAttributeList > & xAttrList,
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 794ce86ca259..a87ca8226bd0 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -1161,8 +1161,6 @@ SvxXMLListStyleContext::~SvxXMLListStyleContext()
delete pLevelStyles;
}
-TYPEINIT1( SvxXMLListStyleContext, SvXMLStyleContext );
-
SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index 18be25e65c9b..79f1376aee13 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -155,8 +155,6 @@ void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
}
}
-TYPEINIT1( SvXMLStyleContext, SvXMLImportContext );
-
SvXMLStyleContext::SvXMLStyleContext(
SvXMLImport& rImp, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -399,8 +397,6 @@ const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext(
// ---------------------------------------------------------------------
-TYPEINIT1( SvXMLStylesContext, SvXMLImportContext );
-
sal_uInt32 SvXMLStylesContext::GetStyleCount() const
{
return mpImpl->GetStyleCount();
diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx
index ff885b74326a..336d745c2c9d 100644
--- a/xmloff/source/style/xmltabi.cxx
+++ b/xmloff/source/style/xmltabi.cxx
@@ -75,8 +75,6 @@ private:
style::TabStop aTabStop;
public:
- TYPEINFO();
-
SvxXMLTabStopContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList > & xAttrList );
@@ -90,8 +88,6 @@ public:
const style::TabStop& getTabStop() const { return aTabStop; }
};
-TYPEINIT1( SvxXMLTabStopContext_Impl, SvXMLImportContext );
-
SvxXMLTabStopContext_Impl::SvxXMLTabStopContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -190,8 +186,6 @@ SV_DECL_PTRARR( SvxXMLTabStopArray_Impl, SvxXMLTabStopContext_Impl_ImplPtr, 20,
// ---
-TYPEINIT1( SvxXMLTabStopImportContext, XMLElementPropertyContext );
-
SvxXMLTabStopImportContext::SvxXMLTabStopImportContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
diff --git a/xmloff/source/text/XMLAutoMarkFileContext.cxx b/xmloff/source/text/XMLAutoMarkFileContext.cxx
index e6593e027514..b5d7ee69c766 100644
--- a/xmloff/source/text/XMLAutoMarkFileContext.cxx
+++ b/xmloff/source/text/XMLAutoMarkFileContext.cxx
@@ -45,8 +45,6 @@ using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_HREF;
-TYPEINIT1( XMLAutoMarkFileContext, SvXMLImportContext );
-
XMLAutoMarkFileContext::XMLAutoMarkFileContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLAutoMarkFileContext.hxx b/xmloff/source/text/XMLAutoMarkFileContext.hxx
index bb20230f2ed0..a9c5ba984e7c 100644
--- a/xmloff/source/text/XMLAutoMarkFileContext.hxx
+++ b/xmloff/source/text/XMLAutoMarkFileContext.hxx
@@ -41,8 +41,6 @@ class XMLAutoMarkFileContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLAutoMarkFileContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
index d2f0d15ce286..b7d32c4cc8a3 100644
--- a/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
+++ b/xmloff/source/text/XMLAutoTextContainerEventImport.cxx
@@ -45,9 +45,6 @@ using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_EVENT_LISTENERS;
-TYPEINIT1(XMLAutoTextContainerEventImport, SvXMLImportContext);
-
-
XMLAutoTextContainerEventImport::XMLAutoTextContainerEventImport(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLAutoTextContainerEventImport.hxx b/xmloff/source/text/XMLAutoTextContainerEventImport.hxx
index 524d7ea83efb..7735189eabb3 100644
--- a/xmloff/source/text/XMLAutoTextContainerEventImport.hxx
+++ b/xmloff/source/text/XMLAutoTextContainerEventImport.hxx
@@ -47,8 +47,6 @@ class XMLAutoTextContainerEventImport : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLAutoTextContainerEventImport(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLChangeElementImportContext.cxx b/xmloff/source/text/XMLChangeElementImportContext.cxx
index 8428fac98c0a..8db4e895a980 100644
--- a/xmloff/source/text/XMLChangeElementImportContext.cxx
+++ b/xmloff/source/text/XMLChangeElementImportContext.cxx
@@ -40,8 +40,6 @@ using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_P;
using ::xmloff::token::XML_CHANGE_INFO;
-TYPEINIT1( XMLChangeElementImportContext, SvXMLImportContext );
-
XMLChangeElementImportContext::XMLChangeElementImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLChangeElementImportContext.hxx b/xmloff/source/text/XMLChangeElementImportContext.hxx
index 31cdd8196c80..27d608daacc8 100644
--- a/xmloff/source/text/XMLChangeElementImportContext.hxx
+++ b/xmloff/source/text/XMLChangeElementImportContext.hxx
@@ -52,8 +52,6 @@ class XMLChangeElementImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLChangeElementImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLChangeImportContext.cxx b/xmloff/source/text/XMLChangeImportContext.cxx
index b7dade8d1dee..20ad756b16e1 100644
--- a/xmloff/source/text/XMLChangeImportContext.cxx
+++ b/xmloff/source/text/XMLChangeImportContext.cxx
@@ -38,8 +38,6 @@ using ::com::sun::star::xml::sax::XAttributeList;
using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_CHANGE_ID;
-TYPEINIT1( XMLChangeImportContext, SvXMLImportContext );
-
XMLChangeImportContext::XMLChangeImportContext(
SvXMLImport& rImport,
sal_Int16 nPrefix,
diff --git a/xmloff/source/text/XMLChangeImportContext.hxx b/xmloff/source/text/XMLChangeImportContext.hxx
index 11a1dd5fee8f..c913ba46c11e 100644
--- a/xmloff/source/text/XMLChangeImportContext.hxx
+++ b/xmloff/source/text/XMLChangeImportContext.hxx
@@ -52,8 +52,6 @@ class XMLChangeImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
/**
* import a change mark
* (<text:change>, <text:change-start>, <text:change-end>)
diff --git a/xmloff/source/text/XMLChangeInfoContext.cxx b/xmloff/source/text/XMLChangeInfoContext.cxx
index a1a1c1078d0d..0d21e097959b 100644
--- a/xmloff/source/text/XMLChangeInfoContext.cxx
+++ b/xmloff/source/text/XMLChangeInfoContext.cxx
@@ -41,8 +41,6 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1(XMLChangeInfoContext, SvXMLImportContext);
-
XMLChangeInfoContext::XMLChangeInfoContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLChangeInfoContext.hxx b/xmloff/source/text/XMLChangeInfoContext.hxx
index 99a5b27cbfb1..b4d6fccbb4bb 100644
--- a/xmloff/source/text/XMLChangeInfoContext.hxx
+++ b/xmloff/source/text/XMLChangeInfoContext.hxx
@@ -55,8 +55,6 @@ class XMLChangeInfoContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLChangeInfoContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx b/xmloff/source/text/XMLChangedRegionImportContext.cxx
index 513bd6950deb..95ca062f2380 100644
--- a/xmloff/source/text/XMLChangedRegionImportContext.cxx
+++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx
@@ -45,8 +45,6 @@ using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1(XMLChangedRegionImportContext, SvXMLImportContext);
-
XMLChangedRegionImportContext::XMLChangedRegionImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLChangedRegionImportContext.hxx b/xmloff/source/text/XMLChangedRegionImportContext.hxx
index 8383836cc801..f0187433f92d 100644
--- a/xmloff/source/text/XMLChangedRegionImportContext.hxx
+++ b/xmloff/source/text/XMLChangedRegionImportContext.hxx
@@ -57,8 +57,6 @@ class XMLChangedRegionImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLChangedRegionImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLFootnoteBodyImportContext.cxx b/xmloff/source/text/XMLFootnoteBodyImportContext.cxx
index 258af7ae8e91..0fdc7879ec94 100644
--- a/xmloff/source/text/XMLFootnoteBodyImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteBodyImportContext.cxx
@@ -41,8 +41,6 @@ using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1( XMLFootnoteBodyImportContext, SvXMLImportContext );
-
XMLFootnoteBodyImportContext::XMLFootnoteBodyImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLFootnoteBodyImportContext.hxx b/xmloff/source/text/XMLFootnoteBodyImportContext.hxx
index 605fdb8b8dec..430fead2bec5 100644
--- a/xmloff/source/text/XMLFootnoteBodyImportContext.hxx
+++ b/xmloff/source/text/XMLFootnoteBodyImportContext.hxx
@@ -44,8 +44,6 @@ class XMLFootnoteBodyImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLFootnoteBodyImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
index 266a9bce706a..dcc5e9c8014e 100644
--- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
@@ -71,8 +71,6 @@ class XMLFootnoteConfigHelper : public SvXMLImportContext
sal_Bool bIsBegin;
public:
- TYPEINFO();
-
XMLFootnoteConfigHelper(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -85,8 +83,6 @@ public:
virtual void Characters( const OUString& rChars );
};
-TYPEINIT1( XMLFootnoteConfigHelper, SvXMLImportContext );
-
XMLFootnoteConfigHelper::XMLFootnoteConfigHelper(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -124,8 +120,6 @@ void XMLFootnoteConfigHelper::Characters( const OUString& rChars )
//
-TYPEINIT1( XMLFootnoteConfigurationImportContext, SvXMLStyleContext );
-
XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLFootnoteImportContext.cxx b/xmloff/source/text/XMLFootnoteImportContext.cxx
index 2b5e5d7de649..db4cd9711032 100644
--- a/xmloff/source/text/XMLFootnoteImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteImportContext.cxx
@@ -56,8 +56,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1(XMLFootnoteImportContext, SvXMLImportContext);
-
const sal_Char sAPI_service_footnote[] = "com.sun.star.text.Footnote";
const sal_Char sAPI_service_endnote[] = "com.sun.star.text.Endnote";
diff --git a/xmloff/source/text/XMLFootnoteImportContext.hxx b/xmloff/source/text/XMLFootnoteImportContext.hxx
index e5d9c8fea6fb..e8ea3ab349e2 100644
--- a/xmloff/source/text/XMLFootnoteImportContext.hxx
+++ b/xmloff/source/text/XMLFootnoteImportContext.hxx
@@ -63,8 +63,6 @@ class XMLFootnoteImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLFootnoteImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
index a0045a3082d0..06f476e6818c 100644
--- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
@@ -65,8 +65,6 @@ const sal_Char sAPI_SortAlgorithm[] = "SortAlgorithm";
const sal_Char sAPI_Locale[] = "Locale";
-TYPEINIT1( XMLIndexAlphabeticalSourceContext, XMLIndexSourceBaseContext );
-
XMLIndexAlphabeticalSourceContext::XMLIndexAlphabeticalSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
index ac2a86bdcbbb..10b3ed80c2ad 100644
--- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
+++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
@@ -70,8 +70,6 @@ class XMLIndexAlphabeticalSourceContext : public XMLIndexSourceBaseContext
public:
- TYPEINFO();
-
XMLIndexAlphabeticalSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
index f3c0ba7d4f4b..54891652c582 100644
--- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
@@ -53,8 +53,6 @@ const sal_Char sAPI_FieldMaster_Bibliography[] =
"com.sun.star.text.FieldMaster.Bibliography";
-TYPEINIT1( XMLIndexBibliographyConfigurationContext, SvXMLStyleContext );
-
XMLIndexBibliographyConfigurationContext::XMLIndexBibliographyConfigurationContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx
index 3054fe4bff79..9ee7059f28f3 100644
--- a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx
@@ -52,8 +52,6 @@ using ::com::sun::star::xml::sax::XAttributeList;
const sal_Char sAPI_TokenType[] = "TokenType";
const sal_Char sAPI_CharacterStyleName[] = "CharacterStyleName";
-TYPEINIT1( XMLIndexBibliographyEntryContext, XMLIndexSimpleEntryContext);
-
XMLIndexBibliographyEntryContext::XMLIndexBibliographyEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx
index 1cc76793bc3e..a165672fd096 100644
--- a/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx
+++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx
@@ -50,8 +50,6 @@ class XMLIndexBibliographyEntryContext : public XMLIndexSimpleEntryContext
public:
- TYPEINFO();
-
XMLIndexBibliographyEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexBibliographySourceContext.cxx b/xmloff/source/text/XMLIndexBibliographySourceContext.cxx
index e36f211d9e88..ee93a3aed221 100644
--- a/xmloff/source/text/XMLIndexBibliographySourceContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographySourceContext.cxx
@@ -51,9 +51,6 @@ using ::com::sun::star::uno::Any;
using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1(XMLIndexBibliographySourceContext, XMLIndexSourceBaseContext);
-
-
XMLIndexBibliographySourceContext::XMLIndexBibliographySourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexBibliographySourceContext.hxx b/xmloff/source/text/XMLIndexBibliographySourceContext.hxx
index 4917727c0a82..1fe4a5aa2952 100644
--- a/xmloff/source/text/XMLIndexBibliographySourceContext.hxx
+++ b/xmloff/source/text/XMLIndexBibliographySourceContext.hxx
@@ -43,8 +43,6 @@ class XMLIndexBibliographySourceContext : public XMLIndexSourceBaseContext
public:
- TYPEINFO();
-
XMLIndexBibliographySourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexBodyContext.cxx b/xmloff/source/text/XMLIndexBodyContext.cxx
index 9fa1cea7293f..94f64fc8345d 100644
--- a/xmloff/source/text/XMLIndexBodyContext.cxx
+++ b/xmloff/source/text/XMLIndexBodyContext.cxx
@@ -37,8 +37,6 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1( XMLIndexBodyContext, SvXMLImportContext);
-
XMLIndexBodyContext::XMLIndexBodyContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexBodyContext.hxx b/xmloff/source/text/XMLIndexBodyContext.hxx
index b0525bf72380..ca891b97a0a2 100644
--- a/xmloff/source/text/XMLIndexBodyContext.hxx
+++ b/xmloff/source/text/XMLIndexBodyContext.hxx
@@ -46,8 +46,6 @@ class XMLIndexBodyContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLIndexBodyContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
index 1d6580acdb94..dfba35a62789 100644
--- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
@@ -50,8 +50,6 @@ using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1( XMLIndexChapterInfoEntryContext, XMLIndexSimpleEntryContext);
-
XMLIndexChapterInfoEntryContext::XMLIndexChapterInfoEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
index 97c45d6802f7..d6368f1061b6 100644
--- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
+++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.hxx
@@ -50,8 +50,6 @@ class XMLIndexChapterInfoEntryContext : public XMLIndexSimpleEntryContext
public:
- TYPEINFO();
-
XMLIndexChapterInfoEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx b/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx
index c345ddf1ae20..7a1f7297dd16 100644
--- a/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexIllustrationSourceContext.cxx
@@ -47,9 +47,6 @@ using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE;
using ::xmloff::token::XML_TOKEN_INVALID;
-TYPEINIT1(XMLIndexIllustrationSourceContext, XMLIndexTableSourceContext);
-
-
XMLIndexIllustrationSourceContext::XMLIndexIllustrationSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexIllustrationSourceContext.hxx b/xmloff/source/text/XMLIndexIllustrationSourceContext.hxx
index 7e4e05abfb07..5084c1db3c94 100644
--- a/xmloff/source/text/XMLIndexIllustrationSourceContext.hxx
+++ b/xmloff/source/text/XMLIndexIllustrationSourceContext.hxx
@@ -45,8 +45,6 @@ class XMLIndexIllustrationSourceContext : public XMLIndexTableSourceContext
{
public:
- TYPEINFO();
-
XMLIndexIllustrationSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexObjectSourceContext.cxx b/xmloff/source/text/XMLIndexObjectSourceContext.cxx
index fd17e59c85f8..a4bbc87623b5 100644
--- a/xmloff/source/text/XMLIndexObjectSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexObjectSourceContext.cxx
@@ -59,8 +59,6 @@ const sal_Char sAPI_CreateFromStarMath[] = "CreateFromStarMath";
const sal_Char sAPI_CreateFromOtherEmbeddedObjects[] = "CreateFromOtherEmbeddedObjects";
-TYPEINIT1( XMLIndexObjectSourceContext, XMLIndexSourceBaseContext );
-
XMLIndexObjectSourceContext::XMLIndexObjectSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexObjectSourceContext.hxx b/xmloff/source/text/XMLIndexObjectSourceContext.hxx
index 77a83593c6f0..98a85f27b203 100644
--- a/xmloff/source/text/XMLIndexObjectSourceContext.hxx
+++ b/xmloff/source/text/XMLIndexObjectSourceContext.hxx
@@ -54,8 +54,6 @@ class XMLIndexObjectSourceContext : public XMLIndexSourceBaseContext
public:
- TYPEINFO();
-
XMLIndexObjectSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx
index ac5abaccd2cc..9c6a84c4c675 100644
--- a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx
@@ -51,8 +51,6 @@ using ::xmloff::token::XML_STYLE_NAME;
const sal_Char sAPI_TokenType[] = "TokenType";
const sal_Char sAPI_CharacterStyleName[] = "CharacterStyleName";
-TYPEINIT1( XMLIndexSimpleEntryContext, SvXMLImportContext);
-
XMLIndexSimpleEntryContext::XMLIndexSimpleEntryContext(
SvXMLImport& rImport,
const OUString& rEntry,
diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.hxx b/xmloff/source/text/XMLIndexSimpleEntryContext.hxx
index 9686a9eeb2f4..85bd9c4782bd 100644
--- a/xmloff/source/text/XMLIndexSimpleEntryContext.hxx
+++ b/xmloff/source/text/XMLIndexSimpleEntryContext.hxx
@@ -58,8 +58,6 @@ protected:
public:
- TYPEINFO();
-
XMLIndexSimpleEntryContext(
SvXMLImport& rImport,
const ::rtl::OUString& rEntry,
diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.cxx b/xmloff/source/text/XMLIndexSourceBaseContext.cxx
index 8369080f1609..0eeb3419efc9 100644
--- a/xmloff/source/text/XMLIndexSourceBaseContext.cxx
+++ b/xmloff/source/text/XMLIndexSourceBaseContext.cxx
@@ -153,8 +153,6 @@ static __FAR_DATA SvXMLTokenMapEntry aIndexSourceTokenMap[] =
};
-TYPEINIT1( XMLIndexSourceBaseContext, SvXMLImportContext );
-
XMLIndexSourceBaseContext::XMLIndexSourceBaseContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.hxx b/xmloff/source/text/XMLIndexSourceBaseContext.hxx
index b59c87d56bda..e2c2d8f94e91 100644
--- a/xmloff/source/text/XMLIndexSourceBaseContext.hxx
+++ b/xmloff/source/text/XMLIndexSourceBaseContext.hxx
@@ -93,8 +93,6 @@ protected:
public:
- TYPEINFO();
-
XMLIndexSourceBaseContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexSpanEntryContext.cxx b/xmloff/source/text/XMLIndexSpanEntryContext.cxx
index 60437139410d..b74d55e279b8 100644
--- a/xmloff/source/text/XMLIndexSpanEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexSpanEntryContext.cxx
@@ -35,8 +35,6 @@ using ::com::sun::star::uno::Any;
using ::com::sun::star::beans::PropertyValue;
-TYPEINIT1( XMLIndexSpanEntryContext, XMLIndexSimpleEntryContext);
-
XMLIndexSpanEntryContext::XMLIndexSpanEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexSpanEntryContext.hxx b/xmloff/source/text/XMLIndexSpanEntryContext.hxx
index 65f41a4e4946..cd8353511ed2 100644
--- a/xmloff/source/text/XMLIndexSpanEntryContext.hxx
+++ b/xmloff/source/text/XMLIndexSpanEntryContext.hxx
@@ -44,8 +44,6 @@ class XMLIndexSpanEntryContext : public XMLIndexSimpleEntryContext
public:
- TYPEINFO();
-
XMLIndexSpanEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index 1b28e6a68e23..4845992eb0f6 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -65,8 +65,6 @@ using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::lang::IllegalArgumentException;
-TYPEINIT1(XMLIndexTOCContext, SvXMLImportContext);
-
static const sal_Char* aIndexServiceMap[] =
{
"com.sun.star.text.ContentIndex",
diff --git a/xmloff/source/text/XMLIndexTOCContext.hxx b/xmloff/source/text/XMLIndexTOCContext.hxx
index 934171081b2a..f6407446a139 100644
--- a/xmloff/source/text/XMLIndexTOCContext.hxx
+++ b/xmloff/source/text/XMLIndexTOCContext.hxx
@@ -75,8 +75,6 @@ class XMLIndexTOCContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLIndexTOCContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.cxx b/xmloff/source/text/XMLIndexTOCSourceContext.cxx
index 8ef456b4ddf0..d94677c66202 100644
--- a/xmloff/source/text/XMLIndexTOCSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCSourceContext.cxx
@@ -58,8 +58,6 @@ const sal_Char sAPI_Level[] = "Level";
const sal_Char sAPI_CreateFromLevelParagraphStyles[] = "CreateFromLevelParagraphStyles";
-TYPEINIT1( XMLIndexTOCSourceContext, XMLIndexSourceBaseContext );
-
XMLIndexTOCSourceContext::XMLIndexTOCSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.hxx b/xmloff/source/text/XMLIndexTOCSourceContext.hxx
index 69f611597c4f..811e677a49b7 100644
--- a/xmloff/source/text/XMLIndexTOCSourceContext.hxx
+++ b/xmloff/source/text/XMLIndexTOCSourceContext.hxx
@@ -53,8 +53,6 @@ class XMLIndexTOCSourceContext : public XMLIndexSourceBaseContext
public:
- TYPEINFO();
-
XMLIndexTOCSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx
index 0a66c277e609..af2ace3e3ed3 100644
--- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx
@@ -53,9 +53,6 @@ using ::com::sun::star::xml::sax::XAttributeList;
const sal_Char sAPI_LevelParagraphStyles[] = "LevelParagraphStyles";
-TYPEINIT1( XMLIndexTOCStylesContext, SvXMLImportContext );
-
-
XMLIndexTOCStylesContext::XMLIndexTOCStylesContext(
SvXMLImport& rImport,
Reference<XPropertySet> & rPropSet,
diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.hxx b/xmloff/source/text/XMLIndexTOCStylesContext.hxx
index 46d6f83404d3..a6d852a6391d 100644
--- a/xmloff/source/text/XMLIndexTOCStylesContext.hxx
+++ b/xmloff/source/text/XMLIndexTOCStylesContext.hxx
@@ -64,8 +64,6 @@ class XMLIndexTOCStylesContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLIndexTOCStylesContext(
SvXMLImport& rImport,
::com::sun::star::uno::Reference<
diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
index a82e8c59ebf5..899bb1cad2e5 100644
--- a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
@@ -47,8 +47,6 @@ using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1( XMLIndexTabStopEntryContext, XMLIndexSimpleEntryContext );
-
XMLIndexTabStopEntryContext::XMLIndexTabStopEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.hxx b/xmloff/source/text/XMLIndexTabStopEntryContext.hxx
index a8c09710bce9..8acddd1acfab 100644
--- a/xmloff/source/text/XMLIndexTabStopEntryContext.hxx
+++ b/xmloff/source/text/XMLIndexTabStopEntryContext.hxx
@@ -50,8 +50,6 @@ class XMLIndexTabStopEntryContext : public XMLIndexSimpleEntryContext
public:
- TYPEINFO();
-
XMLIndexTabStopEntryContext(
SvXMLImport& rImport,
XMLIndexTemplateContext& rTemplate,
diff --git a/xmloff/source/text/XMLIndexTableSourceContext.cxx b/xmloff/source/text/XMLIndexTableSourceContext.cxx
index bdd8cd097a6d..fad8fd25eb48 100644
--- a/xmloff/source/text/XMLIndexTableSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexTableSourceContext.cxx
@@ -60,9 +60,6 @@ const sal_Char sAPI_LabelCategory[] = "LabelCategory";
const sal_Char sAPI_LabelDisplayType[] = "LabelDisplayType";
-TYPEINIT1(XMLIndexTableSourceContext, XMLIndexSourceBaseContext);
-
-
XMLIndexTableSourceContext::XMLIndexTableSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexTableSourceContext.hxx b/xmloff/source/text/XMLIndexTableSourceContext.hxx
index f2cdfd8aa4dd..c92c7a11be0b 100644
--- a/xmloff/source/text/XMLIndexTableSourceContext.hxx
+++ b/xmloff/source/text/XMLIndexTableSourceContext.hxx
@@ -53,8 +53,6 @@ class XMLIndexTableSourceContext : public XMLIndexSourceBaseContext
public:
- TYPEINFO();
-
XMLIndexTableSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx
index 51eff9b4cef8..79e42f47e9dc 100644
--- a/xmloff/source/text/XMLIndexTemplateContext.cxx
+++ b/xmloff/source/text/XMLIndexTemplateContext.cxx
@@ -71,8 +71,6 @@ const sal_Char sAPI_TokenBibliographyDataField[] =
"TokenBibliographyDataField";
-TYPEINIT1( XMLIndexTemplateContext, SvXMLImportContext);
-
XMLIndexTemplateContext::XMLIndexTemplateContext(
SvXMLImport& rImport,
Reference<XPropertySet> & rPropSet,
diff --git a/xmloff/source/text/XMLIndexTemplateContext.hxx b/xmloff/source/text/XMLIndexTemplateContext.hxx
index ac196af92f57..5e738424e2fb 100644
--- a/xmloff/source/text/XMLIndexTemplateContext.hxx
+++ b/xmloff/source/text/XMLIndexTemplateContext.hxx
@@ -117,8 +117,6 @@ public:
const ::rtl::OUString sParaStyleLevel;
- TYPEINFO();
-
XMLIndexTemplateContext(
SvXMLImport& rImport,
::com::sun::star::uno::Reference<
diff --git a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx
index 2e5893ebfc2f..d8cd228a4d0f 100644
--- a/xmloff/source/text/XMLIndexTitleTemplateContext.cxx
+++ b/xmloff/source/text/XMLIndexTitleTemplateContext.cxx
@@ -45,8 +45,6 @@ const sal_Char sAPI_Title[] = "Title";
const sal_Char sAPI_ParaStyleHeading[] = "ParaStyleHeading";
-TYPEINIT1( XMLIndexTitleTemplateContext, SvXMLImportContext );
-
XMLIndexTitleTemplateContext::XMLIndexTitleTemplateContext(
SvXMLImport& rImport,
Reference<XPropertySet> & rPropSet,
diff --git a/xmloff/source/text/XMLIndexTitleTemplateContext.hxx b/xmloff/source/text/XMLIndexTitleTemplateContext.hxx
index a81f8e17921b..d61998bd6d8e 100644
--- a/xmloff/source/text/XMLIndexTitleTemplateContext.hxx
+++ b/xmloff/source/text/XMLIndexTitleTemplateContext.hxx
@@ -58,8 +58,6 @@ class XMLIndexTitleTemplateContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLIndexTitleTemplateContext(
SvXMLImport& rImport,
::com::sun::star::uno::Reference<
diff --git a/xmloff/source/text/XMLIndexUserSourceContext.cxx b/xmloff/source/text/XMLIndexUserSourceContext.cxx
index b6fd8e7ab047..33c670220f9c 100644
--- a/xmloff/source/text/XMLIndexUserSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexUserSourceContext.cxx
@@ -62,9 +62,6 @@ const sal_Char sAPI_CreateFromLevelParagraphStyles[] = "CreateFromLevelParagraph
const sal_Char sAPI_UserIndexName[] = "UserIndexName";
-TYPEINIT1(XMLIndexUserSourceContext, XMLIndexSourceBaseContext);
-
-
XMLIndexUserSourceContext::XMLIndexUserSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLIndexUserSourceContext.hxx b/xmloff/source/text/XMLIndexUserSourceContext.hxx
index 1f83955b4969..c34b646a6b80 100644
--- a/xmloff/source/text/XMLIndexUserSourceContext.hxx
+++ b/xmloff/source/text/XMLIndexUserSourceContext.hxx
@@ -60,8 +60,6 @@ class XMLIndexUserSourceContext : public XMLIndexSourceBaseContext
public:
- TYPEINFO();
-
XMLIndexUserSourceContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx
index 425c6d7c921d..5dac56fad2ee 100644
--- a/xmloff/source/text/XMLLineNumberingImportContext.cxx
+++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx
@@ -47,9 +47,6 @@ using ::com::sun::star::xml::sax::XAttributeList;
using ::com::sun::star::text::XLineNumberingProperties;
using ::rtl::OUString;
-TYPEINIT1( XMLLineNumberingImportContext, SvXMLStyleContext );
-
-
XMLLineNumberingImportContext::XMLLineNumberingImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx
index 22c628236b33..0b7529f417eb 100644
--- a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx
+++ b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx
@@ -40,8 +40,6 @@ using ::rtl::OUStringBuffer;
using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_INCREMENT;
-TYPEINIT1( XMLLineNumberingSeparatorImportContext, SvXMLImportContext );
-
XMLLineNumberingSeparatorImportContext::XMLLineNumberingSeparatorImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx
index cae2bc7bbd10..ca07580918b3 100644
--- a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx
+++ b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.hxx
@@ -44,8 +44,6 @@ class XMLLineNumberingSeparatorImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLLineNumberingSeparatorImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
index 599ec67d7215..4c337bef36a0 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
@@ -55,9 +55,6 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::xml::sax::XAttributeList;
-TYPEINIT1(XMLSectionFootnoteConfigImport, SvXMLImportContext);
-
-
XMLSectionFootnoteConfigImport::XMLSectionFootnoteConfigImport(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.hxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.hxx
index 9a2d97019015..4e6441811dd8 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigImport.hxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.hxx
@@ -52,8 +52,6 @@ class XMLSectionFootnoteConfigImport : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLSectionFootnoteConfigImport(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx
index 54f61844dfb9..0b9b4a212fe1 100644
--- a/xmloff/source/text/XMLSectionImportContext.cxx
+++ b/xmloff/source/text/XMLSectionImportContext.cxx
@@ -54,8 +54,6 @@ using namespace ::com::sun::star::text;
using namespace ::xmloff::token;
-TYPEINIT1( XMLSectionImportContext, SvXMLImportContext );
-
const sal_Char sAPI_TextSection[] = "com.sun.star.text.TextSection";
const sal_Char sAPI_IndexHeaderSection[] = "com.sun.star.text.IndexHeaderSection";
const sal_Char sAPI_IsProtected[] = "IsProtected";
diff --git a/xmloff/source/text/XMLSectionImportContext.hxx b/xmloff/source/text/XMLSectionImportContext.hxx
index 1622f776991d..fd0adcdba3dd 100644
--- a/xmloff/source/text/XMLSectionImportContext.hxx
+++ b/xmloff/source/text/XMLSectionImportContext.hxx
@@ -83,8 +83,6 @@ class XMLSectionImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLSectionImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx
index 23315e19d74d..8105d4e35167 100644
--- a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx
+++ b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx
@@ -54,8 +54,6 @@ const sal_Char sAPI_DDECommandElement[] = "DDECommandElement";
const sal_Char sAPI_IsAutomaticUpdate[] = "IsAutomaticUpdate";
-TYPEINIT1(XMLSectionSourceDDEImportContext, SvXMLImportContext);
-
XMLSectionSourceDDEImportContext::XMLSectionSourceDDEImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx b/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx
index 8f74b455d9e1..a801367dd44f 100644
--- a/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx
+++ b/xmloff/source/text/XMLSectionSourceDDEImportContext.hxx
@@ -45,8 +45,6 @@ class XMLSectionSourceDDEImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLSectionSourceDDEImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLSectionSourceImportContext.cxx b/xmloff/source/text/XMLSectionSourceImportContext.cxx
index d8a4d4b7ee17..93688c9903c5 100644
--- a/xmloff/source/text/XMLSectionSourceImportContext.cxx
+++ b/xmloff/source/text/XMLSectionSourceImportContext.cxx
@@ -46,8 +46,6 @@ using namespace ::com::sun::star::text;
using namespace ::xmloff::token;
-TYPEINIT1(XMLSectionSourceImportContext, SvXMLImportContext);
-
XMLSectionSourceImportContext::XMLSectionSourceImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLSectionSourceImportContext.hxx b/xmloff/source/text/XMLSectionSourceImportContext.hxx
index 72853dda3803..78fb588cefcd 100644
--- a/xmloff/source/text/XMLSectionSourceImportContext.hxx
+++ b/xmloff/source/text/XMLSectionSourceImportContext.hxx
@@ -40,8 +40,6 @@ class XMLSectionSourceImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLSectionSourceImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/text/XMLStringBufferImportContext.cxx b/xmloff/source/text/XMLStringBufferImportContext.cxx
index 7487d6c7dc18..8bb6d721d058 100644
--- a/xmloff/source/text/XMLStringBufferImportContext.cxx
+++ b/xmloff/source/text/XMLStringBufferImportContext.cxx
@@ -36,8 +36,6 @@ using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_P;
-TYPEINIT1(XMLStringBufferImportContext, SvXMLImportContext);
-
XMLStringBufferImportContext::XMLStringBufferImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx
index 86caabd94f93..c886de6bd9b0 100644
--- a/xmloff/source/text/XMLTextColumnsContext.cxx
+++ b/xmloff/source/text/XMLTextColumnsContext.cxx
@@ -96,8 +96,6 @@ class XMLTextColumnContext_Impl: public SvXMLImportContext
text::TextColumn aColumn;
public:
- TYPEINFO();
-
XMLTextColumnContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference<
@@ -109,8 +107,6 @@ public:
text::TextColumn& getTextColumn() { return aColumn; }
};
-TYPEINIT1( XMLTextColumnContext_Impl, SvXMLImportContext );
-
XMLTextColumnContext_Impl::XMLTextColumnContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -180,8 +176,6 @@ class XMLTextColumnSepContext_Impl: public SvXMLImportContext
public:
- TYPEINFO();
-
XMLTextColumnSepContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference<
@@ -197,8 +191,6 @@ public:
};
-TYPEINIT1( XMLTextColumnSepContext_Impl, SvXMLImportContext );
-
XMLTextColumnSepContext_Impl::XMLTextColumnSepContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
@@ -265,8 +257,6 @@ XMLTextColumnSepContext_Impl::~XMLTextColumnSepContext_Impl()
typedef XMLTextColumnContext_Impl *XMLTextColumnContext_ImplPtr;
SV_DECL_PTRARR( XMLTextColumnsArray_Impl, XMLTextColumnContext_ImplPtr, 5, 5 )
-TYPEINIT1( XMLTextColumnsContext, XMLElementPropertyContext );
-
XMLTextColumnsContext::XMLTextColumnsContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index c5e9f723d2f9..cd1ebcf1198b 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -123,8 +123,6 @@ class XMLTextFrameTitleOrDescContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLTextFrameTitleOrDescContext_Impl( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
@@ -134,8 +132,6 @@ public:
virtual void Characters( const OUString& rText );
};
-TYPEINIT1( XMLTextFrameTitleOrDescContext_Impl, SvXMLImportContext );
-
XMLTextFrameTitleOrDescContext_Impl::XMLTextFrameTitleOrDescContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -162,8 +158,6 @@ class XMLTextFrameParam_Impl : public SvXMLImportContext
{
public:
- TYPEINFO();
-
XMLTextFrameParam_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -173,8 +167,6 @@ public:
virtual ~XMLTextFrameParam_Impl();
};
-TYPEINIT1( XMLTextFrameParam_Impl, SvXMLImportContext );
-
XMLTextFrameParam_Impl::~XMLTextFrameParam_Impl()
{
}
@@ -220,8 +212,6 @@ class XMLTextFrameContourContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLTextFrameContourContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference<
@@ -231,8 +221,6 @@ public:
virtual ~XMLTextFrameContourContext_Impl();
};
-TYPEINIT1( XMLTextFrameContourContext_Impl, SvXMLImportContext );
-
XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
@@ -319,7 +307,7 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
else
{
SdXMLImExPointsElement aPoints( sPoints, aViewBox, aPoint, aSize,
- GetImport().GetMM100UnitConverter() );
+ GetImport().GetMM100UnitConverter(), true );
aAny <<= aPoints.GetPointSequenceSequence();
}
@@ -430,8 +418,6 @@ class XMLTextFrameContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
sal_Bool CreateIfNotThere();
const OUString& GetHRef() const { return sHRef; }
@@ -470,8 +456,6 @@ public:
::com::sun::star::beans::XPropertySet >& GetPropSet() const { return xPropSet; }
};
-TYPEINIT1( XMLTextFrameContext_Impl, SvXMLImportContext );
-
void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ )
{
UniReference < XMLTextImportHelper > xTextImportHelper =
@@ -1307,8 +1291,6 @@ void XMLTextFrameContext_Impl::SetDesc( const OUString& rDesc )
//-----------------------------------------------------------------------------------------------------
-TYPEINIT1( XMLTextFrameContext, SvXMLImportContext );
-
void XMLTextFrameContext::removeGraphicFromImportContext(const SvXMLImportContext& rContext) const
{
const XMLTextFrameContext_Impl* pXMLTextFrameContext_Impl = dynamic_cast< const XMLTextFrameContext_Impl* >(&rContext);
@@ -1349,7 +1331,7 @@ sal_Bool XMLTextFrameContext::CreateIfNotThere()
{
sal_Bool bRet = sal_False;
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl* >( pContext );
if( pImpl )
bRet = pImpl->CreateIfNotThere();
@@ -1360,7 +1342,7 @@ sal_Bool XMLTextFrameContext::CreateIfNotThere( ::com::sun::star::uno::Reference
::com::sun::star::beans::XPropertySet >& rPropSet )
{
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl* >( pContext );
if( pImpl )
{
if( pImpl->CreateIfNotThere() )
@@ -1440,11 +1422,10 @@ XMLTextFrameContext::~XMLTextFrameContext()
void XMLTextFrameContext::EndElement()
{
/// solve if multiple image child contexts were imported
- /// the winner is returned, if something has yet to be done with it
- /*const SvXMLImportContext* pWinner =*/ solveMultipleImages();
+ solveMultipleImages();
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl* >( pContext );
if( pImpl )
{
pImpl->CreateIfNotThere();
@@ -1594,7 +1575,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
m_xReplImplContext = pContext;
}
}
- else if( m_xImplContext->ISA( XMLTextFrameContext_Impl ) )
+ else if( dynamic_cast< XMLTextFrameContext_Impl* >(&m_xImplContext) )
{
// the child is a writer frame
if( XML_NAMESPACE_SVG == p_nPrefix )
@@ -1704,7 +1685,7 @@ void XMLTextFrameContext::SetHyperlink( const OUString& rHRef,
TextContentAnchorType XMLTextFrameContext::GetAnchorType() const
{
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl* >( pContext );
if( pImpl )
return pImpl->GetAnchorType();
else
@@ -1715,7 +1696,7 @@ Reference < XTextContent > XMLTextFrameContext::GetTextContent() const
{
Reference < XTextContent > xTxtCntnt;
SvXMLImportContext *pContext = &m_xImplContext;
- XMLTextFrameContext_Impl *pImpl = PTR_CAST( XMLTextFrameContext_Impl, pContext );
+ XMLTextFrameContext_Impl *pImpl = dynamic_cast< XMLTextFrameContext_Impl* >( pContext );
if( pImpl )
xTxtCntnt.set( pImpl->GetPropSet(), UNO_QUERY );
@@ -1727,7 +1708,7 @@ Reference < XShape > XMLTextFrameContext::GetShape() const
{
Reference < XShape > xShape;
SvXMLImportContext* pContext = &m_xImplContext;
- SvXMLShapeContext* pImpl = PTR_CAST( SvXMLShapeContext, pContext );
+ SvXMLShapeContext* pImpl = dynamic_cast< SvXMLShapeContext* >( pContext );
if ( pImpl )
{
xShape = pImpl->getShape();
diff --git a/xmloff/source/text/XMLTextFrameContext.hxx b/xmloff/source/text/XMLTextFrameContext.hxx
index 0cac2a59e23b..cadc0440ff21 100644
--- a/xmloff/source/text/XMLTextFrameContext.hxx
+++ b/xmloff/source/text/XMLTextFrameContext.hxx
@@ -74,8 +74,6 @@ protected:
public:
- TYPEINFO();
-
XMLTextFrameContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
index ca9e42d3eb73..064e2c50c680 100644
--- a/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
+++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.cxx
@@ -43,8 +43,6 @@ using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::beans;
using namespace ::xmloff::token;
-TYPEINIT1( XMLTextFrameHyperlinkContext, SvXMLImportContext );
-
XMLTextFrameHyperlinkContext::XMLTextFrameHyperlinkContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
@@ -148,7 +146,7 @@ TextContentAnchorType XMLTextFrameHyperlinkContext::GetAnchorType() const
if( xFrameContext.Is() )
{
SvXMLImportContext *pContext = &xFrameContext;
- return PTR_CAST( XMLTextFrameContext, pContext ) ->GetAnchorType();
+ return dynamic_cast< XMLTextFrameContext* >( pContext ) ->GetAnchorType();
}
else
return eDefaultAnchorType;
@@ -161,7 +159,7 @@ Reference < XTextContent > XMLTextFrameHyperlinkContext::GetTextContent() const
if( xFrameContext.Is() )
{
SvXMLImportContext *pContext = &xFrameContext;
- xTxt = PTR_CAST( XMLTextFrameContext, pContext )->GetTextContent();
+ xTxt = dynamic_cast< XMLTextFrameContext* >( pContext )->GetTextContent();
}
return xTxt;
@@ -174,7 +172,7 @@ Reference < drawing::XShape > XMLTextFrameHyperlinkContext::GetShape() const
if( xFrameContext.Is() )
{
SvXMLImportContext *pContext = &xFrameContext;
- xShape = PTR_CAST( XMLTextFrameContext, pContext )->GetShape();
+ xShape = dynamic_cast< XMLTextFrameContext* >( pContext )->GetShape();
}
return xShape;
diff --git a/xmloff/source/text/XMLTextFrameHyperlinkContext.hxx b/xmloff/source/text/XMLTextFrameHyperlinkContext.hxx
index fd23e5d477e7..721b8263b126 100644
--- a/xmloff/source/text/XMLTextFrameHyperlinkContext.hxx
+++ b/xmloff/source/text/XMLTextFrameHyperlinkContext.hxx
@@ -51,8 +51,6 @@ class XMLTextFrameHyperlinkContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLTextFrameHyperlinkContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
index bb38b87fdc5f..5a4f3955e2b3 100644
--- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx
+++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
@@ -48,8 +48,6 @@ using namespace ::com::sun::star::beans;
//using namespace ::com::sun::star::text;
-TYPEINIT1( XMLTextHeaderFooterContext, SvXMLImportContext );
-
XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference<
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index 718684fc9d0e..61f8e38145dd 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -47,8 +47,6 @@ using namespace ::com::sun::star::style;
using namespace ::com::sun::star::beans;
using namespace ::xmloff::token;
-TYPEINIT1( XMLTextListBlockContext, SvXMLImportContext );
-
// OD 2008-05-07 #refactorlists#
// add optional parameter <bRestartNumberingAtSubList> and its handling
XMLTextListBlockContext::XMLTextListBlockContext(
diff --git a/xmloff/source/text/XMLTextListBlockContext.hxx b/xmloff/source/text/XMLTextListBlockContext.hxx
index 5eb1b4352062..ae9bf494abf8 100644
--- a/xmloff/source/text/XMLTextListBlockContext.hxx
+++ b/xmloff/source/text/XMLTextListBlockContext.hxx
@@ -55,8 +55,6 @@ class XMLTextListBlockContext : public SvXMLImportContext
public:
- TYPEINFO();
-
// --> OD 2008-05-07 #refactorlists#
// add optional parameter <bRestartNumberingAtSubList>
XMLTextListBlockContext(
diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx
index c7b636325745..804a1653cfb0 100644
--- a/xmloff/source/text/XMLTextListItemContext.cxx
+++ b/xmloff/source/text/XMLTextListItemContext.cxx
@@ -48,8 +48,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::xmloff::token;
-TYPEINIT1( XMLTextListItemContext, SvXMLImportContext );
-
XMLTextListItemContext::XMLTextListItemContext(
SvXMLImport& rImport,
XMLTextImportHelper& rTxtImp,
diff --git a/xmloff/source/text/XMLTextListItemContext.hxx b/xmloff/source/text/XMLTextListItemContext.hxx
index 349c0f0b0e37..02031cc04a03 100644
--- a/xmloff/source/text/XMLTextListItemContext.hxx
+++ b/xmloff/source/text/XMLTextListItemContext.hxx
@@ -44,8 +44,6 @@ class XMLTextListItemContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLTextListItemContext(
SvXMLImport& rImport,
XMLTextImportHelper& rTxtImp,
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index af480cb03485..224a310a5d74 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -103,8 +103,6 @@ void XMLFieldParamImportContext::StartElement(const ::com::sun::star::uno::Refer
}
-TYPEINIT1( XMLTextMarkImportContext, SvXMLImportContext);
-
XMLTextMarkImportContext::XMLTextMarkImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
diff --git a/xmloff/source/text/XMLTextMarkImportContext.hxx b/xmloff/source/text/XMLTextMarkImportContext.hxx
index 4ac3b5f77bd2..0e601b26ae64 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.hxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.hxx
@@ -82,8 +82,6 @@ class XMLTextMarkImportContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLTextMarkImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx
index fb3456f915ff..5d76519322d5 100644
--- a/xmloff/source/text/XMLTextMasterPageContext.cxx
+++ b/xmloff/source/text/XMLTextMasterPageContext.cxx
@@ -67,7 +67,6 @@ Reference < XStyle > XMLTextMasterPageContext::Create()
return xNewStyle;
}
-TYPEINIT1( XMLTextMasterPageContext, SvXMLStyleContext );
XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
diff --git a/xmloff/source/text/XMLTextMasterStylesContext.cxx b/xmloff/source/text/XMLTextMasterStylesContext.cxx
index 518616a78f96..1501febd2c25 100644
--- a/xmloff/source/text/XMLTextMasterStylesContext.cxx
+++ b/xmloff/source/text/XMLTextMasterStylesContext.cxx
@@ -49,8 +49,6 @@ using ::xmloff::token::XML_MASTER_PAGE;
// ------------------------------------------------------------------------
-TYPEINIT1( XMLTextMasterStylesContext, SvXMLStylesContext );
-
sal_Bool XMLTextMasterStylesContext::InsertStyleFamily( sal_uInt16 ) const
{
return sal_True;
diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx
index c35b7523c06f..0ce0d0fedab2 100644
--- a/xmloff/source/text/XMLTextShapeStyleContext.cxx
+++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx
@@ -153,8 +153,6 @@ void XMLTextShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
}
}
-TYPEINIT1( XMLTextShapeStyleContext, XMLShapeStyleContext );
-
XMLTextShapeStyleContext::XMLTextShapeStyleContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const Reference< XAttributeList > & xAttrList,
diff --git a/xmloff/source/text/XMLTextTableContext.cxx b/xmloff/source/text/XMLTextTableContext.cxx
index d92313e75785..5cf670d62c3e 100644
--- a/xmloff/source/text/XMLTextTableContext.cxx
+++ b/xmloff/source/text/XMLTextTableContext.cxx
@@ -31,8 +31,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::text;
-TYPEINIT1( XMLTextTableContext, SvXMLImportContext );
-
XMLTextTableContext::XMLTextTableContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName ) :
diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.cxx b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
index 3acb94f8f978..d57c7ed6044a 100644
--- a/xmloff/source/text/XMLTrackedChangesImportContext.cxx
+++ b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
@@ -42,8 +42,6 @@ using namespace ::xmloff::token;
-TYPEINIT1( XMLTrackedChangesImportContext, SvXMLImportContext );
-
XMLTrackedChangesImportContext::XMLTrackedChangesImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.hxx b/xmloff/source/text/XMLTrackedChangesImportContext.hxx
index a0d1b185bb14..316a6f611776 100644
--- a/xmloff/source/text/XMLTrackedChangesImportContext.hxx
+++ b/xmloff/source/text/XMLTrackedChangesImportContext.hxx
@@ -48,8 +48,6 @@ class XMLTrackedChangesImportContext : public SvXMLImportContext
{
public:
- TYPEINFO();
-
XMLTrackedChangesImportContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/text/txtdropi.cxx b/xmloff/source/text/txtdropi.cxx
index 18612c19d4fb..79b65e952a97 100644
--- a/xmloff/source/text/txtdropi.cxx
+++ b/xmloff/source/text/txtdropi.cxx
@@ -59,7 +59,6 @@ static __FAR_DATA SvXMLTokenMapEntry aDropAttrTokenMap[] =
XML_TOKEN_MAP_END
};
-TYPEINIT1( XMLTextDropCapImportContext, XMLElementPropertyContext );
void XMLTextDropCapImportContext::ProcessAttrs(
const Reference< xml::sax::XAttributeList >& xAttrList )
{
diff --git a/xmloff/source/text/txtdropi.hxx b/xmloff/source/text/txtdropi.hxx
index f8873863a57d..9c47d4d62e55 100644
--- a/xmloff/source/text/txtdropi.hxx
+++ b/xmloff/source/text/txtdropi.hxx
@@ -40,8 +40,6 @@ private:
::com::sun::star::xml::sax::XAttributeList > & xAttrList );
public:
- TYPEINFO();
-
XMLTextDropCapImportContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 61b59aae3334..b7ee240f7419 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -208,8 +208,6 @@ const sal_Char sAPI_TextRange[] = "TextRange";
const sal_Char sAPI_true[] = "sal_True";
-TYPEINIT1( XMLTextFieldImportContext, SvXMLImportContext);
-
XMLTextFieldImportContext::XMLTextFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
const sal_Char* pService,
@@ -628,8 +626,6 @@ void XMLTextFieldImportContext::ForceUpdate(
// XMLSenderFieldImportContext
//
-TYPEINIT1( XMLSenderFieldImportContext, XMLTextFieldImportContext);
-
XMLSenderFieldImportContext::XMLSenderFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName,
@@ -755,8 +751,6 @@ void XMLSenderFieldImportContext::PrepareField(
// XMLAuthorFieldImportContext
//
-TYPEINIT1( XMLAuthorFieldImportContext, XMLSenderFieldImportContext);
-
XMLAuthorFieldImportContext::XMLAuthorFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName,
@@ -815,8 +809,6 @@ void XMLAuthorFieldImportContext::PrepareField(
// page continuation string
//
-TYPEINIT1( XMLPageContinuationImportContext, XMLTextFieldImportContext );
-
static SvXMLEnumMapEntry __READONLY_DATA lcl_aSelectPageAttrMap[] =
{
{ XML_PREVIOUS, PageNumberType_PREV },
@@ -882,8 +874,6 @@ void XMLPageContinuationImportContext::PrepareField(
// page number field
//
-TYPEINIT1( XMLPageNumberImportContext, XMLTextFieldImportContext );
-
XMLPageNumberImportContext::XMLPageNumberImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& sLocalName)
@@ -993,8 +983,6 @@ void XMLPageNumberImportContext::PrepareField(
// Placeholder
//
-TYPEINIT1( XMLPlaceholderFieldImportContext, XMLTextFieldImportContext);
-
XMLPlaceholderFieldImportContext::XMLPlaceholderFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName)
@@ -1079,8 +1067,6 @@ void XMLPlaceholderFieldImportContext::PrepareField(
// time field
//
-TYPEINIT1( XMLTimeFieldImportContext, XMLTextFieldImportContext);
-
XMLTimeFieldImportContext::XMLTimeFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName)
@@ -1233,8 +1219,6 @@ void XMLTimeFieldImportContext::PrepareField(
// date field
//
-TYPEINIT1( XMLDateFieldImportContext, XMLTimeFieldImportContext );
-
XMLDateFieldImportContext::XMLDateFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -1293,8 +1277,6 @@ void XMLDateFieldImportContext::ProcessAttribute(
// database field superclass
//
-TYPEINIT1( XMLDatabaseFieldImportContext, XMLTextFieldImportContext );
-
XMLDatabaseFieldImportContext::XMLDatabaseFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
const sal_Char* pServiceName, sal_uInt16 nPrfx,
@@ -1437,8 +1419,6 @@ void XMLDatabaseFieldImportContext::PrepareField(
// database name field
//
-TYPEINIT1( XMLDatabaseNameImportContext, XMLDatabaseFieldImportContext );
-
XMLDatabaseNameImportContext::XMLDatabaseNameImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -1461,8 +1441,6 @@ void XMLDatabaseNameImportContext::ProcessAttribute(
// database next field
//
-TYPEINIT1( XMLDatabaseNextImportContext, XMLDatabaseFieldImportContext );
-
XMLDatabaseNextImportContext::XMLDatabaseNextImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
const sal_Char* pServiceName, sal_uInt16 nPrfx,
@@ -1528,8 +1506,6 @@ void XMLDatabaseNextImportContext::PrepareField(
// database select field
//
-TYPEINIT1( XMLDatabaseSelectImportContext, XMLDatabaseNextImportContext );
-
XMLDatabaseSelectImportContext::XMLDatabaseSelectImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const ::rtl::OUString& sLocalName) :
@@ -1580,8 +1556,6 @@ void XMLDatabaseSelectImportContext::PrepareField(
// database display row number field
//
-TYPEINIT1( XMLDatabaseNumberImportContext, XMLDatabaseFieldImportContext );
-
XMLDatabaseNumberImportContext::XMLDatabaseNumberImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -1655,8 +1629,6 @@ void XMLDatabaseNumberImportContext::PrepareField(
// Simple doc info fields
//
-TYPEINIT1( XMLSimpleDocInfoImportContext, XMLTextFieldImportContext );
-
XMLSimpleDocInfoImportContext::XMLSimpleDocInfoImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName, sal_uInt16 nToken,
@@ -1799,8 +1771,6 @@ const sal_Char* XMLSimpleDocInfoImportContext::MapTokenToServiceName(
// revision field
//
-TYPEINIT1( XMLRevisionDocInfoImportContext, XMLSimpleDocInfoImportContext );
-
XMLRevisionDocInfoImportContext::XMLRevisionDocInfoImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& sLocalName, sal_uInt16 nToken) :
@@ -1844,8 +1814,6 @@ void XMLRevisionDocInfoImportContext::PrepareField(
// DocInfo fields with date/time attributes
//
-TYPEINIT1( XMLDateTimeDocInfoImportContext, XMLSimpleDocInfoImportContext );
-
XMLDateTimeDocInfoImportContext::XMLDateTimeDocInfoImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& sLocalName, sal_uInt16 nToken)
@@ -1951,8 +1919,6 @@ void XMLDateTimeDocInfoImportContext::PrepareField(
// user defined docinfo fields
//
-TYPEINIT1( XMLUserDocInfoImportContext, XMLSimpleDocInfoImportContext );
-
XMLUserDocInfoImportContext::XMLUserDocInfoImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName, sal_uInt16 nToken) :
@@ -2039,8 +2005,6 @@ void XMLUserDocInfoImportContext::PrepareField(
// import hidden paragraph fields
//
-TYPEINIT1( XMLHiddenParagraphImportContext, XMLTextFieldImportContext );
-
XMLHiddenParagraphImportContext::XMLHiddenParagraphImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -2097,8 +2061,6 @@ void XMLHiddenParagraphImportContext::PrepareField(
// import conditional text (<text:conditional-text>)
//
-TYPEINIT1( XMLConditionalTextImportContext, XMLTextFieldImportContext );
-
XMLConditionalTextImportContext::XMLConditionalTextImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -2185,8 +2147,6 @@ void XMLConditionalTextImportContext::PrepareField(
// hidden text
//
-TYPEINIT1( XMLHiddenTextImportContext, XMLTextFieldImportContext);
-
XMLHiddenTextImportContext::XMLHiddenTextImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -2260,8 +2220,6 @@ void XMLHiddenTextImportContext::PrepareField(
// file name fields
//
-TYPEINIT1( XMLFileNameImportContext, XMLTextFieldImportContext );
-
static const SvXMLEnumMapEntry aFilenameDisplayMap[] =
{
{ XML_PATH, FilenameDisplayFormat::PATH },
@@ -2361,8 +2319,6 @@ static const SvXMLEnumMapEntry aTemplateDisplayMap[] =
{ XML_TOKEN_INVALID, 0 }
};
-TYPEINIT1( XMLTemplateNameImportContext, XMLTextFieldImportContext );
-
XMLTemplateNameImportContext::XMLTemplateNameImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& sLocalName) :
@@ -2410,8 +2366,6 @@ void XMLTemplateNameImportContext::PrepareField(
// import chapter fields
//
-TYPEINIT1( XMLChapterImportContext, XMLTextFieldImportContext );
-
static const SvXMLEnumMapEntry aChapterDisplayMap[] =
{
{ XML_NAME, ChapterFormat::NAME },
@@ -2489,8 +2443,6 @@ void XMLChapterImportContext::PrepareField(
// counting fields
//
-TYPEINIT1( XMLCountFieldImportContext, XMLTextFieldImportContext );
-
XMLCountFieldImportContext::XMLCountFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName, sal_uInt16 nToken) :
@@ -2590,8 +2542,6 @@ const sal_Char* XMLCountFieldImportContext::MapTokenToServiceName(
// page variable import
//
-TYPEINIT1( XMLPageVarGetFieldImportContext, XMLTextFieldImportContext );
-
XMLPageVarGetFieldImportContext::XMLPageVarGetFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -2653,8 +2603,6 @@ void XMLPageVarGetFieldImportContext::PrepareField(
// page variable set fields
//
-TYPEINIT1(XMLPageVarSetFieldImportContext, XMLTextFieldImportContext);
-
XMLPageVarSetFieldImportContext::XMLPageVarSetFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& sLocalName) :
@@ -2711,8 +2659,6 @@ void XMLPageVarSetFieldImportContext::PrepareField(
// macro fields
//
-TYPEINIT1( XMLMacroFieldImportContext, XMLTextFieldImportContext );
-
XMLMacroFieldImportContext::XMLMacroFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& sLocalName) :
@@ -2855,8 +2801,6 @@ void XMLMacroFieldImportContext::PrepareField(
// reference field import
//
-TYPEINIT1( XMLReferenceFieldImportContext, XMLTextFieldImportContext );
-
XMLReferenceFieldImportContext::XMLReferenceFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nToken, sal_uInt16 nPrfx, const OUString& sLocalName)
@@ -3015,8 +2959,6 @@ static __FAR_DATA SvXMLTokenMapEntry aDdeDeclAttrTokenMap[] =
XML_TOKEN_MAP_END
};
-TYPEINIT1( XMLDdeFieldDeclsImportContext, SvXMLImportContext );
-
XMLDdeFieldDeclsImportContext::XMLDdeFieldDeclsImportContext(
SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& sLocalName) :
SvXMLImportContext(rImport, nPrfx, sLocalName),
@@ -3049,8 +2991,6 @@ SvXMLImportContext * XMLDdeFieldDeclsImportContext::CreateChildContext(
// import dde field declaration
//
-TYPEINIT1( XMLDdeFieldDeclImportContext, SvXMLImportContext );
-
XMLDdeFieldDeclImportContext::XMLDdeFieldDeclImportContext(
SvXMLImport& rImport, sal_uInt16 nPrfx,
const OUString& sLocalName, const SvXMLTokenMap& rMap)
@@ -3190,8 +3130,6 @@ void XMLDdeFieldDeclImportContext::StartElement(
// DDE field import
//
-TYPEINIT1( XMLDdeFieldImportContext, XMLTextFieldImportContext );
-
XMLDdeFieldImportContext::XMLDdeFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -3274,8 +3212,6 @@ void XMLDdeFieldImportContext::PrepareField(
// sheet name fields
//
-TYPEINIT1(XMLSheetNameImportContext, XMLTextFieldImportContext);
-
XMLSheetNameImportContext::XMLSheetNameImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
@@ -3305,8 +3241,6 @@ void XMLSheetNameImportContext::PrepareField(
// URL fields (Calc, Impress, Draw)
//
-TYPEINIT1(XMLUrlFieldImportContext, XMLTextFieldImportContext);
-
XMLUrlFieldImportContext::XMLUrlFieldImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
@@ -3361,8 +3295,6 @@ void XMLUrlFieldImportContext::PrepareField(
}
-TYPEINIT1(XMLBibliographyFieldImportContext, XMLTextFieldImportContext);
-
XMLBibliographyFieldImportContext::XMLBibliographyFieldImportContext(
SvXMLImport& rImport,
@@ -3626,8 +3558,6 @@ const sal_Char* XMLBibliographyFieldImportContext::MapBibliographyFieldName(
// Annotation Field
//
-TYPEINIT1(XMLAnnotationImportContext, XMLTextFieldImportContext);
-
XMLAnnotationImportContext::XMLAnnotationImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
@@ -3790,8 +3720,6 @@ void XMLAnnotationImportContext::PrepareField(
// script field
//
-TYPEINIT1(XMLScriptImportContext, XMLTextFieldImportContext);
-
XMLScriptImportContext::XMLScriptImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
@@ -3857,8 +3785,6 @@ void XMLScriptImportContext::PrepareField(
// measure field
//
-TYPEINIT1(XMLMeasureFieldImportContext, XMLTextFieldImportContext);
-
XMLMeasureFieldImportContext::XMLMeasureFieldImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
@@ -3908,8 +3834,6 @@ void XMLMeasureFieldImportContext::PrepareField(
//
-TYPEINIT1( XMLDropDownFieldImportContext, XMLTextFieldImportContext );
-
XMLDropDownFieldImportContext::XMLDropDownFieldImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
@@ -4049,8 +3973,6 @@ void XMLDropDownFieldImportContext::PrepareField(
}
/** import header fields (<draw:header>) */
-TYPEINIT1( XMLHeaderFieldImportContext, XMLTextFieldImportContext );
-
XMLHeaderFieldImportContext::XMLHeaderFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -4073,8 +3995,6 @@ void XMLHeaderFieldImportContext::PrepareField(const Reference<XPropertySet> &)
}
/** import footer fields (<draw:footer>) */
-TYPEINIT1( XMLFooterFieldImportContext, XMLTextFieldImportContext );
-
XMLFooterFieldImportContext::XMLFooterFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
@@ -4098,8 +4018,6 @@ void XMLFooterFieldImportContext::PrepareField(const Reference<XPropertySet> &)
/** import footer fields (<draw:date-and-time>) */
-TYPEINIT1( XMLDateTimeFieldImportContext, XMLTextFieldImportContext );
-
XMLDateTimeFieldImportContext::XMLDateTimeFieldImportContext(
SvXMLImport& rImport, /// XML Import
XMLTextImportHelper& rHlp, /// Text import helper
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index b1821b9e4b82..546c4122ee8f 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1296,11 +1296,11 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
: XML_STYLE_FAMILY_TEXT_TEXT;
if (rStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle =
+ SvXMLStyleContext* pTempStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( nFamily, rStyleName,
- sal_True );
- pStyle = PTR_CAST( XMLTextStyleContext,pTempStyle);
+ sal_True ));
+ pStyle = dynamic_cast< XMLTextStyleContext* >( pTempStyle);
}
if( pStyle )
@@ -1529,10 +1529,10 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
OUString sStyleName( rStyleName );
if (sStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle =
+ SvXMLStyleContext* pTempStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
- FindStyleChildContext( nFamily, sStyleName, sal_True );
- pStyle = PTR_CAST( XMLTextStyleContext,pTempStyle);
+ FindStyleChildContext( nFamily, sStyleName, sal_True ));
+ pStyle = dynamic_cast< XMLTextStyleContext* >( pTempStyle);
}
if( pStyle )
sStyleName = pStyle->GetParentName();
@@ -2276,11 +2276,11 @@ void XMLTextImportHelper::SetRuby(
XMLPropStyleContext *pStyle = 0;
if (rStyleName.getLength() && m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle =
+ SvXMLStyleContext* pTempStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_RUBY,
- rStyleName, sal_True );
- pStyle = PTR_CAST(XMLPropStyleContext,pTempStyle);
+ rStyleName, sal_True ));
+ pStyle = dynamic_cast< XMLPropStyleContext* >( pTempStyle);
if (NULL != pStyle)
pStyle->FillPropertySet( xPropSet );
@@ -2575,10 +2575,10 @@ SvXMLImportContext *XMLTextImportHelper::CreateTableChildContext(
sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
sal_Bool* pIsSystemLanguage )
{
- const SvXMLStyleContext* pStyle =
+ SvXMLStyleContext* pStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE,
- sStyleName, sal_True );
+ sStyleName, sal_True ));
// get appropriate context
@@ -2586,14 +2586,14 @@ sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
// first check if its a impress and draw only number format
// this is needed since its also a SvXMLNumFormatContext,
// that was needed to support them for controls in impress/draw also
- SdXMLNumberFormatImportContext* pSdNumStyle = PTR_CAST( SdXMLNumberFormatImportContext, pStyle );
+ SdXMLNumberFormatImportContext* pSdNumStyle = dynamic_cast< SdXMLNumberFormatImportContext* >( pStyle );
if( pSdNumStyle )
{
return pSdNumStyle->GetDrawKey();
}
else
{
- SvXMLNumFormatContext* pNumStyle = PTR_CAST( SvXMLNumFormatContext, pStyle );
+ SvXMLNumFormatContext* pNumStyle = dynamic_cast< SvXMLNumFormatContext* >( pStyle );
if( pNumStyle )
{
if( pIsSystemLanguage != NULL )
@@ -2611,11 +2611,11 @@ const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUSt
const SvxXMLListStyleContext *pStyle = 0;
if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle =
+ SvXMLStyleContext* pTempStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_LIST, rName,
- sal_True );
- pStyle = PTR_CAST( SvxXMLListStyleContext ,pTempStyle);
+ sal_True ));
+ pStyle = dynamic_cast< SvxXMLListStyleContext * >( pTempStyle);
}
return pStyle;
@@ -2626,11 +2626,11 @@ XMLPropStyleContext *XMLTextImportHelper::FindAutoFrameStyle( const OUString& rN
XMLPropStyleContext *pStyle = 0;
if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle =
+ SvXMLStyleContext* pTempStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_SD_GRAPHICS_ID, rName,
- sal_True );
- pStyle = PTR_CAST( XMLPropStyleContext ,pTempStyle);
+ sal_True ));
+ pStyle = dynamic_cast< XMLPropStyleContext * >( pTempStyle);
}
return pStyle;
@@ -2642,12 +2642,12 @@ XMLPropStyleContext* XMLTextImportHelper::FindSectionStyle(
XMLPropStyleContext* pStyle = NULL;
if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle =
+ SvXMLStyleContext* pTempStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext(
XML_STYLE_FAMILY_TEXT_SECTION,
- rName, sal_True );
- pStyle = PTR_CAST( XMLPropStyleContext,pTempStyle);
+ rName, sal_True ));
+ pStyle = dynamic_cast< XMLPropStyleContext* >( pTempStyle);
}
return pStyle;
@@ -2659,12 +2659,12 @@ XMLPropStyleContext* XMLTextImportHelper::FindPageMaster(
XMLPropStyleContext* pStyle = NULL;
if (m_pImpl->m_xAutoStyles.Is())
{
- const SvXMLStyleContext* pTempStyle =
+ SvXMLStyleContext* pTempStyle = const_cast< SvXMLStyleContext* >(
((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
FindStyleChildContext(
XML_STYLE_FAMILY_PAGE_MASTER,
- rName, sal_True );
- pStyle = PTR_CAST( XMLPropStyleContext,pTempStyle);
+ rName, sal_True ));
+ pStyle = dynamic_cast< XMLPropStyleContext* >( pTempStyle);
}
return pStyle;
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index ecc672b257ee..82068e7fb7ff 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2941,7 +2941,7 @@ void XMLTextParagraphExport::exportContour(
/*const*/ PointSequence* pSequence =
(PointSequence*)aSourcePolyPolygon.getConstArray();
- SdXMLImExPointsElement aPoints( pSequence, aViewBox, aPoint, aSize );
+ SdXMLImExPointsElement aPoints( pSequence, aViewBox, aPoint, aSize, true);
// write point array
GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS,
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index d40afb2f5efc..237e18257e6e 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -81,8 +81,6 @@ using ::com::sun::star::container::XEnumerationAccess;
using ::com::sun::star::container::XEnumeration;
-TYPEINIT1( XMLCharContext, SvXMLImportContext );
-
XMLCharContext::XMLCharContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -174,8 +172,6 @@ void XMLCharContext::InsertString(const ::rtl::OUString& _sString)
class XMLStartReferenceContext_Impl : public SvXMLImportContext
{
public:
- TYPEINFO();
-
// Do everything in constructor. Well ...
XMLStartReferenceContext_Impl (
SvXMLImport& rImport,
@@ -190,8 +186,6 @@ public:
OUString& rName);
};
-TYPEINIT1( XMLStartReferenceContext_Impl, SvXMLImportContext );
-
XMLStartReferenceContext_Impl::XMLStartReferenceContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -247,8 +241,6 @@ sal_Bool XMLStartReferenceContext_Impl::FindName(
class XMLEndReferenceContext_Impl : public SvXMLImportContext
{
public:
- TYPEINFO();
-
// Do everything in constructor. Well ...
XMLEndReferenceContext_Impl(
SvXMLImport& rImport,
@@ -258,8 +250,6 @@ public:
const Reference<xml::sax::XAttributeList> & xAttrList);
};
-TYPEINIT1( XMLEndReferenceContext_Impl, SvXMLImportContext );
-
XMLEndReferenceContext_Impl::XMLEndReferenceContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -306,8 +296,6 @@ class XMLImpSpanContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLImpSpanContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -345,8 +333,6 @@ class XMLImpHyperlinkContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLImpHyperlinkContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -364,8 +350,6 @@ public:
virtual void Characters( const OUString& rChars );
};
-TYPEINIT1( XMLImpHyperlinkContext_Impl, SvXMLImportContext );
-
XMLImpHyperlinkContext_Impl::XMLImpHyperlinkContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -474,8 +458,6 @@ class XMLImpRubyBaseContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLImpRubyBaseContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -493,8 +475,6 @@ public:
virtual void Characters( const OUString& rChars );
};
-TYPEINIT1( XMLImpRubyBaseContext_Impl, SvXMLImportContext );
-
XMLImpRubyBaseContext_Impl::XMLImpRubyBaseContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -545,8 +525,6 @@ class XMLImpRubyContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLImpRubyContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -573,8 +551,6 @@ class XMLImpRubyTextContext_Impl : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLImpRubyTextContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -587,8 +563,6 @@ public:
virtual void Characters( const OUString& rChars );
};
-TYPEINIT1( XMLImpRubyTextContext_Impl, SvXMLImportContext );
-
XMLImpRubyTextContext_Impl::XMLImpRubyTextContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -628,8 +602,6 @@ void XMLImpRubyTextContext_Impl::Characters( const OUString& rChars )
// ---------------------------------------------------------------------
-TYPEINIT1( XMLImpRubyContext_Impl, SvXMLImportContext );
-
XMLImpRubyContext_Impl::XMLImpRubyContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -719,8 +691,6 @@ protected:
OUString m_XmlId;
public:
- TYPEINFO();
-
XMLMetaImportContextBase(
SvXMLImport& i_rImport,
const sal_uInt16 i_nPrefix,
@@ -748,8 +718,6 @@ public:
= 0;
};
-TYPEINIT1( XMLMetaImportContextBase, SvXMLImportContext );
-
XMLMetaImportContextBase::XMLMetaImportContextBase(
SvXMLImport& i_rImport,
const sal_uInt16 i_nPrefix,
@@ -843,8 +811,6 @@ class XMLMetaImportContext : public XMLMetaImportContextBase
::rtl::OUString m_sDatatype;
public:
- TYPEINFO();
-
XMLMetaImportContext(
SvXMLImport& i_rImport,
const sal_uInt16 i_nPrefix,
@@ -858,8 +824,6 @@ public:
virtual void InsertMeta(const Reference<XTextRange> & i_xInsertionRange);
};
-TYPEINIT1( XMLMetaImportContext, XMLMetaImportContextBase );
-
XMLMetaImportContext::XMLMetaImportContext(
SvXMLImport& i_rImport,
const sal_uInt16 i_nPrefix,
@@ -941,8 +905,6 @@ class XMLMetaFieldImportContext : public XMLMetaImportContextBase
OUString m_DataStyleName;
public:
- TYPEINFO();
-
XMLMetaFieldImportContext(
SvXMLImport& i_rImport,
const sal_uInt16 i_nPrefix,
@@ -956,8 +918,6 @@ public:
virtual void InsertMeta(const Reference<XTextRange> & i_xInsertionRange);
};
-TYPEINIT1( XMLMetaFieldImportContext, XMLMetaImportContextBase );
-
XMLMetaFieldImportContext::XMLMetaFieldImportContext(
SvXMLImport& i_rImport,
const sal_uInt16 i_nPrefix,
@@ -1052,8 +1012,6 @@ class XMLIndexMarkImportContext_Impl : public SvXMLImportContext
OUString sID;
public:
- TYPEINFO();
-
XMLIndexMarkImportContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -1090,8 +1048,6 @@ protected:
};
-TYPEINIT1( XMLIndexMarkImportContext_Impl, SvXMLImportContext );
-
XMLIndexMarkImportContext_Impl::XMLIndexMarkImportContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -1329,8 +1285,6 @@ class XMLTOCMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl
const OUString sLevel;
public:
- TYPEINFO();
-
XMLTOCMarkImportContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -1347,9 +1301,6 @@ protected:
Reference<beans::XPropertySet>& rPropSet);
};
-TYPEINIT1( XMLTOCMarkImportContext_Impl, XMLIndexMarkImportContext_Impl );
-
-
XMLTOCMarkImportContext_Impl::XMLTOCMarkImportContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) :
@@ -1395,8 +1346,6 @@ class XMLUserIndexMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl
const OUString sLevel;
public:
- TYPEINFO();
-
XMLUserIndexMarkImportContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -1413,8 +1362,6 @@ protected:
Reference<beans::XPropertySet>& rPropSet);
};
-TYPEINIT1( XMLUserIndexMarkImportContext_Impl, XMLIndexMarkImportContext_Impl);
-
XMLUserIndexMarkImportContext_Impl::XMLUserIndexMarkImportContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) :
@@ -1473,8 +1420,6 @@ class XMLAlphaIndexMarkImportContext_Impl : public XMLIndexMarkImportContext_Imp
const OUString sMainEntry;
public:
- TYPEINFO();
-
XMLAlphaIndexMarkImportContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
@@ -1491,9 +1436,6 @@ protected:
Reference<beans::XPropertySet>& rPropSet);
};
-TYPEINIT1( XMLAlphaIndexMarkImportContext_Impl,
- XMLIndexMarkImportContext_Impl );
-
XMLAlphaIndexMarkImportContext_Impl::XMLAlphaIndexMarkImportContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName,
enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts) :
@@ -1559,8 +1501,6 @@ void XMLAlphaIndexMarkImportContext_Impl::ProcessAttribute(
// ---------------------------------------------------------------------
-TYPEINIT1( XMLImpSpanContext_Impl, SvXMLImportContext );
-
XMLImpSpanContext_Impl::XMLImpSpanContext_Impl(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -1887,8 +1827,6 @@ void XMLImpSpanContext_Impl::Characters( const OUString& rChars )
// ---------------------------------------------------------------------
-TYPEINIT1( XMLParaContext, SvXMLImportContext );
-
XMLParaContext::XMLParaContext(
SvXMLImport& rImport,
sal_uInt16 nPrfx,
@@ -2320,8 +2258,6 @@ void XMLParaContext::Characters( const OUString& rChars )
-TYPEINIT1( XMLNumberedParaContext, SvXMLImportContext );
-
XMLNumberedParaContext::XMLNumberedParaContext(
SvXMLImport& i_rImport,
sal_uInt16 i_nPrefix,
diff --git a/xmloff/source/text/txtparai.hxx b/xmloff/source/text/txtparai.hxx
index 17df75c7e069..ef00ba38952e 100644
--- a/xmloff/source/text/txtparai.hxx
+++ b/xmloff/source/text/txtparai.hxx
@@ -62,8 +62,6 @@ class XMLParaContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLParaContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
const ::rtl::OUString& rLName,
@@ -98,8 +96,6 @@ class XMLNumberedParaContext : public SvXMLImportContext
public:
- TYPEINFO();
-
XMLNumberedParaContext( SvXMLImport& i_rImport,
sal_uInt16 i_nPrefix,
const ::rtl::OUString& i_rLocalName,
diff --git a/xmloff/source/text/txtparaimphint.hxx b/xmloff/source/text/txtparaimphint.hxx
index ef81c1af6085..8572dc152d49 100644
--- a/xmloff/source/text/txtparaimphint.hxx
+++ b/xmloff/source/text/txtparaimphint.hxx
@@ -224,10 +224,10 @@ public:
{
Reference <XTextContent > xTxt;
SvXMLImportContext *pContext = &xContext;
- if( pContext->ISA( XMLTextFrameContext ) )
- xTxt = PTR_CAST( XMLTextFrameContext, pContext )->GetTextContent();
- else if( pContext->ISA( XMLTextFrameHyperlinkContext ) )
- xTxt = PTR_CAST( XMLTextFrameHyperlinkContext, pContext )
+ if( dynamic_cast< XMLTextFrameContext* >(pContext) )
+ xTxt = dynamic_cast< XMLTextFrameContext* >( pContext )->GetTextContent();
+ else if( dynamic_cast< XMLTextFrameHyperlinkContext* >(pContext) )
+ xTxt = dynamic_cast< XMLTextFrameHyperlinkContext* >( pContext )
->GetTextContent();
return xTxt;
@@ -238,10 +238,10 @@ public:
{
Reference < drawing::XShape > xShape;
SvXMLImportContext *pContext = &xContext;
- if( pContext->ISA( XMLTextFrameContext ) )
- xShape = PTR_CAST( XMLTextFrameContext, pContext )->GetShape();
- else if( pContext->ISA( XMLTextFrameHyperlinkContext ) )
- xShape = PTR_CAST( XMLTextFrameHyperlinkContext, pContext )->GetShape();
+ if( dynamic_cast< XMLTextFrameContext* >(pContext) )
+ xShape = dynamic_cast< XMLTextFrameContext* >( pContext )->GetShape();
+ else if( dynamic_cast< XMLTextFrameHyperlinkContext* >(pContext) )
+ xShape = dynamic_cast< XMLTextFrameHyperlinkContext* >( pContext )->GetShape();
return xShape;
}
@@ -251,13 +251,13 @@ public:
{
sal_Bool bRet = sal_False;
SvXMLImportContext *pContext = &xContext;
- if( pContext->ISA( XMLTextFrameContext ) )
+ if( dynamic_cast< XMLTextFrameContext* >(pContext) )
bRet = TextContentAnchorType_AT_CHARACTER ==
- PTR_CAST( XMLTextFrameContext, pContext )
+ dynamic_cast< XMLTextFrameContext* >( pContext )
->GetAnchorType();
- else if( pContext->ISA( XMLTextFrameHyperlinkContext ) )
+ else if( dynamic_cast< XMLTextFrameHyperlinkContext* >(pContext) )
bRet = TextContentAnchorType_AT_CHARACTER ==
- PTR_CAST( XMLTextFrameHyperlinkContext, pContext )
+ dynamic_cast< XMLTextFrameHyperlinkContext* >( pContext )
->GetAnchorType();
return bRet;
}
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index 787a26de47af..1d5e1233f2d9 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -130,8 +130,6 @@ void XMLTextStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
}
}
-TYPEINIT1( XMLTextStyleContext, XMLPropStyleContext );
-
XMLTextStyleContext::XMLTextStyleContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const OUString& rLName,
const Reference< XAttributeList > & xAttrList,
diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx
index 6ca7b568dec7..7a2e5c32b896 100644
--- a/xmloff/source/text/txtvfldi.cxx
+++ b/xmloff/source/text/txtvfldi.cxx
@@ -105,8 +105,6 @@ using namespace ::xmloff::token;
// XMLVarFieldImportContext: superclass for all variable related fields
//
-TYPEINIT1( XMLVarFieldImportContext, XMLTextFieldImportContext );
-
XMLVarFieldImportContext::XMLVarFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
const sal_Char* pServiceName, sal_uInt16 nPrfx,
@@ -300,8 +298,6 @@ void XMLVarFieldImportContext::PrepareField(
// variable set fields
//
-TYPEINIT1( XMLSetVarFieldImportContext, XMLVarFieldImportContext );
-
XMLSetVarFieldImportContext::XMLSetVarFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
const sal_Char* pServiceName, sal_uInt16 nPrfx,
@@ -388,8 +384,6 @@ sal_Bool XMLSetVarFieldImportContext::FindFieldMaster(
// sequence field
//
-TYPEINIT1( XMLSequenceFieldImportContext, XMLSetVarFieldImportContext );
-
XMLSequenceFieldImportContext::XMLSequenceFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& rLocalName) :
@@ -461,8 +455,6 @@ void XMLSequenceFieldImportContext::PrepareField(
// variable set field
//
-TYPEINIT1( XMLVariableSetFieldImportContext, XMLSetVarFieldImportContext );
-
XMLVariableSetFieldImportContext::XMLVariableSetFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& rLocalName) :
@@ -497,8 +489,6 @@ void XMLVariableSetFieldImportContext::PrepareField(
// variable input field
//
-TYPEINIT1( XMLVariableInputFieldImportContext, XMLSetVarFieldImportContext );
-
XMLVariableInputFieldImportContext::XMLVariableInputFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& rLocalName) :
@@ -539,8 +529,6 @@ void XMLVariableInputFieldImportContext::PrepareField(
// user field
//
-TYPEINIT1( XMLUserFieldImportContext, XMLSetVarFieldImportContext );
-
XMLUserFieldImportContext::XMLUserFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& rLocalName) :
@@ -561,8 +549,6 @@ XMLUserFieldImportContext::XMLUserFieldImportContext(
// user input field
//
-TYPEINIT1( XMLUserFieldInputImportContext, XMLVarFieldImportContext );
-
// bug: doesn't work (SO API lacking)
XMLUserFieldInputImportContext::XMLUserFieldInputImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
@@ -594,8 +580,6 @@ void XMLUserFieldInputImportContext::PrepareField(
// variable get field
//
-TYPEINIT1( XMLVariableGetFieldImportContext, XMLVarFieldImportContext );
-
XMLVariableGetFieldImportContext::XMLVariableGetFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& rLocalName) :
@@ -629,8 +613,6 @@ void XMLVariableGetFieldImportContext::PrepareField(
// expression field
//
-TYPEINIT1( XMLExpressionFieldImportContext, XMLVarFieldImportContext );
-
XMLExpressionFieldImportContext::XMLExpressionFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& rLocalName) :
@@ -666,8 +648,6 @@ void XMLExpressionFieldImportContext::PrepareField(
// text input field
//
-TYPEINIT1( XMLTextInputFieldImportContext, XMLVarFieldImportContext );
-
XMLTextInputFieldImportContext::XMLTextInputFieldImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& sLocalName) :
@@ -699,8 +679,6 @@ void XMLTextInputFieldImportContext::PrepareField(
// table formula field
//
-TYPEINIT1( XMLTableFormulaImportContext, XMLTextFieldImportContext );
-
XMLTableFormulaImportContext::XMLTableFormulaImportContext(
SvXMLImport& rImport,
XMLTextImportHelper& rHlp,
@@ -776,8 +754,6 @@ void XMLTableFormulaImportContext::PrepareField(
// declaration containter import (<variable/user-field/sequence-decls>)
//
-TYPEINIT1( XMLVariableDeclsImportContext, SvXMLImportContext );
-
XMLVariableDeclsImportContext::XMLVariableDeclsImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& rLocalName, enum VarType eVarType) :
@@ -837,8 +813,6 @@ SvXMLImportContext* XMLVariableDeclsImportContext::CreateChildContext(
// declaration import (<variable/user-field/sequence-decl> elements)
//
-TYPEINIT1( XMLVariableDeclImportContext, SvXMLImportContext );
-
XMLVariableDeclImportContext::XMLVariableDeclImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp,
sal_uInt16 nPrfx, const OUString& rLocalName,
@@ -1100,8 +1074,6 @@ sal_Bool XMLVariableDeclImportContext::FindFieldMaster(
//
-TYPEINIT1( XMLDatabaseDisplayImportContext, XMLDatabaseFieldImportContext );
-
XMLDatabaseDisplayImportContext::XMLDatabaseDisplayImportContext(
SvXMLImport& rImport, XMLTextImportHelper& rHlp, sal_uInt16 nPrfx,
const OUString& rLocalName) :
diff --git a/xmloff/source/transform/ChartOASISTContext.cxx b/xmloff/source/transform/ChartOASISTContext.cxx
index 4b569302cf22..96f92ccccc47 100644
--- a/xmloff/source/transform/ChartOASISTContext.cxx
+++ b/xmloff/source/transform/ChartOASISTContext.cxx
@@ -41,8 +41,6 @@ using namespace ::xmloff::token;
// -----------------------------------------------------------------------------
-TYPEINIT1( XMLChartOASISTransformerContext, XMLTransformerContext );
-
XMLChartOASISTransformerContext::XMLChartOASISTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/ChartOASISTContext.hxx b/xmloff/source/transform/ChartOASISTContext.hxx
index b22e3f2e30eb..84f01cc178c5 100644
--- a/xmloff/source/transform/ChartOASISTContext.hxx
+++ b/xmloff/source/transform/ChartOASISTContext.hxx
@@ -29,8 +29,6 @@
class XMLChartOASISTransformerContext : public XMLTransformerContext
{
public:
- TYPEINFO();
-
XMLChartOASISTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
virtual ~XMLChartOASISTransformerContext();
diff --git a/xmloff/source/transform/ChartOOoTContext.cxx b/xmloff/source/transform/ChartOOoTContext.cxx
index 45d421541419..3a140af1e09a 100644
--- a/xmloff/source/transform/ChartOOoTContext.cxx
+++ b/xmloff/source/transform/ChartOOoTContext.cxx
@@ -43,8 +43,6 @@ using namespace ::xmloff::token;
// -----------------------------------------------------------------------------
-TYPEINIT1( XMLChartOOoTransformerContext, XMLTransformerContext );
-
XMLChartOOoTransformerContext::XMLChartOOoTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/ChartOOoTContext.hxx b/xmloff/source/transform/ChartOOoTContext.hxx
index 4765ded2b1c5..d88c3e85d10a 100644
--- a/xmloff/source/transform/ChartOOoTContext.hxx
+++ b/xmloff/source/transform/ChartOOoTContext.hxx
@@ -29,8 +29,6 @@
class XMLChartOOoTransformerContext : public XMLTransformerContext
{
public:
- TYPEINFO();
-
XMLChartOOoTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
virtual ~XMLChartOOoTransformerContext();
diff --git a/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx b/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx
index 08596f6703e5..34f25c7c4f2f 100644
--- a/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx
+++ b/xmloff/source/transform/ChartPlotAreaOASISTContext.cxx
@@ -41,8 +41,6 @@ using ::rtl::OUString;
class XMLAxisOASISContext : public XMLPersElemContentTContext
{
public:
- TYPEINFO();
-
XMLAxisOASISContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
::rtl::Reference< XMLPersAttrListTContext > & rOutCategoriesContext );
@@ -64,8 +62,6 @@ private:
bool m_bHasCategories;
};
-TYPEINIT1( XMLAxisOASISContext, XMLPersElemContentTContext );
-
XMLAxisOASISContext::XMLAxisOASISContext(
XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
@@ -200,8 +196,6 @@ bool XMLAxisOASISContext::IsCategoryAxis() const
}
-TYPEINIT1( XMLChartPlotAreaOASISTContext, XMLProcAttrTransformerContext );
-
XMLChartPlotAreaOASISTContext::XMLChartPlotAreaOASISTContext(
XMLTransformerBase & rTransformer, const ::rtl::OUString & rQName ) :
XMLProcAttrTransformerContext( rTransformer, rQName, OASIS_SHAPE_ACTIONS )
diff --git a/xmloff/source/transform/ChartPlotAreaOASISTContext.hxx b/xmloff/source/transform/ChartPlotAreaOASISTContext.hxx
index 463382180b61..aa7b4c3b20cd 100644
--- a/xmloff/source/transform/ChartPlotAreaOASISTContext.hxx
+++ b/xmloff/source/transform/ChartPlotAreaOASISTContext.hxx
@@ -30,8 +30,6 @@
class XMLChartPlotAreaOASISTContext : public XMLProcAttrTransformerContext
{
public:
- TYPEINFO();
-
explicit XMLChartPlotAreaOASISTContext(
XMLTransformerBase & rTransformer, const ::rtl::OUString & rQName );
virtual ~XMLChartPlotAreaOASISTContext();
diff --git a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx
index cf6230dc590c..493890e99a47 100644
--- a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx
+++ b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx
@@ -41,8 +41,6 @@ using ::rtl::OUString;
class XMLAxisOOoContext : public XMLPersElemContentTContext
{
public:
- TYPEINFO();
-
XMLAxisOOoContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
~XMLAxisOOoContext();
@@ -55,8 +53,6 @@ private:
bool m_bIsCategoryAxis;
};
-TYPEINIT1( XMLAxisOOoContext, XMLPersElemContentTContext );
-
XMLAxisOOoContext::XMLAxisOOoContext(
XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName ) :
@@ -132,8 +128,6 @@ bool XMLAxisOOoContext::IsCategoryAxis() const
}
-TYPEINIT1( XMLChartPlotAreaOOoTContext, XMLProcAttrTransformerContext )
-
XMLChartPlotAreaOOoTContext::XMLChartPlotAreaOOoTContext(
XMLTransformerBase & rTransformer, const ::rtl::OUString & rQName ) :
XMLProcAttrTransformerContext( rTransformer, rQName, OOO_SHAPE_ACTIONS )
diff --git a/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx b/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx
index cf53acc1b869..c68093915be5 100644
--- a/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx
+++ b/xmloff/source/transform/ChartPlotAreaOOoTContext.hxx
@@ -36,8 +36,6 @@ class XMLAxisContextVector :
class XMLChartPlotAreaOOoTContext : public XMLProcAttrTransformerContext
{
public:
- TYPEINFO();
-
explicit XMLChartPlotAreaOOoTContext(
XMLTransformerBase & rTransformer, const ::rtl::OUString & rQName );
virtual ~XMLChartPlotAreaOOoTContext();
diff --git a/xmloff/source/transform/ControlOASISTContext.cxx b/xmloff/source/transform/ControlOASISTContext.cxx
index 0f7dbdad6e54..e85215c27521 100644
--- a/xmloff/source/transform/ControlOASISTContext.cxx
+++ b/xmloff/source/transform/ControlOASISTContext.cxx
@@ -39,8 +39,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLControlOASISTransformerContext, XMLTransformerContext );
-
XMLControlOASISTransformerContext::XMLControlOASISTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/ControlOASISTContext.hxx b/xmloff/source/transform/ControlOASISTContext.hxx
index 0b261859fcb6..1bc28e0a4f16 100644
--- a/xmloff/source/transform/ControlOASISTContext.hxx
+++ b/xmloff/source/transform/ControlOASISTContext.hxx
@@ -32,8 +32,6 @@ class XMLControlOASISTransformerContext : public XMLTransformerContext
sal_Bool m_bCreateControl;
public:
- TYPEINFO();
-
XMLControlOASISTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_Bool bCreateControl );
diff --git a/xmloff/source/transform/ControlOOoTContext.cxx b/xmloff/source/transform/ControlOOoTContext.cxx
index 52925b507365..7adb1465aa32 100644
--- a/xmloff/source/transform/ControlOOoTContext.cxx
+++ b/xmloff/source/transform/ControlOOoTContext.cxx
@@ -40,8 +40,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLControlOOoTransformerContext, XMLTransformerContext );
-
XMLControlOOoTransformerContext::XMLControlOOoTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/ControlOOoTContext.hxx b/xmloff/source/transform/ControlOOoTContext.hxx
index 363be741a625..5e9651be4b15 100644
--- a/xmloff/source/transform/ControlOOoTContext.hxx
+++ b/xmloff/source/transform/ControlOOoTContext.hxx
@@ -34,8 +34,6 @@ class XMLControlOOoTransformerContext : public XMLTransformerContext
::rtl::OUString m_aElemQName;
public:
- TYPEINFO();
-
XMLControlOOoTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
diff --git a/xmloff/source/transform/CreateElemTContext.cxx b/xmloff/source/transform/CreateElemTContext.cxx
index 29e201c69465..782bea502a83 100644
--- a/xmloff/source/transform/CreateElemTContext.cxx
+++ b/xmloff/source/transform/CreateElemTContext.cxx
@@ -39,8 +39,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLCreateElemTransformerContext, XMLTransformerContext );
-
XMLCreateElemTransformerContext::XMLCreateElemTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/CreateElemTContext.hxx b/xmloff/source/transform/CreateElemTContext.hxx
index ffa2614c1bdd..10d13ceef1cc 100644
--- a/xmloff/source/transform/CreateElemTContext.hxx
+++ b/xmloff/source/transform/CreateElemTContext.hxx
@@ -38,8 +38,6 @@ protected:
sal_uInt16 GetActionMap() const { return m_nActionMap; }
public:
- TYPEINFO();
-
XMLCreateElemTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_uInt16 nActionMap );
diff --git a/xmloff/source/transform/DeepTContext.cxx b/xmloff/source/transform/DeepTContext.cxx
index 1b194bbb7ac2..ac1a264fa20c 100644
--- a/xmloff/source/transform/DeepTContext.cxx
+++ b/xmloff/source/transform/DeepTContext.cxx
@@ -39,8 +39,6 @@ using ::rtl::OUString;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-TYPEINIT1( XMLPersElemContentTContext, XMLPersAttrListTContext );
-
void XMLPersElemContentTContext::AddContent( XMLTransformerContext *pContext )
{
OSL_ENSURE( pContext && pContext->IsPersistent(),
diff --git a/xmloff/source/transform/DeepTContext.hxx b/xmloff/source/transform/DeepTContext.hxx
index eac219a8658d..9e0efe2b08b1 100644
--- a/xmloff/source/transform/DeepTContext.hxx
+++ b/xmloff/source/transform/DeepTContext.hxx
@@ -35,8 +35,6 @@ class XMLPersElemContentTContext : public XMLPersAttrListTContext
XMLTransformerContextVector m_aChildContexts;
public:
- TYPEINFO();
-
// element content persistence only
XMLPersElemContentTContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
diff --git a/xmloff/source/transform/DlgOASISTContext.cxx b/xmloff/source/transform/DlgOASISTContext.cxx
index 7d6eec6eee67..79a6af3380f0 100644
--- a/xmloff/source/transform/DlgOASISTContext.cxx
+++ b/xmloff/source/transform/DlgOASISTContext.cxx
@@ -41,8 +41,6 @@ using namespace ::xmloff::token;
// -----------------------------------------------------------------------------
-TYPEINIT1( XMLDlgOASISTransformerContext, XMLTransformerContext);
-
XMLDlgOASISTransformerContext::XMLDlgOASISTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/DlgOASISTContext.hxx b/xmloff/source/transform/DlgOASISTContext.hxx
index b1d4e2c8e069..217139931c89 100644
--- a/xmloff/source/transform/DlgOASISTContext.hxx
+++ b/xmloff/source/transform/DlgOASISTContext.hxx
@@ -29,8 +29,6 @@
class XMLDlgOASISTransformerContext : public XMLTransformerContext
{
public:
- TYPEINFO();
-
XMLDlgOASISTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
virtual ~XMLDlgOASISTransformerContext();
diff --git a/xmloff/source/transform/DocumentTContext.cxx b/xmloff/source/transform/DocumentTContext.cxx
index 7d478f5b24f5..7f1e18323cb6 100644
--- a/xmloff/source/transform/DocumentTContext.cxx
+++ b/xmloff/source/transform/DocumentTContext.cxx
@@ -48,8 +48,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::beans;
-TYPEINIT1( XMLDocumentTransformerContext, XMLTransformerContext );
-
XMLDocumentTransformerContext::XMLDocumentTransformerContext( XMLTransformerBase& rImp,
const OUString& rQName ) :
XMLTransformerContext( rImp, rQName )
diff --git a/xmloff/source/transform/DocumentTContext.hxx b/xmloff/source/transform/DocumentTContext.hxx
index c597d063b527..9adcc4c0e15d 100644
--- a/xmloff/source/transform/DocumentTContext.hxx
+++ b/xmloff/source/transform/DocumentTContext.hxx
@@ -29,8 +29,6 @@
class XMLDocumentTransformerContext : public XMLTransformerContext
{
public:
- TYPEINFO();
-
// A contexts constructor does anything that is required if an element
// starts. Namespace processing has been done already.
// Note that virtual methods cannot be used inside constructors. Use
diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx
index acf5fbd8bf18..c1089616f8cb 100644
--- a/xmloff/source/transform/EventOASISTContext.cxx
+++ b/xmloff/source/transform/EventOASISTContext.cxx
@@ -87,8 +87,6 @@ XMLTransformerOASISEventMap_Impl::~XMLTransformerOASISEventMap_Impl()
// -----------------------------------------------------------------------------
-TYPEINIT1( XMLEventOASISTransformerContext, XMLRenameElemTransformerContext);
-
XMLEventOASISTransformerContext::XMLEventOASISTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/EventOASISTContext.hxx b/xmloff/source/transform/EventOASISTContext.hxx
index 674f2c6f292d..a12f076c5564 100644
--- a/xmloff/source/transform/EventOASISTContext.hxx
+++ b/xmloff/source/transform/EventOASISTContext.hxx
@@ -31,8 +31,6 @@ class XMLTransformerOASISEventMap_Impl;
class XMLEventOASISTransformerContext : public XMLRenameElemTransformerContext
{
public:
- TYPEINFO();
-
XMLEventOASISTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
virtual ~XMLEventOASISTransformerContext();
diff --git a/xmloff/source/transform/EventOOoTContext.cxx b/xmloff/source/transform/EventOOoTContext.cxx
index de5a6e065104..17ca31cef24b 100644
--- a/xmloff/source/transform/EventOOoTContext.cxx
+++ b/xmloff/source/transform/EventOOoTContext.cxx
@@ -99,8 +99,6 @@ XMLTransformerOOoEventMap_Impl::~XMLTransformerOOoEventMap_Impl()
// -----------------------------------------------------------------------------
-TYPEINIT1( XMLEventOOoTransformerContext, XMLPersElemContentTContext );
-
XMLEventOOoTransformerContext::XMLEventOOoTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/EventOOoTContext.hxx b/xmloff/source/transform/EventOOoTContext.hxx
index bfcbb8904bea..dcf1e4a32851 100644
--- a/xmloff/source/transform/EventOOoTContext.hxx
+++ b/xmloff/source/transform/EventOOoTContext.hxx
@@ -33,8 +33,6 @@ class XMLEventOOoTransformerContext : public XMLPersElemContentTContext
sal_Bool m_bPersistent;
public:
- TYPEINFO();
-
XMLEventOOoTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_Bool bPersistent = sal_False );
diff --git a/xmloff/source/transform/FlatTContext.cxx b/xmloff/source/transform/FlatTContext.cxx
index 428cb8f769bc..953431d185dc 100644
--- a/xmloff/source/transform/FlatTContext.cxx
+++ b/xmloff/source/transform/FlatTContext.cxx
@@ -33,8 +33,6 @@ using ::rtl::OUString;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-TYPEINIT1( XMLPersTextContentTContext, XMLPersAttrListTContext );
-
XMLPersTextContentTContext::XMLPersTextContentTContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/FlatTContext.hxx b/xmloff/source/transform/FlatTContext.hxx
index fe3a3141a809..ae0843ebbda3 100644
--- a/xmloff/source/transform/FlatTContext.hxx
+++ b/xmloff/source/transform/FlatTContext.hxx
@@ -32,8 +32,6 @@ class XMLPersTextContentTContext : public XMLPersAttrListTContext
::rtl::OUString m_aCharacters;
public:
- TYPEINFO();
-
// A contexts constructor does anything that is required if an element
// starts. Namespace processing has been done already.
// Note that virtual methods cannot be used inside constructors. Use
diff --git a/xmloff/source/transform/FormPropOASISTContext.cxx b/xmloff/source/transform/FormPropOASISTContext.cxx
index d107d1a7d2af..26c34e91045e 100644
--- a/xmloff/source/transform/FormPropOASISTContext.cxx
+++ b/xmloff/source/transform/FormPropOASISTContext.cxx
@@ -39,9 +39,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLFormPropOASISTransformerContext,
- XMLRenameElemTransformerContext );
-
XMLTokenEnum XMLFormPropOASISTransformerContext::GetValueType(
const OUString& rValue )
{
diff --git a/xmloff/source/transform/FormPropOASISTContext.hxx b/xmloff/source/transform/FormPropOASISTContext.hxx
index 412d1df0fcb5..27054411a85c 100644
--- a/xmloff/source/transform/FormPropOASISTContext.hxx
+++ b/xmloff/source/transform/FormPropOASISTContext.hxx
@@ -35,8 +35,6 @@ class XMLFormPropOASISTransformerContext :
::xmloff::token::XMLTokenEnum GetValueType( const ::rtl::OUString& rValue );
public:
- TYPEINFO();
-
XMLFormPropOASISTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
::xmloff::token::XMLTokenEnum eLocalName );
diff --git a/xmloff/source/transform/FormPropOOoTContext.cxx b/xmloff/source/transform/FormPropOOoTContext.cxx
index a9730c53b95f..e69c16164f25 100644
--- a/xmloff/source/transform/FormPropOOoTContext.cxx
+++ b/xmloff/source/transform/FormPropOOoTContext.cxx
@@ -50,8 +50,6 @@ class XMLFormPropValueTContext_Impl : public XMLTransformerContext
sal_Bool m_bIsVoid;
public:
- TYPEINFO();
-
// element content persistence only
XMLFormPropValueTContext_Impl( XMLTransformerBase& rTransformer,
const OUString& rQName );
@@ -74,8 +72,6 @@ public:
const ::rtl::OUString& GetTextContent() const { return m_aCharacters; }
};
-TYPEINIT1( XMLFormPropValueTContext_Impl, XMLTransformerContext );
-
XMLFormPropValueTContext_Impl::XMLFormPropValueTContext_Impl(
XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName ) :
@@ -151,8 +147,6 @@ sal_Bool XMLFormPropValueTContext_Impl::IsPersistent() const
//------------------------------------------------------------------------------
-TYPEINIT1( XMLFormPropOOoTransformerContext, XMLTransformerContext );
-
XMLFormPropOOoTransformerContext::XMLFormPropOOoTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/FormPropOOoTContext.hxx b/xmloff/source/transform/FormPropOOoTContext.hxx
index cd72e5d04437..b2eeb3f9e551 100644
--- a/xmloff/source/transform/FormPropOOoTContext.hxx
+++ b/xmloff/source/transform/FormPropOOoTContext.hxx
@@ -46,8 +46,6 @@ class XMLFormPropOOoTransformerContext : public XMLTransformerContext
sal_Bool m_bIsList;
public:
- TYPEINFO();
-
XMLFormPropOOoTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
diff --git a/xmloff/source/transform/FrameOASISTContext.cxx b/xmloff/source/transform/FrameOASISTContext.cxx
index c5e91b96e25e..c92f0c6f7516 100644
--- a/xmloff/source/transform/FrameOASISTContext.cxx
+++ b/xmloff/source/transform/FrameOASISTContext.cxx
@@ -40,8 +40,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLFrameOASISTransformerContext, XMLTransformerContext );
-
sal_Bool XMLFrameOASISTransformerContext::IsLinkedEmbeddedObject(
const OUString& rLocalName,
const Reference< XAttributeList >& rAttrList )
diff --git a/xmloff/source/transform/FrameOASISTContext.hxx b/xmloff/source/transform/FrameOASISTContext.hxx
index 738aa4b3a0e1..26015175f863 100644
--- a/xmloff/source/transform/FrameOASISTContext.hxx
+++ b/xmloff/source/transform/FrameOASISTContext.hxx
@@ -41,8 +41,6 @@ class XMLFrameOASISTransformerContext : public XMLTransformerContext
::com::sun::star::xml::sax::XAttributeList >& rAttrList );
public:
- TYPEINFO();
-
XMLFrameOASISTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
diff --git a/xmloff/source/transform/FrameOOoTContext.cxx b/xmloff/source/transform/FrameOOoTContext.cxx
index 232bd2f9cee8..1e63d5403972 100644
--- a/xmloff/source/transform/FrameOOoTContext.cxx
+++ b/xmloff/source/transform/FrameOOoTContext.cxx
@@ -41,8 +41,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLFrameOOoTransformerContext, XMLPersElemContentTContext );
-
XMLFrameOOoTransformerContext::XMLFrameOOoTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/FrameOOoTContext.hxx b/xmloff/source/transform/FrameOOoTContext.hxx
index 2c6c342eb7d1..9eb749f2ccaa 100644
--- a/xmloff/source/transform/FrameOOoTContext.hxx
+++ b/xmloff/source/transform/FrameOOoTContext.hxx
@@ -31,8 +31,6 @@ class XMLFrameOOoTransformerContext : public XMLPersElemContentTContext
::rtl::OUString m_aElemQName;
public:
- TYPEINFO();
-
XMLFrameOOoTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
diff --git a/xmloff/source/transform/IgnoreTContext.cxx b/xmloff/source/transform/IgnoreTContext.cxx
index 941d766a12b8..f908109a6602 100644
--- a/xmloff/source/transform/IgnoreTContext.cxx
+++ b/xmloff/source/transform/IgnoreTContext.cxx
@@ -33,8 +33,6 @@ using ::rtl::OUString;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-TYPEINIT1( XMLIgnoreTransformerContext, XMLTransformerContext );
-
XMLIgnoreTransformerContext::XMLIgnoreTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/IgnoreTContext.hxx b/xmloff/source/transform/IgnoreTContext.hxx
index 606505f4ef4a..0c4af883edbc 100644
--- a/xmloff/source/transform/IgnoreTContext.hxx
+++ b/xmloff/source/transform/IgnoreTContext.hxx
@@ -35,8 +35,6 @@ class XMLIgnoreTransformerContext : public XMLTransformerContext
sal_Bool m_bRecursiveUse;
public:
- TYPEINFO();
-
// A contexts constructor does anything that is required if an element
// starts. Namespace processing has been done already.
// Note that virtual methods cannot be used inside constructors. Use
diff --git a/xmloff/source/transform/MergeElemTContext.cxx b/xmloff/source/transform/MergeElemTContext.cxx
index b0ea9395917a..976566e3269c 100644
--- a/xmloff/source/transform/MergeElemTContext.cxx
+++ b/xmloff/source/transform/MergeElemTContext.cxx
@@ -42,8 +42,6 @@ using namespace ::xmloff::token;
class XMLParagraphTransformerContext : public XMLTransformerContext
{
public:
- TYPEINFO();
-
XMLParagraphTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -71,8 +69,6 @@ public:
virtual void Characters( const ::rtl::OUString& rChars );
};
-TYPEINIT1( XMLParagraphTransformerContext, XMLTransformerContext );
-
XMLParagraphTransformerContext::XMLParagraphTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -116,8 +112,6 @@ void XMLParagraphTransformerContext::Characters( const OUString& rChars )
class XMLPersTextContentRNGTransformTContext : public XMLPersTextContentTContext
{
public:
- TYPEINFO();
-
XMLPersTextContentRNGTransformTContext(
XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
@@ -128,8 +122,6 @@ public:
virtual void Characters( const ::rtl::OUString& rChars );
};
-TYPEINIT1( XMLPersTextContentRNGTransformTContext, XMLPersAttrListTContext );
-
XMLPersTextContentRNGTransformTContext::XMLPersTextContentRNGTransformTContext(
XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
@@ -150,8 +142,6 @@ void XMLPersTextContentRNGTransformTContext::Characters( const ::rtl::OUString&
}
-TYPEINIT1( XMLMergeElemTransformerContext, XMLTransformerContext );
-
void XMLMergeElemTransformerContext::ExportStartElement()
{
XMLPersTextContentTContextVector::iterator aIter = m_aChildContexts.begin();
diff --git a/xmloff/source/transform/MergeElemTContext.hxx b/xmloff/source/transform/MergeElemTContext.hxx
index 54b46f1dd611..8ab4e55a2a89 100644
--- a/xmloff/source/transform/MergeElemTContext.hxx
+++ b/xmloff/source/transform/MergeElemTContext.hxx
@@ -42,8 +42,6 @@ class XMLMergeElemTransformerContext : public XMLTransformerContext
void ExportStartElement();
public:
- TYPEINFO();
-
XMLMergeElemTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_uInt16 nActionMap );
diff --git a/xmloff/source/transform/MetaTContext.cxx b/xmloff/source/transform/MetaTContext.cxx
index 919782dd089e..53017089ca5c 100644
--- a/xmloff/source/transform/MetaTContext.cxx
+++ b/xmloff/source/transform/MetaTContext.cxx
@@ -66,8 +66,6 @@ XMLTokenEnum aMetaTokens[] =
XML_TOKEN_END
};
-TYPEINIT1( XMLMetaTransformerContext, XMLTransformerContext );
-
XMLMetaTransformerContext::XMLMetaTransformerContext( XMLTransformerBase& rImp,
const OUString& rQName ) :
XMLTransformerContext( rImp, rQName )
diff --git a/xmloff/source/transform/MetaTContext.hxx b/xmloff/source/transform/MetaTContext.hxx
index 3be2a5d32ed2..c9dd5bc490b8 100644
--- a/xmloff/source/transform/MetaTContext.hxx
+++ b/xmloff/source/transform/MetaTContext.hxx
@@ -43,8 +43,6 @@ class XMLMetaTransformerContext : public XMLTransformerContext
XMLMetaContexts_Impl m_aContexts;
public:
- TYPEINFO();
-
// A contexts constructor does anything that is required if an element
// starts. Namespace processing has been done already.
// Note that virtual methods cannot be used inside constructors. Use
diff --git a/xmloff/source/transform/NotesTContext.cxx b/xmloff/source/transform/NotesTContext.cxx
index f9e60fa1bb00..7961555a5730 100644
--- a/xmloff/source/transform/NotesTContext.cxx
+++ b/xmloff/source/transform/NotesTContext.cxx
@@ -50,8 +50,6 @@ using namespace ::xmloff::token;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-TYPEINIT1( XMLNotesTransformerContext, XMLPersElemContentTContext );
-
XMLNotesTransformerContext::XMLNotesTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/NotesTContext.hxx b/xmloff/source/transform/NotesTContext.hxx
index 7f1842e25fe1..85b78a5a9679 100644
--- a/xmloff/source/transform/NotesTContext.hxx
+++ b/xmloff/source/transform/NotesTContext.hxx
@@ -33,8 +33,6 @@ class XMLNotesTransformerContext : public XMLPersElemContentTContext
::xmloff::token::XMLTokenEnum m_eTypeToken;
public:
- TYPEINFO();
-
XMLNotesTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
::xmloff::token::XMLTokenEnum m_eToken,
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 31d03f496465..6a9bf7eaa60e 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -1106,8 +1106,6 @@ class XMLDocumentTransformerContext_Impl : public XMLTransformerContext
::rtl::OUString m_aOldClass;
public:
- TYPEINFO();
-
XMLDocumentTransformerContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
XMLDocumentTransformerContext_Impl( XMLTransformerBase& rTransformer,
@@ -1121,8 +1119,6 @@ public:
virtual void EndElement();
};
-TYPEINIT1( XMLDocumentTransformerContext_Impl, XMLTransformerContext );
-
XMLDocumentTransformerContext_Impl::XMLDocumentTransformerContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -1257,8 +1253,6 @@ class XMLBodyTransformerContext_Impl : public XMLTransformerContext
OUString m_aClassQName;
public:
- TYPEINFO();
-
XMLBodyTransformerContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -1268,8 +1262,6 @@ public:
virtual void EndElement();
};
-TYPEINIT1( XMLBodyTransformerContext_Impl, XMLTransformerContext );
-
XMLBodyTransformerContext_Impl::XMLBodyTransformerContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -1321,8 +1313,6 @@ void XMLBodyTransformerContext_Impl::EndElement()
class XMLTabStopOOoTContext_Impl : public XMLPersElemContentTContext
{
public:
- TYPEINFO();
-
XMLTabStopOOoTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -1331,8 +1321,6 @@ public:
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
-TYPEINIT1( XMLTabStopOOoTContext_Impl, XMLPersElemContentTContext );
-
XMLTabStopOOoTContext_Impl::XMLTabStopOOoTContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -1424,8 +1412,6 @@ class XMLTrackedChangesOOoTContext_Impl : public XMLTransformerContext
public:
- TYPEINFO();
-
XMLTrackedChangesOOoTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_uInt16 nPrefix,
@@ -1436,8 +1422,6 @@ public:
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
-TYPEINIT1( XMLTrackedChangesOOoTContext_Impl, XMLTransformerContext );
-
XMLTrackedChangesOOoTContext_Impl::XMLTrackedChangesOOoTContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName,
@@ -1502,8 +1486,6 @@ class XMLTableOOoTransformerContext_Impl : public XMLTransformerContext
::rtl::OUString m_aElemQName;
public:
- TYPEINFO();
-
XMLTableOOoTransformerContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -1513,8 +1495,6 @@ public:
virtual void EndElement();
};
-TYPEINIT1( XMLTableOOoTransformerContext_Impl, XMLTransformerContext );
-
XMLTableOOoTransformerContext_Impl::XMLTableOOoTransformerContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index 1ef69dcd73cc..fefcd1127aa1 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -1170,8 +1170,6 @@ class XMLTableTransformerContext_Impl : public XMLTransformerContext
::rtl::OUString m_aElemQName;
public:
- TYPEINFO();
-
XMLTableTransformerContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -1181,8 +1179,6 @@ public:
virtual void EndElement();
};
-TYPEINIT1( XMLTableTransformerContext_Impl, XMLTransformerContext );
-
XMLTableTransformerContext_Impl::XMLTableTransformerContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -1277,8 +1273,6 @@ class XMLBodyOASISTransformerContext_Impl : public XMLTransformerContext
sal_Bool m_bFirstChild;
public:
- TYPEINFO();
-
XMLBodyOASISTransformerContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -1293,8 +1287,6 @@ public:
virtual void EndElement();
};
-TYPEINIT1( XMLBodyOASISTransformerContext_Impl, XMLTransformerContext );
-
XMLBodyOASISTransformerContext_Impl::XMLBodyOASISTransformerContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -1339,8 +1331,6 @@ void XMLBodyOASISTransformerContext_Impl::EndElement()
class XMLTabStopOASISTContext_Impl : public XMLPersElemContentTContext
{
public:
- TYPEINFO();
-
XMLTabStopOASISTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -1349,8 +1339,6 @@ public:
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
-TYPEINIT1( XMLTabStopOASISTContext_Impl, XMLPersElemContentTContext );
-
XMLTabStopOASISTContext_Impl::XMLTabStopOASISTContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -1476,8 +1464,6 @@ class XMLConfigItemTContext_Impl : public XMLTransformerContext
public:
- TYPEINFO();
-
XMLConfigItemTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -1489,8 +1475,6 @@ public:
virtual void Characters( const ::rtl::OUString& rChars );
};
-TYPEINIT1( XMLConfigItemTContext_Impl, XMLTransformerContext );
-
XMLConfigItemTContext_Impl::XMLConfigItemTContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -1593,8 +1577,6 @@ class XMLTrackedChangesOASISTContext_Impl : public XMLTransformerContext
public:
- TYPEINFO();
-
XMLTrackedChangesOASISTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_uInt16 nPrefix,
@@ -1605,8 +1587,6 @@ public:
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
};
-TYPEINIT1( XMLTrackedChangesOASISTContext_Impl, XMLTransformerContext );
-
XMLTrackedChangesOASISTContext_Impl::XMLTrackedChangesOASISTContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/PersAttrListTContext.cxx b/xmloff/source/transform/PersAttrListTContext.cxx
index 79e093aaad00..670e4c6737c5 100644
--- a/xmloff/source/transform/PersAttrListTContext.cxx
+++ b/xmloff/source/transform/PersAttrListTContext.cxx
@@ -38,8 +38,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::xml::sax;
-TYPEINIT1( XMLPersAttrListTContext, XMLTransformerContext );
-
void XMLPersAttrListTContext::AddAttribute(
sal_uInt16 nAPrefix,
::xmloff::token::XMLTokenEnum eAToken,
diff --git a/xmloff/source/transform/PersAttrListTContext.hxx b/xmloff/source/transform/PersAttrListTContext.hxx
index 3c24ff00e47c..62625cbdcde7 100644
--- a/xmloff/source/transform/PersAttrListTContext.hxx
+++ b/xmloff/source/transform/PersAttrListTContext.hxx
@@ -41,8 +41,6 @@ protected:
void SetExportQName( const ::rtl::OUString& r ) { m_aElemQName = r; }
public:
- TYPEINFO();
-
// A contexts constructor does anything that is required if an element
// starts. Namespace processing has been done already.
// Note that virtual methods cannot be used inside constructors. Use
diff --git a/xmloff/source/transform/PersMixedContentTContext.cxx b/xmloff/source/transform/PersMixedContentTContext.cxx
index 957b615143ad..025e7de8572d 100644
--- a/xmloff/source/transform/PersMixedContentTContext.cxx
+++ b/xmloff/source/transform/PersMixedContentTContext.cxx
@@ -39,8 +39,6 @@ class XMLPersTextTContext_Impl : public XMLTransformerContext
::rtl::OUString m_aCharacters;
public:
- TYPEINFO();
-
XMLPersTextTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rChars );
virtual ~XMLPersTextTContext_Impl();
@@ -58,8 +56,6 @@ public:
const ::rtl::OUString& GetText() const { return m_aCharacters; }
};
-TYPEINIT1( XMLPersTextTContext_Impl, XMLTransformerContext );
-
XMLPersTextTContext_Impl::XMLPersTextTContext_Impl(
XMLTransformerBase& rImp,
const OUString& rChars ) :
@@ -110,8 +106,6 @@ void XMLPersTextTContext_Impl::Export()
//------------------------------------------------------------------------------
-TYPEINIT1( XMLPersMixedContentTContext, XMLPersElemContentTContext );
-
XMLPersMixedContentTContext::XMLPersMixedContentTContext(
XMLTransformerBase& rImp,
const OUString& rQName ) :
diff --git a/xmloff/source/transform/PersMixedContentTContext.hxx b/xmloff/source/transform/PersMixedContentTContext.hxx
index a19878282506..19d6e05a760a 100644
--- a/xmloff/source/transform/PersMixedContentTContext.hxx
+++ b/xmloff/source/transform/PersMixedContentTContext.hxx
@@ -32,8 +32,6 @@
class XMLPersMixedContentTContext : public XMLPersElemContentTContext
{
public:
- TYPEINFO();
-
// mixed content persistence only
XMLPersMixedContentTContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
diff --git a/xmloff/source/transform/ProcAddAttrTContext.cxx b/xmloff/source/transform/ProcAddAttrTContext.cxx
index a9c1e223716e..4a0744ac9adf 100644
--- a/xmloff/source/transform/ProcAddAttrTContext.cxx
+++ b/xmloff/source/transform/ProcAddAttrTContext.cxx
@@ -36,8 +36,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLProcAddAttrTransformerContext, XMLProcAttrTransformerContext);
-
XMLProcAddAttrTransformerContext::XMLProcAddAttrTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/ProcAddAttrTContext.hxx b/xmloff/source/transform/ProcAddAttrTContext.hxx
index 703f2b1ad2b8..7e25cbb0f41d 100644
--- a/xmloff/source/transform/ProcAddAttrTContext.hxx
+++ b/xmloff/source/transform/ProcAddAttrTContext.hxx
@@ -34,8 +34,6 @@ class XMLProcAddAttrTransformerContext : public XMLProcAttrTransformerContext
::rtl::OUString m_aAttrValue;
public:
- TYPEINFO();
-
XMLProcAddAttrTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_uInt16 nPrefix,
diff --git a/xmloff/source/transform/ProcAttrTContext.cxx b/xmloff/source/transform/ProcAttrTContext.cxx
index 2e9f32dc596f..dfc45420775b 100644
--- a/xmloff/source/transform/ProcAttrTContext.cxx
+++ b/xmloff/source/transform/ProcAttrTContext.cxx
@@ -37,8 +37,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
-TYPEINIT1( XMLProcAttrTransformerContext, XMLTransformerContext );
-
XMLProcAttrTransformerContext::XMLProcAttrTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/ProcAttrTContext.hxx b/xmloff/source/transform/ProcAttrTContext.hxx
index 8f0c01a3bec0..d91bcac3b5ec 100644
--- a/xmloff/source/transform/ProcAttrTContext.hxx
+++ b/xmloff/source/transform/ProcAttrTContext.hxx
@@ -40,8 +40,6 @@ protected:
sal_uInt16 GetActionMap() const { return m_nActionMap; }
public:
- TYPEINFO();
-
XMLProcAttrTransformerContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_uInt16 nActionMap );
diff --git a/xmloff/source/transform/RenameElemTContext.cxx b/xmloff/source/transform/RenameElemTContext.cxx
index baf54a047cea..5e263f7c02f6 100644
--- a/xmloff/source/transform/RenameElemTContext.cxx
+++ b/xmloff/source/transform/RenameElemTContext.cxx
@@ -35,8 +35,6 @@ using ::rtl::OUString;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-TYPEINIT1( XMLRenameElemTransformerContext, XMLTransformerContext );
-
XMLRenameElemTransformerContext::XMLRenameElemTransformerContext(
XMLTransformerBase& rImp,
const OUString& rQName,
diff --git a/xmloff/source/transform/RenameElemTContext.hxx b/xmloff/source/transform/RenameElemTContext.hxx
index 663d94237800..570b58e92b10 100644
--- a/xmloff/source/transform/RenameElemTContext.hxx
+++ b/xmloff/source/transform/RenameElemTContext.hxx
@@ -35,8 +35,6 @@ class XMLRenameElemTransformerContext : public XMLTransformerContext
::rtl::OUString m_aAttrValue;
public:
- TYPEINFO();
-
// The following consutructor renames the element names "rQName"
// to bPrefix/eToken
XMLRenameElemTransformerContext( XMLTransformerBase& rTransformer,
diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx
index bdbbaefc31a6..725f6268976a 100644
--- a/xmloff/source/transform/StyleOASISTContext.cxx
+++ b/xmloff/source/transform/StyleOASISTContext.cxx
@@ -89,8 +89,6 @@ public:
XMLTransformerContext::SetQName( rQName );
};
- TYPEINFO();
-
XMLPropertiesTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
XMLPropType eP,
@@ -112,8 +110,6 @@ public:
sal_Unicode c );
};
-TYPEINIT1( XMLPropertiesTContext_Impl, XMLPersElemContentTContext );
-
XMLPropertiesTContext_Impl::XMLPropertiesTContext_Impl(
XMLTransformerBase& rImp, const OUString& rQName, XMLPropType eP,
const ::rtl::OUString& rStyleFamily, sal_Bool _bControlStyle ) :
@@ -759,8 +755,6 @@ OUString XMLPropertiesTContext_Impl::MergeLineThrough(
//------------------------------------------------------------------------------
-TYPEINIT1( XMLStyleOASISTContext, XMLPersElemContentTContext );
-
XMLStyleOASISTContext::XMLStyleOASISTContext( XMLTransformerBase& rImp,
const OUString& rQName,
sal_Bool bPersistent ) :
diff --git a/xmloff/source/transform/StyleOASISTContext.hxx b/xmloff/source/transform/StyleOASISTContext.hxx
index dc1d245d305b..1e5b1fdc81e6 100644
--- a/xmloff/source/transform/StyleOASISTContext.hxx
+++ b/xmloff/source/transform/StyleOASISTContext.hxx
@@ -39,8 +39,6 @@ class XMLStyleOASISTContext : public XMLPersElemContentTContext
::rtl::OUString m_aStyleFamily;
public:
- TYPEINFO();
-
XMLStyleOASISTContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
sal_Bool bPersistent=sal_False );
diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx
index 52710e7282b4..0579b1e5718b 100644
--- a/xmloff/source/transform/StyleOOoTContext.cxx
+++ b/xmloff/source/transform/StyleOOoTContext.cxx
@@ -159,8 +159,6 @@ class XMLTypedPropertiesOOoTContext_Impl : public XMLPersElemContentTContext
public:
- TYPEINFO();
-
XMLTypedPropertiesOOoTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName );
@@ -177,8 +175,6 @@ public:
virtual void Export();
};
-TYPEINIT1( XMLTypedPropertiesOOoTContext_Impl, XMLPersElemContentTContext );
-
XMLTypedPropertiesOOoTContext_Impl::XMLTypedPropertiesOOoTContext_Impl(
XMLTransformerBase& rImp,
const OUString& rQName ) :
@@ -250,8 +246,6 @@ class XMLPropertiesOOoTContext_Impl : public XMLTransformerContext
public:
- TYPEINFO();
-
XMLPropertiesOOoTContext_Impl( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
XMLPropTypes& rTypes,
@@ -276,8 +270,6 @@ public:
virtual sal_Bool IsPersistent() const;
};
-TYPEINIT1( XMLPropertiesOOoTContext_Impl, XMLTransformerContext );
-
XMLTypedPropertiesOOoTContext_Impl
*XMLPropertiesOOoTContext_Impl::GetPropContext(
XMLPropType eType )
@@ -1071,8 +1063,6 @@ sal_Bool XMLPropertiesOOoTContext_Impl::IsPersistent() const
//------------------------------------------------------------------------------
-TYPEINIT1( XMLStyleOOoTContext, XMLPersElemContentTContext );
-
XMLStyleOOoTContext::XMLStyleOOoTContext( XMLTransformerBase& rImp,
const OUString& rQName,
XMLFamilyType eT,
diff --git a/xmloff/source/transform/StyleOOoTContext.hxx b/xmloff/source/transform/StyleOOoTContext.hxx
index 24970e7f907b..8cdbf512a0a8 100644
--- a/xmloff/source/transform/StyleOOoTContext.hxx
+++ b/xmloff/source/transform/StyleOOoTContext.hxx
@@ -38,8 +38,6 @@ class XMLStyleOOoTContext : public XMLPersElemContentTContext
sal_Bool m_bPersistent;
public:
- TYPEINFO();
-
XMLStyleOOoTContext( XMLTransformerBase& rTransformer,
const ::rtl::OUString& rQName,
XMLFamilyType eType,
diff --git a/xmloff/source/transform/TransformerContext.cxx b/xmloff/source/transform/TransformerContext.cxx
index d5856d1e9c7e..a27d5312d9ca 100644
--- a/xmloff/source/transform/TransformerContext.cxx
+++ b/xmloff/source/transform/TransformerContext.cxx
@@ -42,8 +42,6 @@ using ::rtl::OUString;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-TYPEINIT0( XMLTransformerContext );
-
sal_Bool XMLTransformerContext::HasQName( sal_uInt16 nPrefix,
::xmloff::token::XMLTokenEnum eToken ) const
{
diff --git a/xmloff/source/transform/TransformerContext.hxx b/xmloff/source/transform/TransformerContext.hxx
index 0df769d1682f..2c230be47f8c 100644
--- a/xmloff/source/transform/TransformerContext.hxx
+++ b/xmloff/source/transform/TransformerContext.hxx
@@ -28,7 +28,6 @@
#include <tools/solar.h>
#include <salhelper/simplereferenceobject.hxx>
#include <rtl/ustring.hxx>
-#include <tools/rtti.hxx>
#include <xmloff/xmltoken.hxx>
class SvXMLNamespaceMap;
@@ -55,8 +54,6 @@ protected:
void SetQName( const ::rtl::OUString& rQName ) { m_aQName = rQName; }
public:
- TYPEINFO();
-
const ::rtl::OUString& GetQName() const { return m_aQName; }
sal_Bool HasQName( sal_uInt16 nPrefix,
::xmloff::token::XMLTokenEnum eToken ) const;
diff --git a/xmlsecurity/source/dialogs/stbcontrl.cxx b/xmlsecurity/source/dialogs/stbcontrl.cxx
index fcc2b6c5c79f..d9e01d2c0f85 100644
--- a/xmlsecurity/source/dialogs/stbcontrl.cxx
+++ b/xmlsecurity/source/dialogs/stbcontrl.cxx
@@ -132,7 +132,7 @@ void XmlSecStatusBarControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
{
mpImpl->mbSigned = false;
}
- else if( pState->ISA( SfxBoolItem ) )
+ else if( dynamic_cast< const SfxBoolItem* >(pState) )
{
mpImpl->mbSigned = ( ( SfxBoolItem* ) pState )->GetValue();
}